From 7baf999bbc95bd9bb3b410c6382b907b4d5efa00 Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Sun, 2 Jan 2022 10:57:04 +0100 Subject: [PATCH] Built motion from commit c102fb6e.|2.5.44 --- 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 +- .../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 +- .../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 +- 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/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/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.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/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/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1169 files changed, 1169 insertions(+), 1169 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 355cc39..2b54b55 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-01-02T09:23:06.084Z", + "time": "2022-01-02T09:48:23.191Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c0b3793..bdec861 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-02T09:23:06.084Z", + "time": "2022-01-02T09:48:23.191Z", "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 553b837..46cf098 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 _0xb748=['exports','VIRTUAL','getDataValue','STRING','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb748,0xd7));var _0x8b74=function(_0x35f726,_0x112fc7){_0x35f726=_0x35f726-0x0;var _0x2b8a8f=_0xb748[_0x35f726];return _0x2b8a8f;};'use strict';var Sequelize=require(_0x8b74('0x0'));module[_0x8b74('0x1')]={'name':{'type':Sequelize[_0x8b74('0x2')],'get':function(_0x5e063a){return this[_0x8b74('0x3')]('action');}},'action':{'type':Sequelize[_0x8b74('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x8b74('0x5'),_0x8b74('0x6'),_0x8b74('0x7'),_0x8b74('0x8'),'bot',_0x8b74('0x9')]],'msg':_0x8b74('0xa')}},'comment':_0x8b74('0xa')},'data1':{'type':Sequelize[_0x8b74('0x4')](0x1000),'comment':_0x8b74('0xb')},'data2':{'type':Sequelize[_0x8b74('0x4')](0x1000),'comment':_0x8b74('0xc')},'data3':{'type':Sequelize[_0x8b74('0x4')](0x1000),'comment':_0x8b74('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8b74('0xe')},'data5':{'type':Sequelize[_0x8b74('0x4')](0x1000),'comments':_0x8b74('0xf')},'data6':{'type':Sequelize[_0x8b74('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8b74('0x10')],'comments':_0x8b74('0x11')}}; \ No newline at end of file +var _0x6578=['contactManager','jscripty','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x6578,0xdc));var _0x8657=function(_0x2e67af,_0x476cdd){_0x2e67af=_0x2e67af-0x0;var _0x24fdd4=_0x6578[_0x2e67af];return _0x24fdd4;};'use strict';var Sequelize=require('sequelize');module[_0x8657('0x0')]={'name':{'type':Sequelize[_0x8657('0x1')],'get':function(_0x1de97a){return this[_0x8657('0x2')](_0x8657('0x3'));}},'action':{'type':Sequelize[_0x8657('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8657('0x5'),'integration','motionbar',_0x8657('0x6'),'urlForward','browser','bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x8657('0x7')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x8657('0x8')},'data2':{'type':Sequelize[_0x8657('0x4')](0x1000),'comment':_0x8657('0x9')},'data3':{'type':Sequelize[_0x8657('0x4')](0x1000),'comment':_0x8657('0xa')},'data4':{'type':Sequelize[_0x8657('0x4')](0x1000),'comments':_0x8657('0xb')},'data5':{'type':Sequelize[_0x8657('0x4')](0x1000),'comments':_0x8657('0xc')},'data6':{'type':Sequelize[_0x8657('0x4')],'comments':_0x8657('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':_0x8657('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 80edb6b..64aa3e1 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 _0xf6cb=['Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','body','params','catch','find','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xf6cb,0x65));var _0xbf6c=function(_0x13a5b6,_0x67cee7){_0x13a5b6=_0x13a5b6-0x0;var _0x547525=_0xf6cb[_0x13a5b6];return _0x547525;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf6c('0x0'));var rp=require(_0xbf6c('0x1'));var moment=require(_0xbf6c('0x2'));var BPromise=require(_0xbf6c('0x3'));var Mustache=require('mustache');var util=require(_0xbf6c('0x4'));var path=require(_0xbf6c('0x5'));var sox=require('sox');var csv=require(_0xbf6c('0x6'));var ejs=require(_0xbf6c('0x7'));var fs=require('fs');var fs_extra=require(_0xbf6c('0x8'));var _=require(_0xbf6c('0x9'));var squel=require(_0xbf6c('0xa'));var crypto=require(_0xbf6c('0xb'));var jsforce=require(_0xbf6c('0xc'));var deskjs=require(_0xbf6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbf6c('0xe'));var Papa=require(_0xbf6c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbf6c('0x10'));var hardwareService=require(_0xbf6c('0x11'));var logger=require(_0xbf6c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xbf6c('0x13'));var licenseUtil=require(_0xbf6c('0x14'));var db=require(_0xbf6c('0x15'))['db'];function respondWithStatusCode(_0x84b6fe,_0x396028){_0x396028=_0x396028||0xcc;return function(_0x27f9cc){if(_0x27f9cc){return _0x84b6fe['sendStatus'](_0x396028);}return _0x84b6fe[_0xbf6c('0x16')](_0x396028)['end']();};}function respondWithResult(_0x1412d8,_0x1d5e75){_0x1d5e75=_0x1d5e75||0xc8;return function(_0x4069cd){if(_0x4069cd){return _0x1412d8[_0xbf6c('0x16')](_0x1d5e75)[_0xbf6c('0x17')](_0x4069cd);}};}function respondWithFilteredResult(_0x1fe0cf,_0x5d5169){return function(_0x377db9){if(_0x377db9){var _0xc4515b=typeof _0x5d5169[_0xbf6c('0x18')]===_0xbf6c('0x19')&&typeof _0x5d5169[_0xbf6c('0x1a')]==='undefined';var _0x35ae9c=_0x377db9[_0xbf6c('0x1b')];var _0x31e549=_0xc4515b?0x0:_0x5d5169[_0xbf6c('0x18')];var _0x51d48e=_0xc4515b?_0x377db9[_0xbf6c('0x1b')]:_0x5d5169[_0xbf6c('0x18')]+_0x5d5169[_0xbf6c('0x1a')];var _0x47cfa8;if(_0x51d48e>=_0x35ae9c){_0x51d48e=_0x35ae9c;_0x47cfa8=0xc8;}else{_0x47cfa8=0xce;}_0x1fe0cf[_0xbf6c('0x16')](_0x47cfa8);return _0x1fe0cf['set'](_0xbf6c('0x1c'),_0x31e549+'-'+_0x51d48e+'/'+_0x35ae9c)[_0xbf6c('0x17')](_0x377db9);}return null;};}function patchUpdates(_0x425325){return function(_0x4ba2fb){try{jsonpatch['apply'](_0x4ba2fb,_0x425325,!![]);}catch(_0x4438f0){return BPromise[_0xbf6c('0x1d')](_0x4438f0);}return _0x4ba2fb[_0xbf6c('0x1e')]();};}function saveUpdates(_0x34f590,_0x3ffbc7){return function(_0x2c1678){if(_0x2c1678){return _0x2c1678[_0xbf6c('0x1f')](_0x34f590)['then'](function(_0x2b632e){return _0x2b632e;});}return null;};}function removeEntity(_0x57fd31,_0x35c83f){return function(_0x711dca){if(_0x711dca){return _0x711dca[_0xbf6c('0x20')]()[_0xbf6c('0x21')](function(){_0x57fd31[_0xbf6c('0x16')](0xcc)[_0xbf6c('0x22')]();});}};}function handleEntityNotFound(_0x911ea7,_0x4d3e1d){return function(_0x30169b){if(!_0x30169b){_0x911ea7['sendStatus'](0x194);}return _0x30169b;};}function handleError(_0xeb681e,_0x591749){_0x591749=_0x591749||0x1f4;return function(_0x4540f4){logger[_0xbf6c('0x23')](_0x4540f4[_0xbf6c('0x24')]);if(_0x4540f4[_0xbf6c('0x25')]){delete _0x4540f4[_0xbf6c('0x25')];}_0xeb681e['status'](_0x591749)[_0xbf6c('0x26')](_0x4540f4);};}exports[_0xbf6c('0x1f')]=function(_0x2a1906,_0x2708a8){if(_0x2a1906[_0xbf6c('0x27')]['id']){delete _0x2a1906['body']['id'];}return db['Action']['find']({'where':{'id':_0x2a1906[_0xbf6c('0x28')]['id']}})[_0xbf6c('0x21')](handleEntityNotFound(_0x2708a8,null))[_0xbf6c('0x21')](saveUpdates(_0x2a1906[_0xbf6c('0x27')],null))[_0xbf6c('0x21')](respondWithResult(_0x2708a8,null))[_0xbf6c('0x29')](handleError(_0x2708a8,null));};exports[_0xbf6c('0x20')]=function(_0x5d36c9,_0x48920d){return db['Action'][_0xbf6c('0x2a')]({'where':{'id':_0x5d36c9['params']['id']}})[_0xbf6c('0x21')](handleEntityNotFound(_0x48920d,null))[_0xbf6c('0x21')](removeEntity(_0x48920d,null))[_0xbf6c('0x29')](handleError(_0x48920d,null));}; \ No newline at end of file +var _0xd504=['update','then','end','error','stack','name','send','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd504,0x73));var _0x4d50=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xd504[_0x271060];return _0x40540b;};'use strict';var emlformat=require(_0x4d50('0x0'));var rimraf=require(_0x4d50('0x1'));var zipdir=require(_0x4d50('0x2'));var jsonpatch=require(_0x4d50('0x3'));var rp=require('request-promise');var moment=require(_0x4d50('0x4'));var BPromise=require(_0x4d50('0x5'));var Mustache=require(_0x4d50('0x6'));var util=require('util');var path=require(_0x4d50('0x7'));var sox=require(_0x4d50('0x8'));var csv=require(_0x4d50('0x9'));var ejs=require(_0x4d50('0xa'));var fs=require('fs');var fs_extra=require(_0x4d50('0xb'));var _=require(_0x4d50('0xc'));var squel=require(_0x4d50('0xd'));var crypto=require(_0x4d50('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4d50('0xf'));var toCsv=require(_0x4d50('0x9'));var querystring=require('querystring');var Papa=require(_0x4d50('0x10'));var Redis=require(_0x4d50('0x11'));var authService=require(_0x4d50('0x12'));var qs=require(_0x4d50('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d50('0x14'));var logger=require('../../config/logger')(_0x4d50('0x15'));var utils=require(_0x4d50('0x16'));var config=require(_0x4d50('0x17'));var licenseUtil=require(_0x4d50('0x18'));var db=require(_0x4d50('0x19'))['db'];function respondWithStatusCode(_0x4c3aa6,_0x5c7f55){_0x5c7f55=_0x5c7f55||0xcc;return function(_0x15d7d6){if(_0x15d7d6){return _0x4c3aa6[_0x4d50('0x1a')](_0x5c7f55);}return _0x4c3aa6[_0x4d50('0x1b')](_0x5c7f55)['end']();};}function respondWithResult(_0x59b459,_0x112af5){_0x112af5=_0x112af5||0xc8;return function(_0x441915){if(_0x441915){return _0x59b459[_0x4d50('0x1b')](_0x112af5)['json'](_0x441915);}};}function respondWithFilteredResult(_0x27ea62,_0x37167c){return function(_0x54e365){if(_0x54e365){var _0x4bd1a2=typeof _0x37167c[_0x4d50('0x1c')]===_0x4d50('0x1d')&&typeof _0x37167c[_0x4d50('0x1e')]===_0x4d50('0x1d');var _0x24c7d7=_0x54e365[_0x4d50('0x1f')];var _0xf91302=_0x4bd1a2?0x0:_0x37167c[_0x4d50('0x1c')];var _0xb2210=_0x4bd1a2?_0x54e365[_0x4d50('0x1f')]:_0x37167c['offset']+_0x37167c[_0x4d50('0x1e')];var _0x4921b1;if(_0xb2210>=_0x24c7d7){_0xb2210=_0x24c7d7;_0x4921b1=0xc8;}else{_0x4921b1=0xce;}_0x27ea62[_0x4d50('0x1b')](_0x4921b1);return _0x27ea62[_0x4d50('0x20')](_0x4d50('0x21'),_0xf91302+'-'+_0xb2210+'/'+_0x24c7d7)[_0x4d50('0x22')](_0x54e365);}return null;};}function patchUpdates(_0x533c4e){return function(_0x1b55ac){try{jsonpatch[_0x4d50('0x23')](_0x1b55ac,_0x533c4e,!![]);}catch(_0x5d257b){return BPromise[_0x4d50('0x24')](_0x5d257b);}return _0x1b55ac[_0x4d50('0x25')]();};}function saveUpdates(_0x482a2e,_0x56e6f7){return function(_0x2bc40b){if(_0x2bc40b){return _0x2bc40b[_0x4d50('0x26')](_0x482a2e)[_0x4d50('0x27')](function(_0x4fc4a3){return _0x4fc4a3;});}return null;};}function removeEntity(_0x253993,_0x5c8cd6){return function(_0x340c73){if(_0x340c73){return _0x340c73['destroy']()[_0x4d50('0x27')](function(){_0x253993[_0x4d50('0x1b')](0xcc)[_0x4d50('0x28')]();});}};}function handleEntityNotFound(_0x420689,_0x42fd4f){return function(_0x3dcbc2){if(!_0x3dcbc2){_0x420689[_0x4d50('0x1a')](0x194);}return _0x3dcbc2;};}function handleError(_0x3929a0,_0x430ae5){_0x430ae5=_0x430ae5||0x1f4;return function(_0xfadb4d){logger[_0x4d50('0x29')](_0xfadb4d[_0x4d50('0x2a')]);if(_0xfadb4d[_0x4d50('0x2b')]){delete _0xfadb4d[_0x4d50('0x2b')];}_0x3929a0['status'](_0x430ae5)[_0x4d50('0x2c')](_0xfadb4d);};}exports[_0x4d50('0x26')]=function(_0x398889,_0x4274ba){if(_0x398889[_0x4d50('0x2d')]['id']){delete _0x398889[_0x4d50('0x2d')]['id'];}return db[_0x4d50('0x2e')][_0x4d50('0x2f')]({'where':{'id':_0x398889[_0x4d50('0x30')]['id']}})[_0x4d50('0x27')](handleEntityNotFound(_0x4274ba,null))[_0x4d50('0x27')](saveUpdates(_0x398889['body'],null))[_0x4d50('0x27')](respondWithResult(_0x4274ba,null))[_0x4d50('0x31')](handleError(_0x4274ba,null));};exports[_0x4d50('0x32')]=function(_0x134cd4,_0x58f5e1){return db[_0x4d50('0x2e')][_0x4d50('0x2f')]({'where':{'id':_0x134cd4[_0x4d50('0x30')]['id']}})[_0x4d50('0x27')](handleEntityNotFound(_0x58f5e1,null))['then'](removeEntity(_0x58f5e1,null))[_0x4d50('0x31')](handleError(_0x58f5e1,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 08de77b..46c2962 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 _0x43c1=['rimraf','./action.attributes','exports','define','tools_actions','lodash','util','moment'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0x43c1,0x105));var _0x143c=function(_0x312976,_0x1d65a9){_0x312976=_0x312976-0x0;var _0x1f4a25=_0x43c1[_0x312976];return _0x1f4a25;};'use strict';var _=require(_0x143c('0x0'));var util=require(_0x143c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x143c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x143c('0x3'));var config=require('../../config/environment');var attributes=require(_0x143c('0x4'));module[_0x143c('0x5')]=function(_0x22de30,_0x165b7d){return _0x22de30[_0x143c('0x6')]('Action',attributes,{'tableName':_0x143c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7aa=['request-promise','path','rimraf','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7aa,0x1c1));var _0xad7a=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xd7aa[_0x10291b];return _0x1d5fbe;};'use strict';var _=require(_0xad7a('0x0'));var util=require(_0xad7a('0x1'));var logger=require(_0xad7a('0x2'))(_0xad7a('0x3'));var moment=require(_0xad7a('0x4'));var BPromise=require(_0xad7a('0x5'));var rp=require(_0xad7a('0x6'));var fs=require('fs');var path=require(_0xad7a('0x7'));var rimraf=require(_0xad7a('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xad7a('0x9')]=function(_0x4f868a,_0x4003ee){return _0x4f868a[_0xad7a('0xa')](_0xad7a('0xb'),attributes,{'tableName':_0xad7a('0xc'),'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 23cc888..a6664e7 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x814b,0x1a2));var _0xb814=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x814b[_0x4ca288];return _0x2362c1;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x8ec426,_0x1ae706){var _0x31a31b=function(_0x3fbbe8){while(--_0x3fbbe8){_0x8ec426['push'](_0x8ec426['shift']());}};_0x31a31b(++_0x1ae706);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 65b4345..2d3eed5 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 _0x36a7=['../../config/environment','./action.controller','isAuthenticated','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x45ee5f,_0x2b7af4){var _0x5be202=function(_0x4c8c8e){while(--_0x4c8c8e){_0x45ee5f['push'](_0x45ee5f['shift']());}};_0x5be202(++_0x2b7af4);}(_0x36a7,0x84));var _0x736a=function(_0x320713,_0x3edea3){_0x320713=_0x320713-0x0;var _0x352457=_0x36a7[_0x320713];return _0x352457;};'use strict';var multer=require(_0x736a('0x0'));var util=require(_0x736a('0x1'));var path=require(_0x736a('0x2'));var timeout=require(_0x736a('0x3'));var express=require(_0x736a('0x4'));var router=express[_0x736a('0x5')]();var fs_extra=require(_0x736a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x736a('0x7'));var config=require(_0x736a('0x8'));var controller=require(_0x736a('0x9'));router['put']('/:id',auth[_0x736a('0xa')](),controller[_0x736a('0xb')]);router['delete'](_0x736a('0xc'),auth['isAuthenticated'](),controller[_0x736a('0xd')]);module['exports']=router; \ No newline at end of file +var _0x184d=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x35bbe4,_0x187e41){var _0x1781be=function(_0x17cf77){while(--_0x17cf77){_0x35bbe4['push'](_0x35bbe4['shift']());}};_0x1781be(++_0x187e41);}(_0x184d,0xca));var _0xd184=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x184d[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0xd184('0x0'));var path=require(_0xd184('0x1'));var timeout=require(_0xd184('0x2'));var express=require(_0xd184('0x3'));var router=express[_0xd184('0x4')]();var fs_extra=require(_0xd184('0x5'));var auth=require(_0xd184('0x6'));var interaction=require(_0xd184('0x7'));var config=require(_0xd184('0x8'));var controller=require(_0xd184('0x9'));router[_0xd184('0xa')](_0xd184('0xb'),auth[_0xd184('0xc')](),controller[_0xd184('0xd')]);router[_0xd184('0xe')](_0xd184('0xb'),auth[_0xd184('0xc')](),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 c5543d3..69d8577 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x4389a8,_0x3d4375){var _0x4e2cea=function(_0xfd0b6d){while(--_0xfd0b6d){_0x4389a8['push'](_0x4389a8['shift']());}};_0x4e2cea(++_0x3d4375);}(_0x6f47,0xc7));var _0x76f4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6f47[_0x3ab9ee];return _0x82ee88;};'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 _0x5d58=['TEXT','STRING'];(function(_0x59b5ec,_0xb8a65c){var _0x48aa15=function(_0x39f200){while(--_0x39f200){_0x59b5ec['push'](_0x59b5ec['shift']());}};_0x48aa15(++_0xb8a65c);}(_0x5d58,0x187));var _0x85d5=function(_0x5f0ffd,_0x5aee14){_0x5f0ffd=_0x5f0ffd-0x0;var _0x3e5c7c=_0x5d58[_0x5f0ffd];return _0x3e5c7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2d87532..4eddfa1 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 _0x74ec=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','AnalyticCustomReport','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','field','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(DISTINCT\x20%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','groupBy','alias','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','../../components/export/','savename','countTable','COUNT(*)','runReport','MAX(%s)','SELECT','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x74ec,0x1de));var _0xc74e=function(_0x1a08c9,_0x289332){_0x1a08c9=_0x1a08c9-0x0;var _0x169206=_0x74ec[_0x1a08c9];return _0x169206;};'use strict';var emlformat=require(_0xc74e('0x0'));var rimraf=require(_0xc74e('0x1'));var zipdir=require(_0xc74e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc74e('0x3'));var moment=require(_0xc74e('0x4'));var BPromise=require(_0xc74e('0x5'));var Mustache=require(_0xc74e('0x6'));var util=require(_0xc74e('0x7'));var path=require(_0xc74e('0x8'));var sox=require(_0xc74e('0x9'));var csv=require(_0xc74e('0xa'));var ejs=require(_0xc74e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc74e('0xc'));var crypto=require(_0xc74e('0xd'));var jsforce=require(_0xc74e('0xe'));var deskjs=require(_0xc74e('0xf'));var toCsv=require(_0xc74e('0xa'));var querystring=require(_0xc74e('0x10'));var Papa=require(_0xc74e('0x11'));var Redis=require(_0xc74e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc74e('0x13'));var as=require(_0xc74e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc74e('0x15'))(_0xc74e('0x16'));var utils=require('../../config/utils');var config=require(_0xc74e('0x17'));var licenseUtil=require(_0xc74e('0x18'));var db=require(_0xc74e('0x19'))['db'];var dbH=require(_0xc74e('0x19'))['dbH'];function respondWithStatusCode(_0x144ba9,_0x4ee80d){_0x4ee80d=_0x4ee80d||0xcc;return function(_0x51a1d9){if(_0x51a1d9){return _0x144ba9[_0xc74e('0x1a')](_0x4ee80d);}return _0x144ba9[_0xc74e('0x1b')](_0x4ee80d)['end']();};}function respondWithResult(_0x498ecd,_0x5ce554){_0x5ce554=_0x5ce554||0xc8;return function(_0x33ba5e){if(_0x33ba5e){return _0x498ecd[_0xc74e('0x1b')](_0x5ce554)['json'](_0x33ba5e);}};}function respondWithFilteredResult(_0x28c014,_0xc9fd18){return function(_0x1976eb){if(_0x1976eb){var _0x3107e2=typeof _0xc9fd18[_0xc74e('0x1c')]===_0xc74e('0x1d')&&typeof _0xc9fd18[_0xc74e('0x1e')]==='undefined';var _0x397e28=_0x1976eb['count'];var _0x176b3f=_0x3107e2?0x0:_0xc9fd18[_0xc74e('0x1c')];var _0xd8af5f=_0x3107e2?_0x1976eb['count']:_0xc9fd18[_0xc74e('0x1c')]+_0xc9fd18['limit'];var _0x361bad;if(_0xd8af5f>=_0x397e28){_0xd8af5f=_0x397e28;_0x361bad=0xc8;}else{_0x361bad=0xce;}_0x28c014[_0xc74e('0x1b')](_0x361bad);return _0x28c014[_0xc74e('0x1f')](_0xc74e('0x20'),_0x176b3f+'-'+_0xd8af5f+'/'+_0x397e28)[_0xc74e('0x21')](_0x1976eb);}return null;};}function patchUpdates(_0xb8b3a4){return function(_0xd4414f){try{jsonpatch['apply'](_0xd4414f,_0xb8b3a4,!![]);}catch(_0x868e4e){return BPromise[_0xc74e('0x22')](_0x868e4e);}return _0xd4414f[_0xc74e('0x23')]();};}function saveUpdates(_0x4891d0,_0x27dbaa){return function(_0x4af1de){if(_0x4af1de){return _0x4af1de[_0xc74e('0x24')](_0x4891d0)[_0xc74e('0x25')](function(_0x575a80){return _0x575a80;});}return null;};}function removeEntity(_0x2ac582,_0x16a9ea){return function(_0x320d90){if(_0x320d90){return _0x320d90[_0xc74e('0x26')]()['then'](function(){var _0x5e51cc=_0x320d90[_0xc74e('0x27')]({'plain':!![]});var _0x5e6611=_0xc74e('0x28');return db[_0xc74e('0x29')]['destroy']({'where':{'type':_0x5e6611,'resourceId':_0x5e51cc['id']}})[_0xc74e('0x25')](function(){return _0x320d90;});})[_0xc74e('0x25')](function(){_0x2ac582['status'](0xcc)[_0xc74e('0x2a')]();});}};}function handleEntityNotFound(_0x24d265,_0x7e0fe0){return function(_0x5f5edc){if(!_0x5f5edc){_0x24d265[_0xc74e('0x1a')](0x194);}return _0x5f5edc;};}function handleError(_0xd221b0,_0x5b5185){_0x5b5185=_0x5b5185||0x1f4;return function(_0x1fba69){logger[_0xc74e('0x2b')](_0x1fba69[_0xc74e('0x2c')]);if(_0x1fba69['name']){delete _0x1fba69[_0xc74e('0x2d')];}_0xd221b0[_0xc74e('0x1b')](_0x5b5185)[_0xc74e('0x2e')](_0x1fba69);};}exports[_0xc74e('0x2f')]=function(_0x62176f,_0x5a1967){var _0x1c37f4={},_0x37e630={},_0x2aeb3f={'count':0x0,'rows':[]};var _0x1f2954=_['map'](db[_0xc74e('0x30')]['rawAttributes'],function(_0x4c8ad){return{'name':_0x4c8ad[_0xc74e('0x31')],'type':_0x4c8ad[_0xc74e('0x32')]['key']};});_0x37e630[_0xc74e('0x33')]=_[_0xc74e('0x34')](_0x1f2954,'name');_0x37e630[_0xc74e('0x35')]=_[_0xc74e('0x36')](_0x62176f['query']);_0x37e630['filters']=_[_0xc74e('0x37')](_0x37e630[_0xc74e('0x33')],_0x37e630[_0xc74e('0x35')]);_0x1c37f4[_0xc74e('0x38')]=_[_0xc74e('0x37')](_0x37e630[_0xc74e('0x33')],qs[_0xc74e('0x39')](_0x62176f['query']['fields']));_0x1c37f4[_0xc74e('0x38')]=_0x1c37f4[_0xc74e('0x38')][_0xc74e('0x3a')]?_0x1c37f4[_0xc74e('0x38')]:_0x37e630[_0xc74e('0x33')];if(!_0x62176f[_0xc74e('0x35')][_0xc74e('0x3b')](_0xc74e('0x3c'))){_0x1c37f4[_0xc74e('0x1e')]=qs[_0xc74e('0x1e')](_0x62176f[_0xc74e('0x35')][_0xc74e('0x1e')]);_0x1c37f4['offset']=qs[_0xc74e('0x1c')](_0x62176f['query'][_0xc74e('0x1c')]);}_0x1c37f4[_0xc74e('0x3d')]=qs[_0xc74e('0x3e')](_0x62176f[_0xc74e('0x35')]['sort']);_0x1c37f4['where']=qs[_0xc74e('0x3f')](_[_0xc74e('0x40')](_0x62176f[_0xc74e('0x35')],_0x37e630[_0xc74e('0x3f')]),_0x1f2954);if(_0x62176f[_0xc74e('0x35')][_0xc74e('0x41')]){_0x1c37f4[_0xc74e('0x42')]=_[_0xc74e('0x43')](_0x1c37f4[_0xc74e('0x42')],{'$or':_[_0xc74e('0x34')](_0x1f2954,function(_0x7a79b7){if(_0x7a79b7[_0xc74e('0x32')]!==_0xc74e('0x44')){var _0x9f6266={};_0x9f6266[_0x7a79b7['name']]={'$like':'%'+_0x62176f['query'][_0xc74e('0x41')]+'%'};return _0x9f6266;}})});}_0x1c37f4=_['merge']({},_0x1c37f4,_0x62176f['options']);var _0x30ee28={'where':_0x1c37f4['where']};return db['AnalyticCustomReport'][_0xc74e('0x45')](_0x30ee28)['then'](function(_0x4a079b){_0x2aeb3f[_0xc74e('0x45')]=_0x4a079b;if(_0x62176f[_0xc74e('0x35')][_0xc74e('0x46')]){_0x1c37f4[_0xc74e('0x47')]=[{'all':!![]}];}return db[_0xc74e('0x30')][_0xc74e('0x48')](_0x1c37f4);})[_0xc74e('0x25')](function(_0x6bd058){_0x2aeb3f[_0xc74e('0x49')]=_0x6bd058;return _0x2aeb3f;})[_0xc74e('0x25')](respondWithFilteredResult(_0x5a1967,_0x1c37f4))[_0xc74e('0x4a')](handleError(_0x5a1967,null));};exports[_0xc74e('0x4b')]=function(_0x2697dc,_0x56e378){var _0x4cc0af={'raw':![],'where':{'id':_0x2697dc[_0xc74e('0x4c')]['id']}},_0x4e4aed={};_0x4e4aed['model']=_[_0xc74e('0x36')](db[_0xc74e('0x30')][_0xc74e('0x4d')]);_0x4e4aed[_0xc74e('0x35')]=_[_0xc74e('0x36')](_0x2697dc['query']);_0x4e4aed[_0xc74e('0x3f')]=_[_0xc74e('0x37')](_0x4e4aed['model'],_0x4e4aed[_0xc74e('0x35')]);_0x4cc0af[_0xc74e('0x38')]=_[_0xc74e('0x37')](_0x4e4aed['model'],qs[_0xc74e('0x39')](_0x2697dc[_0xc74e('0x35')][_0xc74e('0x39')]));_0x4cc0af['attributes']=_0x4cc0af[_0xc74e('0x38')]['length']?_0x4cc0af[_0xc74e('0x38')]:_0x4e4aed[_0xc74e('0x33')];if(_0x2697dc['query'][_0xc74e('0x46')]){_0x4cc0af[_0xc74e('0x47')]=[{'all':!![]}];}_0x4cc0af=_[_0xc74e('0x43')]({},_0x4cc0af,_0x2697dc[_0xc74e('0x4e')]);return db['AnalyticCustomReport']['find'](_0x4cc0af)[_0xc74e('0x25')](handleEntityNotFound(_0x56e378,null))['then'](respondWithResult(_0x56e378,null))[_0xc74e('0x4a')](handleError(_0x56e378,null));};exports['create']=function(_0x5f1732,_0x364f43){return db[_0xc74e('0x30')]['create'](_0x5f1732['body'],{})['then'](function(_0x300614){var _0x1d1cc6=_0x5f1732[_0xc74e('0x4f')][_0xc74e('0x27')]({'plain':!![]});if(!_0x1d1cc6)throw new Error(_0xc74e('0x50'));if(_0x1d1cc6['role']==='user'){var _0x2cb41c=_0x300614[_0xc74e('0x27')]({'plain':!![]});var _0x367b0b='Reports';return db['UserProfileSection'][_0xc74e('0x51')]({'where':{'name':_0x367b0b,'userProfileId':_0x1d1cc6[_0xc74e('0x52')]},'raw':!![]})[_0xc74e('0x25')](function(_0x44007f){if(_0x44007f&&_0x44007f[_0xc74e('0x53')]===0x0){return db[_0xc74e('0x29')][_0xc74e('0x54')]({'name':_0x2cb41c[_0xc74e('0x2d')],'resourceId':_0x2cb41c['id'],'type':_0xc74e('0x28'),'sectionId':_0x44007f['id']},{})['then'](function(){return _0x300614;});}else{return _0x300614;}})[_0xc74e('0x4a')](function(_0x5d06c3){logger['error'](_0xc74e('0x55'),_0x5d06c3);throw _0x5d06c3;});}return _0x300614;})[_0xc74e('0x25')](respondWithResult(_0x364f43,0xc9))[_0xc74e('0x4a')](handleError(_0x364f43,null));};exports[_0xc74e('0x24')]=function(_0x522b76,_0x4c784a){if(_0x522b76[_0xc74e('0x56')]['id']){delete _0x522b76[_0xc74e('0x56')]['id'];}return db[_0xc74e('0x30')][_0xc74e('0x51')]({'where':{'id':_0x522b76['params']['id']}})[_0xc74e('0x25')](handleEntityNotFound(_0x4c784a,null))[_0xc74e('0x25')](saveUpdates(_0x522b76['body'],null))['then'](respondWithResult(_0x4c784a,null))[_0xc74e('0x4a')](handleError(_0x4c784a,null));};exports[_0xc74e('0x26')]=function(_0x1c1e0f,_0xcd2141){return db[_0xc74e('0x30')]['find']({'where':{'id':_0x1c1e0f['params']['id']}})[_0xc74e('0x25')](handleEntityNotFound(_0xcd2141,null))[_0xc74e('0x25')](removeEntity(_0xcd2141,null))[_0xc74e('0x4a')](handleError(_0xcd2141,null));};exports[_0xc74e('0x57')]=function(_0x3ee837,_0x3db82b){var _0x54049a=0xa;var _0x1d567f=[_0xc74e('0x58'),_0xc74e('0x59'),_0xc74e('0x5a'),_0xc74e('0x5b')];var _0x172f4d={'SUM':_0xc74e('0x5c'),'COUNT':_0xc74e('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc74e('0x5e'),'AVG':_0xc74e('0x5f'),'GROUP_CONCAT':_0xc74e('0x60'),'GROUP_CONCAT ASC':_0xc74e('0x61'),'GROUP_CONCAT DESC':_0xc74e('0x62')};var _0x5344cb={'SEC_TO_TIME':_0xc74e('0x63'),'DATE':_0xc74e('0x64'),'HOUR':_0xc74e('0x65'),'ROUND':_0xc74e('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xcc8912=function(_0x34493d){return!_[_0xc74e('0x67')]([_0xc74e('0x68'),_0xc74e('0x69'),'IS\x20EMPTY',_0xc74e('0x6a')],_0x34493d);};var _0x4e489e=function(_0x2503d8){if(!_0x2503d8||!_0x2503d8[_0xc74e('0x6b')][_0xc74e('0x3a')]){return'';}for(var _0x2f55d5='(',_0x4e8281=0x0;_0x4e8281<_0x2503d8[_0xc74e('0x6b')]['length'];_0x4e8281+=0x1){_0x4e8281>0x0&&(_0x2f55d5+='\x20'+_0x2503d8[_0xc74e('0x6c')]+'\x20');_0x2f55d5+=_0x2503d8[_0xc74e('0x6b')][_0x4e8281]['group']?_0x4e489e(_0x2503d8[_0xc74e('0x6b')][_0x4e8281][_0xc74e('0x6d')]):_0x2503d8[_0xc74e('0x6b')][_0x4e8281]['field']+'\x20'+_0x2503d8[_0xc74e('0x6b')][_0x4e8281]['condition']+(_0xcc8912(_0x2503d8['rules'][_0x4e8281][_0xc74e('0x6e')])?'\x20'+_0x2503d8[_0xc74e('0x6b')][_0x4e8281][_0xc74e('0x6f')]:'');}return _0x2f55d5+')';};var _0x3f7806={'where':{'id':_0x3ee837[_0xc74e('0x4c')]['id']}},_0x1c4478,_0x4c6d26,_0x39423f,_0x3df36b,_0x81f88f;_0x3f7806=_['merge']({},_0x3f7806,_0x3ee837[_0xc74e('0x4e')]);return db[_0xc74e('0x30')][_0xc74e('0x51')](_0x3f7806)['then'](function(_0x2397c1){if(_0x2397c1){_0x1c4478=_0x2397c1;return _0x2397c1[_0xc74e('0x70')]();}return null;})[_0xc74e('0x25')](function(_0x2234d6){if(_0x2234d6){if(!_0x2234d6[_0xc74e('0x3a')]){throw new db[(_0xc74e('0x71'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4c6d26=_0x2234d6;return db[_0xc74e('0x72')][_0xc74e('0x48')]({'raw':!![]});}return null;})[_0xc74e('0x25')](function(_0x329631){if(_0x329631){_0x39423f=_['keyBy'](_0x329631,'id');var _0x1856e3;var _0x56ed68=squel[_0xc74e('0x73')]();_0x56ed68[_0xc74e('0x74')](_0x1c4478[_0xc74e('0x75')]);for(var _0x30ce82=0x0;_0x30ce82<_0x4c6d26['length'];_0x30ce82+=0x1){_0x1856e3=_0x4c6d26[_0x30ce82][_0xc74e('0x76')]?_0x39423f[_0x4c6d26[_0x30ce82]['MetricId']][_0xc74e('0x77')]:_0x4c6d26[_0x30ce82]['field'];_0x1856e3=_0x4c6d26[_0x30ce82][_0xc74e('0x78')]?_[_0xc74e('0x79')](_0x172f4d[_0x4c6d26[_0x30ce82][_0xc74e('0x78')]],'%s',_0x1856e3):_0x1856e3;_0x1856e3=_0x4c6d26[_0x30ce82][_0xc74e('0x7a')]?_[_0xc74e('0x79')](_0x5344cb[_0x4c6d26[_0x30ce82]['format']],'%s',_0x1856e3):_0x1856e3;if(_0x4c6d26[_0x30ce82]['groupBy']){_0x56ed68['group'](_0x1856e3);}_0x4c6d26[_0x30ce82][_0xc74e('0x7b')]&&_0x56ed68['order'](_0x1856e3,_0x4c6d26[_0x30ce82][_0xc74e('0x7b')]===_0xc74e('0x7c')?![]:!![]);_0x56ed68[_0xc74e('0x7d')](_0x1856e3,_0x4c6d26[_0x30ce82]['alias']||_0x1856e3);}if(_0x1c4478[_0xc74e('0x7e')]){_0x1c4478['joins']=JSON[_0xc74e('0x7f')](_0x1c4478[_0xc74e('0x7e')]);for(var _0x89d178=0x0;_0x89d178<_0x1c4478[_0xc74e('0x7e')][_0xc74e('0x3a')];_0x89d178+=0x1){if(_0x1c4478['joins'][_0x89d178][_0xc74e('0x32')]&&_['includes'](_0x1d567f,_0x1c4478[_0xc74e('0x7e')][_0x89d178]['type'])&&_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x80')]&&_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x81')]&&_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x82')]){_0x56ed68[_0x1c4478[_0xc74e('0x7e')][_0x89d178]['type']](_0x1c4478['joins'][_0x89d178][_0xc74e('0x81')],null,util[_0xc74e('0x7a')](_0xc74e('0x83'),_0x1c4478['table'],_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x80')],_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x81')],_0x1c4478[_0xc74e('0x7e')][_0x89d178][_0xc74e('0x82')]));}}}if(_0x1c4478[_0xc74e('0x84')]){_0x1c4478[_0xc74e('0x84')]=JSON[_0xc74e('0x7f')](_0x1c4478[_0xc74e('0x84')]);_0x56ed68[_0xc74e('0x42')](_0x4e489e(_0x1c4478[_0xc74e('0x84')][_0xc74e('0x6d')]));}_0x81f88f=_0x56ed68[_0xc74e('0x85')]();_0x56ed68[_0xc74e('0x1e')](_0x54049a);_0x56ed68[_0xc74e('0x1c')](0x0);logger[_0xc74e('0x86')](_0xc74e('0x87'),_0x56ed68[_0xc74e('0x88')]());return dbH[_0xc74e('0x89')][_0xc74e('0x35')](_0x56ed68[_0xc74e('0x88')](),{'type':dbH[_0xc74e('0x89')][_0xc74e('0x8a')]['SELECT']});}})['then'](respondWithResult(_0x3db82b,null))[_0xc74e('0x4a')](handleError(_0x3db82b,null));};function runReport(_0x4f8393,_0x4a0390,_0x464b72){var _0x573e81=_0x4a0390[_0xc74e('0x2d')];var _0x569bda=0xa;var _0x4ca967=['join','left_join',_0xc74e('0x5a'),_0xc74e('0x5b')];var _0x457269={'SUM':_0xc74e('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc74e('0x8b'),'MAX':'MAX(%s)','MIN':_0xc74e('0x5e'),'AVG':_0xc74e('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc74e('0x61'),'GROUP_CONCAT DESC':_0xc74e('0x62')};var _0x5a016e={'SEC_TO_TIME':_0xc74e('0x63'),'DATE':_0xc74e('0x64'),'HOUR':'HOUR(%s)','ROUND':_0xc74e('0x66'),'UNIX_TIMESTAMP':_0xc74e('0x8c')};var _0x2ceb56=function(_0x234014){return!_[_0xc74e('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc74e('0x8d'),_0xc74e('0x6a')],_0x234014);};var _0x50d755=function(_0x18b940){if(!_0x18b940||!_0x18b940[_0xc74e('0x6b')]['length']){return'';}for(var _0x4d5624='(',_0xc5bf69=0x0;_0xc5bf69<_0x18b940[_0xc74e('0x6b')]['length'];_0xc5bf69+=0x1){_0xc5bf69>0x0&&(_0x4d5624+='\x20'+_0x18b940[_0xc74e('0x6c')]+'\x20');_0x4d5624+=_0x18b940[_0xc74e('0x6b')][_0xc5bf69][_0xc74e('0x6d')]?_0x50d755(_0x18b940[_0xc74e('0x6b')][_0xc5bf69][_0xc74e('0x6d')]):_0x18b940[_0xc74e('0x6b')][_0xc5bf69][_0xc74e('0x7d')]+'\x20'+_0x18b940[_0xc74e('0x6b')][_0xc5bf69][_0xc74e('0x6e')]+(_0x2ceb56(_0x18b940[_0xc74e('0x6b')][_0xc5bf69]['condition'])?'\x20'+_0x18b940[_0xc74e('0x6b')][_0xc5bf69]['value']:'');}return _0x4d5624+')';};var _0x547ee0={'where':{'id':_0x4f8393['id']}},_0x295935,_0x1b6b86,_0x7c14f6,_0xb88288,_0x4d11b;_0x547ee0=_[_0xc74e('0x43')]({},_0x547ee0,_0x464b72);return db[_0xc74e('0x30')][_0xc74e('0x51')](_0x547ee0)[_0xc74e('0x25')](function(_0x252824){if(_0x252824){_0x295935=_0x252824;return _0x252824[_0xc74e('0x70')]();}return null;})[_0xc74e('0x25')](function(_0x1c9c1b){if(_0x1c9c1b){if(!_0x1c9c1b['length']){throw new db[(_0xc74e('0x71'))][(_0xc74e('0x8e'))](_0xc74e('0x8f'),0x193);}_0x1b6b86=_0x1c9c1b;return db[_0xc74e('0x72')][_0xc74e('0x48')]({'raw':!![]});}return null;})[_0xc74e('0x25')](function(_0x610ed7){if(_0x610ed7){_0x7c14f6=_[_0xc74e('0x90')](_0x610ed7,'id');var _0x4cf8ca;var _0x2f4145=squel[_0xc74e('0x73')]();_0x2f4145[_0xc74e('0x74')](_0x295935['table']);for(var _0x12628b=0x0;_0x12628b<_0x1b6b86['length'];_0x12628b+=0x1){_0x4cf8ca=_0x1b6b86[_0x12628b][_0xc74e('0x76')]?_0x7c14f6[_0x1b6b86[_0x12628b]['MetricId']][_0xc74e('0x77')]:_0x1b6b86[_0x12628b][_0xc74e('0x7d')];_0x4cf8ca=_0x1b6b86[_0x12628b][_0xc74e('0x78')]?_[_0xc74e('0x79')](_0x457269[_0x1b6b86[_0x12628b][_0xc74e('0x78')]],'%s',_0x4cf8ca):_0x4cf8ca;_0x4cf8ca=_0x1b6b86[_0x12628b][_0xc74e('0x7a')]?_[_0xc74e('0x79')](_0x5a016e[_0x1b6b86[_0x12628b][_0xc74e('0x7a')]],'%s',_0x4cf8ca):_0x4cf8ca;if(_0x1b6b86[_0x12628b][_0xc74e('0x91')]){_0x2f4145[_0xc74e('0x6d')](_0x4cf8ca);}_0x1b6b86[_0x12628b][_0xc74e('0x7b')]&&_0x2f4145['order'](_0x4cf8ca,_0x1b6b86[_0x12628b]['orderBy']===_0xc74e('0x7c')?![]:!![]);_0x2f4145[_0xc74e('0x7d')](_0x4cf8ca,_0x1b6b86[_0x12628b][_0xc74e('0x92')]||_0x4cf8ca);}if(_0x295935[_0xc74e('0x7e')]){_0x295935[_0xc74e('0x7e')]=JSON[_0xc74e('0x7f')](_0x295935[_0xc74e('0x7e')]);for(var _0x265072=0x0;_0x265072<_0x295935['joins']['length'];_0x265072+=0x1){if(_0x295935[_0xc74e('0x7e')][_0x265072][_0xc74e('0x32')]&&_[_0xc74e('0x67')](_0x4ca967,_0x295935[_0xc74e('0x7e')][_0x265072]['type'])&&_0x295935[_0xc74e('0x7e')][_0x265072][_0xc74e('0x80')]&&_0x295935['joins'][_0x265072]['foreignTable']&&_0x295935[_0xc74e('0x7e')][_0x265072]['foreignKey']){_0x2f4145[_0x295935[_0xc74e('0x7e')][_0x265072]['type']](_0x295935['joins'][_0x265072][_0xc74e('0x81')],null,util['format'](_0xc74e('0x83'),_0x295935['table'],_0x295935[_0xc74e('0x7e')][_0x265072][_0xc74e('0x80')],_0x295935[_0xc74e('0x7e')][_0x265072][_0xc74e('0x81')],_0x295935[_0xc74e('0x7e')][_0x265072][_0xc74e('0x82')]));}}}if(_0x295935[_0xc74e('0x84')]){_0x295935[_0xc74e('0x84')]=JSON[_0xc74e('0x7f')](_0x295935[_0xc74e('0x84')]);_0x2f4145[_0xc74e('0x42')](_0x50d755(_0x295935[_0xc74e('0x84')][_0xc74e('0x6d')]));}_0x4d11b=_0x2f4145[_0xc74e('0x85')]();_0x2f4145['limit'](_0x569bda);_0x2f4145[_0xc74e('0x1c')](0x0);return;}})[_0xc74e('0x25')](function(){if(_0x4a0390['output']===_0xc74e('0x93')){return null;}var _0xbe3fcd=_[_0xc74e('0x43')](_0x4a0390,{'name':_0x4a0390['fullPath']||_0x4a0390[_0xc74e('0x2d')]||_0x295935[_0xc74e('0x2d')],'basename':_0x573e81,'savename':util['format'](_0xc74e('0x94'),_0x4a0390[_0xc74e('0x2d')]||_0x295935['name'],require('randomstring')[_0xc74e('0x95')](0x4),_0x4a0390[_0xc74e('0x96')]||_0xc74e('0x97')),'reportId':_0x295935['id'],'reportType':_0xc74e('0x98')});return db[_0xc74e('0x99')][_0xc74e('0x54')](_0xbe3fcd,{'raw':!![]});})[_0xc74e('0x25')](function(_0x1e33ae){if(_0x295935[_0xc74e('0x75')]===_0xc74e('0x9a')){_0x4d11b[_0xc74e('0x42')](_0x295935['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4a0390[_0xc74e('0x9b')],_0x4a0390[_0xc74e('0x9c')]);}else{_0x4d11b['where'](_0x295935[_0xc74e('0x75')]+_0xc74e('0x9d'),_0x4a0390[_0xc74e('0x9b')],_0x4a0390['endDate']);}if(_0x1e33ae){logger['info']('Run\x20Query:',_0x4d11b[_0xc74e('0x88')]());require(_0xc74e('0x9e'))['fork'](path[_0xc74e('0x58')](__dirname,_0xc74e('0x9f'),_0x1e33ae['output']),[_0x1e33ae['id'],_0x4d11b[_0xc74e('0x88')](),path[_0xc74e('0x58')](__dirname,'../../files/reports',_0x1e33ae[_0xc74e('0xa0')]),_0x573e81]);return _0x1e33ae;}else{var _0x37ac57=squel['select']();_0x37ac57[_0xc74e('0x74')]('('+_0x4d11b[_0xc74e('0x88')]()+')',_0xc74e('0xa1'));_0x37ac57[_0xc74e('0x7d')](_0xc74e('0xa2'),_0xc74e('0x45'));_0x4d11b['limit'](_0x4a0390['limit']||_0x569bda);_0x4d11b[_0xc74e('0x1c')](_0x4a0390['offset']||0x0);return dbH[_0xc74e('0x89')][_0xc74e('0x35')](_0x37ac57[_0xc74e('0x88')](),{'type':dbH[_0xc74e('0x89')][_0xc74e('0x8a')]['SELECT']})[_0xc74e('0x25')](function(_0x46fcbb){if(!_0x46fcbb[_0xc74e('0x3a')]){_0xb88288=0x0;}else{_0xb88288=_0x46fcbb[0x0]['count']||0x0;}return dbH[_0xc74e('0x89')]['query'](_0x4d11b[_0xc74e('0x88')](),{'type':dbH[_0xc74e('0x89')][_0xc74e('0x8a')]['SELECT']});})[_0xc74e('0x25')](function(_0x1409a0){return{'rows':_0x1409a0||[],'count':_0xb88288};});}});}exports['run']=function(_0x157cfa,_0x425b9e){return runReport(_0x157cfa['params'],_0x157cfa[_0xc74e('0x35')],_0x157cfa[_0xc74e('0x4e')])[_0xc74e('0x25')](respondWithResult(_0x425b9e,null))[_0xc74e('0x4a')](handleError(_0x425b9e,null));};exports[_0xc74e('0xa3')]=runReport;exports[_0xc74e('0x35')]=function(_0x21db0c,_0x284cc2){var _0x21a0d5=0xa;var _0x1ed85c=[_0xc74e('0x58'),_0xc74e('0x59'),_0xc74e('0x5a'),_0xc74e('0x5b')];var _0x5b843a={'SUM':_0xc74e('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc74e('0x8b'),'MAX':_0xc74e('0xa4'),'MIN':_0xc74e('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc74e('0x60'),'GROUP_CONCAT ASC':_0xc74e('0x61'),'GROUP_CONCAT DESC':_0xc74e('0x62')};var _0x1760a7={'SEC_TO_TIME':_0xc74e('0x63'),'DATE':_0xc74e('0x64'),'HOUR':'HOUR(%s)','ROUND':_0xc74e('0x66'),'UNIX_TIMESTAMP':_0xc74e('0x8c')};var _0x5b2ca9=function(_0x43bd47){return!_[_0xc74e('0x67')]([_0xc74e('0x68'),_0xc74e('0x69'),_0xc74e('0x8d'),_0xc74e('0x6a')],_0x43bd47);};var _0x27ccb1=function(_0x3d5113){if(!_0x3d5113||!_0x3d5113[_0xc74e('0x6b')][_0xc74e('0x3a')]){return'';}for(var _0x1372c7='(',_0x2d3fb2=0x0;_0x2d3fb2<_0x3d5113[_0xc74e('0x6b')][_0xc74e('0x3a')];_0x2d3fb2+=0x1){_0x2d3fb2>0x0&&(_0x1372c7+='\x20'+_0x3d5113[_0xc74e('0x6c')]+'\x20');_0x1372c7+=_0x3d5113[_0xc74e('0x6b')][_0x2d3fb2][_0xc74e('0x6d')]?_0x27ccb1(_0x3d5113[_0xc74e('0x6b')][_0x2d3fb2][_0xc74e('0x6d')]):_0x3d5113[_0xc74e('0x6b')][_0x2d3fb2][_0xc74e('0x7d')]+'\x20'+_0x3d5113[_0xc74e('0x6b')][_0x2d3fb2][_0xc74e('0x6e')]+(_0x5b2ca9(_0x3d5113[_0xc74e('0x6b')][_0x2d3fb2][_0xc74e('0x6e')])?'\x20'+_0x3d5113['rules'][_0x2d3fb2][_0xc74e('0x6f')]:'');}return _0x1372c7+')';};var _0x37d805={'where':{'id':_0x21db0c['params']['id']}},_0x331b45,_0x26a834,_0x3da95d,_0x2e9f7f,_0x52e8af;_0x37d805=_['merge']({},_0x37d805,_0x21db0c[_0xc74e('0x4e')]);return db['AnalyticCustomReport'][_0xc74e('0x51')](_0x37d805)['then'](function(_0x491bb0){if(_0x491bb0){_0x331b45=_0x491bb0;return _0x491bb0['getFields']();}return null;})[_0xc74e('0x25')](function(_0x3f9a6e){if(_0x3f9a6e){if(!_0x3f9a6e['length']){throw new db[(_0xc74e('0x71'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26a834=_0x3f9a6e;return db[_0xc74e('0x72')]['findAll']({'raw':!![]});}return null;})[_0xc74e('0x25')](function(_0x3fa7cc){if(_0x3fa7cc){_0x3da95d=_[_0xc74e('0x90')](_0x3fa7cc,'id');var _0x5562ff;var _0x393950=squel[_0xc74e('0x73')]();_0x393950[_0xc74e('0x74')](_0x331b45[_0xc74e('0x75')]);for(var _0x55aff5=0x0;_0x55aff5<_0x26a834[_0xc74e('0x3a')];_0x55aff5+=0x1){_0x5562ff=_0x26a834[_0x55aff5][_0xc74e('0x76')]?_0x3da95d[_0x26a834[_0x55aff5][_0xc74e('0x76')]][_0xc74e('0x77')]:_0x26a834[_0x55aff5]['field'];_0x5562ff=_0x26a834[_0x55aff5][_0xc74e('0x78')]?_['replace'](_0x5b843a[_0x26a834[_0x55aff5][_0xc74e('0x78')]],'%s',_0x5562ff):_0x5562ff;_0x5562ff=_0x26a834[_0x55aff5][_0xc74e('0x7a')]?_[_0xc74e('0x79')](_0x1760a7[_0x26a834[_0x55aff5]['format']],'%s',_0x5562ff):_0x5562ff;if(_0x26a834[_0x55aff5][_0xc74e('0x91')]){_0x393950['group'](_0x5562ff);}_0x26a834[_0x55aff5][_0xc74e('0x7b')]&&_0x393950['order'](_0x5562ff,_0x26a834[_0x55aff5]['orderBy']===_0xc74e('0x7c')?![]:!![]);_0x393950[_0xc74e('0x7d')](_0x5562ff,_0x26a834[_0x55aff5][_0xc74e('0x92')]||_0x5562ff);}if(_0x331b45['joins']){_0x331b45['joins']=JSON[_0xc74e('0x7f')](_0x331b45['joins']);for(var _0x59b83f=0x0;_0x59b83f<_0x331b45[_0xc74e('0x7e')][_0xc74e('0x3a')];_0x59b83f+=0x1){if(_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x32')]&&_[_0xc74e('0x67')](_0x1ed85c,_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x32')])&&_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x80')]&&_0x331b45[_0xc74e('0x7e')][_0x59b83f]['foreignTable']&&_0x331b45['joins'][_0x59b83f][_0xc74e('0x82')]){_0x393950[_0x331b45['joins'][_0x59b83f][_0xc74e('0x32')]](_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x81')],null,util[_0xc74e('0x7a')]('%s.%s\x20=\x20%s.%s',_0x331b45['table'],_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x80')],_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x81')],_0x331b45[_0xc74e('0x7e')][_0x59b83f][_0xc74e('0x82')]));}}}if(_0x331b45[_0xc74e('0x84')]){_0x331b45[_0xc74e('0x84')]=JSON['parse'](_0x331b45[_0xc74e('0x84')]);_0x393950[_0xc74e('0x42')](_0x27ccb1(_0x331b45['conditions'][_0xc74e('0x6d')]));}_0x52e8af=_0x393950[_0xc74e('0x85')]();_0x393950['limit'](_0x21a0d5);_0x393950['offset'](0x0);logger[_0xc74e('0x86')]('Limited\x20Query:',_0x393950['toString']());return dbH[_0xc74e('0x89')][_0xc74e('0x35')](_0x393950[_0xc74e('0x88')](),{'type':dbH[_0xc74e('0x89')][_0xc74e('0x8a')][_0xc74e('0xa5')]});}})[_0xc74e('0x25')](function(){return{'sql':_0x52e8af[_0xc74e('0x88')]()};})[_0xc74e('0x25')](respondWithResult(_0x284cc2,null))[_0xc74e('0x4a')](handleError(_0x284cc2,null));}; \ No newline at end of file +var _0x5a69=['undefined','limit','count','set','Content-Range','apply','reject','save','then','get','destroy','end','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','include','find','catch','create','body','user','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','operator','value','from','%s.%s\x20=\x20%s.%s','output','fullPath','randomstring','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','savename','countTable','COUNT(*)','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset'];(function(_0x5c8458,_0x257adb){var _0x15f646=function(_0x4c20bc){while(--_0x4c20bc){_0x5c8458['push'](_0x5c8458['shift']());}};_0x15f646(++_0x257adb);}(_0x5a69,0x1c0));var _0x95a6=function(_0x1faeb0,_0x2df832){_0x1faeb0=_0x1faeb0-0x0;var _0x5ce724=_0x5a69[_0x1faeb0];return _0x5ce724;};'use strict';var emlformat=require(_0x95a6('0x0'));var rimraf=require(_0x95a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95a6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95a6('0x3'));var Mustache=require(_0x95a6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x95a6('0x5'));var csv=require(_0x95a6('0x6'));var ejs=require(_0x95a6('0x7'));var fs=require('fs');var fs_extra=require(_0x95a6('0x8'));var _=require(_0x95a6('0x9'));var squel=require(_0x95a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x95a6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x95a6('0xc'));var Papa=require(_0x95a6('0xd'));var Redis=require(_0x95a6('0xe'));var authService=require(_0x95a6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x95a6('0x10'));var hardwareService=require(_0x95a6('0x11'));var logger=require(_0x95a6('0x12'))(_0x95a6('0x13'));var utils=require(_0x95a6('0x14'));var config=require(_0x95a6('0x15'));var licenseUtil=require(_0x95a6('0x16'));var db=require(_0x95a6('0x17'))['db'];var dbH=require('../../mysqldb')[_0x95a6('0x18')];function respondWithStatusCode(_0x4e2a2b,_0x2790f3){_0x2790f3=_0x2790f3||0xcc;return function(_0xdec26a){if(_0xdec26a){return _0x4e2a2b[_0x95a6('0x19')](_0x2790f3);}return _0x4e2a2b[_0x95a6('0x1a')](_0x2790f3)['end']();};}function respondWithResult(_0x168d7d,_0x30a2e0){_0x30a2e0=_0x30a2e0||0xc8;return function(_0x20d8ba){if(_0x20d8ba){return _0x168d7d[_0x95a6('0x1a')](_0x30a2e0)[_0x95a6('0x1b')](_0x20d8ba);}};}function respondWithFilteredResult(_0x469ac2,_0x39c067){return function(_0x4802dc){if(_0x4802dc){var _0x1f6282=typeof _0x39c067[_0x95a6('0x1c')]===_0x95a6('0x1d')&&typeof _0x39c067[_0x95a6('0x1e')]===_0x95a6('0x1d');var _0x383826=_0x4802dc[_0x95a6('0x1f')];var _0x57f3e2=_0x1f6282?0x0:_0x39c067[_0x95a6('0x1c')];var _0x17c8de=_0x1f6282?_0x4802dc[_0x95a6('0x1f')]:_0x39c067['offset']+_0x39c067['limit'];var _0x447a96;if(_0x17c8de>=_0x383826){_0x17c8de=_0x383826;_0x447a96=0xc8;}else{_0x447a96=0xce;}_0x469ac2[_0x95a6('0x1a')](_0x447a96);return _0x469ac2[_0x95a6('0x20')](_0x95a6('0x21'),_0x57f3e2+'-'+_0x17c8de+'/'+_0x383826)[_0x95a6('0x1b')](_0x4802dc);}return null;};}function patchUpdates(_0x48a43e){return function(_0x308ffe){try{jsonpatch[_0x95a6('0x22')](_0x308ffe,_0x48a43e,!![]);}catch(_0x3ca435){return BPromise[_0x95a6('0x23')](_0x3ca435);}return _0x308ffe[_0x95a6('0x24')]();};}function saveUpdates(_0x319a94,_0x3c8ad9){return function(_0x5429a3){if(_0x5429a3){return _0x5429a3['update'](_0x319a94)[_0x95a6('0x25')](function(_0x55e1d8){return _0x55e1d8;});}return null;};}function removeEntity(_0x577884,_0x59303e){return function(_0x472e56){if(_0x472e56){return _0x472e56['destroy']()['then'](function(){var _0x53740c=_0x472e56[_0x95a6('0x26')]({'plain':!![]});var _0x2ccbfd='CustomReports';return db['UserProfileResource'][_0x95a6('0x27')]({'where':{'type':_0x2ccbfd,'resourceId':_0x53740c['id']}})['then'](function(){return _0x472e56;});})[_0x95a6('0x25')](function(){_0x577884[_0x95a6('0x1a')](0xcc)[_0x95a6('0x28')]();});}};}function handleEntityNotFound(_0x18c578,_0x2907d2){return function(_0x1e1f39){if(!_0x1e1f39){_0x18c578[_0x95a6('0x19')](0x194);}return _0x1e1f39;};}function handleError(_0x16e966,_0x49ab58){_0x49ab58=_0x49ab58||0x1f4;return function(_0x13e5d7){logger[_0x95a6('0x29')](_0x13e5d7['stack']);if(_0x13e5d7['name']){delete _0x13e5d7[_0x95a6('0x2a')];}_0x16e966['status'](_0x49ab58)[_0x95a6('0x2b')](_0x13e5d7);};}exports[_0x95a6('0x2c')]=function(_0x5df6a6,_0x2e0aaa){var _0x5e14bf={},_0x4ef1c6={},_0x788561={'count':0x0,'rows':[]};var _0x3ecb70=_[_0x95a6('0x2d')](db[_0x95a6('0x2e')][_0x95a6('0x2f')],function(_0x16336d){return{'name':_0x16336d[_0x95a6('0x30')],'type':_0x16336d['type'][_0x95a6('0x31')]};});_0x4ef1c6['model']=_[_0x95a6('0x2d')](_0x3ecb70,_0x95a6('0x2a'));_0x4ef1c6[_0x95a6('0x32')]=_[_0x95a6('0x33')](_0x5df6a6[_0x95a6('0x32')]);_0x4ef1c6[_0x95a6('0x34')]=_['intersection'](_0x4ef1c6[_0x95a6('0x35')],_0x4ef1c6[_0x95a6('0x32')]);_0x5e14bf[_0x95a6('0x36')]=_[_0x95a6('0x37')](_0x4ef1c6['model'],qs[_0x95a6('0x38')](_0x5df6a6['query'][_0x95a6('0x38')]));_0x5e14bf['attributes']=_0x5e14bf[_0x95a6('0x36')][_0x95a6('0x39')]?_0x5e14bf[_0x95a6('0x36')]:_0x4ef1c6[_0x95a6('0x35')];if(!_0x5df6a6[_0x95a6('0x32')][_0x95a6('0x3a')](_0x95a6('0x3b'))){_0x5e14bf[_0x95a6('0x1e')]=qs[_0x95a6('0x1e')](_0x5df6a6[_0x95a6('0x32')][_0x95a6('0x1e')]);_0x5e14bf['offset']=qs[_0x95a6('0x1c')](_0x5df6a6[_0x95a6('0x32')]['offset']);}_0x5e14bf[_0x95a6('0x3c')]=qs['sort'](_0x5df6a6[_0x95a6('0x32')][_0x95a6('0x3d')]);_0x5e14bf[_0x95a6('0x3e')]=qs[_0x95a6('0x34')](_[_0x95a6('0x3f')](_0x5df6a6[_0x95a6('0x32')],_0x4ef1c6[_0x95a6('0x34')]),_0x3ecb70);if(_0x5df6a6[_0x95a6('0x32')][_0x95a6('0x40')]){_0x5e14bf[_0x95a6('0x3e')]=_[_0x95a6('0x41')](_0x5e14bf[_0x95a6('0x3e')],{'$or':_[_0x95a6('0x2d')](_0x3ecb70,function(_0x148579){if(_0x148579[_0x95a6('0x42')]!==_0x95a6('0x43')){var _0x2b3676={};_0x2b3676[_0x148579['name']]={'$like':'%'+_0x5df6a6[_0x95a6('0x32')][_0x95a6('0x40')]+'%'};return _0x2b3676;}})});}_0x5e14bf=_[_0x95a6('0x41')]({},_0x5e14bf,_0x5df6a6[_0x95a6('0x44')]);var _0x355e00={'where':_0x5e14bf[_0x95a6('0x3e')]};return db[_0x95a6('0x2e')][_0x95a6('0x1f')](_0x355e00)[_0x95a6('0x25')](function(_0x56a0f1){_0x788561[_0x95a6('0x1f')]=_0x56a0f1;if(_0x5df6a6[_0x95a6('0x32')]['includeAll']){_0x5e14bf['include']=[{'all':!![]}];}return db[_0x95a6('0x2e')][_0x95a6('0x45')](_0x5e14bf);})[_0x95a6('0x25')](function(_0x3fa90f){_0x788561[_0x95a6('0x46')]=_0x3fa90f;return _0x788561;})[_0x95a6('0x25')](respondWithFilteredResult(_0x2e0aaa,_0x5e14bf))['catch'](handleError(_0x2e0aaa,null));};exports[_0x95a6('0x47')]=function(_0x7a3fa,_0x210587){var _0x3ce153={'raw':![],'where':{'id':_0x7a3fa[_0x95a6('0x48')]['id']}},_0x297e7b={};_0x297e7b[_0x95a6('0x35')]=_[_0x95a6('0x33')](db[_0x95a6('0x2e')][_0x95a6('0x2f')]);_0x297e7b[_0x95a6('0x32')]=_['keys'](_0x7a3fa[_0x95a6('0x32')]);_0x297e7b[_0x95a6('0x34')]=_[_0x95a6('0x37')](_0x297e7b[_0x95a6('0x35')],_0x297e7b['query']);_0x3ce153[_0x95a6('0x36')]=_['intersection'](_0x297e7b[_0x95a6('0x35')],qs[_0x95a6('0x38')](_0x7a3fa[_0x95a6('0x32')][_0x95a6('0x38')]));_0x3ce153[_0x95a6('0x36')]=_0x3ce153[_0x95a6('0x36')]['length']?_0x3ce153[_0x95a6('0x36')]:_0x297e7b[_0x95a6('0x35')];if(_0x7a3fa[_0x95a6('0x32')]['includeAll']){_0x3ce153[_0x95a6('0x49')]=[{'all':!![]}];}_0x3ce153=_['merge']({},_0x3ce153,_0x7a3fa[_0x95a6('0x44')]);return db[_0x95a6('0x2e')][_0x95a6('0x4a')](_0x3ce153)[_0x95a6('0x25')](handleEntityNotFound(_0x210587,null))[_0x95a6('0x25')](respondWithResult(_0x210587,null))[_0x95a6('0x4b')](handleError(_0x210587,null));};exports[_0x95a6('0x4c')]=function(_0x15d4dc,_0x411693){return db['AnalyticCustomReport'][_0x95a6('0x4c')](_0x15d4dc[_0x95a6('0x4d')],{})['then'](function(_0x57f7f8){var _0x5add53=_0x15d4dc[_0x95a6('0x4e')][_0x95a6('0x26')]({'plain':!![]});if(!_0x5add53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5add53['role']===_0x95a6('0x4e')){var _0x5da805=_0x57f7f8['get']({'plain':!![]});var _0x5808d3=_0x95a6('0x4f');return db['UserProfileSection'][_0x95a6('0x4a')]({'where':{'name':_0x5808d3,'userProfileId':_0x5add53[_0x95a6('0x50')]},'raw':!![]})[_0x95a6('0x25')](function(_0x184862){if(_0x184862&&_0x184862['autoAssociation']===0x0){return db[_0x95a6('0x51')]['create']({'name':_0x5da805['name'],'resourceId':_0x5da805['id'],'type':'CustomReports','sectionId':_0x184862['id']},{})[_0x95a6('0x25')](function(){return _0x57f7f8;});}else{return _0x57f7f8;}})['catch'](function(_0x53fc64){logger['error'](_0x95a6('0x52'),_0x53fc64);throw _0x53fc64;});}return _0x57f7f8;})[_0x95a6('0x25')](respondWithResult(_0x411693,0xc9))[_0x95a6('0x4b')](handleError(_0x411693,null));};exports[_0x95a6('0x53')]=function(_0x436527,_0x4bb703){if(_0x436527['body']['id']){delete _0x436527[_0x95a6('0x4d')]['id'];}return db[_0x95a6('0x2e')][_0x95a6('0x4a')]({'where':{'id':_0x436527[_0x95a6('0x48')]['id']}})[_0x95a6('0x25')](handleEntityNotFound(_0x4bb703,null))['then'](saveUpdates(_0x436527[_0x95a6('0x4d')],null))[_0x95a6('0x25')](respondWithResult(_0x4bb703,null))[_0x95a6('0x4b')](handleError(_0x4bb703,null));};exports[_0x95a6('0x27')]=function(_0x4fc2b2,_0xe604d5){return db[_0x95a6('0x2e')][_0x95a6('0x4a')]({'where':{'id':_0x4fc2b2[_0x95a6('0x48')]['id']}})[_0x95a6('0x25')](handleEntityNotFound(_0xe604d5,null))[_0x95a6('0x25')](removeEntity(_0xe604d5,null))[_0x95a6('0x4b')](handleError(_0xe604d5,null));};exports[_0x95a6('0x54')]=function(_0x1c362e,_0x5d1fe2){var _0x3d83e9=0xa;var _0x4dddc5=[_0x95a6('0x55'),'left_join','right_join',_0x95a6('0x56')];var _0x4094b1={'SUM':_0x95a6('0x57'),'COUNT':_0x95a6('0x58'),'COUNT DISTINCT':_0x95a6('0x59'),'MAX':_0x95a6('0x5a'),'MIN':_0x95a6('0x5b'),'AVG':_0x95a6('0x5c'),'GROUP_CONCAT':_0x95a6('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x95a6('0x5e')};var _0x3004e5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x95a6('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x95a6('0x60')};var _0x10f0e7=function(_0x35b063){return!_['includes']([_0x95a6('0x61'),'IS\x20NOT\x20NULL',_0x95a6('0x62'),_0x95a6('0x63')],_0x35b063);};var _0x20d8b7=function(_0x324ea2){if(!_0x324ea2||!_0x324ea2[_0x95a6('0x64')][_0x95a6('0x39')]){return'';}for(var _0x4d0663='(',_0x7a30e2=0x0;_0x7a30e2<_0x324ea2['rules']['length'];_0x7a30e2+=0x1){_0x7a30e2>0x0&&(_0x4d0663+='\x20'+_0x324ea2['operator']+'\x20');_0x4d0663+=_0x324ea2[_0x95a6('0x64')][_0x7a30e2][_0x95a6('0x65')]?_0x20d8b7(_0x324ea2[_0x95a6('0x64')][_0x7a30e2][_0x95a6('0x65')]):_0x324ea2[_0x95a6('0x64')][_0x7a30e2][_0x95a6('0x66')]+'\x20'+_0x324ea2[_0x95a6('0x64')][_0x7a30e2][_0x95a6('0x67')]+(_0x10f0e7(_0x324ea2[_0x95a6('0x64')][_0x7a30e2][_0x95a6('0x67')])?'\x20'+_0x324ea2['rules'][_0x7a30e2]['value']:'');}return _0x4d0663+')';};var _0x375814={'where':{'id':_0x1c362e['params']['id']}},_0xbb6b33,_0x266067,_0x4529a4,_0x42ebe2,_0x3b1717;_0x375814=_[_0x95a6('0x41')]({},_0x375814,_0x1c362e[_0x95a6('0x44')]);return db[_0x95a6('0x2e')][_0x95a6('0x4a')](_0x375814)[_0x95a6('0x25')](function(_0x5c4810){if(_0x5c4810){_0xbb6b33=_0x5c4810;return _0x5c4810[_0x95a6('0x68')]();}return null;})[_0x95a6('0x25')](function(_0x5597ab){if(_0x5597ab){if(!_0x5597ab[_0x95a6('0x39')]){throw new db[(_0x95a6('0x69'))][(_0x95a6('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x266067=_0x5597ab;return db[_0x95a6('0x6b')][_0x95a6('0x45')]({'raw':!![]});}return null;})['then'](function(_0x2cc646){if(_0x2cc646){_0x4529a4=_[_0x95a6('0x6c')](_0x2cc646,'id');var _0x2d8a77;var _0x5def0c=squel[_0x95a6('0x6d')]();_0x5def0c['from'](_0xbb6b33[_0x95a6('0x6e')]);for(var _0x49dce2=0x0;_0x49dce2<_0x266067[_0x95a6('0x39')];_0x49dce2+=0x1){_0x2d8a77=_0x266067[_0x49dce2][_0x95a6('0x6f')]?_0x4529a4[_0x266067[_0x49dce2][_0x95a6('0x6f')]][_0x95a6('0x70')]:_0x266067[_0x49dce2][_0x95a6('0x66')];_0x2d8a77=_0x266067[_0x49dce2][_0x95a6('0x71')]?_[_0x95a6('0x72')](_0x4094b1[_0x266067[_0x49dce2][_0x95a6('0x71')]],'%s',_0x2d8a77):_0x2d8a77;_0x2d8a77=_0x266067[_0x49dce2][_0x95a6('0x73')]?_['replace'](_0x3004e5[_0x266067[_0x49dce2][_0x95a6('0x73')]],'%s',_0x2d8a77):_0x2d8a77;if(_0x266067[_0x49dce2][_0x95a6('0x74')]){_0x5def0c[_0x95a6('0x65')](_0x2d8a77);}_0x266067[_0x49dce2]['orderBy']&&_0x5def0c[_0x95a6('0x3c')](_0x2d8a77,_0x266067[_0x49dce2][_0x95a6('0x75')]===_0x95a6('0x76')?![]:!![]);_0x5def0c[_0x95a6('0x66')](_0x2d8a77,_0x266067[_0x49dce2][_0x95a6('0x77')]||_0x2d8a77);}if(_0xbb6b33[_0x95a6('0x78')]){_0xbb6b33[_0x95a6('0x78')]=JSON[_0x95a6('0x79')](_0xbb6b33['joins']);for(var _0x131114=0x0;_0x131114<_0xbb6b33[_0x95a6('0x78')]['length'];_0x131114+=0x1){if(_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x42')]&&_[_0x95a6('0x7a')](_0x4dddc5,_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x42')])&&_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x7b')]&&_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x7c')]&&_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x7d')]){_0x5def0c[_0xbb6b33[_0x95a6('0x78')][_0x131114]['type']](_0xbb6b33[_0x95a6('0x78')][_0x131114]['foreignTable'],null,util[_0x95a6('0x73')]('%s.%s\x20=\x20%s.%s',_0xbb6b33[_0x95a6('0x6e')],_0xbb6b33[_0x95a6('0x78')][_0x131114]['parentKey'],_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x7c')],_0xbb6b33[_0x95a6('0x78')][_0x131114][_0x95a6('0x7d')]));}}}if(_0xbb6b33['conditions']){_0xbb6b33[_0x95a6('0x7e')]=JSON[_0x95a6('0x79')](_0xbb6b33[_0x95a6('0x7e')]);_0x5def0c[_0x95a6('0x3e')](_0x20d8b7(_0xbb6b33['conditions'][_0x95a6('0x65')]));}_0x3b1717=_0x5def0c[_0x95a6('0x7f')]();_0x5def0c[_0x95a6('0x1e')](_0x3d83e9);_0x5def0c['offset'](0x0);logger[_0x95a6('0x80')](_0x95a6('0x81'),_0x5def0c[_0x95a6('0x82')]());return dbH[_0x95a6('0x83')][_0x95a6('0x32')](_0x5def0c['toString'](),{'type':dbH[_0x95a6('0x83')][_0x95a6('0x84')][_0x95a6('0x85')]});}})[_0x95a6('0x25')](respondWithResult(_0x5d1fe2,null))[_0x95a6('0x4b')](handleError(_0x5d1fe2,null));};function runReport(_0x461152,_0x3352d3,_0x2dc84d){var _0x30ecd5=_0x3352d3[_0x95a6('0x2a')];var _0x207f21=0xa;var _0x32d0b3=[_0x95a6('0x55'),_0x95a6('0x86'),'right_join','cross_join'];var _0x440862={'SUM':_0x95a6('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x95a6('0x59'),'MAX':'MAX(%s)','MIN':_0x95a6('0x5b'),'AVG':_0x95a6('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x95a6('0x87'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25bd00={'SEC_TO_TIME':_0x95a6('0x88'),'DATE':_0x95a6('0x89'),'HOUR':_0x95a6('0x5f'),'ROUND':_0x95a6('0x8a'),'UNIX_TIMESTAMP':_0x95a6('0x60')};var _0x58a95b=function(_0x3e8476){return!_[_0x95a6('0x7a')]([_0x95a6('0x61'),'IS\x20NOT\x20NULL',_0x95a6('0x62'),_0x95a6('0x63')],_0x3e8476);};var _0x2fb50f=function(_0x232ef6){if(!_0x232ef6||!_0x232ef6['rules'][_0x95a6('0x39')]){return'';}for(var _0x33b078='(',_0x5a7af5=0x0;_0x5a7af5<_0x232ef6['rules'][_0x95a6('0x39')];_0x5a7af5+=0x1){_0x5a7af5>0x0&&(_0x33b078+='\x20'+_0x232ef6[_0x95a6('0x8b')]+'\x20');_0x33b078+=_0x232ef6[_0x95a6('0x64')][_0x5a7af5][_0x95a6('0x65')]?_0x2fb50f(_0x232ef6['rules'][_0x5a7af5]['group']):_0x232ef6[_0x95a6('0x64')][_0x5a7af5]['field']+'\x20'+_0x232ef6[_0x95a6('0x64')][_0x5a7af5][_0x95a6('0x67')]+(_0x58a95b(_0x232ef6['rules'][_0x5a7af5]['condition'])?'\x20'+_0x232ef6[_0x95a6('0x64')][_0x5a7af5][_0x95a6('0x8c')]:'');}return _0x33b078+')';};var _0x4364ab={'where':{'id':_0x461152['id']}},_0x7854d0,_0x43e1fa,_0x5ead63,_0x2d8c84,_0x2cc190;_0x4364ab=_[_0x95a6('0x41')]({},_0x4364ab,_0x2dc84d);return db[_0x95a6('0x2e')][_0x95a6('0x4a')](_0x4364ab)[_0x95a6('0x25')](function(_0x3e3c1e){if(_0x3e3c1e){_0x7854d0=_0x3e3c1e;return _0x3e3c1e[_0x95a6('0x68')]();}return null;})[_0x95a6('0x25')](function(_0x3fd454){if(_0x3fd454){if(!_0x3fd454[_0x95a6('0x39')]){throw new db[(_0x95a6('0x69'))][(_0x95a6('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x43e1fa=_0x3fd454;return db[_0x95a6('0x6b')][_0x95a6('0x45')]({'raw':!![]});}return null;})['then'](function(_0x54589d){if(_0x54589d){_0x5ead63=_['keyBy'](_0x54589d,'id');var _0x52693b;var _0x2d8ba2=squel[_0x95a6('0x6d')]();_0x2d8ba2[_0x95a6('0x8d')](_0x7854d0['table']);for(var _0xb0a78=0x0;_0xb0a78<_0x43e1fa['length'];_0xb0a78+=0x1){_0x52693b=_0x43e1fa[_0xb0a78][_0x95a6('0x6f')]?_0x5ead63[_0x43e1fa[_0xb0a78][_0x95a6('0x6f')]][_0x95a6('0x70')]:_0x43e1fa[_0xb0a78][_0x95a6('0x66')];_0x52693b=_0x43e1fa[_0xb0a78]['function']?_[_0x95a6('0x72')](_0x440862[_0x43e1fa[_0xb0a78][_0x95a6('0x71')]],'%s',_0x52693b):_0x52693b;_0x52693b=_0x43e1fa[_0xb0a78][_0x95a6('0x73')]?_[_0x95a6('0x72')](_0x25bd00[_0x43e1fa[_0xb0a78]['format']],'%s',_0x52693b):_0x52693b;if(_0x43e1fa[_0xb0a78][_0x95a6('0x74')]){_0x2d8ba2[_0x95a6('0x65')](_0x52693b);}_0x43e1fa[_0xb0a78]['orderBy']&&_0x2d8ba2['order'](_0x52693b,_0x43e1fa[_0xb0a78][_0x95a6('0x75')]===_0x95a6('0x76')?![]:!![]);_0x2d8ba2[_0x95a6('0x66')](_0x52693b,_0x43e1fa[_0xb0a78][_0x95a6('0x77')]||_0x52693b);}if(_0x7854d0[_0x95a6('0x78')]){_0x7854d0[_0x95a6('0x78')]=JSON[_0x95a6('0x79')](_0x7854d0['joins']);for(var _0x18bdaa=0x0;_0x18bdaa<_0x7854d0[_0x95a6('0x78')][_0x95a6('0x39')];_0x18bdaa+=0x1){if(_0x7854d0[_0x95a6('0x78')][_0x18bdaa][_0x95a6('0x42')]&&_[_0x95a6('0x7a')](_0x32d0b3,_0x7854d0[_0x95a6('0x78')][_0x18bdaa]['type'])&&_0x7854d0['joins'][_0x18bdaa][_0x95a6('0x7b')]&&_0x7854d0[_0x95a6('0x78')][_0x18bdaa][_0x95a6('0x7c')]&&_0x7854d0[_0x95a6('0x78')][_0x18bdaa][_0x95a6('0x7d')]){_0x2d8ba2[_0x7854d0[_0x95a6('0x78')][_0x18bdaa][_0x95a6('0x42')]](_0x7854d0[_0x95a6('0x78')][_0x18bdaa]['foreignTable'],null,util[_0x95a6('0x73')](_0x95a6('0x8e'),_0x7854d0[_0x95a6('0x6e')],_0x7854d0['joins'][_0x18bdaa][_0x95a6('0x7b')],_0x7854d0['joins'][_0x18bdaa][_0x95a6('0x7c')],_0x7854d0[_0x95a6('0x78')][_0x18bdaa][_0x95a6('0x7d')]));}}}if(_0x7854d0[_0x95a6('0x7e')]){_0x7854d0['conditions']=JSON[_0x95a6('0x79')](_0x7854d0[_0x95a6('0x7e')]);_0x2d8ba2[_0x95a6('0x3e')](_0x2fb50f(_0x7854d0[_0x95a6('0x7e')][_0x95a6('0x65')]));}_0x2cc190=_0x2d8ba2[_0x95a6('0x7f')]();_0x2d8ba2['limit'](_0x207f21);_0x2d8ba2[_0x95a6('0x1c')](0x0);return;}})[_0x95a6('0x25')](function(){if(_0x3352d3[_0x95a6('0x8f')]==='web'){return null;}var _0x9ac459=_['merge'](_0x3352d3,{'name':_0x3352d3[_0x95a6('0x90')]||_0x3352d3[_0x95a6('0x2a')]||_0x7854d0[_0x95a6('0x2a')],'basename':_0x30ecd5,'savename':util[_0x95a6('0x73')]('%s-%s.%s',_0x3352d3['name']||_0x7854d0[_0x95a6('0x2a')],require(_0x95a6('0x91'))['generate'](0x4),_0x3352d3['output']||'csv'),'reportId':_0x7854d0['id'],'reportType':'custom'});return db[_0x95a6('0x92')][_0x95a6('0x4c')](_0x9ac459,{'raw':!![]});})[_0x95a6('0x25')](function(_0x3a64fb){if(_0x7854d0[_0x95a6('0x6e')]===_0x95a6('0x93')){_0x2cc190[_0x95a6('0x3e')](_0x7854d0[_0x95a6('0x6e')]+_0x95a6('0x94'),_0x3352d3[_0x95a6('0x95')],_0x3352d3[_0x95a6('0x96')]);}else{_0x2cc190['where'](_0x7854d0['table']+_0x95a6('0x97'),_0x3352d3[_0x95a6('0x95')],_0x3352d3[_0x95a6('0x96')]);}if(_0x3a64fb){logger[_0x95a6('0x98')]('Run\x20Query:',_0x2cc190[_0x95a6('0x82')]());require(_0x95a6('0x99'))['fork'](path[_0x95a6('0x55')](__dirname,'../../components/export/',_0x3a64fb['output']),[_0x3a64fb['id'],_0x2cc190['toString'](),path[_0x95a6('0x55')](__dirname,'../../files/reports',_0x3a64fb[_0x95a6('0x9a')]),_0x30ecd5]);return _0x3a64fb;}else{var _0x24d48b=squel[_0x95a6('0x6d')]();_0x24d48b['from']('('+_0x2cc190[_0x95a6('0x82')]()+')',_0x95a6('0x9b'));_0x24d48b[_0x95a6('0x66')](_0x95a6('0x9c'),_0x95a6('0x1f'));_0x2cc190[_0x95a6('0x1e')](_0x3352d3[_0x95a6('0x1e')]||_0x207f21);_0x2cc190[_0x95a6('0x1c')](_0x3352d3['offset']||0x0);return dbH[_0x95a6('0x83')]['query'](_0x24d48b['toString'](),{'type':dbH[_0x95a6('0x83')][_0x95a6('0x84')][_0x95a6('0x85')]})['then'](function(_0x2f8a78){if(!_0x2f8a78['length']){_0x2d8c84=0x0;}else{_0x2d8c84=_0x2f8a78[0x0][_0x95a6('0x1f')]||0x0;}return dbH[_0x95a6('0x83')][_0x95a6('0x32')](_0x2cc190[_0x95a6('0x82')](),{'type':dbH[_0x95a6('0x83')][_0x95a6('0x84')][_0x95a6('0x85')]});})['then'](function(_0x1de7e3){return{'rows':_0x1de7e3||[],'count':_0x2d8c84};});}});}exports['run']=function(_0x452ff2,_0x314826){return runReport(_0x452ff2[_0x95a6('0x48')],_0x452ff2[_0x95a6('0x32')],_0x452ff2[_0x95a6('0x44')])[_0x95a6('0x25')](respondWithResult(_0x314826,null))[_0x95a6('0x4b')](handleError(_0x314826,null));};exports[_0x95a6('0x9d')]=runReport;exports[_0x95a6('0x32')]=function(_0x299fd9,_0xe96fea){var _0x6c3998=0xa;var _0x42f5cc=['join','left_join','right_join',_0x95a6('0x56')];var _0x35deb7={'SUM':_0x95a6('0x57'),'COUNT':_0x95a6('0x58'),'COUNT DISTINCT':_0x95a6('0x59'),'MAX':_0x95a6('0x5a'),'MIN':_0x95a6('0x5b'),'AVG':_0x95a6('0x5c'),'GROUP_CONCAT':_0x95a6('0x5d'),'GROUP_CONCAT ASC':_0x95a6('0x87'),'GROUP_CONCAT DESC':_0x95a6('0x5e')};var _0x3f10d8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x95a6('0x5f'),'ROUND':_0x95a6('0x8a'),'UNIX_TIMESTAMP':_0x95a6('0x60')};var _0x1be96a=function(_0x37571b){return!_[_0x95a6('0x7a')]([_0x95a6('0x61'),_0x95a6('0x9e'),_0x95a6('0x62'),_0x95a6('0x63')],_0x37571b);};var _0x42d4f8=function(_0x5e75f6){if(!_0x5e75f6||!_0x5e75f6[_0x95a6('0x64')][_0x95a6('0x39')]){return'';}for(var _0x1ab12f='(',_0x4eaa45=0x0;_0x4eaa45<_0x5e75f6[_0x95a6('0x64')][_0x95a6('0x39')];_0x4eaa45+=0x1){_0x4eaa45>0x0&&(_0x1ab12f+='\x20'+_0x5e75f6['operator']+'\x20');_0x1ab12f+=_0x5e75f6['rules'][_0x4eaa45][_0x95a6('0x65')]?_0x42d4f8(_0x5e75f6['rules'][_0x4eaa45]['group']):_0x5e75f6[_0x95a6('0x64')][_0x4eaa45]['field']+'\x20'+_0x5e75f6['rules'][_0x4eaa45][_0x95a6('0x67')]+(_0x1be96a(_0x5e75f6['rules'][_0x4eaa45][_0x95a6('0x67')])?'\x20'+_0x5e75f6[_0x95a6('0x64')][_0x4eaa45][_0x95a6('0x8c')]:'');}return _0x1ab12f+')';};var _0x5e8d90={'where':{'id':_0x299fd9[_0x95a6('0x48')]['id']}},_0x7fb891,_0x472f51,_0x193ef5,_0x269056,_0x316018;_0x5e8d90=_['merge']({},_0x5e8d90,_0x299fd9[_0x95a6('0x44')]);return db[_0x95a6('0x2e')][_0x95a6('0x4a')](_0x5e8d90)[_0x95a6('0x25')](function(_0x264b70){if(_0x264b70){_0x7fb891=_0x264b70;return _0x264b70['getFields']();}return null;})[_0x95a6('0x25')](function(_0x1fb118){if(_0x1fb118){if(!_0x1fb118['length']){throw new db[(_0x95a6('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x472f51=_0x1fb118;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x95a6('0x25')](function(_0x22be44){if(_0x22be44){_0x193ef5=_[_0x95a6('0x6c')](_0x22be44,'id');var _0x5d2e11;var _0x4eeb8f=squel[_0x95a6('0x6d')]();_0x4eeb8f[_0x95a6('0x8d')](_0x7fb891[_0x95a6('0x6e')]);for(var _0x3b42a0=0x0;_0x3b42a0<_0x472f51[_0x95a6('0x39')];_0x3b42a0+=0x1){_0x5d2e11=_0x472f51[_0x3b42a0][_0x95a6('0x6f')]?_0x193ef5[_0x472f51[_0x3b42a0][_0x95a6('0x6f')]]['metric']:_0x472f51[_0x3b42a0][_0x95a6('0x66')];_0x5d2e11=_0x472f51[_0x3b42a0]['function']?_[_0x95a6('0x72')](_0x35deb7[_0x472f51[_0x3b42a0][_0x95a6('0x71')]],'%s',_0x5d2e11):_0x5d2e11;_0x5d2e11=_0x472f51[_0x3b42a0]['format']?_['replace'](_0x3f10d8[_0x472f51[_0x3b42a0][_0x95a6('0x73')]],'%s',_0x5d2e11):_0x5d2e11;if(_0x472f51[_0x3b42a0][_0x95a6('0x74')]){_0x4eeb8f['group'](_0x5d2e11);}_0x472f51[_0x3b42a0][_0x95a6('0x75')]&&_0x4eeb8f['order'](_0x5d2e11,_0x472f51[_0x3b42a0]['orderBy']===_0x95a6('0x76')?![]:!![]);_0x4eeb8f[_0x95a6('0x66')](_0x5d2e11,_0x472f51[_0x3b42a0][_0x95a6('0x77')]||_0x5d2e11);}if(_0x7fb891[_0x95a6('0x78')]){_0x7fb891[_0x95a6('0x78')]=JSON[_0x95a6('0x79')](_0x7fb891[_0x95a6('0x78')]);for(var _0x433894=0x0;_0x433894<_0x7fb891['joins'][_0x95a6('0x39')];_0x433894+=0x1){if(_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x42')]&&_[_0x95a6('0x7a')](_0x42f5cc,_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x42')])&&_0x7fb891[_0x95a6('0x78')][_0x433894]['parentKey']&&_0x7fb891[_0x95a6('0x78')][_0x433894]['foreignTable']&&_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x7d')]){_0x4eeb8f[_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x42')]](_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x7c')],null,util[_0x95a6('0x73')](_0x95a6('0x8e'),_0x7fb891[_0x95a6('0x6e')],_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x7b')],_0x7fb891[_0x95a6('0x78')][_0x433894][_0x95a6('0x7c')],_0x7fb891['joins'][_0x433894][_0x95a6('0x7d')]));}}}if(_0x7fb891[_0x95a6('0x7e')]){_0x7fb891[_0x95a6('0x7e')]=JSON['parse'](_0x7fb891[_0x95a6('0x7e')]);_0x4eeb8f[_0x95a6('0x3e')](_0x42d4f8(_0x7fb891['conditions'][_0x95a6('0x65')]));}_0x316018=_0x4eeb8f[_0x95a6('0x7f')]();_0x4eeb8f[_0x95a6('0x1e')](_0x6c3998);_0x4eeb8f['offset'](0x0);logger[_0x95a6('0x80')](_0x95a6('0x81'),_0x4eeb8f[_0x95a6('0x82')]());return dbH[_0x95a6('0x83')][_0x95a6('0x32')](_0x4eeb8f[_0x95a6('0x82')](),{'type':dbH[_0x95a6('0x83')]['QueryTypes'][_0x95a6('0x85')]});}})[_0x95a6('0x25')](function(){return{'sql':_0x316018[_0x95a6('0x82')]()};})['then'](respondWithResult(_0xe96fea,null))[_0x95a6('0x4b')](handleError(_0xe96fea,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 746efb8..69d05f9 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 _0x0b4a=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x317d79,_0x27b8c6){var _0x393bc3=function(_0x2c3072){while(--_0x2c3072){_0x317d79['push'](_0x317d79['shift']());}};_0x393bc3(++_0x27b8c6);}(_0x0b4a,0xfb));var _0xa0b4=function(_0x15d79b,_0x4a05c0){_0x15d79b=_0x15d79b-0x0;var _0xc787e5=_0x0b4a[_0x15d79b];return _0xc787e5;};'use strict';var _=require(_0xa0b4('0x0'));var util=require(_0xa0b4('0x1'));var logger=require('../../config/logger')(_0xa0b4('0x2'));var moment=require(_0xa0b4('0x3'));var BPromise=require(_0xa0b4('0x4'));var rp=require(_0xa0b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0b4('0x6'));var config=require(_0xa0b4('0x7'));var attributes=require(_0xa0b4('0x8'));module['exports']=function(_0x12bc7e,_0x2532c5){return _0x12bc7e['define']('AnalyticCustomReport',attributes,{'tableName':_0xa0b4('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1367=['moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x4d45de,_0x31d3b0){var _0x505589=function(_0xd896bb){while(--_0xd896bb){_0x4d45de['push'](_0x4d45de['shift']());}};_0x505589(++_0x31d3b0);}(_0x1367,0x1d1));var _0x7136=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x1367[_0x5d8018];return _0x151ac4;};'use strict';var _=require(_0x7136('0x0'));var util=require(_0x7136('0x1'));var logger=require(_0x7136('0x2'))('api');var moment=require(_0x7136('0x3'));var BPromise=require(_0x7136('0x4'));var rp=require(_0x7136('0x5'));var fs=require('fs');var path=require(_0x7136('0x6'));var rimraf=require('rimraf');var config=require(_0x7136('0x7'));var attributes=require(_0x7136('0x8'));module[_0x7136('0x9')]=function(_0x1249d9,_0x2aafad){return _0x1249d9[_0x7136('0xa')](_0x7136('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index d5c0cd9..38ca00a 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 _0x9b93=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3d2e3b,_0x570ed7){var _0x3e0de5=function(_0x270e1c){while(--_0x270e1c){_0x3d2e3b['push'](_0x3d2e3b['shift']());}};_0x3e0de5(++_0x570ed7);}(_0x9b93,0xe1));var _0x39b9=function(_0x21fec0,_0x2f9a99){_0x21fec0=_0x21fec0-0x0;var _0xcf272e=_0x9b93[_0x21fec0];return _0xcf272e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x39b9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39b9('0x1'));var db=require(_0x39b9('0x2'))['db'];var utils=require(_0x39b9('0x3'));var logger=require(_0x39b9('0x4'))(_0x39b9('0x5'));var config=require(_0x39b9('0x6'));var jayson=require(_0x39b9('0x7'));var client=jayson[_0x39b9('0x8')][_0x39b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ecd56,_0x11fd72,_0x2402bc){return new BPromise(function(_0x299492,_0x1fd268){return client[_0x39b9('0xa')](_0x2ecd56,_0x2402bc)[_0x39b9('0xb')](function(_0x2e76c7){logger[_0x39b9('0xc')](_0x39b9('0xd'),_0x11fd72,'request\x20sent');logger[_0x39b9('0xe')](_0x39b9('0xf'),_0x11fd72,_0x39b9('0x10'),JSON[_0x39b9('0x11')](_0x2e76c7));if(_0x2e76c7[_0x39b9('0x12')]){if(_0x2e76c7[_0x39b9('0x12')][_0x39b9('0x13')]===0x1f4){logger['error'](_0x39b9('0xd'),_0x11fd72,_0x2e76c7[_0x39b9('0x12')][_0x39b9('0x14')]);return _0x1fd268(_0x2e76c7[_0x39b9('0x12')][_0x39b9('0x14')]);}logger[_0x39b9('0x12')](_0x39b9('0xd'),_0x11fd72,_0x2e76c7['error'][_0x39b9('0x14')]);return _0x299492(_0x2e76c7[_0x39b9('0x12')][_0x39b9('0x14')]);}else{logger[_0x39b9('0xc')](_0x39b9('0xd'),_0x11fd72,_0x39b9('0x10'));_0x299492(_0x2e76c7[_0x39b9('0x15')]['message']);}})[_0x39b9('0x16')](function(_0x57674b){logger[_0x39b9('0x12')](_0x39b9('0xd'),_0x11fd72,_0x57674b);_0x1fd268(_0x57674b);});});} \ No newline at end of file +var _0xcf3b=['then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0xcf3b,0x171));var _0xbcf3=function(_0x2fbe89,_0x5c9b64){_0x2fbe89=_0x2fbe89-0x0;var _0x1bafd3=_0xcf3b[_0x2fbe89];return _0x1bafd3;};'use strict';var _=require(_0xbcf3('0x0'));var util=require('util');var moment=require(_0xbcf3('0x1'));var BPromise=require(_0xbcf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcf3('0x3'));var db=require(_0xbcf3('0x4'))['db'];var utils=require(_0xbcf3('0x5'));var logger=require(_0xbcf3('0x6'))(_0xbcf3('0x7'));var config=require(_0xbcf3('0x8'));var jayson=require(_0xbcf3('0x9'));var client=jayson[_0xbcf3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bcf1,_0x5e1433,_0x12e219){return new BPromise(function(_0x4e2434,_0x1e3418){return client['request'](_0x22bcf1,_0x12e219)[_0xbcf3('0xb')](function(_0x555e4f){logger[_0xbcf3('0xc')](_0xbcf3('0xd'),_0x5e1433,'request\x20sent');logger[_0xbcf3('0xe')](_0xbcf3('0xf'),_0x5e1433,'request\x20sent',JSON['stringify'](_0x555e4f));if(_0x555e4f['error']){if(_0x555e4f['error'][_0xbcf3('0x10')]===0x1f4){logger[_0xbcf3('0x11')](_0xbcf3('0xd'),_0x5e1433,_0x555e4f['error'][_0xbcf3('0x12')]);return _0x1e3418(_0x555e4f['error'][_0xbcf3('0x12')]);}logger[_0xbcf3('0x11')](_0xbcf3('0xd'),_0x5e1433,_0x555e4f[_0xbcf3('0x11')]['message']);return _0x4e2434(_0x555e4f[_0xbcf3('0x11')]['message']);}else{logger[_0xbcf3('0xc')](_0xbcf3('0xd'),_0x5e1433,_0xbcf3('0x13'));_0x4e2434(_0x555e4f['result']['message']);}})['catch'](function(_0x2280d8){logger[_0xbcf3('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e1433,_0x2280d8);_0x1e3418(_0x2280d8);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 41ab7d1..736ca9f 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 _0x1fb0=['../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x2c5e7a,_0x3aa9ee){var _0x549b6b=function(_0x2358d7){while(--_0x2358d7){_0x2c5e7a['push'](_0x2c5e7a['shift']());}};_0x549b6b(++_0x3aa9ee);}(_0x1fb0,0x121));var _0x01fb=function(_0x465c3b,_0x384cf1){_0x465c3b=_0x465c3b-0x0;var _0x67f5d8=_0x1fb0[_0x465c3b];return _0x67f5d8;};'use strict';var multer=require('multer');var util=require(_0x01fb('0x0'));var path=require(_0x01fb('0x1'));var timeout=require(_0x01fb('0x2'));var express=require(_0x01fb('0x3'));var router=express['Router']();var fs_extra=require(_0x01fb('0x4'));var auth=require(_0x01fb('0x5'));var interaction=require(_0x01fb('0x6'));var config=require('../../config/environment');var controller=require(_0x01fb('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x01fb('0x8')](_0x01fb('0x9'),auth[_0x01fb('0xa')](),controller['show']);router[_0x01fb('0x8')](_0x01fb('0xb'),auth[_0x01fb('0xa')](),controller[_0x01fb('0xc')]);router[_0x01fb('0x8')](_0x01fb('0xd'),auth[_0x01fb('0xa')](),controller[_0x01fb('0xe')]);router[_0x01fb('0x8')](_0x01fb('0xf'),auth[_0x01fb('0xa')](),controller[_0x01fb('0x10')]);router[_0x01fb('0x11')]('/',auth[_0x01fb('0xa')](),controller['create']);router[_0x01fb('0x12')]('/:id',auth[_0x01fb('0xa')](),controller['update']);router[_0x01fb('0x13')](_0x01fb('0x9'),auth[_0x01fb('0xa')](),controller[_0x01fb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9ef6=['update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','/:id'];(function(_0x59a98b,_0x86003){var _0x5ca8ad=function(_0xebdc09){while(--_0xebdc09){_0x59a98b['push'](_0x59a98b['shift']());}};_0x5ca8ad(++_0x86003);}(_0x9ef6,0xc9));var _0x69ef=function(_0x4e0d45,_0x55f937){_0x4e0d45=_0x4e0d45-0x0;var _0xb25758=_0x9ef6[_0x4e0d45];return _0xb25758;};'use strict';var multer=require('multer');var util=require(_0x69ef('0x0'));var path=require('path');var timeout=require(_0x69ef('0x1'));var express=require(_0x69ef('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x69ef('0x3'));var interaction=require(_0x69ef('0x4'));var config=require(_0x69ef('0x5'));var controller=require(_0x69ef('0x6'));router[_0x69ef('0x7')]('/',auth[_0x69ef('0x8')](),controller[_0x69ef('0x9')]);router[_0x69ef('0x7')]('/:id',auth[_0x69ef('0x8')](),controller[_0x69ef('0xa')]);router[_0x69ef('0x7')](_0x69ef('0xb'),auth[_0x69ef('0x8')](),controller['preview']);router['get'](_0x69ef('0xc'),auth[_0x69ef('0x8')](),controller[_0x69ef('0xd')]);router['get'](_0x69ef('0xe'),auth[_0x69ef('0x8')](),controller['query']);router[_0x69ef('0xf')]('/',auth[_0x69ef('0x8')](),controller[_0x69ef('0x10')]);router[_0x69ef('0x11')](_0x69ef('0x12'),auth[_0x69ef('0x8')](),controller[_0x69ef('0x13')]);router[_0x69ef('0x14')](_0x69ef('0x12'),auth[_0x69ef('0x8')](),controller[_0x69ef('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0abcf5f..a2abe0f 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x50adfe,_0x20cb0a){var _0x5ab9fc=function(_0x2e0ac7){while(--_0x2e0ac7){_0x50adfe['push'](_0x50adfe['shift']());}};_0x5ab9fc(++_0x20cb0a);}(_0x98a8,0x12c));var _0x898a=function(_0x4f9bad,_0x2d65d0){_0x4f9bad=_0x4f9bad-0x0;var _0xd8752a=_0x98a8[_0x4f9bad];return _0xd8752a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x4819,0xcd));var _0x9481=function(_0x4470c0,_0x5b9cd1){_0x4470c0=_0x4470c0-0x0;var _0x2c079a=_0x4819[_0x4470c0];return _0x2c079a;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2a34533..30a06d7 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x520ea2,_0x58f6fa){var _0x42b97f=function(_0x5c2c3b){while(--_0x5c2c3b){_0x520ea2['push'](_0x520ea2['shift']());}};_0x42b97f(++_0x58f6fa);}(_0x814b,0x1a2));var _0xb814=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x814b[_0x442f02];return _0xab6ef1;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file +var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x38c21f,_0x5d27a5){var _0x2e1b03=function(_0x70cc69){while(--_0x70cc69){_0x38c21f['push'](_0x38c21f['shift']());}};_0x2e1b03(++_0x5d27a5);}(_0x7a54,0x106));var _0x47a5=function(_0x2e7388,_0x30b80f){_0x2e7388=_0x2e7388-0x0;var _0x12eed7=_0x7a54[_0x2e7388];return _0x12eed7;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4cd504e..fe99eb5 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 _0x0318=['moment','bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger'];(function(_0x11dde4,_0x1d4852){var _0x6eea94=function(_0x182859){while(--_0x182859){_0x11dde4['push'](_0x11dde4['shift']());}};_0x6eea94(++_0x1d4852);}(_0x0318,0x10c));var _0x8031=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0318[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x8031('0x0'));var logger=require(_0x8031('0x1'))('api');var moment=require(_0x8031('0x2'));var BPromise=require(_0x8031('0x3'));var rp=require(_0x8031('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8031('0x5'));var config=require('../../config/environment');var attributes=require(_0x8031('0x6'));module['exports']=function(_0x47808b,_0x29e8be){return _0x47808b[_0x8031('0x7')](_0x8031('0x8'),attributes,{'tableName':_0x8031('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ed5=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment','bluebird'];(function(_0x346ce7,_0x9702f3){var _0x14363b=function(_0x2fb934){while(--_0x2fb934){_0x346ce7['push'](_0x346ce7['shift']());}};_0x14363b(++_0x9702f3);}(_0x3ed5,0x19d));var _0x53ed=function(_0x589b9b,_0x13dc02){_0x589b9b=_0x589b9b-0x0;var _0x7427d3=_0x3ed5[_0x589b9b];return _0x7427d3;};'use strict';var _=require(_0x53ed('0x0'));var util=require('util');var logger=require(_0x53ed('0x1'))(_0x53ed('0x2'));var moment=require(_0x53ed('0x3'));var BPromise=require(_0x53ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53ed('0x5'));var rimraf=require(_0x53ed('0x6'));var config=require('../../config/environment');var attributes=require(_0x53ed('0x7'));module[_0x53ed('0x8')]=function(_0x4206f3,_0x25a412){return _0x4206f3[_0x53ed('0x9')](_0x53ed('0xa'),attributes,{'tableName':'analytics_default_reports','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 fe6f751..e57a688 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 _0x4327=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x16cbca,_0x3b1ae4){var _0x4dd504=function(_0x109560){while(--_0x109560){_0x16cbca['push'](_0x16cbca['shift']());}};_0x4dd504(++_0x3b1ae4);}(_0x4327,0x16d));var _0x7432=function(_0x4f153b,_0x39818f){_0x4f153b=_0x4f153b-0x0;var _0x4e0cf8=_0x4327[_0x4f153b];return _0x4e0cf8;};'use strict';var _=require(_0x7432('0x0'));var util=require('util');var moment=require(_0x7432('0x1'));var BPromise=require(_0x7432('0x2'));var rs=require(_0x7432('0x3'));var fs=require('fs');var Redis=require(_0x7432('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7432('0x5'));var logger=require(_0x7432('0x6'))(_0x7432('0x7'));var config=require(_0x7432('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7432('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c48c6,_0x43d59e,_0xc1abc4){return new BPromise(function(_0x5de984,_0x243008){return client['request'](_0x1c48c6,_0xc1abc4)[_0x7432('0xa')](function(_0x2142a3){logger[_0x7432('0xb')](_0x7432('0xc'),_0x43d59e,_0x7432('0xd'));logger['debug'](_0x7432('0xe'),_0x43d59e,_0x7432('0xd'),JSON[_0x7432('0xf')](_0x2142a3));if(_0x2142a3[_0x7432('0x10')]){if(_0x2142a3['error'][_0x7432('0x11')]===0x1f4){logger[_0x7432('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x43d59e,_0x2142a3['error'][_0x7432('0x12')]);return _0x243008(_0x2142a3[_0x7432('0x10')]['message']);}logger['error'](_0x7432('0xc'),_0x43d59e,_0x2142a3[_0x7432('0x10')]['message']);return _0x5de984(_0x2142a3['error']['message']);}else{logger[_0x7432('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x43d59e,'request\x20sent');_0x5de984(_0x2142a3[_0x7432('0x13')][_0x7432('0x12')]);}})[_0x7432('0x14')](function(_0x1590a2){logger['error'](_0x7432('0xc'),_0x43d59e,_0x1590a2);_0x243008(_0x1590a2);});});} \ No newline at end of file +var _0xddcf=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x506a60,_0x46793f){var _0x4d12df=function(_0x27b10b){while(--_0x27b10b){_0x506a60['push'](_0x506a60['shift']());}};_0x4d12df(++_0x46793f);}(_0xddcf,0x161));var _0xfddc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xddcf[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xfddc('0x0'));var util=require('util');var moment=require(_0xfddc('0x1'));var BPromise=require(_0xfddc('0x2'));var rs=require(_0xfddc('0x3'));var fs=require('fs');var Redis=require(_0xfddc('0x4'));var db=require(_0xfddc('0x5'))['db'];var utils=require(_0xfddc('0x6'));var logger=require(_0xfddc('0x7'))('rpc');var config=require(_0xfddc('0x8'));var jayson=require(_0xfddc('0x9'));var client=jayson[_0xfddc('0xa')][_0xfddc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x242866,_0xe1c73b,_0x5cd490){return new BPromise(function(_0x56d37d,_0x3c7302){return client[_0xfddc('0xc')](_0x242866,_0x5cd490)[_0xfddc('0xd')](function(_0xaf1670){logger[_0xfddc('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe1c73b,_0xfddc('0xf'));logger[_0xfddc('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xe1c73b,_0xfddc('0xf'),JSON[_0xfddc('0x11')](_0xaf1670));if(_0xaf1670[_0xfddc('0x12')]){if(_0xaf1670[_0xfddc('0x12')][_0xfddc('0x13')]===0x1f4){logger[_0xfddc('0x12')](_0xfddc('0x14'),_0xe1c73b,_0xaf1670[_0xfddc('0x12')][_0xfddc('0x15')]);return _0x3c7302(_0xaf1670[_0xfddc('0x12')][_0xfddc('0x15')]);}logger[_0xfddc('0x12')](_0xfddc('0x14'),_0xe1c73b,_0xaf1670['error'][_0xfddc('0x15')]);return _0x56d37d(_0xaf1670['error'][_0xfddc('0x15')]);}else{logger[_0xfddc('0xe')](_0xfddc('0x14'),_0xe1c73b,'request\x20sent');_0x56d37d(_0xaf1670[_0xfddc('0x16')][_0xfddc('0x15')]);}})[_0xfddc('0x17')](function(_0x4d5758){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xe1c73b,_0x4d5758);_0x3c7302(_0x4d5758);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 57804fc..c98a010 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 _0x2323=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd39dd9,_0x1be5e3){var _0x24f2e2=function(_0x3824d9){while(--_0x3824d9){_0xd39dd9['push'](_0xd39dd9['shift']());}};_0x24f2e2(++_0x1be5e3);}(_0x2323,0x7f));var _0x3232=function(_0x5aec6f,_0x597ce5){_0x5aec6f=_0x5aec6f-0x0;var _0x55fa01=_0x2323[_0x5aec6f];return _0x55fa01;};'use strict';var multer=require(_0x3232('0x0'));var util=require('util');var path=require(_0x3232('0x1'));var timeout=require(_0x3232('0x2'));var express=require(_0x3232('0x3'));var router=express[_0x3232('0x4')]();var fs_extra=require(_0x3232('0x5'));var auth=require(_0x3232('0x6'));var interaction=require(_0x3232('0x7'));var config=require(_0x3232('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x3232('0x9')]('/',auth[_0x3232('0xa')](),controller[_0x3232('0xb')]);router['get'](_0x3232('0xc'),auth[_0x3232('0xa')](),controller[_0x3232('0xd')]);router['get'](_0x3232('0xe'),auth[_0x3232('0xa')](),controller[_0x3232('0xf')]);router[_0x3232('0x9')](_0x3232('0x10'),auth['isAuthenticated'](),controller[_0x3232('0x11')]);router[_0x3232('0x9')](_0x3232('0x12'),auth['isAuthenticated'](),controller[_0x3232('0x13')]);router[_0x3232('0x14')]('/',auth[_0x3232('0xa')](),controller[_0x3232('0x15')]);router[_0x3232('0x16')](_0x3232('0xc'),auth['isAuthenticated'](),controller[_0x3232('0x17')]);router[_0x3232('0x18')](_0x3232('0xc'),auth['isAuthenticated'](),controller[_0x3232('0x19')]);module[_0x3232('0x1a')]=router; \ No newline at end of file +var _0xa58b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','post','put','update'];(function(_0x48b0b6,_0xd86fa5){var _0x2c1a9f=function(_0x351faa){while(--_0x351faa){_0x48b0b6['push'](_0x48b0b6['shift']());}};_0x2c1a9f(++_0xd86fa5);}(_0xa58b,0x7b));var _0xba58=function(_0x33cecd,_0x545a54){_0x33cecd=_0x33cecd-0x0;var _0x3d6d0b=_0xa58b[_0x33cecd];return _0x3d6d0b;};'use strict';var multer=require(_0xba58('0x0'));var util=require(_0xba58('0x1'));var path=require(_0xba58('0x2'));var timeout=require(_0xba58('0x3'));var express=require(_0xba58('0x4'));var router=express[_0xba58('0x5')]();var fs_extra=require(_0xba58('0x6'));var auth=require(_0xba58('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xba58('0x8'));var controller=require(_0xba58('0x9'));router[_0xba58('0xa')]('/',auth[_0xba58('0xb')](),controller[_0xba58('0xc')]);router[_0xba58('0xa')](_0xba58('0xd'),auth[_0xba58('0xb')](),controller[_0xba58('0xe')]);router[_0xba58('0xa')]('/:id/preview',auth[_0xba58('0xb')](),controller[_0xba58('0xf')]);router[_0xba58('0xa')](_0xba58('0x10'),auth[_0xba58('0xb')](),controller[_0xba58('0x11')]);router[_0xba58('0xa')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0xba58('0x12')]('/',auth[_0xba58('0xb')](),controller['create']);router[_0xba58('0x13')](_0xba58('0xd'),auth[_0xba58('0xb')](),controller[_0xba58('0x14')]);router[_0xba58('0x15')]('/:id',auth[_0xba58('0xb')](),controller[_0xba58('0x16')]);module[_0xba58('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8a41d29..58f469d 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 _0xe98f=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe98f,0x1b8));var _0xfe98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfe98('0x0')]={'name':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xfe98('0x2')](_0xfe98('0x3'),_0xfe98('0x4'),_0xfe98('0x5')),'allowNull':![],'defaultValue':_0xfe98('0x3')},'savename':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xfe98('0x6')]},'status':{'type':Sequelize[_0xfe98('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xfe98('0x7')),'allowNull':![],'defaultValue':_0xfe98('0x8')},'reportId':{'type':Sequelize[_0xfe98('0x9')](0xb)[_0xfe98('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x315c=['moment','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x315c,0xe4));var _0xc315=function(_0xfd6b0f,_0x3da364){_0xfd6b0f=_0xfd6b0f-0x0;var _0x19b374=_0x315c[_0xfd6b0f];return _0x19b374;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc315('0x0'));module[_0xc315('0x1')]={'name':{'type':Sequelize[_0xc315('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc315('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xc315('0x3'),_0xc315('0x4'),_0xc315('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc315('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc315('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xc315('0x7')](_0xc315('0x8'),_0xc315('0x9')),'allowNull':![],'defaultValue':_0xc315('0x8')},'reportId':{'type':Sequelize[_0xc315('0xa')](0xb)[_0xc315('0xb')]},'reportType':{'type':Sequelize[_0xc315('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4115cc8..e15681f 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 _0xf463=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','end','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xf463,0x182));var _0x3f46=function(_0x1d17e7,_0x22660d){_0x1d17e7=_0x1d17e7-0x0;var _0x7b1dd6=_0xf463[_0x1d17e7];return _0x7b1dd6;};'use strict';var emlformat=require(_0x3f46('0x0'));var rimraf=require(_0x3f46('0x1'));var zipdir=require(_0x3f46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3f46('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3f46('0x4'));var util=require(_0x3f46('0x5'));var path=require('path');var sox=require(_0x3f46('0x6'));var csv=require(_0x3f46('0x7'));var ejs=require(_0x3f46('0x8'));var fs=require('fs');var fs_extra=require(_0x3f46('0x9'));var _=require(_0x3f46('0xa'));var squel=require(_0x3f46('0xb'));var crypto=require(_0x3f46('0xc'));var jsforce=require(_0x3f46('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3f46('0x7'));var querystring=require(_0x3f46('0xe'));var Papa=require(_0x3f46('0xf'));var Redis=require(_0x3f46('0x10'));var authService=require(_0x3f46('0x11'));var qs=require(_0x3f46('0x12'));var as=require(_0x3f46('0x13'));var hardwareService=require(_0x3f46('0x14'));var logger=require(_0x3f46('0x15'))(_0x3f46('0x16'));var utils=require(_0x3f46('0x17'));var config=require(_0x3f46('0x18'));var licenseUtil=require(_0x3f46('0x19'));var db=require(_0x3f46('0x1a'))['db'];function respondWithStatusCode(_0x5138f4,_0x3e3753){_0x3e3753=_0x3e3753||0xcc;return function(_0xc09617){if(_0xc09617){return _0x5138f4[_0x3f46('0x1b')](_0x3e3753);}return _0x5138f4['status'](_0x3e3753)['end']();};}function respondWithResult(_0x4ce322,_0x3cd9ae){_0x3cd9ae=_0x3cd9ae||0xc8;return function(_0x20ea16){if(_0x20ea16){return _0x4ce322['status'](_0x3cd9ae)[_0x3f46('0x1c')](_0x20ea16);}};}function respondWithFilteredResult(_0x28e7f4,_0x5afd93){return function(_0x3915df){if(_0x3915df){var _0x4cab61=typeof _0x5afd93[_0x3f46('0x1d')]===_0x3f46('0x1e')&&typeof _0x5afd93['limit']===_0x3f46('0x1e');var _0x27540e=_0x3915df[_0x3f46('0x1f')];var _0x1cd04d=_0x4cab61?0x0:_0x5afd93[_0x3f46('0x1d')];var _0xd4b17c=_0x4cab61?_0x3915df['count']:_0x5afd93[_0x3f46('0x1d')]+_0x5afd93['limit'];var _0x4183fe;if(_0xd4b17c>=_0x27540e){_0xd4b17c=_0x27540e;_0x4183fe=0xc8;}else{_0x4183fe=0xce;}_0x28e7f4[_0x3f46('0x20')](_0x4183fe);return _0x28e7f4[_0x3f46('0x21')](_0x3f46('0x22'),_0x1cd04d+'-'+_0xd4b17c+'/'+_0x27540e)[_0x3f46('0x1c')](_0x3915df);}return null;};}function patchUpdates(_0x227cca){return function(_0x2df2c3){try{jsonpatch[_0x3f46('0x23')](_0x2df2c3,_0x227cca,!![]);}catch(_0x4938a6){return BPromise[_0x3f46('0x24')](_0x4938a6);}return _0x2df2c3[_0x3f46('0x25')]();};}function saveUpdates(_0x185bc2,_0x389b56){return function(_0x29705){if(_0x29705){return _0x29705[_0x3f46('0x26')](_0x185bc2)[_0x3f46('0x27')](function(_0x3f91da){return _0x3f91da;});}return null;};}function removeEntity(_0x3fa50b,_0x4d3db1){return function(_0x365ed4){if(_0x365ed4){return _0x365ed4[_0x3f46('0x28')]()[_0x3f46('0x27')](function(){var _0x614742=_0x365ed4[_0x3f46('0x29')]({'plain':!![]});var _0x1f3888=_0x3f46('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f3888,'resourceId':_0x614742['id']}})[_0x3f46('0x27')](function(){return _0x365ed4;});})[_0x3f46('0x27')](function(){_0x3fa50b[_0x3f46('0x20')](0xcc)[_0x3f46('0x2b')]();});}};}function handleEntityNotFound(_0x1a2621,_0x3bf13f){return function(_0x447afe){if(!_0x447afe){_0x1a2621[_0x3f46('0x1b')](0x194);}return _0x447afe;};}function handleError(_0x199a1c,_0x4d7a65){_0x4d7a65=_0x4d7a65||0x1f4;return function(_0xc0c91c){logger[_0x3f46('0x2c')](_0xc0c91c[_0x3f46('0x2d')]);if(_0xc0c91c[_0x3f46('0x2e')]){delete _0xc0c91c[_0x3f46('0x2e')];}_0x199a1c[_0x3f46('0x20')](_0x4d7a65)[_0x3f46('0x2f')](_0xc0c91c);};}exports[_0x3f46('0x30')]=function(_0x2fdbc7,_0x237212){var _0x552049={},_0x198b89={},_0xc8f13f={'count':0x0,'rows':[]};var _0x532764=_[_0x3f46('0x31')](db[_0x3f46('0x32')]['rawAttributes'],function(_0x22d399){return{'name':_0x22d399[_0x3f46('0x33')],'type':_0x22d399['type'][_0x3f46('0x34')]};});_0x198b89[_0x3f46('0x35')]=_[_0x3f46('0x31')](_0x532764,_0x3f46('0x2e'));_0x198b89[_0x3f46('0x36')]=_[_0x3f46('0x37')](_0x2fdbc7[_0x3f46('0x36')]);_0x198b89['filters']=_['intersection'](_0x198b89[_0x3f46('0x35')],_0x198b89[_0x3f46('0x36')]);_0x552049[_0x3f46('0x38')]=_['intersection'](_0x198b89[_0x3f46('0x35')],qs[_0x3f46('0x39')](_0x2fdbc7['query'][_0x3f46('0x39')]));_0x552049[_0x3f46('0x38')]=_0x552049[_0x3f46('0x38')][_0x3f46('0x3a')]?_0x552049[_0x3f46('0x38')]:_0x198b89[_0x3f46('0x35')];if(!_0x2fdbc7[_0x3f46('0x36')][_0x3f46('0x3b')](_0x3f46('0x3c'))){_0x552049[_0x3f46('0x3d')]=qs[_0x3f46('0x3d')](_0x2fdbc7[_0x3f46('0x36')]['limit']);_0x552049[_0x3f46('0x1d')]=qs[_0x3f46('0x1d')](_0x2fdbc7[_0x3f46('0x36')]['offset']);}_0x552049[_0x3f46('0x3e')]=qs[_0x3f46('0x3f')](_0x2fdbc7[_0x3f46('0x36')][_0x3f46('0x3f')]);_0x552049['where']=qs[_0x3f46('0x40')](_[_0x3f46('0x41')](_0x2fdbc7[_0x3f46('0x36')],_0x198b89[_0x3f46('0x40')]),_0x532764);if(_0x2fdbc7[_0x3f46('0x36')][_0x3f46('0x42')]){_0x552049[_0x3f46('0x43')]=_[_0x3f46('0x44')](_0x552049['where'],{'$or':_[_0x3f46('0x31')](_0x532764,function(_0x28d4d3){if(_0x28d4d3['type']!==_0x3f46('0x45')){var _0x232ac9={};_0x232ac9[_0x28d4d3['name']]={'$like':'%'+_0x2fdbc7[_0x3f46('0x36')][_0x3f46('0x42')]+'%'};return _0x232ac9;}})});}_0x552049=_[_0x3f46('0x44')]({},_0x552049,_0x2fdbc7[_0x3f46('0x46')]);var _0x3b8205={'where':_0x552049['where']};return db['AnalyticExtractedReport']['count'](_0x3b8205)[_0x3f46('0x27')](function(_0x3f7d20){_0xc8f13f[_0x3f46('0x1f')]=_0x3f7d20;if(_0x2fdbc7[_0x3f46('0x36')][_0x3f46('0x47')]){_0x552049[_0x3f46('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3f46('0x49')](_0x552049);})['then'](function(_0x5c39f7){_0xc8f13f[_0x3f46('0x4a')]=_0x5c39f7;return _0xc8f13f;})[_0x3f46('0x27')](respondWithFilteredResult(_0x237212,_0x552049))[_0x3f46('0x4b')](handleError(_0x237212,null));};exports[_0x3f46('0x4c')]=function(_0xc4d52e,_0x1fb7d3){var _0x113753={'raw':!![],'where':{'id':_0xc4d52e['params']['id']}},_0xd43a9a={};_0xd43a9a[_0x3f46('0x35')]=_['keys'](db[_0x3f46('0x32')]['rawAttributes']);_0xd43a9a[_0x3f46('0x36')]=_[_0x3f46('0x37')](_0xc4d52e['query']);_0xd43a9a[_0x3f46('0x40')]=_[_0x3f46('0x4d')](_0xd43a9a[_0x3f46('0x35')],_0xd43a9a[_0x3f46('0x36')]);_0x113753[_0x3f46('0x38')]=_[_0x3f46('0x4d')](_0xd43a9a[_0x3f46('0x35')],qs['fields'](_0xc4d52e[_0x3f46('0x36')][_0x3f46('0x39')]));_0x113753[_0x3f46('0x38')]=_0x113753[_0x3f46('0x38')][_0x3f46('0x3a')]?_0x113753[_0x3f46('0x38')]:_0xd43a9a[_0x3f46('0x35')];if(_0xc4d52e[_0x3f46('0x36')][_0x3f46('0x47')]){_0x113753[_0x3f46('0x48')]=[{'all':!![]}];}_0x113753=_[_0x3f46('0x44')]({},_0x113753,_0xc4d52e['options']);return db[_0x3f46('0x32')][_0x3f46('0x4e')](_0x113753)[_0x3f46('0x27')](handleEntityNotFound(_0x1fb7d3,null))['then'](respondWithResult(_0x1fb7d3,null))[_0x3f46('0x4b')](handleError(_0x1fb7d3,null));};exports[_0x3f46('0x4f')]=function(_0x4ab201,_0x145209){return db['AnalyticExtractedReport'][_0x3f46('0x4f')](_0x4ab201[_0x3f46('0x50')],{})[_0x3f46('0x27')](function(_0x1e089a){var _0x80a34f=_0x4ab201[_0x3f46('0x51')][_0x3f46('0x29')]({'plain':!![]});if(!_0x80a34f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x80a34f['role']==='user'){var _0x4795da=_0x1e089a[_0x3f46('0x29')]({'plain':!![]});var _0x4daf23=_0x3f46('0x2a');return db[_0x3f46('0x52')][_0x3f46('0x4e')]({'where':{'name':_0x4daf23,'userProfileId':_0x80a34f[_0x3f46('0x53')]},'raw':!![]})[_0x3f46('0x27')](function(_0x2a794e){if(_0x2a794e&&_0x2a794e[_0x3f46('0x54')]===0x0){return db['UserProfileResource'][_0x3f46('0x4f')]({'name':_0x4795da[_0x3f46('0x2e')],'resourceId':_0x4795da['id'],'type':_0x2a794e['name'],'sectionId':_0x2a794e['id']},{})[_0x3f46('0x27')](function(){return _0x1e089a;});}else{return _0x1e089a;}})['catch'](function(_0x5ace9a){logger[_0x3f46('0x2c')](_0x3f46('0x55'),_0x5ace9a);throw _0x5ace9a;});}return _0x1e089a;})[_0x3f46('0x27')](respondWithResult(_0x145209,0xc9))[_0x3f46('0x4b')](handleError(_0x145209,null));};exports[_0x3f46('0x26')]=function(_0x2270b8,_0x17c5ce){if(_0x2270b8[_0x3f46('0x50')]['id']){delete _0x2270b8['body']['id'];}return db[_0x3f46('0x32')]['find']({'where':{'id':_0x2270b8[_0x3f46('0x56')]['id']}})[_0x3f46('0x27')](handleEntityNotFound(_0x17c5ce,null))[_0x3f46('0x27')](saveUpdates(_0x2270b8[_0x3f46('0x50')],null))[_0x3f46('0x27')](respondWithResult(_0x17c5ce,null))[_0x3f46('0x4b')](handleError(_0x17c5ce,null));};exports[_0x3f46('0x28')]=function(_0x2585c3,_0x37c18d){return db[_0x3f46('0x32')][_0x3f46('0x4e')]({'where':{'id':_0x2585c3['params']['id']}})[_0x3f46('0x27')](handleEntityNotFound(_0x37c18d,null))[_0x3f46('0x27')](removeEntity(_0x37c18d,null))[_0x3f46('0x4b')](handleError(_0x37c18d,null));};exports[_0x3f46('0x57')]=function(_0x291042,_0x26e7fb,_0x5be189){return db[_0x3f46('0x32')][_0x3f46('0x4e')]({'where':{'id':_0x291042[_0x3f46('0x56')]['id']},'attributes':['name',_0x3f46('0x58'),_0x3f46('0x59'),_0x3f46('0x5a')],'raw':!![]})[_0x3f46('0x27')](handleEntityNotFound(_0x26e7fb,null))['then'](function(_0x28117a){if(_0x28117a){if(!fs['existsSync'](path[_0x3f46('0x5b')](config[_0x3f46('0x5c')],_0x3f46('0x5d'),_0x28117a[_0x3f46('0x59')]))){throw new db['Sequelize']['ValidationError'](_0x3f46('0x5e'));}if(_0x291042[_0x3f46('0x36')][_0x3f46('0x5f')]){return _0x26e7fb[_0x3f46('0x1b')](0xc8);}return _0x26e7fb[_0x3f46('0x57')](path[_0x3f46('0x5b')](config['root'],'server/files/reports',_0x28117a['savename']),util[_0x3f46('0x60')](_0x3f46('0x61'),_0x28117a['basename']||_0x28117a['name'],_0x28117a[_0x3f46('0x5a')][_0x3f46('0x62')]()));}})[_0x3f46('0x4b')](handleError(_0x26e7fb,null));}; \ No newline at end of file +var _0xc6db=['zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ExtractedReports','UserProfileResource','then','end','sendStatus','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','basename','toLowerCase','eml-format'];(function(_0x14de3a,_0x2726fa){var _0xcf463b=function(_0x43715a){while(--_0x43715a){_0x14de3a['push'](_0x14de3a['shift']());}};_0xcf463b(++_0x2726fa);}(_0xc6db,0x17b));var _0xbc6d=function(_0x40b7bd,_0x2f8acc){_0x40b7bd=_0x40b7bd-0x0;var _0x30f8a5=_0xc6db[_0x40b7bd];return _0x30f8a5;};'use strict';var emlformat=require(_0xbc6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc6d('0x1'));var jsonpatch=require(_0xbc6d('0x2'));var rp=require(_0xbc6d('0x3'));var moment=require(_0xbc6d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbc6d('0x5'));var sox=require('sox');var csv=require(_0xbc6d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc6d('0x7'));var _=require(_0xbc6d('0x8'));var squel=require(_0xbc6d('0x9'));var crypto=require(_0xbc6d('0xa'));var jsforce=require(_0xbc6d('0xb'));var deskjs=require(_0xbc6d('0xc'));var toCsv=require(_0xbc6d('0x6'));var querystring=require(_0xbc6d('0xd'));var Papa=require(_0xbc6d('0xe'));var Redis=require('ioredis');var authService=require(_0xbc6d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbc6d('0x10'));var hardwareService=require(_0xbc6d('0x11'));var logger=require(_0xbc6d('0x12'))(_0xbc6d('0x13'));var utils=require(_0xbc6d('0x14'));var config=require(_0xbc6d('0x15'));var licenseUtil=require(_0xbc6d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cd194,_0x16edd1){_0x16edd1=_0x16edd1||0xcc;return function(_0x3f3124){if(_0x3f3124){return _0x4cd194['sendStatus'](_0x16edd1);}return _0x4cd194[_0xbc6d('0x17')](_0x16edd1)['end']();};}function respondWithResult(_0x5e6b79,_0x555bc9){_0x555bc9=_0x555bc9||0xc8;return function(_0x4bbe4d){if(_0x4bbe4d){return _0x5e6b79[_0xbc6d('0x17')](_0x555bc9)[_0xbc6d('0x18')](_0x4bbe4d);}};}function respondWithFilteredResult(_0x38cb76,_0x359454){return function(_0xb4a9d6){if(_0xb4a9d6){var _0x5800b5=typeof _0x359454['offset']===_0xbc6d('0x19')&&typeof _0x359454[_0xbc6d('0x1a')]===_0xbc6d('0x19');var _0x17cd94=_0xb4a9d6[_0xbc6d('0x1b')];var _0x117877=_0x5800b5?0x0:_0x359454[_0xbc6d('0x1c')];var _0x54b107=_0x5800b5?_0xb4a9d6[_0xbc6d('0x1b')]:_0x359454[_0xbc6d('0x1c')]+_0x359454[_0xbc6d('0x1a')];var _0x12ed02;if(_0x54b107>=_0x17cd94){_0x54b107=_0x17cd94;_0x12ed02=0xc8;}else{_0x12ed02=0xce;}_0x38cb76[_0xbc6d('0x17')](_0x12ed02);return _0x38cb76[_0xbc6d('0x1d')](_0xbc6d('0x1e'),_0x117877+'-'+_0x54b107+'/'+_0x17cd94)[_0xbc6d('0x18')](_0xb4a9d6);}return null;};}function patchUpdates(_0x11c658){return function(_0x5ecf40){try{jsonpatch[_0xbc6d('0x1f')](_0x5ecf40,_0x11c658,!![]);}catch(_0x526628){return BPromise[_0xbc6d('0x20')](_0x526628);}return _0x5ecf40[_0xbc6d('0x21')]();};}function saveUpdates(_0x31ec69,_0x42ad32){return function(_0x1d1012){if(_0x1d1012){return _0x1d1012[_0xbc6d('0x22')](_0x31ec69)['then'](function(_0x48b9d1){return _0x48b9d1;});}return null;};}function removeEntity(_0x2c0fa5,_0x313557){return function(_0x48279a){if(_0x48279a){return _0x48279a[_0xbc6d('0x23')]()['then'](function(){var _0x14522c=_0x48279a[_0xbc6d('0x24')]({'plain':!![]});var _0x3bdc00=_0xbc6d('0x25');return db[_0xbc6d('0x26')]['destroy']({'where':{'type':_0x3bdc00,'resourceId':_0x14522c['id']}})[_0xbc6d('0x27')](function(){return _0x48279a;});})[_0xbc6d('0x27')](function(){_0x2c0fa5[_0xbc6d('0x17')](0xcc)[_0xbc6d('0x28')]();});}};}function handleEntityNotFound(_0x11076e,_0x36462d){return function(_0xffa466){if(!_0xffa466){_0x11076e[_0xbc6d('0x29')](0x194);}return _0xffa466;};}function handleError(_0x1819e1,_0x30a981){_0x30a981=_0x30a981||0x1f4;return function(_0x1473b3){logger['error'](_0x1473b3[_0xbc6d('0x2a')]);if(_0x1473b3[_0xbc6d('0x2b')]){delete _0x1473b3[_0xbc6d('0x2b')];}_0x1819e1[_0xbc6d('0x17')](_0x30a981)['send'](_0x1473b3);};}exports['index']=function(_0x386228,_0x59eb3a){var _0x116756={},_0x168439={},_0x226f41={'count':0x0,'rows':[]};var _0x59225e=_[_0xbc6d('0x2c')](db[_0xbc6d('0x2d')][_0xbc6d('0x2e')],function(_0x231d2c){return{'name':_0x231d2c[_0xbc6d('0x2f')],'type':_0x231d2c[_0xbc6d('0x30')]['key']};});_0x168439[_0xbc6d('0x31')]=_[_0xbc6d('0x2c')](_0x59225e,'name');_0x168439[_0xbc6d('0x32')]=_['keys'](_0x386228[_0xbc6d('0x32')]);_0x168439['filters']=_[_0xbc6d('0x33')](_0x168439['model'],_0x168439[_0xbc6d('0x32')]);_0x116756[_0xbc6d('0x34')]=_[_0xbc6d('0x33')](_0x168439[_0xbc6d('0x31')],qs[_0xbc6d('0x35')](_0x386228[_0xbc6d('0x32')]['fields']));_0x116756[_0xbc6d('0x34')]=_0x116756['attributes'][_0xbc6d('0x36')]?_0x116756['attributes']:_0x168439[_0xbc6d('0x31')];if(!_0x386228['query'][_0xbc6d('0x37')](_0xbc6d('0x38'))){_0x116756[_0xbc6d('0x1a')]=qs['limit'](_0x386228[_0xbc6d('0x32')]['limit']);_0x116756[_0xbc6d('0x1c')]=qs[_0xbc6d('0x1c')](_0x386228[_0xbc6d('0x32')][_0xbc6d('0x1c')]);}_0x116756['order']=qs['sort'](_0x386228['query'][_0xbc6d('0x39')]);_0x116756[_0xbc6d('0x3a')]=qs[_0xbc6d('0x3b')](_[_0xbc6d('0x3c')](_0x386228['query'],_0x168439[_0xbc6d('0x3b')]),_0x59225e);if(_0x386228['query'][_0xbc6d('0x3d')]){_0x116756[_0xbc6d('0x3a')]=_[_0xbc6d('0x3e')](_0x116756[_0xbc6d('0x3a')],{'$or':_[_0xbc6d('0x2c')](_0x59225e,function(_0x37e07d){if(_0x37e07d[_0xbc6d('0x30')]!==_0xbc6d('0x3f')){var _0x5f1fca={};_0x5f1fca[_0x37e07d['name']]={'$like':'%'+_0x386228['query'][_0xbc6d('0x3d')]+'%'};return _0x5f1fca;}})});}_0x116756=_[_0xbc6d('0x3e')]({},_0x116756,_0x386228[_0xbc6d('0x40')]);var _0x4bffa5={'where':_0x116756['where']};return db[_0xbc6d('0x2d')][_0xbc6d('0x1b')](_0x4bffa5)[_0xbc6d('0x27')](function(_0x15d5d4){_0x226f41[_0xbc6d('0x1b')]=_0x15d5d4;if(_0x386228['query'][_0xbc6d('0x41')]){_0x116756[_0xbc6d('0x42')]=[{'all':!![]}];}return db[_0xbc6d('0x2d')][_0xbc6d('0x43')](_0x116756);})['then'](function(_0x49f68a){_0x226f41['rows']=_0x49f68a;return _0x226f41;})[_0xbc6d('0x27')](respondWithFilteredResult(_0x59eb3a,_0x116756))[_0xbc6d('0x44')](handleError(_0x59eb3a,null));};exports[_0xbc6d('0x45')]=function(_0x5a48e9,_0x12fd2d){var _0x41532a={'raw':!![],'where':{'id':_0x5a48e9[_0xbc6d('0x46')]['id']}},_0x4c8566={};_0x4c8566['model']=_['keys'](db[_0xbc6d('0x2d')][_0xbc6d('0x2e')]);_0x4c8566[_0xbc6d('0x32')]=_[_0xbc6d('0x47')](_0x5a48e9[_0xbc6d('0x32')]);_0x4c8566[_0xbc6d('0x3b')]=_[_0xbc6d('0x33')](_0x4c8566['model'],_0x4c8566[_0xbc6d('0x32')]);_0x41532a[_0xbc6d('0x34')]=_['intersection'](_0x4c8566['model'],qs[_0xbc6d('0x35')](_0x5a48e9[_0xbc6d('0x32')]['fields']));_0x41532a[_0xbc6d('0x34')]=_0x41532a[_0xbc6d('0x34')]['length']?_0x41532a[_0xbc6d('0x34')]:_0x4c8566[_0xbc6d('0x31')];if(_0x5a48e9[_0xbc6d('0x32')][_0xbc6d('0x41')]){_0x41532a[_0xbc6d('0x42')]=[{'all':!![]}];}_0x41532a=_['merge']({},_0x41532a,_0x5a48e9['options']);return db[_0xbc6d('0x2d')][_0xbc6d('0x48')](_0x41532a)['then'](handleEntityNotFound(_0x12fd2d,null))[_0xbc6d('0x27')](respondWithResult(_0x12fd2d,null))[_0xbc6d('0x44')](handleError(_0x12fd2d,null));};exports[_0xbc6d('0x49')]=function(_0x408101,_0x31ca81){return db[_0xbc6d('0x2d')][_0xbc6d('0x49')](_0x408101[_0xbc6d('0x4a')],{})['then'](function(_0x579ba3){var _0x36ce6a=_0x408101[_0xbc6d('0x4b')][_0xbc6d('0x24')]({'plain':!![]});if(!_0x36ce6a)throw new Error(_0xbc6d('0x4c'));if(_0x36ce6a[_0xbc6d('0x4d')]===_0xbc6d('0x4b')){var _0x1d9a6a=_0x579ba3['get']({'plain':!![]});var _0x2c5c6c='ExtractedReports';return db[_0xbc6d('0x4e')][_0xbc6d('0x48')]({'where':{'name':_0x2c5c6c,'userProfileId':_0x36ce6a[_0xbc6d('0x4f')]},'raw':!![]})[_0xbc6d('0x27')](function(_0x385fbc){if(_0x385fbc&&_0x385fbc['autoAssociation']===0x0){return db[_0xbc6d('0x26')]['create']({'name':_0x1d9a6a[_0xbc6d('0x2b')],'resourceId':_0x1d9a6a['id'],'type':_0x385fbc[_0xbc6d('0x2b')],'sectionId':_0x385fbc['id']},{})['then'](function(){return _0x579ba3;});}else{return _0x579ba3;}})[_0xbc6d('0x44')](function(_0x1ea3df){logger['error'](_0xbc6d('0x50'),_0x1ea3df);throw _0x1ea3df;});}return _0x579ba3;})[_0xbc6d('0x27')](respondWithResult(_0x31ca81,0xc9))[_0xbc6d('0x44')](handleError(_0x31ca81,null));};exports[_0xbc6d('0x22')]=function(_0x5a2148,_0x22668c){if(_0x5a2148[_0xbc6d('0x4a')]['id']){delete _0x5a2148[_0xbc6d('0x4a')]['id'];}return db[_0xbc6d('0x2d')][_0xbc6d('0x48')]({'where':{'id':_0x5a2148[_0xbc6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x22668c,null))['then'](saveUpdates(_0x5a2148['body'],null))[_0xbc6d('0x27')](respondWithResult(_0x22668c,null))[_0xbc6d('0x44')](handleError(_0x22668c,null));};exports['destroy']=function(_0x407048,_0x34801a){return db[_0xbc6d('0x2d')][_0xbc6d('0x48')]({'where':{'id':_0x407048[_0xbc6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x34801a,null))[_0xbc6d('0x27')](removeEntity(_0x34801a,null))[_0xbc6d('0x44')](handleError(_0x34801a,null));};exports[_0xbc6d('0x51')]=function(_0x29f345,_0x62a4c4,_0x21de47){return db[_0xbc6d('0x2d')]['find']({'where':{'id':_0x29f345[_0xbc6d('0x46')]['id']},'attributes':[_0xbc6d('0x2b'),'basename',_0xbc6d('0x52'),_0xbc6d('0x53')],'raw':!![]})[_0xbc6d('0x27')](handleEntityNotFound(_0x62a4c4,null))[_0xbc6d('0x27')](function(_0xad65d7){if(_0xad65d7){if(!fs[_0xbc6d('0x54')](path[_0xbc6d('0x55')](config[_0xbc6d('0x56')],'server/files/reports',_0xad65d7[_0xbc6d('0x52')]))){throw new db[(_0xbc6d('0x57'))][(_0xbc6d('0x58'))](_0xbc6d('0x59'));}if(_0x29f345[_0xbc6d('0x32')][_0xbc6d('0x5a')]){return _0x62a4c4['sendStatus'](0xc8);}return _0x62a4c4[_0xbc6d('0x51')](path[_0xbc6d('0x55')](config['root'],_0xbc6d('0x5b'),_0xad65d7[_0xbc6d('0x52')]),util[_0xbc6d('0x5c')]('%s.%s',_0xad65d7[_0xbc6d('0x5d')]||_0xad65d7[_0xbc6d('0x2b')],_0xad65d7['output'][_0xbc6d('0x5e')]()));}})[_0xbc6d('0x44')](handleError(_0x62a4c4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2d2b26a..f89d44f 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 _0x3fa8=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','util','../../config/logger','api','moment','bluebird'];(function(_0x5468e9,_0x7a6edb){var _0x3e0e42=function(_0x3ff5bb){while(--_0x3ff5bb){_0x5468e9['push'](_0x5468e9['shift']());}};_0x3e0e42(++_0x7a6edb);}(_0x3fa8,0x70));var _0x83fa=function(_0x449671,_0x146b62){_0x449671=_0x449671-0x0;var _0x30fad0=_0x3fa8[_0x449671];return _0x30fad0;};'use strict';var _=require('lodash');var util=require(_0x83fa('0x0'));var logger=require(_0x83fa('0x1'))(_0x83fa('0x2'));var moment=require(_0x83fa('0x3'));var BPromise=require(_0x83fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x83fa('0x5'));var config=require(_0x83fa('0x6'));var attributes=require(_0x83fa('0x7'));module['exports']=function(_0x35f4f4,_0x5e8b29){return _0x35f4f4[_0x83fa('0x8')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9524=['moment','bluebird','request-promise','path','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x9524,0x152));var _0x4952=function(_0x2ed6f9,_0x3c9c5c){_0x2ed6f9=_0x2ed6f9-0x0;var _0x4529be=_0x9524[_0x2ed6f9];return _0x4529be;};'use strict';var _=require(_0x4952('0x0'));var util=require('util');var logger=require(_0x4952('0x1'))(_0x4952('0x2'));var moment=require(_0x4952('0x3'));var BPromise=require(_0x4952('0x4'));var rp=require(_0x4952('0x5'));var fs=require('fs');var path=require(_0x4952('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4952('0x7'));module['exports']=function(_0x10ed74,_0x39482a){return _0x10ed74[_0x4952('0x8')](_0x4952('0x9'),attributes,{'tableName':_0x4952('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 901b5e9..4668fba 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 _0x3ccb=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x34c122,_0x4ac121){var _0x4746aa=function(_0x5aeb4c){while(--_0x5aeb4c){_0x34c122['push'](_0x34c122['shift']());}};_0x4746aa(++_0x4ac121);}(_0x3ccb,0xdb));var _0xb3cc=function(_0x2cf34f,_0x113909){_0x2cf34f=_0x2cf34f-0x0;var _0xe590ce=_0x3ccb[_0x2cf34f];return _0xe590ce;};'use strict';var _=require(_0xb3cc('0x0'));var util=require('util');var moment=require(_0xb3cc('0x1'));var BPromise=require(_0xb3cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb3cc('0x3'))(_0xb3cc('0x4'));var config=require(_0xb3cc('0x5'));var jayson=require(_0xb3cc('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbd51ee,_0x49959a,_0x3ee3fd){return new BPromise(function(_0x261482,_0x1e9c9e){return client[_0xb3cc('0x7')](_0xbd51ee,_0x3ee3fd)[_0xb3cc('0x8')](function(_0x9630f3){logger[_0xb3cc('0x9')](_0xb3cc('0xa'),_0x49959a,_0xb3cc('0xb'));logger[_0xb3cc('0xc')](_0xb3cc('0xd'),_0x49959a,_0xb3cc('0xb'),JSON[_0xb3cc('0xe')](_0x9630f3));if(_0x9630f3[_0xb3cc('0xf')]){if(_0x9630f3[_0xb3cc('0xf')][_0xb3cc('0x10')]===0x1f4){logger[_0xb3cc('0xf')](_0xb3cc('0xa'),_0x49959a,_0x9630f3[_0xb3cc('0xf')][_0xb3cc('0x11')]);return _0x1e9c9e(_0x9630f3[_0xb3cc('0xf')][_0xb3cc('0x11')]);}logger['error'](_0xb3cc('0xa'),_0x49959a,_0x9630f3[_0xb3cc('0xf')][_0xb3cc('0x11')]);return _0x261482(_0x9630f3[_0xb3cc('0xf')][_0xb3cc('0x11')]);}else{logger[_0xb3cc('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x49959a,_0xb3cc('0xb'));_0x261482(_0x9630f3[_0xb3cc('0x12')][_0xb3cc('0x11')]);}})[_0xb3cc('0x13')](function(_0x3c240f){logger[_0xb3cc('0xf')](_0xb3cc('0xa'),_0x49959a,_0x3c240f);_0x1e9c9e(_0x3c240f);});});} \ No newline at end of file +var _0xde6f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','moment','bluebird','randomstring','../../mysqldb'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xde6f,0x84));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfde6('0x0'));var BPromise=require(_0xfde6('0x1'));var rs=require(_0xfde6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde6('0x3'))['db'];var utils=require(_0xfde6('0x4'));var logger=require(_0xfde6('0x5'))(_0xfde6('0x6'));var config=require(_0xfde6('0x7'));var jayson=require(_0xfde6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20ec09,_0x33e867,_0x4303b5){return new BPromise(function(_0x135b39,_0x5e6fb0){return client[_0xfde6('0x9')](_0x20ec09,_0x4303b5)[_0xfde6('0xa')](function(_0x136937){logger['info'](_0xfde6('0xb'),_0x33e867,_0xfde6('0xc'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x33e867,_0xfde6('0xc'),JSON[_0xfde6('0xd')](_0x136937));if(_0x136937[_0xfde6('0xe')]){if(_0x136937[_0xfde6('0xe')]['code']===0x1f4){logger[_0xfde6('0xe')](_0xfde6('0xb'),_0x33e867,_0x136937[_0xfde6('0xe')][_0xfde6('0xf')]);return _0x5e6fb0(_0x136937[_0xfde6('0xe')]['message']);}logger[_0xfde6('0xe')](_0xfde6('0xb'),_0x33e867,_0x136937['error'][_0xfde6('0xf')]);return _0x135b39(_0x136937[_0xfde6('0xe')][_0xfde6('0xf')]);}else{logger['info'](_0xfde6('0xb'),_0x33e867,_0xfde6('0xc'));_0x135b39(_0x136937[_0xfde6('0x10')][_0xfde6('0xf')]);}})['catch'](function(_0x4c1ea0){logger[_0xfde6('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33e867,_0x4c1ea0);_0x5e6fb0(_0x4c1ea0);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b776cfb..5eb43a0 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 _0x59ff=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','update','exports','util','path'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x59ff,0x86));var _0xf59f=function(_0x30106c,_0x21bfee){_0x30106c=_0x30106c-0x0;var _0x490fae=_0x59ff[_0x30106c];return _0x490fae;};'use strict';var multer=require('multer');var util=require(_0xf59f('0x0'));var path=require(_0xf59f('0x1'));var timeout=require(_0xf59f('0x2'));var express=require(_0xf59f('0x3'));var router=express['Router']();var fs_extra=require(_0xf59f('0x4'));var auth=require(_0xf59f('0x5'));var interaction=require(_0xf59f('0x6'));var config=require('../../config/environment');var controller=require(_0xf59f('0x7'));router[_0xf59f('0x8')]('/',auth[_0xf59f('0x9')](),controller[_0xf59f('0xa')]);router[_0xf59f('0x8')](_0xf59f('0xb'),auth[_0xf59f('0x9')](),controller[_0xf59f('0xc')]);router[_0xf59f('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf59f('0xd')]);router[_0xf59f('0xe')]('/',auth[_0xf59f('0x9')](),controller['create']);router['put']('/:id',auth[_0xf59f('0x9')](),controller[_0xf59f('0xf')]);router['delete']('/:id',auth[_0xf59f('0x9')](),controller['destroy']);module[_0xf59f('0x10')]=router; \ No newline at end of file +var _0x87eb=['fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','put','update','delete','util','path','Router'];(function(_0x26562b,_0x5ab9f5){var _0x2c9633=function(_0x53a296){while(--_0x53a296){_0x26562b['push'](_0x26562b['shift']());}};_0x2c9633(++_0x5ab9f5);}(_0x87eb,0x177));var _0xb87e=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x87eb[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require('multer');var util=require(_0xb87e('0x0'));var path=require(_0xb87e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb87e('0x2')]();var fs_extra=require(_0xb87e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb87e('0x4'));var config=require(_0xb87e('0x5'));var controller=require(_0xb87e('0x6'));router['get']('/',auth[_0xb87e('0x7')](),controller[_0xb87e('0x8')]);router[_0xb87e('0x9')](_0xb87e('0xa'),auth[_0xb87e('0x7')](),controller[_0xb87e('0xb')]);router[_0xb87e('0x9')](_0xb87e('0xc'),auth['isAuthenticated'](),controller[_0xb87e('0xd')]);router[_0xb87e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb87e('0xf')]('/:id',auth[_0xb87e('0x7')](),controller[_0xb87e('0x10')]);router[_0xb87e('0x11')](_0xb87e('0xa'),auth[_0xb87e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 705a57c..9c29a45 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 _0x8b38=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x8b38,0x11f));var _0x88b3=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0x8b38[_0x4c321c];return _0x25accb;};'use strict';var Sequelize=require(_0x88b3('0x0'));module[_0x88b3('0x1')]={'field':{'type':Sequelize[_0x88b3('0x2')]},'alias':{'type':Sequelize[_0x88b3('0x3')]},'function':{'type':Sequelize[_0x88b3('0x3')]},'format':{'type':Sequelize[_0x88b3('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x88b3('0x3')]},'custom':{'type':Sequelize[_0x88b3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c47=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x321fa6,_0x44e5d0){var _0x5d3f78=function(_0x5045cf){while(--_0x5045cf){_0x321fa6['push'](_0x321fa6['shift']());}};_0x5d3f78(++_0x44e5d0);}(_0x6c47,0x121));var _0x76c4=function(_0x1c0cc0,_0x5778ba){_0x1c0cc0=_0x1c0cc0-0x0;var _0x4599db=_0x6c47[_0x1c0cc0];return _0x4599db;};'use strict';var Sequelize=require(_0x76c4('0x0'));module['exports']={'field':{'type':Sequelize[_0x76c4('0x1')]},'alias':{'type':Sequelize[_0x76c4('0x2')]},'function':{'type':Sequelize[_0x76c4('0x2')]},'format':{'type':Sequelize[_0x76c4('0x2')]},'groupBy':{'type':Sequelize[_0x76c4('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x76c4('0x2')]},'custom':{'type':Sequelize[_0x76c4('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 884c691..8bd24fd 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 _0xd7a0=['AnalyticCustomReport','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','bulkDestroy','destroy','ids'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd7a0,0x150));var _0x0d7a=function(_0x2f56be,_0x4ec278){_0x2f56be=_0x2f56be-0x0;var _0x46db32=_0xd7a0[_0x2f56be];return _0x46db32;};'use strict';var emlformat=require(_0x0d7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d7a('0x1'));var jsonpatch=require(_0x0d7a('0x2'));var rp=require(_0x0d7a('0x3'));var moment=require('moment');var BPromise=require(_0x0d7a('0x4'));var Mustache=require(_0x0d7a('0x5'));var util=require(_0x0d7a('0x6'));var path=require(_0x0d7a('0x7'));var sox=require(_0x0d7a('0x8'));var csv=require('to-csv');var ejs=require(_0x0d7a('0x9'));var fs=require('fs');var fs_extra=require(_0x0d7a('0xa'));var _=require(_0x0d7a('0xb'));var squel=require(_0x0d7a('0xc'));var crypto=require(_0x0d7a('0xd'));var jsforce=require(_0x0d7a('0xe'));var deskjs=require(_0x0d7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d7a('0x10'));var Papa=require(_0x0d7a('0x11'));var Redis=require(_0x0d7a('0x12'));var authService=require(_0x0d7a('0x13'));var qs=require(_0x0d7a('0x14'));var as=require(_0x0d7a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d7a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0d7a('0x17'));var licenseUtil=require(_0x0d7a('0x18'));var db=require(_0x0d7a('0x19'))['db'];function respondWithStatusCode(_0x3fda18,_0x1940e4){_0x1940e4=_0x1940e4||0xcc;return function(_0x3f5c6b){if(_0x3f5c6b){return _0x3fda18[_0x0d7a('0x1a')](_0x1940e4);}return _0x3fda18[_0x0d7a('0x1b')](_0x1940e4)[_0x0d7a('0x1c')]();};}function respondWithResult(_0x4fc7e6,_0x1bd23d){_0x1bd23d=_0x1bd23d||0xc8;return function(_0x30da90){if(_0x30da90){return _0x4fc7e6[_0x0d7a('0x1b')](_0x1bd23d)['json'](_0x30da90);}};}function respondWithFilteredResult(_0x514a40,_0x177e88){return function(_0x2bce9e){if(_0x2bce9e){var _0x689f08=typeof _0x177e88[_0x0d7a('0x1d')]===_0x0d7a('0x1e')&&typeof _0x177e88[_0x0d7a('0x1f')]===_0x0d7a('0x1e');var _0xebdea2=_0x2bce9e[_0x0d7a('0x20')];var _0x3a1426=_0x689f08?0x0:_0x177e88[_0x0d7a('0x1d')];var _0x346c47=_0x689f08?_0x2bce9e['count']:_0x177e88[_0x0d7a('0x1d')]+_0x177e88[_0x0d7a('0x1f')];var _0x1f215a;if(_0x346c47>=_0xebdea2){_0x346c47=_0xebdea2;_0x1f215a=0xc8;}else{_0x1f215a=0xce;}_0x514a40['status'](_0x1f215a);return _0x514a40[_0x0d7a('0x21')]('Content-Range',_0x3a1426+'-'+_0x346c47+'/'+_0xebdea2)[_0x0d7a('0x22')](_0x2bce9e);}return null;};}function patchUpdates(_0xb74811){return function(_0x5551c5){try{jsonpatch['apply'](_0x5551c5,_0xb74811,!![]);}catch(_0x5632fd){return BPromise[_0x0d7a('0x23')](_0x5632fd);}return _0x5551c5[_0x0d7a('0x24')]();};}function saveUpdates(_0x3e2573,_0x495af6){return function(_0x18165b){if(_0x18165b){return _0x18165b[_0x0d7a('0x25')](_0x3e2573)[_0x0d7a('0x26')](function(_0x4aef8c){return _0x4aef8c;});}return null;};}function removeEntity(_0x408311,_0x219446){return function(_0x4f84b2){if(_0x4f84b2){return _0x4f84b2['destroy']()[_0x0d7a('0x26')](function(){_0x408311['status'](0xcc)[_0x0d7a('0x1c')]();});}};}function handleEntityNotFound(_0x160c66,_0x5e19d7){return function(_0x92b1cc){if(!_0x92b1cc){_0x160c66[_0x0d7a('0x1a')](0x194);}return _0x92b1cc;};}function handleError(_0x101a57,_0xc9040b){_0xc9040b=_0xc9040b||0x1f4;return function(_0x2cba65){logger[_0x0d7a('0x27')](_0x2cba65[_0x0d7a('0x28')]);if(_0x2cba65[_0x0d7a('0x29')]){delete _0x2cba65['name'];}_0x101a57[_0x0d7a('0x1b')](_0xc9040b)[_0x0d7a('0x2a')](_0x2cba65);};}exports[_0x0d7a('0x2b')]=function(_0xbbd19b,_0x44f962){var _0x5dc855={},_0x1f6179={},_0x52d63f={'count':0x0,'rows':[]};var _0x3f2c4f=_[_0x0d7a('0x2c')](db[_0x0d7a('0x2d')][_0x0d7a('0x2e')],function(_0x4135f3){return{'name':_0x4135f3[_0x0d7a('0x2f')],'type':_0x4135f3['type'][_0x0d7a('0x30')]};});_0x1f6179['model']=_[_0x0d7a('0x2c')](_0x3f2c4f,_0x0d7a('0x29'));_0x1f6179['query']=_[_0x0d7a('0x31')](_0xbbd19b[_0x0d7a('0x32')]);_0x1f6179['filters']=_[_0x0d7a('0x33')](_0x1f6179[_0x0d7a('0x34')],_0x1f6179['query']);_0x5dc855[_0x0d7a('0x35')]=_['intersection'](_0x1f6179[_0x0d7a('0x34')],qs['fields'](_0xbbd19b[_0x0d7a('0x32')][_0x0d7a('0x36')]));_0x5dc855[_0x0d7a('0x35')]=_0x5dc855[_0x0d7a('0x35')][_0x0d7a('0x37')]?_0x5dc855[_0x0d7a('0x35')]:_0x1f6179[_0x0d7a('0x34')];if(!_0xbbd19b[_0x0d7a('0x32')]['hasOwnProperty'](_0x0d7a('0x38'))){_0x5dc855['limit']=qs[_0x0d7a('0x1f')](_0xbbd19b[_0x0d7a('0x32')][_0x0d7a('0x1f')]);_0x5dc855[_0x0d7a('0x1d')]=qs[_0x0d7a('0x1d')](_0xbbd19b[_0x0d7a('0x32')][_0x0d7a('0x1d')]);}_0x5dc855[_0x0d7a('0x39')]=qs['sort'](_0xbbd19b[_0x0d7a('0x32')]['sort']);_0x5dc855[_0x0d7a('0x3a')]=qs['filters'](_[_0x0d7a('0x3b')](_0xbbd19b[_0x0d7a('0x32')],_0x1f6179[_0x0d7a('0x3c')]),_0x3f2c4f);if(_0xbbd19b[_0x0d7a('0x32')][_0x0d7a('0x3d')]){_0x5dc855['where']=_[_0x0d7a('0x3e')](_0x5dc855[_0x0d7a('0x3a')],{'$or':_[_0x0d7a('0x2c')](_0x3f2c4f,function(_0x938712){if(_0x938712[_0x0d7a('0x3f')]!==_0x0d7a('0x40')){var _0x35c469={};_0x35c469[_0x938712[_0x0d7a('0x29')]]={'$like':'%'+_0xbbd19b[_0x0d7a('0x32')]['filter']+'%'};return _0x35c469;}})});}_0x5dc855=_['merge']({},_0x5dc855,_0xbbd19b['options']);var _0x196c57={'where':_0x5dc855['where']};return db[_0x0d7a('0x2d')]['count'](_0x196c57)['then'](function(_0x3ec254){_0x52d63f[_0x0d7a('0x20')]=_0x3ec254;if(_0xbbd19b[_0x0d7a('0x32')][_0x0d7a('0x41')]){_0x5dc855['include']=[{'all':!![]}];}return db[_0x0d7a('0x2d')][_0x0d7a('0x42')](_0x5dc855);})[_0x0d7a('0x26')](function(_0x12338f){_0x52d63f[_0x0d7a('0x43')]=_0x12338f;return _0x52d63f;})[_0x0d7a('0x26')](respondWithFilteredResult(_0x44f962,_0x5dc855))[_0x0d7a('0x44')](handleError(_0x44f962,null));};exports[_0x0d7a('0x45')]=function(_0x57a218,_0x106f08){var _0x1acf9a={'raw':![],'where':{'id':_0x57a218[_0x0d7a('0x46')]['id']}},_0x3db712={};_0x3db712[_0x0d7a('0x34')]=_[_0x0d7a('0x31')](db[_0x0d7a('0x2d')][_0x0d7a('0x2e')]);_0x3db712[_0x0d7a('0x32')]=_[_0x0d7a('0x31')](_0x57a218[_0x0d7a('0x32')]);_0x3db712[_0x0d7a('0x3c')]=_[_0x0d7a('0x33')](_0x3db712[_0x0d7a('0x34')],_0x3db712[_0x0d7a('0x32')]);_0x1acf9a['attributes']=_[_0x0d7a('0x33')](_0x3db712[_0x0d7a('0x34')],qs[_0x0d7a('0x36')](_0x57a218[_0x0d7a('0x32')]['fields']));_0x1acf9a[_0x0d7a('0x35')]=_0x1acf9a[_0x0d7a('0x35')][_0x0d7a('0x37')]?_0x1acf9a[_0x0d7a('0x35')]:_0x3db712['model'];if(_0x57a218[_0x0d7a('0x32')]['includeAll']){_0x1acf9a[_0x0d7a('0x47')]=[{'all':!![]}];}_0x1acf9a=_[_0x0d7a('0x3e')]({},_0x1acf9a,_0x57a218[_0x0d7a('0x48')]);return db[_0x0d7a('0x2d')]['find'](_0x1acf9a)[_0x0d7a('0x26')](handleEntityNotFound(_0x106f08,null))[_0x0d7a('0x26')](respondWithResult(_0x106f08,null))[_0x0d7a('0x44')](handleError(_0x106f08,null));};exports[_0x0d7a('0x49')]=function(_0xa94503,_0xe4ef63){return db[_0x0d7a('0x2d')][_0x0d7a('0x49')](_0xa94503['body'],{})['then'](respondWithResult(_0xe4ef63,0xc9))[_0x0d7a('0x44')](handleError(_0xe4ef63,null));};exports['bulkCreate']=function(_0x275e96,_0x5b5979){return db[_0x0d7a('0x2d')]['bulkCreate'](_0x275e96[_0x0d7a('0x4a')],{'raw':![],'individualHooks':!![]})[_0x0d7a('0x26')](respondWithResult(_0x5b5979,0xc9))[_0x0d7a('0x44')](handleError(_0x5b5979,null));};exports['update']=function(_0x2e86d0,_0x1e0f4a){if(_0x2e86d0['body']['id']){delete _0x2e86d0[_0x0d7a('0x4a')]['id'];}return db[_0x0d7a('0x2d')][_0x0d7a('0x4b')]({'where':{'id':_0x2e86d0[_0x0d7a('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e0f4a,null))[_0x0d7a('0x26')](saveUpdates(_0x2e86d0['body'],null))[_0x0d7a('0x26')](respondWithResult(_0x1e0f4a,null))[_0x0d7a('0x44')](handleError(_0x1e0f4a,null));};exports['destroy']=function(_0x5067c7,_0x5a4109){return db[_0x0d7a('0x2d')][_0x0d7a('0x4b')]({'where':{'id':_0x5067c7[_0x0d7a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a4109,null))[_0x0d7a('0x26')](removeEntity(_0x5a4109,null))[_0x0d7a('0x44')](handleError(_0x5a4109,null));};exports[_0x0d7a('0x4c')]=function(_0x50f657,_0x5bcfe9){return db['AnalyticFieldReport'][_0x0d7a('0x4d')]({'where':{'id':_0x50f657['query'][_0x0d7a('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5bcfe9,0xcc))[_0x0d7a('0x44')](handleError(_0x5bcfe9,null));};exports['addFields']=function(_0x3b737e,_0x478968,_0x5bb6e5){return db[_0x0d7a('0x4f')]['findOne']({'where':{'id':_0x3b737e[_0x0d7a('0x46')]['id']}})[_0x0d7a('0x26')](handleEntityNotFound(_0x478968,null))[_0x0d7a('0x26')](function(_0x4b6e55){if(_0x4b6e55){return db[_0x0d7a('0x50')][_0x0d7a('0x51')](function(_0x1f195f){return db['AnalyticFieldReport'][_0x0d7a('0x4d')]({'where':{'CustomReportId':_0x3b737e[_0x0d7a('0x46')]['id']},'transaction':_0x1f195f})[_0x0d7a('0x26')](function(_0x2e0080){var _0x3f2eee=_[_0x0d7a('0x2c')](_0x3b737e['body'],function(_0x2a60c1){delete _0x2a60c1['id'];_0x2a60c1['CustomReportId']=_0x3b737e[_0x0d7a('0x46')]['id'];return _0x2a60c1;});return db[_0x0d7a('0x2d')][_0x0d7a('0x52')](_0x3f2eee,{'transaction':_0x1f195f});});})[_0x0d7a('0x26')](function(){return db[_0x0d7a('0x2d')]['findAll']({'where':{'CustomReportId':_0x3b737e[_0x0d7a('0x46')]['id']}});});}})['then'](respondWithResult(_0x478968,null))['catch'](handleError(_0x478968,null));}; \ No newline at end of file +var _0xff31=['CustomReportId','findAll','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','AnalyticFieldReport','rows','catch','show','params','keys','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction'];(function(_0x2c979b,_0x5dfacc){var _0x1330a0=function(_0x2ae52b){while(--_0x2ae52b){_0x2c979b['push'](_0x2c979b['shift']());}};_0x1330a0(++_0x5dfacc);}(_0xff31,0xfe));var _0x1ff3=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xff31[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x1ff3('0x0'));var rimraf=require(_0x1ff3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ff3('0x2'));var rp=require('request-promise');var moment=require(_0x1ff3('0x3'));var BPromise=require(_0x1ff3('0x4'));var Mustache=require(_0x1ff3('0x5'));var util=require(_0x1ff3('0x6'));var path=require('path');var sox=require(_0x1ff3('0x7'));var csv=require(_0x1ff3('0x8'));var ejs=require(_0x1ff3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ff3('0xa'));var _=require(_0x1ff3('0xb'));var squel=require(_0x1ff3('0xc'));var crypto=require('crypto');var jsforce=require(_0x1ff3('0xd'));var deskjs=require(_0x1ff3('0xe'));var toCsv=require(_0x1ff3('0x8'));var querystring=require('querystring');var Papa=require(_0x1ff3('0xf'));var Redis=require('ioredis');var authService=require(_0x1ff3('0x10'));var qs=require(_0x1ff3('0x11'));var as=require(_0x1ff3('0x12'));var hardwareService=require(_0x1ff3('0x13'));var logger=require(_0x1ff3('0x14'))('api');var utils=require(_0x1ff3('0x15'));var config=require(_0x1ff3('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x258b19,_0x38ed34){_0x38ed34=_0x38ed34||0xcc;return function(_0x460383){if(_0x460383){return _0x258b19['sendStatus'](_0x38ed34);}return _0x258b19[_0x1ff3('0x17')](_0x38ed34)[_0x1ff3('0x18')]();};}function respondWithResult(_0x16e649,_0x1483bd){_0x1483bd=_0x1483bd||0xc8;return function(_0x32c80d){if(_0x32c80d){return _0x16e649[_0x1ff3('0x17')](_0x1483bd)[_0x1ff3('0x19')](_0x32c80d);}};}function respondWithFilteredResult(_0x2c038b,_0x1b35c8){return function(_0xacf13f){if(_0xacf13f){var _0x559b25=typeof _0x1b35c8[_0x1ff3('0x1a')]===_0x1ff3('0x1b')&&typeof _0x1b35c8[_0x1ff3('0x1c')]===_0x1ff3('0x1b');var _0xc3ca85=_0xacf13f['count'];var _0x138fc7=_0x559b25?0x0:_0x1b35c8[_0x1ff3('0x1a')];var _0x4863ef=_0x559b25?_0xacf13f[_0x1ff3('0x1d')]:_0x1b35c8['offset']+_0x1b35c8[_0x1ff3('0x1c')];var _0x3e10fb;if(_0x4863ef>=_0xc3ca85){_0x4863ef=_0xc3ca85;_0x3e10fb=0xc8;}else{_0x3e10fb=0xce;}_0x2c038b[_0x1ff3('0x17')](_0x3e10fb);return _0x2c038b[_0x1ff3('0x1e')](_0x1ff3('0x1f'),_0x138fc7+'-'+_0x4863ef+'/'+_0xc3ca85)[_0x1ff3('0x19')](_0xacf13f);}return null;};}function patchUpdates(_0xbc0511){return function(_0x2ff928){try{jsonpatch[_0x1ff3('0x20')](_0x2ff928,_0xbc0511,!![]);}catch(_0x5224bd){return BPromise[_0x1ff3('0x21')](_0x5224bd);}return _0x2ff928[_0x1ff3('0x22')]();};}function saveUpdates(_0x3c841b,_0x2c9c03){return function(_0x37a0db){if(_0x37a0db){return _0x37a0db[_0x1ff3('0x23')](_0x3c841b)[_0x1ff3('0x24')](function(_0x24af53){return _0x24af53;});}return null;};}function removeEntity(_0x549620,_0x3206c5){return function(_0x30ecf2){if(_0x30ecf2){return _0x30ecf2['destroy']()[_0x1ff3('0x24')](function(){_0x549620[_0x1ff3('0x17')](0xcc)[_0x1ff3('0x18')]();});}};}function handleEntityNotFound(_0x457df6,_0x170f1a){return function(_0x18e24c){if(!_0x18e24c){_0x457df6['sendStatus'](0x194);}return _0x18e24c;};}function handleError(_0x2ed03e,_0x5720f3){_0x5720f3=_0x5720f3||0x1f4;return function(_0x1d340f){logger[_0x1ff3('0x25')](_0x1d340f['stack']);if(_0x1d340f[_0x1ff3('0x26')]){delete _0x1d340f['name'];}_0x2ed03e[_0x1ff3('0x17')](_0x5720f3)[_0x1ff3('0x27')](_0x1d340f);};}exports[_0x1ff3('0x28')]=function(_0x319a8c,_0x26e593){var _0x3e4459={},_0x1cef73={},_0x361888={'count':0x0,'rows':[]};var _0x43fd3e=_[_0x1ff3('0x29')](db['AnalyticFieldReport'][_0x1ff3('0x2a')],function(_0xe20935){return{'name':_0xe20935[_0x1ff3('0x2b')],'type':_0xe20935['type'][_0x1ff3('0x2c')]};});_0x1cef73[_0x1ff3('0x2d')]=_[_0x1ff3('0x29')](_0x43fd3e,_0x1ff3('0x26'));_0x1cef73['query']=_['keys'](_0x319a8c[_0x1ff3('0x2e')]);_0x1cef73[_0x1ff3('0x2f')]=_[_0x1ff3('0x30')](_0x1cef73[_0x1ff3('0x2d')],_0x1cef73[_0x1ff3('0x2e')]);_0x3e4459[_0x1ff3('0x31')]=_[_0x1ff3('0x30')](_0x1cef73[_0x1ff3('0x2d')],qs[_0x1ff3('0x32')](_0x319a8c[_0x1ff3('0x2e')][_0x1ff3('0x32')]));_0x3e4459['attributes']=_0x3e4459[_0x1ff3('0x31')][_0x1ff3('0x33')]?_0x3e4459[_0x1ff3('0x31')]:_0x1cef73['model'];if(!_0x319a8c[_0x1ff3('0x2e')][_0x1ff3('0x34')](_0x1ff3('0x35'))){_0x3e4459[_0x1ff3('0x1c')]=qs[_0x1ff3('0x1c')](_0x319a8c[_0x1ff3('0x2e')][_0x1ff3('0x1c')]);_0x3e4459[_0x1ff3('0x1a')]=qs[_0x1ff3('0x1a')](_0x319a8c[_0x1ff3('0x2e')][_0x1ff3('0x1a')]);}_0x3e4459[_0x1ff3('0x36')]=qs[_0x1ff3('0x37')](_0x319a8c[_0x1ff3('0x2e')]['sort']);_0x3e4459[_0x1ff3('0x38')]=qs[_0x1ff3('0x2f')](_['pick'](_0x319a8c['query'],_0x1cef73[_0x1ff3('0x2f')]),_0x43fd3e);if(_0x319a8c['query'][_0x1ff3('0x39')]){_0x3e4459['where']=_[_0x1ff3('0x3a')](_0x3e4459[_0x1ff3('0x38')],{'$or':_[_0x1ff3('0x29')](_0x43fd3e,function(_0x13a74d){if(_0x13a74d[_0x1ff3('0x3b')]!==_0x1ff3('0x3c')){var _0x5c7dd1={};_0x5c7dd1[_0x13a74d[_0x1ff3('0x26')]]={'$like':'%'+_0x319a8c[_0x1ff3('0x2e')][_0x1ff3('0x39')]+'%'};return _0x5c7dd1;}})});}_0x3e4459=_[_0x1ff3('0x3a')]({},_0x3e4459,_0x319a8c[_0x1ff3('0x3d')]);var _0x475a90={'where':_0x3e4459['where']};return db['AnalyticFieldReport'][_0x1ff3('0x1d')](_0x475a90)['then'](function(_0x20b41b){_0x361888[_0x1ff3('0x1d')]=_0x20b41b;if(_0x319a8c['query'][_0x1ff3('0x3e')]){_0x3e4459[_0x1ff3('0x3f')]=[{'all':!![]}];}return db[_0x1ff3('0x40')]['findAll'](_0x3e4459);})[_0x1ff3('0x24')](function(_0xac33cc){_0x361888[_0x1ff3('0x41')]=_0xac33cc;return _0x361888;})[_0x1ff3('0x24')](respondWithFilteredResult(_0x26e593,_0x3e4459))[_0x1ff3('0x42')](handleError(_0x26e593,null));};exports[_0x1ff3('0x43')]=function(_0x196ed6,_0x2b001c){var _0x395402={'raw':![],'where':{'id':_0x196ed6[_0x1ff3('0x44')]['id']}},_0x5ea732={};_0x5ea732[_0x1ff3('0x2d')]=_['keys'](db['AnalyticFieldReport'][_0x1ff3('0x2a')]);_0x5ea732[_0x1ff3('0x2e')]=_[_0x1ff3('0x45')](_0x196ed6[_0x1ff3('0x2e')]);_0x5ea732['filters']=_[_0x1ff3('0x30')](_0x5ea732['model'],_0x5ea732[_0x1ff3('0x2e')]);_0x395402[_0x1ff3('0x31')]=_[_0x1ff3('0x30')](_0x5ea732[_0x1ff3('0x2d')],qs[_0x1ff3('0x32')](_0x196ed6['query']['fields']));_0x395402[_0x1ff3('0x31')]=_0x395402[_0x1ff3('0x31')][_0x1ff3('0x33')]?_0x395402[_0x1ff3('0x31')]:_0x5ea732['model'];if(_0x196ed6[_0x1ff3('0x2e')]['includeAll']){_0x395402[_0x1ff3('0x3f')]=[{'all':!![]}];}_0x395402=_[_0x1ff3('0x3a')]({},_0x395402,_0x196ed6[_0x1ff3('0x3d')]);return db['AnalyticFieldReport'][_0x1ff3('0x46')](_0x395402)[_0x1ff3('0x24')](handleEntityNotFound(_0x2b001c,null))['then'](respondWithResult(_0x2b001c,null))['catch'](handleError(_0x2b001c,null));};exports[_0x1ff3('0x47')]=function(_0x4b8ffc,_0x3a7d26){return db[_0x1ff3('0x40')][_0x1ff3('0x47')](_0x4b8ffc[_0x1ff3('0x48')],{})[_0x1ff3('0x24')](respondWithResult(_0x3a7d26,0xc9))[_0x1ff3('0x42')](handleError(_0x3a7d26,null));};exports[_0x1ff3('0x49')]=function(_0x4afdab,_0x1e3793){return db[_0x1ff3('0x40')][_0x1ff3('0x49')](_0x4afdab[_0x1ff3('0x48')],{'raw':![],'individualHooks':!![]})[_0x1ff3('0x24')](respondWithResult(_0x1e3793,0xc9))[_0x1ff3('0x42')](handleError(_0x1e3793,null));};exports['update']=function(_0x23ed68,_0x4ea8d1){if(_0x23ed68[_0x1ff3('0x48')]['id']){delete _0x23ed68['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x23ed68[_0x1ff3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ea8d1,null))['then'](saveUpdates(_0x23ed68[_0x1ff3('0x48')],null))['then'](respondWithResult(_0x4ea8d1,null))['catch'](handleError(_0x4ea8d1,null));};exports[_0x1ff3('0x4a')]=function(_0x4a72b8,_0x54e6bb){return db[_0x1ff3('0x40')][_0x1ff3('0x46')]({'where':{'id':_0x4a72b8[_0x1ff3('0x44')]['id']}})[_0x1ff3('0x24')](handleEntityNotFound(_0x54e6bb,null))[_0x1ff3('0x24')](removeEntity(_0x54e6bb,null))[_0x1ff3('0x42')](handleError(_0x54e6bb,null));};exports[_0x1ff3('0x4b')]=function(_0x32795c,_0x2d6eee){return db[_0x1ff3('0x40')]['destroy']({'where':{'id':_0x32795c[_0x1ff3('0x2e')][_0x1ff3('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x1ff3('0x24')](respondWithResult(_0x2d6eee,0xcc))[_0x1ff3('0x42')](handleError(_0x2d6eee,null));};exports[_0x1ff3('0x4d')]=function(_0x39cf22,_0x1de409,_0x179cf8){return db[_0x1ff3('0x4e')][_0x1ff3('0x4f')]({'where':{'id':_0x39cf22[_0x1ff3('0x44')]['id']}})['then'](handleEntityNotFound(_0x1de409,null))[_0x1ff3('0x24')](function(_0x5a6123){if(_0x5a6123){return db[_0x1ff3('0x50')][_0x1ff3('0x51')](function(_0x388871){return db[_0x1ff3('0x40')][_0x1ff3('0x4a')]({'where':{'CustomReportId':_0x39cf22['params']['id']},'transaction':_0x388871})[_0x1ff3('0x24')](function(_0x1484a){var _0x1069ec=_['map'](_0x39cf22[_0x1ff3('0x48')],function(_0x1c6437){delete _0x1c6437['id'];_0x1c6437[_0x1ff3('0x52')]=_0x39cf22['params']['id'];return _0x1c6437;});return db[_0x1ff3('0x40')][_0x1ff3('0x49')](_0x1069ec,{'transaction':_0x388871});});})['then'](function(){return db[_0x1ff3('0x40')][_0x1ff3('0x53')]({'where':{'CustomReportId':_0x39cf22[_0x1ff3('0x44')]['id']}});});}})[_0x1ff3('0x24')](respondWithResult(_0x1de409,null))[_0x1ff3('0x42')](handleError(_0x1de409,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 46a16b2..fb8ea81 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 _0xe5fd=['util','../../config/logger','api','moment','request-promise','rimraf','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe5fd,0x185));var _0xde5f=function(_0x370cdd,_0x849a63){_0x370cdd=_0x370cdd-0x0;var _0x464f0f=_0xe5fd[_0x370cdd];return _0x464f0f;};'use strict';var _=require(_0xde5f('0x0'));var util=require(_0xde5f('0x1'));var logger=require(_0xde5f('0x2'))(_0xde5f('0x3'));var moment=require(_0xde5f('0x4'));var BPromise=require('bluebird');var rp=require(_0xde5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde5f('0x6'));var config=require('../../config/environment');var attributes=require(_0xde5f('0x7'));module[_0xde5f('0x8')]=function(_0x51b4b9,_0x31425b){return _0x51b4b9['define']('AnalyticFieldReport',attributes,{'tableName':_0xde5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd798=['define','AnalyticFieldReport','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xd798,0x12b));var _0x8d79=function(_0x421609,_0x31f6cc){_0x421609=_0x421609-0x0;var _0x467e4f=_0xd798[_0x421609];return _0x467e4f;};'use strict';var _=require(_0x8d79('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d79('0x1'));var moment=require(_0x8d79('0x2'));var BPromise=require(_0x8d79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d79('0x4'));var rimraf=require(_0x8d79('0x5'));var config=require(_0x8d79('0x6'));var attributes=require(_0x8d79('0x7'));module[_0x8d79('0x8')]=function(_0x3f06ca,_0x1fe355){return _0x3f06ca[_0x8d79('0x9')](_0x8d79('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 2ca10d8..fedecaa 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 _0xffc0=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x175941,_0x2e476a){var _0x2f5dff=function(_0x5a4ba2){while(--_0x5a4ba2){_0x175941['push'](_0x175941['shift']());}};_0x2f5dff(++_0x2e476a);}(_0xffc0,0x69));var _0x0ffc=function(_0x53feff,_0x3a9a7a){_0x53feff=_0x53feff-0x0;var _0x29d81d=_0xffc0[_0x53feff];return _0x29d81d;};'use strict';var _=require(_0x0ffc('0x0'));var util=require(_0x0ffc('0x1'));var moment=require(_0x0ffc('0x2'));var BPromise=require(_0x0ffc('0x3'));var rs=require(_0x0ffc('0x4'));var fs=require('fs');var Redis=require(_0x0ffc('0x5'));var db=require(_0x0ffc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ffc('0x7'))(_0x0ffc('0x8'));var config=require(_0x0ffc('0x9'));var jayson=require(_0x0ffc('0xa'));var client=jayson['client'][_0x0ffc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b44,_0x25efb6,_0x252857){return new BPromise(function(_0x540db8,_0x3f0a7c){return client['request'](_0x5a5b44,_0x252857)[_0x0ffc('0xc')](function(_0x5d41d5){logger[_0x0ffc('0xd')](_0x0ffc('0xe'),_0x25efb6,_0x0ffc('0xf'));logger['debug'](_0x0ffc('0x10'),_0x25efb6,'request\x20sent',JSON['stringify'](_0x5d41d5));if(_0x5d41d5[_0x0ffc('0x11')]){if(_0x5d41d5[_0x0ffc('0x11')][_0x0ffc('0x12')]===0x1f4){logger['error'](_0x0ffc('0xe'),_0x25efb6,_0x5d41d5[_0x0ffc('0x11')][_0x0ffc('0x13')]);return _0x3f0a7c(_0x5d41d5[_0x0ffc('0x11')]['message']);}logger['error'](_0x0ffc('0xe'),_0x25efb6,_0x5d41d5[_0x0ffc('0x11')][_0x0ffc('0x13')]);return _0x540db8(_0x5d41d5['error'][_0x0ffc('0x13')]);}else{logger[_0x0ffc('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x25efb6,_0x0ffc('0xf'));_0x540db8(_0x5d41d5[_0x0ffc('0x14')][_0x0ffc('0x13')]);}})[_0x0ffc('0x15')](function(_0x339856){logger[_0x0ffc('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x25efb6,_0x339856);_0x3f0a7c(_0x339856);});});} \ No newline at end of file +var _0x491f=['randomstring','../../mysqldb','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment'];(function(_0x5cacd7,_0x14d505){var _0x25afde=function(_0x34459b){while(--_0x34459b){_0x5cacd7['push'](_0x5cacd7['shift']());}};_0x25afde(++_0x14d505);}(_0x491f,0x19f));var _0xf491=function(_0xe02ad0,_0x52353b){_0xe02ad0=_0xe02ad0-0x0;var _0x54e767=_0x491f[_0xe02ad0];return _0x54e767;};'use strict';var _=require(_0xf491('0x0'));var util=require(_0xf491('0x1'));var moment=require(_0xf491('0x2'));var BPromise=require('bluebird');var rs=require(_0xf491('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf491('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf491('0x5'));var client=jayson[_0xf491('0x6')][_0xf491('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x391189,_0x5261a3,_0x507938){return new BPromise(function(_0x2735e0,_0x305386){return client[_0xf491('0x8')](_0x391189,_0x507938)['then'](function(_0x35383f){logger['info'](_0xf491('0x9'),_0x5261a3,_0xf491('0xa'));logger[_0xf491('0xb')](_0xf491('0xc'),_0x5261a3,_0xf491('0xa'),JSON[_0xf491('0xd')](_0x35383f));if(_0x35383f['error']){if(_0x35383f[_0xf491('0xe')]['code']===0x1f4){logger[_0xf491('0xe')](_0xf491('0x9'),_0x5261a3,_0x35383f[_0xf491('0xe')]['message']);return _0x305386(_0x35383f[_0xf491('0xe')][_0xf491('0xf')]);}logger[_0xf491('0xe')](_0xf491('0x9'),_0x5261a3,_0x35383f[_0xf491('0xe')]['message']);return _0x2735e0(_0x35383f['error']['message']);}else{logger[_0xf491('0x10')](_0xf491('0x9'),_0x5261a3,_0xf491('0xa'));_0x2735e0(_0x35383f[_0xf491('0x11')][_0xf491('0xf')]);}})[_0xf491('0x12')](function(_0x145765){logger[_0xf491('0xe')](_0xf491('0x9'),_0x5261a3,_0x145765);_0x305386(_0x145765);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e9c57aa..b88ecd6 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(_0xa746fd,_0x3cc0a4){var _0x3bf7da=function(_0x483617){while(--_0x483617){_0xa746fd['push'](_0xa746fd['shift']());}};_0x3bf7da(++_0x3cc0a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x3edc9c,_0x5139ce){var _0x4a4c72=function(_0x37ae20){while(--_0x37ae20){_0x3edc9c['push'](_0x3edc9c['shift']());}};_0x4a4c72(++_0x5139ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 dd9263e..5463003 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 _0xf151=['STRING','name','TEXT'];(function(_0x4b02d1,_0xb4dac5){var _0x28c865=function(_0x1fe4fb){while(--_0x1fe4fb){_0x4b02d1['push'](_0x4b02d1['shift']());}};_0x28c865(++_0xb4dac5);}(_0xf151,0xab));var _0x1f15=function(_0x15760c,_0x214df2){_0x15760c=_0x15760c-0x0;var _0x175316=_0xf151[_0x15760c];return _0x175316;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1f15('0x0')],'allowNull':![],'unique':_0x1f15('0x1')},'table':{'type':Sequelize[_0x1f15('0x0')]},'metric':{'type':Sequelize[_0x1f15('0x2')]},'description':{'type':Sequelize[_0x1f15('0x0')]}}; \ No newline at end of file +var _0x63eb=['exports','STRING','name','TEXT','sequelize'];(function(_0x3148a6,_0x286b6e){var _0x1d6843=function(_0x646251){while(--_0x646251){_0x3148a6['push'](_0x3148a6['shift']());}};_0x1d6843(++_0x286b6e);}(_0x63eb,0x90));var _0xb63e=function(_0xa4ccd8,_0x5d4136){_0xa4ccd8=_0xa4ccd8-0x0;var _0x276358=_0x63eb[_0xa4ccd8];return _0x276358;};'use strict';var Sequelize=require(_0xb63e('0x0'));module[_0xb63e('0x1')]={'name':{'type':Sequelize[_0xb63e('0x2')],'allowNull':![],'unique':_0xb63e('0x3')},'table':{'type':Sequelize[_0xb63e('0x2')]},'metric':{'type':Sequelize[_0xb63e('0x4')]},'description':{'type':Sequelize[_0xb63e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 631b50d..a66b559 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4c692d,_0x421e58){var _0xa81cd1=function(_0x20a6ea){while(--_0x20a6ea){_0x4c692d['push'](_0x4c692d['shift']());}};_0xa81cd1(++_0x421e58);}(_0x4b84,0x1cc));var _0x44b8=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x4b84[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file +var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x11eaea,_0x1854dd){var _0x34fabe=function(_0x181c3e){while(--_0x181c3e){_0x11eaea['push'](_0x11eaea['shift']());}};_0x34fabe(++_0x1854dd);}(_0x24ca,0x1bc));var _0xa24c=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x24ca[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ef7bfd7..88df3c0 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 _0xdc03=['define','analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x172f55,_0x58cc1d){var _0x267083=function(_0x5b3672){while(--_0x5b3672){_0x172f55['push'](_0x172f55['shift']());}};_0x267083(++_0x58cc1d);}(_0xdc03,0x65));var _0x3dc0=function(_0x4ffc4f,_0x53f1ea){_0x4ffc4f=_0x4ffc4f-0x0;var _0x1641c2=_0xdc03[_0x4ffc4f];return _0x1641c2;};'use strict';var _=require(_0x3dc0('0x0'));var util=require('util');var logger=require(_0x3dc0('0x1'))(_0x3dc0('0x2'));var moment=require('moment');var BPromise=require(_0x3dc0('0x3'));var rp=require(_0x3dc0('0x4'));var fs=require('fs');var path=require(_0x3dc0('0x5'));var rimraf=require(_0x3dc0('0x6'));var config=require(_0x3dc0('0x7'));var attributes=require(_0x3dc0('0x8'));module['exports']=function(_0x3c5407,_0x20c408){return _0x3c5407[_0x3dc0('0x9')]('AnalyticMetric',attributes,{'tableName':_0x3dc0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22ed=['../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5acebe,_0x1f2c20){var _0x4a5136=function(_0xcf061a){while(--_0xcf061a){_0x5acebe['push'](_0x5acebe['shift']());}};_0x4a5136(++_0x1f2c20);}(_0x22ed,0x1a9));var _0xd22e=function(_0xcc9399,_0x127ef1){_0xcc9399=_0xcc9399-0x0;var _0x6d6272=_0x22ed[_0xcc9399];return _0x6d6272;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var logger=require(_0xd22e('0x2'))(_0xd22e('0x3'));var moment=require(_0xd22e('0x4'));var BPromise=require(_0xd22e('0x5'));var rp=require(_0xd22e('0x6'));var fs=require('fs');var path=require(_0xd22e('0x7'));var rimraf=require(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var attributes=require(_0xd22e('0xa'));module[_0xd22e('0xb')]=function(_0x4cd924,_0x131034){return _0x4cd924[_0xd22e('0xc')]('AnalyticMetric',attributes,{'tableName':_0xd22e('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 7bd06b7..ff2954e 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 _0xb5c3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','ioredis'];(function(_0x32460d,_0x3ac014){var _0x6fd726=function(_0x41b1c8){while(--_0x41b1c8){_0x32460d['push'](_0x32460d['shift']());}};_0x6fd726(++_0x3ac014);}(_0xb5c3,0x1c8));var _0x3b5c=function(_0x848126,_0x43db0c){_0x848126=_0x848126-0x0;var _0xb53151=_0xb5c3[_0x848126];return _0xb53151;};'use strict';var _=require(_0x3b5c('0x0'));var util=require(_0x3b5c('0x1'));var moment=require('moment');var BPromise=require(_0x3b5c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b5c('0x4'));var logger=require(_0x3b5c('0x5'))(_0x3b5c('0x6'));var config=require(_0x3b5c('0x7'));var jayson=require(_0x3b5c('0x8'));var client=jayson[_0x3b5c('0x9')][_0x3b5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21c19f,_0xa5ff69,_0x42efa2){return new BPromise(function(_0x3a5de4,_0x1feacd){return client['request'](_0x21c19f,_0x42efa2)[_0x3b5c('0xb')](function(_0x2c5db1){logger[_0x3b5c('0xc')](_0x3b5c('0xd'),_0xa5ff69,'request\x20sent');logger[_0x3b5c('0xe')](_0x3b5c('0xf'),_0xa5ff69,_0x3b5c('0x10'),JSON[_0x3b5c('0x11')](_0x2c5db1));if(_0x2c5db1['error']){if(_0x2c5db1[_0x3b5c('0x12')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0xa5ff69,_0x2c5db1[_0x3b5c('0x12')][_0x3b5c('0x13')]);return _0x1feacd(_0x2c5db1[_0x3b5c('0x12')][_0x3b5c('0x13')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0xa5ff69,_0x2c5db1['error'][_0x3b5c('0x13')]);return _0x3a5de4(_0x2c5db1['error'][_0x3b5c('0x13')]);}else{logger[_0x3b5c('0xc')](_0x3b5c('0xd'),_0xa5ff69,_0x3b5c('0x10'));_0x3a5de4(_0x2c5db1['result'][_0x3b5c('0x13')]);}})['catch'](function(_0xdc0ddd){logger[_0x3b5c('0x12')](_0x3b5c('0xd'),_0xa5ff69,_0xdc0ddd);_0x1feacd(_0xdc0ddd);});});} \ No newline at end of file +var _0x523f=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0xf49a2e,_0x4164c8){var _0x382187=function(_0x3ac086){while(--_0x3ac086){_0xf49a2e['push'](_0xf49a2e['shift']());}};_0x382187(++_0x4164c8);}(_0x523f,0x6c));var _0xf523=function(_0x6d0617,_0xe9474c){_0x6d0617=_0x6d0617-0x0;var _0x127e50=_0x523f[_0x6d0617];return _0x127e50;};'use strict';var _=require(_0xf523('0x0'));var util=require(_0xf523('0x1'));var moment=require(_0xf523('0x2'));var BPromise=require(_0xf523('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf523('0x4'));var db=require(_0xf523('0x5'))['db'];var utils=require(_0xf523('0x6'));var logger=require(_0xf523('0x7'))(_0xf523('0x8'));var config=require(_0xf523('0x9'));var jayson=require(_0xf523('0xa'));var client=jayson[_0xf523('0xb')][_0xf523('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x175411,_0x1b136a,_0x17f33d){return new BPromise(function(_0x519b9e,_0x413756){return client['request'](_0x175411,_0x17f33d)['then'](function(_0x2c9dfc){logger[_0xf523('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x1b136a,'request\x20sent');logger['debug'](_0xf523('0xe'),_0x1b136a,_0xf523('0xf'),JSON[_0xf523('0x10')](_0x2c9dfc));if(_0x2c9dfc[_0xf523('0x11')]){if(_0x2c9dfc[_0xf523('0x11')]['code']===0x1f4){logger[_0xf523('0x11')](_0xf523('0x12'),_0x1b136a,_0x2c9dfc[_0xf523('0x11')]['message']);return _0x413756(_0x2c9dfc[_0xf523('0x11')][_0xf523('0x13')]);}logger['error'](_0xf523('0x12'),_0x1b136a,_0x2c9dfc[_0xf523('0x11')][_0xf523('0x13')]);return _0x519b9e(_0x2c9dfc[_0xf523('0x11')][_0xf523('0x13')]);}else{logger[_0xf523('0xd')](_0xf523('0x12'),_0x1b136a,_0xf523('0xf'));_0x519b9e(_0x2c9dfc[_0xf523('0x14')][_0xf523('0x13')]);}})[_0xf523('0x15')](function(_0x2adbd0){logger[_0xf523('0x11')](_0xf523('0x12'),_0x1b136a,_0x2adbd0);_0x413756(_0x2adbd0);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 7f90334..ad3b7a7 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 _0xdf70=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','show','post','create','put','update','delete','destroy'];(function(_0x23b111,_0x721d72){var _0x2db941=function(_0x4c97ee){while(--_0x4c97ee){_0x23b111['push'](_0x23b111['shift']());}};_0x2db941(++_0x721d72);}(_0xdf70,0x86));var _0x0df7=function(_0x4d4f5d,_0xc758de){_0x4d4f5d=_0x4d4f5d-0x0;var _0x2278a0=_0xdf70[_0x4d4f5d];return _0x2278a0;};'use strict';var multer=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var path=require(_0x0df7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0df7('0x3'));var router=express[_0x0df7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0df7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0df7('0x6'));var controller=require(_0x0df7('0x7'));router['get']('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0x9')]);router[_0x0df7('0xa')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xb')]);router[_0x0df7('0xc')]('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0xd')]);router[_0x0df7('0xe')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xf')]);router[_0x0df7('0x10')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0x11')]);module[_0x0df7('0x12')]=router; \ No newline at end of file +var _0xf6c1=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x281960,_0x1518c2){var _0xd8c43a=function(_0x3cedc4){while(--_0x3cedc4){_0x281960['push'](_0x281960['shift']());}};_0xd8c43a(++_0x1518c2);}(_0xf6c1,0x99));var _0x1f6c=function(_0xff9972,_0x49def9){_0xff9972=_0xff9972-0x0;var _0x24aed7=_0xf6c1[_0xff9972];return _0x24aed7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f6c('0x0'));var timeout=require(_0x1f6c('0x1'));var express=require(_0x1f6c('0x2'));var router=express['Router']();var fs_extra=require(_0x1f6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var controller=require(_0x1f6c('0x6'));router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router['get'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xb')]);router[_0x1f6c('0xc')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xd')]);router[_0x1f6c('0xe')](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller['update']);router['delete']('/:id',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xf')]);module[_0x1f6c('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 95790fe..b61e345 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 _0xb000=['sequelize','exports','TEXT'];(function(_0x105cd4,_0x5044e4){var _0x4636f8=function(_0x4634cb){while(--_0x4634cb){_0x105cd4['push'](_0x105cd4['shift']());}};_0x4636f8(++_0x5044e4);}(_0xb000,0x1a7));var _0x0b00=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xb000[_0x2e4cbf];return _0x52840f;};'use strict';var Sequelize=require(_0x0b00('0x0'));module[_0x0b00('0x1')]={'tree':{'type':Sequelize[_0x0b00('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2ac8=['sequelize','exports','TEXT'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x2ac8,0x9c));var _0x82ac=function(_0x4efee7,_0x2073a8){_0x4efee7=_0x4efee7-0x0;var _0x3cbe39=_0x2ac8[_0x4efee7];return _0x3cbe39;};'use strict';var Sequelize=require(_0x82ac('0x0'));module[_0x82ac('0x1')]={'tree':{'type':Sequelize[_0x82ac('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 2870297..63acd82 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 _0xc428=['path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','params','options','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1428d3,_0x925d43){var _0x103810=function(_0xfb0767){while(--_0xfb0767){_0x1428d3['push'](_0x1428d3['shift']());}};_0x103810(++_0x925d43);}(_0xc428,0x115));var _0x8c42=function(_0x5a29b4,_0x5bb024){_0x5a29b4=_0x5a29b4-0x0;var _0x12cecb=_0xc428[_0x5a29b4];return _0x12cecb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c42('0x0'));var jsonpatch=require(_0x8c42('0x1'));var rp=require(_0x8c42('0x2'));var moment=require(_0x8c42('0x3'));var BPromise=require(_0x8c42('0x4'));var Mustache=require(_0x8c42('0x5'));var util=require(_0x8c42('0x6'));var path=require(_0x8c42('0x7'));var sox=require(_0x8c42('0x8'));var csv=require('to-csv');var ejs=require(_0x8c42('0x9'));var fs=require('fs');var fs_extra=require(_0x8c42('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8c42('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8c42('0xc'));var toCsv=require(_0x8c42('0xd'));var querystring=require(_0x8c42('0xe'));var Papa=require(_0x8c42('0xf'));var Redis=require(_0x8c42('0x10'));var authService=require(_0x8c42('0x11'));var qs=require(_0x8c42('0x12'));var as=require(_0x8c42('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c42('0x14'))(_0x8c42('0x15'));var utils=require(_0x8c42('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8c42('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b6815,_0x8305b6){_0x8305b6=_0x8305b6||0xcc;return function(_0x518d8c){if(_0x518d8c){return _0x2b6815[_0x8c42('0x18')](_0x8305b6);}return _0x2b6815[_0x8c42('0x19')](_0x8305b6)[_0x8c42('0x1a')]();};}function respondWithResult(_0x3d5006,_0x46c36f){_0x46c36f=_0x46c36f||0xc8;return function(_0x7a0f63){if(_0x7a0f63){return _0x3d5006[_0x8c42('0x19')](_0x46c36f)[_0x8c42('0x1b')](_0x7a0f63);}};}function respondWithFilteredResult(_0x599656,_0x5f2beb){return function(_0x5ee669){if(_0x5ee669){var _0x4de0f5=typeof _0x5f2beb['offset']==='undefined'&&typeof _0x5f2beb[_0x8c42('0x1c')]===_0x8c42('0x1d');var _0x2e495d=_0x5ee669[_0x8c42('0x1e')];var _0x126a89=_0x4de0f5?0x0:_0x5f2beb[_0x8c42('0x1f')];var _0x2aa7a9=_0x4de0f5?_0x5ee669[_0x8c42('0x1e')]:_0x5f2beb[_0x8c42('0x1f')]+_0x5f2beb[_0x8c42('0x1c')];var _0x3bb3bf;if(_0x2aa7a9>=_0x2e495d){_0x2aa7a9=_0x2e495d;_0x3bb3bf=0xc8;}else{_0x3bb3bf=0xce;}_0x599656[_0x8c42('0x19')](_0x3bb3bf);return _0x599656['set'](_0x8c42('0x20'),_0x126a89+'-'+_0x2aa7a9+'/'+_0x2e495d)[_0x8c42('0x1b')](_0x5ee669);}return null;};}function patchUpdates(_0x13c4b1){return function(_0x468d17){try{jsonpatch[_0x8c42('0x21')](_0x468d17,_0x13c4b1,!![]);}catch(_0x1775df){return BPromise[_0x8c42('0x22')](_0x1775df);}return _0x468d17[_0x8c42('0x23')]();};}function saveUpdates(_0x3da0ff,_0x273a88){return function(_0x27cb8b){if(_0x27cb8b){return _0x27cb8b[_0x8c42('0x24')](_0x3da0ff)[_0x8c42('0x25')](function(_0x239df4){return _0x239df4;});}return null;};}function removeEntity(_0x26308c,_0x2e13bc){return function(_0x1b8691){if(_0x1b8691){return _0x1b8691[_0x8c42('0x26')]()[_0x8c42('0x25')](function(){_0x26308c['status'](0xcc)[_0x8c42('0x1a')]();});}};}function handleEntityNotFound(_0xdc6713,_0x54530f){return function(_0x575da8){if(!_0x575da8){_0xdc6713['sendStatus'](0x194);}return _0x575da8;};}function handleError(_0x282609,_0x4842fd){_0x4842fd=_0x4842fd||0x1f4;return function(_0x51aa74){logger[_0x8c42('0x27')](_0x51aa74[_0x8c42('0x28')]);if(_0x51aa74['name']){delete _0x51aa74['name'];}_0x282609['status'](_0x4842fd)['send'](_0x51aa74);};}exports['index']=function(_0x11126d,_0x13cfa6){var _0x28511f={},_0x343673={},_0x1117c8={'count':0x0,'rows':[]};var _0x1cd307=_[_0x8c42('0x29')](db[_0x8c42('0x2a')][_0x8c42('0x2b')],function(_0xc638b0){return{'name':_0xc638b0[_0x8c42('0x2c')],'type':_0xc638b0[_0x8c42('0x2d')]['key']};});_0x343673[_0x8c42('0x2e')]=_['map'](_0x1cd307,_0x8c42('0x2f'));_0x343673['query']=_[_0x8c42('0x30')](_0x11126d[_0x8c42('0x31')]);_0x343673[_0x8c42('0x32')]=_[_0x8c42('0x33')](_0x343673[_0x8c42('0x2e')],_0x343673[_0x8c42('0x31')]);_0x28511f[_0x8c42('0x34')]=_[_0x8c42('0x33')](_0x343673[_0x8c42('0x2e')],qs[_0x8c42('0x35')](_0x11126d[_0x8c42('0x31')][_0x8c42('0x35')]));_0x28511f[_0x8c42('0x34')]=_0x28511f['attributes'][_0x8c42('0x36')]?_0x28511f['attributes']:_0x343673['model'];if(!_0x11126d[_0x8c42('0x31')][_0x8c42('0x37')](_0x8c42('0x38'))){_0x28511f['limit']=qs[_0x8c42('0x1c')](_0x11126d[_0x8c42('0x31')][_0x8c42('0x1c')]);_0x28511f[_0x8c42('0x1f')]=qs[_0x8c42('0x1f')](_0x11126d['query']['offset']);}_0x28511f[_0x8c42('0x39')]=qs[_0x8c42('0x3a')](_0x11126d[_0x8c42('0x31')]['sort']);_0x28511f[_0x8c42('0x3b')]=qs[_0x8c42('0x32')](_[_0x8c42('0x3c')](_0x11126d['query'],_0x343673[_0x8c42('0x32')]),_0x1cd307);if(_0x11126d[_0x8c42('0x31')][_0x8c42('0x3d')]){_0x28511f['where']=_[_0x8c42('0x3e')](_0x28511f[_0x8c42('0x3b')],{'$or':_[_0x8c42('0x29')](_0x1cd307,function(_0x426fa1){if(_0x426fa1[_0x8c42('0x2d')]!==_0x8c42('0x3f')){var _0x1def1b={};_0x1def1b[_0x426fa1[_0x8c42('0x2f')]]={'$like':'%'+_0x11126d[_0x8c42('0x31')]['filter']+'%'};return _0x1def1b;}})});}_0x28511f=_[_0x8c42('0x3e')]({},_0x28511f,_0x11126d['options']);var _0x324f3d={'where':_0x28511f[_0x8c42('0x3b')]};return db[_0x8c42('0x2a')][_0x8c42('0x1e')](_0x324f3d)['then'](function(_0xbdade9){_0x1117c8[_0x8c42('0x1e')]=_0xbdade9;if(_0x11126d['query']['includeAll']){_0x28511f['include']=[{'all':!![]}];}return db[_0x8c42('0x2a')][_0x8c42('0x40')](_0x28511f);})[_0x8c42('0x25')](function(_0x49c253){_0x1117c8['rows']=_0x49c253;return _0x1117c8;})['then'](respondWithFilteredResult(_0x13cfa6,_0x28511f))[_0x8c42('0x41')](handleError(_0x13cfa6,null));};exports['show']=function(_0x5b0585,_0x2cb521){var _0x2d0de3={'raw':!![],'where':{'id':_0x5b0585[_0x8c42('0x42')]['id']}},_0x55c779={};_0x55c779['model']=_[_0x8c42('0x30')](db['AnalyticTreeReport']['rawAttributes']);_0x55c779[_0x8c42('0x31')]=_[_0x8c42('0x30')](_0x5b0585[_0x8c42('0x31')]);_0x55c779['filters']=_[_0x8c42('0x33')](_0x55c779['model'],_0x55c779['query']);_0x2d0de3['attributes']=_[_0x8c42('0x33')](_0x55c779['model'],qs[_0x8c42('0x35')](_0x5b0585['query'][_0x8c42('0x35')]));_0x2d0de3[_0x8c42('0x34')]=_0x2d0de3['attributes'][_0x8c42('0x36')]?_0x2d0de3['attributes']:_0x55c779[_0x8c42('0x2e')];if(_0x5b0585['query']['includeAll']){_0x2d0de3['include']=[{'all':!![]}];}_0x2d0de3=_[_0x8c42('0x3e')]({},_0x2d0de3,_0x5b0585[_0x8c42('0x43')]);return db[_0x8c42('0x2a')][_0x8c42('0x44')](_0x2d0de3)['then'](handleEntityNotFound(_0x2cb521,null))[_0x8c42('0x25')](respondWithResult(_0x2cb521,null))[_0x8c42('0x41')](handleError(_0x2cb521,null));};exports[_0x8c42('0x45')]=function(_0x155232,_0x214002){return db[_0x8c42('0x2a')][_0x8c42('0x45')](_0x155232[_0x8c42('0x46')],{})[_0x8c42('0x25')](respondWithResult(_0x214002,0xc9))[_0x8c42('0x41')](handleError(_0x214002,null));};exports['update']=function(_0x581fc0,_0x12cf6f){if(_0x581fc0['body']['id']){delete _0x581fc0[_0x8c42('0x46')]['id'];}return db[_0x8c42('0x2a')][_0x8c42('0x44')]({'where':{'id':_0x581fc0['params']['id']}})[_0x8c42('0x25')](handleEntityNotFound(_0x12cf6f,null))[_0x8c42('0x25')](saveUpdates(_0x581fc0[_0x8c42('0x46')],null))['then'](respondWithResult(_0x12cf6f,null))[_0x8c42('0x41')](handleError(_0x12cf6f,null));};exports['destroy']=function(_0x4c6c4,_0x230e08){return db[_0x8c42('0x2a')][_0x8c42('0x44')]({'where':{'id':_0x4c6c4[_0x8c42('0x42')]['id']}})['then'](handleEntityNotFound(_0x230e08,null))[_0x8c42('0x25')](removeEntity(_0x230e08,null))[_0x8c42('0x41')](handleError(_0x230e08,null));}; \ No newline at end of file +var _0xd520=['ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','AnalyticTreeReport','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x2b1421,_0x53e584){var _0x8b137f=function(_0x38f1d7){while(--_0x38f1d7){_0x2b1421['push'](_0x2b1421['shift']());}};_0x8b137f(++_0x53e584);}(_0xd520,0x163));var _0x0d52=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd520[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x0d52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d52('0x1'));var jsonpatch=require(_0x0d52('0x2'));var rp=require(_0x0d52('0x3'));var moment=require(_0x0d52('0x4'));var BPromise=require(_0x0d52('0x5'));var Mustache=require(_0x0d52('0x6'));var util=require(_0x0d52('0x7'));var path=require('path');var sox=require(_0x0d52('0x8'));var csv=require(_0x0d52('0x9'));var ejs=require(_0x0d52('0xa'));var fs=require('fs');var fs_extra=require(_0x0d52('0xb'));var _=require(_0x0d52('0xc'));var squel=require(_0x0d52('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d52('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0d52('0xf'));var Papa=require('papaparse');var Redis=require(_0x0d52('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0d52('0x11'));var hardwareService=require(_0x0d52('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0d52('0x13'));var config=require(_0x0d52('0x14'));var licenseUtil=require(_0x0d52('0x15'));var db=require(_0x0d52('0x16'))['db'];function respondWithStatusCode(_0x4a8f44,_0x362c52){_0x362c52=_0x362c52||0xcc;return function(_0x5a6530){if(_0x5a6530){return _0x4a8f44[_0x0d52('0x17')](_0x362c52);}return _0x4a8f44[_0x0d52('0x18')](_0x362c52)[_0x0d52('0x19')]();};}function respondWithResult(_0xa2bcbc,_0xe10810){_0xe10810=_0xe10810||0xc8;return function(_0x4d2729){if(_0x4d2729){return _0xa2bcbc['status'](_0xe10810)[_0x0d52('0x1a')](_0x4d2729);}};}function respondWithFilteredResult(_0x2b71ba,_0x1d6a59){return function(_0x52fe09){if(_0x52fe09){var _0x48c199=typeof _0x1d6a59[_0x0d52('0x1b')]===_0x0d52('0x1c')&&typeof _0x1d6a59['limit']===_0x0d52('0x1c');var _0x29d3a8=_0x52fe09[_0x0d52('0x1d')];var _0x2065a5=_0x48c199?0x0:_0x1d6a59[_0x0d52('0x1b')];var _0x408aaf=_0x48c199?_0x52fe09[_0x0d52('0x1d')]:_0x1d6a59['offset']+_0x1d6a59[_0x0d52('0x1e')];var _0x3f2ed6;if(_0x408aaf>=_0x29d3a8){_0x408aaf=_0x29d3a8;_0x3f2ed6=0xc8;}else{_0x3f2ed6=0xce;}_0x2b71ba[_0x0d52('0x18')](_0x3f2ed6);return _0x2b71ba[_0x0d52('0x1f')]('Content-Range',_0x2065a5+'-'+_0x408aaf+'/'+_0x29d3a8)[_0x0d52('0x1a')](_0x52fe09);}return null;};}function patchUpdates(_0x347d99){return function(_0x33d82c){try{jsonpatch[_0x0d52('0x20')](_0x33d82c,_0x347d99,!![]);}catch(_0x4ad697){return BPromise[_0x0d52('0x21')](_0x4ad697);}return _0x33d82c[_0x0d52('0x22')]();};}function saveUpdates(_0x1101ab,_0x2fd038){return function(_0x565910){if(_0x565910){return _0x565910[_0x0d52('0x23')](_0x1101ab)['then'](function(_0x3f448e){return _0x3f448e;});}return null;};}function removeEntity(_0x2cf4c5,_0x438a10){return function(_0x64e760){if(_0x64e760){return _0x64e760[_0x0d52('0x24')]()[_0x0d52('0x25')](function(){_0x2cf4c5[_0x0d52('0x18')](0xcc)[_0x0d52('0x19')]();});}};}function handleEntityNotFound(_0x3f9a51,_0x513d69){return function(_0x319d29){if(!_0x319d29){_0x3f9a51[_0x0d52('0x17')](0x194);}return _0x319d29;};}function handleError(_0xe7be55,_0x37cb0a){_0x37cb0a=_0x37cb0a||0x1f4;return function(_0x15bb56){logger['error'](_0x15bb56[_0x0d52('0x26')]);if(_0x15bb56[_0x0d52('0x27')]){delete _0x15bb56['name'];}_0xe7be55[_0x0d52('0x18')](_0x37cb0a)[_0x0d52('0x28')](_0x15bb56);};}exports[_0x0d52('0x29')]=function(_0x345c16,_0x1977ca){var _0x4aebef={},_0x32c141={},_0x56b647={'count':0x0,'rows':[]};var _0x385e84=_[_0x0d52('0x2a')](db['AnalyticTreeReport'][_0x0d52('0x2b')],function(_0x226601){return{'name':_0x226601[_0x0d52('0x2c')],'type':_0x226601[_0x0d52('0x2d')][_0x0d52('0x2e')]};});_0x32c141['model']=_[_0x0d52('0x2a')](_0x385e84,_0x0d52('0x27'));_0x32c141[_0x0d52('0x2f')]=_[_0x0d52('0x30')](_0x345c16[_0x0d52('0x2f')]);_0x32c141['filters']=_[_0x0d52('0x31')](_0x32c141[_0x0d52('0x32')],_0x32c141['query']);_0x4aebef[_0x0d52('0x33')]=_[_0x0d52('0x31')](_0x32c141['model'],qs[_0x0d52('0x34')](_0x345c16[_0x0d52('0x2f')][_0x0d52('0x34')]));_0x4aebef['attributes']=_0x4aebef[_0x0d52('0x33')][_0x0d52('0x35')]?_0x4aebef['attributes']:_0x32c141[_0x0d52('0x32')];if(!_0x345c16[_0x0d52('0x2f')][_0x0d52('0x36')]('nolimit')){_0x4aebef['limit']=qs[_0x0d52('0x1e')](_0x345c16[_0x0d52('0x2f')][_0x0d52('0x1e')]);_0x4aebef['offset']=qs['offset'](_0x345c16['query'][_0x0d52('0x1b')]);}_0x4aebef[_0x0d52('0x37')]=qs[_0x0d52('0x38')](_0x345c16[_0x0d52('0x2f')][_0x0d52('0x38')]);_0x4aebef['where']=qs[_0x0d52('0x39')](_[_0x0d52('0x3a')](_0x345c16[_0x0d52('0x2f')],_0x32c141['filters']),_0x385e84);if(_0x345c16[_0x0d52('0x2f')][_0x0d52('0x3b')]){_0x4aebef[_0x0d52('0x3c')]=_['merge'](_0x4aebef[_0x0d52('0x3c')],{'$or':_[_0x0d52('0x2a')](_0x385e84,function(_0x340c44){if(_0x340c44[_0x0d52('0x2d')]!=='VIRTUAL'){var _0x364f70={};_0x364f70[_0x340c44[_0x0d52('0x27')]]={'$like':'%'+_0x345c16[_0x0d52('0x2f')][_0x0d52('0x3b')]+'%'};return _0x364f70;}})});}_0x4aebef=_[_0x0d52('0x3d')]({},_0x4aebef,_0x345c16['options']);var _0x376840={'where':_0x4aebef[_0x0d52('0x3c')]};return db[_0x0d52('0x3e')][_0x0d52('0x1d')](_0x376840)[_0x0d52('0x25')](function(_0x3e018c){_0x56b647[_0x0d52('0x1d')]=_0x3e018c;if(_0x345c16['query'][_0x0d52('0x3f')]){_0x4aebef[_0x0d52('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x4aebef);})[_0x0d52('0x25')](function(_0x1585f9){_0x56b647[_0x0d52('0x41')]=_0x1585f9;return _0x56b647;})[_0x0d52('0x25')](respondWithFilteredResult(_0x1977ca,_0x4aebef))[_0x0d52('0x42')](handleError(_0x1977ca,null));};exports[_0x0d52('0x43')]=function(_0xea42d8,_0x53e8dc){var _0x3dea78={'raw':!![],'where':{'id':_0xea42d8[_0x0d52('0x44')]['id']}},_0x2f0e45={};_0x2f0e45[_0x0d52('0x32')]=_[_0x0d52('0x30')](db[_0x0d52('0x3e')][_0x0d52('0x2b')]);_0x2f0e45['query']=_[_0x0d52('0x30')](_0xea42d8[_0x0d52('0x2f')]);_0x2f0e45[_0x0d52('0x39')]=_[_0x0d52('0x31')](_0x2f0e45[_0x0d52('0x32')],_0x2f0e45[_0x0d52('0x2f')]);_0x3dea78[_0x0d52('0x33')]=_[_0x0d52('0x31')](_0x2f0e45['model'],qs[_0x0d52('0x34')](_0xea42d8[_0x0d52('0x2f')][_0x0d52('0x34')]));_0x3dea78[_0x0d52('0x33')]=_0x3dea78[_0x0d52('0x33')][_0x0d52('0x35')]?_0x3dea78[_0x0d52('0x33')]:_0x2f0e45[_0x0d52('0x32')];if(_0xea42d8['query']['includeAll']){_0x3dea78[_0x0d52('0x40')]=[{'all':!![]}];}_0x3dea78=_['merge']({},_0x3dea78,_0xea42d8[_0x0d52('0x45')]);return db[_0x0d52('0x3e')][_0x0d52('0x46')](_0x3dea78)[_0x0d52('0x25')](handleEntityNotFound(_0x53e8dc,null))[_0x0d52('0x25')](respondWithResult(_0x53e8dc,null))['catch'](handleError(_0x53e8dc,null));};exports[_0x0d52('0x47')]=function(_0xda3e38,_0x4319b9){return db['AnalyticTreeReport'][_0x0d52('0x47')](_0xda3e38[_0x0d52('0x48')],{})[_0x0d52('0x25')](respondWithResult(_0x4319b9,0xc9))[_0x0d52('0x42')](handleError(_0x4319b9,null));};exports['update']=function(_0x1549f4,_0x580c8f){if(_0x1549f4[_0x0d52('0x48')]['id']){delete _0x1549f4[_0x0d52('0x48')]['id'];}return db['AnalyticTreeReport'][_0x0d52('0x46')]({'where':{'id':_0x1549f4[_0x0d52('0x44')]['id']}})['then'](handleEntityNotFound(_0x580c8f,null))['then'](saveUpdates(_0x1549f4[_0x0d52('0x48')],null))['then'](respondWithResult(_0x580c8f,null))[_0x0d52('0x42')](handleError(_0x580c8f,null));};exports[_0x0d52('0x24')]=function(_0x212334,_0x13b2aa){return db['AnalyticTreeReport']['find']({'where':{'id':_0x212334[_0x0d52('0x44')]['id']}})[_0x0d52('0x25')](handleEntityNotFound(_0x13b2aa,null))['then'](removeEntity(_0x13b2aa,null))[_0x0d52('0x42')](handleError(_0x13b2aa,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f03cb8c..d4c1262 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 _0x01a1=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x507672,_0x24e04b){var _0x341677=function(_0xce51dc){while(--_0xce51dc){_0x507672['push'](_0x507672['shift']());}};_0x341677(++_0x24e04b);}(_0x01a1,0xa9));var _0x101a=function(_0x39d862,_0x4c182f){_0x39d862=_0x39d862-0x0;var _0x389809=_0x01a1[_0x39d862];return _0x389809;};'use strict';var _=require(_0x101a('0x0'));var util=require(_0x101a('0x1'));var logger=require(_0x101a('0x2'))(_0x101a('0x3'));var moment=require(_0x101a('0x4'));var BPromise=require(_0x101a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x101a('0x6'));var config=require('../../config/environment');var attributes=require(_0x101a('0x7'));module['exports']=function(_0x43a003,_0x1d61e2){return _0x43a003[_0x101a('0x8')](_0x101a('0x9'),attributes,{'tableName':_0x101a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb52a=['analytics_report_trees','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5dd2ec,_0x259f57){var _0x41e2c=function(_0x2ecf82){while(--_0x2ecf82){_0x5dd2ec['push'](_0x5dd2ec['shift']());}};_0x41e2c(++_0x259f57);}(_0xb52a,0x19f));var _0xab52=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb52a[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xab52('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab52('0x1'));var moment=require(_0xab52('0x2'));var BPromise=require('bluebird');var rp=require(_0xab52('0x3'));var fs=require('fs');var path=require(_0xab52('0x4'));var rimraf=require(_0xab52('0x5'));var config=require(_0xab52('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xab52('0x7')]=function(_0x50605b,_0x422b74){return _0x50605b['define']('AnalyticTreeReport',attributes,{'tableName':_0xab52('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 3669c41..ee1d99d 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x436827,_0x570104){var _0x22434d=function(_0x55c067){while(--_0x55c067){_0x436827['push'](_0x436827['shift']());}};_0x22434d(++_0x570104);}(_0xadb5,0xad));var _0x5adb=function(_0x5166d4,_0x1cf662){_0x5166d4=_0x5166d4-0x0;var _0x2f19a1=_0xadb5[_0x5166d4];return _0x2f19a1;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4b5b86,_0x23c37a){var _0xd965ac=function(_0x51f2cb){while(--_0x51f2cb){_0x4b5b86['push'](_0x4b5b86['shift']());}};_0xd965ac(++_0x23c37a);}(_0x2ef3,0xba));var _0x32ef=function(_0x87706f,_0x5744c9){_0x87706f=_0x87706f-0x0;var _0x523ece=_0x2ef3[_0x87706f];return _0x523ece;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 26ab02c..8860361 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 _0x9ed0=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9ed0,0x1c5));var _0x09ed=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x9ed0[_0x2797c6];return _0x54809f;};'use strict';var multer=require(_0x09ed('0x0'));var util=require(_0x09ed('0x1'));var path=require(_0x09ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x09ed('0x3'));var router=express[_0x09ed('0x4')]();var fs_extra=require(_0x09ed('0x5'));var auth=require(_0x09ed('0x6'));var interaction=require(_0x09ed('0x7'));var config=require('../../config/environment');var controller=require(_0x09ed('0x8'));router[_0x09ed('0x9')]('/',auth[_0x09ed('0xa')](),controller[_0x09ed('0xb')]);router['get'](_0x09ed('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x09ed('0xa')](),controller[_0x09ed('0xd')]);router[_0x09ed('0xe')](_0x09ed('0xc'),auth[_0x09ed('0xa')](),controller[_0x09ed('0xf')]);router[_0x09ed('0x10')](_0x09ed('0xc'),auth['isAuthenticated'](),controller[_0x09ed('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2ebf=['update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show'];(function(_0x20a137,_0x4d9549){var _0x3dc414=function(_0x21179b){while(--_0x21179b){_0x20a137['push'](_0x20a137['shift']());}};_0x3dc414(++_0x4d9549);}(_0x2ebf,0xa8));var _0xf2eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ebf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf2eb('0x0'));var timeout=require(_0xf2eb('0x1'));var express=require(_0xf2eb('0x2'));var router=express[_0xf2eb('0x3')]();var fs_extra=require(_0xf2eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf2eb('0x5'));var config=require(_0xf2eb('0x6'));var controller=require(_0xf2eb('0x7'));router[_0xf2eb('0x8')]('/',auth[_0xf2eb('0x9')](),controller['index']);router['get'](_0xf2eb('0xa'),auth[_0xf2eb('0x9')](),controller[_0xf2eb('0xb')]);router['post']('/',auth[_0xf2eb('0x9')](),controller['create']);router['put']('/:id',auth[_0xf2eb('0x9')](),controller[_0xf2eb('0xc')]);router[_0xf2eb('0xd')](_0xf2eb('0xa'),auth[_0xf2eb('0x9')](),controller['destroy']);module[_0xf2eb('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 809a2f4..a7f79ab 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 _0xc831=['STRING','exports'];(function(_0x22254e,_0x36916a){var _0x126c66=function(_0x267ad4){while(--_0x267ad4){_0x22254e['push'](_0x22254e['shift']());}};_0x126c66(++_0x36916a);}(_0xc831,0x103));var _0x1c83=function(_0x2da632,_0x3d63ef){_0x2da632=_0x2da632-0x0;var _0x5aa628=_0xc831[_0x2da632];return _0x5aa628;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'name':{'type':Sequelize[_0x1c83('0x1')]},'basename':{'type':Sequelize[_0x1c83('0x1')]},'type':{'type':Sequelize[_0x1c83('0x1')]}}; \ No newline at end of file +var _0x383a=['STRING','exports'];(function(_0x592ace,_0x5500a3){var _0x3f4b72=function(_0x1f71ab){while(--_0x1f71ab){_0x592ace['push'](_0x592ace['shift']());}};_0x3f4b72(++_0x5500a3);}(_0x383a,0x1ad));var _0xa383=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x383a[_0x1399d6];return _0x4a9db4;};'use strict';var Sequelize=require('sequelize');module[_0xa383('0x0')]={'name':{'type':Sequelize[_0xa383('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c9db3e9..7c1db30 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 _0xb58c=['query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Attachment','rawAttributes','type','key','model','keys'];(function(_0x30fae7,_0x562858){var _0x1dbd52=function(_0x4d8c5e){while(--_0x4d8c5e){_0x30fae7['push'](_0x30fae7['shift']());}};_0x1dbd52(++_0x562858);}(_0xb58c,0x177));var _0xcb58=function(_0x3a5af1,_0xe55183){_0x3a5af1=_0x3a5af1-0x0;var _0x3ae7a7=_0xb58c[_0x3a5af1];return _0x3ae7a7;};'use strict';var emlformat=require(_0xcb58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb58('0x1'));var jsonpatch=require(_0xcb58('0x2'));var rp=require(_0xcb58('0x3'));var moment=require(_0xcb58('0x4'));var BPromise=require(_0xcb58('0x5'));var Mustache=require('mustache');var util=require(_0xcb58('0x6'));var path=require(_0xcb58('0x7'));var sox=require(_0xcb58('0x8'));var csv=require('to-csv');var ejs=require(_0xcb58('0x9'));var fs=require('fs');var fs_extra=require(_0xcb58('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb58('0xb'));var jsforce=require(_0xcb58('0xc'));var deskjs=require(_0xcb58('0xd'));var toCsv=require(_0xcb58('0xe'));var querystring=require(_0xcb58('0xf'));var Papa=require('papaparse');var Redis=require(_0xcb58('0x10'));var authService=require(_0xcb58('0x11'));var qs=require(_0xcb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcb58('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ad01,_0x522971){_0x522971=_0x522971||0xcc;return function(_0xdadef1){if(_0xdadef1){return _0x20ad01[_0xcb58('0x14')](_0x522971);}return _0x20ad01[_0xcb58('0x15')](_0x522971)[_0xcb58('0x16')]();};}function respondWithResult(_0xfb3e49,_0x5e63cb){_0x5e63cb=_0x5e63cb||0xc8;return function(_0x2f263a){if(_0x2f263a){return _0xfb3e49[_0xcb58('0x15')](_0x5e63cb)[_0xcb58('0x17')](_0x2f263a);}};}function respondWithFilteredResult(_0x3594f2,_0x1307e8){return function(_0x1b3d0f){if(_0x1b3d0f){var _0x103959=typeof _0x1307e8['offset']===_0xcb58('0x18')&&typeof _0x1307e8[_0xcb58('0x19')]===_0xcb58('0x18');var _0x40c508=_0x1b3d0f[_0xcb58('0x1a')];var _0x2c7e68=_0x103959?0x0:_0x1307e8[_0xcb58('0x1b')];var _0x3254ad=_0x103959?_0x1b3d0f[_0xcb58('0x1a')]:_0x1307e8[_0xcb58('0x1b')]+_0x1307e8['limit'];var _0x2d6a8a;if(_0x3254ad>=_0x40c508){_0x3254ad=_0x40c508;_0x2d6a8a=0xc8;}else{_0x2d6a8a=0xce;}_0x3594f2[_0xcb58('0x15')](_0x2d6a8a);return _0x3594f2[_0xcb58('0x1c')](_0xcb58('0x1d'),_0x2c7e68+'-'+_0x3254ad+'/'+_0x40c508)[_0xcb58('0x17')](_0x1b3d0f);}return null;};}function patchUpdates(_0x35f8b7){return function(_0x119542){try{jsonpatch[_0xcb58('0x1e')](_0x119542,_0x35f8b7,!![]);}catch(_0x4b746b){return BPromise[_0xcb58('0x1f')](_0x4b746b);}return _0x119542['save']();};}function saveUpdates(_0x22e0bd,_0x32922d){return function(_0x3e3dcc){if(_0x3e3dcc){return _0x3e3dcc[_0xcb58('0x20')](_0x22e0bd)[_0xcb58('0x21')](function(_0x2e32c1){return _0x2e32c1;});}return null;};}function removeEntity(_0x4ce62a,_0x36ba30){return function(_0x288b7a){if(_0x288b7a){return _0x288b7a[_0xcb58('0x22')]()[_0xcb58('0x21')](function(){_0x4ce62a[_0xcb58('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a2aab,_0x2efb61){return function(_0x36141f){if(!_0x36141f){_0x7a2aab[_0xcb58('0x14')](0x194);}return _0x36141f;};}function handleError(_0x2ec9e0,_0x15c1c0){_0x15c1c0=_0x15c1c0||0x1f4;return function(_0x26de5e){logger['error'](_0x26de5e[_0xcb58('0x23')]);if(_0x26de5e[_0xcb58('0x24')]){delete _0x26de5e['name'];}_0x2ec9e0[_0xcb58('0x15')](_0x15c1c0)[_0xcb58('0x25')](_0x26de5e);};}exports['index']=function(_0x4c91ec,_0x36bd05){var _0x5e065a={},_0x53fd42={},_0x190c64={'count':0x0,'rows':[]};var _0x59a6cc=_[_0xcb58('0x26')](db[_0xcb58('0x27')][_0xcb58('0x28')],function(_0x482d70){return{'name':_0x482d70['fieldName'],'type':_0x482d70[_0xcb58('0x29')][_0xcb58('0x2a')]};});_0x53fd42[_0xcb58('0x2b')]=_[_0xcb58('0x26')](_0x59a6cc,_0xcb58('0x24'));_0x53fd42['query']=_[_0xcb58('0x2c')](_0x4c91ec[_0xcb58('0x2d')]);_0x53fd42['filters']=_[_0xcb58('0x2e')](_0x53fd42[_0xcb58('0x2b')],_0x53fd42[_0xcb58('0x2d')]);_0x5e065a[_0xcb58('0x2f')]=_[_0xcb58('0x2e')](_0x53fd42[_0xcb58('0x2b')],qs['fields'](_0x4c91ec[_0xcb58('0x2d')][_0xcb58('0x30')]));_0x5e065a[_0xcb58('0x2f')]=_0x5e065a[_0xcb58('0x2f')]['length']?_0x5e065a['attributes']:_0x53fd42[_0xcb58('0x2b')];if(!_0x4c91ec[_0xcb58('0x2d')][_0xcb58('0x31')](_0xcb58('0x32'))){_0x5e065a[_0xcb58('0x19')]=qs[_0xcb58('0x19')](_0x4c91ec[_0xcb58('0x2d')][_0xcb58('0x19')]);_0x5e065a[_0xcb58('0x1b')]=qs[_0xcb58('0x1b')](_0x4c91ec[_0xcb58('0x2d')][_0xcb58('0x1b')]);}_0x5e065a[_0xcb58('0x33')]=qs[_0xcb58('0x34')](_0x4c91ec['query']['sort']);_0x5e065a[_0xcb58('0x35')]=qs['filters'](_['pick'](_0x4c91ec[_0xcb58('0x2d')],_0x53fd42['filters']),_0x59a6cc);if(_0x4c91ec['query'][_0xcb58('0x36')]){_0x5e065a[_0xcb58('0x35')]=_['merge'](_0x5e065a['where'],{'$or':_[_0xcb58('0x26')](_0x59a6cc,function(_0x8b7709){if(_0x8b7709['type']!==_0xcb58('0x37')){var _0x32f898={};_0x32f898[_0x8b7709[_0xcb58('0x24')]]={'$like':'%'+_0x4c91ec['query'][_0xcb58('0x36')]+'%'};return _0x32f898;}})});}_0x5e065a=_[_0xcb58('0x38')]({},_0x5e065a,_0x4c91ec[_0xcb58('0x39')]);var _0x58a179={'where':_0x5e065a[_0xcb58('0x35')]};return db['Attachment'][_0xcb58('0x1a')](_0x58a179)['then'](function(_0x3ca541){_0x190c64[_0xcb58('0x1a')]=_0x3ca541;if(_0x4c91ec[_0xcb58('0x2d')][_0xcb58('0x3a')]){_0x5e065a[_0xcb58('0x3b')]=[{'all':!![]}];}return db[_0xcb58('0x27')][_0xcb58('0x3c')](_0x5e065a);})[_0xcb58('0x21')](function(_0x24810b){_0x190c64['rows']=_0x24810b;return _0x190c64;})[_0xcb58('0x21')](respondWithFilteredResult(_0x36bd05,_0x5e065a))[_0xcb58('0x3d')](handleError(_0x36bd05,null));};exports[_0xcb58('0x3e')]=function(_0x393354,_0x272eac){var _0x1d721a={'raw':!![],'where':{'id':_0x393354[_0xcb58('0x3f')]['id']}},_0x145439={};_0x145439[_0xcb58('0x2b')]=_[_0xcb58('0x2c')](db[_0xcb58('0x27')][_0xcb58('0x28')]);_0x145439[_0xcb58('0x2d')]=_['keys'](_0x393354[_0xcb58('0x2d')]);_0x145439['filters']=_['intersection'](_0x145439[_0xcb58('0x2b')],_0x145439[_0xcb58('0x2d')]);_0x1d721a[_0xcb58('0x2f')]=_[_0xcb58('0x2e')](_0x145439['model'],qs[_0xcb58('0x30')](_0x393354['query'][_0xcb58('0x30')]));_0x1d721a[_0xcb58('0x2f')]=_0x1d721a[_0xcb58('0x2f')][_0xcb58('0x40')]?_0x1d721a[_0xcb58('0x2f')]:_0x145439[_0xcb58('0x2b')];if(_0x393354[_0xcb58('0x2d')]['includeAll']){_0x1d721a[_0xcb58('0x3b')]=[{'all':!![]}];}_0x1d721a=_[_0xcb58('0x38')]({},_0x1d721a,_0x393354['options']);return db['Attachment'][_0xcb58('0x41')](_0x1d721a)[_0xcb58('0x21')](handleEntityNotFound(_0x272eac,null))[_0xcb58('0x21')](respondWithResult(_0x272eac,null))[_0xcb58('0x3d')](handleError(_0x272eac,null));};exports[_0xcb58('0x42')]=function(_0x2cb9b8,_0x1bc9a9){var _0x1a5ca3={'where':{'id':_0x2cb9b8[_0xcb58('0x3f')]['id']}},_0x600ff2={};_0x600ff2['model']=_[_0xcb58('0x2c')](db[_0xcb58('0x27')][_0xcb58('0x28')]);_0x1a5ca3[_0xcb58('0x2f')]=_[_0xcb58('0x2e')](_0x600ff2[_0xcb58('0x2b')],qs[_0xcb58('0x30')](_0x2cb9b8['query'][_0xcb58('0x30')]));_0x1a5ca3['attributes']=_0x1a5ca3[_0xcb58('0x2f')]['length']?_0x1a5ca3[_0xcb58('0x2f')]:_0x600ff2[_0xcb58('0x2b')];if(_0x2cb9b8['query'][_0xcb58('0x3a')]){_0x1a5ca3['include']=[{'all':!![]}];}_0x1a5ca3=_[_0xcb58('0x38')]({},_0x1a5ca3,_0x2cb9b8[_0xcb58('0x39')]);return db[_0xcb58('0x27')][_0xcb58('0x41')](_0x1a5ca3)['then'](handleEntityNotFound(_0x1bc9a9,null))[_0xcb58('0x21')](function(_0x25bed2){if(_0x25bed2){var _0x52fadf=_0x25bed2[_0xcb58('0x43')]({'plain':!![]});_0x52fadf=qs[_0xcb58('0x44')](_0x52fadf,['id',_0xcb58('0x45'),_0xcb58('0x46')]);_0x2cb9b8[_0xcb58('0x47')]=_['omit'](_0x2cb9b8['body'],['id',_0xcb58('0x45'),_0xcb58('0x46')]);return db[_0xcb58('0x27')]['create'](_[_0xcb58('0x38')](_0x52fadf,_0x2cb9b8['body']),{'include':_0x2cb9b8[_0xcb58('0x2d')][_0xcb58('0x3a')]?[{'all':!![]}]:undefined});}})[_0xcb58('0x21')](respondWithResult(_0x1bc9a9,0xc9))[_0xcb58('0x3d')](handleError(_0x1bc9a9,null));};exports[_0xcb58('0x20')]=function(_0x142067,_0x5eb296){if(_0x142067['body']['id']){delete _0x142067[_0xcb58('0x47')]['id'];}return db['Attachment'][_0xcb58('0x41')]({'where':{'id':_0x142067['params']['id']}})[_0xcb58('0x21')](handleEntityNotFound(_0x5eb296,null))['then'](saveUpdates(_0x142067[_0xcb58('0x47')],null))[_0xcb58('0x21')](respondWithResult(_0x5eb296,null))[_0xcb58('0x3d')](handleError(_0x5eb296,null));};exports[_0xcb58('0x22')]=function(_0x3cff52,_0x59dad1){return db[_0xcb58('0x27')][_0xcb58('0x41')]({'where':{'id':_0x3cff52[_0xcb58('0x3f')]['id']}})['then'](handleEntityNotFound(_0x59dad1,null))[_0xcb58('0x21')](removeEntity(_0x59dad1,null))['catch'](handleError(_0x59dad1,null));};exports[_0xcb58('0x48')]=function(_0x3c6683,_0x2ce167,_0x35f577){_0x3c6683[_0xcb58('0x47')][_0xcb58('0x24')]=_0x3c6683[_0xcb58('0x49')][_0xcb58('0x4a')];_0x3c6683[_0xcb58('0x47')][_0xcb58('0x4b')]=_0x3c6683['file'][_0xcb58('0x4c')];_0x3c6683[_0xcb58('0x47')][_0xcb58('0x29')]=_0x3c6683[_0xcb58('0x49')][_0xcb58('0x4d')];return db[_0xcb58('0x27')][_0xcb58('0x48')](_0x3c6683[_0xcb58('0x47')])[_0xcb58('0x21')](respondWithResult(_0x2ce167,0xc9))[_0xcb58('0x3d')](handleError(_0x2ce167,null));};exports['download']=function(_0x62857f,_0x45ad58,_0x148518){return db['Attachment'][_0xcb58('0x4e')]({'where':{'id':_0x62857f[_0xcb58('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x45ad58,null))['then'](function(_0x32d76e){if(_0x32d76e){var _0x36c8cf=_0x32d76e[_0xcb58('0x4f')]!==null;var _0x37926a=path[_0xcb58('0x50')](config[_0xcb58('0x51')],_0xcb58('0x52'));if(_0x36c8cf){_0x37926a=path['join'](_0x37926a,_0xcb58('0x53'));}var _0x24d51f=path[_0xcb58('0x50')](_0x37926a,_0x32d76e['basename']);return _0x45ad58['download'](_0x24d51f);}})[_0xcb58('0x3d')](handleError(_0x45ad58,null));}; \ No newline at end of file +var _0x279b=['map','Attachment','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','order','where','filter','merge','options','include','findAll','catch','show','params','keys','fields','includeAll','get','omit','createdAt','updatedAt','body','find','destroy','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','Content-Range','save','update','then','sendStatus','error','stack','name','index'];(function(_0x129ecf,_0x320bf7){var _0x2125ff=function(_0x576a21){while(--_0x576a21){_0x129ecf['push'](_0x129ecf['shift']());}};_0x2125ff(++_0x320bf7);}(_0x279b,0x125));var _0xb279=function(_0x5cf5f4,_0x3997ff){_0x5cf5f4=_0x5cf5f4-0x0;var _0x52b615=_0x279b[_0x5cf5f4];return _0x52b615;};'use strict';var emlformat=require(_0xb279('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb279('0x1'));var jsonpatch=require(_0xb279('0x2'));var rp=require(_0xb279('0x3'));var moment=require('moment');var BPromise=require(_0xb279('0x4'));var Mustache=require(_0xb279('0x5'));var util=require(_0xb279('0x6'));var path=require(_0xb279('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb279('0x8'));var fs=require('fs');var fs_extra=require(_0xb279('0x9'));var _=require(_0xb279('0xa'));var squel=require(_0xb279('0xb'));var crypto=require(_0xb279('0xc'));var jsforce=require(_0xb279('0xd'));var deskjs=require(_0xb279('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb279('0xf'));var Papa=require(_0xb279('0x10'));var Redis=require('ioredis');var authService=require(_0xb279('0x11'));var qs=require(_0xb279('0x12'));var as=require(_0xb279('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb279('0x14'));var config=require(_0xb279('0x15'));var licenseUtil=require(_0xb279('0x16'));var db=require(_0xb279('0x17'))['db'];function respondWithStatusCode(_0x83b7be,_0x33cbc7){_0x33cbc7=_0x33cbc7||0xcc;return function(_0x51f97b){if(_0x51f97b){return _0x83b7be['sendStatus'](_0x33cbc7);}return _0x83b7be[_0xb279('0x18')](_0x33cbc7)[_0xb279('0x19')]();};}function respondWithResult(_0xcda356,_0x374579){_0x374579=_0x374579||0xc8;return function(_0x352feb){if(_0x352feb){return _0xcda356[_0xb279('0x18')](_0x374579)['json'](_0x352feb);}};}function respondWithFilteredResult(_0x2ef34b,_0x5d8e76){return function(_0x19e7ca){if(_0x19e7ca){var _0x62b7f9=typeof _0x5d8e76['offset']==='undefined'&&typeof _0x5d8e76[_0xb279('0x1a')]===_0xb279('0x1b');var _0x2fc31e=_0x19e7ca[_0xb279('0x1c')];var _0x57a8db=_0x62b7f9?0x0:_0x5d8e76[_0xb279('0x1d')];var _0x294b46=_0x62b7f9?_0x19e7ca[_0xb279('0x1c')]:_0x5d8e76[_0xb279('0x1d')]+_0x5d8e76[_0xb279('0x1a')];var _0x32df43;if(_0x294b46>=_0x2fc31e){_0x294b46=_0x2fc31e;_0x32df43=0xc8;}else{_0x32df43=0xce;}_0x2ef34b['status'](_0x32df43);return _0x2ef34b['set'](_0xb279('0x1e'),_0x57a8db+'-'+_0x294b46+'/'+_0x2fc31e)['json'](_0x19e7ca);}return null;};}function patchUpdates(_0x5b1043){return function(_0x4f7294){try{jsonpatch['apply'](_0x4f7294,_0x5b1043,!![]);}catch(_0x305119){return BPromise['reject'](_0x305119);}return _0x4f7294[_0xb279('0x1f')]();};}function saveUpdates(_0x15a108,_0x25a8ef){return function(_0x5efd75){if(_0x5efd75){return _0x5efd75[_0xb279('0x20')](_0x15a108)[_0xb279('0x21')](function(_0x664bc9){return _0x664bc9;});}return null;};}function removeEntity(_0x6fb230,_0x127b32){return function(_0x42af97){if(_0x42af97){return _0x42af97['destroy']()[_0xb279('0x21')](function(){_0x6fb230['status'](0xcc)[_0xb279('0x19')]();});}};}function handleEntityNotFound(_0x5207ae,_0x519c26){return function(_0x53c42f){if(!_0x53c42f){_0x5207ae[_0xb279('0x22')](0x194);}return _0x53c42f;};}function handleError(_0x1fc190,_0x461fbe){_0x461fbe=_0x461fbe||0x1f4;return function(_0x38ddd4){logger[_0xb279('0x23')](_0x38ddd4[_0xb279('0x24')]);if(_0x38ddd4[_0xb279('0x25')]){delete _0x38ddd4[_0xb279('0x25')];}_0x1fc190[_0xb279('0x18')](_0x461fbe)['send'](_0x38ddd4);};}exports[_0xb279('0x26')]=function(_0x2d3e0b,_0x3e5100){var _0x3ccda9={},_0x10ca08={},_0x122fb5={'count':0x0,'rows':[]};var _0x43db95=_[_0xb279('0x27')](db[_0xb279('0x28')][_0xb279('0x29')],function(_0x367799){return{'name':_0x367799[_0xb279('0x2a')],'type':_0x367799[_0xb279('0x2b')][_0xb279('0x2c')]};});_0x10ca08['model']=_[_0xb279('0x27')](_0x43db95,_0xb279('0x25'));_0x10ca08[_0xb279('0x2d')]=_['keys'](_0x2d3e0b['query']);_0x10ca08[_0xb279('0x2e')]=_[_0xb279('0x2f')](_0x10ca08[_0xb279('0x30')],_0x10ca08[_0xb279('0x2d')]);_0x3ccda9[_0xb279('0x31')]=_['intersection'](_0x10ca08[_0xb279('0x30')],qs['fields'](_0x2d3e0b[_0xb279('0x2d')]['fields']));_0x3ccda9[_0xb279('0x31')]=_0x3ccda9[_0xb279('0x31')][_0xb279('0x32')]?_0x3ccda9['attributes']:_0x10ca08[_0xb279('0x30')];if(!_0x2d3e0b['query']['hasOwnProperty']('nolimit')){_0x3ccda9[_0xb279('0x1a')]=qs[_0xb279('0x1a')](_0x2d3e0b['query']['limit']);_0x3ccda9['offset']=qs[_0xb279('0x1d')](_0x2d3e0b[_0xb279('0x2d')][_0xb279('0x1d')]);}_0x3ccda9[_0xb279('0x33')]=qs['sort'](_0x2d3e0b[_0xb279('0x2d')]['sort']);_0x3ccda9[_0xb279('0x34')]=qs[_0xb279('0x2e')](_['pick'](_0x2d3e0b[_0xb279('0x2d')],_0x10ca08[_0xb279('0x2e')]),_0x43db95);if(_0x2d3e0b[_0xb279('0x2d')][_0xb279('0x35')]){_0x3ccda9[_0xb279('0x34')]=_['merge'](_0x3ccda9['where'],{'$or':_[_0xb279('0x27')](_0x43db95,function(_0x59d037){if(_0x59d037[_0xb279('0x2b')]!=='VIRTUAL'){var _0x389ac3={};_0x389ac3[_0x59d037[_0xb279('0x25')]]={'$like':'%'+_0x2d3e0b['query'][_0xb279('0x35')]+'%'};return _0x389ac3;}})});}_0x3ccda9=_[_0xb279('0x36')]({},_0x3ccda9,_0x2d3e0b[_0xb279('0x37')]);var _0x1ecb9a={'where':_0x3ccda9[_0xb279('0x34')]};return db['Attachment']['count'](_0x1ecb9a)[_0xb279('0x21')](function(_0x3409b4){_0x122fb5[_0xb279('0x1c')]=_0x3409b4;if(_0x2d3e0b[_0xb279('0x2d')]['includeAll']){_0x3ccda9[_0xb279('0x38')]=[{'all':!![]}];}return db[_0xb279('0x28')][_0xb279('0x39')](_0x3ccda9);})[_0xb279('0x21')](function(_0x43395a){_0x122fb5['rows']=_0x43395a;return _0x122fb5;})[_0xb279('0x21')](respondWithFilteredResult(_0x3e5100,_0x3ccda9))[_0xb279('0x3a')](handleError(_0x3e5100,null));};exports[_0xb279('0x3b')]=function(_0xe53956,_0x287da6){var _0x532e99={'raw':!![],'where':{'id':_0xe53956[_0xb279('0x3c')]['id']}},_0x1549ce={};_0x1549ce[_0xb279('0x30')]=_[_0xb279('0x3d')](db[_0xb279('0x28')][_0xb279('0x29')]);_0x1549ce[_0xb279('0x2d')]=_[_0xb279('0x3d')](_0xe53956[_0xb279('0x2d')]);_0x1549ce[_0xb279('0x2e')]=_[_0xb279('0x2f')](_0x1549ce['model'],_0x1549ce[_0xb279('0x2d')]);_0x532e99[_0xb279('0x31')]=_[_0xb279('0x2f')](_0x1549ce['model'],qs[_0xb279('0x3e')](_0xe53956[_0xb279('0x2d')][_0xb279('0x3e')]));_0x532e99['attributes']=_0x532e99['attributes'][_0xb279('0x32')]?_0x532e99[_0xb279('0x31')]:_0x1549ce[_0xb279('0x30')];if(_0xe53956[_0xb279('0x2d')][_0xb279('0x3f')]){_0x532e99[_0xb279('0x38')]=[{'all':!![]}];}_0x532e99=_[_0xb279('0x36')]({},_0x532e99,_0xe53956[_0xb279('0x37')]);return db[_0xb279('0x28')]['find'](_0x532e99)['then'](handleEntityNotFound(_0x287da6,null))[_0xb279('0x21')](respondWithResult(_0x287da6,null))['catch'](handleError(_0x287da6,null));};exports['clone']=function(_0x10fca1,_0x43f93e){var _0x1ac7b6={'where':{'id':_0x10fca1[_0xb279('0x3c')]['id']}},_0x30f87d={};_0x30f87d['model']=_[_0xb279('0x3d')](db[_0xb279('0x28')][_0xb279('0x29')]);_0x1ac7b6[_0xb279('0x31')]=_['intersection'](_0x30f87d[_0xb279('0x30')],qs[_0xb279('0x3e')](_0x10fca1[_0xb279('0x2d')][_0xb279('0x3e')]));_0x1ac7b6['attributes']=_0x1ac7b6[_0xb279('0x31')]['length']?_0x1ac7b6['attributes']:_0x30f87d[_0xb279('0x30')];if(_0x10fca1['query'][_0xb279('0x3f')]){_0x1ac7b6['include']=[{'all':!![]}];}_0x1ac7b6=_[_0xb279('0x36')]({},_0x1ac7b6,_0x10fca1[_0xb279('0x37')]);return db['Attachment']['find'](_0x1ac7b6)[_0xb279('0x21')](handleEntityNotFound(_0x43f93e,null))[_0xb279('0x21')](function(_0x43e039){if(_0x43e039){var _0x5a0ecb=_0x43e039[_0xb279('0x40')]({'plain':!![]});_0x5a0ecb=qs[_0xb279('0x41')](_0x5a0ecb,['id',_0xb279('0x42'),_0xb279('0x43')]);_0x10fca1['body']=_[_0xb279('0x41')](_0x10fca1[_0xb279('0x44')],['id',_0xb279('0x42'),_0xb279('0x43')]);return db['Attachment']['create'](_[_0xb279('0x36')](_0x5a0ecb,_0x10fca1[_0xb279('0x44')]),{'include':_0x10fca1[_0xb279('0x2d')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x43f93e,0xc9))[_0xb279('0x3a')](handleError(_0x43f93e,null));};exports[_0xb279('0x20')]=function(_0x259f62,_0xcb039){if(_0x259f62[_0xb279('0x44')]['id']){delete _0x259f62[_0xb279('0x44')]['id'];}return db[_0xb279('0x28')][_0xb279('0x45')]({'where':{'id':_0x259f62[_0xb279('0x3c')]['id']}})['then'](handleEntityNotFound(_0xcb039,null))[_0xb279('0x21')](saveUpdates(_0x259f62[_0xb279('0x44')],null))[_0xb279('0x21')](respondWithResult(_0xcb039,null))['catch'](handleError(_0xcb039,null));};exports[_0xb279('0x46')]=function(_0x5858d7,_0xbbe90f){return db['Attachment'][_0xb279('0x45')]({'where':{'id':_0x5858d7[_0xb279('0x3c')]['id']}})[_0xb279('0x21')](handleEntityNotFound(_0xbbe90f,null))[_0xb279('0x21')](removeEntity(_0xbbe90f,null))[_0xb279('0x3a')](handleError(_0xbbe90f,null));};exports[_0xb279('0x47')]=function(_0x2bfaf0,_0xb2273,_0x594666){_0x2bfaf0['body']['name']=_0x2bfaf0[_0xb279('0x48')][_0xb279('0x49')];_0x2bfaf0['body'][_0xb279('0x4a')]=_0x2bfaf0[_0xb279('0x48')][_0xb279('0x4b')];_0x2bfaf0[_0xb279('0x44')][_0xb279('0x2b')]=_0x2bfaf0[_0xb279('0x48')]['mimetype'];return db[_0xb279('0x28')][_0xb279('0x47')](_0x2bfaf0[_0xb279('0x44')])[_0xb279('0x21')](respondWithResult(_0xb2273,0xc9))[_0xb279('0x3a')](handleError(_0xb2273,null));};exports['download']=function(_0x42b3c6,_0x440d26,_0x3f7e16){return db[_0xb279('0x28')][_0xb279('0x4c')]({'where':{'id':_0x42b3c6[_0xb279('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x440d26,null))[_0xb279('0x21')](function(_0x2dd4b7){if(_0x2dd4b7){var _0xdbd175=_0x2dd4b7[_0xb279('0x4d')]!==null;var _0x3ce38f=path[_0xb279('0x4e')](config[_0xb279('0x4f')],_0xb279('0x50'));if(_0xdbd175){_0x3ce38f=path[_0xb279('0x4e')](_0x3ce38f,_0xb279('0x51'));}var _0x1be205=path[_0xb279('0x4e')](_0x3ce38f,_0x2dd4b7[_0xb279('0x4a')]);return _0x440d26[_0xb279('0x52')](_0x1be205);}})[_0xb279('0x3a')](handleError(_0x440d26,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 00d60f4..161bc71 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 _0x9a54=['util','../../config/logger','moment','bluebird','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x367717,_0x3948c2){var _0x4f60f7=function(_0x5eb038){while(--_0x5eb038){_0x367717['push'](_0x367717['shift']());}};_0x4f60f7(++_0x3948c2);}(_0x9a54,0x107));var _0x49a5=function(_0x1b515f,_0x52aa6b){_0x1b515f=_0x1b515f-0x0;var _0x66ff73=_0x9a54[_0x1b515f];return _0x66ff73;};'use strict';var _=require(_0x49a5('0x0'));var util=require(_0x49a5('0x1'));var logger=require(_0x49a5('0x2'))('api');var moment=require(_0x49a5('0x3'));var BPromise=require(_0x49a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49a5('0x5'));var rimraf=require(_0x49a5('0x6'));var config=require('../../config/environment');var attributes=require(_0x49a5('0x7'));module[_0x49a5('0x8')]=function(_0x56b225,_0x1a89fd){return _0x56b225[_0x49a5('0x9')](_0x49a5('0xa'),attributes,{'tableName':_0x49a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfeb=['moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','util','../../config/logger','api'];(function(_0x4000fd,_0x5bb8fb){var _0x30bde2=function(_0x2d397b){while(--_0x2d397b){_0x4000fd['push'](_0x4000fd['shift']());}};_0x30bde2(++_0x5bb8fb);}(_0xdfeb,0x75));var _0xbdfe=function(_0x10a237,_0x108e84){_0x10a237=_0x10a237-0x0;var _0x1c0832=_0xdfeb[_0x10a237];return _0x1c0832;};'use strict';var _=require('lodash');var util=require(_0xbdfe('0x0'));var logger=require(_0xbdfe('0x1'))(_0xbdfe('0x2'));var moment=require(_0xbdfe('0x3'));var BPromise=require(_0xbdfe('0x4'));var rp=require(_0xbdfe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdfe('0x6'));var config=require(_0xbdfe('0x7'));var attributes=require(_0xbdfe('0x8'));module[_0xbdfe('0x9')]=function(_0x251c7d,_0x29aef4){return _0x251c7d['define'](_0xbdfe('0xa'),attributes,{'tableName':_0xbdfe('0xb'),'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 a1be6e2..f855edb 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 _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x482b43,_0x33d73c){_0x482b43=_0x482b43-0x0;var _0x4a8afd=_0x3eec[_0x482b43];return _0x4a8afd;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});}; \ No newline at end of file +var _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x23e9d4,_0x1063fd){var _0x4ab2b0=function(_0x3ff3e3){while(--_0x3ff3e3){_0x23e9d4['push'](_0x23e9d4['shift']());}};_0x4ab2b0(++_0x1063fd);}(_0x6c50,0xa4));var _0x06c5=function(_0x4dd98d,_0x41032b){_0x4dd98d=_0x4dd98d-0x0;var _0x4f3e2b=_0x6c50[_0x4dd98d];return _0x4f3e2b;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index f4b83c9..c90440b 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(_0x4f7100,_0x55039f){var _0x4e89b4=function(_0x1cdc54){while(--_0x1cdc54){_0x4f7100['push'](_0x4f7100['shift']());}};_0x4e89b4(++_0x55039f);}(_0xb10b,0x12a));var _0xbb10=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xb10b[_0x39cd3c];return _0x47a0ae;};'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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x399b17,_0x49ada5){var _0x1a222e=function(_0x30d20a){while(--_0x30d20a){_0x399b17['push'](_0x399b17['shift']());}};_0x1a222e(++_0x49ada5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x153654,_0x4d6991){_0x153654=_0x153654-0x0;var _0xf2a17c=_0x5f2f[_0x153654];return _0xf2a17c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index f913a34..422fc59 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 _0xbea5=['login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','name','password','salt','blocked','blockedAt','online','user','agent','clearBlockUser','getLicense','status','send','message'];(function(_0x3463a7,_0x8dde15){var _0x33f833=function(_0x18cbe5){while(--_0x18cbe5){_0x3463a7['push'](_0x3463a7['shift']());}};_0x33f833(++_0x8dde15);}(_0xbea5,0x177));var _0x5bea=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0xbea5[_0x1d30a3];return _0x32bba1;};'use strict';var passport=require(_0x5bea('0x0'));var LocalStrategy=require(_0x5bea('0x1'))['Strategy'];var moment=require(_0x5bea('0x2'));var ActiveDirectory=require(_0x5bea('0x3'));var BPromise=require(_0x5bea('0x4'));var util=require(_0x5bea('0x5'));var db=require(_0x5bea('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x5bea('0x7'));var logger=require('../../config/logger')(_0x5bea('0x8'));function isActiveDirectoryConfigured(_0x51ac31){var _0x487888=![];if(typeof _0x51ac31[_0x5bea('0x9')]!=='undefined'){_0x487888=_0x51ac31['activedirectory'][_0x5bea('0xa')]&&_0x51ac31[_0x5bea('0x9')][_0x5bea('0xb')]&&_0x51ac31['activedirectory'][_0x5bea('0xc')];}return _0x487888;}function adAuthenticate(_0x53cec8,_0x4e793c,_0x2af7af){return new BPromise(function(_0x1bb8f0,_0x7d6c90){try{var _0x71e4eb=new ActiveDirectory(_0x53cec8);_0x71e4eb[_0x5bea('0xd')](_0x4e793c,_0x2af7af,function(_0x386f92,_0x595d16){if(_0x386f92){logger[_0x5bea('0xe')](_0x5bea('0xf'),_0x4e793c,util['inspect'](_0x386f92,{'showHidden':![],'depth':null}));_0x7d6c90(_0x5bea('0x10'));}else if(!_0x595d16){logger[_0x5bea('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4e793c);_0x7d6c90(_0x5bea('0x10'));}else{_0x1bb8f0(_0x595d16);}});}catch(_0x229e09){_0x7d6c90(_0x229e09);}});}function ActiveDirectoryAuthenticate(_0x26cfca,_0xda336a,_0x1e2861,_0x464d29){var _0x14d46c,_0x5e0518;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x5bea('0x11'),_0xda336a);return _0x464d29(null,![],{'message':_0x5bea('0x10')});}return db[_0x5bea('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x5bea('0x13'),_0x5bea('0x14')],'raw':!![]})[_0x5bea('0x15')](function(_0x49ba83){_0x14d46c=_0x49ba83;if(!_0x14d46c[_0x5bea('0x13')]){logger[_0x5bea('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xda336a);throw new Error(_0x5bea('0x10'));}return _0x26cfca['findOne']({'logging':!![],'attributes':['id',_0x5bea('0x16'),_0x5bea('0x17'),_0x5bea('0x18'),'role','disabled',_0x5bea('0x19'),_0x5bea('0x1a'),_0x5bea('0x1b')],'where':{'name':_0xda336a,'role':{'$or':['admin',_0x5bea('0x1c'),_0x5bea('0x1d')]},'adSsoEnabled':!![]}});})[_0x5bea('0x15')](function(_0xda92cf){if(!_0xda92cf||_0xda92cf&&_0xda92cf['name']!==_0xda336a){throw new Error(_0x5bea('0x10'));}_0x5e0518=_0xda92cf;var _0xad55b1=_0x5e0518[_0x5bea('0x16')]+'@'+config[_0x5bea('0x9')]['domain'];return adAuthenticate(config[_0x5bea('0x9')],_0xad55b1,_0x1e2861);})['then'](function(_0x274f19){if(_0x5e0518['disabled']){throw new Error(_0x5bea('0x10'));}if(_0x14d46c[_0x5bea('0x14')]>0x0){if(_0x5e0518[_0x5bea('0x19')]){if(moment(_0x5e0518[_0x5bea('0x1a')])['add'](_0x14d46c['blockDuration'],'minutes')>moment()){throw new Error(_0x5bea('0x10'));}return utils[_0x5bea('0x1e')](_0x5e0518,0x0,![],null)['then'](function(){return utils['getLicense'](_0x5e0518);})[_0x5bea('0x15')](function(){return _0x464d29(null,_0x5e0518);});}else{return utils[_0x5bea('0x1f')](_0x5e0518)['then'](function(){return _0x464d29(null,_0x5e0518);});}}else{return utils[_0x5bea('0x1f')](_0x5e0518)['then'](function(){return _0x464d29(null,_0x5e0518);});}})['catch'](function(_0x1a784b){return _0x464d29(null,![],_0x1a784b);});}function handleError(_0x2e773a,_0x10b5e6,_0x102ffb){return _0x2e773a[_0x5bea('0x20')](_0x10b5e6||0x1f4)[_0x5bea('0x21')]({'message':_0x102ffb?_0x102ffb[_0x5bea('0x22')]||_0x102ffb:''});}exports[_0x5bea('0x23')]=function(_0x34ae3b,_0x4c023f,_0x4d4cdb){passport[_0x5bea('0xd')](_0x5bea('0x24'),function(_0x196c56,_0x26840e,_0x4b4d1c){var _0x3e19d2=_0x196c56||_0x4b4d1c;if(_0x3e19d2){return handleError(_0x4c023f,0x191,_0x3e19d2);}if(!_0x26840e){return handleError(_0x4c023f,0x194,{'message':_0x5bea('0x25')});}else{var _0x198ba5={'payload':{'id':_0x26840e['id'],'role':_0x26840e[_0x5bea('0x26')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x198ba5)[_0x5bea('0x15')](function(_0x29dfac){_0x4c023f[_0x5bea('0x27')]({'id':_0x26840e['id'],'token':_0x29dfac,'statusCall':'','isAlreadyLogged':_0x26840e['online']});});}})(_0x34ae3b,_0x4c023f,_0x4d4cdb);};passport[_0x5bea('0x28')](_0x5bea('0x24'),new LocalStrategy({'usernameField':_0x5bea('0x16'),'passwordField':_0x5bea('0x17')},function(_0x691435,_0xe796bf,_0x543d56){return ActiveDirectoryAuthenticate(db['User'],_0x691435,_0xe796bf,_0x543d56);})); \ No newline at end of file +var _0xdbde=['getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','name','password','salt','role','online','admin','user','agent','then','disabled','blocked','blockedAt','add','minutes','clearBlockUser'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xdbde,0x1e1));var _0xedbd=function(_0x5d5246,_0xfa9a93){_0x5d5246=_0x5d5246-0x0;var _0xfcad8f=_0xdbde[_0x5d5246];return _0xfcad8f;};'use strict';var passport=require(_0xedbd('0x0'));var LocalStrategy=require(_0xedbd('0x1'))[_0xedbd('0x2')];var moment=require(_0xedbd('0x3'));var ActiveDirectory=require(_0xedbd('0x4'));var BPromise=require('bluebird');var util=require(_0xedbd('0x5'));var db=require(_0xedbd('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xedbd('0x7'));var config=require(_0xedbd('0x8'));var logger=require(_0xedbd('0x9'))(_0xedbd('0xa'));function isActiveDirectoryConfigured(_0x13b27d){var _0x42cadc=![];if(typeof _0x13b27d['activedirectory']!=='undefined'){_0x42cadc=_0x13b27d[_0xedbd('0xb')][_0xedbd('0xc')]&&_0x13b27d[_0xedbd('0xb')][_0xedbd('0xd')]&&_0x13b27d[_0xedbd('0xb')][_0xedbd('0xe')];}return _0x42cadc;}function adAuthenticate(_0x171abd,_0xcd847b,_0x5982aa){return new BPromise(function(_0x22dcb7,_0x5552ff){try{var _0x7319d7=new ActiveDirectory(_0x171abd);_0x7319d7['authenticate'](_0xcd847b,_0x5982aa,function(_0x4adc18,_0x31257b){if(_0x4adc18){logger['error'](_0xedbd('0xf'),_0xcd847b,util['inspect'](_0x4adc18,{'showHidden':![],'depth':null}));_0x5552ff(_0xedbd('0x10'));}else if(!_0x31257b){logger['error'](_0xedbd('0x11'),_0xcd847b);_0x5552ff(_0xedbd('0x10'));}else{_0x22dcb7(_0x31257b);}});}catch(_0xd0718c){_0x5552ff(_0xd0718c);}});}function ActiveDirectoryAuthenticate(_0x4ce36b,_0x3a22f6,_0x2ea227,_0x3c902d){var _0x212095,_0xd61448;if(!isActiveDirectoryConfigured(config)){logger[_0xedbd('0x12')](_0xedbd('0x13'),_0x3a22f6);return _0x3c902d(null,![],{'message':_0xedbd('0x10')});}return db[_0xedbd('0x14')][_0xedbd('0x15')]({'where':{'id':0x1},'attributes':[_0xedbd('0x16'),_0xedbd('0x17')],'raw':!![]})['then'](function(_0x3910e){_0x212095=_0x3910e;if(!_0x212095[_0xedbd('0x16')]){logger[_0xedbd('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3a22f6);throw new Error(_0xedbd('0x10'));}return _0x4ce36b['findOne']({'logging':!![],'attributes':['id',_0xedbd('0x18'),_0xedbd('0x19'),_0xedbd('0x1a'),_0xedbd('0x1b'),'disabled','blocked','blockedAt',_0xedbd('0x1c')],'where':{'name':_0x3a22f6,'role':{'$or':[_0xedbd('0x1d'),_0xedbd('0x1e'),_0xedbd('0x1f')]},'adSsoEnabled':!![]}});})[_0xedbd('0x20')](function(_0x3d45ab){if(!_0x3d45ab||_0x3d45ab&&_0x3d45ab[_0xedbd('0x18')]!==_0x3a22f6){throw new Error(_0xedbd('0x10'));}_0xd61448=_0x3d45ab;var _0x2e8cca=_0xd61448[_0xedbd('0x18')]+'@'+config[_0xedbd('0xb')][_0xedbd('0xe')];return adAuthenticate(config[_0xedbd('0xb')],_0x2e8cca,_0x2ea227);})[_0xedbd('0x20')](function(_0x41b7eb){if(_0xd61448[_0xedbd('0x21')]){throw new Error(_0xedbd('0x10'));}if(_0x212095['blockDuration']>0x0){if(_0xd61448[_0xedbd('0x22')]){if(moment(_0xd61448[_0xedbd('0x23')])[_0xedbd('0x24')](_0x212095[_0xedbd('0x17')],_0xedbd('0x25'))>moment()){throw new Error(_0xedbd('0x10'));}return utils[_0xedbd('0x26')](_0xd61448,0x0,![],null)[_0xedbd('0x20')](function(){return utils['getLicense'](_0xd61448);})['then'](function(){return _0x3c902d(null,_0xd61448);});}else{return utils['getLicense'](_0xd61448)[_0xedbd('0x20')](function(){return _0x3c902d(null,_0xd61448);});}}else{return utils[_0xedbd('0x27')](_0xd61448)['then'](function(){return _0x3c902d(null,_0xd61448);});}})[_0xedbd('0x28')](function(_0x350a96){return _0x3c902d(null,![],_0x350a96);});}function handleError(_0x4ac4de,_0x33a499,_0x27c5bc){return _0x4ac4de[_0xedbd('0x29')](_0x33a499||0x1f4)[_0xedbd('0x2a')]({'message':_0x27c5bc?_0x27c5bc[_0xedbd('0x2b')]||_0x27c5bc:''});}exports[_0xedbd('0x2c')]=function(_0x45ad2f,_0x435503,_0x5bf88f){passport[_0xedbd('0x2d')](_0xedbd('0x2e'),function(_0x58bca7,_0x483167,_0x246deb){var _0x39ec27=_0x58bca7||_0x246deb;if(_0x39ec27){return handleError(_0x435503,0x191,_0x39ec27);}if(!_0x483167){return handleError(_0x435503,0x194,{'message':_0xedbd('0x2f')});}else{var _0x219e16={'payload':{'id':_0x483167['id'],'role':_0x483167[_0xedbd('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xedbd('0x30')](_0x219e16)[_0xedbd('0x20')](function(_0xa07d26){_0x435503[_0xedbd('0x31')]({'id':_0x483167['id'],'token':_0xa07d26,'statusCall':'','isAlreadyLogged':_0x483167[_0xedbd('0x1c')]});});}})(_0x45ad2f,_0x435503,_0x5bf88f);};passport[_0xedbd('0x32')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xedbd('0x19')},function(_0xbcd79f,_0x4cb86b,_0x399242){return ActiveDirectoryAuthenticate(db[_0xedbd('0x33')],_0xbcd79f,_0x4cb86b,_0x399242);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index e5570ff..e2653ab 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 _0x5b8d=['post','exports','Router'];(function(_0x5785f6,_0x21c3fa){var _0x32147c=function(_0x2ea177){while(--_0x2ea177){_0x5785f6['push'](_0x5785f6['shift']());}};_0x32147c(++_0x21c3fa);}(_0x5b8d,0x149));var _0xd5b8=function(_0x3a6db3,_0x5ac5b1){_0x3a6db3=_0x3a6db3-0x0;var _0x4d88f9=_0x5b8d[_0x3a6db3];return _0x4d88f9;};'use strict';var express=require('express');var router=express[_0xd5b8('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xd5b8('0x1')]('/',controller['login']);module[_0xd5b8('0x2')]=router; \ No newline at end of file +var _0x5bc8=['Router','post'];(function(_0x369ac8,_0x1af37c){var _0x371091=function(_0x399a46){while(--_0x399a46){_0x369ac8['push'](_0x369ac8['shift']());}};_0x371091(++_0x1af37c);}(_0x5bc8,0xf6));var _0x85bc=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0x5bc8[_0x395bfe];return _0x35c81c;};'use strict';var express=require('express');var router=express[_0x85bc('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x85bc('0x1')]('/',controller['login']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ae4c07f..4aa5969 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x30cb06,_0x3616ac){_0x30cb06=_0x30cb06-0x0;var _0x456db3=_0x7a54[_0x30cb06];return _0x456db3;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4d14bb,_0xe9dbb5){var _0x1aaa75=function(_0x2c397d){while(--_0x2c397d){_0x4d14bb['push'](_0x4d14bb['shift']());}};_0x1aaa75(++_0xe9dbb5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 161be4c..9579092 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 _0xab17=['passport','login','/callback','setTokenCookie','exports','express'];(function(_0xf233c8,_0x243a04){var _0x39494b=function(_0x11181e){while(--_0x11181e){_0xf233c8['push'](_0xf233c8['shift']());}};_0x39494b(++_0x243a04);}(_0xab17,0x1bb));var _0x7ab1=function(_0xebc240,_0x372e3f){_0xebc240=_0xebc240-0x0;var _0x44b9f4=_0xab17[_0xebc240];return _0x44b9f4;};'use strict';var express=require(_0x7ab1('0x0'));var passport=require(_0x7ab1('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x7ab1('0x2')]);router['get'](_0x7ab1('0x3'),controller['callback'],authService['isMiddleware'],userController[_0x7ab1('0x2')],authService[_0x7ab1('0x4')]);module[_0x7ab1('0x5')]=router; \ No newline at end of file +var _0x8563=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports'];(function(_0x6efe30,_0x313738){var _0x5499d6=function(_0x569be2){while(--_0x569be2){_0x6efe30['push'](_0x6efe30['shift']());}};_0x5499d6(++_0x313738);}(_0x8563,0x138));var _0x3856=function(_0x5584ed,_0x1d839b){_0x5584ed=_0x5584ed-0x0;var _0x4f0640=_0x8563[_0x5584ed];return _0x4f0640;};'use strict';var express=require(_0x3856('0x0'));var passport=require('passport');var router=express[_0x3856('0x1')]();var controller=require(_0x3856('0x2'));var userController=require(_0x3856('0x3'));var authService=require(_0x3856('0x4'));router[_0x3856('0x5')]('/',controller['login']);router[_0x3856('0x5')](_0x3856('0x6'),controller[_0x3856('0x7')],authService[_0x3856('0x8')],userController[_0x3856('0x9')],authService[_0x3856('0xa')]);module[_0x3856('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 0ed4a19..544309e 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 _0x1633=['Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','blocked','minutes','clearBlockUser','add','getLicense','catch','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','email','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','status','Password\x20reset!','local-login','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils'];(function(_0x33c3d3,_0x51eed3){var _0xf3a17f=function(_0x22c578){while(--_0x22c578){_0x33c3d3['push'](_0x33c3d3['shift']());}};_0xf3a17f(++_0x51eed3);}(_0x1633,0xa1));var _0x3163=function(_0x4fa9c8,_0xdf6f4b){_0x4fa9c8=_0x4fa9c8-0x0;var _0x154417=_0x1633[_0x4fa9c8];return _0x154417;};'use strict';var util=require('util');var passport=require(_0x3163('0x0'));var LocalStrategy=require(_0x3163('0x1'))['Strategy'];var jayson=require(_0x3163('0x2'));var _=require('lodash');var rs=require(_0x3163('0x3'));var moment=require(_0x3163('0x4'));var db=require(_0x3163('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x3163('0x6'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x28d5d2,_0xa175af,_0x2b8fb6,_0x5020d6){var _0x4290a6,_0x2c622b;return db[_0x3163('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x3163('0x8'),_0x3163('0x9')],'raw':!![]})[_0x3163('0xa')](function(_0xcad62e){_0x4290a6=_0xcad62e;return _0x28d5d2[_0x3163('0xb')]({'attributes':['id',_0x3163('0xc'),_0x3163('0xd'),_0x3163('0xe'),'role','disabled','blocked',_0x3163('0xf'),'loginAttempts'],'where':{'name':_0xa175af,'role':{'$or':[_0x3163('0x10'),_0x3163('0x11'),'agent']}}});})[_0x3163('0xa')](function(_0x24f48b){if(!_0x24f48b||_0x24f48b&&_0x24f48b[_0x3163('0xc')]!==_0xa175af){throw new Error(_0x3163('0x12'));}else{_0x2c622b=_0x24f48b;return _0x2c622b;}})[_0x3163('0xa')](function(){_0x2c622b[_0x3163('0x13')](_0x2b8fb6,function(_0x529d3d,_0x23c4e8){var _0x321d9c=_0x2c622b[_0x3163('0x14')]+0x1;if(_0x529d3d){return _0x5020d6(_0x529d3d);}else if(!_0x23c4e8){if(_0x2c622b[_0x3163('0x15')]){return _0x5020d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4290a6[_0x3163('0x8')]>0x0){if(_0x2c622b[_0x3163('0x16')]){if(_0x4290a6['blockDuration']>0x0){if(moment(_0x2c622b['blockedAt'])['add'](_0x4290a6['blockDuration'],_0x3163('0x17'))>moment()){return _0x5020d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3163('0x18')](_0x2c622b,_0x321d9c,![],null)[_0x3163('0xa')](function(){return _0x5020d6(null,![],{'message':_0x3163('0x12')});});}}else{return _0x5020d6(null,![],{'message':_0x3163('0x12')});}}else{if(_0x321d9c>=_0x4290a6[_0x3163('0x8')]){return utils[_0x3163('0x18')](_0x2c622b,0x0,!![],moment())[_0x3163('0xa')](function(){return _0x5020d6(null,![],{'message':_0x3163('0x12')});});}else{return utils[_0x3163('0x18')](_0x2c622b,_0x321d9c,![],null)[_0x3163('0xa')](function(){return _0x5020d6(null,![],{'message':_0x3163('0x12')});});}}}else{return _0x5020d6(null,![],{'message':_0x3163('0x12')});}}else{if(_0x2c622b['disabled']){return _0x5020d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4290a6[_0x3163('0x8')]>0x0){if(_0x2c622b['blocked']){if(_0x4290a6[_0x3163('0x9')]>0x0){if(moment(_0x2c622b[_0x3163('0xf')])[_0x3163('0x19')](_0x4290a6[_0x3163('0x9')],'minutes')>moment()){return _0x5020d6(null,![],{'message':_0x3163('0x12')});}else{return utils[_0x3163('0x18')](_0x2c622b,0x0,![],null)[_0x3163('0xa')](function(){return utils[_0x3163('0x1a')](_0x2c622b);})['then'](function(){return _0x5020d6(null,_0x2c622b);});}}else{return _0x5020d6(null,![],{'message':_0x3163('0x12')});}}else{return utils[_0x3163('0x18')](_0x2c622b,0x0,![],null)[_0x3163('0xa')](function(){return utils[_0x3163('0x1a')](_0x2c622b);})[_0x3163('0xa')](function(){return _0x5020d6(null,_0x2c622b);})[_0x3163('0x1b')](function(_0x14f6da){return _0x5020d6(null,![],_0x14f6da);});}}else{if(_0x2c622b[_0x3163('0x16')]){return _0x5020d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2c622b)[_0x3163('0xa')](function(){return _0x5020d6(null,_0x2c622b);});}}}});})[_0x3163('0x1b')](function(_0x4be901){return _0x5020d6(null,![],_0x4be901);});}function sendServiceMail(_0x695be6){return db['MailAccount'][_0x3163('0x1c')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x3163('0x1d')],'as':'Smtp'}]})['then'](function(_0x5debc6){if(!_0x5debc6){throw new Error(_0x3163('0x1e'));}var _0x22e0f2={'tls':{'rejectUnauthorized':![]}};if(_0x5debc6[_0x3163('0x1f')][_0x3163('0x20')]){_0x22e0f2['service']=_0x5debc6['Smtp'][_0x3163('0x20')];}else{_0x22e0f2['host']=_0x5debc6[_0x3163('0x1f')]['host'];_0x22e0f2['port']=_0x5debc6['Smtp'][_0x3163('0x21')];_0x22e0f2[_0x3163('0x22')]=_0x5debc6[_0x3163('0x1f')][_0x3163('0x22')];}if(_0x5debc6[_0x3163('0x1f')][_0x3163('0x23')]){_0x22e0f2[_0x3163('0x24')]={'user':_0x5debc6[_0x3163('0x1f')]['user'],'pass':_0x5debc6[_0x3163('0x1f')][_0x3163('0x25')]};}var _0x3df87b={'account':_0x22e0f2,'message':_['merge']({'from':util[_0x3163('0x26')](_0x3163('0x27'),_0x5debc6['name'],_0x5debc6['email']||_0x5debc6[_0x3163('0x1f')][_0x3163('0x11')])},_0x695be6)};return client[_0x3163('0x28')](_0x3163('0x29'),_0x3df87b);})[_0x3163('0xa')](function(_0x43fb83){if(_0x43fb83[_0x3163('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x43fb83[_0x3163('0x2a')][_0x3163('0x2b')]||JSON[_0x3163('0x2c')](_0x43fb83[_0x3163('0x2a')])));}return!![];});}function handleError(_0x58233b,_0x4b5747,_0x139e99){return _0x58233b['status'](_0x4b5747||0x1f4)[_0x3163('0x2d')]({'message':_0x139e99?_0x139e99[_0x3163('0x2b')]||_0x139e99:''});}exports[_0x3163('0x2e')]=function(_0x519783,_0x406553,_0x191913){passport[_0x3163('0x13')]('local-login',function(_0x57ed15,_0x2d8ae1,_0x563411){var _0x125a02=_0x57ed15||_0x563411;if(_0x125a02){return handleError(_0x406553,0x191,_0x125a02);}if(!_0x2d8ae1){return handleError(_0x406553,0x194,{'message':_0x3163('0x2f')});}else{var _0x58ad5b={'payload':{'id':_0x2d8ae1['id'],'role':_0x2d8ae1[_0x3163('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x3163('0x31')](_0x58ad5b)[_0x3163('0xa')](function(_0x37a0bc){_0x406553['json']({'id':_0x2d8ae1['id'],'token':_0x37a0bc,'statusCall':'','isAlreadyLogged':_0x2d8ae1[_0x3163('0x32')]});});}})(_0x519783,_0x406553,_0x191913);};exports[_0x3163('0x33')]=function(_0x2b8a7c,_0x3e4714,_0x125ef6){if(!_0x2b8a7c[_0x3163('0x34')]['email']){return handleError(_0x3e4714,0x1f4,{'message':_0x3163('0x35')});}var _0x27adc0=rs['generate']();_0x2b8a7c[_0x3163('0x34')][_0x3163('0x36')]=_0x2b8a7c[_0x3163('0x34')][_0x3163('0x36')][_0x3163('0x37')]()[_0x3163('0x38')]();var _0x7dfef8;return db[_0x3163('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x3163('0x8'),_0x3163('0x9')],'raw':!![]})[_0x3163('0xa')](function(_0x1e2c89){_0x7dfef8=_0x1e2c89;return db[_0x3163('0x39')][_0x3163('0x1c')]({'where':{'email':_0x2b8a7c[_0x3163('0x34')][_0x3163('0x36')]}});})['then'](function(_0x4d66db){if(!_0x4d66db){throw new Error(_0x3163('0x3a'));}if(_0x4d66db[_0x3163('0x15')]){throw new Error(_0x3163('0x3b'));}if(_0x4d66db[_0x3163('0x16')]){if(moment(_0x4d66db[_0x3163('0xf')])[_0x3163('0x19')](_0x7dfef8[_0x3163('0x9')],_0x3163('0x17'))>moment()){throw new Error(_0x3163('0x3c'));}else{_0x4d66db[_0x3163('0x16')]=![];_0x4d66db[_0x3163('0xf')]=null;}}_0x4d66db[_0x3163('0x3d')]=_0x27adc0;_0x4d66db[_0x3163('0x3e')]=Date[_0x3163('0x3f')]()+0x36ee80;return _0x4d66db[_0x3163('0x40')]();})[_0x3163('0xa')](function(){return sendServiceMail({'to':_0x2b8a7c[_0x3163('0x34')][_0x3163('0x36')],'subject':_0x3163('0x41'),'text':_0x3163('0x42')+_0x3163('0x43')+_0x3163('0x44')+_0x2b8a7c[_0x3163('0x45')][_0x3163('0x46')]+_0x3163('0x47')+_0x27adc0+'\x0a\x0a'+_0x3163('0x48')});})[_0x3163('0xa')](function(){_0x3e4714['status'](0xc8)[_0x3163('0x2d')]({'message':_0x3163('0x49')});})['catch'](function(_0x101e06){return handleError(_0x3e4714,0x1f4,_0x101e06);});};exports['reset']=function(_0x11d3e2,_0x7a0819,_0xf3f7d1){return db[_0x3163('0x39')][_0x3163('0x1c')]({'where':{'resetPasswordToken':_0x11d3e2['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2bbea1){if(!_0x2bbea1){throw new Error(_0x3163('0x4a'));}return db[_0x3163('0x7')][_0x3163('0xb')]({'attributes':['id',_0x3163('0x4b'),_0x3163('0x4c'),_0x3163('0x4d')]})[_0x3163('0xa')](function(_0x1bd22e){if(_0x1bd22e['securePassword'])authService[_0x3163('0x4e')](_0x11d3e2['body'][_0x3163('0xd')]);if(!_0x1bd22e[_0x3163('0x4c')]||!_0x2bbea1[_0x3163('0x4f')])return _0x2bbea1;authService[_0x3163('0x50')](_0x11d3e2[_0x3163('0x34')]['password'],_0x2bbea1[_0x3163('0x4f')],_0x1bd22e['passwordHistoryLimit']);return _0x2bbea1;})[_0x3163('0xa')](function(){_0x2bbea1[_0x3163('0xd')]=_0x11d3e2[_0x3163('0x34')]['password'];_0x2bbea1[_0x3163('0x3d')]=null;_0x2bbea1[_0x3163('0x3e')]=null;return _0x2bbea1[_0x3163('0x40')]();});})[_0x3163('0xa')](function(){_0x7a0819[_0x3163('0x51')](0xc8)[_0x3163('0x2d')]({'message':_0x3163('0x52')});})[_0x3163('0x1b')](function(_0x3cd166){return handleError(_0x7a0819,0x1f4,_0x3cd166);});};passport['use'](_0x3163('0x53'),new LocalStrategy({'usernameField':_0x3163('0xc'),'passwordField':_0x3163('0xd')},function(_0x255b72,_0xbc5ed7,_0x268a52){return localAuthenticate(db[_0x3163('0x39')],_0x255b72,_0xbc5ed7,_0x268a52);})); \ No newline at end of file +var _0x9001=['use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x9001,0x109));var _0x1900=function(_0x1f548b,_0x282830){_0x1f548b=_0x1f548b-0x0;var _0x5101e8=_0x9001[_0x1f548b];return _0x5101e8;};'use strict';var util=require(_0x1900('0x0'));var passport=require(_0x1900('0x1'));var LocalStrategy=require(_0x1900('0x2'))[_0x1900('0x3')];var jayson=require(_0x1900('0x4'));var _=require(_0x1900('0x5'));var rs=require(_0x1900('0x6'));var moment=require('moment');var db=require(_0x1900('0x7'))['db'];var authService=require(_0x1900('0x8'));var utils=require(_0x1900('0x9'));var client=jayson[_0x1900('0xa')][_0x1900('0xb')]({'port':0x232b});function localAuthenticate(_0x1ceb35,_0x32cebe,_0xc4ce97,_0x66d3f7){var _0x3934a1,_0x16c119;return db[_0x1900('0xc')][_0x1900('0xd')]({'where':{'id':0x1},'attributes':[_0x1900('0xe'),_0x1900('0xf')],'raw':!![]})[_0x1900('0x10')](function(_0x1d0789){_0x3934a1=_0x1d0789;return _0x1ceb35[_0x1900('0xd')]({'attributes':['id',_0x1900('0x11'),_0x1900('0x12'),'salt','role',_0x1900('0x13'),_0x1900('0x14'),_0x1900('0x15'),_0x1900('0x16')],'where':{'name':_0x32cebe,'role':{'$or':[_0x1900('0x17'),_0x1900('0x18'),_0x1900('0x19')]}}});})[_0x1900('0x10')](function(_0x2e28ca){if(!_0x2e28ca||_0x2e28ca&&_0x2e28ca['name']!==_0x32cebe){throw new Error(_0x1900('0x1a'));}else{_0x16c119=_0x2e28ca;return _0x16c119;}})[_0x1900('0x10')](function(){_0x16c119['authenticate'](_0xc4ce97,function(_0x4be51,_0x4adccc){var _0x112d82=_0x16c119[_0x1900('0x16')]+0x1;if(_0x4be51){return _0x66d3f7(_0x4be51);}else if(!_0x4adccc){if(_0x16c119[_0x1900('0x13')]){return _0x66d3f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3934a1[_0x1900('0xe')]>0x0){if(_0x16c119[_0x1900('0x14')]){if(_0x3934a1[_0x1900('0xf')]>0x0){if(moment(_0x16c119[_0x1900('0x15')])['add'](_0x3934a1['blockDuration'],_0x1900('0x1b'))>moment()){return _0x66d3f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1900('0x1c')](_0x16c119,_0x112d82,![],null)[_0x1900('0x10')](function(){return _0x66d3f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});}}else{if(_0x112d82>=_0x3934a1[_0x1900('0xe')]){return utils[_0x1900('0x1c')](_0x16c119,0x0,!![],moment())['then'](function(){return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});});}else{return utils['clearBlockUser'](_0x16c119,_0x112d82,![],null)[_0x1900('0x10')](function(){return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});});}}}else{return _0x66d3f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x16c119[_0x1900('0x13')]){return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});}else if(_0x3934a1[_0x1900('0xe')]>0x0){if(_0x16c119[_0x1900('0x14')]){if(_0x3934a1[_0x1900('0xf')]>0x0){if(moment(_0x16c119['blockedAt'])[_0x1900('0x1d')](_0x3934a1[_0x1900('0xf')],'minutes')>moment()){return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});}else{return utils['clearBlockUser'](_0x16c119,0x0,![],null)[_0x1900('0x10')](function(){return utils[_0x1900('0x1e')](_0x16c119);})[_0x1900('0x10')](function(){return _0x66d3f7(null,_0x16c119);});}}else{return _0x66d3f7(null,![],{'message':_0x1900('0x1a')});}}else{return utils[_0x1900('0x1c')](_0x16c119,0x0,![],null)[_0x1900('0x10')](function(){return utils[_0x1900('0x1e')](_0x16c119);})[_0x1900('0x10')](function(){return _0x66d3f7(null,_0x16c119);})['catch'](function(_0x7c3356){return _0x66d3f7(null,![],_0x7c3356);});}}else{if(_0x16c119[_0x1900('0x14')]){return _0x66d3f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1900('0x1e')](_0x16c119)[_0x1900('0x10')](function(){return _0x66d3f7(null,_0x16c119);});}}}});})[_0x1900('0x1f')](function(_0x15f2a4){return _0x66d3f7(null,![],_0x15f2a4);});}function sendServiceMail(_0x5aba60){return db[_0x1900('0x20')][_0x1900('0x21')]({'where':{'service':!![]},'attributes':['id',_0x1900('0x11'),_0x1900('0x22')],'include':[{'model':db[_0x1900('0x23')],'as':_0x1900('0x24')}]})[_0x1900('0x10')](function(_0x1ec766){if(!_0x1ec766){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x33f7c8={'tls':{'rejectUnauthorized':![]}};if(_0x1ec766[_0x1900('0x24')][_0x1900('0x25')]){_0x33f7c8[_0x1900('0x25')]=_0x1ec766[_0x1900('0x24')][_0x1900('0x25')];}else{_0x33f7c8[_0x1900('0x26')]=_0x1ec766['Smtp'][_0x1900('0x26')];_0x33f7c8['port']=_0x1ec766[_0x1900('0x24')][_0x1900('0x27')];_0x33f7c8[_0x1900('0x28')]=_0x1ec766[_0x1900('0x24')][_0x1900('0x28')];}if(_0x1ec766[_0x1900('0x24')][_0x1900('0x29')]){_0x33f7c8[_0x1900('0x2a')]={'user':_0x1ec766[_0x1900('0x24')]['user'],'pass':_0x1ec766[_0x1900('0x24')][_0x1900('0x2b')]};}var _0x5a7db2={'account':_0x33f7c8,'message':_[_0x1900('0x2c')]({'from':util[_0x1900('0x2d')](_0x1900('0x2e'),_0x1ec766[_0x1900('0x11')],_0x1ec766['email']||_0x1ec766['Smtp'][_0x1900('0x18')])},_0x5aba60)};return client[_0x1900('0x2f')]('SendMail',_0x5a7db2);})['then'](function(_0x4d60ec){if(_0x4d60ec[_0x1900('0x30')]){throw new Error(util[_0x1900('0x2d')](_0x1900('0x31'),_0x4d60ec[_0x1900('0x30')][_0x1900('0x32')]||JSON[_0x1900('0x33')](_0x4d60ec[_0x1900('0x30')])));}return!![];});}function handleError(_0x3f483d,_0x3034b3,_0x5a3c2){return _0x3f483d['status'](_0x3034b3||0x1f4)[_0x1900('0x34')]({'message':_0x5a3c2?_0x5a3c2[_0x1900('0x32')]||_0x5a3c2:''});}exports[_0x1900('0x35')]=function(_0x32f494,_0x2ced06,_0x36a8e2){passport[_0x1900('0x36')](_0x1900('0x37'),function(_0x2744fa,_0x36e418,_0x340b85){var _0x901592=_0x2744fa||_0x340b85;if(_0x901592){return handleError(_0x2ced06,0x191,_0x901592);}if(!_0x36e418){return handleError(_0x2ced06,0x194,{'message':_0x1900('0x38')});}else{var _0xfa105f={'payload':{'id':_0x36e418['id'],'role':_0x36e418[_0x1900('0x39')]},'options':{'expiresIn':0x15180}};return authService[_0x1900('0x3a')](_0xfa105f)['then'](function(_0x492b6c){_0x2ced06[_0x1900('0x3b')]({'id':_0x36e418['id'],'token':_0x492b6c,'statusCall':'','isAlreadyLogged':_0x36e418[_0x1900('0x3c')]});});}})(_0x32f494,_0x2ced06,_0x36a8e2);};exports[_0x1900('0x3d')]=function(_0x32051a,_0x20119b,_0x9ced47){if(!_0x32051a['body'][_0x1900('0x22')]){return handleError(_0x20119b,0x1f4,{'message':_0x1900('0x3e')});}var _0x339a8c=rs[_0x1900('0x3f')]();_0x32051a['body']['email']=_0x32051a[_0x1900('0x40')]['email'][_0x1900('0x41')]()['toLowerCase']();var _0x59e606;return db[_0x1900('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x1900('0xe'),_0x1900('0xf')],'raw':!![]})[_0x1900('0x10')](function(_0x29e5dc){_0x59e606=_0x29e5dc;return db[_0x1900('0x42')][_0x1900('0x21')]({'where':{'email':_0x32051a[_0x1900('0x40')]['email']}});})[_0x1900('0x10')](function(_0xd78ab9){if(!_0xd78ab9){throw new Error(_0x1900('0x43'));}if(_0xd78ab9[_0x1900('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xd78ab9[_0x1900('0x14')]){if(moment(_0xd78ab9['blockedAt'])[_0x1900('0x1d')](_0x59e606[_0x1900('0xf')],_0x1900('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xd78ab9[_0x1900('0x14')]=![];_0xd78ab9['blockedAt']=null;}}_0xd78ab9[_0x1900('0x44')]=_0x339a8c;_0xd78ab9[_0x1900('0x45')]=Date[_0x1900('0x46')]()+0x36ee80;return _0xd78ab9[_0x1900('0x47')]();})[_0x1900('0x10')](function(){return sendServiceMail({'to':_0x32051a[_0x1900('0x40')][_0x1900('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x1900('0x48')+_0x1900('0x49')+_0x32051a[_0x1900('0x4a')][_0x1900('0x26')]+'/reset/'+_0x339a8c+'\x0a\x0a'+_0x1900('0x4b')});})[_0x1900('0x10')](function(){_0x20119b[_0x1900('0x4c')](0xc8)[_0x1900('0x34')]({'message':_0x1900('0x4d')});})[_0x1900('0x1f')](function(_0x1053e1){return handleError(_0x20119b,0x1f4,_0x1053e1);});};exports[_0x1900('0x4e')]=function(_0x141a77,_0x237ae0,_0x2905f0){return db[_0x1900('0x42')][_0x1900('0x21')]({'where':{'resetPasswordToken':_0x141a77['params'][_0x1900('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x1900('0x46')]()}}})[_0x1900('0x10')](function(_0x36e77e){if(!_0x36e77e){throw new Error(_0x1900('0x50'));}return db[_0x1900('0xc')]['findOne']({'attributes':['id',_0x1900('0x51'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x1900('0x10')](function(_0xd088f2){if(_0xd088f2['securePassword'])authService[_0x1900('0x52')](_0x141a77['body'][_0x1900('0x12')]);if(!_0xd088f2['enforcePasswordHistory']||!_0x36e77e['previousPasswords'])return _0x36e77e;authService[_0x1900('0x53')](_0x141a77[_0x1900('0x40')][_0x1900('0x12')],_0x36e77e[_0x1900('0x54')],_0xd088f2[_0x1900('0x55')]);return _0x36e77e;})[_0x1900('0x10')](function(){_0x36e77e[_0x1900('0x12')]=_0x141a77['body'][_0x1900('0x12')];_0x36e77e['resetPasswordToken']=null;_0x36e77e[_0x1900('0x45')]=null;return _0x36e77e['save']();});})[_0x1900('0x10')](function(){_0x237ae0[_0x1900('0x4c')](0xc8)[_0x1900('0x34')]({'message':_0x1900('0x56')});})['catch'](function(_0x171a77){return handleError(_0x237ae0,0x1f4,_0x171a77);});};passport[_0x1900('0x57')]('local-login',new LocalStrategy({'usernameField':_0x1900('0x11'),'passwordField':_0x1900('0x12')},function(_0xbc8e40,_0x3ae7ae,_0xe178ad){return localAuthenticate(db['User'],_0xbc8e40,_0x3ae7ae,_0xe178ad);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ba08e59..33cbe13 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 _0xf191=['reset','express','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x3fbc44,_0x2cfa26){var _0x55ef35=function(_0x44de0c){while(--_0x44de0c){_0x3fbc44['push'](_0x3fbc44['shift']());}};_0x55ef35(++_0x2cfa26);}(_0xf191,0x1c1));var _0x1f19=function(_0x305b12,_0x5ecd09){_0x305b12=_0x305b12-0x0;var _0x4141de=_0xf191[_0x305b12];return _0x4141de;};'use strict';var express=require(_0x1f19('0x0'));var router=express['Router']();var controller=require(_0x1f19('0x1'));router[_0x1f19('0x2')]('/',controller['login']);router[_0x1f19('0x2')](_0x1f19('0x3'),controller[_0x1f19('0x4')]);router[_0x1f19('0x2')](_0x1f19('0x5'),controller[_0x1f19('0x6')]);module['exports']=router; \ No newline at end of file +var _0x645a=['/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x645a,0xf8));var _0xa645=function(_0x499ae7,_0x11541d){_0x499ae7=_0x499ae7-0x0;var _0xdfdd0f=_0x645a[_0x499ae7];return _0xdfdd0f;};'use strict';var express=require('express');var router=express[_0xa645('0x0')]();var controller=require(_0xa645('0x1'));router[_0xa645('0x2')]('/',controller[_0xa645('0x3')]);router['post'](_0xa645('0x4'),controller[_0xa645('0x5')]);router[_0xa645('0x2')](_0xa645('0x6'),controller[_0xa645('0x7')]);module[_0xa645('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 16db9c6..5274b2f 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 _0xbba1=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xbba1,0x152));var _0x1bba=function(_0x428875,_0x38a87e){_0x428875=_0x428875-0x0;var _0x4eb593=_0xbba1[_0x428875];return _0x4eb593;};'use strict';var Sequelize=require(_0x1bba('0x0'));module[_0x1bba('0x1')]={'name':{'type':Sequelize[_0x1bba('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1bba('0x2')]},'description':{'type':Sequelize[_0x1bba('0x2')]},'status':{'type':Sequelize[_0x1bba('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1bba('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xca90=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xca90,0x121));var _0x0ca9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xca90[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0ca9('0x0'));module[_0x0ca9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x0ca9('0x2')]},'description':{'type':Sequelize[_0x0ca9('0x2')]},'status':{'type':Sequelize[_0x0ca9('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0ca9('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index c6c2112..f55e5a9 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 _0x9f17=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','json','apply','reject','update','then','destroy','error','stack','name','index','map','Automation','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','find','create','body','ids','omit','findOne','Condition','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2f3cb7,_0x1fe95b){var _0x1f0047=function(_0x31ab76){while(--_0x31ab76){_0x2f3cb7['push'](_0x2f3cb7['shift']());}};_0x1f0047(++_0x1fe95b);}(_0x9f17,0x1c8));var _0x79f1=function(_0x1160ba,_0x1d0886){_0x1160ba=_0x1160ba-0x0;var _0xad4ab2=_0x9f17[_0x1160ba];return _0xad4ab2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79f1('0x0'));var zipdir=require(_0x79f1('0x1'));var jsonpatch=require(_0x79f1('0x2'));var rp=require('request-promise');var moment=require(_0x79f1('0x3'));var BPromise=require(_0x79f1('0x4'));var Mustache=require(_0x79f1('0x5'));var util=require(_0x79f1('0x6'));var path=require(_0x79f1('0x7'));var sox=require('sox');var csv=require(_0x79f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79f1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79f1('0xa'));var deskjs=require(_0x79f1('0xb'));var toCsv=require(_0x79f1('0x8'));var querystring=require(_0x79f1('0xc'));var Papa=require('papaparse');var Redis=require(_0x79f1('0xd'));var authService=require(_0x79f1('0xe'));var qs=require(_0x79f1('0xf'));var as=require(_0x79f1('0x10'));var hardwareService=require(_0x79f1('0x11'));var logger=require('../../config/logger')(_0x79f1('0x12'));var utils=require(_0x79f1('0x13'));var config=require(_0x79f1('0x14'));var licenseUtil=require(_0x79f1('0x15'));var db=require(_0x79f1('0x16'))['db'];function respondWithStatusCode(_0x43233f,_0x392caf){_0x392caf=_0x392caf||0xcc;return function(_0x1b185f){if(_0x1b185f){return _0x43233f[_0x79f1('0x17')](_0x392caf);}return _0x43233f['status'](_0x392caf)[_0x79f1('0x18')]();};}function respondWithResult(_0x160440,_0xdafff7){_0xdafff7=_0xdafff7||0xc8;return function(_0x567875){if(_0x567875){return _0x160440[_0x79f1('0x19')](_0xdafff7)['json'](_0x567875);}};}function respondWithFilteredResult(_0x1d6ba1,_0x2f0e83){return function(_0x1f9c10){if(_0x1f9c10){var _0x47300c=typeof _0x2f0e83[_0x79f1('0x1a')]===_0x79f1('0x1b')&&typeof _0x2f0e83[_0x79f1('0x1c')]===_0x79f1('0x1b');var _0x3e2689=_0x1f9c10['count'];var _0x33da15=_0x47300c?0x0:_0x2f0e83[_0x79f1('0x1a')];var _0x39121c=_0x47300c?_0x1f9c10['count']:_0x2f0e83['offset']+_0x2f0e83[_0x79f1('0x1c')];var _0xcabf22;if(_0x39121c>=_0x3e2689){_0x39121c=_0x3e2689;_0xcabf22=0xc8;}else{_0xcabf22=0xce;}_0x1d6ba1[_0x79f1('0x19')](_0xcabf22);return _0x1d6ba1['set']('Content-Range',_0x33da15+'-'+_0x39121c+'/'+_0x3e2689)[_0x79f1('0x1d')](_0x1f9c10);}return null;};}function patchUpdates(_0x3424b0){return function(_0x25ef9f){try{jsonpatch[_0x79f1('0x1e')](_0x25ef9f,_0x3424b0,!![]);}catch(_0x16f9d7){return BPromise[_0x79f1('0x1f')](_0x16f9d7);}return _0x25ef9f['save']();};}function saveUpdates(_0xf303ed,_0x29fa40){return function(_0x26d89a){if(_0x26d89a){return _0x26d89a[_0x79f1('0x20')](_0xf303ed)[_0x79f1('0x21')](function(_0x53f374){return _0x53f374;});}return null;};}function removeEntity(_0x2fb5c1,_0x49c313){return function(_0x3ed537){if(_0x3ed537){return _0x3ed537[_0x79f1('0x22')]()['then'](function(){_0x2fb5c1[_0x79f1('0x19')](0xcc)[_0x79f1('0x18')]();});}};}function handleEntityNotFound(_0x11ff71,_0x581058){return function(_0xdd705c){if(!_0xdd705c){_0x11ff71[_0x79f1('0x17')](0x194);}return _0xdd705c;};}function handleError(_0x3c4ab8,_0x211fef){_0x211fef=_0x211fef||0x1f4;return function(_0x434a57){logger[_0x79f1('0x23')](_0x434a57[_0x79f1('0x24')]);if(_0x434a57[_0x79f1('0x25')]){delete _0x434a57[_0x79f1('0x25')];}_0x3c4ab8[_0x79f1('0x19')](_0x211fef)['send'](_0x434a57);};}exports[_0x79f1('0x26')]=function(_0x4b5b36,_0x3718b4){var _0xc40469={},_0xc91d12={},_0xe5f020={'count':0x0,'rows':[]};var _0x4a88d1=_[_0x79f1('0x27')](db[_0x79f1('0x28')]['rawAttributes'],function(_0x225b7e){return{'name':_0x225b7e[_0x79f1('0x29')],'type':_0x225b7e[_0x79f1('0x2a')][_0x79f1('0x2b')]};});_0xc91d12['model']=_[_0x79f1('0x27')](_0x4a88d1,'name');_0xc91d12[_0x79f1('0x2c')]=_[_0x79f1('0x2d')](_0x4b5b36[_0x79f1('0x2c')]);_0xc91d12[_0x79f1('0x2e')]=_[_0x79f1('0x2f')](_0xc91d12['model'],_0xc91d12[_0x79f1('0x2c')]);_0xc40469[_0x79f1('0x30')]=_[_0x79f1('0x2f')](_0xc91d12[_0x79f1('0x31')],qs[_0x79f1('0x32')](_0x4b5b36[_0x79f1('0x2c')]['fields']));_0xc40469[_0x79f1('0x30')]=_0xc40469['attributes'][_0x79f1('0x33')]?_0xc40469[_0x79f1('0x30')]:_0xc91d12[_0x79f1('0x31')];if(!_0x4b5b36[_0x79f1('0x2c')][_0x79f1('0x34')](_0x79f1('0x35'))){_0xc40469[_0x79f1('0x1c')]=qs[_0x79f1('0x1c')](_0x4b5b36[_0x79f1('0x2c')][_0x79f1('0x1c')]);_0xc40469[_0x79f1('0x1a')]=qs[_0x79f1('0x1a')](_0x4b5b36[_0x79f1('0x2c')]['offset']);}_0xc40469[_0x79f1('0x36')]=qs[_0x79f1('0x37')](_0x4b5b36[_0x79f1('0x2c')]['sort']);_0xc40469[_0x79f1('0x38')]=qs[_0x79f1('0x2e')](_[_0x79f1('0x39')](_0x4b5b36[_0x79f1('0x2c')],_0xc91d12[_0x79f1('0x2e')]),_0x4a88d1);if(_0x4b5b36[_0x79f1('0x2c')][_0x79f1('0x3a')]){_0xc40469['where']=_[_0x79f1('0x3b')](_0xc40469['where'],{'$or':_[_0x79f1('0x27')](_0x4a88d1,function(_0x6a25da){if(_0x6a25da['type']!==_0x79f1('0x3c')){var _0x3d992f={};_0x3d992f[_0x6a25da['name']]={'$like':'%'+_0x4b5b36[_0x79f1('0x2c')]['filter']+'%'};return _0x3d992f;}})});}_0xc40469=_[_0x79f1('0x3b')]({},_0xc40469,_0x4b5b36[_0x79f1('0x3d')]);var _0x561671={'where':_0xc40469[_0x79f1('0x38')]};return db[_0x79f1('0x28')]['count'](_0x561671)[_0x79f1('0x21')](function(_0x4714cf){_0xe5f020[_0x79f1('0x3e')]=_0x4714cf;if(_0x4b5b36['query'][_0x79f1('0x3f')]){_0xc40469['include']=[{'all':!![]}];}return db[_0x79f1('0x28')]['findAll'](_0xc40469);})[_0x79f1('0x21')](function(_0x1b8def){_0xe5f020[_0x79f1('0x40')]=_0x1b8def;return _0xe5f020;})[_0x79f1('0x21')](respondWithFilteredResult(_0x3718b4,_0xc40469))[_0x79f1('0x41')](handleError(_0x3718b4,null));};exports[_0x79f1('0x42')]=function(_0x141bc8,_0x4a06ab){var _0x20b8ac={'raw':![],'where':{'id':_0x141bc8[_0x79f1('0x43')]['id']}},_0x3c5876={};_0x3c5876[_0x79f1('0x31')]=_[_0x79f1('0x2d')](db['Automation'][_0x79f1('0x44')]);_0x3c5876['query']=_[_0x79f1('0x2d')](_0x141bc8['query']);_0x3c5876[_0x79f1('0x2e')]=_['intersection'](_0x3c5876[_0x79f1('0x31')],_0x3c5876[_0x79f1('0x2c')]);_0x20b8ac[_0x79f1('0x30')]=_[_0x79f1('0x2f')](_0x3c5876[_0x79f1('0x31')],qs['fields'](_0x141bc8[_0x79f1('0x2c')]['fields']));_0x20b8ac[_0x79f1('0x30')]=_0x20b8ac[_0x79f1('0x30')][_0x79f1('0x33')]?_0x20b8ac[_0x79f1('0x30')]:_0x3c5876[_0x79f1('0x31')];if(_0x141bc8['query'][_0x79f1('0x3f')]){_0x20b8ac['include']=[{'all':!![]}];}_0x20b8ac=_[_0x79f1('0x3b')]({},_0x20b8ac,_0x141bc8[_0x79f1('0x3d')]);return db[_0x79f1('0x28')][_0x79f1('0x45')](_0x20b8ac)[_0x79f1('0x21')](handleEntityNotFound(_0x4a06ab,null))[_0x79f1('0x21')](respondWithResult(_0x4a06ab,null))['catch'](handleError(_0x4a06ab,null));};exports[_0x79f1('0x46')]=function(_0xfb22ac,_0x671f54){return db['Automation']['create'](_0xfb22ac[_0x79f1('0x47')],{})['then'](respondWithResult(_0x671f54,0xc9))[_0x79f1('0x41')](handleError(_0x671f54,null));};exports['update']=function(_0x4020de,_0x4cd0ee){if(_0x4020de[_0x79f1('0x47')]['id']){delete _0x4020de['body']['id'];}return db[_0x79f1('0x28')][_0x79f1('0x45')]({'where':{'id':_0x4020de[_0x79f1('0x43')]['id']}})[_0x79f1('0x21')](handleEntityNotFound(_0x4cd0ee,null))[_0x79f1('0x21')](saveUpdates(_0x4020de[_0x79f1('0x47')],null))[_0x79f1('0x21')](respondWithResult(_0x4cd0ee,null))['catch'](handleError(_0x4cd0ee,null));};exports[_0x79f1('0x22')]=function(_0x29381a,_0x9c5796){return db[_0x79f1('0x28')][_0x79f1('0x45')]({'where':{'id':_0x29381a[_0x79f1('0x43')]['id']}})[_0x79f1('0x21')](handleEntityNotFound(_0x9c5796,null))[_0x79f1('0x21')](removeEntity(_0x9c5796,null))[_0x79f1('0x41')](handleError(_0x9c5796,null));};exports['addConditions']=function(_0x1d2bc4,_0x308688,_0x4d024e){return db['Condition']['find']({'where':{'id':_0x1d2bc4['params']['id']}})[_0x79f1('0x21')](handleEntityNotFound(_0x308688,null))['then'](function(_0x3e8499){if(_0x3e8499){return _0x3e8499['addConditions'](_0x1d2bc4[_0x79f1('0x47')][_0x79f1('0x48')],_[_0x79f1('0x49')](_0x1d2bc4[_0x79f1('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x308688,null))[_0x79f1('0x41')](handleError(_0x308688,null));};exports['getConditions']=function(_0x150493,_0x2cd519,_0x5af936){var _0x1ceb32={};var _0x44eda4={};var _0x2bde22;var _0x3a4605;return db[_0x79f1('0x28')][_0x79f1('0x4a')]({'where':{'id':_0x150493[_0x79f1('0x43')]['id']}})[_0x79f1('0x21')](handleEntityNotFound(_0x2cd519,null))[_0x79f1('0x21')](function(_0x1ad5c1){if(_0x1ad5c1){_0x2bde22=_0x1ad5c1;_0x44eda4[_0x79f1('0x31')]=_[_0x79f1('0x2d')](db[_0x79f1('0x4b')]['rawAttributes']);_0x44eda4[_0x79f1('0x2c')]=_[_0x79f1('0x2d')](_0x150493['query']);_0x44eda4[_0x79f1('0x2e')]=_[_0x79f1('0x2f')](_0x44eda4[_0x79f1('0x31')],_0x44eda4[_0x79f1('0x2c')]);_0x1ceb32[_0x79f1('0x30')]=_[_0x79f1('0x2f')](_0x44eda4[_0x79f1('0x31')],qs[_0x79f1('0x32')](_0x150493[_0x79f1('0x2c')][_0x79f1('0x32')]));_0x1ceb32[_0x79f1('0x30')]=_0x1ceb32['attributes'][_0x79f1('0x33')]?_0x1ceb32[_0x79f1('0x30')]:_0x44eda4[_0x79f1('0x31')];_0x1ceb32[_0x79f1('0x36')]=qs[_0x79f1('0x37')](_0x150493[_0x79f1('0x2c')][_0x79f1('0x37')]);_0x1ceb32[_0x79f1('0x38')]=qs[_0x79f1('0x2e')](_['pick'](_0x150493[_0x79f1('0x2c')],_0x44eda4[_0x79f1('0x2e')]));if(_0x150493[_0x79f1('0x2c')][_0x79f1('0x3a')]){_0x1ceb32['where']=_[_0x79f1('0x3b')](_0x1ceb32[_0x79f1('0x38')],{'$or':_[_0x79f1('0x27')](_0x1ceb32[_0x79f1('0x30')],function(_0x45e799){var _0x3a2479={};_0x3a2479[_0x45e799]={'$like':'%'+_0x150493[_0x79f1('0x2c')][_0x79f1('0x3a')]+'%'};return _0x3a2479;})});}_0x1ceb32=_[_0x79f1('0x3b')]({},_0x1ceb32,_0x150493[_0x79f1('0x3d')]);return _0x2bde22['getConditions'](_0x1ceb32);}})['then'](function(_0x2956b7){if(_0x2956b7){_0x3a4605=_0x2956b7['length'];if(!_0x150493[_0x79f1('0x2c')][_0x79f1('0x34')](_0x79f1('0x35'))){_0x1ceb32[_0x79f1('0x1c')]=qs[_0x79f1('0x1c')](_0x150493[_0x79f1('0x2c')][_0x79f1('0x1c')]);_0x1ceb32[_0x79f1('0x1a')]=qs[_0x79f1('0x1a')](_0x150493['query'][_0x79f1('0x1a')]);}return _0x2bde22['getConditions'](_0x1ceb32);}})[_0x79f1('0x21')](function(_0x30c903){if(_0x30c903){return _0x30c903?{'count':_0x3a4605,'rows':_0x30c903}:null;}})[_0x79f1('0x21')](respondWithResult(_0x2cd519,null))['catch'](handleError(_0x2cd519,null));};exports[_0x79f1('0x4c')]=function(_0x4f7f36,_0x1f9598,_0x4dc360){return db[_0x79f1('0x4d')][_0x79f1('0x45')]({'where':{'id':_0x4f7f36[_0x79f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f9598,null))[_0x79f1('0x21')](function(_0x2a72d4){if(_0x2a72d4){return _0x2a72d4['addActions'](_0x4f7f36[_0x79f1('0x47')][_0x79f1('0x48')],_['omit'](_0x4f7f36[_0x79f1('0x47')],[_0x79f1('0x48'),'id'])||{});}})[_0x79f1('0x21')](respondWithResult(_0x1f9598,null))['catch'](handleError(_0x1f9598,null));};exports['getActions']=function(_0x4514ee,_0x1a5d3c,_0x394913){var _0x31c839={};var _0x19bd57={};var _0x428cd2;var _0xad855b;return db['Automation']['findOne']({'where':{'id':_0x4514ee[_0x79f1('0x43')]['id']}})[_0x79f1('0x21')](handleEntityNotFound(_0x1a5d3c,null))['then'](function(_0x1a7fd2){if(_0x1a7fd2){_0x428cd2=_0x1a7fd2;_0x19bd57[_0x79f1('0x31')]=_[_0x79f1('0x2d')](db[_0x79f1('0x4d')]['rawAttributes']);_0x19bd57[_0x79f1('0x2c')]=_[_0x79f1('0x2d')](_0x4514ee[_0x79f1('0x2c')]);_0x19bd57[_0x79f1('0x2e')]=_[_0x79f1('0x2f')](_0x19bd57[_0x79f1('0x31')],_0x19bd57[_0x79f1('0x2c')]);_0x31c839[_0x79f1('0x30')]=_[_0x79f1('0x2f')](_0x19bd57[_0x79f1('0x31')],qs[_0x79f1('0x32')](_0x4514ee[_0x79f1('0x2c')]['fields']));_0x31c839[_0x79f1('0x30')]=_0x31c839[_0x79f1('0x30')][_0x79f1('0x33')]?_0x31c839[_0x79f1('0x30')]:_0x19bd57[_0x79f1('0x31')];_0x31c839[_0x79f1('0x36')]=qs[_0x79f1('0x37')](_0x4514ee[_0x79f1('0x2c')][_0x79f1('0x37')]);_0x31c839[_0x79f1('0x38')]=qs[_0x79f1('0x2e')](_['pick'](_0x4514ee[_0x79f1('0x2c')],_0x19bd57['filters']));if(_0x4514ee[_0x79f1('0x2c')]['filter']){_0x31c839[_0x79f1('0x38')]=_[_0x79f1('0x3b')](_0x31c839[_0x79f1('0x38')],{'$or':_[_0x79f1('0x27')](_0x31c839[_0x79f1('0x30')],function(_0x909ee3){var _0x25fbf0={};_0x25fbf0[_0x909ee3]={'$like':'%'+_0x4514ee[_0x79f1('0x2c')]['filter']+'%'};return _0x25fbf0;})});}_0x31c839=_[_0x79f1('0x3b')]({},_0x31c839,_0x4514ee[_0x79f1('0x3d')]);return _0x428cd2['getActions'](_0x31c839);}})[_0x79f1('0x21')](function(_0x41f556){if(_0x41f556){_0xad855b=_0x41f556['length'];if(!_0x4514ee[_0x79f1('0x2c')][_0x79f1('0x34')](_0x79f1('0x35'))){_0x31c839[_0x79f1('0x1c')]=qs[_0x79f1('0x1c')](_0x4514ee['query']['limit']);_0x31c839[_0x79f1('0x1a')]=qs[_0x79f1('0x1a')](_0x4514ee[_0x79f1('0x2c')][_0x79f1('0x1a')]);}return _0x428cd2[_0x79f1('0x4e')](_0x31c839);}})[_0x79f1('0x21')](function(_0x51ad72){if(_0x51ad72){return _0x51ad72?{'count':_0xad855b,'rows':_0x51ad72}:null;}})[_0x79f1('0x21')](respondWithResult(_0x1a5d3c,null))[_0x79f1('0x41')](handleError(_0x1a5d3c,null));}; \ No newline at end of file +var _0x794e=['querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','Automation','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','pick','hasOwnProperty','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','crypto','desk.js'];(function(_0x3cc333,_0x1b641f){var _0x5ad627=function(_0x51fd50){while(--_0x51fd50){_0x3cc333['push'](_0x3cc333['shift']());}};_0x5ad627(++_0x1b641f);}(_0x794e,0x17b));var _0xe794=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x794e[_0x5834bc];return _0x3e183a;};'use strict';var emlformat=require(_0xe794('0x0'));var rimraf=require(_0xe794('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe794('0x2'));var rp=require('request-promise');var moment=require(_0xe794('0x3'));var BPromise=require(_0xe794('0x4'));var Mustache=require(_0xe794('0x5'));var util=require(_0xe794('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe794('0x7'));var ejs=require(_0xe794('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe794('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe794('0xa'));var toCsv=require(_0xe794('0x7'));var querystring=require(_0xe794('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe794('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe794('0xd'));var logger=require(_0xe794('0xe'))(_0xe794('0xf'));var utils=require(_0xe794('0x10'));var config=require(_0xe794('0x11'));var licenseUtil=require(_0xe794('0x12'));var db=require(_0xe794('0x13'))['db'];function respondWithStatusCode(_0x42c3f5,_0x3759d0){_0x3759d0=_0x3759d0||0xcc;return function(_0x4d40a1){if(_0x4d40a1){return _0x42c3f5[_0xe794('0x14')](_0x3759d0);}return _0x42c3f5[_0xe794('0x15')](_0x3759d0)['end']();};}function respondWithResult(_0x53c5c6,_0x1bf748){_0x1bf748=_0x1bf748||0xc8;return function(_0x227c47){if(_0x227c47){return _0x53c5c6[_0xe794('0x15')](_0x1bf748)[_0xe794('0x16')](_0x227c47);}};}function respondWithFilteredResult(_0x39170e,_0x30e494){return function(_0x5310a3){if(_0x5310a3){var _0x4725e2=typeof _0x30e494[_0xe794('0x17')]==='undefined'&&typeof _0x30e494[_0xe794('0x18')]==='undefined';var _0x1b4a14=_0x5310a3['count'];var _0x5c9e02=_0x4725e2?0x0:_0x30e494[_0xe794('0x17')];var _0x1423ea=_0x4725e2?_0x5310a3[_0xe794('0x19')]:_0x30e494[_0xe794('0x17')]+_0x30e494[_0xe794('0x18')];var _0x102866;if(_0x1423ea>=_0x1b4a14){_0x1423ea=_0x1b4a14;_0x102866=0xc8;}else{_0x102866=0xce;}_0x39170e[_0xe794('0x15')](_0x102866);return _0x39170e[_0xe794('0x1a')](_0xe794('0x1b'),_0x5c9e02+'-'+_0x1423ea+'/'+_0x1b4a14)[_0xe794('0x16')](_0x5310a3);}return null;};}function patchUpdates(_0xaef2dd){return function(_0x14efc9){try{jsonpatch[_0xe794('0x1c')](_0x14efc9,_0xaef2dd,!![]);}catch(_0x228cbd){return BPromise[_0xe794('0x1d')](_0x228cbd);}return _0x14efc9['save']();};}function saveUpdates(_0x3780a4,_0x19f02a){return function(_0x14e084){if(_0x14e084){return _0x14e084[_0xe794('0x1e')](_0x3780a4)['then'](function(_0x147039){return _0x147039;});}return null;};}function removeEntity(_0x29f484,_0x45f20a){return function(_0x4152a2){if(_0x4152a2){return _0x4152a2[_0xe794('0x1f')]()[_0xe794('0x20')](function(){_0x29f484[_0xe794('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a891e,_0x5e2d98){return function(_0x2bde89){if(!_0x2bde89){_0x3a891e[_0xe794('0x14')](0x194);}return _0x2bde89;};}function handleError(_0x3d6b57,_0x2f562b){_0x2f562b=_0x2f562b||0x1f4;return function(_0x126201){logger[_0xe794('0x21')](_0x126201['stack']);if(_0x126201['name']){delete _0x126201[_0xe794('0x22')];}_0x3d6b57[_0xe794('0x15')](_0x2f562b)[_0xe794('0x23')](_0x126201);};}exports[_0xe794('0x24')]=function(_0x13b247,_0x9721ca){var _0x388c0e={},_0x37e8d1={},_0x579300={'count':0x0,'rows':[]};var _0x522848=_[_0xe794('0x25')](db[_0xe794('0x26')][_0xe794('0x27')],function(_0x4be38f){return{'name':_0x4be38f['fieldName'],'type':_0x4be38f[_0xe794('0x28')][_0xe794('0x29')]};});_0x37e8d1[_0xe794('0x2a')]=_[_0xe794('0x25')](_0x522848,_0xe794('0x22'));_0x37e8d1['query']=_[_0xe794('0x2b')](_0x13b247['query']);_0x37e8d1[_0xe794('0x2c')]=_[_0xe794('0x2d')](_0x37e8d1['model'],_0x37e8d1[_0xe794('0x2e')]);_0x388c0e['attributes']=_[_0xe794('0x2d')](_0x37e8d1['model'],qs['fields'](_0x13b247['query'][_0xe794('0x2f')]));_0x388c0e[_0xe794('0x30')]=_0x388c0e[_0xe794('0x30')][_0xe794('0x31')]?_0x388c0e[_0xe794('0x30')]:_0x37e8d1[_0xe794('0x2a')];if(!_0x13b247['query']['hasOwnProperty'](_0xe794('0x32'))){_0x388c0e['limit']=qs['limit'](_0x13b247['query'][_0xe794('0x18')]);_0x388c0e[_0xe794('0x17')]=qs['offset'](_0x13b247['query'][_0xe794('0x17')]);}_0x388c0e[_0xe794('0x33')]=qs[_0xe794('0x34')](_0x13b247[_0xe794('0x2e')][_0xe794('0x34')]);_0x388c0e['where']=qs[_0xe794('0x2c')](_['pick'](_0x13b247[_0xe794('0x2e')],_0x37e8d1[_0xe794('0x2c')]),_0x522848);if(_0x13b247[_0xe794('0x2e')]['filter']){_0x388c0e[_0xe794('0x35')]=_['merge'](_0x388c0e['where'],{'$or':_[_0xe794('0x25')](_0x522848,function(_0xd2d9b4){if(_0xd2d9b4['type']!==_0xe794('0x36')){var _0x8ae82a={};_0x8ae82a[_0xd2d9b4['name']]={'$like':'%'+_0x13b247[_0xe794('0x2e')][_0xe794('0x37')]+'%'};return _0x8ae82a;}})});}_0x388c0e=_[_0xe794('0x38')]({},_0x388c0e,_0x13b247[_0xe794('0x39')]);var _0x42d110={'where':_0x388c0e['where']};return db[_0xe794('0x26')][_0xe794('0x19')](_0x42d110)[_0xe794('0x20')](function(_0x48f27b){_0x579300[_0xe794('0x19')]=_0x48f27b;if(_0x13b247[_0xe794('0x2e')][_0xe794('0x3a')]){_0x388c0e[_0xe794('0x3b')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x388c0e);})['then'](function(_0x3f646d){_0x579300[_0xe794('0x3c')]=_0x3f646d;return _0x579300;})[_0xe794('0x20')](respondWithFilteredResult(_0x9721ca,_0x388c0e))[_0xe794('0x3d')](handleError(_0x9721ca,null));};exports[_0xe794('0x3e')]=function(_0x52bb84,_0x559457){var _0x1819a1={'raw':![],'where':{'id':_0x52bb84[_0xe794('0x3f')]['id']}},_0x5132db={};_0x5132db['model']=_[_0xe794('0x2b')](db[_0xe794('0x26')][_0xe794('0x27')]);_0x5132db[_0xe794('0x2e')]=_[_0xe794('0x2b')](_0x52bb84[_0xe794('0x2e')]);_0x5132db[_0xe794('0x2c')]=_[_0xe794('0x2d')](_0x5132db['model'],_0x5132db[_0xe794('0x2e')]);_0x1819a1[_0xe794('0x30')]=_[_0xe794('0x2d')](_0x5132db[_0xe794('0x2a')],qs[_0xe794('0x2f')](_0x52bb84['query'][_0xe794('0x2f')]));_0x1819a1[_0xe794('0x30')]=_0x1819a1[_0xe794('0x30')][_0xe794('0x31')]?_0x1819a1[_0xe794('0x30')]:_0x5132db['model'];if(_0x52bb84[_0xe794('0x2e')]['includeAll']){_0x1819a1[_0xe794('0x3b')]=[{'all':!![]}];}_0x1819a1=_[_0xe794('0x38')]({},_0x1819a1,_0x52bb84[_0xe794('0x39')]);return db[_0xe794('0x26')][_0xe794('0x40')](_0x1819a1)[_0xe794('0x20')](handleEntityNotFound(_0x559457,null))['then'](respondWithResult(_0x559457,null))[_0xe794('0x3d')](handleError(_0x559457,null));};exports[_0xe794('0x41')]=function(_0x20e31f,_0x177e39){return db[_0xe794('0x26')][_0xe794('0x41')](_0x20e31f['body'],{})['then'](respondWithResult(_0x177e39,0xc9))['catch'](handleError(_0x177e39,null));};exports[_0xe794('0x1e')]=function(_0x57f2f4,_0x1a54a7){if(_0x57f2f4[_0xe794('0x42')]['id']){delete _0x57f2f4[_0xe794('0x42')]['id'];}return db[_0xe794('0x26')][_0xe794('0x40')]({'where':{'id':_0x57f2f4['params']['id']}})['then'](handleEntityNotFound(_0x1a54a7,null))[_0xe794('0x20')](saveUpdates(_0x57f2f4['body'],null))[_0xe794('0x20')](respondWithResult(_0x1a54a7,null))[_0xe794('0x3d')](handleError(_0x1a54a7,null));};exports[_0xe794('0x1f')]=function(_0x293be1,_0x25484a){return db['Automation'][_0xe794('0x40')]({'where':{'id':_0x293be1['params']['id']}})['then'](handleEntityNotFound(_0x25484a,null))['then'](removeEntity(_0x25484a,null))[_0xe794('0x3d')](handleError(_0x25484a,null));};exports[_0xe794('0x43')]=function(_0x113d0e,_0x1f6caa,_0x3d5bd7){return db['Condition'][_0xe794('0x40')]({'where':{'id':_0x113d0e[_0xe794('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1f6caa,null))[_0xe794('0x20')](function(_0x5dbee1){if(_0x5dbee1){return _0x5dbee1[_0xe794('0x43')](_0x113d0e[_0xe794('0x42')][_0xe794('0x44')],_[_0xe794('0x45')](_0x113d0e[_0xe794('0x42')],[_0xe794('0x44'),'id'])||{});}})['then'](respondWithResult(_0x1f6caa,null))[_0xe794('0x3d')](handleError(_0x1f6caa,null));};exports[_0xe794('0x46')]=function(_0xe0850d,_0x5bda04,_0x293e8a){var _0x5cbb02={};var _0x388216={};var _0x12403a;var _0x55da01;return db[_0xe794('0x26')][_0xe794('0x47')]({'where':{'id':_0xe0850d[_0xe794('0x3f')]['id']}})[_0xe794('0x20')](handleEntityNotFound(_0x5bda04,null))[_0xe794('0x20')](function(_0x262555){if(_0x262555){_0x12403a=_0x262555;_0x388216['model']=_[_0xe794('0x2b')](db[_0xe794('0x48')][_0xe794('0x27')]);_0x388216[_0xe794('0x2e')]=_[_0xe794('0x2b')](_0xe0850d[_0xe794('0x2e')]);_0x388216[_0xe794('0x2c')]=_['intersection'](_0x388216['model'],_0x388216[_0xe794('0x2e')]);_0x5cbb02[_0xe794('0x30')]=_[_0xe794('0x2d')](_0x388216[_0xe794('0x2a')],qs[_0xe794('0x2f')](_0xe0850d['query']['fields']));_0x5cbb02['attributes']=_0x5cbb02[_0xe794('0x30')][_0xe794('0x31')]?_0x5cbb02[_0xe794('0x30')]:_0x388216[_0xe794('0x2a')];_0x5cbb02[_0xe794('0x33')]=qs[_0xe794('0x34')](_0xe0850d[_0xe794('0x2e')]['sort']);_0x5cbb02[_0xe794('0x35')]=qs['filters'](_[_0xe794('0x49')](_0xe0850d[_0xe794('0x2e')],_0x388216[_0xe794('0x2c')]));if(_0xe0850d['query'][_0xe794('0x37')]){_0x5cbb02[_0xe794('0x35')]=_['merge'](_0x5cbb02[_0xe794('0x35')],{'$or':_[_0xe794('0x25')](_0x5cbb02[_0xe794('0x30')],function(_0xf94038){var _0xfd2403={};_0xfd2403[_0xf94038]={'$like':'%'+_0xe0850d[_0xe794('0x2e')][_0xe794('0x37')]+'%'};return _0xfd2403;})});}_0x5cbb02=_[_0xe794('0x38')]({},_0x5cbb02,_0xe0850d[_0xe794('0x39')]);return _0x12403a[_0xe794('0x46')](_0x5cbb02);}})['then'](function(_0x4ef76e){if(_0x4ef76e){_0x55da01=_0x4ef76e[_0xe794('0x31')];if(!_0xe0850d[_0xe794('0x2e')][_0xe794('0x4a')](_0xe794('0x32'))){_0x5cbb02[_0xe794('0x18')]=qs[_0xe794('0x18')](_0xe0850d[_0xe794('0x2e')][_0xe794('0x18')]);_0x5cbb02[_0xe794('0x17')]=qs[_0xe794('0x17')](_0xe0850d['query']['offset']);}return _0x12403a[_0xe794('0x46')](_0x5cbb02);}})['then'](function(_0x575b5c){if(_0x575b5c){return _0x575b5c?{'count':_0x55da01,'rows':_0x575b5c}:null;}})[_0xe794('0x20')](respondWithResult(_0x5bda04,null))[_0xe794('0x3d')](handleError(_0x5bda04,null));};exports[_0xe794('0x4b')]=function(_0xbd5a40,_0x194381,_0x2e57a8){return db['Action']['find']({'where':{'id':_0xbd5a40[_0xe794('0x3f')]['id']}})[_0xe794('0x20')](handleEntityNotFound(_0x194381,null))[_0xe794('0x20')](function(_0x4bbc57){if(_0x4bbc57){return _0x4bbc57['addActions'](_0xbd5a40['body']['ids'],_[_0xe794('0x45')](_0xbd5a40['body'],[_0xe794('0x44'),'id'])||{});}})['then'](respondWithResult(_0x194381,null))['catch'](handleError(_0x194381,null));};exports[_0xe794('0x4c')]=function(_0x4f0ff3,_0x3c791d,_0x174f32){var _0x74755b={};var _0x1faf13={};var _0x34588e;var _0x35e2b1;return db[_0xe794('0x26')]['findOne']({'where':{'id':_0x4f0ff3['params']['id']}})[_0xe794('0x20')](handleEntityNotFound(_0x3c791d,null))[_0xe794('0x20')](function(_0x7339c5){if(_0x7339c5){_0x34588e=_0x7339c5;_0x1faf13[_0xe794('0x2a')]=_[_0xe794('0x2b')](db[_0xe794('0x4d')][_0xe794('0x27')]);_0x1faf13[_0xe794('0x2e')]=_[_0xe794('0x2b')](_0x4f0ff3['query']);_0x1faf13[_0xe794('0x2c')]=_['intersection'](_0x1faf13[_0xe794('0x2a')],_0x1faf13[_0xe794('0x2e')]);_0x74755b['attributes']=_['intersection'](_0x1faf13['model'],qs['fields'](_0x4f0ff3[_0xe794('0x2e')]['fields']));_0x74755b['attributes']=_0x74755b[_0xe794('0x30')][_0xe794('0x31')]?_0x74755b['attributes']:_0x1faf13[_0xe794('0x2a')];_0x74755b['order']=qs[_0xe794('0x34')](_0x4f0ff3['query'][_0xe794('0x34')]);_0x74755b[_0xe794('0x35')]=qs['filters'](_[_0xe794('0x49')](_0x4f0ff3['query'],_0x1faf13['filters']));if(_0x4f0ff3[_0xe794('0x2e')]['filter']){_0x74755b[_0xe794('0x35')]=_[_0xe794('0x38')](_0x74755b[_0xe794('0x35')],{'$or':_[_0xe794('0x25')](_0x74755b[_0xe794('0x30')],function(_0x101e54){var _0x434eb1={};_0x434eb1[_0x101e54]={'$like':'%'+_0x4f0ff3[_0xe794('0x2e')][_0xe794('0x37')]+'%'};return _0x434eb1;})});}_0x74755b=_[_0xe794('0x38')]({},_0x74755b,_0x4f0ff3[_0xe794('0x39')]);return _0x34588e['getActions'](_0x74755b);}})[_0xe794('0x20')](function(_0x26e761){if(_0x26e761){_0x35e2b1=_0x26e761['length'];if(!_0x4f0ff3[_0xe794('0x2e')][_0xe794('0x4a')](_0xe794('0x32'))){_0x74755b[_0xe794('0x18')]=qs[_0xe794('0x18')](_0x4f0ff3[_0xe794('0x2e')][_0xe794('0x18')]);_0x74755b[_0xe794('0x17')]=qs[_0xe794('0x17')](_0x4f0ff3[_0xe794('0x2e')]['offset']);}return _0x34588e[_0xe794('0x4c')](_0x74755b);}})[_0xe794('0x20')](function(_0x2112ad){if(_0x2112ad){return _0x2112ad?{'count':_0x35e2b1,'rows':_0x2112ad}:null;}})[_0xe794('0x20')](respondWithResult(_0x3c791d,null))[_0xe794('0x3d')](handleError(_0x3c791d,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4775466..bceb399 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 _0xa819=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations','../../config/logger','moment','bluebird'];(function(_0x427e9d,_0x6a2c98){var _0x4fc009=function(_0x11d6fb){while(--_0x11d6fb){_0x427e9d['push'](_0x427e9d['shift']());}};_0x4fc009(++_0x6a2c98);}(_0xa819,0x11f));var _0x9a81=function(_0x39543b,_0x21a5ea){_0x39543b=_0x39543b-0x0;var _0xe6e2b8=_0xa819[_0x39543b];return _0xe6e2b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a81('0x0'))('api');var moment=require(_0x9a81('0x1'));var BPromise=require(_0x9a81('0x2'));var rp=require(_0x9a81('0x3'));var fs=require('fs');var path=require(_0x9a81('0x4'));var rimraf=require(_0x9a81('0x5'));var config=require(_0x9a81('0x6'));var attributes=require(_0x9a81('0x7'));module[_0x9a81('0x8')]=function(_0x422765,_0x2ec9ab){return _0x422765['define']('Automation',attributes,{'tableName':_0x9a81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16d0=['moment','bluebird','rimraf','../../config/environment','exports','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x2a3123,_0x225966){var _0xe7eb02=function(_0x9ce013){while(--_0x9ce013){_0x2a3123['push'](_0x2a3123['shift']());}};_0xe7eb02(++_0x225966);}(_0x16d0,0x133));var _0x016d=function(_0x537c84,_0x38468a){_0x537c84=_0x537c84-0x0;var _0x5d66b8=_0x16d0[_0x537c84];return _0x5d66b8;};'use strict';var _=require(_0x016d('0x0'));var util=require(_0x016d('0x1'));var logger=require(_0x016d('0x2'))('api');var moment=require(_0x016d('0x3'));var BPromise=require(_0x016d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x016d('0x5'));var config=require(_0x016d('0x6'));var attributes=require('./automation.attributes');module[_0x016d('0x7')]=function(_0xaa0aa7,_0x39ba58){return _0xaa0aa7['define'](_0x016d('0x8'),attributes,{'tableName':_0x016d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 09ae93f..6f4a9bc 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 _0x3611=['debug','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x2f6dfe,_0x5b8f4a){var _0x5901fa=function(_0x2c005a){while(--_0x2c005a){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5901fa(++_0x5b8f4a);}(_0x3611,0x136));var _0x1361=function(_0xd12505,_0x39566e){_0xd12505=_0xd12505-0x0;var _0x50a799=_0x3611[_0xd12505];return _0x50a799;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1361('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1361('0x2'))['db'];var utils=require(_0x1361('0x3'));var logger=require(_0x1361('0x4'))(_0x1361('0x5'));var config=require('../../config/environment');var jayson=require(_0x1361('0x6'));var client=jayson[_0x1361('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216d22,_0x4da71d,_0x2af7c4){return new BPromise(function(_0x49cfad,_0x5cc29f){return client[_0x1361('0x8')](_0x216d22,_0x2af7c4)[_0x1361('0x9')](function(_0x146242){logger[_0x1361('0xa')](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));logger[_0x1361('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x4da71d,_0x1361('0xc'),JSON['stringify'](_0x146242));if(_0x146242['error']){if(_0x146242[_0x1361('0xe')]['code']===0x1f4){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242[_0x1361('0xe')][_0x1361('0xf')]);return _0x5cc29f(_0x146242[_0x1361('0xe')][_0x1361('0xf')]);}logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242['error']['message']);return _0x49cfad(_0x146242[_0x1361('0xe')]['message']);}else{logger['info'](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));_0x49cfad(_0x146242[_0x1361('0x10')][_0x1361('0xf')]);}})['catch'](function(_0x1bb588){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x1bb588);_0x5cc29f(_0x1bb588);});});} \ No newline at end of file +var _0xa693=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x8ff41b,_0x39f161){var _0x52cfb3=function(_0xb0d8f2){while(--_0xb0d8f2){_0x8ff41b['push'](_0x8ff41b['shift']());}};_0x52cfb3(++_0x39f161);}(_0xa693,0xf1));var _0x3a69=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xa693[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125226,_0x290e84,_0x5e7d90){return new BPromise(function(_0x1d564b,_0x2b8e2e){return client['request'](_0x125226,_0x5e7d90)['then'](function(_0x4e65a5){logger[_0x3a69('0xb')]('Automation,\x20%s,\x20%s',_0x290e84,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x290e84,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x4e65a5));if(_0x4e65a5['error']){if(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x11')]===0x1f4){logger['error'](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x2b8e2e(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x1d564b(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}else{logger[_0x3a69('0xb')]('Automation,\x20%s,\x20%s',_0x290e84,'request\x20sent');_0x1d564b(_0x4e65a5[_0x3a69('0x14')][_0x3a69('0x13')]);}})[_0x3a69('0x15')](function(_0x24fb29){logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x24fb29);_0x2b8e2e(_0x24fb29);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e67d4ad..c29e9d8 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 _0x1629=['show','getConditions','/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0xb3ddd9,_0x355585){var _0x4a606d=function(_0x5e7ac5){while(--_0x5e7ac5){_0xb3ddd9['push'](_0xb3ddd9['shift']());}};_0x4a606d(++_0x355585);}(_0x1629,0x1d8));var _0x9162=function(_0x9952b8,_0x1d8332){_0x9952b8=_0x9952b8-0x0;var _0x5735bb=_0x1629[_0x9952b8];return _0x5735bb;};'use strict';var multer=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var path=require(_0x9162('0x2'));var timeout=require(_0x9162('0x3'));var express=require('express');var router=express[_0x9162('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9162('0x5'));var config=require(_0x9162('0x6'));var controller=require('./automation.controller');router['get']('/',auth[_0x9162('0x7')](),controller[_0x9162('0x8')]);router[_0x9162('0x9')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0xb')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0x9162('0xc')]);router[_0x9162('0x9')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller['getActions']);router[_0x9162('0xe')]('/',auth[_0x9162('0x7')](),controller['create']);router[_0x9162('0xe')](_0x9162('0xf'),auth['isAuthenticated'](),controller[_0x9162('0x10')]);router[_0x9162('0xe')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller[_0x9162('0x11')]);router[_0x9162('0x12')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0x13')]);router[_0x9162('0x14')](_0x9162('0xa'),auth['isAuthenticated'](),controller[_0x9162('0x15')]);module[_0x9162('0x16')]=router; \ No newline at end of file +var _0xb258=['show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id'];(function(_0x1318e9,_0x105432){var _0x2dba6f=function(_0x2cab0c){while(--_0x2cab0c){_0x1318e9['push'](_0x1318e9['shift']());}};_0x2dba6f(++_0x105432);}(_0xb258,0x12b));var _0x8b25=function(_0x5eca8f,_0x257ec3){_0x5eca8f=_0x5eca8f-0x0;var _0x1317ee=_0xb258[_0x5eca8f];return _0x1317ee;};'use strict';var multer=require(_0x8b25('0x0'));var util=require('util');var path=require(_0x8b25('0x1'));var timeout=require(_0x8b25('0x2'));var express=require('express');var router=express[_0x8b25('0x3')]();var fs_extra=require(_0x8b25('0x4'));var auth=require(_0x8b25('0x5'));var interaction=require(_0x8b25('0x6'));var config=require(_0x8b25('0x7'));var controller=require(_0x8b25('0x8'));router['get']('/',auth[_0x8b25('0x9')](),controller[_0x8b25('0xa')]);router[_0x8b25('0xb')](_0x8b25('0xc'),auth['isAuthenticated'](),controller[_0x8b25('0xd')]);router[_0x8b25('0xb')]('/:id/conditions',auth[_0x8b25('0x9')](),controller[_0x8b25('0xe')]);router[_0x8b25('0xb')](_0x8b25('0xf'),auth['isAuthenticated'](),controller[_0x8b25('0x10')]);router[_0x8b25('0x11')]('/',auth[_0x8b25('0x9')](),controller[_0x8b25('0x12')]);router['post'](_0x8b25('0x13'),auth[_0x8b25('0x9')](),controller[_0x8b25('0x14')]);router['post'](_0x8b25('0xf'),auth[_0x8b25('0x9')](),controller[_0x8b25('0x15')]);router[_0x8b25('0x16')]('/:id',auth[_0x8b25('0x9')](),controller['update']);router[_0x8b25('0x17')](_0x8b25('0xc'),auth[_0x8b25('0x9')](),controller[_0x8b25('0x18')]);module[_0x8b25('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 9e6c667..0865099 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 _0xc8be=['onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\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\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never'];(function(_0x50f373,_0x227a59){var _0x184a45=function(_0x5dcd6d){while(--_0x5dcd6d){_0x50f373['push'](_0x50f373['shift']());}};_0x184a45(++_0x227a59);}(_0xc8be,0x66));var _0xec8b=function(_0x50b0f3,_0x5930af){_0x50b0f3=_0x50b0f3-0x0;var _0x1c4efb=_0xc8be[_0x50b0f3];return _0x1c4efb;};'use strict';var Sequelize=require(_0xec8b('0x0'));module['exports']={'name':{'type':Sequelize[_0xec8b('0x1')],'unique':_0xec8b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xec8b('0x3')](_0xec8b('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xec8b('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xec8b('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xec8b('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xec8b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xec8b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xec8b('0x9')](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'comment':_0xec8b('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xec8b('0xf')},'dialTimezone':{'type':Sequelize[_0xec8b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xec8b('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xec8b('0x3')]('always',_0xec8b('0x11'),_0xec8b('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xec8b('0x13')],'defaultValue':0x0,'comment':_0xec8b('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xec8b('0x9')](0x9)[_0xec8b('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xec8b('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xec8b('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xec8b('0x9')](0x9)[_0xec8b('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xec8b('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xec8b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xec8b('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xec8b('0x9')](0x9)[_0xec8b('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xec8b('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xec8b('0x9')](0x9)[_0xec8b('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xec8b('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xec8b('0x9')](0x9)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xec8b('0x9')](0x5)[_0xec8b('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xec8b('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xec8b('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xec8b('0x3')](_0xec8b('0x1c'),_0xec8b('0x1d')),'defaultValue':_0xec8b('0x1c')},'dialPrefix':{'type':Sequelize[_0xec8b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xec8b('0x9')](0x3)[_0xec8b('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xec8b('0x1e')},'dialCutDigit':{'type':Sequelize[_0xec8b('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xec8b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xec8b('0x9')](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xec8b('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xec8b('0x9')](0x3)[_0xec8b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec8b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xec8b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec8b('0x27')}}; \ No newline at end of file +var _0xbfaa=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING'];(function(_0x3db840,_0x40115e){var _0x416a4c=function(_0x122fc1){while(--_0x122fc1){_0x3db840['push'](_0x3db840['shift']());}};_0x416a4c(++_0x40115e);}(_0xbfaa,0x159));var _0xabfa=function(_0x14334d,_0x485a2d){_0x14334d=_0x14334d-0x0;var _0x259cf3=_0xbfaa[_0x14334d];return _0x259cf3;};'use strict';var Sequelize=require(_0xabfa('0x0'));module[_0xabfa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xabfa('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xabfa('0x3')](_0xabfa('0x4')),'allowNull':![],'defaultValue':_0xabfa('0x4')},'description':{'type':Sequelize[_0xabfa('0x5')]},'active':{'type':Sequelize[_0xabfa('0x6')],'defaultValue':0x0,'comment':_0xabfa('0x7')},'limitCalls':{'type':Sequelize[_0xabfa('0x8')](0x4)[_0xabfa('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xabfa('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xabfa('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabfa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xabfa('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabfa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xabfa('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xabfa('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xabfa('0x3')](_0xabfa('0x10'),_0xabfa('0x11'),_0xabfa('0x12')),'defaultValue':_0xabfa('0x10')},'dialAMDActive':{'type':Sequelize[_0xabfa('0x6')],'defaultValue':0x0,'comment':_0xabfa('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xabfa('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xabfa('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xabfa('0x8')](0x9)[_0xabfa('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xabfa('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xabfa('0x8')](0x9)[_0xabfa('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xabfa('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabfa('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xabfa('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xabfa('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xabfa('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xabfa('0x8')](0x5)[_0xabfa('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xabfa('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xabfa('0x8')](0x9)[_0xabfa('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabfa('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xabfa('0x3')](_0xabfa('0x1c'),'ASC'),'defaultValue':_0xabfa('0x1c')},'dialPrefix':{'type':Sequelize[_0xabfa('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabfa('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xabfa('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabfa('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xabfa('0x8')](0x5)[_0xabfa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xabfa('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xabfa('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xabfa('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xabfa('0x8')](0x3)[_0xabfa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabfa('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabfa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabfa('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 70424d4..39df408 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 _0x9d38=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','clone','createdAt','omit','updatedAt','UserProfileSection','userProfileId','error','getHoppers','CmHopper','CampaignId','filter','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','toString','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','scheduledAt','CmListId','cm_contacts','all','removeLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','zip-dir','request-promise','moment','bluebird','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','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','update','then','destroy','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body'];(function(_0x10c58f,_0xe73c82){var _0xf943e=function(_0x2cfef4){while(--_0x2cfef4){_0x10c58f['push'](_0x10c58f['shift']());}};_0xf943e(++_0xe73c82);}(_0x9d38,0x144));var _0x89d3=function(_0x1a6871,_0x5174a7){_0x1a6871=_0x1a6871-0x0;var _0x5a4015=_0x9d38[_0x1a6871];return _0x5a4015;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x89d3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89d3('0x1'));var moment=require(_0x89d3('0x2'));var BPromise=require(_0x89d3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89d3('0x4'));var sox=require(_0x89d3('0x5'));var csv=require(_0x89d3('0x6'));var ejs=require(_0x89d3('0x7'));var fs=require('fs');var fs_extra=require(_0x89d3('0x8'));var _=require(_0x89d3('0x9'));var squel=require(_0x89d3('0xa'));var crypto=require('crypto');var jsforce=require(_0x89d3('0xb'));var deskjs=require(_0x89d3('0xc'));var toCsv=require(_0x89d3('0x6'));var querystring=require(_0x89d3('0xd'));var Papa=require(_0x89d3('0xe'));var Redis=require(_0x89d3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x89d3('0x10'));var as=require(_0x89d3('0x11'));var hardwareService=require(_0x89d3('0x12'));var logger=require(_0x89d3('0x13'))(_0x89d3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x89d3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5818f2,_0x4cbe53){_0x4cbe53=_0x4cbe53||0xcc;return function(_0x5e1ebf){if(_0x5e1ebf){return _0x5818f2[_0x89d3('0x16')](_0x4cbe53);}return _0x5818f2['status'](_0x4cbe53)[_0x89d3('0x17')]();};}function respondWithResult(_0x4fe95d,_0x33eff4){_0x33eff4=_0x33eff4||0xc8;return function(_0x1539f3){if(_0x1539f3){return _0x4fe95d[_0x89d3('0x18')](_0x33eff4)[_0x89d3('0x19')](_0x1539f3);}};}function respondWithFilteredResult(_0x3b02f6,_0x20f15a){return function(_0x408abc){if(_0x408abc){var _0x343644=typeof _0x20f15a['offset']===_0x89d3('0x1a')&&typeof _0x20f15a[_0x89d3('0x1b')]===_0x89d3('0x1a');var _0x2a82a7=_0x408abc['count'];var _0x1e40bc=_0x343644?0x0:_0x20f15a[_0x89d3('0x1c')];var _0x4fd790=_0x343644?_0x408abc[_0x89d3('0x1d')]:_0x20f15a[_0x89d3('0x1c')]+_0x20f15a['limit'];var _0x94a24;if(_0x4fd790>=_0x2a82a7){_0x4fd790=_0x2a82a7;_0x94a24=0xc8;}else{_0x94a24=0xce;}_0x3b02f6[_0x89d3('0x18')](_0x94a24);return _0x3b02f6[_0x89d3('0x1e')]('Content-Range',_0x1e40bc+'-'+_0x4fd790+'/'+_0x2a82a7)[_0x89d3('0x19')](_0x408abc);}return null;};}function patchUpdates(_0xe9ad3f){return function(_0x40740f){try{jsonpatch[_0x89d3('0x1f')](_0x40740f,_0xe9ad3f,!![]);}catch(_0x207724){return BPromise[_0x89d3('0x20')](_0x207724);}return _0x40740f['save']();};}function saveUpdates(_0x20e2d7,_0x114757){return function(_0x4aa8be){if(_0x4aa8be){return _0x4aa8be[_0x89d3('0x21')](_0x20e2d7)[_0x89d3('0x22')](function(_0x5d2421){return _0x5d2421;});}return null;};}function removeEntity(_0x5ecbfb,_0x40772b){return function(_0x4bdf6a){if(_0x4bdf6a){return _0x4bdf6a[_0x89d3('0x23')]()[_0x89d3('0x22')](function(){var _0x3786c5=_0x4bdf6a['get']({'plain':!![]});var _0x36e7a0=_0x89d3('0x24');return db[_0x89d3('0x25')]['destroy']({'where':{'type':_0x36e7a0,'resourceId':_0x3786c5['id']}})[_0x89d3('0x22')](function(){return _0x4bdf6a;});})[_0x89d3('0x22')](function(){_0x5ecbfb['status'](0xcc)[_0x89d3('0x17')]();});}};}function handleEntityNotFound(_0x53cb10,_0x33d3cd){return function(_0xcfd06f){if(!_0xcfd06f){_0x53cb10[_0x89d3('0x16')](0x194);}return _0xcfd06f;};}function handleError(_0x4b2249,_0x2994ea){_0x2994ea=_0x2994ea||0x1f4;return function(_0x3dacb9){logger['error'](_0x3dacb9[_0x89d3('0x26')]);if(_0x3dacb9[_0x89d3('0x27')]){delete _0x3dacb9[_0x89d3('0x27')];}_0x4b2249['status'](_0x2994ea)[_0x89d3('0x28')](_0x3dacb9);};}exports[_0x89d3('0x29')]=function(_0x3ec682,_0x1de013){var _0x5342d5={},_0x27e699={},_0x1e069d={'count':0x0,'rows':[]};var _0x1e9bf4=_[_0x89d3('0x2a')](db[_0x89d3('0x2b')][_0x89d3('0x2c')],function(_0x2dd00a){return{'name':_0x2dd00a[_0x89d3('0x2d')],'type':_0x2dd00a[_0x89d3('0x2e')][_0x89d3('0x2f')]};});_0x27e699[_0x89d3('0x30')]=_['map'](_0x1e9bf4,_0x89d3('0x27'));_0x27e699[_0x89d3('0x31')]=_['keys'](_0x3ec682[_0x89d3('0x31')]);_0x27e699[_0x89d3('0x32')]=_[_0x89d3('0x33')](_0x27e699[_0x89d3('0x30')],_0x27e699[_0x89d3('0x31')]);_0x5342d5[_0x89d3('0x34')]=_[_0x89d3('0x33')](_0x27e699[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x3ec682[_0x89d3('0x31')][_0x89d3('0x35')]));_0x5342d5[_0x89d3('0x34')]=_0x5342d5['attributes'][_0x89d3('0x36')]?_0x5342d5[_0x89d3('0x34')]:_0x27e699[_0x89d3('0x30')];if(!_0x3ec682[_0x89d3('0x31')][_0x89d3('0x37')](_0x89d3('0x38'))){_0x5342d5[_0x89d3('0x1b')]=qs[_0x89d3('0x1b')](_0x3ec682[_0x89d3('0x31')][_0x89d3('0x1b')]);_0x5342d5[_0x89d3('0x1c')]=qs['offset'](_0x3ec682[_0x89d3('0x31')]['offset']);}_0x5342d5[_0x89d3('0x39')]=qs[_0x89d3('0x3a')](_0x3ec682[_0x89d3('0x31')][_0x89d3('0x3a')]);_0x5342d5[_0x89d3('0x3b')]=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x3ec682['query'],_0x27e699['filters']),_0x1e9bf4);if(_0x3ec682[_0x89d3('0x31')]['filter']){_0x5342d5[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x5342d5['where'],{'$or':_[_0x89d3('0x2a')](_0x1e9bf4,function(_0x2bee9c){if(_0x2bee9c['type']!==_0x89d3('0x3e')){var _0x2cd625={};_0x2cd625[_0x2bee9c[_0x89d3('0x27')]]={'$like':'%'+_0x3ec682[_0x89d3('0x31')]['filter']+'%'};return _0x2cd625;}})});}_0x5342d5=_[_0x89d3('0x3d')]({},_0x5342d5,_0x3ec682[_0x89d3('0x3f')]);var _0x38a685={'where':_0x5342d5[_0x89d3('0x3b')]};return db[_0x89d3('0x2b')][_0x89d3('0x1d')](_0x38a685)[_0x89d3('0x22')](function(_0x4d8c1c){_0x1e069d[_0x89d3('0x1d')]=_0x4d8c1c;if(_0x3ec682['query'][_0x89d3('0x40')]){_0x5342d5['include']=[{'all':!![]}];}return db[_0x89d3('0x2b')][_0x89d3('0x41')](_0x5342d5);})['then'](function(_0x51f74){_0x1e069d[_0x89d3('0x42')]=_0x51f74;return _0x1e069d;})['then'](respondWithFilteredResult(_0x1de013,_0x5342d5))[_0x89d3('0x43')](handleError(_0x1de013,null));};exports[_0x89d3('0x44')]=function(_0x52c4d6,_0x438aa6){var _0x453006={'raw':![],'where':{'id':_0x52c4d6[_0x89d3('0x45')]['id']}},_0x2cbb0c={};_0x2cbb0c[_0x89d3('0x30')]=_[_0x89d3('0x46')](db[_0x89d3('0x2b')][_0x89d3('0x2c')]);_0x2cbb0c[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x52c4d6['query']);_0x2cbb0c['filters']=_['intersection'](_0x2cbb0c['model'],_0x2cbb0c[_0x89d3('0x31')]);_0x453006[_0x89d3('0x34')]=_['intersection'](_0x2cbb0c[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x52c4d6[_0x89d3('0x31')][_0x89d3('0x35')]));_0x453006[_0x89d3('0x34')]=_0x453006[_0x89d3('0x34')][_0x89d3('0x36')]?_0x453006[_0x89d3('0x34')]:_0x2cbb0c['model'];if(_0x52c4d6['query']['includeAll']){_0x453006[_0x89d3('0x47')]=[{'all':!![]}];}_0x453006=_['merge']({},_0x453006,_0x52c4d6[_0x89d3('0x3f')]);return db['Campaign'][_0x89d3('0x48')](_0x453006)['then'](handleEntityNotFound(_0x438aa6,null))[_0x89d3('0x22')](respondWithResult(_0x438aa6,null))['catch'](handleError(_0x438aa6,null));};exports[_0x89d3('0x49')]=function(_0x324530,_0x3704c5){return db['Campaign'][_0x89d3('0x49')](_0x324530[_0x89d3('0x4a')],{})['then'](function(_0x2f2ace){var _0x411beb=_0x324530[_0x89d3('0x4b')][_0x89d3('0x4c')]({'plain':!![]});if(!_0x411beb)throw new Error(_0x89d3('0x4d'));if(_0x411beb[_0x89d3('0x4e')]==='user'){var _0x4d77f9=_0x2f2ace[_0x89d3('0x4c')]({'plain':!![]});var _0x276eeb=_0x89d3('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x276eeb,'userProfileId':_0x411beb['userProfileId']},'raw':!![]})[_0x89d3('0x22')](function(_0x29ebbe){if(_0x29ebbe&&_0x29ebbe[_0x89d3('0x4f')]===0x0){return db['UserProfileResource'][_0x89d3('0x49')]({'name':_0x4d77f9[_0x89d3('0x27')],'resourceId':_0x4d77f9['id'],'type':_0x29ebbe[_0x89d3('0x27')],'sectionId':_0x29ebbe['id']},{})[_0x89d3('0x22')](function(){return _0x2f2ace;});}else{return _0x2f2ace;}})[_0x89d3('0x43')](function(_0x39bf15){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39bf15);throw _0x39bf15;});}return _0x2f2ace;})[_0x89d3('0x22')](respondWithResult(_0x3704c5,0xc9))['catch'](handleError(_0x3704c5,null));};exports[_0x89d3('0x50')]=function(_0x140b74,_0x32bd7e){var _0x239af0={'where':{'id':_0x140b74[_0x89d3('0x45')]['id']}},_0x2b01e2={};_0x2b01e2[_0x89d3('0x30')]=_['keys'](db[_0x89d3('0x2b')][_0x89d3('0x2c')]);_0x239af0['attributes']=_['intersection'](_0x2b01e2[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x140b74['query'][_0x89d3('0x35')]));_0x239af0[_0x89d3('0x34')]=_0x239af0[_0x89d3('0x34')][_0x89d3('0x36')]?_0x239af0[_0x89d3('0x34')]:_0x2b01e2[_0x89d3('0x30')];if(_0x140b74[_0x89d3('0x31')][_0x89d3('0x40')]){_0x239af0[_0x89d3('0x47')]=[{'all':!![]}];}_0x239af0=_[_0x89d3('0x3d')]({},_0x239af0,_0x140b74[_0x89d3('0x3f')]);return db[_0x89d3('0x2b')][_0x89d3('0x48')](_0x239af0)[_0x89d3('0x22')](handleEntityNotFound(_0x32bd7e,null))[_0x89d3('0x22')](function(_0x4f78e6){if(_0x4f78e6){var _0x466a72=_0x4f78e6[_0x89d3('0x4c')]({'plain':!![]});_0x466a72=qs['omit'](_0x466a72,['id',_0x89d3('0x51'),'updatedAt']);_0x140b74[_0x89d3('0x4a')]=_[_0x89d3('0x52')](_0x140b74[_0x89d3('0x4a')],['id','createdAt',_0x89d3('0x53')]);return db[_0x89d3('0x2b')][_0x89d3('0x49')](_[_0x89d3('0x3d')](_0x466a72,_0x140b74[_0x89d3('0x4a')]),{'include':_0x140b74['query'][_0x89d3('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x3f5c81){var _0x23fa8e=_0x140b74[_0x89d3('0x4b')]['get']({'plain':!![]});if(!_0x23fa8e)throw new Error(_0x89d3('0x4d'));if(_0x23fa8e[_0x89d3('0x4e')]===_0x89d3('0x4b')){var _0x4de69c=_0x3f5c81[_0x89d3('0x4c')]({'plain':!![]});var _0x2dbf65='IvrCampaigns';return db[_0x89d3('0x54')][_0x89d3('0x48')]({'where':{'name':_0x2dbf65,'userProfileId':_0x23fa8e[_0x89d3('0x55')]},'raw':!![]})[_0x89d3('0x22')](function(_0x4d661e){if(_0x4d661e&&_0x4d661e[_0x89d3('0x4f')]===0x0){return db['UserProfileResource'][_0x89d3('0x49')]({'name':_0x4de69c[_0x89d3('0x27')],'resourceId':_0x4de69c['id'],'type':_0x4d661e[_0x89d3('0x27')],'sectionId':_0x4d661e['id']},{})[_0x89d3('0x22')](function(){return _0x3f5c81;});}else{return _0x3f5c81;}})[_0x89d3('0x43')](function(_0x101a3e){logger[_0x89d3('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x101a3e);throw _0x101a3e;});}return _0x3f5c81;});}})[_0x89d3('0x22')](respondWithResult(_0x32bd7e,0xc9))[_0x89d3('0x43')](handleError(_0x32bd7e,null));};exports[_0x89d3('0x21')]=function(_0xb8dd5e,_0x599442){if(_0xb8dd5e[_0x89d3('0x4a')]['id']){delete _0xb8dd5e[_0x89d3('0x4a')]['id'];}return db['Campaign'][_0x89d3('0x48')]({'where':{'id':_0xb8dd5e[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x599442,null))[_0x89d3('0x22')](saveUpdates(_0xb8dd5e[_0x89d3('0x4a')],null))[_0x89d3('0x22')](respondWithResult(_0x599442,null))[_0x89d3('0x43')](handleError(_0x599442,null));};exports[_0x89d3('0x23')]=function(_0x3827bd,_0x604573){return db['Campaign']['find']({'where':{'id':_0x3827bd[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x604573,null))[_0x89d3('0x22')](removeEntity(_0x604573,null))[_0x89d3('0x43')](handleError(_0x604573,null));};exports[_0x89d3('0x57')]=function(_0x476831,_0x2efd58,_0x16fc4e){var _0x10a5b8={'raw':!![],'where':{}};var _0x34a2b9={};var _0x1eff80={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x476831[_0x89d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2efd58,null))[_0x89d3('0x22')](function(_0x3ba5a5){if(_0x3ba5a5){_0x34a2b9[_0x89d3('0x30')]=_[_0x89d3('0x46')](db[_0x89d3('0x58')][_0x89d3('0x2c')]);_0x34a2b9[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x476831['query']);_0x34a2b9[_0x89d3('0x32')]=_[_0x89d3('0x33')](_0x34a2b9[_0x89d3('0x30')],_0x34a2b9[_0x89d3('0x31')]);_0x10a5b8[_0x89d3('0x34')]=_['intersection'](_0x34a2b9[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x476831[_0x89d3('0x31')][_0x89d3('0x35')]));_0x10a5b8['attributes']=_0x10a5b8['attributes']['length']?_0x10a5b8[_0x89d3('0x34')]:_0x34a2b9[_0x89d3('0x30')];if(!_0x476831[_0x89d3('0x31')]['hasOwnProperty']('nolimit')){_0x10a5b8[_0x89d3('0x1b')]=qs[_0x89d3('0x1b')](_0x476831[_0x89d3('0x31')][_0x89d3('0x1b')]);_0x10a5b8[_0x89d3('0x1c')]=qs[_0x89d3('0x1c')](_0x476831[_0x89d3('0x31')][_0x89d3('0x1c')]);}_0x10a5b8['order']=qs[_0x89d3('0x3a')](_0x476831['query'][_0x89d3('0x3a')]);_0x10a5b8[_0x89d3('0x3b')]=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x476831[_0x89d3('0x31')],_0x34a2b9[_0x89d3('0x32')]));_0x10a5b8['where'][_0x89d3('0x59')]=_0x3ba5a5['id'];if(_0x476831[_0x89d3('0x31')]['filter']){_0x10a5b8[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x10a5b8[_0x89d3('0x3b')],{'$or':_[_0x89d3('0x2a')](_0x10a5b8[_0x89d3('0x34')],function(_0x84d979){var _0x54299f={};_0x54299f[_0x84d979]={'$like':'%'+_0x476831['query'][_0x89d3('0x5a')]+'%'};return _0x54299f;})});}_0x10a5b8=_[_0x89d3('0x3d')]({},_0x10a5b8,_0x476831[_0x89d3('0x3f')]);return db[_0x89d3('0x58')][_0x89d3('0x1d')]({'where':_0x10a5b8[_0x89d3('0x3b')]})[_0x89d3('0x22')](function(_0x52049c){_0x1eff80[_0x89d3('0x1d')]=_0x52049c;if(_0x476831[_0x89d3('0x31')]['includeAll']){_0x10a5b8['include']=[{'all':!![]}];}return db[_0x89d3('0x58')][_0x89d3('0x41')](_0x10a5b8);})[_0x89d3('0x22')](function(_0x30fdc6){_0x1eff80['rows']=_0x30fdc6;return _0x1eff80;});}})['then'](respondWithFilteredResult(_0x2efd58,_0x10a5b8))['catch'](handleError(_0x2efd58,null));};exports['getHopperHistories']=function(_0x1ca5f6,_0x36af86,_0x448624){var _0x38bec4={'raw':!![],'where':{}};var _0x3dc757={};var _0x4076a0={'count':0x0,'rows':[]};return db[_0x89d3('0x2b')][_0x89d3('0x5b')]({'where':{'id':_0x1ca5f6[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x36af86,null))[_0x89d3('0x22')](function(_0x1a4a51){if(_0x1a4a51){_0x3dc757[_0x89d3('0x30')]=_[_0x89d3('0x46')](db[_0x89d3('0x5c')][_0x89d3('0x2c')]);_0x3dc757[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x1ca5f6[_0x89d3('0x31')]);_0x3dc757[_0x89d3('0x32')]=_[_0x89d3('0x33')](_0x3dc757[_0x89d3('0x30')],_0x3dc757[_0x89d3('0x31')]);_0x38bec4[_0x89d3('0x34')]=_['intersection'](_0x3dc757[_0x89d3('0x30')],qs['fields'](_0x1ca5f6['query'][_0x89d3('0x35')]));_0x38bec4[_0x89d3('0x34')]=_0x38bec4['attributes'][_0x89d3('0x36')]?_0x38bec4['attributes']:_0x3dc757['model'];if(!_0x1ca5f6[_0x89d3('0x31')][_0x89d3('0x37')](_0x89d3('0x38'))){_0x38bec4[_0x89d3('0x1b')]=qs[_0x89d3('0x1b')](_0x1ca5f6['query']['limit']);_0x38bec4[_0x89d3('0x1c')]=qs[_0x89d3('0x1c')](_0x1ca5f6[_0x89d3('0x31')][_0x89d3('0x1c')]);}_0x38bec4['order']=qs['sort'](_0x1ca5f6[_0x89d3('0x31')][_0x89d3('0x3a')]);_0x38bec4['where']=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x1ca5f6[_0x89d3('0x31')],_0x3dc757[_0x89d3('0x32')]));_0x38bec4['where'][_0x89d3('0x59')]=_0x1a4a51['id'];if(_0x1ca5f6['query'][_0x89d3('0x5a')]){_0x38bec4[_0x89d3('0x3b')]=_['merge'](_0x38bec4['where'],{'$or':_[_0x89d3('0x2a')](_0x38bec4[_0x89d3('0x34')],function(_0x2437cb){var _0x30caa5={};_0x30caa5[_0x2437cb]={'$like':'%'+_0x1ca5f6[_0x89d3('0x31')][_0x89d3('0x5a')]+'%'};return _0x30caa5;})});}_0x38bec4=_[_0x89d3('0x3d')]({},_0x38bec4,_0x1ca5f6['options']);return db[_0x89d3('0x5c')][_0x89d3('0x1d')]({'where':_0x38bec4[_0x89d3('0x3b')]})['then'](function(_0x1998ac){_0x4076a0[_0x89d3('0x1d')]=_0x1998ac;if(_0x1ca5f6[_0x89d3('0x31')]['includeAll']){_0x38bec4[_0x89d3('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x89d3('0x41')](_0x38bec4);})['then'](function(_0xd4886){_0x4076a0['rows']=_0xd4886;return _0x4076a0;});}})[_0x89d3('0x22')](respondWithFilteredResult(_0x36af86,_0x38bec4))[_0x89d3('0x43')](handleError(_0x36af86,null));};exports[_0x89d3('0x5d')]=function(_0x33b2b6,_0x32b786,_0xf099e1){var _0x326044={'raw':!![],'where':{}};var _0x330f25={};var _0x53ace4={'count':0x0,'rows':[]};return db['Campaign'][_0x89d3('0x5b')]({'where':{'id':_0x33b2b6[_0x89d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x32b786,null))[_0x89d3('0x22')](function(_0x33a66e){if(_0x33a66e){_0x330f25[_0x89d3('0x30')]=_['keys'](db['CmHopperFinal'][_0x89d3('0x2c')]);_0x330f25[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x33b2b6[_0x89d3('0x31')]);_0x330f25[_0x89d3('0x32')]=_['intersection'](_0x330f25['model'],_0x330f25['query']);_0x326044[_0x89d3('0x34')]=_[_0x89d3('0x33')](_0x330f25[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x33b2b6[_0x89d3('0x31')][_0x89d3('0x35')]));_0x326044[_0x89d3('0x34')]=_0x326044['attributes'][_0x89d3('0x36')]?_0x326044['attributes']:_0x330f25['model'];if(!_0x33b2b6[_0x89d3('0x31')][_0x89d3('0x37')]('nolimit')){_0x326044['limit']=qs[_0x89d3('0x1b')](_0x33b2b6['query'][_0x89d3('0x1b')]);_0x326044[_0x89d3('0x1c')]=qs['offset'](_0x33b2b6[_0x89d3('0x31')]['offset']);}_0x326044[_0x89d3('0x39')]=qs[_0x89d3('0x3a')](_0x33b2b6[_0x89d3('0x31')]['sort']);_0x326044[_0x89d3('0x3b')]=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x33b2b6[_0x89d3('0x31')],_0x330f25[_0x89d3('0x32')]));_0x326044[_0x89d3('0x3b')][_0x89d3('0x59')]=_0x33a66e['id'];if(_0x33b2b6[_0x89d3('0x31')][_0x89d3('0x5a')]){_0x326044[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x326044['where'],{'$or':_[_0x89d3('0x2a')](_0x326044[_0x89d3('0x34')],function(_0x3b50a){var _0x4c6abd={};_0x4c6abd[_0x3b50a]={'$like':'%'+_0x33b2b6[_0x89d3('0x31')][_0x89d3('0x5a')]+'%'};return _0x4c6abd;})});}_0x326044=_[_0x89d3('0x3d')]({},_0x326044,_0x33b2b6['options']);return db[_0x89d3('0x5e')]['count']({'where':_0x326044[_0x89d3('0x3b')]})[_0x89d3('0x22')](function(_0x86f929){_0x53ace4[_0x89d3('0x1d')]=_0x86f929;if(_0x33b2b6[_0x89d3('0x31')][_0x89d3('0x40')]){_0x326044[_0x89d3('0x47')]=[{'all':!![]}];}return db[_0x89d3('0x5e')][_0x89d3('0x41')](_0x326044);})[_0x89d3('0x22')](function(_0x41106b){_0x53ace4[_0x89d3('0x42')]=_0x41106b;return _0x53ace4;});}})[_0x89d3('0x22')](respondWithFilteredResult(_0x32b786,_0x326044))[_0x89d3('0x43')](handleError(_0x32b786,null));};exports[_0x89d3('0x5f')]=function(_0xe212f2,_0x3b9475,_0x444c02){var _0x424643={'raw':!![],'where':{}};var _0x8f4794={};var _0x252688={'count':0x0,'rows':[]};return db[_0x89d3('0x2b')][_0x89d3('0x5b')]({'where':{'id':_0xe212f2[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x3b9475,null))[_0x89d3('0x22')](function(_0x466fae){if(_0x466fae){_0x8f4794[_0x89d3('0x30')]=_['keys'](db[_0x89d3('0x60')]['rawAttributes']);_0x8f4794[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0xe212f2['query']);_0x8f4794['filters']=_[_0x89d3('0x33')](_0x8f4794[_0x89d3('0x30')],_0x8f4794[_0x89d3('0x31')]);_0x424643[_0x89d3('0x34')]=_[_0x89d3('0x33')](_0x8f4794[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0xe212f2[_0x89d3('0x31')][_0x89d3('0x35')]));_0x424643[_0x89d3('0x34')]=_0x424643[_0x89d3('0x34')][_0x89d3('0x36')]?_0x424643['attributes']:_0x8f4794['model'];if(!_0xe212f2['query'][_0x89d3('0x37')](_0x89d3('0x38'))){_0x424643[_0x89d3('0x1b')]=qs[_0x89d3('0x1b')](_0xe212f2[_0x89d3('0x31')][_0x89d3('0x1b')]);_0x424643['offset']=qs['offset'](_0xe212f2['query'][_0x89d3('0x1c')]);}_0x424643[_0x89d3('0x39')]=qs[_0x89d3('0x3a')](_0xe212f2[_0x89d3('0x31')][_0x89d3('0x3a')]);_0x424643[_0x89d3('0x3b')]=qs[_0x89d3('0x32')](_['pick'](_0xe212f2[_0x89d3('0x31')],_0x8f4794[_0x89d3('0x32')]));_0x424643[_0x89d3('0x3b')][_0x89d3('0x59')]=_0x466fae['id'];if(_0xe212f2[_0x89d3('0x31')][_0x89d3('0x5a')]){_0x424643[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x424643['where'],{'$or':_[_0x89d3('0x2a')](_0x424643[_0x89d3('0x34')],function(_0xe39b5e){var _0x523473={};_0x523473[_0xe39b5e]={'$like':'%'+_0xe212f2[_0x89d3('0x31')]['filter']+'%'};return _0x523473;})});}_0x424643=_['merge']({},_0x424643,_0xe212f2[_0x89d3('0x3f')]);return db['CmHopperBlack'][_0x89d3('0x1d')]({'where':_0x424643[_0x89d3('0x3b')]})[_0x89d3('0x22')](function(_0x57061b){_0x252688[_0x89d3('0x1d')]=_0x57061b;if(_0xe212f2[_0x89d3('0x31')][_0x89d3('0x40')]){_0x424643[_0x89d3('0x47')]=[{'all':!![]}];}return db[_0x89d3('0x60')][_0x89d3('0x41')](_0x424643);})[_0x89d3('0x22')](function(_0x1c5fd3){_0x252688[_0x89d3('0x42')]=_0x1c5fd3;return _0x252688;});}})['then'](respondWithFilteredResult(_0x3b9475,_0x424643))['catch'](handleError(_0x3b9475,null));};exports['getLists']=function(_0x4a1143,_0x343c4e,_0x471bd7){var _0x44051c={};var _0x384d89={};var _0x5631c2;var _0x3ab9c6;return db[_0x89d3('0x2b')]['findOne']({'where':{'id':_0x4a1143[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x343c4e,null))[_0x89d3('0x22')](function(_0x30f2a5){if(_0x30f2a5){_0x5631c2=_0x30f2a5;_0x384d89[_0x89d3('0x30')]=_[_0x89d3('0x46')](db[_0x89d3('0x61')][_0x89d3('0x2c')]);_0x384d89[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x4a1143['query']);_0x384d89[_0x89d3('0x32')]=_[_0x89d3('0x33')](_0x384d89['model'],_0x384d89[_0x89d3('0x31')]);_0x44051c['attributes']=_[_0x89d3('0x33')](_0x384d89[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x4a1143[_0x89d3('0x31')][_0x89d3('0x35')]));_0x44051c['attributes']=_0x44051c[_0x89d3('0x34')]['length']?_0x44051c[_0x89d3('0x34')]:_0x384d89[_0x89d3('0x30')];_0x44051c[_0x89d3('0x39')]=qs[_0x89d3('0x3a')](_0x4a1143[_0x89d3('0x31')][_0x89d3('0x3a')]);_0x44051c[_0x89d3('0x3b')]=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x4a1143[_0x89d3('0x31')],_0x384d89[_0x89d3('0x32')]));if(_0x4a1143['query'][_0x89d3('0x5a')]){_0x44051c[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x44051c[_0x89d3('0x3b')],{'$or':_[_0x89d3('0x2a')](_0x44051c[_0x89d3('0x34')],function(_0x9a09f8){var _0x11a231={};_0x11a231[_0x9a09f8]={'$like':'%'+_0x4a1143['query'][_0x89d3('0x5a')]+'%'};return _0x11a231;})});}_0x44051c=_[_0x89d3('0x3d')]({},_0x44051c,_0x4a1143[_0x89d3('0x3f')]);return _0x5631c2[_0x89d3('0x62')](_0x44051c);}})['then'](function(_0x4da13d){if(_0x4da13d){_0x3ab9c6=_0x4da13d['length'];if(!_0x4a1143[_0x89d3('0x31')][_0x89d3('0x37')]('nolimit')){_0x44051c[_0x89d3('0x1b')]=qs['limit'](_0x4a1143[_0x89d3('0x31')][_0x89d3('0x1b')]);_0x44051c[_0x89d3('0x1c')]=qs[_0x89d3('0x1c')](_0x4a1143[_0x89d3('0x31')][_0x89d3('0x1c')]);}return _0x5631c2[_0x89d3('0x62')](_0x44051c);}})['then'](function(_0x290aeb){if(_0x290aeb){return _0x290aeb?{'count':_0x3ab9c6,'rows':_0x290aeb}:null;}})[_0x89d3('0x22')](respondWithResult(_0x343c4e,null))['catch'](handleError(_0x343c4e,null));};exports[_0x89d3('0x63')]=function(_0x17480e,_0x275b85,_0x2446be){var _0x20e71e,_0x1926ff;return db['Campaign']['find']({'where':{'id':_0x17480e[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x275b85,null))[_0x89d3('0x22')](function(_0x47375f){if(_0x47375f){_0x1926ff=_0x47375f;return _0x47375f[_0x89d3('0x63')](_0x17480e[_0x89d3('0x4a')][_0x89d3('0x64')],_['omit'](_0x17480e[_0x89d3('0x4a')],[_0x89d3('0x64'),'id'])||{});}return null;})[_0x89d3('0x65')](function(_0x5cd0b5){var _0x2098c9;_0x20e71e=_0x5cd0b5||[];var _0x112ae1=[];if(_0x5cd0b5){for(var _0x54d660=0x0;_0x54d660<_0x5cd0b5[_0x89d3('0x36')];_0x54d660+=0x1){var _0x1d2792=_0x5cd0b5[_0x54d660][_0x89d3('0x4c')]({'plain':!![]});_0x1926ff[_0x89d3('0x66')]=_0x17480e[_0x89d3('0x4a')][_0x89d3('0x66')]?_0x17480e[_0x89d3('0x4a')]['dialCheckDuplicateType']:_0x1926ff[_0x89d3('0x66')];switch(_0x1926ff[_0x89d3('0x66')]){case _0x89d3('0x67'):_0x2098c9=squel[_0x89d3('0x68')]()[_0x89d3('0x69')](_0x89d3('0x6a'))[_0x89d3('0x6b')]([_0x89d3('0x6c'),'scheduledAt',_0x89d3('0x6d'),'ListId','CampaignId','createdAt',_0x89d3('0x53')],squel[_0x89d3('0x6e')]()[_0x89d3('0x6f')](_0x89d3('0x6c'),_0x89d3('0x6c'))['field'](_0x89d3('0x70'),'scheduledAt')[_0x89d3('0x6f')]('id',_0x89d3('0x6d'))[_0x89d3('0x6f')](_0x1d2792['CmListId'][_0x89d3('0x71')](),_0x89d3('0x72'))[_0x89d3('0x6f')](_0x17480e['params']['id'][_0x89d3('0x71')](),_0x89d3('0x59'))[_0x89d3('0x6f')]('NOW()',_0x89d3('0x51'))[_0x89d3('0x6f')](_0x89d3('0x70'),_0x89d3('0x53'))['from']('cm_contacts')[_0x89d3('0x3b')](_0x89d3('0x73'))['where'](_0x89d3('0x74'),_0x1d2792['CmListId']['toString']())[_0x89d3('0x3b')](_0x89d3('0x75'))[_0x89d3('0x3b')](_0x89d3('0x76'),squel['select']()[_0x89d3('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0x89d3('0x77')](_0x89d3('0x78'))[_0x89d3('0x3b')](_0x89d3('0x79'),_0x17480e[_0x89d3('0x45')]['id'][_0x89d3('0x71')]()))[_0x89d3('0x3b')](_0x89d3('0x76'),squel[_0x89d3('0x6e')]()[_0x89d3('0x6f')](_0x89d3('0x7a'))[_0x89d3('0x77')](_0x89d3('0x6a'))['where'](_0x89d3('0x79'),_0x17480e[_0x89d3('0x45')]['id'][_0x89d3('0x71')]())))[_0x89d3('0x71')]();break;case'onlyIfOpen':_0x2098c9=squel[_0x89d3('0x68')]()[_0x89d3('0x69')](_0x89d3('0x6a'))[_0x89d3('0x6b')]([_0x89d3('0x6c'),_0x89d3('0x7b'),'ContactId',_0x89d3('0x72'),_0x89d3('0x59'),_0x89d3('0x51'),'updatedAt'],squel[_0x89d3('0x6e')]()['field'](_0x89d3('0x6c'),_0x89d3('0x6c'))[_0x89d3('0x6f')](_0x89d3('0x70'),_0x89d3('0x7b'))[_0x89d3('0x6f')]('id',_0x89d3('0x6d'))['field'](_0x1d2792[_0x89d3('0x7c')]['toString'](),'ListId')[_0x89d3('0x6f')](_0x17480e[_0x89d3('0x45')]['id'][_0x89d3('0x71')](),_0x89d3('0x59'))[_0x89d3('0x6f')]('NOW()',_0x89d3('0x51'))[_0x89d3('0x6f')]('NOW()',_0x89d3('0x53'))[_0x89d3('0x77')](_0x89d3('0x7d'))[_0x89d3('0x3b')]('deletedAt\x20IS\x20NULL')[_0x89d3('0x3b')](_0x89d3('0x74'),_0x1d2792[_0x89d3('0x7c')][_0x89d3('0x71')]())[_0x89d3('0x3b')](_0x89d3('0x75'))[_0x89d3('0x3b')](_0x89d3('0x76'),squel[_0x89d3('0x6e')]()[_0x89d3('0x6f')]('COALESCE(phone,\x27\x27)')[_0x89d3('0x77')]('cm_hopper')[_0x89d3('0x3b')](_0x89d3('0x79'),_0x17480e['params']['id'][_0x89d3('0x71')]())))['toString']();break;default:_0x2098c9=squel['insert']()[_0x89d3('0x69')](_0x89d3('0x6a'))[_0x89d3('0x6b')]([_0x89d3('0x6c'),_0x89d3('0x7b'),_0x89d3('0x6d'),_0x89d3('0x72'),'CampaignId',_0x89d3('0x51'),_0x89d3('0x53')],squel[_0x89d3('0x6e')]()[_0x89d3('0x6f')]('phone',_0x89d3('0x6c'))['field']('NOW()',_0x89d3('0x7b'))[_0x89d3('0x6f')]('id',_0x89d3('0x6d'))[_0x89d3('0x6f')](_0x1d2792[_0x89d3('0x7c')][_0x89d3('0x71')](),'ListId')['field'](_0x17480e[_0x89d3('0x45')]['id'][_0x89d3('0x71')](),'CampaignId')['field'](_0x89d3('0x70'),_0x89d3('0x51'))[_0x89d3('0x6f')](_0x89d3('0x70'),_0x89d3('0x53'))[_0x89d3('0x77')](_0x89d3('0x7d'))[_0x89d3('0x3b')](_0x89d3('0x73'))[_0x89d3('0x3b')](_0x89d3('0x74'),_0x1d2792[_0x89d3('0x7c')][_0x89d3('0x71')]())[_0x89d3('0x3b')](_0x89d3('0x75')))[_0x89d3('0x71')]();}_0x112ae1['push'](db['sequelize'][_0x89d3('0x31')](_0x2098c9));}return BPromise[_0x89d3('0x7e')](_0x112ae1);}})[_0x89d3('0x22')](function(){return _0x20e71e;})[_0x89d3('0x22')](respondWithResult(_0x275b85,null))['catch'](handleError(_0x275b85,null));};exports['removeLists']=function(_0x19b325,_0x1c72cb,_0x4b4c5a){return db[_0x89d3('0x2b')][_0x89d3('0x48')]({'where':{'id':_0x19b325[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x1c72cb,null))[_0x89d3('0x22')](function(_0x29d98e){if(_0x29d98e){return _0x29d98e[_0x89d3('0x7f')](_0x19b325[_0x89d3('0x31')][_0x89d3('0x64')]);}})['then'](function(_0x19755d){if(_0x19755d){return db['CmHopper'][_0x89d3('0x23')]({'where':{'ListId':_0x19b325['query'][_0x89d3('0x64')],'CampaignId':_0x19b325[_0x89d3('0x45')]['id']}})['then'](function(){return _0x19755d;});}})[_0x89d3('0x22')](respondWithStatusCode(_0x1c72cb,null))[_0x89d3('0x43')](handleError(_0x1c72cb,null));};exports['getBlackLists']=function(_0x4bb585,_0x5bbeeb,_0x1cd074){var _0x2713c5={};var _0x1df820={};var _0x5298ce;var _0x1ef633;return db[_0x89d3('0x2b')]['findOne']({'where':{'id':_0x4bb585[_0x89d3('0x45')]['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x5bbeeb,null))['then'](function(_0x380de4){if(_0x380de4){_0x5298ce=_0x380de4;_0x1df820[_0x89d3('0x30')]=_[_0x89d3('0x46')](db['CmList'][_0x89d3('0x2c')]);_0x1df820[_0x89d3('0x31')]=_[_0x89d3('0x46')](_0x4bb585[_0x89d3('0x31')]);_0x1df820[_0x89d3('0x32')]=_['intersection'](_0x1df820['model'],_0x1df820['query']);_0x2713c5[_0x89d3('0x34')]=_[_0x89d3('0x33')](_0x1df820[_0x89d3('0x30')],qs[_0x89d3('0x35')](_0x4bb585[_0x89d3('0x31')][_0x89d3('0x35')]));_0x2713c5['attributes']=_0x2713c5[_0x89d3('0x34')][_0x89d3('0x36')]?_0x2713c5['attributes']:_0x1df820[_0x89d3('0x30')];_0x2713c5[_0x89d3('0x39')]=qs[_0x89d3('0x3a')](_0x4bb585[_0x89d3('0x31')]['sort']);_0x2713c5['where']=qs[_0x89d3('0x32')](_[_0x89d3('0x3c')](_0x4bb585[_0x89d3('0x31')],_0x1df820['filters']));if(_0x4bb585['query'][_0x89d3('0x5a')]){_0x2713c5[_0x89d3('0x3b')]=_[_0x89d3('0x3d')](_0x2713c5['where'],{'$or':_[_0x89d3('0x2a')](_0x2713c5['attributes'],function(_0x2521ca){var _0x14b393={};_0x14b393[_0x2521ca]={'$like':'%'+_0x4bb585[_0x89d3('0x31')][_0x89d3('0x5a')]+'%'};return _0x14b393;})});}_0x2713c5=_[_0x89d3('0x3d')]({},_0x2713c5,_0x4bb585[_0x89d3('0x3f')]);return _0x5298ce['getBlackLists'](_0x2713c5);}})[_0x89d3('0x22')](function(_0x2a9d1e){if(_0x2a9d1e){_0x1ef633=_0x2a9d1e[_0x89d3('0x36')];if(!_0x4bb585[_0x89d3('0x31')][_0x89d3('0x37')](_0x89d3('0x38'))){_0x2713c5[_0x89d3('0x1b')]=qs[_0x89d3('0x1b')](_0x4bb585[_0x89d3('0x31')]['limit']);_0x2713c5[_0x89d3('0x1c')]=qs[_0x89d3('0x1c')](_0x4bb585[_0x89d3('0x31')][_0x89d3('0x1c')]);}return _0x5298ce['getBlackLists'](_0x2713c5);}})['then'](function(_0xac24c9){if(_0xac24c9){return _0xac24c9?{'count':_0x1ef633,'rows':_0xac24c9}:null;}})['then'](respondWithResult(_0x5bbeeb,null))['catch'](handleError(_0x5bbeeb,null));};exports['addBlackLists']=function(_0x686a0c,_0x1853c1,_0x2f7e89){var _0x45ae3a,_0x3c3504;return db[_0x89d3('0x2b')][_0x89d3('0x48')]({'where':{'id':_0x686a0c['params']['id']}})[_0x89d3('0x22')](handleEntityNotFound(_0x1853c1,null))['then'](function(_0x564261){if(_0x564261){_0x3c3504=_0x564261;return _0x564261[_0x89d3('0x80')](_0x686a0c['body'][_0x89d3('0x64')],_['omit'](_0x686a0c[_0x89d3('0x4a')],[_0x89d3('0x64'),'id'])||{});}return null;})['spread'](function(_0x1281d1){var _0x449029;_0x45ae3a=_0x1281d1||[];var _0x254e3f=[];if(_0x1281d1){for(var _0x41d075=0x0;_0x41d075<_0x1281d1['length'];_0x41d075+=0x1){var _0x24efc2=_0x1281d1[_0x41d075][_0x89d3('0x4c')]({'plain':!![]});_0x449029=squel[_0x89d3('0x68')]()[_0x89d3('0x69')](_0x89d3('0x81'))['fromQuery']([_0x89d3('0x6c'),_0x89d3('0x6d'),_0x89d3('0x72'),_0x89d3('0x59'),_0x89d3('0x51'),_0x89d3('0x53')],squel[_0x89d3('0x6e')]()[_0x89d3('0x6f')]('phone','phone')[_0x89d3('0x6f')]('id','ContactId')['field'](_0x24efc2[_0x89d3('0x7c')]['toString'](),'ListId')[_0x89d3('0x6f')](_0x686a0c[_0x89d3('0x45')]['id'][_0x89d3('0x71')](),_0x89d3('0x59'))[_0x89d3('0x6f')](_0x89d3('0x70'),'createdAt')[_0x89d3('0x6f')]('NOW()',_0x89d3('0x53'))[_0x89d3('0x77')](_0x89d3('0x7d'))[_0x89d3('0x3b')](_0x89d3('0x73'))[_0x89d3('0x3b')](_0x89d3('0x74'),_0x24efc2[_0x89d3('0x7c')][_0x89d3('0x71')]())[_0x89d3('0x3b')](_0x89d3('0x75')))['toString']();_0x254e3f[_0x89d3('0x82')](db[_0x89d3('0x83')][_0x89d3('0x31')](_0x449029));}return BPromise['all'](_0x254e3f);}})[_0x89d3('0x22')](function(){return _0x45ae3a;})[_0x89d3('0x22')](respondWithResult(_0x1853c1,null))[_0x89d3('0x43')](handleError(_0x1853c1,null));};exports[_0x89d3('0x84')]=function(_0x25c51c,_0x35b767,_0x3064bd){return db[_0x89d3('0x2b')]['find']({'where':{'id':_0x25c51c['params']['id']}})['then'](handleEntityNotFound(_0x35b767,null))['then'](function(_0x13be39){if(_0x13be39){return _0x13be39['removeBlackLists'](_0x25c51c[_0x89d3('0x31')][_0x89d3('0x64')]);}})[_0x89d3('0x22')](function(_0x606094){if(_0x606094){return db[_0x89d3('0x60')][_0x89d3('0x23')]({'where':{'ListId':_0x25c51c[_0x89d3('0x31')]['ids'],'CampaignId':_0x25c51c[_0x89d3('0x45')]['id']}})['then'](function(){return _0x606094;});}})['then'](respondWithStatusCode(_0x35b767,null))[_0x89d3('0x43')](handleError(_0x35b767,null));}; \ No newline at end of file +var _0xe8b7=['cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','from','deletedAt\x20IS\x20NULL','CampaignId\x20=\x20?','into','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','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','length','omit','updatedAt','createdAt','IvrCampaigns','getHoppers','findOne','CmHopper','pick','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always'];(function(_0x13f83e,_0x3ec1a2){var _0x1ffbc4=function(_0x549735){while(--_0x549735){_0x13f83e['push'](_0x13f83e['shift']());}};_0x1ffbc4(++_0x3ec1a2);}(_0xe8b7,0x12f));var _0x7e8b=function(_0xc06868,_0x5c9efb){_0xc06868=_0xc06868-0x0;var _0x11548e=_0xe8b7[_0xc06868];return _0x11548e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7e8b('0x0'));var jsonpatch=require(_0x7e8b('0x1'));var rp=require(_0x7e8b('0x2'));var moment=require(_0x7e8b('0x3'));var BPromise=require(_0x7e8b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e8b('0x5'));var sox=require(_0x7e8b('0x6'));var csv=require(_0x7e8b('0x7'));var ejs=require(_0x7e8b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e8b('0x9'));var squel=require(_0x7e8b('0xa'));var crypto=require(_0x7e8b('0xb'));var jsforce=require(_0x7e8b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7e8b('0x7'));var querystring=require(_0x7e8b('0xd'));var Papa=require(_0x7e8b('0xe'));var Redis=require('ioredis');var authService=require(_0x7e8b('0xf'));var qs=require(_0x7e8b('0x10'));var as=require(_0x7e8b('0x11'));var hardwareService=require(_0x7e8b('0x12'));var logger=require(_0x7e8b('0x13'))(_0x7e8b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7e8b('0x15'));var db=require(_0x7e8b('0x16'))['db'];function respondWithStatusCode(_0x34cdbe,_0x24082a){_0x24082a=_0x24082a||0xcc;return function(_0x25a93c){if(_0x25a93c){return _0x34cdbe[_0x7e8b('0x17')](_0x24082a);}return _0x34cdbe[_0x7e8b('0x18')](_0x24082a)[_0x7e8b('0x19')]();};}function respondWithResult(_0x41d188,_0x31188a){_0x31188a=_0x31188a||0xc8;return function(_0x5abed3){if(_0x5abed3){return _0x41d188['status'](_0x31188a)[_0x7e8b('0x1a')](_0x5abed3);}};}function respondWithFilteredResult(_0x30e8ff,_0x5b7ee4){return function(_0x15398e){if(_0x15398e){var _0x44f808=typeof _0x5b7ee4[_0x7e8b('0x1b')]===_0x7e8b('0x1c')&&typeof _0x5b7ee4[_0x7e8b('0x1d')]==='undefined';var _0x5327c0=_0x15398e[_0x7e8b('0x1e')];var _0x4af10d=_0x44f808?0x0:_0x5b7ee4[_0x7e8b('0x1b')];var _0x553e38=_0x44f808?_0x15398e[_0x7e8b('0x1e')]:_0x5b7ee4[_0x7e8b('0x1b')]+_0x5b7ee4['limit'];var _0xecb139;if(_0x553e38>=_0x5327c0){_0x553e38=_0x5327c0;_0xecb139=0xc8;}else{_0xecb139=0xce;}_0x30e8ff[_0x7e8b('0x18')](_0xecb139);return _0x30e8ff[_0x7e8b('0x1f')](_0x7e8b('0x20'),_0x4af10d+'-'+_0x553e38+'/'+_0x5327c0)[_0x7e8b('0x1a')](_0x15398e);}return null;};}function patchUpdates(_0x1462e9){return function(_0x4abc71){try{jsonpatch['apply'](_0x4abc71,_0x1462e9,!![]);}catch(_0x41eb64){return BPromise['reject'](_0x41eb64);}return _0x4abc71[_0x7e8b('0x21')]();};}function saveUpdates(_0x299155,_0x15db90){return function(_0x1db885){if(_0x1db885){return _0x1db885[_0x7e8b('0x22')](_0x299155)[_0x7e8b('0x23')](function(_0x294a91){return _0x294a91;});}return null;};}function removeEntity(_0x6cd57b,_0x5d2d4a){return function(_0xed17f1){if(_0xed17f1){return _0xed17f1[_0x7e8b('0x24')]()['then'](function(){var _0x3831f7=_0xed17f1[_0x7e8b('0x25')]({'plain':!![]});var _0x4570b4='IvrCampaigns';return db[_0x7e8b('0x26')][_0x7e8b('0x24')]({'where':{'type':_0x4570b4,'resourceId':_0x3831f7['id']}})['then'](function(){return _0xed17f1;});})[_0x7e8b('0x23')](function(){_0x6cd57b[_0x7e8b('0x18')](0xcc)[_0x7e8b('0x19')]();});}};}function handleEntityNotFound(_0x55b914,_0xe97630){return function(_0x3362a7){if(!_0x3362a7){_0x55b914[_0x7e8b('0x17')](0x194);}return _0x3362a7;};}function handleError(_0x7297d0,_0xccb4f2){_0xccb4f2=_0xccb4f2||0x1f4;return function(_0x5e41a7){logger[_0x7e8b('0x27')](_0x5e41a7['stack']);if(_0x5e41a7[_0x7e8b('0x28')]){delete _0x5e41a7['name'];}_0x7297d0['status'](_0xccb4f2)['send'](_0x5e41a7);};}exports[_0x7e8b('0x29')]=function(_0x3d7b35,_0x1bb106){var _0x2f2dd7={},_0x2cc7b9={},_0x293f96={'count':0x0,'rows':[]};var _0x1fa6c4=_[_0x7e8b('0x2a')](db[_0x7e8b('0x2b')][_0x7e8b('0x2c')],function(_0x4893d3){return{'name':_0x4893d3[_0x7e8b('0x2d')],'type':_0x4893d3[_0x7e8b('0x2e')][_0x7e8b('0x2f')]};});_0x2cc7b9[_0x7e8b('0x30')]=_[_0x7e8b('0x2a')](_0x1fa6c4,_0x7e8b('0x28'));_0x2cc7b9[_0x7e8b('0x31')]=_[_0x7e8b('0x32')](_0x3d7b35[_0x7e8b('0x31')]);_0x2cc7b9[_0x7e8b('0x33')]=_[_0x7e8b('0x34')](_0x2cc7b9[_0x7e8b('0x30')],_0x2cc7b9[_0x7e8b('0x31')]);_0x2f2dd7['attributes']=_[_0x7e8b('0x34')](_0x2cc7b9['model'],qs[_0x7e8b('0x35')](_0x3d7b35[_0x7e8b('0x31')]['fields']));_0x2f2dd7[_0x7e8b('0x36')]=_0x2f2dd7[_0x7e8b('0x36')]['length']?_0x2f2dd7[_0x7e8b('0x36')]:_0x2cc7b9[_0x7e8b('0x30')];if(!_0x3d7b35[_0x7e8b('0x31')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x2f2dd7[_0x7e8b('0x1d')]=qs[_0x7e8b('0x1d')](_0x3d7b35[_0x7e8b('0x31')][_0x7e8b('0x1d')]);_0x2f2dd7['offset']=qs[_0x7e8b('0x1b')](_0x3d7b35[_0x7e8b('0x31')]['offset']);}_0x2f2dd7[_0x7e8b('0x39')]=qs['sort'](_0x3d7b35[_0x7e8b('0x31')][_0x7e8b('0x3a')]);_0x2f2dd7[_0x7e8b('0x3b')]=qs[_0x7e8b('0x33')](_['pick'](_0x3d7b35['query'],_0x2cc7b9[_0x7e8b('0x33')]),_0x1fa6c4);if(_0x3d7b35['query']['filter']){_0x2f2dd7[_0x7e8b('0x3b')]=_[_0x7e8b('0x3c')](_0x2f2dd7[_0x7e8b('0x3b')],{'$or':_[_0x7e8b('0x2a')](_0x1fa6c4,function(_0x11dc57){if(_0x11dc57[_0x7e8b('0x2e')]!==_0x7e8b('0x3d')){var _0x3a2734={};_0x3a2734[_0x11dc57[_0x7e8b('0x28')]]={'$like':'%'+_0x3d7b35[_0x7e8b('0x31')][_0x7e8b('0x3e')]+'%'};return _0x3a2734;}})});}_0x2f2dd7=_['merge']({},_0x2f2dd7,_0x3d7b35[_0x7e8b('0x3f')]);var _0x26f26a={'where':_0x2f2dd7[_0x7e8b('0x3b')]};return db[_0x7e8b('0x2b')][_0x7e8b('0x1e')](_0x26f26a)[_0x7e8b('0x23')](function(_0x34dc4a){_0x293f96['count']=_0x34dc4a;if(_0x3d7b35[_0x7e8b('0x31')][_0x7e8b('0x40')]){_0x2f2dd7[_0x7e8b('0x41')]=[{'all':!![]}];}return db['Campaign'][_0x7e8b('0x42')](_0x2f2dd7);})[_0x7e8b('0x23')](function(_0x42518a){_0x293f96[_0x7e8b('0x43')]=_0x42518a;return _0x293f96;})[_0x7e8b('0x23')](respondWithFilteredResult(_0x1bb106,_0x2f2dd7))[_0x7e8b('0x44')](handleError(_0x1bb106,null));};exports[_0x7e8b('0x45')]=function(_0x566173,_0x5ecec0){var _0x3ffedc={'raw':![],'where':{'id':_0x566173[_0x7e8b('0x46')]['id']}},_0x4c3c35={};_0x4c3c35[_0x7e8b('0x30')]=_['keys'](db['Campaign']['rawAttributes']);_0x4c3c35[_0x7e8b('0x31')]=_[_0x7e8b('0x32')](_0x566173[_0x7e8b('0x31')]);_0x4c3c35['filters']=_[_0x7e8b('0x34')](_0x4c3c35['model'],_0x4c3c35[_0x7e8b('0x31')]);_0x3ffedc[_0x7e8b('0x36')]=_['intersection'](_0x4c3c35['model'],qs[_0x7e8b('0x35')](_0x566173[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x3ffedc[_0x7e8b('0x36')]=_0x3ffedc[_0x7e8b('0x36')]['length']?_0x3ffedc[_0x7e8b('0x36')]:_0x4c3c35[_0x7e8b('0x30')];if(_0x566173[_0x7e8b('0x31')][_0x7e8b('0x40')]){_0x3ffedc[_0x7e8b('0x41')]=[{'all':!![]}];}_0x3ffedc=_[_0x7e8b('0x3c')]({},_0x3ffedc,_0x566173[_0x7e8b('0x3f')]);return db['Campaign'][_0x7e8b('0x47')](_0x3ffedc)['then'](handleEntityNotFound(_0x5ecec0,null))[_0x7e8b('0x23')](respondWithResult(_0x5ecec0,null))[_0x7e8b('0x44')](handleError(_0x5ecec0,null));};exports[_0x7e8b('0x48')]=function(_0x58e277,_0x2df2dd){return db[_0x7e8b('0x2b')]['create'](_0x58e277[_0x7e8b('0x49')],{})[_0x7e8b('0x23')](function(_0x90f0ed){var _0x2b8287=_0x58e277[_0x7e8b('0x4a')][_0x7e8b('0x25')]({'plain':!![]});if(!_0x2b8287)throw new Error(_0x7e8b('0x4b'));if(_0x2b8287[_0x7e8b('0x4c')]===_0x7e8b('0x4a')){var _0x3c9afc=_0x90f0ed[_0x7e8b('0x25')]({'plain':!![]});var _0x10158a='IvrCampaigns';return db[_0x7e8b('0x4d')]['find']({'where':{'name':_0x10158a,'userProfileId':_0x2b8287[_0x7e8b('0x4e')]},'raw':!![]})[_0x7e8b('0x23')](function(_0x2690d4){if(_0x2690d4&&_0x2690d4[_0x7e8b('0x4f')]===0x0){return db[_0x7e8b('0x26')][_0x7e8b('0x48')]({'name':_0x3c9afc['name'],'resourceId':_0x3c9afc['id'],'type':_0x2690d4['name'],'sectionId':_0x2690d4['id']},{})[_0x7e8b('0x23')](function(){return _0x90f0ed;});}else{return _0x90f0ed;}})[_0x7e8b('0x44')](function(_0x15d471){logger[_0x7e8b('0x27')](_0x7e8b('0x50'),_0x15d471);throw _0x15d471;});}return _0x90f0ed;})[_0x7e8b('0x23')](respondWithResult(_0x2df2dd,0xc9))[_0x7e8b('0x44')](handleError(_0x2df2dd,null));};exports['clone']=function(_0x50c35c,_0x3f693b){var _0xc60f0a={'where':{'id':_0x50c35c[_0x7e8b('0x46')]['id']}},_0x2c1db4={};_0x2c1db4['model']=_[_0x7e8b('0x32')](db[_0x7e8b('0x2b')][_0x7e8b('0x2c')]);_0xc60f0a[_0x7e8b('0x36')]=_[_0x7e8b('0x34')](_0x2c1db4['model'],qs[_0x7e8b('0x35')](_0x50c35c[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0xc60f0a[_0x7e8b('0x36')]=_0xc60f0a[_0x7e8b('0x36')][_0x7e8b('0x51')]?_0xc60f0a[_0x7e8b('0x36')]:_0x2c1db4[_0x7e8b('0x30')];if(_0x50c35c[_0x7e8b('0x31')]['includeAll']){_0xc60f0a[_0x7e8b('0x41')]=[{'all':!![]}];}_0xc60f0a=_[_0x7e8b('0x3c')]({},_0xc60f0a,_0x50c35c[_0x7e8b('0x3f')]);return db[_0x7e8b('0x2b')][_0x7e8b('0x47')](_0xc60f0a)['then'](handleEntityNotFound(_0x3f693b,null))[_0x7e8b('0x23')](function(_0x5c1beb){if(_0x5c1beb){var _0x1b979c=_0x5c1beb[_0x7e8b('0x25')]({'plain':!![]});_0x1b979c=qs[_0x7e8b('0x52')](_0x1b979c,['id','createdAt',_0x7e8b('0x53')]);_0x50c35c['body']=_[_0x7e8b('0x52')](_0x50c35c[_0x7e8b('0x49')],['id',_0x7e8b('0x54'),_0x7e8b('0x53')]);return db[_0x7e8b('0x2b')]['create'](_['merge'](_0x1b979c,_0x50c35c['body']),{'include':_0x50c35c['query'][_0x7e8b('0x40')]?[{'all':!![]}]:undefined})[_0x7e8b('0x23')](function(_0x36783a){var _0x3cfdc3=_0x50c35c['user'][_0x7e8b('0x25')]({'plain':!![]});if(!_0x3cfdc3)throw new Error(_0x7e8b('0x4b'));if(_0x3cfdc3[_0x7e8b('0x4c')]===_0x7e8b('0x4a')){var _0x1bf260=_0x36783a['get']({'plain':!![]});var _0x36f0c1=_0x7e8b('0x55');return db[_0x7e8b('0x4d')][_0x7e8b('0x47')]({'where':{'name':_0x36f0c1,'userProfileId':_0x3cfdc3[_0x7e8b('0x4e')]},'raw':!![]})[_0x7e8b('0x23')](function(_0x2a2896){if(_0x2a2896&&_0x2a2896[_0x7e8b('0x4f')]===0x0){return db[_0x7e8b('0x26')][_0x7e8b('0x48')]({'name':_0x1bf260[_0x7e8b('0x28')],'resourceId':_0x1bf260['id'],'type':_0x2a2896[_0x7e8b('0x28')],'sectionId':_0x2a2896['id']},{})['then'](function(){return _0x36783a;});}else{return _0x36783a;}})['catch'](function(_0x5784d5){logger[_0x7e8b('0x27')](_0x7e8b('0x50'),_0x5784d5);throw _0x5784d5;});}return _0x36783a;});}})[_0x7e8b('0x23')](respondWithResult(_0x3f693b,0xc9))[_0x7e8b('0x44')](handleError(_0x3f693b,null));};exports['update']=function(_0x368e9c,_0x500731){if(_0x368e9c[_0x7e8b('0x49')]['id']){delete _0x368e9c[_0x7e8b('0x49')]['id'];}return db['Campaign'][_0x7e8b('0x47')]({'where':{'id':_0x368e9c[_0x7e8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x500731,null))[_0x7e8b('0x23')](saveUpdates(_0x368e9c[_0x7e8b('0x49')],null))['then'](respondWithResult(_0x500731,null))[_0x7e8b('0x44')](handleError(_0x500731,null));};exports[_0x7e8b('0x24')]=function(_0x3aedbf,_0x2a18c6){return db['Campaign'][_0x7e8b('0x47')]({'where':{'id':_0x3aedbf[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x2a18c6,null))[_0x7e8b('0x23')](removeEntity(_0x2a18c6,null))[_0x7e8b('0x44')](handleError(_0x2a18c6,null));};exports[_0x7e8b('0x56')]=function(_0x1fe892,_0x12b257,_0x364784){var _0x4d08b1={'raw':!![],'where':{}};var _0x3d6d63={};var _0x4046ed={'count':0x0,'rows':[]};return db[_0x7e8b('0x2b')][_0x7e8b('0x57')]({'where':{'id':_0x1fe892[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x12b257,null))[_0x7e8b('0x23')](function(_0x1d3901){if(_0x1d3901){_0x3d6d63[_0x7e8b('0x30')]=_[_0x7e8b('0x32')](db[_0x7e8b('0x58')]['rawAttributes']);_0x3d6d63['query']=_[_0x7e8b('0x32')](_0x1fe892[_0x7e8b('0x31')]);_0x3d6d63[_0x7e8b('0x33')]=_[_0x7e8b('0x34')](_0x3d6d63['model'],_0x3d6d63[_0x7e8b('0x31')]);_0x4d08b1[_0x7e8b('0x36')]=_[_0x7e8b('0x34')](_0x3d6d63[_0x7e8b('0x30')],qs['fields'](_0x1fe892[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x4d08b1['attributes']=_0x4d08b1['attributes'][_0x7e8b('0x51')]?_0x4d08b1[_0x7e8b('0x36')]:_0x3d6d63[_0x7e8b('0x30')];if(!_0x1fe892[_0x7e8b('0x31')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x4d08b1[_0x7e8b('0x1d')]=qs[_0x7e8b('0x1d')](_0x1fe892['query'][_0x7e8b('0x1d')]);_0x4d08b1[_0x7e8b('0x1b')]=qs['offset'](_0x1fe892['query']['offset']);}_0x4d08b1[_0x7e8b('0x39')]=qs[_0x7e8b('0x3a')](_0x1fe892[_0x7e8b('0x31')][_0x7e8b('0x3a')]);_0x4d08b1[_0x7e8b('0x3b')]=qs[_0x7e8b('0x33')](_[_0x7e8b('0x59')](_0x1fe892[_0x7e8b('0x31')],_0x3d6d63[_0x7e8b('0x33')]));_0x4d08b1[_0x7e8b('0x3b')][_0x7e8b('0x5a')]=_0x1d3901['id'];if(_0x1fe892[_0x7e8b('0x31')][_0x7e8b('0x3e')]){_0x4d08b1['where']=_['merge'](_0x4d08b1[_0x7e8b('0x3b')],{'$or':_['map'](_0x4d08b1[_0x7e8b('0x36')],function(_0x3b70e5){var _0x38b1df={};_0x38b1df[_0x3b70e5]={'$like':'%'+_0x1fe892['query'][_0x7e8b('0x3e')]+'%'};return _0x38b1df;})});}_0x4d08b1=_[_0x7e8b('0x3c')]({},_0x4d08b1,_0x1fe892[_0x7e8b('0x3f')]);return db[_0x7e8b('0x58')]['count']({'where':_0x4d08b1['where']})[_0x7e8b('0x23')](function(_0x29c531){_0x4046ed[_0x7e8b('0x1e')]=_0x29c531;if(_0x1fe892[_0x7e8b('0x31')]['includeAll']){_0x4d08b1[_0x7e8b('0x41')]=[{'all':!![]}];}return db[_0x7e8b('0x58')]['findAll'](_0x4d08b1);})[_0x7e8b('0x23')](function(_0x14f2c5){_0x4046ed[_0x7e8b('0x43')]=_0x14f2c5;return _0x4046ed;});}})[_0x7e8b('0x23')](respondWithFilteredResult(_0x12b257,_0x4d08b1))[_0x7e8b('0x44')](handleError(_0x12b257,null));};exports['getHopperHistories']=function(_0x573d11,_0x1f9536,_0x479d20){var _0x45a902={'raw':!![],'where':{}};var _0x34b8fc={};var _0x403ecc={'count':0x0,'rows':[]};return db[_0x7e8b('0x2b')][_0x7e8b('0x57')]({'where':{'id':_0x573d11['params']['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x1f9536,null))[_0x7e8b('0x23')](function(_0x3f4f9d){if(_0x3f4f9d){_0x34b8fc[_0x7e8b('0x30')]=_['keys'](db['CmHopperHistory'][_0x7e8b('0x2c')]);_0x34b8fc[_0x7e8b('0x31')]=_['keys'](_0x573d11[_0x7e8b('0x31')]);_0x34b8fc[_0x7e8b('0x33')]=_['intersection'](_0x34b8fc[_0x7e8b('0x30')],_0x34b8fc[_0x7e8b('0x31')]);_0x45a902[_0x7e8b('0x36')]=_[_0x7e8b('0x34')](_0x34b8fc[_0x7e8b('0x30')],qs[_0x7e8b('0x35')](_0x573d11[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x45a902[_0x7e8b('0x36')]=_0x45a902['attributes'][_0x7e8b('0x51')]?_0x45a902[_0x7e8b('0x36')]:_0x34b8fc[_0x7e8b('0x30')];if(!_0x573d11[_0x7e8b('0x31')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x45a902['limit']=qs[_0x7e8b('0x1d')](_0x573d11['query']['limit']);_0x45a902[_0x7e8b('0x1b')]=qs['offset'](_0x573d11['query'][_0x7e8b('0x1b')]);}_0x45a902[_0x7e8b('0x39')]=qs[_0x7e8b('0x3a')](_0x573d11['query']['sort']);_0x45a902['where']=qs['filters'](_['pick'](_0x573d11[_0x7e8b('0x31')],_0x34b8fc[_0x7e8b('0x33')]));_0x45a902[_0x7e8b('0x3b')][_0x7e8b('0x5a')]=_0x3f4f9d['id'];if(_0x573d11['query'][_0x7e8b('0x3e')]){_0x45a902['where']=_[_0x7e8b('0x3c')](_0x45a902[_0x7e8b('0x3b')],{'$or':_[_0x7e8b('0x2a')](_0x45a902['attributes'],function(_0x3d6fb6){var _0x4f9174={};_0x4f9174[_0x3d6fb6]={'$like':'%'+_0x573d11[_0x7e8b('0x31')][_0x7e8b('0x3e')]+'%'};return _0x4f9174;})});}_0x45a902=_[_0x7e8b('0x3c')]({},_0x45a902,_0x573d11['options']);return db[_0x7e8b('0x5b')]['count']({'where':_0x45a902[_0x7e8b('0x3b')]})[_0x7e8b('0x23')](function(_0x1d018e){_0x403ecc[_0x7e8b('0x1e')]=_0x1d018e;if(_0x573d11[_0x7e8b('0x31')]['includeAll']){_0x45a902[_0x7e8b('0x41')]=[{'all':!![]}];}return db[_0x7e8b('0x5b')][_0x7e8b('0x42')](_0x45a902);})[_0x7e8b('0x23')](function(_0x3fc3f1){_0x403ecc[_0x7e8b('0x43')]=_0x3fc3f1;return _0x403ecc;});}})['then'](respondWithFilteredResult(_0x1f9536,_0x45a902))[_0x7e8b('0x44')](handleError(_0x1f9536,null));};exports[_0x7e8b('0x5c')]=function(_0x484769,_0x165f53,_0x1df900){var _0x1b9d13={'raw':!![],'where':{}};var _0x4a9f79={};var _0x1ccae9={'count':0x0,'rows':[]};return db[_0x7e8b('0x2b')][_0x7e8b('0x57')]({'where':{'id':_0x484769[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x165f53,null))[_0x7e8b('0x23')](function(_0x209ea2){if(_0x209ea2){_0x4a9f79[_0x7e8b('0x30')]=_['keys'](db['CmHopperFinal'][_0x7e8b('0x2c')]);_0x4a9f79[_0x7e8b('0x31')]=_['keys'](_0x484769[_0x7e8b('0x31')]);_0x4a9f79['filters']=_[_0x7e8b('0x34')](_0x4a9f79[_0x7e8b('0x30')],_0x4a9f79[_0x7e8b('0x31')]);_0x1b9d13['attributes']=_[_0x7e8b('0x34')](_0x4a9f79[_0x7e8b('0x30')],qs['fields'](_0x484769['query'][_0x7e8b('0x35')]));_0x1b9d13[_0x7e8b('0x36')]=_0x1b9d13[_0x7e8b('0x36')][_0x7e8b('0x51')]?_0x1b9d13[_0x7e8b('0x36')]:_0x4a9f79[_0x7e8b('0x30')];if(!_0x484769['query']['hasOwnProperty']('nolimit')){_0x1b9d13[_0x7e8b('0x1d')]=qs[_0x7e8b('0x1d')](_0x484769[_0x7e8b('0x31')]['limit']);_0x1b9d13['offset']=qs['offset'](_0x484769[_0x7e8b('0x31')][_0x7e8b('0x1b')]);}_0x1b9d13[_0x7e8b('0x39')]=qs[_0x7e8b('0x3a')](_0x484769['query'][_0x7e8b('0x3a')]);_0x1b9d13[_0x7e8b('0x3b')]=qs['filters'](_['pick'](_0x484769[_0x7e8b('0x31')],_0x4a9f79[_0x7e8b('0x33')]));_0x1b9d13[_0x7e8b('0x3b')][_0x7e8b('0x5a')]=_0x209ea2['id'];if(_0x484769[_0x7e8b('0x31')][_0x7e8b('0x3e')]){_0x1b9d13['where']=_[_0x7e8b('0x3c')](_0x1b9d13['where'],{'$or':_['map'](_0x1b9d13[_0x7e8b('0x36')],function(_0x289a84){var _0xe49cb2={};_0xe49cb2[_0x289a84]={'$like':'%'+_0x484769['query']['filter']+'%'};return _0xe49cb2;})});}_0x1b9d13=_[_0x7e8b('0x3c')]({},_0x1b9d13,_0x484769[_0x7e8b('0x3f')]);return db[_0x7e8b('0x5d')][_0x7e8b('0x1e')]({'where':_0x1b9d13[_0x7e8b('0x3b')]})['then'](function(_0x5d4473){_0x1ccae9[_0x7e8b('0x1e')]=_0x5d4473;if(_0x484769[_0x7e8b('0x31')][_0x7e8b('0x40')]){_0x1b9d13[_0x7e8b('0x41')]=[{'all':!![]}];}return db[_0x7e8b('0x5d')][_0x7e8b('0x42')](_0x1b9d13);})[_0x7e8b('0x23')](function(_0x13361b){_0x1ccae9[_0x7e8b('0x43')]=_0x13361b;return _0x1ccae9;});}})[_0x7e8b('0x23')](respondWithFilteredResult(_0x165f53,_0x1b9d13))[_0x7e8b('0x44')](handleError(_0x165f53,null));};exports[_0x7e8b('0x5e')]=function(_0x382c58,_0x4e6df9,_0x1c2a5f){var _0x35e122={'raw':!![],'where':{}};var _0x266f21={};var _0x46ae7f={'count':0x0,'rows':[]};return db[_0x7e8b('0x2b')][_0x7e8b('0x57')]({'where':{'id':_0x382c58[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x4e6df9,null))[_0x7e8b('0x23')](function(_0x41f897){if(_0x41f897){_0x266f21[_0x7e8b('0x30')]=_[_0x7e8b('0x32')](db[_0x7e8b('0x5f')][_0x7e8b('0x2c')]);_0x266f21['query']=_[_0x7e8b('0x32')](_0x382c58[_0x7e8b('0x31')]);_0x266f21[_0x7e8b('0x33')]=_[_0x7e8b('0x34')](_0x266f21[_0x7e8b('0x30')],_0x266f21['query']);_0x35e122[_0x7e8b('0x36')]=_[_0x7e8b('0x34')](_0x266f21[_0x7e8b('0x30')],qs[_0x7e8b('0x35')](_0x382c58[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x35e122[_0x7e8b('0x36')]=_0x35e122['attributes'][_0x7e8b('0x51')]?_0x35e122['attributes']:_0x266f21['model'];if(!_0x382c58['query'][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x35e122[_0x7e8b('0x1d')]=qs[_0x7e8b('0x1d')](_0x382c58[_0x7e8b('0x31')]['limit']);_0x35e122[_0x7e8b('0x1b')]=qs[_0x7e8b('0x1b')](_0x382c58['query']['offset']);}_0x35e122[_0x7e8b('0x39')]=qs[_0x7e8b('0x3a')](_0x382c58[_0x7e8b('0x31')][_0x7e8b('0x3a')]);_0x35e122['where']=qs['filters'](_[_0x7e8b('0x59')](_0x382c58[_0x7e8b('0x31')],_0x266f21[_0x7e8b('0x33')]));_0x35e122[_0x7e8b('0x3b')][_0x7e8b('0x5a')]=_0x41f897['id'];if(_0x382c58[_0x7e8b('0x31')][_0x7e8b('0x3e')]){_0x35e122['where']=_[_0x7e8b('0x3c')](_0x35e122[_0x7e8b('0x3b')],{'$or':_[_0x7e8b('0x2a')](_0x35e122['attributes'],function(_0x2c42f6){var _0x205d09={};_0x205d09[_0x2c42f6]={'$like':'%'+_0x382c58[_0x7e8b('0x31')]['filter']+'%'};return _0x205d09;})});}_0x35e122=_['merge']({},_0x35e122,_0x382c58['options']);return db[_0x7e8b('0x5f')][_0x7e8b('0x1e')]({'where':_0x35e122[_0x7e8b('0x3b')]})[_0x7e8b('0x23')](function(_0x48a03b){_0x46ae7f[_0x7e8b('0x1e')]=_0x48a03b;if(_0x382c58[_0x7e8b('0x31')][_0x7e8b('0x40')]){_0x35e122[_0x7e8b('0x41')]=[{'all':!![]}];}return db[_0x7e8b('0x5f')][_0x7e8b('0x42')](_0x35e122);})[_0x7e8b('0x23')](function(_0x28b77d){_0x46ae7f['rows']=_0x28b77d;return _0x46ae7f;});}})[_0x7e8b('0x23')](respondWithFilteredResult(_0x4e6df9,_0x35e122))[_0x7e8b('0x44')](handleError(_0x4e6df9,null));};exports[_0x7e8b('0x60')]=function(_0x23f39d,_0x1512d3,_0x41d822){var _0x5bd478={};var _0x36fd98={};var _0x448c01;var _0x4d1ec5;return db[_0x7e8b('0x2b')][_0x7e8b('0x57')]({'where':{'id':_0x23f39d[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x1512d3,null))[_0x7e8b('0x23')](function(_0x155d38){if(_0x155d38){_0x448c01=_0x155d38;_0x36fd98[_0x7e8b('0x30')]=_[_0x7e8b('0x32')](db['CmList'][_0x7e8b('0x2c')]);_0x36fd98[_0x7e8b('0x31')]=_[_0x7e8b('0x32')](_0x23f39d[_0x7e8b('0x31')]);_0x36fd98[_0x7e8b('0x33')]=_['intersection'](_0x36fd98[_0x7e8b('0x30')],_0x36fd98[_0x7e8b('0x31')]);_0x5bd478[_0x7e8b('0x36')]=_['intersection'](_0x36fd98[_0x7e8b('0x30')],qs['fields'](_0x23f39d[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x5bd478[_0x7e8b('0x36')]=_0x5bd478['attributes'][_0x7e8b('0x51')]?_0x5bd478[_0x7e8b('0x36')]:_0x36fd98[_0x7e8b('0x30')];_0x5bd478[_0x7e8b('0x39')]=qs[_0x7e8b('0x3a')](_0x23f39d[_0x7e8b('0x31')][_0x7e8b('0x3a')]);_0x5bd478['where']=qs['filters'](_[_0x7e8b('0x59')](_0x23f39d[_0x7e8b('0x31')],_0x36fd98['filters']));if(_0x23f39d[_0x7e8b('0x31')][_0x7e8b('0x3e')]){_0x5bd478[_0x7e8b('0x3b')]=_[_0x7e8b('0x3c')](_0x5bd478[_0x7e8b('0x3b')],{'$or':_[_0x7e8b('0x2a')](_0x5bd478[_0x7e8b('0x36')],function(_0x409baa){var _0xc52b4c={};_0xc52b4c[_0x409baa]={'$like':'%'+_0x23f39d[_0x7e8b('0x31')]['filter']+'%'};return _0xc52b4c;})});}_0x5bd478=_[_0x7e8b('0x3c')]({},_0x5bd478,_0x23f39d[_0x7e8b('0x3f')]);return _0x448c01[_0x7e8b('0x60')](_0x5bd478);}})[_0x7e8b('0x23')](function(_0x3d9b4c){if(_0x3d9b4c){_0x4d1ec5=_0x3d9b4c[_0x7e8b('0x51')];if(!_0x23f39d[_0x7e8b('0x31')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x5bd478[_0x7e8b('0x1d')]=qs['limit'](_0x23f39d[_0x7e8b('0x31')][_0x7e8b('0x1d')]);_0x5bd478[_0x7e8b('0x1b')]=qs['offset'](_0x23f39d['query'][_0x7e8b('0x1b')]);}return _0x448c01['getLists'](_0x5bd478);}})[_0x7e8b('0x23')](function(_0x39ad22){if(_0x39ad22){return _0x39ad22?{'count':_0x4d1ec5,'rows':_0x39ad22}:null;}})[_0x7e8b('0x23')](respondWithResult(_0x1512d3,null))[_0x7e8b('0x44')](handleError(_0x1512d3,null));};exports[_0x7e8b('0x61')]=function(_0x3468aa,_0x4cde13,_0x3aee11){var _0x3f49b6,_0x3047cd;return db[_0x7e8b('0x2b')][_0x7e8b('0x47')]({'where':{'id':_0x3468aa['params']['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x4cde13,null))[_0x7e8b('0x23')](function(_0x513f77){if(_0x513f77){_0x3047cd=_0x513f77;return _0x513f77[_0x7e8b('0x61')](_0x3468aa[_0x7e8b('0x49')][_0x7e8b('0x62')],_[_0x7e8b('0x52')](_0x3468aa['body'],[_0x7e8b('0x62'),'id'])||{});}return null;})[_0x7e8b('0x63')](function(_0x505357){var _0x458f01;_0x3f49b6=_0x505357||[];var _0xc322cd=[];if(_0x505357){for(var _0x4722c4=0x0;_0x4722c4<_0x505357[_0x7e8b('0x51')];_0x4722c4+=0x1){var _0x1246fb=_0x505357[_0x4722c4][_0x7e8b('0x25')]({'plain':!![]});_0x3047cd[_0x7e8b('0x64')]=_0x3468aa['body'][_0x7e8b('0x64')]?_0x3468aa[_0x7e8b('0x49')]['dialCheckDuplicateType']:_0x3047cd['dialCheckDuplicateType'];switch(_0x3047cd[_0x7e8b('0x64')]){case _0x7e8b('0x65'):_0x458f01=squel['insert']()['into'](_0x7e8b('0x66'))['fromQuery']([_0x7e8b('0x67'),_0x7e8b('0x68'),'ContactId',_0x7e8b('0x69'),'CampaignId',_0x7e8b('0x54'),'updatedAt'],squel[_0x7e8b('0x6a')]()['field'](_0x7e8b('0x67'),_0x7e8b('0x67'))[_0x7e8b('0x6b')](_0x7e8b('0x6c'),_0x7e8b('0x68'))['field']('id',_0x7e8b('0x6d'))[_0x7e8b('0x6b')](_0x1246fb[_0x7e8b('0x6e')][_0x7e8b('0x6f')](),_0x7e8b('0x69'))[_0x7e8b('0x6b')](_0x3468aa[_0x7e8b('0x46')]['id'][_0x7e8b('0x6f')](),'CampaignId')[_0x7e8b('0x6b')](_0x7e8b('0x6c'),_0x7e8b('0x54'))[_0x7e8b('0x6b')](_0x7e8b('0x6c'),'updatedAt')['from'](_0x7e8b('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x7e8b('0x3b')](_0x7e8b('0x71'),_0x1246fb[_0x7e8b('0x6e')]['toString']())['where'](_0x7e8b('0x72'))[_0x7e8b('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7e8b('0x6b')](_0x7e8b('0x73'))['from'](_0x7e8b('0x74'))[_0x7e8b('0x3b')]('CampaignId\x20=\x20?',_0x3468aa[_0x7e8b('0x46')]['id'][_0x7e8b('0x6f')]()))[_0x7e8b('0x3b')](_0x7e8b('0x75'),squel['select']()[_0x7e8b('0x6b')](_0x7e8b('0x76'))['from'](_0x7e8b('0x66'))['where']('CampaignId\x20=\x20?',_0x3468aa[_0x7e8b('0x46')]['id'][_0x7e8b('0x6f')]())))['toString']();break;case _0x7e8b('0x77'):_0x458f01=squel[_0x7e8b('0x78')]()['into'](_0x7e8b('0x66'))[_0x7e8b('0x79')](['phone','scheduledAt',_0x7e8b('0x6d'),_0x7e8b('0x69'),'CampaignId',_0x7e8b('0x54'),'updatedAt'],squel[_0x7e8b('0x6a')]()[_0x7e8b('0x6b')](_0x7e8b('0x67'),_0x7e8b('0x67'))[_0x7e8b('0x6b')]('NOW()','scheduledAt')['field']('id',_0x7e8b('0x6d'))['field'](_0x1246fb[_0x7e8b('0x6e')][_0x7e8b('0x6f')](),_0x7e8b('0x69'))[_0x7e8b('0x6b')](_0x3468aa['params']['id'][_0x7e8b('0x6f')](),'CampaignId')[_0x7e8b('0x6b')](_0x7e8b('0x6c'),_0x7e8b('0x54'))[_0x7e8b('0x6b')](_0x7e8b('0x6c'),_0x7e8b('0x53'))[_0x7e8b('0x7a')](_0x7e8b('0x70'))[_0x7e8b('0x3b')](_0x7e8b('0x7b'))['where'](_0x7e8b('0x71'),_0x1246fb[_0x7e8b('0x6e')][_0x7e8b('0x6f')]())[_0x7e8b('0x3b')](_0x7e8b('0x72'))[_0x7e8b('0x3b')](_0x7e8b('0x75'),squel['select']()[_0x7e8b('0x6b')](_0x7e8b('0x76'))[_0x7e8b('0x7a')](_0x7e8b('0x66'))[_0x7e8b('0x3b')](_0x7e8b('0x7c'),_0x3468aa[_0x7e8b('0x46')]['id'][_0x7e8b('0x6f')]())))['toString']();break;default:_0x458f01=squel['insert']()[_0x7e8b('0x7d')](_0x7e8b('0x66'))[_0x7e8b('0x79')]([_0x7e8b('0x67'),_0x7e8b('0x68'),'ContactId',_0x7e8b('0x69'),_0x7e8b('0x5a'),_0x7e8b('0x54'),'updatedAt'],squel[_0x7e8b('0x6a')]()[_0x7e8b('0x6b')](_0x7e8b('0x67'),'phone')['field'](_0x7e8b('0x6c'),'scheduledAt')[_0x7e8b('0x6b')]('id',_0x7e8b('0x6d'))[_0x7e8b('0x6b')](_0x1246fb['CmListId'][_0x7e8b('0x6f')](),_0x7e8b('0x69'))[_0x7e8b('0x6b')](_0x3468aa[_0x7e8b('0x46')]['id'][_0x7e8b('0x6f')](),_0x7e8b('0x5a'))[_0x7e8b('0x6b')](_0x7e8b('0x6c'),'createdAt')[_0x7e8b('0x6b')]('NOW()',_0x7e8b('0x53'))[_0x7e8b('0x7a')](_0x7e8b('0x70'))[_0x7e8b('0x3b')]('deletedAt\x20IS\x20NULL')[_0x7e8b('0x3b')]('ListId\x20=\x20?',_0x1246fb['CmListId'][_0x7e8b('0x6f')]())[_0x7e8b('0x3b')](_0x7e8b('0x72')))['toString']();}_0xc322cd[_0x7e8b('0x7e')](db[_0x7e8b('0x7f')][_0x7e8b('0x31')](_0x458f01));}return BPromise['all'](_0xc322cd);}})[_0x7e8b('0x23')](function(){return _0x3f49b6;})[_0x7e8b('0x23')](respondWithResult(_0x4cde13,null))[_0x7e8b('0x44')](handleError(_0x4cde13,null));};exports[_0x7e8b('0x80')]=function(_0x59d8b9,_0x2e901b,_0x27fe3e){return db[_0x7e8b('0x2b')][_0x7e8b('0x47')]({'where':{'id':_0x59d8b9[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0x2e901b,null))['then'](function(_0x2ce36e){if(_0x2ce36e){return _0x2ce36e[_0x7e8b('0x80')](_0x59d8b9[_0x7e8b('0x31')][_0x7e8b('0x62')]);}})[_0x7e8b('0x23')](function(_0x556313){if(_0x556313){return db[_0x7e8b('0x58')][_0x7e8b('0x24')]({'where':{'ListId':_0x59d8b9[_0x7e8b('0x31')][_0x7e8b('0x62')],'CampaignId':_0x59d8b9[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](function(){return _0x556313;});}})[_0x7e8b('0x23')](respondWithStatusCode(_0x2e901b,null))[_0x7e8b('0x44')](handleError(_0x2e901b,null));};exports[_0x7e8b('0x81')]=function(_0x1513c2,_0x1b757a,_0x1ce955){var _0x381ac8={};var _0x44eb2c={};var _0x3b98fb;var _0x43a413;return db['Campaign'][_0x7e8b('0x57')]({'where':{'id':_0x1513c2['params']['id']}})['then'](handleEntityNotFound(_0x1b757a,null))['then'](function(_0x343738){if(_0x343738){_0x3b98fb=_0x343738;_0x44eb2c['model']=_[_0x7e8b('0x32')](db[_0x7e8b('0x82')][_0x7e8b('0x2c')]);_0x44eb2c[_0x7e8b('0x31')]=_['keys'](_0x1513c2[_0x7e8b('0x31')]);_0x44eb2c[_0x7e8b('0x33')]=_['intersection'](_0x44eb2c[_0x7e8b('0x30')],_0x44eb2c[_0x7e8b('0x31')]);_0x381ac8['attributes']=_[_0x7e8b('0x34')](_0x44eb2c['model'],qs[_0x7e8b('0x35')](_0x1513c2[_0x7e8b('0x31')][_0x7e8b('0x35')]));_0x381ac8[_0x7e8b('0x36')]=_0x381ac8[_0x7e8b('0x36')][_0x7e8b('0x51')]?_0x381ac8[_0x7e8b('0x36')]:_0x44eb2c['model'];_0x381ac8['order']=qs[_0x7e8b('0x3a')](_0x1513c2[_0x7e8b('0x31')]['sort']);_0x381ac8[_0x7e8b('0x3b')]=qs[_0x7e8b('0x33')](_[_0x7e8b('0x59')](_0x1513c2[_0x7e8b('0x31')],_0x44eb2c[_0x7e8b('0x33')]));if(_0x1513c2[_0x7e8b('0x31')][_0x7e8b('0x3e')]){_0x381ac8[_0x7e8b('0x3b')]=_[_0x7e8b('0x3c')](_0x381ac8['where'],{'$or':_['map'](_0x381ac8[_0x7e8b('0x36')],function(_0x437e96){var _0x521bc8={};_0x521bc8[_0x437e96]={'$like':'%'+_0x1513c2['query'][_0x7e8b('0x3e')]+'%'};return _0x521bc8;})});}_0x381ac8=_['merge']({},_0x381ac8,_0x1513c2['options']);return _0x3b98fb[_0x7e8b('0x81')](_0x381ac8);}})[_0x7e8b('0x23')](function(_0x28ff14){if(_0x28ff14){_0x43a413=_0x28ff14[_0x7e8b('0x51')];if(!_0x1513c2[_0x7e8b('0x31')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x381ac8[_0x7e8b('0x1d')]=qs[_0x7e8b('0x1d')](_0x1513c2[_0x7e8b('0x31')]['limit']);_0x381ac8[_0x7e8b('0x1b')]=qs[_0x7e8b('0x1b')](_0x1513c2[_0x7e8b('0x31')][_0x7e8b('0x1b')]);}return _0x3b98fb['getBlackLists'](_0x381ac8);}})[_0x7e8b('0x23')](function(_0x4aed31){if(_0x4aed31){return _0x4aed31?{'count':_0x43a413,'rows':_0x4aed31}:null;}})[_0x7e8b('0x23')](respondWithResult(_0x1b757a,null))[_0x7e8b('0x44')](handleError(_0x1b757a,null));};exports[_0x7e8b('0x83')]=function(_0x1a5137,_0xda2cf0,_0xb4705b){var _0x2dfb93,_0x22bd4c;return db[_0x7e8b('0x2b')][_0x7e8b('0x47')]({'where':{'id':_0x1a5137[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](handleEntityNotFound(_0xda2cf0,null))[_0x7e8b('0x23')](function(_0x7fffad){if(_0x7fffad){_0x22bd4c=_0x7fffad;return _0x7fffad[_0x7e8b('0x83')](_0x1a5137[_0x7e8b('0x49')][_0x7e8b('0x62')],_[_0x7e8b('0x52')](_0x1a5137[_0x7e8b('0x49')],[_0x7e8b('0x62'),'id'])||{});}return null;})[_0x7e8b('0x63')](function(_0x5164e3){var _0xba0991;_0x2dfb93=_0x5164e3||[];var _0x58595f=[];if(_0x5164e3){for(var _0xd03330=0x0;_0xd03330<_0x5164e3[_0x7e8b('0x51')];_0xd03330+=0x1){var _0x5da31f=_0x5164e3[_0xd03330][_0x7e8b('0x25')]({'plain':!![]});_0xba0991=squel[_0x7e8b('0x78')]()[_0x7e8b('0x7d')](_0x7e8b('0x84'))[_0x7e8b('0x79')]([_0x7e8b('0x67'),_0x7e8b('0x6d'),_0x7e8b('0x69'),_0x7e8b('0x5a'),_0x7e8b('0x54'),'updatedAt'],squel['select']()[_0x7e8b('0x6b')](_0x7e8b('0x67'),'phone')['field']('id','ContactId')[_0x7e8b('0x6b')](_0x5da31f[_0x7e8b('0x6e')]['toString'](),_0x7e8b('0x69'))[_0x7e8b('0x6b')](_0x1a5137[_0x7e8b('0x46')]['id']['toString'](),_0x7e8b('0x5a'))[_0x7e8b('0x6b')](_0x7e8b('0x6c'),'createdAt')['field'](_0x7e8b('0x6c'),_0x7e8b('0x53'))[_0x7e8b('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x7e8b('0x3b')]('ListId\x20=\x20?',_0x5da31f[_0x7e8b('0x6e')][_0x7e8b('0x6f')]())[_0x7e8b('0x3b')](_0x7e8b('0x72')))[_0x7e8b('0x6f')]();_0x58595f[_0x7e8b('0x7e')](db['sequelize'][_0x7e8b('0x31')](_0xba0991));}return BPromise[_0x7e8b('0x85')](_0x58595f);}})[_0x7e8b('0x23')](function(){return _0x2dfb93;})[_0x7e8b('0x23')](respondWithResult(_0xda2cf0,null))[_0x7e8b('0x44')](handleError(_0xda2cf0,null));};exports['removeBlackLists']=function(_0x289eb5,_0x33239d,_0x31b7ef){return db[_0x7e8b('0x2b')][_0x7e8b('0x47')]({'where':{'id':_0x289eb5[_0x7e8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x33239d,null))['then'](function(_0x22a951){if(_0x22a951){return _0x22a951[_0x7e8b('0x86')](_0x289eb5[_0x7e8b('0x31')][_0x7e8b('0x62')]);}})[_0x7e8b('0x23')](function(_0x46be1e){if(_0x46be1e){return db['CmHopperBlack'][_0x7e8b('0x24')]({'where':{'ListId':_0x289eb5[_0x7e8b('0x31')][_0x7e8b('0x62')],'CampaignId':_0x289eb5[_0x7e8b('0x46')]['id']}})[_0x7e8b('0x23')](function(){return _0x46be1e;});}})[_0x7e8b('0x23')](respondWithStatusCode(_0x33239d,null))[_0x7e8b('0x44')](handleError(_0x33239d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b077acd..7c6e66a 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x34e46d,_0x5df86a){var _0x1cc6aa=function(_0x5a22f7){while(--_0x5a22f7){_0x34e46d['push'](_0x34e46d['shift']());}};_0x1cc6aa(++_0x5df86a);}(_0x7a54,0x106));var _0x47a5=function(_0xeb628b,_0x2bb519){_0xeb628b=_0xeb628b-0x0;var _0x4cd9ef=_0x7a54[_0xeb628b];return _0x4cd9ef;};'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 c1a2c80..0927cb8 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 _0x4a81=['include','model','attributes','map','GetCampaign','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','Campaign','findAll','options','raw','where','limit'];(function(_0x1818a2,_0x420df5){var _0x3089f8=function(_0x1d2261){while(--_0x1d2261){_0x1818a2['push'](_0x1818a2['shift']());}};_0x3089f8(++_0x420df5);}(_0x4a81,0x1b7));var _0x14a8=function(_0x4eee15,_0x31bb94){_0x4eee15=_0x4eee15-0x0;var _0xa6d424=_0x4a81[_0x4eee15];return _0xa6d424;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var moment=require(_0x14a8('0x2'));var BPromise=require(_0x14a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x14a8('0x5'))(_0x14a8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14a8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134295,_0x4f2829,_0x26e442){return new BPromise(function(_0x4271b5,_0x3ea48f){return client[_0x14a8('0x8')](_0x134295,_0x26e442)[_0x14a8('0x9')](function(_0x5d42cb){logger['info'](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));logger[_0x14a8('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4f2829,_0x14a8('0xb'),JSON[_0x14a8('0xd')](_0x5d42cb));if(_0x5d42cb[_0x14a8('0xe')]){if(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0xf')]===0x1f4){logger[_0x14a8('0xe')](_0x14a8('0xa'),_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x3ea48f(_0x5d42cb['error'][_0x14a8('0x10')]);}logger[_0x14a8('0xe')]('Campaign,\x20%s,\x20%s',_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x4271b5(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0x10')]);}else{logger[_0x14a8('0x11')](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));_0x4271b5(_0x5d42cb[_0x14a8('0x12')]['message']);}})[_0x14a8('0x13')](function(_0x30de2c){logger['error'](_0x14a8('0xa'),_0x4f2829,_0x30de2c);_0x3ea48f(_0x30de2c);});});}exports['GetCampaign']=function(_0x98e1d5){var _0x1dac45=this;return new Promise(function(_0x456b7f,_0x1069c8){return db[_0x14a8('0x14')][_0x14a8('0x15')]({'raw':_0x98e1d5['options']?_0x98e1d5[_0x14a8('0x16')][_0x14a8('0x17')]===undefined?!![]:![]:!![],'where':_0x98e1d5['options']?_0x98e1d5['options'][_0x14a8('0x18')]||null:null,'attributes':_0x98e1d5['options']?_0x98e1d5[_0x14a8('0x16')]['attributes']||null:null,'limit':_0x98e1d5[_0x14a8('0x16')]?_0x98e1d5['options'][_0x14a8('0x19')]||null:null,'include':_0x98e1d5[_0x14a8('0x16')]?_0x98e1d5[_0x14a8('0x16')][_0x14a8('0x1a')]?_['map'](_0x98e1d5[_0x14a8('0x16')]['include'],function(_0x2cee5e){return{'model':db[_0x2cee5e[_0x14a8('0x1b')]],'as':_0x2cee5e['as'],'attributes':_0x2cee5e[_0x14a8('0x1c')],'include':_0x2cee5e[_0x14a8('0x1a')]?_[_0x14a8('0x1d')](_0x2cee5e[_0x14a8('0x1a')],function(_0x1f251a){return{'model':db[_0x1f251a[_0x14a8('0x1b')]],'as':_0x1f251a['as'],'attributes':_0x1f251a['attributes'],'include':_0x1f251a[_0x14a8('0x1a')]?_[_0x14a8('0x1d')](_0x1f251a[_0x14a8('0x1a')],function(_0x26f11b){return{'model':db[_0x26f11b[_0x14a8('0x1b')]],'as':_0x26f11b['as'],'attributes':_0x26f11b[_0x14a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x14a8('0x9')](function(_0x37a780){logger[_0x14a8('0x11')](_0x14a8('0x1e'),_0x98e1d5);logger[_0x14a8('0xc')](_0x14a8('0x1e'),_0x98e1d5,JSON[_0x14a8('0xd')](_0x37a780));_0x456b7f(_0x37a780);})['catch'](function(_0x380e9a){logger[_0x14a8('0xe')]('GetCampaign',_0x380e9a[_0x14a8('0x10')],_0x98e1d5);_0x1069c8(_0x1dac45[_0x14a8('0xe')](0x1f4,_0x380e9a[_0x14a8('0x10')]));});});}; \ No newline at end of file +var _0x9c5e=['randomstring','../../config/logger','rpc','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','options','raw','limit','include','map','model','attributes','then','lodash','util','moment','bluebird'];(function(_0x3400bc,_0xc11841){var _0xb7c0fd=function(_0x81d091){while(--_0x81d091){_0x3400bc['push'](_0x3400bc['shift']());}};_0xb7c0fd(++_0xc11841);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x3c42bc,_0x3ca03d){_0x3c42bc=_0x3c42bc-0x0;var _0x128473=_0x9c5e[_0x3c42bc];return _0x128473;};'use strict';var _=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var moment=require(_0xe9c5('0x2'));var BPromise=require(_0xe9c5('0x3'));var rs=require(_0xe9c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9c5('0x5'))(_0xe9c5('0x6'));var config=require('../../config/environment');var jayson=require(_0xe9c5('0x7'));var client=jayson[_0xe9c5('0x8')][_0xe9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6f6045,_0x5b1c04,_0x2fa290){return new BPromise(function(_0x34ee69,_0x228ef3){return client[_0xe9c5('0xa')](_0x6f6045,_0x2fa290)['then'](function(_0x596f4c){logger[_0xe9c5('0xb')](_0xe9c5('0xc'),_0x5b1c04,_0xe9c5('0xd'));logger[_0xe9c5('0xe')](_0xe9c5('0xf'),_0x5b1c04,_0xe9c5('0xd'),JSON[_0xe9c5('0x10')](_0x596f4c));if(_0x596f4c[_0xe9c5('0x11')]){if(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x12')]===0x1f4){logger[_0xe9c5('0x11')](_0xe9c5('0xc'),_0x5b1c04,_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);return _0x228ef3(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);}logger['error'](_0xe9c5('0xc'),_0x5b1c04,_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);return _0x34ee69(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);}else{logger[_0xe9c5('0xb')]('Campaign,\x20%s,\x20%s',_0x5b1c04,_0xe9c5('0xd'));_0x34ee69(_0x596f4c[_0xe9c5('0x14')]['message']);}})[_0xe9c5('0x15')](function(_0x45d18d){logger[_0xe9c5('0x11')](_0xe9c5('0xc'),_0x5b1c04,_0x45d18d);_0x228ef3(_0x45d18d);});});}exports[_0xe9c5('0x16')]=function(_0x4d9c7d){var _0x3678fc=this;return new Promise(function(_0x1cecae,_0x2f050b){return db[_0xe9c5('0x17')]['findAll']({'raw':_0x4d9c7d[_0xe9c5('0x18')]?_0x4d9c7d[_0xe9c5('0x18')][_0xe9c5('0x19')]===undefined?!![]:![]:!![],'where':_0x4d9c7d[_0xe9c5('0x18')]?_0x4d9c7d[_0xe9c5('0x18')]['where']||null:null,'attributes':_0x4d9c7d['options']?_0x4d9c7d[_0xe9c5('0x18')]['attributes']||null:null,'limit':_0x4d9c7d[_0xe9c5('0x18')]?_0x4d9c7d[_0xe9c5('0x18')][_0xe9c5('0x1a')]||null:null,'include':_0x4d9c7d[_0xe9c5('0x18')]?_0x4d9c7d['options'][_0xe9c5('0x1b')]?_[_0xe9c5('0x1c')](_0x4d9c7d[_0xe9c5('0x18')][_0xe9c5('0x1b')],function(_0x34a7c8){return{'model':db[_0x34a7c8[_0xe9c5('0x1d')]],'as':_0x34a7c8['as'],'attributes':_0x34a7c8[_0xe9c5('0x1e')],'include':_0x34a7c8[_0xe9c5('0x1b')]?_[_0xe9c5('0x1c')](_0x34a7c8[_0xe9c5('0x1b')],function(_0x5a3caa){return{'model':db[_0x5a3caa['model']],'as':_0x5a3caa['as'],'attributes':_0x5a3caa[_0xe9c5('0x1e')],'include':_0x5a3caa[_0xe9c5('0x1b')]?_[_0xe9c5('0x1c')](_0x5a3caa[_0xe9c5('0x1b')],function(_0x33fe71){return{'model':db[_0x33fe71[_0xe9c5('0x1d')]],'as':_0x33fe71['as'],'attributes':_0x33fe71['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9c5('0x1f')](function(_0x480187){logger[_0xe9c5('0xb')]('GetCampaign',_0x4d9c7d);logger[_0xe9c5('0xe')](_0xe9c5('0x16'),_0x4d9c7d,JSON['stringify'](_0x480187));_0x1cecae(_0x480187);})[_0xe9c5('0x15')](function(_0x46d253){logger[_0xe9c5('0x11')](_0xe9c5('0x16'),_0x46d253[_0xe9c5('0x13')],_0x4d9c7d);_0x2f050b(_0x3678fc['error'](0x1f4,_0x46d253[_0xe9c5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0557014..6ee6bba 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 _0x5347=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addBlackLists','put','update','delete','destroy','removeBlackLists','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x2327df,_0x4f6707){var _0x5c48ef=function(_0x235308){while(--_0x235308){_0x2327df['push'](_0x2327df['shift']());}};_0x5c48ef(++_0x4f6707);}(_0x5347,0x19a));var _0x7534=function(_0x37b83f,_0x29a8f7){_0x37b83f=_0x37b83f-0x0;var _0x1fbac1=_0x5347[_0x37b83f];return _0x1fbac1;};'use strict';var multer=require('multer');var util=require(_0x7534('0x0'));var path=require(_0x7534('0x1'));var timeout=require(_0x7534('0x2'));var express=require(_0x7534('0x3'));var router=express['Router']();var fs_extra=require(_0x7534('0x4'));var auth=require(_0x7534('0x5'));var interaction=require(_0x7534('0x6'));var config=require('../../config/environment');var controller=require(_0x7534('0x7'));router[_0x7534('0x8')]('/',auth[_0x7534('0x9')](),controller[_0x7534('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7534('0xb')]);router[_0x7534('0x8')](_0x7534('0xc'),auth[_0x7534('0x9')](),controller[_0x7534('0xd')]);router[_0x7534('0x8')]('/:id/hopper_histories',auth[_0x7534('0x9')](),controller[_0x7534('0xe')]);router['get'](_0x7534('0xf'),auth[_0x7534('0x9')](),controller[_0x7534('0x10')]);router[_0x7534('0x8')](_0x7534('0x11'),auth[_0x7534('0x9')](),controller[_0x7534('0x12')]);router[_0x7534('0x8')]('/:id/lists',auth[_0x7534('0x9')](),controller[_0x7534('0x13')]);router[_0x7534('0x8')](_0x7534('0x14'),auth[_0x7534('0x9')](),controller[_0x7534('0x15')]);router[_0x7534('0x16')]('/',auth[_0x7534('0x9')](),controller[_0x7534('0x17')]);router[_0x7534('0x16')](_0x7534('0x18'),auth[_0x7534('0x9')](),controller[_0x7534('0x19')]);router[_0x7534('0x16')](_0x7534('0x1a'),auth['isAuthenticated'](),controller['addLists']);router[_0x7534('0x16')](_0x7534('0x14'),auth[_0x7534('0x9')](),controller[_0x7534('0x1b')]);router[_0x7534('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7534('0x1d')]);router[_0x7534('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x7534('0x1f')]);router[_0x7534('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0x7534('0x1e')](_0x7534('0x14'),auth[_0x7534('0x9')](),controller[_0x7534('0x20')]);module['exports']=router; \ No newline at end of file +var _0xbfc2=['clone','addLists','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','get','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/blacklists','getBlackLists','post','/:id/clone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfc2,0xcc));var _0x2bfc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbfc2[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x2bfc('0x0'));var path=require(_0x2bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bfc('0x2'));var router=express[_0x2bfc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2bfc('0x4'));var interaction=require(_0x2bfc('0x5'));var config=require(_0x2bfc('0x6'));var controller=require(_0x2bfc('0x7'));router['get']('/',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x9')]);router['get'](_0x2bfc('0xa'),auth[_0x2bfc('0x8')](),controller['show']);router[_0x2bfc('0xb')]('/:id/hoppers',auth[_0x2bfc('0x8')](),controller['getHoppers']);router[_0x2bfc('0xb')]('/:id/hopper_histories',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0xc')]);router[_0x2bfc('0xb')](_0x2bfc('0xd'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0xe')]);router['get'](_0x2bfc('0xf'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x2bfc('0xb')]('/:id/lists',auth[_0x2bfc('0x8')](),controller['getLists']);router[_0x2bfc('0xb')](_0x2bfc('0x10'),auth['isAuthenticated'](),controller[_0x2bfc('0x11')]);router[_0x2bfc('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2bfc('0x12')](_0x2bfc('0x13'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x14')]);router[_0x2bfc('0x12')]('/:id/lists',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x15')]);router['post'](_0x2bfc('0x10'),auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x2bfc('0xa'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x16')]);router[_0x2bfc('0x17')]('/:id',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x18')]);router['delete'](_0x2bfc('0x19'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x1a')]);router[_0x2bfc('0x17')](_0x2bfc('0x10'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 7973d89..a0e631e 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 _0xed62=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x59f721,_0x1b9643){var _0x20df8d=function(_0x50a486){while(--_0x50a486){_0x59f721['push'](_0x59f721['shift']());}};_0x20df8d(++_0x1b9643);}(_0xed62,0x9d));var _0x2ed6=function(_0x5d26c7,_0x47a139){_0x5d26c7=_0x5d26c7-0x0;var _0xaeff34=_0xed62[_0x5d26c7];return _0xaeff34;};'use strict';var Sequelize=require(_0x2ed6('0x0'));module[_0x2ed6('0x1')]={'key':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2ed6('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x2ed6('0x2')]},'name':{'type':Sequelize[_0x2ed6('0x4')],'get':function(){return this[_0x2ed6('0x5')](_0x2ed6('0x6'));}}}; \ No newline at end of file +var _0x0480=['exports','STRING','TEXT','getDataValue','key','sequelize'];(function(_0x117254,_0x29dacf){var _0x3cc1d9=function(_0x2f1f35){while(--_0x2f1f35){_0x117254['push'](_0x117254['shift']());}};_0x3cc1d9(++_0x29dacf);}(_0x0480,0x6b));var _0x0048=function(_0x5c9a98,_0x2e4702){_0x5c9a98=_0x5c9a98-0x0;var _0x57ed3e=_0x0480[_0x5c9a98];return _0x57ed3e;};'use strict';var Sequelize=require(_0x0048('0x0'));module[_0x0048('0x1')]={'key':{'type':Sequelize[_0x0048('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0048('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x0048('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0048('0x4')](_0x0048('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e206c5a..a052160 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 _0x1e1a=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','key','model','map','query','keys','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','attributes','length','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x185c76,_0x534cc3){var _0x7820b7=function(_0x3bcd58){while(--_0x3bcd58){_0x185c76['push'](_0x185c76['shift']());}};_0x7820b7(++_0x534cc3);}(_0x1e1a,0x1a0));var _0xa1e1=function(_0x128fb5,_0x5276ba){_0x128fb5=_0x128fb5-0x0;var _0x3c498b=_0x1e1a[_0x128fb5];return _0x3c498b;};'use strict';var emlformat=require(_0xa1e1('0x0'));var rimraf=require(_0xa1e1('0x1'));var zipdir=require(_0xa1e1('0x2'));var jsonpatch=require(_0xa1e1('0x3'));var rp=require('request-promise');var moment=require(_0xa1e1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1e1('0x5'));var util=require(_0xa1e1('0x6'));var path=require(_0xa1e1('0x7'));var sox=require(_0xa1e1('0x8'));var csv=require(_0xa1e1('0x9'));var ejs=require(_0xa1e1('0xa'));var fs=require('fs');var fs_extra=require(_0xa1e1('0xb'));var _=require(_0xa1e1('0xc'));var squel=require(_0xa1e1('0xd'));var crypto=require(_0xa1e1('0xe'));var jsforce=require(_0xa1e1('0xf'));var deskjs=require(_0xa1e1('0x10'));var toCsv=require(_0xa1e1('0x9'));var querystring=require(_0xa1e1('0x11'));var Papa=require(_0xa1e1('0x12'));var Redis=require('ioredis');var authService=require(_0xa1e1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1e1('0x14'));var logger=require(_0xa1e1('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa1e1('0x16'));var licenseUtil=require(_0xa1e1('0x17'));var db=require(_0xa1e1('0x18'))['db'];function respondWithStatusCode(_0x3db84f,_0x328536){_0x328536=_0x328536||0xcc;return function(_0x402885){if(_0x402885){return _0x3db84f[_0xa1e1('0x19')](_0x328536);}return _0x3db84f[_0xa1e1('0x1a')](_0x328536)[_0xa1e1('0x1b')]();};}function respondWithResult(_0x2d5f25,_0x195fd8){_0x195fd8=_0x195fd8||0xc8;return function(_0x48d9e4){if(_0x48d9e4){return _0x2d5f25['status'](_0x195fd8)[_0xa1e1('0x1c')](_0x48d9e4);}};}function respondWithFilteredResult(_0x16dbac,_0x2445db){return function(_0x3a6f2f){if(_0x3a6f2f){var _0x18bd34=typeof _0x2445db[_0xa1e1('0x1d')]===_0xa1e1('0x1e')&&typeof _0x2445db[_0xa1e1('0x1f')]===_0xa1e1('0x1e');var _0x5339ac=_0x3a6f2f['count'];var _0x2ca88f=_0x18bd34?0x0:_0x2445db[_0xa1e1('0x1d')];var _0x11b0bb=_0x18bd34?_0x3a6f2f[_0xa1e1('0x20')]:_0x2445db[_0xa1e1('0x1d')]+_0x2445db[_0xa1e1('0x1f')];var _0x5a61ba;if(_0x11b0bb>=_0x5339ac){_0x11b0bb=_0x5339ac;_0x5a61ba=0xc8;}else{_0x5a61ba=0xce;}_0x16dbac[_0xa1e1('0x1a')](_0x5a61ba);return _0x16dbac['set']('Content-Range',_0x2ca88f+'-'+_0x11b0bb+'/'+_0x5339ac)[_0xa1e1('0x1c')](_0x3a6f2f);}return null;};}function patchUpdates(_0x5e7164){return function(_0x473779){try{jsonpatch[_0xa1e1('0x21')](_0x473779,_0x5e7164,!![]);}catch(_0x4abbf9){return BPromise['reject'](_0x4abbf9);}return _0x473779[_0xa1e1('0x22')]();};}function saveUpdates(_0x6d8c29,_0x3fa4c2){return function(_0x23ff90){if(_0x23ff90){return _0x23ff90[_0xa1e1('0x23')](_0x6d8c29)[_0xa1e1('0x24')](function(_0x299ce2){return _0x299ce2;});}return null;};}function removeEntity(_0x360eaf,_0x29e35c){return function(_0x2a3c8c){if(_0x2a3c8c){return _0x2a3c8c[_0xa1e1('0x25')]()[_0xa1e1('0x24')](function(){var _0x2ffeb8=_0x2a3c8c['get']({'plain':!![]});var _0x4bb8a6=_0xa1e1('0x26');return db[_0xa1e1('0x27')][_0xa1e1('0x25')]({'where':{'type':_0x4bb8a6,'resourceId':_0x2ffeb8['id']}})['then'](function(){return _0x2a3c8c;});})[_0xa1e1('0x24')](function(){_0x360eaf[_0xa1e1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ded0f,_0x5694ef){return function(_0x4e338a){if(!_0x4e338a){_0x2ded0f[_0xa1e1('0x19')](0x194);}return _0x4e338a;};}function handleError(_0x5ae56b,_0x5625ed){_0x5625ed=_0x5625ed||0x1f4;return function(_0x4b7042){logger[_0xa1e1('0x28')](_0x4b7042['stack']);if(_0x4b7042[_0xa1e1('0x29')]){delete _0x4b7042[_0xa1e1('0x29')];}_0x5ae56b[_0xa1e1('0x1a')](_0x5625ed)[_0xa1e1('0x2a')](_0x4b7042);};}exports[_0xa1e1('0x2b')]=function(_0x322130,_0x5bc15a){var _0x1f26aa={},_0x38e063={},_0x1f366c={'count':0x0,'rows':[]};var _0x19bfb6=_['map'](db[_0xa1e1('0x2c')][_0xa1e1('0x2d')],function(_0x279486){return{'name':_0x279486['fieldName'],'type':_0x279486['type'][_0xa1e1('0x2e')]};});_0x38e063[_0xa1e1('0x2f')]=_[_0xa1e1('0x30')](_0x19bfb6,_0xa1e1('0x29'));_0x38e063[_0xa1e1('0x31')]=_[_0xa1e1('0x32')](_0x322130[_0xa1e1('0x31')]);_0x38e063['filters']=_[_0xa1e1('0x33')](_0x38e063[_0xa1e1('0x2f')],_0x38e063[_0xa1e1('0x31')]);_0x1f26aa['attributes']=_[_0xa1e1('0x33')](_0x38e063[_0xa1e1('0x2f')],qs[_0xa1e1('0x34')](_0x322130[_0xa1e1('0x31')]['fields']));_0x1f26aa['attributes']=_0x1f26aa['attributes']['length']?_0x1f26aa['attributes']:_0x38e063[_0xa1e1('0x2f')];if(!_0x322130[_0xa1e1('0x31')][_0xa1e1('0x35')](_0xa1e1('0x36'))){_0x1f26aa[_0xa1e1('0x1f')]=qs[_0xa1e1('0x1f')](_0x322130[_0xa1e1('0x31')][_0xa1e1('0x1f')]);_0x1f26aa['offset']=qs[_0xa1e1('0x1d')](_0x322130[_0xa1e1('0x31')][_0xa1e1('0x1d')]);}_0x1f26aa[_0xa1e1('0x37')]=qs['sort'](_0x322130[_0xa1e1('0x31')][_0xa1e1('0x38')]);_0x1f26aa[_0xa1e1('0x39')]=qs[_0xa1e1('0x3a')](_[_0xa1e1('0x3b')](_0x322130[_0xa1e1('0x31')],_0x38e063[_0xa1e1('0x3a')]),_0x19bfb6);if(_0x322130['query'][_0xa1e1('0x3c')]){_0x1f26aa['where']=_[_0xa1e1('0x3d')](_0x1f26aa[_0xa1e1('0x39')],{'$or':[{'key':{'$like':'%'+_0x322130[_0xa1e1('0x31')][_0xa1e1('0x3c')]+'%'}},{'value':{'$like':'%'+_0x322130[_0xa1e1('0x31')][_0xa1e1('0x3c')]+'%'}}]});}_0x1f26aa=_[_0xa1e1('0x3d')]({},_0x1f26aa,_0x322130['options']);var _0x28f246={'where':_0x1f26aa[_0xa1e1('0x39')]};return db[_0xa1e1('0x2c')][_0xa1e1('0x20')](_0x28f246)['then'](function(_0x4d3b88){_0x1f366c[_0xa1e1('0x20')]=_0x4d3b88;if(_0x322130['query'][_0xa1e1('0x3e')]){_0x1f26aa[_0xa1e1('0x3f')]=[{'all':!![]}];}return db[_0xa1e1('0x2c')][_0xa1e1('0x40')](_0x1f26aa);})[_0xa1e1('0x24')](function(_0x1d1223){_0x1f366c[_0xa1e1('0x41')]=_0x1d1223;return _0x1f366c;})[_0xa1e1('0x24')](respondWithFilteredResult(_0x5bc15a,_0x1f26aa))[_0xa1e1('0x42')](handleError(_0x5bc15a,null));};exports[_0xa1e1('0x43')]=function(_0x1b6d39,_0x32b6d4){var _0x5a8fbc={'raw':!![],'where':{'id':_0x1b6d39['params']['id']}},_0x2ba029={};_0x2ba029[_0xa1e1('0x2f')]=_['keys'](db[_0xa1e1('0x2c')][_0xa1e1('0x2d')]);_0x2ba029[_0xa1e1('0x31')]=_['keys'](_0x1b6d39[_0xa1e1('0x31')]);_0x2ba029[_0xa1e1('0x3a')]=_[_0xa1e1('0x33')](_0x2ba029[_0xa1e1('0x2f')],_0x2ba029[_0xa1e1('0x31')]);_0x5a8fbc['attributes']=_[_0xa1e1('0x33')](_0x2ba029[_0xa1e1('0x2f')],qs[_0xa1e1('0x34')](_0x1b6d39[_0xa1e1('0x31')][_0xa1e1('0x34')]));_0x5a8fbc[_0xa1e1('0x44')]=_0x5a8fbc['attributes'][_0xa1e1('0x45')]?_0x5a8fbc['attributes']:_0x2ba029[_0xa1e1('0x2f')];if(_0x1b6d39[_0xa1e1('0x31')][_0xa1e1('0x3e')]){_0x5a8fbc[_0xa1e1('0x3f')]=[{'all':!![]}];}_0x5a8fbc=_[_0xa1e1('0x3d')]({},_0x5a8fbc,_0x1b6d39[_0xa1e1('0x46')]);return db[_0xa1e1('0x2c')][_0xa1e1('0x47')](_0x5a8fbc)[_0xa1e1('0x24')](handleEntityNotFound(_0x32b6d4,null))[_0xa1e1('0x24')](respondWithResult(_0x32b6d4,null))['catch'](handleError(_0x32b6d4,null));};exports[_0xa1e1('0x23')]=function(_0xa975fa,_0x4813a9){if(_0xa975fa[_0xa1e1('0x48')]['id']){delete _0xa975fa['body']['id'];}return db[_0xa1e1('0x2c')][_0xa1e1('0x47')]({'where':{'id':_0xa975fa[_0xa1e1('0x49')]['id']}})['then'](handleEntityNotFound(_0x4813a9,null))[_0xa1e1('0x24')](saveUpdates(_0xa975fa[_0xa1e1('0x48')],null))[_0xa1e1('0x24')](respondWithResult(_0x4813a9,null))[_0xa1e1('0x42')](handleError(_0x4813a9,null));};exports['destroy']=function(_0x583f8d,_0x4ad784){return db[_0xa1e1('0x2c')][_0xa1e1('0x47')]({'where':{'id':_0x583f8d[_0xa1e1('0x49')]['id']}})[_0xa1e1('0x24')](handleEntityNotFound(_0x4ad784,null))['then'](removeEntity(_0x4ad784,null))[_0xa1e1('0x42')](handleError(_0x4ad784,null));};exports[_0xa1e1('0x4a')]=function(_0x3e70c3,_0x7618e1){var _0x3ce62e={'key':_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x2e')]};if(_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4b')]){_0x3ce62e[_0xa1e1('0x4b')]=_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4b')];}else if(_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4c')]){_0x3ce62e[_0xa1e1('0x4c')]=_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4c')];}else if(_0x3e70c3[_0xa1e1('0x48')]['OpenchannelAccountId']){_0x3ce62e[_0xa1e1('0x4d')]=_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4d')];}else if(_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4e')]){_0x3ce62e['ChatWebsiteId']=_0x3e70c3[_0xa1e1('0x48')][_0xa1e1('0x4e')];}return db['CannedAnswer'][_0xa1e1('0x47')]({'where':_0x3ce62e})[_0xa1e1('0x24')](function(_0x3b009c){if(_0x3b009c){throw new db[(_0xa1e1('0x4f'))][(_0xa1e1('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xa1e1('0x2c')][_0xa1e1('0x4a')](_0x3e70c3[_0xa1e1('0x48')]);})[_0xa1e1('0x24')](function(_0x103a09){var _0x1d54a5=_0x3e70c3[_0xa1e1('0x51')][_0xa1e1('0x52')]({'plain':!![]});if(!_0x1d54a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d54a5['role']===_0xa1e1('0x51')){var _0x9f7ffe=_0x103a09['get']({'plain':!![]});return db[_0xa1e1('0x53')][_0xa1e1('0x47')]({'where':{'name':_0xa1e1('0x26'),'userProfileId':_0x1d54a5['userProfileId']},'raw':!![]})[_0xa1e1('0x24')](function(_0x522d2d){if(_0x522d2d&&_0x522d2d[_0xa1e1('0x54')]===0x0){return db[_0xa1e1('0x27')]['create']({'name':_0x9f7ffe[_0xa1e1('0x29')],'resourceId':_0x9f7ffe['id'],'type':_0x522d2d['name'],'sectionId':_0x522d2d['id']},{})[_0xa1e1('0x24')](function(){return _0x103a09;});}else{return _0x103a09;}})[_0xa1e1('0x42')](function(_0x13e225){logger[_0xa1e1('0x28')](_0xa1e1('0x55'),_0x13e225);throw _0x13e225;});}return _0x103a09;})[_0xa1e1('0x24')](respondWithResult(_0x7618e1,0xc9))[_0xa1e1('0x42')](handleError(_0x7618e1,null));}; \ No newline at end of file +var _0x0d27=['status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','include','findAll','rows','catch','show','length','includeAll','options','find','body','params','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end'];(function(_0x10ac84,_0x363f02){var _0x166c3b=function(_0x940ef){while(--_0x940ef){_0x10ac84['push'](_0x10ac84['shift']());}};_0x166c3b(++_0x363f02);}(_0x0d27,0x153));var _0x70d2=function(_0x10c1db,_0x2cf37e){_0x10c1db=_0x10c1db-0x0;var _0x2a10ca=_0x0d27[_0x10c1db];return _0x2a10ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70d2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70d2('0x1'));var rp=require('request-promise');var moment=require(_0x70d2('0x2'));var BPromise=require(_0x70d2('0x3'));var Mustache=require(_0x70d2('0x4'));var util=require(_0x70d2('0x5'));var path=require(_0x70d2('0x6'));var sox=require(_0x70d2('0x7'));var csv=require(_0x70d2('0x8'));var ejs=require(_0x70d2('0x9'));var fs=require('fs');var fs_extra=require(_0x70d2('0xa'));var _=require(_0x70d2('0xb'));var squel=require('squel');var crypto=require(_0x70d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x70d2('0xd'));var toCsv=require(_0x70d2('0x8'));var querystring=require(_0x70d2('0xe'));var Papa=require(_0x70d2('0xf'));var Redis=require(_0x70d2('0x10'));var authService=require(_0x70d2('0x11'));var qs=require(_0x70d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x70d2('0x13'));var logger=require(_0x70d2('0x14'))('api');var utils=require(_0x70d2('0x15'));var config=require(_0x70d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x70d2('0x17'))['db'];function respondWithStatusCode(_0x280fc5,_0x4d2cbb){_0x4d2cbb=_0x4d2cbb||0xcc;return function(_0x447251){if(_0x447251){return _0x280fc5['sendStatus'](_0x4d2cbb);}return _0x280fc5['status'](_0x4d2cbb)[_0x70d2('0x18')]();};}function respondWithResult(_0x7eac17,_0x18e8e5){_0x18e8e5=_0x18e8e5||0xc8;return function(_0x45623a){if(_0x45623a){return _0x7eac17[_0x70d2('0x19')](_0x18e8e5)[_0x70d2('0x1a')](_0x45623a);}};}function respondWithFilteredResult(_0x26f5d8,_0x4c712e){return function(_0x56c04a){if(_0x56c04a){var _0x538184=typeof _0x4c712e[_0x70d2('0x1b')]==='undefined'&&typeof _0x4c712e['limit']===_0x70d2('0x1c');var _0x51febd=_0x56c04a[_0x70d2('0x1d')];var _0x3c09cf=_0x538184?0x0:_0x4c712e[_0x70d2('0x1b')];var _0x2c4f3d=_0x538184?_0x56c04a[_0x70d2('0x1d')]:_0x4c712e['offset']+_0x4c712e[_0x70d2('0x1e')];var _0x36683d;if(_0x2c4f3d>=_0x51febd){_0x2c4f3d=_0x51febd;_0x36683d=0xc8;}else{_0x36683d=0xce;}_0x26f5d8[_0x70d2('0x19')](_0x36683d);return _0x26f5d8['set'](_0x70d2('0x1f'),_0x3c09cf+'-'+_0x2c4f3d+'/'+_0x51febd)[_0x70d2('0x1a')](_0x56c04a);}return null;};}function patchUpdates(_0xd66557){return function(_0x333f34){try{jsonpatch[_0x70d2('0x20')](_0x333f34,_0xd66557,!![]);}catch(_0x1b28fc){return BPromise['reject'](_0x1b28fc);}return _0x333f34[_0x70d2('0x21')]();};}function saveUpdates(_0x589b8b,_0x493b22){return function(_0x146efe){if(_0x146efe){return _0x146efe[_0x70d2('0x22')](_0x589b8b)[_0x70d2('0x23')](function(_0x5f2217){return _0x5f2217;});}return null;};}function removeEntity(_0xe452a4,_0x45aa67){return function(_0x47e051){if(_0x47e051){return _0x47e051['destroy']()[_0x70d2('0x23')](function(){var _0x262d46=_0x47e051[_0x70d2('0x24')]({'plain':!![]});var _0x4eaf23=_0x70d2('0x25');return db[_0x70d2('0x26')]['destroy']({'where':{'type':_0x4eaf23,'resourceId':_0x262d46['id']}})[_0x70d2('0x23')](function(){return _0x47e051;});})['then'](function(){_0xe452a4[_0x70d2('0x19')](0xcc)[_0x70d2('0x18')]();});}};}function handleEntityNotFound(_0x5ad7f0,_0x155657){return function(_0x5aba19){if(!_0x5aba19){_0x5ad7f0[_0x70d2('0x27')](0x194);}return _0x5aba19;};}function handleError(_0x4a7db4,_0x177e6e){_0x177e6e=_0x177e6e||0x1f4;return function(_0x4eae0d){logger[_0x70d2('0x28')](_0x4eae0d[_0x70d2('0x29')]);if(_0x4eae0d[_0x70d2('0x2a')]){delete _0x4eae0d[_0x70d2('0x2a')];}_0x4a7db4[_0x70d2('0x19')](_0x177e6e)[_0x70d2('0x2b')](_0x4eae0d);};}exports[_0x70d2('0x2c')]=function(_0x4496fe,_0x13c3cb){var _0x45791d={},_0x1e20b0={},_0x57004d={'count':0x0,'rows':[]};var _0x50a358=_['map'](db[_0x70d2('0x2d')][_0x70d2('0x2e')],function(_0x8bf3f5){return{'name':_0x8bf3f5[_0x70d2('0x2f')],'type':_0x8bf3f5[_0x70d2('0x30')][_0x70d2('0x31')]};});_0x1e20b0[_0x70d2('0x32')]=_['map'](_0x50a358,_0x70d2('0x2a'));_0x1e20b0['query']=_[_0x70d2('0x33')](_0x4496fe['query']);_0x1e20b0['filters']=_[_0x70d2('0x34')](_0x1e20b0[_0x70d2('0x32')],_0x1e20b0[_0x70d2('0x35')]);_0x45791d['attributes']=_['intersection'](_0x1e20b0[_0x70d2('0x32')],qs['fields'](_0x4496fe['query'][_0x70d2('0x36')]));_0x45791d[_0x70d2('0x37')]=_0x45791d[_0x70d2('0x37')]['length']?_0x45791d[_0x70d2('0x37')]:_0x1e20b0['model'];if(!_0x4496fe[_0x70d2('0x35')][_0x70d2('0x38')](_0x70d2('0x39'))){_0x45791d[_0x70d2('0x1e')]=qs[_0x70d2('0x1e')](_0x4496fe['query'][_0x70d2('0x1e')]);_0x45791d[_0x70d2('0x1b')]=qs[_0x70d2('0x1b')](_0x4496fe[_0x70d2('0x35')]['offset']);}_0x45791d[_0x70d2('0x3a')]=qs['sort'](_0x4496fe['query'][_0x70d2('0x3b')]);_0x45791d['where']=qs[_0x70d2('0x3c')](_[_0x70d2('0x3d')](_0x4496fe[_0x70d2('0x35')],_0x1e20b0[_0x70d2('0x3c')]),_0x50a358);if(_0x4496fe[_0x70d2('0x35')][_0x70d2('0x3e')]){_0x45791d[_0x70d2('0x3f')]=_[_0x70d2('0x40')](_0x45791d['where'],{'$or':[{'key':{'$like':'%'+_0x4496fe[_0x70d2('0x35')][_0x70d2('0x3e')]+'%'}},{'value':{'$like':'%'+_0x4496fe['query'][_0x70d2('0x3e')]+'%'}}]});}_0x45791d=_['merge']({},_0x45791d,_0x4496fe['options']);var _0x505aaf={'where':_0x45791d[_0x70d2('0x3f')]};return db['CannedAnswer'][_0x70d2('0x1d')](_0x505aaf)[_0x70d2('0x23')](function(_0x3904ea){_0x57004d[_0x70d2('0x1d')]=_0x3904ea;if(_0x4496fe[_0x70d2('0x35')]['includeAll']){_0x45791d[_0x70d2('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x70d2('0x42')](_0x45791d);})[_0x70d2('0x23')](function(_0x36ac8b){_0x57004d[_0x70d2('0x43')]=_0x36ac8b;return _0x57004d;})[_0x70d2('0x23')](respondWithFilteredResult(_0x13c3cb,_0x45791d))[_0x70d2('0x44')](handleError(_0x13c3cb,null));};exports[_0x70d2('0x45')]=function(_0x4437a7,_0x1507ba){var _0xc93184={'raw':!![],'where':{'id':_0x4437a7['params']['id']}},_0x4e422a={};_0x4e422a[_0x70d2('0x32')]=_[_0x70d2('0x33')](db['CannedAnswer'][_0x70d2('0x2e')]);_0x4e422a[_0x70d2('0x35')]=_[_0x70d2('0x33')](_0x4437a7['query']);_0x4e422a['filters']=_[_0x70d2('0x34')](_0x4e422a[_0x70d2('0x32')],_0x4e422a[_0x70d2('0x35')]);_0xc93184[_0x70d2('0x37')]=_[_0x70d2('0x34')](_0x4e422a[_0x70d2('0x32')],qs['fields'](_0x4437a7['query'][_0x70d2('0x36')]));_0xc93184[_0x70d2('0x37')]=_0xc93184[_0x70d2('0x37')][_0x70d2('0x46')]?_0xc93184[_0x70d2('0x37')]:_0x4e422a[_0x70d2('0x32')];if(_0x4437a7[_0x70d2('0x35')][_0x70d2('0x47')]){_0xc93184['include']=[{'all':!![]}];}_0xc93184=_[_0x70d2('0x40')]({},_0xc93184,_0x4437a7[_0x70d2('0x48')]);return db['CannedAnswer'][_0x70d2('0x49')](_0xc93184)[_0x70d2('0x23')](handleEntityNotFound(_0x1507ba,null))[_0x70d2('0x23')](respondWithResult(_0x1507ba,null))[_0x70d2('0x44')](handleError(_0x1507ba,null));};exports[_0x70d2('0x22')]=function(_0x2276ae,_0x4ea9ef){if(_0x2276ae[_0x70d2('0x4a')]['id']){delete _0x2276ae['body']['id'];}return db[_0x70d2('0x2d')][_0x70d2('0x49')]({'where':{'id':_0x2276ae[_0x70d2('0x4b')]['id']}})[_0x70d2('0x23')](handleEntityNotFound(_0x4ea9ef,null))[_0x70d2('0x23')](saveUpdates(_0x2276ae[_0x70d2('0x4a')],null))['then'](respondWithResult(_0x4ea9ef,null))[_0x70d2('0x44')](handleError(_0x4ea9ef,null));};exports[_0x70d2('0x4c')]=function(_0x5572be,_0x397508){return db[_0x70d2('0x2d')][_0x70d2('0x49')]({'where':{'id':_0x5572be[_0x70d2('0x4b')]['id']}})[_0x70d2('0x23')](handleEntityNotFound(_0x397508,null))[_0x70d2('0x23')](removeEntity(_0x397508,null))[_0x70d2('0x44')](handleError(_0x397508,null));};exports[_0x70d2('0x4d')]=function(_0xa980bf,_0x380225){var _0x13c750={'key':_0xa980bf['body'][_0x70d2('0x31')]};if(_0xa980bf[_0x70d2('0x4a')][_0x70d2('0x4e')]){_0x13c750['MailAccountId']=_0xa980bf[_0x70d2('0x4a')][_0x70d2('0x4e')];}else if(_0xa980bf['body'][_0x70d2('0x4f')]){_0x13c750['SmsAccountId']=_0xa980bf[_0x70d2('0x4a')]['SmsAccountId'];}else if(_0xa980bf[_0x70d2('0x4a')][_0x70d2('0x50')]){_0x13c750[_0x70d2('0x50')]=_0xa980bf['body'][_0x70d2('0x50')];}else if(_0xa980bf[_0x70d2('0x4a')][_0x70d2('0x51')]){_0x13c750['ChatWebsiteId']=_0xa980bf[_0x70d2('0x4a')][_0x70d2('0x51')];}return db[_0x70d2('0x2d')][_0x70d2('0x49')]({'where':_0x13c750})[_0x70d2('0x23')](function(_0xbb2901){if(_0xbb2901){throw new db[(_0x70d2('0x52'))][(_0x70d2('0x53'))](_0x70d2('0x54'));}return db['CannedAnswer']['create'](_0xa980bf[_0x70d2('0x4a')]);})[_0x70d2('0x23')](function(_0x57d98c){var _0x52f27c=_0xa980bf[_0x70d2('0x55')][_0x70d2('0x24')]({'plain':!![]});if(!_0x52f27c)throw new Error(_0x70d2('0x56'));if(_0x52f27c['role']===_0x70d2('0x55')){var _0x144033=_0x57d98c[_0x70d2('0x24')]({'plain':!![]});return db[_0x70d2('0x57')][_0x70d2('0x49')]({'where':{'name':_0x70d2('0x25'),'userProfileId':_0x52f27c[_0x70d2('0x58')]},'raw':!![]})['then'](function(_0x1842f9){if(_0x1842f9&&_0x1842f9[_0x70d2('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x144033['name'],'resourceId':_0x144033['id'],'type':_0x1842f9[_0x70d2('0x2a')],'sectionId':_0x1842f9['id']},{})['then'](function(){return _0x57d98c;});}else{return _0x57d98c;}})['catch'](function(_0x14504e){logger[_0x70d2('0x28')](_0x70d2('0x5a'),_0x14504e);throw _0x14504e;});}return _0x57d98c;})[_0x70d2('0x23')](respondWithResult(_0x380225,0xc9))['catch'](handleError(_0x380225,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index eca06f8..5c8d913 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 _0x55ec=['request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57fc06,_0xb11b51){var _0x4596b6=function(_0x540c2d){while(--_0x540c2d){_0x57fc06['push'](_0x57fc06['shift']());}};_0x4596b6(++_0xb11b51);}(_0x55ec,0x9a));var _0xc55e=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x55ec[_0x3acee8];return _0x5046cc;};'use strict';var _=require(_0xc55e('0x0'));var util=require(_0xc55e('0x1'));var logger=require(_0xc55e('0x2'))(_0xc55e('0x3'));var moment=require(_0xc55e('0x4'));var BPromise=require(_0xc55e('0x5'));var rp=require(_0xc55e('0x6'));var fs=require('fs');var path=require(_0xc55e('0x7'));var rimraf=require(_0xc55e('0x8'));var config=require('../../config/environment');var attributes=require(_0xc55e('0x9'));module[_0xc55e('0xa')]=function(_0x2a5b78,_0x536022){return _0x2a5b78[_0xc55e('0xb')](_0xc55e('0xc'),attributes,{'tableName':_0xc55e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc55e('0xe'),'collate':_0xc55e('0xf')});}; \ No newline at end of file +var _0x06bc=['bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x06bc,0x73));var _0xc06b=function(_0x442f76,_0x1ae803){_0x442f76=_0x442f76-0x0;var _0x1d62a5=_0x06bc[_0x442f76];return _0x1d62a5;};'use strict';var _=require(_0xc06b('0x0'));var util=require(_0xc06b('0x1'));var logger=require(_0xc06b('0x2'))(_0xc06b('0x3'));var moment=require(_0xc06b('0x4'));var BPromise=require(_0xc06b('0x5'));var rp=require(_0xc06b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc06b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc06b('0x8'));module[_0xc06b('0x9')]=function(_0x49d61d,_0x406607){return _0x49d61d['define'](_0xc06b('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc06b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 92cc592..8d24aeb 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(_0x1058fc,_0x24475f){var _0x376050=function(_0x546ccf){while(--_0x546ccf){_0x1058fc['push'](_0x1058fc['shift']());}};_0x376050(++_0x24475f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x4add44,_0x23ab80){var _0x5f275d=function(_0x22b463){while(--_0x22b463){_0x4add44['push'](_0x4add44['shift']());}};_0x5f275d(++_0x23ab80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 3b97b4a..797cdf9 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 _0xab4e=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0xab4e,0x190));var _0xeab4=function(_0x439f3c,_0x481c26){_0x439f3c=_0x439f3c-0x0;var _0x559956=_0xab4e[_0x439f3c];return _0x559956;};'use strict';var multer=require(_0xeab4('0x0'));var util=require(_0xeab4('0x1'));var path=require(_0xeab4('0x2'));var timeout=require(_0xeab4('0x3'));var express=require(_0xeab4('0x4'));var router=express['Router']();var fs_extra=require(_0xeab4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeab4('0x6'));var controller=require(_0xeab4('0x7'));router[_0xeab4('0x8')]('/',auth[_0xeab4('0x9')](),controller[_0xeab4('0xa')]);router[_0xeab4('0x8')]('/:id',auth[_0xeab4('0x9')](),controller[_0xeab4('0xb')]);router[_0xeab4('0xc')]('/',auth[_0xeab4('0x9')](),controller['create']);router['put'](_0xeab4('0xd'),auth[_0xeab4('0x9')](),controller['update']);router[_0xeab4('0xe')](_0xeab4('0xd'),auth[_0xeab4('0x9')](),controller[_0xeab4('0xf')]);module['exports']=router; \ No newline at end of file +var _0xeac8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x311231,_0xa45337){var _0x27113b=function(_0x1436a0){while(--_0x1436a0){_0x311231['push'](_0x311231['shift']());}};_0x27113b(++_0xa45337);}(_0xeac8,0x169));var _0x8eac=function(_0x25f5ee,_0x165cb0){_0x25f5ee=_0x25f5ee-0x0;var _0x32e69c=_0xeac8[_0x25f5ee];return _0x32e69c;};'use strict';var multer=require(_0x8eac('0x0'));var util=require(_0x8eac('0x1'));var path=require(_0x8eac('0x2'));var timeout=require(_0x8eac('0x3'));var express=require('express');var router=express[_0x8eac('0x4')]();var fs_extra=require(_0x8eac('0x5'));var auth=require(_0x8eac('0x6'));var interaction=require(_0x8eac('0x7'));var config=require(_0x8eac('0x8'));var controller=require('./cannedAnswer.controller');router[_0x8eac('0x9')]('/',auth[_0x8eac('0xa')](),controller[_0x8eac('0xb')]);router[_0x8eac('0x9')](_0x8eac('0xc'),auth[_0x8eac('0xa')](),controller[_0x8eac('0xd')]);router[_0x8eac('0xe')]('/',auth['isAuthenticated'](),controller[_0x8eac('0xf')]);router['put'](_0x8eac('0xc'),auth['isAuthenticated'](),controller[_0x8eac('0x10')]);router['delete'](_0x8eac('0xc'),auth[_0x8eac('0xa')](),controller['destroy']);module[_0x8eac('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index cbebcf0..e9fc7ba 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 _0x5e49=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x366dc5,_0x622de2){var _0x4c4b07=function(_0x461510){while(--_0x461510){_0x366dc5['push'](_0x366dc5['shift']());}};_0x4c4b07(++_0x622de2);}(_0x5e49,0x152));var _0x95e4=function(_0x4b54bf,_0xefb6c1){_0x4b54bf=_0x4b54bf-0x0;var _0x955030=_0x5e49[_0x4b54bf];return _0x955030;};'use strict';var Sequelize=require(_0x95e4('0x0'));module[_0x95e4('0x1')]={'calldate':{'type':Sequelize[_0x95e4('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x95e4('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x95e4('0x3')]},'channel':{'type':Sequelize[_0x95e4('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x95e4('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x95e4('0x3')]},'amaflags':{'type':Sequelize[_0x95e4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x95e4('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x95e4('0x3')]},'sequence':{'type':Sequelize[_0x95e4('0x3')]},'peeraccount':{'type':Sequelize[_0x95e4('0x3')]},'type':{'type':Sequelize[_0x95e4('0x3')]},'tag':{'type':Sequelize[_0x95e4('0x3')]}}; \ No newline at end of file +var _0xd20f=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x4f3555,_0x40a06f){var _0x1c2142=function(_0x4ac329){while(--_0x4ac329){_0x4f3555['push'](_0x4f3555['shift']());}};_0x1c2142(++_0x40a06f);}(_0xd20f,0xbf));var _0xfd20=function(_0x3f0a29,_0x514ddf){_0x3f0a29=_0x3f0a29-0x0;var _0x127b24=_0xd20f[_0x3f0a29];return _0x127b24;};'use strict';var Sequelize=require(_0xfd20('0x0'));module[_0xfd20('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfd20('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfd20('0x3')]},'dcontext':{'type':Sequelize[_0xfd20('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfd20('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfd20('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfd20('0x3')]},'amaflags':{'type':Sequelize[_0xfd20('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfd20('0x3')]},'userfield':{'type':Sequelize[_0xfd20('0x3')]},'uniqueid':{'type':Sequelize[_0xfd20('0x3')]},'linkedid':{'type':Sequelize[_0xfd20('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd20('0x3')]},'tag':{'type':Sequelize[_0xfd20('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 6324746..0860d92 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x1e6f9a,_0x37c6d8){var _0x2b65b0=function(_0xfc8c6){while(--_0xfc8c6){_0x1e6f9a['push'](_0x1e6f9a['shift']());}};_0x2b65b0(++_0x37c6d8);}(_0x0618,0x1c6));var _0x8061=function(_0x5d64f3,_0x374d1a){_0x5d64f3=_0x5d64f3-0x0;var _0x2e5c81=_0x0618[_0x5d64f3];return _0x2e5c81;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));}; \ No newline at end of file +var _0x90b5=['nolimit','limit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','then','error','stack','name','send','index','Cdr','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x6bb3ef,_0x1f98ff){var _0x289616=function(_0x19db3e){while(--_0x19db3e){_0x6bb3ef['push'](_0x6bb3ef['shift']());}};_0x289616(++_0x1f98ff);}(_0x90b5,0x139));var _0x590b=function(_0x1b674c,_0x3f2397){_0x1b674c=_0x1b674c-0x0;var _0x21ae00=_0x90b5[_0x1b674c];return _0x21ae00;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];function respondWithStatusCode(_0x477069,_0x527487){_0x527487=_0x527487||0xcc;return function(_0xb0ca22){if(_0xb0ca22){return _0x477069[_0x590b('0x18')](_0x527487);}return _0x477069[_0x590b('0x19')](_0x527487)[_0x590b('0x1a')]();};}function respondWithResult(_0x2e85b1,_0x6ad7e7){_0x6ad7e7=_0x6ad7e7||0xc8;return function(_0x45ac04){if(_0x45ac04){return _0x2e85b1[_0x590b('0x19')](_0x6ad7e7)[_0x590b('0x1b')](_0x45ac04);}};}function respondWithFilteredResult(_0x1fbc84,_0x3fc5ca){return function(_0x260f47){if(_0x260f47){var _0x3e4723=typeof _0x3fc5ca[_0x590b('0x1c')]===_0x590b('0x1d')&&typeof _0x3fc5ca['limit']===_0x590b('0x1d');var _0x530e24=_0x260f47[_0x590b('0x1e')];var _0x115309=_0x3e4723?0x0:_0x3fc5ca[_0x590b('0x1c')];var _0x53337c=_0x3e4723?_0x260f47['count']:_0x3fc5ca[_0x590b('0x1c')]+_0x3fc5ca['limit'];var _0x21e771;if(_0x53337c>=_0x530e24){_0x53337c=_0x530e24;_0x21e771=0xc8;}else{_0x21e771=0xce;}_0x1fbc84[_0x590b('0x19')](_0x21e771);return _0x1fbc84[_0x590b('0x1f')]('Content-Range',_0x115309+'-'+_0x53337c+'/'+_0x530e24)[_0x590b('0x1b')](_0x260f47);}return null;};}function patchUpdates(_0x8ab843){return function(_0x2b8ea0){try{jsonpatch[_0x590b('0x20')](_0x2b8ea0,_0x8ab843,!![]);}catch(_0x4990ba){return BPromise[_0x590b('0x21')](_0x4990ba);}return _0x2b8ea0['save']();};}function saveUpdates(_0x10a339,_0x30dc9f){return function(_0x5bdaba){if(_0x5bdaba){return _0x5bdaba['update'](_0x10a339)[_0x590b('0x22')](function(_0x2bcfca){return _0x2bcfca;});}return null;};}function removeEntity(_0x52bdad,_0x21638c){return function(_0x1045d5){if(_0x1045d5){return _0x1045d5['destroy']()['then'](function(){_0x52bdad[_0x590b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fead,_0x520095){return function(_0x4d3ff9){if(!_0x4d3ff9){_0x39fead[_0x590b('0x18')](0x194);}return _0x4d3ff9;};}function handleError(_0x20571b,_0x5cf6b6){_0x5cf6b6=_0x5cf6b6||0x1f4;return function(_0x1febcd){logger[_0x590b('0x23')](_0x1febcd[_0x590b('0x24')]);if(_0x1febcd[_0x590b('0x25')]){delete _0x1febcd[_0x590b('0x25')];}_0x20571b['status'](_0x5cf6b6)[_0x590b('0x26')](_0x1febcd);};}exports[_0x590b('0x27')]=function(_0x333af8,_0x38a64a){var _0x1ee769={},_0x3b881f={},_0x5ee979={'count':0x0,'rows':[]};var _0x1dfce0=_['map'](db[_0x590b('0x28')][_0x590b('0x29')],function(_0x448ab3){return{'name':_0x448ab3[_0x590b('0x2a')],'type':_0x448ab3['type'][_0x590b('0x2b')]};});_0x3b881f['model']=_[_0x590b('0x2c')](_0x1dfce0,_0x590b('0x25'));_0x3b881f[_0x590b('0x2d')]=_[_0x590b('0x2e')](_0x333af8[_0x590b('0x2d')]);_0x3b881f['filters']=_[_0x590b('0x2f')](_0x3b881f[_0x590b('0x30')],_0x3b881f[_0x590b('0x2d')]);_0x1ee769[_0x590b('0x31')]=_['intersection'](_0x3b881f['model'],qs[_0x590b('0x32')](_0x333af8[_0x590b('0x2d')][_0x590b('0x32')]));_0x1ee769[_0x590b('0x31')]=_0x1ee769['attributes']['length']?_0x1ee769[_0x590b('0x31')]:_0x3b881f['model'];if(!_0x333af8[_0x590b('0x2d')][_0x590b('0x33')](_0x590b('0x34'))){_0x1ee769[_0x590b('0x35')]=qs[_0x590b('0x35')](_0x333af8[_0x590b('0x2d')][_0x590b('0x35')]);_0x1ee769[_0x590b('0x1c')]=qs[_0x590b('0x1c')](_0x333af8[_0x590b('0x2d')]['offset']);}_0x1ee769['order']=qs[_0x590b('0x36')](_0x333af8[_0x590b('0x2d')][_0x590b('0x36')]);_0x1ee769[_0x590b('0x37')]=qs[_0x590b('0x38')](_['pick'](_0x333af8[_0x590b('0x2d')],_0x3b881f[_0x590b('0x38')]),_0x1dfce0);if(_0x333af8[_0x590b('0x2d')][_0x590b('0x39')]){_0x1ee769[_0x590b('0x37')]=_['merge'](_0x1ee769[_0x590b('0x37')],{'$or':_[_0x590b('0x2c')](_0x1dfce0,function(_0x4e3f84){if(_0x4e3f84['type']!==_0x590b('0x3a')){var _0x4be52e={};_0x4be52e[_0x4e3f84[_0x590b('0x25')]]={'$like':'%'+_0x333af8[_0x590b('0x2d')][_0x590b('0x39')]+'%'};return _0x4be52e;}})});}_0x1ee769=_[_0x590b('0x3b')]({},_0x1ee769,_0x333af8[_0x590b('0x3c')]);var _0x419e6a={'where':_0x1ee769[_0x590b('0x37')]};return db[_0x590b('0x28')][_0x590b('0x1e')](_0x419e6a)[_0x590b('0x22')](function(_0x593b35){_0x5ee979[_0x590b('0x1e')]=_0x593b35;if(_0x333af8[_0x590b('0x2d')][_0x590b('0x3d')]){_0x1ee769['include']=[{'all':!![]}];}return db[_0x590b('0x28')][_0x590b('0x3e')](_0x1ee769);})[_0x590b('0x22')](function(_0x114bbe){_0x5ee979[_0x590b('0x3f')]=_0x114bbe;return _0x5ee979;})[_0x590b('0x22')](respondWithFilteredResult(_0x38a64a,_0x1ee769))[_0x590b('0x40')](handleError(_0x38a64a,null));};exports[_0x590b('0x41')]=function(_0x58c62e,_0x7da2e3){var _0x5984c0={'raw':!![],'where':{'id':_0x58c62e[_0x590b('0x42')]['id']}},_0xb345c0={};_0xb345c0[_0x590b('0x30')]=_['keys'](db[_0x590b('0x28')][_0x590b('0x29')]);_0xb345c0[_0x590b('0x2d')]=_[_0x590b('0x2e')](_0x58c62e['query']);_0xb345c0[_0x590b('0x38')]=_[_0x590b('0x2f')](_0xb345c0['model'],_0xb345c0['query']);_0x5984c0['attributes']=_[_0x590b('0x2f')](_0xb345c0[_0x590b('0x30')],qs[_0x590b('0x32')](_0x58c62e['query']['fields']));_0x5984c0[_0x590b('0x31')]=_0x5984c0[_0x590b('0x31')]['length']?_0x5984c0[_0x590b('0x31')]:_0xb345c0[_0x590b('0x30')];if(_0x58c62e[_0x590b('0x2d')][_0x590b('0x3d')]){_0x5984c0[_0x590b('0x43')]=[{'all':!![]}];}_0x5984c0=_[_0x590b('0x3b')]({},_0x5984c0,_0x58c62e[_0x590b('0x3c')]);return db[_0x590b('0x28')][_0x590b('0x44')](_0x5984c0)[_0x590b('0x22')](handleEntityNotFound(_0x7da2e3,null))[_0x590b('0x22')](respondWithResult(_0x7da2e3,null))[_0x590b('0x40')](handleError(_0x7da2e3,null));};exports[_0x590b('0x45')]=function(_0x5e10de,_0x5e79c5){return db[_0x590b('0x28')][_0x590b('0x45')](_0x5e10de[_0x590b('0x46')],{})[_0x590b('0x22')](respondWithResult(_0x5e79c5,0xc9))['catch'](handleError(_0x5e79c5,null));};exports[_0x590b('0x47')]=function(_0x11bb48,_0x2f492a){if(_0x11bb48['body']['id']){delete _0x11bb48[_0x590b('0x46')]['id'];}return db[_0x590b('0x28')]['find']({'where':{'id':_0x11bb48['params']['id']}})[_0x590b('0x22')](handleEntityNotFound(_0x2f492a,null))[_0x590b('0x22')](saveUpdates(_0x11bb48['body'],null))[_0x590b('0x22')](respondWithResult(_0x2f492a,null))[_0x590b('0x40')](handleError(_0x2f492a,null));};exports['destroy']=function(_0x67ee4f,_0xa6c336){return db[_0x590b('0x28')]['find']({'where':{'id':_0x67ee4f['params']['id']}})[_0x590b('0x22')](handleEntityNotFound(_0xa6c336,null))[_0x590b('0x22')](removeEntity(_0xa6c336,null))['catch'](handleError(_0xa6c336,null));};exports[_0x590b('0x48')]=function(_0xd409f5,_0x228203){return db[_0x590b('0x28')][_0x590b('0x48')]()[_0x590b('0x22')](respondWithResult(_0x228203,null))[_0x590b('0x40')](handleError(_0x228203,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 017db40..e3ea5ff 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(_0x298e28,_0x1f32cf){var _0x143719=function(_0x5ad480){while(--_0x5ad480){_0x298e28['push'](_0x298e28['shift']());}};_0x143719(++_0x1f32cf);}(_0x7a54,0x106));var _0x47a5=function(_0xd15b9b,_0x4d5f5a){_0xd15b9b=_0xd15b9b-0x0;var _0x117b03=_0x7a54[_0xd15b9b];return _0x117b03;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x212b74,_0x566f3d){var _0x1e7000=function(_0x1f07bd){while(--_0x1f07bd){_0x212b74['push'](_0x212b74['shift']());}};_0x1e7000(++_0x566f3d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 6fc67bd..58332d3 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 _0x856a=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x856a,0x1e2));var _0xa856=function(_0x516e36,_0x530648){_0x516e36=_0x516e36-0x0;var _0x3f04b9=_0x856a[_0x516e36];return _0x3f04b9;};'use strict';var _=require(_0xa856('0x0'));var util=require(_0xa856('0x1'));var moment=require(_0xa856('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa856('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa856('0x4'));var logger=require(_0xa856('0x5'))(_0xa856('0x6'));var config=require(_0xa856('0x7'));var jayson=require(_0xa856('0x8'));var client=jayson['client'][_0xa856('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cf3c7,_0x48f1d3,_0x51e187){return new BPromise(function(_0x23245b,_0x569e20){return client[_0xa856('0xa')](_0x3cf3c7,_0x51e187)[_0xa856('0xb')](function(_0x168c5e){logger[_0xa856('0xc')](_0xa856('0xd'),_0x48f1d3,_0xa856('0xe'));logger[_0xa856('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x48f1d3,_0xa856('0xe'),JSON[_0xa856('0x10')](_0x168c5e));if(_0x168c5e[_0xa856('0x11')]){if(_0x168c5e[_0xa856('0x11')]['code']===0x1f4){logger[_0xa856('0x11')]('Cdr,\x20%s,\x20%s',_0x48f1d3,_0x168c5e[_0xa856('0x11')][_0xa856('0x12')]);return _0x569e20(_0x168c5e[_0xa856('0x11')][_0xa856('0x12')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x48f1d3,_0x168c5e[_0xa856('0x11')][_0xa856('0x12')]);return _0x23245b(_0x168c5e[_0xa856('0x11')][_0xa856('0x12')]);}else{logger[_0xa856('0xc')](_0xa856('0xd'),_0x48f1d3,_0xa856('0xe'));_0x23245b(_0x168c5e[_0xa856('0x13')]['message']);}})[_0xa856('0x14')](function(_0xed16f7){logger[_0xa856('0x11')](_0xa856('0xd'),_0x48f1d3,_0xed16f7);_0x569e20(_0xed16f7);});});} \ No newline at end of file +var _0x71d9=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71d9,0x17a));var _0x971d=function(_0x4abb5b,_0x136770){_0x4abb5b=_0x4abb5b-0x0;var _0x4418e7=_0x71d9[_0x4abb5b];return _0x4418e7;};'use strict';var _=require('lodash');var util=require(_0x971d('0x0'));var moment=require(_0x971d('0x1'));var BPromise=require(_0x971d('0x2'));var rs=require(_0x971d('0x3'));var fs=require('fs');var Redis=require(_0x971d('0x4'));var db=require(_0x971d('0x5'))['db'];var utils=require(_0x971d('0x6'));var logger=require(_0x971d('0x7'))('rpc');var config=require(_0x971d('0x8'));var jayson=require(_0x971d('0x9'));var client=jayson['client'][_0x971d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510880,_0x4ea3b8,_0x8fcfea){return new BPromise(function(_0x4555c8,_0x5a9814){return client['request'](_0x510880,_0x8fcfea)[_0x971d('0xb')](function(_0x593bfa){logger[_0x971d('0xc')](_0x971d('0xd'),_0x4ea3b8,_0x971d('0xe'));logger['debug'](_0x971d('0xf'),_0x4ea3b8,_0x971d('0xe'),JSON[_0x971d('0x10')](_0x593bfa));if(_0x593bfa[_0x971d('0x11')]){if(_0x593bfa[_0x971d('0x11')][_0x971d('0x12')]===0x1f4){logger[_0x971d('0x11')](_0x971d('0xd'),_0x4ea3b8,_0x593bfa[_0x971d('0x11')][_0x971d('0x13')]);return _0x5a9814(_0x593bfa[_0x971d('0x11')][_0x971d('0x13')]);}logger[_0x971d('0x11')](_0x971d('0xd'),_0x4ea3b8,_0x593bfa[_0x971d('0x11')][_0x971d('0x13')]);return _0x4555c8(_0x593bfa[_0x971d('0x11')]['message']);}else{logger[_0x971d('0xc')](_0x971d('0xd'),_0x4ea3b8,'request\x20sent');_0x4555c8(_0x593bfa[_0x971d('0x14')]['message']);}})[_0x971d('0x15')](function(_0x3b9675){logger[_0x971d('0x11')]('Cdr,\x20%s,\x20%s',_0x4ea3b8,_0x3b9675);_0x5a9814(_0x3b9675);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 34faffa..daa4ea0 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(_0x30df37,_0x48ad64){var _0x41ab55=function(_0x28feb2){while(--_0x28feb2){_0x30df37['push'](_0x30df37['shift']());}};_0x41ab55(++_0x48ad64);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 8f1e632..fc6b2d3 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 _0x06ec=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5113df,_0x41e65c){var _0x549308=function(_0x59827e){while(--_0x59827e){_0x5113df['push'](_0x5113df['shift']());}};_0x549308(++_0x41e65c);}(_0x06ec,0x1e6));var _0xc06e=function(_0x2ac640,_0x38bfda){_0x2ac640=_0x2ac640-0x0;var _0x5d473a=_0x06ec[_0x2ac640];return _0x5d473a;};'use strict';var Sequelize=require('sequelize');module[_0xc06e('0x0')]={'priority':{'type':Sequelize[_0xc06e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc06e('0x2')],'allowNull':![],'defaultValue':_0xc06e('0x3')},'appdata':{'type':Sequelize[_0xc06e('0x4')]()},'description':{'type':Sequelize[_0xc06e('0x2')]},'interval':{'type':Sequelize[_0xc06e('0x2')],'defaultValue':_0xc06e('0x5')}}; \ No newline at end of file +var _0x92e1=['exports','INTEGER','noop','TEXT','STRING'];(function(_0x17f9c4,_0x1d2d22){var _0x5e6eeb=function(_0x296afd){while(--_0x296afd){_0x17f9c4['push'](_0x17f9c4['shift']());}};_0x5e6eeb(++_0x1d2d22);}(_0x92e1,0x136));var _0x192e=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x92e1[_0x4a6cf8];return _0x22205e;};'use strict';var Sequelize=require('sequelize');module[_0x192e('0x0')]={'priority':{'type':Sequelize[_0x192e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x192e('0x2')},'appdata':{'type':Sequelize[_0x192e('0x3')]()},'description':{'type':Sequelize[_0x192e('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 0c809f0..f79b96b 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 _0xf151=['include','merge','options','catch','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','model','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xf151,0xab));var _0x1f15=function(_0x4c2b40,_0x49079b){_0x4c2b40=_0x4c2b40-0x0;var _0x2b167b=_0xf151[_0x4c2b40];return _0x2b167b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f15('0x0'));var jsonpatch=require(_0x1f15('0x1'));var rp=require(_0x1f15('0x2'));var moment=require(_0x1f15('0x3'));var BPromise=require(_0x1f15('0x4'));var Mustache=require(_0x1f15('0x5'));var util=require(_0x1f15('0x6'));var path=require(_0x1f15('0x7'));var sox=require('sox');var csv=require(_0x1f15('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f15('0x9'));var crypto=require(_0x1f15('0xa'));var jsforce=require(_0x1f15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1f15('0x8'));var querystring=require(_0x1f15('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f15('0xd'));var qs=require(_0x1f15('0xe'));var as=require(_0x1f15('0xf'));var hardwareService=require(_0x1f15('0x10'));var logger=require('../../config/logger')(_0x1f15('0x11'));var utils=require(_0x1f15('0x12'));var config=require(_0x1f15('0x13'));var licenseUtil=require(_0x1f15('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5823c3,_0x340109){_0x340109=_0x340109||0xcc;return function(_0x94e8e4){if(_0x94e8e4){return _0x5823c3[_0x1f15('0x15')](_0x340109);}return _0x5823c3[_0x1f15('0x16')](_0x340109)[_0x1f15('0x17')]();};}function respondWithResult(_0x2ed0b8,_0x5a9f14){_0x5a9f14=_0x5a9f14||0xc8;return function(_0xfafc5c){if(_0xfafc5c){return _0x2ed0b8[_0x1f15('0x16')](_0x5a9f14)[_0x1f15('0x18')](_0xfafc5c);}};}function respondWithFilteredResult(_0x387c36,_0x48ef33){return function(_0x428133){if(_0x428133){var _0x5baa48=typeof _0x48ef33[_0x1f15('0x19')]===_0x1f15('0x1a')&&typeof _0x48ef33[_0x1f15('0x1b')]==='undefined';var _0x586a7d=_0x428133[_0x1f15('0x1c')];var _0xdf70ed=_0x5baa48?0x0:_0x48ef33[_0x1f15('0x19')];var _0x5529d7=_0x5baa48?_0x428133[_0x1f15('0x1c')]:_0x48ef33['offset']+_0x48ef33[_0x1f15('0x1b')];var _0x439ef1;if(_0x5529d7>=_0x586a7d){_0x5529d7=_0x586a7d;_0x439ef1=0xc8;}else{_0x439ef1=0xce;}_0x387c36['status'](_0x439ef1);return _0x387c36['set'](_0x1f15('0x1d'),_0xdf70ed+'-'+_0x5529d7+'/'+_0x586a7d)['json'](_0x428133);}return null;};}function patchUpdates(_0x4542a8){return function(_0x2916b5){try{jsonpatch[_0x1f15('0x1e')](_0x2916b5,_0x4542a8,!![]);}catch(_0x3b1416){return BPromise[_0x1f15('0x1f')](_0x3b1416);}return _0x2916b5[_0x1f15('0x20')]();};}function saveUpdates(_0x2bdd64,_0x588c78){return function(_0x4888c8){if(_0x4888c8){return _0x4888c8[_0x1f15('0x21')](_0x2bdd64)[_0x1f15('0x22')](function(_0x4fa0f4){return _0x4fa0f4;});}return null;};}function removeEntity(_0x57cb54,_0x303d93){return function(_0x49fe69){if(_0x49fe69){return _0x49fe69[_0x1f15('0x23')]()['then'](function(){_0x57cb54[_0x1f15('0x16')](0xcc)[_0x1f15('0x17')]();});}};}function handleEntityNotFound(_0x41559e,_0x46e8a7){return function(_0x262121){if(!_0x262121){_0x41559e[_0x1f15('0x15')](0x194);}return _0x262121;};}function handleError(_0x4305c0,_0x317bfc){_0x317bfc=_0x317bfc||0x1f4;return function(_0x42e5e3){logger['error'](_0x42e5e3[_0x1f15('0x24')]);if(_0x42e5e3['name']){delete _0x42e5e3[_0x1f15('0x25')];}_0x4305c0[_0x1f15('0x16')](_0x317bfc)['send'](_0x42e5e3);};}exports[_0x1f15('0x26')]=function(_0x610939,_0x1a5a14){var _0x4be862={'raw':!![],'where':{'id':_0x610939[_0x1f15('0x27')]['id']}},_0x38ce55={};_0x38ce55[_0x1f15('0x28')]=_['keys'](db[_0x1f15('0x29')]['rawAttributes']);_0x38ce55[_0x1f15('0x2a')]=_['keys'](_0x610939[_0x1f15('0x2a')]);_0x38ce55[_0x1f15('0x2b')]=_[_0x1f15('0x2c')](_0x38ce55[_0x1f15('0x28')],_0x38ce55[_0x1f15('0x2a')]);_0x4be862[_0x1f15('0x2d')]=_[_0x1f15('0x2c')](_0x38ce55[_0x1f15('0x28')],qs['fields'](_0x610939['query'][_0x1f15('0x2e')]));_0x4be862[_0x1f15('0x2d')]=_0x4be862[_0x1f15('0x2d')][_0x1f15('0x2f')]?_0x4be862[_0x1f15('0x2d')]:_0x38ce55[_0x1f15('0x28')];if(_0x610939['query'][_0x1f15('0x30')]){_0x4be862[_0x1f15('0x31')]=[{'all':!![]}];}_0x4be862=_[_0x1f15('0x32')]({},_0x4be862,_0x610939[_0x1f15('0x33')]);return db['ChatApplication']['find'](_0x4be862)['then'](handleEntityNotFound(_0x1a5a14,null))['then'](respondWithResult(_0x1a5a14,null))[_0x1f15('0x34')](handleError(_0x1a5a14,null));};exports[_0x1f15('0x21')]=function(_0x33ba93,_0x23c1d9){if(_0x33ba93['body']['id']){delete _0x33ba93[_0x1f15('0x35')]['id'];}return db['ChatApplication'][_0x1f15('0x36')]({'where':{'id':_0x33ba93[_0x1f15('0x27')]['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x23c1d9,null))[_0x1f15('0x22')](saveUpdates(_0x33ba93[_0x1f15('0x35')],null))[_0x1f15('0x22')](respondWithResult(_0x23c1d9,null))['catch'](handleError(_0x23c1d9,null));};exports[_0x1f15('0x23')]=function(_0x24ea8f,_0x5a61a7){return db[_0x1f15('0x29')][_0x1f15('0x36')]({'where':{'id':_0x24ea8f[_0x1f15('0x27')]['id']}})['then'](handleEntityNotFound(_0x5a61a7,null))[_0x1f15('0x22')](removeEntity(_0x5a61a7,null))[_0x1f15('0x34')](handleError(_0x5a61a7,null));}; \ No newline at end of file +var _0x2285=['keys','ChatApplication','rawAttributes','query','intersection','model','fields','attributes','includeAll','merge','options','find','update','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','params'];(function(_0x2634af,_0x1baae9){var _0x429532=function(_0x4f251e){while(--_0x4f251e){_0x2634af['push'](_0x2634af['shift']());}};_0x429532(++_0x1baae9);}(_0x2285,0x177));var _0x5228=function(_0x203a88,_0x59b25d){_0x203a88=_0x203a88-0x0;var _0x52f0cc=_0x2285[_0x203a88];return _0x52f0cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5228('0x0'));var zipdir=require(_0x5228('0x1'));var jsonpatch=require(_0x5228('0x2'));var rp=require(_0x5228('0x3'));var moment=require(_0x5228('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5228('0x5'));var util=require(_0x5228('0x6'));var path=require('path');var sox=require(_0x5228('0x7'));var csv=require(_0x5228('0x8'));var ejs=require(_0x5228('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5228('0xa'));var squel=require(_0x5228('0xb'));var crypto=require(_0x5228('0xc'));var jsforce=require(_0x5228('0xd'));var deskjs=require(_0x5228('0xe'));var toCsv=require(_0x5228('0x8'));var querystring=require(_0x5228('0xf'));var Papa=require(_0x5228('0x10'));var Redis=require(_0x5228('0x11'));var authService=require(_0x5228('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5228('0x13'));var hardwareService=require(_0x5228('0x14'));var logger=require(_0x5228('0x15'))(_0x5228('0x16'));var utils=require('../../config/utils');var config=require(_0x5228('0x17'));var licenseUtil=require(_0x5228('0x18'));var db=require(_0x5228('0x19'))['db'];function respondWithStatusCode(_0x3e984a,_0x5bbdfe){_0x5bbdfe=_0x5bbdfe||0xcc;return function(_0x2a939d){if(_0x2a939d){return _0x3e984a[_0x5228('0x1a')](_0x5bbdfe);}return _0x3e984a[_0x5228('0x1b')](_0x5bbdfe)[_0x5228('0x1c')]();};}function respondWithResult(_0x19c075,_0x530f36){_0x530f36=_0x530f36||0xc8;return function(_0x4d74d7){if(_0x4d74d7){return _0x19c075[_0x5228('0x1b')](_0x530f36)[_0x5228('0x1d')](_0x4d74d7);}};}function respondWithFilteredResult(_0x55f637,_0xa4aab9){return function(_0x271e3b){if(_0x271e3b){var _0x52d74c=typeof _0xa4aab9[_0x5228('0x1e')]===_0x5228('0x1f')&&typeof _0xa4aab9[_0x5228('0x20')]===_0x5228('0x1f');var _0x5ebf0c=_0x271e3b[_0x5228('0x21')];var _0x23419b=_0x52d74c?0x0:_0xa4aab9['offset'];var _0x41b812=_0x52d74c?_0x271e3b[_0x5228('0x21')]:_0xa4aab9[_0x5228('0x1e')]+_0xa4aab9['limit'];var _0x2dfc47;if(_0x41b812>=_0x5ebf0c){_0x41b812=_0x5ebf0c;_0x2dfc47=0xc8;}else{_0x2dfc47=0xce;}_0x55f637['status'](_0x2dfc47);return _0x55f637[_0x5228('0x22')](_0x5228('0x23'),_0x23419b+'-'+_0x41b812+'/'+_0x5ebf0c)[_0x5228('0x1d')](_0x271e3b);}return null;};}function patchUpdates(_0x52d49e){return function(_0x2c6837){try{jsonpatch[_0x5228('0x24')](_0x2c6837,_0x52d49e,!![]);}catch(_0xc7949f){return BPromise[_0x5228('0x25')](_0xc7949f);}return _0x2c6837['save']();};}function saveUpdates(_0x4d19a5,_0x28aba5){return function(_0x266419){if(_0x266419){return _0x266419['update'](_0x4d19a5)[_0x5228('0x26')](function(_0x2a738d){return _0x2a738d;});}return null;};}function removeEntity(_0xd82625,_0x1ae2df){return function(_0x63ce01){if(_0x63ce01){return _0x63ce01[_0x5228('0x27')]()[_0x5228('0x26')](function(){_0xd82625['status'](0xcc)[_0x5228('0x1c')]();});}};}function handleEntityNotFound(_0x531f16,_0x253207){return function(_0x3f587d){if(!_0x3f587d){_0x531f16['sendStatus'](0x194);}return _0x3f587d;};}function handleError(_0x594edf,_0x53cb40){_0x53cb40=_0x53cb40||0x1f4;return function(_0xfc158e){logger[_0x5228('0x28')](_0xfc158e[_0x5228('0x29')]);if(_0xfc158e['name']){delete _0xfc158e[_0x5228('0x2a')];}_0x594edf[_0x5228('0x1b')](_0x53cb40)[_0x5228('0x2b')](_0xfc158e);};}exports['show']=function(_0x31fc1a,_0x21398c){var _0x3e2561={'raw':!![],'where':{'id':_0x31fc1a[_0x5228('0x2c')]['id']}},_0x2adfb5={};_0x2adfb5['model']=_[_0x5228('0x2d')](db[_0x5228('0x2e')][_0x5228('0x2f')]);_0x2adfb5[_0x5228('0x30')]=_[_0x5228('0x2d')](_0x31fc1a['query']);_0x2adfb5['filters']=_[_0x5228('0x31')](_0x2adfb5[_0x5228('0x32')],_0x2adfb5['query']);_0x3e2561['attributes']=_[_0x5228('0x31')](_0x2adfb5['model'],qs[_0x5228('0x33')](_0x31fc1a[_0x5228('0x30')]['fields']));_0x3e2561[_0x5228('0x34')]=_0x3e2561['attributes']['length']?_0x3e2561[_0x5228('0x34')]:_0x2adfb5[_0x5228('0x32')];if(_0x31fc1a[_0x5228('0x30')][_0x5228('0x35')]){_0x3e2561['include']=[{'all':!![]}];}_0x3e2561=_[_0x5228('0x36')]({},_0x3e2561,_0x31fc1a[_0x5228('0x37')]);return db[_0x5228('0x2e')][_0x5228('0x38')](_0x3e2561)[_0x5228('0x26')](handleEntityNotFound(_0x21398c,null))[_0x5228('0x26')](respondWithResult(_0x21398c,null))['catch'](handleError(_0x21398c,null));};exports[_0x5228('0x39')]=function(_0x5dce78,_0x1ca305){if(_0x5dce78[_0x5228('0x3a')]['id']){delete _0x5dce78['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x5dce78[_0x5228('0x2c')]['id']}})[_0x5228('0x26')](handleEntityNotFound(_0x1ca305,null))[_0x5228('0x26')](saveUpdates(_0x5dce78[_0x5228('0x3a')],null))[_0x5228('0x26')](respondWithResult(_0x1ca305,null))[_0x5228('0x3b')](handleError(_0x1ca305,null));};exports['destroy']=function(_0x493a05,_0x3601fb){return db[_0x5228('0x2e')]['find']({'where':{'id':_0x493a05[_0x5228('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3601fb,null))['then'](removeEntity(_0x3601fb,null))[_0x5228('0x3b')](handleError(_0x3601fb,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 62633bb..6824312 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 _0x9349=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x2e8775,_0x310049){var _0x4cbf35=function(_0x103483){while(--_0x103483){_0x2e8775['push'](_0x2e8775['shift']());}};_0x4cbf35(++_0x310049);}(_0x9349,0x16b));var _0x9934=function(_0x4be703,_0x234e2e){_0x4be703=_0x4be703-0x0;var _0x31181e=_0x9349[_0x4be703];return _0x31181e;};'use strict';var _=require('lodash');var util=require(_0x9934('0x0'));var logger=require(_0x9934('0x1'))(_0x9934('0x2'));var moment=require('moment');var BPromise=require(_0x9934('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9934('0x4'));var rimraf=require(_0x9934('0x5'));var config=require(_0x9934('0x6'));var attributes=require(_0x9934('0x7'));module[_0x9934('0x8')]=function(_0xf4aeca,_0x1d6777){return _0xf4aeca[_0x9934('0x9')]('ChatApplication',attributes,{'tableName':_0x9934('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9934('0xb'),'collate':_0x9934('0xc')});}; \ No newline at end of file +var _0x2d81=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x2d81,0x11c));var _0x12d8=function(_0x1dbd83,_0x1b27f5){_0x1dbd83=_0x1dbd83-0x0;var _0x58c5df=_0x2d81[_0x1dbd83];return _0x58c5df;};'use strict';var _=require(_0x12d8('0x0'));var util=require(_0x12d8('0x1'));var logger=require(_0x12d8('0x2'))(_0x12d8('0x3'));var moment=require(_0x12d8('0x4'));var BPromise=require(_0x12d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12d8('0x6'));var rimraf=require(_0x12d8('0x7'));var config=require(_0x12d8('0x8'));var attributes=require(_0x12d8('0x9'));module[_0x12d8('0xa')]=function(_0x3b8406,_0x3d2b3e){return _0x3b8406['define'](_0x12d8('0xb'),attributes,{'tableName':_0x12d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12d8('0xd'),'collate':_0x12d8('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d5e4004..72fdfb5 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 _0xc1f3=['../../config/environment','client','http','request','then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3bdcf8,_0x3c27d4){var _0x210899=function(_0x3efa3a){while(--_0x3efa3a){_0x3bdcf8['push'](_0x3bdcf8['shift']());}};_0x210899(++_0x3c27d4);}(_0xc1f3,0xa8));var _0x3c1f=function(_0x45dcaf,_0x5d549a){_0x45dcaf=_0x45dcaf-0x0;var _0x258521=_0xc1f3[_0x45dcaf];return _0x258521;};'use strict';var _=require(_0x3c1f('0x0'));var util=require(_0x3c1f('0x1'));var moment=require(_0x3c1f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c1f('0x3'));var db=require(_0x3c1f('0x4'))['db'];var utils=require(_0x3c1f('0x5'));var logger=require(_0x3c1f('0x6'))(_0x3c1f('0x7'));var config=require(_0x3c1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3c1f('0x9')][_0x3c1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2751fa,_0x4f8cbd,_0x5f4228){return new BPromise(function(_0x1ab2c4,_0x27d0ad){return client[_0x3c1f('0xb')](_0x2751fa,_0x5f4228)[_0x3c1f('0xc')](function(_0x324ee7){logger[_0x3c1f('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4f8cbd,_0x3c1f('0xe'));logger['debug'](_0x3c1f('0xf'),_0x4f8cbd,_0x3c1f('0xe'),JSON[_0x3c1f('0x10')](_0x324ee7));if(_0x324ee7[_0x3c1f('0x11')]){if(_0x324ee7['error']['code']===0x1f4){logger[_0x3c1f('0x11')](_0x3c1f('0x12'),_0x4f8cbd,_0x324ee7[_0x3c1f('0x11')][_0x3c1f('0x13')]);return _0x27d0ad(_0x324ee7[_0x3c1f('0x11')][_0x3c1f('0x13')]);}logger[_0x3c1f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4f8cbd,_0x324ee7[_0x3c1f('0x11')][_0x3c1f('0x13')]);return _0x1ab2c4(_0x324ee7['error']['message']);}else{logger[_0x3c1f('0xd')](_0x3c1f('0x12'),_0x4f8cbd,_0x3c1f('0xe'));_0x1ab2c4(_0x324ee7[_0x3c1f('0x14')][_0x3c1f('0x13')]);}})[_0x3c1f('0x15')](function(_0x4eb612){logger[_0x3c1f('0x11')](_0x3c1f('0x12'),_0x4f8cbd,_0x4eb612);_0x27d0ad(_0x4eb612);});});} \ No newline at end of file +var _0x3c4f=['client','request','then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3c4f,0xff));var _0xf3c4=function(_0x3717f5,_0x1b76ae){_0x3717f5=_0x3717f5-0x0;var _0x759e7c=_0x3c4f[_0x3717f5];return _0x759e7c;};'use strict';var _=require('lodash');var util=require(_0xf3c4('0x0'));var moment=require(_0xf3c4('0x1'));var BPromise=require(_0xf3c4('0x2'));var rs=require(_0xf3c4('0x3'));var fs=require('fs');var Redis=require(_0xf3c4('0x4'));var db=require(_0xf3c4('0x5'))['db'];var utils=require(_0xf3c4('0x6'));var logger=require(_0xf3c4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf3c4('0x8'));var client=jayson[_0xf3c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45ce43,_0x5aac07,_0x31d0d0){return new BPromise(function(_0x122433,_0x1c1d24){return client[_0xf3c4('0xa')](_0x45ce43,_0x31d0d0)[_0xf3c4('0xb')](function(_0x5947cc){logger[_0xf3c4('0xc')]('ChatApplication,\x20%s,\x20%s',_0x5aac07,_0xf3c4('0xd'));logger['debug'](_0xf3c4('0xe'),_0x5aac07,_0xf3c4('0xd'),JSON[_0xf3c4('0xf')](_0x5947cc));if(_0x5947cc[_0xf3c4('0x10')]){if(_0x5947cc[_0xf3c4('0x10')][_0xf3c4('0x11')]===0x1f4){logger['error'](_0xf3c4('0x12'),_0x5aac07,_0x5947cc[_0xf3c4('0x10')][_0xf3c4('0x13')]);return _0x1c1d24(_0x5947cc[_0xf3c4('0x10')][_0xf3c4('0x13')]);}logger[_0xf3c4('0x10')](_0xf3c4('0x12'),_0x5aac07,_0x5947cc[_0xf3c4('0x10')][_0xf3c4('0x13')]);return _0x122433(_0x5947cc[_0xf3c4('0x10')][_0xf3c4('0x13')]);}else{logger[_0xf3c4('0xc')]('ChatApplication,\x20%s,\x20%s',_0x5aac07,_0xf3c4('0xd'));_0x122433(_0x5947cc[_0xf3c4('0x14')][_0xf3c4('0x13')]);}})[_0xf3c4('0x15')](function(_0x56449b){logger[_0xf3c4('0x10')](_0xf3c4('0x12'),_0x5aac07,_0x56449b);_0x1c1d24(_0x56449b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 254d780..c01c678 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 _0xa1f9=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xa1f9,0x9c));var _0x9a1f=function(_0xddb5ad,_0x1eb261){_0xddb5ad=_0xddb5ad-0x0;var _0x148693=_0xa1f9[_0xddb5ad];return _0x148693;};'use strict';var multer=require(_0x9a1f('0x0'));var util=require(_0x9a1f('0x1'));var path=require(_0x9a1f('0x2'));var timeout=require(_0x9a1f('0x3'));var express=require('express');var router=express[_0x9a1f('0x4')]();var fs_extra=require(_0x9a1f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9a1f('0x6'));var config=require(_0x9a1f('0x7'));var controller=require(_0x9a1f('0x8'));router[_0x9a1f('0x9')]('/:id',auth[_0x9a1f('0xa')](),controller['show']);router['put'](_0x9a1f('0xb'),auth[_0x9a1f('0xa')](),controller[_0x9a1f('0xc')]);router[_0x9a1f('0xd')](_0x9a1f('0xb'),auth['isAuthenticated'](),controller[_0x9a1f('0xe')]);module[_0x9a1f('0xf')]=router; \ No newline at end of file +var _0x7e89=['fs-extra','./chatApplication.controller','isAuthenticated','show','put','/:id','update','delete','destroy','multer','util','Router'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7e89,0x1b9));var _0x97e8=function(_0x49c699,_0x314403){_0x49c699=_0x49c699-0x0;var _0x2853ea=_0x7e89[_0x49c699];return _0x2853ea;};'use strict';var multer=require(_0x97e8('0x0'));var util=require(_0x97e8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x97e8('0x2')]();var fs_extra=require(_0x97e8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97e8('0x4'));router['get']('/:id',auth[_0x97e8('0x5')](),controller[_0x97e8('0x6')]);router[_0x97e8('0x7')](_0x97e8('0x8'),auth['isAuthenticated'](),controller[_0x97e8('0x9')]);router[_0x97e8('0xa')]('/:id',auth[_0x97e8('0x5')](),controller[_0x97e8('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e67314c..0ed241b 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 _0x164d=['BOOLEAN','sequelize','STRING'];(function(_0x54cf3f,_0x3e8052){var _0x67b127=function(_0x2fcb45){while(--_0x2fcb45){_0x54cf3f['push'](_0x54cf3f['shift']());}};_0x67b127(++_0x3e8052);}(_0x164d,0x82));var _0xd164=function(_0x453327,_0x3ebe4a){_0x453327=_0x453327-0x0;var _0x1d5a70=_0x164d[_0x453327];return _0x1d5a70;};'use strict';var Sequelize=require(_0xd164('0x0'));module['exports']={'name':{'type':Sequelize[_0xd164('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd164('0x1')]},'write':{'type':Sequelize[_0xd164('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4233=['STRING','exports'];(function(_0x344c02,_0xd5e3ff){var _0x762605=function(_0x4b6914){while(--_0x4b6914){_0x344c02['push'](_0x344c02['shift']());}};_0x762605(++_0xd5e3ff);}(_0x4233,0x199));var _0x3423=function(_0x56f15c,_0xe48921){_0x56f15c=_0x56f15c-0x0;var _0x384d5a=_0x4233[_0x56f15c];return _0x384d5a;};'use strict';var Sequelize=require('sequelize');module[_0x3423('0x0')]={'name':{'type':Sequelize[_0x3423('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3423('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 216ce1e..3f4c5ea 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 _0x5a2a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','rows','catch','params','include','find','create','body','describe','ChatInternalMessage','user','addMembers','omit','ids','findOne','User','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x3fc5e9,_0x21abe9){var _0x1bb03d=function(_0x5cde88){while(--_0x5cde88){_0x3fc5e9['push'](_0x3fc5e9['shift']());}};_0x1bb03d(++_0x21abe9);}(_0x5a2a,0xa7));var _0xa5a2=function(_0x1323e3,_0x487c25){_0x1323e3=_0x1323e3-0x0;var _0x3e0d03=_0x5a2a[_0x1323e3];return _0x3e0d03;};'use strict';var emlformat=require(_0xa5a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5a2('0x1'));var jsonpatch=require(_0xa5a2('0x2'));var rp=require(_0xa5a2('0x3'));var moment=require('moment');var BPromise=require(_0xa5a2('0x4'));var Mustache=require(_0xa5a2('0x5'));var util=require('util');var path=require(_0xa5a2('0x6'));var sox=require(_0xa5a2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5a2('0x8'));var _=require(_0xa5a2('0x9'));var squel=require('squel');var crypto=require(_0xa5a2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa5a2('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa5a2('0xc'));var Papa=require(_0xa5a2('0xd'));var Redis=require(_0xa5a2('0xe'));var authService=require(_0xa5a2('0xf'));var qs=require(_0xa5a2('0x10'));var as=require(_0xa5a2('0x11'));var hardwareService=require(_0xa5a2('0x12'));var logger=require(_0xa5a2('0x13'))(_0xa5a2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa5a2('0x15'));var db=require(_0xa5a2('0x16'))['db'];config[_0xa5a2('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa5a2('0x18'))(new Redis(config[_0xa5a2('0x17')]));require(_0xa5a2('0x19'))[_0xa5a2('0x1a')](socket);function respondWithStatusCode(_0x3c5b72,_0x33a330){_0x33a330=_0x33a330||0xcc;return function(_0x1ec77a){if(_0x1ec77a){return _0x3c5b72[_0xa5a2('0x1b')](_0x33a330);}return _0x3c5b72['status'](_0x33a330)['end']();};}function respondWithResult(_0x4d6a0c,_0x4d2d98){_0x4d2d98=_0x4d2d98||0xc8;return function(_0xc19191){if(_0xc19191){return _0x4d6a0c[_0xa5a2('0x1c')](_0x4d2d98)[_0xa5a2('0x1d')](_0xc19191);}};}function respondWithFilteredResult(_0x193d70,_0x2a0d60){return function(_0x3f8b5f){if(_0x3f8b5f){var _0x2461f0=typeof _0x2a0d60[_0xa5a2('0x1e')]==='undefined'&&typeof _0x2a0d60[_0xa5a2('0x1f')]===_0xa5a2('0x20');var _0x2d1973=_0x3f8b5f[_0xa5a2('0x21')];var _0x5b62bb=_0x2461f0?0x0:_0x2a0d60[_0xa5a2('0x1e')];var _0x4f8fb9=_0x2461f0?_0x3f8b5f[_0xa5a2('0x21')]:_0x2a0d60[_0xa5a2('0x1e')]+_0x2a0d60[_0xa5a2('0x1f')];var _0x2a6447;if(_0x4f8fb9>=_0x2d1973){_0x4f8fb9=_0x2d1973;_0x2a6447=0xc8;}else{_0x2a6447=0xce;}_0x193d70['status'](_0x2a6447);return _0x193d70[_0xa5a2('0x22')]('Content-Range',_0x5b62bb+'-'+_0x4f8fb9+'/'+_0x2d1973)[_0xa5a2('0x1d')](_0x3f8b5f);}return null;};}function patchUpdates(_0x11f366){return function(_0x20dc2a){try{jsonpatch[_0xa5a2('0x23')](_0x20dc2a,_0x11f366,!![]);}catch(_0x4e4320){return BPromise[_0xa5a2('0x24')](_0x4e4320);}return _0x20dc2a[_0xa5a2('0x25')]();};}function saveUpdates(_0x4c17c2,_0x3ac865){return function(_0x2625d2){if(_0x2625d2){return _0x2625d2[_0xa5a2('0x26')](_0x4c17c2)[_0xa5a2('0x27')](function(_0x58078b){return _0x58078b;});}return null;};}function removeEntity(_0x3cfd5c,_0x5cf920){return function(_0x4d090d){if(_0x4d090d){return _0x4d090d['destroy']()[_0xa5a2('0x27')](function(){_0x3cfd5c[_0xa5a2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1554f9,_0x506ca0){return function(_0x1f185b){if(!_0x1f185b){_0x1554f9[_0xa5a2('0x1b')](0x194);}return _0x1f185b;};}function handleError(_0x31be83,_0x3726a0){_0x3726a0=_0x3726a0||0x1f4;return function(_0x4e21e6){logger[_0xa5a2('0x28')](_0x4e21e6[_0xa5a2('0x29')]);if(_0x4e21e6[_0xa5a2('0x2a')]){delete _0x4e21e6[_0xa5a2('0x2a')];}_0x31be83[_0xa5a2('0x1c')](_0x3726a0)[_0xa5a2('0x2b')](_0x4e21e6);};}exports[_0xa5a2('0x2c')]=function(_0x344923,_0x27f477){var _0xcd5c2b={},_0xf01eee={},_0xba2731={'count':0x0,'rows':[]};var _0x454cc2=_[_0xa5a2('0x2d')](db[_0xa5a2('0x2e')][_0xa5a2('0x2f')],function(_0x4a5cf0){return{'name':_0x4a5cf0[_0xa5a2('0x30')],'type':_0x4a5cf0[_0xa5a2('0x31')][_0xa5a2('0x32')]};});_0xf01eee[_0xa5a2('0x33')]=_[_0xa5a2('0x2d')](_0x454cc2,'name');_0xf01eee['query']=_[_0xa5a2('0x34')](_0x344923[_0xa5a2('0x35')]);_0xf01eee[_0xa5a2('0x36')]=_[_0xa5a2('0x37')](_0xf01eee[_0xa5a2('0x33')],_0xf01eee['query']);_0xcd5c2b['attributes']=_[_0xa5a2('0x37')](_0xf01eee['model'],qs[_0xa5a2('0x38')](_0x344923[_0xa5a2('0x35')][_0xa5a2('0x38')]));_0xcd5c2b[_0xa5a2('0x39')]=_0xcd5c2b[_0xa5a2('0x39')][_0xa5a2('0x3a')]?_0xcd5c2b[_0xa5a2('0x39')]:_0xf01eee[_0xa5a2('0x33')];if(!_0x344923[_0xa5a2('0x35')][_0xa5a2('0x3b')]('nolimit')){_0xcd5c2b[_0xa5a2('0x1f')]=qs[_0xa5a2('0x1f')](_0x344923[_0xa5a2('0x35')][_0xa5a2('0x1f')]);_0xcd5c2b['offset']=qs[_0xa5a2('0x1e')](_0x344923[_0xa5a2('0x35')]['offset']);}_0xcd5c2b[_0xa5a2('0x3c')]=qs[_0xa5a2('0x3d')](_0x344923[_0xa5a2('0x35')][_0xa5a2('0x3d')]);_0xcd5c2b[_0xa5a2('0x3e')]=qs[_0xa5a2('0x36')](_[_0xa5a2('0x3f')](_0x344923[_0xa5a2('0x35')],_0xf01eee[_0xa5a2('0x36')]),_0x454cc2);if(_0x344923[_0xa5a2('0x35')]['filter']){_0xcd5c2b['where']=_[_0xa5a2('0x40')](_0xcd5c2b[_0xa5a2('0x3e')],{'$or':_[_0xa5a2('0x2d')](_0x454cc2,function(_0x2dbb7c){if(_0x2dbb7c[_0xa5a2('0x31')]!=='VIRTUAL'){var _0x2f568c={};_0x2f568c[_0x2dbb7c[_0xa5a2('0x2a')]]={'$like':'%'+_0x344923[_0xa5a2('0x35')][_0xa5a2('0x41')]+'%'};return _0x2f568c;}})});}_0xcd5c2b=_[_0xa5a2('0x40')]({},_0xcd5c2b,_0x344923[_0xa5a2('0x42')]);var _0x35673b={'where':_0xcd5c2b[_0xa5a2('0x3e')]};return db['ChatGroup']['count'](_0x35673b)[_0xa5a2('0x27')](function(_0x3fc0eb){_0xba2731[_0xa5a2('0x21')]=_0x3fc0eb;if(_0x344923['query'][_0xa5a2('0x43')]){_0xcd5c2b['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0xcd5c2b);})['then'](function(_0x1b75d8){_0xba2731[_0xa5a2('0x44')]=_0x1b75d8;return _0xba2731;})[_0xa5a2('0x27')](respondWithFilteredResult(_0x27f477,_0xcd5c2b))[_0xa5a2('0x45')](handleError(_0x27f477,null));};exports['show']=function(_0x6fa0bc,_0x251bcd){var _0x502e77={'raw':!![],'where':{'id':_0x6fa0bc[_0xa5a2('0x46')]['id']}},_0x21f1e0={};_0x21f1e0[_0xa5a2('0x33')]=_['keys'](db[_0xa5a2('0x2e')][_0xa5a2('0x2f')]);_0x21f1e0[_0xa5a2('0x35')]=_[_0xa5a2('0x34')](_0x6fa0bc[_0xa5a2('0x35')]);_0x21f1e0['filters']=_[_0xa5a2('0x37')](_0x21f1e0[_0xa5a2('0x33')],_0x21f1e0[_0xa5a2('0x35')]);_0x502e77['attributes']=_['intersection'](_0x21f1e0[_0xa5a2('0x33')],qs[_0xa5a2('0x38')](_0x6fa0bc[_0xa5a2('0x35')]['fields']));_0x502e77[_0xa5a2('0x39')]=_0x502e77[_0xa5a2('0x39')]['length']?_0x502e77['attributes']:_0x21f1e0[_0xa5a2('0x33')];if(_0x6fa0bc[_0xa5a2('0x35')][_0xa5a2('0x43')]){_0x502e77[_0xa5a2('0x47')]=[{'all':!![]}];}_0x502e77=_[_0xa5a2('0x40')]({},_0x502e77,_0x6fa0bc['options']);return db[_0xa5a2('0x2e')][_0xa5a2('0x48')](_0x502e77)[_0xa5a2('0x27')](handleEntityNotFound(_0x251bcd,null))[_0xa5a2('0x27')](respondWithResult(_0x251bcd,null))[_0xa5a2('0x45')](handleError(_0x251bcd,null));};exports[_0xa5a2('0x49')]=function(_0x24a985,_0x15449d){return db[_0xa5a2('0x2e')][_0xa5a2('0x49')](_0x24a985[_0xa5a2('0x4a')],{})[_0xa5a2('0x27')](respondWithResult(_0x15449d,0xc9))[_0xa5a2('0x45')](handleError(_0x15449d,null));};exports[_0xa5a2('0x26')]=function(_0x2981c7,_0x428362){if(_0x2981c7['body']['id']){delete _0x2981c7[_0xa5a2('0x4a')]['id'];}return db['ChatGroup'][_0xa5a2('0x48')]({'where':{'id':_0x2981c7[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0x428362,null))[_0xa5a2('0x27')](saveUpdates(_0x2981c7[_0xa5a2('0x4a')],null))[_0xa5a2('0x27')](respondWithResult(_0x428362,null))[_0xa5a2('0x45')](handleError(_0x428362,null));};exports['destroy']=function(_0x2b55a9,_0xf3e4e6){return db['ChatGroup']['find']({'where':{'id':_0x2b55a9[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0xf3e4e6,null))[_0xa5a2('0x27')](removeEntity(_0xf3e4e6,null))[_0xa5a2('0x45')](handleError(_0xf3e4e6,null));};exports[_0xa5a2('0x4b')]=function(_0x339865,_0x3af6f7){return db[_0xa5a2('0x2e')][_0xa5a2('0x4b')]()[_0xa5a2('0x27')](respondWithResult(_0x3af6f7,null))[_0xa5a2('0x45')](handleError(_0x3af6f7,null));};exports['getUnread']=function(_0x1fc4f9,_0x17f35c,_0x18dc9e){return db[_0xa5a2('0x4c')][_0xa5a2('0x21')]({'where':{'ChatGroupId':_0x1fc4f9[_0xa5a2('0x46')]['id'],'ToId':_0x1fc4f9[_0xa5a2('0x4d')]['id'],'read':![]}})['then'](function(_0x1bedd5){return{'id':_['toInteger'](_0x1fc4f9[_0xa5a2('0x46')]['id']),'count':_0x1bedd5};})[_0xa5a2('0x27')](respondWithResult(_0x17f35c,null))[_0xa5a2('0x45')](handleError(_0x17f35c,null));};exports['addMembers']=function(_0x42bbe8,_0xb97be3,_0x45ce4b){return db[_0xa5a2('0x2e')]['find']({'where':{'id':_0x42bbe8[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0xb97be3,null))[_0xa5a2('0x27')](function(_0x64a96b){if(_0x64a96b){return _0x64a96b[_0xa5a2('0x4e')](_0x42bbe8[_0xa5a2('0x4a')]['ids'],_[_0xa5a2('0x4f')](_0x42bbe8[_0xa5a2('0x4a')],[_0xa5a2('0x50'),'id'])||{});}})['then'](respondWithResult(_0xb97be3,null))[_0xa5a2('0x45')](handleError(_0xb97be3,null));};exports['getMembers']=function(_0x5cb5a7,_0x5a91b7,_0x398483){var _0x537852={};var _0x57b842={};var _0xc17d1b;var _0x75dae9;return db['ChatGroup'][_0xa5a2('0x51')]({'where':{'id':_0x5cb5a7[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0x5a91b7,null))[_0xa5a2('0x27')](function(_0x18d5d1){if(_0x18d5d1){_0xc17d1b=_0x18d5d1;_0x57b842[_0xa5a2('0x33')]=_['keys'](db[_0xa5a2('0x52')][_0xa5a2('0x2f')]);_0x57b842[_0xa5a2('0x35')]=_[_0xa5a2('0x34')](_0x5cb5a7[_0xa5a2('0x35')]);_0x57b842['filters']=_[_0xa5a2('0x37')](_0x57b842[_0xa5a2('0x33')],_0x57b842[_0xa5a2('0x35')]);_0x537852['attributes']=_['intersection'](_0x57b842[_0xa5a2('0x33')],qs[_0xa5a2('0x38')](_0x5cb5a7['query'][_0xa5a2('0x38')]));_0x537852[_0xa5a2('0x39')]=_0x537852[_0xa5a2('0x39')][_0xa5a2('0x3a')]?_0x537852[_0xa5a2('0x39')]:_0x57b842[_0xa5a2('0x33')];_0x537852[_0xa5a2('0x3c')]=qs[_0xa5a2('0x3d')](_0x5cb5a7['query'][_0xa5a2('0x3d')]);_0x537852[_0xa5a2('0x3e')]=qs[_0xa5a2('0x36')](_[_0xa5a2('0x3f')](_0x5cb5a7['query'],_0x57b842[_0xa5a2('0x36')]));if(_0x5cb5a7[_0xa5a2('0x35')][_0xa5a2('0x41')]){_0x537852[_0xa5a2('0x3e')]=_['merge'](_0x537852['where'],{'$or':_[_0xa5a2('0x2d')](_0x537852['attributes'],function(_0x57244f){var _0x5c0b35={};_0x5c0b35[_0x57244f]={'$like':'%'+_0x5cb5a7[_0xa5a2('0x35')]['filter']+'%'};return _0x5c0b35;})});}_0x537852=_[_0xa5a2('0x40')]({},_0x537852,_0x5cb5a7[_0xa5a2('0x42')]);return _0xc17d1b['getMembers'](_0x537852);}})[_0xa5a2('0x27')](function(_0x1793b3){if(_0x1793b3){_0x75dae9=_0x1793b3['length'];if(!_0x5cb5a7['query'][_0xa5a2('0x3b')](_0xa5a2('0x53'))){_0x537852[_0xa5a2('0x1f')]=qs[_0xa5a2('0x1f')](_0x5cb5a7[_0xa5a2('0x35')]['limit']);_0x537852['offset']=qs['offset'](_0x5cb5a7[_0xa5a2('0x35')][_0xa5a2('0x1e')]);}return _0xc17d1b[_0xa5a2('0x54')](_0x537852);}})[_0xa5a2('0x27')](function(_0x56011a){if(_0x56011a){return _0x56011a?{'count':_0x75dae9,'rows':_0x56011a}:null;}})[_0xa5a2('0x27')](respondWithResult(_0x5a91b7,null))['catch'](handleError(_0x5a91b7,null));};exports[_0xa5a2('0x55')]=function(_0x383d9e,_0x536b8,_0x5ec78c){return db[_0xa5a2('0x2e')][_0xa5a2('0x48')]({'where':{'id':_0x383d9e[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0x536b8,null))[_0xa5a2('0x27')](function(_0x4332b4){if(_0x4332b4){return _0x4332b4[_0xa5a2('0x55')](_0x383d9e[_0xa5a2('0x35')][_0xa5a2('0x50')]);}})[_0xa5a2('0x27')](respondWithStatusCode(_0x536b8,null))[_0xa5a2('0x45')](handleError(_0x536b8,null));};exports[_0xa5a2('0x56')]=function(_0x4633a6,_0x4b5216,_0x27be2d){if(_0x4633a6[_0xa5a2('0x4a')]['id']){delete _0x4633a6[_0xa5a2('0x4a')]['id'];}return db[_0xa5a2('0x2e')][_0xa5a2('0x48')]({'where':{'id':_0x4633a6[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0x4b5216,null))[_0xa5a2('0x27')](function(_0x17033c){if(_0x17033c){_0x4633a6[_0xa5a2('0x4a')][_0xa5a2('0x57')]=_0x17033c['id'];return db[_0xa5a2('0x4c')]['create'](_0x4633a6[_0xa5a2('0x4a')]);}})['then'](respondWithResult(_0x4b5216,null))[_0xa5a2('0x45')](handleError(_0x4b5216,null));};exports['getMessages']=function(_0x2e94f6,_0x36d15f,_0x15a906){var _0x42b76b={};var _0x4e5dd3={};var _0x5dad1f;var _0x4c0252;return db[_0xa5a2('0x2e')]['findOne']({'where':{'id':_0x2e94f6[_0xa5a2('0x46')]['id']}})[_0xa5a2('0x27')](handleEntityNotFound(_0x36d15f,null))[_0xa5a2('0x27')](function(_0x39f6d0){if(_0x39f6d0){_0x5dad1f=_0x39f6d0;_0x4e5dd3[_0xa5a2('0x33')]=_[_0xa5a2('0x34')](db[_0xa5a2('0x4c')][_0xa5a2('0x2f')]);_0x4e5dd3['query']=_[_0xa5a2('0x34')](_0x2e94f6[_0xa5a2('0x35')]);_0x4e5dd3[_0xa5a2('0x36')]=_[_0xa5a2('0x37')](_0x4e5dd3[_0xa5a2('0x33')],_0x4e5dd3['query']);_0x42b76b[_0xa5a2('0x39')]=_[_0xa5a2('0x37')](_0x4e5dd3[_0xa5a2('0x33')],qs[_0xa5a2('0x38')](_0x2e94f6[_0xa5a2('0x35')][_0xa5a2('0x38')]));_0x42b76b['attributes']=_0x42b76b[_0xa5a2('0x39')][_0xa5a2('0x3a')]?_0x42b76b['attributes']:_0x4e5dd3['model'];_0x42b76b[_0xa5a2('0x3c')]=qs['sort'](_0x2e94f6[_0xa5a2('0x35')][_0xa5a2('0x3d')]);_0x42b76b[_0xa5a2('0x3e')]=qs['filters'](_[_0xa5a2('0x3f')](_0x2e94f6[_0xa5a2('0x35')],_0x4e5dd3[_0xa5a2('0x36')]));if(_0x2e94f6[_0xa5a2('0x35')][_0xa5a2('0x41')]){_0x42b76b['where']=_['merge'](_0x42b76b[_0xa5a2('0x3e')],{'$or':_[_0xa5a2('0x2d')](_0x42b76b['attributes'],function(_0x3ad995){var _0x4eb26a={};_0x4eb26a[_0x3ad995]={'$like':'%'+_0x2e94f6['query'][_0xa5a2('0x41')]+'%'};return _0x4eb26a;})});}if(_0x2e94f6[_0xa5a2('0x35')][_0xa5a2('0x58')]){var _0x42fe8b=_0x2e94f6['query'][_0xa5a2('0x58')]['split'](',');var _0x557d92={};_0x557d92[_0x42fe8b[0x0]]={'$gte':moment(_0x42fe8b[0x1])[_0xa5a2('0x59')](_0xa5a2('0x5a'))};_0x42b76b[_0xa5a2('0x3e')]=_['merge'](_0x42b76b[_0xa5a2('0x3e')],_0x557d92);}_0x42b76b=_[_0xa5a2('0x40')]({},_0x42b76b,_0x2e94f6[_0xa5a2('0x42')]);return _0x5dad1f['getMessages'](_0x42b76b);}})[_0xa5a2('0x27')](function(_0x12413b){if(_0x12413b){_0x4c0252=_0x12413b[_0xa5a2('0x3a')];if(!_0x2e94f6[_0xa5a2('0x35')]['hasOwnProperty'](_0xa5a2('0x53'))){_0x42b76b[_0xa5a2('0x1f')]=qs[_0xa5a2('0x1f')](_0x2e94f6[_0xa5a2('0x35')][_0xa5a2('0x1f')]);_0x42b76b[_0xa5a2('0x1e')]=qs[_0xa5a2('0x1e')](_0x2e94f6[_0xa5a2('0x35')]['offset']);}return _0x5dad1f['getMessages'](_0x42b76b);}})[_0xa5a2('0x27')](function(_0x12fa52){if(_0x12fa52){return _0x12fa52?{'count':_0x4c0252,'rows':_0x12fa52}:null;}})['then'](respondWithResult(_0x36d15f,null))[_0xa5a2('0x45')](handleError(_0x36d15f,null));}; \ No newline at end of file +var _0xbe27=['sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ChatGroup','rows','catch','show','params','create','body','find','describe','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x2850e4,_0xf09559){var _0x5068f7=function(_0x3bd787){while(--_0x3bd787){_0x2850e4['push'](_0x2850e4['shift']());}};_0x5068f7(++_0xf09559);}(_0xbe27,0x81));var _0x7be2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbe27[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x7be2('0x0'));var rimraf=require(_0x7be2('0x1'));var zipdir=require(_0x7be2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7be2('0x3'));var BPromise=require(_0x7be2('0x4'));var Mustache=require(_0x7be2('0x5'));var util=require(_0x7be2('0x6'));var path=require(_0x7be2('0x7'));var sox=require(_0x7be2('0x8'));var csv=require(_0x7be2('0x9'));var ejs=require(_0x7be2('0xa'));var fs=require('fs');var fs_extra=require(_0x7be2('0xb'));var _=require(_0x7be2('0xc'));var squel=require(_0x7be2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7be2('0x9'));var querystring=require(_0x7be2('0xe'));var Papa=require(_0x7be2('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7be2('0x10'));var hardwareService=require(_0x7be2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7be2('0x12'));var config=require(_0x7be2('0x13'));var licenseUtil=require(_0x7be2('0x14'));var db=require(_0x7be2('0x15'))['db'];config[_0x7be2('0x16')]=_[_0x7be2('0x17')](config[_0x7be2('0x16')],{'host':_0x7be2('0x18'),'port':0x18eb});var socket=require(_0x7be2('0x19'))(new Redis(config[_0x7be2('0x16')]));require(_0x7be2('0x1a'))[_0x7be2('0x1b')](socket);function respondWithStatusCode(_0x185843,_0xe91750){_0xe91750=_0xe91750||0xcc;return function(_0x534ee7){if(_0x534ee7){return _0x185843['sendStatus'](_0xe91750);}return _0x185843[_0x7be2('0x1c')](_0xe91750)['end']();};}function respondWithResult(_0x1a9f1c,_0x4b87c2){_0x4b87c2=_0x4b87c2||0xc8;return function(_0x5c9ed9){if(_0x5c9ed9){return _0x1a9f1c['status'](_0x4b87c2)[_0x7be2('0x1d')](_0x5c9ed9);}};}function respondWithFilteredResult(_0x3e2c45,_0xd9273){return function(_0x949991){if(_0x949991){var _0x4db848=typeof _0xd9273[_0x7be2('0x1e')]===_0x7be2('0x1f')&&typeof _0xd9273[_0x7be2('0x20')]===_0x7be2('0x1f');var _0x4f7ee5=_0x949991[_0x7be2('0x21')];var _0x443b7b=_0x4db848?0x0:_0xd9273[_0x7be2('0x1e')];var _0x1f9902=_0x4db848?_0x949991[_0x7be2('0x21')]:_0xd9273[_0x7be2('0x1e')]+_0xd9273[_0x7be2('0x20')];var _0x4afa93;if(_0x1f9902>=_0x4f7ee5){_0x1f9902=_0x4f7ee5;_0x4afa93=0xc8;}else{_0x4afa93=0xce;}_0x3e2c45['status'](_0x4afa93);return _0x3e2c45[_0x7be2('0x22')]('Content-Range',_0x443b7b+'-'+_0x1f9902+'/'+_0x4f7ee5)[_0x7be2('0x1d')](_0x949991);}return null;};}function patchUpdates(_0x164e7c){return function(_0x1de08c){try{jsonpatch[_0x7be2('0x23')](_0x1de08c,_0x164e7c,!![]);}catch(_0x3d2d54){return BPromise[_0x7be2('0x24')](_0x3d2d54);}return _0x1de08c[_0x7be2('0x25')]();};}function saveUpdates(_0x4cbdd2,_0x578699){return function(_0x18c51b){if(_0x18c51b){return _0x18c51b[_0x7be2('0x26')](_0x4cbdd2)[_0x7be2('0x27')](function(_0xaef2aa){return _0xaef2aa;});}return null;};}function removeEntity(_0x3e019b,_0x553179){return function(_0x51d36a){if(_0x51d36a){return _0x51d36a[_0x7be2('0x28')]()[_0x7be2('0x27')](function(){_0x3e019b[_0x7be2('0x1c')](0xcc)[_0x7be2('0x29')]();});}};}function handleEntityNotFound(_0x343f2f,_0x13d46c){return function(_0x350f5d){if(!_0x350f5d){_0x343f2f[_0x7be2('0x2a')](0x194);}return _0x350f5d;};}function handleError(_0x422ba7,_0x922940){_0x922940=_0x922940||0x1f4;return function(_0x3d0383){logger['error'](_0x3d0383[_0x7be2('0x2b')]);if(_0x3d0383[_0x7be2('0x2c')]){delete _0x3d0383[_0x7be2('0x2c')];}_0x422ba7[_0x7be2('0x1c')](_0x922940)[_0x7be2('0x2d')](_0x3d0383);};}exports[_0x7be2('0x2e')]=function(_0x40852a,_0x4ec42f){var _0x52d440={},_0x3ff891={},_0x465906={'count':0x0,'rows':[]};var _0x1e4225=_[_0x7be2('0x2f')](db['ChatGroup'][_0x7be2('0x30')],function(_0x437597){return{'name':_0x437597['fieldName'],'type':_0x437597['type'][_0x7be2('0x31')]};});_0x3ff891[_0x7be2('0x32')]=_[_0x7be2('0x2f')](_0x1e4225,'name');_0x3ff891[_0x7be2('0x33')]=_[_0x7be2('0x34')](_0x40852a[_0x7be2('0x33')]);_0x3ff891[_0x7be2('0x35')]=_['intersection'](_0x3ff891['model'],_0x3ff891[_0x7be2('0x33')]);_0x52d440['attributes']=_[_0x7be2('0x36')](_0x3ff891['model'],qs[_0x7be2('0x37')](_0x40852a['query'][_0x7be2('0x37')]));_0x52d440[_0x7be2('0x38')]=_0x52d440[_0x7be2('0x38')][_0x7be2('0x39')]?_0x52d440[_0x7be2('0x38')]:_0x3ff891[_0x7be2('0x32')];if(!_0x40852a[_0x7be2('0x33')][_0x7be2('0x3a')](_0x7be2('0x3b'))){_0x52d440[_0x7be2('0x20')]=qs['limit'](_0x40852a[_0x7be2('0x33')][_0x7be2('0x20')]);_0x52d440[_0x7be2('0x1e')]=qs[_0x7be2('0x1e')](_0x40852a['query'][_0x7be2('0x1e')]);}_0x52d440[_0x7be2('0x3c')]=qs[_0x7be2('0x3d')](_0x40852a[_0x7be2('0x33')]['sort']);_0x52d440[_0x7be2('0x3e')]=qs[_0x7be2('0x35')](_[_0x7be2('0x3f')](_0x40852a['query'],_0x3ff891['filters']),_0x1e4225);if(_0x40852a['query'][_0x7be2('0x40')]){_0x52d440[_0x7be2('0x3e')]=_[_0x7be2('0x41')](_0x52d440['where'],{'$or':_[_0x7be2('0x2f')](_0x1e4225,function(_0x5e330c){if(_0x5e330c[_0x7be2('0x42')]!==_0x7be2('0x43')){var _0x595f2f={};_0x595f2f[_0x5e330c[_0x7be2('0x2c')]]={'$like':'%'+_0x40852a[_0x7be2('0x33')][_0x7be2('0x40')]+'%'};return _0x595f2f;}})});}_0x52d440=_[_0x7be2('0x41')]({},_0x52d440,_0x40852a[_0x7be2('0x44')]);var _0x5d2b03={'where':_0x52d440[_0x7be2('0x3e')]};return db['ChatGroup'][_0x7be2('0x21')](_0x5d2b03)[_0x7be2('0x27')](function(_0x599f2c){_0x465906[_0x7be2('0x21')]=_0x599f2c;if(_0x40852a[_0x7be2('0x33')][_0x7be2('0x45')]){_0x52d440[_0x7be2('0x46')]=[{'all':!![]}];}return db[_0x7be2('0x47')]['findAll'](_0x52d440);})['then'](function(_0x247421){_0x465906[_0x7be2('0x48')]=_0x247421;return _0x465906;})[_0x7be2('0x27')](respondWithFilteredResult(_0x4ec42f,_0x52d440))[_0x7be2('0x49')](handleError(_0x4ec42f,null));};exports[_0x7be2('0x4a')]=function(_0x2c4517,_0x26a54d){var _0x3b3da4={'raw':!![],'where':{'id':_0x2c4517[_0x7be2('0x4b')]['id']}},_0x202f2b={};_0x202f2b[_0x7be2('0x32')]=_[_0x7be2('0x34')](db[_0x7be2('0x47')][_0x7be2('0x30')]);_0x202f2b[_0x7be2('0x33')]=_['keys'](_0x2c4517['query']);_0x202f2b[_0x7be2('0x35')]=_[_0x7be2('0x36')](_0x202f2b['model'],_0x202f2b[_0x7be2('0x33')]);_0x3b3da4[_0x7be2('0x38')]=_[_0x7be2('0x36')](_0x202f2b['model'],qs['fields'](_0x2c4517[_0x7be2('0x33')][_0x7be2('0x37')]));_0x3b3da4[_0x7be2('0x38')]=_0x3b3da4[_0x7be2('0x38')]['length']?_0x3b3da4[_0x7be2('0x38')]:_0x202f2b[_0x7be2('0x32')];if(_0x2c4517[_0x7be2('0x33')][_0x7be2('0x45')]){_0x3b3da4[_0x7be2('0x46')]=[{'all':!![]}];}_0x3b3da4=_[_0x7be2('0x41')]({},_0x3b3da4,_0x2c4517[_0x7be2('0x44')]);return db[_0x7be2('0x47')]['find'](_0x3b3da4)[_0x7be2('0x27')](handleEntityNotFound(_0x26a54d,null))[_0x7be2('0x27')](respondWithResult(_0x26a54d,null))[_0x7be2('0x49')](handleError(_0x26a54d,null));};exports['create']=function(_0x4638d5,_0x54d0bc){return db[_0x7be2('0x47')][_0x7be2('0x4c')](_0x4638d5[_0x7be2('0x4d')],{})[_0x7be2('0x27')](respondWithResult(_0x54d0bc,0xc9))[_0x7be2('0x49')](handleError(_0x54d0bc,null));};exports['update']=function(_0x2eac3a,_0x5ce560){if(_0x2eac3a['body']['id']){delete _0x2eac3a[_0x7be2('0x4d')]['id'];}return db['ChatGroup'][_0x7be2('0x4e')]({'where':{'id':_0x2eac3a[_0x7be2('0x4b')]['id']}})[_0x7be2('0x27')](handleEntityNotFound(_0x5ce560,null))[_0x7be2('0x27')](saveUpdates(_0x2eac3a[_0x7be2('0x4d')],null))[_0x7be2('0x27')](respondWithResult(_0x5ce560,null))[_0x7be2('0x49')](handleError(_0x5ce560,null));};exports[_0x7be2('0x28')]=function(_0x264b8d,_0xcb791d){return db['ChatGroup'][_0x7be2('0x4e')]({'where':{'id':_0x264b8d['params']['id']}})[_0x7be2('0x27')](handleEntityNotFound(_0xcb791d,null))[_0x7be2('0x27')](removeEntity(_0xcb791d,null))[_0x7be2('0x49')](handleError(_0xcb791d,null));};exports[_0x7be2('0x4f')]=function(_0x9f2c4,_0x37318a){return db['ChatGroup'][_0x7be2('0x4f')]()['then'](respondWithResult(_0x37318a,null))['catch'](handleError(_0x37318a,null));};exports['getUnread']=function(_0x3e0394,_0x2e48fa,_0x354e33){return db[_0x7be2('0x50')][_0x7be2('0x21')]({'where':{'ChatGroupId':_0x3e0394[_0x7be2('0x4b')]['id'],'ToId':_0x3e0394[_0x7be2('0x51')]['id'],'read':![]}})['then'](function(_0x35d251){return{'id':_['toInteger'](_0x3e0394[_0x7be2('0x4b')]['id']),'count':_0x35d251};})[_0x7be2('0x27')](respondWithResult(_0x2e48fa,null))[_0x7be2('0x49')](handleError(_0x2e48fa,null));};exports[_0x7be2('0x52')]=function(_0x946964,_0x1686ff,_0x2e7af3){return db[_0x7be2('0x47')][_0x7be2('0x4e')]({'where':{'id':_0x946964['params']['id']}})[_0x7be2('0x27')](handleEntityNotFound(_0x1686ff,null))[_0x7be2('0x27')](function(_0x199b7a){if(_0x199b7a){return _0x199b7a[_0x7be2('0x52')](_0x946964[_0x7be2('0x4d')][_0x7be2('0x53')],_[_0x7be2('0x54')](_0x946964[_0x7be2('0x4d')],[_0x7be2('0x53'),'id'])||{});}})[_0x7be2('0x27')](respondWithResult(_0x1686ff,null))['catch'](handleError(_0x1686ff,null));};exports['getMembers']=function(_0x522bf4,_0x4062ef,_0x455143){var _0x7e2b21={};var _0x1aba24={};var _0x53d086;var _0x43e227;return db[_0x7be2('0x47')][_0x7be2('0x55')]({'where':{'id':_0x522bf4[_0x7be2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4062ef,null))[_0x7be2('0x27')](function(_0x4e6b6){if(_0x4e6b6){_0x53d086=_0x4e6b6;_0x1aba24[_0x7be2('0x32')]=_[_0x7be2('0x34')](db[_0x7be2('0x56')][_0x7be2('0x30')]);_0x1aba24[_0x7be2('0x33')]=_[_0x7be2('0x34')](_0x522bf4[_0x7be2('0x33')]);_0x1aba24[_0x7be2('0x35')]=_[_0x7be2('0x36')](_0x1aba24['model'],_0x1aba24[_0x7be2('0x33')]);_0x7e2b21[_0x7be2('0x38')]=_['intersection'](_0x1aba24['model'],qs[_0x7be2('0x37')](_0x522bf4['query'][_0x7be2('0x37')]));_0x7e2b21['attributes']=_0x7e2b21[_0x7be2('0x38')][_0x7be2('0x39')]?_0x7e2b21[_0x7be2('0x38')]:_0x1aba24[_0x7be2('0x32')];_0x7e2b21[_0x7be2('0x3c')]=qs[_0x7be2('0x3d')](_0x522bf4[_0x7be2('0x33')]['sort']);_0x7e2b21['where']=qs[_0x7be2('0x35')](_[_0x7be2('0x3f')](_0x522bf4[_0x7be2('0x33')],_0x1aba24[_0x7be2('0x35')]));if(_0x522bf4[_0x7be2('0x33')][_0x7be2('0x40')]){_0x7e2b21['where']=_[_0x7be2('0x41')](_0x7e2b21[_0x7be2('0x3e')],{'$or':_[_0x7be2('0x2f')](_0x7e2b21[_0x7be2('0x38')],function(_0x44072c){var _0x467595={};_0x467595[_0x44072c]={'$like':'%'+_0x522bf4[_0x7be2('0x33')][_0x7be2('0x40')]+'%'};return _0x467595;})});}_0x7e2b21=_['merge']({},_0x7e2b21,_0x522bf4[_0x7be2('0x44')]);return _0x53d086[_0x7be2('0x57')](_0x7e2b21);}})[_0x7be2('0x27')](function(_0x1e84d0){if(_0x1e84d0){_0x43e227=_0x1e84d0[_0x7be2('0x39')];if(!_0x522bf4[_0x7be2('0x33')]['hasOwnProperty'](_0x7be2('0x3b'))){_0x7e2b21[_0x7be2('0x20')]=qs[_0x7be2('0x20')](_0x522bf4[_0x7be2('0x33')][_0x7be2('0x20')]);_0x7e2b21[_0x7be2('0x1e')]=qs[_0x7be2('0x1e')](_0x522bf4[_0x7be2('0x33')]['offset']);}return _0x53d086['getMembers'](_0x7e2b21);}})[_0x7be2('0x27')](function(_0x384bab){if(_0x384bab){return _0x384bab?{'count':_0x43e227,'rows':_0x384bab}:null;}})['then'](respondWithResult(_0x4062ef,null))['catch'](handleError(_0x4062ef,null));};exports[_0x7be2('0x58')]=function(_0x2213a4,_0x2789df,_0xd5c21f){return db[_0x7be2('0x47')][_0x7be2('0x4e')]({'where':{'id':_0x2213a4[_0x7be2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2789df,null))[_0x7be2('0x27')](function(_0x25b4b9){if(_0x25b4b9){return _0x25b4b9[_0x7be2('0x58')](_0x2213a4[_0x7be2('0x33')][_0x7be2('0x53')]);}})[_0x7be2('0x27')](respondWithStatusCode(_0x2789df,null))[_0x7be2('0x49')](handleError(_0x2789df,null));};exports['addMessage']=function(_0x2ba476,_0x36cfd5,_0x2f505c){if(_0x2ba476['body']['id']){delete _0x2ba476[_0x7be2('0x4d')]['id'];}return db['ChatGroup'][_0x7be2('0x4e')]({'where':{'id':_0x2ba476[_0x7be2('0x4b')]['id']}})[_0x7be2('0x27')](handleEntityNotFound(_0x36cfd5,null))[_0x7be2('0x27')](function(_0x1f770b){if(_0x1f770b){_0x2ba476[_0x7be2('0x4d')][_0x7be2('0x59')]=_0x1f770b['id'];return db[_0x7be2('0x50')][_0x7be2('0x4c')](_0x2ba476[_0x7be2('0x4d')]);}})[_0x7be2('0x27')](respondWithResult(_0x36cfd5,null))['catch'](handleError(_0x36cfd5,null));};exports['getMessages']=function(_0x275a1c,_0x4b0cb5,_0x4cbe10){var _0x3c6b64={};var _0x15c0ab={};var _0x1cb0d2;var _0x4d189f;return db['ChatGroup'][_0x7be2('0x55')]({'where':{'id':_0x275a1c['params']['id']}})[_0x7be2('0x27')](handleEntityNotFound(_0x4b0cb5,null))[_0x7be2('0x27')](function(_0x13ea0f){if(_0x13ea0f){_0x1cb0d2=_0x13ea0f;_0x15c0ab[_0x7be2('0x32')]=_['keys'](db[_0x7be2('0x50')][_0x7be2('0x30')]);_0x15c0ab[_0x7be2('0x33')]=_[_0x7be2('0x34')](_0x275a1c[_0x7be2('0x33')]);_0x15c0ab[_0x7be2('0x35')]=_[_0x7be2('0x36')](_0x15c0ab['model'],_0x15c0ab['query']);_0x3c6b64['attributes']=_[_0x7be2('0x36')](_0x15c0ab[_0x7be2('0x32')],qs['fields'](_0x275a1c[_0x7be2('0x33')][_0x7be2('0x37')]));_0x3c6b64['attributes']=_0x3c6b64[_0x7be2('0x38')][_0x7be2('0x39')]?_0x3c6b64[_0x7be2('0x38')]:_0x15c0ab[_0x7be2('0x32')];_0x3c6b64[_0x7be2('0x3c')]=qs['sort'](_0x275a1c['query'][_0x7be2('0x3d')]);_0x3c6b64[_0x7be2('0x3e')]=qs[_0x7be2('0x35')](_[_0x7be2('0x3f')](_0x275a1c[_0x7be2('0x33')],_0x15c0ab[_0x7be2('0x35')]));if(_0x275a1c['query']['filter']){_0x3c6b64[_0x7be2('0x3e')]=_[_0x7be2('0x41')](_0x3c6b64[_0x7be2('0x3e')],{'$or':_[_0x7be2('0x2f')](_0x3c6b64[_0x7be2('0x38')],function(_0x2009b5){var _0x26a89d={};_0x26a89d[_0x2009b5]={'$like':'%'+_0x275a1c[_0x7be2('0x33')][_0x7be2('0x40')]+'%'};return _0x26a89d;})});}if(_0x275a1c['query'][_0x7be2('0x5a')]){var _0x180390=_0x275a1c[_0x7be2('0x33')][_0x7be2('0x5a')][_0x7be2('0x5b')](',');var _0x4b7dab={};_0x4b7dab[_0x180390[0x0]]={'$gte':moment(_0x180390[0x1])[_0x7be2('0x5c')](_0x7be2('0x5d'))};_0x3c6b64['where']=_[_0x7be2('0x41')](_0x3c6b64[_0x7be2('0x3e')],_0x4b7dab);}_0x3c6b64=_[_0x7be2('0x41')]({},_0x3c6b64,_0x275a1c[_0x7be2('0x44')]);return _0x1cb0d2[_0x7be2('0x5e')](_0x3c6b64);}})[_0x7be2('0x27')](function(_0x345e4c){if(_0x345e4c){_0x4d189f=_0x345e4c[_0x7be2('0x39')];if(!_0x275a1c[_0x7be2('0x33')][_0x7be2('0x3a')](_0x7be2('0x3b'))){_0x3c6b64['limit']=qs['limit'](_0x275a1c['query'][_0x7be2('0x20')]);_0x3c6b64[_0x7be2('0x1e')]=qs[_0x7be2('0x1e')](_0x275a1c['query'][_0x7be2('0x1e')]);}return _0x1cb0d2[_0x7be2('0x5e')](_0x3c6b64);}})[_0x7be2('0x27')](function(_0x92fa62){if(_0x92fa62){return _0x92fa62?{'count':_0x4d189f,'rows':_0x92fa62}:null;}})['then'](respondWithResult(_0x4b0cb5,null))[_0x7be2('0x49')](handleError(_0x4b0cb5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 95f6e4e..5f674af 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 _0x14d8=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0xe8e91,_0x401ca3){var _0x1258fe=function(_0x45ac8a){while(--_0x45ac8a){_0xe8e91['push'](_0xe8e91['shift']());}};_0x1258fe(++_0x401ca3);}(_0x14d8,0x87));var _0x814d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x14d8[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0x814d('0x0'));var ChatGroup=require(_0x814d('0x1'))['db'][_0x814d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x814d('0x3')](0x0);var events={'afterCreate':_0x814d('0x4'),'afterUpdate':_0x814d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x713ad6){return function(_0x5635f8,_0x4a139a,_0x5268a9){ChatGroupEvents[_0x814d('0x6')](_0x713ad6+':'+_0x5635f8['id'],_0x5635f8);ChatGroupEvents[_0x814d('0x6')](_0x713ad6,_0x5635f8);_0x5268a9(null);};}for(var e in events){if(events[_0x814d('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x814d('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xe0bf=['events','../../mysqldb','ChatGroup','setMaxListeners','emit','hook'];(function(_0x2ddfbf,_0x214ded){var _0x1a6832=function(_0x1207cd){while(--_0x1207cd){_0x2ddfbf['push'](_0x2ddfbf['shift']());}};_0x1a6832(++_0x214ded);}(_0xe0bf,0x168));var _0xfe0b=function(_0x5e29d8,_0x36180d){_0x5e29d8=_0x5e29d8-0x0;var _0x192e87=_0xe0bf[_0x5e29d8];return _0x192e87;};'use strict';var EventEmitter=require(_0xfe0b('0x0'));var ChatGroup=require(_0xfe0b('0x1'))['db'][_0xfe0b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfe0b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15cc2a){return function(_0x1a0ec9,_0x5ae794,_0x57600a){ChatGroupEvents[_0xfe0b('0x4')](_0x15cc2a+':'+_0x1a0ec9['id'],_0x1a0ec9);ChatGroupEvents[_0xfe0b('0x4')](_0x15cc2a,_0x1a0ec9);_0x57600a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xfe0b('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 6b8cabe..4ec6234 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 _0x4f98=['chat_groups','util','bluebird','request-promise','path','../../config/environment','define','ChatGroup'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x4f98,0x71));var _0x84f9=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0x4f98[_0xfbe06e];return _0x24e5b6;};'use strict';var _=require('lodash');var util=require(_0x84f9('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x84f9('0x1'));var rp=require(_0x84f9('0x2'));var fs=require('fs');var path=require(_0x84f9('0x3'));var rimraf=require('rimraf');var config=require(_0x84f9('0x4'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x1f7ca3,_0x5c159a){return _0x1f7ca3[_0x84f9('0x5')](_0x84f9('0x6'),attributes,{'tableName':_0x84f9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e89=['bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x67afa3,_0x1f4fd0){var _0x560c57=function(_0x4d8e94){while(--_0x4d8e94){_0x67afa3['push'](_0x67afa3['shift']());}};_0x560c57(++_0x1f4fd0);}(_0x8e89,0x1b5));var _0x98e8=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x8e89[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0x98e8('0x0'));var util=require(_0x98e8('0x1'));var logger=require(_0x98e8('0x2'))(_0x98e8('0x3'));var moment=require(_0x98e8('0x4'));var BPromise=require(_0x98e8('0x5'));var rp=require(_0x98e8('0x6'));var fs=require('fs');var path=require(_0x98e8('0x7'));var rimraf=require(_0x98e8('0x8'));var config=require('../../config/environment');var attributes=require(_0x98e8('0x9'));module[_0x98e8('0xa')]=function(_0x3dc748,_0x4100bd){return _0x3dc748[_0x98e8('0xb')](_0x98e8('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 2ce32f2..da85cd9 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 _0x39d4=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatGroup.socket','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0x1c1577,_0x1d4d6d){var _0x566d1f=function(_0x81f351){while(--_0x81f351){_0x1c1577['push'](_0x1c1577['shift']());}};_0x566d1f(++_0x1d4d6d);}(_0x39d4,0x9e));var _0x439d=function(_0x574ec7,_0x1e78a2){_0x574ec7=_0x574ec7-0x0;var _0x24b298=_0x39d4[_0x574ec7];return _0x24b298;};'use strict';var _=require(_0x439d('0x0'));var util=require(_0x439d('0x1'));var moment=require(_0x439d('0x2'));var BPromise=require(_0x439d('0x3'));var rs=require(_0x439d('0x4'));var fs=require('fs');var Redis=require(_0x439d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x439d('0x6'));var logger=require(_0x439d('0x7'))(_0x439d('0x8'));var config=require(_0x439d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x439d('0xa')]({'port':0x232a});config[_0x439d('0xb')]=_[_0x439d('0xc')](config[_0x439d('0xb')],{'host':_0x439d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x439d('0xe'))[_0x439d('0xf')](socket);function respondWithRpcPromise(_0x4c4732,_0x355372,_0x17df11){return new BPromise(function(_0x2b4ab4,_0x119adc){return client['request'](_0x4c4732,_0x17df11)[_0x439d('0x10')](function(_0x8fc40d){logger[_0x439d('0x11')]('ChatGroup,\x20%s,\x20%s',_0x355372,_0x439d('0x12'));logger[_0x439d('0x13')](_0x439d('0x14'),_0x355372,_0x439d('0x12'),JSON['stringify'](_0x8fc40d));if(_0x8fc40d['error']){if(_0x8fc40d[_0x439d('0x15')][_0x439d('0x16')]===0x1f4){logger[_0x439d('0x15')](_0x439d('0x17'),_0x355372,_0x8fc40d[_0x439d('0x15')][_0x439d('0x18')]);return _0x119adc(_0x8fc40d['error'][_0x439d('0x18')]);}logger[_0x439d('0x15')](_0x439d('0x17'),_0x355372,_0x8fc40d['error'][_0x439d('0x18')]);return _0x2b4ab4(_0x8fc40d[_0x439d('0x15')][_0x439d('0x18')]);}else{logger[_0x439d('0x11')](_0x439d('0x17'),_0x355372,_0x439d('0x12'));_0x2b4ab4(_0x8fc40d['result'][_0x439d('0x18')]);}})[_0x439d('0x19')](function(_0x42e9b4){logger[_0x439d('0x15')]('ChatGroup,\x20%s,\x20%s',_0x355372,_0x42e9b4);_0x119adc(_0x42e9b4);});});} \ No newline at end of file +var _0xf712=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter'];(function(_0x3cf78d,_0x3a467a){var _0x35e8d6=function(_0x24dfe1){while(--_0x24dfe1){_0x3cf78d['push'](_0x3cf78d['shift']());}};_0x35e8d6(++_0x3a467a);}(_0xf712,0x19c));var _0x2f71=function(_0x2ae1e3,_0x2b6954){_0x2ae1e3=_0x2ae1e3-0x0;var _0x44eaa7=_0xf712[_0x2ae1e3];return _0x44eaa7;};'use strict';var _=require(_0x2f71('0x0'));var util=require('util');var moment=require(_0x2f71('0x1'));var BPromise=require(_0x2f71('0x2'));var rs=require(_0x2f71('0x3'));var fs=require('fs');var Redis=require(_0x2f71('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f71('0x5'));var logger=require(_0x2f71('0x6'))(_0x2f71('0x7'));var config=require(_0x2f71('0x8'));var jayson=require(_0x2f71('0x9'));var client=jayson['client'][_0x2f71('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2f71('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f71('0xc'))(new Redis(config[_0x2f71('0xb')]));require(_0x2f71('0xd'))[_0x2f71('0xe')](socket);function respondWithRpcPromise(_0x113d97,_0x1b2680,_0x1044c0){return new BPromise(function(_0x349f0f,_0x5cd2c7){return client[_0x2f71('0xf')](_0x113d97,_0x1044c0)[_0x2f71('0x10')](function(_0x4915ae){logger[_0x2f71('0x11')](_0x2f71('0x12'),_0x1b2680,_0x2f71('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1b2680,_0x2f71('0x13'),JSON['stringify'](_0x4915ae));if(_0x4915ae[_0x2f71('0x14')]){if(_0x4915ae[_0x2f71('0x14')][_0x2f71('0x15')]===0x1f4){logger[_0x2f71('0x14')](_0x2f71('0x12'),_0x1b2680,_0x4915ae[_0x2f71('0x14')][_0x2f71('0x16')]);return _0x5cd2c7(_0x4915ae[_0x2f71('0x14')][_0x2f71('0x16')]);}logger[_0x2f71('0x14')](_0x2f71('0x12'),_0x1b2680,_0x4915ae[_0x2f71('0x14')]['message']);return _0x349f0f(_0x4915ae[_0x2f71('0x14')][_0x2f71('0x16')]);}else{logger[_0x2f71('0x11')](_0x2f71('0x12'),_0x1b2680,_0x2f71('0x13'));_0x349f0f(_0x4915ae[_0x2f71('0x17')]['message']);}})[_0x2f71('0x18')](function(_0x76a01a){logger[_0x2f71('0x14')](_0x2f71('0x12'),_0x1b2680,_0x76a01a);_0x5cd2c7(_0x76a01a);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c9cf7a5..3245dc5 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 _0x430c=['save','remove','update','emit','register','length','chatGroup:','./chatGroup.events'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x430c,0xe7));var _0xc430=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x430c[_0x280f4a];return _0x1bb157;};'use strict';var ChatGroupEvents=require(_0xc430('0x0'));var events=[_0xc430('0x1'),_0xc430('0x2'),_0xc430('0x3')];function createListener(_0x316544,_0x12e869){return function(_0x33cf1c){_0x12e869[_0xc430('0x4')](_0x316544,_0x33cf1c);};}function removeListener(_0x346afd,_0x37a8af){return function(){ChatGroupEvents['removeListener'](_0x346afd,_0x37a8af);};}exports[_0xc430('0x5')]=function(_0x4e65d9){for(var _0x100e92=0x0,_0x256b0d=events[_0xc430('0x6')];_0x100e92<_0x256b0d;_0x100e92++){var _0x43401c=events[_0x100e92];var _0x566d68=createListener(_0xc430('0x7')+_0x43401c,_0x4e65d9);ChatGroupEvents['on'](_0x43401c,_0x566d68);}}; \ No newline at end of file +var _0xb14a=['removeListener','chatGroup:','save','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb14a,0x19c));var _0xab14=function(_0x828502,_0x1bc729){_0x828502=_0x828502-0x0;var _0x1a7182=_0xb14a[_0x828502];return _0x1a7182;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xab14('0x0'),_0xab14('0x1'),'update'];function createListener(_0x1f9308,_0x5e260a){return function(_0x29c38d){_0x5e260a[_0xab14('0x2')](_0x1f9308,_0x29c38d);};}function removeListener(_0x55cb28,_0x1d1a57){return function(){ChatGroupEvents[_0xab14('0x3')](_0x55cb28,_0x1d1a57);};}exports['register']=function(_0x5f0dce){for(var _0x117fc3=0x0,_0x399598=events['length'];_0x117fc3<_0x399598;_0x117fc3++){var _0x181c49=events[_0x117fc3];var _0x39ce3c=createListener(_0xab14('0x4')+_0x181c49,_0x5f0dce);ChatGroupEvents['on'](_0x181c49,_0x39ce3c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0753140..eb710b0 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 _0x4513=['/describe','describe','/:id','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','destroy','delete','removeMembers','exports','multer','util','path','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x510645,_0x5349c4){var _0x37623d=function(_0x273d3c){while(--_0x273d3c){_0x510645['push'](_0x510645['shift']());}};_0x37623d(++_0x5349c4);}(_0x4513,0x8d));var _0x3451=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4513[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x3451('0x0'));var util=require(_0x3451('0x1'));var path=require(_0x3451('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3451('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3451('0x4'));var config=require('../../config/environment');var controller=require(_0x3451('0x5'));router[_0x3451('0x6')]('/',auth[_0x3451('0x7')](),controller[_0x3451('0x8')]);router['get'](_0x3451('0x9'),auth[_0x3451('0x7')](),controller[_0x3451('0xa')]);router[_0x3451('0x6')](_0x3451('0xb'),auth[_0x3451('0x7')](),controller['show']);router[_0x3451('0x6')]('/:id/unread',auth[_0x3451('0x7')](),controller['getUnread']);router[_0x3451('0x6')](_0x3451('0xc'),auth['isAuthenticated'](),controller[_0x3451('0xd')]);router[_0x3451('0x6')](_0x3451('0xe'),auth[_0x3451('0x7')](),controller[_0x3451('0xf')]);router[_0x3451('0x10')]('/',auth[_0x3451('0x7')](),controller[_0x3451('0x11')]);router[_0x3451('0x10')]('/:id/members',auth[_0x3451('0x7')](),controller['addMembers']);router[_0x3451('0x10')](_0x3451('0xe'),auth[_0x3451('0x7')](),controller[_0x3451('0x12')]);router[_0x3451('0x13')](_0x3451('0xb'),auth[_0x3451('0x7')](),controller[_0x3451('0x14')]);router['delete'](_0x3451('0xb'),auth[_0x3451('0x7')](),controller[_0x3451('0x15')]);router[_0x3451('0x16')](_0x3451('0xc'),auth[_0x3451('0x7')](),controller[_0x3451('0x17')]);module[_0x3451('0x18')]=router; \ No newline at end of file +var _0x2609=['addMembers','put','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create'];(function(_0x162367,_0xec05f7){var _0x5b01c1=function(_0x4d4078){while(--_0x4d4078){_0x162367['push'](_0x162367['shift']());}};_0x5b01c1(++_0xec05f7);}(_0x2609,0x145));var _0x9260=function(_0x1018e3,_0x16bcc2){_0x1018e3=_0x1018e3-0x0;var _0x2b1eb5=_0x2609[_0x1018e3];return _0x2b1eb5;};'use strict';var multer=require(_0x9260('0x0'));var util=require(_0x9260('0x1'));var path=require('path');var timeout=require(_0x9260('0x2'));var express=require(_0x9260('0x3'));var router=express['Router']();var fs_extra=require(_0x9260('0x4'));var auth=require(_0x9260('0x5'));var interaction=require(_0x9260('0x6'));var config=require(_0x9260('0x7'));var controller=require(_0x9260('0x8'));router['get']('/',auth[_0x9260('0x9')](),controller[_0x9260('0xa')]);router[_0x9260('0xb')](_0x9260('0xc'),auth[_0x9260('0x9')](),controller[_0x9260('0xd')]);router[_0x9260('0xb')](_0x9260('0xe'),auth[_0x9260('0x9')](),controller['show']);router[_0x9260('0xb')](_0x9260('0xf'),auth[_0x9260('0x9')](),controller[_0x9260('0x10')]);router[_0x9260('0xb')](_0x9260('0x11'),auth[_0x9260('0x9')](),controller[_0x9260('0x12')]);router[_0x9260('0xb')](_0x9260('0x13'),auth[_0x9260('0x9')](),controller[_0x9260('0x14')]);router[_0x9260('0x15')]('/',auth[_0x9260('0x9')](),controller[_0x9260('0x16')]);router[_0x9260('0x15')](_0x9260('0x11'),auth[_0x9260('0x9')](),controller[_0x9260('0x17')]);router[_0x9260('0x15')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x9260('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9260('0x19')]('/:id',auth[_0x9260('0x9')](),controller[_0x9260('0x1a')]);router[_0x9260('0x19')](_0x9260('0x11'),auth[_0x9260('0x9')](),controller[_0x9260('0x1b')]);module[_0x9260('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f47d637..0e0048d 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 _0x0102=['TEXT','long','out','exports','BOOLEAN','INTEGER','ENUM','STRING','DATE'];(function(_0x1f0c0e,_0x45b614){var _0x4e5183=function(_0x4afb2b){while(--_0x4afb2b){_0x1f0c0e['push'](_0x1f0c0e['shift']());}};_0x4e5183(++_0x45b614);}(_0x0102,0x186));var _0x2010=function(_0x582382,_0x905517){_0x582382=_0x582382-0x0;var _0x141bc9=_0x0102[_0x582382];return _0x141bc9;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'closed':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2010('0x2')]},'ratingType':{'type':Sequelize[_0x2010('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2010('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2010('0x5')]},'disposition':{'type':Sequelize[_0x2010('0x4')]},'secondDisposition':{'type':Sequelize[_0x2010('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2010('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2010('0x4')]},'osName':{'type':Sequelize[_0x2010('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x2010('0x4')]},'deviceVendor':{'type':Sequelize[_0x2010('0x4')]},'deviceType':{'type':Sequelize[_0x2010('0x4')]},'referer':{'type':Sequelize[_0x2010('0x6')]},'customerIp':{'type':Sequelize[_0x2010('0x4')]},'formData':{'type':Sequelize[_0x2010('0x6')](_0x2010('0x7'))},'read1stAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2010('0x3')]('in',_0x2010('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2010('0x4')]},'customerPort':{'type':Sequelize[_0x2010('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x2010('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x253d=['STRING','ENUM','out','sequelize','star','thumb','TEXT','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x253d,0x1b3));var _0xd253=function(_0x174ba6,_0x527735){_0x174ba6=_0x174ba6-0x0;var _0x598af7=_0x253d[_0x174ba6];return _0x598af7;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xd253('0x1'),_0xd253('0x2')),'defaultValue':_0xd253('0x1')},'ratingMessage':{'type':Sequelize[_0xd253('0x3')]},'pathTranscript':{'type':Sequelize[_0xd253('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd253('0x4')]},'disposition':{'type':Sequelize[_0xd253('0x5')]},'secondDisposition':{'type':Sequelize[_0xd253('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd253('0x5')]},'note':{'type':Sequelize[_0xd253('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xd253('0x5')]},'osName':{'type':Sequelize[_0xd253('0x5')]},'osVersion':{'type':Sequelize[_0xd253('0x5')]},'deviceModel':{'type':Sequelize[_0xd253('0x5')]},'deviceVendor':{'type':Sequelize[_0xd253('0x5')]},'deviceType':{'type':Sequelize[_0xd253('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd253('0x3')]('long')},'read1stAt':{'type':Sequelize[_0xd253('0x4')]},'lastMsgAt':{'type':Sequelize[_0xd253('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd253('0x6')]('in',_0xd253('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd253('0x5')]},'customerPort':{'type':Sequelize[_0xd253('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index bae65b6..dc5e481 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 _0x5e8c=['../../mysqldb','redis','localhost','./chatInteraction.socket','register','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','status','name','merge','contact','interaction','account','Users','map','fullname','TagIds','split','Tags','push','waiting','talking','answered','unmanaged','total','closed','UserId','abandoned','disposition','index','ChatInteraction','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','field','tools_tags','select','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','ChatWebsiteId','where','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','params','rawAttributes','includeAll','include','create','describe','createVidaooSession','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','findOne','attachId','root','offline-chat/','join','close','format','now','pathTranscript','ChatWebsite','Messages','%s%d','customer','Visitor','website_alias','agent_alias','System','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','service','port','secure','authentication','pass','SendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','emit','chatInteractionTags:save','removeTags','download','server','tmp','files','attachments','transcript-%d-%s.zip','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerPort','tail','createReadStream','pipe','createWriteStream','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa3a1d0,_0x1045ee){var _0x81e3ad=function(_0x38c228){while(--_0x38c228){_0xa3a1d0['push'](_0xa3a1d0['shift']());}};_0x81e3ad(++_0x1045ee);}(_0x5e8c,0x11a));var _0xc5e8=function(_0x41987b,_0x5683e9){_0x41987b=_0x41987b-0x0;var _0x190653=_0x5e8c[_0x41987b];return _0x190653;};'use strict';var emlformat=require(_0xc5e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc5e8('0x1'));var rp=require(_0xc5e8('0x2'));var moment=require(_0xc5e8('0x3'));var BPromise=require(_0xc5e8('0x4'));var Mustache=require(_0xc5e8('0x5'));var util=require('util');var path=require(_0xc5e8('0x6'));var sox=require(_0xc5e8('0x7'));var csv=require(_0xc5e8('0x8'));var ejs=require(_0xc5e8('0x9'));var fs=require('fs');var fs_extra=require(_0xc5e8('0xa'));var _=require('lodash');var squel=require(_0xc5e8('0xb'));var crypto=require(_0xc5e8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc5e8('0xd'));var toCsv=require(_0xc5e8('0x8'));var querystring=require('querystring');var Papa=require(_0xc5e8('0xe'));var Redis=require(_0xc5e8('0xf'));var authService=require(_0xc5e8('0x10'));var qs=require(_0xc5e8('0x11'));var as=require(_0xc5e8('0x12'));var pdf=require(_0xc5e8('0x13'));var hardwareService=require(_0xc5e8('0x14'));var logger=require(_0xc5e8('0x15'))(_0xc5e8('0x16'));var utils=require(_0xc5e8('0x17'));var config=require(_0xc5e8('0x18'));var licenseUtil=require(_0xc5e8('0x19'));var db=require(_0xc5e8('0x1a'))['db'];config['redis']=_['defaults'](config[_0xc5e8('0x1b')],{'host':_0xc5e8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5e8('0x1b')]));require(_0xc5e8('0x1d'))[_0xc5e8('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc5e8('0x1f')][_0xc5e8('0x20')]({'port':0x232b});var client9004=jayson[_0xc5e8('0x1f')][_0xc5e8('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2d1352,_0x4ab86f,_0x1a7e2b,_0x2fa0c9){return new BPromise(function(_0x492219,_0x9b7150){var _0x23b3f6=_0x2fa0c9||client;return _0x23b3f6['request'](_0x2d1352,_0x1a7e2b)[_0xc5e8('0x21')](function(_0x256026){logger[_0xc5e8('0x22')](_0xc5e8('0x23'),_0x4ab86f,_0xc5e8('0x24'));logger[_0xc5e8('0x25')](_0xc5e8('0x26'),_0x4ab86f,_0xc5e8('0x24'),JSON[_0xc5e8('0x27')](_0x256026));if(_0x256026[_0xc5e8('0x28')]){if(_0x256026[_0xc5e8('0x28')][_0xc5e8('0x29')]===0x1f4){logger[_0xc5e8('0x28')](_0xc5e8('0x23'),_0x4ab86f,_0x256026[_0xc5e8('0x28')][_0xc5e8('0x2a')]);return _0x9b7150(_0x256026[_0xc5e8('0x28')]['message']);}logger[_0xc5e8('0x28')](_0xc5e8('0x23'),_0x4ab86f,_0x256026[_0xc5e8('0x28')][_0xc5e8('0x2a')]);return _0x492219(_0x256026[_0xc5e8('0x28')][_0xc5e8('0x2a')]);}else{logger[_0xc5e8('0x22')](_0xc5e8('0x23'),_0x4ab86f,_0xc5e8('0x24'));_0x492219(_0x256026[_0xc5e8('0x2b')][_0xc5e8('0x2a')]);}})[_0xc5e8('0x2c')](function(_0x555dec){logger['error'](_0xc5e8('0x23'),_0x4ab86f,_0x555dec);_0x9b7150(_0x555dec);});});}function respondWithStatusCode(_0x18de41,_0x50195b){_0x50195b=_0x50195b||0xcc;return function(_0x13a9bf){if(_0x13a9bf){return _0x18de41[_0xc5e8('0x2d')](_0x50195b);}return _0x18de41['status'](_0x50195b)[_0xc5e8('0x2e')]();};}function respondWithResult(_0x583f57,_0x42fe2f){_0x42fe2f=_0x42fe2f||0xc8;return function(_0x6a2221){if(_0x6a2221){return _0x583f57['status'](_0x42fe2f)['json'](_0x6a2221);}};}function respondWithFilteredResult(_0x5a2850,_0x1abf96){return function(_0x2dea59){if(_0x2dea59){var _0x175412=typeof _0x1abf96[_0xc5e8('0x2f')]===_0xc5e8('0x30')&&typeof _0x1abf96[_0xc5e8('0x31')]===_0xc5e8('0x30');var _0x27dd3c=_0x2dea59[_0xc5e8('0x32')];var _0x55d650=_0x175412?0x0:_0x1abf96[_0xc5e8('0x2f')];var _0x39e701=_0x175412?_0x2dea59[_0xc5e8('0x32')]:_0x1abf96[_0xc5e8('0x2f')]+_0x1abf96[_0xc5e8('0x31')];var _0x3d6b91;if(_0x39e701>=_0x27dd3c){_0x39e701=_0x27dd3c;_0x3d6b91=0xc8;}else{_0x3d6b91=0xce;}_0x5a2850['status'](_0x3d6b91);return _0x5a2850['set'](_0xc5e8('0x33'),_0x55d650+'-'+_0x39e701+'/'+_0x27dd3c)[_0xc5e8('0x34')](_0x2dea59);}return null;};}function patchUpdates(_0x583891){return function(_0x55cbcf){try{jsonpatch[_0xc5e8('0x35')](_0x55cbcf,_0x583891,!![]);}catch(_0x427946){return BPromise[_0xc5e8('0x36')](_0x427946);}return _0x55cbcf['save']();};}function saveUpdates(_0x587111,_0x1db35a){return function(_0x3e6e68){if(_0x3e6e68){return _0x3e6e68[_0xc5e8('0x37')](_0x587111)[_0xc5e8('0x21')](function(_0x8737ce){return _0x8737ce;});}return null;};}function removeEntity(_0xcdd832,_0x4b6579){return function(_0x3c58f7){if(_0x3c58f7){return _0x3c58f7[_0xc5e8('0x38')]()['then'](function(){_0xcdd832[_0xc5e8('0x39')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e67dc,_0x501d8c){return function(_0x2d5f78){if(!_0x2d5f78){_0x5e67dc[_0xc5e8('0x2d')](0x194);}return _0x2d5f78;};}function handleError(_0x519d25,_0x1f23e9){_0x1f23e9=_0x1f23e9||0x1f4;return function(_0x2197c9){logger[_0xc5e8('0x28')](_0x2197c9['stack']);if(_0x2197c9[_0xc5e8('0x3a')]){delete _0x2197c9[_0xc5e8('0x3a')];}_0x519d25[_0xc5e8('0x39')](_0x1f23e9)['send'](_0x2197c9);};}function getMustacheRender(_0x2a5c7c,_0x43f1b7){return Mustache['render'](_0x2a5c7c,_[_0xc5e8('0x3b')](_0x43f1b7['body'],{'contact':_0x43f1b7[_0xc5e8('0x3c')],'message':_0x43f1b7[_0xc5e8('0x2a')],'agent':_0x43f1b7['agent'],'interaction':_0x43f1b7[_0xc5e8('0x3d')],'account':_0x43f1b7[_0xc5e8('0x3e')]}))||'';}function getInteractionUsers(_0x32c08a,_0x5f5914){return new BPromise(function(_0x14d662,_0x1a0c8e){try{if(_0x5f5914[_0x32c08a['id']]){_0x32c08a[_0xc5e8('0x3f')]=_[_0xc5e8('0x40')](_0x5f5914[_0x32c08a['id']],function(_0x22bf2b){return{'id':_0x22bf2b['id'],'fullname':_0x22bf2b[_0xc5e8('0x41')]};});}}catch(_0x4f51d6){_0x1a0c8e(_0x4f51d6);}_0x14d662(_0x32c08a);});}function getInteractionTags(_0xa0c8af,_0x1a6f30){return new BPromise(function(_0x9f3a15,_0x32f55b){try{if(_0xa0c8af[_0xc5e8('0x42')]){_0xa0c8af['Tags']=[];_0xa0c8af[_0xc5e8('0x42')][_0xc5e8('0x43')](',')['forEach'](function(_0x4ba63c){_0xa0c8af[_0xc5e8('0x44')][_0xc5e8('0x45')](_0x1a6f30[_0x4ba63c]);});}delete _0xa0c8af[_0xc5e8('0x42')];}catch(_0x5e0f43){_0x32f55b(_0x5e0f43);}_0x9f3a15(_0xa0c8af);});}function updateChatInteraction(_0x59c302,_0x4c2354,_0x1680e7){return new BPromise(function(_0x5b00f7,_0x2a43ff){return getInteractionUsers(_0x59c302,_0x1680e7)['then'](function(_0xebe5d2){return getInteractionTags(_0xebe5d2,_0x4c2354);})[_0xc5e8('0x21')](function(_0x5a5f4c){return getStateInteraction(_0x5a5f4c);})[_0xc5e8('0x21')](function(_0x2cae33){_0x5b00f7(_0x2cae33);})[_0xc5e8('0x2c')](function(_0x56fe66){_0x2a43ff(_0x56fe66);});});}function getStateInteraction(_0x2a160a){return new BPromise(function(_0x49ff86){_0x2a160a[_0xc5e8('0x46')]=0x0;_0x2a160a[_0xc5e8('0x47')]=0x0;_0x2a160a[_0xc5e8('0x48')]=0x0;_0x2a160a[_0xc5e8('0x49')]=0x0;_0x2a160a['abandoned']=0x0;_0x2a160a[_0xc5e8('0x4a')]=0x0;if(!_0x2a160a[_0xc5e8('0x4b')]&&!_0x2a160a[_0xc5e8('0x4c')]){_0x2a160a[_0xc5e8('0x46')]+=0x1;}if(!_0x2a160a['closed']&&_0x2a160a[_0xc5e8('0x4c')]){_0x2a160a[_0xc5e8('0x47')]+=0x1;if(_0x2a160a['waiting']){_0x2a160a['waiting']-=0x1;}}if(_0x2a160a['closed']&&_0x2a160a['disposition']===_0xc5e8('0x4d')){_0x2a160a['abandoned']+=0x1;if(_0x2a160a[_0xc5e8('0x46')]){_0x2a160a[_0xc5e8('0x46')]-=0x1;}}else if(_0x2a160a[_0xc5e8('0x4b')]&&!_0x2a160a['UserId']&&_0x2a160a[_0xc5e8('0x4e')]){_0x2a160a[_0xc5e8('0x49')]+=0x1;if(_0x2a160a[_0xc5e8('0x46')]){_0x2a160a['waiting']-=0x1;}}else if(_0x2a160a[_0xc5e8('0x4b')]&&_0x2a160a[_0xc5e8('0x4c')]){_0x2a160a[_0xc5e8('0x48')]+=0x1;if(_0x2a160a[_0xc5e8('0x47')]){_0x2a160a[_0xc5e8('0x47')]-=0x1;}}_0x2a160a[_0xc5e8('0x4a')]+=0x1;_0x49ff86(_0x2a160a);});}exports[_0xc5e8('0x4f')]=function(_0x53beaa,_0x572dc9){var _0x42e533={},_0x2a9fdb={},_0x1168a7={'count':0x0,'rows':[]};var _0x2a44c2=_['map'](db[_0xc5e8('0x50')]['rawAttributes'],function(_0x5dd241){return{'name':_0x5dd241['fieldName'],'type':_0x5dd241[_0xc5e8('0x51')][_0xc5e8('0x52')]};});_0x2a9fdb[_0xc5e8('0x53')]=_[_0xc5e8('0x40')](_0x2a44c2,_0xc5e8('0x3a'));_0x2a9fdb['query']=_[_0xc5e8('0x54')](_0x53beaa[_0xc5e8('0x55')]);_0x2a9fdb[_0xc5e8('0x56')]=_[_0xc5e8('0x57')](_0x2a9fdb['model'],_0x2a9fdb[_0xc5e8('0x55')]);_0x42e533['attributes']=_[_0xc5e8('0x57')](_0x2a9fdb[_0xc5e8('0x53')],qs['fields'](_0x53beaa['query'][_0xc5e8('0x58')]));_0x42e533[_0xc5e8('0x59')]=_0x42e533[_0xc5e8('0x59')][_0xc5e8('0x5a')]?_0x42e533[_0xc5e8('0x59')]:_0x2a9fdb['model'];if(!_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x5b')](_0xc5e8('0x5c'))){_0x42e533[_0xc5e8('0x31')]=qs[_0xc5e8('0x31')](_0x53beaa['query'][_0xc5e8('0x31')]);_0x42e533[_0xc5e8('0x2f')]=qs[_0xc5e8('0x2f')](_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x2f')]);}_0x42e533['order']=qs['sort'](_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x5d')]);_0x42e533['where']=qs[_0xc5e8('0x56')](_[_0xc5e8('0x5e')](_0x53beaa[_0xc5e8('0x55')],_0x2a9fdb['filters']),_0x2a44c2);var _0x1eba6f=[];var _0x140717=squel['select']()[_0xc5e8('0x5f')]('id')[_0xc5e8('0x5f')](_0xc5e8('0x3a'))[_0xc5e8('0x5f')]('color')['from'](_0xc5e8('0x60'));var _0xc699a5=squel[_0xc5e8('0x61')]()[_0xc5e8('0x5f')](_0xc5e8('0x62'))[_0xc5e8('0x5f')]('u.fullname')[_0xc5e8('0x5f')](_0xc5e8('0x63'))[_0xc5e8('0x64')](_0xc5e8('0x65'),'ui')[_0xc5e8('0x66')](_0xc5e8('0x67'),'u',_0xc5e8('0x68'));var _0x28c786=squel[_0xc5e8('0x61')]()[_0xc5e8('0x64')](_0xc5e8('0x69'),'i')[_0xc5e8('0x66')](_0xc5e8('0x6a'),'c',_0xc5e8('0x6b'))[_0xc5e8('0x66')]('users','o',_0xc5e8('0x6c'))[_0xc5e8('0x66')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0xc5e8('0x66')](_0xc5e8('0x6d'),'me',_0xc5e8('0x6e'))[_0xc5e8('0x66')](_0xc5e8('0x6f'),'it',_0xc5e8('0x70'))['left_join'](_0xc5e8('0x60'),'t',_0xc5e8('0x71'));var _0x354b59=squel['expr']();var _0x231914=[];var _0x29fda6=squel[_0xc5e8('0x72')]();var _0x5be5e6;if(_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x73')]){_0x5be5e6=as[_0xc5e8('0x74')](_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x73')]);var _0x1d1a91=_0x5be5e6[_0xc5e8('0x75')];for(var _0x231f23=0x0;_0x231f23<_0x5be5e6[_0xc5e8('0x76')][_0xc5e8('0x5a')];_0x231f23++){var _0xa5058d=_0x5be5e6[_0xc5e8('0x76')][_0x231f23];var _0x26f804='i';var _0x4df6b5=_[_0xc5e8('0x77')](_0x2a44c2,[_0xc5e8('0x3a'),_0xa5058d['field']]);if(!_0x4df6b5){switch(_0xa5058d[_0xc5e8('0x5f')]){case _0xc5e8('0x78'):if(_0xa5058d[_0xc5e8('0x79')]==0x1){_0x28c786['having']('`'+_0xa5058d[_0xc5e8('0x5f')]+'`\x20=\x200');}else{_0x28c786[_0xc5e8('0x7a')]('`'+_0xa5058d[_0xc5e8('0x5f')]+_0xc5e8('0x7b'));}break;case'Contact':if(_0xa5058d['operator']==='$substring'){if(_0xa5058d[_0xc5e8('0x79')][_0xc5e8('0x43')]('\x20')[_0xc5e8('0x5a')]>0x1){_0x354b59[_0x1d1a91](_0xc5e8('0x7c'),qs[_0xc5e8('0x7d')](_0xa5058d[_0xc5e8('0x79')]),null);}else{var _0x25557c='%'+_0xa5058d[_0xc5e8('0x79')]+'%';_0x354b59[_0x1d1a91](_0xc5e8('0x7e'),_0x25557c,_0x25557c,_0x25557c);}}else{_0x4df6b5=_[_0xc5e8('0x77')](_0x2a44c2,[_0xc5e8('0x3a'),_0xc5e8('0x7f')]);_0xa5058d[_0xc5e8('0x5f')]=_0xc5e8('0x7f');_0x2bc854=as['buildExpression'](_0x26f804,_0x4df6b5['type'],_0xa5058d);_0x354b59[_0x1d1a91](_0x2bc854[_0xc5e8('0x80')],_0x2bc854['value'][_0xc5e8('0x81')],_0x2bc854[_0xc5e8('0x79')][_0xc5e8('0x2e')]);}break;case _0xc5e8('0x82'):var _0x18fa3a=_0xa5058d[_0xc5e8('0x79')][_0xc5e8('0x43')](',')[_0xc5e8('0x40')](function(_0x42ada5){return Number(_0x42ada5);});_0x18fa3a[_0xc5e8('0x83')](function(_0x372b81){_0x29fda6['or'](_0xc5e8('0x84'),'%,'+_0x372b81+',%');});_0x231914=_[_0xc5e8('0x85')](_0x231914,_0x18fa3a);break;case _0xc5e8('0x86'):if(_0xa5058d['operator']===_0xc5e8('0x87')){_0x354b59[_0x1d1a91](_0xc5e8('0x88'),'%'+_0xa5058d['value']+'%',null);}else{_0x4df6b5=_[_0xc5e8('0x77')](_0x2a44c2,[_0xc5e8('0x3a'),_0xc5e8('0x4c')]);_0xa5058d[_0xc5e8('0x5f')]=_0xc5e8('0x4c');_0x2bc854=as['buildExpression'](_0x26f804,_0x4df6b5[_0xc5e8('0x51')],_0xa5058d);_0x354b59[_0x1d1a91](_0x2bc854['text'],_0x2bc854[_0xc5e8('0x79')][_0xc5e8('0x81')],_0x2bc854[_0xc5e8('0x79')][_0xc5e8('0x2e')]);}break;case _0xc5e8('0x89'):_0x2bc854=as[_0xc5e8('0x8a')]('me',null,_0xa5058d);_0x354b59[_0x1d1a91](_0x2bc854[_0xc5e8('0x80')],_0x2bc854[_0xc5e8('0x79')][_0xc5e8('0x81')],_0x2bc854[_0xc5e8('0x79')][_0xc5e8('0x2e')]);break;}}else{var _0x2bc854=as[_0xc5e8('0x8a')](_0x26f804,_0x4df6b5['type'],_0xa5058d);_0x354b59[_0x1d1a91](_0x2bc854[_0xc5e8('0x80')],_0x2bc854['value'][_0xc5e8('0x81')],_0x2bc854[_0xc5e8('0x79')]['end']);}}}else{var _0x3bd3d9=_(_0x53beaa[_0xc5e8('0x55')])['keys']()[_0xc5e8('0x40')](function(_0xb63860){return _['some'](_0x2a44c2,[_0xc5e8('0x3a'),_0xb63860])?_0xb63860:undefined;})['compact']()[_0xc5e8('0x79')]();if(!_['isEmpty'](_0x3bd3d9)){_0x3bd3d9['forEach'](function(_0x483cde){if(_0x483cde===_0xc5e8('0x8b')){_0x28c786[_0xc5e8('0x8c')]('i.ChatWebsiteId\x20IN\x20?',[][_0xc5e8('0x8d')](_0x53beaa[_0xc5e8('0x55')][_0x483cde]));}else if(_0x483cde===_0xc5e8('0x8e')){var _0x351983=JSON[_0xc5e8('0x8f')](_0x53beaa[_0xc5e8('0x55')][_0x483cde])['$gte'];var _0x3e3930=JSON[_0xc5e8('0x8f')](_0x53beaa[_0xc5e8('0x55')][_0x483cde])['$lte'];_0x28c786[_0xc5e8('0x8c')](_0xc5e8('0x90'),_0x351983,_0x3e3930);}else{if(_0x53beaa[_0xc5e8('0x55')][_0x483cde]===_0xc5e8('0x91')){_0x28c786[_0xc5e8('0x8c')]('i.'+_0x483cde+_0xc5e8('0x92'));}else{_0x28c786['where']('i.'+_0x483cde+_0xc5e8('0x93'),_0x53beaa[_0xc5e8('0x55')][_0x483cde]);}}});}if(_0x53beaa[_0xc5e8('0x55')]['read']){if(_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x94')]==0x1){_0x28c786['having']('`unreadMessages`\x20=\x200');}else{_0x28c786[_0xc5e8('0x7a')](_0xc5e8('0x95'));}}if(_0x53beaa[_0xc5e8('0x55')]['tag']){_0x231914=_['isArray'](_0x53beaa['query'][_0xc5e8('0x96')])?_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x96')]:new Array(_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x96')]);_0x231914[_0xc5e8('0x83')](function(_0x161b8f){_0x29fda6['or'](_0xc5e8('0x84'),'%,'+_0x161b8f+',%');});}if(_0x53beaa[_0xc5e8('0x55')]['filter']){var _0x227a60=_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x97')][_0xc5e8('0x98')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc5e8('0x99')](_0x227a60)){_0x354b59['or'](_0xc5e8('0x9a'),_0x227a60+'%');}else{_0x354b59['or'](_0xc5e8('0x9b'),qs[_0xc5e8('0x7d')](_0x227a60))['or'](_0xc5e8('0x9c'),_0x227a60+'%');}}}_0x28c786[_0xc5e8('0x8c')](_0x354b59);_0x28c786[_0xc5e8('0x9d')]('i.id');var _0x101e98={'type':db[_0xc5e8('0x9e')][_0xc5e8('0x9f')][_0xc5e8('0xa0')],'raw':!![]};var _0x1aefbd=_0x28c786['clone']();_0x1aefbd[_0xc5e8('0x5f')](_0xc5e8('0xa1'));_0x1aefbd[_0xc5e8('0x5f')](_0xc5e8('0xa2'),_0xc5e8('0x78'));if(_0x42e533['order']){_0x42e533['order']['forEach'](function(_0x3d1e0b){var _0x5e1af8=_0x3d1e0b[0x0]==='contactName'?_0x3d1e0b[0x0]:'i.'+_0x3d1e0b[0x0];_0x28c786[_0xc5e8('0xa3')](_0x5e1af8,_0x3d1e0b[0x1]===_0xc5e8('0xa4')?![]:!![]);});}if(!_[_0xc5e8('0xa5')](_0x231914)){_0x28c786[_0xc5e8('0x7a')](_0x29fda6);_0x1aefbd[_0xc5e8('0x8c')]('t.id\x20IN\x20?',_0x231914);}BPromise['resolve']()[_0xc5e8('0x21')](function(){if(!_0x5be5e6){if(_0x53beaa['query'][_0xc5e8('0x8b')])return;_0x1aefbd['where'](_0xc5e8('0xa6'));_0x28c786['where'](_0xc5e8('0xa6'));return;}if(_0x53beaa[_0xc5e8('0xa7')]['role']!==_0xc5e8('0xa8'))return;return _0x53beaa[_0xc5e8('0xa7')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xc5e8('0x21')](function(_0x15e902){if(_[_0xc5e8('0xa5')](_0x15e902)){_0x1aefbd[_0xc5e8('0x8c')](_0xc5e8('0xa9'));_0x28c786[_0xc5e8('0x8c')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1aefbd['where'](_0xc5e8('0xaa'),_[_0xc5e8('0x40')](_0x15e902,'id'));_0x28c786['where'](_0xc5e8('0xaa'),_[_0xc5e8('0x40')](_0x15e902,'id'));}});})[_0xc5e8('0x21')](function(){if(_0x53beaa[_0xc5e8('0xa7')][_0xc5e8('0xab')]==='agent'&&!_0x5be5e6&&!_0x53beaa['query'][_0xc5e8('0x8b')])return[];return db[_0xc5e8('0xac')]['query'](_0x1aefbd[_0xc5e8('0xad')](),_0x101e98);})[_0xc5e8('0x21')](function(_0x28e818){_0x1168a7['count']=_0x28e818[_0xc5e8('0x5a')];if(_0x1168a7[_0xc5e8('0x32')]===0x0)return[];return db['sequelize']['query'](_0x140717['toString'](),_0x101e98)[_0xc5e8('0x21')](function(_0x3d9ad0){_0x1eba6f=_[_0xc5e8('0xae')](_0x3d9ad0,'id');_0x101e98=_[_0xc5e8('0x3b')](_0x101e98,{'model':db[_0xc5e8('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53beaa[_0xc5e8('0x55')][_0xc5e8('0x58')]){_0x42e533[_0xc5e8('0x59')][_0xc5e8('0x83')](function(_0x3d562e){_0x28c786[_0xc5e8('0x5f')]('i.'+_0x3d562e);});}else{_0x28c786[_0xc5e8('0x5f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc5e8('0x78'));_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xaf'),_0xc5e8('0xb0'));_0x28c786[_0xc5e8('0x5f')]('a.mandatoryDisposition',_0xc5e8('0xb1'));_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xb2'),_0xc5e8('0xb3'));_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xb4'));_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xb5'),_0xc5e8('0xb6'));_0x28c786[_0xc5e8('0x5f')]('c.lastName','Contact.lastName');_0x28c786['field'](_0xc5e8('0xb7'),'Contact.email');_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xb8'),_0xc5e8('0xb9'));_0x28c786[_0xc5e8('0x5f')]('c.mobile',_0xc5e8('0xba'));_0x28c786['field']('c.fax',_0xc5e8('0xbb'));_0x28c786[_0xc5e8('0x5f')]('o.fullname','Owner.fullname');_0x28c786['field'](_0xc5e8('0xbc'),'Owner.internal');_0x28c786[_0xc5e8('0x5f')](_0xc5e8('0xbd'),_0xc5e8('0x42'));}if(_0x42e533[_0xc5e8('0x31')])_0x28c786[_0xc5e8('0x31')](_0x42e533[_0xc5e8('0x31')]);if(_0x42e533[_0xc5e8('0x2f')])_0x28c786['offset'](_0x42e533['offset']);return db['sequelize']['query'](_0x28c786[_0xc5e8('0xad')](),_0x101e98);})['then'](function(_0x2e4c93){if(_0x2e4c93[_0xc5e8('0x5a')]>0x0)_0xc699a5[_0xc5e8('0x8c')](_0xc5e8('0xbe'),_[_0xc5e8('0x40')](_0x2e4c93,'id'));return db[_0xc5e8('0xac')][_0xc5e8('0x55')](_0xc699a5[_0xc5e8('0xad')](),_0x101e98)[_0xc5e8('0x21')](function(_0x4cd0bd){var _0x1551a2=_[_0xc5e8('0xbf')](_0x4cd0bd,'ChatInteractionId');var _0x11954a=[];_0x2e4c93[_0xc5e8('0x83')](function(_0x43be6e){_0x11954a['push'](updateChatInteraction(_0x43be6e,_0x1eba6f,_0x1551a2));});return BPromise[_0xc5e8('0xc0')](_0x11954a);});});})[_0xc5e8('0x21')](function(_0x3afd41){_0x1168a7['rows']=_0x3afd41;return _0x1168a7;})[_0xc5e8('0x21')](respondWithFilteredResult(_0x572dc9,_0x42e533))[_0xc5e8('0x2c')](handleError(_0x572dc9,null));};exports[_0xc5e8('0xc1')]=function(_0xb60f4e,_0x2c111f){var _0x2456ba={'raw':![],'where':{'id':_0xb60f4e[_0xc5e8('0xc2')]['id']}},_0x44b8f0={};_0x44b8f0['model']=_[_0xc5e8('0x54')](db[_0xc5e8('0x50')][_0xc5e8('0xc3')]);_0x44b8f0[_0xc5e8('0x55')]=_[_0xc5e8('0x54')](_0xb60f4e[_0xc5e8('0x55')]);_0x44b8f0[_0xc5e8('0x56')]=_[_0xc5e8('0x57')](_0x44b8f0['model'],_0x44b8f0['query']);_0x2456ba[_0xc5e8('0x59')]=_[_0xc5e8('0x57')](_0x44b8f0[_0xc5e8('0x53')],qs[_0xc5e8('0x58')](_0xb60f4e['query'][_0xc5e8('0x58')]));_0x2456ba['attributes']=_0x2456ba['attributes']['length']?_0x2456ba[_0xc5e8('0x59')]:_0x44b8f0[_0xc5e8('0x53')];if(_0xb60f4e['query'][_0xc5e8('0xc4')]){_0x2456ba[_0xc5e8('0xc5')]=[{'all':!![]}];}_0x2456ba=_['merge']({},_0x2456ba,_0xb60f4e['options']);return db[_0xc5e8('0x50')][_0xc5e8('0x77')](_0x2456ba)[_0xc5e8('0x21')](handleEntityNotFound(_0x2c111f,null))[_0xc5e8('0x21')](respondWithResult(_0x2c111f,null))['catch'](handleError(_0x2c111f,null));};exports[_0xc5e8('0xc6')]=function(_0x2a0d47,_0x4c2b58){return db['ChatInteraction'][_0xc5e8('0xc6')](_0x2a0d47[_0xc5e8('0x89')],{})['then'](respondWithResult(_0x4c2b58,0xc9))[_0xc5e8('0x2c')](handleError(_0x4c2b58,null));};exports['update']=function(_0xec3779,_0x1430b7){if(_0xec3779[_0xc5e8('0x89')]['id']){delete _0xec3779[_0xc5e8('0x89')]['id'];}return db[_0xc5e8('0x50')][_0xc5e8('0x77')]({'where':{'id':_0xec3779[_0xc5e8('0xc2')]['id']}})[_0xc5e8('0x21')](handleEntityNotFound(_0x1430b7,null))[_0xc5e8('0x21')](saveUpdates(_0xec3779['body'],null))[_0xc5e8('0x21')](respondWithResult(_0x1430b7,null))[_0xc5e8('0x2c')](handleError(_0x1430b7,null));};exports[_0xc5e8('0x38')]=function(_0x5ffc06,_0x47750){return db[_0xc5e8('0x50')][_0xc5e8('0x77')]({'where':{'id':_0x5ffc06[_0xc5e8('0xc2')]['id']}})[_0xc5e8('0x21')](handleEntityNotFound(_0x47750,null))['then'](removeEntity(_0x47750,null))[_0xc5e8('0x2c')](handleError(_0x47750,null));};exports['describe']=function(_0x37808e,_0x403258){return db[_0xc5e8('0x50')][_0xc5e8('0xc7')]()[_0xc5e8('0x21')](respondWithResult(_0x403258,null))['catch'](handleError(_0x403258,null));};exports[_0xc5e8('0xc8')]=function(_0x39dedf,_0x373d8d){var _0x111833=_0x39dedf[_0xc5e8('0xc2')]['id'];var _0x16afbf;var _0x10398c;var _0x4d8213;return db[_0xc5e8('0x50')]['findOne']({'where':{'id':_0x111833}})[_0xc5e8('0x21')](function(_0x3cf66b){_0x16afbf=_0x3cf66b;return db['ChatWebsite']['findOne']({'where':{'id':_0x3cf66b[_0xc5e8('0x8b')]},'attributes':['id',_0xc5e8('0xc9'),_0xc5e8('0xca'),_0xc5e8('0xcb'),_0xc5e8('0xcc'),_0xc5e8('0xcd')],'raw':!![]});})[_0xc5e8('0x21')](function(_0x2f22a1){if(_0x2f22a1&&_0x2f22a1['vidaooApiKey']&&_0x2f22a1[_0xc5e8('0xca')]){_0x10398c=_0x2f22a1;var _0x24c89c={'interaction':{'id':_0x111833},'agent':{'id':_0x39dedf['user']['id'],'name':_0x39dedf[_0xc5e8('0xa7')][_0xc5e8('0x3a')],'fullname':_0x39dedf[_0xc5e8('0xa7')]['fullname'],'email':_0x39dedf['user']['email']},'contact':_0x39dedf[_0xc5e8('0x89')][_0xc5e8('0x3c')],'account':_0x39dedf['body'][_0xc5e8('0x3e')]};var _0x14ad36={'rejectUnauthorized':![],'method':'POST','url':_0xc5e8('0xce'),'headers':{'X-APIKEY':_0x2f22a1['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39dedf[_0xc5e8('0xa7')]['email']],'buttons':null,'topic':_0x10398c['vidaooTopic'],'note':_[_0xc5e8('0xcf')](_0x10398c[_0xc5e8('0xcc')])?null:getMustacheRender(_0x10398c[_0xc5e8('0xcc')],_0x24c89c),'metadata':null},'redirect':_0xc5e8('0xd0'),'json':!![]};try{if(!_['isNull'](_0x10398c['vidaooMetadata'])){var _0x328d33=getMustacheRender(_0x10398c['vidaooMetadata'],_0x24c89c);var _0x2d5d86=JSON[_0xc5e8('0x8f')](_0x328d33);_0x14ad36[_0xc5e8('0x89')][_0xc5e8('0xd1')]=_0x2d5d86;}}catch(_0x58e326){throw new db[(_0xc5e8('0x9e'))][(_0xc5e8('0xd2'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x14ad36);}else{throw new db[(_0xc5e8('0x9e'))][(_0xc5e8('0xd2'))](_0xc5e8('0xd3'));}})[_0xc5e8('0x21')](function(_0x47fd67){_0x4d8213=_0x47fd67;if(_0x4d8213['id']){var _0x43dc2e={'body':_0x4d8213[_0xc5e8('0xd4')],'ChatWebsiteId':_0x10398c['id'],'ChatInteractionId':_0x16afbf['id'],'direction':_0xc5e8('0xd5'),'UserId':_0x39dedf['user']['id']};return db[_0xc5e8('0xd6')][_0xc5e8('0xc6')](_0x43dc2e,{});}else{throw new db[(_0xc5e8('0x9e'))][(_0xc5e8('0xd2'))](_0xc5e8('0xd7'));}})['then'](function(){return _0x16afbf['updateAttributes']({'vidaooSessionId':_0x4d8213['id']});})[_0xc5e8('0x21')](respondWithResult(_0x373d8d,null))[_0xc5e8('0x2c')](handleError(_0x373d8d,null));};exports['customUpdate']=function(_0x1c49e7,_0x1d6dc2){if(_0x1c49e7[_0xc5e8('0x89')]['id']){delete _0x1c49e7['body']['id'];}return db[_0xc5e8('0x50')]['find']({'where':{'id':_0x1c49e7[_0xc5e8('0xc2')]['id']},'include':[{'model':db[_0xc5e8('0xd8')],'as':_0xc5e8('0xd9')}]})[_0xc5e8('0x21')](handleEntityNotFound(_0x1d6dc2,null))['then'](saveUpdates(_0x1c49e7['body'],null))[_0xc5e8('0x21')](respondWithResult(_0x1d6dc2,null))[_0xc5e8('0x2c')](handleError(_0x1d6dc2,null));};exports[_0xc5e8('0xda')]=function(_0x1ab21f,_0x1335b0,_0x323fe2){if(_0x1ab21f[_0xc5e8('0x89')]['id']){delete _0x1ab21f[_0xc5e8('0x89')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1ab21f[_0xc5e8('0xc2')]['id']}})[_0xc5e8('0x21')](function(_0x522781){if(!_0x522781){logger[_0xc5e8('0x28')](_0xc5e8('0xdb'),_0xc5e8('0xda'),0x194,_0xc5e8('0xdc'));_0x1335b0[_0xc5e8('0x2d')](0x194);}else{if(_0x522781[_0xc5e8('0x4c')]){throw new db['Sequelize'][(_0xc5e8('0xd2'))](_0xc5e8('0xdd'));}}return _0x522781;})['then'](function(_0x151097){if(_0x151097){return _0x151097[_0xc5e8('0x37')]({'closed':_0x1ab21f['body'][_0xc5e8('0x4b')],'disposition':_0x1ab21f[_0xc5e8('0x89')]['disposition']})[_0xc5e8('0x21')](function(_0x1ba8c2){return _0x1ba8c2;});}})['then'](function(_0x1172d3){return respondWithRpcPromise(_0xc5e8('0xde'),'abandon',_0x1ab21f['body'],client9004);})[_0xc5e8('0x21')](respondWithResult(_0x1335b0,null))['catch'](handleError(_0x1335b0,null));};exports['attachmentUpload']=function(_0x3f7d8d,_0x1e0442,_0x11de2d){_0x3f7d8d['body'][_0xc5e8('0x3a')]=_0x3f7d8d[_0xc5e8('0xdf')][_0xc5e8('0xe0')];_0x3f7d8d[_0xc5e8('0x89')][_0xc5e8('0xe1')]=_0x3f7d8d[_0xc5e8('0xdf')][_0xc5e8('0xe2')];_0x3f7d8d[_0xc5e8('0x89')][_0xc5e8('0x51')]=_0x3f7d8d['file'][_0xc5e8('0xe3')];return db[_0xc5e8('0xe4')][_0xc5e8('0xc6')](_0x3f7d8d[_0xc5e8('0x89')])[_0xc5e8('0x21')](respondWithResult(_0x1e0442,0xc9))[_0xc5e8('0x2c')](handleError(_0x1e0442,null));};exports['attachmentDownload']=function(_0x417fa9,_0xc27350,_0x5545cd){return db[_0xc5e8('0x50')][_0xc5e8('0xe5')]({'where':{'id':_0x417fa9['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc27350,null))['then'](function(_0x48eacc){if(_0x48eacc){if(_0x48eacc['closed']){return _0xc27350[_0xc5e8('0x39')](0x193)[_0xc5e8('0x34')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x417fa9[_0xc5e8('0x55')][_0xc5e8('0xe6')]},'raw':!![]})[_0xc5e8('0x21')](handleEntityNotFound(_0xc27350,null));}})[_0xc5e8('0x21')](function(_0x11c781){if(_0x11c781){var _0x25b054=_0x11c781['ChatOfflineMessageId']!==null;var _0x153cc4=path['join'](config[_0xc5e8('0xe7')],'server/files/attachments/');if(_0x25b054){_0x153cc4=path['join'](_0x153cc4,_0xc5e8('0xe8'));}var _0x51501f=path[_0xc5e8('0xe9')](_0x153cc4,_0x11c781[_0xc5e8('0xe1')]);return _0xc27350['download'](_0x51501f);}})['catch'](handleError(_0xc27350,null));};exports[_0xc5e8('0xea')]=function(_0x596e43,_0x14c039){var _0x482f31=null;var _0xcca015=null;var _0x14136a=null;var _0x4fdf36=null;if(_0x596e43[_0xc5e8('0x89')]['id']){delete _0x596e43[_0xc5e8('0x89')]['id'];}if(_0x596e43[_0xc5e8('0x89')]['mailTranscript']){_0x4fdf36=path[_0xc5e8('0xe9')](config['root'],'server/files/chat/upload/',util[_0xc5e8('0xeb')]('transcript-%s.txt',Date[_0xc5e8('0xec')]()));_0x596e43[_0xc5e8('0x89')][_0xc5e8('0xed')]=_0x4fdf36;}return db['ChatInteraction'][_0xc5e8('0x77')]({'where':{'id':_0x596e43['params']['id']},'include':[{'model':db[_0xc5e8('0xd6')],'as':'Messages','include':[{'model':db['User'],'as':_0xc5e8('0x86')}]}]})[_0xc5e8('0x21')](handleEntityNotFound(_0x14c039,null))['then'](saveUpdates(_0x596e43[_0xc5e8('0x89')],null))[_0xc5e8('0x21')](function(_0xbac1f7){if(_0xbac1f7){_0x482f31=_0xbac1f7;return db[_0xc5e8('0xee')]['find']({'where':{'id':_0x482f31['ChatWebsiteId']}});}})[_0xc5e8('0x21')](function(_0xfb91e5){if(_0xfb91e5){_0x14136a=_0xfb91e5;return db[_0xc5e8('0xd8')][_0xc5e8('0x77')]({'where':{'id':_0x482f31[_0xc5e8('0x7f')]}});}})[_0xc5e8('0x21')](function(_0x46935a){if(_0x46935a){_0xcca015=_0x46935a;if(_0x4fdf36){var _0xa48f9e=null;for(var _0x3efb77=0x1;_0x3efb77<_0x482f31[_0xc5e8('0xef')]['length'];++_0x3efb77){_0xa48f9e=_0x482f31[_0xc5e8('0xef')][_0x3efb77];var _0x425473=_0xa48f9e[_0xc5e8('0x4c')]?util['format'](_0xc5e8('0xf0'),_0x14136a['agentAlias'],_0xa48f9e[_0xc5e8('0x4c')]):'System';var _0x476d10=_0x596e43[_0xc5e8('0x89')][_0xc5e8('0xf1')]||util[_0xc5e8('0xeb')](_0xc5e8('0xf0'),_0xc5e8('0xf2'),_0xa48f9e[_0xc5e8('0x7f')]);switch(_0x14136a['agentIdentifier']){case _0xc5e8('0xf3'):_0x425473=_0xa48f9e['UserId']?util[_0xc5e8('0xeb')](_0xc5e8('0xf0'),_0x14136a['agentAlias'],_0xa48f9e[_0xc5e8('0x4c')]):'System';break;case _0xc5e8('0xf4'):_0x425473=_0xa48f9e['UserId']?_0xa48f9e['User']['alias']||_0xa48f9e['User'][_0xc5e8('0x41')]:_0xc5e8('0xf5');break;case _0xc5e8('0xf6'):_0x425473=_0xa48f9e[_0xc5e8('0x4c')]?_0xa48f9e['User']['fullname']:'System';break;default:_0x425473=_0xa48f9e[_0xc5e8('0x4c')]?util[_0xc5e8('0xeb')]('%s%d',_0x14136a[_0xc5e8('0xf7')],_0xa48f9e[_0xc5e8('0x4c')]):'System';}var _0x42a248=util['format'](_0xc5e8('0xf8'),moment(_0xa48f9e[_0xc5e8('0x8e')])['format'](_0xc5e8('0xf9')),_0xa48f9e[_0xc5e8('0xfa')]==='in'?_0x476d10:_0x425473,_0xa48f9e[_0xc5e8('0x89')]);if(!_0xa48f9e[_0xc5e8('0xfb')]){fs['appendFileSync'](_0x4fdf36,_0x42a248);}}return db['MailAccount'][_0xc5e8('0xe5')]({'where':{'service':!![]},'include':[{'model':db[_0xc5e8('0xfc')],'as':_0xc5e8('0xfd'),'raw':!![]}]});}}})[_0xc5e8('0x21')](function(_0x4f5dd4){if(_0x4f5dd4&&_0x4f5dd4[_0xc5e8('0xfd')]&&_0x596e43[_0xc5e8('0x89')]){var _0x434a77={'tls':{'rejectUnauthorized':![]}};if(_0x4f5dd4[_0xc5e8('0xfd')]['service']){_0x434a77[_0xc5e8('0xfe')]=_0x4f5dd4[_0xc5e8('0xfd')][_0xc5e8('0xfe')];}else{_0x434a77['host']=_0x4f5dd4['Smtp']['host'];_0x434a77[_0xc5e8('0xff')]=_0x4f5dd4['Smtp'][_0xc5e8('0xff')];_0x434a77[_0xc5e8('0x100')]=_0x4f5dd4['Smtp'][_0xc5e8('0x100')];}if(_0x4f5dd4[_0xc5e8('0xfd')][_0xc5e8('0x101')]){_0x434a77['auth']={'user':_0x4f5dd4[_0xc5e8('0xfd')][_0xc5e8('0xa7')],'pass':_0x4f5dd4[_0xc5e8('0xfd')][_0xc5e8('0x102')]};}return respondWithRpcPromise(_0xc5e8('0x103'),'sendMail',{'account':_0x434a77,'message':{'from':util[_0xc5e8('0xeb')]('\x22%s\x22\x20<%s>',_0x4f5dd4['name'],_0x4f5dd4['email']||_0x4f5dd4[_0xc5e8('0xfd')][_0xc5e8('0xa7')]),'to':_0x596e43['body'][_0xc5e8('0x104')],'subject':_0xc5e8('0x105'),'text':util[_0xc5e8('0xeb')](_0xc5e8('0x106'),_0x596e43['body'][_0xc5e8('0x104')]),'attachments':[{'path':_0x4fdf36}]}})[_0xc5e8('0x21')](function(){return _0x482f31;})['catch'](function(_0x269a99){console[_0xc5e8('0x28')](_0x269a99);});}else{return _0x482f31;}})['then'](respondWithStatusCode(_0x14c039,0xc8))[_0xc5e8('0x2c')](handleError(_0x14c039,null));};exports[_0xc5e8('0x107')]=function(_0x5c5981,_0x4ad89d,_0x413172){return db[_0xc5e8('0xd6')][_0xc5e8('0x77')]({'where':{'id':_0x5c5981[_0xc5e8('0xc2')]['id']}})['then'](handleEntityNotFound(_0x4ad89d,null))['then'](function(_0x5176ab){if(_0x5176ab){return _0x5176ab['addMessage'](_0x5c5981['body'][_0xc5e8('0x108')],_[_0xc5e8('0x109')](_0x5c5981[_0xc5e8('0x89')],[_0xc5e8('0x108'),'id'])||{});}})[_0xc5e8('0x21')](respondWithResult(_0x4ad89d,null))[_0xc5e8('0x2c')](handleError(_0x4ad89d,null));};exports[_0xc5e8('0x10a')]=function(_0x45ba49,_0x4e024d,_0x4ce8c8){var _0x273c41={'raw':![],'where':{}};var _0x3b5b2d={};var _0x45ee03={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x45ba49['params']['id']}})['then'](handleEntityNotFound(_0x4e024d,null))[_0xc5e8('0x21')](function(_0x475e3d){if(_0x475e3d){_0x3b5b2d['model']=_[_0xc5e8('0x54')](db[_0xc5e8('0xd6')]['rawAttributes']);_0x3b5b2d[_0xc5e8('0x55')]=_['keys'](_0x45ba49[_0xc5e8('0x55')]);_0x3b5b2d['filters']=_['intersection'](_0x3b5b2d[_0xc5e8('0x53')],_0x3b5b2d[_0xc5e8('0x55')]);_0x273c41[_0xc5e8('0x59')]=_['intersection'](_0x3b5b2d[_0xc5e8('0x53')],qs['fields'](_0x45ba49[_0xc5e8('0x55')]['fields']));_0x273c41[_0xc5e8('0x59')]=_0x273c41[_0xc5e8('0x59')][_0xc5e8('0x5a')]?_0x273c41['attributes']:_0x3b5b2d[_0xc5e8('0x53')];if(!_0x45ba49[_0xc5e8('0x55')]['hasOwnProperty']('nolimit')){_0x273c41['limit']=qs[_0xc5e8('0x31')](_0x45ba49['query'][_0xc5e8('0x31')]);_0x273c41[_0xc5e8('0x2f')]=qs[_0xc5e8('0x2f')](_0x45ba49['query'][_0xc5e8('0x2f')]);}_0x273c41['order']=qs[_0xc5e8('0x5d')](_0x45ba49[_0xc5e8('0x55')]['sort']);_0x273c41[_0xc5e8('0x8c')]=qs[_0xc5e8('0x56')](_[_0xc5e8('0x5e')](_0x45ba49[_0xc5e8('0x55')],_0x3b5b2d[_0xc5e8('0x56')]));_0x273c41[_0xc5e8('0x8c')][_0xc5e8('0x10b')]=_0x475e3d['id'];if(_0x45ba49['query'][_0xc5e8('0x97')]){_0x273c41[_0xc5e8('0x8c')]=_[_0xc5e8('0x3b')](_0x273c41[_0xc5e8('0x8c')],{'$or':_[_0xc5e8('0x40')](_0x273c41[_0xc5e8('0x59')],function(_0x38c87f){var _0x14c5f4={};_0x14c5f4[_0x38c87f]={'$like':'%'+_0x45ba49[_0xc5e8('0x55')][_0xc5e8('0x97')]+'%'};return _0x14c5f4;})});}if(_0x45ba49[_0xc5e8('0x55')][_0xc5e8('0x10c')]){var _0x4de05e=_0x45ba49[_0xc5e8('0x55')][_0xc5e8('0x10c')][_0xc5e8('0x43')](',');var _0x530abc={};_0x530abc[_0x4de05e[0x0]]={'$gte':moment(_0x4de05e[0x1])[_0xc5e8('0xeb')](_0xc5e8('0x10d'))};_0x273c41[_0xc5e8('0x8c')]=_[_0xc5e8('0x3b')](_0x273c41[_0xc5e8('0x8c')],_0x530abc);}_0x273c41=_[_0xc5e8('0x3b')]({},_0x273c41,_0x45ba49['options']);return db[_0xc5e8('0xd6')][_0xc5e8('0x32')]({'where':_0x273c41[_0xc5e8('0x8c')]})[_0xc5e8('0x21')](function(_0x54ab4e){_0x45ee03[_0xc5e8('0x32')]=_0x54ab4e;if(_0x45ba49[_0xc5e8('0x55')][_0xc5e8('0xc4')]){_0x273c41['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x273c41);})['then'](function(_0x139ade){_0x45ee03[_0xc5e8('0x10e')]=_0x139ade;return _0x45ee03;});}})['then'](respondWithFilteredResult(_0x4e024d,_0x273c41))[_0xc5e8('0x2c')](handleError(_0x4e024d,null));};exports[_0xc5e8('0x10f')]=function(_0xeec12f,_0x52ffc0,_0x5de656){var _0x28015c={'where':{}},_0x4cb7d5={},_0x5a238e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xc5e8('0xe5')]({'where':{'id':_0xeec12f['params']['id']}})[_0xc5e8('0x21')](handleEntityNotFound(_0x52ffc0,null))[_0xc5e8('0x21')](function(_0x51d490){if(_0x51d490){_0x4cb7d5[_0xc5e8('0x53')]=_[_0xc5e8('0x54')](db[_0xc5e8('0xd6')]['rawAttributes']);_0x4cb7d5['query']=_[_0xc5e8('0x54')](_0xeec12f['query']);_0x4cb7d5[_0xc5e8('0x56')]=_[_0xc5e8('0x57')](_0x4cb7d5[_0xc5e8('0x53')],_0x4cb7d5[_0xc5e8('0x55')]);_0x28015c[_0xc5e8('0x59')]=_['intersection'](_0x4cb7d5['model'],qs[_0xc5e8('0x58')](_0xeec12f[_0xc5e8('0x55')]['fields']));_0x28015c['attributes']=_0x28015c[_0xc5e8('0x59')][_0xc5e8('0x5a')]?_0x28015c['attributes']:_0x4cb7d5[_0xc5e8('0x53')];if(!_0xeec12f[_0xc5e8('0x55')][_0xc5e8('0x5b')](_0xc5e8('0x5c'))){_0x28015c['limit']=qs[_0xc5e8('0x31')](_0xeec12f[_0xc5e8('0x55')][_0xc5e8('0x31')]);_0x28015c[_0xc5e8('0x2f')]=qs[_0xc5e8('0x2f')](_0xeec12f[_0xc5e8('0x55')]['offset']);}_0x28015c['order']=qs[_0xc5e8('0x5d')](_0xeec12f[_0xc5e8('0x55')][_0xc5e8('0x5d')]);_0x28015c['where']=qs[_0xc5e8('0x56')](_['pick'](_0xeec12f[_0xc5e8('0x55')],_0x4cb7d5[_0xc5e8('0x56')]));_0x28015c[_0xc5e8('0x8c')]['ChatInteractionId']=_0x51d490['id'];if(_0xeec12f['query'][_0xc5e8('0x97')]){_0x28015c[_0xc5e8('0x8c')]=_['merge'](_0x28015c['where'],{'$or':_[_0xc5e8('0x40')](_0x28015c[_0xc5e8('0x59')],function(_0x3b2195){var _0x1532db={};_0x1532db[_0x3b2195]={'$like':'%'+_0xeec12f[_0xc5e8('0x55')][_0xc5e8('0x97')]+'%'};return _0x1532db;})});}_0x28015c['where'][_0xc5e8('0xfb')]=![];if(_0xeec12f[_0xc5e8('0x55')]['id']){_0x28015c[_0xc5e8('0x8c')]['id']={'$gt':_0xeec12f[_0xc5e8('0x55')]['id']};}_0x28015c=_[_0xc5e8('0x3b')]({},_0x28015c,_0xeec12f['options']);return db['ChatMessage'][_0xc5e8('0x32')]({'where':_0x28015c[_0xc5e8('0x8c')]})[_0xc5e8('0x21')](function(_0x986945){_0x5a238e[_0xc5e8('0x32')]=_0x986945;_0x28015c[_0xc5e8('0xc5')]=[];if(_0xeec12f['query'][_0xc5e8('0x110')]){_0x28015c[_0xc5e8('0xc5')][_0xc5e8('0x45')]({'model':db[_0xc5e8('0x86')],'as':_0xc5e8('0x86'),'attributes':['id',_0xc5e8('0x41'),'alias']});}if(_0xeec12f[_0xc5e8('0x55')]['includeAll']){_0x28015c[_0xc5e8('0xc5')]=[{'all':!![]}];}return db[_0xc5e8('0xd6')][_0xc5e8('0x111')](_0x28015c);})[_0xc5e8('0x21')](function(_0x1194c8){_0x5a238e['rows']=_0x1194c8;return _0x5a238e;});}})['then'](respondWithFilteredResult(_0x52ffc0,_0x28015c))[_0xc5e8('0x2c')](handleError(_0x52ffc0,null));};exports[_0xc5e8('0x112')]=function(_0x39f957,_0x3efd86,_0x4b977e){return db[_0xc5e8('0x50')][_0xc5e8('0x77')]({'where':{'id':_0x39f957['params']['id']}})['then'](handleEntityNotFound(_0x3efd86,null))['then'](function(_0x315d56){if(_0x315d56){return _0x315d56[_0xc5e8('0x113')](_0x39f957[_0xc5e8('0x89')][_0xc5e8('0x108')],_[_0xc5e8('0x109')](_0x39f957[_0xc5e8('0x89')],[_0xc5e8('0x108'),'id'])||{})['spread'](function(){return db[_0xc5e8('0x82')][_0xc5e8('0x111')]({'attributes':['id',_0xc5e8('0x3a'),'color'],'where':{'id':_0x39f957[_0xc5e8('0x89')]['ids']}});})[_0xc5e8('0x21')](function(_0x398439){socket[_0xc5e8('0x114')](_0xc5e8('0x115'),{'id':Number(_0x39f957[_0xc5e8('0xc2')]['id']),'tags':_0x398439||[]});return{'id':Number(_0x39f957[_0xc5e8('0xc2')]['id']),'tags':_0x398439||[]};});}})['then'](respondWithResult(_0x3efd86,null))[_0xc5e8('0x2c')](handleError(_0x3efd86,null));};exports['removeTags']=function(_0x4f23c0,_0x3eee76,_0x1ed18f){return db['ChatInteraction'][_0xc5e8('0x77')]({'where':{'id':_0x4f23c0[_0xc5e8('0xc2')]['id']}})[_0xc5e8('0x21')](handleEntityNotFound(_0x3eee76,null))['then'](function(_0xe2931f){if(_0xe2931f){return _0xe2931f[_0xc5e8('0x116')](_0x4f23c0[_0xc5e8('0x55')][_0xc5e8('0x108')]);}})['then'](respondWithStatusCode(_0x3eee76,null))[_0xc5e8('0x2c')](handleError(_0x3eee76,null));};exports[_0xc5e8('0x117')]=function(_0x121c85,_0x503e85){var _0x1a6408=moment()['unix']()['toString']();var _0x17d235=path[_0xc5e8('0xe9')](config[_0xc5e8('0xe7')],_0xc5e8('0x118'),'files',_0xc5e8('0x119'));var _0x1c0eac=path['join'](config[_0xc5e8('0xe7')],_0xc5e8('0x118'),_0xc5e8('0x11a'),_0xc5e8('0x11b'));var _0xf7d9f5=path['join'](_0x17d235,_0x1a6408);var _0x5ed07d=util[_0xc5e8('0xeb')](_0xc5e8('0x11c'),_0x121c85[_0xc5e8('0xc2')]['id'],_0x1a6408);var _0x429a98=path[_0xc5e8('0xe9')](_0x17d235,_0x5ed07d);var _0x81586f=[];_0x81586f[_0xc5e8('0x45')]({'model':db['User'],'as':_0xc5e8('0x86'),'attributes':['id',_0xc5e8('0x41')],'raw':!![]});_0x81586f['push']({'model':db[_0xc5e8('0xd8')],'as':_0xc5e8('0xd9'),'attributes':['id','firstName',_0xc5e8('0x11d')],'raw':!![]});if(_0x121c85[_0xc5e8('0x55')][_0xc5e8('0x11b')]){_0x81586f['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4bd2f6=[{'model':db[_0xc5e8('0xd6')],'as':_0xc5e8('0xef'),'attributes':['id',_0xc5e8('0x89'),_0xc5e8('0x8e'),_0xc5e8('0xfa'),_0xc5e8('0xfb'),_0xc5e8('0x94')],'include':_0x81586f}];_0x4bd2f6[_0xc5e8('0x45')]({'model':db[_0xc5e8('0xee')],'as':_0xc5e8('0x11e'),'attributes':['id',_0xc5e8('0x3a')]});_0x4bd2f6['push']({'model':db[_0xc5e8('0x86')],'as':_0xc5e8('0x11f'),'attributes':['id',_0xc5e8('0x41')]});return db['ChatInteraction'][_0xc5e8('0x77')]({'where':{'id':_0x121c85['params']['id']},'include':_0x4bd2f6})[_0xc5e8('0x21')](handleEntityNotFound(_0x503e85,null))[_0xc5e8('0x21')](function(_0x444283){if(_0x444283){var _0x4d566b=_0x444283['get']({'plain':!![]});fs[_0xc5e8('0x120')](_0xf7d9f5);var _0x7eb2a9={'channel':_0xc5e8('0x121'),'account':_0x4d566b[_0xc5e8('0x11e')][_0xc5e8('0x3a')],'agent':_0x4d566b['Owner']?_0x4d566b[_0xc5e8('0x11f')][_0xc5e8('0x41')]:_0xc5e8('0x122'),'createdAt':moment(_0x4d566b[_0xc5e8('0x8e')])[_0xc5e8('0xeb')](_0xc5e8('0x10d'))['toString'](),'closedAt':_0x4d566b[_0xc5e8('0x4b')]?moment(_0x4d566b[_0xc5e8('0x123')])[_0xc5e8('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc5e8('0xad')]():'','disposition':_0x4d566b['disposition'],'chatInfo':{'browser':_0x4d566b[_0xc5e8('0x124')],'os':_0x4d566b[_0xc5e8('0x125')],'referer':_0x4d566b['referer'],'customerIp':_0x4d566b['customerIp'],'customerPort':_0x4d566b[_0xc5e8('0x126')]?_0x4d566b['customerPort']:_0xc5e8('0x122')},'messages':_(_0x4d566b[_0xc5e8('0xef')])[_0xc5e8('0x127')]()['filter']({'secret':![]})[_0xc5e8('0x40')](function(_0x4cafda){if(_0x4cafda[_0xc5e8('0xe4')]){var _0x24b7fd=path[_0xc5e8('0xe9')](_0x1c0eac,_0x4cafda[_0xc5e8('0xe4')][_0xc5e8('0xe1')]);if(fs['existsSync'](_0x24b7fd)){fs[_0xc5e8('0x128')](_0x24b7fd)[_0xc5e8('0x129')](fs[_0xc5e8('0x12a')](path[_0xc5e8('0xe9')](_0xf7d9f5,_0x4cafda['Attachment'][_0xc5e8('0xe1')])));}}return{'date':moment(_0x4cafda[_0xc5e8('0x8e')])[_0xc5e8('0xeb')](_0xc5e8('0x10d'))[_0xc5e8('0xad')](),'sender':_0x4cafda[_0xc5e8('0xfa')]===_0xc5e8('0xd5')?_0x4cafda['User']?_0x4cafda['User'][_0xc5e8('0x41')]:_0xc5e8('0xf5'):_0x4cafda[_0xc5e8('0xd9')][_0xc5e8('0x12b')]+(_0x4cafda[_0xc5e8('0xd9')][_0xc5e8('0x11d')]?'\x20'+_0x4cafda['Contact'][_0xc5e8('0x11d')]:''),'body':_0x4cafda[_0xc5e8('0xe4')]?_0x4cafda[_0xc5e8('0xe4')][_0xc5e8('0xe1')]:_0x4cafda[_0xc5e8('0x89')],'direction':_0x4cafda[_0xc5e8('0xfa')]===_0xc5e8('0xd5')?'A':'C','secret':_0x4cafda['secret'],'read':_0x4cafda['read'],'attachment':_0x4cafda[_0xc5e8('0xe4')]};})[_0xc5e8('0x79')]()};return ejs[_0xc5e8('0x12c')](path['join'](config[_0xc5e8('0xe7')],_0xc5e8('0x118'),_0xc5e8('0x12d'),_0xc5e8('0x12e')),{'interaction':_0x7eb2a9})[_0xc5e8('0x21')](function(_0x599a1f){var _0x464c62=path[_0xc5e8('0xe9')](_0xf7d9f5,'transcript-'+_0x4d566b['id']+'-'+_0x1a6408+_0xc5e8('0x12f'));var _0x341a1d={'path':_0x464c62,'channel':'Chat','interactionId':_0x4d566b['id']};return pdf[_0xc5e8('0x130')](_0x599a1f,_0x341a1d);})[_0xc5e8('0x21')](function(){return new BPromise(function(_0x584f1d,_0x1c7910){zipdir(_0xf7d9f5,{'saveTo':_0x429a98},function(_0x4ea9d6,_0x247391){if(_0x4ea9d6)return _0x1c7910(_0x4ea9d6);return _0x584f1d(_0x247391);});})['then'](function(){return new BPromise(function(_0xc9824e,_0x266b7d){rimraf(_0xf7d9f5,function(_0x11d26b){if(_0x11d26b)_0x266b7d(_0x11d26b);return _0xc9824e();});});})[_0xc5e8('0x21')](function(){return _0x503e85[_0xc5e8('0x117')](_0x429a98,_0x5ed07d,function(_0xe6f9c){if(_0xe6f9c){console[_0xc5e8('0x131')](_0xc5e8('0x132'),_0xe6f9c);}else{fs[_0xc5e8('0x133')](_0x429a98);}});});});}else{return _0x503e85[_0xc5e8('0x2d')](0xc8);}})[_0xc5e8('0x2c')](handleError(_0x503e85,null));}; \ No newline at end of file +var _0x857e=['i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','ChatInteraction','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','create','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','download','format','now','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','alias','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','sendStatus','stack','name','send','body','contact','agent','interaction','Users','map','fullname','TagIds','split','Tags','push','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','field','color','from','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group'];(function(_0x1339ca,_0x50c04e){var _0x414b84=function(_0x393a41){while(--_0x393a41){_0x1339ca['push'](_0x1339ca['shift']());}};_0x414b84(++_0x50c04e);}(_0x857e,0x1d6));var _0xe857=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0x857e[_0x1ca4c3];return _0x4426a6;};'use strict';var emlformat=require(_0xe857('0x0'));var rimraf=require(_0xe857('0x1'));var zipdir=require(_0xe857('0x2'));var jsonpatch=require(_0xe857('0x3'));var rp=require(_0xe857('0x4'));var moment=require(_0xe857('0x5'));var BPromise=require(_0xe857('0x6'));var Mustache=require(_0xe857('0x7'));var util=require('util');var path=require(_0xe857('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe857('0x9'));var _=require('lodash');var squel=require(_0xe857('0xa'));var crypto=require(_0xe857('0xb'));var jsforce=require(_0xe857('0xc'));var deskjs=require(_0xe857('0xd'));var toCsv=require(_0xe857('0xe'));var querystring=require(_0xe857('0xf'));var Papa=require(_0xe857('0x10'));var Redis=require(_0xe857('0x11'));var authService=require(_0xe857('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe857('0x13'));var pdf=require(_0xe857('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe857('0x15'))(_0xe857('0x16'));var utils=require(_0xe857('0x17'));var config=require(_0xe857('0x18'));var licenseUtil=require(_0xe857('0x19'));var db=require(_0xe857('0x1a'))['db'];config[_0xe857('0x1b')]=_[_0xe857('0x1c')](config[_0xe857('0x1b')],{'host':_0xe857('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe857('0x1b')]));require(_0xe857('0x1e'))[_0xe857('0x1f')](socket);var jayson=require(_0xe857('0x20'));var client=jayson[_0xe857('0x21')]['http']({'port':0x232b});var client9004=jayson['client'][_0xe857('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x6e0d0d,_0x221a68,_0x4651d7,_0x370a65){return new BPromise(function(_0x3a4f1f,_0x3aa86f){var _0xd3cec5=_0x370a65||client;return _0xd3cec5['request'](_0x6e0d0d,_0x4651d7)[_0xe857('0x23')](function(_0x102e80){logger[_0xe857('0x24')](_0xe857('0x25'),_0x221a68,_0xe857('0x26'));logger[_0xe857('0x27')](_0xe857('0x28'),_0x221a68,_0xe857('0x26'),JSON['stringify'](_0x102e80));if(_0x102e80[_0xe857('0x29')]){if(_0x102e80[_0xe857('0x29')][_0xe857('0x2a')]===0x1f4){logger[_0xe857('0x29')](_0xe857('0x25'),_0x221a68,_0x102e80[_0xe857('0x29')][_0xe857('0x2b')]);return _0x3aa86f(_0x102e80[_0xe857('0x29')][_0xe857('0x2b')]);}logger[_0xe857('0x29')](_0xe857('0x25'),_0x221a68,_0x102e80[_0xe857('0x29')][_0xe857('0x2b')]);return _0x3a4f1f(_0x102e80[_0xe857('0x29')][_0xe857('0x2b')]);}else{logger[_0xe857('0x24')](_0xe857('0x25'),_0x221a68,_0xe857('0x26'));_0x3a4f1f(_0x102e80['result'][_0xe857('0x2b')]);}})[_0xe857('0x2c')](function(_0x351345){logger[_0xe857('0x29')](_0xe857('0x25'),_0x221a68,_0x351345);_0x3aa86f(_0x351345);});});}function respondWithStatusCode(_0x4b2d9f,_0x35d262){_0x35d262=_0x35d262||0xcc;return function(_0x3a63da){if(_0x3a63da){return _0x4b2d9f['sendStatus'](_0x35d262);}return _0x4b2d9f['status'](_0x35d262)[_0xe857('0x2d')]();};}function respondWithResult(_0x19725c,_0x16f9f1){_0x16f9f1=_0x16f9f1||0xc8;return function(_0x500d49){if(_0x500d49){return _0x19725c[_0xe857('0x2e')](_0x16f9f1)['json'](_0x500d49);}};}function respondWithFilteredResult(_0x597374,_0x35136b){return function(_0x43c637){if(_0x43c637){var _0x47b395=typeof _0x35136b[_0xe857('0x2f')]===_0xe857('0x30')&&typeof _0x35136b[_0xe857('0x31')]===_0xe857('0x30');var _0x23ac0e=_0x43c637[_0xe857('0x32')];var _0x5011ee=_0x47b395?0x0:_0x35136b[_0xe857('0x2f')];var _0x35ddb4=_0x47b395?_0x43c637[_0xe857('0x32')]:_0x35136b[_0xe857('0x2f')]+_0x35136b[_0xe857('0x31')];var _0x59328a;if(_0x35ddb4>=_0x23ac0e){_0x35ddb4=_0x23ac0e;_0x59328a=0xc8;}else{_0x59328a=0xce;}_0x597374[_0xe857('0x2e')](_0x59328a);return _0x597374[_0xe857('0x33')](_0xe857('0x34'),_0x5011ee+'-'+_0x35ddb4+'/'+_0x23ac0e)[_0xe857('0x35')](_0x43c637);}return null;};}function patchUpdates(_0xaae5b5){return function(_0x35ad19){try{jsonpatch[_0xe857('0x36')](_0x35ad19,_0xaae5b5,!![]);}catch(_0x51e562){return BPromise['reject'](_0x51e562);}return _0x35ad19[_0xe857('0x37')]();};}function saveUpdates(_0x50aab9,_0x1d0244){return function(_0x2f4ccc){if(_0x2f4ccc){return _0x2f4ccc[_0xe857('0x38')](_0x50aab9)[_0xe857('0x23')](function(_0x4164a6){return _0x4164a6;});}return null;};}function removeEntity(_0xdc5b52,_0x578fb8){return function(_0x1e3a5e){if(_0x1e3a5e){return _0x1e3a5e['destroy']()[_0xe857('0x23')](function(){_0xdc5b52[_0xe857('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3f07c,_0x1c220f){return function(_0xd42b73){if(!_0xd42b73){_0xb3f07c[_0xe857('0x39')](0x194);}return _0xd42b73;};}function handleError(_0x4dcdc0,_0x4968c9){_0x4968c9=_0x4968c9||0x1f4;return function(_0x2b0a70){logger['error'](_0x2b0a70[_0xe857('0x3a')]);if(_0x2b0a70[_0xe857('0x3b')]){delete _0x2b0a70['name'];}_0x4dcdc0[_0xe857('0x2e')](_0x4968c9)[_0xe857('0x3c')](_0x2b0a70);};}function getMustacheRender(_0x324933,_0x54ae56){return Mustache['render'](_0x324933,_['merge'](_0x54ae56[_0xe857('0x3d')],{'contact':_0x54ae56[_0xe857('0x3e')],'message':_0x54ae56['message'],'agent':_0x54ae56[_0xe857('0x3f')],'interaction':_0x54ae56[_0xe857('0x40')],'account':_0x54ae56['account']}))||'';}function getInteractionUsers(_0x31a2dc,_0x48084c){return new BPromise(function(_0x11d37d,_0x53832c){try{if(_0x48084c[_0x31a2dc['id']]){_0x31a2dc[_0xe857('0x41')]=_[_0xe857('0x42')](_0x48084c[_0x31a2dc['id']],function(_0x3eb96d){return{'id':_0x3eb96d['id'],'fullname':_0x3eb96d[_0xe857('0x43')]};});}}catch(_0x2eadf7){_0x53832c(_0x2eadf7);}_0x11d37d(_0x31a2dc);});}function getInteractionTags(_0x2e00c7,_0x48f2bf){return new BPromise(function(_0x1aba13,_0x1efb41){try{if(_0x2e00c7[_0xe857('0x44')]){_0x2e00c7['Tags']=[];_0x2e00c7[_0xe857('0x44')][_0xe857('0x45')](',')['forEach'](function(_0x397c64){_0x2e00c7[_0xe857('0x46')][_0xe857('0x47')](_0x48f2bf[_0x397c64]);});}delete _0x2e00c7[_0xe857('0x44')];}catch(_0x2248ba){_0x1efb41(_0x2248ba);}_0x1aba13(_0x2e00c7);});}function updateChatInteraction(_0x9abc68,_0x535d3b,_0x2271b5){return new BPromise(function(_0x2e9065,_0x32cebd){return getInteractionUsers(_0x9abc68,_0x2271b5)[_0xe857('0x23')](function(_0x1b6b04){return getInteractionTags(_0x1b6b04,_0x535d3b);})[_0xe857('0x23')](function(_0x46003a){return getStateInteraction(_0x46003a);})['then'](function(_0x1a57f7){_0x2e9065(_0x1a57f7);})[_0xe857('0x2c')](function(_0x4d4561){_0x32cebd(_0x4d4561);});});}function getStateInteraction(_0x533175){return new BPromise(function(_0x80e82e){_0x533175[_0xe857('0x48')]=0x0;_0x533175[_0xe857('0x49')]=0x0;_0x533175[_0xe857('0x4a')]=0x0;_0x533175[_0xe857('0x4b')]=0x0;_0x533175[_0xe857('0x4c')]=0x0;_0x533175[_0xe857('0x4d')]=0x0;if(!_0x533175[_0xe857('0x4e')]&&!_0x533175[_0xe857('0x4f')]){_0x533175[_0xe857('0x48')]+=0x1;}if(!_0x533175[_0xe857('0x4e')]&&_0x533175[_0xe857('0x4f')]){_0x533175[_0xe857('0x49')]+=0x1;if(_0x533175[_0xe857('0x48')]){_0x533175[_0xe857('0x48')]-=0x1;}}if(_0x533175[_0xe857('0x4e')]&&_0x533175[_0xe857('0x50')]===_0xe857('0x4c')){_0x533175['abandoned']+=0x1;if(_0x533175[_0xe857('0x48')]){_0x533175[_0xe857('0x48')]-=0x1;}}else if(_0x533175[_0xe857('0x4e')]&&!_0x533175[_0xe857('0x4f')]&&_0x533175[_0xe857('0x50')]){_0x533175[_0xe857('0x4b')]+=0x1;if(_0x533175[_0xe857('0x48')]){_0x533175['waiting']-=0x1;}}else if(_0x533175[_0xe857('0x4e')]&&_0x533175['UserId']){_0x533175['answered']+=0x1;if(_0x533175[_0xe857('0x49')]){_0x533175[_0xe857('0x49')]-=0x1;}}_0x533175[_0xe857('0x4d')]+=0x1;_0x80e82e(_0x533175);});}exports['index']=function(_0x258e20,_0x436699){var _0x4325d1={},_0x41490f={},_0x576f9e={'count':0x0,'rows':[]};var _0x29de53=_[_0xe857('0x42')](db['ChatInteraction']['rawAttributes'],function(_0x59bbdc){return{'name':_0x59bbdc['fieldName'],'type':_0x59bbdc[_0xe857('0x51')][_0xe857('0x52')]};});_0x41490f[_0xe857('0x53')]=_[_0xe857('0x42')](_0x29de53,_0xe857('0x3b'));_0x41490f[_0xe857('0x54')]=_[_0xe857('0x55')](_0x258e20[_0xe857('0x54')]);_0x41490f[_0xe857('0x56')]=_[_0xe857('0x57')](_0x41490f[_0xe857('0x53')],_0x41490f[_0xe857('0x54')]);_0x4325d1[_0xe857('0x58')]=_[_0xe857('0x57')](_0x41490f[_0xe857('0x53')],qs['fields'](_0x258e20[_0xe857('0x54')]['fields']));_0x4325d1[_0xe857('0x58')]=_0x4325d1['attributes'][_0xe857('0x59')]?_0x4325d1[_0xe857('0x58')]:_0x41490f['model'];if(!_0x258e20[_0xe857('0x54')]['hasOwnProperty'](_0xe857('0x5a'))){_0x4325d1[_0xe857('0x31')]=qs['limit'](_0x258e20[_0xe857('0x54')]['limit']);_0x4325d1['offset']=qs['offset'](_0x258e20['query'][_0xe857('0x2f')]);}_0x4325d1['order']=qs[_0xe857('0x5b')](_0x258e20['query'][_0xe857('0x5b')]);_0x4325d1[_0xe857('0x5c')]=qs[_0xe857('0x56')](_[_0xe857('0x5d')](_0x258e20[_0xe857('0x54')],_0x41490f['filters']),_0x29de53);var _0x4a3b7c=[];var _0x19c111=squel['select']()[_0xe857('0x5e')]('id')['field'](_0xe857('0x3b'))[_0xe857('0x5e')](_0xe857('0x5f'))[_0xe857('0x60')]('tools_tags');var _0x5a74db=squel['select']()[_0xe857('0x5e')](_0xe857('0x61'))[_0xe857('0x5e')]('u.fullname')['field'](_0xe857('0x62'))[_0xe857('0x60')]('user_has_chat_interactions','ui')[_0xe857('0x63')](_0xe857('0x64'),'u',_0xe857('0x65'));var _0x2328b4=squel['select']()[_0xe857('0x60')](_0xe857('0x66'),'i')[_0xe857('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xe857('0x64'),'o','o.id\x20=\x20i.UserId')[_0xe857('0x63')](_0xe857('0x67'),'a',_0xe857('0x68'))[_0xe857('0x63')](_0xe857('0x69'),'me',_0xe857('0x6a'))['left_join'](_0xe857('0x6b'),'it',_0xe857('0x6c'))[_0xe857('0x63')](_0xe857('0x6d'),'t',_0xe857('0x6e'));var _0x27725e=squel[_0xe857('0x6f')]();var _0x32eb00=[];var _0x3fc9ba=squel[_0xe857('0x6f')]();var _0x34e9de;if(_0x258e20['query'][_0xe857('0x70')]){_0x34e9de=as[_0xe857('0x71')](_0x258e20['query']['search']);var _0x189d3b=_0x34e9de['sqlOperator'];for(var _0x45460c=0x0;_0x45460c<_0x34e9de[_0xe857('0x72')][_0xe857('0x59')];_0x45460c++){var _0x3658b6=_0x34e9de['conditions'][_0x45460c];var _0x3f2709='i';var _0x5aef70=_[_0xe857('0x73')](_0x29de53,[_0xe857('0x3b'),_0x3658b6[_0xe857('0x5e')]]);if(!_0x5aef70){switch(_0x3658b6[_0xe857('0x5e')]){case _0xe857('0x74'):if(_0x3658b6[_0xe857('0x75')]==0x1){_0x2328b4[_0xe857('0x76')]('`'+_0x3658b6[_0xe857('0x5e')]+_0xe857('0x77'));}else{_0x2328b4['having']('`'+_0x3658b6[_0xe857('0x5e')]+_0xe857('0x78'));}break;case _0xe857('0x79'):if(_0x3658b6[_0xe857('0x7a')]===_0xe857('0x7b')){if(_0x3658b6[_0xe857('0x75')][_0xe857('0x45')]('\x20')['length']>0x1){_0x27725e[_0x189d3b](_0xe857('0x7c'),qs[_0xe857('0x7d')](_0x3658b6[_0xe857('0x75')]),null);}else{var _0x1639e0='%'+_0x3658b6[_0xe857('0x75')]+'%';_0x27725e[_0x189d3b](_0xe857('0x7e'),_0x1639e0,_0x1639e0,_0x1639e0);}}else{_0x5aef70=_[_0xe857('0x73')](_0x29de53,[_0xe857('0x3b'),'ContactId']);_0x3658b6[_0xe857('0x5e')]=_0xe857('0x7f');_0x20d33e=as['buildExpression'](_0x3f2709,_0x5aef70['type'],_0x3658b6);_0x27725e[_0x189d3b](_0x20d33e[_0xe857('0x80')],_0x20d33e[_0xe857('0x75')][_0xe857('0x81')],_0x20d33e[_0xe857('0x75')][_0xe857('0x2d')]);}break;case _0xe857('0x82'):var _0x4f3e8c=_0x3658b6[_0xe857('0x75')][_0xe857('0x45')](',')['map'](function(_0x57851e){return Number(_0x57851e);});_0x4f3e8c[_0xe857('0x83')](function(_0x421f9d){_0x3fc9ba['or'](_0xe857('0x84'),'%,'+_0x421f9d+',%');});_0x32eb00=_[_0xe857('0x85')](_0x32eb00,_0x4f3e8c);break;case _0xe857('0x86'):if(_0x3658b6[_0xe857('0x7a')]===_0xe857('0x7b')){_0x27725e[_0x189d3b](_0xe857('0x87'),'%'+_0x3658b6['value']+'%',null);}else{_0x5aef70=_[_0xe857('0x73')](_0x29de53,['name',_0xe857('0x4f')]);_0x3658b6[_0xe857('0x5e')]=_0xe857('0x4f');_0x20d33e=as['buildExpression'](_0x3f2709,_0x5aef70[_0xe857('0x51')],_0x3658b6);_0x27725e[_0x189d3b](_0x20d33e[_0xe857('0x80')],_0x20d33e['value'][_0xe857('0x81')],_0x20d33e[_0xe857('0x75')]['end']);}break;case'body':_0x20d33e=as['buildExpression']('me',null,_0x3658b6);_0x27725e[_0x189d3b](_0x20d33e['text'],_0x20d33e[_0xe857('0x75')][_0xe857('0x81')],_0x20d33e[_0xe857('0x75')][_0xe857('0x2d')]);break;}}else{var _0x20d33e=as[_0xe857('0x88')](_0x3f2709,_0x5aef70[_0xe857('0x51')],_0x3658b6);_0x27725e[_0x189d3b](_0x20d33e[_0xe857('0x80')],_0x20d33e['value']['start'],_0x20d33e[_0xe857('0x75')][_0xe857('0x2d')]);}}}else{var _0x2c9181=_(_0x258e20[_0xe857('0x54')])['keys']()[_0xe857('0x42')](function(_0x127329){return _[_0xe857('0x89')](_0x29de53,[_0xe857('0x3b'),_0x127329])?_0x127329:undefined;})[_0xe857('0x8a')]()[_0xe857('0x75')]();if(!_[_0xe857('0x8b')](_0x2c9181)){_0x2c9181[_0xe857('0x83')](function(_0x19a69d){if(_0x19a69d===_0xe857('0x8c')){_0x2328b4[_0xe857('0x5c')](_0xe857('0x8d'),[][_0xe857('0x8e')](_0x258e20[_0xe857('0x54')][_0x19a69d]));}else if(_0x19a69d==='createdAt'){var _0x4a2f99=JSON[_0xe857('0x8f')](_0x258e20[_0xe857('0x54')][_0x19a69d])[_0xe857('0x90')];var _0x17dd8d=JSON[_0xe857('0x8f')](_0x258e20[_0xe857('0x54')][_0x19a69d])[_0xe857('0x91')];_0x2328b4[_0xe857('0x5c')](_0xe857('0x92'),_0x4a2f99,_0x17dd8d);}else{if(_0x258e20[_0xe857('0x54')][_0x19a69d]===_0xe857('0x93')){_0x2328b4[_0xe857('0x5c')]('i.'+_0x19a69d+_0xe857('0x94'));}else{_0x2328b4[_0xe857('0x5c')]('i.'+_0x19a69d+'\x20=\x20?',_0x258e20['query'][_0x19a69d]);}}});}if(_0x258e20[_0xe857('0x54')][_0xe857('0x95')]){if(_0x258e20[_0xe857('0x54')]['read']==0x1){_0x2328b4[_0xe857('0x76')](_0xe857('0x96'));}else{_0x2328b4[_0xe857('0x76')](_0xe857('0x97'));}}if(_0x258e20[_0xe857('0x54')][_0xe857('0x98')]){_0x32eb00=_[_0xe857('0x99')](_0x258e20[_0xe857('0x54')]['tag'])?_0x258e20[_0xe857('0x54')][_0xe857('0x98')]:new Array(_0x258e20[_0xe857('0x54')][_0xe857('0x98')]);_0x32eb00[_0xe857('0x83')](function(_0x862461){_0x3fc9ba['or'](_0xe857('0x84'),'%,'+_0x862461+',%');});}if(_0x258e20[_0xe857('0x54')][_0xe857('0x9a')]){var _0x54d0d4=_0x258e20[_0xe857('0x54')]['filter'][_0xe857('0x9b')]('\x5c','\x5c\x5c')[_0xe857('0x9b')](/'/g,'\x27\x27');if(qs[_0xe857('0x9c')](_0x54d0d4)){_0x27725e['or'](_0xe857('0x9d'),_0x54d0d4+'%');}else{_0x27725e['or'](_0xe857('0x9e'),qs[_0xe857('0x7d')](_0x54d0d4))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x54d0d4+'%');}}}_0x2328b4[_0xe857('0x5c')](_0x27725e);_0x2328b4[_0xe857('0x9f')](_0xe857('0xa0'));var _0x5d4db4={'type':db[_0xe857('0xa1')][_0xe857('0xa2')][_0xe857('0xa3')],'raw':!![]};var _0x29c70c=_0x2328b4[_0xe857('0xa4')]();_0x29c70c[_0xe857('0x5e')](_0xe857('0xa0'));_0x29c70c[_0xe857('0x5e')](_0xe857('0xa5'),_0xe857('0x74'));if(_0x4325d1[_0xe857('0xa6')]){_0x4325d1[_0xe857('0xa6')][_0xe857('0x83')](function(_0x4fcdc5){var _0x2fa08a=_0x4fcdc5[0x0]===_0xe857('0xa7')?_0x4fcdc5[0x0]:'i.'+_0x4fcdc5[0x0];_0x2328b4[_0xe857('0xa6')](_0x2fa08a,_0x4fcdc5[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe857('0x8b')](_0x32eb00)){_0x2328b4[_0xe857('0x76')](_0x3fc9ba);_0x29c70c['where'](_0xe857('0xa8'),_0x32eb00);}BPromise['resolve']()[_0xe857('0x23')](function(){if(!_0x34e9de){if(_0x258e20['query']['ChatWebsiteId'])return;_0x29c70c[_0xe857('0x5c')](_0xe857('0xa9'));_0x2328b4[_0xe857('0x5c')](_0xe857('0xa9'));return;}if(_0x258e20[_0xe857('0xaa')][_0xe857('0xab')]!==_0xe857('0x3f'))return;return _0x258e20[_0xe857('0xaa')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xe857('0x23')](function(_0x56adf7){if(_[_0xe857('0x8b')](_0x56adf7)){_0x29c70c[_0xe857('0x5c')](_0xe857('0xac'));_0x2328b4['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x29c70c[_0xe857('0x5c')](_0xe857('0x8d'),_[_0xe857('0x42')](_0x56adf7,'id'));_0x2328b4[_0xe857('0x5c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe857('0x42')](_0x56adf7,'id'));}});})[_0xe857('0x23')](function(){if(_0x258e20[_0xe857('0xaa')][_0xe857('0xab')]===_0xe857('0x3f')&&!_0x34e9de&&!_0x258e20[_0xe857('0x54')][_0xe857('0x8c')])return[];return db[_0xe857('0xad')][_0xe857('0x54')](_0x29c70c[_0xe857('0xae')](),_0x5d4db4);})['then'](function(_0x4d8a70){_0x576f9e[_0xe857('0x32')]=_0x4d8a70[_0xe857('0x59')];if(_0x576f9e[_0xe857('0x32')]===0x0)return[];return db[_0xe857('0xad')][_0xe857('0x54')](_0x19c111[_0xe857('0xae')](),_0x5d4db4)[_0xe857('0x23')](function(_0x5e8750){_0x4a3b7c=_[_0xe857('0xaf')](_0x5e8750,'id');_0x5d4db4=_['merge'](_0x5d4db4,{'model':db[_0xe857('0xb0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x258e20[_0xe857('0x54')][_0xe857('0xb1')]){_0x4325d1[_0xe857('0x58')]['forEach'](function(_0x19c113){_0x2328b4['field']('i.'+_0x19c113);});}else{_0x2328b4[_0xe857('0x5e')](_0xe857('0xa5'),'unreadMessages');_0x2328b4['field'](_0xe857('0xb2'),_0xe857('0xb3'));_0x2328b4['field'](_0xe857('0xb4'),_0xe857('0xb5'));_0x2328b4[_0xe857('0x5e')](_0xe857('0xb6'),_0xe857('0xa7'));_0x2328b4['field'](_0xe857('0xb7'));_0x2328b4[_0xe857('0x5e')](_0xe857('0xb8'),'Contact.firstName');_0x2328b4[_0xe857('0x5e')](_0xe857('0xb9'),'Contact.lastName');_0x2328b4['field'](_0xe857('0xba'),_0xe857('0xbb'));_0x2328b4[_0xe857('0x5e')]('c.phone',_0xe857('0xbc'));_0x2328b4[_0xe857('0x5e')](_0xe857('0xbd'),_0xe857('0xbe'));_0x2328b4[_0xe857('0x5e')](_0xe857('0xbf'),'Contact.fax');_0x2328b4[_0xe857('0x5e')]('o.fullname','Owner.fullname');_0x2328b4[_0xe857('0x5e')](_0xe857('0xc0'),_0xe857('0xc1'));_0x2328b4[_0xe857('0x5e')](_0xe857('0xc2'),_0xe857('0x44'));}if(_0x4325d1[_0xe857('0x31')])_0x2328b4[_0xe857('0x31')](_0x4325d1[_0xe857('0x31')]);if(_0x4325d1[_0xe857('0x2f')])_0x2328b4['offset'](_0x4325d1[_0xe857('0x2f')]);return db['sequelize']['query'](_0x2328b4[_0xe857('0xae')](),_0x5d4db4);})[_0xe857('0x23')](function(_0x4c4921){if(_0x4c4921[_0xe857('0x59')]>0x0)_0x5a74db[_0xe857('0x5c')]('ui.ChatInteractionId\x20IN\x20?',_[_0xe857('0x42')](_0x4c4921,'id'));return db[_0xe857('0xad')][_0xe857('0x54')](_0x5a74db['toString'](),_0x5d4db4)[_0xe857('0x23')](function(_0x2aa62b){var _0x5e769a=_[_0xe857('0xc3')](_0x2aa62b,_0xe857('0xc4'));var _0x235f24=[];_0x4c4921[_0xe857('0x83')](function(_0x54eddc){_0x235f24[_0xe857('0x47')](updateChatInteraction(_0x54eddc,_0x4a3b7c,_0x5e769a));});return BPromise[_0xe857('0xc5')](_0x235f24);});});})[_0xe857('0x23')](function(_0x35cf7b){_0x576f9e[_0xe857('0xc6')]=_0x35cf7b;return _0x576f9e;})['then'](respondWithFilteredResult(_0x436699,_0x4325d1))['catch'](handleError(_0x436699,null));};exports[_0xe857('0xc7')]=function(_0xb280fc,_0x1f16f9){var _0x4e39b1={'raw':![],'where':{'id':_0xb280fc[_0xe857('0xc8')]['id']}},_0x16c996={};_0x16c996[_0xe857('0x53')]=_[_0xe857('0x55')](db[_0xe857('0xb0')][_0xe857('0xc9')]);_0x16c996[_0xe857('0x54')]=_['keys'](_0xb280fc[_0xe857('0x54')]);_0x16c996[_0xe857('0x56')]=_[_0xe857('0x57')](_0x16c996[_0xe857('0x53')],_0x16c996[_0xe857('0x54')]);_0x4e39b1[_0xe857('0x58')]=_[_0xe857('0x57')](_0x16c996[_0xe857('0x53')],qs[_0xe857('0xb1')](_0xb280fc[_0xe857('0x54')][_0xe857('0xb1')]));_0x4e39b1[_0xe857('0x58')]=_0x4e39b1[_0xe857('0x58')][_0xe857('0x59')]?_0x4e39b1[_0xe857('0x58')]:_0x16c996[_0xe857('0x53')];if(_0xb280fc['query'][_0xe857('0xca')]){_0x4e39b1[_0xe857('0xcb')]=[{'all':!![]}];}_0x4e39b1=_[_0xe857('0xcc')]({},_0x4e39b1,_0xb280fc['options']);return db[_0xe857('0xb0')][_0xe857('0x73')](_0x4e39b1)[_0xe857('0x23')](handleEntityNotFound(_0x1f16f9,null))[_0xe857('0x23')](respondWithResult(_0x1f16f9,null))[_0xe857('0x2c')](handleError(_0x1f16f9,null));};exports[_0xe857('0xcd')]=function(_0x10acd3,_0x14376e){return db[_0xe857('0xb0')][_0xe857('0xcd')](_0x10acd3['body'],{})[_0xe857('0x23')](respondWithResult(_0x14376e,0xc9))['catch'](handleError(_0x14376e,null));};exports['update']=function(_0x508020,_0x4c55aa){if(_0x508020[_0xe857('0x3d')]['id']){delete _0x508020[_0xe857('0x3d')]['id'];}return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x508020[_0xe857('0xc8')]['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x4c55aa,null))[_0xe857('0x23')](saveUpdates(_0x508020[_0xe857('0x3d')],null))[_0xe857('0x23')](respondWithResult(_0x4c55aa,null))[_0xe857('0x2c')](handleError(_0x4c55aa,null));};exports[_0xe857('0xce')]=function(_0x501e8c,_0x582d4f){return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x501e8c[_0xe857('0xc8')]['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x582d4f,null))[_0xe857('0x23')](removeEntity(_0x582d4f,null))['catch'](handleError(_0x582d4f,null));};exports[_0xe857('0xcf')]=function(_0x53991c,_0x189423){return db['ChatInteraction'][_0xe857('0xcf')]()[_0xe857('0x23')](respondWithResult(_0x189423,null))[_0xe857('0x2c')](handleError(_0x189423,null));};exports[_0xe857('0xd0')]=function(_0x580e25,_0x38c0e8){var _0x146d77=_0x580e25[_0xe857('0xc8')]['id'];var _0x3f63e7;var _0x3288ce;var _0x38d427;return db[_0xe857('0xb0')]['findOne']({'where':{'id':_0x146d77}})['then'](function(_0x5b98c6){_0x3f63e7=_0x5b98c6;return db['ChatWebsite'][_0xe857('0xd1')]({'where':{'id':_0x5b98c6[_0xe857('0x8c')]},'attributes':['id',_0xe857('0xd2'),_0xe857('0xd3'),'vidaooTopic',_0xe857('0xd4'),_0xe857('0xd5')],'raw':!![]});})[_0xe857('0x23')](function(_0x21d867){if(_0x21d867&&_0x21d867[_0xe857('0xd2')]&&_0x21d867[_0xe857('0xd3')]){_0x3288ce=_0x21d867;var _0x56dc36={'interaction':{'id':_0x146d77},'agent':{'id':_0x580e25[_0xe857('0xaa')]['id'],'name':_0x580e25['user']['name'],'fullname':_0x580e25['user'][_0xe857('0x43')],'email':_0x580e25['user'][_0xe857('0xd6')]},'contact':_0x580e25[_0xe857('0x3d')][_0xe857('0x3e')],'account':_0x580e25[_0xe857('0x3d')]['account']};var _0x3dba07={'rejectUnauthorized':![],'method':_0xe857('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x21d867['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x580e25['user'][_0xe857('0xd6')]],'buttons':null,'topic':_0x3288ce[_0xe857('0xd8')],'note':_['isNull'](_0x3288ce[_0xe857('0xd4')])?null:getMustacheRender(_0x3288ce[_0xe857('0xd4')],_0x56dc36),'metadata':null},'redirect':_0xe857('0xd9'),'json':!![]};try{if(!_[_0xe857('0xda')](_0x3288ce[_0xe857('0xd5')])){var _0x3186b0=getMustacheRender(_0x3288ce[_0xe857('0xd5')],_0x56dc36);var _0x2170b4=JSON[_0xe857('0x8f')](_0x3186b0);_0x3dba07[_0xe857('0x3d')][_0xe857('0xdb')]=_0x2170b4;}}catch(_0x5397cd){throw new db['Sequelize'][(_0xe857('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3dba07);}else{throw new db[(_0xe857('0xa1'))][(_0xe857('0xdc'))](_0xe857('0xdd'));}})[_0xe857('0x23')](function(_0x5afc65){_0x38d427=_0x5afc65;if(_0x38d427['id']){var _0x24747a={'body':_0x38d427[_0xe857('0xde')],'ChatWebsiteId':_0x3288ce['id'],'ChatInteractionId':_0x3f63e7['id'],'direction':_0xe857('0xdf'),'UserId':_0x580e25[_0xe857('0xaa')]['id']};return db['ChatMessage'][_0xe857('0xcd')](_0x24747a,{});}else{throw new db['Sequelize'][(_0xe857('0xdc'))](_0xe857('0xe0'));}})[_0xe857('0x23')](function(){return _0x3f63e7[_0xe857('0xe1')]({'vidaooSessionId':_0x38d427['id']});})[_0xe857('0x23')](respondWithResult(_0x38c0e8,null))[_0xe857('0x2c')](handleError(_0x38c0e8,null));};exports['customUpdate']=function(_0x62943e,_0x265fb5){if(_0x62943e[_0xe857('0x3d')]['id']){delete _0x62943e[_0xe857('0x3d')]['id'];}return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x62943e[_0xe857('0xc8')]['id']},'include':[{'model':db[_0xe857('0xe2')],'as':'Contact'}]})[_0xe857('0x23')](handleEntityNotFound(_0x265fb5,null))[_0xe857('0x23')](saveUpdates(_0x62943e[_0xe857('0x3d')],null))[_0xe857('0x23')](respondWithResult(_0x265fb5,null))['catch'](handleError(_0x265fb5,null));};exports[_0xe857('0xe3')]=function(_0x39ef76,_0x174629,_0x6d3605){if(_0x39ef76['body']['id']){delete _0x39ef76[_0xe857('0x3d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x39ef76['params']['id']}})[_0xe857('0x23')](function(_0x41e199){if(!_0x41e199){logger[_0xe857('0x29')](_0xe857('0xe4'),'abandon',0x194,'entity\x20not\x20found');_0x174629[_0xe857('0x39')](0x194);}else{if(_0x41e199[_0xe857('0x4f')]){throw new db[(_0xe857('0xa1'))][(_0xe857('0xdc'))](_0xe857('0xe5'));}}return _0x41e199;})[_0xe857('0x23')](function(_0x193c56){if(_0x193c56){return _0x193c56[_0xe857('0x38')]({'closed':_0x39ef76[_0xe857('0x3d')][_0xe857('0x4e')],'disposition':_0x39ef76['body'][_0xe857('0x50')]})['then'](function(_0x2634da){return _0x2634da;});}})[_0xe857('0x23')](function(_0x119da3){return respondWithRpcPromise(_0xe857('0xe6'),_0xe857('0xe3'),_0x39ef76[_0xe857('0x3d')],client9004);})[_0xe857('0x23')](respondWithResult(_0x174629,null))['catch'](handleError(_0x174629,null));};exports[_0xe857('0xe7')]=function(_0x3346b8,_0x237936,_0x39d2f8){_0x3346b8[_0xe857('0x3d')][_0xe857('0x3b')]=_0x3346b8[_0xe857('0xe8')][_0xe857('0xe9')];_0x3346b8['body']['basename']=_0x3346b8[_0xe857('0xe8')][_0xe857('0xea')];_0x3346b8[_0xe857('0x3d')][_0xe857('0x51')]=_0x3346b8[_0xe857('0xe8')][_0xe857('0xeb')];return db[_0xe857('0xec')]['create'](_0x3346b8[_0xe857('0x3d')])[_0xe857('0x23')](respondWithResult(_0x237936,0xc9))[_0xe857('0x2c')](handleError(_0x237936,null));};exports[_0xe857('0xed')]=function(_0x24a392,_0x16d7fc,_0x30af3d){return db[_0xe857('0xb0')][_0xe857('0xd1')]({'where':{'id':_0x24a392[_0xe857('0xc8')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x16d7fc,null))[_0xe857('0x23')](function(_0x5cfba5){if(_0x5cfba5){if(_0x5cfba5['closed']){return _0x16d7fc[_0xe857('0x2e')](0x193)['json']({'status':0x193,'message':_0xe857('0xee')});}return db[_0xe857('0xec')][_0xe857('0xd1')]({'where':{'id':_0x24a392[_0xe857('0x54')][_0xe857('0xef')]},'raw':!![]})[_0xe857('0x23')](handleEntityNotFound(_0x16d7fc,null));}})[_0xe857('0x23')](function(_0x4b3447){if(_0x4b3447){var _0x1a9c95=_0x4b3447['ChatOfflineMessageId']!==null;var _0x280af8=path[_0xe857('0xf0')](config[_0xe857('0xf1')],_0xe857('0xf2'));if(_0x1a9c95){_0x280af8=path[_0xe857('0xf0')](_0x280af8,'offline-chat/');}var _0x4b7797=path['join'](_0x280af8,_0x4b3447[_0xe857('0xf3')]);return _0x16d7fc[_0xe857('0xf4')](_0x4b7797);}})[_0xe857('0x2c')](handleError(_0x16d7fc,null));};exports['close']=function(_0x42d4ea,_0x9e1251){var _0x3dd1f2=null;var _0x2deea0=null;var _0x596224=null;var _0x4f3eea=null;if(_0x42d4ea[_0xe857('0x3d')]['id']){delete _0x42d4ea['body']['id'];}if(_0x42d4ea['body']['mailTranscript']){_0x4f3eea=path['join'](config[_0xe857('0xf1')],'server/files/chat/upload/',util[_0xe857('0xf5')]('transcript-%s.txt',Date[_0xe857('0xf6')]()));_0x42d4ea[_0xe857('0x3d')][_0xe857('0xf7')]=_0x4f3eea;}return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x42d4ea['params']['id']},'include':[{'model':db[_0xe857('0xf8')],'as':_0xe857('0xf9'),'include':[{'model':db[_0xe857('0x86')],'as':_0xe857('0x86')}]}]})['then'](handleEntityNotFound(_0x9e1251,null))['then'](saveUpdates(_0x42d4ea['body'],null))[_0xe857('0x23')](function(_0x52d1c1){if(_0x52d1c1){_0x3dd1f2=_0x52d1c1;return db[_0xe857('0xfa')]['find']({'where':{'id':_0x3dd1f2['ChatWebsiteId']}});}})[_0xe857('0x23')](function(_0x5a81d2){if(_0x5a81d2){_0x596224=_0x5a81d2;return db[_0xe857('0xe2')][_0xe857('0x73')]({'where':{'id':_0x3dd1f2[_0xe857('0x7f')]}});}})[_0xe857('0x23')](function(_0x5c5d99){if(_0x5c5d99){_0x2deea0=_0x5c5d99;if(_0x4f3eea){var _0x10452=null;for(var _0x4259c6=0x1;_0x4259c6<_0x3dd1f2['Messages'][_0xe857('0x59')];++_0x4259c6){_0x10452=_0x3dd1f2[_0xe857('0xf9')][_0x4259c6];var _0x5d31e6=_0x10452[_0xe857('0x4f')]?util[_0xe857('0xf5')](_0xe857('0xfb'),_0x596224[_0xe857('0xfc')],_0x10452[_0xe857('0x4f')]):_0xe857('0xfd');var _0x84aa15=_0x42d4ea[_0xe857('0x3d')][_0xe857('0xfe')]||util[_0xe857('0xf5')](_0xe857('0xfb'),_0xe857('0xff'),_0x10452[_0xe857('0x7f')]);switch(_0x596224[_0xe857('0x100')]){case'website_alias':_0x5d31e6=_0x10452[_0xe857('0x4f')]?util[_0xe857('0xf5')](_0xe857('0xfb'),_0x596224[_0xe857('0xfc')],_0x10452[_0xe857('0x4f')]):'System';break;case'agent_alias':_0x5d31e6=_0x10452[_0xe857('0x4f')]?_0x10452[_0xe857('0x86')]['alias']||_0x10452[_0xe857('0x86')]['fullname']:_0xe857('0xfd');break;case _0xe857('0x101'):_0x5d31e6=_0x10452[_0xe857('0x4f')]?_0x10452[_0xe857('0x86')][_0xe857('0x43')]:'System';break;default:_0x5d31e6=_0x10452[_0xe857('0x4f')]?util[_0xe857('0xf5')](_0xe857('0xfb'),_0x596224[_0xe857('0xfc')],_0x10452[_0xe857('0x4f')]):_0xe857('0xfd');}var _0x55ce42=util[_0xe857('0xf5')](_0xe857('0x102'),moment(_0x10452[_0xe857('0x103')])[_0xe857('0xf5')](_0xe857('0x104')),_0x10452['direction']==='in'?_0x84aa15:_0x5d31e6,_0x10452['body']);if(!_0x10452[_0xe857('0x105')]){fs['appendFileSync'](_0x4f3eea,_0x55ce42);}}return db[_0xe857('0x106')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe857('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0xe857('0x23')](function(_0x33b294){if(_0x33b294&&_0x33b294[_0xe857('0x108')]&&_0x42d4ea[_0xe857('0x3d')]){var _0x5bc916={'tls':{'rejectUnauthorized':![]}};if(_0x33b294[_0xe857('0x108')][_0xe857('0x109')]){_0x5bc916[_0xe857('0x109')]=_0x33b294['Smtp']['service'];}else{_0x5bc916[_0xe857('0x10a')]=_0x33b294[_0xe857('0x108')][_0xe857('0x10a')];_0x5bc916[_0xe857('0x10b')]=_0x33b294[_0xe857('0x108')][_0xe857('0x10b')];_0x5bc916[_0xe857('0x10c')]=_0x33b294['Smtp'][_0xe857('0x10c')];}if(_0x33b294[_0xe857('0x108')]['authentication']){_0x5bc916[_0xe857('0x10d')]={'user':_0x33b294[_0xe857('0x108')][_0xe857('0xaa')],'pass':_0x33b294[_0xe857('0x108')][_0xe857('0x10e')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5bc916,'message':{'from':util[_0xe857('0xf5')](_0xe857('0x10f'),_0x33b294['name'],_0x33b294[_0xe857('0xd6')]||_0x33b294[_0xe857('0x108')][_0xe857('0xaa')]),'to':_0x42d4ea['body']['mailTranscript'],'subject':_0xe857('0x110'),'text':util[_0xe857('0xf5')](_0xe857('0x111'),_0x42d4ea['body']['mailTranscript']),'attachments':[{'path':_0x4f3eea}]}})[_0xe857('0x23')](function(){return _0x3dd1f2;})['catch'](function(_0x51df86){console[_0xe857('0x29')](_0x51df86);});}else{return _0x3dd1f2;}})[_0xe857('0x23')](respondWithStatusCode(_0x9e1251,0xc8))[_0xe857('0x2c')](handleError(_0x9e1251,null));};exports['addMessage']=function(_0x573ea8,_0x371d4b,_0x248460){return db[_0xe857('0xf8')][_0xe857('0x73')]({'where':{'id':_0x573ea8['params']['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x371d4b,null))[_0xe857('0x23')](function(_0x2f535a){if(_0x2f535a){return _0x2f535a[_0xe857('0x112')](_0x573ea8['body'][_0xe857('0x113')],_['omit'](_0x573ea8[_0xe857('0x3d')],[_0xe857('0x113'),'id'])||{});}})[_0xe857('0x23')](respondWithResult(_0x371d4b,null))[_0xe857('0x2c')](handleError(_0x371d4b,null));};exports[_0xe857('0x114')]=function(_0xfe1dd7,_0x1adaf5,_0x413a05){var _0x2985c5={'raw':![],'where':{}};var _0x392fe3={};var _0x2a59ee={'count':0x0,'rows':[]};return db[_0xe857('0xb0')][_0xe857('0xd1')]({'where':{'id':_0xfe1dd7['params']['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x1adaf5,null))[_0xe857('0x23')](function(_0x392ed8){if(_0x392ed8){_0x392fe3[_0xe857('0x53')]=_['keys'](db[_0xe857('0xf8')]['rawAttributes']);_0x392fe3[_0xe857('0x54')]=_[_0xe857('0x55')](_0xfe1dd7[_0xe857('0x54')]);_0x392fe3[_0xe857('0x56')]=_['intersection'](_0x392fe3['model'],_0x392fe3[_0xe857('0x54')]);_0x2985c5['attributes']=_[_0xe857('0x57')](_0x392fe3[_0xe857('0x53')],qs['fields'](_0xfe1dd7[_0xe857('0x54')][_0xe857('0xb1')]));_0x2985c5[_0xe857('0x58')]=_0x2985c5[_0xe857('0x58')][_0xe857('0x59')]?_0x2985c5[_0xe857('0x58')]:_0x392fe3[_0xe857('0x53')];if(!_0xfe1dd7['query'][_0xe857('0x115')](_0xe857('0x5a'))){_0x2985c5[_0xe857('0x31')]=qs[_0xe857('0x31')](_0xfe1dd7[_0xe857('0x54')]['limit']);_0x2985c5['offset']=qs[_0xe857('0x2f')](_0xfe1dd7[_0xe857('0x54')][_0xe857('0x2f')]);}_0x2985c5[_0xe857('0xa6')]=qs[_0xe857('0x5b')](_0xfe1dd7[_0xe857('0x54')][_0xe857('0x5b')]);_0x2985c5[_0xe857('0x5c')]=qs[_0xe857('0x56')](_[_0xe857('0x5d')](_0xfe1dd7['query'],_0x392fe3[_0xe857('0x56')]));_0x2985c5[_0xe857('0x5c')][_0xe857('0xc4')]=_0x392ed8['id'];if(_0xfe1dd7[_0xe857('0x54')]['filter']){_0x2985c5[_0xe857('0x5c')]=_[_0xe857('0xcc')](_0x2985c5[_0xe857('0x5c')],{'$or':_['map'](_0x2985c5[_0xe857('0x58')],function(_0x53cdcd){var _0x2f698f={};_0x2f698f[_0x53cdcd]={'$like':'%'+_0xfe1dd7[_0xe857('0x54')][_0xe857('0x9a')]+'%'};return _0x2f698f;})});}if(_0xfe1dd7[_0xe857('0x54')][_0xe857('0x90')]){var _0x19a49a=_0xfe1dd7['query']['$gte'][_0xe857('0x45')](',');var _0x17a0ff={};_0x17a0ff[_0x19a49a[0x0]]={'$gte':moment(_0x19a49a[0x1])[_0xe857('0xf5')](_0xe857('0x116'))};_0x2985c5[_0xe857('0x5c')]=_[_0xe857('0xcc')](_0x2985c5['where'],_0x17a0ff);}_0x2985c5=_[_0xe857('0xcc')]({},_0x2985c5,_0xfe1dd7['options']);return db['ChatMessage'][_0xe857('0x32')]({'where':_0x2985c5[_0xe857('0x5c')]})[_0xe857('0x23')](function(_0x3f5a88){_0x2a59ee[_0xe857('0x32')]=_0x3f5a88;if(_0xfe1dd7[_0xe857('0x54')]['includeAll']){_0x2985c5[_0xe857('0xcb')]=[{'all':!![]}];}return db[_0xe857('0xf8')][_0xe857('0x117')](_0x2985c5);})[_0xe857('0x23')](function(_0x3f4915){_0x2a59ee[_0xe857('0xc6')]=_0x3f4915;return _0x2a59ee;});}})[_0xe857('0x23')](respondWithFilteredResult(_0x1adaf5,_0x2985c5))['catch'](handleError(_0x1adaf5,null));};exports[_0xe857('0x118')]=function(_0x47c18e,_0x12c163,_0x58f253){var _0x48b8bb={'where':{}},_0x9fb50a={},_0x20e61a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe857('0xd1')]({'where':{'id':_0x47c18e[_0xe857('0xc8')]['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x12c163,null))[_0xe857('0x23')](function(_0x2bbaf0){if(_0x2bbaf0){_0x9fb50a[_0xe857('0x53')]=_[_0xe857('0x55')](db[_0xe857('0xf8')][_0xe857('0xc9')]);_0x9fb50a[_0xe857('0x54')]=_[_0xe857('0x55')](_0x47c18e['query']);_0x9fb50a['filters']=_['intersection'](_0x9fb50a['model'],_0x9fb50a[_0xe857('0x54')]);_0x48b8bb[_0xe857('0x58')]=_[_0xe857('0x57')](_0x9fb50a['model'],qs[_0xe857('0xb1')](_0x47c18e[_0xe857('0x54')][_0xe857('0xb1')]));_0x48b8bb['attributes']=_0x48b8bb['attributes'][_0xe857('0x59')]?_0x48b8bb[_0xe857('0x58')]:_0x9fb50a[_0xe857('0x53')];if(!_0x47c18e[_0xe857('0x54')][_0xe857('0x115')](_0xe857('0x5a'))){_0x48b8bb[_0xe857('0x31')]=qs['limit'](_0x47c18e[_0xe857('0x54')][_0xe857('0x31')]);_0x48b8bb['offset']=qs[_0xe857('0x2f')](_0x47c18e[_0xe857('0x54')]['offset']);}_0x48b8bb[_0xe857('0xa6')]=qs[_0xe857('0x5b')](_0x47c18e[_0xe857('0x54')][_0xe857('0x5b')]);_0x48b8bb['where']=qs[_0xe857('0x56')](_[_0xe857('0x5d')](_0x47c18e[_0xe857('0x54')],_0x9fb50a['filters']));_0x48b8bb['where'][_0xe857('0xc4')]=_0x2bbaf0['id'];if(_0x47c18e['query'][_0xe857('0x9a')]){_0x48b8bb[_0xe857('0x5c')]=_['merge'](_0x48b8bb['where'],{'$or':_['map'](_0x48b8bb[_0xe857('0x58')],function(_0x24a270){var _0x1eb01a={};_0x1eb01a[_0x24a270]={'$like':'%'+_0x47c18e['query'][_0xe857('0x9a')]+'%'};return _0x1eb01a;})});}_0x48b8bb['where'][_0xe857('0x105')]=![];if(_0x47c18e[_0xe857('0x54')]['id']){_0x48b8bb[_0xe857('0x5c')]['id']={'$gt':_0x47c18e[_0xe857('0x54')]['id']};}_0x48b8bb=_[_0xe857('0xcc')]({},_0x48b8bb,_0x47c18e['options']);return db[_0xe857('0xf8')][_0xe857('0x32')]({'where':_0x48b8bb[_0xe857('0x5c')]})[_0xe857('0x23')](function(_0x25dd6c){_0x20e61a[_0xe857('0x32')]=_0x25dd6c;_0x48b8bb['include']=[];if(_0x47c18e['query'][_0xe857('0x119')]){_0x48b8bb[_0xe857('0xcb')][_0xe857('0x47')]({'model':db[_0xe857('0x86')],'as':_0xe857('0x86'),'attributes':['id',_0xe857('0x43'),_0xe857('0x11a')]});}if(_0x47c18e['query'][_0xe857('0xca')]){_0x48b8bb['include']=[{'all':!![]}];}return db[_0xe857('0xf8')]['findAll'](_0x48b8bb);})[_0xe857('0x23')](function(_0x13f37b){_0x20e61a['rows']=_0x13f37b;return _0x20e61a;});}})['then'](respondWithFilteredResult(_0x12c163,_0x48b8bb))[_0xe857('0x2c')](handleError(_0x12c163,null));};exports[_0xe857('0x11b')]=function(_0x3722f7,_0x50ee7c,_0x43f0a2){return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x3722f7['params']['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x50ee7c,null))['then'](function(_0x98361f){if(_0x98361f){return _0x98361f[_0xe857('0x11c')](_0x3722f7['body'][_0xe857('0x113')],_[_0xe857('0x11d')](_0x3722f7[_0xe857('0x3d')],[_0xe857('0x113'),'id'])||{})[_0xe857('0x11e')](function(){return db[_0xe857('0x82')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x3722f7[_0xe857('0x3d')][_0xe857('0x113')]}});})[_0xe857('0x23')](function(_0x34ebd8){socket['emit'](_0xe857('0x11f'),{'id':Number(_0x3722f7['params']['id']),'tags':_0x34ebd8||[]});return{'id':Number(_0x3722f7[_0xe857('0xc8')]['id']),'tags':_0x34ebd8||[]};});}})[_0xe857('0x23')](respondWithResult(_0x50ee7c,null))[_0xe857('0x2c')](handleError(_0x50ee7c,null));};exports[_0xe857('0x120')]=function(_0x308112,_0x2580fd,_0x4d98f7){return db[_0xe857('0xb0')][_0xe857('0x73')]({'where':{'id':_0x308112[_0xe857('0xc8')]['id']}})[_0xe857('0x23')](handleEntityNotFound(_0x2580fd,null))[_0xe857('0x23')](function(_0x531e2d){if(_0x531e2d){return _0x531e2d['removeTags'](_0x308112[_0xe857('0x54')][_0xe857('0x113')]);}})['then'](respondWithStatusCode(_0x2580fd,null))[_0xe857('0x2c')](handleError(_0x2580fd,null));};exports['download']=function(_0x21ae39,_0x3a9812){var _0x39233a=moment()['unix']()[_0xe857('0xae')]();var _0x4cb209=path['join'](config[_0xe857('0xf1')],_0xe857('0x121'),_0xe857('0x122'),_0xe857('0x123'));var _0x3fc7ff=path[_0xe857('0xf0')](config[_0xe857('0xf1')],_0xe857('0x121'),'files',_0xe857('0x124'));var _0x4d60bc=path[_0xe857('0xf0')](_0x4cb209,_0x39233a);var _0x479d6b=util['format'](_0xe857('0x125'),_0x21ae39['params']['id'],_0x39233a);var _0x550af5=path[_0xe857('0xf0')](_0x4cb209,_0x479d6b);var _0x1bcf10=[];_0x1bcf10[_0xe857('0x47')]({'model':db['User'],'as':_0xe857('0x86'),'attributes':['id','fullname'],'raw':!![]});_0x1bcf10['push']({'model':db['CmContact'],'as':_0xe857('0x79'),'attributes':['id',_0xe857('0x126'),_0xe857('0x127')],'raw':!![]});if(_0x21ae39['query'][_0xe857('0x124')]){_0x1bcf10[_0xe857('0x47')]({'model':db[_0xe857('0xec')],'as':'Attachment','raw':!![]});}var _0x2db5cc=[{'model':db[_0xe857('0xf8')],'as':_0xe857('0xf9'),'attributes':['id','body',_0xe857('0x103'),_0xe857('0x128'),_0xe857('0x105'),'read'],'include':_0x1bcf10}];_0x2db5cc['push']({'model':db[_0xe857('0xfa')],'as':_0xe857('0x129'),'attributes':['id',_0xe857('0x3b')]});_0x2db5cc['push']({'model':db['User'],'as':'Owner','attributes':['id',_0xe857('0x43')]});return db[_0xe857('0xb0')]['find']({'where':{'id':_0x21ae39[_0xe857('0xc8')]['id']},'include':_0x2db5cc})['then'](handleEntityNotFound(_0x3a9812,null))[_0xe857('0x23')](function(_0xbb65a1){if(_0xbb65a1){var _0x51ff6f=_0xbb65a1['get']({'plain':!![]});fs[_0xe857('0x12a')](_0x4d60bc);var _0x4102f1={'channel':'Chat','account':_0x51ff6f[_0xe857('0x129')]['name'],'agent':_0x51ff6f['Owner']?_0x51ff6f['Owner'][_0xe857('0x43')]:_0xe857('0x12b'),'createdAt':moment(_0x51ff6f['createdAt'])['format'](_0xe857('0x116'))[_0xe857('0xae')](),'closedAt':_0x51ff6f[_0xe857('0x4e')]?moment(_0x51ff6f['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x51ff6f[_0xe857('0x50')],'chatInfo':{'browser':_0x51ff6f[_0xe857('0x12c')],'os':_0x51ff6f['osName'],'referer':_0x51ff6f[_0xe857('0x12d')],'customerIp':_0x51ff6f[_0xe857('0x12e')],'customerPort':_0x51ff6f[_0xe857('0x12f')]?_0x51ff6f['customerPort']:_0xe857('0x12b')},'messages':_(_0x51ff6f[_0xe857('0xf9')])[_0xe857('0x130')]()[_0xe857('0x9a')]({'secret':![]})['map'](function(_0x339c65){if(_0x339c65['Attachment']){var _0x4c0ce6=path[_0xe857('0xf0')](_0x3fc7ff,_0x339c65[_0xe857('0xec')][_0xe857('0xf3')]);if(fs[_0xe857('0x131')](_0x4c0ce6)){fs['createReadStream'](_0x4c0ce6)['pipe'](fs[_0xe857('0x132')](path[_0xe857('0xf0')](_0x4d60bc,_0x339c65[_0xe857('0xec')][_0xe857('0xf3')])));}}return{'date':moment(_0x339c65[_0xe857('0x103')])[_0xe857('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe857('0xae')](),'sender':_0x339c65[_0xe857('0x128')]==='out'?_0x339c65[_0xe857('0x86')]?_0x339c65[_0xe857('0x86')][_0xe857('0x43')]:_0xe857('0xfd'):_0x339c65[_0xe857('0x79')][_0xe857('0x126')]+(_0x339c65[_0xe857('0x79')][_0xe857('0x127')]?'\x20'+_0x339c65[_0xe857('0x79')][_0xe857('0x127')]:''),'body':_0x339c65[_0xe857('0xec')]?_0x339c65[_0xe857('0xec')][_0xe857('0xf3')]:_0x339c65[_0xe857('0x3d')],'direction':_0x339c65[_0xe857('0x128')]==='out'?'A':'C','secret':_0x339c65['secret'],'read':_0x339c65[_0xe857('0x95')],'attachment':_0x339c65[_0xe857('0xec')]};})[_0xe857('0x75')]()};return ejs[_0xe857('0x133')](path[_0xe857('0xf0')](config[_0xe857('0xf1')],_0xe857('0x121'),_0xe857('0x134'),_0xe857('0x135')),{'interaction':_0x4102f1})[_0xe857('0x23')](function(_0x4e62bc){var _0x1e8006=path[_0xe857('0xf0')](_0x4d60bc,_0xe857('0x136')+_0x51ff6f['id']+'-'+_0x39233a+_0xe857('0x137'));var _0x594c54={'path':_0x1e8006,'channel':_0xe857('0x138'),'interactionId':_0x51ff6f['id']};return pdf['createPdfFromHTML'](_0x4e62bc,_0x594c54);})[_0xe857('0x23')](function(){return new BPromise(function(_0x861c4d,_0x12ab7b){zipdir(_0x4d60bc,{'saveTo':_0x550af5},function(_0x1a4796,_0x282ee3){if(_0x1a4796)return _0x12ab7b(_0x1a4796);return _0x861c4d(_0x282ee3);});})[_0xe857('0x23')](function(){return new BPromise(function(_0x15b6dd,_0xf49e2b){rimraf(_0x4d60bc,function(_0x37b3ef){if(_0x37b3ef)_0xf49e2b(_0x37b3ef);return _0x15b6dd();});});})[_0xe857('0x23')](function(){return _0x3a9812[_0xe857('0xf4')](_0x550af5,_0x479d6b,function(_0x6e196f){if(_0x6e196f){console[_0xe857('0x139')]('err',_0x6e196f);}else{fs[_0xe857('0x13a')](_0x550af5);}});});});}else{return _0x3a9812[_0xe857('0x39')](0xc8);}})[_0xe857('0x2c')](handleError(_0x3a9812,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d1c3142..6173e9f 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 _0xc178=['save','getUsers','then','setDataValue','findAll','length','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xc178,0x183));var _0x8c17=function(_0x15178d,_0x3e7ab3){_0x15178d=_0x15178d-0x0;var _0x2bc3ac=_0xc178[_0x15178d];return _0x2bc3ac;};'use strict';var EventEmitter=require(_0x8c17('0x0'));var ChatInteraction=require(_0x8c17('0x1'))['db'][_0x8c17('0x2')];var ChatMessage=require(_0x8c17('0x1'))['db'][_0x8c17('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8c17('0x4')](0x0);var events={'afterCreate':_0x8c17('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x211c00){return function(_0x55fa66,_0x3f94ba,_0x1c4dcb){_0x55fa66[_0x8c17('0x6')]({'attributes':['id'],'raw':!![]})[_0x8c17('0x7')](function(_0x5d19f3){_0x55fa66[_0x8c17('0x8')]('Users',_0x5d19f3['map'](function(_0x154610){return{'id':_0x154610['id']};}));return ChatMessage[_0x8c17('0x9')]({'where':{'ChatInteractionId':_0x55fa66['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8c17('0x7')](function(_0x23399a){_0x55fa66['setDataValue']('unreadMessages',_0x23399a[_0x8c17('0xa')]);ChatInteractionEvents[_0x8c17('0xb')](_0x211c00+':'+_0x55fa66['id'],_0x55fa66);ChatInteractionEvents['emit'](_0x211c00,_0x55fa66);_0x1c4dcb(null);})['catch'](_0x1c4dcb(null));};}for(var e in events){if(events[_0x8c17('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x8c17('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xd03f=['length','emit','catch','exports','events','ChatInteraction','setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages'];(function(_0x349d70,_0x5d790b){var _0x11fad1=function(_0x1e9b23){while(--_0x1e9b23){_0x349d70['push'](_0x349d70['shift']());}};_0x11fad1(++_0x5d790b);}(_0xd03f,0xc8));var _0xfd03=function(_0xa4b692,_0xaaa99c){_0xa4b692=_0xa4b692-0x0;var _0x858806=_0xd03f[_0xa4b692];return _0x858806;};'use strict';var EventEmitter=require(_0xfd03('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xfd03('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfd03('0x2')](0x0);var events={'afterCreate':_0xfd03('0x3'),'afterUpdate':_0xfd03('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1eca67){return function(_0x21ca80,_0x399bd1,_0x56c898){_0x21ca80['getUsers']({'attributes':['id'],'raw':!![]})[_0xfd03('0x5')](function(_0x3c409c){_0x21ca80[_0xfd03('0x6')]('Users',_0x3c409c[_0xfd03('0x7')](function(_0xb960d2){return{'id':_0xb960d2['id']};}));return ChatMessage[_0xfd03('0x8')]({'where':{'ChatInteractionId':_0x21ca80['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfd03('0x5')](function(_0x125680){_0x21ca80[_0xfd03('0x6')](_0xfd03('0x9'),_0x125680[_0xfd03('0xa')]);ChatInteractionEvents[_0xfd03('0xb')](_0x1eca67+':'+_0x21ca80['id'],_0x21ca80);ChatInteractionEvents['emit'](_0x1eca67,_0x21ca80);_0x56c898(null);})[_0xfd03('0xc')](_0x56c898(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xfd03('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 05595f8..1ce8fdc 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 _0x9728=['exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes'];(function(_0x1828c3,_0x36d621){var _0x2bb9a6=function(_0x1a254b){while(--_0x1a254b){_0x1828c3['push'](_0x1828c3['shift']());}};_0x2bb9a6(++_0x36d621);}(_0x9728,0x117));var _0x8972=function(_0x2cb538,_0x503c72){_0x2cb538=_0x2cb538-0x0;var _0x8c0514=_0x9728[_0x2cb538];return _0x8c0514;};'use strict';var _=require(_0x8972('0x0'));var util=require('util');var logger=require(_0x8972('0x1'))(_0x8972('0x2'));var moment=require(_0x8972('0x3'));var BPromise=require(_0x8972('0x4'));var rp=require(_0x8972('0x5'));var fs=require('fs');var path=require(_0x8972('0x6'));var rimraf=require('rimraf');var config=require(_0x8972('0x7'));var attributes=require(_0x8972('0x8'));module[_0x8972('0x9')]=function(_0x3a498c,_0xe19f97){return _0x3a498c['define'](_0x8972('0xa'),attributes,{'tableName':_0x8972('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a086b,_0x330ff4,_0x5f9a23){if(_0x4a086b[_0x8972('0xc')](_0x8972('0xd'))){_0x4a086b[_0x8972('0xe')]=moment()[_0x8972('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f9a23(null,_0x4a086b);}},'charset':_0x8972('0x10'),'collate':_0x8972('0x11')});}; \ No newline at end of file +var _0xaeda=['request-promise','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','utf8mb4','lodash','util','../../config/logger','bluebird'];(function(_0x5871f9,_0x28ccb7){var _0x8fd1c0=function(_0x510060){while(--_0x510060){_0x5871f9['push'](_0x5871f9['shift']());}};_0x8fd1c0(++_0x28ccb7);}(_0xaeda,0xc0));var _0xaaed=function(_0x472fd2,_0x1ddc31){_0x472fd2=_0x472fd2-0x0;var _0x1e0d3b=_0xaeda[_0x472fd2];return _0x1e0d3b;};'use strict';var _=require(_0xaaed('0x0'));var util=require(_0xaaed('0x1'));var logger=require(_0xaaed('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaaed('0x3'));var rp=require(_0xaaed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaaed('0x5'));var attributes=require(_0xaaed('0x6'));module[_0xaaed('0x7')]=function(_0x7bd44a,_0x12a690){return _0x7bd44a['define'](_0xaaed('0x8'),attributes,{'tableName':_0xaaed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21c208,_0x12fd3d,_0xba50e0){if(_0x21c208[_0xaaed('0xa')](_0xaaed('0xb'))){_0x21c208[_0xaaed('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xba50e0(null,_0x21c208);}},'charset':_0xaaed('0xd'),'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 0fcdd1d..f10f383 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 _0xb2b0=['addTags','ids','omit','AddTags','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','then','AddTagsToChatInteraction','find'];(function(_0x1c443f,_0x51319d){var _0x4a4a71=function(_0x355b73){while(--_0x355b73){_0x1c443f['push'](_0x1c443f['shift']());}};_0x4a4a71(++_0x51319d);}(_0xb2b0,0xdc));var _0x0b2b=function(_0x366cd9,_0xa4d3d){_0x366cd9=_0x366cd9-0x0;var _0x1755aa=_0xb2b0[_0x366cd9];return _0x1755aa;};'use strict';var _=require(_0x0b2b('0x0'));var util=require(_0x0b2b('0x1'));var moment=require(_0x0b2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b2b('0x3'));var fs=require('fs');var Redis=require(_0x0b2b('0x4'));var db=require(_0x0b2b('0x5'))['db'];var utils=require(_0x0b2b('0x6'));var logger=require(_0x0b2b('0x7'))(_0x0b2b('0x8'));var config=require(_0x0b2b('0x9'));var jayson=require(_0x0b2b('0xa'));var client=jayson[_0x0b2b('0xb')][_0x0b2b('0xc')]({'port':0x232a});config[_0x0b2b('0xd')]=_[_0x0b2b('0xe')](config[_0x0b2b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b2b('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x0b2b('0x10')](socket);function respondWithRpcPromise(_0x17b401,_0x124b82,_0x570442){return new BPromise(function(_0x113c6a,_0xdd275a){return client[_0x0b2b('0x11')](_0x17b401,_0x570442)['then'](function(_0x1048fa){logger[_0x0b2b('0x12')](_0x0b2b('0x13'),_0x124b82,_0x0b2b('0x14'));logger['debug'](_0x0b2b('0x15'),_0x124b82,_0x0b2b('0x14'),JSON[_0x0b2b('0x16')](_0x1048fa));if(_0x1048fa[_0x0b2b('0x17')]){if(_0x1048fa[_0x0b2b('0x17')][_0x0b2b('0x18')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x124b82,_0x1048fa[_0x0b2b('0x17')][_0x0b2b('0x19')]);return _0xdd275a(_0x1048fa[_0x0b2b('0x17')][_0x0b2b('0x19')]);}logger[_0x0b2b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x124b82,_0x1048fa[_0x0b2b('0x17')]['message']);return _0x113c6a(_0x1048fa[_0x0b2b('0x17')][_0x0b2b('0x19')]);}else{logger['info'](_0x0b2b('0x13'),_0x124b82,_0x0b2b('0x14'));_0x113c6a(_0x1048fa[_0x0b2b('0x1a')][_0x0b2b('0x19')]);}})[_0x0b2b('0x1b')](function(_0x24f65e){logger[_0x0b2b('0x17')](_0x0b2b('0x13'),_0x124b82,_0x24f65e);_0xdd275a(_0x24f65e);});});}exports[_0x0b2b('0x1c')]=function(_0x28a49d){var _0x12d56d=this;return new Promise(function(_0x17f17b,_0x3c975f){return db[_0x0b2b('0x1d')][_0x0b2b('0x1e')](_0x28a49d[_0x0b2b('0x1f')],{'raw':_0x28a49d['options']?_0x28a49d[_0x0b2b('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a49d[_0x0b2b('0x20')]?_0x28a49d[_0x0b2b('0x20')][_0x0b2b('0x21')]||null:null,'attributes':_0x28a49d['options']?_0x28a49d['options'][_0x0b2b('0x22')]||null:null,'limit':_0x28a49d['options']?_0x28a49d[_0x0b2b('0x20')]['limit']||null:null})[_0x0b2b('0x23')](function(_0x3141ec){logger[_0x0b2b('0x12')](_0x0b2b('0x1c'),_0x28a49d);logger['debug'](_0x0b2b('0x1c'),_0x28a49d,JSON[_0x0b2b('0x16')](_0x3141ec));_0x17f17b(_0x3141ec);})['catch'](function(_0xafb955){logger[_0x0b2b('0x17')](_0x0b2b('0x1c'),_0xafb955[_0x0b2b('0x19')],_0x28a49d);_0x3c975f(_0x12d56d[_0x0b2b('0x17')](0x1f4,_0xafb955[_0x0b2b('0x19')]));});});};exports[_0x0b2b('0x24')]=function(_0x1284b2){return new Promise(function(_0x33b0b1,_0x29c4be){return db[_0x0b2b('0x1d')][_0x0b2b('0x25')]({'where':_0x1284b2[_0x0b2b('0x20')]?_0x1284b2['options'][_0x0b2b('0x21')]||null:null})[_0x0b2b('0x23')](function(_0x3f6699){if(_0x3f6699){return _0x3f6699[_0x0b2b('0x26')](_0x1284b2[_0x0b2b('0x1f')][_0x0b2b('0x27')],_[_0x0b2b('0x28')](_0x1284b2[_0x0b2b('0x1f')],[_0x0b2b('0x27'),'id'])||{});}})['spread'](function(_0x608419){logger[_0x0b2b('0x12')](_0x0b2b('0x29'),_0x1284b2);logger[_0x0b2b('0x2a')]('AddTags',_0x1284b2,JSON['stringify'](_0x608419));_0x33b0b1(_0x608419);})[_0x0b2b('0x1b')](function(_0x5ead6a){logger[_0x0b2b('0x17')]('AddTags',_0x5ead6a[_0x0b2b('0x19')],_0x1284b2);_0x29c4be(_this[_0x0b2b('0x17')](0x1f4,_0x5ead6a[_0x0b2b('0x19')]));});});}; \ No newline at end of file +var _0xb43f=['ChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction'];(function(_0x1357ee,_0x4a422f){var _0x2678e1=function(_0x4cfe94){while(--_0x4cfe94){_0x1357ee['push'](_0x1357ee['shift']());}};_0x2678e1(++_0x4a422f);}(_0xb43f,0x10a));var _0xfb43=function(_0x22a333,_0xb6f8){_0x22a333=_0x22a333-0x0;var _0x109061=_0xb43f[_0x22a333];return _0x109061;};'use strict';var _=require('lodash');var util=require(_0xfb43('0x0'));var moment=require(_0xfb43('0x1'));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('../../config/logger')(_0xfb43('0x2'));var config=require(_0xfb43('0x3'));var jayson=require(_0xfb43('0x4'));var client=jayson[_0xfb43('0x5')][_0xfb43('0x6')]({'port':0x232a});config[_0xfb43('0x7')]=_['defaults'](config[_0xfb43('0x7')],{'host':_0xfb43('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb43('0x7')]));require('./chatInteraction.socket')[_0xfb43('0x9')](socket);function respondWithRpcPromise(_0x91181d,_0x5f2b80,_0x5c5b52){return new BPromise(function(_0x330e11,_0xc32164){return client['request'](_0x91181d,_0x5c5b52)[_0xfb43('0xa')](function(_0x2f1d34){logger[_0xfb43('0xb')](_0xfb43('0xc'),_0x5f2b80,_0xfb43('0xd'));logger[_0xfb43('0xe')](_0xfb43('0xf'),_0x5f2b80,_0xfb43('0xd'),JSON[_0xfb43('0x10')](_0x2f1d34));if(_0x2f1d34[_0xfb43('0x11')]){if(_0x2f1d34[_0xfb43('0x11')][_0xfb43('0x12')]===0x1f4){logger[_0xfb43('0x11')](_0xfb43('0xc'),_0x5f2b80,_0x2f1d34[_0xfb43('0x11')]['message']);return _0xc32164(_0x2f1d34[_0xfb43('0x11')][_0xfb43('0x13')]);}logger[_0xfb43('0x11')](_0xfb43('0xc'),_0x5f2b80,_0x2f1d34[_0xfb43('0x11')][_0xfb43('0x13')]);return _0x330e11(_0x2f1d34[_0xfb43('0x11')][_0xfb43('0x13')]);}else{logger[_0xfb43('0xb')](_0xfb43('0xc'),_0x5f2b80,_0xfb43('0xd'));_0x330e11(_0x2f1d34['result']['message']);}})[_0xfb43('0x14')](function(_0x51c6ca){logger[_0xfb43('0x11')](_0xfb43('0xc'),_0x5f2b80,_0x51c6ca);_0xc32164(_0x51c6ca);});});}exports[_0xfb43('0x15')]=function(_0xa00c9e){var _0x3e6f2a=this;return new Promise(function(_0x422683,_0x4005a3){return db['ChatInteraction'][_0xfb43('0x16')](_0xa00c9e[_0xfb43('0x17')],{'raw':_0xa00c9e[_0xfb43('0x18')]?_0xa00c9e['options'][_0xfb43('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa00c9e[_0xfb43('0x18')]?_0xa00c9e[_0xfb43('0x18')][_0xfb43('0x1a')]||null:null,'attributes':_0xa00c9e[_0xfb43('0x18')]?_0xa00c9e[_0xfb43('0x18')][_0xfb43('0x1b')]||null:null,'limit':_0xa00c9e['options']?_0xa00c9e[_0xfb43('0x18')][_0xfb43('0x1c')]||null:null})[_0xfb43('0xa')](function(_0x159be0){logger[_0xfb43('0xb')](_0xfb43('0x15'),_0xa00c9e);logger[_0xfb43('0xe')](_0xfb43('0x15'),_0xa00c9e,JSON['stringify'](_0x159be0));_0x422683(_0x159be0);})['catch'](function(_0x4acb4a){logger[_0xfb43('0x11')](_0xfb43('0x15'),_0x4acb4a[_0xfb43('0x13')],_0xa00c9e);_0x4005a3(_0x3e6f2a[_0xfb43('0x11')](0x1f4,_0x4acb4a['message']));});});};exports[_0xfb43('0x1d')]=function(_0x523f5f){return new Promise(function(_0x49e87b,_0x102a07){return db[_0xfb43('0x1e')][_0xfb43('0x1f')]({'where':_0x523f5f[_0xfb43('0x18')]?_0x523f5f[_0xfb43('0x18')][_0xfb43('0x1a')]||null:null})[_0xfb43('0xa')](function(_0x59071e){if(_0x59071e){return _0x59071e[_0xfb43('0x20')](_0x523f5f[_0xfb43('0x17')][_0xfb43('0x21')],_[_0xfb43('0x22')](_0x523f5f['body'],[_0xfb43('0x21'),'id'])||{});}})[_0xfb43('0x23')](function(_0x578b56){logger['info']('AddTags',_0x523f5f);logger[_0xfb43('0xe')](_0xfb43('0x24'),_0x523f5f,JSON[_0xfb43('0x10')](_0x578b56));_0x49e87b(_0x578b56);})[_0xfb43('0x14')](function(_0x554dfe){logger['error'](_0xfb43('0x24'),_0x554dfe['message'],_0x523f5f);_0x102a07(_this['error'](0x1f4,_0x554dfe['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 66017b1..115159f 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 _0xa38a=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x33e982,_0x1d15b1){var _0x2d3668=function(_0x3c16d5){while(--_0x3c16d5){_0x33e982['push'](_0x33e982['shift']());}};_0x2d3668(++_0x1d15b1);}(_0xa38a,0x142));var _0xaa38=function(_0xfd0950,_0x48dc75){_0xfd0950=_0xfd0950-0x0;var _0x152a26=_0xa38a[_0xfd0950];return _0x152a26;};'use strict';var ChatInteractionEvents=require(_0xaa38('0x0'));var events=[_0xaa38('0x1'),_0xaa38('0x2'),_0xaa38('0x3')];function createListener(_0x25b984,_0x44c1dd){return function(_0x4edc5f){_0x44c1dd[_0xaa38('0x4')](_0x25b984,_0x4edc5f);};}function removeListener(_0xc3646a,_0x202752){return function(){ChatInteractionEvents[_0xaa38('0x5')](_0xc3646a,_0x202752);};}exports[_0xaa38('0x6')]=function(_0x509cda){for(var _0x16b627=0x0,_0x2a6ed8=events[_0xaa38('0x7')];_0x16b627<_0x2a6ed8;_0x16b627++){var _0x2433f2=events[_0x16b627];var _0x987ce=createListener(_0xaa38('0x8')+_0x2433f2,_0x509cda);ChatInteractionEvents['on'](_0x2433f2,_0x987ce);}}; \ No newline at end of file +var _0xc810=['register','save','remove','removeListener'];(function(_0x2d039a,_0x2731e8){var _0x24b3d5=function(_0x4dda15){while(--_0x4dda15){_0x2d039a['push'](_0x2d039a['shift']());}};_0x24b3d5(++_0x2731e8);}(_0xc810,0xfd));var _0x0c81=function(_0x2bb789,_0x1608bb){_0x2bb789=_0x2bb789-0x0;var _0x5021a1=_0xc810[_0x2bb789];return _0x5021a1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x0c81('0x0'),_0x0c81('0x1'),'update'];function createListener(_0x1bcfd0,_0x2d5d9d){return function(_0x326ae8){_0x2d5d9d['emit'](_0x1bcfd0,_0x326ae8);};}function removeListener(_0x23f413,_0x1cf5ac){return function(){ChatInteractionEvents[_0x0c81('0x2')](_0x23f413,_0x1cf5ac);};}exports[_0x0c81('0x3')]=function(_0x444d68){for(var _0x598a8f=0x0,_0x24643d=events['length'];_0x598a8f<_0x24643d;_0x598a8f++){var _0x1c3efe=events[_0x598a8f];var _0x12fdf5=createListener('chatInteraction:'+_0x1c3efe,_0x444d68);ChatInteractionEvents['on'](_0x1c3efe,_0x12fdf5);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5c61461..41980b9 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 _0x04a1=['tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/download','create','post','/:id/vidaoo','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put'];(function(_0x29c6bc,_0x4c1848){var _0x3c909f=function(_0x375274){while(--_0x375274){_0x29c6bc['push'](_0x29c6bc['shift']());}};_0x3c909f(++_0x4c1848);}(_0x04a1,0x146));var _0x104a=function(_0x241df6,_0x10e2ef){_0x241df6=_0x241df6-0x0;var _0x36876d=_0x04a1[_0x241df6];return _0x36876d;};'use strict';var multer=require(_0x104a('0x0'));var util=require(_0x104a('0x1'));var path=require(_0x104a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x104a('0x3')]();var fs_extra=require(_0x104a('0x4'));var auth=require(_0x104a('0x5'));var interaction=require(_0x104a('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x104a('0x7')]('/',auth[_0x104a('0x8')](),controller[_0x104a('0x9')]);router[_0x104a('0x7')]('/describe',auth[_0x104a('0x8')](),controller[_0x104a('0xa')]);router[_0x104a('0x7')](_0x104a('0xb'),auth[_0x104a('0xc')](),controller[_0x104a('0xd')]);router[_0x104a('0x7')]('/:id/attachment_download',auth[_0x104a('0xc')](),controller[_0x104a('0xe')]);router[_0x104a('0x7')](_0x104a('0xf'),auth[_0x104a('0x8')](),controller[_0x104a('0x10')]);router[_0x104a('0x7')]('/:id/my_messages',auth[_0x104a('0xc')](),controller['getMyMessages']);router['get'](_0x104a('0x11'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x104a('0x12')]);router[_0x104a('0x13')](_0x104a('0x14'),auth[_0x104a('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53d7b0,_0x3dad2b,_0x3f4743){_0x3f4743(null,path['join'](config['root'],_0x104a('0x15')));},'filename':function(_0xb930a7,_0x356164,_0x90bb1){_0x90bb1(null,util[_0x104a('0x16')](_0x104a('0x17'),Date['now'](),_0x356164[_0x104a('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x104a('0x13')](_0x104a('0x19'),upload[_0x104a('0x1a')](_0x104a('0x1b')),controller['attachmentUpload']);router[_0x104a('0x13')](_0x104a('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x104a('0x1c')]);router[_0x104a('0x13')](_0x104a('0x1d'),auth[_0x104a('0x8')](),interaction['tracked'](_0x104a('0x1e'),_0x104a('0x1f')),controller[_0x104a('0x20')]);router[_0x104a('0x21')](_0x104a('0xb'),auth[_0x104a('0x8')](),interaction[_0x104a('0x22')](_0x104a('0x1e'),_0x104a('0x23')),controller[_0x104a('0x24')]);router[_0x104a('0x21')](_0x104a('0x25'),controller[_0x104a('0x26')]);router[_0x104a('0x21')]('/:id/abandon',auth[_0x104a('0xc')](),controller[_0x104a('0x27')]);router[_0x104a('0x21')](_0x104a('0x28'),controller[_0x104a('0x29')]);router[_0x104a('0x2a')]('/:id',auth[_0x104a('0x8')](),interaction[_0x104a('0x22')](_0x104a('0x1e'),_0x104a('0x2b')),controller['destroy']);router[_0x104a('0x2a')](_0x104a('0x1d'),auth[_0x104a('0x8')](),controller['removeTags']);module[_0x104a('0x2c')]=router; \ No newline at end of file +var _0x400a=['/:id/tags','tracked','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','create','post','/:id/vidaoo','diskStorage','join','root','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage'];(function(_0x4c5ec3,_0x220b9f){var _0x2ead97=function(_0x492cf6){while(--_0x492cf6){_0x4c5ec3['push'](_0x4c5ec3['shift']());}};_0x2ead97(++_0x220b9f);}(_0x400a,0x150));var _0xa400=function(_0x4512f2,_0x44be54){_0x4512f2=_0x4512f2-0x0;var _0x4b9a13=_0x400a[_0x4512f2];return _0x4b9a13;};'use strict';var multer=require('multer');var util=require(_0xa400('0x0'));var path=require(_0xa400('0x1'));var timeout=require(_0xa400('0x2'));var express=require('express');var router=express[_0xa400('0x3')]();var fs_extra=require(_0xa400('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa400('0x5'));var config=require('../../config/environment');var controller=require(_0xa400('0x6'));router[_0xa400('0x7')]('/',auth[_0xa400('0x8')](),controller[_0xa400('0x9')]);router[_0xa400('0x7')](_0xa400('0xa'),auth['isAuthenticated'](),controller[_0xa400('0xb')]);router['get'](_0xa400('0xc'),auth[_0xa400('0xd')](),controller[_0xa400('0xe')]);router[_0xa400('0x7')]('/:id/attachment_download',auth[_0xa400('0xd')](),controller[_0xa400('0xf')]);router['get'](_0xa400('0x10'),auth['isAuthenticated'](),controller[_0xa400('0x11')]);router['get']('/:id/my_messages',auth[_0xa400('0xd')](),controller[_0xa400('0x12')]);router[_0xa400('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xa400('0x13')]);router['post']('/',auth[_0xa400('0x8')](),controller[_0xa400('0x14')]);router[_0xa400('0x15')](_0xa400('0x16'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa400('0x17')]({'destination':function(_0x14fb27,_0x283654,_0x44784e){_0x44784e(null,path[_0xa400('0x18')](config[_0xa400('0x19')],'server/files/attachments/'));},'filename':function(_0x38dc27,_0x42ba75,_0xf987c3){_0xf987c3(null,util[_0xa400('0x1a')](_0xa400('0x1b'),Date[_0xa400('0x1c')](),_0x42ba75[_0xa400('0x1d')][_0xa400('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa400('0x15')]('/:id/attachment_upload',upload[_0xa400('0x1f')](_0xa400('0x20')),controller[_0xa400('0x21')]);router[_0xa400('0x15')](_0xa400('0x10'),auth[_0xa400('0xd')](),controller[_0xa400('0x22')]);router[_0xa400('0x15')](_0xa400('0x23'),auth[_0xa400('0x8')](),interaction[_0xa400('0x24')]('chat',_0xa400('0x25')),controller[_0xa400('0x26')]);router['put']('/:id',auth[_0xa400('0x8')](),interaction[_0xa400('0x24')](_0xa400('0x27'),_0xa400('0x28')),controller[_0xa400('0x29')]);router[_0xa400('0x2a')](_0xa400('0x2b'),controller['customUpdate']);router[_0xa400('0x2a')](_0xa400('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0xa400('0x2d')]);router['put'](_0xa400('0x2e'),controller[_0xa400('0x2f')]);router[_0xa400('0x30')](_0xa400('0xc'),auth['isAuthenticated'](),interaction['tracked']('chat',_0xa400('0x31')),controller[_0xa400('0x32')]);router['delete'](_0xa400('0x23'),auth['isAuthenticated'](),controller[_0xa400('0x33')]);module[_0xa400('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 3f6878b..59e1e03 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 _0x650a=['exports','TEXT','INTEGER','sequelize'];(function(_0x37fdfd,_0x38828d){var _0x9049ca=function(_0x5765e6){while(--_0x5765e6){_0x37fdfd['push'](_0x37fdfd['shift']());}};_0x9049ca(++_0x38828d);}(_0x650a,0x13b));var _0xa650=function(_0x2dac02,_0x42354e){_0x2dac02=_0x2dac02-0x0;var _0xff7987=_0x650a[_0x2dac02];return _0xff7987;};'use strict';var Sequelize=require(_0xa650('0x0'));module[_0xa650('0x1')]={'body':{'type':Sequelize[_0xa650('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa650('0x3')]}}; \ No newline at end of file +var _0xc745=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x15713d,_0x459394){var _0x5b3032=function(_0x299760){while(--_0x299760){_0x15713d['push'](_0x15713d['shift']());}};_0x5b3032(++_0x459394);}(_0xc745,0xf7));var _0x5c74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc745[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5c74('0x0'));module[_0x5c74('0x1')]={'body':{'type':Sequelize[_0x5c74('0x2')](_0x5c74('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5c74('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c74('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 7d08eca..095279b 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 _0x2f6e=['update','error','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','then','findAll','rows','catch','includeAll','include','merge','create','body','destroy','find','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0x5b98ed,_0x1de467){var _0x377bc9=function(_0x354ce5){while(--_0x354ce5){_0x5b98ed['push'](_0x5b98ed['shift']());}};_0x377bc9(++_0x1de467);}(_0x2f6e,0xba));var _0xe2f6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2f6e[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xe2f6('0x0'));var rimraf=require(_0xe2f6('0x1'));var zipdir=require(_0xe2f6('0x2'));var jsonpatch=require(_0xe2f6('0x3'));var rp=require('request-promise');var moment=require(_0xe2f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2f6('0x5'));var util=require(_0xe2f6('0x6'));var path=require(_0xe2f6('0x7'));var sox=require(_0xe2f6('0x8'));var csv=require(_0xe2f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2f6('0xa'));var _=require(_0xe2f6('0xb'));var squel=require(_0xe2f6('0xc'));var crypto=require(_0xe2f6('0xd'));var jsforce=require(_0xe2f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe2f6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe2f6('0x10'));var as=require(_0xe2f6('0x11'));var hardwareService=require(_0xe2f6('0x12'));var logger=require(_0xe2f6('0x13'))('api');var utils=require(_0xe2f6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe2f6('0x15'));var db=require('../../mysqldb')['db'];config[_0xe2f6('0x16')]=_['defaults'](config[_0xe2f6('0x16')],{'host':_0xe2f6('0x17'),'port':0x18eb});var socket=require(_0xe2f6('0x18'))(new Redis(config[_0xe2f6('0x16')]));require('./chatInternalMessage.socket')[_0xe2f6('0x19')](socket);function respondWithStatusCode(_0x3106ce,_0x62082e){_0x62082e=_0x62082e||0xcc;return function(_0x3e62d3){if(_0x3e62d3){return _0x3106ce[_0xe2f6('0x1a')](_0x62082e);}return _0x3106ce['status'](_0x62082e)[_0xe2f6('0x1b')]();};}function respondWithResult(_0x3e0b4e,_0x4207dd){_0x4207dd=_0x4207dd||0xc8;return function(_0x1565ae){if(_0x1565ae){return _0x3e0b4e['status'](_0x4207dd)[_0xe2f6('0x1c')](_0x1565ae);}};}function respondWithFilteredResult(_0x4f4bce,_0x2f71de){return function(_0x2cf4ba){if(_0x2cf4ba){var _0x33bd90=typeof _0x2f71de[_0xe2f6('0x1d')]===_0xe2f6('0x1e')&&typeof _0x2f71de[_0xe2f6('0x1f')]===_0xe2f6('0x1e');var _0xce1cae=_0x2cf4ba[_0xe2f6('0x20')];var _0x3fa74e=_0x33bd90?0x0:_0x2f71de[_0xe2f6('0x1d')];var _0x3d8a2c=_0x33bd90?_0x2cf4ba[_0xe2f6('0x20')]:_0x2f71de[_0xe2f6('0x1d')]+_0x2f71de[_0xe2f6('0x1f')];var _0x312500;if(_0x3d8a2c>=_0xce1cae){_0x3d8a2c=_0xce1cae;_0x312500=0xc8;}else{_0x312500=0xce;}_0x4f4bce[_0xe2f6('0x21')](_0x312500);return _0x4f4bce[_0xe2f6('0x22')](_0xe2f6('0x23'),_0x3fa74e+'-'+_0x3d8a2c+'/'+_0xce1cae)['json'](_0x2cf4ba);}return null;};}function patchUpdates(_0x126b04){return function(_0x4b01be){try{jsonpatch[_0xe2f6('0x24')](_0x4b01be,_0x126b04,!![]);}catch(_0x1dd6d6){return BPromise[_0xe2f6('0x25')](_0x1dd6d6);}return _0x4b01be['save']();};}function saveUpdates(_0x5c240a,_0x466aba){return function(_0x2bcba5){if(_0x2bcba5){return _0x2bcba5[_0xe2f6('0x26')](_0x5c240a)['then'](function(_0x11469e){return _0x11469e;});}return null;};}function removeEntity(_0x1747b2,_0x12dd5e){return function(_0x3bed60){if(_0x3bed60){return _0x3bed60['destroy']()['then'](function(){_0x1747b2['status'](0xcc)[_0xe2f6('0x1b')]();});}};}function handleEntityNotFound(_0x22b641,_0x3b2186){return function(_0x307a09){if(!_0x307a09){_0x22b641['sendStatus'](0x194);}return _0x307a09;};}function handleError(_0x225fe3,_0x1c5c5e){_0x1c5c5e=_0x1c5c5e||0x1f4;return function(_0x5ae767){logger[_0xe2f6('0x27')](_0x5ae767['stack']);if(_0x5ae767['name']){delete _0x5ae767['name'];}_0x225fe3[_0xe2f6('0x21')](_0x1c5c5e)[_0xe2f6('0x28')](_0x5ae767);};}exports[_0xe2f6('0x29')]=function(_0x5f31a5,_0x2e85a3){var _0x18a28a={},_0x48deb4={},_0x981e33={'count':0x0,'rows':[]};var _0x2f3b77=_[_0xe2f6('0x2a')](db[_0xe2f6('0x2b')][_0xe2f6('0x2c')],function(_0x139130){return{'name':_0x139130[_0xe2f6('0x2d')],'type':_0x139130[_0xe2f6('0x2e')][_0xe2f6('0x2f')]};});_0x48deb4[_0xe2f6('0x30')]=_[_0xe2f6('0x2a')](_0x2f3b77,_0xe2f6('0x31'));_0x48deb4[_0xe2f6('0x32')]=_[_0xe2f6('0x33')](_0x5f31a5[_0xe2f6('0x32')]);_0x48deb4['filters']=_[_0xe2f6('0x34')](_0x48deb4[_0xe2f6('0x30')],_0x48deb4[_0xe2f6('0x32')]);_0x18a28a[_0xe2f6('0x35')]=_['intersection'](_0x48deb4[_0xe2f6('0x30')],qs['fields'](_0x5f31a5[_0xe2f6('0x32')]['fields']));_0x18a28a[_0xe2f6('0x35')]=_0x18a28a['attributes'][_0xe2f6('0x36')]?_0x18a28a['attributes']:_0x48deb4[_0xe2f6('0x30')];if(!_0x5f31a5[_0xe2f6('0x32')][_0xe2f6('0x37')](_0xe2f6('0x38'))){_0x18a28a['limit']=qs['limit'](_0x5f31a5[_0xe2f6('0x32')][_0xe2f6('0x1f')]);_0x18a28a[_0xe2f6('0x1d')]=qs[_0xe2f6('0x1d')](_0x5f31a5[_0xe2f6('0x32')]['offset']);}_0x18a28a[_0xe2f6('0x39')]=qs['sort'](_0x5f31a5['query'][_0xe2f6('0x3a')]);_0x18a28a['where']=qs[_0xe2f6('0x3b')](_[_0xe2f6('0x3c')](_0x5f31a5[_0xe2f6('0x32')],_0x48deb4[_0xe2f6('0x3b')]),_0x2f3b77);if(_0x5f31a5['query']['filter']){_0x18a28a[_0xe2f6('0x3d')]=_['merge'](_0x18a28a[_0xe2f6('0x3d')],{'$or':_[_0xe2f6('0x2a')](_0x2f3b77,function(_0x356061){if(_0x356061[_0xe2f6('0x2e')]!==_0xe2f6('0x3e')){var _0x267c7d={};_0x267c7d[_0x356061[_0xe2f6('0x31')]]={'$like':'%'+_0x5f31a5[_0xe2f6('0x32')][_0xe2f6('0x3f')]+'%'};return _0x267c7d;}})});}_0x18a28a=_['merge']({},_0x18a28a,_0x5f31a5[_0xe2f6('0x40')]);var _0x35c245={'where':_0x18a28a[_0xe2f6('0x3d')]};return db[_0xe2f6('0x2b')]['count'](_0x35c245)[_0xe2f6('0x41')](function(_0x213e87){_0x981e33[_0xe2f6('0x20')]=_0x213e87;if(_0x5f31a5[_0xe2f6('0x32')]['includeAll']){_0x18a28a['include']=[{'all':!![]}];}return db[_0xe2f6('0x2b')][_0xe2f6('0x42')](_0x18a28a);})[_0xe2f6('0x41')](function(_0x3ea9f8){_0x981e33[_0xe2f6('0x43')]=_0x3ea9f8;return _0x981e33;})[_0xe2f6('0x41')](respondWithFilteredResult(_0x2e85a3,_0x18a28a))[_0xe2f6('0x44')](handleError(_0x2e85a3,null));};exports['show']=function(_0x5942ea,_0x7db596){var _0x80b0ff={'raw':!![],'where':{'id':_0x5942ea['params']['id']}},_0x172faa={};_0x172faa[_0xe2f6('0x30')]=_[_0xe2f6('0x33')](db[_0xe2f6('0x2b')]['rawAttributes']);_0x172faa['query']=_[_0xe2f6('0x33')](_0x5942ea['query']);_0x172faa[_0xe2f6('0x3b')]=_[_0xe2f6('0x34')](_0x172faa[_0xe2f6('0x30')],_0x172faa[_0xe2f6('0x32')]);_0x80b0ff['attributes']=_[_0xe2f6('0x34')](_0x172faa[_0xe2f6('0x30')],qs['fields'](_0x5942ea[_0xe2f6('0x32')]['fields']));_0x80b0ff['attributes']=_0x80b0ff['attributes']['length']?_0x80b0ff['attributes']:_0x172faa[_0xe2f6('0x30')];if(_0x5942ea[_0xe2f6('0x32')][_0xe2f6('0x45')]){_0x80b0ff[_0xe2f6('0x46')]=[{'all':!![]}];}_0x80b0ff=_[_0xe2f6('0x47')]({},_0x80b0ff,_0x5942ea[_0xe2f6('0x40')]);return db['ChatInternalMessage']['find'](_0x80b0ff)[_0xe2f6('0x41')](handleEntityNotFound(_0x7db596,null))['then'](respondWithResult(_0x7db596,null))[_0xe2f6('0x44')](handleError(_0x7db596,null));};exports[_0xe2f6('0x48')]=function(_0x21dd17,_0x6f1128){return db['ChatInternalMessage'][_0xe2f6('0x48')](_0x21dd17[_0xe2f6('0x49')],{})['then'](respondWithResult(_0x6f1128,0xc9))[_0xe2f6('0x44')](handleError(_0x6f1128,null));};exports[_0xe2f6('0x26')]=function(_0x4a939a,_0x42e644){if(_0x4a939a[_0xe2f6('0x49')]['id']){delete _0x4a939a[_0xe2f6('0x49')]['id'];}return db[_0xe2f6('0x2b')]['find']({'where':{'id':_0x4a939a['params']['id']}})['then'](handleEntityNotFound(_0x42e644,null))[_0xe2f6('0x41')](saveUpdates(_0x4a939a[_0xe2f6('0x49')],null))[_0xe2f6('0x41')](respondWithResult(_0x42e644,null))['catch'](handleError(_0x42e644,null));};exports[_0xe2f6('0x4a')]=function(_0x3cd41d,_0x373c6a){return db[_0xe2f6('0x2b')][_0xe2f6('0x4b')]({'where':{'id':_0x3cd41d[_0xe2f6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x373c6a,null))[_0xe2f6('0x41')](removeEntity(_0x373c6a,null))['catch'](handleError(_0x373c6a,null));};exports[_0xe2f6('0x4d')]=function(_0x4bde87,_0xf8388f){return db[_0xe2f6('0x2b')][_0xe2f6('0x4d')]()[_0xe2f6('0x41')](respondWithResult(_0xf8388f,null))[_0xe2f6('0x44')](handleError(_0xf8388f,null));};function wrapUser(_0x3ffa42){return function(_0x5b1d26){var _0x173710=_0x3ffa42[_0xe2f6('0x4e')]({'plain':!![]});_0x173710[_0xe2f6('0x4f')]=[];if(_0x5b1d26){_0x173710[_0xe2f6('0x50')]=_0x5b1d26[_0xe2f6('0x51')];_0x173710[_0xe2f6('0x52')]=_0x5b1d26;}else{_0x173710[_0xe2f6('0x50')]=moment(0x0)[_0xe2f6('0x53')](_0xe2f6('0x54'));_0x173710['lastMessage']={};}return _0x173710;};}exports[_0xe2f6('0x55')]=function(_0x527cb9,_0x3cad08,_0x5d973e){var _0x4d8513=[];return db[_0xe2f6('0x56')][_0xe2f6('0x42')]({'where':{'role':[_0xe2f6('0x57'),'admin',_0xe2f6('0x58')]},'attributes':['id',_0xe2f6('0x59'),_0xe2f6('0x31'),_0xe2f6('0x5a'),_0xe2f6('0x5b'),_0xe2f6('0x5c'),_0xe2f6('0x5d'),_0xe2f6('0x5e'),_0xe2f6('0x5f'),_0xe2f6('0x60')],'order':qs[_0xe2f6('0x3a')](_0xe2f6('0x61')),'include':[{'model':db[_0xe2f6('0x62')],'as':_0xe2f6('0x63'),'attributes':['id',_0xe2f6('0x31'),_0xe2f6('0x2e')],'through':{'attributes':[]}}]})[_0xe2f6('0x41')](function(_0x519aaf){if(_0x519aaf){var _0x26ce59=_0x527cb9[_0xe2f6('0x58')][_0xe2f6('0x4e')]({'plain':!![]});if(!_0x26ce59)throw new Error(_0xe2f6('0x64'));if(_0x26ce59['role']===_0xe2f6('0x58')){return db['UserProfileSection'][_0xe2f6('0x4b')]({'where':{'name':_0xe2f6('0x65'),'userProfileId':_0x26ce59[_0xe2f6('0x66')]},'raw':!![]})[_0xe2f6('0x41')](function(_0x380bcd){if(_0x380bcd){if(_0x380bcd['autoAssociation']===0x0){return db[_0xe2f6('0x67')]['findAll']({'where':{'sectionId':_0x380bcd['id']},'raw':!![]})[_0xe2f6('0x41')](function(_0xcf9123){var _0xcbd1a5=[];if(_[_0xe2f6('0x68')](_0xcf9123)){_0xcbd1a5=_[_0xe2f6('0x3f')](_0x519aaf,function(_0x558d59){if(_0x558d59[_0xe2f6('0x5a')]!==_0xe2f6('0x57')){return _0x558d59;}});return _0xcbd1a5;}else{for(var _0x5bb808=0x0;_0x5bb808<_0x519aaf[_0xe2f6('0x36')];_0x5bb808++){var _0x3b2fab=_0x519aaf[_0x5bb808];if(_0x3b2fab['role']===_0xe2f6('0x57')){var _0x19669c=_[_0xe2f6('0x4b')](_0xcf9123,function(_0x54a114){return _0x54a114[_0xe2f6('0x69')]===_0x3b2fab['id'];});if(_0x19669c)_0xcbd1a5['push'](_0x3b2fab);}else{_0xcbd1a5[_0xe2f6('0x6a')](_0x3b2fab);}}return _0xcbd1a5;}});}else{return _0x519aaf;}}else{var _0x34fea5=_[_0xe2f6('0x3f')](_0x519aaf,function(_0x31f2cd){if(_0x31f2cd[_0xe2f6('0x5a')]!==_0xe2f6('0x57')){return _0x31f2cd;}});return _0x34fea5;}});}else{return _0x519aaf;}}})[_0xe2f6('0x41')](function(_0x2bb19b){var _0x116e88=[];if(_0x2bb19b){_0x4d8513=_0x2bb19b;for(var _0x41a7c9=0x0;_0x41a7c9<_0x2bb19b[_0xe2f6('0x36')];_0x41a7c9+=0x1){_0x4d8513[_0x41a7c9][_0xe2f6('0x4f')]=[];_0x116e88[_0xe2f6('0x6a')](db[_0xe2f6('0x2b')][_0xe2f6('0x4b')]({'where':{'FromId':[_0x527cb9[_0xe2f6('0x58')]['id'],_0x2bb19b[_0x41a7c9]['id']],'ToId':[_0x527cb9['user']['id'],_0x2bb19b[_0x41a7c9]['id']],'ChatGroupId':null},'attributes':['id',_0xe2f6('0x51'),_0xe2f6('0x6b'),_0xe2f6('0x6c'),_0xe2f6('0x6d'),_0xe2f6('0x49')],'order':qs[_0xe2f6('0x3a')](_0xe2f6('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe2f6('0x41')](wrapUser(_0x2bb19b[_0x41a7c9])));}return BPromise[_0xe2f6('0x6f')](_0x116e88);}return[];})['then'](function(_0xc2696f){return{'rows':_0xc2696f,'count':_0xc2696f[_0xe2f6('0x36')]};})[_0xe2f6('0x41')](respondWithResult(_0x3cad08,null))[_0xe2f6('0x44')](handleError(_0x3cad08,null));}; \ No newline at end of file +var _0xfa83=['fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','where','pick','filter','merge','ChatInternalMessage','findAll','rows','show','length','includeAll','include','options','find','catch','create','body','params','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','VoiceQueue','VoiceQueues','get','role','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xfa83,0xcf));var _0x3fa8=function(_0x5b98be,_0x2580bf){_0x5b98be=_0x5b98be-0x0;var _0x26db98=_0xfa83[_0x5b98be];return _0x26db98;};'use strict';var emlformat=require(_0x3fa8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3fa8('0x1'));var rp=require(_0x3fa8('0x2'));var moment=require(_0x3fa8('0x3'));var BPromise=require(_0x3fa8('0x4'));var Mustache=require(_0x3fa8('0x5'));var util=require(_0x3fa8('0x6'));var path=require(_0x3fa8('0x7'));var sox=require(_0x3fa8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fa8('0x9'));var _=require(_0x3fa8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3fa8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3fa8('0xc'));var querystring=require(_0x3fa8('0xd'));var Papa=require('papaparse');var Redis=require(_0x3fa8('0xe'));var authService=require(_0x3fa8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3fa8('0x10'));var hardwareService=require(_0x3fa8('0x11'));var logger=require(_0x3fa8('0x12'))(_0x3fa8('0x13'));var utils=require('../../config/utils');var config=require(_0x3fa8('0x14'));var licenseUtil=require(_0x3fa8('0x15'));var db=require('../../mysqldb')['db'];config[_0x3fa8('0x16')]=_[_0x3fa8('0x17')](config[_0x3fa8('0x16')],{'host':_0x3fa8('0x18'),'port':0x18eb});var socket=require(_0x3fa8('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x3fa8('0x1a')](socket);function respondWithStatusCode(_0xa3be51,_0x15c36d){_0x15c36d=_0x15c36d||0xcc;return function(_0x21aba9){if(_0x21aba9){return _0xa3be51[_0x3fa8('0x1b')](_0x15c36d);}return _0xa3be51[_0x3fa8('0x1c')](_0x15c36d)[_0x3fa8('0x1d')]();};}function respondWithResult(_0x28e089,_0x361eec){_0x361eec=_0x361eec||0xc8;return function(_0x4778dc){if(_0x4778dc){return _0x28e089[_0x3fa8('0x1c')](_0x361eec)[_0x3fa8('0x1e')](_0x4778dc);}};}function respondWithFilteredResult(_0x402898,_0x558896){return function(_0x4d577c){if(_0x4d577c){var _0x2f4bf6=typeof _0x558896[_0x3fa8('0x1f')]===_0x3fa8('0x20')&&typeof _0x558896[_0x3fa8('0x21')]===_0x3fa8('0x20');var _0x51a4f1=_0x4d577c['count'];var _0xd434df=_0x2f4bf6?0x0:_0x558896[_0x3fa8('0x1f')];var _0x782121=_0x2f4bf6?_0x4d577c[_0x3fa8('0x22')]:_0x558896[_0x3fa8('0x1f')]+_0x558896[_0x3fa8('0x21')];var _0x4704cf;if(_0x782121>=_0x51a4f1){_0x782121=_0x51a4f1;_0x4704cf=0xc8;}else{_0x4704cf=0xce;}_0x402898[_0x3fa8('0x1c')](_0x4704cf);return _0x402898['set'](_0x3fa8('0x23'),_0xd434df+'-'+_0x782121+'/'+_0x51a4f1)[_0x3fa8('0x1e')](_0x4d577c);}return null;};}function patchUpdates(_0x3e34b2){return function(_0x34b588){try{jsonpatch[_0x3fa8('0x24')](_0x34b588,_0x3e34b2,!![]);}catch(_0x1c5951){return BPromise['reject'](_0x1c5951);}return _0x34b588[_0x3fa8('0x25')]();};}function saveUpdates(_0x4f5139,_0x502bb3){return function(_0x54265e){if(_0x54265e){return _0x54265e[_0x3fa8('0x26')](_0x4f5139)[_0x3fa8('0x27')](function(_0x4a3738){return _0x4a3738;});}return null;};}function removeEntity(_0x2bc8bc,_0x2f3127){return function(_0x3a0836){if(_0x3a0836){return _0x3a0836[_0x3fa8('0x28')]()['then'](function(){_0x2bc8bc[_0x3fa8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe7e27,_0x5a23c7){return function(_0x3b4ef9){if(!_0x3b4ef9){_0xfe7e27['sendStatus'](0x194);}return _0x3b4ef9;};}function handleError(_0x1cfb26,_0x1f99a1){_0x1f99a1=_0x1f99a1||0x1f4;return function(_0x5e95f6){logger[_0x3fa8('0x29')](_0x5e95f6[_0x3fa8('0x2a')]);if(_0x5e95f6[_0x3fa8('0x2b')]){delete _0x5e95f6[_0x3fa8('0x2b')];}_0x1cfb26['status'](_0x1f99a1)[_0x3fa8('0x2c')](_0x5e95f6);};}exports[_0x3fa8('0x2d')]=function(_0x42836f,_0x11553f){var _0x1ba220={},_0x3f4a07={},_0x822e58={'count':0x0,'rows':[]};var _0x4b679a=_[_0x3fa8('0x2e')](db['ChatInternalMessage'][_0x3fa8('0x2f')],function(_0x4de771){return{'name':_0x4de771['fieldName'],'type':_0x4de771[_0x3fa8('0x30')][_0x3fa8('0x31')]};});_0x3f4a07[_0x3fa8('0x32')]=_[_0x3fa8('0x2e')](_0x4b679a,_0x3fa8('0x2b'));_0x3f4a07[_0x3fa8('0x33')]=_[_0x3fa8('0x34')](_0x42836f[_0x3fa8('0x33')]);_0x3f4a07[_0x3fa8('0x35')]=_[_0x3fa8('0x36')](_0x3f4a07['model'],_0x3f4a07['query']);_0x1ba220[_0x3fa8('0x37')]=_[_0x3fa8('0x36')](_0x3f4a07[_0x3fa8('0x32')],qs[_0x3fa8('0x38')](_0x42836f[_0x3fa8('0x33')]['fields']));_0x1ba220[_0x3fa8('0x37')]=_0x1ba220[_0x3fa8('0x37')]['length']?_0x1ba220[_0x3fa8('0x37')]:_0x3f4a07[_0x3fa8('0x32')];if(!_0x42836f[_0x3fa8('0x33')]['hasOwnProperty'](_0x3fa8('0x39'))){_0x1ba220['limit']=qs[_0x3fa8('0x21')](_0x42836f[_0x3fa8('0x33')][_0x3fa8('0x21')]);_0x1ba220[_0x3fa8('0x1f')]=qs['offset'](_0x42836f['query'][_0x3fa8('0x1f')]);}_0x1ba220['order']=qs['sort'](_0x42836f['query']['sort']);_0x1ba220[_0x3fa8('0x3a')]=qs[_0x3fa8('0x35')](_[_0x3fa8('0x3b')](_0x42836f[_0x3fa8('0x33')],_0x3f4a07[_0x3fa8('0x35')]),_0x4b679a);if(_0x42836f['query'][_0x3fa8('0x3c')]){_0x1ba220[_0x3fa8('0x3a')]=_[_0x3fa8('0x3d')](_0x1ba220[_0x3fa8('0x3a')],{'$or':_[_0x3fa8('0x2e')](_0x4b679a,function(_0x1f0088){if(_0x1f0088[_0x3fa8('0x30')]!=='VIRTUAL'){var _0x4f6743={};_0x4f6743[_0x1f0088['name']]={'$like':'%'+_0x42836f[_0x3fa8('0x33')]['filter']+'%'};return _0x4f6743;}})});}_0x1ba220=_[_0x3fa8('0x3d')]({},_0x1ba220,_0x42836f['options']);var _0x2d653f={'where':_0x1ba220[_0x3fa8('0x3a')]};return db[_0x3fa8('0x3e')][_0x3fa8('0x22')](_0x2d653f)[_0x3fa8('0x27')](function(_0x40543b){_0x822e58[_0x3fa8('0x22')]=_0x40543b;if(_0x42836f[_0x3fa8('0x33')]['includeAll']){_0x1ba220['include']=[{'all':!![]}];}return db[_0x3fa8('0x3e')][_0x3fa8('0x3f')](_0x1ba220);})[_0x3fa8('0x27')](function(_0x5f280a){_0x822e58[_0x3fa8('0x40')]=_0x5f280a;return _0x822e58;})[_0x3fa8('0x27')](respondWithFilteredResult(_0x11553f,_0x1ba220))['catch'](handleError(_0x11553f,null));};exports[_0x3fa8('0x41')]=function(_0x2d77df,_0x51056f){var _0x2b29cf={'raw':!![],'where':{'id':_0x2d77df['params']['id']}},_0x3cc869={};_0x3cc869[_0x3fa8('0x32')]=_['keys'](db[_0x3fa8('0x3e')]['rawAttributes']);_0x3cc869[_0x3fa8('0x33')]=_[_0x3fa8('0x34')](_0x2d77df['query']);_0x3cc869[_0x3fa8('0x35')]=_[_0x3fa8('0x36')](_0x3cc869['model'],_0x3cc869['query']);_0x2b29cf[_0x3fa8('0x37')]=_['intersection'](_0x3cc869['model'],qs['fields'](_0x2d77df[_0x3fa8('0x33')]['fields']));_0x2b29cf['attributes']=_0x2b29cf[_0x3fa8('0x37')][_0x3fa8('0x42')]?_0x2b29cf[_0x3fa8('0x37')]:_0x3cc869[_0x3fa8('0x32')];if(_0x2d77df[_0x3fa8('0x33')][_0x3fa8('0x43')]){_0x2b29cf[_0x3fa8('0x44')]=[{'all':!![]}];}_0x2b29cf=_['merge']({},_0x2b29cf,_0x2d77df[_0x3fa8('0x45')]);return db[_0x3fa8('0x3e')][_0x3fa8('0x46')](_0x2b29cf)['then'](handleEntityNotFound(_0x51056f,null))[_0x3fa8('0x27')](respondWithResult(_0x51056f,null))[_0x3fa8('0x47')](handleError(_0x51056f,null));};exports['create']=function(_0x4933f9,_0x3cd0ce){return db[_0x3fa8('0x3e')][_0x3fa8('0x48')](_0x4933f9[_0x3fa8('0x49')],{})[_0x3fa8('0x27')](respondWithResult(_0x3cd0ce,0xc9))['catch'](handleError(_0x3cd0ce,null));};exports[_0x3fa8('0x26')]=function(_0x5339f3,_0x5a770a){if(_0x5339f3[_0x3fa8('0x49')]['id']){delete _0x5339f3[_0x3fa8('0x49')]['id'];}return db[_0x3fa8('0x3e')]['find']({'where':{'id':_0x5339f3[_0x3fa8('0x4a')]['id']}})[_0x3fa8('0x27')](handleEntityNotFound(_0x5a770a,null))[_0x3fa8('0x27')](saveUpdates(_0x5339f3[_0x3fa8('0x49')],null))[_0x3fa8('0x27')](respondWithResult(_0x5a770a,null))[_0x3fa8('0x47')](handleError(_0x5a770a,null));};exports[_0x3fa8('0x28')]=function(_0x3f8e4e,_0x985e0d){return db[_0x3fa8('0x3e')][_0x3fa8('0x46')]({'where':{'id':_0x3f8e4e[_0x3fa8('0x4a')]['id']}})[_0x3fa8('0x27')](handleEntityNotFound(_0x985e0d,null))['then'](removeEntity(_0x985e0d,null))['catch'](handleError(_0x985e0d,null));};exports[_0x3fa8('0x4b')]=function(_0x924388,_0x143bb5){return db[_0x3fa8('0x3e')]['describe']()['then'](respondWithResult(_0x143bb5,null))[_0x3fa8('0x47')](handleError(_0x143bb5,null));};function wrapUser(_0x9e9ac1){return function(_0x1b496f){var _0x72fc89=_0x9e9ac1['get']({'plain':!![]});_0x72fc89[_0x3fa8('0x4c')]=[];if(_0x1b496f){_0x72fc89[_0x3fa8('0x4d')]=_0x1b496f['createdAt'];_0x72fc89[_0x3fa8('0x4e')]=_0x1b496f;}else{_0x72fc89['lastMessageAt']=moment(0x0)[_0x3fa8('0x4f')](_0x3fa8('0x50'));_0x72fc89[_0x3fa8('0x4e')]={};}return _0x72fc89;};}exports[_0x3fa8('0x51')]=function(_0x4a0a6c,_0x1e4793,_0x547eed){var _0x33c759=[];return db[_0x3fa8('0x52')][_0x3fa8('0x3f')]({'where':{'role':[_0x3fa8('0x53'),_0x3fa8('0x54'),_0x3fa8('0x55')]},'attributes':['id',_0x3fa8('0x56'),_0x3fa8('0x2b'),'role',_0x3fa8('0x57'),_0x3fa8('0x58'),_0x3fa8('0x59'),_0x3fa8('0x5a'),_0x3fa8('0x5b'),_0x3fa8('0x5c')],'order':qs[_0x3fa8('0x5d')]('-online'),'include':[{'model':db[_0x3fa8('0x5e')],'as':_0x3fa8('0x5f'),'attributes':['id',_0x3fa8('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x3fa8('0x27')](function(_0x3bbf21){if(_0x3bbf21){var _0x1b4766=_0x4a0a6c[_0x3fa8('0x55')][_0x3fa8('0x60')]({'plain':!![]});if(!_0x1b4766)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b4766[_0x3fa8('0x61')]===_0x3fa8('0x55')){return db['UserProfileSection'][_0x3fa8('0x46')]({'where':{'name':'Agents','userProfileId':_0x1b4766['userProfileId']},'raw':!![]})[_0x3fa8('0x27')](function(_0xbd7bba){if(_0xbd7bba){if(_0xbd7bba[_0x3fa8('0x62')]===0x0){return db[_0x3fa8('0x63')]['findAll']({'where':{'sectionId':_0xbd7bba['id']},'raw':!![]})[_0x3fa8('0x27')](function(_0x338a72){var _0x4f32bb=[];if(_[_0x3fa8('0x64')](_0x338a72)){_0x4f32bb=_['filter'](_0x3bbf21,function(_0x28da01){if(_0x28da01[_0x3fa8('0x61')]!==_0x3fa8('0x53')){return _0x28da01;}});return _0x4f32bb;}else{for(var _0x455cba=0x0;_0x455cba<_0x3bbf21['length'];_0x455cba++){var _0xed08e7=_0x3bbf21[_0x455cba];if(_0xed08e7[_0x3fa8('0x61')]===_0x3fa8('0x53')){var _0x190b21=_[_0x3fa8('0x46')](_0x338a72,function(_0x55c56c){return _0x55c56c[_0x3fa8('0x65')]===_0xed08e7['id'];});if(_0x190b21)_0x4f32bb[_0x3fa8('0x66')](_0xed08e7);}else{_0x4f32bb[_0x3fa8('0x66')](_0xed08e7);}}return _0x4f32bb;}});}else{return _0x3bbf21;}}else{var _0x2c70d7=_[_0x3fa8('0x3c')](_0x3bbf21,function(_0x1cff7f){if(_0x1cff7f['role']!==_0x3fa8('0x53')){return _0x1cff7f;}});return _0x2c70d7;}});}else{return _0x3bbf21;}}})[_0x3fa8('0x27')](function(_0x5d8ef5){var _0x29f88e=[];if(_0x5d8ef5){_0x33c759=_0x5d8ef5;for(var _0x5bf842=0x0;_0x5bf842<_0x5d8ef5[_0x3fa8('0x42')];_0x5bf842+=0x1){_0x33c759[_0x5bf842][_0x3fa8('0x4c')]=[];_0x29f88e[_0x3fa8('0x66')](db[_0x3fa8('0x3e')][_0x3fa8('0x46')]({'where':{'FromId':[_0x4a0a6c[_0x3fa8('0x55')]['id'],_0x5d8ef5[_0x5bf842]['id']],'ToId':[_0x4a0a6c[_0x3fa8('0x55')]['id'],_0x5d8ef5[_0x5bf842]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x3fa8('0x67'),_0x3fa8('0x68'),_0x3fa8('0x69'),_0x3fa8('0x49')],'order':qs[_0x3fa8('0x5d')](_0x3fa8('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3fa8('0x27')](wrapUser(_0x5d8ef5[_0x5bf842])));}return BPromise[_0x3fa8('0x6b')](_0x29f88e);}return[];})[_0x3fa8('0x27')](function(_0x2b972b){return{'rows':_0x2b972b,'count':_0x2b972b[_0x3fa8('0x42')]};})[_0x3fa8('0x27')](respondWithResult(_0x1e4793,null))[_0x3fa8('0x47')](handleError(_0x1e4793,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index cdda6b8..54cd24e 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 _0x3eae=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0xe5366,_0x32ea05){var _0x3dfd7d=function(_0x3aeb41){while(--_0x3aeb41){_0xe5366['push'](_0xe5366['shift']());}};_0x3dfd7d(++_0x32ea05);}(_0x3eae,0x162));var _0xe3ea=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x3eae[_0x2f32c4];return _0x95b5dc;};'use strict';var EventEmitter=require(_0xe3ea('0x0'));var ChatInternalMessage=require(_0xe3ea('0x1'))['db'][_0xe3ea('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe3ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe3ea('0x4'),'afterDestroy':_0xe3ea('0x5')};function emitEvent(_0x510abd){return function(_0x482c8b,_0x494639,_0x5833ab){ChatInternalMessageEvents[_0xe3ea('0x6')](_0x510abd+':'+_0x482c8b['id'],_0x482c8b);ChatInternalMessageEvents[_0xe3ea('0x6')](_0x510abd,_0x482c8b);_0x5833ab(null);};}for(var e in events){if(events[_0xe3ea('0x7')](e)){var event=events[e];ChatInternalMessage[_0xe3ea('0x8')](e,emitEvent(event));}}module[_0xe3ea('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x926b=['save','update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0x926b,0x178));var _0xb926=function(_0x596814,_0xc0e302){_0x596814=_0x596814-0x0;var _0x51a868=_0x926b[_0x596814];return _0x51a868;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xb926('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb926('0x1')](0x0);var events={'afterCreate':_0xb926('0x2'),'afterUpdate':_0xb926('0x3'),'afterDestroy':_0xb926('0x4')};function emitEvent(_0x192eb7){return function(_0x516e6b,_0x36fca7,_0x4988ad){ChatInternalMessageEvents[_0xb926('0x5')](_0x192eb7+':'+_0x516e6b['id'],_0x516e6b);ChatInternalMessageEvents[_0xb926('0x5')](_0x192eb7,_0x516e6b);_0x4988ad(null);};}for(var e in events){if(events[_0xb926('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb926('0x7')](e,emitEvent(event));}}module[_0xb926('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5b8787c..8a11380 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 _0xf039=['moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x16ff4c,_0x16dd4f){var _0x2cb985=function(_0x39dc4){while(--_0x39dc4){_0x16ff4c['push'](_0x16ff4c['shift']());}};_0x2cb985(++_0x16dd4f);}(_0xf039,0x1d0));var _0x9f03=function(_0x2e6b1e,_0x1dafa3){_0x2e6b1e=_0x2e6b1e-0x0;var _0x3c7ed7=_0xf039[_0x2e6b1e];return _0x3c7ed7;};'use strict';var _=require(_0x9f03('0x0'));var util=require(_0x9f03('0x1'));var logger=require(_0x9f03('0x2'))(_0x9f03('0x3'));var moment=require(_0x9f03('0x4'));var BPromise=require(_0x9f03('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f03('0x6'));var rimraf=require(_0x9f03('0x7'));var config=require(_0x9f03('0x8'));var attributes=require(_0x9f03('0x9'));module[_0x9f03('0xa')]=function(_0x16ca49,_0x43e07e){return _0x16ca49['define']('ChatInternalMessage',attributes,{'tableName':_0x9f03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f03('0xc')});}; \ No newline at end of file +var _0x4c73=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x205d8f,_0x491ea5){var _0x3b178f=function(_0x4bcfca){while(--_0x4bcfca){_0x205d8f['push'](_0x205d8f['shift']());}};_0x3b178f(++_0x491ea5);}(_0x4c73,0x121));var _0x34c7=function(_0x520f86,_0x240cc0){_0x520f86=_0x520f86-0x0;var _0x4b6523=_0x4c73[_0x520f86];return _0x4b6523;};'use strict';var _=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var logger=require(_0x34c7('0x2'))(_0x34c7('0x3'));var moment=require(_0x34c7('0x4'));var BPromise=require(_0x34c7('0x5'));var rp=require(_0x34c7('0x6'));var fs=require('fs');var path=require(_0x34c7('0x7'));var rimraf=require(_0x34c7('0x8'));var config=require(_0x34c7('0x9'));var attributes=require(_0x34c7('0xa'));module[_0x34c7('0xb')]=function(_0x543eb4,_0xb9c7c2){return _0x543eb4[_0x34c7('0xc')](_0x34c7('0xd'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x34c7('0xe'),'collate':_0x34c7('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9327f0c..8179fb5 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 _0x1050=['ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x85b464,_0xb32a20){var _0x75dc19=function(_0x1706e5){while(--_0x1706e5){_0x85b464['push'](_0x85b464['shift']());}};_0x75dc19(++_0xb32a20);}(_0x1050,0x1ef));var _0x0105=function(_0x59a6df,_0xbe3574){_0x59a6df=_0x59a6df-0x0;var _0x12ad25=_0x1050[_0x59a6df];return _0x12ad25;};'use strict';var _=require(_0x0105('0x0'));var util=require(_0x0105('0x1'));var moment=require(_0x0105('0x2'));var BPromise=require(_0x0105('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0105('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0105('0x5'));var logger=require(_0x0105('0x6'))(_0x0105('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0105('0x8')][_0x0105('0x9')]({'port':0x232a});config[_0x0105('0xa')]=_[_0x0105('0xb')](config[_0x0105('0xa')],{'host':_0x0105('0xc'),'port':0x18eb});var socket=require(_0x0105('0xd'))(new Redis(config[_0x0105('0xa')]));require('./chatInternalMessage.socket')[_0x0105('0xe')](socket);function respondWithRpcPromise(_0x4ac277,_0x455abd,_0x2df2fe){return new BPromise(function(_0x3633e5,_0x3de825){return client[_0x0105('0xf')](_0x4ac277,_0x2df2fe)[_0x0105('0x10')](function(_0x1a6afd){logger[_0x0105('0x11')](_0x0105('0x12'),_0x455abd,'request\x20sent');logger[_0x0105('0x13')](_0x0105('0x14'),_0x455abd,'request\x20sent',JSON[_0x0105('0x15')](_0x1a6afd));if(_0x1a6afd[_0x0105('0x16')]){if(_0x1a6afd[_0x0105('0x16')][_0x0105('0x17')]===0x1f4){logger[_0x0105('0x16')](_0x0105('0x12'),_0x455abd,_0x1a6afd['error']['message']);return _0x3de825(_0x1a6afd[_0x0105('0x16')][_0x0105('0x18')]);}logger[_0x0105('0x16')](_0x0105('0x12'),_0x455abd,_0x1a6afd['error']['message']);return _0x3633e5(_0x1a6afd['error'][_0x0105('0x18')]);}else{logger[_0x0105('0x11')](_0x0105('0x12'),_0x455abd,_0x0105('0x19'));_0x3633e5(_0x1a6afd[_0x0105('0x1a')][_0x0105('0x18')]);}})['catch'](function(_0x2e191c){logger[_0x0105('0x16')](_0x0105('0x12'),_0x455abd,_0x2e191c);_0x3de825(_0x2e191c);});});} \ No newline at end of file +var _0x4be6=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1b046c,_0x237e24){var _0x9a9a15=function(_0xff633d){while(--_0xff633d){_0x1b046c['push'](_0x1b046c['shift']());}};_0x9a9a15(++_0x237e24);}(_0x4be6,0xb5));var _0x64be=function(_0x4b19e3,_0x2b63c3){_0x4b19e3=_0x4b19e3-0x0;var _0x2ce22a=_0x4be6[_0x4b19e3];return _0x2ce22a;};'use strict';var _=require('lodash');var util=require(_0x64be('0x0'));var moment=require(_0x64be('0x1'));var BPromise=require(_0x64be('0x2'));var rs=require(_0x64be('0x3'));var fs=require('fs');var Redis=require(_0x64be('0x4'));var db=require(_0x64be('0x5'))['db'];var utils=require(_0x64be('0x6'));var logger=require(_0x64be('0x7'))(_0x64be('0x8'));var config=require(_0x64be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64be('0xa')][_0x64be('0xb')]({'port':0x232a});config[_0x64be('0xc')]=_['defaults'](config[_0x64be('0xc')],{'host':_0x64be('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64be('0xc')]));require('./chatInternalMessage.socket')[_0x64be('0xe')](socket);function respondWithRpcPromise(_0x30b50b,_0x490a80,_0x233dae){return new BPromise(function(_0x3be6de,_0xb45222){return client[_0x64be('0xf')](_0x30b50b,_0x233dae)['then'](function(_0x114265){logger['info'](_0x64be('0x10'),_0x490a80,_0x64be('0x11'));logger[_0x64be('0x12')](_0x64be('0x13'),_0x490a80,_0x64be('0x11'),JSON['stringify'](_0x114265));if(_0x114265[_0x64be('0x14')]){if(_0x114265['error'][_0x64be('0x15')]===0x1f4){logger[_0x64be('0x14')](_0x64be('0x10'),_0x490a80,_0x114265[_0x64be('0x14')][_0x64be('0x16')]);return _0xb45222(_0x114265['error']['message']);}logger[_0x64be('0x14')](_0x64be('0x10'),_0x490a80,_0x114265[_0x64be('0x14')][_0x64be('0x16')]);return _0x3be6de(_0x114265[_0x64be('0x14')]['message']);}else{logger[_0x64be('0x17')](_0x64be('0x10'),_0x490a80,_0x64be('0x11'));_0x3be6de(_0x114265['result'][_0x64be('0x16')]);}})[_0x64be('0x18')](function(_0x3aea7f){logger[_0x64be('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x490a80,_0x3aea7f);_0xb45222(_0x3aea7f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ea643f1..c6304e0 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 _0x7a65=['emit','register','save','remove','update'];(function(_0x2aebf5,_0x1ace5a){var _0x24b50b=function(_0x172d24){while(--_0x172d24){_0x2aebf5['push'](_0x2aebf5['shift']());}};_0x24b50b(++_0x1ace5a);}(_0x7a65,0x8e));var _0x57a6=function(_0x383f1f,_0x13a259){_0x383f1f=_0x383f1f-0x0;var _0x409523=_0x7a65[_0x383f1f];return _0x409523;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x57a6('0x0'),_0x57a6('0x1'),_0x57a6('0x2')];function createListener(_0x19b0ad,_0x578cbc){return function(_0x1eafd5){_0x578cbc[_0x57a6('0x3')](_0x19b0ad,_0x1eafd5);};}function removeListener(_0x3a3202,_0x5ecbe3){return function(){ChatInternalMessageEvents['removeListener'](_0x3a3202,_0x5ecbe3);};}exports[_0x57a6('0x4')]=function(_0x169eec){for(var _0x3ec033=0x0,_0x56a0b7=events['length'];_0x3ec033<_0x56a0b7;_0x3ec033++){var _0x5c4301=events[_0x3ec033];var _0x5010eb=createListener('chatInternalMessage:'+_0x5c4301,_0x169eec);ChatInternalMessageEvents['on'](_0x5c4301,_0x5010eb);}}; \ No newline at end of file +var _0xc6fa=['chatInternalMessage:','./chatInternalMessage.events','update','emit','removeListener','length'];(function(_0xc2590d,_0x4b4c5f){var _0x46d870=function(_0x14395a){while(--_0x14395a){_0xc2590d['push'](_0xc2590d['shift']());}};_0x46d870(++_0x4b4c5f);}(_0xc6fa,0x1b7));var _0xac6f=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xc6fa[_0x5805d7];return _0x170fe4;};'use strict';var ChatInternalMessageEvents=require(_0xac6f('0x0'));var events=['save','remove',_0xac6f('0x1')];function createListener(_0xef93a7,_0x27dbca){return function(_0x58a94b){_0x27dbca[_0xac6f('0x2')](_0xef93a7,_0x58a94b);};}function removeListener(_0x48d11f,_0x230df8){return function(){ChatInternalMessageEvents[_0xac6f('0x3')](_0x48d11f,_0x230df8);};}exports['register']=function(_0x52aa69){for(var _0x10adea=0x0,_0x435414=events[_0xac6f('0x4')];_0x10adea<_0x435414;_0x10adea++){var _0x1e4545=events[_0x10adea];var _0x19f610=createListener(_0xac6f('0x5')+_0x1e4545,_0x52aa69);ChatInternalMessageEvents['on'](_0x1e4545,_0x19f610);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 20594d1..900463c 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 _0x7767=['/users','getUsers','/:id','post','create','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','/describe','describe','get'];(function(_0x53c937,_0x3acfff){var _0x24f3b3=function(_0x5cd683){while(--_0x5cd683){_0x53c937['push'](_0x53c937['shift']());}};_0x24f3b3(++_0x3acfff);}(_0x7767,0x16f));var _0x7776=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x7767[_0x1cb18a];return _0x22442e;};'use strict';var multer=require(_0x7776('0x0'));var util=require('util');var path=require(_0x7776('0x1'));var timeout=require(_0x7776('0x2'));var express=require(_0x7776('0x3'));var router=express[_0x7776('0x4')]();var fs_extra=require(_0x7776('0x5'));var auth=require(_0x7776('0x6'));var interaction=require(_0x7776('0x7'));var config=require('../../config/environment');var controller=require(_0x7776('0x8'));router['get']('/',auth[_0x7776('0x9')](),controller['index']);router['get'](_0x7776('0xa'),auth[_0x7776('0x9')](),controller[_0x7776('0xb')]);router[_0x7776('0xc')](_0x7776('0xd'),auth[_0x7776('0x9')](),controller[_0x7776('0xe')]);router[_0x7776('0xc')](_0x7776('0xf'),auth[_0x7776('0x9')](),controller['show']);router[_0x7776('0x10')]('/',auth[_0x7776('0x9')](),controller[_0x7776('0x11')]);router[_0x7776('0x12')](_0x7776('0xf'),controller[_0x7776('0x13')]);router['delete'](_0x7776('0xf'),auth[_0x7776('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1aed=['/users','isAuthenticated','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','path','express','Router','../../config/environment','./chatInternalMessage.controller','get','/describe'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x1aed,0xdc));var _0xd1ae=function(_0x586d85,_0x2d6de1){_0x586d85=_0x586d85-0x0;var _0x327e7b=_0x1aed[_0x586d85];return _0x327e7b;};'use strict';var multer=require(_0xd1ae('0x0'));var util=require('util');var path=require(_0xd1ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1ae('0x2'));var router=express[_0xd1ae('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1ae('0x4'));var controller=require(_0xd1ae('0x5'));router[_0xd1ae('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd1ae('0x6')](_0xd1ae('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xd1ae('0x6')](_0xd1ae('0x8'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0xa')]);router[_0xd1ae('0x6')](_0xd1ae('0xb'),auth[_0xd1ae('0x9')](),controller[_0xd1ae('0xc')]);router['post']('/',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0xd')]);router[_0xd1ae('0xe')](_0xd1ae('0xb'),controller[_0xd1ae('0xf')]);router[_0xd1ae('0x10')]('/:id',auth[_0xd1ae('0x9')](),controller[_0xd1ae('0x11')]);module[_0xd1ae('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 99d6ddb..9ba65d5 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 _0x74f4=['DATE','STRING','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x56c643,_0x1a97fa){var _0x169734=function(_0x3b567c){while(--_0x3b567c){_0x56c643['push'](_0x56c643['shift']());}};_0x169734(++_0x1a97fa);}(_0x74f4,0xaa));var _0x474f=function(_0x1687b8,_0x30ccd4){_0x1687b8=_0x1687b8-0x0;var _0x2bcc02=_0x74f4[_0x1687b8];return _0x2bcc02;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x474f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x474f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x474f('0x4')]('in','out'),'defaultValue':_0x474f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x474f('0x6')]},'providerName':{'type':Sequelize[_0x474f('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x056b=['medium','BOOLEAN','ENUM','out','DATE','STRING','exports','TEXT'];(function(_0x2242a1,_0x38f44d){var _0x2c298b=function(_0x4f4246){while(--_0x4f4246){_0x2242a1['push'](_0x2242a1['shift']());}};_0x2c298b(++_0x38f44d);}(_0x056b,0xb6));var _0xb056=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x056b[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'body':{'type':Sequelize[_0xb056('0x1')](_0xb056('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb056('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb056('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb056('0x4')]('in',_0xb056('0x5')),'defaultValue':_0xb056('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb056('0x6')]},'providerName':{'type':Sequelize[_0xb056('0x7')]},'providerResponse':{'type':Sequelize[_0xb056('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 236257b..f55ca63 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 _0x280a=['AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','channel','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','name','send','index','ChatMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','filter','options','include','rows','show','params','length','includeAll','find','update','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','agent','get','ChatInteractionId','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null'];(function(_0x31072c,_0x20aa9b){var _0x3675c4=function(_0x24622e){while(--_0x24622e){_0x31072c['push'](_0x31072c['shift']());}};_0x3675c4(++_0x20aa9b);}(_0x280a,0x11f));var _0xa280=function(_0x1af61a,_0x2f6fce){_0x1af61a=_0x1af61a-0x0;var _0x4eed63=_0x280a[_0x1af61a];return _0x4eed63;};'use strict';var emlformat=require(_0xa280('0x0'));var rimraf=require(_0xa280('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa280('0x2'));var BPromise=require(_0xa280('0x3'));var Mustache=require(_0xa280('0x4'));var util=require('util');var path=require(_0xa280('0x5'));var sox=require(_0xa280('0x6'));var csv=require(_0xa280('0x7'));var ejs=require(_0xa280('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa280('0x9'));var squel=require(_0xa280('0xa'));var crypto=require(_0xa280('0xb'));var jsforce=require(_0xa280('0xc'));var deskjs=require(_0xa280('0xd'));var toCsv=require(_0xa280('0x7'));var querystring=require(_0xa280('0xe'));var Papa=require(_0xa280('0xf'));var Redis=require(_0xa280('0x10'));var authService=require(_0xa280('0x11'));var qs=require(_0xa280('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa280('0x13'));var logger=require(_0xa280('0x14'))(_0xa280('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa280('0x16'));var db=require('../../mysqldb')['db'];config[_0xa280('0x17')]=_[_0xa280('0x18')](config[_0xa280('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa280('0x17')]));require(_0xa280('0x19'))[_0xa280('0x1a')](socket);var jayson=require(_0xa280('0x1b'));var client=jayson[_0xa280('0x1c')][_0xa280('0x1d')]({'port':0x232c});var client9002=jayson[_0xa280('0x1c')][_0xa280('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x445aa7,_0x1c85f8,_0x3ea332,_0x277511){return new BPromise(function(_0xdb7535,_0x20bf5c){var _0x16a360=_0x277511||client;return _0x16a360[_0xa280('0x1e')](_0x445aa7,_0x3ea332)['then'](function(_0x219f13){logger[_0xa280('0x1f')](_0xa280('0x20'),_0x1c85f8,_0xa280('0x21'));logger[_0xa280('0x22')](_0xa280('0x23'),_0x1c85f8,_0xa280('0x21'),JSON[_0xa280('0x24')](_0x219f13));if(_0x219f13[_0xa280('0x25')]){if(_0x219f13[_0xa280('0x25')][_0xa280('0x26')]===0x1f4){logger['error'](_0xa280('0x20'),_0x1c85f8,_0x219f13['error'][_0xa280('0x27')]);return _0x20bf5c(_0x219f13[_0xa280('0x25')][_0xa280('0x27')]);}logger['error'](_0xa280('0x20'),_0x1c85f8,_0x219f13[_0xa280('0x25')][_0xa280('0x27')]);return _0xdb7535(_0x219f13[_0xa280('0x25')][_0xa280('0x27')]);}else{logger[_0xa280('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x1c85f8,_0xa280('0x21'));_0xdb7535(_0x219f13[_0xa280('0x28')]['message']);}})[_0xa280('0x29')](function(_0x15dbae){logger['error'](_0xa280('0x20'),_0x1c85f8,_0x15dbae);_0x20bf5c(_0x15dbae);});});}function respondWithStatusCode(_0x4d8c1d,_0xbe4ae0){_0xbe4ae0=_0xbe4ae0||0xcc;return function(_0x26a298){if(_0x26a298){return _0x4d8c1d[_0xa280('0x2a')](_0xbe4ae0);}return _0x4d8c1d['status'](_0xbe4ae0)[_0xa280('0x2b')]();};}function respondWithResult(_0x17adbf,_0x3d08c3){_0x3d08c3=_0x3d08c3||0xc8;return function(_0x5ebe6f){if(_0x5ebe6f){return _0x17adbf[_0xa280('0x2c')](_0x3d08c3)[_0xa280('0x2d')](_0x5ebe6f);}};}function respondWithFilteredResult(_0xc68548,_0x5df0b4){return function(_0xb681c1){if(_0xb681c1){var _0xcc2dff=typeof _0x5df0b4[_0xa280('0x2e')]===_0xa280('0x2f')&&typeof _0x5df0b4[_0xa280('0x30')]===_0xa280('0x2f');var _0x1b6537=_0xb681c1[_0xa280('0x31')];var _0x1fd982=_0xcc2dff?0x0:_0x5df0b4[_0xa280('0x2e')];var _0x5bf04a=_0xcc2dff?_0xb681c1[_0xa280('0x31')]:_0x5df0b4[_0xa280('0x2e')]+_0x5df0b4[_0xa280('0x30')];var _0x12ce0f;if(_0x5bf04a>=_0x1b6537){_0x5bf04a=_0x1b6537;_0x12ce0f=0xc8;}else{_0x12ce0f=0xce;}_0xc68548[_0xa280('0x2c')](_0x12ce0f);return _0xc68548['set'](_0xa280('0x32'),_0x1fd982+'-'+_0x5bf04a+'/'+_0x1b6537)[_0xa280('0x2d')](_0xb681c1);}return null;};}function patchUpdates(_0x551f87){return function(_0x32483c){try{jsonpatch[_0xa280('0x33')](_0x32483c,_0x551f87,!![]);}catch(_0x3c7516){return BPromise['reject'](_0x3c7516);}return _0x32483c[_0xa280('0x34')]();};}function saveUpdates(_0x5b90f4,_0x327bfa){return function(_0x1de988){if(_0x1de988){return _0x1de988['update'](_0x5b90f4)[_0xa280('0x35')](function(_0x2621d0){return _0x2621d0;});}return null;};}function removeEntity(_0x36bcad,_0x54bab5){return function(_0x56bff7){if(_0x56bff7){return _0x56bff7[_0xa280('0x36')]()[_0xa280('0x35')](function(){_0x36bcad[_0xa280('0x2c')](0xcc)[_0xa280('0x2b')]();});}};}function handleEntityNotFound(_0x18a99b,_0x488faf){return function(_0x553997){if(!_0x553997){_0x18a99b[_0xa280('0x2a')](0x194);}return _0x553997;};}function handleError(_0x1a280a,_0x19c567){_0x19c567=_0x19c567||0x1f4;return function(_0xe8cdf3){logger[_0xa280('0x25')](_0xe8cdf3['stack']);if(_0xe8cdf3[_0xa280('0x37')]){delete _0xe8cdf3[_0xa280('0x37')];}_0x1a280a[_0xa280('0x2c')](_0x19c567)[_0xa280('0x38')](_0xe8cdf3);};}exports[_0xa280('0x39')]=function(_0x3c2f4c,_0x461459){var _0x430b06={},_0x4bc2ae={},_0x1300cc={'count':0x0,'rows':[]};var _0x2c855c=_['map'](db[_0xa280('0x3a')][_0xa280('0x3b')],function(_0x13702b){return{'name':_0x13702b['fieldName'],'type':_0x13702b[_0xa280('0x3c')][_0xa280('0x3d')]};});_0x4bc2ae[_0xa280('0x3e')]=_[_0xa280('0x3f')](_0x2c855c,_0xa280('0x37'));_0x4bc2ae[_0xa280('0x40')]=_[_0xa280('0x41')](_0x3c2f4c['query']);_0x4bc2ae[_0xa280('0x42')]=_['intersection'](_0x4bc2ae['model'],_0x4bc2ae[_0xa280('0x40')]);_0x430b06[_0xa280('0x43')]=_[_0xa280('0x44')](_0x4bc2ae['model'],qs[_0xa280('0x45')](_0x3c2f4c['query']['fields']));_0x430b06[_0xa280('0x43')]=_0x430b06['attributes']['length']?_0x430b06['attributes']:_0x4bc2ae['model'];if(!_0x3c2f4c['query']['hasOwnProperty'](_0xa280('0x46'))){_0x430b06[_0xa280('0x30')]=qs[_0xa280('0x30')](_0x3c2f4c['query'][_0xa280('0x30')]);_0x430b06[_0xa280('0x2e')]=qs['offset'](_0x3c2f4c[_0xa280('0x40')][_0xa280('0x2e')]);}_0x430b06[_0xa280('0x47')]=qs['sort'](_0x3c2f4c['query'][_0xa280('0x48')]);_0x430b06[_0xa280('0x49')]=qs[_0xa280('0x42')](_[_0xa280('0x4a')](_0x3c2f4c[_0xa280('0x40')],_0x4bc2ae[_0xa280('0x42')]),_0x2c855c);if(_0x3c2f4c[_0xa280('0x40')]['filter']){_0x430b06[_0xa280('0x49')]=_[_0xa280('0x4b')](_0x430b06[_0xa280('0x49')],{'$or':_[_0xa280('0x3f')](_0x2c855c,function(_0x161998){if(_0x161998['type']!=='VIRTUAL'){var _0xd9cf23={};_0xd9cf23[_0x161998['name']]={'$like':'%'+_0x3c2f4c[_0xa280('0x40')][_0xa280('0x4c')]+'%'};return _0xd9cf23;}})});}_0x430b06=_[_0xa280('0x4b')]({},_0x430b06,_0x3c2f4c[_0xa280('0x4d')]);var _0x305dac={'where':_0x430b06[_0xa280('0x49')]};return db[_0xa280('0x3a')][_0xa280('0x31')](_0x305dac)[_0xa280('0x35')](function(_0x45225b){_0x1300cc[_0xa280('0x31')]=_0x45225b;if(_0x3c2f4c[_0xa280('0x40')]['includeAll']){_0x430b06[_0xa280('0x4e')]=[{'all':!![]}];}return db[_0xa280('0x3a')]['findAll'](_0x430b06);})['then'](function(_0x532433){_0x1300cc[_0xa280('0x4f')]=_0x532433;return _0x1300cc;})[_0xa280('0x35')](respondWithFilteredResult(_0x461459,_0x430b06))[_0xa280('0x29')](handleError(_0x461459,null));};exports[_0xa280('0x50')]=function(_0x3ab174,_0x2b58b5){var _0x2ac47c={'raw':!![],'where':{'id':_0x3ab174[_0xa280('0x51')]['id']}},_0x1f9622={};_0x1f9622[_0xa280('0x3e')]=_[_0xa280('0x41')](db[_0xa280('0x3a')][_0xa280('0x3b')]);_0x1f9622[_0xa280('0x40')]=_[_0xa280('0x41')](_0x3ab174['query']);_0x1f9622['filters']=_[_0xa280('0x44')](_0x1f9622[_0xa280('0x3e')],_0x1f9622[_0xa280('0x40')]);_0x2ac47c['attributes']=_[_0xa280('0x44')](_0x1f9622['model'],qs['fields'](_0x3ab174[_0xa280('0x40')][_0xa280('0x45')]));_0x2ac47c[_0xa280('0x43')]=_0x2ac47c[_0xa280('0x43')][_0xa280('0x52')]?_0x2ac47c[_0xa280('0x43')]:_0x1f9622[_0xa280('0x3e')];if(_0x3ab174[_0xa280('0x40')][_0xa280('0x53')]){_0x2ac47c['include']=[{'all':!![]}];}_0x2ac47c=_[_0xa280('0x4b')]({},_0x2ac47c,_0x3ab174['options']);return db[_0xa280('0x3a')][_0xa280('0x54')](_0x2ac47c)[_0xa280('0x35')](handleEntityNotFound(_0x2b58b5,null))[_0xa280('0x35')](respondWithResult(_0x2b58b5,null))['catch'](handleError(_0x2b58b5,null));};exports['create']=function(_0x4328b1,_0x2935be){return db[_0xa280('0x3a')]['create'](_0x4328b1['body'],{})['then'](respondWithResult(_0x2935be,0xc9))[_0xa280('0x29')](handleError(_0x2935be,null));};exports[_0xa280('0x55')]=function(_0x1163cf,_0x5f29b7){if(_0x1163cf[_0xa280('0x56')]['id']){delete _0x1163cf[_0xa280('0x56')]['id'];}return db[_0xa280('0x3a')][_0xa280('0x54')]({'where':{'id':_0x1163cf[_0xa280('0x51')]['id']}})[_0xa280('0x35')](handleEntityNotFound(_0x5f29b7,null))[_0xa280('0x35')](saveUpdates(_0x1163cf[_0xa280('0x56')],null))['then'](respondWithResult(_0x5f29b7,null))['catch'](handleError(_0x5f29b7,null));};exports['destroy']=function(_0x4fc7ee,_0x7e79f0){return db['ChatMessage'][_0xa280('0x54')]({'where':{'id':_0x4fc7ee[_0xa280('0x51')]['id']}})[_0xa280('0x35')](handleEntityNotFound(_0x7e79f0,null))['then'](removeEntity(_0x7e79f0,null))[_0xa280('0x29')](handleError(_0x7e79f0,null));};exports[_0xa280('0x57')]=function(_0xc7a840,_0x474b0a){return db['ChatMessage'][_0xa280('0x57')]()[_0xa280('0x35')](respondWithResult(_0x474b0a,null))['catch'](handleError(_0x474b0a,null));};var interaction_log=require('../../config/logger')(_0xa280('0x58'));exports[_0xa280('0x59')]=function(_0x2bdb7a,_0x2f5efa,_0x82c153){var _0x1b7d8d={'agent':{},'channel':_0xa280('0x5a')};if(_0x2bdb7a[_0xa280('0x56')]['id']){delete _0x2bdb7a[_0xa280('0x56')]['id'];}_0x2bdb7a['body'][_0xa280('0x5b')]=!![];_0x2bdb7a[_0xa280('0x56')][_0xa280('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2bdb7a[_0xa280('0x56')][_0xa280('0x5d')]=_0x2bdb7a['body']['UserId']||_0x2bdb7a[_0xa280('0x5e')]['id'];_0x1b7d8d[_0xa280('0x5f')]['id']=_0x2bdb7a[_0xa280('0x56')][_0xa280('0x5d')];return db[_0xa280('0x3a')][_0xa280('0x54')]({'where':{'id':_0x2bdb7a[_0xa280('0x51')]['id'],'UserId':null}})[_0xa280('0x35')](handleEntityNotFound(_0x2f5efa,null))[_0xa280('0x35')](saveUpdates(_0x2bdb7a[_0xa280('0x56')],null))[_0xa280('0x35')](function(_0x2cd554){if(_0x2cd554){_0x1b7d8d['message']=_0x2cd554[_0xa280('0x60')]({'plain':!![]});return db['ChatInteraction'][_0xa280('0x54')]({'where':{'id':_0x2cd554[_0xa280('0x61')]}});}return null;})[_0xa280('0x35')](handleEntityNotFound(_0x2f5efa,null))[_0xa280('0x35')](function(_0x4928fa){if(_0x4928fa){return _0x4928fa[_0xa280('0x55')]({'UserId':_0x2bdb7a['body'][_0xa280('0x5d')],'read1stAt':_['isNil'](_0x4928fa['read1stAt'])?moment()[_0xa280('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa280('0x35')](function(_0x596046){if(_0x596046){_0x1b7d8d[_0xa280('0x63')]=_0x596046[_0xa280('0x60')]({'plain':!![]});interaction_log[_0xa280('0x1f')](_0xa280('0x64'),_0x2bdb7a[_0xa280('0x5e')]['id'],_0x2bdb7a[_0xa280('0x5e')][_0xa280('0x37')],_0x2bdb7a[_0xa280('0x5e')][_0xa280('0x65')],_0x1b7d8d[_0xa280('0x63')]['id'],_0x2bdb7a[_0xa280('0x56')]?JSON[_0xa280('0x24')](_0x2bdb7a[_0xa280('0x56')]):_0xa280('0x66'));return respondWithRpcPromise(_0xa280('0x67'),_0xa280('0x68'),_0x1b7d8d);}return null;})['then'](function(_0x8c9d33){var _0x37dcd4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8c9d33[_0xa280('0x27')][_0xa280('0x69')];return db[_0xa280('0x6a')][_0xa280('0x40')](_0x37dcd4,{'type':db[_0xa280('0x6b')][_0xa280('0x6c')][_0xa280('0x6d')],'raw':!![]})[_0xa280('0x35')](function(_0x2b657c){return _0x2b657c;});})[_0xa280('0x35')](function(_0x18a881){if(_0x18a881){_0x1b7d8d[_0xa280('0x27')][_0xa280('0x6e')]=_0x18a881[0x0];if(!_0x2bdb7a[_0xa280('0x56')][_0xa280('0x5d')])return;return db['User']['find']({'where':{'id':_0x2bdb7a['body']['UserId'],'role':_0xa280('0x5f')},'attributes':['id',_0xa280('0x37'),_0xa280('0x6f'),_0xa280('0x70'),'internal'],'raw':!![]});}return null;})[_0xa280('0x35')](function(_0x1b4c83){if(!_0x1b4c83)return null;_0x1b7d8d['message'][_0xa280('0x5f')]=_0x1b4c83;return _0x1b7d8d;})[_0xa280('0x35')](function(_0x192fa1){if(_0x192fa1){if(_0x2bdb7a[_0xa280('0x56')][_0xa280('0x71')]){_0x1b7d8d[_0xa280('0x27')][_0xa280('0x72')]=util[_0xa280('0x62')](_0xa280('0x73'),_0x2bdb7a[_0xa280('0x5e')][_0xa280('0x37')]);_0x1b7d8d[_0xa280('0x27')]['channel']=_0x1b7d8d['channel'];_0x1b7d8d[_0xa280('0x27')][_0xa280('0x74')]=_0x1b7d8d['channel'];_0x1b7d8d[_0xa280('0x27')][_0xa280('0x75')]='accept';return respondWithRpcPromise(_0xa280('0x76'),_0xa280('0x76'),{'event':_0xa280('0x77'),'message':_['merge'](_0x1b7d8d['message'],JSON[_0xa280('0x78')](_0x1b7d8d[_0xa280('0x63')][_0xa280('0x79')]))},client9002)[_0xa280('0x35')](function(){return _0x1b7d8d;});}return _0x1b7d8d;}return null;})[_0xa280('0x35')](respondWithResult(_0x2f5efa,null))['catch'](handleError(_0x2f5efa,null));};var interaction_log=require(_0xa280('0x14'))(_0xa280('0x58'));exports[_0xa280('0x7a')]=function(_0x10e82c,_0x5eb056,_0x2a4dfd){var _0x160853={'agent':{},'channel':'chat'};if(_0x10e82c[_0xa280('0x56')]['id']){delete _0x10e82c[_0xa280('0x56')]['id'];}_0x10e82c['body'][_0xa280('0x5d')]=_0x10e82c[_0xa280('0x56')][_0xa280('0x5d')]||_0x10e82c[_0xa280('0x5e')]['id'];_0x160853[_0xa280('0x5f')]['id']=_0x10e82c['body'][_0xa280('0x5d')];return db['ChatMessage'][_0xa280('0x54')]({'where':{'id':_0x10e82c[_0xa280('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5eb056,null))[_0xa280('0x35')](function(_0x2dd02c){if(_0x2dd02c){_0x160853['message']=_0x2dd02c[_0xa280('0x60')]({'plain':!![]});return db[_0xa280('0x7b')][_0xa280('0x54')]({'where':{'id':_0x2dd02c[_0xa280('0x61')]}});}return null;})[_0xa280('0x35')](handleEntityNotFound(_0x5eb056,null))['then'](function(_0x58ad09){if(_0x58ad09){_0x160853[_0xa280('0x63')]=_0x58ad09[_0xa280('0x60')]({'plain':!![]});interaction_log[_0xa280('0x1f')](_0xa280('0x7c'),_0x10e82c[_0xa280('0x5e')]['id'],_0x10e82c[_0xa280('0x5e')][_0xa280('0x37')],_0x10e82c[_0xa280('0x5e')][_0xa280('0x65')],_0x160853[_0xa280('0x63')]['id'],_0x10e82c[_0xa280('0x56')]?JSON[_0xa280('0x24')](_0x10e82c[_0xa280('0x56')]):_0xa280('0x66'));return respondWithRpcPromise(_0xa280('0x7d'),_0xa280('0x7e'),_0x160853);}return null;})['then'](function(_0x1b1dd7){var _0x2b97fe=_0xa280('0x7f')+_0x1b1dd7['message'][_0xa280('0x69')];return db['sequelize'][_0xa280('0x40')](_0x2b97fe,{'type':db[_0xa280('0x6b')]['QueryTypes'][_0xa280('0x6d')],'raw':!![]})['then'](function(_0x44e58b){return _0x44e58b;});})['then'](function(_0xfd7ca3){if(_0xfd7ca3){_0x160853[_0xa280('0x27')][_0xa280('0x6e')]=_0xfd7ca3[0x0];if(!_0x10e82c['body'][_0xa280('0x5d')])return;return db['User'][_0xa280('0x54')]({'where':{'id':_0x10e82c['body']['UserId'],'role':_0xa280('0x5f')},'attributes':['id',_0xa280('0x37'),_0xa280('0x6f'),_0xa280('0x70'),_0xa280('0x80')],'raw':!![]});}return null;})[_0xa280('0x35')](function(_0x1fab03){if(!_0x1fab03)return null;_0x160853[_0xa280('0x27')][_0xa280('0x5f')]=_0x1fab03;return _0x160853;})[_0xa280('0x35')](function(_0x314e50){if(_0x314e50){_0x314e50[_0xa280('0x27')]['interface']=util[_0xa280('0x62')](_0xa280('0x73'),_0x10e82c[_0xa280('0x5e')]['name']);_0x314e50[_0xa280('0x27')][_0xa280('0x81')]=_0x160853[_0xa280('0x81')];_0x314e50[_0xa280('0x27')][_0xa280('0x74')]=_0x160853[_0xa280('0x81')];_0x314e50[_0xa280('0x27')][_0xa280('0x75')]=_0xa280('0x7a');respondWithRpcPromise(_0xa280('0x76'),_0xa280('0x76'),{'event':'rejectmessage','message':_[_0xa280('0x4b')](_0x160853[_0xa280('0x27')],JSON[_0xa280('0x78')](_0x160853['interaction']['formData']))},client9002);return _0x160853;}return null;})[_0xa280('0x35')](respondWithResult(_0x5eb056,null))[_0xa280('0x29')](handleError(_0x5eb056,null));}; \ No newline at end of file +var _0xfcda=['reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','parse','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatMessage','includeAll','include','rows','catch','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','formData'];(function(_0x1bf507,_0x33a1dc){var _0x126dad=function(_0x40f24b){while(--_0x40f24b){_0x1bf507['push'](_0x1bf507['shift']());}};_0x126dad(++_0x33a1dc);}(_0xfcda,0x117));var _0xafcd=function(_0x19594c,_0x1e99f9){_0x19594c=_0x19594c-0x0;var _0x4e2746=_0xfcda[_0x19594c];return _0x4e2746;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafcd('0x0'));var zipdir=require(_0xafcd('0x1'));var jsonpatch=require(_0xafcd('0x2'));var rp=require('request-promise');var moment=require(_0xafcd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xafcd('0x4'));var util=require('util');var path=require('path');var sox=require(_0xafcd('0x5'));var csv=require(_0xafcd('0x6'));var ejs=require(_0xafcd('0x7'));var fs=require('fs');var fs_extra=require(_0xafcd('0x8'));var _=require(_0xafcd('0x9'));var squel=require(_0xafcd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xafcd('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafcd('0xc'));var Redis=require(_0xafcd('0xd'));var authService=require(_0xafcd('0xe'));var qs=require(_0xafcd('0xf'));var as=require(_0xafcd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafcd('0x11'))('api');var utils=require(_0xafcd('0x12'));var config=require(_0xafcd('0x13'));var licenseUtil=require(_0xafcd('0x14'));var db=require(_0xafcd('0x15'))['db'];config[_0xafcd('0x16')]=_['defaults'](config[_0xafcd('0x16')],{'host':_0xafcd('0x17'),'port':0x18eb});var socket=require(_0xafcd('0x18'))(new Redis(config[_0xafcd('0x16')]));require(_0xafcd('0x19'))[_0xafcd('0x1a')](socket);var jayson=require(_0xafcd('0x1b'));var client=jayson[_0xafcd('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xafcd('0x1c')][_0xafcd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5b3efa,_0x418bdf,_0x5a67ec,_0x181237){return new BPromise(function(_0x229a39,_0x3bf257){var _0x4b8e4f=_0x181237||client;return _0x4b8e4f[_0xafcd('0x1e')](_0x5b3efa,_0x5a67ec)[_0xafcd('0x1f')](function(_0x844bc5){logger[_0xafcd('0x20')](_0xafcd('0x21'),_0x418bdf,_0xafcd('0x22'));logger[_0xafcd('0x23')](_0xafcd('0x24'),_0x418bdf,'request\x20sent',JSON[_0xafcd('0x25')](_0x844bc5));if(_0x844bc5[_0xafcd('0x26')]){if(_0x844bc5[_0xafcd('0x26')][_0xafcd('0x27')]===0x1f4){logger[_0xafcd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x418bdf,_0x844bc5['error'][_0xafcd('0x28')]);return _0x3bf257(_0x844bc5[_0xafcd('0x26')][_0xafcd('0x28')]);}logger[_0xafcd('0x26')](_0xafcd('0x21'),_0x418bdf,_0x844bc5[_0xafcd('0x26')]['message']);return _0x229a39(_0x844bc5['error'][_0xafcd('0x28')]);}else{logger[_0xafcd('0x20')](_0xafcd('0x21'),_0x418bdf,'request\x20sent');_0x229a39(_0x844bc5[_0xafcd('0x29')][_0xafcd('0x28')]);}})['catch'](function(_0x4006f2){logger[_0xafcd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x418bdf,_0x4006f2);_0x3bf257(_0x4006f2);});});}function respondWithStatusCode(_0x41f750,_0x12f996){_0x12f996=_0x12f996||0xcc;return function(_0x18e066){if(_0x18e066){return _0x41f750[_0xafcd('0x2a')](_0x12f996);}return _0x41f750[_0xafcd('0x2b')](_0x12f996)[_0xafcd('0x2c')]();};}function respondWithResult(_0x4bbe4b,_0x3379f9){_0x3379f9=_0x3379f9||0xc8;return function(_0x3a48b6){if(_0x3a48b6){return _0x4bbe4b[_0xafcd('0x2b')](_0x3379f9)[_0xafcd('0x2d')](_0x3a48b6);}};}function respondWithFilteredResult(_0x3e086d,_0x4b3f1f){return function(_0x2dec18){if(_0x2dec18){var _0x571829=typeof _0x4b3f1f[_0xafcd('0x2e')]===_0xafcd('0x2f')&&typeof _0x4b3f1f[_0xafcd('0x30')]===_0xafcd('0x2f');var _0x266f0b=_0x2dec18[_0xafcd('0x31')];var _0x523e1e=_0x571829?0x0:_0x4b3f1f[_0xafcd('0x2e')];var _0x48f2f0=_0x571829?_0x2dec18['count']:_0x4b3f1f[_0xafcd('0x2e')]+_0x4b3f1f[_0xafcd('0x30')];var _0x1cb974;if(_0x48f2f0>=_0x266f0b){_0x48f2f0=_0x266f0b;_0x1cb974=0xc8;}else{_0x1cb974=0xce;}_0x3e086d[_0xafcd('0x2b')](_0x1cb974);return _0x3e086d['set'](_0xafcd('0x32'),_0x523e1e+'-'+_0x48f2f0+'/'+_0x266f0b)[_0xafcd('0x2d')](_0x2dec18);}return null;};}function patchUpdates(_0xa90f3){return function(_0x5dceed){try{jsonpatch[_0xafcd('0x33')](_0x5dceed,_0xa90f3,!![]);}catch(_0x5c77a2){return BPromise['reject'](_0x5c77a2);}return _0x5dceed[_0xafcd('0x34')]();};}function saveUpdates(_0x3514af,_0x2ad46d){return function(_0x500b7f){if(_0x500b7f){return _0x500b7f[_0xafcd('0x35')](_0x3514af)['then'](function(_0x53d4cd){return _0x53d4cd;});}return null;};}function removeEntity(_0x451e35,_0x14e011){return function(_0x5d1074){if(_0x5d1074){return _0x5d1074[_0xafcd('0x36')]()['then'](function(){_0x451e35[_0xafcd('0x2b')](0xcc)[_0xafcd('0x2c')]();});}};}function handleEntityNotFound(_0x41a2eb,_0x4ccbdd){return function(_0x10a3d3){if(!_0x10a3d3){_0x41a2eb[_0xafcd('0x2a')](0x194);}return _0x10a3d3;};}function handleError(_0x17fbe1,_0x2d18e1){_0x2d18e1=_0x2d18e1||0x1f4;return function(_0x1fd603){logger['error'](_0x1fd603[_0xafcd('0x37')]);if(_0x1fd603[_0xafcd('0x38')]){delete _0x1fd603[_0xafcd('0x38')];}_0x17fbe1[_0xafcd('0x2b')](_0x2d18e1)[_0xafcd('0x39')](_0x1fd603);};}exports[_0xafcd('0x3a')]=function(_0x25d96a,_0x52fb60){var _0x2e306e={},_0x36a7c2={},_0xe6eb92={'count':0x0,'rows':[]};var _0x51513e=_[_0xafcd('0x3b')](db['ChatMessage'][_0xafcd('0x3c')],function(_0x3bedbc){return{'name':_0x3bedbc[_0xafcd('0x3d')],'type':_0x3bedbc[_0xafcd('0x3e')][_0xafcd('0x3f')]};});_0x36a7c2['model']=_[_0xafcd('0x3b')](_0x51513e,_0xafcd('0x38'));_0x36a7c2[_0xafcd('0x40')]=_[_0xafcd('0x41')](_0x25d96a[_0xafcd('0x40')]);_0x36a7c2[_0xafcd('0x42')]=_[_0xafcd('0x43')](_0x36a7c2[_0xafcd('0x44')],_0x36a7c2[_0xafcd('0x40')]);_0x2e306e[_0xafcd('0x45')]=_['intersection'](_0x36a7c2['model'],qs['fields'](_0x25d96a[_0xafcd('0x40')][_0xafcd('0x46')]));_0x2e306e['attributes']=_0x2e306e['attributes'][_0xafcd('0x47')]?_0x2e306e[_0xafcd('0x45')]:_0x36a7c2[_0xafcd('0x44')];if(!_0x25d96a[_0xafcd('0x40')]['hasOwnProperty'](_0xafcd('0x48'))){_0x2e306e[_0xafcd('0x30')]=qs[_0xafcd('0x30')](_0x25d96a['query'][_0xafcd('0x30')]);_0x2e306e['offset']=qs[_0xafcd('0x2e')](_0x25d96a[_0xafcd('0x40')][_0xafcd('0x2e')]);}_0x2e306e[_0xafcd('0x49')]=qs[_0xafcd('0x4a')](_0x25d96a[_0xafcd('0x40')][_0xafcd('0x4a')]);_0x2e306e[_0xafcd('0x4b')]=qs[_0xafcd('0x42')](_[_0xafcd('0x4c')](_0x25d96a['query'],_0x36a7c2[_0xafcd('0x42')]),_0x51513e);if(_0x25d96a[_0xafcd('0x40')][_0xafcd('0x4d')]){_0x2e306e['where']=_['merge'](_0x2e306e[_0xafcd('0x4b')],{'$or':_[_0xafcd('0x3b')](_0x51513e,function(_0x207bec){if(_0x207bec[_0xafcd('0x3e')]!=='VIRTUAL'){var _0x9524b3={};_0x9524b3[_0x207bec[_0xafcd('0x38')]]={'$like':'%'+_0x25d96a[_0xafcd('0x40')][_0xafcd('0x4d')]+'%'};return _0x9524b3;}})});}_0x2e306e=_[_0xafcd('0x4e')]({},_0x2e306e,_0x25d96a[_0xafcd('0x4f')]);var _0x5476={'where':_0x2e306e['where']};return db[_0xafcd('0x50')][_0xafcd('0x31')](_0x5476)[_0xafcd('0x1f')](function(_0x5effce){_0xe6eb92[_0xafcd('0x31')]=_0x5effce;if(_0x25d96a[_0xafcd('0x40')][_0xafcd('0x51')]){_0x2e306e[_0xafcd('0x52')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2e306e);})[_0xafcd('0x1f')](function(_0x28dc2b){_0xe6eb92[_0xafcd('0x53')]=_0x28dc2b;return _0xe6eb92;})['then'](respondWithFilteredResult(_0x52fb60,_0x2e306e))[_0xafcd('0x54')](handleError(_0x52fb60,null));};exports[_0xafcd('0x55')]=function(_0x277ca7,_0x578b72){var _0x5ec543={'raw':!![],'where':{'id':_0x277ca7[_0xafcd('0x56')]['id']}},_0x4ef44e={};_0x4ef44e['model']=_[_0xafcd('0x41')](db['ChatMessage'][_0xafcd('0x3c')]);_0x4ef44e['query']=_[_0xafcd('0x41')](_0x277ca7[_0xafcd('0x40')]);_0x4ef44e['filters']=_[_0xafcd('0x43')](_0x4ef44e[_0xafcd('0x44')],_0x4ef44e[_0xafcd('0x40')]);_0x5ec543['attributes']=_[_0xafcd('0x43')](_0x4ef44e[_0xafcd('0x44')],qs[_0xafcd('0x46')](_0x277ca7[_0xafcd('0x40')][_0xafcd('0x46')]));_0x5ec543[_0xafcd('0x45')]=_0x5ec543[_0xafcd('0x45')][_0xafcd('0x47')]?_0x5ec543[_0xafcd('0x45')]:_0x4ef44e[_0xafcd('0x44')];if(_0x277ca7[_0xafcd('0x40')][_0xafcd('0x51')]){_0x5ec543[_0xafcd('0x52')]=[{'all':!![]}];}_0x5ec543=_['merge']({},_0x5ec543,_0x277ca7[_0xafcd('0x4f')]);return db[_0xafcd('0x50')][_0xafcd('0x57')](_0x5ec543)[_0xafcd('0x1f')](handleEntityNotFound(_0x578b72,null))['then'](respondWithResult(_0x578b72,null))['catch'](handleError(_0x578b72,null));};exports[_0xafcd('0x58')]=function(_0x46dc4b,_0x429e30){return db[_0xafcd('0x50')][_0xafcd('0x58')](_0x46dc4b[_0xafcd('0x59')],{})[_0xafcd('0x1f')](respondWithResult(_0x429e30,0xc9))[_0xafcd('0x54')](handleError(_0x429e30,null));};exports[_0xafcd('0x35')]=function(_0x6b4ac6,_0x23eba9){if(_0x6b4ac6['body']['id']){delete _0x6b4ac6[_0xafcd('0x59')]['id'];}return db[_0xafcd('0x50')][_0xafcd('0x57')]({'where':{'id':_0x6b4ac6[_0xafcd('0x56')]['id']}})[_0xafcd('0x1f')](handleEntityNotFound(_0x23eba9,null))[_0xafcd('0x1f')](saveUpdates(_0x6b4ac6['body'],null))[_0xafcd('0x1f')](respondWithResult(_0x23eba9,null))['catch'](handleError(_0x23eba9,null));};exports[_0xafcd('0x36')]=function(_0x27fcd6,_0x1db0b0){return db['ChatMessage']['find']({'where':{'id':_0x27fcd6[_0xafcd('0x56')]['id']}})[_0xafcd('0x1f')](handleEntityNotFound(_0x1db0b0,null))[_0xafcd('0x1f')](removeEntity(_0x1db0b0,null))[_0xafcd('0x54')](handleError(_0x1db0b0,null));};exports[_0xafcd('0x5a')]=function(_0x144986,_0x2342b5){return db[_0xafcd('0x50')]['describe']()[_0xafcd('0x1f')](respondWithResult(_0x2342b5,null))['catch'](handleError(_0x2342b5,null));};var interaction_log=require(_0xafcd('0x11'))(_0xafcd('0x5b'));exports[_0xafcd('0x5c')]=function(_0x2ab998,_0x16e114,_0x4f9334){var _0x1ac280={'agent':{},'channel':_0xafcd('0x5d')};if(_0x2ab998['body']['id']){delete _0x2ab998[_0xafcd('0x59')]['id'];}_0x2ab998[_0xafcd('0x59')][_0xafcd('0x5e')]=!![];_0x2ab998[_0xafcd('0x59')][_0xafcd('0x5f')]=moment()[_0xafcd('0x60')](_0xafcd('0x61'));_0x2ab998[_0xafcd('0x59')][_0xafcd('0x62')]=_0x2ab998[_0xafcd('0x59')][_0xafcd('0x62')]||_0x2ab998[_0xafcd('0x63')]['id'];_0x1ac280[_0xafcd('0x64')]['id']=_0x2ab998[_0xafcd('0x59')][_0xafcd('0x62')];return db['ChatMessage']['find']({'where':{'id':_0x2ab998['params']['id'],'UserId':null}})[_0xafcd('0x1f')](handleEntityNotFound(_0x16e114,null))[_0xafcd('0x1f')](saveUpdates(_0x2ab998[_0xafcd('0x59')],null))['then'](function(_0x265625){if(_0x265625){_0x1ac280[_0xafcd('0x28')]=_0x265625['get']({'plain':!![]});return db[_0xafcd('0x65')][_0xafcd('0x57')]({'where':{'id':_0x265625[_0xafcd('0x66')]}});}return null;})[_0xafcd('0x1f')](handleEntityNotFound(_0x16e114,null))[_0xafcd('0x1f')](function(_0x4462b2){if(_0x4462b2){return _0x4462b2[_0xafcd('0x35')]({'UserId':_0x2ab998['body'][_0xafcd('0x62')],'read1stAt':_[_0xafcd('0x67')](_0x4462b2[_0xafcd('0x68')])?moment()[_0xafcd('0x60')](_0xafcd('0x61')):undefined});}return null;})[_0xafcd('0x1f')](function(_0x4c48c8){if(_0x4c48c8){_0x1ac280[_0xafcd('0x69')]=_0x4c48c8[_0xafcd('0x6a')]({'plain':!![]});interaction_log[_0xafcd('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ab998[_0xafcd('0x63')]['id'],_0x2ab998['user'][_0xafcd('0x38')],_0x2ab998[_0xafcd('0x63')][_0xafcd('0x6b')],_0x1ac280[_0xafcd('0x69')]['id'],_0x2ab998[_0xafcd('0x59')]?JSON[_0xafcd('0x25')](_0x2ab998[_0xafcd('0x59')]):_0xafcd('0x6c'));return respondWithRpcPromise(_0xafcd('0x6d'),_0xafcd('0x6e'),_0x1ac280);}return null;})['then'](function(_0x3034e6){var _0x3c0095=_0xafcd('0x6f')+_0x3034e6[_0xafcd('0x28')]['ContactId'];return db[_0xafcd('0x70')][_0xafcd('0x40')](_0x3c0095,{'type':db[_0xafcd('0x71')]['QueryTypes'][_0xafcd('0x72')],'raw':!![]})[_0xafcd('0x1f')](function(_0x1cc5de){return _0x1cc5de;});})[_0xafcd('0x1f')](function(_0x2ac128){if(_0x2ac128){_0x1ac280[_0xafcd('0x28')][_0xafcd('0x73')]=_0x2ac128[0x0];if(!_0x2ab998[_0xafcd('0x59')][_0xafcd('0x62')])return;return db[_0xafcd('0x74')][_0xafcd('0x57')]({'where':{'id':_0x2ab998[_0xafcd('0x59')]['UserId'],'role':_0xafcd('0x64')},'attributes':['id','name',_0xafcd('0x75'),_0xafcd('0x76'),_0xafcd('0x77')],'raw':!![]});}return null;})[_0xafcd('0x1f')](function(_0x5a80d5){if(!_0x5a80d5)return null;_0x1ac280[_0xafcd('0x28')][_0xafcd('0x64')]=_0x5a80d5;return _0x1ac280;})[_0xafcd('0x1f')](function(_0x3885d6){if(_0x3885d6){if(_0x2ab998['body'][_0xafcd('0x78')]){_0x1ac280[_0xafcd('0x28')][_0xafcd('0x79')]=util[_0xafcd('0x60')](_0xafcd('0x7a'),_0x2ab998[_0xafcd('0x63')][_0xafcd('0x38')]);_0x1ac280['message']['channel']=_0x1ac280['channel'];_0x1ac280[_0xafcd('0x28')][_0xafcd('0x7b')]=_0x1ac280[_0xafcd('0x7c')];_0x1ac280['message'][_0xafcd('0x7d')]='accept';return respondWithRpcPromise(_0xafcd('0x7e'),_0xafcd('0x7e'),{'event':_0xafcd('0x7f'),'message':_[_0xafcd('0x4e')](_0x1ac280[_0xafcd('0x28')],JSON['parse'](_0x1ac280['interaction'][_0xafcd('0x80')]))},client9002)[_0xafcd('0x1f')](function(){return _0x1ac280;});}return _0x1ac280;}return null;})[_0xafcd('0x1f')](respondWithResult(_0x16e114,null))[_0xafcd('0x54')](handleError(_0x16e114,null));};var interaction_log=require(_0xafcd('0x11'))('chat-interactions');exports[_0xafcd('0x81')]=function(_0x5a56db,_0xabec94,_0x446705){var _0x3ff11f={'agent':{},'channel':'chat'};if(_0x5a56db[_0xafcd('0x59')]['id']){delete _0x5a56db[_0xafcd('0x59')]['id'];}_0x5a56db['body'][_0xafcd('0x62')]=_0x5a56db[_0xafcd('0x59')][_0xafcd('0x62')]||_0x5a56db[_0xafcd('0x63')]['id'];_0x3ff11f[_0xafcd('0x64')]['id']=_0x5a56db[_0xafcd('0x59')][_0xafcd('0x62')];return db[_0xafcd('0x50')][_0xafcd('0x57')]({'where':{'id':_0x5a56db[_0xafcd('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xabec94,null))[_0xafcd('0x1f')](function(_0x1f9c2a){if(_0x1f9c2a){_0x3ff11f[_0xafcd('0x28')]=_0x1f9c2a['get']({'plain':!![]});return db[_0xafcd('0x65')][_0xafcd('0x57')]({'where':{'id':_0x1f9c2a[_0xafcd('0x66')]}});}return null;})[_0xafcd('0x1f')](handleEntityNotFound(_0xabec94,null))[_0xafcd('0x1f')](function(_0x4a699e){if(_0x4a699e){_0x3ff11f[_0xafcd('0x69')]=_0x4a699e['get']({'plain':!![]});interaction_log['info'](_0xafcd('0x82'),_0x5a56db[_0xafcd('0x63')]['id'],_0x5a56db['user'][_0xafcd('0x38')],_0x5a56db[_0xafcd('0x63')]['role'],_0x3ff11f['interaction']['id'],_0x5a56db[_0xafcd('0x59')]?JSON[_0xafcd('0x25')](_0x5a56db[_0xafcd('0x59')]):_0xafcd('0x6c'));return respondWithRpcPromise(_0xafcd('0x83'),_0xafcd('0x84'),_0x3ff11f);}return null;})[_0xafcd('0x1f')](function(_0x1a5c6b){var _0x19a774=_0xafcd('0x6f')+_0x1a5c6b['message'][_0xafcd('0x85')];return db[_0xafcd('0x70')][_0xafcd('0x40')](_0x19a774,{'type':db['Sequelize'][_0xafcd('0x86')][_0xafcd('0x72')],'raw':!![]})['then'](function(_0xa3918a){return _0xa3918a;});})[_0xafcd('0x1f')](function(_0x3688d8){if(_0x3688d8){_0x3ff11f[_0xafcd('0x28')][_0xafcd('0x73')]=_0x3688d8[0x0];if(!_0x5a56db[_0xafcd('0x59')][_0xafcd('0x62')])return;return db[_0xafcd('0x74')][_0xafcd('0x57')]({'where':{'id':_0x5a56db[_0xafcd('0x59')][_0xafcd('0x62')],'role':_0xafcd('0x64')},'attributes':['id',_0xafcd('0x38'),_0xafcd('0x75'),_0xafcd('0x76'),_0xafcd('0x77')],'raw':!![]});}return null;})[_0xafcd('0x1f')](function(_0x117316){if(!_0x117316)return null;_0x3ff11f['message']['agent']=_0x117316;return _0x3ff11f;})[_0xafcd('0x1f')](function(_0x339fdb){if(_0x339fdb){_0x339fdb[_0xafcd('0x28')][_0xafcd('0x79')]=util['format'](_0xafcd('0x7a'),_0x5a56db['user'][_0xafcd('0x38')]);_0x339fdb['message'][_0xafcd('0x7c')]=_0x3ff11f[_0xafcd('0x7c')];_0x339fdb['message'][_0xafcd('0x7b')]=_0x3ff11f[_0xafcd('0x7c')];_0x339fdb[_0xafcd('0x28')]['event']='reject';respondWithRpcPromise('EventManager',_0xafcd('0x7e'),{'event':'rejectmessage','message':_[_0xafcd('0x4e')](_0x3ff11f[_0xafcd('0x28')],JSON[_0xafcd('0x87')](_0x3ff11f[_0xafcd('0x69')][_0xafcd('0x80')]))},client9002);return _0x3ff11f;}return null;})[_0xafcd('0x1f')](respondWithResult(_0xabec94,null))[_0xafcd('0x54')](handleError(_0xabec94,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index dfc5f02..b7833f7 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 _0x5d6d=['setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x2f2d70,_0x103a77){var _0x510f0b=function(_0x1d76c1){while(--_0x1d76c1){_0x2f2d70['push'](_0x2f2d70['shift']());}};_0x510f0b(++_0x103a77);}(_0x5d6d,0x1ac));var _0xd5d6=function(_0x16a28a,_0xe0102b){_0x16a28a=_0x16a28a-0x0;var _0x3bb6f7=_0x5d6d[_0x16a28a];return _0x3bb6f7;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd5d6('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd5d6('0x1')};function emitEvent(_0xb9ccf6){return function(_0xe0cfb8,_0x4fbec5,_0x24b8ea){ChatMessageEvents[_0xd5d6('0x2')](_0xb9ccf6+':'+_0xe0cfb8['id'],_0xe0cfb8);ChatMessageEvents['emit'](_0xb9ccf6,_0xe0cfb8);_0x24b8ea(null);};}for(var e in events){if(events[_0xd5d6('0x3')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x7f8c=['hasOwnProperty','hook','../../mysqldb','ChatMessage','remove'];(function(_0x445987,_0x19c35f){var _0x5558b8=function(_0x146589){while(--_0x146589){_0x445987['push'](_0x445987['shift']());}};_0x5558b8(++_0x19c35f);}(_0x7f8c,0xca));var _0xc7f8=function(_0x2dc857,_0x1e0780){_0x2dc857=_0x2dc857-0x0;var _0x4fdfc9=_0x7f8c[_0x2dc857];return _0x4fdfc9;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc7f8('0x0'))['db'][_0xc7f8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc7f8('0x2')};function emitEvent(_0x3369e7){return function(_0x103aa7,_0x677304,_0x4d14b4){ChatMessageEvents['emit'](_0x3369e7+':'+_0x103aa7['id'],_0x103aa7);ChatMessageEvents['emit'](_0x3369e7,_0x103aa7);_0x4d14b4(null);};}for(var e in events){if(events[_0xc7f8('0x3')](e)){var event=events[e];ChatMessage[_0xc7f8('0x4')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index cfcc469..de975d9 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 _0x3182=['ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','../../config/environment','exports','define','ChatMessage','fti_chat_messages','body','direction','toLowerCase','out','secret','isNil'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x3182,0x99));var _0x2318=function(_0x434e4d,_0x38ce0d){_0x434e4d=_0x434e4d-0x0;var _0x547a4b=_0x3182[_0x434e4d];return _0x547a4b;};'use strict';var _=require(_0x2318('0x0'));var util=require('util');var logger=require(_0x2318('0x1'))('api');var moment=require(_0x2318('0x2'));var BPromise=require('bluebird');var rp=require(_0x2318('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2318('0x4'));var attributes=require('./chatMessage.attributes');module[_0x2318('0x5')]=function(_0x2125b9,_0xe140e9){return _0x2125b9[_0x2318('0x6')](_0x2318('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x2318('0x8'),'fields':[_0x2318('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x93e2b,_0x5ea8f0,_0x109e25){var _0x24c179=_0x2125b9['models'];var _0x4cc9fa=_0x93e2b['get']({'plain':!![]});if(_0x4cc9fa[_0x2318('0xa')][_0x2318('0xb')]()==='in'||_0x4cc9fa[_0x2318('0xa')][_0x2318('0xb')]()===_0x2318('0xc')&&!_0x4cc9fa[_0x2318('0xd')]&&!_[_0x2318('0xe')](_0x4cc9fa['UserId'])){_0x24c179[_0x2318('0xf')][_0x2318('0x10')]({'where':{'id':_0x4cc9fa[_0x2318('0x11')]}})[_0x2318('0x12')](function(_0x2b40ee){if(_0x2b40ee){_0x2b40ee['update']({'lastMsgAt':_0x4cc9fa[_0x2318('0x13')],'lastMsgDirection':_0x4cc9fa[_0x2318('0xa')][_0x2318('0xb')]()});}})[_0x2318('0x14')](function(_0x45f502){console[_0x2318('0x15')](_0x45f502);});}_0x109e25();}},'charset':_0x2318('0x16'),'collate':_0x2318('0x17')});}; \ No newline at end of file +var _0x6005=['request-promise','rimraf','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','lodash','moment','bluebird'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x6005,0x1c8));var _0x5600=function(_0x563645,_0x533111){_0x563645=_0x563645-0x0;var _0x3eb7d4=_0x6005[_0x563645];return _0x3eb7d4;};'use strict';var _=require(_0x5600('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5600('0x1'));var BPromise=require(_0x5600('0x2'));var rp=require(_0x5600('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5600('0x4'));var config=require('../../config/environment');var attributes=require(_0x5600('0x5'));module[_0x5600('0x6')]=function(_0x2df798,_0x43912f){return _0x2df798[_0x5600('0x7')]('ChatMessage',attributes,{'tableName':_0x5600('0x8'),'paranoid':![],'indexes':[{'name':_0x5600('0x9'),'fields':[_0x5600('0xa')],'type':_0x5600('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e2b1c,_0x3da571,_0x438185){var _0x10a3da=_0x2df798[_0x5600('0xc')];var _0x448e8b=_0x2e2b1c['get']({'plain':!![]});if(_0x448e8b[_0x5600('0xd')][_0x5600('0xe')]()==='in'||_0x448e8b['direction'][_0x5600('0xe')]()===_0x5600('0xf')&&!_0x448e8b[_0x5600('0x10')]&&!_[_0x5600('0x11')](_0x448e8b[_0x5600('0x12')])){_0x10a3da[_0x5600('0x13')][_0x5600('0x14')]({'where':{'id':_0x448e8b['ChatInteractionId']}})[_0x5600('0x15')](function(_0x375974){if(_0x375974){_0x375974[_0x5600('0x16')]({'lastMsgAt':_0x448e8b[_0x5600('0x17')],'lastMsgDirection':_0x448e8b[_0x5600('0xd')][_0x5600('0xe')]()});}})[_0x5600('0x18')](function(_0x98f39e){console[_0x5600('0x19')](_0x98f39e);});}_0x438185();}},'charset':_0x5600('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e4850c2..9b6d50b 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 _0xe75f=['CreateChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x1237b1,_0x19ce6b){var _0x429a0c=function(_0x52144e){while(--_0x52144e){_0x1237b1['push'](_0x1237b1['shift']());}};_0x429a0c(++_0x19ce6b);}(_0xe75f,0x11e));var _0xfe75=function(_0x16ad1f,_0x4c4210){_0x16ad1f=_0x16ad1f-0x0;var _0x43160a=_0xe75f[_0x16ad1f];return _0x43160a;};'use strict';var _=require(_0xfe75('0x0'));var util=require(_0xfe75('0x1'));var moment=require(_0xfe75('0x2'));var BPromise=require(_0xfe75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe75('0x4'));var db=require(_0xfe75('0x5'))['db'];var utils=require(_0xfe75('0x6'));var logger=require(_0xfe75('0x7'))(_0xfe75('0x8'));var config=require(_0xfe75('0x9'));var jayson=require(_0xfe75('0xa'));var client=jayson[_0xfe75('0xb')][_0xfe75('0xc')]({'port':0x232a});config[_0xfe75('0xd')]=_[_0xfe75('0xe')](config[_0xfe75('0xd')],{'host':_0xfe75('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe75('0x10'))[_0xfe75('0x11')](socket);function respondWithRpcPromise(_0x448c8f,_0x3c8938,_0x267482){return new BPromise(function(_0xac9d25,_0x141445){return client[_0xfe75('0x12')](_0x448c8f,_0x267482)[_0xfe75('0x13')](function(_0x70e1b){logger[_0xfe75('0x14')](_0xfe75('0x15'),_0x3c8938,'request\x20sent');logger[_0xfe75('0x16')](_0xfe75('0x17'),_0x3c8938,_0xfe75('0x18'),JSON['stringify'](_0x70e1b));if(_0x70e1b[_0xfe75('0x19')]){if(_0x70e1b[_0xfe75('0x19')]['code']===0x1f4){logger[_0xfe75('0x19')](_0xfe75('0x15'),_0x3c8938,_0x70e1b[_0xfe75('0x19')][_0xfe75('0x1a')]);return _0x141445(_0x70e1b[_0xfe75('0x19')]['message']);}logger[_0xfe75('0x19')]('ChatMessage,\x20%s,\x20%s',_0x3c8938,_0x70e1b[_0xfe75('0x19')][_0xfe75('0x1a')]);return _0xac9d25(_0x70e1b[_0xfe75('0x19')][_0xfe75('0x1a')]);}else{logger['info'](_0xfe75('0x15'),_0x3c8938,_0xfe75('0x18'));_0xac9d25(_0x70e1b[_0xfe75('0x1b')][_0xfe75('0x1a')]);}})[_0xfe75('0x1c')](function(_0x3d7990){logger[_0xfe75('0x19')](_0xfe75('0x15'),_0x3c8938,_0x3d7990);_0x141445(_0x3d7990);});});}exports[_0xfe75('0x1d')]=function(_0x102299){var _0x4df055=this;return new Promise(function(_0x4fe95b,_0x25a696){return db['ChatMessage'][_0xfe75('0x1e')](_0x102299[_0xfe75('0x1f')],{'raw':_0x102299[_0xfe75('0x20')]?_0x102299[_0xfe75('0x20')][_0xfe75('0x21')]===undefined?!![]:![]:!![]})[_0xfe75('0x13')](function(_0x733886){logger[_0xfe75('0x14')](_0xfe75('0x1d'),_0x102299);logger[_0xfe75('0x16')](_0xfe75('0x1d'),_0x102299,JSON[_0xfe75('0x22')](_0x733886));_0x4fe95b(_0x733886);})['catch'](function(_0x4ed129){logger[_0xfe75('0x19')](_0xfe75('0x1d'),_0x4ed129[_0xfe75('0x1a')],_0x102299);_0x25a696(_0x4df055[_0xfe75('0x19')](0x1f4,_0x4ed129[_0xfe75('0x1a')]));});});}; \ No newline at end of file +var _0x2ab3=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5f2231,_0x1f81b4){var _0x59c0b1=function(_0x32018d){while(--_0x32018d){_0x5f2231['push'](_0x5f2231['shift']());}};_0x59c0b1(++_0x1f81b4);}(_0x2ab3,0x14d));var _0x32ab=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x2ab3[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x32ab('0x0'));var util=require(_0x32ab('0x1'));var moment=require(_0x32ab('0x2'));var BPromise=require(_0x32ab('0x3'));var rs=require(_0x32ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32ab('0x5'))['db'];var utils=require(_0x32ab('0x6'));var logger=require(_0x32ab('0x7'))(_0x32ab('0x8'));var config=require('../../config/environment');var jayson=require(_0x32ab('0x9'));var client=jayson[_0x32ab('0xa')][_0x32ab('0xb')]({'port':0x232a});config[_0x32ab('0xc')]=_[_0x32ab('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x32ab('0xe'))(new Redis(config[_0x32ab('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x178de0,_0x6142e4,_0x33ff22){return new BPromise(function(_0x505071,_0x2c7403){return client[_0x32ab('0xf')](_0x178de0,_0x33ff22)[_0x32ab('0x10')](function(_0x5acb21){logger['info'](_0x32ab('0x11'),_0x6142e4,_0x32ab('0x12'));logger[_0x32ab('0x13')](_0x32ab('0x14'),_0x6142e4,_0x32ab('0x12'),JSON[_0x32ab('0x15')](_0x5acb21));if(_0x5acb21[_0x32ab('0x16')]){if(_0x5acb21[_0x32ab('0x16')][_0x32ab('0x17')]===0x1f4){logger[_0x32ab('0x16')]('ChatMessage,\x20%s,\x20%s',_0x6142e4,_0x5acb21[_0x32ab('0x16')][_0x32ab('0x18')]);return _0x2c7403(_0x5acb21[_0x32ab('0x16')][_0x32ab('0x18')]);}logger[_0x32ab('0x16')](_0x32ab('0x11'),_0x6142e4,_0x5acb21[_0x32ab('0x16')]['message']);return _0x505071(_0x5acb21[_0x32ab('0x16')]['message']);}else{logger[_0x32ab('0x19')](_0x32ab('0x11'),_0x6142e4,_0x32ab('0x12'));_0x505071(_0x5acb21[_0x32ab('0x1a')][_0x32ab('0x18')]);}})[_0x32ab('0x1b')](function(_0x9e904d){logger[_0x32ab('0x16')](_0x32ab('0x11'),_0x6142e4,_0x9e904d);_0x2c7403(_0x9e904d);});});}exports['CreateChatMessage']=function(_0x376534){var _0x28fe4d=this;return new Promise(function(_0x6d081f,_0x5c4759){return db[_0x32ab('0x1c')][_0x32ab('0x1d')](_0x376534[_0x32ab('0x1e')],{'raw':_0x376534[_0x32ab('0x1f')]?_0x376534['options'][_0x32ab('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x277603){logger[_0x32ab('0x19')]('CreateChatMessage',_0x376534);logger[_0x32ab('0x13')](_0x32ab('0x21'),_0x376534,JSON[_0x32ab('0x15')](_0x277603));_0x6d081f(_0x277603);})['catch'](function(_0x3d5386){logger['error']('CreateChatMessage',_0x3d5386[_0x32ab('0x18')],_0x376534);_0x5c4759(_0x28fe4d[_0x32ab('0x16')](0x1f4,_0x3d5386[_0x32ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 069d21f..a82c567 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 _0x277c=['remove','update','emit','./chatMessage.events'];(function(_0xcff491,_0x146dec){var _0x2a5101=function(_0x3282ee){while(--_0x3282ee){_0xcff491['push'](_0xcff491['shift']());}};_0x2a5101(++_0x146dec);}(_0x277c,0x153));var _0xc277=function(_0x5cc833,_0x4033bf){_0x5cc833=_0x5cc833-0x0;var _0xb4a83b=_0x277c[_0x5cc833];return _0xb4a83b;};'use strict';var ChatMessageEvents=require(_0xc277('0x0'));var events=['save',_0xc277('0x1'),_0xc277('0x2')];function createListener(_0x3cd265,_0x21d6f2){return function(_0x394371){_0x21d6f2[_0xc277('0x3')](_0x3cd265,_0x394371);};}function removeListener(_0x72f952,_0x29f81d){return function(){ChatMessageEvents['removeListener'](_0x72f952,_0x29f81d);};}exports['register']=function(_0x1a6582){for(var _0x5a4f03=0x0,_0x77e168=events['length'];_0x5a4f03<_0x77e168;_0x5a4f03++){var _0x378158=events[_0x5a4f03];var _0x17a2fe=createListener('chatMessage:'+_0x378158,_0x1a6582);ChatMessageEvents['on'](_0x378158,_0x17a2fe);}}; \ No newline at end of file +var _0x1501=['save','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x2dd976,_0x1b5dc4){var _0x2265fd=function(_0x270d24){while(--_0x270d24){_0x2dd976['push'](_0x2dd976['shift']());}};_0x2265fd(++_0x1b5dc4);}(_0x1501,0x126));var _0x1150=function(_0xf23730,_0x2c89d1){_0xf23730=_0xf23730-0x0;var _0x478303=_0x1501[_0xf23730];return _0x478303;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x1150('0x0'),_0x1150('0x1'),_0x1150('0x2')];function createListener(_0x4c704f,_0x14d425){return function(_0x323ec2){_0x14d425[_0x1150('0x3')](_0x4c704f,_0x323ec2);};}function removeListener(_0x28eb65,_0x4d218f){return function(){ChatMessageEvents[_0x1150('0x4')](_0x28eb65,_0x4d218f);};}exports['register']=function(_0x63c724){for(var _0x316a7d=0x0,_0x2fc391=events[_0x1150('0x5')];_0x316a7d<_0x2fc391;_0x316a7d++){var _0x24340c=events[_0x316a7d];var _0x321d80=createListener(_0x1150('0x6')+_0x24340c,_0x63c724);ChatMessageEvents['on'](_0x24340c,_0x321d80);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 7985adf..c440c31 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 _0x159e=['./chatMessage.controller','get','/describe','isAuthenticated','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/reject','reject','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17cca1,_0x4cd1f6){var _0x2a1d4a=function(_0x33c8a1){while(--_0x33c8a1){_0x17cca1['push'](_0x17cca1['shift']());}};_0x2a1d4a(++_0x4cd1f6);}(_0x159e,0xd7));var _0xe159=function(_0x39e9fd,_0x2cb37c){_0x39e9fd=_0x39e9fd-0x0;var _0x55a1ef=_0x159e[_0x39e9fd];return _0x55a1ef;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe159('0x0')]();var fs_extra=require(_0xe159('0x1'));var auth=require(_0xe159('0x2'));var interaction=require(_0xe159('0x3'));var config=require(_0xe159('0x4'));var controller=require(_0xe159('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe159('0x6')](_0xe159('0x7'),auth[_0xe159('0x8')](),controller['describe']);router['get'](_0xe159('0x9'),auth[_0xe159('0x8')](),controller[_0xe159('0xa')]);router[_0xe159('0xb')]('/',auth[_0xe159('0x8')](),interaction[_0xe159('0xc')](_0xe159('0xd'),_0xe159('0xe')),controller[_0xe159('0xf')]);router[_0xe159('0x10')](_0xe159('0x9'),controller['update']);router[_0xe159('0x10')]('/:id/accept',auth[_0xe159('0x8')](),controller['accept']);router['put'](_0xe159('0x11'),auth[_0xe159('0x8')](),controller[_0xe159('0x12')]);router[_0xe159('0x13')](_0xe159('0x9'),auth['isAuthenticated'](),controller[_0xe159('0x14')]);module[_0xe159('0x15')]=router; \ No newline at end of file +var _0x89f8=['../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3cb9e2,_0x1ae742){var _0x1b9920=function(_0x2a754b){while(--_0x2a754b){_0x3cb9e2['push'](_0x3cb9e2['shift']());}};_0x1b9920(++_0x1ae742);}(_0x89f8,0x1b3));var _0x889f=function(_0x53166a,_0x43b2d3){_0x53166a=_0x53166a-0x0;var _0x2676c5=_0x89f8[_0x53166a];return _0x2676c5;};'use strict';var multer=require(_0x889f('0x0'));var util=require(_0x889f('0x1'));var path=require(_0x889f('0x2'));var timeout=require('connect-timeout');var express=require(_0x889f('0x3'));var router=express['Router']();var fs_extra=require(_0x889f('0x4'));var auth=require(_0x889f('0x5'));var interaction=require(_0x889f('0x6'));var config=require(_0x889f('0x7'));var controller=require(_0x889f('0x8'));router['get']('/',auth[_0x889f('0x9')](),controller[_0x889f('0xa')]);router[_0x889f('0xb')](_0x889f('0xc'),auth[_0x889f('0x9')](),controller[_0x889f('0xd')]);router[_0x889f('0xb')](_0x889f('0xe'),auth[_0x889f('0x9')](),controller['show']);router[_0x889f('0xf')]('/',auth[_0x889f('0x9')](),interaction[_0x889f('0x10')](_0x889f('0x11'),_0x889f('0x12')),controller['create']);router[_0x889f('0x13')]('/:id',controller[_0x889f('0x14')]);router[_0x889f('0x13')](_0x889f('0x15'),auth[_0x889f('0x9')](),controller[_0x889f('0x16')]);router[_0x889f('0x13')](_0x889f('0x17'),auth[_0x889f('0x9')](),controller['reject']);router['delete'](_0x889f('0xe'),auth[_0x889f('0x9')](),controller[_0x889f('0x18')]);module[_0x889f('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a1faaeb..0b96e89 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x0b0e[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x36c12a,_0x4b4012){var _0x57b390=function(_0x1a0e94){while(--_0x1a0e94){_0x36c12a['push'](_0x36c12a['shift']());}};_0x57b390(++_0x4b4012);}(_0xdb28,0x106));var _0x8db2=function(_0x57e7c0,_0x1a8cb5){_0x57e7c0=_0x57e7c0-0x0;var _0x2a71ff=_0xdb28[_0x57e7c0];return _0x2a71ff;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index fd9779a..308d61c 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(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x7a54,0x106));var _0x47a5=function(_0x360739,_0x3cb57e){_0x360739=_0x360739-0x0;var _0x744ea2=_0x7a54[_0x360739];return _0x744ea2;};'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(_0x303a3e,_0x39e9fd){var _0x3b0d59=function(_0x5170c7){while(--_0x5170c7){_0x303a3e['push'](_0x303a3e['shift']());}};_0x3b0d59(++_0x39e9fd);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 2723828..3fc3c9a 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 _0x6d20=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','ChatOfflineMessage'];(function(_0x1d2766,_0x1ba16b){var _0x3779a8=function(_0x4e71f){while(--_0x4e71f){_0x1d2766['push'](_0x1d2766['shift']());}};_0x3779a8(++_0x1ba16b);}(_0x6d20,0xf7));var _0x06d2=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0x6d20[_0x3fbb91];return _0x3eb213;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x06d2('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x06d2('0x1')](0x0);var events={'afterCreate':_0x06d2('0x2'),'afterUpdate':_0x06d2('0x3'),'afterDestroy':_0x06d2('0x4')};function emitEvent(_0x5e921b){return function(_0x5515c7,_0x591c1e,_0x1a0853){ChatOfflineMessageEvents[_0x06d2('0x5')](_0x5e921b+':'+_0x5515c7['id'],_0x5515c7);ChatOfflineMessageEvents['emit'](_0x5e921b,_0x5515c7);_0x1a0853(null);};}for(var e in events){if(events[_0x06d2('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x06d2('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe60c=['emit','hook','events','../../mysqldb','ChatOfflineMessage','update','remove'];(function(_0x3719f2,_0x39b3f0){var _0x330480=function(_0xc0de24){while(--_0xc0de24){_0x3719f2['push'](_0x3719f2['shift']());}};_0x330480(++_0x39b3f0);}(_0xe60c,0x17c));var _0xce60=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xe60c[_0x3d5f84];return _0x1981b8;};'use strict';var EventEmitter=require(_0xce60('0x0'));var ChatOfflineMessage=require(_0xce60('0x1'))['db'][_0xce60('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xce60('0x3'),'afterDestroy':_0xce60('0x4')};function emitEvent(_0x3f83e6){return function(_0x30437f,_0x28b3b5,_0x2306da){ChatOfflineMessageEvents[_0xce60('0x5')](_0x3f83e6+':'+_0x30437f['id'],_0x30437f);ChatOfflineMessageEvents[_0xce60('0x5')](_0x3f83e6,_0x30437f);_0x2306da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xce60('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 ee22026..6ab6611 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 _0x7e7a=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x7e7a,0xc4));var _0xa7e7=function(_0x4a14fb,_0x1fd534){_0x4a14fb=_0x4a14fb-0x0;var _0x10d597=_0x7e7a[_0x4a14fb];return _0x10d597;};'use strict';var attributes=require(_0xa7e7('0x0'));module[_0xa7e7('0x1')]=function(_0x2e3068){return _0x2e3068[_0xa7e7('0x2')](_0xa7e7('0x3'),attributes,{'tableName':_0xa7e7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa7e7('0x5')});}; \ No newline at end of file +var _0xd076=['./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1194d5,_0x404287){var _0x71d946=function(_0x46409d){while(--_0x46409d){_0x1194d5['push'](_0x1194d5['shift']());}};_0x71d946(++_0x404287);}(_0xd076,0x1a9));var _0x6d07=function(_0x414497,_0x211fae){_0x414497=_0x414497-0x0;var _0x2a4eaf=_0xd076[_0x414497];return _0x2a4eaf;};'use strict';var attributes=require(_0x6d07('0x0'));module['exports']=function(_0x57518b){return _0x57518b[_0x6d07('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x6d07('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d07('0x3'),'collate':_0x6d07('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index cd0975d..1fecb02 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 _0xf8ba=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','ioredis'];(function(_0x20ad45,_0x80fba0){var _0x46196e=function(_0x5dc244){while(--_0x5dc244){_0x20ad45['push'](_0x20ad45['shift']());}};_0x46196e(++_0x80fba0);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x3580bc,_0x755679){_0x3580bc=_0x3580bc-0x0;var _0x4d4a0b=_0xf8ba[_0x3580bc];return _0x4d4a0b;};'use strict';var _=require('lodash');var util=require(_0xaf8b('0x0'));var moment=require(_0xaf8b('0x1'));var BPromise=require(_0xaf8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf8b('0x4'));var logger=require(_0xaf8b('0x5'))(_0xaf8b('0x6'));var config=require(_0xaf8b('0x7'));var jayson=require(_0xaf8b('0x8'));var client=jayson['client'][_0xaf8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37cbc2,_0x462985,_0x3d5d7e){return new BPromise(function(_0x59b9f4,_0x1c1d18){return client[_0xaf8b('0xa')](_0x37cbc2,_0x3d5d7e)['then'](function(_0x34d0d6){logger[_0xaf8b('0xb')](_0xaf8b('0xc'),_0x462985,_0xaf8b('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x462985,_0xaf8b('0xd'),JSON['stringify'](_0x34d0d6));if(_0x34d0d6[_0xaf8b('0xe')]){if(_0x34d0d6[_0xaf8b('0xe')][_0xaf8b('0xf')]===0x1f4){logger[_0xaf8b('0xe')](_0xaf8b('0xc'),_0x462985,_0x34d0d6[_0xaf8b('0xe')][_0xaf8b('0x10')]);return _0x1c1d18(_0x34d0d6[_0xaf8b('0xe')][_0xaf8b('0x10')]);}logger[_0xaf8b('0xe')](_0xaf8b('0xc'),_0x462985,_0x34d0d6[_0xaf8b('0xe')][_0xaf8b('0x10')]);return _0x59b9f4(_0x34d0d6['error'][_0xaf8b('0x10')]);}else{logger[_0xaf8b('0xb')](_0xaf8b('0xc'),_0x462985,_0xaf8b('0xd'));_0x59b9f4(_0x34d0d6['result'][_0xaf8b('0x10')]);}})['catch'](function(_0x51b129){logger[_0xaf8b('0xe')](_0xaf8b('0xc'),_0x462985,_0x51b129);_0x1c1d18(_0x51b129);});});} \ No newline at end of file +var _0xf864=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4ffc9d,_0x583515){var _0x4c5a75=function(_0x54a83f){while(--_0x54a83f){_0x4ffc9d['push'](_0x4ffc9d['shift']());}};_0x4c5a75(++_0x583515);}(_0xf864,0x11f));var _0x4f86=function(_0x235590,_0x34db12){_0x235590=_0x235590-0x0;var _0x4bff61=_0xf864[_0x235590];return _0x4bff61;};'use strict';var _=require(_0x4f86('0x0'));var util=require('util');var moment=require(_0x4f86('0x1'));var BPromise=require(_0x4f86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f86('0x3'));var logger=require(_0x4f86('0x4'))(_0x4f86('0x5'));var config=require(_0x4f86('0x6'));var jayson=require(_0x4f86('0x7'));var client=jayson[_0x4f86('0x8')][_0x4f86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x300a68,_0x3e0f61,_0x5838c0){return new BPromise(function(_0x1c82c3,_0x48fb65){return client[_0x4f86('0xa')](_0x300a68,_0x5838c0)[_0x4f86('0xb')](function(_0x3f3380){logger[_0x4f86('0xc')](_0x4f86('0xd'),_0x3e0f61,_0x4f86('0xe'));logger[_0x4f86('0xf')](_0x4f86('0x10'),_0x3e0f61,_0x4f86('0xe'),JSON['stringify'](_0x3f3380));if(_0x3f3380[_0x4f86('0x11')]){if(_0x3f3380['error']['code']===0x1f4){logger[_0x4f86('0x11')](_0x4f86('0xd'),_0x3e0f61,_0x3f3380[_0x4f86('0x11')][_0x4f86('0x12')]);return _0x48fb65(_0x3f3380[_0x4f86('0x11')]['message']);}logger[_0x4f86('0x11')](_0x4f86('0xd'),_0x3e0f61,_0x3f3380['error'][_0x4f86('0x12')]);return _0x1c82c3(_0x3f3380[_0x4f86('0x11')][_0x4f86('0x12')]);}else{logger[_0x4f86('0xc')](_0x4f86('0xd'),_0x3e0f61,_0x4f86('0xe'));_0x1c82c3(_0x3f3380['result']['message']);}})[_0x4f86('0x13')](function(_0x3b0cf9){logger[_0x4f86('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e0f61,_0x3b0cf9);_0x48fb65(_0x3b0cf9);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4cfc7fc..b22554d 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 _0xb8db=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb8db,0x188));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbb8d('0x0'));var util=require(_0xbb8d('0x1'));var path=require(_0xbb8d('0x2'));var timeout=require(_0xbb8d('0x3'));var express=require(_0xbb8d('0x4'));var router=express[_0xbb8d('0x5')]();var fs_extra=require(_0xbb8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbb8d('0x7'));var config=require(_0xbb8d('0x8'));var controller=require(_0xbb8d('0x9'));router[_0xbb8d('0xa')]('/',auth[_0xbb8d('0xb')](),controller[_0xbb8d('0xc')]);router[_0xbb8d('0xa')](_0xbb8d('0xd'),auth[_0xbb8d('0xb')](),controller['describe']);router[_0xbb8d('0xa')](_0xbb8d('0xe'),auth['isAuthenticated'](),controller[_0xbb8d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb8d('0x10')]);router[_0xbb8d('0x11')](_0xbb8d('0xe'),auth[_0xbb8d('0xb')](),controller['update']);router[_0xbb8d('0x12')](_0xbb8d('0xe'),auth[_0xbb8d('0xb')](),controller[_0xbb8d('0x13')]);module[_0xbb8d('0x14')]=router; \ No newline at end of file +var _0x121d=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x4fb001,_0x3f9e2e){var _0x207eda=function(_0x2d5b05){while(--_0x2d5b05){_0x4fb001['push'](_0x4fb001['shift']());}};_0x207eda(++_0x3f9e2e);}(_0x121d,0x113));var _0xd121=function(_0x2c98bf,_0x27f4c9){_0x2c98bf=_0x2c98bf-0x0;var _0x42e74c=_0x121d[_0x2c98bf];return _0x42e74c;};'use strict';var multer=require(_0xd121('0x0'));var util=require(_0xd121('0x1'));var path=require('path');var timeout=require(_0xd121('0x2'));var express=require('express');var router=express[_0xd121('0x3')]();var fs_extra=require(_0xd121('0x4'));var auth=require(_0xd121('0x5'));var interaction=require(_0xd121('0x6'));var config=require(_0xd121('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd121('0x8')]);router[_0xd121('0x9')]('/describe',auth[_0xd121('0xa')](),controller[_0xd121('0xb')]);router[_0xd121('0x9')](_0xd121('0xc'),auth[_0xd121('0xa')](),controller[_0xd121('0xd')]);router[_0xd121('0xe')]('/',auth[_0xd121('0xa')](),controller[_0xd121('0xf')]);router[_0xd121('0x10')](_0xd121('0xc'),auth[_0xd121('0xa')](),controller[_0xd121('0x11')]);router[_0xd121('0x12')](_0xd121('0xc'),auth[_0xd121('0xa')](),controller[_0xd121('0x13')]);module[_0xd121('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 c8f05ef..9d29ff8 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 _0x653f=['INTEGER','exports','timeout','STRING'];(function(_0x1c1683,_0x1e0d74){var _0xc2c5d2=function(_0x8443c7){while(--_0x8443c7){_0x1c1683['push'](_0x1c1683['shift']());}};_0xc2c5d2(++_0x1e0d74);}(_0x653f,0x1a1));var _0xf653=function(_0x5c59bc,_0x1a86bb){_0x5c59bc=_0x5c59bc-0x0;var _0x5703d6=_0x653f[_0x5c59bc];return _0x5703d6;};'use strict';var Sequelize=require('sequelize');module[_0xf653('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xf653('0x1')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf653('0x2')]},'timeout':{'type':Sequelize[_0xf653('0x3')]}}; \ No newline at end of file +var _0x22b4=['STRING','INTEGER','sequelize','exports','mouseOver'];(function(_0x1b28e,_0x3837e5){var _0x48856f=function(_0x5d795c){while(--_0x5d795c){_0x1b28e['push'](_0x1b28e['shift']());}};_0x48856f(++_0x3837e5);}(_0x22b4,0x1d8));var _0x422b=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x22b4[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require(_0x422b('0x0'));module[_0x422b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x422b('0x2'),'timeout'),'defaultValue':_0x422b('0x2')},'selector':{'type':Sequelize[_0x422b('0x3')]},'timeout':{'type':Sequelize[_0x422b('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c34318a..8957232 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 _0x2e3b=['filters','intersection','model','attributes','fields','length','query','includeAll','ChatProactiveAction','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','sendStatus','error','stack','name','send','show','params','keys'];(function(_0x243f79,_0x429e45){var _0x460321=function(_0x4feefc){while(--_0x4feefc){_0x243f79['push'](_0x243f79['shift']());}};_0x460321(++_0x429e45);}(_0x2e3b,0x81));var _0xb2e3=function(_0x14881e,_0x18a9df){_0x14881e=_0x14881e-0x0;var _0x3ca2a6=_0x2e3b[_0x14881e];return _0x3ca2a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2e3('0x0'));var zipdir=require(_0xb2e3('0x1'));var jsonpatch=require(_0xb2e3('0x2'));var rp=require(_0xb2e3('0x3'));var moment=require(_0xb2e3('0x4'));var BPromise=require(_0xb2e3('0x5'));var Mustache=require(_0xb2e3('0x6'));var util=require(_0xb2e3('0x7'));var path=require('path');var sox=require(_0xb2e3('0x8'));var csv=require(_0xb2e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2e3('0xa'));var _=require(_0xb2e3('0xb'));var squel=require('squel');var crypto=require(_0xb2e3('0xc'));var jsforce=require(_0xb2e3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb2e3('0x9'));var querystring=require(_0xb2e3('0xe'));var Papa=require(_0xb2e3('0xf'));var Redis=require(_0xb2e3('0x10'));var authService=require(_0xb2e3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb2e3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2e3('0x13'))(_0xb2e3('0x14'));var utils=require(_0xb2e3('0x15'));var config=require(_0xb2e3('0x16'));var licenseUtil=require(_0xb2e3('0x17'));var db=require(_0xb2e3('0x18'))['db'];function respondWithStatusCode(_0x409349,_0x4e262b){_0x4e262b=_0x4e262b||0xcc;return function(_0x59b007){if(_0x59b007){return _0x409349['sendStatus'](_0x4e262b);}return _0x409349[_0xb2e3('0x19')](_0x4e262b)[_0xb2e3('0x1a')]();};}function respondWithResult(_0xe5dc7e,_0x429df0){_0x429df0=_0x429df0||0xc8;return function(_0x51e55b){if(_0x51e55b){return _0xe5dc7e[_0xb2e3('0x19')](_0x429df0)[_0xb2e3('0x1b')](_0x51e55b);}};}function respondWithFilteredResult(_0x2f40ed,_0x3ad8f9){return function(_0x473c72){if(_0x473c72){var _0x294072=typeof _0x3ad8f9[_0xb2e3('0x1c')]===_0xb2e3('0x1d')&&typeof _0x3ad8f9[_0xb2e3('0x1e')]==='undefined';var _0x5e10a9=_0x473c72['count'];var _0x28bb98=_0x294072?0x0:_0x3ad8f9[_0xb2e3('0x1c')];var _0x26caf2=_0x294072?_0x473c72[_0xb2e3('0x1f')]:_0x3ad8f9[_0xb2e3('0x1c')]+_0x3ad8f9[_0xb2e3('0x1e')];var _0x11e1b3;if(_0x26caf2>=_0x5e10a9){_0x26caf2=_0x5e10a9;_0x11e1b3=0xc8;}else{_0x11e1b3=0xce;}_0x2f40ed['status'](_0x11e1b3);return _0x2f40ed[_0xb2e3('0x20')]('Content-Range',_0x28bb98+'-'+_0x26caf2+'/'+_0x5e10a9)[_0xb2e3('0x1b')](_0x473c72);}return null;};}function patchUpdates(_0x3bbd4c){return function(_0x101d96){try{jsonpatch[_0xb2e3('0x21')](_0x101d96,_0x3bbd4c,!![]);}catch(_0x5c0781){return BPromise[_0xb2e3('0x22')](_0x5c0781);}return _0x101d96['save']();};}function saveUpdates(_0x2d72eb,_0x36f392){return function(_0x1f1730){if(_0x1f1730){return _0x1f1730[_0xb2e3('0x23')](_0x2d72eb)['then'](function(_0x2e25a4){return _0x2e25a4;});}return null;};}function removeEntity(_0x312020,_0x38e704){return function(_0x1b7ce0){if(_0x1b7ce0){return _0x1b7ce0['destroy']()[_0xb2e3('0x24')](function(){_0x312020[_0xb2e3('0x19')](0xcc)[_0xb2e3('0x1a')]();});}};}function handleEntityNotFound(_0x429923,_0x512fdf){return function(_0x4f3024){if(!_0x4f3024){_0x429923[_0xb2e3('0x25')](0x194);}return _0x4f3024;};}function handleError(_0x474772,_0x27bc76){_0x27bc76=_0x27bc76||0x1f4;return function(_0x1cccdb){logger[_0xb2e3('0x26')](_0x1cccdb[_0xb2e3('0x27')]);if(_0x1cccdb[_0xb2e3('0x28')]){delete _0x1cccdb[_0xb2e3('0x28')];}_0x474772['status'](_0x27bc76)[_0xb2e3('0x29')](_0x1cccdb);};}exports[_0xb2e3('0x2a')]=function(_0x24b363,_0x43bf97){var _0x14d010={'raw':!![],'where':{'id':_0x24b363[_0xb2e3('0x2b')]['id']}},_0x373d72={};_0x373d72['model']=_[_0xb2e3('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x373d72['query']=_[_0xb2e3('0x2c')](_0x24b363['query']);_0x373d72[_0xb2e3('0x2d')]=_[_0xb2e3('0x2e')](_0x373d72[_0xb2e3('0x2f')],_0x373d72['query']);_0x14d010[_0xb2e3('0x30')]=_['intersection'](_0x373d72['model'],qs[_0xb2e3('0x31')](_0x24b363['query'][_0xb2e3('0x31')]));_0x14d010[_0xb2e3('0x30')]=_0x14d010[_0xb2e3('0x30')][_0xb2e3('0x32')]?_0x14d010[_0xb2e3('0x30')]:_0x373d72[_0xb2e3('0x2f')];if(_0x24b363[_0xb2e3('0x33')][_0xb2e3('0x34')]){_0x14d010['include']=[{'all':!![]}];}_0x14d010=_['merge']({},_0x14d010,_0x24b363['options']);return db[_0xb2e3('0x35')]['find'](_0x14d010)[_0xb2e3('0x24')](handleEntityNotFound(_0x43bf97,null))['then'](respondWithResult(_0x43bf97,null))[_0xb2e3('0x36')](handleError(_0x43bf97,null));};exports['create']=function(_0x42fdce,_0x4f6249){return db[_0xb2e3('0x35')][_0xb2e3('0x37')](_0x42fdce[_0xb2e3('0x38')],{})['then'](respondWithResult(_0x4f6249,0xc9))['catch'](handleError(_0x4f6249,null));};exports['update']=function(_0x2a528a,_0x2e9486){if(_0x2a528a[_0xb2e3('0x38')]['id']){delete _0x2a528a[_0xb2e3('0x38')]['id'];}return db[_0xb2e3('0x35')]['find']({'where':{'id':_0x2a528a[_0xb2e3('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2e9486,null))['then'](saveUpdates(_0x2a528a[_0xb2e3('0x38')],null))[_0xb2e3('0x24')](respondWithResult(_0x2e9486,null))[_0xb2e3('0x36')](handleError(_0x2e9486,null));};exports['destroy']=function(_0x4618a7,_0x2f36f5){return db[_0xb2e3('0x35')][_0xb2e3('0x39')]({'where':{'id':_0x4618a7[_0xb2e3('0x2b')]['id']}})[_0xb2e3('0x24')](handleEntityNotFound(_0x2f36f5,null))[_0xb2e3('0x24')](removeEntity(_0x2f36f5,null))[_0xb2e3('0x36')](handleError(_0x2f36f5,null));}; \ No newline at end of file +var _0xafca=['ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body','destroy','eml-format','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','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','name','send','show','params','model','keys'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xaafc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaafc('0x1'));var jsonpatch=require(_0xaafc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaafc('0x3'));var Mustache=require(_0xaafc('0x4'));var util=require(_0xaafc('0x5'));var path=require(_0xaafc('0x6'));var sox=require(_0xaafc('0x7'));var csv=require('to-csv');var ejs=require(_0xaafc('0x8'));var fs=require('fs');var fs_extra=require(_0xaafc('0x9'));var _=require(_0xaafc('0xa'));var squel=require(_0xaafc('0xb'));var crypto=require(_0xaafc('0xc'));var jsforce=require(_0xaafc('0xd'));var deskjs=require(_0xaafc('0xe'));var toCsv=require(_0xaafc('0xf'));var querystring=require(_0xaafc('0x10'));var Papa=require(_0xaafc('0x11'));var Redis=require(_0xaafc('0x12'));var authService=require(_0xaafc('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaafc('0x14'));var logger=require('../../config/logger')(_0xaafc('0x15'));var utils=require('../../config/utils');var config=require(_0xaafc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaafc('0x17'))['db'];function respondWithStatusCode(_0x63e543,_0x410593){_0x410593=_0x410593||0xcc;return function(_0x1c483b){if(_0x1c483b){return _0x63e543[_0xaafc('0x18')](_0x410593);}return _0x63e543[_0xaafc('0x19')](_0x410593)[_0xaafc('0x1a')]();};}function respondWithResult(_0x2c9ec4,_0xcd06fd){_0xcd06fd=_0xcd06fd||0xc8;return function(_0x3313ae){if(_0x3313ae){return _0x2c9ec4[_0xaafc('0x19')](_0xcd06fd)['json'](_0x3313ae);}};}function respondWithFilteredResult(_0x2e9e29,_0x35fcaa){return function(_0x1cf6a3){if(_0x1cf6a3){var _0x42ef58=typeof _0x35fcaa[_0xaafc('0x1b')]===_0xaafc('0x1c')&&typeof _0x35fcaa[_0xaafc('0x1d')]===_0xaafc('0x1c');var _0x34b7e0=_0x1cf6a3[_0xaafc('0x1e')];var _0x48c266=_0x42ef58?0x0:_0x35fcaa[_0xaafc('0x1b')];var _0x504fa0=_0x42ef58?_0x1cf6a3[_0xaafc('0x1e')]:_0x35fcaa[_0xaafc('0x1b')]+_0x35fcaa[_0xaafc('0x1d')];var _0x30b49c;if(_0x504fa0>=_0x34b7e0){_0x504fa0=_0x34b7e0;_0x30b49c=0xc8;}else{_0x30b49c=0xce;}_0x2e9e29[_0xaafc('0x19')](_0x30b49c);return _0x2e9e29[_0xaafc('0x1f')](_0xaafc('0x20'),_0x48c266+'-'+_0x504fa0+'/'+_0x34b7e0)[_0xaafc('0x21')](_0x1cf6a3);}return null;};}function patchUpdates(_0x27b769){return function(_0x4cf7c5){try{jsonpatch[_0xaafc('0x22')](_0x4cf7c5,_0x27b769,!![]);}catch(_0x990ed9){return BPromise['reject'](_0x990ed9);}return _0x4cf7c5[_0xaafc('0x23')]();};}function saveUpdates(_0x1b6b32,_0x7bc70a){return function(_0x521f26){if(_0x521f26){return _0x521f26[_0xaafc('0x24')](_0x1b6b32)[_0xaafc('0x25')](function(_0x1d2091){return _0x1d2091;});}return null;};}function removeEntity(_0x4a31b4,_0x1b3033){return function(_0xd3b1a2){if(_0xd3b1a2){return _0xd3b1a2['destroy']()[_0xaafc('0x25')](function(){_0x4a31b4[_0xaafc('0x19')](0xcc)[_0xaafc('0x1a')]();});}};}function handleEntityNotFound(_0x4103fc,_0x1f5522){return function(_0x386bac){if(!_0x386bac){_0x4103fc['sendStatus'](0x194);}return _0x386bac;};}function handleError(_0xebf3a,_0xa4dc76){_0xa4dc76=_0xa4dc76||0x1f4;return function(_0xdaff5a){logger[_0xaafc('0x26')](_0xdaff5a['stack']);if(_0xdaff5a[_0xaafc('0x27')]){delete _0xdaff5a[_0xaafc('0x27')];}_0xebf3a[_0xaafc('0x19')](_0xa4dc76)[_0xaafc('0x28')](_0xdaff5a);};}exports[_0xaafc('0x29')]=function(_0x44e207,_0x1c9454){var _0x359ddc={'raw':!![],'where':{'id':_0x44e207[_0xaafc('0x2a')]['id']}},_0x3017ba={};_0x3017ba[_0xaafc('0x2b')]=_[_0xaafc('0x2c')](db[_0xaafc('0x2d')][_0xaafc('0x2e')]);_0x3017ba[_0xaafc('0x2f')]=_[_0xaafc('0x2c')](_0x44e207[_0xaafc('0x2f')]);_0x3017ba['filters']=_['intersection'](_0x3017ba['model'],_0x3017ba[_0xaafc('0x2f')]);_0x359ddc[_0xaafc('0x30')]=_[_0xaafc('0x31')](_0x3017ba['model'],qs[_0xaafc('0x32')](_0x44e207[_0xaafc('0x2f')][_0xaafc('0x32')]));_0x359ddc[_0xaafc('0x30')]=_0x359ddc[_0xaafc('0x30')]['length']?_0x359ddc['attributes']:_0x3017ba['model'];if(_0x44e207[_0xaafc('0x2f')][_0xaafc('0x33')]){_0x359ddc[_0xaafc('0x34')]=[{'all':!![]}];}_0x359ddc=_[_0xaafc('0x35')]({},_0x359ddc,_0x44e207[_0xaafc('0x36')]);return db['ChatProactiveAction'][_0xaafc('0x37')](_0x359ddc)[_0xaafc('0x25')](handleEntityNotFound(_0x1c9454,null))[_0xaafc('0x25')](respondWithResult(_0x1c9454,null))[_0xaafc('0x38')](handleError(_0x1c9454,null));};exports[_0xaafc('0x39')]=function(_0x3349f3,_0x21d6dd){return db['ChatProactiveAction']['create'](_0x3349f3[_0xaafc('0x3a')],{})[_0xaafc('0x25')](respondWithResult(_0x21d6dd,0xc9))['catch'](handleError(_0x21d6dd,null));};exports[_0xaafc('0x24')]=function(_0x118a97,_0x35f761){if(_0x118a97[_0xaafc('0x3a')]['id']){delete _0x118a97[_0xaafc('0x3a')]['id'];}return db[_0xaafc('0x2d')][_0xaafc('0x37')]({'where':{'id':_0x118a97[_0xaafc('0x2a')]['id']}})[_0xaafc('0x25')](handleEntityNotFound(_0x35f761,null))[_0xaafc('0x25')](saveUpdates(_0x118a97[_0xaafc('0x3a')],null))[_0xaafc('0x25')](respondWithResult(_0x35f761,null))[_0xaafc('0x38')](handleError(_0x35f761,null));};exports[_0xaafc('0x3b')]=function(_0x508424,_0xe4e432){return db['ChatProactiveAction'][_0xaafc('0x37')]({'where':{'id':_0x508424[_0xaafc('0x2a')]['id']}})[_0xaafc('0x25')](handleEntityNotFound(_0xe4e432,null))[_0xaafc('0x25')](removeEntity(_0xe4e432,null))[_0xaafc('0x38')](handleError(_0xe4e432,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b75489c..4e6fb9b 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 _0x2d26=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0xb1182e,_0x3810e6){var _0x20d097=function(_0x41ff11){while(--_0x41ff11){_0xb1182e['push'](_0xb1182e['shift']());}};_0x20d097(++_0x3810e6);}(_0x2d26,0x1b0));var _0x62d2=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x2d26[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x62d2('0x0'));var util=require(_0x62d2('0x1'));var logger=require(_0x62d2('0x2'))(_0x62d2('0x3'));var moment=require(_0x62d2('0x4'));var BPromise=require('bluebird');var rp=require(_0x62d2('0x5'));var fs=require('fs');var path=require(_0x62d2('0x6'));var rimraf=require(_0x62d2('0x7'));var config=require('../../config/environment');var attributes=require(_0x62d2('0x8'));module['exports']=function(_0x32b717,_0x8fbf43){return _0x32b717[_0x62d2('0x9')](_0x62d2('0xa'),attributes,{'tableName':_0x62d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ec=['../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','rimraf'];(function(_0x19e013,_0x5c74e0){var _0x58c128=function(_0x26aaf1){while(--_0x26aaf1){_0x19e013['push'](_0x19e013['shift']());}};_0x58c128(++_0x5c74e0);}(_0x77ec,0x19f));var _0xc77e=function(_0x37bb8a,_0xbe11d3){_0x37bb8a=_0x37bb8a-0x0;var _0x209ecb=_0x77ec[_0x37bb8a];return _0x209ecb;};'use strict';var _=require('lodash');var util=require(_0xc77e('0x0'));var logger=require(_0xc77e('0x1'))(_0xc77e('0x2'));var moment=require(_0xc77e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc77e('0x4'));var config=require(_0xc77e('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xc77e('0x6')]=function(_0x5379e2,_0x1ac7f2){return _0x5379e2[_0xc77e('0x7')](_0xc77e('0x8'),attributes,{'tableName':_0xc77e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index a64c126..f08d3ae 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 _0xb94f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb94f,0x102));var _0xfb94=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xb94f[_0xffd1b5];return _0x3176d6;};'use strict';var _=require(_0xfb94('0x0'));var util=require(_0xfb94('0x1'));var moment=require(_0xfb94('0x2'));var BPromise=require(_0xfb94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb94('0x4'));var db=require(_0xfb94('0x5'))['db'];var utils=require(_0xfb94('0x6'));var logger=require(_0xfb94('0x7'))(_0xfb94('0x8'));var config=require(_0xfb94('0x9'));var jayson=require(_0xfb94('0xa'));var client=jayson[_0xfb94('0xb')][_0xfb94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x202ff3,_0x9e0413,_0x1d3983){return new BPromise(function(_0x3ad740,_0x564dc6){return client['request'](_0x202ff3,_0x1d3983)[_0xfb94('0xd')](function(_0x5f4bae){logger[_0xfb94('0xe')](_0xfb94('0xf'),_0x9e0413,'request\x20sent');logger[_0xfb94('0x10')](_0xfb94('0x11'),_0x9e0413,_0xfb94('0x12'),JSON['stringify'](_0x5f4bae));if(_0x5f4bae[_0xfb94('0x13')]){if(_0x5f4bae[_0xfb94('0x13')][_0xfb94('0x14')]===0x1f4){logger[_0xfb94('0x13')](_0xfb94('0xf'),_0x9e0413,_0x5f4bae[_0xfb94('0x13')][_0xfb94('0x15')]);return _0x564dc6(_0x5f4bae[_0xfb94('0x13')][_0xfb94('0x15')]);}logger['error'](_0xfb94('0xf'),_0x9e0413,_0x5f4bae['error'][_0xfb94('0x15')]);return _0x3ad740(_0x5f4bae[_0xfb94('0x13')][_0xfb94('0x15')]);}else{logger[_0xfb94('0xe')](_0xfb94('0xf'),_0x9e0413,_0xfb94('0x12'));_0x3ad740(_0x5f4bae['result'][_0xfb94('0x15')]);}})['catch'](function(_0x538745){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x9e0413,_0x538745);_0x564dc6(_0x538745);});});} \ No newline at end of file +var _0x0da5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x220d71,_0x24b753){var _0x1bc48a=function(_0x1cd1ba){while(--_0x1cd1ba){_0x220d71['push'](_0x220d71['shift']());}};_0x1bc48a(++_0x24b753);}(_0x0da5,0x14a));var _0x50da=function(_0x56d14d,_0x3b270a){_0x56d14d=_0x56d14d-0x0;var _0x3de886=_0x0da5[_0x56d14d];return _0x3de886;};'use strict';var _=require(_0x50da('0x0'));var util=require(_0x50da('0x1'));var moment=require(_0x50da('0x2'));var BPromise=require('bluebird');var rs=require(_0x50da('0x3'));var fs=require('fs');var Redis=require(_0x50da('0x4'));var db=require(_0x50da('0x5'))['db'];var utils=require(_0x50da('0x6'));var logger=require(_0x50da('0x7'))(_0x50da('0x8'));var config=require(_0x50da('0x9'));var jayson=require(_0x50da('0xa'));var client=jayson['client'][_0x50da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x425a86,_0x231ae6,_0x4ceba5){return new BPromise(function(_0xa00b64,_0xdb173){return client[_0x50da('0xc')](_0x425a86,_0x4ceba5)[_0x50da('0xd')](function(_0x4c5a0b){logger[_0x50da('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x231ae6,_0x50da('0xf'));logger['debug'](_0x50da('0x10'),_0x231ae6,_0x50da('0xf'),JSON['stringify'](_0x4c5a0b));if(_0x4c5a0b[_0x50da('0x11')]){if(_0x4c5a0b[_0x50da('0x11')]['code']===0x1f4){logger[_0x50da('0x11')](_0x50da('0x12'),_0x231ae6,_0x4c5a0b[_0x50da('0x11')]['message']);return _0xdb173(_0x4c5a0b['error']['message']);}logger[_0x50da('0x11')](_0x50da('0x12'),_0x231ae6,_0x4c5a0b[_0x50da('0x11')][_0x50da('0x13')]);return _0xa00b64(_0x4c5a0b['error'][_0x50da('0x13')]);}else{logger[_0x50da('0xe')](_0x50da('0x12'),_0x231ae6,_0x50da('0xf'));_0xa00b64(_0x4c5a0b[_0x50da('0x14')][_0x50da('0x13')]);}})['catch'](function(_0x202e12){logger[_0x50da('0x11')](_0x50da('0x12'),_0x231ae6,_0x202e12);_0xdb173(_0x202e12);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a3205a3..c7b3514 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x1d884d,_0x1c3c2d){var _0x386031=function(_0x178341){while(--_0x178341){_0x1d884d['push'](_0x1d884d['shift']());}};_0x386031(++_0x1c3c2d);}(_0xeda8,0x104));var _0x8eda=function(_0x323aaf,_0x115511){_0x323aaf=_0x323aaf-0x0;var _0x3a1118=_0xeda8[_0x323aaf];return _0x3a1118;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router; \ No newline at end of file +var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xabce,0x103));var _0xeabc=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xabce[_0x28d18d];return _0x470640;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 91a95ac..97bb296 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 _0xa54f=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x425fc0,_0x26cd44){var _0x343702=function(_0x6defeb){while(--_0x6defeb){_0x425fc0['push'](_0x425fc0['shift']());}};_0x343702(++_0x26cd44);}(_0xa54f,0x1b2));var _0xfa54=function(_0x2cac11,_0x2ffe31){_0x2cac11=_0x2cac11-0x0;var _0xda93a8=_0xa54f[_0x2cac11];return _0xda93a8;};'use strict';var Sequelize=require(_0xfa54('0x0'));module[_0xfa54('0x1')]={'name':{'type':Sequelize[_0xfa54('0x2')],'unique':_0xfa54('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa54('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa54('0x4')](_0xfa54('0x5'),_0xfa54('0x6'),_0xfa54('0x7'))}}; \ No newline at end of file +var _0x15ba=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x31fbfc,_0x382557){var _0x158e9d=function(_0x5c591d){while(--_0x5c591d){_0x31fbfc['push'](_0x31fbfc['shift']());}};_0x158e9d(++_0x382557);}(_0x15ba,0x114));var _0xa15b=function(_0x1a12c8,_0x2df4dc){_0x1a12c8=_0x1a12c8-0x0;var _0x305109=_0x15ba[_0x1a12c8];return _0x305109;};'use strict';var Sequelize=require(_0xa15b('0x0'));module[_0xa15b('0x1')]={'name':{'type':Sequelize[_0xa15b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa15b('0x2')]},'timeout':{'type':Sequelize[_0xa15b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa15b('0x4')](_0xa15b('0x5'),_0xa15b('0x6'),_0xa15b('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 34b5359..bcd7aba 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 _0x357e=['createdAt','rows','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','Agents','online','flatMap','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','offset','set','apply','reject','update','get','UserProfileResource','destroy','stack','name','map','ChatQueue','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','count','include','findAll','show','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','updatedAt'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x357e,0x1f3));var _0xe357=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x357e[_0x17928f];return _0x500b63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe357('0x0'));var jsonpatch=require(_0xe357('0x1'));var rp=require(_0xe357('0x2'));var moment=require(_0xe357('0x3'));var BPromise=require(_0xe357('0x4'));var Mustache=require(_0xe357('0x5'));var util=require(_0xe357('0x6'));var path=require(_0xe357('0x7'));var sox=require(_0xe357('0x8'));var csv=require(_0xe357('0x9'));var ejs=require(_0xe357('0xa'));var fs=require('fs');var fs_extra=require(_0xe357('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe357('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe357('0xd'));var toCsv=require(_0xe357('0x9'));var querystring=require(_0xe357('0xe'));var Papa=require(_0xe357('0xf'));var Redis=require(_0xe357('0x10'));var authService=require(_0xe357('0x11'));var qs=require(_0xe357('0x12'));var as=require(_0xe357('0x13'));var hardwareService=require(_0xe357('0x14'));var logger=require(_0xe357('0x15'))(_0xe357('0x16'));var utils=require('../../config/utils');var config=require(_0xe357('0x17'));var licenseUtil=require(_0xe357('0x18'));var db=require(_0xe357('0x19'))['db'];config['redis']=_[_0xe357('0x1a')](config['redis'],{'host':_0xe357('0x1b'),'port':0x18eb});var socket=require(_0xe357('0x1c'))(new Redis(config['redis']));require(_0xe357('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe357('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417e2a,_0x18f0db,_0x421777,_0x2e7a27){return new BPromise(function(_0x38370c,_0x479ca4){var _0x451a2d=_0x2e7a27||client;return _0x451a2d[_0xe357('0x1f')](_0x417e2a,_0x421777)[_0xe357('0x20')](function(_0x1b5aef){logger[_0xe357('0x21')](_0xe357('0x22'),_0x18f0db,_0xe357('0x23'));logger['debug'](_0xe357('0x24'),_0x18f0db,_0xe357('0x23'),JSON[_0xe357('0x25')](_0x1b5aef));if(_0x1b5aef['error']){if(_0x1b5aef[_0xe357('0x26')][_0xe357('0x27')]===0x1f4){logger[_0xe357('0x26')](_0xe357('0x22'),_0x18f0db,_0x1b5aef[_0xe357('0x26')][_0xe357('0x28')]);return _0x479ca4(_0x1b5aef[_0xe357('0x26')][_0xe357('0x28')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x18f0db,_0x1b5aef['error'][_0xe357('0x28')]);return _0x38370c(_0x1b5aef[_0xe357('0x26')][_0xe357('0x28')]);}else{logger[_0xe357('0x21')]('ChatQueue,\x20%s,\x20%s',_0x18f0db,_0xe357('0x23'));_0x38370c(_0x1b5aef[_0xe357('0x29')][_0xe357('0x28')]);}})[_0xe357('0x2a')](function(_0x5c389b){logger[_0xe357('0x26')](_0xe357('0x22'),_0x18f0db,_0x5c389b);_0x479ca4(_0x5c389b);});});}function respondWithStatusCode(_0x278805,_0x441475){_0x441475=_0x441475||0xcc;return function(_0x37d65d){if(_0x37d65d){return _0x278805[_0xe357('0x2b')](_0x441475);}return _0x278805[_0xe357('0x2c')](_0x441475)[_0xe357('0x2d')]();};}function respondWithResult(_0x216983,_0x57199b){_0x57199b=_0x57199b||0xc8;return function(_0x2a1546){if(_0x2a1546){return _0x216983[_0xe357('0x2c')](_0x57199b)['json'](_0x2a1546);}};}function respondWithFilteredResult(_0x5c416f,_0x325007){return function(_0x1c6e51){if(_0x1c6e51){var _0x1cb01c=typeof _0x325007['offset']===_0xe357('0x2e')&&typeof _0x325007[_0xe357('0x2f')]===_0xe357('0x2e');var _0x323165=_0x1c6e51['count'];var _0xe8ddb6=_0x1cb01c?0x0:_0x325007[_0xe357('0x30')];var _0x46f7db=_0x1cb01c?_0x1c6e51['count']:_0x325007['offset']+_0x325007['limit'];var _0x52c683;if(_0x46f7db>=_0x323165){_0x46f7db=_0x323165;_0x52c683=0xc8;}else{_0x52c683=0xce;}_0x5c416f[_0xe357('0x2c')](_0x52c683);return _0x5c416f[_0xe357('0x31')]('Content-Range',_0xe8ddb6+'-'+_0x46f7db+'/'+_0x323165)['json'](_0x1c6e51);}return null;};}function patchUpdates(_0x31e473){return function(_0x31ea2f){try{jsonpatch[_0xe357('0x32')](_0x31ea2f,_0x31e473,!![]);}catch(_0x235f7d){return BPromise[_0xe357('0x33')](_0x235f7d);}return _0x31ea2f['save']();};}function saveUpdates(_0x3590b3,_0x3635c6){return function(_0x2e13bd){if(_0x2e13bd){return _0x2e13bd[_0xe357('0x34')](_0x3590b3)[_0xe357('0x20')](function(_0x471f97){return _0x471f97;});}return null;};}function removeEntity(_0xef8f1,_0x132611){return function(_0x899d4b){if(_0x899d4b){return _0x899d4b['destroy']()[_0xe357('0x20')](function(){var _0x2e2023=_0x899d4b[_0xe357('0x35')]({'plain':!![]});var _0x320fc5='ChatQueues';return db[_0xe357('0x36')][_0xe357('0x37')]({'where':{'type':_0x320fc5,'resourceId':_0x2e2023['id']}})[_0xe357('0x20')](function(){return _0x899d4b;});})[_0xe357('0x20')](function(){_0xef8f1[_0xe357('0x2c')](0xcc)[_0xe357('0x2d')]();});}};}function handleEntityNotFound(_0x4c4132,_0x4969d8){return function(_0x4d1c1e){if(!_0x4d1c1e){_0x4c4132[_0xe357('0x2b')](0x194);}return _0x4d1c1e;};}function handleError(_0x30893e,_0x5eb800){_0x5eb800=_0x5eb800||0x1f4;return function(_0x272660){logger[_0xe357('0x26')](_0x272660[_0xe357('0x38')]);if(_0x272660[_0xe357('0x39')]){delete _0x272660[_0xe357('0x39')];}_0x30893e[_0xe357('0x2c')](_0x5eb800)['send'](_0x272660);};}exports['index']=function(_0x5d26eb,_0x46932){var _0x59803d={},_0x31b25a={},_0x198109={'count':0x0,'rows':[]};var _0x4d8aca=_[_0xe357('0x3a')](db[_0xe357('0x3b')]['rawAttributes'],function(_0x1f067f){return{'name':_0x1f067f[_0xe357('0x3c')],'type':_0x1f067f['type'][_0xe357('0x3d')]};});_0x31b25a[_0xe357('0x3e')]=_[_0xe357('0x3a')](_0x4d8aca,_0xe357('0x39'));_0x31b25a[_0xe357('0x3f')]=_[_0xe357('0x40')](_0x5d26eb[_0xe357('0x3f')]);_0x31b25a[_0xe357('0x41')]=_['intersection'](_0x31b25a[_0xe357('0x3e')],_0x31b25a['query']);_0x59803d[_0xe357('0x42')]=_[_0xe357('0x43')](_0x31b25a[_0xe357('0x3e')],qs[_0xe357('0x44')](_0x5d26eb['query'][_0xe357('0x44')]));_0x59803d[_0xe357('0x42')]=_0x59803d[_0xe357('0x42')][_0xe357('0x45')]?_0x59803d['attributes']:_0x31b25a[_0xe357('0x3e')];if(!_0x5d26eb[_0xe357('0x3f')][_0xe357('0x46')](_0xe357('0x47'))){_0x59803d[_0xe357('0x2f')]=qs[_0xe357('0x2f')](_0x5d26eb[_0xe357('0x3f')]['limit']);_0x59803d[_0xe357('0x30')]=qs[_0xe357('0x30')](_0x5d26eb[_0xe357('0x3f')][_0xe357('0x30')]);}_0x59803d['order']=qs[_0xe357('0x48')](_0x5d26eb[_0xe357('0x3f')]['sort']);_0x59803d[_0xe357('0x49')]=qs[_0xe357('0x41')](_[_0xe357('0x4a')](_0x5d26eb[_0xe357('0x3f')],_0x31b25a[_0xe357('0x41')]),_0x4d8aca);if(_0x5d26eb['query'][_0xe357('0x4b')]){_0x59803d[_0xe357('0x49')]=_[_0xe357('0x4c')](_0x59803d[_0xe357('0x49')],{'$or':_[_0xe357('0x3a')](_0x4d8aca,function(_0x397267){if(_0x397267[_0xe357('0x4d')]!==_0xe357('0x4e')){var _0x262dbb={};_0x262dbb[_0x397267['name']]={'$like':'%'+_0x5d26eb[_0xe357('0x3f')][_0xe357('0x4b')]+'%'};return _0x262dbb;}})});}_0x59803d=_[_0xe357('0x4c')]({},_0x59803d,_0x5d26eb['options']);var _0x410645={'where':_0x59803d[_0xe357('0x49')]};return db['ChatQueue']['count'](_0x410645)[_0xe357('0x20')](function(_0x504bb8){_0x198109[_0xe357('0x4f')]=_0x504bb8;if(_0x5d26eb['query']['includeAll']){_0x59803d[_0xe357('0x50')]=[{'all':!![]}];}return db[_0xe357('0x3b')][_0xe357('0x51')](_0x59803d);})['then'](function(_0x5d9e46){_0x198109['rows']=_0x5d9e46;return _0x198109;})[_0xe357('0x20')](respondWithFilteredResult(_0x46932,_0x59803d))[_0xe357('0x2a')](handleError(_0x46932,null));};exports[_0xe357('0x52')]=function(_0x10e389,_0x116fe5){var _0x43019a={'raw':!![],'where':{'id':_0x10e389['params']['id']}},_0x1fa3dc={};_0x1fa3dc[_0xe357('0x3e')]=_[_0xe357('0x40')](db[_0xe357('0x3b')][_0xe357('0x53')]);_0x1fa3dc['query']=_['keys'](_0x10e389[_0xe357('0x3f')]);_0x1fa3dc['filters']=_[_0xe357('0x43')](_0x1fa3dc['model'],_0x1fa3dc['query']);_0x43019a[_0xe357('0x42')]=_[_0xe357('0x43')](_0x1fa3dc['model'],qs[_0xe357('0x44')](_0x10e389[_0xe357('0x3f')][_0xe357('0x44')]));_0x43019a[_0xe357('0x42')]=_0x43019a['attributes'][_0xe357('0x45')]?_0x43019a[_0xe357('0x42')]:_0x1fa3dc[_0xe357('0x3e')];if(_0x10e389[_0xe357('0x3f')][_0xe357('0x54')]){_0x43019a[_0xe357('0x50')]=[{'all':!![]}];}_0x43019a=_['merge']({},_0x43019a,_0x10e389[_0xe357('0x55')]);return db['ChatQueue'][_0xe357('0x56')](_0x43019a)[_0xe357('0x20')](handleEntityNotFound(_0x116fe5,null))[_0xe357('0x20')](respondWithResult(_0x116fe5,null))[_0xe357('0x2a')](handleError(_0x116fe5,null));};exports[_0xe357('0x57')]=function(_0x23b8f0,_0x5b1703){return db['ChatQueue'][_0xe357('0x57')](_0x23b8f0[_0xe357('0x58')],{})[_0xe357('0x20')](function(_0x1b0d5){var _0x3190e7=_0x23b8f0[_0xe357('0x59')]['get']({'plain':!![]});if(!_0x3190e7)throw new Error(_0xe357('0x5a'));if(_0x3190e7['role']===_0xe357('0x59')){var _0xca4fd1=_0x1b0d5[_0xe357('0x35')]({'plain':!![]});var _0x35333b='ChatQueues';return db[_0xe357('0x5b')][_0xe357('0x56')]({'where':{'name':_0x35333b,'userProfileId':_0x3190e7[_0xe357('0x5c')]},'raw':!![]})[_0xe357('0x20')](function(_0x5934b9){if(_0x5934b9&&_0x5934b9[_0xe357('0x5d')]===0x0){return db[_0xe357('0x36')][_0xe357('0x57')]({'name':_0xca4fd1[_0xe357('0x39')],'resourceId':_0xca4fd1['id'],'type':_0x5934b9[_0xe357('0x39')],'sectionId':_0x5934b9['id']},{})[_0xe357('0x20')](function(){return _0x1b0d5;});}else{return _0x1b0d5;}})[_0xe357('0x2a')](function(_0x5dd963){logger[_0xe357('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dd963);throw _0x5dd963;});}return _0x1b0d5;})[_0xe357('0x20')](respondWithResult(_0x5b1703,0xc9))[_0xe357('0x2a')](handleError(_0x5b1703,null));};exports['update']=function(_0x4565e3,_0x467170){if(_0x4565e3[_0xe357('0x58')]['id']){delete _0x4565e3[_0xe357('0x58')]['id'];}return db['ChatQueue'][_0xe357('0x56')]({'where':{'id':_0x4565e3[_0xe357('0x5e')]['id']}})['then'](handleEntityNotFound(_0x467170,null))['then'](saveUpdates(_0x4565e3['body'],null))[_0xe357('0x20')](respondWithResult(_0x467170,null))['catch'](handleError(_0x467170,null));};exports[_0xe357('0x37')]=function(_0x15e92f,_0x1f1dc1){return db['ChatQueue'][_0xe357('0x56')]({'where':{'id':_0x15e92f[_0xe357('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1f1dc1,null))[_0xe357('0x20')](removeEntity(_0x1f1dc1,null))['catch'](handleError(_0x1f1dc1,null));};exports[_0xe357('0x5f')]=function(_0xe78135,_0x4d77d9){return db[_0xe357('0x3b')][_0xe357('0x5f')]()['then'](respondWithResult(_0x4d77d9,null))[_0xe357('0x2a')](handleError(_0x4d77d9,null));};exports[_0xe357('0x60')]=function(_0x5e4430,_0x33a147,_0x178a03){var _0xc525e5={'raw':!![],'where':{}},_0xcd5bf5={},_0x554ba2;return db[_0xe357('0x3b')][_0xe357('0x61')]({'where':{'id':_0x5e4430[_0xe357('0x5e')]['id']}})['then'](handleEntityNotFound(_0x33a147,null))[_0xe357('0x20')](function(_0x509131){if(_0x509131){_0x554ba2=_0x509131['get']({'plain':!![]});_0xcd5bf5[_0xe357('0x3e')]=_['keys'](db[_0xe357('0x62')][_0xe357('0x53')]);_0xcd5bf5[_0xe357('0x3f')]=_['keys'](_0x5e4430['query']);_0xcd5bf5[_0xe357('0x41')]=_[_0xe357('0x43')](_0xcd5bf5[_0xe357('0x3e')],_0xcd5bf5[_0xe357('0x3f')]);_0xc525e5[_0xe357('0x42')]=_['intersection'](_0xcd5bf5[_0xe357('0x3e')],qs[_0xe357('0x44')](_0x5e4430[_0xe357('0x3f')][_0xe357('0x44')]));_0xc525e5['attributes']=_0xc525e5['attributes'][_0xe357('0x45')]?_0xc525e5[_0xe357('0x42')]:_0xcd5bf5[_0xe357('0x3e')];if(!_0x5e4430[_0xe357('0x3f')][_0xe357('0x46')](_0xe357('0x47'))){_0xc525e5[_0xe357('0x2f')]=qs[_0xe357('0x2f')](_0x5e4430[_0xe357('0x3f')][_0xe357('0x2f')]);_0xc525e5[_0xe357('0x30')]=qs[_0xe357('0x30')](_0x5e4430[_0xe357('0x3f')][_0xe357('0x30')]);}_0xc525e5[_0xe357('0x63')]=qs[_0xe357('0x48')](_0x5e4430[_0xe357('0x3f')][_0xe357('0x48')]);_0xc525e5[_0xe357('0x49')]=qs['filters'](_[_0xe357('0x4a')](_0x5e4430[_0xe357('0x3f')],_0xcd5bf5[_0xe357('0x41')]));_0xc525e5['where'][_0xe357('0x64')]=_0x509131['id'];if(_0x5e4430[_0xe357('0x3f')][_0xe357('0x4b')]){_0xc525e5[_0xe357('0x49')]=_[_0xe357('0x4c')](_0xc525e5['where'],{'$or':_['map'](_0xc525e5[_0xe357('0x42')],function(_0x307959){var _0x186453={};_0x186453[_0x307959]={'$like':'%'+_0x5e4430[_0xe357('0x3f')][_0xe357('0x4b')]+'%'};return _0x186453;})});}_0xc525e5=_[_0xe357('0x4c')]({},_0xc525e5,_0x5e4430[_0xe357('0x55')]);return db[_0xe357('0x62')]['findAll'](_0xc525e5);}})['then'](function(_0x1f83c8){if(_0x1f83c8){return db[_0xe357('0x65')][_0xe357('0x66')]({'where':{'id':_[_0xe357('0x3a')](_0x1f83c8,_0xe357('0x67')),'role':'agent'},'attributes':['id',_0xe357('0x39'),'chatPause',_0xe357('0x68'),_0xe357('0x69')]});}})[_0xe357('0x20')](function(_0x524da2){if(_0x524da2){return{'count':_0x524da2[_0xe357('0x4f')],'rows':_[_0xe357('0x3a')](_0x524da2[_0xe357('0x6a')],function(_0x2b18f6){return{'membername':_0x2b18f6[_0xe357('0x39')],'UserId':_0x2b18f6['id'],'queue_name':_0x554ba2[_0xe357('0x39')],'ChatQueueId':_0x554ba2['id'],'interface':util[_0xe357('0x6b')](_0xe357('0x6c'),_0xe357('0x6d'),_0x2b18f6[_0xe357('0x39')]),'penalty':0x0,'paused':_0x2b18f6[_0xe357('0x6e')],'createdAt':_0x2b18f6[_0xe357('0x69')],'updatedAt':_0x2b18f6[_0xe357('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33a147,_0xc525e5))[_0xe357('0x2a')](handleError(_0x33a147,null));};exports[_0xe357('0x6f')]=function(_0x9ffb0b,_0x108c7a,_0x2b6dcd){var _0x51f6b8={};var _0x4ce7a5={};var _0x2d1a57;var _0x20c83b;return db['ChatQueue'][_0xe357('0x61')]({'where':{'id':_0x9ffb0b[_0xe357('0x5e')]['id']}})[_0xe357('0x20')](handleEntityNotFound(_0x108c7a,null))[_0xe357('0x20')](function(_0x1e07ae){if(_0x1e07ae){_0x2d1a57=_0x1e07ae;_0x4ce7a5[_0xe357('0x3e')]=_[_0xe357('0x40')](db[_0xe357('0x70')][_0xe357('0x53')]);_0x4ce7a5[_0xe357('0x3f')]=_['keys'](_0x9ffb0b[_0xe357('0x3f')]);_0x4ce7a5['filters']=_['intersection'](_0x4ce7a5[_0xe357('0x3e')],_0x4ce7a5[_0xe357('0x3f')]);_0x51f6b8[_0xe357('0x42')]=_[_0xe357('0x43')](_0x4ce7a5[_0xe357('0x3e')],qs[_0xe357('0x44')](_0x9ffb0b[_0xe357('0x3f')]['fields']));_0x51f6b8['attributes']=_0x51f6b8[_0xe357('0x42')][_0xe357('0x45')]?_0x51f6b8[_0xe357('0x42')]:_0x4ce7a5[_0xe357('0x3e')];_0x51f6b8['order']=qs['sort'](_0x9ffb0b['query'][_0xe357('0x48')]);_0x51f6b8[_0xe357('0x49')]=qs['filters'](_[_0xe357('0x4a')](_0x9ffb0b[_0xe357('0x3f')],_0x4ce7a5[_0xe357('0x41')]));if(_0x9ffb0b[_0xe357('0x3f')][_0xe357('0x4b')]){_0x51f6b8['where']=_[_0xe357('0x4c')](_0x51f6b8[_0xe357('0x49')],{'$or':_[_0xe357('0x3a')](_0x51f6b8[_0xe357('0x42')],function(_0x43ad1e){var _0xc5caf2={};_0xc5caf2[_0x43ad1e]={'$like':'%'+_0x9ffb0b[_0xe357('0x3f')][_0xe357('0x4b')]+'%'};return _0xc5caf2;})});}_0x51f6b8=_[_0xe357('0x4c')]({},_0x51f6b8,_0x9ffb0b[_0xe357('0x55')]);return _0x2d1a57[_0xe357('0x6f')](_0x51f6b8);}})[_0xe357('0x20')](function(_0x4125f6){if(_0x4125f6){_0x20c83b=_0x4125f6[_0xe357('0x45')];if(!_0x9ffb0b[_0xe357('0x3f')]['hasOwnProperty'](_0xe357('0x47'))){_0x51f6b8[_0xe357('0x2f')]=qs[_0xe357('0x2f')](_0x9ffb0b[_0xe357('0x3f')][_0xe357('0x2f')]);_0x51f6b8[_0xe357('0x30')]=qs[_0xe357('0x30')](_0x9ffb0b[_0xe357('0x3f')][_0xe357('0x30')]);}return _0x2d1a57['getTeams'](_0x51f6b8);}})['then'](function(_0x2b16b2){if(_0x2b16b2){return _0x2b16b2?{'count':_0x20c83b,'rows':_0x2b16b2}:null;}})[_0xe357('0x20')](respondWithResult(_0x108c7a,null))[_0xe357('0x2a')](handleError(_0x108c7a,null));};exports[_0xe357('0x71')]=function(_0x194a61,_0x2ec5cc,_0x3de53c){var _0x13661d=_0x194a61['body']['ids'];return db[_0xe357('0x70')]['findAll']({'where':{'id':_0x13661d},'attributes':['id'],'include':[{'model':db[_0xe357('0x65')],'as':_0xe357('0x72'),'attributes':['id',_0xe357('0x39'),_0xe357('0x73'),'voicePause','interface'],'raw':!![]}]})[_0xe357('0x20')](function(_0x1d2234){if(_0x1d2234){var _0x2f21f0=_[_0xe357('0x74')](_0x1d2234,function(_0x2ab679){var _0x3b3e8a=_0x2ab679['get']({'plain':!![]});return _0x3b3e8a[_0xe357('0x72')];});return db['ChatQueue'][_0xe357('0x56')]({'where':{'id':_0x194a61[_0xe357('0x5e')]['id']}})['then'](function(_0x323dc2){return db['sequelize'][_0xe357('0x75')](function(_0x412d1d){return _0x323dc2[_0xe357('0x71')](_0x13661d,{'transaction':_0x412d1d})['then'](function(){return BPromise[_0xe357('0x76')](_0x2f21f0,function(_0x2529b6){return db[_0xe357('0x62')]['findOrCreate']({'where':{'UserId':_0x2529b6['id'],'ChatQueueId':_0x194a61['params']['id']},'transaction':_0x412d1d});});})[_0xe357('0x20')](function(){_0x2f21f0[_0xe357('0x77')](function(_0x39fbc3){socket[_0xe357('0x78')](_0xe357('0x79'),{'UserId':_0x39fbc3['id'],'ChatQueueId':_0x323dc2['id']});});});});});}})[_0xe357('0x20')](respondWithStatusCode(_0x2ec5cc,null))[_0xe357('0x2a')](handleError(_0x2ec5cc,null));};exports[_0xe357('0x7a')]=function(_0x279837,_0x2d7aac,_0x21abca){return db[_0xe357('0x70')][_0xe357('0x51')]({'where':{'id':_0x279837[_0xe357('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe357('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe357('0x20')](handleEntityNotFound(_0x2d7aac,null))['then'](function(_0x312c28){var _0x5eea29=_[_0xe357('0x3a')](_0x312c28,'id');var _0x500bb8=[];var _0x2ee4ec=[];var _0x274b97=squel[_0xe357('0x7b')]();_0x274b97[_0xe357('0x7c')](_0xe357('0x7d'))[_0xe357('0x7e')](_0xe357('0x7f'),'tq')[_0xe357('0x80')](_0xe357('0x81'),'ut',_0xe357('0x82'))[_0xe357('0x49')](_0xe357('0x83'),_0x279837['params']['id']);for(var _0x1e0ae9=0x0;_0x1e0ae9<_0x312c28[_0xe357('0x45')];_0x1e0ae9+=0x1){let _0x4b9582=_0x312c28[_0x1e0ae9];for(var _0x4d78ff=0x0;_0x4d78ff<_0x4b9582[_0xe357('0x72')][_0xe357('0x45')];_0x4d78ff+=0x1){let _0x26a4e4=_0x4b9582['Agents'][_0x4d78ff];var _0x592177=_0x274b97[_0xe357('0x84')]();_0x592177[_0xe357('0x49')](_0xe357('0x85'),_0x26a4e4['id']);_0x2ee4ec[_0xe357('0x86')](db['sequelize'][_0xe357('0x3f')](_0x592177['toString'](),{'type':db[_0xe357('0x87')][_0xe357('0x88')]['SELECT']})['then'](function(_0x4d173e){if(_0x4d173e[_0xe357('0x45')]===0x1){return _0x26a4e4['id'];}else{var _0x553e27=_[_0xe357('0x89')](_['map'](_0x4d173e,_0xe357('0x8a')),function(_0x4d57bc){return _[_0xe357('0x8b')](_0x5eea29,_0x4d57bc);});if(_0x553e27){return _0x26a4e4['id'];}}}));}}return BPromise[_0xe357('0x8c')](_0x2ee4ec)['then'](function(_0x119387){_0x500bb8=_(_0x500bb8)[_0xe357('0x8d')](_0x119387)[_0xe357('0x8e')]()['value']();return db[_0xe357('0x3b')][_0xe357('0x56')]({'where':{'id':_0x279837[_0xe357('0x5e')]['id']}})[_0xe357('0x20')](function(_0x32cdf7){return db[_0xe357('0x87')][_0xe357('0x75')](function(_0x5d4ad0){return _0x32cdf7[_0xe357('0x7a')](_0x279837['query'][_0xe357('0x8f')],{'transaction':_0x5d4ad0})[_0xe357('0x20')](function(){if(!_[_0xe357('0x90')](_0x500bb8)){return _0x32cdf7[_0xe357('0x91')](_0x500bb8,{'transaction':_0x5d4ad0});}})[_0xe357('0x20')](function(){_0x500bb8[_0xe357('0x77')](function(_0x50504b){socket[_0xe357('0x78')](_0xe357('0x92'),{'UserId':_0x50504b,'ChatQueueId':_0x32cdf7['id']});});});});});});})[_0xe357('0x20')](respondWithStatusCode(_0x2d7aac,null))[_0xe357('0x2a')](handleError(_0x2d7aac,null));};exports[_0xe357('0x93')]=function(_0x1023df,_0x551dd3,_0x5acb17){return db['ChatQueue']['find']({'where':{'id':_0x1023df[_0xe357('0x5e')]['id']}})[_0xe357('0x20')](handleEntityNotFound(_0x551dd3,null))[_0xe357('0x20')](function(_0x314f7e){if(_0x314f7e){return _0x314f7e['addAgents'](_0x1023df[_0xe357('0x58')][_0xe357('0x8f')],_['omit'](_0x1023df['body'],['ids','id'])||{})[_0xe357('0x94')](function(_0x40eab5){for(var _0x2164e6=0x0;_0x2164e6<_0x1023df[_0xe357('0x58')][_0xe357('0x8f')][_0xe357('0x45')];_0x2164e6+=0x1){socket['emit'](_0xe357('0x79'),{'UserId':Number(_0x1023df[_0xe357('0x58')][_0xe357('0x8f')][_0x2164e6]),'ChatQueueId':Number(_0x1023df[_0xe357('0x5e')]['id'])});}return _0x40eab5;});}})[_0xe357('0x20')](respondWithResult(_0x551dd3,null))[_0xe357('0x2a')](handleError(_0x551dd3,null));};exports[_0xe357('0x91')]=function(_0x2abab0,_0x63e814,_0x46cba9){return db[_0xe357('0x3b')][_0xe357('0x56')]({'where':{'id':_0x2abab0[_0xe357('0x5e')]['id']}})[_0xe357('0x20')](handleEntityNotFound(_0x63e814,null))['then'](function(_0x8fbc4e){if(_0x8fbc4e){return _0x8fbc4e['removeAgents'](_0x2abab0['query']['ids'])[_0xe357('0x20')](function(){if(_[_0xe357('0x95')](_0x2abab0['query']['ids'])){for(var _0x572d93=0x0;_0x572d93<_0x2abab0[_0xe357('0x3f')][_0xe357('0x8f')][_0xe357('0x45')];_0x572d93+=0x1){socket[_0xe357('0x78')](_0xe357('0x92'),{'UserId':Number(_0x2abab0[_0xe357('0x3f')]['ids'][_0x572d93]),'ChatQueueId':Number(_0x2abab0['params']['id'])});}}else{socket['emit'](_0xe357('0x92'),{'UserId':Number(_0x2abab0[_0xe357('0x3f')][_0xe357('0x8f')]),'ChatQueueId':Number(_0x2abab0[_0xe357('0x5e')]['id'])});}});}})[_0xe357('0x20')](respondWithStatusCode(_0x63e814,null))[_0xe357('0x2a')](handleError(_0x63e814,null));};exports[_0xe357('0x96')]=function(_0x22e0dc,_0x4deaab,_0x348ddb){var _0x47414b={};var _0x41e261={};var _0x2a3660;var _0x54e99c;return db[_0xe357('0x3b')]['findOne']({'where':{'id':_0x22e0dc[_0xe357('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4deaab,null))[_0xe357('0x20')](function(_0x1adc5e){if(_0x1adc5e){_0x2a3660=_0x1adc5e;_0x41e261[_0xe357('0x3e')]=_[_0xe357('0x40')](db[_0xe357('0x65')]['rawAttributes']);_0x41e261[_0xe357('0x3f')]=_['keys'](_0x22e0dc['query']);_0x41e261[_0xe357('0x41')]=_['intersection'](_0x41e261[_0xe357('0x3e')],_0x41e261['query']);_0x47414b[_0xe357('0x42')]=_[_0xe357('0x43')](_0x41e261[_0xe357('0x3e')],qs[_0xe357('0x44')](_0x22e0dc[_0xe357('0x3f')][_0xe357('0x44')]));_0x47414b[_0xe357('0x42')]=_0x47414b[_0xe357('0x42')][_0xe357('0x45')]?_0x47414b['attributes']:_0x41e261[_0xe357('0x3e')];_0x47414b['order']=qs[_0xe357('0x48')](_0x22e0dc['query'][_0xe357('0x48')]);_0x47414b[_0xe357('0x49')]=qs[_0xe357('0x41')](_[_0xe357('0x4a')](_0x22e0dc[_0xe357('0x3f')],_0x41e261[_0xe357('0x41')]));if(_0x22e0dc[_0xe357('0x3f')][_0xe357('0x4b')]){_0x47414b[_0xe357('0x49')]=_[_0xe357('0x4c')](_0x47414b[_0xe357('0x49')],{'$or':_['map'](_0x47414b[_0xe357('0x42')],function(_0x4c4e54){var _0x2b8a27={};_0x2b8a27[_0x4c4e54]={'$like':'%'+_0x22e0dc[_0xe357('0x3f')][_0xe357('0x4b')]+'%'};return _0x2b8a27;})});}_0x47414b=_[_0xe357('0x4c')]({},_0x47414b,_0x22e0dc[_0xe357('0x55')]);return _0x2a3660[_0xe357('0x96')](_0x47414b);}})[_0xe357('0x20')](function(_0x3b4c13){if(_0x3b4c13){_0x54e99c=_0x3b4c13[_0xe357('0x45')];if(!_0x22e0dc[_0xe357('0x3f')]['hasOwnProperty'](_0xe357('0x47'))){_0x47414b[_0xe357('0x2f')]=qs[_0xe357('0x2f')](_0x22e0dc[_0xe357('0x3f')][_0xe357('0x2f')]);_0x47414b[_0xe357('0x30')]=qs['offset'](_0x22e0dc[_0xe357('0x3f')][_0xe357('0x30')]);}return _0x2a3660[_0xe357('0x96')](_0x47414b);}})[_0xe357('0x20')](function(_0x4971f1){if(_0x4971f1){return _0x4971f1?{'count':_0x54e99c,'rows':_0x4971f1}:null;}})[_0xe357('0x20')](respondWithResult(_0x4deaab,null))[_0xe357('0x2a')](handleError(_0x4deaab,null));}; \ No newline at end of file +var _0x9c03=['findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatQueue.socket','register','jayson/promise','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','send','index','map','ChatQueue','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','rows','show','params','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','filter','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction'];(function(_0x36ca11,_0x53b76b){var _0x35e530=function(_0x57933f){while(--_0x57933f){_0x36ca11['push'](_0x36ca11['shift']());}};_0x35e530(++_0x53b76b);}(_0x9c03,0x152));var _0x39c0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9c03[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x39c0('0x0'));var rimraf=require(_0x39c0('0x1'));var zipdir=require(_0x39c0('0x2'));var jsonpatch=require(_0x39c0('0x3'));var rp=require(_0x39c0('0x4'));var moment=require(_0x39c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x39c0('0x6'));var util=require(_0x39c0('0x7'));var path=require(_0x39c0('0x8'));var sox=require(_0x39c0('0x9'));var csv=require(_0x39c0('0xa'));var ejs=require(_0x39c0('0xb'));var fs=require('fs');var fs_extra=require(_0x39c0('0xc'));var _=require(_0x39c0('0xd'));var squel=require(_0x39c0('0xe'));var crypto=require(_0x39c0('0xf'));var jsforce=require(_0x39c0('0x10'));var deskjs=require(_0x39c0('0x11'));var toCsv=require(_0x39c0('0xa'));var querystring=require(_0x39c0('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39c0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x39c0('0x14'));var hardwareService=require(_0x39c0('0x15'));var logger=require(_0x39c0('0x16'))('api');var utils=require(_0x39c0('0x17'));var config=require(_0x39c0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x39c0('0x19'))['db'];config['redis']=_[_0x39c0('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x39c0('0x1b'))(new Redis(config[_0x39c0('0x1c')]));require(_0x39c0('0x1d'))[_0x39c0('0x1e')](socket);var jayson=require(_0x39c0('0x1f'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5121ce,_0x464817,_0x434615,_0x3abcbe){return new BPromise(function(_0x121172,_0x2fad83){var _0x49d8d1=_0x3abcbe||client;return _0x49d8d1[_0x39c0('0x20')](_0x5121ce,_0x434615)['then'](function(_0x37a2e1){logger[_0x39c0('0x21')](_0x39c0('0x22'),_0x464817,_0x39c0('0x23'));logger[_0x39c0('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x464817,'request\x20sent',JSON[_0x39c0('0x25')](_0x37a2e1));if(_0x37a2e1[_0x39c0('0x26')]){if(_0x37a2e1[_0x39c0('0x26')][_0x39c0('0x27')]===0x1f4){logger[_0x39c0('0x26')](_0x39c0('0x22'),_0x464817,_0x37a2e1[_0x39c0('0x26')][_0x39c0('0x28')]);return _0x2fad83(_0x37a2e1[_0x39c0('0x26')][_0x39c0('0x28')]);}logger[_0x39c0('0x26')](_0x39c0('0x22'),_0x464817,_0x37a2e1[_0x39c0('0x26')][_0x39c0('0x28')]);return _0x121172(_0x37a2e1['error'][_0x39c0('0x28')]);}else{logger[_0x39c0('0x21')](_0x39c0('0x22'),_0x464817,_0x39c0('0x23'));_0x121172(_0x37a2e1['result'][_0x39c0('0x28')]);}})[_0x39c0('0x29')](function(_0x5764ac){logger['error']('ChatQueue,\x20%s,\x20%s',_0x464817,_0x5764ac);_0x2fad83(_0x5764ac);});});}function respondWithStatusCode(_0x572fc6,_0x4c305e){_0x4c305e=_0x4c305e||0xcc;return function(_0x14883d){if(_0x14883d){return _0x572fc6[_0x39c0('0x2a')](_0x4c305e);}return _0x572fc6['status'](_0x4c305e)[_0x39c0('0x2b')]();};}function respondWithResult(_0xc2a7b2,_0x183952){_0x183952=_0x183952||0xc8;return function(_0x3d7b0b){if(_0x3d7b0b){return _0xc2a7b2[_0x39c0('0x2c')](_0x183952)[_0x39c0('0x2d')](_0x3d7b0b);}};}function respondWithFilteredResult(_0x3500c3,_0x463252){return function(_0x4d3e7d){if(_0x4d3e7d){var _0x252715=typeof _0x463252['offset']==='undefined'&&typeof _0x463252[_0x39c0('0x2e')]===_0x39c0('0x2f');var _0x2bcb82=_0x4d3e7d[_0x39c0('0x30')];var _0x41123a=_0x252715?0x0:_0x463252[_0x39c0('0x31')];var _0x39c3f2=_0x252715?_0x4d3e7d[_0x39c0('0x30')]:_0x463252[_0x39c0('0x31')]+_0x463252['limit'];var _0x582d41;if(_0x39c3f2>=_0x2bcb82){_0x39c3f2=_0x2bcb82;_0x582d41=0xc8;}else{_0x582d41=0xce;}_0x3500c3[_0x39c0('0x2c')](_0x582d41);return _0x3500c3[_0x39c0('0x32')](_0x39c0('0x33'),_0x41123a+'-'+_0x39c3f2+'/'+_0x2bcb82)['json'](_0x4d3e7d);}return null;};}function patchUpdates(_0x38f44c){return function(_0xc1e33b){try{jsonpatch['apply'](_0xc1e33b,_0x38f44c,!![]);}catch(_0x5cf583){return BPromise[_0x39c0('0x34')](_0x5cf583);}return _0xc1e33b[_0x39c0('0x35')]();};}function saveUpdates(_0x4ad474,_0x4214f6){return function(_0x3c6083){if(_0x3c6083){return _0x3c6083['update'](_0x4ad474)[_0x39c0('0x36')](function(_0x57cc24){return _0x57cc24;});}return null;};}function removeEntity(_0x2e9712,_0x44691d){return function(_0x16551b){if(_0x16551b){return _0x16551b[_0x39c0('0x37')]()[_0x39c0('0x36')](function(){var _0x22b8f0=_0x16551b[_0x39c0('0x38')]({'plain':!![]});var _0x5680a7='ChatQueues';return db[_0x39c0('0x39')][_0x39c0('0x37')]({'where':{'type':_0x5680a7,'resourceId':_0x22b8f0['id']}})['then'](function(){return _0x16551b;});})[_0x39c0('0x36')](function(){_0x2e9712[_0x39c0('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ae0f4,_0x591a5b){return function(_0x4d0756){if(!_0x4d0756){_0x4ae0f4[_0x39c0('0x2a')](0x194);}return _0x4d0756;};}function handleError(_0x1a7aac,_0x338de4){_0x338de4=_0x338de4||0x1f4;return function(_0x13261c){logger[_0x39c0('0x26')](_0x13261c['stack']);if(_0x13261c['name']){delete _0x13261c['name'];}_0x1a7aac['status'](_0x338de4)[_0x39c0('0x3a')](_0x13261c);};}exports[_0x39c0('0x3b')]=function(_0x3af533,_0x20f3c8){var _0x395ee7={},_0x21091a={},_0x179c1f={'count':0x0,'rows':[]};var _0x17ec62=_[_0x39c0('0x3c')](db[_0x39c0('0x3d')]['rawAttributes'],function(_0x20f24b){return{'name':_0x20f24b[_0x39c0('0x3e')],'type':_0x20f24b[_0x39c0('0x3f')][_0x39c0('0x40')]};});_0x21091a['model']=_[_0x39c0('0x3c')](_0x17ec62,_0x39c0('0x41'));_0x21091a[_0x39c0('0x42')]=_[_0x39c0('0x43')](_0x3af533[_0x39c0('0x42')]);_0x21091a[_0x39c0('0x44')]=_[_0x39c0('0x45')](_0x21091a[_0x39c0('0x46')],_0x21091a[_0x39c0('0x42')]);_0x395ee7[_0x39c0('0x47')]=_['intersection'](_0x21091a['model'],qs[_0x39c0('0x48')](_0x3af533['query'][_0x39c0('0x48')]));_0x395ee7[_0x39c0('0x47')]=_0x395ee7[_0x39c0('0x47')][_0x39c0('0x49')]?_0x395ee7[_0x39c0('0x47')]:_0x21091a[_0x39c0('0x46')];if(!_0x3af533[_0x39c0('0x42')][_0x39c0('0x4a')](_0x39c0('0x4b'))){_0x395ee7[_0x39c0('0x2e')]=qs[_0x39c0('0x2e')](_0x3af533['query'][_0x39c0('0x2e')]);_0x395ee7['offset']=qs[_0x39c0('0x31')](_0x3af533[_0x39c0('0x42')][_0x39c0('0x31')]);}_0x395ee7[_0x39c0('0x4c')]=qs[_0x39c0('0x4d')](_0x3af533['query'][_0x39c0('0x4d')]);_0x395ee7['where']=qs[_0x39c0('0x44')](_[_0x39c0('0x4e')](_0x3af533[_0x39c0('0x42')],_0x21091a['filters']),_0x17ec62);if(_0x3af533[_0x39c0('0x42')]['filter']){_0x395ee7[_0x39c0('0x4f')]=_['merge'](_0x395ee7['where'],{'$or':_[_0x39c0('0x3c')](_0x17ec62,function(_0x14c43a){if(_0x14c43a['type']!==_0x39c0('0x50')){var _0x1c488b={};_0x1c488b[_0x14c43a[_0x39c0('0x41')]]={'$like':'%'+_0x3af533[_0x39c0('0x42')]['filter']+'%'};return _0x1c488b;}})});}_0x395ee7=_[_0x39c0('0x51')]({},_0x395ee7,_0x3af533[_0x39c0('0x52')]);var _0x3ea852={'where':_0x395ee7[_0x39c0('0x4f')]};return db[_0x39c0('0x3d')][_0x39c0('0x30')](_0x3ea852)[_0x39c0('0x36')](function(_0x541355){_0x179c1f[_0x39c0('0x30')]=_0x541355;if(_0x3af533['query'][_0x39c0('0x53')]){_0x395ee7['include']=[{'all':!![]}];}return db[_0x39c0('0x3d')]['findAll'](_0x395ee7);})[_0x39c0('0x36')](function(_0x302076){_0x179c1f[_0x39c0('0x54')]=_0x302076;return _0x179c1f;})[_0x39c0('0x36')](respondWithFilteredResult(_0x20f3c8,_0x395ee7))['catch'](handleError(_0x20f3c8,null));};exports[_0x39c0('0x55')]=function(_0x3d5236,_0x279bfb){var _0x55f5f5={'raw':!![],'where':{'id':_0x3d5236[_0x39c0('0x56')]['id']}},_0x1cdb75={};_0x1cdb75[_0x39c0('0x46')]=_[_0x39c0('0x43')](db['ChatQueue'][_0x39c0('0x57')]);_0x1cdb75[_0x39c0('0x42')]=_[_0x39c0('0x43')](_0x3d5236[_0x39c0('0x42')]);_0x1cdb75[_0x39c0('0x44')]=_[_0x39c0('0x45')](_0x1cdb75[_0x39c0('0x46')],_0x1cdb75[_0x39c0('0x42')]);_0x55f5f5[_0x39c0('0x47')]=_['intersection'](_0x1cdb75[_0x39c0('0x46')],qs[_0x39c0('0x48')](_0x3d5236[_0x39c0('0x42')][_0x39c0('0x48')]));_0x55f5f5[_0x39c0('0x47')]=_0x55f5f5[_0x39c0('0x47')][_0x39c0('0x49')]?_0x55f5f5[_0x39c0('0x47')]:_0x1cdb75['model'];if(_0x3d5236[_0x39c0('0x42')][_0x39c0('0x53')]){_0x55f5f5['include']=[{'all':!![]}];}_0x55f5f5=_['merge']({},_0x55f5f5,_0x3d5236['options']);return db[_0x39c0('0x3d')]['find'](_0x55f5f5)['then'](handleEntityNotFound(_0x279bfb,null))[_0x39c0('0x36')](respondWithResult(_0x279bfb,null))[_0x39c0('0x29')](handleError(_0x279bfb,null));};exports['create']=function(_0x16a00b,_0x462371){return db['ChatQueue']['create'](_0x16a00b[_0x39c0('0x58')],{})[_0x39c0('0x36')](function(_0x441841){var _0x1fd1fd=_0x16a00b['user'][_0x39c0('0x38')]({'plain':!![]});if(!_0x1fd1fd)throw new Error(_0x39c0('0x59'));if(_0x1fd1fd[_0x39c0('0x5a')]===_0x39c0('0x5b')){var _0x364371=_0x441841[_0x39c0('0x38')]({'plain':!![]});var _0x16ef35=_0x39c0('0x5c');return db[_0x39c0('0x5d')]['find']({'where':{'name':_0x16ef35,'userProfileId':_0x1fd1fd[_0x39c0('0x5e')]},'raw':!![]})[_0x39c0('0x36')](function(_0x3e6d56){if(_0x3e6d56&&_0x3e6d56['autoAssociation']===0x0){return db[_0x39c0('0x39')]['create']({'name':_0x364371[_0x39c0('0x41')],'resourceId':_0x364371['id'],'type':_0x3e6d56[_0x39c0('0x41')],'sectionId':_0x3e6d56['id']},{})[_0x39c0('0x36')](function(){return _0x441841;});}else{return _0x441841;}})[_0x39c0('0x29')](function(_0x135a5e){logger[_0x39c0('0x26')](_0x39c0('0x5f'),_0x135a5e);throw _0x135a5e;});}return _0x441841;})[_0x39c0('0x36')](respondWithResult(_0x462371,0xc9))[_0x39c0('0x29')](handleError(_0x462371,null));};exports[_0x39c0('0x60')]=function(_0x5c0b74,_0x5bb8a6){if(_0x5c0b74[_0x39c0('0x58')]['id']){delete _0x5c0b74['body']['id'];}return db[_0x39c0('0x3d')][_0x39c0('0x61')]({'where':{'id':_0x5c0b74[_0x39c0('0x56')]['id']}})[_0x39c0('0x36')](handleEntityNotFound(_0x5bb8a6,null))[_0x39c0('0x36')](saveUpdates(_0x5c0b74[_0x39c0('0x58')],null))[_0x39c0('0x36')](respondWithResult(_0x5bb8a6,null))[_0x39c0('0x29')](handleError(_0x5bb8a6,null));};exports[_0x39c0('0x37')]=function(_0x505b26,_0x1fc26e){return db['ChatQueue'][_0x39c0('0x61')]({'where':{'id':_0x505b26[_0x39c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x1fc26e,null))[_0x39c0('0x36')](removeEntity(_0x1fc26e,null))[_0x39c0('0x29')](handleError(_0x1fc26e,null));};exports[_0x39c0('0x62')]=function(_0x18fe8d,_0x48cbe1){return db[_0x39c0('0x3d')][_0x39c0('0x62')]()[_0x39c0('0x36')](respondWithResult(_0x48cbe1,null))[_0x39c0('0x29')](handleError(_0x48cbe1,null));};exports[_0x39c0('0x63')]=function(_0x244fa1,_0x440539,_0x2eaef3){var _0x14f465={'raw':!![],'where':{}},_0x4a72b7={},_0x3a860b;return db['ChatQueue']['findOne']({'where':{'id':_0x244fa1[_0x39c0('0x56')]['id']}})[_0x39c0('0x36')](handleEntityNotFound(_0x440539,null))[_0x39c0('0x36')](function(_0x38f288){if(_0x38f288){_0x3a860b=_0x38f288[_0x39c0('0x38')]({'plain':!![]});_0x4a72b7[_0x39c0('0x46')]=_[_0x39c0('0x43')](db['UserChatQueue'][_0x39c0('0x57')]);_0x4a72b7['query']=_[_0x39c0('0x43')](_0x244fa1['query']);_0x4a72b7[_0x39c0('0x44')]=_['intersection'](_0x4a72b7[_0x39c0('0x46')],_0x4a72b7['query']);_0x14f465[_0x39c0('0x47')]=_['intersection'](_0x4a72b7[_0x39c0('0x46')],qs[_0x39c0('0x48')](_0x244fa1[_0x39c0('0x42')][_0x39c0('0x48')]));_0x14f465[_0x39c0('0x47')]=_0x14f465['attributes'][_0x39c0('0x49')]?_0x14f465['attributes']:_0x4a72b7[_0x39c0('0x46')];if(!_0x244fa1['query']['hasOwnProperty'](_0x39c0('0x4b'))){_0x14f465['limit']=qs[_0x39c0('0x2e')](_0x244fa1[_0x39c0('0x42')][_0x39c0('0x2e')]);_0x14f465[_0x39c0('0x31')]=qs[_0x39c0('0x31')](_0x244fa1[_0x39c0('0x42')][_0x39c0('0x31')]);}_0x14f465[_0x39c0('0x4c')]=qs[_0x39c0('0x4d')](_0x244fa1['query'][_0x39c0('0x4d')]);_0x14f465['where']=qs[_0x39c0('0x44')](_[_0x39c0('0x4e')](_0x244fa1[_0x39c0('0x42')],_0x4a72b7[_0x39c0('0x44')]));_0x14f465[_0x39c0('0x4f')]['ChatQueueId']=_0x38f288['id'];if(_0x244fa1['query'][_0x39c0('0x64')]){_0x14f465['where']=_[_0x39c0('0x51')](_0x14f465[_0x39c0('0x4f')],{'$or':_['map'](_0x14f465[_0x39c0('0x47')],function(_0x120b13){var _0xa34f30={};_0xa34f30[_0x120b13]={'$like':'%'+_0x244fa1['query'][_0x39c0('0x64')]+'%'};return _0xa34f30;})});}_0x14f465=_[_0x39c0('0x51')]({},_0x14f465,_0x244fa1[_0x39c0('0x52')]);return db[_0x39c0('0x65')][_0x39c0('0x66')](_0x14f465);}})[_0x39c0('0x36')](function(_0x59c349){if(_0x59c349){return db[_0x39c0('0x67')][_0x39c0('0x68')]({'where':{'id':_[_0x39c0('0x3c')](_0x59c349,_0x39c0('0x69')),'role':_0x39c0('0x6a')},'attributes':['id',_0x39c0('0x41'),_0x39c0('0x6b'),_0x39c0('0x6c'),_0x39c0('0x6d')]});}})[_0x39c0('0x36')](function(_0x5517f9){if(_0x5517f9){return{'count':_0x5517f9[_0x39c0('0x30')],'rows':_['map'](_0x5517f9[_0x39c0('0x54')],function(_0x20859c){return{'membername':_0x20859c['name'],'UserId':_0x20859c['id'],'queue_name':_0x3a860b[_0x39c0('0x41')],'ChatQueueId':_0x3a860b['id'],'interface':util[_0x39c0('0x6e')](_0x39c0('0x6f'),'SIP',_0x20859c[_0x39c0('0x41')]),'penalty':0x0,'paused':_0x20859c['chatPause'],'createdAt':_0x20859c[_0x39c0('0x6d')],'updatedAt':_0x20859c[_0x39c0('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x39c0('0x36')](respondWithFilteredResult(_0x440539,_0x14f465))[_0x39c0('0x29')](handleError(_0x440539,null));};exports[_0x39c0('0x70')]=function(_0x112a9b,_0x21e72e,_0x1c5f48){var _0x5f3042={};var _0x259b59={};var _0x2ab472;var _0x12d8b3;return db[_0x39c0('0x3d')][_0x39c0('0x71')]({'where':{'id':_0x112a9b[_0x39c0('0x56')]['id']}})[_0x39c0('0x36')](handleEntityNotFound(_0x21e72e,null))['then'](function(_0x161795){if(_0x161795){_0x2ab472=_0x161795;_0x259b59[_0x39c0('0x46')]=_[_0x39c0('0x43')](db[_0x39c0('0x72')][_0x39c0('0x57')]);_0x259b59[_0x39c0('0x42')]=_[_0x39c0('0x43')](_0x112a9b[_0x39c0('0x42')]);_0x259b59[_0x39c0('0x44')]=_[_0x39c0('0x45')](_0x259b59['model'],_0x259b59['query']);_0x5f3042['attributes']=_[_0x39c0('0x45')](_0x259b59[_0x39c0('0x46')],qs['fields'](_0x112a9b[_0x39c0('0x42')][_0x39c0('0x48')]));_0x5f3042['attributes']=_0x5f3042['attributes'][_0x39c0('0x49')]?_0x5f3042[_0x39c0('0x47')]:_0x259b59['model'];_0x5f3042[_0x39c0('0x4c')]=qs[_0x39c0('0x4d')](_0x112a9b[_0x39c0('0x42')][_0x39c0('0x4d')]);_0x5f3042['where']=qs[_0x39c0('0x44')](_[_0x39c0('0x4e')](_0x112a9b['query'],_0x259b59[_0x39c0('0x44')]));if(_0x112a9b[_0x39c0('0x42')][_0x39c0('0x64')]){_0x5f3042[_0x39c0('0x4f')]=_[_0x39c0('0x51')](_0x5f3042['where'],{'$or':_[_0x39c0('0x3c')](_0x5f3042['attributes'],function(_0x355aca){var _0x2401a4={};_0x2401a4[_0x355aca]={'$like':'%'+_0x112a9b[_0x39c0('0x42')][_0x39c0('0x64')]+'%'};return _0x2401a4;})});}_0x5f3042=_['merge']({},_0x5f3042,_0x112a9b['options']);return _0x2ab472[_0x39c0('0x70')](_0x5f3042);}})[_0x39c0('0x36')](function(_0x180482){if(_0x180482){_0x12d8b3=_0x180482['length'];if(!_0x112a9b['query'][_0x39c0('0x4a')](_0x39c0('0x4b'))){_0x5f3042[_0x39c0('0x2e')]=qs['limit'](_0x112a9b[_0x39c0('0x42')][_0x39c0('0x2e')]);_0x5f3042['offset']=qs['offset'](_0x112a9b['query']['offset']);}return _0x2ab472['getTeams'](_0x5f3042);}})[_0x39c0('0x36')](function(_0x1bd852){if(_0x1bd852){return _0x1bd852?{'count':_0x12d8b3,'rows':_0x1bd852}:null;}})['then'](respondWithResult(_0x21e72e,null))[_0x39c0('0x29')](handleError(_0x21e72e,null));};exports[_0x39c0('0x73')]=function(_0x15d3eb,_0x225ba4,_0x516275){var _0x1c2762=_0x15d3eb[_0x39c0('0x58')][_0x39c0('0x74')];return db[_0x39c0('0x72')]['findAll']({'where':{'id':_0x1c2762},'attributes':['id'],'include':[{'model':db[_0x39c0('0x67')],'as':'Agents','attributes':['id','name',_0x39c0('0x75'),_0x39c0('0x76'),_0x39c0('0x77')],'raw':!![]}]})['then'](function(_0x294917){if(_0x294917){var _0x2145a9=_[_0x39c0('0x78')](_0x294917,function(_0x392084){var _0x4bc1be=_0x392084[_0x39c0('0x38')]({'plain':!![]});return _0x4bc1be[_0x39c0('0x79')];});return db[_0x39c0('0x3d')][_0x39c0('0x61')]({'where':{'id':_0x15d3eb['params']['id']}})[_0x39c0('0x36')](function(_0x370b64){return db[_0x39c0('0x7a')][_0x39c0('0x7b')](function(_0x403f0d){return _0x370b64[_0x39c0('0x73')](_0x1c2762,{'transaction':_0x403f0d})[_0x39c0('0x36')](function(){return BPromise['each'](_0x2145a9,function(_0x485098){return db[_0x39c0('0x65')][_0x39c0('0x7c')]({'where':{'UserId':_0x485098['id'],'ChatQueueId':_0x15d3eb[_0x39c0('0x56')]['id']},'transaction':_0x403f0d});});})[_0x39c0('0x36')](function(){_0x2145a9[_0x39c0('0x7d')](function(_0x44c65a){socket[_0x39c0('0x7e')]('userChatQueue:save',{'UserId':_0x44c65a['id'],'ChatQueueId':_0x370b64['id']});});});});});}})[_0x39c0('0x36')](respondWithStatusCode(_0x225ba4,null))['catch'](handleError(_0x225ba4,null));};exports['removeTeams']=function(_0x51baa6,_0x485494,_0x1042d9){return db[_0x39c0('0x72')][_0x39c0('0x66')]({'where':{'id':_0x51baa6['query'][_0x39c0('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x39c0('0x79'),'attributes':['id'],'raw':!![]}]})[_0x39c0('0x36')](handleEntityNotFound(_0x485494,null))['then'](function(_0x50ff2d){var _0x1d6d43=_[_0x39c0('0x3c')](_0x50ff2d,'id');var _0x182277=[];var _0x561a1b=[];var _0x24c30f=squel[_0x39c0('0x7f')]();_0x24c30f[_0x39c0('0x80')](_0x39c0('0x81'))[_0x39c0('0x82')](_0x39c0('0x83'),'tq')[_0x39c0('0x84')](_0x39c0('0x85'),'ut',_0x39c0('0x86'))[_0x39c0('0x4f')](_0x39c0('0x87'),_0x51baa6['params']['id']);for(var _0x1313af=0x0;_0x1313af<_0x50ff2d[_0x39c0('0x49')];_0x1313af+=0x1){let _0x273bcd=_0x50ff2d[_0x1313af];for(var _0x19796d=0x0;_0x19796d<_0x273bcd[_0x39c0('0x79')][_0x39c0('0x49')];_0x19796d+=0x1){let _0x728be9=_0x273bcd[_0x39c0('0x79')][_0x19796d];var _0x29aaab=_0x24c30f['clone']();_0x29aaab[_0x39c0('0x4f')](_0x39c0('0x88'),_0x728be9['id']);_0x561a1b[_0x39c0('0x89')](db[_0x39c0('0x7a')][_0x39c0('0x42')](_0x29aaab['toString'](),{'type':db['sequelize'][_0x39c0('0x8a')][_0x39c0('0x8b')]})[_0x39c0('0x36')](function(_0x236a26){if(_0x236a26[_0x39c0('0x49')]===0x1){return _0x728be9['id'];}else{var _0xfb2169=_[_0x39c0('0x8c')](_['map'](_0x236a26,_0x39c0('0x8d')),function(_0x146d27){return _[_0x39c0('0x8e')](_0x1d6d43,_0x146d27);});if(_0xfb2169){return _0x728be9['id'];}}}));}}return BPromise[_0x39c0('0x8f')](_0x561a1b)['then'](function(_0x3e477f){_0x182277=_(_0x182277)[_0x39c0('0x90')](_0x3e477f)[_0x39c0('0x91')]()[_0x39c0('0x92')]();return db['ChatQueue'][_0x39c0('0x61')]({'where':{'id':_0x51baa6['params']['id']}})[_0x39c0('0x36')](function(_0x289574){return db[_0x39c0('0x7a')]['transaction'](function(_0x50b342){return _0x289574['removeTeams'](_0x51baa6['query']['ids'],{'transaction':_0x50b342})[_0x39c0('0x36')](function(){if(!_[_0x39c0('0x93')](_0x182277)){return _0x289574[_0x39c0('0x94')](_0x182277,{'transaction':_0x50b342});}})[_0x39c0('0x36')](function(){_0x182277[_0x39c0('0x7d')](function(_0xe6d209){socket['emit'](_0x39c0('0x95'),{'UserId':_0xe6d209,'ChatQueueId':_0x289574['id']});});});});});});})[_0x39c0('0x36')](respondWithStatusCode(_0x485494,null))[_0x39c0('0x29')](handleError(_0x485494,null));};exports[_0x39c0('0x96')]=function(_0x1c8e8d,_0x467b9f,_0x25ba6f){return db[_0x39c0('0x3d')][_0x39c0('0x61')]({'where':{'id':_0x1c8e8d['params']['id']}})['then'](handleEntityNotFound(_0x467b9f,null))['then'](function(_0x4b25fa){if(_0x4b25fa){return _0x4b25fa[_0x39c0('0x96')](_0x1c8e8d[_0x39c0('0x58')]['ids'],_[_0x39c0('0x97')](_0x1c8e8d[_0x39c0('0x58')],[_0x39c0('0x74'),'id'])||{})['spread'](function(_0x564b45){for(var _0x4fa2da=0x0;_0x4fa2da<_0x1c8e8d[_0x39c0('0x58')]['ids'][_0x39c0('0x49')];_0x4fa2da+=0x1){socket[_0x39c0('0x7e')](_0x39c0('0x98'),{'UserId':Number(_0x1c8e8d[_0x39c0('0x58')][_0x39c0('0x74')][_0x4fa2da]),'ChatQueueId':Number(_0x1c8e8d[_0x39c0('0x56')]['id'])});}return _0x564b45;});}})['then'](respondWithResult(_0x467b9f,null))[_0x39c0('0x29')](handleError(_0x467b9f,null));};exports[_0x39c0('0x94')]=function(_0x46b415,_0x349429,_0x44fe28){return db[_0x39c0('0x3d')][_0x39c0('0x61')]({'where':{'id':_0x46b415[_0x39c0('0x56')]['id']}})[_0x39c0('0x36')](handleEntityNotFound(_0x349429,null))[_0x39c0('0x36')](function(_0x52f377){if(_0x52f377){return _0x52f377[_0x39c0('0x94')](_0x46b415[_0x39c0('0x42')][_0x39c0('0x74')])[_0x39c0('0x36')](function(){if(_['isArray'](_0x46b415['query']['ids'])){for(var _0x183605=0x0;_0x183605<_0x46b415[_0x39c0('0x42')][_0x39c0('0x74')]['length'];_0x183605+=0x1){socket[_0x39c0('0x7e')](_0x39c0('0x95'),{'UserId':Number(_0x46b415['query'][_0x39c0('0x74')][_0x183605]),'ChatQueueId':Number(_0x46b415['params']['id'])});}}else{socket[_0x39c0('0x7e')](_0x39c0('0x95'),{'UserId':Number(_0x46b415[_0x39c0('0x42')][_0x39c0('0x74')]),'ChatQueueId':Number(_0x46b415[_0x39c0('0x56')]['id'])});}});}})[_0x39c0('0x36')](respondWithStatusCode(_0x349429,null))['catch'](handleError(_0x349429,null));};exports[_0x39c0('0x99')]=function(_0x4e41ae,_0x4f199b,_0x5403d4){var _0x15d48a={};var _0x41dc7e={};var _0x5dee3e;var _0x2dcfdc;return db[_0x39c0('0x3d')][_0x39c0('0x71')]({'where':{'id':_0x4e41ae[_0x39c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x4f199b,null))[_0x39c0('0x36')](function(_0x2730be){if(_0x2730be){_0x5dee3e=_0x2730be;_0x41dc7e[_0x39c0('0x46')]=_[_0x39c0('0x43')](db['User']['rawAttributes']);_0x41dc7e[_0x39c0('0x42')]=_[_0x39c0('0x43')](_0x4e41ae[_0x39c0('0x42')]);_0x41dc7e['filters']=_[_0x39c0('0x45')](_0x41dc7e[_0x39c0('0x46')],_0x41dc7e[_0x39c0('0x42')]);_0x15d48a[_0x39c0('0x47')]=_[_0x39c0('0x45')](_0x41dc7e[_0x39c0('0x46')],qs['fields'](_0x4e41ae[_0x39c0('0x42')][_0x39c0('0x48')]));_0x15d48a[_0x39c0('0x47')]=_0x15d48a['attributes'][_0x39c0('0x49')]?_0x15d48a[_0x39c0('0x47')]:_0x41dc7e['model'];_0x15d48a['order']=qs[_0x39c0('0x4d')](_0x4e41ae[_0x39c0('0x42')]['sort']);_0x15d48a['where']=qs[_0x39c0('0x44')](_['pick'](_0x4e41ae[_0x39c0('0x42')],_0x41dc7e['filters']));if(_0x4e41ae[_0x39c0('0x42')]['filter']){_0x15d48a[_0x39c0('0x4f')]=_[_0x39c0('0x51')](_0x15d48a[_0x39c0('0x4f')],{'$or':_[_0x39c0('0x3c')](_0x15d48a['attributes'],function(_0x420d6c){var _0x140cf9={};_0x140cf9[_0x420d6c]={'$like':'%'+_0x4e41ae[_0x39c0('0x42')][_0x39c0('0x64')]+'%'};return _0x140cf9;})});}_0x15d48a=_[_0x39c0('0x51')]({},_0x15d48a,_0x4e41ae[_0x39c0('0x52')]);return _0x5dee3e[_0x39c0('0x99')](_0x15d48a);}})['then'](function(_0xf07bf4){if(_0xf07bf4){_0x2dcfdc=_0xf07bf4[_0x39c0('0x49')];if(!_0x4e41ae[_0x39c0('0x42')][_0x39c0('0x4a')]('nolimit')){_0x15d48a['limit']=qs[_0x39c0('0x2e')](_0x4e41ae[_0x39c0('0x42')][_0x39c0('0x2e')]);_0x15d48a[_0x39c0('0x31')]=qs[_0x39c0('0x31')](_0x4e41ae[_0x39c0('0x42')]['offset']);}return _0x5dee3e[_0x39c0('0x99')](_0x15d48a);}})[_0x39c0('0x36')](function(_0xfb8b8c){if(_0xfb8b8c){return _0xfb8b8c?{'count':_0x2dcfdc,'rows':_0xfb8b8c}:null;}})['then'](respondWithResult(_0x4f199b,null))['catch'](handleError(_0x4f199b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 40b5a49..15802dc 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 _0x2e1a=['update','remove','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0x453f54,_0x28ebf2){var _0x46f6cc=function(_0xa208d4){while(--_0xa208d4){_0x453f54['push'](_0x453f54['shift']());}};_0x46f6cc(++_0x28ebf2);}(_0x2e1a,0xd6));var _0xa2e1=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x2e1a[_0x5cb1af];return _0x8d7940;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xa2e1('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa2e1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2e1('0x2'),'afterDestroy':_0xa2e1('0x3')};function emitEvent(_0x3e04cb){return function(_0x242e1b,_0x29ffd9,_0x230363){ChatQueueEvents[_0xa2e1('0x4')](_0x3e04cb+':'+_0x242e1b['id'],_0x242e1b);ChatQueueEvents['emit'](_0x3e04cb,_0x242e1b);_0x230363(null);};}for(var e in events){if(events[_0xa2e1('0x5')](e)){var event=events[e];ChatQueue[_0xa2e1('0x6')](e,emitEvent(event));}}module[_0xa2e1('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x7b0b=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x365977,_0x57b7ae){var _0x843665=function(_0x345a7c){while(--_0x345a7c){_0x365977['push'](_0x365977['shift']());}};_0x843665(++_0x57b7ae);}(_0x7b0b,0x1a1));var _0xb7b0=function(_0x46fc89,_0x240af8){_0x46fc89=_0x46fc89-0x0;var _0x765582=_0x7b0b[_0x46fc89];return _0x765582;};'use strict';var EventEmitter=require(_0xb7b0('0x0'));var ChatQueue=require(_0xb7b0('0x1'))['db'][_0xb7b0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb7b0('0x3')](0x0);var events={'afterCreate':_0xb7b0('0x4'),'afterUpdate':'update','afterDestroy':_0xb7b0('0x5')};function emitEvent(_0x367bd2){return function(_0x2e9ff4,_0x39e000,_0x4bb0b0){ChatQueueEvents['emit'](_0x367bd2+':'+_0x2e9ff4['id'],_0x2e9ff4);ChatQueueEvents['emit'](_0x367bd2,_0x2e9ff4);_0x4bb0b0(null);};}for(var e in events){if(events[_0xb7b0('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xb7b0('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c80aeda..b3c6b31 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 _0xc66a=['ChatQueue','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc66a,0x64));var _0xac66=function(_0x4b69dd,_0xc908d){_0x4b69dd=_0x4b69dd-0x0;var _0x40c7b0=_0xc66a[_0x4b69dd];return _0x40c7b0;};'use strict';var _=require(_0xac66('0x0'));var util=require('util');var logger=require(_0xac66('0x1'))(_0xac66('0x2'));var moment=require(_0xac66('0x3'));var BPromise=require(_0xac66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac66('0x5'));var rimraf=require(_0xac66('0x6'));var config=require(_0xac66('0x7'));var attributes=require(_0xac66('0x8'));module[_0xac66('0x9')]=function(_0x3a6063,_0x53698f){return _0x3a6063['define'](_0xac66('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d0a=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x564878,_0x32b7db){var _0x26e2fb=function(_0x3fa780){while(--_0x3fa780){_0x564878['push'](_0x564878['shift']());}};_0x26e2fb(++_0x32b7db);}(_0x6d0a,0x1b9));var _0xa6d0=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x6d0a[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xa6d0('0x0'));var util=require(_0xa6d0('0x1'));var logger=require('../../config/logger')(_0xa6d0('0x2'));var moment=require(_0xa6d0('0x3'));var BPromise=require(_0xa6d0('0x4'));var rp=require(_0xa6d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6d0('0x6'));var config=require(_0xa6d0('0x7'));var attributes=require(_0xa6d0('0x8'));module[_0xa6d0('0x9')]=function(_0x515149,_0x1fd26d){return _0x515149[_0xa6d0('0xa')](_0xa6d0('0xb'),attributes,{'tableName':_0xa6d0('0xc'),'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 16ddbc7..1aa8e0a 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 _0xbbce=['error','code','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3b13be,_0x2ea88c){var _0x2346d6=function(_0xd58e40){while(--_0xd58e40){_0x3b13be['push'](_0x3b13be['shift']());}};_0x2346d6(++_0x2ea88c);}(_0xbbce,0xb0));var _0xebbc=function(_0x28fe35,_0x6901ac){_0x28fe35=_0x28fe35-0x0;var _0x7d39b0=_0xbbce[_0x28fe35];return _0x7d39b0;};'use strict';var _=require(_0xebbc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xebbc('0x1'));var rs=require(_0xebbc('0x2'));var fs=require('fs');var Redis=require(_0xebbc('0x3'));var db=require(_0xebbc('0x4'))['db'];var utils=require(_0xebbc('0x5'));var logger=require(_0xebbc('0x6'))('rpc');var config=require(_0xebbc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xebbc('0x8')]({'port':0x232a});config[_0xebbc('0x9')]=_['defaults'](config[_0xebbc('0x9')],{'host':_0xebbc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebbc('0x9')]));require(_0xebbc('0xb'))[_0xebbc('0xc')](socket);function respondWithRpcPromise(_0xb98d32,_0x4cc8b0,_0x211abf){return new BPromise(function(_0x290b6f,_0x58fe71){return client[_0xebbc('0xd')](_0xb98d32,_0x211abf)[_0xebbc('0xe')](function(_0x4800ad){logger['info'](_0xebbc('0xf'),_0x4cc8b0,_0xebbc('0x10'));logger[_0xebbc('0x11')](_0xebbc('0x12'),_0x4cc8b0,_0xebbc('0x10'),JSON['stringify'](_0x4800ad));if(_0x4800ad[_0xebbc('0x13')]){if(_0x4800ad['error'][_0xebbc('0x14')]===0x1f4){logger[_0xebbc('0x13')](_0xebbc('0xf'),_0x4cc8b0,_0x4800ad[_0xebbc('0x13')][_0xebbc('0x15')]);return _0x58fe71(_0x4800ad['error'][_0xebbc('0x15')]);}logger['error'](_0xebbc('0xf'),_0x4cc8b0,_0x4800ad[_0xebbc('0x13')]['message']);return _0x290b6f(_0x4800ad[_0xebbc('0x13')]['message']);}else{logger[_0xebbc('0x16')]('ChatQueue,\x20%s,\x20%s',_0x4cc8b0,_0xebbc('0x10'));_0x290b6f(_0x4800ad[_0xebbc('0x17')][_0xebbc('0x15')]);}})['catch'](function(_0x1aa2a4){logger[_0xebbc('0x13')](_0xebbc('0xf'),_0x4cc8b0,_0x1aa2a4);_0x58fe71(_0x1aa2a4);});});}exports[_0xebbc('0x18')]=function(_0x5ebe7b){var _0x3bb1ae=this;return new Promise(function(_0x254599,_0x2c1843){return db[_0xebbc('0x19')][_0xebbc('0x1a')]({'raw':_0x5ebe7b[_0xebbc('0x1b')]?_0x5ebe7b['options'][_0xebbc('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ebe7b['options']?_0x5ebe7b[_0xebbc('0x1b')][_0xebbc('0x1d')]||null:null,'attributes':_0x5ebe7b[_0xebbc('0x1b')]?_0x5ebe7b[_0xebbc('0x1b')][_0xebbc('0x1e')]||null:null,'limit':_0x5ebe7b['options']?_0x5ebe7b['options'][_0xebbc('0x1f')]||null:null,'include':_0x5ebe7b['options']?_0x5ebe7b[_0xebbc('0x1b')][_0xebbc('0x20')]?_[_0xebbc('0x21')](_0x5ebe7b[_0xebbc('0x1b')][_0xebbc('0x20')],function(_0x3b3437){return{'model':db[_0x3b3437[_0xebbc('0x22')]],'as':_0x3b3437['as'],'attributes':_0x3b3437[_0xebbc('0x1e')],'include':_0x3b3437[_0xebbc('0x20')]?_['map'](_0x3b3437[_0xebbc('0x20')],function(_0x38e477){return{'model':db[_0x38e477[_0xebbc('0x22')]],'as':_0x38e477['as'],'attributes':_0x38e477[_0xebbc('0x1e')],'include':_0x38e477['include']?_['map'](_0x38e477['include'],function(_0x3ce6cd){return{'model':db[_0x3ce6cd[_0xebbc('0x22')]],'as':_0x3ce6cd['as'],'attributes':_0x3ce6cd[_0xebbc('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f6049){logger[_0xebbc('0x16')](_0xebbc('0x18'),_0x5ebe7b);logger[_0xebbc('0x11')]('GetChatQueue',_0x5ebe7b,JSON[_0xebbc('0x23')](_0x3f6049));_0x254599(_0x3f6049);})[_0xebbc('0x24')](function(_0x43f30a){logger['error'](_0xebbc('0x18'),_0x43f30a[_0xebbc('0x15')],_0x5ebe7b);_0x2c1843(_0x3bb1ae[_0xebbc('0x13')](0x1f4,_0x43f30a['message']));});});};exports[_0xebbc('0x25')]=function(_0x73ee0e){var _0xff9485=this;return new Promise(function(_0x3eff35,_0x18f293){return db[_0xebbc('0x19')][_0xebbc('0x26')]({'raw':_0x73ee0e[_0xebbc('0x1b')]?_0x73ee0e[_0xebbc('0x1b')][_0xebbc('0x1c')]===undefined?!![]:![]:!![],'where':_0x73ee0e['options']?_0x73ee0e[_0xebbc('0x1b')][_0xebbc('0x1d')]||null:null,'attributes':_0x73ee0e[_0xebbc('0x1b')]?_0x73ee0e[_0xebbc('0x1b')][_0xebbc('0x1e')]||null:null,'include':_0x73ee0e[_0xebbc('0x1b')]?_0x73ee0e['options']['include']?_[_0xebbc('0x21')](_0x73ee0e['options']['include'],function(_0x4c0327){return{'model':db[_0x4c0327[_0xebbc('0x22')]],'as':_0x4c0327['as'],'attributes':_0x4c0327[_0xebbc('0x1e')],'include':_0x4c0327[_0xebbc('0x20')]?_['map'](_0x4c0327[_0xebbc('0x20')],function(_0x2ed3c5){return{'model':db[_0x2ed3c5[_0xebbc('0x22')]],'as':_0x2ed3c5['as'],'attributes':_0x2ed3c5['attributes'],'include':_0x2ed3c5[_0xebbc('0x20')]?_['map'](_0x2ed3c5['include'],function(_0x2eb3b2){return{'model':db[_0x2eb3b2['model']],'as':_0x2eb3b2['as'],'attributes':_0x2eb3b2[_0xebbc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xebbc('0xe')](function(_0x1d2015){logger[_0xebbc('0x16')](_0xebbc('0x25'),_0x73ee0e);logger[_0xebbc('0x11')]('ShowChatQueue',_0x73ee0e,JSON[_0xebbc('0x23')](_0x1d2015));_0x3eff35(_0x1d2015);})[_0xebbc('0x24')](function(_0x5e4fc1){logger['error'](_0xebbc('0x25'),_0x5e4fc1['message'],_0x73ee0e);_0x18f293(_0xff9485[_0xebbc('0x13')](0x1f4,_0x5e4fc1['message']));});});}; \ No newline at end of file +var _0xa321=['options','raw','where','attributes','limit','include','map','model','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetChatQueue','findAll'];(function(_0x430e3c,_0x44f1ad){var _0x598a20=function(_0x4f498a){while(--_0x4f498a){_0x430e3c['push'](_0x430e3c['shift']());}};_0x598a20(++_0x44f1ad);}(_0xa321,0x9d));var _0x1a32=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0xa321[_0x2c1e7a];return _0xcacb4f;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});config['redis']=_[_0x1a32('0x9')](config[_0x1a32('0xa')],{'host':_0x1a32('0xb'),'port':0x18eb});var socket=require(_0x1a32('0xc'))(new Redis(config[_0x1a32('0xa')]));require('./chatQueue.socket')[_0x1a32('0xd')](socket);function respondWithRpcPromise(_0xa920f7,_0x5d034a,_0x14d287){return new BPromise(function(_0x3cf338,_0x1ce64e){return client[_0x1a32('0xe')](_0xa920f7,_0x14d287)[_0x1a32('0xf')](function(_0x31f14f){logger['info'](_0x1a32('0x10'),_0x5d034a,_0x1a32('0x11'));logger[_0x1a32('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5d034a,_0x1a32('0x11'),JSON[_0x1a32('0x13')](_0x31f14f));if(_0x31f14f[_0x1a32('0x14')]){if(_0x31f14f[_0x1a32('0x14')][_0x1a32('0x15')]===0x1f4){logger['error'](_0x1a32('0x10'),_0x5d034a,_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);return _0x1ce64e(_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);}logger[_0x1a32('0x14')]('ChatQueue,\x20%s,\x20%s',_0x5d034a,_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);return _0x3cf338(_0x31f14f['error'][_0x1a32('0x16')]);}else{logger[_0x1a32('0x17')](_0x1a32('0x10'),_0x5d034a,_0x1a32('0x11'));_0x3cf338(_0x31f14f[_0x1a32('0x18')][_0x1a32('0x16')]);}})[_0x1a32('0x19')](function(_0xf6093d){logger[_0x1a32('0x14')](_0x1a32('0x10'),_0x5d034a,_0xf6093d);_0x1ce64e(_0xf6093d);});});}exports[_0x1a32('0x1a')]=function(_0x4c1141){var _0x3231b2=this;return new Promise(function(_0x16896e,_0x235fd0){return db['ChatQueue'][_0x1a32('0x1b')]({'raw':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c1141['options']?_0x4c1141[_0x1a32('0x1c')][_0x1a32('0x1e')]||null:null,'attributes':_0x4c1141['options']?_0x4c1141[_0x1a32('0x1c')][_0x1a32('0x1f')]||null:null,'limit':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x20')]||null:null,'include':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x4c1141['options'][_0x1a32('0x21')],function(_0x4b3b33){return{'model':db[_0x4b3b33['model']],'as':_0x4b3b33['as'],'attributes':_0x4b3b33['attributes'],'include':_0x4b3b33['include']?_['map'](_0x4b3b33[_0x1a32('0x21')],function(_0x2309b3){return{'model':db[_0x2309b3[_0x1a32('0x23')]],'as':_0x2309b3['as'],'attributes':_0x2309b3[_0x1a32('0x1f')],'include':_0x2309b3[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x2309b3[_0x1a32('0x21')],function(_0x2edc3e){return{'model':db[_0x2edc3e['model']],'as':_0x2edc3e['as'],'attributes':_0x2edc3e[_0x1a32('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a32('0xf')](function(_0x37d660){logger[_0x1a32('0x17')](_0x1a32('0x1a'),_0x4c1141);logger[_0x1a32('0x12')](_0x1a32('0x1a'),_0x4c1141,JSON[_0x1a32('0x13')](_0x37d660));_0x16896e(_0x37d660);})[_0x1a32('0x19')](function(_0x54b122){logger[_0x1a32('0x14')](_0x1a32('0x1a'),_0x54b122['message'],_0x4c1141);_0x235fd0(_0x3231b2['error'](0x1f4,_0x54b122[_0x1a32('0x16')]));});});};exports['ShowChatQueue']=function(_0x5b9f13){var _0x1d874e=this;return new Promise(function(_0x4ef9fd,_0x59f1bc){return db['ChatQueue']['find']({'raw':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')]['where']||null:null,'attributes':_0x5b9f13['options']?_0x5b9f13[_0x1a32('0x1c')]['attributes']||null:null,'include':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x21')]?_['map'](_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x21')],function(_0x2121e2){return{'model':db[_0x2121e2[_0x1a32('0x23')]],'as':_0x2121e2['as'],'attributes':_0x2121e2[_0x1a32('0x1f')],'include':_0x2121e2[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x2121e2[_0x1a32('0x21')],function(_0x1b0b1e){return{'model':db[_0x1b0b1e['model']],'as':_0x1b0b1e['as'],'attributes':_0x1b0b1e[_0x1a32('0x1f')],'include':_0x1b0b1e[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x1b0b1e['include'],function(_0x20d393){return{'model':db[_0x20d393[_0x1a32('0x23')]],'as':_0x20d393['as'],'attributes':_0x20d393[_0x1a32('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a32('0xf')](function(_0x29dd8d){logger[_0x1a32('0x17')](_0x1a32('0x24'),_0x5b9f13);logger[_0x1a32('0x12')](_0x1a32('0x24'),_0x5b9f13,JSON[_0x1a32('0x13')](_0x29dd8d));_0x4ef9fd(_0x29dd8d);})[_0x1a32('0x19')](function(_0x3e26e8){logger[_0x1a32('0x14')](_0x1a32('0x24'),_0x3e26e8[_0x1a32('0x16')],_0x5b9f13);_0x59f1bc(_0x1d874e['error'](0x1f4,_0x3e26e8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e1c610e..99622b8 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 _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x5499b6,_0x2f478d){var _0x2291af=function(_0xc4cc64){while(--_0xc4cc64){_0x5499b6['push'](_0x5499b6['shift']());}};_0x2291af(++_0x2f478d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x4b84[_0x31b5b2];return _0x364f13;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file +var _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x4db639,_0x4ab091){var _0x4b2b8c=function(_0x5f3829){while(--_0x5f3829){_0x4db639['push'](_0x4db639['shift']());}};_0x4b2b8c(++_0x4ab091);}(_0x9b67,0xf6));var _0x79b6=function(_0x338129,_0xf3532e){_0x338129=_0x338129-0x0;var _0x5adc3f=_0x9b67[_0x338129];return _0x5adc3f;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 65ce7b1..25266fe 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd5d7ba,_0x27f4f3){var _0x2b9ed1=function(_0x5b9c13){while(--_0x5b9c13){_0xd5d7ba['push'](_0xd5d7ba['shift']());}};_0x2b9ed1(++_0x27f4f3);}(_0x008c,0x188));var _0xc008=function(_0x195f71,_0x40c2bd){_0x195f71=_0x195f71-0x0;var _0x3bb3bc=_0x008c[_0x195f71];return _0x3bb3bc;};'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')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);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('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1efc8c,_0x46e5ef){var _0x2f2ace=function(_0x1623a4){while(--_0x1623a4){_0x1efc8c['push'](_0x1efc8c['shift']());}};_0x2f2ace(++_0x46e5ef);}(_0x814b,0x1a2));var _0xb814=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x814b[_0x2d364e];return _0x1b9312;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5c74eea..7def7db 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 _0xe30f=['exports','DATE','moment','sequelize'];(function(_0x22385a,_0x215734){var _0x56893b=function(_0x40c6a2){while(--_0x40c6a2){_0x22385a['push'](_0x22385a['shift']());}};_0x56893b(++_0x215734);}(_0xe30f,0x11a));var _0xfe30=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe30f[_0x6c993a];return _0x27f547;};'use strict';var moment=require(_0xfe30('0x0'));var Sequelize=require(_0xfe30('0x1'));module[_0xfe30('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfe30('0x3')]},'acceptAt':{'type':Sequelize[_0xfe30('0x3')]},'exitAt':{'type':Sequelize[_0xfe30('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb0c2=['DATE','moment','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0c2,0x1aa));var _0x2b0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0c2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2b0c('0x0'));var Sequelize=require(_0x2b0c('0x1'));module[_0x2b0c('0x2')]={'uniqueid':{'type':Sequelize[_0x2b0c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2b0c('0x3')]},'joinAt':{'type':Sequelize[_0x2b0c('0x4')]},'leaveAt':{'type':Sequelize[_0x2b0c('0x4')]},'acceptAt':{'type':Sequelize[_0x2b0c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2b0c('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index ea4a83a..9098600 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 _0x27fb=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x3c818f,_0x32de51){var _0x1eb68d=function(_0x495d93){while(--_0x495d93){_0x3c818f['push'](_0x3c818f['shift']());}};_0x1eb68d(++_0x32de51);}(_0x27fb,0x1de));var _0xb27f=function(_0x3ab900,_0x852e94){_0x3ab900=_0x3ab900-0x0;var _0x240738=_0x27fb[_0x3ab900];return _0x240738;};'use strict';var emlformat=require(_0xb27f('0x0'));var rimraf=require(_0xb27f('0x1'));var zipdir=require(_0xb27f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb27f('0x3'));var moment=require('moment');var BPromise=require(_0xb27f('0x4'));var Mustache=require(_0xb27f('0x5'));var util=require(_0xb27f('0x6'));var path=require('path');var sox=require(_0xb27f('0x7'));var csv=require('to-csv');var ejs=require(_0xb27f('0x8'));var fs=require('fs');var fs_extra=require(_0xb27f('0x9'));var _=require(_0xb27f('0xa'));var squel=require(_0xb27f('0xb'));var crypto=require(_0xb27f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb27f('0xd'));var toCsv=require(_0xb27f('0xe'));var querystring=require('querystring');var Papa=require(_0xb27f('0xf'));var Redis=require(_0xb27f('0x10'));var authService=require(_0xb27f('0x11'));var qs=require(_0xb27f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb27f('0x13'));var logger=require(_0xb27f('0x14'))('api');var utils=require(_0xb27f('0x15'));var config=require(_0xb27f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb27f('0x17'))['db'];function respondWithStatusCode(_0x3c8e49,_0x3df902){_0x3df902=_0x3df902||0xcc;return function(_0x1971bb){if(_0x1971bb){return _0x3c8e49[_0xb27f('0x18')](_0x3df902);}return _0x3c8e49[_0xb27f('0x19')](_0x3df902)['end']();};}function respondWithResult(_0x434e15,_0x4c35a0){_0x4c35a0=_0x4c35a0||0xc8;return function(_0x1bc3b3){if(_0x1bc3b3){return _0x434e15['status'](_0x4c35a0)[_0xb27f('0x1a')](_0x1bc3b3);}};}function respondWithFilteredResult(_0x2c9fb9,_0x24dd7b){return function(_0x11155b){if(_0x11155b){var _0x33520b=typeof _0x24dd7b['offset']===_0xb27f('0x1b')&&typeof _0x24dd7b[_0xb27f('0x1c')]===_0xb27f('0x1b');var _0xfc4bd0=_0x11155b[_0xb27f('0x1d')];var _0xb126c6=_0x33520b?0x0:_0x24dd7b[_0xb27f('0x1e')];var _0x559cf4=_0x33520b?_0x11155b[_0xb27f('0x1d')]:_0x24dd7b[_0xb27f('0x1e')]+_0x24dd7b[_0xb27f('0x1c')];var _0x4b8be9;if(_0x559cf4>=_0xfc4bd0){_0x559cf4=_0xfc4bd0;_0x4b8be9=0xc8;}else{_0x4b8be9=0xce;}_0x2c9fb9[_0xb27f('0x19')](_0x4b8be9);return _0x2c9fb9[_0xb27f('0x1f')]('Content-Range',_0xb126c6+'-'+_0x559cf4+'/'+_0xfc4bd0)[_0xb27f('0x1a')](_0x11155b);}return null;};}function patchUpdates(_0x26090c){return function(_0x34b5ae){try{jsonpatch[_0xb27f('0x20')](_0x34b5ae,_0x26090c,!![]);}catch(_0x88a06d){return BPromise[_0xb27f('0x21')](_0x88a06d);}return _0x34b5ae[_0xb27f('0x22')]();};}function saveUpdates(_0x578c3d,_0x3a70c9){return function(_0x5303ac){if(_0x5303ac){return _0x5303ac[_0xb27f('0x23')](_0x578c3d)[_0xb27f('0x24')](function(_0x1e6abf){return _0x1e6abf;});}return null;};}function removeEntity(_0x56e3cd,_0xb68ac0){return function(_0x59b315){if(_0x59b315){return _0x59b315[_0xb27f('0x25')]()['then'](function(){_0x56e3cd['status'](0xcc)[_0xb27f('0x26')]();});}};}function handleEntityNotFound(_0x5b79c7,_0x41834b){return function(_0x20e85d){if(!_0x20e85d){_0x5b79c7['sendStatus'](0x194);}return _0x20e85d;};}function handleError(_0x915737,_0x3fd1a5){_0x3fd1a5=_0x3fd1a5||0x1f4;return function(_0x2bfae9){logger['error'](_0x2bfae9[_0xb27f('0x27')]);if(_0x2bfae9[_0xb27f('0x28')]){delete _0x2bfae9[_0xb27f('0x28')];}_0x915737[_0xb27f('0x19')](_0x3fd1a5)['send'](_0x2bfae9);};}exports[_0xb27f('0x29')]=function(_0x57cf52,_0xcf8c7a){var _0x443641={},_0x4ce30d={},_0x4caf5a={'count':0x0,'rows':[]};var _0x1adeec=_['map'](db[_0xb27f('0x2a')][_0xb27f('0x2b')],function(_0x13f2cc){return{'name':_0x13f2cc[_0xb27f('0x2c')],'type':_0x13f2cc['type'][_0xb27f('0x2d')]};});_0x4ce30d[_0xb27f('0x2e')]=_[_0xb27f('0x2f')](_0x1adeec,_0xb27f('0x28'));_0x4ce30d[_0xb27f('0x30')]=_[_0xb27f('0x31')](_0x57cf52[_0xb27f('0x30')]);_0x4ce30d[_0xb27f('0x32')]=_[_0xb27f('0x33')](_0x4ce30d[_0xb27f('0x2e')],_0x4ce30d[_0xb27f('0x30')]);_0x443641[_0xb27f('0x34')]=_[_0xb27f('0x33')](_0x4ce30d[_0xb27f('0x2e')],qs[_0xb27f('0x35')](_0x57cf52[_0xb27f('0x30')]['fields']));_0x443641['attributes']=_0x443641[_0xb27f('0x34')]['length']?_0x443641[_0xb27f('0x34')]:_0x4ce30d['model'];if(!_0x57cf52[_0xb27f('0x30')]['hasOwnProperty'](_0xb27f('0x36'))){_0x443641[_0xb27f('0x1c')]=qs[_0xb27f('0x1c')](_0x57cf52['query'][_0xb27f('0x1c')]);_0x443641[_0xb27f('0x1e')]=qs['offset'](_0x57cf52[_0xb27f('0x30')][_0xb27f('0x1e')]);}_0x443641[_0xb27f('0x37')]=qs[_0xb27f('0x38')](_0x57cf52[_0xb27f('0x30')]['sort']);_0x443641[_0xb27f('0x39')]=qs[_0xb27f('0x32')](_[_0xb27f('0x3a')](_0x57cf52[_0xb27f('0x30')],_0x4ce30d[_0xb27f('0x32')]),_0x1adeec);if(_0x57cf52['query'][_0xb27f('0x3b')]){_0x443641['where']=_[_0xb27f('0x3c')](_0x443641[_0xb27f('0x39')],{'$or':_[_0xb27f('0x2f')](_0x1adeec,function(_0x5a606f){if(_0x5a606f[_0xb27f('0x3d')]!==_0xb27f('0x3e')){var _0x4ab5de={};_0x4ab5de[_0x5a606f[_0xb27f('0x28')]]={'$like':'%'+_0x57cf52['query'][_0xb27f('0x3b')]+'%'};return _0x4ab5de;}})});}_0x443641=_['merge']({},_0x443641,_0x57cf52[_0xb27f('0x3f')]);var _0x47bd52={'where':_0x443641['where']};return db[_0xb27f('0x2a')][_0xb27f('0x1d')](_0x47bd52)[_0xb27f('0x24')](function(_0x2892a6){_0x4caf5a[_0xb27f('0x1d')]=_0x2892a6;if(_0x57cf52[_0xb27f('0x30')][_0xb27f('0x40')]){_0x443641[_0xb27f('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xb27f('0x42')](_0x443641);})[_0xb27f('0x24')](function(_0x3d6a2c){_0x4caf5a[_0xb27f('0x43')]=_0x3d6a2c;return _0x4caf5a;})[_0xb27f('0x24')](respondWithFilteredResult(_0xcf8c7a,_0x443641))[_0xb27f('0x44')](handleError(_0xcf8c7a,null));};exports[_0xb27f('0x45')]=function(_0x4823e8,_0x534826){var _0x31cbc2={'raw':!![],'where':{'id':_0x4823e8['params']['id']}},_0x5cd045={};_0x5cd045[_0xb27f('0x2e')]=_['keys'](db[_0xb27f('0x2a')]['rawAttributes']);_0x5cd045[_0xb27f('0x30')]=_[_0xb27f('0x31')](_0x4823e8[_0xb27f('0x30')]);_0x5cd045[_0xb27f('0x32')]=_[_0xb27f('0x33')](_0x5cd045[_0xb27f('0x2e')],_0x5cd045[_0xb27f('0x30')]);_0x31cbc2[_0xb27f('0x34')]=_[_0xb27f('0x33')](_0x5cd045[_0xb27f('0x2e')],qs[_0xb27f('0x35')](_0x4823e8[_0xb27f('0x30')][_0xb27f('0x35')]));_0x31cbc2[_0xb27f('0x34')]=_0x31cbc2[_0xb27f('0x34')][_0xb27f('0x46')]?_0x31cbc2['attributes']:_0x5cd045[_0xb27f('0x2e')];if(_0x4823e8['query'][_0xb27f('0x40')]){_0x31cbc2['include']=[{'all':!![]}];}_0x31cbc2=_['merge']({},_0x31cbc2,_0x4823e8[_0xb27f('0x3f')]);return db['ChatQueueReport'][_0xb27f('0x47')](_0x31cbc2)[_0xb27f('0x24')](handleEntityNotFound(_0x534826,null))[_0xb27f('0x24')](respondWithResult(_0x534826,null))[_0xb27f('0x44')](handleError(_0x534826,null));};exports['create']=function(_0x33ba5d,_0x56dc81){return db[_0xb27f('0x2a')][_0xb27f('0x48')](_0x33ba5d['body'],{})[_0xb27f('0x24')](respondWithResult(_0x56dc81,0xc9))[_0xb27f('0x44')](handleError(_0x56dc81,null));};exports['update']=function(_0xd9fc18,_0x2b0c77){if(_0xd9fc18[_0xb27f('0x49')]['id']){delete _0xd9fc18[_0xb27f('0x49')]['id'];}return db[_0xb27f('0x2a')][_0xb27f('0x47')]({'where':{'id':_0xd9fc18[_0xb27f('0x4a')]['id']}})[_0xb27f('0x24')](handleEntityNotFound(_0x2b0c77,null))['then'](saveUpdates(_0xd9fc18[_0xb27f('0x49')],null))[_0xb27f('0x24')](respondWithResult(_0x2b0c77,null))[_0xb27f('0x44')](handleError(_0x2b0c77,null));};exports[_0xb27f('0x25')]=function(_0x2867ff,_0x33d76f){return db[_0xb27f('0x2a')][_0xb27f('0x47')]({'where':{'id':_0x2867ff[_0xb27f('0x4a')]['id']}})[_0xb27f('0x24')](handleEntityNotFound(_0x33d76f,null))[_0xb27f('0x24')](removeEntity(_0x33d76f,null))['catch'](handleError(_0x33d76f,null));};exports['describe']=function(_0x1dfafa,_0x50f959){return db[_0xb27f('0x2a')][_0xb27f('0x4b')]()[_0xb27f('0x24')](respondWithResult(_0x50f959,null))['catch'](handleError(_0x50f959,null));}; \ No newline at end of file +var _0xeae8=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map'];(function(_0x858016,_0x15797d){var _0x489207=function(_0x18015e){while(--_0x18015e){_0x858016['push'](_0x858016['shift']());}};_0x489207(++_0x15797d);}(_0xeae8,0x66));var _0x8eae=function(_0x5c9939,_0x5f1deb){_0x5c9939=_0x5c9939-0x0;var _0x6ce458=_0xeae8[_0x5c9939];return _0x6ce458;};'use strict';var emlformat=require(_0x8eae('0x0'));var rimraf=require(_0x8eae('0x1'));var zipdir=require(_0x8eae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8eae('0x3'));var moment=require('moment');var BPromise=require(_0x8eae('0x4'));var Mustache=require('mustache');var util=require(_0x8eae('0x5'));var path=require(_0x8eae('0x6'));var sox=require(_0x8eae('0x7'));var csv=require(_0x8eae('0x8'));var ejs=require(_0x8eae('0x9'));var fs=require('fs');var fs_extra=require(_0x8eae('0xa'));var _=require(_0x8eae('0xb'));var squel=require(_0x8eae('0xc'));var crypto=require(_0x8eae('0xd'));var jsforce=require(_0x8eae('0xe'));var deskjs=require(_0x8eae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8eae('0x10'));var Redis=require(_0x8eae('0x11'));var authService=require(_0x8eae('0x12'));var qs=require(_0x8eae('0x13'));var as=require(_0x8eae('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8eae('0x15'));var config=require(_0x8eae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8eae('0x17'))['db'];function respondWithStatusCode(_0x50e569,_0xa29afd){_0xa29afd=_0xa29afd||0xcc;return function(_0x38d257){if(_0x38d257){return _0x50e569[_0x8eae('0x18')](_0xa29afd);}return _0x50e569[_0x8eae('0x19')](_0xa29afd)[_0x8eae('0x1a')]();};}function respondWithResult(_0x549d19,_0x16f24a){_0x16f24a=_0x16f24a||0xc8;return function(_0x39d8e7){if(_0x39d8e7){return _0x549d19[_0x8eae('0x19')](_0x16f24a)[_0x8eae('0x1b')](_0x39d8e7);}};}function respondWithFilteredResult(_0x1bf2f7,_0x1cec9f){return function(_0x28eae2){if(_0x28eae2){var _0x367dfe=typeof _0x1cec9f[_0x8eae('0x1c')]==='undefined'&&typeof _0x1cec9f['limit']==='undefined';var _0x29caea=_0x28eae2['count'];var _0x3db47b=_0x367dfe?0x0:_0x1cec9f[_0x8eae('0x1c')];var _0x386a97=_0x367dfe?_0x28eae2[_0x8eae('0x1d')]:_0x1cec9f[_0x8eae('0x1c')]+_0x1cec9f[_0x8eae('0x1e')];var _0x3af89b;if(_0x386a97>=_0x29caea){_0x386a97=_0x29caea;_0x3af89b=0xc8;}else{_0x3af89b=0xce;}_0x1bf2f7[_0x8eae('0x19')](_0x3af89b);return _0x1bf2f7[_0x8eae('0x1f')](_0x8eae('0x20'),_0x3db47b+'-'+_0x386a97+'/'+_0x29caea)['json'](_0x28eae2);}return null;};}function patchUpdates(_0x5b3c8a){return function(_0x1a74a5){try{jsonpatch[_0x8eae('0x21')](_0x1a74a5,_0x5b3c8a,!![]);}catch(_0x35c70b){return BPromise['reject'](_0x35c70b);}return _0x1a74a5[_0x8eae('0x22')]();};}function saveUpdates(_0x8e69cb,_0x51fa34){return function(_0x1dc612){if(_0x1dc612){return _0x1dc612[_0x8eae('0x23')](_0x8e69cb)['then'](function(_0x1b3b2f){return _0x1b3b2f;});}return null;};}function removeEntity(_0x597156,_0x171710){return function(_0x282fa5){if(_0x282fa5){return _0x282fa5[_0x8eae('0x24')]()[_0x8eae('0x25')](function(){_0x597156[_0x8eae('0x19')](0xcc)[_0x8eae('0x1a')]();});}};}function handleEntityNotFound(_0x14c0c5,_0x2fc7ec){return function(_0x386bec){if(!_0x386bec){_0x14c0c5['sendStatus'](0x194);}return _0x386bec;};}function handleError(_0x3143a9,_0xe9a3c5){_0xe9a3c5=_0xe9a3c5||0x1f4;return function(_0x141940){logger[_0x8eae('0x26')](_0x141940[_0x8eae('0x27')]);if(_0x141940[_0x8eae('0x28')]){delete _0x141940[_0x8eae('0x28')];}_0x3143a9['status'](_0xe9a3c5)[_0x8eae('0x29')](_0x141940);};}exports['index']=function(_0x342caf,_0xf4f03c){var _0x34f0c4={},_0x3f5d30={},_0x1aa3a0={'count':0x0,'rows':[]};var _0x541448=_['map'](db[_0x8eae('0x2a')][_0x8eae('0x2b')],function(_0x35c717){return{'name':_0x35c717[_0x8eae('0x2c')],'type':_0x35c717['type'][_0x8eae('0x2d')]};});_0x3f5d30[_0x8eae('0x2e')]=_[_0x8eae('0x2f')](_0x541448,_0x8eae('0x28'));_0x3f5d30[_0x8eae('0x30')]=_[_0x8eae('0x31')](_0x342caf[_0x8eae('0x30')]);_0x3f5d30[_0x8eae('0x32')]=_[_0x8eae('0x33')](_0x3f5d30[_0x8eae('0x2e')],_0x3f5d30[_0x8eae('0x30')]);_0x34f0c4[_0x8eae('0x34')]=_[_0x8eae('0x33')](_0x3f5d30[_0x8eae('0x2e')],qs[_0x8eae('0x35')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x35')]));_0x34f0c4[_0x8eae('0x34')]=_0x34f0c4[_0x8eae('0x34')][_0x8eae('0x36')]?_0x34f0c4[_0x8eae('0x34')]:_0x3f5d30['model'];if(!_0x342caf[_0x8eae('0x30')][_0x8eae('0x37')](_0x8eae('0x38'))){_0x34f0c4['limit']=qs[_0x8eae('0x1e')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x1e')]);_0x34f0c4[_0x8eae('0x1c')]=qs['offset'](_0x342caf[_0x8eae('0x30')]['offset']);}_0x34f0c4['order']=qs[_0x8eae('0x39')](_0x342caf[_0x8eae('0x30')][_0x8eae('0x39')]);_0x34f0c4[_0x8eae('0x3a')]=qs[_0x8eae('0x32')](_[_0x8eae('0x3b')](_0x342caf[_0x8eae('0x30')],_0x3f5d30['filters']),_0x541448);if(_0x342caf[_0x8eae('0x30')][_0x8eae('0x3c')]){_0x34f0c4['where']=_['merge'](_0x34f0c4['where'],{'$or':_[_0x8eae('0x2f')](_0x541448,function(_0x3b6bba){if(_0x3b6bba['type']!==_0x8eae('0x3d')){var _0x1a7539={};_0x1a7539[_0x3b6bba['name']]={'$like':'%'+_0x342caf[_0x8eae('0x30')][_0x8eae('0x3c')]+'%'};return _0x1a7539;}})});}_0x34f0c4=_[_0x8eae('0x3e')]({},_0x34f0c4,_0x342caf[_0x8eae('0x3f')]);var _0x139c25={'where':_0x34f0c4['where']};return db[_0x8eae('0x2a')][_0x8eae('0x1d')](_0x139c25)[_0x8eae('0x25')](function(_0x488b61){_0x1aa3a0[_0x8eae('0x1d')]=_0x488b61;if(_0x342caf[_0x8eae('0x30')]['includeAll']){_0x34f0c4[_0x8eae('0x40')]=[{'all':!![]}];}return db[_0x8eae('0x2a')][_0x8eae('0x41')](_0x34f0c4);})[_0x8eae('0x25')](function(_0x5923f7){_0x1aa3a0[_0x8eae('0x42')]=_0x5923f7;return _0x1aa3a0;})[_0x8eae('0x25')](respondWithFilteredResult(_0xf4f03c,_0x34f0c4))[_0x8eae('0x43')](handleError(_0xf4f03c,null));};exports[_0x8eae('0x44')]=function(_0x4e4f85,_0x985430){var _0x284dca={'raw':!![],'where':{'id':_0x4e4f85[_0x8eae('0x45')]['id']}},_0x1b5775={};_0x1b5775['model']=_[_0x8eae('0x31')](db['ChatQueueReport'][_0x8eae('0x2b')]);_0x1b5775['query']=_[_0x8eae('0x31')](_0x4e4f85[_0x8eae('0x30')]);_0x1b5775['filters']=_[_0x8eae('0x33')](_0x1b5775[_0x8eae('0x2e')],_0x1b5775[_0x8eae('0x30')]);_0x284dca[_0x8eae('0x34')]=_[_0x8eae('0x33')](_0x1b5775[_0x8eae('0x2e')],qs[_0x8eae('0x35')](_0x4e4f85[_0x8eae('0x30')][_0x8eae('0x35')]));_0x284dca['attributes']=_0x284dca[_0x8eae('0x34')]['length']?_0x284dca[_0x8eae('0x34')]:_0x1b5775[_0x8eae('0x2e')];if(_0x4e4f85[_0x8eae('0x30')][_0x8eae('0x46')]){_0x284dca['include']=[{'all':!![]}];}_0x284dca=_[_0x8eae('0x3e')]({},_0x284dca,_0x4e4f85[_0x8eae('0x3f')]);return db[_0x8eae('0x2a')][_0x8eae('0x47')](_0x284dca)[_0x8eae('0x25')](handleEntityNotFound(_0x985430,null))[_0x8eae('0x25')](respondWithResult(_0x985430,null))[_0x8eae('0x43')](handleError(_0x985430,null));};exports[_0x8eae('0x48')]=function(_0x324da8,_0x84a054){return db[_0x8eae('0x2a')]['create'](_0x324da8[_0x8eae('0x49')],{})[_0x8eae('0x25')](respondWithResult(_0x84a054,0xc9))['catch'](handleError(_0x84a054,null));};exports[_0x8eae('0x23')]=function(_0x490416,_0xb34032){if(_0x490416['body']['id']){delete _0x490416[_0x8eae('0x49')]['id'];}return db['ChatQueueReport'][_0x8eae('0x47')]({'where':{'id':_0x490416[_0x8eae('0x45')]['id']}})[_0x8eae('0x25')](handleEntityNotFound(_0xb34032,null))[_0x8eae('0x25')](saveUpdates(_0x490416[_0x8eae('0x49')],null))[_0x8eae('0x25')](respondWithResult(_0xb34032,null))[_0x8eae('0x43')](handleError(_0xb34032,null));};exports[_0x8eae('0x24')]=function(_0x2ba875,_0x3b9313){return db[_0x8eae('0x2a')]['find']({'where':{'id':_0x2ba875['params']['id']}})[_0x8eae('0x25')](handleEntityNotFound(_0x3b9313,null))[_0x8eae('0x25')](removeEntity(_0x3b9313,null))[_0x8eae('0x43')](handleError(_0x3b9313,null));};exports[_0x8eae('0x4a')]=function(_0xab5418,_0x476fe4){return db['ChatQueueReport'][_0x8eae('0x4a')]()[_0x8eae('0x25')](respondWithResult(_0x476fe4,null))[_0x8eae('0x43')](handleError(_0x476fe4,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 0f90807..ac67f98 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(_0x279c98,_0x775ca0){var _0x192a1c=function(_0x4c7c08){while(--_0x4c7c08){_0x279c98['push'](_0x279c98['shift']());}};_0x192a1c(++_0x775ca0);}(_0x757a,0xde));var _0xa757=function(_0x2dc1fa,_0x4ae9ec){_0x2dc1fa=_0x2dc1fa-0x0;var _0x29c8e4=_0x757a[_0x2dc1fa];return _0x29c8e4;};'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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5516d9,_0x550c39){var _0x4b97c7=function(_0x3e2c93){while(--_0x3e2c93){_0x5516d9['push'](_0x5516d9['shift']());}};_0x4b97c7(++_0x550c39);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9fb9910..03686d3 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 _0xe034=['error','message','info','request\x20sent','result','catch','CreateChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40dc7e,_0x322488){var _0x31f6d4=function(_0x2db5e2){while(--_0x2db5e2){_0x40dc7e['push'](_0x40dc7e['shift']());}};_0x31f6d4(++_0x322488);}(_0xe034,0x190));var _0x4e03=function(_0x2a5c70,_0x1d1dbb){_0x2a5c70=_0x2a5c70-0x0;var _0x344e06=_0xe034[_0x2a5c70];return _0x344e06;};'use strict';var _=require(_0x4e03('0x0'));var util=require(_0x4e03('0x1'));var moment=require(_0x4e03('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e03('0x3'));var fs=require('fs');var Redis=require(_0x4e03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e03('0x5'));var logger=require(_0x4e03('0x6'))('rpc');var config=require(_0x4e03('0x7'));var jayson=require(_0x4e03('0x8'));var client=jayson[_0x4e03('0x9')][_0x4e03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x284478,_0x18b989,_0x1fd323){return new BPromise(function(_0x432fec,_0x5af407){return client[_0x4e03('0xb')](_0x284478,_0x1fd323)[_0x4e03('0xc')](function(_0x31c996){logger['info'](_0x4e03('0xd'),_0x18b989,'request\x20sent');logger['debug'](_0x4e03('0xe'),_0x18b989,'request\x20sent',JSON[_0x4e03('0xf')](_0x31c996));if(_0x31c996[_0x4e03('0x10')]){if(_0x31c996[_0x4e03('0x10')]['code']===0x1f4){logger[_0x4e03('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x18b989,_0x31c996[_0x4e03('0x10')]['message']);return _0x5af407(_0x31c996[_0x4e03('0x10')][_0x4e03('0x11')]);}logger[_0x4e03('0x10')](_0x4e03('0xd'),_0x18b989,_0x31c996[_0x4e03('0x10')][_0x4e03('0x11')]);return _0x432fec(_0x31c996['error'][_0x4e03('0x11')]);}else{logger[_0x4e03('0x12')](_0x4e03('0xd'),_0x18b989,_0x4e03('0x13'));_0x432fec(_0x31c996[_0x4e03('0x14')][_0x4e03('0x11')]);}})[_0x4e03('0x15')](function(_0x207bde){logger[_0x4e03('0x10')](_0x4e03('0xd'),_0x18b989,_0x207bde);_0x5af407(_0x207bde);});});}exports[_0x4e03('0x16')]=function(_0x2c61ac){var _0x181a20=this;return new Promise(function(_0x1ead1d,_0x1bac47){return db['ChatQueueReport'][_0x4e03('0x17')](_0x2c61ac[_0x4e03('0x18')],{'raw':_0x2c61ac[_0x4e03('0x19')]?_0x2c61ac[_0x4e03('0x19')][_0x4e03('0x1a')]===undefined?!![]:![]:!![]})[_0x4e03('0xc')](function(_0x240072){logger[_0x4e03('0x12')](_0x4e03('0x16'),_0x2c61ac);logger[_0x4e03('0x1b')](_0x4e03('0x16'),_0x2c61ac,JSON['stringify'](_0x240072));_0x1ead1d(_0x240072);})[_0x4e03('0x15')](function(_0x4addb9){logger[_0x4e03('0x10')](_0x4e03('0x16'),_0x4addb9[_0x4e03('0x11')],_0x2c61ac);_0x1bac47(_0x181a20['error'](0x1f4,_0x4addb9[_0x4e03('0x11')]));});});};exports[_0x4e03('0x1c')]=function(_0x1d0961){var _0x4eaf56=this;return new Promise(function(_0x479cb7,_0x1da984){return db['ChatQueueReport'][_0x4e03('0x1d')](_0x1d0961[_0x4e03('0x18')],{'raw':_0x1d0961[_0x4e03('0x19')]?_0x1d0961['options'][_0x4e03('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0961['options']?_0x1d0961[_0x4e03('0x19')]['where']||null:null,'attributes':_0x1d0961[_0x4e03('0x19')]?_0x1d0961['options'][_0x4e03('0x1e')]||null:null,'limit':_0x1d0961['options']?_0x1d0961[_0x4e03('0x19')][_0x4e03('0x1f')]||null:null})[_0x4e03('0xc')](function(_0x4d42d4){logger[_0x4e03('0x12')](_0x4e03('0x1c'),_0x1d0961);logger[_0x4e03('0x1b')]('UpdateChatQueueReport',_0x1d0961,JSON['stringify'](_0x4d42d4));_0x479cb7(_0x4d42d4);})['catch'](function(_0x1fdfaf){logger[_0x4e03('0x10')](_0x4e03('0x1c'),_0x1fdfaf[_0x4e03('0x11')],_0x1d0961);_0x1da984(_0x4eaf56[_0x4e03('0x10')](0x1f4,_0x1fdfaf[_0x4e03('0x11')]));});});}; \ No newline at end of file +var _0xec5b=['UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','options','raw','then','CreateChatQueueReport','update','body','where','attributes'];(function(_0x1a28c2,_0x5d6d9a){var _0x438a93=function(_0x297466){while(--_0x297466){_0x1a28c2['push'](_0x1a28c2['shift']());}};_0x438a93(++_0x5d6d9a);}(_0xec5b,0x175));var _0xbec5=function(_0x3e6110,_0xf58d80){_0x3e6110=_0x3e6110-0x0;var _0x4c186c=_0xec5b[_0x3e6110];return _0x4c186c;};'use strict';var _=require(_0xbec5('0x0'));var util=require('util');var moment=require(_0xbec5('0x1'));var BPromise=require('bluebird');var rs=require(_0xbec5('0x2'));var fs=require('fs');var Redis=require(_0xbec5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbec5('0x4'));var logger=require(_0xbec5('0x5'))(_0xbec5('0x6'));var config=require(_0xbec5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbec5('0x8')][_0xbec5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a17fd,_0x113a2e,_0x20499d){return new BPromise(function(_0x1be34c,_0x45d5be){return client['request'](_0x1a17fd,_0x20499d)['then'](function(_0x4b6b3d){logger[_0xbec5('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x113a2e,'request\x20sent');logger[_0xbec5('0xb')](_0xbec5('0xc'),_0x113a2e,_0xbec5('0xd'),JSON[_0xbec5('0xe')](_0x4b6b3d));if(_0x4b6b3d[_0xbec5('0xf')]){if(_0x4b6b3d[_0xbec5('0xf')]['code']===0x1f4){logger[_0xbec5('0xf')](_0xbec5('0x10'),_0x113a2e,_0x4b6b3d[_0xbec5('0xf')]['message']);return _0x45d5be(_0x4b6b3d[_0xbec5('0xf')]['message']);}logger[_0xbec5('0xf')](_0xbec5('0x10'),_0x113a2e,_0x4b6b3d[_0xbec5('0xf')]['message']);return _0x1be34c(_0x4b6b3d[_0xbec5('0xf')][_0xbec5('0x11')]);}else{logger[_0xbec5('0xa')](_0xbec5('0x10'),_0x113a2e,_0xbec5('0xd'));_0x1be34c(_0x4b6b3d[_0xbec5('0x12')][_0xbec5('0x11')]);}})[_0xbec5('0x13')](function(_0x3e9430){logger['error'](_0xbec5('0x10'),_0x113a2e,_0x3e9430);_0x45d5be(_0x3e9430);});});}exports['CreateChatQueueReport']=function(_0x4f7185){var _0x22e035=this;return new Promise(function(_0x23c066,_0x5c8009){return db[_0xbec5('0x14')][_0xbec5('0x15')](_0x4f7185['body'],{'raw':_0x4f7185[_0xbec5('0x16')]?_0x4f7185[_0xbec5('0x16')][_0xbec5('0x17')]===undefined?!![]:![]:!![]})[_0xbec5('0x18')](function(_0x1d8193){logger['info'](_0xbec5('0x19'),_0x4f7185);logger[_0xbec5('0xb')](_0xbec5('0x19'),_0x4f7185,JSON['stringify'](_0x1d8193));_0x23c066(_0x1d8193);})['catch'](function(_0xb7b05f){logger[_0xbec5('0xf')]('CreateChatQueueReport',_0xb7b05f['message'],_0x4f7185);_0x5c8009(_0x22e035[_0xbec5('0xf')](0x1f4,_0xb7b05f[_0xbec5('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x25feda){var _0x2f7ee1=this;return new Promise(function(_0x5ab765,_0x42aeeb){return db[_0xbec5('0x14')][_0xbec5('0x1a')](_0x25feda[_0xbec5('0x1b')],{'raw':_0x25feda['options']?_0x25feda[_0xbec5('0x16')][_0xbec5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25feda['options']?_0x25feda[_0xbec5('0x16')][_0xbec5('0x1c')]||null:null,'attributes':_0x25feda[_0xbec5('0x16')]?_0x25feda[_0xbec5('0x16')][_0xbec5('0x1d')]||null:null,'limit':_0x25feda[_0xbec5('0x16')]?_0x25feda[_0xbec5('0x16')]['limit']||null:null})[_0xbec5('0x18')](function(_0x161db6){logger[_0xbec5('0xa')](_0xbec5('0x1e'),_0x25feda);logger[_0xbec5('0xb')](_0xbec5('0x1e'),_0x25feda,JSON['stringify'](_0x161db6));_0x5ab765(_0x161db6);})[_0xbec5('0x13')](function(_0x585b4c){logger[_0xbec5('0xf')]('UpdateChatQueueReport',_0x585b4c['message'],_0x25feda);_0x42aeeb(_0x2f7ee1['error'](0x1f4,_0x585b4c[_0xbec5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1e1b862..07f7878 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 _0xf8cd=['/:id','post','create','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xf8cd,0x1bd));var _0xdf8c=function(_0x1397e3,_0x161953){_0x1397e3=_0x1397e3-0x0;var _0x4c2d72=_0xf8cd[_0x1397e3];return _0x4c2d72;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf8c('0x0'));var express=require('express');var router=express[_0xdf8c('0x1')]();var fs_extra=require(_0xdf8c('0x2'));var auth=require(_0xdf8c('0x3'));var interaction=require(_0xdf8c('0x4'));var config=require('../../config/environment');var controller=require(_0xdf8c('0x5'));router[_0xdf8c('0x6')]('/',auth['isAuthenticated'](),controller[_0xdf8c('0x7')]);router['get'](_0xdf8c('0x8'),auth[_0xdf8c('0x9')](),controller[_0xdf8c('0xa')]);router[_0xdf8c('0x6')](_0xdf8c('0xb'),auth[_0xdf8c('0x9')](),controller['show']);router[_0xdf8c('0xc')]('/',auth[_0xdf8c('0x9')](),controller[_0xdf8c('0xd')]);router[_0xdf8c('0xe')](_0xdf8c('0xb'),auth[_0xdf8c('0x9')](),controller[_0xdf8c('0xf')]);router[_0xdf8c('0x10')]('/:id',auth[_0xdf8c('0x9')](),controller[_0xdf8c('0x11')]);module[_0xdf8c('0x12')]=router; \ No newline at end of file +var _0xe7b0=['../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x6a79c4,_0x4deb74){var _0x2725f9=function(_0x3639e8){while(--_0x3639e8){_0x6a79c4['push'](_0x6a79c4['shift']());}};_0x2725f9(++_0x4deb74);}(_0xe7b0,0xc6));var _0x0e7b=function(_0x1ce71c,_0x1f2369){_0x1ce71c=_0x1ce71c-0x0;var _0x38c215=_0xe7b0[_0x1ce71c];return _0x38c215;};'use strict';var multer=require('multer');var util=require(_0x0e7b('0x0'));var path=require(_0x0e7b('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e7b('0x2'));var router=express[_0x0e7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0e7b('0x4'));var interaction=require(_0x0e7b('0x5'));var config=require(_0x0e7b('0x6'));var controller=require(_0x0e7b('0x7'));router[_0x0e7b('0x8')]('/',auth[_0x0e7b('0x9')](),controller[_0x0e7b('0xa')]);router[_0x0e7b('0x8')](_0x0e7b('0xb'),auth[_0x0e7b('0x9')](),controller[_0x0e7b('0xc')]);router[_0x0e7b('0x8')](_0x0e7b('0xd'),auth[_0x0e7b('0x9')](),controller[_0x0e7b('0xe')]);router['post']('/',auth[_0x0e7b('0x9')](),controller[_0x0e7b('0xf')]);router[_0x0e7b('0x10')](_0x0e7b('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0e7b('0x9')](),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 8fd5357..deebd6b 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x551ed2,_0x197d2d){var _0x4bb9d1=function(_0x5b49f6){while(--_0x5b49f6){_0x551ed2['push'](_0x551ed2['shift']());}};_0x4bb9d1(++_0x197d2d);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x290907,_0x1e8855){var _0x4d5e48=function(_0x1b3112){while(--_0x1b3112){_0x290907['push'](_0x290907['shift']());}};_0x4d5e48(++_0x1e8855);}(_0x008c,0x188));var _0xc008=function(_0x3e5595,_0xbe4275){_0x3e5595=_0x3e5595-0x0;var _0x3fd3a6=_0x008c[_0x3e5595];return _0x3fd3a6;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index a09b7c8..f455a7b 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 _0xb756=['reject','save','update','then','destroy','end','error','name','index','map','ChatTransferReport','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply'];(function(_0xac4dd4,_0x41ac92){var _0x35b182=function(_0xa9a425){while(--_0xa9a425){_0xac4dd4['push'](_0xac4dd4['shift']());}};_0x35b182(++_0x41ac92);}(_0xb756,0x1ad));var _0x6b75=function(_0x51b744,_0x156d96){_0x51b744=_0x51b744-0x0;var _0xd25a58=_0xb756[_0x51b744];return _0xd25a58;};'use strict';var emlformat=require(_0x6b75('0x0'));var rimraf=require(_0x6b75('0x1'));var zipdir=require(_0x6b75('0x2'));var jsonpatch=require(_0x6b75('0x3'));var rp=require(_0x6b75('0x4'));var moment=require(_0x6b75('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b75('0x6'));var util=require(_0x6b75('0x7'));var path=require(_0x6b75('0x8'));var sox=require('sox');var csv=require(_0x6b75('0x9'));var ejs=require(_0x6b75('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b75('0xb'));var squel=require(_0x6b75('0xc'));var crypto=require(_0x6b75('0xd'));var jsforce=require(_0x6b75('0xe'));var deskjs=require(_0x6b75('0xf'));var toCsv=require(_0x6b75('0x9'));var querystring=require(_0x6b75('0x10'));var Papa=require(_0x6b75('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b75('0x12'));var as=require(_0x6b75('0x13'));var hardwareService=require(_0x6b75('0x14'));var logger=require('../../config/logger')(_0x6b75('0x15'));var utils=require('../../config/utils');var config=require(_0x6b75('0x16'));var licenseUtil=require(_0x6b75('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8fdc,_0x5a4bcd){_0x5a4bcd=_0x5a4bcd||0xcc;return function(_0x233d4c){if(_0x233d4c){return _0x2b8fdc[_0x6b75('0x18')](_0x5a4bcd);}return _0x2b8fdc[_0x6b75('0x19')](_0x5a4bcd)['end']();};}function respondWithResult(_0x266825,_0x18d73d){_0x18d73d=_0x18d73d||0xc8;return function(_0x476d9c){if(_0x476d9c){return _0x266825['status'](_0x18d73d)[_0x6b75('0x1a')](_0x476d9c);}};}function respondWithFilteredResult(_0x98ad64,_0x1b79a4){return function(_0x6013ce){if(_0x6013ce){var _0x18f558=typeof _0x1b79a4[_0x6b75('0x1b')]===_0x6b75('0x1c')&&typeof _0x1b79a4[_0x6b75('0x1d')]==='undefined';var _0x5790ba=_0x6013ce[_0x6b75('0x1e')];var _0x23f9b8=_0x18f558?0x0:_0x1b79a4[_0x6b75('0x1b')];var _0x12839f=_0x18f558?_0x6013ce['count']:_0x1b79a4[_0x6b75('0x1b')]+_0x1b79a4[_0x6b75('0x1d')];var _0x14952c;if(_0x12839f>=_0x5790ba){_0x12839f=_0x5790ba;_0x14952c=0xc8;}else{_0x14952c=0xce;}_0x98ad64[_0x6b75('0x19')](_0x14952c);return _0x98ad64[_0x6b75('0x1f')]('Content-Range',_0x23f9b8+'-'+_0x12839f+'/'+_0x5790ba)['json'](_0x6013ce);}return null;};}function patchUpdates(_0x23ac06){return function(_0x27a353){try{jsonpatch[_0x6b75('0x20')](_0x27a353,_0x23ac06,!![]);}catch(_0x1645aa){return BPromise[_0x6b75('0x21')](_0x1645aa);}return _0x27a353[_0x6b75('0x22')]();};}function saveUpdates(_0x1e9184,_0xa272b1){return function(_0x12c6f4){if(_0x12c6f4){return _0x12c6f4[_0x6b75('0x23')](_0x1e9184)[_0x6b75('0x24')](function(_0x4a3463){return _0x4a3463;});}return null;};}function removeEntity(_0xc7c044,_0x3e237a){return function(_0x61ddc1){if(_0x61ddc1){return _0x61ddc1[_0x6b75('0x25')]()[_0x6b75('0x24')](function(){_0xc7c044[_0x6b75('0x19')](0xcc)[_0x6b75('0x26')]();});}};}function handleEntityNotFound(_0x227981,_0x2b96f4){return function(_0x100558){if(!_0x100558){_0x227981[_0x6b75('0x18')](0x194);}return _0x100558;};}function handleError(_0x49b60e,_0xe313fd){_0xe313fd=_0xe313fd||0x1f4;return function(_0x315d3d){logger[_0x6b75('0x27')](_0x315d3d['stack']);if(_0x315d3d[_0x6b75('0x28')]){delete _0x315d3d[_0x6b75('0x28')];}_0x49b60e[_0x6b75('0x19')](_0xe313fd)['send'](_0x315d3d);};}exports[_0x6b75('0x29')]=function(_0x4b5140,_0x4deda9){var _0x2e8dd5={},_0x2fe58d={},_0x56b72b={'count':0x0,'rows':[]};var _0x275017=_[_0x6b75('0x2a')](db[_0x6b75('0x2b')]['rawAttributes'],function(_0x5da0b0){return{'name':_0x5da0b0[_0x6b75('0x2c')],'type':_0x5da0b0['type'][_0x6b75('0x2d')]};});_0x2fe58d['model']=_[_0x6b75('0x2a')](_0x275017,_0x6b75('0x28'));_0x2fe58d[_0x6b75('0x2e')]=_[_0x6b75('0x2f')](_0x4b5140[_0x6b75('0x2e')]);_0x2fe58d[_0x6b75('0x30')]=_[_0x6b75('0x31')](_0x2fe58d[_0x6b75('0x32')],_0x2fe58d[_0x6b75('0x2e')]);_0x2e8dd5['attributes']=_[_0x6b75('0x31')](_0x2fe58d['model'],qs['fields'](_0x4b5140['query'][_0x6b75('0x33')]));_0x2e8dd5[_0x6b75('0x34')]=_0x2e8dd5['attributes'][_0x6b75('0x35')]?_0x2e8dd5[_0x6b75('0x34')]:_0x2fe58d[_0x6b75('0x32')];if(!_0x4b5140['query'][_0x6b75('0x36')](_0x6b75('0x37'))){_0x2e8dd5[_0x6b75('0x1d')]=qs[_0x6b75('0x1d')](_0x4b5140[_0x6b75('0x2e')]['limit']);_0x2e8dd5[_0x6b75('0x1b')]=qs[_0x6b75('0x1b')](_0x4b5140[_0x6b75('0x2e')][_0x6b75('0x1b')]);}_0x2e8dd5[_0x6b75('0x38')]=qs['sort'](_0x4b5140[_0x6b75('0x2e')][_0x6b75('0x39')]);_0x2e8dd5[_0x6b75('0x3a')]=qs['filters'](_[_0x6b75('0x3b')](_0x4b5140[_0x6b75('0x2e')],_0x2fe58d[_0x6b75('0x30')]),_0x275017);if(_0x4b5140[_0x6b75('0x2e')]['filter']){_0x2e8dd5[_0x6b75('0x3a')]=_[_0x6b75('0x3c')](_0x2e8dd5[_0x6b75('0x3a')],{'$or':_[_0x6b75('0x2a')](_0x275017,function(_0x271ec5){if(_0x271ec5[_0x6b75('0x3d')]!==_0x6b75('0x3e')){var _0x2fe761={};_0x2fe761[_0x271ec5[_0x6b75('0x28')]]={'$like':'%'+_0x4b5140['query'][_0x6b75('0x3f')]+'%'};return _0x2fe761;}})});}_0x2e8dd5=_[_0x6b75('0x3c')]({},_0x2e8dd5,_0x4b5140[_0x6b75('0x40')]);var _0x5b0d74={'where':_0x2e8dd5['where']};return db['ChatTransferReport'][_0x6b75('0x1e')](_0x5b0d74)[_0x6b75('0x24')](function(_0x52763c){_0x56b72b['count']=_0x52763c;if(_0x4b5140[_0x6b75('0x2e')]['includeAll']){_0x2e8dd5[_0x6b75('0x41')]=[{'all':!![]}];}return db[_0x6b75('0x2b')][_0x6b75('0x42')](_0x2e8dd5);})['then'](function(_0x2971f8){_0x56b72b[_0x6b75('0x43')]=_0x2971f8;return _0x56b72b;})['then'](respondWithFilteredResult(_0x4deda9,_0x2e8dd5))[_0x6b75('0x44')](handleError(_0x4deda9,null));};exports[_0x6b75('0x45')]=function(_0x611bb4,_0x29b555){var _0x342ab4={'raw':!![],'where':{'id':_0x611bb4[_0x6b75('0x46')]['id']}},_0x12971c={};_0x12971c[_0x6b75('0x32')]=_[_0x6b75('0x2f')](db[_0x6b75('0x2b')][_0x6b75('0x47')]);_0x12971c[_0x6b75('0x2e')]=_['keys'](_0x611bb4[_0x6b75('0x2e')]);_0x12971c[_0x6b75('0x30')]=_['intersection'](_0x12971c[_0x6b75('0x32')],_0x12971c['query']);_0x342ab4['attributes']=_[_0x6b75('0x31')](_0x12971c['model'],qs[_0x6b75('0x33')](_0x611bb4[_0x6b75('0x2e')][_0x6b75('0x33')]));_0x342ab4[_0x6b75('0x34')]=_0x342ab4[_0x6b75('0x34')][_0x6b75('0x35')]?_0x342ab4[_0x6b75('0x34')]:_0x12971c[_0x6b75('0x32')];if(_0x611bb4[_0x6b75('0x2e')][_0x6b75('0x48')]){_0x342ab4['include']=[{'all':!![]}];}_0x342ab4=_[_0x6b75('0x3c')]({},_0x342ab4,_0x611bb4[_0x6b75('0x40')]);return db['ChatTransferReport'][_0x6b75('0x49')](_0x342ab4)['then'](handleEntityNotFound(_0x29b555,null))[_0x6b75('0x24')](respondWithResult(_0x29b555,null))[_0x6b75('0x44')](handleError(_0x29b555,null));};exports['create']=function(_0xdd191e,_0x4c8e1b){return db[_0x6b75('0x2b')][_0x6b75('0x4a')](_0xdd191e[_0x6b75('0x4b')],{})[_0x6b75('0x24')](respondWithResult(_0x4c8e1b,0xc9))[_0x6b75('0x44')](handleError(_0x4c8e1b,null));};exports[_0x6b75('0x23')]=function(_0x5b5d9a,_0x4599e0){if(_0x5b5d9a[_0x6b75('0x4b')]['id']){delete _0x5b5d9a[_0x6b75('0x4b')]['id'];}return db[_0x6b75('0x2b')][_0x6b75('0x49')]({'where':{'id':_0x5b5d9a[_0x6b75('0x46')]['id']}})['then'](handleEntityNotFound(_0x4599e0,null))[_0x6b75('0x24')](saveUpdates(_0x5b5d9a[_0x6b75('0x4b')],null))[_0x6b75('0x24')](respondWithResult(_0x4599e0,null))[_0x6b75('0x44')](handleError(_0x4599e0,null));};exports[_0x6b75('0x25')]=function(_0x210408,_0x1fbeb8){return db['ChatTransferReport'][_0x6b75('0x49')]({'where':{'id':_0x210408['params']['id']}})[_0x6b75('0x24')](handleEntityNotFound(_0x1fbeb8,null))[_0x6b75('0x24')](removeEntity(_0x1fbeb8,null))['catch'](handleError(_0x1fbeb8,null));};exports[_0x6b75('0x4c')]=function(_0x280695,_0x1a14b5){return db['ChatTransferReport'][_0x6b75('0x4c')]()[_0x6b75('0x24')](respondWithResult(_0x1a14b5,null))[_0x6b75('0x44')](handleError(_0x1a14b5,null));}; \ No newline at end of file +var _0xc75e=['key','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','filter','where','VIRTUAL','options','ChatTransferReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc75e,0x1eb));var _0xec75=function(_0x1ebc81,_0x4f619c){_0x1ebc81=_0x1ebc81-0x0;var _0xff70f0=_0xc75e[_0x1ebc81];return _0xff70f0;};'use strict';var emlformat=require(_0xec75('0x0'));var rimraf=require(_0xec75('0x1'));var zipdir=require(_0xec75('0x2'));var jsonpatch=require(_0xec75('0x3'));var rp=require(_0xec75('0x4'));var moment=require(_0xec75('0x5'));var BPromise=require(_0xec75('0x6'));var Mustache=require(_0xec75('0x7'));var util=require(_0xec75('0x8'));var path=require(_0xec75('0x9'));var sox=require(_0xec75('0xa'));var csv=require(_0xec75('0xb'));var ejs=require(_0xec75('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec75('0xd'));var squel=require(_0xec75('0xe'));var crypto=require('crypto');var jsforce=require(_0xec75('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xec75('0xb'));var querystring=require(_0xec75('0x10'));var Papa=require(_0xec75('0x11'));var Redis=require(_0xec75('0x12'));var authService=require(_0xec75('0x13'));var qs=require(_0xec75('0x14'));var as=require(_0xec75('0x15'));var hardwareService=require(_0xec75('0x16'));var logger=require(_0xec75('0x17'))(_0xec75('0x18'));var utils=require(_0xec75('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11ee9a,_0x4db174){_0x4db174=_0x4db174||0xcc;return function(_0x4df224){if(_0x4df224){return _0x11ee9a[_0xec75('0x1a')](_0x4db174);}return _0x11ee9a[_0xec75('0x1b')](_0x4db174)[_0xec75('0x1c')]();};}function respondWithResult(_0x71c881,_0x2ea958){_0x2ea958=_0x2ea958||0xc8;return function(_0x57e8a8){if(_0x57e8a8){return _0x71c881['status'](_0x2ea958)[_0xec75('0x1d')](_0x57e8a8);}};}function respondWithFilteredResult(_0x583f70,_0x249491){return function(_0x504768){if(_0x504768){var _0x597537=typeof _0x249491['offset']==='undefined'&&typeof _0x249491['limit']===_0xec75('0x1e');var _0x448eec=_0x504768[_0xec75('0x1f')];var _0x226fba=_0x597537?0x0:_0x249491[_0xec75('0x20')];var _0x6361a0=_0x597537?_0x504768[_0xec75('0x1f')]:_0x249491[_0xec75('0x20')]+_0x249491[_0xec75('0x21')];var _0x59fb00;if(_0x6361a0>=_0x448eec){_0x6361a0=_0x448eec;_0x59fb00=0xc8;}else{_0x59fb00=0xce;}_0x583f70[_0xec75('0x1b')](_0x59fb00);return _0x583f70[_0xec75('0x22')]('Content-Range',_0x226fba+'-'+_0x6361a0+'/'+_0x448eec)['json'](_0x504768);}return null;};}function patchUpdates(_0x1b5d19){return function(_0x3b6002){try{jsonpatch[_0xec75('0x23')](_0x3b6002,_0x1b5d19,!![]);}catch(_0xc5a115){return BPromise[_0xec75('0x24')](_0xc5a115);}return _0x3b6002['save']();};}function saveUpdates(_0x1cd56d,_0x84ee4b){return function(_0x8fb767){if(_0x8fb767){return _0x8fb767[_0xec75('0x25')](_0x1cd56d)[_0xec75('0x26')](function(_0x46e70b){return _0x46e70b;});}return null;};}function removeEntity(_0x2dde64,_0x2bb4e8){return function(_0x1974e4){if(_0x1974e4){return _0x1974e4[_0xec75('0x27')]()[_0xec75('0x26')](function(){_0x2dde64[_0xec75('0x1b')](0xcc)[_0xec75('0x1c')]();});}};}function handleEntityNotFound(_0x14368a,_0x1eb773){return function(_0x1db2d9){if(!_0x1db2d9){_0x14368a[_0xec75('0x1a')](0x194);}return _0x1db2d9;};}function handleError(_0x46832e,_0x38f86a){_0x38f86a=_0x38f86a||0x1f4;return function(_0x3c510f){logger[_0xec75('0x28')](_0x3c510f[_0xec75('0x29')]);if(_0x3c510f[_0xec75('0x2a')]){delete _0x3c510f[_0xec75('0x2a')];}_0x46832e[_0xec75('0x1b')](_0x38f86a)[_0xec75('0x2b')](_0x3c510f);};}exports[_0xec75('0x2c')]=function(_0x18e75b,_0x54d8d6){var _0x28fedc={},_0x7a4633={},_0x39d036={'count':0x0,'rows':[]};var _0xcafc95=_['map'](db['ChatTransferReport'][_0xec75('0x2d')],function(_0x33fcac){return{'name':_0x33fcac[_0xec75('0x2e')],'type':_0x33fcac[_0xec75('0x2f')][_0xec75('0x30')]};});_0x7a4633['model']=_[_0xec75('0x31')](_0xcafc95,_0xec75('0x2a'));_0x7a4633[_0xec75('0x32')]=_['keys'](_0x18e75b[_0xec75('0x32')]);_0x7a4633[_0xec75('0x33')]=_['intersection'](_0x7a4633[_0xec75('0x34')],_0x7a4633[_0xec75('0x32')]);_0x28fedc[_0xec75('0x35')]=_[_0xec75('0x36')](_0x7a4633[_0xec75('0x34')],qs[_0xec75('0x37')](_0x18e75b[_0xec75('0x32')][_0xec75('0x37')]));_0x28fedc['attributes']=_0x28fedc[_0xec75('0x35')][_0xec75('0x38')]?_0x28fedc[_0xec75('0x35')]:_0x7a4633[_0xec75('0x34')];if(!_0x18e75b[_0xec75('0x32')]['hasOwnProperty'](_0xec75('0x39'))){_0x28fedc[_0xec75('0x21')]=qs[_0xec75('0x21')](_0x18e75b['query']['limit']);_0x28fedc[_0xec75('0x20')]=qs['offset'](_0x18e75b['query'][_0xec75('0x20')]);}_0x28fedc[_0xec75('0x3a')]=qs[_0xec75('0x3b')](_0x18e75b[_0xec75('0x32')][_0xec75('0x3b')]);_0x28fedc['where']=qs[_0xec75('0x33')](_['pick'](_0x18e75b[_0xec75('0x32')],_0x7a4633[_0xec75('0x33')]),_0xcafc95);if(_0x18e75b[_0xec75('0x32')][_0xec75('0x3c')]){_0x28fedc[_0xec75('0x3d')]=_['merge'](_0x28fedc[_0xec75('0x3d')],{'$or':_[_0xec75('0x31')](_0xcafc95,function(_0xdb8598){if(_0xdb8598[_0xec75('0x2f')]!==_0xec75('0x3e')){var _0x4ce2f3={};_0x4ce2f3[_0xdb8598['name']]={'$like':'%'+_0x18e75b[_0xec75('0x32')][_0xec75('0x3c')]+'%'};return _0x4ce2f3;}})});}_0x28fedc=_['merge']({},_0x28fedc,_0x18e75b[_0xec75('0x3f')]);var _0x51a2ff={'where':_0x28fedc[_0xec75('0x3d')]};return db[_0xec75('0x40')][_0xec75('0x1f')](_0x51a2ff)['then'](function(_0x4efb66){_0x39d036[_0xec75('0x1f')]=_0x4efb66;if(_0x18e75b[_0xec75('0x32')]['includeAll']){_0x28fedc[_0xec75('0x41')]=[{'all':!![]}];}return db[_0xec75('0x40')][_0xec75('0x42')](_0x28fedc);})[_0xec75('0x26')](function(_0x565cf9){_0x39d036[_0xec75('0x43')]=_0x565cf9;return _0x39d036;})[_0xec75('0x26')](respondWithFilteredResult(_0x54d8d6,_0x28fedc))[_0xec75('0x44')](handleError(_0x54d8d6,null));};exports[_0xec75('0x45')]=function(_0x244eb2,_0x4eb23e){var _0x99911b={'raw':!![],'where':{'id':_0x244eb2[_0xec75('0x46')]['id']}},_0x250d6e={};_0x250d6e[_0xec75('0x34')]=_[_0xec75('0x47')](db[_0xec75('0x40')][_0xec75('0x2d')]);_0x250d6e[_0xec75('0x32')]=_[_0xec75('0x47')](_0x244eb2[_0xec75('0x32')]);_0x250d6e[_0xec75('0x33')]=_[_0xec75('0x36')](_0x250d6e[_0xec75('0x34')],_0x250d6e[_0xec75('0x32')]);_0x99911b[_0xec75('0x35')]=_[_0xec75('0x36')](_0x250d6e[_0xec75('0x34')],qs[_0xec75('0x37')](_0x244eb2[_0xec75('0x32')]['fields']));_0x99911b[_0xec75('0x35')]=_0x99911b[_0xec75('0x35')][_0xec75('0x38')]?_0x99911b[_0xec75('0x35')]:_0x250d6e[_0xec75('0x34')];if(_0x244eb2['query'][_0xec75('0x48')]){_0x99911b[_0xec75('0x41')]=[{'all':!![]}];}_0x99911b=_['merge']({},_0x99911b,_0x244eb2[_0xec75('0x3f')]);return db[_0xec75('0x40')][_0xec75('0x49')](_0x99911b)[_0xec75('0x26')](handleEntityNotFound(_0x4eb23e,null))[_0xec75('0x26')](respondWithResult(_0x4eb23e,null))['catch'](handleError(_0x4eb23e,null));};exports['create']=function(_0xa1c24b,_0x266449){return db[_0xec75('0x40')][_0xec75('0x4a')](_0xa1c24b[_0xec75('0x4b')],{})[_0xec75('0x26')](respondWithResult(_0x266449,0xc9))[_0xec75('0x44')](handleError(_0x266449,null));};exports[_0xec75('0x25')]=function(_0xf0faa7,_0x3fe295){if(_0xf0faa7[_0xec75('0x4b')]['id']){delete _0xf0faa7[_0xec75('0x4b')]['id'];}return db[_0xec75('0x40')][_0xec75('0x49')]({'where':{'id':_0xf0faa7[_0xec75('0x46')]['id']}})[_0xec75('0x26')](handleEntityNotFound(_0x3fe295,null))[_0xec75('0x26')](saveUpdates(_0xf0faa7[_0xec75('0x4b')],null))[_0xec75('0x26')](respondWithResult(_0x3fe295,null))[_0xec75('0x44')](handleError(_0x3fe295,null));};exports[_0xec75('0x27')]=function(_0x59218e,_0x1629f5){return db['ChatTransferReport'][_0xec75('0x49')]({'where':{'id':_0x59218e[_0xec75('0x46')]['id']}})[_0xec75('0x26')](handleEntityNotFound(_0x1629f5,null))[_0xec75('0x26')](removeEntity(_0x1629f5,null))[_0xec75('0x44')](handleError(_0x1629f5,null));};exports[_0xec75('0x4c')]=function(_0x2f8237,_0x40d46a){return db[_0xec75('0x40')][_0xec75('0x4c')]()['then'](respondWithResult(_0x40d46a,null))[_0xec75('0x44')](handleError(_0x40d46a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 870dc4c..348785b 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 _0x1a9e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x59233e,_0x5833dc){var _0xe06e55=function(_0x217ca3){while(--_0x217ca3){_0x59233e['push'](_0x59233e['shift']());}};_0xe06e55(++_0x5833dc);}(_0x1a9e,0x8f));var _0xe1a9=function(_0x1a3158,_0xe92611){_0x1a3158=_0x1a3158-0x0;var _0x5dab9f=_0x1a9e[_0x1a3158];return _0x5dab9f;};'use strict';var _=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var logger=require(_0xe1a9('0x2'))(_0xe1a9('0x3'));var moment=require(_0xe1a9('0x4'));var BPromise=require(_0xe1a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1a9('0x6'));var rimraf=require(_0xe1a9('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xe1a9('0x8')]=function(_0x14eadc,_0x2de698){return _0x14eadc[_0xe1a9('0x9')](_0xe1a9('0xa'),attributes,{'tableName':_0xe1a9('0xb'),'paranoid':![],'indexes':[{'name':_0xe1a9('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e0b=['api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x3e0b,0x14e));var _0xb3e0=function(_0x43970e,_0x2e9e79){_0x43970e=_0x43970e-0x0;var _0x4fb408=_0x3e0b[_0x43970e];return _0x4fb408;};'use strict';var _=require('lodash');var util=require(_0xb3e0('0x0'));var logger=require(_0xb3e0('0x1'))(_0xb3e0('0x2'));var moment=require(_0xb3e0('0x3'));var BPromise=require(_0xb3e0('0x4'));var rp=require(_0xb3e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb3e0('0x6'));var attributes=require(_0xb3e0('0x7'));module['exports']=function(_0x3fd4d4,_0x5a556a){return _0x3fd4d4[_0xb3e0('0x8')](_0xb3e0('0x9'),attributes,{'tableName':_0xb3e0('0xa'),'paranoid':![],'indexes':[{'name':_0xb3e0('0xb'),'fields':[_0xb3e0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 75badc9..e107b4f 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 _0x6508=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','util'];(function(_0x4bf9aa,_0xafa1ec){var _0x1db38a=function(_0x44540e){while(--_0x44540e){_0x4bf9aa['push'](_0x4bf9aa['shift']());}};_0x1db38a(++_0xafa1ec);}(_0x6508,0x107));var _0x8650=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0x6508[_0x124298];return _0x35ac24;};'use strict';var _=require('lodash');var util=require(_0x8650('0x0'));var moment=require('moment');var BPromise=require(_0x8650('0x1'));var rs=require(_0x8650('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8650('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8650('0x4'))(_0x8650('0x5'));var config=require(_0x8650('0x6'));var jayson=require(_0x8650('0x7'));var client=jayson[_0x8650('0x8')][_0x8650('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeac0f0,_0x1fddf4,_0x1445af){return new BPromise(function(_0x3611d3,_0xee92bb){return client[_0x8650('0xa')](_0xeac0f0,_0x1445af)[_0x8650('0xb')](function(_0x59fb46){logger[_0x8650('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x1fddf4,_0x8650('0xd'));logger[_0x8650('0xe')](_0x8650('0xf'),_0x1fddf4,_0x8650('0xd'),JSON[_0x8650('0x10')](_0x59fb46));if(_0x59fb46[_0x8650('0x11')]){if(_0x59fb46[_0x8650('0x11')][_0x8650('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1fddf4,_0x59fb46[_0x8650('0x11')]['message']);return _0xee92bb(_0x59fb46[_0x8650('0x11')][_0x8650('0x13')]);}logger[_0x8650('0x11')](_0x8650('0x14'),_0x1fddf4,_0x59fb46[_0x8650('0x11')][_0x8650('0x13')]);return _0x3611d3(_0x59fb46[_0x8650('0x11')][_0x8650('0x13')]);}else{logger[_0x8650('0xc')](_0x8650('0x14'),_0x1fddf4,_0x8650('0xd'));_0x3611d3(_0x59fb46[_0x8650('0x15')][_0x8650('0x13')]);}})['catch'](function(_0x367652){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1fddf4,_0x367652);_0xee92bb(_0x367652);});});} \ No newline at end of file +var _0xfa65=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ChatTransferReport,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x35c775,_0xcb5aa7){var _0x5c8e24=function(_0x3ce90a){while(--_0x3ce90a){_0x35c775['push'](_0x35c775['shift']());}};_0x5c8e24(++_0xcb5aa7);}(_0xfa65,0x13e));var _0x5fa6=function(_0x59c78a,_0x57813a){_0x59c78a=_0x59c78a-0x0;var _0x4415c5=_0xfa65[_0x59c78a];return _0x4415c5;};'use strict';var _=require('lodash');var util=require(_0x5fa6('0x0'));var moment=require(_0x5fa6('0x1'));var BPromise=require(_0x5fa6('0x2'));var rs=require(_0x5fa6('0x3'));var fs=require('fs');var Redis=require(_0x5fa6('0x4'));var db=require(_0x5fa6('0x5'))['db'];var utils=require(_0x5fa6('0x6'));var logger=require(_0x5fa6('0x7'))('rpc');var config=require(_0x5fa6('0x8'));var jayson=require(_0x5fa6('0x9'));var client=jayson[_0x5fa6('0xa')][_0x5fa6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bddd6,_0x32136b,_0x31ac37){return new BPromise(function(_0x39f203,_0x11f80e){return client[_0x5fa6('0xc')](_0x5bddd6,_0x31ac37)[_0x5fa6('0xd')](function(_0x10161d){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x32136b,'request\x20sent');logger[_0x5fa6('0xe')](_0x5fa6('0xf'),_0x32136b,_0x5fa6('0x10'),JSON[_0x5fa6('0x11')](_0x10161d));if(_0x10161d['error']){if(_0x10161d[_0x5fa6('0x12')][_0x5fa6('0x13')]===0x1f4){logger[_0x5fa6('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x32136b,_0x10161d[_0x5fa6('0x12')]['message']);return _0x11f80e(_0x10161d['error'][_0x5fa6('0x14')]);}logger[_0x5fa6('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x32136b,_0x10161d[_0x5fa6('0x12')][_0x5fa6('0x14')]);return _0x39f203(_0x10161d['error'][_0x5fa6('0x14')]);}else{logger[_0x5fa6('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x32136b,_0x5fa6('0x10'));_0x39f203(_0x10161d[_0x5fa6('0x16')][_0x5fa6('0x14')]);}})[_0x5fa6('0x17')](function(_0x4892e2){logger[_0x5fa6('0x12')](_0x5fa6('0x18'),_0x32136b,_0x4892e2);_0x11f80e(_0x4892e2);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 820aa65..0b07593 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 _0x6152=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x373d6c,_0x5f5653){var _0xd517c6=function(_0x4fb6f8){while(--_0x4fb6f8){_0x373d6c['push'](_0x373d6c['shift']());}};_0xd517c6(++_0x5f5653);}(_0x6152,0x163));var _0x2615=function(_0x317d0b,_0x510370){_0x317d0b=_0x317d0b-0x0;var _0x3667c7=_0x6152[_0x317d0b];return _0x3667c7;};'use strict';var multer=require(_0x2615('0x0'));var util=require(_0x2615('0x1'));var path=require(_0x2615('0x2'));var timeout=require(_0x2615('0x3'));var express=require(_0x2615('0x4'));var router=express['Router']();var fs_extra=require(_0x2615('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2615('0x6'));var config=require(_0x2615('0x7'));var controller=require('./chatTransferReport.controller');router[_0x2615('0x8')]('/',auth[_0x2615('0x9')](),controller[_0x2615('0xa')]);router[_0x2615('0x8')](_0x2615('0xb'),auth[_0x2615('0x9')](),controller[_0x2615('0xc')]);router[_0x2615('0x8')](_0x2615('0xd'),auth[_0x2615('0x9')](),controller[_0x2615('0xe')]);router[_0x2615('0xf')]('/',auth[_0x2615('0x9')](),controller['create']);router['put'](_0x2615('0xd'),auth[_0x2615('0x9')](),controller['update']);router[_0x2615('0x10')](_0x2615('0xd'),auth[_0x2615('0x9')](),controller[_0x2615('0x11')]);module[_0x2615('0x12')]=router; \ No newline at end of file +var _0xd4d0=['create','put','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1d5910,_0x2d74de){var _0x509012=function(_0x2844fd){while(--_0x2844fd){_0x1d5910['push'](_0x1d5910['shift']());}};_0x509012(++_0x2d74de);}(_0xd4d0,0x158));var _0x0d4d=function(_0x2416d0,_0x440fa7){_0x2416d0=_0x2416d0-0x0;var _0x3643e3=_0xd4d0[_0x2416d0];return _0x3643e3;};'use strict';var multer=require('multer');var util=require(_0x0d4d('0x0'));var path=require(_0x0d4d('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d4d('0x2'));var router=express[_0x0d4d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0d4d('0x4'));var interaction=require(_0x0d4d('0x5'));var config=require(_0x0d4d('0x6'));var controller=require(_0x0d4d('0x7'));router[_0x0d4d('0x8')]('/',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0xa')]);router[_0x0d4d('0x8')](_0x0d4d('0xb'),auth['isAuthenticated'](),controller[_0x0d4d('0xc')]);router[_0x0d4d('0x8')](_0x0d4d('0xd'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0xe')]);router[_0x0d4d('0xf')]('/',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x10')]);router[_0x0d4d('0x11')](_0x0d4d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0d4d('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0d4d('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e2a3f59..3e45d8c 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 _0xbd83=['setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','TEXT','input','name','getDataValue','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0xbd83,0x9a));var _0x3bd8=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xbd83[_0x3c504b];return _0x2e5354;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3bd8('0x0'));module[_0x3bd8('0x1')]={'name':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3bd8('0x3')},'description':{'type':Sequelize[_0x3bd8('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x4')},'key':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x5')},'customerAlias':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![],'defaultValue':_0x3bd8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3bd8('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3bd8('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3bd8('0xa'),_0x3bd8('0xb')),'defaultValue':_0x3bd8('0xa')},'header_online':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0xc')},'start_chat_button':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3bd8('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x12')},'placeholderMessage':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x13')},'closingMessageButton':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x14')},'skipMessageButton':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3bd8('0x16')](_0x3bd8('0x17'),'thumb'),'defaultValue':_0x3bd8('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x3bd8('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3bd8('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3bd8('0x19'),'variable':null,'config':{'placeholder':_0x3bd8('0x1a'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3bd8('0x19'),'props':{'title':_0x3bd8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3bd8('0x4'),'type':_0x3bd8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3bd8('0x1b')](_0x3bd8('0x1c'))?JSON[_0x3bd8('0x1d')](this[_0x3bd8('0x1b')](_0x3bd8('0x1c'))):{};},'set':function(_0x2d7231){return this['setDataValue'](_0x3bd8('0x1c'),JSON[_0x3bd8('0x1e')](_0x2d7231));}},'offlineForm':{'type':Sequelize[_0x3bd8('0x18')],'defaultValue':function(){return JSON[_0x3bd8('0x1e')]({'items':[{'type':_0x3bd8('0x19'),'props':{'title':_0x3bd8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3bd8('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x3bd8('0x1f'),'helpText':_0x3bd8('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x3bd8('0x1b')](_0x3bd8('0x21'))?JSON[_0x3bd8('0x1d')](this[_0x3bd8('0x1b')](_0x3bd8('0x21'))):{};},'set':function(_0x4de416){return this[_0x3bd8('0x22')](_0x3bd8('0x21'),JSON[_0x3bd8('0x1e')](_0x4de416));}},'token':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':function(){return rs[_0x3bd8('0x23')]();}},'autoclose':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x24')},'offlineMessageBody':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x25')},'skipUnmanaged':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x14')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3bd8('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3bd8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3bd8('0x18')],'defaultValue':function(){return _0x3bd8('0x26');}},'notificationSound':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3bd8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3bd8('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3bd8('0x29')},'defaultTitle':{'type':Sequelize[_0x3bd8('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3bd8('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3bd8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':_0x3bd8('0x2a')},'systemAvatar':{'type':Sequelize[_0x3bd8('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3bd8('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3bd8('0x2b'),'set':function(_0xcc95b4){if(!_0xcc95b4)this[_0x3bd8('0x22')](_0x3bd8('0x2c'),null);this[_0x3bd8('0x22')](_0x3bd8('0x2d'),_0xcc95b4);}},'vidaooEscalation':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3bd8('0x2')]},'vidaooTopic':{'type':Sequelize[_0x3bd8('0x2')],'allowNull':![],'defaultValue':_0x3bd8('0x2e')},'vidaooNote':{'type':Sequelize[_0x3bd8('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x3bd8('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3bd8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3bd8('0x18')]}}; \ No newline at end of file +var _0x002f=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x002f,0x145));var _0xf002=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x002f[_0x55bd12];return _0x1941dd;};'use strict';var Sequelize=require(_0xf002('0x0'));var rs=require(_0xf002('0x1'));module['exports']={'name':{'type':Sequelize[_0xf002('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf002('0x3')},'description':{'type':Sequelize[_0xf002('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0xf002('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x5')},'customerAlias':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf002('0x2')],'allowNull':![],'defaultValue':_0xf002('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf002('0x2')],'allowNull':![],'defaultValue':_0xf002('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf002('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf002('0x2')]},'animation':{'type':Sequelize[_0xf002('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf002('0xa')](_0xf002('0xb'),_0xf002('0xc')),'defaultValue':_0xf002('0xb')},'header_online':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0xd')},'offline_chat_button':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0xe')},'header_offline':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0xf')},'download_transcript':{'type':Sequelize[_0xf002('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf002('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x13')},'noteTitle':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x14')},'closingMessage':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x15')},'closingMessageButton':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xf002('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x16')},'ratingType':{'type':Sequelize[_0xf002('0xa')](_0xf002('0x17'),_0xf002('0x18')),'defaultValue':_0xf002('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf002('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf002('0x19')],'defaultValue':function(){return JSON[_0xf002('0x1a')]({'items':[{'type':_0xf002('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xf002('0x1c'),'required':!![]},'props':{'title':_0xf002('0x1d'),'helpText':''}},{'type':_0xf002('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf002('0x4'),'type':_0xf002('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf002('0x1e')](_0xf002('0x1f'))?JSON[_0xf002('0x20')](this[_0xf002('0x1e')](_0xf002('0x1f'))):{};},'set':function(_0x2834b9){return this[_0xf002('0x21')](_0xf002('0x1f'),JSON[_0xf002('0x1a')](_0x2834b9));}},'offlineForm':{'type':Sequelize[_0xf002('0x19')],'defaultValue':function(){return JSON[_0xf002('0x1a')]({'items':[{'type':'input','props':{'title':_0xf002('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf002('0x4'),'type':_0xf002('0x4')},'variable':null},{'type':_0xf002('0x22'),'config':{'placeholder':_0xf002('0x23')},'props':{'title':_0xf002('0x23'),'helpText':_0xf002('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xf002('0x1e')](_0xf002('0x25'))?JSON[_0xf002('0x20')](this['getDataValue'](_0xf002('0x25'))):{};},'set':function(_0xf4ddca){return this['setDataValue'](_0xf002('0x25'),JSON[_0xf002('0x1a')](_0xf4ddca));}},'token':{'type':Sequelize[_0xf002('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf002('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x26')},'waitingMessage':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x28')},'offlineMessageBody':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xf002('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf002('0x2')],'defaultValue':_0xf002('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x2b')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf002('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf002('0x19')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf002('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf002('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x2d')},'verticalAlignment':{'type':Sequelize[_0xf002('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x2f')},'defaultTitle':{'type':Sequelize[_0xf002('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf002('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf002('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf002('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf002('0x31')},'systemAvatar':{'type':Sequelize[_0xf002('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf002('0x8')],'comment':_0xf002('0x32')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf002('0x33'),'set':function(_0x11b894){if(!_0x11b894)this[_0xf002('0x21')](_0xf002('0x34'),null);this['setDataValue'](_0xf002('0x35'),_0x11b894);}},'vidaooEscalation':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf002('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf002('0x2')],'allowNull':![],'defaultValue':_0xf002('0x36')},'vidaooNote':{'type':Sequelize[_0xf002('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xf002('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf002('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf002('0x19')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c312aab..23b0b5e 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 _0x757a=['body','user','UserProfileSection','autoAssociation','describe','params','ChatWebsiteId','Disposition','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','includes','mapKey','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','priority','asc','ListId','CmContact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','firstName','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','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','defaults','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','findOne','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','color_button','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','find','catch','create'];(function(_0x2938a7,_0x48327e){var _0x2689f9=function(_0x31b54e){while(--_0x31b54e){_0x2938a7['push'](_0x2938a7['shift']());}};_0x2689f9(++_0x48327e);}(_0x757a,0xde));var _0xa757=function(_0x4ff326,_0x11770a){_0x4ff326=_0x4ff326-0x0;var _0x4a25f2=_0x757a[_0x4ff326];return _0x4a25f2;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa757('0x2'));var querystring=require(_0xa757('0x3'));var Redis=require(_0xa757('0x4'));var qs=require(_0xa757('0x5'));var logger=require(_0xa757('0x6'))(_0xa757('0x7'));var config=require('../../config/environment');var db=require(_0xa757('0x8'))['db'];config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);var htmlToText=require(_0xa757('0xd'));var jayson=require(_0xa757('0xe'));var client=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232c});var client9002=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232a});var client9003=jayson[_0xa757('0xf')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x56acfb,_0x4db68e,_0x421040,_0x544b45){return new BPromise(function(_0x564187,_0x2ed0d2){var _0x513b1f=_0x544b45||client;return _0x513b1f['request'](_0x56acfb,_0x421040)[_0xa757('0x11')](function(_0x1b670e){logger[_0xa757('0x12')](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));logger[_0xa757('0x15')](_0xa757('0x16'),_0x4db68e,_0xa757('0x14'),JSON[_0xa757('0x17')](_0x1b670e));if(_0x1b670e[_0xa757('0x18')]){if(_0x1b670e['error'][_0xa757('0x19')]===0x1f4){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e['error']['message']);return _0x2ed0d2(_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);}logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);return _0x564187(_0x1b670e['error'][_0xa757('0x1a')]);}else{logger['info'](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));_0x564187(_0x1b670e[_0xa757('0x1b')][_0xa757('0x1a')]);}})['catch'](function(_0x5638c7){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x5638c7);_0x2ed0d2(_0x5638c7);});});}function respondWithStatusCode(_0x2ba923,_0x8d121f){_0x8d121f=_0x8d121f||0xcc;return function(_0x1d6e2){if(_0x1d6e2){return _0x2ba923[_0xa757('0x1c')](_0x8d121f);}return _0x2ba923[_0xa757('0x1d')](_0x8d121f)[_0xa757('0x1e')]();};}function respondWithResult(_0x2bf276,_0x59fae6){_0x59fae6=_0x59fae6||0xc8;return function(_0x3707c1){if(_0x3707c1){return _0x2bf276['status'](_0x59fae6)[_0xa757('0x1f')](_0x3707c1);}};}function respondWithFilteredResult(_0x47903b,_0x40551d){return function(_0x3859ce){if(_0x3859ce){var _0x37c7e6=typeof _0x40551d['offset']===_0xa757('0x20')&&typeof _0x40551d[_0xa757('0x21')]===_0xa757('0x20');var _0x3bf7f3=_0x3859ce['count'];var _0x449a7d=_0x37c7e6?0x0:_0x40551d['offset'];var _0x5a5664=_0x37c7e6?_0x3859ce['count']:_0x40551d['offset']+_0x40551d[_0xa757('0x21')];var _0x596ae2;if(_0x5a5664>=_0x3bf7f3){_0x5a5664=_0x3bf7f3;_0x596ae2=0xc8;}else{_0x596ae2=0xce;}_0x47903b[_0xa757('0x1d')](_0x596ae2);return _0x47903b[_0xa757('0x22')]('Content-Range',_0x449a7d+'-'+_0x5a5664+'/'+_0x3bf7f3)[_0xa757('0x1f')](_0x3859ce);}return null;};}function saveUpdates(_0x5119ad){return function(_0x2c4823){if(_0x2c4823){return _0x2c4823[_0xa757('0x23')](_0x5119ad)['then'](function(_0x235e54){return _0x235e54;});}return null;};}function removeEntity(_0x5ade7b){return function(_0x3a4a66){if(_0x3a4a66){return _0x3a4a66[_0xa757('0x24')]()[_0xa757('0x11')](function(){var _0x300dc4=_0x3a4a66[_0xa757('0x25')]({'plain':!![]});var _0x2c1885=_0xa757('0x26');return db[_0xa757('0x27')][_0xa757('0x24')]({'where':{'type':_0x2c1885,'resourceId':_0x300dc4['id']}})[_0xa757('0x11')](function(){return _0x3a4a66;});})[_0xa757('0x11')](function(){_0x5ade7b[_0xa757('0x1d')](0xcc)[_0xa757('0x1e')]();});}};}function handleEntityNotFound(_0x2dfb33){return function(_0x27be88){if(!_0x27be88){_0x2dfb33[_0xa757('0x1c')](0x194);}return _0x27be88;};}function handleError(_0x3e64b7,_0x1ad384){_0x1ad384=_0x1ad384||0x1f4;return function(_0x1eacde){logger[_0xa757('0x18')](_0x1eacde[_0xa757('0x28')]);if(_0x1eacde[_0xa757('0x29')]){delete _0x1eacde[_0xa757('0x29')];}_0x3e64b7[_0xa757('0x1d')](_0x1ad384)['send'](_0x1eacde);};}exports[_0xa757('0x2a')]=function(_0x21d6b3,_0x1e9d63){var _0x1794a9={'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x1c4c40={},_0x51e2aa={'count':0x0,'rows':[]};var _0x37b1a3=_[_0xa757('0x2d')](db[_0xa757('0x2e')][_0xa757('0x2f')],function(_0x499390){return{'name':_0x499390[_0xa757('0x30')],'type':_0x499390[_0xa757('0x31')][_0xa757('0x32')]};});_0x1c4c40[_0xa757('0x33')]=_[_0xa757('0x2d')](_0x37b1a3,_0xa757('0x29'));_0x1c4c40[_0xa757('0x34')]=_[_0xa757('0x35')](_0x21d6b3[_0xa757('0x34')]);_0x1c4c40['filters']=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],_0x1c4c40[_0xa757('0x34')]);_0x1794a9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],qs['fields'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x38')]));_0x1794a9['attributes']=_0x1794a9['attributes'][_0xa757('0x39')]?_0x1794a9[_0xa757('0x37')]:_0x1c4c40['model'];if(!_0x21d6b3['query'][_0xa757('0x3a')](_0xa757('0x3b'))){_0x1794a9[_0xa757('0x21')]=qs['limit'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x21')]);_0x1794a9[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x21d6b3[_0xa757('0x34')]['offset']);}_0x1794a9[_0xa757('0x3d')]=qs['sort'](_0x21d6b3['query'][_0xa757('0x3e')]);_0x1794a9[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x21d6b3[_0xa757('0x34')],_0x1c4c40['filters']),_0x37b1a3);if(_0x21d6b3['query'][_0xa757('0x42')]){_0x1794a9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x1794a9[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x37b1a3,function(_0x3db5d5){if(_0x3db5d5['type']!==_0xa757('0x44')){var _0x364998={};_0x364998[_0x3db5d5['name']]={'$like':'%'+_0x21d6b3[_0xa757('0x34')]['filter']+'%'};return _0x364998;}})});}_0x1794a9=_[_0xa757('0x43')]({},_0x1794a9,_0x21d6b3[_0xa757('0x45')]);var _0x4cf90f={'where':_0x1794a9[_0xa757('0x3f')]};return db[_0xa757('0x2e')]['count'](_0x4cf90f)[_0xa757('0x11')](function(_0x257bcd){_0x51e2aa[_0xa757('0x46')]=_0x257bcd;if(_0x21d6b3[_0xa757('0x34')]['includeAll']){_0x1794a9[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x2e')][_0xa757('0x48')](_0x1794a9);})[_0xa757('0x11')](function(_0x4d7493){_0x51e2aa[_0xa757('0x49')]=_0x4d7493;return _0x51e2aa;})['then'](respondWithFilteredResult(_0x1e9d63,_0x1794a9))['catch'](handleError(_0x1e9d63,null));};exports[_0xa757('0x4a')]=function(_0x3c039d,_0x1ae3ae){var _0x5e13cf={'raw':![],'where':{'id':_0x3c039d['params']['id']},'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x421c65={};_0x421c65[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x2e')][_0xa757('0x2f')]);_0x421c65[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3c039d['query']);_0x421c65[_0xa757('0x40')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],_0x421c65[_0xa757('0x34')]);_0x5e13cf[_0xa757('0x37')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],qs[_0xa757('0x38')](_0x3c039d[_0xa757('0x34')][_0xa757('0x38')]));_0x5e13cf[_0xa757('0x37')]=_0x5e13cf[_0xa757('0x37')][_0xa757('0x39')]?_0x5e13cf[_0xa757('0x37')]:_0x421c65[_0xa757('0x33')];if(_0x3c039d[_0xa757('0x34')]['includeAll']){_0x5e13cf[_0xa757('0x47')]=[{'all':!![]}];}_0x5e13cf=_['merge']({},_0x5e13cf,_0x3c039d[_0xa757('0x45')]);return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x5e13cf)[_0xa757('0x11')](handleEntityNotFound(_0x1ae3ae,null))['then'](respondWithResult(_0x1ae3ae,null))[_0xa757('0x4c')](handleError(_0x1ae3ae,null));};exports[_0xa757('0x4d')]=function(_0x8614f9,_0x980e1){return db['ChatWebsite'][_0xa757('0x4d')](_0x8614f9[_0xa757('0x4e')],{})[_0xa757('0x11')](function(_0x1c9f1e){var _0x33666d=_0x8614f9[_0xa757('0x4f')]['get']({'plain':!![]});if(!_0x33666d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33666d['role']==='user'){var _0x1d8742=_0x1c9f1e[_0xa757('0x25')]({'plain':!![]});var _0x137477=_0xa757('0x26');return db[_0xa757('0x50')][_0xa757('0x4b')]({'where':{'name':_0x137477,'userProfileId':_0x33666d['userProfileId']},'raw':!![]})[_0xa757('0x11')](function(_0x163d99){if(_0x163d99&&_0x163d99[_0xa757('0x51')]===0x0){return db[_0xa757('0x27')]['create']({'name':_0x1d8742[_0xa757('0x29')],'resourceId':_0x1d8742['id'],'type':_0x163d99[_0xa757('0x29')],'sectionId':_0x163d99['id']},{})['then'](function(){return _0x1c9f1e;});}else{return _0x1c9f1e;}})[_0xa757('0x4c')](function(_0x5cd0c3){logger[_0xa757('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cd0c3);throw _0x5cd0c3;});}return _0x1c9f1e;})[_0xa757('0x11')](respondWithResult(_0x980e1,0xc9))['catch'](handleError(_0x980e1,null));};exports['update']=function(_0x367b48,_0x235c1e){if(_0x367b48[_0xa757('0x4e')]['id']){delete _0x367b48[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x367b48['params']['id']},'include':[{'model':db['Pause'],'as':_0xa757('0x2c')}]})[_0xa757('0x11')](handleEntityNotFound(_0x235c1e,null))[_0xa757('0x11')](saveUpdates(_0x367b48['body'],null))['then'](respondWithResult(_0x235c1e,null))[_0xa757('0x4c')](handleError(_0x235c1e,null));};exports[_0xa757('0x24')]=function(_0x215a80,_0x504c4f){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x215a80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x504c4f,null))[_0xa757('0x11')](removeEntity(_0x504c4f,null))[_0xa757('0x4c')](handleError(_0x504c4f,null));};exports[_0xa757('0x52')]=function(_0x1291df,_0xfbcb43){return db[_0xa757('0x2e')][_0xa757('0x52')]()[_0xa757('0x11')](respondWithResult(_0xfbcb43,null))[_0xa757('0x4c')](handleError(_0xfbcb43,null));};exports['addDisposition']=function(_0x9e96e6,_0x5c803a){if(_0x9e96e6['body']['id']){delete _0x9e96e6[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x9e96e6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5c803a,null))[_0xa757('0x11')](function(_0x1b34ad){if(_0x1b34ad){_0x9e96e6[_0xa757('0x4e')][_0xa757('0x54')]=_0x1b34ad['id'];return db[_0xa757('0x55')][_0xa757('0x4d')](_0x9e96e6['body']);}})[_0xa757('0x11')](respondWithResult(_0x5c803a,null))[_0xa757('0x4c')](handleError(_0x5c803a,null));};exports['getDispositions']=function(_0x11ebb3,_0x409ee9){var _0x198a11={'raw':![],'where':{}};var _0x180cec={};var _0x27d79b={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x11ebb3[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x409ee9,null))[_0xa757('0x11')](function(_0x3250d0){if(_0x3250d0){_0x180cec[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x55')]['rawAttributes']);_0x180cec['query']=_[_0xa757('0x35')](_0x11ebb3[_0xa757('0x34')]);_0x180cec[_0xa757('0x40')]=_['intersection'](_0x180cec[_0xa757('0x33')],_0x180cec['query']);_0x198a11[_0xa757('0x37')]=_[_0xa757('0x36')](_0x180cec[_0xa757('0x33')],qs[_0xa757('0x38')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x38')]));_0x198a11['attributes']=_0x198a11[_0xa757('0x37')][_0xa757('0x39')]?_0x198a11[_0xa757('0x37')]:_0x180cec[_0xa757('0x33')];if(!_0x11ebb3[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0x198a11[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x21')]);_0x198a11['offset']=qs[_0xa757('0x3c')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3c')]);}_0x198a11['order']=qs[_0xa757('0x3e')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3e')]);_0x198a11[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x11ebb3[_0xa757('0x34')],_0x180cec[_0xa757('0x40')]));_0x198a11[_0xa757('0x3f')][_0xa757('0x54')]=_0x3250d0['id'];if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x42')]){_0x198a11[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x198a11['where'],{'$or':_[_0xa757('0x2d')](_0x198a11[_0xa757('0x37')],function(_0x532ab5){var _0x11f2b3={};_0x11f2b3[_0x532ab5]={'$like':'%'+_0x11ebb3[_0xa757('0x34')]['filter']+'%'};return _0x11f2b3;})});}_0x198a11=_[_0xa757('0x43')]({},_0x198a11,_0x11ebb3[_0xa757('0x45')]);return db[_0xa757('0x55')][_0xa757('0x46')]({'where':_0x198a11[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0xdb2ac6){_0x27d79b[_0xa757('0x46')]=_0xdb2ac6;if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x56')]){_0x198a11[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x55')][_0xa757('0x48')](_0x198a11);})[_0xa757('0x11')](function(_0x27604c){_0x27d79b[_0xa757('0x49')]=_0x27604c;return _0x27d79b;});}})['then'](respondWithFilteredResult(_0x409ee9,_0x198a11))[_0xa757('0x4c')](handleError(_0x409ee9,null));};exports['removeDispositions']=function(_0x39357f,_0x20c444){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39357f[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x20c444,null))[_0xa757('0x11')](function(_0x67a58b){if(_0x67a58b){return _0x67a58b[_0xa757('0x57')](_0x39357f['query'][_0xa757('0x58')]);}})[_0xa757('0x11')](respondWithStatusCode(_0x20c444,null))[_0xa757('0x4c')](handleError(_0x20c444,null));};exports['addAnswer']=function(_0x501134,_0x1f437d){if(_0x501134[_0xa757('0x4e')]['id']){delete _0x501134[_0xa757('0x4e')]['id'];}return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x501134['params']['id']}})['then'](handleEntityNotFound(_0x1f437d,null))[_0xa757('0x11')](function(_0x1adf5a){if(_0x1adf5a){_0x501134[_0xa757('0x4e')]['ChatWebsiteId']=_0x1adf5a['id'];return db[_0xa757('0x59')][_0xa757('0x4d')](_0x501134[_0xa757('0x4e')]);}})[_0xa757('0x11')](respondWithResult(_0x1f437d,null))[_0xa757('0x4c')](handleError(_0x1f437d,null));};exports[_0xa757('0x5a')]=function(_0x26dcec,_0x44c681){var _0xe38e76={'raw':![],'where':{}};var _0x35c1aa={};var _0x180fee={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x26dcec[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x44c681,null))[_0xa757('0x11')](function(_0x346a4a){if(_0x346a4a){_0x35c1aa[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x59')][_0xa757('0x2f')]);_0x35c1aa[_0xa757('0x34')]=_[_0xa757('0x35')](_0x26dcec[_0xa757('0x34')]);_0x35c1aa[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],_0x35c1aa[_0xa757('0x34')]);_0xe38e76[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],qs[_0xa757('0x38')](_0x26dcec[_0xa757('0x34')][_0xa757('0x38')]));_0xe38e76[_0xa757('0x37')]=_0xe38e76['attributes'][_0xa757('0x39')]?_0xe38e76[_0xa757('0x37')]:_0x35c1aa['model'];if(!_0x26dcec[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0xe38e76[_0xa757('0x21')]=qs['limit'](_0x26dcec[_0xa757('0x34')][_0xa757('0x21')]);_0xe38e76[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x26dcec['query'][_0xa757('0x3c')]);}_0xe38e76[_0xa757('0x3d')]=qs['sort'](_0x26dcec[_0xa757('0x34')][_0xa757('0x3e')]);_0xe38e76['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x26dcec[_0xa757('0x34')],_0x35c1aa[_0xa757('0x40')]));_0xe38e76[_0xa757('0x3f')][_0xa757('0x54')]=_0x346a4a['id'];if(_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]){_0xe38e76[_0xa757('0x3f')]=_['merge'](_0xe38e76['where'],{'$or':_[_0xa757('0x2d')](_0xe38e76[_0xa757('0x37')],function(_0x11baf9){var _0x234855={};_0x234855[_0x11baf9]={'$like':'%'+_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x234855;})});}_0xe38e76=_[_0xa757('0x43')]({},_0xe38e76,_0x26dcec['options']);return db[_0xa757('0x59')]['count']({'where':_0xe38e76[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x365a0d){_0x180fee[_0xa757('0x46')]=_0x365a0d;if(_0x26dcec[_0xa757('0x34')]['includeAll']){_0xe38e76[_0xa757('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa757('0x48')](_0xe38e76);})[_0xa757('0x11')](function(_0x183097){_0x180fee[_0xa757('0x49')]=_0x183097;return _0x180fee;});}})['then'](respondWithFilteredResult(_0x44c681,_0xe38e76))[_0xa757('0x4c')](handleError(_0x44c681,null));};exports[_0xa757('0x5b')]=function(_0x187681,_0x3c6d51){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x187681[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c6d51,null))['then'](function(_0x24fd9c){if(_0x24fd9c){return _0x24fd9c[_0xa757('0x5b')](_0x187681[_0xa757('0x34')][_0xa757('0x58')]);}})['then'](respondWithStatusCode(_0x3c6d51,null))[_0xa757('0x4c')](handleError(_0x3c6d51,null));};exports[_0xa757('0x5c')]=function(_0x441f80,_0x9b5432){_0x441f80[_0xa757('0x4e')][_0xa757('0x5d')]=_0x441f80[_0xa757('0x5e')]['filename'];return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x441f80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x9b5432,null))['then'](saveUpdates(_0x441f80['body'],null))[_0xa757('0x11')](respondWithResult(_0x9b5432,null))[_0xa757('0x4c')](handleError(_0x9b5432,null));};exports[_0xa757('0x5f')]=function(_0x218030,_0xb95266){_0x218030[_0xa757('0x4e')][_0xa757('0x60')]=_0x218030[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')]['find']({'where':{'id':_0x218030[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0xb95266,null))[_0xa757('0x11')](saveUpdates(_0x218030[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0xb95266,null))[_0xa757('0x4c')](handleError(_0xb95266,null));};exports['addCustomerAvatar']=function(_0x3738f9,_0x3ba04e){_0x3738f9[_0xa757('0x4e')][_0xa757('0x62')]=_0x3738f9[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x3738f9[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3ba04e,null))[_0xa757('0x11')](saveUpdates(_0x3738f9[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x3ba04e,null))[_0xa757('0x4c')](handleError(_0x3ba04e,null));};exports[_0xa757('0x63')]=function(_0x56a060,_0x4af060){_0x56a060[_0xa757('0x4e')]['systemAvatar']=_0x56a060[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x56a060['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4af060,null))[_0xa757('0x11')](saveUpdates(_0x56a060[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x4af060,null))[_0xa757('0x4c')](handleError(_0x4af060,null));};exports[_0xa757('0x64')]=function(_0x526b82,_0x3cb1ec){var _0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x67'));var _0x4b1c4c={'where':{'id':_0x526b82['params']['id']},'attributes':['id',_0xa757('0x5d')],'raw':!![]};var _0x531cba=![];return require(_0xa757('0x68'))['getLicense']()[_0xa757('0x11')](function(_0x1dee22){if(_0x1dee22){_0x531cba=_0x1dee22[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x4b1c4c);})[_0xa757('0x11')](handleEntityNotFound(_0x3cb1ec,null))[_0xa757('0x11')](function(_0x2ac258){if(_0x2ac258){if(!_[_0xa757('0x6a')](_0x2ac258[_0xa757('0x5d')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6b'),_0x2ac258[_0xa757('0x5d')]))&&_0x531cba){_0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/logos/',_0x2ac258[_0xa757('0x5d')]);}}return _0x3cb1ec[_0xa757('0x6c')](_0x3cca3e);}})['catch'](handleError(_0x3cb1ec,null));};exports[_0xa757('0x6d')]=function(_0x68a80b,_0x1f4782){var _0x5e6171=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6e'));var _0xfdd493={'where':{'id':_0x68a80b[_0xa757('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0xfdd493)['then'](handleEntityNotFound(_0x1f4782,null))[_0xa757('0x11')](function(_0x544ed2){if(_0x544ed2){if(!_['isNil'](_0x544ed2[_0xa757('0x60')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x544ed2[_0xa757('0x60')]))){_0x5e6171=path['join'](config['root'],'server/files/images/avatars/',_0x544ed2['agentAvatar']);}}return _0x1f4782['download'](_0x5e6171);}})['catch'](handleError(_0x1f4782,null));};exports['getCustomerAvatar']=function(_0x1c9b81,_0x536b96){var _0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x71'));var _0x46fd6b={'where':{'id':_0x1c9b81[_0xa757('0x53')]['id']},'attributes':['id',_0xa757('0x62'),_0xa757('0x72')],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0x46fd6b)['then'](handleEntityNotFound(_0x536b96,null))[_0xa757('0x11')](function(_0x3147eb){if(_0x3147eb){if(!_[_0xa757('0x6a')](_0x3147eb[_0xa757('0x62')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x3147eb[_0xa757('0x62')]))&&_0x3147eb[_0xa757('0x72')]){_0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/avatars/',_0x3147eb[_0xa757('0x62')]);}}return _0x536b96[_0xa757('0x6c')](_0x1ba0df);}})['catch'](handleError(_0x536b96,null));};exports[_0xa757('0x73')]=function(_0x3924af,_0x332c68){var _0x18fa30=path[_0xa757('0x65')](config['root'],_0xa757('0x74'));var _0x237c6f={'where':{'id':_0x3924af[_0xa757('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x237c6f)[_0xa757('0x11')](handleEntityNotFound(_0x332c68,null))['then'](function(_0x21aeae){if(_0x21aeae){if(!_[_0xa757('0x6a')](_0x21aeae[_0xa757('0x75')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config['root'],_0xa757('0x70'),_0x21aeae['systemAvatar']))){_0x18fa30=path['join'](config[_0xa757('0x66')],_0xa757('0x70'),_0x21aeae[_0xa757('0x75')]);}}return _0x332c68[_0xa757('0x6c')](_0x18fa30);}})['catch'](handleError(_0x332c68,null));};exports[_0xa757('0x76')]=function(_0x36c462,_0x4735a9){var _0x2aa91b=require(_0xa757('0x77'));var _0x3e660e=new _0x2aa91b();var _0x182d4f=_0x3e660e[_0xa757('0x78')](_0x36c462['headers'][_0xa757('0x79')])[_0xa757('0x7a')]();var _0x1e6f99={'body':_0x36c462[_0xa757('0x4e')],'channel':_0xa757('0x7b')};var _0x182d71=[];var _0x3addae=[];var _0x4024d1={};var _0x160872=![];return db['CmContact']['describe']()[_0xa757('0x11')](function(_0x59b351){if(!_0x59b351){throw new db['Sequelize'][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x182d71=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f')]);_0x3addae=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),'ListId']);if(_0x36c462[_0xa757('0x4e')]['id']){delete _0x36c462[_0xa757('0x4e')]['id'];}if(_['isNil'](_0x36c462[_0xa757('0x4e')][_0xa757('0x81')])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0x83'));}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')])||_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')]['mapKey'])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}if(!_[_0xa757('0x84')](_0x3addae,_0x36c462[_0xa757('0x4e')][_0xa757('0x85')])){throw new db[(_0xa757('0x82'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}_0x4024d1[_0x36c462[_0xa757('0x4e')]['mapKey']]=_0x36c462[_0xa757('0x4e')]['from'];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x36c462[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa757('0x87'),'where':_0x4024d1,'limit':0x1,'order':[[_0xa757('0x7f'),_0xa757('0x88')]]}]},{'model':db[_0xa757('0x89')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x4735a9,null))[_0xa757('0x11')](function(_0x50ff83){if(_0x50ff83&&_0x50ff83[_0xa757('0x8a')]){_0x1e6f99[_0xa757('0x8b')]=_0x50ff83;_0x1e6f99[_0xa757('0x8c')]=_0x50ff83[_0xa757('0x8d')];_0x1e6f99[_0xa757('0x8e')]=_0x50ff83[_0xa757('0x8a')];_0x1e6f99[_0xa757('0x8c')]=_['orderBy'](_0x1e6f99[_0xa757('0x8c')],[_0xa757('0x8f')],[_0xa757('0x90')]);if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')]){delete _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')];}if(_0x1e6f99['account']['List']&&_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')][_0xa757('0x87')][_0xa757('0x39')]){return _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')]['Contacts'][0x0];}var _0x244c9b=_['defaults'](_0x36c462[_0xa757('0x4e')],{'firstName':_0x36c462[_0xa757('0x4e')][_0xa757('0x81')],'ListId':_0x50ff83[_0xa757('0x91')]});_0x244c9b[_0x36c462[_0xa757('0x4e')][_0xa757('0x85')]]=_0x36c462[_0xa757('0x4e')][_0xa757('0x81')];return db[_0xa757('0x92')][_0xa757('0x4d')](_0x244c9b,{'fields':_0x182d71,'raw':!![]});}})['then'](handleEntityNotFound(_0x4735a9,null))['then'](function(_0x3e025a){_0x1e6f99['contact']=_0x3e025a;var _0x4bd0a6=_0x36c462[_0xa757('0x4e')][_0xa757('0x93')];if(_0x36c462['headers'][_0xa757('0x94')]){_0x4bd0a6=_0x36c462['headers'][_0xa757('0x94')];}else if(_0x36c462[_0xa757('0x95')][_0xa757('0x96')]){_0x4bd0a6=_[_0xa757('0x97')](_0x36c462[_0xa757('0x95')][_0xa757('0x96')][_0xa757('0x98')](','));}if(_0x3e025a){var _0x44d742={'ContactId':_0x3e025a['id'],'ChatWebsiteId':_0x36c462['params']['id'],'from':(_0x3e025a['firstName']||'')+'\x20'+(_0x3e025a[_0xa757('0x99')]||''),'customerIp':_0x4bd0a6,'customerPort':_0x36c462['headers'][_0xa757('0x9a')]?_0x36c462[_0xa757('0x95')][_0xa757('0x9a')]:null,'referer':_0x36c462[_0xa757('0x4e')][_0xa757('0x9b')],'browserName':_0x182d4f[_0xa757('0x9c')][_0xa757('0x29')]&&_0x182d4f[_0xa757('0x9c')]['version']?util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['browser'][_0xa757('0x29')],_0x182d4f[_0xa757('0x9c')][_0xa757('0x9e')]):_0xa757('0x9f'),'browserVersion':_0x182d4f['browser'][_0xa757('0x9e')]||'unknown','osName':util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['os'][_0xa757('0x29')],_0x182d4f['os'][_0xa757('0x9e')]),'osVersion':_0x182d4f['os']['version'],'deviceModel':_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')]&&_0x182d4f['device'][_0xa757('0xa1')]?util[_0xa757('0x9d')](_0xa757('0xa2'),_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')],_0x182d4f[_0xa757('0xa0')][_0xa757('0xa1')],_0x182d4f['device'][_0xa757('0x31')]):null,'deviceVendor':_0x182d4f[_0xa757('0xa0')]['vendor'],'deviceType':_0x182d4f['device'][_0xa757('0x31')],'formData':JSON[_0xa757('0x17')](_0x36c462[_0xa757('0x4e')])};var _0x1612d5={'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'closed':![]};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]){_0x1612d5[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x5758db){if(_0x5758db){return[_0x5758db,![]];}_0x44d742[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];_0x44d742['externalUrl']=_0x36c462['body'][_0xa757('0xa5')];return db[_0xa757('0xa4')]['create'](_0x44d742)[_0xa757('0x11')](function(_0xa50160){return[_0xa50160,!![]];});});}_0x1612d5['ContactId']=_0x3e025a['id'];if(_0x36c462[_0xa757('0x4e')]['interaction']&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id']){_0x1612d5['id']=_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id'];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x69af1f){if(_0x69af1f){return[_0x69af1f,![]];}return db['ChatInteraction'][_0xa757('0x4d')](_0x44d742)['then'](function(_0x49f140){return[_0x49f140,!![]];});});}return db[_0xa757('0xa4')][_0xa757('0x4d')](_0x44d742)['then'](function(_0x488019){return[_0x488019,!![]];});}})['spread'](function(_0x31084d,_0x1f0e18){if(_0x31084d){_0x160872=_0x1f0e18;if(!_0x1f0e18){var _0x10cf3b={'from':(_0x1e6f99['contact'][_0xa757('0xa7')]||'')+'\x20'+(_0x1e6f99[_0xa757('0xa8')][_0xa757('0x99')]||'')};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')]&&_0x36c462[_0xa757('0x4e')]['threadId']!=_0x36c462[_0xa757('0x4e')]['messageId']){_0x10cf3b[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')];}return _0x31084d[_0xa757('0x23')](_0x10cf3b);}else{return _0x31084d;}}})[_0xa757('0x11')](function(_0x56c40e){_0x1e6f99[_0xa757('0xa6')]=_0x56c40e['get']({'plain':!![]});_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]=_0x160872;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]){if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0xab')]){_0x1e6f99[_0xa757('0x8c')][_0xa757('0xac')]({'id':0x0,'priority':_0x1e6f99[_0xa757('0x8c')]['length']+0x1,'app':'close','appdata':_0xa757('0xad'),'interval':_0xa757('0xae')});}}return db['ChatMessage'][_0xa757('0x4d')]({'body':_0x36c462[_0xa757('0x4e')]['body'],'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'ChatInteractionId':_0x56c40e['id'],'direction':'in','ContactId':_0x1e6f99['contact']['id'],'AttachmentId':_0x36c462[_0xa757('0x4e')][_0xa757('0xaf')]});})[_0xa757('0x11')](function(_0x2bdbdf){_0x1e6f99[_0xa757('0x1a')]=_0x2bdbdf;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]){return db[_0xa757('0xb1')][_0xa757('0x4b')]({'attributes':['id',_0xa757('0x29')],'where':{'id':_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]}})[_0xa757('0x11')](function(_0x5005fa){if(_0x5005fa){_0x1e6f99['applications'][_0xa757('0xb2')]({'id':0x0,'priority':0x0,'app':_0xa757('0xb3'),'appdata':_0x5005fa[_0xa757('0x29')]+','+(_0x1e6f99['account'][_0xa757('0xb4')]||0xa),'interval':_0xa757('0xae')});_0x1e6f99[_0xa757('0xb5')]=!![];}return respondWithRpcPromise(_0xa757('0xb6'),_0xa757('0xb7'),_0x1e6f99);});}return respondWithRpcPromise('Start','startRouting',_0x1e6f99);})[_0xa757('0x11')](function(_0x4606e1){respondWithRpcPromise(_0xa757('0xb8'),'EventManager',{'event':_0xa757('0x76'),'message':_0x4606e1},client9002);return _0x4606e1;})[_0xa757('0x11')](respondWithResult(_0x4735a9,null))['catch'](handleError(_0x4735a9,null));};exports[_0xa757('0xb9')]=function(_0x39527f,_0x257371){var _0x4f8908,_0x41d5d1,_0x5ae589;var _0x1b702f=[];var _0x3540ca={};var _0x22939e=_0x39527f[_0xa757('0xba')]||[];var _0x36ea16=[];var _0x53949c;return db[_0xa757('0x92')]['describe']()[_0xa757('0x11')](function(_0x439650){if(!_0x439650){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x1b702f=_['difference'](_[_0xa757('0x35')](_0x439650),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),_0xa757('0x91')]);if(_0x39527f['body']['id']){delete _0x39527f['body']['id'];}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')][_0xa757('0x81')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))]['ValidationError'](_0xa757('0x83')));}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')]['body'])||_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbc')));}if(_['isNil'](_0x39527f[_0xa757('0x4e')][_0xa757('0xbd')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbe')+_0x1b702f));}if(!_['includes'](_0x1b702f,_0x39527f[_0xa757('0x4e')]['mapKeyOffline'])){throw _0x257371[_0xa757('0x1d')](0x1f4)['send'](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbf')+_0x1b702f));}_0x3540ca[_0x39527f['body']['mapKeyOffline']]=_0x39527f['body'][_0xa757('0x81')];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39527f['params']['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List'},{'model':db[_0xa757('0xc0')],'as':_0xa757('0xc0')}]});})[_0xa757('0x11')](handleEntityNotFound(_0x257371,null))['then'](function(_0x42d869){if(_0x42d869&&_0x42d869['List']){_0x41d5d1=_0x42d869;var _0x2cd549=_[_0xa757('0xc1')](_0x39527f['body'],{'firstName':_0x39527f[_0xa757('0x4e')][_0xa757('0x81')],'phone':_0x39527f[_0xa757('0x4e')]['from'],'ListId':_0x42d869['ListId']});_0x2cd549[_0x39527f['body'][_0xa757('0xbd')]]=_0x39527f[_0xa757('0x4e')]['from'];return db['CmContact'][_0xa757('0xc2')]({'where':_0x3540ca,'defaults':_0x2cd549});}})[_0xa757('0xc3')](function(_0x1b7a7b){if(_0x1b7a7b){_0x5ae589=_0x1b7a7b;var _0x4da912=fs['readFileSync'](path['join'](config[_0xa757('0x66')],_0xa757('0xc4')),_0xa757('0xc5'));var _0x330523=ejs[_0xa757('0xc6')](_0x4da912,{'body':_[_0xa757('0xc7')](_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]),'bodyTitle':_0x41d5d1['offlineMessageBody']});return db[_0xa757('0xc8')][_0xa757('0x4d')]({'body':_0x330523,'plainBody':htmlToText['fromString'](_0x330523),'ContactId':_0x1b7a7b['id'],'ChatWebsiteId':_0x41d5d1['id']});}})[_0xa757('0x11')](function(_0x28ef9c){_0x53949c=_0x28ef9c;if(_0x22939e[_0xa757('0x39')]){var _0x34b501=_0x22939e[_0xa757('0x2d')](function(_0x9b7857){return{'name':_0x9b7857[_0xa757('0xc9')],'basename':_0x9b7857[_0xa757('0x61')],'type':_0x9b7857[_0xa757('0xca')],'ChatOfflineMessageId':_0x28ef9c['id']};});_0x36ea16=_0x34b501[_0xa757('0x2d')](_0x39afb0=>{var _0x1c55ad={'filename':_0x39afb0['name'],'path':path['join'](config[_0xa757('0x66')],_0xa757('0xcb'),_0xa757('0xba'),_0xa757('0xcc'),_0xa757('0xcd'),_0x39afb0[_0xa757('0xce')])};return _0x1c55ad;});if(!_0x41d5d1[_0xa757('0xcf')]){return db['sequelize'][_0xa757('0xd0')](function(_0x2266db){return db[_0xa757('0xd1')][_0xa757('0xd2')](_0x34b501,{'transaction':_0x2266db});});}}})[_0xa757('0x11')](function(){if(_0x53949c){_0x4f8908=_0x53949c;return db[_0xa757('0xc0')][_0xa757('0xd3')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xa757('0xd4'),'raw':!![]}]});}})[_0xa757('0x11')](function(_0x4ddabe){if(_0x4ddabe&&_0x4ddabe['Smtp']&&_0x41d5d1['forwardOffline']&&_0x41d5d1[_0xa757('0xd5')]){var _0x50f3e3={'tls':{'rejectUnauthorized':![]}};if(_0x4ddabe['Smtp'][_0xa757('0xd6')]){_0x50f3e3[_0xa757('0xd6')]=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd6')];}else{_0x50f3e3['host']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd7')];_0x50f3e3['port']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd8')];_0x50f3e3[_0xa757('0xd9')]=_0x4ddabe[_0xa757('0xd4')]['secure'];}if(_0x4ddabe[_0xa757('0xd4')][_0xa757('0xda')]){_0x50f3e3[_0xa757('0xdb')]={'user':_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')],'pass':_0x4ddabe[_0xa757('0xd4')][_0xa757('0xdc')]};}return respondWithRpcPromise(_0xa757('0xdd'),_0xa757('0xde'),{'account':_0x50f3e3,'message':{'from':util['format'](_0xa757('0xdf'),_0x4ddabe[_0xa757('0x29')],_0x4ddabe[_0xa757('0xe0')]||_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')]),'to':_0x41d5d1[_0xa757('0xd5')],'subject':_0x41d5d1[_0xa757('0xe1')],'html':_0x4f8908['body'],'attachments':_0x36ea16}},client9003)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2fa389){console[_0xa757('0x18')](_0x2fa389);});}})[_0xa757('0x11')](function(){if(_0x41d5d1&&_0x41d5d1[_0xa757('0xcf')]&&_0x41d5d1[_0xa757('0xe2')]){var _0x1eeff5=[];if(_0x22939e[_0xa757('0x39')]){_0x1eeff5=_0x22939e['map'](function(_0xe4b4ab){return{'name':_0xe4b4ab['originalname'],'basename':_0xe4b4ab['filename'],'type':_0xe4b4ab[_0xa757('0xca')],'ChatOfflineMessageId':_0x53949c['id']};});}var _0x48cf01;if(!_[_0xa757('0x6a')](_0x41d5d1[_0xa757('0xe3')])){var _0x54f4ca=_[_0xa757('0x2d')](_0x39527f['body'],function(_0x522478){return _0x522478;});var _0x451ca7=_['toPairsIn'](_0x54f4ca)[0x0];var _0x5730f3=_['mapValues'](_0x451ca7,function(_0x52aed8){return _0x52aed8;});_0x48cf01=_0x5730f3[0x1][_0x41d5d1['subjectOffline']];}var _0x3a98f9={'from':_0x5ae589[_0xa757('0xe0')],'firstName':_0x5ae589[_0xa757('0xa7')],'lastName':_0x5ae589[_0xa757('0x99')],'mapKey':'email','message':{'from':_0x5ae589[_0xa757('0xe0')],'to':_0x41d5d1[_0xa757('0xc0')][_0xa757('0xe0')],'cc':'','subject':_[_0xa757('0x6a')](_0x48cf01)?_0x41d5d1[_0xa757('0xe1')]:_0x48cf01,'messageId':'','sentAt':new Date(),'attach':_0x1eeff5[_0xa757('0x39')],'attachments':_0x1eeff5,'originChannel':_0xa757('0xe4'),'ChatWebsiteId':_0x41d5d1['id'],'ChatOfflineMessageId':_0x4f8908['id'],'originTo':_0x41d5d1['MailAccount'][_0xa757('0xe0')]},'body':_0x4f8908[_0xa757('0x4e')]};var _0x5be779={'account':{'id':_0x41d5d1[_0xa757('0xe2')]},'body':_0x3a98f9,'log':_0xa757('0xe5')};return respondWithRpcPromise('NotifyMailAccount',_0xa757('0xe6'),_0x5be779,client9001)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2aaf2a){console[_0xa757('0x18')](_0x2aaf2a);});}return;})[_0xa757('0x11')](function(){if(_0x4f8908){return _0x4f8908;}})[_0xa757('0x11')](respondWithResult(_0x257371,null))['catch'](function(_0x3d79d4){console[_0xa757('0x18')](_0xa757('0x4c'),_0x3d79d4);for(var _0x2f667c of _0x22939e){var _0x531b88=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0xcb'),'files',_0xa757('0xcc'),_0xa757('0xcd'),_0x2f667c['filename']);fs_extra[_0xa757('0xe7')](_0x531b88)['catch'](function(_0x1c38cb){console['error'](_0xa757('0xe8'),_0x531b88,_0x1c38cb);});}});};exports[_0xa757('0xe9')]=function(_0x3039d7,_0x58f20d){return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':{'id':_0x3039d7[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x58f20d,null))[_0xa757('0x11')](function(_0x4b274f){if(_0x4b274f){return _0x4b274f[_0xa757('0xe9')](_0x3039d7[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x3039d7[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0x58f20d,null))[_0xa757('0x4c')](handleError(_0x58f20d,null));};exports[_0xa757('0xeb')]=function(_0x35a0d8,_0x430ed6){var _0x31dba9={'raw':![],'where':{}};var _0x3eb7d4={};var _0x1b8b13={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa757('0xd3')]({'where':{'id':_0x35a0d8['params']['id']}})['then'](handleEntityNotFound(_0x430ed6,null))[_0xa757('0x11')](function(_0x3655fa){if(_0x3655fa){_0x3eb7d4[_0xa757('0x33')]=_['keys'](db[_0xa757('0xa4')]['rawAttributes']);_0x3eb7d4[_0xa757('0x34')]=_[_0xa757('0x35')](_0x35a0d8['query']);_0x3eb7d4[_0xa757('0x40')]=_['intersection'](_0x3eb7d4[_0xa757('0x33')],_0x3eb7d4[_0xa757('0x34')]);_0x31dba9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x3eb7d4[_0xa757('0x33')],qs[_0xa757('0x38')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x38')]));_0x31dba9[_0xa757('0x37')]=_0x31dba9[_0xa757('0x37')][_0xa757('0x39')]?_0x31dba9['attributes']:_0x3eb7d4[_0xa757('0x33')];if(!_0x35a0d8[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x31dba9[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x21')]);_0x31dba9['offset']=qs[_0xa757('0x3c')](_0x35a0d8['query'][_0xa757('0x3c')]);}_0x31dba9[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x3e')]);_0x31dba9['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x35a0d8[_0xa757('0x34')],_0x3eb7d4['filters']));_0x31dba9[_0xa757('0x3f')]['ChatWebsiteId']=_0x3655fa['id'];if(_0x35a0d8['query'][_0xa757('0x42')]){_0x31dba9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x31dba9[_0xa757('0x3f')],{'$or':_['map'](_0x31dba9[_0xa757('0x37')],function(_0xdc5215){var _0x41c5ec={};_0x41c5ec[_0xdc5215]={'$like':'%'+_0x35a0d8[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x41c5ec;})});}_0x31dba9=_['merge']({},_0x31dba9,_0x35a0d8['options']);return db['ChatInteraction']['count']({'where':_0x31dba9[_0xa757('0x3f')]})['then'](function(_0xb64ce5){_0x1b8b13[_0xa757('0x46')]=_0xb64ce5;if(_0x35a0d8[_0xa757('0x34')][_0xa757('0x56')]){_0x31dba9[_0xa757('0x47')]=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xb1')],'as':_0xa757('0xed'),'attributes':[_0xa757('0x29'),_0xa757('0xee'),_0xa757('0xef')],'required':![]},{'model':db[_0xa757('0xf0')],'as':_0xa757('0xf1'),'attributes':['id',_0xa757('0x29'),_0xa757('0xf2')],'where':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?{'id':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]}:undefined,'required':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?!![]:![]}];}return db[_0xa757('0xa4')][_0xa757('0x48')](_0x31dba9);})[_0xa757('0x11')](function(_0x1f0f82){_0x1b8b13[_0xa757('0x49')]=_0x1f0f82;return _0x1b8b13;});}})[_0xa757('0x11')](respondWithFilteredResult(_0x430ed6,_0x31dba9))['catch'](handleError(_0x430ed6,null));};function iftimePromise(_0x3bd029,_0x2f37ca){return respondWithRpcPromise(_0xa757('0xf4'),_0xa757('0xf5'),{'command':_0x2f37ca['timezone']?util[_0xa757('0x9d')](_0xa757('0xf6'),_0x3bd029[_0xa757('0xf7')],_0x2f37ca[_0xa757('0xf8')]):util[_0xa757('0x9d')](_0xa757('0xf9'),_0x3bd029[_0xa757('0xf7')])},client9002)[_0xa757('0x11')](function(_0x7e03ff){var _0x1bb7ed=_0x7e03ff&&_0x7e03ff[_0xa757('0xfa')](_0xa757('0xfb'))>=0x0?!![]:![];logger[_0xa757('0x12')](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029['interval'],_0x1bb7ed?_0xa757('0xfd'):_0xa757('0xfe'),_0x2f37ca['timezone']?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return _0x1bb7ed;})[_0xa757('0x4c')](function(_0x466f7b){logger['error'](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029[_0xa757('0xf7')],util[_0xa757('0x100')](_0x466f7b,{'showHidden':![],'depth':null}),_0x2f37ca[_0xa757('0xf8')]?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return![];});}exports[_0xa757('0xf5')]=function(_0x195707,_0x32311d){var _0x1d83a8=0x0;var _0x2da3b2=0x0;var _0x4f10fc=![];var _0x5d427d;var _0x5ad837;return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x195707[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x101'),'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x102'),'attributes':['id',_0xa757('0xf7')],'raw':!![]}]}]})[_0xa757('0x11')](handleEntityNotFound(_0x32311d,null))[_0xa757('0x11')](function(_0x46c664){if(_0x46c664){_0x5d427d=_0x46c664;return _0x46c664[_0xa757('0x103')]({'raw':!![]});}})[_0xa757('0x11')](function(_0x7af4cd){if(_0x5d427d){if(_0x7af4cd){_0x5ad837=_0x7af4cd;}}return require(_0xa757('0x68'))[_0xa757('0x104')]();})[_0xa757('0x11')](function(_0x38727a){if(_0x38727a){_0x2da3b2=_0x38727a[_0xa757('0x105')];_0x4f10fc=_0x38727a[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0xa4')][_0xa757('0x46')]({'where':{'closed':![]}});})[_0xa757('0x11')](function(_0x196823){_0x1d83a8=_0x196823;if(_0x2da3b2&&_0x196823>_0x2da3b2){return db['License'][_0xa757('0xd3')]({'where':{'id':0x1}})[_0xa757('0x11')](function(_0x2328eb){if(_0x2328eb){_0x2328eb[_0xa757('0x106')]('chatLicenseExceeded');}});}})[_0xa757('0x11')](function(){if(_0x5d427d['Interval']&&_0x5d427d[_0xa757('0x101')][_0xa757('0x102')]){var _0x1a2818=[];for(var _0x56b7f3=0x0;_0x56b7f3<_0x5d427d[_0xa757('0x101')]['Intervals']['length'];_0x56b7f3++){var _0x411c88=_0x5d427d[_0xa757('0x101')]['Intervals'][_0x56b7f3][_0xa757('0x25')]({'plain':!![]});_0x1a2818[_0xa757('0xac')](iftimePromise(_0x411c88,_0x5d427d));}return BPromise[_0xa757('0x107')](_0x1a2818)[_0xa757('0x11')](function(_0x39442a){return _[_0xa757('0x108')](_0x39442a);});}else{return!![];}})[_0xa757('0x11')](function(_0x3ef371){var _0x46465a=fs[_0xa757('0x109')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x10a')),_0xa757('0xc5'));var _0x466b78={'remote':_0x5d427d[_0xa757('0x10b')],'query':querystring[_0xa757('0x17')](_[_0xa757('0x43')](_0x5d427d[_0xa757('0x25')]({'plain':!![]}),{'customerIp':_0x195707['headers']['x-forwarded-for']||_0x195707[_0xa757('0x95')][_0xa757('0x10c')]||_0x195707[_0xa757('0x10d')][_0xa757('0x10e')]||_0x195707['ip'],'referer':_0x195707[_0xa757('0x95')][_0xa757('0x9b')],'openedInteractions':_0x1d83a8,'maxInteractions':_0x2da3b2,'virtual':_0x4f10fc[_0xa757('0x105')],'online':_0x3ef371,'custom':_0x4f10fc}))['replace'](/'/g,'\x5c\x27')};_0x32311d[_0xa757('0xbb')](ejs[_0xa757('0xc6')](Mustache[_0xa757('0xc6')](_0x46465a,_0x466b78),{'proactiveActions':_0x5ad837,'alignment':_0x5d427d[_0xa757('0x10f')],'verticalAlignment':_0x5d427d[_0xa757('0x110')],'div_color':_0x5d427d['color'],'labelText':_0x5d427d[_0xa757('0x111')],'text_color':_0x5d427d['textColor'],'button_color':_0x5d427d[_0xa757('0x112')],'background_color':_0x5d427d['backgroundColor']}));})[_0xa757('0x4c')](handleError(_0x32311d,null));};exports[_0xa757('0x113')]=function(_0x52a8a8,_0x59039a){var _0x2892a7=_0x52a8a8[_0xa757('0x53')]['id'];var _0x54a489=_0x52a8a8[_0xa757('0x4e')];var _0xe21512=0xc8;var _0x25aad1=null;return db[_0xa757('0x114')][_0xa757('0xd0')]({'isolationLevel':db[_0xa757('0x114')]['Transaction'][_0xa757('0x115')][_0xa757('0x116')]},function(_0x1132f2){return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(_0x1e3ee8){if(_0x1e3ee8){return db[_0xa757('0x89')][_0xa757('0x24')]({'where':{'ChatWebsiteId':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(){var _0x17135b=_[_0xa757('0x2d')](_0x54a489,function(_0x4ebd06){_0x4ebd06[_0xa757('0x54')]=_0x2892a7;return _0x4ebd06;});return db[_0xa757('0x89')][_0xa757('0xd2')](_0x17135b,{'transaction':_0x1132f2});});}else{_0xe21512=0x194;_0x25aad1=[];}});})[_0xa757('0x11')](function(){if(_0xe21512!==0x194){return db['ChatApplication'][_0xa757('0x117')]({'where':{'ChatWebsiteId':_0x2892a7},'order':_0xa757('0x8f')})[_0xa757('0x11')](function(_0x141d20){_0x25aad1=_0x141d20;});}})[_0xa757('0x4c')](function(_0x54f67c){_0xe21512=0x1f4;logger[_0xa757('0x18')](_0x54f67c[_0xa757('0x28')]);if(_0x54f67c[_0xa757('0x29')]){delete _0x54f67c[_0xa757('0x29')];}_0x25aad1=_0x54f67c;})[_0xa757('0x118')](function(){if(_0x25aad1===null){_0x59039a[_0xa757('0x1c')](_0xe21512);}else{if(_0xe21512===0x1f4){_0x59039a[_0xa757('0x1d')](_0xe21512)[_0xa757('0xbb')](_0x25aad1);}else{_0x59039a[_0xa757('0x1d')](_0xe21512)['json'](_0x25aad1);}}});};exports[_0xa757('0x119')]=function(_0x505a2a,_0x344d13){var _0x5836cd={};var _0x35fe4e={};var _0x418eeb;var _0xc25de1;return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x505a2a[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x344d13,null))[_0xa757('0x11')](function(_0x16a500){if(_0x16a500){_0x418eeb=_0x16a500;_0x35fe4e[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x89')][_0xa757('0x2f')]);_0x35fe4e[_0xa757('0x34')]=_[_0xa757('0x35')](_0x505a2a[_0xa757('0x34')]);_0x35fe4e[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],_0x35fe4e[_0xa757('0x34')]);_0x5836cd[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],qs[_0xa757('0x38')](_0x505a2a[_0xa757('0x34')][_0xa757('0x38')]));_0x5836cd[_0xa757('0x37')]=_0x5836cd[_0xa757('0x37')]['length']?_0x5836cd[_0xa757('0x37')]:_0x35fe4e[_0xa757('0x33')];_0x5836cd[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x505a2a[_0xa757('0x34')][_0xa757('0x3e')]);_0x5836cd[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x505a2a[_0xa757('0x34')],_0x35fe4e['filters']));if(_0x505a2a['query'][_0xa757('0x42')]){_0x5836cd[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x5836cd[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x5836cd['attributes'],function(_0xf19c44){var _0x648a92={};_0x648a92[_0xf19c44]={'$like':'%'+_0x505a2a[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x648a92;})});}_0x5836cd=_[_0xa757('0x43')]({},_0x5836cd,_0x505a2a[_0xa757('0x45')]);return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x4c53e3){if(_0x4c53e3){_0xc25de1=_0x4c53e3[_0xa757('0x39')];if(!_0x505a2a[_0xa757('0x34')]['hasOwnProperty']('nolimit')){_0x5836cd['limit']=qs[_0xa757('0x21')](_0x505a2a[_0xa757('0x34')][_0xa757('0x21')]);_0x5836cd[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x505a2a[_0xa757('0x34')]['offset']);}return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x14ab00){if(_0x14ab00){return _0x14ab00?{'count':_0xc25de1,'rows':_0x14ab00}:null;}})[_0xa757('0x11')](respondWithResult(_0x344d13,null))[_0xa757('0x4c')](handleError(_0x344d13,null));};exports['addProactiveActions']=function(_0x34cd11,_0xd8ff77){return db[_0xa757('0x11a')][_0xa757('0x4b')]({'where':{'id':_0x34cd11[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0xd8ff77,null))[_0xa757('0x11')](function(_0x5da427){if(_0x5da427){return _0x5da427[_0xa757('0x11b')](_0x34cd11[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x34cd11[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0xd8ff77,null))[_0xa757('0x4c')](handleError(_0xd8ff77,null));};exports[_0xa757('0x103')]=function(_0x4067a2,_0x2e8eb6){var _0x3e454d={};var _0x265365={};var _0x3b12e9;var _0x1b753b;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x4067a2[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e8eb6,null))[_0xa757('0x11')](function(_0x119e10){if(_0x119e10){_0x3b12e9=_0x119e10;_0x265365['model']=_[_0xa757('0x35')](db[_0xa757('0x11c')]['rawAttributes']);_0x265365['query']=_[_0xa757('0x35')](_0x4067a2[_0xa757('0x34')]);_0x265365[_0xa757('0x40')]=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],_0x265365[_0xa757('0x34')]);_0x3e454d['attributes']=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],qs['fields'](_0x4067a2[_0xa757('0x34')][_0xa757('0x38')]));_0x3e454d['attributes']=_0x3e454d['attributes']['length']?_0x3e454d[_0xa757('0x37')]:_0x265365[_0xa757('0x33')];_0x3e454d['order']=qs[_0xa757('0x3e')](_0x4067a2['query'][_0xa757('0x3e')]);_0x3e454d[_0xa757('0x3f')]=qs['filters'](_['pick'](_0x4067a2[_0xa757('0x34')],_0x265365[_0xa757('0x40')]));if(_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]){_0x3e454d[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x3e454d['where'],{'$or':_[_0xa757('0x2d')](_0x3e454d[_0xa757('0x37')],function(_0x5c371b){var _0x5c1bae={};_0x5c1bae[_0x5c371b]={'$like':'%'+_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x5c1bae;})});}_0x3e454d=_['merge']({},_0x3e454d,_0x4067a2['options']);return _0x3b12e9['getProactiveActions'](_0x3e454d);}})[_0xa757('0x11')](function(_0x21a21d){if(_0x21a21d){_0x1b753b=_0x21a21d[_0xa757('0x39')];if(!_0x4067a2[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3e454d[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x4067a2['query']['limit']);_0x3e454d[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x4067a2['query'][_0xa757('0x3c')]);}return _0x3b12e9[_0xa757('0x103')](_0x3e454d);}})[_0xa757('0x11')](function(_0x2d94f8){if(_0x2d94f8){return _0x2d94f8?{'count':_0x1b753b,'rows':_0x2d94f8}:null;}})[_0xa757('0x11')](respondWithResult(_0x2e8eb6,null))[_0xa757('0x4c')](handleError(_0x2e8eb6,null));};exports[_0xa757('0x11d')]=function(_0x26957f,_0x3c7bf7){var _0x1d431e=_0x26957f[_0xa757('0x34')]['online']===_0xa757('0x11e')?_0xa757('0x11f'):_0xa757('0x120');return db['ChatWebsite'][_0xa757('0x4b')]({'attributes':['id',_0x1d431e],'where':{'id':_0x26957f[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c7bf7,null))[_0xa757('0x11')](function(_0x325afa){if(_0x325afa){var _0x4be11c=_0x325afa[_0x1d431e];var _0x2c06d5=_0x4be11c&&_0x4be11c[_0xa757('0x121')]?_0x4be11c[_0xa757('0x121')]:[];_0x3c7bf7[_0xa757('0xbb')]({'fromKey':_[_0xa757('0x6a')](_0x4be11c[_0xa757('0x122')])?undefined:_0x4be11c['fromKey'],'count':_0x2c06d5[_0xa757('0x39')],'rows':_0x2c06d5});}})[_0xa757('0x4c')](handleError(_0x3c7bf7,null));};exports[_0xa757('0x123')]=function(_0x193bd6,_0x4ed18b){var _0x3ae2d6={'raw':![],'where':{}};var _0x1f687b={};var _0x40d442={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x193bd6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4ed18b,null))['then'](function(_0x5cce3e){if(_0x5cce3e){_0x1f687b[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0xc8')][_0xa757('0x2f')]);_0x1f687b['query']=_[_0xa757('0x35')](_0x193bd6[_0xa757('0x34')]);_0x1f687b[_0xa757('0x40')]=_[_0xa757('0x36')](_0x1f687b['model'],_0x1f687b[_0xa757('0x34')]);_0x3ae2d6[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1f687b[_0xa757('0x33')],qs[_0xa757('0x38')](_0x193bd6[_0xa757('0x34')][_0xa757('0x38')]));_0x3ae2d6[_0xa757('0x37')]=_0x3ae2d6[_0xa757('0x37')][_0xa757('0x39')]?_0x3ae2d6[_0xa757('0x37')]:_0x1f687b[_0xa757('0x33')];if(!_0x193bd6[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3ae2d6[_0xa757('0x21')]=qs['limit'](_0x193bd6[_0xa757('0x34')][_0xa757('0x21')]);_0x3ae2d6['offset']=qs[_0xa757('0x3c')](_0x193bd6[_0xa757('0x34')][_0xa757('0x3c')]);}_0x3ae2d6[_0xa757('0x3d')]=qs['sort'](_0x193bd6[_0xa757('0x34')][_0xa757('0x3e')]);_0x3ae2d6['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x193bd6[_0xa757('0x34')],_0x1f687b[_0xa757('0x40')]));_0x3ae2d6['where'][_0xa757('0x54')]=_0x5cce3e['id'];if(_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]){_0x3ae2d6['where']=_['merge'](_0x3ae2d6[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x3ae2d6[_0xa757('0x37')],function(_0x5df3a1){var _0x3949b5={};_0x3949b5[_0x5df3a1]={'$like':'%'+_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x3949b5;})});}_0x3ae2d6=_['merge']({},_0x3ae2d6,_0x193bd6[_0xa757('0x45')]);return db['ChatOfflineMessage'][_0xa757('0x46')]({'where':_0x3ae2d6[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x3d3fbe){_0x40d442[_0xa757('0x46')]=_0x3d3fbe;if(_0x193bd6['query'][_0xa757('0x56')]){_0x3ae2d6[_0xa757('0x47')]=[{'all':!![]}];}else{_0x3ae2d6['include']=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xd1')],'as':_0xa757('0x124'),'required':![]}];}return db[_0xa757('0xc8')][_0xa757('0x48')](_0x3ae2d6);})[_0xa757('0x11')](function(_0x4779a1){_0x40d442[_0xa757('0x49')]=_0x4779a1;return _0x40d442;});}})['then'](respondWithFilteredResult(_0x4ed18b,_0x3ae2d6))[_0xa757('0x4c')](handleError(_0x4ed18b,null));};exports['addAgents']=function(_0x153d6e,_0x5cce1a){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x153d6e[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5cce1a,null))['then'](function(_0x19d612){if(_0x19d612){return _0x19d612[_0xa757('0x125')](_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x153d6e[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{})['spread'](function(_0x2dd360){for(var _0x17a46c=0x0;_0x17a46c<_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0xa757('0x39')];_0x17a46c+=0x1){socket['emit'](_0xa757('0x126'),{'UserId':Number(_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0x17a46c]),'ChatWebsiteId':Number(_0x153d6e[_0xa757('0x53')]['id'])});}return _0x2dd360;});}})[_0xa757('0x11')](respondWithResult(_0x5cce1a,null))[_0xa757('0x4c')](handleError(_0x5cce1a,null));};exports[_0xa757('0x127')]=function(_0x509030,_0x20c801){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x509030[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x20c801,null))[_0xa757('0x11')](function(_0x2f435e){if(_0x2f435e){return _0x2f435e[_0xa757('0x127')](_0x509030['query'][_0xa757('0x58')])[_0xa757('0x11')](function(){if(_[_0xa757('0x128')](_0x509030['query']['ids'])){for(var _0x38ebb2=0x0;_0x38ebb2<_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0xa757('0x39')];_0x38ebb2+=0x1){socket[_0xa757('0x129')](_0xa757('0x12a'),{'UserId':Number(_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0x38ebb2]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}}else{socket['emit'](_0xa757('0x12a'),{'UserId':Number(_0x509030['query'][_0xa757('0x58')]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}});}})[_0xa757('0x11')](respondWithStatusCode(_0x20c801,null))['catch'](handleError(_0x20c801,null));};exports[_0xa757('0x12b')]=function(_0x13dd20,_0x42a68c){var _0x35b73f={};var _0x45249e={};var _0x381ec6;var _0x29ebb3;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x13dd20[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x42a68c,null))[_0xa757('0x11')](function(_0x39ee36){if(_0x39ee36){_0x381ec6=_0x39ee36;_0x45249e[_0xa757('0x33')]=_['keys'](db['User'][_0xa757('0x2f')]);_0x45249e['query']=_[_0xa757('0x35')](_0x13dd20['query']);_0x45249e['filters']=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],_0x45249e[_0xa757('0x34')]);_0x35b73f[_0xa757('0x37')]=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],qs['fields'](_0x13dd20['query'][_0xa757('0x38')]));_0x35b73f[_0xa757('0x37')]=_0x35b73f['attributes']['length']?_0x35b73f['attributes']:_0x45249e[_0xa757('0x33')];_0x35b73f[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x13dd20['query'][_0xa757('0x3e')]);_0x35b73f[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x13dd20[_0xa757('0x34')],_0x45249e[_0xa757('0x40')]));if(_0x13dd20[_0xa757('0x34')][_0xa757('0x42')]){_0x35b73f[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x35b73f[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x35b73f[_0xa757('0x37')],function(_0x32f78f){var _0x4fc399={};_0x4fc399[_0x32f78f]={'$like':'%'+_0x13dd20[_0xa757('0x34')]['filter']+'%'};return _0x4fc399;})});}_0x35b73f=_[_0xa757('0x43')]({},_0x35b73f,_0x13dd20[_0xa757('0x45')]);return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0xe79266){if(_0xe79266){_0x29ebb3=_0xe79266[_0xa757('0x39')];if(!_0x13dd20[_0xa757('0x34')][_0xa757('0x3a')]('nolimit')){_0x35b73f[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x13dd20[_0xa757('0x34')][_0xa757('0x21')]);_0x35b73f[_0xa757('0x3c')]=qs['offset'](_0x13dd20[_0xa757('0x34')][_0xa757('0x3c')]);}return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0x2a5c0a){if(_0x2a5c0a){return _0x2a5c0a?{'count':_0x29ebb3,'rows':_0x2a5c0a}:null;}})[_0xa757('0x11')](respondWithResult(_0x42a68c,null))[_0xa757('0x4c')](handleError(_0x42a68c,null));}; \ No newline at end of file +var _0xbaf0=['userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','length','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','Contact','Owner','fullname','internal','Tags','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','referer','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents'];(function(_0x30ed68,_0x437bf6){var _0x3437b7=function(_0x4b6b4e){while(--_0x4b6b4e){_0x30ed68['push'](_0x30ed68['shift']());}};_0x3437b7(++_0x437bf6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var path=require(_0x0baf('0x2'));var ejs=require(_0x0baf('0x3'));var fs=require('fs');var fs_extra=require(_0x0baf('0x4'));var _=require(_0x0baf('0x5'));var querystring=require('querystring');var Redis=require(_0x0baf('0x6'));var qs=require(_0x0baf('0x7'));var logger=require(_0x0baf('0x8'))(_0x0baf('0x9'));var config=require(_0x0baf('0xa'));var db=require(_0x0baf('0xb'))['db'];config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);var htmlToText=require(_0x0baf('0x11'));var jayson=require(_0x0baf('0x12'));var client=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232c});var client9002=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232a});var client9003=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232b});var client9001=jayson[_0x0baf('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5a53e2,_0x465dd7,_0xe4378c,_0x5db689){return new BPromise(function(_0x13df17,_0x5a0583){var _0x2ab33e=_0x5db689||client;return _0x2ab33e['request'](_0x5a53e2,_0xe4378c)[_0x0baf('0x15')](function(_0x1f50c3){logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));logger[_0x0baf('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x465dd7,'request\x20sent',JSON[_0x0baf('0x1a')](_0x1f50c3));if(_0x1f50c3[_0x0baf('0x1b')]){if(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1c')]===0x1f4){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3['error'][_0x0baf('0x1d')]);return _0x5a0583(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1d')]);}logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3[_0x0baf('0x1b')]['message']);return _0x13df17(_0x1f50c3['error'][_0x0baf('0x1d')]);}else{logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));_0x13df17(_0x1f50c3[_0x0baf('0x1e')][_0x0baf('0x1d')]);}})[_0x0baf('0x1f')](function(_0x636a13){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x636a13);_0x5a0583(_0x636a13);});});}function respondWithStatusCode(_0x54f2fa,_0x334bd6){_0x334bd6=_0x334bd6||0xcc;return function(_0x482522){if(_0x482522){return _0x54f2fa[_0x0baf('0x20')](_0x334bd6);}return _0x54f2fa['status'](_0x334bd6)['end']();};}function respondWithResult(_0x2ef0aa,_0x48a0e9){_0x48a0e9=_0x48a0e9||0xc8;return function(_0x4be1b9){if(_0x4be1b9){return _0x2ef0aa[_0x0baf('0x21')](_0x48a0e9)[_0x0baf('0x22')](_0x4be1b9);}};}function respondWithFilteredResult(_0x34e264,_0x19d9fd){return function(_0x3a1ba1){if(_0x3a1ba1){var _0x56b299=typeof _0x19d9fd[_0x0baf('0x23')]===_0x0baf('0x24')&&typeof _0x19d9fd[_0x0baf('0x25')]===_0x0baf('0x24');var _0x3843b8=_0x3a1ba1[_0x0baf('0x26')];var _0x453525=_0x56b299?0x0:_0x19d9fd['offset'];var _0x1590b4=_0x56b299?_0x3a1ba1[_0x0baf('0x26')]:_0x19d9fd[_0x0baf('0x23')]+_0x19d9fd[_0x0baf('0x25')];var _0x55c715;if(_0x1590b4>=_0x3843b8){_0x1590b4=_0x3843b8;_0x55c715=0xc8;}else{_0x55c715=0xce;}_0x34e264[_0x0baf('0x21')](_0x55c715);return _0x34e264[_0x0baf('0x27')]('Content-Range',_0x453525+'-'+_0x1590b4+'/'+_0x3843b8)[_0x0baf('0x22')](_0x3a1ba1);}return null;};}function saveUpdates(_0x32e4fb){return function(_0x478ce8){if(_0x478ce8){return _0x478ce8[_0x0baf('0x28')](_0x32e4fb)[_0x0baf('0x15')](function(_0x366924){return _0x366924;});}return null;};}function removeEntity(_0x213a6a){return function(_0x57476f){if(_0x57476f){return _0x57476f[_0x0baf('0x29')]()[_0x0baf('0x15')](function(){var _0x37be4e=_0x57476f[_0x0baf('0x2a')]({'plain':!![]});var _0x24ecee=_0x0baf('0x2b');return db[_0x0baf('0x2c')][_0x0baf('0x29')]({'where':{'type':_0x24ecee,'resourceId':_0x37be4e['id']}})[_0x0baf('0x15')](function(){return _0x57476f;});})[_0x0baf('0x15')](function(){_0x213a6a[_0x0baf('0x21')](0xcc)[_0x0baf('0x2d')]();});}};}function handleEntityNotFound(_0x45294a){return function(_0x3a3353){if(!_0x3a3353){_0x45294a['sendStatus'](0x194);}return _0x3a3353;};}function handleError(_0x2fd426,_0x53ae1d){_0x53ae1d=_0x53ae1d||0x1f4;return function(_0x1aa474){logger[_0x0baf('0x1b')](_0x1aa474[_0x0baf('0x2e')]);if(_0x1aa474[_0x0baf('0x2f')]){delete _0x1aa474['name'];}_0x2fd426[_0x0baf('0x21')](_0x53ae1d)[_0x0baf('0x30')](_0x1aa474);};}exports['index']=function(_0x23d890,_0x2447c2){var _0x62a2ed={'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]},_0xbaa9a7={},_0x1f60bd={'count':0x0,'rows':[]};var _0x675461=_['map'](db[_0x0baf('0x33')][_0x0baf('0x34')],function(_0x5b991f){return{'name':_0x5b991f[_0x0baf('0x35')],'type':_0x5b991f['type']['key']};});_0xbaa9a7[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x675461,'name');_0xbaa9a7['query']=_[_0x0baf('0x38')](_0x23d890[_0x0baf('0x39')]);_0xbaa9a7[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],_0xbaa9a7[_0x0baf('0x39')]);_0x62a2ed[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x62a2ed[_0x0baf('0x3c')]=_0x62a2ed[_0x0baf('0x3c')]['length']?_0x62a2ed[_0x0baf('0x3c')]:_0xbaa9a7[_0x0baf('0x36')];if(!_0x23d890['query'][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x62a2ed[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x25')]);_0x62a2ed['offset']=qs[_0x0baf('0x23')](_0x23d890[_0x0baf('0x39')]['offset']);}_0x62a2ed[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x41')]);_0x62a2ed['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x23d890[_0x0baf('0x39')],_0xbaa9a7[_0x0baf('0x3a')]),_0x675461);if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x43')]){_0x62a2ed[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x62a2ed[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x675461,function(_0x56270e){if(_0x56270e[_0x0baf('0x46')]!==_0x0baf('0x47')){var _0x1daf1d={};_0x1daf1d[_0x56270e[_0x0baf('0x2f')]]={'$like':'%'+_0x23d890[_0x0baf('0x39')]['filter']+'%'};return _0x1daf1d;}})});}_0x62a2ed=_[_0x0baf('0x45')]({},_0x62a2ed,_0x23d890[_0x0baf('0x48')]);var _0x27c3ee={'where':_0x62a2ed[_0x0baf('0x44')]};return db[_0x0baf('0x33')]['count'](_0x27c3ee)[_0x0baf('0x15')](function(_0x85bedb){_0x1f60bd[_0x0baf('0x26')]=_0x85bedb;if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x49')]){_0x62a2ed[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x33')]['findAll'](_0x62a2ed);})[_0x0baf('0x15')](function(_0x167fb8){_0x1f60bd[_0x0baf('0x4b')]=_0x167fb8;return _0x1f60bd;})['then'](respondWithFilteredResult(_0x2447c2,_0x62a2ed))[_0x0baf('0x1f')](handleError(_0x2447c2,null));};exports[_0x0baf('0x4c')]=function(_0x10fa62,_0x3fabec){var _0x204d77={'raw':![],'where':{'id':_0x10fa62[_0x0baf('0x4d')]['id']},'include':[{'model':db['Pause'],'as':_0x0baf('0x32')}]},_0x1b71a3={};_0x1b71a3[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x33')][_0x0baf('0x34')]);_0x1b71a3[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x10fa62[_0x0baf('0x39')]);_0x1b71a3[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],_0x1b71a3['query']);_0x204d77['attributes']=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x10fa62[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x204d77[_0x0baf('0x3c')]=_0x204d77[_0x0baf('0x3c')]['length']?_0x204d77[_0x0baf('0x3c')]:_0x1b71a3[_0x0baf('0x36')];if(_0x10fa62[_0x0baf('0x39')][_0x0baf('0x49')]){_0x204d77[_0x0baf('0x4a')]=[{'all':!![]}];}_0x204d77=_[_0x0baf('0x45')]({},_0x204d77,_0x10fa62['options']);return db[_0x0baf('0x33')]['find'](_0x204d77)[_0x0baf('0x15')](handleEntityNotFound(_0x3fabec,null))['then'](respondWithResult(_0x3fabec,null))[_0x0baf('0x1f')](handleError(_0x3fabec,null));};exports['create']=function(_0x35b1a5,_0x4c035b){return db[_0x0baf('0x33')][_0x0baf('0x4e')](_0x35b1a5[_0x0baf('0x4f')],{})[_0x0baf('0x15')](function(_0x42a68b){var _0x576475=_0x35b1a5[_0x0baf('0x50')][_0x0baf('0x2a')]({'plain':!![]});if(!_0x576475)throw new Error(_0x0baf('0x51'));if(_0x576475[_0x0baf('0x52')]===_0x0baf('0x50')){var _0xa19b21=_0x42a68b['get']({'plain':!![]});var _0x402f4d=_0x0baf('0x2b');return db[_0x0baf('0x53')][_0x0baf('0x54')]({'where':{'name':_0x402f4d,'userProfileId':_0x576475[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x15')](function(_0x3834a2){if(_0x3834a2&&_0x3834a2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0baf('0x4e')]({'name':_0xa19b21[_0x0baf('0x2f')],'resourceId':_0xa19b21['id'],'type':_0x3834a2[_0x0baf('0x2f')],'sectionId':_0x3834a2['id']},{})[_0x0baf('0x15')](function(){return _0x42a68b;});}else{return _0x42a68b;}})[_0x0baf('0x1f')](function(_0x35221e){logger[_0x0baf('0x1b')](_0x0baf('0x56'),_0x35221e);throw _0x35221e;});}return _0x42a68b;})[_0x0baf('0x15')](respondWithResult(_0x4c035b,0xc9))['catch'](handleError(_0x4c035b,null));};exports[_0x0baf('0x28')]=function(_0x268be8,_0x3c2d03){if(_0x268be8[_0x0baf('0x4f')]['id']){delete _0x268be8[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x268be8['params']['id']},'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]})[_0x0baf('0x15')](handleEntityNotFound(_0x3c2d03,null))[_0x0baf('0x15')](saveUpdates(_0x268be8[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x3c2d03,null))[_0x0baf('0x1f')](handleError(_0x3c2d03,null));};exports[_0x0baf('0x29')]=function(_0x498405,_0x178495){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x498405['params']['id']}})['then'](handleEntityNotFound(_0x178495,null))[_0x0baf('0x15')](removeEntity(_0x178495,null))['catch'](handleError(_0x178495,null));};exports[_0x0baf('0x57')]=function(_0x2b17f8,_0x49d713){return db[_0x0baf('0x33')][_0x0baf('0x57')]()[_0x0baf('0x15')](respondWithResult(_0x49d713,null))['catch'](handleError(_0x49d713,null));};exports['addDisposition']=function(_0x2438df,_0x7e8946){if(_0x2438df[_0x0baf('0x4f')]['id']){delete _0x2438df[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')]['find']({'where':{'id':_0x2438df[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7e8946,null))['then'](function(_0x59a0b2){if(_0x59a0b2){_0x2438df[_0x0baf('0x4f')]['ChatWebsiteId']=_0x59a0b2['id'];return db['Disposition'][_0x0baf('0x4e')](_0x2438df[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x7e8946,null))[_0x0baf('0x1f')](handleError(_0x7e8946,null));};exports[_0x0baf('0x58')]=function(_0x27ddc7,_0x4c05d6){var _0xec3b32={'raw':![],'where':{}};var _0x1a0a67={};var _0x185473={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x27ddc7[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c05d6,null))[_0x0baf('0x15')](function(_0x468363){if(_0x468363){_0x1a0a67[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x5a')][_0x0baf('0x34')]);_0x1a0a67[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x27ddc7[_0x0baf('0x39')]);_0x1a0a67[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1a0a67['model'],_0x1a0a67['query']);_0xec3b32['attributes']=_[_0x0baf('0x3b')](_0x1a0a67[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3d')]));_0xec3b32[_0x0baf('0x3c')]=_0xec3b32['attributes']['length']?_0xec3b32[_0x0baf('0x3c')]:_0x1a0a67['model'];if(!_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xec3b32[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x25')]);_0xec3b32[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xec3b32[_0x0baf('0x40')]=qs['sort'](_0x27ddc7['query']['sort']);_0xec3b32['where']=qs['filters'](_[_0x0baf('0x42')](_0x27ddc7[_0x0baf('0x39')],_0x1a0a67[_0x0baf('0x3a')]));_0xec3b32[_0x0baf('0x44')]['ChatWebsiteId']=_0x468363['id'];if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]){_0xec3b32['where']=_['merge'](_0xec3b32[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xec3b32[_0x0baf('0x3c')],function(_0x442e5f){var _0x30b35e={};_0x30b35e[_0x442e5f]={'$like':'%'+_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x30b35e;})});}_0xec3b32=_[_0x0baf('0x45')]({},_0xec3b32,_0x27ddc7['options']);return db[_0x0baf('0x5a')][_0x0baf('0x26')]({'where':_0xec3b32['where']})[_0x0baf('0x15')](function(_0x2db4ec){_0x185473['count']=_0x2db4ec;if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x49')]){_0xec3b32[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x5a')][_0x0baf('0x5b')](_0xec3b32);})['then'](function(_0x4807fc){_0x185473[_0x0baf('0x4b')]=_0x4807fc;return _0x185473;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x4c05d6,_0xec3b32))['catch'](handleError(_0x4c05d6,null));};exports[_0x0baf('0x5c')]=function(_0x59dad5,_0x21ad25){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x59dad5[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x21ad25,null))['then'](function(_0x3c2bc1){if(_0x3c2bc1){return _0x3c2bc1['removeDispositions'](_0x59dad5[_0x0baf('0x39')][_0x0baf('0x5d')]);}})[_0x0baf('0x15')](respondWithStatusCode(_0x21ad25,null))[_0x0baf('0x1f')](handleError(_0x21ad25,null));};exports[_0x0baf('0x5e')]=function(_0x52e845,_0x866e6e){if(_0x52e845[_0x0baf('0x4f')]['id']){delete _0x52e845['body']['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x52e845[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x866e6e,null))[_0x0baf('0x15')](function(_0x250df2){if(_0x250df2){_0x52e845[_0x0baf('0x4f')][_0x0baf('0x5f')]=_0x250df2['id'];return db[_0x0baf('0x60')][_0x0baf('0x4e')](_0x52e845[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x866e6e,null))['catch'](handleError(_0x866e6e,null));};exports['getAnswers']=function(_0x29a036,_0x322a09){var _0x384c29={'raw':![],'where':{}};var _0x52f267={};var _0x507783={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x29a036[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x322a09,null))[_0x0baf('0x15')](function(_0x3033c8){if(_0x3033c8){_0x52f267[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x60')]['rawAttributes']);_0x52f267[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x29a036[_0x0baf('0x39')]);_0x52f267[_0x0baf('0x3a')]=_['intersection'](_0x52f267['model'],_0x52f267['query']);_0x384c29[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x52f267['model'],qs['fields'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x384c29['attributes']=_0x384c29[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x384c29[_0x0baf('0x3c')]:_0x52f267[_0x0baf('0x36')];if(!_0x29a036[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x384c29[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x25')]);_0x384c29[_0x0baf('0x23')]=qs['offset'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x23')]);}_0x384c29[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x41')]);_0x384c29['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x29a036[_0x0baf('0x39')],_0x52f267[_0x0baf('0x3a')]));_0x384c29[_0x0baf('0x44')]['ChatWebsiteId']=_0x3033c8['id'];if(_0x29a036[_0x0baf('0x39')][_0x0baf('0x43')]){_0x384c29[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x384c29[_0x0baf('0x44')],{'$or':_['map'](_0x384c29['attributes'],function(_0xb5f4e5){var _0x5a2454={};_0x5a2454[_0xb5f4e5]={'$like':'%'+_0x29a036[_0x0baf('0x39')]['filter']+'%'};return _0x5a2454;})});}_0x384c29=_[_0x0baf('0x45')]({},_0x384c29,_0x29a036[_0x0baf('0x48')]);return db[_0x0baf('0x60')][_0x0baf('0x26')]({'where':_0x384c29['where']})[_0x0baf('0x15')](function(_0x106ffa){_0x507783[_0x0baf('0x26')]=_0x106ffa;if(_0x29a036['query']['includeAll']){_0x384c29['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0baf('0x5b')](_0x384c29);})[_0x0baf('0x15')](function(_0x2b7f13){_0x507783[_0x0baf('0x4b')]=_0x2b7f13;return _0x507783;});}})['then'](respondWithFilteredResult(_0x322a09,_0x384c29))[_0x0baf('0x1f')](handleError(_0x322a09,null));};exports[_0x0baf('0x62')]=function(_0x1843eb,_0x4b4ef8){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1843eb['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x4b4ef8,null))['then'](function(_0x8a0a1b){if(_0x8a0a1b){return _0x8a0a1b[_0x0baf('0x62')](_0x1843eb[_0x0baf('0x39')][_0x0baf('0x5d')]);}})['then'](respondWithStatusCode(_0x4b4ef8,null))['catch'](handleError(_0x4b4ef8,null));};exports[_0x0baf('0x63')]=function(_0x4e1a7e,_0x3b4ae3){_0x4e1a7e[_0x0baf('0x4f')][_0x0baf('0x64')]=_0x4e1a7e[_0x0baf('0x65')][_0x0baf('0x66')];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4e1a7e['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3b4ae3,null))['then'](saveUpdates(_0x4e1a7e[_0x0baf('0x4f')],null))['then'](respondWithResult(_0x3b4ae3,null))[_0x0baf('0x1f')](handleError(_0x3b4ae3,null));};exports[_0x0baf('0x67')]=function(_0x443f62,_0x5033f3){_0x443f62['body'][_0x0baf('0x68')]=_0x443f62[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x443f62[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5033f3,null))[_0x0baf('0x15')](saveUpdates(_0x443f62['body'],null))[_0x0baf('0x15')](respondWithResult(_0x5033f3,null))['catch'](handleError(_0x5033f3,null));};exports[_0x0baf('0x69')]=function(_0x4df797,_0x30f32b){_0x4df797['body'][_0x0baf('0x6a')]=_0x4df797[_0x0baf('0x65')]['filename'];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4df797[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30f32b,null))[_0x0baf('0x15')](saveUpdates(_0x4df797['body'],null))['then'](respondWithResult(_0x30f32b,null))[_0x0baf('0x1f')](handleError(_0x30f32b,null));};exports[_0x0baf('0x6b')]=function(_0x116d52,_0x2c7417){_0x116d52[_0x0baf('0x4f')][_0x0baf('0x6c')]=_0x116d52[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x116d52['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2c7417,null))['then'](saveUpdates(_0x116d52[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x2c7417,null))[_0x0baf('0x1f')](handleError(_0x2c7417,null));};exports[_0x0baf('0x6d')]=function(_0x4d7d29,_0x227fbd){var _0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x70'));var _0x2c2b77={'where':{'id':_0x4d7d29[_0x0baf('0x4d')]['id']},'attributes':['id',_0x0baf('0x64')],'raw':!![]};var _0xb61593=![];return require('../../config/license/util')[_0x0baf('0x71')]()[_0x0baf('0x15')](function(_0x4d501e){if(_0x4d501e){_0xb61593=_0x4d501e[_0x0baf('0x72')];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x2c2b77);})[_0x0baf('0x15')](handleEntityNotFound(_0x227fbd,null))[_0x0baf('0x15')](function(_0x3c5654){if(_0x3c5654){if(!_[_0x0baf('0x73')](_0x3c5654[_0x0baf('0x64')])){if(fs['existsSync'](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x74'),_0x3c5654[_0x0baf('0x64')]))&&_0xb61593){_0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/logos/',_0x3c5654[_0x0baf('0x64')]);}}return _0x227fbd[_0x0baf('0x75')](_0x647233);}})[_0x0baf('0x1f')](handleError(_0x227fbd,null));};exports['getAvatar']=function(_0x49855a,_0x5adbd9){var _0x1adb84=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x76'));var _0x577536={'where':{'id':_0x49855a[_0x0baf('0x4d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x577536)['then'](handleEntityNotFound(_0x5adbd9,null))[_0x0baf('0x15')](function(_0x290686){if(_0x290686){if(!_[_0x0baf('0x73')](_0x290686[_0x0baf('0x68')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/avatars/',_0x290686[_0x0baf('0x68')]))){_0x1adb84=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x290686[_0x0baf('0x68')]);}}return _0x5adbd9[_0x0baf('0x75')](_0x1adb84);}})[_0x0baf('0x1f')](handleError(_0x5adbd9,null));};exports[_0x0baf('0x79')]=function(_0x4415c2,_0x46103a){var _0x308b3f=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x7a'));var _0x59dd6c={'where':{'id':_0x4415c2['params']['id']},'attributes':['id',_0x0baf('0x6a'),_0x0baf('0x7b')],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x59dd6c)['then'](handleEntityNotFound(_0x46103a,null))[_0x0baf('0x15')](function(_0xc6c049){if(_0xc6c049){if(!_[_0x0baf('0x73')](_0xc6c049[_0x0baf('0x6a')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config['root'],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]))&&_0xc6c049[_0x0baf('0x7b')]){_0x308b3f=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]);}}return _0x46103a['download'](_0x308b3f);}})['catch'](handleError(_0x46103a,null));};exports['getSystemAvatar']=function(_0x11a85a,_0x51c895){var _0x2f0104=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x7c'));var _0x5b5cd5={'where':{'id':_0x11a85a['params']['id']},'attributes':['id',_0x0baf('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x0baf('0x54')](_0x5b5cd5)['then'](handleEntityNotFound(_0x51c895,null))['then'](function(_0x56c377){if(_0x56c377){if(!_[_0x0baf('0x73')](_0x56c377[_0x0baf('0x6c')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]))){_0x2f0104=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]);}}return _0x51c895['download'](_0x2f0104);}})[_0x0baf('0x1f')](handleError(_0x51c895,null));};exports[_0x0baf('0x7d')]=function(_0x12311d,_0x52c7f7){var _0x25eccd=require('user-agent-parser');var _0x235bd5=new _0x25eccd();var _0x12ff07=_0x235bd5['setUA'](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x7f')])[_0x0baf('0x80')]();var _0x1805ff={'body':_0x12311d['body'],'channel':_0x0baf('0x81')};var _0x39eb13=[];var _0x4d4eab=[];var _0x5054f9={};var _0x1ac8eb=![];return db[_0x0baf('0x82')][_0x0baf('0x57')]()[_0x0baf('0x15')](function(_0x4d4a7f){if(!_0x4d4a7f){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x84'));}_0x39eb13=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),[_0x0baf('0x86'),'updatedAt']);_0x4d4eab=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),['createdAt',_0x0baf('0x87'),_0x0baf('0x88'),'ListId']);if(_0x12311d[_0x0baf('0x4f')]['id']){delete _0x12311d[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))](_0x0baf('0x8b'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')])||_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')]===''){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}if(!_[_0x0baf('0x8e')](_0x4d4eab,_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}_0x5054f9[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x12311d[_0x0baf('0x4d')]['id']},'include':[{'model':db[_0x0baf('0x8f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0baf('0x90'),'where':_0x5054f9,'limit':0x1,'order':[[_0x0baf('0x87'),_0x0baf('0x91')]]}]},{'model':db['ChatApplication'],'as':_0x0baf('0x92')}]});})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x3cfb49){if(_0x3cfb49&&_0x3cfb49[_0x0baf('0x93')]){_0x1805ff[_0x0baf('0x94')]=_0x3cfb49;_0x1805ff[_0x0baf('0x95')]=_0x3cfb49[_0x0baf('0x92')];_0x1805ff[_0x0baf('0x96')]=_0x3cfb49[_0x0baf('0x93')];_0x1805ff['applications']=_[_0x0baf('0x97')](_0x1805ff[_0x0baf('0x95')],[_0x0baf('0x98')],[_0x0baf('0x99')]);if(_0x1805ff['account'][_0x0baf('0x92')]){delete _0x1805ff[_0x0baf('0x94')][_0x0baf('0x92')];}if(_0x1805ff['account'][_0x0baf('0x93')]&&_0x1805ff[_0x0baf('0x94')][_0x0baf('0x93')][_0x0baf('0x90')][_0x0baf('0x61')]){return _0x1805ff['account'][_0x0baf('0x93')][_0x0baf('0x90')][0x0];}var _0x53df55=_['defaults'](_0x12311d[_0x0baf('0x4f')],{'firstName':_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x3cfb49[_0x0baf('0x9a')]});_0x53df55[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];return db['CmContact'][_0x0baf('0x4e')](_0x53df55,{'fields':_0x39eb13,'raw':!![]});}})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x47de3f){_0x1805ff[_0x0baf('0x9b')]=_0x47de3f;var _0x3a6bf8=_0x12311d['body'][_0x0baf('0x9c')];if(_0x12311d[_0x0baf('0x7e')]['cf-connecting-ip']){_0x3a6bf8=_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9d')];}else if(_0x12311d[_0x0baf('0x7e')]['x-forwarded-for']){_0x3a6bf8=_[_0x0baf('0x9e')](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9f')][_0x0baf('0xa0')](','));}if(_0x47de3f){var _0x3021f7={'ContactId':_0x47de3f['id'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'from':(_0x47de3f[_0x0baf('0xa1')]||'')+'\x20'+(_0x47de3f['lastName']||''),'customerIp':_0x3a6bf8,'customerPort':_0x12311d[_0x0baf('0x7e')]['x-real-port']?_0x12311d[_0x0baf('0x7e')][_0x0baf('0xa2')]:null,'referer':_0x12311d['body']['referer'],'browserName':_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')]&&_0x12ff07[_0x0baf('0xa3')]['version']?util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')],_0x12ff07[_0x0baf('0xa3')][_0x0baf('0xa6')]):_0x0baf('0xa7'),'browserVersion':_0x12ff07[_0x0baf('0xa3')]['version']||'unknown','osName':util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07['os']['name'],_0x12ff07['os'][_0x0baf('0xa6')]),'osVersion':_0x12ff07['os'][_0x0baf('0xa6')],'deviceModel':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x36')]&&_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')]?util[_0x0baf('0xa4')]('%s\x20%s\x20%s',_0x12ff07[_0x0baf('0xa8')]['model'],_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],_0x12ff07['device']['type']):null,'deviceVendor':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],'deviceType':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x46')],'formData':JSON[_0x0baf('0x1a')](_0x12311d[_0x0baf('0x4f')])};var _0x18f7bd={'ChatWebsiteId':_0x12311d['params']['id'],'closed':![]};if(_0x12311d['body']['threadId']){_0x18f7bd[_0x0baf('0xaa')]=_0x12311d['body'][_0x0baf('0xaa')];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})['then'](function(_0x40785c){if(_0x40785c){return[_0x40785c,![]];}_0x3021f7[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')];_0x3021f7[_0x0baf('0xac')]=_0x12311d['body'][_0x0baf('0xac')];return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)[_0x0baf('0x15')](function(_0xf784df){return[_0xf784df,!![]];});});}_0x18f7bd[_0x0baf('0xad')]=_0x47de3f['id'];if(_0x12311d['body'][_0x0baf('0xae')]&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xae')]['id']){_0x18f7bd['id']=_0x12311d['body'][_0x0baf('0xae')]['id'];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})[_0x0baf('0x15')](function(_0xe93008){if(_0xe93008){return[_0xe93008,![]];}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x4ffc8e){return[_0x4ffc8e,!![]];});});}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x43022c){return[_0x43022c,!![]];});}})[_0x0baf('0xaf')](function(_0xcd88a1,_0x13ac02){if(_0xcd88a1){_0x1ac8eb=_0x13ac02;if(!_0x13ac02){var _0x122a1a={'from':(_0x1805ff['contact'][_0x0baf('0xa1')]||'')+'\x20'+(_0x1805ff[_0x0baf('0x9b')][_0x0baf('0xb0')]||'')};if(_0x12311d[_0x0baf('0x4f')]['threadId']&&_0x12311d[_0x0baf('0x4f')]['messageId']&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')]!=_0x12311d[_0x0baf('0x4f')]['messageId']){_0x122a1a[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb1')];}return _0xcd88a1[_0x0baf('0x28')](_0x122a1a);}else{return _0xcd88a1;}}})[_0x0baf('0x15')](function(_0x2a72b3){_0x1805ff[_0x0baf('0xae')]=_0x2a72b3[_0x0baf('0x2a')]({'plain':!![]});_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]=_0x1ac8eb;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]){if(_0x1805ff['account']['autoclose']){_0x1805ff[_0x0baf('0x95')]['push']({'id':0x0,'priority':_0x1805ff['applications']['length']+0x1,'app':'close','appdata':_0x0baf('0xb3'),'interval':_0x0baf('0xb4')});}}return db['ChatMessage']['create']({'body':_0x12311d['body']['body'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'ChatInteractionId':_0x2a72b3['id'],'direction':'in','ContactId':_0x1805ff['contact']['id'],'AttachmentId':_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb5')]});})[_0x0baf('0x15')](function(_0xa1b680){_0x1805ff[_0x0baf('0x1d')]=_0xa1b680;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]){return db[_0x0baf('0xb7')]['find']({'attributes':['id','name'],'where':{'id':_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]}})['then'](function(_0x21a72d){if(_0x21a72d){_0x1805ff['applications'][_0x0baf('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x21a72d['name']+','+(_0x1805ff[_0x0baf('0x94')][_0x0baf('0xb9')]||0xa),'interval':_0x0baf('0xb4')});_0x1805ff[_0x0baf('0xba')]=!![];}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);});}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);})[_0x0baf('0x15')](function(_0x3348c6){respondWithRpcPromise(_0x0baf('0xbd'),_0x0baf('0xbd'),{'event':_0x0baf('0x7d'),'message':_0x3348c6},client9002);return _0x3348c6;})[_0x0baf('0x15')](respondWithResult(_0x52c7f7,null))[_0x0baf('0x1f')](handleError(_0x52c7f7,null));};exports[_0x0baf('0xbe')]=function(_0x5b61ff,_0x3c78ca){var _0x1a016f,_0x5b9e60,_0x9f2b22;var _0x39526b=[];var _0x5ee76f={};var _0x186d83=_0x5b61ff['files']||[];var _0x3f816f=[];var _0x569bbb;return db[_0x0baf('0x82')]['describe']()[_0x0baf('0x15')](function(_0x298cb5){if(!_0x298cb5){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('no\x20available\x20attributes');}_0x39526b=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x298cb5),[_0x0baf('0x86'),_0x0baf('0x87'),'CompanyId','ListId']);if(_0x5b61ff[_0x0baf('0x4f')]['id']){delete _0x5b61ff[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x5b61ff[_0x0baf('0x4f')]['from'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x0baf('0x73')](_0x5b61ff['body'][_0x0baf('0x4f')])||_0x5b61ff['body'][_0x0baf('0x4f')]===''){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c')));}if(_['isNil'](_0x5b61ff['body'][_0x0baf('0xbf')])){throw _0x3c78ca['status'](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}if(!_[_0x0baf('0x8e')](_0x39526b,_0x5b61ff[_0x0baf('0x4f')]['mapKeyOffline'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)['send'](new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}_0x5ee76f[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')];})[_0x0baf('0x15')](function(){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x5b61ff['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x0baf('0xc0')],'as':_0x0baf('0xc0')}]});})['then'](handleEntityNotFound(_0x3c78ca,null))[_0x0baf('0x15')](function(_0x58e1ae){if(_0x58e1ae&&_0x58e1ae['List']){_0x5b9e60=_0x58e1ae;var _0x30a982=_[_0x0baf('0xd')](_0x5b61ff[_0x0baf('0x4f')],{'firstName':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'phone':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x58e1ae[_0x0baf('0x9a')]});_0x30a982[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff['body'][_0x0baf('0x89')];return db[_0x0baf('0x82')][_0x0baf('0xc1')]({'where':_0x5ee76f,'defaults':_0x30a982});}})[_0x0baf('0xaf')](function(_0x1d1ed6){if(_0x1d1ed6){_0x9f2b22=_0x1d1ed6;var _0x57b26e=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0xc3')),_0x0baf('0xc4'));var _0x44f822=ejs[_0x0baf('0xc5')](_0x57b26e,{'body':_[_0x0baf('0xc6')](_0x5b61ff[_0x0baf('0x4f')]['body']),'bodyTitle':_0x5b9e60[_0x0baf('0xc7')]});return db[_0x0baf('0xc8')][_0x0baf('0x4e')]({'body':_0x44f822,'plainBody':htmlToText[_0x0baf('0xc9')](_0x44f822),'ContactId':_0x1d1ed6['id'],'ChatWebsiteId':_0x5b9e60['id']});}})[_0x0baf('0x15')](function(_0x130ad1){_0x569bbb=_0x130ad1;if(_0x186d83[_0x0baf('0x61')]){var _0x17ef4f=_0x186d83[_0x0baf('0x37')](function(_0x1ee4c7){return{'name':_0x1ee4c7[_0x0baf('0xca')],'basename':_0x1ee4c7[_0x0baf('0x66')],'type':_0x1ee4c7[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x130ad1['id']};});_0x3f816f=_0x17ef4f[_0x0baf('0x37')](_0x37430c=>{var _0x3fffe8={'filename':_0x37430c[_0x0baf('0x2f')],'path':path[_0x0baf('0x6e')](config['root'],_0x0baf('0xcc'),_0x0baf('0xcd'),_0x0baf('0xce'),_0x0baf('0xcf'),_0x37430c[_0x0baf('0xd0')])};return _0x3fffe8;});if(!_0x5b9e60[_0x0baf('0xd1')]){return db[_0x0baf('0xd2')]['transaction'](function(_0xa7a73a){return db[_0x0baf('0xd3')][_0x0baf('0xd4')](_0x17ef4f,{'transaction':_0xa7a73a});});}}})[_0x0baf('0x15')](function(){if(_0x569bbb){_0x1a016f=_0x569bbb;return db[_0x0baf('0xc0')][_0x0baf('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0x0baf('0xd5')],'as':'Smtp','raw':!![]}]});}})[_0x0baf('0x15')](function(_0x17b3a9){if(_0x17b3a9&&_0x17b3a9[_0x0baf('0xd6')]&&_0x5b9e60[_0x0baf('0xd7')]&&_0x5b9e60[_0x0baf('0xd8')]){var _0x1912ff={'tls':{'rejectUnauthorized':![]}};if(_0x17b3a9['Smtp'][_0x0baf('0xd9')]){_0x1912ff[_0x0baf('0xd9')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xd9')];}else{_0x1912ff[_0x0baf('0xda')]=_0x17b3a9['Smtp']['host'];_0x1912ff[_0x0baf('0xdb')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdb')];_0x1912ff[_0x0baf('0xdc')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdc')];}if(_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdd')]){_0x1912ff[_0x0baf('0xde')]={'user':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')],'pass':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdf')]};}return respondWithRpcPromise(_0x0baf('0xe0'),_0x0baf('0xe1'),{'account':_0x1912ff,'message':{'from':util[_0x0baf('0xa4')](_0x0baf('0xe2'),_0x17b3a9[_0x0baf('0x2f')],_0x17b3a9[_0x0baf('0xe3')]||_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')]),'to':_0x5b9e60[_0x0baf('0xd8')],'subject':_0x5b9e60[_0x0baf('0xe4')],'html':_0x1a016f[_0x0baf('0x4f')],'attachments':_0x3f816f}},client9003)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x1d4581){console['error'](_0x1d4581);});}})[_0x0baf('0x15')](function(){if(_0x5b9e60&&_0x5b9e60[_0x0baf('0xd1')]&&_0x5b9e60[_0x0baf('0xe5')]){var _0x14a397=[];if(_0x186d83[_0x0baf('0x61')]){_0x14a397=_0x186d83['map'](function(_0x3e3fba){return{'name':_0x3e3fba[_0x0baf('0xca')],'basename':_0x3e3fba[_0x0baf('0x66')],'type':_0x3e3fba[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x569bbb['id']};});}var _0x1db841;if(!_[_0x0baf('0x73')](_0x5b9e60[_0x0baf('0xe6')])){var _0x237a20=_[_0x0baf('0x37')](_0x5b61ff[_0x0baf('0x4f')],function(_0xe840f2){return _0xe840f2;});var _0x12726d=_[_0x0baf('0xe7')](_0x237a20)[0x0];var _0x1b2278=_[_0x0baf('0xe8')](_0x12726d,function(_0x221aac){return _0x221aac;});_0x1db841=_0x1b2278[0x1][_0x5b9e60[_0x0baf('0xe6')]];}var _0x3e970a={'from':_0x9f2b22['email'],'firstName':_0x9f2b22[_0x0baf('0xa1')],'lastName':_0x9f2b22['lastName'],'mapKey':'email','message':{'from':_0x9f2b22[_0x0baf('0xe3')],'to':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')],'cc':'','subject':_['isNil'](_0x1db841)?_0x5b9e60[_0x0baf('0xe4')]:_0x1db841,'messageId':'','sentAt':new Date(),'attach':_0x14a397[_0x0baf('0x61')],'attachments':_0x14a397,'originChannel':_0x0baf('0xe9'),'ChatWebsiteId':_0x5b9e60['id'],'ChatOfflineMessageId':_0x1a016f['id'],'originTo':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')]},'body':_0x1a016f[_0x0baf('0x4f')]};var _0x49543e={'account':{'id':_0x5b9e60[_0x0baf('0xe5')]},'body':_0x3e970a,'log':_0x0baf('0xea')};return respondWithRpcPromise(_0x0baf('0xea'),_0x0baf('0xeb'),_0x49543e,client9001)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x4c2bae){console[_0x0baf('0x1b')](_0x4c2bae);});}return;})['then'](function(){if(_0x1a016f){return _0x1a016f;}})[_0x0baf('0x15')](respondWithResult(_0x3c78ca,null))[_0x0baf('0x1f')](function(_0x47b168){console['error'](_0x0baf('0x1f'),_0x47b168);for(var _0x1de1dd of _0x186d83){var _0xf4da6a=path['join'](config[_0x0baf('0x6f')],_0x0baf('0xcc'),'files',_0x0baf('0xce'),_0x0baf('0xcf'),_0x1de1dd[_0x0baf('0x66')]);fs_extra[_0x0baf('0xec')](_0xf4da6a)[_0x0baf('0x1f')](function(_0x2759bb){console[_0x0baf('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xf4da6a,_0x2759bb);});}});};exports['addInteraction']=function(_0x131573,_0x1bd67f){return db[_0x0baf('0xab')][_0x0baf('0x54')]({'where':{'id':_0x131573[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x1bd67f,null))[_0x0baf('0x15')](function(_0x4316c5){if(_0x4316c5){return _0x4316c5[_0x0baf('0xed')](_0x131573[_0x0baf('0x4f')]['ids'],_['omit'](_0x131573[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0x1bd67f,null))['catch'](handleError(_0x1bd67f,null));};exports['getInteractions']=function(_0x3d740a,_0x2cb735){var _0xf82eb5={'raw':![],'where':{}};var _0x197bbe={};var _0x4a6a50={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x3d740a[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2cb735,null))[_0x0baf('0x15')](function(_0x120c18){if(_0x120c18){_0x197bbe[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatInteraction'][_0x0baf('0x34')]);_0x197bbe[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x3d740a[_0x0baf('0x39')]);_0x197bbe[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x197bbe['model'],_0x197bbe[_0x0baf('0x39')]);_0xf82eb5[_0x0baf('0x3c')]=_['intersection'](_0x197bbe['model'],qs[_0x0baf('0x3d')](_0x3d740a['query'][_0x0baf('0x3d')]));_0xf82eb5[_0x0baf('0x3c')]=_0xf82eb5[_0x0baf('0x3c')][_0x0baf('0x61')]?_0xf82eb5['attributes']:_0x197bbe[_0x0baf('0x36')];if(!_0x3d740a[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xf82eb5[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x3d740a['query'][_0x0baf('0x25')]);_0xf82eb5['offset']=qs[_0x0baf('0x23')](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xf82eb5[_0x0baf('0x40')]=qs['sort'](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x41')]);_0xf82eb5['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x3d740a['query'],_0x197bbe[_0x0baf('0x3a')]));_0xf82eb5[_0x0baf('0x44')]['ChatWebsiteId']=_0x120c18['id'];if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]){_0xf82eb5[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0xf82eb5[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xf82eb5['attributes'],function(_0x181385){var _0x120f68={};_0x120f68[_0x181385]={'$like':'%'+_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x120f68;})});}_0xf82eb5=_[_0x0baf('0x45')]({},_0xf82eb5,_0x3d740a[_0x0baf('0x48')]);return db[_0x0baf('0xab')][_0x0baf('0x26')]({'where':_0xf82eb5[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x72e44c){_0x4a6a50[_0x0baf('0x26')]=_0x72e44c;if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x49')]){_0xf82eb5[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xb7')],'as':_0x0baf('0xef'),'attributes':[_0x0baf('0x2f'),_0x0baf('0xf0'),_0x0baf('0xf1')],'required':![]},{'model':db['Tag'],'as':_0x0baf('0xf2'),'attributes':['id',_0x0baf('0x2f'),'color'],'where':_0x3d740a['query']['tag']?{'id':_0x3d740a[_0x0baf('0x39')]['tag']}:undefined,'required':_0x3d740a['query']['tag']?!![]:![]}];}return db[_0x0baf('0xab')][_0x0baf('0x5b')](_0xf82eb5);})[_0x0baf('0x15')](function(_0x5ab269){_0x4a6a50[_0x0baf('0x4b')]=_0x5ab269;return _0x4a6a50;});}})['then'](respondWithFilteredResult(_0x2cb735,_0xf82eb5))['catch'](handleError(_0x2cb735,null));};function iftimePromise(_0x743f4b,_0xc93c2b){return respondWithRpcPromise(_0x0baf('0xf3'),'getSnippet',{'command':_0xc93c2b['timezone']?util[_0x0baf('0xa4')](_0x0baf('0xf4'),_0x743f4b[_0x0baf('0xf5')],_0xc93c2b[_0x0baf('0xf6')]):util[_0x0baf('0xa4')](_0x0baf('0xf7'),_0x743f4b['interval'])},client9002)['then'](function(_0x217cd8){var _0x21e3b1=_0x217cd8&&_0x217cd8['indexOf'](_0x0baf('0xf8'))>=0x0?!![]:![];logger[_0x0baf('0x16')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b[_0x0baf('0xf5')],_0x21e3b1?'ONLINE':_0x0baf('0xfa'),_0xc93c2b['timezone']?_0xc93c2b['timezone']:_0x0baf('0xfb'));return _0x21e3b1;})['catch'](function(_0x4a0f32){logger[_0x0baf('0x1b')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b['interval'],util[_0x0baf('0xfc')](_0x4a0f32,{'showHidden':![],'depth':null}),_0xc93c2b[_0x0baf('0xf6')]?_0xc93c2b[_0x0baf('0xf6')]:_0x0baf('0xfb'));return![];});}exports[_0x0baf('0xfd')]=function(_0x1ad92d,_0x532e4b){var _0x395ad5=0x0;var _0x47fcb1=0x0;var _0x2a4997=![];var _0x2997b3;var _0x4e0fc6;return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x1ad92d[_0x0baf('0x4d')]['id']},'include':[{'model':db['Interval'],'as':_0x0baf('0xfe'),'include':[{'model':db[_0x0baf('0xfe')],'as':_0x0baf('0xff'),'attributes':['id',_0x0baf('0xf5')],'raw':!![]}]}]})[_0x0baf('0x15')](handleEntityNotFound(_0x532e4b,null))[_0x0baf('0x15')](function(_0x20f37b){if(_0x20f37b){_0x2997b3=_0x20f37b;return _0x20f37b[_0x0baf('0x100')]({'raw':!![]});}})['then'](function(_0x3f136e){if(_0x2997b3){if(_0x3f136e){_0x4e0fc6=_0x3f136e;}}return require(_0x0baf('0x101'))['getLicense']();})['then'](function(_0x276d39){if(_0x276d39){_0x47fcb1=_0x276d39[_0x0baf('0x102')];_0x2a4997=_0x276d39['custom'];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0xab')]['count']({'where':{'closed':![]}});})[_0x0baf('0x15')](function(_0x47825b){_0x395ad5=_0x47825b;if(_0x47fcb1&&_0x47825b>_0x47fcb1){return db[_0x0baf('0x103')][_0x0baf('0x59')]({'where':{'id':0x1}})[_0x0baf('0x15')](function(_0x9f5f16){if(_0x9f5f16){_0x9f5f16[_0x0baf('0x104')](_0x0baf('0x105'));}});}})[_0x0baf('0x15')](function(){if(_0x2997b3['Interval']&&_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')]){var _0x547a10=[];for(var _0x4ef69a=0x0;_0x4ef69a<_0x2997b3[_0x0baf('0xfe')]['Intervals'][_0x0baf('0x61')];_0x4ef69a++){var _0x3752fd=_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')][_0x4ef69a][_0x0baf('0x2a')]({'plain':!![]});_0x547a10[_0x0baf('0x106')](iftimePromise(_0x3752fd,_0x2997b3));}return BPromise[_0x0baf('0x107')](_0x547a10)[_0x0baf('0x15')](function(_0x148b9a){return _['some'](_0x148b9a);});}else{return!![];}})[_0x0baf('0x15')](function(_0x6721e9){var _0x2d4336=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0x108')),_0x0baf('0xc4'));var _0x550db0={'remote':_0x2997b3[_0x0baf('0x109')],'query':querystring[_0x0baf('0x1a')](_[_0x0baf('0x45')](_0x2997b3[_0x0baf('0x2a')]({'plain':!![]}),{'customerIp':_0x1ad92d['headers'][_0x0baf('0x9f')]||_0x1ad92d[_0x0baf('0x7e')]['x-real-ip']||_0x1ad92d['connection']['remoteAddress']||_0x1ad92d['ip'],'referer':_0x1ad92d[_0x0baf('0x7e')][_0x0baf('0x10a')],'openedInteractions':_0x395ad5,'maxInteractions':_0x47fcb1,'virtual':_0x2a4997[_0x0baf('0x102')],'online':_0x6721e9,'custom':_0x2a4997}))['replace'](/'/g,'\x5c\x27')};_0x532e4b[_0x0baf('0x30')](ejs[_0x0baf('0xc5')](Mustache[_0x0baf('0xc5')](_0x2d4336,_0x550db0),{'proactiveActions':_0x4e0fc6,'alignment':_0x2997b3[_0x0baf('0x10b')],'verticalAlignment':_0x2997b3[_0x0baf('0x10c')],'div_color':_0x2997b3['color'],'labelText':_0x2997b3[_0x0baf('0x10d')],'text_color':_0x2997b3[_0x0baf('0x10e')],'button_color':_0x2997b3[_0x0baf('0x10f')],'background_color':_0x2997b3[_0x0baf('0x110')]}));})[_0x0baf('0x1f')](handleError(_0x532e4b,null));};exports[_0x0baf('0x111')]=function(_0x5ab670,_0x4c4ffe){var _0x181980=_0x5ab670[_0x0baf('0x4d')]['id'];var _0x313e3e=_0x5ab670[_0x0baf('0x4f')];var _0x1cf4b5=0xc8;var _0x5d1985=null;return db[_0x0baf('0xd2')][_0x0baf('0x112')]({'isolationLevel':db[_0x0baf('0xd2')]['Transaction'][_0x0baf('0x113')][_0x0baf('0x114')]},function(_0x1e10a4){return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(_0x4d6e8e){if(_0x4d6e8e){return db[_0x0baf('0x115')][_0x0baf('0x29')]({'where':{'ChatWebsiteId':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(){var _0x594a08=_['map'](_0x313e3e,function(_0x45e0ec){_0x45e0ec[_0x0baf('0x5f')]=_0x181980;return _0x45e0ec;});return db[_0x0baf('0x115')][_0x0baf('0xd4')](_0x594a08,{'transaction':_0x1e10a4});});}else{_0x1cf4b5=0x194;_0x5d1985=[];}});})['then'](function(){if(_0x1cf4b5!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x181980},'order':_0x0baf('0x98')})[_0x0baf('0x15')](function(_0x46171d){_0x5d1985=_0x46171d;});}})['catch'](function(_0x2ba54d){_0x1cf4b5=0x1f4;logger[_0x0baf('0x1b')](_0x2ba54d[_0x0baf('0x2e')]);if(_0x2ba54d['name']){delete _0x2ba54d[_0x0baf('0x2f')];}_0x5d1985=_0x2ba54d;})[_0x0baf('0x116')](function(){if(_0x5d1985===null){_0x4c4ffe[_0x0baf('0x20')](_0x1cf4b5);}else{if(_0x1cf4b5===0x1f4){_0x4c4ffe['status'](_0x1cf4b5)['send'](_0x5d1985);}else{_0x4c4ffe['status'](_0x1cf4b5)['json'](_0x5d1985);}}});};exports[_0x0baf('0x117')]=function(_0x1c8b91,_0x3124bc){var _0x5ba16f={};var _0xcbc041={};var _0x5b1808;var _0x1abba8;return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x1c8b91['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3124bc,null))[_0x0baf('0x15')](function(_0xc0952d){if(_0xc0952d){_0x5b1808=_0xc0952d;_0xcbc041['model']=_[_0x0baf('0x38')](db[_0x0baf('0x115')]['rawAttributes']);_0xcbc041['query']=_[_0x0baf('0x38')](_0x1c8b91[_0x0baf('0x39')]);_0xcbc041[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],_0xcbc041[_0x0baf('0x39')]);_0x5ba16f[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x5ba16f[_0x0baf('0x3c')]=_0x5ba16f[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x5ba16f['attributes']:_0xcbc041[_0x0baf('0x36')];_0x5ba16f[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x1c8b91['query']['sort']);_0x5ba16f[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x1c8b91[_0x0baf('0x39')],_0xcbc041[_0x0baf('0x3a')]));if(_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x43')]){_0x5ba16f[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x5ba16f[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x5ba16f[_0x0baf('0x3c')],function(_0x4306bb){var _0x2c2d4b={};_0x2c2d4b[_0x4306bb]={'$like':'%'+_0x1c8b91[_0x0baf('0x39')]['filter']+'%'};return _0x2c2d4b;})});}_0x5ba16f=_[_0x0baf('0x45')]({},_0x5ba16f,_0x1c8b91[_0x0baf('0x48')]);return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x4056b6){if(_0x4056b6){_0x1abba8=_0x4056b6[_0x0baf('0x61')];if(!_0x1c8b91[_0x0baf('0x39')]['hasOwnProperty']('nolimit')){_0x5ba16f[_0x0baf('0x25')]=qs['limit'](_0x1c8b91['query'][_0x0baf('0x25')]);_0x5ba16f['offset']=qs[_0x0baf('0x23')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x2a02e6){if(_0x2a02e6){return _0x2a02e6?{'count':_0x1abba8,'rows':_0x2a02e6}:null;}})[_0x0baf('0x15')](respondWithResult(_0x3124bc,null))[_0x0baf('0x1f')](handleError(_0x3124bc,null));};exports['addProactiveActions']=function(_0x4bcc76,_0xae7f71){return db[_0x0baf('0x118')][_0x0baf('0x54')]({'where':{'id':_0x4bcc76[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0xae7f71,null))['then'](function(_0x123037){if(_0x123037){return _0x123037[_0x0baf('0x119')](_0x4bcc76[_0x0baf('0x4f')][_0x0baf('0x5d')],_[_0x0baf('0x11a')](_0x4bcc76[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0xae7f71,null))[_0x0baf('0x1f')](handleError(_0xae7f71,null));};exports[_0x0baf('0x100')]=function(_0x238649,_0x30ef34){var _0x43c6a6={};var _0x2448dd={};var _0x4a999b;var _0x165555;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x238649[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30ef34,null))['then'](function(_0x2723ea){if(_0x2723ea){_0x4a999b=_0x2723ea;_0x2448dd[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatProactiveAction']['rawAttributes']);_0x2448dd[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x238649['query']);_0x2448dd[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x2448dd['model'],_0x2448dd[_0x0baf('0x39')]);_0x43c6a6[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x2448dd[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x238649[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x43c6a6['attributes']=_0x43c6a6['attributes'][_0x0baf('0x61')]?_0x43c6a6['attributes']:_0x2448dd[_0x0baf('0x36')];_0x43c6a6[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x238649['query'][_0x0baf('0x41')]);_0x43c6a6[_0x0baf('0x44')]=qs['filters'](_[_0x0baf('0x42')](_0x238649[_0x0baf('0x39')],_0x2448dd[_0x0baf('0x3a')]));if(_0x238649[_0x0baf('0x39')][_0x0baf('0x43')]){_0x43c6a6[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x43c6a6[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x43c6a6['attributes'],function(_0x2739c7){var _0x1bea85={};_0x1bea85[_0x2739c7]={'$like':'%'+_0x238649['query']['filter']+'%'};return _0x1bea85;})});}_0x43c6a6=_[_0x0baf('0x45')]({},_0x43c6a6,_0x238649[_0x0baf('0x48')]);return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})[_0x0baf('0x15')](function(_0x34d2db){if(_0x34d2db){_0x165555=_0x34d2db['length'];if(!_0x238649['query'][_0x0baf('0x3e')]('nolimit')){_0x43c6a6[_0x0baf('0x25')]=qs['limit'](_0x238649[_0x0baf('0x39')][_0x0baf('0x25')]);_0x43c6a6[_0x0baf('0x23')]=qs['offset'](_0x238649[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})['then'](function(_0xb3a031){if(_0xb3a031){return _0xb3a031?{'count':_0x165555,'rows':_0xb3a031}:null;}})[_0x0baf('0x15')](respondWithResult(_0x30ef34,null))[_0x0baf('0x1f')](handleError(_0x30ef34,null));};exports[_0x0baf('0x11b')]=function(_0x3597fe,_0x132995){var _0x12c4bf=_0x3597fe[_0x0baf('0x39')][_0x0baf('0x11c')]===_0x0baf('0x11d')?'offlineForm':_0x0baf('0x11e');return db[_0x0baf('0x33')]['find']({'attributes':['id',_0x12c4bf],'where':{'id':_0x3597fe[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x132995,null))[_0x0baf('0x15')](function(_0xc2b22e){if(_0xc2b22e){var _0x51f903=_0xc2b22e[_0x12c4bf];var _0x423e9c=_0x51f903&&_0x51f903[_0x0baf('0x11f')]?_0x51f903[_0x0baf('0x11f')]:[];_0x132995['send']({'fromKey':_['isNil'](_0x51f903[_0x0baf('0x120')])?undefined:_0x51f903['fromKey'],'count':_0x423e9c[_0x0baf('0x61')],'rows':_0x423e9c});}})[_0x0baf('0x1f')](handleError(_0x132995,null));};exports['getOfflineMessages']=function(_0x53e81a,_0x572289){var _0x4fc936={'raw':![],'where':{}};var _0x423636={};var _0x51f03c={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x53e81a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x572289,null))['then'](function(_0xa010ed){if(_0xa010ed){_0x423636[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0xc8')]['rawAttributes']);_0x423636[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x53e81a['query']);_0x423636[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x423636['model'],_0x423636[_0x0baf('0x39')]);_0x4fc936[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x423636[_0x0baf('0x36')],qs['fields'](_0x53e81a[_0x0baf('0x39')]['fields']));_0x4fc936[_0x0baf('0x3c')]=_0x4fc936[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x4fc936['attributes']:_0x423636['model'];if(!_0x53e81a[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x4fc936['limit']=qs[_0x0baf('0x25')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x25')]);_0x4fc936['offset']=qs[_0x0baf('0x23')](_0x53e81a['query'][_0x0baf('0x23')]);}_0x4fc936[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x41')]);_0x4fc936[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x53e81a[_0x0baf('0x39')],_0x423636['filters']));_0x4fc936[_0x0baf('0x44')][_0x0baf('0x5f')]=_0xa010ed['id'];if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]){_0x4fc936[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x4fc936[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x4fc936[_0x0baf('0x3c')],function(_0x410e8e){var _0x54facf={};_0x54facf[_0x410e8e]={'$like':'%'+_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x54facf;})});}_0x4fc936=_['merge']({},_0x4fc936,_0x53e81a[_0x0baf('0x48')]);return db[_0x0baf('0xc8')][_0x0baf('0x26')]({'where':_0x4fc936[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x1fb9f7){_0x51f03c[_0x0baf('0x26')]=_0x1fb9f7;if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x49')]){_0x4fc936['include']=[{'all':!![]}];}else{_0x4fc936[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xd3')],'as':_0x0baf('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4fc936);})[_0x0baf('0x15')](function(_0x58b532){_0x51f03c[_0x0baf('0x4b')]=_0x58b532;return _0x51f03c;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x572289,_0x4fc936))[_0x0baf('0x1f')](handleError(_0x572289,null));};exports[_0x0baf('0x122')]=function(_0x3a667a,_0x2629e9){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x3a667a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2629e9,null))['then'](function(_0x274787){if(_0x274787){return _0x274787[_0x0baf('0x122')](_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')],_['omit'](_0x3a667a[_0x0baf('0x4f')],['ids','id'])||{})[_0x0baf('0xaf')](function(_0x548f40){for(var _0x64dd21=0x0;_0x64dd21<_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')]['length'];_0x64dd21+=0x1){socket[_0x0baf('0x123')](_0x0baf('0x124'),{'UserId':Number(_0x3a667a['body']['ids'][_0x64dd21]),'ChatWebsiteId':Number(_0x3a667a['params']['id'])});}return _0x548f40;});}})['then'](respondWithResult(_0x2629e9,null))[_0x0baf('0x1f')](handleError(_0x2629e9,null));};exports[_0x0baf('0x125')]=function(_0x1c414,_0x27c810){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1c414[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x27c810,null))[_0x0baf('0x15')](function(_0xfa0191){if(_0xfa0191){return _0xfa0191[_0x0baf('0x125')](_0x1c414[_0x0baf('0x39')]['ids'])[_0x0baf('0x15')](function(){if(_['isArray'](_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')])){for(var _0x93dcbd=0x0;_0x93dcbd<_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')][_0x0baf('0x61')];_0x93dcbd+=0x1){socket[_0x0baf('0x123')]('userChatWebsite:remove',{'UserId':Number(_0x1c414[_0x0baf('0x39')]['ids'][_0x93dcbd]),'ChatWebsiteId':Number(_0x1c414[_0x0baf('0x4d')]['id'])});}}else{socket[_0x0baf('0x123')](_0x0baf('0x126'),{'UserId':Number(_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')]),'ChatWebsiteId':Number(_0x1c414['params']['id'])});}});}})['then'](respondWithStatusCode(_0x27c810,null))[_0x0baf('0x1f')](handleError(_0x27c810,null));};exports[_0x0baf('0x127')]=function(_0x28c059,_0x51c9e0){var _0x52faae={};var _0x47868e={};var _0x2849c1;var _0x3dd487;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x28c059[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x51c9e0,null))[_0x0baf('0x15')](function(_0x393408){if(_0x393408){_0x2849c1=_0x393408;_0x47868e['model']=_['keys'](db[_0x0baf('0xb7')][_0x0baf('0x34')]);_0x47868e[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x28c059['query']);_0x47868e[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],_0x47868e['query']);_0x52faae[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x28c059['query'][_0x0baf('0x3d')]));_0x52faae[_0x0baf('0x3c')]=_0x52faae[_0x0baf('0x3c')]['length']?_0x52faae[_0x0baf('0x3c')]:_0x47868e[_0x0baf('0x36')];_0x52faae['order']=qs[_0x0baf('0x41')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x41')]);_0x52faae[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_['pick'](_0x28c059['query'],_0x47868e[_0x0baf('0x3a')]));if(_0x28c059['query'][_0x0baf('0x43')]){_0x52faae[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x52faae[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x52faae[_0x0baf('0x3c')],function(_0xe30e49){var _0x3a5d39={};_0x3a5d39[_0xe30e49]={'$like':'%'+_0x28c059[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x3a5d39;})});}_0x52faae=_[_0x0baf('0x45')]({},_0x52faae,_0x28c059[_0x0baf('0x48')]);return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})['then'](function(_0x1684e5){if(_0x1684e5){_0x3dd487=_0x1684e5[_0x0baf('0x61')];if(!_0x28c059[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x52faae[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x25')]);_0x52faae[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x28c059[_0x0baf('0x39')]['offset']);}return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})[_0x0baf('0x15')](function(_0x1ea92f){if(_0x1ea92f){return _0x1ea92f?{'count':_0x3dd487,'rows':_0x1ea92f}:null;}})['then'](respondWithResult(_0x51c9e0,null))[_0x0baf('0x1f')](handleError(_0x51c9e0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index ab39d5e..53287b5 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 _0xafe6=['update','emit','hook','exports','events','../../mysqldb','save'];(function(_0x2e0851,_0x4bcf4c){var _0xb79e84=function(_0x5c4770){while(--_0x5c4770){_0x2e0851['push'](_0x2e0851['shift']());}};_0xb79e84(++_0x4bcf4c);}(_0xafe6,0xac));var _0x6afe=function(_0x56b754,_0x4be944){_0x56b754=_0x56b754-0x0;var _0x450cb5=_0xafe6[_0x56b754];return _0x450cb5;};'use strict';var EventEmitter=require(_0x6afe('0x0'));var ChatWebsite=require(_0x6afe('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6afe('0x2'),'afterUpdate':_0x6afe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x591738){return function(_0x40d720,_0x176f85,_0xb8eaf9){ChatWebsiteEvents[_0x6afe('0x4')](_0x591738+':'+_0x40d720['id'],_0x40d720);ChatWebsiteEvents[_0x6afe('0x4')](_0x591738,_0x40d720);_0xb8eaf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x6afe('0x5')](e,emitEvent(event));}}module[_0x6afe('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xac9d=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x5d00e9,_0x496174){var _0x399693=function(_0x241538){while(--_0x241538){_0x5d00e9['push'](_0x5d00e9['shift']());}};_0x399693(++_0x496174);}(_0xac9d,0x14d));var _0xdac9=function(_0x48b88f,_0x2e1e94){_0x48b88f=_0x48b88f-0x0;var _0x34d441=_0xac9d[_0x48b88f];return _0x34d441;};'use strict';var EventEmitter=require(_0xdac9('0x0'));var ChatWebsite=require(_0xdac9('0x1'))['db'][_0xdac9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdac9('0x3')](0x0);var events={'afterCreate':_0xdac9('0x4'),'afterUpdate':_0xdac9('0x5'),'afterDestroy':_0xdac9('0x6')};function emitEvent(_0x1b967e){return function(_0x51a5d7,_0x1c17a6,_0x5a984a){ChatWebsiteEvents[_0xdac9('0x7')](_0x1b967e+':'+_0x51a5d7['id'],_0x51a5d7);ChatWebsiteEvents[_0xdac9('0x7')](_0x1b967e,_0x51a5d7);_0x5a984a(null);};}for(var e in events){if(events[_0xdac9('0x8')](e)){var event=events[e];ChatWebsite[_0xdac9('0x9')](e,emitEvent(event));}}module[_0xdac9('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 62590b3..ecb3a2b 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 _0xaf65=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash','util'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xaf65,0xda));var _0x5af6=function(_0x49254c,_0x1ee5ee){_0x49254c=_0x49254c-0x0;var _0x24faa3=_0xaf65[_0x49254c];return _0x24faa3;};'use strict';var _=require(_0x5af6('0x0'));var util=require(_0x5af6('0x1'));var logger=require(_0x5af6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5af6('0x3'));var rp=require(_0x5af6('0x4'));var fs=require('fs');var path=require(_0x5af6('0x5'));var rimraf=require(_0x5af6('0x6'));var config=require(_0x5af6('0x7'));var attributes=require(_0x5af6('0x8'));module[_0x5af6('0x9')]=function(_0x27efee,_0x1ab28b){return _0x27efee[_0x5af6('0xa')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c94=['api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','lodash','util'];(function(_0x2990bd,_0x310e66){var _0x47eada=function(_0x2e5e2d){while(--_0x2e5e2d){_0x2990bd['push'](_0x2990bd['shift']());}};_0x47eada(++_0x310e66);}(_0x2c94,0xb2));var _0x42c9=function(_0x32f3b5,_0x5cfa8f){_0x32f3b5=_0x32f3b5-0x0;var _0x4ea9d5=_0x2c94[_0x32f3b5];return _0x4ea9d5;};'use strict';var _=require(_0x42c9('0x0'));var util=require(_0x42c9('0x1'));var logger=require('../../config/logger')(_0x42c9('0x2'));var moment=require(_0x42c9('0x3'));var BPromise=require(_0x42c9('0x4'));var rp=require(_0x42c9('0x5'));var fs=require('fs');var path=require(_0x42c9('0x6'));var rimraf=require(_0x42c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x42c9('0x8'));module['exports']=function(_0x581fa3,_0xadc5b){return _0x581fa3[_0x42c9('0x9')]('ChatWebsite',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 a18b72c..db41b5e 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 _0x81ca=['result','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x81ca,0xc1));var _0xa81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81ca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa81c('0x0'));var moment=require(_0xa81c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa81c('0x2'));var fs=require('fs');var Redis=require(_0xa81c('0x3'));var db=require(_0xa81c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa81c('0x5'));var config=require('../../config/environment');var jayson=require(_0xa81c('0x6'));var client=jayson[_0xa81c('0x7')][_0xa81c('0x8')]({'port':0x232a});config[_0xa81c('0x9')]=_[_0xa81c('0xa')](config[_0xa81c('0x9')],{'host':_0xa81c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa81c('0xc'))[_0xa81c('0xd')](socket);function respondWithRpcPromise(_0x46c99b,_0x3e4f42,_0x534bc5){return new BPromise(function(_0x554a1e,_0x6c7c68){return client[_0xa81c('0xe')](_0x46c99b,_0x534bc5)[_0xa81c('0xf')](function(_0x581eb8){logger['info'](_0xa81c('0x10'),_0x3e4f42,'request\x20sent');logger[_0xa81c('0x11')](_0xa81c('0x12'),_0x3e4f42,_0xa81c('0x13'),JSON['stringify'](_0x581eb8));if(_0x581eb8[_0xa81c('0x14')]){if(_0x581eb8['error'][_0xa81c('0x15')]===0x1f4){logger[_0xa81c('0x14')](_0xa81c('0x10'),_0x3e4f42,_0x581eb8['error']['message']);return _0x6c7c68(_0x581eb8['error'][_0xa81c('0x16')]);}logger[_0xa81c('0x14')](_0xa81c('0x10'),_0x3e4f42,_0x581eb8[_0xa81c('0x14')][_0xa81c('0x16')]);return _0x554a1e(_0x581eb8[_0xa81c('0x14')][_0xa81c('0x16')]);}else{logger['info'](_0xa81c('0x10'),_0x3e4f42,_0xa81c('0x13'));_0x554a1e(_0x581eb8[_0xa81c('0x17')][_0xa81c('0x16')]);}})['catch'](function(_0x36b71e){logger[_0xa81c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3e4f42,_0x36b71e);_0x6c7c68(_0x36b71e);});});} \ No newline at end of file +var _0x2906=['socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatWebsite,\x20%s,\x20%s','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x5c63be,_0x16d12f){var _0x20a6ae=function(_0x3cdc3f){while(--_0x3cdc3f){_0x5c63be['push'](_0x5c63be['shift']());}};_0x20a6ae(++_0x16d12f);}(_0x2906,0xbc));var _0x6290=function(_0x267390,_0x1733f2){_0x267390=_0x267390-0x0;var _0x19c5a9=_0x2906[_0x267390];return _0x19c5a9;};'use strict';var _=require(_0x6290('0x0'));var util=require(_0x6290('0x1'));var moment=require(_0x6290('0x2'));var BPromise=require('bluebird');var rs=require(_0x6290('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6290('0x4'));var logger=require('../../config/logger')(_0x6290('0x5'));var config=require(_0x6290('0x6'));var jayson=require(_0x6290('0x7'));var client=jayson[_0x6290('0x8')][_0x6290('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6290('0xa')],{'host':_0x6290('0xb'),'port':0x18eb});var socket=require(_0x6290('0xc'))(new Redis(config[_0x6290('0xa')]));require(_0x6290('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b7d24,_0x8e0fd,_0x37f39e){return new BPromise(function(_0x4224ae,_0x4ebd9e){return client[_0x6290('0xe')](_0x2b7d24,_0x37f39e)[_0x6290('0xf')](function(_0x225198){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x8e0fd,_0x6290('0x10'));logger['debug'](_0x6290('0x11'),_0x8e0fd,_0x6290('0x10'),JSON[_0x6290('0x12')](_0x225198));if(_0x225198[_0x6290('0x13')]){if(_0x225198[_0x6290('0x13')][_0x6290('0x14')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x8e0fd,_0x225198['error'][_0x6290('0x15')]);return _0x4ebd9e(_0x225198[_0x6290('0x13')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x8e0fd,_0x225198['error'][_0x6290('0x15')]);return _0x4224ae(_0x225198[_0x6290('0x13')][_0x6290('0x15')]);}else{logger[_0x6290('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x8e0fd,_0x6290('0x10'));_0x4224ae(_0x225198[_0x6290('0x17')]['message']);}})['catch'](function(_0x29f5e6){logger[_0x6290('0x13')](_0x6290('0x18'),_0x8e0fd,_0x29f5e6);_0x4ebd9e(_0x29f5e6);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 444ee0a..1c855b4 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 _0xc30a=['register','length','remove','update','emit','removeListener'];(function(_0x3a14f6,_0x5caf4e){var _0x35bbfb=function(_0x194f11){while(--_0x194f11){_0x3a14f6['push'](_0x3a14f6['shift']());}};_0x35bbfb(++_0x5caf4e);}(_0xc30a,0x18e));var _0xac30=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xc30a[_0x21aec3];return _0x288bbc;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xac30('0x0'),_0xac30('0x1')];function createListener(_0x2c9b75,_0x101768){return function(_0x34b5d2){_0x101768[_0xac30('0x2')](_0x2c9b75,_0x34b5d2);};}function removeListener(_0x4efe0f,_0x5c8e6f){return function(){ChatWebsiteEvents[_0xac30('0x3')](_0x4efe0f,_0x5c8e6f);};}exports[_0xac30('0x4')]=function(_0x4b7211){for(var _0x3f9661=0x0,_0x57175f=events[_0xac30('0x5')];_0x3f9661<_0x57175f;_0x3f9661++){var _0x3ddb41=events[_0x3f9661];var _0x286fc7=createListener('chatWebsite:'+_0x3ddb41,_0x4b7211);ChatWebsiteEvents['on'](_0x3ddb41,_0x286fc7);}}; \ No newline at end of file +var _0x2d41=['./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x13bea0,_0x210a0c){var _0x3f12df=function(_0x11ef1c){while(--_0x11ef1c){_0x13bea0['push'](_0x13bea0['shift']());}};_0x3f12df(++_0x210a0c);}(_0x2d41,0xcb));var _0x12d4=function(_0x4dd526,_0x54d6a8){_0x4dd526=_0x4dd526-0x0;var _0x5a2890=_0x2d41[_0x4dd526];return _0x5a2890;};'use strict';var ChatWebsiteEvents=require(_0x12d4('0x0'));var events=[_0x12d4('0x1'),_0x12d4('0x2'),'update'];function createListener(_0x4514b7,_0x208a03){return function(_0x444dfe){_0x208a03[_0x12d4('0x3')](_0x4514b7,_0x444dfe);};}function removeListener(_0x1c290c,_0x456108){return function(){ChatWebsiteEvents[_0x12d4('0x4')](_0x1c290c,_0x456108);};}exports[_0x12d4('0x5')]=function(_0x2d6b7a){for(var _0x36da9=0x0,_0x3952d5=events[_0x12d4('0x6')];_0x36da9<_0x3952d5;_0x36da9++){var _0x116c2d=events[_0x36da9];var _0x2b7e7f=createListener('chatWebsite:'+_0x116c2d,_0x2d6b7a);ChatWebsiteEvents['on'](_0x116c2d,_0x2b7e7f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 7b08fa7..0216333 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 _0xfd78=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','server/files/images/avatars/','format','/:id/customer_avatar','/:id/notify','notify','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xfd78,0xff));var _0x8fd7=function(_0x62041b,_0x2f1a13){_0x62041b=_0x62041b-0x0;var _0x3e485c=_0xfd78[_0x62041b];return _0x3e485c;};'use strict';var multer=require(_0x8fd7('0x0'));var util=require(_0x8fd7('0x1'));var path=require('path');var timeout=require(_0x8fd7('0x2'));var express=require(_0x8fd7('0x3'));var router=express['Router']();var fs_extra=require(_0x8fd7('0x4'));var auth=require(_0x8fd7('0x5'));var interaction=require(_0x8fd7('0x6'));var config=require(_0x8fd7('0x7'));var controller=require('./chatWebsite.controller');router[_0x8fd7('0x8')]('/',auth[_0x8fd7('0x9')](),controller[_0x8fd7('0xa')]);router[_0x8fd7('0x8')](_0x8fd7('0xb'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0xc')]);router['get'](_0x8fd7('0xd'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0xe')]);router[_0x8fd7('0x8')](_0x8fd7('0xf'),auth[_0x8fd7('0x9')](),controller['getDispositions']);router['get'](_0x8fd7('0x10'),auth[_0x8fd7('0x9')](),controller['getAnswers']);router[_0x8fd7('0x8')](_0x8fd7('0x11'),controller[_0x8fd7('0x12')]);router[_0x8fd7('0x8')](_0x8fd7('0x13'),controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0x8fd7('0x14')]);router[_0x8fd7('0x8')](_0x8fd7('0x15'),controller[_0x8fd7('0x16')]);router[_0x8fd7('0x8')](_0x8fd7('0x17'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x18')]);router[_0x8fd7('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x8fd7('0x8')](_0x8fd7('0x19'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x1a')]);router[_0x8fd7('0x8')](_0x8fd7('0x1b'),auth[_0x8fd7('0x9')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x8fd7('0x1c')]);router[_0x8fd7('0x8')](_0x8fd7('0x1d'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x1e')]);router[_0x8fd7('0x8')](_0x8fd7('0x1f'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x20')]);router[_0x8fd7('0x21')]('/',auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x22')]);router[_0x8fd7('0x21')](_0x8fd7('0xf'),auth['isAuthenticated'](),controller[_0x8fd7('0x23')]);router[_0x8fd7('0x21')]('/:id/canned_answers',auth[_0x8fd7('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x8fd7('0x24')]({'destination':function(_0x481890,_0x4e7051,_0x41d3b9){_0x41d3b9(null,path[_0x8fd7('0x25')](config[_0x8fd7('0x26')],_0x8fd7('0x27')));},'filename':function(_0x12506e,_0x26b6c7,_0x127a95){_0x127a95(null,util['format'](_0x8fd7('0x28'),Date[_0x8fd7('0x29')](),_0x26b6c7[_0x8fd7('0x2a')]));}})});router[_0x8fd7('0x21')]('/:id/logo',upload[_0x8fd7('0x2b')](_0x8fd7('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0x8fd7('0x24')]({'destination':function(_0x2df628,_0x4722be,_0x168d55){_0x168d55(null,path['join'](config[_0x8fd7('0x26')],_0x8fd7('0x2d')));},'filename':function(_0x12bb3a,_0x4ce7c9,_0x5b33dc){_0x5b33dc(null,util[_0x8fd7('0x2e')](_0x8fd7('0x28'),Date[_0x8fd7('0x29')](),_0x4ce7c9['originalname']));}})});router[_0x8fd7('0x21')](_0x8fd7('0x13'),upload[_0x8fd7('0x2b')](_0x8fd7('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x8fd7('0x24')]({'destination':function(_0x4679a9,_0x54c8cf,_0x19f4af){_0x19f4af(null,path[_0x8fd7('0x25')](config[_0x8fd7('0x26')],_0x8fd7('0x2d')));},'filename':function(_0x437c11,_0x134287,_0x523fe4){_0x523fe4(null,util[_0x8fd7('0x2e')](_0x8fd7('0x28'),Date[_0x8fd7('0x29')](),_0x134287[_0x8fd7('0x2a')]));}})});router[_0x8fd7('0x21')](_0x8fd7('0x2f'),upload[_0x8fd7('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x8fd7('0x24')]({'destination':function(_0x467721,_0x360ac6,_0x45b9a6){_0x45b9a6(null,path[_0x8fd7('0x25')](config[_0x8fd7('0x26')],_0x8fd7('0x2d')));},'filename':function(_0x16aa7b,_0x222ae5,_0x3fad43){_0x3fad43(null,util[_0x8fd7('0x2e')](_0x8fd7('0x28'),Date[_0x8fd7('0x29')](),_0x222ae5['originalname']));}})});router[_0x8fd7('0x21')](_0x8fd7('0x15'),upload[_0x8fd7('0x2b')](_0x8fd7('0x2c')),controller['addSystemAvatar']);router[_0x8fd7('0x21')](_0x8fd7('0x30'),controller[_0x8fd7('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x8fd7('0x24')]({'destination':function(_0x33a7c0,_0x449a40,_0x2c1c6a){const _0x215db6=path[_0x8fd7('0x25')](config[_0x8fd7('0x26')],'server/files','attachments',_0x8fd7('0x32'));fs_extra[_0x8fd7('0x33')](_0x215db6,function(){_0x2c1c6a(null,_0x215db6);});},'filename':function(_0x1f1e80,_0x519c28,_0x1e8ca6){const _0x5786ce=_0x519c28[_0x8fd7('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x474a1a=path['extname'](_0x5786ce);const _0x2b5f5b=Date[_0x8fd7('0x29')]()+'-'+_0x5786ce[_0x8fd7('0x34')](_0x474a1a,'')+_0x474a1a;_0x1e8ca6(null,_0x2b5f5b);}})});router[_0x8fd7('0x21')](_0x8fd7('0x35'),offlineUploadMulter[_0x8fd7('0x36')](),controller['offline']);router['post'](_0x8fd7('0x17'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x37')]);router[_0x8fd7('0x21')](_0x8fd7('0x19'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x38')]);router[_0x8fd7('0x21')](_0x8fd7('0x1b'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x39')]);router['post']('/:id/users',auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x3a')]);router[_0x8fd7('0x3b')](_0x8fd7('0xd'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x3c')]);router[_0x8fd7('0x3d')](_0x8fd7('0xd'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x3e')]);router[_0x8fd7('0x3d')](_0x8fd7('0xf'),auth[_0x8fd7('0x9')](),controller['removeDispositions']);router['delete'](_0x8fd7('0x10'),auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x3f')]);router[_0x8fd7('0x3d')]('/:id/users',auth[_0x8fd7('0x9')](),controller[_0x8fd7('0x40')]);module[_0x8fd7('0x41')]=router; \ No newline at end of file +var _0xa1ba=['offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join','root','server/files/images/logos/','originalname','single','addLogo','diskStorage','server/files/images/avatars/','addAvatar','format','%s-%s','now','/:id/customer_avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x22e89a,_0x213ae0){var _0x5f49e9=function(_0x134e7d){while(--_0x134e7d){_0x22e89a['push'](_0x22e89a['shift']());}};_0x5f49e9(++_0x213ae0);}(_0xa1ba,0x19e));var _0xaa1b=function(_0xb9615d,_0x52b31c){_0xb9615d=_0xb9615d-0x0;var _0x234c41=_0xa1ba[_0xb9615d];return _0x234c41;};'use strict';var multer=require(_0xaa1b('0x0'));var util=require(_0xaa1b('0x1'));var path=require(_0xaa1b('0x2'));var timeout=require(_0xaa1b('0x3'));var express=require('express');var router=express[_0xaa1b('0x4')]();var fs_extra=require(_0xaa1b('0x5'));var auth=require(_0xaa1b('0x6'));var interaction=require(_0xaa1b('0x7'));var config=require(_0xaa1b('0x8'));var controller=require(_0xaa1b('0x9'));router[_0xaa1b('0xa')]('/',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0xc')]);router['get']('/describe',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0xd')]);router[_0xaa1b('0xa')]('/:id',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0xe')]);router['get'](_0xaa1b('0xf'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x10')]);router['get'](_0xaa1b('0x11'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x12')]);router[_0xaa1b('0xa')](_0xaa1b('0x13'),controller[_0xaa1b('0x14')]);router['get'](_0xaa1b('0x15'),controller[_0xaa1b('0x16')]);router[_0xaa1b('0xa')]('/:id/customer_avatar',controller[_0xaa1b('0x17')]);router['get'](_0xaa1b('0x18'),controller['getSystemAvatar']);router[_0xaa1b('0xa')](_0xaa1b('0x19'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x1a')]);router[_0xaa1b('0xa')](_0xaa1b('0x1b'),controller[_0xaa1b('0x1c')]);router[_0xaa1b('0xa')](_0xaa1b('0x1d'),auth['isAuthenticated'](),controller[_0xaa1b('0x1e')]);router[_0xaa1b('0xa')](_0xaa1b('0x1f'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x20')]);router[_0xaa1b('0xa')](_0xaa1b('0x21'),controller[_0xaa1b('0x22')]);router[_0xaa1b('0xa')](_0xaa1b('0x23'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x24')]);router[_0xaa1b('0xa')](_0xaa1b('0x25'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x26')]);router['post']('/',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x27')]);router[_0xaa1b('0x28')](_0xaa1b('0xf'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x29')]);router[_0xaa1b('0x28')](_0xaa1b('0x11'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41f498,_0xe24a3,_0x110a10){_0x110a10(null,path[_0xaa1b('0x2a')](config[_0xaa1b('0x2b')],_0xaa1b('0x2c')));},'filename':function(_0x5e4c98,_0x5ca727,_0x39f88e){_0x39f88e(null,util['format']('%s-%s',Date['now'](),_0x5ca727[_0xaa1b('0x2d')]));}})});router[_0xaa1b('0x28')](_0xaa1b('0x13'),upload[_0xaa1b('0x2e')]('file'),controller[_0xaa1b('0x2f')]);var upload=multer({'storage':multer[_0xaa1b('0x30')]({'destination':function(_0x189440,_0x460bc8,_0x29879c){_0x29879c(null,path[_0xaa1b('0x2a')](config[_0xaa1b('0x2b')],_0xaa1b('0x31')));},'filename':function(_0x16b725,_0x2f9f32,_0x1d8877){_0x1d8877(null,util['format']('%s-%s',Date['now'](),_0x2f9f32[_0xaa1b('0x2d')]));}})});router['post'](_0xaa1b('0x15'),upload[_0xaa1b('0x2e')]('file'),controller[_0xaa1b('0x32')]);var upload=multer({'storage':multer[_0xaa1b('0x30')]({'destination':function(_0xc7164a,_0x71da53,_0x4b51be){_0x4b51be(null,path[_0xaa1b('0x2a')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2f91d1,_0xcb5fb9,_0xcf70ef){_0xcf70ef(null,util[_0xaa1b('0x33')](_0xaa1b('0x34'),Date[_0xaa1b('0x35')](),_0xcb5fb9[_0xaa1b('0x2d')]));}})});router[_0xaa1b('0x28')](_0xaa1b('0x36'),upload['single'](_0xaa1b('0x37')),controller[_0xaa1b('0x38')]);var upload=multer({'storage':multer[_0xaa1b('0x30')]({'destination':function(_0x1ce035,_0x3d080a,_0x3afed0){_0x3afed0(null,path[_0xaa1b('0x2a')](config[_0xaa1b('0x2b')],_0xaa1b('0x31')));},'filename':function(_0x5c9622,_0x1c009e,_0x47ea9d){_0x47ea9d(null,util[_0xaa1b('0x33')](_0xaa1b('0x34'),Date[_0xaa1b('0x35')](),_0x1c009e[_0xaa1b('0x2d')]));}})});router['post'](_0xaa1b('0x18'),upload[_0xaa1b('0x2e')](_0xaa1b('0x37')),controller[_0xaa1b('0x39')]);router[_0xaa1b('0x28')](_0xaa1b('0x3a'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xaa1b('0x30')]({'destination':function(_0x4ec91e,_0x20b5a8,_0x5a49e6){const _0x467cd1=path[_0xaa1b('0x2a')](config[_0xaa1b('0x2b')],_0xaa1b('0x3b'),'attachments',_0xaa1b('0x3c'));fs_extra[_0xaa1b('0x3d')](_0x467cd1,function(){_0x5a49e6(null,_0x467cd1);});},'filename':function(_0x1e91ff,_0x5c8d4e,_0x31d6df){const _0x5b28ca=_0x5c8d4e[_0xaa1b('0x2d')][_0xaa1b('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x59ad41=path[_0xaa1b('0x3f')](_0x5b28ca);const _0x56e11b=Date[_0xaa1b('0x35')]()+'-'+_0x5b28ca['replace'](_0x59ad41,'')+_0x59ad41;_0x31d6df(null,_0x56e11b);}})});router[_0xaa1b('0x28')](_0xaa1b('0x40'),offlineUploadMulter[_0xaa1b('0x41')](),controller[_0xaa1b('0x42')]);router[_0xaa1b('0x28')](_0xaa1b('0x19'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x43')]);router[_0xaa1b('0x28')](_0xaa1b('0x1d'),auth[_0xaa1b('0xb')](),controller['addApplications']);router[_0xaa1b('0x28')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xaa1b('0x44')]);router['post'](_0xaa1b('0x25'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x45')]);router[_0xaa1b('0x46')]('/:id',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x47')]);router[_0xaa1b('0x48')](_0xaa1b('0x49'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x4a')]);router[_0xaa1b('0x48')]('/:id/dispositions',auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x4b')]);router[_0xaa1b('0x48')](_0xaa1b('0x11'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x4c')]);router[_0xaa1b('0x48')](_0xaa1b('0x25'),auth[_0xaa1b('0xb')](),controller[_0xaa1b('0x4d')]);module[_0xaa1b('0x4e')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 92c9a98..0966cad 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 _0x0878=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use'];(function(_0x4d2552,_0x560684){var _0x56761b=function(_0x33805f){while(--_0x33805f){_0x4d2552['push'](_0x4d2552['shift']());}};_0x56761b(++_0x560684);}(_0x0878,0x98));var _0x8087=function(_0x35d038,_0x528e62){_0x35d038=_0x35d038-0x0;var _0x414015=_0x0878[_0x35d038];return _0x414015;};var beaverLogger=require(_0x8087('0x0'));var express=require(_0x8087('0x1'));var auth=require(_0x8087('0x2'));var config=require(_0x8087('0x3'));var router=express[_0x8087('0x4')]();var isProduction=config[_0x8087('0x5')]===_0x8087('0x6')||![];function clientSideLogs(_0x11107f,_0x5bdd18,_0x530b0b){var _0x32a7a0=_0x11107f[_0x8087('0x7')][_0x8087('0x8')](_0x8087('0x9'));if(!_0x32a7a0){throw new Error(_0x8087('0xa'));}return beaverLogger[_0x8087('0xb')]({'uri':'/client-logs','logger':_0x32a7a0,'enableCors':!isProduction})(_0x11107f,_0x5bdd18,_0x530b0b);}router[_0x8087('0xc')](auth[_0x8087('0xd')](),clientSideLogs);module[_0x8087('0xe')]=router; \ No newline at end of file +var _0x19fe=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env'];(function(_0x50700c,_0x3eafbf){var _0x21d99d=function(_0x461bc9){while(--_0x461bc9){_0x50700c['push'](_0x50700c['shift']());}};_0x21d99d(++_0x3eafbf);}(_0x19fe,0x19e));var _0xe19f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x19fe[_0x321bb2];return _0x9c12ed;};var beaverLogger=require(_0xe19f('0x0'));var express=require(_0xe19f('0x1'));var auth=require(_0xe19f('0x2'));var config=require(_0xe19f('0x3'));var router=express[_0xe19f('0x4')]();var isProduction=config[_0xe19f('0x5')]===_0xe19f('0x6')||![];function clientSideLogs(_0x45e30f,_0x2f0f59,_0x30d1ce){var _0x583ca6=_0x45e30f[_0xe19f('0x7')][_0xe19f('0x8')](_0xe19f('0x9'));if(!_0x583ca6){throw new Error(_0xe19f('0xa'));}return beaverLogger[_0xe19f('0xb')]({'uri':_0xe19f('0xc'),'logger':_0x583ca6,'enableCors':!isProduction})(_0x45e30f,_0x2f0f59,_0x30d1ce);}router[_0xe19f('0xd')](auth[_0xe19f('0xe')](),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 a5fe610..6996eaa 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 _0x49a5=['STRING','Google','MicrosoftAzure','ENUM','Dynamics365','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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x49a5,0x8a));var _0x549a=function(_0x527acd,_0x32b758){_0x527acd=_0x527acd-0x0;var _0x2c990f=_0x49a5[_0x527acd];return _0x2c990f;};'use strict';var Sequelize=require(_0x549a('0x0'));module[_0x549a('0x1')]={'name':{'type':Sequelize[_0x549a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x549a('0x3'),_0x549a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x549a('0x5')]('Outlook365',_0x549a('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x549a('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x549a('0x8')},'data3':{'type':Sequelize[_0x549a('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x549a('0x2')],'comment':_0x549a('0x9')},'data5':{'type':Sequelize[_0x549a('0xa')],'comment':_0x549a('0xb')},'data6':{'type':Sequelize[_0x549a('0xa')],'comment':_0x549a('0xc')},'data7':{'type':Sequelize[_0x549a('0xa')],'comment':_0x549a('0xd')}}; \ No newline at end of file +var _0xa09f=['exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0xb3bbc8,_0x2a3635){var _0x3254b7=function(_0x823e23){while(--_0x823e23){_0xb3bbc8['push'](_0xb3bbc8['shift']());}};_0x3254b7(++_0x2a3635);}(_0xa09f,0x7f));var _0xfa09=function(_0x27a29c,_0x31abe9){_0x27a29c=_0x27a29c-0x0;var _0x30cea4=_0xa09f[_0x27a29c];return _0x30cea4;};'use strict';var Sequelize=require(_0xfa09('0x0'));module[_0xfa09('0x1')]={'name':{'type':Sequelize[_0xfa09('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfa09('0x3')](_0xfa09('0x4'),_0xfa09('0x5'),_0xfa09('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xfa09('0x3')](_0xfa09('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0xfa09('0x2')],'comment':_0xfa09('0x8')},'data2':{'type':Sequelize[_0xfa09('0x2')],'comment':_0xfa09('0x9')},'data3':{'type':Sequelize[_0xfa09('0x2')],'comment':_0xfa09('0xa')},'data4':{'type':Sequelize[_0xfa09('0x2')],'comment':_0xfa09('0xb')},'data5':{'type':Sequelize[_0xfa09('0xc')],'comment':_0xfa09('0xd')},'data6':{'type':Sequelize[_0xfa09('0xc')],'comment':_0xfa09('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':_0xfa09('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 31498f1..d995115 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 _0x4dcc=['oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','ioredis','../../components/encryptor','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','index','CloudProvider','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','MicrosoftAzure','data3','catch','rawAttributes','length','includeAll','options','service','create','body','includes','join','encryptString','find','params'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x4dcc,0xd0));var _0xc4dc=function(_0x2c03ca,_0xad92ca){_0x2c03ca=_0x2c03ca-0x0;var _0xe670b=_0x4dcc[_0x2c03ca];return _0xe670b;};'use strict';var _=require('lodash');var Redis=require(_0xc4dc('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc4dc('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xc4dc('0x2'));config['redis']=_[_0xc4dc('0x3')](config[_0xc4dc('0x4')],{'host':_0xc4dc('0x5'),'port':0x18eb});var socket=require(_0xc4dc('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0xc4dc('0x4')]);function respondWithStatusCode(_0x3067ac,_0x682848){_0x682848=_0x682848||0xcc;return function(_0x1c5810){if(_0x1c5810){return _0x3067ac[_0xc4dc('0x7')](_0x682848);}return _0x3067ac[_0xc4dc('0x8')](_0x682848)[_0xc4dc('0x9')]();};}function respondWithResult(_0x4638b4,_0x5f2e90){_0x5f2e90=_0x5f2e90||0xc8;return function(_0xb7336){if(_0xb7336){return _0x4638b4[_0xc4dc('0x8')](_0x5f2e90)[_0xc4dc('0xa')](_0xb7336);}};}function respondWithFilteredResult(_0x54dbe9,_0x58ae6e){return function(_0x1a76f9){if(_0x1a76f9){var _0x5bf67e=typeof _0x58ae6e[_0xc4dc('0xb')]==='undefined'&&typeof _0x58ae6e[_0xc4dc('0xc')]===_0xc4dc('0xd');var _0x1f7e01=_0x1a76f9['count'];var _0x1c4c83=_0x5bf67e?0x0:_0x58ae6e[_0xc4dc('0xb')];var _0x23e4a8=_0x5bf67e?_0x1a76f9[_0xc4dc('0xe')]:_0x58ae6e[_0xc4dc('0xb')]+_0x58ae6e[_0xc4dc('0xc')];var _0x24acc8;if(_0x23e4a8>=_0x1f7e01){_0x23e4a8=_0x1f7e01;_0x24acc8=0xc8;}else{_0x24acc8=0xce;}_0x54dbe9[_0xc4dc('0x8')](_0x24acc8);return _0x54dbe9[_0xc4dc('0xf')](_0xc4dc('0x10'),_0x1c4c83+'-'+_0x23e4a8+'/'+_0x1f7e01)['json'](_0x1a76f9);}return null;};}function saveUpdates(_0x487d5f){return function(_0xb49b9a){if(_0xb49b9a){return _0xb49b9a[_0xc4dc('0x11')](_0x487d5f)[_0xc4dc('0x12')](function(_0x17f304){return _0x17f304;});}return null;};}function removeEntity(_0x55e653){return function(_0x1754ff){if(_0x1754ff){return _0x1754ff[_0xc4dc('0x13')]()[_0xc4dc('0x12')](function(){_0x55e653[_0xc4dc('0x8')](0xcc)[_0xc4dc('0x9')]();});}};}function handleEntityNotFound(_0x40e2f2){return function(_0x2097e7){if(!_0x2097e7){_0x40e2f2[_0xc4dc('0x7')](0x194);}return _0x2097e7;};}function handleError(_0x48cb5a,_0x31d423){_0x31d423=_0x31d423||0x1f4;return function(_0x47f15d){logger[_0xc4dc('0x14')](_0x47f15d[_0xc4dc('0x15')]);if(_0x47f15d[_0xc4dc('0x16')]){delete _0x47f15d['name'];}_0x48cb5a[_0xc4dc('0x8')](_0x31d423)[_0xc4dc('0x17')](_0x47f15d);};}function maskClientSecret(_0x4a784d){return _[_0xc4dc('0x18')](_0x4a784d[_0xc4dc('0x19')](0x0,0x3),0x14,'*');}exports[_0xc4dc('0x1a')]=function(_0x55d754,_0x546422){var _0x18249f={},_0xa32f6a={},_0xf8c5d2={'count':0x0,'rows':[]};var _0x30107f=_['map'](db[_0xc4dc('0x1b')]['rawAttributes'],function(_0xbbd51e){return{'name':_0xbbd51e['fieldName'],'type':_0xbbd51e[_0xc4dc('0x1c')][_0xc4dc('0x1d')]};});_0xa32f6a[_0xc4dc('0x1e')]=_[_0xc4dc('0x1f')](_0x30107f,_0xc4dc('0x16'));_0xa32f6a['query']=_[_0xc4dc('0x20')](_0x55d754[_0xc4dc('0x21')]);_0xa32f6a[_0xc4dc('0x22')]=_[_0xc4dc('0x23')](_0xa32f6a[_0xc4dc('0x1e')],_0xa32f6a[_0xc4dc('0x21')]);_0x18249f['attributes']=_['intersection'](_0xa32f6a[_0xc4dc('0x1e')],qs[_0xc4dc('0x24')](_0x55d754[_0xc4dc('0x21')]['fields']));_0x18249f['attributes']=_0x18249f[_0xc4dc('0x25')]['length']?_0x18249f[_0xc4dc('0x25')]:_0xa32f6a[_0xc4dc('0x1e')];if(!_0x55d754[_0xc4dc('0x21')][_0xc4dc('0x26')](_0xc4dc('0x27'))){_0x18249f[_0xc4dc('0xc')]=qs[_0xc4dc('0xc')](_0x55d754[_0xc4dc('0x21')][_0xc4dc('0xc')]);_0x18249f[_0xc4dc('0xb')]=qs[_0xc4dc('0xb')](_0x55d754[_0xc4dc('0x21')][_0xc4dc('0xb')]);}_0x18249f[_0xc4dc('0x28')]=qs[_0xc4dc('0x29')](_0x55d754[_0xc4dc('0x21')][_0xc4dc('0x29')]);_0x18249f['where']=qs[_0xc4dc('0x22')](_[_0xc4dc('0x2a')](_0x55d754[_0xc4dc('0x21')],_0xa32f6a['filters']),_0x30107f);if(_0x55d754[_0xc4dc('0x21')][_0xc4dc('0x2b')]){_0x18249f['where']=_[_0xc4dc('0x2c')](_0x18249f[_0xc4dc('0x2d')],{'$or':_['map'](_0x30107f,function(_0x2b33e4){if(_0x2b33e4[_0xc4dc('0x1c')]!==_0xc4dc('0x2e')){var _0x5cc67c={};_0x5cc67c[_0x2b33e4[_0xc4dc('0x16')]]={'$like':'%'+_0x55d754[_0xc4dc('0x21')][_0xc4dc('0x2b')]+'%'};return _0x5cc67c;}})});}_0x18249f=_[_0xc4dc('0x2c')]({},_0x18249f,_0x55d754['options']);var _0x186fff={'where':_0x18249f['where']};return db[_0xc4dc('0x1b')][_0xc4dc('0xe')](_0x186fff)['then'](function(_0x2cfc12){_0xf8c5d2[_0xc4dc('0xe')]=_0x2cfc12;if(_0x55d754['query']['includeAll']){_0x18249f[_0xc4dc('0x2f')]=[{'all':!![]}];}return db[_0xc4dc('0x1b')][_0xc4dc('0x30')](_0x18249f);})['then'](function(_0x4b57bf){_0xf8c5d2[_0xc4dc('0x31')]=_[_0xc4dc('0x1f')](_0x4b57bf,function(_0xca457a){if(_0xca457a['service']===_0xc4dc('0x32')){var _0x55a6e1=encryptor['decryptString'](_0xca457a[_0xc4dc('0x33')]);_0xca457a['data3']=maskClientSecret(_0x55a6e1);}return _0xca457a;});return _0xf8c5d2;})[_0xc4dc('0x12')](respondWithFilteredResult(_0x546422,_0x18249f))[_0xc4dc('0x34')](handleError(_0x546422,null));};exports['show']=function(_0x513b6e,_0x4db78f){var _0x2c0967={'raw':!![],'where':{'id':_0x513b6e['params']['id']}},_0x74ac46={};_0x74ac46[_0xc4dc('0x1e')]=_['keys'](db[_0xc4dc('0x1b')][_0xc4dc('0x35')]);_0x74ac46[_0xc4dc('0x21')]=_[_0xc4dc('0x20')](_0x513b6e[_0xc4dc('0x21')]);_0x74ac46[_0xc4dc('0x22')]=_[_0xc4dc('0x23')](_0x74ac46[_0xc4dc('0x1e')],_0x74ac46['query']);_0x2c0967['attributes']=_[_0xc4dc('0x23')](_0x74ac46[_0xc4dc('0x1e')],qs[_0xc4dc('0x24')](_0x513b6e['query'][_0xc4dc('0x24')]));_0x2c0967['attributes']=_0x2c0967['attributes'][_0xc4dc('0x36')]?_0x2c0967[_0xc4dc('0x25')]:_0x74ac46['model'];if(_0x513b6e[_0xc4dc('0x21')][_0xc4dc('0x37')]){_0x2c0967['include']=[{'all':!![]}];}_0x2c0967=_[_0xc4dc('0x2c')]({},_0x2c0967,_0x513b6e[_0xc4dc('0x38')]);return db[_0xc4dc('0x1b')]['find'](_0x2c0967)[_0xc4dc('0x12')](handleEntityNotFound(_0x4db78f,null))[_0xc4dc('0x12')](function(_0x3e395e){if(_0x3e395e[_0xc4dc('0x39')]===_0xc4dc('0x32')){var _0x242ad1=encryptor['decryptString'](_0x3e395e[_0xc4dc('0x33')]);_0x3e395e['data3']=maskClientSecret(_0x242ad1);}return _0x3e395e;})['then'](respondWithResult(_0x4db78f,null))['catch'](handleError(_0x4db78f,null));};exports[_0xc4dc('0x3a')]=function(_0x3dea8e,_0x2da0b1){if(!_0x3dea8e[_0xc4dc('0x3b')][_0xc4dc('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3dea8e['body'][_0xc4dc('0x39')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3f1ad1=db[_0xc4dc('0x1b')][_0xc4dc('0x35')][_0xc4dc('0x39')]['values'];if(!_0x3f1ad1[_0xc4dc('0x3c')](_0x3dea8e[_0xc4dc('0x3b')][_0xc4dc('0x39')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3f1ad1[_0xc4dc('0x3d')](',\x20'));if(_0x3dea8e['body']['service']===_0xc4dc('0x32')&&_0x3dea8e[_0xc4dc('0x3b')][_0xc4dc('0x33')]){_0x3dea8e['body'][_0xc4dc('0x33')]=encryptor[_0xc4dc('0x3e')](_0x3dea8e[_0xc4dc('0x3b')][_0xc4dc('0x33')]);}return db['CloudProvider'][_0xc4dc('0x3a')](_0x3dea8e[_0xc4dc('0x3b')],{})[_0xc4dc('0x12')](respondWithResult(_0x2da0b1,0xc9))[_0xc4dc('0x34')](handleError(_0x2da0b1,null));};exports[_0xc4dc('0x11')]=function(_0x2630ec,_0x38bce4){if(_0x2630ec[_0xc4dc('0x3b')]['id']){delete _0x2630ec[_0xc4dc('0x3b')]['id'];}return db[_0xc4dc('0x1b')][_0xc4dc('0x3f')]({'where':{'id':_0x2630ec['params']['id']}})['then'](handleEntityNotFound(_0x38bce4,null))[_0xc4dc('0x12')](function(_0xb61df2){if(_0xb61df2[_0xc4dc('0x39')]===_0xc4dc('0x32')&&_0x2630ec[_0xc4dc('0x3b')][_0xc4dc('0x33')]){_0x2630ec['body'][_0xc4dc('0x33')]=encryptor[_0xc4dc('0x3e')](_0x2630ec[_0xc4dc('0x3b')][_0xc4dc('0x33')]);}return _0xb61df2;})[_0xc4dc('0x12')](saveUpdates(_0x2630ec[_0xc4dc('0x3b')],null))['then'](respondWithResult(_0x38bce4,null))[_0xc4dc('0x34')](handleError(_0x38bce4,null));};exports['destroy']=function(_0x9eca5d,_0x422fb9){return db[_0xc4dc('0x1b')][_0xc4dc('0x3f')]({'where':{'id':_0x9eca5d[_0xc4dc('0x40')]['id']}})[_0xc4dc('0x12')](handleEntityNotFound(_0x422fb9,null))[_0xc4dc('0x12')](removeEntity(_0x422fb9,null))[_0xc4dc('0x34')](handleError(_0x422fb9,null));};exports[_0xc4dc('0x41')]=function(_0x21151f,_0x315d2c){return db[_0xc4dc('0x1b')]['findOne']({'where':{'id':_0x21151f[_0xc4dc('0x40')]['id']},'raw':!![]})[_0xc4dc('0x12')](function(_0x3f31f7){if(!_0x3f31f7)return _0x315d2c['sendStatus'](0x194);return{'url':oauth[_0xc4dc('0x42')](_0x3f31f7,_0x21151f[_0xc4dc('0x43')]['id'])};})[_0xc4dc('0x12')](respondWithResult(_0x315d2c,null))[_0xc4dc('0x34')](handleError(_0x315d2c,null));};exports[_0xc4dc('0x44')]=function(_0x5d8863,_0x2151ea){var _0x1e91c0=_0x5d8863[_0xc4dc('0x3b')];var _0x346d0e;var _0x462849;if(_0x1e91c0['error'])throw _0x1e91c0;redis['get'](_0x1e91c0[_0xc4dc('0x45')])[_0xc4dc('0x12')](function(_0x2eb40c){if(!_0x2eb40c)throw new Error(_0xc4dc('0x46'));_0x346d0e=JSON['parse'](_0x2eb40c);var _0x55618e=Buffer[_0xc4dc('0x47')](_0x1e91c0[_0xc4dc('0x45')],_0xc4dc('0x48'))[_0xc4dc('0x49')]('ascii');_0x462849=JSON[_0xc4dc('0x4a')](_0x55618e);if(!oauth[_0xc4dc('0x4b')](_0x1e91c0[_0xc4dc('0x4c')],_0x346d0e[_0xc4dc('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xc4dc('0x4e')](_0x1e91c0[_0xc4dc('0x45')]);return oauth[_0xc4dc('0x4f')](_0x1e91c0['code'],_0x346d0e);})[_0xc4dc('0x12')](function(_0xbb8f23){_0x346d0e['data5']=_0xbb8f23[_0xc4dc('0x50')];_0x346d0e[_0xc4dc('0x51')]=_0xbb8f23[_0xc4dc('0x52')];return db[_0xc4dc('0x1b')]['update']({'data5':_0x346d0e[_0xc4dc('0x53')],'data6':_0x346d0e[_0xc4dc('0x51')]},{'where':{'id':_0x346d0e['id']}});})['then'](function(){oauth[_0xc4dc('0x54')](_0x346d0e);socket[_0xc4dc('0x55')](_0xc4dc('0x56'),{'id':_0x462849['id']});return;})[_0xc4dc('0x12')](respondWithStatusCode(_0x2151ea,null))['catch'](function(_0x2fb68d){if(_0x462849){socket[_0xc4dc('0x55')](_0xc4dc('0x57'),{'id':_0x462849['id']});}if(!_0x346d0e){logger[_0xc4dc('0x14')](_0xc4dc('0x58'),_0x2fb68d);return _0x2151ea[_0xc4dc('0x8')](0x1f4)['send'](_0x2fb68d[_0xc4dc('0x59')]);}logger[_0xc4dc('0x14')](_0xc4dc('0x5a'),_0x346d0e['id'],_0x2fb68d);});}; \ No newline at end of file +var _0xeb11=['getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','json','update','destroy','then','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','decryptString','data3','catch','show','params','find','service','MicrosoftAzure','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del'];(function(_0x222449,_0x2ea79f){var _0xb484f1=function(_0x5457b4){while(--_0x5457b4){_0x222449['push'](_0x222449['shift']());}};_0xb484f1(++_0x2ea79f);}(_0xeb11,0x189));var _0x1eb1=function(_0x3a1dcc,_0x4f81be){_0x3a1dcc=_0x3a1dcc-0x0;var _0xb42443=_0xeb11[_0x3a1dcc];return _0xb42443;};'use strict';var _=require(_0x1eb1('0x0'));var Redis=require('ioredis');var qs=require(_0x1eb1('0x1'));var encryptor=require(_0x1eb1('0x2'));var config=require(_0x1eb1('0x3'));var logger=require(_0x1eb1('0x4'))('api');var db=require(_0x1eb1('0x5'))['db'];var oauth=require(_0x1eb1('0x6'));config[_0x1eb1('0x7')]=_[_0x1eb1('0x8')](config['redis'],{'host':_0x1eb1('0x9'),'port':0x18eb});var socket=require(_0x1eb1('0xa'))(new Redis(config[_0x1eb1('0x7')]));var redis=new Redis(config[_0x1eb1('0x7')]);function respondWithStatusCode(_0x3ec88f,_0x2512b8){_0x2512b8=_0x2512b8||0xcc;return function(_0x18128d){if(_0x18128d){return _0x3ec88f[_0x1eb1('0xb')](_0x2512b8);}return _0x3ec88f[_0x1eb1('0xc')](_0x2512b8)['end']();};}function respondWithResult(_0x5aaaf7,_0x480fc0){_0x480fc0=_0x480fc0||0xc8;return function(_0xd39faa){if(_0xd39faa){return _0x5aaaf7[_0x1eb1('0xc')](_0x480fc0)['json'](_0xd39faa);}};}function respondWithFilteredResult(_0x18520a,_0x146e79){return function(_0x2033bb){if(_0x2033bb){var _0x29869f=typeof _0x146e79[_0x1eb1('0xd')]===_0x1eb1('0xe')&&typeof _0x146e79['limit']===_0x1eb1('0xe');var _0x465b6a=_0x2033bb[_0x1eb1('0xf')];var _0x202616=_0x29869f?0x0:_0x146e79[_0x1eb1('0xd')];var _0x4b4158=_0x29869f?_0x2033bb['count']:_0x146e79[_0x1eb1('0xd')]+_0x146e79[_0x1eb1('0x10')];var _0x5c4a23;if(_0x4b4158>=_0x465b6a){_0x4b4158=_0x465b6a;_0x5c4a23=0xc8;}else{_0x5c4a23=0xce;}_0x18520a[_0x1eb1('0xc')](_0x5c4a23);return _0x18520a[_0x1eb1('0x11')]('Content-Range',_0x202616+'-'+_0x4b4158+'/'+_0x465b6a)[_0x1eb1('0x12')](_0x2033bb);}return null;};}function saveUpdates(_0x405495){return function(_0x55c709){if(_0x55c709){return _0x55c709[_0x1eb1('0x13')](_0x405495)['then'](function(_0x475286){return _0x475286;});}return null;};}function removeEntity(_0x5ea824){return function(_0x107e02){if(_0x107e02){return _0x107e02[_0x1eb1('0x14')]()[_0x1eb1('0x15')](function(){_0x5ea824['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe2bc){return function(_0xe9114f){if(!_0xe9114f){_0x2fe2bc[_0x1eb1('0xb')](0x194);}return _0xe9114f;};}function handleError(_0x455dd3,_0x5c3dcc){_0x5c3dcc=_0x5c3dcc||0x1f4;return function(_0x3e6c08){logger[_0x1eb1('0x16')](_0x3e6c08[_0x1eb1('0x17')]);if(_0x3e6c08[_0x1eb1('0x18')]){delete _0x3e6c08[_0x1eb1('0x18')];}_0x455dd3[_0x1eb1('0xc')](_0x5c3dcc)[_0x1eb1('0x19')](_0x3e6c08);};}function maskClientSecret(_0x499c61){return _[_0x1eb1('0x1a')](_0x499c61[_0x1eb1('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x336fa9,_0x3e2b4c){var _0xa977ce={},_0x324494={},_0x2b8c2e={'count':0x0,'rows':[]};var _0x4c8dec=_[_0x1eb1('0x1c')](db[_0x1eb1('0x1d')][_0x1eb1('0x1e')],function(_0xac29ea){return{'name':_0xac29ea[_0x1eb1('0x1f')],'type':_0xac29ea[_0x1eb1('0x20')]['key']};});_0x324494[_0x1eb1('0x21')]=_[_0x1eb1('0x1c')](_0x4c8dec,_0x1eb1('0x18'));_0x324494['query']=_[_0x1eb1('0x22')](_0x336fa9[_0x1eb1('0x23')]);_0x324494[_0x1eb1('0x24')]=_['intersection'](_0x324494[_0x1eb1('0x21')],_0x324494[_0x1eb1('0x23')]);_0xa977ce[_0x1eb1('0x25')]=_[_0x1eb1('0x26')](_0x324494[_0x1eb1('0x21')],qs[_0x1eb1('0x27')](_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x27')]));_0xa977ce['attributes']=_0xa977ce['attributes'][_0x1eb1('0x28')]?_0xa977ce['attributes']:_0x324494[_0x1eb1('0x21')];if(!_0x336fa9['query'][_0x1eb1('0x29')](_0x1eb1('0x2a'))){_0xa977ce[_0x1eb1('0x10')]=qs[_0x1eb1('0x10')](_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x10')]);_0xa977ce[_0x1eb1('0xd')]=qs[_0x1eb1('0xd')](_0x336fa9[_0x1eb1('0x23')]['offset']);}_0xa977ce[_0x1eb1('0x2b')]=qs[_0x1eb1('0x2c')](_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x2c')]);_0xa977ce[_0x1eb1('0x2d')]=qs[_0x1eb1('0x24')](_['pick'](_0x336fa9[_0x1eb1('0x23')],_0x324494['filters']),_0x4c8dec);if(_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x2e')]){_0xa977ce['where']=_[_0x1eb1('0x2f')](_0xa977ce[_0x1eb1('0x2d')],{'$or':_['map'](_0x4c8dec,function(_0x58cce2){if(_0x58cce2[_0x1eb1('0x20')]!==_0x1eb1('0x30')){var _0x3ac551={};_0x3ac551[_0x58cce2[_0x1eb1('0x18')]]={'$like':'%'+_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x2e')]+'%'};return _0x3ac551;}})});}_0xa977ce=_[_0x1eb1('0x2f')]({},_0xa977ce,_0x336fa9[_0x1eb1('0x31')]);var _0x5b3652={'where':_0xa977ce[_0x1eb1('0x2d')]};return db[_0x1eb1('0x1d')]['count'](_0x5b3652)[_0x1eb1('0x15')](function(_0x4b5591){_0x2b8c2e[_0x1eb1('0xf')]=_0x4b5591;if(_0x336fa9[_0x1eb1('0x23')][_0x1eb1('0x32')]){_0xa977ce[_0x1eb1('0x33')]=[{'all':!![]}];}return db[_0x1eb1('0x1d')][_0x1eb1('0x34')](_0xa977ce);})['then'](function(_0x4ca3aa){_0x2b8c2e[_0x1eb1('0x35')]=_[_0x1eb1('0x1c')](_0x4ca3aa,function(_0x487744){if(_0x487744['service']==='MicrosoftAzure'){var _0x31b969=encryptor[_0x1eb1('0x36')](_0x487744[_0x1eb1('0x37')]);_0x487744['data3']=maskClientSecret(_0x31b969);}return _0x487744;});return _0x2b8c2e;})[_0x1eb1('0x15')](respondWithFilteredResult(_0x3e2b4c,_0xa977ce))[_0x1eb1('0x38')](handleError(_0x3e2b4c,null));};exports[_0x1eb1('0x39')]=function(_0x4ac27a,_0x329430){var _0x246dc9={'raw':!![],'where':{'id':_0x4ac27a[_0x1eb1('0x3a')]['id']}},_0xa67ccf={};_0xa67ccf[_0x1eb1('0x21')]=_[_0x1eb1('0x22')](db[_0x1eb1('0x1d')][_0x1eb1('0x1e')]);_0xa67ccf[_0x1eb1('0x23')]=_[_0x1eb1('0x22')](_0x4ac27a['query']);_0xa67ccf[_0x1eb1('0x24')]=_['intersection'](_0xa67ccf['model'],_0xa67ccf['query']);_0x246dc9[_0x1eb1('0x25')]=_[_0x1eb1('0x26')](_0xa67ccf[_0x1eb1('0x21')],qs['fields'](_0x4ac27a[_0x1eb1('0x23')][_0x1eb1('0x27')]));_0x246dc9[_0x1eb1('0x25')]=_0x246dc9[_0x1eb1('0x25')][_0x1eb1('0x28')]?_0x246dc9[_0x1eb1('0x25')]:_0xa67ccf[_0x1eb1('0x21')];if(_0x4ac27a[_0x1eb1('0x23')]['includeAll']){_0x246dc9[_0x1eb1('0x33')]=[{'all':!![]}];}_0x246dc9=_['merge']({},_0x246dc9,_0x4ac27a['options']);return db[_0x1eb1('0x1d')][_0x1eb1('0x3b')](_0x246dc9)[_0x1eb1('0x15')](handleEntityNotFound(_0x329430,null))[_0x1eb1('0x15')](function(_0x3be1bc){if(_0x3be1bc[_0x1eb1('0x3c')]===_0x1eb1('0x3d')){var _0x2e5b53=encryptor[_0x1eb1('0x36')](_0x3be1bc[_0x1eb1('0x37')]);_0x3be1bc['data3']=maskClientSecret(_0x2e5b53);}return _0x3be1bc;})[_0x1eb1('0x15')](respondWithResult(_0x329430,null))[_0x1eb1('0x38')](handleError(_0x329430,null));};exports['create']=function(_0x3eba4d,_0x41d6ae){if(!_0x3eba4d[_0x1eb1('0x3e')][_0x1eb1('0x18')])throw new Error(_0x1eb1('0x3f'));if(!_0x3eba4d[_0x1eb1('0x3e')][_0x1eb1('0x3c')])throw new Error(_0x1eb1('0x40'));var _0xffc73f=db[_0x1eb1('0x1d')][_0x1eb1('0x1e')][_0x1eb1('0x3c')][_0x1eb1('0x41')];if(!_0xffc73f['includes'](_0x3eba4d[_0x1eb1('0x3e')][_0x1eb1('0x3c')]))throw new Error(_0x1eb1('0x42')+_0xffc73f[_0x1eb1('0x43')](',\x20'));if(_0x3eba4d[_0x1eb1('0x3e')][_0x1eb1('0x3c')]===_0x1eb1('0x3d')&&_0x3eba4d['body'][_0x1eb1('0x37')]){_0x3eba4d['body'][_0x1eb1('0x37')]=encryptor[_0x1eb1('0x44')](_0x3eba4d[_0x1eb1('0x3e')]['data3']);}return db[_0x1eb1('0x1d')][_0x1eb1('0x45')](_0x3eba4d[_0x1eb1('0x3e')],{})[_0x1eb1('0x15')](respondWithResult(_0x41d6ae,0xc9))['catch'](handleError(_0x41d6ae,null));};exports[_0x1eb1('0x13')]=function(_0x45db99,_0x413f73){if(_0x45db99[_0x1eb1('0x3e')]['id']){delete _0x45db99[_0x1eb1('0x3e')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x45db99[_0x1eb1('0x3a')]['id']}})[_0x1eb1('0x15')](handleEntityNotFound(_0x413f73,null))['then'](function(_0x3572a3){if(_0x3572a3[_0x1eb1('0x3c')]===_0x1eb1('0x3d')&&_0x45db99[_0x1eb1('0x3e')][_0x1eb1('0x37')]){_0x45db99[_0x1eb1('0x3e')][_0x1eb1('0x37')]=encryptor['encryptString'](_0x45db99[_0x1eb1('0x3e')][_0x1eb1('0x37')]);}return _0x3572a3;})[_0x1eb1('0x15')](saveUpdates(_0x45db99['body'],null))[_0x1eb1('0x15')](respondWithResult(_0x413f73,null))[_0x1eb1('0x38')](handleError(_0x413f73,null));};exports[_0x1eb1('0x14')]=function(_0x7ad0b5,_0x32f22a){return db[_0x1eb1('0x1d')]['find']({'where':{'id':_0x7ad0b5['params']['id']}})['then'](handleEntityNotFound(_0x32f22a,null))[_0x1eb1('0x15')](removeEntity(_0x32f22a,null))['catch'](handleError(_0x32f22a,null));};exports['oauth2MicrosoftAuthorize']=function(_0x54c188,_0x5d849f){return db['CloudProvider']['findOne']({'where':{'id':_0x54c188[_0x1eb1('0x3a')]['id']},'raw':!![]})[_0x1eb1('0x15')](function(_0x273255){if(!_0x273255)return _0x5d849f['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x273255,_0x54c188[_0x1eb1('0x46')]['id'])};})['then'](respondWithResult(_0x5d849f,null))[_0x1eb1('0x38')](handleError(_0x5d849f,null));};exports[_0x1eb1('0x47')]=function(_0x226565,_0x4e715b){var _0xf5fe30=_0x226565[_0x1eb1('0x3e')];var _0x2df7bb;var _0x1fb31e;if(_0xf5fe30[_0x1eb1('0x16')])throw _0xf5fe30;redis[_0x1eb1('0x48')](_0xf5fe30[_0x1eb1('0x49')])[_0x1eb1('0x15')](function(_0x485e6b){if(!_0x485e6b)throw new Error(_0x1eb1('0x4a'));_0x2df7bb=JSON[_0x1eb1('0x4b')](_0x485e6b);var _0x3f7c98=Buffer[_0x1eb1('0x4c')](_0xf5fe30['state'],'base64')[_0x1eb1('0x4d')]('ascii');_0x1fb31e=JSON[_0x1eb1('0x4b')](_0x3f7c98);if(!oauth[_0x1eb1('0x4e')](_0xf5fe30['id_token'],_0x2df7bb[_0x1eb1('0x4f')]))throw new Error(_0x1eb1('0x50'));redis[_0x1eb1('0x51')](_0xf5fe30['state']);return oauth[_0x1eb1('0x52')](_0xf5fe30[_0x1eb1('0x53')],_0x2df7bb);})['then'](function(_0x5a085e){_0x2df7bb[_0x1eb1('0x54')]=_0x5a085e[_0x1eb1('0x55')];_0x2df7bb[_0x1eb1('0x56')]=_0x5a085e[_0x1eb1('0x57')];return db[_0x1eb1('0x1d')]['update']({'data5':_0x2df7bb[_0x1eb1('0x54')],'data6':_0x2df7bb[_0x1eb1('0x56')]},{'where':{'id':_0x2df7bb['id']}});})[_0x1eb1('0x15')](function(){oauth[_0x1eb1('0x58')](_0x2df7bb);socket[_0x1eb1('0x59')](_0x1eb1('0x5a'),{'id':_0x1fb31e['id']});return;})[_0x1eb1('0x15')](respondWithStatusCode(_0x4e715b,null))[_0x1eb1('0x38')](function(_0x5af028){if(_0x1fb31e){socket[_0x1eb1('0x59')](_0x1eb1('0x5b'),{'id':_0x1fb31e['id']});}if(!_0x2df7bb){logger[_0x1eb1('0x16')](_0x1eb1('0x5c'),_0x5af028);return _0x4e715b[_0x1eb1('0xc')](0x1f4)[_0x1eb1('0x19')](_0x5af028[_0x1eb1('0x5d')]);}logger[_0x1eb1('0x16')](_0x1eb1('0x5e'),_0x2df7bb['id'],_0x5af028);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a41d186..f6e1316 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 _0x8125=['../../config/environment','define','CloudProvider','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b03fb,_0x674bda){var _0x4a853f=function(_0x58d0ab){while(--_0x58d0ab){_0x2b03fb['push'](_0x2b03fb['shift']());}};_0x4a853f(++_0x674bda);}(_0x8125,0xc3));var _0x5812=function(_0x268a1a,_0x4c1c60){_0x268a1a=_0x268a1a-0x0;var _0x184802=_0x8125[_0x268a1a];return _0x184802;};'use strict';var _=require(_0x5812('0x0'));var util=require(_0x5812('0x1'));var logger=require(_0x5812('0x2'))(_0x5812('0x3'));var moment=require(_0x5812('0x4'));var BPromise=require(_0x5812('0x5'));var rp=require(_0x5812('0x6'));var fs=require('fs');var path=require(_0x5812('0x7'));var rimraf=require(_0x5812('0x8'));var config=require(_0x5812('0x9'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x5dc2af,_0xe9fee7){return _0x5dc2af[_0x5812('0xa')](_0x5812('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9b7=['rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','path'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0xb9b7,0x192));var _0x7b9b=function(_0x11557b,_0x582206){_0x11557b=_0x11557b-0x0;var _0x2275d7=_0xb9b7[_0x11557b];return _0x2275d7;};'use strict';var _=require(_0x7b9b('0x0'));var util=require(_0x7b9b('0x1'));var logger=require('../../config/logger')(_0x7b9b('0x2'));var moment=require(_0x7b9b('0x3'));var BPromise=require(_0x7b9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b9b('0x5'));var rimraf=require(_0x7b9b('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b9b('0x7'));module[_0x7b9b('0x8')]=function(_0x1fdd7f,_0x50a74d){return _0x1fdd7f[_0x7b9b('0x9')](_0x7b9b('0xa'),attributes,{'tableName':_0x7b9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index e050d9d..08fb4c4 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 _0x5f2f=['stringify','toString','randomBytes','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','issuer','aud','audience','isAfter','unix','exp','data3','findOne','refresh_token','data6','decryptString','POST','then','data5','update','catch','intervals','CloudProvider','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','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','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d593b,_0x3f675a){_0x1d593b=_0x1d593b-0x0;var _0x5e0082=_0x5f2f[_0x1d593b];return _0x5e0082;};'use strict';var _=require(_0xf5f2('0x0'));var crypto=require(_0xf5f2('0x1'));var jwt=require(_0xf5f2('0x2'));var moment=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var util=require(_0xf5f2('0x6'));var encryptor=require(_0xf5f2('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf5f2('0x8'));var schedule=require(_0xf5f2('0x9'));var db=require(_0xf5f2('0xa'))['db'];config[_0xf5f2('0xb')]=_[_0xf5f2('0xc')](config[_0xf5f2('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf5f2('0xb')]);var MICROSOFT_AUTH_URL=_0xf5f2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf5f2('0xe'),'profile',_0xf5f2('0xf'),_0xf5f2('0x10'),_0xf5f2('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf5f2('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf5f2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xf5f2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b78cd){var _0x336f6b=_[_0xf5f2('0x15')](AZURE_AUTH_SCOPES[_0x4b78cd[_0xf5f2('0x16')]]);if(_0x4b78cd[_0xf5f2('0x16')]===_0xf5f2('0x17'))_0x336f6b[_0xf5f2('0x18')](_0x4b78cd['data7']+_0xf5f2('0x19'));return _0x336f6b[_0xf5f2('0x1a')]('\x20');}function getAccessTokenScope(_0x269909){if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x17'))return _0x269909[_0xf5f2('0x1c')]+_0xf5f2('0x19');}function generateMicrosoftAuthorizationUrl(_0x23e23a,_0x3a9dbb){var _0xdb61b3=MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x23e23a[_0xf5f2('0x1f')]);var _0x20fccd=[_0xf5f2('0x20'),_0xf5f2('0x21')];var _0x3ee69=Buffer[_0xf5f2('0x22')](JSON[_0xf5f2('0x23')]({'id':_0x3a9dbb}))[_0xf5f2('0x24')]('base64');var _0x34706d=crypto[_0xf5f2('0x25')](0x10)['toString']('hex');var _0x2d2805=getAuthorizationScopes(_0x23e23a);var _0x388e6c=[{'key':'client_id','value':_0x23e23a[_0xf5f2('0x26')]},{'key':_0xf5f2('0x27'),'value':encodeURIComponent(_0x20fccd[_0xf5f2('0x1a')]('\x20'))},{'key':_0xf5f2('0x28'),'value':_0x23e23a[_0xf5f2('0x29')]},{'key':'response_mode','value':_0xf5f2('0x2a')},{'key':_0xf5f2('0x2b'),'value':encodeURIComponent(_0x2d2805)},{'key':_0xf5f2('0x2c'),'value':_0x3ee69},{'key':_0xf5f2('0x2d'),'value':_0x34706d},{'key':_0xf5f2('0x2e'),'value':'login'}];var _0x529f07=_0xdb61b3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf5f2('0x15')](_0x388e6c,function(_0x3f79d5){return _0x3f79d5[_0xf5f2('0x2f')]+'='+_0x3f79d5[_0xf5f2('0x30')];})[_0xf5f2('0x1a')]('&');_0x23e23a[_0xf5f2('0x31')]={'issuer':_0xdb61b3[_0xf5f2('0x1d')](_0xf5f2('0x32'),''),'audience':_0x23e23a[_0xf5f2('0x26')],'state':_0x3ee69,'nonce':_0x34706d};redis['set'](_0x3ee69,JSON[_0xf5f2('0x23')](_0x23e23a));return _0x529f07;}function isValidIdToken(_0x102449,_0x375ca8){try{var _0x31bfcb=jwt[_0xf5f2('0x33')](_0x102449,{'complete':!![]});var _0x477604=_0x31bfcb['payload'];if(_0x477604['iss']!==_0x375ca8[_0xf5f2('0x34')])return![];if(_0x477604[_0xf5f2('0x35')]!==_0x375ca8[_0xf5f2('0x36')])return![];if(_0x477604['nonce']!==_0x375ca8['nonce'])return![];if(moment()[_0xf5f2('0x37')](moment[_0xf5f2('0x38')](_0x477604[_0xf5f2('0x39')])))return![];return!![];}catch(_0x153924){throw _0x153924;}}function refreshOauth2MicrosoftAccessToken(_0x1b381e){return Promise['resolve']()['then'](function(){if(_0x1b381e[_0xf5f2('0x3a')])return _0x1b381e;return db['CloudProvider'][_0xf5f2('0x3b')]({'where':{'id':_0x1b381e['id']},'raw':!![]});})['then'](function(_0x45b643){var _0x31087c={'grant_type':_0xf5f2('0x3c'),'refresh_token':_0x45b643[_0xf5f2('0x3d')],'scope':getAccessTokenScope(_0x45b643),'redirect_uri':_0x45b643[_0xf5f2('0x29')],'client_id':_0x45b643[_0xf5f2('0x26')],'client_secret':encryptor[_0xf5f2('0x3e')](_0x45b643[_0xf5f2('0x3a')])};var _0x5ca917={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x45b643[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31087c,'json':!![]};return rp(_0x5ca917);})[_0xf5f2('0x40')](function(_0x27c0e7){_0x1b381e[_0xf5f2('0x41')]=_0x27c0e7['access_token'];_0x1b381e[_0xf5f2('0x3d')]=_0x27c0e7[_0xf5f2('0x3c')];return db['CloudProvider'][_0xf5f2('0x42')]({'data5':_0x1b381e['data5'],'data6':_0x1b381e[_0xf5f2('0x3d')]},{'where':{'id':_0x1b381e['id']}});})[_0xf5f2('0x40')](function(){return _0x1b381e;})[_0xf5f2('0x43')](function(_0x2e3cca){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x1b381e['id'],_0x2e3cca);});}function getOauth2MicrosoftAccessToken(_0x41088b,_0x46ad4a){var _0x20eb74={'grant_type':'authorization_code','code':_0x41088b,'scope':getAccessTokenScope(_0x46ad4a),'redirect_uri':_0x46ad4a[_0xf5f2('0x29')],'client_id':_0x46ad4a['data1'],'client_secret':encryptor[_0xf5f2('0x3e')](_0x46ad4a['data3'])};var _0x46f464={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xf5f2('0x1e'),_0x46ad4a[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x20eb74,'json':!![]};return rp(_0x46f464);}function startRefreshInterval(_0x5a4441){var _0x35f738=schedule['intervals'];if(_0x35f738[_0x5a4441['id']])clearInterval(_0x35f738[_0x5a4441['id']]);_0x35f738[_0x5a4441['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a4441['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf5f2('0x44')]=_0x35f738;}function startAllRefreshIntervals(){return db[_0xf5f2('0x45')][_0xf5f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf5f2('0x40')](function(_0x2c7f65){var _0xe62b57=_0x2c7f65[_0xf5f2('0x15')](function(_0x4c0ac7){return refreshOauth2MicrosoftAccessToken(_0x4c0ac7)[_0xf5f2('0x40')](function(_0x3b4ea6){startRefreshInterval(_0x3b4ea6);});});return Promise['all'](_0xe62b57);})[_0xf5f2('0x43')](function(_0x3f3895){var _0x71b0e7=_0x3f3895?util[_0xf5f2('0x47')](_0x3f3895,{'showHidden':![],'depth':null}):'';logger[_0xf5f2('0x48')](_0xf5f2('0x49'),_0x71b0e7);});}module[_0xf5f2('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x326f=['../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','push','data7','/.default','join','Dynamics365','replace','data2','code','id_token','from','randomBytes','data1','response_type','data4','response_mode','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','stringify','decode','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','intervals','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x326f,0xd1));var _0xf326=function(_0x3ca527,_0x34c0b0){_0x3ca527=_0x3ca527-0x0;var _0x30f565=_0x326f[_0x3ca527];return _0x30f565;};'use strict';var _=require(_0xf326('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var util=require(_0xf326('0x4'));var encryptor=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var logger=require(_0xf326('0x7'))(_0xf326('0x8'));var schedule=require(_0xf326('0x9'));var db=require(_0xf326('0xa'))['db'];config['redis']=_[_0xf326('0xb')](config[_0xf326('0xc')],{'host':_0xf326('0xd'),'port':0x18eb});var redis=new Redis(config[_0xf326('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0xf326('0xe'),_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12')],'Dynamics365':['openid',_0xf326('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xf326('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4aaf3a){var _0x2e4b71=_['map'](AZURE_AUTH_SCOPES[_0x4aaf3a[_0xf326('0x14')]]);if(_0x4aaf3a[_0xf326('0x14')]==='Dynamics365')_0x2e4b71[_0xf326('0x15')](_0x4aaf3a[_0xf326('0x16')]+_0xf326('0x17'));return _0x2e4b71[_0xf326('0x18')]('\x20');}function getAccessTokenScope(_0x5c8483){if(_0x5c8483[_0xf326('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5c8483[_0xf326('0x14')]===_0xf326('0x19'))return _0x5c8483[_0xf326('0x16')]+_0xf326('0x17');}function generateMicrosoftAuthorizationUrl(_0x292f4b,_0x287a2a){var _0x34128e=MICROSOFT_AUTH_URL[_0xf326('0x1a')]('{TENANT_ID}',_0x292f4b[_0xf326('0x1b')]);var _0x453100=[_0xf326('0x1c'),_0xf326('0x1d')];var _0xcef2b5=Buffer[_0xf326('0x1e')](JSON['stringify']({'id':_0x287a2a}))['toString']('base64');var _0x16e605=crypto[_0xf326('0x1f')](0x10)['toString']('hex');var _0x128c68=getAuthorizationScopes(_0x292f4b);var _0x4dfa76=[{'key':'client_id','value':_0x292f4b[_0xf326('0x20')]},{'key':_0xf326('0x21'),'value':encodeURIComponent(_0x453100['join']('\x20'))},{'key':'redirect_uri','value':_0x292f4b[_0xf326('0x22')]},{'key':_0xf326('0x23'),'value':'form_post'},{'key':_0xf326('0x24'),'value':encodeURIComponent(_0x128c68)},{'key':_0xf326('0x25'),'value':_0xcef2b5},{'key':_0xf326('0x26'),'value':_0x16e605},{'key':_0xf326('0x27'),'value':_0xf326('0x28')}];var _0x2049ec=_0x34128e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4dfa76,function(_0x55b9f4){return _0x55b9f4['key']+'='+_0x55b9f4[_0xf326('0x29')];})[_0xf326('0x18')]('&');_0x292f4b[_0xf326('0x2a')]={'issuer':_0x34128e[_0xf326('0x1a')](_0xf326('0x2b'),''),'audience':_0x292f4b[_0xf326('0x20')],'state':_0xcef2b5,'nonce':_0x16e605};redis['set'](_0xcef2b5,JSON[_0xf326('0x2c')](_0x292f4b));return _0x2049ec;}function isValidIdToken(_0xa3c0b,_0x212d5d){try{var _0x581531=jwt[_0xf326('0x2d')](_0xa3c0b,{'complete':!![]});var _0x55ad0f=_0x581531['payload'];if(_0x55ad0f[_0xf326('0x2e')]!==_0x212d5d[_0xf326('0x2f')])return![];if(_0x55ad0f[_0xf326('0x30')]!==_0x212d5d['audience'])return![];if(_0x55ad0f[_0xf326('0x26')]!==_0x212d5d[_0xf326('0x26')])return![];if(moment()['isAfter'](moment[_0xf326('0x31')](_0x55ad0f[_0xf326('0x32')])))return![];return!![];}catch(_0xd77aba){throw _0xd77aba;}}function refreshOauth2MicrosoftAccessToken(_0x18d110){return Promise[_0xf326('0x33')]()[_0xf326('0x34')](function(){if(_0x18d110[_0xf326('0x35')])return _0x18d110;return db[_0xf326('0x36')][_0xf326('0x37')]({'where':{'id':_0x18d110['id']},'raw':!![]});})[_0xf326('0x34')](function(_0x4b52f2){var _0x1035ed={'grant_type':_0xf326('0x38'),'refresh_token':_0x4b52f2[_0xf326('0x39')],'scope':getAccessTokenScope(_0x4b52f2),'redirect_uri':_0x4b52f2['data4'],'client_id':_0x4b52f2[_0xf326('0x20')],'client_secret':encryptor[_0xf326('0x3a')](_0x4b52f2[_0xf326('0x35')])};var _0x4df451={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xf326('0x1a')](_0xf326('0x3b'),_0x4b52f2[_0xf326('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1035ed,'json':!![]};return rp(_0x4df451);})[_0xf326('0x34')](function(_0x30694f){_0x18d110[_0xf326('0x3c')]=_0x30694f[_0xf326('0x3d')];_0x18d110[_0xf326('0x39')]=_0x30694f['refresh_token'];return db[_0xf326('0x36')][_0xf326('0x3e')]({'data5':_0x18d110['data5'],'data6':_0x18d110[_0xf326('0x39')]},{'where':{'id':_0x18d110['id']}});})['then'](function(){return _0x18d110;})[_0xf326('0x3f')](function(_0x481b64){logger['error'](_0xf326('0x40'),_0x18d110['id'],_0x481b64);});}function getOauth2MicrosoftAccessToken(_0x4d8eac,_0x40dcb4){var _0x57aa27={'grant_type':_0xf326('0x41'),'code':_0x4d8eac,'scope':getAccessTokenScope(_0x40dcb4),'redirect_uri':_0x40dcb4[_0xf326('0x22')],'client_id':_0x40dcb4[_0xf326('0x20')],'client_secret':encryptor['decryptString'](_0x40dcb4[_0xf326('0x35')])};var _0x4095e6={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xf326('0x1a')](_0xf326('0x3b'),_0x40dcb4[_0xf326('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57aa27,'json':!![]};return rp(_0x4095e6);}function startRefreshInterval(_0xaf65e0){var _0x51076c=schedule[_0xf326('0x42')];if(_0x51076c[_0xaf65e0['id']])clearInterval(_0x51076c[_0xaf65e0['id']]);_0x51076c[_0xaf65e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf326('0x43')](this,{'id':_0xaf65e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf326('0x42')]=_0x51076c;}function startAllRefreshIntervals(){return db[_0xf326('0x36')][_0xf326('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3e830d){var _0x1b7bf6=_0x3e830d['map'](function(_0x4dd361){return refreshOauth2MicrosoftAccessToken(_0x4dd361)[_0xf326('0x34')](function(_0x577634){startRefreshInterval(_0x577634);});});return Promise['all'](_0x1b7bf6);})[_0xf326('0x3f')](function(_0x5d6ae2){var _0x3e1e8c=_0x5d6ae2?util[_0xf326('0x45')](_0x5d6ae2,{'showHidden':![],'depth':null}):'';logger[_0xf326('0x46')](_0xf326('0x47'),_0x3e1e8c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 0f2730b..82533ec 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 _0x57ef=['CloudProvider,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x2298bd,_0x17dec8){var _0xd156=function(_0x3f8dd0){while(--_0x3f8dd0){_0x2298bd['push'](_0x2298bd['shift']());}};_0xd156(++_0x17dec8);}(_0x57ef,0xdb));var _0xf57e=function(_0x483cde,_0x2e3551){_0x483cde=_0x483cde-0x0;var _0x59ee0f=_0x57ef[_0x483cde];return _0x59ee0f;};'use strict';var _=require('lodash');var util=require(_0xf57e('0x0'));var moment=require(_0xf57e('0x1'));var BPromise=require(_0xf57e('0x2'));var rs=require(_0xf57e('0x3'));var fs=require('fs');var Redis=require(_0xf57e('0x4'));var db=require(_0xf57e('0x5'))['db'];var utils=require(_0xf57e('0x6'));var logger=require('../../config/logger')(_0xf57e('0x7'));var config=require(_0xf57e('0x8'));var jayson=require(_0xf57e('0x9'));var client=jayson[_0xf57e('0xa')][_0xf57e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f47b5,_0x2498c5,_0x29ad0f){return new BPromise(function(_0x48031b,_0x2c69e6){return client[_0xf57e('0xc')](_0x2f47b5,_0x29ad0f)[_0xf57e('0xd')](function(_0x2430b1){logger[_0xf57e('0xe')]('CloudProvider,\x20%s,\x20%s',_0x2498c5,_0xf57e('0xf'));logger[_0xf57e('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x2498c5,_0xf57e('0xf'),JSON[_0xf57e('0x11')](_0x2430b1));if(_0x2430b1[_0xf57e('0x12')]){if(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x13')]===0x1f4){logger[_0xf57e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x2498c5,_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);return _0x2c69e6(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);}logger[_0xf57e('0x12')](_0xf57e('0x15'),_0x2498c5,_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);return _0x48031b(_0x2430b1[_0xf57e('0x12')][_0xf57e('0x14')]);}else{logger[_0xf57e('0xe')](_0xf57e('0x15'),_0x2498c5,_0xf57e('0xf'));_0x48031b(_0x2430b1[_0xf57e('0x16')][_0xf57e('0x14')]);}})[_0xf57e('0x17')](function(_0x464d53){logger[_0xf57e('0x12')](_0xf57e('0x15'),_0x2498c5,_0x464d53);_0x2c69e6(_0x464d53);});});} \ No newline at end of file +var _0x39d0=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x39d0,0x144));var _0x039d=function(_0x527a91,_0x1f06d8){_0x527a91=_0x527a91-0x0;var _0x5320ef=_0x39d0[_0x527a91];return _0x5320ef;};'use strict';var _=require(_0x039d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x039d('0x1'));var rs=require(_0x039d('0x2'));var fs=require('fs');var Redis=require(_0x039d('0x3'));var db=require(_0x039d('0x4'))['db'];var utils=require(_0x039d('0x5'));var logger=require('../../config/logger')(_0x039d('0x6'));var config=require(_0x039d('0x7'));var jayson=require(_0x039d('0x8'));var client=jayson[_0x039d('0x9')][_0x039d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dcc60,_0x2f8c4b,_0x4705e8){return new BPromise(function(_0x425f6e,_0x210090){return client[_0x039d('0xb')](_0x7dcc60,_0x4705e8)['then'](function(_0x591f97){logger[_0x039d('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2f8c4b,_0x039d('0xd'));logger[_0x039d('0xe')](_0x039d('0xf'),_0x2f8c4b,_0x039d('0xd'),JSON['stringify'](_0x591f97));if(_0x591f97[_0x039d('0x10')]){if(_0x591f97[_0x039d('0x10')][_0x039d('0x11')]===0x1f4){logger['error'](_0x039d('0x12'),_0x2f8c4b,_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);return _0x210090(_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);}logger[_0x039d('0x10')](_0x039d('0x12'),_0x2f8c4b,_0x591f97['error']['message']);return _0x425f6e(_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);}else{logger[_0x039d('0xc')](_0x039d('0x12'),_0x2f8c4b,_0x039d('0xd'));_0x425f6e(_0x591f97[_0x039d('0x14')]['message']);}})[_0x039d('0x15')](function(_0x226853){logger[_0x039d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2f8c4b,_0x226853);_0x210090(_0x226853);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 421b1ca..89f3fa5 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x33ba4d,_0x1ba7cd){var _0x4b54d3=function(_0x129462){while(--_0x129462){_0x33ba4d['push'](_0x33ba4d['shift']());}};_0x4b54d3(++_0x1ba7cd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x2c266f,_0x207da2){_0x2c266f=_0x2c266f-0x0;var _0xf68f2d=_0x7a54[_0x2c266f];return _0xf68f2d;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7babcd8..43dcc2b 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 _0x6aea=['exports','STRING','name','sequelize'];(function(_0x37ae15,_0x5e73df){var _0x5bb139=function(_0x1fd29d){while(--_0x1fd29d){_0x37ae15['push'](_0x37ae15['shift']());}};_0x5bb139(++_0x5e73df);}(_0x6aea,0x13b));var _0xa6ae=function(_0x341f97,_0x33895e){_0x341f97=_0x341f97-0x0;var _0x4a0531=_0x6aea[_0x341f97];return _0x4a0531;};'use strict';var Sequelize=require(_0xa6ae('0x0'));module[_0xa6ae('0x1')]={'name':{'type':Sequelize[_0xa6ae('0x2')],'unique':_0xa6ae('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa6ae('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa6ae('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa6ae('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa6ae('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa6ae('0x2')]},'email':{'type':Sequelize[_0xa6ae('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa6ae('0x2')]},'sStreet':{'type':Sequelize[_0xa6ae('0x2')]},'sPostalCode':{'type':Sequelize[_0xa6ae('0x2')]},'sCity':{'type':Sequelize[_0xa6ae('0x2')]},'sCountry':{'type':Sequelize[_0xa6ae('0x2')]},'description':{'type':Sequelize[_0xa6ae('0x2')]}}; \ No newline at end of file +var _0xb016=['name','sequelize','exports','STRING'];(function(_0xdaca08,_0x934f87){var _0x42eb7a=function(_0x502690){while(--_0x502690){_0xdaca08['push'](_0xdaca08['shift']());}};_0x42eb7a(++_0x934f87);}(_0xb016,0x191));var _0x6b01=function(_0x2bf9d9,_0x1809e6){_0x2bf9d9=_0x2bf9d9-0x0;var _0x4c78ad=_0xb016[_0x2bf9d9];return _0x4c78ad;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6b01('0x2')]},'companyId':{'type':Sequelize[_0x6b01('0x2')]},'website':{'type':Sequelize[_0x6b01('0x2')]},'phone':{'type':Sequelize[_0x6b01('0x2')]},'fax':{'type':Sequelize[_0x6b01('0x2')]},'type':{'type':Sequelize[_0x6b01('0x2')]},'street':{'type':Sequelize[_0x6b01('0x2')]},'postalCode':{'type':Sequelize[_0x6b01('0x2')]},'city':{'type':Sequelize[_0x6b01('0x2')]},'country':{'type':Sequelize[_0x6b01('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6b01('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x6b01('0x2')]},'sCity':{'type':Sequelize[_0x6b01('0x2')]},'sCountry':{'type':Sequelize[_0x6b01('0x2')]},'description':{'type':Sequelize[_0x6b01('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 07efc20..b983611 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 _0xf3c3=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','sendStatus','error','stack','send','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','ids','omit','getContacts','findOne','CmContact','length','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','papaparse','ioredis'];(function(_0x1cf88c,_0x577daa){var _0xa3ddca=function(_0x4eef26){while(--_0x4eef26){_0x1cf88c['push'](_0x1cf88c['shift']());}};_0xa3ddca(++_0x577daa);}(_0xf3c3,0x1eb));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f3c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f3c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f3c('0x2'));var Mustache=require(_0x3f3c('0x3'));var util=require(_0x3f3c('0x4'));var path=require(_0x3f3c('0x5'));var sox=require(_0x3f3c('0x6'));var csv=require('to-csv');var ejs=require(_0x3f3c('0x7'));var fs=require('fs');var fs_extra=require(_0x3f3c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f3c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3f3c('0xa'));var querystring=require('querystring');var Papa=require(_0x3f3c('0xb'));var Redis=require(_0x3f3c('0xc'));var authService=require(_0x3f3c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3f3c('0xe'));var hardwareService=require(_0x3f3c('0xf'));var logger=require(_0x3f3c('0x10'))(_0x3f3c('0x11'));var utils=require(_0x3f3c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3f3c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279645,_0x4fefbb){_0x4fefbb=_0x4fefbb||0xcc;return function(_0x6ee469){if(_0x6ee469){return _0x279645['sendStatus'](_0x4fefbb);}return _0x279645[_0x3f3c('0x14')](_0x4fefbb)[_0x3f3c('0x15')]();};}function respondWithResult(_0x1c7585,_0x16f039){_0x16f039=_0x16f039||0xc8;return function(_0x443cc1){if(_0x443cc1){return _0x1c7585[_0x3f3c('0x14')](_0x16f039)[_0x3f3c('0x16')](_0x443cc1);}};}function respondWithFilteredResult(_0x800564,_0x37e85e){return function(_0x507aa3){if(_0x507aa3){var _0x19f53f=typeof _0x37e85e['offset']===_0x3f3c('0x17')&&typeof _0x37e85e[_0x3f3c('0x18')]===_0x3f3c('0x17');var _0x119f5a=_0x507aa3[_0x3f3c('0x19')];var _0x1e48d2=_0x19f53f?0x0:_0x37e85e[_0x3f3c('0x1a')];var _0x49255b=_0x19f53f?_0x507aa3[_0x3f3c('0x19')]:_0x37e85e[_0x3f3c('0x1a')]+_0x37e85e['limit'];var _0x4e1d1f;if(_0x49255b>=_0x119f5a){_0x49255b=_0x119f5a;_0x4e1d1f=0xc8;}else{_0x4e1d1f=0xce;}_0x800564[_0x3f3c('0x14')](_0x4e1d1f);return _0x800564[_0x3f3c('0x1b')](_0x3f3c('0x1c'),_0x1e48d2+'-'+_0x49255b+'/'+_0x119f5a)[_0x3f3c('0x16')](_0x507aa3);}return null;};}function patchUpdates(_0x5b92ea){return function(_0x2ff574){try{jsonpatch[_0x3f3c('0x1d')](_0x2ff574,_0x5b92ea,!![]);}catch(_0x433ab7){return BPromise[_0x3f3c('0x1e')](_0x433ab7);}return _0x2ff574[_0x3f3c('0x1f')]();};}function saveUpdates(_0xd3feeb,_0x3ec66e){return function(_0x356f26){if(_0x356f26){return _0x356f26[_0x3f3c('0x20')](_0xd3feeb)[_0x3f3c('0x21')](function(_0x832f44){return _0x832f44;});}return null;};}function removeEntity(_0x2c1333,_0x317ef2){return function(_0x235613){if(_0x235613){return _0x235613['destroy']()[_0x3f3c('0x21')](function(){var _0x56d35e=_0x235613[_0x3f3c('0x22')]({'plain':!![]});var _0x35fb45=_0x3f3c('0x23');return db[_0x3f3c('0x24')]['destroy']({'where':{'type':_0x35fb45,'resourceId':_0x56d35e['id']}})[_0x3f3c('0x21')](function(){return _0x235613;});})[_0x3f3c('0x21')](function(){_0x2c1333['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41afd9,_0x1e7a45){return function(_0x6fc26b){if(!_0x6fc26b){_0x41afd9[_0x3f3c('0x25')](0x194);}return _0x6fc26b;};}function handleError(_0x2bc30c,_0x3dd554){_0x3dd554=_0x3dd554||0x1f4;return function(_0xe52920){logger[_0x3f3c('0x26')](_0xe52920[_0x3f3c('0x27')]);if(_0xe52920['name']){delete _0xe52920['name'];}_0x2bc30c[_0x3f3c('0x14')](_0x3dd554)[_0x3f3c('0x28')](_0xe52920);};}exports[_0x3f3c('0x29')]=function(_0x1a7c8d,_0x53805a){var _0x3203ca={},_0x546eb9={},_0x13257c={'count':0x0,'rows':[]};return db[_0x3f3c('0x2a')][_0x3f3c('0x2b')]()['then'](function(_0x26e92b){_0x546eb9[_0x3f3c('0x2c')]=_[_0x3f3c('0x2d')](_0x26e92b);_0x546eb9[_0x3f3c('0x2e')]=_['keys'](_0x1a7c8d[_0x3f3c('0x2e')]);_0x546eb9[_0x3f3c('0x2f')]=_[_0x3f3c('0x30')](_0x546eb9[_0x3f3c('0x2c')],_0x546eb9[_0x3f3c('0x2e')]);_0x3203ca['attributes']=_[_0x3f3c('0x30')](_0x546eb9[_0x3f3c('0x2c')],qs['fields'](_0x1a7c8d[_0x3f3c('0x2e')][_0x3f3c('0x31')]));_0x3203ca[_0x3f3c('0x32')]=_0x3203ca[_0x3f3c('0x32')]['length']?_0x3203ca[_0x3f3c('0x32')]:_0x546eb9[_0x3f3c('0x2c')];if(!_0x1a7c8d[_0x3f3c('0x2e')][_0x3f3c('0x33')](_0x3f3c('0x34'))){_0x3203ca[_0x3f3c('0x18')]=qs[_0x3f3c('0x18')](_0x1a7c8d['query'][_0x3f3c('0x18')]);_0x3203ca[_0x3f3c('0x1a')]=qs[_0x3f3c('0x1a')](_0x1a7c8d['query'][_0x3f3c('0x1a')]);}_0x3203ca[_0x3f3c('0x35')]=qs[_0x3f3c('0x36')](_0x1a7c8d[_0x3f3c('0x2e')]['sort']);_0x3203ca[_0x3f3c('0x37')]=qs['filters'](_['pick'](_0x1a7c8d[_0x3f3c('0x2e')],_0x546eb9[_0x3f3c('0x2f')]),_0x26e92b);if(_0x1a7c8d[_0x3f3c('0x2e')][_0x3f3c('0x38')]){_0x3203ca['where']=_[_0x3f3c('0x39')](_0x3203ca['where'],{'$or':_[_0x3f3c('0x3a')](_0x3203ca[_0x3f3c('0x32')],function(_0x3b1204){var _0x5d1bdf={};_0x5d1bdf[_0x3b1204]={'$like':'%'+_0x1a7c8d[_0x3f3c('0x2e')]['filter']+'%'};return _0x5d1bdf;})});}_0x3203ca=_['merge']({},_0x3203ca,_0x1a7c8d[_0x3f3c('0x3b')]);var _0x1d7a7a={'where':_0x3203ca['where']};return db[_0x3f3c('0x2a')][_0x3f3c('0x19')](_0x1d7a7a)[_0x3f3c('0x21')](function(_0x4b5baa){_0x13257c[_0x3f3c('0x19')]=_0x4b5baa;if(_0x1a7c8d[_0x3f3c('0x2e')][_0x3f3c('0x3c')]){_0x3203ca[_0x3f3c('0x3d')]=[{'all':!![]}];}return db[_0x3f3c('0x2a')]['findAll'](_0x3203ca);})['then'](function(_0xde4c5e){_0x13257c[_0x3f3c('0x3e')]=_0xde4c5e;return _0x13257c;})[_0x3f3c('0x21')](respondWithFilteredResult(_0x53805a,_0x3203ca))[_0x3f3c('0x3f')](handleError(_0x53805a,null));})[_0x3f3c('0x3f')](handleError(_0x53805a,null));};exports['show']=function(_0x14e05b,_0x3d249a){var _0x12ffa3={'raw':![],'where':{'id':_0x14e05b[_0x3f3c('0x40')]['id']}},_0x49b25d={};_0x49b25d[_0x3f3c('0x2c')]=_[_0x3f3c('0x2d')](db[_0x3f3c('0x2a')][_0x3f3c('0x41')]);_0x49b25d[_0x3f3c('0x2e')]=_[_0x3f3c('0x2d')](_0x14e05b[_0x3f3c('0x2e')]);_0x49b25d[_0x3f3c('0x2f')]=_[_0x3f3c('0x30')](_0x49b25d[_0x3f3c('0x2c')],_0x49b25d[_0x3f3c('0x2e')]);_0x12ffa3[_0x3f3c('0x32')]=_[_0x3f3c('0x30')](_0x49b25d['model'],qs[_0x3f3c('0x31')](_0x14e05b[_0x3f3c('0x2e')][_0x3f3c('0x31')]));_0x12ffa3[_0x3f3c('0x32')]=_0x12ffa3['attributes']['length']?_0x12ffa3[_0x3f3c('0x32')]:_0x49b25d['model'];if(_0x14e05b[_0x3f3c('0x2e')][_0x3f3c('0x3c')]){_0x12ffa3['include']=[{'all':!![]}];}_0x12ffa3=_['merge']({},_0x12ffa3,_0x14e05b[_0x3f3c('0x3b')]);return db['CmCompany'][_0x3f3c('0x42')](_0x12ffa3)[_0x3f3c('0x21')](handleEntityNotFound(_0x3d249a,null))[_0x3f3c('0x21')](respondWithResult(_0x3d249a,null))['catch'](handleError(_0x3d249a,null));};exports[_0x3f3c('0x43')]=function(_0x19f070,_0x87996f){return db[_0x3f3c('0x2a')][_0x3f3c('0x43')](_0x19f070[_0x3f3c('0x44')],{})[_0x3f3c('0x21')](function(_0x193132){var _0x3734cd=_0x19f070[_0x3f3c('0x45')][_0x3f3c('0x22')]({'plain':!![]});if(!_0x3734cd)throw new Error(_0x3f3c('0x46'));if(_0x3734cd[_0x3f3c('0x47')]===_0x3f3c('0x45')){var _0x5e347a=_0x193132[_0x3f3c('0x22')]({'plain':!![]});var _0x357128=_0x3f3c('0x23');return db[_0x3f3c('0x48')]['find']({'where':{'name':_0x357128,'userProfileId':_0x3734cd[_0x3f3c('0x49')]},'raw':!![]})[_0x3f3c('0x21')](function(_0x40141f){if(_0x40141f&&_0x40141f['autoAssociation']===0x0){return db['UserProfileResource'][_0x3f3c('0x43')]({'name':_0x5e347a[_0x3f3c('0x4a')],'resourceId':_0x5e347a['id'],'type':_0x40141f[_0x3f3c('0x4a')],'sectionId':_0x40141f['id']},{})[_0x3f3c('0x21')](function(){return _0x193132;});}else{return _0x193132;}})[_0x3f3c('0x3f')](function(_0x54f843){logger[_0x3f3c('0x26')](_0x3f3c('0x4b'),_0x54f843);throw _0x54f843;});}return _0x193132;})[_0x3f3c('0x21')](respondWithResult(_0x87996f,0xc9))[_0x3f3c('0x3f')](handleError(_0x87996f,null));};exports[_0x3f3c('0x20')]=function(_0x265dd3,_0x34a055){if(_0x265dd3[_0x3f3c('0x44')]['id']){delete _0x265dd3['body']['id'];}return db[_0x3f3c('0x2a')][_0x3f3c('0x42')]({'where':{'id':_0x265dd3['params']['id']}})[_0x3f3c('0x21')](handleEntityNotFound(_0x34a055,null))[_0x3f3c('0x21')](saveUpdates(_0x265dd3[_0x3f3c('0x44')],null))['then'](respondWithResult(_0x34a055,null))[_0x3f3c('0x3f')](handleError(_0x34a055,null));};exports[_0x3f3c('0x4c')]=function(_0x4f9362,_0x5167b6){return db[_0x3f3c('0x2a')][_0x3f3c('0x42')]({'where':{'id':_0x4f9362[_0x3f3c('0x40')]['id']}})[_0x3f3c('0x21')](handleEntityNotFound(_0x5167b6,null))['then'](removeEntity(_0x5167b6,null))[_0x3f3c('0x3f')](handleError(_0x5167b6,null));};exports[_0x3f3c('0x2b')]=function(_0x522936,_0x2ba9d2){return db[_0x3f3c('0x2a')][_0x3f3c('0x2b')]()[_0x3f3c('0x21')](respondWithResult(_0x2ba9d2,null))[_0x3f3c('0x3f')](handleError(_0x2ba9d2,null));};exports['addContacts']=function(_0x56b61a,_0x372e63,_0x4aae15){return db['CmContact'][_0x3f3c('0x42')]({'where':{'id':_0x56b61a[_0x3f3c('0x40')]['id']}})['then'](handleEntityNotFound(_0x372e63,null))[_0x3f3c('0x21')](function(_0x32b24d){if(_0x32b24d){return _0x32b24d[_0x3f3c('0x4d')](_0x56b61a[_0x3f3c('0x44')][_0x3f3c('0x4e')],_[_0x3f3c('0x4f')](_0x56b61a[_0x3f3c('0x44')],[_0x3f3c('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x372e63,null))[_0x3f3c('0x3f')](handleError(_0x372e63,null));};exports[_0x3f3c('0x50')]=function(_0x53f56c,_0x1355fb,_0x2cceef){var _0x5d6ec9={};var _0x26cc8f={};var _0x502e7b;var _0x48a807;return db[_0x3f3c('0x2a')][_0x3f3c('0x51')]({'where':{'id':_0x53f56c['params']['id']}})[_0x3f3c('0x21')](handleEntityNotFound(_0x1355fb,null))['then'](function(_0xf4a16f){if(_0xf4a16f){_0x502e7b=_0xf4a16f;_0x26cc8f[_0x3f3c('0x2c')]=_[_0x3f3c('0x2d')](db[_0x3f3c('0x52')][_0x3f3c('0x41')]);_0x26cc8f[_0x3f3c('0x2e')]=_['keys'](_0x53f56c['query']);_0x26cc8f['filters']=_[_0x3f3c('0x30')](_0x26cc8f['model'],_0x26cc8f[_0x3f3c('0x2e')]);_0x5d6ec9[_0x3f3c('0x32')]=_['intersection'](_0x26cc8f[_0x3f3c('0x2c')],qs[_0x3f3c('0x31')](_0x53f56c['query'][_0x3f3c('0x31')]));_0x5d6ec9[_0x3f3c('0x32')]=_0x5d6ec9[_0x3f3c('0x32')][_0x3f3c('0x53')]?_0x5d6ec9['attributes']:_0x26cc8f[_0x3f3c('0x2c')];_0x5d6ec9['order']=qs[_0x3f3c('0x36')](_0x53f56c[_0x3f3c('0x2e')]['sort']);_0x5d6ec9['where']=qs[_0x3f3c('0x2f')](_['pick'](_0x53f56c[_0x3f3c('0x2e')],_0x26cc8f[_0x3f3c('0x2f')]));if(_0x53f56c['query'][_0x3f3c('0x38')]){_0x5d6ec9[_0x3f3c('0x37')]=_['merge'](_0x5d6ec9['where'],{'$or':_[_0x3f3c('0x3a')](_0x5d6ec9[_0x3f3c('0x32')],function(_0x6dcde3){var _0x327ada={};_0x327ada[_0x6dcde3]={'$like':'%'+_0x53f56c[_0x3f3c('0x2e')]['filter']+'%'};return _0x327ada;})});}_0x5d6ec9=_['merge']({},_0x5d6ec9,_0x53f56c[_0x3f3c('0x3b')]);return _0x502e7b['getContacts'](_0x5d6ec9);}})[_0x3f3c('0x21')](function(_0x156e24){if(_0x156e24){_0x48a807=_0x156e24[_0x3f3c('0x53')];if(!_0x53f56c[_0x3f3c('0x2e')][_0x3f3c('0x33')](_0x3f3c('0x34'))){_0x5d6ec9[_0x3f3c('0x18')]=qs[_0x3f3c('0x18')](_0x53f56c[_0x3f3c('0x2e')]['limit']);_0x5d6ec9[_0x3f3c('0x1a')]=qs[_0x3f3c('0x1a')](_0x53f56c[_0x3f3c('0x2e')][_0x3f3c('0x1a')]);}return _0x502e7b[_0x3f3c('0x50')](_0x5d6ec9);}})[_0x3f3c('0x21')](function(_0x554cf7){if(_0x554cf7){return _0x554cf7?{'count':_0x48a807,'rows':_0x554cf7}:null;}})[_0x3f3c('0x21')](respondWithResult(_0x1355fb,null))[_0x3f3c('0x3f')](handleError(_0x1355fb,null));}; \ No newline at end of file +var _0x3d15=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','filter','options','include','findAll','catch','show','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','autoAssociation','params','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3d37b3,_0x252695){var _0x4c3538=function(_0xcc187e){while(--_0xcc187e){_0x3d37b3['push'](_0x3d37b3['shift']());}};_0x4c3538(++_0x252695);}(_0x3d15,0xe4));var _0x53d1=function(_0x1a3577,_0x724eca){_0x1a3577=_0x1a3577-0x0;var _0x388e8c=_0x3d15[_0x1a3577];return _0x388e8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53d1('0x0'));var zipdir=require(_0x53d1('0x1'));var jsonpatch=require(_0x53d1('0x2'));var rp=require(_0x53d1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x53d1('0x4'));var util=require(_0x53d1('0x5'));var path=require(_0x53d1('0x6'));var sox=require(_0x53d1('0x7'));var csv=require(_0x53d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53d1('0x9'));var _=require(_0x53d1('0xa'));var squel=require('squel');var crypto=require(_0x53d1('0xb'));var jsforce=require(_0x53d1('0xc'));var deskjs=require(_0x53d1('0xd'));var toCsv=require(_0x53d1('0x8'));var querystring=require('querystring');var Papa=require(_0x53d1('0xe'));var Redis=require(_0x53d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x53d1('0x10'));var as=require(_0x53d1('0x11'));var hardwareService=require(_0x53d1('0x12'));var logger=require(_0x53d1('0x13'))(_0x53d1('0x14'));var utils=require('../../config/utils');var config=require(_0x53d1('0x15'));var licenseUtil=require(_0x53d1('0x16'));var db=require(_0x53d1('0x17'))['db'];function respondWithStatusCode(_0x429bb0,_0xb033c8){_0xb033c8=_0xb033c8||0xcc;return function(_0x3bcbad){if(_0x3bcbad){return _0x429bb0[_0x53d1('0x18')](_0xb033c8);}return _0x429bb0[_0x53d1('0x19')](_0xb033c8)['end']();};}function respondWithResult(_0x1f456d,_0x2e7274){_0x2e7274=_0x2e7274||0xc8;return function(_0x1631c4){if(_0x1631c4){return _0x1f456d['status'](_0x2e7274)[_0x53d1('0x1a')](_0x1631c4);}};}function respondWithFilteredResult(_0xc9fc3d,_0x15a644){return function(_0x40cb56){if(_0x40cb56){var _0x51b54d=typeof _0x15a644[_0x53d1('0x1b')]===_0x53d1('0x1c')&&typeof _0x15a644[_0x53d1('0x1d')]===_0x53d1('0x1c');var _0x277693=_0x40cb56[_0x53d1('0x1e')];var _0x2cba5a=_0x51b54d?0x0:_0x15a644[_0x53d1('0x1b')];var _0x1f2340=_0x51b54d?_0x40cb56[_0x53d1('0x1e')]:_0x15a644[_0x53d1('0x1b')]+_0x15a644[_0x53d1('0x1d')];var _0x4e0c05;if(_0x1f2340>=_0x277693){_0x1f2340=_0x277693;_0x4e0c05=0xc8;}else{_0x4e0c05=0xce;}_0xc9fc3d[_0x53d1('0x19')](_0x4e0c05);return _0xc9fc3d['set'](_0x53d1('0x1f'),_0x2cba5a+'-'+_0x1f2340+'/'+_0x277693)[_0x53d1('0x1a')](_0x40cb56);}return null;};}function patchUpdates(_0x5453fd){return function(_0x42164f){try{jsonpatch[_0x53d1('0x20')](_0x42164f,_0x5453fd,!![]);}catch(_0xb05bb7){return BPromise[_0x53d1('0x21')](_0xb05bb7);}return _0x42164f['save']();};}function saveUpdates(_0x899d3f,_0xdabd8f){return function(_0x559e04){if(_0x559e04){return _0x559e04['update'](_0x899d3f)[_0x53d1('0x22')](function(_0x1b19fb){return _0x1b19fb;});}return null;};}function removeEntity(_0xba17ee,_0xfe5626){return function(_0x3e2daf){if(_0x3e2daf){return _0x3e2daf[_0x53d1('0x23')]()['then'](function(){var _0x1865b8=_0x3e2daf[_0x53d1('0x24')]({'plain':!![]});var _0x486c09='Companies';return db[_0x53d1('0x25')][_0x53d1('0x23')]({'where':{'type':_0x486c09,'resourceId':_0x1865b8['id']}})[_0x53d1('0x22')](function(){return _0x3e2daf;});})[_0x53d1('0x22')](function(){_0xba17ee[_0x53d1('0x19')](0xcc)[_0x53d1('0x26')]();});}};}function handleEntityNotFound(_0x5a11f1,_0x3beb66){return function(_0x277d65){if(!_0x277d65){_0x5a11f1[_0x53d1('0x18')](0x194);}return _0x277d65;};}function handleError(_0xfecbfa,_0x16ced6){_0x16ced6=_0x16ced6||0x1f4;return function(_0x13c019){logger[_0x53d1('0x27')](_0x13c019[_0x53d1('0x28')]);if(_0x13c019[_0x53d1('0x29')]){delete _0x13c019[_0x53d1('0x29')];}_0xfecbfa[_0x53d1('0x19')](_0x16ced6)['send'](_0x13c019);};}exports[_0x53d1('0x2a')]=function(_0x2bf495,_0x261ed8){var _0x1b1767={},_0x416fe3={},_0x4667df={'count':0x0,'rows':[]};return db[_0x53d1('0x2b')][_0x53d1('0x2c')]()[_0x53d1('0x22')](function(_0x53287e){_0x416fe3[_0x53d1('0x2d')]=_['keys'](_0x53287e);_0x416fe3[_0x53d1('0x2e')]=_['keys'](_0x2bf495['query']);_0x416fe3[_0x53d1('0x2f')]=_[_0x53d1('0x30')](_0x416fe3[_0x53d1('0x2d')],_0x416fe3[_0x53d1('0x2e')]);_0x1b1767[_0x53d1('0x31')]=_['intersection'](_0x416fe3[_0x53d1('0x2d')],qs['fields'](_0x2bf495[_0x53d1('0x2e')][_0x53d1('0x32')]));_0x1b1767['attributes']=_0x1b1767[_0x53d1('0x31')][_0x53d1('0x33')]?_0x1b1767[_0x53d1('0x31')]:_0x416fe3[_0x53d1('0x2d')];if(!_0x2bf495[_0x53d1('0x2e')][_0x53d1('0x34')]('nolimit')){_0x1b1767[_0x53d1('0x1d')]=qs[_0x53d1('0x1d')](_0x2bf495[_0x53d1('0x2e')][_0x53d1('0x1d')]);_0x1b1767[_0x53d1('0x1b')]=qs[_0x53d1('0x1b')](_0x2bf495[_0x53d1('0x2e')]['offset']);}_0x1b1767[_0x53d1('0x35')]=qs[_0x53d1('0x36')](_0x2bf495[_0x53d1('0x2e')]['sort']);_0x1b1767[_0x53d1('0x37')]=qs[_0x53d1('0x2f')](_['pick'](_0x2bf495['query'],_0x416fe3['filters']),_0x53287e);if(_0x2bf495['query']['filter']){_0x1b1767[_0x53d1('0x37')]=_[_0x53d1('0x38')](_0x1b1767[_0x53d1('0x37')],{'$or':_[_0x53d1('0x39')](_0x1b1767[_0x53d1('0x31')],function(_0x93bc56){var _0x4693c4={};_0x4693c4[_0x93bc56]={'$like':'%'+_0x2bf495[_0x53d1('0x2e')][_0x53d1('0x3a')]+'%'};return _0x4693c4;})});}_0x1b1767=_[_0x53d1('0x38')]({},_0x1b1767,_0x2bf495[_0x53d1('0x3b')]);var _0x1eff10={'where':_0x1b1767['where']};return db[_0x53d1('0x2b')]['count'](_0x1eff10)['then'](function(_0xc480ba){_0x4667df[_0x53d1('0x1e')]=_0xc480ba;if(_0x2bf495[_0x53d1('0x2e')]['includeAll']){_0x1b1767[_0x53d1('0x3c')]=[{'all':!![]}];}return db[_0x53d1('0x2b')][_0x53d1('0x3d')](_0x1b1767);})['then'](function(_0x171b9a){_0x4667df['rows']=_0x171b9a;return _0x4667df;})[_0x53d1('0x22')](respondWithFilteredResult(_0x261ed8,_0x1b1767))[_0x53d1('0x3e')](handleError(_0x261ed8,null));})[_0x53d1('0x3e')](handleError(_0x261ed8,null));};exports[_0x53d1('0x3f')]=function(_0x38d67e,_0x2394d4){var _0x1b0306={'raw':![],'where':{'id':_0x38d67e['params']['id']}},_0x39edb5={};_0x39edb5[_0x53d1('0x2d')]=_[_0x53d1('0x40')](db['CmCompany']['rawAttributes']);_0x39edb5[_0x53d1('0x2e')]=_['keys'](_0x38d67e['query']);_0x39edb5[_0x53d1('0x2f')]=_[_0x53d1('0x30')](_0x39edb5['model'],_0x39edb5[_0x53d1('0x2e')]);_0x1b0306['attributes']=_[_0x53d1('0x30')](_0x39edb5[_0x53d1('0x2d')],qs['fields'](_0x38d67e[_0x53d1('0x2e')][_0x53d1('0x32')]));_0x1b0306[_0x53d1('0x31')]=_0x1b0306[_0x53d1('0x31')][_0x53d1('0x33')]?_0x1b0306['attributes']:_0x39edb5[_0x53d1('0x2d')];if(_0x38d67e[_0x53d1('0x2e')][_0x53d1('0x41')]){_0x1b0306[_0x53d1('0x3c')]=[{'all':!![]}];}_0x1b0306=_[_0x53d1('0x38')]({},_0x1b0306,_0x38d67e[_0x53d1('0x3b')]);return db[_0x53d1('0x2b')][_0x53d1('0x42')](_0x1b0306)['then'](handleEntityNotFound(_0x2394d4,null))[_0x53d1('0x22')](respondWithResult(_0x2394d4,null))['catch'](handleError(_0x2394d4,null));};exports['create']=function(_0x4a0828,_0x1cba44){return db['CmCompany'][_0x53d1('0x43')](_0x4a0828[_0x53d1('0x44')],{})['then'](function(_0xa2848d){var _0x5e2b56=_0x4a0828['user'][_0x53d1('0x24')]({'plain':!![]});if(!_0x5e2b56)throw new Error(_0x53d1('0x45'));if(_0x5e2b56[_0x53d1('0x46')]===_0x53d1('0x47')){var _0x3b2344=_0xa2848d[_0x53d1('0x24')]({'plain':!![]});var _0x430713=_0x53d1('0x48');return db[_0x53d1('0x49')][_0x53d1('0x42')]({'where':{'name':_0x430713,'userProfileId':_0x5e2b56['userProfileId']},'raw':!![]})[_0x53d1('0x22')](function(_0x5c6343){if(_0x5c6343&&_0x5c6343[_0x53d1('0x4a')]===0x0){return db[_0x53d1('0x25')][_0x53d1('0x43')]({'name':_0x3b2344['name'],'resourceId':_0x3b2344['id'],'type':_0x5c6343[_0x53d1('0x29')],'sectionId':_0x5c6343['id']},{})[_0x53d1('0x22')](function(){return _0xa2848d;});}else{return _0xa2848d;}})[_0x53d1('0x3e')](function(_0x11f496){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11f496);throw _0x11f496;});}return _0xa2848d;})[_0x53d1('0x22')](respondWithResult(_0x1cba44,0xc9))[_0x53d1('0x3e')](handleError(_0x1cba44,null));};exports['update']=function(_0x4991e8,_0x1f4515){if(_0x4991e8['body']['id']){delete _0x4991e8[_0x53d1('0x44')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x4991e8[_0x53d1('0x4b')]['id']}})[_0x53d1('0x22')](handleEntityNotFound(_0x1f4515,null))[_0x53d1('0x22')](saveUpdates(_0x4991e8[_0x53d1('0x44')],null))[_0x53d1('0x22')](respondWithResult(_0x1f4515,null))[_0x53d1('0x3e')](handleError(_0x1f4515,null));};exports[_0x53d1('0x23')]=function(_0x46efed,_0x577dca){return db[_0x53d1('0x2b')][_0x53d1('0x42')]({'where':{'id':_0x46efed['params']['id']}})['then'](handleEntityNotFound(_0x577dca,null))[_0x53d1('0x22')](removeEntity(_0x577dca,null))[_0x53d1('0x3e')](handleError(_0x577dca,null));};exports[_0x53d1('0x2c')]=function(_0x50b030,_0x3b0b62){return db[_0x53d1('0x2b')][_0x53d1('0x2c')]()[_0x53d1('0x22')](respondWithResult(_0x3b0b62,null))[_0x53d1('0x3e')](handleError(_0x3b0b62,null));};exports[_0x53d1('0x4c')]=function(_0x330963,_0x392b56,_0x52935f){return db[_0x53d1('0x4d')]['find']({'where':{'id':_0x330963[_0x53d1('0x4b')]['id']}})[_0x53d1('0x22')](handleEntityNotFound(_0x392b56,null))[_0x53d1('0x22')](function(_0x177c42){if(_0x177c42){return _0x177c42[_0x53d1('0x4c')](_0x330963[_0x53d1('0x44')][_0x53d1('0x4e')],_[_0x53d1('0x4f')](_0x330963[_0x53d1('0x44')],[_0x53d1('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x392b56,null))[_0x53d1('0x3e')](handleError(_0x392b56,null));};exports[_0x53d1('0x50')]=function(_0x2c4737,_0x52ba9f,_0x50625d){var _0x59192b={};var _0x37a493={};var _0x325406;var _0x24a5b9;return db[_0x53d1('0x2b')][_0x53d1('0x51')]({'where':{'id':_0x2c4737[_0x53d1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x52ba9f,null))[_0x53d1('0x22')](function(_0x533b40){if(_0x533b40){_0x325406=_0x533b40;_0x37a493[_0x53d1('0x2d')]=_['keys'](db[_0x53d1('0x4d')]['rawAttributes']);_0x37a493[_0x53d1('0x2e')]=_[_0x53d1('0x40')](_0x2c4737[_0x53d1('0x2e')]);_0x37a493[_0x53d1('0x2f')]=_['intersection'](_0x37a493[_0x53d1('0x2d')],_0x37a493[_0x53d1('0x2e')]);_0x59192b['attributes']=_[_0x53d1('0x30')](_0x37a493[_0x53d1('0x2d')],qs['fields'](_0x2c4737[_0x53d1('0x2e')][_0x53d1('0x32')]));_0x59192b[_0x53d1('0x31')]=_0x59192b[_0x53d1('0x31')][_0x53d1('0x33')]?_0x59192b[_0x53d1('0x31')]:_0x37a493[_0x53d1('0x2d')];_0x59192b[_0x53d1('0x35')]=qs['sort'](_0x2c4737[_0x53d1('0x2e')][_0x53d1('0x36')]);_0x59192b[_0x53d1('0x37')]=qs[_0x53d1('0x2f')](_['pick'](_0x2c4737[_0x53d1('0x2e')],_0x37a493['filters']));if(_0x2c4737[_0x53d1('0x2e')]['filter']){_0x59192b[_0x53d1('0x37')]=_[_0x53d1('0x38')](_0x59192b[_0x53d1('0x37')],{'$or':_[_0x53d1('0x39')](_0x59192b[_0x53d1('0x31')],function(_0x48a400){var _0x4f43ee={};_0x4f43ee[_0x48a400]={'$like':'%'+_0x2c4737['query']['filter']+'%'};return _0x4f43ee;})});}_0x59192b=_[_0x53d1('0x38')]({},_0x59192b,_0x2c4737[_0x53d1('0x3b')]);return _0x325406[_0x53d1('0x50')](_0x59192b);}})[_0x53d1('0x22')](function(_0x12372b){if(_0x12372b){_0x24a5b9=_0x12372b['length'];if(!_0x2c4737[_0x53d1('0x2e')][_0x53d1('0x34')](_0x53d1('0x52'))){_0x59192b[_0x53d1('0x1d')]=qs[_0x53d1('0x1d')](_0x2c4737[_0x53d1('0x2e')][_0x53d1('0x1d')]);_0x59192b['offset']=qs[_0x53d1('0x1b')](_0x2c4737[_0x53d1('0x2e')][_0x53d1('0x1b')]);}return _0x325406[_0x53d1('0x50')](_0x59192b);}})[_0x53d1('0x22')](function(_0x232cb3){if(_0x232cb3){return _0x232cb3?{'count':_0x24a5b9,'rows':_0x232cb3}:null;}})['then'](respondWithResult(_0x52ba9f,null))[_0x53d1('0x3e')](handleError(_0x52ba9f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3506e5f..c9e9e10 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 _0x59f7=['moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','util','../../config/logger'];(function(_0x20d1c,_0x2a61e9){var _0x492f13=function(_0x47fafc){while(--_0x47fafc){_0x20d1c['push'](_0x20d1c['shift']());}};_0x492f13(++_0x2a61e9);}(_0x59f7,0xd6));var _0x759f=function(_0x28e070,_0xbe9a15){_0x28e070=_0x28e070-0x0;var _0x4d47e3=_0x59f7[_0x28e070];return _0x4d47e3;};'use strict';var _=require('lodash');var util=require(_0x759f('0x0'));var logger=require(_0x759f('0x1'))('api');var moment=require(_0x759f('0x2'));var BPromise=require('bluebird');var rp=require(_0x759f('0x3'));var fs=require('fs');var path=require(_0x759f('0x4'));var rimraf=require(_0x759f('0x5'));var config=require('../../config/environment');var attributes=require(_0x759f('0x6'));module[_0x759f('0x7')]=function(_0x42b00a,_0x542482){return _0x42b00a[_0x759f('0x8')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x113d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x38ffe4,_0x26d6d3){var _0x5e88f7=function(_0x25fff7){while(--_0x25fff7){_0x38ffe4['push'](_0x38ffe4['shift']());}};_0x5e88f7(++_0x26d6d3);}(_0x113d,0x80));var _0xd113=function(_0x57c551,_0x556c5d){_0x57c551=_0x57c551-0x0;var _0x484a2c=_0x113d[_0x57c551];return _0x484a2c;};'use strict';var _=require(_0xd113('0x0'));var util=require(_0xd113('0x1'));var logger=require(_0xd113('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd113('0x3'));var rp=require(_0xd113('0x4'));var fs=require('fs');var path=require(_0xd113('0x5'));var rimraf=require(_0xd113('0x6'));var config=require(_0xd113('0x7'));var attributes=require(_0xd113('0x8'));module[_0xd113('0x9')]=function(_0x58ff82,_0x3ab772){return _0x58ff82[_0xd113('0xa')](_0xd113('0xb'),attributes,{'tableName':_0xd113('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 25ec4b2..73ba3b6 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 _0x12bb=['../../config/utils','rpc','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4de1c3,_0xbe77b9){var _0x26acfe=function(_0x2c9df4){while(--_0x2c9df4){_0x4de1c3['push'](_0x4de1c3['shift']());}};_0x26acfe(++_0xbe77b9);}(_0x12bb,0x86));var _0xb12b=function(_0x33335d,_0x5201d2){_0x33335d=_0x33335d-0x0;var _0x41f942=_0x12bb[_0x33335d];return _0x41f942;};'use strict';var _=require(_0xb12b('0x0'));var util=require(_0xb12b('0x1'));var moment=require(_0xb12b('0x2'));var BPromise=require(_0xb12b('0x3'));var rs=require(_0xb12b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb12b('0x5'))['db'];var utils=require(_0xb12b('0x6'));var logger=require('../../config/logger')(_0xb12b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb12b('0x8'));var client=jayson['client'][_0xb12b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x554233,_0x1db7b5,_0x19b9fb){return new BPromise(function(_0x306fbe,_0x3efdea){return client[_0xb12b('0xa')](_0x554233,_0x19b9fb)[_0xb12b('0xb')](function(_0xd42518){logger['info']('CmCompany,\x20%s,\x20%s',_0x1db7b5,'request\x20sent');logger['debug'](_0xb12b('0xc'),_0x1db7b5,'request\x20sent',JSON[_0xb12b('0xd')](_0xd42518));if(_0xd42518[_0xb12b('0xe')]){if(_0xd42518[_0xb12b('0xe')][_0xb12b('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x1db7b5,_0xd42518[_0xb12b('0xe')]['message']);return _0x3efdea(_0xd42518['error'][_0xb12b('0x10')]);}logger[_0xb12b('0xe')]('CmCompany,\x20%s,\x20%s',_0x1db7b5,_0xd42518[_0xb12b('0xe')][_0xb12b('0x10')]);return _0x306fbe(_0xd42518[_0xb12b('0xe')][_0xb12b('0x10')]);}else{logger[_0xb12b('0x11')]('CmCompany,\x20%s,\x20%s',_0x1db7b5,_0xb12b('0x12'));_0x306fbe(_0xd42518[_0xb12b('0x13')][_0xb12b('0x10')]);}})['catch'](function(_0x5c9a77){logger['error']('CmCompany,\x20%s,\x20%s',_0x1db7b5,_0x5c9a77);_0x3efdea(_0x5c9a77);});});} \ No newline at end of file +var _0xfa19=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xfa19,0xec));var _0x9fa1=function(_0x2cd4ee,_0x40f6dc){_0x2cd4ee=_0x2cd4ee-0x0;var _0x123967=_0xfa19[_0x2cd4ee];return _0x123967;};'use strict';var _=require(_0x9fa1('0x0'));var util=require('util');var moment=require(_0x9fa1('0x1'));var BPromise=require(_0x9fa1('0x2'));var rs=require(_0x9fa1('0x3'));var fs=require('fs');var Redis=require(_0x9fa1('0x4'));var db=require(_0x9fa1('0x5'))['db'];var utils=require(_0x9fa1('0x6'));var logger=require(_0x9fa1('0x7'))(_0x9fa1('0x8'));var config=require(_0x9fa1('0x9'));var jayson=require(_0x9fa1('0xa'));var client=jayson[_0x9fa1('0xb')][_0x9fa1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb579c,_0x387727,_0x4c592a){return new BPromise(function(_0x5cc368,_0x30a89f){return client[_0x9fa1('0xd')](_0xb579c,_0x4c592a)['then'](function(_0xfd78d4){logger['info'](_0x9fa1('0xe'),_0x387727,_0x9fa1('0xf'));logger[_0x9fa1('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x387727,'request\x20sent',JSON['stringify'](_0xfd78d4));if(_0xfd78d4[_0x9fa1('0x11')]){if(_0xfd78d4[_0x9fa1('0x11')][_0x9fa1('0x12')]===0x1f4){logger[_0x9fa1('0x11')](_0x9fa1('0xe'),_0x387727,_0xfd78d4['error'][_0x9fa1('0x13')]);return _0x30a89f(_0xfd78d4[_0x9fa1('0x11')][_0x9fa1('0x13')]);}logger[_0x9fa1('0x11')](_0x9fa1('0xe'),_0x387727,_0xfd78d4[_0x9fa1('0x11')]['message']);return _0x5cc368(_0xfd78d4[_0x9fa1('0x11')][_0x9fa1('0x13')]);}else{logger[_0x9fa1('0x14')]('CmCompany,\x20%s,\x20%s',_0x387727,_0x9fa1('0xf'));_0x5cc368(_0xfd78d4[_0x9fa1('0x15')]['message']);}})['catch'](function(_0xa5fb2c){logger[_0x9fa1('0x11')](_0x9fa1('0xe'),_0x387727,_0xa5fb2c);_0x30a89f(_0xa5fb2c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index efc6a29..04119fb 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 _0xd60f=['/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','getContacts','post','create','/:id/contacts','put'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xd60f,0x1d3));var _0xfd60=function(_0x56147f,_0xc4a581){_0x56147f=_0x56147f-0x0;var _0x12dec0=_0xd60f[_0x56147f];return _0x12dec0;};'use strict';var multer=require(_0xfd60('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd60('0x1'));var express=require('express');var router=express[_0xfd60('0x2')]();var fs_extra=require(_0xfd60('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd60('0x4'));var config=require('../../config/environment');var controller=require(_0xfd60('0x5'));router[_0xfd60('0x6')]('/',auth[_0xfd60('0x7')](),controller[_0xfd60('0x8')]);router[_0xfd60('0x6')](_0xfd60('0x9'),auth[_0xfd60('0x7')](),controller[_0xfd60('0xa')]);router[_0xfd60('0x6')]('/:id',auth[_0xfd60('0x7')](),controller[_0xfd60('0xb')]);router[_0xfd60('0x6')]('/:id/contacts',auth[_0xfd60('0x7')](),controller[_0xfd60('0xc')]);router[_0xfd60('0xd')]('/',auth['isAuthenticated'](),controller[_0xfd60('0xe')]);router[_0xfd60('0xd')](_0xfd60('0xf'),auth[_0xfd60('0x7')](),controller['addContacts']);router[_0xfd60('0x10')](_0xfd60('0x11'),auth[_0xfd60('0x7')](),controller[_0xfd60('0x12')]);router[_0xfd60('0x13')](_0xfd60('0x11'),auth[_0xfd60('0x7')](),controller[_0xfd60('0x14')]);module[_0xfd60('0x15')]=router; \ No newline at end of file +var _0x0cfe=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','exports','multer','express','Router'];(function(_0x1e74a2,_0x163bc5){var _0x2e09e5=function(_0x149a0d){while(--_0x149a0d){_0x1e74a2['push'](_0x1e74a2['shift']());}};_0x2e09e5(++_0x163bc5);}(_0x0cfe,0xb5));var _0xe0cf=function(_0xd81536,_0x33c2b6){_0xd81536=_0xd81536-0x0;var _0x4f1460=_0x0cfe[_0xd81536];return _0x4f1460;};'use strict';var multer=require(_0xe0cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0cf('0x1'));var router=express[_0xe0cf('0x2')]();var fs_extra=require(_0xe0cf('0x3'));var auth=require(_0xe0cf('0x4'));var interaction=require(_0xe0cf('0x5'));var config=require(_0xe0cf('0x6'));var controller=require(_0xe0cf('0x7'));router['get']('/',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x9')]);router[_0xe0cf('0xa')](_0xe0cf('0xb'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xc')]);router[_0xe0cf('0xa')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0xe')]);router[_0xe0cf('0xa')](_0xe0cf('0xf'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x10')]);router[_0xe0cf('0x11')]('/',auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x12')]);router['post'](_0xe0cf('0xf'),auth[_0xe0cf('0x8')](),controller[_0xe0cf('0x13')]);router[_0xe0cf('0x14')]('/:id',auth[_0xe0cf('0x8')](),controller['update']);router[_0xe0cf('0x15')](_0xe0cf('0xd'),auth[_0xe0cf('0x8')](),controller['destroy']);module[_0xe0cf('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 02c5ed6..93e9a79 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 _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x2032,0xd9));var _0x2203=function(_0x35b07b,_0x5d38e5){_0x35b07b=_0x35b07b-0x0;var _0xbdb7c7=_0x2032[_0x35b07b];return _0xbdb7c7;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}}; \ No newline at end of file +var _0x5f2f=['INTEGER','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x46dac6,_0x243fd4){var _0x7ccea2=function(_0x3d53b8){while(--_0x3d53b8){_0x46dac6['push'](_0x46dac6['shift']());}};_0x7ccea2(++_0x243fd4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x185d41,_0x580b0e){_0x185d41=_0x185d41-0x0;var _0x59b958=_0x5f2f[_0x185d41];return _0x59b958;};'use strict';var _=require(_0xf5f2('0x0'));var Sequelize=require(_0xf5f2('0x1'));module[_0xf5f2('0x2')]={'firstName':{'type':Sequelize[_0xf5f2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf5f2('0x3')]},'street':{'type':Sequelize[_0xf5f2('0x3')]},'postalCode':{'type':Sequelize[_0xf5f2('0x3')]},'city':{'type':Sequelize[_0xf5f2('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5f2('0x4')]},'phone':{'type':Sequelize[_0xf5f2('0x3')]},'mobile':{'type':Sequelize[_0xf5f2('0x3')]},'fax':{'type':Sequelize[_0xf5f2('0x3')]},'email':{'type':Sequelize[_0xf5f2('0x3')]},'url':{'type':Sequelize[_0xf5f2('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xf5f2('0x3')]},'twitter':{'type':Sequelize[_0xf5f2('0x3')]},'skype':{'type':Sequelize[_0xf5f2('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xf5f2('0x3')]},'line':{'type':Sequelize[_0xf5f2('0x3')]},'wechat':{'type':Sequelize[_0xf5f2('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf5f2('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':Sequelize[_0xf5f2('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 31a5c28..c9ca0e4 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 _0x409d=['bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','get','$and','omit','format','cf_%d','pickBy','table','phone','CmHopper','rawAttributes','getTags','nolimit','setTags','ids','options','includeAll','getHopperHistories','ContactId','include','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','binding','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','starttime','duration','userDisposition','userThirdDisposition','UserId','fullname','createdAt','findAndCountAll','startCase','chat','Website','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','osName','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','sortBy','reverse','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/environment/shared','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','then','keys','length','startsWith','cf_','CmCustomField','findOne','all','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','map','filter','isNil','push','Contact','isEmpty','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','forEach','replace','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?','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','columnName','displayName','findAll','alias','custom','values','body','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','join','dialTimezone','timezones','utcOffset'];(function(_0x8d5e8a,_0x36b09a){var _0x2126df=function(_0x1d6476){while(--_0x1d6476){_0x8d5e8a['push'](_0x8d5e8a['shift']());}};_0x2126df(++_0x36b09a);}(_0x409d,0x195));var _0xd409=function(_0x449043,_0x56df64){_0x449043=_0x449043-0x0;var _0x562598=_0x409d[_0x449043];return _0x562598;};'use strict';var moment=require('moment');var BPromise=require(_0xd409('0x0'));var util=require(_0xd409('0x1'));var path=require(_0xd409('0x2'));var fs=require('fs');var _=require(_0xd409('0x3'));var squel=require(_0xd409('0x4'));var Papa=require(_0xd409('0x5'));var Redis=require(_0xd409('0x6'));var qs=require(_0xd409('0x7'));var as=require(_0xd409('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xd409('0x9'));var shared=require(_0xd409('0xa'));var db=require(_0xd409('0xb'))['db'];config[_0xd409('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd409('0xd'))(new Redis(config[_0xd409('0xc')]));require(_0xd409('0xe'))[_0xd409('0xf')](socket);function respondWithResult(_0x1457ff,_0x1027cc){_0x1027cc=_0x1027cc||0xc8;return function(_0x503011){if(_0x503011){return _0x1457ff[_0xd409('0x10')](_0x1027cc)[_0xd409('0x11')](_0x503011);}};}function respondWithFilteredResult(_0x2b000d,_0x3616c4){return function(_0x243f0b){if(_0x243f0b){var _0x288e8b=typeof _0x3616c4[_0xd409('0x12')]===_0xd409('0x13')&&typeof _0x3616c4[_0xd409('0x14')]===_0xd409('0x13');var _0xae1b18=_0x243f0b[_0xd409('0x15')];var _0x58e9ed=_0x288e8b?0x0:_0x3616c4[_0xd409('0x12')];var _0x397ce0=_0x288e8b?_0x243f0b[_0xd409('0x15')]:_0x3616c4[_0xd409('0x12')]+_0x3616c4[_0xd409('0x14')];var _0x4558e2;if(_0x397ce0>=_0xae1b18){_0x397ce0=_0xae1b18;_0x4558e2=0xc8;}else{_0x4558e2=0xce;}_0x2b000d[_0xd409('0x10')](_0x4558e2);return _0x2b000d['set'](_0xd409('0x16'),_0x58e9ed+'-'+_0x397ce0+'/'+_0xae1b18)[_0xd409('0x11')](_0x243f0b);}return null;};}function saveUpdates(_0x11d627){return function(_0x411f54){if(_0x411f54){return _0x411f54[_0xd409('0x17')](_0x11d627)['then'](function(_0x3350fd){return _0x3350fd;});}return null;};}function removeEntity(_0x474e97){return function(_0x51e8e4){if(_0x51e8e4){return _0x51e8e4[_0xd409('0x18')]()['then'](function(){_0x474e97[_0xd409('0x10')](0xcc)[_0xd409('0x19')]();});}};}function handleEntityNotFound(_0x24b07a){return function(_0x18a150){if(!_0x18a150){_0x24b07a[_0xd409('0x1a')](0x194);}return _0x18a150;};}function handleError(_0x2af11d,_0x56a568){_0x56a568=_0x56a568||0x1f4;return function(_0x2afae8){logger[_0xd409('0x1b')](_0x2afae8[_0xd409('0x1c')]);if(_0x2afae8[_0xd409('0x1d')]){delete _0x2afae8[_0xd409('0x1d')];}_0x2af11d[_0xd409('0x10')](_0x56a568)[_0xd409('0x1e')](_0x2afae8);};}exports[_0xd409('0x1f')]=function(_0x2081d9,_0x8b68e1){var _0x1734b8={},_0x10fd40={},_0x2f6bce={'count':0x0,'rows':[]};return db[_0xd409('0x20')][_0xd409('0x21')]()[_0xd409('0x22')](function(_0x390cbf){var _0x18f705=[];for(var _0x3f8f14=0x0;_0x3f8f140x1){_0x33300a['or'](_0xd409('0x66'),qs[_0xd409('0x67')](_0x59a366),null);}else{if(qs[_0xd409('0x68')](_0x59a366)){_0x33300a['or'](_0xd409('0x69'),_0x59a366+'%');_0x33300a['or'](_0xd409('0x6a'),_0x59a366+'%');_0x33300a['or'](_0xd409('0x6b'),_0x59a366+'%');_0x33300a['or'](_0xd409('0x6c'),_0x59a366+'%');}else if(qs['isEmail'](_0x59a366)){_0x33300a['or']('c.email\x20LIKE\x20?',_0x59a366+'%');}else{_0x33300a['or'](_0xd409('0x6d'),'%'+_0x59a366+'%');_0x33300a['or']('c.lastName\x20LIKE\x20?','%'+_0x59a366+'%');_0x33300a['or'](_0xd409('0x6e'),'%'+_0x59a366+'%');}}}}_0x478cb9[_0xd409('0x34')](_0x33300a);_0x478cb9[_0xd409('0x6f')](_0xd409('0x70'));var _0x290784={'type':db[_0xd409('0x71')][_0xd409('0x72')]['SELECT'],'raw':!![]};var _0x4e400b=_0x478cb9[_0xd409('0x73')]()[_0xd409('0x38')]('c.id');if(_0x1734b8[_0xd409('0x32')]){_0x1734b8[_0xd409('0x32')]['forEach'](function(_0x5c440d){_0x478cb9[_0xd409('0x32')]('c.'+_0x5c440d[0x0],_0x5c440d[0x1]===_0xd409('0x74')?![]:!![]);});}if(!_[_0xd409('0x5e')](_0x9747d1)){_0x478cb9[_0xd409('0x75')](_0x37e3f6);_0x4e400b[_0xd409('0x34')](_0xd409('0x76'),_0x9747d1);}BPromise[_0xd409('0x77')]()['then'](function(){if(!_0x3e69b8)return;if(_0x2081d9[_0xd409('0x78')][_0xd409('0x79')]!==_0xd409('0x7a'))return;if(!_[_0xd409('0x7b')](_0x3e69b8[_0xd409('0x48')],[_0xd409('0x38'),_0xd409('0x4e')])){return _0x2081d9[_0xd409('0x78')][_0xd409('0x7c')]({'attributes':['id'],'raw':!![]})[_0xd409('0x22')](function(_0x55c387){if(_['isEmpty'](_0x55c387)){_0x4e400b[_0xd409('0x34')](_0xd409('0x7d'));_0x478cb9[_0xd409('0x34')](_0xd409('0x7d'));}else{_0x4e400b[_0xd409('0x34')](_0xd409('0x5f'),_[_0xd409('0x59')](_0x55c387,'id'));_0x478cb9['where'](_0xd409('0x5f'),_[_0xd409('0x59')](_0x55c387,'id'));}});}})[_0xd409('0x22')](function(){if(_0x2081d9['user'][_0xd409('0x79')]===_0xd409('0x7a')&&!_0x3e69b8&&!_0x2081d9[_0xd409('0x2d')][_0xd409('0x7e')])return[];return db[_0xd409('0x7f')][_0xd409('0x2d')](_0x4e400b[_0xd409('0x80')](),_0x290784);})[_0xd409('0x22')](function(_0x41930d){_0x2f6bce[_0xd409('0x15')]=_0x41930d[_0xd409('0x24')];if(_0x2f6bce[_0xd409('0x15')]===0x0)return[];return db[_0xd409('0x7f')]['query'](_0x6ee960[_0xd409('0x80')](),_0x290784)[_0xd409('0x22')](function(_0x527ebb){_0x5a3444=_['keyBy'](_0x527ebb,'id');_0x290784=_[_0xd409('0x81')](_0x290784,{'model':db[_0xd409('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2081d9[_0xd409('0x2d')][_0xd409('0x30')]){_0x1734b8[_0xd409('0x2f')][_0xd409('0x64')](function(_0x472b37){_0x478cb9[_0xd409('0x38')]('c.'+_0x472b37);});}else{_0x478cb9[_0xd409('0x38')](_0xd409('0x70'));_0x478cb9['field'](_0xd409('0x82'));_0x478cb9[_0xd409('0x38')](_0xd409('0x83'));_0x478cb9[_0xd409('0x38')](_0xd409('0x84'));_0x478cb9[_0xd409('0x38')](_0xd409('0x85'));_0x478cb9[_0xd409('0x38')](_0xd409('0x86'));_0x478cb9[_0xd409('0x38')](_0xd409('0x87'));_0x478cb9[_0xd409('0x38')](_0xd409('0x88'));_0x478cb9[_0xd409('0x38')](_0xd409('0x89'));_0x478cb9[_0xd409('0x38')]('c.deletedAt');_0x478cb9['field'](_0xd409('0x8a'));_0x478cb9[_0xd409('0x38')](_0xd409('0x8b'),_0xd409('0x8c'));}if(_0x1734b8[_0xd409('0x14')])_0x478cb9['limit'](_0x1734b8[_0xd409('0x14')]);if(_0x1734b8['offset'])_0x478cb9[_0xd409('0x12')](_0x1734b8['offset']);return db[_0xd409('0x7f')][_0xd409('0x2d')](_0x478cb9['toString'](),_0x290784);});})['then'](function(_0x24b8d1){_0x24b8d1[_0xd409('0x64')](function(_0x10b14a){if(_0x10b14a[_0xd409('0x8c')]){_0x10b14a['Tags']=[];_0x10b14a[_0xd409('0x8c')][_0xd409('0x4b')](',')[_0xd409('0x64')](function(_0x12b39f){_0x10b14a[_0xd409('0x8d')][_0xd409('0x5c')](_0x5a3444[_0x12b39f]);});}delete _0x10b14a['TagIds'];});_0x2f6bce[_0xd409('0x8e')]=_0x24b8d1;return _0x2f6bce;})[_0xd409('0x22')](respondWithFilteredResult(_0x8b68e1,_0x1734b8));})[_0xd409('0x8f')](handleError(_0x8b68e1,null));};exports['destroy']=function(_0x46bdec,_0x308fe3){return db['CmContact'][_0xd409('0x49')]({'where':{'id':_0x46bdec['params']['id']}})[_0xd409('0x22')](handleEntityNotFound(_0x308fe3,null))['then'](removeEntity(_0x308fe3,null))['catch'](handleError(_0x308fe3,null));};exports['describe']=function(_0x2d3093,_0x26dcc8){return db[_0xd409('0x20')]['describe']()[_0xd409('0x22')](function(_0x9cd626){delete _0x9cd626['tags'];for(var _0x2df781=0x0;_0x2df781=_0x2243c2){_0x16d3a6=_0x2243c2;_0x5dc57f=0xc8;}else{_0x5dc57f=0xce;}_0x44a5ca[_0x4ee0('0x18')](_0x5dc57f);return _0x44a5ca['set'](_0x4ee0('0x19'),_0x11cd29+'-'+_0x16d3a6+'/'+_0x2243c2)[_0x4ee0('0x13')](_0x535998);}return null;};}function saveUpdates(_0x363d66){return function(_0x121650){if(_0x121650){return _0x121650[_0x4ee0('0x1a')](_0x363d66)[_0x4ee0('0x1b')](function(_0x1256d4){return _0x1256d4;});}return null;};}function removeEntity(_0x2522f0){return function(_0x18a8af){if(_0x18a8af){return _0x18a8af[_0x4ee0('0x1c')]()[_0x4ee0('0x1b')](function(){_0x2522f0[_0x4ee0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x350e62){return function(_0x138553){if(!_0x138553){_0x350e62['sendStatus'](0x194);}return _0x138553;};}function handleError(_0x28741e,_0x23a43c){_0x23a43c=_0x23a43c||0x1f4;return function(_0x13eb83){logger['error'](_0x13eb83[_0x4ee0('0x1d')]);if(_0x13eb83[_0x4ee0('0x1e')]){delete _0x13eb83[_0x4ee0('0x1e')];}_0x28741e[_0x4ee0('0x18')](_0x23a43c)[_0x4ee0('0x1f')](_0x13eb83);};}exports['index']=function(_0x586548,_0x37ce87){var _0x4ef138={},_0x4b50cb={},_0x3302f2={'count':0x0,'rows':[]};return db[_0x4ee0('0x20')]['describe']()['then'](function(_0x202e39){var _0x2c2dd1=[];for(var _0xeb24b1=0x0;_0xeb24b10x1){_0x20043a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4ee0('0x58')](_0x50f8e2),null);}else{if(qs[_0x4ee0('0x59')](_0x50f8e2)){_0x20043a['or'](_0x4ee0('0x5a'),_0x50f8e2+'%');_0x20043a['or'](_0x4ee0('0x5b'),_0x50f8e2+'%');_0x20043a['or'](_0x4ee0('0x5c'),_0x50f8e2+'%');_0x20043a['or']('c.fax\x20LIKE\x20?',_0x50f8e2+'%');}else if(qs[_0x4ee0('0x5d')](_0x50f8e2)){_0x20043a['or'](_0x4ee0('0x5e'),_0x50f8e2+'%');}else{_0x20043a['or']('c.firstName\x20LIKE\x20?','%'+_0x50f8e2+'%');_0x20043a['or']('c.lastName\x20LIKE\x20?','%'+_0x50f8e2+'%');_0x20043a['or'](_0x4ee0('0x5e'),'%'+_0x50f8e2+'%');}}}}_0x52b910['where'](_0x20043a);_0x52b910[_0x4ee0('0x5f')]('c.id');var _0x170e4d={'type':db[_0x4ee0('0x60')][_0x4ee0('0x61')][_0x4ee0('0x62')],'raw':!![]};var _0x3d66a1=_0x52b910[_0x4ee0('0x63')]()[_0x4ee0('0x37')]('c.id');if(_0x4ef138[_0x4ee0('0x33')]){_0x4ef138[_0x4ee0('0x33')]['forEach'](function(_0x1856bd){_0x52b910[_0x4ee0('0x33')]('c.'+_0x1856bd[0x0],_0x1856bd[0x1]===_0x4ee0('0x64')?![]:!![]);});}if(!_[_0x4ee0('0x65')](_0x251042)){_0x52b910[_0x4ee0('0x66')](_0x241287);_0x3d66a1[_0x4ee0('0x3d')](_0x4ee0('0x67'),_0x251042);}BPromise[_0x4ee0('0x68')]()[_0x4ee0('0x1b')](function(){if(!_0x3234d4)return;if(_0x586548[_0x4ee0('0x69')][_0x4ee0('0x6a')]!==_0x4ee0('0x6b'))return;if(!_[_0x4ee0('0x6c')](_0x3234d4[_0x4ee0('0x41')],[_0x4ee0('0x37'),'User'])){return _0x586548[_0x4ee0('0x69')]['getLists']({'attributes':['id'],'raw':!![]})[_0x4ee0('0x1b')](function(_0x4e7edd){if(_['isEmpty'](_0x4e7edd)){_0x3d66a1[_0x4ee0('0x3d')](_0x4ee0('0x6d'));_0x52b910['where'](_0x4ee0('0x6d'));}else{_0x3d66a1[_0x4ee0('0x3d')](_0x4ee0('0x6e'),_[_0x4ee0('0x44')](_0x4e7edd,'id'));_0x52b910['where'](_0x4ee0('0x6e'),_['map'](_0x4e7edd,'id'));}});}})[_0x4ee0('0x1b')](function(){if(_0x586548[_0x4ee0('0x69')]['role']===_0x4ee0('0x6b')&&!_0x3234d4&&!_0x586548[_0x4ee0('0x2c')][_0x4ee0('0x52')])return[];return db[_0x4ee0('0x6f')]['query'](_0x3d66a1['toString'](),_0x170e4d);})[_0x4ee0('0x1b')](function(_0x304c7d){_0x3302f2['count']=_0x304c7d[_0x4ee0('0x22')];if(_0x3302f2[_0x4ee0('0x17')]===0x0)return[];return db[_0x4ee0('0x6f')][_0x4ee0('0x2c')](_0x20a5d1[_0x4ee0('0x70')](),_0x170e4d)[_0x4ee0('0x1b')](function(_0x15aa76){_0x521ed2=_[_0x4ee0('0x71')](_0x15aa76,'id');_0x170e4d=_['merge'](_0x170e4d,{'model':db[_0x4ee0('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x586548[_0x4ee0('0x2c')][_0x4ee0('0x31')]){_0x4ef138[_0x4ee0('0x30')][_0x4ee0('0x45')](function(_0x4abe67){_0x52b910[_0x4ee0('0x37')]('c.'+_0x4abe67);});}else{_0x52b910['field'](_0x4ee0('0x72'));_0x52b910[_0x4ee0('0x37')](_0x4ee0('0x73'));_0x52b910['field'](_0x4ee0('0x74'));_0x52b910[_0x4ee0('0x37')]('c.phone');_0x52b910[_0x4ee0('0x37')](_0x4ee0('0x75'));_0x52b910[_0x4ee0('0x37')](_0x4ee0('0x76'));_0x52b910[_0x4ee0('0x37')](_0x4ee0('0x77'));_0x52b910['field'](_0x4ee0('0x78'));_0x52b910[_0x4ee0('0x37')](_0x4ee0('0x79'));_0x52b910[_0x4ee0('0x37')]('c.deletedAt');_0x52b910['field'](_0x4ee0('0x7a'));_0x52b910['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4ee0('0x7b'));}if(_0x4ef138[_0x4ee0('0x15')])_0x52b910['limit'](_0x4ef138[_0x4ee0('0x15')]);if(_0x4ef138[_0x4ee0('0x14')])_0x52b910[_0x4ee0('0x14')](_0x4ef138['offset']);return db['sequelize'][_0x4ee0('0x2c')](_0x52b910[_0x4ee0('0x70')](),_0x170e4d);});})[_0x4ee0('0x1b')](function(_0x318be1){_0x318be1['forEach'](function(_0x10938e){if(_0x10938e['TagIds']){_0x10938e['Tags']=[];_0x10938e[_0x4ee0('0x7b')][_0x4ee0('0x43')](',')[_0x4ee0('0x45')](function(_0x33094c){_0x10938e[_0x4ee0('0x7c')][_0x4ee0('0x24')](_0x521ed2[_0x33094c]);});}delete _0x10938e['TagIds'];});_0x3302f2[_0x4ee0('0x7d')]=_0x318be1;return _0x3302f2;})[_0x4ee0('0x1b')](respondWithFilteredResult(_0x37ce87,_0x4ef138));})[_0x4ee0('0x7e')](handleError(_0x37ce87,null));};exports[_0x4ee0('0x1c')]=function(_0x1f8450,_0x1bcd2d){return db[_0x4ee0('0x20')][_0x4ee0('0x7f')]({'where':{'id':_0x1f8450[_0x4ee0('0x80')]['id']}})['then'](handleEntityNotFound(_0x1bcd2d,null))[_0x4ee0('0x1b')](removeEntity(_0x1bcd2d,null))[_0x4ee0('0x7e')](handleError(_0x1bcd2d,null));};exports['describe']=function(_0x573a4c,_0x2f680d){return db[_0x4ee0('0x20')][_0x4ee0('0x81')]()[_0x4ee0('0x1b')](function(_0x238892){delete _0x238892['tags'];for(var _0x401bc7=0x0;_0x401bc7{}\s\\|]/g,'-');_0x2649f1(null,util[_0x35a2('0x22')]('%s-%s%s',path[_0x35a2('0x23')](_0x96cb41[_0x35a2('0x20')],path[_0x35a2('0x24')](_0x96cb41[_0x35a2('0x20')])),Date[_0x35a2('0x25')](),path['extname'](_0x96cb41['originalname'])));}})});router[_0x35a2('0x17')](_0x35a2('0x26'),upload['single'](_0x35a2('0x27')),controller[_0x35a2('0x28')]);var upload=multer({'storage':multer[_0x35a2('0x1d')]({'destination':function(_0x3ac57f,_0x492687,_0x59a307){_0x59a307(null,path[_0x35a2('0x1e')](config[_0x35a2('0x29')],_0x35a2('0x1f')));},'filename':function(_0x2fb3a1,_0x149e8e,_0x430187){_0x149e8e[_0x35a2('0x20')]=_0x149e8e['originalname'][_0x35a2('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x430187(null,util[_0x35a2('0x22')](_0x35a2('0x2a'),path['basename'](_0x149e8e[_0x35a2('0x20')],path[_0x35a2('0x24')](_0x149e8e[_0x35a2('0x20')])),Date[_0x35a2('0x25')](),path[_0x35a2('0x24')](_0x149e8e['originalname'])));}})});router[_0x35a2('0x17')](_0x35a2('0x2b'),upload[_0x35a2('0x2c')]('file'),controller['upload']);router[_0x35a2('0x17')](_0x35a2('0x2d'),auth[_0x35a2('0xb')](),controller[_0x35a2('0x2e')]);router[_0x35a2('0x2f')]('/:id',auth[_0x35a2('0xb')](),controller[_0x35a2('0x30')]);router[_0x35a2('0x31')](_0x35a2('0x32'),auth['isAuthenticated'](),controller['destroy']);module[_0x35a2('0x33')]=router; \ No newline at end of file +var _0xa6af=['file','upload','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s','now','extname','/csv','single','uploadCsv','basename','/upload'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xa6af,0x104));var _0xfa6a=function(_0x22b508,_0x5628dd){_0x22b508=_0x22b508-0x0;var _0x25e479=_0xa6af[_0x22b508];return _0x25e479;};'use strict';var multer=require(_0xfa6a('0x0'));var util=require(_0xfa6a('0x1'));var path=require('path');var timeout=require(_0xfa6a('0x2'));var express=require(_0xfa6a('0x3'));var router=express[_0xfa6a('0x4')]();var fs_extra=require(_0xfa6a('0x5'));var auth=require(_0xfa6a('0x6'));var interaction=require(_0xfa6a('0x7'));var config=require(_0xfa6a('0x8'));var controller=require(_0xfa6a('0x9'));router[_0xfa6a('0xa')]('/',auth[_0xfa6a('0xb')](),controller[_0xfa6a('0xc')]);router[_0xfa6a('0xa')](_0xfa6a('0xd'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0xe')]);router[_0xfa6a('0xa')](_0xfa6a('0xf'),auth['isAuthenticated'](),controller[_0xfa6a('0x10')]);router[_0xfa6a('0xa')](_0xfa6a('0x11'),auth[_0xfa6a('0xb')](),controller['getTags']);router[_0xfa6a('0xa')](_0xfa6a('0x12'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x13')]);router['get'](_0xfa6a('0x14'),auth['isAuthenticated'](),controller[_0xfa6a('0x15')]);router[_0xfa6a('0xa')](_0xfa6a('0x16'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x17')]);router['get'](_0xfa6a('0x18'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x19')]);router[_0xfa6a('0xa')]('/:id/journey',auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x1a')]);router[_0xfa6a('0x1b')](_0xfa6a('0x1c'),auth[_0xfa6a('0xb')](),controller['merge']);router[_0xfa6a('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfa6a('0x1b')](_0xfa6a('0x1d'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x1e')]);router['post'](_0xfa6a('0x11'),auth['isAuthenticated'](),controller[_0xfa6a('0x1f')]);var upload=multer({'storage':multer[_0xfa6a('0x20')]({'destination':function(_0x4511ef,_0x51c4b4,_0x3b7fb2){_0x3b7fb2(null,path[_0xfa6a('0x21')](config[_0xfa6a('0x22')],_0xfa6a('0x23')));},'filename':function(_0x3976eb,_0x57f1b7,_0x57876a){_0x57f1b7[_0xfa6a('0x24')]=_0x57f1b7['originalname'][_0xfa6a('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57876a(null,util['format'](_0xfa6a('0x26'),path['basename'](_0x57f1b7[_0xfa6a('0x24')],path['extname'](_0x57f1b7[_0xfa6a('0x24')])),Date[_0xfa6a('0x27')](),path[_0xfa6a('0x28')](_0x57f1b7[_0xfa6a('0x24')])));}})});router['post'](_0xfa6a('0x29'),upload[_0xfa6a('0x2a')]('file'),controller[_0xfa6a('0x2b')]);var upload=multer({'storage':multer[_0xfa6a('0x20')]({'destination':function(_0xff1ed2,_0x42a96a,_0x45285b){_0x45285b(null,path[_0xfa6a('0x21')](config[_0xfa6a('0x22')],'server/files/tmp'));},'filename':function(_0x469118,_0x9fac42,_0x51c591){_0x9fac42['originalname']=_0x9fac42[_0xfa6a('0x24')][_0xfa6a('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x51c591(null,util['format'](_0xfa6a('0x26'),path[_0xfa6a('0x2c')](_0x9fac42[_0xfa6a('0x24')],path['extname'](_0x9fac42['originalname'])),Date['now'](),path[_0xfa6a('0x28')](_0x9fac42[_0xfa6a('0x24')])));}})});router[_0xfa6a('0x1b')](_0xfa6a('0x2d'),upload[_0xfa6a('0x2a')](_0xfa6a('0x2e')),controller[_0xfa6a('0x2f')]);router[_0xfa6a('0x1b')]('/upload/:id',auth[_0xfa6a('0xb')](),controller['import']);router['put'](_0xfa6a('0xf'),auth[_0xfa6a('0xb')](),controller[_0xfa6a('0x30')]);router[_0xfa6a('0x31')](_0xfa6a('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa6a('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 7e77fe8..91d08a2 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 _0xcc28=['VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xcc28,0x64));var _0x8cc2=function(_0x458b31,_0x17aa2a){_0x458b31=_0x458b31-0x0;var _0x2e0215=_0xcc28[_0x458b31];return _0x2e0215;};'use strict';var Sequelize=require(_0x8cc2('0x0'));var _=require(_0x8cc2('0x1'));module['exports']={'name':{'type':Sequelize[_0x8cc2('0x2')],'get':function(_0x13ae23){return this[_0x8cc2('0x3')]('alias');}},'alias':{'type':Sequelize[_0x8cc2('0x4')],'allowNull':![],'set':function(_0x21e07f){this[_0x8cc2('0x5')](_0x8cc2('0x6'),_0x21e07f?_0x21e07f:this[_0x8cc2('0x3')](_0x8cc2('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x8cc2('0x8')](_0x8cc2('0x9')),'get':function(){if(this[_0x8cc2('0x3')]('type')===_0x8cc2('0xa')){return JSON[_0x8cc2('0xb')](this['getDataValue']('values'));}else{return this[_0x8cc2('0x3')](_0x8cc2('0xc'));}},'set':function(_0x7f6f43){if(Array[_0x8cc2('0xd')](_0x7f6f43)){this[_0x8cc2('0x5')]('values',JSON[_0x8cc2('0xe')](_0x7f6f43));}else{this['setDataValue']('values',_0x7f6f43);}}},'required':{'type':Sequelize[_0x8cc2('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8cc2('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8cc2('0x10')]('voice')}}; \ No newline at end of file +var _0x0037=['ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','alias','TEXT','long','select','values','isArray','setDataValue','stringify','BOOLEAN'];(function(_0x1d826d,_0x3a39d5){var _0x2f96c6=function(_0x2cdbd4){while(--_0x2cdbd4){_0x1d826d['push'](_0x1d826d['shift']());}};_0x2f96c6(++_0x3a39d5);}(_0x0037,0x1bc));var _0x7003=function(_0x4d6599,_0x36ead7){_0x4d6599=_0x4d6599-0x0;var _0x368a5f=_0x0037[_0x4d6599];return _0x368a5f;};'use strict';var Sequelize=require(_0x7003('0x0'));var _=require(_0x7003('0x1'));module[_0x7003('0x2')]={'name':{'type':Sequelize[_0x7003('0x3')],'get':function(_0x23d1ad){return this[_0x7003('0x4')]('alias');}},'alias':{'type':Sequelize[_0x7003('0x5')],'allowNull':![],'set':function(_0x3ee5c9){this['setDataValue'](_0x7003('0x6'),_0x3ee5c9?_0x3ee5c9:this[_0x7003('0x4')]('name'));}},'type':{'type':Sequelize[_0x7003('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x7003('0x7')](_0x7003('0x8')),'get':function(){if(this['getDataValue']('type')===_0x7003('0x9')){return JSON['parse'](this[_0x7003('0x4')](_0x7003('0xa')));}else{return this['getDataValue'](_0x7003('0xa'));}},'set':function(_0x2d2d0b){if(Array[_0x7003('0xb')](_0x2d2d0b)){this[_0x7003('0xc')](_0x7003('0xa'),JSON[_0x7003('0xd')](_0x2d2d0b));}else{this[_0x7003('0xc')]('values',_0x2d2d0b);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7003('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7003('0xf')](_0x7003('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 41a9dc9..233f802 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 _0x712d=['INTEGER','switch','BOOLEAN','defaultValue','sequelize','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','CmCustomField','rawAttributes','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','body','create','Sequelize','TEXT','number'];(function(_0x1374f1,_0x19f66f){var _0x3f109d=function(_0x2dc81a){while(--_0x2dc81a){_0x1374f1['push'](_0x1374f1['shift']());}};_0x3f109d(++_0x19f66f);}(_0x712d,0x1f2));var _0xd712=function(_0x5dc482,_0xdf3f6d){_0x5dc482=_0x5dc482-0x0;var _0xb24c2a=_0x712d[_0x5dc482];return _0xb24c2a;};'use strict';var emlformat=require(_0xd712('0x0'));var rimraf=require(_0xd712('0x1'));var zipdir=require(_0xd712('0x2'));var jsonpatch=require(_0xd712('0x3'));var rp=require(_0xd712('0x4'));var moment=require('moment');var BPromise=require(_0xd712('0x5'));var Mustache=require(_0xd712('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd712('0x7'));var _=require(_0xd712('0x8'));var squel=require(_0xd712('0x9'));var crypto=require(_0xd712('0xa'));var jsforce=require(_0xd712('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd712('0xc'));var querystring=require(_0xd712('0xd'));var Papa=require(_0xd712('0xe'));var Redis=require(_0xd712('0xf'));var authService=require(_0xd712('0x10'));var qs=require(_0xd712('0x11'));var as=require(_0xd712('0x12'));var hardwareService=require(_0xd712('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd712('0x14'));var config=require(_0xd712('0x15'));var licenseUtil=require(_0xd712('0x16'));var db=require(_0xd712('0x17'))['db'];function respondWithStatusCode(_0x2e2fde,_0xa005dc){_0xa005dc=_0xa005dc||0xcc;return function(_0x14ed1c){if(_0x14ed1c){return _0x2e2fde[_0xd712('0x18')](_0xa005dc);}return _0x2e2fde['status'](_0xa005dc)['end']();};}function respondWithResult(_0x2c5ae6,_0xfca83d){_0xfca83d=_0xfca83d||0xc8;return function(_0x119da8){if(_0x119da8){return _0x2c5ae6[_0xd712('0x19')](_0xfca83d)[_0xd712('0x1a')](_0x119da8);}};}function respondWithFilteredResult(_0xc06930,_0x29b143){return function(_0x9565fb){if(_0x9565fb){var _0x174d15=typeof _0x29b143[_0xd712('0x1b')]==='undefined'&&typeof _0x29b143[_0xd712('0x1c')]===_0xd712('0x1d');var _0x9e6b95=_0x9565fb[_0xd712('0x1e')];var _0x328008=_0x174d15?0x0:_0x29b143[_0xd712('0x1b')];var _0x4188a3=_0x174d15?_0x9565fb[_0xd712('0x1e')]:_0x29b143[_0xd712('0x1b')]+_0x29b143['limit'];var _0xb3ecda;if(_0x4188a3>=_0x9e6b95){_0x4188a3=_0x9e6b95;_0xb3ecda=0xc8;}else{_0xb3ecda=0xce;}_0xc06930['status'](_0xb3ecda);return _0xc06930[_0xd712('0x1f')](_0xd712('0x20'),_0x328008+'-'+_0x4188a3+'/'+_0x9e6b95)[_0xd712('0x1a')](_0x9565fb);}return null;};}function patchUpdates(_0x51c193){return function(_0x29ec30){try{jsonpatch[_0xd712('0x21')](_0x29ec30,_0x51c193,!![]);}catch(_0x4dc649){return BPromise[_0xd712('0x22')](_0x4dc649);}return _0x29ec30[_0xd712('0x23')]();};}function saveUpdates(_0x3b6411,_0x1b93ce){return function(_0x292a45){if(_0x292a45){return _0x292a45[_0xd712('0x24')](_0x3b6411)[_0xd712('0x25')](function(_0x2102dd){return _0x2102dd;});}return null;};}function removeEntity(_0x50aec1,_0x55fb30){return function(_0x2ff00d){if(_0x2ff00d){return _0x2ff00d[_0xd712('0x26')]()[_0xd712('0x25')](function(){_0x50aec1['status'](0xcc)[_0xd712('0x27')]();});}};}function handleEntityNotFound(_0x51b3a8,_0x2ed39b){return function(_0x15d445){if(!_0x15d445){_0x51b3a8[_0xd712('0x18')](0x194);}return _0x15d445;};}function handleError(_0x14b23f,_0x376b60){_0x376b60=_0x376b60||0x1f4;return function(_0x2ff430){logger['error'](_0x2ff430[_0xd712('0x28')]);if(_0x2ff430['name']){delete _0x2ff430[_0xd712('0x29')];}_0x14b23f[_0xd712('0x19')](_0x376b60)['send'](_0x2ff430);};}exports[_0xd712('0x2a')]=function(_0x56e173,_0x391d1e){var _0x16e96d={},_0x201750={},_0xa67f49={'count':0x0,'rows':[]};var _0x56a27e=_[_0xd712('0x2b')](db[_0xd712('0x2c')][_0xd712('0x2d')],function(_0xaaffdd){return{'name':_0xaaffdd['fieldName'],'type':_0xaaffdd[_0xd712('0x2e')][_0xd712('0x2f')]};});_0x201750['model']=_[_0xd712('0x30')](_[_0xd712('0x2b')](_0x56a27e,_0xd712('0x29')),[_0xd712('0x29')]);_0x201750[_0xd712('0x31')]=_[_0xd712('0x32')](_0x56e173[_0xd712('0x31')]);_0x201750[_0xd712('0x33')]=_[_0xd712('0x34')](_0x201750[_0xd712('0x35')],_0x201750[_0xd712('0x31')]);_0x16e96d[_0xd712('0x36')]=_[_0xd712('0x34')](_0x201750[_0xd712('0x35')],qs[_0xd712('0x37')](_0x56e173[_0xd712('0x31')][_0xd712('0x37')]));_0x16e96d['attributes']=_0x16e96d[_0xd712('0x36')]['length']?_0x16e96d[_0xd712('0x36')]:_0x201750[_0xd712('0x35')];if(!_0x56e173[_0xd712('0x31')]['hasOwnProperty'](_0xd712('0x38'))){_0x16e96d[_0xd712('0x1c')]=qs[_0xd712('0x1c')](_0x56e173[_0xd712('0x31')]['limit']);_0x16e96d[_0xd712('0x1b')]=qs[_0xd712('0x1b')](_0x56e173[_0xd712('0x31')][_0xd712('0x1b')]);}_0x16e96d[_0xd712('0x39')]=qs[_0xd712('0x3a')](_0x56e173[_0xd712('0x31')][_0xd712('0x3a')]);_0x16e96d[_0xd712('0x3b')]=qs[_0xd712('0x33')](_[_0xd712('0x3c')](_0x56e173[_0xd712('0x31')],_0x201750[_0xd712('0x33')]),_0x56a27e);if(_0x56e173[_0xd712('0x31')][_0xd712('0x3d')]){_0x16e96d['where']=_[_0xd712('0x3e')](_0x16e96d[_0xd712('0x3b')],{'$or':_[_0xd712('0x2b')](_0x56a27e,function(_0x36c801){if(_0x36c801[_0xd712('0x2e')]!=='VIRTUAL'){var _0xadf58e={};_0xadf58e[_0x36c801['name']]={'$like':'%'+_0x56e173[_0xd712('0x31')][_0xd712('0x3d')]+'%'};return _0xadf58e;}})});}_0x16e96d=_[_0xd712('0x3e')]({},_0x16e96d,_0x56e173[_0xd712('0x3f')]);var _0x140aae={'where':_0x16e96d[_0xd712('0x3b')]};return db[_0xd712('0x2c')][_0xd712('0x1e')](_0x140aae)[_0xd712('0x25')](function(_0x3bd652){_0xa67f49[_0xd712('0x1e')]=_0x3bd652;if(_0x56e173[_0xd712('0x31')][_0xd712('0x40')]){_0x16e96d[_0xd712('0x41')]=[{'all':!![]}];}return db[_0xd712('0x2c')]['findAll'](_0x16e96d);})[_0xd712('0x25')](function(_0x58ea59){_0xa67f49[_0xd712('0x42')]=_0x58ea59;return _0xa67f49;})[_0xd712('0x25')](respondWithFilteredResult(_0x391d1e,_0x16e96d))[_0xd712('0x43')](handleError(_0x391d1e,null));};exports[_0xd712('0x44')]=function(_0x4bd2d2,_0xe49569){var _0x311d76={'raw':!![],'where':{'id':_0x4bd2d2[_0xd712('0x45')]['id']}},_0x2c1a67={};_0x2c1a67[_0xd712('0x35')]=_[_0xd712('0x32')](db[_0xd712('0x2c')][_0xd712('0x2d')]);_0x2c1a67[_0xd712('0x31')]=_[_0xd712('0x32')](_0x4bd2d2[_0xd712('0x31')]);_0x2c1a67[_0xd712('0x33')]=_[_0xd712('0x34')](_0x2c1a67[_0xd712('0x35')],_0x2c1a67[_0xd712('0x31')]);_0x311d76['attributes']=_[_0xd712('0x34')](_0x2c1a67[_0xd712('0x35')],qs[_0xd712('0x37')](_0x4bd2d2[_0xd712('0x31')][_0xd712('0x37')]));_0x311d76[_0xd712('0x36')]=_0x311d76[_0xd712('0x36')]['length']?_0x311d76[_0xd712('0x36')]:_0x2c1a67[_0xd712('0x35')];if(_0x4bd2d2[_0xd712('0x31')]['includeAll']){_0x311d76['include']=[{'all':!![]}];}_0x311d76=_['merge']({},_0x311d76,_0x4bd2d2[_0xd712('0x3f')]);return db[_0xd712('0x2c')][_0xd712('0x46')](_0x311d76)['then'](handleEntityNotFound(_0xe49569,null))[_0xd712('0x25')](respondWithResult(_0xe49569,null))[_0xd712('0x43')](handleError(_0xe49569,null));};exports[_0xd712('0x24')]=function(_0x198dab,_0x1a7c5a){if(_0x198dab[_0xd712('0x47')]['id']){delete _0x198dab[_0xd712('0x47')]['id'];}return db['CmCustomField'][_0xd712('0x46')]({'where':{'id':_0x198dab[_0xd712('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a7c5a,null))['then'](saveUpdates(_0x198dab[_0xd712('0x47')],null))[_0xd712('0x25')](respondWithResult(_0x1a7c5a,null))['catch'](handleError(_0x1a7c5a,null));};exports[_0xd712('0x26')]=function(_0x10d995,_0x4ff509){return db['CmCustomField'][_0xd712('0x46')]({'where':{'id':_0x10d995[_0xd712('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ff509,null))[_0xd712('0x25')](removeEntity(_0x4ff509,null))[_0xd712('0x43')](handleError(_0x4ff509,null));};exports[_0xd712('0x48')]=function(_0x3438b1,_0xd03a23){var _0x130ec1;return db['sequelize']['transaction'](function(_0x479cc8){return db['CmCustomField']['create'](_0x3438b1[_0xd712('0x47')],{'transaction':_0x479cc8})[_0xd712('0x25')](function(_0x3a4e99){_0x130ec1=_0x3a4e99;var _0xed2b13={'type':db[_0xd712('0x49')][_0xd712('0x4a')],'transaction':_0x479cc8};switch(_0x3438b1[_0xd712('0x47')][_0xd712('0x2e')]){case'text':_0xed2b13[_0xd712('0x2e')]=db['Sequelize'][_0xd712('0x4a')];break;case _0xd712('0x4b'):_0xed2b13[_0xd712('0x2e')]=db['Sequelize'][_0xd712('0x4c')];break;case _0xd712('0x4d'):_0xed2b13['type']=db['Sequelize'][_0xd712('0x4e')];_0xed2b13[_0xd712('0x4f')]=![];break;default:}return db[_0xd712('0x50')]['queryInterface']['addColumn']('cm_contacts',util[_0xd712('0x51')]('cf_%d',_0x130ec1['id']),_0xed2b13);})[_0xd712('0x25')](function(){return _0x130ec1;});})[_0xd712('0x25')](respondWithResult(_0xd03a23,0xc9))[_0xd712('0x43')](handleError(_0xd03a23,null));}; \ No newline at end of file +var _0x97ee=['sendStatus','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmCustomField','fieldName','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','keys','find','body','create','sequelize','transaction','TEXT','text','Sequelize','number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4b96bd,_0xe341d){var _0x515ad8=function(_0x166deb){while(--_0x166deb){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x515ad8(++_0xe341d);}(_0x97ee,0xf3));var _0xe97e=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x97ee[_0x455c6c];return _0x488242;};'use strict';var emlformat=require(_0xe97e('0x0'));var rimraf=require(_0xe97e('0x1'));var zipdir=require(_0xe97e('0x2'));var jsonpatch=require(_0xe97e('0x3'));var rp=require(_0xe97e('0x4'));var moment=require(_0xe97e('0x5'));var BPromise=require(_0xe97e('0x6'));var Mustache=require('mustache');var util=require(_0xe97e('0x7'));var path=require(_0xe97e('0x8'));var sox=require(_0xe97e('0x9'));var csv=require('to-csv');var ejs=require(_0xe97e('0xa'));var fs=require('fs');var fs_extra=require(_0xe97e('0xb'));var _=require(_0xe97e('0xc'));var squel=require(_0xe97e('0xd'));var crypto=require(_0xe97e('0xe'));var jsforce=require(_0xe97e('0xf'));var deskjs=require(_0xe97e('0x10'));var toCsv=require(_0xe97e('0x11'));var querystring=require(_0xe97e('0x12'));var Papa=require(_0xe97e('0x13'));var Redis=require(_0xe97e('0x14'));var authService=require(_0xe97e('0x15'));var qs=require(_0xe97e('0x16'));var as=require(_0xe97e('0x17'));var hardwareService=require(_0xe97e('0x18'));var logger=require('../../config/logger')(_0xe97e('0x19'));var utils=require(_0xe97e('0x1a'));var config=require(_0xe97e('0x1b'));var licenseUtil=require(_0xe97e('0x1c'));var db=require(_0xe97e('0x1d'))['db'];function respondWithStatusCode(_0x402488,_0x18c497){_0x18c497=_0x18c497||0xcc;return function(_0xb5da4){if(_0xb5da4){return _0x402488[_0xe97e('0x1e')](_0x18c497);}return _0x402488['status'](_0x18c497)[_0xe97e('0x1f')]();};}function respondWithResult(_0x4243dc,_0x7626ce){_0x7626ce=_0x7626ce||0xc8;return function(_0x33ed2f){if(_0x33ed2f){return _0x4243dc[_0xe97e('0x20')](_0x7626ce)['json'](_0x33ed2f);}};}function respondWithFilteredResult(_0x4af3e9,_0x582894){return function(_0x5f43aa){if(_0x5f43aa){var _0x45a5a1=typeof _0x582894['offset']===_0xe97e('0x21')&&typeof _0x582894[_0xe97e('0x22')]===_0xe97e('0x21');var _0x35e188=_0x5f43aa[_0xe97e('0x23')];var _0x59811c=_0x45a5a1?0x0:_0x582894[_0xe97e('0x24')];var _0x47a180=_0x45a5a1?_0x5f43aa[_0xe97e('0x23')]:_0x582894[_0xe97e('0x24')]+_0x582894[_0xe97e('0x22')];var _0x2279c6;if(_0x47a180>=_0x35e188){_0x47a180=_0x35e188;_0x2279c6=0xc8;}else{_0x2279c6=0xce;}_0x4af3e9[_0xe97e('0x20')](_0x2279c6);return _0x4af3e9['set']('Content-Range',_0x59811c+'-'+_0x47a180+'/'+_0x35e188)[_0xe97e('0x25')](_0x5f43aa);}return null;};}function patchUpdates(_0x5f9dcb){return function(_0x3c84b4){try{jsonpatch[_0xe97e('0x26')](_0x3c84b4,_0x5f9dcb,!![]);}catch(_0x5490c9){return BPromise[_0xe97e('0x27')](_0x5490c9);}return _0x3c84b4[_0xe97e('0x28')]();};}function saveUpdates(_0x2924aa,_0xbfd21){return function(_0x7da73a){if(_0x7da73a){return _0x7da73a[_0xe97e('0x29')](_0x2924aa)[_0xe97e('0x2a')](function(_0xf4b5bd){return _0xf4b5bd;});}return null;};}function removeEntity(_0x259621,_0x6c1226){return function(_0x2b939f){if(_0x2b939f){return _0x2b939f[_0xe97e('0x2b')]()[_0xe97e('0x2a')](function(){_0x259621[_0xe97e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1644a7,_0x4bb2d7){return function(_0x24ab22){if(!_0x24ab22){_0x1644a7['sendStatus'](0x194);}return _0x24ab22;};}function handleError(_0x5be32d,_0x460321){_0x460321=_0x460321||0x1f4;return function(_0x2a3855){logger[_0xe97e('0x2c')](_0x2a3855[_0xe97e('0x2d')]);if(_0x2a3855[_0xe97e('0x2e')]){delete _0x2a3855[_0xe97e('0x2e')];}_0x5be32d['status'](_0x460321)[_0xe97e('0x2f')](_0x2a3855);};}exports['index']=function(_0x289794,_0x5946bd){var _0x5a0b49={},_0x3e8c49={},_0x48c52f={'count':0x0,'rows':[]};var _0x2087f2=_[_0xe97e('0x30')](db[_0xe97e('0x31')]['rawAttributes'],function(_0x2240a6){return{'name':_0x2240a6[_0xe97e('0x32')],'type':_0x2240a6['type'][_0xe97e('0x33')]};});_0x3e8c49[_0xe97e('0x34')]=_[_0xe97e('0x35')](_[_0xe97e('0x30')](_0x2087f2,_0xe97e('0x2e')),[_0xe97e('0x2e')]);_0x3e8c49[_0xe97e('0x36')]=_['keys'](_0x289794[_0xe97e('0x36')]);_0x3e8c49[_0xe97e('0x37')]=_[_0xe97e('0x38')](_0x3e8c49[_0xe97e('0x34')],_0x3e8c49[_0xe97e('0x36')]);_0x5a0b49[_0xe97e('0x39')]=_[_0xe97e('0x38')](_0x3e8c49[_0xe97e('0x34')],qs[_0xe97e('0x3a')](_0x289794['query'][_0xe97e('0x3a')]));_0x5a0b49[_0xe97e('0x39')]=_0x5a0b49[_0xe97e('0x39')][_0xe97e('0x3b')]?_0x5a0b49[_0xe97e('0x39')]:_0x3e8c49[_0xe97e('0x34')];if(!_0x289794[_0xe97e('0x36')][_0xe97e('0x3c')](_0xe97e('0x3d'))){_0x5a0b49['limit']=qs[_0xe97e('0x22')](_0x289794['query'][_0xe97e('0x22')]);_0x5a0b49[_0xe97e('0x24')]=qs['offset'](_0x289794[_0xe97e('0x36')][_0xe97e('0x24')]);}_0x5a0b49[_0xe97e('0x3e')]=qs[_0xe97e('0x3f')](_0x289794[_0xe97e('0x36')][_0xe97e('0x3f')]);_0x5a0b49[_0xe97e('0x40')]=qs[_0xe97e('0x37')](_['pick'](_0x289794[_0xe97e('0x36')],_0x3e8c49['filters']),_0x2087f2);if(_0x289794[_0xe97e('0x36')][_0xe97e('0x41')]){_0x5a0b49['where']=_[_0xe97e('0x42')](_0x5a0b49[_0xe97e('0x40')],{'$or':_['map'](_0x2087f2,function(_0x321395){if(_0x321395[_0xe97e('0x43')]!=='VIRTUAL'){var _0xfd7bad={};_0xfd7bad[_0x321395[_0xe97e('0x2e')]]={'$like':'%'+_0x289794[_0xe97e('0x36')][_0xe97e('0x41')]+'%'};return _0xfd7bad;}})});}_0x5a0b49=_[_0xe97e('0x42')]({},_0x5a0b49,_0x289794[_0xe97e('0x44')]);var _0x49085f={'where':_0x5a0b49[_0xe97e('0x40')]};return db[_0xe97e('0x31')][_0xe97e('0x23')](_0x49085f)[_0xe97e('0x2a')](function(_0x37347a){_0x48c52f[_0xe97e('0x23')]=_0x37347a;if(_0x289794[_0xe97e('0x36')][_0xe97e('0x45')]){_0x5a0b49[_0xe97e('0x46')]=[{'all':!![]}];}return db[_0xe97e('0x31')][_0xe97e('0x47')](_0x5a0b49);})[_0xe97e('0x2a')](function(_0x153942){_0x48c52f[_0xe97e('0x48')]=_0x153942;return _0x48c52f;})[_0xe97e('0x2a')](respondWithFilteredResult(_0x5946bd,_0x5a0b49))[_0xe97e('0x49')](handleError(_0x5946bd,null));};exports[_0xe97e('0x4a')]=function(_0x1d3fab,_0x207e70){var _0x4b4f68={'raw':!![],'where':{'id':_0x1d3fab['params']['id']}},_0x88f179={};_0x88f179[_0xe97e('0x34')]=_[_0xe97e('0x4b')](db[_0xe97e('0x31')]['rawAttributes']);_0x88f179['query']=_['keys'](_0x1d3fab[_0xe97e('0x36')]);_0x88f179[_0xe97e('0x37')]=_[_0xe97e('0x38')](_0x88f179[_0xe97e('0x34')],_0x88f179['query']);_0x4b4f68[_0xe97e('0x39')]=_['intersection'](_0x88f179[_0xe97e('0x34')],qs[_0xe97e('0x3a')](_0x1d3fab[_0xe97e('0x36')][_0xe97e('0x3a')]));_0x4b4f68['attributes']=_0x4b4f68[_0xe97e('0x39')][_0xe97e('0x3b')]?_0x4b4f68[_0xe97e('0x39')]:_0x88f179[_0xe97e('0x34')];if(_0x1d3fab[_0xe97e('0x36')][_0xe97e('0x45')]){_0x4b4f68[_0xe97e('0x46')]=[{'all':!![]}];}_0x4b4f68=_[_0xe97e('0x42')]({},_0x4b4f68,_0x1d3fab[_0xe97e('0x44')]);return db[_0xe97e('0x31')][_0xe97e('0x4c')](_0x4b4f68)['then'](handleEntityNotFound(_0x207e70,null))['then'](respondWithResult(_0x207e70,null))[_0xe97e('0x49')](handleError(_0x207e70,null));};exports[_0xe97e('0x29')]=function(_0x20e4c1,_0xdeab2a){if(_0x20e4c1[_0xe97e('0x4d')]['id']){delete _0x20e4c1[_0xe97e('0x4d')]['id'];}return db[_0xe97e('0x31')][_0xe97e('0x4c')]({'where':{'id':_0x20e4c1['params']['id']}})[_0xe97e('0x2a')](handleEntityNotFound(_0xdeab2a,null))[_0xe97e('0x2a')](saveUpdates(_0x20e4c1[_0xe97e('0x4d')],null))['then'](respondWithResult(_0xdeab2a,null))['catch'](handleError(_0xdeab2a,null));};exports[_0xe97e('0x2b')]=function(_0x4f061c,_0x30984b){return db[_0xe97e('0x31')]['find']({'where':{'id':_0x4f061c['params']['id']}})[_0xe97e('0x2a')](handleEntityNotFound(_0x30984b,null))[_0xe97e('0x2a')](removeEntity(_0x30984b,null))[_0xe97e('0x49')](handleError(_0x30984b,null));};exports[_0xe97e('0x4e')]=function(_0x1ea662,_0x1f60e0){var _0x236cd8;return db[_0xe97e('0x4f')][_0xe97e('0x50')](function(_0x3610e8){return db[_0xe97e('0x31')][_0xe97e('0x4e')](_0x1ea662['body'],{'transaction':_0x3610e8})['then'](function(_0x58a908){_0x236cd8=_0x58a908;var _0x546b13={'type':db['Sequelize'][_0xe97e('0x51')],'transaction':_0x3610e8};switch(_0x1ea662['body'][_0xe97e('0x43')]){case _0xe97e('0x52'):_0x546b13[_0xe97e('0x43')]=db[_0xe97e('0x53')][_0xe97e('0x51')];break;case _0xe97e('0x54'):_0x546b13[_0xe97e('0x43')]=db[_0xe97e('0x53')]['INTEGER'];break;case _0xe97e('0x55'):_0x546b13['type']=db[_0xe97e('0x53')]['BOOLEAN'];_0x546b13[_0xe97e('0x56')]=![];break;default:}return db[_0xe97e('0x4f')][_0xe97e('0x57')][_0xe97e('0x58')](_0xe97e('0x59'),util[_0xe97e('0x5a')]('cf_%d',_0x236cd8['id']),_0x546b13);})[_0xe97e('0x2a')](function(){return _0x236cd8;});})[_0xe97e('0x2a')](respondWithResult(_0x1f60e0,0xc9))[_0xe97e('0x49')](handleError(_0x1f60e0,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 29fae70..3d514d7 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 _0x4360=['util','../../config/logger','api','bluebird','path','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash'];(function(_0x5ef8e7,_0x319734){var _0x44dbf4=function(_0x525a99){while(--_0x525a99){_0x5ef8e7['push'](_0x5ef8e7['shift']());}};_0x44dbf4(++_0x319734);}(_0x4360,0x1f3));var _0x0436=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4360[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x0436('0x0'));var util=require(_0x0436('0x1'));var logger=require(_0x0436('0x2'))(_0x0436('0x3'));var moment=require('moment');var BPromise=require(_0x0436('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0436('0x5'));var rimraf=require('rimraf');var config=require(_0x0436('0x6'));var attributes=require(_0x0436('0x7'));module['exports']=function(_0x240d5f,_0xfa13ab){return _0x240d5f['define'](_0x0436('0x8'),attributes,{'tableName':_0x0436('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab95=['cm_custom_fields','lodash','api','moment','request-promise','path','rimraf','exports','CmCustomField'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xab95,0xb5));var _0x5ab9=function(_0x8ac0d0,_0x21a1ba){_0x8ac0d0=_0x8ac0d0-0x0;var _0x42da79=_0xab95[_0x8ac0d0];return _0x42da79;};'use strict';var _=require(_0x5ab9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5ab9('0x1'));var moment=require(_0x5ab9('0x2'));var BPromise=require('bluebird');var rp=require(_0x5ab9('0x3'));var fs=require('fs');var path=require(_0x5ab9('0x4'));var rimraf=require(_0x5ab9('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x5ab9('0x6')]=function(_0x4c9daa,_0x570e78){return _0x4c9daa['define'](_0x5ab9('0x7'),attributes,{'tableName':_0x5ab9('0x8'),'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 54d08ed..e4e328c 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 _0x50d9=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x418760,_0x219c2f){var _0xc02e59=function(_0x589e2f){while(--_0x589e2f){_0x418760['push'](_0x418760['shift']());}};_0xc02e59(++_0x219c2f);}(_0x50d9,0xdb));var _0x950d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x50d9[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0x950d('0x0'));var moment=require('moment');var BPromise=require(_0x950d('0x1'));var rs=require(_0x950d('0x2'));var fs=require('fs');var Redis=require(_0x950d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x950d('0x4'));var logger=require(_0x950d('0x5'))(_0x950d('0x6'));var config=require('../../config/environment');var jayson=require(_0x950d('0x7'));var client=jayson['client'][_0x950d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3307a6,_0x2efc00,_0x5cea59){return new BPromise(function(_0x2b7646,_0x349df5){return client[_0x950d('0x9')](_0x3307a6,_0x5cea59)['then'](function(_0x2e99cc){logger['info'](_0x950d('0xa'),_0x2efc00,_0x950d('0xb'));logger[_0x950d('0xc')](_0x950d('0xd'),_0x2efc00,_0x950d('0xb'),JSON[_0x950d('0xe')](_0x2e99cc));if(_0x2e99cc[_0x950d('0xf')]){if(_0x2e99cc[_0x950d('0xf')][_0x950d('0x10')]===0x1f4){logger[_0x950d('0xf')](_0x950d('0xa'),_0x2efc00,_0x2e99cc[_0x950d('0xf')][_0x950d('0x11')]);return _0x349df5(_0x2e99cc[_0x950d('0xf')]['message']);}logger[_0x950d('0xf')](_0x950d('0xa'),_0x2efc00,_0x2e99cc[_0x950d('0xf')][_0x950d('0x11')]);return _0x2b7646(_0x2e99cc[_0x950d('0xf')][_0x950d('0x11')]);}else{logger['info'](_0x950d('0xa'),_0x2efc00,_0x950d('0xb'));_0x2b7646(_0x2e99cc[_0x950d('0x12')]['message']);}})[_0x950d('0x13')](function(_0x585821){logger[_0x950d('0xf')](_0x950d('0xa'),_0x2efc00,_0x585821);_0x349df5(_0x585821);});});} \ No newline at end of file +var _0xab12=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x14ff87,_0x3ae56b){var _0x18ef95=function(_0x2aeae6){while(--_0x2aeae6){_0x14ff87['push'](_0x14ff87['shift']());}};_0x18ef95(++_0x3ae56b);}(_0xab12,0x14a));var _0x2ab1=function(_0x260a72,_0x27738f){_0x260a72=_0x260a72-0x0;var _0x14dbca=_0xab12[_0x260a72];return _0x14dbca;};'use strict';var _=require(_0x2ab1('0x0'));var util=require(_0x2ab1('0x1'));var moment=require(_0x2ab1('0x2'));var BPromise=require(_0x2ab1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ab1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2ab1('0x5'))(_0x2ab1('0x6'));var config=require(_0x2ab1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2ab1('0x8')][_0x2ab1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2450ec,_0x46402c,_0x3b103a){return new BPromise(function(_0xffb011,_0x4087a8){return client[_0x2ab1('0xa')](_0x2450ec,_0x3b103a)[_0x2ab1('0xb')](function(_0x2d8751){logger[_0x2ab1('0xc')](_0x2ab1('0xd'),_0x46402c,_0x2ab1('0xe'));logger[_0x2ab1('0xf')](_0x2ab1('0x10'),_0x46402c,_0x2ab1('0xe'),JSON[_0x2ab1('0x11')](_0x2d8751));if(_0x2d8751[_0x2ab1('0x12')]){if(_0x2d8751['error'][_0x2ab1('0x13')]===0x1f4){logger['error'](_0x2ab1('0xd'),_0x46402c,_0x2d8751[_0x2ab1('0x12')][_0x2ab1('0x14')]);return _0x4087a8(_0x2d8751[_0x2ab1('0x12')][_0x2ab1('0x14')]);}logger[_0x2ab1('0x12')](_0x2ab1('0xd'),_0x46402c,_0x2d8751[_0x2ab1('0x12')][_0x2ab1('0x14')]);return _0xffb011(_0x2d8751[_0x2ab1('0x12')][_0x2ab1('0x14')]);}else{logger[_0x2ab1('0xc')]('CmCustomField,\x20%s,\x20%s',_0x46402c,_0x2ab1('0xe'));_0xffb011(_0x2d8751[_0x2ab1('0x15')][_0x2ab1('0x14')]);}})[_0x2ab1('0x16')](function(_0x2d6d68){logger[_0x2ab1('0x12')](_0x2ab1('0xd'),_0x46402c,_0x2d6d68);_0x4087a8(_0x2d6d68);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0780ab8..40240a8 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 _0x8f23=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x17cffd,_0x2e92ca){var _0x54b404=function(_0x117995){while(--_0x117995){_0x17cffd['push'](_0x17cffd['shift']());}};_0x54b404(++_0x2e92ca);}(_0x8f23,0x1e5));var _0x38f2=function(_0x42f8e3,_0x4f76d1){_0x42f8e3=_0x42f8e3-0x0;var _0x5dd259=_0x8f23[_0x42f8e3];return _0x5dd259;};'use strict';var multer=require(_0x38f2('0x0'));var util=require(_0x38f2('0x1'));var path=require(_0x38f2('0x2'));var timeout=require(_0x38f2('0x3'));var express=require(_0x38f2('0x4'));var router=express[_0x38f2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x38f2('0x6'));var config=require(_0x38f2('0x7'));var controller=require(_0x38f2('0x8'));router[_0x38f2('0x9')]('/',auth[_0x38f2('0xa')](),controller[_0x38f2('0xb')]);router[_0x38f2('0x9')](_0x38f2('0xc'),auth['isAuthenticated'](),controller[_0x38f2('0xd')]);router[_0x38f2('0xe')]('/',auth[_0x38f2('0xa')](),controller[_0x38f2('0xf')]);router[_0x38f2('0x10')](_0x38f2('0xc'),auth[_0x38f2('0xa')](),controller[_0x38f2('0x11')]);router[_0x38f2('0x12')](_0x38f2('0xc'),auth[_0x38f2('0xa')](),controller[_0x38f2('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8f53=['index','/:id','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','./cmCustomField.controller','get','isAuthenticated'];(function(_0xd06b93,_0x4b1590){var _0x101dbb=function(_0xae7ff8){while(--_0xae7ff8){_0xd06b93['push'](_0xd06b93['shift']());}};_0x101dbb(++_0x4b1590);}(_0x8f53,0x128));var _0x38f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f53[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var path=require(_0x38f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x38f5('0x3')]();var fs_extra=require(_0x38f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38f5('0x5'));router[_0x38f5('0x6')]('/',auth[_0x38f5('0x7')](),controller[_0x38f5('0x8')]);router[_0x38f5('0x6')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xa')]);router[_0x38f5('0xb')]('/',auth['isAuthenticated'](),controller[_0x38f5('0xc')]);router['put']('/:id',auth[_0x38f5('0x7')](),controller[_0x38f5('0xd')]);router[_0x38f5('0xe')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xf')]);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 2f75e19..9fa89bc 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 _0x4213=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x2a8841,_0x355633){var _0x164f64=function(_0x5f29e2){while(--_0x5f29e2){_0x2a8841['push'](_0x2a8841['shift']());}};_0x164f64(++_0x355633);}(_0x4213,0x77));var _0x3421=function(_0x32a424,_0x15ea7d){_0x32a424=_0x32a424-0x0;var _0x3884e8=_0x4213[_0x32a424];return _0x3884e8;};'use strict';var moment=require(_0x3421('0x0'));var Sequelize=require(_0x3421('0x1'));module[_0x3421('0x2')]={'phone':{'type':Sequelize[_0x3421('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3421('0x5')],'defaultValue':moment()[_0x3421('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3421('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3421('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3421('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3421('0x7')],'unique':_0x3421('0x9')},'ListId':{'type':Sequelize[_0x3421('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3421('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3421('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3421('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3421('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xadb5=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN'];(function(_0x13f3f8,_0x6e0e18){var _0x249947=function(_0x20cb4c){while(--_0x20cb4c){_0x13f3f8['push'](_0x13f3f8['shift']());}};_0x249947(++_0x6e0e18);}(_0xadb5,0xad));var _0x5adb=function(_0x1086cb,_0x2989d2){_0x1086cb=_0x1086cb-0x0;var _0x31bb65=_0xadb5[_0x1086cb];return _0x31bb65;};'use strict';var moment=require('moment');var Sequelize=require(_0x5adb('0x0'));module['exports']={'phone':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5adb('0x3')],'defaultValue':moment()['format'](_0x5adb('0x4'))},'countbusyretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5adb('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5adb('0x3')]},'priority':{'type':Sequelize[_0x5adb('0x5')](0x2)[_0x5adb('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'ListId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'UserId':{'type':Sequelize[_0x5adb('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'CampaignId':{'type':Sequelize[_0x5adb('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x5adb('0x3')],'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 595c4e3..0b967e6 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 _0xc997=['CmCompany','List','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','api','json','undefined','limit','count','offset','set','Content-Range','then','error','stack','name','status','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','concat','$and','$or','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','CmHopper','findAll','rows','catch','params','create','update','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','statedesc','deleted','membername','user','UserId','deletedat','format','calleridnum','phone','ivr','CmContact','ContactId','firstName','lastName','calleridname','isNil','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','Queue','dialActive','recallme'];(function(_0x429c05,_0x107a0d){var _0x31bc9e=function(_0x51b296){while(--_0x51b296){_0x429c05['push'](_0x429c05['shift']());}};_0x31bc9e(++_0x107a0d);}(_0xc997,0x91));var _0x7c99=function(_0x4f12ee,_0xbe8277){_0x4f12ee=_0x4f12ee-0x0;var _0x4b0fe2=_0xc997[_0x4f12ee];return _0x4b0fe2;};'use strict';var moment=require('moment');var _=require(_0x7c99('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x271a71,_0x265fb4){_0x265fb4=_0x265fb4||0xc8;return function(_0x5b5893){if(_0x5b5893){return _0x271a71['status'](_0x265fb4)[_0x7c99('0x3')](_0x5b5893);}};}function respondWithFilteredResult(_0x4470dd,_0x2b2407){return function(_0x1868be){if(_0x1868be){var _0x2b8ced=typeof _0x2b2407['offset']===_0x7c99('0x4')&&typeof _0x2b2407[_0x7c99('0x5')]===_0x7c99('0x4');var _0x425e88=_0x1868be[_0x7c99('0x6')];var _0xe57c08=_0x2b8ced?0x0:_0x2b2407[_0x7c99('0x7')];var _0x22c6a0=_0x2b8ced?_0x1868be['count']:_0x2b2407[_0x7c99('0x7')]+_0x2b2407['limit'];var _0x446f5a;if(_0x22c6a0>=_0x425e88){_0x22c6a0=_0x425e88;_0x446f5a=0xc8;}else{_0x446f5a=0xce;}_0x4470dd['status'](_0x446f5a);return _0x4470dd[_0x7c99('0x8')](_0x7c99('0x9'),_0xe57c08+'-'+_0x22c6a0+'/'+_0x425e88)[_0x7c99('0x3')](_0x1868be);}return null;};}function saveUpdates(_0x51277d,_0x32e3e5){return function(_0x250ee9){if(_0x250ee9){return _0x250ee9['update'](_0x51277d)[_0x7c99('0xa')](function(_0x20c23c){return _0x20c23c;});}return null;};}function handleEntityNotFound(_0xcc33d2,_0x408f35){return function(_0x461bac){if(!_0x461bac){_0xcc33d2['sendStatus'](0x194);}return _0x461bac;};}function handleError(_0x36eecf,_0x2e1e6b){_0x2e1e6b=_0x2e1e6b||0x1f4;return function(_0x265089){logger[_0x7c99('0xb')](_0x265089[_0x7c99('0xc')]);if(_0x265089[_0x7c99('0xd')]){delete _0x265089[_0x7c99('0xd')];}_0x36eecf[_0x7c99('0xe')](_0x2e1e6b)[_0x7c99('0xf')](_0x265089);};}exports[_0x7c99('0x10')]=function(_0x432b11,_0x15fff6){var _0x5df1c1={},_0x2af5d5={},_0xb95d1a={'count':0x0,'rows':[]};var _0x547cd8=_[_0x7c99('0x11')](db['CmHopper'][_0x7c99('0x12')],function(_0x3c864b){return{'name':_0x3c864b[_0x7c99('0x13')],'type':_0x3c864b['type'][_0x7c99('0x14')]};});_0x2af5d5[_0x7c99('0x15')]=_[_0x7c99('0x11')](_0x547cd8,_0x7c99('0xd'));_0x2af5d5['query']=_[_0x7c99('0x16')](_0x432b11[_0x7c99('0x17')]);_0x2af5d5[_0x7c99('0x18')]=_[_0x7c99('0x19')](_0x2af5d5[_0x7c99('0x15')],_0x2af5d5[_0x7c99('0x17')]);_0x2af5d5['filters']=_[_0x7c99('0x1a')](_0x2af5d5['filters'],[_0x7c99('0x1b'),_0x7c99('0x1c'),'$gt',_0x7c99('0x1d'),'$lt',_0x7c99('0x1e'),'$ne',_0x7c99('0x1f'),_0x7c99('0x20'),_0x7c99('0x21'),_0x7c99('0x22'),_0x7c99('0x23'),_0x7c99('0x24'),'$like',_0x7c99('0x25'),_0x7c99('0x26'),_0x7c99('0x27'),'$like','$overlap',_0x7c99('0x28'),_0x7c99('0x29'),_0x7c99('0x2a')]);_0x5df1c1[_0x7c99('0x2b')]=_[_0x7c99('0x19')](_0x2af5d5[_0x7c99('0x15')],qs[_0x7c99('0x2c')](_0x432b11['query'][_0x7c99('0x2c')]));_0x5df1c1[_0x7c99('0x2b')]=_0x5df1c1[_0x7c99('0x2b')][_0x7c99('0x2d')]?_0x5df1c1[_0x7c99('0x2b')]:_0x2af5d5['model'];if(!_0x432b11[_0x7c99('0x17')]['hasOwnProperty'](_0x7c99('0x2e'))){_0x5df1c1[_0x7c99('0x5')]=qs[_0x7c99('0x5')](_0x432b11[_0x7c99('0x17')][_0x7c99('0x5')]);_0x5df1c1[_0x7c99('0x7')]=qs[_0x7c99('0x7')](_0x432b11['query'][_0x7c99('0x7')]);}_0x5df1c1[_0x7c99('0x2f')]=qs[_0x7c99('0x30')](_0x432b11[_0x7c99('0x17')][_0x7c99('0x30')]);_0x5df1c1['where']=qs[_0x7c99('0x18')](_[_0x7c99('0x31')](_0x432b11[_0x7c99('0x17')],_0x2af5d5[_0x7c99('0x18')]),_0x547cd8);if(_0x432b11[_0x7c99('0x17')][_0x7c99('0x32')]){_0x5df1c1[_0x7c99('0x33')]=_[_0x7c99('0x34')](_0x5df1c1[_0x7c99('0x33')],{'$or':_['map'](_0x547cd8,function(_0xdf2f5e){if(_0xdf2f5e[_0x7c99('0x35')]!==_0x7c99('0x36')){var _0x401c16={};_0x401c16[_0xdf2f5e[_0x7c99('0xd')]]={'$like':'%'+_0x432b11[_0x7c99('0x17')][_0x7c99('0x32')]+'%'};return _0x401c16;}})});}_0x5df1c1=_['merge']({},_0x5df1c1,_0x432b11[_0x7c99('0x37')]);var _0x19d809={'where':_0x5df1c1[_0x7c99('0x33')]};return db['CmHopper'][_0x7c99('0x6')](_0x19d809)[_0x7c99('0xa')](function(_0x5a116d){_0xb95d1a[_0x7c99('0x6')]=_0x5a116d;if(_0x432b11[_0x7c99('0x17')]['includeAll']){_0x5df1c1[_0x7c99('0x38')]=[{'all':!![]}];}return db[_0x7c99('0x39')][_0x7c99('0x3a')](_0x5df1c1);})[_0x7c99('0xa')](function(_0x5ae30c){_0xb95d1a[_0x7c99('0x3b')]=_0x5ae30c;return _0xb95d1a;})['then'](respondWithFilteredResult(_0x15fff6,_0x5df1c1))[_0x7c99('0x3c')](handleError(_0x15fff6,null));};exports['show']=function(_0x56822e,_0x45fc7e){var _0x476589={'raw':!![],'where':{'id':_0x56822e[_0x7c99('0x3d')]['id']}},_0x30a181={};_0x30a181[_0x7c99('0x15')]=_['keys'](db['CmHopper'][_0x7c99('0x12')]);_0x30a181[_0x7c99('0x17')]=_[_0x7c99('0x16')](_0x56822e[_0x7c99('0x17')]);_0x30a181[_0x7c99('0x18')]=_[_0x7c99('0x19')](_0x30a181['model'],_0x30a181['query']);_0x476589[_0x7c99('0x2b')]=_[_0x7c99('0x19')](_0x30a181[_0x7c99('0x15')],qs[_0x7c99('0x2c')](_0x56822e[_0x7c99('0x17')]['fields']));_0x476589['attributes']=_0x476589[_0x7c99('0x2b')][_0x7c99('0x2d')]?_0x476589['attributes']:_0x30a181[_0x7c99('0x15')];if(_0x56822e[_0x7c99('0x17')]['includeAll']){_0x476589[_0x7c99('0x38')]=[{'all':!![]}];}_0x476589=_['merge']({},_0x476589,_0x56822e[_0x7c99('0x37')]);return db[_0x7c99('0x39')]['find'](_0x476589)[_0x7c99('0xa')](handleEntityNotFound(_0x45fc7e,null))['then'](respondWithResult(_0x45fc7e,null))[_0x7c99('0x3c')](handleError(_0x45fc7e,null));};exports[_0x7c99('0x3e')]=function(_0x141d25,_0x3a0988){return db[_0x7c99('0x39')][_0x7c99('0x3e')](_0x141d25['body'],{})[_0x7c99('0xa')](respondWithResult(_0x3a0988,0xc9))[_0x7c99('0x3c')](handleError(_0x3a0988,null));};exports[_0x7c99('0x3f')]=function(_0x2015b7,_0x1cf329){if(_0x2015b7['body']['id']){delete _0x2015b7[_0x7c99('0x40')]['id'];}return db[_0x7c99('0x39')][_0x7c99('0x41')]({'where':{'id':_0x2015b7[_0x7c99('0x3d')]['id']}})[_0x7c99('0xa')](handleEntityNotFound(_0x1cf329,null))[_0x7c99('0xa')](saveUpdates(_0x2015b7[_0x7c99('0x40')],null))['then'](respondWithResult(_0x1cf329,null))[_0x7c99('0x3c')](handleError(_0x1cf329,null));};exports[_0x7c99('0x42')]=function(_0x17f5bb,_0x49f6b6){return db['CmHopper']['describe']()[_0x7c99('0xa')](respondWithResult(_0x49f6b6,null))[_0x7c99('0x3c')](handleError(_0x49f6b6,null));};exports[_0x7c99('0x43')]=function(_0x4bddf6,_0x4f7840){var _0x8bdb93;return db[_0x7c99('0x39')][_0x7c99('0x41')]({'where':{'id':_0x4bddf6[_0x7c99('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4f7840,null))[_0x7c99('0xa')](function(_0x2fabbf){if(_0x2fabbf){return _0x2fabbf['destroy']()[_0x7c99('0xa')](function(_0x267fe0){return _0x267fe0;});}})[_0x7c99('0xa')](function(_0xf51a0){_0x8bdb93=_0xf51a0;if(_0xf51a0){if(_0xf51a0[_0x7c99('0x44')]||_0xf51a0[_0x7c99('0x45')]){return db[_0xf51a0[_0x7c99('0x44')]?_0x7c99('0x46'):_0x7c99('0x47')][_0x7c99('0x41')]({'where':{'id':_0xf51a0['VoiceQueueId']?_0xf51a0[_0x7c99('0x44')]:_0xf51a0['CampaignId']},'attributes':['id',_0x7c99('0xd')],'raw':!![]});}}})[_0x7c99('0xa')](function(_0x212783){var _0x38e861={};if(_0x212783){_[_0x7c99('0x34')](_0x38e861,_[_0x7c99('0x48')](_0x8bdb93['dataValues'],[_0x7c99('0x49'),_0x7c99('0x4a'),'id']));_0x38e861['state']=0x15;_0x38e861[_0x7c99('0x4b')]=_0x7c99('0x4c');_0x38e861['campaign']=_0x212783[_0x7c99('0xd')];_0x38e861[_0x7c99('0x4d')]=_0x4bddf6[_0x7c99('0x4e')][_0x7c99('0xd')];_0x38e861[_0x7c99('0x4f')]=_0x4bddf6[_0x7c99('0x4e')]['id'];_0x38e861['deleted']=!![];_0x38e861[_0x7c99('0x50')]=moment()[_0x7c99('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e861[_0x7c99('0x52')]=_0x8bdb93[_0x7c99('0x53')];_0x38e861['campaigntype']=_0x8bdb93[_0x7c99('0x44')]?'queue':_0x7c99('0x54');return db[_0x7c99('0x55')][_0x7c99('0x41')]({'where':{'id':_0x38e861[_0x7c99('0x56')]},'attributes':[_0x7c99('0x57'),_0x7c99('0x58')]})[_0x7c99('0xa')](function(_0x346bfe){if(!_['isNil'](_0x4f7840)&&!_['isNil'](_0x346bfe[_0x7c99('0x57')])){_0x38e861[_0x7c99('0x59')]=_0x346bfe[_0x7c99('0x57')];if(!_[_0x7c99('0x5a')](_0x346bfe['lastName'])){_0x38e861[_0x7c99('0x59')]+='\x20'+_0x346bfe[_0x7c99('0x58')];}}})[_0x7c99('0x5b')](function(){return db[_0x7c99('0x5c')]['create'](_0x38e861);});}})[_0x7c99('0xa')](function(){return _0x4f7840['status'](0xcc)['end']();})['catch'](handleError(_0x4f7840,null));};exports[_0x7c99('0x5d')]=function(_0x181dcf,_0x495789){var _0x45b123=[];return db['CmContact'][_0x7c99('0x42')]()[_0x7c99('0xa')](function(_0x25ea93){_0x45b123=_[_0x7c99('0x16')](_0x25ea93);return _0x181dcf['user'][_0x7c99('0x5e')]({'where':{'type':_0x7c99('0x5f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0x7c99('0x60')],'raw':!![]});})[_0x7c99('0xa')](function(_0x198116){if(_0x198116&&_0x198116['length']){return db[_0x7c99('0x61')][_0x7c99('0x62')](function(_0x50b20d){var _0x12c521={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7c99('0x51')](_0x7c99('0x63'))},'VoiceQueueId':{'$in':_['map'](_0x198116,'id')},'$or':[{'UserId':null},{'UserId':_0x181dcf[_0x7c99('0x4e')]['id']}]};var _0x32d616={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x198116)['filter'](['dialPreviewAutoRecallMe',0x0])[_0x7c99('0x11')]('id')[_0x7c99('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x181dcf[_0x7c99('0x4e')]['id']}]};var _0x4670ff={'$or':[_0x12c521,_0x32d616]};var _0x145cab=[];if(_0x181dcf[_0x7c99('0x40')][_0x7c99('0x65')]&&_0x181dcf[_0x7c99('0x40')]['direction']==='prev'){if(!_[_0x7c99('0x66')](_0x181dcf['body'][_0x7c99('0x67')])){_0x4670ff['id']={'$in':_0x181dcf[_0x7c99('0x40')][_0x7c99('0x67')]};}_0x145cab=[[_0x7c99('0x68'),_0x7c99('0x69')],['scheduledAt',_0x198116[0x0][_0x7c99('0x6a')]===_0x7c99('0x69')?'DESC':'ASC'],db['sequelize'][_0x7c99('0x6b')](_0x7c99('0x6c')),['id','DESC']];}else{if(!_[_0x7c99('0x66')](_0x181dcf[_0x7c99('0x40')][_0x7c99('0x67')])){_0x4670ff['id']={'$notIn':_0x181dcf['body']['hopperIds']};}_0x145cab=[[_0x7c99('0x68'),_0x7c99('0x6d')],[_0x7c99('0x6e'),_0x198116[0x0][_0x7c99('0x6a')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x7c99('0x69')]];}return db['CmHopper'][_0x7c99('0x6f')]({'attributes':['id',_0x7c99('0x70'),'recallme'],'where':_0x4670ff,'order':_0x145cab,'transaction':_0x50b20d,'lock':_0x50b20d[_0x7c99('0x71')][_0x7c99('0x72')],'include':[{'model':db['CmContact'],'as':_0x7c99('0x73'),'attributes':_0x45b123,'include':[{'model':db['CmCompany'],'as':_0x7c99('0x74'),'attributes':['id',_0x7c99('0xd')]}]},{'model':db[_0x7c99('0x75')],'as':'List','attributes':['id',_0x7c99('0xd')]},{'model':db['VoiceQueue'],'as':_0x7c99('0x76'),'attributes':['id',_0x7c99('0xd'),_0x7c99('0x77')]}]})[_0x7c99('0xa')](function(_0x44a7b8){if(_0x44a7b8){return _0x44a7b8[_0x7c99('0x3f')]({'UserId':_0x181dcf['user']['id']},{'transaction':_0x50b20d});}});});}})['then'](handleEntityNotFound(_0x495789,null))['then'](respondWithResult(_0x495789,null))[_0x7c99('0x3c')](handleError(_0x495789,null));};exports['getPreviewRecall']=function(_0x5acf18,_0xecca93,_0x2c90c1){var _0x43b0dc=[];var _0x6db421=_0x5acf18['params']['id'];var _0x30ab88=_0x5acf18[_0x7c99('0x4e')]['id'];return db[_0x7c99('0x55')][_0x7c99('0x42')]()[_0x7c99('0xa')](function(_0x448a65){_0x43b0dc=_['keys'](_0x448a65);return db['sequelize'][_0x7c99('0x62')](function(_0xdd42e1){const _0x3e6c7e={'id':_0x6db421};return db['CmHopper']['findOne']({'attributes':['id',_0x7c99('0x70'),_0x7c99('0x78')],'where':_0x3e6c7e,'transaction':_0xdd42e1,'lock':_0xdd42e1['LOCK'][_0x7c99('0x72')],'include':[{'model':db[_0x7c99('0x55')],'as':_0x7c99('0x73'),'attributes':_0x43b0dc,'include':[{'model':db[_0x7c99('0x79')],'as':_0x7c99('0x74'),'attributes':['id',_0x7c99('0xd')]}]},{'model':db['CmList'],'as':_0x7c99('0x7a'),'attributes':['id',_0x7c99('0xd')]},{'model':db['VoiceQueue'],'as':_0x7c99('0x76'),'attributes':['id',_0x7c99('0xd'),_0x7c99('0x77')]}]})[_0x7c99('0xa')](function(_0x12ffe0){if(_0x12ffe0){return _0x12ffe0['update']({'UserId':_0x30ab88},{'transaction':_0xdd42e1});}});});})[_0x7c99('0xa')](handleEntityNotFound(_0xecca93,null))[_0x7c99('0xa')](respondWithResult(_0xecca93,null))[_0x7c99('0x3c')](handleError(_0xecca93,null));};exports[_0x7c99('0x7b')]=function(_0x1ec692,_0x4309d3){return _0x1ec692['user']['getVoiceQueues']({'where':{'type':_0x7c99('0x5f'),'dialActive':!![],'dialMethod':_0x7c99('0x7c')},'attributes':['id'],'raw':!![]})[_0x7c99('0xa')](function(_0x40b2c4){if(_0x40b2c4&&_0x40b2c4[_0x7c99('0x2d')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7c99('0x51')](_0x7c99('0x63'))},'VoiceQueueId':{'$in':_[_0x7c99('0x11')](_0x40b2c4,'id')},'$or':[{'UserId':null},{'UserId':_0x1ec692[_0x7c99('0x4e')]['id']}]}});}return 0x0;})[_0x7c99('0xa')](function(_0x15878c){if(!_[_0x7c99('0x5a')](_0x15878c)&&_[_0x7c99('0x7d')](_0x15878c)){return _0x4309d3[_0x7c99('0xe')](0xc8)[_0x7c99('0x3')]({'contacts':_0x15878c});}else{logger[_0x7c99('0xb')](_0x7c99('0x7e'),_0x7c99('0x7b'),0x194,_0x7c99('0x7f'));_0x4309d3[_0x7c99('0x80')](0x194);}})[_0x7c99('0x3c')](handleError(_0x4309d3,null));};exports['getTimezones']=function(_0xbf2820,_0x4ecf70){var _0x1a8b53=shared[_0x7c99('0x81')];var _0x1a6bd8=[];_['map'](_0x1a8b53,function(_0x3cb011){_0x1a6bd8[_0x7c99('0x82')]({'id':_0x3cb011[_0x7c99('0xd')],'name':_0x3cb011[_0x7c99('0xd')],'utcOffset':_0x3cb011[_0x7c99('0x83')]});});return _0x4ecf70[_0x7c99('0xe')](0xc8)['json']({'tz':_0x1a6bd8});};exports[_0x7c99('0x84')]=function(_0x1b10df,_0x1cf72a){var _0x3cb8a2=shared[_0x7c99('0x81')];var _0x2fb27d={};if(!_['isNil'](_0x3cb8a2[_0x1b10df[_0x7c99('0x40')]['id']]))_0x2fb27d=_0x3cb8a2[_0x1b10df[_0x7c99('0x40')]['id']];return _0x1cf72a[_0x7c99('0xe')](0xc8)['json'](_0x2fb27d);}; \ No newline at end of file +var _0x2d98=['state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','end','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','transaction','filter','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','Company','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','undefined','limit','count','offset','set','json','then','sendStatus','error','name','index','map','CmHopper','rawAttributes','model','keys','filters','intersection','query','concat','$and','$or','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','includeAll','include','findAll','catch','show','params','options','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','merge','omit','dataValues','createdAt','updatedAt'];(function(_0x3733b7,_0x145cd8){var _0x454b57=function(_0x32a440){while(--_0x32a440){_0x3733b7['push'](_0x3733b7['shift']());}};_0x454b57(++_0x145cd8);}(_0x2d98,0x14f));var _0x82d9=function(_0x42a279,_0x14bcef){_0x42a279=_0x42a279-0x0;var _0x1cc265=_0x2d98[_0x42a279];return _0x1cc265;};'use strict';var moment=require(_0x82d9('0x0'));var _=require(_0x82d9('0x1'));var qs=require(_0x82d9('0x2'));var logger=require(_0x82d9('0x3'))(_0x82d9('0x4'));var shared=require('../../config/environment');var db=require(_0x82d9('0x5'))['db'];function respondWithResult(_0xd9c9f3,_0x15189e){_0x15189e=_0x15189e||0xc8;return function(_0x905020){if(_0x905020){return _0xd9c9f3[_0x82d9('0x6')](_0x15189e)['json'](_0x905020);}};}function respondWithFilteredResult(_0x10eaee,_0x298fab){return function(_0x394557){if(_0x394557){var _0x8bb5e7=typeof _0x298fab['offset']===_0x82d9('0x7')&&typeof _0x298fab[_0x82d9('0x8')]===_0x82d9('0x7');var _0x1c90f2=_0x394557[_0x82d9('0x9')];var _0x36a4ba=_0x8bb5e7?0x0:_0x298fab[_0x82d9('0xa')];var _0x406faa=_0x8bb5e7?_0x394557[_0x82d9('0x9')]:_0x298fab['offset']+_0x298fab['limit'];var _0x4d7c22;if(_0x406faa>=_0x1c90f2){_0x406faa=_0x1c90f2;_0x4d7c22=0xc8;}else{_0x4d7c22=0xce;}_0x10eaee[_0x82d9('0x6')](_0x4d7c22);return _0x10eaee[_0x82d9('0xb')]('Content-Range',_0x36a4ba+'-'+_0x406faa+'/'+_0x1c90f2)[_0x82d9('0xc')](_0x394557);}return null;};}function saveUpdates(_0x22f953,_0x2452ad){return function(_0x21c82c){if(_0x21c82c){return _0x21c82c['update'](_0x22f953)[_0x82d9('0xd')](function(_0x46b6f1){return _0x46b6f1;});}return null;};}function handleEntityNotFound(_0x1f9567,_0x339ac4){return function(_0x2332b1){if(!_0x2332b1){_0x1f9567[_0x82d9('0xe')](0x194);}return _0x2332b1;};}function handleError(_0x589735,_0x202a0f){_0x202a0f=_0x202a0f||0x1f4;return function(_0x1b7a6d){logger[_0x82d9('0xf')](_0x1b7a6d['stack']);if(_0x1b7a6d[_0x82d9('0x10')]){delete _0x1b7a6d[_0x82d9('0x10')];}_0x589735[_0x82d9('0x6')](_0x202a0f)['send'](_0x1b7a6d);};}exports[_0x82d9('0x11')]=function(_0x4ca067,_0x5617f3){var _0xbfba13={},_0x772b2b={},_0x181b9d={'count':0x0,'rows':[]};var _0x37d58e=_[_0x82d9('0x12')](db[_0x82d9('0x13')][_0x82d9('0x14')],function(_0x45e75d){return{'name':_0x45e75d['fieldName'],'type':_0x45e75d['type']['key']};});_0x772b2b[_0x82d9('0x15')]=_['map'](_0x37d58e,'name');_0x772b2b['query']=_[_0x82d9('0x16')](_0x4ca067['query']);_0x772b2b[_0x82d9('0x17')]=_[_0x82d9('0x18')](_0x772b2b[_0x82d9('0x15')],_0x772b2b[_0x82d9('0x19')]);_0x772b2b[_0x82d9('0x17')]=_[_0x82d9('0x1a')](_0x772b2b[_0x82d9('0x17')],[_0x82d9('0x1b'),_0x82d9('0x1c'),'$gt','$gte',_0x82d9('0x1d'),_0x82d9('0x1e'),_0x82d9('0x1f'),_0x82d9('0x20'),'$not',_0x82d9('0x21'),_0x82d9('0x22'),_0x82d9('0x23'),_0x82d9('0x24'),_0x82d9('0x25'),'$notLike','$iLike','$notILike',_0x82d9('0x25'),_0x82d9('0x26'),_0x82d9('0x27'),_0x82d9('0x28'),_0x82d9('0x29')]);_0xbfba13[_0x82d9('0x2a')]=_['intersection'](_0x772b2b[_0x82d9('0x15')],qs[_0x82d9('0x2b')](_0x4ca067[_0x82d9('0x19')]['fields']));_0xbfba13[_0x82d9('0x2a')]=_0xbfba13[_0x82d9('0x2a')][_0x82d9('0x2c')]?_0xbfba13[_0x82d9('0x2a')]:_0x772b2b[_0x82d9('0x15')];if(!_0x4ca067['query'][_0x82d9('0x2d')](_0x82d9('0x2e'))){_0xbfba13[_0x82d9('0x8')]=qs[_0x82d9('0x8')](_0x4ca067[_0x82d9('0x19')][_0x82d9('0x8')]);_0xbfba13[_0x82d9('0xa')]=qs['offset'](_0x4ca067[_0x82d9('0x19')][_0x82d9('0xa')]);}_0xbfba13[_0x82d9('0x2f')]=qs['sort'](_0x4ca067[_0x82d9('0x19')][_0x82d9('0x30')]);_0xbfba13[_0x82d9('0x31')]=qs[_0x82d9('0x17')](_[_0x82d9('0x32')](_0x4ca067['query'],_0x772b2b[_0x82d9('0x17')]),_0x37d58e);if(_0x4ca067['query']['filter']){_0xbfba13['where']=_['merge'](_0xbfba13[_0x82d9('0x31')],{'$or':_[_0x82d9('0x12')](_0x37d58e,function(_0x45a978){if(_0x45a978[_0x82d9('0x33')]!=='VIRTUAL'){var _0x495a82={};_0x495a82[_0x45a978[_0x82d9('0x10')]]={'$like':'%'+_0x4ca067[_0x82d9('0x19')]['filter']+'%'};return _0x495a82;}})});}_0xbfba13=_['merge']({},_0xbfba13,_0x4ca067['options']);var _0xc8f578={'where':_0xbfba13[_0x82d9('0x31')]};return db[_0x82d9('0x13')][_0x82d9('0x9')](_0xc8f578)[_0x82d9('0xd')](function(_0x4b54d6){_0x181b9d[_0x82d9('0x9')]=_0x4b54d6;if(_0x4ca067[_0x82d9('0x19')][_0x82d9('0x34')]){_0xbfba13[_0x82d9('0x35')]=[{'all':!![]}];}return db['CmHopper'][_0x82d9('0x36')](_0xbfba13);})['then'](function(_0x144bc0){_0x181b9d['rows']=_0x144bc0;return _0x181b9d;})['then'](respondWithFilteredResult(_0x5617f3,_0xbfba13))[_0x82d9('0x37')](handleError(_0x5617f3,null));};exports[_0x82d9('0x38')]=function(_0x2dcefe,_0x4e088c){var _0x4cd4c9={'raw':!![],'where':{'id':_0x2dcefe[_0x82d9('0x39')]['id']}},_0x340797={};_0x340797[_0x82d9('0x15')]=_['keys'](db[_0x82d9('0x13')]['rawAttributes']);_0x340797[_0x82d9('0x19')]=_[_0x82d9('0x16')](_0x2dcefe[_0x82d9('0x19')]);_0x340797[_0x82d9('0x17')]=_[_0x82d9('0x18')](_0x340797[_0x82d9('0x15')],_0x340797['query']);_0x4cd4c9['attributes']=_[_0x82d9('0x18')](_0x340797[_0x82d9('0x15')],qs[_0x82d9('0x2b')](_0x2dcefe[_0x82d9('0x19')][_0x82d9('0x2b')]));_0x4cd4c9[_0x82d9('0x2a')]=_0x4cd4c9[_0x82d9('0x2a')][_0x82d9('0x2c')]?_0x4cd4c9[_0x82d9('0x2a')]:_0x340797[_0x82d9('0x15')];if(_0x2dcefe['query'][_0x82d9('0x34')]){_0x4cd4c9[_0x82d9('0x35')]=[{'all':!![]}];}_0x4cd4c9=_['merge']({},_0x4cd4c9,_0x2dcefe[_0x82d9('0x3a')]);return db[_0x82d9('0x13')][_0x82d9('0x3b')](_0x4cd4c9)[_0x82d9('0xd')](handleEntityNotFound(_0x4e088c,null))[_0x82d9('0xd')](respondWithResult(_0x4e088c,null))[_0x82d9('0x37')](handleError(_0x4e088c,null));};exports[_0x82d9('0x3c')]=function(_0x59fb15,_0x5b9ae1){return db[_0x82d9('0x13')][_0x82d9('0x3c')](_0x59fb15[_0x82d9('0x3d')],{})[_0x82d9('0xd')](respondWithResult(_0x5b9ae1,0xc9))['catch'](handleError(_0x5b9ae1,null));};exports[_0x82d9('0x3e')]=function(_0x1b4561,_0x1c63a8){if(_0x1b4561[_0x82d9('0x3d')]['id']){delete _0x1b4561[_0x82d9('0x3d')]['id'];}return db['CmHopper'][_0x82d9('0x3b')]({'where':{'id':_0x1b4561[_0x82d9('0x39')]['id']}})['then'](handleEntityNotFound(_0x1c63a8,null))[_0x82d9('0xd')](saveUpdates(_0x1b4561['body'],null))[_0x82d9('0xd')](respondWithResult(_0x1c63a8,null))[_0x82d9('0x37')](handleError(_0x1c63a8,null));};exports['describe']=function(_0x21b707,_0x1166b1){return db[_0x82d9('0x13')][_0x82d9('0x3f')]()[_0x82d9('0xd')](respondWithResult(_0x1166b1,null))['catch'](handleError(_0x1166b1,null));};exports[_0x82d9('0x40')]=function(_0x223e83,_0x54f8b1){var _0x356b69;return db[_0x82d9('0x13')]['find']({'where':{'id':_0x223e83[_0x82d9('0x39')]['id']}})[_0x82d9('0xd')](handleEntityNotFound(_0x54f8b1,null))[_0x82d9('0xd')](function(_0x29e00f){if(_0x29e00f){return _0x29e00f[_0x82d9('0x40')]()[_0x82d9('0xd')](function(_0x4cd27a){return _0x4cd27a;});}})[_0x82d9('0xd')](function(_0x5fa608){_0x356b69=_0x5fa608;if(_0x5fa608){if(_0x5fa608[_0x82d9('0x41')]||_0x5fa608[_0x82d9('0x42')]){return db[_0x5fa608[_0x82d9('0x41')]?_0x82d9('0x43'):'Campaign'][_0x82d9('0x3b')]({'where':{'id':_0x5fa608['VoiceQueueId']?_0x5fa608[_0x82d9('0x41')]:_0x5fa608['CampaignId']},'attributes':['id',_0x82d9('0x10')],'raw':!![]});}}})[_0x82d9('0xd')](function(_0x473d88){var _0x278eef={};if(_0x473d88){_[_0x82d9('0x44')](_0x278eef,_[_0x82d9('0x45')](_0x356b69[_0x82d9('0x46')],[_0x82d9('0x47'),_0x82d9('0x48'),'id']));_0x278eef[_0x82d9('0x49')]=0x15;_0x278eef[_0x82d9('0x4a')]=_0x82d9('0x4b');_0x278eef[_0x82d9('0x4c')]=_0x473d88[_0x82d9('0x10')];_0x278eef[_0x82d9('0x4d')]=_0x223e83[_0x82d9('0x4e')][_0x82d9('0x10')];_0x278eef[_0x82d9('0x4f')]=_0x223e83['user']['id'];_0x278eef[_0x82d9('0x4b')]=!![];_0x278eef[_0x82d9('0x50')]=moment()[_0x82d9('0x51')](_0x82d9('0x52'));_0x278eef['calleridnum']=_0x356b69[_0x82d9('0x53')];_0x278eef[_0x82d9('0x54')]=_0x356b69['VoiceQueueId']?_0x82d9('0x55'):_0x82d9('0x56');return db[_0x82d9('0x57')][_0x82d9('0x3b')]({'where':{'id':_0x278eef['ContactId']},'attributes':['firstName','lastName']})[_0x82d9('0xd')](function(_0x5ed4a7){if(!_[_0x82d9('0x58')](_0x54f8b1)&&!_[_0x82d9('0x58')](_0x5ed4a7[_0x82d9('0x59')])){_0x278eef[_0x82d9('0x5a')]=_0x5ed4a7['firstName'];if(!_[_0x82d9('0x58')](_0x5ed4a7[_0x82d9('0x5b')])){_0x278eef['calleridname']+='\x20'+_0x5ed4a7[_0x82d9('0x5b')];}}})[_0x82d9('0x5c')](function(){return db[_0x82d9('0x5d')][_0x82d9('0x3c')](_0x278eef);});}})[_0x82d9('0xd')](function(){return _0x54f8b1[_0x82d9('0x6')](0xcc)[_0x82d9('0x5e')]();})[_0x82d9('0x37')](handleError(_0x54f8b1,null));};exports[_0x82d9('0x5f')]=function(_0x162aae,_0x5c383a){var _0xd94443=[];return db[_0x82d9('0x57')][_0x82d9('0x3f')]()[_0x82d9('0xd')](function(_0x29d28a){_0xd94443=_[_0x82d9('0x16')](_0x29d28a);return _0x162aae[_0x82d9('0x4e')][_0x82d9('0x60')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x82d9('0x61')},'attributes':['id',_0x82d9('0x62'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x16bf13){if(_0x16bf13&&_0x16bf13[_0x82d9('0x2c')]){return db['sequelize'][_0x82d9('0x63')](function(_0x540ace){var _0x3ea738={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x82d9('0x51')](_0x82d9('0x52'))},'VoiceQueueId':{'$in':_[_0x82d9('0x12')](_0x16bf13,'id')},'$or':[{'UserId':null},{'UserId':_0x162aae[_0x82d9('0x4e')]['id']}]};var _0x522184={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x16bf13)[_0x82d9('0x64')]([_0x82d9('0x65'),0x0])[_0x82d9('0x12')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x162aae[_0x82d9('0x4e')]['id']}]};var _0x185487={'$or':[_0x3ea738,_0x522184]};var _0x736946=[];if(_0x162aae[_0x82d9('0x3d')]['direction']&&_0x162aae['body'][_0x82d9('0x66')]===_0x82d9('0x67')){if(!_[_0x82d9('0x68')](_0x162aae[_0x82d9('0x3d')][_0x82d9('0x69')])){_0x185487['id']={'$in':_0x162aae[_0x82d9('0x3d')][_0x82d9('0x69')]};}_0x736946=[[_0x82d9('0x6a'),_0x82d9('0x6b')],[_0x82d9('0x6c'),_0x16bf13[0x0][_0x82d9('0x62')]==='ASC'?_0x82d9('0x6d'):_0x82d9('0x6b')],db[_0x82d9('0x6e')]['literal'](_0x82d9('0x6f')),['id',_0x82d9('0x6d')]];}else{if(!_[_0x82d9('0x68')](_0x162aae[_0x82d9('0x3d')][_0x82d9('0x69')])){_0x185487['id']={'$notIn':_0x162aae[_0x82d9('0x3d')][_0x82d9('0x69')]};}_0x736946=[[_0x82d9('0x6a'),_0x82d9('0x6d')],['scheduledAt',_0x16bf13[0x0]['dialOrderByScheduledAt']],db[_0x82d9('0x6e')][_0x82d9('0x70')](_0x82d9('0x71')),['id','ASC']];}return db[_0x82d9('0x13')][_0x82d9('0x72')]({'attributes':['id',_0x82d9('0x73'),_0x82d9('0x74')],'where':_0x185487,'order':_0x736946,'transaction':_0x540ace,'lock':_0x540ace[_0x82d9('0x75')][_0x82d9('0x76')],'include':[{'model':db['CmContact'],'as':_0x82d9('0x77'),'attributes':_0xd94443,'include':[{'model':db[_0x82d9('0x78')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x82d9('0x79')],'as':_0x82d9('0x7a'),'attributes':['id',_0x82d9('0x10')]},{'model':db['VoiceQueue'],'as':_0x82d9('0x7b'),'attributes':['id','name',_0x82d9('0x7c')]}]})['then'](function(_0xba03e1){if(_0xba03e1){return _0xba03e1['update']({'UserId':_0x162aae[_0x82d9('0x4e')]['id']},{'transaction':_0x540ace});}});});}})[_0x82d9('0xd')](handleEntityNotFound(_0x5c383a,null))[_0x82d9('0xd')](respondWithResult(_0x5c383a,null))[_0x82d9('0x37')](handleError(_0x5c383a,null));};exports[_0x82d9('0x7d')]=function(_0x335c73,_0x2489a5,_0x4aac20){var _0x2b0598=[];var _0x4fc612=_0x335c73[_0x82d9('0x39')]['id'];var _0x22d6b7=_0x335c73[_0x82d9('0x4e')]['id'];return db[_0x82d9('0x57')][_0x82d9('0x3f')]()[_0x82d9('0xd')](function(_0x11f88f){_0x2b0598=_['keys'](_0x11f88f);return db[_0x82d9('0x6e')]['transaction'](function(_0x16098c){const _0x5e903a={'id':_0x4fc612};return db['CmHopper'][_0x82d9('0x72')]({'attributes':['id',_0x82d9('0x73'),_0x82d9('0x74')],'where':_0x5e903a,'transaction':_0x16098c,'lock':_0x16098c[_0x82d9('0x75')][_0x82d9('0x76')],'include':[{'model':db[_0x82d9('0x57')],'as':_0x82d9('0x77'),'attributes':_0x2b0598,'include':[{'model':db[_0x82d9('0x78')],'as':_0x82d9('0x7e'),'attributes':['id',_0x82d9('0x10')]}]},{'model':db[_0x82d9('0x79')],'as':_0x82d9('0x7a'),'attributes':['id','name']},{'model':db[_0x82d9('0x43')],'as':_0x82d9('0x7b'),'attributes':['id','name',_0x82d9('0x7c')]}]})[_0x82d9('0xd')](function(_0x4aaff0){if(_0x4aaff0){return _0x4aaff0[_0x82d9('0x3e')]({'UserId':_0x22d6b7},{'transaction':_0x16098c});}});});})['then'](handleEntityNotFound(_0x2489a5,null))[_0x82d9('0xd')](respondWithResult(_0x2489a5,null))[_0x82d9('0x37')](handleError(_0x2489a5,null));};exports[_0x82d9('0x7f')]=function(_0x2e294f,_0x4434fc){return _0x2e294f[_0x82d9('0x4e')][_0x82d9('0x60')]({'where':{'type':_0x82d9('0x80'),'dialActive':!![],'dialMethod':_0x82d9('0x61')},'attributes':['id'],'raw':!![]})[_0x82d9('0xd')](function(_0x5a17cf){if(_0x5a17cf&&_0x5a17cf[_0x82d9('0x2c')]){return db[_0x82d9('0x13')][_0x82d9('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x82d9('0x51')](_0x82d9('0x52'))},'VoiceQueueId':{'$in':_[_0x82d9('0x12')](_0x5a17cf,'id')},'$or':[{'UserId':null},{'UserId':_0x2e294f[_0x82d9('0x4e')]['id']}]}});}return 0x0;})[_0x82d9('0xd')](function(_0x2e35d2){if(!_[_0x82d9('0x58')](_0x2e35d2)&&_[_0x82d9('0x81')](_0x2e35d2)){return _0x4434fc['status'](0xc8)[_0x82d9('0xc')]({'contacts':_0x2e35d2});}else{logger[_0x82d9('0xf')](_0x82d9('0x82'),_0x82d9('0x7f'),0x194,_0x82d9('0x83'));_0x4434fc['sendStatus'](0x194);}})[_0x82d9('0x37')](handleError(_0x4434fc,null));};exports[_0x82d9('0x84')]=function(_0x3ad38d,_0x528470){var _0x4c5119=shared[_0x82d9('0x85')];var _0x150c83=[];_[_0x82d9('0x12')](_0x4c5119,function(_0x4b6744){_0x150c83[_0x82d9('0x86')]({'id':_0x4b6744[_0x82d9('0x10')],'name':_0x4b6744['name'],'utcOffset':_0x4b6744[_0x82d9('0x87')]});});return _0x528470[_0x82d9('0x6')](0xc8)[_0x82d9('0xc')]({'tz':_0x150c83});};exports['getTimezone']=function(_0x34fc96,_0x157748){var _0x25ee30=shared[_0x82d9('0x85')];var _0x213f49={};if(!_[_0x82d9('0x58')](_0x25ee30[_0x34fc96[_0x82d9('0x3d')]['id']]))_0x213f49=_0x25ee30[_0x34fc96[_0x82d9('0x3d')]['id']];return _0x157748[_0x82d9('0x6')](0xc8)[_0x82d9('0xc')](_0x213f49);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 12601df..edffbd9 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 _0x5d58=['priority','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper','scheduledat','phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d58,0x187));var _0x85d5=function(_0x526e62,_0x1a9b09){_0x526e62=_0x526e62-0x0;var _0x48b5ab=_0x5d58[_0x526e62];return _0x48b5ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./cmHopper.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('CmHopper',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[{'name':_0x85d5('0x7'),'fields':['scheduledat']},{'name':_0x85d5('0x8'),'fields':['phone']},{'name':_0x85d5('0x9'),'fields':[_0x85d5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['util','../../config/logger','api','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','phone'];(function(_0x4baa57,_0x35e052){var _0x2a8eea=function(_0x24e0f1){while(--_0x24e0f1){_0x4baa57['push'](_0x4baa57['shift']());}};_0x2a8eea(++_0x35e052);}(_0x038b,0x114));var _0xb038=function(_0x3b9f1d,_0x1b2d1e){_0x3b9f1d=_0x3b9f1d-0x0;var _0x2c58eb=_0x038b[_0x3b9f1d];return _0x2c58eb;};'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'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xb038('0xb'),'fields':[_0xb038('0xb')]},{'name':'priority','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 44942d6..c49b69b 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 _0x6132=['options','raw','where','attributes','map','include','model','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','UPDATE','Contact','User','length','UserId','push','includes','all','dataValues','sequelize','CmHopperFinal','active','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','\x20MINUTE','Agent','name','CmList','log','NOW()','lodash','util','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetCmHopper','CmHopper','findAll'];(function(_0x1df956,_0xe69448){var _0xf18159=function(_0x1edfc9){while(--_0x1edfc9){_0x1df956['push'](_0x1df956['shift']());}};_0xf18159(++_0xe69448);}(_0x6132,0x13a));var _0x2613=function(_0x1e5c74,_0x523dce){_0x1e5c74=_0x1e5c74-0x0;var _0x535efc=_0x6132[_0x1e5c74];return _0x535efc;};'use strict';var _=require(_0x2613('0x0'));var util=require(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require(_0x2613('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x2613('0x4'))(_0x2613('0x5'));var jayson=require(_0x2613('0x6'));var client=jayson[_0x2613('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8d00d8,_0x4b96c6,_0x59240d){return new BPromise(function(_0x30cac4,_0x309663){return client[_0x2613('0x8')](_0x8d00d8,_0x59240d)[_0x2613('0x9')](function(_0xe295ea){logger['info'](_0x2613('0xa'),_0x4b96c6,_0x2613('0xb'));logger[_0x2613('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4b96c6,_0x2613('0xb'),JSON[_0x2613('0xd')](_0xe295ea));if(_0xe295ea[_0x2613('0xe')]){if(_0xe295ea[_0x2613('0xe')][_0x2613('0xf')]===0x1f4){logger[_0x2613('0xe')](_0x2613('0xa'),_0x4b96c6,_0xe295ea[_0x2613('0xe')][_0x2613('0x10')]);return _0x309663(_0xe295ea[_0x2613('0xe')]['message']);}logger[_0x2613('0xe')](_0x2613('0xa'),_0x4b96c6,_0xe295ea[_0x2613('0xe')][_0x2613('0x10')]);return _0x30cac4(_0xe295ea['error'][_0x2613('0x10')]);}else{logger[_0x2613('0x11')](_0x2613('0xa'),_0x4b96c6,_0x2613('0xb'));_0x30cac4(_0xe295ea['result'][_0x2613('0x10')]);}})[_0x2613('0x12')](function(_0x386686){logger[_0x2613('0xe')]('CmHopper,\x20%s,\x20%s',_0x4b96c6,_0x386686);_0x309663(_0x386686);});});}exports[_0x2613('0x13')]=function(_0x13cdee){var _0x4958c2=this;return new Promise(function(_0x37f961,_0x226197){return db[_0x2613('0x14')][_0x2613('0x15')]({'raw':_0x13cdee[_0x2613('0x16')]?_0x13cdee['options'][_0x2613('0x17')]===undefined?!![]:![]:!![],'where':_0x13cdee[_0x2613('0x16')]?_0x13cdee['options'][_0x2613('0x18')]||null:null,'attributes':_0x13cdee[_0x2613('0x16')]?_0x13cdee[_0x2613('0x16')][_0x2613('0x19')]||null:null,'limit':_0x13cdee['options']?_0x13cdee[_0x2613('0x16')]['limit']||null:null,'include':_0x13cdee['options']?_0x13cdee[_0x2613('0x16')]['include']?_[_0x2613('0x1a')](_0x13cdee[_0x2613('0x16')][_0x2613('0x1b')],function(_0x5b3893){return{'model':db[_0x5b3893['model']],'as':_0x5b3893['as'],'attributes':_0x5b3893[_0x2613('0x19')],'include':_0x5b3893[_0x2613('0x1b')]?_['map'](_0x5b3893[_0x2613('0x1b')],function(_0x25b315){return{'model':db[_0x25b315[_0x2613('0x1c')]],'as':_0x25b315['as'],'attributes':_0x25b315[_0x2613('0x19')],'include':_0x25b315[_0x2613('0x1b')]?_[_0x2613('0x1a')](_0x25b315[_0x2613('0x1b')],function(_0xad2c6c){return{'model':db[_0xad2c6c['model']],'as':_0xad2c6c['as'],'attributes':_0xad2c6c[_0x2613('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2613('0x9')](function(_0x19fb11){logger[_0x2613('0x11')](_0x2613('0x13'),_0x13cdee);logger[_0x2613('0xc')](_0x2613('0x13'),_0x13cdee,JSON[_0x2613('0xd')](_0x19fb11));_0x37f961(_0x19fb11);})[_0x2613('0x12')](function(_0x5c1577){logger[_0x2613('0xe')](_0x2613('0x13'),_0x5c1577[_0x2613('0x10')],_0x13cdee);_0x226197(_0x4958c2[_0x2613('0xe')](0x1f4,_0x5c1577[_0x2613('0x10')]));});});};exports[_0x2613('0x1d')]=function(_0x3fbf0d){var _0x2ee0ac=this;return new Promise(function(_0x5b0c2f,_0x378ee1){return db[_0x2613('0x14')][_0x2613('0x1e')]({'raw':_0x3fbf0d[_0x2613('0x16')]?_0x3fbf0d[_0x2613('0x16')][_0x2613('0x17')]===undefined?!![]:![]:!![],'where':_0x3fbf0d['options']?_0x3fbf0d[_0x2613('0x16')]['where']||null:null,'attributes':_0x3fbf0d[_0x2613('0x16')]?_0x3fbf0d['options'][_0x2613('0x19')]||null:null,'include':_0x3fbf0d['options']?_0x3fbf0d[_0x2613('0x16')][_0x2613('0x1b')]?_[_0x2613('0x1a')](_0x3fbf0d[_0x2613('0x16')][_0x2613('0x1b')],function(_0x51a5b8){return{'model':db[_0x51a5b8[_0x2613('0x1c')]],'as':_0x51a5b8['as'],'attributes':_0x51a5b8[_0x2613('0x19')],'include':_0x51a5b8[_0x2613('0x1b')]?_['map'](_0x51a5b8['include'],function(_0xa6cab2){return{'model':db[_0xa6cab2[_0x2613('0x1c')]],'as':_0xa6cab2['as'],'attributes':_0xa6cab2[_0x2613('0x19')],'include':_0xa6cab2[_0x2613('0x1b')]?_[_0x2613('0x1a')](_0xa6cab2[_0x2613('0x1b')],function(_0x4c0812){return{'model':db[_0x4c0812['model']],'as':_0x4c0812['as'],'attributes':_0x4c0812[_0x2613('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x506097){logger[_0x2613('0x11')](_0x2613('0x1d'),_0x3fbf0d);logger['debug'](_0x2613('0x1d'),_0x3fbf0d,JSON['stringify'](_0x506097));_0x5b0c2f(_0x506097);})[_0x2613('0x12')](function(_0x2e8200){logger['error']('ShowCmHopper',_0x2e8200['message'],_0x3fbf0d);_0x378ee1(_0x2ee0ac[_0x2613('0xe')](0x1f4,_0x2e8200[_0x2613('0x10')]));});});};exports[_0x2613('0x1f')]=function(_0x57d3dc){var _0x3094f3=this;return new Promise(function(_0x3e732a,_0x2f2da3){return db[_0x2613('0x14')][_0x2613('0x20')](_0x57d3dc['body'],{'raw':_0x57d3dc['options']?_0x57d3dc[_0x2613('0x16')][_0x2613('0x17')]===undefined?!![]:![]:!![]})[_0x2613('0x9')](function(_0x4f6b7f){logger['info'](_0x2613('0x1f'),_0x57d3dc);logger[_0x2613('0xc')](_0x2613('0x1f'),_0x57d3dc,JSON['stringify'](_0x4f6b7f));_0x3e732a(_0x4f6b7f);})['catch'](function(_0x4e8ba4){logger[_0x2613('0xe')](_0x2613('0x1f'),_0x4e8ba4[_0x2613('0x10')],_0x57d3dc);_0x2f2da3(_0x3094f3[_0x2613('0xe')](0x1f4,_0x4e8ba4[_0x2613('0x10')]));});});};exports[_0x2613('0x21')]=function(_0x235730){var _0x1fb080=this;return new Promise(function(_0x237218,_0x268cd4){return db[_0x2613('0x14')][_0x2613('0x22')](_0x235730[_0x2613('0x23')],{'raw':_0x235730['options']?_0x235730[_0x2613('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235730[_0x2613('0x16')]?_0x235730[_0x2613('0x16')][_0x2613('0x18')]||null:null,'attributes':_0x235730['options']?_0x235730['options'][_0x2613('0x19')]||null:null,'limit':_0x235730[_0x2613('0x16')]?_0x235730[_0x2613('0x16')][_0x2613('0x24')]||null:null})[_0x2613('0x9')](function(_0x5001d4){logger['info']('UpdateCmHopper',_0x235730);logger[_0x2613('0x11')](_0x2613('0x25'),JSON[_0x2613('0xd')](_0x235730[_0x2613('0x16')]['where']),_0x235730[_0x2613('0x23')]['active']);logger[_0x2613('0xc')]('UpdateCmHopper',_0x235730,JSON['stringify'](_0x5001d4));_0x237218(_0x5001d4);})[_0x2613('0x12')](function(_0x17c1fa){logger[_0x2613('0xe')](_0x2613('0x21'),_0x17c1fa[_0x2613('0x10')],_0x235730);_0x268cd4(_0x1fb080[_0x2613('0xe')](0x1f4,_0x17c1fa[_0x2613('0x10')]));});});};exports[_0x2613('0x26')]=function(_0x50c715){var _0x18aced=this;return new Promise(function(_0x58de75,_0x47f427){return db[_0x2613('0x14')][_0x2613('0x27')]({'where':_0x50c715['options']?_0x50c715[_0x2613('0x16')][_0x2613('0x18')]||null:null})['then'](function(_0x3ae665){logger[_0x2613('0x11')]('DestroyCmHopper',_0x50c715);logger[_0x2613('0xc')]('DestroyCmHopper',_0x50c715,JSON[_0x2613('0xd')](_0x3ae665));_0x58de75(_0x3ae665);})[_0x2613('0x12')](function(_0x2481da){logger['error'](_0x2613('0x26'),_0x2481da['message'],_0x50c715);_0x47f427(_0x18aced[_0x2613('0xe')](0x1f4,_0x2481da['message']));});});};exports[_0x2613('0x28')]=function(_0x6f4f3){var _0x5bd2b7=this;return new Promise(function(_0xaed6aa,_0x1e3565){return db[_0x2613('0x29')][_0x2613('0x2a')]()[_0x2613('0x9')](function(_0x2d8199){return db['sequelize'][_0x2613('0x2b')](function(_0x23a0d1){return db[_0x2613('0x14')][_0x2613('0x15')]({'where':_0x6f4f3[_0x2613('0x16')]?_0x6f4f3['options'][_0x2613('0x18')]||null:null,'attributes':_0x6f4f3[_0x2613('0x16')]?_0x6f4f3[_0x2613('0x16')][_0x2613('0x19')]||null:null,'limit':_0x6f4f3['options']?_0x6f4f3[_0x2613('0x16')]['limit']||null:null,'order':_0x6f4f3[_0x2613('0x16')]?_0x6f4f3[_0x2613('0x16')][_0x2613('0x2c')]||null:null,'transaction':_0x23a0d1,'lock':_0x23a0d1['LOCK'][_0x2613('0x2d')],'include':[{'model':db['CmContact'],'as':_0x2613('0x2e'),'attributes':_['keys'](_0x2d8199)},{'model':db[_0x2613('0x2f')],'as':'Agent','attributes':['id','name','voicePause']}]})[_0x2613('0x9')](function(_0x38f1f2){var _0xbea153=[];var _0x2c3d44=[];for(var _0xf2fa5=0x0;_0xf2fa5<_0x38f1f2[_0x2613('0x30')];_0xf2fa5+=0x1){var _0x4e20d1=_0x38f1f2[_0xf2fa5][_0x2613('0x31')];if(_0x4e20d1===null){_0xbea153[_0x2613('0x32')](_0x38f1f2[_0xf2fa5][_0x2613('0x22')](_0x6f4f3[_0x2613('0x23')],{'transaction':_0x23a0d1}));}else if(!_0x2c3d44[_0x2613('0x33')](_0x4e20d1)){_0x2c3d44[_0x2613('0x32')](_0x4e20d1);_0xbea153[_0x2613('0x32')](_0x38f1f2[_0xf2fa5][_0x2613('0x22')](_0x6f4f3['body'],{'transaction':_0x23a0d1}));}}return BPromise[_0x2613('0x34')](_0xbea153);});})[_0x2613('0x9')](function(_0x31324d){logger[_0x2613('0x11')](_0x2613('0x28'),_0x6f4f3);if(_0x31324d[_0x2613('0x30')]>0x0){logger[_0x2613('0x11')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x31324d[0x0][_0x2613('0x35')]['id'],_0x31324d[0x0][_0x2613('0x35')]['ContactId'],_0x31324d[0x0][_0x2613('0x35')]['active']);}logger[_0x2613('0xc')](_0x2613('0x28'),_0x6f4f3,JSON[_0x2613('0xd')](_0x31324d));_0xaed6aa(_0x31324d);})['catch'](function(_0x29786f){logger[_0x2613('0xe')](_0x2613('0x28'),_0x29786f[_0x2613('0x10')],_0x6f4f3);_0x1e3565(_0x5bd2b7[_0x2613('0xe')](0x1f4,_0x29786f[_0x2613('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x33acb4){var _0x44f321=this;return new Promise(function(_0xaa6c44,_0x4c1ab3){return db[_0x2613('0x36')][_0x2613('0x2b')](function(_0x15a990){return db[_0x2613('0x37')][_0x2613('0x20')](_0x33acb4[_0x2613('0x23')],{'raw':_0x33acb4[_0x2613('0x16')]?_0x33acb4['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x15a990})[_0x2613('0x9')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x33acb4[_0x2613('0x16')][_0x2613('0x18')]),_0x33acb4[_0x2613('0x16')][_0x2613('0x18')][_0x2613('0x38')]);return db[_0x2613('0x14')]['destroy']({'where':_0x33acb4[_0x2613('0x16')]?_0x33acb4[_0x2613('0x16')]['where']||null:null,'transaction':_0x15a990});});})[_0x2613('0x9')](function(_0x50c32a){logger[_0x2613('0x11')]('MoveContactManagedDialer',_0x33acb4);logger[_0x2613('0xc')](_0x2613('0x39'),_0x33acb4,JSON[_0x2613('0xd')](_0x50c32a));_0xaa6c44(_0x50c32a);})[_0x2613('0x12')](function(_0xd14604){logger[_0x2613('0xe')](_0x2613('0x39'),_0xd14604[_0x2613('0x10')],_0x33acb4);_0x4c1ab3(_0x44f321[_0x2613('0xe')](0x1f4,_0xd14604[_0x2613('0x10')]));});});};exports[_0x2613('0x3a')]=function(_0x13362b){var _0x2e84cb=this;return new Promise(function(_0x21b4a0,_0x4b059d){return db[_0x2613('0x14')]['findAll']({'raw':_0x13362b['options']?_0x13362b[_0x2613('0x16')][_0x2613('0x17')]===undefined?!![]:![]:!![],'where':_0x13362b[_0x2613('0x16')]?_0x13362b[_0x2613('0x16')][_0x2613('0x18')]||null:null,'attributes':[[db[_0x2613('0x36')]['fn'](_0x2613('0x3b'),db[_0x2613('0x36')]['fn']('IF',db[_0x2613('0x36')][_0x2613('0x3c')](_0x2613('0x3d')+util['format'](_0x2613('0x3e'),moment()[_0x2613('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x2613('0x40')))),_0x2613('0x41')]]})[_0x2613('0x9')](function(_0x5bedeb){logger[_0x2613('0x11')](_0x2613('0x3a'),_0x13362b);logger[_0x2613('0xc')](_0x2613('0x3a'),_0x13362b,JSON[_0x2613('0xd')](_0x5bedeb));_0x21b4a0(_0x5bedeb);})[_0x2613('0x12')](function(_0x566e0c){logger[_0x2613('0xe')]('CountReScheduled',_0x566e0c[_0x2613('0x10')],_0x13362b);_0x4b059d(_0x2e84cb[_0x2613('0xe')](0x1f4,_0x566e0c[_0x2613('0x10')]));});});};exports['GetContactRecallMe']=function(_0x27aba6){var _0x25f6ff=this;return new Promise(function(_0x24aff4,_0x3d9331){return db['CmContact']['describe']()[_0x2613('0x9')](function(_0x21b89b){return db[_0x2613('0x36')][_0x2613('0x2b')](function(_0x509210){return db[_0x2613('0x14')][_0x2613('0x15')]({'where':_0x27aba6[_0x2613('0x16')]?_0x27aba6['options'][_0x2613('0x18')]||null:null,'attributes':_0x27aba6[_0x2613('0x16')]?_0x27aba6[_0x2613('0x16')][_0x2613('0x19')]||null:null,'limit':0x1,'order':_0x27aba6['options']?_0x27aba6[_0x2613('0x16')]['order']||null:null,'group':db['CmHopper'][_0x2613('0x31')],'transaction':_0x509210,'lock':_0x509210['LOCK'][_0x2613('0x2d')],'include':_0x27aba6[_0x2613('0x16')]?_0x27aba6[_0x2613('0x16')][_0x2613('0x1b')]?_['map'](_0x27aba6[_0x2613('0x16')][_0x2613('0x1b')],function(_0x7aef1a){return{'model':db[_0x7aef1a[_0x2613('0x1c')]],'as':_0x7aef1a['as'],'attributes':_0x7aef1a[_0x2613('0x19')],'include':_0x7aef1a[_0x2613('0x1b')]?_[_0x2613('0x1a')](_0x7aef1a[_0x2613('0x1b')],function(_0x16af2c){return{'model':db[_0x16af2c[_0x2613('0x1c')]],'as':_0x16af2c['as'],'attributes':_0x16af2c[_0x2613('0x19')],'include':_0x16af2c['include']?_[_0x2613('0x1a')](_0x16af2c[_0x2613('0x1b')],function(_0xb886db){return{'model':db[_0xb886db['model']],'as':_0xb886db['as'],'attributes':_0xb886db[_0x2613('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ca82b){var _0x16bf96=[];for(var _0x179e82=0x0;_0x179e82<_0x5ca82b[_0x2613('0x30')];_0x179e82+=0x1){_0x16bf96['push'](_0x5ca82b[_0x179e82][_0x2613('0x22')](_0x27aba6['body'],{'transaction':_0x509210}));}return BPromise[_0x2613('0x34')](_0x16bf96);});})['then'](function(_0x4d24f2){logger[_0x2613('0x11')](_0x2613('0x42'),_0x27aba6);logger['debug']('GetContactRecallMe',_0x27aba6,JSON[_0x2613('0xd')](_0x4d24f2));_0x24aff4(_0x4d24f2);})['catch'](function(_0x4109a4){logger['error'](_0x2613('0x42'),_0x4109a4[_0x2613('0x10')],_0x27aba6);_0x3d9331(_0x25f6ff['error'](0x1f4,_0x4109a4[_0x2613('0x10')]));});});});};exports[_0x2613('0x43')]=function(_0x4cba17){var _0x8a47c6=this;return new Promise(function(_0x483c4c,_0x4454c2){db[_0x2613('0x29')]['describe']()['then'](function(_0x1909f5){return db[_0x2613('0x14')][_0x2613('0x15')]({'raw':_0x4cba17['options']?_0x4cba17[_0x2613('0x16')][_0x2613('0x17')]===undefined?!![]:![]:!![],'where':_0x4cba17['options']?_0x4cba17[_0x2613('0x16')]['where']||null:null,'attributes':_0x4cba17[_0x2613('0x16')]?_0x4cba17[_0x2613('0x16')][_0x2613('0x19')]||null:null,'limit':_0x4cba17[_0x2613('0x16')]?_0x4cba17[_0x2613('0x16')][_0x2613('0x24')]||null:null,'include':_0x4cba17[_0x2613('0x16')]?_0x4cba17[_0x2613('0x16')][_0x2613('0x1b')]?_[_0x2613('0x1a')](_0x4cba17['options'][_0x2613('0x1b')],function(_0x5f433b){return{'model':db[_0x5f433b[_0x2613('0x1c')]],'as':_0x5f433b['as'],'attributes':_0x5f433b['as']==='Contact'?_[_0x2613('0x44')](_0x1909f5):_0x5f433b[_0x2613('0x19')],'include':_0x5f433b['include']?_['map'](_0x5f433b['include'],function(_0x9d0669){return{'model':db[_0x9d0669['model']],'as':_0x9d0669['as'],'attributes':_0x9d0669[_0x2613('0x19')],'include':_0x9d0669[_0x2613('0x1b')]?_[_0x2613('0x1a')](_0x9d0669[_0x2613('0x1b')],function(_0x517a33){return{'model':db[_0x517a33[_0x2613('0x1c')]],'as':_0x517a33['as'],'attributes':_0x517a33['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x437016){logger['info'](_0x2613('0x13'),_0x4cba17);logger[_0x2613('0xc')](_0x2613('0x13'),_0x4cba17,JSON[_0x2613('0xd')](_0x437016));_0x483c4c(_0x437016);})[_0x2613('0x12')](function(_0x11e5c4){logger[_0x2613('0xe')]('GetCmHopper',_0x11e5c4[_0x2613('0x10')],_0x4cba17);_0x4454c2(_0x8a47c6[_0x2613('0xe')](0x1f4,_0x11e5c4[_0x2613('0x10')]));});});});};exports[_0x2613('0x45')]=function(_0x299a45){var _0x47d97d=this;return new Promise(function(_0x238a5f,_0x4fe340){return db[_0x2613('0x29')][_0x2613('0x46')]({'raw':!![],'where':{'phone':_0x299a45[_0x2613('0x16')][_0x2613('0x18')][_0x2613('0x47')]},'attributes':['id','dialTimezone'],'order':[['id',_0x2613('0x48')]]})[_0x2613('0x9')](function(_0x4b885f){logger[_0x2613('0x11')](_0x2613('0x49'),_0x299a45);logger[_0x2613('0xc')]('getContactByPhone',_0x299a45,JSON[_0x2613('0xd')](_0x4b885f));_0x238a5f(_0x4b885f);})[_0x2613('0x12')](function(_0x5f32bf){logger['error'](_0x2613('0x49'),_0x5f32bf[_0x2613('0x10')],_0x299a45);_0x4fe340(_0x47d97d['error'](0x1f4,_0x5f32bf['message']));});});};exports['ResetActiveCalls']=function(_0x5c9d35){var _0x5a51f9=this;return new Promise(function(_0x443227,_0x406885){return db[_0x2613('0x36')][_0x2613('0x2b')](function(_0x460e8f){return db[_0x2613('0x14')][_0x2613('0x22')]({'active':![]},{'where':{},'transaction':_0x460e8f})[_0x2613('0x9')](function(_0x1e4c9e){logger['info'](_0x2613('0x4a'),_0x5c9d35);logger['debug'](_0x2613('0x4a'),_0x5c9d35,JSON[_0x2613('0xd')](_0x1e4c9e));_0x443227(_0x1e4c9e);})[_0x2613('0x12')](function(_0x314762){logger[_0x2613('0xe')](_0x2613('0x4a'),_0x314762['message'],_0x5c9d35);_0x406885(_0x5a51f9['error'](0x1f4,_0x314762[_0x2613('0x10')]));});});});};exports[_0x2613('0x4b')]=function(_0x55588b){var _0x8a4b81=this;var _0x27f9d3=_0x55588b[_0x2613('0x23')][_0x2613('0x18')][_0x2613('0x4c')];var _0x456a0b=_0x55588b[_0x2613('0x23')][_0x2613('0x18')][_0x2613('0x4d')];return new Promise(function(_0x4ba81d,_0x676c67){return db[_0x2613('0x14')][_0x2613('0x15')]({'logging':!![],'where':{'voiceQueueId':_0x27f9d3,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x2613('0x36')][_0x2613('0x3c')]('NOW()\x20+\x20INTERVAL\x20'+_0x456a0b+_0x2613('0x4e')),'$gt':db['sequelize'][_0x2613('0x3c')]('NOW()')}}},'include':[{'model':db[_0x2613('0x29')],'as':'Contact'},{'model':db['User'],'as':_0x2613('0x4f'),'attributes':['id',_0x2613('0x50'),'voicePause']},{'model':db[_0x2613('0x51')],'as':'List'}]})[_0x2613('0x9')](function(_0x1a5770){console[_0x2613('0x52')](_0x1a5770);if(_0x1a5770[_0x2613('0x30')]>0x0){return db[_0x2613('0x36')][_0x2613('0x2b')](function(_0x525788){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0x2613('0x36')][_0x2613('0x3c')](_0x2613('0x53'))},{'where':{'id':{'$in':_[_0x2613('0x1a')](_0x1a5770,'id')}},'logging':!![],'transaction':_0x525788})[_0x2613('0x9')](function(_0x1ad6a2){console['log'](_0x1ad6a2);_0x4ba81d(_0x1a5770);})[_0x2613('0x12')](function(_0x71b225){logger[_0x2613('0xe')](_0x2613('0x4b'),_0x71b225['message'],_0x55588b);_0x676c67(_0x8a4b81[_0x2613('0xe')](0x1f4,_0x71b225[_0x2613('0x10')]));});})[_0x2613('0x12')](function(_0x501661){logger[_0x2613('0xe')](_0x2613('0x4b'),_0x501661[_0x2613('0x10')],_0x55588b);_0x676c67(_0x8a4b81[_0x2613('0xe')](0x1f4,_0x501661[_0x2613('0x10')]));});}else{_0x4ba81d(_0x1a5770);}});});}; \ No newline at end of file +var _0xde81=['getContactByPhone','ResetActiveCalls','NOW()','CmList','List','log','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','client','request','then','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopper','CmHopper','options','where','attributes','limit','include','model','map','info','stringify','ShowCmHopper','find','raw','CreateCmHopper','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','UPDATE','Contact','keys','User','Agent','name','voicePause','UserId','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','ContactId','dataValues','active','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','transaction','LOCK','GetContactByPhone','findOne','phone','dialTimezone'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xde81,0x109));var _0x1de8=function(_0x3bcf38,_0x290cc0){_0x3bcf38=_0x3bcf38-0x0;var _0x49d42e=_0xde81[_0x3bcf38];return _0x49d42e;};'use strict';var _=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var moment=require(_0x1de8('0x2'));var BPromise=require(_0x1de8('0x3'));var db=require(_0x1de8('0x4'))['db'];var logger=require(_0x1de8('0x5'))('rpc');var jayson=require('jayson/promise');var client=jayson[_0x1de8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1421ce,_0x407364,_0x42801a){return new BPromise(function(_0x3ae723,_0x22918e){return client[_0x1de8('0x7')](_0x1421ce,_0x42801a)[_0x1de8('0x8')](function(_0x5ae9ca){logger['info'](_0x1de8('0x9'),_0x407364,'request\x20sent');logger[_0x1de8('0xa')](_0x1de8('0xb'),_0x407364,_0x1de8('0xc'),JSON['stringify'](_0x5ae9ca));if(_0x5ae9ca[_0x1de8('0xd')]){if(_0x5ae9ca[_0x1de8('0xd')][_0x1de8('0xe')]===0x1f4){logger[_0x1de8('0xd')](_0x1de8('0x9'),_0x407364,_0x5ae9ca[_0x1de8('0xd')][_0x1de8('0xf')]);return _0x22918e(_0x5ae9ca[_0x1de8('0xd')][_0x1de8('0xf')]);}logger[_0x1de8('0xd')]('CmHopper,\x20%s,\x20%s',_0x407364,_0x5ae9ca[_0x1de8('0xd')]['message']);return _0x3ae723(_0x5ae9ca[_0x1de8('0xd')][_0x1de8('0xf')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x407364,_0x1de8('0xc'));_0x3ae723(_0x5ae9ca[_0x1de8('0x10')][_0x1de8('0xf')]);}})[_0x1de8('0x11')](function(_0x578dbc){logger[_0x1de8('0xd')](_0x1de8('0x9'),_0x407364,_0x578dbc);_0x22918e(_0x578dbc);});});}exports[_0x1de8('0x12')]=function(_0x4d5fbc){var _0x10efc1=this;return new Promise(function(_0x197595,_0x4e0786){return db[_0x1de8('0x13')]['findAll']({'raw':_0x4d5fbc['options']?_0x4d5fbc[_0x1de8('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4d5fbc[_0x1de8('0x14')]?_0x4d5fbc[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'attributes':_0x4d5fbc['options']?_0x4d5fbc[_0x1de8('0x14')][_0x1de8('0x16')]||null:null,'limit':_0x4d5fbc[_0x1de8('0x14')]?_0x4d5fbc[_0x1de8('0x14')][_0x1de8('0x17')]||null:null,'include':_0x4d5fbc[_0x1de8('0x14')]?_0x4d5fbc[_0x1de8('0x14')][_0x1de8('0x18')]?_['map'](_0x4d5fbc[_0x1de8('0x14')][_0x1de8('0x18')],function(_0x404696){return{'model':db[_0x404696[_0x1de8('0x19')]],'as':_0x404696['as'],'attributes':_0x404696[_0x1de8('0x16')],'include':_0x404696[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x404696['include'],function(_0x43fe66){return{'model':db[_0x43fe66['model']],'as':_0x43fe66['as'],'attributes':_0x43fe66['attributes'],'include':_0x43fe66[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x43fe66[_0x1de8('0x18')],function(_0x1fa81a){return{'model':db[_0x1fa81a[_0x1de8('0x19')]],'as':_0x1fa81a['as'],'attributes':_0x1fa81a[_0x1de8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1de8('0x8')](function(_0x49f8a6){logger[_0x1de8('0x1b')](_0x1de8('0x12'),_0x4d5fbc);logger[_0x1de8('0xa')](_0x1de8('0x12'),_0x4d5fbc,JSON[_0x1de8('0x1c')](_0x49f8a6));_0x197595(_0x49f8a6);})['catch'](function(_0x5e5156){logger[_0x1de8('0xd')](_0x1de8('0x12'),_0x5e5156[_0x1de8('0xf')],_0x4d5fbc);_0x4e0786(_0x10efc1[_0x1de8('0xd')](0x1f4,_0x5e5156['message']));});});};exports[_0x1de8('0x1d')]=function(_0x2a5409){var _0x5bbf52=this;return new Promise(function(_0x379935,_0x30cb0c){return db[_0x1de8('0x13')][_0x1de8('0x1e')]({'raw':_0x2a5409[_0x1de8('0x14')]?_0x2a5409[_0x1de8('0x14')][_0x1de8('0x1f')]===undefined?!![]:![]:!![],'where':_0x2a5409[_0x1de8('0x14')]?_0x2a5409[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'attributes':_0x2a5409[_0x1de8('0x14')]?_0x2a5409[_0x1de8('0x14')][_0x1de8('0x16')]||null:null,'include':_0x2a5409[_0x1de8('0x14')]?_0x2a5409[_0x1de8('0x14')]['include']?_[_0x1de8('0x1a')](_0x2a5409[_0x1de8('0x14')][_0x1de8('0x18')],function(_0xaa5258){return{'model':db[_0xaa5258[_0x1de8('0x19')]],'as':_0xaa5258['as'],'attributes':_0xaa5258[_0x1de8('0x16')],'include':_0xaa5258['include']?_['map'](_0xaa5258[_0x1de8('0x18')],function(_0x4411fd){return{'model':db[_0x4411fd[_0x1de8('0x19')]],'as':_0x4411fd['as'],'attributes':_0x4411fd[_0x1de8('0x16')],'include':_0x4411fd[_0x1de8('0x18')]?_['map'](_0x4411fd[_0x1de8('0x18')],function(_0x507a4e){return{'model':db[_0x507a4e[_0x1de8('0x19')]],'as':_0x507a4e['as'],'attributes':_0x507a4e[_0x1de8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1de8('0x8')](function(_0x578bc0){logger['info'](_0x1de8('0x1d'),_0x2a5409);logger[_0x1de8('0xa')](_0x1de8('0x1d'),_0x2a5409,JSON['stringify'](_0x578bc0));_0x379935(_0x578bc0);})['catch'](function(_0x3074ec){logger[_0x1de8('0xd')](_0x1de8('0x1d'),_0x3074ec[_0x1de8('0xf')],_0x2a5409);_0x30cb0c(_0x5bbf52['error'](0x1f4,_0x3074ec[_0x1de8('0xf')]));});});};exports[_0x1de8('0x20')]=function(_0xac090a){var _0x4775df=this;return new Promise(function(_0x37b767,_0x32cf97){return db[_0x1de8('0x13')]['create'](_0xac090a[_0x1de8('0x21')],{'raw':_0xac090a['options']?_0xac090a['options'][_0x1de8('0x1f')]===undefined?!![]:![]:!![]})[_0x1de8('0x8')](function(_0x17330e){logger[_0x1de8('0x1b')]('CreateCmHopper',_0xac090a);logger[_0x1de8('0xa')]('CreateCmHopper',_0xac090a,JSON[_0x1de8('0x1c')](_0x17330e));_0x37b767(_0x17330e);})[_0x1de8('0x11')](function(_0x13384c){logger[_0x1de8('0xd')](_0x1de8('0x20'),_0x13384c[_0x1de8('0xf')],_0xac090a);_0x32cf97(_0x4775df[_0x1de8('0xd')](0x1f4,_0x13384c[_0x1de8('0xf')]));});});};exports['UpdateCmHopper']=function(_0x5bba82){var _0x131188=this;return new Promise(function(_0x5038d6,_0x356f36){return db['CmHopper'][_0x1de8('0x22')](_0x5bba82['body'],{'raw':_0x5bba82[_0x1de8('0x14')]?_0x5bba82[_0x1de8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bba82['options']?_0x5bba82[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'attributes':_0x5bba82[_0x1de8('0x14')]?_0x5bba82[_0x1de8('0x14')][_0x1de8('0x16')]||null:null,'limit':_0x5bba82[_0x1de8('0x14')]?_0x5bba82[_0x1de8('0x14')][_0x1de8('0x17')]||null:null})['then'](function(_0x21d23b){logger['info'](_0x1de8('0x23'),_0x5bba82);logger[_0x1de8('0x1b')](_0x1de8('0x24'),JSON['stringify'](_0x5bba82[_0x1de8('0x14')][_0x1de8('0x15')]),_0x5bba82[_0x1de8('0x21')]['active']);logger['debug'](_0x1de8('0x23'),_0x5bba82,JSON[_0x1de8('0x1c')](_0x21d23b));_0x5038d6(_0x21d23b);})[_0x1de8('0x11')](function(_0xaff415){logger[_0x1de8('0xd')](_0x1de8('0x23'),_0xaff415['message'],_0x5bba82);_0x356f36(_0x131188['error'](0x1f4,_0xaff415[_0x1de8('0xf')]));});});};exports['DestroyCmHopper']=function(_0x59bb33){var _0xa86cef=this;return new Promise(function(_0x14855b,_0xa4de0e){return db['CmHopper'][_0x1de8('0x25')]({'where':_0x59bb33[_0x1de8('0x14')]?_0x59bb33[_0x1de8('0x14')]['where']||null:null})[_0x1de8('0x8')](function(_0x3ce31e){logger['info']('DestroyCmHopper',_0x59bb33);logger[_0x1de8('0xa')]('DestroyCmHopper',_0x59bb33,JSON[_0x1de8('0x1c')](_0x3ce31e));_0x14855b(_0x3ce31e);})['catch'](function(_0x1ec82b){logger['error']('DestroyCmHopper',_0x1ec82b['message'],_0x59bb33);_0xa4de0e(_0xa86cef['error'](0x1f4,_0x1ec82b[_0x1de8('0xf')]));});});};exports[_0x1de8('0x26')]=function(_0x299d74){var _0x4acaeb=this;return new Promise(function(_0x10ff97,_0x1bb02a){return db[_0x1de8('0x27')][_0x1de8('0x28')]()[_0x1de8('0x8')](function(_0x217043){return db[_0x1de8('0x29')]['transaction'](function(_0x2fff89){return db[_0x1de8('0x13')][_0x1de8('0x2a')]({'where':_0x299d74[_0x1de8('0x14')]?_0x299d74[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'attributes':_0x299d74[_0x1de8('0x14')]?_0x299d74['options'][_0x1de8('0x16')]||null:null,'limit':_0x299d74[_0x1de8('0x14')]?_0x299d74[_0x1de8('0x14')][_0x1de8('0x17')]||null:null,'order':_0x299d74['options']?_0x299d74[_0x1de8('0x14')][_0x1de8('0x2b')]||null:null,'transaction':_0x2fff89,'lock':_0x2fff89['LOCK'][_0x1de8('0x2c')],'include':[{'model':db[_0x1de8('0x27')],'as':_0x1de8('0x2d'),'attributes':_[_0x1de8('0x2e')](_0x217043)},{'model':db[_0x1de8('0x2f')],'as':_0x1de8('0x30'),'attributes':['id',_0x1de8('0x31'),_0x1de8('0x32')]}]})['then'](function(_0x206750){var _0x18defb=[];var _0x11b6c6=[];for(var _0x3ec7e9=0x0;_0x3ec7e9<_0x206750['length'];_0x3ec7e9+=0x1){var _0x51e645=_0x206750[_0x3ec7e9][_0x1de8('0x33')];if(_0x51e645===null){_0x18defb[_0x1de8('0x34')](_0x206750[_0x3ec7e9][_0x1de8('0x22')](_0x299d74[_0x1de8('0x21')],{'transaction':_0x2fff89}));}else if(!_0x11b6c6[_0x1de8('0x35')](_0x51e645)){_0x11b6c6['push'](_0x51e645);_0x18defb[_0x1de8('0x34')](_0x206750[_0x3ec7e9][_0x1de8('0x22')](_0x299d74['body'],{'transaction':_0x2fff89}));}}return BPromise[_0x1de8('0x36')](_0x18defb);});})[_0x1de8('0x8')](function(_0x48bac2){logger[_0x1de8('0x1b')](_0x1de8('0x26'),_0x299d74);if(_0x48bac2[_0x1de8('0x37')]>0x0){logger[_0x1de8('0x1b')](_0x1de8('0x38'),_0x48bac2[0x0]['dataValues']['id'],_0x48bac2[0x0]['dataValues'][_0x1de8('0x39')],_0x48bac2[0x0][_0x1de8('0x3a')][_0x1de8('0x3b')]);}logger[_0x1de8('0xa')](_0x1de8('0x26'),_0x299d74,JSON[_0x1de8('0x1c')](_0x48bac2));_0x10ff97(_0x48bac2);})[_0x1de8('0x11')](function(_0x42991f){logger['error'](_0x1de8('0x26'),_0x42991f[_0x1de8('0xf')],_0x299d74);_0x1bb02a(_0x4acaeb[_0x1de8('0xd')](0x1f4,_0x42991f['message']));});});});};exports[_0x1de8('0x3c')]=function(_0x264e01){var _0x14115e=this;return new Promise(function(_0x48a74f,_0x30699b){return db[_0x1de8('0x29')]['transaction'](function(_0x208044){return db[_0x1de8('0x3d')][_0x1de8('0x3e')](_0x264e01[_0x1de8('0x21')],{'raw':_0x264e01['options']?_0x264e01[_0x1de8('0x14')][_0x1de8('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x208044})[_0x1de8('0x8')](function(){logger[_0x1de8('0x1b')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x264e01[_0x1de8('0x14')][_0x1de8('0x15')]),_0x264e01[_0x1de8('0x14')][_0x1de8('0x15')][_0x1de8('0x3b')]);return db[_0x1de8('0x13')][_0x1de8('0x25')]({'where':_0x264e01[_0x1de8('0x14')]?_0x264e01[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'transaction':_0x208044});});})[_0x1de8('0x8')](function(_0x4e31c1){logger['info'](_0x1de8('0x3c'),_0x264e01);logger[_0x1de8('0xa')](_0x1de8('0x3c'),_0x264e01,JSON['stringify'](_0x4e31c1));_0x48a74f(_0x4e31c1);})[_0x1de8('0x11')](function(_0x5d2773){logger[_0x1de8('0xd')](_0x1de8('0x3c'),_0x5d2773[_0x1de8('0xf')],_0x264e01);_0x30699b(_0x14115e[_0x1de8('0xd')](0x1f4,_0x5d2773[_0x1de8('0xf')]));});});};exports[_0x1de8('0x3f')]=function(_0x311910){var _0x2e0aa3=this;return new Promise(function(_0x3aed06,_0x3ae7eb){return db[_0x1de8('0x13')][_0x1de8('0x2a')]({'raw':_0x311910[_0x1de8('0x14')]?_0x311910['options']['raw']===undefined?!![]:![]:!![],'where':_0x311910[_0x1de8('0x14')]?_0x311910[_0x1de8('0x14')][_0x1de8('0x15')]||null:null,'attributes':[[db[_0x1de8('0x29')]['fn'](_0x1de8('0x40'),db[_0x1de8('0x29')]['fn']('IF',db[_0x1de8('0x29')][_0x1de8('0x41')](_0x1de8('0x42')+util[_0x1de8('0x43')](_0x1de8('0x44'),moment()[_0x1de8('0x43')](_0x1de8('0x45')))+_0x1de8('0x46')))),_0x1de8('0x47')]]})['then'](function(_0x593762){logger['info']('CountReScheduled',_0x311910);logger[_0x1de8('0xa')]('CountReScheduled',_0x311910,JSON[_0x1de8('0x1c')](_0x593762));_0x3aed06(_0x593762);})['catch'](function(_0x4cf457){logger[_0x1de8('0xd')](_0x1de8('0x3f'),_0x4cf457[_0x1de8('0xf')],_0x311910);_0x3ae7eb(_0x2e0aa3[_0x1de8('0xd')](0x1f4,_0x4cf457['message']));});});};exports[_0x1de8('0x48')]=function(_0x38d0bb){var _0x1a7687=this;return new Promise(function(_0x41ebc8,_0x4c29ef){return db[_0x1de8('0x27')][_0x1de8('0x28')]()['then'](function(_0x24b18e){return db['sequelize'][_0x1de8('0x49')](function(_0x45786a){return db[_0x1de8('0x13')][_0x1de8('0x2a')]({'where':_0x38d0bb[_0x1de8('0x14')]?_0x38d0bb['options'][_0x1de8('0x15')]||null:null,'attributes':_0x38d0bb[_0x1de8('0x14')]?_0x38d0bb['options']['attributes']||null:null,'limit':0x1,'order':_0x38d0bb[_0x1de8('0x14')]?_0x38d0bb['options'][_0x1de8('0x2b')]||null:null,'group':db[_0x1de8('0x13')][_0x1de8('0x33')],'transaction':_0x45786a,'lock':_0x45786a[_0x1de8('0x4a')]['UPDATE'],'include':_0x38d0bb[_0x1de8('0x14')]?_0x38d0bb[_0x1de8('0x14')][_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x38d0bb['options'][_0x1de8('0x18')],function(_0x3b1c20){return{'model':db[_0x3b1c20[_0x1de8('0x19')]],'as':_0x3b1c20['as'],'attributes':_0x3b1c20['attributes'],'include':_0x3b1c20[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x3b1c20['include'],function(_0x2f9959){return{'model':db[_0x2f9959['model']],'as':_0x2f9959['as'],'attributes':_0x2f9959[_0x1de8('0x16')],'include':_0x2f9959[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x2f9959['include'],function(_0x2c0112){return{'model':db[_0x2c0112[_0x1de8('0x19')]],'as':_0x2c0112['as'],'attributes':_0x2c0112[_0x1de8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1de8('0x8')](function(_0x50ef9e){var _0x2851cf=[];for(var _0x1db813=0x0;_0x1db813<_0x50ef9e[_0x1de8('0x37')];_0x1db813+=0x1){_0x2851cf[_0x1de8('0x34')](_0x50ef9e[_0x1db813][_0x1de8('0x22')](_0x38d0bb['body'],{'transaction':_0x45786a}));}return BPromise[_0x1de8('0x36')](_0x2851cf);});})[_0x1de8('0x8')](function(_0x240c25){logger['info']('GetContactRecallMe',_0x38d0bb);logger[_0x1de8('0xa')](_0x1de8('0x48'),_0x38d0bb,JSON['stringify'](_0x240c25));_0x41ebc8(_0x240c25);})[_0x1de8('0x11')](function(_0x2bbf15){logger['error'](_0x1de8('0x48'),_0x2bbf15[_0x1de8('0xf')],_0x38d0bb);_0x4c29ef(_0x1a7687['error'](0x1f4,_0x2bbf15[_0x1de8('0xf')]));});});});};exports['GetCmHopperPreview']=function(_0x3447dc){var _0x344dd0=this;return new Promise(function(_0x2abdad,_0x5ebb30){db[_0x1de8('0x27')][_0x1de8('0x28')]()['then'](function(_0x12d235){return db[_0x1de8('0x13')][_0x1de8('0x2a')]({'raw':_0x3447dc[_0x1de8('0x14')]?_0x3447dc['options'][_0x1de8('0x1f')]===undefined?!![]:![]:!![],'where':_0x3447dc[_0x1de8('0x14')]?_0x3447dc[_0x1de8('0x14')]['where']||null:null,'attributes':_0x3447dc[_0x1de8('0x14')]?_0x3447dc['options']['attributes']||null:null,'limit':_0x3447dc[_0x1de8('0x14')]?_0x3447dc[_0x1de8('0x14')][_0x1de8('0x17')]||null:null,'include':_0x3447dc['options']?_0x3447dc['options']['include']?_[_0x1de8('0x1a')](_0x3447dc['options'][_0x1de8('0x18')],function(_0x43d706){return{'model':db[_0x43d706[_0x1de8('0x19')]],'as':_0x43d706['as'],'attributes':_0x43d706['as']===_0x1de8('0x2d')?_[_0x1de8('0x2e')](_0x12d235):_0x43d706[_0x1de8('0x16')],'include':_0x43d706[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x43d706['include'],function(_0x36e7aa){return{'model':db[_0x36e7aa[_0x1de8('0x19')]],'as':_0x36e7aa['as'],'attributes':_0x36e7aa['attributes'],'include':_0x36e7aa[_0x1de8('0x18')]?_[_0x1de8('0x1a')](_0x36e7aa[_0x1de8('0x18')],function(_0x19fbbf){return{'model':db[_0x19fbbf[_0x1de8('0x19')]],'as':_0x19fbbf['as'],'attributes':_0x19fbbf[_0x1de8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1de8('0x8')](function(_0xe3b4b1){logger['info']('GetCmHopper',_0x3447dc);logger[_0x1de8('0xa')](_0x1de8('0x12'),_0x3447dc,JSON[_0x1de8('0x1c')](_0xe3b4b1));_0x2abdad(_0xe3b4b1);})[_0x1de8('0x11')](function(_0x5b0fcd){logger[_0x1de8('0xd')](_0x1de8('0x12'),_0x5b0fcd['message'],_0x3447dc);_0x5ebb30(_0x344dd0['error'](0x1f4,_0x5b0fcd['message']));});});});};exports[_0x1de8('0x4b')]=function(_0x4a9fc7){var _0x1c34ee=this;return new Promise(function(_0x579f86,_0x2f44a4){return db['CmContact'][_0x1de8('0x4c')]({'raw':!![],'where':{'phone':_0x4a9fc7[_0x1de8('0x14')][_0x1de8('0x15')][_0x1de8('0x4d')]},'attributes':['id',_0x1de8('0x4e')],'order':[['id','DESC']]})[_0x1de8('0x8')](function(_0x17cf36){logger[_0x1de8('0x1b')](_0x1de8('0x4f'),_0x4a9fc7);logger[_0x1de8('0xa')](_0x1de8('0x4f'),_0x4a9fc7,JSON[_0x1de8('0x1c')](_0x17cf36));_0x579f86(_0x17cf36);})['catch'](function(_0x332989){logger[_0x1de8('0xd')](_0x1de8('0x4f'),_0x332989[_0x1de8('0xf')],_0x4a9fc7);_0x2f44a4(_0x1c34ee[_0x1de8('0xd')](0x1f4,_0x332989[_0x1de8('0xf')]));});});};exports['ResetActiveCalls']=function(_0x14aa5f){var _0x1fabb0=this;return new Promise(function(_0x43c8ff,_0x22b0b8){return db[_0x1de8('0x29')][_0x1de8('0x49')](function(_0x4e00a9){return db[_0x1de8('0x13')][_0x1de8('0x22')]({'active':![]},{'where':{},'transaction':_0x4e00a9})[_0x1de8('0x8')](function(_0x41fa36){logger['info'](_0x1de8('0x50'),_0x14aa5f);logger[_0x1de8('0xa')](_0x1de8('0x50'),_0x14aa5f,JSON[_0x1de8('0x1c')](_0x41fa36));_0x43c8ff(_0x41fa36);})[_0x1de8('0x11')](function(_0x37465f){logger[_0x1de8('0xd')](_0x1de8('0x50'),_0x37465f[_0x1de8('0xf')],_0x14aa5f);_0x22b0b8(_0x1fabb0[_0x1de8('0xd')](0x1f4,_0x37465f['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2a7793){var _0x15bc9b=this;var _0x48a18c=_0x2a7793[_0x1de8('0x21')][_0x1de8('0x15')]['voiceQueueId'];var _0x5e6550=_0x2a7793[_0x1de8('0x21')][_0x1de8('0x15')]['interval'];return new Promise(function(_0x45ba7b,_0x4c2519){return db[_0x1de8('0x13')]['findAll']({'logging':!![],'where':{'voiceQueueId':_0x48a18c,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x1de8('0x29')][_0x1de8('0x41')]('NOW()\x20+\x20INTERVAL\x20'+_0x5e6550+'\x20MINUTE'),'$gt':db['sequelize'][_0x1de8('0x41')](_0x1de8('0x51'))}}},'include':[{'model':db[_0x1de8('0x27')],'as':_0x1de8('0x2d')},{'model':db[_0x1de8('0x2f')],'as':'Agent','attributes':['id',_0x1de8('0x31'),'voicePause']},{'model':db[_0x1de8('0x52')],'as':_0x1de8('0x53')}]})[_0x1de8('0x8')](function(_0x147583){console[_0x1de8('0x54')](_0x147583);if(_0x147583['length']>0x0){return db[_0x1de8('0x29')]['transaction'](function(_0x207493){return db[_0x1de8('0x13')][_0x1de8('0x22')]({'recallmeNotifiedDate':db[_0x1de8('0x29')][_0x1de8('0x41')](_0x1de8('0x51'))},{'where':{'id':{'$in':_[_0x1de8('0x1a')](_0x147583,'id')}},'logging':!![],'transaction':_0x207493})['then'](function(_0x413150){console[_0x1de8('0x54')](_0x413150);_0x45ba7b(_0x147583);})[_0x1de8('0x11')](function(_0x233555){logger['error'](_0x1de8('0x55'),_0x233555[_0x1de8('0xf')],_0x2a7793);_0x4c2519(_0x15bc9b['error'](0x1f4,_0x233555[_0x1de8('0xf')]));});})['catch'](function(_0x5137bb){logger[_0x1de8('0xd')](_0x1de8('0x55'),_0x5137bb[_0x1de8('0xf')],_0x2a7793);_0x4c2519(_0x15bc9b[_0x1de8('0xd')](0x1f4,_0x5137bb['message']));});}else{_0x45ba7b(_0x147583);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7aca7cd..b8176cf 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 _0xaf0e=['/:id','delete','destroy','exports','express','../../components/auth/service','get','isAuthenticated','describe','/opencontacts','getTimezones','show','post','create','/preview','getPreview','/timezone','getTimezone','put'];(function(_0xffd0f8,_0x259f35){var _0xdbc30=function(_0x53d625){while(--_0x53d625){_0xffd0f8['push'](_0xffd0f8['shift']());}};_0xdbc30(++_0x259f35);}(_0xaf0e,0x15a));var _0xeaf0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaf0e[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0xeaf0('0x0'));var router=express['Router']();var auth=require(_0xeaf0('0x1'));var controller=require('./cmHopper.controller');router[_0xeaf0('0x2')]('/',auth[_0xeaf0('0x3')](),controller['index']);router[_0xeaf0('0x2')]('/describe',auth['isAuthenticated'](),controller[_0xeaf0('0x4')]);router[_0xeaf0('0x2')](_0xeaf0('0x5'),auth[_0xeaf0('0x3')](),controller['getOpenContacts']);router['get']('/timezones',auth[_0xeaf0('0x3')](),controller[_0xeaf0('0x6')]);router['get']('/:id',auth[_0xeaf0('0x3')](),controller[_0xeaf0('0x7')]);router[_0xeaf0('0x2')]('/:id/previewrecall',auth[_0xeaf0('0x3')](),controller['getPreviewRecall']);router[_0xeaf0('0x8')]('/',auth[_0xeaf0('0x3')](),controller[_0xeaf0('0x9')]);router['post'](_0xeaf0('0xa'),auth[_0xeaf0('0x3')](),controller[_0xeaf0('0xb')]);router['post'](_0xeaf0('0xc'),auth[_0xeaf0('0x3')](),controller[_0xeaf0('0xd')]);router[_0xeaf0('0xe')](_0xeaf0('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xeaf0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xeaf0('0x11')]);module[_0xeaf0('0x12')]=router; \ No newline at end of file +var _0xdfbf=['index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','create','post','getPreview','/timezone','getTimezone','put','update','delete','exports','express','Router','get','isAuthenticated'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdfbf,0xe2));var _0xfdfb=function(_0xb86a05,_0x4e3b73){_0xb86a05=_0xb86a05-0x0;var _0x1b3c36=_0xdfbf[_0xb86a05];return _0x1b3c36;};'use strict';var express=require(_0xfdfb('0x0'));var router=express[_0xfdfb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0xfdfb('0x2')]('/',auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x4')]);router[_0xfdfb('0x2')](_0xfdfb('0x5'),auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x6')]);router[_0xfdfb('0x2')](_0xfdfb('0x7'),auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x8')]);router[_0xfdfb('0x2')](_0xfdfb('0x9'),auth[_0xfdfb('0x3')](),controller[_0xfdfb('0xa')]);router[_0xfdfb('0x2')]('/:id',auth[_0xfdfb('0x3')](),controller[_0xfdfb('0xb')]);router[_0xfdfb('0x2')](_0xfdfb('0xc'),auth[_0xfdfb('0x3')](),controller[_0xfdfb('0xd')]);router['post']('/',auth[_0xfdfb('0x3')](),controller[_0xfdfb('0xe')]);router[_0xfdfb('0xf')]('/preview',auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x10')]);router[_0xfdfb('0xf')](_0xfdfb('0x11'),auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x12')]);router[_0xfdfb('0x13')]('/:id',auth[_0xfdfb('0x3')](),controller[_0xfdfb('0x14')]);router[_0xfdfb('0x15')]('/:id',auth[_0xfdfb('0x3')](),controller['destroy']);module[_0xfdfb('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 53a7283..de4c875 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 _0x5e11=['contactListQueue','moment','exports','STRING','INTEGER'];(function(_0x1373a3,_0x344b83){var _0x32e1bc=function(_0x4b6692){while(--_0x4b6692){_0x1373a3['push'](_0x1373a3['shift']());}};_0x32e1bc(++_0x344b83);}(_0x5e11,0x1c3));var _0x15e1=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x5e11[_0x616290];return _0x453879;};'use strict';var moment=require(_0x15e1('0x0'));var Sequelize=require('sequelize');module[_0x15e1('0x1')]={'phone':{'type':Sequelize[_0x15e1('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x15e1('0x3')],'unique':_0x15e1('0x4')},'ListId':{'type':Sequelize[_0x15e1('0x3')],'unique':_0x15e1('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x15e1('0x4')}}; \ No newline at end of file +var _0x00f0=['INTEGER','moment','sequelize','exports','STRING'];(function(_0x46748c,_0x3742eb){var _0x548154=function(_0x452840){while(--_0x452840){_0x46748c['push'](_0x46748c['shift']());}};_0x548154(++_0x3742eb);}(_0x00f0,0xec));var _0x000f=function(_0x330371,_0x25ea43){_0x330371=_0x330371-0x0;var _0x54abe1=_0x00f0[_0x330371];return _0x54abe1;};'use strict';var moment=require(_0x000f('0x0'));var Sequelize=require(_0x000f('0x1'));module[_0x000f('0x2')]={'phone':{'type':Sequelize[_0x000f('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x000f('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x000f('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index def67e4..a1f261a 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 _0xedc2=['map','CmHopperBlack','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','describe','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0xedc2,0x1db));var _0x2edc=function(_0x1bec9c,_0x11ee9f){_0x1bec9c=_0x1bec9c-0x0;var _0x29bf09=_0xedc2[_0x1bec9c];return _0x29bf09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2edc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2edc('0x1'));var moment=require('moment');var BPromise=require(_0x2edc('0x2'));var Mustache=require(_0x2edc('0x3'));var util=require('util');var path=require(_0x2edc('0x4'));var sox=require(_0x2edc('0x5'));var csv=require('to-csv');var ejs=require(_0x2edc('0x6'));var fs=require('fs');var fs_extra=require(_0x2edc('0x7'));var _=require(_0x2edc('0x8'));var squel=require(_0x2edc('0x9'));var crypto=require(_0x2edc('0xa'));var jsforce=require(_0x2edc('0xb'));var deskjs=require(_0x2edc('0xc'));var toCsv=require(_0x2edc('0xd'));var querystring=require(_0x2edc('0xe'));var Papa=require(_0x2edc('0xf'));var Redis=require(_0x2edc('0x10'));var authService=require(_0x2edc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2edc('0x12'));var hardwareService=require(_0x2edc('0x13'));var logger=require(_0x2edc('0x14'))(_0x2edc('0x15'));var utils=require(_0x2edc('0x16'));var config=require(_0x2edc('0x17'));var licenseUtil=require(_0x2edc('0x18'));var db=require(_0x2edc('0x19'))['db'];function respondWithStatusCode(_0x19532e,_0x28d407){_0x28d407=_0x28d407||0xcc;return function(_0x2bd1fc){if(_0x2bd1fc){return _0x19532e[_0x2edc('0x1a')](_0x28d407);}return _0x19532e[_0x2edc('0x1b')](_0x28d407)[_0x2edc('0x1c')]();};}function respondWithResult(_0x4c428b,_0x1bed30){_0x1bed30=_0x1bed30||0xc8;return function(_0x332631){if(_0x332631){return _0x4c428b[_0x2edc('0x1b')](_0x1bed30)['json'](_0x332631);}};}function respondWithFilteredResult(_0x104bae,_0x1d68da){return function(_0x14db39){if(_0x14db39){var _0x34d214=typeof _0x1d68da[_0x2edc('0x1d')]===_0x2edc('0x1e')&&typeof _0x1d68da['limit']===_0x2edc('0x1e');var _0x4bb03c=_0x14db39[_0x2edc('0x1f')];var _0x3849eb=_0x34d214?0x0:_0x1d68da['offset'];var _0x4715f9=_0x34d214?_0x14db39[_0x2edc('0x1f')]:_0x1d68da[_0x2edc('0x1d')]+_0x1d68da[_0x2edc('0x20')];var _0x703b13;if(_0x4715f9>=_0x4bb03c){_0x4715f9=_0x4bb03c;_0x703b13=0xc8;}else{_0x703b13=0xce;}_0x104bae[_0x2edc('0x1b')](_0x703b13);return _0x104bae['set'](_0x2edc('0x21'),_0x3849eb+'-'+_0x4715f9+'/'+_0x4bb03c)['json'](_0x14db39);}return null;};}function patchUpdates(_0xc4b529){return function(_0x3596f4){try{jsonpatch[_0x2edc('0x22')](_0x3596f4,_0xc4b529,!![]);}catch(_0x32e3db){return BPromise[_0x2edc('0x23')](_0x32e3db);}return _0x3596f4[_0x2edc('0x24')]();};}function saveUpdates(_0x4ff110,_0x1b1e78){return function(_0x6830c0){if(_0x6830c0){return _0x6830c0['update'](_0x4ff110)[_0x2edc('0x25')](function(_0x3c0561){return _0x3c0561;});}return null;};}function removeEntity(_0x10e311,_0x3b656f){return function(_0x5926e2){if(_0x5926e2){return _0x5926e2[_0x2edc('0x26')]()['then'](function(){_0x10e311[_0x2edc('0x1b')](0xcc)[_0x2edc('0x1c')]();});}};}function handleEntityNotFound(_0x3a7bd3,_0x7d8541){return function(_0x7fc64a){if(!_0x7fc64a){_0x3a7bd3[_0x2edc('0x1a')](0x194);}return _0x7fc64a;};}function handleError(_0x4dd500,_0x2d008a){_0x2d008a=_0x2d008a||0x1f4;return function(_0x18a344){logger[_0x2edc('0x27')](_0x18a344[_0x2edc('0x28')]);if(_0x18a344[_0x2edc('0x29')]){delete _0x18a344[_0x2edc('0x29')];}_0x4dd500[_0x2edc('0x1b')](_0x2d008a)[_0x2edc('0x2a')](_0x18a344);};}exports['index']=function(_0x1e7875,_0x1d3770){var _0x335ac3={},_0x10c69e={},_0x3cc8c2={'count':0x0,'rows':[]};var _0xe89640=_[_0x2edc('0x2b')](db[_0x2edc('0x2c')][_0x2edc('0x2d')],function(_0x1d741a){return{'name':_0x1d741a[_0x2edc('0x2e')],'type':_0x1d741a[_0x2edc('0x2f')]['key']};});_0x10c69e[_0x2edc('0x30')]=_[_0x2edc('0x2b')](_0xe89640,'name');_0x10c69e[_0x2edc('0x31')]=_['keys'](_0x1e7875['query']);_0x10c69e[_0x2edc('0x32')]=_[_0x2edc('0x33')](_0x10c69e['model'],_0x10c69e[_0x2edc('0x31')]);_0x335ac3[_0x2edc('0x34')]=_[_0x2edc('0x33')](_0x10c69e[_0x2edc('0x30')],qs[_0x2edc('0x35')](_0x1e7875[_0x2edc('0x31')][_0x2edc('0x35')]));_0x335ac3[_0x2edc('0x34')]=_0x335ac3[_0x2edc('0x34')][_0x2edc('0x36')]?_0x335ac3['attributes']:_0x10c69e['model'];if(!_0x1e7875['query']['hasOwnProperty'](_0x2edc('0x37'))){_0x335ac3[_0x2edc('0x20')]=qs['limit'](_0x1e7875[_0x2edc('0x31')][_0x2edc('0x20')]);_0x335ac3[_0x2edc('0x1d')]=qs[_0x2edc('0x1d')](_0x1e7875[_0x2edc('0x31')]['offset']);}_0x335ac3[_0x2edc('0x38')]=qs['sort'](_0x1e7875['query'][_0x2edc('0x39')]);_0x335ac3[_0x2edc('0x3a')]=qs[_0x2edc('0x32')](_['pick'](_0x1e7875[_0x2edc('0x31')],_0x10c69e[_0x2edc('0x32')]),_0xe89640);if(_0x1e7875[_0x2edc('0x31')][_0x2edc('0x3b')]){_0x335ac3[_0x2edc('0x3a')]=_[_0x2edc('0x3c')](_0x335ac3[_0x2edc('0x3a')],{'$or':_[_0x2edc('0x2b')](_0xe89640,function(_0x41f69b){if(_0x41f69b[_0x2edc('0x2f')]!==_0x2edc('0x3d')){var _0x483d36={};_0x483d36[_0x41f69b[_0x2edc('0x29')]]={'$like':'%'+_0x1e7875[_0x2edc('0x31')][_0x2edc('0x3b')]+'%'};return _0x483d36;}})});}_0x335ac3=_[_0x2edc('0x3c')]({},_0x335ac3,_0x1e7875[_0x2edc('0x3e')]);var _0x841b97={'where':_0x335ac3[_0x2edc('0x3a')]};return db['CmHopperBlack']['count'](_0x841b97)[_0x2edc('0x25')](function(_0x26c315){_0x3cc8c2[_0x2edc('0x1f')]=_0x26c315;if(_0x1e7875[_0x2edc('0x31')][_0x2edc('0x3f')]){_0x335ac3[_0x2edc('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x2edc('0x41')](_0x335ac3);})[_0x2edc('0x25')](function(_0x792597){_0x3cc8c2[_0x2edc('0x42')]=_0x792597;return _0x3cc8c2;})['then'](respondWithFilteredResult(_0x1d3770,_0x335ac3))[_0x2edc('0x43')](handleError(_0x1d3770,null));};exports[_0x2edc('0x44')]=function(_0x2f31c7,_0x20a223){var _0x2bf629={'raw':!![],'where':{'id':_0x2f31c7[_0x2edc('0x45')]['id']}},_0x4382a1={};_0x4382a1[_0x2edc('0x30')]=_['keys'](db[_0x2edc('0x2c')][_0x2edc('0x2d')]);_0x4382a1[_0x2edc('0x31')]=_['keys'](_0x2f31c7['query']);_0x4382a1[_0x2edc('0x32')]=_[_0x2edc('0x33')](_0x4382a1['model'],_0x4382a1[_0x2edc('0x31')]);_0x2bf629[_0x2edc('0x34')]=_[_0x2edc('0x33')](_0x4382a1[_0x2edc('0x30')],qs[_0x2edc('0x35')](_0x2f31c7[_0x2edc('0x31')][_0x2edc('0x35')]));_0x2bf629[_0x2edc('0x34')]=_0x2bf629['attributes'][_0x2edc('0x36')]?_0x2bf629[_0x2edc('0x34')]:_0x4382a1['model'];if(_0x2f31c7[_0x2edc('0x31')]['includeAll']){_0x2bf629[_0x2edc('0x40')]=[{'all':!![]}];}_0x2bf629=_['merge']({},_0x2bf629,_0x2f31c7[_0x2edc('0x3e')]);return db[_0x2edc('0x2c')][_0x2edc('0x46')](_0x2bf629)[_0x2edc('0x25')](handleEntityNotFound(_0x20a223,null))[_0x2edc('0x25')](respondWithResult(_0x20a223,null))[_0x2edc('0x43')](handleError(_0x20a223,null));};exports[_0x2edc('0x47')]=function(_0x427215,_0x43644c){if(_0x427215[_0x2edc('0x48')]['id']){delete _0x427215[_0x2edc('0x48')]['id'];}return db[_0x2edc('0x2c')][_0x2edc('0x46')]({'where':{'id':_0x427215['params']['id']}})[_0x2edc('0x25')](handleEntityNotFound(_0x43644c,null))['then'](saveUpdates(_0x427215[_0x2edc('0x48')],null))['then'](respondWithResult(_0x43644c,null))[_0x2edc('0x43')](handleError(_0x43644c,null));};exports[_0x2edc('0x26')]=function(_0x4095ed,_0x2d92e9){return db[_0x2edc('0x2c')][_0x2edc('0x46')]({'where':{'id':_0x4095ed[_0x2edc('0x45')]['id']}})[_0x2edc('0x25')](handleEntityNotFound(_0x2d92e9,null))[_0x2edc('0x25')](removeEntity(_0x2d92e9,null))[_0x2edc('0x43')](handleError(_0x2d92e9,null));};exports[_0x2edc('0x49')]=function(_0x2ae972,_0x12e6b5){return db[_0x2edc('0x2c')]['describe']()[_0x2edc('0x25')](respondWithResult(_0x12e6b5,null))[_0x2edc('0x43')](handleError(_0x12e6b5,null));}; \ No newline at end of file +var _0xb044=['error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','includeAll','find','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus'];(function(_0x3c7c79,_0x19f8c4){var _0x2e920b=function(_0x4811b0){while(--_0x4811b0){_0x3c7c79['push'](_0x3c7c79['shift']());}};_0x2e920b(++_0x19f8c4);}(_0xb044,0x74));var _0x4b04=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb044[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b04('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b04('0x1'));var rp=require(_0x4b04('0x2'));var moment=require(_0x4b04('0x3'));var BPromise=require(_0x4b04('0x4'));var Mustache=require(_0x4b04('0x5'));var util=require(_0x4b04('0x6'));var path=require(_0x4b04('0x7'));var sox=require('sox');var csv=require(_0x4b04('0x8'));var ejs=require(_0x4b04('0x9'));var fs=require('fs');var fs_extra=require(_0x4b04('0xa'));var _=require(_0x4b04('0xb'));var squel=require('squel');var crypto=require(_0x4b04('0xc'));var jsforce=require(_0x4b04('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4b04('0x8'));var querystring=require(_0x4b04('0xe'));var Papa=require(_0x4b04('0xf'));var Redis=require(_0x4b04('0x10'));var authService=require(_0x4b04('0x11'));var qs=require(_0x4b04('0x12'));var as=require(_0x4b04('0x13'));var hardwareService=require(_0x4b04('0x14'));var logger=require(_0x4b04('0x15'))(_0x4b04('0x16'));var utils=require(_0x4b04('0x17'));var config=require(_0x4b04('0x18'));var licenseUtil=require(_0x4b04('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42c425,_0x1ce7a4){_0x1ce7a4=_0x1ce7a4||0xcc;return function(_0xd977db){if(_0xd977db){return _0x42c425['sendStatus'](_0x1ce7a4);}return _0x42c425[_0x4b04('0x1a')](_0x1ce7a4)[_0x4b04('0x1b')]();};}function respondWithResult(_0x5f544d,_0x53985c){_0x53985c=_0x53985c||0xc8;return function(_0x42e461){if(_0x42e461){return _0x5f544d[_0x4b04('0x1a')](_0x53985c)['json'](_0x42e461);}};}function respondWithFilteredResult(_0x5763d5,_0x435785){return function(_0x4e044f){if(_0x4e044f){var _0x40286d=typeof _0x435785[_0x4b04('0x1c')]===_0x4b04('0x1d')&&typeof _0x435785['limit']===_0x4b04('0x1d');var _0x19de92=_0x4e044f[_0x4b04('0x1e')];var _0x289014=_0x40286d?0x0:_0x435785[_0x4b04('0x1c')];var _0x3115b7=_0x40286d?_0x4e044f[_0x4b04('0x1e')]:_0x435785[_0x4b04('0x1c')]+_0x435785[_0x4b04('0x1f')];var _0x390e4f;if(_0x3115b7>=_0x19de92){_0x3115b7=_0x19de92;_0x390e4f=0xc8;}else{_0x390e4f=0xce;}_0x5763d5['status'](_0x390e4f);return _0x5763d5[_0x4b04('0x20')](_0x4b04('0x21'),_0x289014+'-'+_0x3115b7+'/'+_0x19de92)['json'](_0x4e044f);}return null;};}function patchUpdates(_0x238b1a){return function(_0x43601b){try{jsonpatch[_0x4b04('0x22')](_0x43601b,_0x238b1a,!![]);}catch(_0x508764){return BPromise[_0x4b04('0x23')](_0x508764);}return _0x43601b['save']();};}function saveUpdates(_0x1110d3,_0x3a47d7){return function(_0x5d121f){if(_0x5d121f){return _0x5d121f[_0x4b04('0x24')](_0x1110d3)[_0x4b04('0x25')](function(_0x2a1b6b){return _0x2a1b6b;});}return null;};}function removeEntity(_0xe61c7b,_0x2066c5){return function(_0x16e037){if(_0x16e037){return _0x16e037[_0x4b04('0x26')]()['then'](function(){_0xe61c7b[_0x4b04('0x1a')](0xcc)[_0x4b04('0x1b')]();});}};}function handleEntityNotFound(_0x18c668,_0x5e8c9d){return function(_0x36e8f9){if(!_0x36e8f9){_0x18c668[_0x4b04('0x27')](0x194);}return _0x36e8f9;};}function handleError(_0x4e9c20,_0x4bbfdd){_0x4bbfdd=_0x4bbfdd||0x1f4;return function(_0x290ee0){logger[_0x4b04('0x28')](_0x290ee0[_0x4b04('0x29')]);if(_0x290ee0[_0x4b04('0x2a')]){delete _0x290ee0[_0x4b04('0x2a')];}_0x4e9c20[_0x4b04('0x1a')](_0x4bbfdd)[_0x4b04('0x2b')](_0x290ee0);};}exports[_0x4b04('0x2c')]=function(_0x6d9b,_0x14adda){var _0x53461f={},_0x2539e8={},_0x5d47b1={'count':0x0,'rows':[]};var _0x5435c9=_[_0x4b04('0x2d')](db[_0x4b04('0x2e')][_0x4b04('0x2f')],function(_0x412b1c){return{'name':_0x412b1c[_0x4b04('0x30')],'type':_0x412b1c['type'][_0x4b04('0x31')]};});_0x2539e8[_0x4b04('0x32')]=_['map'](_0x5435c9,_0x4b04('0x2a'));_0x2539e8[_0x4b04('0x33')]=_[_0x4b04('0x34')](_0x6d9b[_0x4b04('0x33')]);_0x2539e8[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x2539e8['model'],_0x2539e8[_0x4b04('0x33')]);_0x53461f[_0x4b04('0x37')]=_[_0x4b04('0x36')](_0x2539e8['model'],qs[_0x4b04('0x38')](_0x6d9b[_0x4b04('0x33')][_0x4b04('0x38')]));_0x53461f['attributes']=_0x53461f['attributes'][_0x4b04('0x39')]?_0x53461f['attributes']:_0x2539e8['model'];if(!_0x6d9b[_0x4b04('0x33')][_0x4b04('0x3a')](_0x4b04('0x3b'))){_0x53461f[_0x4b04('0x1f')]=qs[_0x4b04('0x1f')](_0x6d9b[_0x4b04('0x33')][_0x4b04('0x1f')]);_0x53461f[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x6d9b[_0x4b04('0x33')][_0x4b04('0x1c')]);}_0x53461f[_0x4b04('0x3c')]=qs[_0x4b04('0x3d')](_0x6d9b[_0x4b04('0x33')][_0x4b04('0x3d')]);_0x53461f[_0x4b04('0x3e')]=qs[_0x4b04('0x35')](_[_0x4b04('0x3f')](_0x6d9b[_0x4b04('0x33')],_0x2539e8[_0x4b04('0x35')]),_0x5435c9);if(_0x6d9b[_0x4b04('0x33')][_0x4b04('0x40')]){_0x53461f[_0x4b04('0x3e')]=_[_0x4b04('0x41')](_0x53461f[_0x4b04('0x3e')],{'$or':_[_0x4b04('0x2d')](_0x5435c9,function(_0x57feb1){if(_0x57feb1[_0x4b04('0x42')]!=='VIRTUAL'){var _0x3351f5={};_0x3351f5[_0x57feb1['name']]={'$like':'%'+_0x6d9b[_0x4b04('0x33')][_0x4b04('0x40')]+'%'};return _0x3351f5;}})});}_0x53461f=_[_0x4b04('0x41')]({},_0x53461f,_0x6d9b[_0x4b04('0x43')]);var _0x444090={'where':_0x53461f[_0x4b04('0x3e')]};return db[_0x4b04('0x2e')][_0x4b04('0x1e')](_0x444090)[_0x4b04('0x25')](function(_0x5f294a){_0x5d47b1[_0x4b04('0x1e')]=_0x5f294a;if(_0x6d9b[_0x4b04('0x33')]['includeAll']){_0x53461f[_0x4b04('0x44')]=[{'all':!![]}];}return db[_0x4b04('0x2e')][_0x4b04('0x45')](_0x53461f);})[_0x4b04('0x25')](function(_0x227db2){_0x5d47b1[_0x4b04('0x46')]=_0x227db2;return _0x5d47b1;})[_0x4b04('0x25')](respondWithFilteredResult(_0x14adda,_0x53461f))[_0x4b04('0x47')](handleError(_0x14adda,null));};exports[_0x4b04('0x48')]=function(_0x4c2398,_0x52e6de){var _0x3a46d0={'raw':!![],'where':{'id':_0x4c2398['params']['id']}},_0x53e0b0={};_0x53e0b0[_0x4b04('0x32')]=_[_0x4b04('0x34')](db[_0x4b04('0x2e')][_0x4b04('0x2f')]);_0x53e0b0[_0x4b04('0x33')]=_[_0x4b04('0x34')](_0x4c2398[_0x4b04('0x33')]);_0x53e0b0[_0x4b04('0x35')]=_['intersection'](_0x53e0b0['model'],_0x53e0b0['query']);_0x3a46d0[_0x4b04('0x37')]=_[_0x4b04('0x36')](_0x53e0b0[_0x4b04('0x32')],qs[_0x4b04('0x38')](_0x4c2398[_0x4b04('0x33')][_0x4b04('0x38')]));_0x3a46d0['attributes']=_0x3a46d0[_0x4b04('0x37')][_0x4b04('0x39')]?_0x3a46d0['attributes']:_0x53e0b0[_0x4b04('0x32')];if(_0x4c2398[_0x4b04('0x33')][_0x4b04('0x49')]){_0x3a46d0[_0x4b04('0x44')]=[{'all':!![]}];}_0x3a46d0=_['merge']({},_0x3a46d0,_0x4c2398['options']);return db[_0x4b04('0x2e')][_0x4b04('0x4a')](_0x3a46d0)[_0x4b04('0x25')](handleEntityNotFound(_0x52e6de,null))['then'](respondWithResult(_0x52e6de,null))[_0x4b04('0x47')](handleError(_0x52e6de,null));};exports[_0x4b04('0x24')]=function(_0x34b8e3,_0x21a3ca){if(_0x34b8e3[_0x4b04('0x4b')]['id']){delete _0x34b8e3[_0x4b04('0x4b')]['id'];}return db[_0x4b04('0x2e')][_0x4b04('0x4a')]({'where':{'id':_0x34b8e3['params']['id']}})[_0x4b04('0x25')](handleEntityNotFound(_0x21a3ca,null))['then'](saveUpdates(_0x34b8e3[_0x4b04('0x4b')],null))[_0x4b04('0x25')](respondWithResult(_0x21a3ca,null))[_0x4b04('0x47')](handleError(_0x21a3ca,null));};exports[_0x4b04('0x26')]=function(_0x26ec4a,_0x4985a1){return db[_0x4b04('0x2e')]['find']({'where':{'id':_0x26ec4a[_0x4b04('0x4c')]['id']}})[_0x4b04('0x25')](handleEntityNotFound(_0x4985a1,null))[_0x4b04('0x25')](removeEntity(_0x4985a1,null))[_0x4b04('0x47')](handleError(_0x4985a1,null));};exports[_0x4b04('0x4d')]=function(_0x2258b8,_0x221fd9){return db[_0x4b04('0x2e')]['describe']()[_0x4b04('0x25')](respondWithResult(_0x221fd9,null))[_0x4b04('0x47')](handleError(_0x221fd9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 970b414..2e77d69 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 _0x5057=['cm_hopper_black','lodash','util','../../config/logger','api','request-promise','rimraf','exports','define','CmHopperBlack'];(function(_0x5cad07,_0x14e750){var _0x3fecdb=function(_0xa09ee5){while(--_0xa09ee5){_0x5cad07['push'](_0x5cad07['shift']());}};_0x3fecdb(++_0x14e750);}(_0x5057,0xdd));var _0x7505=function(_0x3ad2ec,_0x56d0e5){_0x3ad2ec=_0x3ad2ec-0x0;var _0x4c9852=_0x5057[_0x3ad2ec];return _0x4c9852;};'use strict';var _=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var logger=require(_0x7505('0x2'))(_0x7505('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7505('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7505('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x7505('0x6')]=function(_0x3058e8,_0x12a219){return _0x3058e8[_0x7505('0x7')](_0x7505('0x8'),attributes,{'tableName':_0x7505('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86dc=['request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x706a3a,_0x2261b4){var _0x49f112=function(_0x14f6d2){while(--_0x14f6d2){_0x706a3a['push'](_0x706a3a['shift']());}};_0x49f112(++_0x2261b4);}(_0x86dc,0x78));var _0xc86d=function(_0x3cd98a,_0x4d7426){_0x3cd98a=_0x3cd98a-0x0;var _0x5cf775=_0x86dc[_0x3cd98a];return _0x5cf775;};'use strict';var _=require(_0xc86d('0x0'));var util=require(_0xc86d('0x1'));var logger=require(_0xc86d('0x2'))(_0xc86d('0x3'));var moment=require(_0xc86d('0x4'));var BPromise=require(_0xc86d('0x5'));var rp=require(_0xc86d('0x6'));var fs=require('fs');var path=require(_0xc86d('0x7'));var rimraf=require('rimraf');var config=require(_0xc86d('0x8'));var attributes=require(_0xc86d('0x9'));module[_0xc86d('0xa')]=function(_0x4dfcef,_0x21ae0b){return _0x4dfcef[_0xc86d('0xb')](_0xc86d('0xc'),attributes,{'tableName':_0xc86d('0xd'),'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 91ff13c..961abdc 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 _0x300c=['../../config/environment','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x165430,_0x45cce0){var _0x7fc920=function(_0x42cd6d){while(--_0x42cd6d){_0x165430['push'](_0x165430['shift']());}};_0x7fc920(++_0x45cce0);}(_0x300c,0x69));var _0xc300=function(_0x42e1ba,_0x21e380){_0x42e1ba=_0x42e1ba-0x0;var _0xef0f7e=_0x300c[_0x42e1ba];return _0xef0f7e;};'use strict';var _=require(_0xc300('0x0'));var util=require(_0xc300('0x1'));var moment=require(_0xc300('0x2'));var BPromise=require(_0xc300('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc300('0x4'));var db=require(_0xc300('0x5'))['db'];var utils=require(_0xc300('0x6'));var logger=require(_0xc300('0x7'))(_0xc300('0x8'));var config=require(_0xc300('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc300('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e4db,_0x563212,_0x3d1f74){return new BPromise(function(_0x8e1ace,_0x5f4b5c){return client[_0xc300('0xb')](_0x55e4db,_0x3d1f74)[_0xc300('0xc')](function(_0x429cc8){logger[_0xc300('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x563212,_0xc300('0xe'));logger[_0xc300('0xf')](_0xc300('0x10'),_0x563212,'request\x20sent',JSON[_0xc300('0x11')](_0x429cc8));if(_0x429cc8[_0xc300('0x12')]){if(_0x429cc8[_0xc300('0x12')][_0xc300('0x13')]===0x1f4){logger[_0xc300('0x12')](_0xc300('0x14'),_0x563212,_0x429cc8[_0xc300('0x12')][_0xc300('0x15')]);return _0x5f4b5c(_0x429cc8[_0xc300('0x12')][_0xc300('0x15')]);}logger[_0xc300('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x563212,_0x429cc8[_0xc300('0x12')][_0xc300('0x15')]);return _0x8e1ace(_0x429cc8[_0xc300('0x12')][_0xc300('0x15')]);}else{logger[_0xc300('0xd')](_0xc300('0x14'),_0x563212,'request\x20sent');_0x8e1ace(_0x429cc8[_0xc300('0x16')][_0xc300('0x15')]);}})['catch'](function(_0x345956){logger['error'](_0xc300('0x14'),_0x563212,_0x345956);_0x5f4b5c(_0x345956);});});}exports[_0xc300('0x17')]=function(_0xd4ea7d){var _0x1da693=this;return new Promise(function(_0x105dbb,_0x44afd3){return db[_0xc300('0x18')]['findAll']({'raw':_0xd4ea7d[_0xc300('0x19')]?_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1a')]===undefined?!![]:![]:!![],'where':_0xd4ea7d[_0xc300('0x19')]?_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1b')]||null:null,'attributes':_0xd4ea7d[_0xc300('0x19')]?_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1c')]||null:null,'limit':_0xd4ea7d[_0xc300('0x19')]?_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1d')]||null:null,'include':_0xd4ea7d[_0xc300('0x19')]?_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1e')]?_[_0xc300('0x1f')](_0xd4ea7d[_0xc300('0x19')][_0xc300('0x1e')],function(_0x555c72){return{'model':db[_0x555c72[_0xc300('0x20')]],'as':_0x555c72['as'],'attributes':_0x555c72[_0xc300('0x1c')],'include':_0x555c72[_0xc300('0x1e')]?_[_0xc300('0x1f')](_0x555c72[_0xc300('0x1e')],function(_0x265d7f){return{'model':db[_0x265d7f[_0xc300('0x20')]],'as':_0x265d7f['as'],'attributes':_0x265d7f['attributes'],'include':_0x265d7f[_0xc300('0x1e')]?_[_0xc300('0x1f')](_0x265d7f['include'],function(_0xa1c49c){return{'model':db[_0xa1c49c[_0xc300('0x20')]],'as':_0xa1c49c['as'],'attributes':_0xa1c49c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16c4f3){logger['info']('GetCmHopperBlack',_0xd4ea7d);logger[_0xc300('0xf')](_0xc300('0x17'),_0xd4ea7d,JSON['stringify'](_0x16c4f3));_0x105dbb(_0x16c4f3);})[_0xc300('0x21')](function(_0x1f679d){logger[_0xc300('0x12')](_0xc300('0x17'),_0x1f679d['message'],_0xd4ea7d);_0x44afd3(_0x1da693[_0xc300('0x12')](0x1f4,_0x1f679d[_0xc300('0x15')]));});});};exports[_0xc300('0x22')]=function(_0x5ea199){var _0x582dc6=this;return new Promise(function(_0x40ecfe,_0x42767e){return db['CmHopperBlack']['update'](_0x5ea199[_0xc300('0x23')],{'raw':_0x5ea199[_0xc300('0x19')]?_0x5ea199[_0xc300('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ea199[_0xc300('0x19')]?_0x5ea199[_0xc300('0x19')][_0xc300('0x1b')]||null:null,'attributes':_0x5ea199[_0xc300('0x19')]?_0x5ea199['options'][_0xc300('0x1c')]||null:null,'limit':_0x5ea199[_0xc300('0x19')]?_0x5ea199[_0xc300('0x19')][_0xc300('0x1d')]||null:null})[_0xc300('0xc')](function(_0x32a677){logger[_0xc300('0xd')](_0xc300('0x22'),_0x5ea199);logger['debug'](_0xc300('0x22'),_0x5ea199,JSON[_0xc300('0x11')](_0x32a677));_0x40ecfe(_0x32a677);})[_0xc300('0x21')](function(_0x1909ae){logger[_0xc300('0x12')](_0xc300('0x22'),_0x1909ae['message'],_0x5ea199);_0x42767e(_0x582dc6[_0xc300('0x12')](0x1f4,_0x1909ae[_0xc300('0x15')]));});});};exports[_0xc300('0x24')]=function(_0x358881){var _0x11c18f=this;return new Promise(function(_0x5f4a2f,_0x1d8d1e){return db[_0xc300('0x18')][_0xc300('0x25')]({'where':_0x358881[_0xc300('0x19')]?_0x358881['options'][_0xc300('0x1b')]||null:null})[_0xc300('0xc')](function(_0x4a26ee){logger[_0xc300('0xd')](_0xc300('0x24'),_0x358881);logger[_0xc300('0xf')](_0xc300('0x24'),_0x358881,JSON[_0xc300('0x11')](_0x4a26ee));_0x5f4a2f(_0x4a26ee);})[_0xc300('0x21')](function(_0x2d38f4){logger['error'](_0xc300('0x24'),_0x2d38f4[_0xc300('0x15')],_0x358881);_0x1d8d1e(_0x11c18f[_0xc300('0x12')](0x1f4,_0x2d38f4['message']));});});}; \ No newline at end of file +var _0x3829=['result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','attributes','model','then','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s'];(function(_0x10d341,_0x57ff35){var _0xddc36d=function(_0x1c24f0){while(--_0x1c24f0){_0x10d341['push'](_0x10d341['shift']());}};_0xddc36d(++_0x57ff35);}(_0x3829,0xb3));var _0x9382=function(_0x34692e,_0x2a932b){_0x34692e=_0x34692e-0x0;var _0x58481f=_0x3829[_0x34692e];return _0x58481f;};'use strict';var _=require(_0x9382('0x0'));var util=require(_0x9382('0x1'));var moment=require(_0x9382('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9382('0x3'));var db=require(_0x9382('0x4'))['db'];var utils=require(_0x9382('0x5'));var logger=require(_0x9382('0x6'))(_0x9382('0x7'));var config=require(_0x9382('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9382('0x9')][_0x9382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367c66,_0x1f3995,_0x857b5b){return new BPromise(function(_0x3d2ae0,_0x1e9859){return client[_0x9382('0xb')](_0x367c66,_0x857b5b)['then'](function(_0x295402){logger[_0x9382('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1f3995,_0x9382('0xd'));logger[_0x9382('0xe')](_0x9382('0xf'),_0x1f3995,_0x9382('0xd'),JSON[_0x9382('0x10')](_0x295402));if(_0x295402['error']){if(_0x295402[_0x9382('0x11')][_0x9382('0x12')]===0x1f4){logger[_0x9382('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x1f3995,_0x295402[_0x9382('0x11')]['message']);return _0x1e9859(_0x295402[_0x9382('0x11')][_0x9382('0x13')]);}logger[_0x9382('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x1f3995,_0x295402['error'][_0x9382('0x13')]);return _0x3d2ae0(_0x295402['error'][_0x9382('0x13')]);}else{logger['info'](_0x9382('0x14'),_0x1f3995,_0x9382('0xd'));_0x3d2ae0(_0x295402[_0x9382('0x15')][_0x9382('0x13')]);}})[_0x9382('0x16')](function(_0x526edc){logger[_0x9382('0x11')](_0x9382('0x14'),_0x1f3995,_0x526edc);_0x1e9859(_0x526edc);});});}exports[_0x9382('0x17')]=function(_0x3d81dd){var _0xae7ae2=this;return new Promise(function(_0x324b40,_0x1b869e){return db[_0x9382('0x18')][_0x9382('0x19')]({'raw':_0x3d81dd[_0x9382('0x1a')]?_0x3d81dd[_0x9382('0x1a')][_0x9382('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d81dd['options']?_0x3d81dd[_0x9382('0x1a')]['where']||null:null,'attributes':_0x3d81dd[_0x9382('0x1a')]?_0x3d81dd['options']['attributes']||null:null,'limit':_0x3d81dd[_0x9382('0x1a')]?_0x3d81dd[_0x9382('0x1a')][_0x9382('0x1c')]||null:null,'include':_0x3d81dd[_0x9382('0x1a')]?_0x3d81dd[_0x9382('0x1a')][_0x9382('0x1d')]?_['map'](_0x3d81dd[_0x9382('0x1a')][_0x9382('0x1d')],function(_0x3fef70){return{'model':db[_0x3fef70['model']],'as':_0x3fef70['as'],'attributes':_0x3fef70['attributes'],'include':_0x3fef70[_0x9382('0x1d')]?_[_0x9382('0x1e')](_0x3fef70[_0x9382('0x1d')],function(_0x1dbf33){return{'model':db[_0x1dbf33['model']],'as':_0x1dbf33['as'],'attributes':_0x1dbf33[_0x9382('0x1f')],'include':_0x1dbf33[_0x9382('0x1d')]?_[_0x9382('0x1e')](_0x1dbf33['include'],function(_0x4541dc){return{'model':db[_0x4541dc[_0x9382('0x20')]],'as':_0x4541dc['as'],'attributes':_0x4541dc[_0x9382('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9382('0x21')](function(_0x2273da){logger['info'](_0x9382('0x17'),_0x3d81dd);logger[_0x9382('0xe')](_0x9382('0x17'),_0x3d81dd,JSON['stringify'](_0x2273da));_0x324b40(_0x2273da);})[_0x9382('0x16')](function(_0x4a1403){logger[_0x9382('0x11')](_0x9382('0x17'),_0x4a1403['message'],_0x3d81dd);_0x1b869e(_0xae7ae2['error'](0x1f4,_0x4a1403[_0x9382('0x13')]));});});};exports[_0x9382('0x22')]=function(_0x259dd7){var _0x1f69df=this;return new Promise(function(_0x1af370,_0x2ecdaa){return db[_0x9382('0x18')][_0x9382('0x23')](_0x259dd7[_0x9382('0x24')],{'raw':_0x259dd7[_0x9382('0x1a')]?_0x259dd7[_0x9382('0x1a')][_0x9382('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x259dd7['options']?_0x259dd7[_0x9382('0x1a')][_0x9382('0x25')]||null:null,'attributes':_0x259dd7[_0x9382('0x1a')]?_0x259dd7[_0x9382('0x1a')][_0x9382('0x1f')]||null:null,'limit':_0x259dd7[_0x9382('0x1a')]?_0x259dd7[_0x9382('0x1a')][_0x9382('0x1c')]||null:null})[_0x9382('0x21')](function(_0x44a0ab){logger[_0x9382('0xc')](_0x9382('0x22'),_0x259dd7);logger['debug']('UpdateCmHopperBlack',_0x259dd7,JSON[_0x9382('0x10')](_0x44a0ab));_0x1af370(_0x44a0ab);})['catch'](function(_0x103fde){logger['error'](_0x9382('0x22'),_0x103fde[_0x9382('0x13')],_0x259dd7);_0x2ecdaa(_0x1f69df[_0x9382('0x11')](0x1f4,_0x103fde[_0x9382('0x13')]));});});};exports[_0x9382('0x26')]=function(_0x237b60){var _0x1c9992=this;return new Promise(function(_0x2ff0cd,_0x592c80){return db['CmHopperBlack'][_0x9382('0x27')]({'where':_0x237b60[_0x9382('0x1a')]?_0x237b60['options'][_0x9382('0x25')]||null:null})['then'](function(_0x3c32ab){logger[_0x9382('0xc')](_0x9382('0x26'),_0x237b60);logger[_0x9382('0xe')](_0x9382('0x26'),_0x237b60,JSON[_0x9382('0x10')](_0x3c32ab));_0x2ff0cd(_0x3c32ab);})[_0x9382('0x16')](function(_0x129efe){logger[_0x9382('0x11')]('DestroyCmHopperBlack',_0x129efe[_0x9382('0x13')],_0x237b60);_0x592c80(_0x1c9992[_0x9382('0x11')](0x1f4,_0x129efe['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 4140c29..f56c8e2 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 _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x4faf39,_0x266abd){var _0xbd062a=function(_0x555684){while(--_0x555684){_0x4faf39['push'](_0x4faf39['shift']());}};_0xbd062a(++_0x266abd);}(_0x82c4,0x1ca));var _0x482c=function(_0x25f2bc,_0x3fd38a){_0x25f2bc=_0x25f2bc-0x0;var _0x21bd7=_0x82c4[_0x25f2bc];return _0x21bd7;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4bd3=['put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x4bd3,0x174));var _0x34bd=function(_0x38f4ff,_0x26ded7){_0x38f4ff=_0x38f4ff-0x0;var _0x5c46c3=_0x4bd3[_0x38f4ff];return _0x5c46c3;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./cmHopperBlack.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/:id',auth[_0x34bd('0x7')](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 4efcf1c..ff23d04 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 _0x19b1=['endtime','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x19b1,0xf6));var _0x119b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x19b1[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x119b('0x0'));var moment=require(_0x119b('0x1'));module[_0x119b('0x2')]={'state':{'type':Sequelize[_0x119b('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x119b('0x4')]},'scheduledat':{'type':Sequelize[_0x119b('0x5')]},'countbusyretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x119b('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x119b('0x4')]},'originatecalleridname':{'type':Sequelize[_0x119b('0x4')]},'calleridnum':{'type':Sequelize[_0x119b('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x119b('0x5')]},'responsetime':{'type':Sequelize[_0x119b('0x5')]},'answertime':{'type':Sequelize[_0x119b('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x119b('0x5')]},'ringtime':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x119b('0x4')]},'campaign':{'type':Sequelize[_0x119b('0x4')]},'campaigntype':{'type':Sequelize[_0x119b('0x4')]},'membername':{'type':Sequelize[_0x119b('0x4')]},'reason':{'type':Sequelize[_0x119b('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x119b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x119b('0x4')]},'dispositionat':{'type':Sequelize[_0x119b('0x5')],'set':function(_0x521487){var _0x2f3849=this[_0x119b('0x6')](_0x119b('0x7'));if(_0x2f3849&&_0x521487){this['setDataValue'](_0x119b('0x8'),moment(_0x521487)[_0x119b('0x9')](moment(_0x2f3849),'seconds'));}return this['setDataValue']('dispositionat',_0x521487);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x119b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x119b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x119b('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x119b('0x5')]},'callback':{'type':Sequelize[_0x119b('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x119b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x119b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x119b('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x119b('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x119b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0f80=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f80,0x1ab));var _0x00f8=function(_0x31e438,_0x3d90ad){_0x31e438=_0x31e438-0x0;var _0xe8fbd7=_0x0f80[_0x31e438];return _0xe8fbd7;};'use strict';var Sequelize=require(_0x00f8('0x0'));var moment=require(_0x00f8('0x1'));module[_0x00f8('0x2')]={'state':{'type':Sequelize[_0x00f8('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x00f8('0x4')]},'scheduledat':{'type':Sequelize[_0x00f8('0x5')]},'countbusyretry':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x00f8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x00f8('0x4')]},'originatecalleridname':{'type':Sequelize[_0x00f8('0x4')]},'calleridnum':{'type':Sequelize[_0x00f8('0x4')]},'calleridname':{'type':Sequelize[_0x00f8('0x4')]},'starttime':{'type':Sequelize[_0x00f8('0x5')]},'responsetime':{'type':Sequelize[_0x00f8('0x5')]},'answertime':{'type':Sequelize[_0x00f8('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x00f8('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x00f8('0x4')]},'campaign':{'type':Sequelize[_0x00f8('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x00f8('0x4')]},'secondDisposition':{'type':Sequelize[_0x00f8('0x4')]},'thirdDisposition':{'type':Sequelize[_0x00f8('0x4')]},'dispositionat':{'type':Sequelize[_0x00f8('0x5')],'set':function(_0x5e96f6){var _0xd10352=this[_0x00f8('0x6')](_0x00f8('0x7'));if(_0xd10352&&_0x5e96f6){this[_0x00f8('0x8')](_0x00f8('0x9'),moment(_0x5e96f6)['diff'](moment(_0xd10352),_0x00f8('0xa')));}return this[_0x00f8('0x8')](_0x00f8('0xb'),_0x5e96f6);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x00f8('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x00f8('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x00f8('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x00f8('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x00f8('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x00f8('0x5')]},'recallme':{'type':Sequelize[_0x00f8('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x00f8('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x00f8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x00f8('0x3')],'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 0ff3f7d..489692b 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 _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x5d17,0x114));var _0x75d1=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x5d17[_0x18d631];return _0x50d708;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file +var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x526a76,_0x39446e){var _0x4f010f=function(_0x67b80c){while(--_0x67b80c){_0x526a76['push'](_0x526a76['shift']());}};_0x4f010f(++_0x39446e);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 89a4968..235823b 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 _0x0b05=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./cmHopperFinal.attributes'];(function(_0x12fb34,_0x383774){var _0xf5c6bf=function(_0x1d38b1){while(--_0x1d38b1){_0x12fb34['push'](_0x12fb34['shift']());}};_0xf5c6bf(++_0x383774);}(_0x0b05,0x1f0));var _0x50b0=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0b05[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x50b0('0x0'));var util=require('util');var logger=require(_0x50b0('0x1'))(_0x50b0('0x2'));var moment=require(_0x50b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x50b0('0x4'));var fs=require('fs');var path=require(_0x50b0('0x5'));var rimraf=require(_0x50b0('0x6'));var config=require('../../config/environment');var attributes=require(_0x50b0('0x7'));module[_0x50b0('0x8')]=function(_0x4f8966,_0x331def){return _0x4f8966[_0x50b0('0x9')](_0x50b0('0xa'),attributes,{'tableName':_0x50b0('0xb'),'paranoid':![],'indexes':[{'name':_0x50b0('0xc'),'fields':[_0x50b0('0xc')]},{'name':_0x50b0('0xd'),'fields':[_0x50b0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa144=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x13e0d1,_0x3c0ef0){var _0xd74af6=function(_0x61c36f){while(--_0x61c36f){_0x13e0d1['push'](_0x13e0d1['shift']());}};_0xd74af6(++_0x3c0ef0);}(_0xa144,0x1b1));var _0x4a14=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa144[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x4a14('0x0'));var util=require(_0x4a14('0x1'));var logger=require(_0x4a14('0x2'))(_0x4a14('0x3'));var moment=require('moment');var BPromise=require(_0x4a14('0x4'));var rp=require(_0x4a14('0x5'));var fs=require('fs');var path=require(_0x4a14('0x6'));var rimraf=require(_0x4a14('0x7'));var config=require(_0x4a14('0x8'));var attributes=require(_0x4a14('0x9'));module['exports']=function(_0x22c214,_0xa91655){return _0x22c214['define'](_0x4a14('0xa'),attributes,{'tableName':_0x4a14('0xb'),'paranoid':![],'indexes':[{'name':_0x4a14('0xc'),'fields':[_0x4a14('0xc')]},{'name':'uniqueid','fields':[_0x4a14('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index be22b87..16c1a02 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(_0x13b725,_0x14550e){var _0x782d94=function(_0x3f2b4f){while(--_0x3f2b4f){_0x13b725['push'](_0x13b725['shift']());}};_0x782d94(++_0x14550e);}(_0x7a54,0x106));var _0x47a5=function(_0x259fa7,_0x30c697){_0x259fa7=_0x259fa7-0x0;var _0x203962=_0x7a54[_0x259fa7];return _0x203962;};'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(_0x3c30e9,_0x5f5bdd){var _0x482a17=function(_0x27ce8e){while(--_0x27ce8e){_0x3c30e9['push'](_0x3c30e9['shift']());}};_0x482a17(++_0x5f5bdd);}(_0x7a54,0x106));var _0x47a5=function(_0xf83f02,_0x1d6003){_0xf83f02=_0xf83f02-0x0;var _0x55333b=_0x7a54[_0xf83f02];return _0x55333b;};'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 3e27dfa..44d4a9f 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 _0x00ca=['multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports'];(function(_0x2813fa,_0x3211d4){var _0x8a2acb=function(_0x4a9602){while(--_0x4a9602){_0x2813fa['push'](_0x2813fa['shift']());}};_0x8a2acb(++_0x3211d4);}(_0x00ca,0x96));var _0xa00c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x00ca[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xa00c('0x0'));var util=require(_0xa00c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa00c('0x2'));var router=express['Router']();var fs_extra=require(_0xa00c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa00c('0x4'));var config=require(_0xa00c('0x5'));var controller=require(_0xa00c('0x6'));router[_0xa00c('0x7')]('/',auth[_0xa00c('0x8')](),controller[_0xa00c('0x9')]);router['get']('/describe',auth[_0xa00c('0x8')](),controller[_0xa00c('0xa')]);router[_0xa00c('0x7')](_0xa00c('0xb'),auth[_0xa00c('0x8')](),controller[_0xa00c('0xc')]);router[_0xa00c('0x7')]('/voice/queue/countAttributes/:id',auth[_0xa00c('0x8')](),controller[_0xa00c('0xd')]);router['get'](_0xa00c('0xe'),auth[_0xa00c('0x8')](),controller[_0xa00c('0xf')]);router[_0xa00c('0x10')](_0xa00c('0x11'),auth[_0xa00c('0x8')](),controller[_0xa00c('0x12')]);router[_0xa00c('0x10')](_0xa00c('0x13'),auth[_0xa00c('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xa00c('0x10')](_0xa00c('0x14'),auth[_0xa00c('0x8')](),controller[_0xa00c('0x15')]);router[_0xa00c('0x16')]('/:id',auth[_0xa00c('0x8')](),controller[_0xa00c('0x17')]);module[_0xa00c('0x18')]=router; \ No newline at end of file +var _0x084b=['index','/describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x084b,0xd5));var _0xb084=function(_0x3c5ba1,_0x1d30b3){_0x3c5ba1=_0x3c5ba1-0x0;var _0x1201ad=_0x084b[_0x3c5ba1];return _0x1201ad;};'use strict';var multer=require(_0xb084('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb084('0x1'));var router=express[_0xb084('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb084('0x3'));var interaction=require(_0xb084('0x4'));var config=require(_0xb084('0x5'));var controller=require('./cmHopperFinal.controller');router[_0xb084('0x6')]('/',auth['isAuthenticated'](),controller[_0xb084('0x7')]);router[_0xb084('0x6')](_0xb084('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xb084('0x6')](_0xb084('0x9'),auth[_0xb084('0xa')](),controller[_0xb084('0xb')]);router[_0xb084('0x6')](_0xb084('0xc'),auth[_0xb084('0xa')](),controller[_0xb084('0xd')]);router[_0xb084('0x6')](_0xb084('0xe'),auth[_0xb084('0xa')](),controller[_0xb084('0xf')]);router[_0xb084('0x10')](_0xb084('0x11'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb084('0x10')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0xb084('0x12')]);router[_0xb084('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xb084('0x13')]);router[_0xb084('0x14')](_0xb084('0x9'),auth[_0xb084('0xa')](),controller[_0xb084('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b71925f..564b3f9 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 _0xc090=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc090,0x132));var _0x0c09=function(_0x46f8cc,_0x490768){_0x46f8cc=_0x46f8cc-0x0;var _0x53dc3c=_0xc090[_0x46f8cc];return _0x53dc3c;};'use strict';var Sequelize=require(_0x0c09('0x0'));module[_0x0c09('0x1')]={'state':{'type':Sequelize[_0x0c09('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0c09('0x3')]},'scheduledat':{'type':Sequelize[_0x0c09('0x4')]},'countbusyretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0c09('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0c09('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0c09('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0c09('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0c09('0x4')]},'answertime':{'type':Sequelize[_0x0c09('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0c09('0x4')]},'ringtime':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0c09('0x3')]},'amd':{'type':Sequelize[_0x0c09('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0c09('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0c09('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0c09('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x0c09('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0c09('0x4')]},'edited':{'type':Sequelize[_0x0c09('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0c09('0x3')]}}; \ No newline at end of file +var _0xa7ad=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x494e72,_0x5f1178){var _0x2d3947=function(_0x165f2b){while(--_0x165f2b){_0x494e72['push'](_0x494e72['shift']());}};_0x2d3947(++_0x5f1178);}(_0xa7ad,0x168));var _0xda7a=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xa7ad[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0xda7a('0x0'));module[_0xda7a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xda7a('0x2')]},'scheduledat':{'type':Sequelize[_0xda7a('0x3')]},'countbusyretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xda7a('0x2')]},'originatecalleridname':{'type':Sequelize[_0xda7a('0x2')]},'calleridnum':{'type':Sequelize[_0xda7a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xda7a('0x3')]},'responsetime':{'type':Sequelize[_0xda7a('0x3')]},'answertime':{'type':Sequelize[_0xda7a('0x3')]},'droptime':{'type':Sequelize[_0xda7a('0x3')]},'endtime':{'type':Sequelize[_0xda7a('0x3')]},'ringtime':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xda7a('0x2')]},'campaign':{'type':Sequelize[_0xda7a('0x2')]},'campaigntype':{'type':Sequelize[_0xda7a('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xda7a('0x2')]},'amd':{'type':Sequelize[_0xda7a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xda7a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xda7a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xda7a('0x3')]},'edited':{'type':Sequelize[_0xda7a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xda7a('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xda7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index bfd499a..f867a53 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 _0x7166=['set','Content-Range','apply','reject','save','update','then','stack','name','send','CmHopperHistory','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','fields','length','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x3e356a,_0x29a97f){var _0x4646bc=function(_0x344640){while(--_0x344640){_0x3e356a['push'](_0x3e356a['shift']());}};_0x4646bc(++_0x29a97f);}(_0x7166,0x15f));var _0x6716=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x7166[_0x172133];return _0x2460e5;};'use strict';var emlformat=require(_0x6716('0x0'));var rimraf=require(_0x6716('0x1'));var zipdir=require(_0x6716('0x2'));var jsonpatch=require(_0x6716('0x3'));var rp=require(_0x6716('0x4'));var moment=require(_0x6716('0x5'));var BPromise=require(_0x6716('0x6'));var Mustache=require(_0x6716('0x7'));var util=require(_0x6716('0x8'));var path=require(_0x6716('0x9'));var sox=require(_0x6716('0xa'));var csv=require('to-csv');var ejs=require(_0x6716('0xb'));var fs=require('fs');var fs_extra=require(_0x6716('0xc'));var _=require('lodash');var squel=require(_0x6716('0xd'));var crypto=require('crypto');var jsforce=require(_0x6716('0xe'));var deskjs=require(_0x6716('0xf'));var toCsv=require(_0x6716('0x10'));var querystring=require(_0x6716('0x11'));var Papa=require(_0x6716('0x12'));var Redis=require('ioredis');var authService=require(_0x6716('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6716('0x14'));var hardwareService=require(_0x6716('0x15'));var logger=require(_0x6716('0x16'))('api');var utils=require(_0x6716('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6716('0x18'));var db=require(_0x6716('0x19'))['db'];function respondWithStatusCode(_0x1b95bc,_0x254409){_0x254409=_0x254409||0xcc;return function(_0x36057f){if(_0x36057f){return _0x1b95bc[_0x6716('0x1a')](_0x254409);}return _0x1b95bc['status'](_0x254409)[_0x6716('0x1b')]();};}function respondWithResult(_0x5290f4,_0x5dc500){_0x5dc500=_0x5dc500||0xc8;return function(_0xe01dbc){if(_0xe01dbc){return _0x5290f4[_0x6716('0x1c')](_0x5dc500)[_0x6716('0x1d')](_0xe01dbc);}};}function respondWithFilteredResult(_0x177d20,_0x5a5bc5){return function(_0x5204ee){if(_0x5204ee){var _0x133e52=typeof _0x5a5bc5[_0x6716('0x1e')]===_0x6716('0x1f')&&typeof _0x5a5bc5[_0x6716('0x20')]===_0x6716('0x1f');var _0x315677=_0x5204ee['count'];var _0x52622b=_0x133e52?0x0:_0x5a5bc5[_0x6716('0x1e')];var _0x47b190=_0x133e52?_0x5204ee[_0x6716('0x21')]:_0x5a5bc5[_0x6716('0x1e')]+_0x5a5bc5['limit'];var _0x29f383;if(_0x47b190>=_0x315677){_0x47b190=_0x315677;_0x29f383=0xc8;}else{_0x29f383=0xce;}_0x177d20[_0x6716('0x1c')](_0x29f383);return _0x177d20[_0x6716('0x22')](_0x6716('0x23'),_0x52622b+'-'+_0x47b190+'/'+_0x315677)[_0x6716('0x1d')](_0x5204ee);}return null;};}function patchUpdates(_0x3aba5a){return function(_0xdb1d46){try{jsonpatch[_0x6716('0x24')](_0xdb1d46,_0x3aba5a,!![]);}catch(_0x34d464){return BPromise[_0x6716('0x25')](_0x34d464);}return _0xdb1d46[_0x6716('0x26')]();};}function saveUpdates(_0x5c9156,_0x5e6ecc){return function(_0x1efa73){if(_0x1efa73){return _0x1efa73[_0x6716('0x27')](_0x5c9156)[_0x6716('0x28')](function(_0x3f4277){return _0x3f4277;});}return null;};}function removeEntity(_0x59d9db,_0x2a052e){return function(_0x3cd268){if(_0x3cd268){return _0x3cd268['destroy']()[_0x6716('0x28')](function(){_0x59d9db[_0x6716('0x1c')](0xcc)[_0x6716('0x1b')]();});}};}function handleEntityNotFound(_0x56bb08,_0x2ee49c){return function(_0x53d81c){if(!_0x53d81c){_0x56bb08[_0x6716('0x1a')](0x194);}return _0x53d81c;};}function handleError(_0x523f89,_0x5b1cb4){_0x5b1cb4=_0x5b1cb4||0x1f4;return function(_0x5ec601){logger['error'](_0x5ec601[_0x6716('0x29')]);if(_0x5ec601[_0x6716('0x2a')]){delete _0x5ec601[_0x6716('0x2a')];}_0x523f89[_0x6716('0x1c')](_0x5b1cb4)[_0x6716('0x2b')](_0x5ec601);};}exports['index']=function(_0x52b702,_0x5618cd){var _0x44e672={},_0xd64c2a={},_0x198937={'count':0x0,'rows':[]};var _0x3ac0e1=_['map'](db[_0x6716('0x2c')][_0x6716('0x2d')],function(_0x130ae7){return{'name':_0x130ae7['fieldName'],'type':_0x130ae7[_0x6716('0x2e')][_0x6716('0x2f')]};});_0xd64c2a[_0x6716('0x30')]=_[_0x6716('0x31')](_0x3ac0e1,'name');_0xd64c2a['query']=_[_0x6716('0x32')](_0x52b702[_0x6716('0x33')]);_0xd64c2a[_0x6716('0x34')]=_[_0x6716('0x35')](_0xd64c2a['model'],_0xd64c2a[_0x6716('0x33')]);_0x44e672['attributes']=_[_0x6716('0x35')](_0xd64c2a[_0x6716('0x30')],qs['fields'](_0x52b702[_0x6716('0x33')]['fields']));_0x44e672[_0x6716('0x36')]=_0x44e672[_0x6716('0x36')]['length']?_0x44e672[_0x6716('0x36')]:_0xd64c2a[_0x6716('0x30')];if(!_0x52b702[_0x6716('0x33')][_0x6716('0x37')](_0x6716('0x38'))){_0x44e672['limit']=qs['limit'](_0x52b702[_0x6716('0x33')][_0x6716('0x20')]);_0x44e672[_0x6716('0x1e')]=qs['offset'](_0x52b702[_0x6716('0x33')][_0x6716('0x1e')]);}_0x44e672[_0x6716('0x39')]=qs[_0x6716('0x3a')](_0x52b702['query'][_0x6716('0x3a')]);_0x44e672[_0x6716('0x3b')]=qs[_0x6716('0x34')](_[_0x6716('0x3c')](_0x52b702[_0x6716('0x33')],_0xd64c2a['filters']),_0x3ac0e1);if(_0x52b702['query'][_0x6716('0x3d')]){_0x44e672[_0x6716('0x3b')]=_[_0x6716('0x3e')](_0x44e672['where'],{'$or':_[_0x6716('0x31')](_0x3ac0e1,function(_0x9a4f52){if(_0x9a4f52[_0x6716('0x2e')]!==_0x6716('0x3f')){var _0x1bb3cc={};_0x1bb3cc[_0x9a4f52[_0x6716('0x2a')]]={'$like':'%'+_0x52b702[_0x6716('0x33')][_0x6716('0x3d')]+'%'};return _0x1bb3cc;}})});}_0x44e672=_[_0x6716('0x3e')]({},_0x44e672,_0x52b702[_0x6716('0x40')]);var _0x1f8a1a={'where':_0x44e672['where']};return db['CmHopperHistory'][_0x6716('0x21')](_0x1f8a1a)[_0x6716('0x28')](function(_0xdbdf39){_0x198937[_0x6716('0x21')]=_0xdbdf39;if(_0x52b702[_0x6716('0x33')][_0x6716('0x41')]){_0x44e672[_0x6716('0x42')]=[{'all':!![]}];}return db[_0x6716('0x2c')][_0x6716('0x43')](_0x44e672);})[_0x6716('0x28')](function(_0x3a165c){_0x198937['rows']=_0x3a165c;return _0x198937;})[_0x6716('0x28')](respondWithFilteredResult(_0x5618cd,_0x44e672))[_0x6716('0x44')](handleError(_0x5618cd,null));};exports['show']=function(_0x598e79,_0x41453b){var _0x112398={'raw':!![],'where':{'id':_0x598e79[_0x6716('0x45')]['id']}},_0x3101ad={};_0x3101ad[_0x6716('0x30')]=_[_0x6716('0x32')](db[_0x6716('0x2c')]['rawAttributes']);_0x3101ad[_0x6716('0x33')]=_[_0x6716('0x32')](_0x598e79[_0x6716('0x33')]);_0x3101ad[_0x6716('0x34')]=_[_0x6716('0x35')](_0x3101ad[_0x6716('0x30')],_0x3101ad[_0x6716('0x33')]);_0x112398['attributes']=_[_0x6716('0x35')](_0x3101ad[_0x6716('0x30')],qs[_0x6716('0x46')](_0x598e79[_0x6716('0x33')][_0x6716('0x46')]));_0x112398[_0x6716('0x36')]=_0x112398['attributes'][_0x6716('0x47')]?_0x112398[_0x6716('0x36')]:_0x3101ad[_0x6716('0x30')];if(_0x598e79[_0x6716('0x33')][_0x6716('0x41')]){_0x112398['include']=[{'all':!![]}];}_0x112398=_['merge']({},_0x112398,_0x598e79[_0x6716('0x40')]);return db['CmHopperHistory'][_0x6716('0x48')](_0x112398)[_0x6716('0x28')](handleEntityNotFound(_0x41453b,null))['then'](respondWithResult(_0x41453b,null))['catch'](handleError(_0x41453b,null));};exports[_0x6716('0x49')]=function(_0x1e3e5e,_0x27ffbb){return db[_0x6716('0x2c')][_0x6716('0x49')](_0x1e3e5e[_0x6716('0x4a')],{})[_0x6716('0x28')](respondWithResult(_0x27ffbb,0xc9))[_0x6716('0x44')](handleError(_0x27ffbb,null));};exports[_0x6716('0x4b')]=function(_0x2d2b75,_0x188ff0){return db[_0x6716('0x2c')][_0x6716('0x4b')]()[_0x6716('0x28')](respondWithResult(_0x188ff0,null))[_0x6716('0x44')](handleError(_0x188ff0,null));};exports[_0x6716('0x27')]=function(_0x9b4872,_0x3c95a9){if(_0x9b4872[_0x6716('0x4a')]['uniqueid']){delete _0x9b4872['body'][_0x6716('0x4c')];}return db['CmHopperHistory'][_0x6716('0x48')]({'where':{'uniqueid':_0x9b4872[_0x6716('0x45')]['id']}})[_0x6716('0x28')](handleEntityNotFound(_0x3c95a9,null))[_0x6716('0x28')](saveUpdates(_0x9b4872[_0x6716('0x4a')],null))[_0x6716('0x28')](respondWithResult(_0x3c95a9,null))[_0x6716('0x44')](handleError(_0x3c95a9,null));}; \ No newline at end of file +var _0xd8ea=['describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body'];(function(_0x2a7315,_0x3b4a1e){var _0x55b4c8=function(_0x51c9e4){while(--_0x51c9e4){_0x2a7315['push'](_0x2a7315['shift']());}};_0x55b4c8(++_0x3b4a1e);}(_0xd8ea,0x179));var _0xad8e=function(_0x774a25,_0x46f547){_0x774a25=_0x774a25-0x0;var _0x3dc2fd=_0xd8ea[_0x774a25];return _0x3dc2fd;};'use strict';var emlformat=require(_0xad8e('0x0'));var rimraf=require(_0xad8e('0x1'));var zipdir=require(_0xad8e('0x2'));var jsonpatch=require(_0xad8e('0x3'));var rp=require('request-promise');var moment=require(_0xad8e('0x4'));var BPromise=require(_0xad8e('0x5'));var Mustache=require(_0xad8e('0x6'));var util=require(_0xad8e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad8e('0x8'));var fs=require('fs');var fs_extra=require(_0xad8e('0x9'));var _=require('lodash');var squel=require(_0xad8e('0xa'));var crypto=require('crypto');var jsforce=require(_0xad8e('0xb'));var deskjs=require(_0xad8e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad8e('0xd'));var Papa=require('papaparse');var Redis=require(_0xad8e('0xe'));var authService=require(_0xad8e('0xf'));var qs=require(_0xad8e('0x10'));var as=require(_0xad8e('0x11'));var hardwareService=require(_0xad8e('0x12'));var logger=require('../../config/logger')(_0xad8e('0x13'));var utils=require(_0xad8e('0x14'));var config=require(_0xad8e('0x15'));var licenseUtil=require(_0xad8e('0x16'));var db=require(_0xad8e('0x17'))['db'];function respondWithStatusCode(_0x428eca,_0x5e5b36){_0x5e5b36=_0x5e5b36||0xcc;return function(_0x189a32){if(_0x189a32){return _0x428eca[_0xad8e('0x18')](_0x5e5b36);}return _0x428eca[_0xad8e('0x19')](_0x5e5b36)[_0xad8e('0x1a')]();};}function respondWithResult(_0x1fc45d,_0x1b5eec){_0x1b5eec=_0x1b5eec||0xc8;return function(_0x80344c){if(_0x80344c){return _0x1fc45d['status'](_0x1b5eec)['json'](_0x80344c);}};}function respondWithFilteredResult(_0x9f0623,_0x498501){return function(_0x2292a7){if(_0x2292a7){var _0x186a9a=typeof _0x498501[_0xad8e('0x1b')]===_0xad8e('0x1c')&&typeof _0x498501[_0xad8e('0x1d')]===_0xad8e('0x1c');var _0x58ce5d=_0x2292a7['count'];var _0x3ef582=_0x186a9a?0x0:_0x498501[_0xad8e('0x1b')];var _0x417900=_0x186a9a?_0x2292a7[_0xad8e('0x1e')]:_0x498501[_0xad8e('0x1b')]+_0x498501[_0xad8e('0x1d')];var _0x111104;if(_0x417900>=_0x58ce5d){_0x417900=_0x58ce5d;_0x111104=0xc8;}else{_0x111104=0xce;}_0x9f0623['status'](_0x111104);return _0x9f0623[_0xad8e('0x1f')]('Content-Range',_0x3ef582+'-'+_0x417900+'/'+_0x58ce5d)[_0xad8e('0x20')](_0x2292a7);}return null;};}function patchUpdates(_0x3a7c68){return function(_0x2739ad){try{jsonpatch[_0xad8e('0x21')](_0x2739ad,_0x3a7c68,!![]);}catch(_0x27ecfc){return BPromise['reject'](_0x27ecfc);}return _0x2739ad['save']();};}function saveUpdates(_0x55bc1f,_0xd600ea){return function(_0x4c06ac){if(_0x4c06ac){return _0x4c06ac[_0xad8e('0x22')](_0x55bc1f)[_0xad8e('0x23')](function(_0x54aa75){return _0x54aa75;});}return null;};}function removeEntity(_0x1575ed,_0x3a4099){return function(_0x1fa354){if(_0x1fa354){return _0x1fa354[_0xad8e('0x24')]()[_0xad8e('0x23')](function(){_0x1575ed[_0xad8e('0x19')](0xcc)[_0xad8e('0x1a')]();});}};}function handleEntityNotFound(_0x582aff,_0xf7425b){return function(_0x512325){if(!_0x512325){_0x582aff[_0xad8e('0x18')](0x194);}return _0x512325;};}function handleError(_0x468ad5,_0x5891e8){_0x5891e8=_0x5891e8||0x1f4;return function(_0x28f755){logger[_0xad8e('0x25')](_0x28f755[_0xad8e('0x26')]);if(_0x28f755['name']){delete _0x28f755[_0xad8e('0x27')];}_0x468ad5[_0xad8e('0x19')](_0x5891e8)[_0xad8e('0x28')](_0x28f755);};}exports[_0xad8e('0x29')]=function(_0x3ba4a4,_0x319686){var _0x3077e6={},_0x45fe4a={},_0x304f28={'count':0x0,'rows':[]};var _0x413bbb=_[_0xad8e('0x2a')](db[_0xad8e('0x2b')]['rawAttributes'],function(_0x249125){return{'name':_0x249125[_0xad8e('0x2c')],'type':_0x249125[_0xad8e('0x2d')]['key']};});_0x45fe4a['model']=_['map'](_0x413bbb,_0xad8e('0x27'));_0x45fe4a[_0xad8e('0x2e')]=_['keys'](_0x3ba4a4[_0xad8e('0x2e')]);_0x45fe4a[_0xad8e('0x2f')]=_[_0xad8e('0x30')](_0x45fe4a[_0xad8e('0x31')],_0x45fe4a[_0xad8e('0x2e')]);_0x3077e6[_0xad8e('0x32')]=_['intersection'](_0x45fe4a[_0xad8e('0x31')],qs[_0xad8e('0x33')](_0x3ba4a4[_0xad8e('0x2e')]['fields']));_0x3077e6[_0xad8e('0x32')]=_0x3077e6[_0xad8e('0x32')]['length']?_0x3077e6['attributes']:_0x45fe4a['model'];if(!_0x3ba4a4[_0xad8e('0x2e')][_0xad8e('0x34')](_0xad8e('0x35'))){_0x3077e6['limit']=qs[_0xad8e('0x1d')](_0x3ba4a4[_0xad8e('0x2e')][_0xad8e('0x1d')]);_0x3077e6['offset']=qs[_0xad8e('0x1b')](_0x3ba4a4[_0xad8e('0x2e')][_0xad8e('0x1b')]);}_0x3077e6[_0xad8e('0x36')]=qs[_0xad8e('0x37')](_0x3ba4a4['query'][_0xad8e('0x37')]);_0x3077e6[_0xad8e('0x38')]=qs[_0xad8e('0x2f')](_[_0xad8e('0x39')](_0x3ba4a4[_0xad8e('0x2e')],_0x45fe4a['filters']),_0x413bbb);if(_0x3ba4a4[_0xad8e('0x2e')][_0xad8e('0x3a')]){_0x3077e6[_0xad8e('0x38')]=_[_0xad8e('0x3b')](_0x3077e6['where'],{'$or':_['map'](_0x413bbb,function(_0x580140){if(_0x580140[_0xad8e('0x2d')]!==_0xad8e('0x3c')){var _0x24249b={};_0x24249b[_0x580140[_0xad8e('0x27')]]={'$like':'%'+_0x3ba4a4['query'][_0xad8e('0x3a')]+'%'};return _0x24249b;}})});}_0x3077e6=_[_0xad8e('0x3b')]({},_0x3077e6,_0x3ba4a4[_0xad8e('0x3d')]);var _0x1b0ba9={'where':_0x3077e6[_0xad8e('0x38')]};return db[_0xad8e('0x2b')]['count'](_0x1b0ba9)[_0xad8e('0x23')](function(_0x2a5456){_0x304f28['count']=_0x2a5456;if(_0x3ba4a4[_0xad8e('0x2e')][_0xad8e('0x3e')]){_0x3077e6[_0xad8e('0x3f')]=[{'all':!![]}];}return db[_0xad8e('0x2b')][_0xad8e('0x40')](_0x3077e6);})[_0xad8e('0x23')](function(_0x592f0d){_0x304f28['rows']=_0x592f0d;return _0x304f28;})[_0xad8e('0x23')](respondWithFilteredResult(_0x319686,_0x3077e6))[_0xad8e('0x41')](handleError(_0x319686,null));};exports[_0xad8e('0x42')]=function(_0x2b08b6,_0x3369e5){var _0x3212ce={'raw':!![],'where':{'id':_0x2b08b6[_0xad8e('0x43')]['id']}},_0x172a27={};_0x172a27[_0xad8e('0x31')]=_[_0xad8e('0x44')](db[_0xad8e('0x2b')]['rawAttributes']);_0x172a27[_0xad8e('0x2e')]=_['keys'](_0x2b08b6[_0xad8e('0x2e')]);_0x172a27['filters']=_['intersection'](_0x172a27[_0xad8e('0x31')],_0x172a27[_0xad8e('0x2e')]);_0x3212ce[_0xad8e('0x32')]=_[_0xad8e('0x30')](_0x172a27[_0xad8e('0x31')],qs[_0xad8e('0x33')](_0x2b08b6[_0xad8e('0x2e')]['fields']));_0x3212ce['attributes']=_0x3212ce[_0xad8e('0x32')][_0xad8e('0x45')]?_0x3212ce[_0xad8e('0x32')]:_0x172a27[_0xad8e('0x31')];if(_0x2b08b6[_0xad8e('0x2e')][_0xad8e('0x3e')]){_0x3212ce[_0xad8e('0x3f')]=[{'all':!![]}];}_0x3212ce=_[_0xad8e('0x3b')]({},_0x3212ce,_0x2b08b6['options']);return db[_0xad8e('0x2b')][_0xad8e('0x46')](_0x3212ce)['then'](handleEntityNotFound(_0x3369e5,null))[_0xad8e('0x23')](respondWithResult(_0x3369e5,null))[_0xad8e('0x41')](handleError(_0x3369e5,null));};exports[_0xad8e('0x47')]=function(_0x40dd2c,_0x1409d3){return db[_0xad8e('0x2b')][_0xad8e('0x47')](_0x40dd2c[_0xad8e('0x48')],{})[_0xad8e('0x23')](respondWithResult(_0x1409d3,0xc9))[_0xad8e('0x41')](handleError(_0x1409d3,null));};exports['describe']=function(_0x446958,_0x5c113a){return db[_0xad8e('0x2b')][_0xad8e('0x49')]()['then'](respondWithResult(_0x5c113a,null))['catch'](handleError(_0x5c113a,null));};exports['update']=function(_0x2ec983,_0x329b5d){if(_0x2ec983[_0xad8e('0x48')][_0xad8e('0x4a')]){delete _0x2ec983['body'][_0xad8e('0x4a')];}return db[_0xad8e('0x2b')][_0xad8e('0x46')]({'where':{'uniqueid':_0x2ec983['params']['id']}})[_0xad8e('0x23')](handleEntityNotFound(_0x329b5d,null))[_0xad8e('0x23')](saveUpdates(_0x2ec983[_0xad8e('0x48')],null))[_0xad8e('0x23')](respondWithResult(_0x329b5d,null))[_0xad8e('0x41')](handleError(_0x329b5d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 4a76d43..eed0fb2 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 _0x1bb4=['util','../../config/logger','api','moment','request-promise','rimraf','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x333ba6,_0x2cc404){_0x333ba6=_0x333ba6-0x0;var _0x3f6c76=_0x1bb4[_0x333ba6];return _0x3f6c76;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var logger=require(_0x41bb('0x2'))(_0x41bb('0x3'));var moment=require(_0x41bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x41bb('0x7'));module['exports']=function(_0x232b17,_0x3ab646){return _0x232b17[_0x41bb('0x8')]('CmHopperHistory',attributes,{'tableName':_0x41bb('0x9'),'paranoid':![],'indexes':[{'name':_0x41bb('0xa'),'fields':['endtime']},{'name':_0x41bb('0xb'),'fields':[_0x41bb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5360=['rimraf','../../config/environment','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x2eca02,_0x369f77){var _0x271ce5=function(_0x307832){while(--_0x307832){_0x2eca02['push'](_0x2eca02['shift']());}};_0x271ce5(++_0x369f77);}(_0x5360,0x157));var _0x0536=function(_0x1d62e5,_0x40eb1f){_0x1d62e5=_0x1d62e5-0x0;var _0x519bf1=_0x5360[_0x1d62e5];return _0x519bf1;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var logger=require(_0x0536('0x2'))(_0x0536('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0536('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0536('0x5'));var config=require(_0x0536('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x4fc885,_0x459432){return _0x4fc885[_0x0536('0x7')](_0x0536('0x8'),attributes,{'tableName':_0x0536('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0536('0xa')]},{'name':_0x0536('0xb'),'fields':[_0x0536('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6cae6c6..d671379 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 _0xfc73=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateCmHopperHistory','create','options','raw','CmHopperHistory','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`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','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5a65e9,_0x5caf5d){var _0x95de87=function(_0x172bb0){while(--_0x172bb0){_0x5a65e9['push'](_0x5a65e9['shift']());}};_0x95de87(++_0x5caf5d);}(_0xfc73,0x8d));var _0x3fc7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfc73[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require('moment');var BPromise=require(_0x3fc7('0x2'));var rs=require(_0x3fc7('0x3'));var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require(_0x3fc7('0x6'));var logger=require(_0x3fc7('0x7'))(_0x3fc7('0x8'));var config=require(_0x3fc7('0x9'));var jayson=require(_0x3fc7('0xa'));var client=jayson[_0x3fc7('0xb')][_0x3fc7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1375dc,_0x5e41d3,_0x36ec87){return new BPromise(function(_0x12c2ec,_0x14cd0a){return client[_0x3fc7('0xd')](_0x1375dc,_0x36ec87)[_0x3fc7('0xe')](function(_0x4ed1e6){logger['info'](_0x3fc7('0xf'),_0x5e41d3,_0x3fc7('0x10'));logger[_0x3fc7('0x11')](_0x3fc7('0x12'),_0x5e41d3,_0x3fc7('0x10'),JSON[_0x3fc7('0x13')](_0x4ed1e6));if(_0x4ed1e6['error']){if(_0x4ed1e6['error'][_0x3fc7('0x14')]===0x1f4){logger['error'](_0x3fc7('0xf'),_0x5e41d3,_0x4ed1e6[_0x3fc7('0x15')][_0x3fc7('0x16')]);return _0x14cd0a(_0x4ed1e6[_0x3fc7('0x15')]['message']);}logger[_0x3fc7('0x15')](_0x3fc7('0xf'),_0x5e41d3,_0x4ed1e6[_0x3fc7('0x15')][_0x3fc7('0x16')]);return _0x12c2ec(_0x4ed1e6[_0x3fc7('0x15')][_0x3fc7('0x16')]);}else{logger[_0x3fc7('0x17')](_0x3fc7('0xf'),_0x5e41d3,_0x3fc7('0x10'));_0x12c2ec(_0x4ed1e6[_0x3fc7('0x18')][_0x3fc7('0x16')]);}})[_0x3fc7('0x19')](function(_0x10a0d3){logger[_0x3fc7('0x15')](_0x3fc7('0xf'),_0x5e41d3,_0x10a0d3);_0x14cd0a(_0x10a0d3);});});}exports[_0x3fc7('0x1a')]=function(_0x2d7885){var _0x2583d4=this;return new Promise(function(_0x268334,_0x502490){return db['CmHopperHistory'][_0x3fc7('0x1b')](_0x2d7885['body'],{'raw':_0x2d7885['options']?_0x2d7885[_0x3fc7('0x1c')][_0x3fc7('0x1d')]===undefined?!![]:![]:!![]})[_0x3fc7('0xe')](function(_0x4daacf){logger['info'](_0x3fc7('0x1a'),_0x2d7885);logger[_0x3fc7('0x11')](_0x3fc7('0x1a'),_0x2d7885,JSON[_0x3fc7('0x13')](_0x4daacf));_0x268334(_0x4daacf);})[_0x3fc7('0x19')](function(_0x483018){logger['error'](_0x3fc7('0x1a'),_0x483018[_0x3fc7('0x16')],_0x2d7885);_0x502490(_0x2583d4['error'](0x1f4,_0x483018['message']));});});};exports['AvgHandleTime']=function(_0x456ddc){var _0x1cfd17=this;return new Promise(function(_0x50648f,_0x4c1212){return db[_0x3fc7('0x1e')][_0x3fc7('0x1f')]({'raw':_0x456ddc[_0x3fc7('0x1c')]?_0x456ddc[_0x3fc7('0x1c')][_0x3fc7('0x1d')]===undefined?!![]:![]:!![],'where':_0x456ddc[_0x3fc7('0x1c')]?_0x456ddc[_0x3fc7('0x1c')][_0x3fc7('0x20')]||null:null,'attributes':[[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')][_0x3fc7('0x23')]('id')),_0x3fc7('0x24')],[db[_0x3fc7('0x21')]['fn']('COUNT',db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')]['literal'](_0x3fc7('0x25')))),_0x3fc7('0x26')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db['sequelize']['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x28')))),_0x3fc7('0x29')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')]['literal'](_0x3fc7('0x2a')))),_0x3fc7('0x2b')],[db[_0x3fc7('0x21')]['fn']('AVG',db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x2c')))),_0x3fc7('0x2d')],[db[_0x3fc7('0x21')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x2e')))),_0x3fc7('0x2f')]]})['then'](function(_0x2177ac){logger[_0x3fc7('0x17')](_0x3fc7('0x30'),_0x456ddc);logger['debug'](_0x3fc7('0x30'),_0x456ddc,JSON[_0x3fc7('0x13')](_0x2177ac));_0x50648f(_0x2177ac);})[_0x3fc7('0x19')](function(_0x5d63ee){logger['error'](_0x3fc7('0x30'),_0x5d63ee['message'],_0x456ddc);_0x4c1212(_0x1cfd17[_0x3fc7('0x15')](0x1f4,_0x5d63ee['message']));});});};exports[_0x3fc7('0x31')]=function(_0x5f2d77){var _0x32aaa7=this;return new Promise(function(_0x295cd8,_0x1e1e78){return db[_0x3fc7('0x1e')][_0x3fc7('0x1f')]({'raw':_0x5f2d77['options']?_0x5f2d77['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f2d77['options']?_0x5f2d77['options'][_0x3fc7('0x20')]||null:null,'attributes':[[_0x3fc7('0x32'),'name'],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db['sequelize']['literal'](_0x3fc7('0x33')))),'outboundNoSuchCallsDay'],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x34')))),_0x3fc7('0x35')],[db['sequelize']['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x25')))),'outboundAnswerCallsDay'],[db[_0x3fc7('0x21')]['fn']('COUNT',db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x36')))),'outboundBusyCallsDay'],[db[_0x3fc7('0x21')]['fn']('COUNT',db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')]['literal'](_0x3fc7('0x37')))),_0x3fc7('0x38')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x39')))),_0x3fc7('0x3a')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x3b')))),_0x3fc7('0x3c')],[db[_0x3fc7('0x21')]['fn']('COUNT',db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x3d')))),_0x3fc7('0x3e')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db['sequelize']['fn']('IF',db[_0x3fc7('0x21')]['literal'](_0x3fc7('0x3f')))),_0x3fc7('0x40')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db[_0x3fc7('0x21')][_0x3fc7('0x27')](_0x3fc7('0x41')))),'outboundOriginateFailureCallsDay'],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db['sequelize'][_0x3fc7('0x27')]('`state`\x20=\x2018,\x201,\x20null'))),_0x3fc7('0x42')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db['sequelize'][_0x3fc7('0x27')](_0x3fc7('0x43')))),'outboundAnswerAgiCallsDay'],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')]['fn']('IF',db['sequelize'][_0x3fc7('0x27')](_0x3fc7('0x44')))),_0x3fc7('0x45')]],'group':['campaign']})[_0x3fc7('0xe')](function(_0x12b93b){logger[_0x3fc7('0x17')](_0x3fc7('0x31'),_0x5f2d77);logger[_0x3fc7('0x11')](_0x3fc7('0x31'),_0x5f2d77,JSON['stringify'](_0x12b93b));_0x295cd8(_0x12b93b);})['catch'](function(_0x189364){logger[_0x3fc7('0x15')]('GetVoiceQueueHopperHistory',_0x189364[_0x3fc7('0x16')],_0x5f2d77);_0x1e1e78(_0x32aaa7[_0x3fc7('0x15')](0x1f4,_0x189364['message']));});});};exports['GetCampaignHopperHistory']=function(_0x2b3b02){var _0x3c5375=this;return new Promise(function(_0x3f0646,_0x5646d5){return db[_0x3fc7('0x1e')][_0x3fc7('0x1f')]({'raw':_0x2b3b02[_0x3fc7('0x1c')]?_0x2b3b02[_0x3fc7('0x1c')][_0x3fc7('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b3b02[_0x3fc7('0x1c')]?_0x2b3b02[_0x3fc7('0x1c')][_0x3fc7('0x20')]||null:null,'attributes':[[_0x3fc7('0x32'),'name'],[db['sequelize']['fn'](_0x3fc7('0x22'),db[_0x3fc7('0x21')][_0x3fc7('0x23')]('id')),_0x3fc7('0x46')],[db[_0x3fc7('0x21')]['fn'](_0x3fc7('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x3fc7('0x47')]],'group':[_0x3fc7('0x32')]})[_0x3fc7('0xe')](function(_0x144de0){logger[_0x3fc7('0x17')](_0x3fc7('0x48'),_0x2b3b02);logger['debug']('GetCampaignHopperHistory',_0x2b3b02,JSON[_0x3fc7('0x13')](_0x144de0));_0x3f0646(_0x144de0);})[_0x3fc7('0x19')](function(_0x4eaff1){logger[_0x3fc7('0x15')](_0x3fc7('0x48'),_0x4eaff1[_0x3fc7('0x16')],_0x2b3b02);_0x5646d5(_0x3c5375['error'](0x1f4,_0x4eaff1[_0x3fc7('0x16')]));});});}; \ No newline at end of file +var _0xd2a8=['util','moment','randomstring','ioredis','rpc','jayson/promise','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','then','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xd2a8,0xc9));var _0x8d2a=function(_0x4142b1,_0x1119af){_0x4142b1=_0x4142b1-0x0;var _0x346210=_0xd2a8[_0x4142b1];return _0x346210;};'use strict';var _=require('lodash');var util=require(_0x8d2a('0x0'));var moment=require(_0x8d2a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d2a('0x2'));var fs=require('fs');var Redis=require(_0x8d2a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8d2a('0x4'));var config=require('../../config/environment');var jayson=require(_0x8d2a('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5cee,_0x337b9a,_0x5900d5){return new BPromise(function(_0x29d943,_0x5baa38){return client[_0x8d2a('0x6')](_0x4d5cee,_0x5900d5)['then'](function(_0x1ef202){logger[_0x8d2a('0x7')]('CmHopperHistory,\x20%s,\x20%s',_0x337b9a,_0x8d2a('0x8'));logger[_0x8d2a('0x9')](_0x8d2a('0xa'),_0x337b9a,_0x8d2a('0x8'),JSON[_0x8d2a('0xb')](_0x1ef202));if(_0x1ef202[_0x8d2a('0xc')]){if(_0x1ef202[_0x8d2a('0xc')][_0x8d2a('0xd')]===0x1f4){logger[_0x8d2a('0xc')](_0x8d2a('0xe'),_0x337b9a,_0x1ef202[_0x8d2a('0xc')][_0x8d2a('0xf')]);return _0x5baa38(_0x1ef202[_0x8d2a('0xc')][_0x8d2a('0xf')]);}logger[_0x8d2a('0xc')](_0x8d2a('0xe'),_0x337b9a,_0x1ef202[_0x8d2a('0xc')][_0x8d2a('0xf')]);return _0x29d943(_0x1ef202[_0x8d2a('0xc')][_0x8d2a('0xf')]);}else{logger['info'](_0x8d2a('0xe'),_0x337b9a,_0x8d2a('0x8'));_0x29d943(_0x1ef202[_0x8d2a('0x10')]['message']);}})[_0x8d2a('0x11')](function(_0x4121c6){logger[_0x8d2a('0xc')](_0x8d2a('0xe'),_0x337b9a,_0x4121c6);_0x5baa38(_0x4121c6);});});}exports[_0x8d2a('0x12')]=function(_0x48c0cc){var _0x397e72=this;return new Promise(function(_0x2ea79a,_0x23e699){return db[_0x8d2a('0x13')][_0x8d2a('0x14')](_0x48c0cc[_0x8d2a('0x15')],{'raw':_0x48c0cc[_0x8d2a('0x16')]?_0x48c0cc['options']['raw']===undefined?!![]:![]:!![]})[_0x8d2a('0x17')](function(_0x372f77){logger[_0x8d2a('0x7')](_0x8d2a('0x12'),_0x48c0cc);logger['debug'](_0x8d2a('0x12'),_0x48c0cc,JSON[_0x8d2a('0xb')](_0x372f77));_0x2ea79a(_0x372f77);})[_0x8d2a('0x11')](function(_0x17e370){logger[_0x8d2a('0xc')](_0x8d2a('0x12'),_0x17e370[_0x8d2a('0xf')],_0x48c0cc);_0x23e699(_0x397e72['error'](0x1f4,_0x17e370[_0x8d2a('0xf')]));});});};exports['AvgHandleTime']=function(_0x3ee19d){var _0x45c713=this;return new Promise(function(_0xf23e96,_0x3b5b9d){return db['CmHopperHistory'][_0x8d2a('0x18')]({'raw':_0x3ee19d[_0x8d2a('0x16')]?_0x3ee19d['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ee19d[_0x8d2a('0x16')]?_0x3ee19d[_0x8d2a('0x16')][_0x8d2a('0x19')]||null:null,'attributes':[[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db['sequelize']['col']('id')),_0x8d2a('0x1c')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')]['literal'](_0x8d2a('0x1d')))),_0x8d2a('0x1e')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x20')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db['sequelize']['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x21')))),_0x8d2a('0x22')],[db['sequelize']['fn']('AVG',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x23')))),_0x8d2a('0x24')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x25'),db['sequelize']['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x26')))),_0x8d2a('0x27')]]})[_0x8d2a('0x17')](function(_0x4ba70d){logger[_0x8d2a('0x7')](_0x8d2a('0x28'),_0x3ee19d);logger[_0x8d2a('0x9')]('AvgHandleTime',_0x3ee19d,JSON[_0x8d2a('0xb')](_0x4ba70d));_0xf23e96(_0x4ba70d);})[_0x8d2a('0x11')](function(_0x16828c){logger[_0x8d2a('0xc')]('AvgHandleTime',_0x16828c[_0x8d2a('0xf')],_0x3ee19d);_0x3b5b9d(_0x45c713[_0x8d2a('0xc')](0x1f4,_0x16828c[_0x8d2a('0xf')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1ed1d6){var _0x47a2f1=this;return new Promise(function(_0x48d9da,_0xad5e70){return db[_0x8d2a('0x13')][_0x8d2a('0x18')]({'raw':_0x1ed1d6[_0x8d2a('0x16')]?_0x1ed1d6[_0x8d2a('0x16')][_0x8d2a('0x29')]===undefined?!![]:![]:!![],'where':_0x1ed1d6[_0x8d2a('0x16')]?_0x1ed1d6[_0x8d2a('0x16')][_0x8d2a('0x19')]||null:null,'attributes':[[_0x8d2a('0x2a'),_0x8d2a('0x2b')],[db[_0x8d2a('0x1a')]['fn']('COUNT',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')]['literal'](_0x8d2a('0x2c')))),'outboundNoSuchCallsDay'],[db[_0x8d2a('0x1a')]['fn']('COUNT',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')]('`state`\x20=\x203,\x201,\x20null'))),_0x8d2a('0x2d')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x1d')))),_0x8d2a('0x2e')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')]['literal'](_0x8d2a('0x2f')))),'outboundBusyCallsDay'],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x30')))),_0x8d2a('0x31')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x32')))),_0x8d2a('0x33')],[db[_0x8d2a('0x1a')]['fn']('COUNT',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x34')))),_0x8d2a('0x35')],[db[_0x8d2a('0x1a')]['fn']('COUNT',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')]['literal'](_0x8d2a('0x36')))),'outboundBlacklistCallsDay'],[db[_0x8d2a('0x1a')]['fn']('COUNT',db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x37')))),_0x8d2a('0x38')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0x8d2a('0x39')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x3a')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db['sequelize'][_0x8d2a('0x1f')](_0x8d2a('0x3b')))),_0x8d2a('0x39')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')][_0x8d2a('0x1f')](_0x8d2a('0x3c')))),_0x8d2a('0x3d')]],'group':[_0x8d2a('0x2a')]})['then'](function(_0x70a1c5){logger['info'](_0x8d2a('0x3e'),_0x1ed1d6);logger[_0x8d2a('0x9')](_0x8d2a('0x3e'),_0x1ed1d6,JSON[_0x8d2a('0xb')](_0x70a1c5));_0x48d9da(_0x70a1c5);})[_0x8d2a('0x11')](function(_0xc8c04b){logger[_0x8d2a('0xc')](_0x8d2a('0x3e'),_0xc8c04b[_0x8d2a('0xf')],_0x1ed1d6);_0xad5e70(_0x47a2f1[_0x8d2a('0xc')](0x1f4,_0xc8c04b['message']));});});};exports[_0x8d2a('0x3f')]=function(_0x3a36fa){var _0x20693c=this;return new Promise(function(_0x3a25ec,_0x3ed8fc){return db[_0x8d2a('0x13')][_0x8d2a('0x18')]({'raw':_0x3a36fa['options']?_0x3a36fa['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a36fa[_0x8d2a('0x16')]?_0x3a36fa['options'][_0x8d2a('0x19')]||null:null,'attributes':[['campaign',_0x8d2a('0x2b')],[db['sequelize']['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')][_0x8d2a('0x40')]('id')),_0x8d2a('0x41')],[db[_0x8d2a('0x1a')]['fn'](_0x8d2a('0x1b'),db[_0x8d2a('0x1a')]['fn']('IF',db[_0x8d2a('0x1a')]['literal'](_0x8d2a('0x1d')))),_0x8d2a('0x42')]],'group':[_0x8d2a('0x2a')]})[_0x8d2a('0x17')](function(_0x45a2c0){logger[_0x8d2a('0x7')](_0x8d2a('0x3f'),_0x3a36fa);logger['debug']('GetCampaignHopperHistory',_0x3a36fa,JSON[_0x8d2a('0xb')](_0x45a2c0));_0x3a25ec(_0x45a2c0);})[_0x8d2a('0x11')](function(_0x28931b){logger['error']('GetCampaignHopperHistory',_0x28931b['message'],_0x3a36fa);_0x3ed8fc(_0x20693c[_0x8d2a('0xc')](0x1f4,_0x28931b['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3bc4c4d..9792bcf 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 _0xe078=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','exports'];(function(_0x34517a,_0x57bce2){var _0x2e3576=function(_0x2d4904){while(--_0x2d4904){_0x34517a['push'](_0x34517a['shift']());}};_0x2e3576(++_0x57bce2);}(_0xe078,0x1a2));var _0x8e07=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe078[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0x8e07('0x0'));var util=require(_0x8e07('0x1'));var path=require(_0x8e07('0x2'));var timeout=require(_0x8e07('0x3'));var express=require(_0x8e07('0x4'));var router=express[_0x8e07('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8e07('0x6'));var interaction=require(_0x8e07('0x7'));var config=require('../../config/environment');var controller=require(_0x8e07('0x8'));router[_0x8e07('0x9')]('/',auth[_0x8e07('0xa')](),controller[_0x8e07('0xb')]);router[_0x8e07('0x9')](_0x8e07('0xc'),auth[_0x8e07('0xa')](),controller[_0x8e07('0xd')]);router[_0x8e07('0x9')](_0x8e07('0xe'),auth[_0x8e07('0xa')](),controller['show']);router[_0x8e07('0xf')]('/',auth[_0x8e07('0xa')](),controller[_0x8e07('0x10')]);router[_0x8e07('0x11')](_0x8e07('0xe'),auth[_0x8e07('0xa')](),controller['update']);module[_0x8e07('0x12')]=router; \ No newline at end of file +var _0xec8b=['express','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(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xec8b,0x166));var _0xbec8=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xec8b[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xbec8('0x0'));var util=require(_0xbec8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbec8('0x2'));var router=express['Router']();var fs_extra=require(_0xbec8('0x3'));var auth=require(_0xbec8('0x4'));var interaction=require(_0xbec8('0x5'));var config=require(_0xbec8('0x6'));var controller=require(_0xbec8('0x7'));router[_0xbec8('0x8')]('/',auth[_0xbec8('0x9')](),controller[_0xbec8('0xa')]);router[_0xbec8('0x8')](_0xbec8('0xb'),auth[_0xbec8('0x9')](),controller[_0xbec8('0xc')]);router[_0xbec8('0x8')](_0xbec8('0xd'),auth[_0xbec8('0x9')](),controller[_0xbec8('0xe')]);router[_0xbec8('0xf')]('/',auth[_0xbec8('0x9')](),controller[_0xbec8('0x10')]);router[_0xbec8('0x11')]('/:id',auth[_0xbec8('0x9')](),controller[_0xbec8('0x12')]);module[_0xbec8('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ce8e204..dd0ba79 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 _0x7c49=['sequelize','exports','STRING'];(function(_0x2d5f34,_0x10e2d4){var _0x27300e=function(_0x8d2a83){while(--_0x8d2a83){_0x2d5f34['push'](_0x2d5f34['shift']());}};_0x27300e(++_0x10e2d4);}(_0x7c49,0x141));var _0x97c4=function(_0x2a38cf,_0x588c7e){_0x2a38cf=_0x2a38cf-0x0;var _0x5392f7=_0x7c49[_0x2a38cf];return _0x5392f7;};'use strict';var Sequelize=require(_0x97c4('0x0'));module[_0x97c4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x97c4('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a3a=['exports','STRING','name','sequelize'];(function(_0x9dd431,_0x389313){var _0x1aa903=function(_0x564021){while(--_0x564021){_0x9dd431['push'](_0x9dd431['shift']());}};_0x1aa903(++_0x389313);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x2a0659,_0x3e054e){_0x2a0659=_0x2a0659-0x0;var _0x442f0c=_0x2a3a[_0x2a0659];return _0x442f0c;};'use strict';var Sequelize=require(_0xa2a3('0x0'));module[_0xa2a3('0x1')]={'name':{'type':Sequelize[_0xa2a3('0x2')],'unique':_0xa2a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa2a3('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d972ce0..5435b0a 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 _0xe6bb=['cm_contacts','getCustomFields','findAndCountAll','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','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','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','get','Lists','error','stack','name','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','CmList','includeAll','include','findAll','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','getDispositions','Disposition','hasOwnProperty','order','ListId','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','success','dataValues','errors','getContacts','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','concat','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','findOne','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface'];(function(_0x4dccfb,_0x5c9f92){var _0x20bc89=function(_0x1719cf){while(--_0x1719cf){_0x4dccfb['push'](_0x4dccfb['shift']());}};_0x20bc89(++_0x5c9f92);}(_0xe6bb,0x133));var _0xbe6b=function(_0x2506cc,_0x3799b1){_0x2506cc=_0x2506cc-0x0;var _0x12697a=_0xe6bb[_0x2506cc];return _0x12697a;};'use strict';var emlformat=require(_0xbe6b('0x0'));var rimraf=require(_0xbe6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe6b('0x2'));var moment=require(_0xbe6b('0x3'));var BPromise=require(_0xbe6b('0x4'));var Mustache=require(_0xbe6b('0x5'));var util=require('util');var path=require(_0xbe6b('0x6'));var sox=require(_0xbe6b('0x7'));var csv=require(_0xbe6b('0x8'));var ejs=require(_0xbe6b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe6b('0xa'));var squel=require('squel');var crypto=require(_0xbe6b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbe6b('0xc'));var toCsv=require(_0xbe6b('0x8'));var querystring=require(_0xbe6b('0xd'));var Papa=require(_0xbe6b('0xe'));var Redis=require(_0xbe6b('0xf'));var authService=require(_0xbe6b('0x10'));var qs=require(_0xbe6b('0x11'));var as=require(_0xbe6b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe6b('0x13'))(_0xbe6b('0x14'));var utils=require(_0xbe6b('0x15'));var config=require(_0xbe6b('0x16'));var licenseUtil=require(_0xbe6b('0x17'));var db=require(_0xbe6b('0x18'))['db'];config[_0xbe6b('0x19')]=_[_0xbe6b('0x1a')](config[_0xbe6b('0x19')],{'host':_0xbe6b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe6b('0x1c'))[_0xbe6b('0x1d')](socket);function respondWithStatusCode(_0x32c70d,_0x35cb37){_0x35cb37=_0x35cb37||0xcc;return function(_0x2695cd){if(_0x2695cd){return _0x32c70d[_0xbe6b('0x1e')](_0x35cb37);}return _0x32c70d[_0xbe6b('0x1f')](_0x35cb37)[_0xbe6b('0x20')]();};}function respondWithResult(_0xac3777,_0x41f3e4){_0x41f3e4=_0x41f3e4||0xc8;return function(_0x4f42e5){if(_0x4f42e5){return _0xac3777[_0xbe6b('0x1f')](_0x41f3e4)['json'](_0x4f42e5);}};}function respondWithFilteredResult(_0xcad01b,_0x30628d){return function(_0x21a76d){if(_0x21a76d){var _0xae1594=typeof _0x30628d[_0xbe6b('0x21')]===_0xbe6b('0x22')&&typeof _0x30628d[_0xbe6b('0x23')]===_0xbe6b('0x22');var _0x300b6f=_0x21a76d[_0xbe6b('0x24')];var _0x222b93=_0xae1594?0x0:_0x30628d[_0xbe6b('0x21')];var _0xa290e7=_0xae1594?_0x21a76d[_0xbe6b('0x24')]:_0x30628d[_0xbe6b('0x21')]+_0x30628d[_0xbe6b('0x23')];var _0x485b16;if(_0xa290e7>=_0x300b6f){_0xa290e7=_0x300b6f;_0x485b16=0xc8;}else{_0x485b16=0xce;}_0xcad01b[_0xbe6b('0x1f')](_0x485b16);return _0xcad01b['set'](_0xbe6b('0x25'),_0x222b93+'-'+_0xa290e7+'/'+_0x300b6f)[_0xbe6b('0x26')](_0x21a76d);}return null;};}function patchUpdates(_0x2a26f8){return function(_0x40f076){try{jsonpatch[_0xbe6b('0x27')](_0x40f076,_0x2a26f8,!![]);}catch(_0xb9e82b){return BPromise['reject'](_0xb9e82b);}return _0x40f076['save']();};}function saveUpdates(_0x11448f,_0x3d787c){return function(_0xfa6bc){if(_0xfa6bc){return _0xfa6bc[_0xbe6b('0x28')](_0x11448f)[_0xbe6b('0x29')](function(_0x4d3f20){return _0x4d3f20;});}return null;};}function removeEntity(_0x5ce343,_0xd242c5){return function(_0x34a191){if(_0x34a191){return _0x34a191[_0xbe6b('0x2a')]()[_0xbe6b('0x29')](function(){var _0x4319bc=_0x34a191[_0xbe6b('0x2b')]({'plain':!![]});var _0xd35c84=_0xbe6b('0x2c');return db['UserProfileResource'][_0xbe6b('0x2a')]({'where':{'type':_0xd35c84,'resourceId':_0x4319bc['id']}})[_0xbe6b('0x29')](function(){return _0x34a191;});})['then'](function(){_0x5ce343['status'](0xcc)[_0xbe6b('0x20')]();});}};}function handleEntityNotFound(_0xdc4916,_0x5e9f43){return function(_0x16682c){if(!_0x16682c){_0xdc4916[_0xbe6b('0x1e')](0x194);}return _0x16682c;};}function handleError(_0x21af36,_0x294de6){_0x294de6=_0x294de6||0x1f4;return function(_0x40902a){logger[_0xbe6b('0x2d')](_0x40902a[_0xbe6b('0x2e')]);if(_0x40902a[_0xbe6b('0x2f')]){delete _0x40902a[_0xbe6b('0x2f')];}_0x21af36[_0xbe6b('0x1f')](_0x294de6)['send'](_0x40902a);};}exports[_0xbe6b('0x30')]=function(_0x48eea7,_0x36eb49){var _0x4f5c10={},_0x357bf3={},_0x4f1dd8={'count':0x0,'rows':[]};var _0x54f96a=_['map'](db['CmList'][_0xbe6b('0x31')],function(_0x55879e){return{'name':_0x55879e['fieldName'],'type':_0x55879e[_0xbe6b('0x32')][_0xbe6b('0x33')]};});_0x357bf3['model']=_[_0xbe6b('0x34')](_0x54f96a,_0xbe6b('0x2f'));_0x357bf3[_0xbe6b('0x35')]=_[_0xbe6b('0x36')](_0x48eea7[_0xbe6b('0x35')]);_0x357bf3[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x357bf3[_0xbe6b('0x39')],_0x357bf3[_0xbe6b('0x35')]);_0x4f5c10[_0xbe6b('0x3a')]=_[_0xbe6b('0x38')](_0x357bf3[_0xbe6b('0x39')],qs['fields'](_0x48eea7[_0xbe6b('0x35')][_0xbe6b('0x3b')]));_0x4f5c10['attributes']=_0x4f5c10[_0xbe6b('0x3a')][_0xbe6b('0x3c')]?_0x4f5c10[_0xbe6b('0x3a')]:_0x357bf3['model'];if(!_0x48eea7[_0xbe6b('0x35')]['hasOwnProperty'](_0xbe6b('0x3d'))){_0x4f5c10['limit']=qs[_0xbe6b('0x23')](_0x48eea7['query'][_0xbe6b('0x23')]);_0x4f5c10[_0xbe6b('0x21')]=qs[_0xbe6b('0x21')](_0x48eea7[_0xbe6b('0x35')][_0xbe6b('0x21')]);}_0x4f5c10['order']=qs[_0xbe6b('0x3e')](_0x48eea7[_0xbe6b('0x35')][_0xbe6b('0x3e')]);_0x4f5c10[_0xbe6b('0x3f')]=qs[_0xbe6b('0x37')](_[_0xbe6b('0x40')](_0x48eea7[_0xbe6b('0x35')],_0x357bf3[_0xbe6b('0x37')]),_0x54f96a);if(_0x48eea7[_0xbe6b('0x35')][_0xbe6b('0x41')]){_0x4f5c10[_0xbe6b('0x3f')]=_['merge'](_0x4f5c10['where'],{'$or':_[_0xbe6b('0x34')](_0x54f96a,function(_0x258ac3){if(_0x258ac3[_0xbe6b('0x32')]!==_0xbe6b('0x42')){var _0x2fd200={};_0x2fd200[_0x258ac3[_0xbe6b('0x2f')]]={'$like':'%'+_0x48eea7['query'][_0xbe6b('0x41')]+'%'};return _0x2fd200;}})});}_0x4f5c10=_[_0xbe6b('0x43')]({},_0x4f5c10,_0x48eea7[_0xbe6b('0x44')]);var _0x56939a={'where':_0x4f5c10[_0xbe6b('0x3f')]};return db[_0xbe6b('0x45')][_0xbe6b('0x24')](_0x56939a)[_0xbe6b('0x29')](function(_0x578446){_0x4f1dd8[_0xbe6b('0x24')]=_0x578446;if(_0x48eea7[_0xbe6b('0x35')][_0xbe6b('0x46')]){_0x4f5c10[_0xbe6b('0x47')]=[{'all':!![]}];}return db[_0xbe6b('0x45')][_0xbe6b('0x48')](_0x4f5c10);})['then'](function(_0xd29d06){_0x4f1dd8['rows']=_0xd29d06;return _0x4f1dd8;})['then'](respondWithFilteredResult(_0x36eb49,_0x4f5c10))[_0xbe6b('0x49')](handleError(_0x36eb49,null));};exports[_0xbe6b('0x4a')]=function(_0x2375c5,_0x4c54a0){var _0x1f5109={'raw':![],'where':{'id':_0x2375c5['params']['id']}},_0x2a3c81={};_0x2a3c81[_0xbe6b('0x39')]=_[_0xbe6b('0x36')](db[_0xbe6b('0x45')][_0xbe6b('0x31')]);_0x2a3c81[_0xbe6b('0x35')]=_[_0xbe6b('0x36')](_0x2375c5['query']);_0x2a3c81[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x2a3c81[_0xbe6b('0x39')],_0x2a3c81[_0xbe6b('0x35')]);_0x1f5109[_0xbe6b('0x3a')]=_[_0xbe6b('0x38')](_0x2a3c81[_0xbe6b('0x39')],qs[_0xbe6b('0x3b')](_0x2375c5[_0xbe6b('0x35')]['fields']));_0x1f5109[_0xbe6b('0x3a')]=_0x1f5109[_0xbe6b('0x3a')][_0xbe6b('0x3c')]?_0x1f5109[_0xbe6b('0x3a')]:_0x2a3c81[_0xbe6b('0x39')];if(_0x2375c5[_0xbe6b('0x35')]['includeAll']){_0x1f5109[_0xbe6b('0x47')]=[{'all':!![]}];}_0x1f5109=_[_0xbe6b('0x43')]({},_0x1f5109,_0x2375c5[_0xbe6b('0x44')]);return db[_0xbe6b('0x45')]['find'](_0x1f5109)[_0xbe6b('0x29')](handleEntityNotFound(_0x4c54a0,null))[_0xbe6b('0x29')](respondWithResult(_0x4c54a0,null))[_0xbe6b('0x49')](handleError(_0x4c54a0,null));};exports[_0xbe6b('0x4b')]=function(_0x2834d8,_0x5dbece){return db[_0xbe6b('0x45')][_0xbe6b('0x4b')](_0x2834d8['body'],{})['then'](function(_0x12a658){var _0x52a306=_0x2834d8[_0xbe6b('0x4c')][_0xbe6b('0x2b')]({'plain':!![]});if(!_0x52a306)throw new Error(_0xbe6b('0x4d'));if(_0x52a306[_0xbe6b('0x4e')]===_0xbe6b('0x4c')){var _0xbc881a=_0x12a658[_0xbe6b('0x2b')]({'plain':!![]});var _0x2dec14=_0xbe6b('0x2c');return db[_0xbe6b('0x4f')][_0xbe6b('0x50')]({'where':{'name':_0x2dec14,'userProfileId':_0x52a306[_0xbe6b('0x51')]},'raw':!![]})[_0xbe6b('0x29')](function(_0x1747a7){if(_0x1747a7&&_0x1747a7[_0xbe6b('0x52')]===0x0){return db[_0xbe6b('0x53')][_0xbe6b('0x4b')]({'name':_0xbc881a[_0xbe6b('0x2f')],'resourceId':_0xbc881a['id'],'type':_0x1747a7[_0xbe6b('0x2f')],'sectionId':_0x1747a7['id']},{})[_0xbe6b('0x29')](function(){return _0x12a658;});}else{return _0x12a658;}})[_0xbe6b('0x49')](function(_0x4927cd){logger[_0xbe6b('0x2d')](_0xbe6b('0x54'),_0x4927cd);throw _0x4927cd;});}return _0x12a658;})[_0xbe6b('0x29')](respondWithResult(_0x5dbece,0xc9))[_0xbe6b('0x49')](handleError(_0x5dbece,null));};exports['update']=function(_0x87d40c,_0x263a31){if(_0x87d40c[_0xbe6b('0x55')]['id']){delete _0x87d40c['body']['id'];}return db['CmList']['find']({'where':{'id':_0x87d40c['params']['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x263a31,null))[_0xbe6b('0x29')](saveUpdates(_0x87d40c['body'],null))[_0xbe6b('0x29')](respondWithResult(_0x263a31,null))[_0xbe6b('0x49')](handleError(_0x263a31,null));};exports[_0xbe6b('0x2a')]=function(_0x535edf,_0x4abbd6){return db[_0xbe6b('0x45')][_0xbe6b('0x50')]({'where':{'id':_0x535edf[_0xbe6b('0x56')]['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x4abbd6,null))[_0xbe6b('0x29')](removeEntity(_0x4abbd6,null))[_0xbe6b('0x49')](handleError(_0x4abbd6,null));};exports[_0xbe6b('0x57')]=function(_0x1fc3f9,_0xe0f14){return db[_0xbe6b('0x45')][_0xbe6b('0x57')]()['then'](respondWithResult(_0xe0f14,null))[_0xbe6b('0x49')](handleError(_0xe0f14,null));};exports[_0xbe6b('0x58')]=function(_0x465861,_0x38a926,_0x4ce6aa){if(_0x465861[_0xbe6b('0x55')]['id']){delete _0x465861[_0xbe6b('0x55')]['id'];}return db[_0xbe6b('0x45')][_0xbe6b('0x50')]({'where':{'id':_0x465861['params']['id']}})['then'](handleEntityNotFound(_0x38a926,null))[_0xbe6b('0x29')](function(_0x4efc00){if(_0x4efc00){_0x465861['body']['ListId']=_0x4efc00['id'];return db['Disposition'][_0xbe6b('0x4b')](_0x465861[_0xbe6b('0x55')]);}})[_0xbe6b('0x29')](respondWithResult(_0x38a926,null))[_0xbe6b('0x49')](handleError(_0x38a926,null));};exports[_0xbe6b('0x59')]=function(_0x3375a6,_0x2a7dba,_0x251dc2){var _0x31ecb8={'raw':![],'where':{}};var _0x454d01={};var _0x375263={'count':0x0,'rows':[]};return db[_0xbe6b('0x45')]['findOne']({'where':{'id':_0x3375a6[_0xbe6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a7dba,null))[_0xbe6b('0x29')](function(_0xff8514){if(_0xff8514){_0x454d01[_0xbe6b('0x39')]=_['keys'](db[_0xbe6b('0x5a')][_0xbe6b('0x31')]);_0x454d01[_0xbe6b('0x35')]=_[_0xbe6b('0x36')](_0x3375a6[_0xbe6b('0x35')]);_0x454d01[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x454d01[_0xbe6b('0x39')],_0x454d01['query']);_0x31ecb8[_0xbe6b('0x3a')]=_['intersection'](_0x454d01[_0xbe6b('0x39')],qs[_0xbe6b('0x3b')](_0x3375a6['query'][_0xbe6b('0x3b')]));_0x31ecb8[_0xbe6b('0x3a')]=_0x31ecb8[_0xbe6b('0x3a')][_0xbe6b('0x3c')]?_0x31ecb8[_0xbe6b('0x3a')]:_0x454d01[_0xbe6b('0x39')];if(!_0x3375a6[_0xbe6b('0x35')][_0xbe6b('0x5b')](_0xbe6b('0x3d'))){_0x31ecb8[_0xbe6b('0x23')]=qs[_0xbe6b('0x23')](_0x3375a6['query']['limit']);_0x31ecb8[_0xbe6b('0x21')]=qs['offset'](_0x3375a6[_0xbe6b('0x35')][_0xbe6b('0x21')]);}_0x31ecb8[_0xbe6b('0x5c')]=qs['sort'](_0x3375a6[_0xbe6b('0x35')][_0xbe6b('0x3e')]);_0x31ecb8[_0xbe6b('0x3f')]=qs['filters'](_['pick'](_0x3375a6[_0xbe6b('0x35')],_0x454d01[_0xbe6b('0x37')]));_0x31ecb8[_0xbe6b('0x3f')][_0xbe6b('0x5d')]=_0xff8514['id'];if(_0x3375a6['query']['filter']){_0x31ecb8[_0xbe6b('0x3f')]=_[_0xbe6b('0x43')](_0x31ecb8[_0xbe6b('0x3f')],{'$or':_['map'](_0x31ecb8['attributes'],function(_0x9d1f1e){var _0x140e8d={};_0x140e8d[_0x9d1f1e]={'$like':'%'+_0x3375a6[_0xbe6b('0x35')][_0xbe6b('0x41')]+'%'};return _0x140e8d;})});}_0x31ecb8=_['merge']({},_0x31ecb8,_0x3375a6[_0xbe6b('0x44')]);return db[_0xbe6b('0x5a')]['count']({'where':_0x31ecb8[_0xbe6b('0x3f')]})[_0xbe6b('0x29')](function(_0x4bedef){_0x375263[_0xbe6b('0x24')]=_0x4bedef;if(_0x3375a6[_0xbe6b('0x35')][_0xbe6b('0x46')]){_0x31ecb8[_0xbe6b('0x47')]=[{'all':!![]}];}return db[_0xbe6b('0x5a')]['findAll'](_0x31ecb8);})['then'](function(_0x5180a1){_0x375263[_0xbe6b('0x5e')]=_0x5180a1;return _0x375263;});}})['then'](respondWithFilteredResult(_0x2a7dba,_0x31ecb8))[_0xbe6b('0x49')](handleError(_0x2a7dba,null));};exports[_0xbe6b('0x5f')]=function(_0x556674,_0x1032df,_0x34e26d){return db['CmList']['find']({'where':{'id':_0x556674[_0xbe6b('0x56')]['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x1032df,null))[_0xbe6b('0x29')](function(_0x32710d){if(_0x32710d){return _0x32710d[_0xbe6b('0x5f')](_0x556674['query'][_0xbe6b('0x60')]);}})[_0xbe6b('0x29')](respondWithStatusCode(_0x1032df,null))[_0xbe6b('0x49')](handleError(_0x1032df,null));};exports[_0xbe6b('0x61')]=function(_0x42d0ec,_0x8ace57,_0x2cc66c){return db[_0xbe6b('0x45')][_0xbe6b('0x50')]({'where':{'id':_0x42d0ec[_0xbe6b('0x56')]['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x8ace57,null))[_0xbe6b('0x29')](function(_0x3a1fe0){if(_0x3a1fe0){var _0x36bd2c=[];var _0x3c9a49={'success':[],'errors':[]};return db[_0xbe6b('0x62')]['describe']()[_0xbe6b('0x29')](function(_0x1d8eed){if(_0x42d0ec['body'][_0xbe6b('0x63')]&&_[_0xbe6b('0x64')](_0x42d0ec[_0xbe6b('0x55')][_0xbe6b('0x63')])){if(_0x42d0ec[_0xbe6b('0x55')][_0xbe6b('0x63')][_0xbe6b('0x3c')]){_0x42d0ec[_0xbe6b('0x55')]['tags']=_0x42d0ec[_0xbe6b('0x55')][_0xbe6b('0x63')][_0xbe6b('0x65')](';')+';';}else{_0x42d0ec[_0xbe6b('0x55')]['tags']=null;}}else{_0x42d0ec[_0xbe6b('0x55')]['tags']=null;}if(_0x42d0ec[_0xbe6b('0x55')]&&_[_0xbe6b('0x64')](_0x42d0ec[_0xbe6b('0x55')])){for(var _0x474dbf=0x0;_0x474dbf<_0x42d0ec['body']['length'];_0x474dbf+=0x1){_0x42d0ec[_0xbe6b('0x55')][_0x474dbf][_0xbe6b('0x5d')]=_0x42d0ec[_0xbe6b('0x56')]['id'];_0x36bd2c[_0xbe6b('0x66')](_0x42d0ec[_0xbe6b('0x55')][_0x474dbf]);}return BPromise[_0xbe6b('0x67')](_0x36bd2c,function(_0x1add7d){return db[_0xbe6b('0x62')]['create'](_['omit'](_0x1add7d,[_0xbe6b('0x60'),'id'])||{},{'fields':_[_0xbe6b('0x36')](_0x1d8eed),'raw':!![]})[_0xbe6b('0x29')](function(_0x5bca29){_0x3c9a49[_0xbe6b('0x68')][_0xbe6b('0x66')](_0x5bca29[_0xbe6b('0x69')]);})['catch'](function(_0x2fafb3){_0x3c9a49[_0xbe6b('0x6a')][_0xbe6b('0x66')]({'data':_0x1add7d,'error':_0x2fafb3['message']});});})[_0xbe6b('0x29')](function(_0x387161){return _0x3c9a49;})[_0xbe6b('0x49')](function(_0x2f44b3){return _0x2f44b3;});}else{_0x8ace57[_0xbe6b('0x1f')](0x190)[_0xbe6b('0x26')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xbe6b('0x29')](respondWithResult(_0x8ace57,null))[_0xbe6b('0x49')](handleError(_0x8ace57,null));};exports[_0xbe6b('0x6b')]=function(_0x41d9b7,_0x415b4f,_0x5eefcf){var _0x5af5d8;return db[_0xbe6b('0x45')]['find']({'where':{'id':_0x41d9b7[_0xbe6b('0x56')]['id']},'include':[{'model':db[_0xbe6b('0x6c')],'as':_0xbe6b('0x6d')}]})['then'](handleEntityNotFound(_0x415b4f,null))[_0xbe6b('0x29')](function(_0x2ea7eb){if(_0x2ea7eb){_0x5af5d8=_0x2ea7eb;return db['CmContact']['rawAttributes'];}})[_0xbe6b('0x29')](function(_0x2718ac){if(_0x2718ac){var _0x148f40={};var _0x551f90={};_0x551f90[_0xbe6b('0x39')]=_['concat'](_['keys'](_0x2718ac),_[_0xbe6b('0x34')](_0x5af5d8[_0xbe6b('0x6d')],function(_0x6d3277){return util['format'](_0xbe6b('0x6e'),_0x6d3277['id']);}));_0x551f90['query']=_[_0xbe6b('0x36')](_0x41d9b7[_0xbe6b('0x35')]);_0x551f90[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x551f90[_0xbe6b('0x39')],_0x551f90[_0xbe6b('0x35')]);_0x148f40['attributes']=_[_0xbe6b('0x38')](_0x551f90[_0xbe6b('0x39')],qs[_0xbe6b('0x3b')](_0x41d9b7[_0xbe6b('0x35')]['fields']));_0x148f40['attributes']=_0x148f40['attributes'][_0xbe6b('0x3c')]?_0x148f40[_0xbe6b('0x3a')]:_0x551f90[_0xbe6b('0x39')];if(!_0x41d9b7[_0xbe6b('0x35')][_0xbe6b('0x5b')]('nolimit')){_0x148f40['limit']=qs[_0xbe6b('0x23')](_0x41d9b7[_0xbe6b('0x35')]['limit']);_0x148f40[_0xbe6b('0x21')]=qs[_0xbe6b('0x21')](_0x41d9b7['query'][_0xbe6b('0x21')]);}_0x148f40[_0xbe6b('0x5c')]=qs['sort'](_0x41d9b7[_0xbe6b('0x35')][_0xbe6b('0x3e')]);_0x148f40[_0xbe6b('0x3f')]=qs[_0xbe6b('0x37')](_[_0xbe6b('0x40')](_0x41d9b7['query'],_0x551f90[_0xbe6b('0x37')]));_0x148f40[_0xbe6b('0x6f')]=!![];if(_0x41d9b7[_0xbe6b('0x35')][_0xbe6b('0x41')]){_0x148f40[_0xbe6b('0x3f')]=_[_0xbe6b('0x43')](_0x148f40[_0xbe6b('0x3f')],{'$or':_['map'](_0x148f40[_0xbe6b('0x3a')],function(_0x5b3aa6){var _0x2774e2={};_0x2774e2[_0x5b3aa6]={'$like':'%'+_0x41d9b7['query']['filter']+'%'};return _0x2774e2;})});}_0x148f40=_['merge']({},_0x148f40,_0x41d9b7[_0xbe6b('0x44')]);return _0x5af5d8[_0xbe6b('0x6b')](_0x148f40);}})['then'](respondWithResult(_0x415b4f,null))[_0xbe6b('0x49')](handleError(_0x415b4f,null));};exports[_0xbe6b('0x70')]=function(_0x3474eb,_0x5b1441,_0x2e4370){var _0x3404e3;return db['CmList'][_0xbe6b('0x50')]({'where':{'id':_0x3474eb['params']['id']},'include':[{'model':db[_0xbe6b('0x6c')],'as':_0xbe6b('0x6d')}]})[_0xbe6b('0x29')](handleEntityNotFound(_0x5b1441,null))[_0xbe6b('0x29')](function(_0x2ca4ed){if(_0x2ca4ed){_0x3404e3=_0x2ca4ed;return db[_0xbe6b('0x62')]['rawAttributes'];}})[_0xbe6b('0x29')](function(_0x9ca899){if(_0x9ca899){var _0x3a383c={};var _0x12802a={};_0x12802a['model']=_[_0xbe6b('0x71')](_[_0xbe6b('0x36')](_0x9ca899),_[_0xbe6b('0x34')](_0x3404e3['CustomFields'],function(_0x415f0b){return util[_0xbe6b('0x72')](_0xbe6b('0x6e'),_0x415f0b['id']);}));_0x12802a[_0xbe6b('0x35')]=_['keys'](_0x3474eb[_0xbe6b('0x35')]);_0x12802a[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x12802a[_0xbe6b('0x39')],_0x12802a[_0xbe6b('0x35')]);_0x3a383c[_0xbe6b('0x3a')]=_[_0xbe6b('0x38')](_0x12802a[_0xbe6b('0x39')],qs['fields'](_0x3474eb[_0xbe6b('0x35')][_0xbe6b('0x3b')]));_0x3a383c['attributes']=_0x3a383c[_0xbe6b('0x3a')]['length']?_0x3a383c['attributes']:_0x12802a[_0xbe6b('0x39')];if(!_0x3474eb[_0xbe6b('0x35')][_0xbe6b('0x5b')](_0xbe6b('0x3d'))){_0x3a383c[_0xbe6b('0x23')]=qs[_0xbe6b('0x23')](_0x3474eb[_0xbe6b('0x35')][_0xbe6b('0x23')]);_0x3a383c[_0xbe6b('0x21')]=qs[_0xbe6b('0x21')](_0x3474eb[_0xbe6b('0x35')][_0xbe6b('0x21')]);}_0x3a383c[_0xbe6b('0x5c')]=qs[_0xbe6b('0x3e')](_0x3474eb[_0xbe6b('0x35')]['sort']);_0x3a383c[_0xbe6b('0x3f')]=qs['filters'](_[_0xbe6b('0x40')](_0x3474eb['query'],_0x12802a[_0xbe6b('0x37')]));_0x3a383c['raw']=!![];if(_0x3474eb['query'][_0xbe6b('0x41')]){_0x3a383c[_0xbe6b('0x3f')]=_[_0xbe6b('0x43')](_0x3a383c[_0xbe6b('0x3f')],{'$or':_['map'](_0x3a383c[_0xbe6b('0x3a')],function(_0x2cd5d9){var _0x15e031={};_0x15e031[_0x2cd5d9]={'$like':'%'+_0x3474eb[_0xbe6b('0x35')]['filter']+'%'};return _0x15e031;})});}_0x3a383c=_[_0xbe6b('0x43')]({},_0x3a383c,_0x3474eb['options']);return _0x3404e3['getContacts'](_0x3a383c);}})[_0xbe6b('0x29')](function(_0x180399){if(!_[_0xbe6b('0x73')](_0x180399)){var _0x9307c2=toCsv(_0x180399);var _0xf6d28d=Date['now']();fs[_0xbe6b('0x74')](util[_0xbe6b('0x72')](_0xbe6b('0x75'),_0x3404e3['id'],_0xf6d28d),_0x9307c2);_0x5b1441['setHeader'](_0xbe6b('0x76'),_0xbe6b('0x77')+util['format'](_0xbe6b('0x78'),_0x3404e3['id'],_0xf6d28d));_0x5b1441[_0xbe6b('0x79')](_0xbe6b('0x7a'),_0xbe6b('0x7b'));return _0x5b1441[_0xbe6b('0x7c')](util[_0xbe6b('0x72')](_0xbe6b('0x75'),_0x3404e3['id'],_0xf6d28d));}else{return _0x5b1441['sendStatus'](0xcc);}})[_0xbe6b('0x49')](handleError(_0x5b1441,null));};exports[_0xbe6b('0x7d')]=function(_0x5a1250,_0xa24f7c,_0x52df66){var _0xc33e66;delete _0x5a1250['body']['id'];return db[_0xbe6b('0x45')][_0xbe6b('0x7e')]({'where':{'id':_0x5a1250[_0xbe6b('0x56')]['id']}})['then'](handleEntityNotFound(_0xa24f7c,null))[_0xbe6b('0x29')](function(_0x152675){if(_0x152675){return db['sequelize'][_0xbe6b('0x7f')](function(_0x501bb1){return db['CmCustomField']['create'](_0x5a1250[_0xbe6b('0x55')],{'transaction':_0x501bb1})[_0xbe6b('0x29')](function(_0x1254b3){_0xc33e66=_0x1254b3;return _0x152675['addCustomFields'](_0x1254b3,{'transaction':_0x501bb1});})[_0xbe6b('0x29')](function(){var _0x54c446={'type':db[_0xbe6b('0x80')][_0xbe6b('0x81')],'transaction':_0x501bb1};switch(_0x5a1250['body'][_0xbe6b('0x32')]){case'text':_0x54c446[_0xbe6b('0x32')]=db[_0xbe6b('0x80')][_0xbe6b('0x81')];break;case _0xbe6b('0x82'):_0x54c446['type']=db[_0xbe6b('0x80')][_0xbe6b('0x83')];break;case _0xbe6b('0x84'):_0x54c446[_0xbe6b('0x32')]=db[_0xbe6b('0x80')][_0xbe6b('0x85')];_0x54c446[_0xbe6b('0x86')]=![];break;default:}return db[_0xbe6b('0x87')][_0xbe6b('0x88')]['addColumn'](_0xbe6b('0x89'),util[_0xbe6b('0x72')]('cf_%s',_0xc33e66['id']),_0x54c446);})[_0xbe6b('0x29')](function(){return _0xc33e66;});});}})[_0xbe6b('0x29')](respondWithResult(_0xa24f7c,null))['catch'](handleError(_0xa24f7c,null));};exports[_0xbe6b('0x8a')]=function(_0x3739e1,_0xc40026,_0x31b7cd){var _0x142905={};var _0x519f3a={};var _0x518486;var _0x46c3ed;return db[_0xbe6b('0x45')]['findOne']({'where':{'id':_0x3739e1['params']['id']}})['then'](handleEntityNotFound(_0xc40026,null))[_0xbe6b('0x29')](function(_0x47e939){if(_0x47e939){_0x518486=_0x47e939;_0x519f3a[_0xbe6b('0x39')]=_[_0xbe6b('0x36')](db[_0xbe6b('0x6c')]['rawAttributes']);_0x519f3a[_0xbe6b('0x35')]=_[_0xbe6b('0x36')](_0x3739e1[_0xbe6b('0x35')]);_0x519f3a[_0xbe6b('0x37')]=_[_0xbe6b('0x38')](_0x519f3a['model'],_0x519f3a[_0xbe6b('0x35')]);_0x142905[_0xbe6b('0x3a')]=_[_0xbe6b('0x38')](_0x519f3a[_0xbe6b('0x39')],qs['fields'](_0x3739e1['query'][_0xbe6b('0x3b')]));_0x142905[_0xbe6b('0x3a')]=_0x142905['attributes']['length']?_0x142905[_0xbe6b('0x3a')]:_0x519f3a[_0xbe6b('0x39')];_0x142905['order']=qs[_0xbe6b('0x3e')](_0x3739e1['query'][_0xbe6b('0x3e')]);_0x142905[_0xbe6b('0x3f')]=qs[_0xbe6b('0x37')](_[_0xbe6b('0x40')](_0x3739e1[_0xbe6b('0x35')],_0x519f3a[_0xbe6b('0x37')]));_0x142905[_0xbe6b('0x3f')]=_[_0xbe6b('0x43')](_0x142905[_0xbe6b('0x3f')],{'$or':[{'ListId':_0x47e939['id']},{'ListId':null}]});if(_0x3739e1[_0xbe6b('0x35')]['filter']){_0x142905[_0xbe6b('0x3f')]=_[_0xbe6b('0x43')](_0x142905[_0xbe6b('0x3f')],{'$or':_[_0xbe6b('0x34')](_0x142905['attributes'],function(_0x5b00bd){var _0x1f0536={};_0x1f0536[_0x5b00bd]={'$like':'%'+_0x3739e1[_0xbe6b('0x35')][_0xbe6b('0x41')]+'%'};return _0x1f0536;})});}_0x142905=_[_0xbe6b('0x43')]({},_0x142905,_0x3739e1[_0xbe6b('0x44')]);return db[_0xbe6b('0x6c')][_0xbe6b('0x8b')](_0x142905);}})[_0xbe6b('0x29')](respondWithResult(_0xc40026,null))['catch'](handleError(_0xc40026,null));};exports[_0xbe6b('0x8c')]=function(_0x166ca3,_0x394233,_0x19c2a2){return db[_0xbe6b('0x45')][_0xbe6b('0x50')]({'where':{'id':_0x166ca3['params']['id']}})['then'](handleEntityNotFound(_0x394233,null))[_0xbe6b('0x29')](function(_0x5f1a7b){if(_0x5f1a7b){return _0x5f1a7b[_0xbe6b('0x8c')](_0x166ca3['body'][_0xbe6b('0x60')],_[_0xbe6b('0x8d')](_0x166ca3['body'],['ids','id'])||{})['spread'](function(_0x24100d){for(var _0x367f2f=0x0;_0x367f2f<_0x166ca3[_0xbe6b('0x55')][_0xbe6b('0x60')][_0xbe6b('0x3c')];_0x367f2f+=0x1){socket[_0xbe6b('0x8e')](_0xbe6b('0x8f'),{'UserId':Number(_0x166ca3[_0xbe6b('0x55')][_0xbe6b('0x60')][_0x367f2f]),'CmListId':Number(_0x166ca3[_0xbe6b('0x56')]['id'])});}return _0x24100d;});}})[_0xbe6b('0x29')](respondWithResult(_0x394233,null))[_0xbe6b('0x49')](handleError(_0x394233,null));};exports[_0xbe6b('0x90')]=function(_0x2bc6c3,_0x52b130,_0x5a2394){return db['CmList']['find']({'where':{'id':_0x2bc6c3['params']['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x52b130,null))[_0xbe6b('0x29')](function(_0x5c43c4){if(_0x5c43c4){return _0x5c43c4[_0xbe6b('0x90')](_0x2bc6c3['query'][_0xbe6b('0x60')])['then'](function(){if(_['isArray'](_0x2bc6c3[_0xbe6b('0x35')][_0xbe6b('0x60')])){for(var _0x46f424=0x0;_0x46f424<_0x2bc6c3['query'][_0xbe6b('0x60')][_0xbe6b('0x3c')];_0x46f424+=0x1){socket[_0xbe6b('0x8e')](_0xbe6b('0x91'),{'UserId':Number(_0x2bc6c3['query'][_0xbe6b('0x60')][_0x46f424]),'CmListId':Number(_0x2bc6c3[_0xbe6b('0x56')]['id'])});}}else{socket[_0xbe6b('0x8e')]('userCmList:remove',{'UserId':Number(_0x2bc6c3[_0xbe6b('0x35')][_0xbe6b('0x60')]),'CmListId':Number(_0x2bc6c3[_0xbe6b('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x52b130,null))[_0xbe6b('0x49')](handleError(_0x52b130,null));};exports[_0xbe6b('0x92')]=function(_0xe51478,_0x14ef85,_0x4e1a52){var _0x21f80e={};var _0xad1fc4={};var _0x32b19c;var _0x4eb293;return db['CmList'][_0xbe6b('0x7e')]({'where':{'id':_0xe51478[_0xbe6b('0x56')]['id']}})[_0xbe6b('0x29')](handleEntityNotFound(_0x14ef85,null))[_0xbe6b('0x29')](function(_0x3b362d){if(_0x3b362d){_0x32b19c=_0x3b362d;_0xad1fc4[_0xbe6b('0x39')]=_[_0xbe6b('0x36')](db[_0xbe6b('0x93')][_0xbe6b('0x31')]);_0xad1fc4['query']=_[_0xbe6b('0x36')](_0xe51478[_0xbe6b('0x35')]);_0xad1fc4['filters']=_[_0xbe6b('0x38')](_0xad1fc4[_0xbe6b('0x39')],_0xad1fc4[_0xbe6b('0x35')]);_0x21f80e[_0xbe6b('0x3a')]=_[_0xbe6b('0x38')](_0xad1fc4[_0xbe6b('0x39')],qs['fields'](_0xe51478[_0xbe6b('0x35')]['fields']));_0x21f80e[_0xbe6b('0x3a')]=_0x21f80e[_0xbe6b('0x3a')]['length']?_0x21f80e['attributes']:_0xad1fc4[_0xbe6b('0x39')];_0x21f80e['order']=qs[_0xbe6b('0x3e')](_0xe51478[_0xbe6b('0x35')][_0xbe6b('0x3e')]);_0x21f80e[_0xbe6b('0x3f')]=qs[_0xbe6b('0x37')](_['pick'](_0xe51478[_0xbe6b('0x35')],_0xad1fc4[_0xbe6b('0x37')]));if(_0xe51478[_0xbe6b('0x35')][_0xbe6b('0x41')]){_0x21f80e['where']=_[_0xbe6b('0x43')](_0x21f80e[_0xbe6b('0x3f')],{'$or':_[_0xbe6b('0x34')](_0x21f80e[_0xbe6b('0x3a')],function(_0x11e77e){var _0x2ed7f0={};_0x2ed7f0[_0x11e77e]={'$like':'%'+_0xe51478[_0xbe6b('0x35')][_0xbe6b('0x41')]+'%'};return _0x2ed7f0;})});}_0x21f80e=_[_0xbe6b('0x43')]({},_0x21f80e,_0xe51478[_0xbe6b('0x44')]);return _0x32b19c['getAgents'](_0x21f80e);}})[_0xbe6b('0x29')](function(_0x549aa9){if(_0x549aa9){_0x4eb293=_0x549aa9[_0xbe6b('0x3c')];if(!_0xe51478[_0xbe6b('0x35')]['hasOwnProperty'](_0xbe6b('0x3d'))){_0x21f80e[_0xbe6b('0x23')]=qs[_0xbe6b('0x23')](_0xe51478[_0xbe6b('0x35')][_0xbe6b('0x23')]);_0x21f80e[_0xbe6b('0x21')]=qs[_0xbe6b('0x21')](_0xe51478[_0xbe6b('0x35')][_0xbe6b('0x21')]);}return _0x32b19c[_0xbe6b('0x92')](_0x21f80e);}})[_0xbe6b('0x29')](function(_0x2e0906){if(_0x2e0906){return _0x2e0906?{'count':_0x4eb293,'rows':_0x2e0906}:null;}})[_0xbe6b('0x29')](respondWithResult(_0x14ef85,null))['catch'](handleError(_0x14ef85,null));}; \ No newline at end of file +var _0x6844=['push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','CmList','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','describe','addDisposition','body','Disposition','getDispositions','findOne','order','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray'];(function(_0x261844,_0x3b27c5){var _0x1fe3cd=function(_0x5b331b){while(--_0x5b331b){_0x261844['push'](_0x261844['shift']());}};_0x1fe3cd(++_0x3b27c5);}(_0x6844,0x14f));var _0x4684=function(_0x54764c,_0x2328db){_0x54764c=_0x54764c-0x0;var _0x89a299=_0x6844[_0x54764c];return _0x89a299;};'use strict';var emlformat=require(_0x4684('0x0'));var rimraf=require(_0x4684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4684('0x2'));var moment=require(_0x4684('0x3'));var BPromise=require(_0x4684('0x4'));var Mustache=require(_0x4684('0x5'));var util=require(_0x4684('0x6'));var path=require('path');var sox=require(_0x4684('0x7'));var csv=require(_0x4684('0x8'));var ejs=require(_0x4684('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4684('0xa'));var crypto=require('crypto');var jsforce=require(_0x4684('0xb'));var deskjs=require(_0x4684('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4684('0xd'));var Papa=require('papaparse');var Redis=require(_0x4684('0xe'));var authService=require(_0x4684('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4684('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4684('0x11'))('api');var utils=require(_0x4684('0x12'));var config=require(_0x4684('0x13'));var licenseUtil=require(_0x4684('0x14'));var db=require(_0x4684('0x15'))['db'];config['redis']=_[_0x4684('0x16')](config[_0x4684('0x17')],{'host':_0x4684('0x18'),'port':0x18eb});var socket=require(_0x4684('0x19'))(new Redis(config[_0x4684('0x17')]));require(_0x4684('0x1a'))[_0x4684('0x1b')](socket);function respondWithStatusCode(_0x1efbfa,_0x9bb339){_0x9bb339=_0x9bb339||0xcc;return function(_0x32586c){if(_0x32586c){return _0x1efbfa['sendStatus'](_0x9bb339);}return _0x1efbfa[_0x4684('0x1c')](_0x9bb339)[_0x4684('0x1d')]();};}function respondWithResult(_0x18d0a7,_0x38c7f7){_0x38c7f7=_0x38c7f7||0xc8;return function(_0x2ee313){if(_0x2ee313){return _0x18d0a7[_0x4684('0x1c')](_0x38c7f7)[_0x4684('0x1e')](_0x2ee313);}};}function respondWithFilteredResult(_0x2160f9,_0x53007c){return function(_0x36a7ce){if(_0x36a7ce){var _0x9bb105=typeof _0x53007c[_0x4684('0x1f')]===_0x4684('0x20')&&typeof _0x53007c[_0x4684('0x21')]===_0x4684('0x20');var _0x320ec7=_0x36a7ce[_0x4684('0x22')];var _0x146620=_0x9bb105?0x0:_0x53007c['offset'];var _0x4a344f=_0x9bb105?_0x36a7ce[_0x4684('0x22')]:_0x53007c[_0x4684('0x1f')]+_0x53007c[_0x4684('0x21')];var _0x2d075a;if(_0x4a344f>=_0x320ec7){_0x4a344f=_0x320ec7;_0x2d075a=0xc8;}else{_0x2d075a=0xce;}_0x2160f9[_0x4684('0x1c')](_0x2d075a);return _0x2160f9[_0x4684('0x23')](_0x4684('0x24'),_0x146620+'-'+_0x4a344f+'/'+_0x320ec7)[_0x4684('0x1e')](_0x36a7ce);}return null;};}function patchUpdates(_0x2d9575){return function(_0x286c98){try{jsonpatch['apply'](_0x286c98,_0x2d9575,!![]);}catch(_0x31e330){return BPromise[_0x4684('0x25')](_0x31e330);}return _0x286c98['save']();};}function saveUpdates(_0x5b25cf,_0x140b8a){return function(_0x225fde){if(_0x225fde){return _0x225fde[_0x4684('0x26')](_0x5b25cf)[_0x4684('0x27')](function(_0x3a4447){return _0x3a4447;});}return null;};}function removeEntity(_0x1e34b1,_0x395101){return function(_0x1a924b){if(_0x1a924b){return _0x1a924b[_0x4684('0x28')]()[_0x4684('0x27')](function(){var _0x38fb63=_0x1a924b[_0x4684('0x29')]({'plain':!![]});var _0x1aea47=_0x4684('0x2a');return db[_0x4684('0x2b')][_0x4684('0x28')]({'where':{'type':_0x1aea47,'resourceId':_0x38fb63['id']}})[_0x4684('0x27')](function(){return _0x1a924b;});})[_0x4684('0x27')](function(){_0x1e34b1[_0x4684('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104588,_0x27e41e){return function(_0x5cd4ac){if(!_0x5cd4ac){_0x104588[_0x4684('0x2c')](0x194);}return _0x5cd4ac;};}function handleError(_0x42a812,_0x3234f1){_0x3234f1=_0x3234f1||0x1f4;return function(_0x40ea5f){logger[_0x4684('0x2d')](_0x40ea5f['stack']);if(_0x40ea5f[_0x4684('0x2e')]){delete _0x40ea5f[_0x4684('0x2e')];}_0x42a812[_0x4684('0x1c')](_0x3234f1)[_0x4684('0x2f')](_0x40ea5f);};}exports[_0x4684('0x30')]=function(_0x373287,_0x4c6259){var _0x473047={},_0x15a6fb={},_0x534210={'count':0x0,'rows':[]};var _0x17de23=_[_0x4684('0x31')](db['CmList'][_0x4684('0x32')],function(_0x463888){return{'name':_0x463888[_0x4684('0x33')],'type':_0x463888['type'][_0x4684('0x34')]};});_0x15a6fb[_0x4684('0x35')]=_[_0x4684('0x31')](_0x17de23,'name');_0x15a6fb[_0x4684('0x36')]=_[_0x4684('0x37')](_0x373287[_0x4684('0x36')]);_0x15a6fb[_0x4684('0x38')]=_[_0x4684('0x39')](_0x15a6fb[_0x4684('0x35')],_0x15a6fb[_0x4684('0x36')]);_0x473047[_0x4684('0x3a')]=_[_0x4684('0x39')](_0x15a6fb[_0x4684('0x35')],qs['fields'](_0x373287['query'][_0x4684('0x3b')]));_0x473047[_0x4684('0x3a')]=_0x473047[_0x4684('0x3a')][_0x4684('0x3c')]?_0x473047[_0x4684('0x3a')]:_0x15a6fb[_0x4684('0x35')];if(!_0x373287['query'][_0x4684('0x3d')](_0x4684('0x3e'))){_0x473047[_0x4684('0x21')]=qs[_0x4684('0x21')](_0x373287[_0x4684('0x36')][_0x4684('0x21')]);_0x473047[_0x4684('0x1f')]=qs[_0x4684('0x1f')](_0x373287[_0x4684('0x36')][_0x4684('0x1f')]);}_0x473047['order']=qs[_0x4684('0x3f')](_0x373287['query'][_0x4684('0x3f')]);_0x473047[_0x4684('0x40')]=qs['filters'](_[_0x4684('0x41')](_0x373287[_0x4684('0x36')],_0x15a6fb['filters']),_0x17de23);if(_0x373287['query'][_0x4684('0x42')]){_0x473047[_0x4684('0x40')]=_[_0x4684('0x43')](_0x473047[_0x4684('0x40')],{'$or':_[_0x4684('0x31')](_0x17de23,function(_0x19bed6){if(_0x19bed6[_0x4684('0x44')]!==_0x4684('0x45')){var _0x3bc51b={};_0x3bc51b[_0x19bed6[_0x4684('0x2e')]]={'$like':'%'+_0x373287['query']['filter']+'%'};return _0x3bc51b;}})});}_0x473047=_['merge']({},_0x473047,_0x373287[_0x4684('0x46')]);var _0x3becb5={'where':_0x473047[_0x4684('0x40')]};return db['CmList'][_0x4684('0x22')](_0x3becb5)[_0x4684('0x27')](function(_0x1eed69){_0x534210[_0x4684('0x22')]=_0x1eed69;if(_0x373287[_0x4684('0x36')][_0x4684('0x47')]){_0x473047[_0x4684('0x48')]=[{'all':!![]}];}return db[_0x4684('0x49')][_0x4684('0x4a')](_0x473047);})[_0x4684('0x27')](function(_0xfed9c7){_0x534210[_0x4684('0x4b')]=_0xfed9c7;return _0x534210;})[_0x4684('0x27')](respondWithFilteredResult(_0x4c6259,_0x473047))[_0x4684('0x4c')](handleError(_0x4c6259,null));};exports[_0x4684('0x4d')]=function(_0x18231b,_0x5a0f8f){var _0x36515f={'raw':![],'where':{'id':_0x18231b[_0x4684('0x4e')]['id']}},_0x47ca81={};_0x47ca81[_0x4684('0x35')]=_[_0x4684('0x37')](db[_0x4684('0x49')][_0x4684('0x32')]);_0x47ca81['query']=_[_0x4684('0x37')](_0x18231b[_0x4684('0x36')]);_0x47ca81[_0x4684('0x38')]=_[_0x4684('0x39')](_0x47ca81['model'],_0x47ca81[_0x4684('0x36')]);_0x36515f[_0x4684('0x3a')]=_[_0x4684('0x39')](_0x47ca81[_0x4684('0x35')],qs[_0x4684('0x3b')](_0x18231b['query'][_0x4684('0x3b')]));_0x36515f[_0x4684('0x3a')]=_0x36515f[_0x4684('0x3a')][_0x4684('0x3c')]?_0x36515f[_0x4684('0x3a')]:_0x47ca81[_0x4684('0x35')];if(_0x18231b['query']['includeAll']){_0x36515f['include']=[{'all':!![]}];}_0x36515f=_[_0x4684('0x43')]({},_0x36515f,_0x18231b[_0x4684('0x46')]);return db[_0x4684('0x49')][_0x4684('0x4f')](_0x36515f)['then'](handleEntityNotFound(_0x5a0f8f,null))[_0x4684('0x27')](respondWithResult(_0x5a0f8f,null))['catch'](handleError(_0x5a0f8f,null));};exports[_0x4684('0x50')]=function(_0x5b4d7b,_0x3ba5d1){return db[_0x4684('0x49')][_0x4684('0x50')](_0x5b4d7b['body'],{})[_0x4684('0x27')](function(_0x8ce9ce){var _0x5a3ec1=_0x5b4d7b['user'][_0x4684('0x29')]({'plain':!![]});if(!_0x5a3ec1)throw new Error(_0x4684('0x51'));if(_0x5a3ec1[_0x4684('0x52')]===_0x4684('0x53')){var _0x3bf093=_0x8ce9ce[_0x4684('0x29')]({'plain':!![]});var _0x11c9a0=_0x4684('0x2a');return db[_0x4684('0x54')][_0x4684('0x4f')]({'where':{'name':_0x11c9a0,'userProfileId':_0x5a3ec1['userProfileId']},'raw':!![]})[_0x4684('0x27')](function(_0x1f4f90){if(_0x1f4f90&&_0x1f4f90[_0x4684('0x55')]===0x0){return db[_0x4684('0x2b')]['create']({'name':_0x3bf093['name'],'resourceId':_0x3bf093['id'],'type':_0x1f4f90[_0x4684('0x2e')],'sectionId':_0x1f4f90['id']},{})[_0x4684('0x27')](function(){return _0x8ce9ce;});}else{return _0x8ce9ce;}})[_0x4684('0x4c')](function(_0x1498a1){logger[_0x4684('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1498a1);throw _0x1498a1;});}return _0x8ce9ce;})[_0x4684('0x27')](respondWithResult(_0x3ba5d1,0xc9))[_0x4684('0x4c')](handleError(_0x3ba5d1,null));};exports[_0x4684('0x26')]=function(_0x28dd1c,_0x4b6f38){if(_0x28dd1c['body']['id']){delete _0x28dd1c['body']['id'];}return db[_0x4684('0x49')][_0x4684('0x4f')]({'where':{'id':_0x28dd1c['params']['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x4b6f38,null))[_0x4684('0x27')](saveUpdates(_0x28dd1c['body'],null))[_0x4684('0x27')](respondWithResult(_0x4b6f38,null))[_0x4684('0x4c')](handleError(_0x4b6f38,null));};exports[_0x4684('0x28')]=function(_0x3e9540,_0x4c430){return db['CmList']['find']({'where':{'id':_0x3e9540[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x4c430,null))['then'](removeEntity(_0x4c430,null))[_0x4684('0x4c')](handleError(_0x4c430,null));};exports[_0x4684('0x56')]=function(_0x3238d5,_0x33ce2b){return db['CmList'][_0x4684('0x56')]()['then'](respondWithResult(_0x33ce2b,null))['catch'](handleError(_0x33ce2b,null));};exports[_0x4684('0x57')]=function(_0x53d4a2,_0x3c94cc,_0x367ae3){if(_0x53d4a2[_0x4684('0x58')]['id']){delete _0x53d4a2['body']['id'];}return db[_0x4684('0x49')]['find']({'where':{'id':_0x53d4a2[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x3c94cc,null))[_0x4684('0x27')](function(_0x32a4a0){if(_0x32a4a0){_0x53d4a2[_0x4684('0x58')]['ListId']=_0x32a4a0['id'];return db[_0x4684('0x59')][_0x4684('0x50')](_0x53d4a2[_0x4684('0x58')]);}})[_0x4684('0x27')](respondWithResult(_0x3c94cc,null))['catch'](handleError(_0x3c94cc,null));};exports[_0x4684('0x5a')]=function(_0x2b4c2e,_0x1b4efb,_0x4aef1c){var _0x221630={'raw':![],'where':{}};var _0x146e73={};var _0x5e46f5={'count':0x0,'rows':[]};return db[_0x4684('0x49')][_0x4684('0x5b')]({'where':{'id':_0x2b4c2e[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x1b4efb,null))[_0x4684('0x27')](function(_0x11f295){if(_0x11f295){_0x146e73[_0x4684('0x35')]=_[_0x4684('0x37')](db['Disposition'][_0x4684('0x32')]);_0x146e73[_0x4684('0x36')]=_['keys'](_0x2b4c2e['query']);_0x146e73[_0x4684('0x38')]=_[_0x4684('0x39')](_0x146e73[_0x4684('0x35')],_0x146e73[_0x4684('0x36')]);_0x221630[_0x4684('0x3a')]=_[_0x4684('0x39')](_0x146e73[_0x4684('0x35')],qs[_0x4684('0x3b')](_0x2b4c2e['query'][_0x4684('0x3b')]));_0x221630[_0x4684('0x3a')]=_0x221630[_0x4684('0x3a')][_0x4684('0x3c')]?_0x221630[_0x4684('0x3a')]:_0x146e73[_0x4684('0x35')];if(!_0x2b4c2e[_0x4684('0x36')]['hasOwnProperty'](_0x4684('0x3e'))){_0x221630['limit']=qs[_0x4684('0x21')](_0x2b4c2e[_0x4684('0x36')][_0x4684('0x21')]);_0x221630['offset']=qs[_0x4684('0x1f')](_0x2b4c2e['query']['offset']);}_0x221630[_0x4684('0x5c')]=qs[_0x4684('0x3f')](_0x2b4c2e[_0x4684('0x36')][_0x4684('0x3f')]);_0x221630[_0x4684('0x40')]=qs['filters'](_['pick'](_0x2b4c2e[_0x4684('0x36')],_0x146e73[_0x4684('0x38')]));_0x221630[_0x4684('0x40')][_0x4684('0x5d')]=_0x11f295['id'];if(_0x2b4c2e[_0x4684('0x36')][_0x4684('0x42')]){_0x221630[_0x4684('0x40')]=_[_0x4684('0x43')](_0x221630['where'],{'$or':_['map'](_0x221630[_0x4684('0x3a')],function(_0x49043e){var _0x41b4f4={};_0x41b4f4[_0x49043e]={'$like':'%'+_0x2b4c2e['query'][_0x4684('0x42')]+'%'};return _0x41b4f4;})});}_0x221630=_['merge']({},_0x221630,_0x2b4c2e[_0x4684('0x46')]);return db[_0x4684('0x59')][_0x4684('0x22')]({'where':_0x221630[_0x4684('0x40')]})['then'](function(_0x3723e5){_0x5e46f5[_0x4684('0x22')]=_0x3723e5;if(_0x2b4c2e[_0x4684('0x36')]['includeAll']){_0x221630[_0x4684('0x48')]=[{'all':!![]}];}return db[_0x4684('0x59')][_0x4684('0x4a')](_0x221630);})[_0x4684('0x27')](function(_0x2946b7){_0x5e46f5['rows']=_0x2946b7;return _0x5e46f5;});}})[_0x4684('0x27')](respondWithFilteredResult(_0x1b4efb,_0x221630))['catch'](handleError(_0x1b4efb,null));};exports[_0x4684('0x5e')]=function(_0x38951a,_0x3a0bc5,_0x35d186){return db[_0x4684('0x49')]['find']({'where':{'id':_0x38951a[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x3a0bc5,null))['then'](function(_0x4fcc9b){if(_0x4fcc9b){return _0x4fcc9b[_0x4684('0x5e')](_0x38951a[_0x4684('0x36')][_0x4684('0x5f')]);}})[_0x4684('0x27')](respondWithStatusCode(_0x3a0bc5,null))[_0x4684('0x4c')](handleError(_0x3a0bc5,null));};exports[_0x4684('0x60')]=function(_0x1e1516,_0x5ebf08,_0x3f045b){return db[_0x4684('0x49')][_0x4684('0x4f')]({'where':{'id':_0x1e1516[_0x4684('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ebf08,null))[_0x4684('0x27')](function(_0x35730f){if(_0x35730f){var _0x4fc658=[];var _0x144724={'success':[],'errors':[]};return db[_0x4684('0x61')][_0x4684('0x56')]()[_0x4684('0x27')](function(_0x26ea17){if(_0x1e1516['body'][_0x4684('0x62')]&&_[_0x4684('0x63')](_0x1e1516[_0x4684('0x58')][_0x4684('0x62')])){if(_0x1e1516[_0x4684('0x58')]['tags']['length']){_0x1e1516['body']['tags']=_0x1e1516[_0x4684('0x58')][_0x4684('0x62')]['join'](';')+';';}else{_0x1e1516[_0x4684('0x58')][_0x4684('0x62')]=null;}}else{_0x1e1516[_0x4684('0x58')]['tags']=null;}if(_0x1e1516[_0x4684('0x58')]&&_[_0x4684('0x63')](_0x1e1516[_0x4684('0x58')])){for(var _0x75a850=0x0;_0x75a850<_0x1e1516[_0x4684('0x58')][_0x4684('0x3c')];_0x75a850+=0x1){_0x1e1516[_0x4684('0x58')][_0x75a850][_0x4684('0x5d')]=_0x1e1516[_0x4684('0x4e')]['id'];_0x4fc658[_0x4684('0x64')](_0x1e1516[_0x4684('0x58')][_0x75a850]);}return BPromise[_0x4684('0x65')](_0x4fc658,function(_0x240dd9){return db['CmContact']['create'](_[_0x4684('0x66')](_0x240dd9,['ids','id'])||{},{'fields':_[_0x4684('0x37')](_0x26ea17),'raw':!![]})[_0x4684('0x27')](function(_0x51d627){_0x144724[_0x4684('0x67')][_0x4684('0x64')](_0x51d627[_0x4684('0x68')]);})['catch'](function(_0x320009){_0x144724[_0x4684('0x69')][_0x4684('0x64')]({'data':_0x240dd9,'error':_0x320009['message']});});})[_0x4684('0x27')](function(_0xf25572){return _0x144724;})[_0x4684('0x4c')](function(_0x44ec98){return _0x44ec98;});}else{_0x5ebf08['status'](0x190)[_0x4684('0x1e')]({'message':_0x4684('0x6a')});}});}})[_0x4684('0x27')](respondWithResult(_0x5ebf08,null))[_0x4684('0x4c')](handleError(_0x5ebf08,null));};exports[_0x4684('0x6b')]=function(_0x367217,_0x308f76,_0x47c5ca){var _0x2a61b8;return db[_0x4684('0x49')]['find']({'where':{'id':_0x367217[_0x4684('0x4e')]['id']},'include':[{'model':db[_0x4684('0x6c')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x308f76,null))[_0x4684('0x27')](function(_0x1db661){if(_0x1db661){_0x2a61b8=_0x1db661;return db[_0x4684('0x61')][_0x4684('0x32')];}})['then'](function(_0x34278e){if(_0x34278e){var _0x1c2198={};var _0x2fdcae={};_0x2fdcae['model']=_['concat'](_[_0x4684('0x37')](_0x34278e),_['map'](_0x2a61b8[_0x4684('0x6d')],function(_0x1a767c){return util[_0x4684('0x6e')](_0x4684('0x6f'),_0x1a767c['id']);}));_0x2fdcae[_0x4684('0x36')]=_[_0x4684('0x37')](_0x367217[_0x4684('0x36')]);_0x2fdcae[_0x4684('0x38')]=_['intersection'](_0x2fdcae[_0x4684('0x35')],_0x2fdcae[_0x4684('0x36')]);_0x1c2198[_0x4684('0x3a')]=_[_0x4684('0x39')](_0x2fdcae[_0x4684('0x35')],qs['fields'](_0x367217['query'][_0x4684('0x3b')]));_0x1c2198[_0x4684('0x3a')]=_0x1c2198[_0x4684('0x3a')][_0x4684('0x3c')]?_0x1c2198[_0x4684('0x3a')]:_0x2fdcae[_0x4684('0x35')];if(!_0x367217[_0x4684('0x36')][_0x4684('0x3d')]('nolimit')){_0x1c2198[_0x4684('0x21')]=qs[_0x4684('0x21')](_0x367217[_0x4684('0x36')]['limit']);_0x1c2198[_0x4684('0x1f')]=qs[_0x4684('0x1f')](_0x367217[_0x4684('0x36')][_0x4684('0x1f')]);}_0x1c2198['order']=qs[_0x4684('0x3f')](_0x367217[_0x4684('0x36')][_0x4684('0x3f')]);_0x1c2198[_0x4684('0x40')]=qs[_0x4684('0x38')](_['pick'](_0x367217[_0x4684('0x36')],_0x2fdcae[_0x4684('0x38')]));_0x1c2198['raw']=!![];if(_0x367217[_0x4684('0x36')][_0x4684('0x42')]){_0x1c2198[_0x4684('0x40')]=_[_0x4684('0x43')](_0x1c2198[_0x4684('0x40')],{'$or':_[_0x4684('0x31')](_0x1c2198[_0x4684('0x3a')],function(_0x310cd9){var _0x508faa={};_0x508faa[_0x310cd9]={'$like':'%'+_0x367217[_0x4684('0x36')]['filter']+'%'};return _0x508faa;})});}_0x1c2198=_[_0x4684('0x43')]({},_0x1c2198,_0x367217[_0x4684('0x46')]);return _0x2a61b8['getContacts'](_0x1c2198);}})[_0x4684('0x27')](respondWithResult(_0x308f76,null))[_0x4684('0x4c')](handleError(_0x308f76,null));};exports['getContactsCsv']=function(_0x29bdfe,_0x51e665,_0x2ef822){var _0x586217;return db[_0x4684('0x49')][_0x4684('0x4f')]({'where':{'id':_0x29bdfe[_0x4684('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4684('0x6d')}]})[_0x4684('0x27')](handleEntityNotFound(_0x51e665,null))[_0x4684('0x27')](function(_0x341324){if(_0x341324){_0x586217=_0x341324;return db['CmContact'][_0x4684('0x32')];}})[_0x4684('0x27')](function(_0x2b72d0){if(_0x2b72d0){var _0x273ab9={};var _0x385fe0={};_0x385fe0[_0x4684('0x35')]=_['concat'](_[_0x4684('0x37')](_0x2b72d0),_[_0x4684('0x31')](_0x586217['CustomFields'],function(_0xbddac9){return util['format'](_0x4684('0x6f'),_0xbddac9['id']);}));_0x385fe0[_0x4684('0x36')]=_[_0x4684('0x37')](_0x29bdfe[_0x4684('0x36')]);_0x385fe0[_0x4684('0x38')]=_[_0x4684('0x39')](_0x385fe0['model'],_0x385fe0[_0x4684('0x36')]);_0x273ab9['attributes']=_[_0x4684('0x39')](_0x385fe0[_0x4684('0x35')],qs[_0x4684('0x3b')](_0x29bdfe[_0x4684('0x36')][_0x4684('0x3b')]));_0x273ab9[_0x4684('0x3a')]=_0x273ab9[_0x4684('0x3a')][_0x4684('0x3c')]?_0x273ab9[_0x4684('0x3a')]:_0x385fe0['model'];if(!_0x29bdfe['query'][_0x4684('0x3d')]('nolimit')){_0x273ab9[_0x4684('0x21')]=qs[_0x4684('0x21')](_0x29bdfe[_0x4684('0x36')][_0x4684('0x21')]);_0x273ab9[_0x4684('0x1f')]=qs['offset'](_0x29bdfe[_0x4684('0x36')][_0x4684('0x1f')]);}_0x273ab9[_0x4684('0x5c')]=qs[_0x4684('0x3f')](_0x29bdfe[_0x4684('0x36')][_0x4684('0x3f')]);_0x273ab9[_0x4684('0x40')]=qs[_0x4684('0x38')](_[_0x4684('0x41')](_0x29bdfe[_0x4684('0x36')],_0x385fe0[_0x4684('0x38')]));_0x273ab9[_0x4684('0x70')]=!![];if(_0x29bdfe[_0x4684('0x36')]['filter']){_0x273ab9[_0x4684('0x40')]=_[_0x4684('0x43')](_0x273ab9['where'],{'$or':_[_0x4684('0x31')](_0x273ab9[_0x4684('0x3a')],function(_0x5d8c05){var _0xd855b4={};_0xd855b4[_0x5d8c05]={'$like':'%'+_0x29bdfe[_0x4684('0x36')][_0x4684('0x42')]+'%'};return _0xd855b4;})});}_0x273ab9=_[_0x4684('0x43')]({},_0x273ab9,_0x29bdfe['options']);return _0x586217['getContacts'](_0x273ab9);}})[_0x4684('0x27')](function(_0x5dda3e){if(!_[_0x4684('0x71')](_0x5dda3e)){var _0x16500c=toCsv(_0x5dda3e);var _0x426809=Date[_0x4684('0x72')]();fs[_0x4684('0x73')](util[_0x4684('0x6e')](_0x4684('0x74'),_0x586217['id'],_0x426809),_0x16500c);_0x51e665[_0x4684('0x75')](_0x4684('0x76'),_0x4684('0x77')+util[_0x4684('0x6e')](_0x4684('0x78'),_0x586217['id'],_0x426809));_0x51e665[_0x4684('0x75')](_0x4684('0x79'),_0x4684('0x7a'));return _0x51e665[_0x4684('0x7b')](util[_0x4684('0x6e')](_0x4684('0x74'),_0x586217['id'],_0x426809));}else{return _0x51e665[_0x4684('0x2c')](0xcc);}})[_0x4684('0x4c')](handleError(_0x51e665,null));};exports['addCustomField']=function(_0xfaec06,_0x214965,_0x349e44){var _0x540a6d;delete _0xfaec06[_0x4684('0x58')]['id'];return db['CmList']['findOne']({'where':{'id':_0xfaec06[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x214965,null))[_0x4684('0x27')](function(_0x5eeb1f){if(_0x5eeb1f){return db['sequelize'][_0x4684('0x7c')](function(_0x56adcd){return db[_0x4684('0x6c')][_0x4684('0x50')](_0xfaec06['body'],{'transaction':_0x56adcd})[_0x4684('0x27')](function(_0x410d7a){_0x540a6d=_0x410d7a;return _0x5eeb1f[_0x4684('0x7d')](_0x410d7a,{'transaction':_0x56adcd});})[_0x4684('0x27')](function(){var _0x5e94c7={'type':db['Sequelize'][_0x4684('0x7e')],'transaction':_0x56adcd};switch(_0xfaec06[_0x4684('0x58')]['type']){case _0x4684('0x7f'):_0x5e94c7[_0x4684('0x44')]=db[_0x4684('0x80')][_0x4684('0x7e')];break;case _0x4684('0x81'):_0x5e94c7[_0x4684('0x44')]=db[_0x4684('0x80')][_0x4684('0x82')];break;case'switch':_0x5e94c7[_0x4684('0x44')]=db[_0x4684('0x80')][_0x4684('0x83')];_0x5e94c7[_0x4684('0x84')]=![];break;default:}return db[_0x4684('0x85')][_0x4684('0x86')]['addColumn'](_0x4684('0x87'),util['format'](_0x4684('0x88'),_0x540a6d['id']),_0x5e94c7);})[_0x4684('0x27')](function(){return _0x540a6d;});});}})[_0x4684('0x27')](respondWithResult(_0x214965,null))[_0x4684('0x4c')](handleError(_0x214965,null));};exports[_0x4684('0x89')]=function(_0xa16ca,_0x4e1f82,_0x23632f){var _0xf1f406={};var _0x44c266={};var _0x22e0c0;var _0x5bfa8e;return db[_0x4684('0x49')][_0x4684('0x5b')]({'where':{'id':_0xa16ca['params']['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x4e1f82,null))[_0x4684('0x27')](function(_0x25c1a4){if(_0x25c1a4){_0x22e0c0=_0x25c1a4;_0x44c266[_0x4684('0x35')]=_[_0x4684('0x37')](db[_0x4684('0x6c')]['rawAttributes']);_0x44c266[_0x4684('0x36')]=_[_0x4684('0x37')](_0xa16ca['query']);_0x44c266[_0x4684('0x38')]=_[_0x4684('0x39')](_0x44c266['model'],_0x44c266['query']);_0xf1f406[_0x4684('0x3a')]=_[_0x4684('0x39')](_0x44c266['model'],qs[_0x4684('0x3b')](_0xa16ca[_0x4684('0x36')]['fields']));_0xf1f406['attributes']=_0xf1f406[_0x4684('0x3a')][_0x4684('0x3c')]?_0xf1f406['attributes']:_0x44c266[_0x4684('0x35')];_0xf1f406['order']=qs['sort'](_0xa16ca['query'][_0x4684('0x3f')]);_0xf1f406[_0x4684('0x40')]=qs[_0x4684('0x38')](_[_0x4684('0x41')](_0xa16ca[_0x4684('0x36')],_0x44c266[_0x4684('0x38')]));_0xf1f406[_0x4684('0x40')]=_[_0x4684('0x43')](_0xf1f406['where'],{'$or':[{'ListId':_0x25c1a4['id']},{'ListId':null}]});if(_0xa16ca[_0x4684('0x36')][_0x4684('0x42')]){_0xf1f406['where']=_[_0x4684('0x43')](_0xf1f406['where'],{'$or':_[_0x4684('0x31')](_0xf1f406['attributes'],function(_0x5a9b6f){var _0x4e7e2f={};_0x4e7e2f[_0x5a9b6f]={'$like':'%'+_0xa16ca['query']['filter']+'%'};return _0x4e7e2f;})});}_0xf1f406=_[_0x4684('0x43')]({},_0xf1f406,_0xa16ca[_0x4684('0x46')]);return db[_0x4684('0x6c')]['findAndCountAll'](_0xf1f406);}})['then'](respondWithResult(_0x4e1f82,null))[_0x4684('0x4c')](handleError(_0x4e1f82,null));};exports[_0x4684('0x8a')]=function(_0x329afb,_0x15029e,_0x236132){return db[_0x4684('0x49')][_0x4684('0x4f')]({'where':{'id':_0x329afb[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x15029e,null))[_0x4684('0x27')](function(_0x23e396){if(_0x23e396){return _0x23e396['addAgents'](_0x329afb['body'][_0x4684('0x5f')],_[_0x4684('0x66')](_0x329afb[_0x4684('0x58')],['ids','id'])||{})['spread'](function(_0x2599f5){for(var _0x58fff7=0x0;_0x58fff7<_0x329afb[_0x4684('0x58')][_0x4684('0x5f')]['length'];_0x58fff7+=0x1){socket['emit'](_0x4684('0x8b'),{'UserId':Number(_0x329afb['body'][_0x4684('0x5f')][_0x58fff7]),'CmListId':Number(_0x329afb[_0x4684('0x4e')]['id'])});}return _0x2599f5;});}})[_0x4684('0x27')](respondWithResult(_0x15029e,null))[_0x4684('0x4c')](handleError(_0x15029e,null));};exports[_0x4684('0x8c')]=function(_0x1936cd,_0x36a145,_0x4af9e1){return db[_0x4684('0x49')]['find']({'where':{'id':_0x1936cd[_0x4684('0x4e')]['id']}})[_0x4684('0x27')](handleEntityNotFound(_0x36a145,null))[_0x4684('0x27')](function(_0x2c0afe){if(_0x2c0afe){return _0x2c0afe[_0x4684('0x8c')](_0x1936cd[_0x4684('0x36')][_0x4684('0x5f')])[_0x4684('0x27')](function(){if(_[_0x4684('0x63')](_0x1936cd['query'][_0x4684('0x5f')])){for(var _0x58c46c=0x0;_0x58c46c<_0x1936cd[_0x4684('0x36')]['ids'][_0x4684('0x3c')];_0x58c46c+=0x1){socket[_0x4684('0x8d')](_0x4684('0x8e'),{'UserId':Number(_0x1936cd[_0x4684('0x36')][_0x4684('0x5f')][_0x58c46c]),'CmListId':Number(_0x1936cd[_0x4684('0x4e')]['id'])});}}else{socket[_0x4684('0x8d')]('userCmList:remove',{'UserId':Number(_0x1936cd['query']['ids']),'CmListId':Number(_0x1936cd[_0x4684('0x4e')]['id'])});}});}})[_0x4684('0x27')](respondWithStatusCode(_0x36a145,null))[_0x4684('0x4c')](handleError(_0x36a145,null));};exports[_0x4684('0x8f')]=function(_0x323cde,_0x376ad8,_0x18a4da){var _0x1c64f9={};var _0x107664={};var _0x4dba0c;var _0x3044d1;return db[_0x4684('0x49')][_0x4684('0x5b')]({'where':{'id':_0x323cde[_0x4684('0x4e')]['id']}})['then'](handleEntityNotFound(_0x376ad8,null))[_0x4684('0x27')](function(_0x418722){if(_0x418722){_0x4dba0c=_0x418722;_0x107664[_0x4684('0x35')]=_['keys'](db[_0x4684('0x90')]['rawAttributes']);_0x107664['query']=_[_0x4684('0x37')](_0x323cde[_0x4684('0x36')]);_0x107664[_0x4684('0x38')]=_[_0x4684('0x39')](_0x107664[_0x4684('0x35')],_0x107664[_0x4684('0x36')]);_0x1c64f9['attributes']=_['intersection'](_0x107664['model'],qs[_0x4684('0x3b')](_0x323cde[_0x4684('0x36')][_0x4684('0x3b')]));_0x1c64f9['attributes']=_0x1c64f9[_0x4684('0x3a')][_0x4684('0x3c')]?_0x1c64f9[_0x4684('0x3a')]:_0x107664[_0x4684('0x35')];_0x1c64f9[_0x4684('0x5c')]=qs[_0x4684('0x3f')](_0x323cde[_0x4684('0x36')][_0x4684('0x3f')]);_0x1c64f9[_0x4684('0x40')]=qs[_0x4684('0x38')](_['pick'](_0x323cde[_0x4684('0x36')],_0x107664[_0x4684('0x38')]));if(_0x323cde['query'][_0x4684('0x42')]){_0x1c64f9[_0x4684('0x40')]=_[_0x4684('0x43')](_0x1c64f9[_0x4684('0x40')],{'$or':_[_0x4684('0x31')](_0x1c64f9[_0x4684('0x3a')],function(_0x2857ac){var _0x57db92={};_0x57db92[_0x2857ac]={'$like':'%'+_0x323cde[_0x4684('0x36')][_0x4684('0x42')]+'%'};return _0x57db92;})});}_0x1c64f9=_['merge']({},_0x1c64f9,_0x323cde[_0x4684('0x46')]);return _0x4dba0c['getAgents'](_0x1c64f9);}})[_0x4684('0x27')](function(_0x4d46d3){if(_0x4d46d3){_0x3044d1=_0x4d46d3['length'];if(!_0x323cde[_0x4684('0x36')][_0x4684('0x3d')](_0x4684('0x3e'))){_0x1c64f9['limit']=qs[_0x4684('0x21')](_0x323cde[_0x4684('0x36')]['limit']);_0x1c64f9[_0x4684('0x1f')]=qs[_0x4684('0x1f')](_0x323cde['query']['offset']);}return _0x4dba0c['getAgents'](_0x1c64f9);}})[_0x4684('0x27')](function(_0x1f5b29){if(_0x1f5b29){return _0x1f5b29?{'count':_0x3044d1,'rows':_0x1f5b29}:null;}})[_0x4684('0x27')](respondWithResult(_0x376ad8,null))[_0x4684('0x4c')](handleError(_0x376ad8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 0130db6..9d67fb1 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x326f,0xd1));var _0xf326=function(_0x4473ab,_0xc6a91){_0x4473ab=_0x4473ab-0x0;var _0x5b73cd=_0x326f[_0x4473ab];return _0x5b73cd;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x158ad4,_0x512023){_0x158ad4=_0x158ad4-0x0;var _0x5d7d78=_0xe14b[_0x158ad4];return _0x5d7d78;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9f9dddc..15c1018 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 _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0x1be1,0x192));var _0x11be=function(_0x5220b5,_0x5ee6ba){_0x5220b5=_0x5220b5-0x0;var _0xf2343e=_0x1be1[_0x5220b5];return _0xf2343e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./cmList.attributes','exports','define','cm_lists','lodash','bluebird','rimraf','../../config/environment'];(function(_0x4788ca,_0x5cda70){var _0x28a6f5=function(_0xa6db8){while(--_0xa6db8){_0x4788ca['push'](_0x4788ca['shift']());}};_0x28a6f5(++_0x5cda70);}(_0xf4eb,0xec));var _0xbf4e=function(_0x45ebc8,_0x4e8010){_0x45ebc8=_0x45ebc8-0x0;var _0xdb9571=_0xf4eb[_0x45ebc8];return _0xdb9571;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('CmList',attributes,{'tableName':_0xbf4e('0x7'),'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 ccc4ef6..bfbd370 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 _0xcf9e=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3090e5,_0x47b68b){var _0x4658c8=function(_0x464d8b){while(--_0x464d8b){_0x3090e5['push'](_0x3090e5['shift']());}};_0x4658c8(++_0x47b68b);}(_0xcf9e,0xe1));var _0xecf9=function(_0x4766b5,_0x27775d){_0x4766b5=_0x4766b5-0x0;var _0x4a6245=_0xcf9e[_0x4766b5];return _0x4a6245;};'use strict';var _=require(_0xecf9('0x0'));var util=require(_0xecf9('0x1'));var moment=require(_0xecf9('0x2'));var BPromise=require(_0xecf9('0x3'));var rs=require(_0xecf9('0x4'));var fs=require('fs');var Redis=require(_0xecf9('0x5'));var db=require(_0xecf9('0x6'))['db'];var utils=require(_0xecf9('0x7'));var logger=require(_0xecf9('0x8'))(_0xecf9('0x9'));var config=require(_0xecf9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xecf9('0xb')][_0xecf9('0xc')]({'port':0x232a});config[_0xecf9('0xd')]=_[_0xecf9('0xe')](config[_0xecf9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xecf9('0xf'))(new Redis(config[_0xecf9('0xd')]));require('./cmList.socket')[_0xecf9('0x10')](socket);function respondWithRpcPromise(_0x3ac4aa,_0x10cf2e,_0x3338ce){return new BPromise(function(_0x2406b5,_0x5dbfca){return client[_0xecf9('0x11')](_0x3ac4aa,_0x3338ce)[_0xecf9('0x12')](function(_0x1a8f57){logger['info'](_0xecf9('0x13'),_0x10cf2e,_0xecf9('0x14'));logger[_0xecf9('0x15')](_0xecf9('0x16'),_0x10cf2e,_0xecf9('0x14'),JSON['stringify'](_0x1a8f57));if(_0x1a8f57['error']){if(_0x1a8f57[_0xecf9('0x17')][_0xecf9('0x18')]===0x1f4){logger[_0xecf9('0x17')](_0xecf9('0x13'),_0x10cf2e,_0x1a8f57[_0xecf9('0x17')][_0xecf9('0x19')]);return _0x5dbfca(_0x1a8f57[_0xecf9('0x17')][_0xecf9('0x19')]);}logger[_0xecf9('0x17')](_0xecf9('0x13'),_0x10cf2e,_0x1a8f57[_0xecf9('0x17')][_0xecf9('0x19')]);return _0x2406b5(_0x1a8f57[_0xecf9('0x17')][_0xecf9('0x19')]);}else{logger[_0xecf9('0x1a')](_0xecf9('0x13'),_0x10cf2e,_0xecf9('0x14'));_0x2406b5(_0x1a8f57[_0xecf9('0x1b')][_0xecf9('0x19')]);}})['catch'](function(_0x5af63d){logger[_0xecf9('0x17')](_0xecf9('0x13'),_0x10cf2e,_0x5af63d);_0x5dbfca(_0x5af63d);});});} \ No newline at end of file +var _0xd807=['CmList,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','./cmList.socket','register','then','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xd807,0xdb));var _0x7d80=function(_0x3f8f9b,_0x43caea){_0x3f8f9b=_0x3f8f9b-0x0;var _0x6f52f5=_0xd807[_0x3f8f9b];return _0x6f52f5;};'use strict';var _=require(_0x7d80('0x0'));var util=require(_0x7d80('0x1'));var moment=require('moment');var BPromise=require(_0x7d80('0x2'));var rs=require(_0x7d80('0x3'));var fs=require('fs');var Redis=require(_0x7d80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d80('0x5'));var logger=require(_0x7d80('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d80('0x7'));var client=jayson[_0x7d80('0x8')]['http']({'port':0x232a});config[_0x7d80('0x9')]=_[_0x7d80('0xa')](config[_0x7d80('0x9')],{'host':_0x7d80('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d80('0x9')]));require(_0x7d80('0xc'))[_0x7d80('0xd')](socket);function respondWithRpcPromise(_0x234aba,_0x1bd78d,_0x38003e){return new BPromise(function(_0x47c37f,_0x4e054d){return client['request'](_0x234aba,_0x38003e)[_0x7d80('0xe')](function(_0x27b085){logger['info']('CmList,\x20%s,\x20%s',_0x1bd78d,'request\x20sent');logger[_0x7d80('0xf')](_0x7d80('0x10'),_0x1bd78d,_0x7d80('0x11'),JSON[_0x7d80('0x12')](_0x27b085));if(_0x27b085[_0x7d80('0x13')]){if(_0x27b085[_0x7d80('0x13')][_0x7d80('0x14')]===0x1f4){logger[_0x7d80('0x13')](_0x7d80('0x15'),_0x1bd78d,_0x27b085[_0x7d80('0x13')]['message']);return _0x4e054d(_0x27b085['error'][_0x7d80('0x16')]);}logger[_0x7d80('0x13')](_0x7d80('0x15'),_0x1bd78d,_0x27b085['error'][_0x7d80('0x16')]);return _0x47c37f(_0x27b085['error'][_0x7d80('0x16')]);}else{logger['info'](_0x7d80('0x15'),_0x1bd78d,_0x7d80('0x11'));_0x47c37f(_0x27b085['result'][_0x7d80('0x16')]);}})[_0x7d80('0x17')](function(_0x5e6d1c){logger[_0x7d80('0x13')](_0x7d80('0x15'),_0x1bd78d,_0x5e6d1c);_0x4e054d(_0x5e6d1c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 8ce97ee..34d6ad3 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 _0xcfbf=['save','remove','update','emit','removeListener','length','cmList:'];(function(_0x2fb1bc,_0xc002d4){var _0x4bcc47=function(_0x5121c4){while(--_0x5121c4){_0x2fb1bc['push'](_0x2fb1bc['shift']());}};_0x4bcc47(++_0xc002d4);}(_0xcfbf,0x1f1));var _0xfcfb=function(_0x73ac10,_0x53e2c0){_0x73ac10=_0x73ac10-0x0;var _0x195b45=_0xcfbf[_0x73ac10];return _0x195b45;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xfcfb('0x0'),_0xfcfb('0x1'),_0xfcfb('0x2')];function createListener(_0x7df76c,_0x14ed7b){return function(_0x28b39e){_0x14ed7b[_0xfcfb('0x3')](_0x7df76c,_0x28b39e);};}function removeListener(_0x1ce038,_0x4c56ff){return function(){CmListEvents[_0xfcfb('0x4')](_0x1ce038,_0x4c56ff);};}exports['register']=function(_0x5ee535){for(var _0x3902f9=0x0,_0x311d4d=events[_0xfcfb('0x5')];_0x3902f9<_0x311d4d;_0x3902f9++){var _0x5106e9=events[_0x3902f9];var _0x108689=createListener(_0xfcfb('0x6')+_0x5106e9,_0x5ee535);CmListEvents['on'](_0x5106e9,_0x108689);}}; \ No newline at end of file +var _0x8477=['removeListener','register','length','cmList:','./cmList.events','save','update'];(function(_0x13251e,_0x4b9eac){var _0x3fa9d6=function(_0x541721){while(--_0x541721){_0x13251e['push'](_0x13251e['shift']());}};_0x3fa9d6(++_0x4b9eac);}(_0x8477,0x1e0));var _0x7847=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x8477[_0x53fe97];return _0x5c49a2;};'use strict';var CmListEvents=require(_0x7847('0x0'));var events=[_0x7847('0x1'),'remove',_0x7847('0x2')];function createListener(_0x5e5910,_0x171f33){return function(_0x3584b2){_0x171f33['emit'](_0x5e5910,_0x3584b2);};}function removeListener(_0x5b8e2d,_0x49f7fa){return function(){CmListEvents[_0x7847('0x3')](_0x5b8e2d,_0x49f7fa);};}exports[_0x7847('0x4')]=function(_0x204595){for(var _0x5a35c6=0x0,_0x1c8144=events[_0x7847('0x5')];_0x5a35c6<_0x1c8144;_0x5a35c6++){var _0x4959e9=events[_0x5a35c6];var _0x4f2424=createListener(_0x7847('0x6')+_0x4959e9,_0x204595);CmListEvents['on'](_0x4959e9,_0x4f2424);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 82ed10d..c070995 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 _0xad11=['../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addAgents','put','update','delete','destroy','/:id/dispositions','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x81b6c5,_0x261ca0){var _0x5603a3=function(_0x4c855e){while(--_0x4c855e){_0x81b6c5['push'](_0x81b6c5['shift']());}};_0x5603a3(++_0x261ca0);}(_0xad11,0x19d));var _0x1ad1=function(_0x34078e,_0x2705fe){_0x34078e=_0x34078e-0x0;var _0x427bdf=_0xad11[_0x34078e];return _0x427bdf;};'use strict';var multer=require(_0x1ad1('0x0'));var util=require(_0x1ad1('0x1'));var path=require(_0x1ad1('0x2'));var timeout=require(_0x1ad1('0x3'));var express=require(_0x1ad1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ad1('0x5'));var interaction=require(_0x1ad1('0x6'));var config=require(_0x1ad1('0x7'));var controller=require(_0x1ad1('0x8'));router[_0x1ad1('0x9')]('/',auth[_0x1ad1('0xa')](),controller[_0x1ad1('0xb')]);router[_0x1ad1('0x9')]('/describe',auth[_0x1ad1('0xa')](),controller[_0x1ad1('0xc')]);router['get'](_0x1ad1('0xd'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0xe')]);router[_0x1ad1('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1ad1('0xf')]);router[_0x1ad1('0x9')]('/:id/contacts',auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x10')]);router['get'](_0x1ad1('0x11'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x12')]);router[_0x1ad1('0x9')](_0x1ad1('0x13'),auth['isAuthenticated'](),controller[_0x1ad1('0x14')]);router[_0x1ad1('0x9')](_0x1ad1('0x15'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x16')]);router[_0x1ad1('0x17')]('/',auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x18')]);router[_0x1ad1('0x17')]('/:id/dispositions',auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x19')]);router[_0x1ad1('0x17')](_0x1ad1('0x1a'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x1b')]);router[_0x1ad1('0x17')](_0x1ad1('0x13'),auth[_0x1ad1('0xa')](),controller['addCustomField']);router[_0x1ad1('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x1ad1('0x1c')]);router[_0x1ad1('0x1d')](_0x1ad1('0xd'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x1e')]);router[_0x1ad1('0x1f')](_0x1ad1('0xd'),auth[_0x1ad1('0xa')](),controller[_0x1ad1('0x20')]);router[_0x1ad1('0x1f')](_0x1ad1('0x21'),auth[_0x1ad1('0xa')](),controller['removeDispositions']);router['delete'](_0x1ad1('0x15'),auth[_0x1ad1('0xa')](),controller['removeAgents']);module[_0x1ad1('0x22')]=router; \ No newline at end of file +var _0x0502=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getAgents','addDisposition','post','/:id/users','addAgents','put','/:id','delete','removeDispositions','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0502,0x99));var _0x2050=function(_0x16f497,_0x268936){_0x16f497=_0x16f497-0x0;var _0x574894=_0x0502[_0x16f497];return _0x574894;};'use strict';var multer=require(_0x2050('0x0'));var util=require(_0x2050('0x1'));var path=require(_0x2050('0x2'));var timeout=require(_0x2050('0x3'));var express=require(_0x2050('0x4'));var router=express[_0x2050('0x5')]();var fs_extra=require(_0x2050('0x6'));var auth=require(_0x2050('0x7'));var interaction=require(_0x2050('0x8'));var config=require(_0x2050('0x9'));var controller=require(_0x2050('0xa'));router[_0x2050('0xb')]('/',auth[_0x2050('0xc')](),controller[_0x2050('0xd')]);router['get'](_0x2050('0xe'),auth[_0x2050('0xc')](),controller[_0x2050('0xf')]);router[_0x2050('0xb')]('/:id',auth[_0x2050('0xc')](),controller[_0x2050('0x10')]);router[_0x2050('0xb')](_0x2050('0x11'),auth[_0x2050('0xc')](),controller[_0x2050('0x12')]);router[_0x2050('0xb')](_0x2050('0x13'),auth[_0x2050('0xc')](),controller[_0x2050('0x14')]);router['get'](_0x2050('0x15'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x2050('0xb')](_0x2050('0x16'),auth['isAuthenticated'](),controller['getCustomFields']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x2050('0x17')]);router['post']('/',auth[_0x2050('0xc')](),controller['create']);router['post'](_0x2050('0x11'),auth[_0x2050('0xc')](),controller[_0x2050('0x18')]);router[_0x2050('0x19')](_0x2050('0x13'),auth[_0x2050('0xc')](),controller['addContacts']);router['post'](_0x2050('0x16'),auth[_0x2050('0xc')](),controller['addCustomField']);router[_0x2050('0x19')](_0x2050('0x1a'),auth[_0x2050('0xc')](),controller[_0x2050('0x1b')]);router[_0x2050('0x1c')](_0x2050('0x1d'),auth[_0x2050('0xc')](),controller['update']);router[_0x2050('0x1e')](_0x2050('0x1d'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x2050('0x11'),auth[_0x2050('0xc')](),controller[_0x2050('0x1f')]);router[_0x2050('0x1e')](_0x2050('0x1a'),auth[_0x2050('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 43db0d5..ea89657 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 _0xe021=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0xe021,0xd0));var _0x1e02=function(_0x1d0554,_0x1a3f7a){_0x1d0554=_0x1d0554-0x0;var _0x5e1920=_0xe021[_0x1d0554];return _0x5e1920;};'use strict';var Sequelize=require('sequelize');module[_0x1e02('0x0')]={'name':{'type':Sequelize[_0x1e02('0x1')],'get':function(_0x1d3c7b){return this[_0x1e02('0x2')](_0x1e02('0x3'));}},'field':{'type':Sequelize[_0x1e02('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1e02('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x6f78=['getDataValue','field','STRING','exports'];(function(_0x4c8f61,_0x503655){var _0x3c56e3=function(_0x34d665){while(--_0x34d665){_0x4c8f61['push'](_0x4c8f61['shift']());}};_0x3c56e3(++_0x503655);}(_0x6f78,0xfb));var _0x86f7=function(_0xfbe56a,_0x468e7e){_0xfbe56a=_0xfbe56a-0x0;var _0x926e24=_0x6f78[_0xfbe56a];return _0x926e24;};'use strict';var Sequelize=require('sequelize');module[_0x86f7('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a4a00){return this[_0x86f7('0x1')](_0x86f7('0x2'));}},'field':{'type':Sequelize[_0x86f7('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x86f7('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x86f7('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index ccb1ef1..71fa32e 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x17fdfd,_0x3904c0){var _0x4720be=function(_0x514524){while(--_0x514524){_0x17fdfd['push'](_0x17fdfd['shift']());}};_0x4720be(++_0x3904c0);}(_0x7a54,0x106));var _0x47a5=function(_0x1acb5f,_0x106da3){_0x1acb5f=_0x1acb5f-0x0;var _0x4249cc=_0x7a54[_0x1acb5f];return _0x4249cc;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +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(_0x5ed9ff,_0x5d4e2c){var _0x5bd410=function(_0x103177){while(--_0x103177){_0x5ed9ff['push'](_0x5ed9ff['shift']());}};_0x5bd410(++_0x5d4e2c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e273e2e..1c403c0 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 _0xaf63=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x1f89b9,_0x34218d){var _0x5b24d2=function(_0x293a40){while(--_0x293a40){_0x1f89b9['push'](_0x1f89b9['shift']());}};_0x5b24d2(++_0x34218d);}(_0xaf63,0x1ec));var _0x3af6=function(_0x4db0b9,_0x1a5301){_0x4db0b9=_0x4db0b9-0x0;var _0x132177=_0xaf63[_0x4db0b9];return _0x132177;};'use strict';var _=require(_0x3af6('0x0'));var util=require(_0x3af6('0x1'));var logger=require(_0x3af6('0x2'))('api');var moment=require(_0x3af6('0x3'));var BPromise=require(_0x3af6('0x4'));var rp=require(_0x3af6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3af6('0x6'));var config=require(_0x3af6('0x7'));var attributes=require(_0x3af6('0x8'));module[_0x3af6('0x9')]=function(_0x210a96,_0x1be422){return _0x210a96[_0x3af6('0xa')](_0x3af6('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe57b=['define','Condition','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x52b991,_0x52358f){var _0x3a1409=function(_0x2e2dfd){while(--_0x2e2dfd){_0x52b991['push'](_0x52b991['shift']());}};_0x3a1409(++_0x52358f);}(_0xe57b,0x1f1));var _0xbe57=function(_0x483d2b,_0x330d68){_0x483d2b=_0x483d2b-0x0;var _0x54912c=_0xe57b[_0x483d2b];return _0x54912c;};'use strict';var _=require('lodash');var util=require(_0xbe57('0x0'));var logger=require(_0xbe57('0x1'))(_0xbe57('0x2'));var moment=require(_0xbe57('0x3'));var BPromise=require(_0xbe57('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe57('0x5'));var rimraf=require(_0xbe57('0x6'));var config=require(_0xbe57('0x7'));var attributes=require('./condition.attributes');module[_0xbe57('0x8')]=function(_0x1bb74b,_0x202866){return _0x1bb74b[_0xbe57('0x9')](_0xbe57('0xa'),attributes,{'tableName':'tools_conditions','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 8b2d400..c106f75 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 _0xefea=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x7de33e,_0x46a873){var _0x9b0f8=function(_0x264f7f){while(--_0x264f7f){_0x7de33e['push'](_0x7de33e['shift']());}};_0x9b0f8(++_0x46a873);}(_0xefea,0x121));var _0xaefe=function(_0x2e748f,_0x26f01e){_0x2e748f=_0x2e748f-0x0;var _0x200c30=_0xefea[_0x2e748f];return _0x200c30;};'use strict';var _=require(_0xaefe('0x0'));var util=require(_0xaefe('0x1'));var moment=require('moment');var BPromise=require(_0xaefe('0x2'));var rs=require(_0xaefe('0x3'));var fs=require('fs');var Redis=require(_0xaefe('0x4'));var db=require(_0xaefe('0x5'))['db'];var utils=require(_0xaefe('0x6'));var logger=require(_0xaefe('0x7'))('rpc');var config=require(_0xaefe('0x8'));var jayson=require(_0xaefe('0x9'));var client=jayson[_0xaefe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41891d,_0x4b841f,_0x5dbd89){return new BPromise(function(_0x15bd71,_0xea58b6){return client[_0xaefe('0xb')](_0x41891d,_0x5dbd89)[_0xaefe('0xc')](function(_0x530eef){logger[_0xaefe('0xd')](_0xaefe('0xe'),_0x4b841f,_0xaefe('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x4b841f,_0xaefe('0xf'),JSON[_0xaefe('0x10')](_0x530eef));if(_0x530eef[_0xaefe('0x11')]){if(_0x530eef[_0xaefe('0x11')][_0xaefe('0x12')]===0x1f4){logger[_0xaefe('0x11')](_0xaefe('0xe'),_0x4b841f,_0x530eef['error'][_0xaefe('0x13')]);return _0xea58b6(_0x530eef[_0xaefe('0x11')][_0xaefe('0x13')]);}logger['error'](_0xaefe('0xe'),_0x4b841f,_0x530eef[_0xaefe('0x11')][_0xaefe('0x13')]);return _0x15bd71(_0x530eef[_0xaefe('0x11')]['message']);}else{logger[_0xaefe('0xd')](_0xaefe('0xe'),_0x4b841f,'request\x20sent');_0x15bd71(_0x530eef['result'][_0xaefe('0x13')]);}})[_0xaefe('0x14')](function(_0x2ef0b9){logger['error'](_0xaefe('0xe'),_0x4b841f,_0x2ef0b9);_0xea58b6(_0x2ef0b9);});});} \ No newline at end of file +var _0x3b84=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0xd0f42d,_0x5beaab){var _0x26534c=function(_0x281ccb){while(--_0x281ccb){_0xd0f42d['push'](_0xd0f42d['shift']());}};_0x26534c(++_0x5beaab);}(_0x3b84,0xd7));var _0x43b8=function(_0x37772a,_0x28ae00){_0x37772a=_0x37772a-0x0;var _0x66df01=_0x3b84[_0x37772a];return _0x66df01;};'use strict';var _=require(_0x43b8('0x0'));var util=require('util');var moment=require(_0x43b8('0x1'));var BPromise=require('bluebird');var rs=require(_0x43b8('0x2'));var fs=require('fs');var Redis=require(_0x43b8('0x3'));var db=require(_0x43b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43b8('0x5'))(_0x43b8('0x6'));var config=require(_0x43b8('0x7'));var jayson=require(_0x43b8('0x8'));var client=jayson[_0x43b8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2895ab,_0x481cea,_0x5b5544){return new BPromise(function(_0x18e109,_0x492e11){return client['request'](_0x2895ab,_0x5b5544)['then'](function(_0x287049){logger[_0x43b8('0xa')](_0x43b8('0xb'),_0x481cea,_0x43b8('0xc'));logger[_0x43b8('0xd')](_0x43b8('0xe'),_0x481cea,'request\x20sent',JSON[_0x43b8('0xf')](_0x287049));if(_0x287049[_0x43b8('0x10')]){if(_0x287049['error']['code']===0x1f4){logger[_0x43b8('0x10')](_0x43b8('0xb'),_0x481cea,_0x287049['error'][_0x43b8('0x11')]);return _0x492e11(_0x287049[_0x43b8('0x10')][_0x43b8('0x11')]);}logger[_0x43b8('0x10')]('Condition,\x20%s,\x20%s',_0x481cea,_0x287049[_0x43b8('0x10')][_0x43b8('0x11')]);return _0x18e109(_0x287049[_0x43b8('0x10')][_0x43b8('0x11')]);}else{logger['info'](_0x43b8('0xb'),_0x481cea,_0x43b8('0xc'));_0x18e109(_0x287049['result'][_0x43b8('0x11')]);}})['catch'](function(_0x4e7949){logger[_0x43b8('0x10')](_0x43b8('0xb'),_0x481cea,_0x4e7949);_0x492e11(_0x4e7949);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 14207db..69d33c4 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 _0xbc25=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated','delete'];(function(_0x14e1c9,_0x3cc226){var _0x3db48a=function(_0x164657){while(--_0x164657){_0x14e1c9['push'](_0x14e1c9['shift']());}};_0x3db48a(++_0x3cc226);}(_0xbc25,0x1ee));var _0x5bc2=function(_0x388899,_0x17f370){_0x388899=_0x388899-0x0;var _0x3be17d=_0xbc25[_0x388899];return _0x3be17d;};'use strict';var multer=require('multer');var util=require(_0x5bc2('0x0'));var path=require(_0x5bc2('0x1'));var timeout=require(_0x5bc2('0x2'));var express=require(_0x5bc2('0x3'));var router=express[_0x5bc2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5bc2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5bc2('0x6'));var controller=require('./condition.controller');router['put'](_0x5bc2('0x7'),auth[_0x5bc2('0x8')](),controller['update']);router[_0x5bc2('0x9')](_0x5bc2('0x7'),auth[_0x5bc2('0x8')](),controller[_0x5bc2('0xa')]);module[_0x5bc2('0xb')]=router; \ No newline at end of file +var _0x8c17=['isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0x8c17,0xd7));var _0x78c1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8c17[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x78c1('0x0'));var timeout=require(_0x78c1('0x1'));var express=require(_0x78c1('0x2'));var router=express[_0x78c1('0x3')]();var fs_extra=require(_0x78c1('0x4'));var auth=require(_0x78c1('0x5'));var interaction=require(_0x78c1('0x6'));var config=require(_0x78c1('0x7'));var controller=require(_0x78c1('0x8'));router[_0x78c1('0x9')]('/:id',auth[_0x78c1('0xa')](),controller[_0x78c1('0xb')]);router[_0x78c1('0xc')]('/:id',auth[_0x78c1('0xa')](),controller[_0x78c1('0xd')]);module[_0x78c1('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 6d479e8..31ec217 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 _0x2032=['name','exports','STRING'];(function(_0x5b0be5,_0x332da3){var _0x29c0ab=function(_0x494c1f){while(--_0x494c1f){_0x5b0be5['push'](_0x5b0be5['shift']());}};_0x29c0ab(++_0x332da3);}(_0x2032,0xd9));var _0x2203=function(_0x2f1afd,_0x3945f1){_0x2f1afd=_0x2f1afd-0x0;var _0x5da5bc=_0x2032[_0x2f1afd];return _0x5da5bc;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x144077,_0xd74a48){var _0x584b57=function(_0x1f71bc){while(--_0x1f71bc){_0x144077['push'](_0x144077['shift']());}};_0x584b57(++_0xd74a48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a1e8fdc..1aeb02b 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 _0x9ca7=['CustomDashboards','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','createdAt','user','userProfileId','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','DashboardItem','nolimit','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','get','sendStatus','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','params','length','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x4c1195,_0x2022ec){var _0xcabe5f=function(_0x9d0ac){while(--_0x9d0ac){_0x4c1195['push'](_0x4c1195['shift']());}};_0xcabe5f(++_0x2022ec);}(_0x9ca7,0x1bf));var _0x79ca=function(_0x14e852,_0x324fd3){_0x14e852=_0x14e852-0x0;var _0x22c428=_0x9ca7[_0x14e852];return _0x22c428;};'use strict';var emlformat=require(_0x79ca('0x0'));var rimraf=require(_0x79ca('0x1'));var zipdir=require(_0x79ca('0x2'));var jsonpatch=require(_0x79ca('0x3'));var rp=require(_0x79ca('0x4'));var moment=require(_0x79ca('0x5'));var BPromise=require(_0x79ca('0x6'));var Mustache=require(_0x79ca('0x7'));var util=require(_0x79ca('0x8'));var path=require(_0x79ca('0x9'));var sox=require(_0x79ca('0xa'));var csv=require(_0x79ca('0xb'));var ejs=require(_0x79ca('0xc'));var fs=require('fs');var fs_extra=require(_0x79ca('0xd'));var _=require(_0x79ca('0xe'));var squel=require('squel');var crypto=require(_0x79ca('0xf'));var jsforce=require(_0x79ca('0x10'));var deskjs=require(_0x79ca('0x11'));var toCsv=require(_0x79ca('0xb'));var querystring=require(_0x79ca('0x12'));var Papa=require(_0x79ca('0x13'));var Redis=require(_0x79ca('0x14'));var authService=require(_0x79ca('0x15'));var qs=require(_0x79ca('0x16'));var as=require(_0x79ca('0x17'));var hardwareService=require(_0x79ca('0x18'));var logger=require('../../config/logger')(_0x79ca('0x19'));var utils=require(_0x79ca('0x1a'));var config=require(_0x79ca('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x79ca('0x1c'))['db'];config[_0x79ca('0x1d')]=_[_0x79ca('0x1e')](config[_0x79ca('0x1d')],{'host':_0x79ca('0x1f'),'port':0x18eb});var socket=require(_0x79ca('0x20'))(new Redis(config[_0x79ca('0x1d')]));require(_0x79ca('0x21'))[_0x79ca('0x22')](socket);function respondWithStatusCode(_0x2b5534,_0x70c391){_0x70c391=_0x70c391||0xcc;return function(_0x45af29){if(_0x45af29){return _0x2b5534['sendStatus'](_0x70c391);}return _0x2b5534[_0x79ca('0x23')](_0x70c391)[_0x79ca('0x24')]();};}function respondWithResult(_0x34688b,_0x1b1c0e){_0x1b1c0e=_0x1b1c0e||0xc8;return function(_0x273522){if(_0x273522){return _0x34688b[_0x79ca('0x23')](_0x1b1c0e)[_0x79ca('0x25')](_0x273522);}};}function respondWithFilteredResult(_0x451a67,_0x40b609){return function(_0x41ae63){if(_0x41ae63){var _0xb0f79c=typeof _0x40b609['offset']===_0x79ca('0x26')&&typeof _0x40b609[_0x79ca('0x27')]===_0x79ca('0x26');var _0x2881a1=_0x41ae63[_0x79ca('0x28')];var _0x1f765f=_0xb0f79c?0x0:_0x40b609[_0x79ca('0x29')];var _0x566e6c=_0xb0f79c?_0x41ae63[_0x79ca('0x28')]:_0x40b609[_0x79ca('0x29')]+_0x40b609['limit'];var _0x44dc51;if(_0x566e6c>=_0x2881a1){_0x566e6c=_0x2881a1;_0x44dc51=0xc8;}else{_0x44dc51=0xce;}_0x451a67[_0x79ca('0x23')](_0x44dc51);return _0x451a67[_0x79ca('0x2a')](_0x79ca('0x2b'),_0x1f765f+'-'+_0x566e6c+'/'+_0x2881a1)['json'](_0x41ae63);}return null;};}function patchUpdates(_0x3925e5){return function(_0x55901a){try{jsonpatch['apply'](_0x55901a,_0x3925e5,!![]);}catch(_0x147b04){return BPromise['reject'](_0x147b04);}return _0x55901a[_0x79ca('0x2c')]();};}function saveUpdates(_0x24fcea,_0x480c59){return function(_0x38f413){if(_0x38f413){return _0x38f413['update'](_0x24fcea)[_0x79ca('0x2d')](function(_0x2cfd64){return _0x2cfd64;});}return null;};}function removeEntity(_0x21d749,_0x314523){return function(_0x4d9ae6){if(_0x4d9ae6){return _0x4d9ae6[_0x79ca('0x2e')]()[_0x79ca('0x2d')](function(){var _0x5e0e41=_0x4d9ae6[_0x79ca('0x2f')]({'plain':!![]});var _0x2e21e0='CustomDashboards';return db['UserProfileResource'][_0x79ca('0x2e')]({'where':{'type':_0x2e21e0,'resourceId':_0x5e0e41['id']}})[_0x79ca('0x2d')](function(){return _0x4d9ae6;});})[_0x79ca('0x2d')](function(){_0x21d749['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c8574,_0x59bc66){return function(_0x4779fe){if(!_0x4779fe){_0x4c8574[_0x79ca('0x30')](0x194);}return _0x4779fe;};}function handleError(_0x132eb1,_0x18028b){_0x18028b=_0x18028b||0x1f4;return function(_0x5dc7b5){logger['error'](_0x5dc7b5[_0x79ca('0x31')]);if(_0x5dc7b5['name']){delete _0x5dc7b5[_0x79ca('0x32')];}_0x132eb1[_0x79ca('0x23')](_0x18028b)[_0x79ca('0x33')](_0x5dc7b5);};}exports[_0x79ca('0x34')]=function(_0x36a4bc,_0xbd9920){var _0x4c456f={},_0x16c2eb={},_0x3aee32={'count':0x0,'rows':[]};var _0x4d41bc=_['map'](db[_0x79ca('0x35')][_0x79ca('0x36')],function(_0x188279){return{'name':_0x188279[_0x79ca('0x37')],'type':_0x188279[_0x79ca('0x38')][_0x79ca('0x39')]};});_0x16c2eb[_0x79ca('0x3a')]=_[_0x79ca('0x3b')](_0x4d41bc,'name');_0x16c2eb[_0x79ca('0x3c')]=_[_0x79ca('0x3d')](_0x36a4bc[_0x79ca('0x3c')]);_0x16c2eb[_0x79ca('0x3e')]=_[_0x79ca('0x3f')](_0x16c2eb[_0x79ca('0x3a')],_0x16c2eb[_0x79ca('0x3c')]);_0x4c456f['attributes']=_[_0x79ca('0x3f')](_0x16c2eb[_0x79ca('0x3a')],qs[_0x79ca('0x40')](_0x36a4bc['query']['fields']));_0x4c456f[_0x79ca('0x41')]=_0x4c456f[_0x79ca('0x41')]['length']?_0x4c456f['attributes']:_0x16c2eb['model'];if(!_0x36a4bc[_0x79ca('0x3c')][_0x79ca('0x42')]('nolimit')){_0x4c456f[_0x79ca('0x27')]=qs[_0x79ca('0x27')](_0x36a4bc[_0x79ca('0x3c')][_0x79ca('0x27')]);_0x4c456f[_0x79ca('0x29')]=qs[_0x79ca('0x29')](_0x36a4bc['query'][_0x79ca('0x29')]);}_0x4c456f[_0x79ca('0x43')]=qs[_0x79ca('0x44')](_0x36a4bc[_0x79ca('0x3c')][_0x79ca('0x44')]);_0x4c456f[_0x79ca('0x45')]=qs['filters'](_[_0x79ca('0x46')](_0x36a4bc[_0x79ca('0x3c')],_0x16c2eb[_0x79ca('0x3e')]),_0x4d41bc);if(_0x36a4bc['query'][_0x79ca('0x47')]){_0x4c456f[_0x79ca('0x45')]=_[_0x79ca('0x48')](_0x4c456f['where'],{'$or':_[_0x79ca('0x3b')](_0x4d41bc,function(_0x2bbf88){if(_0x2bbf88[_0x79ca('0x38')]!=='VIRTUAL'){var _0x464e8b={};_0x464e8b[_0x2bbf88[_0x79ca('0x32')]]={'$like':'%'+_0x36a4bc[_0x79ca('0x3c')][_0x79ca('0x47')]+'%'};return _0x464e8b;}})});}_0x4c456f=_[_0x79ca('0x48')]({},_0x4c456f,_0x36a4bc['options']);var _0x83863d={'where':_0x4c456f['where']};return db[_0x79ca('0x35')]['count'](_0x83863d)[_0x79ca('0x2d')](function(_0x26a781){_0x3aee32[_0x79ca('0x28')]=_0x26a781;if(_0x36a4bc[_0x79ca('0x3c')]['includeAll']){_0x4c456f[_0x79ca('0x49')]=[{'all':!![]}];}return db[_0x79ca('0x35')][_0x79ca('0x4a')](_0x4c456f);})[_0x79ca('0x2d')](function(_0x1091fb){_0x3aee32[_0x79ca('0x4b')]=_0x1091fb;return _0x3aee32;})[_0x79ca('0x2d')](respondWithFilteredResult(_0xbd9920,_0x4c456f))[_0x79ca('0x4c')](handleError(_0xbd9920,null));};exports['show']=function(_0x30891b,_0x3e7b60){var _0x20366d={'raw':![],'where':{'id':_0x30891b[_0x79ca('0x4d')]['id']}},_0x2d967={};_0x2d967[_0x79ca('0x3a')]=_[_0x79ca('0x3d')](db['Dashboard'][_0x79ca('0x36')]);_0x2d967[_0x79ca('0x3c')]=_[_0x79ca('0x3d')](_0x30891b['query']);_0x2d967['filters']=_[_0x79ca('0x3f')](_0x2d967[_0x79ca('0x3a')],_0x2d967['query']);_0x20366d[_0x79ca('0x41')]=_[_0x79ca('0x3f')](_0x2d967[_0x79ca('0x3a')],qs[_0x79ca('0x40')](_0x30891b[_0x79ca('0x3c')][_0x79ca('0x40')]));_0x20366d['attributes']=_0x20366d[_0x79ca('0x41')][_0x79ca('0x4e')]?_0x20366d['attributes']:_0x2d967[_0x79ca('0x3a')];if(_0x30891b[_0x79ca('0x3c')][_0x79ca('0x4f')]){_0x20366d[_0x79ca('0x49')]=[{'all':!![]}];}_0x20366d=_[_0x79ca('0x48')]({},_0x20366d,_0x30891b[_0x79ca('0x50')]);return db[_0x79ca('0x35')]['find'](_0x20366d)[_0x79ca('0x2d')](handleEntityNotFound(_0x3e7b60,null))[_0x79ca('0x2d')](respondWithResult(_0x3e7b60,null))[_0x79ca('0x4c')](handleError(_0x3e7b60,null));};exports[_0x79ca('0x51')]=function(_0xb4831d,_0x563913){return db[_0x79ca('0x35')][_0x79ca('0x51')](_0xb4831d[_0x79ca('0x52')],{})[_0x79ca('0x2d')](function(_0x38e3a5){var _0x33d0cb=_0xb4831d['user']['get']({'plain':!![]});if(!_0x33d0cb)throw new Error(_0x79ca('0x53'));if(_0x33d0cb[_0x79ca('0x54')]==='user'){var _0x483129=_0x38e3a5[_0x79ca('0x2f')]({'plain':!![]});var _0x57dfcd=_0x79ca('0x55');return db[_0x79ca('0x56')][_0x79ca('0x57')]({'where':{'name':_0x57dfcd,'userProfileId':_0x33d0cb['userProfileId']},'raw':!![]})[_0x79ca('0x2d')](function(_0x6e95c8){if(_0x6e95c8&&_0x6e95c8[_0x79ca('0x58')]===0x0){return db[_0x79ca('0x59')][_0x79ca('0x51')]({'name':_0x483129[_0x79ca('0x32')],'resourceId':_0x483129['id'],'type':_0x6e95c8[_0x79ca('0x32')],'sectionId':_0x6e95c8['id']},{})[_0x79ca('0x2d')](function(){return _0x38e3a5;});}else{return _0x38e3a5;}})[_0x79ca('0x4c')](function(_0x4a304e){logger[_0x79ca('0x5a')](_0x79ca('0x5b'),_0x4a304e);throw _0x4a304e;});}return _0x38e3a5;})['then'](respondWithResult(_0x563913,0xc9))[_0x79ca('0x4c')](handleError(_0x563913,null));};exports[_0x79ca('0x5c')]=function(_0x22392e,_0x98a867){var _0x47592d={'where':{'id':_0x22392e[_0x79ca('0x4d')]['id']}},_0x204bd2={};_0x204bd2['model']=_[_0x79ca('0x3d')](db[_0x79ca('0x35')][_0x79ca('0x36')]);_0x47592d[_0x79ca('0x41')]=_['intersection'](_0x204bd2['model'],qs[_0x79ca('0x40')](_0x22392e['query'][_0x79ca('0x40')]));_0x47592d[_0x79ca('0x41')]=_0x47592d['attributes'][_0x79ca('0x4e')]?_0x47592d[_0x79ca('0x41')]:_0x204bd2[_0x79ca('0x3a')];if(_0x22392e[_0x79ca('0x3c')][_0x79ca('0x4f')]){_0x47592d[_0x79ca('0x49')]=[{'all':!![]}];}_0x47592d=_[_0x79ca('0x48')]({},_0x47592d,_0x22392e[_0x79ca('0x50')]);return db[_0x79ca('0x35')][_0x79ca('0x57')](_0x47592d)[_0x79ca('0x2d')](handleEntityNotFound(_0x98a867,null))[_0x79ca('0x2d')](function(_0x5395e7){if(_0x5395e7){var _0x273a11=_0x5395e7[_0x79ca('0x2f')]({'plain':!![]});_0x273a11=qs['omit'](_0x273a11,['id','createdAt',_0x79ca('0x5d')]);_0x22392e['body']=_['omit'](_0x22392e['body'],['id',_0x79ca('0x5e'),_0x79ca('0x5d')]);return db[_0x79ca('0x35')]['create'](_['merge'](_0x273a11,_0x22392e['body']),{'include':_0x22392e[_0x79ca('0x3c')][_0x79ca('0x4f')]?[{'all':!![]}]:undefined})[_0x79ca('0x2d')](function(_0x2c47da){var _0x4da170=_0x22392e[_0x79ca('0x5f')][_0x79ca('0x2f')]({'plain':!![]});if(!_0x4da170)throw new Error(_0x79ca('0x53'));if(_0x4da170['role']==='user'){var _0x1938f3=_0x2c47da[_0x79ca('0x2f')]({'plain':!![]});var _0xd0b4e0=_0x79ca('0x55');return db[_0x79ca('0x56')][_0x79ca('0x57')]({'where':{'name':_0xd0b4e0,'userProfileId':_0x4da170[_0x79ca('0x60')]},'raw':!![]})[_0x79ca('0x2d')](function(_0x494f84){if(_0x494f84&&_0x494f84[_0x79ca('0x58')]===0x0){return db[_0x79ca('0x59')][_0x79ca('0x51')]({'name':_0x1938f3[_0x79ca('0x32')],'resourceId':_0x1938f3['id'],'type':_0x494f84[_0x79ca('0x32')],'sectionId':_0x494f84['id']},{})[_0x79ca('0x2d')](function(){return _0x2c47da;});}else{return _0x2c47da;}})[_0x79ca('0x4c')](function(_0x582a5a){logger['error'](_0x79ca('0x5b'),_0x582a5a);throw _0x582a5a;});}return _0x2c47da;});}})[_0x79ca('0x2d')](respondWithResult(_0x98a867,0xc9))[_0x79ca('0x4c')](handleError(_0x98a867,null));};exports[_0x79ca('0x61')]=function(_0x15d7a8,_0x71cc17){if(_0x15d7a8[_0x79ca('0x52')]['id']){delete _0x15d7a8['body']['id'];}return db[_0x79ca('0x35')][_0x79ca('0x57')]({'where':{'id':_0x15d7a8[_0x79ca('0x4d')]['id']}})[_0x79ca('0x2d')](handleEntityNotFound(_0x71cc17,null))['then'](saveUpdates(_0x15d7a8['body'],null))[_0x79ca('0x2d')](respondWithResult(_0x71cc17,null))[_0x79ca('0x4c')](handleError(_0x71cc17,null));};exports[_0x79ca('0x2e')]=function(_0x3493af,_0x2bbab1){return db[_0x79ca('0x35')][_0x79ca('0x57')]({'where':{'id':_0x3493af[_0x79ca('0x4d')]['id']}})[_0x79ca('0x2d')](handleEntityNotFound(_0x2bbab1,null))['then'](removeEntity(_0x2bbab1,null))['catch'](handleError(_0x2bbab1,null));};function widgetAttributes(_0xf469cb){try{switch(_0xf469cb[_0x79ca('0x38')]){case _0x79ca('0x62'):return[{'name':_0x79ca('0x63'),'value':_0xf469cb[_0x79ca('0x63')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb[_0x79ca('0x64')][0x0][_0x79ca('0x65')]:undefined)||_0x79ca('0x66')}];case _0x79ca('0x67'):return[{'name':_0x79ca('0x68'),'value':_0xf469cb['attrPath']||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb[_0x79ca('0x64')][0x0][_0x79ca('0x65')]:undefined)||''}];case'clock':return[{'name':_0x79ca('0x69'),'value':_0xf469cb[_0x79ca('0x69')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb[_0x79ca('0x64')][0x0][_0x79ca('0x65')]:undefined)||_0x79ca('0x6a')},{'name':'attrTimezone','value':_0xf469cb['attrTimezone']||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x1]?_0xf469cb['attrs'][0x1][_0x79ca('0x65')]:undefined)||_0x79ca('0x6b')},{'name':_0x79ca('0x6c'),'value':_0xf469cb['attrFontSize']||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x2]?_0xf469cb['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0xf469cb['attrMetric']||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb[_0x79ca('0x64')][0x0][_0x79ca('0x65')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xf469cb[_0x79ca('0x6d')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x1]?_0xf469cb[_0x79ca('0x64')][0x1][_0x79ca('0x65')]:undefined)||[]},{'name':_0x79ca('0x6c'),'value':_0xf469cb[_0x79ca('0x6c')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x2]?_0xf469cb[_0x79ca('0x64')][0x2][_0x79ca('0x65')]:undefined)||0x14},{'name':_0x79ca('0x6e'),'value':_0xf469cb['attrChannel']||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x3]?_0xf469cb[_0x79ca('0x64')][0x3][_0x79ca('0x65')]:undefined)||_0x79ca('0x6f')},{'name':_0x79ca('0x70'),'value':_0xf469cb[_0x79ca('0x70')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb['attrs'][0x4]?_0xf469cb[_0x79ca('0x64')][0x4][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x71'),'value':_0xf469cb[_0x79ca('0x71')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x5]?_0xf469cb['attrs'][0x5][_0x79ca('0x65')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xf469cb[_0x79ca('0x72')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x6]?_0xf469cb['attrs'][0x6][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x73'),'value':_0xf469cb['attrOpenchannelAccounts']||(_0xf469cb['attrs']&&_0xf469cb['attrs'][0x7]?_0xf469cb[_0x79ca('0x64')][0x7][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x74'),'value':_0xf469cb[_0x79ca('0x74')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x8]?_0xf469cb['attrs'][0x8][_0x79ca('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0xf469cb[_0x79ca('0x75')]||(_0xf469cb['attrs']&&_0xf469cb['attrs'][0x9]?_0xf469cb[_0x79ca('0x64')][0x9]['value']:undefined)||''}];case _0x79ca('0x76'):case _0x79ca('0x77'):return[{'name':_0x79ca('0x78'),'value':_0xf469cb[_0x79ca('0x78')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb['attrs'][0x0][_0x79ca('0x65')]:undefined)||_0x79ca('0x79')},{'name':_0x79ca('0x7a'),'value':_0xf469cb['attrSerie2']||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x1]?_0xf469cb['attrs'][0x1]['value']:undefined)||null},{'name':_0x79ca('0x7b'),'value':_0xf469cb[_0x79ca('0x7b')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x2]?_0xf469cb[_0x79ca('0x64')][0x2][_0x79ca('0x65')]:undefined)||null},{'name':_0x79ca('0x6d'),'value':_0xf469cb[_0x79ca('0x6d')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb['attrs'][0x3]?_0xf469cb[_0x79ca('0x64')][0x3][_0x79ca('0x65')]:undefined)||[]},{'name':_0x79ca('0x6e'),'value':_0xf469cb[_0x79ca('0x6e')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x4]?_0xf469cb[_0x79ca('0x64')][0x4][_0x79ca('0x65')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xf469cb[_0x79ca('0x70')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x5]?_0xf469cb[_0x79ca('0x64')][0x5][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x71'),'value':_0xf469cb[_0x79ca('0x71')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x6]?_0xf469cb[_0x79ca('0x64')][0x6][_0x79ca('0x65')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xf469cb[_0x79ca('0x72')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb['attrs'][0x7]?_0xf469cb['attrs'][0x7][_0x79ca('0x65')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xf469cb[_0x79ca('0x73')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb['attrs'][0x8]?_0xf469cb[_0x79ca('0x64')][0x8][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x74'),'value':_0xf469cb[_0x79ca('0x74')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x9]?_0xf469cb[_0x79ca('0x64')][0x9][_0x79ca('0x65')]:undefined)||''},{'name':_0x79ca('0x75'),'value':_0xf469cb[_0x79ca('0x75')]||(_0xf469cb['attrs']&&_0xf469cb[_0x79ca('0x64')][0xa]?_0xf469cb[_0x79ca('0x64')][0xa][_0x79ca('0x65')]:undefined)||''}];case _0x79ca('0x7c'):return[{'name':_0x79ca('0x7d'),'type':_0xf469cb['reportType']||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x0]?_0xf469cb[_0x79ca('0x64')][0x0][_0x79ca('0x38')]:undefined)||null,'value':_0xf469cb[_0x79ca('0x7d')]||(_0xf469cb['attrs']&&_0xf469cb['attrs'][0x0]?_0xf469cb['attrs'][0x0][_0x79ca('0x65')]:undefined)||null},{'name':_0x79ca('0x7e'),'value':_0xf469cb[_0x79ca('0x7e')]||(_0xf469cb[_0x79ca('0x64')]&&_0xf469cb[_0x79ca('0x64')][0x1]?_0xf469cb[_0x79ca('0x64')][0x1][_0x79ca('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x254098){logger[_0x79ca('0x5a')](_0x79ca('0x7f'),JSON[_0x79ca('0x80')](_0x254098));return[];}}exports['addItem']=function(_0x4bdbe9,_0x38bbd9,_0x54c61a){if(_0x4bdbe9[_0x79ca('0x52')]['id']){delete _0x4bdbe9[_0x79ca('0x52')]['id'];}return db[_0x79ca('0x35')][_0x79ca('0x57')]({'where':{'id':_0x4bdbe9[_0x79ca('0x4d')]['id']}})[_0x79ca('0x2d')](handleEntityNotFound(_0x38bbd9,null))[_0x79ca('0x2d')](function(_0x119da5){if(_0x119da5){_0x4bdbe9[_0x79ca('0x52')][_0x79ca('0x81')]=_0x119da5['id'];_0x4bdbe9['body']['attrs']=widgetAttributes(_0x4bdbe9['body']);return db['DashboardItem'][_0x79ca('0x51')](_0x4bdbe9[_0x79ca('0x52')]);}})[_0x79ca('0x2d')](respondWithResult(_0x38bbd9,null))[_0x79ca('0x4c')](handleError(_0x38bbd9,null));};exports[_0x79ca('0x82')]=function(_0x47b419,_0x3e1c22,_0x56252d){var _0x390ee7={};var _0x5c47e9={};var _0x3a584a;var _0x1d7abc;return db[_0x79ca('0x35')]['findOne']({'where':{'id':_0x47b419['params']['id']}})['then'](handleEntityNotFound(_0x3e1c22,null))[_0x79ca('0x2d')](function(_0x128520){if(_0x128520){_0x3a584a=_0x128520;_0x5c47e9[_0x79ca('0x3a')]=_[_0x79ca('0x3d')](db[_0x79ca('0x83')][_0x79ca('0x36')]);_0x5c47e9[_0x79ca('0x3c')]=_[_0x79ca('0x3d')](_0x47b419['query']);_0x5c47e9[_0x79ca('0x3e')]=_[_0x79ca('0x3f')](_0x5c47e9[_0x79ca('0x3a')],_0x5c47e9[_0x79ca('0x3c')]);_0x390ee7['attributes']=_[_0x79ca('0x3f')](_0x5c47e9[_0x79ca('0x3a')],qs[_0x79ca('0x40')](_0x47b419['query'][_0x79ca('0x40')]));_0x390ee7[_0x79ca('0x41')]=_0x390ee7['attributes'][_0x79ca('0x4e')]?_0x390ee7[_0x79ca('0x41')]:_0x5c47e9[_0x79ca('0x3a')];_0x390ee7[_0x79ca('0x43')]=qs[_0x79ca('0x44')](_0x47b419[_0x79ca('0x3c')][_0x79ca('0x44')]);_0x390ee7[_0x79ca('0x45')]=qs[_0x79ca('0x3e')](_['pick'](_0x47b419['query'],_0x5c47e9['filters']));if(_0x47b419['query']['filter']){_0x390ee7[_0x79ca('0x45')]=_[_0x79ca('0x48')](_0x390ee7[_0x79ca('0x45')],{'$or':_[_0x79ca('0x3b')](_0x390ee7[_0x79ca('0x41')],function(_0x135ac0){var _0x5018c1={};_0x5018c1[_0x135ac0]={'$like':'%'+_0x47b419[_0x79ca('0x3c')]['filter']+'%'};return _0x5018c1;})});}_0x390ee7=_[_0x79ca('0x48')]({},_0x390ee7,_0x47b419[_0x79ca('0x50')]);return _0x3a584a['getItems'](_0x390ee7);}})[_0x79ca('0x2d')](function(_0x458d51){if(_0x458d51){_0x1d7abc=_0x458d51['length'];if(!_0x47b419[_0x79ca('0x3c')][_0x79ca('0x42')](_0x79ca('0x84'))){_0x390ee7[_0x79ca('0x27')]=qs['limit'](_0x47b419[_0x79ca('0x3c')][_0x79ca('0x27')]);_0x390ee7[_0x79ca('0x29')]=qs['offset'](_0x47b419[_0x79ca('0x3c')][_0x79ca('0x29')]);}return _0x3a584a[_0x79ca('0x82')](_0x390ee7);}})[_0x79ca('0x2d')](function(_0x1fb17b){if(_0x1fb17b){return _0x1fb17b?{'count':_0x1d7abc,'rows':_0x1fb17b}:null;}})[_0x79ca('0x2d')](respondWithResult(_0x3e1c22,null))[_0x79ca('0x4c')](handleError(_0x3e1c22,null));}; \ No newline at end of file +var _0x7df2=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','length','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','omit','body','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','getItems','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7df2,0x73));var _0x27df=function(_0x302b17,_0x45dbee){_0x302b17=_0x302b17-0x0;var _0xd97366=_0x7df2[_0x302b17];return _0xd97366;};'use strict';var emlformat=require(_0x27df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27df('0x1'));var jsonpatch=require(_0x27df('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x27df('0x3'));var Mustache=require(_0x27df('0x4'));var util=require(_0x27df('0x5'));var path=require(_0x27df('0x6'));var sox=require(_0x27df('0x7'));var csv=require(_0x27df('0x8'));var ejs=require(_0x27df('0x9'));var fs=require('fs');var fs_extra=require(_0x27df('0xa'));var _=require(_0x27df('0xb'));var squel=require('squel');var crypto=require(_0x27df('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x27df('0xd'));var toCsv=require(_0x27df('0x8'));var querystring=require('querystring');var Papa=require(_0x27df('0xe'));var Redis=require(_0x27df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x27df('0x10'));var as=require(_0x27df('0x11'));var hardwareService=require(_0x27df('0x12'));var logger=require('../../config/logger')(_0x27df('0x13'));var utils=require(_0x27df('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x27df('0x15'));var db=require('../../mysqldb')['db'];config[_0x27df('0x16')]=_[_0x27df('0x17')](config['redis'],{'host':_0x27df('0x18'),'port':0x18eb});var socket=require(_0x27df('0x19'))(new Redis(config['redis']));require(_0x27df('0x1a'))['register'](socket);function respondWithStatusCode(_0x125f7d,_0x5cf38c){_0x5cf38c=_0x5cf38c||0xcc;return function(_0xbbe6eb){if(_0xbbe6eb){return _0x125f7d[_0x27df('0x1b')](_0x5cf38c);}return _0x125f7d[_0x27df('0x1c')](_0x5cf38c)[_0x27df('0x1d')]();};}function respondWithResult(_0x11dc78,_0x1d7075){_0x1d7075=_0x1d7075||0xc8;return function(_0x324678){if(_0x324678){return _0x11dc78[_0x27df('0x1c')](_0x1d7075)['json'](_0x324678);}};}function respondWithFilteredResult(_0x1a7913,_0x13c07c){return function(_0x862534){if(_0x862534){var _0x3f211a=typeof _0x13c07c[_0x27df('0x1e')]==='undefined'&&typeof _0x13c07c['limit']===_0x27df('0x1f');var _0xa3ef91=_0x862534[_0x27df('0x20')];var _0x3e9bf1=_0x3f211a?0x0:_0x13c07c[_0x27df('0x1e')];var _0x2cc784=_0x3f211a?_0x862534[_0x27df('0x20')]:_0x13c07c[_0x27df('0x1e')]+_0x13c07c[_0x27df('0x21')];var _0x11a303;if(_0x2cc784>=_0xa3ef91){_0x2cc784=_0xa3ef91;_0x11a303=0xc8;}else{_0x11a303=0xce;}_0x1a7913[_0x27df('0x1c')](_0x11a303);return _0x1a7913[_0x27df('0x22')](_0x27df('0x23'),_0x3e9bf1+'-'+_0x2cc784+'/'+_0xa3ef91)[_0x27df('0x24')](_0x862534);}return null;};}function patchUpdates(_0x368e33){return function(_0x4e6606){try{jsonpatch[_0x27df('0x25')](_0x4e6606,_0x368e33,!![]);}catch(_0x4ba3f9){return BPromise[_0x27df('0x26')](_0x4ba3f9);}return _0x4e6606[_0x27df('0x27')]();};}function saveUpdates(_0x45f656,_0x208553){return function(_0x264f66){if(_0x264f66){return _0x264f66[_0x27df('0x28')](_0x45f656)[_0x27df('0x29')](function(_0x41662b){return _0x41662b;});}return null;};}function removeEntity(_0x4e7e78,_0x19e971){return function(_0x1dbe45){if(_0x1dbe45){return _0x1dbe45[_0x27df('0x2a')]()[_0x27df('0x29')](function(){var _0x5cb483=_0x1dbe45[_0x27df('0x2b')]({'plain':!![]});var _0x421477=_0x27df('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x421477,'resourceId':_0x5cb483['id']}})[_0x27df('0x29')](function(){return _0x1dbe45;});})[_0x27df('0x29')](function(){_0x4e7e78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13bc3e,_0xe230a9){return function(_0x3e6adb){if(!_0x3e6adb){_0x13bc3e[_0x27df('0x1b')](0x194);}return _0x3e6adb;};}function handleError(_0x30f0aa,_0x566e40){_0x566e40=_0x566e40||0x1f4;return function(_0x345144){logger[_0x27df('0x2d')](_0x345144[_0x27df('0x2e')]);if(_0x345144[_0x27df('0x2f')]){delete _0x345144[_0x27df('0x2f')];}_0x30f0aa[_0x27df('0x1c')](_0x566e40)[_0x27df('0x30')](_0x345144);};}exports[_0x27df('0x31')]=function(_0x1bedcf,_0x16f2f7){var _0x2e9e9e={},_0xdab4a7={},_0x3a759d={'count':0x0,'rows':[]};var _0x3ee447=_[_0x27df('0x32')](db[_0x27df('0x33')][_0x27df('0x34')],function(_0x5d846d){return{'name':_0x5d846d[_0x27df('0x35')],'type':_0x5d846d[_0x27df('0x36')][_0x27df('0x37')]};});_0xdab4a7['model']=_[_0x27df('0x32')](_0x3ee447,'name');_0xdab4a7[_0x27df('0x38')]=_[_0x27df('0x39')](_0x1bedcf[_0x27df('0x38')]);_0xdab4a7['filters']=_[_0x27df('0x3a')](_0xdab4a7[_0x27df('0x3b')],_0xdab4a7[_0x27df('0x38')]);_0x2e9e9e[_0x27df('0x3c')]=_[_0x27df('0x3a')](_0xdab4a7[_0x27df('0x3b')],qs[_0x27df('0x3d')](_0x1bedcf[_0x27df('0x38')][_0x27df('0x3d')]));_0x2e9e9e[_0x27df('0x3c')]=_0x2e9e9e[_0x27df('0x3c')]['length']?_0x2e9e9e[_0x27df('0x3c')]:_0xdab4a7['model'];if(!_0x1bedcf[_0x27df('0x38')][_0x27df('0x3e')](_0x27df('0x3f'))){_0x2e9e9e[_0x27df('0x21')]=qs[_0x27df('0x21')](_0x1bedcf[_0x27df('0x38')]['limit']);_0x2e9e9e[_0x27df('0x1e')]=qs[_0x27df('0x1e')](_0x1bedcf[_0x27df('0x38')]['offset']);}_0x2e9e9e[_0x27df('0x40')]=qs[_0x27df('0x41')](_0x1bedcf[_0x27df('0x38')][_0x27df('0x41')]);_0x2e9e9e[_0x27df('0x42')]=qs['filters'](_[_0x27df('0x43')](_0x1bedcf[_0x27df('0x38')],_0xdab4a7[_0x27df('0x44')]),_0x3ee447);if(_0x1bedcf[_0x27df('0x38')][_0x27df('0x45')]){_0x2e9e9e[_0x27df('0x42')]=_[_0x27df('0x46')](_0x2e9e9e['where'],{'$or':_[_0x27df('0x32')](_0x3ee447,function(_0x499ae8){if(_0x499ae8[_0x27df('0x36')]!==_0x27df('0x47')){var _0x17410a={};_0x17410a[_0x499ae8[_0x27df('0x2f')]]={'$like':'%'+_0x1bedcf[_0x27df('0x38')]['filter']+'%'};return _0x17410a;}})});}_0x2e9e9e=_[_0x27df('0x46')]({},_0x2e9e9e,_0x1bedcf['options']);var _0x6e0ca5={'where':_0x2e9e9e[_0x27df('0x42')]};return db[_0x27df('0x33')][_0x27df('0x20')](_0x6e0ca5)[_0x27df('0x29')](function(_0x305964){_0x3a759d['count']=_0x305964;if(_0x1bedcf['query'][_0x27df('0x48')]){_0x2e9e9e['include']=[{'all':!![]}];}return db[_0x27df('0x33')][_0x27df('0x49')](_0x2e9e9e);})[_0x27df('0x29')](function(_0x542d2b){_0x3a759d[_0x27df('0x4a')]=_0x542d2b;return _0x3a759d;})['then'](respondWithFilteredResult(_0x16f2f7,_0x2e9e9e))['catch'](handleError(_0x16f2f7,null));};exports[_0x27df('0x4b')]=function(_0x3c51af,_0x532ebd){var _0x1568e6={'raw':![],'where':{'id':_0x3c51af[_0x27df('0x4c')]['id']}},_0x96bb8c={};_0x96bb8c[_0x27df('0x3b')]=_['keys'](db[_0x27df('0x33')]['rawAttributes']);_0x96bb8c[_0x27df('0x38')]=_[_0x27df('0x39')](_0x3c51af['query']);_0x96bb8c['filters']=_[_0x27df('0x3a')](_0x96bb8c['model'],_0x96bb8c[_0x27df('0x38')]);_0x1568e6[_0x27df('0x3c')]=_['intersection'](_0x96bb8c['model'],qs['fields'](_0x3c51af[_0x27df('0x38')][_0x27df('0x3d')]));_0x1568e6['attributes']=_0x1568e6[_0x27df('0x3c')][_0x27df('0x4d')]?_0x1568e6[_0x27df('0x3c')]:_0x96bb8c[_0x27df('0x3b')];if(_0x3c51af[_0x27df('0x38')]['includeAll']){_0x1568e6[_0x27df('0x4e')]=[{'all':!![]}];}_0x1568e6=_[_0x27df('0x46')]({},_0x1568e6,_0x3c51af[_0x27df('0x4f')]);return db[_0x27df('0x33')][_0x27df('0x50')](_0x1568e6)[_0x27df('0x29')](handleEntityNotFound(_0x532ebd,null))[_0x27df('0x29')](respondWithResult(_0x532ebd,null))['catch'](handleError(_0x532ebd,null));};exports['create']=function(_0x3c35f4,_0x1b3fc4){return db['Dashboard'][_0x27df('0x51')](_0x3c35f4['body'],{})[_0x27df('0x29')](function(_0x187dc2){var _0x42d6d4=_0x3c35f4[_0x27df('0x52')]['get']({'plain':!![]});if(!_0x42d6d4)throw new Error(_0x27df('0x53'));if(_0x42d6d4[_0x27df('0x54')]===_0x27df('0x52')){var _0x29a92e=_0x187dc2['get']({'plain':!![]});var _0x3b18b1=_0x27df('0x2c');return db[_0x27df('0x55')][_0x27df('0x50')]({'where':{'name':_0x3b18b1,'userProfileId':_0x42d6d4[_0x27df('0x56')]},'raw':!![]})[_0x27df('0x29')](function(_0x40500e){if(_0x40500e&&_0x40500e[_0x27df('0x57')]===0x0){return db[_0x27df('0x58')][_0x27df('0x51')]({'name':_0x29a92e[_0x27df('0x2f')],'resourceId':_0x29a92e['id'],'type':_0x40500e[_0x27df('0x2f')],'sectionId':_0x40500e['id']},{})[_0x27df('0x29')](function(){return _0x187dc2;});}else{return _0x187dc2;}})[_0x27df('0x59')](function(_0x3af67a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3af67a);throw _0x3af67a;});}return _0x187dc2;})[_0x27df('0x29')](respondWithResult(_0x1b3fc4,0xc9))[_0x27df('0x59')](handleError(_0x1b3fc4,null));};exports['clone']=function(_0x52913d,_0x22d551){var _0x16f146={'where':{'id':_0x52913d[_0x27df('0x4c')]['id']}},_0xbc9560={};_0xbc9560[_0x27df('0x3b')]=_[_0x27df('0x39')](db['Dashboard'][_0x27df('0x34')]);_0x16f146['attributes']=_[_0x27df('0x3a')](_0xbc9560[_0x27df('0x3b')],qs[_0x27df('0x3d')](_0x52913d[_0x27df('0x38')][_0x27df('0x3d')]));_0x16f146[_0x27df('0x3c')]=_0x16f146[_0x27df('0x3c')][_0x27df('0x4d')]?_0x16f146[_0x27df('0x3c')]:_0xbc9560['model'];if(_0x52913d[_0x27df('0x38')][_0x27df('0x48')]){_0x16f146[_0x27df('0x4e')]=[{'all':!![]}];}_0x16f146=_[_0x27df('0x46')]({},_0x16f146,_0x52913d[_0x27df('0x4f')]);return db[_0x27df('0x33')]['find'](_0x16f146)[_0x27df('0x29')](handleEntityNotFound(_0x22d551,null))[_0x27df('0x29')](function(_0x130b71){if(_0x130b71){var _0x1aaab6=_0x130b71[_0x27df('0x2b')]({'plain':!![]});_0x1aaab6=qs[_0x27df('0x5a')](_0x1aaab6,['id','createdAt','updatedAt']);_0x52913d[_0x27df('0x5b')]=_[_0x27df('0x5a')](_0x52913d['body'],['id',_0x27df('0x5c'),_0x27df('0x5d')]);return db['Dashboard']['create'](_[_0x27df('0x46')](_0x1aaab6,_0x52913d[_0x27df('0x5b')]),{'include':_0x52913d[_0x27df('0x38')][_0x27df('0x48')]?[{'all':!![]}]:undefined})[_0x27df('0x29')](function(_0x441727){var _0xad94da=_0x52913d[_0x27df('0x52')]['get']({'plain':!![]});if(!_0xad94da)throw new Error(_0x27df('0x53'));if(_0xad94da[_0x27df('0x54')]===_0x27df('0x52')){var _0x5504c7=_0x441727[_0x27df('0x2b')]({'plain':!![]});var _0x20f2f5=_0x27df('0x2c');return db['UserProfileSection'][_0x27df('0x50')]({'where':{'name':_0x20f2f5,'userProfileId':_0xad94da[_0x27df('0x56')]},'raw':!![]})['then'](function(_0x8a0dd4){if(_0x8a0dd4&&_0x8a0dd4[_0x27df('0x57')]===0x0){return db[_0x27df('0x58')][_0x27df('0x51')]({'name':_0x5504c7['name'],'resourceId':_0x5504c7['id'],'type':_0x8a0dd4['name'],'sectionId':_0x8a0dd4['id']},{})[_0x27df('0x29')](function(){return _0x441727;});}else{return _0x441727;}})[_0x27df('0x59')](function(_0x375974){logger[_0x27df('0x2d')](_0x27df('0x5e'),_0x375974);throw _0x375974;});}return _0x441727;});}})[_0x27df('0x29')](respondWithResult(_0x22d551,0xc9))['catch'](handleError(_0x22d551,null));};exports[_0x27df('0x28')]=function(_0x532f5d,_0x96e9ae){if(_0x532f5d[_0x27df('0x5b')]['id']){delete _0x532f5d[_0x27df('0x5b')]['id'];}return db[_0x27df('0x33')][_0x27df('0x50')]({'where':{'id':_0x532f5d[_0x27df('0x4c')]['id']}})['then'](handleEntityNotFound(_0x96e9ae,null))['then'](saveUpdates(_0x532f5d[_0x27df('0x5b')],null))[_0x27df('0x29')](respondWithResult(_0x96e9ae,null))[_0x27df('0x59')](handleError(_0x96e9ae,null));};exports['destroy']=function(_0x4f7630,_0x13c2de){return db[_0x27df('0x33')][_0x27df('0x50')]({'where':{'id':_0x4f7630['params']['id']}})[_0x27df('0x29')](handleEntityNotFound(_0x13c2de,null))[_0x27df('0x29')](removeEntity(_0x13c2de,null))['catch'](handleError(_0x13c2de,null));};function widgetAttributes(_0x151bd1){try{switch(_0x151bd1[_0x27df('0x36')]){case'iframe':return[{'name':_0x27df('0x5f'),'value':_0x151bd1[_0x27df('0x5f')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1[_0x27df('0x60')][0x0][_0x27df('0x61')]:undefined)||_0x27df('0x62')}];case _0x27df('0x63'):return[{'name':_0x27df('0x64'),'value':_0x151bd1[_0x27df('0x64')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1[_0x27df('0x60')][0x0][_0x27df('0x61')]:undefined)||''}];case _0x27df('0x65'):return[{'name':'attrHourFormat','value':_0x151bd1[_0x27df('0x66')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1['attrs'][0x0][_0x27df('0x61')]:undefined)||_0x27df('0x67')},{'name':_0x27df('0x68'),'value':_0x151bd1[_0x27df('0x68')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x1]?_0x151bd1[_0x27df('0x60')][0x1][_0x27df('0x61')]:undefined)||'0.00'},{'name':_0x27df('0x69'),'value':_0x151bd1['attrFontSize']||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1['attrs'][0x2]?_0x151bd1[_0x27df('0x60')][0x2]['value']:undefined)||0xc}];case _0x27df('0x6a'):return[{'name':_0x27df('0x6b'),'value':_0x151bd1[_0x27df('0x6b')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1['attrs'][0x0][_0x27df('0x61')]:undefined)||'total'},{'name':_0x27df('0x6c'),'value':_0x151bd1[_0x27df('0x6c')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x1]?_0x151bd1[_0x27df('0x60')][0x1][_0x27df('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x151bd1['attrFontSize']||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1['attrs'][0x2]?_0x151bd1[_0x27df('0x60')][0x2][_0x27df('0x61')]:undefined)||0x14},{'name':'attrChannel','value':_0x151bd1[_0x27df('0x6d')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x3]?_0x151bd1[_0x27df('0x60')][0x3][_0x27df('0x61')]:undefined)||'voice'},{'name':_0x27df('0x6e'),'value':_0x151bd1[_0x27df('0x6e')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x4]?_0x151bd1['attrs'][0x4][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x6f'),'value':_0x151bd1[_0x27df('0x6f')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x5]?_0x151bd1[_0x27df('0x60')][0x5][_0x27df('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x151bd1[_0x27df('0x70')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x6]?_0x151bd1['attrs'][0x6][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x71'),'value':_0x151bd1[_0x27df('0x71')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x7]?_0x151bd1[_0x27df('0x60')][0x7][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x72'),'value':_0x151bd1[_0x27df('0x72')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x8]?_0x151bd1[_0x27df('0x60')][0x8][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x73'),'value':_0x151bd1[_0x27df('0x73')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x9]?_0x151bd1[_0x27df('0x60')][0x9][_0x27df('0x61')]:undefined)||''}];case _0x27df('0x74'):case _0x27df('0x75'):return[{'name':'attrSerie1','value':_0x151bd1[_0x27df('0x76')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1['attrs'][0x0]?_0x151bd1['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x151bd1[_0x27df('0x77')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x1]?_0x151bd1['attrs'][0x1][_0x27df('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x151bd1[_0x27df('0x78')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x2]?_0x151bd1[_0x27df('0x60')][0x2][_0x27df('0x61')]:undefined)||null},{'name':_0x27df('0x6c'),'value':_0x151bd1[_0x27df('0x6c')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x3]?_0x151bd1[_0x27df('0x60')][0x3]['value']:undefined)||[]},{'name':_0x27df('0x6d'),'value':_0x151bd1[_0x27df('0x6d')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x4]?_0x151bd1[_0x27df('0x60')][0x4][_0x27df('0x61')]:undefined)||'voice'},{'name':_0x27df('0x6e'),'value':_0x151bd1[_0x27df('0x6e')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x5]?_0x151bd1['attrs'][0x5][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x6f'),'value':_0x151bd1['attrFaxAccounts']||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x6]?_0x151bd1['attrs'][0x6][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x70'),'value':_0x151bd1[_0x27df('0x70')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x7]?_0x151bd1[_0x27df('0x60')][0x7][_0x27df('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x151bd1[_0x27df('0x71')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x8]?_0x151bd1[_0x27df('0x60')][0x8][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x72'),'value':_0x151bd1[_0x27df('0x72')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x9]?_0x151bd1[_0x27df('0x60')][0x9][_0x27df('0x61')]:undefined)||''},{'name':_0x27df('0x73'),'value':_0x151bd1['attrChatWebsites']||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0xa]?_0x151bd1[_0x27df('0x60')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x27df('0x79'),'type':_0x151bd1['reportType']||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1['attrs'][0x0][_0x27df('0x36')]:undefined)||null,'value':_0x151bd1[_0x27df('0x79')]||(_0x151bd1[_0x27df('0x60')]&&_0x151bd1[_0x27df('0x60')][0x0]?_0x151bd1[_0x27df('0x60')][0x0][_0x27df('0x61')]:undefined)||null},{'name':_0x27df('0x7a'),'value':_0x151bd1[_0x27df('0x7a')]||(_0x151bd1['attrs']&&_0x151bd1[_0x27df('0x60')][0x1]?_0x151bd1[_0x27df('0x60')][0x1][_0x27df('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x4ea18c){logger['error'](_0x27df('0x7b'),JSON[_0x27df('0x7c')](_0x4ea18c));return[];}}exports['addItem']=function(_0x3fdf99,_0x179c3b,_0x267649){if(_0x3fdf99['body']['id']){delete _0x3fdf99[_0x27df('0x5b')]['id'];}return db[_0x27df('0x33')]['find']({'where':{'id':_0x3fdf99[_0x27df('0x4c')]['id']}})['then'](handleEntityNotFound(_0x179c3b,null))[_0x27df('0x29')](function(_0x20e3e3){if(_0x20e3e3){_0x3fdf99[_0x27df('0x5b')][_0x27df('0x7d')]=_0x20e3e3['id'];_0x3fdf99['body'][_0x27df('0x60')]=widgetAttributes(_0x3fdf99[_0x27df('0x5b')]);return db[_0x27df('0x7e')][_0x27df('0x51')](_0x3fdf99['body']);}})['then'](respondWithResult(_0x179c3b,null))['catch'](handleError(_0x179c3b,null));};exports['getItems']=function(_0x5bcdf1,_0x5b0bb7,_0x56f70a){var _0x469861={};var _0x2ff7f3={};var _0xcd2b1e;var _0x5884f9;return db[_0x27df('0x33')][_0x27df('0x7f')]({'where':{'id':_0x5bcdf1[_0x27df('0x4c')]['id']}})[_0x27df('0x29')](handleEntityNotFound(_0x5b0bb7,null))['then'](function(_0x132553){if(_0x132553){_0xcd2b1e=_0x132553;_0x2ff7f3['model']=_[_0x27df('0x39')](db[_0x27df('0x7e')][_0x27df('0x34')]);_0x2ff7f3['query']=_[_0x27df('0x39')](_0x5bcdf1[_0x27df('0x38')]);_0x2ff7f3[_0x27df('0x44')]=_['intersection'](_0x2ff7f3['model'],_0x2ff7f3[_0x27df('0x38')]);_0x469861[_0x27df('0x3c')]=_[_0x27df('0x3a')](_0x2ff7f3['model'],qs[_0x27df('0x3d')](_0x5bcdf1[_0x27df('0x38')][_0x27df('0x3d')]));_0x469861['attributes']=_0x469861[_0x27df('0x3c')][_0x27df('0x4d')]?_0x469861[_0x27df('0x3c')]:_0x2ff7f3[_0x27df('0x3b')];_0x469861[_0x27df('0x40')]=qs[_0x27df('0x41')](_0x5bcdf1[_0x27df('0x38')][_0x27df('0x41')]);_0x469861[_0x27df('0x42')]=qs['filters'](_['pick'](_0x5bcdf1['query'],_0x2ff7f3[_0x27df('0x44')]));if(_0x5bcdf1[_0x27df('0x38')][_0x27df('0x45')]){_0x469861[_0x27df('0x42')]=_[_0x27df('0x46')](_0x469861[_0x27df('0x42')],{'$or':_[_0x27df('0x32')](_0x469861[_0x27df('0x3c')],function(_0x3604e9){var _0x459c2d={};_0x459c2d[_0x3604e9]={'$like':'%'+_0x5bcdf1[_0x27df('0x38')][_0x27df('0x45')]+'%'};return _0x459c2d;})});}_0x469861=_[_0x27df('0x46')]({},_0x469861,_0x5bcdf1[_0x27df('0x4f')]);return _0xcd2b1e['getItems'](_0x469861);}})[_0x27df('0x29')](function(_0x11daf1){if(_0x11daf1){_0x5884f9=_0x11daf1[_0x27df('0x4d')];if(!_0x5bcdf1[_0x27df('0x38')][_0x27df('0x3e')](_0x27df('0x3f'))){_0x469861[_0x27df('0x21')]=qs[_0x27df('0x21')](_0x5bcdf1[_0x27df('0x38')][_0x27df('0x21')]);_0x469861[_0x27df('0x1e')]=qs[_0x27df('0x1e')](_0x5bcdf1[_0x27df('0x38')]['offset']);}return _0xcd2b1e[_0x27df('0x80')](_0x469861);}})[_0x27df('0x29')](function(_0x3974ba){if(_0x3974ba){return _0x3974ba?{'count':_0x5884f9,'rows':_0x3974ba}:null;}})[_0x27df('0x29')](respondWithResult(_0x5b0bb7,null))[_0x27df('0x59')](handleError(_0x5b0bb7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4278713..f43b08c 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 _0x986b=['../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x986b,0xd0));var _0xb986=function(_0x215155,_0x32cc3c){_0x215155=_0x215155-0x0;var _0xa3a503=_0x986b[_0x215155];return _0xa3a503;};'use strict';var EventEmitter=require(_0xb986('0x0'));var Dashboard=require(_0xb986('0x1'))['db'][_0xb986('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb986('0x3')](0x0);var events={'afterCreate':_0xb986('0x4'),'afterUpdate':_0xb986('0x5'),'afterDestroy':_0xb986('0x6')};function emitEvent(_0x18088f){return function(_0x4cd4e4,_0x2d00af,_0x4cf521){DashboardEvents[_0xb986('0x7')](_0x18088f+':'+_0x4cd4e4['id'],_0x4cd4e4);DashboardEvents[_0xb986('0x7')](_0x18088f,_0x4cd4e4);_0x4cf521(null);};}for(var e in events){if(events[_0xb986('0x8')](e)){var event=events[e];Dashboard[_0xb986('0x9')](e,emitEvent(event));}}module[_0xb986('0xa')]=DashboardEvents; \ No newline at end of file +var _0x4b8f=['setMaxListeners','save','remove','hasOwnProperty','hook','exports','../../mysqldb','Dashboard'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x4b8f,0x6e));var _0xf4b8=function(_0x56e2f9,_0x42c2f5){_0x56e2f9=_0x56e2f9-0x0;var _0x1a303f=_0x4b8f[_0x56e2f9];return _0x1a303f;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xf4b8('0x0'))['db'][_0xf4b8('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf4b8('0x2')](0x0);var events={'afterCreate':_0xf4b8('0x3'),'afterUpdate':'update','afterDestroy':_0xf4b8('0x4')};function emitEvent(_0x7387e1){return function(_0x34d83d,_0x6ba818,_0x2d6b66){DashboardEvents['emit'](_0x7387e1+':'+_0x34d83d['id'],_0x34d83d);DashboardEvents['emit'](_0x7387e1,_0x34d83d);_0x2d6b66(null);};}for(var e in events){if(events[_0xf4b8('0x5')](e)){var event=events[e];Dashboard[_0xf4b8('0x6')](e,emitEvent(event));}}module[_0xf4b8('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index cfab71a..3f919d4 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 _0xb641=['define','Dashboard','util','../../config/logger','moment','path','rimraf','../../config/environment','exports'];(function(_0x16d9eb,_0x5d5921){var _0x16f48d=function(_0x1c5c12){while(--_0x1c5c12){_0x16d9eb['push'](_0x16d9eb['shift']());}};_0x16f48d(++_0x5d5921);}(_0xb641,0x9b));var _0x1b64=function(_0x535c12,_0x55fc02){_0x535c12=_0x535c12-0x0;var _0x5a9f6f=_0xb641[_0x535c12];return _0x5a9f6f;};'use strict';var _=require('lodash');var util=require(_0x1b64('0x0'));var logger=require(_0x1b64('0x1'))('api');var moment=require(_0x1b64('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b64('0x3'));var rimraf=require(_0x1b64('0x4'));var config=require(_0x1b64('0x5'));var attributes=require('./dashboard.attributes');module[_0x1b64('0x6')]=function(_0x3a00ed,_0x25beb0){return _0x3a00ed[_0x1b64('0x7')](_0x1b64('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ad7=['exports','define','Dashboard','dashboards','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x55fd6e,_0x13edf2){var _0x14c636=function(_0x21f12e){while(--_0x21f12e){_0x55fd6e['push'](_0x55fd6e['shift']());}};_0x14c636(++_0x13edf2);}(_0x5ad7,0x184));var _0x75ad=function(_0x126b4e,_0x5daad5){_0x126b4e=_0x126b4e-0x0;var _0x4fff5d=_0x5ad7[_0x126b4e];return _0x4fff5d;};'use strict';var _=require('lodash');var util=require(_0x75ad('0x0'));var logger=require(_0x75ad('0x1'))('api');var moment=require(_0x75ad('0x2'));var BPromise=require(_0x75ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75ad('0x4'));var rimraf=require(_0x75ad('0x5'));var config=require(_0x75ad('0x6'));var attributes=require(_0x75ad('0x7'));module[_0x75ad('0x8')]=function(_0x5b69e1,_0x60a28e){return _0x5b69e1[_0x75ad('0x9')](_0x75ad('0xa'),attributes,{'tableName':_0x75ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index c50a26c..00a3212 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 _0x335b=['socket.io-emitter','redis','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','localhost'];(function(_0x5c4c8d,_0x566b34){var _0x19995c=function(_0x32d12c){while(--_0x32d12c){_0x5c4c8d['push'](_0x5c4c8d['shift']());}};_0x19995c(++_0x566b34);}(_0x335b,0x1a0));var _0xb335=function(_0x400f6b,_0x390a12){_0x400f6b=_0x400f6b-0x0;var _0x1837bf=_0x335b[_0x400f6b];return _0x1837bf;};'use strict';var _=require(_0xb335('0x0'));var util=require(_0xb335('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb335('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb335('0x3'))['db'];var utils=require(_0xb335('0x4'));var logger=require(_0xb335('0x5'))(_0xb335('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb335('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb335('0x8'),'port':0x18eb});var socket=require(_0xb335('0x9'))(new Redis(config[_0xb335('0xa')]));require(_0xb335('0xb'))['register'](socket);function respondWithRpcPromise(_0x1d882e,_0x3707ff,_0x3a1c31){return new BPromise(function(_0xaeec32,_0x36c724){return client[_0xb335('0xc')](_0x1d882e,_0x3a1c31)[_0xb335('0xd')](function(_0x2f698d){logger[_0xb335('0xe')](_0xb335('0xf'),_0x3707ff,_0xb335('0x10'));logger[_0xb335('0x11')](_0xb335('0x12'),_0x3707ff,'request\x20sent',JSON[_0xb335('0x13')](_0x2f698d));if(_0x2f698d[_0xb335('0x14')]){if(_0x2f698d['error'][_0xb335('0x15')]===0x1f4){logger[_0xb335('0x14')](_0xb335('0xf'),_0x3707ff,_0x2f698d[_0xb335('0x14')][_0xb335('0x16')]);return _0x36c724(_0x2f698d['error']['message']);}logger[_0xb335('0x14')](_0xb335('0xf'),_0x3707ff,_0x2f698d[_0xb335('0x14')][_0xb335('0x16')]);return _0xaeec32(_0x2f698d[_0xb335('0x14')][_0xb335('0x16')]);}else{logger['info'](_0xb335('0xf'),_0x3707ff,_0xb335('0x10'));_0xaeec32(_0x2f698d[_0xb335('0x17')][_0xb335('0x16')]);}})[_0xb335('0x18')](function(_0x1bae13){logger['error'](_0xb335('0xf'),_0x3707ff,_0x1bae13);_0x36c724(_0x1bae13);});});} \ No newline at end of file +var _0x514e=['Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','./dashboard.socket','register','then','request\x20sent','debug'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x514e,0x155));var _0xe514=function(_0x4fcc5f,_0x15792c){_0x4fcc5f=_0x4fcc5f-0x0;var _0x34edc8=_0x514e[_0x4fcc5f];return _0x34edc8;};'use strict';var _=require('lodash');var util=require(_0xe514('0x0'));var moment=require(_0xe514('0x1'));var BPromise=require('bluebird');var rs=require(_0xe514('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe514('0x3'))['db'];var utils=require(_0xe514('0x4'));var logger=require('../../config/logger')(_0xe514('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe514('0x6')][_0xe514('0x7')]({'port':0x232a});config[_0xe514('0x8')]=_[_0xe514('0x9')](config[_0xe514('0x8')],{'host':_0xe514('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe514('0x8')]));require(_0xe514('0xb'))[_0xe514('0xc')](socket);function respondWithRpcPromise(_0x3372cd,_0x55d7d5,_0x1b1e98){return new BPromise(function(_0x59d7b6,_0x200a84){return client['request'](_0x3372cd,_0x1b1e98)[_0xe514('0xd')](function(_0x5f40b7){logger['info']('Dashboard,\x20%s,\x20%s',_0x55d7d5,_0xe514('0xe'));logger[_0xe514('0xf')](_0xe514('0x10'),_0x55d7d5,'request\x20sent',JSON['stringify'](_0x5f40b7));if(_0x5f40b7[_0xe514('0x11')]){if(_0x5f40b7[_0xe514('0x11')][_0xe514('0x12')]===0x1f4){logger[_0xe514('0x11')](_0xe514('0x13'),_0x55d7d5,_0x5f40b7['error'][_0xe514('0x14')]);return _0x200a84(_0x5f40b7[_0xe514('0x11')][_0xe514('0x14')]);}logger[_0xe514('0x11')](_0xe514('0x13'),_0x55d7d5,_0x5f40b7['error'][_0xe514('0x14')]);return _0x59d7b6(_0x5f40b7[_0xe514('0x11')][_0xe514('0x14')]);}else{logger['info'](_0xe514('0x13'),_0x55d7d5,_0xe514('0xe'));_0x59d7b6(_0x5f40b7['result'][_0xe514('0x14')]);}})['catch'](function(_0x23fba4){logger[_0xe514('0x11')](_0xe514('0x13'),_0x55d7d5,_0x23fba4);_0x200a84(_0x23fba4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9d28d27..80a0eb0 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 _0xcb1c=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb1c,0x1d8));var _0xccb1=function(_0xa8993a,_0x2a2816){_0xa8993a=_0xa8993a-0x0;var _0x343421=_0xcb1c[_0xa8993a];return _0x343421;};'use strict';var DashboardEvents=require(_0xccb1('0x0'));var events=[_0xccb1('0x1'),_0xccb1('0x2'),_0xccb1('0x3')];function createListener(_0x5943be,_0x134f0e){return function(_0x384b67){_0x134f0e[_0xccb1('0x4')](_0x5943be,_0x384b67);};}function removeListener(_0x187cee,_0x1079f9){return function(){DashboardEvents[_0xccb1('0x5')](_0x187cee,_0x1079f9);};}exports[_0xccb1('0x6')]=function(_0x468e23){for(var _0x5a649f=0x0,_0xd9a64d=events[_0xccb1('0x7')];_0x5a649f<_0xd9a64d;_0x5a649f++){var _0x3e39ec=events[_0x5a649f];var _0x791ebe=createListener(_0xccb1('0x8')+_0x3e39ec,_0x468e23);DashboardEvents['on'](_0x3e39ec,_0x791ebe);}}; \ No newline at end of file +var _0xe484=['save','remove','update','emit','removeListener','length','dashboard:','./dashboard.events'];(function(_0x217b9b,_0x366b88){var _0x2fbc3b=function(_0x48fc51){while(--_0x48fc51){_0x217b9b['push'](_0x217b9b['shift']());}};_0x2fbc3b(++_0x366b88);}(_0xe484,0x1df));var _0x4e48=function(_0x1bccc8,_0x43502e){_0x1bccc8=_0x1bccc8-0x0;var _0x227a0d=_0xe484[_0x1bccc8];return _0x227a0d;};'use strict';var DashboardEvents=require(_0x4e48('0x0'));var events=[_0x4e48('0x1'),_0x4e48('0x2'),_0x4e48('0x3')];function createListener(_0xcd5190,_0x30b972){return function(_0x3c7466){_0x30b972[_0x4e48('0x4')](_0xcd5190,_0x3c7466);};}function removeListener(_0x46a4e8,_0x343b72){return function(){DashboardEvents[_0x4e48('0x5')](_0x46a4e8,_0x343b72);};}exports['register']=function(_0x1be01a){for(var _0x510237=0x0,_0x4e80e4=events[_0x4e48('0x6')];_0x510237<_0x4e80e4;_0x510237++){var _0x31567c=events[_0x510237];var _0x1e6cf4=createListener(_0x4e48('0x7')+_0x31567c,_0x1be01a);DashboardEvents['on'](_0x31567c,_0x1e6cf4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 571c1c4..260b345 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 _0x9a21=['/:id/clone','/:id/items','addItem','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getItems','post'];(function(_0x4757d5,_0x3557c0){var _0x18a2ab=function(_0x4fb6f2){while(--_0x4fb6f2){_0x4757d5['push'](_0x4757d5['shift']());}};_0x18a2ab(++_0x3557c0);}(_0x9a21,0x126));var _0x19a2=function(_0x5783fa,_0x2fa004){_0x5783fa=_0x5783fa-0x0;var _0x36ae69=_0x9a21[_0x5783fa];return _0x36ae69;};'use strict';var multer=require(_0x19a2('0x0'));var util=require(_0x19a2('0x1'));var path=require(_0x19a2('0x2'));var timeout=require(_0x19a2('0x3'));var express=require('express');var router=express[_0x19a2('0x4')]();var fs_extra=require(_0x19a2('0x5'));var auth=require(_0x19a2('0x6'));var interaction=require(_0x19a2('0x7'));var config=require(_0x19a2('0x8'));var controller=require('./dashboard.controller');router[_0x19a2('0x9')]('/',auth[_0x19a2('0xa')](),controller['index']);router[_0x19a2('0x9')]('/:id',auth[_0x19a2('0xa')](),controller[_0x19a2('0xb')]);router[_0x19a2('0x9')]('/:id/items',auth[_0x19a2('0xa')](),controller[_0x19a2('0xc')]);router[_0x19a2('0xd')]('/',auth[_0x19a2('0xa')](),controller['create']);router['post'](_0x19a2('0xe'),auth[_0x19a2('0xa')](),controller['clone']);router[_0x19a2('0xd')](_0x19a2('0xf'),auth[_0x19a2('0xa')](),controller[_0x19a2('0x10')]);router[_0x19a2('0x11')](_0x19a2('0x12'),auth[_0x19a2('0xa')](),controller['update']);router[_0x19a2('0x13')]('/:id',auth[_0x19a2('0xa')](),controller[_0x19a2('0x14')]);module[_0x19a2('0x15')]=router; \ No newline at end of file +var _0x4676=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','index','get','/:id','show','/:id/items','isAuthenticated','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x49d5c7,_0x3f77aa){var _0x2f1f5e=function(_0x58d445){while(--_0x58d445){_0x49d5c7['push'](_0x49d5c7['shift']());}};_0x2f1f5e(++_0x3f77aa);}(_0x4676,0xcc));var _0x6467=function(_0x1288c7,_0x37b7c9){_0x1288c7=_0x1288c7-0x0;var _0x1ffe57=_0x4676[_0x1288c7];return _0x1ffe57;};'use strict';var multer=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var path=require(_0x6467('0x2'));var timeout=require(_0x6467('0x3'));var express=require(_0x6467('0x4'));var router=express[_0x6467('0x5')]();var fs_extra=require(_0x6467('0x6'));var auth=require(_0x6467('0x7'));var interaction=require(_0x6467('0x8'));var config=require('../../config/environment');var controller=require(_0x6467('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6467('0xa')]);router[_0x6467('0xb')](_0x6467('0xc'),auth['isAuthenticated'](),controller[_0x6467('0xd')]);router[_0x6467('0xb')](_0x6467('0xe'),auth[_0x6467('0xf')](),controller['getItems']);router[_0x6467('0x10')]('/',auth['isAuthenticated'](),controller[_0x6467('0x11')]);router[_0x6467('0x10')](_0x6467('0x12'),auth[_0x6467('0xf')](),controller[_0x6467('0x13')]);router[_0x6467('0x10')](_0x6467('0xe'),auth['isAuthenticated'](),controller[_0x6467('0x14')]);router[_0x6467('0x15')](_0x6467('0xc'),auth[_0x6467('0xf')](),controller[_0x6467('0x16')]);router[_0x6467('0x17')](_0x6467('0xc'),auth[_0x6467('0xf')](),controller[_0x6467('0x18')]);module[_0x6467('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1b4a666..39a3f61 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 _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xd46e('0x0'));var squel=require(_0xd46e('0x1'));var _=require('lodash');module[_0xd46e('0x2')]={'title':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd46e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd46e('0x4')),'get':function(){try{return JSON[_0xd46e('0x5')](this['getDataValue'](_0xd46e('0x6')));}catch(_0x1926d9){return[];}},'set':function(_0x160bcf){try{this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')](_0x160bcf));}catch(_0x437ea0){this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xd46e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd46e('0x9')]},'col':{'type':Sequelize[_0xd46e('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd46e('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![],'defaultValue':_0xd46e('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd46e('0x3')]},'titleFontSize':{'type':Sequelize[_0xd46e('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2eb2=['STRING','TEXT','parse','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','lodash','exports'];(function(_0x399b94,_0xe2a307){var _0x393a46=function(_0x8b6b05){while(--_0x8b6b05){_0x399b94['push'](_0x399b94['shift']());}};_0x393a46(++_0xe2a307);}(_0x2eb2,0x19f));var _0x22eb=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x2eb2[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));module[_0x22eb('0x2')]={'title':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x22eb('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x22eb('0x4')]('long'),'get':function(){try{return JSON[_0x22eb('0x5')](this['getDataValue']('attrs'));}catch(_0x1dfef7){return[];}},'set':function(_0x10e116){try{this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')](_0x10e116));}catch(_0x396806){this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x22eb('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x22eb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x22eb('0x9')],'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 6003d32..7cfd15a 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 _0x9b09=['count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','includeAll','include','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','attrHourFormat','value','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','status','json','offset','limit','undefined'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9b09,0x1ad));var _0x99b0=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x9b09[_0x3de7e0];return _0x11d0b3;};'use strict';var emlformat=require(_0x99b0('0x0'));var rimraf=require(_0x99b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b0('0x2'));var rp=require(_0x99b0('0x3'));var moment=require('moment');var BPromise=require(_0x99b0('0x4'));var Mustache=require('mustache');var util=require(_0x99b0('0x5'));var path=require('path');var sox=require(_0x99b0('0x6'));var csv=require(_0x99b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b0('0x8'));var _=require(_0x99b0('0x9'));var squel=require('squel');var crypto=require(_0x99b0('0xa'));var jsforce=require(_0x99b0('0xb'));var deskjs=require(_0x99b0('0xc'));var toCsv=require(_0x99b0('0x7'));var querystring=require(_0x99b0('0xd'));var Papa=require('papaparse');var Redis=require(_0x99b0('0xe'));var authService=require(_0x99b0('0xf'));var qs=require(_0x99b0('0x10'));var as=require(_0x99b0('0x11'));var hardwareService=require(_0x99b0('0x12'));var logger=require('../../config/logger')(_0x99b0('0x13'));var utils=require(_0x99b0('0x14'));var config=require(_0x99b0('0x15'));var licenseUtil=require(_0x99b0('0x16'));var db=require(_0x99b0('0x17'))['db'];config[_0x99b0('0x18')]=_['defaults'](config[_0x99b0('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x99b0('0x19'))(new Redis(config[_0x99b0('0x18')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x27142a,_0x2743d3){_0x2743d3=_0x2743d3||0xcc;return function(_0x2331e7){if(_0x2331e7){return _0x27142a['sendStatus'](_0x2743d3);}return _0x27142a['status'](_0x2743d3)['end']();};}function respondWithResult(_0x2e176f,_0x30c552){_0x30c552=_0x30c552||0xc8;return function(_0x4d40ea){if(_0x4d40ea){return _0x2e176f[_0x99b0('0x1a')](_0x30c552)[_0x99b0('0x1b')](_0x4d40ea);}};}function respondWithFilteredResult(_0xaa1009,_0x7bbb89){return function(_0x1cb302){if(_0x1cb302){var _0x45317d=typeof _0x7bbb89[_0x99b0('0x1c')]==='undefined'&&typeof _0x7bbb89[_0x99b0('0x1d')]===_0x99b0('0x1e');var _0x1fb89b=_0x1cb302[_0x99b0('0x1f')];var _0x1a5863=_0x45317d?0x0:_0x7bbb89[_0x99b0('0x1c')];var _0x3b303b=_0x45317d?_0x1cb302[_0x99b0('0x1f')]:_0x7bbb89[_0x99b0('0x1c')]+_0x7bbb89[_0x99b0('0x1d')];var _0x3988c4;if(_0x3b303b>=_0x1fb89b){_0x3b303b=_0x1fb89b;_0x3988c4=0xc8;}else{_0x3988c4=0xce;}_0xaa1009[_0x99b0('0x1a')](_0x3988c4);return _0xaa1009[_0x99b0('0x20')](_0x99b0('0x21'),_0x1a5863+'-'+_0x3b303b+'/'+_0x1fb89b)[_0x99b0('0x1b')](_0x1cb302);}return null;};}function patchUpdates(_0x93dcb1){return function(_0xa469fa){try{jsonpatch[_0x99b0('0x22')](_0xa469fa,_0x93dcb1,!![]);}catch(_0x1d7022){return BPromise[_0x99b0('0x23')](_0x1d7022);}return _0xa469fa[_0x99b0('0x24')]();};}function saveUpdates(_0x28f11d,_0x3be9fc){return function(_0x21e7e3){if(_0x21e7e3){return _0x21e7e3['update'](_0x28f11d)[_0x99b0('0x25')](function(_0x4a6c0f){return _0x4a6c0f;});}return null;};}function removeEntity(_0x55f4f1,_0x34075a){return function(_0x3efaab){if(_0x3efaab){return _0x3efaab[_0x99b0('0x26')]()[_0x99b0('0x25')](function(){_0x55f4f1[_0x99b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128b0e,_0x154dec){return function(_0x18d113){if(!_0x18d113){_0x128b0e[_0x99b0('0x27')](0x194);}return _0x18d113;};}function handleError(_0x5d3d09,_0x7dc8a6){_0x7dc8a6=_0x7dc8a6||0x1f4;return function(_0x2e0850){logger['error'](_0x2e0850[_0x99b0('0x28')]);if(_0x2e0850[_0x99b0('0x29')]){delete _0x2e0850[_0x99b0('0x29')];}_0x5d3d09[_0x99b0('0x1a')](_0x7dc8a6)[_0x99b0('0x2a')](_0x2e0850);};}exports[_0x99b0('0x2b')]=function(_0x233eb6,_0x398885){var _0x19c850={'raw':![],'where':{'id':_0x233eb6[_0x99b0('0x2c')]['id']}},_0x5b009e={};_0x5b009e[_0x99b0('0x2d')]=_[_0x99b0('0x2e')](db[_0x99b0('0x2f')][_0x99b0('0x30')]);_0x5b009e[_0x99b0('0x31')]=_['keys'](_0x233eb6[_0x99b0('0x31')]);_0x5b009e[_0x99b0('0x32')]=_[_0x99b0('0x33')](_0x5b009e[_0x99b0('0x2d')],_0x5b009e[_0x99b0('0x31')]);_0x19c850[_0x99b0('0x34')]=_[_0x99b0('0x33')](_0x5b009e[_0x99b0('0x2d')],qs['fields'](_0x233eb6[_0x99b0('0x31')]['fields']));_0x19c850[_0x99b0('0x34')]=_0x19c850[_0x99b0('0x34')]['length']?_0x19c850[_0x99b0('0x34')]:_0x5b009e['model'];if(_0x233eb6['query'][_0x99b0('0x35')]){_0x19c850[_0x99b0('0x36')]=[{'all':!![]}];}_0x19c850=_['merge']({},_0x19c850,_0x233eb6['options']);return db[_0x99b0('0x2f')][_0x99b0('0x37')](_0x19c850)['then'](handleEntityNotFound(_0x398885,null))[_0x99b0('0x25')](respondWithResult(_0x398885,null))['catch'](handleError(_0x398885,null));};exports[_0x99b0('0x26')]=function(_0x59d74c,_0x1c4fff){return db[_0x99b0('0x2f')][_0x99b0('0x37')]({'where':{'id':_0x59d74c['params']['id']}})[_0x99b0('0x25')](handleEntityNotFound(_0x1c4fff,null))['then'](removeEntity(_0x1c4fff,null))[_0x99b0('0x38')](handleError(_0x1c4fff,null));};function widgetAttributes(_0x5f1137){try{switch(_0x5f1137[_0x99b0('0x39')]){case _0x99b0('0x3a'):return[{'name':_0x99b0('0x3b'),'value':_0x5f1137[_0x99b0('0x3b')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x0]?_0x5f1137['attrs'][0x0]['value']:undefined)||_0x99b0('0x3d')}];case _0x99b0('0x3e'):return[{'name':_0x99b0('0x3f'),'value':_0x5f1137[_0x99b0('0x3f')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137['attrs'][0x0]?_0x5f1137[_0x99b0('0x3c')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x99b0('0x40'),'value':_0x5f1137[_0x99b0('0x40')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137['attrs'][0x0]?_0x5f1137['attrs'][0x0][_0x99b0('0x41')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x5f1137['attrTimezone']||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x1]?_0x5f1137[_0x99b0('0x3c')][0x1]['value']:undefined)||_0x99b0('0x42')},{'name':'attrFontSize','value':_0x5f1137[_0x99b0('0x43')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x2]?_0x5f1137[_0x99b0('0x3c')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5f1137[_0x99b0('0x44')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x0]?_0x5f1137[_0x99b0('0x3c')][0x0]['value']:undefined)||'total'},{'name':_0x99b0('0x45'),'value':_0x5f1137[_0x99b0('0x45')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x1]?_0x5f1137['attrs'][0x1][_0x99b0('0x41')]:undefined)||[]},{'name':_0x99b0('0x43'),'value':_0x5f1137[_0x99b0('0x43')]||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x2]?_0x5f1137[_0x99b0('0x3c')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x5f1137[_0x99b0('0x46')]||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x3]?_0x5f1137[_0x99b0('0x3c')][0x3][_0x99b0('0x41')]:undefined)||'voice'},{'name':_0x99b0('0x47'),'value':_0x5f1137[_0x99b0('0x47')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x4]?_0x5f1137['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x5f1137[_0x99b0('0x48')]||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x5]?_0x5f1137[_0x99b0('0x3c')][0x5][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x49'),'value':_0x5f1137[_0x99b0('0x49')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137['attrs'][0x6]?_0x5f1137['attrs'][0x6][_0x99b0('0x41')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5f1137[_0x99b0('0x4a')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x7]?_0x5f1137[_0x99b0('0x3c')][0x7][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x4b'),'value':_0x5f1137[_0x99b0('0x4b')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x8]?_0x5f1137['attrs'][0x8][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x4c'),'value':_0x5f1137[_0x99b0('0x4c')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x9]?_0x5f1137[_0x99b0('0x3c')][0x9][_0x99b0('0x41')]:undefined)||''}];case _0x99b0('0x4d'):case _0x99b0('0x4e'):return[{'name':_0x99b0('0x4f'),'value':_0x5f1137[_0x99b0('0x4f')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x0]?_0x5f1137[_0x99b0('0x3c')][0x0]['value']:undefined)||_0x99b0('0x50')},{'name':_0x99b0('0x51'),'value':_0x5f1137['attrSerie2']||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x1]?_0x5f1137[_0x99b0('0x3c')][0x1]['value']:undefined)||null},{'name':_0x99b0('0x52'),'value':_0x5f1137['attrSerie3']||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x2]?_0x5f1137['attrs'][0x2]['value']:undefined)||null},{'name':_0x99b0('0x45'),'value':_0x5f1137['attrVoiceQueues']||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x3]?_0x5f1137[_0x99b0('0x3c')][0x3][_0x99b0('0x41')]:undefined)||[]},{'name':'attrChannel','value':_0x5f1137[_0x99b0('0x46')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x4]?_0x5f1137[_0x99b0('0x3c')][0x4][_0x99b0('0x41')]:undefined)||_0x99b0('0x53')},{'name':_0x99b0('0x47'),'value':_0x5f1137[_0x99b0('0x47')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x5]?_0x5f1137[_0x99b0('0x3c')][0x5][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x48'),'value':_0x5f1137[_0x99b0('0x48')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137['attrs'][0x6]?_0x5f1137['attrs'][0x6][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x49'),'value':_0x5f1137['attrSmsAccounts']||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x7]?_0x5f1137['attrs'][0x7][_0x99b0('0x41')]:undefined)||''},{'name':_0x99b0('0x4a'),'value':_0x5f1137[_0x99b0('0x4a')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x8]?_0x5f1137[_0x99b0('0x3c')][0x8]['value']:undefined)||''},{'name':_0x99b0('0x4b'),'value':_0x5f1137[_0x99b0('0x4b')]||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x9]?_0x5f1137[_0x99b0('0x3c')][0x9][_0x99b0('0x41')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5f1137[_0x99b0('0x4c')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137['attrs'][0xa]?_0x5f1137[_0x99b0('0x3c')][0xa][_0x99b0('0x41')]:undefined)||''}];case _0x99b0('0x54'):return[{'name':'attrReport','type':_0x5f1137['reportType']||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x0]?_0x5f1137[_0x99b0('0x3c')][0x0][_0x99b0('0x39')]:undefined)||null,'value':_0x5f1137[_0x99b0('0x55')]||(_0x5f1137['attrs']&&_0x5f1137[_0x99b0('0x3c')][0x0]?_0x5f1137['attrs'][0x0][_0x99b0('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x5f1137[_0x99b0('0x56')]||(_0x5f1137[_0x99b0('0x3c')]&&_0x5f1137[_0x99b0('0x3c')][0x1]?_0x5f1137['attrs'][0x1][_0x99b0('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x2913f9){logger[_0x99b0('0x57')](_0x99b0('0x58'),JSON[_0x99b0('0x59')](_0x2913f9));return[];}}exports[_0x99b0('0x5a')]=function(_0x9a9b02,_0x1d7515){if(_0x9a9b02[_0x99b0('0x5b')]){_0x9a9b02[_0x99b0('0x5b')]['attrs']=widgetAttributes(_0x9a9b02[_0x99b0('0x5b')]);}return db[_0x99b0('0x2f')][_0x99b0('0x5a')](_0x9a9b02[_0x99b0('0x5b')],{})['then'](respondWithResult(_0x1d7515,0xc9))[_0x99b0('0x38')](handleError(_0x1d7515,null));};exports['update']=function(_0x5ae1ae,_0x42c125){if(_0x5ae1ae['body']['id']){delete _0x5ae1ae[_0x99b0('0x5b')]['id'];}_0x5ae1ae[_0x99b0('0x5b')][_0x99b0('0x3c')]=widgetAttributes(_0x5ae1ae['body']);return db[_0x99b0('0x2f')][_0x99b0('0x37')]({'where':{'id':_0x5ae1ae['params']['id']}})[_0x99b0('0x25')](handleEntityNotFound(_0x42c125,null))[_0x99b0('0x25')](saveUpdates(_0x5ae1ae[_0x99b0('0x5b')],null))['then'](respondWithResult(_0x42c125,null))[_0x99b0('0x38')](handleError(_0x42c125,null));}; \ No newline at end of file +var _0x62f1=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','name','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','length','includeAll','merge','options','catch','find','iframe','attrUrl','attrs','value','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','reportType','type','attrReport','attrRefresh','error','stringify','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3fea18,_0x386ae8){var _0x47a122=function(_0x541927){while(--_0x541927){_0x3fea18['push'](_0x3fea18['shift']());}};_0x47a122(++_0x386ae8);}(_0x62f1,0x112));var _0x162f=function(_0x3e030b,_0x459975){_0x3e030b=_0x3e030b-0x0;var _0x34267c=_0x62f1[_0x3e030b];return _0x34267c;};'use strict';var emlformat=require(_0x162f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x162f('0x1'));var jsonpatch=require(_0x162f('0x2'));var rp=require(_0x162f('0x3'));var moment=require(_0x162f('0x4'));var BPromise=require(_0x162f('0x5'));var Mustache=require(_0x162f('0x6'));var util=require(_0x162f('0x7'));var path=require(_0x162f('0x8'));var sox=require(_0x162f('0x9'));var csv=require(_0x162f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x162f('0xb'));var _=require(_0x162f('0xc'));var squel=require('squel');var crypto=require(_0x162f('0xd'));var jsforce=require(_0x162f('0xe'));var deskjs=require(_0x162f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x162f('0x10'));var Papa=require(_0x162f('0x11'));var Redis=require(_0x162f('0x12'));var authService=require(_0x162f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x162f('0x14'));var hardwareService=require(_0x162f('0x15'));var logger=require(_0x162f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x162f('0x17'));var db=require('../../mysqldb')['db'];config[_0x162f('0x18')]=_[_0x162f('0x19')](config[_0x162f('0x18')],{'host':_0x162f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x162f('0x18')]));require(_0x162f('0x1b'))[_0x162f('0x1c')](socket);function respondWithStatusCode(_0x130db8,_0x567f37){_0x567f37=_0x567f37||0xcc;return function(_0x195085){if(_0x195085){return _0x130db8['sendStatus'](_0x567f37);}return _0x130db8[_0x162f('0x1d')](_0x567f37)[_0x162f('0x1e')]();};}function respondWithResult(_0x40a284,_0x8990f3){_0x8990f3=_0x8990f3||0xc8;return function(_0x55026b){if(_0x55026b){return _0x40a284['status'](_0x8990f3)[_0x162f('0x1f')](_0x55026b);}};}function respondWithFilteredResult(_0xa03e71,_0x413c63){return function(_0x1ee433){if(_0x1ee433){var _0x45f7ef=typeof _0x413c63[_0x162f('0x20')]===_0x162f('0x21')&&typeof _0x413c63['limit']===_0x162f('0x21');var _0x53ac47=_0x1ee433[_0x162f('0x22')];var _0x46df5e=_0x45f7ef?0x0:_0x413c63['offset'];var _0x26c05b=_0x45f7ef?_0x1ee433[_0x162f('0x22')]:_0x413c63['offset']+_0x413c63[_0x162f('0x23')];var _0x436a5a;if(_0x26c05b>=_0x53ac47){_0x26c05b=_0x53ac47;_0x436a5a=0xc8;}else{_0x436a5a=0xce;}_0xa03e71[_0x162f('0x1d')](_0x436a5a);return _0xa03e71[_0x162f('0x24')]('Content-Range',_0x46df5e+'-'+_0x26c05b+'/'+_0x53ac47)[_0x162f('0x1f')](_0x1ee433);}return null;};}function patchUpdates(_0x246aff){return function(_0x9e3f3c){try{jsonpatch[_0x162f('0x25')](_0x9e3f3c,_0x246aff,!![]);}catch(_0x422241){return BPromise[_0x162f('0x26')](_0x422241);}return _0x9e3f3c[_0x162f('0x27')]();};}function saveUpdates(_0x331d0d,_0x56fdda){return function(_0x352547){if(_0x352547){return _0x352547[_0x162f('0x28')](_0x331d0d)[_0x162f('0x29')](function(_0x16f5e2){return _0x16f5e2;});}return null;};}function removeEntity(_0x59482e,_0x2fc293){return function(_0x58af8a){if(_0x58af8a){return _0x58af8a[_0x162f('0x2a')]()['then'](function(){_0x59482e[_0x162f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1414dd,_0x567175){return function(_0x3e710d){if(!_0x3e710d){_0x1414dd[_0x162f('0x2b')](0x194);}return _0x3e710d;};}function handleError(_0x3a02bf,_0x50fb25){_0x50fb25=_0x50fb25||0x1f4;return function(_0x4bb880){logger['error'](_0x4bb880['stack']);if(_0x4bb880[_0x162f('0x2c')]){delete _0x4bb880[_0x162f('0x2c')];}_0x3a02bf['status'](_0x50fb25)['send'](_0x4bb880);};}exports['show']=function(_0xf1c578,_0x5089c7){var _0x43bb9a={'raw':![],'where':{'id':_0xf1c578['params']['id']}},_0x1f1c3b={};_0x1f1c3b['model']=_[_0x162f('0x2d')](db[_0x162f('0x2e')][_0x162f('0x2f')]);_0x1f1c3b['query']=_[_0x162f('0x2d')](_0xf1c578[_0x162f('0x30')]);_0x1f1c3b[_0x162f('0x31')]=_[_0x162f('0x32')](_0x1f1c3b['model'],_0x1f1c3b['query']);_0x43bb9a[_0x162f('0x33')]=_['intersection'](_0x1f1c3b[_0x162f('0x34')],qs['fields'](_0xf1c578['query']['fields']));_0x43bb9a['attributes']=_0x43bb9a[_0x162f('0x33')][_0x162f('0x35')]?_0x43bb9a[_0x162f('0x33')]:_0x1f1c3b['model'];if(_0xf1c578[_0x162f('0x30')][_0x162f('0x36')]){_0x43bb9a['include']=[{'all':!![]}];}_0x43bb9a=_[_0x162f('0x37')]({},_0x43bb9a,_0xf1c578[_0x162f('0x38')]);return db[_0x162f('0x2e')]['find'](_0x43bb9a)[_0x162f('0x29')](handleEntityNotFound(_0x5089c7,null))['then'](respondWithResult(_0x5089c7,null))[_0x162f('0x39')](handleError(_0x5089c7,null));};exports['destroy']=function(_0x463c10,_0x510ea7){return db[_0x162f('0x2e')][_0x162f('0x3a')]({'where':{'id':_0x463c10['params']['id']}})[_0x162f('0x29')](handleEntityNotFound(_0x510ea7,null))['then'](removeEntity(_0x510ea7,null))[_0x162f('0x39')](handleError(_0x510ea7,null));};function widgetAttributes(_0x32909c){try{switch(_0x32909c['type']){case _0x162f('0x3b'):return[{'name':'attrUrl','value':_0x32909c[_0x162f('0x3c')]||(_0x32909c['attrs']&&_0x32909c['attrs'][0x0]?_0x32909c[_0x162f('0x3d')][0x0][_0x162f('0x3e')]:undefined)||'https://'}];case _0x162f('0x3f'):return[{'name':'attrPath','value':_0x32909c['attrPath']||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x0]?_0x32909c['attrs'][0x0][_0x162f('0x3e')]:undefined)||''}];case _0x162f('0x40'):return[{'name':_0x162f('0x41'),'value':_0x32909c[_0x162f('0x41')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x0]?_0x32909c[_0x162f('0x3d')][0x0][_0x162f('0x3e')]:undefined)||_0x162f('0x42')},{'name':_0x162f('0x43'),'value':_0x32909c['attrTimezone']||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x1]?_0x32909c[_0x162f('0x3d')][0x1][_0x162f('0x3e')]:undefined)||'0.00'},{'name':_0x162f('0x44'),'value':_0x32909c[_0x162f('0x44')]||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x2]?_0x32909c[_0x162f('0x3d')][0x2][_0x162f('0x3e')]:undefined)||0xc}];case _0x162f('0x45'):return[{'name':_0x162f('0x46'),'value':_0x32909c[_0x162f('0x46')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x0]?_0x32909c[_0x162f('0x3d')][0x0][_0x162f('0x3e')]:undefined)||'total'},{'name':_0x162f('0x47'),'value':_0x32909c[_0x162f('0x47')]||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x1]?_0x32909c[_0x162f('0x3d')][0x1][_0x162f('0x3e')]:undefined)||[]},{'name':_0x162f('0x44'),'value':_0x32909c[_0x162f('0x44')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x2]?_0x32909c[_0x162f('0x3d')][0x2][_0x162f('0x3e')]:undefined)||0x14},{'name':_0x162f('0x48'),'value':_0x32909c[_0x162f('0x48')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x3]?_0x32909c[_0x162f('0x3d')][0x3]['value']:undefined)||_0x162f('0x49')},{'name':_0x162f('0x4a'),'value':_0x32909c['attrEmailAccounts']||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x4]?_0x32909c['attrs'][0x4][_0x162f('0x3e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x32909c[_0x162f('0x4b')]||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x5]?_0x32909c[_0x162f('0x3d')][0x5][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4c'),'value':_0x32909c[_0x162f('0x4c')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x6]?_0x32909c[_0x162f('0x3d')][0x6][_0x162f('0x3e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x32909c[_0x162f('0x4d')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x7]?_0x32909c[_0x162f('0x3d')][0x7][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4e'),'value':_0x32909c[_0x162f('0x4e')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x8]?_0x32909c[_0x162f('0x3d')][0x8][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4f'),'value':_0x32909c[_0x162f('0x4f')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x9]?_0x32909c['attrs'][0x9][_0x162f('0x3e')]:undefined)||''}];case'multibar-chart':case _0x162f('0x50'):return[{'name':_0x162f('0x51'),'value':_0x32909c['attrSerie1']||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x0]?_0x32909c['attrs'][0x0][_0x162f('0x3e')]:undefined)||_0x162f('0x52')},{'name':_0x162f('0x53'),'value':_0x32909c[_0x162f('0x53')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x1]?_0x32909c[_0x162f('0x3d')][0x1]['value']:undefined)||null},{'name':_0x162f('0x54'),'value':_0x32909c['attrSerie3']||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x2]?_0x32909c[_0x162f('0x3d')][0x2][_0x162f('0x3e')]:undefined)||null},{'name':_0x162f('0x47'),'value':_0x32909c['attrVoiceQueues']||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x3]?_0x32909c[_0x162f('0x3d')][0x3][_0x162f('0x3e')]:undefined)||[]},{'name':_0x162f('0x48'),'value':_0x32909c[_0x162f('0x48')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x4]?_0x32909c[_0x162f('0x3d')][0x4][_0x162f('0x3e')]:undefined)||_0x162f('0x49')},{'name':_0x162f('0x4a'),'value':_0x32909c[_0x162f('0x4a')]||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x5]?_0x32909c[_0x162f('0x3d')][0x5][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4b'),'value':_0x32909c[_0x162f('0x4b')]||(_0x32909c['attrs']&&_0x32909c[_0x162f('0x3d')][0x6]?_0x32909c[_0x162f('0x3d')][0x6][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4c'),'value':_0x32909c[_0x162f('0x4c')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x7]?_0x32909c[_0x162f('0x3d')][0x7][_0x162f('0x3e')]:undefined)||''},{'name':_0x162f('0x4d'),'value':_0x32909c[_0x162f('0x4d')]||(_0x32909c['attrs']&&_0x32909c['attrs'][0x8]?_0x32909c[_0x162f('0x3d')][0x8][_0x162f('0x3e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x32909c[_0x162f('0x4e')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x9]?_0x32909c[_0x162f('0x3d')][0x9]['value']:undefined)||''},{'name':_0x162f('0x4f'),'value':_0x32909c[_0x162f('0x4f')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0xa]?_0x32909c[_0x162f('0x3d')][0xa][_0x162f('0x3e')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x32909c[_0x162f('0x55')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x0]?_0x32909c[_0x162f('0x3d')][0x0][_0x162f('0x56')]:undefined)||null,'value':_0x32909c[_0x162f('0x57')]||(_0x32909c[_0x162f('0x3d')]&&_0x32909c['attrs'][0x0]?_0x32909c[_0x162f('0x3d')][0x0][_0x162f('0x3e')]:undefined)||null},{'name':_0x162f('0x58'),'value':_0x32909c['attrRefresh']||(_0x32909c[_0x162f('0x3d')]&&_0x32909c[_0x162f('0x3d')][0x1]?_0x32909c[_0x162f('0x3d')][0x1][_0x162f('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x2887dd){logger[_0x162f('0x59')]('widgetAttributes:\x20%s',JSON[_0x162f('0x5a')](_0x2887dd));return[];}}exports[_0x162f('0x5b')]=function(_0xfffd7a,_0x4219c8){if(_0xfffd7a[_0x162f('0x5c')]){_0xfffd7a[_0x162f('0x5c')][_0x162f('0x3d')]=widgetAttributes(_0xfffd7a['body']);}return db[_0x162f('0x2e')][_0x162f('0x5b')](_0xfffd7a[_0x162f('0x5c')],{})[_0x162f('0x29')](respondWithResult(_0x4219c8,0xc9))['catch'](handleError(_0x4219c8,null));};exports[_0x162f('0x28')]=function(_0x34941d,_0x363cf2){if(_0x34941d[_0x162f('0x5c')]['id']){delete _0x34941d[_0x162f('0x5c')]['id'];}_0x34941d[_0x162f('0x5c')]['attrs']=widgetAttributes(_0x34941d[_0x162f('0x5c')]);return db['DashboardItem'][_0x162f('0x3a')]({'where':{'id':_0x34941d[_0x162f('0x5d')]['id']}})[_0x162f('0x29')](handleEntityNotFound(_0x363cf2,null))['then'](saveUpdates(_0x34941d[_0x162f('0x5c')],null))[_0x162f('0x29')](respondWithResult(_0x363cf2,null))['catch'](handleError(_0x363cf2,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index c5977c0..a7025de 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 _0x996f=['DashboardItem','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x155e04,_0x28cd61){var _0x4590d0=function(_0x3f685b){while(--_0x3f685b){_0x155e04['push'](_0x155e04['shift']());}};_0x4590d0(++_0x28cd61);}(_0x996f,0x97));var _0xf996=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x996f[_0x3ab9ee];return _0x82ee88;};'use strict';var EventEmitter=require(_0xf996('0x0'));var DashboardItem=require(_0xf996('0x1'))['db'][_0xf996('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf996('0x3'),'afterUpdate':_0xf996('0x4'),'afterDestroy':_0xf996('0x5')};function emitEvent(_0x5dd758){return function(_0x52da08,_0x342dc0,_0x5aaa8c){DashboardItemEvents[_0xf996('0x6')](_0x5dd758+':'+_0x52da08['id'],_0x52da08);DashboardItemEvents[_0xf996('0x6')](_0x5dd758,_0x52da08);_0x5aaa8c(null);};}for(var e in events){if(events[_0xf996('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf996('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x5e2f=['remove','emit','hook','events','../../mysqldb','DashboardItem','setMaxListeners','update'];(function(_0x58f1d4,_0x1a457f){var _0x5935e9=function(_0x174e0b){while(--_0x174e0b){_0x58f1d4['push'](_0x58f1d4['shift']());}};_0x5935e9(++_0x1a457f);}(_0x5e2f,0x133));var _0xf5e2=function(_0x27e857,_0x3d9c0b){_0x27e857=_0x27e857-0x0;var _0xc14c95=_0x5e2f[_0x27e857];return _0xc14c95;};'use strict';var EventEmitter=require(_0xf5e2('0x0'));var DashboardItem=require(_0xf5e2('0x1'))['db'][_0xf5e2('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf5e2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf5e2('0x4'),'afterDestroy':_0xf5e2('0x5')};function emitEvent(_0x50d76e){return function(_0x525d02,_0x33f1d5,_0x4ed1f3){DashboardItemEvents[_0xf5e2('0x6')](_0x50d76e+':'+_0x525d02['id'],_0x525d02);DashboardItemEvents['emit'](_0x50d76e,_0x525d02);_0x4ed1f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf5e2('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ae7fd4b..20f0ee8 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 _0x09c7=['util','api','moment','bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x09c7,0x118));var _0x709c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x09c7[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x709c('0x0'));var logger=require('../../config/logger')(_0x709c('0x1'));var moment=require(_0x709c('0x2'));var BPromise=require(_0x709c('0x3'));var rp=require(_0x709c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x709c('0x5'));var config=require('../../config/environment');var attributes=require(_0x709c('0x6'));module[_0x709c('0x7')]=function(_0x426d15,_0x435eeb){return _0x426d15[_0x709c('0x8')]('DashboardItem',attributes,{'tableName':_0x709c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20e7=['./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x20e7,0x178));var _0x720e=function(_0x23a0c5,_0x3debb4){_0x23a0c5=_0x23a0c5-0x0;var _0x46d6d9=_0x20e7[_0x23a0c5];return _0x46d6d9;};'use strict';var _=require(_0x720e('0x0'));var util=require(_0x720e('0x1'));var logger=require('../../config/logger')(_0x720e('0x2'));var moment=require(_0x720e('0x3'));var BPromise=require('bluebird');var rp=require(_0x720e('0x4'));var fs=require('fs');var path=require(_0x720e('0x5'));var rimraf=require(_0x720e('0x6'));var config=require(_0x720e('0x7'));var attributes=require(_0x720e('0x8'));module['exports']=function(_0x14ff38,_0x2b2c47){return _0x14ff38[_0x720e('0x9')](_0x720e('0xa'),attributes,{'tableName':_0x720e('0xb'),'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 e9eb627..3b600df 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 _0x7417=['../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x46fc9c,_0xa27416){var _0x5311d4=function(_0x176a48){while(--_0x176a48){_0x46fc9c['push'](_0x46fc9c['shift']());}};_0x5311d4(++_0xa27416);}(_0x7417,0x133));var _0x7741=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7417[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7741('0x0'));var util=require(_0x7741('0x1'));var moment=require(_0x7741('0x2'));var BPromise=require(_0x7741('0x3'));var rs=require(_0x7741('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7741('0x5'))(_0x7741('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7741('0x7')][_0x7741('0x8')]({'port':0x232a});config[_0x7741('0x9')]=_[_0x7741('0xa')](config[_0x7741('0x9')],{'host':_0x7741('0xb'),'port':0x18eb});var socket=require(_0x7741('0xc'))(new Redis(config[_0x7741('0x9')]));require(_0x7741('0xd'))[_0x7741('0xe')](socket);function respondWithRpcPromise(_0x3a787c,_0x153bfc,_0x493424){return new BPromise(function(_0xba5e65,_0x254e3d){return client[_0x7741('0xf')](_0x3a787c,_0x493424)[_0x7741('0x10')](function(_0x1acfd2){logger[_0x7741('0x11')](_0x7741('0x12'),_0x153bfc,_0x7741('0x13'));logger[_0x7741('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x153bfc,_0x7741('0x13'),JSON[_0x7741('0x15')](_0x1acfd2));if(_0x1acfd2[_0x7741('0x16')]){if(_0x1acfd2['error']['code']===0x1f4){logger[_0x7741('0x16')](_0x7741('0x12'),_0x153bfc,_0x1acfd2[_0x7741('0x16')][_0x7741('0x17')]);return _0x254e3d(_0x1acfd2['error'][_0x7741('0x17')]);}logger['error'](_0x7741('0x12'),_0x153bfc,_0x1acfd2[_0x7741('0x16')][_0x7741('0x17')]);return _0xba5e65(_0x1acfd2[_0x7741('0x16')]['message']);}else{logger[_0x7741('0x11')](_0x7741('0x12'),_0x153bfc,_0x7741('0x13'));_0xba5e65(_0x1acfd2[_0x7741('0x18')][_0x7741('0x17')]);}})[_0x7741('0x19')](function(_0x4e2220){logger[_0x7741('0x16')]('DashboardItem,\x20%s,\x20%s',_0x153bfc,_0x4e2220);_0x254e3d(_0x4e2220);});});} \ No newline at end of file +var _0xfefa=['client','redis','socket.io-emitter','./dashboardItem.socket','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfefa,0x10d));var _0xafef=function(_0x1c077c,_0x5e5e18){_0x1c077c=_0x1c077c-0x0;var _0x1d010a=_0xfefa[_0x1c077c];return _0x1d010a;};'use strict';var _=require(_0xafef('0x0'));var util=require(_0xafef('0x1'));var moment=require('moment');var BPromise=require(_0xafef('0x2'));var rs=require(_0xafef('0x3'));var fs=require('fs');var Redis=require(_0xafef('0x4'));var db=require(_0xafef('0x5'))['db'];var utils=require(_0xafef('0x6'));var logger=require(_0xafef('0x7'))(_0xafef('0x8'));var config=require(_0xafef('0x9'));var jayson=require(_0xafef('0xa'));var client=jayson[_0xafef('0xb')]['http']({'port':0x232a});config[_0xafef('0xc')]=_['defaults'](config[_0xafef('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xafef('0xd'))(new Redis(config[_0xafef('0xc')]));require(_0xafef('0xe'))['register'](socket);function respondWithRpcPromise(_0x5344fc,_0x3b0f8d,_0x3414fb){return new BPromise(function(_0x52e8d5,_0x2d23b2){return client[_0xafef('0xf')](_0x5344fc,_0x3414fb)[_0xafef('0x10')](function(_0x110b5d){logger[_0xafef('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3b0f8d,_0xafef('0x12'));logger[_0xafef('0x13')](_0xafef('0x14'),_0x3b0f8d,_0xafef('0x12'),JSON[_0xafef('0x15')](_0x110b5d));if(_0x110b5d['error']){if(_0x110b5d[_0xafef('0x16')][_0xafef('0x17')]===0x1f4){logger[_0xafef('0x16')](_0xafef('0x18'),_0x3b0f8d,_0x110b5d[_0xafef('0x16')][_0xafef('0x19')]);return _0x2d23b2(_0x110b5d[_0xafef('0x16')]['message']);}logger[_0xafef('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3b0f8d,_0x110b5d['error'][_0xafef('0x19')]);return _0x52e8d5(_0x110b5d[_0xafef('0x16')][_0xafef('0x19')]);}else{logger[_0xafef('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3b0f8d,_0xafef('0x12'));_0x52e8d5(_0x110b5d[_0xafef('0x1a')][_0xafef('0x19')]);}})[_0xafef('0x1b')](function(_0x2a5521){logger[_0xafef('0x16')](_0xafef('0x18'),_0x3b0f8d,_0x2a5521);_0x2d23b2(_0x2a5521);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cf89786..17867ff 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 _0x1db5=['emit','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x3d8d0a,_0x11bb87){var _0x5b9df5=function(_0x3ecba2){while(--_0x3ecba2){_0x3d8d0a['push'](_0x3d8d0a['shift']());}};_0x5b9df5(++_0x11bb87);}(_0x1db5,0x115));var _0x51db=function(_0x5b0b5f,_0x318bb5){_0x5b0b5f=_0x5b0b5f-0x0;var _0xbd6084=_0x1db5[_0x5b0b5f];return _0xbd6084;};'use strict';var DashboardItemEvents=require(_0x51db('0x0'));var events=[_0x51db('0x1'),_0x51db('0x2'),'update'];function createListener(_0x445ec2,_0x2d5519){return function(_0xee1ad0){_0x2d5519[_0x51db('0x3')](_0x445ec2,_0xee1ad0);};}function removeListener(_0x5623c0,_0x59a7c7){return function(){DashboardItemEvents['removeListener'](_0x5623c0,_0x59a7c7);};}exports[_0x51db('0x4')]=function(_0xd654e9){for(var _0x5bb78a=0x0,_0x5b3d6e=events[_0x51db('0x5')];_0x5bb78a<_0x5b3d6e;_0x5bb78a++){var _0x5ecd40=events[_0x5bb78a];var _0x41e392=createListener(_0x51db('0x6')+_0x5ecd40,_0xd654e9);DashboardItemEvents['on'](_0x5ecd40,_0x41e392);}}; \ No newline at end of file +var _0x29df=['dashboardItem:','save','remove','update','removeListener'];(function(_0x38aa32,_0x327f59){var _0x943164=function(_0x1a347a){while(--_0x1a347a){_0x38aa32['push'](_0x38aa32['shift']());}};_0x943164(++_0x327f59);}(_0x29df,0xb5));var _0xf29d=function(_0xe42045,_0x41cd3c){_0xe42045=_0xe42045-0x0;var _0x3e4772=_0x29df[_0xe42045];return _0x3e4772;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf29d('0x0'),_0xf29d('0x1'),_0xf29d('0x2')];function createListener(_0x572971,_0x1b0d30){return function(_0x5b2cec){_0x1b0d30['emit'](_0x572971,_0x5b2cec);};}function removeListener(_0x3b317f,_0x1c02ee){return function(){DashboardItemEvents[_0xf29d('0x3')](_0x3b317f,_0x1c02ee);};}exports['register']=function(_0x3aed18){for(var _0x24a69a=0x0,_0x567f2=events['length'];_0x24a69a<_0x567f2;_0x24a69a++){var _0x235825=events[_0x24a69a];var _0x2626c4=createListener(_0xf29d('0x4')+_0x235825,_0x3aed18);DashboardItemEvents['on'](_0x235825,_0x2626c4);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d34c783..4566605 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 _0x874f=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboardItem.controller','get','/:id','isAuthenticated','show'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x874f,0x71));var _0xf874=function(_0x3b14ad,_0x5e4401){_0x3b14ad=_0x3b14ad-0x0;var _0x392677=_0x874f[_0x3b14ad];return _0x392677;};'use strict';var multer=require(_0xf874('0x0'));var util=require(_0xf874('0x1'));var path=require(_0xf874('0x2'));var timeout=require(_0xf874('0x3'));var express=require(_0xf874('0x4'));var router=express[_0xf874('0x5')]();var fs_extra=require(_0xf874('0x6'));var auth=require(_0xf874('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf874('0x8'));router[_0xf874('0x9')](_0xf874('0xa'),auth[_0xf874('0xb')](),controller[_0xf874('0xc')]);router['post']('/',auth[_0xf874('0xb')](),controller[_0xf874('0xd')]);router[_0xf874('0xe')]('/:id',auth[_0xf874('0xb')](),controller[_0xf874('0xf')]);router['delete'](_0xf874('0xa'),auth[_0xf874('0xb')](),controller[_0xf874('0x10')]);module[_0xf874('0x11')]=router; \ No newline at end of file +var _0xa893=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','path'];(function(_0x150a67,_0x4406ca){var _0x505c8f=function(_0x5278ba){while(--_0x5278ba){_0x150a67['push'](_0x150a67['shift']());}};_0x505c8f(++_0x4406ca);}(_0xa893,0x11f));var _0x3a89=function(_0x1067a9,_0x5b8436){_0x1067a9=_0x1067a9-0x0;var _0xc2153a=_0xa893[_0x1067a9];return _0xc2153a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a89('0x0'));var timeout=require(_0x3a89('0x1'));var express=require('express');var router=express[_0x3a89('0x2')]();var fs_extra=require(_0x3a89('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3a89('0x4'));var config=require(_0x3a89('0x5'));var controller=require('./dashboardItem.controller');router[_0x3a89('0x6')](_0x3a89('0x7'),auth['isAuthenticated'](),controller[_0x3a89('0x8')]);router[_0x3a89('0x9')]('/',auth[_0x3a89('0xa')](),controller[_0x3a89('0xb')]);router[_0x3a89('0xc')](_0x3a89('0x7'),auth[_0x3a89('0xa')](),controller['update']);router[_0x3a89('0xd')](_0x3a89('0x7'),auth[_0x3a89('0xa')](),controller[_0x3a89('0xe')]);module[_0x3a89('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7b62607..6e2e4c8 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 _0x1bec=['STRING','first','second','third','sequelize','exports'];(function(_0x44d428,_0x317ab0){var _0x506124=function(_0x35ca05){while(--_0x35ca05){_0x44d428['push'](_0x44d428['shift']());}};_0x506124(++_0x317ab0);}(_0x1bec,0x1de));var _0xc1be=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x1bec[_0x258fb0];return _0x4d1afe;};'use strict';var Sequelize=require(_0xc1be('0x0'));module[_0xc1be('0x1')]={'name':{'type':Sequelize[_0xc1be('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xc1be('0x3'),_0xc1be('0x4'),_0xc1be('0x5')),'allowNull':![],'defaultValue':_0xc1be('0x3')},'description':{'type':Sequelize[_0xc1be('0x2')]}}; \ No newline at end of file +var _0x62ad=['third','sequelize','exports','STRING','ENUM','first'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x62ad,0x175));var _0xd62a=function(_0x7c7f,_0x2d0723){_0x7c7f=_0x7c7f-0x0;var _0x49df12=_0x62ad[_0x7c7f];return _0x49df12;};'use strict';var Sequelize=require(_0xd62a('0x0'));module[_0xd62a('0x1')]={'name':{'type':Sequelize[_0xd62a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xd62a('0x3')](_0xd62a('0x4'),'second',_0xd62a('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ba08797..269b59e 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 _0x2db5=['Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','find','rimraf','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set'];(function(_0x464cde,_0x383009){var _0x190615=function(_0x12c029){while(--_0x12c029){_0x464cde['push'](_0x464cde['shift']());}};_0x190615(++_0x383009);}(_0x2db5,0x168));var _0x52db=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x2db5[_0x4eb6ec];return _0x58881b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x52db('0x1'));var moment=require('moment');var BPromise=require(_0x52db('0x2'));var Mustache=require('mustache');var util=require(_0x52db('0x3'));var path=require('path');var sox=require(_0x52db('0x4'));var csv=require('to-csv');var ejs=require(_0x52db('0x5'));var fs=require('fs');var fs_extra=require(_0x52db('0x6'));var _=require(_0x52db('0x7'));var squel=require(_0x52db('0x8'));var crypto=require(_0x52db('0x9'));var jsforce=require(_0x52db('0xa'));var deskjs=require(_0x52db('0xb'));var toCsv=require(_0x52db('0xc'));var querystring=require(_0x52db('0xd'));var Papa=require('papaparse');var Redis=require(_0x52db('0xe'));var authService=require(_0x52db('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52db('0x10'));var logger=require(_0x52db('0x11'))(_0x52db('0x12'));var utils=require(_0x52db('0x13'));var config=require(_0x52db('0x14'));var licenseUtil=require(_0x52db('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3423fd,_0x2a698b){_0x2a698b=_0x2a698b||0xcc;return function(_0x464621){if(_0x464621){return _0x3423fd[_0x52db('0x16')](_0x2a698b);}return _0x3423fd['status'](_0x2a698b)[_0x52db('0x17')]();};}function respondWithResult(_0x5bae38,_0x561cf7){_0x561cf7=_0x561cf7||0xc8;return function(_0x47b21d){if(_0x47b21d){return _0x5bae38[_0x52db('0x18')](_0x561cf7)[_0x52db('0x19')](_0x47b21d);}};}function respondWithFilteredResult(_0x565e6c,_0x2a9c89){return function(_0x133747){if(_0x133747){var _0x491023=typeof _0x2a9c89[_0x52db('0x1a')]===_0x52db('0x1b')&&typeof _0x2a9c89['limit']==='undefined';var _0x4f280c=_0x133747['count'];var _0x4efee7=_0x491023?0x0:_0x2a9c89[_0x52db('0x1a')];var _0x49c6d8=_0x491023?_0x133747[_0x52db('0x1c')]:_0x2a9c89[_0x52db('0x1a')]+_0x2a9c89['limit'];var _0xf54426;if(_0x49c6d8>=_0x4f280c){_0x49c6d8=_0x4f280c;_0xf54426=0xc8;}else{_0xf54426=0xce;}_0x565e6c['status'](_0xf54426);return _0x565e6c[_0x52db('0x1d')](_0x52db('0x1e'),_0x4efee7+'-'+_0x49c6d8+'/'+_0x4f280c)[_0x52db('0x19')](_0x133747);}return null;};}function patchUpdates(_0xf3bd26){return function(_0x57d4c8){try{jsonpatch[_0x52db('0x1f')](_0x57d4c8,_0xf3bd26,!![]);}catch(_0x326cb7){return BPromise[_0x52db('0x20')](_0x326cb7);}return _0x57d4c8[_0x52db('0x21')]();};}function saveUpdates(_0x53b6b1,_0x31ef34){return function(_0x47034f){if(_0x47034f){return _0x47034f[_0x52db('0x22')](_0x53b6b1)[_0x52db('0x23')](function(_0x446ac0){return _0x446ac0;});}return null;};}function removeEntity(_0xcfdef8,_0x2e967a){return function(_0x44668b){if(_0x44668b){return _0x44668b[_0x52db('0x24')]()[_0x52db('0x23')](function(){var _0x24d395=_0x44668b[_0x52db('0x25')]({'plain':!![]});var _0x57d8c6=_0x52db('0x26');return db[_0x52db('0x27')][_0x52db('0x24')]({'where':{'type':_0x57d8c6,'resourceId':_0x24d395['id']}})[_0x52db('0x23')](function(){return _0x44668b;});})[_0x52db('0x23')](function(){_0xcfdef8['status'](0xcc)[_0x52db('0x17')]();});}};}function handleEntityNotFound(_0x3dac3a,_0x193a03){return function(_0x574d27){if(!_0x574d27){_0x3dac3a['sendStatus'](0x194);}return _0x574d27;};}function handleError(_0x439bc5,_0x52c318){_0x52c318=_0x52c318||0x1f4;return function(_0x13c7c6){logger[_0x52db('0x28')](_0x13c7c6['stack']);if(_0x13c7c6[_0x52db('0x29')]){delete _0x13c7c6[_0x52db('0x29')];}_0x439bc5[_0x52db('0x18')](_0x52c318)['send'](_0x13c7c6);};}exports[_0x52db('0x2a')]=function(_0x96c2c5,_0x50b94c){var _0x347264={},_0x41a006={},_0x33cd9d={'count':0x0,'rows':[]};var _0x3442fe=_[_0x52db('0x2b')](db['Disposition'][_0x52db('0x2c')],function(_0x57f2c7){return{'name':_0x57f2c7['fieldName'],'type':_0x57f2c7[_0x52db('0x2d')]['key']};});_0x41a006['model']=_[_0x52db('0x2b')](_0x3442fe,_0x52db('0x29'));_0x41a006[_0x52db('0x2e')]=_[_0x52db('0x2f')](_0x96c2c5[_0x52db('0x2e')]);_0x41a006[_0x52db('0x30')]=_[_0x52db('0x31')](_0x41a006[_0x52db('0x32')],_0x41a006[_0x52db('0x2e')]);_0x347264[_0x52db('0x33')]=_['intersection'](_0x41a006[_0x52db('0x32')],qs[_0x52db('0x34')](_0x96c2c5[_0x52db('0x2e')]['fields']));_0x347264[_0x52db('0x33')]=_0x347264[_0x52db('0x33')][_0x52db('0x35')]?_0x347264['attributes']:_0x41a006[_0x52db('0x32')];if(!_0x96c2c5['query'][_0x52db('0x36')](_0x52db('0x37'))){_0x347264[_0x52db('0x38')]=qs[_0x52db('0x38')](_0x96c2c5[_0x52db('0x2e')]['limit']);_0x347264[_0x52db('0x1a')]=qs[_0x52db('0x1a')](_0x96c2c5['query'][_0x52db('0x1a')]);}_0x347264[_0x52db('0x39')]=qs[_0x52db('0x3a')](_0x96c2c5[_0x52db('0x2e')]['sort']);_0x347264[_0x52db('0x3b')]=qs['filters'](_[_0x52db('0x3c')](_0x96c2c5[_0x52db('0x2e')],_0x41a006[_0x52db('0x30')]),_0x3442fe);if(_0x96c2c5[_0x52db('0x2e')][_0x52db('0x3d')]){_0x347264['where']=_[_0x52db('0x3e')](_0x347264['where'],{'$or':_[_0x52db('0x2b')](_0x3442fe,function(_0x4828f9){if(_0x4828f9[_0x52db('0x2d')]!==_0x52db('0x3f')){var _0x1928fc={};_0x1928fc[_0x4828f9[_0x52db('0x29')]]={'$like':'%'+_0x96c2c5[_0x52db('0x2e')][_0x52db('0x3d')]+'%'};return _0x1928fc;}})});}_0x347264=_[_0x52db('0x3e')]({},_0x347264,_0x96c2c5[_0x52db('0x40')]);var _0x405de0={'where':_0x347264[_0x52db('0x3b')]};return db[_0x52db('0x41')][_0x52db('0x1c')](_0x405de0)['then'](function(_0x40fe58){_0x33cd9d['count']=_0x40fe58;if(_0x96c2c5[_0x52db('0x2e')][_0x52db('0x42')]){_0x347264[_0x52db('0x43')]=[{'all':!![]}];}return db[_0x52db('0x41')]['findAll'](_0x347264);})[_0x52db('0x23')](function(_0x45d66b){_0x33cd9d[_0x52db('0x44')]=_0x45d66b;return _0x33cd9d;})[_0x52db('0x23')](respondWithFilteredResult(_0x50b94c,_0x347264))['catch'](handleError(_0x50b94c,null));};exports['show']=function(_0x2eff70,_0x13cb59){var _0x100394={'raw':!![],'where':{'id':_0x2eff70[_0x52db('0x45')]['id']}},_0x1f8d64={};_0x1f8d64['model']=_[_0x52db('0x2f')](db[_0x52db('0x41')][_0x52db('0x2c')]);_0x1f8d64[_0x52db('0x2e')]=_[_0x52db('0x2f')](_0x2eff70[_0x52db('0x2e')]);_0x1f8d64[_0x52db('0x30')]=_['intersection'](_0x1f8d64[_0x52db('0x32')],_0x1f8d64['query']);_0x100394[_0x52db('0x33')]=_[_0x52db('0x31')](_0x1f8d64[_0x52db('0x32')],qs[_0x52db('0x34')](_0x2eff70[_0x52db('0x2e')][_0x52db('0x34')]));_0x100394[_0x52db('0x33')]=_0x100394['attributes'][_0x52db('0x35')]?_0x100394[_0x52db('0x33')]:_0x1f8d64['model'];if(_0x2eff70[_0x52db('0x2e')]['includeAll']){_0x100394['include']=[{'all':!![]}];}_0x100394=_[_0x52db('0x3e')]({},_0x100394,_0x2eff70[_0x52db('0x40')]);return db[_0x52db('0x41')]['find'](_0x100394)['then'](handleEntityNotFound(_0x13cb59,null))[_0x52db('0x23')](respondWithResult(_0x13cb59,null))['catch'](handleError(_0x13cb59,null));};exports[_0x52db('0x46')]=function(_0x44efb5,_0x146143){return db[_0x52db('0x41')]['create'](_0x44efb5[_0x52db('0x47')],{})[_0x52db('0x23')](function(_0x52f635){var _0x125623=_0x44efb5[_0x52db('0x48')][_0x52db('0x25')]({'plain':!![]});if(!_0x125623)throw new Error(_0x52db('0x49'));if(_0x125623[_0x52db('0x4a')]===_0x52db('0x48')){var _0x2b5d67=_0x52f635['get']({'plain':!![]});var _0x32aa6b=_0x52db('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x32aa6b,'userProfileId':_0x125623['userProfileId']},'raw':!![]})[_0x52db('0x23')](function(_0x35987b){if(_0x35987b&&_0x35987b['autoAssociation']===0x0){return db[_0x52db('0x27')][_0x52db('0x46')]({'name':_0x2b5d67[_0x52db('0x29')],'resourceId':_0x2b5d67['id'],'type':_0x35987b[_0x52db('0x29')],'sectionId':_0x35987b['id']},{})[_0x52db('0x23')](function(){return _0x52f635;});}else{return _0x52f635;}})['catch'](function(_0x5445fc){logger['error'](_0x52db('0x4b'),_0x5445fc);throw _0x5445fc;});}return _0x52f635;})[_0x52db('0x23')](respondWithResult(_0x146143,0xc9))[_0x52db('0x4c')](handleError(_0x146143,null));};exports[_0x52db('0x22')]=function(_0x551913,_0x50c4ad){if(_0x551913[_0x52db('0x47')]['id']){delete _0x551913[_0x52db('0x47')]['id'];}return db[_0x52db('0x41')][_0x52db('0x4d')]({'where':{'id':_0x551913[_0x52db('0x45')]['id']}})[_0x52db('0x23')](handleEntityNotFound(_0x50c4ad,null))[_0x52db('0x23')](saveUpdates(_0x551913[_0x52db('0x47')],null))['then'](respondWithResult(_0x50c4ad,null))[_0x52db('0x4c')](handleError(_0x50c4ad,null));};exports['destroy']=function(_0x38c2c4,_0x5b5a70){return db[_0x52db('0x41')][_0x52db('0x4d')]({'where':{'id':_0x38c2c4['params']['id']}})[_0x52db('0x23')](handleEntityNotFound(_0x5b5a70,null))['then'](removeEntity(_0x5b5a70,null))[_0x52db('0x4c')](handleError(_0x5b5a70,null));}; \ No newline at end of file +var _0xe74c=['end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Dispositions','UserProfileResource','destroy','stack','name','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','Disposition','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe74c,0x1d3));var _0xce74=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe74c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xce74('0x0'));var rimraf=require(_0xce74('0x1'));var zipdir=require(_0xce74('0x2'));var jsonpatch=require(_0xce74('0x3'));var rp=require('request-promise');var moment=require(_0xce74('0x4'));var BPromise=require(_0xce74('0x5'));var Mustache=require(_0xce74('0x6'));var util=require(_0xce74('0x7'));var path=require(_0xce74('0x8'));var sox=require(_0xce74('0x9'));var csv=require(_0xce74('0xa'));var ejs=require(_0xce74('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce74('0xc'));var squel=require(_0xce74('0xd'));var crypto=require('crypto');var jsforce=require(_0xce74('0xe'));var deskjs=require(_0xce74('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce74('0x10'));var Redis=require(_0xce74('0x11'));var authService=require(_0xce74('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xce74('0x13'));var hardwareService=require(_0xce74('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xce74('0x15'));var config=require(_0xce74('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xce74('0x17'))['db'];function respondWithStatusCode(_0x15ea9b,_0x3f884e){_0x3f884e=_0x3f884e||0xcc;return function(_0x25e77f){if(_0x25e77f){return _0x15ea9b['sendStatus'](_0x3f884e);}return _0x15ea9b[_0xce74('0x18')](_0x3f884e)[_0xce74('0x19')]();};}function respondWithResult(_0x53bcc0,_0xa8ab94){_0xa8ab94=_0xa8ab94||0xc8;return function(_0x16e2d0){if(_0x16e2d0){return _0x53bcc0[_0xce74('0x18')](_0xa8ab94)[_0xce74('0x1a')](_0x16e2d0);}};}function respondWithFilteredResult(_0x5b19df,_0x395714){return function(_0xdfda43){if(_0xdfda43){var _0x2280c6=typeof _0x395714[_0xce74('0x1b')]===_0xce74('0x1c')&&typeof _0x395714[_0xce74('0x1d')]==='undefined';var _0x1f564f=_0xdfda43[_0xce74('0x1e')];var _0x239d84=_0x2280c6?0x0:_0x395714['offset'];var _0x475ae8=_0x2280c6?_0xdfda43[_0xce74('0x1e')]:_0x395714[_0xce74('0x1b')]+_0x395714['limit'];var _0x1b45f4;if(_0x475ae8>=_0x1f564f){_0x475ae8=_0x1f564f;_0x1b45f4=0xc8;}else{_0x1b45f4=0xce;}_0x5b19df[_0xce74('0x18')](_0x1b45f4);return _0x5b19df[_0xce74('0x1f')](_0xce74('0x20'),_0x239d84+'-'+_0x475ae8+'/'+_0x1f564f)[_0xce74('0x1a')](_0xdfda43);}return null;};}function patchUpdates(_0x21fd52){return function(_0x4ad6e2){try{jsonpatch[_0xce74('0x21')](_0x4ad6e2,_0x21fd52,!![]);}catch(_0x5417b4){return BPromise['reject'](_0x5417b4);}return _0x4ad6e2['save']();};}function saveUpdates(_0x386958,_0x13361b){return function(_0x3a01a3){if(_0x3a01a3){return _0x3a01a3[_0xce74('0x22')](_0x386958)['then'](function(_0x49b849){return _0x49b849;});}return null;};}function removeEntity(_0x3f13d4,_0x840d7d){return function(_0x55b0be){if(_0x55b0be){return _0x55b0be['destroy']()[_0xce74('0x23')](function(){var _0x3997c2=_0x55b0be[_0xce74('0x24')]({'plain':!![]});var _0x54ee3f=_0xce74('0x25');return db[_0xce74('0x26')][_0xce74('0x27')]({'where':{'type':_0x54ee3f,'resourceId':_0x3997c2['id']}})[_0xce74('0x23')](function(){return _0x55b0be;});})[_0xce74('0x23')](function(){_0x3f13d4[_0xce74('0x18')](0xcc)[_0xce74('0x19')]();});}};}function handleEntityNotFound(_0x1dd2a6,_0x76ea2a){return function(_0x548b95){if(!_0x548b95){_0x1dd2a6['sendStatus'](0x194);}return _0x548b95;};}function handleError(_0x4a2160,_0xd503f){_0xd503f=_0xd503f||0x1f4;return function(_0x41fa12){logger['error'](_0x41fa12[_0xce74('0x28')]);if(_0x41fa12[_0xce74('0x29')]){delete _0x41fa12['name'];}_0x4a2160['status'](_0xd503f)['send'](_0x41fa12);};}exports['index']=function(_0x57b80d,_0x265110){var _0x3c4006={},_0x303402={},_0x2cf2c3={'count':0x0,'rows':[]};var _0xc81a7a=_[_0xce74('0x2a')](db['Disposition']['rawAttributes'],function(_0x11c804){return{'name':_0x11c804[_0xce74('0x2b')],'type':_0x11c804['type'][_0xce74('0x2c')]};});_0x303402[_0xce74('0x2d')]=_[_0xce74('0x2a')](_0xc81a7a,_0xce74('0x29'));_0x303402[_0xce74('0x2e')]=_['keys'](_0x57b80d[_0xce74('0x2e')]);_0x303402[_0xce74('0x2f')]=_[_0xce74('0x30')](_0x303402[_0xce74('0x2d')],_0x303402[_0xce74('0x2e')]);_0x3c4006[_0xce74('0x31')]=_[_0xce74('0x30')](_0x303402[_0xce74('0x2d')],qs[_0xce74('0x32')](_0x57b80d[_0xce74('0x2e')]['fields']));_0x3c4006[_0xce74('0x31')]=_0x3c4006[_0xce74('0x31')][_0xce74('0x33')]?_0x3c4006[_0xce74('0x31')]:_0x303402[_0xce74('0x2d')];if(!_0x57b80d[_0xce74('0x2e')][_0xce74('0x34')](_0xce74('0x35'))){_0x3c4006[_0xce74('0x1d')]=qs[_0xce74('0x1d')](_0x57b80d[_0xce74('0x2e')][_0xce74('0x1d')]);_0x3c4006[_0xce74('0x1b')]=qs[_0xce74('0x1b')](_0x57b80d[_0xce74('0x2e')][_0xce74('0x1b')]);}_0x3c4006[_0xce74('0x36')]=qs[_0xce74('0x37')](_0x57b80d[_0xce74('0x2e')][_0xce74('0x37')]);_0x3c4006[_0xce74('0x38')]=qs[_0xce74('0x2f')](_[_0xce74('0x39')](_0x57b80d[_0xce74('0x2e')],_0x303402[_0xce74('0x2f')]),_0xc81a7a);if(_0x57b80d[_0xce74('0x2e')][_0xce74('0x3a')]){_0x3c4006[_0xce74('0x38')]=_[_0xce74('0x3b')](_0x3c4006[_0xce74('0x38')],{'$or':_[_0xce74('0x2a')](_0xc81a7a,function(_0x4e8421){if(_0x4e8421[_0xce74('0x3c')]!==_0xce74('0x3d')){var _0x60495={};_0x60495[_0x4e8421['name']]={'$like':'%'+_0x57b80d[_0xce74('0x2e')][_0xce74('0x3a')]+'%'};return _0x60495;}})});}_0x3c4006=_['merge']({},_0x3c4006,_0x57b80d[_0xce74('0x3e')]);var _0x545353={'where':_0x3c4006['where']};return db['Disposition'][_0xce74('0x1e')](_0x545353)[_0xce74('0x23')](function(_0x14eedd){_0x2cf2c3[_0xce74('0x1e')]=_0x14eedd;if(_0x57b80d[_0xce74('0x2e')][_0xce74('0x3f')]){_0x3c4006['include']=[{'all':!![]}];}return db['Disposition'][_0xce74('0x40')](_0x3c4006);})[_0xce74('0x23')](function(_0x2c9231){_0x2cf2c3[_0xce74('0x41')]=_0x2c9231;return _0x2cf2c3;})['then'](respondWithFilteredResult(_0x265110,_0x3c4006))[_0xce74('0x42')](handleError(_0x265110,null));};exports[_0xce74('0x43')]=function(_0xa6a174,_0x55130c){var _0x20f7d2={'raw':!![],'where':{'id':_0xa6a174[_0xce74('0x44')]['id']}},_0x384a1e={};_0x384a1e[_0xce74('0x2d')]=_[_0xce74('0x45')](db[_0xce74('0x46')][_0xce74('0x47')]);_0x384a1e['query']=_[_0xce74('0x45')](_0xa6a174['query']);_0x384a1e[_0xce74('0x2f')]=_['intersection'](_0x384a1e[_0xce74('0x2d')],_0x384a1e['query']);_0x20f7d2[_0xce74('0x31')]=_['intersection'](_0x384a1e['model'],qs[_0xce74('0x32')](_0xa6a174['query'][_0xce74('0x32')]));_0x20f7d2[_0xce74('0x31')]=_0x20f7d2[_0xce74('0x31')][_0xce74('0x33')]?_0x20f7d2[_0xce74('0x31')]:_0x384a1e[_0xce74('0x2d')];if(_0xa6a174[_0xce74('0x2e')]['includeAll']){_0x20f7d2[_0xce74('0x48')]=[{'all':!![]}];}_0x20f7d2=_['merge']({},_0x20f7d2,_0xa6a174[_0xce74('0x3e')]);return db[_0xce74('0x46')]['find'](_0x20f7d2)[_0xce74('0x23')](handleEntityNotFound(_0x55130c,null))['then'](respondWithResult(_0x55130c,null))[_0xce74('0x42')](handleError(_0x55130c,null));};exports['create']=function(_0x5d75ee,_0x4664fe){return db['Disposition'][_0xce74('0x49')](_0x5d75ee[_0xce74('0x4a')],{})['then'](function(_0x8faec4){var _0x14e9cb=_0x5d75ee[_0xce74('0x4b')][_0xce74('0x24')]({'plain':!![]});if(!_0x14e9cb)throw new Error(_0xce74('0x4c'));if(_0x14e9cb['role']===_0xce74('0x4b')){var _0x40d12b=_0x8faec4['get']({'plain':!![]});var _0x564865=_0xce74('0x25');return db[_0xce74('0x4d')]['find']({'where':{'name':_0x564865,'userProfileId':_0x14e9cb[_0xce74('0x4e')]},'raw':!![]})[_0xce74('0x23')](function(_0x6db5a2){if(_0x6db5a2&&_0x6db5a2[_0xce74('0x4f')]===0x0){return db['UserProfileResource'][_0xce74('0x49')]({'name':_0x40d12b[_0xce74('0x29')],'resourceId':_0x40d12b['id'],'type':_0x6db5a2[_0xce74('0x29')],'sectionId':_0x6db5a2['id']},{})[_0xce74('0x23')](function(){return _0x8faec4;});}else{return _0x8faec4;}})[_0xce74('0x42')](function(_0x2813d7){logger[_0xce74('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2813d7);throw _0x2813d7;});}return _0x8faec4;})[_0xce74('0x23')](respondWithResult(_0x4664fe,0xc9))[_0xce74('0x42')](handleError(_0x4664fe,null));};exports[_0xce74('0x22')]=function(_0x383506,_0x4772ec){if(_0x383506[_0xce74('0x4a')]['id']){delete _0x383506[_0xce74('0x4a')]['id'];}return db[_0xce74('0x46')][_0xce74('0x51')]({'where':{'id':_0x383506[_0xce74('0x44')]['id']}})['then'](handleEntityNotFound(_0x4772ec,null))['then'](saveUpdates(_0x383506[_0xce74('0x4a')],null))[_0xce74('0x23')](respondWithResult(_0x4772ec,null))[_0xce74('0x42')](handleError(_0x4772ec,null));};exports[_0xce74('0x27')]=function(_0x1be54c,_0x3c6138){return db[_0xce74('0x46')][_0xce74('0x51')]({'where':{'id':_0x1be54c[_0xce74('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c6138,null))[_0xce74('0x23')](removeEntity(_0x3c6138,null))['catch'](handleError(_0x3c6138,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 31bd877..c1cf86a 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 _0x13c5=['../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x13c5,0x1c8));var _0x513c=function(_0x130186,_0x5d8a11){_0x130186=_0x130186-0x0;var _0x1defc3=_0x13c5[_0x130186];return _0x1defc3;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var logger=require(_0x513c('0x1'))('api');var moment=require(_0x513c('0x2'));var BPromise=require(_0x513c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x513c('0x4'));var rimraf=require(_0x513c('0x5'));var config=require(_0x513c('0x6'));var attributes=require(_0x513c('0x7'));module[_0x513c('0x8')]=function(_0x23c463,_0x28f321){return _0x23c463['define'](_0x513c('0x9'),attributes,{'tableName':_0x513c('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x513c('0xb'),'fields':[_0x513c('0xc'),_0x513c('0xd')]},{'unique':!![],'name':_0x513c('0xe'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x513c('0xc'),_0x513c('0xf')]},{'unique':!![],'name':_0x513c('0x10'),'fields':[_0x513c('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x513c('0x11'),'fields':['name',_0x513c('0x12')]},{'unique':!![],'name':_0x513c('0x13'),'fields':[_0x513c('0xc'),_0x513c('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x725a=['SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x725a,0x119));var _0xa725=function(_0x573ace,_0x5f5c56){_0x573ace=_0x573ace-0x0;var _0x6059c1=_0x725a[_0x573ace];return _0x6059c1;};'use strict';var _=require('lodash');var util=require(_0xa725('0x0'));var logger=require(_0xa725('0x1'))(_0xa725('0x2'));var moment=require(_0xa725('0x3'));var BPromise=require(_0xa725('0x4'));var rp=require(_0xa725('0x5'));var fs=require('fs');var path=require(_0xa725('0x6'));var rimraf=require(_0xa725('0x7'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xa725('0x8')]=function(_0x4cb4ba,_0x37a48c){return _0x4cb4ba[_0xa725('0x9')](_0xa725('0xa'),attributes,{'tableName':_0xa725('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa725('0xc'),'fields':[_0xa725('0xd'),_0xa725('0xe')]},{'unique':!![],'name':_0xa725('0xf'),'fields':[_0xa725('0xd'),_0xa725('0x10')]},{'unique':!![],'name':_0xa725('0x11'),'fields':[_0xa725('0xd'),_0xa725('0x12')]},{'unique':!![],'name':'name_sms','fields':['name',_0xa725('0x13')]},{'unique':!![],'name':_0xa725('0x14'),'fields':[_0xa725('0xd'),_0xa725('0x15')]},{'unique':!![],'name':_0xa725('0x16'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0xa725('0x17'),'fields':[_0xa725('0xd'),_0xa725('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 49c0d3f..a8e723e 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(_0x3c3a38,_0x3e506d){var _0x308fce=function(_0x28ae65){while(--_0x28ae65){_0x3c3a38['push'](_0x3c3a38['shift']());}};_0x308fce(++_0x3e506d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1db476,_0x55946b){var _0x17d850=function(_0x4471e5){while(--_0x4471e5){_0x1db476['push'](_0x1db476['shift']());}};_0x17d850(++_0x55946b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 78b1700..e9bd4af 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 _0xc564=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc564,0xf7));var _0x4c56=function(_0x149a00,_0x26f485){_0x149a00=_0x149a00-0x0;var _0x413d13=_0xc564[_0x149a00];return _0x413d13;};'use strict';var multer=require('multer');var util=require(_0x4c56('0x0'));var path=require(_0x4c56('0x1'));var timeout=require(_0x4c56('0x2'));var express=require(_0x4c56('0x3'));var router=express['Router']();var fs_extra=require(_0x4c56('0x4'));var auth=require(_0x4c56('0x5'));var interaction=require(_0x4c56('0x6'));var config=require(_0x4c56('0x7'));var controller=require(_0x4c56('0x8'));router[_0x4c56('0x9')]('/',auth[_0x4c56('0xa')](),controller['index']);router[_0x4c56('0x9')](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0xc')]);router[_0x4c56('0xd')]('/',auth[_0x4c56('0xa')](),controller[_0x4c56('0xe')]);router[_0x4c56('0xf')](_0x4c56('0xb'),auth['isAuthenticated'](),controller[_0x4c56('0x10')]);router['delete'](_0x4c56('0xb'),auth[_0x4c56('0xa')](),controller[_0x4c56('0x11')]);module[_0x4c56('0x12')]=router; \ No newline at end of file +var _0x15b3=['../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x15b3,0x1b5));var _0x315b=function(_0x1b7b49,_0xa94977){_0x1b7b49=_0x1b7b49-0x0;var _0x247f87=_0x15b3[_0x1b7b49];return _0x247f87;};'use strict';var multer=require(_0x315b('0x0'));var util=require(_0x315b('0x1'));var path=require(_0x315b('0x2'));var timeout=require(_0x315b('0x3'));var express=require(_0x315b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x315b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x315b('0x6'));var controller=require(_0x315b('0x7'));router[_0x315b('0x8')]('/',auth[_0x315b('0x9')](),controller[_0x315b('0xa')]);router[_0x315b('0x8')](_0x315b('0xb'),auth[_0x315b('0x9')](),controller[_0x315b('0xc')]);router['post']('/',auth[_0x315b('0x9')](),controller['create']);router[_0x315b('0xd')]('/:id',auth[_0x315b('0x9')](),controller['update']);router[_0x315b('0xe')](_0x315b('0xb'),auth[_0x315b('0x9')](),controller[_0x315b('0xf')]);module[_0x315b('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 00acfb9..39592ca 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 _0x18d7=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','IAX','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x200c1f,_0x232a76){var _0x3c12e8=function(_0x1f36fe){while(--_0x1f36fe){_0x200c1f['push'](_0x200c1f['shift']());}};_0x3c12e8(++_0x232a76);}(_0x18d7,0x14d));var _0x718d=function(_0x1e65f8,_0x16bea1){_0x1e65f8=_0x1e65f8-0x0;var _0x252c63=_0x18d7[_0x1e65f8];return _0x252c63;};'use strict';var Sequelize=require(_0x718d('0x0'));module[_0x718d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x718d('0x2')]},'ecm':{'type':Sequelize[_0x718d('0x3')](_0x718d('0x4'),'no'),'defaultValue':_0x718d('0x4')},'headerinfo':{'type':Sequelize[_0x718d('0x2')],'defaultValue':_0x718d('0x5')},'localstationid':{'type':Sequelize[_0x718d('0x2')],'unique':_0x718d('0x6')},'minrate':{'type':Sequelize[_0x718d('0x3')](_0x718d('0x7'),_0x718d('0x8'),_0x718d('0x9'),_0x718d('0xa'),_0x718d('0xb'),_0x718d('0xc')),'defaultValue':_0x718d('0x8')},'maxrate':{'type':Sequelize[_0x718d('0x3')]('2400',_0x718d('0x8'),_0x718d('0x9'),_0x718d('0xa'),'12000',_0x718d('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x718d('0xd')},'gateway':{'type':Sequelize[_0x718d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x718d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x718d('0xe'),_0x718d('0xf'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x718d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x718d('0x10');}},'notificationSound':{'type':Sequelize[_0x718d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x718d('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x718d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x718d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x718d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x718d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x718d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x718d('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x718d('0x11')],'defaultValue':![],'comment':_0x718d('0x14'),'set':function(_0x533134){if(!_0x533134)this[_0x718d('0x15')](_0x718d('0x16'),null);this['setDataValue'](_0x718d('0x17'),_0x533134);}}}; \ No newline at end of file +var _0xa0f1=['mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x229fe7,_0x2364c7){var _0x386c43=function(_0x3a079c){while(--_0x3a079c){_0x229fe7['push'](_0x229fe7['shift']());}};_0x386c43(++_0x2364c7);}(_0xa0f1,0x199));var _0x1a0f=function(_0x11eae7,_0x4ff987){_0x11eae7=_0x11eae7-0x0;var _0x5c4c4c=_0xa0f1[_0x11eae7];return _0x5c4c4c;};'use strict';var Sequelize=require(_0x1a0f('0x0'));module[_0x1a0f('0x1')]={'name':{'type':Sequelize[_0x1a0f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x1a0f('0x3')]('yes','no'),'defaultValue':_0x1a0f('0x4')},'headerinfo':{'type':Sequelize[_0x1a0f('0x2')],'defaultValue':_0x1a0f('0x5')},'localstationid':{'type':Sequelize[_0x1a0f('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x1a0f('0x3')](_0x1a0f('0x6'),'4800',_0x1a0f('0x7'),'9600','12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM']('2400','4800',_0x1a0f('0x7'),_0x1a0f('0x8'),_0x1a0f('0x9'),_0x1a0f('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x1a0f('0x2')],'defaultValue':_0x1a0f('0xb')},'gateway':{'type':Sequelize[_0x1a0f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1a0f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1a0f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1a0f('0x3')](_0x1a0f('0xd'),_0x1a0f('0xe'),_0x1a0f('0xf'),_0x1a0f('0x10')),'defaultValue':_0x1a0f('0xd')},'key':{'type':Sequelize[_0x1a0f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1a0f('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[_0x1a0f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1a0f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a0f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1a0f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a0f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1a0f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1a0f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x1a0f('0x12')],'defaultValue':![],'comment':_0x1a0f('0x14'),'set':function(_0x2b65ea){if(!_0x2b65ea)this[_0x1a0f('0x15')](_0x1a0f('0x16'),null);this[_0x1a0f('0x15')](_0x1a0f('0x17'),_0x2b65ea);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index eb310c6..3a8dcde 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 _0xd975=['Content-Range','apply','reject','update','destroy','then','FaxAccounts','stack','name','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','options','Contact','User','Owner','fullname','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','push','CDR(type)=inbound-fax','Set','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','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','jayson/promise','client','http','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x315f31,_0x59438e){var _0x120fca=function(_0x504017){while(--_0x504017){_0x315f31['push'](_0x315f31['shift']());}};_0x120fca(++_0x59438e);}(_0xd975,0x97));var _0x5d97=function(_0x6440d4,_0x23689d){_0x6440d4=_0x6440d4-0x0;var _0x96919c=_0xd975[_0x6440d4];return _0x96919c;};'use strict';var emlformat=require(_0x5d97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d97('0x1'));var jsonpatch=require(_0x5d97('0x2'));var rp=require(_0x5d97('0x3'));var moment=require(_0x5d97('0x4'));var BPromise=require(_0x5d97('0x5'));var Mustache=require(_0x5d97('0x6'));var util=require('util');var path=require(_0x5d97('0x7'));var sox=require(_0x5d97('0x8'));var csv=require(_0x5d97('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d97('0xa'));var _=require(_0x5d97('0xb'));var squel=require(_0x5d97('0xc'));var crypto=require(_0x5d97('0xd'));var jsforce=require(_0x5d97('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d97('0x9'));var querystring=require(_0x5d97('0xf'));var Papa=require(_0x5d97('0x10'));var Redis=require(_0x5d97('0x11'));var authService=require(_0x5d97('0x12'));var qs=require(_0x5d97('0x13'));var as=require(_0x5d97('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d97('0x15'))(_0x5d97('0x16'));var utils=require(_0x5d97('0x17'));var config=require(_0x5d97('0x18'));var licenseUtil=require(_0x5d97('0x19'));var db=require(_0x5d97('0x1a'))['db'];config[_0x5d97('0x1b')]=_['defaults'](config['redis'],{'host':_0x5d97('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d97('0x1b')]));require(_0x5d97('0x1d'))['register'](socket);var jayson=require(_0x5d97('0x1e'));var client=jayson[_0x5d97('0x1f')][_0x5d97('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x5d97('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xfae57c,_0x5bca71,_0x428f81,_0x23808d){return new BPromise(function(_0x26493e,_0x175127){var _0xa05e3b=_0x23808d||client;return _0xa05e3b[_0x5d97('0x21')](_0xfae57c,_0x428f81)['then'](function(_0x1a24cb){logger['info']('FaxAccount,\x20%s,\x20%s',_0x5bca71,_0x5d97('0x22'));logger[_0x5d97('0x23')](_0x5d97('0x24'),_0x5bca71,_0x5d97('0x22'),JSON[_0x5d97('0x25')](_0x1a24cb));if(_0x1a24cb[_0x5d97('0x26')]){if(_0x1a24cb[_0x5d97('0x26')][_0x5d97('0x27')]===0x1f4){logger['error'](_0x5d97('0x28'),_0x5bca71,_0x1a24cb[_0x5d97('0x26')][_0x5d97('0x29')]);return _0x175127(_0x1a24cb['error'][_0x5d97('0x29')]);}logger['error'](_0x5d97('0x28'),_0x5bca71,_0x1a24cb[_0x5d97('0x26')]['message']);return _0x26493e(_0x1a24cb[_0x5d97('0x26')][_0x5d97('0x29')]);}else{logger[_0x5d97('0x2a')](_0x5d97('0x28'),_0x5bca71,_0x5d97('0x22'));_0x26493e(_0x1a24cb[_0x5d97('0x2b')][_0x5d97('0x29')]);}})[_0x5d97('0x2c')](function(_0x58c08c){logger[_0x5d97('0x26')]('FaxAccount,\x20%s,\x20%s',_0x5bca71,_0x58c08c);_0x175127(_0x58c08c);});});}function respondWithStatusCode(_0x58978c,_0x5ac477){_0x5ac477=_0x5ac477||0xcc;return function(_0x38616d){if(_0x38616d){return _0x58978c[_0x5d97('0x2d')](_0x5ac477);}return _0x58978c[_0x5d97('0x2e')](_0x5ac477)[_0x5d97('0x2f')]();};}function respondWithResult(_0x3a0889,_0x390bcd){_0x390bcd=_0x390bcd||0xc8;return function(_0x71fbb7){if(_0x71fbb7){return _0x3a0889[_0x5d97('0x2e')](_0x390bcd)[_0x5d97('0x30')](_0x71fbb7);}};}function respondWithFilteredResult(_0x22185c,_0x500177){return function(_0x1d4e49){if(_0x1d4e49){var _0x5a0a56=typeof _0x500177[_0x5d97('0x31')]==='undefined'&&typeof _0x500177[_0x5d97('0x32')]===_0x5d97('0x33');var _0x55484f=_0x1d4e49[_0x5d97('0x34')];var _0x3b300a=_0x5a0a56?0x0:_0x500177[_0x5d97('0x31')];var _0x2d0109=_0x5a0a56?_0x1d4e49['count']:_0x500177[_0x5d97('0x31')]+_0x500177['limit'];var _0x3ff9aa;if(_0x2d0109>=_0x55484f){_0x2d0109=_0x55484f;_0x3ff9aa=0xc8;}else{_0x3ff9aa=0xce;}_0x22185c[_0x5d97('0x2e')](_0x3ff9aa);return _0x22185c[_0x5d97('0x35')](_0x5d97('0x36'),_0x3b300a+'-'+_0x2d0109+'/'+_0x55484f)['json'](_0x1d4e49);}return null;};}function patchUpdates(_0x1a5c1d){return function(_0xefa2ab){try{jsonpatch[_0x5d97('0x37')](_0xefa2ab,_0x1a5c1d,!![]);}catch(_0x2db52d){return BPromise[_0x5d97('0x38')](_0x2db52d);}return _0xefa2ab['save']();};}function saveUpdates(_0x619ad2,_0x3e71e8){return function(_0x5a767a){if(_0x5a767a){return _0x5a767a[_0x5d97('0x39')](_0x619ad2)['then'](function(_0x15972c){return _0x15972c;});}return null;};}function removeEntity(_0x25c6ca,_0x1b5250){return function(_0x4c59aa){if(_0x4c59aa){return _0x4c59aa[_0x5d97('0x3a')]()[_0x5d97('0x3b')](function(){var _0x4f0d3e=_0x4c59aa['get']({'plain':!![]});var _0x572428=_0x5d97('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0x572428,'resourceId':_0x4f0d3e['id']}})[_0x5d97('0x3b')](function(){return _0x4c59aa;});})[_0x5d97('0x3b')](function(){_0x25c6ca[_0x5d97('0x2e')](0xcc)[_0x5d97('0x2f')]();});}};}function handleEntityNotFound(_0xa83b27,_0x181dcf){return function(_0x3a68ec){if(!_0x3a68ec){_0xa83b27[_0x5d97('0x2d')](0x194);}return _0x3a68ec;};}function handleError(_0x2ff8f1,_0x7614db){_0x7614db=_0x7614db||0x1f4;return function(_0x5a1716){logger[_0x5d97('0x26')](_0x5a1716[_0x5d97('0x3d')]);if(_0x5a1716[_0x5d97('0x3e')]){delete _0x5a1716[_0x5d97('0x3e')];}_0x2ff8f1['status'](_0x7614db)['send'](_0x5a1716);};}exports['index']=function(_0x3d463e,_0x4ed88b){var _0x3d94dc={'include':[{'model':db[_0x5d97('0x3f')],'as':_0x5d97('0x40')}]},_0x3b89e0={},_0x2ccd7a={'count':0x0,'rows':[]};var _0x58f19b=_['map'](db[_0x5d97('0x41')][_0x5d97('0x42')],function(_0x4a7899){return{'name':_0x4a7899[_0x5d97('0x43')],'type':_0x4a7899['type'][_0x5d97('0x44')]};});_0x3b89e0[_0x5d97('0x45')]=_[_0x5d97('0x46')](_0x58f19b,_0x5d97('0x3e'));_0x3b89e0[_0x5d97('0x47')]=_[_0x5d97('0x48')](_0x3d463e[_0x5d97('0x47')]);_0x3b89e0[_0x5d97('0x49')]=_['intersection'](_0x3b89e0[_0x5d97('0x45')],_0x3b89e0['query']);_0x3d94dc['attributes']=_[_0x5d97('0x4a')](_0x3b89e0[_0x5d97('0x45')],qs[_0x5d97('0x4b')](_0x3d463e['query'][_0x5d97('0x4b')]));_0x3d94dc[_0x5d97('0x4c')]=_0x3d94dc[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x3d94dc[_0x5d97('0x4c')]:_0x3b89e0[_0x5d97('0x45')];if(!_0x3d463e[_0x5d97('0x47')]['hasOwnProperty'](_0x5d97('0x4e'))){_0x3d94dc[_0x5d97('0x32')]=qs[_0x5d97('0x32')](_0x3d463e[_0x5d97('0x47')][_0x5d97('0x32')]);_0x3d94dc[_0x5d97('0x31')]=qs[_0x5d97('0x31')](_0x3d463e[_0x5d97('0x47')][_0x5d97('0x31')]);}_0x3d94dc[_0x5d97('0x4f')]=qs[_0x5d97('0x50')](_0x3d463e[_0x5d97('0x47')][_0x5d97('0x50')]);_0x3d94dc[_0x5d97('0x51')]=qs[_0x5d97('0x49')](_[_0x5d97('0x52')](_0x3d463e['query'],_0x3b89e0[_0x5d97('0x49')]),_0x58f19b);if(_0x3d463e['query'][_0x5d97('0x53')]){_0x3d94dc[_0x5d97('0x51')]=_[_0x5d97('0x54')](_0x3d94dc[_0x5d97('0x51')],{'$or':_['map'](_0x58f19b,function(_0x57038a){if(_0x57038a[_0x5d97('0x55')]!==_0x5d97('0x56')){var _0x43e0c9={};_0x43e0c9[_0x57038a[_0x5d97('0x3e')]]={'$like':'%'+_0x3d463e[_0x5d97('0x47')][_0x5d97('0x53')]+'%'};return _0x43e0c9;}})});}_0x3d94dc=_[_0x5d97('0x54')]({},_0x3d94dc,_0x3d463e['options']);var _0x4305f6={'where':_0x3d94dc[_0x5d97('0x51')]};return db[_0x5d97('0x41')]['count'](_0x4305f6)[_0x5d97('0x3b')](function(_0x5c6561){_0x2ccd7a[_0x5d97('0x34')]=_0x5c6561;if(_0x3d463e[_0x5d97('0x47')][_0x5d97('0x57')]){_0x3d94dc[_0x5d97('0x58')]=[{'all':!![]}];}return db[_0x5d97('0x41')][_0x5d97('0x59')](_0x3d94dc);})['then'](function(_0x28115d){_0x2ccd7a[_0x5d97('0x5a')]=_0x28115d;return _0x2ccd7a;})['then'](respondWithFilteredResult(_0x4ed88b,_0x3d94dc))[_0x5d97('0x2c')](handleError(_0x4ed88b,null));};exports[_0x5d97('0x5b')]=function(_0x1c9f9a,_0x450bf1){var _0x3a3937={'raw':![],'where':{'id':_0x1c9f9a[_0x5d97('0x5c')]['id']},'include':[{'model':db[_0x5d97('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2057c2={};_0x2057c2[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x41')]['rawAttributes']);_0x2057c2[_0x5d97('0x47')]=_[_0x5d97('0x48')](_0x1c9f9a['query']);_0x2057c2[_0x5d97('0x49')]=_[_0x5d97('0x4a')](_0x2057c2['model'],_0x2057c2[_0x5d97('0x47')]);_0x3a3937['attributes']=_[_0x5d97('0x4a')](_0x2057c2[_0x5d97('0x45')],qs[_0x5d97('0x4b')](_0x1c9f9a[_0x5d97('0x47')][_0x5d97('0x4b')]));_0x3a3937[_0x5d97('0x4c')]=_0x3a3937[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x3a3937[_0x5d97('0x4c')]:_0x2057c2[_0x5d97('0x45')];if(_0x1c9f9a[_0x5d97('0x47')][_0x5d97('0x57')]){_0x3a3937[_0x5d97('0x58')]=[{'all':!![]}];}_0x3a3937=_[_0x5d97('0x54')]({},_0x3a3937,_0x1c9f9a['options']);return db[_0x5d97('0x41')][_0x5d97('0x5d')](_0x3a3937)[_0x5d97('0x3b')](handleEntityNotFound(_0x450bf1,null))['then'](respondWithResult(_0x450bf1,null))[_0x5d97('0x2c')](handleError(_0x450bf1,null));};exports['create']=function(_0x120a0b,_0x177740){return db[_0x5d97('0x41')]['create'](_0x120a0b[_0x5d97('0x5e')],{})[_0x5d97('0x3b')](function(_0x553465){var _0x2dbb72=_0x120a0b[_0x5d97('0x5f')][_0x5d97('0x60')]({'plain':!![]});if(!_0x2dbb72)throw new Error(_0x5d97('0x61'));if(_0x2dbb72[_0x5d97('0x62')]==='user'){var _0x51c0f4=_0x553465[_0x5d97('0x60')]({'plain':!![]});var _0x4c8cb6='FaxAccounts';return db[_0x5d97('0x63')]['find']({'where':{'name':_0x4c8cb6,'userProfileId':_0x2dbb72[_0x5d97('0x64')]},'raw':!![]})['then'](function(_0x6c01b7){if(_0x6c01b7&&_0x6c01b7['autoAssociation']===0x0){return db['UserProfileResource'][_0x5d97('0x65')]({'name':_0x51c0f4['name'],'resourceId':_0x51c0f4['id'],'type':_0x6c01b7[_0x5d97('0x3e')],'sectionId':_0x6c01b7['id']},{})[_0x5d97('0x3b')](function(){return _0x553465;});}else{return _0x553465;}})[_0x5d97('0x2c')](function(_0x10f80d){logger[_0x5d97('0x26')](_0x5d97('0x66'),_0x10f80d);throw _0x10f80d;});}return _0x553465;})[_0x5d97('0x3b')](respondWithResult(_0x177740,0xc9))[_0x5d97('0x2c')](handleError(_0x177740,null));};exports[_0x5d97('0x39')]=function(_0x1bef6c,_0x4dfb90){if(_0x1bef6c[_0x5d97('0x5e')]['id']){delete _0x1bef6c[_0x5d97('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x1bef6c[_0x5d97('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x5d97('0x40')}]})[_0x5d97('0x3b')](handleEntityNotFound(_0x4dfb90,null))[_0x5d97('0x3b')](saveUpdates(_0x1bef6c[_0x5d97('0x5e')],null))[_0x5d97('0x3b')](respondWithResult(_0x4dfb90,null))[_0x5d97('0x2c')](handleError(_0x4dfb90,null));};exports[_0x5d97('0x3a')]=function(_0x198a8e,_0x41766e){return db['FaxAccount']['find']({'where':{'id':_0x198a8e['params']['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x41766e,null))[_0x5d97('0x3b')](removeEntity(_0x41766e,null))['catch'](handleError(_0x41766e,null));};exports[_0x5d97('0x67')]=function(_0x1b46fc,_0x304ac2){return db[_0x5d97('0x41')][_0x5d97('0x67')]()[_0x5d97('0x3b')](respondWithResult(_0x304ac2,null))['catch'](handleError(_0x304ac2,null));};exports[_0x5d97('0x68')]=function(_0x3f91b3,_0x12cdf7,_0x4836ce){if(_0x3f91b3[_0x5d97('0x5e')]['id']){delete _0x3f91b3[_0x5d97('0x5e')]['id'];}return db[_0x5d97('0x41')]['find']({'where':{'id':_0x3f91b3[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x12cdf7,null))['then'](function(_0x588f6f){if(_0x588f6f){_0x3f91b3[_0x5d97('0x5e')][_0x5d97('0x69')]=_0x588f6f['id'];return db[_0x5d97('0x6a')][_0x5d97('0x65')](_0x3f91b3[_0x5d97('0x5e')]);}})[_0x5d97('0x3b')](respondWithResult(_0x12cdf7,null))[_0x5d97('0x2c')](handleError(_0x12cdf7,null));};exports[_0x5d97('0x6b')]=function(_0x3487d5,_0x2134e4,_0x2c5c47){var _0x2c25a2={'raw':![],'where':{}};var _0x30cd7f={};var _0x556c13={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5d97('0x6c')]({'where':{'id':_0x3487d5[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x2134e4,null))[_0x5d97('0x3b')](function(_0x32db17){if(_0x32db17){_0x30cd7f[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x6a')][_0x5d97('0x42')]);_0x30cd7f[_0x5d97('0x47')]=_[_0x5d97('0x48')](_0x3487d5[_0x5d97('0x47')]);_0x30cd7f[_0x5d97('0x49')]=_[_0x5d97('0x4a')](_0x30cd7f[_0x5d97('0x45')],_0x30cd7f['query']);_0x2c25a2[_0x5d97('0x4c')]=_[_0x5d97('0x4a')](_0x30cd7f[_0x5d97('0x45')],qs['fields'](_0x3487d5['query'][_0x5d97('0x4b')]));_0x2c25a2[_0x5d97('0x4c')]=_0x2c25a2[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x2c25a2[_0x5d97('0x4c')]:_0x30cd7f[_0x5d97('0x45')];if(!_0x3487d5[_0x5d97('0x47')][_0x5d97('0x6d')](_0x5d97('0x4e'))){_0x2c25a2['limit']=qs[_0x5d97('0x32')](_0x3487d5[_0x5d97('0x47')][_0x5d97('0x32')]);_0x2c25a2[_0x5d97('0x31')]=qs[_0x5d97('0x31')](_0x3487d5['query'][_0x5d97('0x31')]);}_0x2c25a2[_0x5d97('0x4f')]=qs[_0x5d97('0x50')](_0x3487d5[_0x5d97('0x47')]['sort']);_0x2c25a2[_0x5d97('0x51')]=qs[_0x5d97('0x49')](_['pick'](_0x3487d5[_0x5d97('0x47')],_0x30cd7f[_0x5d97('0x49')]));_0x2c25a2[_0x5d97('0x51')][_0x5d97('0x69')]=_0x32db17['id'];if(_0x3487d5['query'][_0x5d97('0x53')]){_0x2c25a2[_0x5d97('0x51')]=_['merge'](_0x2c25a2[_0x5d97('0x51')],{'$or':_[_0x5d97('0x46')](_0x2c25a2[_0x5d97('0x4c')],function(_0x17b65a){var _0x3e06fc={};_0x3e06fc[_0x17b65a]={'$like':'%'+_0x3487d5[_0x5d97('0x47')][_0x5d97('0x53')]+'%'};return _0x3e06fc;})});}_0x2c25a2=_[_0x5d97('0x54')]({},_0x2c25a2,_0x3487d5['options']);return db[_0x5d97('0x6a')][_0x5d97('0x34')]({'where':_0x2c25a2[_0x5d97('0x51')]})[_0x5d97('0x3b')](function(_0x3a5397){_0x556c13[_0x5d97('0x34')]=_0x3a5397;if(_0x3487d5[_0x5d97('0x47')][_0x5d97('0x57')]){_0x2c25a2['include']=[{'all':!![]}];}return db[_0x5d97('0x6a')][_0x5d97('0x59')](_0x2c25a2);})[_0x5d97('0x3b')](function(_0x769efe){_0x556c13[_0x5d97('0x5a')]=_0x769efe;return _0x556c13;});}})[_0x5d97('0x3b')](respondWithFilteredResult(_0x2134e4,_0x2c25a2))[_0x5d97('0x2c')](handleError(_0x2134e4,null));};exports[_0x5d97('0x6e')]=function(_0x29a585,_0x7e3194,_0x2d5406){return db[_0x5d97('0x41')]['find']({'where':{'id':_0x29a585[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x7e3194,null))[_0x5d97('0x3b')](function(_0x385bce){if(_0x385bce){return _0x385bce['removeDispositions'](_0x29a585[_0x5d97('0x47')][_0x5d97('0x6f')]);}})[_0x5d97('0x3b')](respondWithStatusCode(_0x7e3194,null))['catch'](handleError(_0x7e3194,null));};exports[_0x5d97('0x70')]=function(_0x232cd7,_0x5d2336,_0xf05568){if(_0x232cd7[_0x5d97('0x5e')]['id']){delete _0x232cd7[_0x5d97('0x5e')]['id'];}return db[_0x5d97('0x41')][_0x5d97('0x5d')]({'where':{'id':_0x232cd7[_0x5d97('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d2336,null))[_0x5d97('0x3b')](function(_0x3bf61f){if(_0x3bf61f){_0x232cd7[_0x5d97('0x5e')]['FaxAccountId']=_0x3bf61f['id'];return db[_0x5d97('0x71')]['create'](_0x232cd7[_0x5d97('0x5e')]);}})[_0x5d97('0x3b')](respondWithResult(_0x5d2336,null))[_0x5d97('0x2c')](handleError(_0x5d2336,null));};exports[_0x5d97('0x72')]=function(_0x4943a9,_0x4e504b,_0x4b93f7){var _0x335b8e={'raw':![],'where':{}};var _0x142314={};var _0x1135c6={'count':0x0,'rows':[]};return db[_0x5d97('0x41')]['findOne']({'where':{'id':_0x4943a9[_0x5d97('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e504b,null))['then'](function(_0x10aaab){if(_0x10aaab){_0x142314[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x71')][_0x5d97('0x42')]);_0x142314['query']=_[_0x5d97('0x48')](_0x4943a9['query']);_0x142314[_0x5d97('0x49')]=_[_0x5d97('0x4a')](_0x142314[_0x5d97('0x45')],_0x142314[_0x5d97('0x47')]);_0x335b8e[_0x5d97('0x4c')]=_[_0x5d97('0x4a')](_0x142314[_0x5d97('0x45')],qs[_0x5d97('0x4b')](_0x4943a9[_0x5d97('0x47')]['fields']));_0x335b8e[_0x5d97('0x4c')]=_0x335b8e[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x335b8e[_0x5d97('0x4c')]:_0x142314['model'];if(!_0x4943a9[_0x5d97('0x47')][_0x5d97('0x6d')]('nolimit')){_0x335b8e['limit']=qs[_0x5d97('0x32')](_0x4943a9[_0x5d97('0x47')][_0x5d97('0x32')]);_0x335b8e[_0x5d97('0x31')]=qs[_0x5d97('0x31')](_0x4943a9[_0x5d97('0x47')][_0x5d97('0x31')]);}_0x335b8e[_0x5d97('0x4f')]=qs[_0x5d97('0x50')](_0x4943a9[_0x5d97('0x47')][_0x5d97('0x50')]);_0x335b8e[_0x5d97('0x51')]=qs['filters'](_[_0x5d97('0x52')](_0x4943a9['query'],_0x142314[_0x5d97('0x49')]));_0x335b8e[_0x5d97('0x51')][_0x5d97('0x69')]=_0x10aaab['id'];if(_0x4943a9[_0x5d97('0x47')][_0x5d97('0x53')]){_0x335b8e[_0x5d97('0x51')]=_[_0x5d97('0x54')](_0x335b8e['where'],{'$or':_[_0x5d97('0x46')](_0x335b8e['attributes'],function(_0x674402){var _0x47a0f4={};_0x47a0f4[_0x674402]={'$like':'%'+_0x4943a9['query'][_0x5d97('0x53')]+'%'};return _0x47a0f4;})});}_0x335b8e=_[_0x5d97('0x54')]({},_0x335b8e,_0x4943a9['options']);return db[_0x5d97('0x71')][_0x5d97('0x34')]({'where':_0x335b8e[_0x5d97('0x51')]})[_0x5d97('0x3b')](function(_0x1fdde0){_0x1135c6[_0x5d97('0x34')]=_0x1fdde0;if(_0x4943a9['query'][_0x5d97('0x57')]){_0x335b8e[_0x5d97('0x58')]=[{'all':!![]}];}return db[_0x5d97('0x71')][_0x5d97('0x59')](_0x335b8e);})[_0x5d97('0x3b')](function(_0x416697){_0x1135c6[_0x5d97('0x5a')]=_0x416697;return _0x1135c6;});}})[_0x5d97('0x3b')](respondWithFilteredResult(_0x4e504b,_0x335b8e))[_0x5d97('0x2c')](handleError(_0x4e504b,null));};exports['removeAnswers']=function(_0x1815c5,_0x124d76,_0x2b33d0){return db[_0x5d97('0x41')][_0x5d97('0x5d')]({'where':{'id':_0x1815c5[_0x5d97('0x5c')]['id']}})['then'](handleEntityNotFound(_0x124d76,null))[_0x5d97('0x3b')](function(_0x3b6540){if(_0x3b6540){return _0x3b6540[_0x5d97('0x73')](_0x1815c5[_0x5d97('0x47')][_0x5d97('0x6f')]);}})[_0x5d97('0x3b')](respondWithStatusCode(_0x124d76,null))[_0x5d97('0x2c')](handleError(_0x124d76,null));};exports[_0x5d97('0x74')]=function(_0x5999f6,_0xd0d786,_0x3326fa){return db[_0x5d97('0x75')][_0x5d97('0x5d')]({'where':{'id':_0x5999f6[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0xd0d786,null))[_0x5d97('0x3b')](function(_0x410095){if(_0x410095){return _0x410095[_0x5d97('0x74')](_0x5999f6[_0x5d97('0x5e')][_0x5d97('0x6f')],_[_0x5d97('0x76')](_0x5999f6[_0x5d97('0x5e')],[_0x5d97('0x6f'),'id'])||{});}})[_0x5d97('0x3b')](respondWithResult(_0xd0d786,null))[_0x5d97('0x2c')](handleError(_0xd0d786,null));};exports[_0x5d97('0x77')]=function(_0x41e908,_0x17ea8d,_0x50b170){var _0x28ace6={'raw':![],'where':{}};var _0x241d78={};var _0x3beb2a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5d97('0x6c')]({'where':{'id':_0x41e908['params']['id']}})['then'](handleEntityNotFound(_0x17ea8d,null))[_0x5d97('0x3b')](function(_0x1b9d2b){if(_0x1b9d2b){_0x241d78[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x75')]['rawAttributes']);_0x241d78[_0x5d97('0x47')]=_['keys'](_0x41e908[_0x5d97('0x47')]);_0x241d78['filters']=_['intersection'](_0x241d78[_0x5d97('0x45')],_0x241d78[_0x5d97('0x47')]);_0x28ace6[_0x5d97('0x4c')]=_['intersection'](_0x241d78[_0x5d97('0x45')],qs[_0x5d97('0x4b')](_0x41e908[_0x5d97('0x47')][_0x5d97('0x4b')]));_0x28ace6[_0x5d97('0x4c')]=_0x28ace6[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x28ace6[_0x5d97('0x4c')]:_0x241d78['model'];if(!_0x41e908[_0x5d97('0x47')]['hasOwnProperty'](_0x5d97('0x4e'))){_0x28ace6[_0x5d97('0x32')]=qs[_0x5d97('0x32')](_0x41e908[_0x5d97('0x47')]['limit']);_0x28ace6[_0x5d97('0x31')]=qs[_0x5d97('0x31')](_0x41e908[_0x5d97('0x47')]['offset']);}_0x28ace6[_0x5d97('0x4f')]=qs['sort'](_0x41e908['query'][_0x5d97('0x50')]);_0x28ace6[_0x5d97('0x51')]=qs[_0x5d97('0x49')](_[_0x5d97('0x52')](_0x41e908[_0x5d97('0x47')],_0x241d78[_0x5d97('0x49')]));_0x28ace6[_0x5d97('0x51')][_0x5d97('0x69')]=_0x1b9d2b['id'];if(_0x41e908[_0x5d97('0x47')]['filter']){_0x28ace6[_0x5d97('0x51')]=_[_0x5d97('0x54')](_0x28ace6[_0x5d97('0x51')],{'$or':_['map'](_0x28ace6[_0x5d97('0x4c')],function(_0x564143){var _0x21cd15={};_0x21cd15[_0x564143]={'$like':'%'+_0x41e908[_0x5d97('0x47')][_0x5d97('0x53')]+'%'};return _0x21cd15;})});}_0x28ace6=_[_0x5d97('0x54')]({},_0x28ace6,_0x41e908[_0x5d97('0x78')]);return db['FaxInteraction'][_0x5d97('0x34')]({'where':_0x28ace6['where']})[_0x5d97('0x3b')](function(_0x527d5e){_0x3beb2a[_0x5d97('0x34')]=_0x527d5e;if(_0x41e908[_0x5d97('0x47')][_0x5d97('0x57')]){_0x28ace6[_0x5d97('0x58')]=[{'model':db['CmContact'],'as':_0x5d97('0x79'),'required':![]},{'model':db[_0x5d97('0x7a')],'as':_0x5d97('0x7b'),'attributes':[_0x5d97('0x3e'),_0x5d97('0x7c'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5d97('0x3e'),_0x5d97('0x7d')],'where':_0x41e908[_0x5d97('0x47')][_0x5d97('0x7e')]?{'id':_0x41e908[_0x5d97('0x47')][_0x5d97('0x7e')]}:undefined,'required':_0x41e908['query'][_0x5d97('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x5d97('0x59')](_0x28ace6);})[_0x5d97('0x3b')](function(_0x59c1a8){_0x3beb2a[_0x5d97('0x5a')]=_0x59c1a8;return _0x3beb2a;});}})[_0x5d97('0x3b')](respondWithFilteredResult(_0x17ea8d,_0x28ace6))[_0x5d97('0x2c')](handleError(_0x17ea8d,null));};exports[_0x5d97('0x7f')]=function(_0x106b5b,_0x49ee77){var _0x22f2cb=_0x106b5b[_0x5d97('0x5c')]['id'];var _0x5282be=_0x106b5b[_0x5d97('0x5e')];var _0x393865=0xc8;var _0x77d805=null;return db[_0x5d97('0x80')][_0x5d97('0x81')]({'isolationLevel':db[_0x5d97('0x80')][_0x5d97('0x82')][_0x5d97('0x83')][_0x5d97('0x84')]},function(_0xfed89b){return db['FaxAccount']['findOne']({'where':{'id':_0x22f2cb},'transaction':_0xfed89b})[_0x5d97('0x3b')](function(_0x1c7435){if(_0x1c7435){return db[_0x5d97('0x85')][_0x5d97('0x3a')]({'where':{'FaxAccountId':_0x22f2cb},'transaction':_0xfed89b})[_0x5d97('0x3b')](function(){var _0x46354f=_[_0x5d97('0x46')](_0x5282be,function(_0x5b8173){_0x5b8173[_0x5d97('0x69')]=_0x22f2cb;return _0x5b8173;});return db['FaxApplication'][_0x5d97('0x86')](_0x46354f,{'transaction':_0xfed89b});});}else{_0x393865=0x194;_0x77d805=[];}});})[_0x5d97('0x3b')](function(){if(_0x393865!==0x194){return db[_0x5d97('0x85')][_0x5d97('0x87')]({'where':{'FaxAccountId':_0x22f2cb},'order':_0x5d97('0x88')})[_0x5d97('0x3b')](function(_0x2fc452){_0x77d805=_0x2fc452;});}})[_0x5d97('0x2c')](function(_0x1b464f){_0x393865=0x1f4;logger[_0x5d97('0x26')](_0x1b464f[_0x5d97('0x3d')]);if(_0x1b464f[_0x5d97('0x3e')]){delete _0x1b464f[_0x5d97('0x3e')];}_0x77d805=_0x1b464f;})[_0x5d97('0x89')](function(){if(_0x77d805===null){_0x49ee77[_0x5d97('0x2d')](_0x393865);}else{if(_0x393865===0x1f4){_0x49ee77[_0x5d97('0x2e')](_0x393865)[_0x5d97('0x8a')](_0x77d805);}else{_0x49ee77[_0x5d97('0x2e')](_0x393865)['json'](_0x77d805);}}});};exports[_0x5d97('0x8b')]=function(_0x48edf2,_0x2e37b4,_0xce5da){var _0x13c626={};var _0x504ecf={};var _0x22a1b7;var _0x4e9e54;return db[_0x5d97('0x41')][_0x5d97('0x6c')]({'where':{'id':_0x48edf2[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x2e37b4,null))['then'](function(_0x57f9ca){if(_0x57f9ca){_0x22a1b7=_0x57f9ca;_0x504ecf[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x85')]['rawAttributes']);_0x504ecf[_0x5d97('0x47')]=_[_0x5d97('0x48')](_0x48edf2[_0x5d97('0x47')]);_0x504ecf[_0x5d97('0x49')]=_['intersection'](_0x504ecf[_0x5d97('0x45')],_0x504ecf['query']);_0x13c626['attributes']=_[_0x5d97('0x4a')](_0x504ecf[_0x5d97('0x45')],qs[_0x5d97('0x4b')](_0x48edf2[_0x5d97('0x47')][_0x5d97('0x4b')]));_0x13c626[_0x5d97('0x4c')]=_0x13c626['attributes']['length']?_0x13c626[_0x5d97('0x4c')]:_0x504ecf[_0x5d97('0x45')];_0x13c626[_0x5d97('0x4f')]=qs[_0x5d97('0x50')](_0x48edf2[_0x5d97('0x47')][_0x5d97('0x50')]);_0x13c626['where']=qs[_0x5d97('0x49')](_[_0x5d97('0x52')](_0x48edf2[_0x5d97('0x47')],_0x504ecf[_0x5d97('0x49')]));if(_0x48edf2[_0x5d97('0x47')][_0x5d97('0x53')]){_0x13c626[_0x5d97('0x51')]=_['merge'](_0x13c626[_0x5d97('0x51')],{'$or':_['map'](_0x13c626[_0x5d97('0x4c')],function(_0x1e5285){var _0x2fba8d={};_0x2fba8d[_0x1e5285]={'$like':'%'+_0x48edf2[_0x5d97('0x47')]['filter']+'%'};return _0x2fba8d;})});}_0x13c626=_[_0x5d97('0x54')]({},_0x13c626,_0x48edf2[_0x5d97('0x78')]);return _0x22a1b7[_0x5d97('0x8b')](_0x13c626);}})[_0x5d97('0x3b')](function(_0xa85a91){if(_0xa85a91){_0x4e9e54=_0xa85a91[_0x5d97('0x4d')];if(!_0x48edf2[_0x5d97('0x47')][_0x5d97('0x6d')](_0x5d97('0x4e'))){_0x13c626[_0x5d97('0x32')]=qs[_0x5d97('0x32')](_0x48edf2[_0x5d97('0x47')][_0x5d97('0x32')]);_0x13c626[_0x5d97('0x31')]=qs[_0x5d97('0x31')](_0x48edf2[_0x5d97('0x47')][_0x5d97('0x31')]);}return _0x22a1b7['getApplications'](_0x13c626);}})[_0x5d97('0x3b')](function(_0x184e02){if(_0x184e02){return _0x184e02?{'count':_0x4e9e54,'rows':_0x184e02}:null;}})['then'](respondWithResult(_0x2e37b4,null))['catch'](handleError(_0x2e37b4,null));};function Extension(_0x372b34,_0x5a8066,_0x44dd59,_0x1190e7){this[_0x5d97('0x8c')]=_0x5d97('0x8d');this[_0x5d97('0x8e')]=_0x372b34[_0x5d97('0x8f')];this[_0x5d97('0x90')]=_0x1190e7;this[_0x5d97('0x55')]=_0x5d97('0x91');this[_0x5d97('0x92')]='Fax\x20Extension';this[_0x5d97('0x69')]=_0x372b34['id'];this[_0x5d97('0x88')]=_0x5a8066;this['appdata']=_0x44dd59;}function createExtensionsReciveFax(_0x30c567){var _0x481715=0x1;var _0x2fa1f2=[];_0x2fa1f2[_0x5d97('0x93')](new Extension(_0x30c567,_0x481715,'','Answer'));_0x481715+=0x1;_0x2fa1f2[_0x5d97('0x93')](new Extension(_0x30c567,_0x481715,_0x5d97('0x94'),_0x5d97('0x95')));_0x481715+=0x1;for(var _0x135b1d in _0x30c567){if(_0x30c567[_0x5d97('0x6d')](_0x135b1d)&&(_0x135b1d==='ecm'||_0x135b1d==='localstationid'||_0x135b1d===_0x5d97('0x96')||_0x135b1d===_0x5d97('0x97')||_0x135b1d===_0x5d97('0x98')||_0x135b1d===_0x5d97('0x99')||_0x135b1d===_0x5d97('0x9a')||_0x135b1d===_0x5d97('0x9b')||_0x135b1d===_0x5d97('0x9c'))){_0x2fa1f2[_0x5d97('0x93')](new Extension(_0x30c567,_0x481715,'FAXOPT('+_0x135b1d+')='+_0x30c567[_0x135b1d],'Set'));_0x481715+=0x1;}}_0x2fa1f2['push'](new Extension(_0x30c567,_0x481715,'6',_0x5d97('0x9d')));_0x481715+=0x1;_0x2fa1f2[_0x5d97('0x93')](new Extension(_0x30c567,_0x481715,_0x5d97('0x9e'),_0x5d97('0x9f')));_0x481715=0x0;return _0x2fa1f2;}exports[_0x5d97('0xa0')]=function(_0x5caf66,_0xdf94eb,_0x347b05){var _0x73aae5;return db[_0x5d97('0x80')][_0x5d97('0x81')](function(_0x14bd1e){return db[_0x5d97('0x41')]['create'](_0x5caf66['body'],{'transaction':_0x14bd1e})['then'](function(_0x45c388){_0x73aae5=_0x45c388[_0x5d97('0x60')]({'plain':!![]});return db[_0x5d97('0xa1')][_0x5d97('0x86')](createExtensionsReciveFax(_0x73aae5),{'transaction':_0x14bd1e});});})[_0x5d97('0x3b')](function(){return _0x73aae5;})[_0x5d97('0x3b')](respondWithResult(_0xdf94eb,null))[_0x5d97('0x2c')](handleError(_0xdf94eb,null));};exports[_0x5d97('0xa2')]=function(_0x442ac1,_0x1ad5ad,_0x5f15e2){var _0x33be9c;return db['sequelize'][_0x5d97('0x81')](function(_0x2457e6){return db['FaxAccount'][_0x5d97('0x39')](_0x442ac1[_0x5d97('0x5e')],{'where':{'id':_0x442ac1['body']['id']},'transaction':_0x2457e6})['then'](function(_0x504fef){return db[_0x5d97('0xa1')][_0x5d97('0x3a')]({'where':{'FaxAccountId':_0x442ac1['body']['id']},'transaction':_0x2457e6})['then'](function(_0xdd7a03){return db[_0x5d97('0xa1')][_0x5d97('0x86')](createExtensionsReciveFax(_[_0x5d97('0x76')](_0x442ac1['body'],[_0x5d97('0xa3'),_0x5d97('0x44'),_0x5d97('0xa4'),_0x5d97('0xa5'),_0x5d97('0xa6'),'ListId'])),{'transaction':_0x2457e6});});});})[_0x5d97('0x3b')](function(){return db[_0x5d97('0x41')][_0x5d97('0xa7')](_0x442ac1[_0x5d97('0x5e')]['id']);})['then'](respondWithResult(_0x1ad5ad,null))[_0x5d97('0x2c')](handleError(_0x1ad5ad,null));};exports[_0x5d97('0xa8')]=function(_0x567cf9,_0xbb7185,_0x501122){var _0x3ecd3f={'raw':!![],'where':{}};var _0x386430={};var _0x42320c={'count':0x0,'rows':[]};return db[_0x5d97('0x41')][_0x5d97('0x6c')]({'where':{'id':_0x567cf9[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0xbb7185,null))['then'](function(_0x33ed51){if(_0x33ed51){_0x386430['model']=_[_0x5d97('0x48')](db[_0x5d97('0xa9')][_0x5d97('0x42')]);_0x386430['query']=_[_0x5d97('0x48')](_0x567cf9[_0x5d97('0x47')]);_0x386430[_0x5d97('0x49')]=_[_0x5d97('0x4a')](_0x386430[_0x5d97('0x45')],_0x386430[_0x5d97('0x47')]);_0x3ecd3f[_0x5d97('0x4c')]=_[_0x5d97('0x4a')](_0x386430[_0x5d97('0x45')],qs['fields'](_0x567cf9['query'][_0x5d97('0x4b')]));_0x3ecd3f[_0x5d97('0x4c')]=_0x3ecd3f[_0x5d97('0x4c')][_0x5d97('0x4d')]?_0x3ecd3f[_0x5d97('0x4c')]:_0x386430[_0x5d97('0x45')];if(!_0x567cf9['query'][_0x5d97('0x6d')]('nolimit')){_0x3ecd3f['limit']=qs[_0x5d97('0x32')](_0x567cf9[_0x5d97('0x47')][_0x5d97('0x32')]);_0x3ecd3f[_0x5d97('0x31')]=qs['offset'](_0x567cf9[_0x5d97('0x47')]['offset']);}_0x3ecd3f[_0x5d97('0x4f')]=qs[_0x5d97('0x50')](_0x567cf9[_0x5d97('0x47')][_0x5d97('0x50')]);_0x3ecd3f[_0x5d97('0x51')]=qs[_0x5d97('0x49')](_[_0x5d97('0x52')](_0x567cf9[_0x5d97('0x47')],_0x386430[_0x5d97('0x49')]));_0x3ecd3f[_0x5d97('0x51')]['FaxAccountId']=_0x33ed51['id'];if(_0x567cf9[_0x5d97('0x47')][_0x5d97('0x53')]){_0x3ecd3f[_0x5d97('0x51')]=_[_0x5d97('0x54')](_0x3ecd3f['where'],{'$or':_['map'](_0x3ecd3f[_0x5d97('0x4c')],function(_0x30eeee){var _0x16b47e={};_0x16b47e[_0x30eeee]={'$like':'%'+_0x567cf9[_0x5d97('0x47')][_0x5d97('0x53')]+'%'};return _0x16b47e;})});}if(_0x567cf9[_0x5d97('0x47')]['$gte']){var _0x273147=_0x567cf9[_0x5d97('0x47')][_0x5d97('0xaa')][_0x5d97('0xab')](',');var _0x484bb0={};_0x484bb0[_0x273147[0x0]]={'$gte':moment(_0x273147[0x1])[_0x5d97('0xac')](_0x5d97('0xad'))};_0x3ecd3f['where']=_[_0x5d97('0x54')](_0x3ecd3f['where'],_0x484bb0);}_0x3ecd3f=_['merge']({},_0x3ecd3f,_0x567cf9['options']);return db['FaxMessage'][_0x5d97('0x34')]({'where':_0x3ecd3f[_0x5d97('0x51')]})[_0x5d97('0x3b')](function(_0x34fb8c){_0x42320c[_0x5d97('0x34')]=_0x34fb8c;if(_0x567cf9[_0x5d97('0x47')][_0x5d97('0x57')]){_0x3ecd3f[_0x5d97('0x58')]=[{'all':!![]}];}return db[_0x5d97('0xa9')][_0x5d97('0x59')](_0x3ecd3f);})[_0x5d97('0x3b')](function(_0x3594a1){_0x42320c[_0x5d97('0x5a')]=_0x3594a1;return _0x42320c;});}})[_0x5d97('0x3b')](respondWithFilteredResult(_0xbb7185,_0x3ecd3f))[_0x5d97('0x2c')](handleError(_0xbb7185,null));};exports[_0x5d97('0x8a')]=function(_0x4d5421,_0x37f7aa,_0xc24cb5){var _0xbee914,_0x42652b={},_0x10792d;if(_0x4d5421[_0x5d97('0x5e')]['to']){_0x10792d=_0x4d5421[_0x5d97('0x5e')]['to'][0x0];}return db[_0x5d97('0x41')][_0x5d97('0x5d')]({'where':{'id':_0x4d5421['params']['id']},'include':[{'model':db[_0x5d97('0xae')],'as':_0x5d97('0xaf'),'include':[{'model':db[_0x5d97('0xb0')],'as':_0x5d97('0xb1'),'where':{'fax':_0x10792d},'limit':0x1,'order':[[_0x5d97('0xa5'),_0x5d97('0xb2')]]}]}]})[_0x5d97('0x3b')](handleEntityNotFound(_0x37f7aa,null))['then'](function(_0x1d1ecc){_0xbee914=_0x1d1ecc;if(_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')]&&_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][_0x5d97('0x4d')]){for(var _0x462f9f=0x0;_0x462f9f<_0x4d5421['body'][_0x5d97('0xb3')][_0x5d97('0x4d')];_0x462f9f+=0x1){_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][_0x462f9f]={'filename':_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][_0x462f9f][_0x5d97('0x3e')],'id':_0x4d5421['body'][_0x5d97('0xb3')][_0x462f9f]['id'],'path':path['join'](config['root'],_0x5d97('0xb4'),_0x4d5421['body']['attachments'][_0x462f9f][_0x5d97('0xb5')])};}}return respondWithRpcPromise(_0x5d97('0xb6'),'CheckAfterSend',{'FaxAccountId':_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5c')]['id'])?undefined:_0x4d5421[_0x5d97('0x5c')]['id'],'path':_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5e')]['attachments'][0x0][_0x5d97('0x7')])?undefined:_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0][_0x5d97('0x7')],'fax':_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5e')]['to'][0x0])?undefined:_0x4d5421[_0x5d97('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0xbee914){if(_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5e')]['from'])){_0x4d5421['body'][_0x5d97('0xb8')]=util[_0x5d97('0xac')](_0x5d97('0xb9'),_0xbee914[_0x5d97('0x3e')],_0xbee914[_0x5d97('0xba')]);}if(_0xbee914[_0x5d97('0xaf')]){if(_0xbee914[_0x5d97('0xaf')]['Contacts'][_0x5d97('0x4d')]){return _0xbee914[_0x5d97('0xaf')]['Contacts'][0x0];}else{return db[_0x5d97('0xb0')][_0x5d97('0x65')](_[_0x5d97('0xbb')](_0x4d5421[_0x5d97('0x5e')],{'firstName':_0x4d5421[_0x5d97('0x5e')]['to'][0x0],'phone':_0x4d5421['body']['to'][0x0],'fax':_0x4d5421[_0x5d97('0x5e')]['to'][0x0],'ListId':_0xbee914['ListId']}));}}else{throw new Error(_0x5d97('0xbc'));}}else{throw new Error(_0x5d97('0xbd'));}})['then'](function(_0x4c5b13){if(_0x4c5b13){return db['FaxInteraction'][_0x5d97('0x5d')]({'where':{'ContactId':_0x4c5b13['id'],'closed':![],'FaxAccountId':_0xbee914['id']}})[_0x5d97('0x3b')](function(_0xcc70a1){if(_0xcc70a1){return[_0xcc70a1,![]];}return db[_0x5d97('0x75')][_0x5d97('0x65')]({'UserId':_0x4d5421[_0x5d97('0x5f')]['id'],'ContactId':_0x4c5b13['id'],'FaxAccountId':_0xbee914['id'],'fax':_0x4d5421[_0x5d97('0x5e')]['to'][0x0],'firstMsgDirection':_0x5d97('0xbe'),'Messages':[_[_0x5d97('0x54')](_0x4d5421[_0x5d97('0x5e')],{'read':![],'body':_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0][_0x5d97('0xbf')],'FaxAccountId':_0xbee914['id'],'UserId':_0x4d5421[_0x5d97('0x5f')]['id'],'ContactId':_0x4c5b13['id'],'AttachmentId':_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x5d97('0xc0')}]})[_0x5d97('0x3b')](function(_0x5ae15b){return[_0x5ae15b,!![]];});});}else{throw new Error(_0x5d97('0xc1'));}})[_0x5d97('0xc2')](function(_0x555914,_0x3df16d){if(_0x3df16d){return _0x555914;}return db[_0x5d97('0xa9')][_0x5d97('0x65')]({'direction':'out','read':![],'body':_0x4d5421[_0x5d97('0x5e')]['attachments'][0x0]['filename'],'FaxAccountId':_0xbee914['id'],'FaxInteractionId':_0x555914['id'],'UserId':_0x4d5421['user']['id'],'ContactId':_0x555914['ContactId'],'AttachmentId':_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0]['id']})['then'](function(_0x32382d){_0x555914[_0x5d97('0xc3')][_0x5d97('0xc0')]=[];_0x555914[_0x5d97('0xc3')]['Messages'][_0x5d97('0x93')](_0x32382d['dataValues']);return _0x555914;});})[_0x5d97('0x3b')](function(_0xbd8c87){respondWithRpcPromise('SendFax',_0x5d97('0xc4'),{'FaxAccountId':_['isNil'](_0x4d5421['params']['id'])?undefined:_0x4d5421[_0x5d97('0x5c')]['id'],'path':_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0][_0x5d97('0x7')])?undefined:_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0][_0x5d97('0x7')],'fax':_[_0x5d97('0xb7')](_0x4d5421[_0x5d97('0x5e')]['to'][0x0])?undefined:_0x4d5421['body']['to'][0x0],'AttachmentId':_0x4d5421[_0x5d97('0x5e')][_0x5d97('0xb3')][0x0]['id']},client9002)[_0x5d97('0x3b')](function(_0x574dce){logger[_0x5d97('0x2a')](_0x5d97('0xc5'),_0x574dce);})[_0x5d97('0x2c')](function(_0x2de232){logger[_0x5d97('0x2a')](_0x5d97('0xc5'),_0x2de232);});return _0xbd8c87;})[_0x5d97('0x3b')](respondWithResult(_0x37f7aa,null))['catch'](handleError(_0x37f7aa,null));};exports[_0x5d97('0xc6')]=function(_0xd804dc,_0x22aa0a,_0x26192d){return db[_0x5d97('0x41')][_0x5d97('0x5d')]({'where':{'id':_0xd804dc['params']['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x22aa0a,null))[_0x5d97('0x3b')](function(_0x5e4519){if(_0x5e4519){return _0x5e4519[_0x5d97('0xc6')](_0xd804dc[_0x5d97('0x5e')]['ids'],_[_0x5d97('0x76')](_0xd804dc[_0x5d97('0x5e')],[_0x5d97('0x6f'),'id'])||{})['spread'](function(_0x4574b0){for(var _0x4e1d40=0x0;_0x4e1d40<_0xd804dc[_0x5d97('0x5e')][_0x5d97('0x6f')][_0x5d97('0x4d')];_0x4e1d40+=0x1){socket['emit'](_0x5d97('0xc7'),{'UserId':Number(_0xd804dc[_0x5d97('0x5e')][_0x5d97('0x6f')][_0x4e1d40]),'FaxAccountId':Number(_0xd804dc[_0x5d97('0x5c')]['id'])});}return _0x4574b0;});}})[_0x5d97('0x3b')](respondWithResult(_0x22aa0a,null))[_0x5d97('0x2c')](handleError(_0x22aa0a,null));};exports[_0x5d97('0xc8')]=function(_0x10621f,_0x588d81,_0x5ade69){return db[_0x5d97('0x41')]['find']({'where':{'id':_0x10621f[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x588d81,null))['then'](function(_0x33e75b){if(_0x33e75b){return _0x33e75b['removeAgents'](_0x10621f[_0x5d97('0x47')]['ids'])[_0x5d97('0x3b')](function(){if(_[_0x5d97('0xc9')](_0x10621f[_0x5d97('0x47')][_0x5d97('0x6f')])){for(var _0x2baa07=0x0;_0x2baa07<_0x10621f[_0x5d97('0x47')][_0x5d97('0x6f')][_0x5d97('0x4d')];_0x2baa07+=0x1){socket[_0x5d97('0xca')]('userFaxAccount:remove',{'UserId':Number(_0x10621f[_0x5d97('0x47')][_0x5d97('0x6f')][_0x2baa07]),'FaxAccountId':Number(_0x10621f['params']['id'])});}}else{socket[_0x5d97('0xca')](_0x5d97('0xcb'),{'UserId':Number(_0x10621f[_0x5d97('0x47')]['ids']),'FaxAccountId':Number(_0x10621f[_0x5d97('0x5c')]['id'])});}});}})[_0x5d97('0x3b')](respondWithStatusCode(_0x588d81,null))[_0x5d97('0x2c')](handleError(_0x588d81,null));};exports[_0x5d97('0xcc')]=function(_0x3e149d,_0x540267,_0x3ac843){var _0x37fa6b={};var _0x305108={};var _0x3dac68;var _0x33f00f;return db['FaxAccount'][_0x5d97('0x6c')]({'where':{'id':_0x3e149d[_0x5d97('0x5c')]['id']}})[_0x5d97('0x3b')](handleEntityNotFound(_0x540267,null))['then'](function(_0x22a1c5){if(_0x22a1c5){_0x3dac68=_0x22a1c5;_0x305108[_0x5d97('0x45')]=_[_0x5d97('0x48')](db[_0x5d97('0x7a')][_0x5d97('0x42')]);_0x305108[_0x5d97('0x47')]=_[_0x5d97('0x48')](_0x3e149d[_0x5d97('0x47')]);_0x305108[_0x5d97('0x49')]=_['intersection'](_0x305108['model'],_0x305108[_0x5d97('0x47')]);_0x37fa6b[_0x5d97('0x4c')]=_[_0x5d97('0x4a')](_0x305108['model'],qs[_0x5d97('0x4b')](_0x3e149d[_0x5d97('0x47')][_0x5d97('0x4b')]));_0x37fa6b[_0x5d97('0x4c')]=_0x37fa6b['attributes']['length']?_0x37fa6b[_0x5d97('0x4c')]:_0x305108[_0x5d97('0x45')];_0x37fa6b['order']=qs[_0x5d97('0x50')](_0x3e149d[_0x5d97('0x47')][_0x5d97('0x50')]);_0x37fa6b['where']=qs[_0x5d97('0x49')](_[_0x5d97('0x52')](_0x3e149d[_0x5d97('0x47')],_0x305108[_0x5d97('0x49')]));if(_0x3e149d['query']['filter']){_0x37fa6b[_0x5d97('0x51')]=_[_0x5d97('0x54')](_0x37fa6b[_0x5d97('0x51')],{'$or':_['map'](_0x37fa6b[_0x5d97('0x4c')],function(_0x27e48f){var _0x15d836={};_0x15d836[_0x27e48f]={'$like':'%'+_0x3e149d['query']['filter']+'%'};return _0x15d836;})});}_0x37fa6b=_[_0x5d97('0x54')]({},_0x37fa6b,_0x3e149d['options']);return _0x3dac68[_0x5d97('0xcc')](_0x37fa6b);}})[_0x5d97('0x3b')](function(_0x938252){if(_0x938252){_0x33f00f=_0x938252[_0x5d97('0x4d')];if(!_0x3e149d[_0x5d97('0x47')][_0x5d97('0x6d')]('nolimit')){_0x37fa6b[_0x5d97('0x32')]=qs[_0x5d97('0x32')](_0x3e149d[_0x5d97('0x47')][_0x5d97('0x32')]);_0x37fa6b['offset']=qs[_0x5d97('0x31')](_0x3e149d['query'][_0x5d97('0x31')]);}return _0x3dac68[_0x5d97('0xcc')](_0x37fa6b);}})[_0x5d97('0x3b')](function(_0x1c523f){if(_0x1c523f){return _0x1c523f?{'count':_0x33f00f,'rows':_0x1c523f}:null;}})[_0x5d97('0x3b')](respondWithResult(_0x540267,null))[_0x5d97('0x2c')](handleError(_0x540267,null));}; \ No newline at end of file +var _0xaf7a=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','FaxAccount','rows','show','params','mandatoryDispositionPause','keys','fields','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','ReceiveFax','VoiceExtension','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\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','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus'];(function(_0x56de82,_0x2a0650){var _0xb4a459=function(_0x367036){while(--_0x367036){_0x56de82['push'](_0x56de82['shift']());}};_0xb4a459(++_0x2a0650);}(_0xaf7a,0x15c));var _0xaaf7=function(_0x226893,_0x5c76fa){_0x226893=_0x226893-0x0;var _0x190b66=_0xaf7a[_0x226893];return _0x190b66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf7('0x0'));var zipdir=require(_0xaaf7('0x1'));var jsonpatch=require(_0xaaf7('0x2'));var rp=require(_0xaaf7('0x3'));var moment=require('moment');var BPromise=require(_0xaaf7('0x4'));var Mustache=require('mustache');var util=require(_0xaaf7('0x5'));var path=require(_0xaaf7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaaf7('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaaf7('0x8'));var toCsv=require('to-csv');var querystring=require(_0xaaf7('0x9'));var Papa=require(_0xaaf7('0xa'));var Redis=require(_0xaaf7('0xb'));var authService=require(_0xaaf7('0xc'));var qs=require(_0xaaf7('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaaf7('0xe'));var logger=require(_0xaaf7('0xf'))(_0xaaf7('0x10'));var utils=require('../../config/utils');var config=require(_0xaaf7('0x11'));var licenseUtil=require(_0xaaf7('0x12'));var db=require(_0xaaf7('0x13'))['db'];config[_0xaaf7('0x14')]=_[_0xaaf7('0x15')](config[_0xaaf7('0x14')],{'host':_0xaaf7('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaf7('0x14')]));require('./faxAccount.socket')[_0xaaf7('0x17')](socket);var jayson=require(_0xaaf7('0x18'));var client=jayson[_0xaaf7('0x19')][_0xaaf7('0x1a')]({'port':0x232c});var client9002=jayson[_0xaaf7('0x19')][_0xaaf7('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x36897c,_0x357950,_0x4e013c,_0x1f8ff9){return new BPromise(function(_0xa4c142,_0x56d34d){var _0x20d741=_0x1f8ff9||client;return _0x20d741['request'](_0x36897c,_0x4e013c)[_0xaaf7('0x1b')](function(_0x21c6ab){logger[_0xaaf7('0x1c')](_0xaaf7('0x1d'),_0x357950,_0xaaf7('0x1e'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x357950,_0xaaf7('0x1e'),JSON['stringify'](_0x21c6ab));if(_0x21c6ab['error']){if(_0x21c6ab[_0xaaf7('0x1f')]['code']===0x1f4){logger[_0xaaf7('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x357950,_0x21c6ab['error'][_0xaaf7('0x20')]);return _0x56d34d(_0x21c6ab[_0xaaf7('0x1f')][_0xaaf7('0x20')]);}logger[_0xaaf7('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x357950,_0x21c6ab['error'][_0xaaf7('0x20')]);return _0xa4c142(_0x21c6ab[_0xaaf7('0x1f')][_0xaaf7('0x20')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x357950,_0xaaf7('0x1e'));_0xa4c142(_0x21c6ab[_0xaaf7('0x21')][_0xaaf7('0x20')]);}})[_0xaaf7('0x22')](function(_0x59f113){logger[_0xaaf7('0x1f')](_0xaaf7('0x1d'),_0x357950,_0x59f113);_0x56d34d(_0x59f113);});});}function respondWithStatusCode(_0x34b441,_0x1544c8){_0x1544c8=_0x1544c8||0xcc;return function(_0x159a28){if(_0x159a28){return _0x34b441[_0xaaf7('0x23')](_0x1544c8);}return _0x34b441['status'](_0x1544c8)[_0xaaf7('0x24')]();};}function respondWithResult(_0x3aff86,_0x1cc172){_0x1cc172=_0x1cc172||0xc8;return function(_0x1d9a8d){if(_0x1d9a8d){return _0x3aff86[_0xaaf7('0x25')](_0x1cc172)['json'](_0x1d9a8d);}};}function respondWithFilteredResult(_0x32d3c1,_0x2e3323){return function(_0x3d135e){if(_0x3d135e){var _0x3a9e18=typeof _0x2e3323[_0xaaf7('0x26')]===_0xaaf7('0x27')&&typeof _0x2e3323[_0xaaf7('0x28')]===_0xaaf7('0x27');var _0x593772=_0x3d135e[_0xaaf7('0x29')];var _0x27669b=_0x3a9e18?0x0:_0x2e3323[_0xaaf7('0x26')];var _0x36837c=_0x3a9e18?_0x3d135e[_0xaaf7('0x29')]:_0x2e3323[_0xaaf7('0x26')]+_0x2e3323[_0xaaf7('0x28')];var _0x4f65c4;if(_0x36837c>=_0x593772){_0x36837c=_0x593772;_0x4f65c4=0xc8;}else{_0x4f65c4=0xce;}_0x32d3c1[_0xaaf7('0x25')](_0x4f65c4);return _0x32d3c1[_0xaaf7('0x2a')](_0xaaf7('0x2b'),_0x27669b+'-'+_0x36837c+'/'+_0x593772)[_0xaaf7('0x2c')](_0x3d135e);}return null;};}function patchUpdates(_0x248c18){return function(_0x40fa44){try{jsonpatch[_0xaaf7('0x2d')](_0x40fa44,_0x248c18,!![]);}catch(_0x593ae8){return BPromise[_0xaaf7('0x2e')](_0x593ae8);}return _0x40fa44[_0xaaf7('0x2f')]();};}function saveUpdates(_0x52037e,_0x13c3dd){return function(_0xaab878){if(_0xaab878){return _0xaab878[_0xaaf7('0x30')](_0x52037e)['then'](function(_0x47653b){return _0x47653b;});}return null;};}function removeEntity(_0x1c43a0,_0x57992b){return function(_0xf3cba1){if(_0xf3cba1){return _0xf3cba1['destroy']()[_0xaaf7('0x1b')](function(){var _0xf4e956=_0xf3cba1[_0xaaf7('0x31')]({'plain':!![]});var _0x4a7156=_0xaaf7('0x32');return db[_0xaaf7('0x33')][_0xaaf7('0x34')]({'where':{'type':_0x4a7156,'resourceId':_0xf4e956['id']}})[_0xaaf7('0x1b')](function(){return _0xf3cba1;});})[_0xaaf7('0x1b')](function(){_0x1c43a0[_0xaaf7('0x25')](0xcc)[_0xaaf7('0x24')]();});}};}function handleEntityNotFound(_0x4496cc,_0x3818b9){return function(_0x174dc7){if(!_0x174dc7){_0x4496cc[_0xaaf7('0x23')](0x194);}return _0x174dc7;};}function handleError(_0x3f2376,_0x14c402){_0x14c402=_0x14c402||0x1f4;return function(_0x42280b){logger[_0xaaf7('0x1f')](_0x42280b[_0xaaf7('0x35')]);if(_0x42280b[_0xaaf7('0x36')]){delete _0x42280b[_0xaaf7('0x36')];}_0x3f2376['status'](_0x14c402)[_0xaaf7('0x37')](_0x42280b);};}exports[_0xaaf7('0x38')]=function(_0x1cffa3,_0x7f5013){var _0x2e4d2a={'include':[{'model':db[_0xaaf7('0x39')],'as':'mandatoryDispositionPause'}]},_0x490d24={},_0x55cc5d={'count':0x0,'rows':[]};var _0x2083f0=_[_0xaaf7('0x3a')](db['FaxAccount'][_0xaaf7('0x3b')],function(_0x2c6663){return{'name':_0x2c6663[_0xaaf7('0x3c')],'type':_0x2c6663[_0xaaf7('0x3d')][_0xaaf7('0x3e')]};});_0x490d24['model']=_[_0xaaf7('0x3a')](_0x2083f0,_0xaaf7('0x36'));_0x490d24[_0xaaf7('0x3f')]=_['keys'](_0x1cffa3['query']);_0x490d24[_0xaaf7('0x40')]=_[_0xaaf7('0x41')](_0x490d24[_0xaaf7('0x42')],_0x490d24[_0xaaf7('0x3f')]);_0x2e4d2a[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0x490d24['model'],qs['fields'](_0x1cffa3[_0xaaf7('0x3f')]['fields']));_0x2e4d2a['attributes']=_0x2e4d2a[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0x2e4d2a[_0xaaf7('0x43')]:_0x490d24['model'];if(!_0x1cffa3[_0xaaf7('0x3f')][_0xaaf7('0x45')](_0xaaf7('0x46'))){_0x2e4d2a[_0xaaf7('0x28')]=qs[_0xaaf7('0x28')](_0x1cffa3['query'][_0xaaf7('0x28')]);_0x2e4d2a[_0xaaf7('0x26')]=qs[_0xaaf7('0x26')](_0x1cffa3[_0xaaf7('0x3f')]['offset']);}_0x2e4d2a[_0xaaf7('0x47')]=qs[_0xaaf7('0x48')](_0x1cffa3['query']['sort']);_0x2e4d2a['where']=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0x1cffa3['query'],_0x490d24[_0xaaf7('0x40')]),_0x2083f0);if(_0x1cffa3[_0xaaf7('0x3f')][_0xaaf7('0x4a')]){_0x2e4d2a[_0xaaf7('0x4b')]=_[_0xaaf7('0x4c')](_0x2e4d2a[_0xaaf7('0x4b')],{'$or':_[_0xaaf7('0x3a')](_0x2083f0,function(_0x2b6d77){if(_0x2b6d77[_0xaaf7('0x3d')]!==_0xaaf7('0x4d')){var _0x546be9={};_0x546be9[_0x2b6d77[_0xaaf7('0x36')]]={'$like':'%'+_0x1cffa3[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x546be9;}})});}_0x2e4d2a=_[_0xaaf7('0x4c')]({},_0x2e4d2a,_0x1cffa3['options']);var _0x227b0e={'where':_0x2e4d2a[_0xaaf7('0x4b')]};return db['FaxAccount'][_0xaaf7('0x29')](_0x227b0e)[_0xaaf7('0x1b')](function(_0x18110f){_0x55cc5d['count']=_0x18110f;if(_0x1cffa3['query']['includeAll']){_0x2e4d2a[_0xaaf7('0x4e')]=[{'all':!![]}];}return db[_0xaaf7('0x4f')]['findAll'](_0x2e4d2a);})[_0xaaf7('0x1b')](function(_0x5d4604){_0x55cc5d[_0xaaf7('0x50')]=_0x5d4604;return _0x55cc5d;})[_0xaaf7('0x1b')](respondWithFilteredResult(_0x7f5013,_0x2e4d2a))[_0xaaf7('0x22')](handleError(_0x7f5013,null));};exports[_0xaaf7('0x51')]=function(_0x1e3285,_0x218c02){var _0x23ff90={'raw':![],'where':{'id':_0x1e3285[_0xaaf7('0x52')]['id']},'include':[{'model':db[_0xaaf7('0x39')],'as':_0xaaf7('0x53')}]},_0x5d05f8={};_0x5d05f8[_0xaaf7('0x42')]=_[_0xaaf7('0x54')](db[_0xaaf7('0x4f')][_0xaaf7('0x3b')]);_0x5d05f8[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0x1e3285['query']);_0x5d05f8[_0xaaf7('0x40')]=_[_0xaaf7('0x41')](_0x5d05f8[_0xaaf7('0x42')],_0x5d05f8[_0xaaf7('0x3f')]);_0x23ff90[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0x5d05f8[_0xaaf7('0x42')],qs['fields'](_0x1e3285[_0xaaf7('0x3f')][_0xaaf7('0x55')]));_0x23ff90[_0xaaf7('0x43')]=_0x23ff90[_0xaaf7('0x43')]['length']?_0x23ff90[_0xaaf7('0x43')]:_0x5d05f8['model'];if(_0x1e3285[_0xaaf7('0x3f')][_0xaaf7('0x56')]){_0x23ff90['include']=[{'all':!![]}];}_0x23ff90=_['merge']({},_0x23ff90,_0x1e3285[_0xaaf7('0x57')]);return db[_0xaaf7('0x4f')]['find'](_0x23ff90)[_0xaaf7('0x1b')](handleEntityNotFound(_0x218c02,null))[_0xaaf7('0x1b')](respondWithResult(_0x218c02,null))[_0xaaf7('0x22')](handleError(_0x218c02,null));};exports[_0xaaf7('0x58')]=function(_0x161231,_0x26fd06){return db[_0xaaf7('0x4f')][_0xaaf7('0x58')](_0x161231['body'],{})[_0xaaf7('0x1b')](function(_0x427742){var _0x428776=_0x161231[_0xaaf7('0x59')][_0xaaf7('0x31')]({'plain':!![]});if(!_0x428776)throw new Error(_0xaaf7('0x5a'));if(_0x428776[_0xaaf7('0x5b')]==='user'){var _0x2ad6b4=_0x427742['get']({'plain':!![]});var _0x1e42e5='FaxAccounts';return db[_0xaaf7('0x5c')][_0xaaf7('0x5d')]({'where':{'name':_0x1e42e5,'userProfileId':_0x428776[_0xaaf7('0x5e')]},'raw':!![]})[_0xaaf7('0x1b')](function(_0x14d99a){if(_0x14d99a&&_0x14d99a[_0xaaf7('0x5f')]===0x0){return db[_0xaaf7('0x33')]['create']({'name':_0x2ad6b4[_0xaaf7('0x36')],'resourceId':_0x2ad6b4['id'],'type':_0x14d99a[_0xaaf7('0x36')],'sectionId':_0x14d99a['id']},{})['then'](function(){return _0x427742;});}else{return _0x427742;}})[_0xaaf7('0x22')](function(_0x4e03f5){logger[_0xaaf7('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e03f5);throw _0x4e03f5;});}return _0x427742;})[_0xaaf7('0x1b')](respondWithResult(_0x26fd06,0xc9))[_0xaaf7('0x22')](handleError(_0x26fd06,null));};exports[_0xaaf7('0x30')]=function(_0x442bb4,_0x2ae620){if(_0x442bb4[_0xaaf7('0x60')]['id']){delete _0x442bb4[_0xaaf7('0x60')]['id'];}return db[_0xaaf7('0x4f')][_0xaaf7('0x5d')]({'where':{'id':_0x442bb4[_0xaaf7('0x52')]['id']},'include':[{'model':db[_0xaaf7('0x39')],'as':'mandatoryDispositionPause'}]})[_0xaaf7('0x1b')](handleEntityNotFound(_0x2ae620,null))['then'](saveUpdates(_0x442bb4[_0xaaf7('0x60')],null))[_0xaaf7('0x1b')](respondWithResult(_0x2ae620,null))[_0xaaf7('0x22')](handleError(_0x2ae620,null));};exports[_0xaaf7('0x34')]=function(_0x2ec548,_0x609ccd){return db[_0xaaf7('0x4f')][_0xaaf7('0x5d')]({'where':{'id':_0x2ec548['params']['id']}})['then'](handleEntityNotFound(_0x609ccd,null))[_0xaaf7('0x1b')](removeEntity(_0x609ccd,null))[_0xaaf7('0x22')](handleError(_0x609ccd,null));};exports[_0xaaf7('0x61')]=function(_0x5d3571,_0x56d202){return db[_0xaaf7('0x4f')]['describe']()[_0xaaf7('0x1b')](respondWithResult(_0x56d202,null))[_0xaaf7('0x22')](handleError(_0x56d202,null));};exports[_0xaaf7('0x62')]=function(_0x39dd6b,_0x13da10,_0xf1a49b){if(_0x39dd6b['body']['id']){delete _0x39dd6b[_0xaaf7('0x60')]['id'];}return db['FaxAccount'][_0xaaf7('0x5d')]({'where':{'id':_0x39dd6b[_0xaaf7('0x52')]['id']}})['then'](handleEntityNotFound(_0x13da10,null))[_0xaaf7('0x1b')](function(_0x501f76){if(_0x501f76){_0x39dd6b[_0xaaf7('0x60')]['FaxAccountId']=_0x501f76['id'];return db[_0xaaf7('0x63')][_0xaaf7('0x58')](_0x39dd6b[_0xaaf7('0x60')]);}})[_0xaaf7('0x1b')](respondWithResult(_0x13da10,null))[_0xaaf7('0x22')](handleError(_0x13da10,null));};exports['getDispositions']=function(_0x459de9,_0x353c09,_0x5ae1bd){var _0xacc1b5={'raw':![],'where':{}};var _0xdff1ef={};var _0x3f0b01={'count':0x0,'rows':[]};return db['FaxAccount'][_0xaaf7('0x64')]({'where':{'id':_0x459de9['params']['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x353c09,null))[_0xaaf7('0x1b')](function(_0x1ee6c7){if(_0x1ee6c7){_0xdff1ef[_0xaaf7('0x42')]=_[_0xaaf7('0x54')](db[_0xaaf7('0x63')][_0xaaf7('0x3b')]);_0xdff1ef[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0x459de9[_0xaaf7('0x3f')]);_0xdff1ef['filters']=_[_0xaaf7('0x41')](_0xdff1ef[_0xaaf7('0x42')],_0xdff1ef[_0xaaf7('0x3f')]);_0xacc1b5[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0xdff1ef[_0xaaf7('0x42')],qs[_0xaaf7('0x55')](_0x459de9[_0xaaf7('0x3f')][_0xaaf7('0x55')]));_0xacc1b5[_0xaaf7('0x43')]=_0xacc1b5[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0xacc1b5[_0xaaf7('0x43')]:_0xdff1ef['model'];if(!_0x459de9[_0xaaf7('0x3f')][_0xaaf7('0x45')](_0xaaf7('0x46'))){_0xacc1b5[_0xaaf7('0x28')]=qs['limit'](_0x459de9['query'][_0xaaf7('0x28')]);_0xacc1b5['offset']=qs[_0xaaf7('0x26')](_0x459de9[_0xaaf7('0x3f')]['offset']);}_0xacc1b5[_0xaaf7('0x47')]=qs['sort'](_0x459de9['query'][_0xaaf7('0x48')]);_0xacc1b5['where']=qs['filters'](_[_0xaaf7('0x49')](_0x459de9[_0xaaf7('0x3f')],_0xdff1ef[_0xaaf7('0x40')]));_0xacc1b5[_0xaaf7('0x4b')]['FaxAccountId']=_0x1ee6c7['id'];if(_0x459de9[_0xaaf7('0x3f')][_0xaaf7('0x4a')]){_0xacc1b5[_0xaaf7('0x4b')]=_[_0xaaf7('0x4c')](_0xacc1b5['where'],{'$or':_[_0xaaf7('0x3a')](_0xacc1b5[_0xaaf7('0x43')],function(_0x525716){var _0x25ec9c={};_0x25ec9c[_0x525716]={'$like':'%'+_0x459de9[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x25ec9c;})});}_0xacc1b5=_[_0xaaf7('0x4c')]({},_0xacc1b5,_0x459de9[_0xaaf7('0x57')]);return db[_0xaaf7('0x63')]['count']({'where':_0xacc1b5[_0xaaf7('0x4b')]})[_0xaaf7('0x1b')](function(_0x44613f){_0x3f0b01[_0xaaf7('0x29')]=_0x44613f;if(_0x459de9[_0xaaf7('0x3f')][_0xaaf7('0x56')]){_0xacc1b5['include']=[{'all':!![]}];}return db[_0xaaf7('0x63')][_0xaaf7('0x65')](_0xacc1b5);})[_0xaaf7('0x1b')](function(_0xf9320d){_0x3f0b01['rows']=_0xf9320d;return _0x3f0b01;});}})[_0xaaf7('0x1b')](respondWithFilteredResult(_0x353c09,_0xacc1b5))[_0xaaf7('0x22')](handleError(_0x353c09,null));};exports[_0xaaf7('0x66')]=function(_0x631a5e,_0x5a1796,_0x58e72a){return db[_0xaaf7('0x4f')]['find']({'where':{'id':_0x631a5e[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x5a1796,null))[_0xaaf7('0x1b')](function(_0x4b5baf){if(_0x4b5baf){return _0x4b5baf[_0xaaf7('0x66')](_0x631a5e[_0xaaf7('0x3f')][_0xaaf7('0x67')]);}})['then'](respondWithStatusCode(_0x5a1796,null))[_0xaaf7('0x22')](handleError(_0x5a1796,null));};exports[_0xaaf7('0x68')]=function(_0x336976,_0x2b707d,_0x166285){if(_0x336976[_0xaaf7('0x60')]['id']){delete _0x336976[_0xaaf7('0x60')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x336976[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x2b707d,null))[_0xaaf7('0x1b')](function(_0x31794d){if(_0x31794d){_0x336976[_0xaaf7('0x60')][_0xaaf7('0x69')]=_0x31794d['id'];return db[_0xaaf7('0x6a')][_0xaaf7('0x58')](_0x336976['body']);}})[_0xaaf7('0x1b')](respondWithResult(_0x2b707d,null))[_0xaaf7('0x22')](handleError(_0x2b707d,null));};exports[_0xaaf7('0x6b')]=function(_0x5cf6cb,_0x14adde,_0x42e27f){var _0x4b887a={'raw':![],'where':{}};var _0x3d499e={};var _0x33ecbd={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5cf6cb[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x14adde,null))[_0xaaf7('0x1b')](function(_0x4cb10d){if(_0x4cb10d){_0x3d499e[_0xaaf7('0x42')]=_[_0xaaf7('0x54')](db['CannedAnswer'][_0xaaf7('0x3b')]);_0x3d499e[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0x5cf6cb['query']);_0x3d499e[_0xaaf7('0x40')]=_[_0xaaf7('0x41')](_0x3d499e[_0xaaf7('0x42')],_0x3d499e[_0xaaf7('0x3f')]);_0x4b887a[_0xaaf7('0x43')]=_['intersection'](_0x3d499e[_0xaaf7('0x42')],qs[_0xaaf7('0x55')](_0x5cf6cb[_0xaaf7('0x3f')]['fields']));_0x4b887a[_0xaaf7('0x43')]=_0x4b887a[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0x4b887a[_0xaaf7('0x43')]:_0x3d499e[_0xaaf7('0x42')];if(!_0x5cf6cb[_0xaaf7('0x3f')][_0xaaf7('0x45')](_0xaaf7('0x46'))){_0x4b887a['limit']=qs[_0xaaf7('0x28')](_0x5cf6cb[_0xaaf7('0x3f')]['limit']);_0x4b887a['offset']=qs['offset'](_0x5cf6cb[_0xaaf7('0x3f')][_0xaaf7('0x26')]);}_0x4b887a[_0xaaf7('0x47')]=qs[_0xaaf7('0x48')](_0x5cf6cb['query'][_0xaaf7('0x48')]);_0x4b887a[_0xaaf7('0x4b')]=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0x5cf6cb[_0xaaf7('0x3f')],_0x3d499e[_0xaaf7('0x40')]));_0x4b887a[_0xaaf7('0x4b')][_0xaaf7('0x69')]=_0x4cb10d['id'];if(_0x5cf6cb[_0xaaf7('0x3f')][_0xaaf7('0x4a')]){_0x4b887a[_0xaaf7('0x4b')]=_['merge'](_0x4b887a[_0xaaf7('0x4b')],{'$or':_[_0xaaf7('0x3a')](_0x4b887a[_0xaaf7('0x43')],function(_0x35d86a){var _0x204ff0={};_0x204ff0[_0x35d86a]={'$like':'%'+_0x5cf6cb[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x204ff0;})});}_0x4b887a=_['merge']({},_0x4b887a,_0x5cf6cb[_0xaaf7('0x57')]);return db[_0xaaf7('0x6a')][_0xaaf7('0x29')]({'where':_0x4b887a[_0xaaf7('0x4b')]})[_0xaaf7('0x1b')](function(_0x2584a8){_0x33ecbd[_0xaaf7('0x29')]=_0x2584a8;if(_0x5cf6cb[_0xaaf7('0x3f')][_0xaaf7('0x56')]){_0x4b887a[_0xaaf7('0x4e')]=[{'all':!![]}];}return db[_0xaaf7('0x6a')]['findAll'](_0x4b887a);})['then'](function(_0x5443b7){_0x33ecbd[_0xaaf7('0x50')]=_0x5443b7;return _0x33ecbd;});}})[_0xaaf7('0x1b')](respondWithFilteredResult(_0x14adde,_0x4b887a))[_0xaaf7('0x22')](handleError(_0x14adde,null));};exports['removeAnswers']=function(_0x4c3880,_0x576f11,_0x2220f3){return db[_0xaaf7('0x4f')][_0xaaf7('0x5d')]({'where':{'id':_0x4c3880[_0xaaf7('0x52')]['id']}})['then'](handleEntityNotFound(_0x576f11,null))[_0xaaf7('0x1b')](function(_0x37f985){if(_0x37f985){return _0x37f985[_0xaaf7('0x6c')](_0x4c3880['query']['ids']);}})[_0xaaf7('0x1b')](respondWithStatusCode(_0x576f11,null))['catch'](handleError(_0x576f11,null));};exports['addInteraction']=function(_0x34ffc1,_0x3a96f8,_0x2b8dc2){return db[_0xaaf7('0x6d')][_0xaaf7('0x5d')]({'where':{'id':_0x34ffc1[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x3a96f8,null))['then'](function(_0x2aa4bb){if(_0x2aa4bb){return _0x2aa4bb[_0xaaf7('0x6e')](_0x34ffc1[_0xaaf7('0x60')][_0xaaf7('0x67')],_[_0xaaf7('0x6f')](_0x34ffc1['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3a96f8,null))['catch'](handleError(_0x3a96f8,null));};exports[_0xaaf7('0x70')]=function(_0x2b389d,_0x131107,_0x1be3d7){var _0x330868={'raw':![],'where':{}};var _0x1bd8c7={};var _0x37630e={'count':0x0,'rows':[]};return db['FaxAccount'][_0xaaf7('0x64')]({'where':{'id':_0x2b389d['params']['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x131107,null))[_0xaaf7('0x1b')](function(_0x1044e4){if(_0x1044e4){_0x1bd8c7['model']=_[_0xaaf7('0x54')](db[_0xaaf7('0x6d')]['rawAttributes']);_0x1bd8c7[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0x2b389d[_0xaaf7('0x3f')]);_0x1bd8c7[_0xaaf7('0x40')]=_[_0xaaf7('0x41')](_0x1bd8c7['model'],_0x1bd8c7[_0xaaf7('0x3f')]);_0x330868[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0x1bd8c7[_0xaaf7('0x42')],qs[_0xaaf7('0x55')](_0x2b389d[_0xaaf7('0x3f')]['fields']));_0x330868['attributes']=_0x330868[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0x330868['attributes']:_0x1bd8c7[_0xaaf7('0x42')];if(!_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x45')](_0xaaf7('0x46'))){_0x330868[_0xaaf7('0x28')]=qs['limit'](_0x2b389d[_0xaaf7('0x3f')]['limit']);_0x330868['offset']=qs[_0xaaf7('0x26')](_0x2b389d['query'][_0xaaf7('0x26')]);}_0x330868[_0xaaf7('0x47')]=qs[_0xaaf7('0x48')](_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x48')]);_0x330868[_0xaaf7('0x4b')]=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0x2b389d['query'],_0x1bd8c7[_0xaaf7('0x40')]));_0x330868[_0xaaf7('0x4b')][_0xaaf7('0x69')]=_0x1044e4['id'];if(_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x4a')]){_0x330868['where']=_[_0xaaf7('0x4c')](_0x330868[_0xaaf7('0x4b')],{'$or':_['map'](_0x330868[_0xaaf7('0x43')],function(_0xbdc322){var _0x459065={};_0x459065[_0xbdc322]={'$like':'%'+_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x459065;})});}_0x330868=_[_0xaaf7('0x4c')]({},_0x330868,_0x2b389d[_0xaaf7('0x57')]);return db[_0xaaf7('0x6d')][_0xaaf7('0x29')]({'where':_0x330868[_0xaaf7('0x4b')]})['then'](function(_0x4578b0){_0x37630e[_0xaaf7('0x29')]=_0x4578b0;if(_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x56')]){_0x330868[_0xaaf7('0x4e')]=[{'model':db[_0xaaf7('0x71')],'as':_0xaaf7('0x72'),'required':![]},{'model':db[_0xaaf7('0x73')],'as':_0xaaf7('0x74'),'attributes':[_0xaaf7('0x36'),_0xaaf7('0x75'),_0xaaf7('0x76')],'required':![]},{'model':db[_0xaaf7('0x77')],'as':_0xaaf7('0x78'),'attributes':['id','name','color'],'where':_0x2b389d['query']['tag']?{'id':_0x2b389d[_0xaaf7('0x3f')]['tag']}:undefined,'required':_0x2b389d[_0xaaf7('0x3f')][_0xaaf7('0x79')]?!![]:![]}];}return db[_0xaaf7('0x6d')][_0xaaf7('0x65')](_0x330868);})['then'](function(_0x3b45f6){_0x37630e[_0xaaf7('0x50')]=_0x3b45f6;return _0x37630e;});}})[_0xaaf7('0x1b')](respondWithFilteredResult(_0x131107,_0x330868))['catch'](handleError(_0x131107,null));};exports[_0xaaf7('0x7a')]=function(_0x6fb07b,_0x53d774){var _0xb0839e=_0x6fb07b[_0xaaf7('0x52')]['id'];var _0x56c1ab=_0x6fb07b[_0xaaf7('0x60')];var _0x23a4ff=0xc8;var _0x58e122=null;return db[_0xaaf7('0x7b')][_0xaaf7('0x7c')]({'isolationLevel':db[_0xaaf7('0x7b')][_0xaaf7('0x7d')]['ISOLATION_LEVELS'][_0xaaf7('0x7e')]},function(_0x395860){return db[_0xaaf7('0x4f')][_0xaaf7('0x64')]({'where':{'id':_0xb0839e},'transaction':_0x395860})[_0xaaf7('0x1b')](function(_0x5208b5){if(_0x5208b5){return db[_0xaaf7('0x7f')][_0xaaf7('0x34')]({'where':{'FaxAccountId':_0xb0839e},'transaction':_0x395860})[_0xaaf7('0x1b')](function(){var _0x58beb9=_[_0xaaf7('0x3a')](_0x56c1ab,function(_0x5f1a60){_0x5f1a60['FaxAccountId']=_0xb0839e;return _0x5f1a60;});return db[_0xaaf7('0x7f')][_0xaaf7('0x80')](_0x58beb9,{'transaction':_0x395860});});}else{_0x23a4ff=0x194;_0x58e122=[];}});})[_0xaaf7('0x1b')](function(){if(_0x23a4ff!==0x194){return db[_0xaaf7('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0xb0839e},'order':_0xaaf7('0x81')})[_0xaaf7('0x1b')](function(_0x4e2129){_0x58e122=_0x4e2129;});}})['catch'](function(_0x29a182){_0x23a4ff=0x1f4;logger[_0xaaf7('0x1f')](_0x29a182['stack']);if(_0x29a182['name']){delete _0x29a182[_0xaaf7('0x36')];}_0x58e122=_0x29a182;})[_0xaaf7('0x82')](function(){if(_0x58e122===null){_0x53d774[_0xaaf7('0x23')](_0x23a4ff);}else{if(_0x23a4ff===0x1f4){_0x53d774[_0xaaf7('0x25')](_0x23a4ff)[_0xaaf7('0x37')](_0x58e122);}else{_0x53d774['status'](_0x23a4ff)[_0xaaf7('0x2c')](_0x58e122);}}});};exports[_0xaaf7('0x83')]=function(_0x9fcb7e,_0x3fc0da,_0xe1a2f9){var _0x3691b6={};var _0xad96ae={};var _0x34984a;var _0x1628c8;return db[_0xaaf7('0x4f')][_0xaaf7('0x64')]({'where':{'id':_0x9fcb7e[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x3fc0da,null))[_0xaaf7('0x1b')](function(_0x90cf6c){if(_0x90cf6c){_0x34984a=_0x90cf6c;_0xad96ae[_0xaaf7('0x42')]=_[_0xaaf7('0x54')](db[_0xaaf7('0x7f')]['rawAttributes']);_0xad96ae[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0x9fcb7e['query']);_0xad96ae[_0xaaf7('0x40')]=_[_0xaaf7('0x41')](_0xad96ae[_0xaaf7('0x42')],_0xad96ae[_0xaaf7('0x3f')]);_0x3691b6[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0xad96ae['model'],qs['fields'](_0x9fcb7e[_0xaaf7('0x3f')][_0xaaf7('0x55')]));_0x3691b6['attributes']=_0x3691b6[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0x3691b6['attributes']:_0xad96ae[_0xaaf7('0x42')];_0x3691b6['order']=qs['sort'](_0x9fcb7e['query'][_0xaaf7('0x48')]);_0x3691b6[_0xaaf7('0x4b')]=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0x9fcb7e[_0xaaf7('0x3f')],_0xad96ae[_0xaaf7('0x40')]));if(_0x9fcb7e['query']['filter']){_0x3691b6[_0xaaf7('0x4b')]=_['merge'](_0x3691b6[_0xaaf7('0x4b')],{'$or':_['map'](_0x3691b6[_0xaaf7('0x43')],function(_0x17be32){var _0x50be83={};_0x50be83[_0x17be32]={'$like':'%'+_0x9fcb7e['query'][_0xaaf7('0x4a')]+'%'};return _0x50be83;})});}_0x3691b6=_[_0xaaf7('0x4c')]({},_0x3691b6,_0x9fcb7e['options']);return _0x34984a['getApplications'](_0x3691b6);}})['then'](function(_0x1e0c98){if(_0x1e0c98){_0x1628c8=_0x1e0c98[_0xaaf7('0x44')];if(!_0x9fcb7e[_0xaaf7('0x3f')]['hasOwnProperty'](_0xaaf7('0x46'))){_0x3691b6[_0xaaf7('0x28')]=qs[_0xaaf7('0x28')](_0x9fcb7e[_0xaaf7('0x3f')][_0xaaf7('0x28')]);_0x3691b6['offset']=qs[_0xaaf7('0x26')](_0x9fcb7e['query'][_0xaaf7('0x26')]);}return _0x34984a[_0xaaf7('0x83')](_0x3691b6);}})[_0xaaf7('0x1b')](function(_0x5a9878){if(_0x5a9878){return _0x5a9878?{'count':_0x1628c8,'rows':_0x5a9878}:null;}})[_0xaaf7('0x1b')](respondWithResult(_0x3fc0da,null))[_0xaaf7('0x22')](handleError(_0x3fc0da,null));};function Extension(_0x2296c3,_0x351ffc,_0x2c86b8,_0x19f861){this[_0xaaf7('0x84')]=_0xaaf7('0x85');this['exten']=_0x2296c3[_0xaaf7('0x86')];this[_0xaaf7('0x87')]=_0x19f861;this[_0xaaf7('0x3d')]='system';this[_0xaaf7('0x88')]=_0xaaf7('0x89');this[_0xaaf7('0x69')]=_0x2296c3['id'];this[_0xaaf7('0x81')]=_0x351ffc;this[_0xaaf7('0x8a')]=_0x2c86b8;}function createExtensionsReciveFax(_0x4dc945){var _0x3ae71f=0x1;var _0x4cde9b=[];_0x4cde9b[_0xaaf7('0x8b')](new Extension(_0x4dc945,_0x3ae71f,'','Answer'));_0x3ae71f+=0x1;_0x4cde9b[_0xaaf7('0x8b')](new Extension(_0x4dc945,_0x3ae71f,_0xaaf7('0x8c'),_0xaaf7('0x8d')));_0x3ae71f+=0x1;for(var _0x4a9cfd in _0x4dc945){if(_0x4dc945[_0xaaf7('0x45')](_0x4a9cfd)&&(_0x4a9cfd==='ecm'||_0x4a9cfd==='localstationid'||_0x4a9cfd===_0xaaf7('0x8e')||_0x4a9cfd===_0xaaf7('0x8f')||_0x4a9cfd===_0xaaf7('0x90')||_0x4a9cfd===_0xaaf7('0x91')||_0x4a9cfd===_0xaaf7('0x92')||_0x4a9cfd===_0xaaf7('0x93')||_0x4a9cfd==='t38timeout')){_0x4cde9b[_0xaaf7('0x8b')](new Extension(_0x4dc945,_0x3ae71f,_0xaaf7('0x94')+_0x4a9cfd+')='+_0x4dc945[_0x4a9cfd],_0xaaf7('0x8d')));_0x3ae71f+=0x1;}}_0x4cde9b[_0xaaf7('0x8b')](new Extension(_0x4dc945,_0x3ae71f,'6',_0xaaf7('0x95')));_0x3ae71f+=0x1;_0x4cde9b[_0xaaf7('0x8b')](new Extension(_0x4dc945,_0x3ae71f,'/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',_0xaaf7('0x96')));_0x3ae71f=0x0;return _0x4cde9b;}exports['addAccountApplications']=function(_0x3d1427,_0x1a13e8,_0x1fc6cd){var _0x29f5fc;return db['sequelize']['transaction'](function(_0x14575c){return db[_0xaaf7('0x4f')][_0xaaf7('0x58')](_0x3d1427['body'],{'transaction':_0x14575c})[_0xaaf7('0x1b')](function(_0x5c6fc9){_0x29f5fc=_0x5c6fc9[_0xaaf7('0x31')]({'plain':!![]});return db[_0xaaf7('0x97')][_0xaaf7('0x80')](createExtensionsReciveFax(_0x29f5fc),{'transaction':_0x14575c});});})[_0xaaf7('0x1b')](function(){return _0x29f5fc;})[_0xaaf7('0x1b')](respondWithResult(_0x1a13e8,null))['catch'](handleError(_0x1a13e8,null));};exports['updateAccountApplications']=function(_0x4d890c,_0x521cc3,_0xd3901d){var _0x44234a;return db[_0xaaf7('0x7b')][_0xaaf7('0x7c')](function(_0x5c177a){return db[_0xaaf7('0x4f')][_0xaaf7('0x30')](_0x4d890c[_0xaaf7('0x60')],{'where':{'id':_0x4d890c[_0xaaf7('0x60')]['id']},'transaction':_0x5c177a})[_0xaaf7('0x1b')](function(_0x4ddb2a){return db[_0xaaf7('0x97')][_0xaaf7('0x34')]({'where':{'FaxAccountId':_0x4d890c[_0xaaf7('0x60')]['id']},'transaction':_0x5c177a})[_0xaaf7('0x1b')](function(_0x56973e){return db[_0xaaf7('0x97')][_0xaaf7('0x80')](createExtensionsReciveFax(_[_0xaaf7('0x6f')](_0x4d890c[_0xaaf7('0x60')],['tech',_0xaaf7('0x3e'),'createdAt','updatedAt',_0xaaf7('0x98'),'ListId'])),{'transaction':_0x5c177a});});});})[_0xaaf7('0x1b')](function(){return db['FaxAccount'][_0xaaf7('0x99')](_0x4d890c[_0xaaf7('0x60')]['id']);})['then'](respondWithResult(_0x521cc3,null))[_0xaaf7('0x22')](handleError(_0x521cc3,null));};exports[_0xaaf7('0x9a')]=function(_0xff7926,_0x1cd636,_0x4a2427){var _0x449552={'raw':!![],'where':{}};var _0x37c02a={};var _0x9e2567={'count':0x0,'rows':[]};return db['FaxAccount'][_0xaaf7('0x64')]({'where':{'id':_0xff7926[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x1cd636,null))[_0xaaf7('0x1b')](function(_0x1c3023){if(_0x1c3023){_0x37c02a[_0xaaf7('0x42')]=_['keys'](db[_0xaaf7('0x9b')][_0xaaf7('0x3b')]);_0x37c02a[_0xaaf7('0x3f')]=_[_0xaaf7('0x54')](_0xff7926[_0xaaf7('0x3f')]);_0x37c02a['filters']=_[_0xaaf7('0x41')](_0x37c02a[_0xaaf7('0x42')],_0x37c02a[_0xaaf7('0x3f')]);_0x449552['attributes']=_['intersection'](_0x37c02a[_0xaaf7('0x42')],qs[_0xaaf7('0x55')](_0xff7926['query'][_0xaaf7('0x55')]));_0x449552[_0xaaf7('0x43')]=_0x449552[_0xaaf7('0x43')][_0xaaf7('0x44')]?_0x449552[_0xaaf7('0x43')]:_0x37c02a[_0xaaf7('0x42')];if(!_0xff7926['query'][_0xaaf7('0x45')](_0xaaf7('0x46'))){_0x449552[_0xaaf7('0x28')]=qs[_0xaaf7('0x28')](_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x28')]);_0x449552[_0xaaf7('0x26')]=qs[_0xaaf7('0x26')](_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x26')]);}_0x449552[_0xaaf7('0x47')]=qs['sort'](_0xff7926['query'][_0xaaf7('0x48')]);_0x449552[_0xaaf7('0x4b')]=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0xff7926[_0xaaf7('0x3f')],_0x37c02a[_0xaaf7('0x40')]));_0x449552[_0xaaf7('0x4b')]['FaxAccountId']=_0x1c3023['id'];if(_0xff7926[_0xaaf7('0x3f')]['filter']){_0x449552['where']=_[_0xaaf7('0x4c')](_0x449552[_0xaaf7('0x4b')],{'$or':_[_0xaaf7('0x3a')](_0x449552[_0xaaf7('0x43')],function(_0x546345){var _0x2c8838={};_0x2c8838[_0x546345]={'$like':'%'+_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x2c8838;})});}if(_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x9c')]){var _0x13eed6=_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x9c')][_0xaaf7('0x9d')](',');var _0x339651={};_0x339651[_0x13eed6[0x0]]={'$gte':moment(_0x13eed6[0x1])[_0xaaf7('0x9e')](_0xaaf7('0x9f'))};_0x449552['where']=_['merge'](_0x449552[_0xaaf7('0x4b')],_0x339651);}_0x449552=_[_0xaaf7('0x4c')]({},_0x449552,_0xff7926[_0xaaf7('0x57')]);return db[_0xaaf7('0x9b')][_0xaaf7('0x29')]({'where':_0x449552[_0xaaf7('0x4b')]})['then'](function(_0x3095fe){_0x9e2567['count']=_0x3095fe;if(_0xff7926[_0xaaf7('0x3f')][_0xaaf7('0x56')]){_0x449552['include']=[{'all':!![]}];}return db[_0xaaf7('0x9b')]['findAll'](_0x449552);})['then'](function(_0x417ada){_0x9e2567[_0xaaf7('0x50')]=_0x417ada;return _0x9e2567;});}})[_0xaaf7('0x1b')](respondWithFilteredResult(_0x1cd636,_0x449552))[_0xaaf7('0x22')](handleError(_0x1cd636,null));};exports[_0xaaf7('0x37')]=function(_0x857b60,_0x2e00ef,_0x4a25be){var _0x59cca8,_0x13c262={},_0x265eed;if(_0x857b60['body']['to']){_0x265eed=_0x857b60[_0xaaf7('0x60')]['to'][0x0];}return db[_0xaaf7('0x4f')]['find']({'where':{'id':_0x857b60['params']['id']},'include':[{'model':db[_0xaaf7('0xa0')],'as':'List','include':[{'model':db[_0xaaf7('0x71')],'as':_0xaaf7('0xa1'),'where':{'fax':_0x265eed},'limit':0x1,'order':[[_0xaaf7('0xa2'),_0xaaf7('0xa3')]]}]}]})[_0xaaf7('0x1b')](handleEntityNotFound(_0x2e00ef,null))[_0xaaf7('0x1b')](function(_0x425f1d){_0x59cca8=_0x425f1d;if(_0x857b60[_0xaaf7('0x60')]['attachments']&&_0x857b60[_0xaaf7('0x60')]['attachments']['length']){for(var _0x5d7931=0x0;_0x5d7931<_0x857b60['body'][_0xaaf7('0xa4')][_0xaaf7('0x44')];_0x5d7931+=0x1){_0x857b60['body'][_0xaaf7('0xa4')][_0x5d7931]={'filename':_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][_0x5d7931][_0xaaf7('0x36')],'id':_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][_0x5d7931]['id'],'path':path[_0xaaf7('0xa5')](config[_0xaaf7('0xa6')],_0xaaf7('0xa7'),_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][_0x5d7931][_0xaaf7('0xa8')])};}}return respondWithRpcPromise(_0xaaf7('0xa9'),'CheckAfterSend',{'FaxAccountId':_[_0xaaf7('0xaa')](_0x857b60['params']['id'])?undefined:_0x857b60[_0xaaf7('0x52')]['id'],'path':_[_0xaaf7('0xaa')](_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0][_0xaaf7('0x6')])?undefined:_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0][_0xaaf7('0x6')],'fax':_['isNil'](_0x857b60['body']['to'][0x0])?undefined:_0x857b60[_0xaaf7('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x59cca8){if(_[_0xaaf7('0xaa')](_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xab')])){_0x857b60[_0xaaf7('0x60')]['from']=util[_0xaaf7('0x9e')](_0xaaf7('0xac'),_0x59cca8[_0xaaf7('0x36')],_0x59cca8['fax']);}if(_0x59cca8[_0xaaf7('0xad')]){if(_0x59cca8['List'][_0xaaf7('0xa1')][_0xaaf7('0x44')]){return _0x59cca8[_0xaaf7('0xad')][_0xaaf7('0xa1')][0x0];}else{return db[_0xaaf7('0x71')][_0xaaf7('0x58')](_[_0xaaf7('0x15')](_0x857b60[_0xaaf7('0x60')],{'firstName':_0x857b60[_0xaaf7('0x60')]['to'][0x0],'phone':_0x857b60[_0xaaf7('0x60')]['to'][0x0],'fax':_0x857b60[_0xaaf7('0x60')]['to'][0x0],'ListId':_0x59cca8[_0xaaf7('0xae')]}));}}else{throw new Error(_0xaaf7('0xaf'));}}else{throw new Error(_0xaaf7('0xb0'));}})[_0xaaf7('0x1b')](function(_0x3f12f5){if(_0x3f12f5){return db[_0xaaf7('0x6d')]['find']({'where':{'ContactId':_0x3f12f5['id'],'closed':![],'FaxAccountId':_0x59cca8['id']}})[_0xaaf7('0x1b')](function(_0x1536cd){if(_0x1536cd){return[_0x1536cd,![]];}return db[_0xaaf7('0x6d')][_0xaaf7('0x58')]({'UserId':_0x857b60['user']['id'],'ContactId':_0x3f12f5['id'],'FaxAccountId':_0x59cca8['id'],'fax':_0x857b60[_0xaaf7('0x60')]['to'][0x0],'firstMsgDirection':_0xaaf7('0xb1'),'Messages':[_[_0xaaf7('0x4c')](_0x857b60[_0xaaf7('0x60')],{'read':![],'body':_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0][_0xaaf7('0xb2')],'FaxAccountId':_0x59cca8['id'],'UserId':_0x857b60[_0xaaf7('0x59')]['id'],'ContactId':_0x3f12f5['id'],'AttachmentId':_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xaaf7('0x9b')],'as':_0xaaf7('0xb3')}]})[_0xaaf7('0x1b')](function(_0x6277e){return[_0x6277e,!![]];});});}else{throw new Error(_0xaaf7('0xb4'));}})[_0xaaf7('0xb5')](function(_0x174c43,_0x3227cf){if(_0x3227cf){return _0x174c43;}return db[_0xaaf7('0x9b')]['create']({'direction':'out','read':![],'body':_0x857b60[_0xaaf7('0x60')]['attachments'][0x0][_0xaaf7('0xb2')],'FaxAccountId':_0x59cca8['id'],'FaxInteractionId':_0x174c43['id'],'UserId':_0x857b60[_0xaaf7('0x59')]['id'],'ContactId':_0x174c43[_0xaaf7('0xb6')],'AttachmentId':_0x857b60['body'][_0xaaf7('0xa4')][0x0]['id']})[_0xaaf7('0x1b')](function(_0x1a04dc){_0x174c43[_0xaaf7('0xb7')][_0xaaf7('0xb3')]=[];_0x174c43['dataValues'][_0xaaf7('0xb3')][_0xaaf7('0x8b')](_0x1a04dc[_0xaaf7('0xb7')]);return _0x174c43;});})['then'](function(_0x4c20a4){respondWithRpcPromise('SendFax',_0xaaf7('0xb8'),{'FaxAccountId':_[_0xaaf7('0xaa')](_0x857b60['params']['id'])?undefined:_0x857b60[_0xaaf7('0x52')]['id'],'path':_[_0xaaf7('0xaa')](_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0][_0xaaf7('0x6')])?undefined:_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0][_0xaaf7('0x6')],'fax':_[_0xaaf7('0xaa')](_0x857b60[_0xaaf7('0x60')]['to'][0x0])?undefined:_0x857b60['body']['to'][0x0],'AttachmentId':_0x857b60[_0xaaf7('0x60')][_0xaaf7('0xa4')][0x0]['id']},client9002)[_0xaaf7('0x1b')](function(_0x44a29){logger[_0xaaf7('0x1c')](_0xaaf7('0xb9'),_0x44a29);})[_0xaaf7('0x22')](function(_0x237bb4){logger['info'](_0xaaf7('0xb9'),_0x237bb4);});return _0x4c20a4;})[_0xaaf7('0x1b')](respondWithResult(_0x2e00ef,null))[_0xaaf7('0x22')](handleError(_0x2e00ef,null));};exports['addAgents']=function(_0x5e25bf,_0x41b2c6,_0x266fec){return db[_0xaaf7('0x4f')][_0xaaf7('0x5d')]({'where':{'id':_0x5e25bf['params']['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0x41b2c6,null))[_0xaaf7('0x1b')](function(_0x192dde){if(_0x192dde){return _0x192dde['addAgents'](_0x5e25bf[_0xaaf7('0x60')][_0xaaf7('0x67')],_[_0xaaf7('0x6f')](_0x5e25bf[_0xaaf7('0x60')],[_0xaaf7('0x67'),'id'])||{})[_0xaaf7('0xb5')](function(_0x4ce1c5){for(var _0x2a071c=0x0;_0x2a071c<_0x5e25bf['body'][_0xaaf7('0x67')]['length'];_0x2a071c+=0x1){socket[_0xaaf7('0xba')](_0xaaf7('0xbb'),{'UserId':Number(_0x5e25bf[_0xaaf7('0x60')][_0xaaf7('0x67')][_0x2a071c]),'FaxAccountId':Number(_0x5e25bf[_0xaaf7('0x52')]['id'])});}return _0x4ce1c5;});}})[_0xaaf7('0x1b')](respondWithResult(_0x41b2c6,null))[_0xaaf7('0x22')](handleError(_0x41b2c6,null));};exports['removeAgents']=function(_0x3d034e,_0xe40d02,_0x2b888b){return db[_0xaaf7('0x4f')][_0xaaf7('0x5d')]({'where':{'id':_0x3d034e[_0xaaf7('0x52')]['id']}})[_0xaaf7('0x1b')](handleEntityNotFound(_0xe40d02,null))[_0xaaf7('0x1b')](function(_0x265887){if(_0x265887){return _0x265887[_0xaaf7('0xbc')](_0x3d034e[_0xaaf7('0x3f')]['ids'])[_0xaaf7('0x1b')](function(){if(_[_0xaaf7('0xbd')](_0x3d034e['query'][_0xaaf7('0x67')])){for(var _0x443573=0x0;_0x443573<_0x3d034e['query'][_0xaaf7('0x67')]['length'];_0x443573+=0x1){socket[_0xaaf7('0xba')]('userFaxAccount:remove',{'UserId':Number(_0x3d034e[_0xaaf7('0x3f')][_0xaaf7('0x67')][_0x443573]),'FaxAccountId':Number(_0x3d034e['params']['id'])});}}else{socket[_0xaaf7('0xba')](_0xaaf7('0xbe'),{'UserId':Number(_0x3d034e[_0xaaf7('0x3f')][_0xaaf7('0x67')]),'FaxAccountId':Number(_0x3d034e[_0xaaf7('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0xe40d02,null))[_0xaaf7('0x22')](handleError(_0xe40d02,null));};exports[_0xaaf7('0xbf')]=function(_0x4a07fb,_0x4bd7e4,_0x5d72f1){var _0x327a5e={};var _0xdcfbf1={};var _0x4a3ba4;var _0x2a730c;return db['FaxAccount'][_0xaaf7('0x64')]({'where':{'id':_0x4a07fb['params']['id']}})['then'](handleEntityNotFound(_0x4bd7e4,null))[_0xaaf7('0x1b')](function(_0x302542){if(_0x302542){_0x4a3ba4=_0x302542;_0xdcfbf1[_0xaaf7('0x42')]=_[_0xaaf7('0x54')](db[_0xaaf7('0x73')][_0xaaf7('0x3b')]);_0xdcfbf1['query']=_[_0xaaf7('0x54')](_0x4a07fb[_0xaaf7('0x3f')]);_0xdcfbf1[_0xaaf7('0x40')]=_['intersection'](_0xdcfbf1['model'],_0xdcfbf1[_0xaaf7('0x3f')]);_0x327a5e[_0xaaf7('0x43')]=_[_0xaaf7('0x41')](_0xdcfbf1[_0xaaf7('0x42')],qs['fields'](_0x4a07fb[_0xaaf7('0x3f')][_0xaaf7('0x55')]));_0x327a5e[_0xaaf7('0x43')]=_0x327a5e[_0xaaf7('0x43')]['length']?_0x327a5e[_0xaaf7('0x43')]:_0xdcfbf1[_0xaaf7('0x42')];_0x327a5e[_0xaaf7('0x47')]=qs[_0xaaf7('0x48')](_0x4a07fb[_0xaaf7('0x3f')][_0xaaf7('0x48')]);_0x327a5e[_0xaaf7('0x4b')]=qs[_0xaaf7('0x40')](_[_0xaaf7('0x49')](_0x4a07fb['query'],_0xdcfbf1['filters']));if(_0x4a07fb[_0xaaf7('0x3f')][_0xaaf7('0x4a')]){_0x327a5e['where']=_[_0xaaf7('0x4c')](_0x327a5e[_0xaaf7('0x4b')],{'$or':_[_0xaaf7('0x3a')](_0x327a5e[_0xaaf7('0x43')],function(_0x29c322){var _0x5e47e8={};_0x5e47e8[_0x29c322]={'$like':'%'+_0x4a07fb[_0xaaf7('0x3f')][_0xaaf7('0x4a')]+'%'};return _0x5e47e8;})});}_0x327a5e=_[_0xaaf7('0x4c')]({},_0x327a5e,_0x4a07fb[_0xaaf7('0x57')]);return _0x4a3ba4[_0xaaf7('0xbf')](_0x327a5e);}})[_0xaaf7('0x1b')](function(_0x420d9b){if(_0x420d9b){_0x2a730c=_0x420d9b['length'];if(!_0x4a07fb['query']['hasOwnProperty']('nolimit')){_0x327a5e[_0xaaf7('0x28')]=qs[_0xaaf7('0x28')](_0x4a07fb[_0xaaf7('0x3f')]['limit']);_0x327a5e['offset']=qs[_0xaaf7('0x26')](_0x4a07fb[_0xaaf7('0x3f')][_0xaaf7('0x26')]);}return _0x4a3ba4[_0xaaf7('0xbf')](_0x327a5e);}})[_0xaaf7('0x1b')](function(_0x3f18bc){if(_0x3f18bc){return _0x3f18bc?{'count':_0x2a730c,'rows':_0x3f18bc}:null;}})[_0xaaf7('0x1b')](respondWithResult(_0x4bd7e4,null))['catch'](handleError(_0x4bd7e4,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c89dc3a..7d8111e 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 _0x085d=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x085d,0x192));var _0xd085=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x085d[_0x120123];return _0x3bec4c;};'use strict';var EventEmitter=require(_0xd085('0x0'));var FaxAccount=require(_0xd085('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd085('0x2')](0x0);var events={'afterCreate':_0xd085('0x3'),'afterUpdate':_0xd085('0x4'),'afterDestroy':_0xd085('0x5')};function emitEvent(_0x5e5078){return function(_0x52f43c,_0x5d471a,_0x359751){FaxAccountEvents['emit'](_0x5e5078+':'+_0x52f43c['id'],_0x52f43c);FaxAccountEvents[_0xd085('0x6')](_0x5e5078,_0x52f43c);_0x359751(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xd085('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x6dd5=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5b4ab0,_0x3c9e51){var _0x1c22f3=function(_0x15478d){while(--_0x15478d){_0x5b4ab0['push'](_0x5b4ab0['shift']());}};_0x1c22f3(++_0x3c9e51);}(_0x6dd5,0x1b8));var _0x56dd=function(_0x431cc8,_0xbf532e){_0x431cc8=_0x431cc8-0x0;var _0x58fe95=_0x6dd5[_0x431cc8];return _0x58fe95;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x56dd('0x0'))['db'][_0x56dd('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x56dd('0x2')](0x0);var events={'afterCreate':_0x56dd('0x3'),'afterUpdate':_0x56dd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x339c7f){return function(_0x27e111,_0x144ebf,_0xe23f1){FaxAccountEvents[_0x56dd('0x5')](_0x339c7f+':'+_0x27e111['id'],_0x27e111);FaxAccountEvents[_0x56dd('0x5')](_0x339c7f,_0x27e111);_0xe23f1(null);};}for(var e in events){if(events[_0x56dd('0x6')](e)){var event=events[e];FaxAccount[_0x56dd('0x7')](e,emitEvent(event));}}module[_0x56dd('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 3721a1e..33ade26 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 _0x7110=['rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4ce2b0,_0x163fb1){var _0x30215c=function(_0x53cf67){while(--_0x53cf67){_0x4ce2b0['push'](_0x4ce2b0['shift']());}};_0x30215c(++_0x163fb1);}(_0x7110,0x14b));var _0x0711=function(_0x1b68c3,_0x356ab2){_0x1b68c3=_0x1b68c3-0x0;var _0x41ac70=_0x7110[_0x1b68c3];return _0x41ac70;};'use strict';var _=require(_0x0711('0x0'));var util=require(_0x0711('0x1'));var logger=require('../../config/logger')(_0x0711('0x2'));var moment=require(_0x0711('0x3'));var BPromise=require(_0x0711('0x4'));var rp=require(_0x0711('0x5'));var fs=require('fs');var path=require(_0x0711('0x6'));var rimraf=require(_0x0711('0x7'));var config=require(_0x0711('0x8'));var attributes=require('./faxAccount.attributes');module[_0x0711('0x9')]=function(_0x3b5909,_0x23babf){return _0x3b5909[_0x0711('0xa')](_0x0711('0xb'),attributes,{'tableName':_0x0711('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd52b=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','FaxAccount','fax_accounts'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xd52b,0x1ef));var _0xbd52=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd52b[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xbd52('0x0'));var util=require(_0xbd52('0x1'));var logger=require(_0xbd52('0x2'))('api');var moment=require(_0xbd52('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd52('0x4'));var fs=require('fs');var path=require(_0xbd52('0x5'));var rimraf=require('rimraf');var config=require(_0xbd52('0x6'));var attributes=require('./faxAccount.attributes');module[_0xbd52('0x7')]=function(_0x297997,_0x5e43a7){return _0x297997[_0xbd52('0x8')](_0xbd52('0x9'),attributes,{'tableName':_0xbd52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index b981c63..e675458 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 _0x7a5e=['agent','startRouting','Start','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetFaxAccount','FaxAccount','options','where','include','model','attributes','map','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift'];(function(_0x1fec1b,_0x2d7233){var _0xb86d9f=function(_0x446fed){while(--_0x446fed){_0x1fec1b['push'](_0x1fec1b['shift']());}};_0xb86d9f(++_0x2d7233);}(_0x7a5e,0x1cf));var _0xe7a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe7a5('0x0'));var moment=require(_0xe7a5('0x1'));var BPromise=require(_0xe7a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7a5('0x3'));var db=require(_0xe7a5('0x4'))['db'];var utils=require(_0xe7a5('0x5'));var logger=require(_0xe7a5('0x6'))('rpc');var config=require(_0xe7a5('0x7'));var jayson=require(_0xe7a5('0x8'));var client=jayson[_0xe7a5('0x9')][_0xe7a5('0xa')]({'port':0x232c});config['redis']=_[_0xe7a5('0xb')](config[_0xe7a5('0xc')],{'host':_0xe7a5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7a5('0xe'))[_0xe7a5('0xf')](socket);function respondWithRpcPromise(_0x3f87f2,_0x517bb0,_0x4f9939){return new BPromise(function(_0x21ff6a,_0x45b414){return client[_0xe7a5('0x10')](_0x3f87f2,_0x4f9939)[_0xe7a5('0x11')](function(_0x1d95dc){logger['info'](_0xe7a5('0x12'),_0x517bb0,_0xe7a5('0x13'));logger[_0xe7a5('0x14')](_0xe7a5('0x15'),_0x517bb0,'request\x20sent',JSON[_0xe7a5('0x16')](_0x1d95dc));if(_0x1d95dc[_0xe7a5('0x17')]){if(_0x1d95dc[_0xe7a5('0x17')][_0xe7a5('0x18')]===0x1f4){logger[_0xe7a5('0x17')](_0xe7a5('0x12'),_0x517bb0,_0x1d95dc['error'][_0xe7a5('0x19')]);return _0x45b414(_0x1d95dc[_0xe7a5('0x17')]['message']);}logger[_0xe7a5('0x17')]('FaxAccount,\x20%s,\x20%s',_0x517bb0,_0x1d95dc[_0xe7a5('0x17')]['message']);return _0x21ff6a(_0x1d95dc[_0xe7a5('0x17')][_0xe7a5('0x19')]);}else{logger[_0xe7a5('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x517bb0,_0xe7a5('0x13'));_0x21ff6a(_0x1d95dc['result'][_0xe7a5('0x19')]);}})[_0xe7a5('0x1b')](function(_0xdc7596){logger[_0xe7a5('0x17')](_0xe7a5('0x12'),_0x517bb0,_0xdc7596);_0x45b414(_0xdc7596);});});}exports[_0xe7a5('0x1c')]=function(_0x1a7b7b){var _0x42d809=this;return new Promise(function(_0x37115a,_0x232591){return db[_0xe7a5('0x1d')]['findAll']({'raw':_0x1a7b7b['options']?_0x1a7b7b[_0xe7a5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a7b7b[_0xe7a5('0x1e')]?_0x1a7b7b[_0xe7a5('0x1e')][_0xe7a5('0x1f')]||null:null,'attributes':_0x1a7b7b[_0xe7a5('0x1e')]?_0x1a7b7b[_0xe7a5('0x1e')]['attributes']||null:null,'limit':_0x1a7b7b[_0xe7a5('0x1e')]?_0x1a7b7b[_0xe7a5('0x1e')]['limit']||null:null,'include':_0x1a7b7b['options']?_0x1a7b7b[_0xe7a5('0x1e')][_0xe7a5('0x20')]?_['map'](_0x1a7b7b[_0xe7a5('0x1e')]['include'],function(_0x23af58){return{'model':db[_0x23af58[_0xe7a5('0x21')]],'as':_0x23af58['as'],'attributes':_0x23af58[_0xe7a5('0x22')],'include':_0x23af58[_0xe7a5('0x20')]?_['map'](_0x23af58[_0xe7a5('0x20')],function(_0x5cb51d){return{'model':db[_0x5cb51d[_0xe7a5('0x21')]],'as':_0x5cb51d['as'],'attributes':_0x5cb51d[_0xe7a5('0x22')],'include':_0x5cb51d['include']?_[_0xe7a5('0x23')](_0x5cb51d[_0xe7a5('0x20')],function(_0x234251){return{'model':db[_0x234251[_0xe7a5('0x21')]],'as':_0x234251['as'],'attributes':_0x234251['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7a5('0x11')](function(_0xb1f09f){logger['info'](_0xe7a5('0x1c'),_0x1a7b7b);logger[_0xe7a5('0x14')](_0xe7a5('0x1c'),_0x1a7b7b,JSON[_0xe7a5('0x16')](_0xb1f09f));_0x37115a(_0xb1f09f);})[_0xe7a5('0x1b')](function(_0x165ee3){logger[_0xe7a5('0x17')](_0xe7a5('0x1c'),_0x165ee3[_0xe7a5('0x19')],_0x1a7b7b);_0x232591(_0x42d809['error'](0x1f4,_0x165ee3[_0xe7a5('0x19')]));});});};exports[_0xe7a5('0x24')]=function(_0x13880f,_0x3a4998,_0x5f39b8){var _0x32e66e=this;return new Promise(function(_0x487a89,_0x1c6251){var _0x435ea7={'body':_0x13880f[_0xe7a5('0x25')],'channel':_0xe7a5('0x26')};var _0x150d67=[];var _0x52c73e=[];var _0xe39009={};return db['CmContact'][_0xe7a5('0x27')]()[_0xe7a5('0x11')](function(_0x10f5da){if(!_0x10f5da){throw new db[(_0xe7a5('0x28'))]['ValidationError'](_0xe7a5('0x29'));}_0x150d67=_[_0xe7a5('0x2a')](_['keys'](_0x10f5da),[_0xe7a5('0x2b'),_0xe7a5('0x2c')]);_0x52c73e=_[_0xe7a5('0x2a')](_[_0xe7a5('0x2d')](_0x10f5da),[_0xe7a5('0x2b'),_0xe7a5('0x2c'),_0xe7a5('0x2e'),_0xe7a5('0x2f')]);if(_0x13880f[_0xe7a5('0x25')]['id']){delete _0x13880f[_0xe7a5('0x25')]['id'];}if(_[_0xe7a5('0x30')](_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x31')])){throw new db[(_0xe7a5('0x28'))][(_0xe7a5('0x32'))]('from\x20is\x20mandatory');}if(_[_0xe7a5('0x30')](_0x13880f[_0xe7a5('0x25')]['body'])||_0x13880f['body'][_0xe7a5('0x25')]===''){throw new db['Sequelize'][(_0xe7a5('0x32'))](_0xe7a5('0x33'));}if(_['isNil'](_0x13880f['body'][_0xe7a5('0x34')])){throw new db[(_0xe7a5('0x28'))][(_0xe7a5('0x32'))](_0xe7a5('0x35')+_0x52c73e);}if(!_[_0xe7a5('0x36')](_0x52c73e,_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x34')])){throw new db['Sequelize']['ValidationError'](_0xe7a5('0x37')+_0x52c73e);}_0xe39009[_0x13880f[_0xe7a5('0x25')]['mapKey']]=_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x31')];})['then'](function(){return db[_0xe7a5('0x1d')][_0xe7a5('0x38')]({'where':{'id':_0x13880f[_0xe7a5('0x39')]['id']},'include':[{'model':db[_0xe7a5('0x3a')],'as':_0xe7a5('0x3b'),'include':[{'model':db[_0xe7a5('0x3c')],'as':_0xe7a5('0x3d'),'where':_0xe39009,'limit':0x1,'order':[[_0xe7a5('0x2c'),_0xe7a5('0x3e')]]}]},{'model':db[_0xe7a5('0x3f')],'as':_0xe7a5('0x40')}]});})[_0xe7a5('0x11')](function(_0x3fb11e){if(_0x3fb11e&&_0x3fb11e[_0xe7a5('0x3b')]){var _0x247272=_0x3fb11e['get']({'plain':!![]});_0x435ea7[_0xe7a5('0x39')]=_0x247272;_0x435ea7[_0xe7a5('0x41')]=_0x247272[_0xe7a5('0x40')];_0x435ea7[_0xe7a5('0x42')]=_0x247272[_0xe7a5('0x3b')];_0x435ea7[_0xe7a5('0x41')]=_[_0xe7a5('0x43')](_0x435ea7[_0xe7a5('0x41')],[_0xe7a5('0x44')],[_0xe7a5('0x45')]);if(_0x435ea7[_0xe7a5('0x39')][_0xe7a5('0x40')]){delete _0x435ea7[_0xe7a5('0x39')][_0xe7a5('0x40')];}if(_0x435ea7[_0xe7a5('0x39')]['List']&&_0x435ea7[_0xe7a5('0x39')][_0xe7a5('0x3b')][_0xe7a5('0x3d')][_0xe7a5('0x46')]){return _0x435ea7[_0xe7a5('0x39')][_0xe7a5('0x3b')][_0xe7a5('0x3d')][0x0];}var _0x36c25a=_[_0xe7a5('0xb')](_0x13880f[_0xe7a5('0x25')],{'firstName':_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x31')],'ListId':_0x247272['ListId']});_0x36c25a[_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x34')]]=_0x13880f[_0xe7a5('0x25')]['from'];return db[_0xe7a5('0x3c')][_0xe7a5('0x47')](_0x36c25a,{'fields':_0x150d67,'raw':!![]});}})[_0xe7a5('0x11')](function(_0x196375){_0x435ea7['contact']=_0x196375;if(_0x196375){var _0xba7232={'ContactId':_0x196375['id'],'FaxAccountId':_0x13880f[_0xe7a5('0x39')]['id'],'fax':_0x196375[_0xe7a5('0x26')]};return db[_0xe7a5('0x48')][_0xe7a5('0x38')]({'where':{'ContactId':_0x196375['id'],'closed':![],'FaxAccountId':_0x13880f[_0xe7a5('0x39')]['id']}})[_0xe7a5('0x11')](function(_0x45b681){if(_0x45b681){return[_0x45b681,![]];}return db[_0xe7a5('0x48')][_0xe7a5('0x47')](_0xba7232)[_0xe7a5('0x11')](function(_0x290ac0){return[_0x290ac0,!![]];});});}else{throw new Error(_0xe7a5('0x49'));}})[_0xe7a5('0x4a')](function(_0x305542,_0x133903){var _0x4e6c5b=_0x305542['get']({'plain':!![]});if(_0x133903){if(_0x435ea7['account'][_0xe7a5('0x4b')]){_0x435ea7[_0xe7a5('0x41')][_0xe7a5('0x4c')]({'id':0x0,'priority':_0x435ea7[_0xe7a5('0x41')][_0xe7a5('0x46')]+0x1,'app':_0xe7a5('0x4d'),'appdata':_0xe7a5('0x4e'),'interval':_0xe7a5('0x4f')});}_0x4e6c5b[_0xe7a5('0x50')]=!![];}else{_0x4e6c5b['created']=![];}_0x435ea7[_0xe7a5('0x51')]=_0x4e6c5b;return db[_0xe7a5('0x52')][_0xe7a5('0x47')]({'body':_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x25')],'FaxAccountId':_0x13880f[_0xe7a5('0x39')]['id'],'FaxInteractionId':_0x305542['id'],'direction':'in','ContactId':_0x305542[_0xe7a5('0x53')],'AttachmentId':_0x13880f[_0xe7a5('0x25')][_0xe7a5('0x54')]});})['then'](function(_0x15847a){_0x435ea7[_0xe7a5('0x19')]=_0x15847a;if(_0x435ea7[_0xe7a5('0x51')][_0xe7a5('0x55')]){return db[_0xe7a5('0x56')][_0xe7a5('0x38')]({'attributes':['id',_0xe7a5('0x57')],'where':{'id':_0x435ea7['interaction'][_0xe7a5('0x55')]}})[_0xe7a5('0x11')](function(_0xa1329){if(_0xa1329){_0x435ea7[_0xe7a5('0x41')][_0xe7a5('0x58')]({'id':0x0,'priority':0x0,'app':_0xe7a5('0x59'),'appdata':_0xa1329['name']+','+(_0x435ea7[_0xe7a5('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xe7a5('0x4f')});}return respondWithRpcPromise('Start',_0xe7a5('0x5a'),_0x435ea7);});}return respondWithRpcPromise(_0xe7a5('0x5b'),'startRouting',_0x435ea7);})[_0xe7a5('0x11')](function(_0xbf70c2){_0x487a89(_0xbf70c2);})[_0xe7a5('0x1b')](function(_0x237972){_0x1c6251(_0x32e66e[_0xe7a5('0x17')](0x1f4,_0x237972[_0xe7a5('0x19')]));});});}; \ No newline at end of file +var _0xd0a0=['AttachmentId','name','UserId','unshift','waitForTheAssignedAgent','Start','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetFaxAccount','findAll','options','raw','attributes','include','map','model','stringify','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','keys','createdAt','updatedAt','ListId','body','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','FaxAccount','account','CmList','Contacts','FaxApplication','Applications','List','get','applications','list','orderBy','length','create','find','FaxInteraction','Contact\x20not\x20found','spread','close','*,*,*,*','created','interaction','FaxMessage'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0xd0a0,0x192));var _0x0d0a=function(_0x35f966,_0x12f8f3){_0x35f966=_0x35f966-0x0;var _0x2dce03=_0xd0a0[_0x35f966];return _0x2dce03;};'use strict';var _=require(_0x0d0a('0x0'));var util=require(_0x0d0a('0x1'));var moment=require('moment');var BPromise=require(_0x0d0a('0x2'));var rs=require(_0x0d0a('0x3'));var fs=require('fs');var Redis=require(_0x0d0a('0x4'));var db=require(_0x0d0a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d0a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d0a('0x7')]['http']({'port':0x232c});config[_0x0d0a('0x8')]=_[_0x0d0a('0x9')](config[_0x0d0a('0x8')],{'host':_0x0d0a('0xa'),'port':0x18eb});var socket=require(_0x0d0a('0xb'))(new Redis(config[_0x0d0a('0x8')]));require(_0x0d0a('0xc'))[_0x0d0a('0xd')](socket);function respondWithRpcPromise(_0x112a2f,_0x4fdec8,_0x7287ea){return new BPromise(function(_0x3bc682,_0x2fa11c){return client['request'](_0x112a2f,_0x7287ea)[_0x0d0a('0xe')](function(_0x2934c2){logger[_0x0d0a('0xf')](_0x0d0a('0x10'),_0x4fdec8,'request\x20sent');logger[_0x0d0a('0x11')](_0x0d0a('0x12'),_0x4fdec8,_0x0d0a('0x13'),JSON['stringify'](_0x2934c2));if(_0x2934c2['error']){if(_0x2934c2[_0x0d0a('0x14')][_0x0d0a('0x15')]===0x1f4){logger[_0x0d0a('0x14')](_0x0d0a('0x10'),_0x4fdec8,_0x2934c2['error'][_0x0d0a('0x16')]);return _0x2fa11c(_0x2934c2[_0x0d0a('0x14')][_0x0d0a('0x16')]);}logger[_0x0d0a('0x14')](_0x0d0a('0x10'),_0x4fdec8,_0x2934c2['error']['message']);return _0x3bc682(_0x2934c2[_0x0d0a('0x14')][_0x0d0a('0x16')]);}else{logger['info'](_0x0d0a('0x10'),_0x4fdec8,_0x0d0a('0x13'));_0x3bc682(_0x2934c2['result'][_0x0d0a('0x16')]);}})['catch'](function(_0x4a7da6){logger['error'](_0x0d0a('0x10'),_0x4fdec8,_0x4a7da6);_0x2fa11c(_0x4a7da6);});});}exports[_0x0d0a('0x17')]=function(_0x47784a){var _0x1a5658=this;return new Promise(function(_0x3a3637,_0x51f91a){return db['FaxAccount'][_0x0d0a('0x18')]({'raw':_0x47784a[_0x0d0a('0x19')]?_0x47784a[_0x0d0a('0x19')][_0x0d0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x47784a[_0x0d0a('0x19')]?_0x47784a['options']['where']||null:null,'attributes':_0x47784a['options']?_0x47784a[_0x0d0a('0x19')][_0x0d0a('0x1b')]||null:null,'limit':_0x47784a[_0x0d0a('0x19')]?_0x47784a[_0x0d0a('0x19')]['limit']||null:null,'include':_0x47784a[_0x0d0a('0x19')]?_0x47784a['options'][_0x0d0a('0x1c')]?_[_0x0d0a('0x1d')](_0x47784a[_0x0d0a('0x19')][_0x0d0a('0x1c')],function(_0x9f12da){return{'model':db[_0x9f12da[_0x0d0a('0x1e')]],'as':_0x9f12da['as'],'attributes':_0x9f12da[_0x0d0a('0x1b')],'include':_0x9f12da[_0x0d0a('0x1c')]?_[_0x0d0a('0x1d')](_0x9f12da[_0x0d0a('0x1c')],function(_0x31752d){return{'model':db[_0x31752d['model']],'as':_0x31752d['as'],'attributes':_0x31752d[_0x0d0a('0x1b')],'include':_0x31752d[_0x0d0a('0x1c')]?_[_0x0d0a('0x1d')](_0x31752d[_0x0d0a('0x1c')],function(_0x89dc10){return{'model':db[_0x89dc10['model']],'as':_0x89dc10['as'],'attributes':_0x89dc10[_0x0d0a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d0a('0xe')](function(_0x7ae57e){logger[_0x0d0a('0xf')](_0x0d0a('0x17'),_0x47784a);logger[_0x0d0a('0x11')](_0x0d0a('0x17'),_0x47784a,JSON[_0x0d0a('0x1f')](_0x7ae57e));_0x3a3637(_0x7ae57e);})['catch'](function(_0x21c9fa){logger[_0x0d0a('0x14')]('GetFaxAccount',_0x21c9fa[_0x0d0a('0x16')],_0x47784a);_0x51f91a(_0x1a5658['error'](0x1f4,_0x21c9fa['message']));});});};exports[_0x0d0a('0x20')]=function(_0x431070,_0x175789,_0x466301){var _0xe9f283=this;return new Promise(function(_0x3e873d,_0x23825a){var _0xfa360f={'body':_0x431070['body'],'channel':_0x0d0a('0x21')};var _0x51ecb4=[];var _0x661c54=[];var _0x36a8a5={};return db[_0x0d0a('0x22')][_0x0d0a('0x23')]()[_0x0d0a('0xe')](function(_0x118f00){if(!_0x118f00){throw new db[(_0x0d0a('0x24'))]['ValidationError'](_0x0d0a('0x25'));}_0x51ecb4=_['difference'](_[_0x0d0a('0x26')](_0x118f00),[_0x0d0a('0x27'),_0x0d0a('0x28')]);_0x661c54=_['difference'](_[_0x0d0a('0x26')](_0x118f00),[_0x0d0a('0x27'),_0x0d0a('0x28'),'CompanyId',_0x0d0a('0x29')]);if(_0x431070[_0x0d0a('0x2a')]['id']){delete _0x431070['body']['id'];}if(_[_0x0d0a('0x2b')](_0x431070[_0x0d0a('0x2a')][_0x0d0a('0x2c')])){throw new db[(_0x0d0a('0x24'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x431070[_0x0d0a('0x2a')]['body'])||_0x431070[_0x0d0a('0x2a')]['body']===''){throw new db[(_0x0d0a('0x24'))][(_0x0d0a('0x2d'))](_0x0d0a('0x2e'));}if(_['isNil'](_0x431070['body']['mapKey'])){throw new db[(_0x0d0a('0x24'))][(_0x0d0a('0x2d'))](_0x0d0a('0x2f')+_0x661c54);}if(!_[_0x0d0a('0x30')](_0x661c54,_0x431070['body'][_0x0d0a('0x31')])){throw new db[(_0x0d0a('0x24'))][(_0x0d0a('0x2d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x661c54);}_0x36a8a5[_0x431070['body']['mapKey']]=_0x431070[_0x0d0a('0x2a')]['from'];})[_0x0d0a('0xe')](function(){return db[_0x0d0a('0x32')]['find']({'where':{'id':_0x431070[_0x0d0a('0x33')]['id']},'include':[{'model':db[_0x0d0a('0x34')],'as':'List','include':[{'model':db[_0x0d0a('0x22')],'as':_0x0d0a('0x35'),'where':_0x36a8a5,'limit':0x1,'order':[[_0x0d0a('0x28'),'DESC']]}]},{'model':db[_0x0d0a('0x36')],'as':_0x0d0a('0x37')}]});})[_0x0d0a('0xe')](function(_0x154053){if(_0x154053&&_0x154053[_0x0d0a('0x38')]){var _0x142363=_0x154053[_0x0d0a('0x39')]({'plain':!![]});_0xfa360f[_0x0d0a('0x33')]=_0x142363;_0xfa360f[_0x0d0a('0x3a')]=_0x142363[_0x0d0a('0x37')];_0xfa360f[_0x0d0a('0x3b')]=_0x142363[_0x0d0a('0x38')];_0xfa360f['applications']=_[_0x0d0a('0x3c')](_0xfa360f[_0x0d0a('0x3a')],['priority'],['asc']);if(_0xfa360f[_0x0d0a('0x33')][_0x0d0a('0x37')]){delete _0xfa360f[_0x0d0a('0x33')][_0x0d0a('0x37')];}if(_0xfa360f[_0x0d0a('0x33')][_0x0d0a('0x38')]&&_0xfa360f[_0x0d0a('0x33')][_0x0d0a('0x38')][_0x0d0a('0x35')][_0x0d0a('0x3d')]){return _0xfa360f[_0x0d0a('0x33')]['List']['Contacts'][0x0];}var _0xe8ae35=_[_0x0d0a('0x9')](_0x431070['body'],{'firstName':_0x431070[_0x0d0a('0x2a')][_0x0d0a('0x2c')],'ListId':_0x142363[_0x0d0a('0x29')]});_0xe8ae35[_0x431070[_0x0d0a('0x2a')][_0x0d0a('0x31')]]=_0x431070['body'][_0x0d0a('0x2c')];return db['CmContact'][_0x0d0a('0x3e')](_0xe8ae35,{'fields':_0x51ecb4,'raw':!![]});}})[_0x0d0a('0xe')](function(_0x439408){_0xfa360f['contact']=_0x439408;if(_0x439408){var _0x37af64={'ContactId':_0x439408['id'],'FaxAccountId':_0x431070[_0x0d0a('0x33')]['id'],'fax':_0x439408[_0x0d0a('0x21')]};return db['FaxInteraction'][_0x0d0a('0x3f')]({'where':{'ContactId':_0x439408['id'],'closed':![],'FaxAccountId':_0x431070[_0x0d0a('0x33')]['id']}})[_0x0d0a('0xe')](function(_0x2ef444){if(_0x2ef444){return[_0x2ef444,![]];}return db[_0x0d0a('0x40')]['create'](_0x37af64)[_0x0d0a('0xe')](function(_0x4ca519){return[_0x4ca519,!![]];});});}else{throw new Error(_0x0d0a('0x41'));}})[_0x0d0a('0x42')](function(_0x54fac1,_0x1acc5e){var _0x230076=_0x54fac1[_0x0d0a('0x39')]({'plain':!![]});if(_0x1acc5e){if(_0xfa360f['account']['autoclose']){_0xfa360f['applications']['push']({'id':0x0,'priority':_0xfa360f['applications'][_0x0d0a('0x3d')]+0x1,'app':_0x0d0a('0x43'),'appdata':'unmanaged','interval':_0x0d0a('0x44')});}_0x230076[_0x0d0a('0x45')]=!![];}else{_0x230076[_0x0d0a('0x45')]=![];}_0xfa360f[_0x0d0a('0x46')]=_0x230076;return db[_0x0d0a('0x47')]['create']({'body':_0x431070['body'][_0x0d0a('0x2a')],'FaxAccountId':_0x431070[_0x0d0a('0x33')]['id'],'FaxInteractionId':_0x54fac1['id'],'direction':'in','ContactId':_0x54fac1['ContactId'],'AttachmentId':_0x431070[_0x0d0a('0x2a')][_0x0d0a('0x48')]});})[_0x0d0a('0xe')](function(_0x1d1bfc){_0xfa360f[_0x0d0a('0x16')]=_0x1d1bfc;if(_0xfa360f[_0x0d0a('0x46')]['UserId']){return db['User'][_0x0d0a('0x3f')]({'attributes':['id',_0x0d0a('0x49')],'where':{'id':_0xfa360f['interaction'][_0x0d0a('0x4a')]}})['then'](function(_0xef1e81){if(_0xef1e81){_0xfa360f[_0x0d0a('0x3a')][_0x0d0a('0x4b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xef1e81[_0x0d0a('0x49')]+','+(_0xfa360f[_0x0d0a('0x33')][_0x0d0a('0x4c')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0d0a('0x4d'),'startRouting',_0xfa360f);});}return respondWithRpcPromise('Start','startRouting',_0xfa360f);})[_0x0d0a('0xe')](function(_0x203563){_0x3e873d(_0x203563);})[_0x0d0a('0x4e')](function(_0x475359){_0x23825a(_0xe9f283['error'](0x1f4,_0x475359['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 67d3a55..136c370 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 _0x2efc=['faxAccount:','./faxAccount.events','save','remove','update','register'];(function(_0xaac40c,_0xff010a){var _0x5c379a=function(_0x384a7c){while(--_0x384a7c){_0xaac40c['push'](_0xaac40c['shift']());}};_0x5c379a(++_0xff010a);}(_0x2efc,0x1e7));var _0xc2ef=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x2efc[_0x2e53e1];return _0x3a23de;};'use strict';var FaxAccountEvents=require(_0xc2ef('0x0'));var events=[_0xc2ef('0x1'),_0xc2ef('0x2'),_0xc2ef('0x3')];function createListener(_0x124445,_0x3ca0de){return function(_0x51b049){_0x3ca0de['emit'](_0x124445,_0x51b049);};}function removeListener(_0x2980fe,_0x5ad620){return function(){FaxAccountEvents['removeListener'](_0x2980fe,_0x5ad620);};}exports[_0xc2ef('0x4')]=function(_0x36b4d1){for(var _0x561d67=0x0,_0x1f613e=events['length'];_0x561d67<_0x1f613e;_0x561d67++){var _0x2d237d=events[_0x561d67];var _0x46ad42=createListener(_0xc2ef('0x5')+_0x2d237d,_0x36b4d1);FaxAccountEvents['on'](_0x2d237d,_0x46ad42);}}; \ No newline at end of file +var _0xf24a=['update','emit','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xf24a,0x178));var _0xaf24=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf24a[_0x122ef9];return _0x42fba0;};'use strict';var FaxAccountEvents=require(_0xaf24('0x0'));var events=[_0xaf24('0x1'),'remove',_0xaf24('0x2')];function createListener(_0x3441fc,_0x2e22d8){return function(_0xbb5cda){_0x2e22d8[_0xaf24('0x3')](_0x3441fc,_0xbb5cda);};}function removeListener(_0x20c881,_0xeefaee){return function(){FaxAccountEvents['removeListener'](_0x20c881,_0xeefaee);};}exports[_0xaf24('0x4')]=function(_0x1214f9){for(var _0x1a6d1f=0x0,_0x42583f=events[_0xaf24('0x5')];_0x1a6d1f<_0x42583f;_0x1a6d1f++){var _0x1e5e05=events[_0x1a6d1f];var _0x93187f=createListener(_0xaf24('0x6')+_0x1e5e05,_0x1214f9);FaxAccountEvents['on'](_0x1e5e05,_0x93187f);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 7f4323d..95c3d1c 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(_0x50b65a,_0x1d594c){var _0x41e568=function(_0x221788){while(--_0x221788){_0x50b65a['push'](_0x50b65a['shift']());}};_0x41e568(++_0x1d594c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x4578da,_0x167447){var _0x10c671=function(_0x40365f){while(--_0x40365f){_0x4578da['push'](_0x4578da['shift']());}};_0x10c671(++_0x167447);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 516c840..9c293dc 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 _0x6121=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x6121,0x178));var _0x1612=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6121[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x1612('0x0'));module[_0x1612('0x1')]={'priority':{'type':Sequelize[_0x1612('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1612('0x3')],'allowNull':![],'defaultValue':_0x1612('0x4')},'appdata':{'type':Sequelize[_0x1612('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1612('0x6')}}; \ No newline at end of file +var _0xf73c=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x35c9af,_0x56dd66){var _0x5826cd=function(_0x3e79eb){while(--_0x3e79eb){_0x35c9af['push'](_0x35c9af['shift']());}};_0x5826cd(++_0x56dd66);}(_0xf73c,0x18c));var _0xcf73=function(_0x273f39,_0x37ea54){_0x273f39=_0x273f39-0x0;var _0xd2bc49=_0xf73c[_0x273f39];return _0xd2bc49;};'use strict';var Sequelize=require(_0xcf73('0x0'));module[_0xcf73('0x1')]={'priority':{'type':Sequelize[_0xcf73('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcf73('0x3')},'appdata':{'type':Sequelize[_0xcf73('0x4')]()},'description':{'type':Sequelize[_0xcf73('0x5')]},'interval':{'type':Sequelize[_0xcf73('0x5')],'defaultValue':_0xcf73('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 1ae11a4..e4675de 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 _0x96f2=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x1af6b9,_0x515347){var _0x27fc2c=function(_0x4e9aa2){while(--_0x4e9aa2){_0x1af6b9['push'](_0x1af6b9['shift']());}};_0x27fc2c(++_0x515347);}(_0x96f2,0x187));var _0x296f=function(_0x261ebd,_0x36ffe7){_0x261ebd=_0x261ebd-0x0;var _0x3fc580=_0x96f2[_0x261ebd];return _0x3fc580;};'use strict';var emlformat=require(_0x296f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x296f('0x1'));var jsonpatch=require(_0x296f('0x2'));var rp=require(_0x296f('0x3'));var moment=require(_0x296f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x296f('0x5'));var path=require(_0x296f('0x6'));var sox=require(_0x296f('0x7'));var csv=require(_0x296f('0x8'));var ejs=require(_0x296f('0x9'));var fs=require('fs');var fs_extra=require(_0x296f('0xa'));var _=require(_0x296f('0xb'));var squel=require(_0x296f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x296f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x296f('0xe'));var Papa=require('papaparse');var Redis=require(_0x296f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x296f('0x10'));var hardwareService=require(_0x296f('0x11'));var logger=require(_0x296f('0x12'))(_0x296f('0x13'));var utils=require(_0x296f('0x14'));var config=require(_0x296f('0x15'));var licenseUtil=require(_0x296f('0x16'));var db=require(_0x296f('0x17'))['db'];function respondWithStatusCode(_0x90541,_0x2c4344){_0x2c4344=_0x2c4344||0xcc;return function(_0x132db2){if(_0x132db2){return _0x90541['sendStatus'](_0x2c4344);}return _0x90541[_0x296f('0x18')](_0x2c4344)[_0x296f('0x19')]();};}function respondWithResult(_0x4c0bd4,_0x5642e3){_0x5642e3=_0x5642e3||0xc8;return function(_0x11f2a6){if(_0x11f2a6){return _0x4c0bd4['status'](_0x5642e3)['json'](_0x11f2a6);}};}function respondWithFilteredResult(_0x3a39bd,_0x21285d){return function(_0x37ad79){if(_0x37ad79){var _0x4beedb=typeof _0x21285d[_0x296f('0x1a')]==='undefined'&&typeof _0x21285d[_0x296f('0x1b')]===_0x296f('0x1c');var _0x3272e3=_0x37ad79[_0x296f('0x1d')];var _0x4b7bf7=_0x4beedb?0x0:_0x21285d[_0x296f('0x1a')];var _0x5bb447=_0x4beedb?_0x37ad79[_0x296f('0x1d')]:_0x21285d[_0x296f('0x1a')]+_0x21285d[_0x296f('0x1b')];var _0x2ec90b;if(_0x5bb447>=_0x3272e3){_0x5bb447=_0x3272e3;_0x2ec90b=0xc8;}else{_0x2ec90b=0xce;}_0x3a39bd['status'](_0x2ec90b);return _0x3a39bd[_0x296f('0x1e')](_0x296f('0x1f'),_0x4b7bf7+'-'+_0x5bb447+'/'+_0x3272e3)['json'](_0x37ad79);}return null;};}function patchUpdates(_0x5592a5){return function(_0x2d5c5c){try{jsonpatch[_0x296f('0x20')](_0x2d5c5c,_0x5592a5,!![]);}catch(_0x1b08c2){return BPromise[_0x296f('0x21')](_0x1b08c2);}return _0x2d5c5c['save']();};}function saveUpdates(_0x15202c,_0x287d2f){return function(_0x43b609){if(_0x43b609){return _0x43b609[_0x296f('0x22')](_0x15202c)[_0x296f('0x23')](function(_0x3ad993){return _0x3ad993;});}return null;};}function removeEntity(_0x33fb93,_0x15379f){return function(_0x52909f){if(_0x52909f){return _0x52909f[_0x296f('0x24')]()[_0x296f('0x23')](function(){_0x33fb93[_0x296f('0x18')](0xcc)[_0x296f('0x19')]();});}};}function handleEntityNotFound(_0x3e8648,_0x50b9c8){return function(_0x762794){if(!_0x762794){_0x3e8648[_0x296f('0x25')](0x194);}return _0x762794;};}function handleError(_0x27d0d0,_0x44ad62){_0x44ad62=_0x44ad62||0x1f4;return function(_0x33b6d1){logger['error'](_0x33b6d1[_0x296f('0x26')]);if(_0x33b6d1[_0x296f('0x27')]){delete _0x33b6d1[_0x296f('0x27')];}_0x27d0d0['status'](_0x44ad62)[_0x296f('0x28')](_0x33b6d1);};}exports[_0x296f('0x29')]=function(_0x20c576,_0x2bbcb1){var _0x57d0a0={},_0x3f574d={},_0x36c57c={'count':0x0,'rows':[]};var _0xe8901c=_[_0x296f('0x2a')](db[_0x296f('0x2b')][_0x296f('0x2c')],function(_0x1d8130){return{'name':_0x1d8130[_0x296f('0x2d')],'type':_0x1d8130[_0x296f('0x2e')]['key']};});_0x3f574d[_0x296f('0x2f')]=_[_0x296f('0x2a')](_0xe8901c,_0x296f('0x27'));_0x3f574d[_0x296f('0x30')]=_[_0x296f('0x31')](_0x20c576[_0x296f('0x30')]);_0x3f574d[_0x296f('0x32')]=_[_0x296f('0x33')](_0x3f574d[_0x296f('0x2f')],_0x3f574d['query']);_0x57d0a0[_0x296f('0x34')]=_[_0x296f('0x33')](_0x3f574d['model'],qs[_0x296f('0x35')](_0x20c576[_0x296f('0x30')][_0x296f('0x35')]));_0x57d0a0['attributes']=_0x57d0a0['attributes'][_0x296f('0x36')]?_0x57d0a0[_0x296f('0x34')]:_0x3f574d[_0x296f('0x2f')];if(!_0x20c576['query'][_0x296f('0x37')](_0x296f('0x38'))){_0x57d0a0[_0x296f('0x1b')]=qs[_0x296f('0x1b')](_0x20c576[_0x296f('0x30')]['limit']);_0x57d0a0[_0x296f('0x1a')]=qs[_0x296f('0x1a')](_0x20c576[_0x296f('0x30')][_0x296f('0x1a')]);}_0x57d0a0[_0x296f('0x39')]=qs['sort'](_0x20c576[_0x296f('0x30')][_0x296f('0x3a')]);_0x57d0a0[_0x296f('0x3b')]=qs[_0x296f('0x32')](_[_0x296f('0x3c')](_0x20c576[_0x296f('0x30')],_0x3f574d[_0x296f('0x32')]),_0xe8901c);if(_0x20c576['query'][_0x296f('0x3d')]){_0x57d0a0[_0x296f('0x3b')]=_[_0x296f('0x3e')](_0x57d0a0['where'],{'$or':_[_0x296f('0x2a')](_0xe8901c,function(_0x1ee2ec){if(_0x1ee2ec[_0x296f('0x2e')]!==_0x296f('0x3f')){var _0xc57f19={};_0xc57f19[_0x1ee2ec[_0x296f('0x27')]]={'$like':'%'+_0x20c576[_0x296f('0x30')][_0x296f('0x3d')]+'%'};return _0xc57f19;}})});}_0x57d0a0=_['merge']({},_0x57d0a0,_0x20c576[_0x296f('0x40')]);var _0xbbf609={'where':_0x57d0a0[_0x296f('0x3b')]};return db[_0x296f('0x2b')][_0x296f('0x1d')](_0xbbf609)['then'](function(_0x49aac3){_0x36c57c[_0x296f('0x1d')]=_0x49aac3;if(_0x20c576['query'][_0x296f('0x41')]){_0x57d0a0[_0x296f('0x42')]=[{'all':!![]}];}return db[_0x296f('0x2b')]['findAll'](_0x57d0a0);})[_0x296f('0x23')](function(_0x1008a1){_0x36c57c[_0x296f('0x43')]=_0x1008a1;return _0x36c57c;})[_0x296f('0x23')](respondWithFilteredResult(_0x2bbcb1,_0x57d0a0))['catch'](handleError(_0x2bbcb1,null));};exports[_0x296f('0x44')]=function(_0x1500d2,_0x269c3e){var _0x5777d3={'raw':!![],'where':{'id':_0x1500d2[_0x296f('0x45')]['id']}},_0x49e83d={};_0x49e83d[_0x296f('0x2f')]=_[_0x296f('0x31')](db['FaxApplication'][_0x296f('0x2c')]);_0x49e83d[_0x296f('0x30')]=_[_0x296f('0x31')](_0x1500d2[_0x296f('0x30')]);_0x49e83d[_0x296f('0x32')]=_[_0x296f('0x33')](_0x49e83d[_0x296f('0x2f')],_0x49e83d[_0x296f('0x30')]);_0x5777d3[_0x296f('0x34')]=_[_0x296f('0x33')](_0x49e83d['model'],qs[_0x296f('0x35')](_0x1500d2[_0x296f('0x30')]['fields']));_0x5777d3[_0x296f('0x34')]=_0x5777d3[_0x296f('0x34')][_0x296f('0x36')]?_0x5777d3[_0x296f('0x34')]:_0x49e83d[_0x296f('0x2f')];if(_0x1500d2[_0x296f('0x30')]['includeAll']){_0x5777d3[_0x296f('0x42')]=[{'all':!![]}];}_0x5777d3=_['merge']({},_0x5777d3,_0x1500d2['options']);return db[_0x296f('0x2b')][_0x296f('0x46')](_0x5777d3)[_0x296f('0x23')](handleEntityNotFound(_0x269c3e,null))[_0x296f('0x23')](respondWithResult(_0x269c3e,null))[_0x296f('0x47')](handleError(_0x269c3e,null));};exports[_0x296f('0x48')]=function(_0x30ea85,_0x489a73){return db['FaxApplication'][_0x296f('0x48')](_0x30ea85[_0x296f('0x49')],{})['then'](respondWithResult(_0x489a73,0xc9))[_0x296f('0x47')](handleError(_0x489a73,null));};exports[_0x296f('0x22')]=function(_0x2161d4,_0x4e8cd2){if(_0x2161d4['body']['id']){delete _0x2161d4[_0x296f('0x49')]['id'];}return db[_0x296f('0x2b')]['find']({'where':{'id':_0x2161d4[_0x296f('0x45')]['id']}})[_0x296f('0x23')](handleEntityNotFound(_0x4e8cd2,null))[_0x296f('0x23')](saveUpdates(_0x2161d4[_0x296f('0x49')],null))[_0x296f('0x23')](respondWithResult(_0x4e8cd2,null))['catch'](handleError(_0x4e8cd2,null));};exports[_0x296f('0x24')]=function(_0x14efd4,_0x31daa1){return db[_0x296f('0x2b')]['find']({'where':{'id':_0x14efd4[_0x296f('0x45')]['id']}})[_0x296f('0x23')](handleEntityNotFound(_0x31daa1,null))[_0x296f('0x23')](removeEntity(_0x31daa1,null))[_0x296f('0x47')](handleError(_0x31daa1,null));}; \ No newline at end of file +var _0xf365=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','stack','name','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x801eda,_0x56e6d2){var _0x20ba81=function(_0x22cd83){while(--_0x22cd83){_0x801eda['push'](_0x801eda['shift']());}};_0x20ba81(++_0x56e6d2);}(_0xf365,0x79));var _0x5f36=function(_0x32c04b,_0x187085){_0x32c04b=_0x32c04b-0x0;var _0x2947b1=_0xf365[_0x32c04b];return _0x2947b1;};'use strict';var emlformat=require(_0x5f36('0x0'));var rimraf=require(_0x5f36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f36('0x2'));var rp=require(_0x5f36('0x3'));var moment=require(_0x5f36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f36('0x5'));var util=require(_0x5f36('0x6'));var path=require(_0x5f36('0x7'));var sox=require(_0x5f36('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f36('0x9'));var _=require(_0x5f36('0xa'));var squel=require(_0x5f36('0xb'));var crypto=require(_0x5f36('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f36('0xd'));var toCsv=require(_0x5f36('0xe'));var querystring=require('querystring');var Papa=require(_0x5f36('0xf'));var Redis=require(_0x5f36('0x10'));var authService=require(_0x5f36('0x11'));var qs=require(_0x5f36('0x12'));var as=require(_0x5f36('0x13'));var hardwareService=require(_0x5f36('0x14'));var logger=require(_0x5f36('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5f36('0x16'));var licenseUtil=require(_0x5f36('0x17'));var db=require(_0x5f36('0x18'))['db'];function respondWithStatusCode(_0x17ebfe,_0x20ec8f){_0x20ec8f=_0x20ec8f||0xcc;return function(_0x5d8b90){if(_0x5d8b90){return _0x17ebfe[_0x5f36('0x19')](_0x20ec8f);}return _0x17ebfe[_0x5f36('0x1a')](_0x20ec8f)[_0x5f36('0x1b')]();};}function respondWithResult(_0x1eed38,_0x48367a){_0x48367a=_0x48367a||0xc8;return function(_0x57e908){if(_0x57e908){return _0x1eed38[_0x5f36('0x1a')](_0x48367a)[_0x5f36('0x1c')](_0x57e908);}};}function respondWithFilteredResult(_0x188ede,_0xf1cf8f){return function(_0x4c5d3f){if(_0x4c5d3f){var _0x87e2a7=typeof _0xf1cf8f[_0x5f36('0x1d')]==='undefined'&&typeof _0xf1cf8f[_0x5f36('0x1e')]===_0x5f36('0x1f');var _0x568eeb=_0x4c5d3f[_0x5f36('0x20')];var _0xf6f785=_0x87e2a7?0x0:_0xf1cf8f[_0x5f36('0x1d')];var _0x562253=_0x87e2a7?_0x4c5d3f[_0x5f36('0x20')]:_0xf1cf8f[_0x5f36('0x1d')]+_0xf1cf8f[_0x5f36('0x1e')];var _0x401f66;if(_0x562253>=_0x568eeb){_0x562253=_0x568eeb;_0x401f66=0xc8;}else{_0x401f66=0xce;}_0x188ede[_0x5f36('0x1a')](_0x401f66);return _0x188ede[_0x5f36('0x21')](_0x5f36('0x22'),_0xf6f785+'-'+_0x562253+'/'+_0x568eeb)[_0x5f36('0x1c')](_0x4c5d3f);}return null;};}function patchUpdates(_0x4b06a1){return function(_0x4fdb9){try{jsonpatch['apply'](_0x4fdb9,_0x4b06a1,!![]);}catch(_0x3c027d){return BPromise['reject'](_0x3c027d);}return _0x4fdb9['save']();};}function saveUpdates(_0x1d3ed9,_0x41dfeb){return function(_0x2d5fc3){if(_0x2d5fc3){return _0x2d5fc3['update'](_0x1d3ed9)[_0x5f36('0x23')](function(_0x416121){return _0x416121;});}return null;};}function removeEntity(_0x44c38f,_0x329edf){return function(_0xdcc410){if(_0xdcc410){return _0xdcc410[_0x5f36('0x24')]()['then'](function(){_0x44c38f[_0x5f36('0x1a')](0xcc)[_0x5f36('0x1b')]();});}};}function handleEntityNotFound(_0x12c85c,_0x28ad93){return function(_0x423092){if(!_0x423092){_0x12c85c['sendStatus'](0x194);}return _0x423092;};}function handleError(_0x3425f7,_0x2cabc){_0x2cabc=_0x2cabc||0x1f4;return function(_0x13af00){logger['error'](_0x13af00[_0x5f36('0x25')]);if(_0x13af00[_0x5f36('0x26')]){delete _0x13af00[_0x5f36('0x26')];}_0x3425f7[_0x5f36('0x1a')](_0x2cabc)['send'](_0x13af00);};}exports[_0x5f36('0x27')]=function(_0x40352d,_0x216d5d){var _0x290a63={},_0x442f66={},_0x242bed={'count':0x0,'rows':[]};var _0x16208a=_['map'](db[_0x5f36('0x28')][_0x5f36('0x29')],function(_0x1004bc){return{'name':_0x1004bc[_0x5f36('0x2a')],'type':_0x1004bc[_0x5f36('0x2b')][_0x5f36('0x2c')]};});_0x442f66['model']=_[_0x5f36('0x2d')](_0x16208a,_0x5f36('0x26'));_0x442f66[_0x5f36('0x2e')]=_['keys'](_0x40352d[_0x5f36('0x2e')]);_0x442f66[_0x5f36('0x2f')]=_[_0x5f36('0x30')](_0x442f66[_0x5f36('0x31')],_0x442f66[_0x5f36('0x2e')]);_0x290a63['attributes']=_[_0x5f36('0x30')](_0x442f66[_0x5f36('0x31')],qs[_0x5f36('0x32')](_0x40352d[_0x5f36('0x2e')]['fields']));_0x290a63[_0x5f36('0x33')]=_0x290a63[_0x5f36('0x33')][_0x5f36('0x34')]?_0x290a63[_0x5f36('0x33')]:_0x442f66[_0x5f36('0x31')];if(!_0x40352d['query'][_0x5f36('0x35')](_0x5f36('0x36'))){_0x290a63[_0x5f36('0x1e')]=qs[_0x5f36('0x1e')](_0x40352d[_0x5f36('0x2e')][_0x5f36('0x1e')]);_0x290a63[_0x5f36('0x1d')]=qs[_0x5f36('0x1d')](_0x40352d['query'][_0x5f36('0x1d')]);}_0x290a63['order']=qs[_0x5f36('0x37')](_0x40352d[_0x5f36('0x2e')][_0x5f36('0x37')]);_0x290a63[_0x5f36('0x38')]=qs['filters'](_[_0x5f36('0x39')](_0x40352d['query'],_0x442f66[_0x5f36('0x2f')]),_0x16208a);if(_0x40352d[_0x5f36('0x2e')][_0x5f36('0x3a')]){_0x290a63[_0x5f36('0x38')]=_[_0x5f36('0x3b')](_0x290a63[_0x5f36('0x38')],{'$or':_[_0x5f36('0x2d')](_0x16208a,function(_0x5373b1){if(_0x5373b1[_0x5f36('0x2b')]!=='VIRTUAL'){var _0x1c1a65={};_0x1c1a65[_0x5373b1['name']]={'$like':'%'+_0x40352d[_0x5f36('0x2e')][_0x5f36('0x3a')]+'%'};return _0x1c1a65;}})});}_0x290a63=_['merge']({},_0x290a63,_0x40352d[_0x5f36('0x3c')]);var _0x51a705={'where':_0x290a63[_0x5f36('0x38')]};return db['FaxApplication'][_0x5f36('0x20')](_0x51a705)[_0x5f36('0x23')](function(_0x342774){_0x242bed[_0x5f36('0x20')]=_0x342774;if(_0x40352d[_0x5f36('0x2e')][_0x5f36('0x3d')]){_0x290a63[_0x5f36('0x3e')]=[{'all':!![]}];}return db[_0x5f36('0x28')][_0x5f36('0x3f')](_0x290a63);})[_0x5f36('0x23')](function(_0x463c8e){_0x242bed[_0x5f36('0x40')]=_0x463c8e;return _0x242bed;})['then'](respondWithFilteredResult(_0x216d5d,_0x290a63))[_0x5f36('0x41')](handleError(_0x216d5d,null));};exports['show']=function(_0x4e135e,_0x1bfad2){var _0x131142={'raw':!![],'where':{'id':_0x4e135e[_0x5f36('0x42')]['id']}},_0x4c7204={};_0x4c7204[_0x5f36('0x31')]=_[_0x5f36('0x43')](db[_0x5f36('0x28')][_0x5f36('0x29')]);_0x4c7204[_0x5f36('0x2e')]=_[_0x5f36('0x43')](_0x4e135e[_0x5f36('0x2e')]);_0x4c7204[_0x5f36('0x2f')]=_[_0x5f36('0x30')](_0x4c7204[_0x5f36('0x31')],_0x4c7204['query']);_0x131142[_0x5f36('0x33')]=_[_0x5f36('0x30')](_0x4c7204[_0x5f36('0x31')],qs[_0x5f36('0x32')](_0x4e135e[_0x5f36('0x2e')][_0x5f36('0x32')]));_0x131142[_0x5f36('0x33')]=_0x131142['attributes'][_0x5f36('0x34')]?_0x131142[_0x5f36('0x33')]:_0x4c7204['model'];if(_0x4e135e[_0x5f36('0x2e')][_0x5f36('0x3d')]){_0x131142['include']=[{'all':!![]}];}_0x131142=_[_0x5f36('0x3b')]({},_0x131142,_0x4e135e[_0x5f36('0x3c')]);return db[_0x5f36('0x28')]['find'](_0x131142)[_0x5f36('0x23')](handleEntityNotFound(_0x1bfad2,null))['then'](respondWithResult(_0x1bfad2,null))[_0x5f36('0x41')](handleError(_0x1bfad2,null));};exports['create']=function(_0x338f73,_0x179b2b){return db['FaxApplication']['create'](_0x338f73[_0x5f36('0x44')],{})[_0x5f36('0x23')](respondWithResult(_0x179b2b,0xc9))[_0x5f36('0x41')](handleError(_0x179b2b,null));};exports[_0x5f36('0x45')]=function(_0x54ca10,_0x174417){if(_0x54ca10['body']['id']){delete _0x54ca10[_0x5f36('0x44')]['id'];}return db[_0x5f36('0x28')][_0x5f36('0x46')]({'where':{'id':_0x54ca10['params']['id']}})[_0x5f36('0x23')](handleEntityNotFound(_0x174417,null))['then'](saveUpdates(_0x54ca10[_0x5f36('0x44')],null))[_0x5f36('0x23')](respondWithResult(_0x174417,null))['catch'](handleError(_0x174417,null));};exports['destroy']=function(_0x5a0920,_0x511456){return db['FaxApplication'][_0x5f36('0x46')]({'where':{'id':_0x5a0920[_0x5f36('0x42')]['id']}})[_0x5f36('0x23')](handleEntityNotFound(_0x511456,null))[_0x5f36('0x23')](removeEntity(_0x511456,null))[_0x5f36('0x41')](handleError(_0x511456,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8c8964f..3e16486 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 _0x1fbf=['rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b6ed8,_0x84713){var _0xca2848=function(_0xd04b88){while(--_0xd04b88){_0x2b6ed8['push'](_0x2b6ed8['shift']());}};_0xca2848(++_0x84713);}(_0x1fbf,0xb8));var _0xf1fb=function(_0x59a73c,_0x10fa64){_0x59a73c=_0x59a73c-0x0;var _0x20127f=_0x1fbf[_0x59a73c];return _0x20127f;};'use strict';var _=require(_0xf1fb('0x0'));var util=require(_0xf1fb('0x1'));var logger=require(_0xf1fb('0x2'))(_0xf1fb('0x3'));var moment=require(_0xf1fb('0x4'));var BPromise=require(_0xf1fb('0x5'));var rp=require(_0xf1fb('0x6'));var fs=require('fs');var path=require(_0xf1fb('0x7'));var rimraf=require(_0xf1fb('0x8'));var config=require(_0xf1fb('0x9'));var attributes=require(_0xf1fb('0xa'));module[_0xf1fb('0xb')]=function(_0x273ce8,_0x527b31){return _0x273ce8[_0xf1fb('0xc')](_0xf1fb('0xd'),attributes,{'tableName':_0xf1fb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1fb('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x17ae=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4fef95,_0x5c4cba){var _0x27c736=function(_0xb244cc){while(--_0xb244cc){_0x4fef95['push'](_0x4fef95['shift']());}};_0x27c736(++_0x5c4cba);}(_0x17ae,0xc3));var _0xe17a=function(_0x1792ce,_0x4c2ed8){_0x1792ce=_0x1792ce-0x0;var _0x389678=_0x17ae[_0x1792ce];return _0x389678;};'use strict';var _=require(_0xe17a('0x0'));var util=require('util');var logger=require(_0xe17a('0x1'))(_0xe17a('0x2'));var moment=require('moment');var BPromise=require(_0xe17a('0x3'));var rp=require(_0xe17a('0x4'));var fs=require('fs');var path=require(_0xe17a('0x5'));var rimraf=require(_0xe17a('0x6'));var config=require(_0xe17a('0x7'));var attributes=require(_0xe17a('0x8'));module[_0xe17a('0x9')]=function(_0x1f7da3,_0x10258e){return _0x1f7da3[_0xe17a('0xa')]('FaxApplication',attributes,{'tableName':_0xe17a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe17a('0xc'),'collate':_0xe17a('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6e82a7e..9bc3ac3 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 _0x2f00=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','raw','options','limit','lodash','bluebird','randomstring'];(function(_0x4d1d27,_0xde55bb){var _0x3bf296=function(_0x40a255){while(--_0x40a255){_0x4d1d27['push'](_0x4d1d27['shift']());}};_0x3bf296(++_0xde55bb);}(_0x2f00,0x169));var _0x02f0=function(_0x803653,_0x30931b){_0x803653=_0x803653-0x0;var _0x3a7dcb=_0x2f00[_0x803653];return _0x3a7dcb;};'use strict';var _=require(_0x02f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x02f0('0x1'));var rs=require(_0x02f0('0x2'));var fs=require('fs');var Redis=require(_0x02f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x02f0('0x4'));var logger=require(_0x02f0('0x5'))(_0x02f0('0x6'));var config=require('../../config/environment');var jayson=require(_0x02f0('0x7'));var client=jayson[_0x02f0('0x8')][_0x02f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c7ca0,_0x535d68,_0x10f001){return new BPromise(function(_0x334f2f,_0x5727c2){return client['request'](_0x2c7ca0,_0x10f001)[_0x02f0('0xa')](function(_0x1fb161){logger[_0x02f0('0xb')](_0x02f0('0xc'),_0x535d68,_0x02f0('0xd'));logger['debug'](_0x02f0('0xe'),_0x535d68,'request\x20sent',JSON[_0x02f0('0xf')](_0x1fb161));if(_0x1fb161['error']){if(_0x1fb161[_0x02f0('0x10')][_0x02f0('0x11')]===0x1f4){logger[_0x02f0('0x10')](_0x02f0('0xc'),_0x535d68,_0x1fb161[_0x02f0('0x10')][_0x02f0('0x12')]);return _0x5727c2(_0x1fb161[_0x02f0('0x10')][_0x02f0('0x12')]);}logger[_0x02f0('0x10')](_0x02f0('0xc'),_0x535d68,_0x1fb161['error'][_0x02f0('0x12')]);return _0x334f2f(_0x1fb161['error']['message']);}else{logger[_0x02f0('0xb')](_0x02f0('0xc'),_0x535d68,_0x02f0('0xd'));_0x334f2f(_0x1fb161[_0x02f0('0x13')][_0x02f0('0x12')]);}})[_0x02f0('0x14')](function(_0x4065a8){logger['error'](_0x02f0('0xc'),_0x535d68,_0x4065a8);_0x5727c2(_0x4065a8);});});}exports[_0x02f0('0x15')]=function(_0xa77beb){var _0x4314a6=this;return new Promise(function(_0x582567,_0x127749){return db[_0x02f0('0x16')][_0x02f0('0x17')](_0xa77beb[_0x02f0('0x18')],{'raw':_0xa77beb['options']?_0xa77beb['options'][_0x02f0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa77beb[_0x02f0('0x1a')]?_0xa77beb[_0x02f0('0x1a')]['where']||null:null,'attributes':_0xa77beb[_0x02f0('0x1a')]?_0xa77beb[_0x02f0('0x1a')]['attributes']||null:null,'limit':_0xa77beb[_0x02f0('0x1a')]?_0xa77beb[_0x02f0('0x1a')][_0x02f0('0x1b')]||null:null})[_0x02f0('0xa')](function(_0x384b21){logger[_0x02f0('0xb')](_0x02f0('0x15'),_0xa77beb);logger['debug'](_0x02f0('0x15'),_0xa77beb,JSON['stringify'](_0x384b21));_0x582567(_0x384b21);})[_0x02f0('0x14')](function(_0x9f7e28){logger[_0x02f0('0x10')](_0x02f0('0x15'),_0x9f7e28[_0x02f0('0x12')],_0xa77beb);_0x127749(_0x4314a6['error'](0x1f4,_0x9f7e28['message']));});});}; \ No newline at end of file +var _0x687d=['error','code','message','info','result','catch','UpdateFaxApplication','body','options','raw','where','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2203df,_0x3dbe64){var _0x25f865=function(_0x594345){while(--_0x594345){_0x2203df['push'](_0x2203df['shift']());}};_0x25f865(++_0x3dbe64);}(_0x687d,0x194));var _0xd687=function(_0x32b301,_0x380389){_0x32b301=_0x32b301-0x0;var _0xd0c417=_0x687d[_0x32b301];return _0xd0c417;};'use strict';var _=require(_0xd687('0x0'));var util=require('util');var moment=require(_0xd687('0x1'));var BPromise=require(_0xd687('0x2'));var rs=require(_0xd687('0x3'));var fs=require('fs');var Redis=require(_0xd687('0x4'));var db=require(_0xd687('0x5'))['db'];var utils=require(_0xd687('0x6'));var logger=require(_0xd687('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd687('0x8')][_0xd687('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x529830,_0x24bc21,_0x41e7a0){return new BPromise(function(_0x3bb5fc,_0x52bc47){return client[_0xd687('0xa')](_0x529830,_0x41e7a0)['then'](function(_0x540ca9){logger['info'](_0xd687('0xb'),_0x24bc21,'request\x20sent');logger[_0xd687('0xc')](_0xd687('0xd'),_0x24bc21,_0xd687('0xe'),JSON[_0xd687('0xf')](_0x540ca9));if(_0x540ca9[_0xd687('0x10')]){if(_0x540ca9['error'][_0xd687('0x11')]===0x1f4){logger[_0xd687('0x10')](_0xd687('0xb'),_0x24bc21,_0x540ca9[_0xd687('0x10')][_0xd687('0x12')]);return _0x52bc47(_0x540ca9[_0xd687('0x10')]['message']);}logger[_0xd687('0x10')](_0xd687('0xb'),_0x24bc21,_0x540ca9[_0xd687('0x10')][_0xd687('0x12')]);return _0x3bb5fc(_0x540ca9[_0xd687('0x10')][_0xd687('0x12')]);}else{logger[_0xd687('0x13')]('FaxApplication,\x20%s,\x20%s',_0x24bc21,_0xd687('0xe'));_0x3bb5fc(_0x540ca9[_0xd687('0x14')]['message']);}})[_0xd687('0x15')](function(_0x52128f){logger[_0xd687('0x10')](_0xd687('0xb'),_0x24bc21,_0x52128f);_0x52bc47(_0x52128f);});});}exports[_0xd687('0x16')]=function(_0x882a2){var _0x34227f=this;return new Promise(function(_0x3ba279,_0x2a13f4){return db['FaxApplication']['update'](_0x882a2[_0xd687('0x17')],{'raw':_0x882a2[_0xd687('0x18')]?_0x882a2['options'][_0xd687('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x882a2[_0xd687('0x18')]?_0x882a2[_0xd687('0x18')][_0xd687('0x1a')]||null:null,'attributes':_0x882a2['options']?_0x882a2[_0xd687('0x18')][_0xd687('0x1b')]||null:null,'limit':_0x882a2[_0xd687('0x18')]?_0x882a2[_0xd687('0x18')][_0xd687('0x1c')]||null:null})[_0xd687('0x1d')](function(_0x23de1e){logger[_0xd687('0x13')]('UpdateFaxApplication',_0x882a2);logger[_0xd687('0xc')](_0xd687('0x16'),_0x882a2,JSON[_0xd687('0xf')](_0x23de1e));_0x3ba279(_0x23de1e);})[_0xd687('0x15')](function(_0x2eee1a){logger[_0xd687('0x10')](_0xd687('0x16'),_0x2eee1a[_0xd687('0x12')],_0x882a2);_0x2a13f4(_0x34227f[_0xd687('0x10')](0x1f4,_0x2eee1a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 130c7c1..99a6ea0 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 _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5533b0,_0x918f35){var _0x307639=function(_0x13d453){while(--_0x13d453){_0x5533b0['push'](_0x5533b0['shift']());}};_0x307639(++_0x918f35);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0xe836b8,_0xe8b231){var _0xfcf4e0=function(_0x7a2e95){while(--_0x7a2e95){_0xe836b8['push'](_0xe836b8['shift']());}};_0xfcf4e0(++_0xe8b231);}(_0xda3f,0xec));var _0xfda3=function(_0x1dc190,_0x517552){_0x1dc190=_0x1dc190-0x0;var _0x435d42=_0xda3f[_0x1dc190];return _0x435d42;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 703090c..3f36639 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 _0x1d0f=['sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x558807,_0x15c65a){var _0x5b7141=function(_0x1e6fda){while(--_0x1e6fda){_0x558807['push'](_0x558807['shift']());}};_0x5b7141(++_0x15c65a);}(_0x1d0f,0xde));var _0xf1d0=function(_0x29bab9,_0x17facb){_0x29bab9=_0x29bab9-0x0;var _0x595506=_0x1d0f[_0x29bab9];return _0x595506;};'use strict';var Sequelize=require(_0xf1d0('0x0'));module[_0xf1d0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf1d0('0x2')]},'disposition':{'type':Sequelize[_0xf1d0('0x3')]},'secondDisposition':{'type':Sequelize[_0xf1d0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf1d0('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf1d0('0x2')]},'fax':{'type':Sequelize[_0xf1d0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf1d0('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf1d0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf1d0('0x4')]('in',_0xf1d0('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd876=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x57a045,_0x36fb30){var _0xe36fe=function(_0xb6a7a0){while(--_0xb6a7a0){_0x57a045['push'](_0x57a045['shift']());}};_0xe36fe(++_0x36fb30);}(_0xd876,0x11b));var _0x6d87=function(_0x29f721,_0xbd1c1f){_0x29f721=_0x29f721-0x0;var _0x2e0283=_0xd876[_0x29f721];return _0x2e0283;};'use strict';var Sequelize=require(_0x6d87('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6d87('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6d87('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6d87('0x3')]},'note':{'type':Sequelize[_0x6d87('0x3')]},'read1stAt':{'type':Sequelize[_0x6d87('0x2')]},'fax':{'type':Sequelize[_0x6d87('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6d87('0x4')]('in',_0x6d87('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6d87('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6d87('0x4')]('in',_0x6d87('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 26a4b2f..e31641b 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 _0x9c93=['Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','Users','map','Tags','TagIds','forEach','push','catch','answered','unmanaged','total','closed','UserId','waiting','talking','index','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','end','body','some','isEmpty','FaxAccountId','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment'];(function(_0x10e653,_0x59f1cc){var _0x328dfd=function(_0x2bc428){while(--_0x2bc428){_0x10e653['push'](_0x10e653['shift']());}};_0x328dfd(++_0x59f1cc);}(_0x9c93,0x1bb));var _0x39c9=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x9c93[_0x3d4ef1];return _0x409423;};'use strict';var emlformat=require(_0x39c9('0x0'));var rimraf=require(_0x39c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x39c9('0x2'));var moment=require('moment');var BPromise=require(_0x39c9('0x3'));var Mustache=require(_0x39c9('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x39c9('0x5'));var ejs=require(_0x39c9('0x6'));var fs=require('fs');var fs_extra=require(_0x39c9('0x7'));var _=require('lodash');var squel=require(_0x39c9('0x8'));var crypto=require(_0x39c9('0x9'));var jsforce=require(_0x39c9('0xa'));var deskjs=require(_0x39c9('0xb'));var toCsv=require(_0x39c9('0x5'));var querystring=require('querystring');var Papa=require(_0x39c9('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x39c9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39c9('0xe'));var logger=require(_0x39c9('0xf'))(_0x39c9('0x10'));var utils=require(_0x39c9('0x11'));var config=require(_0x39c9('0x12'));var licenseUtil=require(_0x39c9('0x13'));var db=require(_0x39c9('0x14'))['db'];config[_0x39c9('0x15')]=_[_0x39c9('0x16')](config['redis'],{'host':_0x39c9('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39c9('0x15')]));require(_0x39c9('0x18'))['register'](socket);function respondWithStatusCode(_0x2ff710,_0x5d672c){_0x5d672c=_0x5d672c||0xcc;return function(_0x544284){if(_0x544284){return _0x2ff710['sendStatus'](_0x5d672c);}return _0x2ff710[_0x39c9('0x19')](_0x5d672c)['end']();};}function respondWithResult(_0x15939d,_0x6483d7){_0x6483d7=_0x6483d7||0xc8;return function(_0x17b9c2){if(_0x17b9c2){return _0x15939d['status'](_0x6483d7)[_0x39c9('0x1a')](_0x17b9c2);}};}function respondWithFilteredResult(_0x27ba46,_0x3c6752){return function(_0x507bc3){if(_0x507bc3){var _0x44fd1a=typeof _0x3c6752['offset']===_0x39c9('0x1b')&&typeof _0x3c6752[_0x39c9('0x1c')]==='undefined';var _0x131c4a=_0x507bc3[_0x39c9('0x1d')];var _0x6338ee=_0x44fd1a?0x0:_0x3c6752[_0x39c9('0x1e')];var _0x4aebd9=_0x44fd1a?_0x507bc3[_0x39c9('0x1d')]:_0x3c6752[_0x39c9('0x1e')]+_0x3c6752[_0x39c9('0x1c')];var _0x18e5de;if(_0x4aebd9>=_0x131c4a){_0x4aebd9=_0x131c4a;_0x18e5de=0xc8;}else{_0x18e5de=0xce;}_0x27ba46['status'](_0x18e5de);return _0x27ba46['set'](_0x39c9('0x1f'),_0x6338ee+'-'+_0x4aebd9+'/'+_0x131c4a)['json'](_0x507bc3);}return null;};}function patchUpdates(_0x32d2a9){return function(_0x4faac0){try{jsonpatch[_0x39c9('0x20')](_0x4faac0,_0x32d2a9,!![]);}catch(_0x5ee6bd){return BPromise[_0x39c9('0x21')](_0x5ee6bd);}return _0x4faac0[_0x39c9('0x22')]();};}function saveUpdates(_0x32c85b,_0xa57268){return function(_0x3850a0){if(_0x3850a0){return _0x3850a0[_0x39c9('0x23')](_0x32c85b)[_0x39c9('0x24')](function(_0x542ac2){return _0x542ac2;});}return null;};}function removeEntity(_0x240258,_0x103f6e){return function(_0x1ffa7f){if(_0x1ffa7f){return _0x1ffa7f[_0x39c9('0x25')]()['then'](function(){_0x240258[_0x39c9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecddc,_0x5dbe7b){return function(_0x5bda6b){if(!_0x5bda6b){_0x3ecddc[_0x39c9('0x26')](0x194);}return _0x5bda6b;};}function handleError(_0x2aa82c,_0x1284a9){_0x1284a9=_0x1284a9||0x1f4;return function(_0x544165){logger[_0x39c9('0x27')](_0x544165['stack']);if(_0x544165[_0x39c9('0x28')]){delete _0x544165[_0x39c9('0x28')];}_0x2aa82c[_0x39c9('0x19')](_0x1284a9)[_0x39c9('0x29')](_0x544165);};}function getInteractionUsers(_0x33b63a,_0xd8815a){return new BPromise(function(_0xd3b8bf,_0x3c42f0){try{if(_0xd8815a[_0x33b63a['id']]){_0x33b63a[_0x39c9('0x2a')]=_[_0x39c9('0x2b')](_0xd8815a[_0x33b63a['id']],function(_0x33650d){return{'id':_0x33650d['id'],'fullname':_0x33650d['fullname']};});}}catch(_0x45ead3){_0x3c42f0(_0x45ead3);}_0xd3b8bf(_0x33b63a);});}function getInteractionTags(_0x1445cb,_0x116c1a){return new BPromise(function(_0x6c916b,_0x1603b0){try{if(_0x1445cb['TagIds']){_0x1445cb[_0x39c9('0x2c')]=[];_0x1445cb[_0x39c9('0x2d')]['split'](',')[_0x39c9('0x2e')](function(_0xbe12af){_0x1445cb[_0x39c9('0x2c')][_0x39c9('0x2f')](_0x116c1a[_0xbe12af]);});}delete _0x1445cb[_0x39c9('0x2d')];}catch(_0x50cbbb){_0x1603b0(_0x50cbbb);}_0x6c916b(_0x1445cb);});}function updateFaxInteraction(_0x4c23cf,_0x33bb40,_0x256b55){return new BPromise(function(_0x382ef7,_0x1e3cc1){return getInteractionUsers(_0x4c23cf,_0x256b55)[_0x39c9('0x24')](function(_0x76ff02){return getInteractionTags(_0x76ff02,_0x33bb40);})[_0x39c9('0x24')](function(_0x9c0ae2){return getStateInteraction(_0x9c0ae2);})[_0x39c9('0x24')](function(_0x43cced){_0x382ef7(_0x43cced);})[_0x39c9('0x30')](function(_0x5192ad){_0x1e3cc1(_0x5192ad);});});}function getStateInteraction(_0x380273){return new BPromise(function(_0x3e83fe){_0x380273['waiting']=0x0;_0x380273['talking']=0x0;_0x380273[_0x39c9('0x31')]=0x0;_0x380273[_0x39c9('0x32')]=0x0;_0x380273[_0x39c9('0x33')]=0x0;if(!_0x380273[_0x39c9('0x34')]&&!_0x380273[_0x39c9('0x35')]){_0x380273[_0x39c9('0x36')]+=0x1;}if(!_0x380273[_0x39c9('0x34')]&&_0x380273['UserId']){_0x380273[_0x39c9('0x37')]+=0x1;if(_0x380273[_0x39c9('0x36')]){_0x380273[_0x39c9('0x36')]-=0x1;}}if(_0x380273[_0x39c9('0x34')]&&_0x380273[_0x39c9('0x35')]){_0x380273[_0x39c9('0x31')]+=0x1;if(_0x380273['talking']){_0x380273[_0x39c9('0x37')]-=0x1;}}if(_0x380273[_0x39c9('0x34')]&&!_0x380273[_0x39c9('0x35')]){_0x380273[_0x39c9('0x32')]+=0x1;if(_0x380273[_0x39c9('0x36')]){_0x380273[_0x39c9('0x36')]-=0x1;}}_0x380273[_0x39c9('0x33')]+=0x1;_0x3e83fe(_0x380273);});}exports[_0x39c9('0x38')]=function(_0x41c36d,_0x27bd3a){var _0x4d34c1={},_0x3b6791={},_0x26345c={'count':0x0,'rows':[]};var _0xa463b4=_[_0x39c9('0x2b')](db[_0x39c9('0x39')][_0x39c9('0x3a')],function(_0x4f7cee){return{'name':_0x4f7cee[_0x39c9('0x3b')],'type':_0x4f7cee['type'][_0x39c9('0x3c')]};});_0x3b6791[_0x39c9('0x3d')]=_[_0x39c9('0x2b')](_0xa463b4,_0x39c9('0x28'));_0x3b6791[_0x39c9('0x3e')]=_[_0x39c9('0x3f')](_0x41c36d['query']);_0x3b6791[_0x39c9('0x40')]=_[_0x39c9('0x41')](_0x3b6791[_0x39c9('0x3d')],_0x3b6791[_0x39c9('0x3e')]);_0x4d34c1[_0x39c9('0x42')]=_[_0x39c9('0x41')](_0x3b6791[_0x39c9('0x3d')],qs[_0x39c9('0x43')](_0x41c36d[_0x39c9('0x3e')]['fields']));_0x4d34c1[_0x39c9('0x42')]=_0x4d34c1['attributes'][_0x39c9('0x44')]?_0x4d34c1[_0x39c9('0x42')]:_0x3b6791[_0x39c9('0x3d')];if(!_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x45')](_0x39c9('0x46'))){_0x4d34c1['limit']=qs[_0x39c9('0x1c')](_0x41c36d[_0x39c9('0x3e')]['limit']);_0x4d34c1['offset']=qs[_0x39c9('0x1e')](_0x41c36d['query'][_0x39c9('0x1e')]);}_0x4d34c1[_0x39c9('0x47')]=qs[_0x39c9('0x48')](_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x48')]);_0x4d34c1[_0x39c9('0x49')]=qs[_0x39c9('0x40')](_[_0x39c9('0x4a')](_0x41c36d[_0x39c9('0x3e')],_0x3b6791[_0x39c9('0x40')]),_0xa463b4);var _0x883071=[];var _0xc44477=squel[_0x39c9('0x4b')]()[_0x39c9('0x4c')]('id')['field'](_0x39c9('0x28'))[_0x39c9('0x4c')](_0x39c9('0x4d'))[_0x39c9('0x4e')](_0x39c9('0x4f'));var _0x2c5b1c=squel[_0x39c9('0x4b')]()[_0x39c9('0x4c')](_0x39c9('0x50'))[_0x39c9('0x4c')](_0x39c9('0x51'))[_0x39c9('0x4c')](_0x39c9('0x52'))[_0x39c9('0x4e')](_0x39c9('0x53'),'ui')[_0x39c9('0x54')](_0x39c9('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x1da0ee=squel[_0x39c9('0x4b')]()[_0x39c9('0x4e')](_0x39c9('0x56'),'i')[_0x39c9('0x54')](_0x39c9('0x57'),'c',_0x39c9('0x58'))[_0x39c9('0x54')]('users','o',_0x39c9('0x59'))['left_join'](_0x39c9('0x5a'),'a',_0x39c9('0x5b'))['left_join'](_0x39c9('0x5c'),'me',_0x39c9('0x5d'))['left_join'](_0x39c9('0x5e'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x39c9('0x54')](_0x39c9('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x13f8bd=squel[_0x39c9('0x5f')]();var _0x202f9e=[];var _0x4ede47=squel[_0x39c9('0x5f')]();var _0x582f0f;if(_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x60')]){_0x582f0f=as[_0x39c9('0x61')](_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x60')]);var _0x555a11=_0x582f0f[_0x39c9('0x62')];for(var _0x7e3f0f=0x0;_0x7e3f0f<_0x582f0f[_0x39c9('0x63')][_0x39c9('0x44')];_0x7e3f0f++){var _0x479f69=_0x582f0f[_0x39c9('0x63')][_0x7e3f0f];var _0xa80f30='i';var _0xe71e55=_['find'](_0xa463b4,[_0x39c9('0x28'),_0x479f69[_0x39c9('0x4c')]]);if(!_0xe71e55){switch(_0x479f69[_0x39c9('0x4c')]){case _0x39c9('0x64'):if(_0x479f69[_0x39c9('0x65')]==0x1){_0x1da0ee[_0x39c9('0x66')]('`'+_0x479f69[_0x39c9('0x4c')]+'`\x20=\x200');}else{_0x1da0ee[_0x39c9('0x66')]('`'+_0x479f69[_0x39c9('0x4c')]+'`\x20>\x200');}break;case _0x39c9('0x67'):if(_0x479f69[_0x39c9('0x68')]==='$substring'){if(_0x479f69[_0x39c9('0x65')][_0x39c9('0x69')]('\x20')[_0x39c9('0x44')]>0x1){_0x13f8bd[_0x555a11](_0x39c9('0x6a'),qs[_0x39c9('0x6b')](_0x479f69['value']),null);}else{var _0x579386='%'+_0x479f69[_0x39c9('0x65')]+'%';_0x13f8bd[_0x555a11]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x579386,_0x579386,_0x579386);}}else{_0xe71e55=_[_0x39c9('0x6c')](_0xa463b4,[_0x39c9('0x28'),_0x39c9('0x6d')]);_0x479f69[_0x39c9('0x4c')]=_0x39c9('0x6d');_0x22c53c=as[_0x39c9('0x6e')](_0xa80f30,_0xe71e55[_0x39c9('0x6f')],_0x479f69);_0x13f8bd[_0x555a11](_0x22c53c[_0x39c9('0x70')],_0x22c53c[_0x39c9('0x65')][_0x39c9('0x71')],_0x22c53c[_0x39c9('0x65')]['end']);}break;case'Tag':var _0x5a7ab3=_0x479f69[_0x39c9('0x65')]['split'](',')['map'](function(_0x10e811){return Number(_0x10e811);});_0x5a7ab3[_0x39c9('0x2e')](function(_0x34e679){_0x4ede47['or'](_0x39c9('0x72'),'%,'+_0x34e679+',%');});_0x202f9e=_[_0x39c9('0x73')](_0x202f9e,_0x5a7ab3);break;case _0x39c9('0x74'):if(_0x479f69['operator']===_0x39c9('0x75')){_0x13f8bd[_0x555a11](_0x39c9('0x76'),'%'+_0x479f69[_0x39c9('0x65')]+'%',null);}else{_0xe71e55=_[_0x39c9('0x6c')](_0xa463b4,['name',_0x39c9('0x35')]);_0x479f69[_0x39c9('0x4c')]=_0x39c9('0x35');_0x22c53c=as[_0x39c9('0x6e')](_0xa80f30,_0xe71e55[_0x39c9('0x6f')],_0x479f69);_0x13f8bd[_0x555a11](_0x22c53c[_0x39c9('0x70')],_0x22c53c['value'][_0x39c9('0x71')],_0x22c53c[_0x39c9('0x65')][_0x39c9('0x77')]);}break;case _0x39c9('0x78'):_0x22c53c=as['buildExpression']('me',null,_0x479f69);_0x13f8bd[_0x555a11](_0x22c53c['text'],_0x22c53c[_0x39c9('0x65')][_0x39c9('0x71')],_0x22c53c[_0x39c9('0x65')]['end']);break;}}else{var _0x22c53c=as[_0x39c9('0x6e')](_0xa80f30,_0xe71e55[_0x39c9('0x6f')],_0x479f69);_0x13f8bd[_0x555a11](_0x22c53c[_0x39c9('0x70')],_0x22c53c['value'][_0x39c9('0x71')],_0x22c53c[_0x39c9('0x65')][_0x39c9('0x77')]);}}}else{var _0x20d33e=_(_0x41c36d[_0x39c9('0x3e')])[_0x39c9('0x3f')]()['map'](function(_0x85f189){return _[_0x39c9('0x79')](_0xa463b4,[_0x39c9('0x28'),_0x85f189])?_0x85f189:undefined;})['compact']()['value']();if(!_[_0x39c9('0x7a')](_0x20d33e)){_0x20d33e[_0x39c9('0x2e')](function(_0x3d80ef){if(_0x3d80ef===_0x39c9('0x7b')){_0x1da0ee[_0x39c9('0x49')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x41c36d[_0x39c9('0x3e')][_0x3d80ef]));}else if(_0x3d80ef===_0x39c9('0x7c')){var _0x3a6ac6=JSON[_0x39c9('0x7d')](_0x41c36d[_0x39c9('0x3e')][_0x3d80ef])['$gte'];var _0x196553=JSON[_0x39c9('0x7d')](_0x41c36d['query'][_0x3d80ef])[_0x39c9('0x7e')];_0x1da0ee[_0x39c9('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a6ac6,_0x196553);}else{if(_0x41c36d[_0x39c9('0x3e')][_0x3d80ef]===_0x39c9('0x7f')){_0x1da0ee[_0x39c9('0x49')]('i.'+_0x3d80ef+_0x39c9('0x80'));}else{_0x1da0ee[_0x39c9('0x49')]('i.'+_0x3d80ef+_0x39c9('0x81'),_0x41c36d['query'][_0x3d80ef]);}}});}if(_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x82')]){if(_0x41c36d[_0x39c9('0x3e')]['read']==0x1){_0x1da0ee[_0x39c9('0x66')](_0x39c9('0x83'));}else{_0x1da0ee[_0x39c9('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x84')]){_0x202f9e=_['isArray'](_0x41c36d['query'][_0x39c9('0x84')])?_0x41c36d['query'][_0x39c9('0x84')]:new Array(_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x84')]);_0x202f9e['forEach'](function(_0x3cc804){_0x4ede47['or'](_0x39c9('0x72'),'%,'+_0x3cc804+',%');});}if(_0x41c36d['query'][_0x39c9('0x85')]){var _0x12da6d=_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x85')][_0x39c9('0x86')]('\x5c','\x5c\x5c')[_0x39c9('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x12da6d)){_0x13f8bd['or'](_0x39c9('0x87'),_0x12da6d+'%')['or']('i.fax\x20LIKE\x20?',_0x12da6d+'%');}_0x13f8bd['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x12da6d+'%');}}_0x1da0ee[_0x39c9('0x49')](_0x13f8bd);_0x1da0ee[_0x39c9('0x88')]('i.id');var _0x117eed={'type':db[_0x39c9('0x89')][_0x39c9('0x8a')][_0x39c9('0x8b')],'raw':!![]};var _0x5affee=_0x1da0ee[_0x39c9('0x8c')]();_0x5affee[_0x39c9('0x4c')](_0x39c9('0x8d'));_0x5affee[_0x39c9('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x39c9('0x64'));if(_0x4d34c1['order']){_0x4d34c1['order'][_0x39c9('0x2e')](function(_0x5b7186){var _0x510692=_0x5b7186[0x0]===_0x39c9('0x8e')?_0x5b7186[0x0]:'i.'+_0x5b7186[0x0];_0x1da0ee[_0x39c9('0x47')](_0x510692,_0x5b7186[0x1]===_0x39c9('0x8f')?![]:!![]);});}if(!_[_0x39c9('0x7a')](_0x202f9e)){_0x1da0ee['having'](_0x4ede47);_0x5affee[_0x39c9('0x49')](_0x39c9('0x90'),_0x202f9e);}BPromise['resolve']()[_0x39c9('0x24')](function(){if(!_0x582f0f){if(_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x7b')])return;_0x5affee[_0x39c9('0x49')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1da0ee['where'](_0x39c9('0x91'));return;}if(_0x41c36d[_0x39c9('0x92')][_0x39c9('0x93')]!==_0x39c9('0x94'))return;return _0x41c36d['user'][_0x39c9('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22c01b){if(_['isEmpty'](_0x22c01b)){_0x5affee['where'](_0x39c9('0x96'));_0x1da0ee[_0x39c9('0x49')](_0x39c9('0x96'));}else{_0x5affee[_0x39c9('0x49')](_0x39c9('0x97'),_[_0x39c9('0x2b')](_0x22c01b,'id'));_0x1da0ee[_0x39c9('0x49')](_0x39c9('0x97'),_[_0x39c9('0x2b')](_0x22c01b,'id'));}});})['then'](function(){if(_0x41c36d[_0x39c9('0x92')][_0x39c9('0x93')]==='agent'&&!_0x582f0f&&!_0x41c36d[_0x39c9('0x3e')][_0x39c9('0x7b')])return[];return db[_0x39c9('0x98')][_0x39c9('0x3e')](_0x5affee[_0x39c9('0x99')](),_0x117eed);})[_0x39c9('0x24')](function(_0x148ecd){_0x26345c[_0x39c9('0x1d')]=_0x148ecd[_0x39c9('0x44')];if(_0x26345c[_0x39c9('0x1d')]===0x0)return[];return db[_0x39c9('0x98')][_0x39c9('0x3e')](_0xc44477[_0x39c9('0x99')](),_0x117eed)['then'](function(_0x205aa2){_0x883071=_['keyBy'](_0x205aa2,'id');_0x117eed=_[_0x39c9('0x9a')](_0x117eed,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41c36d[_0x39c9('0x3e')]['fields']){_0x4d34c1[_0x39c9('0x42')][_0x39c9('0x2e')](function(_0x11d753){_0x1da0ee[_0x39c9('0x4c')]('i.'+_0x11d753);});}else{_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0x9b'),'unreadMessages');_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0x9c'),'Account.key');_0x1da0ee['field'](_0x39c9('0x9d'),_0x39c9('0x9e'));_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0x9f'),_0x39c9('0x8e'));_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0xa0'));_0x1da0ee[_0x39c9('0x4c')]('c.firstName',_0x39c9('0xa1'));_0x1da0ee['field'](_0x39c9('0xa2'),_0x39c9('0xa3'));_0x1da0ee[_0x39c9('0x4c')]('c.email',_0x39c9('0xa4'));_0x1da0ee[_0x39c9('0x4c')]('c.phone',_0x39c9('0xa5'));_0x1da0ee['field'](_0x39c9('0xa6'),_0x39c9('0xa7'));_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0xa8'),_0x39c9('0xa9'));_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0xaa'),'Owner.fullname');_0x1da0ee[_0x39c9('0x4c')]('o.internal','Owner.internal');_0x1da0ee[_0x39c9('0x4c')](_0x39c9('0xab'),'TagIds');}if(_0x4d34c1['limit'])_0x1da0ee[_0x39c9('0x1c')](_0x4d34c1[_0x39c9('0x1c')]);if(_0x4d34c1[_0x39c9('0x1e')])_0x1da0ee[_0x39c9('0x1e')](_0x4d34c1[_0x39c9('0x1e')]);return db['sequelize'][_0x39c9('0x3e')](_0x1da0ee[_0x39c9('0x99')](),_0x117eed);})[_0x39c9('0x24')](function(_0x32e0e3){if(_0x32e0e3[_0x39c9('0x44')]>0x0)_0x2c5b1c['where'](_0x39c9('0xac'),_[_0x39c9('0x2b')](_0x32e0e3,'id'));return db[_0x39c9('0x98')][_0x39c9('0x3e')](_0x2c5b1c[_0x39c9('0x99')](),_0x117eed)['then'](function(_0x21c63f){var _0xf57ce=_['groupBy'](_0x21c63f,'FaxInteractionId');var _0x4a24c1=[];_0x32e0e3[_0x39c9('0x2e')](function(_0x5f0e7b){_0x4a24c1[_0x39c9('0x2f')](updateFaxInteraction(_0x5f0e7b,_0x883071,_0xf57ce));});return BPromise[_0x39c9('0xad')](_0x4a24c1);});});})['then'](function(_0x2dbaf3){_0x26345c[_0x39c9('0xae')]=_0x2dbaf3;return _0x26345c;})['then'](respondWithFilteredResult(_0x27bd3a,_0x4d34c1))[_0x39c9('0x30')](handleError(_0x27bd3a,null));};exports[_0x39c9('0xaf')]=function(_0x2989af,_0x2d526b){var _0x10970c={'raw':![],'where':{'id':_0x2989af[_0x39c9('0xb0')]['id']}},_0x5f0653={};_0x5f0653[_0x39c9('0x3d')]=_[_0x39c9('0x3f')](db['FaxInteraction'][_0x39c9('0x3a')]);_0x5f0653['query']=_[_0x39c9('0x3f')](_0x2989af[_0x39c9('0x3e')]);_0x5f0653['filters']=_[_0x39c9('0x41')](_0x5f0653[_0x39c9('0x3d')],_0x5f0653['query']);_0x10970c['attributes']=_['intersection'](_0x5f0653[_0x39c9('0x3d')],qs['fields'](_0x2989af['query'][_0x39c9('0x43')]));_0x10970c['attributes']=_0x10970c['attributes'][_0x39c9('0x44')]?_0x10970c[_0x39c9('0x42')]:_0x5f0653['model'];if(_0x2989af[_0x39c9('0x3e')]['includeAll']){_0x10970c[_0x39c9('0xb1')]=[{'all':!![]}];}_0x10970c=_[_0x39c9('0x9a')]({},_0x10970c,_0x2989af[_0x39c9('0xb2')]);return db[_0x39c9('0x39')][_0x39c9('0x6c')](_0x10970c)['then'](handleEntityNotFound(_0x2d526b,null))[_0x39c9('0x24')](respondWithResult(_0x2d526b,null))[_0x39c9('0x30')](handleError(_0x2d526b,null));};exports[_0x39c9('0xb3')]=function(_0x1c7097,_0xc2e560){return db[_0x39c9('0x39')][_0x39c9('0xb3')](_0x1c7097[_0x39c9('0x78')],{})[_0x39c9('0x24')](respondWithResult(_0xc2e560,0xc9))[_0x39c9('0x30')](handleError(_0xc2e560,null));};exports[_0x39c9('0x23')]=function(_0x47b280,_0x19507a){if(_0x47b280[_0x39c9('0x78')]['id']){delete _0x47b280['body']['id'];}return db[_0x39c9('0x39')][_0x39c9('0x6c')]({'where':{'id':_0x47b280[_0x39c9('0xb0')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x19507a,null))[_0x39c9('0x24')](saveUpdates(_0x47b280[_0x39c9('0x78')],null))[_0x39c9('0x24')](respondWithResult(_0x19507a,null))[_0x39c9('0x30')](handleError(_0x19507a,null));};exports[_0x39c9('0x25')]=function(_0x104707,_0x4f01dc){return db[_0x39c9('0x39')]['find']({'where':{'id':_0x104707[_0x39c9('0xb0')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x4f01dc,null))['then'](removeEntity(_0x4f01dc,null))['catch'](handleError(_0x4f01dc,null));};exports[_0x39c9('0xb4')]=function(_0x1b4981,_0x4f168c){return db[_0x39c9('0x39')][_0x39c9('0xb4')]()[_0x39c9('0x24')](respondWithResult(_0x4f168c,null))['catch'](handleError(_0x4f168c,null));};exports[_0x39c9('0xb5')]=function(_0x454a28,_0x3d9b31,_0x3bc06c){return db['FaxMessage'][_0x39c9('0x6c')]({'where':{'id':_0x454a28['params']['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x3d9b31,null))[_0x39c9('0x24')](function(_0x1e65af){if(_0x1e65af){return _0x1e65af['addMessage'](_0x454a28[_0x39c9('0x78')][_0x39c9('0xb6')],_[_0x39c9('0xb7')](_0x454a28['body'],[_0x39c9('0xb6'),'id'])||{});}})[_0x39c9('0x24')](respondWithResult(_0x3d9b31,null))[_0x39c9('0x30')](handleError(_0x3d9b31,null));};exports[_0x39c9('0xb8')]=function(_0x5c1b77,_0x542a8e,_0x67d9a4){var _0x308d57={'raw':![],'where':{}};var _0x3cde98={};var _0x4097d9={'count':0x0,'rows':[]};return db[_0x39c9('0x39')][_0x39c9('0xb9')]({'where':{'id':_0x5c1b77[_0x39c9('0xb0')]['id']}})['then'](handleEntityNotFound(_0x542a8e,null))[_0x39c9('0x24')](function(_0x3c976e){if(_0x3c976e){_0x3cde98['model']=_['keys'](db[_0x39c9('0xba')][_0x39c9('0x3a')]);_0x3cde98[_0x39c9('0x3e')]=_[_0x39c9('0x3f')](_0x5c1b77[_0x39c9('0x3e')]);_0x3cde98[_0x39c9('0x40')]=_[_0x39c9('0x41')](_0x3cde98[_0x39c9('0x3d')],_0x3cde98[_0x39c9('0x3e')]);_0x308d57['attributes']=_[_0x39c9('0x41')](_0x3cde98[_0x39c9('0x3d')],qs['fields'](_0x5c1b77['query'][_0x39c9('0x43')]));_0x308d57[_0x39c9('0x42')]=_0x308d57[_0x39c9('0x42')][_0x39c9('0x44')]?_0x308d57[_0x39c9('0x42')]:_0x3cde98[_0x39c9('0x3d')];if(!_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0x45')](_0x39c9('0x46'))){_0x308d57[_0x39c9('0x1c')]=qs[_0x39c9('0x1c')](_0x5c1b77['query']['limit']);_0x308d57[_0x39c9('0x1e')]=qs[_0x39c9('0x1e')](_0x5c1b77[_0x39c9('0x3e')]['offset']);}_0x308d57[_0x39c9('0x47')]=qs[_0x39c9('0x48')](_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0x48')]);_0x308d57[_0x39c9('0x49')]=qs['filters'](_['pick'](_0x5c1b77['query'],_0x3cde98[_0x39c9('0x40')]));_0x308d57[_0x39c9('0x49')][_0x39c9('0xbb')]=_0x3c976e['id'];if(_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0x85')]){_0x308d57[_0x39c9('0x49')]=_[_0x39c9('0x9a')](_0x308d57[_0x39c9('0x49')],{'$or':_['map'](_0x308d57[_0x39c9('0x42')],function(_0x10864){var _0x3808f4={};_0x3808f4[_0x10864]={'$like':'%'+_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0x85')]+'%'};return _0x3808f4;})});}if(_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0xbc')]){var _0x598bcd=_0x5c1b77[_0x39c9('0x3e')][_0x39c9('0xbc')][_0x39c9('0x69')](',');var _0x3c8150={};_0x3c8150[_0x598bcd[0x0]]={'$gte':moment(_0x598bcd[0x1])[_0x39c9('0xbd')](_0x39c9('0xbe'))};_0x308d57[_0x39c9('0x49')]=_[_0x39c9('0x9a')](_0x308d57['where'],_0x3c8150);}_0x308d57=_[_0x39c9('0x9a')]({},_0x308d57,_0x5c1b77[_0x39c9('0xb2')]);return db[_0x39c9('0xba')][_0x39c9('0x1d')]({'where':_0x308d57[_0x39c9('0x49')]})[_0x39c9('0x24')](function(_0x28136c){_0x4097d9[_0x39c9('0x1d')]=_0x28136c;if(_0x5c1b77['query']['includeAll']){_0x308d57[_0x39c9('0xb1')]=[{'all':!![]}];}return db['FaxMessage'][_0x39c9('0xbf')](_0x308d57);})[_0x39c9('0x24')](function(_0x44e7cc){_0x4097d9[_0x39c9('0xae')]=_0x44e7cc;return _0x4097d9;});}})[_0x39c9('0x24')](respondWithFilteredResult(_0x542a8e,_0x308d57))[_0x39c9('0x30')](handleError(_0x542a8e,null));};exports[_0x39c9('0xc0')]=function(_0xb85d31,_0x1bb895,_0x572fa3){return db['FaxInteraction'][_0x39c9('0x6c')]({'where':{'id':_0xb85d31[_0x39c9('0xb0')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x1bb895,null))['then'](function(_0x80f1a0){if(_0x80f1a0){return _0x80f1a0[_0x39c9('0xc1')](_0xb85d31[_0x39c9('0x78')][_0x39c9('0xb6')],_[_0x39c9('0xb7')](_0xb85d31[_0x39c9('0x78')],[_0x39c9('0xb6'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x39c9('0x4d')],'where':{'id':_0xb85d31[_0x39c9('0x78')][_0x39c9('0xb6')]}});})[_0x39c9('0x24')](function(_0x192ee5){socket[_0x39c9('0xc2')]('faxInteractionTags:save',{'id':Number(_0xb85d31[_0x39c9('0xb0')]['id']),'tags':_0x192ee5||[]});return{'id':Number(_0xb85d31[_0x39c9('0xb0')]['id']),'tags':_0x192ee5||[]};});}})[_0x39c9('0x24')](respondWithResult(_0x1bb895,null))['catch'](handleError(_0x1bb895,null));};exports[_0x39c9('0xc3')]=function(_0x5386c2,_0x5e8ca1,_0x2353a3){return db['FaxInteraction']['find']({'where':{'id':_0x5386c2['params']['id']}})['then'](handleEntityNotFound(_0x5e8ca1,null))[_0x39c9('0x24')](function(_0x38dc29){if(_0x38dc29){return _0x38dc29['removeTags'](_0x5386c2['query'][_0x39c9('0xb6')]);}})['then'](respondWithStatusCode(_0x5e8ca1,null))[_0x39c9('0x30')](handleError(_0x5e8ca1,null));};exports[_0x39c9('0xc4')]=function(_0x4d31a1,_0x3930cd){var _0x9949c9=moment()[_0x39c9('0xc5')]()[_0x39c9('0x99')]();var _0x28f54c=path[_0x39c9('0xc6')](config[_0x39c9('0xc7')],_0x39c9('0xc8'),_0x39c9('0xc9'),_0x39c9('0xca'));var _0x563102=path[_0x39c9('0xc6')](config[_0x39c9('0xc7')],_0x39c9('0xc8'),_0x39c9('0xc9'),'attachments');var _0x6e2807=path[_0x39c9('0xc6')](_0x28f54c,_0x9949c9);var _0xb8f4f5=util['format'](_0x39c9('0xcb'),_0x4d31a1['params']['id'],_0x9949c9);var _0x589ba8=path[_0x39c9('0xc6')](_0x28f54c,_0xb8f4f5);var _0x1f76bd=[];_0x1f76bd[_0x39c9('0x2f')]({'model':db[_0x39c9('0xcc')],'as':_0x39c9('0xcc'),'raw':!![]});var _0x1bcc89=[{'model':db[_0x39c9('0xba')],'as':_0x39c9('0xcd'),'attributes':['id',_0x39c9('0x78'),_0x39c9('0x7c')],'include':_0x1f76bd}];return db[_0x39c9('0x39')][_0x39c9('0x6c')]({'where':{'id':_0x4d31a1[_0x39c9('0xb0')]['id']},'include':_0x1bcc89})[_0x39c9('0x24')](handleEntityNotFound(_0x3930cd,null))[_0x39c9('0x24')](function(_0x3caf93){if(_0x3caf93&&_0x3caf93[_0x39c9('0xcd')]){var _0x5afc64=_0x3caf93['get']({'plain':!![]});fs[_0x39c9('0xce')](_0x6e2807);for(var _0xd874d0=0x0;_0xd874d0<_0x5afc64[_0x39c9('0xcd')][_0x39c9('0x44')];_0xd874d0++){var _0x5f3ffe=_0x5afc64[_0x39c9('0xcd')][_0xd874d0][_0x39c9('0xcc')];if(_0x5f3ffe){var _0x4d4e7e=path['join'](_0x563102,_0x5f3ffe[_0x39c9('0xcf')]);if(fs[_0x39c9('0xd0')](_0x4d4e7e)){fs[_0x39c9('0xd1')](_0x4d4e7e)[_0x39c9('0xd2')](fs[_0x39c9('0xd3')](path['join'](_0x6e2807,_0x5f3ffe[_0x39c9('0xcf')])));}}}return BPromise[_0x39c9('0xd4')]()[_0x39c9('0x24')](function(){return new BPromise(function(_0x3bf964,_0x33a29e){zipdir(_0x6e2807,{'saveTo':_0x589ba8},function(_0xc7e3d8,_0x2670b6){if(_0xc7e3d8)return _0x33a29e(_0xc7e3d8);return _0x3bf964(_0x2670b6);});})[_0x39c9('0x24')](function(){return new BPromise(function(_0x529153,_0x47de1d){rimraf(_0x6e2807,function(_0x4ef7fb){if(_0x4ef7fb)_0x47de1d(_0x4ef7fb);return _0x529153();});});})[_0x39c9('0x24')](function(){return _0x3930cd[_0x39c9('0xc4')](_0x589ba8,_0xb8f4f5,function(_0x29a3d3){if(_0x29a3d3){console[_0x39c9('0xd5')](_0x39c9('0xd6'),_0x29a3d3);}else{fs[_0x39c9('0xd7')](_0x589ba8);}});});});}else{return _0x3930cd[_0x39c9('0x26')](0xc8);}})[_0x39c9('0x30')](handleError(_0x3930cd,null));}; \ No newline at end of file +var _0xedd3=['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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','includeAll','include','options','create','destroy','describe','FaxMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','Attachment','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','then','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','Tag','User','buildExpression','text','body','compact','isEmpty','FaxAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','length','keyBy','merge','a.key','Account.key','a.mandatoryDisposition'];(function(_0xd028d7,_0x4b2364){var _0x32810c=function(_0x128fce){while(--_0x128fce){_0xd028d7['push'](_0xd028d7['shift']());}};_0x32810c(++_0x4b2364);}(_0xedd3,0x111));var _0x3edd=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xedd3[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x3edd('0x0'));var rimraf=require(_0x3edd('0x1'));var zipdir=require(_0x3edd('0x2'));var jsonpatch=require(_0x3edd('0x3'));var rp=require(_0x3edd('0x4'));var moment=require(_0x3edd('0x5'));var BPromise=require(_0x3edd('0x6'));var Mustache=require(_0x3edd('0x7'));var util=require(_0x3edd('0x8'));var path=require(_0x3edd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3edd('0xa'));var fs=require('fs');var fs_extra=require(_0x3edd('0xb'));var _=require('lodash');var squel=require(_0x3edd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3edd('0xd'));var toCsv=require(_0x3edd('0xe'));var querystring=require(_0x3edd('0xf'));var Papa=require(_0x3edd('0x10'));var Redis=require(_0x3edd('0x11'));var authService=require(_0x3edd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3edd('0x13'));var hardwareService=require(_0x3edd('0x14'));var logger=require(_0x3edd('0x15'))(_0x3edd('0x16'));var utils=require(_0x3edd('0x17'));var config=require(_0x3edd('0x18'));var licenseUtil=require(_0x3edd('0x19'));var db=require(_0x3edd('0x1a'))['db'];config[_0x3edd('0x1b')]=_[_0x3edd('0x1c')](config[_0x3edd('0x1b')],{'host':_0x3edd('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3edd('0x1b')]));require(_0x3edd('0x1e'))[_0x3edd('0x1f')](socket);function respondWithStatusCode(_0x5a5f29,_0x383beb){_0x383beb=_0x383beb||0xcc;return function(_0x1b851f){if(_0x1b851f){return _0x5a5f29[_0x3edd('0x20')](_0x383beb);}return _0x5a5f29['status'](_0x383beb)[_0x3edd('0x21')]();};}function respondWithResult(_0x13957a,_0x5cedd3){_0x5cedd3=_0x5cedd3||0xc8;return function(_0x54f4f2){if(_0x54f4f2){return _0x13957a[_0x3edd('0x22')](_0x5cedd3)['json'](_0x54f4f2);}};}function respondWithFilteredResult(_0x3ab38e,_0x332a8c){return function(_0x26617c){if(_0x26617c){var _0x582aed=typeof _0x332a8c[_0x3edd('0x23')]==='undefined'&&typeof _0x332a8c[_0x3edd('0x24')]===_0x3edd('0x25');var _0x1fc98f=_0x26617c[_0x3edd('0x26')];var _0x2e3e90=_0x582aed?0x0:_0x332a8c[_0x3edd('0x23')];var _0x53a8b1=_0x582aed?_0x26617c[_0x3edd('0x26')]:_0x332a8c[_0x3edd('0x23')]+_0x332a8c['limit'];var _0x3360c2;if(_0x53a8b1>=_0x1fc98f){_0x53a8b1=_0x1fc98f;_0x3360c2=0xc8;}else{_0x3360c2=0xce;}_0x3ab38e[_0x3edd('0x22')](_0x3360c2);return _0x3ab38e[_0x3edd('0x27')](_0x3edd('0x28'),_0x2e3e90+'-'+_0x53a8b1+'/'+_0x1fc98f)[_0x3edd('0x29')](_0x26617c);}return null;};}function patchUpdates(_0x215218){return function(_0x11788f){try{jsonpatch[_0x3edd('0x2a')](_0x11788f,_0x215218,!![]);}catch(_0x469a5a){return BPromise[_0x3edd('0x2b')](_0x469a5a);}return _0x11788f[_0x3edd('0x2c')]();};}function saveUpdates(_0x2976a3,_0x1b9eaa){return function(_0x198bf2){if(_0x198bf2){return _0x198bf2[_0x3edd('0x2d')](_0x2976a3)['then'](function(_0x3f59d9){return _0x3f59d9;});}return null;};}function removeEntity(_0x58e948,_0xfb11f6){return function(_0x367aee){if(_0x367aee){return _0x367aee['destroy']()['then'](function(){_0x58e948[_0x3edd('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c8bee,_0x28e538){return function(_0x479dd4){if(!_0x479dd4){_0x4c8bee['sendStatus'](0x194);}return _0x479dd4;};}function handleError(_0x352bad,_0x27600c){_0x27600c=_0x27600c||0x1f4;return function(_0x48f201){logger['error'](_0x48f201[_0x3edd('0x2e')]);if(_0x48f201[_0x3edd('0x2f')]){delete _0x48f201[_0x3edd('0x2f')];}_0x352bad[_0x3edd('0x22')](_0x27600c)[_0x3edd('0x30')](_0x48f201);};}function getInteractionUsers(_0xf6b0b6,_0x353ec6){return new BPromise(function(_0x33e319,_0x3854db){try{if(_0x353ec6[_0xf6b0b6['id']]){_0xf6b0b6['Users']=_[_0x3edd('0x31')](_0x353ec6[_0xf6b0b6['id']],function(_0x3ad384){return{'id':_0x3ad384['id'],'fullname':_0x3ad384[_0x3edd('0x32')]};});}}catch(_0x24c6f8){_0x3854db(_0x24c6f8);}_0x33e319(_0xf6b0b6);});}function getInteractionTags(_0x3ed7e8,_0x2b3201){return new BPromise(function(_0x14fed5,_0x303db9){try{if(_0x3ed7e8[_0x3edd('0x33')]){_0x3ed7e8[_0x3edd('0x34')]=[];_0x3ed7e8[_0x3edd('0x33')][_0x3edd('0x35')](',')[_0x3edd('0x36')](function(_0xd3f269){_0x3ed7e8['Tags'][_0x3edd('0x37')](_0x2b3201[_0xd3f269]);});}delete _0x3ed7e8[_0x3edd('0x33')];}catch(_0xdc91d6){_0x303db9(_0xdc91d6);}_0x14fed5(_0x3ed7e8);});}function updateFaxInteraction(_0x5c80c2,_0x26e986,_0x5b17e8){return new BPromise(function(_0x23610b,_0x3b367b){return getInteractionUsers(_0x5c80c2,_0x5b17e8)[_0x3edd('0x38')](function(_0x252e52){return getInteractionTags(_0x252e52,_0x26e986);})[_0x3edd('0x38')](function(_0x338fe7){return getStateInteraction(_0x338fe7);})[_0x3edd('0x38')](function(_0xafeafd){_0x23610b(_0xafeafd);})[_0x3edd('0x39')](function(_0x2a38c0){_0x3b367b(_0x2a38c0);});});}function getStateInteraction(_0x5bafc6){return new BPromise(function(_0x547578){_0x5bafc6[_0x3edd('0x3a')]=0x0;_0x5bafc6['talking']=0x0;_0x5bafc6[_0x3edd('0x3b')]=0x0;_0x5bafc6[_0x3edd('0x3c')]=0x0;_0x5bafc6[_0x3edd('0x3d')]=0x0;if(!_0x5bafc6[_0x3edd('0x3e')]&&!_0x5bafc6[_0x3edd('0x3f')]){_0x5bafc6[_0x3edd('0x3a')]+=0x1;}if(!_0x5bafc6['closed']&&_0x5bafc6[_0x3edd('0x3f')]){_0x5bafc6[_0x3edd('0x40')]+=0x1;if(_0x5bafc6['waiting']){_0x5bafc6[_0x3edd('0x3a')]-=0x1;}}if(_0x5bafc6[_0x3edd('0x3e')]&&_0x5bafc6[_0x3edd('0x3f')]){_0x5bafc6[_0x3edd('0x3b')]+=0x1;if(_0x5bafc6[_0x3edd('0x40')]){_0x5bafc6[_0x3edd('0x40')]-=0x1;}}if(_0x5bafc6['closed']&&!_0x5bafc6[_0x3edd('0x3f')]){_0x5bafc6['unmanaged']+=0x1;if(_0x5bafc6[_0x3edd('0x3a')]){_0x5bafc6[_0x3edd('0x3a')]-=0x1;}}_0x5bafc6[_0x3edd('0x3d')]+=0x1;_0x547578(_0x5bafc6);});}exports[_0x3edd('0x41')]=function(_0x232b53,_0x3bc3f1){var _0x24f322={},_0x5e948a={},_0x434610={'count':0x0,'rows':[]};var _0x48fcf2=_[_0x3edd('0x31')](db[_0x3edd('0x42')][_0x3edd('0x43')],function(_0x49b8e8){return{'name':_0x49b8e8[_0x3edd('0x44')],'type':_0x49b8e8[_0x3edd('0x45')][_0x3edd('0x46')]};});_0x5e948a[_0x3edd('0x47')]=_[_0x3edd('0x31')](_0x48fcf2,_0x3edd('0x2f'));_0x5e948a[_0x3edd('0x48')]=_[_0x3edd('0x49')](_0x232b53[_0x3edd('0x48')]);_0x5e948a[_0x3edd('0x4a')]=_['intersection'](_0x5e948a[_0x3edd('0x47')],_0x5e948a[_0x3edd('0x48')]);_0x24f322[_0x3edd('0x4b')]=_[_0x3edd('0x4c')](_0x5e948a[_0x3edd('0x47')],qs[_0x3edd('0x4d')](_0x232b53[_0x3edd('0x48')][_0x3edd('0x4d')]));_0x24f322[_0x3edd('0x4b')]=_0x24f322[_0x3edd('0x4b')]['length']?_0x24f322[_0x3edd('0x4b')]:_0x5e948a[_0x3edd('0x47')];if(!_0x232b53[_0x3edd('0x48')][_0x3edd('0x4e')](_0x3edd('0x4f'))){_0x24f322[_0x3edd('0x24')]=qs[_0x3edd('0x24')](_0x232b53[_0x3edd('0x48')][_0x3edd('0x24')]);_0x24f322[_0x3edd('0x23')]=qs['offset'](_0x232b53[_0x3edd('0x48')][_0x3edd('0x23')]);}_0x24f322[_0x3edd('0x50')]=qs['sort'](_0x232b53[_0x3edd('0x48')][_0x3edd('0x51')]);_0x24f322[_0x3edd('0x52')]=qs[_0x3edd('0x4a')](_[_0x3edd('0x53')](_0x232b53[_0x3edd('0x48')],_0x5e948a[_0x3edd('0x4a')]),_0x48fcf2);var _0x6b91b=[];var _0x3af2ae=squel[_0x3edd('0x54')]()[_0x3edd('0x55')]('id')[_0x3edd('0x55')]('name')[_0x3edd('0x55')]('color')[_0x3edd('0x56')](_0x3edd('0x57'));var _0x35deb6=squel[_0x3edd('0x54')]()['field'](_0x3edd('0x58'))['field'](_0x3edd('0x59'))[_0x3edd('0x55')]('ui.FaxInteractionId')[_0x3edd('0x56')]('user_has_fax_interactions','ui')[_0x3edd('0x5a')](_0x3edd('0x5b'),'u',_0x3edd('0x5c'));var _0x57335=squel[_0x3edd('0x54')]()['from'](_0x3edd('0x5d'),'i')[_0x3edd('0x5a')](_0x3edd('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x3edd('0x5b'),'o',_0x3edd('0x5f'))[_0x3edd('0x5a')](_0x3edd('0x60'),'a','a.id\x20=\x20i.FaxAccountId')[_0x3edd('0x5a')]('fax_messages','me',_0x3edd('0x61'))[_0x3edd('0x5a')](_0x3edd('0x62'),'it',_0x3edd('0x63'))[_0x3edd('0x5a')]('tools_tags','t',_0x3edd('0x64'));var _0x3e795b=squel[_0x3edd('0x65')]();var _0x18a70f=[];var _0x54e7d2=squel[_0x3edd('0x65')]();var _0x2476bc;if(_0x232b53[_0x3edd('0x48')][_0x3edd('0x66')]){_0x2476bc=as[_0x3edd('0x67')](_0x232b53[_0x3edd('0x48')][_0x3edd('0x66')]);var _0xef90ba=_0x2476bc[_0x3edd('0x68')];for(var _0x2ff53f=0x0;_0x2ff53f<_0x2476bc[_0x3edd('0x69')]['length'];_0x2ff53f++){var _0x3ee715=_0x2476bc[_0x3edd('0x69')][_0x2ff53f];var _0x3f9678='i';var _0x4bdd14=_['find'](_0x48fcf2,[_0x3edd('0x2f'),_0x3ee715[_0x3edd('0x55')]]);if(!_0x4bdd14){switch(_0x3ee715['field']){case'unreadMessages':if(_0x3ee715[_0x3edd('0x6a')]==0x1){_0x57335[_0x3edd('0x6b')]('`'+_0x3ee715[_0x3edd('0x55')]+'`\x20=\x200');}else{_0x57335[_0x3edd('0x6b')]('`'+_0x3ee715['field']+_0x3edd('0x6c'));}break;case'Contact':if(_0x3ee715[_0x3edd('0x6d')]===_0x3edd('0x6e')){if(_0x3ee715[_0x3edd('0x6a')][_0x3edd('0x35')]('\x20')['length']>0x1){_0x3e795b[_0xef90ba]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3edd('0x6f')](_0x3ee715[_0x3edd('0x6a')]),null);}else{var _0x3c8341='%'+_0x3ee715[_0x3edd('0x6a')]+'%';_0x3e795b[_0xef90ba](_0x3edd('0x70'),_0x3c8341,_0x3c8341,_0x3c8341);}}else{_0x4bdd14=_[_0x3edd('0x71')](_0x48fcf2,[_0x3edd('0x2f'),_0x3edd('0x72')]);_0x3ee715[_0x3edd('0x55')]='ContactId';_0xef5ffc=as['buildExpression'](_0x3f9678,_0x4bdd14[_0x3edd('0x45')],_0x3ee715);_0x3e795b[_0xef90ba](_0xef5ffc['text'],_0xef5ffc[_0x3edd('0x6a')][_0x3edd('0x73')],_0xef5ffc[_0x3edd('0x6a')]['end']);}break;case _0x3edd('0x74'):var _0x4045b2=_0x3ee715['value'][_0x3edd('0x35')](',')[_0x3edd('0x31')](function(_0x527cc1){return Number(_0x527cc1);});_0x4045b2[_0x3edd('0x36')](function(_0x19a89e){_0x54e7d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x19a89e+',%');});_0x18a70f=_['union'](_0x18a70f,_0x4045b2);break;case _0x3edd('0x75'):if(_0x3ee715[_0x3edd('0x6d')]===_0x3edd('0x6e')){_0x3e795b[_0xef90ba]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3ee715[_0x3edd('0x6a')]+'%',null);}else{_0x4bdd14=_['find'](_0x48fcf2,[_0x3edd('0x2f'),_0x3edd('0x3f')]);_0x3ee715[_0x3edd('0x55')]='UserId';_0xef5ffc=as[_0x3edd('0x76')](_0x3f9678,_0x4bdd14[_0x3edd('0x45')],_0x3ee715);_0x3e795b[_0xef90ba](_0xef5ffc[_0x3edd('0x77')],_0xef5ffc[_0x3edd('0x6a')][_0x3edd('0x73')],_0xef5ffc[_0x3edd('0x6a')][_0x3edd('0x21')]);}break;case _0x3edd('0x78'):_0xef5ffc=as[_0x3edd('0x76')]('me',null,_0x3ee715);_0x3e795b[_0xef90ba](_0xef5ffc[_0x3edd('0x77')],_0xef5ffc[_0x3edd('0x6a')][_0x3edd('0x73')],_0xef5ffc['value'][_0x3edd('0x21')]);break;}}else{var _0xef5ffc=as[_0x3edd('0x76')](_0x3f9678,_0x4bdd14[_0x3edd('0x45')],_0x3ee715);_0x3e795b[_0xef90ba](_0xef5ffc[_0x3edd('0x77')],_0xef5ffc[_0x3edd('0x6a')][_0x3edd('0x73')],_0xef5ffc[_0x3edd('0x6a')]['end']);}}}else{var _0x1fd510=_(_0x232b53['query'])[_0x3edd('0x49')]()[_0x3edd('0x31')](function(_0x4742f1){return _['some'](_0x48fcf2,['name',_0x4742f1])?_0x4742f1:undefined;})[_0x3edd('0x79')]()[_0x3edd('0x6a')]();if(!_[_0x3edd('0x7a')](_0x1fd510)){_0x1fd510[_0x3edd('0x36')](function(_0x4d579b){if(_0x4d579b===_0x3edd('0x7b')){_0x57335[_0x3edd('0x52')]('i.FaxAccountId\x20IN\x20?',[][_0x3edd('0x7c')](_0x232b53[_0x3edd('0x48')][_0x4d579b]));}else if(_0x4d579b===_0x3edd('0x7d')){var _0x5985a2=JSON['parse'](_0x232b53[_0x3edd('0x48')][_0x4d579b])[_0x3edd('0x7e')];var _0x190001=JSON[_0x3edd('0x7f')](_0x232b53[_0x3edd('0x48')][_0x4d579b])[_0x3edd('0x80')];_0x57335[_0x3edd('0x52')](_0x3edd('0x81'),_0x5985a2,_0x190001);}else{if(_0x232b53[_0x3edd('0x48')][_0x4d579b]===_0x3edd('0x82')){_0x57335[_0x3edd('0x52')]('i.'+_0x4d579b+_0x3edd('0x83'));}else{_0x57335[_0x3edd('0x52')]('i.'+_0x4d579b+'\x20=\x20?',_0x232b53['query'][_0x4d579b]);}}});}if(_0x232b53[_0x3edd('0x48')][_0x3edd('0x84')]){if(_0x232b53['query'][_0x3edd('0x84')]==0x1){_0x57335[_0x3edd('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x57335[_0x3edd('0x6b')](_0x3edd('0x85'));}}if(_0x232b53['query']['tag']){_0x18a70f=_[_0x3edd('0x86')](_0x232b53['query']['tag'])?_0x232b53['query'][_0x3edd('0x87')]:new Array(_0x232b53['query'][_0x3edd('0x87')]);_0x18a70f[_0x3edd('0x36')](function(_0x28ba7f){_0x54e7d2['or'](_0x3edd('0x88'),'%,'+_0x28ba7f+',%');});}if(_0x232b53[_0x3edd('0x48')]['filter']){var _0x514cb8=_0x232b53[_0x3edd('0x48')][_0x3edd('0x89')][_0x3edd('0x8a')]('\x5c','\x5c\x5c')[_0x3edd('0x8a')](/'/g,'\x27\x27');if(qs[_0x3edd('0x8b')](_0x514cb8)){_0x3e795b['or'](_0x3edd('0x8c'),_0x514cb8+'%')['or']('i.fax\x20LIKE\x20?',_0x514cb8+'%');}_0x3e795b['or'](_0x3edd('0x8d'),_0x514cb8+'%');}}_0x57335['where'](_0x3e795b);_0x57335[_0x3edd('0x8e')](_0x3edd('0x8f'));var _0x2de2cf={'type':db[_0x3edd('0x90')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4ec938=_0x57335[_0x3edd('0x91')]();_0x4ec938[_0x3edd('0x55')](_0x3edd('0x8f'));_0x4ec938['field'](_0x3edd('0x92'),'unreadMessages');if(_0x24f322[_0x3edd('0x50')]){_0x24f322[_0x3edd('0x50')][_0x3edd('0x36')](function(_0x5829f3){var _0x147db8=_0x5829f3[0x0]===_0x3edd('0x93')?_0x5829f3[0x0]:'i.'+_0x5829f3[0x0];_0x57335[_0x3edd('0x50')](_0x147db8,_0x5829f3[0x1]===_0x3edd('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x18a70f)){_0x57335[_0x3edd('0x6b')](_0x54e7d2);_0x4ec938[_0x3edd('0x52')]('t.id\x20IN\x20?',_0x18a70f);}BPromise[_0x3edd('0x95')]()[_0x3edd('0x38')](function(){if(!_0x2476bc){if(_0x232b53[_0x3edd('0x48')]['FaxAccountId'])return;_0x4ec938[_0x3edd('0x52')](_0x3edd('0x96'));_0x57335[_0x3edd('0x52')](_0x3edd('0x96'));return;}if(_0x232b53['user']['role']!=='agent')return;return _0x232b53[_0x3edd('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x4c388c){if(_[_0x3edd('0x7a')](_0x4c388c)){_0x4ec938['where'](_0x3edd('0x98'));_0x57335[_0x3edd('0x52')](_0x3edd('0x98'));}else{_0x4ec938[_0x3edd('0x52')](_0x3edd('0x99'),_[_0x3edd('0x31')](_0x4c388c,'id'));_0x57335[_0x3edd('0x52')](_0x3edd('0x99'),_[_0x3edd('0x31')](_0x4c388c,'id'));}});})[_0x3edd('0x38')](function(){if(_0x232b53[_0x3edd('0x97')][_0x3edd('0x9a')]==='agent'&&!_0x2476bc&&!_0x232b53[_0x3edd('0x48')][_0x3edd('0x7b')])return[];return db[_0x3edd('0x9b')]['query'](_0x4ec938[_0x3edd('0x9c')](),_0x2de2cf);})[_0x3edd('0x38')](function(_0x17f805){_0x434610[_0x3edd('0x26')]=_0x17f805[_0x3edd('0x9d')];if(_0x434610[_0x3edd('0x26')]===0x0)return[];return db[_0x3edd('0x9b')][_0x3edd('0x48')](_0x3af2ae['toString'](),_0x2de2cf)[_0x3edd('0x38')](function(_0x31fe68){_0x6b91b=_[_0x3edd('0x9e')](_0x31fe68,'id');_0x2de2cf=_[_0x3edd('0x9f')](_0x2de2cf,{'model':db[_0x3edd('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x232b53['query'][_0x3edd('0x4d')]){_0x24f322[_0x3edd('0x4b')][_0x3edd('0x36')](function(_0x224e45){_0x57335[_0x3edd('0x55')]('i.'+_0x224e45);});}else{_0x57335[_0x3edd('0x55')](_0x3edd('0x92'),'unreadMessages');_0x57335[_0x3edd('0x55')](_0x3edd('0xa0'),_0x3edd('0xa1'));_0x57335[_0x3edd('0x55')](_0x3edd('0xa2'),'Account.mandatoryDisposition');_0x57335['field'](_0x3edd('0xa3'),_0x3edd('0x93'));_0x57335['field']('i.*');_0x57335[_0x3edd('0x55')](_0x3edd('0xa4'),'Contact.firstName');_0x57335[_0x3edd('0x55')](_0x3edd('0xa5'),_0x3edd('0xa6'));_0x57335['field'](_0x3edd('0xa7'),_0x3edd('0xa8'));_0x57335[_0x3edd('0x55')](_0x3edd('0xa9'),_0x3edd('0xaa'));_0x57335[_0x3edd('0x55')](_0x3edd('0xab'),'Contact.mobile');_0x57335['field'](_0x3edd('0xac'),_0x3edd('0xad'));_0x57335['field'](_0x3edd('0xae'),'Owner.fullname');_0x57335[_0x3edd('0x55')](_0x3edd('0xaf'),'Owner.internal');_0x57335[_0x3edd('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x24f322[_0x3edd('0x24')])_0x57335[_0x3edd('0x24')](_0x24f322[_0x3edd('0x24')]);if(_0x24f322[_0x3edd('0x23')])_0x57335[_0x3edd('0x23')](_0x24f322[_0x3edd('0x23')]);return db['sequelize'][_0x3edd('0x48')](_0x57335[_0x3edd('0x9c')](),_0x2de2cf);})[_0x3edd('0x38')](function(_0x467b27){if(_0x467b27[_0x3edd('0x9d')]>0x0)_0x35deb6[_0x3edd('0x52')](_0x3edd('0xb0'),_['map'](_0x467b27,'id'));return db[_0x3edd('0x9b')]['query'](_0x35deb6[_0x3edd('0x9c')](),_0x2de2cf)['then'](function(_0x3c98ff){var _0x121c68=_[_0x3edd('0xb1')](_0x3c98ff,_0x3edd('0xb2'));var _0x5c798b=[];_0x467b27[_0x3edd('0x36')](function(_0x28590b){_0x5c798b[_0x3edd('0x37')](updateFaxInteraction(_0x28590b,_0x6b91b,_0x121c68));});return BPromise['all'](_0x5c798b);});});})[_0x3edd('0x38')](function(_0x113119){_0x434610[_0x3edd('0xb3')]=_0x113119;return _0x434610;})[_0x3edd('0x38')](respondWithFilteredResult(_0x3bc3f1,_0x24f322))[_0x3edd('0x39')](handleError(_0x3bc3f1,null));};exports[_0x3edd('0xb4')]=function(_0x4544b7,_0x1ff65b){var _0x3146ed={'raw':![],'where':{'id':_0x4544b7[_0x3edd('0xb5')]['id']}},_0x17e33a={};_0x17e33a['model']=_[_0x3edd('0x49')](db['FaxInteraction']['rawAttributes']);_0x17e33a['query']=_['keys'](_0x4544b7[_0x3edd('0x48')]);_0x17e33a[_0x3edd('0x4a')]=_[_0x3edd('0x4c')](_0x17e33a[_0x3edd('0x47')],_0x17e33a[_0x3edd('0x48')]);_0x3146ed['attributes']=_[_0x3edd('0x4c')](_0x17e33a[_0x3edd('0x47')],qs[_0x3edd('0x4d')](_0x4544b7[_0x3edd('0x48')]['fields']));_0x3146ed['attributes']=_0x3146ed[_0x3edd('0x4b')]['length']?_0x3146ed['attributes']:_0x17e33a[_0x3edd('0x47')];if(_0x4544b7[_0x3edd('0x48')][_0x3edd('0xb6')]){_0x3146ed[_0x3edd('0xb7')]=[{'all':!![]}];}_0x3146ed=_['merge']({},_0x3146ed,_0x4544b7[_0x3edd('0xb8')]);return db[_0x3edd('0x42')][_0x3edd('0x71')](_0x3146ed)[_0x3edd('0x38')](handleEntityNotFound(_0x1ff65b,null))[_0x3edd('0x38')](respondWithResult(_0x1ff65b,null))[_0x3edd('0x39')](handleError(_0x1ff65b,null));};exports[_0x3edd('0xb9')]=function(_0x4faa73,_0x23b205){return db[_0x3edd('0x42')][_0x3edd('0xb9')](_0x4faa73['body'],{})['then'](respondWithResult(_0x23b205,0xc9))[_0x3edd('0x39')](handleError(_0x23b205,null));};exports[_0x3edd('0x2d')]=function(_0x56f266,_0x5b343b){if(_0x56f266[_0x3edd('0x78')]['id']){delete _0x56f266[_0x3edd('0x78')]['id'];}return db[_0x3edd('0x42')][_0x3edd('0x71')]({'where':{'id':_0x56f266[_0x3edd('0xb5')]['id']}})[_0x3edd('0x38')](handleEntityNotFound(_0x5b343b,null))['then'](saveUpdates(_0x56f266[_0x3edd('0x78')],null))[_0x3edd('0x38')](respondWithResult(_0x5b343b,null))[_0x3edd('0x39')](handleError(_0x5b343b,null));};exports[_0x3edd('0xba')]=function(_0x259d00,_0x3688dd){return db[_0x3edd('0x42')][_0x3edd('0x71')]({'where':{'id':_0x259d00[_0x3edd('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3688dd,null))['then'](removeEntity(_0x3688dd,null))[_0x3edd('0x39')](handleError(_0x3688dd,null));};exports[_0x3edd('0xbb')]=function(_0x463731,_0xbabc6c){return db['FaxInteraction'][_0x3edd('0xbb')]()['then'](respondWithResult(_0xbabc6c,null))[_0x3edd('0x39')](handleError(_0xbabc6c,null));};exports['addMessage']=function(_0x1fbd89,_0x1ad5e1,_0x16e5cc){return db[_0x3edd('0xbc')]['find']({'where':{'id':_0x1fbd89[_0x3edd('0xb5')]['id']}})[_0x3edd('0x38')](handleEntityNotFound(_0x1ad5e1,null))[_0x3edd('0x38')](function(_0x2c3cf2){if(_0x2c3cf2){return _0x2c3cf2['addMessage'](_0x1fbd89[_0x3edd('0x78')][_0x3edd('0xbd')],_[_0x3edd('0xbe')](_0x1fbd89[_0x3edd('0x78')],[_0x3edd('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x1ad5e1,null))[_0x3edd('0x39')](handleError(_0x1ad5e1,null));};exports[_0x3edd('0xbf')]=function(_0x28a517,_0x4038ac,_0x2490cd){var _0x3623ea={'raw':![],'where':{}};var _0x1af930={};var _0x2c2309={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x3edd('0xc0')]({'where':{'id':_0x28a517[_0x3edd('0xb5')]['id']}})[_0x3edd('0x38')](handleEntityNotFound(_0x4038ac,null))[_0x3edd('0x38')](function(_0x5b06f6){if(_0x5b06f6){_0x1af930['model']=_[_0x3edd('0x49')](db[_0x3edd('0xbc')][_0x3edd('0x43')]);_0x1af930[_0x3edd('0x48')]=_[_0x3edd('0x49')](_0x28a517[_0x3edd('0x48')]);_0x1af930[_0x3edd('0x4a')]=_[_0x3edd('0x4c')](_0x1af930[_0x3edd('0x47')],_0x1af930[_0x3edd('0x48')]);_0x3623ea[_0x3edd('0x4b')]=_['intersection'](_0x1af930['model'],qs['fields'](_0x28a517[_0x3edd('0x48')]['fields']));_0x3623ea[_0x3edd('0x4b')]=_0x3623ea[_0x3edd('0x4b')][_0x3edd('0x9d')]?_0x3623ea['attributes']:_0x1af930[_0x3edd('0x47')];if(!_0x28a517[_0x3edd('0x48')]['hasOwnProperty']('nolimit')){_0x3623ea[_0x3edd('0x24')]=qs[_0x3edd('0x24')](_0x28a517[_0x3edd('0x48')][_0x3edd('0x24')]);_0x3623ea[_0x3edd('0x23')]=qs[_0x3edd('0x23')](_0x28a517[_0x3edd('0x48')][_0x3edd('0x23')]);}_0x3623ea['order']=qs[_0x3edd('0x51')](_0x28a517['query'][_0x3edd('0x51')]);_0x3623ea[_0x3edd('0x52')]=qs[_0x3edd('0x4a')](_['pick'](_0x28a517[_0x3edd('0x48')],_0x1af930[_0x3edd('0x4a')]));_0x3623ea[_0x3edd('0x52')][_0x3edd('0xb2')]=_0x5b06f6['id'];if(_0x28a517[_0x3edd('0x48')][_0x3edd('0x89')]){_0x3623ea['where']=_['merge'](_0x3623ea[_0x3edd('0x52')],{'$or':_[_0x3edd('0x31')](_0x3623ea[_0x3edd('0x4b')],function(_0x1f2fe1){var _0x1c8e33={};_0x1c8e33[_0x1f2fe1]={'$like':'%'+_0x28a517['query'][_0x3edd('0x89')]+'%'};return _0x1c8e33;})});}if(_0x28a517[_0x3edd('0x48')][_0x3edd('0x7e')]){var _0x584883=_0x28a517[_0x3edd('0x48')]['$gte']['split'](',');var _0xd3bc7f={};_0xd3bc7f[_0x584883[0x0]]={'$gte':moment(_0x584883[0x1])[_0x3edd('0xc1')](_0x3edd('0xc2'))};_0x3623ea[_0x3edd('0x52')]=_[_0x3edd('0x9f')](_0x3623ea['where'],_0xd3bc7f);}_0x3623ea=_[_0x3edd('0x9f')]({},_0x3623ea,_0x28a517[_0x3edd('0xb8')]);return db[_0x3edd('0xbc')][_0x3edd('0x26')]({'where':_0x3623ea[_0x3edd('0x52')]})[_0x3edd('0x38')](function(_0x8f827c){_0x2c2309[_0x3edd('0x26')]=_0x8f827c;if(_0x28a517[_0x3edd('0x48')]['includeAll']){_0x3623ea[_0x3edd('0xb7')]=[{'all':!![]}];}return db[_0x3edd('0xbc')][_0x3edd('0xc3')](_0x3623ea);})[_0x3edd('0x38')](function(_0x229589){_0x2c2309[_0x3edd('0xb3')]=_0x229589;return _0x2c2309;});}})[_0x3edd('0x38')](respondWithFilteredResult(_0x4038ac,_0x3623ea))['catch'](handleError(_0x4038ac,null));};exports[_0x3edd('0xc4')]=function(_0x4be9d9,_0x532433,_0xd982c8){return db[_0x3edd('0x42')][_0x3edd('0x71')]({'where':{'id':_0x4be9d9[_0x3edd('0xb5')]['id']}})['then'](handleEntityNotFound(_0x532433,null))[_0x3edd('0x38')](function(_0x2d0fd8){if(_0x2d0fd8){return _0x2d0fd8[_0x3edd('0xc5')](_0x4be9d9[_0x3edd('0x78')][_0x3edd('0xbd')],_[_0x3edd('0xbe')](_0x4be9d9[_0x3edd('0x78')],[_0x3edd('0xbd'),'id'])||{})['spread'](function(){return db[_0x3edd('0x74')]['findAll']({'attributes':['id',_0x3edd('0x2f'),'color'],'where':{'id':_0x4be9d9['body']['ids']}});})[_0x3edd('0x38')](function(_0x7b06f2){socket[_0x3edd('0xc6')](_0x3edd('0xc7'),{'id':Number(_0x4be9d9[_0x3edd('0xb5')]['id']),'tags':_0x7b06f2||[]});return{'id':Number(_0x4be9d9[_0x3edd('0xb5')]['id']),'tags':_0x7b06f2||[]};});}})[_0x3edd('0x38')](respondWithResult(_0x532433,null))[_0x3edd('0x39')](handleError(_0x532433,null));};exports[_0x3edd('0xc8')]=function(_0x165d0e,_0x550346,_0x1c6eab){return db['FaxInteraction'][_0x3edd('0x71')]({'where':{'id':_0x165d0e['params']['id']}})[_0x3edd('0x38')](handleEntityNotFound(_0x550346,null))[_0x3edd('0x38')](function(_0x5e506b){if(_0x5e506b){return _0x5e506b['removeTags'](_0x165d0e[_0x3edd('0x48')][_0x3edd('0xbd')]);}})[_0x3edd('0x38')](respondWithStatusCode(_0x550346,null))['catch'](handleError(_0x550346,null));};exports[_0x3edd('0xc9')]=function(_0x33035e,_0x35538d){var _0x62d5d3=moment()[_0x3edd('0xca')]()[_0x3edd('0x9c')]();var _0x5557a0=path[_0x3edd('0xcb')](config['root'],_0x3edd('0xcc'),_0x3edd('0xcd'),_0x3edd('0xce'));var _0x15f0a4=path[_0x3edd('0xcb')](config[_0x3edd('0xcf')],_0x3edd('0xcc'),'files','attachments');var _0x37c976=path[_0x3edd('0xcb')](_0x5557a0,_0x62d5d3);var _0x404944=util['format']('transcript-%d-%s.zip',_0x33035e[_0x3edd('0xb5')]['id'],_0x62d5d3);var _0x105704=path['join'](_0x5557a0,_0x404944);var _0x45f590=[];_0x45f590['push']({'model':db[_0x3edd('0xd0')],'as':_0x3edd('0xd0'),'raw':!![]});var _0x3d1941=[{'model':db[_0x3edd('0xbc')],'as':'Messages','attributes':['id',_0x3edd('0x78'),_0x3edd('0x7d')],'include':_0x45f590}];return db[_0x3edd('0x42')][_0x3edd('0x71')]({'where':{'id':_0x33035e[_0x3edd('0xb5')]['id']},'include':_0x3d1941})[_0x3edd('0x38')](handleEntityNotFound(_0x35538d,null))[_0x3edd('0x38')](function(_0x46e74b){if(_0x46e74b&&_0x46e74b['Messages']){var _0x35219b=_0x46e74b[_0x3edd('0xd1')]({'plain':!![]});fs[_0x3edd('0xd2')](_0x37c976);for(var _0x271b41=0x0;_0x271b41<_0x35219b['Messages'][_0x3edd('0x9d')];_0x271b41++){var _0x35022d=_0x35219b['Messages'][_0x271b41][_0x3edd('0xd0')];if(_0x35022d){var _0x4b2bc3=path[_0x3edd('0xcb')](_0x15f0a4,_0x35022d[_0x3edd('0xd3')]);if(fs[_0x3edd('0xd4')](_0x4b2bc3)){fs[_0x3edd('0xd5')](_0x4b2bc3)['pipe'](fs[_0x3edd('0xd6')](path[_0x3edd('0xcb')](_0x37c976,_0x35022d[_0x3edd('0xd3')])));}}}return BPromise[_0x3edd('0x95')]()[_0x3edd('0x38')](function(){return new BPromise(function(_0x556b7c,_0x1de5a3){zipdir(_0x37c976,{'saveTo':_0x105704},function(_0x6457a4,_0x4c13b8){if(_0x6457a4)return _0x1de5a3(_0x6457a4);return _0x556b7c(_0x4c13b8);});})[_0x3edd('0x38')](function(){return new BPromise(function(_0xe3680a,_0x28dc96){rimraf(_0x37c976,function(_0x59b35c){if(_0x59b35c)_0x28dc96(_0x59b35c);return _0xe3680a();});});})[_0x3edd('0x38')](function(){return _0x35538d[_0x3edd('0xc9')](_0x105704,_0x404944,function(_0x3396fa){if(_0x3396fa){console[_0x3edd('0xd7')](_0x3edd('0xd8'),_0x3396fa);}else{fs[_0x3edd('0xd9')](_0x105704);}});});});}else{return _0x35538d['sendStatus'](0xc8);}})[_0x3edd('0x39')](handleError(_0x35538d,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index be96ffc..f9b8623 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 _0x12c8=['map','findAll','then','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','getUsers','setDataValue','Users'];(function(_0x52d376,_0x4c4820){var _0x5316c2=function(_0x19a6b2){while(--_0x19a6b2){_0x52d376['push'](_0x52d376['shift']());}};_0x5316c2(++_0x4c4820);}(_0x12c8,0x78));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x812c('0x0'));var FaxInteraction=require(_0x812c('0x1'))['db'][_0x812c('0x2')];var FaxMessage=require(_0x812c('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x317ced){return function(_0x4d99a6,_0x17bed4,_0x50709d){_0x4d99a6[_0x812c('0x3')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5dbe9f){_0x4d99a6[_0x812c('0x4')](_0x812c('0x5'),_0x5dbe9f[_0x812c('0x6')](function(_0x260628){return{'id':_0x260628['id']};}));return FaxMessage[_0x812c('0x7')]({'where':{'FaxInteractionId':_0x4d99a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x812c('0x8')](function(_0x555190){_0x4d99a6['setDataValue']('unreadMessages',_0x555190[_0x812c('0x9')]);FaxInteractionEvents[_0x812c('0xa')](_0x317ced+':'+_0x4d99a6['id'],_0x4d99a6);FaxInteractionEvents[_0x812c('0xa')](_0x317ced,_0x4d99a6);_0x50709d(null);})[_0x812c('0xb')](_0x50709d(null));};}for(var e in events){if(events[_0x812c('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x812c('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xe39d=['emit','catch','hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x541fbb,_0x2fd494){var _0x41746d=function(_0x298d98){while(--_0x298d98){_0x541fbb['push'](_0x541fbb['shift']());}};_0x41746d(++_0x2fd494);}(_0xe39d,0xa8));var _0xde39=function(_0x4fc6cf,_0x23fbb8){_0x4fc6cf=_0x4fc6cf-0x0;var _0x5e5c56=_0xe39d[_0x4fc6cf];return _0x5e5c56;};'use strict';var EventEmitter=require(_0xde39('0x0'));var FaxInteraction=require(_0xde39('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xde39('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xde39('0x3')](0x0);var events={'afterCreate':_0xde39('0x4'),'afterUpdate':_0xde39('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34d435){return function(_0x107478,_0x4829bc,_0x2ccd16){_0x107478[_0xde39('0x6')]({'attributes':['id'],'raw':!![]})[_0xde39('0x7')](function(_0x12fcc4){_0x107478[_0xde39('0x8')]('Users',_0x12fcc4[_0xde39('0x9')](function(_0x136fdc){return{'id':_0x136fdc['id']};}));return FaxMessage[_0xde39('0xa')]({'where':{'FaxInteractionId':_0x107478['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde39('0x7')](function(_0x2f7e57){_0x107478[_0xde39('0x8')](_0xde39('0xb'),_0x2f7e57['length']);FaxInteractionEvents[_0xde39('0xc')](_0x34d435+':'+_0x107478['id'],_0x107478);FaxInteractionEvents['emit'](_0x34d435,_0x107478);_0x2ccd16(null);})[_0xde39('0xd')](_0x2ccd16(null));};}for(var e in events){if(events[_0xde39('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 26f682c..28909fa 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 _0xd93a=['request-promise','rimraf','../../config/environment','exports','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd93a,0x91));var _0xad93=function(_0x34537d,_0x4e82ea){_0x34537d=_0x34537d-0x0;var _0x32e000=_0xd93a[_0x34537d];return _0x32e000;};'use strict';var _=require(_0xad93('0x0'));var util=require(_0xad93('0x1'));var logger=require('../../config/logger')(_0xad93('0x2'));var moment=require(_0xad93('0x3'));var BPromise=require(_0xad93('0x4'));var rp=require(_0xad93('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad93('0x6'));var config=require(_0xad93('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xad93('0x8')]=function(_0x820a93,_0x43bd17){return _0x820a93[_0xad93('0x9')](_0xad93('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35cac6,_0x3e26bd,_0x3f9408){if(_0x35cac6[_0xad93('0xb')](_0xad93('0xc'))){_0x35cac6[_0xad93('0xd')]=moment()['format'](_0xad93('0xe'));}_0x3f9408(null,_0x35cac6);}}});}; \ No newline at end of file +var _0xcbcf=['fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1805a8,_0x1ba981){var _0x51fcd3=function(_0x290a6d){while(--_0x290a6d){_0x1805a8['push'](_0x1805a8['shift']());}};_0x51fcd3(++_0x1ba981);}(_0xcbcf,0xae));var _0xfcbc=function(_0xb1e99a,_0xbaf1df){_0xb1e99a=_0xb1e99a-0x0;var _0x5e96bb=_0xcbcf[_0xb1e99a];return _0x5e96bb;};'use strict';var _=require(_0xfcbc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfcbc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcbc('0x2'));var fs=require('fs');var path=require(_0xfcbc('0x3'));var rimraf=require(_0xfcbc('0x4'));var config=require(_0xfcbc('0x5'));var attributes=require('./faxInteraction.attributes');module[_0xfcbc('0x6')]=function(_0x4dd7a4,_0x42c6f7){return _0x4dd7a4[_0xfcbc('0x7')]('FaxInteraction',attributes,{'tableName':_0xfcbc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4dfe94,_0x3486e2,_0x8155a2){if(_0x4dfe94[_0xfcbc('0x9')](_0xfcbc('0xa'))){_0x4dfe94[_0xfcbc('0xb')]=moment()['format'](_0xfcbc('0xc'));}_0x8155a2(null,_0x4dfe94);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 55f14f9..f0adb01 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 _0x2d59=['request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','attributes','limit','where','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','debug'];(function(_0x8da2f2,_0x494e48){var _0x52475b=function(_0x328ad9){while(--_0x328ad9){_0x8da2f2['push'](_0x8da2f2['shift']());}};_0x52475b(++_0x494e48);}(_0x2d59,0x17b));var _0x92d5=function(_0x87948c,_0x3f1bbe){_0x87948c=_0x87948c-0x0;var _0x4c1f74=_0x2d59[_0x87948c];return _0x4c1f74;};'use strict';var _=require('lodash');var util=require(_0x92d5('0x0'));var moment=require(_0x92d5('0x1'));var BPromise=require(_0x92d5('0x2'));var rs=require(_0x92d5('0x3'));var fs=require('fs');var Redis=require(_0x92d5('0x4'));var db=require(_0x92d5('0x5'))['db'];var utils=require(_0x92d5('0x6'));var logger=require(_0x92d5('0x7'))(_0x92d5('0x8'));var config=require(_0x92d5('0x9'));var jayson=require(_0x92d5('0xa'));var client=jayson[_0x92d5('0xb')]['http']({'port':0x232a});config[_0x92d5('0xc')]=_[_0x92d5('0xd')](config[_0x92d5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x92d5('0xe'))(new Redis(config[_0x92d5('0xc')]));require(_0x92d5('0xf'))[_0x92d5('0x10')](socket);function respondWithRpcPromise(_0x681f86,_0x350732,_0x18c1f9){return new BPromise(function(_0x4290e2,_0x3741c1){return client[_0x92d5('0x11')](_0x681f86,_0x18c1f9)[_0x92d5('0x12')](function(_0x1ddbc4){logger[_0x92d5('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x350732,'request\x20sent');logger[_0x92d5('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x350732,_0x92d5('0x15'),JSON[_0x92d5('0x16')](_0x1ddbc4));if(_0x1ddbc4[_0x92d5('0x17')]){if(_0x1ddbc4['error'][_0x92d5('0x18')]===0x1f4){logger[_0x92d5('0x17')](_0x92d5('0x19'),_0x350732,_0x1ddbc4[_0x92d5('0x17')][_0x92d5('0x1a')]);return _0x3741c1(_0x1ddbc4[_0x92d5('0x17')][_0x92d5('0x1a')]);}logger[_0x92d5('0x17')](_0x92d5('0x19'),_0x350732,_0x1ddbc4[_0x92d5('0x17')][_0x92d5('0x1a')]);return _0x4290e2(_0x1ddbc4[_0x92d5('0x17')][_0x92d5('0x1a')]);}else{logger[_0x92d5('0x13')](_0x92d5('0x19'),_0x350732,_0x92d5('0x15'));_0x4290e2(_0x1ddbc4['result']['message']);}})[_0x92d5('0x1b')](function(_0x53a4a5){logger[_0x92d5('0x17')](_0x92d5('0x19'),_0x350732,_0x53a4a5);_0x3741c1(_0x53a4a5);});});}exports[_0x92d5('0x1c')]=function(_0x51e3c2){var _0x4a5d5f=this;return new Promise(function(_0x1826b5,_0x56ab59){return db[_0x92d5('0x1d')]['update'](_0x51e3c2[_0x92d5('0x1e')],{'raw':_0x51e3c2[_0x92d5('0x1f')]?_0x51e3c2[_0x92d5('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e3c2[_0x92d5('0x1f')]?_0x51e3c2[_0x92d5('0x1f')]['where']||null:null,'attributes':_0x51e3c2[_0x92d5('0x1f')]?_0x51e3c2['options'][_0x92d5('0x20')]||null:null,'limit':_0x51e3c2[_0x92d5('0x1f')]?_0x51e3c2[_0x92d5('0x1f')][_0x92d5('0x21')]||null:null})[_0x92d5('0x12')](function(_0x2a2f16){logger['info']('UpdateFaxInteraction',_0x51e3c2);logger[_0x92d5('0x14')](_0x92d5('0x1c'),_0x51e3c2,JSON[_0x92d5('0x16')](_0x2a2f16));_0x1826b5(_0x2a2f16);})[_0x92d5('0x1b')](function(_0x10dbdb){logger['error'](_0x92d5('0x1c'),_0x10dbdb[_0x92d5('0x1a')],_0x51e3c2);_0x56ab59(_0x4a5d5f[_0x92d5('0x17')](0x1f4,_0x10dbdb[_0x92d5('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1de002){return new Promise(function(_0x62b58b,_0x543155){return db['FaxInteraction']['find']({'where':_0x1de002[_0x92d5('0x1f')]?_0x1de002[_0x92d5('0x1f')][_0x92d5('0x22')]||null:null})[_0x92d5('0x12')](function(_0x58f6bf){if(_0x58f6bf){return _0x58f6bf[_0x92d5('0x23')](_0x1de002['body']['ids'],_[_0x92d5('0x24')](_0x1de002[_0x92d5('0x1e')],[_0x92d5('0x25'),'id'])||{});}})[_0x92d5('0x26')](function(_0x1ded06){logger['info'](_0x92d5('0x27'),_0x1de002);logger[_0x92d5('0x14')](_0x92d5('0x27'),_0x1de002,JSON['stringify'](_0x1ded06));_0x62b58b(_0x1ded06);})['catch'](function(_0x567e3a){logger[_0x92d5('0x17')](_0x92d5('0x27'),_0x567e3a['message'],_0x1de002);_0x543155(_this[_0x92d5('0x17')](0x1f4,_0x567e3a[_0x92d5('0x1a')]));});});}; \ No newline at end of file +var _0x6ed8=['./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','FaxInteraction','update','body','options','limit','UpdateFaxInteraction','debug','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x216f9c,_0x551583){var _0x4bb63d=function(_0x793bdb){while(--_0x793bdb){_0x216f9c['push'](_0x216f9c['shift']());}};_0x4bb63d(++_0x551583);}(_0x6ed8,0x10c));var _0x86ed=function(_0x3f48c8,_0x299d53){_0x3f48c8=_0x3f48c8-0x0;var _0x4c7512=_0x6ed8[_0x3f48c8];return _0x4c7512;};'use strict';var _=require('lodash');var util=require(_0x86ed('0x0'));var moment=require(_0x86ed('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86ed('0x2'));var db=require(_0x86ed('0x3'))['db'];var utils=require(_0x86ed('0x4'));var logger=require(_0x86ed('0x5'))(_0x86ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x86ed('0x7'));var client=jayson['client'][_0x86ed('0x8')]({'port':0x232a});config[_0x86ed('0x9')]=_[_0x86ed('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x86ed('0xb'))(new Redis(config[_0x86ed('0x9')]));require(_0x86ed('0xc'))[_0x86ed('0xd')](socket);function respondWithRpcPromise(_0x50d900,_0x251b12,_0x1accb7){return new BPromise(function(_0x53752c,_0x2789f6){return client['request'](_0x50d900,_0x1accb7)[_0x86ed('0xe')](function(_0x907267){logger['info'](_0x86ed('0xf'),_0x251b12,'request\x20sent');logger['debug'](_0x86ed('0x10'),_0x251b12,_0x86ed('0x11'),JSON[_0x86ed('0x12')](_0x907267));if(_0x907267[_0x86ed('0x13')]){if(_0x907267[_0x86ed('0x13')][_0x86ed('0x14')]===0x1f4){logger[_0x86ed('0x13')](_0x86ed('0xf'),_0x251b12,_0x907267['error'][_0x86ed('0x15')]);return _0x2789f6(_0x907267[_0x86ed('0x13')][_0x86ed('0x15')]);}logger[_0x86ed('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x251b12,_0x907267[_0x86ed('0x13')][_0x86ed('0x15')]);return _0x53752c(_0x907267[_0x86ed('0x13')][_0x86ed('0x15')]);}else{logger[_0x86ed('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x251b12,_0x86ed('0x11'));_0x53752c(_0x907267[_0x86ed('0x17')][_0x86ed('0x15')]);}})[_0x86ed('0x18')](function(_0x3b13db){logger[_0x86ed('0x13')](_0x86ed('0xf'),_0x251b12,_0x3b13db);_0x2789f6(_0x3b13db);});});}exports['UpdateFaxInteraction']=function(_0x3dae33){var _0x4baebf=this;return new Promise(function(_0x191039,_0x542f98){return db[_0x86ed('0x19')][_0x86ed('0x1a')](_0x3dae33[_0x86ed('0x1b')],{'raw':_0x3dae33[_0x86ed('0x1c')]?_0x3dae33[_0x86ed('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dae33[_0x86ed('0x1c')]?_0x3dae33[_0x86ed('0x1c')]['where']||null:null,'attributes':_0x3dae33[_0x86ed('0x1c')]?_0x3dae33[_0x86ed('0x1c')]['attributes']||null:null,'limit':_0x3dae33['options']?_0x3dae33[_0x86ed('0x1c')][_0x86ed('0x1d')]||null:null})[_0x86ed('0xe')](function(_0xadb307){logger[_0x86ed('0x16')](_0x86ed('0x1e'),_0x3dae33);logger[_0x86ed('0x1f')]('UpdateFaxInteraction',_0x3dae33,JSON[_0x86ed('0x12')](_0xadb307));_0x191039(_0xadb307);})['catch'](function(_0x451e29){logger[_0x86ed('0x13')](_0x86ed('0x1e'),_0x451e29['message'],_0x3dae33);_0x542f98(_0x4baebf['error'](0x1f4,_0x451e29[_0x86ed('0x15')]));});});};exports[_0x86ed('0x20')]=function(_0x226a92){return new Promise(function(_0x17cb23,_0x3377fb){return db[_0x86ed('0x19')][_0x86ed('0x21')]({'where':_0x226a92[_0x86ed('0x1c')]?_0x226a92[_0x86ed('0x1c')][_0x86ed('0x22')]||null:null})['then'](function(_0x20f449){if(_0x20f449){return _0x20f449[_0x86ed('0x23')](_0x226a92[_0x86ed('0x1b')][_0x86ed('0x24')],_[_0x86ed('0x25')](_0x226a92[_0x86ed('0x1b')],[_0x86ed('0x24'),'id'])||{});}})[_0x86ed('0x26')](function(_0x44f2f2){logger[_0x86ed('0x16')](_0x86ed('0x27'),_0x226a92);logger[_0x86ed('0x1f')](_0x86ed('0x27'),_0x226a92,JSON[_0x86ed('0x12')](_0x44f2f2));_0x17cb23(_0x44f2f2);})[_0x86ed('0x18')](function(_0x1adfb8){logger[_0x86ed('0x13')]('AddTags',_0x1adfb8['message'],_0x226a92);_0x3377fb(_this[_0x86ed('0x13')](0x1f4,_0x1adfb8[_0x86ed('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1181df1..5ab4136 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 _0x02e7=['update','emit','removeListener','register','length','faxInteraction:','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02e7,0x156));var _0x702e=function(_0x2feade,_0x3d6a7a){_0x2feade=_0x2feade-0x0;var _0x51f51a=_0x02e7[_0x2feade];return _0x51f51a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x702e('0x0'),_0x702e('0x1'),_0x702e('0x2')];function createListener(_0x25d165,_0x2d75ac){return function(_0x2b18b5){_0x2d75ac[_0x702e('0x3')](_0x25d165,_0x2b18b5);};}function removeListener(_0xd80b46,_0x5c86a6){return function(){FaxInteractionEvents[_0x702e('0x4')](_0xd80b46,_0x5c86a6);};}exports[_0x702e('0x5')]=function(_0xd3ea6f){for(var _0x383f54=0x0,_0xaad040=events[_0x702e('0x6')];_0x383f54<_0xaad040;_0x383f54++){var _0x3886cf=events[_0x383f54];var _0xc665c8=createListener(_0x702e('0x7')+_0x3886cf,_0xd3ea6f);FaxInteractionEvents['on'](_0x3886cf,_0xc665c8);}}; \ No newline at end of file +var _0x50e9=['./faxInteraction.events','save','update','removeListener','register','faxInteraction:'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x50e9,0x11a));var _0x950e=function(_0x269676,_0x423434){_0x269676=_0x269676-0x0;var _0x126100=_0x50e9[_0x269676];return _0x126100;};'use strict';var FaxInteractionEvents=require(_0x950e('0x0'));var events=[_0x950e('0x1'),'remove',_0x950e('0x2')];function createListener(_0x14ec77,_0x4a5cc0){return function(_0xed7038){_0x4a5cc0['emit'](_0x14ec77,_0xed7038);};}function removeListener(_0x4f076d,_0x3ae382){return function(){FaxInteractionEvents[_0x950e('0x3')](_0x4f076d,_0x3ae382);};}exports[_0x950e('0x4')]=function(_0x3a1822){for(var _0x4a0320=0x0,_0x16f7f7=events['length'];_0x4a0320<_0x16f7f7;_0x4a0320++){var _0x66d1bc=events[_0x4a0320];var _0xb6dee4=createListener(_0x950e('0x5')+_0x66d1bc,_0x3a1822);FaxInteractionEvents['on'](_0x66d1bc,_0xb6dee4);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e91df8e..056d1b1 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 _0x2feb=['destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy'];(function(_0x4c788c,_0x10eb8a){var _0x48a3ef=function(_0x1e2c1d){while(--_0x1e2c1d){_0x4c788c['push'](_0x4c788c['shift']());}};_0x48a3ef(++_0x10eb8a);}(_0x2feb,0x10c));var _0xb2fe=function(_0x59684c,_0x4f23bd){_0x59684c=_0x59684c-0x0;var _0x6e9beb=_0x2feb[_0x59684c];return _0x6e9beb;};'use strict';var multer=require(_0xb2fe('0x0'));var util=require('util');var path=require(_0xb2fe('0x1'));var timeout=require(_0xb2fe('0x2'));var express=require(_0xb2fe('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2fe('0x4'));var interaction=require(_0xb2fe('0x5'));var config=require(_0xb2fe('0x6'));var controller=require(_0xb2fe('0x7'));router[_0xb2fe('0x8')]('/',auth[_0xb2fe('0x9')](),controller['index']);router[_0xb2fe('0x8')](_0xb2fe('0xa'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xb')]);router[_0xb2fe('0x8')](_0xb2fe('0xc'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xd')]);router[_0xb2fe('0x8')](_0xb2fe('0xe'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xf')]);router[_0xb2fe('0x8')](_0xb2fe('0x10'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0x11')]);router[_0xb2fe('0x12')]('/',auth[_0xb2fe('0x9')](),controller[_0xb2fe('0x13')]);router[_0xb2fe('0x12')](_0xb2fe('0xe'),auth[_0xb2fe('0x9')](),controller['addMessage']);router[_0xb2fe('0x12')]('/:id/tags',auth[_0xb2fe('0x9')](),interaction[_0xb2fe('0x14')](_0xb2fe('0x15'),_0xb2fe('0x16')),controller[_0xb2fe('0x17')]);router[_0xb2fe('0x18')](_0xb2fe('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xb2fe('0x15'),_0xb2fe('0x19')),controller[_0xb2fe('0x1a')]);router[_0xb2fe('0x1b')](_0xb2fe('0xc'),auth[_0xb2fe('0x9')](),interaction[_0xb2fe('0x14')]('fax',_0xb2fe('0x1c')),controller[_0xb2fe('0x1d')]);router[_0xb2fe('0x1b')](_0xb2fe('0x1e'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0x1f')]);module[_0xb2fe('0x20')]=router; \ No newline at end of file +var _0xbd48=['/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','addTags','put','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0xbd48,0x124));var _0x8bd4=function(_0x114478,_0x3de4df){_0x114478=_0x114478-0x0;var _0x149b19=_0xbd48[_0x114478];return _0x149b19;};'use strict';var multer=require(_0x8bd4('0x0'));var util=require(_0x8bd4('0x1'));var path=require(_0x8bd4('0x2'));var timeout=require(_0x8bd4('0x3'));var express=require(_0x8bd4('0x4'));var router=express['Router']();var fs_extra=require(_0x8bd4('0x5'));var auth=require(_0x8bd4('0x6'));var interaction=require(_0x8bd4('0x7'));var config=require(_0x8bd4('0x8'));var controller=require(_0x8bd4('0x9'));router[_0x8bd4('0xa')]('/',auth[_0x8bd4('0xb')](),controller[_0x8bd4('0xc')]);router[_0x8bd4('0xa')](_0x8bd4('0xd'),auth[_0x8bd4('0xb')](),controller['describe']);router['get'](_0x8bd4('0xe'),auth['isAuthenticated'](),controller[_0x8bd4('0xf')]);router[_0x8bd4('0xa')](_0x8bd4('0x10'),auth[_0x8bd4('0xb')](),controller[_0x8bd4('0x11')]);router[_0x8bd4('0xa')]('/:id/download',auth[_0x8bd4('0xb')](),controller[_0x8bd4('0x12')]);router[_0x8bd4('0x13')]('/',auth[_0x8bd4('0xb')](),controller[_0x8bd4('0x14')]);router[_0x8bd4('0x13')]('/:id/messages',auth[_0x8bd4('0xb')](),controller[_0x8bd4('0x15')]);router[_0x8bd4('0x13')](_0x8bd4('0x16'),auth[_0x8bd4('0xb')](),interaction['tracked']('fax','faxinteraction:addtags'),controller[_0x8bd4('0x17')]);router[_0x8bd4('0x18')](_0x8bd4('0xe'),auth['isAuthenticated'](),interaction[_0x8bd4('0x19')](_0x8bd4('0x1a'),_0x8bd4('0x1b')),controller[_0x8bd4('0x1c')]);router[_0x8bd4('0x1d')](_0x8bd4('0xe'),auth['isAuthenticated'](),interaction[_0x8bd4('0x19')]('fax',_0x8bd4('0x1e')),controller[_0x8bd4('0x1f')]);router['delete'](_0x8bd4('0x16'),auth[_0x8bd4('0xb')](),controller[_0x8bd4('0x20')]);module[_0x8bd4('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 196119f..a0e434b 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 _0x0e85=['exports','medium','BOOLEAN','TEXT','sequelize'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0e85[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x50e8('0x0'));module[_0x50e8('0x1')]={'body':{'type':Sequelize['TEXT'](_0x50e8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x50e8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x50e8('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8ece=['medium','out','DATE','sequelize','exports','TEXT'];(function(_0x1442d8,_0x242f3c){var _0x4c7b66=function(_0x349bfb){while(--_0x349bfb){_0x1442d8['push'](_0x1442d8['shift']());}};_0x4c7b66(++_0x242f3c);}(_0x8ece,0x195));var _0xe8ec=function(_0x5b04a3,_0xfda4fd){_0x5b04a3=_0x5b04a3-0x0;var _0x1adf11=_0x8ece[_0x5b04a3];return _0x1adf11;};'use strict';var Sequelize=require(_0xe8ec('0x0'));module[_0xe8ec('0x1')]={'body':{'type':Sequelize[_0xe8ec('0x2')](_0xe8ec('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe8ec('0x4')),'defaultValue':_0xe8ec('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe8ec('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe8ec('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 540a3ea..5211aaf 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 _0xbc6e=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','FaxMessage','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','options','includeAll','findAll','show','include','find','body','destroy','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteractionId','isNil','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','manual','interface','SIP/%s','motionChannel','EventManager','acceptmessage','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','internal','channel','event','rejectmessage','create','findOne','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','Attachment','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','http','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end'];(function(_0x39e438,_0x1ff236){var _0x27f588=function(_0x6e718a){while(--_0x6e718a){_0x39e438['push'](_0x39e438['shift']());}};_0x27f588(++_0x1ff236);}(_0xbc6e,0xf3));var _0xebc6=function(_0x5414ec,_0x519cb2){_0x5414ec=_0x5414ec-0x0;var _0xf8da2b=_0xbc6e[_0x5414ec];return _0xf8da2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebc6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebc6('0x1'));var rp=require(_0xebc6('0x2'));var moment=require(_0xebc6('0x3'));var BPromise=require(_0xebc6('0x4'));var Mustache=require(_0xebc6('0x5'));var util=require('util');var path=require(_0xebc6('0x6'));var sox=require(_0xebc6('0x7'));var csv=require(_0xebc6('0x8'));var ejs=require(_0xebc6('0x9'));var fs=require('fs');var fs_extra=require(_0xebc6('0xa'));var _=require(_0xebc6('0xb'));var squel=require(_0xebc6('0xc'));var crypto=require('crypto');var jsforce=require(_0xebc6('0xd'));var deskjs=require(_0xebc6('0xe'));var toCsv=require(_0xebc6('0x8'));var querystring=require(_0xebc6('0xf'));var Papa=require(_0xebc6('0x10'));var Redis=require(_0xebc6('0x11'));var authService=require(_0xebc6('0x12'));var qs=require(_0xebc6('0x13'));var as=require(_0xebc6('0x14'));var hardwareService=require(_0xebc6('0x15'));var logger=require(_0xebc6('0x16'))(_0xebc6('0x17'));var utils=require(_0xebc6('0x18'));var config=require(_0xebc6('0x19'));var licenseUtil=require(_0xebc6('0x1a'));var db=require('../../mysqldb')['db'];config[_0xebc6('0x1b')]=_[_0xebc6('0x1c')](config[_0xebc6('0x1b')],{'host':_0xebc6('0x1d'),'port':0x18eb});var socket=require(_0xebc6('0x1e'))(new Redis(config[_0xebc6('0x1b')]));require(_0xebc6('0x1f'))[_0xebc6('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xebc6('0x21')]({'port':0x232c});var client9002=jayson[_0xebc6('0x22')][_0xebc6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x17d774,_0x16caa5,_0x53a263,_0x58d05a){return new BPromise(function(_0x3f7a08,_0x394373){var _0x2f5673=_0x58d05a||client;return _0x2f5673[_0xebc6('0x23')](_0x17d774,_0x53a263)['then'](function(_0x5ba928){logger[_0xebc6('0x24')](_0xebc6('0x25'),_0x16caa5,_0xebc6('0x26'));logger['debug'](_0xebc6('0x27'),_0x16caa5,_0xebc6('0x26'),JSON[_0xebc6('0x28')](_0x5ba928));if(_0x5ba928[_0xebc6('0x29')]){if(_0x5ba928[_0xebc6('0x29')]['code']===0x1f4){logger['error'](_0xebc6('0x25'),_0x16caa5,_0x5ba928[_0xebc6('0x29')][_0xebc6('0x2a')]);return _0x394373(_0x5ba928['error'][_0xebc6('0x2a')]);}logger[_0xebc6('0x29')](_0xebc6('0x25'),_0x16caa5,_0x5ba928[_0xebc6('0x29')][_0xebc6('0x2a')]);return _0x3f7a08(_0x5ba928[_0xebc6('0x29')][_0xebc6('0x2a')]);}else{logger[_0xebc6('0x24')](_0xebc6('0x25'),_0x16caa5,_0xebc6('0x26'));_0x3f7a08(_0x5ba928['result'][_0xebc6('0x2a')]);}})[_0xebc6('0x2b')](function(_0x517c22){logger[_0xebc6('0x29')](_0xebc6('0x25'),_0x16caa5,_0x517c22);_0x394373(_0x517c22);});});}function respondWithStatusCode(_0x9891c5,_0x3daf54){_0x3daf54=_0x3daf54||0xcc;return function(_0xe65559){if(_0xe65559){return _0x9891c5[_0xebc6('0x2c')](_0x3daf54);}return _0x9891c5[_0xebc6('0x2d')](_0x3daf54)[_0xebc6('0x2e')]();};}function respondWithResult(_0xd47160,_0x1ae0de){_0x1ae0de=_0x1ae0de||0xc8;return function(_0x435312){if(_0x435312){return _0xd47160[_0xebc6('0x2d')](_0x1ae0de)[_0xebc6('0x2f')](_0x435312);}};}function respondWithFilteredResult(_0x3a0d66,_0xb50dec){return function(_0x1bb195){if(_0x1bb195){var _0x5105f6=typeof _0xb50dec[_0xebc6('0x30')]===_0xebc6('0x31')&&typeof _0xb50dec[_0xebc6('0x32')]===_0xebc6('0x31');var _0x5cb919=_0x1bb195[_0xebc6('0x33')];var _0x44a311=_0x5105f6?0x0:_0xb50dec[_0xebc6('0x30')];var _0x24e5e7=_0x5105f6?_0x1bb195[_0xebc6('0x33')]:_0xb50dec[_0xebc6('0x30')]+_0xb50dec['limit'];var _0x2ed868;if(_0x24e5e7>=_0x5cb919){_0x24e5e7=_0x5cb919;_0x2ed868=0xc8;}else{_0x2ed868=0xce;}_0x3a0d66[_0xebc6('0x2d')](_0x2ed868);return _0x3a0d66[_0xebc6('0x34')](_0xebc6('0x35'),_0x44a311+'-'+_0x24e5e7+'/'+_0x5cb919)[_0xebc6('0x2f')](_0x1bb195);}return null;};}function patchUpdates(_0x570b17){return function(_0x5a6820){try{jsonpatch[_0xebc6('0x36')](_0x5a6820,_0x570b17,!![]);}catch(_0x1bde25){return BPromise[_0xebc6('0x37')](_0x1bde25);}return _0x5a6820[_0xebc6('0x38')]();};}function saveUpdates(_0x313726,_0x322b84){return function(_0x4214c1){if(_0x4214c1){return _0x4214c1[_0xebc6('0x39')](_0x313726)[_0xebc6('0x3a')](function(_0x34b4f6){return _0x34b4f6;});}return null;};}function removeEntity(_0xe6dbc2,_0x31c960){return function(_0x5ec9f7){if(_0x5ec9f7){return _0x5ec9f7['destroy']()['then'](function(){_0xe6dbc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x173309,_0x3d2a12){return function(_0x3509d5){if(!_0x3509d5){_0x173309[_0xebc6('0x2c')](0x194);}return _0x3509d5;};}function handleError(_0x369c6a,_0x1a13e4){_0x1a13e4=_0x1a13e4||0x1f4;return function(_0x532825){logger[_0xebc6('0x29')](_0x532825[_0xebc6('0x3b')]);if(_0x532825[_0xebc6('0x3c')]){delete _0x532825['name'];}_0x369c6a['status'](_0x1a13e4)['send'](_0x532825);};}exports[_0xebc6('0x3d')]=function(_0x2b1358,_0x50823a){var _0x4d7c18={},_0x4bc13c={},_0x2bef63={'count':0x0,'rows':[]};var _0x29930c=_['map'](db[_0xebc6('0x3e')][_0xebc6('0x3f')],function(_0xa0a4e1){return{'name':_0xa0a4e1['fieldName'],'type':_0xa0a4e1['type'][_0xebc6('0x40')]};});_0x4bc13c[_0xebc6('0x41')]=_[_0xebc6('0x42')](_0x29930c,'name');_0x4bc13c[_0xebc6('0x43')]=_[_0xebc6('0x44')](_0x2b1358[_0xebc6('0x43')]);_0x4bc13c[_0xebc6('0x45')]=_[_0xebc6('0x46')](_0x4bc13c[_0xebc6('0x41')],_0x4bc13c[_0xebc6('0x43')]);_0x4d7c18[_0xebc6('0x47')]=_[_0xebc6('0x46')](_0x4bc13c[_0xebc6('0x41')],qs[_0xebc6('0x48')](_0x2b1358[_0xebc6('0x43')][_0xebc6('0x48')]));_0x4d7c18[_0xebc6('0x47')]=_0x4d7c18[_0xebc6('0x47')][_0xebc6('0x49')]?_0x4d7c18['attributes']:_0x4bc13c[_0xebc6('0x41')];if(!_0x2b1358[_0xebc6('0x43')][_0xebc6('0x4a')](_0xebc6('0x4b'))){_0x4d7c18[_0xebc6('0x32')]=qs[_0xebc6('0x32')](_0x2b1358[_0xebc6('0x43')][_0xebc6('0x32')]);_0x4d7c18[_0xebc6('0x30')]=qs[_0xebc6('0x30')](_0x2b1358[_0xebc6('0x43')][_0xebc6('0x30')]);}_0x4d7c18[_0xebc6('0x4c')]=qs[_0xebc6('0x4d')](_0x2b1358[_0xebc6('0x43')]['sort']);_0x4d7c18['where']=qs['filters'](_[_0xebc6('0x4e')](_0x2b1358[_0xebc6('0x43')],_0x4bc13c[_0xebc6('0x45')]),_0x29930c);if(_0x2b1358[_0xebc6('0x43')][_0xebc6('0x4f')]){_0x4d7c18[_0xebc6('0x50')]=_['merge'](_0x4d7c18[_0xebc6('0x50')],{'$or':_[_0xebc6('0x42')](_0x29930c,function(_0x4d2154){if(_0x4d2154[_0xebc6('0x51')]!=='VIRTUAL'){var _0x5d5f71={};_0x5d5f71[_0x4d2154[_0xebc6('0x3c')]]={'$like':'%'+_0x2b1358[_0xebc6('0x43')][_0xebc6('0x4f')]+'%'};return _0x5d5f71;}})});}_0x4d7c18=_[_0xebc6('0x52')]({},_0x4d7c18,_0x2b1358[_0xebc6('0x53')]);var _0x2c471f={'where':_0x4d7c18[_0xebc6('0x50')]};return db['FaxMessage'][_0xebc6('0x33')](_0x2c471f)[_0xebc6('0x3a')](function(_0x2ec90f){_0x2bef63[_0xebc6('0x33')]=_0x2ec90f;if(_0x2b1358['query'][_0xebc6('0x54')]){_0x4d7c18['include']=[{'all':!![]}];}return db[_0xebc6('0x3e')][_0xebc6('0x55')](_0x4d7c18);})['then'](function(_0x4c8e8a){_0x2bef63['rows']=_0x4c8e8a;return _0x2bef63;})[_0xebc6('0x3a')](respondWithFilteredResult(_0x50823a,_0x4d7c18))['catch'](handleError(_0x50823a,null));};exports[_0xebc6('0x56')]=function(_0x16ad1c,_0x6f9aa6){var _0x3c4f2a={'raw':!![],'where':{'id':_0x16ad1c['params']['id']}},_0x875360={};_0x875360[_0xebc6('0x41')]=_[_0xebc6('0x44')](db[_0xebc6('0x3e')][_0xebc6('0x3f')]);_0x875360[_0xebc6('0x43')]=_['keys'](_0x16ad1c['query']);_0x875360[_0xebc6('0x45')]=_['intersection'](_0x875360[_0xebc6('0x41')],_0x875360[_0xebc6('0x43')]);_0x3c4f2a[_0xebc6('0x47')]=_[_0xebc6('0x46')](_0x875360[_0xebc6('0x41')],qs[_0xebc6('0x48')](_0x16ad1c[_0xebc6('0x43')]['fields']));_0x3c4f2a['attributes']=_0x3c4f2a[_0xebc6('0x47')]['length']?_0x3c4f2a[_0xebc6('0x47')]:_0x875360[_0xebc6('0x41')];if(_0x16ad1c[_0xebc6('0x43')][_0xebc6('0x54')]){_0x3c4f2a[_0xebc6('0x57')]=[{'all':!![]}];}_0x3c4f2a=_[_0xebc6('0x52')]({},_0x3c4f2a,_0x16ad1c[_0xebc6('0x53')]);return db[_0xebc6('0x3e')][_0xebc6('0x58')](_0x3c4f2a)[_0xebc6('0x3a')](handleEntityNotFound(_0x6f9aa6,null))[_0xebc6('0x3a')](respondWithResult(_0x6f9aa6,null))[_0xebc6('0x2b')](handleError(_0x6f9aa6,null));};exports[_0xebc6('0x39')]=function(_0x1ec3a7,_0x572c0b){if(_0x1ec3a7[_0xebc6('0x59')]['id']){delete _0x1ec3a7[_0xebc6('0x59')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x1ec3a7['params']['id']}})[_0xebc6('0x3a')](handleEntityNotFound(_0x572c0b,null))['then'](saveUpdates(_0x1ec3a7[_0xebc6('0x59')],null))['then'](respondWithResult(_0x572c0b,null))[_0xebc6('0x2b')](handleError(_0x572c0b,null));};exports[_0xebc6('0x5a')]=function(_0x58b015,_0x49a6f0){return db['FaxMessage'][_0xebc6('0x58')]({'where':{'id':_0x58b015[_0xebc6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x49a6f0,null))[_0xebc6('0x3a')](removeEntity(_0x49a6f0,null))['catch'](handleError(_0x49a6f0,null));};exports[_0xebc6('0x5c')]=function(_0xe12fc2,_0x53e517){return db[_0xebc6('0x3e')]['describe']()[_0xebc6('0x3a')](respondWithResult(_0x53e517,null))[_0xebc6('0x2b')](handleError(_0x53e517,null));};var interaction_log=require('../../config/logger')(_0xebc6('0x5d'));exports[_0xebc6('0x5e')]=function(_0x595bb9,_0x30f622,_0x1d9844){var _0x1ee6f4={'agent':{},'channel':_0xebc6('0x5f')};if(_0x595bb9['body']['id']){delete _0x595bb9[_0xebc6('0x59')]['id'];}_0x595bb9[_0xebc6('0x59')]['read']=!![];_0x595bb9[_0xebc6('0x59')][_0xebc6('0x60')]=moment()[_0xebc6('0x61')](_0xebc6('0x62'));_0x595bb9[_0xebc6('0x59')][_0xebc6('0x63')]=_0x595bb9[_0xebc6('0x59')][_0xebc6('0x63')]||_0x595bb9[_0xebc6('0x64')]['id'];_0x1ee6f4[_0xebc6('0x65')]['id']=_0x595bb9[_0xebc6('0x59')][_0xebc6('0x63')];return db[_0xebc6('0x3e')][_0xebc6('0x58')]({'where':{'id':_0x595bb9['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30f622,null))[_0xebc6('0x3a')](saveUpdates(_0x595bb9[_0xebc6('0x59')],null))['then'](function(_0x51c5a6){if(_0x51c5a6){_0x1ee6f4[_0xebc6('0x2a')]=_0x51c5a6['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x51c5a6[_0xebc6('0x66')]}});}return null;})[_0xebc6('0x3a')](handleEntityNotFound(_0x30f622,null))[_0xebc6('0x3a')](function(_0x5dae65){if(_0x5dae65){return _0x5dae65[_0xebc6('0x39')]({'UserId':_0x595bb9[_0xebc6('0x59')][_0xebc6('0x63')],'read1stAt':_[_0xebc6('0x67')](_0x5dae65['read1stAt'])?moment()[_0xebc6('0x61')](_0xebc6('0x62')):undefined});}return null;})[_0xebc6('0x3a')](function(_0x1eb910){if(_0x1eb910){_0x1ee6f4['interaction']=_0x1eb910['get']({'plain':!![]});interaction_log[_0xebc6('0x24')](_0xebc6('0x68'),_0x595bb9['user']['id'],_0x595bb9[_0xebc6('0x64')]['name'],_0x595bb9[_0xebc6('0x64')][_0xebc6('0x69')],_0x1ee6f4[_0xebc6('0x6a')]['id'],_0x595bb9[_0xebc6('0x59')]?JSON[_0xebc6('0x28')](_0x595bb9['body']):_0xebc6('0x6b'));return respondWithRpcPromise(_0xebc6('0x6c'),_0xebc6('0x6d'),_0x1ee6f4);}return null;})[_0xebc6('0x3a')](function(_0xd27071){var _0x4afdab=_0xebc6('0x6e')+_0xd27071['message'][_0xebc6('0x6f')];return db[_0xebc6('0x70')][_0xebc6('0x43')](_0x4afdab,{'type':db[_0xebc6('0x71')][_0xebc6('0x72')]['SELECT'],'raw':!![]})[_0xebc6('0x3a')](function(_0x367803){return _0x367803;});})['then'](function(_0x4eeae1){if(_0x4eeae1){_0x1ee6f4[_0xebc6('0x2a')]['contact']=_0x4eeae1[0x0];if(!_0x595bb9[_0xebc6('0x59')][_0xebc6('0x63')])return;return db[_0xebc6('0x73')][_0xebc6('0x58')]({'where':{'id':_0x595bb9['body']['UserId'],'role':_0xebc6('0x65')},'attributes':['id','name',_0xebc6('0x74'),_0xebc6('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf7b48a){if(!_0xf7b48a)return null;_0x1ee6f4[_0xebc6('0x2a')][_0xebc6('0x65')]=_0xf7b48a;return _0x1ee6f4;})[_0xebc6('0x3a')](function(_0x196b9b){if(_0x196b9b){if(_0x595bb9[_0xebc6('0x59')][_0xebc6('0x76')]){_0x1ee6f4[_0xebc6('0x2a')][_0xebc6('0x77')]=util['format'](_0xebc6('0x78'),_0x595bb9['user'][_0xebc6('0x3c')]);_0x1ee6f4[_0xebc6('0x2a')]['channel']=_0x1ee6f4['channel'];_0x1ee6f4[_0xebc6('0x2a')][_0xebc6('0x79')]=_0x1ee6f4['channel'];_0x1ee6f4[_0xebc6('0x2a')]['event']=_0xebc6('0x5e');return respondWithRpcPromise(_0xebc6('0x7a'),_0xebc6('0x7a'),{'event':_0xebc6('0x7b'),'message':_0x1ee6f4[_0xebc6('0x2a')]},client9002)['then'](function(){return _0x1ee6f4;});}return _0x1ee6f4;}return null;})['then'](respondWithResult(_0x30f622,null))[_0xebc6('0x2b')](handleError(_0x30f622,null));};var interaction_log=require(_0xebc6('0x16'))(_0xebc6('0x5d'));exports['reject']=function(_0x5c23ee,_0x4992d9,_0xca2e14){var _0x595f45={'agent':{},'channel':_0xebc6('0x5f')};if(_0x5c23ee['body']['id']){delete _0x5c23ee[_0xebc6('0x59')]['id'];}_0x5c23ee[_0xebc6('0x59')]['UserId']=_0x5c23ee[_0xebc6('0x59')][_0xebc6('0x63')]||_0x5c23ee['user']['id'];_0x595f45[_0xebc6('0x65')]['id']=_0x5c23ee['body'][_0xebc6('0x63')];return db[_0xebc6('0x3e')][_0xebc6('0x58')]({'where':{'id':_0x5c23ee[_0xebc6('0x5b')]['id'],'UserId':null}})[_0xebc6('0x3a')](handleEntityNotFound(_0x4992d9,null))[_0xebc6('0x3a')](function(_0x58fea5){if(_0x58fea5){_0x595f45[_0xebc6('0x2a')]=_0x58fea5[_0xebc6('0x7c')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x58fea5['FaxInteractionId']}});}return null;})[_0xebc6('0x3a')](handleEntityNotFound(_0x4992d9,null))[_0xebc6('0x3a')](function(_0x1b6835){if(_0x1b6835){_0x595f45[_0xebc6('0x6a')]=_0x1b6835['get']({'plain':!![]});interaction_log['info'](_0xebc6('0x7d'),_0x5c23ee[_0xebc6('0x64')]['id'],_0x5c23ee[_0xebc6('0x64')][_0xebc6('0x3c')],_0x5c23ee['user'][_0xebc6('0x69')],_0x595f45['interaction']['id'],_0x5c23ee[_0xebc6('0x59')]?JSON[_0xebc6('0x28')](_0x5c23ee[_0xebc6('0x59')]):_0xebc6('0x6b'));return respondWithRpcPromise(_0xebc6('0x7e'),_0xebc6('0x7f'),_0x595f45);}return null;})[_0xebc6('0x3a')](function(_0x516202){var _0x167d8a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x516202[_0xebc6('0x2a')][_0xebc6('0x6f')];return db[_0xebc6('0x70')][_0xebc6('0x43')](_0x167d8a,{'type':db[_0xebc6('0x71')][_0xebc6('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x36c72c){return _0x36c72c;});})[_0xebc6('0x3a')](function(_0x1d7683){if(_0x1d7683){_0x595f45[_0xebc6('0x2a')][_0xebc6('0x80')]=_0x1d7683[0x0];if(!_0x5c23ee[_0xebc6('0x59')][_0xebc6('0x63')])return;return db[_0xebc6('0x73')][_0xebc6('0x58')]({'where':{'id':_0x5c23ee[_0xebc6('0x59')][_0xebc6('0x63')],'role':_0xebc6('0x65')},'attributes':['id',_0xebc6('0x3c'),_0xebc6('0x74'),'email',_0xebc6('0x81')],'raw':!![]});}return null;})[_0xebc6('0x3a')](function(_0x18d9d0){if(!_0x18d9d0)return null;_0x595f45[_0xebc6('0x2a')][_0xebc6('0x65')]=_0x18d9d0;return _0x595f45;})[_0xebc6('0x3a')](function(_0x5338c0){if(_0x5338c0){_0x5338c0[_0xebc6('0x2a')][_0xebc6('0x77')]=util['format'](_0xebc6('0x78'),_0x5c23ee[_0xebc6('0x64')][_0xebc6('0x3c')]);_0x5338c0['message'][_0xebc6('0x82')]=_0x595f45['channel'];_0x5338c0[_0xebc6('0x2a')][_0xebc6('0x79')]=_0x595f45[_0xebc6('0x82')];_0x5338c0['message'][_0xebc6('0x83')]='reject';respondWithRpcPromise(_0xebc6('0x7a'),_0xebc6('0x7a'),{'event':_0xebc6('0x84'),'message':_0x5338c0[_0xebc6('0x2a')]},client9002);return _0x595f45;}return null;})[_0xebc6('0x3a')](respondWithResult(_0x4992d9,null))[_0xebc6('0x2b')](handleError(_0x4992d9,null));};exports[_0xebc6('0x85')]=function(_0x44a35a,_0x198e7a){var _0x3bcd7c;return db[_0xebc6('0x3e')][_0xebc6('0x85')](_0x44a35a['body'],{})[_0xebc6('0x3a')](function(_0x1221a6){_0x3bcd7c=_0x1221a6;return db['CmContact'][_0xebc6('0x86')]({'where':{'id':_0x3bcd7c[_0xebc6('0x6f')]}});})[_0xebc6('0x3a')](function(_0x42b107){if(_[_0xebc6('0x67')](_0x42b107)){return;}else{_0x3bcd7c[_0xebc6('0x5f')]=_0x42b107['fax'];return db['Attachment']['findOne']({'where':{'id':_0x3bcd7c[_0xebc6('0x87')]}});}})['then'](function(_0x3d888d){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x44a35a[_0xebc6('0x59')])?undefined:_0x44a35a[_0xebc6('0x59')][_0xebc6('0x88')],'path':_[_0xebc6('0x67')](_0x3d888d)?undefined:util[_0xebc6('0x61')](_0xebc6('0x89'),_0x3d888d[_0xebc6('0x8a')]),'fax':_['isNil'](_0x3bcd7c[_0xebc6('0x5f')])?undefined:_0x3bcd7c[_0xebc6('0x5f')],'AttachmentId':_0x3bcd7c[_0xebc6('0x87')]},client9002);})[_0xebc6('0x3a')](respondWithResult(_0x198e7a,0xc9))[_0xebc6('0x2b')](handleError(_0x198e7a,null));};exports[_0xebc6('0x8b')]=function(_0x476706,_0x5e0b73){var _0x30484e=path[_0xebc6('0x8c')](config[_0xebc6('0x8d')],_0xebc6('0x8e'),'files',_0xebc6('0x8f'));return db[_0xebc6('0x3e')][_0xebc6('0x58')]({'where':{'id':_0x476706[_0xebc6('0x5b')]['id']},'include':[{'model':db[_0xebc6('0x90')],'as':_0xebc6('0x90')}]})[_0xebc6('0x3a')](handleEntityNotFound(_0x5e0b73,null))[_0xebc6('0x3a')](function(_0x19e73d){if(_0x19e73d){return _0x5e0b73[_0xebc6('0x8b')](path[_0xebc6('0x8c')](_0x30484e,_0x19e73d[_0xebc6('0x90')]['basename']));}})['catch'](handleError(_0x5e0b73,null));}; \ No newline at end of file +var _0x0c32=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','rows','show','params','keys','find','body','describe','../../config/logger','fax-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','channel','motionChannel','EventManager','fax','FaxInteractionId','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','SELECT','interface','event','rejectmessage','CmContact','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','Attachment','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x4dd9f1,_0x4933a0){var _0x396bff=function(_0x2df1b){while(--_0x2df1b){_0x4dd9f1['push'](_0x4dd9f1['shift']());}};_0x396bff(++_0x4933a0);}(_0x0c32,0x87));var _0x20c3=function(_0x3cd294,_0xbe58fb){_0x3cd294=_0x3cd294-0x0;var _0x10f600=_0x0c32[_0x3cd294];return _0x10f600;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20c3('0x0'));var zipdir=require(_0x20c3('0x1'));var jsonpatch=require(_0x20c3('0x2'));var rp=require(_0x20c3('0x3'));var moment=require(_0x20c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x20c3('0x5'));var util=require(_0x20c3('0x6'));var path=require(_0x20c3('0x7'));var sox=require(_0x20c3('0x8'));var csv=require(_0x20c3('0x9'));var ejs=require(_0x20c3('0xa'));var fs=require('fs');var fs_extra=require(_0x20c3('0xb'));var _=require('lodash');var squel=require(_0x20c3('0xc'));var crypto=require(_0x20c3('0xd'));var jsforce=require(_0x20c3('0xe'));var deskjs=require(_0x20c3('0xf'));var toCsv=require(_0x20c3('0x9'));var querystring=require(_0x20c3('0x10'));var Papa=require('papaparse');var Redis=require(_0x20c3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x20c3('0x12'));var hardwareService=require(_0x20c3('0x13'));var logger=require('../../config/logger')(_0x20c3('0x14'));var utils=require(_0x20c3('0x15'));var config=require(_0x20c3('0x16'));var licenseUtil=require(_0x20c3('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x20c3('0x18')],{'host':_0x20c3('0x19'),'port':0x18eb});var socket=require(_0x20c3('0x1a'))(new Redis(config[_0x20c3('0x18')]));require(_0x20c3('0x1b'))[_0x20c3('0x1c')](socket);var jayson=require(_0x20c3('0x1d'));var client=jayson['client'][_0x20c3('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd2900d,_0x535bdf,_0x3cc6a2,_0x5e7772){return new BPromise(function(_0x116531,_0x1dc942){var _0x2b13f5=_0x5e7772||client;return _0x2b13f5[_0x20c3('0x1f')](_0xd2900d,_0x3cc6a2)[_0x20c3('0x20')](function(_0x3656ba){logger[_0x20c3('0x21')](_0x20c3('0x22'),_0x535bdf,_0x20c3('0x23'));logger['debug'](_0x20c3('0x24'),_0x535bdf,_0x20c3('0x23'),JSON['stringify'](_0x3656ba));if(_0x3656ba[_0x20c3('0x25')]){if(_0x3656ba[_0x20c3('0x25')][_0x20c3('0x26')]===0x1f4){logger[_0x20c3('0x25')](_0x20c3('0x22'),_0x535bdf,_0x3656ba['error'][_0x20c3('0x27')]);return _0x1dc942(_0x3656ba['error'][_0x20c3('0x27')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x535bdf,_0x3656ba[_0x20c3('0x25')][_0x20c3('0x27')]);return _0x116531(_0x3656ba['error'][_0x20c3('0x27')]);}else{logger[_0x20c3('0x21')](_0x20c3('0x22'),_0x535bdf,_0x20c3('0x23'));_0x116531(_0x3656ba[_0x20c3('0x28')][_0x20c3('0x27')]);}})[_0x20c3('0x29')](function(_0x9e3a3c){logger['error'](_0x20c3('0x22'),_0x535bdf,_0x9e3a3c);_0x1dc942(_0x9e3a3c);});});}function respondWithStatusCode(_0x30a4a,_0x4d22a9){_0x4d22a9=_0x4d22a9||0xcc;return function(_0x3e5300){if(_0x3e5300){return _0x30a4a[_0x20c3('0x2a')](_0x4d22a9);}return _0x30a4a[_0x20c3('0x2b')](_0x4d22a9)[_0x20c3('0x2c')]();};}function respondWithResult(_0xc24516,_0xe528fa){_0xe528fa=_0xe528fa||0xc8;return function(_0x13a1ec){if(_0x13a1ec){return _0xc24516[_0x20c3('0x2b')](_0xe528fa)['json'](_0x13a1ec);}};}function respondWithFilteredResult(_0xfe2b31,_0x33fdd7){return function(_0x2c3355){if(_0x2c3355){var _0x36c85f=typeof _0x33fdd7[_0x20c3('0x2d')]===_0x20c3('0x2e')&&typeof _0x33fdd7[_0x20c3('0x2f')]==='undefined';var _0x3eaf15=_0x2c3355['count'];var _0x1d6c68=_0x36c85f?0x0:_0x33fdd7['offset'];var _0x38b058=_0x36c85f?_0x2c3355[_0x20c3('0x30')]:_0x33fdd7[_0x20c3('0x2d')]+_0x33fdd7[_0x20c3('0x2f')];var _0x5b6b5e;if(_0x38b058>=_0x3eaf15){_0x38b058=_0x3eaf15;_0x5b6b5e=0xc8;}else{_0x5b6b5e=0xce;}_0xfe2b31[_0x20c3('0x2b')](_0x5b6b5e);return _0xfe2b31[_0x20c3('0x31')](_0x20c3('0x32'),_0x1d6c68+'-'+_0x38b058+'/'+_0x3eaf15)[_0x20c3('0x33')](_0x2c3355);}return null;};}function patchUpdates(_0x2b8144){return function(_0x5385ce){try{jsonpatch[_0x20c3('0x34')](_0x5385ce,_0x2b8144,!![]);}catch(_0x7831ed){return BPromise[_0x20c3('0x35')](_0x7831ed);}return _0x5385ce[_0x20c3('0x36')]();};}function saveUpdates(_0x19f552,_0x2d900f){return function(_0x5e2c52){if(_0x5e2c52){return _0x5e2c52[_0x20c3('0x37')](_0x19f552)[_0x20c3('0x20')](function(_0x3c14da){return _0x3c14da;});}return null;};}function removeEntity(_0x2ffc4c,_0xcabe65){return function(_0x19220d){if(_0x19220d){return _0x19220d[_0x20c3('0x38')]()['then'](function(){_0x2ffc4c[_0x20c3('0x2b')](0xcc)[_0x20c3('0x2c')]();});}};}function handleEntityNotFound(_0x4b7f8c,_0x4349d7){return function(_0x566198){if(!_0x566198){_0x4b7f8c[_0x20c3('0x2a')](0x194);}return _0x566198;};}function handleError(_0x38b1b7,_0x1bcc7c){_0x1bcc7c=_0x1bcc7c||0x1f4;return function(_0x6807af){logger[_0x20c3('0x25')](_0x6807af[_0x20c3('0x39')]);if(_0x6807af[_0x20c3('0x3a')]){delete _0x6807af[_0x20c3('0x3a')];}_0x38b1b7[_0x20c3('0x2b')](_0x1bcc7c)['send'](_0x6807af);};}exports['index']=function(_0x372953,_0x1d3de6){var _0x3bd565={},_0x216237={},_0x18fed9={'count':0x0,'rows':[]};var _0x1d24a2=_[_0x20c3('0x3b')](db['FaxMessage'][_0x20c3('0x3c')],function(_0x387e71){return{'name':_0x387e71[_0x20c3('0x3d')],'type':_0x387e71[_0x20c3('0x3e')]['key']};});_0x216237[_0x20c3('0x3f')]=_[_0x20c3('0x3b')](_0x1d24a2,_0x20c3('0x3a'));_0x216237[_0x20c3('0x40')]=_['keys'](_0x372953[_0x20c3('0x40')]);_0x216237[_0x20c3('0x41')]=_[_0x20c3('0x42')](_0x216237[_0x20c3('0x3f')],_0x216237[_0x20c3('0x40')]);_0x3bd565['attributes']=_[_0x20c3('0x42')](_0x216237[_0x20c3('0x3f')],qs[_0x20c3('0x43')](_0x372953['query'][_0x20c3('0x43')]));_0x3bd565[_0x20c3('0x44')]=_0x3bd565[_0x20c3('0x44')][_0x20c3('0x45')]?_0x3bd565[_0x20c3('0x44')]:_0x216237['model'];if(!_0x372953[_0x20c3('0x40')][_0x20c3('0x46')](_0x20c3('0x47'))){_0x3bd565['limit']=qs[_0x20c3('0x2f')](_0x372953[_0x20c3('0x40')][_0x20c3('0x2f')]);_0x3bd565[_0x20c3('0x2d')]=qs[_0x20c3('0x2d')](_0x372953[_0x20c3('0x40')][_0x20c3('0x2d')]);}_0x3bd565['order']=qs[_0x20c3('0x48')](_0x372953[_0x20c3('0x40')]['sort']);_0x3bd565[_0x20c3('0x49')]=qs[_0x20c3('0x41')](_[_0x20c3('0x4a')](_0x372953[_0x20c3('0x40')],_0x216237[_0x20c3('0x41')]),_0x1d24a2);if(_0x372953[_0x20c3('0x40')]['filter']){_0x3bd565['where']=_[_0x20c3('0x4b')](_0x3bd565['where'],{'$or':_[_0x20c3('0x3b')](_0x1d24a2,function(_0x517670){if(_0x517670['type']!==_0x20c3('0x4c')){var _0x398f9d={};_0x398f9d[_0x517670[_0x20c3('0x3a')]]={'$like':'%'+_0x372953[_0x20c3('0x40')][_0x20c3('0x4d')]+'%'};return _0x398f9d;}})});}_0x3bd565=_[_0x20c3('0x4b')]({},_0x3bd565,_0x372953[_0x20c3('0x4e')]);var _0x30c64c={'where':_0x3bd565[_0x20c3('0x49')]};return db[_0x20c3('0x4f')][_0x20c3('0x30')](_0x30c64c)[_0x20c3('0x20')](function(_0x243ead){_0x18fed9['count']=_0x243ead;if(_0x372953['query'][_0x20c3('0x50')]){_0x3bd565[_0x20c3('0x51')]=[{'all':!![]}];}return db[_0x20c3('0x4f')]['findAll'](_0x3bd565);})[_0x20c3('0x20')](function(_0x1c363f){_0x18fed9[_0x20c3('0x52')]=_0x1c363f;return _0x18fed9;})['then'](respondWithFilteredResult(_0x1d3de6,_0x3bd565))[_0x20c3('0x29')](handleError(_0x1d3de6,null));};exports[_0x20c3('0x53')]=function(_0x4e1c74,_0x1e53e1){var _0x3e929e={'raw':!![],'where':{'id':_0x4e1c74[_0x20c3('0x54')]['id']}},_0x2b7a86={};_0x2b7a86[_0x20c3('0x3f')]=_[_0x20c3('0x55')](db[_0x20c3('0x4f')][_0x20c3('0x3c')]);_0x2b7a86[_0x20c3('0x40')]=_[_0x20c3('0x55')](_0x4e1c74['query']);_0x2b7a86[_0x20c3('0x41')]=_['intersection'](_0x2b7a86[_0x20c3('0x3f')],_0x2b7a86[_0x20c3('0x40')]);_0x3e929e['attributes']=_[_0x20c3('0x42')](_0x2b7a86[_0x20c3('0x3f')],qs[_0x20c3('0x43')](_0x4e1c74['query']['fields']));_0x3e929e['attributes']=_0x3e929e['attributes'][_0x20c3('0x45')]?_0x3e929e[_0x20c3('0x44')]:_0x2b7a86[_0x20c3('0x3f')];if(_0x4e1c74['query']['includeAll']){_0x3e929e[_0x20c3('0x51')]=[{'all':!![]}];}_0x3e929e=_['merge']({},_0x3e929e,_0x4e1c74[_0x20c3('0x4e')]);return db[_0x20c3('0x4f')][_0x20c3('0x56')](_0x3e929e)[_0x20c3('0x20')](handleEntityNotFound(_0x1e53e1,null))[_0x20c3('0x20')](respondWithResult(_0x1e53e1,null))[_0x20c3('0x29')](handleError(_0x1e53e1,null));};exports[_0x20c3('0x37')]=function(_0x31e181,_0xd44401){if(_0x31e181[_0x20c3('0x57')]['id']){delete _0x31e181[_0x20c3('0x57')]['id'];}return db[_0x20c3('0x4f')][_0x20c3('0x56')]({'where':{'id':_0x31e181['params']['id']}})['then'](handleEntityNotFound(_0xd44401,null))['then'](saveUpdates(_0x31e181[_0x20c3('0x57')],null))[_0x20c3('0x20')](respondWithResult(_0xd44401,null))[_0x20c3('0x29')](handleError(_0xd44401,null));};exports[_0x20c3('0x38')]=function(_0x365c5e,_0x4a1bc2){return db['FaxMessage'][_0x20c3('0x56')]({'where':{'id':_0x365c5e['params']['id']}})['then'](handleEntityNotFound(_0x4a1bc2,null))[_0x20c3('0x20')](removeEntity(_0x4a1bc2,null))[_0x20c3('0x29')](handleError(_0x4a1bc2,null));};exports[_0x20c3('0x58')]=function(_0x367cfb,_0x4ed486){return db[_0x20c3('0x4f')][_0x20c3('0x58')]()['then'](respondWithResult(_0x4ed486,null))['catch'](handleError(_0x4ed486,null));};var interaction_log=require(_0x20c3('0x59'))(_0x20c3('0x5a'));exports[_0x20c3('0x5b')]=function(_0x5d1c07,_0x4dd208,_0x21c7b8){var _0x5eb983={'agent':{},'channel':'fax'};if(_0x5d1c07[_0x20c3('0x57')]['id']){delete _0x5d1c07['body']['id'];}_0x5d1c07['body'][_0x20c3('0x5c')]=!![];_0x5d1c07[_0x20c3('0x57')]['readAt']=moment()['format'](_0x20c3('0x5d'));_0x5d1c07[_0x20c3('0x57')][_0x20c3('0x5e')]=_0x5d1c07['body'][_0x20c3('0x5e')]||_0x5d1c07[_0x20c3('0x5f')]['id'];_0x5eb983[_0x20c3('0x60')]['id']=_0x5d1c07[_0x20c3('0x57')][_0x20c3('0x5e')];return db['FaxMessage'][_0x20c3('0x56')]({'where':{'id':_0x5d1c07['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4dd208,null))['then'](saveUpdates(_0x5d1c07[_0x20c3('0x57')],null))[_0x20c3('0x20')](function(_0x1ebb21){if(_0x1ebb21){_0x5eb983['message']=_0x1ebb21[_0x20c3('0x61')]({'plain':!![]});return db[_0x20c3('0x62')][_0x20c3('0x56')]({'where':{'id':_0x1ebb21['FaxInteractionId']}});}return null;})[_0x20c3('0x20')](handleEntityNotFound(_0x4dd208,null))[_0x20c3('0x20')](function(_0x38b19f){if(_0x38b19f){return _0x38b19f[_0x20c3('0x37')]({'UserId':_0x5d1c07['body'][_0x20c3('0x5e')],'read1stAt':_[_0x20c3('0x63')](_0x38b19f[_0x20c3('0x64')])?moment()[_0x20c3('0x65')](_0x20c3('0x5d')):undefined});}return null;})[_0x20c3('0x20')](function(_0x5c5841){if(_0x5c5841){_0x5eb983['interaction']=_0x5c5841['get']({'plain':!![]});interaction_log[_0x20c3('0x21')](_0x20c3('0x66'),_0x5d1c07[_0x20c3('0x5f')]['id'],_0x5d1c07['user'][_0x20c3('0x3a')],_0x5d1c07['user'][_0x20c3('0x67')],_0x5eb983['interaction']['id'],_0x5d1c07[_0x20c3('0x57')]?JSON[_0x20c3('0x68')](_0x5d1c07[_0x20c3('0x57')]):_0x20c3('0x69'));return respondWithRpcPromise(_0x20c3('0x6a'),'acceptMessage',_0x5eb983);}return null;})[_0x20c3('0x20')](function(_0x3b9270){var _0x4342c2=_0x20c3('0x6b')+_0x3b9270[_0x20c3('0x27')]['ContactId'];return db[_0x20c3('0x6c')][_0x20c3('0x40')](_0x4342c2,{'type':db['Sequelize'][_0x20c3('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5a5222){return _0x5a5222;});})[_0x20c3('0x20')](function(_0x4208ea){if(_0x4208ea){_0x5eb983[_0x20c3('0x27')][_0x20c3('0x6e')]=_0x4208ea[0x0];if(!_0x5d1c07['body'][_0x20c3('0x5e')])return;return db[_0x20c3('0x6f')]['find']({'where':{'id':_0x5d1c07[_0x20c3('0x57')]['UserId'],'role':_0x20c3('0x60')},'attributes':['id',_0x20c3('0x3a'),_0x20c3('0x70'),_0x20c3('0x71'),_0x20c3('0x72')],'raw':!![]});}return null;})[_0x20c3('0x20')](function(_0x1c04b4){if(!_0x1c04b4)return null;_0x5eb983[_0x20c3('0x27')][_0x20c3('0x60')]=_0x1c04b4;return _0x5eb983;})['then'](function(_0x1082e8){if(_0x1082e8){if(_0x5d1c07[_0x20c3('0x57')][_0x20c3('0x73')]){_0x5eb983[_0x20c3('0x27')]['interface']=util[_0x20c3('0x65')]('SIP/%s',_0x5d1c07[_0x20c3('0x5f')][_0x20c3('0x3a')]);_0x5eb983[_0x20c3('0x27')]['channel']=_0x5eb983[_0x20c3('0x74')];_0x5eb983[_0x20c3('0x27')][_0x20c3('0x75')]=_0x5eb983['channel'];_0x5eb983[_0x20c3('0x27')]['event']='accept';return respondWithRpcPromise('EventManager',_0x20c3('0x76'),{'event':'acceptmessage','message':_0x5eb983[_0x20c3('0x27')]},client9002)[_0x20c3('0x20')](function(){return _0x5eb983;});}return _0x5eb983;}return null;})['then'](respondWithResult(_0x4dd208,null))[_0x20c3('0x29')](handleError(_0x4dd208,null));};var interaction_log=require(_0x20c3('0x59'))('fax-interactions');exports[_0x20c3('0x35')]=function(_0x4921f7,_0x525557,_0x275c23){var _0x1c30f6={'agent':{},'channel':_0x20c3('0x77')};if(_0x4921f7[_0x20c3('0x57')]['id']){delete _0x4921f7['body']['id'];}_0x4921f7[_0x20c3('0x57')]['UserId']=_0x4921f7['body']['UserId']||_0x4921f7[_0x20c3('0x5f')]['id'];_0x1c30f6[_0x20c3('0x60')]['id']=_0x4921f7[_0x20c3('0x57')][_0x20c3('0x5e')];return db[_0x20c3('0x4f')]['find']({'where':{'id':_0x4921f7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x525557,null))['then'](function(_0x35e7ec){if(_0x35e7ec){_0x1c30f6['message']=_0x35e7ec[_0x20c3('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x20c3('0x56')]({'where':{'id':_0x35e7ec[_0x20c3('0x78')]}});}return null;})[_0x20c3('0x20')](handleEntityNotFound(_0x525557,null))[_0x20c3('0x20')](function(_0x1ad819){if(_0x1ad819){_0x1c30f6[_0x20c3('0x79')]=_0x1ad819[_0x20c3('0x61')]({'plain':!![]});interaction_log[_0x20c3('0x21')](_0x20c3('0x7a'),_0x4921f7[_0x20c3('0x5f')]['id'],_0x4921f7[_0x20c3('0x5f')][_0x20c3('0x3a')],_0x4921f7['user'][_0x20c3('0x67')],_0x1c30f6['interaction']['id'],_0x4921f7[_0x20c3('0x57')]?JSON[_0x20c3('0x68')](_0x4921f7[_0x20c3('0x57')]):'null');return respondWithRpcPromise(_0x20c3('0x7b'),_0x20c3('0x7c'),_0x1c30f6);}return null;})['then'](function(_0x3ccd35){var _0x2aa708=_0x20c3('0x6b')+_0x3ccd35[_0x20c3('0x27')][_0x20c3('0x7d')];return db[_0x20c3('0x6c')]['query'](_0x2aa708,{'type':db[_0x20c3('0x7e')][_0x20c3('0x6d')][_0x20c3('0x7f')],'raw':!![]})[_0x20c3('0x20')](function(_0x23e27){return _0x23e27;});})['then'](function(_0x176e97){if(_0x176e97){_0x1c30f6[_0x20c3('0x27')]['contact']=_0x176e97[0x0];if(!_0x4921f7['body']['UserId'])return;return db[_0x20c3('0x6f')][_0x20c3('0x56')]({'where':{'id':_0x4921f7[_0x20c3('0x57')][_0x20c3('0x5e')],'role':'agent'},'attributes':['id','name','fullname',_0x20c3('0x71'),'internal'],'raw':!![]});}return null;})[_0x20c3('0x20')](function(_0x243ce7){if(!_0x243ce7)return null;_0x1c30f6[_0x20c3('0x27')][_0x20c3('0x60')]=_0x243ce7;return _0x1c30f6;})['then'](function(_0x4c0571){if(_0x4c0571){_0x4c0571[_0x20c3('0x27')][_0x20c3('0x80')]=util[_0x20c3('0x65')]('SIP/%s',_0x4921f7['user'][_0x20c3('0x3a')]);_0x4c0571[_0x20c3('0x27')][_0x20c3('0x74')]=_0x1c30f6[_0x20c3('0x74')];_0x4c0571[_0x20c3('0x27')][_0x20c3('0x75')]=_0x1c30f6[_0x20c3('0x74')];_0x4c0571[_0x20c3('0x27')][_0x20c3('0x81')]=_0x20c3('0x35');respondWithRpcPromise(_0x20c3('0x76'),_0x20c3('0x76'),{'event':_0x20c3('0x82'),'message':_0x4c0571[_0x20c3('0x27')]},client9002);return _0x1c30f6;}return null;})[_0x20c3('0x20')](respondWithResult(_0x525557,null))[_0x20c3('0x29')](handleError(_0x525557,null));};exports['create']=function(_0xc6aef,_0x42182b){var _0x108cea;return db[_0x20c3('0x4f')]['create'](_0xc6aef[_0x20c3('0x57')],{})[_0x20c3('0x20')](function(_0xffacc5){_0x108cea=_0xffacc5;return db[_0x20c3('0x83')]['findOne']({'where':{'id':_0x108cea[_0x20c3('0x7d')]}});})[_0x20c3('0x20')](function(_0xa51b98){if(_[_0x20c3('0x63')](_0xa51b98)){return;}else{_0x108cea[_0x20c3('0x77')]=_0xa51b98['fax'];return db['Attachment'][_0x20c3('0x84')]({'where':{'id':_0x108cea[_0x20c3('0x85')]}});}})[_0x20c3('0x20')](function(_0x11531c){return respondWithRpcPromise(_0x20c3('0x86'),_0x20c3('0x86'),{'FaxAccountId':_[_0x20c3('0x63')](_0xc6aef[_0x20c3('0x57')])?undefined:_0xc6aef[_0x20c3('0x57')]['FaxAccountId'],'path':_[_0x20c3('0x63')](_0x11531c)?undefined:util[_0x20c3('0x65')](_0x20c3('0x87'),_0x11531c[_0x20c3('0x88')]),'fax':_[_0x20c3('0x63')](_0x108cea[_0x20c3('0x77')])?undefined:_0x108cea[_0x20c3('0x77')],'AttachmentId':_0x108cea[_0x20c3('0x85')]},client9002);})[_0x20c3('0x20')](respondWithResult(_0x42182b,0xc9))[_0x20c3('0x29')](handleError(_0x42182b,null));};exports[_0x20c3('0x89')]=function(_0x1a989f,_0x526713){var _0x3a75a3=path['join'](config[_0x20c3('0x8a')],_0x20c3('0x8b'),_0x20c3('0x8c'),_0x20c3('0x8d'));return db['FaxMessage'][_0x20c3('0x56')]({'where':{'id':_0x1a989f['params']['id']},'include':[{'model':db[_0x20c3('0x8e')],'as':_0x20c3('0x8e')}]})[_0x20c3('0x20')](handleEntityNotFound(_0x526713,null))[_0x20c3('0x20')](function(_0x88b673){if(_0x88b673){return _0x526713['download'](path[_0x20c3('0x8f')](_0x3a75a3,_0x88b673[_0x20c3('0x8e')][_0x20c3('0x88')]));}})['catch'](handleError(_0x526713,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 216256e..f56114b 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 _0xf2e3=['remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xf2e3[_0x12f688];return _0x59c3de;};'use strict';var EventEmitter=require(_0x3f2e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x3f2e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3f2e('0x2')](0x0);var events={'afterCreate':_0x3f2e('0x3'),'afterUpdate':_0x3f2e('0x4'),'afterDestroy':_0x3f2e('0x5')};function emitEvent(_0x1634cd){return function(_0x3938e2,_0xabcf5c,_0x216b26){FaxMessageEvents['emit'](_0x1634cd+':'+_0x3938e2['id'],_0x3938e2);FaxMessageEvents[_0x3f2e('0x6')](_0x1634cd,_0x3938e2);_0x216b26(null);};}for(var e in events){if(events[_0x3f2e('0x7')](e)){var event=events[e];FaxMessage[_0x3f2e('0x8')](e,emitEvent(event));}}module[_0x3f2e('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xbb67=['hook','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xbb67,0x161));var _0x7bb6=function(_0x49132e,_0x45232b){_0x49132e=_0x49132e-0x0;var _0x14fd86=_0xbb67[_0x49132e];return _0x14fd86;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7bb6('0x0'))['db'][_0x7bb6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7bb6('0x2')](0x0);var events={'afterCreate':_0x7bb6('0x3'),'afterUpdate':_0x7bb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33a5c4){return function(_0x2c1ddb,_0x1f527c,_0x7fb7c9){FaxMessageEvents[_0x7bb6('0x5')](_0x33a5c4+':'+_0x2c1ddb['id'],_0x2c1ddb);FaxMessageEvents[_0x7bb6('0x5')](_0x33a5c4,_0x2c1ddb);_0x7fb7c9(null);};}for(var e in events){if(events[_0x7bb6('0x6')](e)){var event=events[e];FaxMessage[_0x7bb6('0x7')](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 3f2c859..78b7a89 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 _0xace2=['moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x296782,_0x407742){var _0x2c8173=function(_0x23f99d){while(--_0x23f99d){_0x296782['push'](_0x296782['shift']());}};_0x2c8173(++_0x407742);}(_0xace2,0xb2));var _0x2ace=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0xace2[_0x2e6dee];return _0x47706;};'use strict';var _=require(_0x2ace('0x0'));var util=require('util');var logger=require(_0x2ace('0x1'))('api');var moment=require(_0x2ace('0x2'));var BPromise=require(_0x2ace('0x3'));var rp=require(_0x2ace('0x4'));var fs=require('fs');var path=require(_0x2ace('0x5'));var rimraf=require(_0x2ace('0x6'));var config=require('../../config/environment');var attributes=require(_0x2ace('0x7'));module[_0x2ace('0x8')]=function(_0x3bb7f4,_0x2b9772){return _0x3bb7f4[_0x2ace('0x9')](_0x2ace('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2ace('0xb'),'fields':[_0x2ace('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11a5a7,_0x5f4fd0,_0x44961e){var _0x505a50=_0x3bb7f4[_0x2ace('0xd')];var _0x41606b=_0x11a5a7[_0x2ace('0xe')]({'plain':!![]});if(_0x41606b[_0x2ace('0xf')][_0x2ace('0x10')]()==='in'||_0x41606b[_0x2ace('0xf')][_0x2ace('0x10')]()===_0x2ace('0x11')&&!_0x41606b[_0x2ace('0x12')]&&!_[_0x2ace('0x13')](_0x41606b[_0x2ace('0x14')])){_0x505a50[_0x2ace('0x15')][_0x2ace('0x16')]({'where':{'id':_0x41606b['FaxInteractionId']}})[_0x2ace('0x17')](function(_0x47aecf){if(_0x47aecf){_0x47aecf[_0x2ace('0x18')]({'lastMsgAt':_0x41606b[_0x2ace('0x19')],'lastMsgDirection':_0x41606b[_0x2ace('0xf')][_0x2ace('0x10')]()});}})[_0x2ace('0x1a')](function(_0x2d6559){console[_0x2ace('0x1b')](_0x2d6559);});}_0x44961e();}},'charset':_0x2ace('0x1c'),'collate':_0x2ace('0x1d')});}; \ No newline at end of file +var _0xc0b5=['FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x339c1e,_0x5e0abd){var _0x15bc87=function(_0x1b361a){while(--_0x1b361a){_0x339c1e['push'](_0x339c1e['shift']());}};_0x15bc87(++_0x5e0abd);}(_0xc0b5,0x191));var _0x5c0b=function(_0x5a79ff,_0x335f55){_0x5a79ff=_0x5a79ff-0x0;var _0x40833e=_0xc0b5[_0x5a79ff];return _0x40833e;};'use strict';var _=require(_0x5c0b('0x0'));var util=require('util');var logger=require(_0x5c0b('0x1'))(_0x5c0b('0x2'));var moment=require('moment');var BPromise=require(_0x5c0b('0x3'));var rp=require(_0x5c0b('0x4'));var fs=require('fs');var path=require(_0x5c0b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5c0b('0x6'));module[_0x5c0b('0x7')]=function(_0x5e66e6,_0x5c8a94){return _0x5e66e6[_0x5c0b('0x8')]('FaxMessage',attributes,{'tableName':_0x5c0b('0x9'),'paranoid':![],'indexes':[{'name':_0x5c0b('0xa'),'fields':['body'],'type':_0x5c0b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4abffa,_0x5d97d9,_0x43b0e3){var _0x4d09b2=_0x5e66e6['models'];var _0x2b8e9f=_0x4abffa[_0x5c0b('0xc')]({'plain':!![]});if(_0x2b8e9f[_0x5c0b('0xd')][_0x5c0b('0xe')]()==='in'||_0x2b8e9f[_0x5c0b('0xd')]['toLowerCase']()===_0x5c0b('0xf')&&!_0x2b8e9f[_0x5c0b('0x10')]&&!_[_0x5c0b('0x11')](_0x2b8e9f[_0x5c0b('0x12')])){_0x4d09b2[_0x5c0b('0x13')][_0x5c0b('0x14')]({'where':{'id':_0x2b8e9f[_0x5c0b('0x15')]}})[_0x5c0b('0x16')](function(_0x20656b){if(_0x20656b){_0x20656b[_0x5c0b('0x17')]({'lastMsgAt':_0x2b8e9f[_0x5c0b('0x18')],'lastMsgDirection':_0x2b8e9f['direction'][_0x5c0b('0xe')]()});}})[_0x5c0b('0x19')](function(_0x78fae3){console['error'](_0x78fae3);});}_0x43b0e3();}},'charset':_0x5c0b('0x1a'),'collate':_0x5c0b('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 841fdd2..0cc1a98 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(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'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 _0x8d0e=['http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2c5d65,_0x22b0e2){var _0x2a14ab=function(_0xd902d1){while(--_0xd902d1){_0x2c5d65['push'](_0x2c5d65['shift']());}};_0x2a14ab(++_0x22b0e2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1d86ea,_0x56330a){_0x1d86ea=_0x1d86ea-0x0;var _0x37a7a6=_0x8d0e[_0x1d86ea];return _0x37a7a6;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('FaxMessage,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});}exports[_0xe8d0('0x1a')]=function(_0x12ebf4){var _0x524b00=this;return new Promise(function(_0x5ce284,_0x554402){return db[_0xe8d0('0x1b')][_0xe8d0('0x1c')](_0x12ebf4[_0xe8d0('0x1d')],{'raw':_0x12ebf4[_0xe8d0('0x1e')]?_0x12ebf4[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![]})[_0xe8d0('0x11')](function(_0x28a6b5){logger[_0xe8d0('0x12')]('CreateFaxMessage',_0x12ebf4);logger[_0xe8d0('0x20')](_0xe8d0('0x1a'),_0x12ebf4,JSON['stringify'](_0x28a6b5));_0x5ce284(_0x28a6b5);})[_0xe8d0('0x19')](function(_0x2e69d1){logger[_0xe8d0('0x16')](_0xe8d0('0x1a'),_0x2e69d1[_0xe8d0('0x17')],_0x12ebf4);_0x554402(_0x524b00[_0xe8d0('0x16')](0x1f4,_0x2e69d1[_0xe8d0('0x17')]));});});};exports[_0xe8d0('0x21')]=function(_0xfa3527){var _0x2dee67=this;return new Promise(function(_0x264de4,_0x539548){return db[_0xe8d0('0x1b')][_0xe8d0('0x22')](_0xfa3527[_0xe8d0('0x1d')],{'raw':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x23')]||null:null,'attributes':_0xfa3527[_0xe8d0('0x1e')]?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x24')]||null:null,'limit':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')]['limit']||null:null})['then'](function(_0x50ad3c){logger[_0xe8d0('0x12')](_0xe8d0('0x21'),_0xfa3527);logger[_0xe8d0('0x20')]('UpdateFaxMessage',_0xfa3527,JSON['stringify'](_0x50ad3c));_0x264de4(_0x50ad3c);})[_0xe8d0('0x19')](function(_0x551999){logger[_0xe8d0('0x16')](_0xe8d0('0x21'),_0x551999[_0xe8d0('0x17')],_0xfa3527);_0x539548(_0x2dee67[_0xe8d0('0x16')](0x1f4,_0x551999[_0xe8d0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d1d06db..895d177 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 _0x41f2=['remove','update','emit','length','faxMessage:','./faxMessage.events','save'];(function(_0x556a4a,_0x3ad25b){var _0x4e4825=function(_0x1a0213){while(--_0x1a0213){_0x556a4a['push'](_0x556a4a['shift']());}};_0x4e4825(++_0x3ad25b);}(_0x41f2,0x186));var _0x241f=function(_0x349d64,_0x2819dd){_0x349d64=_0x349d64-0x0;var _0x589671=_0x41f2[_0x349d64];return _0x589671;};'use strict';var FaxMessageEvents=require(_0x241f('0x0'));var events=[_0x241f('0x1'),_0x241f('0x2'),_0x241f('0x3')];function createListener(_0xb9f9e,_0x36c42a){return function(_0x5552e5){_0x36c42a[_0x241f('0x4')](_0xb9f9e,_0x5552e5);};}function removeListener(_0x3ccb2e,_0x1efa91){return function(){FaxMessageEvents['removeListener'](_0x3ccb2e,_0x1efa91);};}exports['register']=function(_0x333198){for(var _0x1b0d90=0x0,_0x56c201=events[_0x241f('0x5')];_0x1b0d90<_0x56c201;_0x1b0d90++){var _0x1784a1=events[_0x1b0d90];var _0x3907f9=createListener(_0x241f('0x6')+_0x1784a1,_0x333198);FaxMessageEvents['on'](_0x1784a1,_0x3907f9);}}; \ No newline at end of file +var _0x462d=['removeListener','register','faxMessage:','save'];(function(_0x109f3d,_0x16ce86){var _0x1a39a8=function(_0x42ba5b){while(--_0x42ba5b){_0x109f3d['push'](_0x109f3d['shift']());}};_0x1a39a8(++_0x16ce86);}(_0x462d,0x1cf));var _0xd462=function(_0x3eeb2e,_0x45bd06){_0x3eeb2e=_0x3eeb2e-0x0;var _0x235f76=_0x462d[_0x3eeb2e];return _0x235f76;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xd462('0x0'),'remove','update'];function createListener(_0xaef6aa,_0x45c062){return function(_0x4b7cb9){_0x45c062['emit'](_0xaef6aa,_0x4b7cb9);};}function removeListener(_0x51ce1c,_0x385068){return function(){FaxMessageEvents[_0xd462('0x1')](_0x51ce1c,_0x385068);};}exports[_0xd462('0x2')]=function(_0x5d9085){for(var _0xa09610=0x0,_0x3b20ab=events['length'];_0xa09610<_0x3b20ab;_0xa09610++){var _0x41efe6=events[_0xa09610];var _0x1b15e6=createListener(_0xd462('0x3')+_0x41efe6,_0x5d9085);FaxMessageEvents['on'](_0x41efe6,_0x1b15e6);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3092429..e1dfdfa 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 _0x4e81=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','fs-extra'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x4e81[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14e8('0x3'));var auth=require(_0x14e8('0x4'));var interaction=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var controller=require(_0x14e8('0x7'));router[_0x14e8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14e8('0x8')](_0x14e8('0x9'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xb')]);router[_0x14e8('0x8')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xd')]);router[_0x14e8('0x8')]('/:id/download',auth[_0x14e8('0xa')](),controller[_0x14e8('0xe')]);router[_0x14e8('0xf')]('/',auth[_0x14e8('0xa')](),interaction[_0x14e8('0x10')](_0x14e8('0x11'),_0x14e8('0x12')),controller[_0x14e8('0x13')]);router['put'](_0x14e8('0xc'),auth['isAuthenticated'](),controller[_0x14e8('0x14')]);router[_0x14e8('0x15')](_0x14e8('0x16'),auth['isAuthenticated'](),controller[_0x14e8('0x17')]);router['put'](_0x14e8('0x18'),auth['isAuthenticated'](),controller[_0x14e8('0x19')]);router[_0x14e8('0x1a')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller['destroy']);module[_0x14e8('0x1b')]=router; \ No newline at end of file +var _0xee5b=['update','/:id/accept','accept','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id'];(function(_0x1ce52a,_0x368e5e){var _0x42d74e=function(_0xbda091){while(--_0xbda091){_0x1ce52a['push'](_0x1ce52a['shift']());}};_0x42d74e(++_0x368e5e);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3dfae0,_0x21f57f){_0x3dfae0=_0x3dfae0-0x0;var _0x3e257c=_0xee5b[_0x3dfae0];return _0x3e257c;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0x7')](_0xbee5('0xb'),auth['isAuthenticated'](),controller[_0xbee5('0xc')]);router[_0xbee5('0xd')]('/',auth[_0xbee5('0x8')](),interaction[_0xbee5('0xe')](_0xbee5('0xf'),_0xbee5('0x10')),controller[_0xbee5('0x11')]);router[_0xbee5('0x12')](_0xbee5('0x13'),auth['isAuthenticated'](),controller[_0xbee5('0x14')]);router['put'](_0xbee5('0x15'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x16')]);router['put']('/:id/reject',auth[_0xbee5('0x8')](),controller['reject']);router[_0xbee5('0x17')]('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0x18')]);module[_0xbee5('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f7e3819..9257768 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 _0x9c5a=['INTEGER','rrmemory','roundrobin','exports','STRING','name'];(function(_0x51666b,_0x48e537){var _0x1858fa=function(_0x578ff0){while(--_0x578ff0){_0x51666b['push'](_0x51666b['shift']());}};_0x1858fa(++_0x48e537);}(_0x9c5a,0x17d));var _0xa9c5=function(_0x3c31c3,_0x193112){_0x3c31c3=_0x3c31c3-0x0;var _0x4bb08b=_0x9c5a[_0x3c31c3];return _0x4bb08b;};'use strict';var Sequelize=require('sequelize');module[_0xa9c5('0x0')]={'name':{'type':Sequelize[_0xa9c5('0x1')],'unique':_0xa9c5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa9c5('0x1')]},'timeout':{'type':Sequelize[_0xa9c5('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa9c5('0x4'),'beepall',_0xa9c5('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfbe8=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x372db9,_0x1ba0f3){var _0x7da012=function(_0x20c6ee){while(--_0x20c6ee){_0x372db9['push'](_0x372db9['shift']());}};_0x7da012(++_0x1ba0f3);}(_0xfbe8,0x152));var _0x8fbe=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xfbe8[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x8fbe('0x0'));module[_0x8fbe('0x1')]={'name':{'type':Sequelize[_0x8fbe('0x2')],'unique':_0x8fbe('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8fbe('0x2')]},'timeout':{'type':Sequelize[_0x8fbe('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8fbe('0x5'),_0x8fbe('0x6'),'roundrobin'),'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 87e9a4a..3666b8c 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 _0x8889=['flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','limit','offset','count','Content-Range','apply','save','then','destroy','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','FaxQueue','include','findAll','rows','params','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','order','FaxQueueId','User','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','interface'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x8889,0x1d0));var _0x9888=function(_0x1ca8b6,_0x4f4550){_0x1ca8b6=_0x1ca8b6-0x0;var _0x3af669=_0x8889[_0x1ca8b6];return _0x3af669;};'use strict';var emlformat=require(_0x9888('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9888('0x1'));var rp=require(_0x9888('0x2'));var moment=require(_0x9888('0x3'));var BPromise=require(_0x9888('0x4'));var Mustache=require(_0x9888('0x5'));var util=require(_0x9888('0x6'));var path=require(_0x9888('0x7'));var sox=require(_0x9888('0x8'));var csv=require(_0x9888('0x9'));var ejs=require(_0x9888('0xa'));var fs=require('fs');var fs_extra=require(_0x9888('0xb'));var _=require(_0x9888('0xc'));var squel=require(_0x9888('0xd'));var crypto=require('crypto');var jsforce=require(_0x9888('0xe'));var deskjs=require(_0x9888('0xf'));var toCsv=require(_0x9888('0x9'));var querystring=require(_0x9888('0x10'));var Papa=require(_0x9888('0x11'));var Redis=require(_0x9888('0x12'));var authService=require(_0x9888('0x13'));var qs=require(_0x9888('0x14'));var as=require(_0x9888('0x15'));var hardwareService=require(_0x9888('0x16'));var logger=require(_0x9888('0x17'))(_0x9888('0x18'));var utils=require(_0x9888('0x19'));var config=require(_0x9888('0x1a'));var licenseUtil=require(_0x9888('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9888('0x1c')](config[_0x9888('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x9888('0x1e'))(new Redis(config['redis']));require(_0x9888('0x1f'))[_0x9888('0x20')](socket);function respondWithStatusCode(_0x331dc2,_0x1e4f81){_0x1e4f81=_0x1e4f81||0xcc;return function(_0x581250){if(_0x581250){return _0x331dc2[_0x9888('0x21')](_0x1e4f81);}return _0x331dc2['status'](_0x1e4f81)[_0x9888('0x22')]();};}function respondWithResult(_0x31a0a1,_0x4e6028){_0x4e6028=_0x4e6028||0xc8;return function(_0x3d9d6e){if(_0x3d9d6e){return _0x31a0a1[_0x9888('0x23')](_0x4e6028)[_0x9888('0x24')](_0x3d9d6e);}};}function respondWithFilteredResult(_0x1a1ea6,_0x5c865b){return function(_0x3dbbc7){if(_0x3dbbc7){var _0xf52365=typeof _0x5c865b['offset']==='undefined'&&typeof _0x5c865b[_0x9888('0x25')]==='undefined';var _0x1fe2d4=_0x3dbbc7['count'];var _0x531c9d=_0xf52365?0x0:_0x5c865b[_0x9888('0x26')];var _0x30c762=_0xf52365?_0x3dbbc7[_0x9888('0x27')]:_0x5c865b[_0x9888('0x26')]+_0x5c865b[_0x9888('0x25')];var _0x11dd05;if(_0x30c762>=_0x1fe2d4){_0x30c762=_0x1fe2d4;_0x11dd05=0xc8;}else{_0x11dd05=0xce;}_0x1a1ea6['status'](_0x11dd05);return _0x1a1ea6['set'](_0x9888('0x28'),_0x531c9d+'-'+_0x30c762+'/'+_0x1fe2d4)[_0x9888('0x24')](_0x3dbbc7);}return null;};}function patchUpdates(_0x2ae92b){return function(_0x1714bc){try{jsonpatch[_0x9888('0x29')](_0x1714bc,_0x2ae92b,!![]);}catch(_0x1f730e){return BPromise['reject'](_0x1f730e);}return _0x1714bc[_0x9888('0x2a')]();};}function saveUpdates(_0x5f5b63,_0x168487){return function(_0x1471f8){if(_0x1471f8){return _0x1471f8['update'](_0x5f5b63)[_0x9888('0x2b')](function(_0x12fa68){return _0x12fa68;});}return null;};}function removeEntity(_0x5325da,_0x8e8660){return function(_0x15ccc7){if(_0x15ccc7){return _0x15ccc7[_0x9888('0x2c')]()[_0x9888('0x2b')](function(){var _0x4663b4=_0x15ccc7['get']({'plain':!![]});var _0x2a7976='FaxQueues';return db[_0x9888('0x2d')][_0x9888('0x2c')]({'where':{'type':_0x2a7976,'resourceId':_0x4663b4['id']}})[_0x9888('0x2b')](function(){return _0x15ccc7;});})['then'](function(){_0x5325da[_0x9888('0x23')](0xcc)[_0x9888('0x22')]();});}};}function handleEntityNotFound(_0x280f30,_0x54d7ad){return function(_0x35a7ef){if(!_0x35a7ef){_0x280f30[_0x9888('0x21')](0x194);}return _0x35a7ef;};}function handleError(_0x306b9d,_0x4f3b58){_0x4f3b58=_0x4f3b58||0x1f4;return function(_0x4f9476){logger[_0x9888('0x2e')](_0x4f9476[_0x9888('0x2f')]);if(_0x4f9476[_0x9888('0x30')]){delete _0x4f9476[_0x9888('0x30')];}_0x306b9d[_0x9888('0x23')](_0x4f3b58)[_0x9888('0x31')](_0x4f9476);};}exports[_0x9888('0x32')]=function(_0x2e0aa1,_0x3705b4){var _0x18e2dd={},_0x40c09b={},_0x3706eb={'count':0x0,'rows':[]};var _0x376d87=_['map'](db['FaxQueue'][_0x9888('0x33')],function(_0x1fbeca){return{'name':_0x1fbeca[_0x9888('0x34')],'type':_0x1fbeca[_0x9888('0x35')][_0x9888('0x36')]};});_0x40c09b['model']=_['map'](_0x376d87,'name');_0x40c09b[_0x9888('0x37')]=_[_0x9888('0x38')](_0x2e0aa1[_0x9888('0x37')]);_0x40c09b['filters']=_[_0x9888('0x39')](_0x40c09b[_0x9888('0x3a')],_0x40c09b[_0x9888('0x37')]);_0x18e2dd[_0x9888('0x3b')]=_[_0x9888('0x39')](_0x40c09b[_0x9888('0x3a')],qs[_0x9888('0x3c')](_0x2e0aa1['query'][_0x9888('0x3c')]));_0x18e2dd[_0x9888('0x3b')]=_0x18e2dd[_0x9888('0x3b')][_0x9888('0x3d')]?_0x18e2dd[_0x9888('0x3b')]:_0x40c09b[_0x9888('0x3a')];if(!_0x2e0aa1[_0x9888('0x37')][_0x9888('0x3e')]('nolimit')){_0x18e2dd['limit']=qs[_0x9888('0x25')](_0x2e0aa1[_0x9888('0x37')][_0x9888('0x25')]);_0x18e2dd[_0x9888('0x26')]=qs['offset'](_0x2e0aa1[_0x9888('0x37')][_0x9888('0x26')]);}_0x18e2dd['order']=qs['sort'](_0x2e0aa1[_0x9888('0x37')][_0x9888('0x3f')]);_0x18e2dd[_0x9888('0x40')]=qs[_0x9888('0x41')](_[_0x9888('0x42')](_0x2e0aa1['query'],_0x40c09b['filters']),_0x376d87);if(_0x2e0aa1[_0x9888('0x37')][_0x9888('0x43')]){_0x18e2dd[_0x9888('0x40')]=_[_0x9888('0x44')](_0x18e2dd['where'],{'$or':_[_0x9888('0x45')](_0x376d87,function(_0x26f0ef){if(_0x26f0ef['type']!==_0x9888('0x46')){var _0x412bc7={};_0x412bc7[_0x26f0ef[_0x9888('0x30')]]={'$like':'%'+_0x2e0aa1[_0x9888('0x37')]['filter']+'%'};return _0x412bc7;}})});}_0x18e2dd=_[_0x9888('0x44')]({},_0x18e2dd,_0x2e0aa1[_0x9888('0x47')]);var _0x53ab95={'where':_0x18e2dd['where']};return db[_0x9888('0x48')][_0x9888('0x27')](_0x53ab95)[_0x9888('0x2b')](function(_0x45be87){_0x3706eb['count']=_0x45be87;if(_0x2e0aa1['query']['includeAll']){_0x18e2dd[_0x9888('0x49')]=[{'all':!![]}];}return db[_0x9888('0x48')][_0x9888('0x4a')](_0x18e2dd);})[_0x9888('0x2b')](function(_0x2c7ad5){_0x3706eb[_0x9888('0x4b')]=_0x2c7ad5;return _0x3706eb;})[_0x9888('0x2b')](respondWithFilteredResult(_0x3705b4,_0x18e2dd))['catch'](handleError(_0x3705b4,null));};exports['show']=function(_0x354646,_0x145b59){var _0x59473f={'raw':!![],'where':{'id':_0x354646[_0x9888('0x4c')]['id']}},_0x360a14={};_0x360a14[_0x9888('0x3a')]=_[_0x9888('0x38')](db[_0x9888('0x48')][_0x9888('0x33')]);_0x360a14[_0x9888('0x37')]=_[_0x9888('0x38')](_0x354646[_0x9888('0x37')]);_0x360a14[_0x9888('0x41')]=_['intersection'](_0x360a14['model'],_0x360a14[_0x9888('0x37')]);_0x59473f[_0x9888('0x3b')]=_['intersection'](_0x360a14[_0x9888('0x3a')],qs[_0x9888('0x3c')](_0x354646[_0x9888('0x37')]['fields']));_0x59473f[_0x9888('0x3b')]=_0x59473f[_0x9888('0x3b')][_0x9888('0x3d')]?_0x59473f[_0x9888('0x3b')]:_0x360a14['model'];if(_0x354646['query'][_0x9888('0x4d')]){_0x59473f[_0x9888('0x49')]=[{'all':!![]}];}_0x59473f=_[_0x9888('0x44')]({},_0x59473f,_0x354646[_0x9888('0x47')]);return db['FaxQueue'][_0x9888('0x4e')](_0x59473f)['then'](handleEntityNotFound(_0x145b59,null))[_0x9888('0x2b')](respondWithResult(_0x145b59,null))[_0x9888('0x4f')](handleError(_0x145b59,null));};exports[_0x9888('0x50')]=function(_0x52ee87,_0x5d999b){return db[_0x9888('0x48')][_0x9888('0x50')](_0x52ee87[_0x9888('0x51')],{})[_0x9888('0x2b')](function(_0x12f912){var _0x14a2a4=_0x52ee87[_0x9888('0x52')][_0x9888('0x53')]({'plain':!![]});if(!_0x14a2a4)throw new Error(_0x9888('0x54'));if(_0x14a2a4['role']===_0x9888('0x52')){var _0x238e5b=_0x12f912['get']({'plain':!![]});var _0x56cc09=_0x9888('0x55');return db[_0x9888('0x56')][_0x9888('0x4e')]({'where':{'name':_0x56cc09,'userProfileId':_0x14a2a4[_0x9888('0x57')]},'raw':!![]})[_0x9888('0x2b')](function(_0x5abfb1){if(_0x5abfb1&&_0x5abfb1[_0x9888('0x58')]===0x0){return db[_0x9888('0x2d')][_0x9888('0x50')]({'name':_0x238e5b[_0x9888('0x30')],'resourceId':_0x238e5b['id'],'type':_0x5abfb1['name'],'sectionId':_0x5abfb1['id']},{})[_0x9888('0x2b')](function(){return _0x12f912;});}else{return _0x12f912;}})['catch'](function(_0x181750){logger[_0x9888('0x2e')](_0x9888('0x59'),_0x181750);throw _0x181750;});}return _0x12f912;})['then'](respondWithResult(_0x5d999b,0xc9))[_0x9888('0x4f')](handleError(_0x5d999b,null));};exports[_0x9888('0x5a')]=function(_0x33d432,_0x40f251){if(_0x33d432[_0x9888('0x51')]['id']){delete _0x33d432['body']['id'];}return db['FaxQueue'][_0x9888('0x4e')]({'where':{'id':_0x33d432['params']['id']}})[_0x9888('0x2b')](handleEntityNotFound(_0x40f251,null))[_0x9888('0x2b')](saveUpdates(_0x33d432[_0x9888('0x51')],null))['then'](respondWithResult(_0x40f251,null))['catch'](handleError(_0x40f251,null));};exports[_0x9888('0x2c')]=function(_0x2b0327,_0x34f6b9){return db['FaxQueue'][_0x9888('0x4e')]({'where':{'id':_0x2b0327[_0x9888('0x4c')]['id']}})[_0x9888('0x2b')](handleEntityNotFound(_0x34f6b9,null))[_0x9888('0x2b')](removeEntity(_0x34f6b9,null))['catch'](handleError(_0x34f6b9,null));};exports[_0x9888('0x5b')]=function(_0x520d46,_0x428862){return db['FaxQueue']['describe']()[_0x9888('0x2b')](respondWithResult(_0x428862,null))[_0x9888('0x4f')](handleError(_0x428862,null));};exports[_0x9888('0x5c')]=function(_0x1c3d17,_0x1fb271,_0x90375d){var _0x5561d2={'raw':!![],'where':{}},_0x32ea04={},_0x21e6bf;return db[_0x9888('0x48')][_0x9888('0x5d')]({'where':{'id':_0x1c3d17[_0x9888('0x4c')]['id']}})[_0x9888('0x2b')](handleEntityNotFound(_0x1fb271,null))['then'](function(_0x295b43){if(_0x295b43){_0x21e6bf=_0x295b43['get']({'plain':!![]});_0x32ea04[_0x9888('0x3a')]=_[_0x9888('0x38')](db[_0x9888('0x5e')]['rawAttributes']);_0x32ea04[_0x9888('0x37')]=_[_0x9888('0x38')](_0x1c3d17[_0x9888('0x37')]);_0x32ea04[_0x9888('0x41')]=_[_0x9888('0x39')](_0x32ea04[_0x9888('0x3a')],_0x32ea04[_0x9888('0x37')]);_0x5561d2[_0x9888('0x3b')]=_[_0x9888('0x39')](_0x32ea04[_0x9888('0x3a')],qs[_0x9888('0x3c')](_0x1c3d17[_0x9888('0x37')][_0x9888('0x3c')]));_0x5561d2[_0x9888('0x3b')]=_0x5561d2['attributes'][_0x9888('0x3d')]?_0x5561d2[_0x9888('0x3b')]:_0x32ea04['model'];if(!_0x1c3d17[_0x9888('0x37')]['hasOwnProperty']('nolimit')){_0x5561d2[_0x9888('0x25')]=qs[_0x9888('0x25')](_0x1c3d17['query'][_0x9888('0x25')]);_0x5561d2['offset']=qs[_0x9888('0x26')](_0x1c3d17[_0x9888('0x37')]['offset']);}_0x5561d2[_0x9888('0x5f')]=qs[_0x9888('0x3f')](_0x1c3d17[_0x9888('0x37')][_0x9888('0x3f')]);_0x5561d2[_0x9888('0x40')]=qs[_0x9888('0x41')](_['pick'](_0x1c3d17[_0x9888('0x37')],_0x32ea04[_0x9888('0x41')]));_0x5561d2[_0x9888('0x40')][_0x9888('0x60')]=_0x295b43['id'];if(_0x1c3d17[_0x9888('0x37')][_0x9888('0x43')]){_0x5561d2['where']=_[_0x9888('0x44')](_0x5561d2[_0x9888('0x40')],{'$or':_[_0x9888('0x45')](_0x5561d2['attributes'],function(_0x25d69b){var _0x4c6e80={};_0x4c6e80[_0x25d69b]={'$like':'%'+_0x1c3d17['query'][_0x9888('0x43')]+'%'};return _0x4c6e80;})});}_0x5561d2=_['merge']({},_0x5561d2,_0x1c3d17[_0x9888('0x47')]);return db['UserFaxQueue'][_0x9888('0x4a')](_0x5561d2);}})[_0x9888('0x2b')](function(_0x4eab95){if(_0x4eab95){return db[_0x9888('0x61')]['findAndCountAll']({'where':{'id':_[_0x9888('0x45')](_0x4eab95,_0x9888('0x62')),'role':_0x9888('0x63')},'attributes':['id',_0x9888('0x30'),'faxPause',_0x9888('0x64'),_0x9888('0x65')]});}})[_0x9888('0x2b')](function(_0x1cc35b){if(_0x1cc35b){return{'count':_0x1cc35b[_0x9888('0x27')],'rows':_[_0x9888('0x45')](_0x1cc35b['rows'],function(_0xe73ff6){return{'membername':_0xe73ff6[_0x9888('0x30')],'UserId':_0xe73ff6['id'],'queue_name':_0x21e6bf['name'],'FaxQueueId':_0x21e6bf['id'],'interface':util[_0x9888('0x66')](_0x9888('0x67'),'SIP',_0xe73ff6[_0x9888('0x30')]),'penalty':0x0,'paused':_0xe73ff6['faxPause'],'createdAt':_0xe73ff6[_0x9888('0x65')],'updatedAt':_0xe73ff6[_0x9888('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1fb271,_0x5561d2))[_0x9888('0x4f')](handleError(_0x1fb271,null));};exports[_0x9888('0x68')]=function(_0x5b2b0d,_0x5a8627,_0x44c200){var _0x54c197={};var _0xd984d4={};var _0x4f903a;var _0x57c860;return db['FaxQueue'][_0x9888('0x5d')]({'where':{'id':_0x5b2b0d[_0x9888('0x4c')]['id']}})[_0x9888('0x2b')](handleEntityNotFound(_0x5a8627,null))[_0x9888('0x2b')](function(_0x2221bf){if(_0x2221bf){_0x4f903a=_0x2221bf;_0xd984d4[_0x9888('0x3a')]=_[_0x9888('0x38')](db[_0x9888('0x69')][_0x9888('0x33')]);_0xd984d4[_0x9888('0x37')]=_['keys'](_0x5b2b0d[_0x9888('0x37')]);_0xd984d4[_0x9888('0x41')]=_['intersection'](_0xd984d4['model'],_0xd984d4[_0x9888('0x37')]);_0x54c197[_0x9888('0x3b')]=_[_0x9888('0x39')](_0xd984d4[_0x9888('0x3a')],qs[_0x9888('0x3c')](_0x5b2b0d[_0x9888('0x37')][_0x9888('0x3c')]));_0x54c197['attributes']=_0x54c197[_0x9888('0x3b')]['length']?_0x54c197[_0x9888('0x3b')]:_0xd984d4['model'];_0x54c197[_0x9888('0x5f')]=qs[_0x9888('0x3f')](_0x5b2b0d[_0x9888('0x37')][_0x9888('0x3f')]);_0x54c197[_0x9888('0x40')]=qs['filters'](_[_0x9888('0x42')](_0x5b2b0d['query'],_0xd984d4[_0x9888('0x41')]));if(_0x5b2b0d[_0x9888('0x37')][_0x9888('0x43')]){_0x54c197[_0x9888('0x40')]=_[_0x9888('0x44')](_0x54c197[_0x9888('0x40')],{'$or':_[_0x9888('0x45')](_0x54c197[_0x9888('0x3b')],function(_0x29550e){var _0x4e41e8={};_0x4e41e8[_0x29550e]={'$like':'%'+_0x5b2b0d['query']['filter']+'%'};return _0x4e41e8;})});}_0x54c197=_[_0x9888('0x44')]({},_0x54c197,_0x5b2b0d['options']);return _0x4f903a[_0x9888('0x68')](_0x54c197);}})['then'](function(_0x4966b9){if(_0x4966b9){_0x57c860=_0x4966b9[_0x9888('0x3d')];if(!_0x5b2b0d[_0x9888('0x37')][_0x9888('0x3e')](_0x9888('0x6a'))){_0x54c197[_0x9888('0x25')]=qs['limit'](_0x5b2b0d[_0x9888('0x37')]['limit']);_0x54c197['offset']=qs[_0x9888('0x26')](_0x5b2b0d['query']['offset']);}return _0x4f903a[_0x9888('0x68')](_0x54c197);}})[_0x9888('0x2b')](function(_0xd7296){if(_0xd7296){return _0xd7296?{'count':_0x57c860,'rows':_0xd7296}:null;}})[_0x9888('0x2b')](respondWithResult(_0x5a8627,null))[_0x9888('0x4f')](handleError(_0x5a8627,null));};exports[_0x9888('0x6b')]=function(_0x44f3bb,_0x3758e1,_0x3aa55b){var _0x1b15ed=_0x44f3bb[_0x9888('0x51')][_0x9888('0x6c')];return db[_0x9888('0x69')][_0x9888('0x4a')]({'where':{'id':_0x1b15ed},'attributes':['id'],'include':[{'model':db[_0x9888('0x61')],'as':_0x9888('0x6d'),'attributes':['id',_0x9888('0x30'),'online',_0x9888('0x6e'),_0x9888('0x6f')],'raw':!![]}]})[_0x9888('0x2b')](function(_0x3514a0){if(_0x3514a0){var _0x897301=_[_0x9888('0x70')](_0x3514a0,function(_0xc6f0cb){var _0x3e73fa=_0xc6f0cb['get']({'plain':!![]});return _0x3e73fa[_0x9888('0x6d')];});return db[_0x9888('0x48')][_0x9888('0x4e')]({'where':{'id':_0x44f3bb[_0x9888('0x4c')]['id']}})[_0x9888('0x2b')](function(_0x3ac5a4){return db[_0x9888('0x71')][_0x9888('0x72')](function(_0x555310){return _0x3ac5a4['addTeams'](_0x1b15ed,{'transaction':_0x555310})['then'](function(){return BPromise['each'](_0x897301,function(_0x2cfee6){return db[_0x9888('0x5e')][_0x9888('0x73')]({'where':{'UserId':_0x2cfee6['id'],'FaxQueueId':_0x44f3bb[_0x9888('0x4c')]['id']},'transaction':_0x555310});});})[_0x9888('0x2b')](function(){_0x897301[_0x9888('0x74')](function(_0x214f4b){socket[_0x9888('0x75')](_0x9888('0x76'),{'UserId':_0x214f4b['id'],'FaxQueueId':_0x3ac5a4['id']});});});});});}})['then'](respondWithStatusCode(_0x3758e1,null))[_0x9888('0x4f')](handleError(_0x3758e1,null));};exports[_0x9888('0x77')]=function(_0x3a159e,_0x2ae27c,_0x36cc92){return db[_0x9888('0x69')][_0x9888('0x4a')]({'where':{'id':_0x3a159e[_0x9888('0x37')][_0x9888('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9888('0x2b')](handleEntityNotFound(_0x2ae27c,null))[_0x9888('0x2b')](function(_0x386e29){var _0x1a408b=_[_0x9888('0x45')](_0x386e29,'id');var _0x44c015=[];var _0x3d762b=[];var _0x13bf61=squel[_0x9888('0x78')]();_0x13bf61[_0x9888('0x79')](_0x9888('0x7a'))[_0x9888('0x7b')](_0x9888('0x7c'),'tq')[_0x9888('0x7d')](_0x9888('0x7e'),'ut',_0x9888('0x7f'))[_0x9888('0x40')]('FaxQueueId\x20=\x20?',_0x3a159e[_0x9888('0x4c')]['id']);for(var _0x49d1ee=0x0;_0x49d1ee<_0x386e29[_0x9888('0x3d')];_0x49d1ee+=0x1){let _0x54c8d2=_0x386e29[_0x49d1ee];for(var _0x51a431=0x0;_0x51a431<_0x54c8d2[_0x9888('0x6d')]['length'];_0x51a431+=0x1){let _0x54b220=_0x54c8d2['Agents'][_0x51a431];var _0x1e00a7=_0x13bf61[_0x9888('0x80')]();_0x1e00a7[_0x9888('0x40')](_0x9888('0x81'),_0x54b220['id']);_0x3d762b[_0x9888('0x82')](db['sequelize'][_0x9888('0x37')](_0x1e00a7[_0x9888('0x83')](),{'type':db['sequelize'][_0x9888('0x84')][_0x9888('0x85')]})[_0x9888('0x2b')](function(_0x52a598){if(_0x52a598[_0x9888('0x3d')]===0x1){return _0x54b220['id'];}else{var _0x5a6632=_['every'](_[_0x9888('0x45')](_0x52a598,'TeamId'),function(_0xbdbd3){return _[_0x9888('0x86')](_0x1a408b,_0xbdbd3);});if(_0x5a6632){return _0x54b220['id'];}}}));}}return BPromise['all'](_0x3d762b)['then'](function(_0x1d3c20){_0x44c015=_(_0x44c015)['union'](_0x1d3c20)[_0x9888('0x87')]()['value']();return db[_0x9888('0x48')][_0x9888('0x4e')]({'where':{'id':_0x3a159e[_0x9888('0x4c')]['id']}})[_0x9888('0x2b')](function(_0x59eba9){return db[_0x9888('0x71')][_0x9888('0x72')](function(_0x4eaadf){return _0x59eba9[_0x9888('0x77')](_0x3a159e[_0x9888('0x37')][_0x9888('0x6c')],{'transaction':_0x4eaadf})['then'](function(){if(!_[_0x9888('0x88')](_0x44c015)){return _0x59eba9[_0x9888('0x89')](_0x44c015,{'transaction':_0x4eaadf});}})[_0x9888('0x2b')](function(){_0x44c015[_0x9888('0x74')](function(_0x18a1bb){socket[_0x9888('0x75')](_0x9888('0x8a'),{'UserId':_0x18a1bb,'FaxQueueId':_0x59eba9['id']});});});});});});})[_0x9888('0x2b')](respondWithStatusCode(_0x2ae27c,null))[_0x9888('0x4f')](handleError(_0x2ae27c,null));};exports['addAgents']=function(_0x34ae29,_0x2143c4,_0x5a3063){return db['FaxQueue'][_0x9888('0x4e')]({'where':{'id':_0x34ae29['params']['id']}})['then'](handleEntityNotFound(_0x2143c4,null))[_0x9888('0x2b')](function(_0x3da2bb){if(_0x3da2bb){return _0x3da2bb[_0x9888('0x8b')](_0x34ae29[_0x9888('0x51')][_0x9888('0x6c')],_[_0x9888('0x8c')](_0x34ae29[_0x9888('0x51')],[_0x9888('0x6c'),'id'])||{})[_0x9888('0x8d')](function(_0x210d27){for(var _0x14fc64=0x0;_0x14fc64<_0x34ae29['body'][_0x9888('0x6c')][_0x9888('0x3d')];_0x14fc64+=0x1){socket[_0x9888('0x75')](_0x9888('0x76'),{'UserId':Number(_0x34ae29[_0x9888('0x51')][_0x9888('0x6c')][_0x14fc64]),'FaxQueueId':Number(_0x34ae29[_0x9888('0x4c')]['id'])});}return _0x210d27;});}})[_0x9888('0x2b')](respondWithResult(_0x2143c4,null))[_0x9888('0x4f')](handleError(_0x2143c4,null));};exports[_0x9888('0x89')]=function(_0x101447,_0x454a05,_0x4ea0ee){return db['FaxQueue']['find']({'where':{'id':_0x101447['params']['id']}})[_0x9888('0x2b')](handleEntityNotFound(_0x454a05,null))['then'](function(_0x194e6a){if(_0x194e6a){return _0x194e6a[_0x9888('0x89')](_0x101447[_0x9888('0x37')][_0x9888('0x6c')])[_0x9888('0x2b')](function(){if(_[_0x9888('0x8e')](_0x101447[_0x9888('0x37')][_0x9888('0x6c')])){for(var _0x1f7c52=0x0;_0x1f7c52<_0x101447['query'][_0x9888('0x6c')][_0x9888('0x3d')];_0x1f7c52+=0x1){socket[_0x9888('0x75')](_0x9888('0x8a'),{'UserId':Number(_0x101447['query']['ids'][_0x1f7c52]),'FaxQueueId':Number(_0x101447[_0x9888('0x4c')]['id'])});}}else{socket[_0x9888('0x75')](_0x9888('0x8a'),{'UserId':Number(_0x101447['query']['ids']),'FaxQueueId':Number(_0x101447[_0x9888('0x4c')]['id'])});}});}})[_0x9888('0x2b')](respondWithStatusCode(_0x454a05,null))[_0x9888('0x4f')](handleError(_0x454a05,null));};exports[_0x9888('0x8f')]=function(_0x3949c9,_0x137e44,_0x2b4db1){var _0x3dca39={};var _0x2b5276={};var _0x5170d6;var _0x581af0;return db[_0x9888('0x48')][_0x9888('0x5d')]({'where':{'id':_0x3949c9['params']['id']}})['then'](handleEntityNotFound(_0x137e44,null))[_0x9888('0x2b')](function(_0x188d2f){if(_0x188d2f){_0x5170d6=_0x188d2f;_0x2b5276[_0x9888('0x3a')]=_['keys'](db['User'][_0x9888('0x33')]);_0x2b5276[_0x9888('0x37')]=_[_0x9888('0x38')](_0x3949c9[_0x9888('0x37')]);_0x2b5276[_0x9888('0x41')]=_[_0x9888('0x39')](_0x2b5276[_0x9888('0x3a')],_0x2b5276['query']);_0x3dca39[_0x9888('0x3b')]=_[_0x9888('0x39')](_0x2b5276['model'],qs[_0x9888('0x3c')](_0x3949c9[_0x9888('0x37')]['fields']));_0x3dca39[_0x9888('0x3b')]=_0x3dca39[_0x9888('0x3b')]['length']?_0x3dca39['attributes']:_0x2b5276[_0x9888('0x3a')];_0x3dca39[_0x9888('0x5f')]=qs[_0x9888('0x3f')](_0x3949c9[_0x9888('0x37')][_0x9888('0x3f')]);_0x3dca39[_0x9888('0x40')]=qs[_0x9888('0x41')](_[_0x9888('0x42')](_0x3949c9['query'],_0x2b5276['filters']));if(_0x3949c9['query'][_0x9888('0x43')]){_0x3dca39[_0x9888('0x40')]=_[_0x9888('0x44')](_0x3dca39[_0x9888('0x40')],{'$or':_[_0x9888('0x45')](_0x3dca39[_0x9888('0x3b')],function(_0x55c1e8){var _0x1396c7={};_0x1396c7[_0x55c1e8]={'$like':'%'+_0x3949c9[_0x9888('0x37')][_0x9888('0x43')]+'%'};return _0x1396c7;})});}_0x3dca39=_['merge']({},_0x3dca39,_0x3949c9['options']);return _0x5170d6[_0x9888('0x8f')](_0x3dca39);}})[_0x9888('0x2b')](function(_0x151988){if(_0x151988){_0x581af0=_0x151988['length'];if(!_0x3949c9[_0x9888('0x37')][_0x9888('0x3e')](_0x9888('0x6a'))){_0x3dca39[_0x9888('0x25')]=qs[_0x9888('0x25')](_0x3949c9['query']['limit']);_0x3dca39[_0x9888('0x26')]=qs[_0x9888('0x26')](_0x3949c9[_0x9888('0x37')][_0x9888('0x26')]);}return _0x5170d6['getAgents'](_0x3dca39);}})[_0x9888('0x2b')](function(_0x5ef6b7){if(_0x5ef6b7){return _0x5ef6b7?{'count':_0x581af0,'rows':_0x5ef6b7}:null;}})['then'](respondWithResult(_0x137e44,null))['catch'](handleError(_0x137e44,null));}; \ No newline at end of file +var _0x60f4=['FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','Agents','online','interface','sequelize','addTeams','each','findOrCreate','forEach','removeTeams','ids','field','tq.TeamId','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','every','all','value','transaction','isEmpty','addAgents','omit','spread','emit','removeAgents','userFaxQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxQueue.socket','end','status','offset','undefined','limit','count','Content-Range','apply','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','map'];(function(_0x563231,_0x2a509e){var _0x25cdf8=function(_0x54be1a){while(--_0x54be1a){_0x563231['push'](_0x563231['shift']());}};_0x25cdf8(++_0x2a509e);}(_0x60f4,0x155));var _0x460f=function(_0x2a8ed3,_0x1042a7){_0x2a8ed3=_0x2a8ed3-0x0;var _0x51402f=_0x60f4[_0x2a8ed3];return _0x51402f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x460f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x460f('0x1'));var rp=require(_0x460f('0x2'));var moment=require('moment');var BPromise=require(_0x460f('0x3'));var Mustache=require(_0x460f('0x4'));var util=require('util');var path=require(_0x460f('0x5'));var sox=require('sox');var csv=require(_0x460f('0x6'));var ejs=require(_0x460f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x460f('0x8'));var squel=require(_0x460f('0x9'));var crypto=require('crypto');var jsforce=require(_0x460f('0xa'));var deskjs=require(_0x460f('0xb'));var toCsv=require(_0x460f('0x6'));var querystring=require('querystring');var Papa=require(_0x460f('0xc'));var Redis=require(_0x460f('0xd'));var authService=require(_0x460f('0xe'));var qs=require(_0x460f('0xf'));var as=require(_0x460f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x460f('0x11'))(_0x460f('0x12'));var utils=require(_0x460f('0x13'));var config=require(_0x460f('0x14'));var licenseUtil=require(_0x460f('0x15'));var db=require('../../mysqldb')['db'];config[_0x460f('0x16')]=_[_0x460f('0x17')](config['redis'],{'host':_0x460f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x460f('0x16')]));require(_0x460f('0x19'))['register'](socket);function respondWithStatusCode(_0x23a982,_0x41d9f0){_0x41d9f0=_0x41d9f0||0xcc;return function(_0x1cd664){if(_0x1cd664){return _0x23a982['sendStatus'](_0x41d9f0);}return _0x23a982['status'](_0x41d9f0)[_0x460f('0x1a')]();};}function respondWithResult(_0x4a9acc,_0x1346ca){_0x1346ca=_0x1346ca||0xc8;return function(_0x5beece){if(_0x5beece){return _0x4a9acc[_0x460f('0x1b')](_0x1346ca)['json'](_0x5beece);}};}function respondWithFilteredResult(_0x216907,_0x3613a5){return function(_0x5d6cfe){if(_0x5d6cfe){var _0x368927=typeof _0x3613a5[_0x460f('0x1c')]===_0x460f('0x1d')&&typeof _0x3613a5[_0x460f('0x1e')]===_0x460f('0x1d');var _0x1ff20a=_0x5d6cfe['count'];var _0x875b95=_0x368927?0x0:_0x3613a5[_0x460f('0x1c')];var _0x2a92f9=_0x368927?_0x5d6cfe[_0x460f('0x1f')]:_0x3613a5[_0x460f('0x1c')]+_0x3613a5['limit'];var _0x135527;if(_0x2a92f9>=_0x1ff20a){_0x2a92f9=_0x1ff20a;_0x135527=0xc8;}else{_0x135527=0xce;}_0x216907[_0x460f('0x1b')](_0x135527);return _0x216907['set'](_0x460f('0x20'),_0x875b95+'-'+_0x2a92f9+'/'+_0x1ff20a)['json'](_0x5d6cfe);}return null;};}function patchUpdates(_0x2bfdc3){return function(_0x313041){try{jsonpatch[_0x460f('0x21')](_0x313041,_0x2bfdc3,!![]);}catch(_0x556d9c){return BPromise['reject'](_0x556d9c);}return _0x313041['save']();};}function saveUpdates(_0x9a50e8,_0x4a1538){return function(_0x474c55){if(_0x474c55){return _0x474c55['update'](_0x9a50e8)[_0x460f('0x22')](function(_0x48fa32){return _0x48fa32;});}return null;};}function removeEntity(_0x486580,_0x2645c1){return function(_0x28a19e){if(_0x28a19e){return _0x28a19e[_0x460f('0x23')]()[_0x460f('0x22')](function(){var _0x55a01e=_0x28a19e[_0x460f('0x24')]({'plain':!![]});var _0xbd5676=_0x460f('0x25');return db[_0x460f('0x26')][_0x460f('0x23')]({'where':{'type':_0xbd5676,'resourceId':_0x55a01e['id']}})['then'](function(){return _0x28a19e;});})['then'](function(){_0x486580['status'](0xcc)[_0x460f('0x1a')]();});}};}function handleEntityNotFound(_0x11fa9a,_0xc67671){return function(_0x514396){if(!_0x514396){_0x11fa9a['sendStatus'](0x194);}return _0x514396;};}function handleError(_0x3d3071,_0x269658){_0x269658=_0x269658||0x1f4;return function(_0x49df5e){logger['error'](_0x49df5e['stack']);if(_0x49df5e[_0x460f('0x27')]){delete _0x49df5e[_0x460f('0x27')];}_0x3d3071[_0x460f('0x1b')](_0x269658)[_0x460f('0x28')](_0x49df5e);};}exports[_0x460f('0x29')]=function(_0x594fe5,_0x1cc8f4){var _0xd5b463={},_0xc186e6={},_0x29bb3e={'count':0x0,'rows':[]};var _0x1f2e5c=_[_0x460f('0x2a')](db[_0x460f('0x2b')][_0x460f('0x2c')],function(_0xc431b6){return{'name':_0xc431b6[_0x460f('0x2d')],'type':_0xc431b6[_0x460f('0x2e')][_0x460f('0x2f')]};});_0xc186e6[_0x460f('0x30')]=_['map'](_0x1f2e5c,_0x460f('0x27'));_0xc186e6[_0x460f('0x31')]=_[_0x460f('0x32')](_0x594fe5[_0x460f('0x31')]);_0xc186e6['filters']=_['intersection'](_0xc186e6['model'],_0xc186e6[_0x460f('0x31')]);_0xd5b463[_0x460f('0x33')]=_['intersection'](_0xc186e6[_0x460f('0x30')],qs[_0x460f('0x34')](_0x594fe5[_0x460f('0x31')][_0x460f('0x34')]));_0xd5b463[_0x460f('0x33')]=_0xd5b463[_0x460f('0x33')][_0x460f('0x35')]?_0xd5b463[_0x460f('0x33')]:_0xc186e6[_0x460f('0x30')];if(!_0x594fe5[_0x460f('0x31')][_0x460f('0x36')](_0x460f('0x37'))){_0xd5b463[_0x460f('0x1e')]=qs[_0x460f('0x1e')](_0x594fe5[_0x460f('0x31')]['limit']);_0xd5b463[_0x460f('0x1c')]=qs[_0x460f('0x1c')](_0x594fe5[_0x460f('0x31')][_0x460f('0x1c')]);}_0xd5b463[_0x460f('0x38')]=qs['sort'](_0x594fe5['query'][_0x460f('0x39')]);_0xd5b463[_0x460f('0x3a')]=qs[_0x460f('0x3b')](_[_0x460f('0x3c')](_0x594fe5[_0x460f('0x31')],_0xc186e6[_0x460f('0x3b')]),_0x1f2e5c);if(_0x594fe5['query'][_0x460f('0x3d')]){_0xd5b463[_0x460f('0x3a')]=_[_0x460f('0x3e')](_0xd5b463[_0x460f('0x3a')],{'$or':_[_0x460f('0x2a')](_0x1f2e5c,function(_0x414431){if(_0x414431[_0x460f('0x2e')]!==_0x460f('0x3f')){var _0x2bcc10={};_0x2bcc10[_0x414431['name']]={'$like':'%'+_0x594fe5[_0x460f('0x31')][_0x460f('0x3d')]+'%'};return _0x2bcc10;}})});}_0xd5b463=_['merge']({},_0xd5b463,_0x594fe5[_0x460f('0x40')]);var _0x3b89cb={'where':_0xd5b463['where']};return db['FaxQueue'][_0x460f('0x1f')](_0x3b89cb)[_0x460f('0x22')](function(_0x2c600a){_0x29bb3e[_0x460f('0x1f')]=_0x2c600a;if(_0x594fe5[_0x460f('0x31')][_0x460f('0x41')]){_0xd5b463[_0x460f('0x42')]=[{'all':!![]}];}return db[_0x460f('0x2b')]['findAll'](_0xd5b463);})[_0x460f('0x22')](function(_0x114391){_0x29bb3e['rows']=_0x114391;return _0x29bb3e;})[_0x460f('0x22')](respondWithFilteredResult(_0x1cc8f4,_0xd5b463))[_0x460f('0x43')](handleError(_0x1cc8f4,null));};exports[_0x460f('0x44')]=function(_0x3a4b00,_0x1f2b23){var _0x4b8db6={'raw':!![],'where':{'id':_0x3a4b00['params']['id']}},_0x44f1fd={};_0x44f1fd[_0x460f('0x30')]=_[_0x460f('0x32')](db['FaxQueue'][_0x460f('0x2c')]);_0x44f1fd['query']=_[_0x460f('0x32')](_0x3a4b00['query']);_0x44f1fd[_0x460f('0x3b')]=_[_0x460f('0x45')](_0x44f1fd[_0x460f('0x30')],_0x44f1fd[_0x460f('0x31')]);_0x4b8db6[_0x460f('0x33')]=_[_0x460f('0x45')](_0x44f1fd['model'],qs[_0x460f('0x34')](_0x3a4b00[_0x460f('0x31')][_0x460f('0x34')]));_0x4b8db6[_0x460f('0x33')]=_0x4b8db6[_0x460f('0x33')][_0x460f('0x35')]?_0x4b8db6[_0x460f('0x33')]:_0x44f1fd['model'];if(_0x3a4b00[_0x460f('0x31')]['includeAll']){_0x4b8db6['include']=[{'all':!![]}];}_0x4b8db6=_[_0x460f('0x3e')]({},_0x4b8db6,_0x3a4b00[_0x460f('0x40')]);return db['FaxQueue'][_0x460f('0x46')](_0x4b8db6)['then'](handleEntityNotFound(_0x1f2b23,null))[_0x460f('0x22')](respondWithResult(_0x1f2b23,null))[_0x460f('0x43')](handleError(_0x1f2b23,null));};exports[_0x460f('0x47')]=function(_0x3547d5,_0xc94e){return db['FaxQueue'][_0x460f('0x47')](_0x3547d5[_0x460f('0x48')],{})[_0x460f('0x22')](function(_0x54cd36){var _0x5c8736=_0x3547d5[_0x460f('0x49')][_0x460f('0x24')]({'plain':!![]});if(!_0x5c8736)throw new Error(_0x460f('0x4a'));if(_0x5c8736[_0x460f('0x4b')]===_0x460f('0x49')){var _0x522843=_0x54cd36[_0x460f('0x24')]({'plain':!![]});var _0x1d1c12=_0x460f('0x25');return db['UserProfileSection'][_0x460f('0x46')]({'where':{'name':_0x1d1c12,'userProfileId':_0x5c8736[_0x460f('0x4c')]},'raw':!![]})[_0x460f('0x22')](function(_0x506ff8){if(_0x506ff8&&_0x506ff8[_0x460f('0x4d')]===0x0){return db['UserProfileResource'][_0x460f('0x47')]({'name':_0x522843[_0x460f('0x27')],'resourceId':_0x522843['id'],'type':_0x506ff8[_0x460f('0x27')],'sectionId':_0x506ff8['id']},{})[_0x460f('0x22')](function(){return _0x54cd36;});}else{return _0x54cd36;}})['catch'](function(_0x3d2528){logger[_0x460f('0x4e')](_0x460f('0x4f'),_0x3d2528);throw _0x3d2528;});}return _0x54cd36;})[_0x460f('0x22')](respondWithResult(_0xc94e,0xc9))['catch'](handleError(_0xc94e,null));};exports[_0x460f('0x50')]=function(_0x5538c1,_0xa3517a){if(_0x5538c1['body']['id']){delete _0x5538c1[_0x460f('0x48')]['id'];}return db[_0x460f('0x2b')][_0x460f('0x46')]({'where':{'id':_0x5538c1['params']['id']}})['then'](handleEntityNotFound(_0xa3517a,null))[_0x460f('0x22')](saveUpdates(_0x5538c1[_0x460f('0x48')],null))[_0x460f('0x22')](respondWithResult(_0xa3517a,null))[_0x460f('0x43')](handleError(_0xa3517a,null));};exports[_0x460f('0x23')]=function(_0x308ed6,_0x2d6787){return db[_0x460f('0x2b')][_0x460f('0x46')]({'where':{'id':_0x308ed6[_0x460f('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d6787,null))[_0x460f('0x22')](removeEntity(_0x2d6787,null))[_0x460f('0x43')](handleError(_0x2d6787,null));};exports['describe']=function(_0x58d8f1,_0xdac80e){return db[_0x460f('0x2b')]['describe']()[_0x460f('0x22')](respondWithResult(_0xdac80e,null))[_0x460f('0x43')](handleError(_0xdac80e,null));};exports['getMembers']=function(_0x4906ac,_0xe8dfbb,_0x21281c){var _0x23693b={'raw':!![],'where':{}},_0x1229a4={},_0x36cd71;return db[_0x460f('0x2b')][_0x460f('0x52')]({'where':{'id':_0x4906ac['params']['id']}})['then'](handleEntityNotFound(_0xe8dfbb,null))['then'](function(_0x5ec772){if(_0x5ec772){_0x36cd71=_0x5ec772[_0x460f('0x24')]({'plain':!![]});_0x1229a4[_0x460f('0x30')]=_[_0x460f('0x32')](db[_0x460f('0x53')]['rawAttributes']);_0x1229a4[_0x460f('0x31')]=_[_0x460f('0x32')](_0x4906ac[_0x460f('0x31')]);_0x1229a4[_0x460f('0x3b')]=_['intersection'](_0x1229a4[_0x460f('0x30')],_0x1229a4['query']);_0x23693b[_0x460f('0x33')]=_[_0x460f('0x45')](_0x1229a4[_0x460f('0x30')],qs[_0x460f('0x34')](_0x4906ac[_0x460f('0x31')]['fields']));_0x23693b[_0x460f('0x33')]=_0x23693b['attributes'][_0x460f('0x35')]?_0x23693b[_0x460f('0x33')]:_0x1229a4[_0x460f('0x30')];if(!_0x4906ac[_0x460f('0x31')][_0x460f('0x36')]('nolimit')){_0x23693b['limit']=qs[_0x460f('0x1e')](_0x4906ac[_0x460f('0x31')][_0x460f('0x1e')]);_0x23693b[_0x460f('0x1c')]=qs[_0x460f('0x1c')](_0x4906ac[_0x460f('0x31')][_0x460f('0x1c')]);}_0x23693b['order']=qs['sort'](_0x4906ac['query'][_0x460f('0x39')]);_0x23693b[_0x460f('0x3a')]=qs[_0x460f('0x3b')](_['pick'](_0x4906ac['query'],_0x1229a4[_0x460f('0x3b')]));_0x23693b[_0x460f('0x3a')][_0x460f('0x54')]=_0x5ec772['id'];if(_0x4906ac['query'][_0x460f('0x3d')]){_0x23693b[_0x460f('0x3a')]=_['merge'](_0x23693b[_0x460f('0x3a')],{'$or':_[_0x460f('0x2a')](_0x23693b['attributes'],function(_0xc8c910){var _0x4ff2c4={};_0x4ff2c4[_0xc8c910]={'$like':'%'+_0x4906ac[_0x460f('0x31')][_0x460f('0x3d')]+'%'};return _0x4ff2c4;})});}_0x23693b=_[_0x460f('0x3e')]({},_0x23693b,_0x4906ac[_0x460f('0x40')]);return db[_0x460f('0x53')][_0x460f('0x55')](_0x23693b);}})[_0x460f('0x22')](function(_0x9e1f6e){if(_0x9e1f6e){return db[_0x460f('0x56')][_0x460f('0x57')]({'where':{'id':_[_0x460f('0x2a')](_0x9e1f6e,_0x460f('0x58')),'role':_0x460f('0x59')},'attributes':['id',_0x460f('0x27'),_0x460f('0x5a'),_0x460f('0x5b'),'createdAt']});}})[_0x460f('0x22')](function(_0x3a6fc8){if(_0x3a6fc8){return{'count':_0x3a6fc8[_0x460f('0x1f')],'rows':_[_0x460f('0x2a')](_0x3a6fc8['rows'],function(_0xb2a235){return{'membername':_0xb2a235[_0x460f('0x27')],'UserId':_0xb2a235['id'],'queue_name':_0x36cd71['name'],'FaxQueueId':_0x36cd71['id'],'interface':util[_0x460f('0x5c')](_0x460f('0x5d'),_0x460f('0x5e'),_0xb2a235[_0x460f('0x27')]),'penalty':0x0,'paused':_0xb2a235[_0x460f('0x5a')],'createdAt':_0xb2a235[_0x460f('0x5f')],'updatedAt':_0xb2a235[_0x460f('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x460f('0x22')](respondWithFilteredResult(_0xe8dfbb,_0x23693b))[_0x460f('0x43')](handleError(_0xe8dfbb,null));};exports[_0x460f('0x60')]=function(_0x3dce75,_0x1a23f4,_0x24d1d6){var _0x463d4b={};var _0x26089e={};var _0x56b6e2;var _0x18d16e;return db['FaxQueue'][_0x460f('0x52')]({'where':{'id':_0x3dce75['params']['id']}})['then'](handleEntityNotFound(_0x1a23f4,null))[_0x460f('0x22')](function(_0x13c8e0){if(_0x13c8e0){_0x56b6e2=_0x13c8e0;_0x26089e[_0x460f('0x30')]=_[_0x460f('0x32')](db[_0x460f('0x61')][_0x460f('0x2c')]);_0x26089e['query']=_['keys'](_0x3dce75[_0x460f('0x31')]);_0x26089e[_0x460f('0x3b')]=_[_0x460f('0x45')](_0x26089e[_0x460f('0x30')],_0x26089e[_0x460f('0x31')]);_0x463d4b[_0x460f('0x33')]=_[_0x460f('0x45')](_0x26089e[_0x460f('0x30')],qs[_0x460f('0x34')](_0x3dce75[_0x460f('0x31')][_0x460f('0x34')]));_0x463d4b['attributes']=_0x463d4b[_0x460f('0x33')][_0x460f('0x35')]?_0x463d4b[_0x460f('0x33')]:_0x26089e[_0x460f('0x30')];_0x463d4b[_0x460f('0x38')]=qs[_0x460f('0x39')](_0x3dce75[_0x460f('0x31')]['sort']);_0x463d4b['where']=qs[_0x460f('0x3b')](_[_0x460f('0x3c')](_0x3dce75[_0x460f('0x31')],_0x26089e[_0x460f('0x3b')]));if(_0x3dce75[_0x460f('0x31')][_0x460f('0x3d')]){_0x463d4b[_0x460f('0x3a')]=_[_0x460f('0x3e')](_0x463d4b[_0x460f('0x3a')],{'$or':_[_0x460f('0x2a')](_0x463d4b[_0x460f('0x33')],function(_0x47a0d2){var _0x3c55b1={};_0x3c55b1[_0x47a0d2]={'$like':'%'+_0x3dce75[_0x460f('0x31')][_0x460f('0x3d')]+'%'};return _0x3c55b1;})});}_0x463d4b=_[_0x460f('0x3e')]({},_0x463d4b,_0x3dce75[_0x460f('0x40')]);return _0x56b6e2[_0x460f('0x60')](_0x463d4b);}})[_0x460f('0x22')](function(_0x454bd0){if(_0x454bd0){_0x18d16e=_0x454bd0['length'];if(!_0x3dce75[_0x460f('0x31')][_0x460f('0x36')](_0x460f('0x37'))){_0x463d4b[_0x460f('0x1e')]=qs[_0x460f('0x1e')](_0x3dce75[_0x460f('0x31')][_0x460f('0x1e')]);_0x463d4b['offset']=qs[_0x460f('0x1c')](_0x3dce75['query']['offset']);}return _0x56b6e2['getTeams'](_0x463d4b);}})[_0x460f('0x22')](function(_0x375f36){if(_0x375f36){return _0x375f36?{'count':_0x18d16e,'rows':_0x375f36}:null;}})[_0x460f('0x22')](respondWithResult(_0x1a23f4,null))[_0x460f('0x43')](handleError(_0x1a23f4,null));};exports['addTeams']=function(_0x1a57b4,_0xe45ad8,_0x29afff){var _0x21a6bd=_0x1a57b4[_0x460f('0x48')]['ids'];return db[_0x460f('0x61')][_0x460f('0x55')]({'where':{'id':_0x21a6bd},'attributes':['id'],'include':[{'model':db[_0x460f('0x56')],'as':_0x460f('0x62'),'attributes':['id',_0x460f('0x27'),_0x460f('0x63'),'voicePause',_0x460f('0x64')],'raw':!![]}]})[_0x460f('0x22')](function(_0x5942fa){if(_0x5942fa){var _0x48e4f6=_['flatMap'](_0x5942fa,function(_0x592d35){var _0x4156e3=_0x592d35['get']({'plain':!![]});return _0x4156e3[_0x460f('0x62')];});return db['FaxQueue'][_0x460f('0x46')]({'where':{'id':_0x1a57b4[_0x460f('0x51')]['id']}})[_0x460f('0x22')](function(_0x4e0c9c){return db[_0x460f('0x65')]['transaction'](function(_0x535a1d){return _0x4e0c9c[_0x460f('0x66')](_0x21a6bd,{'transaction':_0x535a1d})[_0x460f('0x22')](function(){return BPromise[_0x460f('0x67')](_0x48e4f6,function(_0x33ae30){return db[_0x460f('0x53')][_0x460f('0x68')]({'where':{'UserId':_0x33ae30['id'],'FaxQueueId':_0x1a57b4[_0x460f('0x51')]['id']},'transaction':_0x535a1d});});})[_0x460f('0x22')](function(){_0x48e4f6[_0x460f('0x69')](function(_0x514425){socket['emit']('userFaxQueue:save',{'UserId':_0x514425['id'],'FaxQueueId':_0x4e0c9c['id']});});});});});}})[_0x460f('0x22')](respondWithStatusCode(_0xe45ad8,null))[_0x460f('0x43')](handleError(_0xe45ad8,null));};exports[_0x460f('0x6a')]=function(_0x160047,_0x1b1c7c,_0x4d62be){return db[_0x460f('0x61')][_0x460f('0x55')]({'where':{'id':_0x160047[_0x460f('0x31')][_0x460f('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x460f('0x56')],'as':_0x460f('0x62'),'attributes':['id'],'raw':!![]}]})[_0x460f('0x22')](handleEntityNotFound(_0x1b1c7c,null))[_0x460f('0x22')](function(_0xe9912c){var _0x48ce80=_[_0x460f('0x2a')](_0xe9912c,'id');var _0x35da81=[];var _0x4394a3=[];var _0x5485e3=squel['select']();_0x5485e3[_0x460f('0x6c')](_0x460f('0x6d'))['from'](_0x460f('0x6e'),'tq')[_0x460f('0x6f')]('user_has_teams','ut',_0x460f('0x70'))[_0x460f('0x3a')]('FaxQueueId\x20=\x20?',_0x160047[_0x460f('0x51')]['id']);for(var _0x454ed2=0x0;_0x454ed2<_0xe9912c['length'];_0x454ed2+=0x1){let _0x7bf78d=_0xe9912c[_0x454ed2];for(var _0x26ee5b=0x0;_0x26ee5b<_0x7bf78d['Agents'][_0x460f('0x35')];_0x26ee5b+=0x1){let _0x3d2db7=_0x7bf78d[_0x460f('0x62')][_0x26ee5b];var _0x12610f=_0x5485e3['clone']();_0x12610f['where']('ut.UserId\x20=\x20?',_0x3d2db7['id']);_0x4394a3[_0x460f('0x71')](db[_0x460f('0x65')][_0x460f('0x31')](_0x12610f[_0x460f('0x72')](),{'type':db[_0x460f('0x65')][_0x460f('0x73')]['SELECT']})[_0x460f('0x22')](function(_0x1cd21c){if(_0x1cd21c[_0x460f('0x35')]===0x1){return _0x3d2db7['id'];}else{var _0x5555f8=_[_0x460f('0x74')](_[_0x460f('0x2a')](_0x1cd21c,'TeamId'),function(_0x549a51){return _['includes'](_0x48ce80,_0x549a51);});if(_0x5555f8){return _0x3d2db7['id'];}}}));}}return BPromise[_0x460f('0x75')](_0x4394a3)[_0x460f('0x22')](function(_0x468f00){_0x35da81=_(_0x35da81)['union'](_0x468f00)['compact']()[_0x460f('0x76')]();return db[_0x460f('0x2b')][_0x460f('0x46')]({'where':{'id':_0x160047[_0x460f('0x51')]['id']}})['then'](function(_0xf7e8a7){return db['sequelize'][_0x460f('0x77')](function(_0x56207a){return _0xf7e8a7['removeTeams'](_0x160047['query']['ids'],{'transaction':_0x56207a})[_0x460f('0x22')](function(){if(!_[_0x460f('0x78')](_0x35da81)){return _0xf7e8a7['removeAgents'](_0x35da81,{'transaction':_0x56207a});}})['then'](function(){_0x35da81[_0x460f('0x69')](function(_0x42d4f6){socket['emit']('userFaxQueue:remove',{'UserId':_0x42d4f6,'FaxQueueId':_0xf7e8a7['id']});});});});});});})[_0x460f('0x22')](respondWithStatusCode(_0x1b1c7c,null))[_0x460f('0x43')](handleError(_0x1b1c7c,null));};exports[_0x460f('0x79')]=function(_0x26b449,_0x53d204,_0x4f3e43){return db[_0x460f('0x2b')]['find']({'where':{'id':_0x26b449[_0x460f('0x51')]['id']}})['then'](handleEntityNotFound(_0x53d204,null))[_0x460f('0x22')](function(_0x1230b1){if(_0x1230b1){return _0x1230b1[_0x460f('0x79')](_0x26b449[_0x460f('0x48')]['ids'],_[_0x460f('0x7a')](_0x26b449[_0x460f('0x48')],[_0x460f('0x6b'),'id'])||{})[_0x460f('0x7b')](function(_0x118ac3){for(var _0x42cfc6=0x0;_0x42cfc6<_0x26b449[_0x460f('0x48')][_0x460f('0x6b')][_0x460f('0x35')];_0x42cfc6+=0x1){socket[_0x460f('0x7c')]('userFaxQueue:save',{'UserId':Number(_0x26b449[_0x460f('0x48')]['ids'][_0x42cfc6]),'FaxQueueId':Number(_0x26b449[_0x460f('0x51')]['id'])});}return _0x118ac3;});}})[_0x460f('0x22')](respondWithResult(_0x53d204,null))['catch'](handleError(_0x53d204,null));};exports['removeAgents']=function(_0x1e058e,_0x586d93,_0x52c1bd){return db['FaxQueue']['find']({'where':{'id':_0x1e058e['params']['id']}})[_0x460f('0x22')](handleEntityNotFound(_0x586d93,null))[_0x460f('0x22')](function(_0xc2f961){if(_0xc2f961){return _0xc2f961[_0x460f('0x7d')](_0x1e058e[_0x460f('0x31')][_0x460f('0x6b')])[_0x460f('0x22')](function(){if(_['isArray'](_0x1e058e['query'][_0x460f('0x6b')])){for(var _0x21f9b0=0x0;_0x21f9b0<_0x1e058e[_0x460f('0x31')][_0x460f('0x6b')][_0x460f('0x35')];_0x21f9b0+=0x1){socket[_0x460f('0x7c')](_0x460f('0x7e'),{'UserId':Number(_0x1e058e[_0x460f('0x31')][_0x460f('0x6b')][_0x21f9b0]),'FaxQueueId':Number(_0x1e058e[_0x460f('0x51')]['id'])});}}else{socket[_0x460f('0x7c')](_0x460f('0x7e'),{'UserId':Number(_0x1e058e[_0x460f('0x31')]['ids']),'FaxQueueId':Number(_0x1e058e[_0x460f('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x586d93,null))['catch'](handleError(_0x586d93,null));};exports[_0x460f('0x7f')]=function(_0x29e6c5,_0x3194ea,_0x36a04c){var _0x10b50c={};var _0x6633e={};var _0x152332;var _0x4cc241;return db[_0x460f('0x2b')][_0x460f('0x52')]({'where':{'id':_0x29e6c5['params']['id']}})['then'](handleEntityNotFound(_0x3194ea,null))[_0x460f('0x22')](function(_0x4c037a){if(_0x4c037a){_0x152332=_0x4c037a;_0x6633e['model']=_[_0x460f('0x32')](db[_0x460f('0x56')][_0x460f('0x2c')]);_0x6633e['query']=_['keys'](_0x29e6c5['query']);_0x6633e['filters']=_['intersection'](_0x6633e[_0x460f('0x30')],_0x6633e[_0x460f('0x31')]);_0x10b50c[_0x460f('0x33')]=_[_0x460f('0x45')](_0x6633e[_0x460f('0x30')],qs['fields'](_0x29e6c5[_0x460f('0x31')]['fields']));_0x10b50c[_0x460f('0x33')]=_0x10b50c['attributes'][_0x460f('0x35')]?_0x10b50c[_0x460f('0x33')]:_0x6633e[_0x460f('0x30')];_0x10b50c[_0x460f('0x38')]=qs[_0x460f('0x39')](_0x29e6c5[_0x460f('0x31')][_0x460f('0x39')]);_0x10b50c['where']=qs[_0x460f('0x3b')](_[_0x460f('0x3c')](_0x29e6c5[_0x460f('0x31')],_0x6633e[_0x460f('0x3b')]));if(_0x29e6c5['query'][_0x460f('0x3d')]){_0x10b50c[_0x460f('0x3a')]=_['merge'](_0x10b50c[_0x460f('0x3a')],{'$or':_['map'](_0x10b50c[_0x460f('0x33')],function(_0x527fdf){var _0x4ad2de={};_0x4ad2de[_0x527fdf]={'$like':'%'+_0x29e6c5[_0x460f('0x31')][_0x460f('0x3d')]+'%'};return _0x4ad2de;})});}_0x10b50c=_[_0x460f('0x3e')]({},_0x10b50c,_0x29e6c5[_0x460f('0x40')]);return _0x152332[_0x460f('0x7f')](_0x10b50c);}})[_0x460f('0x22')](function(_0x2dc4e2){if(_0x2dc4e2){_0x4cc241=_0x2dc4e2[_0x460f('0x35')];if(!_0x29e6c5[_0x460f('0x31')][_0x460f('0x36')](_0x460f('0x37'))){_0x10b50c[_0x460f('0x1e')]=qs[_0x460f('0x1e')](_0x29e6c5['query']['limit']);_0x10b50c[_0x460f('0x1c')]=qs[_0x460f('0x1c')](_0x29e6c5['query'][_0x460f('0x1c')]);}return _0x152332[_0x460f('0x7f')](_0x10b50c);}})['then'](function(_0x2efe36){if(_0x2efe36){return _0x2efe36?{'count':_0x4cc241,'rows':_0x2efe36}:null;}})['then'](respondWithResult(_0x3194ea,null))[_0x460f('0x43')](handleError(_0x3194ea,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index cd7091f..9a8547e 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 _0xad05=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x2eb6b8,_0x3425fc){var _0x270d8a=function(_0x499141){while(--_0x499141){_0x2eb6b8['push'](_0x2eb6b8['shift']());}};_0x270d8a(++_0x3425fc);}(_0xad05,0x1a6));var _0x5ad0=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0xad05[_0x2de020];return _0x182b7c;};'use strict';var EventEmitter=require(_0x5ad0('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5ad0('0x1')](0x0);var events={'afterCreate':_0x5ad0('0x2'),'afterUpdate':_0x5ad0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2146ca){return function(_0x57bd80,_0x2a1afe,_0x5f1353){FaxQueueEvents[_0x5ad0('0x4')](_0x2146ca+':'+_0x57bd80['id'],_0x57bd80);FaxQueueEvents[_0x5ad0('0x4')](_0x2146ca,_0x57bd80);_0x5f1353(null);};}for(var e in events){if(events[_0x5ad0('0x5')](e)){var event=events[e];FaxQueue[_0x5ad0('0x6')](e,emitEvent(event));}}module[_0x5ad0('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x7af9=['events','../../mysqldb','FaxQueue','setMaxListeners','update','emit','hook','exports'];(function(_0x2f8ba2,_0x137db4){var _0x3f8aa5=function(_0x36cb0b){while(--_0x36cb0b){_0x2f8ba2['push'](_0x2f8ba2['shift']());}};_0x3f8aa5(++_0x137db4);}(_0x7af9,0x118));var _0x97af=function(_0x449775,_0x263a4f){_0x449775=_0x449775-0x0;var _0x1f2f28=_0x7af9[_0x449775];return _0x1f2f28;};'use strict';var EventEmitter=require(_0x97af('0x0'));var FaxQueue=require(_0x97af('0x1'))['db'][_0x97af('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x97af('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x97af('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23b70b){return function(_0x3e53cf,_0x28f393,_0x4a0d00){FaxQueueEvents[_0x97af('0x5')](_0x23b70b+':'+_0x3e53cf['id'],_0x3e53cf);FaxQueueEvents[_0x97af('0x5')](_0x23b70b,_0x3e53cf);_0x4a0d00(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x97af('0x6')](e,emitEvent(event));}}module[_0x97af('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 3165701..4c1e693 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 _0x3f3e=['moment','bluebird','path','../../config/environment','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x312015,_0x2d0de0){var _0x477f9e=function(_0x19a2db){while(--_0x19a2db){_0x312015['push'](_0x312015['shift']());}};_0x477f9e(++_0x2d0de0);}(_0x3f3e,0x11e));var _0xe3f3=function(_0x4599bc,_0x40ff9e){_0x4599bc=_0x4599bc-0x0;var _0x2a8d13=_0x3f3e[_0x4599bc];return _0x2a8d13;};'use strict';var _=require(_0xe3f3('0x0'));var util=require('util');var logger=require(_0xe3f3('0x1'))('api');var moment=require(_0xe3f3('0x2'));var BPromise=require(_0xe3f3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3f3('0x4'));var rimraf=require('rimraf');var config=require(_0xe3f3('0x5'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x2fa7ca,_0x5077eb){return _0x2fa7ca[_0xe3f3('0x6')](_0xe3f3('0x7'),attributes,{'tableName':_0xe3f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c15=['fax_queues','lodash','util','api','moment','request-promise','path','rimraf','./faxQueue.attributes','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7c15,0x137));var _0x57c1=function(_0x9ca57b,_0x1a5e44){_0x9ca57b=_0x9ca57b-0x0;var _0x15b2e4=_0x7c15[_0x9ca57b];return _0x15b2e4;};'use strict';var _=require(_0x57c1('0x0'));var util=require(_0x57c1('0x1'));var logger=require('../../config/logger')(_0x57c1('0x2'));var moment=require(_0x57c1('0x3'));var BPromise=require('bluebird');var rp=require(_0x57c1('0x4'));var fs=require('fs');var path=require(_0x57c1('0x5'));var rimraf=require(_0x57c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x57c1('0x7'));module[_0x57c1('0x8')]=function(_0x5870fb,_0xbfb68d){return _0x5870fb['define']('FaxQueue',attributes,{'tableName':_0x57c1('0x9'),'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 990f4f7..0584d19 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 _0x7344=['error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','map','model','include','attributes','debug','ShowFaxQueue','find','where','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7344,0x91));var _0x4734=function(_0x5056da,_0x1661a2){_0x5056da=_0x5056da-0x0;var _0x428836=_0x7344[_0x5056da];return _0x428836;};'use strict';var _=require(_0x4734('0x0'));var util=require('util');var moment=require(_0x4734('0x1'));var BPromise=require(_0x4734('0x2'));var rs=require(_0x4734('0x3'));var fs=require('fs');var Redis=require(_0x4734('0x4'));var db=require(_0x4734('0x5'))['db'];var utils=require(_0x4734('0x6'));var logger=require('../../config/logger')(_0x4734('0x7'));var config=require(_0x4734('0x8'));var jayson=require(_0x4734('0x9'));var client=jayson[_0x4734('0xa')][_0x4734('0xb')]({'port':0x232a});config[_0x4734('0xc')]=_[_0x4734('0xd')](config[_0x4734('0xc')],{'host':_0x4734('0xe'),'port':0x18eb});var socket=require(_0x4734('0xf'))(new Redis(config[_0x4734('0xc')]));require(_0x4734('0x10'))['register'](socket);function respondWithRpcPromise(_0x3af41d,_0x1db93c,_0x32c0dc){return new BPromise(function(_0x265f6d,_0x27a6ae){return client[_0x4734('0x11')](_0x3af41d,_0x32c0dc)[_0x4734('0x12')](function(_0x210ce2){logger[_0x4734('0x13')](_0x4734('0x14'),_0x1db93c,_0x4734('0x15'));logger['debug'](_0x4734('0x16'),_0x1db93c,_0x4734('0x15'),JSON['stringify'](_0x210ce2));if(_0x210ce2['error']){if(_0x210ce2[_0x4734('0x17')][_0x4734('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1db93c,_0x210ce2[_0x4734('0x17')][_0x4734('0x19')]);return _0x27a6ae(_0x210ce2[_0x4734('0x17')]['message']);}logger[_0x4734('0x17')](_0x4734('0x14'),_0x1db93c,_0x210ce2['error'][_0x4734('0x19')]);return _0x265f6d(_0x210ce2[_0x4734('0x17')]['message']);}else{logger[_0x4734('0x13')](_0x4734('0x14'),_0x1db93c,_0x4734('0x15'));_0x265f6d(_0x210ce2[_0x4734('0x1a')][_0x4734('0x19')]);}})[_0x4734('0x1b')](function(_0x18dc80){logger['error'](_0x4734('0x14'),_0x1db93c,_0x18dc80);_0x27a6ae(_0x18dc80);});});}exports[_0x4734('0x1c')]=function(_0x5aedac){var _0x4f172d=this;return new Promise(function(_0x102e92,_0x512ad3){return db[_0x4734('0x1d')][_0x4734('0x1e')]({'raw':_0x5aedac[_0x4734('0x1f')]?_0x5aedac['options'][_0x4734('0x20')]===undefined?!![]:![]:!![],'where':_0x5aedac[_0x4734('0x1f')]?_0x5aedac[_0x4734('0x1f')]['where']||null:null,'attributes':_0x5aedac['options']?_0x5aedac[_0x4734('0x1f')]['attributes']||null:null,'limit':_0x5aedac[_0x4734('0x1f')]?_0x5aedac[_0x4734('0x1f')]['limit']||null:null,'include':_0x5aedac[_0x4734('0x1f')]?_0x5aedac[_0x4734('0x1f')]['include']?_[_0x4734('0x21')](_0x5aedac['options']['include'],function(_0x4f9a14){return{'model':db[_0x4f9a14[_0x4734('0x22')]],'as':_0x4f9a14['as'],'attributes':_0x4f9a14['attributes'],'include':_0x4f9a14[_0x4734('0x23')]?_[_0x4734('0x21')](_0x4f9a14[_0x4734('0x23')],function(_0x23b695){return{'model':db[_0x23b695[_0x4734('0x22')]],'as':_0x23b695['as'],'attributes':_0x23b695[_0x4734('0x24')],'include':_0x23b695[_0x4734('0x23')]?_[_0x4734('0x21')](_0x23b695[_0x4734('0x23')],function(_0x5ad2d0){return{'model':db[_0x5ad2d0[_0x4734('0x22')]],'as':_0x5ad2d0['as'],'attributes':_0x5ad2d0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c55bf){logger[_0x4734('0x13')](_0x4734('0x1c'),_0x5aedac);logger[_0x4734('0x25')]('GetFaxQueue',_0x5aedac,JSON['stringify'](_0x2c55bf));_0x102e92(_0x2c55bf);})[_0x4734('0x1b')](function(_0x53804a){logger[_0x4734('0x17')](_0x4734('0x1c'),_0x53804a[_0x4734('0x19')],_0x5aedac);_0x512ad3(_0x4f172d[_0x4734('0x17')](0x1f4,_0x53804a[_0x4734('0x19')]));});});};exports[_0x4734('0x26')]=function(_0x11e2f8){var _0xc7efbb=this;return new Promise(function(_0x2d16d4,_0x2a05f5){return db[_0x4734('0x1d')][_0x4734('0x27')]({'raw':_0x11e2f8['options']?_0x11e2f8[_0x4734('0x1f')][_0x4734('0x20')]===undefined?!![]:![]:!![],'where':_0x11e2f8[_0x4734('0x1f')]?_0x11e2f8[_0x4734('0x1f')][_0x4734('0x28')]||null:null,'attributes':_0x11e2f8[_0x4734('0x1f')]?_0x11e2f8[_0x4734('0x1f')][_0x4734('0x24')]||null:null,'include':_0x11e2f8[_0x4734('0x1f')]?_0x11e2f8['options']['include']?_['map'](_0x11e2f8[_0x4734('0x1f')]['include'],function(_0x31cd91){return{'model':db[_0x31cd91[_0x4734('0x22')]],'as':_0x31cd91['as'],'attributes':_0x31cd91[_0x4734('0x24')],'include':_0x31cd91[_0x4734('0x23')]?_[_0x4734('0x21')](_0x31cd91[_0x4734('0x23')],function(_0xf83317){return{'model':db[_0xf83317[_0x4734('0x22')]],'as':_0xf83317['as'],'attributes':_0xf83317['attributes'],'include':_0xf83317[_0x4734('0x23')]?_[_0x4734('0x21')](_0xf83317[_0x4734('0x23')],function(_0x283c08){return{'model':db[_0x283c08['model']],'as':_0x283c08['as'],'attributes':_0x283c08['attributes']};}):[]};}):[]};}):[]:[]})[_0x4734('0x12')](function(_0x44272c){logger[_0x4734('0x13')](_0x4734('0x26'),_0x11e2f8);logger[_0x4734('0x25')](_0x4734('0x26'),_0x11e2f8,JSON[_0x4734('0x29')](_0x44272c));_0x2d16d4(_0x44272c);})['catch'](function(_0x7aca4d){logger[_0x4734('0x17')](_0x4734('0x26'),_0x7aca4d['message'],_0x11e2f8);_0x2a05f5(_0xc7efbb[_0x4734('0x17')](0x1f4,_0x7aca4d[_0x4734('0x19')]));});});}; \ No newline at end of file +var _0x939e=['catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x939e,0xbc));var _0xe939=function(_0x229e80,_0x414425){_0x229e80=_0x229e80-0x0;var _0x30c4a4=_0x939e[_0x229e80];return _0x30c4a4;};'use strict';var _=require(_0xe939('0x0'));var util=require('util');var moment=require(_0xe939('0x1'));var BPromise=require(_0xe939('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe939('0x3'));var logger=require(_0xe939('0x4'))(_0xe939('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe939('0x6')][_0xe939('0x7')]({'port':0x232a});config[_0xe939('0x8')]=_[_0xe939('0x9')](config[_0xe939('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe939('0x8')]));require(_0xe939('0xa'))[_0xe939('0xb')](socket);function respondWithRpcPromise(_0x455995,_0x5a1e45,_0x5e2dd4){return new BPromise(function(_0x3b1a99,_0x5ad1a9){return client[_0xe939('0xc')](_0x455995,_0x5e2dd4)[_0xe939('0xd')](function(_0x1bcf8c){logger[_0xe939('0xe')](_0xe939('0xf'),_0x5a1e45,'request\x20sent');logger[_0xe939('0x10')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5a1e45,_0xe939('0x11'),JSON['stringify'](_0x1bcf8c));if(_0x1bcf8c[_0xe939('0x12')]){if(_0x1bcf8c[_0xe939('0x12')][_0xe939('0x13')]===0x1f4){logger[_0xe939('0x12')](_0xe939('0xf'),_0x5a1e45,_0x1bcf8c[_0xe939('0x12')]['message']);return _0x5ad1a9(_0x1bcf8c[_0xe939('0x12')][_0xe939('0x14')]);}logger[_0xe939('0x12')](_0xe939('0xf'),_0x5a1e45,_0x1bcf8c[_0xe939('0x12')][_0xe939('0x14')]);return _0x3b1a99(_0x1bcf8c['error'][_0xe939('0x14')]);}else{logger[_0xe939('0xe')](_0xe939('0xf'),_0x5a1e45,_0xe939('0x11'));_0x3b1a99(_0x1bcf8c[_0xe939('0x15')][_0xe939('0x14')]);}})[_0xe939('0x16')](function(_0x571a97){logger[_0xe939('0x12')]('FaxQueue,\x20%s,\x20%s',_0x5a1e45,_0x571a97);_0x5ad1a9(_0x571a97);});});}exports[_0xe939('0x17')]=function(_0x4b4119){var _0x2c0eaf=this;return new Promise(function(_0xdb753c,_0x41626a){return db[_0xe939('0x18')][_0xe939('0x19')]({'raw':_0x4b4119['options']?_0x4b4119[_0xe939('0x1a')][_0xe939('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b4119[_0xe939('0x1a')]?_0x4b4119[_0xe939('0x1a')][_0xe939('0x1c')]||null:null,'attributes':_0x4b4119[_0xe939('0x1a')]?_0x4b4119['options'][_0xe939('0x1d')]||null:null,'limit':_0x4b4119['options']?_0x4b4119[_0xe939('0x1a')][_0xe939('0x1e')]||null:null,'include':_0x4b4119[_0xe939('0x1a')]?_0x4b4119[_0xe939('0x1a')][_0xe939('0x1f')]?_[_0xe939('0x20')](_0x4b4119[_0xe939('0x1a')][_0xe939('0x1f')],function(_0x63e16f){return{'model':db[_0x63e16f['model']],'as':_0x63e16f['as'],'attributes':_0x63e16f[_0xe939('0x1d')],'include':_0x63e16f['include']?_['map'](_0x63e16f['include'],function(_0x5e00fc){return{'model':db[_0x5e00fc[_0xe939('0x21')]],'as':_0x5e00fc['as'],'attributes':_0x5e00fc[_0xe939('0x1d')],'include':_0x5e00fc[_0xe939('0x1f')]?_['map'](_0x5e00fc['include'],function(_0x41ed79){return{'model':db[_0x41ed79[_0xe939('0x21')]],'as':_0x41ed79['as'],'attributes':_0x41ed79['attributes']};}):[]};}):[]};}):[]:[]})[_0xe939('0xd')](function(_0x2dac0c){logger['info'](_0xe939('0x17'),_0x4b4119);logger[_0xe939('0x10')](_0xe939('0x17'),_0x4b4119,JSON['stringify'](_0x2dac0c));_0xdb753c(_0x2dac0c);})[_0xe939('0x16')](function(_0x315626){logger[_0xe939('0x12')](_0xe939('0x17'),_0x315626[_0xe939('0x14')],_0x4b4119);_0x41626a(_0x2c0eaf[_0xe939('0x12')](0x1f4,_0x315626[_0xe939('0x14')]));});});};exports[_0xe939('0x22')]=function(_0x3cb9ee){var _0x1bbc15=this;return new Promise(function(_0x142274,_0x288333){return db[_0xe939('0x18')]['find']({'raw':_0x3cb9ee[_0xe939('0x1a')]?_0x3cb9ee[_0xe939('0x1a')][_0xe939('0x1b')]===undefined?!![]:![]:!![],'where':_0x3cb9ee[_0xe939('0x1a')]?_0x3cb9ee[_0xe939('0x1a')][_0xe939('0x1c')]||null:null,'attributes':_0x3cb9ee[_0xe939('0x1a')]?_0x3cb9ee[_0xe939('0x1a')][_0xe939('0x1d')]||null:null,'include':_0x3cb9ee[_0xe939('0x1a')]?_0x3cb9ee[_0xe939('0x1a')][_0xe939('0x1f')]?_[_0xe939('0x20')](_0x3cb9ee[_0xe939('0x1a')][_0xe939('0x1f')],function(_0x4df3c1){return{'model':db[_0x4df3c1[_0xe939('0x21')]],'as':_0x4df3c1['as'],'attributes':_0x4df3c1['attributes'],'include':_0x4df3c1['include']?_[_0xe939('0x20')](_0x4df3c1[_0xe939('0x1f')],function(_0x5e0cb3){return{'model':db[_0x5e0cb3[_0xe939('0x21')]],'as':_0x5e0cb3['as'],'attributes':_0x5e0cb3[_0xe939('0x1d')],'include':_0x5e0cb3['include']?_['map'](_0x5e0cb3[_0xe939('0x1f')],function(_0x30d860){return{'model':db[_0x30d860[_0xe939('0x21')]],'as':_0x30d860['as'],'attributes':_0x30d860[_0xe939('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe939('0xd')](function(_0x5a6ddd){logger[_0xe939('0xe')](_0xe939('0x22'),_0x3cb9ee);logger[_0xe939('0x10')](_0xe939('0x22'),_0x3cb9ee,JSON['stringify'](_0x5a6ddd));_0x142274(_0x5a6ddd);})[_0xe939('0x16')](function(_0x353352){logger['error'](_0xe939('0x22'),_0x353352[_0xe939('0x14')],_0x3cb9ee);_0x288333(_0x1bbc15[_0xe939('0x12')](0x1f4,_0x353352['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 00470fd..e988a95 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 _0xe0d6=['remove','update','emit','removeListener','register','length','faxQueue:','save'];(function(_0xff32d3,_0x421cd3){var _0x12dc06=function(_0x16e3fd){while(--_0x16e3fd){_0xff32d3['push'](_0xff32d3['shift']());}};_0x12dc06(++_0x421cd3);}(_0xe0d6,0x13f));var _0x6e0d=function(_0x6f2bc3,_0x5666c2){_0x6f2bc3=_0x6f2bc3-0x0;var _0x203e08=_0xe0d6[_0x6f2bc3];return _0x203e08;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x6e0d('0x0'),_0x6e0d('0x1'),_0x6e0d('0x2')];function createListener(_0x2a9bfa,_0x396517){return function(_0x14f1eb){_0x396517[_0x6e0d('0x3')](_0x2a9bfa,_0x14f1eb);};}function removeListener(_0x5520f4,_0x4bc2d4){return function(){FaxQueueEvents[_0x6e0d('0x4')](_0x5520f4,_0x4bc2d4);};}exports[_0x6e0d('0x5')]=function(_0x605dab){for(var _0x4a39e6=0x0,_0x555454=events[_0x6e0d('0x6')];_0x4a39e6<_0x555454;_0x4a39e6++){var _0x4ea437=events[_0x4a39e6];var _0x1878e1=createListener(_0x6e0d('0x7')+_0x4ea437,_0x605dab);FaxQueueEvents['on'](_0x4ea437,_0x1878e1);}}; \ No newline at end of file +var _0xf34b=['./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf34b,0x66));var _0xbf34=function(_0x2e0100,_0x3c4128){_0x2e0100=_0x2e0100-0x0;var _0x239c8d=_0xf34b[_0x2e0100];return _0x239c8d;};'use strict';var FaxQueueEvents=require(_0xbf34('0x0'));var events=[_0xbf34('0x1'),_0xbf34('0x2'),'update'];function createListener(_0xf71c11,_0x249a60){return function(_0x1c1cb1){_0x249a60[_0xbf34('0x3')](_0xf71c11,_0x1c1cb1);};}function removeListener(_0x37cbd9,_0xdb3dda){return function(){FaxQueueEvents[_0xbf34('0x4')](_0x37cbd9,_0xdb3dda);};}exports[_0xbf34('0x5')]=function(_0x455cd0){for(var _0x2dd618=0x0,_0x5e638c=events['length'];_0x2dd618<_0x5e638c;_0x2dd618++){var _0x26f52a=events[_0x2dd618];var _0xcfdb2e=createListener('faxQueue:'+_0x26f52a,_0x455cd0);FaxQueueEvents['on'](_0x26f52a,_0xcfdb2e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ad22b36..bdfd80f 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 _0xc359=['isAuthenticated','describe','/:id','show','/:id/members','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x30e86a,_0xdb8ad1){var _0x484b30=function(_0x1a7691){while(--_0x1a7691){_0x30e86a['push'](_0x30e86a['shift']());}};_0x484b30(++_0xdb8ad1);}(_0xc359,0x1d9));var _0x9c35=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xc359[_0x57d740];return _0x6607ef;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x5'));var controller=require('./faxQueue.controller');router[_0x9c35('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9c35('0x7')](),controller[_0x9c35('0x8')]);router[_0x9c35('0x6')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xa')]);router['get'](_0x9c35('0xb'),auth[_0x9c35('0x7')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x9c35('0x7')](),controller['getTeams']);router[_0x9c35('0x6')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['getAgents']);router[_0x9c35('0xd')]('/',auth[_0x9c35('0x7')](),controller[_0x9c35('0xe')]);router[_0x9c35('0xd')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x10')]);router[_0x9c35('0xd')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x11')]);router[_0x9c35('0x12')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x13')]);router[_0x9c35('0x14')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x15')]);router[_0x9c35('0x14')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x16')]);router[_0x9c35('0x14')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['removeAgents']);module[_0x9c35('0x17')]=router; \ No newline at end of file +var _0x1967=['getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x1967,0x173));var _0x7196=function(_0x9c781a,_0x45a1d4){_0x9c781a=_0x9c781a-0x0;var _0x216fc5=_0x1967[_0x9c781a];return _0x216fc5;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0xc')](_0x7196('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7196('0xc')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);router[_0x7196('0xc')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x15')]);router[_0x7196('0x16')]('/',auth[_0x7196('0xa')](),controller[_0x7196('0x17')]);router['post'](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x18')]);router[_0x7196('0x16')]('/:id/users',auth[_0x7196('0xa')](),controller['addAgents']);router[_0x7196('0x19')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1a')]);router[_0x7196('0x1b')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1c')]);router[_0x7196('0x1b')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller['removeTeams']);router['delete'](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index dd4b622..5dd72d4 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 _0xa603=['exports','STRING','DATE','moment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa603,0x7f));var _0x3a60=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa603[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x3a60('0x0'));var Sequelize=require('sequelize');module[_0x3a60('0x1')]={'uniqueid':{'type':Sequelize[_0x3a60('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3a60('0x2')]},'joinAt':{'type':Sequelize[_0x3a60('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3a60('0x3')]},'exitAt':{'type':Sequelize[_0x3a60('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef30=['moment','sequelize','exports','STRING','DATE'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0xef30,0x118));var _0x0ef3=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0xef30[_0x4c98b9];return _0x3a257a;};'use strict';var moment=require(_0x0ef3('0x0'));var Sequelize=require(_0x0ef3('0x1'));module[_0x0ef3('0x2')]={'uniqueid':{'type':Sequelize[_0x0ef3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0ef3('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0ef3('0x4')]},'acceptAt':{'type':Sequelize[_0x0ef3('0x4')]},'exitAt':{'type':Sequelize[_0x0ef3('0x4')]},'reason':{'type':Sequelize[_0x0ef3('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3a89436..96cc07e 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 _0x9990=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','error','name','send','index','map','FaxQueueReport','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9990,0xf6));var _0x0999=function(_0x2bb197,_0x5bda99){_0x2bb197=_0x2bb197-0x0;var _0x152608=_0x9990[_0x2bb197];return _0x152608;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0999('0x0'));var zipdir=require(_0x0999('0x1'));var jsonpatch=require(_0x0999('0x2'));var rp=require(_0x0999('0x3'));var moment=require(_0x0999('0x4'));var BPromise=require(_0x0999('0x5'));var Mustache=require(_0x0999('0x6'));var util=require(_0x0999('0x7'));var path=require('path');var sox=require(_0x0999('0x8'));var csv=require(_0x0999('0x9'));var ejs=require(_0x0999('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0999('0xb'));var squel=require(_0x0999('0xc'));var crypto=require(_0x0999('0xd'));var jsforce=require(_0x0999('0xe'));var deskjs=require(_0x0999('0xf'));var toCsv=require(_0x0999('0x9'));var querystring=require(_0x0999('0x10'));var Papa=require('papaparse');var Redis=require(_0x0999('0x11'));var authService=require(_0x0999('0x12'));var qs=require(_0x0999('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0999('0x14'));var logger=require(_0x0999('0x15'))(_0x0999('0x16'));var utils=require('../../config/utils');var config=require(_0x0999('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0999('0x18'))['db'];function respondWithStatusCode(_0x36133e,_0x2ea251){_0x2ea251=_0x2ea251||0xcc;return function(_0x428b59){if(_0x428b59){return _0x36133e[_0x0999('0x19')](_0x2ea251);}return _0x36133e['status'](_0x2ea251)[_0x0999('0x1a')]();};}function respondWithResult(_0x2fa8e0,_0x39cba9){_0x39cba9=_0x39cba9||0xc8;return function(_0x4011bf){if(_0x4011bf){return _0x2fa8e0[_0x0999('0x1b')](_0x39cba9)['json'](_0x4011bf);}};}function respondWithFilteredResult(_0x137083,_0x3757ae){return function(_0x6bf882){if(_0x6bf882){var _0x4e4e53=typeof _0x3757ae[_0x0999('0x1c')]===_0x0999('0x1d')&&typeof _0x3757ae[_0x0999('0x1e')]==='undefined';var _0xa82828=_0x6bf882[_0x0999('0x1f')];var _0x4f6440=_0x4e4e53?0x0:_0x3757ae[_0x0999('0x1c')];var _0x5b14a3=_0x4e4e53?_0x6bf882['count']:_0x3757ae[_0x0999('0x1c')]+_0x3757ae[_0x0999('0x1e')];var _0x220cc3;if(_0x5b14a3>=_0xa82828){_0x5b14a3=_0xa82828;_0x220cc3=0xc8;}else{_0x220cc3=0xce;}_0x137083[_0x0999('0x1b')](_0x220cc3);return _0x137083[_0x0999('0x20')](_0x0999('0x21'),_0x4f6440+'-'+_0x5b14a3+'/'+_0xa82828)[_0x0999('0x22')](_0x6bf882);}return null;};}function patchUpdates(_0x113017){return function(_0x8a5ef6){try{jsonpatch['apply'](_0x8a5ef6,_0x113017,!![]);}catch(_0xe118ec){return BPromise[_0x0999('0x23')](_0xe118ec);}return _0x8a5ef6['save']();};}function saveUpdates(_0x505372,_0x19ddc0){return function(_0xf2820c){if(_0xf2820c){return _0xf2820c[_0x0999('0x24')](_0x505372)[_0x0999('0x25')](function(_0x6c9bd9){return _0x6c9bd9;});}return null;};}function removeEntity(_0x15a7e8,_0x4d4f38){return function(_0x20ba88){if(_0x20ba88){return _0x20ba88['destroy']()[_0x0999('0x25')](function(){_0x15a7e8['status'](0xcc)[_0x0999('0x1a')]();});}};}function handleEntityNotFound(_0x106669,_0x273163){return function(_0x317127){if(!_0x317127){_0x106669['sendStatus'](0x194);}return _0x317127;};}function handleError(_0x55c8b3,_0x1cc734){_0x1cc734=_0x1cc734||0x1f4;return function(_0x5e5681){logger[_0x0999('0x26')](_0x5e5681['stack']);if(_0x5e5681[_0x0999('0x27')]){delete _0x5e5681[_0x0999('0x27')];}_0x55c8b3[_0x0999('0x1b')](_0x1cc734)[_0x0999('0x28')](_0x5e5681);};}exports[_0x0999('0x29')]=function(_0x155d79,_0x3cf0d3){var _0x5c9fb4={},_0x1df4cf={},_0x199df7={'count':0x0,'rows':[]};var _0x36cd03=_[_0x0999('0x2a')](db[_0x0999('0x2b')]['rawAttributes'],function(_0x106bf9){return{'name':_0x106bf9[_0x0999('0x2c')],'type':_0x106bf9[_0x0999('0x2d')]['key']};});_0x1df4cf['model']=_[_0x0999('0x2a')](_0x36cd03,_0x0999('0x27'));_0x1df4cf['query']=_[_0x0999('0x2e')](_0x155d79[_0x0999('0x2f')]);_0x1df4cf[_0x0999('0x30')]=_['intersection'](_0x1df4cf[_0x0999('0x31')],_0x1df4cf['query']);_0x5c9fb4[_0x0999('0x32')]=_[_0x0999('0x33')](_0x1df4cf[_0x0999('0x31')],qs[_0x0999('0x34')](_0x155d79[_0x0999('0x2f')]['fields']));_0x5c9fb4['attributes']=_0x5c9fb4[_0x0999('0x32')][_0x0999('0x35')]?_0x5c9fb4[_0x0999('0x32')]:_0x1df4cf[_0x0999('0x31')];if(!_0x155d79['query'][_0x0999('0x36')](_0x0999('0x37'))){_0x5c9fb4['limit']=qs[_0x0999('0x1e')](_0x155d79[_0x0999('0x2f')][_0x0999('0x1e')]);_0x5c9fb4[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x155d79[_0x0999('0x2f')]['offset']);}_0x5c9fb4[_0x0999('0x38')]=qs['sort'](_0x155d79[_0x0999('0x2f')][_0x0999('0x39')]);_0x5c9fb4[_0x0999('0x3a')]=qs['filters'](_[_0x0999('0x3b')](_0x155d79[_0x0999('0x2f')],_0x1df4cf[_0x0999('0x30')]),_0x36cd03);if(_0x155d79[_0x0999('0x2f')][_0x0999('0x3c')]){_0x5c9fb4[_0x0999('0x3a')]=_[_0x0999('0x3d')](_0x5c9fb4[_0x0999('0x3a')],{'$or':_[_0x0999('0x2a')](_0x36cd03,function(_0x2aa04c){if(_0x2aa04c['type']!==_0x0999('0x3e')){var _0x22da38={};_0x22da38[_0x2aa04c['name']]={'$like':'%'+_0x155d79[_0x0999('0x2f')][_0x0999('0x3c')]+'%'};return _0x22da38;}})});}_0x5c9fb4=_[_0x0999('0x3d')]({},_0x5c9fb4,_0x155d79[_0x0999('0x3f')]);var _0x41da42={'where':_0x5c9fb4['where']};return db[_0x0999('0x2b')][_0x0999('0x1f')](_0x41da42)[_0x0999('0x25')](function(_0x57cdf7){_0x199df7[_0x0999('0x1f')]=_0x57cdf7;if(_0x155d79[_0x0999('0x2f')][_0x0999('0x40')]){_0x5c9fb4[_0x0999('0x41')]=[{'all':!![]}];}return db[_0x0999('0x2b')][_0x0999('0x42')](_0x5c9fb4);})[_0x0999('0x25')](function(_0x315ca3){_0x199df7[_0x0999('0x43')]=_0x315ca3;return _0x199df7;})[_0x0999('0x25')](respondWithFilteredResult(_0x3cf0d3,_0x5c9fb4))[_0x0999('0x44')](handleError(_0x3cf0d3,null));};exports[_0x0999('0x45')]=function(_0x5aa926,_0xc632f4){var _0x266982={'raw':!![],'where':{'id':_0x5aa926['params']['id']}},_0x47edb3={};_0x47edb3[_0x0999('0x31')]=_['keys'](db['FaxQueueReport'][_0x0999('0x46')]);_0x47edb3[_0x0999('0x2f')]=_[_0x0999('0x2e')](_0x5aa926[_0x0999('0x2f')]);_0x47edb3[_0x0999('0x30')]=_[_0x0999('0x33')](_0x47edb3[_0x0999('0x31')],_0x47edb3[_0x0999('0x2f')]);_0x266982[_0x0999('0x32')]=_[_0x0999('0x33')](_0x47edb3[_0x0999('0x31')],qs['fields'](_0x5aa926['query'][_0x0999('0x34')]));_0x266982[_0x0999('0x32')]=_0x266982[_0x0999('0x32')][_0x0999('0x35')]?_0x266982[_0x0999('0x32')]:_0x47edb3[_0x0999('0x31')];if(_0x5aa926[_0x0999('0x2f')][_0x0999('0x40')]){_0x266982['include']=[{'all':!![]}];}_0x266982=_['merge']({},_0x266982,_0x5aa926[_0x0999('0x3f')]);return db[_0x0999('0x2b')]['find'](_0x266982)[_0x0999('0x25')](handleEntityNotFound(_0xc632f4,null))['then'](respondWithResult(_0xc632f4,null))['catch'](handleError(_0xc632f4,null));};exports[_0x0999('0x47')]=function(_0x1ddd6e,_0x433a6d){return db[_0x0999('0x2b')][_0x0999('0x47')](_0x1ddd6e[_0x0999('0x48')],{})[_0x0999('0x25')](respondWithResult(_0x433a6d,0xc9))[_0x0999('0x44')](handleError(_0x433a6d,null));};exports[_0x0999('0x24')]=function(_0x508e42,_0x2ee544){if(_0x508e42[_0x0999('0x48')]['id']){delete _0x508e42[_0x0999('0x48')]['id'];}return db[_0x0999('0x2b')][_0x0999('0x49')]({'where':{'id':_0x508e42[_0x0999('0x4a')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x2ee544,null))[_0x0999('0x25')](saveUpdates(_0x508e42[_0x0999('0x48')],null))['then'](respondWithResult(_0x2ee544,null))[_0x0999('0x44')](handleError(_0x2ee544,null));};exports['destroy']=function(_0x28924a,_0x218092){return db[_0x0999('0x2b')][_0x0999('0x49')]({'where':{'id':_0x28924a[_0x0999('0x4a')]['id']}})['then'](handleEntityNotFound(_0x218092,null))[_0x0999('0x25')](removeEntity(_0x218092,null))[_0x0999('0x44')](handleError(_0x218092,null));};exports[_0x0999('0x4b')]=function(_0x17942e,_0x3f42f8){return db[_0x0999('0x2b')]['describe']()[_0x0999('0x25')](respondWithResult(_0x3f42f8,null))[_0x0999('0x44')](handleError(_0x3f42f8,null));}; \ No newline at end of file +var _0xde56=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','FaxQueueReport','rows','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde56,0x144));var _0x6de5=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0xde56[_0x553150];return _0x18193d;};'use strict';var emlformat=require(_0x6de5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6de5('0x1'));var jsonpatch=require(_0x6de5('0x2'));var rp=require(_0x6de5('0x3'));var moment=require(_0x6de5('0x4'));var BPromise=require(_0x6de5('0x5'));var Mustache=require(_0x6de5('0x6'));var util=require(_0x6de5('0x7'));var path=require(_0x6de5('0x8'));var sox=require(_0x6de5('0x9'));var csv=require(_0x6de5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6de5('0xb'));var _=require(_0x6de5('0xc'));var squel=require(_0x6de5('0xd'));var crypto=require(_0x6de5('0xe'));var jsforce=require(_0x6de5('0xf'));var deskjs=require(_0x6de5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6de5('0x11'));var Redis=require(_0x6de5('0x12'));var authService=require(_0x6de5('0x13'));var qs=require(_0x6de5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6de5('0x15'));var logger=require(_0x6de5('0x16'))(_0x6de5('0x17'));var utils=require(_0x6de5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6de5('0x19'));var db=require(_0x6de5('0x1a'))['db'];function respondWithStatusCode(_0x550496,_0x2e0d4d){_0x2e0d4d=_0x2e0d4d||0xcc;return function(_0x10f7de){if(_0x10f7de){return _0x550496[_0x6de5('0x1b')](_0x2e0d4d);}return _0x550496[_0x6de5('0x1c')](_0x2e0d4d)['end']();};}function respondWithResult(_0x39a96f,_0x13405e){_0x13405e=_0x13405e||0xc8;return function(_0x3c65c3){if(_0x3c65c3){return _0x39a96f[_0x6de5('0x1c')](_0x13405e)['json'](_0x3c65c3);}};}function respondWithFilteredResult(_0x2d370d,_0x1a6cab){return function(_0x11fcdb){if(_0x11fcdb){var _0x2e61ca=typeof _0x1a6cab['offset']===_0x6de5('0x1d')&&typeof _0x1a6cab[_0x6de5('0x1e')]===_0x6de5('0x1d');var _0xafa2a=_0x11fcdb['count'];var _0x1752f5=_0x2e61ca?0x0:_0x1a6cab[_0x6de5('0x1f')];var _0x385ade=_0x2e61ca?_0x11fcdb[_0x6de5('0x20')]:_0x1a6cab['offset']+_0x1a6cab['limit'];var _0x36c782;if(_0x385ade>=_0xafa2a){_0x385ade=_0xafa2a;_0x36c782=0xc8;}else{_0x36c782=0xce;}_0x2d370d['status'](_0x36c782);return _0x2d370d['set'](_0x6de5('0x21'),_0x1752f5+'-'+_0x385ade+'/'+_0xafa2a)['json'](_0x11fcdb);}return null;};}function patchUpdates(_0x37a64d){return function(_0x319e9c){try{jsonpatch[_0x6de5('0x22')](_0x319e9c,_0x37a64d,!![]);}catch(_0x5d7351){return BPromise[_0x6de5('0x23')](_0x5d7351);}return _0x319e9c['save']();};}function saveUpdates(_0x5ebeb4,_0x4c9621){return function(_0x4f9dd1){if(_0x4f9dd1){return _0x4f9dd1[_0x6de5('0x24')](_0x5ebeb4)[_0x6de5('0x25')](function(_0x3b1096){return _0x3b1096;});}return null;};}function removeEntity(_0x26c9d6,_0x2272dc){return function(_0x28ba44){if(_0x28ba44){return _0x28ba44[_0x6de5('0x26')]()['then'](function(){_0x26c9d6['status'](0xcc)[_0x6de5('0x27')]();});}};}function handleEntityNotFound(_0x685c78,_0x4a2ffd){return function(_0x2e27d0){if(!_0x2e27d0){_0x685c78[_0x6de5('0x1b')](0x194);}return _0x2e27d0;};}function handleError(_0x42bb5a,_0x5ebd66){_0x5ebd66=_0x5ebd66||0x1f4;return function(_0x31ec12){logger[_0x6de5('0x28')](_0x31ec12[_0x6de5('0x29')]);if(_0x31ec12[_0x6de5('0x2a')]){delete _0x31ec12[_0x6de5('0x2a')];}_0x42bb5a[_0x6de5('0x1c')](_0x5ebd66)[_0x6de5('0x2b')](_0x31ec12);};}exports[_0x6de5('0x2c')]=function(_0x46b678,_0x5aed57){var _0x1e1810={},_0xf3db96={},_0x3fc237={'count':0x0,'rows':[]};var _0x475c2f=_[_0x6de5('0x2d')](db['FaxQueueReport']['rawAttributes'],function(_0x47d029){return{'name':_0x47d029[_0x6de5('0x2e')],'type':_0x47d029[_0x6de5('0x2f')]['key']};});_0xf3db96[_0x6de5('0x30')]=_[_0x6de5('0x2d')](_0x475c2f,_0x6de5('0x2a'));_0xf3db96[_0x6de5('0x31')]=_[_0x6de5('0x32')](_0x46b678[_0x6de5('0x31')]);_0xf3db96[_0x6de5('0x33')]=_['intersection'](_0xf3db96[_0x6de5('0x30')],_0xf3db96[_0x6de5('0x31')]);_0x1e1810['attributes']=_[_0x6de5('0x34')](_0xf3db96[_0x6de5('0x30')],qs[_0x6de5('0x35')](_0x46b678[_0x6de5('0x31')][_0x6de5('0x35')]));_0x1e1810[_0x6de5('0x36')]=_0x1e1810[_0x6de5('0x36')][_0x6de5('0x37')]?_0x1e1810[_0x6de5('0x36')]:_0xf3db96[_0x6de5('0x30')];if(!_0x46b678[_0x6de5('0x31')][_0x6de5('0x38')]('nolimit')){_0x1e1810[_0x6de5('0x1e')]=qs[_0x6de5('0x1e')](_0x46b678[_0x6de5('0x31')][_0x6de5('0x1e')]);_0x1e1810['offset']=qs['offset'](_0x46b678['query'][_0x6de5('0x1f')]);}_0x1e1810[_0x6de5('0x39')]=qs[_0x6de5('0x3a')](_0x46b678[_0x6de5('0x31')]['sort']);_0x1e1810[_0x6de5('0x3b')]=qs['filters'](_['pick'](_0x46b678['query'],_0xf3db96[_0x6de5('0x33')]),_0x475c2f);if(_0x46b678[_0x6de5('0x31')]['filter']){_0x1e1810['where']=_[_0x6de5('0x3c')](_0x1e1810[_0x6de5('0x3b')],{'$or':_[_0x6de5('0x2d')](_0x475c2f,function(_0x392210){if(_0x392210['type']!==_0x6de5('0x3d')){var _0x4ca3c5={};_0x4ca3c5[_0x392210[_0x6de5('0x2a')]]={'$like':'%'+_0x46b678['query'][_0x6de5('0x3e')]+'%'};return _0x4ca3c5;}})});}_0x1e1810=_[_0x6de5('0x3c')]({},_0x1e1810,_0x46b678['options']);var _0x331a8f={'where':_0x1e1810[_0x6de5('0x3b')]};return db['FaxQueueReport'][_0x6de5('0x20')](_0x331a8f)[_0x6de5('0x25')](function(_0x1840e4){_0x3fc237[_0x6de5('0x20')]=_0x1840e4;if(_0x46b678[_0x6de5('0x31')][_0x6de5('0x3f')]){_0x1e1810['include']=[{'all':!![]}];}return db[_0x6de5('0x40')]['findAll'](_0x1e1810);})['then'](function(_0x567c74){_0x3fc237[_0x6de5('0x41')]=_0x567c74;return _0x3fc237;})['then'](respondWithFilteredResult(_0x5aed57,_0x1e1810))[_0x6de5('0x42')](handleError(_0x5aed57,null));};exports['show']=function(_0xbac85b,_0x40695e){var _0x2268fc={'raw':!![],'where':{'id':_0xbac85b[_0x6de5('0x43')]['id']}},_0x3bc554={};_0x3bc554[_0x6de5('0x30')]=_[_0x6de5('0x32')](db['FaxQueueReport'][_0x6de5('0x44')]);_0x3bc554[_0x6de5('0x31')]=_[_0x6de5('0x32')](_0xbac85b[_0x6de5('0x31')]);_0x3bc554[_0x6de5('0x33')]=_[_0x6de5('0x34')](_0x3bc554['model'],_0x3bc554[_0x6de5('0x31')]);_0x2268fc[_0x6de5('0x36')]=_[_0x6de5('0x34')](_0x3bc554[_0x6de5('0x30')],qs['fields'](_0xbac85b['query'][_0x6de5('0x35')]));_0x2268fc[_0x6de5('0x36')]=_0x2268fc[_0x6de5('0x36')]['length']?_0x2268fc[_0x6de5('0x36')]:_0x3bc554[_0x6de5('0x30')];if(_0xbac85b[_0x6de5('0x31')][_0x6de5('0x3f')]){_0x2268fc[_0x6de5('0x45')]=[{'all':!![]}];}_0x2268fc=_[_0x6de5('0x3c')]({},_0x2268fc,_0xbac85b[_0x6de5('0x46')]);return db[_0x6de5('0x40')][_0x6de5('0x47')](_0x2268fc)['then'](handleEntityNotFound(_0x40695e,null))[_0x6de5('0x25')](respondWithResult(_0x40695e,null))[_0x6de5('0x42')](handleError(_0x40695e,null));};exports[_0x6de5('0x48')]=function(_0x5cf643,_0x3dfff7){return db['FaxQueueReport']['create'](_0x5cf643[_0x6de5('0x49')],{})['then'](respondWithResult(_0x3dfff7,0xc9))[_0x6de5('0x42')](handleError(_0x3dfff7,null));};exports[_0x6de5('0x24')]=function(_0xb21944,_0xb55785){if(_0xb21944[_0x6de5('0x49')]['id']){delete _0xb21944[_0x6de5('0x49')]['id'];}return db[_0x6de5('0x40')][_0x6de5('0x47')]({'where':{'id':_0xb21944[_0x6de5('0x43')]['id']}})[_0x6de5('0x25')](handleEntityNotFound(_0xb55785,null))['then'](saveUpdates(_0xb21944['body'],null))['then'](respondWithResult(_0xb55785,null))[_0x6de5('0x42')](handleError(_0xb55785,null));};exports[_0x6de5('0x26')]=function(_0xd32813,_0x5b2572){return db['FaxQueueReport'][_0x6de5('0x47')]({'where':{'id':_0xd32813[_0x6de5('0x43')]['id']}})[_0x6de5('0x25')](handleEntityNotFound(_0x5b2572,null))[_0x6de5('0x25')](removeEntity(_0x5b2572,null))[_0x6de5('0x42')](handleError(_0x5b2572,null));};exports[_0x6de5('0x4a')]=function(_0x34fcd6,_0x230c97){return db[_0x6de5('0x40')][_0x6de5('0x4a')]()['then'](respondWithResult(_0x230c97,null))[_0x6de5('0x42')](handleError(_0x230c97,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 34cd3ed..f583362 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x4243c0,_0x467e81){var _0x3b2eda=function(_0x4fd6f9){while(--_0x4fd6f9){_0x4243c0['push'](_0x4243c0['shift']());}};_0x3b2eda(++_0x467e81);}(_0x326f,0xd1));var _0xf326=function(_0x1ec372,_0x133369){_0x1ec372=_0x1ec372-0x0;var _0x4331d4=_0x326f[_0x1ec372];return _0x4331d4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x5815c4,_0x512694){var _0x51f2f8=function(_0x2a8714){while(--_0x2a8714){_0x5815c4['push'](_0x5815c4['shift']());}};_0x51f2f8(++_0x512694);}(_0xabce,0x103));var _0xeabc=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xabce[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 1d79014..30cd05c 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 _0xe4f2=['request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','update','body','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3e94d1,_0x2d264e){var _0x5b4d1e=function(_0x2b0e06){while(--_0x2b0e06){_0x3e94d1['push'](_0x3e94d1['shift']());}};_0x5b4d1e(++_0x2d264e);}(_0xe4f2,0xed));var _0x2e4f=function(_0x37026f,_0x2df88f){_0x37026f=_0x37026f-0x0;var _0x40cb74=_0xe4f2[_0x37026f];return _0x40cb74;};'use strict';var _=require(_0x2e4f('0x0'));var util=require(_0x2e4f('0x1'));var moment=require('moment');var BPromise=require(_0x2e4f('0x2'));var rs=require(_0x2e4f('0x3'));var fs=require('fs');var Redis=require(_0x2e4f('0x4'));var db=require(_0x2e4f('0x5'))['db'];var utils=require(_0x2e4f('0x6'));var logger=require(_0x2e4f('0x7'))(_0x2e4f('0x8'));var config=require(_0x2e4f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2e4f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x410183,_0x53ab20,_0x748663){return new BPromise(function(_0x51f022,_0x203d91){return client[_0x2e4f('0xb')](_0x410183,_0x748663)[_0x2e4f('0xc')](function(_0x57bf47){logger['info'](_0x2e4f('0xd'),_0x53ab20,_0x2e4f('0xe'));logger[_0x2e4f('0xf')](_0x2e4f('0x10'),_0x53ab20,'request\x20sent',JSON[_0x2e4f('0x11')](_0x57bf47));if(_0x57bf47[_0x2e4f('0x12')]){if(_0x57bf47[_0x2e4f('0x12')]['code']===0x1f4){logger[_0x2e4f('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x53ab20,_0x57bf47[_0x2e4f('0x12')]['message']);return _0x203d91(_0x57bf47['error']['message']);}logger['error'](_0x2e4f('0xd'),_0x53ab20,_0x57bf47['error'][_0x2e4f('0x13')]);return _0x51f022(_0x57bf47['error'][_0x2e4f('0x13')]);}else{logger['info'](_0x2e4f('0xd'),_0x53ab20,_0x2e4f('0xe'));_0x51f022(_0x57bf47[_0x2e4f('0x14')][_0x2e4f('0x13')]);}})[_0x2e4f('0x15')](function(_0x23a489){logger[_0x2e4f('0x12')](_0x2e4f('0xd'),_0x53ab20,_0x23a489);_0x203d91(_0x23a489);});});}exports[_0x2e4f('0x16')]=function(_0x14086c){var _0x31f8b2=this;return new Promise(function(_0xc1f870,_0x534a1e){return db[_0x2e4f('0x17')]['create'](_0x14086c['body'],{'raw':_0x14086c[_0x2e4f('0x18')]?_0x14086c[_0x2e4f('0x18')][_0x2e4f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x376e32){logger['info'](_0x2e4f('0x16'),_0x14086c);logger[_0x2e4f('0xf')](_0x2e4f('0x16'),_0x14086c,JSON[_0x2e4f('0x11')](_0x376e32));_0xc1f870(_0x376e32);})['catch'](function(_0x4e14fa){logger[_0x2e4f('0x12')]('CreateFaxQueueReport',_0x4e14fa[_0x2e4f('0x13')],_0x14086c);_0x534a1e(_0x31f8b2['error'](0x1f4,_0x4e14fa[_0x2e4f('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x415de8){var _0x575786=this;return new Promise(function(_0x2d3560,_0x272e98){return db[_0x2e4f('0x17')][_0x2e4f('0x1a')](_0x415de8[_0x2e4f('0x1b')],{'raw':_0x415de8[_0x2e4f('0x18')]?_0x415de8['options'][_0x2e4f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415de8[_0x2e4f('0x18')]?_0x415de8[_0x2e4f('0x18')]['where']||null:null,'attributes':_0x415de8[_0x2e4f('0x18')]?_0x415de8[_0x2e4f('0x18')][_0x2e4f('0x1c')]||null:null,'limit':_0x415de8['options']?_0x415de8['options'][_0x2e4f('0x1d')]||null:null})['then'](function(_0x4af8fa){logger['info'](_0x2e4f('0x1e'),_0x415de8);logger['debug'](_0x2e4f('0x1e'),_0x415de8,JSON[_0x2e4f('0x11')](_0x4af8fa));_0x2d3560(_0x4af8fa);})['catch'](function(_0x33f78f){logger[_0x2e4f('0x12')](_0x2e4f('0x1e'),_0x33f78f[_0x2e4f('0x13')],_0x415de8);_0x272e98(_0x575786[_0x2e4f('0x12')](0x1f4,_0x33f78f['message']));});});}; \ No newline at end of file +var _0xc9b3=['stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','where','limit','UpdateFaxQueueReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1ee64d,_0x14849b){var _0x33d61e=function(_0x242e58){while(--_0x242e58){_0x1ee64d['push'](_0x1ee64d['shift']());}};_0x33d61e(++_0x14849b);}(_0xc9b3,0x93));var _0x3c9b=function(_0x501fa6,_0x4a176d){_0x501fa6=_0x501fa6-0x0;var _0x30423d=_0xc9b3[_0x501fa6];return _0x30423d;};'use strict';var _=require(_0x3c9b('0x0'));var util=require(_0x3c9b('0x1'));var moment=require(_0x3c9b('0x2'));var BPromise=require(_0x3c9b('0x3'));var rs=require(_0x3c9b('0x4'));var fs=require('fs');var Redis=require(_0x3c9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c9b('0x6'));var config=require(_0x3c9b('0x7'));var jayson=require(_0x3c9b('0x8'));var client=jayson[_0x3c9b('0x9')][_0x3c9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26e5e8,_0x22c177,_0x49e655){return new BPromise(function(_0x3b8a3d,_0x21821b){return client[_0x3c9b('0xb')](_0x26e5e8,_0x49e655)[_0x3c9b('0xc')](function(_0x386a6f){logger[_0x3c9b('0xd')](_0x3c9b('0xe'),_0x22c177,_0x3c9b('0xf'));logger[_0x3c9b('0x10')](_0x3c9b('0x11'),_0x22c177,_0x3c9b('0xf'),JSON[_0x3c9b('0x12')](_0x386a6f));if(_0x386a6f[_0x3c9b('0x13')]){if(_0x386a6f[_0x3c9b('0x13')]['code']===0x1f4){logger[_0x3c9b('0x13')](_0x3c9b('0xe'),_0x22c177,_0x386a6f['error']['message']);return _0x21821b(_0x386a6f[_0x3c9b('0x13')][_0x3c9b('0x14')]);}logger['error'](_0x3c9b('0xe'),_0x22c177,_0x386a6f[_0x3c9b('0x13')][_0x3c9b('0x14')]);return _0x3b8a3d(_0x386a6f[_0x3c9b('0x13')]['message']);}else{logger[_0x3c9b('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x22c177,_0x3c9b('0xf'));_0x3b8a3d(_0x386a6f[_0x3c9b('0x15')][_0x3c9b('0x14')]);}})['catch'](function(_0x316de9){logger[_0x3c9b('0x13')](_0x3c9b('0xe'),_0x22c177,_0x316de9);_0x21821b(_0x316de9);});});}exports[_0x3c9b('0x16')]=function(_0x45deb8){var _0x109dd5=this;return new Promise(function(_0x17357c,_0x5b361d){return db[_0x3c9b('0x17')][_0x3c9b('0x18')](_0x45deb8[_0x3c9b('0x19')],{'raw':_0x45deb8[_0x3c9b('0x1a')]?_0x45deb8[_0x3c9b('0x1a')][_0x3c9b('0x1b')]===undefined?!![]:![]:!![]})[_0x3c9b('0xc')](function(_0x177acf){logger['info']('CreateFaxQueueReport',_0x45deb8);logger[_0x3c9b('0x10')](_0x3c9b('0x16'),_0x45deb8,JSON[_0x3c9b('0x12')](_0x177acf));_0x17357c(_0x177acf);})['catch'](function(_0x55f3ae){logger[_0x3c9b('0x13')](_0x3c9b('0x16'),_0x55f3ae[_0x3c9b('0x14')],_0x45deb8);_0x5b361d(_0x109dd5[_0x3c9b('0x13')](0x1f4,_0x55f3ae[_0x3c9b('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x3f6637){var _0x18ff9e=this;return new Promise(function(_0xa30a55,_0x12abd4){return db[_0x3c9b('0x17')][_0x3c9b('0x1c')](_0x3f6637[_0x3c9b('0x19')],{'raw':_0x3f6637['options']?_0x3f6637[_0x3c9b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6637[_0x3c9b('0x1a')]?_0x3f6637[_0x3c9b('0x1a')][_0x3c9b('0x1d')]||null:null,'attributes':_0x3f6637[_0x3c9b('0x1a')]?_0x3f6637[_0x3c9b('0x1a')]['attributes']||null:null,'limit':_0x3f6637[_0x3c9b('0x1a')]?_0x3f6637[_0x3c9b('0x1a')][_0x3c9b('0x1e')]||null:null})[_0x3c9b('0xc')](function(_0x3264f5){logger[_0x3c9b('0xd')](_0x3c9b('0x1f'),_0x3f6637);logger['debug'](_0x3c9b('0x1f'),_0x3f6637,JSON['stringify'](_0x3264f5));_0xa30a55(_0x3264f5);})[_0x3c9b('0x20')](function(_0x150439){logger[_0x3c9b('0x13')](_0x3c9b('0x1f'),_0x150439[_0x3c9b('0x14')],_0x3f6637);_0x12abd4(_0x18ff9e[_0x3c9b('0x13')](0x1f4,_0x150439[_0x3c9b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 2021704..bb3cc04 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 _0x6156=['isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6156,0xd2));var _0x6615=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x6156[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require(_0x6615('0x0'));var path=require(_0x6615('0x1'));var timeout=require(_0x6615('0x2'));var express=require(_0x6615('0x3'));var router=express['Router']();var fs_extra=require(_0x6615('0x4'));var auth=require(_0x6615('0x5'));var interaction=require(_0x6615('0x6'));var config=require(_0x6615('0x7'));var controller=require(_0x6615('0x8'));router[_0x6615('0x9')]('/',auth[_0x6615('0xa')](),controller['index']);router['get'](_0x6615('0xb'),auth[_0x6615('0xa')](),controller[_0x6615('0xc')]);router[_0x6615('0x9')](_0x6615('0xd'),auth[_0x6615('0xa')](),controller[_0x6615('0xe')]);router[_0x6615('0xf')]('/',auth[_0x6615('0xa')](),controller[_0x6615('0x10')]);router['put'](_0x6615('0xd'),auth[_0x6615('0xa')](),controller[_0x6615('0x11')]);router[_0x6615('0x12')](_0x6615('0xd'),auth[_0x6615('0xa')](),controller[_0x6615('0x13')]);module['exports']=router; \ No newline at end of file +var _0xdf3e=['./faxQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdf3e,0x176));var _0xedf3=function(_0x371755,_0x253725){_0x371755=_0x371755-0x0;var _0x6980e9=_0xdf3e[_0x371755];return _0x6980e9;};'use strict';var multer=require(_0xedf3('0x0'));var util=require(_0xedf3('0x1'));var path=require(_0xedf3('0x2'));var timeout=require(_0xedf3('0x3'));var express=require(_0xedf3('0x4'));var router=express[_0xedf3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedf3('0x6'));router['get']('/',auth[_0xedf3('0x7')](),controller[_0xedf3('0x8')]);router['get'](_0xedf3('0x9'),auth[_0xedf3('0x7')](),controller[_0xedf3('0xa')]);router[_0xedf3('0xb')](_0xedf3('0xc'),auth['isAuthenticated'](),controller[_0xedf3('0xd')]);router[_0xedf3('0xe')]('/',auth[_0xedf3('0x7')](),controller['create']);router[_0xedf3('0xf')](_0xedf3('0xc'),auth[_0xedf3('0x7')](),controller[_0xedf3('0x10')]);router[_0xedf3('0x11')]('/:id',auth[_0xedf3('0x7')](),controller[_0xedf3('0x12')]);module[_0xedf3('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 52f8fae..982f84e 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x49141a,_0x1d83c4){var _0x38c8c6=function(_0x514697){while(--_0x514697){_0x49141a['push'](_0x49141a['shift']());}};_0x38c8c6(++_0x1d83c4);}(_0x70e0,0x17b));var _0x070e=function(_0xea412b,_0x5a080c){_0xea412b=_0xea412b-0x0;var _0x314c84=_0x70e0[_0xea412b];return _0x314c84;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3187b0,_0x4cee2a){var _0x12c691=function(_0x25f27c){while(--_0x25f27c){_0x3187b0['push'](_0x3187b0['shift']());}};_0x12c691(++_0x4cee2a);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1d0e91a..87b014e 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 _0x1d1c=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x1d7216,_0x254f5b){var _0xd3e597=function(_0x2988ca){while(--_0x2988ca){_0x1d7216['push'](_0x1d7216['shift']());}};_0xd3e597(++_0x254f5b);}(_0x1d1c,0x1be));var _0xc1d1=function(_0x3572c5,_0x3bdc11){_0x3572c5=_0x3572c5-0x0;var _0x109a4c=_0x1d1c[_0x3572c5];return _0x109a4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1d1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1d1('0x1'));var rp=require(_0xc1d1('0x2'));var moment=require(_0xc1d1('0x3'));var BPromise=require(_0xc1d1('0x4'));var Mustache=require(_0xc1d1('0x5'));var util=require(_0xc1d1('0x6'));var path=require(_0xc1d1('0x7'));var sox=require(_0xc1d1('0x8'));var csv=require(_0xc1d1('0x9'));var ejs=require(_0xc1d1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1d1('0xb'));var squel=require(_0xc1d1('0xc'));var crypto=require(_0xc1d1('0xd'));var jsforce=require(_0xc1d1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc1d1('0x9'));var querystring=require(_0xc1d1('0xf'));var Papa=require('papaparse');var Redis=require(_0xc1d1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc1d1('0x11'));var as=require(_0xc1d1('0x12'));var hardwareService=require(_0xc1d1('0x13'));var logger=require(_0xc1d1('0x14'))(_0xc1d1('0x15'));var utils=require(_0xc1d1('0x16'));var config=require(_0xc1d1('0x17'));var licenseUtil=require(_0xc1d1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256363,_0x422db8){_0x422db8=_0x422db8||0xcc;return function(_0xb681ac){if(_0xb681ac){return _0x256363[_0xc1d1('0x19')](_0x422db8);}return _0x256363[_0xc1d1('0x1a')](_0x422db8)[_0xc1d1('0x1b')]();};}function respondWithResult(_0x9d0e9e,_0x4f8c95){_0x4f8c95=_0x4f8c95||0xc8;return function(_0x4d07a2){if(_0x4d07a2){return _0x9d0e9e['status'](_0x4f8c95)[_0xc1d1('0x1c')](_0x4d07a2);}};}function respondWithFilteredResult(_0x3a4e22,_0xffcb62){return function(_0x4bb77a){if(_0x4bb77a){var _0x238099=typeof _0xffcb62[_0xc1d1('0x1d')]===_0xc1d1('0x1e')&&typeof _0xffcb62[_0xc1d1('0x1f')]==='undefined';var _0x122b79=_0x4bb77a[_0xc1d1('0x20')];var _0x4e7e0e=_0x238099?0x0:_0xffcb62[_0xc1d1('0x1d')];var _0x5c0e98=_0x238099?_0x4bb77a[_0xc1d1('0x20')]:_0xffcb62[_0xc1d1('0x1d')]+_0xffcb62[_0xc1d1('0x1f')];var _0x44af0f;if(_0x5c0e98>=_0x122b79){_0x5c0e98=_0x122b79;_0x44af0f=0xc8;}else{_0x44af0f=0xce;}_0x3a4e22[_0xc1d1('0x1a')](_0x44af0f);return _0x3a4e22[_0xc1d1('0x21')](_0xc1d1('0x22'),_0x4e7e0e+'-'+_0x5c0e98+'/'+_0x122b79)[_0xc1d1('0x1c')](_0x4bb77a);}return null;};}function patchUpdates(_0x128a16){return function(_0x497d16){try{jsonpatch['apply'](_0x497d16,_0x128a16,!![]);}catch(_0x578d17){return BPromise[_0xc1d1('0x23')](_0x578d17);}return _0x497d16['save']();};}function saveUpdates(_0x4440a3,_0xab2ee2){return function(_0x2f35dd){if(_0x2f35dd){return _0x2f35dd[_0xc1d1('0x24')](_0x4440a3)[_0xc1d1('0x25')](function(_0x5436a7){return _0x5436a7;});}return null;};}function removeEntity(_0x2f92e5,_0x1c9c56){return function(_0x1d20d2){if(_0x1d20d2){return _0x1d20d2[_0xc1d1('0x26')]()[_0xc1d1('0x25')](function(){_0x2f92e5[_0xc1d1('0x1a')](0xcc)[_0xc1d1('0x1b')]();});}};}function handleEntityNotFound(_0x13bfa7,_0x1ee7fb){return function(_0x55384e){if(!_0x55384e){_0x13bfa7[_0xc1d1('0x19')](0x194);}return _0x55384e;};}function handleError(_0x3c2389,_0x1e9cf3){_0x1e9cf3=_0x1e9cf3||0x1f4;return function(_0x1c61a9){logger['error'](_0x1c61a9[_0xc1d1('0x27')]);if(_0x1c61a9['name']){delete _0x1c61a9[_0xc1d1('0x28')];}_0x3c2389[_0xc1d1('0x1a')](_0x1e9cf3)[_0xc1d1('0x29')](_0x1c61a9);};}exports[_0xc1d1('0x2a')]=function(_0x2673d7,_0x2677e8){var _0x2bb96d={},_0x3b0c08={},_0x481086={'count':0x0,'rows':[]};var _0x38cd26=_['map'](db['FaxTransferReport'][_0xc1d1('0x2b')],function(_0x30c3b3){return{'name':_0x30c3b3[_0xc1d1('0x2c')],'type':_0x30c3b3[_0xc1d1('0x2d')][_0xc1d1('0x2e')]};});_0x3b0c08[_0xc1d1('0x2f')]=_[_0xc1d1('0x30')](_0x38cd26,'name');_0x3b0c08[_0xc1d1('0x31')]=_[_0xc1d1('0x32')](_0x2673d7[_0xc1d1('0x31')]);_0x3b0c08[_0xc1d1('0x33')]=_[_0xc1d1('0x34')](_0x3b0c08[_0xc1d1('0x2f')],_0x3b0c08[_0xc1d1('0x31')]);_0x2bb96d['attributes']=_[_0xc1d1('0x34')](_0x3b0c08[_0xc1d1('0x2f')],qs['fields'](_0x2673d7[_0xc1d1('0x31')]['fields']));_0x2bb96d[_0xc1d1('0x35')]=_0x2bb96d[_0xc1d1('0x35')][_0xc1d1('0x36')]?_0x2bb96d[_0xc1d1('0x35')]:_0x3b0c08[_0xc1d1('0x2f')];if(!_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x37')](_0xc1d1('0x38'))){_0x2bb96d[_0xc1d1('0x1f')]=qs[_0xc1d1('0x1f')](_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x1f')]);_0x2bb96d[_0xc1d1('0x1d')]=qs[_0xc1d1('0x1d')](_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x1d')]);}_0x2bb96d[_0xc1d1('0x39')]=qs['sort'](_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x3a')]);_0x2bb96d[_0xc1d1('0x3b')]=qs[_0xc1d1('0x33')](_[_0xc1d1('0x3c')](_0x2673d7[_0xc1d1('0x31')],_0x3b0c08[_0xc1d1('0x33')]),_0x38cd26);if(_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x3d')]){_0x2bb96d[_0xc1d1('0x3b')]=_['merge'](_0x2bb96d[_0xc1d1('0x3b')],{'$or':_[_0xc1d1('0x30')](_0x38cd26,function(_0x1ba259){if(_0x1ba259[_0xc1d1('0x2d')]!=='VIRTUAL'){var _0x2873b4={};_0x2873b4[_0x1ba259[_0xc1d1('0x28')]]={'$like':'%'+_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x3d')]+'%'};return _0x2873b4;}})});}_0x2bb96d=_[_0xc1d1('0x3e')]({},_0x2bb96d,_0x2673d7['options']);var _0x384c3a={'where':_0x2bb96d[_0xc1d1('0x3b')]};return db[_0xc1d1('0x3f')]['count'](_0x384c3a)['then'](function(_0x26a673){_0x481086['count']=_0x26a673;if(_0x2673d7[_0xc1d1('0x31')][_0xc1d1('0x40')]){_0x2bb96d[_0xc1d1('0x41')]=[{'all':!![]}];}return db[_0xc1d1('0x3f')][_0xc1d1('0x42')](_0x2bb96d);})[_0xc1d1('0x25')](function(_0x83a471){_0x481086[_0xc1d1('0x43')]=_0x83a471;return _0x481086;})[_0xc1d1('0x25')](respondWithFilteredResult(_0x2677e8,_0x2bb96d))[_0xc1d1('0x44')](handleError(_0x2677e8,null));};exports[_0xc1d1('0x45')]=function(_0xc108bb,_0x2b2800){var _0x58cc82={'raw':!![],'where':{'id':_0xc108bb[_0xc1d1('0x46')]['id']}},_0x281b52={};_0x281b52[_0xc1d1('0x2f')]=_[_0xc1d1('0x32')](db[_0xc1d1('0x3f')][_0xc1d1('0x2b')]);_0x281b52[_0xc1d1('0x31')]=_[_0xc1d1('0x32')](_0xc108bb['query']);_0x281b52['filters']=_['intersection'](_0x281b52[_0xc1d1('0x2f')],_0x281b52['query']);_0x58cc82['attributes']=_[_0xc1d1('0x34')](_0x281b52['model'],qs[_0xc1d1('0x47')](_0xc108bb[_0xc1d1('0x31')][_0xc1d1('0x47')]));_0x58cc82[_0xc1d1('0x35')]=_0x58cc82['attributes'][_0xc1d1('0x36')]?_0x58cc82[_0xc1d1('0x35')]:_0x281b52['model'];if(_0xc108bb[_0xc1d1('0x31')][_0xc1d1('0x40')]){_0x58cc82[_0xc1d1('0x41')]=[{'all':!![]}];}_0x58cc82=_[_0xc1d1('0x3e')]({},_0x58cc82,_0xc108bb[_0xc1d1('0x48')]);return db['FaxTransferReport'][_0xc1d1('0x49')](_0x58cc82)[_0xc1d1('0x25')](handleEntityNotFound(_0x2b2800,null))['then'](respondWithResult(_0x2b2800,null))[_0xc1d1('0x44')](handleError(_0x2b2800,null));};exports[_0xc1d1('0x4a')]=function(_0x15401e,_0x8db0b){return db['FaxTransferReport'][_0xc1d1('0x4a')](_0x15401e['body'],{})[_0xc1d1('0x25')](respondWithResult(_0x8db0b,0xc9))[_0xc1d1('0x44')](handleError(_0x8db0b,null));};exports['update']=function(_0x157ac5,_0x3de851){if(_0x157ac5[_0xc1d1('0x4b')]['id']){delete _0x157ac5['body']['id'];}return db[_0xc1d1('0x3f')][_0xc1d1('0x49')]({'where':{'id':_0x157ac5[_0xc1d1('0x46')]['id']}})[_0xc1d1('0x25')](handleEntityNotFound(_0x3de851,null))['then'](saveUpdates(_0x157ac5[_0xc1d1('0x4b')],null))[_0xc1d1('0x25')](respondWithResult(_0x3de851,null))[_0xc1d1('0x44')](handleError(_0x3de851,null));};exports[_0xc1d1('0x26')]=function(_0x56f7d3,_0x69d41a){return db[_0xc1d1('0x3f')]['find']({'where':{'id':_0x56f7d3[_0xc1d1('0x46')]['id']}})['then'](handleEntityNotFound(_0x69d41a,null))[_0xc1d1('0x25')](removeEntity(_0x69d41a,null))['catch'](handleError(_0x69d41a,null));};exports[_0xc1d1('0x4c')]=function(_0x125aae,_0x235e30){return db[_0xc1d1('0x3f')]['describe']()[_0xc1d1('0x25')](respondWithResult(_0x235e30,null))[_0xc1d1('0x44')](handleError(_0x235e30,null));}; \ No newline at end of file +var _0x433e=['filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FaxTransferReport','includeAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','end','stack','name','index','map','fieldName','type','key','query','keys'];(function(_0x3076e4,_0xc070eb){var _0x191f63=function(_0x24bfbe){while(--_0x24bfbe){_0x3076e4['push'](_0x3076e4['shift']());}};_0x191f63(++_0xc070eb);}(_0x433e,0x181));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe433('0x0'));var rimraf=require(_0xe433('0x1'));var zipdir=require(_0xe433('0x2'));var jsonpatch=require(_0xe433('0x3'));var rp=require(_0xe433('0x4'));var moment=require(_0xe433('0x5'));var BPromise=require(_0xe433('0x6'));var Mustache=require(_0xe433('0x7'));var util=require('util');var path=require(_0xe433('0x8'));var sox=require('sox');var csv=require(_0xe433('0x9'));var ejs=require(_0xe433('0xa'));var fs=require('fs');var fs_extra=require(_0xe433('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe433('0xc'));var jsforce=require(_0xe433('0xd'));var deskjs=require(_0xe433('0xe'));var toCsv=require(_0xe433('0x9'));var querystring=require(_0xe433('0xf'));var Papa=require('papaparse');var Redis=require(_0xe433('0x10'));var authService=require(_0xe433('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe433('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe433('0x13'))('api');var utils=require(_0xe433('0x14'));var config=require(_0xe433('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe433('0x16'))['db'];function respondWithStatusCode(_0x43779c,_0xf46987){_0xf46987=_0xf46987||0xcc;return function(_0x136456){if(_0x136456){return _0x43779c[_0xe433('0x17')](_0xf46987);}return _0x43779c['status'](_0xf46987)['end']();};}function respondWithResult(_0x368960,_0x3c95d1){_0x3c95d1=_0x3c95d1||0xc8;return function(_0x10ad83){if(_0x10ad83){return _0x368960['status'](_0x3c95d1)[_0xe433('0x18')](_0x10ad83);}};}function respondWithFilteredResult(_0x43f3c6,_0x10c801){return function(_0x21d1f4){if(_0x21d1f4){var _0x3db7b1=typeof _0x10c801[_0xe433('0x19')]===_0xe433('0x1a')&&typeof _0x10c801[_0xe433('0x1b')]===_0xe433('0x1a');var _0x550ed7=_0x21d1f4[_0xe433('0x1c')];var _0x9cafdb=_0x3db7b1?0x0:_0x10c801['offset'];var _0x5ee9fe=_0x3db7b1?_0x21d1f4[_0xe433('0x1c')]:_0x10c801[_0xe433('0x19')]+_0x10c801[_0xe433('0x1b')];var _0x4621e8;if(_0x5ee9fe>=_0x550ed7){_0x5ee9fe=_0x550ed7;_0x4621e8=0xc8;}else{_0x4621e8=0xce;}_0x43f3c6[_0xe433('0x1d')](_0x4621e8);return _0x43f3c6[_0xe433('0x1e')]('Content-Range',_0x9cafdb+'-'+_0x5ee9fe+'/'+_0x550ed7)['json'](_0x21d1f4);}return null;};}function patchUpdates(_0x5ad865){return function(_0x7b7061){try{jsonpatch[_0xe433('0x1f')](_0x7b7061,_0x5ad865,!![]);}catch(_0x1b2b86){return BPromise[_0xe433('0x20')](_0x1b2b86);}return _0x7b7061[_0xe433('0x21')]();};}function saveUpdates(_0x1c8c6e,_0x104531){return function(_0x51c849){if(_0x51c849){return _0x51c849[_0xe433('0x22')](_0x1c8c6e)[_0xe433('0x23')](function(_0x110909){return _0x110909;});}return null;};}function removeEntity(_0x4115bb,_0x1e30eb){return function(_0x36a21b){if(_0x36a21b){return _0x36a21b[_0xe433('0x24')]()['then'](function(){_0x4115bb[_0xe433('0x1d')](0xcc)[_0xe433('0x25')]();});}};}function handleEntityNotFound(_0x4c7a41,_0x40b754){return function(_0x36fe99){if(!_0x36fe99){_0x4c7a41[_0xe433('0x17')](0x194);}return _0x36fe99;};}function handleError(_0x9ce55f,_0x105aea){_0x105aea=_0x105aea||0x1f4;return function(_0x35ea29){logger['error'](_0x35ea29[_0xe433('0x26')]);if(_0x35ea29[_0xe433('0x27')]){delete _0x35ea29[_0xe433('0x27')];}_0x9ce55f[_0xe433('0x1d')](_0x105aea)['send'](_0x35ea29);};}exports[_0xe433('0x28')]=function(_0x588139,_0x4c073e){var _0xe8f2b9={},_0x144b04={},_0x3d7a4b={'count':0x0,'rows':[]};var _0x4073e5=_[_0xe433('0x29')](db['FaxTransferReport']['rawAttributes'],function(_0x41dbb9){return{'name':_0x41dbb9[_0xe433('0x2a')],'type':_0x41dbb9[_0xe433('0x2b')][_0xe433('0x2c')]};});_0x144b04['model']=_[_0xe433('0x29')](_0x4073e5,_0xe433('0x27'));_0x144b04[_0xe433('0x2d')]=_[_0xe433('0x2e')](_0x588139[_0xe433('0x2d')]);_0x144b04[_0xe433('0x2f')]=_['intersection'](_0x144b04[_0xe433('0x30')],_0x144b04[_0xe433('0x2d')]);_0xe8f2b9[_0xe433('0x31')]=_[_0xe433('0x32')](_0x144b04['model'],qs[_0xe433('0x33')](_0x588139['query']['fields']));_0xe8f2b9['attributes']=_0xe8f2b9[_0xe433('0x31')]['length']?_0xe8f2b9[_0xe433('0x31')]:_0x144b04[_0xe433('0x30')];if(!_0x588139[_0xe433('0x2d')][_0xe433('0x34')](_0xe433('0x35'))){_0xe8f2b9[_0xe433('0x1b')]=qs[_0xe433('0x1b')](_0x588139[_0xe433('0x2d')]['limit']);_0xe8f2b9[_0xe433('0x19')]=qs[_0xe433('0x19')](_0x588139['query'][_0xe433('0x19')]);}_0xe8f2b9[_0xe433('0x36')]=qs[_0xe433('0x37')](_0x588139[_0xe433('0x2d')][_0xe433('0x37')]);_0xe8f2b9[_0xe433('0x38')]=qs['filters'](_[_0xe433('0x39')](_0x588139['query'],_0x144b04['filters']),_0x4073e5);if(_0x588139[_0xe433('0x2d')][_0xe433('0x3a')]){_0xe8f2b9[_0xe433('0x38')]=_[_0xe433('0x3b')](_0xe8f2b9[_0xe433('0x38')],{'$or':_[_0xe433('0x29')](_0x4073e5,function(_0xe32b1c){if(_0xe32b1c[_0xe433('0x2b')]!=='VIRTUAL'){var _0x3071d6={};_0x3071d6[_0xe32b1c[_0xe433('0x27')]]={'$like':'%'+_0x588139[_0xe433('0x2d')][_0xe433('0x3a')]+'%'};return _0x3071d6;}})});}_0xe8f2b9=_[_0xe433('0x3b')]({},_0xe8f2b9,_0x588139[_0xe433('0x3c')]);var _0x4cb416={'where':_0xe8f2b9['where']};return db[_0xe433('0x3d')][_0xe433('0x1c')](_0x4cb416)[_0xe433('0x23')](function(_0x1950aa){_0x3d7a4b[_0xe433('0x1c')]=_0x1950aa;if(_0x588139[_0xe433('0x2d')][_0xe433('0x3e')]){_0xe8f2b9['include']=[{'all':!![]}];}return db[_0xe433('0x3d')]['findAll'](_0xe8f2b9);})[_0xe433('0x23')](function(_0x447389){_0x3d7a4b[_0xe433('0x3f')]=_0x447389;return _0x3d7a4b;})['then'](respondWithFilteredResult(_0x4c073e,_0xe8f2b9))['catch'](handleError(_0x4c073e,null));};exports[_0xe433('0x40')]=function(_0x54b234,_0x162f77){var _0x143fb4={'raw':!![],'where':{'id':_0x54b234[_0xe433('0x41')]['id']}},_0x1f6e83={};_0x1f6e83[_0xe433('0x30')]=_[_0xe433('0x2e')](db[_0xe433('0x3d')]['rawAttributes']);_0x1f6e83[_0xe433('0x2d')]=_[_0xe433('0x2e')](_0x54b234[_0xe433('0x2d')]);_0x1f6e83[_0xe433('0x2f')]=_[_0xe433('0x32')](_0x1f6e83[_0xe433('0x30')],_0x1f6e83[_0xe433('0x2d')]);_0x143fb4[_0xe433('0x31')]=_[_0xe433('0x32')](_0x1f6e83['model'],qs[_0xe433('0x33')](_0x54b234[_0xe433('0x2d')][_0xe433('0x33')]));_0x143fb4[_0xe433('0x31')]=_0x143fb4[_0xe433('0x31')][_0xe433('0x42')]?_0x143fb4[_0xe433('0x31')]:_0x1f6e83['model'];if(_0x54b234[_0xe433('0x2d')]['includeAll']){_0x143fb4['include']=[{'all':!![]}];}_0x143fb4=_[_0xe433('0x3b')]({},_0x143fb4,_0x54b234[_0xe433('0x3c')]);return db[_0xe433('0x3d')][_0xe433('0x43')](_0x143fb4)[_0xe433('0x23')](handleEntityNotFound(_0x162f77,null))[_0xe433('0x23')](respondWithResult(_0x162f77,null))[_0xe433('0x44')](handleError(_0x162f77,null));};exports[_0xe433('0x45')]=function(_0x3cbd77,_0x14ba33){return db['FaxTransferReport'][_0xe433('0x45')](_0x3cbd77[_0xe433('0x46')],{})[_0xe433('0x23')](respondWithResult(_0x14ba33,0xc9))[_0xe433('0x44')](handleError(_0x14ba33,null));};exports[_0xe433('0x22')]=function(_0x5ce982,_0x5730c2){if(_0x5ce982[_0xe433('0x46')]['id']){delete _0x5ce982[_0xe433('0x46')]['id'];}return db[_0xe433('0x3d')][_0xe433('0x43')]({'where':{'id':_0x5ce982[_0xe433('0x41')]['id']}})['then'](handleEntityNotFound(_0x5730c2,null))[_0xe433('0x23')](saveUpdates(_0x5ce982[_0xe433('0x46')],null))['then'](respondWithResult(_0x5730c2,null))[_0xe433('0x44')](handleError(_0x5730c2,null));};exports[_0xe433('0x24')]=function(_0x361216,_0x1d98fd){return db[_0xe433('0x3d')][_0xe433('0x43')]({'where':{'id':_0x361216[_0xe433('0x41')]['id']}})[_0xe433('0x23')](handleEntityNotFound(_0x1d98fd,null))[_0xe433('0x23')](removeEntity(_0x1d98fd,null))['catch'](handleError(_0x1d98fd,null));};exports[_0xe433('0x47')]=function(_0x29c30d,_0x329427){return db[_0xe433('0x3d')][_0xe433('0x47')]()['then'](respondWithResult(_0x329427,null))[_0xe433('0x44')](handleError(_0x329427,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a7826bf..f544ce0 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 _0x3276=['uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_fax_transfer'];(function(_0x254842,_0x159c1f){var _0x364fad=function(_0x305392){while(--_0x305392){_0x254842['push'](_0x254842['shift']());}};_0x364fad(++_0x159c1f);}(_0x3276,0xc7));var _0x6327=function(_0x339a0b,_0x3a870f){_0x339a0b=_0x339a0b-0x0;var _0x1bf9b4=_0x3276[_0x339a0b];return _0x1bf9b4;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('FaxTransferReport',attributes,{'tableName':_0x6327('0x9'),'paranoid':![],'indexes':[{'name':_0x6327('0xa'),'fields':[_0x6327('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8166=['exports','define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes'];(function(_0xe425ef,_0x26cbb6){var _0x3e5c79=function(_0x45dbe8){while(--_0x45dbe8){_0xe425ef['push'](_0xe425ef['shift']());}};_0x3e5c79(++_0x26cbb6);}(_0x8166,0x100));var _0x6816=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x8166[_0x188d31];return _0x30ed33;};'use strict';var _=require(_0x6816('0x0'));var util=require('util');var logger=require(_0x6816('0x1'))(_0x6816('0x2'));var moment=require('moment');var BPromise=require(_0x6816('0x3'));var rp=require(_0x6816('0x4'));var fs=require('fs');var path=require(_0x6816('0x5'));var rimraf=require(_0x6816('0x6'));var config=require('../../config/environment');var attributes=require(_0x6816('0x7'));module[_0x6816('0x8')]=function(_0x1fc363,_0xca44d0){return _0x1fc363[_0x6816('0x9')]('FaxTransferReport',attributes,{'tableName':_0x6816('0xa'),'paranoid':![],'indexes':[{'name':_0x6816('0xb'),'fields':[_0x6816('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 53b0061..0049214 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 _0xc282=['then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x470ad3,_0x17ff4f){var _0x3cec06=function(_0x4b399c){while(--_0x4b399c){_0x470ad3['push'](_0x470ad3['shift']());}};_0x3cec06(++_0x17ff4f);}(_0xc282,0xcb));var _0x2c28=function(_0x26e5f9,_0x269ef1){_0x26e5f9=_0x26e5f9-0x0;var _0x298e9d=_0xc282[_0x26e5f9];return _0x298e9d;};'use strict';var _=require(_0x2c28('0x0'));var util=require(_0x2c28('0x1'));var moment=require(_0x2c28('0x2'));var BPromise=require(_0x2c28('0x3'));var rs=require(_0x2c28('0x4'));var fs=require('fs');var Redis=require(_0x2c28('0x5'));var db=require(_0x2c28('0x6'))['db'];var utils=require(_0x2c28('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2c28('0x8'));var jayson=require(_0x2c28('0x9'));var client=jayson[_0x2c28('0xa')][_0x2c28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506114,_0x595ba5,_0x185185){return new BPromise(function(_0x5ebf5e,_0x426306){return client[_0x2c28('0xc')](_0x506114,_0x185185)[_0x2c28('0xd')](function(_0xb2bfa2){logger[_0x2c28('0xe')](_0x2c28('0xf'),_0x595ba5,_0x2c28('0x10'));logger[_0x2c28('0x11')](_0x2c28('0x12'),_0x595ba5,_0x2c28('0x10'),JSON[_0x2c28('0x13')](_0xb2bfa2));if(_0xb2bfa2[_0x2c28('0x14')]){if(_0xb2bfa2[_0x2c28('0x14')][_0x2c28('0x15')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x595ba5,_0xb2bfa2[_0x2c28('0x14')][_0x2c28('0x16')]);return _0x426306(_0xb2bfa2[_0x2c28('0x14')][_0x2c28('0x16')]);}logger[_0x2c28('0x14')](_0x2c28('0xf'),_0x595ba5,_0xb2bfa2['error'][_0x2c28('0x16')]);return _0x5ebf5e(_0xb2bfa2['error'][_0x2c28('0x16')]);}else{logger[_0x2c28('0xe')](_0x2c28('0xf'),_0x595ba5,'request\x20sent');_0x5ebf5e(_0xb2bfa2[_0x2c28('0x17')][_0x2c28('0x16')]);}})['catch'](function(_0x269608){logger[_0x2c28('0x14')](_0x2c28('0xf'),_0x595ba5,_0x269608);_0x426306(_0x269608);});});} \ No newline at end of file +var _0xa619=['jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa619,0xe7));var _0x9a61=function(_0x4fe7e5,_0x55a10f){_0x4fe7e5=_0x4fe7e5-0x0;var _0x3a8239=_0xa619[_0x4fe7e5];return _0x3a8239;};'use strict';var _=require(_0x9a61('0x0'));var util=require(_0x9a61('0x1'));var moment=require(_0x9a61('0x2'));var BPromise=require(_0x9a61('0x3'));var rs=require(_0x9a61('0x4'));var fs=require('fs');var Redis=require(_0x9a61('0x5'));var db=require(_0x9a61('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a61('0x7'))(_0x9a61('0x8'));var config=require('../../config/environment');var jayson=require(_0x9a61('0x9'));var client=jayson['client'][_0x9a61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12cc5d,_0x8866c4,_0x502d74){return new BPromise(function(_0xdcae29,_0x2841af){return client[_0x9a61('0xb')](_0x12cc5d,_0x502d74)['then'](function(_0x1ad881){logger[_0x9a61('0xc')](_0x9a61('0xd'),_0x8866c4,'request\x20sent');logger['debug'](_0x9a61('0xe'),_0x8866c4,_0x9a61('0xf'),JSON['stringify'](_0x1ad881));if(_0x1ad881[_0x9a61('0x10')]){if(_0x1ad881['error'][_0x9a61('0x11')]===0x1f4){logger[_0x9a61('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x8866c4,_0x1ad881[_0x9a61('0x10')][_0x9a61('0x12')]);return _0x2841af(_0x1ad881[_0x9a61('0x10')][_0x9a61('0x12')]);}logger[_0x9a61('0x10')](_0x9a61('0xd'),_0x8866c4,_0x1ad881['error'][_0x9a61('0x12')]);return _0xdcae29(_0x1ad881['error'][_0x9a61('0x12')]);}else{logger[_0x9a61('0xc')](_0x9a61('0xd'),_0x8866c4,_0x9a61('0xf'));_0xdcae29(_0x1ad881[_0x9a61('0x13')]['message']);}})['catch'](function(_0x20016b){logger[_0x9a61('0x10')](_0x9a61('0xd'),_0x8866c4,_0x20016b);_0x2841af(_0x20016b);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b531684..3910144 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 _0xb8d9=['./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x43e768,_0x4f2dff){var _0x3552e0=function(_0x1455fb){while(--_0x1455fb){_0x43e768['push'](_0x43e768['shift']());}};_0x3552e0(++_0x4f2dff);}(_0xb8d9,0xb7));var _0x9b8d=function(_0x5dabe7,_0x3e495b){_0x5dabe7=_0x5dabe7-0x0;var _0x4fc3c5=_0xb8d9[_0x5dabe7];return _0x4fc3c5;};'use strict';var multer=require(_0x9b8d('0x0'));var util=require(_0x9b8d('0x1'));var path=require('path');var timeout=require(_0x9b8d('0x2'));var express=require(_0x9b8d('0x3'));var router=express[_0x9b8d('0x4')]();var fs_extra=require(_0x9b8d('0x5'));var auth=require(_0x9b8d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b8d('0x7'));router[_0x9b8d('0x8')]('/',auth[_0x9b8d('0x9')](),controller['index']);router[_0x9b8d('0x8')](_0x9b8d('0xa'),auth[_0x9b8d('0x9')](),controller[_0x9b8d('0xb')]);router[_0x9b8d('0x8')](_0x9b8d('0xc'),auth[_0x9b8d('0x9')](),controller[_0x9b8d('0xd')]);router[_0x9b8d('0xe')]('/',auth['isAuthenticated'](),controller[_0x9b8d('0xf')]);router['put'](_0x9b8d('0xc'),auth[_0x9b8d('0x9')](),controller['update']);router[_0x9b8d('0x10')](_0x9b8d('0xc'),auth[_0x9b8d('0x9')](),controller[_0x9b8d('0x11')]);module[_0x9b8d('0x12')]=router; \ No newline at end of file +var _0x214f=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create'];(function(_0x49fa22,_0x3a8ccb){var _0x4af7a1=function(_0x5010c3){while(--_0x5010c3){_0x49fa22['push'](_0x49fa22['shift']());}};_0x4af7a1(++_0x3a8ccb);}(_0x214f,0xac));var _0xf214=function(_0x3feee1,_0x463fb4){_0x3feee1=_0x3feee1-0x0;var _0x1335d4=_0x214f[_0x3feee1];return _0x1335d4;};'use strict';var multer=require('multer');var util=require(_0xf214('0x0'));var path=require('path');var timeout=require(_0xf214('0x1'));var express=require(_0xf214('0x2'));var router=express[_0xf214('0x3')]();var fs_extra=require(_0xf214('0x4'));var auth=require(_0xf214('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf214('0x6'));var controller=require(_0xf214('0x7'));router[_0xf214('0x8')]('/',auth[_0xf214('0x9')](),controller[_0xf214('0xa')]);router[_0xf214('0x8')](_0xf214('0xb'),auth[_0xf214('0x9')](),controller[_0xf214('0xc')]);router[_0xf214('0x8')](_0xf214('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf214('0x9')](),controller[_0xf214('0xe')]);router['put'](_0xf214('0xd'),auth[_0xf214('0x9')](),controller['update']);router['delete'](_0xf214('0xd'),auth[_0xf214('0x9')](),controller[_0xf214('0xf')]);module[_0xf214('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 3b9f671..57789c0 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 _0xcbec=['express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util'];(function(_0x1a0ef0,_0x3330ae){var _0x4a4ffb=function(_0x404712){while(--_0x404712){_0x1a0ef0['push'](_0x1a0ef0['shift']());}};_0x4a4ffb(++_0x3330ae);}(_0xcbec,0x91));var _0xccbe=function(_0xaaf6a3,_0x46bf1c){_0xaaf6a3=_0xaaf6a3-0x0;var _0x255dbe=_0xcbec[_0xaaf6a3];return _0x255dbe;};'use strict';var multer=require(_0xccbe('0x0'));var util=require(_0xccbe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xccbe('0x2'));var router=express['Router']();var fs_extra=require(_0xccbe('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xccbe('0x4'));var config=require(_0xccbe('0x5'));var controller=require(_0xccbe('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xccbe('0x7')]);router[_0xccbe('0x8')](_0xccbe('0x9'),auth[_0xccbe('0xa')](),controller[_0xccbe('0xb')]);router[_0xccbe('0x8')]('/:id/configurations',auth[_0xccbe('0xa')](),controller[_0xccbe('0xc')]);router['get'](_0xccbe('0xd'),auth[_0xccbe('0xa')](),controller[_0xccbe('0xe')]);router[_0xccbe('0xf')]('/',auth[_0xccbe('0xa')](),controller['create']);router[_0xccbe('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xccbe('0x10')]);router[_0xccbe('0x11')]('/:id',auth[_0xccbe('0xa')](),controller[_0xccbe('0x12')]);router['delete']('/:id',auth[_0xccbe('0xa')](),controller[_0xccbe('0x13')]);module[_0xccbe('0x14')]=router; \ No newline at end of file +var _0xb288=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util'];(function(_0x3737e0,_0x45b3ad){var _0x462af5=function(_0x3435c7){while(--_0x3435c7){_0x3737e0['push'](_0x3737e0['shift']());}};_0x462af5(++_0x45b3ad);}(_0xb288,0x1b3));var _0x8b28=function(_0x5cc556,_0x158710){_0x5cc556=_0x5cc556-0x0;var _0x12103b=_0xb288[_0x5cc556];return _0x12103b;};'use strict';var multer=require(_0x8b28('0x0'));var util=require(_0x8b28('0x1'));var path=require(_0x8b28('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b28('0x3'));var router=express[_0x8b28('0x4')]();var fs_extra=require(_0x8b28('0x5'));var auth=require(_0x8b28('0x6'));var interaction=require(_0x8b28('0x7'));var config=require(_0x8b28('0x8'));var controller=require('./intDeskAccount.controller');router[_0x8b28('0x9')]('/',auth[_0x8b28('0xa')](),controller[_0x8b28('0xb')]);router[_0x8b28('0x9')]('/:id',auth[_0x8b28('0xa')](),controller['show']);router[_0x8b28('0x9')]('/:id/configurations',auth[_0x8b28('0xa')](),controller[_0x8b28('0xc')]);router[_0x8b28('0x9')](_0x8b28('0xd'),auth[_0x8b28('0xa')](),controller[_0x8b28('0xe')]);router[_0x8b28('0xf')]('/',auth[_0x8b28('0xa')](),controller[_0x8b28('0x10')]);router['post']('/:id/configurations',auth[_0x8b28('0xa')](),controller[_0x8b28('0x11')]);router[_0x8b28('0x12')](_0x8b28('0x13'),auth['isAuthenticated'](),controller[_0x8b28('0x14')]);router[_0x8b28('0x15')]('/:id',auth[_0x8b28('0xa')](),controller[_0x8b28('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 1f576e5..cd05b7a 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 _0xa921=['STRING','basic','ENUM','integrationTab','newTab','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa921,0x1df));var _0x1a92=function(_0x3b6aec,_0x1589b6){_0x3b6aec=_0x3b6aec-0x0;var _0x442853=_0xa921[_0x3b6aec];return _0x442853;};'use strict';var Sequelize=require('sequelize');module[_0x1a92('0x0')]={'name':{'type':Sequelize[_0x1a92('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1a92('0x1')]},'remoteUri':{'type':Sequelize[_0x1a92('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x1a92('0x2')),'defaultValue':_0x1a92('0x2')},'password':{'type':Sequelize[_0x1a92('0x1')]},'consumerKey':{'type':Sequelize[_0x1a92('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1a92('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1a92('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1a92('0x3')](_0x1a92('0x4'),_0x1a92('0x5')),'defaultValue':_0x1a92('0x4')}}; \ No newline at end of file +var _0xc39a=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc39a,0x15e));var _0xac39=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xc39a[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0xac39('0x0'));module[_0xac39('0x1')]={'name':{'type':Sequelize[_0xac39('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xac39('0x2')]},'remoteUri':{'type':Sequelize[_0xac39('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xac39('0x3')),'defaultValue':_0xac39('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xac39('0x2')]},'consumerSecret':{'type':Sequelize[_0xac39('0x2')]},'token':{'type':Sequelize[_0xac39('0x2')]},'tokenSecret':{'type':Sequelize[_0xac39('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xac39('0x4')](_0xac39('0x5'),_0xac39('0x6')),'defaultValue':_0xac39('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1f78bb0..e6a205f 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 _0x192a=['priority','remoteUri','authType','consumerKey','consumerSecret','tokenSecret','GET','format','%s/custom_fields','application/json','Authorization','%s:%s','username','toString','concat','_embedded','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','DeskAccount','findAll','rows','catch','params','keys','options','find','body','getConfigurations','findOne','DeskConfiguration','Subjects','channel','Descriptions','getDescriptions','create','DeskField','getFields'];(function(_0x2ee6ea,_0x5a1390){var _0x4d4099=function(_0x2ee078){while(--_0x2ee078){_0x2ee6ea['push'](_0x2ee6ea['shift']());}};_0x4d4099(++_0x5a1390);}(_0x192a,0x15c));var _0xa192=function(_0x2d787e,_0x1d3bb0){_0x2d787e=_0x2d787e-0x0;var _0x57e37c=_0x192a[_0x2d787e];return _0x57e37c;};'use strict';var emlformat=require(_0xa192('0x0'));var rimraf=require(_0xa192('0x1'));var zipdir=require(_0xa192('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa192('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa192('0x4'));var util=require(_0xa192('0x5'));var path=require('path');var sox=require(_0xa192('0x6'));var csv=require(_0xa192('0x7'));var ejs=require(_0xa192('0x8'));var fs=require('fs');var fs_extra=require(_0xa192('0x9'));var _=require(_0xa192('0xa'));var squel=require('squel');var crypto=require(_0xa192('0xb'));var jsforce=require(_0xa192('0xc'));var deskjs=require(_0xa192('0xd'));var toCsv=require(_0xa192('0x7'));var querystring=require('querystring');var Papa=require(_0xa192('0xe'));var Redis=require(_0xa192('0xf'));var authService=require(_0xa192('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa192('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa192('0x12'));var utils=require(_0xa192('0x13'));var config=require(_0xa192('0x14'));var licenseUtil=require(_0xa192('0x15'));var db=require(_0xa192('0x16'))['db'];var integrations=require(_0xa192('0x17'));function respondWithStatusCode(_0x28f3cb,_0x5041c5){_0x5041c5=_0x5041c5||0xcc;return function(_0x3edba9){if(_0x3edba9){return _0x28f3cb[_0xa192('0x18')](_0x5041c5);}return _0x28f3cb[_0xa192('0x19')](_0x5041c5)[_0xa192('0x1a')]();};}function respondWithResult(_0x345d50,_0x53b28a){_0x53b28a=_0x53b28a||0xc8;return function(_0x48b2b8){if(_0x48b2b8){return _0x345d50[_0xa192('0x19')](_0x53b28a)[_0xa192('0x1b')](_0x48b2b8);}};}function respondWithFilteredResult(_0x59106f,_0x296bde){return function(_0x39147f){if(_0x39147f){var _0x27737a=typeof _0x296bde[_0xa192('0x1c')]==='undefined'&&typeof _0x296bde['limit']===_0xa192('0x1d');var _0x5a0c2f=_0x39147f['count'];var _0x11dfac=_0x27737a?0x0:_0x296bde[_0xa192('0x1c')];var _0x3b0594=_0x27737a?_0x39147f['count']:_0x296bde['offset']+_0x296bde[_0xa192('0x1e')];var _0x1af3f3;if(_0x3b0594>=_0x5a0c2f){_0x3b0594=_0x5a0c2f;_0x1af3f3=0xc8;}else{_0x1af3f3=0xce;}_0x59106f[_0xa192('0x19')](_0x1af3f3);return _0x59106f['set'](_0xa192('0x1f'),_0x11dfac+'-'+_0x3b0594+'/'+_0x5a0c2f)[_0xa192('0x1b')](_0x39147f);}return null;};}function patchUpdates(_0x29aae0){return function(_0x1f788b){try{jsonpatch[_0xa192('0x20')](_0x1f788b,_0x29aae0,!![]);}catch(_0x355519){return BPromise[_0xa192('0x21')](_0x355519);}return _0x1f788b[_0xa192('0x22')]();};}function saveUpdates(_0x4430e0,_0x4970af){return function(_0x3aa67e){if(_0x3aa67e){return _0x3aa67e[_0xa192('0x23')](_0x4430e0)[_0xa192('0x24')](function(_0x4589bc){return _0x4589bc;});}return null;};}function removeEntity(_0x56a4da,_0x22630d){return function(_0x5756f4){if(_0x5756f4){return _0x5756f4[_0xa192('0x25')]()[_0xa192('0x24')](function(){_0x56a4da['status'](0xcc)[_0xa192('0x1a')]();});}};}function handleEntityNotFound(_0x2ba983,_0x4ee478){return function(_0x328194){if(!_0x328194){_0x2ba983[_0xa192('0x18')](0x194);}return _0x328194;};}function handleError(_0x1eaf8c,_0x2579fd){_0x2579fd=_0x2579fd||0x1f4;return function(_0x567df7){logger[_0xa192('0x26')](_0x567df7[_0xa192('0x27')]);if(_0x567df7[_0xa192('0x28')]){delete _0x567df7['name'];}_0x1eaf8c[_0xa192('0x19')](_0x2579fd)['send'](_0x567df7);};}exports[_0xa192('0x29')]=function(_0x407e28,_0x1de3f0){var _0x5c536d={},_0x49e82b={},_0x2e78f7={'count':0x0,'rows':[]};var _0x5188be=_[_0xa192('0x2a')](db['DeskAccount'][_0xa192('0x2b')],function(_0xc7a71a){return{'name':_0xc7a71a[_0xa192('0x2c')],'type':_0xc7a71a[_0xa192('0x2d')][_0xa192('0x2e')]};});_0x49e82b[_0xa192('0x2f')]=_[_0xa192('0x2a')](_0x5188be,_0xa192('0x28'));_0x49e82b[_0xa192('0x30')]=_['keys'](_0x407e28[_0xa192('0x30')]);_0x49e82b[_0xa192('0x31')]=_[_0xa192('0x32')](_0x49e82b[_0xa192('0x2f')],_0x49e82b[_0xa192('0x30')]);_0x5c536d[_0xa192('0x33')]=_[_0xa192('0x32')](_0x49e82b[_0xa192('0x2f')],qs['fields'](_0x407e28[_0xa192('0x30')][_0xa192('0x34')]));_0x5c536d[_0xa192('0x33')]=_0x5c536d[_0xa192('0x33')][_0xa192('0x35')]?_0x5c536d[_0xa192('0x33')]:_0x49e82b[_0xa192('0x2f')];if(!_0x407e28[_0xa192('0x30')][_0xa192('0x36')](_0xa192('0x37'))){_0x5c536d[_0xa192('0x1e')]=qs[_0xa192('0x1e')](_0x407e28['query'][_0xa192('0x1e')]);_0x5c536d[_0xa192('0x1c')]=qs[_0xa192('0x1c')](_0x407e28[_0xa192('0x30')][_0xa192('0x1c')]);}_0x5c536d[_0xa192('0x38')]=qs['sort'](_0x407e28[_0xa192('0x30')][_0xa192('0x39')]);_0x5c536d['where']=qs[_0xa192('0x31')](_[_0xa192('0x3a')](_0x407e28['query'],_0x49e82b['filters']),_0x5188be);if(_0x407e28[_0xa192('0x30')][_0xa192('0x3b')]){_0x5c536d[_0xa192('0x3c')]=_[_0xa192('0x3d')](_0x5c536d[_0xa192('0x3c')],{'$or':_['map'](_0x5188be,function(_0xbb145c){if(_0xbb145c[_0xa192('0x2d')]!==_0xa192('0x3e')){var _0x4bc3b1={};_0x4bc3b1[_0xbb145c[_0xa192('0x28')]]={'$like':'%'+_0x407e28[_0xa192('0x30')][_0xa192('0x3b')]+'%'};return _0x4bc3b1;}})});}_0x5c536d=_[_0xa192('0x3d')]({},_0x5c536d,_0x407e28['options']);var _0x517bcc={'where':_0x5c536d[_0xa192('0x3c')]};return db['DeskAccount']['count'](_0x517bcc)[_0xa192('0x24')](function(_0x35b348){_0x2e78f7['count']=_0x35b348;if(_0x407e28['query'][_0xa192('0x3f')]){_0x5c536d[_0xa192('0x40')]=[{'all':!![]}];}return db[_0xa192('0x41')][_0xa192('0x42')](_0x5c536d);})['then'](function(_0x416c72){_0x2e78f7[_0xa192('0x43')]=_0x416c72;return _0x2e78f7;})[_0xa192('0x24')](respondWithFilteredResult(_0x1de3f0,_0x5c536d))[_0xa192('0x44')](handleError(_0x1de3f0,null));};exports['show']=function(_0x377889,_0x106bff){var _0x9e8223={'raw':![],'where':{'id':_0x377889[_0xa192('0x45')]['id']}},_0x1b33e2={};_0x1b33e2['model']=_[_0xa192('0x46')](db[_0xa192('0x41')][_0xa192('0x2b')]);_0x1b33e2['query']=_[_0xa192('0x46')](_0x377889[_0xa192('0x30')]);_0x1b33e2['filters']=_[_0xa192('0x32')](_0x1b33e2['model'],_0x1b33e2[_0xa192('0x30')]);_0x9e8223[_0xa192('0x33')]=_['intersection'](_0x1b33e2[_0xa192('0x2f')],qs[_0xa192('0x34')](_0x377889[_0xa192('0x30')][_0xa192('0x34')]));_0x9e8223['attributes']=_0x9e8223[_0xa192('0x33')][_0xa192('0x35')]?_0x9e8223['attributes']:_0x1b33e2[_0xa192('0x2f')];if(_0x377889[_0xa192('0x30')][_0xa192('0x3f')]){_0x9e8223[_0xa192('0x40')]=[{'all':!![]}];}_0x9e8223=_[_0xa192('0x3d')]({},_0x9e8223,_0x377889[_0xa192('0x47')]);return db[_0xa192('0x41')][_0xa192('0x48')](_0x9e8223)[_0xa192('0x24')](handleEntityNotFound(_0x106bff,null))['then'](respondWithResult(_0x106bff,null))['catch'](handleError(_0x106bff,null));};exports['create']=function(_0x290645,_0x587ce9){return db[_0xa192('0x41')]['create'](_0x290645[_0xa192('0x49')],{})['then'](respondWithResult(_0x587ce9,0xc9))['catch'](handleError(_0x587ce9,null));};exports[_0xa192('0x23')]=function(_0x3274c9,_0x3701f8){if(_0x3274c9['body']['id']){delete _0x3274c9['body']['id'];}return db[_0xa192('0x41')]['find']({'where':{'id':_0x3274c9[_0xa192('0x45')]['id']}})[_0xa192('0x24')](handleEntityNotFound(_0x3701f8,null))[_0xa192('0x24')](saveUpdates(_0x3274c9[_0xa192('0x49')],null))[_0xa192('0x24')](respondWithResult(_0x3701f8,null))['catch'](handleError(_0x3701f8,null));};exports['destroy']=function(_0x448d70,_0x1e95a6){return db['DeskAccount']['find']({'where':{'id':_0x448d70[_0xa192('0x45')]['id']}})[_0xa192('0x24')](handleEntityNotFound(_0x1e95a6,null))[_0xa192('0x24')](removeEntity(_0x1e95a6,null))['catch'](handleError(_0x1e95a6,null));};exports[_0xa192('0x4a')]=function(_0x1b6aea,_0x497865,_0x1da53a){var _0x3cab4c={};var _0x5290a6={};var _0xb5e63e;var _0x2fcaa7;return db[_0xa192('0x41')][_0xa192('0x4b')]({'where':{'id':_0x1b6aea[_0xa192('0x45')]['id']}})[_0xa192('0x24')](handleEntityNotFound(_0x497865,null))[_0xa192('0x24')](function(_0x33df0c){if(_0x33df0c){_0xb5e63e=_0x33df0c;_0x5290a6[_0xa192('0x2f')]=_['keys'](db[_0xa192('0x4c')]['rawAttributes']);_0x5290a6[_0xa192('0x30')]=_[_0xa192('0x46')](_0x1b6aea[_0xa192('0x30')]);_0x5290a6['filters']=_[_0xa192('0x32')](_0x5290a6[_0xa192('0x2f')],_0x5290a6[_0xa192('0x30')]);_0x3cab4c[_0xa192('0x33')]=_[_0xa192('0x32')](_0x5290a6[_0xa192('0x2f')],qs['fields'](_0x1b6aea[_0xa192('0x30')][_0xa192('0x34')]));_0x3cab4c['attributes']=_0x3cab4c['attributes'][_0xa192('0x35')]?_0x3cab4c[_0xa192('0x33')]:_0x5290a6['model'];_0x3cab4c[_0xa192('0x38')]=qs['sort'](_0x1b6aea[_0xa192('0x30')][_0xa192('0x39')]);_0x3cab4c['where']=qs[_0xa192('0x31')](_['pick'](_0x1b6aea['query'],_0x5290a6['filters']));if(_0x1b6aea[_0xa192('0x30')]['filter']){_0x3cab4c[_0xa192('0x3c')]=_[_0xa192('0x3d')](_0x3cab4c['where'],{'$or':_[_0xa192('0x2a')](_0x3cab4c[_0xa192('0x33')],function(_0x14d52e){var _0x23fcdd={};_0x23fcdd[_0x14d52e]={'$like':'%'+_0x1b6aea[_0xa192('0x30')][_0xa192('0x3b')]+'%'};return _0x23fcdd;})});}_0x3cab4c=_[_0xa192('0x3d')]({},_0x3cab4c,_0x1b6aea[_0xa192('0x47')]);return _0xb5e63e['getConfigurations'](_0x3cab4c);}})[_0xa192('0x24')](function(_0xee08b3){if(_0xee08b3){_0x2fcaa7=_0xee08b3[_0xa192('0x35')];if(!_0x1b6aea[_0xa192('0x30')][_0xa192('0x36')](_0xa192('0x37'))){_0x3cab4c[_0xa192('0x1e')]=qs[_0xa192('0x1e')](_0x1b6aea[_0xa192('0x30')]['limit']);_0x3cab4c[_0xa192('0x1c')]=qs[_0xa192('0x1c')](_0x1b6aea[_0xa192('0x30')][_0xa192('0x1c')]);}return _0xb5e63e[_0xa192('0x4a')](_0x3cab4c);}})[_0xa192('0x24')](function(_0x1e795b){if(_0x1e795b){return _0x1e795b?{'count':_0x2fcaa7,'rows':_0x1e795b}:null;}})[_0xa192('0x24')](respondWithResult(_0x497865,null))[_0xa192('0x44')](handleError(_0x497865,null));};exports['addConfiguration']=function(_0x208c5b,_0x10c9f7,_0x11cd32){if(_0x208c5b[_0xa192('0x49')]['id']){delete _0x208c5b[_0xa192('0x49')]['id'];}return db[_0xa192('0x41')][_0xa192('0x4b')]({'where':{'id':_0x208c5b[_0xa192('0x45')]['id']}})[_0xa192('0x24')](handleEntityNotFound(_0x10c9f7,null))[_0xa192('0x24')](function(_0x4f79d3){if(_0x4f79d3){_0x208c5b[_0xa192('0x49')]['AccountId']=_0x4f79d3['id'];_0x208c5b['body'][_0xa192('0x4d')]=integrations['getSubjects'](_0x208c5b['body'][_0xa192('0x4e')],_0x208c5b['body'][_0xa192('0x2d')]);_0x208c5b[_0xa192('0x49')][_0xa192('0x4f')]=integrations[_0xa192('0x50')](_0x208c5b[_0xa192('0x49')][_0xa192('0x4e')],_0x208c5b[_0xa192('0x49')][_0xa192('0x2d')]);return db[_0xa192('0x4c')][_0xa192('0x51')](_0x208c5b['body'],{'include':[{'model':db['DeskField'],'as':_0xa192('0x4d')},{'model':db[_0xa192('0x52')],'as':'Descriptions'}]});}return null;})[_0xa192('0x24')](respondWithResult(_0x10c9f7,null))[_0xa192('0x44')](handleError(_0x10c9f7,null));};exports[_0xa192('0x53')]=function(_0x2b5978,_0x43942d,_0x2de664){var _0x58adb2=[{'name':_0xa192('0x54'),'label':_0xa192('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4a388e='';return db['DeskAccount'][_0xa192('0x4b')]({'where':{'id':_0x2b5978[_0xa192('0x45')]['id']},'attributes':['id',_0xa192('0x55'),_0xa192('0x56'),'username','password',_0xa192('0x57'),_0xa192('0x58'),'token',_0xa192('0x59')]})[_0xa192('0x24')](handleEntityNotFound(_0x43942d,null))[_0xa192('0x24')](function(_0x3241b5){if(_0x3241b5){_0x4a388e=_0x3241b5[_0xa192('0x55')];var _0x3c7002=_0x4a388e['slice'](-0x1);if(_0x3c7002==='/'){_0x4a388e=_0x4a388e['substring'](0x0,_0x4a388e['lastIndexOf'](_0x3c7002));}var _0x31cfd3={'method':_0xa192('0x5a'),'uri':util[_0xa192('0x5b')](_0xa192('0x5c'),_0x4a388e),'headers':{'Content-Type':_0xa192('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x3241b5[_0xa192('0x56')]==='basic'){_0x31cfd3['headers'][_0xa192('0x5e')]=util['format']('Basic\x20%s',new Buffer(util['format'](_0xa192('0x5f'),_0x3241b5[_0xa192('0x60')],_0x3241b5['password']))[_0xa192('0x61')]('base64'));}return rp(_0x31cfd3)[_0xa192('0x24')](function(_0x465b37){return _0x58adb2[_0xa192('0x62')](_[_0xa192('0x2a')](_0x465b37[_0xa192('0x63')]['entries'],function(_0x326e36){return{'id':_0x326e36[_0xa192('0x28')],'name':_0x326e36[_0xa192('0x28')],'type':_0x326e36[_0xa192('0x2d')],'active':_0x326e36[_0xa192('0x64')],'label':_0x326e36[_0xa192('0x65')],'custom':!![]};}));});}})['then'](function(_0x1c3ad7){return{'count':_0x1c3ad7['length'],'rows':_0x1c3ad7};})[_0xa192('0x24')](respondWithResult(_0x43942d,null))[_0xa192('0x44')](function(_0x48f54c){var _0x5567e9=_0x2b5978[_0xa192('0x30')]['test']?0x1f4:_0x48f54c[_0xa192('0x66')]||0x1f4;logger[_0xa192('0x26')](_0xa192('0x67'),_0xa192('0x53'),_0x5567e9,JSON[_0xa192('0x68')](_0x48f54c));delete _0x48f54c[_0xa192('0x28')];if(_0x5567e9===0x191){_0x5567e9=0x190;}_0x43942d[_0xa192('0x19')](_0x5567e9)[_0xa192('0x69')](_0x2b5978[_0xa192('0x30')][_0xa192('0x6a')]?{'message':_0xa192('0x6b'),'statusCode':_0x48f54c[_0xa192('0x66')]}:_0x48f54c);});}; \ No newline at end of file +var _0xdc84=['pick','addConfiguration','Subjects','getSubjects','channel','type','getDescriptions','DeskConfiguration','DeskField','Descriptions','getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdc84,0x117));var _0x4dc8=function(_0x4fd75e,_0x219e4a){_0x4fd75e=_0x4fd75e-0x0;var _0x5b6338=_0xdc84[_0x4fd75e];return _0x5b6338;};'use strict';var emlformat=require(_0x4dc8('0x0'));var rimraf=require(_0x4dc8('0x1'));var zipdir=require(_0x4dc8('0x2'));var jsonpatch=require(_0x4dc8('0x3'));var rp=require(_0x4dc8('0x4'));var moment=require('moment');var BPromise=require(_0x4dc8('0x5'));var Mustache=require(_0x4dc8('0x6'));var util=require(_0x4dc8('0x7'));var path=require('path');var sox=require(_0x4dc8('0x8'));var csv=require(_0x4dc8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4dc8('0xa'));var squel=require(_0x4dc8('0xb'));var crypto=require(_0x4dc8('0xc'));var jsforce=require(_0x4dc8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4dc8('0x9'));var querystring=require('querystring');var Papa=require(_0x4dc8('0xe'));var Redis=require(_0x4dc8('0xf'));var authService=require(_0x4dc8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4dc8('0x11'));var hardwareService=require(_0x4dc8('0x12'));var logger=require(_0x4dc8('0x13'))(_0x4dc8('0x14'));var utils=require(_0x4dc8('0x15'));var config=require(_0x4dc8('0x16'));var licenseUtil=require(_0x4dc8('0x17'));var db=require(_0x4dc8('0x18'))['db'];var integrations=require(_0x4dc8('0x19'));function respondWithStatusCode(_0x1430ce,_0x3ac6dc){_0x3ac6dc=_0x3ac6dc||0xcc;return function(_0x5b0f71){if(_0x5b0f71){return _0x1430ce[_0x4dc8('0x1a')](_0x3ac6dc);}return _0x1430ce[_0x4dc8('0x1b')](_0x3ac6dc)[_0x4dc8('0x1c')]();};}function respondWithResult(_0xc7f9c4,_0x1eda67){_0x1eda67=_0x1eda67||0xc8;return function(_0x254897){if(_0x254897){return _0xc7f9c4[_0x4dc8('0x1b')](_0x1eda67)[_0x4dc8('0x1d')](_0x254897);}};}function respondWithFilteredResult(_0x4b2a99,_0x9b3998){return function(_0x1fc766){if(_0x1fc766){var _0x4cdc15=typeof _0x9b3998[_0x4dc8('0x1e')]===_0x4dc8('0x1f')&&typeof _0x9b3998[_0x4dc8('0x20')]==='undefined';var _0x4d62ee=_0x1fc766['count'];var _0x3cb970=_0x4cdc15?0x0:_0x9b3998[_0x4dc8('0x1e')];var _0x279369=_0x4cdc15?_0x1fc766[_0x4dc8('0x21')]:_0x9b3998['offset']+_0x9b3998[_0x4dc8('0x20')];var _0x3ec268;if(_0x279369>=_0x4d62ee){_0x279369=_0x4d62ee;_0x3ec268=0xc8;}else{_0x3ec268=0xce;}_0x4b2a99[_0x4dc8('0x1b')](_0x3ec268);return _0x4b2a99[_0x4dc8('0x22')](_0x4dc8('0x23'),_0x3cb970+'-'+_0x279369+'/'+_0x4d62ee)[_0x4dc8('0x1d')](_0x1fc766);}return null;};}function patchUpdates(_0x431aa0){return function(_0x473aba){try{jsonpatch[_0x4dc8('0x24')](_0x473aba,_0x431aa0,!![]);}catch(_0x2dae31){return BPromise[_0x4dc8('0x25')](_0x2dae31);}return _0x473aba[_0x4dc8('0x26')]();};}function saveUpdates(_0x818706,_0xee877f){return function(_0x2ed069){if(_0x2ed069){return _0x2ed069[_0x4dc8('0x27')](_0x818706)[_0x4dc8('0x28')](function(_0x47fb72){return _0x47fb72;});}return null;};}function removeEntity(_0x2f0780,_0x39841f){return function(_0x445e55){if(_0x445e55){return _0x445e55[_0x4dc8('0x29')]()[_0x4dc8('0x28')](function(){_0x2f0780[_0x4dc8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf71b26,_0x4a3a2e){return function(_0x15c7f3){if(!_0x15c7f3){_0xf71b26[_0x4dc8('0x1a')](0x194);}return _0x15c7f3;};}function handleError(_0x19c0c6,_0x4a0af8){_0x4a0af8=_0x4a0af8||0x1f4;return function(_0x5c9db7){logger[_0x4dc8('0x2a')](_0x5c9db7[_0x4dc8('0x2b')]);if(_0x5c9db7['name']){delete _0x5c9db7[_0x4dc8('0x2c')];}_0x19c0c6['status'](_0x4a0af8)[_0x4dc8('0x2d')](_0x5c9db7);};}exports[_0x4dc8('0x2e')]=function(_0x2975cb,_0xb4b798){var _0x4d72e9={},_0x1eb9c6={},_0x379582={'count':0x0,'rows':[]};var _0x359578=_[_0x4dc8('0x2f')](db[_0x4dc8('0x30')][_0x4dc8('0x31')],function(_0x40ab50){return{'name':_0x40ab50[_0x4dc8('0x32')],'type':_0x40ab50['type']['key']};});_0x1eb9c6[_0x4dc8('0x33')]=_[_0x4dc8('0x2f')](_0x359578,_0x4dc8('0x2c'));_0x1eb9c6[_0x4dc8('0x34')]=_[_0x4dc8('0x35')](_0x2975cb[_0x4dc8('0x34')]);_0x1eb9c6[_0x4dc8('0x36')]=_[_0x4dc8('0x37')](_0x1eb9c6[_0x4dc8('0x33')],_0x1eb9c6[_0x4dc8('0x34')]);_0x4d72e9[_0x4dc8('0x38')]=_[_0x4dc8('0x37')](_0x1eb9c6['model'],qs['fields'](_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x39')]));_0x4d72e9[_0x4dc8('0x38')]=_0x4d72e9[_0x4dc8('0x38')][_0x4dc8('0x3a')]?_0x4d72e9[_0x4dc8('0x38')]:_0x1eb9c6[_0x4dc8('0x33')];if(!_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x3b')](_0x4dc8('0x3c'))){_0x4d72e9[_0x4dc8('0x20')]=qs[_0x4dc8('0x20')](_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x20')]);_0x4d72e9[_0x4dc8('0x1e')]=qs[_0x4dc8('0x1e')](_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x1e')]);}_0x4d72e9['order']=qs[_0x4dc8('0x3d')](_0x2975cb['query'][_0x4dc8('0x3d')]);_0x4d72e9[_0x4dc8('0x3e')]=qs[_0x4dc8('0x36')](_['pick'](_0x2975cb[_0x4dc8('0x34')],_0x1eb9c6[_0x4dc8('0x36')]),_0x359578);if(_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x3f')]){_0x4d72e9[_0x4dc8('0x3e')]=_[_0x4dc8('0x40')](_0x4d72e9[_0x4dc8('0x3e')],{'$or':_[_0x4dc8('0x2f')](_0x359578,function(_0x2d9f66){if(_0x2d9f66['type']!==_0x4dc8('0x41')){var _0x2c563a={};_0x2c563a[_0x2d9f66[_0x4dc8('0x2c')]]={'$like':'%'+_0x2975cb['query']['filter']+'%'};return _0x2c563a;}})});}_0x4d72e9=_[_0x4dc8('0x40')]({},_0x4d72e9,_0x2975cb[_0x4dc8('0x42')]);var _0x41b395={'where':_0x4d72e9[_0x4dc8('0x3e')]};return db['DeskAccount'][_0x4dc8('0x21')](_0x41b395)[_0x4dc8('0x28')](function(_0x3da358){_0x379582[_0x4dc8('0x21')]=_0x3da358;if(_0x2975cb[_0x4dc8('0x34')][_0x4dc8('0x43')]){_0x4d72e9['include']=[{'all':!![]}];}return db[_0x4dc8('0x30')][_0x4dc8('0x44')](_0x4d72e9);})['then'](function(_0x1dec99){_0x379582[_0x4dc8('0x45')]=_0x1dec99;return _0x379582;})[_0x4dc8('0x28')](respondWithFilteredResult(_0xb4b798,_0x4d72e9))['catch'](handleError(_0xb4b798,null));};exports[_0x4dc8('0x46')]=function(_0x366060,_0x57cbf8){var _0x326ab9={'raw':![],'where':{'id':_0x366060['params']['id']}},_0x391083={};_0x391083['model']=_[_0x4dc8('0x35')](db[_0x4dc8('0x30')]['rawAttributes']);_0x391083[_0x4dc8('0x34')]=_[_0x4dc8('0x35')](_0x366060['query']);_0x391083['filters']=_['intersection'](_0x391083['model'],_0x391083[_0x4dc8('0x34')]);_0x326ab9['attributes']=_[_0x4dc8('0x37')](_0x391083['model'],qs[_0x4dc8('0x39')](_0x366060[_0x4dc8('0x34')][_0x4dc8('0x39')]));_0x326ab9[_0x4dc8('0x38')]=_0x326ab9[_0x4dc8('0x38')]['length']?_0x326ab9[_0x4dc8('0x38')]:_0x391083['model'];if(_0x366060[_0x4dc8('0x34')]['includeAll']){_0x326ab9['include']=[{'all':!![]}];}_0x326ab9=_['merge']({},_0x326ab9,_0x366060[_0x4dc8('0x42')]);return db[_0x4dc8('0x30')][_0x4dc8('0x47')](_0x326ab9)['then'](handleEntityNotFound(_0x57cbf8,null))[_0x4dc8('0x28')](respondWithResult(_0x57cbf8,null))[_0x4dc8('0x48')](handleError(_0x57cbf8,null));};exports[_0x4dc8('0x49')]=function(_0x435347,_0xe91031){return db[_0x4dc8('0x30')]['create'](_0x435347[_0x4dc8('0x4a')],{})[_0x4dc8('0x28')](respondWithResult(_0xe91031,0xc9))['catch'](handleError(_0xe91031,null));};exports['update']=function(_0x4e56ae,_0xcf8d85){if(_0x4e56ae['body']['id']){delete _0x4e56ae[_0x4dc8('0x4a')]['id'];}return db[_0x4dc8('0x30')][_0x4dc8('0x47')]({'where':{'id':_0x4e56ae[_0x4dc8('0x4b')]['id']}})[_0x4dc8('0x28')](handleEntityNotFound(_0xcf8d85,null))['then'](saveUpdates(_0x4e56ae[_0x4dc8('0x4a')],null))[_0x4dc8('0x28')](respondWithResult(_0xcf8d85,null))['catch'](handleError(_0xcf8d85,null));};exports[_0x4dc8('0x29')]=function(_0x184a69,_0x1dd79d){return db['DeskAccount'][_0x4dc8('0x47')]({'where':{'id':_0x184a69[_0x4dc8('0x4b')]['id']}})[_0x4dc8('0x28')](handleEntityNotFound(_0x1dd79d,null))[_0x4dc8('0x28')](removeEntity(_0x1dd79d,null))[_0x4dc8('0x48')](handleError(_0x1dd79d,null));};exports[_0x4dc8('0x4c')]=function(_0x5cb1ee,_0x4def3b,_0x2c8704){var _0x4b94d3={};var _0x4449ef={};var _0x3f8335;var _0xa1e379;return db['DeskAccount'][_0x4dc8('0x4d')]({'where':{'id':_0x5cb1ee[_0x4dc8('0x4b')]['id']}})[_0x4dc8('0x28')](handleEntityNotFound(_0x4def3b,null))[_0x4dc8('0x28')](function(_0x459102){if(_0x459102){_0x3f8335=_0x459102;_0x4449ef['model']=_['keys'](db['DeskConfiguration'][_0x4dc8('0x31')]);_0x4449ef[_0x4dc8('0x34')]=_['keys'](_0x5cb1ee[_0x4dc8('0x34')]);_0x4449ef['filters']=_['intersection'](_0x4449ef[_0x4dc8('0x33')],_0x4449ef['query']);_0x4b94d3[_0x4dc8('0x38')]=_['intersection'](_0x4449ef['model'],qs['fields'](_0x5cb1ee['query'][_0x4dc8('0x39')]));_0x4b94d3[_0x4dc8('0x38')]=_0x4b94d3[_0x4dc8('0x38')]['length']?_0x4b94d3['attributes']:_0x4449ef['model'];_0x4b94d3['order']=qs[_0x4dc8('0x3d')](_0x5cb1ee[_0x4dc8('0x34')]['sort']);_0x4b94d3[_0x4dc8('0x3e')]=qs['filters'](_[_0x4dc8('0x4e')](_0x5cb1ee[_0x4dc8('0x34')],_0x4449ef[_0x4dc8('0x36')]));if(_0x5cb1ee[_0x4dc8('0x34')][_0x4dc8('0x3f')]){_0x4b94d3['where']=_[_0x4dc8('0x40')](_0x4b94d3[_0x4dc8('0x3e')],{'$or':_['map'](_0x4b94d3['attributes'],function(_0xfca43a){var _0x11d132={};_0x11d132[_0xfca43a]={'$like':'%'+_0x5cb1ee['query'][_0x4dc8('0x3f')]+'%'};return _0x11d132;})});}_0x4b94d3=_[_0x4dc8('0x40')]({},_0x4b94d3,_0x5cb1ee[_0x4dc8('0x42')]);return _0x3f8335[_0x4dc8('0x4c')](_0x4b94d3);}})[_0x4dc8('0x28')](function(_0x3e9d1e){if(_0x3e9d1e){_0xa1e379=_0x3e9d1e[_0x4dc8('0x3a')];if(!_0x5cb1ee[_0x4dc8('0x34')][_0x4dc8('0x3b')](_0x4dc8('0x3c'))){_0x4b94d3[_0x4dc8('0x20')]=qs[_0x4dc8('0x20')](_0x5cb1ee['query'][_0x4dc8('0x20')]);_0x4b94d3[_0x4dc8('0x1e')]=qs['offset'](_0x5cb1ee[_0x4dc8('0x34')][_0x4dc8('0x1e')]);}return _0x3f8335[_0x4dc8('0x4c')](_0x4b94d3);}})['then'](function(_0x2bbb6e){if(_0x2bbb6e){return _0x2bbb6e?{'count':_0xa1e379,'rows':_0x2bbb6e}:null;}})[_0x4dc8('0x28')](respondWithResult(_0x4def3b,null))[_0x4dc8('0x48')](handleError(_0x4def3b,null));};exports[_0x4dc8('0x4f')]=function(_0x3bafd1,_0x1c7369,_0x5208cb){if(_0x3bafd1[_0x4dc8('0x4a')]['id']){delete _0x3bafd1[_0x4dc8('0x4a')]['id'];}return db[_0x4dc8('0x30')][_0x4dc8('0x4d')]({'where':{'id':_0x3bafd1[_0x4dc8('0x4b')]['id']}})[_0x4dc8('0x28')](handleEntityNotFound(_0x1c7369,null))[_0x4dc8('0x28')](function(_0x41d2c6){if(_0x41d2c6){_0x3bafd1[_0x4dc8('0x4a')]['AccountId']=_0x41d2c6['id'];_0x3bafd1[_0x4dc8('0x4a')][_0x4dc8('0x50')]=integrations[_0x4dc8('0x51')](_0x3bafd1[_0x4dc8('0x4a')][_0x4dc8('0x52')],_0x3bafd1[_0x4dc8('0x4a')][_0x4dc8('0x53')]);_0x3bafd1[_0x4dc8('0x4a')]['Descriptions']=integrations[_0x4dc8('0x54')](_0x3bafd1[_0x4dc8('0x4a')][_0x4dc8('0x52')],_0x3bafd1[_0x4dc8('0x4a')][_0x4dc8('0x53')]);return db[_0x4dc8('0x55')][_0x4dc8('0x49')](_0x3bafd1[_0x4dc8('0x4a')],{'include':[{'model':db['DeskField'],'as':_0x4dc8('0x50')},{'model':db[_0x4dc8('0x56')],'as':_0x4dc8('0x57')}]});}return null;})[_0x4dc8('0x28')](respondWithResult(_0x1c7369,null))[_0x4dc8('0x48')](handleError(_0x1c7369,null));};exports[_0x4dc8('0x58')]=function(_0xe8fc1e,_0x177e00,_0x2452fa){var _0x342032=[{'name':_0x4dc8('0x59'),'label':_0x4dc8('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x6793d5='';return db[_0x4dc8('0x30')][_0x4dc8('0x4d')]({'where':{'id':_0xe8fc1e[_0x4dc8('0x4b')]['id']},'attributes':['id','remoteUri',_0x4dc8('0x5a'),_0x4dc8('0x5b'),_0x4dc8('0x5c'),'consumerKey',_0x4dc8('0x5d'),_0x4dc8('0x5e'),_0x4dc8('0x5f')]})['then'](handleEntityNotFound(_0x177e00,null))[_0x4dc8('0x28')](function(_0x1bcec5){if(_0x1bcec5){_0x6793d5=_0x1bcec5[_0x4dc8('0x60')];var _0x4e0b78=_0x6793d5[_0x4dc8('0x61')](-0x1);if(_0x4e0b78==='/'){_0x6793d5=_0x6793d5[_0x4dc8('0x62')](0x0,_0x6793d5[_0x4dc8('0x63')](_0x4e0b78));}var _0x401f03={'method':_0x4dc8('0x64'),'uri':util[_0x4dc8('0x65')](_0x4dc8('0x66'),_0x6793d5),'headers':{'Content-Type':'application/json','Accept':_0x4dc8('0x67')},'json':!![]};if(_0x1bcec5[_0x4dc8('0x5a')]===_0x4dc8('0x68')){_0x401f03['headers'][_0x4dc8('0x69')]=util[_0x4dc8('0x65')](_0x4dc8('0x6a'),new Buffer(util[_0x4dc8('0x65')](_0x4dc8('0x6b'),_0x1bcec5['username'],_0x1bcec5['password']))[_0x4dc8('0x6c')](_0x4dc8('0x6d')));}return rp(_0x401f03)['then'](function(_0x33e5fe){return _0x342032['concat'](_[_0x4dc8('0x2f')](_0x33e5fe[_0x4dc8('0x6e')][_0x4dc8('0x6f')],function(_0x10b077){return{'id':_0x10b077[_0x4dc8('0x2c')],'name':_0x10b077['name'],'type':_0x10b077[_0x4dc8('0x53')],'active':_0x10b077[_0x4dc8('0x70')],'label':_0x10b077[_0x4dc8('0x71')],'custom':!![]};}));});}})['then'](function(_0x3ff763){return{'count':_0x3ff763[_0x4dc8('0x3a')],'rows':_0x3ff763};})['then'](respondWithResult(_0x177e00,null))[_0x4dc8('0x48')](function(_0x7423ef){var _0x29fec2=_0xe8fc1e[_0x4dc8('0x34')][_0x4dc8('0x72')]?0x1f4:_0x7423ef[_0x4dc8('0x73')]||0x1f4;logger['error'](_0x4dc8('0x74'),_0x4dc8('0x58'),_0x29fec2,JSON[_0x4dc8('0x75')](_0x7423ef));delete _0x7423ef[_0x4dc8('0x2c')];if(_0x29fec2===0x191){_0x29fec2=0x190;}_0x177e00[_0x4dc8('0x1b')](_0x29fec2)[_0x4dc8('0x2d')](_0xe8fc1e['query'][_0x4dc8('0x72')]?{'message':_0x4dc8('0x76'),'statusCode':_0x7423ef[_0x4dc8('0x73')]}:_0x7423ef);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ba412ef..9e3ef89 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 _0xb6ae=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6ae,0xf6));var _0xeb6a=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xb6ae[_0x4afac5];return _0x2404b3;};'use strict';var _=require(_0xeb6a('0x0'));var util=require('util');var logger=require(_0xeb6a('0x1'))(_0xeb6a('0x2'));var moment=require(_0xeb6a('0x3'));var BPromise=require(_0xeb6a('0x4'));var rp=require(_0xeb6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb6a('0x6'));var config=require(_0xeb6a('0x7'));var attributes=require(_0xeb6a('0x8'));var integrations=require(_0xeb6a('0x9'));module[_0xeb6a('0xa')]=function(_0x500199,_0x4a7845){return _0x500199[_0xeb6a('0xb')](_0xeb6a('0xc'),attributes,{'tableName':_0xeb6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2396=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x33ac75,_0x4953e3){var _0x34d5f2=function(_0x4c2b4a){while(--_0x4c2b4a){_0x33ac75['push'](_0x33ac75['shift']());}};_0x34d5f2(++_0x4953e3);}(_0x2396,0x77));var _0x6239=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x2396[_0x267d8d];return _0x11a98f;};'use strict';var _=require(_0x6239('0x0'));var util=require(_0x6239('0x1'));var logger=require(_0x6239('0x2'))(_0x6239('0x3'));var moment=require('moment');var BPromise=require(_0x6239('0x4'));var rp=require(_0x6239('0x5'));var fs=require('fs');var path=require(_0x6239('0x6'));var rimraf=require('rimraf');var config=require(_0x6239('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x6239('0x8')]=function(_0x9a00da,_0x42bfa7){return _0x9a00da[_0x6239('0x9')](_0x6239('0xa'),attributes,{'tableName':_0x6239('0xb'),'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 0868a7d..f66a199 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 _0x28f8=['limit','map','include','model','attributes','ShowDeskAccount','DeskAccount','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetDeskAccount','findAll','options','raw'];(function(_0x405870,_0x5410ea){var _0x785164=function(_0x40b2a1){while(--_0x40b2a1){_0x405870['push'](_0x405870['shift']());}};_0x785164(++_0x5410ea);}(_0x28f8,0x121));var _0x828f=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x28f8[_0x4ac424];return _0xe1b890;};'use strict';var _=require(_0x828f('0x0'));var util=require('util');var moment=require(_0x828f('0x1'));var BPromise=require('bluebird');var rs=require(_0x828f('0x2'));var fs=require('fs');var Redis=require(_0x828f('0x3'));var db=require(_0x828f('0x4'))['db'];var utils=require(_0x828f('0x5'));var logger=require('../../config/logger')(_0x828f('0x6'));var config=require(_0x828f('0x7'));var jayson=require(_0x828f('0x8'));var client=jayson[_0x828f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe39c31,_0x5209cc,_0x293b19){return new BPromise(function(_0x542928,_0x35cbfb){return client[_0x828f('0xa')](_0xe39c31,_0x293b19)[_0x828f('0xb')](function(_0x1ae727){logger[_0x828f('0xc')](_0x828f('0xd'),_0x5209cc,'request\x20sent');logger[_0x828f('0xe')](_0x828f('0xf'),_0x5209cc,'request\x20sent',JSON['stringify'](_0x1ae727));if(_0x1ae727['error']){if(_0x1ae727[_0x828f('0x10')][_0x828f('0x11')]===0x1f4){logger['error'](_0x828f('0xd'),_0x5209cc,_0x1ae727[_0x828f('0x10')]['message']);return _0x35cbfb(_0x1ae727[_0x828f('0x10')][_0x828f('0x12')]);}logger[_0x828f('0x10')](_0x828f('0xd'),_0x5209cc,_0x1ae727['error']['message']);return _0x542928(_0x1ae727[_0x828f('0x10')][_0x828f('0x12')]);}else{logger[_0x828f('0xc')](_0x828f('0xd'),_0x5209cc,_0x828f('0x13'));_0x542928(_0x1ae727[_0x828f('0x14')]['message']);}})[_0x828f('0x15')](function(_0x4156e9){logger[_0x828f('0x10')](_0x828f('0xd'),_0x5209cc,_0x4156e9);_0x35cbfb(_0x4156e9);});});}exports[_0x828f('0x16')]=function(_0x12d044){var _0x267fc4=this;return new Promise(function(_0x53f5a3,_0x1a20b2){return db['DeskAccount'][_0x828f('0x17')]({'raw':_0x12d044[_0x828f('0x18')]?_0x12d044[_0x828f('0x18')][_0x828f('0x19')]===undefined?!![]:![]:!![],'where':_0x12d044['options']?_0x12d044[_0x828f('0x18')]['where']||null:null,'attributes':_0x12d044[_0x828f('0x18')]?_0x12d044[_0x828f('0x18')]['attributes']||null:null,'limit':_0x12d044[_0x828f('0x18')]?_0x12d044[_0x828f('0x18')][_0x828f('0x1a')]||null:null,'include':_0x12d044['options']?_0x12d044['options']['include']?_[_0x828f('0x1b')](_0x12d044['options'][_0x828f('0x1c')],function(_0x1ad993){return{'model':db[_0x1ad993[_0x828f('0x1d')]],'as':_0x1ad993['as'],'attributes':_0x1ad993[_0x828f('0x1e')],'include':_0x1ad993[_0x828f('0x1c')]?_['map'](_0x1ad993[_0x828f('0x1c')],function(_0x45c633){return{'model':db[_0x45c633[_0x828f('0x1d')]],'as':_0x45c633['as'],'attributes':_0x45c633[_0x828f('0x1e')],'include':_0x45c633[_0x828f('0x1c')]?_[_0x828f('0x1b')](_0x45c633['include'],function(_0x13be42){return{'model':db[_0x13be42['model']],'as':_0x13be42['as'],'attributes':_0x13be42['attributes']};}):[]};}):[]};}):[]:[]})[_0x828f('0xb')](function(_0x1355ba){logger[_0x828f('0xc')](_0x828f('0x16'),_0x12d044);logger['debug'](_0x828f('0x16'),_0x12d044,JSON['stringify'](_0x1355ba));_0x53f5a3(_0x1355ba);})[_0x828f('0x15')](function(_0x34e50a){logger[_0x828f('0x10')](_0x828f('0x16'),_0x34e50a[_0x828f('0x12')],_0x12d044);_0x1a20b2(_0x267fc4[_0x828f('0x10')](0x1f4,_0x34e50a[_0x828f('0x12')]));});});};exports[_0x828f('0x1f')]=function(_0x2b4efd){var _0x161a08=this;return new Promise(function(_0x190e97,_0x5d3730){return db[_0x828f('0x20')][_0x828f('0x21')]({'raw':_0x2b4efd['options']?_0x2b4efd[_0x828f('0x18')][_0x828f('0x19')]===undefined?!![]:![]:!![],'where':_0x2b4efd[_0x828f('0x18')]?_0x2b4efd[_0x828f('0x18')][_0x828f('0x22')]||null:null,'attributes':_0x2b4efd[_0x828f('0x18')]?_0x2b4efd[_0x828f('0x18')]['attributes']||null:null,'include':_0x2b4efd[_0x828f('0x18')]?_0x2b4efd[_0x828f('0x18')]['include']?_['map'](_0x2b4efd[_0x828f('0x18')][_0x828f('0x1c')],function(_0x4ba6f3){return{'model':db[_0x4ba6f3[_0x828f('0x1d')]],'as':_0x4ba6f3['as'],'attributes':_0x4ba6f3['attributes'],'include':_0x4ba6f3[_0x828f('0x1c')]?_['map'](_0x4ba6f3['include'],function(_0x470b91){return{'model':db[_0x470b91[_0x828f('0x1d')]],'as':_0x470b91['as'],'attributes':_0x470b91['attributes'],'include':_0x470b91[_0x828f('0x1c')]?_['map'](_0x470b91['include'],function(_0x3a1ef0){return{'model':db[_0x3a1ef0[_0x828f('0x1d')]],'as':_0x3a1ef0['as'],'attributes':_0x3a1ef0[_0x828f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41385a){logger[_0x828f('0xc')](_0x828f('0x1f'),_0x2b4efd);logger[_0x828f('0xe')]('ShowDeskAccount',_0x2b4efd,JSON['stringify'](_0x41385a));_0x190e97(_0x41385a);})['catch'](function(_0xd1af5a){logger[_0x828f('0x10')]('ShowDeskAccount',_0xd1af5a[_0x828f('0x12')],_0x2b4efd);_0x5d3730(_0x161a08[_0x828f('0x10')](0x1f4,_0xd1af5a['message']));});});}; \ No newline at end of file +var _0xb352=['raw','attributes','include','map','ShowDeskAccount','where','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options'];(function(_0x484b1c,_0x4c9285){var _0x42dd71=function(_0x26ae0c){while(--_0x26ae0c){_0x484b1c['push'](_0x484b1c['shift']());}};_0x42dd71(++_0x4c9285);}(_0xb352,0xda));var _0x2b35=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb352[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x2b35('0x0'));var util=require('util');var moment=require(_0x2b35('0x1'));var BPromise=require(_0x2b35('0x2'));var rs=require(_0x2b35('0x3'));var fs=require('fs');var Redis=require(_0x2b35('0x4'));var db=require(_0x2b35('0x5'))['db'];var utils=require(_0x2b35('0x6'));var logger=require(_0x2b35('0x7'))(_0x2b35('0x8'));var config=require(_0x2b35('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2b35('0xa')][_0x2b35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e8131,_0x233196,_0x392fc1){return new BPromise(function(_0x5348e6,_0x362082){return client[_0x2b35('0xc')](_0x2e8131,_0x392fc1)['then'](function(_0x1af1a3){logger[_0x2b35('0xd')](_0x2b35('0xe'),_0x233196,'request\x20sent');logger[_0x2b35('0xf')](_0x2b35('0x10'),_0x233196,_0x2b35('0x11'),JSON[_0x2b35('0x12')](_0x1af1a3));if(_0x1af1a3[_0x2b35('0x13')]){if(_0x1af1a3[_0x2b35('0x13')][_0x2b35('0x14')]===0x1f4){logger['error'](_0x2b35('0xe'),_0x233196,_0x1af1a3['error'][_0x2b35('0x15')]);return _0x362082(_0x1af1a3[_0x2b35('0x13')][_0x2b35('0x15')]);}logger['error'](_0x2b35('0xe'),_0x233196,_0x1af1a3[_0x2b35('0x13')][_0x2b35('0x15')]);return _0x5348e6(_0x1af1a3['error'][_0x2b35('0x15')]);}else{logger[_0x2b35('0xd')](_0x2b35('0xe'),_0x233196,'request\x20sent');_0x5348e6(_0x1af1a3[_0x2b35('0x16')][_0x2b35('0x15')]);}})[_0x2b35('0x17')](function(_0x22f57f){logger['error']('DeskAccount,\x20%s,\x20%s',_0x233196,_0x22f57f);_0x362082(_0x22f57f);});});}exports[_0x2b35('0x18')]=function(_0x4905cb){var _0x382358=this;return new Promise(function(_0x274a65,_0x40f1d0){return db[_0x2b35('0x19')]['findAll']({'raw':_0x4905cb[_0x2b35('0x1a')]?_0x4905cb[_0x2b35('0x1a')][_0x2b35('0x1b')]===undefined?!![]:![]:!![],'where':_0x4905cb[_0x2b35('0x1a')]?_0x4905cb[_0x2b35('0x1a')]['where']||null:null,'attributes':_0x4905cb['options']?_0x4905cb[_0x2b35('0x1a')][_0x2b35('0x1c')]||null:null,'limit':_0x4905cb['options']?_0x4905cb[_0x2b35('0x1a')]['limit']||null:null,'include':_0x4905cb[_0x2b35('0x1a')]?_0x4905cb['options'][_0x2b35('0x1d')]?_[_0x2b35('0x1e')](_0x4905cb[_0x2b35('0x1a')][_0x2b35('0x1d')],function(_0x86dd99){return{'model':db[_0x86dd99['model']],'as':_0x86dd99['as'],'attributes':_0x86dd99[_0x2b35('0x1c')],'include':_0x86dd99[_0x2b35('0x1d')]?_[_0x2b35('0x1e')](_0x86dd99[_0x2b35('0x1d')],function(_0x34651f){return{'model':db[_0x34651f['model']],'as':_0x34651f['as'],'attributes':_0x34651f[_0x2b35('0x1c')],'include':_0x34651f['include']?_[_0x2b35('0x1e')](_0x34651f[_0x2b35('0x1d')],function(_0x2c3cf4){return{'model':db[_0x2c3cf4['model']],'as':_0x2c3cf4['as'],'attributes':_0x2c3cf4[_0x2b35('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cfaa3){logger[_0x2b35('0xd')]('GetDeskAccount',_0x4905cb);logger[_0x2b35('0xf')](_0x2b35('0x18'),_0x4905cb,JSON[_0x2b35('0x12')](_0x2cfaa3));_0x274a65(_0x2cfaa3);})['catch'](function(_0x2e8665){logger['error'](_0x2b35('0x18'),_0x2e8665[_0x2b35('0x15')],_0x4905cb);_0x40f1d0(_0x382358['error'](0x1f4,_0x2e8665[_0x2b35('0x15')]));});});};exports[_0x2b35('0x1f')]=function(_0x3e9f9b){var _0x2ca2f0=this;return new Promise(function(_0x368da4,_0xbcfc16){return db[_0x2b35('0x19')]['find']({'raw':_0x3e9f9b[_0x2b35('0x1a')]?_0x3e9f9b[_0x2b35('0x1a')][_0x2b35('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e9f9b[_0x2b35('0x1a')]?_0x3e9f9b[_0x2b35('0x1a')][_0x2b35('0x20')]||null:null,'attributes':_0x3e9f9b['options']?_0x3e9f9b[_0x2b35('0x1a')]['attributes']||null:null,'include':_0x3e9f9b[_0x2b35('0x1a')]?_0x3e9f9b[_0x2b35('0x1a')]['include']?_[_0x2b35('0x1e')](_0x3e9f9b[_0x2b35('0x1a')]['include'],function(_0x2d1b3f){return{'model':db[_0x2d1b3f[_0x2b35('0x21')]],'as':_0x2d1b3f['as'],'attributes':_0x2d1b3f['attributes'],'include':_0x2d1b3f['include']?_[_0x2b35('0x1e')](_0x2d1b3f['include'],function(_0x3005bb){return{'model':db[_0x3005bb[_0x2b35('0x21')]],'as':_0x3005bb['as'],'attributes':_0x3005bb['attributes'],'include':_0x3005bb[_0x2b35('0x1d')]?_[_0x2b35('0x1e')](_0x3005bb[_0x2b35('0x1d')],function(_0x187576){return{'model':db[_0x187576[_0x2b35('0x21')]],'as':_0x187576['as'],'attributes':_0x187576['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b35('0x22')](function(_0x12f900){logger[_0x2b35('0xd')](_0x2b35('0x1f'),_0x3e9f9b);logger[_0x2b35('0xf')](_0x2b35('0x1f'),_0x3e9f9b,JSON['stringify'](_0x12f900));_0x368da4(_0x12f900);})[_0x2b35('0x17')](function(_0x563871){logger[_0x2b35('0x13')](_0x2b35('0x1f'),_0x563871['message'],_0x3e9f9b);_0xbcfc16(_0x2ca2f0['error'](0x1f4,_0x563871[_0x2b35('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6ef4a81..82b8d8f 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 _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(_0x40a683,_0x546a2c){var _0x3597b1=function(_0x94e979){while(--_0x94e979){_0x40a683['push'](_0x40a683['shift']());}};_0x3597b1(++_0x546a2c);}(_0x008c,0x188));var _0xc008=function(_0x98e64,_0x216f4d){_0x98e64=_0x98e64-0x0;var _0x48d537=_0x008c[_0x98e64];return _0x48d537;};'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 +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x47baf5,_0x195010){var _0x4d5d0f=function(_0x1e0487){while(--_0x1e0487){_0x47baf5['push'](_0x47baf5['shift']());}};_0x4d5d0f(++_0x195010);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b43ed87..5c8a32a 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 _0x215e=['STRING'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0x215e,0x157));var _0xe215=function(_0x3d63e3,_0xbee445){_0x3d63e3=_0x3d63e3-0x0;var _0x1220ad=_0x215e[_0x3d63e3];return _0x1220ad;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe215('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe71b=['exports','STRING'];(function(_0x1bb593,_0x4662c9){var _0x495172=function(_0x3453cc){while(--_0x3453cc){_0x1bb593['push'](_0x1bb593['shift']());}};_0x495172(++_0x4662c9);}(_0xe71b,0x1ac));var _0xbe71=function(_0x54daf5,_0x528643){_0x54daf5=_0x54daf5-0x0;var _0xf70158=_0xe71b[_0x54daf5];return _0xf70158;};'use strict';var Sequelize=require('sequelize');module[_0xbe71('0x0')]={'name':{'type':Sequelize[_0xbe71('0x1')]},'description':{'type':Sequelize[_0xbe71('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3370a04..9a59199 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 _0xf477=['count','offset','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','findOne','DeskField','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit'];(function(_0x4a5cdc,_0x7cdd47){var _0x298986=function(_0x4d46fd){while(--_0x4d46fd){_0x4a5cdc['push'](_0x4a5cdc['shift']());}};_0x298986(++_0x7cdd47);}(_0xf477,0xeb));var _0x7f47=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf477[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x7f47('0x0'));var rimraf=require(_0x7f47('0x1'));var zipdir=require(_0x7f47('0x2'));var jsonpatch=require(_0x7f47('0x3'));var rp=require(_0x7f47('0x4'));var moment=require(_0x7f47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7f47('0x6'));var util=require(_0x7f47('0x7'));var path=require(_0x7f47('0x8'));var sox=require(_0x7f47('0x9'));var csv=require(_0x7f47('0xa'));var ejs=require(_0x7f47('0xb'));var fs=require('fs');var fs_extra=require(_0x7f47('0xc'));var _=require(_0x7f47('0xd'));var squel=require(_0x7f47('0xe'));var crypto=require(_0x7f47('0xf'));var jsforce=require(_0x7f47('0x10'));var deskjs=require(_0x7f47('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7f47('0x12'));var Papa=require(_0x7f47('0x13'));var Redis=require(_0x7f47('0x14'));var authService=require(_0x7f47('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f47('0x16'));var logger=require('../../config/logger')(_0x7f47('0x17'));var utils=require(_0x7f47('0x18'));var config=require(_0x7f47('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f47('0x1a'))['db'];function respondWithStatusCode(_0x144318,_0x7ca99){_0x7ca99=_0x7ca99||0xcc;return function(_0x142a07){if(_0x142a07){return _0x144318[_0x7f47('0x1b')](_0x7ca99);}return _0x144318[_0x7f47('0x1c')](_0x7ca99)['end']();};}function respondWithResult(_0x42f885,_0x1d2a3b){_0x1d2a3b=_0x1d2a3b||0xc8;return function(_0x25bd95){if(_0x25bd95){return _0x42f885[_0x7f47('0x1c')](_0x1d2a3b)[_0x7f47('0x1d')](_0x25bd95);}};}function respondWithFilteredResult(_0x12d194,_0x470d40){return function(_0x36f513){if(_0x36f513){var _0x190549=typeof _0x470d40['offset']===_0x7f47('0x1e')&&typeof _0x470d40[_0x7f47('0x1f')]===_0x7f47('0x1e');var _0x27fd3b=_0x36f513[_0x7f47('0x20')];var _0x410616=_0x190549?0x0:_0x470d40['offset'];var _0x180d05=_0x190549?_0x36f513['count']:_0x470d40[_0x7f47('0x21')]+_0x470d40['limit'];var _0x2f09fd;if(_0x180d05>=_0x27fd3b){_0x180d05=_0x27fd3b;_0x2f09fd=0xc8;}else{_0x2f09fd=0xce;}_0x12d194[_0x7f47('0x1c')](_0x2f09fd);return _0x12d194[_0x7f47('0x22')](_0x7f47('0x23'),_0x410616+'-'+_0x180d05+'/'+_0x27fd3b)[_0x7f47('0x1d')](_0x36f513);}return null;};}function patchUpdates(_0x221b83){return function(_0x1aae52){try{jsonpatch[_0x7f47('0x24')](_0x1aae52,_0x221b83,!![]);}catch(_0x20ca22){return BPromise[_0x7f47('0x25')](_0x20ca22);}return _0x1aae52[_0x7f47('0x26')]();};}function saveUpdates(_0x31d1fd,_0x13ea4f){return function(_0x278e42){if(_0x278e42){return _0x278e42['update'](_0x31d1fd)['then'](function(_0x15dedc){return _0x15dedc;});}return null;};}function removeEntity(_0x1c6163,_0x1d5264){return function(_0x4f3f41){if(_0x4f3f41){return _0x4f3f41[_0x7f47('0x27')]()[_0x7f47('0x28')](function(){_0x1c6163[_0x7f47('0x1c')](0xcc)[_0x7f47('0x29')]();});}};}function handleEntityNotFound(_0x15fad9,_0x5a5564){return function(_0x522f11){if(!_0x522f11){_0x15fad9[_0x7f47('0x1b')](0x194);}return _0x522f11;};}function handleError(_0x249f4a,_0x5bed14){_0x5bed14=_0x5bed14||0x1f4;return function(_0x343dd7){logger[_0x7f47('0x2a')](_0x343dd7[_0x7f47('0x2b')]);if(_0x343dd7[_0x7f47('0x2c')]){delete _0x343dd7['name'];}_0x249f4a[_0x7f47('0x1c')](_0x5bed14)[_0x7f47('0x2d')](_0x343dd7);};}exports[_0x7f47('0x2e')]=function(_0x21299d,_0x519ae8){var _0x30a101={},_0x5c6a6a={},_0x2523d4={'count':0x0,'rows':[]};var _0xcd7a55=_[_0x7f47('0x2f')](db[_0x7f47('0x30')][_0x7f47('0x31')],function(_0x1df403){return{'name':_0x1df403['fieldName'],'type':_0x1df403[_0x7f47('0x32')][_0x7f47('0x33')]};});_0x5c6a6a['model']=_[_0x7f47('0x2f')](_0xcd7a55,'name');_0x5c6a6a[_0x7f47('0x34')]=_[_0x7f47('0x35')](_0x21299d[_0x7f47('0x34')]);_0x5c6a6a[_0x7f47('0x36')]=_[_0x7f47('0x37')](_0x5c6a6a[_0x7f47('0x38')],_0x5c6a6a[_0x7f47('0x34')]);_0x30a101[_0x7f47('0x39')]=_[_0x7f47('0x37')](_0x5c6a6a[_0x7f47('0x38')],qs['fields'](_0x21299d['query'][_0x7f47('0x3a')]));_0x30a101[_0x7f47('0x39')]=_0x30a101[_0x7f47('0x39')][_0x7f47('0x3b')]?_0x30a101[_0x7f47('0x39')]:_0x5c6a6a['model'];if(!_0x21299d['query'][_0x7f47('0x3c')](_0x7f47('0x3d'))){_0x30a101[_0x7f47('0x1f')]=qs[_0x7f47('0x1f')](_0x21299d['query'][_0x7f47('0x1f')]);_0x30a101[_0x7f47('0x21')]=qs[_0x7f47('0x21')](_0x21299d[_0x7f47('0x34')][_0x7f47('0x21')]);}_0x30a101[_0x7f47('0x3e')]=qs['sort'](_0x21299d[_0x7f47('0x34')][_0x7f47('0x3f')]);_0x30a101['where']=qs['filters'](_[_0x7f47('0x40')](_0x21299d[_0x7f47('0x34')],_0x5c6a6a[_0x7f47('0x36')]),_0xcd7a55);if(_0x21299d[_0x7f47('0x34')][_0x7f47('0x41')]){_0x30a101['where']=_[_0x7f47('0x42')](_0x30a101[_0x7f47('0x43')],{'$or':_[_0x7f47('0x2f')](_0xcd7a55,function(_0x20cb53){if(_0x20cb53[_0x7f47('0x32')]!==_0x7f47('0x44')){var _0x56a7ac={};_0x56a7ac[_0x20cb53[_0x7f47('0x2c')]]={'$like':'%'+_0x21299d['query'][_0x7f47('0x41')]+'%'};return _0x56a7ac;}})});}_0x30a101=_[_0x7f47('0x42')]({},_0x30a101,_0x21299d['options']);var _0x1c1139={'where':_0x30a101[_0x7f47('0x43')]};return db[_0x7f47('0x30')][_0x7f47('0x20')](_0x1c1139)[_0x7f47('0x28')](function(_0x3325a7){_0x2523d4[_0x7f47('0x20')]=_0x3325a7;if(_0x21299d['query'][_0x7f47('0x45')]){_0x30a101[_0x7f47('0x46')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x7f47('0x47')](_0x30a101);})[_0x7f47('0x28')](function(_0x3bb7a9){_0x2523d4[_0x7f47('0x48')]=_0x3bb7a9;return _0x2523d4;})['then'](respondWithFilteredResult(_0x519ae8,_0x30a101))['catch'](handleError(_0x519ae8,null));};exports[_0x7f47('0x49')]=function(_0x2bdd42,_0xcb4bb7){var _0x334a0a={'raw':![],'where':{'id':_0x2bdd42[_0x7f47('0x4a')]['id']}},_0x52f094={};_0x52f094['model']=_[_0x7f47('0x35')](db[_0x7f47('0x30')][_0x7f47('0x31')]);_0x52f094[_0x7f47('0x34')]=_[_0x7f47('0x35')](_0x2bdd42[_0x7f47('0x34')]);_0x52f094['filters']=_[_0x7f47('0x37')](_0x52f094[_0x7f47('0x38')],_0x52f094[_0x7f47('0x34')]);_0x334a0a[_0x7f47('0x39')]=_[_0x7f47('0x37')](_0x52f094[_0x7f47('0x38')],qs[_0x7f47('0x3a')](_0x2bdd42[_0x7f47('0x34')]['fields']));_0x334a0a[_0x7f47('0x39')]=_0x334a0a[_0x7f47('0x39')][_0x7f47('0x3b')]?_0x334a0a[_0x7f47('0x39')]:_0x52f094[_0x7f47('0x38')];if(_0x2bdd42[_0x7f47('0x34')][_0x7f47('0x45')]){_0x334a0a['include']=[{'all':!![]}];}_0x334a0a=_[_0x7f47('0x42')]({},_0x334a0a,_0x2bdd42[_0x7f47('0x4b')]);return db[_0x7f47('0x30')]['find'](_0x334a0a)[_0x7f47('0x28')](handleEntityNotFound(_0xcb4bb7,null))[_0x7f47('0x28')](respondWithResult(_0xcb4bb7,null))[_0x7f47('0x4c')](handleError(_0xcb4bb7,null));};exports['create']=function(_0x4ba05b,_0x2d1a6b){return db[_0x7f47('0x30')][_0x7f47('0x4d')](_0x4ba05b['body'],{})[_0x7f47('0x28')](respondWithResult(_0x2d1a6b,0xc9))[_0x7f47('0x4c')](handleError(_0x2d1a6b,null));};exports['update']=function(_0x25a294,_0x32f98){if(_0x25a294[_0x7f47('0x4e')]['id']){delete _0x25a294['body']['id'];}return db[_0x7f47('0x30')]['find']({'where':{'id':_0x25a294['params']['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x32f98,null))[_0x7f47('0x28')](saveUpdates(_0x25a294['body'],null))[_0x7f47('0x28')](respondWithResult(_0x32f98,null))[_0x7f47('0x4c')](handleError(_0x32f98,null));};exports['destroy']=function(_0x5e1acd,_0x29f083){return db[_0x7f47('0x30')][_0x7f47('0x4f')]({'where':{'id':_0x5e1acd[_0x7f47('0x4a')]['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x29f083,null))[_0x7f47('0x28')](removeEntity(_0x29f083,null))['catch'](handleError(_0x29f083,null));};exports['getFields']=function(_0x304f0e,_0x31756f,_0x5052cf){var _0x293031={};var _0x595e80={};var _0xac115a;var _0x20ec65;return db[_0x7f47('0x30')][_0x7f47('0x50')]({'where':{'id':_0x304f0e[_0x7f47('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31756f,null))['then'](function(_0x50a898){if(_0x50a898){_0xac115a=_0x50a898;_0x595e80[_0x7f47('0x38')]=_[_0x7f47('0x35')](db[_0x7f47('0x51')][_0x7f47('0x31')]);_0x595e80[_0x7f47('0x34')]=_['keys'](_0x304f0e['query']);_0x595e80[_0x7f47('0x36')]=_[_0x7f47('0x37')](_0x595e80[_0x7f47('0x38')],_0x595e80[_0x7f47('0x34')]);_0x293031[_0x7f47('0x39')]=_[_0x7f47('0x37')](_0x595e80[_0x7f47('0x38')],qs[_0x7f47('0x3a')](_0x304f0e['query'][_0x7f47('0x3a')]));_0x293031[_0x7f47('0x39')]=_0x293031[_0x7f47('0x39')]['length']?_0x293031['attributes']:_0x595e80[_0x7f47('0x38')];_0x293031[_0x7f47('0x3e')]=qs[_0x7f47('0x3f')](_0x304f0e[_0x7f47('0x34')][_0x7f47('0x3f')]);_0x293031['where']=qs['filters'](_['pick'](_0x304f0e[_0x7f47('0x34')],_0x595e80[_0x7f47('0x36')]));if(_0x304f0e[_0x7f47('0x34')][_0x7f47('0x41')]){_0x293031[_0x7f47('0x43')]=_[_0x7f47('0x42')](_0x293031[_0x7f47('0x43')],{'$or':_['map'](_0x293031['attributes'],function(_0x53264d){var _0x187107={};_0x187107[_0x53264d]={'$like':'%'+_0x304f0e[_0x7f47('0x34')][_0x7f47('0x41')]+'%'};return _0x187107;})});}_0x293031=_['merge']({},_0x293031,_0x304f0e[_0x7f47('0x4b')]);return _0xac115a['getFields'](_0x293031);}})[_0x7f47('0x28')](function(_0x1d0eb3){if(_0x1d0eb3){_0x20ec65=_0x1d0eb3[_0x7f47('0x3b')];if(!_0x304f0e[_0x7f47('0x34')][_0x7f47('0x3c')](_0x7f47('0x3d'))){_0x293031['limit']=qs[_0x7f47('0x1f')](_0x304f0e['query'][_0x7f47('0x1f')]);_0x293031[_0x7f47('0x21')]=qs['offset'](_0x304f0e[_0x7f47('0x34')][_0x7f47('0x21')]);}return _0xac115a[_0x7f47('0x52')](_0x293031);}})[_0x7f47('0x28')](function(_0x209535){if(_0x209535){return _0x209535?{'count':_0x20ec65,'rows':_0x209535}:null;}})[_0x7f47('0x28')](respondWithResult(_0x31756f,null))['catch'](handleError(_0x31756f,null));};exports[_0x7f47('0x53')]=function(_0x3efc6b,_0x108344,_0x448950){var _0x2ba980={};var _0x4a5098={};var _0x5ecb83;var _0x1f3a2d;return db['DeskConfiguration'][_0x7f47('0x50')]({'where':{'id':_0x3efc6b[_0x7f47('0x4a')]['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x108344,null))['then'](function(_0xbf6da6){if(_0xbf6da6){_0x5ecb83=_0xbf6da6;_0x4a5098[_0x7f47('0x38')]=_[_0x7f47('0x35')](db['DeskField']['rawAttributes']);_0x4a5098['query']=_[_0x7f47('0x35')](_0x3efc6b['query']);_0x4a5098['filters']=_[_0x7f47('0x37')](_0x4a5098[_0x7f47('0x38')],_0x4a5098[_0x7f47('0x34')]);_0x2ba980[_0x7f47('0x39')]=_[_0x7f47('0x37')](_0x4a5098[_0x7f47('0x38')],qs[_0x7f47('0x3a')](_0x3efc6b[_0x7f47('0x34')]['fields']));_0x2ba980[_0x7f47('0x39')]=_0x2ba980[_0x7f47('0x39')][_0x7f47('0x3b')]?_0x2ba980[_0x7f47('0x39')]:_0x4a5098[_0x7f47('0x38')];_0x2ba980[_0x7f47('0x3e')]=qs[_0x7f47('0x3f')](_0x3efc6b[_0x7f47('0x34')][_0x7f47('0x3f')]);_0x2ba980[_0x7f47('0x43')]=qs[_0x7f47('0x36')](_[_0x7f47('0x40')](_0x3efc6b[_0x7f47('0x34')],_0x4a5098['filters']));if(_0x3efc6b['query'][_0x7f47('0x41')]){_0x2ba980[_0x7f47('0x43')]=_['merge'](_0x2ba980[_0x7f47('0x43')],{'$or':_['map'](_0x2ba980[_0x7f47('0x39')],function(_0x358c97){var _0x3723d5={};_0x3723d5[_0x358c97]={'$like':'%'+_0x3efc6b[_0x7f47('0x34')][_0x7f47('0x41')]+'%'};return _0x3723d5;})});}_0x2ba980=_['merge']({},_0x2ba980,_0x3efc6b['options']);return _0x5ecb83[_0x7f47('0x53')](_0x2ba980);}})[_0x7f47('0x28')](function(_0x4d54bb){if(_0x4d54bb){_0x1f3a2d=_0x4d54bb[_0x7f47('0x3b')];if(!_0x3efc6b['query']['hasOwnProperty'](_0x7f47('0x3d'))){_0x2ba980[_0x7f47('0x1f')]=qs[_0x7f47('0x1f')](_0x3efc6b['query']['limit']);_0x2ba980[_0x7f47('0x21')]=qs['offset'](_0x3efc6b[_0x7f47('0x34')][_0x7f47('0x21')]);}return _0x5ecb83[_0x7f47('0x53')](_0x2ba980);}})[_0x7f47('0x28')](function(_0x95deac){if(_0x95deac){return _0x95deac?{'count':_0x1f3a2d,'rows':_0x95deac}:null;}})[_0x7f47('0x28')](respondWithResult(_0x108344,null))[_0x7f47('0x4c')](handleError(_0x108344,null));};exports[_0x7f47('0x54')]=function(_0x1f8105,_0x4a1695,_0x2ec0a2){var _0x5d279f={};var _0x39f50a={};var _0x4ec52e;var _0x4cdd2c;return db[_0x7f47('0x30')][_0x7f47('0x50')]({'where':{'id':_0x1f8105[_0x7f47('0x4a')]['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x4a1695,null))['then'](function(_0x5dde92){if(_0x5dde92){_0x4ec52e=_0x5dde92;_0x39f50a[_0x7f47('0x38')]=_['keys'](db[_0x7f47('0x51')][_0x7f47('0x31')]);_0x39f50a[_0x7f47('0x34')]=_['keys'](_0x1f8105[_0x7f47('0x34')]);_0x39f50a[_0x7f47('0x36')]=_[_0x7f47('0x37')](_0x39f50a[_0x7f47('0x38')],_0x39f50a[_0x7f47('0x34')]);_0x5d279f[_0x7f47('0x39')]=_['intersection'](_0x39f50a[_0x7f47('0x38')],qs[_0x7f47('0x3a')](_0x1f8105[_0x7f47('0x34')][_0x7f47('0x3a')]));_0x5d279f['attributes']=_0x5d279f[_0x7f47('0x39')]['length']?_0x5d279f['attributes']:_0x39f50a[_0x7f47('0x38')];_0x5d279f[_0x7f47('0x3e')]=qs[_0x7f47('0x3f')](_0x1f8105[_0x7f47('0x34')][_0x7f47('0x3f')]);_0x5d279f[_0x7f47('0x43')]=qs[_0x7f47('0x36')](_[_0x7f47('0x40')](_0x1f8105['query'],_0x39f50a[_0x7f47('0x36')]));if(_0x1f8105[_0x7f47('0x34')][_0x7f47('0x41')]){_0x5d279f[_0x7f47('0x43')]=_['merge'](_0x5d279f['where'],{'$or':_[_0x7f47('0x2f')](_0x5d279f[_0x7f47('0x39')],function(_0x5e8313){var _0x1f1271={};_0x1f1271[_0x5e8313]={'$like':'%'+_0x1f8105[_0x7f47('0x34')]['filter']+'%'};return _0x1f1271;})});}_0x5d279f=_[_0x7f47('0x42')]({},_0x5d279f,_0x1f8105[_0x7f47('0x4b')]);return _0x4ec52e['getDescriptions'](_0x5d279f);}})[_0x7f47('0x28')](function(_0x9acc2){if(_0x9acc2){_0x4cdd2c=_0x9acc2[_0x7f47('0x3b')];if(!_0x1f8105[_0x7f47('0x34')][_0x7f47('0x3c')](_0x7f47('0x3d'))){_0x5d279f[_0x7f47('0x1f')]=qs[_0x7f47('0x1f')](_0x1f8105[_0x7f47('0x34')][_0x7f47('0x1f')]);_0x5d279f[_0x7f47('0x21')]=qs[_0x7f47('0x21')](_0x1f8105[_0x7f47('0x34')][_0x7f47('0x21')]);}return _0x4ec52e[_0x7f47('0x54')](_0x5d279f);}})[_0x7f47('0x28')](function(_0x2725c2){if(_0x2725c2){return _0x2725c2?{'count':_0x4cdd2c,'rows':_0x2725c2}:null;}})['then'](respondWithResult(_0x4a1695,null))[_0x7f47('0x4c')](handleError(_0x4a1695,null));};exports['getTags']=function(_0x48e2d5,_0x335b3e,_0x184d9b){var _0x483de7={};var _0x264fda={};var _0x478e5e;var _0x10f38f;return db['DeskConfiguration'][_0x7f47('0x50')]({'where':{'id':_0x48e2d5[_0x7f47('0x4a')]['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x335b3e,null))['then'](function(_0x3acc44){if(_0x3acc44){_0x478e5e=_0x3acc44;_0x264fda[_0x7f47('0x38')]=_['keys'](db[_0x7f47('0x55')]['rawAttributes']);_0x264fda[_0x7f47('0x34')]=_[_0x7f47('0x35')](_0x48e2d5['query']);_0x264fda[_0x7f47('0x36')]=_['intersection'](_0x264fda[_0x7f47('0x38')],_0x264fda[_0x7f47('0x34')]);_0x483de7[_0x7f47('0x39')]=_['intersection'](_0x264fda[_0x7f47('0x38')],qs[_0x7f47('0x3a')](_0x48e2d5[_0x7f47('0x34')][_0x7f47('0x3a')]));_0x483de7[_0x7f47('0x39')]=_0x483de7[_0x7f47('0x39')][_0x7f47('0x3b')]?_0x483de7[_0x7f47('0x39')]:_0x264fda['model'];_0x483de7[_0x7f47('0x3e')]=qs[_0x7f47('0x3f')](_0x48e2d5['query']['sort']);_0x483de7['where']=qs[_0x7f47('0x36')](_[_0x7f47('0x40')](_0x48e2d5[_0x7f47('0x34')],_0x264fda[_0x7f47('0x36')]));if(_0x48e2d5[_0x7f47('0x34')][_0x7f47('0x41')]){_0x483de7['where']=_['merge'](_0x483de7[_0x7f47('0x43')],{'$or':_[_0x7f47('0x2f')](_0x483de7[_0x7f47('0x39')],function(_0x1b7c1f){var _0x2d6c3a={};_0x2d6c3a[_0x1b7c1f]={'$like':'%'+_0x48e2d5[_0x7f47('0x34')][_0x7f47('0x41')]+'%'};return _0x2d6c3a;})});}_0x483de7=_[_0x7f47('0x42')]({},_0x483de7,_0x48e2d5[_0x7f47('0x4b')]);return _0x478e5e[_0x7f47('0x56')](_0x483de7);}})[_0x7f47('0x28')](function(_0x292510){if(_0x292510){_0x10f38f=_0x292510[_0x7f47('0x3b')];if(!_0x48e2d5[_0x7f47('0x34')]['hasOwnProperty'](_0x7f47('0x3d'))){_0x483de7[_0x7f47('0x1f')]=qs[_0x7f47('0x1f')](_0x48e2d5[_0x7f47('0x34')][_0x7f47('0x1f')]);_0x483de7['offset']=qs[_0x7f47('0x21')](_0x48e2d5[_0x7f47('0x34')][_0x7f47('0x21')]);}return _0x478e5e[_0x7f47('0x56')](_0x483de7);}})['then'](function(_0x5b1f68){if(_0x5b1f68){return _0x5b1f68?{'count':_0x10f38f,'rows':_0x5b1f68}:null;}})[_0x7f47('0x28')](respondWithResult(_0x335b3e,null))['catch'](handleError(_0x335b3e,null));};exports[_0x7f47('0x57')]=function(_0x4716c9,_0x218caf,_0xfc7113){if(_0x4716c9['body']['id']){delete _0x4716c9[_0x7f47('0x4e')]['id'];}return db['DeskConfiguration'][_0x7f47('0x50')]({'where':{'id':_0x4716c9[_0x7f47('0x4a')]['id']}})[_0x7f47('0x28')](handleEntityNotFound(_0x218caf,null))[_0x7f47('0x28')](function(_0x130445){if(_0x130445){return _0x130445[_0x7f47('0x57')](_0x4716c9[_0x7f47('0x4e')][_0x7f47('0x58')]||[]);}return null;})['then'](respondWithResult(_0x218caf,null))['catch'](handleError(_0x218caf,null));}; \ No newline at end of file +var _0x1fa3=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','fields','length','attributes','nolimit','sort','where','filters','pick','filter','VIRTUAL','DeskConfiguration','count','includeAll','include','findAll','rows','show','params','keys','merge','options','find','create','body','catch','getFields','findOne','order','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x5069ed,_0x383431){var _0x2924ec=function(_0x5b16d8){while(--_0x5b16d8){_0x5069ed['push'](_0x5069ed['shift']());}};_0x2924ec(++_0x383431);}(_0x1fa3,0x193));var _0x31fa=function(_0x552c6b,_0x164fc7){_0x552c6b=_0x552c6b-0x0;var _0x350033=_0x1fa3[_0x552c6b];return _0x350033;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x31fa('0x0'));var jsonpatch=require(_0x31fa('0x1'));var rp=require(_0x31fa('0x2'));var moment=require(_0x31fa('0x3'));var BPromise=require(_0x31fa('0x4'));var Mustache=require(_0x31fa('0x5'));var util=require(_0x31fa('0x6'));var path=require(_0x31fa('0x7'));var sox=require(_0x31fa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31fa('0x9'));var _=require(_0x31fa('0xa'));var squel=require(_0x31fa('0xb'));var crypto=require(_0x31fa('0xc'));var jsforce=require(_0x31fa('0xd'));var deskjs=require(_0x31fa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x31fa('0xf'));var Papa=require('papaparse');var Redis=require(_0x31fa('0x10'));var authService=require(_0x31fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x31fa('0x12'));var hardwareService=require(_0x31fa('0x13'));var logger=require('../../config/logger')(_0x31fa('0x14'));var utils=require(_0x31fa('0x15'));var config=require(_0x31fa('0x16'));var licenseUtil=require(_0x31fa('0x17'));var db=require(_0x31fa('0x18'))['db'];function respondWithStatusCode(_0x50e6a2,_0x405bf8){_0x405bf8=_0x405bf8||0xcc;return function(_0x1919a6){if(_0x1919a6){return _0x50e6a2[_0x31fa('0x19')](_0x405bf8);}return _0x50e6a2[_0x31fa('0x1a')](_0x405bf8)['end']();};}function respondWithResult(_0x483c7c,_0x302a7c){_0x302a7c=_0x302a7c||0xc8;return function(_0x17666f){if(_0x17666f){return _0x483c7c['status'](_0x302a7c)[_0x31fa('0x1b')](_0x17666f);}};}function respondWithFilteredResult(_0x3f63bc,_0xe4ea45){return function(_0x24f874){if(_0x24f874){var _0x587b35=typeof _0xe4ea45[_0x31fa('0x1c')]===_0x31fa('0x1d')&&typeof _0xe4ea45[_0x31fa('0x1e')]==='undefined';var _0x115fed=_0x24f874['count'];var _0x45ebfc=_0x587b35?0x0:_0xe4ea45[_0x31fa('0x1c')];var _0x93d99c=_0x587b35?_0x24f874['count']:_0xe4ea45[_0x31fa('0x1c')]+_0xe4ea45[_0x31fa('0x1e')];var _0x5f0549;if(_0x93d99c>=_0x115fed){_0x93d99c=_0x115fed;_0x5f0549=0xc8;}else{_0x5f0549=0xce;}_0x3f63bc['status'](_0x5f0549);return _0x3f63bc[_0x31fa('0x1f')](_0x31fa('0x20'),_0x45ebfc+'-'+_0x93d99c+'/'+_0x115fed)[_0x31fa('0x1b')](_0x24f874);}return null;};}function patchUpdates(_0x1cb9d5){return function(_0xd5c73b){try{jsonpatch[_0x31fa('0x21')](_0xd5c73b,_0x1cb9d5,!![]);}catch(_0x426b9d){return BPromise['reject'](_0x426b9d);}return _0xd5c73b[_0x31fa('0x22')]();};}function saveUpdates(_0xaeca38,_0x59ea4d){return function(_0x157aba){if(_0x157aba){return _0x157aba[_0x31fa('0x23')](_0xaeca38)[_0x31fa('0x24')](function(_0x347d84){return _0x347d84;});}return null;};}function removeEntity(_0x5782b4,_0x455d33){return function(_0x5517df){if(_0x5517df){return _0x5517df[_0x31fa('0x25')]()[_0x31fa('0x24')](function(){_0x5782b4[_0x31fa('0x1a')](0xcc)[_0x31fa('0x26')]();});}};}function handleEntityNotFound(_0x2f09ce,_0x2aca56){return function(_0x1b159c){if(!_0x1b159c){_0x2f09ce[_0x31fa('0x19')](0x194);}return _0x1b159c;};}function handleError(_0x8eb2ad,_0x5d4d90){_0x5d4d90=_0x5d4d90||0x1f4;return function(_0x266161){logger[_0x31fa('0x27')](_0x266161['stack']);if(_0x266161[_0x31fa('0x28')]){delete _0x266161[_0x31fa('0x28')];}_0x8eb2ad[_0x31fa('0x1a')](_0x5d4d90)[_0x31fa('0x29')](_0x266161);};}exports[_0x31fa('0x2a')]=function(_0x2a60e3,_0x179828){var _0x3953ea={},_0x11bd8d={},_0x2467bf={'count':0x0,'rows':[]};var _0x565931=_[_0x31fa('0x2b')](db['DeskConfiguration'][_0x31fa('0x2c')],function(_0x38e757){return{'name':_0x38e757[_0x31fa('0x2d')],'type':_0x38e757[_0x31fa('0x2e')]['key']};});_0x11bd8d['model']=_[_0x31fa('0x2b')](_0x565931,_0x31fa('0x28'));_0x11bd8d['query']=_['keys'](_0x2a60e3[_0x31fa('0x2f')]);_0x11bd8d['filters']=_[_0x31fa('0x30')](_0x11bd8d[_0x31fa('0x31')],_0x11bd8d[_0x31fa('0x2f')]);_0x3953ea['attributes']=_['intersection'](_0x11bd8d['model'],qs['fields'](_0x2a60e3[_0x31fa('0x2f')][_0x31fa('0x32')]));_0x3953ea['attributes']=_0x3953ea['attributes'][_0x31fa('0x33')]?_0x3953ea[_0x31fa('0x34')]:_0x11bd8d[_0x31fa('0x31')];if(!_0x2a60e3[_0x31fa('0x2f')]['hasOwnProperty'](_0x31fa('0x35'))){_0x3953ea[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x2a60e3[_0x31fa('0x2f')][_0x31fa('0x1e')]);_0x3953ea[_0x31fa('0x1c')]=qs[_0x31fa('0x1c')](_0x2a60e3[_0x31fa('0x2f')][_0x31fa('0x1c')]);}_0x3953ea['order']=qs[_0x31fa('0x36')](_0x2a60e3[_0x31fa('0x2f')]['sort']);_0x3953ea[_0x31fa('0x37')]=qs[_0x31fa('0x38')](_[_0x31fa('0x39')](_0x2a60e3[_0x31fa('0x2f')],_0x11bd8d['filters']),_0x565931);if(_0x2a60e3[_0x31fa('0x2f')][_0x31fa('0x3a')]){_0x3953ea['where']=_['merge'](_0x3953ea[_0x31fa('0x37')],{'$or':_[_0x31fa('0x2b')](_0x565931,function(_0x5ee22d){if(_0x5ee22d[_0x31fa('0x2e')]!==_0x31fa('0x3b')){var _0x2c1688={};_0x2c1688[_0x5ee22d[_0x31fa('0x28')]]={'$like':'%'+_0x2a60e3[_0x31fa('0x2f')]['filter']+'%'};return _0x2c1688;}})});}_0x3953ea=_['merge']({},_0x3953ea,_0x2a60e3['options']);var _0x5e2a45={'where':_0x3953ea[_0x31fa('0x37')]};return db[_0x31fa('0x3c')]['count'](_0x5e2a45)[_0x31fa('0x24')](function(_0x1c6c3a){_0x2467bf[_0x31fa('0x3d')]=_0x1c6c3a;if(_0x2a60e3['query'][_0x31fa('0x3e')]){_0x3953ea[_0x31fa('0x3f')]=[{'all':!![]}];}return db[_0x31fa('0x3c')][_0x31fa('0x40')](_0x3953ea);})[_0x31fa('0x24')](function(_0x111c89){_0x2467bf[_0x31fa('0x41')]=_0x111c89;return _0x2467bf;})['then'](respondWithFilteredResult(_0x179828,_0x3953ea))['catch'](handleError(_0x179828,null));};exports[_0x31fa('0x42')]=function(_0x288aa8,_0x90d427){var _0x24478d={'raw':![],'where':{'id':_0x288aa8[_0x31fa('0x43')]['id']}},_0x404e17={};_0x404e17[_0x31fa('0x31')]=_[_0x31fa('0x44')](db[_0x31fa('0x3c')][_0x31fa('0x2c')]);_0x404e17[_0x31fa('0x2f')]=_[_0x31fa('0x44')](_0x288aa8['query']);_0x404e17['filters']=_[_0x31fa('0x30')](_0x404e17[_0x31fa('0x31')],_0x404e17['query']);_0x24478d[_0x31fa('0x34')]=_[_0x31fa('0x30')](_0x404e17[_0x31fa('0x31')],qs['fields'](_0x288aa8['query'][_0x31fa('0x32')]));_0x24478d[_0x31fa('0x34')]=_0x24478d[_0x31fa('0x34')][_0x31fa('0x33')]?_0x24478d[_0x31fa('0x34')]:_0x404e17[_0x31fa('0x31')];if(_0x288aa8['query'][_0x31fa('0x3e')]){_0x24478d[_0x31fa('0x3f')]=[{'all':!![]}];}_0x24478d=_[_0x31fa('0x45')]({},_0x24478d,_0x288aa8[_0x31fa('0x46')]);return db['DeskConfiguration'][_0x31fa('0x47')](_0x24478d)[_0x31fa('0x24')](handleEntityNotFound(_0x90d427,null))[_0x31fa('0x24')](respondWithResult(_0x90d427,null))['catch'](handleError(_0x90d427,null));};exports['create']=function(_0x731af7,_0x3ada79){return db[_0x31fa('0x3c')][_0x31fa('0x48')](_0x731af7[_0x31fa('0x49')],{})[_0x31fa('0x24')](respondWithResult(_0x3ada79,0xc9))['catch'](handleError(_0x3ada79,null));};exports['update']=function(_0x2c1578,_0x3d106e){if(_0x2c1578[_0x31fa('0x49')]['id']){delete _0x2c1578[_0x31fa('0x49')]['id'];}return db[_0x31fa('0x3c')]['find']({'where':{'id':_0x2c1578[_0x31fa('0x43')]['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x3d106e,null))[_0x31fa('0x24')](saveUpdates(_0x2c1578['body'],null))[_0x31fa('0x24')](respondWithResult(_0x3d106e,null))[_0x31fa('0x4a')](handleError(_0x3d106e,null));};exports[_0x31fa('0x25')]=function(_0x255817,_0x382ac7){return db[_0x31fa('0x3c')][_0x31fa('0x47')]({'where':{'id':_0x255817['params']['id']}})['then'](handleEntityNotFound(_0x382ac7,null))[_0x31fa('0x24')](removeEntity(_0x382ac7,null))[_0x31fa('0x4a')](handleError(_0x382ac7,null));};exports[_0x31fa('0x4b')]=function(_0x58bcc8,_0x21ae7c,_0x55f257){var _0x580d7e={};var _0x2cc6f1={};var _0x57fac1;var _0x33837f;return db[_0x31fa('0x3c')][_0x31fa('0x4c')]({'where':{'id':_0x58bcc8[_0x31fa('0x43')]['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x21ae7c,null))[_0x31fa('0x24')](function(_0x165f53){if(_0x165f53){_0x57fac1=_0x165f53;_0x2cc6f1[_0x31fa('0x31')]=_[_0x31fa('0x44')](db['DeskField'][_0x31fa('0x2c')]);_0x2cc6f1[_0x31fa('0x2f')]=_[_0x31fa('0x44')](_0x58bcc8[_0x31fa('0x2f')]);_0x2cc6f1[_0x31fa('0x38')]=_['intersection'](_0x2cc6f1[_0x31fa('0x31')],_0x2cc6f1[_0x31fa('0x2f')]);_0x580d7e['attributes']=_[_0x31fa('0x30')](_0x2cc6f1['model'],qs['fields'](_0x58bcc8[_0x31fa('0x2f')]['fields']));_0x580d7e['attributes']=_0x580d7e[_0x31fa('0x34')][_0x31fa('0x33')]?_0x580d7e[_0x31fa('0x34')]:_0x2cc6f1[_0x31fa('0x31')];_0x580d7e[_0x31fa('0x4d')]=qs[_0x31fa('0x36')](_0x58bcc8[_0x31fa('0x2f')][_0x31fa('0x36')]);_0x580d7e[_0x31fa('0x37')]=qs['filters'](_[_0x31fa('0x39')](_0x58bcc8[_0x31fa('0x2f')],_0x2cc6f1[_0x31fa('0x38')]));if(_0x58bcc8[_0x31fa('0x2f')][_0x31fa('0x3a')]){_0x580d7e[_0x31fa('0x37')]=_[_0x31fa('0x45')](_0x580d7e[_0x31fa('0x37')],{'$or':_[_0x31fa('0x2b')](_0x580d7e[_0x31fa('0x34')],function(_0xda5c20){var _0x32c6df={};_0x32c6df[_0xda5c20]={'$like':'%'+_0x58bcc8['query']['filter']+'%'};return _0x32c6df;})});}_0x580d7e=_[_0x31fa('0x45')]({},_0x580d7e,_0x58bcc8['options']);return _0x57fac1[_0x31fa('0x4b')](_0x580d7e);}})[_0x31fa('0x24')](function(_0x396b65){if(_0x396b65){_0x33837f=_0x396b65[_0x31fa('0x33')];if(!_0x58bcc8['query'][_0x31fa('0x4e')](_0x31fa('0x35'))){_0x580d7e[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x58bcc8['query'][_0x31fa('0x1e')]);_0x580d7e[_0x31fa('0x1c')]=qs[_0x31fa('0x1c')](_0x58bcc8[_0x31fa('0x2f')][_0x31fa('0x1c')]);}return _0x57fac1[_0x31fa('0x4b')](_0x580d7e);}})['then'](function(_0x293be4){if(_0x293be4){return _0x293be4?{'count':_0x33837f,'rows':_0x293be4}:null;}})['then'](respondWithResult(_0x21ae7c,null))[_0x31fa('0x4a')](handleError(_0x21ae7c,null));};exports[_0x31fa('0x4f')]=function(_0x527cbd,_0x11d65e,_0x37f36a){var _0x14654e={};var _0x4b64a3={};var _0x550971;var _0x3608e0;return db['DeskConfiguration'][_0x31fa('0x4c')]({'where':{'id':_0x527cbd['params']['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x11d65e,null))[_0x31fa('0x24')](function(_0x2f58dc){if(_0x2f58dc){_0x550971=_0x2f58dc;_0x4b64a3[_0x31fa('0x31')]=_[_0x31fa('0x44')](db['DeskField'][_0x31fa('0x2c')]);_0x4b64a3[_0x31fa('0x2f')]=_[_0x31fa('0x44')](_0x527cbd[_0x31fa('0x2f')]);_0x4b64a3['filters']=_['intersection'](_0x4b64a3['model'],_0x4b64a3['query']);_0x14654e[_0x31fa('0x34')]=_[_0x31fa('0x30')](_0x4b64a3['model'],qs['fields'](_0x527cbd[_0x31fa('0x2f')][_0x31fa('0x32')]));_0x14654e[_0x31fa('0x34')]=_0x14654e[_0x31fa('0x34')][_0x31fa('0x33')]?_0x14654e[_0x31fa('0x34')]:_0x4b64a3[_0x31fa('0x31')];_0x14654e[_0x31fa('0x4d')]=qs[_0x31fa('0x36')](_0x527cbd[_0x31fa('0x2f')][_0x31fa('0x36')]);_0x14654e[_0x31fa('0x37')]=qs[_0x31fa('0x38')](_['pick'](_0x527cbd[_0x31fa('0x2f')],_0x4b64a3[_0x31fa('0x38')]));if(_0x527cbd[_0x31fa('0x2f')][_0x31fa('0x3a')]){_0x14654e[_0x31fa('0x37')]=_[_0x31fa('0x45')](_0x14654e['where'],{'$or':_['map'](_0x14654e[_0x31fa('0x34')],function(_0x4a13a2){var _0xf22332={};_0xf22332[_0x4a13a2]={'$like':'%'+_0x527cbd['query'][_0x31fa('0x3a')]+'%'};return _0xf22332;})});}_0x14654e=_[_0x31fa('0x45')]({},_0x14654e,_0x527cbd['options']);return _0x550971[_0x31fa('0x4f')](_0x14654e);}})[_0x31fa('0x24')](function(_0x2b9112){if(_0x2b9112){_0x3608e0=_0x2b9112['length'];if(!_0x527cbd[_0x31fa('0x2f')][_0x31fa('0x4e')](_0x31fa('0x35'))){_0x14654e[_0x31fa('0x1e')]=qs['limit'](_0x527cbd['query'][_0x31fa('0x1e')]);_0x14654e['offset']=qs[_0x31fa('0x1c')](_0x527cbd[_0x31fa('0x2f')]['offset']);}return _0x550971[_0x31fa('0x4f')](_0x14654e);}})['then'](function(_0xcef3b9){if(_0xcef3b9){return _0xcef3b9?{'count':_0x3608e0,'rows':_0xcef3b9}:null;}})[_0x31fa('0x24')](respondWithResult(_0x11d65e,null))[_0x31fa('0x4a')](handleError(_0x11d65e,null));};exports['getDescriptions']=function(_0x5a6bdb,_0x3ebac6,_0x2561cb){var _0x239738={};var _0x4044b5={};var _0x45ad95;var _0x22fd8a;return db[_0x31fa('0x3c')][_0x31fa('0x4c')]({'where':{'id':_0x5a6bdb[_0x31fa('0x43')]['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x3ebac6,null))[_0x31fa('0x24')](function(_0x3f0439){if(_0x3f0439){_0x45ad95=_0x3f0439;_0x4044b5[_0x31fa('0x31')]=_['keys'](db[_0x31fa('0x50')][_0x31fa('0x2c')]);_0x4044b5[_0x31fa('0x2f')]=_[_0x31fa('0x44')](_0x5a6bdb[_0x31fa('0x2f')]);_0x4044b5[_0x31fa('0x38')]=_['intersection'](_0x4044b5[_0x31fa('0x31')],_0x4044b5[_0x31fa('0x2f')]);_0x239738[_0x31fa('0x34')]=_[_0x31fa('0x30')](_0x4044b5['model'],qs[_0x31fa('0x32')](_0x5a6bdb[_0x31fa('0x2f')][_0x31fa('0x32')]));_0x239738[_0x31fa('0x34')]=_0x239738[_0x31fa('0x34')]['length']?_0x239738[_0x31fa('0x34')]:_0x4044b5['model'];_0x239738[_0x31fa('0x4d')]=qs[_0x31fa('0x36')](_0x5a6bdb[_0x31fa('0x2f')]['sort']);_0x239738[_0x31fa('0x37')]=qs[_0x31fa('0x38')](_['pick'](_0x5a6bdb[_0x31fa('0x2f')],_0x4044b5[_0x31fa('0x38')]));if(_0x5a6bdb[_0x31fa('0x2f')][_0x31fa('0x3a')]){_0x239738[_0x31fa('0x37')]=_[_0x31fa('0x45')](_0x239738[_0x31fa('0x37')],{'$or':_[_0x31fa('0x2b')](_0x239738[_0x31fa('0x34')],function(_0x45a5a9){var _0x5b6ebb={};_0x5b6ebb[_0x45a5a9]={'$like':'%'+_0x5a6bdb[_0x31fa('0x2f')][_0x31fa('0x3a')]+'%'};return _0x5b6ebb;})});}_0x239738=_[_0x31fa('0x45')]({},_0x239738,_0x5a6bdb[_0x31fa('0x46')]);return _0x45ad95[_0x31fa('0x51')](_0x239738);}})[_0x31fa('0x24')](function(_0x4a7d94){if(_0x4a7d94){_0x22fd8a=_0x4a7d94[_0x31fa('0x33')];if(!_0x5a6bdb[_0x31fa('0x2f')][_0x31fa('0x4e')](_0x31fa('0x35'))){_0x239738[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x5a6bdb[_0x31fa('0x2f')][_0x31fa('0x1e')]);_0x239738[_0x31fa('0x1c')]=qs['offset'](_0x5a6bdb['query']['offset']);}return _0x45ad95[_0x31fa('0x51')](_0x239738);}})[_0x31fa('0x24')](function(_0x5dee3d){if(_0x5dee3d){return _0x5dee3d?{'count':_0x22fd8a,'rows':_0x5dee3d}:null;}})[_0x31fa('0x24')](respondWithResult(_0x3ebac6,null))['catch'](handleError(_0x3ebac6,null));};exports[_0x31fa('0x52')]=function(_0x9dc988,_0x370a88,_0x44d86a){var _0x3c92a8={};var _0x15fc90={};var _0x270f0d;var _0x29ee8f;return db[_0x31fa('0x3c')][_0x31fa('0x4c')]({'where':{'id':_0x9dc988[_0x31fa('0x43')]['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x370a88,null))[_0x31fa('0x24')](function(_0x4f8dba){if(_0x4f8dba){_0x270f0d=_0x4f8dba;_0x15fc90['model']=_[_0x31fa('0x44')](db['Tag'][_0x31fa('0x2c')]);_0x15fc90['query']=_['keys'](_0x9dc988[_0x31fa('0x2f')]);_0x15fc90['filters']=_[_0x31fa('0x30')](_0x15fc90[_0x31fa('0x31')],_0x15fc90[_0x31fa('0x2f')]);_0x3c92a8[_0x31fa('0x34')]=_['intersection'](_0x15fc90[_0x31fa('0x31')],qs[_0x31fa('0x32')](_0x9dc988[_0x31fa('0x2f')]['fields']));_0x3c92a8['attributes']=_0x3c92a8[_0x31fa('0x34')][_0x31fa('0x33')]?_0x3c92a8[_0x31fa('0x34')]:_0x15fc90[_0x31fa('0x31')];_0x3c92a8['order']=qs['sort'](_0x9dc988[_0x31fa('0x2f')][_0x31fa('0x36')]);_0x3c92a8[_0x31fa('0x37')]=qs[_0x31fa('0x38')](_[_0x31fa('0x39')](_0x9dc988[_0x31fa('0x2f')],_0x15fc90[_0x31fa('0x38')]));if(_0x9dc988[_0x31fa('0x2f')]['filter']){_0x3c92a8[_0x31fa('0x37')]=_[_0x31fa('0x45')](_0x3c92a8['where'],{'$or':_[_0x31fa('0x2b')](_0x3c92a8['attributes'],function(_0x31b8b5){var _0x40df55={};_0x40df55[_0x31b8b5]={'$like':'%'+_0x9dc988['query'][_0x31fa('0x3a')]+'%'};return _0x40df55;})});}_0x3c92a8=_['merge']({},_0x3c92a8,_0x9dc988['options']);return _0x270f0d['getTags'](_0x3c92a8);}})[_0x31fa('0x24')](function(_0xba85){if(_0xba85){_0x29ee8f=_0xba85['length'];if(!_0x9dc988[_0x31fa('0x2f')][_0x31fa('0x4e')](_0x31fa('0x35'))){_0x3c92a8[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x9dc988['query']['limit']);_0x3c92a8[_0x31fa('0x1c')]=qs['offset'](_0x9dc988[_0x31fa('0x2f')][_0x31fa('0x1c')]);}return _0x270f0d[_0x31fa('0x52')](_0x3c92a8);}})[_0x31fa('0x24')](function(_0x31ab96){if(_0x31ab96){return _0x31ab96?{'count':_0x29ee8f,'rows':_0x31ab96}:null;}})[_0x31fa('0x24')](respondWithResult(_0x370a88,null))[_0x31fa('0x4a')](handleError(_0x370a88,null));};exports[_0x31fa('0x53')]=function(_0x3d1717,_0x43c68d,_0x5a215f){if(_0x3d1717['body']['id']){delete _0x3d1717[_0x31fa('0x49')]['id'];}return db[_0x31fa('0x3c')][_0x31fa('0x4c')]({'where':{'id':_0x3d1717[_0x31fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x43c68d,null))[_0x31fa('0x24')](function(_0xdd4ea8){if(_0xdd4ea8){return _0xdd4ea8['setTags'](_0x3d1717[_0x31fa('0x49')][_0x31fa('0x54')]||[]);}return null;})[_0x31fa('0x24')](respondWithResult(_0x43c68d,null))[_0x31fa('0x4a')](handleError(_0x43c68d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 966f7e0..ae0a978 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 _0x91dd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','lodash','util'];(function(_0x132659,_0x486e0c){var _0x215fc3=function(_0x3a14e8){while(--_0x3a14e8){_0x132659['push'](_0x132659['shift']());}};_0x215fc3(++_0x486e0c);}(_0x91dd,0x136));var _0xd91d=function(_0x26bf6f,_0x425507){_0x26bf6f=_0x26bf6f-0x0;var _0x5abc38=_0x91dd[_0x26bf6f];return _0x5abc38;};'use strict';var _=require(_0xd91d('0x0'));var util=require(_0xd91d('0x1'));var logger=require(_0xd91d('0x2'))(_0xd91d('0x3'));var moment=require(_0xd91d('0x4'));var BPromise=require(_0xd91d('0x5'));var rp=require(_0xd91d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd91d('0x7'));var config=require(_0xd91d('0x8'));var attributes=require(_0xd91d('0x9'));module['exports']=function(_0x3a03b9,_0xc3b7cc){return _0x3a03b9[_0xd91d('0xa')](_0xd91d('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fd9=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x147090,_0x3669ef){var _0x2635d2=function(_0x733f38){while(--_0x733f38){_0x147090['push'](_0x147090['shift']());}};_0x2635d2(++_0x3669ef);}(_0x1fd9,0xcb));var _0x91fd=function(_0x3630b8,_0x5a47ec){_0x3630b8=_0x3630b8-0x0;var _0x37496b=_0x1fd9[_0x3630b8];return _0x37496b;};'use strict';var _=require(_0x91fd('0x0'));var util=require(_0x91fd('0x1'));var logger=require(_0x91fd('0x2'))(_0x91fd('0x3'));var moment=require(_0x91fd('0x4'));var BPromise=require(_0x91fd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91fd('0x6'));var rimraf=require(_0x91fd('0x7'));var config=require(_0x91fd('0x8'));var attributes=require(_0x91fd('0x9'));module[_0x91fd('0xa')]=function(_0x209315,_0x35dc6c){return _0x209315[_0x91fd('0xb')](_0x91fd('0xc'),attributes,{'tableName':_0x91fd('0xd'),'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 82f6685..ec7037a 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 _0x9a2a=['request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b68ab,_0x1c5b85){var _0x584005=function(_0x398f9f){while(--_0x398f9f){_0x1b68ab['push'](_0x1b68ab['shift']());}};_0x584005(++_0x1c5b85);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x283952,_0x442596){_0x283952=_0x283952-0x0;var _0x57bb99=_0x9a2a[_0x283952];return _0x57bb99;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var moment=require(_0xa9a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a2('0x3'))['db'];var utils=require(_0xa9a2('0x4'));var logger=require(_0xa9a2('0x5'))(_0xa9a2('0x6'));var config=require(_0xa9a2('0x7'));var jayson=require(_0xa9a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x388689,_0xb51739,_0xedae90){return new BPromise(function(_0x287343,_0xcd2750){return client[_0xa9a2('0x9')](_0x388689,_0xedae90)[_0xa9a2('0xa')](function(_0x26f1ce){logger[_0xa9a2('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0xb51739,_0xa9a2('0xc'));logger[_0xa9a2('0xd')](_0xa9a2('0xe'),_0xb51739,_0xa9a2('0xc'),JSON[_0xa9a2('0xf')](_0x26f1ce));if(_0x26f1ce[_0xa9a2('0x10')]){if(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x11')]===0x1f4){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce['error'][_0xa9a2('0x13')]);return _0xcd2750(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);return _0x287343(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}else{logger[_0xa9a2('0xb')](_0xa9a2('0x12'),_0xb51739,_0xa9a2('0xc'));_0x287343(_0x26f1ce[_0xa9a2('0x14')]['message']);}})[_0xa9a2('0x15')](function(_0xbb6546){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0xbb6546);_0xcd2750(_0xbb6546);});});} \ No newline at end of file +var _0x3070=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x33a0a7,_0xab4c3e){var _0x2fd532=function(_0x5ef1e2){while(--_0x5ef1e2){_0x33a0a7['push'](_0x33a0a7['shift']());}};_0x2fd532(++_0xab4c3e);}(_0x3070,0x75));var _0x0307=function(_0x968c4c,_0x2f359d){_0x968c4c=_0x968c4c-0x0;var _0xb50052=_0x3070[_0x968c4c];return _0xb50052;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dc51,_0x4fbe3e,_0x3ecfb6){return new BPromise(function(_0x41e638,_0x53e6b7){return client[_0x0307('0xa')](_0xc1dc51,_0x3ecfb6)[_0x0307('0xb')](function(_0x187fb3){logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,_0x0307('0xe'));logger[_0x0307('0xf')](_0x0307('0x10'),_0x4fbe3e,_0x0307('0xe'),JSON['stringify'](_0x187fb3));if(_0x187fb3[_0x0307('0x11')]){if(_0x187fb3['error'][_0x0307('0x12')]===0x1f4){logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x53e6b7(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x41e638(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}else{logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,'request\x20sent');_0x41e638(_0x187fb3[_0x0307('0x14')][_0x0307('0x13')]);}})[_0x0307('0x15')](function(_0x5f11a5){logger['error'](_0x0307('0xd'),_0x4fbe3e,_0x5f11a5);_0x53e6b7(_0x5f11a5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 88b928d..8faa4d0 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 _0x819d=['exports','util','path','express','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x599cb5,_0x15b171){var _0x468de1=function(_0x4cebc3){while(--_0x4cebc3){_0x599cb5['push'](_0x599cb5['shift']());}};_0x468de1(++_0x15b171);}(_0x819d,0x10f));var _0xd819=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x819d[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require(_0xd819('0x0'));var path=require(_0xd819('0x1'));var timeout=require('connect-timeout');var express=require(_0xd819('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd819('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd819('0x4'));var controller=require('./intDeskField.controller');router[_0xd819('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd819('0x5')](_0xd819('0x6'),auth[_0xd819('0x7')](),controller[_0xd819('0x8')]);router[_0xd819('0x9')]('/',auth['isAuthenticated'](),controller[_0xd819('0xa')]);router[_0xd819('0xb')](_0xd819('0x6'),auth[_0xd819('0x7')](),controller[_0xd819('0xc')]);router['delete']('/:id',auth[_0xd819('0x7')](),controller[_0xd819('0xd')]);module[_0xd819('0xe')]=router; \ No newline at end of file +var _0xfa7e=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports'];(function(_0x265408,_0x515faa){var _0x396121=function(_0x12ca46){while(--_0x12ca46){_0x265408['push'](_0x265408['shift']());}};_0x396121(++_0x515faa);}(_0xfa7e,0xfc));var _0xefa7=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xfa7e[_0xb833b1];return _0x1ab87a;};'use strict';var multer=require('multer');var util=require(_0xefa7('0x0'));var path=require('path');var timeout=require(_0xefa7('0x1'));var express=require(_0xefa7('0x2'));var router=express[_0xefa7('0x3')]();var fs_extra=require(_0xefa7('0x4'));var auth=require(_0xefa7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefa7('0x6'));var controller=require(_0xefa7('0x7'));router[_0xefa7('0x8')]('/',auth[_0xefa7('0x9')](),controller[_0xefa7('0xa')]);router[_0xefa7('0x8')](_0xefa7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xefa7('0xc')]('/',auth[_0xefa7('0x9')](),controller[_0xefa7('0xd')]);router['put'](_0xefa7('0xb'),auth[_0xefa7('0x9')](),controller[_0xefa7('0xe')]);router[_0xefa7('0xf')](_0xefa7('0xb'),auth['isAuthenticated'](),controller[_0xefa7('0x10')]);module[_0xefa7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 50d7675..c83ab41 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 _0xb09f=['keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xb09f,0x1bd));var _0xfb09=function(_0x22438c,_0x283866){_0x22438c=_0x22438c-0x0;var _0x5b058d=_0xb09f[_0x22438c];return _0x5b058d;};'use strict';var Sequelize=require(_0xfb09('0x0'));module[_0xfb09('0x1')]={'type':{'type':Sequelize[_0xfb09('0x2')](_0xfb09('0x3'),'variable',_0xfb09('0x4'),_0xfb09('0x5'),_0xfb09('0x6')),'defaultValue':_0xfb09('0x3')},'content':{'type':Sequelize[_0xfb09('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xfb09('0x3'),_0xfb09('0x8'),_0xfb09('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfb09('0x7')]},'nameField':{'type':Sequelize[_0xfb09('0x7')]},'customField':{'type':Sequelize[_0xfb09('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb09('0x7')]}}; \ No newline at end of file +var _0x3f11=['string','STRING','ENUM','variable','customVariable','sequelize','keyValue','picklist'];(function(_0x26c0ca,_0x507f64){var _0x4de255=function(_0x21ed31){while(--_0x21ed31){_0x26c0ca['push'](_0x26c0ca['shift']());}};_0x4de255(++_0x507f64);}(_0x3f11,0x105));var _0x13f1=function(_0x109dbd,_0x290d2b){_0x109dbd=_0x109dbd-0x0;var _0x395644=_0x3f11[_0x109dbd];return _0x395644;};'use strict';var Sequelize=require(_0x13f1('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x13f1('0x1'),_0x13f1('0x2')),'defaultValue':_0x13f1('0x3')},'content':{'type':Sequelize[_0x13f1('0x4')]},'key':{'type':Sequelize[_0x13f1('0x4')]},'keyType':{'type':Sequelize[_0x13f1('0x5')]('string',_0x13f1('0x6'),_0x13f1('0x7'))},'keyContent':{'type':Sequelize[_0x13f1('0x4')]},'idField':{'type':Sequelize[_0x13f1('0x4')]},'nameField':{'type':Sequelize[_0x13f1('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13f1('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 069a726..b04e8c7 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 _0x510e=['model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','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','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x510e,0x1ed));var _0xe510=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x510e[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xe510('0x0'));var rimraf=require(_0xe510('0x1'));var zipdir=require(_0xe510('0x2'));var jsonpatch=require(_0xe510('0x3'));var rp=require(_0xe510('0x4'));var moment=require(_0xe510('0x5'));var BPromise=require(_0xe510('0x6'));var Mustache=require(_0xe510('0x7'));var util=require(_0xe510('0x8'));var path=require('path');var sox=require(_0xe510('0x9'));var csv=require(_0xe510('0xa'));var ejs=require(_0xe510('0xb'));var fs=require('fs');var fs_extra=require(_0xe510('0xc'));var _=require(_0xe510('0xd'));var squel=require(_0xe510('0xe'));var crypto=require(_0xe510('0xf'));var jsforce=require(_0xe510('0x10'));var deskjs=require(_0xe510('0x11'));var toCsv=require(_0xe510('0xa'));var querystring=require(_0xe510('0x12'));var Papa=require(_0xe510('0x13'));var Redis=require(_0xe510('0x14'));var authService=require(_0xe510('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe510('0x16'));var hardwareService=require(_0xe510('0x17'));var logger=require(_0xe510('0x18'))(_0xe510('0x19'));var utils=require(_0xe510('0x1a'));var config=require(_0xe510('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xe510('0x1c'))['db'];function respondWithStatusCode(_0x2168b2,_0x55ee64){_0x55ee64=_0x55ee64||0xcc;return function(_0x261832){if(_0x261832){return _0x2168b2[_0xe510('0x1d')](_0x55ee64);}return _0x2168b2[_0xe510('0x1e')](_0x55ee64)[_0xe510('0x1f')]();};}function respondWithResult(_0x351376,_0x1b399f){_0x1b399f=_0x1b399f||0xc8;return function(_0x3af96e){if(_0x3af96e){return _0x351376[_0xe510('0x1e')](_0x1b399f)[_0xe510('0x20')](_0x3af96e);}};}function respondWithFilteredResult(_0x538d55,_0x8150a7){return function(_0x52feea){if(_0x52feea){var _0x574ce5=typeof _0x8150a7[_0xe510('0x21')]===_0xe510('0x22')&&typeof _0x8150a7[_0xe510('0x23')]===_0xe510('0x22');var _0x9b92b0=_0x52feea[_0xe510('0x24')];var _0x268736=_0x574ce5?0x0:_0x8150a7[_0xe510('0x21')];var _0x48e676=_0x574ce5?_0x52feea[_0xe510('0x24')]:_0x8150a7[_0xe510('0x21')]+_0x8150a7[_0xe510('0x23')];var _0x4dd3d8;if(_0x48e676>=_0x9b92b0){_0x48e676=_0x9b92b0;_0x4dd3d8=0xc8;}else{_0x4dd3d8=0xce;}_0x538d55[_0xe510('0x1e')](_0x4dd3d8);return _0x538d55[_0xe510('0x25')](_0xe510('0x26'),_0x268736+'-'+_0x48e676+'/'+_0x9b92b0)['json'](_0x52feea);}return null;};}function patchUpdates(_0xd3237){return function(_0x212e3e){try{jsonpatch['apply'](_0x212e3e,_0xd3237,!![]);}catch(_0x269596){return BPromise[_0xe510('0x27')](_0x269596);}return _0x212e3e['save']();};}function saveUpdates(_0x25b523,_0x460d28){return function(_0x4a0c3d){if(_0x4a0c3d){return _0x4a0c3d[_0xe510('0x28')](_0x25b523)[_0xe510('0x29')](function(_0x2ba74a){return _0x2ba74a;});}return null;};}function removeEntity(_0x2ea51b,_0xc6ffae){return function(_0x4c034f){if(_0x4c034f){return _0x4c034f[_0xe510('0x2a')]()['then'](function(){_0x2ea51b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4425ee,_0x26988f){return function(_0x5abf44){if(!_0x5abf44){_0x4425ee[_0xe510('0x1d')](0x194);}return _0x5abf44;};}function handleError(_0x59d10b,_0x11ed03){_0x11ed03=_0x11ed03||0x1f4;return function(_0x45ea1e){logger[_0xe510('0x2b')](_0x45ea1e[_0xe510('0x2c')]);if(_0x45ea1e[_0xe510('0x2d')]){delete _0x45ea1e[_0xe510('0x2d')];}_0x59d10b[_0xe510('0x1e')](_0x11ed03)[_0xe510('0x2e')](_0x45ea1e);};}exports[_0xe510('0x2f')]=function(_0x2aff62,_0x92bfa3){var _0x5dcdb3={},_0xf5a2fb={},_0x1ea081={'count':0x0,'rows':[]};var _0x49a33f=_['map'](db[_0xe510('0x30')][_0xe510('0x31')],function(_0x538e31){return{'name':_0x538e31[_0xe510('0x32')],'type':_0x538e31[_0xe510('0x33')][_0xe510('0x34')]};});_0xf5a2fb[_0xe510('0x35')]=_[_0xe510('0x36')](_0x49a33f,'name');_0xf5a2fb[_0xe510('0x37')]=_[_0xe510('0x38')](_0x2aff62[_0xe510('0x37')]);_0xf5a2fb[_0xe510('0x39')]=_[_0xe510('0x3a')](_0xf5a2fb[_0xe510('0x35')],_0xf5a2fb[_0xe510('0x37')]);_0x5dcdb3[_0xe510('0x3b')]=_[_0xe510('0x3a')](_0xf5a2fb[_0xe510('0x35')],qs['fields'](_0x2aff62[_0xe510('0x37')][_0xe510('0x3c')]));_0x5dcdb3[_0xe510('0x3b')]=_0x5dcdb3[_0xe510('0x3b')][_0xe510('0x3d')]?_0x5dcdb3[_0xe510('0x3b')]:_0xf5a2fb[_0xe510('0x35')];if(!_0x2aff62[_0xe510('0x37')][_0xe510('0x3e')](_0xe510('0x3f'))){_0x5dcdb3[_0xe510('0x23')]=qs[_0xe510('0x23')](_0x2aff62[_0xe510('0x37')][_0xe510('0x23')]);_0x5dcdb3[_0xe510('0x21')]=qs[_0xe510('0x21')](_0x2aff62[_0xe510('0x37')]['offset']);}_0x5dcdb3[_0xe510('0x40')]=qs[_0xe510('0x41')](_0x2aff62['query'][_0xe510('0x41')]);_0x5dcdb3[_0xe510('0x42')]=qs['filters'](_['pick'](_0x2aff62[_0xe510('0x37')],_0xf5a2fb[_0xe510('0x39')]),_0x49a33f);if(_0x2aff62[_0xe510('0x37')][_0xe510('0x43')]){_0x5dcdb3['where']=_[_0xe510('0x44')](_0x5dcdb3['where'],{'$or':_[_0xe510('0x36')](_0x49a33f,function(_0x2bec4b){if(_0x2bec4b[_0xe510('0x33')]!=='VIRTUAL'){var _0x31ef35={};_0x31ef35[_0x2bec4b[_0xe510('0x2d')]]={'$like':'%'+_0x2aff62[_0xe510('0x37')][_0xe510('0x43')]+'%'};return _0x31ef35;}})});}_0x5dcdb3=_[_0xe510('0x44')]({},_0x5dcdb3,_0x2aff62[_0xe510('0x45')]);var _0x266f2a={'where':_0x5dcdb3[_0xe510('0x42')]};return db[_0xe510('0x30')][_0xe510('0x24')](_0x266f2a)[_0xe510('0x29')](function(_0x1e3912){_0x1ea081[_0xe510('0x24')]=_0x1e3912;if(_0x2aff62[_0xe510('0x37')][_0xe510('0x46')]){_0x5dcdb3[_0xe510('0x47')]=[{'all':!![]}];}return db[_0xe510('0x30')][_0xe510('0x48')](_0x5dcdb3);})[_0xe510('0x29')](function(_0x5a92f4){_0x1ea081['rows']=_0x5a92f4;return _0x1ea081;})['then'](respondWithFilteredResult(_0x92bfa3,_0x5dcdb3))[_0xe510('0x49')](handleError(_0x92bfa3,null));};exports[_0xe510('0x4a')]=function(_0x198615,_0x251e86){var _0x58f6af={'raw':!![],'where':{'id':_0x198615[_0xe510('0x4b')]['id']}},_0x59a603={};_0x59a603[_0xe510('0x35')]=_['keys'](db[_0xe510('0x30')][_0xe510('0x31')]);_0x59a603['query']=_[_0xe510('0x38')](_0x198615[_0xe510('0x37')]);_0x59a603[_0xe510('0x39')]=_[_0xe510('0x3a')](_0x59a603['model'],_0x59a603[_0xe510('0x37')]);_0x58f6af[_0xe510('0x3b')]=_[_0xe510('0x3a')](_0x59a603['model'],qs[_0xe510('0x3c')](_0x198615[_0xe510('0x37')]['fields']));_0x58f6af[_0xe510('0x3b')]=_0x58f6af[_0xe510('0x3b')][_0xe510('0x3d')]?_0x58f6af['attributes']:_0x59a603[_0xe510('0x35')];if(_0x198615['query'][_0xe510('0x46')]){_0x58f6af[_0xe510('0x47')]=[{'all':!![]}];}_0x58f6af=_[_0xe510('0x44')]({},_0x58f6af,_0x198615[_0xe510('0x45')]);return db['DeskField'][_0xe510('0x4c')](_0x58f6af)['then'](handleEntityNotFound(_0x251e86,null))[_0xe510('0x29')](respondWithResult(_0x251e86,null))['catch'](handleError(_0x251e86,null));};exports['create']=function(_0x5acee9,_0x684d19){return db['DeskField']['create'](_0x5acee9['body'],{})[_0xe510('0x29')](respondWithResult(_0x684d19,0xc9))[_0xe510('0x49')](handleError(_0x684d19,null));};exports[_0xe510('0x28')]=function(_0x38ccc1,_0x4cce42){if(_0x38ccc1[_0xe510('0x4d')]['id']){delete _0x38ccc1[_0xe510('0x4d')]['id'];}return db[_0xe510('0x30')][_0xe510('0x4c')]({'where':{'id':_0x38ccc1['params']['id']}})['then'](handleEntityNotFound(_0x4cce42,null))['then'](saveUpdates(_0x38ccc1[_0xe510('0x4d')],null))[_0xe510('0x29')](respondWithResult(_0x4cce42,null))[_0xe510('0x49')](handleError(_0x4cce42,null));};exports[_0xe510('0x2a')]=function(_0x992fa4,_0x4f1d42){return db[_0xe510('0x30')]['find']({'where':{'id':_0x992fa4[_0xe510('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f1d42,null))['then'](removeEntity(_0x4f1d42,null))[_0xe510('0x49')](handleError(_0x4f1d42,null));}; \ No newline at end of file +var _0x292c=['model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','stack','name','index','DeskField','fieldName','type'];(function(_0x4887a6,_0x17c7db){var _0x3a0838=function(_0x2ecb8e){while(--_0x2ecb8e){_0x4887a6['push'](_0x4887a6['shift']());}};_0x3a0838(++_0x17c7db);}(_0x292c,0x66));var _0xc292=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x292c[_0x51ed62];return _0x34aee3;};'use strict';var emlformat=require(_0xc292('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc292('0x1'));var jsonpatch=require(_0xc292('0x2'));var rp=require(_0xc292('0x3'));var moment=require(_0xc292('0x4'));var BPromise=require(_0xc292('0x5'));var Mustache=require('mustache');var util=require(_0xc292('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc292('0x7'));var ejs=require(_0xc292('0x8'));var fs=require('fs');var fs_extra=require(_0xc292('0x9'));var _=require(_0xc292('0xa'));var squel=require(_0xc292('0xb'));var crypto=require(_0xc292('0xc'));var jsforce=require(_0xc292('0xd'));var deskjs=require(_0xc292('0xe'));var toCsv=require(_0xc292('0x7'));var querystring=require(_0xc292('0xf'));var Papa=require('papaparse');var Redis=require(_0xc292('0x10'));var authService=require(_0xc292('0x11'));var qs=require(_0xc292('0x12'));var as=require(_0xc292('0x13'));var hardwareService=require(_0xc292('0x14'));var logger=require('../../config/logger')(_0xc292('0x15'));var utils=require(_0xc292('0x16'));var config=require(_0xc292('0x17'));var licenseUtil=require(_0xc292('0x18'));var db=require(_0xc292('0x19'))['db'];function respondWithStatusCode(_0x3ead77,_0x4f4e98){_0x4f4e98=_0x4f4e98||0xcc;return function(_0x891862){if(_0x891862){return _0x3ead77[_0xc292('0x1a')](_0x4f4e98);}return _0x3ead77[_0xc292('0x1b')](_0x4f4e98)[_0xc292('0x1c')]();};}function respondWithResult(_0x38c865,_0x51ab23){_0x51ab23=_0x51ab23||0xc8;return function(_0x56417e){if(_0x56417e){return _0x38c865[_0xc292('0x1b')](_0x51ab23)[_0xc292('0x1d')](_0x56417e);}};}function respondWithFilteredResult(_0x5d0067,_0x290138){return function(_0x53a23e){if(_0x53a23e){var _0x5e765a=typeof _0x290138[_0xc292('0x1e')]==='undefined'&&typeof _0x290138[_0xc292('0x1f')]===_0xc292('0x20');var _0x18b73b=_0x53a23e['count'];var _0x43128f=_0x5e765a?0x0:_0x290138['offset'];var _0x581782=_0x5e765a?_0x53a23e[_0xc292('0x21')]:_0x290138[_0xc292('0x1e')]+_0x290138['limit'];var _0x2a74af;if(_0x581782>=_0x18b73b){_0x581782=_0x18b73b;_0x2a74af=0xc8;}else{_0x2a74af=0xce;}_0x5d0067[_0xc292('0x1b')](_0x2a74af);return _0x5d0067[_0xc292('0x22')]('Content-Range',_0x43128f+'-'+_0x581782+'/'+_0x18b73b)['json'](_0x53a23e);}return null;};}function patchUpdates(_0x29b51a){return function(_0x169c3d){try{jsonpatch[_0xc292('0x23')](_0x169c3d,_0x29b51a,!![]);}catch(_0x2493ac){return BPromise[_0xc292('0x24')](_0x2493ac);}return _0x169c3d[_0xc292('0x25')]();};}function saveUpdates(_0x17bafc,_0x2a4618){return function(_0x3e638b){if(_0x3e638b){return _0x3e638b['update'](_0x17bafc)['then'](function(_0x2a1750){return _0x2a1750;});}return null;};}function removeEntity(_0x3aa05b,_0x4ba9e3){return function(_0x190aae){if(_0x190aae){return _0x190aae[_0xc292('0x26')]()[_0xc292('0x27')](function(){_0x3aa05b['status'](0xcc)[_0xc292('0x1c')]();});}};}function handleEntityNotFound(_0x342d73,_0x53040d){return function(_0x4eb30e){if(!_0x4eb30e){_0x342d73[_0xc292('0x1a')](0x194);}return _0x4eb30e;};}function handleError(_0x415167,_0x53fcb9){_0x53fcb9=_0x53fcb9||0x1f4;return function(_0x51314f){logger['error'](_0x51314f[_0xc292('0x28')]);if(_0x51314f[_0xc292('0x29')]){delete _0x51314f['name'];}_0x415167[_0xc292('0x1b')](_0x53fcb9)['send'](_0x51314f);};}exports[_0xc292('0x2a')]=function(_0x20452e,_0x4ae177){var _0x4c5b13={},_0x23cb2c={},_0x100cf2={'count':0x0,'rows':[]};var _0x4f169b=_['map'](db[_0xc292('0x2b')]['rawAttributes'],function(_0x3142d8){return{'name':_0x3142d8[_0xc292('0x2c')],'type':_0x3142d8[_0xc292('0x2d')]['key']};});_0x23cb2c[_0xc292('0x2e')]=_[_0xc292('0x2f')](_0x4f169b,_0xc292('0x29'));_0x23cb2c[_0xc292('0x30')]=_[_0xc292('0x31')](_0x20452e['query']);_0x23cb2c[_0xc292('0x32')]=_[_0xc292('0x33')](_0x23cb2c[_0xc292('0x2e')],_0x23cb2c[_0xc292('0x30')]);_0x4c5b13['attributes']=_['intersection'](_0x23cb2c[_0xc292('0x2e')],qs[_0xc292('0x34')](_0x20452e[_0xc292('0x30')][_0xc292('0x34')]));_0x4c5b13[_0xc292('0x35')]=_0x4c5b13[_0xc292('0x35')]['length']?_0x4c5b13['attributes']:_0x23cb2c[_0xc292('0x2e')];if(!_0x20452e[_0xc292('0x30')]['hasOwnProperty'](_0xc292('0x36'))){_0x4c5b13[_0xc292('0x1f')]=qs[_0xc292('0x1f')](_0x20452e[_0xc292('0x30')][_0xc292('0x1f')]);_0x4c5b13['offset']=qs[_0xc292('0x1e')](_0x20452e[_0xc292('0x30')][_0xc292('0x1e')]);}_0x4c5b13[_0xc292('0x37')]=qs[_0xc292('0x38')](_0x20452e[_0xc292('0x30')]['sort']);_0x4c5b13[_0xc292('0x39')]=qs[_0xc292('0x32')](_[_0xc292('0x3a')](_0x20452e[_0xc292('0x30')],_0x23cb2c[_0xc292('0x32')]),_0x4f169b);if(_0x20452e['query'][_0xc292('0x3b')]){_0x4c5b13[_0xc292('0x39')]=_[_0xc292('0x3c')](_0x4c5b13[_0xc292('0x39')],{'$or':_[_0xc292('0x2f')](_0x4f169b,function(_0x4a15ec){if(_0x4a15ec['type']!==_0xc292('0x3d')){var _0x284a06={};_0x284a06[_0x4a15ec['name']]={'$like':'%'+_0x20452e[_0xc292('0x30')][_0xc292('0x3b')]+'%'};return _0x284a06;}})});}_0x4c5b13=_['merge']({},_0x4c5b13,_0x20452e[_0xc292('0x3e')]);var _0x23bae9={'where':_0x4c5b13['where']};return db[_0xc292('0x2b')][_0xc292('0x21')](_0x23bae9)[_0xc292('0x27')](function(_0x23f45b){_0x100cf2[_0xc292('0x21')]=_0x23f45b;if(_0x20452e[_0xc292('0x30')]['includeAll']){_0x4c5b13[_0xc292('0x3f')]=[{'all':!![]}];}return db[_0xc292('0x2b')][_0xc292('0x40')](_0x4c5b13);})['then'](function(_0x1ebc6e){_0x100cf2['rows']=_0x1ebc6e;return _0x100cf2;})['then'](respondWithFilteredResult(_0x4ae177,_0x4c5b13))[_0xc292('0x41')](handleError(_0x4ae177,null));};exports[_0xc292('0x42')]=function(_0x331193,_0x49a10c){var _0x267817={'raw':!![],'where':{'id':_0x331193[_0xc292('0x43')]['id']}},_0x585e1e={};_0x585e1e[_0xc292('0x2e')]=_[_0xc292('0x31')](db['DeskField']['rawAttributes']);_0x585e1e[_0xc292('0x30')]=_[_0xc292('0x31')](_0x331193['query']);_0x585e1e['filters']=_[_0xc292('0x33')](_0x585e1e[_0xc292('0x2e')],_0x585e1e[_0xc292('0x30')]);_0x267817['attributes']=_[_0xc292('0x33')](_0x585e1e['model'],qs['fields'](_0x331193[_0xc292('0x30')]['fields']));_0x267817[_0xc292('0x35')]=_0x267817['attributes'][_0xc292('0x44')]?_0x267817[_0xc292('0x35')]:_0x585e1e[_0xc292('0x2e')];if(_0x331193[_0xc292('0x30')][_0xc292('0x45')]){_0x267817[_0xc292('0x3f')]=[{'all':!![]}];}_0x267817=_['merge']({},_0x267817,_0x331193[_0xc292('0x3e')]);return db[_0xc292('0x2b')]['find'](_0x267817)[_0xc292('0x27')](handleEntityNotFound(_0x49a10c,null))[_0xc292('0x27')](respondWithResult(_0x49a10c,null))[_0xc292('0x41')](handleError(_0x49a10c,null));};exports[_0xc292('0x46')]=function(_0x21968e,_0x6c7d1a){return db['DeskField'][_0xc292('0x46')](_0x21968e[_0xc292('0x47')],{})[_0xc292('0x27')](respondWithResult(_0x6c7d1a,0xc9))[_0xc292('0x41')](handleError(_0x6c7d1a,null));};exports[_0xc292('0x48')]=function(_0x3609fe,_0x88063c){if(_0x3609fe[_0xc292('0x47')]['id']){delete _0x3609fe[_0xc292('0x47')]['id'];}return db[_0xc292('0x2b')][_0xc292('0x49')]({'where':{'id':_0x3609fe[_0xc292('0x43')]['id']}})[_0xc292('0x27')](handleEntityNotFound(_0x88063c,null))[_0xc292('0x27')](saveUpdates(_0x3609fe[_0xc292('0x47')],null))[_0xc292('0x27')](respondWithResult(_0x88063c,null))['catch'](handleError(_0x88063c,null));};exports[_0xc292('0x26')]=function(_0x1b74f7,_0x9d9083){return db[_0xc292('0x2b')]['find']({'where':{'id':_0x1b74f7[_0xc292('0x43')]['id']}})[_0xc292('0x27')](handleEntityNotFound(_0x9d9083,null))[_0xc292('0x27')](removeEntity(_0x9d9083,null))[_0xc292('0x41')](handleError(_0x9d9083,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 8e6ca42..0dc8541 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 _0xfc52=['request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x551876,_0x14bc1b){var _0x337952=function(_0x371685){while(--_0x371685){_0x551876['push'](_0x551876['shift']());}};_0x337952(++_0x14bc1b);}(_0xfc52,0xda));var _0x2fc5=function(_0x153da6,_0xc9bfde){_0x153da6=_0x153da6-0x0;var _0xf01a0d=_0xfc52[_0x153da6];return _0xf01a0d;};'use strict';var _=require(_0x2fc5('0x0'));var util=require(_0x2fc5('0x1'));var logger=require(_0x2fc5('0x2'))(_0x2fc5('0x3'));var moment=require(_0x2fc5('0x4'));var BPromise=require(_0x2fc5('0x5'));var rp=require(_0x2fc5('0x6'));var fs=require('fs');var path=require(_0x2fc5('0x7'));var rimraf=require(_0x2fc5('0x8'));var config=require('../../config/environment');var attributes=require(_0x2fc5('0x9'));module[_0x2fc5('0xa')]=function(_0x692d07,_0x164de2){return _0x692d07[_0x2fc5('0xb')](_0x2fc5('0xc'),attributes,{'tableName':_0x2fc5('0xd'),'paranoid':![],'indexes':[{'name':_0x2fc5('0xe'),'fields':['idField',_0x2fc5('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0181=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54080c,_0x2b5537){var _0x37b3a7=function(_0xb85a85){while(--_0xb85a85){_0x54080c['push'](_0x54080c['shift']());}};_0x37b3a7(++_0x2b5537);}(_0x0181,0x119));var _0x1018=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x0181[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x1018('0x0'));var util=require(_0x1018('0x1'));var logger=require(_0x1018('0x2'))(_0x1018('0x3'));var moment=require(_0x1018('0x4'));var BPromise=require(_0x1018('0x5'));var rp=require(_0x1018('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1018('0x7'));var config=require(_0x1018('0x8'));var attributes=require(_0x1018('0x9'));module[_0x1018('0xa')]=function(_0x20a29b,_0x343870){return _0x20a29b[_0x1018('0xb')]('DeskField',attributes,{'tableName':_0x1018('0xc'),'paranoid':![],'indexes':[{'name':_0x1018('0xd'),'fields':[_0x1018('0xe'),_0x1018('0xf')],'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 ddb4aef..43da914 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 _0x31de=['../../config/environment','http','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2d14d2,_0x44c861){var _0x1a0515=function(_0x2194d9){while(--_0x2194d9){_0x2d14d2['push'](_0x2d14d2['shift']());}};_0x1a0515(++_0x44c861);}(_0x31de,0x15f));var _0xe31d=function(_0x14a007,_0x20c57d){_0x14a007=_0x14a007-0x0;var _0x5def45=_0x31de[_0x14a007];return _0x5def45;};'use strict';var _=require(_0xe31d('0x0'));var util=require(_0xe31d('0x1'));var moment=require(_0xe31d('0x2'));var BPromise=require(_0xe31d('0x3'));var rs=require(_0xe31d('0x4'));var fs=require('fs');var Redis=require(_0xe31d('0x5'));var db=require(_0xe31d('0x6'))['db'];var utils=require(_0xe31d('0x7'));var logger=require('../../config/logger')(_0xe31d('0x8'));var config=require(_0xe31d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe31d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a0eef,_0xe2428c,_0x51af2f){return new BPromise(function(_0x4efa1a,_0x3c2bbf){return client['request'](_0x5a0eef,_0x51af2f)['then'](function(_0x54d82b){logger['info']('DeskField,\x20%s,\x20%s',_0xe2428c,_0xe31d('0xb'));logger[_0xe31d('0xc')](_0xe31d('0xd'),_0xe2428c,_0xe31d('0xb'),JSON[_0xe31d('0xe')](_0x54d82b));if(_0x54d82b['error']){if(_0x54d82b[_0xe31d('0xf')][_0xe31d('0x10')]===0x1f4){logger[_0xe31d('0xf')]('DeskField,\x20%s,\x20%s',_0xe2428c,_0x54d82b[_0xe31d('0xf')]['message']);return _0x3c2bbf(_0x54d82b[_0xe31d('0xf')]['message']);}logger[_0xe31d('0xf')](_0xe31d('0x11'),_0xe2428c,_0x54d82b[_0xe31d('0xf')]['message']);return _0x4efa1a(_0x54d82b[_0xe31d('0xf')][_0xe31d('0x12')]);}else{logger['info'](_0xe31d('0x11'),_0xe2428c,_0xe31d('0xb'));_0x4efa1a(_0x54d82b[_0xe31d('0x13')]['message']);}})['catch'](function(_0x4e9931){logger['error']('DeskField,\x20%s,\x20%s',_0xe2428c,_0x4e9931);_0x3c2bbf(_0x4e9931);});});} \ No newline at end of file +var _0x09a9=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x58717e,_0x2ecb22){var _0x1650de=function(_0x333a63){while(--_0x333a63){_0x58717e['push'](_0x58717e['shift']());}};_0x1650de(++_0x2ecb22);}(_0x09a9,0x77));var _0x909a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x09a9[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x909a('0x0'));var util=require(_0x909a('0x1'));var moment=require('moment');var BPromise=require(_0x909a('0x2'));var rs=require(_0x909a('0x3'));var fs=require('fs');var Redis=require(_0x909a('0x4'));var db=require(_0x909a('0x5'))['db'];var utils=require(_0x909a('0x6'));var logger=require('../../config/logger')(_0x909a('0x7'));var config=require(_0x909a('0x8'));var jayson=require(_0x909a('0x9'));var client=jayson[_0x909a('0xa')][_0x909a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54d117,_0x158eec,_0x1a5b9a){return new BPromise(function(_0x4dcecd,_0x405869){return client[_0x909a('0xc')](_0x54d117,_0x1a5b9a)[_0x909a('0xd')](function(_0x313332){logger[_0x909a('0xe')](_0x909a('0xf'),_0x158eec,_0x909a('0x10'));logger[_0x909a('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x158eec,_0x909a('0x10'),JSON[_0x909a('0x12')](_0x313332));if(_0x313332[_0x909a('0x13')]){if(_0x313332[_0x909a('0x13')][_0x909a('0x14')]===0x1f4){logger[_0x909a('0x13')]('DeskField,\x20%s,\x20%s',_0x158eec,_0x313332['error']['message']);return _0x405869(_0x313332[_0x909a('0x13')][_0x909a('0x15')]);}logger[_0x909a('0x13')](_0x909a('0xf'),_0x158eec,_0x313332[_0x909a('0x13')][_0x909a('0x15')]);return _0x4dcecd(_0x313332[_0x909a('0x13')][_0x909a('0x15')]);}else{logger[_0x909a('0xe')](_0x909a('0xf'),_0x158eec,_0x909a('0x10'));_0x4dcecd(_0x313332[_0x909a('0x16')][_0x909a('0x15')]);}})[_0x909a('0x17')](function(_0x231f51){logger[_0x909a('0x13')]('DeskField,\x20%s,\x20%s',_0x158eec,_0x231f51);_0x405869(_0x231f51);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 011d175..a3df119 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 _0xb32a=['./intDynamics365Account.controller','get','index','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0xb32a,0x1a8));var _0xab32=function(_0x43bccf,_0x4a0a35){_0x43bccf=_0x43bccf-0x0;var _0x2991e8=_0xb32a[_0x43bccf];return _0x2991e8;};'use strict';var multer=require(_0xab32('0x0'));var util=require(_0xab32('0x1'));var path=require(_0xab32('0x2'));var timeout=require(_0xab32('0x3'));var express=require(_0xab32('0x4'));var router=express[_0xab32('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab32('0x6'));var config=require(_0xab32('0x7'));var controller=require(_0xab32('0x8'));router[_0xab32('0x9')]('/',auth['isAuthenticated'](),controller[_0xab32('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xab32('0xb')]);router[_0xab32('0x9')](_0xab32('0xc'),auth[_0xab32('0xd')](),controller['getConfigurations']);router[_0xab32('0x9')](_0xab32('0xe'),auth[_0xab32('0xd')](),controller[_0xab32('0xf')]);router[_0xab32('0x10')]('/',auth[_0xab32('0xd')](),controller[_0xab32('0x11')]);router[_0xab32('0x10')](_0xab32('0xc'),auth[_0xab32('0xd')](),controller[_0xab32('0x12')]);router[_0xab32('0x13')](_0xab32('0x14'),auth[_0xab32('0xd')](),controller[_0xab32('0x15')]);router[_0xab32('0x16')](_0xab32('0x14'),auth[_0xab32('0xd')](),controller[_0xab32('0x17')]);module['exports']=router; \ No newline at end of file +var _0x61e1=['index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x56f390,_0x379801){var _0x57fa9e=function(_0x4afe75){while(--_0x4afe75){_0x56f390['push'](_0x56f390['shift']());}};_0x57fa9e(++_0x379801);}(_0x61e1,0xa0));var _0x161e=function(_0x4c87fe,_0xe5eb68){_0x4c87fe=_0x4c87fe-0x0;var _0x5d82f5=_0x61e1[_0x4c87fe];return _0x5d82f5;};'use strict';var multer=require(_0x161e('0x0'));var util=require('util');var path=require(_0x161e('0x1'));var timeout=require(_0x161e('0x2'));var express=require(_0x161e('0x3'));var router=express[_0x161e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x161e('0x5'));var interaction=require(_0x161e('0x6'));var config=require(_0x161e('0x7'));var controller=require(_0x161e('0x8'));router[_0x161e('0x9')]('/',auth['isAuthenticated'](),controller[_0x161e('0xa')]);router['get'](_0x161e('0xb'),auth[_0x161e('0xc')](),controller['show']);router[_0x161e('0x9')](_0x161e('0xd'),auth[_0x161e('0xc')](),controller['getConfigurations']);router[_0x161e('0x9')](_0x161e('0xe'),auth[_0x161e('0xc')](),controller[_0x161e('0xf')]);router['post']('/',auth[_0x161e('0xc')](),controller['create']);router['post'](_0x161e('0xd'),auth[_0x161e('0xc')](),controller['addConfiguration']);router['put'](_0x161e('0xb'),auth[_0x161e('0xc')](),controller[_0x161e('0x10')]);router['delete'](_0x161e('0xb'),auth[_0x161e('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 6dd6c02..7f672e8 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 _0xa2e0=['exports','STRING','sequelize'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xa2e0,0x9b));var _0x0a2e=function(_0x19da9,_0x328a63){_0x19da9=_0x19da9-0x0;var _0xf6a067=_0xa2e0[_0x19da9];return _0xf6a067;};'use strict';var Sequelize=require(_0x0a2e('0x0'));module[_0x0a2e('0x1')]={'name':{'type':Sequelize[_0x0a2e('0x2')]},'username':{'type':Sequelize[_0x0a2e('0x2')]},'password':{'type':Sequelize[_0x0a2e('0x2')]},'remoteUri':{'type':Sequelize[_0x0a2e('0x2')]},'tenantId':{'type':Sequelize[_0x0a2e('0x2')]},'clientId':{'type':Sequelize[_0x0a2e('0x2')]},'clientSecret':{'type':Sequelize[_0x0a2e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a2e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0a2e('0x2')]}}; \ No newline at end of file +var _0x0ca9=['STRING','sequelize','exports'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x0ca9,0x151));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x90ca('0x0'));module[_0x90ca('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x90ca('0x2')]},'password':{'type':Sequelize[_0x90ca('0x2')]},'remoteUri':{'type':Sequelize[_0x90ca('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x90ca('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 4674191..1881d4b 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 _0x00bb=['owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','GET','Bearer\x20','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','false','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','save','then','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','update','find','body','destroy','getConfigurations','Dynamics365Configuration','pick','findOne','Subjects','getSubjects','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype'];(function(_0x46f01a,_0xc5ab14){var _0xfe8a59=function(_0x1496c2){while(--_0x1496c2){_0x46f01a['push'](_0x46f01a['shift']());}};_0xfe8a59(++_0xc5ab14);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var integrations=require(_0xb00b('0x15'));function respondWithStatusCode(_0x1be8aa,_0x466b9b){_0x466b9b=_0x466b9b||0xcc;return function(_0xef5d52){if(_0xef5d52){return _0x1be8aa[_0xb00b('0x16')](_0x466b9b);}return _0x1be8aa['status'](_0x466b9b)[_0xb00b('0x17')]();};}function respondWithResult(_0xb0d42e,_0x482fe6){_0x482fe6=_0x482fe6||0xc8;return function(_0x88d95e){if(_0x88d95e){return _0xb0d42e[_0xb00b('0x18')](_0x482fe6)['json'](_0x88d95e);}};}function respondWithFilteredResult(_0x5da36b,_0x9b471e){return function(_0x4dcd45){if(_0x4dcd45){var _0x51d136=typeof _0x9b471e[_0xb00b('0x19')]===_0xb00b('0x1a')&&typeof _0x9b471e[_0xb00b('0x1b')]===_0xb00b('0x1a');var _0x58d65f=_0x4dcd45[_0xb00b('0x1c')];var _0x599347=_0x51d136?0x0:_0x9b471e[_0xb00b('0x19')];var _0x5aa9a0=_0x51d136?_0x4dcd45[_0xb00b('0x1c')]:_0x9b471e['offset']+_0x9b471e[_0xb00b('0x1b')];var _0x3355a3;if(_0x5aa9a0>=_0x58d65f){_0x5aa9a0=_0x58d65f;_0x3355a3=0xc8;}else{_0x3355a3=0xce;}_0x5da36b['status'](_0x3355a3);return _0x5da36b['set'](_0xb00b('0x1d'),_0x599347+'-'+_0x5aa9a0+'/'+_0x58d65f)['json'](_0x4dcd45);}return null;};}function patchUpdates(_0x1344c4){return function(_0x43da66){try{jsonpatch[_0xb00b('0x1e')](_0x43da66,_0x1344c4,!![]);}catch(_0x3501af){return BPromise['reject'](_0x3501af);}return _0x43da66[_0xb00b('0x1f')]();};}function saveUpdates(_0x4df284,_0x25a973){return function(_0x121ec7){if(_0x121ec7){return _0x121ec7['update'](_0x4df284)[_0xb00b('0x20')](function(_0x2896d1){return _0x2896d1;});}return null;};}function removeEntity(_0x520444,_0x3ab3cc){return function(_0x1f04d3){if(_0x1f04d3){return _0x1f04d3['destroy']()[_0xb00b('0x20')](function(){_0x520444[_0xb00b('0x18')](0xcc)[_0xb00b('0x17')]();});}};}function handleEntityNotFound(_0x8caadf,_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x8caadf[_0xb00b('0x16')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x21')](_0x4a635e[_0xb00b('0x22')]);if(_0x4a635e[_0xb00b('0x23')]){delete _0x4a635e[_0xb00b('0x23')];}_0x490380[_0xb00b('0x18')](_0x550587)[_0xb00b('0x24')](_0x4a635e);};}exports[_0xb00b('0x25')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={},_0x450129={},_0x348165={'count':0x0,'rows':[]};var _0x5424ca=_['map'](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x16fbd5){return{'name':_0x16fbd5[_0xb00b('0x28')],'type':_0x16fbd5[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x450129[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x5424ca,_0xb00b('0x23'));_0x450129['query']=_[_0xb00b('0x2d')](_0x4a8d2b[_0xb00b('0x2e')]);_0x450129['filters']=_[_0xb00b('0x2f')](_0x450129[_0xb00b('0x2b')],_0x450129['query']);_0x503c9c[_0xb00b('0x30')]=_['intersection'](_0x450129[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x503c9c[_0xb00b('0x30')]=_0x503c9c[_0xb00b('0x30')][_0xb00b('0x32')]?_0x503c9c['attributes']:_0x450129['model'];if(!_0x4a8d2b['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x503c9c[_0xb00b('0x1b')]=qs[_0xb00b('0x1b')](_0x4a8d2b['query'][_0xb00b('0x1b')]);_0x503c9c[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x503c9c[_0xb00b('0x35')]=qs[_0xb00b('0x36')](_0x4a8d2b[_0xb00b('0x2e')]['sort']);_0x503c9c['where']=qs[_0xb00b('0x37')](_['pick'](_0x4a8d2b[_0xb00b('0x2e')],_0x450129[_0xb00b('0x37')]),_0x5424ca);if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x38')]){_0x503c9c[_0xb00b('0x39')]=_[_0xb00b('0x3a')](_0x503c9c[_0xb00b('0x39')],{'$or':_['map'](_0x5424ca,function(_0x35f1ca){if(_0x35f1ca[_0xb00b('0x29')]!==_0xb00b('0x3b')){var _0xd9c03f={};_0xd9c03f[_0x35f1ca[_0xb00b('0x23')]]={'$like':'%'+_0x4a8d2b[_0xb00b('0x2e')]['filter']+'%'};return _0xd9c03f;}})});}_0x503c9c=_[_0xb00b('0x3a')]({},_0x503c9c,_0x4a8d2b[_0xb00b('0x3c')]);var _0x4801e7={'where':_0x503c9c[_0xb00b('0x39')]};return db[_0xb00b('0x26')][_0xb00b('0x1c')](_0x4801e7)[_0xb00b('0x20')](function(_0x2954e8){_0x348165['count']=_0x2954e8;if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x3d')]){_0x503c9c[_0xb00b('0x3e')]=[{'all':!![]}];}return db[_0xb00b('0x26')]['findAll'](_0x503c9c);})['then'](function(_0x43f834){_0x348165[_0xb00b('0x3f')]=_0x43f834;return _0x348165;})[_0xb00b('0x20')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x40')](handleError(_0x22c22d,null));};exports[_0xb00b('0x41')]=function(_0x26f17b,_0x275664){var _0x493841={'raw':![],'where':{'id':_0x26f17b[_0xb00b('0x42')]['id']}},_0x36200d={};_0x36200d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36200d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x26f17b[_0xb00b('0x2e')]);_0x36200d[_0xb00b('0x37')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],_0x36200d['query']);_0x493841[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x26f17b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x493841[_0xb00b('0x30')]=_0x493841[_0xb00b('0x30')][_0xb00b('0x32')]?_0x493841[_0xb00b('0x30')]:_0x36200d[_0xb00b('0x2b')];if(_0x26f17b[_0xb00b('0x2e')]['includeAll']){_0x493841['include']=[{'all':!![]}];}_0x493841=_['merge']({},_0x493841,_0x26f17b[_0xb00b('0x3c')]);return db[_0xb00b('0x26')]['find'](_0x493841)[_0xb00b('0x20')](handleEntityNotFound(_0x275664,null))[_0xb00b('0x20')](respondWithResult(_0x275664,null))[_0xb00b('0x40')](handleError(_0x275664,null));};exports[_0xb00b('0x43')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x26')][_0xb00b('0x43')](_0x4b62b3['body'],{})['then'](respondWithResult(_0x58e9cb,0xc9))[_0xb00b('0x40')](handleError(_0x58e9cb,null));};exports[_0xb00b('0x44')]=function(_0x4e0be4,_0x2228e9){if(_0x4e0be4['body']['id']){delete _0x4e0be4['body']['id'];}return db['Dynamics365Account'][_0xb00b('0x45')]({'where':{'id':_0x4e0be4['params']['id']}})[_0xb00b('0x20')](handleEntityNotFound(_0x2228e9,null))[_0xb00b('0x20')](saveUpdates(_0x4e0be4[_0xb00b('0x46')],null))[_0xb00b('0x20')](respondWithResult(_0x2228e9,null))[_0xb00b('0x40')](handleError(_0x2228e9,null));};exports[_0xb00b('0x47')]=function(_0x4846c9,_0x5bd40c){return db[_0xb00b('0x26')][_0xb00b('0x45')]({'where':{'id':_0x4846c9['params']['id']}})[_0xb00b('0x20')](handleEntityNotFound(_0x5bd40c,null))[_0xb00b('0x20')](removeEntity(_0x5bd40c,null))['catch'](handleError(_0x5bd40c,null));};exports[_0xb00b('0x48')]=function(_0x10e066,_0x3b5d82,_0x498f95){var _0x501cbe={};var _0x19f907={};var _0x398deb;var _0x12737d;return db[_0xb00b('0x26')]['findOne']({'where':{'id':_0x10e066[_0xb00b('0x42')]['id']}})[_0xb00b('0x20')](handleEntityNotFound(_0x3b5d82,null))['then'](function(_0x4cd9fd){if(_0x4cd9fd){_0x398deb=_0x4cd9fd;_0x19f907[_0xb00b('0x2b')]=_['keys'](db[_0xb00b('0x49')][_0xb00b('0x27')]);_0x19f907[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x10e066[_0xb00b('0x2e')]);_0x19f907[_0xb00b('0x37')]=_['intersection'](_0x19f907[_0xb00b('0x2b')],_0x19f907['query']);_0x501cbe[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x19f907[_0xb00b('0x2b')],qs['fields'](_0x10e066[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x501cbe[_0xb00b('0x30')]=_0x501cbe['attributes'][_0xb00b('0x32')]?_0x501cbe[_0xb00b('0x30')]:_0x19f907[_0xb00b('0x2b')];_0x501cbe[_0xb00b('0x35')]=qs[_0xb00b('0x36')](_0x10e066[_0xb00b('0x2e')][_0xb00b('0x36')]);_0x501cbe[_0xb00b('0x39')]=qs['filters'](_[_0xb00b('0x4a')](_0x10e066[_0xb00b('0x2e')],_0x19f907[_0xb00b('0x37')]));if(_0x10e066['query'][_0xb00b('0x38')]){_0x501cbe[_0xb00b('0x39')]=_[_0xb00b('0x3a')](_0x501cbe[_0xb00b('0x39')],{'$or':_[_0xb00b('0x2c')](_0x501cbe['attributes'],function(_0xfd4ecc){var _0x343214={};_0x343214[_0xfd4ecc]={'$like':'%'+_0x10e066[_0xb00b('0x2e')][_0xb00b('0x38')]+'%'};return _0x343214;})});}_0x501cbe=_['merge']({},_0x501cbe,_0x10e066[_0xb00b('0x3c')]);return _0x398deb[_0xb00b('0x48')](_0x501cbe);}})[_0xb00b('0x20')](function(_0x2d73bb){if(_0x2d73bb){_0x12737d=_0x2d73bb[_0xb00b('0x32')];if(!_0x10e066[_0xb00b('0x2e')][_0xb00b('0x33')]('nolimit')){_0x501cbe[_0xb00b('0x1b')]=qs['limit'](_0x10e066[_0xb00b('0x2e')]['limit']);_0x501cbe[_0xb00b('0x19')]=qs['offset'](_0x10e066[_0xb00b('0x2e')]['offset']);}return _0x398deb[_0xb00b('0x48')](_0x501cbe);}})[_0xb00b('0x20')](function(_0x3bae02){if(_0x3bae02){return _0x3bae02?{'count':_0x12737d,'rows':_0x3bae02}:null;}})['then'](respondWithResult(_0x3b5d82,null))['catch'](handleError(_0x3b5d82,null));};exports['addConfiguration']=function(_0x21a53d,_0x3126be,_0x1d06ca){if(_0x21a53d['body']['id']){delete _0x21a53d[_0xb00b('0x46')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x4b')]({'where':{'id':_0x21a53d[_0xb00b('0x42')]['id']}})[_0xb00b('0x20')](handleEntityNotFound(_0x3126be,null))['then'](function(_0x32f924){if(_0x32f924){_0x21a53d[_0xb00b('0x46')]['AccountId']=_0x32f924['id'];_0x21a53d[_0xb00b('0x46')][_0xb00b('0x4c')]=integrations[_0xb00b('0x4d')](_0x21a53d['body']['channel'],_0x21a53d[_0xb00b('0x46')][_0xb00b('0x29')]);_0x21a53d[_0xb00b('0x46')]['Descriptions']=integrations['getDescriptions'](_0x21a53d['body']['channel'],_0x21a53d[_0xb00b('0x46')]['type']);return db[_0xb00b('0x49')][_0xb00b('0x43')](_0x21a53d['body'],{'include':[{'model':db[_0xb00b('0x4e')],'as':_0xb00b('0x4c')},{'model':db[_0xb00b('0x4e')],'as':_0xb00b('0x4f')}]});}return null;})[_0xb00b('0x20')](respondWithResult(_0x3126be,null))['catch'](handleError(_0x3126be,null));};exports[_0xb00b('0x50')]=function(_0x851800,_0x3d4482,_0x15dcc3){var _0x8e7e4e=_0x851800[_0xb00b('0x2e')][_0xb00b('0x51')];var _0x550473=_0x8e7e4e===_0xb00b('0x52')?_0xb00b('0x53'):_0xb00b('0x54');var _0x328f72='';var _0x109f56='';var _0x432b68='';var _0x3f010a='';var _0x266294='';var _0x4d6f3a='';var _0x292986='';var _0x446e42='';var _0x1bf5ad=[_0xb00b('0x55'),_0xb00b('0x56'),_0xb00b('0x57'),_0xb00b('0x58'),_0xb00b('0x59'),'subject',_0xb00b('0x5a'),_0xb00b('0x5b'),_0xb00b('0x5c'),_0xb00b('0x5d')];var _0x227949=[_0xb00b('0x5e'),_0xb00b('0x5f'),'actualserviceunits',_0xb00b('0x60'),_0xb00b('0x61'),_0xb00b('0x62'),_0xb00b('0x63'),_0xb00b('0x64'),_0xb00b('0x65'),'createdbyexternalpartyyominame',_0xb00b('0x66'),'createdbyyominame',_0xb00b('0x67'),'createdonbehalfbyname',_0xb00b('0x68'),_0xb00b('0x69'),_0xb00b('0x6a'),'customeridyominame','emailaddress',_0xb00b('0x6b'),_0xb00b('0x6c'),_0xb00b('0x6d'),_0xb00b('0x6e'),_0xb00b('0x6f'),_0xb00b('0x70'),_0xb00b('0x71'),_0xb00b('0x72'),_0xb00b('0x73'),_0xb00b('0x74'),_0xb00b('0x75'),_0xb00b('0x76'),_0xb00b('0x77'),_0xb00b('0x78'),'modifiedbyname','modifiedbyyominame',_0xb00b('0x79'),_0xb00b('0x7a'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xb00b('0x7b'),_0xb00b('0x7c'),_0xb00b('0x7d'),'overriddencreatedon',_0xb00b('0x7e'),_0xb00b('0x7f'),_0xb00b('0x80'),_0xb00b('0x81'),_0xb00b('0x82'),_0xb00b('0x83'),_0xb00b('0x84'),'productidname',_0xb00b('0x85'),'resolveby',_0xb00b('0x86'),_0xb00b('0x87'),'responsiblecontactidname',_0xb00b('0x88'),_0xb00b('0x89'),_0xb00b('0x8a'),_0xb00b('0x8b'),_0xb00b('0x8c'),_0xb00b('0x8d'),_0xb00b('0x8e'),_0xb00b('0x8f'),_0xb00b('0x90'),_0xb00b('0x91'),_0xb00b('0x92'),_0xb00b('0x93'),'utcconversiontimezonecode',_0xb00b('0x94')];var _0x64d8ea=_0x1bf5ad[_0xb00b('0x95')](_0x227949);return db[_0xb00b('0x26')]['findOne']({'where':{'id':_0x851800[_0xb00b('0x42')]['id']},'attributes':['id',_0xb00b('0x96'),_0xb00b('0x97'),_0xb00b('0x98'),_0xb00b('0x99'),'clientId',_0xb00b('0x9a')]})[_0xb00b('0x20')](handleEntityNotFound(_0x3d4482,null))[_0xb00b('0x20')](function(_0x2b66b7){if(_0x2b66b7){_0x446e42=_0x2b66b7['remoteUri'];var _0x34dcb0=_0x446e42['slice'](-0x1);if(_0x34dcb0==='/'){_0x446e42=_0x446e42[_0xb00b('0x9b')](0x0,_0x446e42[_0xb00b('0x9c')](_0x34dcb0));}_0x292986=util[_0xb00b('0x9d')](_0xb00b('0x9e'),_0x446e42);var _0x188349={'method':_0xb00b('0x9f'),'uri':_0xb00b('0xa0')+_0x2b66b7[_0xb00b('0x99')]+_0xb00b('0xa1'),'form':{'client_id':_0x2b66b7[_0xb00b('0xa2')],'resource':_0x446e42,'username':_0x2b66b7[_0xb00b('0x96')],'password':_0x2b66b7['password'],'grant_type':_0xb00b('0x97'),'client_secret':_0x2b66b7[_0xb00b('0x9a')]},'json':!![]};return rp(_0x188349);}})[_0xb00b('0x20')](function(_0x3eb70e){_0x4d6f3a=_0x3eb70e['access_token'];var _0x136ca4={'method':_0xb00b('0xa3'),'uri':encodeURI(_0x292986+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x550473+'\x27'),'headers':{'Authorization':_0xb00b('0xa4')+_0x4d6f3a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x136ca4);})[_0xb00b('0x20')](function(_0x43377c){var _0x3ffd91=_0x43377c['value'][0x0];var _0x2c4cdf=_0x3ffd91[_0xb00b('0xa5')];var _0x3a5c6d={'method':_0xb00b('0xa3'),'uri':_0x292986+_0xb00b('0xa6')+_0x2c4cdf+_0xb00b('0xa7'),'headers':{'Authorization':_0xb00b('0xa4')+_0x4d6f3a,'If-None-Match':null,'OData-Version':_0xb00b('0xa8')},'json':!![]};return rp(_0x3a5c6d);})[_0xb00b('0x20')](function(_0x4add9c){_0x328f72=_0x4add9c;_0x109f56=_0x328f72['Attributes'];_0x109f56=_[_0xb00b('0xa9')](_0x109f56,function(_0x39d7dd){return!_0x64d8ea[_0xb00b('0xaa')](_0x39d7dd[_0xb00b('0xab')]);});var _0x4a7f8c=[];var _0x62f47=[];_0x109f56[_0xb00b('0xac')](function(_0x5eea96){if(_0x5eea96[_0xb00b('0xad')]){var _0x21cdbe=_0x5eea96[_0xb00b('0xad')]['substring'](_0x5eea96[_0xb00b('0xad')][_0xb00b('0x9c')]('.')+0x1);if(_0x21cdbe==='PicklistAttributeMetadata'){_0x4a7f8c[_0xb00b('0xae')](getSelectList(_0x292986,_0x8e7e4e,_0x62f47,_0x328f72[_0xb00b('0xa5')],_0x5eea96[_0xb00b('0xa5')],_0x4d6f3a));}}});return Promise[_0xb00b('0xaf')](_0x4a7f8c);})[_0xb00b('0x20')](function(_0x294f38){_0x432b68=_0x294f38[0x0];var _0x3a7db7=[];var _0x183341=[];_0x109f56['forEach'](function(_0x7c79e2){if(!_[_0xb00b('0xb0')](_0x7c79e2[_0xb00b('0xad')])){var _0x29d101=_0x7c79e2['@odata.type'][_0xb00b('0x9b')](_0x7c79e2['@odata.type'][_0xb00b('0x9c')]('.')+0x1);if(_0x29d101==='BooleanAttributeMetadata'){_0x3a7db7[_0xb00b('0xae')](getBooleanList(_0x292986,_0x8e7e4e,_0x183341,_0x328f72[_0xb00b('0xa5')],_0x7c79e2[_0xb00b('0xa5')],_0x4d6f3a));}}});return Promise[_0xb00b('0xaf')](_0x3a7db7);})[_0xb00b('0x20')](function(_0x59a2f3){_0x3f010a=_0x59a2f3[0x0];var _0x3ee641=[];var _0x176a5f=[];_0x109f56['forEach'](function(_0x44c086){if(_0x44c086['@odata.type']){var _0x20a690=_0x44c086[_0xb00b('0xad')][_0xb00b('0x9b')](_0x44c086[_0xb00b('0xad')]['lastIndexOf']('.')+0x1);if(_0x20a690===_0xb00b('0xb1')||_0x20a690===_0xb00b('0xb2')||_0x20a690===_0xb00b('0xb3')||_0x20a690===_0xb00b('0xb4')||_0x20a690===_0xb00b('0xb5')||_0x20a690==='DateTimeAttributeMetadata'||_0x20a690==='StatusAttributeMetadata'||_0x20a690===_0xb00b('0xb6')||_0x20a690===_0xb00b('0xb7')||_0x20a690===_0xb00b('0xb8')){_0x3ee641[_0xb00b('0xae')](getInputList(_0x292986,_0x8e7e4e,_0x20a690,_0x176a5f,_0x328f72[_0xb00b('0xa5')],_0x44c086['MetadataId'],_0x4d6f3a));}}});return Promise['all'](_0x3ee641);})[_0xb00b('0x20')](function(_0x7e4de2){_0x266294=_0x7e4de2[0x0];var _0x20d610=_0x432b68[_0xb00b('0x95')](_0x3f010a)[_0xb00b('0x95')](_0x266294);var _0x38b718={'count':_0x20d610[_0xb00b('0x32')],'rows':_0x20d610};return _0x38b718;})['then'](respondWithResult(_0x3d4482,null))[_0xb00b('0x40')](function(_0x54b972){var _0x128a41=_0x851800['query'][_0xb00b('0xb9')]?0x1f4:_0x54b972[_0xb00b('0xba')]||0x1f4;logger[_0xb00b('0x21')](_0x54b972[_0xb00b('0x22')]);delete _0x54b972[_0xb00b('0x23')];if(_0x128a41===0x191){_0x128a41=0x190;}_0x3d4482[_0xb00b('0x18')](_0x128a41)[_0xb00b('0x24')](_0x851800[_0xb00b('0x2e')][_0xb00b('0xb9')]?{'message':_0xb00b('0xbb'),'statusCode':_0x54b972[_0xb00b('0xba')]}:_0x54b972);});};function getSelectList(_0x565667,_0x456a2f,_0xaad8c4,_0x29742c,_0x3150a6,_0x4feff3){var _0x3f0175={'method':_0xb00b('0xa3'),'uri':_0x565667+'EntityDefinitions('+_0x29742c+_0xb00b('0xbc')+_0x3150a6+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xb00b('0xbd'),'headers':{'Authorization':_0xb00b('0xa4')+_0x4feff3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f0175)[_0xb00b('0x20')](function(_0x349b5f){var _0x3032d9=[];var _0x20ca7b=_0x349b5f[_0xb00b('0xbe')][_0xb00b('0xbf')];_0x20ca7b['forEach'](function(_0x39c493){_0x3032d9['push']({'name':_0x39c493[_0xb00b('0xc0')][_0xb00b('0xc1')][_0xb00b('0xc0')],'value':String(_0x39c493[_0xb00b('0xc2')])});});var _0x5b511d={'id':_0x456a2f+'_'+_0x349b5f[_0xb00b('0xab')],'name':_0x349b5f[_0xb00b('0xc3')][_0xb00b('0xc1')]['Label'],'custom':![],'options':_0x3032d9};_0xaad8c4[_0xb00b('0xae')](_0x5b511d);return _0xaad8c4;});}function getBooleanList(_0x1bec6b,_0x2a91a6,_0xcc2183,_0x56a0bb,_0x212a40,_0x3c5c17){var _0x10fd66={'method':_0xb00b('0xa3'),'uri':_0x1bec6b+_0xb00b('0xa6')+_0x56a0bb+_0xb00b('0xbc')+_0x212a40+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x3c5c17,'If-None-Match':null,'OData-Version':_0xb00b('0xa8')},'json':!![]};return rp(_0x10fd66)[_0xb00b('0x20')](function(_0x206686){var _0x2ec514=[];_0x2ec514[_0xb00b('0xae')]({'name':_0x206686['OptionSet'][_0xb00b('0xc4')][_0xb00b('0xc0')][_0xb00b('0xc1')][_0xb00b('0xc0')],'value':_0xb00b('0xc5')},{'name':_0x206686[_0xb00b('0xbe')]['FalseOption'][_0xb00b('0xc0')][_0xb00b('0xc1')][_0xb00b('0xc0')],'value':_0xb00b('0xc6')});var _0x44129a={'id':_0x2a91a6+'_'+_0x206686[_0xb00b('0xab')],'name':_0x206686[_0xb00b('0xc3')][_0xb00b('0xc1')][_0xb00b('0xc0')],'custom':![],'options':_0x2ec514};_0xcc2183[_0xb00b('0xae')](_0x44129a);return _0xcc2183;});}function getInputList(_0x59c8e1,_0x5a4d53,_0x20a942,_0x2599d0,_0x23eaff,_0x55b3fd,_0x4e0a24){var _0x50f959={'method':_0xb00b('0xa3'),'uri':_0x59c8e1+_0xb00b('0xa6')+_0x23eaff+_0xb00b('0xbc')+_0x55b3fd+')/Microsoft.Dynamics.CRM.'+_0x20a942+_0xb00b('0xc7'),'headers':{'Authorization':_0xb00b('0xa4')+_0x4e0a24,'If-None-Match':null,'OData-Version':_0xb00b('0xa8')},'json':!![]};return rp(_0x50f959)[_0xb00b('0x20')](function(_0x5796dd){var _0x373f79={'id':_0x5a4d53+'_'+_0x5796dd[_0xb00b('0xab')],'name':_0x5796dd[_0xb00b('0xc3')][_0xb00b('0xc1')]?_0x5796dd[_0xb00b('0xc3')][_0xb00b('0xc1')][_0xb00b('0xc0')]:_0x5796dd[_0xb00b('0xab')],'custom':![],'options':[]};_0x2599d0['push'](_0x373f79);return _0x2599d0;});} \ No newline at end of file +var _0x9335=['Content-Range','apply','reject','then','end','sendStatus','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','Dynamics365Account','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','getConfigurations','findOne','Dynamics365Configuration','order','options','addConfiguration','Subjects','channel','Descriptions','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','accountidname','accountidyominame','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','push','Label','LogicalName','DisplayName','TrueOption','true','FalseOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','limit','undefined','offset','count','set'];(function(_0x327066,_0x471d99){var _0xf65bc=function(_0x7190a1){while(--_0x7190a1){_0x327066['push'](_0x327066['shift']());}};_0xf65bc(++_0x471d99);}(_0x9335,0xab));var _0x5933=function(_0x4db418,_0x4e57a8){_0x4db418=_0x4db418-0x0;var _0xad2c04=_0x9335[_0x4db418];return _0xad2c04;};'use strict';var emlformat=require(_0x5933('0x0'));var rimraf=require(_0x5933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x2'));var rp=require(_0x5933('0x3'));var moment=require(_0x5933('0x4'));var BPromise=require(_0x5933('0x5'));var Mustache=require(_0x5933('0x6'));var util=require(_0x5933('0x7'));var path=require(_0x5933('0x8'));var sox=require('sox');var csv=require(_0x5933('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5933('0xd'));var toCsv=require(_0x5933('0x9'));var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require(_0x5933('0x10'));var authService=require(_0x5933('0x11'));var qs=require(_0x5933('0x12'));var as=require(_0x5933('0x13'));var hardwareService=require(_0x5933('0x14'));var logger=require(_0x5933('0x15'))(_0x5933('0x16'));var utils=require(_0x5933('0x17'));var config=require(_0x5933('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x8b6bad,_0x1b4428){_0x1b4428=_0x1b4428||0xcc;return function(_0x12a173){if(_0x12a173){return _0x8b6bad['sendStatus'](_0x1b4428);}return _0x8b6bad[_0x5933('0x1a')](_0x1b4428)['end']();};}function respondWithResult(_0x1ab3d0,_0x4fc51d){_0x4fc51d=_0x4fc51d||0xc8;return function(_0x3b9d8d){if(_0x3b9d8d){return _0x1ab3d0['status'](_0x4fc51d)[_0x5933('0x1b')](_0x3b9d8d);}};}function respondWithFilteredResult(_0x5e91da,_0x404555){return function(_0x34c035){if(_0x34c035){var _0x236c9a=typeof _0x404555['offset']==='undefined'&&typeof _0x404555[_0x5933('0x1c')]===_0x5933('0x1d');var _0x3fb0e1=_0x34c035['count'];var _0x4a4d3f=_0x236c9a?0x0:_0x404555[_0x5933('0x1e')];var _0x480e67=_0x236c9a?_0x34c035[_0x5933('0x1f')]:_0x404555[_0x5933('0x1e')]+_0x404555[_0x5933('0x1c')];var _0x501065;if(_0x480e67>=_0x3fb0e1){_0x480e67=_0x3fb0e1;_0x501065=0xc8;}else{_0x501065=0xce;}_0x5e91da[_0x5933('0x1a')](_0x501065);return _0x5e91da[_0x5933('0x20')](_0x5933('0x21'),_0x4a4d3f+'-'+_0x480e67+'/'+_0x3fb0e1)['json'](_0x34c035);}return null;};}function patchUpdates(_0x59a2cd){return function(_0x49c67f){try{jsonpatch[_0x5933('0x22')](_0x49c67f,_0x59a2cd,!![]);}catch(_0x5bbfe7){return BPromise[_0x5933('0x23')](_0x5bbfe7);}return _0x49c67f['save']();};}function saveUpdates(_0x2d0fb7,_0x50026f){return function(_0x54a25a){if(_0x54a25a){return _0x54a25a['update'](_0x2d0fb7)['then'](function(_0x3d70ef){return _0x3d70ef;});}return null;};}function removeEntity(_0x5639c7,_0x1a2f5d){return function(_0x544f23){if(_0x544f23){return _0x544f23['destroy']()[_0x5933('0x24')](function(){_0x5639c7[_0x5933('0x1a')](0xcc)[_0x5933('0x25')]();});}};}function handleEntityNotFound(_0x56e8a9,_0xd2320){return function(_0x101a7b){if(!_0x101a7b){_0x56e8a9[_0x5933('0x26')](0x194);}return _0x101a7b;};}function handleError(_0x5a0de4,_0x1e24f6){_0x1e24f6=_0x1e24f6||0x1f4;return function(_0x6a9f34){logger['error'](_0x6a9f34[_0x5933('0x27')]);if(_0x6a9f34[_0x5933('0x28')]){delete _0x6a9f34['name'];}_0x5a0de4[_0x5933('0x1a')](_0x1e24f6)['send'](_0x6a9f34);};}exports[_0x5933('0x29')]=function(_0x45039b,_0x1af598){var _0x4adb80={},_0x255ed5={},_0x51e2d6={'count':0x0,'rows':[]};var _0x3a602c=_[_0x5933('0x2a')](db['Dynamics365Account']['rawAttributes'],function(_0x5c15dd){return{'name':_0x5c15dd[_0x5933('0x2b')],'type':_0x5c15dd[_0x5933('0x2c')]['key']};});_0x255ed5[_0x5933('0x2d')]=_[_0x5933('0x2a')](_0x3a602c,_0x5933('0x28'));_0x255ed5[_0x5933('0x2e')]=_['keys'](_0x45039b[_0x5933('0x2e')]);_0x255ed5['filters']=_[_0x5933('0x2f')](_0x255ed5['model'],_0x255ed5[_0x5933('0x2e')]);_0x4adb80[_0x5933('0x30')]=_[_0x5933('0x2f')](_0x255ed5[_0x5933('0x2d')],qs['fields'](_0x45039b[_0x5933('0x2e')][_0x5933('0x31')]));_0x4adb80['attributes']=_0x4adb80['attributes'][_0x5933('0x32')]?_0x4adb80['attributes']:_0x255ed5['model'];if(!_0x45039b[_0x5933('0x2e')][_0x5933('0x33')](_0x5933('0x34'))){_0x4adb80[_0x5933('0x1c')]=qs['limit'](_0x45039b['query']['limit']);_0x4adb80['offset']=qs[_0x5933('0x1e')](_0x45039b['query']['offset']);}_0x4adb80['order']=qs[_0x5933('0x35')](_0x45039b[_0x5933('0x2e')][_0x5933('0x35')]);_0x4adb80[_0x5933('0x36')]=qs[_0x5933('0x37')](_[_0x5933('0x38')](_0x45039b[_0x5933('0x2e')],_0x255ed5[_0x5933('0x37')]),_0x3a602c);if(_0x45039b[_0x5933('0x2e')][_0x5933('0x39')]){_0x4adb80['where']=_[_0x5933('0x3a')](_0x4adb80[_0x5933('0x36')],{'$or':_[_0x5933('0x2a')](_0x3a602c,function(_0x43f33d){if(_0x43f33d[_0x5933('0x2c')]!==_0x5933('0x3b')){var _0xe7e47c={};_0xe7e47c[_0x43f33d[_0x5933('0x28')]]={'$like':'%'+_0x45039b[_0x5933('0x2e')][_0x5933('0x39')]+'%'};return _0xe7e47c;}})});}_0x4adb80=_['merge']({},_0x4adb80,_0x45039b['options']);var _0x2016e0={'where':_0x4adb80[_0x5933('0x36')]};return db[_0x5933('0x3c')]['count'](_0x2016e0)['then'](function(_0x382254){_0x51e2d6[_0x5933('0x1f')]=_0x382254;if(_0x45039b['query'][_0x5933('0x3d')]){_0x4adb80[_0x5933('0x3e')]=[{'all':!![]}];}return db[_0x5933('0x3c')][_0x5933('0x3f')](_0x4adb80);})[_0x5933('0x24')](function(_0x1f1d56){_0x51e2d6['rows']=_0x1f1d56;return _0x51e2d6;})['then'](respondWithFilteredResult(_0x1af598,_0x4adb80))[_0x5933('0x40')](handleError(_0x1af598,null));};exports[_0x5933('0x41')]=function(_0x36d072,_0x293845){var _0x247c65={'raw':![],'where':{'id':_0x36d072['params']['id']}},_0x19af9e={};_0x19af9e[_0x5933('0x2d')]=_[_0x5933('0x42')](db[_0x5933('0x3c')]['rawAttributes']);_0x19af9e[_0x5933('0x2e')]=_[_0x5933('0x42')](_0x36d072[_0x5933('0x2e')]);_0x19af9e[_0x5933('0x37')]=_[_0x5933('0x2f')](_0x19af9e[_0x5933('0x2d')],_0x19af9e[_0x5933('0x2e')]);_0x247c65[_0x5933('0x30')]=_[_0x5933('0x2f')](_0x19af9e[_0x5933('0x2d')],qs['fields'](_0x36d072[_0x5933('0x2e')]['fields']));_0x247c65['attributes']=_0x247c65['attributes'][_0x5933('0x32')]?_0x247c65['attributes']:_0x19af9e['model'];if(_0x36d072[_0x5933('0x2e')][_0x5933('0x3d')]){_0x247c65['include']=[{'all':!![]}];}_0x247c65=_[_0x5933('0x3a')]({},_0x247c65,_0x36d072['options']);return db[_0x5933('0x3c')][_0x5933('0x43')](_0x247c65)['then'](handleEntityNotFound(_0x293845,null))['then'](respondWithResult(_0x293845,null))[_0x5933('0x40')](handleError(_0x293845,null));};exports[_0x5933('0x44')]=function(_0x38e713,_0x10148d){return db[_0x5933('0x3c')]['create'](_0x38e713[_0x5933('0x45')],{})[_0x5933('0x24')](respondWithResult(_0x10148d,0xc9))[_0x5933('0x40')](handleError(_0x10148d,null));};exports['update']=function(_0x2d5fd4,_0x9f2a15){if(_0x2d5fd4[_0x5933('0x45')]['id']){delete _0x2d5fd4[_0x5933('0x45')]['id'];}return db['Dynamics365Account'][_0x5933('0x43')]({'where':{'id':_0x2d5fd4[_0x5933('0x46')]['id']}})[_0x5933('0x24')](handleEntityNotFound(_0x9f2a15,null))[_0x5933('0x24')](saveUpdates(_0x2d5fd4['body'],null))[_0x5933('0x24')](respondWithResult(_0x9f2a15,null))[_0x5933('0x40')](handleError(_0x9f2a15,null));};exports[_0x5933('0x47')]=function(_0x38f681,_0x40b672){return db[_0x5933('0x3c')][_0x5933('0x43')]({'where':{'id':_0x38f681[_0x5933('0x46')]['id']}})[_0x5933('0x24')](handleEntityNotFound(_0x40b672,null))[_0x5933('0x24')](removeEntity(_0x40b672,null))['catch'](handleError(_0x40b672,null));};exports[_0x5933('0x48')]=function(_0x4d0bb8,_0x38ceb0,_0x5d4a4c){var _0x2e1ee9={};var _0x5e1029={};var _0x1aabbc;var _0x28cb6d;return db['Dynamics365Account'][_0x5933('0x49')]({'where':{'id':_0x4d0bb8['params']['id']}})[_0x5933('0x24')](handleEntityNotFound(_0x38ceb0,null))[_0x5933('0x24')](function(_0x2680be){if(_0x2680be){_0x1aabbc=_0x2680be;_0x5e1029[_0x5933('0x2d')]=_[_0x5933('0x42')](db[_0x5933('0x4a')]['rawAttributes']);_0x5e1029[_0x5933('0x2e')]=_[_0x5933('0x42')](_0x4d0bb8[_0x5933('0x2e')]);_0x5e1029['filters']=_[_0x5933('0x2f')](_0x5e1029['model'],_0x5e1029[_0x5933('0x2e')]);_0x2e1ee9['attributes']=_[_0x5933('0x2f')](_0x5e1029[_0x5933('0x2d')],qs[_0x5933('0x31')](_0x4d0bb8[_0x5933('0x2e')]['fields']));_0x2e1ee9['attributes']=_0x2e1ee9['attributes'][_0x5933('0x32')]?_0x2e1ee9[_0x5933('0x30')]:_0x5e1029[_0x5933('0x2d')];_0x2e1ee9[_0x5933('0x4b')]=qs[_0x5933('0x35')](_0x4d0bb8[_0x5933('0x2e')]['sort']);_0x2e1ee9['where']=qs[_0x5933('0x37')](_[_0x5933('0x38')](_0x4d0bb8[_0x5933('0x2e')],_0x5e1029['filters']));if(_0x4d0bb8[_0x5933('0x2e')][_0x5933('0x39')]){_0x2e1ee9[_0x5933('0x36')]=_[_0x5933('0x3a')](_0x2e1ee9[_0x5933('0x36')],{'$or':_[_0x5933('0x2a')](_0x2e1ee9[_0x5933('0x30')],function(_0x377d24){var _0x67a14a={};_0x67a14a[_0x377d24]={'$like':'%'+_0x4d0bb8[_0x5933('0x2e')][_0x5933('0x39')]+'%'};return _0x67a14a;})});}_0x2e1ee9=_[_0x5933('0x3a')]({},_0x2e1ee9,_0x4d0bb8[_0x5933('0x4c')]);return _0x1aabbc['getConfigurations'](_0x2e1ee9);}})[_0x5933('0x24')](function(_0x79dd3){if(_0x79dd3){_0x28cb6d=_0x79dd3[_0x5933('0x32')];if(!_0x4d0bb8[_0x5933('0x2e')][_0x5933('0x33')](_0x5933('0x34'))){_0x2e1ee9[_0x5933('0x1c')]=qs[_0x5933('0x1c')](_0x4d0bb8[_0x5933('0x2e')][_0x5933('0x1c')]);_0x2e1ee9[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x4d0bb8[_0x5933('0x2e')][_0x5933('0x1e')]);}return _0x1aabbc[_0x5933('0x48')](_0x2e1ee9);}})[_0x5933('0x24')](function(_0x50c938){if(_0x50c938){return _0x50c938?{'count':_0x28cb6d,'rows':_0x50c938}:null;}})['then'](respondWithResult(_0x38ceb0,null))[_0x5933('0x40')](handleError(_0x38ceb0,null));};exports[_0x5933('0x4d')]=function(_0x43998c,_0x1852df,_0x23b6b9){if(_0x43998c[_0x5933('0x45')]['id']){delete _0x43998c[_0x5933('0x45')]['id'];}return db[_0x5933('0x3c')][_0x5933('0x49')]({'where':{'id':_0x43998c['params']['id']}})['then'](handleEntityNotFound(_0x1852df,null))[_0x5933('0x24')](function(_0x58fe09){if(_0x58fe09){_0x43998c[_0x5933('0x45')]['AccountId']=_0x58fe09['id'];_0x43998c['body'][_0x5933('0x4e')]=integrations['getSubjects'](_0x43998c['body'][_0x5933('0x4f')],_0x43998c[_0x5933('0x45')][_0x5933('0x2c')]);_0x43998c[_0x5933('0x45')][_0x5933('0x50')]=integrations['getDescriptions'](_0x43998c[_0x5933('0x45')]['channel'],_0x43998c[_0x5933('0x45')][_0x5933('0x2c')]);return db[_0x5933('0x4a')][_0x5933('0x44')](_0x43998c[_0x5933('0x45')],{'include':[{'model':db[_0x5933('0x51')],'as':_0x5933('0x4e')},{'model':db[_0x5933('0x51')],'as':_0x5933('0x50')}]});}return null;})[_0x5933('0x24')](respondWithResult(_0x1852df,null))[_0x5933('0x40')](handleError(_0x1852df,null));};exports[_0x5933('0x52')]=function(_0x589020,_0x45907,_0x1a2f2b){var _0x332aaa=_0x589020['query']['ticketType'];var _0x73c530=_0x332aaa===_0x5933('0x53')?_0x5933('0x54'):_0x5933('0x55');var _0x14532e='';var _0x3abf1e='';var _0x8f9e63='';var _0x5a0a84='';var _0x3502d0='';var _0x392b98='';var _0x4ef370='';var _0x193539='';var _0x2c4719=[_0x5933('0x56'),_0x5933('0x57'),_0x5933('0x58'),_0x5933('0x59'),_0x5933('0x5a'),_0x5933('0x5b'),_0x5933('0x5c'),'regardingobjectid','directioncode','phonecall_activity_parties'];var _0x5c24ad=[_0x5933('0x5d'),_0x5933('0x5e'),'actualserviceunits','billedserviceunits',_0x5933('0x5f'),'contactidyominame',_0x5933('0x60'),_0x5933('0x61'),_0x5933('0x62'),'createdbyexternalpartyyominame',_0x5933('0x63'),'createdbyyominame',_0x5933('0x64'),_0x5933('0x65'),'createdonbehalfbyyominame',_0x5933('0x66'),_0x5933('0x67'),_0x5933('0x68'),_0x5933('0x69'),'entitlementidname',_0x5933('0x6a'),_0x5933('0x6b'),'escalatedon',_0x5933('0x6c'),_0x5933('0x6d'),'followupby','importsequencenumber','influencescore',_0x5933('0x6e'),'lastonholdtime',_0x5933('0x6f'),'modifiedbyexternalpartyname',_0x5933('0x70'),_0x5933('0x71'),_0x5933('0x72'),_0x5933('0x73'),'modifiedonbehalfbyname',_0x5933('0x74'),_0x5933('0x75'),_0x5933('0x76'),_0x5933('0x77'),_0x5933('0x78'),_0x5933('0x79'),'owneridname',_0x5933('0x7a'),'owneridyominame',_0x5933('0x7b'),_0x5933('0x7c'),_0x5933('0x7d'),_0x5933('0x7e'),_0x5933('0x7f'),_0x5933('0x80'),'resolveby',_0x5933('0x81'),_0x5933('0x82'),_0x5933('0x83'),_0x5933('0x84'),_0x5933('0x85'),_0x5933('0x86'),_0x5933('0x87'),_0x5933('0x88'),_0x5933('0x89'),_0x5933('0x8a'),_0x5933('0x8b'),_0x5933('0x8c'),_0x5933('0x8d'),_0x5933('0x8e'),_0x5933('0x8f'),_0x5933('0x90'),_0x5933('0x91')];var _0x2b58ce=_0x2c4719[_0x5933('0x92')](_0x5c24ad);return db['Dynamics365Account']['findOne']({'where':{'id':_0x589020[_0x5933('0x46')]['id']},'attributes':['id',_0x5933('0x93'),_0x5933('0x94'),_0x5933('0x95'),_0x5933('0x96'),_0x5933('0x97'),_0x5933('0x98')]})[_0x5933('0x24')](handleEntityNotFound(_0x45907,null))['then'](function(_0x59d8ac){if(_0x59d8ac){_0x193539=_0x59d8ac['remoteUri'];var _0x57f09d=_0x193539[_0x5933('0x99')](-0x1);if(_0x57f09d==='/'){_0x193539=_0x193539[_0x5933('0x9a')](0x0,_0x193539[_0x5933('0x9b')](_0x57f09d));}_0x4ef370=util[_0x5933('0x9c')](_0x5933('0x9d'),_0x193539);var _0x5023c4={'method':_0x5933('0x9e'),'uri':_0x5933('0x9f')+_0x59d8ac[_0x5933('0x96')]+_0x5933('0xa0'),'form':{'client_id':_0x59d8ac[_0x5933('0x97')],'resource':_0x193539,'username':_0x59d8ac[_0x5933('0x93')],'password':_0x59d8ac['password'],'grant_type':'password','client_secret':_0x59d8ac['clientSecret']},'json':!![]};return rp(_0x5023c4);}})[_0x5933('0x24')](function(_0x80b511){_0x392b98=_0x80b511[_0x5933('0xa1')];var _0x1e6380={'method':'GET','uri':encodeURI(_0x4ef370+_0x5933('0xa2')+_0x73c530+'\x27'),'headers':{'Authorization':_0x5933('0xa3')+_0x392b98,'If-None-Match':null,'OData-Version':_0x5933('0xa4')},'json':!![]};return rp(_0x1e6380);})[_0x5933('0x24')](function(_0x2165db){var _0x370d8a=_0x2165db[_0x5933('0xa5')][0x0];var _0x2d599c=_0x370d8a[_0x5933('0xa6')];var _0x5c5b14={'method':_0x5933('0xa7'),'uri':_0x4ef370+_0x5933('0xa8')+_0x2d599c+_0x5933('0xa9'),'headers':{'Authorization':_0x5933('0xa3')+_0x392b98,'If-None-Match':null,'OData-Version':_0x5933('0xa4')},'json':!![]};return rp(_0x5c5b14);})[_0x5933('0x24')](function(_0x52f348){_0x14532e=_0x52f348;_0x3abf1e=_0x14532e[_0x5933('0xaa')];_0x3abf1e=_['remove'](_0x3abf1e,function(_0x17210e){return!_0x2b58ce[_0x5933('0xab')](_0x17210e['LogicalName']);});var _0x13403e=[];var _0x4db63c=[];_0x3abf1e[_0x5933('0xac')](function(_0x4d8dd8){if(_0x4d8dd8['@odata.type']){var _0x349364=_0x4d8dd8[_0x5933('0xad')][_0x5933('0x9a')](_0x4d8dd8['@odata.type'][_0x5933('0x9b')]('.')+0x1);if(_0x349364==='PicklistAttributeMetadata'){_0x13403e['push'](getSelectList(_0x4ef370,_0x332aaa,_0x4db63c,_0x14532e[_0x5933('0xa6')],_0x4d8dd8[_0x5933('0xa6')],_0x392b98));}}});return Promise[_0x5933('0xae')](_0x13403e);})[_0x5933('0x24')](function(_0x35bdf3){_0x8f9e63=_0x35bdf3[0x0];var _0x20f42f=[];var _0x480d1e=[];_0x3abf1e[_0x5933('0xac')](function(_0x3f00cd){if(!_[_0x5933('0xaf')](_0x3f00cd[_0x5933('0xad')])){var _0x2ffe55=_0x3f00cd[_0x5933('0xad')][_0x5933('0x9a')](_0x3f00cd[_0x5933('0xad')]['lastIndexOf']('.')+0x1);if(_0x2ffe55===_0x5933('0xb0')){_0x20f42f['push'](getBooleanList(_0x4ef370,_0x332aaa,_0x480d1e,_0x14532e[_0x5933('0xa6')],_0x3f00cd[_0x5933('0xa6')],_0x392b98));}}});return Promise[_0x5933('0xae')](_0x20f42f);})[_0x5933('0x24')](function(_0x2ef069){_0x5a0a84=_0x2ef069[0x0];var _0x156045=[];var _0x573dd0=[];_0x3abf1e[_0x5933('0xac')](function(_0x375953){if(_0x375953['@odata.type']){var _0x25865a=_0x375953[_0x5933('0xad')][_0x5933('0x9a')](_0x375953['@odata.type'][_0x5933('0x9b')]('.')+0x1);if(_0x25865a===_0x5933('0xb1')||_0x25865a===_0x5933('0xb2')||_0x25865a===_0x5933('0xb3')||_0x25865a===_0x5933('0xb4')||_0x25865a===_0x5933('0xb5')||_0x25865a==='DateTimeAttributeMetadata'||_0x25865a==='StatusAttributeMetadata'||_0x25865a===_0x5933('0xb6')||_0x25865a===_0x5933('0xb7')||_0x25865a==='DecimalAttributeMetadata'){_0x156045['push'](getInputList(_0x4ef370,_0x332aaa,_0x25865a,_0x573dd0,_0x14532e[_0x5933('0xa6')],_0x375953[_0x5933('0xa6')],_0x392b98));}}});return Promise[_0x5933('0xae')](_0x156045);})[_0x5933('0x24')](function(_0xa0f027){_0x3502d0=_0xa0f027[0x0];var _0x2d51ce=_0x8f9e63['concat'](_0x5a0a84)[_0x5933('0x92')](_0x3502d0);var _0x3700b5={'count':_0x2d51ce['length'],'rows':_0x2d51ce};return _0x3700b5;})['then'](respondWithResult(_0x45907,null))['catch'](function(_0x2f0af6){var _0x99732c=_0x589020[_0x5933('0x2e')][_0x5933('0xb8')]?0x1f4:_0x2f0af6[_0x5933('0xb9')]||0x1f4;logger[_0x5933('0xba')](_0x2f0af6['stack']);delete _0x2f0af6[_0x5933('0x28')];if(_0x99732c===0x191){_0x99732c=0x190;}_0x45907['status'](_0x99732c)[_0x5933('0xbb')](_0x589020[_0x5933('0x2e')][_0x5933('0xb8')]?{'message':_0x5933('0xbc'),'statusCode':_0x2f0af6[_0x5933('0xb9')]}:_0x2f0af6);});};function getSelectList(_0x12f2ad,_0x457a62,_0x2072e5,_0x58c946,_0x4aa44c,_0x4c84a4){var _0xe335fc={'method':'GET','uri':_0x12f2ad+_0x5933('0xa8')+_0x58c946+_0x5933('0xbd')+_0x4aa44c+_0x5933('0xbe')+_0x5933('0xbf'),'headers':{'Authorization':_0x5933('0xa3')+_0x4c84a4,'If-None-Match':null,'OData-Version':_0x5933('0xa4')},'json':!![]};return rp(_0xe335fc)[_0x5933('0x24')](function(_0x3f5920){var _0x1a87f2=[];var _0xe93693=_0x3f5920[_0x5933('0xc0')]['Options'];_0xe93693[_0x5933('0xac')](function(_0x54a656){_0x1a87f2[_0x5933('0xc1')]({'name':_0x54a656[_0x5933('0xc2')]['UserLocalizedLabel'][_0x5933('0xc2')],'value':String(_0x54a656['Value'])});});var _0x2da18a={'id':_0x457a62+'_'+_0x3f5920[_0x5933('0xc3')],'name':_0x3f5920[_0x5933('0xc4')]['UserLocalizedLabel'][_0x5933('0xc2')],'custom':![],'options':_0x1a87f2};_0x2072e5[_0x5933('0xc1')](_0x2da18a);return _0x2072e5;});}function getBooleanList(_0x45adee,_0x5114d1,_0x4a0e82,_0x4c7095,_0x128252,_0x2b1e9a){var _0x44a700={'method':_0x5933('0xa7'),'uri':_0x45adee+_0x5933('0xa8')+_0x4c7095+_0x5933('0xbd')+_0x128252+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x5933('0xa3')+_0x2b1e9a,'If-None-Match':null,'OData-Version':_0x5933('0xa4')},'json':!![]};return rp(_0x44a700)[_0x5933('0x24')](function(_0x40dd25){var _0x3a5bba=[];_0x3a5bba[_0x5933('0xc1')]({'name':_0x40dd25['OptionSet'][_0x5933('0xc5')]['Label']['UserLocalizedLabel'][_0x5933('0xc2')],'value':_0x5933('0xc6')},{'name':_0x40dd25[_0x5933('0xc0')][_0x5933('0xc7')][_0x5933('0xc2')][_0x5933('0xc8')][_0x5933('0xc2')],'value':_0x5933('0xc9')});var _0x1956b3={'id':_0x5114d1+'_'+_0x40dd25[_0x5933('0xc3')],'name':_0x40dd25[_0x5933('0xc4')][_0x5933('0xc8')][_0x5933('0xc2')],'custom':![],'options':_0x3a5bba};_0x4a0e82[_0x5933('0xc1')](_0x1956b3);return _0x4a0e82;});}function getInputList(_0x309e94,_0xe7c2f8,_0x58e94a,_0x29463e,_0x1618f5,_0x15ea04,_0x4ef47a){var _0x532364={'method':'GET','uri':_0x309e94+_0x5933('0xa8')+_0x1618f5+_0x5933('0xbd')+_0x15ea04+_0x5933('0xca')+_0x58e94a+_0x5933('0xcb'),'headers':{'Authorization':_0x5933('0xa3')+_0x4ef47a,'If-None-Match':null,'OData-Version':_0x5933('0xa4')},'json':!![]};return rp(_0x532364)[_0x5933('0x24')](function(_0x4c13b9){var _0xe25856={'id':_0xe7c2f8+'_'+_0x4c13b9[_0x5933('0xc3')],'name':_0x4c13b9['DisplayName'][_0x5933('0xc8')]?_0x4c13b9[_0x5933('0xc4')][_0x5933('0xc8')][_0x5933('0xc2')]:_0x4c13b9['LogicalName'],'custom':![],'options':[]};_0x29463e[_0x5933('0xc1')](_0xe25856);return _0x29463e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e303c6d..4ecffac 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(_0x29d9b9,_0x4e50fe){var _0x32dbd4=function(_0x57590b){while(--_0x57590b){_0x29d9b9['push'](_0x29d9b9['shift']());}};_0x32dbd4(++_0x4e50fe);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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(_0x12ae35,_0x517c9b){var _0x214735=function(_0x1af99e){while(--_0x1af99e){_0x12ae35['push'](_0x12ae35['shift']());}};_0x214735(++_0x517c9b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'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 7127675..a32f723 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 _0x0555=['raw','where','limit','include','map','model','attributes','then','GetDynamics365Account','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options'];(function(_0x30534c,_0x482261){var _0x254c9e=function(_0x44d271){while(--_0x44d271){_0x30534c['push'](_0x30534c['shift']());}};_0x254c9e(++_0x482261);}(_0x0555,0xd6));var _0x5055=function(_0x610568,_0x1b0386){_0x610568=_0x610568-0x0;var _0x360299=_0x0555[_0x610568];return _0x360299;};'use strict';var _=require(_0x5055('0x0'));var util=require(_0x5055('0x1'));var moment=require(_0x5055('0x2'));var BPromise=require(_0x5055('0x3'));var rs=require(_0x5055('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5055('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5055('0x6'));var client=jayson[_0x5055('0x7')][_0x5055('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x482b88,_0x403cdb,_0x3ba625){return new BPromise(function(_0x33bc34,_0x5970d5){return client[_0x5055('0x9')](_0x482b88,_0x3ba625)['then'](function(_0x4e5174){logger[_0x5055('0xa')](_0x5055('0xb'),_0x403cdb,_0x5055('0xc'));logger[_0x5055('0xd')](_0x5055('0xe'),_0x403cdb,_0x5055('0xc'),JSON[_0x5055('0xf')](_0x4e5174));if(_0x4e5174[_0x5055('0x10')]){if(_0x4e5174['error'][_0x5055('0x11')]===0x1f4){logger[_0x5055('0x10')](_0x5055('0xb'),_0x403cdb,_0x4e5174[_0x5055('0x10')][_0x5055('0x12')]);return _0x5970d5(_0x4e5174[_0x5055('0x10')][_0x5055('0x12')]);}logger[_0x5055('0x10')](_0x5055('0xb'),_0x403cdb,_0x4e5174['error'][_0x5055('0x12')]);return _0x33bc34(_0x4e5174[_0x5055('0x10')][_0x5055('0x12')]);}else{logger[_0x5055('0xa')](_0x5055('0xb'),_0x403cdb,_0x5055('0xc'));_0x33bc34(_0x4e5174[_0x5055('0x13')][_0x5055('0x12')]);}})[_0x5055('0x14')](function(_0x30861b){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x403cdb,_0x30861b);_0x5970d5(_0x30861b);});});}exports['GetDynamics365Account']=function(_0x55b603){var _0x508692=this;return new Promise(function(_0xa75d9e,_0x48d146){return db[_0x5055('0x15')][_0x5055('0x16')]({'raw':_0x55b603[_0x5055('0x17')]?_0x55b603['options'][_0x5055('0x18')]===undefined?!![]:![]:!![],'where':_0x55b603[_0x5055('0x17')]?_0x55b603[_0x5055('0x17')][_0x5055('0x19')]||null:null,'attributes':_0x55b603[_0x5055('0x17')]?_0x55b603[_0x5055('0x17')]['attributes']||null:null,'limit':_0x55b603['options']?_0x55b603[_0x5055('0x17')][_0x5055('0x1a')]||null:null,'include':_0x55b603[_0x5055('0x17')]?_0x55b603['options'][_0x5055('0x1b')]?_[_0x5055('0x1c')](_0x55b603['options'][_0x5055('0x1b')],function(_0x3e56c4){return{'model':db[_0x3e56c4[_0x5055('0x1d')]],'as':_0x3e56c4['as'],'attributes':_0x3e56c4[_0x5055('0x1e')],'include':_0x3e56c4['include']?_[_0x5055('0x1c')](_0x3e56c4['include'],function(_0x1a06bd){return{'model':db[_0x1a06bd['model']],'as':_0x1a06bd['as'],'attributes':_0x1a06bd['attributes'],'include':_0x1a06bd['include']?_[_0x5055('0x1c')](_0x1a06bd[_0x5055('0x1b')],function(_0x2be02e){return{'model':db[_0x2be02e['model']],'as':_0x2be02e['as'],'attributes':_0x2be02e[_0x5055('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5055('0x1f')](function(_0x392c03){logger['info'](_0x5055('0x20'),_0x55b603);logger[_0x5055('0xd')](_0x5055('0x20'),_0x55b603,JSON[_0x5055('0xf')](_0x392c03));_0xa75d9e(_0x392c03);})[_0x5055('0x14')](function(_0x22fb46){logger[_0x5055('0x10')]('GetDynamics365Account',_0x22fb46[_0x5055('0x12')],_0x55b603);_0x48d146(_0x508692[_0x5055('0x10')](0x1f4,_0x22fb46[_0x5055('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x451c80){var _0x421961=this;return new Promise(function(_0x3d3d49,_0x57608e){return db['Dynamics365Account']['find']({'raw':_0x451c80['options']?_0x451c80['options']['raw']===undefined?!![]:![]:!![],'where':_0x451c80['options']?_0x451c80[_0x5055('0x17')][_0x5055('0x19')]||null:null,'attributes':_0x451c80['options']?_0x451c80[_0x5055('0x17')][_0x5055('0x1e')]||null:null,'include':_0x451c80[_0x5055('0x17')]?_0x451c80[_0x5055('0x17')]['include']?_[_0x5055('0x1c')](_0x451c80[_0x5055('0x17')][_0x5055('0x1b')],function(_0x14e52a){return{'model':db[_0x14e52a[_0x5055('0x1d')]],'as':_0x14e52a['as'],'attributes':_0x14e52a['attributes'],'include':_0x14e52a[_0x5055('0x1b')]?_[_0x5055('0x1c')](_0x14e52a[_0x5055('0x1b')],function(_0x9be801){return{'model':db[_0x9be801[_0x5055('0x1d')]],'as':_0x9be801['as'],'attributes':_0x9be801[_0x5055('0x1e')],'include':_0x9be801[_0x5055('0x1b')]?_['map'](_0x9be801['include'],function(_0x2753bd){return{'model':db[_0x2753bd[_0x5055('0x1d')]],'as':_0x2753bd['as'],'attributes':_0x2753bd[_0x5055('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5055('0x1f')](function(_0xbcfa6a){logger[_0x5055('0xa')](_0x5055('0x21'),_0x451c80);logger[_0x5055('0xd')](_0x5055('0x21'),_0x451c80,JSON[_0x5055('0xf')](_0xbcfa6a));_0x3d3d49(_0xbcfa6a);})['catch'](function(_0x40df17){logger[_0x5055('0x10')](_0x5055('0x21'),_0x40df17[_0x5055('0x12')],_0x451c80);_0x57608e(_0x421961[_0x5055('0x10')](0x1f4,_0x40df17[_0x5055('0x12')]));});});}; \ No newline at end of file +var _0x6d20=['Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account'];(function(_0x1e6e99,_0xd3bb5f){var _0x6b6ca8=function(_0xa29245){while(--_0xa29245){_0x1e6e99['push'](_0x1e6e99['shift']());}};_0x6b6ca8(++_0xd3bb5f);}(_0x6d20,0x10f));var _0x06d2=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x6d20[_0x16539a];return _0x200796;};'use strict';var _=require(_0x06d2('0x0'));var util=require(_0x06d2('0x1'));var moment=require(_0x06d2('0x2'));var BPromise=require(_0x06d2('0x3'));var rs=require(_0x06d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06d2('0x5'))['db'];var utils=require(_0x06d2('0x6'));var logger=require(_0x06d2('0x7'))('rpc');var config=require(_0x06d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06d2('0x9')][_0x06d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x591f11,_0x2772ff,_0x6ae6a5){return new BPromise(function(_0x54c538,_0x2cbd51){return client[_0x06d2('0xb')](_0x591f11,_0x6ae6a5)[_0x06d2('0xc')](function(_0x78c1ae){logger['info'](_0x06d2('0xd'),_0x2772ff,_0x06d2('0xe'));logger[_0x06d2('0xf')](_0x06d2('0x10'),_0x2772ff,_0x06d2('0xe'),JSON[_0x06d2('0x11')](_0x78c1ae));if(_0x78c1ae['error']){if(_0x78c1ae[_0x06d2('0x12')][_0x06d2('0x13')]===0x1f4){logger[_0x06d2('0x12')](_0x06d2('0xd'),_0x2772ff,_0x78c1ae['error'][_0x06d2('0x14')]);return _0x2cbd51(_0x78c1ae[_0x06d2('0x12')][_0x06d2('0x14')]);}logger[_0x06d2('0x12')](_0x06d2('0xd'),_0x2772ff,_0x78c1ae[_0x06d2('0x12')][_0x06d2('0x14')]);return _0x54c538(_0x78c1ae[_0x06d2('0x12')][_0x06d2('0x14')]);}else{logger[_0x06d2('0x15')](_0x06d2('0xd'),_0x2772ff,_0x06d2('0xe'));_0x54c538(_0x78c1ae[_0x06d2('0x16')][_0x06d2('0x14')]);}})[_0x06d2('0x17')](function(_0x175858){logger[_0x06d2('0x12')](_0x06d2('0xd'),_0x2772ff,_0x175858);_0x2cbd51(_0x175858);});});}exports[_0x06d2('0x18')]=function(_0x5b23fb){var _0x45eb7d=this;return new Promise(function(_0x4febd7,_0x5b46ac){return db[_0x06d2('0x19')][_0x06d2('0x1a')]({'raw':_0x5b23fb[_0x06d2('0x1b')]?_0x5b23fb[_0x06d2('0x1b')][_0x06d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b23fb[_0x06d2('0x1b')]?_0x5b23fb['options'][_0x06d2('0x1d')]||null:null,'attributes':_0x5b23fb[_0x06d2('0x1b')]?_0x5b23fb[_0x06d2('0x1b')][_0x06d2('0x1e')]||null:null,'limit':_0x5b23fb[_0x06d2('0x1b')]?_0x5b23fb['options'][_0x06d2('0x1f')]||null:null,'include':_0x5b23fb['options']?_0x5b23fb[_0x06d2('0x1b')]['include']?_['map'](_0x5b23fb[_0x06d2('0x1b')][_0x06d2('0x20')],function(_0x1aced9){return{'model':db[_0x1aced9[_0x06d2('0x21')]],'as':_0x1aced9['as'],'attributes':_0x1aced9['attributes'],'include':_0x1aced9[_0x06d2('0x20')]?_[_0x06d2('0x22')](_0x1aced9['include'],function(_0x5f5ac4){return{'model':db[_0x5f5ac4[_0x06d2('0x21')]],'as':_0x5f5ac4['as'],'attributes':_0x5f5ac4[_0x06d2('0x1e')],'include':_0x5f5ac4[_0x06d2('0x20')]?_[_0x06d2('0x22')](_0x5f5ac4[_0x06d2('0x20')],function(_0xed3352){return{'model':db[_0xed3352[_0x06d2('0x21')]],'as':_0xed3352['as'],'attributes':_0xed3352[_0x06d2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x06d2('0xc')](function(_0x29201c){logger[_0x06d2('0x15')]('GetDynamics365Account',_0x5b23fb);logger['debug']('GetDynamics365Account',_0x5b23fb,JSON[_0x06d2('0x11')](_0x29201c));_0x4febd7(_0x29201c);})['catch'](function(_0x4de744){logger['error'](_0x06d2('0x18'),_0x4de744[_0x06d2('0x14')],_0x5b23fb);_0x5b46ac(_0x45eb7d['error'](0x1f4,_0x4de744['message']));});});};exports[_0x06d2('0x23')]=function(_0x1e3f89){var _0x200245=this;return new Promise(function(_0x7816b7,_0x367281){return db[_0x06d2('0x19')][_0x06d2('0x24')]({'raw':_0x1e3f89[_0x06d2('0x1b')]?_0x1e3f89[_0x06d2('0x1b')][_0x06d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e3f89[_0x06d2('0x1b')]?_0x1e3f89[_0x06d2('0x1b')]['where']||null:null,'attributes':_0x1e3f89[_0x06d2('0x1b')]?_0x1e3f89[_0x06d2('0x1b')][_0x06d2('0x1e')]||null:null,'include':_0x1e3f89[_0x06d2('0x1b')]?_0x1e3f89[_0x06d2('0x1b')][_0x06d2('0x20')]?_['map'](_0x1e3f89[_0x06d2('0x1b')][_0x06d2('0x20')],function(_0x376818){return{'model':db[_0x376818['model']],'as':_0x376818['as'],'attributes':_0x376818[_0x06d2('0x1e')],'include':_0x376818[_0x06d2('0x20')]?_[_0x06d2('0x22')](_0x376818['include'],function(_0x278e0e){return{'model':db[_0x278e0e[_0x06d2('0x21')]],'as':_0x278e0e['as'],'attributes':_0x278e0e[_0x06d2('0x1e')],'include':_0x278e0e[_0x06d2('0x20')]?_[_0x06d2('0x22')](_0x278e0e[_0x06d2('0x20')],function(_0x29c699){return{'model':db[_0x29c699[_0x06d2('0x21')]],'as':_0x29c699['as'],'attributes':_0x29c699[_0x06d2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x06d2('0xc')](function(_0x56cd17){logger[_0x06d2('0x15')](_0x06d2('0x23'),_0x1e3f89);logger[_0x06d2('0xf')]('ShowDynamics365Account',_0x1e3f89,JSON['stringify'](_0x56cd17));_0x7816b7(_0x56cd17);})[_0x06d2('0x17')](function(_0x2e1312){logger[_0x06d2('0x12')]('ShowDynamics365Account',_0x2e1312[_0x06d2('0x14')],_0x1e3f89);_0x367281(_0x200245[_0x06d2('0x12')](0x1f4,_0x2e1312[_0x06d2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b39e89b..8071913 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 _0xda5b=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x122c32,_0x4d5a1e){var _0x1fa47d=function(_0x430baf){while(--_0x430baf){_0x122c32['push'](_0x122c32['shift']());}};_0x1fa47d(++_0x4d5a1e);}(_0xda5b,0x12d));var _0xbda5=function(_0x4d03d6,_0x438a06){_0x4d03d6=_0x4d03d6-0x0;var _0x22752e=_0xda5b[_0x4d03d6];return _0x22752e;};'use strict';var multer=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var path=require(_0xbda5('0x2'));var timeout=require(_0xbda5('0x3'));var express=require('express');var router=express[_0xbda5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbda5('0x5'));var interaction=require(_0xbda5('0x6'));var config=require(_0xbda5('0x7'));var controller=require(_0xbda5('0x8'));router['get']('/',auth[_0xbda5('0x9')](),controller['index']);router[_0xbda5('0xa')](_0xbda5('0xb'),auth[_0xbda5('0x9')](),controller[_0xbda5('0xc')]);router[_0xbda5('0xa')](_0xbda5('0xd'),auth[_0xbda5('0x9')](),controller['getFields']);router['get'](_0xbda5('0xe'),auth[_0xbda5('0x9')](),controller[_0xbda5('0xf')]);router[_0xbda5('0xa')](_0xbda5('0x10'),auth['isAuthenticated'](),controller[_0xbda5('0x11')]);router[_0xbda5('0x12')]('/',auth[_0xbda5('0x9')](),controller[_0xbda5('0x13')]);router[_0xbda5('0x14')](_0xbda5('0xb'),auth[_0xbda5('0x9')](),controller[_0xbda5('0x15')]);router[_0xbda5('0x16')](_0xbda5('0xb'),auth[_0xbda5('0x9')](),controller[_0xbda5('0x17')]);module[_0xbda5('0x18')]=router; \ No newline at end of file +var _0xda59=['getDescriptions','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions'];(function(_0x5d8694,_0x12b8c2){var _0x442111=function(_0x52f1eb){while(--_0x52f1eb){_0x5d8694['push'](_0x5d8694['shift']());}};_0x442111(++_0x12b8c2);}(_0xda59,0x1f3));var _0x9da5=function(_0x3b3d84,_0x4957df){_0x3b3d84=_0x3b3d84-0x0;var _0x3452cb=_0xda59[_0x3b3d84];return _0x3452cb;};'use strict';var multer=require(_0x9da5('0x0'));var util=require(_0x9da5('0x1'));var path=require(_0x9da5('0x2'));var timeout=require('connect-timeout');var express=require(_0x9da5('0x3'));var router=express[_0x9da5('0x4')]();var fs_extra=require(_0x9da5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9da5('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x9da5('0x7')]('/',auth[_0x9da5('0x8')](),controller['index']);router[_0x9da5('0x7')](_0x9da5('0x9'),auth[_0x9da5('0x8')](),controller['show']);router['get'](_0x9da5('0xa'),auth['isAuthenticated'](),controller[_0x9da5('0xb')]);router[_0x9da5('0x7')]('/:id/subjects',auth[_0x9da5('0x8')](),controller[_0x9da5('0xc')]);router['get'](_0x9da5('0xd'),auth['isAuthenticated'](),controller[_0x9da5('0xe')]);router[_0x9da5('0xf')]('/',auth[_0x9da5('0x8')](),controller['create']);router['put'](_0x9da5('0x9'),auth[_0x9da5('0x8')](),controller[_0x9da5('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9da5('0x11')]);module[_0x9da5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a300006..2fcbd89 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 _0xd575=['exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x513037,_0xeefa16){var _0x45dcc3=function(_0x118e77){while(--_0x118e77){_0x513037['push'](_0x513037['shift']());}};_0x45dcc3(++_0xeefa16);}(_0xd575,0x7e));var _0x5d57=function(_0x31611f,_0x1e6d20){_0x31611f=_0x31611f-0x0;var _0x3185e6=_0xd575[_0x31611f];return _0x3185e6;};'use strict';var Sequelize=require('sequelize');module[_0x5d57('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5d57('0x1')]},'ticketType':{'type':Sequelize[_0x5d57('0x2')](_0x5d57('0x3'),_0x5d57('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x5d57('0x2')](_0x5d57('0x5'),'nothing'),'defaultValue':_0x5d57('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x4a19=['STRING','incident','ENUM','contact','nothing','sequelize'];(function(_0xd5463,_0x1685cf){var _0x5bc896=function(_0x4ddc2c){while(--_0x4ddc2c){_0xd5463['push'](_0xd5463['shift']());}};_0x5bc896(++_0x1685cf);}(_0x4a19,0x1b5));var _0x94a1=function(_0x44c672,_0x89b247){_0x44c672=_0x44c672-0x0;var _0x419110=_0x4a19[_0x44c672];return _0x419110;};'use strict';var Sequelize=require(_0x94a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x94a1('0x1')]},'description':{'type':Sequelize[_0x94a1('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x94a1('0x2'),'phonecall'),'defaultValue':_0x94a1('0x2')},'moduleCreate':{'type':Sequelize[_0x94a1('0x3')](_0x94a1('0x4'),_0x94a1('0x5')),'defaultValue':_0x94a1('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 98a19d0..6280905 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 _0x6e3e=['json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','keys','length','options','create','body','find','findOne','Dynamics365Field','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4fe496,_0x1d8673){var _0x422b24=function(_0x27a644){while(--_0x27a644){_0x4fe496['push'](_0x4fe496['shift']());}};_0x422b24(++_0x1d8673);}(_0x6e3e,0x164));var _0xe6e3=function(_0x52a9f1,_0x45bde3){_0x52a9f1=_0x52a9f1-0x0;var _0x28dd4c=_0x6e3e[_0x52a9f1];return _0x28dd4c;};'use strict';var emlformat=require(_0xe6e3('0x0'));var rimraf=require(_0xe6e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe6e3('0x2'));var moment=require(_0xe6e3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe6e3('0x4'));var path=require(_0xe6e3('0x5'));var sox=require(_0xe6e3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6e3('0x7'));var _=require(_0xe6e3('0x8'));var squel=require('squel');var crypto=require(_0xe6e3('0x9'));var jsforce=require(_0xe6e3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe6e3('0xb'));var querystring=require(_0xe6e3('0xc'));var Papa=require(_0xe6e3('0xd'));var Redis=require('ioredis');var authService=require(_0xe6e3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe6e3('0xf'));var hardwareService=require(_0xe6e3('0x10'));var logger=require(_0xe6e3('0x11'))(_0xe6e3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe6e3('0x13'));var db=require(_0xe6e3('0x14'))['db'];function respondWithStatusCode(_0x2eae79,_0x2d8e85){_0x2d8e85=_0x2d8e85||0xcc;return function(_0x3832a6){if(_0x3832a6){return _0x2eae79[_0xe6e3('0x15')](_0x2d8e85);}return _0x2eae79[_0xe6e3('0x16')](_0x2d8e85)[_0xe6e3('0x17')]();};}function respondWithResult(_0x1c266c,_0x18ba81){_0x18ba81=_0x18ba81||0xc8;return function(_0x16b6c4){if(_0x16b6c4){return _0x1c266c['status'](_0x18ba81)[_0xe6e3('0x18')](_0x16b6c4);}};}function respondWithFilteredResult(_0x1e0a40,_0x1da5ea){return function(_0x1b02c1){if(_0x1b02c1){var _0xe0205a=typeof _0x1da5ea['offset']===_0xe6e3('0x19')&&typeof _0x1da5ea[_0xe6e3('0x1a')]==='undefined';var _0x33a44f=_0x1b02c1[_0xe6e3('0x1b')];var _0x253203=_0xe0205a?0x0:_0x1da5ea[_0xe6e3('0x1c')];var _0x56a7a6=_0xe0205a?_0x1b02c1[_0xe6e3('0x1b')]:_0x1da5ea[_0xe6e3('0x1c')]+_0x1da5ea[_0xe6e3('0x1a')];var _0x47401e;if(_0x56a7a6>=_0x33a44f){_0x56a7a6=_0x33a44f;_0x47401e=0xc8;}else{_0x47401e=0xce;}_0x1e0a40[_0xe6e3('0x16')](_0x47401e);return _0x1e0a40[_0xe6e3('0x1d')]('Content-Range',_0x253203+'-'+_0x56a7a6+'/'+_0x33a44f)['json'](_0x1b02c1);}return null;};}function patchUpdates(_0x5b9263){return function(_0x29d928){try{jsonpatch[_0xe6e3('0x1e')](_0x29d928,_0x5b9263,!![]);}catch(_0x340466){return BPromise[_0xe6e3('0x1f')](_0x340466);}return _0x29d928[_0xe6e3('0x20')]();};}function saveUpdates(_0x4ba269,_0x33d256){return function(_0x7e67b9){if(_0x7e67b9){return _0x7e67b9[_0xe6e3('0x21')](_0x4ba269)[_0xe6e3('0x22')](function(_0xaa157b){return _0xaa157b;});}return null;};}function removeEntity(_0x13ef45,_0x58f4dc){return function(_0x327a96){if(_0x327a96){return _0x327a96[_0xe6e3('0x23')]()[_0xe6e3('0x22')](function(){_0x13ef45[_0xe6e3('0x16')](0xcc)[_0xe6e3('0x17')]();});}};}function handleEntityNotFound(_0x5e2500,_0x3d0c9e){return function(_0x47e05f){if(!_0x47e05f){_0x5e2500[_0xe6e3('0x15')](0x194);}return _0x47e05f;};}function handleError(_0x4bbbf6,_0x4eac47){_0x4eac47=_0x4eac47||0x1f4;return function(_0x44203c){logger[_0xe6e3('0x24')](_0x44203c['stack']);if(_0x44203c['name']){delete _0x44203c[_0xe6e3('0x25')];}_0x4bbbf6['status'](_0x4eac47)[_0xe6e3('0x26')](_0x44203c);};}exports[_0xe6e3('0x27')]=function(_0x44de99,_0xaf939c){var _0x13ba2a={},_0x1f14e5={},_0x3467ee={'count':0x0,'rows':[]};var _0x5b2221=_[_0xe6e3('0x28')](db[_0xe6e3('0x29')][_0xe6e3('0x2a')],function(_0x26fb35){return{'name':_0x26fb35[_0xe6e3('0x2b')],'type':_0x26fb35[_0xe6e3('0x2c')]['key']};});_0x1f14e5['model']=_[_0xe6e3('0x28')](_0x5b2221,_0xe6e3('0x25'));_0x1f14e5[_0xe6e3('0x2d')]=_['keys'](_0x44de99[_0xe6e3('0x2d')]);_0x1f14e5[_0xe6e3('0x2e')]=_[_0xe6e3('0x2f')](_0x1f14e5['model'],_0x1f14e5[_0xe6e3('0x2d')]);_0x13ba2a[_0xe6e3('0x30')]=_[_0xe6e3('0x2f')](_0x1f14e5['model'],qs[_0xe6e3('0x31')](_0x44de99['query'][_0xe6e3('0x31')]));_0x13ba2a[_0xe6e3('0x30')]=_0x13ba2a['attributes']['length']?_0x13ba2a[_0xe6e3('0x30')]:_0x1f14e5[_0xe6e3('0x32')];if(!_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x33')](_0xe6e3('0x34'))){_0x13ba2a[_0xe6e3('0x1a')]=qs[_0xe6e3('0x1a')](_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x1a')]);_0x13ba2a[_0xe6e3('0x1c')]=qs[_0xe6e3('0x1c')](_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x1c')]);}_0x13ba2a['order']=qs[_0xe6e3('0x35')](_0x44de99['query'][_0xe6e3('0x35')]);_0x13ba2a[_0xe6e3('0x36')]=qs[_0xe6e3('0x2e')](_[_0xe6e3('0x37')](_0x44de99[_0xe6e3('0x2d')],_0x1f14e5[_0xe6e3('0x2e')]),_0x5b2221);if(_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x38')]){_0x13ba2a[_0xe6e3('0x36')]=_[_0xe6e3('0x39')](_0x13ba2a[_0xe6e3('0x36')],{'$or':_[_0xe6e3('0x28')](_0x5b2221,function(_0xe50336){if(_0xe50336['type']!=='VIRTUAL'){var _0x382cd3={};_0x382cd3[_0xe50336['name']]={'$like':'%'+_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x38')]+'%'};return _0x382cd3;}})});}_0x13ba2a=_[_0xe6e3('0x39')]({},_0x13ba2a,_0x44de99['options']);var _0xd45f4f={'where':_0x13ba2a['where']};return db[_0xe6e3('0x29')][_0xe6e3('0x1b')](_0xd45f4f)[_0xe6e3('0x22')](function(_0x5ec4ec){_0x3467ee[_0xe6e3('0x1b')]=_0x5ec4ec;if(_0x44de99[_0xe6e3('0x2d')][_0xe6e3('0x3a')]){_0x13ba2a[_0xe6e3('0x3b')]=[{'all':!![]}];}return db[_0xe6e3('0x29')][_0xe6e3('0x3c')](_0x13ba2a);})['then'](function(_0x539ac4){_0x3467ee[_0xe6e3('0x3d')]=_0x539ac4;return _0x3467ee;})['then'](respondWithFilteredResult(_0xaf939c,_0x13ba2a))[_0xe6e3('0x3e')](handleError(_0xaf939c,null));};exports['show']=function(_0x44655a,_0x1f7360){var _0x1acf63={'raw':![],'where':{'id':_0x44655a[_0xe6e3('0x3f')]['id']}},_0x364caf={};_0x364caf[_0xe6e3('0x32')]=_['keys'](db['Dynamics365Configuration'][_0xe6e3('0x2a')]);_0x364caf[_0xe6e3('0x2d')]=_[_0xe6e3('0x40')](_0x44655a['query']);_0x364caf['filters']=_[_0xe6e3('0x2f')](_0x364caf[_0xe6e3('0x32')],_0x364caf['query']);_0x1acf63[_0xe6e3('0x30')]=_[_0xe6e3('0x2f')](_0x364caf[_0xe6e3('0x32')],qs[_0xe6e3('0x31')](_0x44655a[_0xe6e3('0x2d')][_0xe6e3('0x31')]));_0x1acf63[_0xe6e3('0x30')]=_0x1acf63[_0xe6e3('0x30')][_0xe6e3('0x41')]?_0x1acf63['attributes']:_0x364caf[_0xe6e3('0x32')];if(_0x44655a[_0xe6e3('0x2d')][_0xe6e3('0x3a')]){_0x1acf63[_0xe6e3('0x3b')]=[{'all':!![]}];}_0x1acf63=_['merge']({},_0x1acf63,_0x44655a[_0xe6e3('0x42')]);return db[_0xe6e3('0x29')]['find'](_0x1acf63)[_0xe6e3('0x22')](handleEntityNotFound(_0x1f7360,null))[_0xe6e3('0x22')](respondWithResult(_0x1f7360,null))[_0xe6e3('0x3e')](handleError(_0x1f7360,null));};exports[_0xe6e3('0x43')]=function(_0x5deb27,_0x334deb){return db[_0xe6e3('0x29')][_0xe6e3('0x43')](_0x5deb27['body'],{})[_0xe6e3('0x22')](respondWithResult(_0x334deb,0xc9))[_0xe6e3('0x3e')](handleError(_0x334deb,null));};exports[_0xe6e3('0x21')]=function(_0x38a293,_0x3502a9){if(_0x38a293['body']['id']){delete _0x38a293[_0xe6e3('0x44')]['id'];}return db[_0xe6e3('0x29')][_0xe6e3('0x45')]({'where':{'id':_0x38a293['params']['id']}})[_0xe6e3('0x22')](handleEntityNotFound(_0x3502a9,null))['then'](saveUpdates(_0x38a293[_0xe6e3('0x44')],null))['then'](respondWithResult(_0x3502a9,null))[_0xe6e3('0x3e')](handleError(_0x3502a9,null));};exports[_0xe6e3('0x23')]=function(_0x546325,_0x2e361d){return db[_0xe6e3('0x29')]['find']({'where':{'id':_0x546325['params']['id']}})[_0xe6e3('0x22')](handleEntityNotFound(_0x2e361d,null))['then'](removeEntity(_0x2e361d,null))[_0xe6e3('0x3e')](handleError(_0x2e361d,null));};exports['getFields']=function(_0x390db5,_0x49ab9f,_0x539410){var _0xb32e16={};var _0x299471={};var _0x40b5d6;var _0x3ada68;return db[_0xe6e3('0x29')][_0xe6e3('0x46')]({'where':{'id':_0x390db5[_0xe6e3('0x3f')]['id']}})[_0xe6e3('0x22')](handleEntityNotFound(_0x49ab9f,null))['then'](function(_0x4efb4e){if(_0x4efb4e){_0x40b5d6=_0x4efb4e;_0x299471[_0xe6e3('0x32')]=_[_0xe6e3('0x40')](db[_0xe6e3('0x47')][_0xe6e3('0x2a')]);_0x299471['query']=_[_0xe6e3('0x40')](_0x390db5[_0xe6e3('0x2d')]);_0x299471[_0xe6e3('0x2e')]=_['intersection'](_0x299471[_0xe6e3('0x32')],_0x299471[_0xe6e3('0x2d')]);_0xb32e16[_0xe6e3('0x30')]=_[_0xe6e3('0x2f')](_0x299471['model'],qs[_0xe6e3('0x31')](_0x390db5[_0xe6e3('0x2d')][_0xe6e3('0x31')]));_0xb32e16[_0xe6e3('0x30')]=_0xb32e16[_0xe6e3('0x30')]['length']?_0xb32e16['attributes']:_0x299471['model'];_0xb32e16[_0xe6e3('0x48')]=qs[_0xe6e3('0x35')](_0x390db5['query'][_0xe6e3('0x35')]);_0xb32e16[_0xe6e3('0x36')]=qs[_0xe6e3('0x2e')](_['pick'](_0x390db5['query'],_0x299471[_0xe6e3('0x2e')]));if(_0x390db5[_0xe6e3('0x2d')][_0xe6e3('0x38')]){_0xb32e16['where']=_[_0xe6e3('0x39')](_0xb32e16[_0xe6e3('0x36')],{'$or':_['map'](_0xb32e16[_0xe6e3('0x30')],function(_0x178d15){var _0x411259={};_0x411259[_0x178d15]={'$like':'%'+_0x390db5[_0xe6e3('0x2d')][_0xe6e3('0x38')]+'%'};return _0x411259;})});}_0xb32e16=_[_0xe6e3('0x39')]({},_0xb32e16,_0x390db5[_0xe6e3('0x42')]);return _0x40b5d6[_0xe6e3('0x49')](_0xb32e16);}})['then'](function(_0x3ab4dc){if(_0x3ab4dc){_0x3ada68=_0x3ab4dc[_0xe6e3('0x41')];if(!_0x390db5[_0xe6e3('0x2d')][_0xe6e3('0x33')](_0xe6e3('0x34'))){_0xb32e16[_0xe6e3('0x1a')]=qs[_0xe6e3('0x1a')](_0x390db5[_0xe6e3('0x2d')][_0xe6e3('0x1a')]);_0xb32e16[_0xe6e3('0x1c')]=qs[_0xe6e3('0x1c')](_0x390db5[_0xe6e3('0x2d')]['offset']);}return _0x40b5d6[_0xe6e3('0x49')](_0xb32e16);}})[_0xe6e3('0x22')](function(_0x182f25){if(_0x182f25){return _0x182f25?{'count':_0x3ada68,'rows':_0x182f25}:null;}})['then'](respondWithResult(_0x49ab9f,null))['catch'](handleError(_0x49ab9f,null));};exports[_0xe6e3('0x4a')]=function(_0x3333b8,_0x2a9e73,_0x168c12){var _0x15bf27={};var _0x3e51cb={};var _0x1de461;var _0xd1edb8;return db[_0xe6e3('0x29')][_0xe6e3('0x46')]({'where':{'id':_0x3333b8[_0xe6e3('0x3f')]['id']}})[_0xe6e3('0x22')](handleEntityNotFound(_0x2a9e73,null))[_0xe6e3('0x22')](function(_0x34b9f7){if(_0x34b9f7){_0x1de461=_0x34b9f7;_0x3e51cb['model']=_[_0xe6e3('0x40')](db[_0xe6e3('0x47')][_0xe6e3('0x2a')]);_0x3e51cb[_0xe6e3('0x2d')]=_[_0xe6e3('0x40')](_0x3333b8[_0xe6e3('0x2d')]);_0x3e51cb[_0xe6e3('0x2e')]=_[_0xe6e3('0x2f')](_0x3e51cb[_0xe6e3('0x32')],_0x3e51cb['query']);_0x15bf27['attributes']=_[_0xe6e3('0x2f')](_0x3e51cb[_0xe6e3('0x32')],qs['fields'](_0x3333b8['query'][_0xe6e3('0x31')]));_0x15bf27[_0xe6e3('0x30')]=_0x15bf27[_0xe6e3('0x30')][_0xe6e3('0x41')]?_0x15bf27['attributes']:_0x3e51cb[_0xe6e3('0x32')];_0x15bf27[_0xe6e3('0x48')]=qs[_0xe6e3('0x35')](_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x35')]);_0x15bf27[_0xe6e3('0x36')]=qs['filters'](_[_0xe6e3('0x37')](_0x3333b8[_0xe6e3('0x2d')],_0x3e51cb['filters']));if(_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x38')]){_0x15bf27[_0xe6e3('0x36')]=_[_0xe6e3('0x39')](_0x15bf27[_0xe6e3('0x36')],{'$or':_[_0xe6e3('0x28')](_0x15bf27['attributes'],function(_0x564726){var _0x2620be={};_0x2620be[_0x564726]={'$like':'%'+_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x38')]+'%'};return _0x2620be;})});}_0x15bf27=_[_0xe6e3('0x39')]({},_0x15bf27,_0x3333b8['options']);return _0x1de461[_0xe6e3('0x4a')](_0x15bf27);}})[_0xe6e3('0x22')](function(_0x619e1b){if(_0x619e1b){_0xd1edb8=_0x619e1b['length'];if(!_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x33')](_0xe6e3('0x34'))){_0x15bf27[_0xe6e3('0x1a')]=qs['limit'](_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x1a')]);_0x15bf27['offset']=qs[_0xe6e3('0x1c')](_0x3333b8[_0xe6e3('0x2d')][_0xe6e3('0x1c')]);}return _0x1de461[_0xe6e3('0x4a')](_0x15bf27);}})[_0xe6e3('0x22')](function(_0x536bb1){if(_0x536bb1){return _0x536bb1?{'count':_0xd1edb8,'rows':_0x536bb1}:null;}})['then'](respondWithResult(_0x2a9e73,null))[_0xe6e3('0x3e')](handleError(_0x2a9e73,null));};exports['getDescriptions']=function(_0x5ba410,_0x3b4fdc,_0x345a6d){var _0x5ec3fc={};var _0x342232={};var _0x4a3ed9;var _0x30a9b9;return db['Dynamics365Configuration'][_0xe6e3('0x46')]({'where':{'id':_0x5ba410[_0xe6e3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b4fdc,null))[_0xe6e3('0x22')](function(_0x460214){if(_0x460214){_0x4a3ed9=_0x460214;_0x342232['model']=_[_0xe6e3('0x40')](db[_0xe6e3('0x47')][_0xe6e3('0x2a')]);_0x342232['query']=_[_0xe6e3('0x40')](_0x5ba410[_0xe6e3('0x2d')]);_0x342232[_0xe6e3('0x2e')]=_[_0xe6e3('0x2f')](_0x342232[_0xe6e3('0x32')],_0x342232[_0xe6e3('0x2d')]);_0x5ec3fc[_0xe6e3('0x30')]=_[_0xe6e3('0x2f')](_0x342232[_0xe6e3('0x32')],qs[_0xe6e3('0x31')](_0x5ba410[_0xe6e3('0x2d')][_0xe6e3('0x31')]));_0x5ec3fc[_0xe6e3('0x30')]=_0x5ec3fc['attributes'][_0xe6e3('0x41')]?_0x5ec3fc[_0xe6e3('0x30')]:_0x342232['model'];_0x5ec3fc[_0xe6e3('0x48')]=qs[_0xe6e3('0x35')](_0x5ba410['query'][_0xe6e3('0x35')]);_0x5ec3fc[_0xe6e3('0x36')]=qs[_0xe6e3('0x2e')](_[_0xe6e3('0x37')](_0x5ba410[_0xe6e3('0x2d')],_0x342232[_0xe6e3('0x2e')]));if(_0x5ba410[_0xe6e3('0x2d')][_0xe6e3('0x38')]){_0x5ec3fc[_0xe6e3('0x36')]=_[_0xe6e3('0x39')](_0x5ec3fc['where'],{'$or':_[_0xe6e3('0x28')](_0x5ec3fc[_0xe6e3('0x30')],function(_0xf6be85){var _0x2a791b={};_0x2a791b[_0xf6be85]={'$like':'%'+_0x5ba410[_0xe6e3('0x2d')][_0xe6e3('0x38')]+'%'};return _0x2a791b;})});}_0x5ec3fc=_[_0xe6e3('0x39')]({},_0x5ec3fc,_0x5ba410['options']);return _0x4a3ed9[_0xe6e3('0x4b')](_0x5ec3fc);}})[_0xe6e3('0x22')](function(_0x48115f){if(_0x48115f){_0x30a9b9=_0x48115f[_0xe6e3('0x41')];if(!_0x5ba410[_0xe6e3('0x2d')]['hasOwnProperty']('nolimit')){_0x5ec3fc[_0xe6e3('0x1a')]=qs[_0xe6e3('0x1a')](_0x5ba410['query'][_0xe6e3('0x1a')]);_0x5ec3fc[_0xe6e3('0x1c')]=qs[_0xe6e3('0x1c')](_0x5ba410['query'][_0xe6e3('0x1c')]);}return _0x4a3ed9[_0xe6e3('0x4b')](_0x5ec3fc);}})[_0xe6e3('0x22')](function(_0x409748){if(_0x409748){return _0x409748?{'count':_0x30a9b9,'rows':_0x409748}:null;}})[_0xe6e3('0x22')](respondWithResult(_0x3b4fdc,null))['catch'](handleError(_0x3b4fdc,null));}; \ No newline at end of file +var _0x3e06=['offset','set','Content-Range','save','update','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','include','then','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count'];(function(_0x41525f,_0x206de7){var _0x1332c6=function(_0x112878){while(--_0x112878){_0x41525f['push'](_0x41525f['shift']());}};_0x1332c6(++_0x206de7);}(_0x3e06,0x7d));var _0x63e0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3e06[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63e0('0x0'));var zipdir=require(_0x63e0('0x1'));var jsonpatch=require(_0x63e0('0x2'));var rp=require(_0x63e0('0x3'));var moment=require(_0x63e0('0x4'));var BPromise=require(_0x63e0('0x5'));var Mustache=require(_0x63e0('0x6'));var util=require(_0x63e0('0x7'));var path=require(_0x63e0('0x8'));var sox=require(_0x63e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63e0('0xa'));var squel=require('squel');var crypto=require(_0x63e0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x63e0('0xc'));var toCsv=require(_0x63e0('0xd'));var querystring=require(_0x63e0('0xe'));var Papa=require(_0x63e0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63e0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63e0('0x11'));var logger=require('../../config/logger')(_0x63e0('0x12'));var utils=require(_0x63e0('0x13'));var config=require(_0x63e0('0x14'));var licenseUtil=require(_0x63e0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x308b51,_0x378e1f){_0x378e1f=_0x378e1f||0xcc;return function(_0x41e942){if(_0x41e942){return _0x308b51[_0x63e0('0x16')](_0x378e1f);}return _0x308b51['status'](_0x378e1f)[_0x63e0('0x17')]();};}function respondWithResult(_0x4dff2b,_0x277948){_0x277948=_0x277948||0xc8;return function(_0x4422ea){if(_0x4422ea){return _0x4dff2b[_0x63e0('0x18')](_0x277948)[_0x63e0('0x19')](_0x4422ea);}};}function respondWithFilteredResult(_0x1c08e6,_0x132d94){return function(_0x4d7bdd){if(_0x4d7bdd){var _0x4431ac=typeof _0x132d94['offset']===_0x63e0('0x1a')&&typeof _0x132d94[_0x63e0('0x1b')]===_0x63e0('0x1a');var _0x753b2d=_0x4d7bdd[_0x63e0('0x1c')];var _0x22617f=_0x4431ac?0x0:_0x132d94[_0x63e0('0x1d')];var _0x5e78f3=_0x4431ac?_0x4d7bdd[_0x63e0('0x1c')]:_0x132d94[_0x63e0('0x1d')]+_0x132d94[_0x63e0('0x1b')];var _0x35f615;if(_0x5e78f3>=_0x753b2d){_0x5e78f3=_0x753b2d;_0x35f615=0xc8;}else{_0x35f615=0xce;}_0x1c08e6[_0x63e0('0x18')](_0x35f615);return _0x1c08e6[_0x63e0('0x1e')](_0x63e0('0x1f'),_0x22617f+'-'+_0x5e78f3+'/'+_0x753b2d)[_0x63e0('0x19')](_0x4d7bdd);}return null;};}function patchUpdates(_0x551974){return function(_0x450068){try{jsonpatch['apply'](_0x450068,_0x551974,!![]);}catch(_0x12c5c4){return BPromise['reject'](_0x12c5c4);}return _0x450068[_0x63e0('0x20')]();};}function saveUpdates(_0x5e88d1,_0x4487bd){return function(_0x6d0df0){if(_0x6d0df0){return _0x6d0df0[_0x63e0('0x21')](_0x5e88d1)['then'](function(_0x4f5b2c){return _0x4f5b2c;});}return null;};}function removeEntity(_0xc53a05,_0x33179e){return function(_0x3382d1){if(_0x3382d1){return _0x3382d1[_0x63e0('0x22')]()['then'](function(){_0xc53a05[_0x63e0('0x18')](0xcc)[_0x63e0('0x17')]();});}};}function handleEntityNotFound(_0x58be5f,_0x44c5a7){return function(_0x556335){if(!_0x556335){_0x58be5f[_0x63e0('0x16')](0x194);}return _0x556335;};}function handleError(_0x387495,_0x137fd8){_0x137fd8=_0x137fd8||0x1f4;return function(_0x55f462){logger[_0x63e0('0x23')](_0x55f462['stack']);if(_0x55f462['name']){delete _0x55f462[_0x63e0('0x24')];}_0x387495[_0x63e0('0x18')](_0x137fd8)[_0x63e0('0x25')](_0x55f462);};}exports[_0x63e0('0x26')]=function(_0x4ca011,_0x5d62a9){var _0x4b6ba4={},_0x5d4eb9={},_0x151e72={'count':0x0,'rows':[]};var _0x16a747=_[_0x63e0('0x27')](db['Dynamics365Configuration'][_0x63e0('0x28')],function(_0x1f3524){return{'name':_0x1f3524[_0x63e0('0x29')],'type':_0x1f3524[_0x63e0('0x2a')][_0x63e0('0x2b')]};});_0x5d4eb9[_0x63e0('0x2c')]=_[_0x63e0('0x27')](_0x16a747,'name');_0x5d4eb9['query']=_[_0x63e0('0x2d')](_0x4ca011['query']);_0x5d4eb9[_0x63e0('0x2e')]=_[_0x63e0('0x2f')](_0x5d4eb9['model'],_0x5d4eb9[_0x63e0('0x30')]);_0x4b6ba4[_0x63e0('0x31')]=_[_0x63e0('0x2f')](_0x5d4eb9[_0x63e0('0x2c')],qs[_0x63e0('0x32')](_0x4ca011[_0x63e0('0x30')]['fields']));_0x4b6ba4[_0x63e0('0x31')]=_0x4b6ba4[_0x63e0('0x31')][_0x63e0('0x33')]?_0x4b6ba4[_0x63e0('0x31')]:_0x5d4eb9['model'];if(!_0x4ca011[_0x63e0('0x30')][_0x63e0('0x34')](_0x63e0('0x35'))){_0x4b6ba4[_0x63e0('0x1b')]=qs[_0x63e0('0x1b')](_0x4ca011['query'][_0x63e0('0x1b')]);_0x4b6ba4[_0x63e0('0x1d')]=qs[_0x63e0('0x1d')](_0x4ca011['query'][_0x63e0('0x1d')]);}_0x4b6ba4[_0x63e0('0x36')]=qs['sort'](_0x4ca011[_0x63e0('0x30')][_0x63e0('0x37')]);_0x4b6ba4[_0x63e0('0x38')]=qs[_0x63e0('0x2e')](_[_0x63e0('0x39')](_0x4ca011['query'],_0x5d4eb9[_0x63e0('0x2e')]),_0x16a747);if(_0x4ca011['query'][_0x63e0('0x3a')]){_0x4b6ba4[_0x63e0('0x38')]=_[_0x63e0('0x3b')](_0x4b6ba4[_0x63e0('0x38')],{'$or':_[_0x63e0('0x27')](_0x16a747,function(_0x3df873){if(_0x3df873[_0x63e0('0x2a')]!==_0x63e0('0x3c')){var _0x8aef8={};_0x8aef8[_0x3df873[_0x63e0('0x24')]]={'$like':'%'+_0x4ca011[_0x63e0('0x30')]['filter']+'%'};return _0x8aef8;}})});}_0x4b6ba4=_[_0x63e0('0x3b')]({},_0x4b6ba4,_0x4ca011[_0x63e0('0x3d')]);var _0x547e47={'where':_0x4b6ba4[_0x63e0('0x38')]};return db[_0x63e0('0x3e')]['count'](_0x547e47)['then'](function(_0x5b9cf3){_0x151e72['count']=_0x5b9cf3;if(_0x4ca011['query']['includeAll']){_0x4b6ba4[_0x63e0('0x3f')]=[{'all':!![]}];}return db[_0x63e0('0x3e')]['findAll'](_0x4b6ba4);})[_0x63e0('0x40')](function(_0x184ad2){_0x151e72[_0x63e0('0x41')]=_0x184ad2;return _0x151e72;})[_0x63e0('0x40')](respondWithFilteredResult(_0x5d62a9,_0x4b6ba4))[_0x63e0('0x42')](handleError(_0x5d62a9,null));};exports[_0x63e0('0x43')]=function(_0x222b1,_0x1ccaf8){var _0x15f5ad={'raw':![],'where':{'id':_0x222b1[_0x63e0('0x44')]['id']}},_0x2cb0c2={};_0x2cb0c2[_0x63e0('0x2c')]=_['keys'](db[_0x63e0('0x3e')]['rawAttributes']);_0x2cb0c2[_0x63e0('0x30')]=_[_0x63e0('0x2d')](_0x222b1[_0x63e0('0x30')]);_0x2cb0c2[_0x63e0('0x2e')]=_[_0x63e0('0x2f')](_0x2cb0c2[_0x63e0('0x2c')],_0x2cb0c2[_0x63e0('0x30')]);_0x15f5ad['attributes']=_[_0x63e0('0x2f')](_0x2cb0c2[_0x63e0('0x2c')],qs[_0x63e0('0x32')](_0x222b1[_0x63e0('0x30')][_0x63e0('0x32')]));_0x15f5ad[_0x63e0('0x31')]=_0x15f5ad[_0x63e0('0x31')]['length']?_0x15f5ad['attributes']:_0x2cb0c2['model'];if(_0x222b1['query'][_0x63e0('0x45')]){_0x15f5ad[_0x63e0('0x3f')]=[{'all':!![]}];}_0x15f5ad=_[_0x63e0('0x3b')]({},_0x15f5ad,_0x222b1[_0x63e0('0x3d')]);return db[_0x63e0('0x3e')][_0x63e0('0x46')](_0x15f5ad)[_0x63e0('0x40')](handleEntityNotFound(_0x1ccaf8,null))[_0x63e0('0x40')](respondWithResult(_0x1ccaf8,null))['catch'](handleError(_0x1ccaf8,null));};exports[_0x63e0('0x47')]=function(_0x2e2873,_0x5f4614){return db[_0x63e0('0x3e')][_0x63e0('0x47')](_0x2e2873[_0x63e0('0x48')],{})[_0x63e0('0x40')](respondWithResult(_0x5f4614,0xc9))[_0x63e0('0x42')](handleError(_0x5f4614,null));};exports[_0x63e0('0x21')]=function(_0xa86ab6,_0x150825){if(_0xa86ab6[_0x63e0('0x48')]['id']){delete _0xa86ab6[_0x63e0('0x48')]['id'];}return db[_0x63e0('0x3e')][_0x63e0('0x46')]({'where':{'id':_0xa86ab6[_0x63e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x150825,null))[_0x63e0('0x40')](saveUpdates(_0xa86ab6[_0x63e0('0x48')],null))[_0x63e0('0x40')](respondWithResult(_0x150825,null))[_0x63e0('0x42')](handleError(_0x150825,null));};exports[_0x63e0('0x22')]=function(_0x22196a,_0x1eb95f){return db[_0x63e0('0x3e')]['find']({'where':{'id':_0x22196a[_0x63e0('0x44')]['id']}})[_0x63e0('0x40')](handleEntityNotFound(_0x1eb95f,null))[_0x63e0('0x40')](removeEntity(_0x1eb95f,null))[_0x63e0('0x42')](handleError(_0x1eb95f,null));};exports[_0x63e0('0x49')]=function(_0x21c847,_0x32685f,_0x209efd){var _0x24584d={};var _0x6c571c={};var _0x5859d8;var _0x3dba1e;return db[_0x63e0('0x3e')][_0x63e0('0x4a')]({'where':{'id':_0x21c847[_0x63e0('0x44')]['id']}})[_0x63e0('0x40')](handleEntityNotFound(_0x32685f,null))[_0x63e0('0x40')](function(_0x1d8392){if(_0x1d8392){_0x5859d8=_0x1d8392;_0x6c571c[_0x63e0('0x2c')]=_[_0x63e0('0x2d')](db[_0x63e0('0x4b')][_0x63e0('0x28')]);_0x6c571c[_0x63e0('0x30')]=_[_0x63e0('0x2d')](_0x21c847[_0x63e0('0x30')]);_0x6c571c[_0x63e0('0x2e')]=_[_0x63e0('0x2f')](_0x6c571c[_0x63e0('0x2c')],_0x6c571c['query']);_0x24584d['attributes']=_['intersection'](_0x6c571c['model'],qs[_0x63e0('0x32')](_0x21c847[_0x63e0('0x30')][_0x63e0('0x32')]));_0x24584d[_0x63e0('0x31')]=_0x24584d[_0x63e0('0x31')][_0x63e0('0x33')]?_0x24584d[_0x63e0('0x31')]:_0x6c571c['model'];_0x24584d[_0x63e0('0x36')]=qs[_0x63e0('0x37')](_0x21c847[_0x63e0('0x30')][_0x63e0('0x37')]);_0x24584d[_0x63e0('0x38')]=qs[_0x63e0('0x2e')](_[_0x63e0('0x39')](_0x21c847[_0x63e0('0x30')],_0x6c571c[_0x63e0('0x2e')]));if(_0x21c847[_0x63e0('0x30')][_0x63e0('0x3a')]){_0x24584d[_0x63e0('0x38')]=_[_0x63e0('0x3b')](_0x24584d[_0x63e0('0x38')],{'$or':_[_0x63e0('0x27')](_0x24584d['attributes'],function(_0x2b7aaa){var _0x74daa9={};_0x74daa9[_0x2b7aaa]={'$like':'%'+_0x21c847[_0x63e0('0x30')]['filter']+'%'};return _0x74daa9;})});}_0x24584d=_[_0x63e0('0x3b')]({},_0x24584d,_0x21c847[_0x63e0('0x3d')]);return _0x5859d8[_0x63e0('0x49')](_0x24584d);}})[_0x63e0('0x40')](function(_0x3695a1){if(_0x3695a1){_0x3dba1e=_0x3695a1[_0x63e0('0x33')];if(!_0x21c847[_0x63e0('0x30')][_0x63e0('0x34')](_0x63e0('0x35'))){_0x24584d[_0x63e0('0x1b')]=qs[_0x63e0('0x1b')](_0x21c847['query'][_0x63e0('0x1b')]);_0x24584d[_0x63e0('0x1d')]=qs[_0x63e0('0x1d')](_0x21c847['query'][_0x63e0('0x1d')]);}return _0x5859d8[_0x63e0('0x49')](_0x24584d);}})[_0x63e0('0x40')](function(_0x5b84c7){if(_0x5b84c7){return _0x5b84c7?{'count':_0x3dba1e,'rows':_0x5b84c7}:null;}})[_0x63e0('0x40')](respondWithResult(_0x32685f,null))[_0x63e0('0x42')](handleError(_0x32685f,null));};exports[_0x63e0('0x4c')]=function(_0x443b43,_0x55fdb6,_0x42d6ee){var _0x5def22={};var _0x5a9d39={};var _0x5a9d80;var _0x5db41c;return db[_0x63e0('0x3e')]['findOne']({'where':{'id':_0x443b43[_0x63e0('0x44')]['id']}})[_0x63e0('0x40')](handleEntityNotFound(_0x55fdb6,null))[_0x63e0('0x40')](function(_0x275099){if(_0x275099){_0x5a9d80=_0x275099;_0x5a9d39[_0x63e0('0x2c')]=_['keys'](db[_0x63e0('0x4b')][_0x63e0('0x28')]);_0x5a9d39[_0x63e0('0x30')]=_[_0x63e0('0x2d')](_0x443b43[_0x63e0('0x30')]);_0x5a9d39[_0x63e0('0x2e')]=_['intersection'](_0x5a9d39[_0x63e0('0x2c')],_0x5a9d39[_0x63e0('0x30')]);_0x5def22[_0x63e0('0x31')]=_[_0x63e0('0x2f')](_0x5a9d39[_0x63e0('0x2c')],qs[_0x63e0('0x32')](_0x443b43['query'][_0x63e0('0x32')]));_0x5def22[_0x63e0('0x31')]=_0x5def22[_0x63e0('0x31')]['length']?_0x5def22['attributes']:_0x5a9d39[_0x63e0('0x2c')];_0x5def22[_0x63e0('0x36')]=qs[_0x63e0('0x37')](_0x443b43[_0x63e0('0x30')][_0x63e0('0x37')]);_0x5def22[_0x63e0('0x38')]=qs[_0x63e0('0x2e')](_['pick'](_0x443b43[_0x63e0('0x30')],_0x5a9d39[_0x63e0('0x2e')]));if(_0x443b43[_0x63e0('0x30')][_0x63e0('0x3a')]){_0x5def22[_0x63e0('0x38')]=_['merge'](_0x5def22[_0x63e0('0x38')],{'$or':_[_0x63e0('0x27')](_0x5def22[_0x63e0('0x31')],function(_0x307c78){var _0x31ebc9={};_0x31ebc9[_0x307c78]={'$like':'%'+_0x443b43[_0x63e0('0x30')][_0x63e0('0x3a')]+'%'};return _0x31ebc9;})});}_0x5def22=_['merge']({},_0x5def22,_0x443b43[_0x63e0('0x3d')]);return _0x5a9d80[_0x63e0('0x4c')](_0x5def22);}})[_0x63e0('0x40')](function(_0x34877a){if(_0x34877a){_0x5db41c=_0x34877a[_0x63e0('0x33')];if(!_0x443b43[_0x63e0('0x30')][_0x63e0('0x34')]('nolimit')){_0x5def22['limit']=qs[_0x63e0('0x1b')](_0x443b43[_0x63e0('0x30')][_0x63e0('0x1b')]);_0x5def22[_0x63e0('0x1d')]=qs[_0x63e0('0x1d')](_0x443b43[_0x63e0('0x30')][_0x63e0('0x1d')]);}return _0x5a9d80['getSubjects'](_0x5def22);}})[_0x63e0('0x40')](function(_0x4c3a7a){if(_0x4c3a7a){return _0x4c3a7a?{'count':_0x5db41c,'rows':_0x4c3a7a}:null;}})[_0x63e0('0x40')](respondWithResult(_0x55fdb6,null))['catch'](handleError(_0x55fdb6,null));};exports['getDescriptions']=function(_0x13b708,_0x5075c7,_0x465137){var _0x19066d={};var _0x14b321={};var _0x375fd2;var _0x3c8862;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x13b708[_0x63e0('0x44')]['id']}})[_0x63e0('0x40')](handleEntityNotFound(_0x5075c7,null))[_0x63e0('0x40')](function(_0x5876b4){if(_0x5876b4){_0x375fd2=_0x5876b4;_0x14b321[_0x63e0('0x2c')]=_[_0x63e0('0x2d')](db['Dynamics365Field'][_0x63e0('0x28')]);_0x14b321[_0x63e0('0x30')]=_['keys'](_0x13b708['query']);_0x14b321[_0x63e0('0x2e')]=_[_0x63e0('0x2f')](_0x14b321[_0x63e0('0x2c')],_0x14b321['query']);_0x19066d['attributes']=_[_0x63e0('0x2f')](_0x14b321[_0x63e0('0x2c')],qs[_0x63e0('0x32')](_0x13b708[_0x63e0('0x30')][_0x63e0('0x32')]));_0x19066d[_0x63e0('0x31')]=_0x19066d[_0x63e0('0x31')][_0x63e0('0x33')]?_0x19066d['attributes']:_0x14b321[_0x63e0('0x2c')];_0x19066d[_0x63e0('0x36')]=qs[_0x63e0('0x37')](_0x13b708[_0x63e0('0x30')][_0x63e0('0x37')]);_0x19066d['where']=qs[_0x63e0('0x2e')](_[_0x63e0('0x39')](_0x13b708[_0x63e0('0x30')],_0x14b321[_0x63e0('0x2e')]));if(_0x13b708[_0x63e0('0x30')][_0x63e0('0x3a')]){_0x19066d[_0x63e0('0x38')]=_[_0x63e0('0x3b')](_0x19066d['where'],{'$or':_['map'](_0x19066d[_0x63e0('0x31')],function(_0x571210){var _0x35e20c={};_0x35e20c[_0x571210]={'$like':'%'+_0x13b708[_0x63e0('0x30')][_0x63e0('0x3a')]+'%'};return _0x35e20c;})});}_0x19066d=_[_0x63e0('0x3b')]({},_0x19066d,_0x13b708[_0x63e0('0x3d')]);return _0x375fd2['getDescriptions'](_0x19066d);}})[_0x63e0('0x40')](function(_0x28f65b){if(_0x28f65b){_0x3c8862=_0x28f65b[_0x63e0('0x33')];if(!_0x13b708[_0x63e0('0x30')]['hasOwnProperty'](_0x63e0('0x35'))){_0x19066d[_0x63e0('0x1b')]=qs[_0x63e0('0x1b')](_0x13b708[_0x63e0('0x30')][_0x63e0('0x1b')]);_0x19066d[_0x63e0('0x1d')]=qs[_0x63e0('0x1d')](_0x13b708['query'][_0x63e0('0x1d')]);}return _0x375fd2['getDescriptions'](_0x19066d);}})[_0x63e0('0x40')](function(_0x259d8f){if(_0x259d8f){return _0x259d8f?{'count':_0x3c8862,'rows':_0x259d8f}:null;}})['then'](respondWithResult(_0x5075c7,null))[_0x63e0('0x42')](handleError(_0x5075c7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5ab8d84..488fe10 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 _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x564cbb,_0x4a2375){var _0x132f4c=function(_0x1a8b17){while(--_0x1a8b17){_0x564cbb['push'](_0x564cbb['shift']());}};_0x132f4c(++_0x4a2375);}(_0xf109,0xce));var _0x9f10=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf109[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x1a20c7,_0x454c81){var _0x45598e=function(_0x549c5b){while(--_0x549c5b){_0x1a20c7['push'](_0x1a20c7['shift']());}};_0x45598e(++_0x454c81);}(_0xdace,0xc5));var _0xedac=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xdace[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index bcc5c4e..67eb530 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 _0x700f=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1324fb,_0x3d51ff){var _0x152272=function(_0x179530){while(--_0x179530){_0x1324fb['push'](_0x1324fb['shift']());}};_0x152272(++_0x3d51ff);}(_0x700f,0xe4));var _0xf700=function(_0x51f2dc,_0x2f58a4){_0x51f2dc=_0x51f2dc-0x0;var _0x12e28d=_0x700f[_0x51f2dc];return _0x12e28d;};'use strict';var _=require(_0xf700('0x0'));var util=require(_0xf700('0x1'));var moment=require(_0xf700('0x2'));var BPromise=require(_0xf700('0x3'));var rs=require(_0xf700('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf700('0x5'))['db'];var utils=require(_0xf700('0x6'));var logger=require('../../config/logger')(_0xf700('0x7'));var config=require(_0xf700('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf700('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47c93b,_0x206923,_0x387063){return new BPromise(function(_0x355436,_0x7cfe65){return client[_0xf700('0xa')](_0x47c93b,_0x387063)[_0xf700('0xb')](function(_0x1d7e3e){logger[_0xf700('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x206923,_0xf700('0xd'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x206923,_0xf700('0xd'),JSON[_0xf700('0xe')](_0x1d7e3e));if(_0x1d7e3e[_0xf700('0xf')]){if(_0x1d7e3e['error'][_0xf700('0x10')]===0x1f4){logger['error'](_0xf700('0x11'),_0x206923,_0x1d7e3e['error'][_0xf700('0x12')]);return _0x7cfe65(_0x1d7e3e['error'][_0xf700('0x12')]);}logger['error'](_0xf700('0x11'),_0x206923,_0x1d7e3e[_0xf700('0xf')][_0xf700('0x12')]);return _0x355436(_0x1d7e3e['error']['message']);}else{logger[_0xf700('0xc')](_0xf700('0x11'),_0x206923,_0xf700('0xd'));_0x355436(_0x1d7e3e[_0xf700('0x13')][_0xf700('0x12')]);}})[_0xf700('0x14')](function(_0x27d3a1){logger[_0xf700('0xf')](_0xf700('0x11'),_0x206923,_0x27d3a1);_0x7cfe65(_0x27d3a1);});});} \ No newline at end of file +var _0x621d=['code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x621d,0x191));var _0xd621=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x621d[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0xd621('0x0'));var util=require('util');var moment=require(_0xd621('0x1'));var BPromise=require(_0xd621('0x2'));var rs=require(_0xd621('0x3'));var fs=require('fs');var Redis=require(_0xd621('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd621('0x5'));var logger=require(_0xd621('0x6'))(_0xd621('0x7'));var config=require('../../config/environment');var jayson=require(_0xd621('0x8'));var client=jayson['client'][_0xd621('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x348080,_0x577d00,_0x1d4054){return new BPromise(function(_0x1c2f09,_0x50f092){return client[_0xd621('0xa')](_0x348080,_0x1d4054)[_0xd621('0xb')](function(_0x5aff4f){logger['info'](_0xd621('0xc'),_0x577d00,_0xd621('0xd'));logger[_0xd621('0xe')](_0xd621('0xf'),_0x577d00,'request\x20sent',JSON[_0xd621('0x10')](_0x5aff4f));if(_0x5aff4f['error']){if(_0x5aff4f['error'][_0xd621('0x11')]===0x1f4){logger[_0xd621('0x12')](_0xd621('0xc'),_0x577d00,_0x5aff4f[_0xd621('0x12')]['message']);return _0x50f092(_0x5aff4f[_0xd621('0x12')][_0xd621('0x13')]);}logger['error'](_0xd621('0xc'),_0x577d00,_0x5aff4f[_0xd621('0x12')][_0xd621('0x13')]);return _0x1c2f09(_0x5aff4f['error']['message']);}else{logger['info'](_0xd621('0xc'),_0x577d00,_0xd621('0xd'));_0x1c2f09(_0x5aff4f[_0xd621('0x14')][_0xd621('0x13')]);}})[_0xd621('0x15')](function(_0x4e7d25){logger[_0xd621('0x12')](_0xd621('0xc'),_0x577d00,_0x4e7d25);_0x50f092(_0x4e7d25);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6658f44..4a91098 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 _0x2a13=['show','post','put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated'];(function(_0x5efa9e,_0x52aa77){var _0x2f8be0=function(_0x410d65){while(--_0x410d65){_0x5efa9e['push'](_0x5efa9e['shift']());}};_0x2f8be0(++_0x52aa77);}(_0x2a13,0x1d5));var _0x32a1=function(_0x2b833c,_0x967283){_0x2b833c=_0x2b833c-0x0;var _0x5d7493=_0x2a13[_0x2b833c];return _0x5d7493;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x32a1('0x0'));var express=require(_0x32a1('0x1'));var router=express[_0x32a1('0x2')]();var fs_extra=require(_0x32a1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x32a1('0x4'));var config=require('../../config/environment');var controller=require(_0x32a1('0x5'));router['get']('/',auth[_0x32a1('0x6')](),controller['index']);router['get']('/:id',auth[_0x32a1('0x6')](),controller[_0x32a1('0x7')]);router[_0x32a1('0x8')]('/',auth[_0x32a1('0x6')](),controller['create']);router[_0x32a1('0x9')](_0x32a1('0xa'),auth[_0x32a1('0x6')](),controller[_0x32a1('0xb')]);router[_0x32a1('0xc')](_0x32a1('0xa'),auth[_0x32a1('0x6')](),controller[_0x32a1('0xd')]);module['exports']=router; \ No newline at end of file +var _0x2487=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x172da7,_0x450119){var _0x305231=function(_0x5ad803){while(--_0x5ad803){_0x172da7['push'](_0x172da7['shift']());}};_0x305231(++_0x450119);}(_0x2487,0x1b2));var _0x7248=function(_0x195c19,_0x2897be){_0x195c19=_0x195c19-0x0;var _0x456f1e=_0x2487[_0x195c19];return _0x456f1e;};'use strict';var multer=require(_0x7248('0x0'));var util=require(_0x7248('0x1'));var path=require(_0x7248('0x2'));var timeout=require(_0x7248('0x3'));var express=require('express');var router=express[_0x7248('0x4')]();var fs_extra=require(_0x7248('0x5'));var auth=require(_0x7248('0x6'));var interaction=require(_0x7248('0x7'));var config=require(_0x7248('0x8'));var controller=require(_0x7248('0x9'));router[_0x7248('0xa')]('/',auth[_0x7248('0xb')](),controller[_0x7248('0xc')]);router[_0x7248('0xa')](_0x7248('0xd'),auth[_0x7248('0xb')](),controller['show']);router[_0x7248('0xe')]('/',auth[_0x7248('0xb')](),controller[_0x7248('0xf')]);router[_0x7248('0x10')](_0x7248('0xd'),auth['isAuthenticated'](),controller[_0x7248('0x11')]);router['delete'](_0x7248('0xd'),auth[_0x7248('0xb')](),controller[_0x7248('0x12')]);module[_0x7248('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1ccff7b..142c1aa 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 _0x2a20=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x22e4be,_0x35ee33){var _0x867265=function(_0x34d2f1){while(--_0x34d2f1){_0x22e4be['push'](_0x22e4be['shift']());}};_0x867265(++_0x35ee33);}(_0x2a20,0x79));var _0x02a2=function(_0x304746,_0x14441a){_0x304746=_0x304746-0x0;var _0x4be24a=_0x2a20[_0x304746];return _0x4be24a;};'use strict';var Sequelize=require(_0x02a2('0x0'));module[_0x02a2('0x1')]={'type':{'type':Sequelize[_0x02a2('0x2')](_0x02a2('0x3'),_0x02a2('0x4'),_0x02a2('0x5'),_0x02a2('0x6'),_0x02a2('0x7')),'defaultValue':_0x02a2('0x3')},'content':{'type':Sequelize[_0x02a2('0x8')]},'key':{'type':Sequelize[_0x02a2('0x8')]},'keyType':{'type':Sequelize[_0x02a2('0x2')](_0x02a2('0x3'),_0x02a2('0x4'),_0x02a2('0x5'))},'keyContent':{'type':Sequelize[_0x02a2('0x8')]},'idField':{'type':Sequelize[_0x02a2('0x8')]},'nameField':{'type':Sequelize[_0x02a2('0x8')]},'customField':{'type':Sequelize[_0x02a2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02a2('0x8')]}}; \ No newline at end of file +var _0xa898=['exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x5f14ab,_0x32a8f1){var _0x3f1a18=function(_0x405a1f){while(--_0x405a1f){_0x5f14ab['push'](_0x5f14ab['shift']());}};_0x3f1a18(++_0x32a8f1);}(_0xa898,0x167));var _0x8a89=function(_0x12c374,_0x49e1fa){_0x12c374=_0x12c374-0x0;var _0x1f9d83=_0xa898[_0x12c374];return _0x1f9d83;};'use strict';var Sequelize=require(_0x8a89('0x0'));module[_0x8a89('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x8a89('0x2'),_0x8a89('0x3'),_0x8a89('0x4'),_0x8a89('0x5')),'defaultValue':_0x8a89('0x6')},'content':{'type':Sequelize[_0x8a89('0x7')]},'key':{'type':Sequelize[_0x8a89('0x7')]},'keyType':{'type':Sequelize[_0x8a89('0x8')](_0x8a89('0x6'),_0x8a89('0x2'),_0x8a89('0x3'))},'keyContent':{'type':Sequelize[_0x8a89('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8a89('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a89('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index da05050..af4159a 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 _0x42df=['to-csv','fs-extra','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','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x26fe6f,_0x4b5f52){var _0x13f5ec=function(_0x1069bd){while(--_0x1069bd){_0x26fe6f['push'](_0x26fe6f['shift']());}};_0x13f5ec(++_0x4b5f52);}(_0x42df,0x1bf));var _0xf42d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x42df[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xf42d('0x0'));var rimraf=require(_0xf42d('0x1'));var zipdir=require(_0xf42d('0x2'));var jsonpatch=require(_0xf42d('0x3'));var rp=require(_0xf42d('0x4'));var moment=require(_0xf42d('0x5'));var BPromise=require(_0xf42d('0x6'));var Mustache=require(_0xf42d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf42d('0x8'));var csv=require(_0xf42d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf42d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf42d('0x9'));var querystring=require(_0xf42d('0xb'));var Papa=require(_0xf42d('0xc'));var Redis=require(_0xf42d('0xd'));var authService=require(_0xf42d('0xe'));var qs=require(_0xf42d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf42d('0x10'));var logger=require(_0xf42d('0x11'))(_0xf42d('0x12'));var utils=require(_0xf42d('0x13'));var config=require(_0xf42d('0x14'));var licenseUtil=require(_0xf42d('0x15'));var db=require(_0xf42d('0x16'))['db'];function respondWithStatusCode(_0x2709b6,_0x459371){_0x459371=_0x459371||0xcc;return function(_0x10728b){if(_0x10728b){return _0x2709b6['sendStatus'](_0x459371);}return _0x2709b6[_0xf42d('0x17')](_0x459371)[_0xf42d('0x18')]();};}function respondWithResult(_0x2c6cd7,_0x36f89d){_0x36f89d=_0x36f89d||0xc8;return function(_0x2ba4e8){if(_0x2ba4e8){return _0x2c6cd7[_0xf42d('0x17')](_0x36f89d)[_0xf42d('0x19')](_0x2ba4e8);}};}function respondWithFilteredResult(_0x12550c,_0x47f01d){return function(_0x38f267){if(_0x38f267){var _0x5aadb4=typeof _0x47f01d[_0xf42d('0x1a')]===_0xf42d('0x1b')&&typeof _0x47f01d[_0xf42d('0x1c')]===_0xf42d('0x1b');var _0x2db67a=_0x38f267[_0xf42d('0x1d')];var _0x219156=_0x5aadb4?0x0:_0x47f01d['offset'];var _0x1a5fc3=_0x5aadb4?_0x38f267[_0xf42d('0x1d')]:_0x47f01d['offset']+_0x47f01d[_0xf42d('0x1c')];var _0x43640c;if(_0x1a5fc3>=_0x2db67a){_0x1a5fc3=_0x2db67a;_0x43640c=0xc8;}else{_0x43640c=0xce;}_0x12550c['status'](_0x43640c);return _0x12550c[_0xf42d('0x1e')](_0xf42d('0x1f'),_0x219156+'-'+_0x1a5fc3+'/'+_0x2db67a)[_0xf42d('0x19')](_0x38f267);}return null;};}function patchUpdates(_0x33193c){return function(_0x501632){try{jsonpatch[_0xf42d('0x20')](_0x501632,_0x33193c,!![]);}catch(_0x4e4742){return BPromise['reject'](_0x4e4742);}return _0x501632[_0xf42d('0x21')]();};}function saveUpdates(_0xd94bff,_0x207e96){return function(_0x4b6966){if(_0x4b6966){return _0x4b6966[_0xf42d('0x22')](_0xd94bff)[_0xf42d('0x23')](function(_0x8ad3f9){return _0x8ad3f9;});}return null;};}function removeEntity(_0x3406ab,_0x1e52ee){return function(_0x3c3cdd){if(_0x3c3cdd){return _0x3c3cdd[_0xf42d('0x24')]()['then'](function(){_0x3406ab[_0xf42d('0x17')](0xcc)[_0xf42d('0x18')]();});}};}function handleEntityNotFound(_0x2384ff,_0x2a1c16){return function(_0x4ad371){if(!_0x4ad371){_0x2384ff[_0xf42d('0x25')](0x194);}return _0x4ad371;};}function handleError(_0x55d6ed,_0x329806){_0x329806=_0x329806||0x1f4;return function(_0x4c52f5){logger[_0xf42d('0x26')](_0x4c52f5[_0xf42d('0x27')]);if(_0x4c52f5['name']){delete _0x4c52f5[_0xf42d('0x28')];}_0x55d6ed['status'](_0x329806)[_0xf42d('0x29')](_0x4c52f5);};}exports[_0xf42d('0x2a')]=function(_0x374dc9,_0x5b9109){var _0x134116={},_0x573d72={},_0x808a19={'count':0x0,'rows':[]};var _0x48cbf0=_['map'](db['Dynamics365Field'][_0xf42d('0x2b')],function(_0x33564a){return{'name':_0x33564a[_0xf42d('0x2c')],'type':_0x33564a[_0xf42d('0x2d')][_0xf42d('0x2e')]};});_0x573d72['model']=_[_0xf42d('0x2f')](_0x48cbf0,_0xf42d('0x28'));_0x573d72['query']=_[_0xf42d('0x30')](_0x374dc9[_0xf42d('0x31')]);_0x573d72[_0xf42d('0x32')]=_[_0xf42d('0x33')](_0x573d72[_0xf42d('0x34')],_0x573d72[_0xf42d('0x31')]);_0x134116[_0xf42d('0x35')]=_['intersection'](_0x573d72['model'],qs[_0xf42d('0x36')](_0x374dc9[_0xf42d('0x31')][_0xf42d('0x36')]));_0x134116[_0xf42d('0x35')]=_0x134116[_0xf42d('0x35')][_0xf42d('0x37')]?_0x134116[_0xf42d('0x35')]:_0x573d72['model'];if(!_0x374dc9['query'][_0xf42d('0x38')]('nolimit')){_0x134116[_0xf42d('0x1c')]=qs[_0xf42d('0x1c')](_0x374dc9[_0xf42d('0x31')][_0xf42d('0x1c')]);_0x134116[_0xf42d('0x1a')]=qs[_0xf42d('0x1a')](_0x374dc9[_0xf42d('0x31')][_0xf42d('0x1a')]);}_0x134116[_0xf42d('0x39')]=qs[_0xf42d('0x3a')](_0x374dc9[_0xf42d('0x31')][_0xf42d('0x3a')]);_0x134116[_0xf42d('0x3b')]=qs[_0xf42d('0x32')](_[_0xf42d('0x3c')](_0x374dc9['query'],_0x573d72[_0xf42d('0x32')]),_0x48cbf0);if(_0x374dc9[_0xf42d('0x31')][_0xf42d('0x3d')]){_0x134116[_0xf42d('0x3b')]=_[_0xf42d('0x3e')](_0x134116['where'],{'$or':_[_0xf42d('0x2f')](_0x48cbf0,function(_0x4b962c){if(_0x4b962c['type']!==_0xf42d('0x3f')){var _0x54f9b8={};_0x54f9b8[_0x4b962c['name']]={'$like':'%'+_0x374dc9['query'][_0xf42d('0x3d')]+'%'};return _0x54f9b8;}})});}_0x134116=_['merge']({},_0x134116,_0x374dc9[_0xf42d('0x40')]);var _0x256ec4={'where':_0x134116[_0xf42d('0x3b')]};return db[_0xf42d('0x41')][_0xf42d('0x1d')](_0x256ec4)['then'](function(_0x4552a6){_0x808a19[_0xf42d('0x1d')]=_0x4552a6;if(_0x374dc9['query'][_0xf42d('0x42')]){_0x134116['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xf42d('0x43')](_0x134116);})['then'](function(_0x80f780){_0x808a19[_0xf42d('0x44')]=_0x80f780;return _0x808a19;})['then'](respondWithFilteredResult(_0x5b9109,_0x134116))[_0xf42d('0x45')](handleError(_0x5b9109,null));};exports[_0xf42d('0x46')]=function(_0xd987a8,_0x1aba75){var _0x26bee0={'raw':!![],'where':{'id':_0xd987a8[_0xf42d('0x47')]['id']}},_0x4479f2={};_0x4479f2[_0xf42d('0x34')]=_['keys'](db[_0xf42d('0x41')][_0xf42d('0x2b')]);_0x4479f2[_0xf42d('0x31')]=_['keys'](_0xd987a8['query']);_0x4479f2[_0xf42d('0x32')]=_[_0xf42d('0x33')](_0x4479f2['model'],_0x4479f2[_0xf42d('0x31')]);_0x26bee0['attributes']=_[_0xf42d('0x33')](_0x4479f2[_0xf42d('0x34')],qs[_0xf42d('0x36')](_0xd987a8['query'][_0xf42d('0x36')]));_0x26bee0['attributes']=_0x26bee0[_0xf42d('0x35')][_0xf42d('0x37')]?_0x26bee0[_0xf42d('0x35')]:_0x4479f2[_0xf42d('0x34')];if(_0xd987a8['query'][_0xf42d('0x42')]){_0x26bee0[_0xf42d('0x48')]=[{'all':!![]}];}_0x26bee0=_[_0xf42d('0x3e')]({},_0x26bee0,_0xd987a8['options']);return db[_0xf42d('0x41')][_0xf42d('0x49')](_0x26bee0)[_0xf42d('0x23')](handleEntityNotFound(_0x1aba75,null))[_0xf42d('0x23')](respondWithResult(_0x1aba75,null))['catch'](handleError(_0x1aba75,null));};exports[_0xf42d('0x4a')]=function(_0x44a8b5,_0x53d844){return db[_0xf42d('0x41')][_0xf42d('0x4a')](_0x44a8b5['body'],{})[_0xf42d('0x23')](respondWithResult(_0x53d844,0xc9))[_0xf42d('0x45')](handleError(_0x53d844,null));};exports[_0xf42d('0x22')]=function(_0x3938d6,_0x39df13){if(_0x3938d6[_0xf42d('0x4b')]['id']){delete _0x3938d6['body']['id'];}return db[_0xf42d('0x41')][_0xf42d('0x49')]({'where':{'id':_0x3938d6[_0xf42d('0x47')]['id']}})['then'](handleEntityNotFound(_0x39df13,null))[_0xf42d('0x23')](saveUpdates(_0x3938d6[_0xf42d('0x4b')],null))[_0xf42d('0x23')](respondWithResult(_0x39df13,null))[_0xf42d('0x45')](handleError(_0x39df13,null));};exports['destroy']=function(_0x4c25cf,_0x5e1d5e){return db[_0xf42d('0x41')][_0xf42d('0x49')]({'where':{'id':_0x4c25cf['params']['id']}})[_0xf42d('0x23')](handleEntityNotFound(_0x5e1d5e,null))['then'](removeEntity(_0x5e1d5e,null))[_0xf42d('0x45')](handleError(_0x5e1d5e,null));}; \ No newline at end of file +var _0x6c3b=['type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Dynamics365Field','fieldName'];(function(_0x5036be,_0x14b5a1){var _0x23d356=function(_0xb4736b){while(--_0xb4736b){_0x5036be['push'](_0x5036be['shift']());}};_0x23d356(++_0x14b5a1);}(_0x6c3b,0x1b4));var _0xb6c3=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6c3b[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0xb6c3('0x0'));var rimraf=require(_0xb6c3('0x1'));var zipdir=require(_0xb6c3('0x2'));var jsonpatch=require(_0xb6c3('0x3'));var rp=require(_0xb6c3('0x4'));var moment=require(_0xb6c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb6c3('0x6'));var util=require(_0xb6c3('0x7'));var path=require(_0xb6c3('0x8'));var sox=require(_0xb6c3('0x9'));var csv=require(_0xb6c3('0xa'));var ejs=require(_0xb6c3('0xb'));var fs=require('fs');var fs_extra=require(_0xb6c3('0xc'));var _=require(_0xb6c3('0xd'));var squel=require(_0xb6c3('0xe'));var crypto=require(_0xb6c3('0xf'));var jsforce=require(_0xb6c3('0x10'));var deskjs=require(_0xb6c3('0x11'));var toCsv=require(_0xb6c3('0xa'));var querystring=require(_0xb6c3('0x12'));var Papa=require(_0xb6c3('0x13'));var Redis=require(_0xb6c3('0x14'));var authService=require(_0xb6c3('0x15'));var qs=require(_0xb6c3('0x16'));var as=require(_0xb6c3('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6c3('0x18'))('api');var utils=require(_0xb6c3('0x19'));var config=require(_0xb6c3('0x1a'));var licenseUtil=require(_0xb6c3('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4181cc,_0x83b806){_0x83b806=_0x83b806||0xcc;return function(_0x33f6f3){if(_0x33f6f3){return _0x4181cc[_0xb6c3('0x1c')](_0x83b806);}return _0x4181cc[_0xb6c3('0x1d')](_0x83b806)[_0xb6c3('0x1e')]();};}function respondWithResult(_0x135c8f,_0xcee02e){_0xcee02e=_0xcee02e||0xc8;return function(_0x42c7a7){if(_0x42c7a7){return _0x135c8f['status'](_0xcee02e)[_0xb6c3('0x1f')](_0x42c7a7);}};}function respondWithFilteredResult(_0x1b6d3b,_0x225ceb){return function(_0xd0e6de){if(_0xd0e6de){var _0x505386=typeof _0x225ceb[_0xb6c3('0x20')]===_0xb6c3('0x21')&&typeof _0x225ceb[_0xb6c3('0x22')]===_0xb6c3('0x21');var _0x33ab1b=_0xd0e6de[_0xb6c3('0x23')];var _0x32632c=_0x505386?0x0:_0x225ceb[_0xb6c3('0x20')];var _0x199cda=_0x505386?_0xd0e6de['count']:_0x225ceb[_0xb6c3('0x20')]+_0x225ceb['limit'];var _0x4a2c7b;if(_0x199cda>=_0x33ab1b){_0x199cda=_0x33ab1b;_0x4a2c7b=0xc8;}else{_0x4a2c7b=0xce;}_0x1b6d3b[_0xb6c3('0x1d')](_0x4a2c7b);return _0x1b6d3b[_0xb6c3('0x24')](_0xb6c3('0x25'),_0x32632c+'-'+_0x199cda+'/'+_0x33ab1b)[_0xb6c3('0x1f')](_0xd0e6de);}return null;};}function patchUpdates(_0x167f4e){return function(_0x254fec){try{jsonpatch[_0xb6c3('0x26')](_0x254fec,_0x167f4e,!![]);}catch(_0x2ef2ff){return BPromise['reject'](_0x2ef2ff);}return _0x254fec[_0xb6c3('0x27')]();};}function saveUpdates(_0x3efae2,_0x5c718d){return function(_0x18d2ab){if(_0x18d2ab){return _0x18d2ab[_0xb6c3('0x28')](_0x3efae2)[_0xb6c3('0x29')](function(_0x49cd48){return _0x49cd48;});}return null;};}function removeEntity(_0x452247,_0x54d674){return function(_0x3e117f){if(_0x3e117f){return _0x3e117f['destroy']()[_0xb6c3('0x29')](function(){_0x452247[_0xb6c3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35f0ab,_0x5b6e61){return function(_0x38c9f8){if(!_0x38c9f8){_0x35f0ab[_0xb6c3('0x1c')](0x194);}return _0x38c9f8;};}function handleError(_0xdebe1c,_0x198669){_0x198669=_0x198669||0x1f4;return function(_0x25fe69){logger[_0xb6c3('0x2a')](_0x25fe69[_0xb6c3('0x2b')]);if(_0x25fe69[_0xb6c3('0x2c')]){delete _0x25fe69[_0xb6c3('0x2c')];}_0xdebe1c['status'](_0x198669)[_0xb6c3('0x2d')](_0x25fe69);};}exports[_0xb6c3('0x2e')]=function(_0xac984c,_0x13249f){var _0x58b964={},_0x5e1865={},_0x1448d4={'count':0x0,'rows':[]};var _0x1e1407=_[_0xb6c3('0x2f')](db[_0xb6c3('0x30')]['rawAttributes'],function(_0x22a84e){return{'name':_0x22a84e[_0xb6c3('0x31')],'type':_0x22a84e[_0xb6c3('0x32')][_0xb6c3('0x33')]};});_0x5e1865['model']=_[_0xb6c3('0x2f')](_0x1e1407,_0xb6c3('0x2c'));_0x5e1865[_0xb6c3('0x34')]=_[_0xb6c3('0x35')](_0xac984c[_0xb6c3('0x34')]);_0x5e1865[_0xb6c3('0x36')]=_[_0xb6c3('0x37')](_0x5e1865['model'],_0x5e1865[_0xb6c3('0x34')]);_0x58b964[_0xb6c3('0x38')]=_[_0xb6c3('0x37')](_0x5e1865[_0xb6c3('0x39')],qs['fields'](_0xac984c[_0xb6c3('0x34')][_0xb6c3('0x3a')]));_0x58b964['attributes']=_0x58b964[_0xb6c3('0x38')][_0xb6c3('0x3b')]?_0x58b964['attributes']:_0x5e1865[_0xb6c3('0x39')];if(!_0xac984c[_0xb6c3('0x34')][_0xb6c3('0x3c')](_0xb6c3('0x3d'))){_0x58b964['limit']=qs[_0xb6c3('0x22')](_0xac984c[_0xb6c3('0x34')][_0xb6c3('0x22')]);_0x58b964[_0xb6c3('0x20')]=qs[_0xb6c3('0x20')](_0xac984c['query'][_0xb6c3('0x20')]);}_0x58b964[_0xb6c3('0x3e')]=qs[_0xb6c3('0x3f')](_0xac984c['query'][_0xb6c3('0x3f')]);_0x58b964[_0xb6c3('0x40')]=qs[_0xb6c3('0x36')](_['pick'](_0xac984c[_0xb6c3('0x34')],_0x5e1865[_0xb6c3('0x36')]),_0x1e1407);if(_0xac984c[_0xb6c3('0x34')]['filter']){_0x58b964[_0xb6c3('0x40')]=_[_0xb6c3('0x41')](_0x58b964['where'],{'$or':_['map'](_0x1e1407,function(_0x4dffce){if(_0x4dffce[_0xb6c3('0x32')]!==_0xb6c3('0x42')){var _0x5fcc48={};_0x5fcc48[_0x4dffce['name']]={'$like':'%'+_0xac984c['query'][_0xb6c3('0x43')]+'%'};return _0x5fcc48;}})});}_0x58b964=_[_0xb6c3('0x41')]({},_0x58b964,_0xac984c[_0xb6c3('0x44')]);var _0x44bf36={'where':_0x58b964[_0xb6c3('0x40')]};return db['Dynamics365Field'][_0xb6c3('0x23')](_0x44bf36)[_0xb6c3('0x29')](function(_0x4bc6a4){_0x1448d4[_0xb6c3('0x23')]=_0x4bc6a4;if(_0xac984c['query']['includeAll']){_0x58b964['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xb6c3('0x45')](_0x58b964);})[_0xb6c3('0x29')](function(_0x1f7fa2){_0x1448d4[_0xb6c3('0x46')]=_0x1f7fa2;return _0x1448d4;})[_0xb6c3('0x29')](respondWithFilteredResult(_0x13249f,_0x58b964))[_0xb6c3('0x47')](handleError(_0x13249f,null));};exports[_0xb6c3('0x48')]=function(_0x43df98,_0x1b8334){var _0x20a415={'raw':!![],'where':{'id':_0x43df98['params']['id']}},_0x126f99={};_0x126f99['model']=_[_0xb6c3('0x35')](db[_0xb6c3('0x30')][_0xb6c3('0x49')]);_0x126f99[_0xb6c3('0x34')]=_['keys'](_0x43df98[_0xb6c3('0x34')]);_0x126f99['filters']=_[_0xb6c3('0x37')](_0x126f99[_0xb6c3('0x39')],_0x126f99['query']);_0x20a415[_0xb6c3('0x38')]=_[_0xb6c3('0x37')](_0x126f99['model'],qs['fields'](_0x43df98[_0xb6c3('0x34')][_0xb6c3('0x3a')]));_0x20a415[_0xb6c3('0x38')]=_0x20a415[_0xb6c3('0x38')]['length']?_0x20a415[_0xb6c3('0x38')]:_0x126f99[_0xb6c3('0x39')];if(_0x43df98[_0xb6c3('0x34')][_0xb6c3('0x4a')]){_0x20a415[_0xb6c3('0x4b')]=[{'all':!![]}];}_0x20a415=_['merge']({},_0x20a415,_0x43df98[_0xb6c3('0x44')]);return db[_0xb6c3('0x30')][_0xb6c3('0x4c')](_0x20a415)[_0xb6c3('0x29')](handleEntityNotFound(_0x1b8334,null))['then'](respondWithResult(_0x1b8334,null))[_0xb6c3('0x47')](handleError(_0x1b8334,null));};exports[_0xb6c3('0x4d')]=function(_0x3b68c9,_0x48cbcf){return db[_0xb6c3('0x30')][_0xb6c3('0x4d')](_0x3b68c9[_0xb6c3('0x4e')],{})[_0xb6c3('0x29')](respondWithResult(_0x48cbcf,0xc9))[_0xb6c3('0x47')](handleError(_0x48cbcf,null));};exports[_0xb6c3('0x28')]=function(_0x43ba6d,_0x4145d8){if(_0x43ba6d[_0xb6c3('0x4e')]['id']){delete _0x43ba6d['body']['id'];}return db[_0xb6c3('0x30')][_0xb6c3('0x4c')]({'where':{'id':_0x43ba6d[_0xb6c3('0x4f')]['id']}})[_0xb6c3('0x29')](handleEntityNotFound(_0x4145d8,null))['then'](saveUpdates(_0x43ba6d['body'],null))[_0xb6c3('0x29')](respondWithResult(_0x4145d8,null))['catch'](handleError(_0x4145d8,null));};exports[_0xb6c3('0x50')]=function(_0x1f1f0c,_0x576f14){return db[_0xb6c3('0x30')][_0xb6c3('0x4c')]({'where':{'id':_0x1f1f0c[_0xb6c3('0x4f')]['id']}})[_0xb6c3('0x29')](handleEntityNotFound(_0x576f14,null))[_0xb6c3('0x29')](removeEntity(_0x576f14,null))[_0xb6c3('0x47')](handleError(_0x576f14,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 4594ccf..e94574e 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 _0xc9de=['moment','request-promise','path','rimraf','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','../../config/logger','api'];(function(_0x1298d5,_0x259b01){var _0x5c08e3=function(_0xc41da6){while(--_0xc41da6){_0x1298d5['push'](_0x1298d5['shift']());}};_0x5c08e3(++_0x259b01);}(_0xc9de,0xee));var _0xec9d=function(_0x558bef,_0x54ee21){_0x558bef=_0x558bef-0x0;var _0x42aadd=_0xc9de[_0x558bef];return _0x42aadd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xec9d('0x0'))(_0xec9d('0x1'));var moment=require(_0xec9d('0x2'));var BPromise=require('bluebird');var rp=require(_0xec9d('0x3'));var fs=require('fs');var path=require(_0xec9d('0x4'));var rimraf=require(_0xec9d('0x5'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xec9d('0x6')]=function(_0x15f209,_0x3518ca){return _0x15f209[_0xec9d('0x7')](_0xec9d('0x8'),attributes,{'tableName':_0xec9d('0x9'),'paranoid':![],'indexes':[{'name':_0xec9d('0xa'),'fields':[_0xec9d('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a98=['Dynamics365Field','dynamics365_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x5f1988,_0x51495b){var _0x39d762=function(_0x487b18){while(--_0x487b18){_0x5f1988['push'](_0x5f1988['shift']());}};_0x39d762(++_0x51495b);}(_0x0a98,0x8a));var _0x80a9=function(_0x30af79,_0x6acaef){_0x30af79=_0x30af79-0x0;var _0x3edd51=_0x0a98[_0x30af79];return _0x3edd51;};'use strict';var _=require(_0x80a9('0x0'));var util=require(_0x80a9('0x1'));var logger=require(_0x80a9('0x2'))(_0x80a9('0x3'));var moment=require(_0x80a9('0x4'));var BPromise=require(_0x80a9('0x5'));var rp=require(_0x80a9('0x6'));var fs=require('fs');var path=require(_0x80a9('0x7'));var rimraf=require(_0x80a9('0x8'));var config=require(_0x80a9('0x9'));var attributes=require(_0x80a9('0xa'));module[_0x80a9('0xb')]=function(_0x52f130,_0x220331){return _0x52f130['define'](_0x80a9('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x80a9('0xd'),'fields':[_0x80a9('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 b96cd1d..65ea145 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 _0x6b18=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug'];(function(_0x54bff7,_0x586ae1){var _0x44f9cf=function(_0x37a042){while(--_0x37a042){_0x54bff7['push'](_0x54bff7['shift']());}};_0x44f9cf(++_0x586ae1);}(_0x6b18,0x79));var _0x86b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b18[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x86b1('0x0'));var util=require(_0x86b1('0x1'));var moment=require(_0x86b1('0x2'));var BPromise=require(_0x86b1('0x3'));var rs=require(_0x86b1('0x4'));var fs=require('fs');var Redis=require(_0x86b1('0x5'));var db=require(_0x86b1('0x6'))['db'];var utils=require(_0x86b1('0x7'));var logger=require(_0x86b1('0x8'))(_0x86b1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x86b1('0xa')][_0x86b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x358b14,_0x3ed484,_0x51fb59){return new BPromise(function(_0x241446,_0xc496b7){return client[_0x86b1('0xc')](_0x358b14,_0x51fb59)[_0x86b1('0xd')](function(_0x59535d){logger[_0x86b1('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x3ed484,_0x86b1('0xf'));logger[_0x86b1('0x10')](_0x86b1('0x11'),_0x3ed484,_0x86b1('0xf'),JSON[_0x86b1('0x12')](_0x59535d));if(_0x59535d[_0x86b1('0x13')]){if(_0x59535d[_0x86b1('0x13')]['code']===0x1f4){logger[_0x86b1('0x13')](_0x86b1('0x14'),_0x3ed484,_0x59535d[_0x86b1('0x13')][_0x86b1('0x15')]);return _0xc496b7(_0x59535d[_0x86b1('0x13')][_0x86b1('0x15')]);}logger[_0x86b1('0x13')](_0x86b1('0x14'),_0x3ed484,_0x59535d[_0x86b1('0x13')][_0x86b1('0x15')]);return _0x241446(_0x59535d[_0x86b1('0x13')][_0x86b1('0x15')]);}else{logger[_0x86b1('0xe')](_0x86b1('0x14'),_0x3ed484,'request\x20sent');_0x241446(_0x59535d[_0x86b1('0x16')]['message']);}})['catch'](function(_0x263b12){logger[_0x86b1('0x13')](_0x86b1('0x14'),_0x3ed484,_0x263b12);_0xc496b7(_0x263b12);});});} \ No newline at end of file +var _0xcb26=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x39915b,_0x35bc36){var _0x4581a0=function(_0x28e563){while(--_0x28e563){_0x39915b['push'](_0x39915b['shift']());}};_0x4581a0(++_0x35bc36);}(_0xcb26,0x1cb));var _0x6cb2=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xcb26[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require(_0x6cb2('0x0'));var moment=require(_0x6cb2('0x1'));var BPromise=require(_0x6cb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb2('0x3'));var db=require(_0x6cb2('0x4'))['db'];var utils=require(_0x6cb2('0x5'));var logger=require(_0x6cb2('0x6'))(_0x6cb2('0x7'));var config=require(_0x6cb2('0x8'));var jayson=require(_0x6cb2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x78f948,_0x2d25ae,_0x9a1d2b){return new BPromise(function(_0x4868d7,_0x3b8c01){return client[_0x6cb2('0xa')](_0x78f948,_0x9a1d2b)[_0x6cb2('0xb')](function(_0x3af305){logger['info'](_0x6cb2('0xc'),_0x2d25ae,_0x6cb2('0xd'));logger[_0x6cb2('0xe')](_0x6cb2('0xf'),_0x2d25ae,_0x6cb2('0xd'),JSON[_0x6cb2('0x10')](_0x3af305));if(_0x3af305[_0x6cb2('0x11')]){if(_0x3af305[_0x6cb2('0x11')][_0x6cb2('0x12')]===0x1f4){logger[_0x6cb2('0x11')](_0x6cb2('0xc'),_0x2d25ae,_0x3af305[_0x6cb2('0x11')]['message']);return _0x3b8c01(_0x3af305['error'][_0x6cb2('0x13')]);}logger[_0x6cb2('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x2d25ae,_0x3af305[_0x6cb2('0x11')][_0x6cb2('0x13')]);return _0x4868d7(_0x3af305[_0x6cb2('0x11')][_0x6cb2('0x13')]);}else{logger[_0x6cb2('0x14')](_0x6cb2('0xc'),_0x2d25ae,'request\x20sent');_0x4868d7(_0x3af305[_0x6cb2('0x15')][_0x6cb2('0x13')]);}})[_0x6cb2('0x16')](function(_0x3bad7a){logger[_0x6cb2('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x2d25ae,_0x3bad7a);_0x3b8c01(_0x3bad7a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 7964ab1..088cf31 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 _0x06c2=['index','isAuthenticated','/:id/configurations','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x06c2,0x15f));var _0x206c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06c2[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x206c('0x0'));var util=require(_0x206c('0x1'));var path=require('path');var timeout=require(_0x206c('0x2'));var express=require(_0x206c('0x3'));var router=express[_0x206c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x206c('0x5'));var interaction=require(_0x206c('0x6'));var config=require(_0x206c('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x206c('0x8')]('/',auth['isAuthenticated'](),controller[_0x206c('0x9')]);router[_0x206c('0x8')]('/:id',auth[_0x206c('0xa')](),controller['show']);router[_0x206c('0x8')](_0x206c('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x206c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x206c('0xc')]('/',auth[_0x206c('0xa')](),controller[_0x206c('0xd')]);router[_0x206c('0xc')](_0x206c('0xb'),auth[_0x206c('0xa')](),controller['addConfiguration']);router[_0x206c('0xe')](_0x206c('0xf'),auth[_0x206c('0xa')](),controller[_0x206c('0x10')]);router[_0x206c('0x11')](_0x206c('0xf'),auth[_0x206c('0xa')](),controller[_0x206c('0x12')]);module[_0x206c('0x13')]=router; \ No newline at end of file +var _0x540c=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete'];(function(_0xb1b481,_0x337b26){var _0x2433d2=function(_0x5c8bdf){while(--_0x5c8bdf){_0xb1b481['push'](_0xb1b481['shift']());}};_0x2433d2(++_0x337b26);}(_0x540c,0x94));var _0xc540=function(_0x5c32a1,_0x55e928){_0x5c32a1=_0x5c32a1-0x0;var _0x1ab8f7=_0x540c[_0x5c32a1];return _0x1ab8f7;};'use strict';var multer=require(_0xc540('0x0'));var util=require('util');var path=require(_0xc540('0x1'));var timeout=require(_0xc540('0x2'));var express=require('express');var router=express[_0xc540('0x3')]();var fs_extra=require(_0xc540('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc540('0x5'));var config=require('../../config/environment');var controller=require(_0xc540('0x6'));router[_0xc540('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xc540('0x8')](),controller[_0xc540('0x9')]);router[_0xc540('0x7')](_0xc540('0xa'),auth[_0xc540('0x8')](),controller[_0xc540('0xb')]);router['get'](_0xc540('0xc'),auth[_0xc540('0x8')](),controller[_0xc540('0xd')]);router[_0xc540('0xe')]('/',auth['isAuthenticated'](),controller[_0xc540('0xf')]);router['post'](_0xc540('0xa'),auth[_0xc540('0x8')](),controller[_0xc540('0x10')]);router[_0xc540('0x11')](_0xc540('0x12'),auth[_0xc540('0x8')](),controller['update']);router[_0xc540('0x13')](_0xc540('0x12'),auth[_0xc540('0x8')](),controller['destroy']);module[_0xc540('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2c578e4..595187b 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 _0x4137=['STRING','username','remoteUri','sequelize','exports'];(function(_0x4e2cd6,_0x53c4a3){var _0x5ab517=function(_0x39f42b){while(--_0x39f42b){_0x4e2cd6['push'](_0x4e2cd6['shift']());}};_0x5ab517(++_0x53c4a3);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')]},'description':{'type':Sequelize[_0x7413('0x2')]},'username':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3')},'apiKey':{'type':Sequelize[_0x7413('0x2')]},'remoteUri':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x4')},'serverUrl':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2032=['remoteUri','exports','STRING','username'];(function(_0x3f9bbf,_0x197a82){var _0x555b03=function(_0x1ed120){while(--_0x1ed120){_0x3f9bbf['push'](_0x3f9bbf['shift']());}};_0x555b03(++_0x197a82);}(_0x2032,0xd9));var _0x2203=function(_0x378fd7,_0x1ecdb2){_0x378fd7=_0x378fd7-0x0;var _0x31c3a3=_0x2032[_0x378fd7];return _0x31c3a3;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 326aaad..494f769 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 _0xd9dc=['../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','FreshdeskAccount','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','getConfigurations','FreshdeskConfiguration','length','pick','hasOwnProperty','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','%s/%s','format','Basic\x20%s','%s:X','toString','base64','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x5cb477,_0xa1a857){_0x5cb477=_0x5cb477-0x0;var _0x4696a3=_0xd9dc[_0x5cb477];return _0x4696a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd9d('0x0'));var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9d('0x2'));var moment=require(_0xcd9d('0x3'));var BPromise=require(_0xcd9d('0x4'));var Mustache=require('mustache');var util=require(_0xcd9d('0x5'));var path=require(_0xcd9d('0x6'));var sox=require(_0xcd9d('0x7'));var csv=require(_0xcd9d('0x8'));var ejs=require(_0xcd9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9d('0xa'));var squel=require(_0xcd9d('0xb'));var crypto=require(_0xcd9d('0xc'));var jsforce=require(_0xcd9d('0xd'));var deskjs=require(_0xcd9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd9d('0xf'));var Papa=require(_0xcd9d('0x10'));var Redis=require(_0xcd9d('0x11'));var authService=require(_0xcd9d('0x12'));var qs=require(_0xcd9d('0x13'));var as=require(_0xcd9d('0x14'));var hardwareService=require(_0xcd9d('0x15'));var logger=require(_0xcd9d('0x16'))('api');var utils=require(_0xcd9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9d('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcd9d('0x19'));function respondWithStatusCode(_0x3ab0af,_0x2fa1d0){_0x2fa1d0=_0x2fa1d0||0xcc;return function(_0x49028e){if(_0x49028e){return _0x3ab0af[_0xcd9d('0x1a')](_0x2fa1d0);}return _0x3ab0af['status'](_0x2fa1d0)[_0xcd9d('0x1b')]();};}function respondWithResult(_0x957089,_0x31ddbb){_0x31ddbb=_0x31ddbb||0xc8;return function(_0x582a92){if(_0x582a92){return _0x957089[_0xcd9d('0x1c')](_0x31ddbb)[_0xcd9d('0x1d')](_0x582a92);}};}function respondWithFilteredResult(_0x50f14d,_0x40d5aa){return function(_0x5a7248){if(_0x5a7248){var _0x3ea72c=typeof _0x40d5aa['offset']===_0xcd9d('0x1e')&&typeof _0x40d5aa[_0xcd9d('0x1f')]===_0xcd9d('0x1e');var _0xf82796=_0x5a7248[_0xcd9d('0x20')];var _0x4381e2=_0x3ea72c?0x0:_0x40d5aa[_0xcd9d('0x21')];var _0x3c544d=_0x3ea72c?_0x5a7248[_0xcd9d('0x20')]:_0x40d5aa[_0xcd9d('0x21')]+_0x40d5aa[_0xcd9d('0x1f')];var _0x497425;if(_0x3c544d>=_0xf82796){_0x3c544d=_0xf82796;_0x497425=0xc8;}else{_0x497425=0xce;}_0x50f14d[_0xcd9d('0x1c')](_0x497425);return _0x50f14d[_0xcd9d('0x22')](_0xcd9d('0x23'),_0x4381e2+'-'+_0x3c544d+'/'+_0xf82796)['json'](_0x5a7248);}return null;};}function patchUpdates(_0x2a5848){return function(_0xe04bb8){try{jsonpatch[_0xcd9d('0x24')](_0xe04bb8,_0x2a5848,!![]);}catch(_0x851388){return BPromise[_0xcd9d('0x25')](_0x851388);}return _0xe04bb8[_0xcd9d('0x26')]();};}function saveUpdates(_0x1e7d4d,_0x12e585){return function(_0x4ad511){if(_0x4ad511){return _0x4ad511['update'](_0x1e7d4d)[_0xcd9d('0x27')](function(_0x222afe){return _0x222afe;});}return null;};}function removeEntity(_0x2560fd,_0x474bb4){return function(_0x58b632){if(_0x58b632){return _0x58b632[_0xcd9d('0x28')]()[_0xcd9d('0x27')](function(){_0x2560fd[_0xcd9d('0x1c')](0xcc)[_0xcd9d('0x1b')]();});}};}function handleEntityNotFound(_0x32686a,_0x5ed51f){return function(_0x33aca7){if(!_0x33aca7){_0x32686a[_0xcd9d('0x1a')](0x194);}return _0x33aca7;};}function handleError(_0xf21e2,_0x4ce785){_0x4ce785=_0x4ce785||0x1f4;return function(_0x14a5e9){logger[_0xcd9d('0x29')](_0x14a5e9[_0xcd9d('0x2a')]);if(_0x14a5e9['name']){delete _0x14a5e9[_0xcd9d('0x2b')];}_0xf21e2[_0xcd9d('0x1c')](_0x4ce785)['send'](_0x14a5e9);};}exports['index']=function(_0xf84e80,_0x124da9){var _0x5b1fd6={},_0xcf8b36={},_0x2d3347={'count':0x0,'rows':[]};var _0x3c70de=_[_0xcd9d('0x2c')](db[_0xcd9d('0x2d')]['rawAttributes'],function(_0x4bd53d){return{'name':_0x4bd53d[_0xcd9d('0x2e')],'type':_0x4bd53d[_0xcd9d('0x2f')]['key']};});_0xcf8b36[_0xcd9d('0x30')]=_[_0xcd9d('0x2c')](_0x3c70de,_0xcd9d('0x2b'));_0xcf8b36['query']=_[_0xcd9d('0x31')](_0xf84e80[_0xcd9d('0x32')]);_0xcf8b36[_0xcd9d('0x33')]=_[_0xcd9d('0x34')](_0xcf8b36['model'],_0xcf8b36['query']);_0x5b1fd6[_0xcd9d('0x35')]=_['intersection'](_0xcf8b36['model'],qs[_0xcd9d('0x36')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x5b1fd6[_0xcd9d('0x35')]=_0x5b1fd6['attributes']['length']?_0x5b1fd6[_0xcd9d('0x35')]:_0xcf8b36[_0xcd9d('0x30')];if(!_0xf84e80[_0xcd9d('0x32')]['hasOwnProperty'](_0xcd9d('0x37'))){_0x5b1fd6[_0xcd9d('0x1f')]=qs[_0xcd9d('0x1f')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x1f')]);_0x5b1fd6[_0xcd9d('0x21')]=qs[_0xcd9d('0x21')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x21')]);}_0x5b1fd6[_0xcd9d('0x38')]=qs[_0xcd9d('0x39')](_0xf84e80[_0xcd9d('0x32')]['sort']);_0x5b1fd6[_0xcd9d('0x3a')]=qs[_0xcd9d('0x33')](_['pick'](_0xf84e80['query'],_0xcf8b36[_0xcd9d('0x33')]),_0x3c70de);if(_0xf84e80['query']['filter']){_0x5b1fd6[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x5b1fd6[_0xcd9d('0x3a')],{'$or':_[_0xcd9d('0x2c')](_0x3c70de,function(_0x49b83d){if(_0x49b83d[_0xcd9d('0x2f')]!==_0xcd9d('0x3c')){var _0x532174={};_0x532174[_0x49b83d[_0xcd9d('0x2b')]]={'$like':'%'+_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x3d')]+'%'};return _0x532174;}})});}_0x5b1fd6=_[_0xcd9d('0x3b')]({},_0x5b1fd6,_0xf84e80['options']);var _0x4f06e6={'where':_0x5b1fd6[_0xcd9d('0x3a')]};return db['FreshdeskAccount'][_0xcd9d('0x20')](_0x4f06e6)[_0xcd9d('0x27')](function(_0x10c35a){_0x2d3347['count']=_0x10c35a;if(_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x3e')]){_0x5b1fd6[_0xcd9d('0x3f')]=[{'all':!![]}];}return db[_0xcd9d('0x2d')][_0xcd9d('0x40')](_0x5b1fd6);})[_0xcd9d('0x27')](function(_0x23065b){_0x2d3347[_0xcd9d('0x41')]=_0x23065b;return _0x2d3347;})[_0xcd9d('0x27')](respondWithFilteredResult(_0x124da9,_0x5b1fd6))[_0xcd9d('0x42')](handleError(_0x124da9,null));};exports[_0xcd9d('0x43')]=function(_0x5e8223,_0x4a2dec){var _0x52b882={'raw':![],'where':{'id':_0x5e8223[_0xcd9d('0x44')]['id']}},_0x2b4584={};_0x2b4584[_0xcd9d('0x30')]=_['keys'](db[_0xcd9d('0x2d')][_0xcd9d('0x45')]);_0x2b4584['query']=_[_0xcd9d('0x31')](_0x5e8223['query']);_0x2b4584[_0xcd9d('0x33')]=_[_0xcd9d('0x34')](_0x2b4584['model'],_0x2b4584['query']);_0x52b882[_0xcd9d('0x35')]=_[_0xcd9d('0x34')](_0x2b4584[_0xcd9d('0x30')],qs[_0xcd9d('0x36')](_0x5e8223[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x52b882['attributes']=_0x52b882['attributes']['length']?_0x52b882[_0xcd9d('0x35')]:_0x2b4584[_0xcd9d('0x30')];if(_0x5e8223['query'][_0xcd9d('0x3e')]){_0x52b882[_0xcd9d('0x3f')]=[{'all':!![]}];}_0x52b882=_[_0xcd9d('0x3b')]({},_0x52b882,_0x5e8223[_0xcd9d('0x46')]);return db[_0xcd9d('0x2d')][_0xcd9d('0x47')](_0x52b882)[_0xcd9d('0x27')](handleEntityNotFound(_0x4a2dec,null))[_0xcd9d('0x27')](respondWithResult(_0x4a2dec,null))[_0xcd9d('0x42')](handleError(_0x4a2dec,null));};exports[_0xcd9d('0x48')]=function(_0x55c374,_0x28b724){return db[_0xcd9d('0x2d')][_0xcd9d('0x48')](_0x55c374[_0xcd9d('0x49')],{})[_0xcd9d('0x27')](respondWithResult(_0x28b724,0xc9))[_0xcd9d('0x42')](handleError(_0x28b724,null));};exports[_0xcd9d('0x4a')]=function(_0x3234ea,_0x5a1c79){if(_0x3234ea[_0xcd9d('0x49')]['id']){delete _0x3234ea[_0xcd9d('0x49')]['id'];}return db[_0xcd9d('0x2d')]['find']({'where':{'id':_0x3234ea[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x5a1c79,null))[_0xcd9d('0x27')](saveUpdates(_0x3234ea[_0xcd9d('0x49')],null))[_0xcd9d('0x27')](respondWithResult(_0x5a1c79,null))[_0xcd9d('0x42')](handleError(_0x5a1c79,null));};exports[_0xcd9d('0x28')]=function(_0x346776,_0x5c541e){return db[_0xcd9d('0x2d')][_0xcd9d('0x47')]({'where':{'id':_0x346776[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x5c541e,null))['then'](removeEntity(_0x5c541e,null))[_0xcd9d('0x42')](handleError(_0x5c541e,null));};exports[_0xcd9d('0x4b')]=function(_0x26b475,_0x10fb9f,_0x5bdcfd){var _0x27a363={};var _0x3e6754={};var _0x1bf893;var _0x425e86;return db[_0xcd9d('0x2d')]['findOne']({'where':{'id':_0x26b475[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x10fb9f,null))['then'](function(_0x2c2782){if(_0x2c2782){_0x1bf893=_0x2c2782;_0x3e6754[_0xcd9d('0x30')]=_['keys'](db[_0xcd9d('0x4c')][_0xcd9d('0x45')]);_0x3e6754[_0xcd9d('0x32')]=_[_0xcd9d('0x31')](_0x26b475[_0xcd9d('0x32')]);_0x3e6754[_0xcd9d('0x33')]=_['intersection'](_0x3e6754['model'],_0x3e6754['query']);_0x27a363[_0xcd9d('0x35')]=_[_0xcd9d('0x34')](_0x3e6754[_0xcd9d('0x30')],qs['fields'](_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x27a363['attributes']=_0x27a363[_0xcd9d('0x35')][_0xcd9d('0x4d')]?_0x27a363[_0xcd9d('0x35')]:_0x3e6754['model'];_0x27a363[_0xcd9d('0x38')]=qs[_0xcd9d('0x39')](_0x26b475['query'][_0xcd9d('0x39')]);_0x27a363['where']=qs[_0xcd9d('0x33')](_[_0xcd9d('0x4e')](_0x26b475[_0xcd9d('0x32')],_0x3e6754['filters']));if(_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x3d')]){_0x27a363[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x27a363[_0xcd9d('0x3a')],{'$or':_[_0xcd9d('0x2c')](_0x27a363[_0xcd9d('0x35')],function(_0x288d3e){var _0xf9b506={};_0xf9b506[_0x288d3e]={'$like':'%'+_0x26b475['query'][_0xcd9d('0x3d')]+'%'};return _0xf9b506;})});}_0x27a363=_[_0xcd9d('0x3b')]({},_0x27a363,_0x26b475[_0xcd9d('0x46')]);return _0x1bf893['getConfigurations'](_0x27a363);}})[_0xcd9d('0x27')](function(_0x282048){if(_0x282048){_0x425e86=_0x282048[_0xcd9d('0x4d')];if(!_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x4f')](_0xcd9d('0x37'))){_0x27a363['limit']=qs['limit'](_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x1f')]);_0x27a363[_0xcd9d('0x21')]=qs[_0xcd9d('0x21')](_0x26b475[_0xcd9d('0x32')]['offset']);}return _0x1bf893[_0xcd9d('0x4b')](_0x27a363);}})['then'](function(_0xe4aace){if(_0xe4aace){return _0xe4aace?{'count':_0x425e86,'rows':_0xe4aace}:null;}})['then'](respondWithResult(_0x10fb9f,null))[_0xcd9d('0x42')](handleError(_0x10fb9f,null));};exports['addConfiguration']=function(_0x380e8b,_0x32fd7e,_0x5608f1){if(_0x380e8b[_0xcd9d('0x49')]['id']){delete _0x380e8b['body']['id'];}return db[_0xcd9d('0x2d')][_0xcd9d('0x50')]({'where':{'id':_0x380e8b['params']['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x32fd7e,null))[_0xcd9d('0x27')](function(_0x23998d){if(_0x23998d){_0x380e8b['body'][_0xcd9d('0x51')]=_0x23998d['id'];_0x380e8b['body']['Subjects']=integrations[_0xcd9d('0x52')](_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x53')],_0x380e8b['body'][_0xcd9d('0x2f')]);_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x54')]=integrations[_0xcd9d('0x55')](_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x53')],_0x380e8b['body'][_0xcd9d('0x2f')]);return db[_0xcd9d('0x4c')]['create'](_0x380e8b[_0xcd9d('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0xcd9d('0x56')},{'model':db[_0xcd9d('0x57')],'as':_0xcd9d('0x54')}]});}return null;})[_0xcd9d('0x27')](respondWithResult(_0x32fd7e,null))[_0xcd9d('0x42')](handleError(_0x32fd7e,null));};exports[_0xcd9d('0x58')]=function(_0xf8932c,_0xb62b90,_0x2e7eef){var _0x4a16f8='';return db[_0xcd9d('0x2d')]['findOne']({'where':{'id':_0xf8932c[_0xcd9d('0x44')]['id']},'attributes':['id',_0xcd9d('0x59'),_0xcd9d('0x5a')]})[_0xcd9d('0x27')](handleEntityNotFound(_0xb62b90,null))[_0xcd9d('0x27')](function(_0x5587cf){if(_0x5587cf){_0x4a16f8=_0x5587cf[_0xcd9d('0x59')];var _0x6fe93a=_0x4a16f8[_0xcd9d('0x5b')](-0x1);if(_0x6fe93a==='/'){_0x4a16f8=_0x4a16f8[_0xcd9d('0x5c')](0x0,_0x4a16f8[_0xcd9d('0x5d')](_0x6fe93a));}return rp({'method':'GET','uri':util['format'](_0xcd9d('0x5e'),_0x4a16f8,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xcd9d('0x5f')](_0xcd9d('0x60'),new Buffer(util['format'](_0xcd9d('0x61'),_0x5587cf[_0xcd9d('0x5a')]))[_0xcd9d('0x62')](_0xcd9d('0x63')))},'json':!![]});}})['then'](function(_0x52b1bc){if(_0x52b1bc){var _0x565ee7=['requester','subject',_0xcd9d('0x64'),'description',_0xcd9d('0x1c'),_0xcd9d('0x65'),_0xcd9d('0x66'),_0xcd9d('0x67'),_0xcd9d('0x68'),_0xcd9d('0x66'),'company'];_[_0xcd9d('0x69')](_0x52b1bc,function(_0x470a1d){return _0x565ee7[_0xcd9d('0x6a')](_0x470a1d['name'])||!_0x470a1d[_0xcd9d('0x6b')]&&_0x470a1d[_0xcd9d('0x2f')]!==_0xcd9d('0x6c')&&_0x470a1d['type']!==_0xcd9d('0x6d');});return{'count':_0x52b1bc['length'],'rows':_[_0xcd9d('0x2c')](_0x52b1bc,function(_0x2fbeee){return{'id':_0x2fbeee[_0xcd9d('0x2b')],'name':_0x2fbeee[_0xcd9d('0x6e')],'custom':!_0x2fbeee[_0xcd9d('0x6b')],'options':_0x2fbeee[_0xcd9d('0x6f')]?_[_0xcd9d('0x2c')](_0x2fbeee[_0xcd9d('0x6f')],function(_0x32ad9c){return{'name':_[_0xcd9d('0x70')](_0x32ad9c),'value':_0x32ad9c};}):[]};})};}})['then'](respondWithResult(_0xb62b90,null))['catch'](function(_0xa4ae71){var _0x14b11a=_0xf8932c[_0xcd9d('0x32')][_0xcd9d('0x71')]?0x1f4:_0xa4ae71['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xcd9d('0x58'),_0x14b11a,JSON['stringify'](_0xa4ae71));delete _0xa4ae71[_0xcd9d('0x2b')];if(_0x14b11a===0x191){_0x14b11a=0x190;}_0xb62b90[_0xcd9d('0x1c')](_0x14b11a)[_0xcd9d('0x72')](_0xf8932c[_0xcd9d('0x32')][_0xcd9d('0x71')]?{'message':_0xcd9d('0x73'),'statusCode':_0xa4ae71[_0xcd9d('0x74')]}:_0xa4ae71);});}; \ No newline at end of file +var _0xaa2d=['undefined','count','limit','set','Content-Range','reject','save','then','destroy','stack','name','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','FreshdeskAccount','findAll','catch','show','rawAttributes','length','find','create','body','update','params','getConfigurations','FreshdeskConfiguration','nolimit','findOne','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','format','Basic\x20%s','toString','base64','description','priority','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','json','offset'];(function(_0x61711c,_0x5b2962){var _0x4cf0e9=function(_0x179352){while(--_0x179352){_0x61711c['push'](_0x61711c['shift']());}};_0x4cf0e9(++_0x5b2962);}(_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'];var integrations=require(_0xdaa2('0x13'));function respondWithStatusCode(_0x5c2797,_0x3e6a73){_0x3e6a73=_0x3e6a73||0xcc;return function(_0xf6aa3d){if(_0xf6aa3d){return _0x5c2797[_0xdaa2('0x14')](_0x3e6a73);}return _0x5c2797[_0xdaa2('0x15')](_0x3e6a73)[_0xdaa2('0x16')]();};}function respondWithResult(_0x878f25,_0x29bc7b){_0x29bc7b=_0x29bc7b||0xc8;return function(_0x576b98){if(_0x576b98){return _0x878f25[_0xdaa2('0x15')](_0x29bc7b)[_0xdaa2('0x17')](_0x576b98);}};}function respondWithFilteredResult(_0x185857,_0x262ce4){return function(_0x1970fe){if(_0x1970fe){var _0x2a9fbd=typeof _0x262ce4[_0xdaa2('0x18')]===_0xdaa2('0x19')&&typeof _0x262ce4['limit']===_0xdaa2('0x19');var _0x563b2f=_0x1970fe[_0xdaa2('0x1a')];var _0x523a9a=_0x2a9fbd?0x0:_0x262ce4[_0xdaa2('0x18')];var _0x2f555e=_0x2a9fbd?_0x1970fe[_0xdaa2('0x1a')]:_0x262ce4['offset']+_0x262ce4[_0xdaa2('0x1b')];var _0x1f77cc;if(_0x2f555e>=_0x563b2f){_0x2f555e=_0x563b2f;_0x1f77cc=0xc8;}else{_0x1f77cc=0xce;}_0x185857[_0xdaa2('0x15')](_0x1f77cc);return _0x185857[_0xdaa2('0x1c')](_0xdaa2('0x1d'),_0x523a9a+'-'+_0x2f555e+'/'+_0x563b2f)[_0xdaa2('0x17')](_0x1970fe);}return null;};}function patchUpdates(_0x2d9a81){return function(_0x3ab68f){try{jsonpatch['apply'](_0x3ab68f,_0x2d9a81,!![]);}catch(_0x267fe6){return BPromise[_0xdaa2('0x1e')](_0x267fe6);}return _0x3ab68f[_0xdaa2('0x1f')]();};}function saveUpdates(_0x3d36bb,_0x5893f7){return function(_0x434128){if(_0x434128){return _0x434128['update'](_0x3d36bb)[_0xdaa2('0x20')](function(_0x43e2ec){return _0x43e2ec;});}return null;};}function removeEntity(_0x470242,_0x1c1a6a){return function(_0x45df63){if(_0x45df63){return _0x45df63[_0xdaa2('0x21')]()[_0xdaa2('0x20')](function(){_0x470242[_0xdaa2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41edaa,_0xcf89f7){return function(_0x52743f){if(!_0x52743f){_0x41edaa[_0xdaa2('0x14')](0x194);}return _0x52743f;};}function handleError(_0x1a2098,_0x1faafc){_0x1faafc=_0x1faafc||0x1f4;return function(_0x212f1a){logger['error'](_0x212f1a[_0xdaa2('0x22')]);if(_0x212f1a[_0xdaa2('0x23')]){delete _0x212f1a[_0xdaa2('0x23')];}_0x1a2098['status'](_0x1faafc)['send'](_0x212f1a);};}exports['index']=function(_0x55ff98,_0x429522){var _0x2b3956={},_0x573f2b={},_0x3a8071={'count':0x0,'rows':[]};var _0x4ef89c=_[_0xdaa2('0x24')](db['FreshdeskAccount']['rawAttributes'],function(_0x356832){return{'name':_0x356832[_0xdaa2('0x25')],'type':_0x356832[_0xdaa2('0x26')][_0xdaa2('0x27')]};});_0x573f2b['model']=_[_0xdaa2('0x24')](_0x4ef89c,_0xdaa2('0x23'));_0x573f2b['query']=_[_0xdaa2('0x28')](_0x55ff98[_0xdaa2('0x29')]);_0x573f2b['filters']=_[_0xdaa2('0x2a')](_0x573f2b[_0xdaa2('0x2b')],_0x573f2b[_0xdaa2('0x29')]);_0x2b3956[_0xdaa2('0x2c')]=_['intersection'](_0x573f2b[_0xdaa2('0x2b')],qs[_0xdaa2('0x2d')](_0x55ff98['query'][_0xdaa2('0x2d')]));_0x2b3956[_0xdaa2('0x2c')]=_0x2b3956['attributes']['length']?_0x2b3956['attributes']:_0x573f2b[_0xdaa2('0x2b')];if(!_0x55ff98[_0xdaa2('0x29')][_0xdaa2('0x2e')]('nolimit')){_0x2b3956['limit']=qs[_0xdaa2('0x1b')](_0x55ff98['query'][_0xdaa2('0x1b')]);_0x2b3956[_0xdaa2('0x18')]=qs['offset'](_0x55ff98[_0xdaa2('0x29')][_0xdaa2('0x18')]);}_0x2b3956[_0xdaa2('0x2f')]=qs[_0xdaa2('0x30')](_0x55ff98[_0xdaa2('0x29')][_0xdaa2('0x30')]);_0x2b3956[_0xdaa2('0x31')]=qs[_0xdaa2('0x32')](_[_0xdaa2('0x33')](_0x55ff98['query'],_0x573f2b[_0xdaa2('0x32')]),_0x4ef89c);if(_0x55ff98[_0xdaa2('0x29')]['filter']){_0x2b3956['where']=_[_0xdaa2('0x34')](_0x2b3956[_0xdaa2('0x31')],{'$or':_[_0xdaa2('0x24')](_0x4ef89c,function(_0x2661d5){if(_0x2661d5[_0xdaa2('0x26')]!==_0xdaa2('0x35')){var _0x38dfa0={};_0x38dfa0[_0x2661d5['name']]={'$like':'%'+_0x55ff98[_0xdaa2('0x29')][_0xdaa2('0x36')]+'%'};return _0x38dfa0;}})});}_0x2b3956=_[_0xdaa2('0x34')]({},_0x2b3956,_0x55ff98[_0xdaa2('0x37')]);var _0xfdd21b={'where':_0x2b3956[_0xdaa2('0x31')]};return db['FreshdeskAccount'][_0xdaa2('0x1a')](_0xfdd21b)[_0xdaa2('0x20')](function(_0x4afa1b){_0x3a8071[_0xdaa2('0x1a')]=_0x4afa1b;if(_0x55ff98[_0xdaa2('0x29')][_0xdaa2('0x38')]){_0x2b3956[_0xdaa2('0x39')]=[{'all':!![]}];}return db[_0xdaa2('0x3a')][_0xdaa2('0x3b')](_0x2b3956);})['then'](function(_0x1161d1){_0x3a8071['rows']=_0x1161d1;return _0x3a8071;})[_0xdaa2('0x20')](respondWithFilteredResult(_0x429522,_0x2b3956))[_0xdaa2('0x3c')](handleError(_0x429522,null));};exports[_0xdaa2('0x3d')]=function(_0x506442,_0x37fe55){var _0x31f362={'raw':![],'where':{'id':_0x506442['params']['id']}},_0x473ff4={};_0x473ff4['model']=_[_0xdaa2('0x28')](db[_0xdaa2('0x3a')][_0xdaa2('0x3e')]);_0x473ff4[_0xdaa2('0x29')]=_[_0xdaa2('0x28')](_0x506442['query']);_0x473ff4[_0xdaa2('0x32')]=_['intersection'](_0x473ff4[_0xdaa2('0x2b')],_0x473ff4[_0xdaa2('0x29')]);_0x31f362[_0xdaa2('0x2c')]=_[_0xdaa2('0x2a')](_0x473ff4[_0xdaa2('0x2b')],qs[_0xdaa2('0x2d')](_0x506442['query']['fields']));_0x31f362[_0xdaa2('0x2c')]=_0x31f362[_0xdaa2('0x2c')][_0xdaa2('0x3f')]?_0x31f362['attributes']:_0x473ff4[_0xdaa2('0x2b')];if(_0x506442['query'][_0xdaa2('0x38')]){_0x31f362[_0xdaa2('0x39')]=[{'all':!![]}];}_0x31f362=_[_0xdaa2('0x34')]({},_0x31f362,_0x506442['options']);return db[_0xdaa2('0x3a')][_0xdaa2('0x40')](_0x31f362)[_0xdaa2('0x20')](handleEntityNotFound(_0x37fe55,null))['then'](respondWithResult(_0x37fe55,null))[_0xdaa2('0x3c')](handleError(_0x37fe55,null));};exports[_0xdaa2('0x41')]=function(_0x408d32,_0x587daf){return db[_0xdaa2('0x3a')][_0xdaa2('0x41')](_0x408d32[_0xdaa2('0x42')],{})[_0xdaa2('0x20')](respondWithResult(_0x587daf,0xc9))['catch'](handleError(_0x587daf,null));};exports[_0xdaa2('0x43')]=function(_0x1966ad,_0x2409e6){if(_0x1966ad[_0xdaa2('0x42')]['id']){delete _0x1966ad[_0xdaa2('0x42')]['id'];}return db['FreshdeskAccount'][_0xdaa2('0x40')]({'where':{'id':_0x1966ad[_0xdaa2('0x44')]['id']}})['then'](handleEntityNotFound(_0x2409e6,null))[_0xdaa2('0x20')](saveUpdates(_0x1966ad[_0xdaa2('0x42')],null))[_0xdaa2('0x20')](respondWithResult(_0x2409e6,null))['catch'](handleError(_0x2409e6,null));};exports[_0xdaa2('0x21')]=function(_0x3db104,_0x5f20ab){return db[_0xdaa2('0x3a')][_0xdaa2('0x40')]({'where':{'id':_0x3db104[_0xdaa2('0x44')]['id']}})[_0xdaa2('0x20')](handleEntityNotFound(_0x5f20ab,null))[_0xdaa2('0x20')](removeEntity(_0x5f20ab,null))[_0xdaa2('0x3c')](handleError(_0x5f20ab,null));};exports[_0xdaa2('0x45')]=function(_0x126362,_0x459c63,_0x28c90d){var _0x479e7d={};var _0x52d24d={};var _0x46e27c;var _0x26f69b;return db[_0xdaa2('0x3a')]['findOne']({'where':{'id':_0x126362['params']['id']}})[_0xdaa2('0x20')](handleEntityNotFound(_0x459c63,null))['then'](function(_0x5a9291){if(_0x5a9291){_0x46e27c=_0x5a9291;_0x52d24d['model']=_[_0xdaa2('0x28')](db[_0xdaa2('0x46')][_0xdaa2('0x3e')]);_0x52d24d[_0xdaa2('0x29')]=_['keys'](_0x126362['query']);_0x52d24d[_0xdaa2('0x32')]=_['intersection'](_0x52d24d[_0xdaa2('0x2b')],_0x52d24d[_0xdaa2('0x29')]);_0x479e7d[_0xdaa2('0x2c')]=_[_0xdaa2('0x2a')](_0x52d24d[_0xdaa2('0x2b')],qs['fields'](_0x126362[_0xdaa2('0x29')][_0xdaa2('0x2d')]));_0x479e7d[_0xdaa2('0x2c')]=_0x479e7d[_0xdaa2('0x2c')][_0xdaa2('0x3f')]?_0x479e7d[_0xdaa2('0x2c')]:_0x52d24d[_0xdaa2('0x2b')];_0x479e7d[_0xdaa2('0x2f')]=qs[_0xdaa2('0x30')](_0x126362[_0xdaa2('0x29')][_0xdaa2('0x30')]);_0x479e7d[_0xdaa2('0x31')]=qs[_0xdaa2('0x32')](_[_0xdaa2('0x33')](_0x126362[_0xdaa2('0x29')],_0x52d24d[_0xdaa2('0x32')]));if(_0x126362[_0xdaa2('0x29')][_0xdaa2('0x36')]){_0x479e7d[_0xdaa2('0x31')]=_[_0xdaa2('0x34')](_0x479e7d[_0xdaa2('0x31')],{'$or':_[_0xdaa2('0x24')](_0x479e7d[_0xdaa2('0x2c')],function(_0x1bd6f5){var _0x5f01e6={};_0x5f01e6[_0x1bd6f5]={'$like':'%'+_0x126362[_0xdaa2('0x29')][_0xdaa2('0x36')]+'%'};return _0x5f01e6;})});}_0x479e7d=_[_0xdaa2('0x34')]({},_0x479e7d,_0x126362[_0xdaa2('0x37')]);return _0x46e27c[_0xdaa2('0x45')](_0x479e7d);}})[_0xdaa2('0x20')](function(_0x35dd76){if(_0x35dd76){_0x26f69b=_0x35dd76['length'];if(!_0x126362[_0xdaa2('0x29')][_0xdaa2('0x2e')](_0xdaa2('0x47'))){_0x479e7d[_0xdaa2('0x1b')]=qs[_0xdaa2('0x1b')](_0x126362['query'][_0xdaa2('0x1b')]);_0x479e7d[_0xdaa2('0x18')]=qs[_0xdaa2('0x18')](_0x126362[_0xdaa2('0x29')][_0xdaa2('0x18')]);}return _0x46e27c[_0xdaa2('0x45')](_0x479e7d);}})[_0xdaa2('0x20')](function(_0x493337){if(_0x493337){return _0x493337?{'count':_0x26f69b,'rows':_0x493337}:null;}})[_0xdaa2('0x20')](respondWithResult(_0x459c63,null))['catch'](handleError(_0x459c63,null));};exports['addConfiguration']=function(_0xd206b3,_0x2428b3,_0x45052e){if(_0xd206b3[_0xdaa2('0x42')]['id']){delete _0xd206b3[_0xdaa2('0x42')]['id'];}return db['FreshdeskAccount'][_0xdaa2('0x48')]({'where':{'id':_0xd206b3[_0xdaa2('0x44')]['id']}})[_0xdaa2('0x20')](handleEntityNotFound(_0x2428b3,null))[_0xdaa2('0x20')](function(_0x4ec8ce){if(_0x4ec8ce){_0xd206b3['body']['AccountId']=_0x4ec8ce['id'];_0xd206b3[_0xdaa2('0x42')][_0xdaa2('0x49')]=integrations[_0xdaa2('0x4a')](_0xd206b3[_0xdaa2('0x42')][_0xdaa2('0x4b')],_0xd206b3[_0xdaa2('0x42')]['type']);_0xd206b3[_0xdaa2('0x42')]['Descriptions']=integrations['getDescriptions'](_0xd206b3[_0xdaa2('0x42')][_0xdaa2('0x4b')],_0xd206b3[_0xdaa2('0x42')][_0xdaa2('0x26')]);return db[_0xdaa2('0x46')][_0xdaa2('0x41')](_0xd206b3[_0xdaa2('0x42')],{'include':[{'model':db[_0xdaa2('0x4c')],'as':_0xdaa2('0x49')},{'model':db[_0xdaa2('0x4c')],'as':_0xdaa2('0x4d')}]});}return null;})['then'](respondWithResult(_0x2428b3,null))[_0xdaa2('0x3c')](handleError(_0x2428b3,null));};exports[_0xdaa2('0x4e')]=function(_0xfa2648,_0x2fa64b,_0x22a8cb){var _0x52e245='';return db[_0xdaa2('0x3a')][_0xdaa2('0x48')]({'where':{'id':_0xfa2648['params']['id']},'attributes':['id',_0xdaa2('0x4f'),_0xdaa2('0x50')]})[_0xdaa2('0x20')](handleEntityNotFound(_0x2fa64b,null))[_0xdaa2('0x20')](function(_0x21e8bb){if(_0x21e8bb){_0x52e245=_0x21e8bb[_0xdaa2('0x4f')];var _0x523d3d=_0x52e245[_0xdaa2('0x51')](-0x1);if(_0x523d3d==='/'){_0x52e245=_0x52e245['substring'](0x0,_0x52e245[_0xdaa2('0x52')](_0x523d3d));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x52e245,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xdaa2('0x53')](_0xdaa2('0x54'),new Buffer(util['format']('%s:X',_0x21e8bb[_0xdaa2('0x50')]))[_0xdaa2('0x55')](_0xdaa2('0x56')))},'json':!![]});}})['then'](function(_0x37fbcb){if(_0x37fbcb){var _0x48a216=['requester','subject','agent',_0xdaa2('0x57'),'status',_0xdaa2('0x58'),_0xdaa2('0x59'),_0xdaa2('0x5a'),_0xdaa2('0x5b'),_0xdaa2('0x59'),_0xdaa2('0x5c')];_['remove'](_0x37fbcb,function(_0x37de8a){return _0x48a216['includes'](_0x37de8a[_0xdaa2('0x23')])||!_0x37de8a[_0xdaa2('0x5d')]&&_0x37de8a[_0xdaa2('0x26')]!==_0xdaa2('0x5e')&&_0x37de8a[_0xdaa2('0x26')]!==_0xdaa2('0x5f');});return{'count':_0x37fbcb['length'],'rows':_[_0xdaa2('0x24')](_0x37fbcb,function(_0x283131){return{'id':_0x283131[_0xdaa2('0x23')],'name':_0x283131[_0xdaa2('0x60')],'custom':!_0x283131[_0xdaa2('0x5d')],'options':_0x283131[_0xdaa2('0x61')]?_[_0xdaa2('0x24')](_0x283131['choices'],function(_0x3725b1){return{'name':_['capitalize'](_0x3725b1),'value':_0x3725b1};}):[]};})};}})[_0xdaa2('0x20')](respondWithResult(_0x2fa64b,null))[_0xdaa2('0x3c')](function(_0xab2b13){var _0x5e1288=_0xfa2648[_0xdaa2('0x29')][_0xdaa2('0x62')]?0x1f4:_0xab2b13[_0xdaa2('0x63')]||0x1f4;logger[_0xdaa2('0x64')]('getFields,\x20%s,\x20%s,\x20%s',_0xdaa2('0x4e'),_0x5e1288,JSON[_0xdaa2('0x65')](_0xab2b13));delete _0xab2b13[_0xdaa2('0x23')];if(_0x5e1288===0x191){_0x5e1288=0x190;}_0x2fa64b[_0xdaa2('0x15')](_0x5e1288)['send'](_0xfa2648[_0xdaa2('0x29')]['test']?{'message':_0xdaa2('0x66'),'statusCode':_0xab2b13['statusCode']}:_0xab2b13);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 3eb5bab..9f609b7 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 _0x24b8=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x1785a3,_0x319e55){var _0x4c97c0=function(_0xbbf1e6){while(--_0xbbf1e6){_0x1785a3['push'](_0x1785a3['shift']());}};_0x4c97c0(++_0x319e55);}(_0x24b8,0xad));var _0x824b=function(_0x17a74f,_0x5be372){_0x17a74f=_0x17a74f-0x0;var _0x21a545=_0x24b8[_0x17a74f];return _0x21a545;};'use strict';var _=require(_0x824b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x824b('0x1'));var moment=require('moment');var BPromise=require(_0x824b('0x2'));var rp=require(_0x824b('0x3'));var fs=require('fs');var path=require(_0x824b('0x4'));var rimraf=require(_0x824b('0x5'));var config=require('../../config/environment');var attributes=require(_0x824b('0x6'));var integrations=require(_0x824b('0x7'));module[_0x824b('0x8')]=function(_0x175030,_0x707712){return _0x175030[_0x824b('0x9')](_0x824b('0xa'),attributes,{'tableName':_0x824b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7055=['../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','util','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x147023,_0xd4674d){var _0x5b6c2a=function(_0x4bbcf7){while(--_0x4bbcf7){_0x147023['push'](_0x147023['shift']());}};_0x5b6c2a(++_0xd4674d);}(_0x7055,0x19b));var _0x5705=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x7055[_0x38fb8b];return _0x1ec681;};'use strict';var _=require('lodash');var util=require(_0x5705('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5705('0x1'));var BPromise=require(_0x5705('0x2'));var rp=require(_0x5705('0x3'));var fs=require('fs');var path=require(_0x5705('0x4'));var rimraf=require('rimraf');var config=require(_0x5705('0x5'));var attributes=require(_0x5705('0x6'));var integrations=require(_0x5705('0x7'));module[_0x5705('0x8')]=function(_0xd2d3ce,_0x3a0742){return _0xd2d3ce['define'](_0x5705('0x9'),attributes,{'tableName':_0x5705('0xa'),'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 20e4808..9850131 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 _0xb0d2=['where','attributes','map','model','include','catch','ShowFreshdeskAccount','FreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','findAll','options','raw'];(function(_0x3baaaf,_0x2f8fe7){var _0x43d428=function(_0x46d9f6){while(--_0x46d9f6){_0x3baaaf['push'](_0x3baaaf['shift']());}};_0x43d428(++_0x2f8fe7);}(_0xb0d2,0x1cf));var _0x2b0d=function(_0x1717b5,_0xef8edb){_0x1717b5=_0x1717b5-0x0;var _0x9d84d9=_0xb0d2[_0x1717b5];return _0x9d84d9;};'use strict';var _=require(_0x2b0d('0x0'));var util=require(_0x2b0d('0x1'));var moment=require(_0x2b0d('0x2'));var BPromise=require(_0x2b0d('0x3'));var rs=require(_0x2b0d('0x4'));var fs=require('fs');var Redis=require(_0x2b0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b0d('0x6'));var logger=require('../../config/logger')(_0x2b0d('0x7'));var config=require(_0x2b0d('0x8'));var jayson=require(_0x2b0d('0x9'));var client=jayson['client'][_0x2b0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1544db,_0x4d35f9,_0x3ded89){return new BPromise(function(_0x2481d8,_0x5de0a4){return client[_0x2b0d('0xb')](_0x1544db,_0x3ded89)[_0x2b0d('0xc')](function(_0x5b1b90){logger[_0x2b0d('0xd')](_0x2b0d('0xe'),_0x4d35f9,_0x2b0d('0xf'));logger[_0x2b0d('0x10')](_0x2b0d('0x11'),_0x4d35f9,_0x2b0d('0xf'),JSON[_0x2b0d('0x12')](_0x5b1b90));if(_0x5b1b90[_0x2b0d('0x13')]){if(_0x5b1b90[_0x2b0d('0x13')][_0x2b0d('0x14')]===0x1f4){logger[_0x2b0d('0x13')](_0x2b0d('0xe'),_0x4d35f9,_0x5b1b90[_0x2b0d('0x13')]['message']);return _0x5de0a4(_0x5b1b90[_0x2b0d('0x13')]['message']);}logger[_0x2b0d('0x13')](_0x2b0d('0xe'),_0x4d35f9,_0x5b1b90[_0x2b0d('0x13')][_0x2b0d('0x15')]);return _0x2481d8(_0x5b1b90[_0x2b0d('0x13')][_0x2b0d('0x15')]);}else{logger['info'](_0x2b0d('0xe'),_0x4d35f9,_0x2b0d('0xf'));_0x2481d8(_0x5b1b90[_0x2b0d('0x16')][_0x2b0d('0x15')]);}})['catch'](function(_0x518403){logger[_0x2b0d('0x13')](_0x2b0d('0xe'),_0x4d35f9,_0x518403);_0x5de0a4(_0x518403);});});}exports[_0x2b0d('0x17')]=function(_0x33c8d2){var _0x5bbe6a=this;return new Promise(function(_0x42685f,_0x148c7d){return db['FreshdeskAccount'][_0x2b0d('0x18')]({'raw':_0x33c8d2['options']?_0x33c8d2[_0x2b0d('0x19')][_0x2b0d('0x1a')]===undefined?!![]:![]:!![],'where':_0x33c8d2['options']?_0x33c8d2[_0x2b0d('0x19')][_0x2b0d('0x1b')]||null:null,'attributes':_0x33c8d2['options']?_0x33c8d2['options'][_0x2b0d('0x1c')]||null:null,'limit':_0x33c8d2[_0x2b0d('0x19')]?_0x33c8d2[_0x2b0d('0x19')]['limit']||null:null,'include':_0x33c8d2[_0x2b0d('0x19')]?_0x33c8d2[_0x2b0d('0x19')]['include']?_[_0x2b0d('0x1d')](_0x33c8d2[_0x2b0d('0x19')]['include'],function(_0x344aa4){return{'model':db[_0x344aa4[_0x2b0d('0x1e')]],'as':_0x344aa4['as'],'attributes':_0x344aa4[_0x2b0d('0x1c')],'include':_0x344aa4[_0x2b0d('0x1f')]?_[_0x2b0d('0x1d')](_0x344aa4[_0x2b0d('0x1f')],function(_0x2613f5){return{'model':db[_0x2613f5[_0x2b0d('0x1e')]],'as':_0x2613f5['as'],'attributes':_0x2613f5['attributes'],'include':_0x2613f5[_0x2b0d('0x1f')]?_[_0x2b0d('0x1d')](_0x2613f5[_0x2b0d('0x1f')],function(_0x4c4ca0){return{'model':db[_0x4c4ca0[_0x2b0d('0x1e')]],'as':_0x4c4ca0['as'],'attributes':_0x4c4ca0[_0x2b0d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2b0d('0xc')](function(_0xc1d23c){logger['info'](_0x2b0d('0x17'),_0x33c8d2);logger[_0x2b0d('0x10')](_0x2b0d('0x17'),_0x33c8d2,JSON[_0x2b0d('0x12')](_0xc1d23c));_0x42685f(_0xc1d23c);})[_0x2b0d('0x20')](function(_0x1cf880){logger['error']('GetFreshdeskAccount',_0x1cf880[_0x2b0d('0x15')],_0x33c8d2);_0x148c7d(_0x5bbe6a['error'](0x1f4,_0x1cf880[_0x2b0d('0x15')]));});});};exports[_0x2b0d('0x21')]=function(_0x1f4c86){var _0x45b108=this;return new Promise(function(_0x5e8964,_0x70c913){return db[_0x2b0d('0x22')]['find']({'raw':_0x1f4c86['options']?_0x1f4c86[_0x2b0d('0x19')][_0x2b0d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f4c86[_0x2b0d('0x19')]?_0x1f4c86[_0x2b0d('0x19')]['where']||null:null,'attributes':_0x1f4c86['options']?_0x1f4c86[_0x2b0d('0x19')][_0x2b0d('0x1c')]||null:null,'include':_0x1f4c86[_0x2b0d('0x19')]?_0x1f4c86[_0x2b0d('0x19')][_0x2b0d('0x1f')]?_[_0x2b0d('0x1d')](_0x1f4c86[_0x2b0d('0x19')][_0x2b0d('0x1f')],function(_0x3f61fe){return{'model':db[_0x3f61fe['model']],'as':_0x3f61fe['as'],'attributes':_0x3f61fe['attributes'],'include':_0x3f61fe[_0x2b0d('0x1f')]?_[_0x2b0d('0x1d')](_0x3f61fe[_0x2b0d('0x1f')],function(_0x5e1adc){return{'model':db[_0x5e1adc[_0x2b0d('0x1e')]],'as':_0x5e1adc['as'],'attributes':_0x5e1adc[_0x2b0d('0x1c')],'include':_0x5e1adc[_0x2b0d('0x1f')]?_[_0x2b0d('0x1d')](_0x5e1adc[_0x2b0d('0x1f')],function(_0x17ee7e){return{'model':db[_0x17ee7e[_0x2b0d('0x1e')]],'as':_0x17ee7e['as'],'attributes':_0x17ee7e[_0x2b0d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2b0d('0xc')](function(_0x2eefb4){logger[_0x2b0d('0xd')]('ShowFreshdeskAccount',_0x1f4c86);logger['debug'](_0x2b0d('0x21'),_0x1f4c86,JSON[_0x2b0d('0x12')](_0x2eefb4));_0x5e8964(_0x2eefb4);})[_0x2b0d('0x20')](function(_0x1c655a){logger['error'](_0x2b0d('0x21'),_0x1c655a[_0x2b0d('0x15')],_0x1f4c86);_0x70c913(_0x45b108[_0x2b0d('0x13')](0x1f4,_0x1c655a[_0x2b0d('0x15')]));});});}; \ No newline at end of file +var _0x7079=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','include','model','attributes','map','then','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash'];(function(_0x394315,_0x38b3b9){var _0x1cfee6=function(_0x3121ff){while(--_0x3121ff){_0x394315['push'](_0x394315['shift']());}};_0x1cfee6(++_0x38b3b9);}(_0x7079,0x68));var _0x9707=function(_0x74d7e4,_0x3ee0b0){_0x74d7e4=_0x74d7e4-0x0;var _0xbd61bc=_0x7079[_0x74d7e4];return _0xbd61bc;};'use strict';var _=require(_0x9707('0x0'));var util=require(_0x9707('0x1'));var moment=require('moment');var BPromise=require(_0x9707('0x2'));var rs=require(_0x9707('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9707('0x4'))['db'];var utils=require(_0x9707('0x5'));var logger=require(_0x9707('0x6'))('rpc');var config=require(_0x9707('0x7'));var jayson=require(_0x9707('0x8'));var client=jayson[_0x9707('0x9')][_0x9707('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28160d,_0x40761e,_0x3c43c7){return new BPromise(function(_0x2c4afa,_0x20e436){return client['request'](_0x28160d,_0x3c43c7)['then'](function(_0x431bad){logger[_0x9707('0xb')](_0x9707('0xc'),_0x40761e,_0x9707('0xd'));logger[_0x9707('0xe')](_0x9707('0xf'),_0x40761e,_0x9707('0xd'),JSON['stringify'](_0x431bad));if(_0x431bad[_0x9707('0x10')]){if(_0x431bad['error'][_0x9707('0x11')]===0x1f4){logger[_0x9707('0x10')](_0x9707('0xc'),_0x40761e,_0x431bad[_0x9707('0x10')][_0x9707('0x12')]);return _0x20e436(_0x431bad['error'][_0x9707('0x12')]);}logger['error'](_0x9707('0xc'),_0x40761e,_0x431bad[_0x9707('0x10')][_0x9707('0x12')]);return _0x2c4afa(_0x431bad['error'][_0x9707('0x12')]);}else{logger['info'](_0x9707('0xc'),_0x40761e,_0x9707('0xd'));_0x2c4afa(_0x431bad[_0x9707('0x13')]['message']);}})[_0x9707('0x14')](function(_0x353d9e){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x40761e,_0x353d9e);_0x20e436(_0x353d9e);});});}exports[_0x9707('0x15')]=function(_0x4084eb){var _0x36e0d3=this;return new Promise(function(_0x3be78c,_0x48c86f){return db['FreshdeskAccount'][_0x9707('0x16')]({'raw':_0x4084eb[_0x9707('0x17')]?_0x4084eb[_0x9707('0x17')][_0x9707('0x18')]===undefined?!![]:![]:!![],'where':_0x4084eb[_0x9707('0x17')]?_0x4084eb[_0x9707('0x17')][_0x9707('0x19')]||null:null,'attributes':_0x4084eb[_0x9707('0x17')]?_0x4084eb[_0x9707('0x17')]['attributes']||null:null,'limit':_0x4084eb[_0x9707('0x17')]?_0x4084eb[_0x9707('0x17')]['limit']||null:null,'include':_0x4084eb['options']?_0x4084eb[_0x9707('0x17')][_0x9707('0x1a')]?_['map'](_0x4084eb['options'][_0x9707('0x1a')],function(_0x1f1e00){return{'model':db[_0x1f1e00[_0x9707('0x1b')]],'as':_0x1f1e00['as'],'attributes':_0x1f1e00[_0x9707('0x1c')],'include':_0x1f1e00['include']?_['map'](_0x1f1e00[_0x9707('0x1a')],function(_0x2f4671){return{'model':db[_0x2f4671[_0x9707('0x1b')]],'as':_0x2f4671['as'],'attributes':_0x2f4671[_0x9707('0x1c')],'include':_0x2f4671[_0x9707('0x1a')]?_[_0x9707('0x1d')](_0x2f4671[_0x9707('0x1a')],function(_0x382ad5){return{'model':db[_0x382ad5[_0x9707('0x1b')]],'as':_0x382ad5['as'],'attributes':_0x382ad5[_0x9707('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9707('0x1e')](function(_0x41f873){logger[_0x9707('0xb')](_0x9707('0x15'),_0x4084eb);logger[_0x9707('0xe')](_0x9707('0x15'),_0x4084eb,JSON[_0x9707('0x1f')](_0x41f873));_0x3be78c(_0x41f873);})[_0x9707('0x14')](function(_0x19accd){logger[_0x9707('0x10')]('GetFreshdeskAccount',_0x19accd[_0x9707('0x12')],_0x4084eb);_0x48c86f(_0x36e0d3[_0x9707('0x10')](0x1f4,_0x19accd[_0x9707('0x12')]));});});};exports[_0x9707('0x20')]=function(_0x2ee6b5){var _0x4183f7=this;return new Promise(function(_0x1ff43b,_0x1ec7e8){return db[_0x9707('0x21')][_0x9707('0x22')]({'raw':_0x2ee6b5[_0x9707('0x17')]?_0x2ee6b5[_0x9707('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2ee6b5['options']?_0x2ee6b5[_0x9707('0x17')]['where']||null:null,'attributes':_0x2ee6b5[_0x9707('0x17')]?_0x2ee6b5[_0x9707('0x17')][_0x9707('0x1c')]||null:null,'include':_0x2ee6b5[_0x9707('0x17')]?_0x2ee6b5['options'][_0x9707('0x1a')]?_[_0x9707('0x1d')](_0x2ee6b5[_0x9707('0x17')]['include'],function(_0x24079b){return{'model':db[_0x24079b[_0x9707('0x1b')]],'as':_0x24079b['as'],'attributes':_0x24079b[_0x9707('0x1c')],'include':_0x24079b[_0x9707('0x1a')]?_[_0x9707('0x1d')](_0x24079b[_0x9707('0x1a')],function(_0x5685d2){return{'model':db[_0x5685d2[_0x9707('0x1b')]],'as':_0x5685d2['as'],'attributes':_0x5685d2[_0x9707('0x1c')],'include':_0x5685d2[_0x9707('0x1a')]?_['map'](_0x5685d2[_0x9707('0x1a')],function(_0x1212b0){return{'model':db[_0x1212b0[_0x9707('0x1b')]],'as':_0x1212b0['as'],'attributes':_0x1212b0[_0x9707('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9707('0x1e')](function(_0x18285a){logger[_0x9707('0xb')](_0x9707('0x20'),_0x2ee6b5);logger[_0x9707('0xe')](_0x9707('0x20'),_0x2ee6b5,JSON[_0x9707('0x1f')](_0x18285a));_0x1ff43b(_0x18285a);})['catch'](function(_0x371336){logger[_0x9707('0x10')](_0x9707('0x20'),_0x371336['message'],_0x2ee6b5);_0x1ec7e8(_0x4183f7[_0x9707('0x10')](0x1f4,_0x371336[_0x9707('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index af1b2db..79af06e 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 _0x5d67=['/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','put','/:id','update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','show','/:id/fields','isAuthenticated','getFields'];(function(_0x29efed,_0x4ef8d0){var _0x155f12=function(_0x542216){while(--_0x542216){_0x29efed['push'](_0x29efed['shift']());}};_0x155f12(++_0x4ef8d0);}(_0x5d67,0xd3));var _0x75d6=function(_0x27c1f2,_0x2692e3){_0x27c1f2=_0x27c1f2-0x0;var _0x41771d=_0x5d67[_0x27c1f2];return _0x41771d;};'use strict';var multer=require(_0x75d6('0x0'));var util=require('util');var path=require(_0x75d6('0x1'));var timeout=require(_0x75d6('0x2'));var express=require('express');var router=express[_0x75d6('0x3')]();var fs_extra=require(_0x75d6('0x4'));var auth=require(_0x75d6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x75d6('0x6'));var controller=require(_0x75d6('0x7'));router[_0x75d6('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x75d6('0xa')]);router[_0x75d6('0x8')](_0x75d6('0xb'),auth[_0x75d6('0xc')](),controller[_0x75d6('0xd')]);router[_0x75d6('0x8')](_0x75d6('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x75d6('0x8')](_0x75d6('0xf'),auth['isAuthenticated'](),controller[_0x75d6('0x10')]);router[_0x75d6('0x8')]('/:id/tags',auth[_0x75d6('0xc')](),controller[_0x75d6('0x11')]);router[_0x75d6('0x12')]('/',auth[_0x75d6('0xc')](),controller['create']);router[_0x75d6('0x12')](_0x75d6('0x13'),auth[_0x75d6('0xc')](),controller[_0x75d6('0x14')]);router[_0x75d6('0x15')](_0x75d6('0x16'),auth['isAuthenticated'](),controller[_0x75d6('0x17')]);router['delete'](_0x75d6('0x16'),auth[_0x75d6('0xc')](),controller[_0x75d6('0x18')]);module['exports']=router; \ No newline at end of file +var _0xfc7b=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xfc7b,0xca));var _0xbfc7=function(_0x54003c,_0x3e3ea0){_0x54003c=_0x54003c-0x0;var _0x16884=_0xfc7b[_0x54003c];return _0x16884;};'use strict';var multer=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var path=require(_0xbfc7('0x2'));var timeout=require(_0xbfc7('0x3'));var express=require('express');var router=express[_0xbfc7('0x4')]();var fs_extra=require(_0xbfc7('0x5'));var auth=require(_0xbfc7('0x6'));var interaction=require(_0xbfc7('0x7'));var config=require(_0xbfc7('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xbfc7('0x9')]('/',auth['isAuthenticated'](),controller[_0xbfc7('0xa')]);router[_0xbfc7('0x9')](_0xbfc7('0xb'),auth[_0xbfc7('0xc')](),controller[_0xbfc7('0xd')]);router['get'](_0xbfc7('0xe'),auth[_0xbfc7('0xc')](),controller[_0xbfc7('0xf')]);router[_0xbfc7('0x9')](_0xbfc7('0x10'),auth[_0xbfc7('0xc')](),controller[_0xbfc7('0x11')]);router[_0xbfc7('0x9')](_0xbfc7('0x12'),auth[_0xbfc7('0xc')](),controller['getDescriptions']);router[_0xbfc7('0x9')](_0xbfc7('0x13'),auth[_0xbfc7('0xc')](),controller[_0xbfc7('0x14')]);router[_0xbfc7('0x15')]('/',auth['isAuthenticated'](),controller[_0xbfc7('0x16')]);router[_0xbfc7('0x15')]('/:id/tags',auth[_0xbfc7('0xc')](),controller[_0xbfc7('0x17')]);router[_0xbfc7('0x18')](_0xbfc7('0xb'),auth[_0xbfc7('0xc')](),controller[_0xbfc7('0x19')]);router['delete'](_0xbfc7('0xb'),auth[_0xbfc7('0xc')](),controller['destroy']);module[_0xbfc7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 431d7f4..a389a0d 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 _0xd523=['sequelize','exports','STRING'];(function(_0x5c85c8,_0x16110b){var _0x42d66f=function(_0x2c6dda){while(--_0x2c6dda){_0x5c85c8['push'](_0x5c85c8['shift']());}};_0x42d66f(++_0x16110b);}(_0xd523,0x147));var _0x3d52=function(_0x1d8aa5,_0x291157){_0x1d8aa5=_0x1d8aa5-0x0;var _0x2e09a8=_0xd523[_0x1d8aa5];return _0x2e09a8;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'name':{'type':Sequelize[_0x3d52('0x2')]},'description':{'type':Sequelize[_0x3d52('0x2')]}}; \ No newline at end of file +var _0x50f7=['STRING','sequelize'];(function(_0x2831a4,_0x1fc18e){var _0xa25f09=function(_0x9b9df4){while(--_0x9b9df4){_0x2831a4['push'](_0x2831a4['shift']());}};_0xa25f09(++_0x1fc18e);}(_0x50f7,0xb1));var _0x750f=function(_0x2fac1d,_0x1994d6){_0x2fac1d=_0x2fac1d-0x0;var _0x55383a=_0x50f7[_0x2fac1d];return _0x55383a;};'use strict';var Sequelize=require(_0x750f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x750f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 167b15e..5883d01 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 _0xd596=['query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','catch','params','length','create','body','find','destroy','getFields','findOne','FreshdeskField','map','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','fieldName','type','key','model','keys','filters','intersection'];(function(_0xd553ab,_0x788918){var _0x215442=function(_0x5b32f8){while(--_0x5b32f8){_0xd553ab['push'](_0xd553ab['shift']());}};_0x215442(++_0x788918);}(_0xd596,0x175));var _0x6d59=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xd596[_0x54a2e4];return _0x4742d0;};'use strict';var emlformat=require(_0x6d59('0x0'));var rimraf=require(_0x6d59('0x1'));var zipdir=require(_0x6d59('0x2'));var jsonpatch=require(_0x6d59('0x3'));var rp=require(_0x6d59('0x4'));var moment=require(_0x6d59('0x5'));var BPromise=require(_0x6d59('0x6'));var Mustache=require(_0x6d59('0x7'));var util=require(_0x6d59('0x8'));var path=require(_0x6d59('0x9'));var sox=require(_0x6d59('0xa'));var csv=require(_0x6d59('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d59('0xc'));var squel=require(_0x6d59('0xd'));var crypto=require(_0x6d59('0xe'));var jsforce=require(_0x6d59('0xf'));var deskjs=require(_0x6d59('0x10'));var toCsv=require(_0x6d59('0xb'));var querystring=require(_0x6d59('0x11'));var Papa=require(_0x6d59('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d59('0x13'));var hardwareService=require(_0x6d59('0x14'));var logger=require(_0x6d59('0x15'))(_0x6d59('0x16'));var utils=require('../../config/utils');var config=require(_0x6d59('0x17'));var licenseUtil=require(_0x6d59('0x18'));var db=require(_0x6d59('0x19'))['db'];function respondWithStatusCode(_0x1284df,_0x2d6dec){_0x2d6dec=_0x2d6dec||0xcc;return function(_0x360b01){if(_0x360b01){return _0x1284df[_0x6d59('0x1a')](_0x2d6dec);}return _0x1284df[_0x6d59('0x1b')](_0x2d6dec)[_0x6d59('0x1c')]();};}function respondWithResult(_0x31b1c3,_0x37a366){_0x37a366=_0x37a366||0xc8;return function(_0x26a1bd){if(_0x26a1bd){return _0x31b1c3['status'](_0x37a366)[_0x6d59('0x1d')](_0x26a1bd);}};}function respondWithFilteredResult(_0x1d58f2,_0x177d5b){return function(_0x597b25){if(_0x597b25){var _0x1d51ec=typeof _0x177d5b[_0x6d59('0x1e')]===_0x6d59('0x1f')&&typeof _0x177d5b[_0x6d59('0x20')]===_0x6d59('0x1f');var _0x3ced2c=_0x597b25[_0x6d59('0x21')];var _0x19e807=_0x1d51ec?0x0:_0x177d5b['offset'];var _0x1f68ec=_0x1d51ec?_0x597b25['count']:_0x177d5b[_0x6d59('0x1e')]+_0x177d5b[_0x6d59('0x20')];var _0x394cfe;if(_0x1f68ec>=_0x3ced2c){_0x1f68ec=_0x3ced2c;_0x394cfe=0xc8;}else{_0x394cfe=0xce;}_0x1d58f2[_0x6d59('0x1b')](_0x394cfe);return _0x1d58f2[_0x6d59('0x22')](_0x6d59('0x23'),_0x19e807+'-'+_0x1f68ec+'/'+_0x3ced2c)[_0x6d59('0x1d')](_0x597b25);}return null;};}function patchUpdates(_0xd0e824){return function(_0x3026b6){try{jsonpatch[_0x6d59('0x24')](_0x3026b6,_0xd0e824,!![]);}catch(_0x28d749){return BPromise[_0x6d59('0x25')](_0x28d749);}return _0x3026b6[_0x6d59('0x26')]();};}function saveUpdates(_0x4d0760,_0x1316ad){return function(_0x1fcf0c){if(_0x1fcf0c){return _0x1fcf0c[_0x6d59('0x27')](_0x4d0760)['then'](function(_0x282592){return _0x282592;});}return null;};}function removeEntity(_0x2248f8,_0x50c940){return function(_0x2458cd){if(_0x2458cd){return _0x2458cd['destroy']()[_0x6d59('0x28')](function(){_0x2248f8[_0x6d59('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x248029,_0x7c9c8a){return function(_0xb82359){if(!_0xb82359){_0x248029[_0x6d59('0x1a')](0x194);}return _0xb82359;};}function handleError(_0x3158ab,_0x2d96e5){_0x2d96e5=_0x2d96e5||0x1f4;return function(_0x571c47){logger['error'](_0x571c47['stack']);if(_0x571c47[_0x6d59('0x29')]){delete _0x571c47[_0x6d59('0x29')];}_0x3158ab[_0x6d59('0x1b')](_0x2d96e5)[_0x6d59('0x2a')](_0x571c47);};}exports[_0x6d59('0x2b')]=function(_0x24e2d8,_0x535674){var _0x4fd4af={},_0x5770ec={},_0xd05aed={'count':0x0,'rows':[]};var _0x207f47=_['map'](db['FreshdeskConfiguration'][_0x6d59('0x2c')],function(_0x83a4cb){return{'name':_0x83a4cb[_0x6d59('0x2d')],'type':_0x83a4cb[_0x6d59('0x2e')][_0x6d59('0x2f')]};});_0x5770ec[_0x6d59('0x30')]=_['map'](_0x207f47,_0x6d59('0x29'));_0x5770ec['query']=_[_0x6d59('0x31')](_0x24e2d8['query']);_0x5770ec[_0x6d59('0x32')]=_[_0x6d59('0x33')](_0x5770ec[_0x6d59('0x30')],_0x5770ec[_0x6d59('0x34')]);_0x4fd4af[_0x6d59('0x35')]=_[_0x6d59('0x33')](_0x5770ec[_0x6d59('0x30')],qs[_0x6d59('0x36')](_0x24e2d8[_0x6d59('0x34')][_0x6d59('0x36')]));_0x4fd4af[_0x6d59('0x35')]=_0x4fd4af['attributes']['length']?_0x4fd4af[_0x6d59('0x35')]:_0x5770ec[_0x6d59('0x30')];if(!_0x24e2d8[_0x6d59('0x34')][_0x6d59('0x37')](_0x6d59('0x38'))){_0x4fd4af[_0x6d59('0x20')]=qs[_0x6d59('0x20')](_0x24e2d8['query'][_0x6d59('0x20')]);_0x4fd4af[_0x6d59('0x1e')]=qs[_0x6d59('0x1e')](_0x24e2d8[_0x6d59('0x34')][_0x6d59('0x1e')]);}_0x4fd4af[_0x6d59('0x39')]=qs[_0x6d59('0x3a')](_0x24e2d8[_0x6d59('0x34')]['sort']);_0x4fd4af['where']=qs[_0x6d59('0x32')](_[_0x6d59('0x3b')](_0x24e2d8[_0x6d59('0x34')],_0x5770ec[_0x6d59('0x32')]),_0x207f47);if(_0x24e2d8[_0x6d59('0x34')][_0x6d59('0x3c')]){_0x4fd4af[_0x6d59('0x3d')]=_[_0x6d59('0x3e')](_0x4fd4af[_0x6d59('0x3d')],{'$or':_['map'](_0x207f47,function(_0x139bcd){if(_0x139bcd[_0x6d59('0x2e')]!==_0x6d59('0x3f')){var _0x4d0f7c={};_0x4d0f7c[_0x139bcd[_0x6d59('0x29')]]={'$like':'%'+_0x24e2d8[_0x6d59('0x34')][_0x6d59('0x3c')]+'%'};return _0x4d0f7c;}})});}_0x4fd4af=_[_0x6d59('0x3e')]({},_0x4fd4af,_0x24e2d8[_0x6d59('0x40')]);var _0x4c8630={'where':_0x4fd4af[_0x6d59('0x3d')]};return db[_0x6d59('0x41')]['count'](_0x4c8630)[_0x6d59('0x28')](function(_0xb58d59){_0xd05aed[_0x6d59('0x21')]=_0xb58d59;if(_0x24e2d8['query'][_0x6d59('0x42')]){_0x4fd4af[_0x6d59('0x43')]=[{'all':!![]}];}return db[_0x6d59('0x41')]['findAll'](_0x4fd4af);})[_0x6d59('0x28')](function(_0x4e6ff6){_0xd05aed['rows']=_0x4e6ff6;return _0xd05aed;})[_0x6d59('0x28')](respondWithFilteredResult(_0x535674,_0x4fd4af))[_0x6d59('0x44')](handleError(_0x535674,null));};exports['show']=function(_0x3fd4fc,_0x205ca8){var _0x1e6398={'raw':![],'where':{'id':_0x3fd4fc[_0x6d59('0x45')]['id']}},_0x1d208e={};_0x1d208e[_0x6d59('0x30')]=_[_0x6d59('0x31')](db[_0x6d59('0x41')][_0x6d59('0x2c')]);_0x1d208e[_0x6d59('0x34')]=_[_0x6d59('0x31')](_0x3fd4fc[_0x6d59('0x34')]);_0x1d208e[_0x6d59('0x32')]=_[_0x6d59('0x33')](_0x1d208e[_0x6d59('0x30')],_0x1d208e[_0x6d59('0x34')]);_0x1e6398[_0x6d59('0x35')]=_[_0x6d59('0x33')](_0x1d208e[_0x6d59('0x30')],qs[_0x6d59('0x36')](_0x3fd4fc['query']['fields']));_0x1e6398[_0x6d59('0x35')]=_0x1e6398[_0x6d59('0x35')][_0x6d59('0x46')]?_0x1e6398['attributes']:_0x1d208e['model'];if(_0x3fd4fc['query']['includeAll']){_0x1e6398[_0x6d59('0x43')]=[{'all':!![]}];}_0x1e6398=_[_0x6d59('0x3e')]({},_0x1e6398,_0x3fd4fc[_0x6d59('0x40')]);return db[_0x6d59('0x41')]['find'](_0x1e6398)[_0x6d59('0x28')](handleEntityNotFound(_0x205ca8,null))[_0x6d59('0x28')](respondWithResult(_0x205ca8,null))[_0x6d59('0x44')](handleError(_0x205ca8,null));};exports[_0x6d59('0x47')]=function(_0xb3b99b,_0x775559){return db['FreshdeskConfiguration'][_0x6d59('0x47')](_0xb3b99b[_0x6d59('0x48')],{})['then'](respondWithResult(_0x775559,0xc9))[_0x6d59('0x44')](handleError(_0x775559,null));};exports[_0x6d59('0x27')]=function(_0x4310a0,_0x38de6b){if(_0x4310a0[_0x6d59('0x48')]['id']){delete _0x4310a0[_0x6d59('0x48')]['id'];}return db[_0x6d59('0x41')][_0x6d59('0x49')]({'where':{'id':_0x4310a0['params']['id']}})['then'](handleEntityNotFound(_0x38de6b,null))[_0x6d59('0x28')](saveUpdates(_0x4310a0[_0x6d59('0x48')],null))[_0x6d59('0x28')](respondWithResult(_0x38de6b,null))['catch'](handleError(_0x38de6b,null));};exports[_0x6d59('0x4a')]=function(_0x172d67,_0x264793){return db[_0x6d59('0x41')]['find']({'where':{'id':_0x172d67[_0x6d59('0x45')]['id']}})[_0x6d59('0x28')](handleEntityNotFound(_0x264793,null))[_0x6d59('0x28')](removeEntity(_0x264793,null))[_0x6d59('0x44')](handleError(_0x264793,null));};exports[_0x6d59('0x4b')]=function(_0x43b4ca,_0x512e40,_0x38fa24){var _0x1fad5c={};var _0x51348f={};var _0x5926dd;var _0x57e38d;return db['FreshdeskConfiguration'][_0x6d59('0x4c')]({'where':{'id':_0x43b4ca['params']['id']}})['then'](handleEntityNotFound(_0x512e40,null))[_0x6d59('0x28')](function(_0x298d96){if(_0x298d96){_0x5926dd=_0x298d96;_0x51348f[_0x6d59('0x30')]=_[_0x6d59('0x31')](db[_0x6d59('0x4d')][_0x6d59('0x2c')]);_0x51348f['query']=_[_0x6d59('0x31')](_0x43b4ca['query']);_0x51348f['filters']=_[_0x6d59('0x33')](_0x51348f[_0x6d59('0x30')],_0x51348f[_0x6d59('0x34')]);_0x1fad5c[_0x6d59('0x35')]=_['intersection'](_0x51348f[_0x6d59('0x30')],qs['fields'](_0x43b4ca[_0x6d59('0x34')][_0x6d59('0x36')]));_0x1fad5c[_0x6d59('0x35')]=_0x1fad5c[_0x6d59('0x35')][_0x6d59('0x46')]?_0x1fad5c['attributes']:_0x51348f[_0x6d59('0x30')];_0x1fad5c[_0x6d59('0x39')]=qs[_0x6d59('0x3a')](_0x43b4ca[_0x6d59('0x34')][_0x6d59('0x3a')]);_0x1fad5c[_0x6d59('0x3d')]=qs[_0x6d59('0x32')](_[_0x6d59('0x3b')](_0x43b4ca['query'],_0x51348f[_0x6d59('0x32')]));if(_0x43b4ca[_0x6d59('0x34')][_0x6d59('0x3c')]){_0x1fad5c[_0x6d59('0x3d')]=_[_0x6d59('0x3e')](_0x1fad5c['where'],{'$or':_[_0x6d59('0x4e')](_0x1fad5c['attributes'],function(_0x4fa270){var _0x83fee1={};_0x83fee1[_0x4fa270]={'$like':'%'+_0x43b4ca[_0x6d59('0x34')]['filter']+'%'};return _0x83fee1;})});}_0x1fad5c=_['merge']({},_0x1fad5c,_0x43b4ca[_0x6d59('0x40')]);return _0x5926dd[_0x6d59('0x4b')](_0x1fad5c);}})[_0x6d59('0x28')](function(_0x4cbd66){if(_0x4cbd66){_0x57e38d=_0x4cbd66[_0x6d59('0x46')];if(!_0x43b4ca['query'][_0x6d59('0x37')](_0x6d59('0x38'))){_0x1fad5c['limit']=qs[_0x6d59('0x20')](_0x43b4ca[_0x6d59('0x34')][_0x6d59('0x20')]);_0x1fad5c[_0x6d59('0x1e')]=qs[_0x6d59('0x1e')](_0x43b4ca[_0x6d59('0x34')][_0x6d59('0x1e')]);}return _0x5926dd[_0x6d59('0x4b')](_0x1fad5c);}})[_0x6d59('0x28')](function(_0x44231e){if(_0x44231e){return _0x44231e?{'count':_0x57e38d,'rows':_0x44231e}:null;}})[_0x6d59('0x28')](respondWithResult(_0x512e40,null))[_0x6d59('0x44')](handleError(_0x512e40,null));};exports[_0x6d59('0x4f')]=function(_0x518725,_0x54719c,_0xc7b325){var _0x5a2b38={};var _0x3dd636={};var _0x2f48a4;var _0x155e6c;return db[_0x6d59('0x41')]['findOne']({'where':{'id':_0x518725[_0x6d59('0x45')]['id']}})['then'](handleEntityNotFound(_0x54719c,null))[_0x6d59('0x28')](function(_0x4d37c3){if(_0x4d37c3){_0x2f48a4=_0x4d37c3;_0x3dd636[_0x6d59('0x30')]=_[_0x6d59('0x31')](db['FreshdeskField'][_0x6d59('0x2c')]);_0x3dd636[_0x6d59('0x34')]=_[_0x6d59('0x31')](_0x518725[_0x6d59('0x34')]);_0x3dd636[_0x6d59('0x32')]=_['intersection'](_0x3dd636['model'],_0x3dd636[_0x6d59('0x34')]);_0x5a2b38['attributes']=_[_0x6d59('0x33')](_0x3dd636['model'],qs[_0x6d59('0x36')](_0x518725[_0x6d59('0x34')][_0x6d59('0x36')]));_0x5a2b38[_0x6d59('0x35')]=_0x5a2b38[_0x6d59('0x35')][_0x6d59('0x46')]?_0x5a2b38[_0x6d59('0x35')]:_0x3dd636[_0x6d59('0x30')];_0x5a2b38[_0x6d59('0x39')]=qs[_0x6d59('0x3a')](_0x518725[_0x6d59('0x34')][_0x6d59('0x3a')]);_0x5a2b38[_0x6d59('0x3d')]=qs[_0x6d59('0x32')](_[_0x6d59('0x3b')](_0x518725['query'],_0x3dd636[_0x6d59('0x32')]));if(_0x518725[_0x6d59('0x34')]['filter']){_0x5a2b38[_0x6d59('0x3d')]=_[_0x6d59('0x3e')](_0x5a2b38[_0x6d59('0x3d')],{'$or':_[_0x6d59('0x4e')](_0x5a2b38[_0x6d59('0x35')],function(_0x417028){var _0x23d308={};_0x23d308[_0x417028]={'$like':'%'+_0x518725[_0x6d59('0x34')][_0x6d59('0x3c')]+'%'};return _0x23d308;})});}_0x5a2b38=_[_0x6d59('0x3e')]({},_0x5a2b38,_0x518725[_0x6d59('0x40')]);return _0x2f48a4['getSubjects'](_0x5a2b38);}})[_0x6d59('0x28')](function(_0x3e03f5){if(_0x3e03f5){_0x155e6c=_0x3e03f5[_0x6d59('0x46')];if(!_0x518725[_0x6d59('0x34')][_0x6d59('0x37')](_0x6d59('0x38'))){_0x5a2b38['limit']=qs['limit'](_0x518725[_0x6d59('0x34')][_0x6d59('0x20')]);_0x5a2b38[_0x6d59('0x1e')]=qs[_0x6d59('0x1e')](_0x518725['query'][_0x6d59('0x1e')]);}return _0x2f48a4[_0x6d59('0x4f')](_0x5a2b38);}})[_0x6d59('0x28')](function(_0x21a8ac){if(_0x21a8ac){return _0x21a8ac?{'count':_0x155e6c,'rows':_0x21a8ac}:null;}})['then'](respondWithResult(_0x54719c,null))[_0x6d59('0x44')](handleError(_0x54719c,null));};exports[_0x6d59('0x50')]=function(_0x170ccc,_0x155279,_0x3b3639){var _0x46fe44={};var _0x416762={};var _0x2ff623;var _0x1ecc9f;return db[_0x6d59('0x41')][_0x6d59('0x4c')]({'where':{'id':_0x170ccc[_0x6d59('0x45')]['id']}})[_0x6d59('0x28')](handleEntityNotFound(_0x155279,null))[_0x6d59('0x28')](function(_0x528376){if(_0x528376){_0x2ff623=_0x528376;_0x416762[_0x6d59('0x30')]=_[_0x6d59('0x31')](db['FreshdeskField'][_0x6d59('0x2c')]);_0x416762[_0x6d59('0x34')]=_[_0x6d59('0x31')](_0x170ccc[_0x6d59('0x34')]);_0x416762[_0x6d59('0x32')]=_[_0x6d59('0x33')](_0x416762[_0x6d59('0x30')],_0x416762[_0x6d59('0x34')]);_0x46fe44[_0x6d59('0x35')]=_[_0x6d59('0x33')](_0x416762[_0x6d59('0x30')],qs[_0x6d59('0x36')](_0x170ccc['query'][_0x6d59('0x36')]));_0x46fe44[_0x6d59('0x35')]=_0x46fe44['attributes'][_0x6d59('0x46')]?_0x46fe44[_0x6d59('0x35')]:_0x416762[_0x6d59('0x30')];_0x46fe44[_0x6d59('0x39')]=qs['sort'](_0x170ccc['query']['sort']);_0x46fe44[_0x6d59('0x3d')]=qs[_0x6d59('0x32')](_[_0x6d59('0x3b')](_0x170ccc['query'],_0x416762[_0x6d59('0x32')]));if(_0x170ccc[_0x6d59('0x34')][_0x6d59('0x3c')]){_0x46fe44[_0x6d59('0x3d')]=_[_0x6d59('0x3e')](_0x46fe44[_0x6d59('0x3d')],{'$or':_[_0x6d59('0x4e')](_0x46fe44[_0x6d59('0x35')],function(_0x263862){var _0xe36158={};_0xe36158[_0x263862]={'$like':'%'+_0x170ccc[_0x6d59('0x34')][_0x6d59('0x3c')]+'%'};return _0xe36158;})});}_0x46fe44=_['merge']({},_0x46fe44,_0x170ccc[_0x6d59('0x40')]);return _0x2ff623['getDescriptions'](_0x46fe44);}})['then'](function(_0x145393){if(_0x145393){_0x1ecc9f=_0x145393['length'];if(!_0x170ccc[_0x6d59('0x34')][_0x6d59('0x37')](_0x6d59('0x38'))){_0x46fe44[_0x6d59('0x20')]=qs['limit'](_0x170ccc[_0x6d59('0x34')][_0x6d59('0x20')]);_0x46fe44[_0x6d59('0x1e')]=qs[_0x6d59('0x1e')](_0x170ccc[_0x6d59('0x34')][_0x6d59('0x1e')]);}return _0x2ff623[_0x6d59('0x50')](_0x46fe44);}})[_0x6d59('0x28')](function(_0x1d89da){if(_0x1d89da){return _0x1d89da?{'count':_0x1ecc9f,'rows':_0x1d89da}:null;}})['then'](respondWithResult(_0x155279,null))['catch'](handleError(_0x155279,null));};exports[_0x6d59('0x51')]=function(_0x244032,_0x36b96d,_0x5e6d96){var _0x5d0438={};var _0x1462be={};var _0x19972b;var _0x36dfc9;return db[_0x6d59('0x41')][_0x6d59('0x4c')]({'where':{'id':_0x244032[_0x6d59('0x45')]['id']}})['then'](handleEntityNotFound(_0x36b96d,null))['then'](function(_0x316563){if(_0x316563){_0x19972b=_0x316563;_0x1462be['model']=_[_0x6d59('0x31')](db[_0x6d59('0x52')][_0x6d59('0x2c')]);_0x1462be[_0x6d59('0x34')]=_[_0x6d59('0x31')](_0x244032[_0x6d59('0x34')]);_0x1462be[_0x6d59('0x32')]=_[_0x6d59('0x33')](_0x1462be['model'],_0x1462be[_0x6d59('0x34')]);_0x5d0438[_0x6d59('0x35')]=_[_0x6d59('0x33')](_0x1462be[_0x6d59('0x30')],qs['fields'](_0x244032[_0x6d59('0x34')][_0x6d59('0x36')]));_0x5d0438[_0x6d59('0x35')]=_0x5d0438[_0x6d59('0x35')][_0x6d59('0x46')]?_0x5d0438[_0x6d59('0x35')]:_0x1462be[_0x6d59('0x30')];_0x5d0438['order']=qs['sort'](_0x244032[_0x6d59('0x34')]['sort']);_0x5d0438['where']=qs['filters'](_[_0x6d59('0x3b')](_0x244032['query'],_0x1462be[_0x6d59('0x32')]));if(_0x244032['query']['filter']){_0x5d0438[_0x6d59('0x3d')]=_[_0x6d59('0x3e')](_0x5d0438[_0x6d59('0x3d')],{'$or':_['map'](_0x5d0438['attributes'],function(_0x4c83e2){var _0x5a42c={};_0x5a42c[_0x4c83e2]={'$like':'%'+_0x244032[_0x6d59('0x34')][_0x6d59('0x3c')]+'%'};return _0x5a42c;})});}_0x5d0438=_['merge']({},_0x5d0438,_0x244032[_0x6d59('0x40')]);return _0x19972b['getTags'](_0x5d0438);}})[_0x6d59('0x28')](function(_0x1affa0){if(_0x1affa0){_0x36dfc9=_0x1affa0[_0x6d59('0x46')];if(!_0x244032[_0x6d59('0x34')][_0x6d59('0x37')](_0x6d59('0x38'))){_0x5d0438[_0x6d59('0x20')]=qs[_0x6d59('0x20')](_0x244032[_0x6d59('0x34')][_0x6d59('0x20')]);_0x5d0438['offset']=qs[_0x6d59('0x1e')](_0x244032[_0x6d59('0x34')][_0x6d59('0x1e')]);}return _0x19972b[_0x6d59('0x51')](_0x5d0438);}})[_0x6d59('0x28')](function(_0x39c0d2){if(_0x39c0d2){return _0x39c0d2?{'count':_0x36dfc9,'rows':_0x39c0d2}:null;}})[_0x6d59('0x28')](respondWithResult(_0x36b96d,null))['catch'](handleError(_0x36b96d,null));};exports[_0x6d59('0x53')]=function(_0x2b003c,_0x207e23,_0x353d2c){if(_0x2b003c[_0x6d59('0x48')]['id']){delete _0x2b003c['body']['id'];}return db[_0x6d59('0x41')]['findOne']({'where':{'id':_0x2b003c['params']['id']}})[_0x6d59('0x28')](handleEntityNotFound(_0x207e23,null))['then'](function(_0x2fa784){if(_0x2fa784){return _0x2fa784[_0x6d59('0x53')](_0x2b003c[_0x6d59('0x48')][_0x6d59('0x54')]||[]);}return null;})['then'](respondWithResult(_0x207e23,null))[_0x6d59('0x44')](handleError(_0x207e23,null));}; \ No newline at end of file +var _0x42cf=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','send','FreshdeskConfiguration','fieldName','type','key','map','query','keys','filters','intersection','model','fields','length','sort','where','pick','merge','filter','then','include','findAll','rows','catch','show','params','attributes','includeAll','options','create','body','find','findOne','FreshdeskField','order','getFields','hasOwnProperty','nolimit','getSubjects','rawAttributes','getDescriptions','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x42cf,0x99));var _0xf42c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x42cf[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf42c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf42c('0x1'));var rp=require(_0xf42c('0x2'));var moment=require(_0xf42c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf42c('0x4'));var util=require(_0xf42c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf42c('0x6'));var ejs=require(_0xf42c('0x7'));var fs=require('fs');var fs_extra=require(_0xf42c('0x8'));var _=require(_0xf42c('0x9'));var squel=require(_0xf42c('0xa'));var crypto=require(_0xf42c('0xb'));var jsforce=require(_0xf42c('0xc'));var deskjs=require(_0xf42c('0xd'));var toCsv=require(_0xf42c('0x6'));var querystring=require('querystring');var Papa=require(_0xf42c('0xe'));var Redis=require(_0xf42c('0xf'));var authService=require(_0xf42c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf42c('0x11'));var hardwareService=require(_0xf42c('0x12'));var logger=require(_0xf42c('0x13'))(_0xf42c('0x14'));var utils=require(_0xf42c('0x15'));var config=require(_0xf42c('0x16'));var licenseUtil=require(_0xf42c('0x17'));var db=require(_0xf42c('0x18'))['db'];function respondWithStatusCode(_0x5f3fcc,_0x37a85a){_0x37a85a=_0x37a85a||0xcc;return function(_0x3f29e2){if(_0x3f29e2){return _0x5f3fcc[_0xf42c('0x19')](_0x37a85a);}return _0x5f3fcc[_0xf42c('0x1a')](_0x37a85a)[_0xf42c('0x1b')]();};}function respondWithResult(_0x21db45,_0x14a09d){_0x14a09d=_0x14a09d||0xc8;return function(_0x5ec035){if(_0x5ec035){return _0x21db45[_0xf42c('0x1a')](_0x14a09d)[_0xf42c('0x1c')](_0x5ec035);}};}function respondWithFilteredResult(_0x377a39,_0x139855){return function(_0x8a9150){if(_0x8a9150){var _0x2ca997=typeof _0x139855[_0xf42c('0x1d')]===_0xf42c('0x1e')&&typeof _0x139855['limit']===_0xf42c('0x1e');var _0x3f2551=_0x8a9150[_0xf42c('0x1f')];var _0x42cce8=_0x2ca997?0x0:_0x139855[_0xf42c('0x1d')];var _0x36a2ad=_0x2ca997?_0x8a9150[_0xf42c('0x1f')]:_0x139855[_0xf42c('0x1d')]+_0x139855[_0xf42c('0x20')];var _0x2b3651;if(_0x36a2ad>=_0x3f2551){_0x36a2ad=_0x3f2551;_0x2b3651=0xc8;}else{_0x2b3651=0xce;}_0x377a39['status'](_0x2b3651);return _0x377a39[_0xf42c('0x21')](_0xf42c('0x22'),_0x42cce8+'-'+_0x36a2ad+'/'+_0x3f2551)['json'](_0x8a9150);}return null;};}function patchUpdates(_0x3ce629){return function(_0x857ebe){try{jsonpatch[_0xf42c('0x23')](_0x857ebe,_0x3ce629,!![]);}catch(_0x4a4341){return BPromise[_0xf42c('0x24')](_0x4a4341);}return _0x857ebe[_0xf42c('0x25')]();};}function saveUpdates(_0x290211,_0x54addb){return function(_0x16fd9a){if(_0x16fd9a){return _0x16fd9a[_0xf42c('0x26')](_0x290211)['then'](function(_0x29568f){return _0x29568f;});}return null;};}function removeEntity(_0x5c6e66,_0x2d249f){return function(_0x2f774e){if(_0x2f774e){return _0x2f774e[_0xf42c('0x27')]()['then'](function(){_0x5c6e66[_0xf42c('0x1a')](0xcc)[_0xf42c('0x1b')]();});}};}function handleEntityNotFound(_0x2e733e,_0x4e3bdd){return function(_0x5902c8){if(!_0x5902c8){_0x2e733e[_0xf42c('0x19')](0x194);}return _0x5902c8;};}function handleError(_0x4c51db,_0x29e764){_0x29e764=_0x29e764||0x1f4;return function(_0x385220){logger[_0xf42c('0x28')](_0x385220['stack']);if(_0x385220[_0xf42c('0x29')]){delete _0x385220[_0xf42c('0x29')];}_0x4c51db['status'](_0x29e764)[_0xf42c('0x2a')](_0x385220);};}exports['index']=function(_0x2d7a72,_0x5aed2b){var _0x516eef={},_0x3b5fcd={},_0x17e7dc={'count':0x0,'rows':[]};var _0x541a60=_['map'](db[_0xf42c('0x2b')]['rawAttributes'],function(_0xc67cc1){return{'name':_0xc67cc1[_0xf42c('0x2c')],'type':_0xc67cc1[_0xf42c('0x2d')][_0xf42c('0x2e')]};});_0x3b5fcd['model']=_[_0xf42c('0x2f')](_0x541a60,_0xf42c('0x29'));_0x3b5fcd[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x2d7a72[_0xf42c('0x30')]);_0x3b5fcd[_0xf42c('0x32')]=_[_0xf42c('0x33')](_0x3b5fcd[_0xf42c('0x34')],_0x3b5fcd[_0xf42c('0x30')]);_0x516eef['attributes']=_[_0xf42c('0x33')](_0x3b5fcd[_0xf42c('0x34')],qs[_0xf42c('0x35')](_0x2d7a72[_0xf42c('0x30')]['fields']));_0x516eef['attributes']=_0x516eef['attributes'][_0xf42c('0x36')]?_0x516eef['attributes']:_0x3b5fcd[_0xf42c('0x34')];if(!_0x2d7a72['query']['hasOwnProperty']('nolimit')){_0x516eef[_0xf42c('0x20')]=qs['limit'](_0x2d7a72[_0xf42c('0x30')][_0xf42c('0x20')]);_0x516eef['offset']=qs[_0xf42c('0x1d')](_0x2d7a72[_0xf42c('0x30')][_0xf42c('0x1d')]);}_0x516eef['order']=qs[_0xf42c('0x37')](_0x2d7a72['query']['sort']);_0x516eef[_0xf42c('0x38')]=qs[_0xf42c('0x32')](_[_0xf42c('0x39')](_0x2d7a72[_0xf42c('0x30')],_0x3b5fcd[_0xf42c('0x32')]),_0x541a60);if(_0x2d7a72[_0xf42c('0x30')]['filter']){_0x516eef['where']=_[_0xf42c('0x3a')](_0x516eef['where'],{'$or':_['map'](_0x541a60,function(_0x15344b){if(_0x15344b[_0xf42c('0x2d')]!=='VIRTUAL'){var _0x2a40a2={};_0x2a40a2[_0x15344b[_0xf42c('0x29')]]={'$like':'%'+_0x2d7a72[_0xf42c('0x30')][_0xf42c('0x3b')]+'%'};return _0x2a40a2;}})});}_0x516eef=_[_0xf42c('0x3a')]({},_0x516eef,_0x2d7a72['options']);var _0x3060bc={'where':_0x516eef['where']};return db['FreshdeskConfiguration']['count'](_0x3060bc)[_0xf42c('0x3c')](function(_0x19c3fe){_0x17e7dc[_0xf42c('0x1f')]=_0x19c3fe;if(_0x2d7a72[_0xf42c('0x30')]['includeAll']){_0x516eef[_0xf42c('0x3d')]=[{'all':!![]}];}return db[_0xf42c('0x2b')][_0xf42c('0x3e')](_0x516eef);})[_0xf42c('0x3c')](function(_0x3a1818){_0x17e7dc[_0xf42c('0x3f')]=_0x3a1818;return _0x17e7dc;})[_0xf42c('0x3c')](respondWithFilteredResult(_0x5aed2b,_0x516eef))[_0xf42c('0x40')](handleError(_0x5aed2b,null));};exports[_0xf42c('0x41')]=function(_0x419a35,_0x4842f9){var _0x2322ed={'raw':![],'where':{'id':_0x419a35[_0xf42c('0x42')]['id']}},_0x329cb1={};_0x329cb1['model']=_[_0xf42c('0x31')](db[_0xf42c('0x2b')]['rawAttributes']);_0x329cb1[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x419a35[_0xf42c('0x30')]);_0x329cb1[_0xf42c('0x32')]=_[_0xf42c('0x33')](_0x329cb1[_0xf42c('0x34')],_0x329cb1['query']);_0x2322ed[_0xf42c('0x43')]=_[_0xf42c('0x33')](_0x329cb1[_0xf42c('0x34')],qs['fields'](_0x419a35[_0xf42c('0x30')][_0xf42c('0x35')]));_0x2322ed[_0xf42c('0x43')]=_0x2322ed[_0xf42c('0x43')]['length']?_0x2322ed[_0xf42c('0x43')]:_0x329cb1['model'];if(_0x419a35[_0xf42c('0x30')][_0xf42c('0x44')]){_0x2322ed[_0xf42c('0x3d')]=[{'all':!![]}];}_0x2322ed=_[_0xf42c('0x3a')]({},_0x2322ed,_0x419a35[_0xf42c('0x45')]);return db[_0xf42c('0x2b')]['find'](_0x2322ed)['then'](handleEntityNotFound(_0x4842f9,null))[_0xf42c('0x3c')](respondWithResult(_0x4842f9,null))[_0xf42c('0x40')](handleError(_0x4842f9,null));};exports[_0xf42c('0x46')]=function(_0x2bdb62,_0xae8d01){return db[_0xf42c('0x2b')][_0xf42c('0x46')](_0x2bdb62[_0xf42c('0x47')],{})[_0xf42c('0x3c')](respondWithResult(_0xae8d01,0xc9))[_0xf42c('0x40')](handleError(_0xae8d01,null));};exports['update']=function(_0x3dbc29,_0x808b98){if(_0x3dbc29['body']['id']){delete _0x3dbc29[_0xf42c('0x47')]['id'];}return db[_0xf42c('0x2b')][_0xf42c('0x48')]({'where':{'id':_0x3dbc29[_0xf42c('0x42')]['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x808b98,null))[_0xf42c('0x3c')](saveUpdates(_0x3dbc29[_0xf42c('0x47')],null))[_0xf42c('0x3c')](respondWithResult(_0x808b98,null))[_0xf42c('0x40')](handleError(_0x808b98,null));};exports[_0xf42c('0x27')]=function(_0x1f25ef,_0x4227e3){return db[_0xf42c('0x2b')][_0xf42c('0x48')]({'where':{'id':_0x1f25ef[_0xf42c('0x42')]['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x4227e3,null))['then'](removeEntity(_0x4227e3,null))['catch'](handleError(_0x4227e3,null));};exports['getFields']=function(_0x1d4810,_0x1cfb76,_0x5639d4){var _0x56d1cd={};var _0x3f64bc={};var _0x5c675b;var _0x1fce45;return db[_0xf42c('0x2b')][_0xf42c('0x49')]({'where':{'id':_0x1d4810['params']['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x1cfb76,null))[_0xf42c('0x3c')](function(_0x43703a){if(_0x43703a){_0x5c675b=_0x43703a;_0x3f64bc['model']=_[_0xf42c('0x31')](db[_0xf42c('0x4a')]['rawAttributes']);_0x3f64bc[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x1d4810[_0xf42c('0x30')]);_0x3f64bc[_0xf42c('0x32')]=_[_0xf42c('0x33')](_0x3f64bc[_0xf42c('0x34')],_0x3f64bc[_0xf42c('0x30')]);_0x56d1cd[_0xf42c('0x43')]=_[_0xf42c('0x33')](_0x3f64bc[_0xf42c('0x34')],qs['fields'](_0x1d4810[_0xf42c('0x30')]['fields']));_0x56d1cd[_0xf42c('0x43')]=_0x56d1cd[_0xf42c('0x43')][_0xf42c('0x36')]?_0x56d1cd['attributes']:_0x3f64bc[_0xf42c('0x34')];_0x56d1cd[_0xf42c('0x4b')]=qs[_0xf42c('0x37')](_0x1d4810[_0xf42c('0x30')][_0xf42c('0x37')]);_0x56d1cd[_0xf42c('0x38')]=qs[_0xf42c('0x32')](_[_0xf42c('0x39')](_0x1d4810[_0xf42c('0x30')],_0x3f64bc[_0xf42c('0x32')]));if(_0x1d4810[_0xf42c('0x30')]['filter']){_0x56d1cd[_0xf42c('0x38')]=_[_0xf42c('0x3a')](_0x56d1cd[_0xf42c('0x38')],{'$or':_['map'](_0x56d1cd['attributes'],function(_0x2131c3){var _0x438e79={};_0x438e79[_0x2131c3]={'$like':'%'+_0x1d4810[_0xf42c('0x30')][_0xf42c('0x3b')]+'%'};return _0x438e79;})});}_0x56d1cd=_[_0xf42c('0x3a')]({},_0x56d1cd,_0x1d4810['options']);return _0x5c675b[_0xf42c('0x4c')](_0x56d1cd);}})['then'](function(_0x1ce51e){if(_0x1ce51e){_0x1fce45=_0x1ce51e['length'];if(!_0x1d4810['query'][_0xf42c('0x4d')](_0xf42c('0x4e'))){_0x56d1cd['limit']=qs[_0xf42c('0x20')](_0x1d4810['query']['limit']);_0x56d1cd['offset']=qs[_0xf42c('0x1d')](_0x1d4810['query'][_0xf42c('0x1d')]);}return _0x5c675b[_0xf42c('0x4c')](_0x56d1cd);}})[_0xf42c('0x3c')](function(_0x367048){if(_0x367048){return _0x367048?{'count':_0x1fce45,'rows':_0x367048}:null;}})['then'](respondWithResult(_0x1cfb76,null))['catch'](handleError(_0x1cfb76,null));};exports[_0xf42c('0x4f')]=function(_0x2325ba,_0x2280f4,_0x40dcc6){var _0x59acbc={};var _0x37dbb2={};var _0x343d0b;var _0x5eae7c;return db[_0xf42c('0x2b')][_0xf42c('0x49')]({'where':{'id':_0x2325ba['params']['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x2280f4,null))['then'](function(_0x4e1efe){if(_0x4e1efe){_0x343d0b=_0x4e1efe;_0x37dbb2[_0xf42c('0x34')]=_[_0xf42c('0x31')](db[_0xf42c('0x4a')][_0xf42c('0x50')]);_0x37dbb2[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x2325ba[_0xf42c('0x30')]);_0x37dbb2[_0xf42c('0x32')]=_[_0xf42c('0x33')](_0x37dbb2['model'],_0x37dbb2[_0xf42c('0x30')]);_0x59acbc[_0xf42c('0x43')]=_[_0xf42c('0x33')](_0x37dbb2[_0xf42c('0x34')],qs[_0xf42c('0x35')](_0x2325ba[_0xf42c('0x30')]['fields']));_0x59acbc['attributes']=_0x59acbc[_0xf42c('0x43')][_0xf42c('0x36')]?_0x59acbc[_0xf42c('0x43')]:_0x37dbb2[_0xf42c('0x34')];_0x59acbc[_0xf42c('0x4b')]=qs[_0xf42c('0x37')](_0x2325ba[_0xf42c('0x30')][_0xf42c('0x37')]);_0x59acbc[_0xf42c('0x38')]=qs[_0xf42c('0x32')](_[_0xf42c('0x39')](_0x2325ba[_0xf42c('0x30')],_0x37dbb2[_0xf42c('0x32')]));if(_0x2325ba[_0xf42c('0x30')][_0xf42c('0x3b')]){_0x59acbc[_0xf42c('0x38')]=_[_0xf42c('0x3a')](_0x59acbc[_0xf42c('0x38')],{'$or':_[_0xf42c('0x2f')](_0x59acbc[_0xf42c('0x43')],function(_0x5843fd){var _0x299639={};_0x299639[_0x5843fd]={'$like':'%'+_0x2325ba[_0xf42c('0x30')][_0xf42c('0x3b')]+'%'};return _0x299639;})});}_0x59acbc=_[_0xf42c('0x3a')]({},_0x59acbc,_0x2325ba[_0xf42c('0x45')]);return _0x343d0b[_0xf42c('0x4f')](_0x59acbc);}})[_0xf42c('0x3c')](function(_0x489225){if(_0x489225){_0x5eae7c=_0x489225[_0xf42c('0x36')];if(!_0x2325ba[_0xf42c('0x30')][_0xf42c('0x4d')](_0xf42c('0x4e'))){_0x59acbc['limit']=qs['limit'](_0x2325ba[_0xf42c('0x30')]['limit']);_0x59acbc[_0xf42c('0x1d')]=qs[_0xf42c('0x1d')](_0x2325ba[_0xf42c('0x30')][_0xf42c('0x1d')]);}return _0x343d0b[_0xf42c('0x4f')](_0x59acbc);}})['then'](function(_0x11ea38){if(_0x11ea38){return _0x11ea38?{'count':_0x5eae7c,'rows':_0x11ea38}:null;}})[_0xf42c('0x3c')](respondWithResult(_0x2280f4,null))['catch'](handleError(_0x2280f4,null));};exports[_0xf42c('0x51')]=function(_0x38c4c1,_0x20e738,_0x43b9e1){var _0x3a184e={};var _0x3e13dc={};var _0x1438a2;var _0x334b2c;return db['FreshdeskConfiguration'][_0xf42c('0x49')]({'where':{'id':_0x38c4c1[_0xf42c('0x42')]['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x20e738,null))['then'](function(_0xeac9a3){if(_0xeac9a3){_0x1438a2=_0xeac9a3;_0x3e13dc[_0xf42c('0x34')]=_[_0xf42c('0x31')](db[_0xf42c('0x4a')]['rawAttributes']);_0x3e13dc[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x38c4c1[_0xf42c('0x30')]);_0x3e13dc[_0xf42c('0x32')]=_['intersection'](_0x3e13dc[_0xf42c('0x34')],_0x3e13dc[_0xf42c('0x30')]);_0x3a184e['attributes']=_[_0xf42c('0x33')](_0x3e13dc['model'],qs['fields'](_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x35')]));_0x3a184e['attributes']=_0x3a184e['attributes'][_0xf42c('0x36')]?_0x3a184e[_0xf42c('0x43')]:_0x3e13dc['model'];_0x3a184e[_0xf42c('0x4b')]=qs['sort'](_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x37')]);_0x3a184e[_0xf42c('0x38')]=qs[_0xf42c('0x32')](_[_0xf42c('0x39')](_0x38c4c1[_0xf42c('0x30')],_0x3e13dc[_0xf42c('0x32')]));if(_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x3b')]){_0x3a184e[_0xf42c('0x38')]=_[_0xf42c('0x3a')](_0x3a184e['where'],{'$or':_['map'](_0x3a184e[_0xf42c('0x43')],function(_0xc79771){var _0x21df9a={};_0x21df9a[_0xc79771]={'$like':'%'+_0x38c4c1['query'][_0xf42c('0x3b')]+'%'};return _0x21df9a;})});}_0x3a184e=_[_0xf42c('0x3a')]({},_0x3a184e,_0x38c4c1['options']);return _0x1438a2[_0xf42c('0x51')](_0x3a184e);}})[_0xf42c('0x3c')](function(_0x4752ab){if(_0x4752ab){_0x334b2c=_0x4752ab[_0xf42c('0x36')];if(!_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x4d')](_0xf42c('0x4e'))){_0x3a184e[_0xf42c('0x20')]=qs[_0xf42c('0x20')](_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x20')]);_0x3a184e[_0xf42c('0x1d')]=qs[_0xf42c('0x1d')](_0x38c4c1[_0xf42c('0x30')][_0xf42c('0x1d')]);}return _0x1438a2[_0xf42c('0x51')](_0x3a184e);}})[_0xf42c('0x3c')](function(_0x446be1){if(_0x446be1){return _0x446be1?{'count':_0x334b2c,'rows':_0x446be1}:null;}})['then'](respondWithResult(_0x20e738,null))[_0xf42c('0x40')](handleError(_0x20e738,null));};exports[_0xf42c('0x52')]=function(_0x41a5dd,_0x234431,_0x1d6a3c){var _0x3e7160={};var _0x578685={};var _0x4f048d;var _0x4dbdbc;return db['FreshdeskConfiguration'][_0xf42c('0x49')]({'where':{'id':_0x41a5dd['params']['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x234431,null))[_0xf42c('0x3c')](function(_0x188eff){if(_0x188eff){_0x4f048d=_0x188eff;_0x578685['model']=_['keys'](db['Tag'][_0xf42c('0x50')]);_0x578685[_0xf42c('0x30')]=_[_0xf42c('0x31')](_0x41a5dd[_0xf42c('0x30')]);_0x578685[_0xf42c('0x32')]=_[_0xf42c('0x33')](_0x578685[_0xf42c('0x34')],_0x578685[_0xf42c('0x30')]);_0x3e7160[_0xf42c('0x43')]=_[_0xf42c('0x33')](_0x578685[_0xf42c('0x34')],qs[_0xf42c('0x35')](_0x41a5dd['query'][_0xf42c('0x35')]));_0x3e7160[_0xf42c('0x43')]=_0x3e7160[_0xf42c('0x43')][_0xf42c('0x36')]?_0x3e7160[_0xf42c('0x43')]:_0x578685['model'];_0x3e7160[_0xf42c('0x4b')]=qs[_0xf42c('0x37')](_0x41a5dd[_0xf42c('0x30')][_0xf42c('0x37')]);_0x3e7160[_0xf42c('0x38')]=qs['filters'](_[_0xf42c('0x39')](_0x41a5dd[_0xf42c('0x30')],_0x578685[_0xf42c('0x32')]));if(_0x41a5dd['query']['filter']){_0x3e7160[_0xf42c('0x38')]=_[_0xf42c('0x3a')](_0x3e7160[_0xf42c('0x38')],{'$or':_[_0xf42c('0x2f')](_0x3e7160[_0xf42c('0x43')],function(_0x3844af){var _0x46c1b3={};_0x46c1b3[_0x3844af]={'$like':'%'+_0x41a5dd[_0xf42c('0x30')][_0xf42c('0x3b')]+'%'};return _0x46c1b3;})});}_0x3e7160=_[_0xf42c('0x3a')]({},_0x3e7160,_0x41a5dd[_0xf42c('0x45')]);return _0x4f048d[_0xf42c('0x52')](_0x3e7160);}})['then'](function(_0x5cc2a2){if(_0x5cc2a2){_0x4dbdbc=_0x5cc2a2[_0xf42c('0x36')];if(!_0x41a5dd['query'][_0xf42c('0x4d')](_0xf42c('0x4e'))){_0x3e7160['limit']=qs[_0xf42c('0x20')](_0x41a5dd[_0xf42c('0x30')][_0xf42c('0x20')]);_0x3e7160[_0xf42c('0x1d')]=qs[_0xf42c('0x1d')](_0x41a5dd[_0xf42c('0x30')][_0xf42c('0x1d')]);}return _0x4f048d[_0xf42c('0x52')](_0x3e7160);}})[_0xf42c('0x3c')](function(_0x3af740){if(_0x3af740){return _0x3af740?{'count':_0x4dbdbc,'rows':_0x3af740}:null;}})['then'](respondWithResult(_0x234431,null))[_0xf42c('0x40')](handleError(_0x234431,null));};exports[_0xf42c('0x53')]=function(_0x25c342,_0x2dc327,_0x3afaad){if(_0x25c342[_0xf42c('0x47')]['id']){delete _0x25c342[_0xf42c('0x47')]['id'];}return db[_0xf42c('0x2b')][_0xf42c('0x49')]({'where':{'id':_0x25c342[_0xf42c('0x42')]['id']}})[_0xf42c('0x3c')](handleEntityNotFound(_0x2dc327,null))[_0xf42c('0x3c')](function(_0xb8582d){if(_0xb8582d){return _0xb8582d['setTags'](_0x25c342['body'][_0xf42c('0x54')]||[]);}return null;})[_0xf42c('0x3c')](respondWithResult(_0x2dc327,null))[_0xf42c('0x40')](handleError(_0x2dc327,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f2bcf06..e3618ac 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 _0x568b=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x4e3f48,_0x511eee){var _0x56585f=function(_0x5380ff){while(--_0x5380ff){_0x4e3f48['push'](_0x4e3f48['shift']());}};_0x56585f(++_0x511eee);}(_0x568b,0x130));var _0xb568=function(_0x421102,_0x457a13){_0x421102=_0x421102-0x0;var _0x16b9e3=_0x568b[_0x421102];return _0x16b9e3;};'use strict';var _=require(_0xb568('0x0'));var util=require(_0xb568('0x1'));var logger=require(_0xb568('0x2'))(_0xb568('0x3'));var moment=require(_0xb568('0x4'));var BPromise=require(_0xb568('0x5'));var rp=require(_0xb568('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb568('0x7'));var config=require(_0xb568('0x8'));var attributes=require(_0xb568('0x9'));module[_0xb568('0xa')]=function(_0x2f7c48,_0x5e3ef9){return _0x2f7c48[_0xb568('0xb')](_0xb568('0xc'),attributes,{'tableName':_0xb568('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2aa1=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f8146,_0x1103f7){var _0x219d9f=function(_0x3b742d){while(--_0x3b742d){_0x1f8146['push'](_0x1f8146['shift']());}};_0x219d9f(++_0x1103f7);}(_0x2aa1,0x10d));var _0x12aa=function(_0x4db539,_0x23c53d){_0x4db539=_0x4db539-0x0;var _0x3dae86=_0x2aa1[_0x4db539];return _0x3dae86;};'use strict';var _=require(_0x12aa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x12aa('0x1'));var moment=require(_0x12aa('0x2'));var BPromise=require(_0x12aa('0x3'));var rp=require(_0x12aa('0x4'));var fs=require('fs');var path=require(_0x12aa('0x5'));var rimraf=require(_0x12aa('0x6'));var config=require(_0x12aa('0x7'));var attributes=require(_0x12aa('0x8'));module[_0x12aa('0x9')]=function(_0x13632b,_0x641b41){return _0x13632b[_0x12aa('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x12aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index cf53de7..e2d06f6 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 _0x4804=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0x4804,0x129));var _0x4480=function(_0x4f87c0,_0x227ecf){_0x4f87c0=_0x4f87c0-0x0;var _0x165cda=_0x4804[_0x4f87c0];return _0x165cda;};'use strict';var _=require(_0x4480('0x0'));var util=require('util');var moment=require(_0x4480('0x1'));var BPromise=require(_0x4480('0x2'));var rs=require(_0x4480('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4480('0x4'))['db'];var utils=require(_0x4480('0x5'));var logger=require(_0x4480('0x6'))(_0x4480('0x7'));var config=require(_0x4480('0x8'));var jayson=require(_0x4480('0x9'));var client=jayson[_0x4480('0xa')][_0x4480('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5320bb,_0x4e11c6,_0x25a677){return new BPromise(function(_0x331d28,_0x46d92e){return client['request'](_0x5320bb,_0x25a677)[_0x4480('0xc')](function(_0x640a77){logger[_0x4480('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4e11c6,_0x4480('0xe'));logger[_0x4480('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4e11c6,_0x4480('0xe'),JSON[_0x4480('0x10')](_0x640a77));if(_0x640a77[_0x4480('0x11')]){if(_0x640a77[_0x4480('0x11')][_0x4480('0x12')]===0x1f4){logger[_0x4480('0x11')](_0x4480('0x13'),_0x4e11c6,_0x640a77[_0x4480('0x11')][_0x4480('0x14')]);return _0x46d92e(_0x640a77[_0x4480('0x11')][_0x4480('0x14')]);}logger[_0x4480('0x11')](_0x4480('0x13'),_0x4e11c6,_0x640a77[_0x4480('0x11')]['message']);return _0x331d28(_0x640a77['error'][_0x4480('0x14')]);}else{logger[_0x4480('0xd')](_0x4480('0x13'),_0x4e11c6,'request\x20sent');_0x331d28(_0x640a77[_0x4480('0x15')][_0x4480('0x14')]);}})[_0x4480('0x16')](function(_0x404df4){logger['error'](_0x4480('0x13'),_0x4e11c6,_0x404df4);_0x46d92e(_0x404df4);});});} \ No newline at end of file +var _0x9d65=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x13b696,_0x5068f2){var _0x4ef0c2=function(_0x3dd5c1){while(--_0x3dd5c1){_0x13b696['push'](_0x13b696['shift']());}};_0x4ef0c2(++_0x5068f2);}(_0x9d65,0x11a));var _0x59d6=function(_0x5d3313,_0x39c46e){_0x5d3313=_0x5d3313-0x0;var _0x40b46c=_0x9d65[_0x5d3313];return _0x40b46c;};'use strict';var _=require(_0x59d6('0x0'));var util=require(_0x59d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x59d6('0x2'));var fs=require('fs');var Redis=require(_0x59d6('0x3'));var db=require(_0x59d6('0x4'))['db'];var utils=require(_0x59d6('0x5'));var logger=require(_0x59d6('0x6'))(_0x59d6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x59d6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e79a7,_0x81a786,_0x3bef02){return new BPromise(function(_0x518112,_0xefa72a){return client[_0x59d6('0x9')](_0x4e79a7,_0x3bef02)[_0x59d6('0xa')](function(_0x29baa1){logger[_0x59d6('0xb')](_0x59d6('0xc'),_0x81a786,_0x59d6('0xd'));logger[_0x59d6('0xe')](_0x59d6('0xf'),_0x81a786,_0x59d6('0xd'),JSON[_0x59d6('0x10')](_0x29baa1));if(_0x29baa1['error']){if(_0x29baa1['error']['code']===0x1f4){logger[_0x59d6('0x11')](_0x59d6('0xc'),_0x81a786,_0x29baa1[_0x59d6('0x11')][_0x59d6('0x12')]);return _0xefa72a(_0x29baa1['error'][_0x59d6('0x12')]);}logger[_0x59d6('0x11')](_0x59d6('0xc'),_0x81a786,_0x29baa1[_0x59d6('0x11')][_0x59d6('0x12')]);return _0x518112(_0x29baa1[_0x59d6('0x11')][_0x59d6('0x12')]);}else{logger['info'](_0x59d6('0xc'),_0x81a786,_0x59d6('0xd'));_0x518112(_0x29baa1[_0x59d6('0x13')][_0x59d6('0x12')]);}})[_0x59d6('0x14')](function(_0x23702f){logger[_0x59d6('0x11')](_0x59d6('0xc'),_0x81a786,_0x23702f);_0xefa72a(_0x23702f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 95444e9..a14ccc9 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 _0xe5c4=['show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','get','/:id'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe5c4,0x15c));var _0x4e5c=function(_0xe5d7b6,_0x32fe11){_0xe5d7b6=_0xe5d7b6-0x0;var _0x489aba=_0xe5c4[_0xe5d7b6];return _0x489aba;};'use strict';var multer=require('multer');var util=require(_0x4e5c('0x0'));var path=require('path');var timeout=require(_0x4e5c('0x1'));var express=require(_0x4e5c('0x2'));var router=express[_0x4e5c('0x3')]();var fs_extra=require(_0x4e5c('0x4'));var auth=require(_0x4e5c('0x5'));var interaction=require(_0x4e5c('0x6'));var config=require(_0x4e5c('0x7'));var controller=require(_0x4e5c('0x8'));router['get']('/',auth[_0x4e5c('0x9')](),controller['index']);router[_0x4e5c('0xa')](_0x4e5c('0xb'),auth[_0x4e5c('0x9')](),controller[_0x4e5c('0xc')]);router[_0x4e5c('0xd')]('/',auth[_0x4e5c('0x9')](),controller[_0x4e5c('0xe')]);router['put'](_0x4e5c('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4e5c('0xf')](_0x4e5c('0xb'),auth[_0x4e5c('0x9')](),controller[_0x4e5c('0x10')]);module[_0x4e5c('0x11')]=router; \ No newline at end of file +var _0xe818=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x227b67,_0x5c4075){var _0x16f616=function(_0x46e857){while(--_0x46e857){_0x227b67['push'](_0x227b67['shift']());}};_0x16f616(++_0x5c4075);}(_0xe818,0xb2));var _0x8e81=function(_0x396869,_0x1ec6d0){_0x396869=_0x396869-0x0;var _0x342747=_0xe818[_0x396869];return _0x342747;};'use strict';var multer=require(_0x8e81('0x0'));var util=require(_0x8e81('0x1'));var path=require(_0x8e81('0x2'));var timeout=require(_0x8e81('0x3'));var express=require(_0x8e81('0x4'));var router=express['Router']();var fs_extra=require(_0x8e81('0x5'));var auth=require(_0x8e81('0x6'));var interaction=require(_0x8e81('0x7'));var config=require(_0x8e81('0x8'));var controller=require(_0x8e81('0x9'));router[_0x8e81('0xa')]('/',auth[_0x8e81('0xb')](),controller[_0x8e81('0xc')]);router[_0x8e81('0xa')](_0x8e81('0xd'),auth[_0x8e81('0xb')](),controller[_0x8e81('0xe')]);router[_0x8e81('0xf')]('/',auth['isAuthenticated'](),controller[_0x8e81('0x10')]);router[_0x8e81('0x11')](_0x8e81('0xd'),auth[_0x8e81('0xb')](),controller[_0x8e81('0x12')]);router[_0x8e81('0x13')](_0x8e81('0xd'),auth[_0x8e81('0xb')](),controller['destroy']);module[_0x8e81('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 220f937..2360bf9 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 _0xd68e=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x61683d,_0xe7e2d5){var _0xfed21e=function(_0x1f7b9d){while(--_0x1f7b9d){_0x61683d['push'](_0x61683d['shift']());}};_0xfed21e(++_0xe7e2d5);}(_0xd68e,0x1a5));var _0xed68=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xd68e[_0x3438cf];return _0x278698;};'use strict';var Sequelize=require(_0xed68('0x0'));module[_0xed68('0x1')]={'type':{'type':Sequelize[_0xed68('0x2')](_0xed68('0x3'),_0xed68('0x4'),_0xed68('0x5'),_0xed68('0x6'),_0xed68('0x7')),'defaultValue':_0xed68('0x3')},'content':{'type':Sequelize[_0xed68('0x8')]},'key':{'type':Sequelize[_0xed68('0x8')]},'keyType':{'type':Sequelize[_0xed68('0x2')]('string',_0xed68('0x4'),_0xed68('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xed68('0x8')]},'nameField':{'type':Sequelize[_0xed68('0x8')]},'customField':{'type':Sequelize[_0xed68('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xed68('0x8')]}}; \ No newline at end of file +var _0x302f=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x12c4cd,_0xdebe29){var _0x18a029=function(_0x4c4272){while(--_0x4c4272){_0x12c4cd['push'](_0x12c4cd['shift']());}};_0x18a029(++_0xdebe29);}(_0x302f,0xe2));var _0xf302=function(_0x85cb5d,_0x377e04){_0x85cb5d=_0x85cb5d-0x0;var _0x64432b=_0x302f[_0x85cb5d];return _0x64432b;};'use strict';var Sequelize=require('sequelize');module[_0xf302('0x0')]={'type':{'type':Sequelize[_0xf302('0x1')](_0xf302('0x2'),_0xf302('0x3'),_0xf302('0x4'),_0xf302('0x5'),_0xf302('0x6')),'defaultValue':_0xf302('0x2')},'content':{'type':Sequelize[_0xf302('0x7')]},'key':{'type':Sequelize[_0xf302('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf302('0x3'),_0xf302('0x4'))},'keyContent':{'type':Sequelize[_0xf302('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf302('0x7')]},'customField':{'type':Sequelize[_0xf302('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf302('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4cd4a97..e6d800d 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 _0x16d2=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x8bb1c3,_0xeb1eb1){var _0x3802ae=function(_0x8144d6){while(--_0x8144d6){_0x8bb1c3['push'](_0x8bb1c3['shift']());}};_0x3802ae(++_0xeb1eb1);}(_0x16d2,0x123));var _0x216d=function(_0x17e750,_0x26c72a){_0x17e750=_0x17e750-0x0;var _0xb6974e=_0x16d2[_0x17e750];return _0xb6974e;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x5998a1,_0x4ec8a7){return function(_0x56460f){if(!_0x56460f){_0x5998a1['sendStatus'](0x194);}return _0x56460f;};}function handleError(_0x5eb444,_0x32f240){_0x32f240=_0x32f240||0x1f4;return function(_0x470d8a){logger[_0x216d('0x28')](_0x470d8a[_0x216d('0x29')]);if(_0x470d8a[_0x216d('0x2a')]){delete _0x470d8a['name'];}_0x5eb444['status'](_0x32f240)[_0x216d('0x2b')](_0x470d8a);};}exports['index']=function(_0x23d1c3,_0x42abbe){var _0x10f7c6={},_0x20bc16={},_0x307f2b={'count':0x0,'rows':[]};var _0x12bcab=_[_0x216d('0x2c')](db[_0x216d('0x2d')][_0x216d('0x2e')],function(_0x28f56a){return{'name':_0x28f56a[_0x216d('0x2f')],'type':_0x28f56a[_0x216d('0x30')][_0x216d('0x31')]};});_0x20bc16['model']=_[_0x216d('0x2c')](_0x12bcab,_0x216d('0x2a'));_0x20bc16[_0x216d('0x32')]=_['keys'](_0x23d1c3[_0x216d('0x32')]);_0x20bc16[_0x216d('0x33')]=_[_0x216d('0x34')](_0x20bc16[_0x216d('0x35')],_0x20bc16['query']);_0x10f7c6[_0x216d('0x36')]=_[_0x216d('0x34')](_0x20bc16[_0x216d('0x35')],qs[_0x216d('0x37')](_0x23d1c3[_0x216d('0x32')][_0x216d('0x37')]));_0x10f7c6[_0x216d('0x36')]=_0x10f7c6[_0x216d('0x36')][_0x216d('0x38')]?_0x10f7c6[_0x216d('0x36')]:_0x20bc16[_0x216d('0x35')];if(!_0x23d1c3['query'][_0x216d('0x39')](_0x216d('0x3a'))){_0x10f7c6[_0x216d('0x21')]=qs['limit'](_0x23d1c3[_0x216d('0x32')][_0x216d('0x21')]);_0x10f7c6['offset']=qs[_0x216d('0x1f')](_0x23d1c3['query']['offset']);}_0x10f7c6[_0x216d('0x3b')]=qs[_0x216d('0x3c')](_0x23d1c3[_0x216d('0x32')][_0x216d('0x3c')]);_0x10f7c6['where']=qs['filters'](_['pick'](_0x23d1c3[_0x216d('0x32')],_0x20bc16[_0x216d('0x33')]),_0x12bcab);if(_0x23d1c3['query'][_0x216d('0x3d')]){_0x10f7c6[_0x216d('0x3e')]=_['merge'](_0x10f7c6[_0x216d('0x3e')],{'$or':_[_0x216d('0x2c')](_0x12bcab,function(_0x2476a0){if(_0x2476a0[_0x216d('0x30')]!==_0x216d('0x3f')){var _0x2e857e={};_0x2e857e[_0x2476a0[_0x216d('0x2a')]]={'$like':'%'+_0x23d1c3[_0x216d('0x32')]['filter']+'%'};return _0x2e857e;}})});}_0x10f7c6=_['merge']({},_0x10f7c6,_0x23d1c3[_0x216d('0x40')]);var _0x2be24f={'where':_0x10f7c6['where']};return db[_0x216d('0x2d')][_0x216d('0x22')](_0x2be24f)[_0x216d('0x27')](function(_0x47f796){_0x307f2b[_0x216d('0x22')]=_0x47f796;if(_0x23d1c3[_0x216d('0x32')][_0x216d('0x41')]){_0x10f7c6[_0x216d('0x42')]=[{'all':!![]}];}return db['FreshdeskField'][_0x216d('0x43')](_0x10f7c6);})[_0x216d('0x27')](function(_0x5665d7){_0x307f2b[_0x216d('0x44')]=_0x5665d7;return _0x307f2b;})[_0x216d('0x27')](respondWithFilteredResult(_0x42abbe,_0x10f7c6))['catch'](handleError(_0x42abbe,null));};exports['show']=function(_0x330ec8,_0x440bc9){var _0x3c491e={'raw':!![],'where':{'id':_0x330ec8[_0x216d('0x45')]['id']}},_0x498efe={};_0x498efe['model']=_['keys'](db[_0x216d('0x2d')][_0x216d('0x2e')]);_0x498efe[_0x216d('0x32')]=_['keys'](_0x330ec8[_0x216d('0x32')]);_0x498efe['filters']=_[_0x216d('0x34')](_0x498efe[_0x216d('0x35')],_0x498efe[_0x216d('0x32')]);_0x3c491e['attributes']=_[_0x216d('0x34')](_0x498efe[_0x216d('0x35')],qs[_0x216d('0x37')](_0x330ec8[_0x216d('0x32')]['fields']));_0x3c491e['attributes']=_0x3c491e['attributes'][_0x216d('0x38')]?_0x3c491e[_0x216d('0x36')]:_0x498efe[_0x216d('0x35')];if(_0x330ec8[_0x216d('0x32')][_0x216d('0x41')]){_0x3c491e[_0x216d('0x42')]=[{'all':!![]}];}_0x3c491e=_[_0x216d('0x46')]({},_0x3c491e,_0x330ec8[_0x216d('0x40')]);return db['FreshdeskField'][_0x216d('0x47')](_0x3c491e)[_0x216d('0x27')](handleEntityNotFound(_0x440bc9,null))[_0x216d('0x27')](respondWithResult(_0x440bc9,null))[_0x216d('0x48')](handleError(_0x440bc9,null));};exports['create']=function(_0x31b8a1,_0x542e1b){return db[_0x216d('0x2d')][_0x216d('0x49')](_0x31b8a1[_0x216d('0x4a')],{})['then'](respondWithResult(_0x542e1b,0xc9))['catch'](handleError(_0x542e1b,null));};exports[_0x216d('0x4b')]=function(_0x32d499,_0x3932a3){if(_0x32d499[_0x216d('0x4a')]['id']){delete _0x32d499[_0x216d('0x4a')]['id'];}return db[_0x216d('0x2d')]['find']({'where':{'id':_0x32d499['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x3932a3,null))['then'](saveUpdates(_0x32d499[_0x216d('0x4a')],null))[_0x216d('0x27')](respondWithResult(_0x3932a3,null))['catch'](handleError(_0x3932a3,null));};exports['destroy']=function(_0x5f37e3,_0x4bac14){return db[_0x216d('0x2d')][_0x216d('0x47')]({'where':{'id':_0x5f37e3[_0x216d('0x45')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4bac14,null))[_0x216d('0x27')](removeEntity(_0x4bac14,null))[_0x216d('0x48')](handleError(_0x4bac14,null));}; \ No newline at end of file +var _0x00b3=['hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','show','merge','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length'];(function(_0x179314,_0x32d3a2){var _0x3556f7=function(_0x16244e){while(--_0x16244e){_0x179314['push'](_0x179314['shift']());}};_0x3556f7(++_0x32d3a2);}(_0x00b3,0x17a));var _0x300b=function(_0x52be2c,_0x49a4b8){_0x52be2c=_0x52be2c-0x0;var _0x4a72da=_0x00b3[_0x52be2c];return _0x4a72da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){_0x28bc0a[_0x300b('0x16')](0xcc)[_0x300b('0x17')]();});}};}function handleEntityNotFound(_0x544658,_0x3d62b1){return function(_0x152048){if(!_0x152048){_0x544658[_0x300b('0x15')](0x194);}return _0x152048;};}function handleError(_0x43c480,_0x4cce77){_0x4cce77=_0x4cce77||0x1f4;return function(_0x4f50b0){logger['error'](_0x4f50b0[_0x300b('0x22')]);if(_0x4f50b0['name']){delete _0x4f50b0[_0x300b('0x23')];}_0x43c480[_0x300b('0x16')](_0x4cce77)[_0x300b('0x24')](_0x4f50b0);};}exports[_0x300b('0x25')]=function(_0x2d2ea7,_0x10ed6b){var _0x165f56={},_0x159b63={},_0x1cdc8b={'count':0x0,'rows':[]};var _0x3210cd=_['map'](db['FreshdeskField'][_0x300b('0x26')],function(_0x2a7604){return{'name':_0x2a7604[_0x300b('0x27')],'type':_0x2a7604[_0x300b('0x28')]['key']};});_0x159b63[_0x300b('0x29')]=_['map'](_0x3210cd,'name');_0x159b63['query']=_[_0x300b('0x2a')](_0x2d2ea7[_0x300b('0x2b')]);_0x159b63['filters']=_[_0x300b('0x2c')](_0x159b63[_0x300b('0x29')],_0x159b63['query']);_0x165f56[_0x300b('0x2d')]=_['intersection'](_0x159b63[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x2e')]));_0x165f56[_0x300b('0x2d')]=_0x165f56[_0x300b('0x2d')][_0x300b('0x2f')]?_0x165f56['attributes']:_0x159b63[_0x300b('0x29')];if(!_0x2d2ea7['query'][_0x300b('0x30')](_0x300b('0x31'))){_0x165f56['limit']=qs[_0x300b('0x18')](_0x2d2ea7[_0x300b('0x2b')]['limit']);_0x165f56[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0x2d2ea7[_0x300b('0x2b')]['offset']);}_0x165f56[_0x300b('0x32')]=qs[_0x300b('0x33')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x33')]);_0x165f56[_0x300b('0x34')]=qs[_0x300b('0x35')](_[_0x300b('0x36')](_0x2d2ea7['query'],_0x159b63[_0x300b('0x35')]),_0x3210cd);if(_0x2d2ea7[_0x300b('0x2b')]['filter']){_0x165f56[_0x300b('0x34')]=_['merge'](_0x165f56['where'],{'$or':_[_0x300b('0x37')](_0x3210cd,function(_0x393017){if(_0x393017[_0x300b('0x28')]!==_0x300b('0x38')){var _0xa9c0bf={};_0xa9c0bf[_0x393017['name']]={'$like':'%'+_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x39')]+'%'};return _0xa9c0bf;}})});}_0x165f56=_['merge']({},_0x165f56,_0x2d2ea7[_0x300b('0x3a')]);var _0x479561={'where':_0x165f56[_0x300b('0x34')]};return db[_0x300b('0x3b')][_0x300b('0x1a')](_0x479561)[_0x300b('0x20')](function(_0x40b715){_0x1cdc8b[_0x300b('0x1a')]=_0x40b715;if(_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x3c')]){_0x165f56[_0x300b('0x3d')]=[{'all':!![]}];}return db[_0x300b('0x3b')][_0x300b('0x3e')](_0x165f56);})['then'](function(_0x4ee1d0){_0x1cdc8b[_0x300b('0x3f')]=_0x4ee1d0;return _0x1cdc8b;})['then'](respondWithFilteredResult(_0x10ed6b,_0x165f56))['catch'](handleError(_0x10ed6b,null));};exports[_0x300b('0x40')]=function(_0x24cb83,_0x61fc72){var _0x5ef864={'raw':!![],'where':{'id':_0x24cb83['params']['id']}},_0x7aa03a={};_0x7aa03a['model']=_[_0x300b('0x2a')](db[_0x300b('0x3b')]['rawAttributes']);_0x7aa03a[_0x300b('0x2b')]=_[_0x300b('0x2a')](_0x24cb83['query']);_0x7aa03a[_0x300b('0x35')]=_[_0x300b('0x2c')](_0x7aa03a['model'],_0x7aa03a[_0x300b('0x2b')]);_0x5ef864[_0x300b('0x2d')]=_[_0x300b('0x2c')](_0x7aa03a[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x24cb83[_0x300b('0x2b')][_0x300b('0x2e')]));_0x5ef864[_0x300b('0x2d')]=_0x5ef864['attributes']['length']?_0x5ef864[_0x300b('0x2d')]:_0x7aa03a['model'];if(_0x24cb83['query'][_0x300b('0x3c')]){_0x5ef864[_0x300b('0x3d')]=[{'all':!![]}];}_0x5ef864=_[_0x300b('0x41')]({},_0x5ef864,_0x24cb83[_0x300b('0x3a')]);return db[_0x300b('0x3b')][_0x300b('0x42')](_0x5ef864)['then'](handleEntityNotFound(_0x61fc72,null))[_0x300b('0x20')](respondWithResult(_0x61fc72,null))['catch'](handleError(_0x61fc72,null));};exports['create']=function(_0x3b6ed2,_0x44d1b4){return db['FreshdeskField'][_0x300b('0x43')](_0x3b6ed2[_0x300b('0x44')],{})[_0x300b('0x20')](respondWithResult(_0x44d1b4,0xc9))[_0x300b('0x45')](handleError(_0x44d1b4,null));};exports['update']=function(_0x389256,_0x43eef6){if(_0x389256['body']['id']){delete _0x389256[_0x300b('0x44')]['id'];}return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x389256['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x43eef6,null))[_0x300b('0x20')](saveUpdates(_0x389256[_0x300b('0x44')],null))[_0x300b('0x20')](respondWithResult(_0x43eef6,null))[_0x300b('0x45')](handleError(_0x43eef6,null));};exports[_0x300b('0x21')]=function(_0x418ac3,_0x3dd25c){return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x418ac3[_0x300b('0x46')]['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x3dd25c,null))[_0x300b('0x20')](removeEntity(_0x3dd25c,null))['catch'](handleError(_0x3dd25c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ae08ee2..b07ad62 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 _0xe3ee=['request-promise','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','../../config/logger','api'];(function(_0x371f16,_0x22a9a0){var _0x1b4dfb=function(_0x5354c7){while(--_0x5354c7){_0x371f16['push'](_0x371f16['shift']());}};_0x1b4dfb(++_0x22a9a0);}(_0xe3ee,0x116));var _0xee3e=function(_0x77c630,_0x580e3a){_0x77c630=_0x77c630-0x0;var _0x2b9f93=_0xe3ee[_0x77c630];return _0x2b9f93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee3e('0x0'))(_0xee3e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee3e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xee3e('0x3'));var attributes=require('./intFreshdeskField.attributes');module[_0xee3e('0x4')]=function(_0x352eca,_0x3907a7){return _0x352eca[_0xee3e('0x5')](_0xee3e('0x6'),attributes,{'tableName':_0xee3e('0x7'),'paranoid':![],'indexes':[{'name':_0xee3e('0x8'),'fields':[_0xee3e('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8216=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId'];(function(_0x429a52,_0x56635c){var _0x1f05c0=function(_0x2c9c26){while(--_0x2c9c26){_0x429a52['push'](_0x429a52['shift']());}};_0x1f05c0(++_0x56635c);}(_0x8216,0xa0));var _0x6821=function(_0x256b8e,_0x2a702e){_0x256b8e=_0x256b8e-0x0;var _0x122189=_0x8216[_0x256b8e];return _0x122189;};'use strict';var _=require(_0x6821('0x0'));var util=require('util');var logger=require(_0x6821('0x1'))(_0x6821('0x2'));var moment=require(_0x6821('0x3'));var BPromise=require(_0x6821('0x4'));var rp=require(_0x6821('0x5'));var fs=require('fs');var path=require(_0x6821('0x6'));var rimraf=require(_0x6821('0x7'));var config=require(_0x6821('0x8'));var attributes=require(_0x6821('0x9'));module[_0x6821('0xa')]=function(_0x5e29a4,_0x5f1159){return _0x5e29a4[_0x6821('0xb')](_0x6821('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x6821('0xd'),'fields':[_0x6821('0xe'),_0x6821('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 7d48d69..8b1cac5 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 _0x7453=['../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7453,0xcc));var _0x3745=function(_0x26bca6,_0x4c5efd){_0x26bca6=_0x26bca6-0x0;var _0x375bd1=_0x7453[_0x26bca6];return _0x375bd1;};'use strict';var _=require(_0x3745('0x0'));var util=require(_0x3745('0x1'));var moment=require('moment');var BPromise=require(_0x3745('0x2'));var rs=require(_0x3745('0x3'));var fs=require('fs');var Redis=require(_0x3745('0x4'));var db=require(_0x3745('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3745('0x6'))(_0x3745('0x7'));var config=require('../../config/environment');var jayson=require(_0x3745('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc9ad25,_0x2397f7,_0x5708db){return new BPromise(function(_0x4e88dd,_0xeceb4){return client[_0x3745('0x9')](_0xc9ad25,_0x5708db)[_0x3745('0xa')](function(_0x3b37d1){logger[_0x3745('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x2397f7,_0x3745('0xc'));logger[_0x3745('0xd')](_0x3745('0xe'),_0x2397f7,_0x3745('0xc'),JSON[_0x3745('0xf')](_0x3b37d1));if(_0x3b37d1[_0x3745('0x10')]){if(_0x3b37d1['error'][_0x3745('0x11')]===0x1f4){logger[_0x3745('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x2397f7,_0x3b37d1[_0x3745('0x10')][_0x3745('0x12')]);return _0xeceb4(_0x3b37d1[_0x3745('0x10')][_0x3745('0x12')]);}logger[_0x3745('0x10')](_0x3745('0x13'),_0x2397f7,_0x3b37d1[_0x3745('0x10')]['message']);return _0x4e88dd(_0x3b37d1[_0x3745('0x10')]['message']);}else{logger[_0x3745('0xb')](_0x3745('0x13'),_0x2397f7,_0x3745('0xc'));_0x4e88dd(_0x3b37d1[_0x3745('0x14')][_0x3745('0x12')]);}})['catch'](function(_0x193b14){logger[_0x3745('0x10')](_0x3745('0x13'),_0x2397f7,_0x193b14);_0xeceb4(_0x193b14);});});} \ No newline at end of file +var _0x0987=['code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error'];(function(_0x439c41,_0x309721){var _0x4187d0=function(_0x3fa727){while(--_0x3fa727){_0x439c41['push'](_0x439c41['shift']());}};_0x4187d0(++_0x309721);}(_0x0987,0x193));var _0x7098=function(_0x28a968,_0x33d131){_0x28a968=_0x28a968-0x0;var _0x410e35=_0x0987[_0x28a968];return _0x410e35;};'use strict';var _=require(_0x7098('0x0'));var util=require(_0x7098('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7098('0x2'));var fs=require('fs');var Redis=require(_0x7098('0x3'));var db=require(_0x7098('0x4'))['db'];var utils=require(_0x7098('0x5'));var logger=require(_0x7098('0x6'))(_0x7098('0x7'));var config=require(_0x7098('0x8'));var jayson=require(_0x7098('0x9'));var client=jayson['client'][_0x7098('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x281da2,_0x5f3903,_0x175f55){return new BPromise(function(_0x1b91c6,_0x59279e){return client['request'](_0x281da2,_0x175f55)['then'](function(_0x4f609c){logger[_0x7098('0xb')](_0x7098('0xc'),_0x5f3903,_0x7098('0xd'));logger[_0x7098('0xe')](_0x7098('0xf'),_0x5f3903,_0x7098('0xd'),JSON['stringify'](_0x4f609c));if(_0x4f609c[_0x7098('0x10')]){if(_0x4f609c['error'][_0x7098('0x11')]===0x1f4){logger[_0x7098('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x5f3903,_0x4f609c[_0x7098('0x10')][_0x7098('0x12')]);return _0x59279e(_0x4f609c[_0x7098('0x10')][_0x7098('0x12')]);}logger[_0x7098('0x10')](_0x7098('0xc'),_0x5f3903,_0x4f609c[_0x7098('0x10')]['message']);return _0x1b91c6(_0x4f609c[_0x7098('0x10')][_0x7098('0x12')]);}else{logger['info'](_0x7098('0xc'),_0x5f3903,_0x7098('0xd'));_0x1b91c6(_0x4f609c['result'][_0x7098('0x12')]);}})[_0x7098('0x13')](function(_0x5de973){logger[_0x7098('0x10')](_0x7098('0xc'),_0x5f3903,_0x5de973);_0x59279e(_0x5de973);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 9c4d232..a1f27ba 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 _0x39cb=['put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x39cb,0x1bd));var _0xb39c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x39cb[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['show']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),controller[_0xb39c('0xf')]);router[_0xb39c('0xe')](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x10')]);router[_0xb39c('0x11')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x14')]);module[_0xb39c('0x15')]=router; \ No newline at end of file +var _0xb7e7=['put','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xb7e7,0x121));var _0x7b7e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb7e7[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x12')]);router[_0x7b7e('0x13')]('/:id',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['delete'](_0x7b7e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 2aa4a55..3367482 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 _0x1399=['exports','STRING','username','remoteUri','sequelize'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x1399,0x16c));var _0x9139=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0x1399[_0x1af5b2];return _0xf1aa2d;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9139('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x9139('0x3')},'apiKey':{'type':Sequelize[_0x9139('0x2')]},'remoteUri':{'type':Sequelize[_0x9139('0x2')],'unique':_0x9139('0x4')},'serverUrl':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x77d4=['exports','STRING','username'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x77d4,0x108));var _0x477d=function(_0x318c27,_0x280505){_0x318c27=_0x318c27-0x0;var _0x16e8cf=_0x77d4[_0x318c27];return _0x16e8cf;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 4ee1cc0..6158615 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 _0x2177=['show','params','keys','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','pick','options','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','username','remoteUri','apiKey','substring','lastIndexOf','%s%s','users','email','Requested\x20Resource\x20not\x20Found','catch','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','send','index','map','FreshsalesAccount','fieldName','model','intersection','query','fields','attributes','length','nolimit','limit','order','sort','filters','where','type','VIRTUAL','filter','merge','includeAll','findAll','rows'];(function(_0xf2ccc0,_0x447ce8){var _0xc9ec65=function(_0x5aeee1){while(--_0x5aeee1){_0xf2ccc0['push'](_0xf2ccc0['shift']());}};_0xc9ec65(++_0x447ce8);}(_0x2177,0x1ae));var _0x7217=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x2177[_0x12e3e3];return _0x26602e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7217('0x0'));var zipdir=require(_0x7217('0x1'));var jsonpatch=require(_0x7217('0x2'));var rp=require(_0x7217('0x3'));var moment=require('moment');var BPromise=require(_0x7217('0x4'));var Mustache=require(_0x7217('0x5'));var util=require(_0x7217('0x6'));var path=require(_0x7217('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(_0x7217('0x8'));var crypto=require(_0x7217('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7217('0xa'));var toCsv=require(_0x7217('0xb'));var querystring=require(_0x7217('0xc'));var Papa=require(_0x7217('0xd'));var Redis=require(_0x7217('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7217('0xf'));var as=require(_0x7217('0x10'));var hardwareService=require(_0x7217('0x11'));var logger=require(_0x7217('0x12'))(_0x7217('0x13'));var utils=require(_0x7217('0x14'));var config=require(_0x7217('0x15'));var licenseUtil=require(_0x7217('0x16'));var db=require(_0x7217('0x17'))['db'];var integrations=require(_0x7217('0x18'));function respondWithStatusCode(_0x1fa702,_0x269e16){_0x269e16=_0x269e16||0xcc;return function(_0x592bf7){if(_0x592bf7){return _0x1fa702[_0x7217('0x19')](_0x269e16);}return _0x1fa702[_0x7217('0x1a')](_0x269e16)['end']();};}function respondWithResult(_0x9e422d,_0x394dee){_0x394dee=_0x394dee||0xc8;return function(_0x3b824c){if(_0x3b824c){return _0x9e422d[_0x7217('0x1a')](_0x394dee)['json'](_0x3b824c);}};}function respondWithFilteredResult(_0x572d39,_0x12dd6f){return function(_0x1059ed){if(_0x1059ed){var _0x101fac=typeof _0x12dd6f[_0x7217('0x1b')]===_0x7217('0x1c')&&typeof _0x12dd6f['limit']===_0x7217('0x1c');var _0x2cad9d=_0x1059ed[_0x7217('0x1d')];var _0x44e139=_0x101fac?0x0:_0x12dd6f[_0x7217('0x1b')];var _0x57202a=_0x101fac?_0x1059ed[_0x7217('0x1d')]:_0x12dd6f[_0x7217('0x1b')]+_0x12dd6f['limit'];var _0x2ff3ea;if(_0x57202a>=_0x2cad9d){_0x57202a=_0x2cad9d;_0x2ff3ea=0xc8;}else{_0x2ff3ea=0xce;}_0x572d39[_0x7217('0x1a')](_0x2ff3ea);return _0x572d39[_0x7217('0x1e')](_0x7217('0x1f'),_0x44e139+'-'+_0x57202a+'/'+_0x2cad9d)[_0x7217('0x20')](_0x1059ed);}return null;};}function patchUpdates(_0x5b5bb0){return function(_0x3ffcae){try{jsonpatch[_0x7217('0x21')](_0x3ffcae,_0x5b5bb0,!![]);}catch(_0x5093ac){return BPromise['reject'](_0x5093ac);}return _0x3ffcae[_0x7217('0x22')]();};}function saveUpdates(_0x15c455,_0x3d03ca){return function(_0x18a92c){if(_0x18a92c){return _0x18a92c[_0x7217('0x23')](_0x15c455)[_0x7217('0x24')](function(_0x2864a1){return _0x2864a1;});}return null;};}function removeEntity(_0x412f09,_0x2b513d){return function(_0x9ae9b6){if(_0x9ae9b6){return _0x9ae9b6[_0x7217('0x25')]()[_0x7217('0x24')](function(){_0x412f09[_0x7217('0x1a')](0xcc)[_0x7217('0x26')]();});}};}function handleEntityNotFound(_0x4c2b0b,_0x57ab27){return function(_0x39962a){if(!_0x39962a){_0x4c2b0b[_0x7217('0x19')](0x194);}return _0x39962a;};}function handleError(_0x278e99,_0x4b17c7){_0x4b17c7=_0x4b17c7||0x1f4;return function(_0x474b8f){logger[_0x7217('0x27')](_0x474b8f['stack']);if(_0x474b8f[_0x7217('0x28')]){delete _0x474b8f[_0x7217('0x28')];}_0x278e99[_0x7217('0x1a')](_0x4b17c7)[_0x7217('0x29')](_0x474b8f);};}exports[_0x7217('0x2a')]=function(_0x251f0e,_0xf7c920){var _0x192c7a={},_0x55ce20={},_0x213b5f={'count':0x0,'rows':[]};var _0x428100=_[_0x7217('0x2b')](db[_0x7217('0x2c')]['rawAttributes'],function(_0x34a09f){return{'name':_0x34a09f[_0x7217('0x2d')],'type':_0x34a09f['type']['key']};});_0x55ce20['model']=_[_0x7217('0x2b')](_0x428100,_0x7217('0x28'));_0x55ce20['query']=_['keys'](_0x251f0e['query']);_0x55ce20['filters']=_['intersection'](_0x55ce20[_0x7217('0x2e')],_0x55ce20['query']);_0x192c7a['attributes']=_[_0x7217('0x2f')](_0x55ce20[_0x7217('0x2e')],qs['fields'](_0x251f0e[_0x7217('0x30')][_0x7217('0x31')]));_0x192c7a['attributes']=_0x192c7a[_0x7217('0x32')][_0x7217('0x33')]?_0x192c7a[_0x7217('0x32')]:_0x55ce20[_0x7217('0x2e')];if(!_0x251f0e['query']['hasOwnProperty'](_0x7217('0x34'))){_0x192c7a[_0x7217('0x35')]=qs['limit'](_0x251f0e[_0x7217('0x30')][_0x7217('0x35')]);_0x192c7a[_0x7217('0x1b')]=qs[_0x7217('0x1b')](_0x251f0e[_0x7217('0x30')][_0x7217('0x1b')]);}_0x192c7a[_0x7217('0x36')]=qs[_0x7217('0x37')](_0x251f0e[_0x7217('0x30')][_0x7217('0x37')]);_0x192c7a['where']=qs[_0x7217('0x38')](_['pick'](_0x251f0e[_0x7217('0x30')],_0x55ce20[_0x7217('0x38')]),_0x428100);if(_0x251f0e[_0x7217('0x30')]['filter']){_0x192c7a[_0x7217('0x39')]=_['merge'](_0x192c7a[_0x7217('0x39')],{'$or':_[_0x7217('0x2b')](_0x428100,function(_0x18cc63){if(_0x18cc63[_0x7217('0x3a')]!==_0x7217('0x3b')){var _0x333873={};_0x333873[_0x18cc63[_0x7217('0x28')]]={'$like':'%'+_0x251f0e[_0x7217('0x30')][_0x7217('0x3c')]+'%'};return _0x333873;}})});}_0x192c7a=_[_0x7217('0x3d')]({},_0x192c7a,_0x251f0e['options']);var _0x94e1e7={'where':_0x192c7a['where']};return db['FreshsalesAccount'][_0x7217('0x1d')](_0x94e1e7)['then'](function(_0x25edcc){_0x213b5f['count']=_0x25edcc;if(_0x251f0e[_0x7217('0x30')][_0x7217('0x3e')]){_0x192c7a['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x7217('0x3f')](_0x192c7a);})[_0x7217('0x24')](function(_0x380194){_0x213b5f[_0x7217('0x40')]=_0x380194;return _0x213b5f;})[_0x7217('0x24')](respondWithFilteredResult(_0xf7c920,_0x192c7a))['catch'](handleError(_0xf7c920,null));};exports[_0x7217('0x41')]=function(_0x2103b2,_0x12c206){var _0x420d61={'raw':![],'where':{'id':_0x2103b2[_0x7217('0x42')]['id']}},_0x5bbcc1={};_0x5bbcc1[_0x7217('0x2e')]=_[_0x7217('0x43')](db['FreshsalesAccount']['rawAttributes']);_0x5bbcc1[_0x7217('0x30')]=_['keys'](_0x2103b2[_0x7217('0x30')]);_0x5bbcc1[_0x7217('0x38')]=_[_0x7217('0x2f')](_0x5bbcc1[_0x7217('0x2e')],_0x5bbcc1['query']);_0x420d61['attributes']=_[_0x7217('0x2f')](_0x5bbcc1[_0x7217('0x2e')],qs[_0x7217('0x31')](_0x2103b2[_0x7217('0x30')]['fields']));_0x420d61[_0x7217('0x32')]=_0x420d61[_0x7217('0x32')][_0x7217('0x33')]?_0x420d61[_0x7217('0x32')]:_0x5bbcc1['model'];if(_0x2103b2['query'][_0x7217('0x3e')]){_0x420d61[_0x7217('0x44')]=[{'all':!![]}];}_0x420d61=_['merge']({},_0x420d61,_0x2103b2['options']);return db[_0x7217('0x2c')][_0x7217('0x45')](_0x420d61)[_0x7217('0x24')](handleEntityNotFound(_0x12c206,null))[_0x7217('0x24')](respondWithResult(_0x12c206,null))['catch'](handleError(_0x12c206,null));};exports[_0x7217('0x46')]=function(_0x1a4f17,_0xadf1c3){return db[_0x7217('0x2c')][_0x7217('0x46')](_0x1a4f17[_0x7217('0x47')],{})['then'](respondWithResult(_0xadf1c3,0xc9))['catch'](handleError(_0xadf1c3,null));};exports[_0x7217('0x23')]=function(_0x32ea76,_0x891a33){if(_0x32ea76[_0x7217('0x47')]['id']){delete _0x32ea76['body']['id'];}return db[_0x7217('0x2c')][_0x7217('0x45')]({'where':{'id':_0x32ea76[_0x7217('0x42')]['id']}})['then'](handleEntityNotFound(_0x891a33,null))['then'](saveUpdates(_0x32ea76[_0x7217('0x47')],null))[_0x7217('0x24')](respondWithResult(_0x891a33,null))['catch'](handleError(_0x891a33,null));};exports['destroy']=function(_0x35da75,_0x29b00b){return db[_0x7217('0x2c')][_0x7217('0x45')]({'where':{'id':_0x35da75[_0x7217('0x42')]['id']}})[_0x7217('0x24')](handleEntityNotFound(_0x29b00b,null))['then'](removeEntity(_0x29b00b,null))['catch'](handleError(_0x29b00b,null));};exports[_0x7217('0x48')]=function(_0x9ddf1a,_0x2ab5ef,_0x4f2c7a){var _0xb744b7={};var _0x3fde61={};var _0xea57f;var _0x431e6d;return db['FreshsalesAccount'][_0x7217('0x49')]({'where':{'id':_0x9ddf1a[_0x7217('0x42')]['id']}})[_0x7217('0x24')](handleEntityNotFound(_0x2ab5ef,null))[_0x7217('0x24')](function(_0x1a5e42){if(_0x1a5e42){_0xea57f=_0x1a5e42;_0x3fde61[_0x7217('0x2e')]=_[_0x7217('0x43')](db[_0x7217('0x4a')][_0x7217('0x4b')]);_0x3fde61[_0x7217('0x30')]=_[_0x7217('0x43')](_0x9ddf1a[_0x7217('0x30')]);_0x3fde61[_0x7217('0x38')]=_[_0x7217('0x2f')](_0x3fde61[_0x7217('0x2e')],_0x3fde61[_0x7217('0x30')]);_0xb744b7[_0x7217('0x32')]=_[_0x7217('0x2f')](_0x3fde61[_0x7217('0x2e')],qs[_0x7217('0x31')](_0x9ddf1a[_0x7217('0x30')][_0x7217('0x31')]));_0xb744b7[_0x7217('0x32')]=_0xb744b7['attributes']['length']?_0xb744b7[_0x7217('0x32')]:_0x3fde61[_0x7217('0x2e')];_0xb744b7[_0x7217('0x36')]=qs['sort'](_0x9ddf1a[_0x7217('0x30')][_0x7217('0x37')]);_0xb744b7[_0x7217('0x39')]=qs[_0x7217('0x38')](_[_0x7217('0x4c')](_0x9ddf1a['query'],_0x3fde61[_0x7217('0x38')]));if(_0x9ddf1a[_0x7217('0x30')]['filter']){_0xb744b7['where']=_[_0x7217('0x3d')](_0xb744b7[_0x7217('0x39')],{'$or':_[_0x7217('0x2b')](_0xb744b7[_0x7217('0x32')],function(_0x3aaffa){var _0x3f5be1={};_0x3f5be1[_0x3aaffa]={'$like':'%'+_0x9ddf1a['query']['filter']+'%'};return _0x3f5be1;})});}_0xb744b7=_[_0x7217('0x3d')]({},_0xb744b7,_0x9ddf1a[_0x7217('0x4d')]);return _0xea57f[_0x7217('0x48')](_0xb744b7);}})[_0x7217('0x24')](function(_0x5b418f){if(_0x5b418f){_0x431e6d=_0x5b418f[_0x7217('0x33')];if(!_0x9ddf1a['query']['hasOwnProperty'](_0x7217('0x34'))){_0xb744b7[_0x7217('0x35')]=qs['limit'](_0x9ddf1a[_0x7217('0x30')][_0x7217('0x35')]);_0xb744b7['offset']=qs[_0x7217('0x1b')](_0x9ddf1a['query'][_0x7217('0x1b')]);}return _0xea57f[_0x7217('0x48')](_0xb744b7);}})[_0x7217('0x24')](function(_0x2445eb){if(_0x2445eb){return _0x2445eb?{'count':_0x431e6d,'rows':_0x2445eb}:null;}})[_0x7217('0x24')](respondWithResult(_0x2ab5ef,null))['catch'](handleError(_0x2ab5ef,null));};exports[_0x7217('0x4e')]=function(_0x30e12c,_0x210336,_0x156807){if(_0x30e12c[_0x7217('0x47')]['id']){delete _0x30e12c['body']['id'];}return db['FreshsalesAccount'][_0x7217('0x49')]({'where':{'id':_0x30e12c[_0x7217('0x42')]['id']}})[_0x7217('0x24')](handleEntityNotFound(_0x210336,null))['then'](function(_0x52b1b9){if(_0x52b1b9){_0x30e12c['body']['AccountId']=_0x52b1b9['id'];_0x30e12c[_0x7217('0x47')][_0x7217('0x4f')]=integrations[_0x7217('0x50')](_0x30e12c[_0x7217('0x47')][_0x7217('0x51')],_0x30e12c[_0x7217('0x47')][_0x7217('0x3a')]);_0x30e12c[_0x7217('0x47')]['Descriptions']=integrations[_0x7217('0x52')](_0x30e12c[_0x7217('0x47')][_0x7217('0x51')],_0x30e12c[_0x7217('0x47')][_0x7217('0x3a')]);return db[_0x7217('0x4a')][_0x7217('0x46')](_0x30e12c[_0x7217('0x47')],{'include':[{'model':db[_0x7217('0x53')],'as':_0x7217('0x4f')},{'model':db[_0x7217('0x53')],'as':'Descriptions'}]});}return null;})[_0x7217('0x24')](respondWithResult(_0x210336,null))['catch'](handleError(_0x210336,null));};exports['getFields']=function(_0x29225c,_0x3dbc90,_0x22ad27){var _0x17b7b7='';var _0x439a92='';return db['FreshsalesAccount'][_0x7217('0x49')]({'where':{'id':_0x29225c[_0x7217('0x42')]['id']},'attributes':['id',_0x7217('0x54'),_0x7217('0x55'),_0x7217('0x56')]})['then'](handleEntityNotFound(_0x3dbc90,null))[_0x7217('0x24')](function(_0x40952d){if(_0x40952d){_0x439a92=_0x40952d[_0x7217('0x54')];_0x17b7b7=_0x40952d['remoteUri'];var _0x53cf3c=_0x40952d[_0x7217('0x55')]['slice'](-0x1);if(_0x53cf3c==='/'){_0x17b7b7=_0x17b7b7[_0x7217('0x57')](0x0,_0x17b7b7[_0x7217('0x58')](_0x53cf3c));}return rp({'method':'GET','uri':util['format'](_0x7217('0x59'),_0x17b7b7,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x40952d['apiKey']},'json':!![]});}})[_0x7217('0x24')](function(_0x592584){if(_0x592584){var _0x4ac636=_0x592584[_0x7217('0x5a')];var _0x1cbfc2=![];var _0x1b3bc5=null;for(_0x1b3bc5=0x0;_0x1b3bc5<_0x4ac636[_0x7217('0x33')];_0x1b3bc5++){if(_0x4ac636[_0x1b3bc5][_0x7217('0x5b')]===_0x439a92){_0x1cbfc2=!![];}}if(_0x1cbfc2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7217('0x5c')});}}})[_0x7217('0x24')](respondWithResult(_0x3dbc90,null))[_0x7217('0x5d')](function(_0xadd719){var _0x247b8c=_0x29225c[_0x7217('0x30')][_0x7217('0x5e')]?0x1f4:_0xadd719[_0x7217('0x5f')]||0x1f4;logger[_0x7217('0x27')](_0x7217('0x60'),_0x7217('0x61'),_0x247b8c,JSON['stringify'](_0xadd719));delete _0xadd719[_0x7217('0x28')];if(_0x247b8c===0x191){_0x247b8c=0x190;}_0x3dbc90[_0x7217('0x1a')](_0x247b8c)[_0x7217('0x29')](_0x29225c[_0x7217('0x30')][_0x7217('0x5e')]?{'message':_0x7217('0x62'),'statusCode':_0xadd719['statusCode']}:_0xadd719);});}; \ No newline at end of file +var _0x9187=['apiKey','username','slice','substring','lastIndexOf','GET','%s%s','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','Content-Range','update','then','end','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','FreshsalesConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','remoteUri'];(function(_0x247a68,_0x6e8e5d){var _0x17e79a=function(_0x34e9ac){while(--_0x34e9ac){_0x247a68['push'](_0x247a68['shift']());}};_0x17e79a(++_0x6e8e5d);}(_0x9187,0x70));var _0x7918=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9187[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x7918('0x0'));var rimraf=require(_0x7918('0x1'));var zipdir=require(_0x7918('0x2'));var jsonpatch=require(_0x7918('0x3'));var rp=require('request-promise');var moment=require(_0x7918('0x4'));var BPromise=require(_0x7918('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7918('0x6'));var ejs=require(_0x7918('0x7'));var fs=require('fs');var fs_extra=require(_0x7918('0x8'));var _=require(_0x7918('0x9'));var squel=require(_0x7918('0xa'));var crypto=require('crypto');var jsforce=require(_0x7918('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7918('0x6'));var querystring=require('querystring');var Papa=require(_0x7918('0xc'));var Redis=require(_0x7918('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7918('0xe'));var as=require(_0x7918('0xf'));var hardwareService=require(_0x7918('0x10'));var logger=require(_0x7918('0x11'))(_0x7918('0x12'));var utils=require(_0x7918('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7918('0x14'));function respondWithStatusCode(_0xc374de,_0x5bb0fe){_0x5bb0fe=_0x5bb0fe||0xcc;return function(_0x34414b){if(_0x34414b){return _0xc374de[_0x7918('0x15')](_0x5bb0fe);}return _0xc374de[_0x7918('0x16')](_0x5bb0fe)['end']();};}function respondWithResult(_0x54b9fb,_0x554b4c){_0x554b4c=_0x554b4c||0xc8;return function(_0x236800){if(_0x236800){return _0x54b9fb[_0x7918('0x16')](_0x554b4c)[_0x7918('0x17')](_0x236800);}};}function respondWithFilteredResult(_0x419d33,_0x29ceb9){return function(_0x3537e4){if(_0x3537e4){var _0x35c774=typeof _0x29ceb9[_0x7918('0x18')]==='undefined'&&typeof _0x29ceb9[_0x7918('0x19')]===_0x7918('0x1a');var _0x226cf6=_0x3537e4[_0x7918('0x1b')];var _0x13af49=_0x35c774?0x0:_0x29ceb9[_0x7918('0x18')];var _0x2696c4=_0x35c774?_0x3537e4[_0x7918('0x1b')]:_0x29ceb9['offset']+_0x29ceb9[_0x7918('0x19')];var _0x34f622;if(_0x2696c4>=_0x226cf6){_0x2696c4=_0x226cf6;_0x34f622=0xc8;}else{_0x34f622=0xce;}_0x419d33[_0x7918('0x16')](_0x34f622);return _0x419d33['set'](_0x7918('0x1c'),_0x13af49+'-'+_0x2696c4+'/'+_0x226cf6)['json'](_0x3537e4);}return null;};}function patchUpdates(_0x17da33){return function(_0x17840b){try{jsonpatch['apply'](_0x17840b,_0x17da33,!![]);}catch(_0x26edfb){return BPromise['reject'](_0x26edfb);}return _0x17840b['save']();};}function saveUpdates(_0x368bfd,_0x612f2c){return function(_0x56edaf){if(_0x56edaf){return _0x56edaf[_0x7918('0x1d')](_0x368bfd)[_0x7918('0x1e')](function(_0x4800fb){return _0x4800fb;});}return null;};}function removeEntity(_0x584944,_0x286c42){return function(_0x3fec81){if(_0x3fec81){return _0x3fec81['destroy']()[_0x7918('0x1e')](function(){_0x584944[_0x7918('0x16')](0xcc)[_0x7918('0x1f')]();});}};}function handleEntityNotFound(_0x3d532f,_0x3065bf){return function(_0x4a81df){if(!_0x4a81df){_0x3d532f[_0x7918('0x15')](0x194);}return _0x4a81df;};}function handleError(_0x5ee120,_0x8b46ec){_0x8b46ec=_0x8b46ec||0x1f4;return function(_0x2d2c11){logger[_0x7918('0x20')](_0x2d2c11[_0x7918('0x21')]);if(_0x2d2c11['name']){delete _0x2d2c11[_0x7918('0x22')];}_0x5ee120[_0x7918('0x16')](_0x8b46ec)[_0x7918('0x23')](_0x2d2c11);};}exports[_0x7918('0x24')]=function(_0x5235df,_0x7d2a26){var _0x1e814b={},_0x5615f7={},_0x14e492={'count':0x0,'rows':[]};var _0x112cea=_[_0x7918('0x25')](db[_0x7918('0x26')]['rawAttributes'],function(_0x3c69ad){return{'name':_0x3c69ad[_0x7918('0x27')],'type':_0x3c69ad[_0x7918('0x28')][_0x7918('0x29')]};});_0x5615f7[_0x7918('0x2a')]=_[_0x7918('0x25')](_0x112cea,_0x7918('0x22'));_0x5615f7[_0x7918('0x2b')]=_[_0x7918('0x2c')](_0x5235df[_0x7918('0x2b')]);_0x5615f7[_0x7918('0x2d')]=_[_0x7918('0x2e')](_0x5615f7[_0x7918('0x2a')],_0x5615f7[_0x7918('0x2b')]);_0x1e814b[_0x7918('0x2f')]=_[_0x7918('0x2e')](_0x5615f7[_0x7918('0x2a')],qs['fields'](_0x5235df[_0x7918('0x2b')][_0x7918('0x30')]));_0x1e814b[_0x7918('0x2f')]=_0x1e814b['attributes'][_0x7918('0x31')]?_0x1e814b[_0x7918('0x2f')]:_0x5615f7[_0x7918('0x2a')];if(!_0x5235df[_0x7918('0x2b')][_0x7918('0x32')](_0x7918('0x33'))){_0x1e814b[_0x7918('0x19')]=qs['limit'](_0x5235df[_0x7918('0x2b')][_0x7918('0x19')]);_0x1e814b[_0x7918('0x18')]=qs['offset'](_0x5235df['query'][_0x7918('0x18')]);}_0x1e814b[_0x7918('0x34')]=qs[_0x7918('0x35')](_0x5235df[_0x7918('0x2b')][_0x7918('0x35')]);_0x1e814b['where']=qs[_0x7918('0x2d')](_[_0x7918('0x36')](_0x5235df[_0x7918('0x2b')],_0x5615f7['filters']),_0x112cea);if(_0x5235df[_0x7918('0x2b')][_0x7918('0x37')]){_0x1e814b[_0x7918('0x38')]=_[_0x7918('0x39')](_0x1e814b[_0x7918('0x38')],{'$or':_[_0x7918('0x25')](_0x112cea,function(_0x537e03){if(_0x537e03[_0x7918('0x28')]!==_0x7918('0x3a')){var _0x5c087d={};_0x5c087d[_0x537e03['name']]={'$like':'%'+_0x5235df[_0x7918('0x2b')]['filter']+'%'};return _0x5c087d;}})});}_0x1e814b=_['merge']({},_0x1e814b,_0x5235df[_0x7918('0x3b')]);var _0x525025={'where':_0x1e814b[_0x7918('0x38')]};return db[_0x7918('0x26')]['count'](_0x525025)[_0x7918('0x1e')](function(_0x4b1974){_0x14e492[_0x7918('0x1b')]=_0x4b1974;if(_0x5235df[_0x7918('0x2b')][_0x7918('0x3c')]){_0x1e814b['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x1e814b);})[_0x7918('0x1e')](function(_0x2a3e16){_0x14e492[_0x7918('0x3d')]=_0x2a3e16;return _0x14e492;})[_0x7918('0x1e')](respondWithFilteredResult(_0x7d2a26,_0x1e814b))[_0x7918('0x3e')](handleError(_0x7d2a26,null));};exports[_0x7918('0x3f')]=function(_0x5d161c,_0x198cdf){var _0x1367b7={'raw':![],'where':{'id':_0x5d161c[_0x7918('0x40')]['id']}},_0x5b056b={};_0x5b056b[_0x7918('0x2a')]=_[_0x7918('0x2c')](db[_0x7918('0x26')][_0x7918('0x41')]);_0x5b056b['query']=_[_0x7918('0x2c')](_0x5d161c[_0x7918('0x2b')]);_0x5b056b[_0x7918('0x2d')]=_['intersection'](_0x5b056b[_0x7918('0x2a')],_0x5b056b['query']);_0x1367b7['attributes']=_[_0x7918('0x2e')](_0x5b056b[_0x7918('0x2a')],qs['fields'](_0x5d161c['query'][_0x7918('0x30')]));_0x1367b7[_0x7918('0x2f')]=_0x1367b7[_0x7918('0x2f')]['length']?_0x1367b7[_0x7918('0x2f')]:_0x5b056b[_0x7918('0x2a')];if(_0x5d161c[_0x7918('0x2b')]['includeAll']){_0x1367b7['include']=[{'all':!![]}];}_0x1367b7=_['merge']({},_0x1367b7,_0x5d161c[_0x7918('0x3b')]);return db[_0x7918('0x26')][_0x7918('0x42')](_0x1367b7)[_0x7918('0x1e')](handleEntityNotFound(_0x198cdf,null))[_0x7918('0x1e')](respondWithResult(_0x198cdf,null))['catch'](handleError(_0x198cdf,null));};exports[_0x7918('0x43')]=function(_0x3d1bff,_0x371181){return db['FreshsalesAccount'][_0x7918('0x43')](_0x3d1bff[_0x7918('0x44')],{})[_0x7918('0x1e')](respondWithResult(_0x371181,0xc9))[_0x7918('0x3e')](handleError(_0x371181,null));};exports[_0x7918('0x1d')]=function(_0x597f4c,_0x35aa09){if(_0x597f4c[_0x7918('0x44')]['id']){delete _0x597f4c['body']['id'];}return db['FreshsalesAccount'][_0x7918('0x42')]({'where':{'id':_0x597f4c[_0x7918('0x40')]['id']}})[_0x7918('0x1e')](handleEntityNotFound(_0x35aa09,null))[_0x7918('0x1e')](saveUpdates(_0x597f4c[_0x7918('0x44')],null))[_0x7918('0x1e')](respondWithResult(_0x35aa09,null))[_0x7918('0x3e')](handleError(_0x35aa09,null));};exports[_0x7918('0x45')]=function(_0x5e0ec4,_0x3a0e34){return db[_0x7918('0x26')][_0x7918('0x42')]({'where':{'id':_0x5e0ec4[_0x7918('0x40')]['id']}})[_0x7918('0x1e')](handleEntityNotFound(_0x3a0e34,null))[_0x7918('0x1e')](removeEntity(_0x3a0e34,null))['catch'](handleError(_0x3a0e34,null));};exports[_0x7918('0x46')]=function(_0x1bdeb3,_0x349f69,_0x13d230){var _0x16b09b={};var _0x41e813={};var _0x4e71ec;var _0x196639;return db[_0x7918('0x26')]['findOne']({'where':{'id':_0x1bdeb3[_0x7918('0x40')]['id']}})[_0x7918('0x1e')](handleEntityNotFound(_0x349f69,null))[_0x7918('0x1e')](function(_0x51b299){if(_0x51b299){_0x4e71ec=_0x51b299;_0x41e813[_0x7918('0x2a')]=_[_0x7918('0x2c')](db[_0x7918('0x47')]['rawAttributes']);_0x41e813[_0x7918('0x2b')]=_['keys'](_0x1bdeb3[_0x7918('0x2b')]);_0x41e813[_0x7918('0x2d')]=_[_0x7918('0x2e')](_0x41e813['model'],_0x41e813['query']);_0x16b09b[_0x7918('0x2f')]=_[_0x7918('0x2e')](_0x41e813['model'],qs[_0x7918('0x30')](_0x1bdeb3[_0x7918('0x2b')][_0x7918('0x30')]));_0x16b09b[_0x7918('0x2f')]=_0x16b09b[_0x7918('0x2f')]['length']?_0x16b09b['attributes']:_0x41e813[_0x7918('0x2a')];_0x16b09b[_0x7918('0x34')]=qs[_0x7918('0x35')](_0x1bdeb3[_0x7918('0x2b')][_0x7918('0x35')]);_0x16b09b[_0x7918('0x38')]=qs[_0x7918('0x2d')](_[_0x7918('0x36')](_0x1bdeb3[_0x7918('0x2b')],_0x41e813[_0x7918('0x2d')]));if(_0x1bdeb3[_0x7918('0x2b')][_0x7918('0x37')]){_0x16b09b['where']=_[_0x7918('0x39')](_0x16b09b[_0x7918('0x38')],{'$or':_[_0x7918('0x25')](_0x16b09b['attributes'],function(_0x49384c){var _0x121d68={};_0x121d68[_0x49384c]={'$like':'%'+_0x1bdeb3[_0x7918('0x2b')][_0x7918('0x37')]+'%'};return _0x121d68;})});}_0x16b09b=_[_0x7918('0x39')]({},_0x16b09b,_0x1bdeb3[_0x7918('0x3b')]);return _0x4e71ec['getConfigurations'](_0x16b09b);}})['then'](function(_0x48cfe9){if(_0x48cfe9){_0x196639=_0x48cfe9[_0x7918('0x31')];if(!_0x1bdeb3[_0x7918('0x2b')]['hasOwnProperty'](_0x7918('0x33'))){_0x16b09b[_0x7918('0x19')]=qs['limit'](_0x1bdeb3[_0x7918('0x2b')]['limit']);_0x16b09b['offset']=qs[_0x7918('0x18')](_0x1bdeb3['query']['offset']);}return _0x4e71ec[_0x7918('0x46')](_0x16b09b);}})[_0x7918('0x1e')](function(_0xaec6eb){if(_0xaec6eb){return _0xaec6eb?{'count':_0x196639,'rows':_0xaec6eb}:null;}})['then'](respondWithResult(_0x349f69,null))[_0x7918('0x3e')](handleError(_0x349f69,null));};exports['addConfiguration']=function(_0x160dff,_0x172c9c,_0x233acc){if(_0x160dff[_0x7918('0x44')]['id']){delete _0x160dff['body']['id'];}return db[_0x7918('0x26')][_0x7918('0x48')]({'where':{'id':_0x160dff[_0x7918('0x40')]['id']}})[_0x7918('0x1e')](handleEntityNotFound(_0x172c9c,null))[_0x7918('0x1e')](function(_0x21e800){if(_0x21e800){_0x160dff[_0x7918('0x44')][_0x7918('0x49')]=_0x21e800['id'];_0x160dff['body'][_0x7918('0x4a')]=integrations[_0x7918('0x4b')](_0x160dff[_0x7918('0x44')][_0x7918('0x4c')],_0x160dff[_0x7918('0x44')]['type']);_0x160dff[_0x7918('0x44')][_0x7918('0x4d')]=integrations[_0x7918('0x4e')](_0x160dff[_0x7918('0x44')][_0x7918('0x4c')],_0x160dff[_0x7918('0x44')][_0x7918('0x28')]);return db[_0x7918('0x47')][_0x7918('0x43')](_0x160dff['body'],{'include':[{'model':db[_0x7918('0x4f')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x7918('0x4d')}]});}return null;})[_0x7918('0x1e')](respondWithResult(_0x172c9c,null))[_0x7918('0x3e')](handleError(_0x172c9c,null));};exports[_0x7918('0x50')]=function(_0x557297,_0x4c81bb,_0x46bb03){var _0x166cd3='';var _0x241951='';return db[_0x7918('0x26')]['findOne']({'where':{'id':_0x557297[_0x7918('0x40')]['id']},'attributes':['id','username',_0x7918('0x51'),_0x7918('0x52')]})[_0x7918('0x1e')](handleEntityNotFound(_0x4c81bb,null))['then'](function(_0x25f30f){if(_0x25f30f){_0x241951=_0x25f30f[_0x7918('0x53')];_0x166cd3=_0x25f30f[_0x7918('0x51')];var _0x478f48=_0x25f30f['remoteUri'][_0x7918('0x54')](-0x1);if(_0x478f48==='/'){_0x166cd3=_0x166cd3[_0x7918('0x55')](0x0,_0x166cd3[_0x7918('0x56')](_0x478f48));}return rp({'method':_0x7918('0x57'),'uri':util['format'](_0x7918('0x58'),_0x166cd3,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x25f30f[_0x7918('0x52')]},'json':!![]});}})['then'](function(_0x572ecf){if(_0x572ecf){var _0x293070=_0x572ecf[_0x7918('0x59')];var _0x254796=![];var _0x8e233=null;for(_0x8e233=0x0;_0x8e233<_0x293070[_0x7918('0x31')];_0x8e233++){if(_0x293070[_0x8e233][_0x7918('0x5a')]===_0x241951){_0x254796=!![];}}if(_0x254796){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7918('0x5b')});}}})[_0x7918('0x1e')](respondWithResult(_0x4c81bb,null))[_0x7918('0x3e')](function(_0x12b7fb){var _0x562ecd=_0x557297[_0x7918('0x2b')][_0x7918('0x5c')]?0x1f4:_0x12b7fb[_0x7918('0x5d')]||0x1f4;logger[_0x7918('0x20')](_0x7918('0x5e'),_0x7918('0x50'),_0x562ecd,JSON[_0x7918('0x5f')](_0x12b7fb));delete _0x12b7fb['name'];if(_0x562ecd===0x191){_0x562ecd=0x190;}_0x4c81bb['status'](_0x562ecd)[_0x7918('0x23')](_0x557297[_0x7918('0x2b')][_0x7918('0x5c')]?{'message':_0x7918('0x60'),'statusCode':_0x12b7fb[_0x7918('0x5d')]}:_0x12b7fb);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b0cb08b..958c1d0 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 _0x5f2f=['../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util'];(function(_0x209d9e,_0x368eb6){var _0x2abe25=function(_0x35715f){while(--_0x35715f){_0x209d9e['push'](_0x209d9e['shift']());}};_0x2abe25(++_0x368eb6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e0ab0,_0x11a5cf){_0x4e0ab0=_0x4e0ab0-0x0;var _0x1b1b56=_0x5f2f[_0x4e0ab0];return _0x1b1b56;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));var integrations=require(_0xf5f2('0x9'));module[_0xf5f2('0xa')]=function(_0x3eebf6,_0x3133bc){return _0x3eebf6[_0xf5f2('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xf5f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4325=['int_freshsales_accounts','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define'];(function(_0x76eb19,_0x25f423){var _0x314507=function(_0x27a24d){while(--_0x27a24d){_0x76eb19['push'](_0x76eb19['shift']());}};_0x314507(++_0x25f423);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x5432('0x8')]=function(_0xbb0075,_0x4a6e76){return _0xbb0075[_0x5432('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x5432('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index a4c97ac..28511e9 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 _0x32b6=['raw','where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','GetFreshsalesAccount','FreshsalesAccount','findAll','options'];(function(_0x4f562a,_0x4ac213){var _0xbda7a4=function(_0x1e6ebd){while(--_0x1e6ebd){_0x4f562a['push'](_0x4f562a['shift']());}};_0xbda7a4(++_0x4ac213);}(_0x32b6,0x1d1));var _0x632b=function(_0x434c94,_0x27701a){_0x434c94=_0x434c94-0x0;var _0x18e89c=_0x32b6[_0x434c94];return _0x18e89c;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')]({'raw':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1a')]||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f['options'][_0x632b('0x1b')]||null:null,'limit':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x18')][_0x632b('0x1c')]||null:null,'include':_0x3bb27f[_0x632b('0x18')]?_0x3bb27f['options'][_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x3bb27f['options'][_0x632b('0x1d')],function(_0x379dc2){return{'model':db[_0x379dc2[_0x632b('0x1f')]],'as':_0x379dc2['as'],'attributes':_0x379dc2[_0x632b('0x1b')],'include':_0x379dc2[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x379dc2['include'],function(_0x5e7b20){return{'model':db[_0x5e7b20[_0x632b('0x1f')]],'as':_0x5e7b20['as'],'attributes':_0x5e7b20['attributes'],'include':_0x5e7b20[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x5e7b20['include'],function(_0x273e89){return{'model':db[_0x273e89[_0x632b('0x1f')]],'as':_0x273e89['as'],'attributes':_0x273e89[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x4728a8){logger[_0x632b('0x14')](_0x632b('0x15'),_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON['stringify'](_0x4728a8));_0x51c894(_0x4728a8);})[_0x632b('0x20')](function(_0x35348e){logger[_0x632b('0x10')](_0x632b('0x15'),_0x35348e[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x35348e[_0x632b('0x13')]));});});};exports[_0x632b('0x21')]=function(_0x1ace1b){var _0x319df3=this;return new Promise(function(_0x417793,_0x35584f){return db[_0x632b('0x16')][_0x632b('0x22')]({'raw':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x19')]===undefined?!![]:![]:!![],'where':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1a')]||null:null,'attributes':_0x1ace1b['options']?_0x1ace1b[_0x632b('0x18')][_0x632b('0x1b')]||null:null,'include':_0x1ace1b[_0x632b('0x18')]?_0x1ace1b[_0x632b('0x18')]['include']?_[_0x632b('0x1e')](_0x1ace1b['options'][_0x632b('0x1d')],function(_0x15b22d){return{'model':db[_0x15b22d['model']],'as':_0x15b22d['as'],'attributes':_0x15b22d[_0x632b('0x1b')],'include':_0x15b22d[_0x632b('0x1d')]?_[_0x632b('0x1e')](_0x15b22d[_0x632b('0x1d')],function(_0x27bbf5){return{'model':db[_0x27bbf5[_0x632b('0x1f')]],'as':_0x27bbf5['as'],'attributes':_0x27bbf5[_0x632b('0x1b')],'include':_0x27bbf5[_0x632b('0x1d')]?_['map'](_0x27bbf5['include'],function(_0x22ae6a){return{'model':db[_0x22ae6a[_0x632b('0x1f')]],'as':_0x22ae6a['as'],'attributes':_0x22ae6a[_0x632b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x632b('0xc')](function(_0x384420){logger[_0x632b('0x14')](_0x632b('0x21'),_0x1ace1b);logger[_0x632b('0xd')]('ShowFreshsalesAccount',_0x1ace1b,JSON['stringify'](_0x384420));_0x417793(_0x384420);})[_0x632b('0x20')](function(_0x581b92){logger[_0x632b('0x10')](_0x632b('0x21'),_0x581b92[_0x632b('0x13')],_0x1ace1b);_0x35584f(_0x319df3[_0x632b('0x10')](0x1f4,_0x581b92[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x5f2f,0x73));var _0xf5f2=function(_0x151ab5,_0x2d7459){_0x151ab5=_0x151ab5-0x0;var _0x46acfa=_0x5f2f[_0x151ab5];return _0x46acfa;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index ff4f068..5d496d6 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 _0x5be7=['get','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','put','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index'];(function(_0x5276c6,_0x23dab0){var _0x468b37=function(_0x4b6e0c){while(--_0x4b6e0c){_0x5276c6['push'](_0x5276c6['shift']());}};_0x468b37(++_0x23dab0);}(_0x5be7,0x182));var _0x75be=function(_0xbb6739,_0x37e0af){_0xbb6739=_0xbb6739-0x0;var _0x3259a4=_0x5be7[_0xbb6739];return _0x3259a4;};'use strict';var multer=require(_0x75be('0x0'));var util=require(_0x75be('0x1'));var path=require(_0x75be('0x2'));var timeout=require('connect-timeout');var express=require(_0x75be('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75be('0x4'));var interaction=require(_0x75be('0x5'));var config=require(_0x75be('0x6'));var controller=require(_0x75be('0x7'));router['get']('/',auth[_0x75be('0x8')](),controller[_0x75be('0x9')]);router[_0x75be('0xa')](_0x75be('0xb'),auth[_0x75be('0x8')](),controller[_0x75be('0xc')]);router[_0x75be('0xa')](_0x75be('0xd'),auth[_0x75be('0x8')](),controller[_0x75be('0xe')]);router['get']('/:id/descriptions',auth[_0x75be('0x8')](),controller[_0x75be('0xf')]);router[_0x75be('0xa')](_0x75be('0x10'),auth[_0x75be('0x8')](),controller[_0x75be('0x11')]);router[_0x75be('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x75be('0x13')](_0x75be('0xb'),auth[_0x75be('0x8')](),controller['update']);router[_0x75be('0x14')](_0x75be('0xb'),auth[_0x75be('0x8')](),controller[_0x75be('0x15')]);module['exports']=router; \ No newline at end of file +var _0xeb68=['/:id/fields','post','create','put','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x16eed0,_0xd3b40c){var _0x3cc645=function(_0x5e4b5a){while(--_0x5e4b5a){_0x16eed0['push'](_0x16eed0['shift']());}};_0x3cc645(++_0xd3b40c);}(_0xeb68,0x178));var _0x8eb6=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0xeb68[_0x30c2ae];return _0x1ee1cc;};'use strict';var multer=require(_0x8eb6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8eb6('0x1'));var express=require(_0x8eb6('0x2'));var router=express[_0x8eb6('0x3')]();var fs_extra=require(_0x8eb6('0x4'));var auth=require(_0x8eb6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8eb6('0x6'));router[_0x8eb6('0x7')]('/',auth[_0x8eb6('0x8')](),controller[_0x8eb6('0x9')]);router[_0x8eb6('0x7')]('/:id',auth[_0x8eb6('0x8')](),controller[_0x8eb6('0xa')]);router[_0x8eb6('0x7')](_0x8eb6('0xb'),auth[_0x8eb6('0x8')](),controller[_0x8eb6('0xc')]);router['get'](_0x8eb6('0xd'),auth[_0x8eb6('0x8')](),controller[_0x8eb6('0xe')]);router['get'](_0x8eb6('0xf'),auth[_0x8eb6('0x8')](),controller['getFields']);router[_0x8eb6('0x10')]('/',auth[_0x8eb6('0x8')](),controller[_0x8eb6('0x11')]);router[_0x8eb6('0x12')]('/:id',auth[_0x8eb6('0x8')](),controller['update']);router[_0x8eb6('0x13')](_0x8eb6('0x14'),auth['isAuthenticated'](),controller[_0x8eb6('0x15')]);module[_0x8eb6('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 54beead..dffbf99 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 _0xe451=['STRING','sequelize','exports'];(function(_0x3a9516,_0x19a696){var _0xf04299=function(_0x47e21c){while(--_0x47e21c){_0x3a9516['push'](_0x3a9516['shift']());}};_0xf04299(++_0x19a696);}(_0xe451,0x12d));var _0x1e45=function(_0x756326,_0x4005bb){_0x756326=_0x756326-0x0;var _0x11e2ca=_0xe451[_0x756326];return _0x11e2ca;};'use strict';var Sequelize=require(_0x1e45('0x0'));module[_0x1e45('0x1')]={'name':{'type':Sequelize[_0x1e45('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda77=['STRING','sequelize'];(function(_0x38cf85,_0x234c29){var _0x5a4c10=function(_0xcfabf2){while(--_0xcfabf2){_0x38cf85['push'](_0x38cf85['shift']());}};_0x5a4c10(++_0x234c29);}(_0xda77,0x173));var _0x7da7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xda77[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7da7('0x0'));module['exports']={'name':{'type':Sequelize[_0x7da7('0x1')]},'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 da92784..e7f3fc2 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 _0xf1db=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','rawAttributes','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','rows','show','params','keys','find','catch','create','body','getSubjects','FreshsalesField','getDescriptions','hasOwnProperty','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x2bfd45,_0x1b5278){var _0x1e7cdd=function(_0x46e693){while(--_0x46e693){_0x2bfd45['push'](_0x2bfd45['shift']());}};_0x1e7cdd(++_0x1b5278);}(_0xf1db,0x85));var _0xbf1d=function(_0x730d45,_0x3996a5){_0x730d45=_0x730d45-0x0;var _0x467bb6=_0xf1db[_0x730d45];return _0x467bb6;};'use strict';var emlformat=require(_0xbf1d('0x0'));var rimraf=require(_0xbf1d('0x1'));var zipdir=require(_0xbf1d('0x2'));var jsonpatch=require(_0xbf1d('0x3'));var rp=require(_0xbf1d('0x4'));var moment=require('moment');var BPromise=require(_0xbf1d('0x5'));var Mustache=require(_0xbf1d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbf1d('0x7'));var csv=require(_0xbf1d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf1d('0x9'));var squel=require(_0xbf1d('0xa'));var crypto=require(_0xbf1d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf1d('0xc'));var toCsv=require(_0xbf1d('0x8'));var querystring=require(_0xbf1d('0xd'));var Papa=require(_0xbf1d('0xe'));var Redis=require(_0xbf1d('0xf'));var authService=require(_0xbf1d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbf1d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf1d('0x12'))(_0xbf1d('0x13'));var utils=require(_0xbf1d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbf1d('0x15'))['db'];function respondWithStatusCode(_0x246a54,_0x46d94c){_0x46d94c=_0x46d94c||0xcc;return function(_0x137963){if(_0x137963){return _0x246a54[_0xbf1d('0x16')](_0x46d94c);}return _0x246a54[_0xbf1d('0x17')](_0x46d94c)[_0xbf1d('0x18')]();};}function respondWithResult(_0x1c0ff1,_0x8c6cd1){_0x8c6cd1=_0x8c6cd1||0xc8;return function(_0x43554f){if(_0x43554f){return _0x1c0ff1[_0xbf1d('0x17')](_0x8c6cd1)[_0xbf1d('0x19')](_0x43554f);}};}function respondWithFilteredResult(_0x295358,_0x1453e9){return function(_0x20e994){if(_0x20e994){var _0x137712=typeof _0x1453e9[_0xbf1d('0x1a')]===_0xbf1d('0x1b')&&typeof _0x1453e9[_0xbf1d('0x1c')]===_0xbf1d('0x1b');var _0x962428=_0x20e994[_0xbf1d('0x1d')];var _0x43e30f=_0x137712?0x0:_0x1453e9['offset'];var _0x53840c=_0x137712?_0x20e994[_0xbf1d('0x1d')]:_0x1453e9[_0xbf1d('0x1a')]+_0x1453e9[_0xbf1d('0x1c')];var _0x345890;if(_0x53840c>=_0x962428){_0x53840c=_0x962428;_0x345890=0xc8;}else{_0x345890=0xce;}_0x295358[_0xbf1d('0x17')](_0x345890);return _0x295358[_0xbf1d('0x1e')](_0xbf1d('0x1f'),_0x43e30f+'-'+_0x53840c+'/'+_0x962428)['json'](_0x20e994);}return null;};}function patchUpdates(_0x5433be){return function(_0x3a98c9){try{jsonpatch[_0xbf1d('0x20')](_0x3a98c9,_0x5433be,!![]);}catch(_0x8be084){return BPromise[_0xbf1d('0x21')](_0x8be084);}return _0x3a98c9[_0xbf1d('0x22')]();};}function saveUpdates(_0x310cba,_0x4b84cf){return function(_0x46d6d5){if(_0x46d6d5){return _0x46d6d5[_0xbf1d('0x23')](_0x310cba)['then'](function(_0x1b25a4){return _0x1b25a4;});}return null;};}function removeEntity(_0x1f9e04,_0x16daef){return function(_0x398290){if(_0x398290){return _0x398290[_0xbf1d('0x24')]()[_0xbf1d('0x25')](function(){_0x1f9e04['status'](0xcc)[_0xbf1d('0x18')]();});}};}function handleEntityNotFound(_0x59493e,_0x3109b8){return function(_0x2f254e){if(!_0x2f254e){_0x59493e[_0xbf1d('0x16')](0x194);}return _0x2f254e;};}function handleError(_0x473e49,_0x2b69b8){_0x2b69b8=_0x2b69b8||0x1f4;return function(_0x33a3dd){logger[_0xbf1d('0x26')](_0x33a3dd['stack']);if(_0x33a3dd[_0xbf1d('0x27')]){delete _0x33a3dd['name'];}_0x473e49[_0xbf1d('0x17')](_0x2b69b8)['send'](_0x33a3dd);};}exports['index']=function(_0xeba96a,_0x47c431){var _0x36bfe5={},_0x5e3edb={},_0xb2d8b3={'count':0x0,'rows':[]};var _0x34af36=_['map'](db['FreshsalesConfiguration'][_0xbf1d('0x28')],function(_0x5d52eb){return{'name':_0x5d52eb[_0xbf1d('0x29')],'type':_0x5d52eb['type'][_0xbf1d('0x2a')]};});_0x5e3edb['model']=_[_0xbf1d('0x2b')](_0x34af36,_0xbf1d('0x27'));_0x5e3edb['query']=_['keys'](_0xeba96a[_0xbf1d('0x2c')]);_0x5e3edb[_0xbf1d('0x2d')]=_['intersection'](_0x5e3edb[_0xbf1d('0x2e')],_0x5e3edb[_0xbf1d('0x2c')]);_0x36bfe5[_0xbf1d('0x2f')]=_[_0xbf1d('0x30')](_0x5e3edb[_0xbf1d('0x2e')],qs[_0xbf1d('0x31')](_0xeba96a[_0xbf1d('0x2c')][_0xbf1d('0x31')]));_0x36bfe5[_0xbf1d('0x2f')]=_0x36bfe5['attributes'][_0xbf1d('0x32')]?_0x36bfe5[_0xbf1d('0x2f')]:_0x5e3edb[_0xbf1d('0x2e')];if(!_0xeba96a[_0xbf1d('0x2c')]['hasOwnProperty'](_0xbf1d('0x33'))){_0x36bfe5[_0xbf1d('0x1c')]=qs[_0xbf1d('0x1c')](_0xeba96a[_0xbf1d('0x2c')]['limit']);_0x36bfe5[_0xbf1d('0x1a')]=qs[_0xbf1d('0x1a')](_0xeba96a[_0xbf1d('0x2c')][_0xbf1d('0x1a')]);}_0x36bfe5[_0xbf1d('0x34')]=qs[_0xbf1d('0x35')](_0xeba96a[_0xbf1d('0x2c')][_0xbf1d('0x35')]);_0x36bfe5[_0xbf1d('0x36')]=qs['filters'](_[_0xbf1d('0x37')](_0xeba96a['query'],_0x5e3edb[_0xbf1d('0x2d')]),_0x34af36);if(_0xeba96a[_0xbf1d('0x2c')][_0xbf1d('0x38')]){_0x36bfe5[_0xbf1d('0x36')]=_['merge'](_0x36bfe5[_0xbf1d('0x36')],{'$or':_[_0xbf1d('0x2b')](_0x34af36,function(_0x285438){if(_0x285438['type']!==_0xbf1d('0x39')){var _0x380ca1={};_0x380ca1[_0x285438[_0xbf1d('0x27')]]={'$like':'%'+_0xeba96a['query']['filter']+'%'};return _0x380ca1;}})});}_0x36bfe5=_[_0xbf1d('0x3a')]({},_0x36bfe5,_0xeba96a[_0xbf1d('0x3b')]);var _0x4deca7={'where':_0x36bfe5[_0xbf1d('0x36')]};return db[_0xbf1d('0x3c')][_0xbf1d('0x1d')](_0x4deca7)[_0xbf1d('0x25')](function(_0x307541){_0xb2d8b3[_0xbf1d('0x1d')]=_0x307541;if(_0xeba96a['query'][_0xbf1d('0x3d')]){_0x36bfe5[_0xbf1d('0x3e')]=[{'all':!![]}];}return db[_0xbf1d('0x3c')]['findAll'](_0x36bfe5);})[_0xbf1d('0x25')](function(_0x38b501){_0xb2d8b3[_0xbf1d('0x3f')]=_0x38b501;return _0xb2d8b3;})['then'](respondWithFilteredResult(_0x47c431,_0x36bfe5))['catch'](handleError(_0x47c431,null));};exports[_0xbf1d('0x40')]=function(_0xd9dae8,_0x2172ae){var _0x216742={'raw':![],'where':{'id':_0xd9dae8[_0xbf1d('0x41')]['id']}},_0x5aad32={};_0x5aad32[_0xbf1d('0x2e')]=_[_0xbf1d('0x42')](db[_0xbf1d('0x3c')][_0xbf1d('0x28')]);_0x5aad32[_0xbf1d('0x2c')]=_['keys'](_0xd9dae8[_0xbf1d('0x2c')]);_0x5aad32['filters']=_['intersection'](_0x5aad32[_0xbf1d('0x2e')],_0x5aad32['query']);_0x216742[_0xbf1d('0x2f')]=_[_0xbf1d('0x30')](_0x5aad32[_0xbf1d('0x2e')],qs['fields'](_0xd9dae8[_0xbf1d('0x2c')][_0xbf1d('0x31')]));_0x216742[_0xbf1d('0x2f')]=_0x216742[_0xbf1d('0x2f')][_0xbf1d('0x32')]?_0x216742['attributes']:_0x5aad32[_0xbf1d('0x2e')];if(_0xd9dae8['query'][_0xbf1d('0x3d')]){_0x216742[_0xbf1d('0x3e')]=[{'all':!![]}];}_0x216742=_['merge']({},_0x216742,_0xd9dae8['options']);return db[_0xbf1d('0x3c')][_0xbf1d('0x43')](_0x216742)[_0xbf1d('0x25')](handleEntityNotFound(_0x2172ae,null))[_0xbf1d('0x25')](respondWithResult(_0x2172ae,null))[_0xbf1d('0x44')](handleError(_0x2172ae,null));};exports[_0xbf1d('0x45')]=function(_0x5b4319,_0x347e80){return db[_0xbf1d('0x3c')][_0xbf1d('0x45')](_0x5b4319['body'],{})[_0xbf1d('0x25')](respondWithResult(_0x347e80,0xc9))[_0xbf1d('0x44')](handleError(_0x347e80,null));};exports[_0xbf1d('0x23')]=function(_0x416cd6,_0x3f5552){if(_0x416cd6['body']['id']){delete _0x416cd6[_0xbf1d('0x46')]['id'];}return db[_0xbf1d('0x3c')][_0xbf1d('0x43')]({'where':{'id':_0x416cd6[_0xbf1d('0x41')]['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x3f5552,null))[_0xbf1d('0x25')](saveUpdates(_0x416cd6[_0xbf1d('0x46')],null))[_0xbf1d('0x25')](respondWithResult(_0x3f5552,null))[_0xbf1d('0x44')](handleError(_0x3f5552,null));};exports[_0xbf1d('0x24')]=function(_0xa8030e,_0x1938bf){return db[_0xbf1d('0x3c')][_0xbf1d('0x43')]({'where':{'id':_0xa8030e[_0xbf1d('0x41')]['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x1938bf,null))[_0xbf1d('0x25')](removeEntity(_0x1938bf,null))[_0xbf1d('0x44')](handleError(_0x1938bf,null));};exports[_0xbf1d('0x47')]=function(_0x1aa09d,_0x1d1853,_0x20e950){var _0x47ccf4={};var _0x42b318={};var _0x6750a9;var _0x4c8b16;return db[_0xbf1d('0x3c')]['findOne']({'where':{'id':_0x1aa09d[_0xbf1d('0x41')]['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x1d1853,null))[_0xbf1d('0x25')](function(_0x51f58e){if(_0x51f58e){_0x6750a9=_0x51f58e;_0x42b318['model']=_[_0xbf1d('0x42')](db[_0xbf1d('0x48')][_0xbf1d('0x28')]);_0x42b318[_0xbf1d('0x2c')]=_[_0xbf1d('0x42')](_0x1aa09d['query']);_0x42b318[_0xbf1d('0x2d')]=_['intersection'](_0x42b318[_0xbf1d('0x2e')],_0x42b318[_0xbf1d('0x2c')]);_0x47ccf4[_0xbf1d('0x2f')]=_['intersection'](_0x42b318[_0xbf1d('0x2e')],qs[_0xbf1d('0x31')](_0x1aa09d[_0xbf1d('0x2c')]['fields']));_0x47ccf4[_0xbf1d('0x2f')]=_0x47ccf4['attributes'][_0xbf1d('0x32')]?_0x47ccf4[_0xbf1d('0x2f')]:_0x42b318[_0xbf1d('0x2e')];_0x47ccf4['order']=qs[_0xbf1d('0x35')](_0x1aa09d[_0xbf1d('0x2c')][_0xbf1d('0x35')]);_0x47ccf4[_0xbf1d('0x36')]=qs[_0xbf1d('0x2d')](_[_0xbf1d('0x37')](_0x1aa09d['query'],_0x42b318[_0xbf1d('0x2d')]));if(_0x1aa09d['query'][_0xbf1d('0x38')]){_0x47ccf4[_0xbf1d('0x36')]=_[_0xbf1d('0x3a')](_0x47ccf4[_0xbf1d('0x36')],{'$or':_[_0xbf1d('0x2b')](_0x47ccf4['attributes'],function(_0x485ad1){var _0x56884b={};_0x56884b[_0x485ad1]={'$like':'%'+_0x1aa09d[_0xbf1d('0x2c')][_0xbf1d('0x38')]+'%'};return _0x56884b;})});}_0x47ccf4=_['merge']({},_0x47ccf4,_0x1aa09d['options']);return _0x6750a9[_0xbf1d('0x47')](_0x47ccf4);}})['then'](function(_0x58fa27){if(_0x58fa27){_0x4c8b16=_0x58fa27[_0xbf1d('0x32')];if(!_0x1aa09d[_0xbf1d('0x2c')]['hasOwnProperty'](_0xbf1d('0x33'))){_0x47ccf4[_0xbf1d('0x1c')]=qs[_0xbf1d('0x1c')](_0x1aa09d['query'][_0xbf1d('0x1c')]);_0x47ccf4[_0xbf1d('0x1a')]=qs['offset'](_0x1aa09d[_0xbf1d('0x2c')][_0xbf1d('0x1a')]);}return _0x6750a9[_0xbf1d('0x47')](_0x47ccf4);}})[_0xbf1d('0x25')](function(_0x33283f){if(_0x33283f){return _0x33283f?{'count':_0x4c8b16,'rows':_0x33283f}:null;}})[_0xbf1d('0x25')](respondWithResult(_0x1d1853,null))[_0xbf1d('0x44')](handleError(_0x1d1853,null));};exports[_0xbf1d('0x49')]=function(_0x3bccd2,_0x4b7731,_0x2cce95){var _0x561f01={};var _0x33d537={};var _0xe7c4c;var _0xd68f09;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3bccd2[_0xbf1d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b7731,null))['then'](function(_0x3e5cc5){if(_0x3e5cc5){_0xe7c4c=_0x3e5cc5;_0x33d537[_0xbf1d('0x2e')]=_[_0xbf1d('0x42')](db[_0xbf1d('0x48')][_0xbf1d('0x28')]);_0x33d537[_0xbf1d('0x2c')]=_[_0xbf1d('0x42')](_0x3bccd2['query']);_0x33d537[_0xbf1d('0x2d')]=_[_0xbf1d('0x30')](_0x33d537[_0xbf1d('0x2e')],_0x33d537[_0xbf1d('0x2c')]);_0x561f01[_0xbf1d('0x2f')]=_[_0xbf1d('0x30')](_0x33d537[_0xbf1d('0x2e')],qs['fields'](_0x3bccd2['query'][_0xbf1d('0x31')]));_0x561f01['attributes']=_0x561f01[_0xbf1d('0x2f')]['length']?_0x561f01[_0xbf1d('0x2f')]:_0x33d537[_0xbf1d('0x2e')];_0x561f01[_0xbf1d('0x34')]=qs[_0xbf1d('0x35')](_0x3bccd2['query'][_0xbf1d('0x35')]);_0x561f01[_0xbf1d('0x36')]=qs[_0xbf1d('0x2d')](_['pick'](_0x3bccd2[_0xbf1d('0x2c')],_0x33d537[_0xbf1d('0x2d')]));if(_0x3bccd2['query'][_0xbf1d('0x38')]){_0x561f01[_0xbf1d('0x36')]=_[_0xbf1d('0x3a')](_0x561f01[_0xbf1d('0x36')],{'$or':_[_0xbf1d('0x2b')](_0x561f01[_0xbf1d('0x2f')],function(_0x26f641){var _0x331918={};_0x331918[_0x26f641]={'$like':'%'+_0x3bccd2[_0xbf1d('0x2c')]['filter']+'%'};return _0x331918;})});}_0x561f01=_[_0xbf1d('0x3a')]({},_0x561f01,_0x3bccd2[_0xbf1d('0x3b')]);return _0xe7c4c[_0xbf1d('0x49')](_0x561f01);}})['then'](function(_0x3d134e){if(_0x3d134e){_0xd68f09=_0x3d134e['length'];if(!_0x3bccd2[_0xbf1d('0x2c')][_0xbf1d('0x4a')](_0xbf1d('0x33'))){_0x561f01[_0xbf1d('0x1c')]=qs[_0xbf1d('0x1c')](_0x3bccd2[_0xbf1d('0x2c')][_0xbf1d('0x1c')]);_0x561f01['offset']=qs[_0xbf1d('0x1a')](_0x3bccd2['query'][_0xbf1d('0x1a')]);}return _0xe7c4c[_0xbf1d('0x49')](_0x561f01);}})['then'](function(_0x3fe15b){if(_0x3fe15b){return _0x3fe15b?{'count':_0xd68f09,'rows':_0x3fe15b}:null;}})['then'](respondWithResult(_0x4b7731,null))[_0xbf1d('0x44')](handleError(_0x4b7731,null));};exports['getFields']=function(_0x1e46c4,_0x476835,_0x5b4af1){var _0x3add2b={};var _0x1eafa2={};var _0x270fc3;var _0x568871;return db[_0xbf1d('0x3c')][_0xbf1d('0x4b')]({'where':{'id':_0x1e46c4[_0xbf1d('0x41')]['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x476835,null))['then'](function(_0x264f30){if(_0x264f30){_0x270fc3=_0x264f30;_0x1eafa2[_0xbf1d('0x2e')]=_[_0xbf1d('0x42')](db['FreshsalesField'][_0xbf1d('0x28')]);_0x1eafa2[_0xbf1d('0x2c')]=_[_0xbf1d('0x42')](_0x1e46c4[_0xbf1d('0x2c')]);_0x1eafa2[_0xbf1d('0x2d')]=_['intersection'](_0x1eafa2[_0xbf1d('0x2e')],_0x1eafa2[_0xbf1d('0x2c')]);_0x3add2b['attributes']=_[_0xbf1d('0x30')](_0x1eafa2[_0xbf1d('0x2e')],qs[_0xbf1d('0x31')](_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x31')]));_0x3add2b['attributes']=_0x3add2b['attributes']['length']?_0x3add2b[_0xbf1d('0x2f')]:_0x1eafa2[_0xbf1d('0x2e')];_0x3add2b[_0xbf1d('0x34')]=qs['sort'](_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x35')]);_0x3add2b[_0xbf1d('0x36')]=qs[_0xbf1d('0x2d')](_['pick'](_0x1e46c4[_0xbf1d('0x2c')],_0x1eafa2[_0xbf1d('0x2d')]));if(_0x1e46c4['query'][_0xbf1d('0x38')]){_0x3add2b[_0xbf1d('0x36')]=_[_0xbf1d('0x3a')](_0x3add2b[_0xbf1d('0x36')],{'$or':_['map'](_0x3add2b['attributes'],function(_0xc3faf6){var _0x420dd4={};_0x420dd4[_0xc3faf6]={'$like':'%'+_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x38')]+'%'};return _0x420dd4;})});}_0x3add2b=_[_0xbf1d('0x3a')]({},_0x3add2b,_0x1e46c4[_0xbf1d('0x3b')]);return _0x270fc3[_0xbf1d('0x4c')](_0x3add2b);}})[_0xbf1d('0x25')](function(_0x9031fe){if(_0x9031fe){_0x568871=_0x9031fe[_0xbf1d('0x32')];if(!_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x4a')](_0xbf1d('0x33'))){_0x3add2b[_0xbf1d('0x1c')]=qs[_0xbf1d('0x1c')](_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x1c')]);_0x3add2b[_0xbf1d('0x1a')]=qs[_0xbf1d('0x1a')](_0x1e46c4[_0xbf1d('0x2c')][_0xbf1d('0x1a')]);}return _0x270fc3['getFields'](_0x3add2b);}})[_0xbf1d('0x25')](function(_0x2f8bf4){if(_0x2f8bf4){return _0x2f8bf4?{'count':_0x568871,'rows':_0x2f8bf4}:null;}})[_0xbf1d('0x25')](respondWithResult(_0x476835,null))['catch'](handleError(_0x476835,null));}; \ No newline at end of file +var _0xb65a=['update','destroy','then','end','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','body','find','getSubjects','order','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save'];(function(_0x14fb14,_0x36aeaa){var _0x4587e9=function(_0x27dd69){while(--_0x27dd69){_0x14fb14['push'](_0x14fb14['shift']());}};_0x4587e9(++_0x36aeaa);}(_0xb65a,0x1c2));var _0xab65=function(_0x67e937,_0x502492){_0x67e937=_0x67e937-0x0;var _0x56399d=_0xb65a[_0x67e937];return _0x56399d;};'use strict';var emlformat=require(_0xab65('0x0'));var rimraf=require(_0xab65('0x1'));var zipdir=require(_0xab65('0x2'));var jsonpatch=require(_0xab65('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab65('0x4'));var Mustache=require(_0xab65('0x5'));var util=require(_0xab65('0x6'));var path=require(_0xab65('0x7'));var sox=require(_0xab65('0x8'));var csv=require(_0xab65('0x9'));var ejs=require(_0xab65('0xa'));var fs=require('fs');var fs_extra=require(_0xab65('0xb'));var _=require(_0xab65('0xc'));var squel=require('squel');var crypto=require(_0xab65('0xd'));var jsforce=require(_0xab65('0xe'));var deskjs=require(_0xab65('0xf'));var toCsv=require('to-csv');var querystring=require(_0xab65('0x10'));var Papa=require(_0xab65('0x11'));var Redis=require(_0xab65('0x12'));var authService=require(_0xab65('0x13'));var qs=require(_0xab65('0x14'));var as=require(_0xab65('0x15'));var hardwareService=require(_0xab65('0x16'));var logger=require('../../config/logger')(_0xab65('0x17'));var utils=require(_0xab65('0x18'));var config=require(_0xab65('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fd428,_0x5bc6f0){_0x5bc6f0=_0x5bc6f0||0xcc;return function(_0x1ae92a){if(_0x1ae92a){return _0x2fd428[_0xab65('0x1a')](_0x5bc6f0);}return _0x2fd428[_0xab65('0x1b')](_0x5bc6f0)['end']();};}function respondWithResult(_0x568f9c,_0x2f0acd){_0x2f0acd=_0x2f0acd||0xc8;return function(_0x16520a){if(_0x16520a){return _0x568f9c[_0xab65('0x1b')](_0x2f0acd)[_0xab65('0x1c')](_0x16520a);}};}function respondWithFilteredResult(_0x47c8cf,_0x45681c){return function(_0x1e49bb){if(_0x1e49bb){var _0x1ef7cd=typeof _0x45681c['offset']===_0xab65('0x1d')&&typeof _0x45681c[_0xab65('0x1e')]===_0xab65('0x1d');var _0x27d5ba=_0x1e49bb[_0xab65('0x1f')];var _0x370507=_0x1ef7cd?0x0:_0x45681c[_0xab65('0x20')];var _0x45d31f=_0x1ef7cd?_0x1e49bb[_0xab65('0x1f')]:_0x45681c[_0xab65('0x20')]+_0x45681c[_0xab65('0x1e')];var _0x5c54a3;if(_0x45d31f>=_0x27d5ba){_0x45d31f=_0x27d5ba;_0x5c54a3=0xc8;}else{_0x5c54a3=0xce;}_0x47c8cf['status'](_0x5c54a3);return _0x47c8cf['set']('Content-Range',_0x370507+'-'+_0x45d31f+'/'+_0x27d5ba)[_0xab65('0x1c')](_0x1e49bb);}return null;};}function patchUpdates(_0x152417){return function(_0x9837bc){try{jsonpatch[_0xab65('0x21')](_0x9837bc,_0x152417,!![]);}catch(_0x4a5b22){return BPromise[_0xab65('0x22')](_0x4a5b22);}return _0x9837bc[_0xab65('0x23')]();};}function saveUpdates(_0x2d0191,_0x340ab9){return function(_0x4b7f91){if(_0x4b7f91){return _0x4b7f91[_0xab65('0x24')](_0x2d0191)['then'](function(_0x482bd5){return _0x482bd5;});}return null;};}function removeEntity(_0x3e2f6b,_0x1961f1){return function(_0x576a4b){if(_0x576a4b){return _0x576a4b[_0xab65('0x25')]()[_0xab65('0x26')](function(){_0x3e2f6b['status'](0xcc)[_0xab65('0x27')]();});}};}function handleEntityNotFound(_0x4e079c,_0x27c168){return function(_0x50f0e3){if(!_0x50f0e3){_0x4e079c[_0xab65('0x1a')](0x194);}return _0x50f0e3;};}function handleError(_0x4848da,_0x2eeb4e){_0x2eeb4e=_0x2eeb4e||0x1f4;return function(_0x5c839d){logger[_0xab65('0x28')](_0x5c839d['stack']);if(_0x5c839d[_0xab65('0x29')]){delete _0x5c839d['name'];}_0x4848da['status'](_0x2eeb4e)[_0xab65('0x2a')](_0x5c839d);};}exports[_0xab65('0x2b')]=function(_0x1dc50c,_0x216f66){var _0x39e79b={},_0xa5820a={},_0x2d5643={'count':0x0,'rows':[]};var _0x3a0896=_[_0xab65('0x2c')](db[_0xab65('0x2d')][_0xab65('0x2e')],function(_0x11f6c7){return{'name':_0x11f6c7['fieldName'],'type':_0x11f6c7[_0xab65('0x2f')][_0xab65('0x30')]};});_0xa5820a[_0xab65('0x31')]=_[_0xab65('0x2c')](_0x3a0896,_0xab65('0x29'));_0xa5820a[_0xab65('0x32')]=_[_0xab65('0x33')](_0x1dc50c['query']);_0xa5820a[_0xab65('0x34')]=_[_0xab65('0x35')](_0xa5820a['model'],_0xa5820a[_0xab65('0x32')]);_0x39e79b['attributes']=_[_0xab65('0x35')](_0xa5820a[_0xab65('0x31')],qs[_0xab65('0x36')](_0x1dc50c['query'][_0xab65('0x36')]));_0x39e79b[_0xab65('0x37')]=_0x39e79b[_0xab65('0x37')][_0xab65('0x38')]?_0x39e79b[_0xab65('0x37')]:_0xa5820a['model'];if(!_0x1dc50c[_0xab65('0x32')][_0xab65('0x39')](_0xab65('0x3a'))){_0x39e79b['limit']=qs[_0xab65('0x1e')](_0x1dc50c[_0xab65('0x32')]['limit']);_0x39e79b[_0xab65('0x20')]=qs[_0xab65('0x20')](_0x1dc50c[_0xab65('0x32')][_0xab65('0x20')]);}_0x39e79b['order']=qs[_0xab65('0x3b')](_0x1dc50c[_0xab65('0x32')]['sort']);_0x39e79b[_0xab65('0x3c')]=qs[_0xab65('0x34')](_[_0xab65('0x3d')](_0x1dc50c['query'],_0xa5820a['filters']),_0x3a0896);if(_0x1dc50c['query']['filter']){_0x39e79b[_0xab65('0x3c')]=_['merge'](_0x39e79b[_0xab65('0x3c')],{'$or':_['map'](_0x3a0896,function(_0x556cab){if(_0x556cab[_0xab65('0x2f')]!==_0xab65('0x3e')){var _0x5cbb86={};_0x5cbb86[_0x556cab[_0xab65('0x29')]]={'$like':'%'+_0x1dc50c[_0xab65('0x32')][_0xab65('0x3f')]+'%'};return _0x5cbb86;}})});}_0x39e79b=_[_0xab65('0x40')]({},_0x39e79b,_0x1dc50c[_0xab65('0x41')]);var _0x4c757b={'where':_0x39e79b[_0xab65('0x3c')]};return db[_0xab65('0x2d')][_0xab65('0x1f')](_0x4c757b)['then'](function(_0x408e5e){_0x2d5643[_0xab65('0x1f')]=_0x408e5e;if(_0x1dc50c[_0xab65('0x32')]['includeAll']){_0x39e79b[_0xab65('0x42')]=[{'all':!![]}];}return db[_0xab65('0x2d')][_0xab65('0x43')](_0x39e79b);})[_0xab65('0x26')](function(_0x4fb2cb){_0x2d5643[_0xab65('0x44')]=_0x4fb2cb;return _0x2d5643;})[_0xab65('0x26')](respondWithFilteredResult(_0x216f66,_0x39e79b))[_0xab65('0x45')](handleError(_0x216f66,null));};exports['show']=function(_0x41ff3b,_0x23d87c){var _0x1a587f={'raw':![],'where':{'id':_0x41ff3b[_0xab65('0x46')]['id']}},_0x1bba98={};_0x1bba98[_0xab65('0x31')]=_[_0xab65('0x33')](db[_0xab65('0x2d')][_0xab65('0x2e')]);_0x1bba98['query']=_[_0xab65('0x33')](_0x41ff3b[_0xab65('0x32')]);_0x1bba98[_0xab65('0x34')]=_[_0xab65('0x35')](_0x1bba98['model'],_0x1bba98[_0xab65('0x32')]);_0x1a587f['attributes']=_[_0xab65('0x35')](_0x1bba98[_0xab65('0x31')],qs['fields'](_0x41ff3b['query'][_0xab65('0x36')]));_0x1a587f[_0xab65('0x37')]=_0x1a587f['attributes'][_0xab65('0x38')]?_0x1a587f[_0xab65('0x37')]:_0x1bba98[_0xab65('0x31')];if(_0x41ff3b[_0xab65('0x32')][_0xab65('0x47')]){_0x1a587f['include']=[{'all':!![]}];}_0x1a587f=_['merge']({},_0x1a587f,_0x41ff3b[_0xab65('0x41')]);return db[_0xab65('0x2d')]['find'](_0x1a587f)['then'](handleEntityNotFound(_0x23d87c,null))[_0xab65('0x26')](respondWithResult(_0x23d87c,null))[_0xab65('0x45')](handleError(_0x23d87c,null));};exports['create']=function(_0x516b55,_0x5d6743){return db['FreshsalesConfiguration'][_0xab65('0x48')](_0x516b55[_0xab65('0x49')],{})[_0xab65('0x26')](respondWithResult(_0x5d6743,0xc9))['catch'](handleError(_0x5d6743,null));};exports[_0xab65('0x24')]=function(_0x1542ff,_0xbf0c2d){if(_0x1542ff[_0xab65('0x49')]['id']){delete _0x1542ff[_0xab65('0x49')]['id'];}return db[_0xab65('0x2d')]['find']({'where':{'id':_0x1542ff[_0xab65('0x46')]['id']}})[_0xab65('0x26')](handleEntityNotFound(_0xbf0c2d,null))[_0xab65('0x26')](saveUpdates(_0x1542ff[_0xab65('0x49')],null))['then'](respondWithResult(_0xbf0c2d,null))[_0xab65('0x45')](handleError(_0xbf0c2d,null));};exports[_0xab65('0x25')]=function(_0x2a8e22,_0x54cf47){return db[_0xab65('0x2d')][_0xab65('0x4a')]({'where':{'id':_0x2a8e22[_0xab65('0x46')]['id']}})[_0xab65('0x26')](handleEntityNotFound(_0x54cf47,null))[_0xab65('0x26')](removeEntity(_0x54cf47,null))[_0xab65('0x45')](handleError(_0x54cf47,null));};exports[_0xab65('0x4b')]=function(_0x56e517,_0x34b986,_0x2e3a53){var _0xfd4343={};var _0x50d3bf={};var _0xc7e780;var _0x57c1b1;return db[_0xab65('0x2d')]['findOne']({'where':{'id':_0x56e517[_0xab65('0x46')]['id']}})[_0xab65('0x26')](handleEntityNotFound(_0x34b986,null))[_0xab65('0x26')](function(_0x41d170){if(_0x41d170){_0xc7e780=_0x41d170;_0x50d3bf[_0xab65('0x31')]=_[_0xab65('0x33')](db['FreshsalesField']['rawAttributes']);_0x50d3bf[_0xab65('0x32')]=_[_0xab65('0x33')](_0x56e517['query']);_0x50d3bf[_0xab65('0x34')]=_[_0xab65('0x35')](_0x50d3bf[_0xab65('0x31')],_0x50d3bf[_0xab65('0x32')]);_0xfd4343['attributes']=_[_0xab65('0x35')](_0x50d3bf[_0xab65('0x31')],qs[_0xab65('0x36')](_0x56e517[_0xab65('0x32')][_0xab65('0x36')]));_0xfd4343[_0xab65('0x37')]=_0xfd4343[_0xab65('0x37')][_0xab65('0x38')]?_0xfd4343['attributes']:_0x50d3bf[_0xab65('0x31')];_0xfd4343[_0xab65('0x4c')]=qs[_0xab65('0x3b')](_0x56e517['query']['sort']);_0xfd4343[_0xab65('0x3c')]=qs[_0xab65('0x34')](_[_0xab65('0x3d')](_0x56e517[_0xab65('0x32')],_0x50d3bf[_0xab65('0x34')]));if(_0x56e517['query'][_0xab65('0x3f')]){_0xfd4343[_0xab65('0x3c')]=_[_0xab65('0x40')](_0xfd4343['where'],{'$or':_[_0xab65('0x2c')](_0xfd4343[_0xab65('0x37')],function(_0x28e1c1){var _0x356758={};_0x356758[_0x28e1c1]={'$like':'%'+_0x56e517[_0xab65('0x32')][_0xab65('0x3f')]+'%'};return _0x356758;})});}_0xfd4343=_[_0xab65('0x40')]({},_0xfd4343,_0x56e517['options']);return _0xc7e780[_0xab65('0x4b')](_0xfd4343);}})[_0xab65('0x26')](function(_0x176539){if(_0x176539){_0x57c1b1=_0x176539['length'];if(!_0x56e517[_0xab65('0x32')]['hasOwnProperty'](_0xab65('0x3a'))){_0xfd4343[_0xab65('0x1e')]=qs['limit'](_0x56e517[_0xab65('0x32')][_0xab65('0x1e')]);_0xfd4343[_0xab65('0x20')]=qs[_0xab65('0x20')](_0x56e517['query'][_0xab65('0x20')]);}return _0xc7e780[_0xab65('0x4b')](_0xfd4343);}})[_0xab65('0x26')](function(_0x44d7a9){if(_0x44d7a9){return _0x44d7a9?{'count':_0x57c1b1,'rows':_0x44d7a9}:null;}})[_0xab65('0x26')](respondWithResult(_0x34b986,null))[_0xab65('0x45')](handleError(_0x34b986,null));};exports['getDescriptions']=function(_0x2c16af,_0x53f67b,_0x313e6a){var _0x3426e8={};var _0x38b7e1={};var _0xa46256;var _0x3626b6;return db[_0xab65('0x2d')][_0xab65('0x4d')]({'where':{'id':_0x2c16af[_0xab65('0x46')]['id']}})[_0xab65('0x26')](handleEntityNotFound(_0x53f67b,null))[_0xab65('0x26')](function(_0xf2b8d6){if(_0xf2b8d6){_0xa46256=_0xf2b8d6;_0x38b7e1[_0xab65('0x31')]=_[_0xab65('0x33')](db[_0xab65('0x4e')][_0xab65('0x2e')]);_0x38b7e1[_0xab65('0x32')]=_['keys'](_0x2c16af[_0xab65('0x32')]);_0x38b7e1[_0xab65('0x34')]=_['intersection'](_0x38b7e1[_0xab65('0x31')],_0x38b7e1[_0xab65('0x32')]);_0x3426e8[_0xab65('0x37')]=_[_0xab65('0x35')](_0x38b7e1['model'],qs['fields'](_0x2c16af[_0xab65('0x32')][_0xab65('0x36')]));_0x3426e8[_0xab65('0x37')]=_0x3426e8[_0xab65('0x37')][_0xab65('0x38')]?_0x3426e8[_0xab65('0x37')]:_0x38b7e1['model'];_0x3426e8[_0xab65('0x4c')]=qs[_0xab65('0x3b')](_0x2c16af[_0xab65('0x32')][_0xab65('0x3b')]);_0x3426e8[_0xab65('0x3c')]=qs[_0xab65('0x34')](_['pick'](_0x2c16af[_0xab65('0x32')],_0x38b7e1[_0xab65('0x34')]));if(_0x2c16af[_0xab65('0x32')]['filter']){_0x3426e8[_0xab65('0x3c')]=_['merge'](_0x3426e8[_0xab65('0x3c')],{'$or':_[_0xab65('0x2c')](_0x3426e8[_0xab65('0x37')],function(_0x26e248){var _0x55eab0={};_0x55eab0[_0x26e248]={'$like':'%'+_0x2c16af[_0xab65('0x32')]['filter']+'%'};return _0x55eab0;})});}_0x3426e8=_[_0xab65('0x40')]({},_0x3426e8,_0x2c16af[_0xab65('0x41')]);return _0xa46256[_0xab65('0x4f')](_0x3426e8);}})['then'](function(_0x26091b){if(_0x26091b){_0x3626b6=_0x26091b[_0xab65('0x38')];if(!_0x2c16af[_0xab65('0x32')][_0xab65('0x39')]('nolimit')){_0x3426e8[_0xab65('0x1e')]=qs[_0xab65('0x1e')](_0x2c16af[_0xab65('0x32')][_0xab65('0x1e')]);_0x3426e8[_0xab65('0x20')]=qs[_0xab65('0x20')](_0x2c16af['query']['offset']);}return _0xa46256['getDescriptions'](_0x3426e8);}})[_0xab65('0x26')](function(_0x24f43c){if(_0x24f43c){return _0x24f43c?{'count':_0x3626b6,'rows':_0x24f43c}:null;}})['then'](respondWithResult(_0x53f67b,null))['catch'](handleError(_0x53f67b,null));};exports[_0xab65('0x50')]=function(_0x2a011c,_0x1b8cda,_0x39e885){var _0x28d004={};var _0x55e758={};var _0x35fc46;var _0x3c35e6;return db['FreshsalesConfiguration'][_0xab65('0x4d')]({'where':{'id':_0x2a011c[_0xab65('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b8cda,null))['then'](function(_0x4b5671){if(_0x4b5671){_0x35fc46=_0x4b5671;_0x55e758[_0xab65('0x31')]=_[_0xab65('0x33')](db['FreshsalesField'][_0xab65('0x2e')]);_0x55e758['query']=_['keys'](_0x2a011c[_0xab65('0x32')]);_0x55e758[_0xab65('0x34')]=_['intersection'](_0x55e758[_0xab65('0x31')],_0x55e758['query']);_0x28d004['attributes']=_['intersection'](_0x55e758[_0xab65('0x31')],qs['fields'](_0x2a011c[_0xab65('0x32')][_0xab65('0x36')]));_0x28d004['attributes']=_0x28d004[_0xab65('0x37')]['length']?_0x28d004['attributes']:_0x55e758[_0xab65('0x31')];_0x28d004[_0xab65('0x4c')]=qs[_0xab65('0x3b')](_0x2a011c[_0xab65('0x32')]['sort']);_0x28d004['where']=qs[_0xab65('0x34')](_[_0xab65('0x3d')](_0x2a011c['query'],_0x55e758['filters']));if(_0x2a011c[_0xab65('0x32')][_0xab65('0x3f')]){_0x28d004[_0xab65('0x3c')]=_[_0xab65('0x40')](_0x28d004[_0xab65('0x3c')],{'$or':_[_0xab65('0x2c')](_0x28d004[_0xab65('0x37')],function(_0x18bbc8){var _0x3779ba={};_0x3779ba[_0x18bbc8]={'$like':'%'+_0x2a011c[_0xab65('0x32')][_0xab65('0x3f')]+'%'};return _0x3779ba;})});}_0x28d004=_['merge']({},_0x28d004,_0x2a011c['options']);return _0x35fc46[_0xab65('0x50')](_0x28d004);}})[_0xab65('0x26')](function(_0x154cde){if(_0x154cde){_0x3c35e6=_0x154cde['length'];if(!_0x2a011c[_0xab65('0x32')][_0xab65('0x39')]('nolimit')){_0x28d004[_0xab65('0x1e')]=qs[_0xab65('0x1e')](_0x2a011c[_0xab65('0x32')][_0xab65('0x1e')]);_0x28d004['offset']=qs[_0xab65('0x20')](_0x2a011c[_0xab65('0x32')][_0xab65('0x20')]);}return _0x35fc46[_0xab65('0x50')](_0x28d004);}})[_0xab65('0x26')](function(_0x2d65e5){if(_0x2d65e5){return _0x2d65e5?{'count':_0x3c35e6,'rows':_0x2d65e5}:null;}})[_0xab65('0x26')](respondWithResult(_0x1b8cda,null))[_0xab65('0x45')](handleError(_0x1b8cda,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index ed7f970..d64890c 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 _0xf27d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0xd92a00,_0x3cadb5){var _0x22aff5=function(_0x56d6df){while(--_0x56d6df){_0xd92a00['push'](_0xd92a00['shift']());}};_0x22aff5(++_0x3cadb5);}(_0xf27d,0x143));var _0xdf27=function(_0x8eb21b,_0x2b3ddb){_0x8eb21b=_0x8eb21b-0x0;var _0x4abf47=_0xf27d[_0x8eb21b];return _0x4abf47;};'use strict';var _=require(_0xdf27('0x0'));var util=require(_0xdf27('0x1'));var logger=require(_0xdf27('0x2'))(_0xdf27('0x3'));var moment=require(_0xdf27('0x4'));var BPromise=require(_0xdf27('0x5'));var rp=require(_0xdf27('0x6'));var fs=require('fs');var path=require(_0xdf27('0x7'));var rimraf=require(_0xdf27('0x8'));var config=require(_0xdf27('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x401022,_0xab447c){return _0x401022[_0xdf27('0xa')](_0xdf27('0xb'),attributes,{'tableName':_0xdf27('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b71=['api','moment','bluebird','path','rimraf','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4b71,0x127));var _0x14b7=function(_0x556094,_0x3e4d74){_0x556094=_0x556094-0x0;var _0x510e9b=_0x4b71[_0x556094];return _0x510e9b;};'use strict';var _=require(_0x14b7('0x0'));var util=require(_0x14b7('0x1'));var logger=require('../../config/logger')(_0x14b7('0x2'));var moment=require(_0x14b7('0x3'));var BPromise=require(_0x14b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14b7('0x5'));var rimraf=require(_0x14b7('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x14b7('0x7')]=function(_0x42cbb6,_0x177a82){return _0x42cbb6[_0x14b7('0x8')](_0x14b7('0x9'),attributes,{'tableName':_0x14b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index a29c577..74ea30f 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 _0x7658=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x3f25a8,_0x3c7a82){var _0x5dcc4d=function(_0x198454){while(--_0x198454){_0x3f25a8['push'](_0x3f25a8['shift']());}};_0x5dcc4d(++_0x3c7a82);}(_0x7658,0x1f0));var _0x8765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7658[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8765('0x0'));var util=require(_0x8765('0x1'));var moment=require(_0x8765('0x2'));var BPromise=require('bluebird');var rs=require(_0x8765('0x3'));var fs=require('fs');var Redis=require(_0x8765('0x4'));var db=require(_0x8765('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8765('0x6'))(_0x8765('0x7'));var config=require(_0x8765('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8765('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13bac7,_0x5e668e,_0x4fda1a){return new BPromise(function(_0x278c39,_0x5f3667){return client[_0x8765('0xa')](_0x13bac7,_0x4fda1a)['then'](function(_0x26b245){logger[_0x8765('0xb')](_0x8765('0xc'),_0x5e668e,'request\x20sent');logger[_0x8765('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5e668e,_0x8765('0xe'),JSON[_0x8765('0xf')](_0x26b245));if(_0x26b245[_0x8765('0x10')]){if(_0x26b245[_0x8765('0x10')]['code']===0x1f4){logger[_0x8765('0x10')](_0x8765('0xc'),_0x5e668e,_0x26b245[_0x8765('0x10')][_0x8765('0x11')]);return _0x5f3667(_0x26b245[_0x8765('0x10')]['message']);}logger[_0x8765('0x10')](_0x8765('0xc'),_0x5e668e,_0x26b245['error'][_0x8765('0x11')]);return _0x278c39(_0x26b245[_0x8765('0x10')][_0x8765('0x11')]);}else{logger[_0x8765('0xb')](_0x8765('0xc'),_0x5e668e,'request\x20sent');_0x278c39(_0x26b245[_0x8765('0x12')][_0x8765('0x11')]);}})[_0x8765('0x13')](function(_0xf212cc){logger['error'](_0x8765('0xc'),_0x5e668e,_0xf212cc);_0x5f3667(_0xf212cc);});});} \ No newline at end of file +var _0x67d3=['request\x20sent','debug','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x67d3,0x1b6));var _0x367d=function(_0x2dac86,_0x255e1d){_0x2dac86=_0x2dac86-0x0;var _0x262df0=_0x67d3[_0x2dac86];return _0x262df0;};'use strict';var _=require('lodash');var util=require(_0x367d('0x0'));var moment=require(_0x367d('0x1'));var BPromise=require(_0x367d('0x2'));var rs=require(_0x367d('0x3'));var fs=require('fs');var Redis=require(_0x367d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x367d('0x5'))(_0x367d('0x6'));var config=require(_0x367d('0x7'));var jayson=require(_0x367d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x191aa6,_0x1bca3d,_0x8c79a8){return new BPromise(function(_0x158403,_0x3de108){return client[_0x367d('0x9')](_0x191aa6,_0x8c79a8)[_0x367d('0xa')](function(_0x37befc){logger['info'](_0x367d('0xb'),_0x1bca3d,_0x367d('0xc'));logger[_0x367d('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1bca3d,_0x367d('0xc'),JSON['stringify'](_0x37befc));if(_0x37befc['error']){if(_0x37befc[_0x367d('0xe')]['code']===0x1f4){logger['error'](_0x367d('0xb'),_0x1bca3d,_0x37befc['error'][_0x367d('0xf')]);return _0x3de108(_0x37befc['error'][_0x367d('0xf')]);}logger[_0x367d('0xe')](_0x367d('0xb'),_0x1bca3d,_0x37befc[_0x367d('0xe')]['message']);return _0x158403(_0x37befc[_0x367d('0xe')][_0x367d('0xf')]);}else{logger[_0x367d('0x10')](_0x367d('0xb'),_0x1bca3d,_0x367d('0xc'));_0x158403(_0x37befc[_0x367d('0x11')][_0x367d('0xf')]);}})['catch'](function(_0x963310){logger[_0x367d('0xe')](_0x367d('0xb'),_0x1bca3d,_0x963310);_0x3de108(_0x963310);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 93a1ff2..1af4690 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 _0x534d=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x5bb8ab,_0x325ccc){var _0x17dd81=function(_0x2f4824){while(--_0x2f4824){_0x5bb8ab['push'](_0x5bb8ab['shift']());}};_0x17dd81(++_0x325ccc);}(_0x534d,0x79));var _0xd534=function(_0x4bee39,_0x5b40d2){_0x4bee39=_0x4bee39-0x0;var _0x2e9965=_0x534d[_0x4bee39];return _0x2e9965;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require(_0xd534('0x4'));var router=express[_0xd534('0x5')]();var fs_extra=require(_0xd534('0x6'));var auth=require(_0xd534('0x7'));var interaction=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var controller=require(_0xd534('0xa'));router[_0xd534('0xb')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0xd')]);router[_0xd534('0xb')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0xf')]);router[_0xd534('0x10')]('/',auth['isAuthenticated'](),controller[_0xd534('0x11')]);router[_0xd534('0x12')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x13')]);router['delete'](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x14')]);module[_0xd534('0x15')]=router; \ No newline at end of file +var _0xbb95=['Router','../../components/auth/service','get','isAuthenticated','/:id','post','create','put','update','delete','multer','util','express'];(function(_0x4d8951,_0x58aaec){var _0x1cc6f3=function(_0x234b8f){while(--_0x234b8f){_0x4d8951['push'](_0x4d8951['shift']());}};_0x1cc6f3(++_0x58aaec);}(_0xbb95,0x7f));var _0x5bb9=function(_0x3445b0,_0x362241){_0x3445b0=_0x3445b0-0x0;var _0x2251c0=_0xbb95[_0x3445b0];return _0x2251c0;};'use strict';var multer=require(_0x5bb9('0x0'));var util=require(_0x5bb9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5bb9('0x2'));var router=express[_0x5bb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5bb9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x5bb9('0x5')]('/',auth[_0x5bb9('0x6')](),controller['index']);router[_0x5bb9('0x5')](_0x5bb9('0x7'),auth[_0x5bb9('0x6')](),controller['show']);router[_0x5bb9('0x8')]('/',auth[_0x5bb9('0x6')](),controller[_0x5bb9('0x9')]);router[_0x5bb9('0xa')](_0x5bb9('0x7'),auth[_0x5bb9('0x6')](),controller[_0x5bb9('0xb')]);router[_0x5bb9('0xc')](_0x5bb9('0x7'),auth[_0x5bb9('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a89ba92..b838780 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 _0x5936=['string','keyValue','picklist','STRING','variable','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x55bd38,_0x48eacf){var _0x444323=function(_0x22c59c){while(--_0x22c59c){_0x55bd38['push'](_0x55bd38['shift']());}};_0x444323(++_0x48eacf);}(_0x5936,0xf1));var _0x6593=function(_0x1ffdeb,_0x3555ba){_0x1ffdeb=_0x1ffdeb-0x0;var _0x1a97f7=_0x5936[_0x1ffdeb];return _0x1a97f7;};'use strict';var Sequelize=require(_0x6593('0x0'));module['exports']={'type':{'type':Sequelize[_0x6593('0x1')](_0x6593('0x2'),'variable','customVariable',_0x6593('0x3'),_0x6593('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6593('0x5')]},'key':{'type':Sequelize[_0x6593('0x5')]},'keyType':{'type':Sequelize[_0x6593('0x1')](_0x6593('0x2'),_0x6593('0x6'),_0x6593('0x7'))},'keyContent':{'type':Sequelize[_0x6593('0x5')]},'idField':{'type':Sequelize[_0x6593('0x5')]},'nameField':{'type':Sequelize[_0x6593('0x5')]},'customField':{'type':Sequelize[_0x6593('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6593('0x5')]}}; \ No newline at end of file +var _0x1dca=['variable','customVariable','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x5b674c,_0xc560b){var _0x3da567=function(_0x495f29){while(--_0x495f29){_0x5b674c['push'](_0x5b674c['shift']());}};_0x3da567(++_0xc560b);}(_0x1dca,0x194));var _0xa1dc=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x1dca[_0x112db5];return _0x1d7d06;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa1dc('0x0')](_0xa1dc('0x1'),_0xa1dc('0x2'),_0xa1dc('0x3'),'keyValue',_0xa1dc('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa1dc('0x5')]},'keyType':{'type':Sequelize[_0xa1dc('0x0')](_0xa1dc('0x1'),_0xa1dc('0x2'),_0xa1dc('0x3'))},'keyContent':{'type':Sequelize[_0xa1dc('0x5')]},'idField':{'type':Sequelize[_0xa1dc('0x5')]},'nameField':{'type':Sequelize[_0xa1dc('0x5')]},'customField':{'type':Sequelize[_0xa1dc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 29c33be..3bd83e6 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 _0x346f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x3f0a07,_0x11b5bc){var _0x5f37ed=function(_0x3ff0fd){while(--_0x3ff0fd){_0x3f0a07['push'](_0x3f0a07['shift']());}};_0x5f37ed(++_0x11b5bc);}(_0x346f,0x196));var _0xf346=function(_0x374aed,_0x45ccf3){_0x374aed=_0x374aed-0x0;var _0x181071=_0x346f[_0x374aed];return _0x181071;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf346('0x0'));var zipdir=require(_0xf346('0x1'));var jsonpatch=require(_0xf346('0x2'));var rp=require(_0xf346('0x3'));var moment=require(_0xf346('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf346('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf346('0x6'));var csv=require(_0xf346('0x7'));var ejs=require(_0xf346('0x8'));var fs=require('fs');var fs_extra=require(_0xf346('0x9'));var _=require('lodash');var squel=require(_0xf346('0xa'));var crypto=require('crypto');var jsforce=require(_0xf346('0xb'));var deskjs=require(_0xf346('0xc'));var toCsv=require(_0xf346('0x7'));var querystring=require(_0xf346('0xd'));var Papa=require(_0xf346('0xe'));var Redis=require(_0xf346('0xf'));var authService=require(_0xf346('0x10'));var qs=require(_0xf346('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf346('0x12'));var logger=require(_0xf346('0x13'))(_0xf346('0x14'));var utils=require('../../config/utils');var config=require(_0xf346('0x15'));var licenseUtil=require(_0xf346('0x16'));var db=require(_0xf346('0x17'))['db'];function respondWithStatusCode(_0x44ec0b,_0x39f869){_0x39f869=_0x39f869||0xcc;return function(_0x4a9d7d){if(_0x4a9d7d){return _0x44ec0b[_0xf346('0x18')](_0x39f869);}return _0x44ec0b[_0xf346('0x19')](_0x39f869)[_0xf346('0x1a')]();};}function respondWithResult(_0x1c4126,_0x5025d7){_0x5025d7=_0x5025d7||0xc8;return function(_0x5957ed){if(_0x5957ed){return _0x1c4126[_0xf346('0x19')](_0x5025d7)[_0xf346('0x1b')](_0x5957ed);}};}function respondWithFilteredResult(_0x50b2dd,_0x2e5ffc){return function(_0x430ced){if(_0x430ced){var _0x75a038=typeof _0x2e5ffc[_0xf346('0x1c')]==='undefined'&&typeof _0x2e5ffc[_0xf346('0x1d')]==='undefined';var _0x5390dd=_0x430ced[_0xf346('0x1e')];var _0xe67ab9=_0x75a038?0x0:_0x2e5ffc[_0xf346('0x1c')];var _0x4d5894=_0x75a038?_0x430ced[_0xf346('0x1e')]:_0x2e5ffc[_0xf346('0x1c')]+_0x2e5ffc[_0xf346('0x1d')];var _0x1935f1;if(_0x4d5894>=_0x5390dd){_0x4d5894=_0x5390dd;_0x1935f1=0xc8;}else{_0x1935f1=0xce;}_0x50b2dd['status'](_0x1935f1);return _0x50b2dd['set'](_0xf346('0x1f'),_0xe67ab9+'-'+_0x4d5894+'/'+_0x5390dd)[_0xf346('0x1b')](_0x430ced);}return null;};}function patchUpdates(_0x3fe238){return function(_0x2d9386){try{jsonpatch['apply'](_0x2d9386,_0x3fe238,!![]);}catch(_0x597231){return BPromise['reject'](_0x597231);}return _0x2d9386[_0xf346('0x20')]();};}function saveUpdates(_0x478847,_0x219d95){return function(_0x2cbd81){if(_0x2cbd81){return _0x2cbd81[_0xf346('0x21')](_0x478847)[_0xf346('0x22')](function(_0x1d20ac){return _0x1d20ac;});}return null;};}function removeEntity(_0x1a1203,_0x1ba4b5){return function(_0x20e661){if(_0x20e661){return _0x20e661[_0xf346('0x23')]()[_0xf346('0x22')](function(){_0x1a1203[_0xf346('0x19')](0xcc)[_0xf346('0x1a')]();});}};}function handleEntityNotFound(_0x587095,_0x1b9096){return function(_0xbd84b2){if(!_0xbd84b2){_0x587095[_0xf346('0x18')](0x194);}return _0xbd84b2;};}function handleError(_0x1d7229,_0x247b07){_0x247b07=_0x247b07||0x1f4;return function(_0x42fdfa){logger[_0xf346('0x24')](_0x42fdfa['stack']);if(_0x42fdfa[_0xf346('0x25')]){delete _0x42fdfa[_0xf346('0x25')];}_0x1d7229[_0xf346('0x19')](_0x247b07)[_0xf346('0x26')](_0x42fdfa);};}exports['index']=function(_0x24a71f,_0x3d3428){var _0x1d0384={},_0x4aedbe={},_0x5a4ca9={'count':0x0,'rows':[]};var _0x463a99=_[_0xf346('0x27')](db[_0xf346('0x28')][_0xf346('0x29')],function(_0x352a6b){return{'name':_0x352a6b['fieldName'],'type':_0x352a6b[_0xf346('0x2a')][_0xf346('0x2b')]};});_0x4aedbe[_0xf346('0x2c')]=_['map'](_0x463a99,_0xf346('0x25'));_0x4aedbe[_0xf346('0x2d')]=_['keys'](_0x24a71f[_0xf346('0x2d')]);_0x4aedbe[_0xf346('0x2e')]=_[_0xf346('0x2f')](_0x4aedbe[_0xf346('0x2c')],_0x4aedbe['query']);_0x1d0384[_0xf346('0x30')]=_[_0xf346('0x2f')](_0x4aedbe[_0xf346('0x2c')],qs['fields'](_0x24a71f[_0xf346('0x2d')][_0xf346('0x31')]));_0x1d0384[_0xf346('0x30')]=_0x1d0384[_0xf346('0x30')][_0xf346('0x32')]?_0x1d0384[_0xf346('0x30')]:_0x4aedbe[_0xf346('0x2c')];if(!_0x24a71f[_0xf346('0x2d')][_0xf346('0x33')]('nolimit')){_0x1d0384[_0xf346('0x1d')]=qs['limit'](_0x24a71f['query'][_0xf346('0x1d')]);_0x1d0384[_0xf346('0x1c')]=qs[_0xf346('0x1c')](_0x24a71f[_0xf346('0x2d')][_0xf346('0x1c')]);}_0x1d0384[_0xf346('0x34')]=qs[_0xf346('0x35')](_0x24a71f[_0xf346('0x2d')]['sort']);_0x1d0384[_0xf346('0x36')]=qs[_0xf346('0x2e')](_[_0xf346('0x37')](_0x24a71f[_0xf346('0x2d')],_0x4aedbe[_0xf346('0x2e')]),_0x463a99);if(_0x24a71f['query'][_0xf346('0x38')]){_0x1d0384[_0xf346('0x36')]=_[_0xf346('0x39')](_0x1d0384['where'],{'$or':_[_0xf346('0x27')](_0x463a99,function(_0x7398a8){if(_0x7398a8[_0xf346('0x2a')]!==_0xf346('0x3a')){var _0x5376fd={};_0x5376fd[_0x7398a8[_0xf346('0x25')]]={'$like':'%'+_0x24a71f['query'][_0xf346('0x38')]+'%'};return _0x5376fd;}})});}_0x1d0384=_[_0xf346('0x39')]({},_0x1d0384,_0x24a71f[_0xf346('0x3b')]);var _0x403805={'where':_0x1d0384[_0xf346('0x36')]};return db[_0xf346('0x28')][_0xf346('0x1e')](_0x403805)[_0xf346('0x22')](function(_0x56fa14){_0x5a4ca9['count']=_0x56fa14;if(_0x24a71f[_0xf346('0x2d')][_0xf346('0x3c')]){_0x1d0384[_0xf346('0x3d')]=[{'all':!![]}];}return db[_0xf346('0x28')][_0xf346('0x3e')](_0x1d0384);})['then'](function(_0x21e6a3){_0x5a4ca9['rows']=_0x21e6a3;return _0x5a4ca9;})[_0xf346('0x22')](respondWithFilteredResult(_0x3d3428,_0x1d0384))['catch'](handleError(_0x3d3428,null));};exports[_0xf346('0x3f')]=function(_0x7d1601,_0x2dee96){var _0x17065f={'raw':!![],'where':{'id':_0x7d1601[_0xf346('0x40')]['id']}},_0x48c94d={};_0x48c94d[_0xf346('0x2c')]=_[_0xf346('0x41')](db[_0xf346('0x28')][_0xf346('0x29')]);_0x48c94d[_0xf346('0x2d')]=_[_0xf346('0x41')](_0x7d1601[_0xf346('0x2d')]);_0x48c94d[_0xf346('0x2e')]=_[_0xf346('0x2f')](_0x48c94d[_0xf346('0x2c')],_0x48c94d[_0xf346('0x2d')]);_0x17065f[_0xf346('0x30')]=_[_0xf346('0x2f')](_0x48c94d[_0xf346('0x2c')],qs[_0xf346('0x31')](_0x7d1601[_0xf346('0x2d')][_0xf346('0x31')]));_0x17065f[_0xf346('0x30')]=_0x17065f[_0xf346('0x30')][_0xf346('0x32')]?_0x17065f[_0xf346('0x30')]:_0x48c94d[_0xf346('0x2c')];if(_0x7d1601[_0xf346('0x2d')][_0xf346('0x3c')]){_0x17065f[_0xf346('0x3d')]=[{'all':!![]}];}_0x17065f=_[_0xf346('0x39')]({},_0x17065f,_0x7d1601[_0xf346('0x3b')]);return db['FreshsalesField'][_0xf346('0x42')](_0x17065f)[_0xf346('0x22')](handleEntityNotFound(_0x2dee96,null))[_0xf346('0x22')](respondWithResult(_0x2dee96,null))[_0xf346('0x43')](handleError(_0x2dee96,null));};exports[_0xf346('0x44')]=function(_0x371079,_0x4598e5){return db[_0xf346('0x28')][_0xf346('0x44')](_0x371079[_0xf346('0x45')],{})[_0xf346('0x22')](respondWithResult(_0x4598e5,0xc9))[_0xf346('0x43')](handleError(_0x4598e5,null));};exports['update']=function(_0x3e338b,_0x2abdb0){if(_0x3e338b[_0xf346('0x45')]['id']){delete _0x3e338b[_0xf346('0x45')]['id'];}return db[_0xf346('0x28')][_0xf346('0x42')]({'where':{'id':_0x3e338b[_0xf346('0x40')]['id']}})[_0xf346('0x22')](handleEntityNotFound(_0x2abdb0,null))[_0xf346('0x22')](saveUpdates(_0x3e338b[_0xf346('0x45')],null))[_0xf346('0x22')](respondWithResult(_0x2abdb0,null))[_0xf346('0x43')](handleError(_0x2abdb0,null));};exports['destroy']=function(_0x275264,_0x55a3cb){return db[_0xf346('0x28')][_0xf346('0x42')]({'where':{'id':_0x275264[_0xf346('0x40')]['id']}})['then'](handleEntityNotFound(_0x55a3cb,null))[_0xf346('0x22')](removeEntity(_0x55a3cb,null))[_0xf346('0x43')](handleError(_0x55a3cb,null));}; \ No newline at end of file +var _0xa8c1=['destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','zip-dir','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x4604ed,_0x5a7eaa){var _0x141903=function(_0xeaa392){while(--_0xeaa392){_0x4604ed['push'](_0x4604ed['shift']());}};_0x141903(++_0x5a7eaa);}(_0xa8c1,0x127));var _0x1a8c=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xa8c1[_0x3e7e96];return _0x13f6f0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a8c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a8c('0x2'));var util=require(_0x1a8c('0x3'));var path=require(_0x1a8c('0x4'));var sox=require('sox');var csv=require(_0x1a8c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a8c('0x6'));var squel=require('squel');var crypto=require(_0x1a8c('0x7'));var jsforce=require(_0x1a8c('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x1a8c('0x5'));var querystring=require('querystring');var Papa=require(_0x1a8c('0x9'));var Redis=require(_0x1a8c('0xa'));var authService=require(_0x1a8c('0xb'));var qs=require(_0x1a8c('0xc'));var as=require(_0x1a8c('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a8c('0xe'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2f65,_0x2d1b44){_0x2d1b44=_0x2d1b44||0xcc;return function(_0x43f382){if(_0x43f382){return _0x3d2f65[_0x1a8c('0xf')](_0x2d1b44);}return _0x3d2f65['status'](_0x2d1b44)[_0x1a8c('0x10')]();};}function respondWithResult(_0x4a3963,_0x8b79d8){_0x8b79d8=_0x8b79d8||0xc8;return function(_0x343b28){if(_0x343b28){return _0x4a3963[_0x1a8c('0x11')](_0x8b79d8)['json'](_0x343b28);}};}function respondWithFilteredResult(_0x2ac24d,_0x89ab79){return function(_0x556631){if(_0x556631){var _0x144268=typeof _0x89ab79[_0x1a8c('0x12')]===_0x1a8c('0x13')&&typeof _0x89ab79['limit']===_0x1a8c('0x13');var _0x5a6018=_0x556631[_0x1a8c('0x14')];var _0x1a0951=_0x144268?0x0:_0x89ab79[_0x1a8c('0x12')];var _0x59a4e5=_0x144268?_0x556631['count']:_0x89ab79['offset']+_0x89ab79[_0x1a8c('0x15')];var _0x2fa014;if(_0x59a4e5>=_0x5a6018){_0x59a4e5=_0x5a6018;_0x2fa014=0xc8;}else{_0x2fa014=0xce;}_0x2ac24d[_0x1a8c('0x11')](_0x2fa014);return _0x2ac24d[_0x1a8c('0x16')](_0x1a8c('0x17'),_0x1a0951+'-'+_0x59a4e5+'/'+_0x5a6018)[_0x1a8c('0x18')](_0x556631);}return null;};}function patchUpdates(_0x36ece1){return function(_0xb44e31){try{jsonpatch[_0x1a8c('0x19')](_0xb44e31,_0x36ece1,!![]);}catch(_0x1da3f4){return BPromise[_0x1a8c('0x1a')](_0x1da3f4);}return _0xb44e31[_0x1a8c('0x1b')]();};}function saveUpdates(_0x5b3c2f,_0x3318e4){return function(_0x5c46bc){if(_0x5c46bc){return _0x5c46bc[_0x1a8c('0x1c')](_0x5b3c2f)[_0x1a8c('0x1d')](function(_0x506d15){return _0x506d15;});}return null;};}function removeEntity(_0x3c636d,_0x1f6657){return function(_0x401bd7){if(_0x401bd7){return _0x401bd7[_0x1a8c('0x1e')]()[_0x1a8c('0x1d')](function(){_0x3c636d['status'](0xcc)[_0x1a8c('0x10')]();});}};}function handleEntityNotFound(_0x5e2fd5,_0x59c88f){return function(_0xdf5aed){if(!_0xdf5aed){_0x5e2fd5['sendStatus'](0x194);}return _0xdf5aed;};}function handleError(_0x39b243,_0x49ca73){_0x49ca73=_0x49ca73||0x1f4;return function(_0x4da7d0){logger[_0x1a8c('0x1f')](_0x4da7d0[_0x1a8c('0x20')]);if(_0x4da7d0['name']){delete _0x4da7d0[_0x1a8c('0x21')];}_0x39b243[_0x1a8c('0x11')](_0x49ca73)[_0x1a8c('0x22')](_0x4da7d0);};}exports[_0x1a8c('0x23')]=function(_0x568af0,_0x20bf2b){var _0xcf8812={},_0xffb86e={},_0x102338={'count':0x0,'rows':[]};var _0x47570f=_[_0x1a8c('0x24')](db[_0x1a8c('0x25')][_0x1a8c('0x26')],function(_0x2660bc){return{'name':_0x2660bc[_0x1a8c('0x27')],'type':_0x2660bc[_0x1a8c('0x28')][_0x1a8c('0x29')]};});_0xffb86e['model']=_[_0x1a8c('0x24')](_0x47570f,_0x1a8c('0x21'));_0xffb86e[_0x1a8c('0x2a')]=_[_0x1a8c('0x2b')](_0x568af0[_0x1a8c('0x2a')]);_0xffb86e[_0x1a8c('0x2c')]=_[_0x1a8c('0x2d')](_0xffb86e[_0x1a8c('0x2e')],_0xffb86e['query']);_0xcf8812[_0x1a8c('0x2f')]=_[_0x1a8c('0x2d')](_0xffb86e[_0x1a8c('0x2e')],qs[_0x1a8c('0x30')](_0x568af0[_0x1a8c('0x2a')][_0x1a8c('0x30')]));_0xcf8812[_0x1a8c('0x2f')]=_0xcf8812[_0x1a8c('0x2f')]['length']?_0xcf8812[_0x1a8c('0x2f')]:_0xffb86e[_0x1a8c('0x2e')];if(!_0x568af0[_0x1a8c('0x2a')]['hasOwnProperty'](_0x1a8c('0x31'))){_0xcf8812['limit']=qs[_0x1a8c('0x15')](_0x568af0[_0x1a8c('0x2a')][_0x1a8c('0x15')]);_0xcf8812[_0x1a8c('0x12')]=qs[_0x1a8c('0x12')](_0x568af0[_0x1a8c('0x2a')][_0x1a8c('0x12')]);}_0xcf8812['order']=qs[_0x1a8c('0x32')](_0x568af0['query'][_0x1a8c('0x32')]);_0xcf8812[_0x1a8c('0x33')]=qs[_0x1a8c('0x2c')](_['pick'](_0x568af0[_0x1a8c('0x2a')],_0xffb86e['filters']),_0x47570f);if(_0x568af0['query']['filter']){_0xcf8812[_0x1a8c('0x33')]=_['merge'](_0xcf8812[_0x1a8c('0x33')],{'$or':_[_0x1a8c('0x24')](_0x47570f,function(_0x3639f7){if(_0x3639f7[_0x1a8c('0x28')]!==_0x1a8c('0x34')){var _0x1beb35={};_0x1beb35[_0x3639f7[_0x1a8c('0x21')]]={'$like':'%'+_0x568af0['query']['filter']+'%'};return _0x1beb35;}})});}_0xcf8812=_[_0x1a8c('0x35')]({},_0xcf8812,_0x568af0[_0x1a8c('0x36')]);var _0x57b4a0={'where':_0xcf8812[_0x1a8c('0x33')]};return db['FreshsalesField'][_0x1a8c('0x14')](_0x57b4a0)[_0x1a8c('0x1d')](function(_0x1e19aa){_0x102338[_0x1a8c('0x14')]=_0x1e19aa;if(_0x568af0[_0x1a8c('0x2a')]['includeAll']){_0xcf8812[_0x1a8c('0x37')]=[{'all':!![]}];}return db['FreshsalesField'][_0x1a8c('0x38')](_0xcf8812);})[_0x1a8c('0x1d')](function(_0xca8ea6){_0x102338[_0x1a8c('0x39')]=_0xca8ea6;return _0x102338;})[_0x1a8c('0x1d')](respondWithFilteredResult(_0x20bf2b,_0xcf8812))[_0x1a8c('0x3a')](handleError(_0x20bf2b,null));};exports[_0x1a8c('0x3b')]=function(_0x54c5b6,_0x339ea6){var _0x46db1f={'raw':!![],'where':{'id':_0x54c5b6[_0x1a8c('0x3c')]['id']}},_0xe44a0d={};_0xe44a0d[_0x1a8c('0x2e')]=_[_0x1a8c('0x2b')](db[_0x1a8c('0x25')][_0x1a8c('0x26')]);_0xe44a0d[_0x1a8c('0x2a')]=_[_0x1a8c('0x2b')](_0x54c5b6[_0x1a8c('0x2a')]);_0xe44a0d['filters']=_[_0x1a8c('0x2d')](_0xe44a0d[_0x1a8c('0x2e')],_0xe44a0d[_0x1a8c('0x2a')]);_0x46db1f[_0x1a8c('0x2f')]=_[_0x1a8c('0x2d')](_0xe44a0d[_0x1a8c('0x2e')],qs[_0x1a8c('0x30')](_0x54c5b6[_0x1a8c('0x2a')][_0x1a8c('0x30')]));_0x46db1f[_0x1a8c('0x2f')]=_0x46db1f[_0x1a8c('0x2f')]['length']?_0x46db1f['attributes']:_0xe44a0d[_0x1a8c('0x2e')];if(_0x54c5b6[_0x1a8c('0x2a')][_0x1a8c('0x3d')]){_0x46db1f[_0x1a8c('0x37')]=[{'all':!![]}];}_0x46db1f=_[_0x1a8c('0x35')]({},_0x46db1f,_0x54c5b6[_0x1a8c('0x36')]);return db['FreshsalesField'][_0x1a8c('0x3e')](_0x46db1f)[_0x1a8c('0x1d')](handleEntityNotFound(_0x339ea6,null))[_0x1a8c('0x1d')](respondWithResult(_0x339ea6,null))[_0x1a8c('0x3a')](handleError(_0x339ea6,null));};exports[_0x1a8c('0x3f')]=function(_0x257e54,_0x384ce6){return db[_0x1a8c('0x25')][_0x1a8c('0x3f')](_0x257e54[_0x1a8c('0x40')],{})[_0x1a8c('0x1d')](respondWithResult(_0x384ce6,0xc9))[_0x1a8c('0x3a')](handleError(_0x384ce6,null));};exports['update']=function(_0x3f6218,_0x16b36c){if(_0x3f6218[_0x1a8c('0x40')]['id']){delete _0x3f6218[_0x1a8c('0x40')]['id'];}return db[_0x1a8c('0x25')][_0x1a8c('0x3e')]({'where':{'id':_0x3f6218['params']['id']}})[_0x1a8c('0x1d')](handleEntityNotFound(_0x16b36c,null))[_0x1a8c('0x1d')](saveUpdates(_0x3f6218[_0x1a8c('0x40')],null))['then'](respondWithResult(_0x16b36c,null))[_0x1a8c('0x3a')](handleError(_0x16b36c,null));};exports[_0x1a8c('0x1e')]=function(_0x36e45c,_0x51fe74){return db[_0x1a8c('0x25')]['find']({'where':{'id':_0x36e45c[_0x1a8c('0x3c')]['id']}})[_0x1a8c('0x1d')](handleEntityNotFound(_0x51fe74,null))[_0x1a8c('0x1d')](removeEntity(_0x51fe74,null))[_0x1a8c('0x3a')](handleError(_0x51fe74,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e2166c7..3d01402 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 _0x757a=['FieldId','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x5c7dfd,_0x568cdf){var _0x1d4120=function(_0x29ea7b){while(--_0x29ea7b){_0x5c7dfd['push'](_0x5c7dfd['shift']());}};_0x1d4120(++_0x568cdf);}(_0x757a,0xde));var _0xa757=function(_0x76c317,_0x35dc15){_0x76c317=_0x76c317-0x0;var _0x8e1a12=_0x757a[_0x76c317];return _0x8e1a12;};'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')]('FreshsalesField',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb'),_0xa757('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','util','../../config/logger'];(function(_0x3e058a,_0x4c3b78){var _0x46f99d=function(_0x1db182){while(--_0x1db182){_0x3e058a['push'](_0x3e058a['shift']());}};_0x46f99d(++_0x4c3b78);}(_0x57ca,0x108));var _0xa57c=function(_0x554794,_0x5d44bc){_0x554794=_0x554794-0x0;var _0x266070=_0x57ca[_0x554794];return _0x266070;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'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 7dec29e..e98d83b 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x48b394,_0x115f29){var _0x467c81=function(_0x10ae29){while(--_0x10ae29){_0x48b394['push'](_0x48b394['shift']());}};_0x467c81(++_0x115f29);}(_0x187d,0x93));var _0xd187=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x187d[_0x37bd26];return _0xe83dc4;};'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')]('FreshsalesField,\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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x1917ce,_0x456d7c){var _0x56f927=function(_0x4ee840){while(--_0x4ee840){_0x1917ce['push'](_0x1917ce['shift']());}};_0x56f927(++_0x456d7c);}(_0xeff8,0x186));var _0x8eff=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xeff8[_0x4bb581];return _0x316bf5;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 74bacda..16cf63e 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1e607b,_0x3e21f2){var _0x44c68f=function(_0x550cd2){while(--_0x550cd2){_0x1e607b['push'](_0x1e607b['shift']());}};_0x44c68f(++_0x3e21f2);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x2788ac,_0x22bc4f){var _0x508507=function(_0x4a2d6c){while(--_0x4a2d6c){_0x2788ac['push'](_0x2788ac['shift']());}};_0x508507(++_0x22bc4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 adfca9e..f323491 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 _0x4628=['newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x4628,0xd3));var _0x8462=function(_0xfbf7e6,_0x56e560){_0xfbf7e6=_0xfbf7e6-0x0;var _0x4da03d=_0x4628[_0xfbf7e6];return _0x4da03d;};'use strict';var Sequelize=require(_0x8462('0x0'));module[_0x8462('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8462('0x2')]},'username':{'type':Sequelize[_0x8462('0x2')],'unique':_0x8462('0x3')},'remoteUri':{'type':Sequelize[_0x8462('0x2')]},'password':{'type':Sequelize[_0x8462('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8462('0x2')]},'securityToken':{'type':Sequelize[_0x8462('0x2')]},'serverUrl':{'type':Sequelize[_0x8462('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8462('0x4')]('integrationTab',_0x8462('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x3457=['STRING','username','integrationTab'];(function(_0x47c195,_0x6304ba){var _0x3f6afb=function(_0x41736e){while(--_0x41736e){_0x47c195['push'](_0x47c195['shift']());}};_0x3f6afb(++_0x6304ba);}(_0x3457,0x93));var _0x7345=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3457[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7345('0x0')],'unique':_0x7345('0x1')},'remoteUri':{'type':Sequelize[_0x7345('0x0')]},'password':{'type':Sequelize[_0x7345('0x0')]},'clientId':{'type':Sequelize[_0x7345('0x0')]},'clientSecret':{'type':Sequelize[_0x7345('0x0')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7345('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x7345('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 755b493..fa196d7 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 _0x4c94=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','show','params','rawAttributes','options','find','create','catch','body','getConfigurations','findOne','SalesforceConfiguration','length','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','substring','login','isNil','OwnerId','Description','string','int','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','name','send','index','SalesforceAccount','fieldName','type','key','model','map'];(function(_0x477cd1,_0x214e5a){var _0x3dcaa3=function(_0x47e211){while(--_0x47e211){_0x477cd1['push'](_0x477cd1['shift']());}};_0x3dcaa3(++_0x214e5a);}(_0x4c94,0xb6));var _0x44c9=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x4c94[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44c9('0x0'));var zipdir=require(_0x44c9('0x1'));var jsonpatch=require(_0x44c9('0x2'));var rp=require(_0x44c9('0x3'));var moment=require(_0x44c9('0x4'));var BPromise=require(_0x44c9('0x5'));var Mustache=require('mustache');var util=require(_0x44c9('0x6'));var path=require('path');var sox=require(_0x44c9('0x7'));var csv=require(_0x44c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44c9('0x9'));var _=require(_0x44c9('0xa'));var squel=require(_0x44c9('0xb'));var crypto=require(_0x44c9('0xc'));var jsforce=require(_0x44c9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x44c9('0x8'));var querystring=require('querystring');var Papa=require(_0x44c9('0xe'));var Redis=require(_0x44c9('0xf'));var authService=require(_0x44c9('0x10'));var qs=require(_0x44c9('0x11'));var as=require(_0x44c9('0x12'));var hardwareService=require(_0x44c9('0x13'));var logger=require(_0x44c9('0x14'))(_0x44c9('0x15'));var utils=require(_0x44c9('0x16'));var config=require(_0x44c9('0x17'));var licenseUtil=require(_0x44c9('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x44c9('0x19'));function respondWithStatusCode(_0x56e85c,_0x46d4e3){_0x46d4e3=_0x46d4e3||0xcc;return function(_0x475d53){if(_0x475d53){return _0x56e85c[_0x44c9('0x1a')](_0x46d4e3);}return _0x56e85c[_0x44c9('0x1b')](_0x46d4e3)[_0x44c9('0x1c')]();};}function respondWithResult(_0x495732,_0x3a3b57){_0x3a3b57=_0x3a3b57||0xc8;return function(_0x3c60de){if(_0x3c60de){return _0x495732['status'](_0x3a3b57)[_0x44c9('0x1d')](_0x3c60de);}};}function respondWithFilteredResult(_0x57548d,_0x414691){return function(_0x1c9f6d){if(_0x1c9f6d){var _0x52a5cd=typeof _0x414691['offset']===_0x44c9('0x1e')&&typeof _0x414691[_0x44c9('0x1f')]==='undefined';var _0x528318=_0x1c9f6d[_0x44c9('0x20')];var _0x512214=_0x52a5cd?0x0:_0x414691[_0x44c9('0x21')];var _0x4793e7=_0x52a5cd?_0x1c9f6d[_0x44c9('0x20')]:_0x414691[_0x44c9('0x21')]+_0x414691[_0x44c9('0x1f')];var _0x216992;if(_0x4793e7>=_0x528318){_0x4793e7=_0x528318;_0x216992=0xc8;}else{_0x216992=0xce;}_0x57548d[_0x44c9('0x1b')](_0x216992);return _0x57548d[_0x44c9('0x22')](_0x44c9('0x23'),_0x512214+'-'+_0x4793e7+'/'+_0x528318)[_0x44c9('0x1d')](_0x1c9f6d);}return null;};}function patchUpdates(_0x51fa11){return function(_0x2b5600){try{jsonpatch['apply'](_0x2b5600,_0x51fa11,!![]);}catch(_0x2de4fe){return BPromise[_0x44c9('0x24')](_0x2de4fe);}return _0x2b5600['save']();};}function saveUpdates(_0x1f50e2,_0x45634b){return function(_0x429ed8){if(_0x429ed8){return _0x429ed8[_0x44c9('0x25')](_0x1f50e2)[_0x44c9('0x26')](function(_0x250dc6){return _0x250dc6;});}return null;};}function removeEntity(_0x2de0f2,_0x7d5f67){return function(_0x3e634a){if(_0x3e634a){return _0x3e634a[_0x44c9('0x27')]()[_0x44c9('0x26')](function(){_0x2de0f2[_0x44c9('0x1b')](0xcc)[_0x44c9('0x1c')]();});}};}function handleEntityNotFound(_0x2855b1,_0x55934d){return function(_0x28d72f){if(!_0x28d72f){_0x2855b1[_0x44c9('0x1a')](0x194);}return _0x28d72f;};}function handleError(_0x1f63d5,_0x39fa1e){_0x39fa1e=_0x39fa1e||0x1f4;return function(_0x161850){logger[_0x44c9('0x28')](_0x161850['stack']);if(_0x161850[_0x44c9('0x29')]){delete _0x161850[_0x44c9('0x29')];}_0x1f63d5[_0x44c9('0x1b')](_0x39fa1e)[_0x44c9('0x2a')](_0x161850);};}exports[_0x44c9('0x2b')]=function(_0x452514,_0x51add2){var _0x2bb3d3={},_0x2516cb={},_0x1e923c={'count':0x0,'rows':[]};var _0x104143=_['map'](db[_0x44c9('0x2c')]['rawAttributes'],function(_0x5f80bf){return{'name':_0x5f80bf[_0x44c9('0x2d')],'type':_0x5f80bf[_0x44c9('0x2e')][_0x44c9('0x2f')]};});_0x2516cb[_0x44c9('0x30')]=_[_0x44c9('0x31')](_0x104143,_0x44c9('0x29'));_0x2516cb[_0x44c9('0x32')]=_[_0x44c9('0x33')](_0x452514[_0x44c9('0x32')]);_0x2516cb[_0x44c9('0x34')]=_['intersection'](_0x2516cb[_0x44c9('0x30')],_0x2516cb[_0x44c9('0x32')]);_0x2bb3d3[_0x44c9('0x35')]=_[_0x44c9('0x36')](_0x2516cb[_0x44c9('0x30')],qs[_0x44c9('0x37')](_0x452514[_0x44c9('0x32')][_0x44c9('0x37')]));_0x2bb3d3[_0x44c9('0x35')]=_0x2bb3d3['attributes']['length']?_0x2bb3d3[_0x44c9('0x35')]:_0x2516cb[_0x44c9('0x30')];if(!_0x452514[_0x44c9('0x32')][_0x44c9('0x38')](_0x44c9('0x39'))){_0x2bb3d3[_0x44c9('0x1f')]=qs[_0x44c9('0x1f')](_0x452514['query']['limit']);_0x2bb3d3[_0x44c9('0x21')]=qs[_0x44c9('0x21')](_0x452514[_0x44c9('0x32')][_0x44c9('0x21')]);}_0x2bb3d3[_0x44c9('0x3a')]=qs[_0x44c9('0x3b')](_0x452514[_0x44c9('0x32')][_0x44c9('0x3b')]);_0x2bb3d3[_0x44c9('0x3c')]=qs[_0x44c9('0x34')](_[_0x44c9('0x3d')](_0x452514[_0x44c9('0x32')],_0x2516cb[_0x44c9('0x34')]),_0x104143);if(_0x452514['query']['filter']){_0x2bb3d3[_0x44c9('0x3c')]=_[_0x44c9('0x3e')](_0x2bb3d3['where'],{'$or':_['map'](_0x104143,function(_0x7697b1){if(_0x7697b1['type']!=='VIRTUAL'){var _0x44d36c={};_0x44d36c[_0x7697b1[_0x44c9('0x29')]]={'$like':'%'+_0x452514[_0x44c9('0x32')][_0x44c9('0x3f')]+'%'};return _0x44d36c;}})});}_0x2bb3d3=_['merge']({},_0x2bb3d3,_0x452514['options']);var _0x2d6202={'where':_0x2bb3d3[_0x44c9('0x3c')]};return db['SalesforceAccount'][_0x44c9('0x20')](_0x2d6202)['then'](function(_0x44f04c){_0x1e923c[_0x44c9('0x20')]=_0x44f04c;if(_0x452514['query'][_0x44c9('0x40')]){_0x2bb3d3[_0x44c9('0x41')]=[{'all':!![]}];}return db[_0x44c9('0x2c')][_0x44c9('0x42')](_0x2bb3d3);})['then'](function(_0x3e2ed3){_0x1e923c['rows']=_0x3e2ed3;return _0x1e923c;})['then'](respondWithFilteredResult(_0x51add2,_0x2bb3d3))['catch'](handleError(_0x51add2,null));};exports[_0x44c9('0x43')]=function(_0x41fe5e,_0x42b1fe){var _0x52a44d={'raw':![],'where':{'id':_0x41fe5e[_0x44c9('0x44')]['id']}},_0x252822={};_0x252822['model']=_[_0x44c9('0x33')](db['SalesforceAccount'][_0x44c9('0x45')]);_0x252822[_0x44c9('0x32')]=_[_0x44c9('0x33')](_0x41fe5e['query']);_0x252822[_0x44c9('0x34')]=_[_0x44c9('0x36')](_0x252822[_0x44c9('0x30')],_0x252822[_0x44c9('0x32')]);_0x52a44d['attributes']=_['intersection'](_0x252822['model'],qs[_0x44c9('0x37')](_0x41fe5e['query'][_0x44c9('0x37')]));_0x52a44d[_0x44c9('0x35')]=_0x52a44d[_0x44c9('0x35')]['length']?_0x52a44d[_0x44c9('0x35')]:_0x252822[_0x44c9('0x30')];if(_0x41fe5e[_0x44c9('0x32')][_0x44c9('0x40')]){_0x52a44d[_0x44c9('0x41')]=[{'all':!![]}];}_0x52a44d=_['merge']({},_0x52a44d,_0x41fe5e[_0x44c9('0x46')]);return db[_0x44c9('0x2c')][_0x44c9('0x47')](_0x52a44d)[_0x44c9('0x26')](handleEntityNotFound(_0x42b1fe,null))[_0x44c9('0x26')](respondWithResult(_0x42b1fe,null))['catch'](handleError(_0x42b1fe,null));};exports['create']=function(_0x3aa2ef,_0x1b15d1){return db[_0x44c9('0x2c')][_0x44c9('0x48')](_0x3aa2ef['body'],{})[_0x44c9('0x26')](respondWithResult(_0x1b15d1,0xc9))[_0x44c9('0x49')](handleError(_0x1b15d1,null));};exports[_0x44c9('0x25')]=function(_0x27e41f,_0x380608){if(_0x27e41f[_0x44c9('0x4a')]['id']){delete _0x27e41f[_0x44c9('0x4a')]['id'];}return db[_0x44c9('0x2c')]['find']({'where':{'id':_0x27e41f[_0x44c9('0x44')]['id']}})[_0x44c9('0x26')](handleEntityNotFound(_0x380608,null))[_0x44c9('0x26')](saveUpdates(_0x27e41f[_0x44c9('0x4a')],null))[_0x44c9('0x26')](respondWithResult(_0x380608,null))[_0x44c9('0x49')](handleError(_0x380608,null));};exports[_0x44c9('0x27')]=function(_0x44351f,_0x20f053){return db[_0x44c9('0x2c')]['find']({'where':{'id':_0x44351f[_0x44c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x20f053,null))[_0x44c9('0x26')](removeEntity(_0x20f053,null))[_0x44c9('0x49')](handleError(_0x20f053,null));};exports[_0x44c9('0x4b')]=function(_0x326a59,_0x313610,_0x482553){var _0x3c6477={};var _0x254577={};var _0x28c884;var _0x5a6136;return db[_0x44c9('0x2c')][_0x44c9('0x4c')]({'where':{'id':_0x326a59[_0x44c9('0x44')]['id']}})[_0x44c9('0x26')](handleEntityNotFound(_0x313610,null))[_0x44c9('0x26')](function(_0x43453e){if(_0x43453e){_0x28c884=_0x43453e;_0x254577[_0x44c9('0x30')]=_['keys'](db[_0x44c9('0x4d')]['rawAttributes']);_0x254577[_0x44c9('0x32')]=_[_0x44c9('0x33')](_0x326a59[_0x44c9('0x32')]);_0x254577[_0x44c9('0x34')]=_['intersection'](_0x254577['model'],_0x254577[_0x44c9('0x32')]);_0x3c6477[_0x44c9('0x35')]=_[_0x44c9('0x36')](_0x254577[_0x44c9('0x30')],qs[_0x44c9('0x37')](_0x326a59[_0x44c9('0x32')][_0x44c9('0x37')]));_0x3c6477['attributes']=_0x3c6477[_0x44c9('0x35')]['length']?_0x3c6477[_0x44c9('0x35')]:_0x254577[_0x44c9('0x30')];_0x3c6477[_0x44c9('0x3a')]=qs[_0x44c9('0x3b')](_0x326a59[_0x44c9('0x32')][_0x44c9('0x3b')]);_0x3c6477[_0x44c9('0x3c')]=qs[_0x44c9('0x34')](_[_0x44c9('0x3d')](_0x326a59[_0x44c9('0x32')],_0x254577[_0x44c9('0x34')]));if(_0x326a59['query'][_0x44c9('0x3f')]){_0x3c6477[_0x44c9('0x3c')]=_[_0x44c9('0x3e')](_0x3c6477['where'],{'$or':_['map'](_0x3c6477[_0x44c9('0x35')],function(_0x22c77e){var _0x27744e={};_0x27744e[_0x22c77e]={'$like':'%'+_0x326a59[_0x44c9('0x32')][_0x44c9('0x3f')]+'%'};return _0x27744e;})});}_0x3c6477=_[_0x44c9('0x3e')]({},_0x3c6477,_0x326a59[_0x44c9('0x46')]);return _0x28c884['getConfigurations'](_0x3c6477);}})[_0x44c9('0x26')](function(_0x241afc){if(_0x241afc){_0x5a6136=_0x241afc[_0x44c9('0x4e')];if(!_0x326a59[_0x44c9('0x32')][_0x44c9('0x38')](_0x44c9('0x39'))){_0x3c6477[_0x44c9('0x1f')]=qs[_0x44c9('0x1f')](_0x326a59[_0x44c9('0x32')][_0x44c9('0x1f')]);_0x3c6477[_0x44c9('0x21')]=qs[_0x44c9('0x21')](_0x326a59[_0x44c9('0x32')][_0x44c9('0x21')]);}return _0x28c884[_0x44c9('0x4b')](_0x3c6477);}})[_0x44c9('0x26')](function(_0x17369e){if(_0x17369e){return _0x17369e?{'count':_0x5a6136,'rows':_0x17369e}:null;}})[_0x44c9('0x26')](respondWithResult(_0x313610,null))[_0x44c9('0x49')](handleError(_0x313610,null));};exports[_0x44c9('0x4f')]=function(_0x3b6abf,_0x2423e1,_0x149cbe){if(_0x3b6abf['body']['id']){delete _0x3b6abf[_0x44c9('0x4a')]['id'];}return db['SalesforceAccount'][_0x44c9('0x4c')]({'where':{'id':_0x3b6abf[_0x44c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2423e1,null))[_0x44c9('0x26')](function(_0x4b5714){if(_0x4b5714){_0x3b6abf[_0x44c9('0x4a')][_0x44c9('0x50')]=_0x4b5714['id'];_0x3b6abf['body'][_0x44c9('0x51')]=integrations['getSubjects'](_0x3b6abf[_0x44c9('0x4a')][_0x44c9('0x52')],_0x3b6abf[_0x44c9('0x4a')][_0x44c9('0x2e')]);_0x3b6abf[_0x44c9('0x4a')]['Descriptions']=integrations[_0x44c9('0x53')](_0x3b6abf['body']['channel'],_0x3b6abf[_0x44c9('0x4a')][_0x44c9('0x2e')]);return db[_0x44c9('0x4d')][_0x44c9('0x48')](_0x3b6abf[_0x44c9('0x4a')],{'include':[{'model':db[_0x44c9('0x54')],'as':_0x44c9('0x51')},{'model':db[_0x44c9('0x54')],'as':_0x44c9('0x55')}]});}return null;})[_0x44c9('0x26')](respondWithResult(_0x2423e1,null))['catch'](handleError(_0x2423e1,null));};exports[_0x44c9('0x56')]=function(_0x4332af,_0x39b38d,_0x33bb8d){var _0x89737c;var _0x11ed0d='';var _0x4eae32='Task';return db[_0x44c9('0x2c')][_0x44c9('0x4c')]({'where':{'id':_0x4332af[_0x44c9('0x44')]['id']},'attributes':['id',_0x44c9('0x57'),_0x44c9('0x58'),_0x44c9('0x59'),_0x44c9('0x5a'),_0x44c9('0x5b'),_0x44c9('0x5c')]})[_0x44c9('0x26')](handleEntityNotFound(_0x39b38d,null))['then'](function(_0x8c3485){if(_0x8c3485){_0x11ed0d=_0x8c3485[_0x44c9('0x57')];var _0x25f113=_0x11ed0d['slice'](-0x1);if(_0x25f113==='/'){_0x11ed0d=_0x11ed0d[_0x44c9('0x5d')](0x0,_0x11ed0d['lastIndexOf'](_0x25f113));}_0x89737c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x11ed0d,'clientId':_0x8c3485[_0x44c9('0x58')],'clientSecret':_0x8c3485['clientSecret']}});return _0x89737c[_0x44c9('0x5e')](_0x8c3485[_0x44c9('0x5a')],_0x8c3485[_0x44c9('0x5b')]['concat'](_0x8c3485[_0x44c9('0x5c')]));}})[_0x44c9('0x26')](function(_0x2101e6){if(_0x2101e6){if(!_[_0x44c9('0x5f')](_0x4332af[_0x44c9('0x32')]['ticketType'])){_0x4eae32=_0x4332af['query']['ticketType'];}return _0x89737c['sobject'](_0x4eae32)['describe']();}})['then'](function(_0x1d12cf){var _0x261295=[_0x44c9('0x60'),'ActivityDate','IsReminderSet','IsRecurrence','Subject',_0x44c9('0x61')];var _0x11328f=[_0x44c9('0x62'),_0x44c9('0x63'),'picklist',_0x44c9('0x64'),_0x44c9('0x65'),_0x44c9('0x66'),_0x44c9('0x67')];if(_0x1d12cf){_[_0x44c9('0x68')](_0x1d12cf[_0x44c9('0x37')],function(_0x49dee0){return _0x261295[_0x44c9('0x69')](_0x49dee0['name'])||!_0x11328f[_0x44c9('0x69')](_0x49dee0[_0x44c9('0x2e')]);});return{'count':_0x1d12cf['fields'][_0x44c9('0x4e')],'rows':_[_0x44c9('0x31')](_0x1d12cf[_0x44c9('0x37')],function(_0x5ea388){return{'id':_0x5ea388['name'],'name':_0x5ea388['label'],'custom':_0x5ea388[_0x44c9('0x6a')],'options':_0x5ea388['picklistValues']['length']>0x0?_[_0x44c9('0x31')](_0x5ea388[_0x44c9('0x6b')],function(_0x5dd304){return{'name':_0x5dd304[_0x44c9('0x6c')],'value':_0x5dd304[_0x44c9('0x6d')]};}):_0x5ea388[_0x44c9('0x2e')]==_0x44c9('0x64')?[{'name':'True','value':'true'},{'name':'False','value':_0x44c9('0x6e')}]:[]};})};}})['then'](respondWithResult(_0x39b38d,null))[_0x44c9('0x49')](function(_0x2e531d){var _0x2e3fcf=_0x4332af[_0x44c9('0x32')][_0x44c9('0x6f')]?0x1f4:_0x2e531d[_0x44c9('0x70')]||0x1f4;logger[_0x44c9('0x28')](_0x44c9('0x71'),'getFields',_0x2e3fcf,JSON[_0x44c9('0x72')](_0x2e531d));delete _0x2e531d[_0x44c9('0x29')];if(_0x2e3fcf===0x191){_0x2e3fcf=0x190;}_0x39b38d[_0x44c9('0x1b')](_0x2e3fcf)[_0x44c9('0x2a')](_0x4332af[_0x44c9('0x32')][_0x44c9('0x6f')]?{'message':_0x44c9('0x73'),'statusCode':_0x2e531d[_0x44c9('0x70')]}:_0x2e531d);});}; \ No newline at end of file +var _0xed13=['picklistValues','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','SalesforceConfiguration','order','getConfigurations','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','ticketType','OwnerId','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom'];(function(_0x1641da,_0x58d230){var _0x31ec20=function(_0x508bf1){while(--_0x508bf1){_0x1641da['push'](_0x1641da['shift']());}};_0x31ec20(++_0x58d230);}(_0xed13,0x85));var _0x3ed1=function(_0x3a1077,_0x3bcd8c){_0x3a1077=_0x3a1077-0x0;var _0x44372d=_0xed13[_0x3a1077];return _0x44372d;};'use strict';var emlformat=require(_0x3ed1('0x0'));var rimraf=require(_0x3ed1('0x1'));var zipdir=require(_0x3ed1('0x2'));var jsonpatch=require(_0x3ed1('0x3'));var rp=require(_0x3ed1('0x4'));var moment=require(_0x3ed1('0x5'));var BPromise=require(_0x3ed1('0x6'));var Mustache=require('mustache');var util=require(_0x3ed1('0x7'));var path=require(_0x3ed1('0x8'));var sox=require(_0x3ed1('0x9'));var csv=require('to-csv');var ejs=require(_0x3ed1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ed1('0xb'));var squel=require(_0x3ed1('0xc'));var crypto=require(_0x3ed1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3ed1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3ed1('0xf'));var Papa=require(_0x3ed1('0x10'));var Redis=require('ioredis');var authService=require(_0x3ed1('0x11'));var qs=require(_0x3ed1('0x12'));var as=require(_0x3ed1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ed1('0x14'))('api');var utils=require(_0x3ed1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3ed1('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3ed1('0x17'));function respondWithStatusCode(_0x5722c2,_0x15e990){_0x15e990=_0x15e990||0xcc;return function(_0x3cece9){if(_0x3cece9){return _0x5722c2[_0x3ed1('0x18')](_0x15e990);}return _0x5722c2['status'](_0x15e990)['end']();};}function respondWithResult(_0x1478b3,_0x4a692b){_0x4a692b=_0x4a692b||0xc8;return function(_0x320b02){if(_0x320b02){return _0x1478b3['status'](_0x4a692b)[_0x3ed1('0x19')](_0x320b02);}};}function respondWithFilteredResult(_0x2fbec0,_0x324702){return function(_0x371eb7){if(_0x371eb7){var _0x1720b2=typeof _0x324702[_0x3ed1('0x1a')]===_0x3ed1('0x1b')&&typeof _0x324702['limit']===_0x3ed1('0x1b');var _0xa59cc2=_0x371eb7[_0x3ed1('0x1c')];var _0x1aeac7=_0x1720b2?0x0:_0x324702[_0x3ed1('0x1a')];var _0x13ef33=_0x1720b2?_0x371eb7[_0x3ed1('0x1c')]:_0x324702[_0x3ed1('0x1a')]+_0x324702[_0x3ed1('0x1d')];var _0x51cd49;if(_0x13ef33>=_0xa59cc2){_0x13ef33=_0xa59cc2;_0x51cd49=0xc8;}else{_0x51cd49=0xce;}_0x2fbec0[_0x3ed1('0x1e')](_0x51cd49);return _0x2fbec0[_0x3ed1('0x1f')](_0x3ed1('0x20'),_0x1aeac7+'-'+_0x13ef33+'/'+_0xa59cc2)[_0x3ed1('0x19')](_0x371eb7);}return null;};}function patchUpdates(_0x51b22a){return function(_0xcae3b3){try{jsonpatch['apply'](_0xcae3b3,_0x51b22a,!![]);}catch(_0x58d9a0){return BPromise[_0x3ed1('0x21')](_0x58d9a0);}return _0xcae3b3[_0x3ed1('0x22')]();};}function saveUpdates(_0x334921,_0x5a44e9){return function(_0x4c4f55){if(_0x4c4f55){return _0x4c4f55['update'](_0x334921)[_0x3ed1('0x23')](function(_0x58725f){return _0x58725f;});}return null;};}function removeEntity(_0x3c4c7b,_0x4fb348){return function(_0x2c6cfb){if(_0x2c6cfb){return _0x2c6cfb[_0x3ed1('0x24')]()[_0x3ed1('0x23')](function(){_0x3c4c7b[_0x3ed1('0x1e')](0xcc)[_0x3ed1('0x25')]();});}};}function handleEntityNotFound(_0x145548,_0x463214){return function(_0x513aaf){if(!_0x513aaf){_0x145548[_0x3ed1('0x18')](0x194);}return _0x513aaf;};}function handleError(_0xe7902d,_0xb2764a){_0xb2764a=_0xb2764a||0x1f4;return function(_0x46211){logger[_0x3ed1('0x26')](_0x46211[_0x3ed1('0x27')]);if(_0x46211[_0x3ed1('0x28')]){delete _0x46211[_0x3ed1('0x28')];}_0xe7902d[_0x3ed1('0x1e')](_0xb2764a)[_0x3ed1('0x29')](_0x46211);};}exports['index']=function(_0x40cde6,_0x15e422){var _0x3bb939={},_0x43d803={},_0x3350e9={'count':0x0,'rows':[]};var _0x4287fb=_[_0x3ed1('0x2a')](db[_0x3ed1('0x2b')][_0x3ed1('0x2c')],function(_0x102eb7){return{'name':_0x102eb7[_0x3ed1('0x2d')],'type':_0x102eb7[_0x3ed1('0x2e')][_0x3ed1('0x2f')]};});_0x43d803[_0x3ed1('0x30')]=_[_0x3ed1('0x2a')](_0x4287fb,_0x3ed1('0x28'));_0x43d803[_0x3ed1('0x31')]=_['keys'](_0x40cde6[_0x3ed1('0x31')]);_0x43d803[_0x3ed1('0x32')]=_[_0x3ed1('0x33')](_0x43d803[_0x3ed1('0x30')],_0x43d803[_0x3ed1('0x31')]);_0x3bb939[_0x3ed1('0x34')]=_[_0x3ed1('0x33')](_0x43d803[_0x3ed1('0x30')],qs[_0x3ed1('0x35')](_0x40cde6[_0x3ed1('0x31')][_0x3ed1('0x35')]));_0x3bb939[_0x3ed1('0x34')]=_0x3bb939['attributes'][_0x3ed1('0x36')]?_0x3bb939[_0x3ed1('0x34')]:_0x43d803[_0x3ed1('0x30')];if(!_0x40cde6['query'][_0x3ed1('0x37')]('nolimit')){_0x3bb939[_0x3ed1('0x1d')]=qs[_0x3ed1('0x1d')](_0x40cde6[_0x3ed1('0x31')][_0x3ed1('0x1d')]);_0x3bb939[_0x3ed1('0x1a')]=qs['offset'](_0x40cde6[_0x3ed1('0x31')][_0x3ed1('0x1a')]);}_0x3bb939['order']=qs['sort'](_0x40cde6[_0x3ed1('0x31')][_0x3ed1('0x38')]);_0x3bb939[_0x3ed1('0x39')]=qs['filters'](_[_0x3ed1('0x3a')](_0x40cde6[_0x3ed1('0x31')],_0x43d803[_0x3ed1('0x32')]),_0x4287fb);if(_0x40cde6[_0x3ed1('0x31')]['filter']){_0x3bb939[_0x3ed1('0x39')]=_[_0x3ed1('0x3b')](_0x3bb939[_0x3ed1('0x39')],{'$or':_[_0x3ed1('0x2a')](_0x4287fb,function(_0x565bcb){if(_0x565bcb['type']!==_0x3ed1('0x3c')){var _0x4d7d58={};_0x4d7d58[_0x565bcb[_0x3ed1('0x28')]]={'$like':'%'+_0x40cde6[_0x3ed1('0x31')][_0x3ed1('0x3d')]+'%'};return _0x4d7d58;}})});}_0x3bb939=_[_0x3ed1('0x3b')]({},_0x3bb939,_0x40cde6[_0x3ed1('0x3e')]);var _0x30e30a={'where':_0x3bb939[_0x3ed1('0x39')]};return db[_0x3ed1('0x2b')][_0x3ed1('0x1c')](_0x30e30a)[_0x3ed1('0x23')](function(_0x5415da){_0x3350e9[_0x3ed1('0x1c')]=_0x5415da;if(_0x40cde6[_0x3ed1('0x31')]['includeAll']){_0x3bb939[_0x3ed1('0x3f')]=[{'all':!![]}];}return db[_0x3ed1('0x2b')][_0x3ed1('0x40')](_0x3bb939);})[_0x3ed1('0x23')](function(_0x594fe4){_0x3350e9[_0x3ed1('0x41')]=_0x594fe4;return _0x3350e9;})[_0x3ed1('0x23')](respondWithFilteredResult(_0x15e422,_0x3bb939))[_0x3ed1('0x42')](handleError(_0x15e422,null));};exports[_0x3ed1('0x43')]=function(_0x5d8980,_0x1ad14f){var _0x439eb9={'raw':![],'where':{'id':_0x5d8980[_0x3ed1('0x44')]['id']}},_0x58c984={};_0x58c984[_0x3ed1('0x30')]=_['keys'](db['SalesforceAccount'][_0x3ed1('0x2c')]);_0x58c984[_0x3ed1('0x31')]=_[_0x3ed1('0x45')](_0x5d8980[_0x3ed1('0x31')]);_0x58c984[_0x3ed1('0x32')]=_[_0x3ed1('0x33')](_0x58c984[_0x3ed1('0x30')],_0x58c984['query']);_0x439eb9[_0x3ed1('0x34')]=_[_0x3ed1('0x33')](_0x58c984[_0x3ed1('0x30')],qs[_0x3ed1('0x35')](_0x5d8980['query'][_0x3ed1('0x35')]));_0x439eb9[_0x3ed1('0x34')]=_0x439eb9[_0x3ed1('0x34')]['length']?_0x439eb9[_0x3ed1('0x34')]:_0x58c984[_0x3ed1('0x30')];if(_0x5d8980[_0x3ed1('0x31')][_0x3ed1('0x46')]){_0x439eb9[_0x3ed1('0x3f')]=[{'all':!![]}];}_0x439eb9=_[_0x3ed1('0x3b')]({},_0x439eb9,_0x5d8980[_0x3ed1('0x3e')]);return db[_0x3ed1('0x2b')][_0x3ed1('0x47')](_0x439eb9)[_0x3ed1('0x23')](handleEntityNotFound(_0x1ad14f,null))[_0x3ed1('0x23')](respondWithResult(_0x1ad14f,null))[_0x3ed1('0x42')](handleError(_0x1ad14f,null));};exports[_0x3ed1('0x48')]=function(_0x4cbe51,_0x5899d7){return db[_0x3ed1('0x2b')][_0x3ed1('0x48')](_0x4cbe51[_0x3ed1('0x49')],{})[_0x3ed1('0x23')](respondWithResult(_0x5899d7,0xc9))[_0x3ed1('0x42')](handleError(_0x5899d7,null));};exports[_0x3ed1('0x4a')]=function(_0x54caa7,_0x434b29){if(_0x54caa7[_0x3ed1('0x49')]['id']){delete _0x54caa7[_0x3ed1('0x49')]['id'];}return db[_0x3ed1('0x2b')][_0x3ed1('0x47')]({'where':{'id':_0x54caa7[_0x3ed1('0x44')]['id']}})[_0x3ed1('0x23')](handleEntityNotFound(_0x434b29,null))[_0x3ed1('0x23')](saveUpdates(_0x54caa7['body'],null))['then'](respondWithResult(_0x434b29,null))['catch'](handleError(_0x434b29,null));};exports[_0x3ed1('0x24')]=function(_0x5f0917,_0x5eae1a){return db[_0x3ed1('0x2b')]['find']({'where':{'id':_0x5f0917['params']['id']}})[_0x3ed1('0x23')](handleEntityNotFound(_0x5eae1a,null))['then'](removeEntity(_0x5eae1a,null))[_0x3ed1('0x42')](handleError(_0x5eae1a,null));};exports['getConfigurations']=function(_0x44f6ee,_0x339436,_0x33b594){var _0x2a7551={};var _0x273512={};var _0x540af3;var _0x40eac6;return db[_0x3ed1('0x2b')]['findOne']({'where':{'id':_0x44f6ee[_0x3ed1('0x44')]['id']}})[_0x3ed1('0x23')](handleEntityNotFound(_0x339436,null))['then'](function(_0x151e60){if(_0x151e60){_0x540af3=_0x151e60;_0x273512[_0x3ed1('0x30')]=_[_0x3ed1('0x45')](db[_0x3ed1('0x4b')]['rawAttributes']);_0x273512[_0x3ed1('0x31')]=_[_0x3ed1('0x45')](_0x44f6ee[_0x3ed1('0x31')]);_0x273512['filters']=_[_0x3ed1('0x33')](_0x273512[_0x3ed1('0x30')],_0x273512[_0x3ed1('0x31')]);_0x2a7551['attributes']=_['intersection'](_0x273512[_0x3ed1('0x30')],qs[_0x3ed1('0x35')](_0x44f6ee['query'][_0x3ed1('0x35')]));_0x2a7551[_0x3ed1('0x34')]=_0x2a7551[_0x3ed1('0x34')]['length']?_0x2a7551['attributes']:_0x273512[_0x3ed1('0x30')];_0x2a7551[_0x3ed1('0x4c')]=qs['sort'](_0x44f6ee['query'][_0x3ed1('0x38')]);_0x2a7551[_0x3ed1('0x39')]=qs['filters'](_[_0x3ed1('0x3a')](_0x44f6ee[_0x3ed1('0x31')],_0x273512[_0x3ed1('0x32')]));if(_0x44f6ee[_0x3ed1('0x31')][_0x3ed1('0x3d')]){_0x2a7551[_0x3ed1('0x39')]=_[_0x3ed1('0x3b')](_0x2a7551[_0x3ed1('0x39')],{'$or':_['map'](_0x2a7551[_0x3ed1('0x34')],function(_0x2cab10){var _0x13e726={};_0x13e726[_0x2cab10]={'$like':'%'+_0x44f6ee[_0x3ed1('0x31')]['filter']+'%'};return _0x13e726;})});}_0x2a7551=_[_0x3ed1('0x3b')]({},_0x2a7551,_0x44f6ee[_0x3ed1('0x3e')]);return _0x540af3[_0x3ed1('0x4d')](_0x2a7551);}})[_0x3ed1('0x23')](function(_0x1888bc){if(_0x1888bc){_0x40eac6=_0x1888bc['length'];if(!_0x44f6ee[_0x3ed1('0x31')]['hasOwnProperty'](_0x3ed1('0x4e'))){_0x2a7551[_0x3ed1('0x1d')]=qs[_0x3ed1('0x1d')](_0x44f6ee[_0x3ed1('0x31')][_0x3ed1('0x1d')]);_0x2a7551['offset']=qs[_0x3ed1('0x1a')](_0x44f6ee[_0x3ed1('0x31')][_0x3ed1('0x1a')]);}return _0x540af3[_0x3ed1('0x4d')](_0x2a7551);}})['then'](function(_0x487e7b){if(_0x487e7b){return _0x487e7b?{'count':_0x40eac6,'rows':_0x487e7b}:null;}})[_0x3ed1('0x23')](respondWithResult(_0x339436,null))[_0x3ed1('0x42')](handleError(_0x339436,null));};exports['addConfiguration']=function(_0x14ba02,_0x508d34,_0x239696){if(_0x14ba02[_0x3ed1('0x49')]['id']){delete _0x14ba02[_0x3ed1('0x49')]['id'];}return db[_0x3ed1('0x2b')][_0x3ed1('0x4f')]({'where':{'id':_0x14ba02['params']['id']}})[_0x3ed1('0x23')](handleEntityNotFound(_0x508d34,null))['then'](function(_0x4925a3){if(_0x4925a3){_0x14ba02[_0x3ed1('0x49')][_0x3ed1('0x50')]=_0x4925a3['id'];_0x14ba02[_0x3ed1('0x49')][_0x3ed1('0x51')]=integrations[_0x3ed1('0x52')](_0x14ba02[_0x3ed1('0x49')][_0x3ed1('0x53')],_0x14ba02[_0x3ed1('0x49')]['type']);_0x14ba02[_0x3ed1('0x49')][_0x3ed1('0x54')]=integrations['getDescriptions'](_0x14ba02[_0x3ed1('0x49')][_0x3ed1('0x53')],_0x14ba02[_0x3ed1('0x49')]['type']);return db['SalesforceConfiguration']['create'](_0x14ba02[_0x3ed1('0x49')],{'include':[{'model':db[_0x3ed1('0x55')],'as':_0x3ed1('0x51')},{'model':db['SalesforceField'],'as':_0x3ed1('0x54')}]});}return null;})[_0x3ed1('0x23')](respondWithResult(_0x508d34,null))['catch'](handleError(_0x508d34,null));};exports[_0x3ed1('0x56')]=function(_0x26e83f,_0x14842b,_0x381a60){var _0x3c9a68;var _0x36b177='';var _0x155e6e=_0x3ed1('0x57');return db[_0x3ed1('0x2b')][_0x3ed1('0x4f')]({'where':{'id':_0x26e83f[_0x3ed1('0x44')]['id']},'attributes':['id',_0x3ed1('0x58'),_0x3ed1('0x59'),_0x3ed1('0x5a'),_0x3ed1('0x5b'),_0x3ed1('0x5c'),_0x3ed1('0x5d')]})[_0x3ed1('0x23')](handleEntityNotFound(_0x14842b,null))[_0x3ed1('0x23')](function(_0x5d78fe){if(_0x5d78fe){_0x36b177=_0x5d78fe['remoteUri'];var _0xc36205=_0x36b177[_0x3ed1('0x5e')](-0x1);if(_0xc36205==='/'){_0x36b177=_0x36b177[_0x3ed1('0x5f')](0x0,_0x36b177['lastIndexOf'](_0xc36205));}_0x3c9a68=new jsforce[(_0x3ed1('0x60'))]({'oauth2':{'loginUrl':_0x36b177,'clientId':_0x5d78fe[_0x3ed1('0x59')],'clientSecret':_0x5d78fe[_0x3ed1('0x5a')]}});return _0x3c9a68[_0x3ed1('0x61')](_0x5d78fe[_0x3ed1('0x5b')],_0x5d78fe[_0x3ed1('0x5c')]['concat'](_0x5d78fe[_0x3ed1('0x5d')]));}})[_0x3ed1('0x23')](function(_0x17c8bf){if(_0x17c8bf){if(!_['isNil'](_0x26e83f[_0x3ed1('0x31')][_0x3ed1('0x62')])){_0x155e6e=_0x26e83f[_0x3ed1('0x31')][_0x3ed1('0x62')];}return _0x3c9a68['sobject'](_0x155e6e)['describe']();}})[_0x3ed1('0x23')](function(_0x481e79){var _0x61760c=[_0x3ed1('0x63'),'ActivityDate','IsReminderSet',_0x3ed1('0x64'),_0x3ed1('0x65'),_0x3ed1('0x66')];var _0x5d3da9=[_0x3ed1('0x67'),'int',_0x3ed1('0x68'),_0x3ed1('0x69'),_0x3ed1('0x6a'),_0x3ed1('0x6b'),_0x3ed1('0x6c')];if(_0x481e79){_[_0x3ed1('0x6d')](_0x481e79[_0x3ed1('0x35')],function(_0x2f2870){return _0x61760c[_0x3ed1('0x6e')](_0x2f2870[_0x3ed1('0x28')])||!_0x5d3da9[_0x3ed1('0x6e')](_0x2f2870['type']);});return{'count':_0x481e79[_0x3ed1('0x35')]['length'],'rows':_[_0x3ed1('0x2a')](_0x481e79['fields'],function(_0x4aa79b){return{'id':_0x4aa79b[_0x3ed1('0x28')],'name':_0x4aa79b[_0x3ed1('0x6f')],'custom':_0x4aa79b[_0x3ed1('0x70')],'options':_0x4aa79b[_0x3ed1('0x71')][_0x3ed1('0x36')]>0x0?_[_0x3ed1('0x2a')](_0x4aa79b['picklistValues'],function(_0x5b6b3d){return{'name':_0x5b6b3d[_0x3ed1('0x6f')],'value':_0x5b6b3d[_0x3ed1('0x72')]};}):_0x4aa79b[_0x3ed1('0x2e')]==_0x3ed1('0x69')?[{'name':_0x3ed1('0x73'),'value':_0x3ed1('0x74')},{'name':_0x3ed1('0x75'),'value':_0x3ed1('0x76')}]:[]};})};}})[_0x3ed1('0x23')](respondWithResult(_0x14842b,null))[_0x3ed1('0x42')](function(_0x482933){var _0x411ee2=_0x26e83f[_0x3ed1('0x31')][_0x3ed1('0x77')]?0x1f4:_0x482933['statusCode']||0x1f4;logger[_0x3ed1('0x26')](_0x3ed1('0x78'),_0x3ed1('0x56'),_0x411ee2,JSON[_0x3ed1('0x79')](_0x482933));delete _0x482933[_0x3ed1('0x28')];if(_0x411ee2===0x191){_0x411ee2=0x190;}_0x14842b[_0x3ed1('0x1e')](_0x411ee2)[_0x3ed1('0x29')](_0x26e83f[_0x3ed1('0x31')][_0x3ed1('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x482933[_0x3ed1('0x7a')]}:_0x482933);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 3aac083..88751ab 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 _0xe3a6=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','define'];(function(_0x496bab,_0x483f8a){var _0x2c455b=function(_0x4e47de){while(--_0x4e47de){_0x496bab['push'](_0x496bab['shift']());}};_0x2c455b(++_0x483f8a);}(_0xe3a6,0x79));var _0x6e3a=function(_0x4dd747,_0x2c1d03){_0x4dd747=_0x4dd747-0x0;var _0x36890e=_0xe3a6[_0x4dd747];return _0x36890e;};'use strict';var _=require(_0x6e3a('0x0'));var util=require('util');var logger=require(_0x6e3a('0x1'))(_0x6e3a('0x2'));var moment=require(_0x6e3a('0x3'));var BPromise=require(_0x6e3a('0x4'));var rp=require(_0x6e3a('0x5'));var fs=require('fs');var path=require(_0x6e3a('0x6'));var rimraf=require(_0x6e3a('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e3a('0x8'));var integrations=require(_0x6e3a('0x9'));module['exports']=function(_0x1c7840,_0x38f47a){return _0x1c7840[_0x6e3a('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ab7=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfca65d,_0x3988c5){var _0x391094=function(_0x7af239){while(--_0x7af239){_0xfca65d['push'](_0xfca65d['shift']());}};_0x391094(++_0x3988c5);}(_0x4ab7,0x75));var _0x74ab=function(_0x503a12,_0x1efa26){_0x503a12=_0x503a12-0x0;var _0x31a8d2=_0x4ab7[_0x503a12];return _0x31a8d2;};'use strict';var _=require(_0x74ab('0x0'));var util=require('util');var logger=require(_0x74ab('0x1'))(_0x74ab('0x2'));var moment=require(_0x74ab('0x3'));var BPromise=require(_0x74ab('0x4'));var rp=require(_0x74ab('0x5'));var fs=require('fs');var path=require(_0x74ab('0x6'));var rimraf=require(_0x74ab('0x7'));var config=require(_0x74ab('0x8'));var attributes=require(_0x74ab('0x9'));var integrations=require(_0x74ab('0xa'));module[_0x74ab('0xb')]=function(_0x2acdfe,_0x50b206){return _0x2acdfe[_0x74ab('0xc')](_0x74ab('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index a403ff5..4a1d666 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 _0xcceb=['../../config/environment','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','SalesforceAccount','findAll','options','raw','attributes','limit','map','include','model','then','GetSalesforceAccount','ShowSalesforceAccount','find','where','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x26726c,_0x519164){var _0x21576a=function(_0x100b66){while(--_0x100b66){_0x26726c['push'](_0x26726c['shift']());}};_0x21576a(++_0x519164);}(_0xcceb,0x144));var _0xbcce=function(_0xaec7d,_0x44dce6){_0xaec7d=_0xaec7d-0x0;var _0x54a0ce=_0xcceb[_0xaec7d];return _0x54a0ce;};'use strict';var _=require(_0xbcce('0x0'));var util=require(_0xbcce('0x1'));var moment=require(_0xbcce('0x2'));var BPromise=require(_0xbcce('0x3'));var rs=require(_0xbcce('0x4'));var fs=require('fs');var Redis=require(_0xbcce('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcce('0x6'));var logger=require(_0xbcce('0x7'))(_0xbcce('0x8'));var config=require(_0xbcce('0x9'));var jayson=require(_0xbcce('0xa'));var client=jayson[_0xbcce('0xb')][_0xbcce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x463a21,_0x2b63f2,_0x282ef5){return new BPromise(function(_0xbe9475,_0x5c0904){return client['request'](_0x463a21,_0x282ef5)['then'](function(_0x194f06){logger[_0xbcce('0xd')](_0xbcce('0xe'),_0x2b63f2,_0xbcce('0xf'));logger[_0xbcce('0x10')](_0xbcce('0x11'),_0x2b63f2,_0xbcce('0xf'),JSON['stringify'](_0x194f06));if(_0x194f06['error']){if(_0x194f06[_0xbcce('0x12')]['code']===0x1f4){logger[_0xbcce('0x12')](_0xbcce('0xe'),_0x2b63f2,_0x194f06[_0xbcce('0x12')][_0xbcce('0x13')]);return _0x5c0904(_0x194f06[_0xbcce('0x12')]['message']);}logger[_0xbcce('0x12')](_0xbcce('0xe'),_0x2b63f2,_0x194f06['error'][_0xbcce('0x13')]);return _0xbe9475(_0x194f06['error'][_0xbcce('0x13')]);}else{logger[_0xbcce('0xd')](_0xbcce('0xe'),_0x2b63f2,'request\x20sent');_0xbe9475(_0x194f06[_0xbcce('0x14')][_0xbcce('0x13')]);}})[_0xbcce('0x15')](function(_0x2309f7){logger[_0xbcce('0x12')](_0xbcce('0xe'),_0x2b63f2,_0x2309f7);_0x5c0904(_0x2309f7);});});}exports['GetSalesforceAccount']=function(_0x17dd90){var _0x237e25=this;return new Promise(function(_0x22b98d,_0xbb2c23){return db[_0xbcce('0x16')][_0xbcce('0x17')]({'raw':_0x17dd90['options']?_0x17dd90[_0xbcce('0x18')][_0xbcce('0x19')]===undefined?!![]:![]:!![],'where':_0x17dd90[_0xbcce('0x18')]?_0x17dd90[_0xbcce('0x18')]['where']||null:null,'attributes':_0x17dd90[_0xbcce('0x18')]?_0x17dd90[_0xbcce('0x18')][_0xbcce('0x1a')]||null:null,'limit':_0x17dd90['options']?_0x17dd90[_0xbcce('0x18')][_0xbcce('0x1b')]||null:null,'include':_0x17dd90[_0xbcce('0x18')]?_0x17dd90[_0xbcce('0x18')]['include']?_[_0xbcce('0x1c')](_0x17dd90['options'][_0xbcce('0x1d')],function(_0x17e8a5){return{'model':db[_0x17e8a5[_0xbcce('0x1e')]],'as':_0x17e8a5['as'],'attributes':_0x17e8a5[_0xbcce('0x1a')],'include':_0x17e8a5[_0xbcce('0x1d')]?_[_0xbcce('0x1c')](_0x17e8a5['include'],function(_0x597a30){return{'model':db[_0x597a30[_0xbcce('0x1e')]],'as':_0x597a30['as'],'attributes':_0x597a30[_0xbcce('0x1a')],'include':_0x597a30['include']?_[_0xbcce('0x1c')](_0x597a30[_0xbcce('0x1d')],function(_0x4bbdce){return{'model':db[_0x4bbdce['model']],'as':_0x4bbdce['as'],'attributes':_0x4bbdce[_0xbcce('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbcce('0x1f')](function(_0x2c9ed9){logger[_0xbcce('0xd')]('GetSalesforceAccount',_0x17dd90);logger[_0xbcce('0x10')]('GetSalesforceAccount',_0x17dd90,JSON['stringify'](_0x2c9ed9));_0x22b98d(_0x2c9ed9);})[_0xbcce('0x15')](function(_0x294fec){logger[_0xbcce('0x12')](_0xbcce('0x20'),_0x294fec[_0xbcce('0x13')],_0x17dd90);_0xbb2c23(_0x237e25[_0xbcce('0x12')](0x1f4,_0x294fec[_0xbcce('0x13')]));});});};exports[_0xbcce('0x21')]=function(_0x364d18){var _0x460edc=this;return new Promise(function(_0x21c698,_0x4654cd){return db[_0xbcce('0x16')][_0xbcce('0x22')]({'raw':_0x364d18[_0xbcce('0x18')]?_0x364d18['options'][_0xbcce('0x19')]===undefined?!![]:![]:!![],'where':_0x364d18[_0xbcce('0x18')]?_0x364d18[_0xbcce('0x18')][_0xbcce('0x23')]||null:null,'attributes':_0x364d18['options']?_0x364d18[_0xbcce('0x18')][_0xbcce('0x1a')]||null:null,'include':_0x364d18['options']?_0x364d18[_0xbcce('0x18')][_0xbcce('0x1d')]?_[_0xbcce('0x1c')](_0x364d18[_0xbcce('0x18')][_0xbcce('0x1d')],function(_0x261a63){return{'model':db[_0x261a63[_0xbcce('0x1e')]],'as':_0x261a63['as'],'attributes':_0x261a63[_0xbcce('0x1a')],'include':_0x261a63[_0xbcce('0x1d')]?_[_0xbcce('0x1c')](_0x261a63['include'],function(_0x19a68f){return{'model':db[_0x19a68f[_0xbcce('0x1e')]],'as':_0x19a68f['as'],'attributes':_0x19a68f[_0xbcce('0x1a')],'include':_0x19a68f[_0xbcce('0x1d')]?_[_0xbcce('0x1c')](_0x19a68f[_0xbcce('0x1d')],function(_0x3ebe84){return{'model':db[_0x3ebe84[_0xbcce('0x1e')]],'as':_0x3ebe84['as'],'attributes':_0x3ebe84[_0xbcce('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbcce('0x1f')](function(_0x1ead84){logger[_0xbcce('0xd')](_0xbcce('0x21'),_0x364d18);logger[_0xbcce('0x10')](_0xbcce('0x21'),_0x364d18,JSON[_0xbcce('0x24')](_0x1ead84));_0x21c698(_0x1ead84);})[_0xbcce('0x15')](function(_0x215f7a){logger[_0xbcce('0x12')](_0xbcce('0x21'),_0x215f7a['message'],_0x364d18);_0x4654cd(_0x460edc['error'](0x1f4,_0x215f7a[_0xbcce('0x13')]));});});}; \ No newline at end of file +var _0x10ad=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x248d1b,_0xcbfb91){var _0x45702d=function(_0x7f8fd8){while(--_0x7f8fd8){_0x248d1b['push'](_0x248d1b['shift']());}};_0x45702d(++_0xcbfb91);}(_0x10ad,0xf4));var _0xd10a=function(_0x2c94b7,_0x46b3a5){_0x2c94b7=_0x2c94b7-0x0;var _0x40bc13=_0x10ad[_0x2c94b7];return _0x40bc13;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd10a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x1'));var db=require(_0xd10a('0x2'))['db'];var utils=require(_0xd10a('0x3'));var logger=require(_0xd10a('0x4'))('rpc');var config=require(_0xd10a('0x5'));var jayson=require(_0xd10a('0x6'));var client=jayson[_0xd10a('0x7')][_0xd10a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x429316,_0xdae354,_0x217329){return new BPromise(function(_0x194a4a,_0x5be3da){return client['request'](_0x429316,_0x217329)[_0xd10a('0x9')](function(_0x4d8613){logger[_0xd10a('0xa')](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));logger[_0xd10a('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xdae354,_0xd10a('0xc'),JSON[_0xd10a('0xe')](_0x4d8613));if(_0x4d8613[_0xd10a('0xf')]){if(_0x4d8613['error'][_0xd10a('0x10')]===0x1f4){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x5be3da(_0x4d8613[_0xd10a('0xf')]['message']);}logger['error'](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x194a4a(_0x4d8613[_0xd10a('0xf')]['message']);}else{logger['info'](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));_0x194a4a(_0x4d8613[_0xd10a('0x12')][_0xd10a('0x11')]);}})[_0xd10a('0x13')](function(_0x33bb89){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x33bb89);_0x5be3da(_0x33bb89);});});}exports[_0xd10a('0x14')]=function(_0x48a07b){var _0x589fb3=this;return new Promise(function(_0x40dd9f,_0x27d1a7){return db['SalesforceAccount']['findAll']({'raw':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x17')]||null:null,'attributes':_0x48a07b['options']?_0x48a07b['options'][_0xd10a('0x18')]||null:null,'limit':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x19')]||null:null,'include':_0x48a07b[_0xd10a('0x15')]?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x48a07b['options'][_0xd10a('0x1a')],function(_0x13eefe){return{'model':db[_0x13eefe[_0xd10a('0x1c')]],'as':_0x13eefe['as'],'attributes':_0x13eefe[_0xd10a('0x18')],'include':_0x13eefe[_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x13eefe[_0xd10a('0x1a')],function(_0x3715fe){return{'model':db[_0x3715fe['model']],'as':_0x3715fe['as'],'attributes':_0x3715fe['attributes'],'include':_0x3715fe['include']?_[_0xd10a('0x1b')](_0x3715fe[_0xd10a('0x1a')],function(_0x58f500){return{'model':db[_0x58f500[_0xd10a('0x1c')]],'as':_0x58f500['as'],'attributes':_0x58f500[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x152bd5){logger[_0xd10a('0xa')]('GetSalesforceAccount',_0x48a07b);logger[_0xd10a('0xd')](_0xd10a('0x14'),_0x48a07b,JSON[_0xd10a('0xe')](_0x152bd5));_0x40dd9f(_0x152bd5);})[_0xd10a('0x13')](function(_0x41e582){logger[_0xd10a('0xf')](_0xd10a('0x14'),_0x41e582[_0xd10a('0x11')],_0x48a07b);_0x27d1a7(_0x589fb3[_0xd10a('0xf')](0x1f4,_0x41e582[_0xd10a('0x11')]));});});};exports[_0xd10a('0x1d')]=function(_0x45e9fd){var _0x12ab07=this;return new Promise(function(_0xd7741,_0x4ad3d4){return db['SalesforceAccount'][_0xd10a('0x1e')]({'raw':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['where']||null:null,'attributes':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['attributes']||null:null,'include':_0x45e9fd['options']?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x45e9fd[_0xd10a('0x15')]['include'],function(_0xa6aeeb){return{'model':db[_0xa6aeeb['model']],'as':_0xa6aeeb['as'],'attributes':_0xa6aeeb[_0xd10a('0x18')],'include':_0xa6aeeb['include']?_['map'](_0xa6aeeb[_0xd10a('0x1a')],function(_0x1bce2b){return{'model':db[_0x1bce2b[_0xd10a('0x1c')]],'as':_0x1bce2b['as'],'attributes':_0x1bce2b['attributes'],'include':_0x1bce2b[_0xd10a('0x1a')]?_['map'](_0x1bce2b[_0xd10a('0x1a')],function(_0x1ab0a2){return{'model':db[_0x1ab0a2[_0xd10a('0x1c')]],'as':_0x1ab0a2['as'],'attributes':_0x1ab0a2[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x22ee6e){logger[_0xd10a('0xa')]('ShowSalesforceAccount',_0x45e9fd);logger[_0xd10a('0xd')](_0xd10a('0x1d'),_0x45e9fd,JSON[_0xd10a('0xe')](_0x22ee6e));_0xd7741(_0x22ee6e);})[_0xd10a('0x13')](function(_0x4997b0){logger[_0xd10a('0xf')](_0xd10a('0x1d'),_0x4997b0[_0xd10a('0x11')],_0x45e9fd);_0x4ad3d4(_0x12ab07['error'](0x1f4,_0x4997b0['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 376e609..d8815d4 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x3c572f,_0x46fdab){var _0x43bcaf=function(_0x58f491){while(--_0x58f491){_0x3c572f['push'](_0x3c572f['shift']());}};_0x43bcaf(++_0x46fdab);}(_0x2ef3,0xba));var _0x32ef=function(_0x5a6bad,_0xaa3b91){_0x5a6bad=_0x5a6bad-0x0;var _0x498f44=_0x2ef3[_0x5a6bad];return _0x498f44;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5d256e,_0x3ad793){var _0x2d1646=function(_0x50b8de){while(--_0x50b8de){_0x5d256e['push'](_0x5d256e['shift']());}};_0x2d1646(++_0x3ad793);}(_0xadb5,0xad));var _0x5adb=function(_0x56965e,_0x37af05){_0x56965e=_0x56965e-0x0;var _0x382ebb=_0xadb5[_0x56965e];return _0x382ebb;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9170ddf..12ee5b9 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 _0xa866=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports'];(function(_0xdb9789,_0x3b7ff5){var _0x3cabf8=function(_0xc4fc2a){while(--_0xc4fc2a){_0xdb9789['push'](_0xdb9789['shift']());}};_0x3cabf8(++_0x3b7ff5);}(_0xa866,0x8e));var _0x6a86=function(_0x30173c,_0x599eb2){_0x30173c=_0x30173c-0x0;var _0x210c49=_0xa866[_0x30173c];return _0x210c49;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6a86('0x2')]},'ticketType':{'type':Sequelize[_0x6a86('0x3')](_0x6a86('0x4'),_0x6a86('0x5')),'defaultValue':_0x6a86('0x4')},'moduleSearch':{'type':Sequelize[_0x6a86('0x3')](_0x6a86('0x6'),_0x6a86('0x7'),_0x6a86('0x8'),_0x6a86('0x9'),_0x6a86('0xa')),'defaultValue':_0x6a86('0x6')},'moduleCreate':{'type':Sequelize[_0x6a86('0x3')](_0x6a86('0xb'),_0x6a86('0x7'),_0x6a86('0x8'),_0x6a86('0xa')),'defaultValue':_0x6a86('0x8')},'leadId':{'type':Sequelize[_0x6a86('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6a86('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x6a86('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x6a86('0x2')]}}; \ No newline at end of file +var _0x6c2a=['STRING','Case','Task','ENUM','contact_lead','contact','account_contact_lead','account','nothing','lead'];(function(_0x1f85f1,_0x2f0f25){var _0x270519=function(_0x535d5b){while(--_0x535d5b){_0x1f85f1['push'](_0x1f85f1['shift']());}};_0x270519(++_0x2f0f25);}(_0x6c2a,0xbe));var _0xa6c2=function(_0x3d0136,_0x4627ad){_0x3d0136=_0x3d0136-0x0;var _0x252020=_0x6c2a[_0x3d0136];return _0x252020;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa6c2('0x0')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0xa6c2('0x1')),'defaultValue':_0xa6c2('0x2')},'moduleSearch':{'type':Sequelize[_0xa6c2('0x3')](_0xa6c2('0x4'),_0xa6c2('0x5'),'lead',_0xa6c2('0x6'),_0xa6c2('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa6c2('0x3')](_0xa6c2('0x8'),_0xa6c2('0x5'),_0xa6c2('0x9'),_0xa6c2('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xa6c2('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xa6c2('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xa6c2('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 68532a0..f0ae01a 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 _0x7576=['find','create','update','body','SalesforceField','getFields','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','destroy','then','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7576,0x1d8));var _0x6757=function(_0x86effe,_0xa5b7b4){_0x86effe=_0x86effe-0x0;var _0x1a3e7d=_0x7576[_0x86effe];return _0x1a3e7d;};'use strict';var emlformat=require(_0x6757('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6757('0x2'));var moment=require(_0x6757('0x3'));var BPromise=require(_0x6757('0x4'));var Mustache=require(_0x6757('0x5'));var util=require(_0x6757('0x6'));var path=require('path');var sox=require(_0x6757('0x7'));var csv=require(_0x6757('0x8'));var ejs=require(_0x6757('0x9'));var fs=require('fs');var fs_extra=require(_0x6757('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6757('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6757('0x8'));var querystring=require(_0x6757('0xc'));var Papa=require(_0x6757('0xd'));var Redis=require(_0x6757('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6757('0xf'));var as=require(_0x6757('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6757('0x11'));var utils=require(_0x6757('0x12'));var config=require(_0x6757('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6757('0x14'))['db'];function respondWithStatusCode(_0x33362d,_0x548eb1){_0x548eb1=_0x548eb1||0xcc;return function(_0x32548f){if(_0x32548f){return _0x33362d[_0x6757('0x15')](_0x548eb1);}return _0x33362d[_0x6757('0x16')](_0x548eb1)[_0x6757('0x17')]();};}function respondWithResult(_0x5279ca,_0x5bdd15){_0x5bdd15=_0x5bdd15||0xc8;return function(_0x5762ad){if(_0x5762ad){return _0x5279ca[_0x6757('0x16')](_0x5bdd15)[_0x6757('0x18')](_0x5762ad);}};}function respondWithFilteredResult(_0x3a10a9,_0x14b564){return function(_0x2b16b7){if(_0x2b16b7){var _0xba31b0=typeof _0x14b564['offset']===_0x6757('0x19')&&typeof _0x14b564['limit']===_0x6757('0x19');var _0x3f8028=_0x2b16b7[_0x6757('0x1a')];var _0x4707da=_0xba31b0?0x0:_0x14b564[_0x6757('0x1b')];var _0x3e1cb8=_0xba31b0?_0x2b16b7[_0x6757('0x1a')]:_0x14b564['offset']+_0x14b564[_0x6757('0x1c')];var _0x32752a;if(_0x3e1cb8>=_0x3f8028){_0x3e1cb8=_0x3f8028;_0x32752a=0xc8;}else{_0x32752a=0xce;}_0x3a10a9[_0x6757('0x16')](_0x32752a);return _0x3a10a9[_0x6757('0x1d')]('Content-Range',_0x4707da+'-'+_0x3e1cb8+'/'+_0x3f8028)['json'](_0x2b16b7);}return null;};}function patchUpdates(_0x49929b){return function(_0x1d5e6f){try{jsonpatch[_0x6757('0x1e')](_0x1d5e6f,_0x49929b,!![]);}catch(_0xbaeb8e){return BPromise[_0x6757('0x1f')](_0xbaeb8e);}return _0x1d5e6f[_0x6757('0x20')]();};}function saveUpdates(_0x2fb4aa,_0x25e609){return function(_0x19940f){if(_0x19940f){return _0x19940f['update'](_0x2fb4aa)['then'](function(_0x1feb2d){return _0x1feb2d;});}return null;};}function removeEntity(_0x23664e,_0x20ddc6){return function(_0x3ed266){if(_0x3ed266){return _0x3ed266[_0x6757('0x21')]()[_0x6757('0x22')](function(){_0x23664e[_0x6757('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e343c,_0x11c51d){return function(_0x2f5015){if(!_0x2f5015){_0x5e343c[_0x6757('0x15')](0x194);}return _0x2f5015;};}function handleError(_0x174229,_0x5b1064){_0x5b1064=_0x5b1064||0x1f4;return function(_0x27e465){logger[_0x6757('0x23')](_0x27e465['stack']);if(_0x27e465[_0x6757('0x24')]){delete _0x27e465[_0x6757('0x24')];}_0x174229[_0x6757('0x16')](_0x5b1064)[_0x6757('0x25')](_0x27e465);};}exports[_0x6757('0x26')]=function(_0x327e7e,_0x3df4c3){var _0x5ab4be={},_0x4fdc5b={},_0x48a9d9={'count':0x0,'rows':[]};var _0x267454=_[_0x6757('0x27')](db[_0x6757('0x28')][_0x6757('0x29')],function(_0x79645f){return{'name':_0x79645f[_0x6757('0x2a')],'type':_0x79645f[_0x6757('0x2b')]['key']};});_0x4fdc5b['model']=_['map'](_0x267454,'name');_0x4fdc5b[_0x6757('0x2c')]=_['keys'](_0x327e7e[_0x6757('0x2c')]);_0x4fdc5b[_0x6757('0x2d')]=_['intersection'](_0x4fdc5b['model'],_0x4fdc5b[_0x6757('0x2c')]);_0x5ab4be[_0x6757('0x2e')]=_[_0x6757('0x2f')](_0x4fdc5b['model'],qs[_0x6757('0x30')](_0x327e7e[_0x6757('0x2c')][_0x6757('0x30')]));_0x5ab4be[_0x6757('0x2e')]=_0x5ab4be[_0x6757('0x2e')][_0x6757('0x31')]?_0x5ab4be['attributes']:_0x4fdc5b[_0x6757('0x32')];if(!_0x327e7e[_0x6757('0x2c')]['hasOwnProperty'](_0x6757('0x33'))){_0x5ab4be[_0x6757('0x1c')]=qs[_0x6757('0x1c')](_0x327e7e['query'][_0x6757('0x1c')]);_0x5ab4be[_0x6757('0x1b')]=qs[_0x6757('0x1b')](_0x327e7e[_0x6757('0x2c')][_0x6757('0x1b')]);}_0x5ab4be[_0x6757('0x34')]=qs[_0x6757('0x35')](_0x327e7e[_0x6757('0x2c')][_0x6757('0x35')]);_0x5ab4be[_0x6757('0x36')]=qs[_0x6757('0x2d')](_[_0x6757('0x37')](_0x327e7e[_0x6757('0x2c')],_0x4fdc5b[_0x6757('0x2d')]),_0x267454);if(_0x327e7e['query'][_0x6757('0x38')]){_0x5ab4be['where']=_[_0x6757('0x39')](_0x5ab4be[_0x6757('0x36')],{'$or':_[_0x6757('0x27')](_0x267454,function(_0x451d8e){if(_0x451d8e[_0x6757('0x2b')]!==_0x6757('0x3a')){var _0x13585c={};_0x13585c[_0x451d8e[_0x6757('0x24')]]={'$like':'%'+_0x327e7e[_0x6757('0x2c')][_0x6757('0x38')]+'%'};return _0x13585c;}})});}_0x5ab4be=_[_0x6757('0x39')]({},_0x5ab4be,_0x327e7e[_0x6757('0x3b')]);var _0x5ef3bf={'where':_0x5ab4be[_0x6757('0x36')]};return db[_0x6757('0x28')][_0x6757('0x1a')](_0x5ef3bf)[_0x6757('0x22')](function(_0x1704e9){_0x48a9d9[_0x6757('0x1a')]=_0x1704e9;if(_0x327e7e[_0x6757('0x2c')][_0x6757('0x3c')]){_0x5ab4be['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x6757('0x3d')](_0x5ab4be);})[_0x6757('0x22')](function(_0x4cbab6){_0x48a9d9[_0x6757('0x3e')]=_0x4cbab6;return _0x48a9d9;})[_0x6757('0x22')](respondWithFilteredResult(_0x3df4c3,_0x5ab4be))[_0x6757('0x3f')](handleError(_0x3df4c3,null));};exports['show']=function(_0x351862,_0x552161){var _0x1e08a3={'raw':![],'where':{'id':_0x351862[_0x6757('0x40')]['id']}},_0x213e6d={};_0x213e6d[_0x6757('0x32')]=_[_0x6757('0x41')](db[_0x6757('0x28')][_0x6757('0x29')]);_0x213e6d[_0x6757('0x2c')]=_[_0x6757('0x41')](_0x351862[_0x6757('0x2c')]);_0x213e6d[_0x6757('0x2d')]=_['intersection'](_0x213e6d[_0x6757('0x32')],_0x213e6d[_0x6757('0x2c')]);_0x1e08a3[_0x6757('0x2e')]=_[_0x6757('0x2f')](_0x213e6d['model'],qs[_0x6757('0x30')](_0x351862[_0x6757('0x2c')][_0x6757('0x30')]));_0x1e08a3[_0x6757('0x2e')]=_0x1e08a3['attributes'][_0x6757('0x31')]?_0x1e08a3['attributes']:_0x213e6d[_0x6757('0x32')];if(_0x351862[_0x6757('0x2c')][_0x6757('0x3c')]){_0x1e08a3[_0x6757('0x42')]=[{'all':!![]}];}_0x1e08a3=_[_0x6757('0x39')]({},_0x1e08a3,_0x351862[_0x6757('0x3b')]);return db[_0x6757('0x28')][_0x6757('0x43')](_0x1e08a3)['then'](handleEntityNotFound(_0x552161,null))[_0x6757('0x22')](respondWithResult(_0x552161,null))[_0x6757('0x3f')](handleError(_0x552161,null));};exports['create']=function(_0x535243,_0x3dfe23){return db['SalesforceConfiguration'][_0x6757('0x44')](_0x535243['body'],{})[_0x6757('0x22')](respondWithResult(_0x3dfe23,0xc9))[_0x6757('0x3f')](handleError(_0x3dfe23,null));};exports[_0x6757('0x45')]=function(_0x36ebaa,_0x58b53a){if(_0x36ebaa['body']['id']){delete _0x36ebaa['body']['id'];}return db[_0x6757('0x28')]['find']({'where':{'id':_0x36ebaa['params']['id']}})['then'](handleEntityNotFound(_0x58b53a,null))[_0x6757('0x22')](saveUpdates(_0x36ebaa[_0x6757('0x46')],null))['then'](respondWithResult(_0x58b53a,null))['catch'](handleError(_0x58b53a,null));};exports[_0x6757('0x21')]=function(_0x5c6581,_0xc23a28){return db[_0x6757('0x28')][_0x6757('0x43')]({'where':{'id':_0x5c6581[_0x6757('0x40')]['id']}})['then'](handleEntityNotFound(_0xc23a28,null))[_0x6757('0x22')](removeEntity(_0xc23a28,null))['catch'](handleError(_0xc23a28,null));};exports['getFields']=function(_0x17e6d3,_0x1b8525,_0x31c8b1){var _0xd31a24={};var _0x46c734={};var _0x1d04f2;var _0x488aa9;return db[_0x6757('0x28')]['findOne']({'where':{'id':_0x17e6d3['params']['id']}})[_0x6757('0x22')](handleEntityNotFound(_0x1b8525,null))[_0x6757('0x22')](function(_0x15314a){if(_0x15314a){_0x1d04f2=_0x15314a;_0x46c734[_0x6757('0x32')]=_[_0x6757('0x41')](db[_0x6757('0x47')][_0x6757('0x29')]);_0x46c734[_0x6757('0x2c')]=_[_0x6757('0x41')](_0x17e6d3[_0x6757('0x2c')]);_0x46c734['filters']=_['intersection'](_0x46c734['model'],_0x46c734['query']);_0xd31a24[_0x6757('0x2e')]=_[_0x6757('0x2f')](_0x46c734[_0x6757('0x32')],qs[_0x6757('0x30')](_0x17e6d3[_0x6757('0x2c')][_0x6757('0x30')]));_0xd31a24[_0x6757('0x2e')]=_0xd31a24['attributes']['length']?_0xd31a24[_0x6757('0x2e')]:_0x46c734[_0x6757('0x32')];_0xd31a24[_0x6757('0x34')]=qs[_0x6757('0x35')](_0x17e6d3[_0x6757('0x2c')][_0x6757('0x35')]);_0xd31a24[_0x6757('0x36')]=qs[_0x6757('0x2d')](_[_0x6757('0x37')](_0x17e6d3['query'],_0x46c734[_0x6757('0x2d')]));if(_0x17e6d3[_0x6757('0x2c')][_0x6757('0x38')]){_0xd31a24[_0x6757('0x36')]=_[_0x6757('0x39')](_0xd31a24['where'],{'$or':_['map'](_0xd31a24[_0x6757('0x2e')],function(_0x3449e0){var _0x532257={};_0x532257[_0x3449e0]={'$like':'%'+_0x17e6d3[_0x6757('0x2c')][_0x6757('0x38')]+'%'};return _0x532257;})});}_0xd31a24=_[_0x6757('0x39')]({},_0xd31a24,_0x17e6d3[_0x6757('0x3b')]);return _0x1d04f2[_0x6757('0x48')](_0xd31a24);}})[_0x6757('0x22')](function(_0x2b441d){if(_0x2b441d){_0x488aa9=_0x2b441d[_0x6757('0x31')];if(!_0x17e6d3[_0x6757('0x2c')]['hasOwnProperty'](_0x6757('0x33'))){_0xd31a24['limit']=qs['limit'](_0x17e6d3[_0x6757('0x2c')][_0x6757('0x1c')]);_0xd31a24[_0x6757('0x1b')]=qs['offset'](_0x17e6d3['query']['offset']);}return _0x1d04f2[_0x6757('0x48')](_0xd31a24);}})['then'](function(_0x537177){if(_0x537177){return _0x537177?{'count':_0x488aa9,'rows':_0x537177}:null;}})[_0x6757('0x22')](respondWithResult(_0x1b8525,null))[_0x6757('0x3f')](handleError(_0x1b8525,null));};exports[_0x6757('0x49')]=function(_0x339772,_0x25e84b,_0x34a95d){var _0x2a261d={};var _0x190bc0={};var _0x205ab9;var _0x2d7c77;return db[_0x6757('0x28')][_0x6757('0x4a')]({'where':{'id':_0x339772['params']['id']}})['then'](handleEntityNotFound(_0x25e84b,null))[_0x6757('0x22')](function(_0x43ca4c){if(_0x43ca4c){_0x205ab9=_0x43ca4c;_0x190bc0[_0x6757('0x32')]=_[_0x6757('0x41')](db['SalesforceField'][_0x6757('0x29')]);_0x190bc0[_0x6757('0x2c')]=_[_0x6757('0x41')](_0x339772[_0x6757('0x2c')]);_0x190bc0[_0x6757('0x2d')]=_['intersection'](_0x190bc0[_0x6757('0x32')],_0x190bc0[_0x6757('0x2c')]);_0x2a261d['attributes']=_[_0x6757('0x2f')](_0x190bc0[_0x6757('0x32')],qs[_0x6757('0x30')](_0x339772[_0x6757('0x2c')][_0x6757('0x30')]));_0x2a261d[_0x6757('0x2e')]=_0x2a261d[_0x6757('0x2e')][_0x6757('0x31')]?_0x2a261d[_0x6757('0x2e')]:_0x190bc0[_0x6757('0x32')];_0x2a261d[_0x6757('0x34')]=qs[_0x6757('0x35')](_0x339772[_0x6757('0x2c')][_0x6757('0x35')]);_0x2a261d[_0x6757('0x36')]=qs[_0x6757('0x2d')](_[_0x6757('0x37')](_0x339772[_0x6757('0x2c')],_0x190bc0[_0x6757('0x2d')]));if(_0x339772[_0x6757('0x2c')]['filter']){_0x2a261d['where']=_[_0x6757('0x39')](_0x2a261d['where'],{'$or':_[_0x6757('0x27')](_0x2a261d[_0x6757('0x2e')],function(_0x5cceb8){var _0xe1d993={};_0xe1d993[_0x5cceb8]={'$like':'%'+_0x339772[_0x6757('0x2c')][_0x6757('0x38')]+'%'};return _0xe1d993;})});}_0x2a261d=_[_0x6757('0x39')]({},_0x2a261d,_0x339772[_0x6757('0x3b')]);return _0x205ab9[_0x6757('0x49')](_0x2a261d);}})[_0x6757('0x22')](function(_0x22f03a){if(_0x22f03a){_0x2d7c77=_0x22f03a[_0x6757('0x31')];if(!_0x339772[_0x6757('0x2c')][_0x6757('0x4b')](_0x6757('0x33'))){_0x2a261d[_0x6757('0x1c')]=qs[_0x6757('0x1c')](_0x339772['query'][_0x6757('0x1c')]);_0x2a261d[_0x6757('0x1b')]=qs[_0x6757('0x1b')](_0x339772['query']['offset']);}return _0x205ab9[_0x6757('0x49')](_0x2a261d);}})['then'](function(_0x8077c9){if(_0x8077c9){return _0x8077c9?{'count':_0x2d7c77,'rows':_0x8077c9}:null;}})[_0x6757('0x22')](respondWithResult(_0x25e84b,null))[_0x6757('0x3f')](handleError(_0x25e84b,null));};exports[_0x6757('0x4c')]=function(_0x7f1c87,_0x97fe30,_0x5c6db8){var _0x4fa866={};var _0x5eb3c7={};var _0x4e383e;var _0x2abd2b;return db[_0x6757('0x28')][_0x6757('0x4a')]({'where':{'id':_0x7f1c87[_0x6757('0x40')]['id']}})[_0x6757('0x22')](handleEntityNotFound(_0x97fe30,null))[_0x6757('0x22')](function(_0x366d99){if(_0x366d99){_0x4e383e=_0x366d99;_0x5eb3c7[_0x6757('0x32')]=_[_0x6757('0x41')](db[_0x6757('0x47')][_0x6757('0x29')]);_0x5eb3c7[_0x6757('0x2c')]=_[_0x6757('0x41')](_0x7f1c87['query']);_0x5eb3c7[_0x6757('0x2d')]=_[_0x6757('0x2f')](_0x5eb3c7[_0x6757('0x32')],_0x5eb3c7['query']);_0x4fa866[_0x6757('0x2e')]=_['intersection'](_0x5eb3c7[_0x6757('0x32')],qs[_0x6757('0x30')](_0x7f1c87[_0x6757('0x2c')][_0x6757('0x30')]));_0x4fa866[_0x6757('0x2e')]=_0x4fa866[_0x6757('0x2e')][_0x6757('0x31')]?_0x4fa866[_0x6757('0x2e')]:_0x5eb3c7[_0x6757('0x32')];_0x4fa866['order']=qs['sort'](_0x7f1c87[_0x6757('0x2c')][_0x6757('0x35')]);_0x4fa866[_0x6757('0x36')]=qs[_0x6757('0x2d')](_[_0x6757('0x37')](_0x7f1c87['query'],_0x5eb3c7[_0x6757('0x2d')]));if(_0x7f1c87[_0x6757('0x2c')][_0x6757('0x38')]){_0x4fa866['where']=_[_0x6757('0x39')](_0x4fa866[_0x6757('0x36')],{'$or':_['map'](_0x4fa866[_0x6757('0x2e')],function(_0x149206){var _0x50db6d={};_0x50db6d[_0x149206]={'$like':'%'+_0x7f1c87[_0x6757('0x2c')][_0x6757('0x38')]+'%'};return _0x50db6d;})});}_0x4fa866=_[_0x6757('0x39')]({},_0x4fa866,_0x7f1c87[_0x6757('0x3b')]);return _0x4e383e['getDescriptions'](_0x4fa866);}})['then'](function(_0x38d002){if(_0x38d002){_0x2abd2b=_0x38d002[_0x6757('0x31')];if(!_0x7f1c87[_0x6757('0x2c')][_0x6757('0x4b')](_0x6757('0x33'))){_0x4fa866[_0x6757('0x1c')]=qs[_0x6757('0x1c')](_0x7f1c87[_0x6757('0x2c')]['limit']);_0x4fa866[_0x6757('0x1b')]=qs[_0x6757('0x1b')](_0x7f1c87[_0x6757('0x2c')][_0x6757('0x1b')]);}return _0x4e383e[_0x6757('0x4c')](_0x4fa866);}})[_0x6757('0x22')](function(_0x4d6a73){if(_0x4d6a73){return _0x4d6a73?{'count':_0x2abd2b,'rows':_0x4d6a73}:null;}})[_0x6757('0x22')](respondWithResult(_0x97fe30,null))[_0x6757('0x3f')](handleError(_0x97fe30,null));}; \ No newline at end of file +var _0x89fe=['destroy','sendStatus','error','stack','send','index','map','SalesforceConfiguration','rawAttributes','type','key','name','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','getFields','getSubjects','findOne','SalesforceField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0xec5e51,_0x163908){var _0x3b42f4=function(_0x43bd7d){while(--_0x43bd7d){_0xec5e51['push'](_0xec5e51['shift']());}};_0x3b42f4(++_0x163908);}(_0x89fe,0x83));var _0xe89f=function(_0x56519b,_0x55664c){_0x56519b=_0x56519b-0x0;var _0x5eed16=_0x89fe[_0x56519b];return _0x5eed16;};'use strict';var emlformat=require(_0xe89f('0x0'));var rimraf=require(_0xe89f('0x1'));var zipdir=require(_0xe89f('0x2'));var jsonpatch=require(_0xe89f('0x3'));var rp=require('request-promise');var moment=require(_0xe89f('0x4'));var BPromise=require(_0xe89f('0x5'));var Mustache=require('mustache');var util=require(_0xe89f('0x6'));var path=require(_0xe89f('0x7'));var sox=require(_0xe89f('0x8'));var csv=require(_0xe89f('0x9'));var ejs=require(_0xe89f('0xa'));var fs=require('fs');var fs_extra=require(_0xe89f('0xb'));var _=require(_0xe89f('0xc'));var squel=require('squel');var crypto=require(_0xe89f('0xd'));var jsforce=require(_0xe89f('0xe'));var deskjs=require(_0xe89f('0xf'));var toCsv=require(_0xe89f('0x9'));var querystring=require(_0xe89f('0x10'));var Papa=require('papaparse');var Redis=require(_0xe89f('0x11'));var authService=require(_0xe89f('0x12'));var qs=require(_0xe89f('0x13'));var as=require(_0xe89f('0x14'));var hardwareService=require(_0xe89f('0x15'));var logger=require(_0xe89f('0x16'))(_0xe89f('0x17'));var utils=require(_0xe89f('0x18'));var config=require(_0xe89f('0x19'));var licenseUtil=require(_0xe89f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b6fc7,_0x548a3b){_0x548a3b=_0x548a3b||0xcc;return function(_0x4976a1){if(_0x4976a1){return _0x4b6fc7['sendStatus'](_0x548a3b);}return _0x4b6fc7[_0xe89f('0x1b')](_0x548a3b)[_0xe89f('0x1c')]();};}function respondWithResult(_0x4919f2,_0x489ef2){_0x489ef2=_0x489ef2||0xc8;return function(_0x4617e7){if(_0x4617e7){return _0x4919f2[_0xe89f('0x1b')](_0x489ef2)[_0xe89f('0x1d')](_0x4617e7);}};}function respondWithFilteredResult(_0x45d41e,_0xf1d0bf){return function(_0x2c82c3){if(_0x2c82c3){var _0x38050e=typeof _0xf1d0bf[_0xe89f('0x1e')]===_0xe89f('0x1f')&&typeof _0xf1d0bf[_0xe89f('0x20')]==='undefined';var _0x23f097=_0x2c82c3[_0xe89f('0x21')];var _0x510e6e=_0x38050e?0x0:_0xf1d0bf['offset'];var _0x11e5e1=_0x38050e?_0x2c82c3[_0xe89f('0x21')]:_0xf1d0bf[_0xe89f('0x1e')]+_0xf1d0bf[_0xe89f('0x20')];var _0xff80f5;if(_0x11e5e1>=_0x23f097){_0x11e5e1=_0x23f097;_0xff80f5=0xc8;}else{_0xff80f5=0xce;}_0x45d41e['status'](_0xff80f5);return _0x45d41e['set'](_0xe89f('0x22'),_0x510e6e+'-'+_0x11e5e1+'/'+_0x23f097)['json'](_0x2c82c3);}return null;};}function patchUpdates(_0x237718){return function(_0x33c584){try{jsonpatch[_0xe89f('0x23')](_0x33c584,_0x237718,!![]);}catch(_0x24715c){return BPromise[_0xe89f('0x24')](_0x24715c);}return _0x33c584[_0xe89f('0x25')]();};}function saveUpdates(_0x21dc02,_0x559d84){return function(_0x415505){if(_0x415505){return _0x415505[_0xe89f('0x26')](_0x21dc02)['then'](function(_0x4fc334){return _0x4fc334;});}return null;};}function removeEntity(_0x18b52e,_0x5b548d){return function(_0x24878d){if(_0x24878d){return _0x24878d[_0xe89f('0x27')]()['then'](function(){_0x18b52e[_0xe89f('0x1b')](0xcc)[_0xe89f('0x1c')]();});}};}function handleEntityNotFound(_0x5b3135,_0x5d7bff){return function(_0x2bd661){if(!_0x2bd661){_0x5b3135[_0xe89f('0x28')](0x194);}return _0x2bd661;};}function handleError(_0x312ad8,_0x29b9ff){_0x29b9ff=_0x29b9ff||0x1f4;return function(_0x288d8f){logger[_0xe89f('0x29')](_0x288d8f[_0xe89f('0x2a')]);if(_0x288d8f['name']){delete _0x288d8f['name'];}_0x312ad8[_0xe89f('0x1b')](_0x29b9ff)[_0xe89f('0x2b')](_0x288d8f);};}exports[_0xe89f('0x2c')]=function(_0xed3fc9,_0x26604a){var _0x5cf085={},_0x3c773c={},_0x31f4ec={'count':0x0,'rows':[]};var _0x29f7c2=_[_0xe89f('0x2d')](db[_0xe89f('0x2e')][_0xe89f('0x2f')],function(_0x1df269){return{'name':_0x1df269['fieldName'],'type':_0x1df269[_0xe89f('0x30')][_0xe89f('0x31')]};});_0x3c773c['model']=_[_0xe89f('0x2d')](_0x29f7c2,_0xe89f('0x32'));_0x3c773c[_0xe89f('0x33')]=_[_0xe89f('0x34')](_0xed3fc9[_0xe89f('0x33')]);_0x3c773c[_0xe89f('0x35')]=_['intersection'](_0x3c773c[_0xe89f('0x36')],_0x3c773c[_0xe89f('0x33')]);_0x5cf085['attributes']=_[_0xe89f('0x37')](_0x3c773c[_0xe89f('0x36')],qs[_0xe89f('0x38')](_0xed3fc9[_0xe89f('0x33')][_0xe89f('0x38')]));_0x5cf085[_0xe89f('0x39')]=_0x5cf085[_0xe89f('0x39')][_0xe89f('0x3a')]?_0x5cf085[_0xe89f('0x39')]:_0x3c773c[_0xe89f('0x36')];if(!_0xed3fc9[_0xe89f('0x33')][_0xe89f('0x3b')](_0xe89f('0x3c'))){_0x5cf085[_0xe89f('0x20')]=qs['limit'](_0xed3fc9[_0xe89f('0x33')]['limit']);_0x5cf085[_0xe89f('0x1e')]=qs[_0xe89f('0x1e')](_0xed3fc9['query'][_0xe89f('0x1e')]);}_0x5cf085['order']=qs[_0xe89f('0x3d')](_0xed3fc9[_0xe89f('0x33')][_0xe89f('0x3d')]);_0x5cf085[_0xe89f('0x3e')]=qs[_0xe89f('0x35')](_[_0xe89f('0x3f')](_0xed3fc9[_0xe89f('0x33')],_0x3c773c['filters']),_0x29f7c2);if(_0xed3fc9[_0xe89f('0x33')][_0xe89f('0x40')]){_0x5cf085['where']=_[_0xe89f('0x41')](_0x5cf085[_0xe89f('0x3e')],{'$or':_['map'](_0x29f7c2,function(_0xe7df71){if(_0xe7df71[_0xe89f('0x30')]!==_0xe89f('0x42')){var _0x279c6f={};_0x279c6f[_0xe7df71[_0xe89f('0x32')]]={'$like':'%'+_0xed3fc9[_0xe89f('0x33')][_0xe89f('0x40')]+'%'};return _0x279c6f;}})});}_0x5cf085=_[_0xe89f('0x41')]({},_0x5cf085,_0xed3fc9[_0xe89f('0x43')]);var _0x15b536={'where':_0x5cf085[_0xe89f('0x3e')]};return db[_0xe89f('0x2e')][_0xe89f('0x21')](_0x15b536)['then'](function(_0x3d612b){_0x31f4ec[_0xe89f('0x21')]=_0x3d612b;if(_0xed3fc9['query'][_0xe89f('0x44')]){_0x5cf085[_0xe89f('0x45')]=[{'all':!![]}];}return db[_0xe89f('0x2e')][_0xe89f('0x46')](_0x5cf085);})[_0xe89f('0x47')](function(_0xe7be2f){_0x31f4ec[_0xe89f('0x48')]=_0xe7be2f;return _0x31f4ec;})[_0xe89f('0x47')](respondWithFilteredResult(_0x26604a,_0x5cf085))[_0xe89f('0x49')](handleError(_0x26604a,null));};exports[_0xe89f('0x4a')]=function(_0x397e8d,_0x2a0567){var _0x2b4229={'raw':![],'where':{'id':_0x397e8d[_0xe89f('0x4b')]['id']}},_0x1926f2={};_0x1926f2[_0xe89f('0x36')]=_[_0xe89f('0x34')](db[_0xe89f('0x2e')][_0xe89f('0x2f')]);_0x1926f2['query']=_[_0xe89f('0x34')](_0x397e8d[_0xe89f('0x33')]);_0x1926f2[_0xe89f('0x35')]=_['intersection'](_0x1926f2[_0xe89f('0x36')],_0x1926f2[_0xe89f('0x33')]);_0x2b4229[_0xe89f('0x39')]=_[_0xe89f('0x37')](_0x1926f2[_0xe89f('0x36')],qs[_0xe89f('0x38')](_0x397e8d[_0xe89f('0x33')][_0xe89f('0x38')]));_0x2b4229[_0xe89f('0x39')]=_0x2b4229[_0xe89f('0x39')][_0xe89f('0x3a')]?_0x2b4229[_0xe89f('0x39')]:_0x1926f2[_0xe89f('0x36')];if(_0x397e8d[_0xe89f('0x33')][_0xe89f('0x44')]){_0x2b4229[_0xe89f('0x45')]=[{'all':!![]}];}_0x2b4229=_[_0xe89f('0x41')]({},_0x2b4229,_0x397e8d[_0xe89f('0x43')]);return db[_0xe89f('0x2e')][_0xe89f('0x4c')](_0x2b4229)[_0xe89f('0x47')](handleEntityNotFound(_0x2a0567,null))[_0xe89f('0x47')](respondWithResult(_0x2a0567,null))[_0xe89f('0x49')](handleError(_0x2a0567,null));};exports[_0xe89f('0x4d')]=function(_0x2524c1,_0x2d19a7){return db[_0xe89f('0x2e')][_0xe89f('0x4d')](_0x2524c1[_0xe89f('0x4e')],{})['then'](respondWithResult(_0x2d19a7,0xc9))[_0xe89f('0x49')](handleError(_0x2d19a7,null));};exports[_0xe89f('0x26')]=function(_0x41e6f1,_0x2143ef){if(_0x41e6f1['body']['id']){delete _0x41e6f1[_0xe89f('0x4e')]['id'];}return db[_0xe89f('0x2e')]['find']({'where':{'id':_0x41e6f1['params']['id']}})[_0xe89f('0x47')](handleEntityNotFound(_0x2143ef,null))['then'](saveUpdates(_0x41e6f1[_0xe89f('0x4e')],null))[_0xe89f('0x47')](respondWithResult(_0x2143ef,null))[_0xe89f('0x49')](handleError(_0x2143ef,null));};exports['destroy']=function(_0x28dba0,_0x362855){return db[_0xe89f('0x2e')][_0xe89f('0x4c')]({'where':{'id':_0x28dba0[_0xe89f('0x4b')]['id']}})[_0xe89f('0x47')](handleEntityNotFound(_0x362855,null))[_0xe89f('0x47')](removeEntity(_0x362855,null))[_0xe89f('0x49')](handleError(_0x362855,null));};exports[_0xe89f('0x4f')]=function(_0x461f8c,_0x864d13,_0xbac93c){var _0x43a5b9={};var _0x33aee6={};var _0x37b7cc;var _0x28076c;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x461f8c[_0xe89f('0x4b')]['id']}})[_0xe89f('0x47')](handleEntityNotFound(_0x864d13,null))[_0xe89f('0x47')](function(_0x1df43e){if(_0x1df43e){_0x37b7cc=_0x1df43e;_0x33aee6[_0xe89f('0x36')]=_['keys'](db['SalesforceField'][_0xe89f('0x2f')]);_0x33aee6[_0xe89f('0x33')]=_[_0xe89f('0x34')](_0x461f8c[_0xe89f('0x33')]);_0x33aee6['filters']=_['intersection'](_0x33aee6[_0xe89f('0x36')],_0x33aee6['query']);_0x43a5b9['attributes']=_[_0xe89f('0x37')](_0x33aee6['model'],qs[_0xe89f('0x38')](_0x461f8c[_0xe89f('0x33')][_0xe89f('0x38')]));_0x43a5b9[_0xe89f('0x39')]=_0x43a5b9[_0xe89f('0x39')][_0xe89f('0x3a')]?_0x43a5b9[_0xe89f('0x39')]:_0x33aee6[_0xe89f('0x36')];_0x43a5b9['order']=qs[_0xe89f('0x3d')](_0x461f8c[_0xe89f('0x33')][_0xe89f('0x3d')]);_0x43a5b9[_0xe89f('0x3e')]=qs['filters'](_[_0xe89f('0x3f')](_0x461f8c[_0xe89f('0x33')],_0x33aee6[_0xe89f('0x35')]));if(_0x461f8c[_0xe89f('0x33')][_0xe89f('0x40')]){_0x43a5b9[_0xe89f('0x3e')]=_[_0xe89f('0x41')](_0x43a5b9[_0xe89f('0x3e')],{'$or':_[_0xe89f('0x2d')](_0x43a5b9[_0xe89f('0x39')],function(_0x5296bd){var _0x20c1e2={};_0x20c1e2[_0x5296bd]={'$like':'%'+_0x461f8c[_0xe89f('0x33')][_0xe89f('0x40')]+'%'};return _0x20c1e2;})});}_0x43a5b9=_[_0xe89f('0x41')]({},_0x43a5b9,_0x461f8c[_0xe89f('0x43')]);return _0x37b7cc[_0xe89f('0x4f')](_0x43a5b9);}})['then'](function(_0x5865e1){if(_0x5865e1){_0x28076c=_0x5865e1['length'];if(!_0x461f8c[_0xe89f('0x33')][_0xe89f('0x3b')]('nolimit')){_0x43a5b9[_0xe89f('0x20')]=qs[_0xe89f('0x20')](_0x461f8c[_0xe89f('0x33')]['limit']);_0x43a5b9[_0xe89f('0x1e')]=qs[_0xe89f('0x1e')](_0x461f8c[_0xe89f('0x33')][_0xe89f('0x1e')]);}return _0x37b7cc['getFields'](_0x43a5b9);}})[_0xe89f('0x47')](function(_0x2e5bbd){if(_0x2e5bbd){return _0x2e5bbd?{'count':_0x28076c,'rows':_0x2e5bbd}:null;}})['then'](respondWithResult(_0x864d13,null))[_0xe89f('0x49')](handleError(_0x864d13,null));};exports[_0xe89f('0x50')]=function(_0x29dc12,_0x489f58,_0x3d82af){var _0x569386={};var _0x38346d={};var _0xf8ad55;var _0x420455;return db['SalesforceConfiguration'][_0xe89f('0x51')]({'where':{'id':_0x29dc12['params']['id']}})[_0xe89f('0x47')](handleEntityNotFound(_0x489f58,null))['then'](function(_0x417ac0){if(_0x417ac0){_0xf8ad55=_0x417ac0;_0x38346d[_0xe89f('0x36')]=_[_0xe89f('0x34')](db[_0xe89f('0x52')]['rawAttributes']);_0x38346d[_0xe89f('0x33')]=_[_0xe89f('0x34')](_0x29dc12[_0xe89f('0x33')]);_0x38346d['filters']=_['intersection'](_0x38346d[_0xe89f('0x36')],_0x38346d[_0xe89f('0x33')]);_0x569386[_0xe89f('0x39')]=_['intersection'](_0x38346d[_0xe89f('0x36')],qs['fields'](_0x29dc12[_0xe89f('0x33')][_0xe89f('0x38')]));_0x569386[_0xe89f('0x39')]=_0x569386['attributes'][_0xe89f('0x3a')]?_0x569386[_0xe89f('0x39')]:_0x38346d[_0xe89f('0x36')];_0x569386[_0xe89f('0x53')]=qs[_0xe89f('0x3d')](_0x29dc12[_0xe89f('0x33')][_0xe89f('0x3d')]);_0x569386[_0xe89f('0x3e')]=qs[_0xe89f('0x35')](_[_0xe89f('0x3f')](_0x29dc12['query'],_0x38346d[_0xe89f('0x35')]));if(_0x29dc12[_0xe89f('0x33')][_0xe89f('0x40')]){_0x569386['where']=_[_0xe89f('0x41')](_0x569386['where'],{'$or':_[_0xe89f('0x2d')](_0x569386['attributes'],function(_0x134e73){var _0x494fc4={};_0x494fc4[_0x134e73]={'$like':'%'+_0x29dc12['query'][_0xe89f('0x40')]+'%'};return _0x494fc4;})});}_0x569386=_[_0xe89f('0x41')]({},_0x569386,_0x29dc12[_0xe89f('0x43')]);return _0xf8ad55[_0xe89f('0x50')](_0x569386);}})[_0xe89f('0x47')](function(_0x2d3fda){if(_0x2d3fda){_0x420455=_0x2d3fda[_0xe89f('0x3a')];if(!_0x29dc12[_0xe89f('0x33')][_0xe89f('0x3b')]('nolimit')){_0x569386['limit']=qs[_0xe89f('0x20')](_0x29dc12[_0xe89f('0x33')]['limit']);_0x569386[_0xe89f('0x1e')]=qs[_0xe89f('0x1e')](_0x29dc12[_0xe89f('0x33')][_0xe89f('0x1e')]);}return _0xf8ad55['getSubjects'](_0x569386);}})[_0xe89f('0x47')](function(_0x1d82f5){if(_0x1d82f5){return _0x1d82f5?{'count':_0x420455,'rows':_0x1d82f5}:null;}})['then'](respondWithResult(_0x489f58,null))[_0xe89f('0x49')](handleError(_0x489f58,null));};exports[_0xe89f('0x54')]=function(_0x1d14b1,_0x17b6f9,_0x4e6a58){var _0x666f16={};var _0x2fed51={};var _0x557ddf;var _0x4be009;return db[_0xe89f('0x2e')][_0xe89f('0x51')]({'where':{'id':_0x1d14b1[_0xe89f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17b6f9,null))[_0xe89f('0x47')](function(_0x42a5a7){if(_0x42a5a7){_0x557ddf=_0x42a5a7;_0x2fed51[_0xe89f('0x36')]=_['keys'](db[_0xe89f('0x52')][_0xe89f('0x2f')]);_0x2fed51[_0xe89f('0x33')]=_['keys'](_0x1d14b1['query']);_0x2fed51['filters']=_[_0xe89f('0x37')](_0x2fed51[_0xe89f('0x36')],_0x2fed51['query']);_0x666f16[_0xe89f('0x39')]=_['intersection'](_0x2fed51[_0xe89f('0x36')],qs[_0xe89f('0x38')](_0x1d14b1['query'][_0xe89f('0x38')]));_0x666f16['attributes']=_0x666f16[_0xe89f('0x39')][_0xe89f('0x3a')]?_0x666f16[_0xe89f('0x39')]:_0x2fed51[_0xe89f('0x36')];_0x666f16[_0xe89f('0x53')]=qs['sort'](_0x1d14b1[_0xe89f('0x33')][_0xe89f('0x3d')]);_0x666f16[_0xe89f('0x3e')]=qs[_0xe89f('0x35')](_[_0xe89f('0x3f')](_0x1d14b1[_0xe89f('0x33')],_0x2fed51[_0xe89f('0x35')]));if(_0x1d14b1[_0xe89f('0x33')][_0xe89f('0x40')]){_0x666f16['where']=_[_0xe89f('0x41')](_0x666f16['where'],{'$or':_[_0xe89f('0x2d')](_0x666f16[_0xe89f('0x39')],function(_0x44a8a8){var _0x3ba95f={};_0x3ba95f[_0x44a8a8]={'$like':'%'+_0x1d14b1[_0xe89f('0x33')][_0xe89f('0x40')]+'%'};return _0x3ba95f;})});}_0x666f16=_['merge']({},_0x666f16,_0x1d14b1['options']);return _0x557ddf['getDescriptions'](_0x666f16);}})[_0xe89f('0x47')](function(_0x12a7ef){if(_0x12a7ef){_0x4be009=_0x12a7ef[_0xe89f('0x3a')];if(!_0x1d14b1['query'][_0xe89f('0x3b')](_0xe89f('0x3c'))){_0x666f16[_0xe89f('0x20')]=qs[_0xe89f('0x20')](_0x1d14b1[_0xe89f('0x33')][_0xe89f('0x20')]);_0x666f16[_0xe89f('0x1e')]=qs[_0xe89f('0x1e')](_0x1d14b1[_0xe89f('0x33')][_0xe89f('0x1e')]);}return _0x557ddf[_0xe89f('0x54')](_0x666f16);}})[_0xe89f('0x47')](function(_0x21e851){if(_0x21e851){return _0x21e851?{'count':_0x4be009,'rows':_0x21e851}:null;}})[_0xe89f('0x47')](respondWithResult(_0x17b6f9,null))[_0xe89f('0x49')](handleError(_0x17b6f9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 4b22247..4e7a4a0 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 _0x1c6e=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1c6e,0x16b));var _0xe1c6=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0x1c6e[_0x10bcc4];return _0x2da988;};'use strict';var _=require(_0xe1c6('0x0'));var util=require(_0xe1c6('0x1'));var logger=require(_0xe1c6('0x2'))('api');var moment=require(_0xe1c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xe1c6('0x4'));var fs=require('fs');var path=require(_0xe1c6('0x5'));var rimraf=require(_0xe1c6('0x6'));var config=require(_0xe1c6('0x7'));var attributes=require(_0xe1c6('0x8'));module['exports']=function(_0x5d1043,_0x54af9b){return _0x5d1043[_0xe1c6('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xe1c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5f4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x26c551,_0x3e08bd){var _0x149d66=function(_0x211994){while(--_0x211994){_0x26c551['push'](_0x26c551['shift']());}};_0x149d66(++_0x3e08bd);}(_0xb5f4,0x178));var _0x4b5f=function(_0x573200,_0xb5aa49){_0x573200=_0x573200-0x0;var _0x2a53b6=_0xb5f4[_0x573200];return _0x2a53b6;};'use strict';var _=require(_0x4b5f('0x0'));var util=require(_0x4b5f('0x1'));var logger=require(_0x4b5f('0x2'))(_0x4b5f('0x3'));var moment=require(_0x4b5f('0x4'));var BPromise=require(_0x4b5f('0x5'));var rp=require(_0x4b5f('0x6'));var fs=require('fs');var path=require(_0x4b5f('0x7'));var rimraf=require(_0x4b5f('0x8'));var config=require(_0x4b5f('0x9'));var attributes=require(_0x4b5f('0xa'));module['exports']=function(_0x4d2ad4,_0x194280){return _0x4d2ad4[_0x4b5f('0xb')](_0x4b5f('0xc'),attributes,{'tableName':_0x4b5f('0xd'),'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 ba04edd..07bdbf8 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 _0xac77=['client','http','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4e4f14,_0x29526a){var _0x28e816=function(_0x4170fc){while(--_0x4170fc){_0x4e4f14['push'](_0x4e4f14['shift']());}};_0x28e816(++_0x29526a);}(_0xac77,0xc1));var _0x7ac7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xac77[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x7ac7('0x0'));var util=require(_0x7ac7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ac7('0x2'));var db=require(_0x7ac7('0x3'))['db'];var utils=require(_0x7ac7('0x4'));var logger=require(_0x7ac7('0x5'))(_0x7ac7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ac7('0x7')][_0x7ac7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38d08a,_0x5bd6d9,_0x4336cb){return new BPromise(function(_0x226f01,_0x198b3f){return client['request'](_0x38d08a,_0x4336cb)[_0x7ac7('0x9')](function(_0x4522a5){logger[_0x7ac7('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5bd6d9,_0x7ac7('0xb'));logger[_0x7ac7('0xc')](_0x7ac7('0xd'),_0x5bd6d9,_0x7ac7('0xb'),JSON[_0x7ac7('0xe')](_0x4522a5));if(_0x4522a5[_0x7ac7('0xf')]){if(_0x4522a5[_0x7ac7('0xf')]['code']===0x1f4){logger['error'](_0x7ac7('0x10'),_0x5bd6d9,_0x4522a5[_0x7ac7('0xf')][_0x7ac7('0x11')]);return _0x198b3f(_0x4522a5['error'][_0x7ac7('0x11')]);}logger[_0x7ac7('0xf')](_0x7ac7('0x10'),_0x5bd6d9,_0x4522a5[_0x7ac7('0xf')][_0x7ac7('0x11')]);return _0x226f01(_0x4522a5['error'][_0x7ac7('0x11')]);}else{logger[_0x7ac7('0xa')](_0x7ac7('0x10'),_0x5bd6d9,'request\x20sent');_0x226f01(_0x4522a5[_0x7ac7('0x12')][_0x7ac7('0x11')]);}})[_0x7ac7('0x13')](function(_0x593a0c){logger[_0x7ac7('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5bd6d9,_0x593a0c);_0x198b3f(_0x593a0c);});});} \ No newline at end of file +var _0xd343=['client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\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'];(function(_0x4bb3de,_0x230ba2){var _0xe27505=function(_0x42c474){while(--_0x42c474){_0x4bb3de['push'](_0x4bb3de['shift']());}};_0xe27505(++_0x230ba2);}(_0xd343,0xa6));var _0x3d34=function(_0x371db9,_0x238289){_0x371db9=_0x371db9-0x0;var _0xbf8000=_0xd343[_0x371db9];return _0xbf8000;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3d34('0x0'));var BPromise=require(_0x3d34('0x1'));var rs=require(_0x3d34('0x2'));var fs=require('fs');var Redis=require(_0x3d34('0x3'));var db=require(_0x3d34('0x4'))['db'];var utils=require(_0x3d34('0x5'));var logger=require(_0x3d34('0x6'))(_0x3d34('0x7'));var config=require(_0x3d34('0x8'));var jayson=require(_0x3d34('0x9'));var client=jayson[_0x3d34('0xa')][_0x3d34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2169a9,_0x164b42,_0x479edf){return new BPromise(function(_0xe13b78,_0x29ae63){return client['request'](_0x2169a9,_0x479edf)[_0x3d34('0xc')](function(_0x354d00){logger['info'](_0x3d34('0xd'),_0x164b42,_0x3d34('0xe'));logger['debug'](_0x3d34('0xf'),_0x164b42,'request\x20sent',JSON[_0x3d34('0x10')](_0x354d00));if(_0x354d00[_0x3d34('0x11')]){if(_0x354d00[_0x3d34('0x11')][_0x3d34('0x12')]===0x1f4){logger['error'](_0x3d34('0xd'),_0x164b42,_0x354d00['error']['message']);return _0x29ae63(_0x354d00[_0x3d34('0x11')][_0x3d34('0x13')]);}logger[_0x3d34('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x164b42,_0x354d00[_0x3d34('0x11')]['message']);return _0xe13b78(_0x354d00[_0x3d34('0x11')][_0x3d34('0x13')]);}else{logger['info'](_0x3d34('0xd'),_0x164b42,'request\x20sent');_0xe13b78(_0x354d00[_0x3d34('0x14')][_0x3d34('0x13')]);}})[_0x3d34('0x15')](function(_0xf1737d){logger[_0x3d34('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x164b42,_0xf1737d);_0x29ae63(_0xf1737d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index be088a8..03a8d8e 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 _0x7ca6=['delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x13d481,_0x3f4eae){var _0x35294c=function(_0x5a2b48){while(--_0x5a2b48){_0x13d481['push'](_0x13d481['shift']());}};_0x35294c(++_0x3f4eae);}(_0x7ca6,0x1b2));var _0x67ca=function(_0x53936a,_0x12f660){_0x53936a=_0x53936a-0x0;var _0xa7162a=_0x7ca6[_0x53936a];return _0xa7162a;};'use strict';var multer=require(_0x67ca('0x0'));var util=require('util');var path=require(_0x67ca('0x1'));var timeout=require(_0x67ca('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x67ca('0x3'));var auth=require(_0x67ca('0x4'));var interaction=require(_0x67ca('0x5'));var config=require(_0x67ca('0x6'));var controller=require(_0x67ca('0x7'));router[_0x67ca('0x8')]('/',auth[_0x67ca('0x9')](),controller['index']);router['get'](_0x67ca('0xa'),auth['isAuthenticated'](),controller[_0x67ca('0xb')]);router[_0x67ca('0xc')]('/',auth[_0x67ca('0x9')](),controller[_0x67ca('0xd')]);router[_0x67ca('0xe')](_0x67ca('0xa'),auth[_0x67ca('0x9')](),controller[_0x67ca('0xf')]);router[_0x67ca('0x10')](_0x67ca('0xa'),auth[_0x67ca('0x9')](),controller[_0x67ca('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6235=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x84a189,_0x323ae4){var _0x476af8=function(_0x52e014){while(--_0x52e014){_0x84a189['push'](_0x84a189['shift']());}};_0x476af8(++_0x323ae4);}(_0x6235,0x15d));var _0x5623=function(_0x27bed7,_0x34b899){_0x27bed7=_0x27bed7-0x0;var _0x25c0b9=_0x6235[_0x27bed7];return _0x25c0b9;};'use strict';var multer=require(_0x5623('0x0'));var util=require('util');var path=require(_0x5623('0x1'));var timeout=require(_0x5623('0x2'));var express=require(_0x5623('0x3'));var router=express[_0x5623('0x4')]();var fs_extra=require(_0x5623('0x5'));var auth=require(_0x5623('0x6'));var interaction=require(_0x5623('0x7'));var config=require(_0x5623('0x8'));var controller=require(_0x5623('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5623('0xa')](_0x5623('0xb'),auth[_0x5623('0xc')](),controller[_0x5623('0xd')]);router[_0x5623('0xe')]('/',auth[_0x5623('0xc')](),controller[_0x5623('0xf')]);router[_0x5623('0x10')](_0x5623('0xb'),auth[_0x5623('0xc')](),controller[_0x5623('0x11')]);router[_0x5623('0x12')](_0x5623('0xb'),auth[_0x5623('0xc')](),controller[_0x5623('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 687ba37..89cfdbf 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 _0x4438=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x3832cd,_0x11aca2){var _0x4176a2=function(_0x3a06c3){while(--_0x3a06c3){_0x3832cd['push'](_0x3832cd['shift']());}};_0x4176a2(++_0x11aca2);}(_0x4438,0x172));var _0x8443=function(_0x303962,_0x4febc7){_0x303962=_0x303962-0x0;var _0x393675=_0x4438[_0x303962];return _0x393675;};'use strict';var Sequelize=require(_0x8443('0x0'));module['exports']={'type':{'type':Sequelize[_0x8443('0x1')](_0x8443('0x2'),_0x8443('0x3'),_0x8443('0x4'),_0x8443('0x5'),'picklist'),'defaultValue':_0x8443('0x2')},'content':{'type':Sequelize[_0x8443('0x6')]},'key':{'type':Sequelize[_0x8443('0x6')]},'keyType':{'type':Sequelize[_0x8443('0x1')](_0x8443('0x2'),_0x8443('0x3'),_0x8443('0x4'))},'keyContent':{'type':Sequelize[_0x8443('0x6')]},'idField':{'type':Sequelize[_0x8443('0x6')]},'variableName':{'type':Sequelize[_0x8443('0x6')]}}; \ No newline at end of file +var _0x1c16=['exports','ENUM','string','customVariable','keyValue','STRING','sequelize'];(function(_0x1f754a,_0x38709f){var _0x4b1c93=function(_0x4e90e0){while(--_0x4e90e0){_0x1f754a['push'](_0x1f754a['shift']());}};_0x4b1c93(++_0x38709f);}(_0x1c16,0xe6));var _0x61c1=function(_0x5dcae8,_0x14040a){_0x5dcae8=_0x5dcae8-0x0;var _0xa7a0c6=_0x1c16[_0x5dcae8];return _0xa7a0c6;};'use strict';var Sequelize=require(_0x61c1('0x0'));module[_0x61c1('0x1')]={'type':{'type':Sequelize[_0x61c1('0x2')](_0x61c1('0x3'),'variable',_0x61c1('0x4'),_0x61c1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x61c1('0x6')]},'key':{'type':Sequelize[_0x61c1('0x6')]},'keyType':{'type':Sequelize[_0x61c1('0x2')](_0x61c1('0x3'),'variable',_0x61c1('0x4'))},'keyContent':{'type':Sequelize[_0x61c1('0x6')]},'idField':{'type':Sequelize[_0x61c1('0x6')]},'variableName':{'type':Sequelize[_0x61c1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7dac517..953fad0 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 _0x733f=['keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','then','includeAll','SalesforceField','findAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query'];(function(_0x12329c,_0x15eb78){var _0x5ab816=function(_0x57dc1b){while(--_0x57dc1b){_0x12329c['push'](_0x12329c['shift']());}};_0x5ab816(++_0x15eb78);}(_0x733f,0xb5));var _0xf733=function(_0x2e223b,_0x354b69){_0x2e223b=_0x2e223b-0x0;var _0x50aabd=_0x733f[_0x2e223b];return _0x50aabd;};'use strict';var emlformat=require(_0xf733('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf733('0x1'));var jsonpatch=require(_0xf733('0x2'));var rp=require(_0xf733('0x3'));var moment=require(_0xf733('0x4'));var BPromise=require(_0xf733('0x5'));var Mustache=require(_0xf733('0x6'));var util=require('util');var path=require(_0xf733('0x7'));var sox=require(_0xf733('0x8'));var csv=require(_0xf733('0x9'));var ejs=require(_0xf733('0xa'));var fs=require('fs');var fs_extra=require(_0xf733('0xb'));var _=require(_0xf733('0xc'));var squel=require(_0xf733('0xd'));var crypto=require(_0xf733('0xe'));var jsforce=require(_0xf733('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf733('0x9'));var querystring=require(_0xf733('0x10'));var Papa=require(_0xf733('0x11'));var Redis=require(_0xf733('0x12'));var authService=require(_0xf733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf733('0x14'));var hardwareService=require(_0xf733('0x15'));var logger=require(_0xf733('0x16'))(_0xf733('0x17'));var utils=require(_0xf733('0x18'));var config=require(_0xf733('0x19'));var licenseUtil=require(_0xf733('0x1a'));var db=require(_0xf733('0x1b'))['db'];function respondWithStatusCode(_0x43ee32,_0x4f7f0b){_0x4f7f0b=_0x4f7f0b||0xcc;return function(_0x489850){if(_0x489850){return _0x43ee32[_0xf733('0x1c')](_0x4f7f0b);}return _0x43ee32['status'](_0x4f7f0b)['end']();};}function respondWithResult(_0x2cd97d,_0x20ac1c){_0x20ac1c=_0x20ac1c||0xc8;return function(_0x488597){if(_0x488597){return _0x2cd97d[_0xf733('0x1d')](_0x20ac1c)[_0xf733('0x1e')](_0x488597);}};}function respondWithFilteredResult(_0x3c9cfb,_0x138c45){return function(_0x4bd20e){if(_0x4bd20e){var _0x2049cf=typeof _0x138c45[_0xf733('0x1f')]==='undefined'&&typeof _0x138c45[_0xf733('0x20')]===_0xf733('0x21');var _0x4d0de8=_0x4bd20e[_0xf733('0x22')];var _0x3932bc=_0x2049cf?0x0:_0x138c45[_0xf733('0x1f')];var _0x4d941f=_0x2049cf?_0x4bd20e[_0xf733('0x22')]:_0x138c45[_0xf733('0x1f')]+_0x138c45[_0xf733('0x20')];var _0x48d356;if(_0x4d941f>=_0x4d0de8){_0x4d941f=_0x4d0de8;_0x48d356=0xc8;}else{_0x48d356=0xce;}_0x3c9cfb[_0xf733('0x1d')](_0x48d356);return _0x3c9cfb['set'](_0xf733('0x23'),_0x3932bc+'-'+_0x4d941f+'/'+_0x4d0de8)['json'](_0x4bd20e);}return null;};}function patchUpdates(_0x515351){return function(_0x462dc4){try{jsonpatch['apply'](_0x462dc4,_0x515351,!![]);}catch(_0x5e17fa){return BPromise[_0xf733('0x24')](_0x5e17fa);}return _0x462dc4[_0xf733('0x25')]();};}function saveUpdates(_0x5eadce,_0x4452d1){return function(_0x3cb800){if(_0x3cb800){return _0x3cb800[_0xf733('0x26')](_0x5eadce)['then'](function(_0x39f52e){return _0x39f52e;});}return null;};}function removeEntity(_0x37c091,_0x35ea90){return function(_0xdffcb8){if(_0xdffcb8){return _0xdffcb8['destroy']()['then'](function(){_0x37c091[_0xf733('0x1d')](0xcc)[_0xf733('0x27')]();});}};}function handleEntityNotFound(_0xdc07c6,_0x4b84a2){return function(_0x3dd735){if(!_0x3dd735){_0xdc07c6['sendStatus'](0x194);}return _0x3dd735;};}function handleError(_0x4f722c,_0xab70fa){_0xab70fa=_0xab70fa||0x1f4;return function(_0x58a5a0){logger[_0xf733('0x28')](_0x58a5a0[_0xf733('0x29')]);if(_0x58a5a0[_0xf733('0x2a')]){delete _0x58a5a0[_0xf733('0x2a')];}_0x4f722c[_0xf733('0x1d')](_0xab70fa)[_0xf733('0x2b')](_0x58a5a0);};}exports[_0xf733('0x2c')]=function(_0x448c32,_0x4fea83){var _0x46d2ed={},_0x1ccdc6={},_0x257918={'count':0x0,'rows':[]};var _0x1f6714=_[_0xf733('0x2d')](db['SalesforceField'][_0xf733('0x2e')],function(_0x272d46){return{'name':_0x272d46[_0xf733('0x2f')],'type':_0x272d46['type'][_0xf733('0x30')]};});_0x1ccdc6['model']=_[_0xf733('0x2d')](_0x1f6714,_0xf733('0x2a'));_0x1ccdc6[_0xf733('0x31')]=_[_0xf733('0x32')](_0x448c32[_0xf733('0x31')]);_0x1ccdc6[_0xf733('0x33')]=_[_0xf733('0x34')](_0x1ccdc6[_0xf733('0x35')],_0x1ccdc6[_0xf733('0x31')]);_0x46d2ed['attributes']=_[_0xf733('0x34')](_0x1ccdc6['model'],qs[_0xf733('0x36')](_0x448c32[_0xf733('0x31')]['fields']));_0x46d2ed[_0xf733('0x37')]=_0x46d2ed['attributes']['length']?_0x46d2ed[_0xf733('0x37')]:_0x1ccdc6[_0xf733('0x35')];if(!_0x448c32[_0xf733('0x31')][_0xf733('0x38')]('nolimit')){_0x46d2ed[_0xf733('0x20')]=qs[_0xf733('0x20')](_0x448c32[_0xf733('0x31')][_0xf733('0x20')]);_0x46d2ed[_0xf733('0x1f')]=qs[_0xf733('0x1f')](_0x448c32['query'][_0xf733('0x1f')]);}_0x46d2ed[_0xf733('0x39')]=qs['sort'](_0x448c32['query'][_0xf733('0x3a')]);_0x46d2ed[_0xf733('0x3b')]=qs[_0xf733('0x33')](_[_0xf733('0x3c')](_0x448c32[_0xf733('0x31')],_0x1ccdc6[_0xf733('0x33')]),_0x1f6714);if(_0x448c32[_0xf733('0x31')][_0xf733('0x3d')]){_0x46d2ed[_0xf733('0x3b')]=_[_0xf733('0x3e')](_0x46d2ed[_0xf733('0x3b')],{'$or':_['map'](_0x1f6714,function(_0x3ae92e){if(_0x3ae92e[_0xf733('0x3f')]!=='VIRTUAL'){var _0xe3d1d={};_0xe3d1d[_0x3ae92e['name']]={'$like':'%'+_0x448c32[_0xf733('0x31')][_0xf733('0x3d')]+'%'};return _0xe3d1d;}})});}_0x46d2ed=_[_0xf733('0x3e')]({},_0x46d2ed,_0x448c32[_0xf733('0x40')]);var _0x28fcd8={'where':_0x46d2ed[_0xf733('0x3b')]};return db['SalesforceField']['count'](_0x28fcd8)[_0xf733('0x41')](function(_0x1b0863){_0x257918['count']=_0x1b0863;if(_0x448c32[_0xf733('0x31')][_0xf733('0x42')]){_0x46d2ed['include']=[{'all':!![]}];}return db[_0xf733('0x43')][_0xf733('0x44')](_0x46d2ed);})[_0xf733('0x41')](function(_0x483ebe){_0x257918[_0xf733('0x45')]=_0x483ebe;return _0x257918;})[_0xf733('0x41')](respondWithFilteredResult(_0x4fea83,_0x46d2ed))[_0xf733('0x46')](handleError(_0x4fea83,null));};exports[_0xf733('0x47')]=function(_0xf8025,_0x3d971c){var _0xd91d7c={'raw':!![],'where':{'id':_0xf8025[_0xf733('0x48')]['id']}},_0x319b60={};_0x319b60[_0xf733('0x35')]=_['keys'](db[_0xf733('0x43')][_0xf733('0x2e')]);_0x319b60[_0xf733('0x31')]=_[_0xf733('0x32')](_0xf8025[_0xf733('0x31')]);_0x319b60[_0xf733('0x33')]=_[_0xf733('0x34')](_0x319b60[_0xf733('0x35')],_0x319b60[_0xf733('0x31')]);_0xd91d7c[_0xf733('0x37')]=_[_0xf733('0x34')](_0x319b60[_0xf733('0x35')],qs[_0xf733('0x36')](_0xf8025[_0xf733('0x31')][_0xf733('0x36')]));_0xd91d7c[_0xf733('0x37')]=_0xd91d7c[_0xf733('0x37')]['length']?_0xd91d7c[_0xf733('0x37')]:_0x319b60[_0xf733('0x35')];if(_0xf8025[_0xf733('0x31')][_0xf733('0x42')]){_0xd91d7c[_0xf733('0x49')]=[{'all':!![]}];}_0xd91d7c=_[_0xf733('0x3e')]({},_0xd91d7c,_0xf8025['options']);return db['SalesforceField'][_0xf733('0x4a')](_0xd91d7c)[_0xf733('0x41')](handleEntityNotFound(_0x3d971c,null))[_0xf733('0x41')](respondWithResult(_0x3d971c,null))[_0xf733('0x46')](handleError(_0x3d971c,null));};exports[_0xf733('0x4b')]=function(_0x3228fb,_0x5da83d){return db[_0xf733('0x43')][_0xf733('0x4b')](_0x3228fb['body'],{})[_0xf733('0x41')](respondWithResult(_0x5da83d,0xc9))[_0xf733('0x46')](handleError(_0x5da83d,null));};exports[_0xf733('0x26')]=function(_0x4f964b,_0x172fbd){if(_0x4f964b[_0xf733('0x4c')]['id']){delete _0x4f964b[_0xf733('0x4c')]['id'];}return db[_0xf733('0x43')][_0xf733('0x4a')]({'where':{'id':_0x4f964b['params']['id']}})['then'](handleEntityNotFound(_0x172fbd,null))[_0xf733('0x41')](saveUpdates(_0x4f964b[_0xf733('0x4c')],null))[_0xf733('0x41')](respondWithResult(_0x172fbd,null))[_0xf733('0x46')](handleError(_0x172fbd,null));};exports['destroy']=function(_0x3ff1b6,_0x50ab7f){return db['SalesforceField'][_0xf733('0x4a')]({'where':{'id':_0x3ff1b6[_0xf733('0x48')]['id']}})[_0xf733('0x41')](handleEntityNotFound(_0x50ab7f,null))[_0xf733('0x41')](removeEntity(_0x50ab7f,null))['catch'](handleError(_0x50ab7f,null));}; \ No newline at end of file +var _0xb793=['show','keys','create','update','body','find','params','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','then','catch'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xb793,0x188));var _0x3b79=function(_0x461cf6,_0x21201d){_0x461cf6=_0x461cf6-0x0;var _0x2d5ca7=_0xb793[_0x461cf6];return _0x2d5ca7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b79('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b79('0x1'));var BPromise=require(_0x3b79('0x2'));var Mustache=require(_0x3b79('0x3'));var util=require(_0x3b79('0x4'));var path=require(_0x3b79('0x5'));var sox=require(_0x3b79('0x6'));var csv=require('to-csv');var ejs=require(_0x3b79('0x7'));var fs=require('fs');var fs_extra=require(_0x3b79('0x8'));var _=require(_0x3b79('0x9'));var squel=require(_0x3b79('0xa'));var crypto=require(_0x3b79('0xb'));var jsforce=require(_0x3b79('0xc'));var deskjs=require(_0x3b79('0xd'));var toCsv=require(_0x3b79('0xe'));var querystring=require(_0x3b79('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b79('0x10'));var qs=require(_0x3b79('0x11'));var as=require(_0x3b79('0x12'));var hardwareService=require(_0x3b79('0x13'));var logger=require(_0x3b79('0x14'))(_0x3b79('0x15'));var utils=require('../../config/utils');var config=require(_0x3b79('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b79('0x17'))['db'];function respondWithStatusCode(_0x17e46d,_0xbe4e4){_0xbe4e4=_0xbe4e4||0xcc;return function(_0x46dbc8){if(_0x46dbc8){return _0x17e46d[_0x3b79('0x18')](_0xbe4e4);}return _0x17e46d[_0x3b79('0x19')](_0xbe4e4)[_0x3b79('0x1a')]();};}function respondWithResult(_0x15c1d7,_0xfb3b4e){_0xfb3b4e=_0xfb3b4e||0xc8;return function(_0x4290fe){if(_0x4290fe){return _0x15c1d7[_0x3b79('0x19')](_0xfb3b4e)[_0x3b79('0x1b')](_0x4290fe);}};}function respondWithFilteredResult(_0x245779,_0x56e6e7){return function(_0x4bae49){if(_0x4bae49){var _0x26b75f=typeof _0x56e6e7[_0x3b79('0x1c')]===_0x3b79('0x1d')&&typeof _0x56e6e7[_0x3b79('0x1e')]==='undefined';var _0x1c324a=_0x4bae49[_0x3b79('0x1f')];var _0x4a31ec=_0x26b75f?0x0:_0x56e6e7[_0x3b79('0x1c')];var _0x3268c5=_0x26b75f?_0x4bae49[_0x3b79('0x1f')]:_0x56e6e7['offset']+_0x56e6e7['limit'];var _0x4823ae;if(_0x3268c5>=_0x1c324a){_0x3268c5=_0x1c324a;_0x4823ae=0xc8;}else{_0x4823ae=0xce;}_0x245779['status'](_0x4823ae);return _0x245779[_0x3b79('0x20')](_0x3b79('0x21'),_0x4a31ec+'-'+_0x3268c5+'/'+_0x1c324a)[_0x3b79('0x1b')](_0x4bae49);}return null;};}function patchUpdates(_0x3bb9c2){return function(_0x596aaf){try{jsonpatch[_0x3b79('0x22')](_0x596aaf,_0x3bb9c2,!![]);}catch(_0x14a5a1){return BPromise[_0x3b79('0x23')](_0x14a5a1);}return _0x596aaf[_0x3b79('0x24')]();};}function saveUpdates(_0x298dfd,_0x17f25e){return function(_0xc3ec73){if(_0xc3ec73){return _0xc3ec73['update'](_0x298dfd)['then'](function(_0x2bf9d5){return _0x2bf9d5;});}return null;};}function removeEntity(_0x38293e,_0xcc6d7c){return function(_0x523395){if(_0x523395){return _0x523395[_0x3b79('0x25')]()['then'](function(){_0x38293e[_0x3b79('0x19')](0xcc)[_0x3b79('0x1a')]();});}};}function handleEntityNotFound(_0x411598,_0xe1b359){return function(_0x3a5a56){if(!_0x3a5a56){_0x411598[_0x3b79('0x18')](0x194);}return _0x3a5a56;};}function handleError(_0x1545d0,_0x338db3){_0x338db3=_0x338db3||0x1f4;return function(_0x4c7928){logger['error'](_0x4c7928[_0x3b79('0x26')]);if(_0x4c7928[_0x3b79('0x27')]){delete _0x4c7928[_0x3b79('0x27')];}_0x1545d0[_0x3b79('0x19')](_0x338db3)[_0x3b79('0x28')](_0x4c7928);};}exports[_0x3b79('0x29')]=function(_0x47d5ce,_0x68904f){var _0x4caf7e={},_0x173c8e={},_0x202f6c={'count':0x0,'rows':[]};var _0x14c53e=_[_0x3b79('0x2a')](db[_0x3b79('0x2b')][_0x3b79('0x2c')],function(_0x28b18a){return{'name':_0x28b18a[_0x3b79('0x2d')],'type':_0x28b18a[_0x3b79('0x2e')][_0x3b79('0x2f')]};});_0x173c8e[_0x3b79('0x30')]=_[_0x3b79('0x2a')](_0x14c53e,_0x3b79('0x27'));_0x173c8e[_0x3b79('0x31')]=_['keys'](_0x47d5ce[_0x3b79('0x31')]);_0x173c8e[_0x3b79('0x32')]=_[_0x3b79('0x33')](_0x173c8e[_0x3b79('0x30')],_0x173c8e['query']);_0x4caf7e[_0x3b79('0x34')]=_[_0x3b79('0x33')](_0x173c8e[_0x3b79('0x30')],qs['fields'](_0x47d5ce['query'][_0x3b79('0x35')]));_0x4caf7e['attributes']=_0x4caf7e[_0x3b79('0x34')][_0x3b79('0x36')]?_0x4caf7e[_0x3b79('0x34')]:_0x173c8e[_0x3b79('0x30')];if(!_0x47d5ce[_0x3b79('0x31')][_0x3b79('0x37')](_0x3b79('0x38'))){_0x4caf7e[_0x3b79('0x1e')]=qs[_0x3b79('0x1e')](_0x47d5ce[_0x3b79('0x31')][_0x3b79('0x1e')]);_0x4caf7e['offset']=qs[_0x3b79('0x1c')](_0x47d5ce[_0x3b79('0x31')][_0x3b79('0x1c')]);}_0x4caf7e[_0x3b79('0x39')]=qs[_0x3b79('0x3a')](_0x47d5ce['query'][_0x3b79('0x3a')]);_0x4caf7e[_0x3b79('0x3b')]=qs[_0x3b79('0x32')](_[_0x3b79('0x3c')](_0x47d5ce[_0x3b79('0x31')],_0x173c8e[_0x3b79('0x32')]),_0x14c53e);if(_0x47d5ce[_0x3b79('0x31')][_0x3b79('0x3d')]){_0x4caf7e[_0x3b79('0x3b')]=_['merge'](_0x4caf7e[_0x3b79('0x3b')],{'$or':_['map'](_0x14c53e,function(_0x537cdc){if(_0x537cdc[_0x3b79('0x2e')]!==_0x3b79('0x3e')){var _0x16729a={};_0x16729a[_0x537cdc[_0x3b79('0x27')]]={'$like':'%'+_0x47d5ce[_0x3b79('0x31')][_0x3b79('0x3d')]+'%'};return _0x16729a;}})});}_0x4caf7e=_[_0x3b79('0x3f')]({},_0x4caf7e,_0x47d5ce[_0x3b79('0x40')]);var _0x18a999={'where':_0x4caf7e[_0x3b79('0x3b')]};return db[_0x3b79('0x2b')][_0x3b79('0x1f')](_0x18a999)['then'](function(_0x135ae5){_0x202f6c[_0x3b79('0x1f')]=_0x135ae5;if(_0x47d5ce['query'][_0x3b79('0x41')]){_0x4caf7e[_0x3b79('0x42')]=[{'all':!![]}];}return db['SalesforceField'][_0x3b79('0x43')](_0x4caf7e);})[_0x3b79('0x44')](function(_0x36485e){_0x202f6c['rows']=_0x36485e;return _0x202f6c;})[_0x3b79('0x44')](respondWithFilteredResult(_0x68904f,_0x4caf7e))[_0x3b79('0x45')](handleError(_0x68904f,null));};exports[_0x3b79('0x46')]=function(_0x48f7db,_0xb14465){var _0xbae163={'raw':!![],'where':{'id':_0x48f7db['params']['id']}},_0x4a0ac2={};_0x4a0ac2['model']=_[_0x3b79('0x47')](db[_0x3b79('0x2b')][_0x3b79('0x2c')]);_0x4a0ac2[_0x3b79('0x31')]=_['keys'](_0x48f7db[_0x3b79('0x31')]);_0x4a0ac2[_0x3b79('0x32')]=_['intersection'](_0x4a0ac2['model'],_0x4a0ac2[_0x3b79('0x31')]);_0xbae163['attributes']=_[_0x3b79('0x33')](_0x4a0ac2[_0x3b79('0x30')],qs[_0x3b79('0x35')](_0x48f7db['query'][_0x3b79('0x35')]));_0xbae163['attributes']=_0xbae163[_0x3b79('0x34')][_0x3b79('0x36')]?_0xbae163[_0x3b79('0x34')]:_0x4a0ac2['model'];if(_0x48f7db[_0x3b79('0x31')][_0x3b79('0x41')]){_0xbae163[_0x3b79('0x42')]=[{'all':!![]}];}_0xbae163=_[_0x3b79('0x3f')]({},_0xbae163,_0x48f7db['options']);return db[_0x3b79('0x2b')]['find'](_0xbae163)['then'](handleEntityNotFound(_0xb14465,null))[_0x3b79('0x44')](respondWithResult(_0xb14465,null))[_0x3b79('0x45')](handleError(_0xb14465,null));};exports['create']=function(_0x1ef193,_0x4508a3){return db[_0x3b79('0x2b')][_0x3b79('0x48')](_0x1ef193['body'],{})[_0x3b79('0x44')](respondWithResult(_0x4508a3,0xc9))[_0x3b79('0x45')](handleError(_0x4508a3,null));};exports[_0x3b79('0x49')]=function(_0x3661f3,_0x1c1b4c){if(_0x3661f3[_0x3b79('0x4a')]['id']){delete _0x3661f3[_0x3b79('0x4a')]['id'];}return db[_0x3b79('0x2b')][_0x3b79('0x4b')]({'where':{'id':_0x3661f3[_0x3b79('0x4c')]['id']}})[_0x3b79('0x44')](handleEntityNotFound(_0x1c1b4c,null))[_0x3b79('0x44')](saveUpdates(_0x3661f3[_0x3b79('0x4a')],null))[_0x3b79('0x44')](respondWithResult(_0x1c1b4c,null))['catch'](handleError(_0x1c1b4c,null));};exports['destroy']=function(_0x48f526,_0x223994){return db['SalesforceField'][_0x3b79('0x4b')]({'where':{'id':_0x48f526[_0x3b79('0x4c')]['id']}})[_0x3b79('0x44')](handleEntityNotFound(_0x223994,null))[_0x3b79('0x44')](removeEntity(_0x223994,null))[_0x3b79('0x45')](handleError(_0x223994,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b71970d..9c06cbc 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 _0x81f4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','FieldId','lodash','util'];(function(_0x450700,_0x3fb27c){var _0x3d3da1=function(_0x22b5de){while(--_0x22b5de){_0x450700['push'](_0x450700['shift']());}};_0x3d3da1(++_0x3fb27c);}(_0x81f4,0xdf));var _0x481f=function(_0x4b6ce6,_0x5b1db9){_0x4b6ce6=_0x4b6ce6-0x0;var _0x1f13d7=_0x81f4[_0x4b6ce6];return _0x1f13d7;};'use strict';var _=require(_0x481f('0x0'));var util=require(_0x481f('0x1'));var logger=require(_0x481f('0x2'))(_0x481f('0x3'));var moment=require(_0x481f('0x4'));var BPromise=require(_0x481f('0x5'));var rp=require(_0x481f('0x6'));var fs=require('fs');var path=require(_0x481f('0x7'));var rimraf=require(_0x481f('0x8'));var config=require('../../config/environment');var attributes=require(_0x481f('0x9'));module[_0x481f('0xa')]=function(_0x53965b,_0x93a47b){return _0x53965b[_0x481f('0xb')](_0x481f('0xc'),attributes,{'tableName':_0x481f('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x481f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf90b=['FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField'];(function(_0x25d190,_0x577ff7){var _0x4efaff=function(_0x3b295e){while(--_0x3b295e){_0x25d190['push'](_0x25d190['shift']());}};_0x4efaff(++_0x577ff7);}(_0xf90b,0xf8));var _0xbf90=function(_0x204d12,_0x2e6cbc){_0x204d12=_0x204d12-0x0;var _0x49ec86=_0xf90b[_0x204d12];return _0x49ec86;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbf90('0x0'));var moment=require(_0xbf90('0x1'));var BPromise=require(_0xbf90('0x2'));var rp=require(_0xbf90('0x3'));var fs=require('fs');var path=require(_0xbf90('0x4'));var rimraf=require(_0xbf90('0x5'));var config=require(_0xbf90('0x6'));var attributes=require(_0xbf90('0x7'));module[_0xbf90('0x8')]=function(_0x7827de,_0x1c8ce0){return _0x7827de['define'](_0xbf90('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xbf90('0xa'),'fields':[_0xbf90('0xb'),_0xbf90('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 d198d77..05e6127 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 _0x761e=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2f9382,_0x374f46){var _0x37943b=function(_0x355220){while(--_0x355220){_0x2f9382['push'](_0x2f9382['shift']());}};_0x37943b(++_0x374f46);}(_0x761e,0x143));var _0xe761=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x761e[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require(_0xe761('0x0'));var util=require('util');var moment=require(_0xe761('0x1'));var BPromise=require(_0xe761('0x2'));var rs=require(_0xe761('0x3'));var fs=require('fs');var Redis=require(_0xe761('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe761('0x5'))('rpc');var config=require(_0xe761('0x6'));var jayson=require(_0xe761('0x7'));var client=jayson[_0xe761('0x8')][_0xe761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf6ea,_0x3af370,_0x187037){return new BPromise(function(_0x362044,_0x3ff97b){return client['request'](_0x3bf6ea,_0x187037)[_0xe761('0xa')](function(_0xc2d234){logger[_0xe761('0xb')](_0xe761('0xc'),_0x3af370,_0xe761('0xd'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3af370,_0xe761('0xd'),JSON[_0xe761('0xe')](_0xc2d234));if(_0xc2d234[_0xe761('0xf')]){if(_0xc2d234[_0xe761('0xf')][_0xe761('0x10')]===0x1f4){logger[_0xe761('0xf')](_0xe761('0xc'),_0x3af370,_0xc2d234[_0xe761('0xf')][_0xe761('0x11')]);return _0x3ff97b(_0xc2d234[_0xe761('0xf')][_0xe761('0x11')]);}logger[_0xe761('0xf')](_0xe761('0xc'),_0x3af370,_0xc2d234[_0xe761('0xf')][_0xe761('0x11')]);return _0x362044(_0xc2d234['error'][_0xe761('0x11')]);}else{logger[_0xe761('0xb')]('SalesforceField,\x20%s,\x20%s',_0x3af370,_0xe761('0xd'));_0x362044(_0xc2d234[_0xe761('0x12')][_0xe761('0x11')]);}})[_0xe761('0x13')](function(_0x3eed14){logger[_0xe761('0xf')](_0xe761('0xc'),_0x3af370,_0x3eed14);_0x3ff97b(_0x3eed14);});});} \ No newline at end of file +var _0x5138=['message','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5138,0x132));var _0x8513=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x5138[_0x1399d6];return _0x4a9db4;};'use strict';var _=require('lodash');var util=require(_0x8513('0x0'));var moment=require('moment');var BPromise=require(_0x8513('0x1'));var rs=require(_0x8513('0x2'));var fs=require('fs');var Redis=require(_0x8513('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8513('0x4'));var logger=require('../../config/logger')(_0x8513('0x5'));var config=require(_0x8513('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8513('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x465687,_0x35f67d,_0x5e2f94){return new BPromise(function(_0x542c3f,_0xac01d8){return client[_0x8513('0x8')](_0x465687,_0x5e2f94)[_0x8513('0x9')](function(_0x30a38c){logger[_0x8513('0xa')](_0x8513('0xb'),_0x35f67d,_0x8513('0xc'));logger[_0x8513('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x35f67d,_0x8513('0xc'),JSON[_0x8513('0xe')](_0x30a38c));if(_0x30a38c[_0x8513('0xf')]){if(_0x30a38c['error'][_0x8513('0x10')]===0x1f4){logger[_0x8513('0xf')](_0x8513('0xb'),_0x35f67d,_0x30a38c[_0x8513('0xf')]['message']);return _0xac01d8(_0x30a38c['error'][_0x8513('0x11')]);}logger['error'](_0x8513('0xb'),_0x35f67d,_0x30a38c[_0x8513('0xf')][_0x8513('0x11')]);return _0x542c3f(_0x30a38c[_0x8513('0xf')][_0x8513('0x11')]);}else{logger[_0x8513('0xa')](_0x8513('0xb'),_0x35f67d,_0x8513('0xc'));_0x542c3f(_0x30a38c['result'][_0x8513('0x11')]);}})[_0x8513('0x12')](function(_0x383435){logger[_0x8513('0xf')]('SalesforceField,\x20%s,\x20%s',_0x35f67d,_0x383435);_0xac01d8(_0x383435);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index de6f42a..7ac06d4 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 _0xb6b8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','post','create','put','update','exports','util','path','connect-timeout'];(function(_0x51cbe4,_0x3acc5a){var _0x5ec7cc=function(_0x1f391b){while(--_0x1f391b){_0x51cbe4['push'](_0x51cbe4['shift']());}};_0x5ec7cc(++_0x3acc5a);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x140192,_0x20d1b9){_0x140192=_0x140192-0x0;var _0x37449c=_0xb6b8[_0x140192];return _0x37449c;};'use strict';var multer=require('multer');var util=require(_0x8b6b('0x0'));var path=require(_0x8b6b('0x1'));var timeout=require(_0x8b6b('0x2'));var express=require(_0x8b6b('0x3'));var router=express[_0x8b6b('0x4')]();var fs_extra=require(_0x8b6b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b6b('0x6'));var config=require(_0x8b6b('0x7'));var controller=require(_0x8b6b('0x8'));router['get']('/',auth[_0x8b6b('0x9')](),controller['index']);router['get'](_0x8b6b('0xa'),auth[_0x8b6b('0x9')](),controller[_0x8b6b('0xb')]);router[_0x8b6b('0xc')](_0x8b6b('0xd'),auth[_0x8b6b('0x9')](),controller[_0x8b6b('0xe')]);router[_0x8b6b('0xc')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8b6b('0xf')]('/',auth[_0x8b6b('0x9')](),controller[_0x8b6b('0x10')]);router['post'](_0x8b6b('0xd'),auth[_0x8b6b('0x9')](),controller['addConfiguration']);router[_0x8b6b('0x11')]('/:id',auth[_0x8b6b('0x9')](),controller[_0x8b6b('0x12')]);router['delete']('/:id',auth[_0x8b6b('0x9')](),controller['destroy']);module[_0x8b6b('0x13')]=router; \ No newline at end of file +var _0x0e35=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x28bcbc,_0x30ec21){var _0x3a814e=function(_0x175dc0){while(--_0x175dc0){_0x28bcbc['push'](_0x28bcbc['shift']());}};_0x3a814e(++_0x30ec21);}(_0x0e35,0xc2));var _0x50e3=function(_0x12860d,_0x169180){_0x12860d=_0x12860d-0x0;var _0x542f73=_0x0e35[_0x12860d];return _0x542f73;};'use strict';var multer=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var path=require(_0x50e3('0x2'));var timeout=require(_0x50e3('0x3'));var express=require(_0x50e3('0x4'));var router=express[_0x50e3('0x5')]();var fs_extra=require(_0x50e3('0x6'));var auth=require(_0x50e3('0x7'));var interaction=require(_0x50e3('0x8'));var config=require(_0x50e3('0x9'));var controller=require('./intServicenowAccount.controller');router[_0x50e3('0xa')]('/',auth[_0x50e3('0xb')](),controller['index']);router['get'](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller['show']);router['get'](_0x50e3('0xd'),auth[_0x50e3('0xb')](),controller[_0x50e3('0xe')]);router[_0x50e3('0xa')](_0x50e3('0xf'),auth[_0x50e3('0xb')](),controller[_0x50e3('0x10')]);router[_0x50e3('0x11')]('/',auth[_0x50e3('0xb')](),controller[_0x50e3('0x12')]);router[_0x50e3('0x11')](_0x50e3('0xd'),auth[_0x50e3('0xb')](),controller['addConfiguration']);router[_0x50e3('0x13')](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller[_0x50e3('0x14')]);router['delete'](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller['destroy']);module[_0x50e3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 086b3b7..c1b619f 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 _0xee0c=['STRING','username','remoteUri','sequelize','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xee0c,0x161));var _0xcee0=function(_0x392f58,_0x29560b){_0x392f58=_0x392f58-0x0;var _0x58fd09=_0xee0c[_0x392f58];return _0x58fd09;};'use strict';var Sequelize=require(_0xcee0('0x0'));module[_0xcee0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcee0('0x2')]},'username':{'type':Sequelize[_0xcee0('0x2')],'unique':_0xcee0('0x3')},'password':{'type':Sequelize[_0xcee0('0x2')]},'email':{'type':Sequelize[_0xcee0('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcee0('0x4')},'serverUrl':{'type':Sequelize[_0xcee0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8d13=['sequelize','STRING','username'];(function(_0x4fd6bb,_0x807aec){var _0x349021=function(_0x5f30e2){while(--_0x5f30e2){_0x4fd6bb['push'](_0x4fd6bb['shift']());}};_0x349021(++_0x807aec);}(_0x8d13,0x117));var _0x38d1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8d13[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x38d1('0x0'));module['exports']={'name':{'type':Sequelize[_0x38d1('0x1')]},'description':{'type':Sequelize[_0x38d1('0x1')]},'username':{'type':Sequelize[_0x38d1('0x1')],'unique':_0x38d1('0x2')},'password':{'type':Sequelize[_0x38d1('0x1')]},'email':{'type':Sequelize[_0x38d1('0x1')]},'remoteUri':{'type':Sequelize[_0x38d1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x38d1('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 41128a0..44c8d64 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 _0x7846=['activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','show','params','options','find','create','body','destroy','findOne','ServicenowConfiguration','getConfigurations','catch','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','resolved_at','caller_id','approval_set','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','contact_type','reopened_by','urgency','company','reassignment_count'];(function(_0x13b8e4,_0xba93f6){var _0x5a9faf=function(_0x19c712){while(--_0x19c712){_0x13b8e4['push'](_0x13b8e4['shift']());}};_0x5a9faf(++_0xba93f6);}(_0x7846,0x1b0));var _0x6784=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x7846[_0x234ae1];return _0x227ba0;};'use strict';var emlformat=require(_0x6784('0x0'));var rimraf=require(_0x6784('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6784('0x2'));var rp=require(_0x6784('0x3'));var moment=require(_0x6784('0x4'));var BPromise=require(_0x6784('0x5'));var Mustache=require('mustache');var util=require(_0x6784('0x6'));var path=require(_0x6784('0x7'));var sox=require(_0x6784('0x8'));var csv=require(_0x6784('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6784('0xa'));var _=require(_0x6784('0xb'));var squel=require(_0x6784('0xc'));var crypto=require(_0x6784('0xd'));var jsforce=require(_0x6784('0xe'));var deskjs=require(_0x6784('0xf'));var toCsv=require(_0x6784('0x9'));var querystring=require(_0x6784('0x10'));var Papa=require(_0x6784('0x11'));var Redis=require(_0x6784('0x12'));var authService=require(_0x6784('0x13'));var qs=require(_0x6784('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6784('0x15'));var utils=require('../../config/utils');var config=require(_0x6784('0x16'));var licenseUtil=require(_0x6784('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6784('0x18'));function respondWithStatusCode(_0x42a9ba,_0x4789a5){_0x4789a5=_0x4789a5||0xcc;return function(_0x1da886){if(_0x1da886){return _0x42a9ba[_0x6784('0x19')](_0x4789a5);}return _0x42a9ba[_0x6784('0x1a')](_0x4789a5)['end']();};}function respondWithResult(_0x723a73,_0x45082b){_0x45082b=_0x45082b||0xc8;return function(_0x256e3b){if(_0x256e3b){return _0x723a73[_0x6784('0x1a')](_0x45082b)[_0x6784('0x1b')](_0x256e3b);}};}function respondWithFilteredResult(_0x5b03ea,_0x515b84){return function(_0x30da9c){if(_0x30da9c){var _0x3344c7=typeof _0x515b84[_0x6784('0x1c')]===_0x6784('0x1d')&&typeof _0x515b84[_0x6784('0x1e')]===_0x6784('0x1d');var _0x1c8fc5=_0x30da9c[_0x6784('0x1f')];var _0x11c867=_0x3344c7?0x0:_0x515b84['offset'];var _0x53d536=_0x3344c7?_0x30da9c[_0x6784('0x1f')]:_0x515b84[_0x6784('0x1c')]+_0x515b84[_0x6784('0x1e')];var _0x428a5f;if(_0x53d536>=_0x1c8fc5){_0x53d536=_0x1c8fc5;_0x428a5f=0xc8;}else{_0x428a5f=0xce;}_0x5b03ea[_0x6784('0x1a')](_0x428a5f);return _0x5b03ea['set'](_0x6784('0x20'),_0x11c867+'-'+_0x53d536+'/'+_0x1c8fc5)[_0x6784('0x1b')](_0x30da9c);}return null;};}function patchUpdates(_0x235912){return function(_0x46bb9b){try{jsonpatch[_0x6784('0x21')](_0x46bb9b,_0x235912,!![]);}catch(_0x526b4b){return BPromise['reject'](_0x526b4b);}return _0x46bb9b[_0x6784('0x22')]();};}function saveUpdates(_0x4b3537,_0x2942c3){return function(_0x57b28b){if(_0x57b28b){return _0x57b28b[_0x6784('0x23')](_0x4b3537)['then'](function(_0x492602){return _0x492602;});}return null;};}function removeEntity(_0x2f11da,_0x4d30e9){return function(_0x54a961){if(_0x54a961){return _0x54a961['destroy']()[_0x6784('0x24')](function(){_0x2f11da[_0x6784('0x1a')](0xcc)[_0x6784('0x25')]();});}};}function handleEntityNotFound(_0x179905,_0x412b21){return function(_0x57ada1){if(!_0x57ada1){_0x179905[_0x6784('0x19')](0x194);}return _0x57ada1;};}function handleError(_0x4700c0,_0x2676a2){_0x2676a2=_0x2676a2||0x1f4;return function(_0x406eb0){logger[_0x6784('0x26')](_0x406eb0[_0x6784('0x27')]);if(_0x406eb0[_0x6784('0x28')]){delete _0x406eb0[_0x6784('0x28')];}_0x4700c0[_0x6784('0x1a')](_0x2676a2)[_0x6784('0x29')](_0x406eb0);};}exports[_0x6784('0x2a')]=function(_0x572483,_0xe15125){var _0x17daad={},_0x28d73f={},_0x506808={'count':0x0,'rows':[]};var _0x3f30f5=_[_0x6784('0x2b')](db[_0x6784('0x2c')][_0x6784('0x2d')],function(_0x58045d){return{'name':_0x58045d[_0x6784('0x2e')],'type':_0x58045d[_0x6784('0x2f')][_0x6784('0x30')]};});_0x28d73f[_0x6784('0x31')]=_[_0x6784('0x2b')](_0x3f30f5,_0x6784('0x28'));_0x28d73f[_0x6784('0x32')]=_[_0x6784('0x33')](_0x572483[_0x6784('0x32')]);_0x28d73f[_0x6784('0x34')]=_['intersection'](_0x28d73f[_0x6784('0x31')],_0x28d73f[_0x6784('0x32')]);_0x17daad[_0x6784('0x35')]=_[_0x6784('0x36')](_0x28d73f['model'],qs[_0x6784('0x37')](_0x572483[_0x6784('0x32')][_0x6784('0x37')]));_0x17daad[_0x6784('0x35')]=_0x17daad[_0x6784('0x35')][_0x6784('0x38')]?_0x17daad[_0x6784('0x35')]:_0x28d73f['model'];if(!_0x572483[_0x6784('0x32')][_0x6784('0x39')](_0x6784('0x3a'))){_0x17daad[_0x6784('0x1e')]=qs[_0x6784('0x1e')](_0x572483[_0x6784('0x32')]['limit']);_0x17daad['offset']=qs[_0x6784('0x1c')](_0x572483[_0x6784('0x32')][_0x6784('0x1c')]);}_0x17daad[_0x6784('0x3b')]=qs[_0x6784('0x3c')](_0x572483['query'][_0x6784('0x3c')]);_0x17daad['where']=qs[_0x6784('0x34')](_[_0x6784('0x3d')](_0x572483[_0x6784('0x32')],_0x28d73f[_0x6784('0x34')]),_0x3f30f5);if(_0x572483[_0x6784('0x32')][_0x6784('0x3e')]){_0x17daad['where']=_[_0x6784('0x3f')](_0x17daad[_0x6784('0x40')],{'$or':_[_0x6784('0x2b')](_0x3f30f5,function(_0x11cb3c){if(_0x11cb3c[_0x6784('0x2f')]!=='VIRTUAL'){var _0x5d2b64={};_0x5d2b64[_0x11cb3c['name']]={'$like':'%'+_0x572483[_0x6784('0x32')][_0x6784('0x3e')]+'%'};return _0x5d2b64;}})});}_0x17daad=_[_0x6784('0x3f')]({},_0x17daad,_0x572483['options']);var _0x1f2524={'where':_0x17daad[_0x6784('0x40')]};return db[_0x6784('0x2c')][_0x6784('0x1f')](_0x1f2524)[_0x6784('0x24')](function(_0xdbc4c1){_0x506808[_0x6784('0x1f')]=_0xdbc4c1;if(_0x572483[_0x6784('0x32')][_0x6784('0x41')]){_0x17daad[_0x6784('0x42')]=[{'all':!![]}];}return db[_0x6784('0x2c')]['findAll'](_0x17daad);})[_0x6784('0x24')](function(_0x1e705e){_0x506808[_0x6784('0x43')]=_0x1e705e;return _0x506808;})[_0x6784('0x24')](respondWithFilteredResult(_0xe15125,_0x17daad))['catch'](handleError(_0xe15125,null));};exports[_0x6784('0x44')]=function(_0x933356,_0x36b50b){var _0x31e51b={'raw':![],'where':{'id':_0x933356[_0x6784('0x45')]['id']}},_0x184146={};_0x184146[_0x6784('0x31')]=_['keys'](db[_0x6784('0x2c')]['rawAttributes']);_0x184146[_0x6784('0x32')]=_[_0x6784('0x33')](_0x933356[_0x6784('0x32')]);_0x184146[_0x6784('0x34')]=_[_0x6784('0x36')](_0x184146[_0x6784('0x31')],_0x184146[_0x6784('0x32')]);_0x31e51b['attributes']=_[_0x6784('0x36')](_0x184146['model'],qs[_0x6784('0x37')](_0x933356['query']['fields']));_0x31e51b[_0x6784('0x35')]=_0x31e51b[_0x6784('0x35')][_0x6784('0x38')]?_0x31e51b[_0x6784('0x35')]:_0x184146['model'];if(_0x933356['query'][_0x6784('0x41')]){_0x31e51b[_0x6784('0x42')]=[{'all':!![]}];}_0x31e51b=_[_0x6784('0x3f')]({},_0x31e51b,_0x933356[_0x6784('0x46')]);return db[_0x6784('0x2c')][_0x6784('0x47')](_0x31e51b)['then'](handleEntityNotFound(_0x36b50b,null))['then'](respondWithResult(_0x36b50b,null))['catch'](handleError(_0x36b50b,null));};exports[_0x6784('0x48')]=function(_0x3c0bd3,_0x438db7){return db[_0x6784('0x2c')][_0x6784('0x48')](_0x3c0bd3['body'],{})[_0x6784('0x24')](respondWithResult(_0x438db7,0xc9))['catch'](handleError(_0x438db7,null));};exports[_0x6784('0x23')]=function(_0x4a6268,_0x223b70){if(_0x4a6268['body']['id']){delete _0x4a6268[_0x6784('0x49')]['id'];}return db[_0x6784('0x2c')]['find']({'where':{'id':_0x4a6268[_0x6784('0x45')]['id']}})[_0x6784('0x24')](handleEntityNotFound(_0x223b70,null))[_0x6784('0x24')](saveUpdates(_0x4a6268[_0x6784('0x49')],null))[_0x6784('0x24')](respondWithResult(_0x223b70,null))['catch'](handleError(_0x223b70,null));};exports[_0x6784('0x4a')]=function(_0x4c3fef,_0x2117b0){return db[_0x6784('0x2c')][_0x6784('0x47')]({'where':{'id':_0x4c3fef[_0x6784('0x45')]['id']}})[_0x6784('0x24')](handleEntityNotFound(_0x2117b0,null))[_0x6784('0x24')](removeEntity(_0x2117b0,null))['catch'](handleError(_0x2117b0,null));};exports['getConfigurations']=function(_0x514d77,_0x2a457e,_0x407cdd){var _0x3e0c22={};var _0x1e88ff={};var _0x68d118;var _0x3d659e;return db[_0x6784('0x2c')][_0x6784('0x4b')]({'where':{'id':_0x514d77[_0x6784('0x45')]['id']}})[_0x6784('0x24')](handleEntityNotFound(_0x2a457e,null))[_0x6784('0x24')](function(_0x50fbf8){if(_0x50fbf8){_0x68d118=_0x50fbf8;_0x1e88ff[_0x6784('0x31')]=_[_0x6784('0x33')](db[_0x6784('0x4c')]['rawAttributes']);_0x1e88ff[_0x6784('0x32')]=_[_0x6784('0x33')](_0x514d77[_0x6784('0x32')]);_0x1e88ff[_0x6784('0x34')]=_[_0x6784('0x36')](_0x1e88ff[_0x6784('0x31')],_0x1e88ff[_0x6784('0x32')]);_0x3e0c22[_0x6784('0x35')]=_['intersection'](_0x1e88ff[_0x6784('0x31')],qs[_0x6784('0x37')](_0x514d77[_0x6784('0x32')][_0x6784('0x37')]));_0x3e0c22['attributes']=_0x3e0c22['attributes'][_0x6784('0x38')]?_0x3e0c22['attributes']:_0x1e88ff[_0x6784('0x31')];_0x3e0c22[_0x6784('0x3b')]=qs['sort'](_0x514d77[_0x6784('0x32')][_0x6784('0x3c')]);_0x3e0c22[_0x6784('0x40')]=qs[_0x6784('0x34')](_[_0x6784('0x3d')](_0x514d77[_0x6784('0x32')],_0x1e88ff['filters']));if(_0x514d77[_0x6784('0x32')]['filter']){_0x3e0c22[_0x6784('0x40')]=_[_0x6784('0x3f')](_0x3e0c22[_0x6784('0x40')],{'$or':_[_0x6784('0x2b')](_0x3e0c22[_0x6784('0x35')],function(_0x257f98){var _0xd908ce={};_0xd908ce[_0x257f98]={'$like':'%'+_0x514d77[_0x6784('0x32')][_0x6784('0x3e')]+'%'};return _0xd908ce;})});}_0x3e0c22=_[_0x6784('0x3f')]({},_0x3e0c22,_0x514d77[_0x6784('0x46')]);return _0x68d118['getConfigurations'](_0x3e0c22);}})[_0x6784('0x24')](function(_0x2d1107){if(_0x2d1107){_0x3d659e=_0x2d1107['length'];if(!_0x514d77[_0x6784('0x32')][_0x6784('0x39')](_0x6784('0x3a'))){_0x3e0c22[_0x6784('0x1e')]=qs[_0x6784('0x1e')](_0x514d77['query'][_0x6784('0x1e')]);_0x3e0c22[_0x6784('0x1c')]=qs[_0x6784('0x1c')](_0x514d77[_0x6784('0x32')]['offset']);}return _0x68d118[_0x6784('0x4d')](_0x3e0c22);}})[_0x6784('0x24')](function(_0x40a53a){if(_0x40a53a){return _0x40a53a?{'count':_0x3d659e,'rows':_0x40a53a}:null;}})[_0x6784('0x24')](respondWithResult(_0x2a457e,null))[_0x6784('0x4e')](handleError(_0x2a457e,null));};exports[_0x6784('0x4f')]=function(_0x3f415d,_0x3381fb,_0x31a4ee){if(_0x3f415d[_0x6784('0x49')]['id']){delete _0x3f415d[_0x6784('0x49')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3f415d[_0x6784('0x45')]['id']}})['then'](handleEntityNotFound(_0x3381fb,null))[_0x6784('0x24')](function(_0x442701){if(_0x442701){_0x3f415d[_0x6784('0x49')][_0x6784('0x50')]=_0x442701['id'];_0x3f415d['body'][_0x6784('0x51')]=integrations[_0x6784('0x52')](_0x3f415d[_0x6784('0x49')][_0x6784('0x53')],_0x3f415d[_0x6784('0x49')][_0x6784('0x2f')]);_0x3f415d[_0x6784('0x49')][_0x6784('0x54')]=integrations[_0x6784('0x55')](_0x3f415d[_0x6784('0x49')][_0x6784('0x53')],_0x3f415d[_0x6784('0x49')][_0x6784('0x2f')]);return db[_0x6784('0x4c')]['create'](_0x3f415d[_0x6784('0x49')],{'include':[{'model':db[_0x6784('0x56')],'as':'Subjects'},{'model':db[_0x6784('0x56')],'as':'Descriptions'}]});}return null;})[_0x6784('0x24')](respondWithResult(_0x3381fb,null))[_0x6784('0x4e')](handleError(_0x3381fb,null));};exports[_0x6784('0x57')]=function(_0x215f71,_0x50074,_0x2f221e){var _0x3c56bf=['made_sla',_0x6784('0x58'),_0x6784('0x59'),_0x6784('0x5a'),_0x6784('0x5b'),_0x6784('0x5c'),_0x6784('0x5d'),_0x6784('0x5e'),'category'];var _0x1dca63=[_0x6784('0x5f'),'made_sla',_0x6784('0x60'),_0x6784('0x61'),_0x6784('0x62'),'sys_updated_on',_0x6784('0x63'),'hold_reason',_0x6784('0x64'),_0x6784('0x65'),_0x6784('0x66'),_0x6784('0x67'),_0x6784('0x68'),_0x6784('0x69'),_0x6784('0x6a'),_0x6784('0x6b'),_0x6784('0x6c'),_0x6784('0x6d'),_0x6784('0x59'),_0x6784('0x3b'),_0x6784('0x6e'),_0x6784('0x6f'),_0x6784('0x70'),_0x6784('0x71'),_0x6784('0x72'),'active',_0x6784('0x73'),_0x6784('0x74'),_0x6784('0x75'),_0x6784('0x76'),_0x6784('0x77'),_0x6784('0x78'),_0x6784('0x79'),_0x6784('0x7a'),'business_duration',_0x6784('0x7b'),'work_end','reopened_time',_0x6784('0x7c'),_0x6784('0x7d'),_0x6784('0x7e'),_0x6784('0x5a'),_0x6784('0x7f'),_0x6784('0x80'),_0x6784('0x5b'),_0x6784('0x81'),'delivery_task',_0x6784('0x82'),_0x6784('0x83'),_0x6784('0x84'),_0x6784('0x85'),_0x6784('0x86'),_0x6784('0x87'),_0x6784('0x5c'),_0x6784('0x88'),_0x6784('0x89'),_0x6784('0x8a'),'follow_up','parent_incident','sys_id',_0x6784('0x8b'),_0x6784('0x8c'),_0x6784('0x5d'),_0x6784('0x8d'),'problem_id',_0x6784('0x8e'),_0x6784('0x8f'),_0x6784('0x90'),_0x6784('0x91'),'severity',_0x6784('0x92'),_0x6784('0x93'),_0x6784('0x94'),_0x6784('0x95'),_0x6784('0x96'),_0x6784('0x97'),_0x6784('0x98'),_0x6784('0x99'),_0x6784('0x9a'),_0x6784('0x9b'),_0x6784('0x9c'),_0x6784('0x9d'),_0x6784('0x9e')];var _0x3cac7d='';var _0x139afd='';var _0x5baa28=[];var _0x3648f7='';var _0x3b9e5c='';var _0x304c2c=[];var _0x1f3ed6='';var _0x76ef4d='';var _0x2d9e2e={};var _0x585c18='';return db[_0x6784('0x2c')][_0x6784('0x4b')]({'where':{'id':_0x215f71[_0x6784('0x45')]['id']},'attributes':['id',_0x6784('0x9f'),_0x6784('0xa0'),_0x6784('0xa1'),_0x6784('0xa2'),'serverUrl']})[_0x6784('0x24')](handleEntityNotFound(_0x50074,null))[_0x6784('0x24')](function(_0x3d7091){if(_0x3d7091){_0x585c18=_0x3d7091[_0x6784('0xa2')];var _0x2b51f9=_0x585c18['slice'](-0x1);if(_0x2b51f9==='/'){_0x585c18=_0x585c18[_0x6784('0xa3')](0x0,_0x585c18[_0x6784('0xa4')](_0x2b51f9));}_0x76ef4d=util[_0x6784('0xa5')](_0x6784('0xa6'),_0x585c18);_0x1f3ed6=util[_0x6784('0xa5')](_0x6784('0xa7'),_0x585c18);_0x2d9e2e={'user':_0x3d7091[_0x6784('0x9f')],'pass':_0x3d7091[_0x6784('0xa0')]};var _0xd52d9={'method':'GET','uri':_0x76ef4d+_0x6784('0xa8'),'auth':_0x2d9e2e,'json':!![]};return rp(_0xd52d9);}})[_0x6784('0x24')](function(_0x24bf71){if(_0x24bf71[_0x6784('0xa9')][_0x6784('0x38')]>0x0){_0x3cac7d=_0x24bf71['result'];}console[_0x6784('0xaa')]('incident\x20table\x20objects',_0x3cac7d);_0x304c2c=[];_0x139afd=Object[_0x6784('0xab')]([],_0x3cac7d);_[_0x6784('0xac')](_0x139afd,function(_0x5649dd){return!_0x3c56bf['includes'](_0x5649dd[_0x6784('0x28')]);});_0x139afd[_0x6784('0xad')](function(_0x3f6f4d){var _0x2e067b=createFieldObject(_0x1f3ed6,_0x2d9e2e,_0x3f6f4d[_0x6784('0xae')],_0x3f6f4d[_0x6784('0x28')],_0x3f6f4d[_0x6784('0xaf')],![]);_0x304c2c[_0x6784('0xb0')](_0x2e067b);});return Promise[_0x6784('0xb1')](_0x304c2c);})[_0x6784('0x24')](function(_0x1117a2){_0x5baa28=_0x1117a2;_0x3648f7=Object[_0x6784('0xab')]([],_0x3cac7d);console[_0x6784('0xaa')](_0x6784('0xb2'),_0x3cac7d);_[_0x6784('0xac')](_0x3648f7,function(_0x2f34d4){return _0x1dca63[_0x6784('0xb3')](_0x2f34d4[_0x6784('0x28')]);});console[_0x6784('0xaa')](_0x6784('0xb4'),_0x3648f7);_0x304c2c=[];_0x3648f7[_0x6784('0xad')](function(_0x3d6a46){var _0x2b8626=createFieldObject(_0x1f3ed6,_0x2d9e2e,_0x3d6a46[_0x6784('0xae')],_0x3d6a46[_0x6784('0x28')],_0x3d6a46[_0x6784('0xaf')],!![]);_0x304c2c['push'](_0x2b8626);});return Promise[_0x6784('0xb1')](_0x304c2c);})['then'](function(_0x18bece){_0x3b9e5c=_0x18bece;var _0x5078ab=_0x5baa28[_0x6784('0xb5')](_0x3b9e5c);return{'count':_0x5078ab[_0x6784('0x38')],'rows':_0x5078ab};})[_0x6784('0x24')](respondWithResult(_0x50074,null))[_0x6784('0x4e')](function(_0x5ea729){console[_0x6784('0xaa')](_0x6784('0xb6')+_0x5ea729);var _0x22d37d=_0x215f71['query'][_0x6784('0xb7')]?0x1f4:_0x5ea729[_0x6784('0xb8')]||0x1f4;logger[_0x6784('0x26')](_0x5ea729[_0x6784('0x27')]);delete _0x5ea729['name'];if(_0x22d37d===0x191){_0x22d37d=0x190;}_0x50074['status'](_0x22d37d)[_0x6784('0x29')](_0x215f71['query'][_0x6784('0xb7')]?{'message':_0x6784('0xb9'),'statusCode':_0x5ea729[_0x6784('0xb8')]}:_0x5ea729);});};function createFieldObject(_0x3aa852,_0x3f812c,_0x5a453d,_0x28b1ef,_0x388a6a,_0x4ad6ce){return new Promise(function(_0x320c09,_0xd5eb42){var _0x2591f8={'id':_0x28b1ef,'name':_0x388a6a,'custom':_0x4ad6ce};if(_0x5a453d===_0x6784('0xba')){_0x2591f8[_0x6784('0x46')]=[{'name':_0x6784('0xbb'),'value':'true'},{'name':_0x6784('0xbc'),'value':_0x6784('0xbd')}];_0x320c09(_0x2591f8);}else{var _0x1218f7={'method':'GET','uri':_0x3aa852+_0x6784('0xbe')+_0x28b1ef,'auth':_0x3f812c,'json':!![]};return rp(_0x1218f7)[_0x6784('0x24')](function(_0x41edfe){var _0xa31c14=[];if(_0x41edfe[_0x6784('0xa9')][_0x6784('0x38')]>0x0){_0x41edfe[_0x6784('0xa9')][_0x6784('0xad')](function(_0x240d51){if(_0x240d51['inactive']===_0x6784('0xbd')){var _0x7712ff={'name':_0x240d51[_0x6784('0xaf')],'value':_0x240d51[_0x6784('0xbf')]};_0xa31c14[_0x6784('0xb0')](_0x7712ff);}});}_0x2591f8[_0x6784('0x46')]=_0xa31c14;if(_0x2591f8[_0x6784('0x46')][_0x6784('0x38')]>0x0){_0x320c09(_0x2591f8);}else{if(_0x4ad6ce==![]){_0x320c09();}else{_0x320c09(_0x2591f8);}}});}});} \ No newline at end of file +var _0x3651=['filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','Subjects','channel','Descriptions','ServicenowField','getFields','hold_reason','subcategory','notify','incident_state','severity','category','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','delivery_task','work_start','assignment_group','business_stc','calendar_duration','close_notes','closed_by','parent_incident','sys_id','reopened_by','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','upon_approval','location','username','password','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','result','log','includes','forEach','internalType','label','push','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','then','error','stack','name','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3651,0x78));var _0x1365=function(_0x242554,_0x389fb0){_0x242554=_0x242554-0x0;var _0x1308e5=_0x3651[_0x242554];return _0x1308e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1365('0x0'));var zipdir=require(_0x1365('0x1'));var jsonpatch=require(_0x1365('0x2'));var rp=require(_0x1365('0x3'));var moment=require(_0x1365('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1365('0x5'));var path=require(_0x1365('0x6'));var sox=require('sox');var csv=require(_0x1365('0x7'));var ejs=require(_0x1365('0x8'));var fs=require('fs');var fs_extra=require(_0x1365('0x9'));var _=require('lodash');var squel=require(_0x1365('0xa'));var crypto=require(_0x1365('0xb'));var jsforce=require(_0x1365('0xc'));var deskjs=require(_0x1365('0xd'));var toCsv=require(_0x1365('0x7'));var querystring=require(_0x1365('0xe'));var Papa=require(_0x1365('0xf'));var Redis=require('ioredis');var authService=require(_0x1365('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1365('0x11'));var hardwareService=require(_0x1365('0x12'));var logger=require(_0x1365('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1365('0x14'));var licenseUtil=require(_0x1365('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b38ad,_0x18b3d8){_0x18b3d8=_0x18b3d8||0xcc;return function(_0x4fb680){if(_0x4fb680){return _0x5b38ad[_0x1365('0x16')](_0x18b3d8);}return _0x5b38ad[_0x1365('0x17')](_0x18b3d8)[_0x1365('0x18')]();};}function respondWithResult(_0x1f03b2,_0x425c1a){_0x425c1a=_0x425c1a||0xc8;return function(_0x10ab6a){if(_0x10ab6a){return _0x1f03b2[_0x1365('0x17')](_0x425c1a)['json'](_0x10ab6a);}};}function respondWithFilteredResult(_0x589268,_0x42c1c3){return function(_0x4840dd){if(_0x4840dd){var _0x2792be=typeof _0x42c1c3['offset']==='undefined'&&typeof _0x42c1c3[_0x1365('0x19')]===_0x1365('0x1a');var _0x4a6769=_0x4840dd[_0x1365('0x1b')];var _0x383083=_0x2792be?0x0:_0x42c1c3[_0x1365('0x1c')];var _0x3c4f62=_0x2792be?_0x4840dd[_0x1365('0x1b')]:_0x42c1c3[_0x1365('0x1c')]+_0x42c1c3[_0x1365('0x19')];var _0x506dd7;if(_0x3c4f62>=_0x4a6769){_0x3c4f62=_0x4a6769;_0x506dd7=0xc8;}else{_0x506dd7=0xce;}_0x589268[_0x1365('0x17')](_0x506dd7);return _0x589268[_0x1365('0x1d')](_0x1365('0x1e'),_0x383083+'-'+_0x3c4f62+'/'+_0x4a6769)['json'](_0x4840dd);}return null;};}function patchUpdates(_0x5783a9){return function(_0x24b8c4){try{jsonpatch['apply'](_0x24b8c4,_0x5783a9,!![]);}catch(_0x14fd28){return BPromise[_0x1365('0x1f')](_0x14fd28);}return _0x24b8c4[_0x1365('0x20')]();};}function saveUpdates(_0x5a37a1,_0x133b73){return function(_0x426922){if(_0x426922){return _0x426922['update'](_0x5a37a1)['then'](function(_0x12eb49){return _0x12eb49;});}return null;};}function removeEntity(_0x1f6ea7,_0x2045e3){return function(_0x2ac7f6){if(_0x2ac7f6){return _0x2ac7f6['destroy']()[_0x1365('0x21')](function(){_0x1f6ea7[_0x1365('0x17')](0xcc)[_0x1365('0x18')]();});}};}function handleEntityNotFound(_0x46d707,_0x507a1a){return function(_0x2274eb){if(!_0x2274eb){_0x46d707['sendStatus'](0x194);}return _0x2274eb;};}function handleError(_0x2dc386,_0x415a99){_0x415a99=_0x415a99||0x1f4;return function(_0x1fcd5d){logger[_0x1365('0x22')](_0x1fcd5d[_0x1365('0x23')]);if(_0x1fcd5d[_0x1365('0x24')]){delete _0x1fcd5d[_0x1365('0x24')];}_0x2dc386[_0x1365('0x17')](_0x415a99)['send'](_0x1fcd5d);};}exports[_0x1365('0x25')]=function(_0x167e2c,_0x11bb4e){var _0x47af2c={},_0x5d8522={},_0x465e3c={'count':0x0,'rows':[]};var _0xbf6fa4=_[_0x1365('0x26')](db[_0x1365('0x27')]['rawAttributes'],function(_0x18641d){return{'name':_0x18641d[_0x1365('0x28')],'type':_0x18641d[_0x1365('0x29')][_0x1365('0x2a')]};});_0x5d8522[_0x1365('0x2b')]=_[_0x1365('0x26')](_0xbf6fa4,'name');_0x5d8522[_0x1365('0x2c')]=_[_0x1365('0x2d')](_0x167e2c[_0x1365('0x2c')]);_0x5d8522[_0x1365('0x2e')]=_[_0x1365('0x2f')](_0x5d8522[_0x1365('0x2b')],_0x5d8522[_0x1365('0x2c')]);_0x47af2c[_0x1365('0x30')]=_[_0x1365('0x2f')](_0x5d8522['model'],qs[_0x1365('0x31')](_0x167e2c[_0x1365('0x2c')][_0x1365('0x31')]));_0x47af2c['attributes']=_0x47af2c['attributes'][_0x1365('0x32')]?_0x47af2c[_0x1365('0x30')]:_0x5d8522[_0x1365('0x2b')];if(!_0x167e2c[_0x1365('0x2c')][_0x1365('0x33')](_0x1365('0x34'))){_0x47af2c['limit']=qs[_0x1365('0x19')](_0x167e2c[_0x1365('0x2c')]['limit']);_0x47af2c[_0x1365('0x1c')]=qs[_0x1365('0x1c')](_0x167e2c[_0x1365('0x2c')][_0x1365('0x1c')]);}_0x47af2c[_0x1365('0x35')]=qs[_0x1365('0x36')](_0x167e2c[_0x1365('0x2c')][_0x1365('0x36')]);_0x47af2c[_0x1365('0x37')]=qs[_0x1365('0x2e')](_['pick'](_0x167e2c['query'],_0x5d8522[_0x1365('0x2e')]),_0xbf6fa4);if(_0x167e2c[_0x1365('0x2c')][_0x1365('0x38')]){_0x47af2c['where']=_[_0x1365('0x39')](_0x47af2c[_0x1365('0x37')],{'$or':_[_0x1365('0x26')](_0xbf6fa4,function(_0x4ac8a3){if(_0x4ac8a3[_0x1365('0x29')]!=='VIRTUAL'){var _0x220665={};_0x220665[_0x4ac8a3[_0x1365('0x24')]]={'$like':'%'+_0x167e2c[_0x1365('0x2c')]['filter']+'%'};return _0x220665;}})});}_0x47af2c=_['merge']({},_0x47af2c,_0x167e2c[_0x1365('0x3a')]);var _0x1d4337={'where':_0x47af2c[_0x1365('0x37')]};return db[_0x1365('0x27')][_0x1365('0x1b')](_0x1d4337)[_0x1365('0x21')](function(_0xbd66ad){_0x465e3c[_0x1365('0x1b')]=_0xbd66ad;if(_0x167e2c[_0x1365('0x2c')][_0x1365('0x3b')]){_0x47af2c['include']=[{'all':!![]}];}return db[_0x1365('0x27')][_0x1365('0x3c')](_0x47af2c);})[_0x1365('0x21')](function(_0x2a6ba0){_0x465e3c[_0x1365('0x3d')]=_0x2a6ba0;return _0x465e3c;})[_0x1365('0x21')](respondWithFilteredResult(_0x11bb4e,_0x47af2c))[_0x1365('0x3e')](handleError(_0x11bb4e,null));};exports[_0x1365('0x3f')]=function(_0x29207f,_0x413832){var _0x29ecc2={'raw':![],'where':{'id':_0x29207f[_0x1365('0x40')]['id']}},_0x1f352f={};_0x1f352f[_0x1365('0x2b')]=_[_0x1365('0x2d')](db[_0x1365('0x27')][_0x1365('0x41')]);_0x1f352f['query']=_[_0x1365('0x2d')](_0x29207f[_0x1365('0x2c')]);_0x1f352f[_0x1365('0x2e')]=_[_0x1365('0x2f')](_0x1f352f[_0x1365('0x2b')],_0x1f352f[_0x1365('0x2c')]);_0x29ecc2[_0x1365('0x30')]=_[_0x1365('0x2f')](_0x1f352f[_0x1365('0x2b')],qs[_0x1365('0x31')](_0x29207f['query'][_0x1365('0x31')]));_0x29ecc2[_0x1365('0x30')]=_0x29ecc2['attributes'][_0x1365('0x32')]?_0x29ecc2['attributes']:_0x1f352f[_0x1365('0x2b')];if(_0x29207f[_0x1365('0x2c')][_0x1365('0x3b')]){_0x29ecc2['include']=[{'all':!![]}];}_0x29ecc2=_[_0x1365('0x39')]({},_0x29ecc2,_0x29207f[_0x1365('0x3a')]);return db[_0x1365('0x27')][_0x1365('0x42')](_0x29ecc2)[_0x1365('0x21')](handleEntityNotFound(_0x413832,null))['then'](respondWithResult(_0x413832,null))['catch'](handleError(_0x413832,null));};exports[_0x1365('0x43')]=function(_0x1cbc03,_0x437808){return db[_0x1365('0x27')]['create'](_0x1cbc03[_0x1365('0x44')],{})[_0x1365('0x21')](respondWithResult(_0x437808,0xc9))['catch'](handleError(_0x437808,null));};exports[_0x1365('0x45')]=function(_0x188f2e,_0x4e8a3f){if(_0x188f2e['body']['id']){delete _0x188f2e[_0x1365('0x44')]['id'];}return db[_0x1365('0x27')][_0x1365('0x42')]({'where':{'id':_0x188f2e[_0x1365('0x40')]['id']}})[_0x1365('0x21')](handleEntityNotFound(_0x4e8a3f,null))[_0x1365('0x21')](saveUpdates(_0x188f2e[_0x1365('0x44')],null))[_0x1365('0x21')](respondWithResult(_0x4e8a3f,null))[_0x1365('0x3e')](handleError(_0x4e8a3f,null));};exports['destroy']=function(_0x23db5d,_0x29c910){return db[_0x1365('0x27')][_0x1365('0x42')]({'where':{'id':_0x23db5d['params']['id']}})[_0x1365('0x21')](handleEntityNotFound(_0x29c910,null))['then'](removeEntity(_0x29c910,null))[_0x1365('0x3e')](handleError(_0x29c910,null));};exports[_0x1365('0x46')]=function(_0x3a34e5,_0xe8bd26,_0x5cfeb5){var _0x59c2da={};var _0x11b254={};var _0x918d2b;var _0x3e3ec1;return db[_0x1365('0x27')][_0x1365('0x47')]({'where':{'id':_0x3a34e5[_0x1365('0x40')]['id']}})[_0x1365('0x21')](handleEntityNotFound(_0xe8bd26,null))[_0x1365('0x21')](function(_0x12d811){if(_0x12d811){_0x918d2b=_0x12d811;_0x11b254[_0x1365('0x2b')]=_[_0x1365('0x2d')](db[_0x1365('0x48')][_0x1365('0x41')]);_0x11b254['query']=_['keys'](_0x3a34e5[_0x1365('0x2c')]);_0x11b254['filters']=_[_0x1365('0x2f')](_0x11b254[_0x1365('0x2b')],_0x11b254[_0x1365('0x2c')]);_0x59c2da[_0x1365('0x30')]=_['intersection'](_0x11b254[_0x1365('0x2b')],qs['fields'](_0x3a34e5[_0x1365('0x2c')]['fields']));_0x59c2da[_0x1365('0x30')]=_0x59c2da[_0x1365('0x30')][_0x1365('0x32')]?_0x59c2da[_0x1365('0x30')]:_0x11b254[_0x1365('0x2b')];_0x59c2da[_0x1365('0x35')]=qs[_0x1365('0x36')](_0x3a34e5[_0x1365('0x2c')][_0x1365('0x36')]);_0x59c2da[_0x1365('0x37')]=qs[_0x1365('0x2e')](_['pick'](_0x3a34e5[_0x1365('0x2c')],_0x11b254['filters']));if(_0x3a34e5[_0x1365('0x2c')][_0x1365('0x38')]){_0x59c2da[_0x1365('0x37')]=_[_0x1365('0x39')](_0x59c2da[_0x1365('0x37')],{'$or':_['map'](_0x59c2da[_0x1365('0x30')],function(_0x266c84){var _0x379175={};_0x379175[_0x266c84]={'$like':'%'+_0x3a34e5['query'][_0x1365('0x38')]+'%'};return _0x379175;})});}_0x59c2da=_['merge']({},_0x59c2da,_0x3a34e5[_0x1365('0x3a')]);return _0x918d2b[_0x1365('0x46')](_0x59c2da);}})[_0x1365('0x21')](function(_0x27bb1c){if(_0x27bb1c){_0x3e3ec1=_0x27bb1c[_0x1365('0x32')];if(!_0x3a34e5[_0x1365('0x2c')]['hasOwnProperty']('nolimit')){_0x59c2da[_0x1365('0x19')]=qs[_0x1365('0x19')](_0x3a34e5[_0x1365('0x2c')][_0x1365('0x19')]);_0x59c2da[_0x1365('0x1c')]=qs[_0x1365('0x1c')](_0x3a34e5['query'][_0x1365('0x1c')]);}return _0x918d2b[_0x1365('0x46')](_0x59c2da);}})[_0x1365('0x21')](function(_0x4bd07f){if(_0x4bd07f){return _0x4bd07f?{'count':_0x3e3ec1,'rows':_0x4bd07f}:null;}})[_0x1365('0x21')](respondWithResult(_0xe8bd26,null))[_0x1365('0x3e')](handleError(_0xe8bd26,null));};exports[_0x1365('0x49')]=function(_0x3d3040,_0x49ee77,_0x4bafbf){if(_0x3d3040[_0x1365('0x44')]['id']){delete _0x3d3040['body']['id'];}return db[_0x1365('0x27')]['findOne']({'where':{'id':_0x3d3040[_0x1365('0x40')]['id']}})[_0x1365('0x21')](handleEntityNotFound(_0x49ee77,null))['then'](function(_0x52f5ff){if(_0x52f5ff){_0x3d3040[_0x1365('0x44')]['AccountId']=_0x52f5ff['id'];_0x3d3040[_0x1365('0x44')][_0x1365('0x4a')]=integrations['getSubjects'](_0x3d3040['body'][_0x1365('0x4b')],_0x3d3040[_0x1365('0x44')][_0x1365('0x29')]);_0x3d3040['body'][_0x1365('0x4c')]=integrations['getDescriptions'](_0x3d3040[_0x1365('0x44')][_0x1365('0x4b')],_0x3d3040[_0x1365('0x44')]['type']);return db[_0x1365('0x48')][_0x1365('0x43')](_0x3d3040[_0x1365('0x44')],{'include':[{'model':db[_0x1365('0x4d')],'as':_0x1365('0x4a')},{'model':db[_0x1365('0x4d')],'as':_0x1365('0x4c')}]});}return null;})[_0x1365('0x21')](respondWithResult(_0x49ee77,null))[_0x1365('0x3e')](handleError(_0x49ee77,null));};exports[_0x1365('0x4e')]=function(_0xa7282b,_0x590127,_0x6cde78){var _0x140e6d=['made_sla',_0x1365('0x4f'),'knowledge',_0x1365('0x50'),'close_code',_0x1365('0x51'),_0x1365('0x52'),_0x1365('0x53'),_0x1365('0x54')];var _0x15134b=[_0x1365('0x55'),'made_sla','caused_by','watch_list',_0x1365('0x56'),_0x1365('0x57'),_0x1365('0x58'),'hold_reason',_0x1365('0x59'),_0x1365('0x5a'),'resolved_by',_0x1365('0x5b'),_0x1365('0x5c'),_0x1365('0x5d'),'sys_created_on',_0x1365('0x5e'),_0x1365('0x5f'),_0x1365('0x60'),_0x1365('0x61'),'order',_0x1365('0x62'),_0x1365('0x63'),_0x1365('0x64'),'delivery_plan',_0x1365('0x65'),_0x1365('0x66'),_0x1365('0x67'),_0x1365('0x68'),_0x1365('0x69'),_0x1365('0x6a'),_0x1365('0x6b'),_0x1365('0x6c'),_0x1365('0x6d'),_0x1365('0x6e'),_0x1365('0x6f'),_0x1365('0x70'),_0x1365('0x71'),'reopened_time',_0x1365('0x72'),_0x1365('0x73'),_0x1365('0x74'),_0x1365('0x50'),_0x1365('0x75'),'short_description','close_code','correlation_display',_0x1365('0x76'),_0x1365('0x77'),_0x1365('0x78'),_0x1365('0x79'),'additional_assignee_list','description',_0x1365('0x7a'),_0x1365('0x51'),'sys_class_name',_0x1365('0x7b'),_0x1365('0x7c'),'follow_up',_0x1365('0x7d'),_0x1365('0x7e'),'contact_type',_0x1365('0x7f'),_0x1365('0x52'),_0x1365('0x80'),_0x1365('0x81'),_0x1365('0x82'),_0x1365('0x83'),_0x1365('0x84'),_0x1365('0x85'),_0x1365('0x53'),_0x1365('0x86'),_0x1365('0x87'),_0x1365('0x88'),_0x1365('0x89'),_0x1365('0x8a'),_0x1365('0x8b'),_0x1365('0x8c'),_0x1365('0x8d'),_0x1365('0x8e'),_0x1365('0x8f'),'correlation_id',_0x1365('0x90'),_0x1365('0x54')];var _0x43e60f='';var _0x575ddd='';var _0x45cd4f=[];var _0x375ea2='';var _0x432f5a='';var _0x43718b=[];var _0x531a39='';var _0x52335f='';var _0x29f265={};var _0x3c85d1='';return db[_0x1365('0x27')][_0x1365('0x47')]({'where':{'id':_0xa7282b[_0x1365('0x40')]['id']},'attributes':['id',_0x1365('0x91'),_0x1365('0x92'),'email',_0x1365('0x93'),_0x1365('0x94')]})[_0x1365('0x21')](handleEntityNotFound(_0x590127,null))[_0x1365('0x21')](function(_0x479ce1){if(_0x479ce1){_0x3c85d1=_0x479ce1[_0x1365('0x93')];var _0x4c44e3=_0x3c85d1[_0x1365('0x95')](-0x1);if(_0x4c44e3==='/'){_0x3c85d1=_0x3c85d1[_0x1365('0x96')](0x0,_0x3c85d1['lastIndexOf'](_0x4c44e3));}_0x52335f=util[_0x1365('0x97')](_0x1365('0x98'),_0x3c85d1);_0x531a39=util[_0x1365('0x97')]('%s/api/now/table/',_0x3c85d1);_0x29f265={'user':_0x479ce1[_0x1365('0x91')],'pass':_0x479ce1[_0x1365('0x92')]};var _0x561a71={'method':_0x1365('0x99'),'uri':_0x52335f+'incident?sysparm_display_value=all','auth':_0x29f265,'json':!![]};return rp(_0x561a71);}})[_0x1365('0x21')](function(_0x281660){if(_0x281660[_0x1365('0x9a')][_0x1365('0x32')]>0x0){_0x43e60f=_0x281660[_0x1365('0x9a')];}console[_0x1365('0x9b')]('incident\x20table\x20objects',_0x43e60f);_0x43718b=[];_0x575ddd=Object['assign']([],_0x43e60f);_['remove'](_0x575ddd,function(_0x5dde7b){return!_0x140e6d[_0x1365('0x9c')](_0x5dde7b[_0x1365('0x24')]);});_0x575ddd[_0x1365('0x9d')](function(_0x13e28a){var _0x440e6b=createFieldObject(_0x531a39,_0x29f265,_0x13e28a[_0x1365('0x9e')],_0x13e28a[_0x1365('0x24')],_0x13e28a[_0x1365('0x9f')],![]);_0x43718b[_0x1365('0xa0')](_0x440e6b);});return Promise[_0x1365('0xa1')](_0x43718b);})[_0x1365('0x21')](function(_0x3dfcd0){_0x45cd4f=_0x3dfcd0;_0x375ea2=Object[_0x1365('0xa2')]([],_0x43e60f);console[_0x1365('0x9b')]('TCL:\x20_object',_0x43e60f);_['remove'](_0x375ea2,function(_0x3f39f4){return _0x15134b['includes'](_0x3f39f4[_0x1365('0x24')]);});console['log'](_0x1365('0xa3'),_0x375ea2);_0x43718b=[];_0x375ea2[_0x1365('0x9d')](function(_0x10d049){var _0x7d91e3=createFieldObject(_0x531a39,_0x29f265,_0x10d049[_0x1365('0x9e')],_0x10d049[_0x1365('0x24')],_0x10d049[_0x1365('0x9f')],!![]);_0x43718b[_0x1365('0xa0')](_0x7d91e3);});return Promise[_0x1365('0xa1')](_0x43718b);})[_0x1365('0x21')](function(_0x3d2a74){_0x432f5a=_0x3d2a74;var _0x1253d4=_0x45cd4f['concat'](_0x432f5a);return{'count':_0x1253d4[_0x1365('0x32')],'rows':_0x1253d4};})[_0x1365('0x21')](respondWithResult(_0x590127,null))[_0x1365('0x3e')](function(_0x1acbbd){console[_0x1365('0x9b')](_0x1365('0xa4')+_0x1acbbd);var _0x2d510b=_0xa7282b['query'][_0x1365('0xa5')]?0x1f4:_0x1acbbd['statusCode']||0x1f4;logger['error'](_0x1acbbd[_0x1365('0x23')]);delete _0x1acbbd[_0x1365('0x24')];if(_0x2d510b===0x191){_0x2d510b=0x190;}_0x590127['status'](_0x2d510b)[_0x1365('0xa6')](_0xa7282b[_0x1365('0x2c')][_0x1365('0xa5')]?{'message':_0x1365('0xa7'),'statusCode':_0x1acbbd['statusCode']}:_0x1acbbd);});};function createFieldObject(_0x5dd2ae,_0x4032da,_0x2ac0c5,_0x40c734,_0x20047c,_0x4c90e7){return new Promise(function(_0x118470,_0x152133){var _0x32731d={'id':_0x40c734,'name':_0x20047c,'custom':_0x4c90e7};if(_0x2ac0c5===_0x1365('0xa8')){_0x32731d[_0x1365('0x3a')]=[{'name':_0x1365('0xa9'),'value':_0x1365('0xaa')},{'name':_0x1365('0xab'),'value':'false'}];_0x118470(_0x32731d);}else{var _0x36d9e8={'method':_0x1365('0x99'),'uri':_0x5dd2ae+_0x1365('0xac')+_0x40c734,'auth':_0x4032da,'json':!![]};return rp(_0x36d9e8)[_0x1365('0x21')](function(_0x362f07){var _0x6b3a5d=[];if(_0x362f07[_0x1365('0x9a')][_0x1365('0x32')]>0x0){_0x362f07[_0x1365('0x9a')][_0x1365('0x9d')](function(_0x158dcc){if(_0x158dcc[_0x1365('0xad')]===_0x1365('0xae')){var _0x2d96a2={'name':_0x158dcc['label'],'value':_0x158dcc[_0x1365('0xaf')]};_0x6b3a5d[_0x1365('0xa0')](_0x2d96a2);}});}_0x32731d[_0x1365('0x3a')]=_0x6b3a5d;if(_0x32731d[_0x1365('0x3a')][_0x1365('0x32')]>0x0){_0x118470(_0x32731d);}else{if(_0x4c90e7==![]){_0x118470();}else{_0x118470(_0x32731d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1ab8a5e..52946c9 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 _0xee14=['ServicenowAccount','int_servicenow_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define'];(function(_0x2003ac,_0x3d521d){var _0x2148d9=function(_0x2cd21f){while(--_0x2cd21f){_0x2003ac['push'](_0x2003ac['shift']());}};_0x2148d9(++_0x3d521d);}(_0xee14,0x13a));var _0x4ee1=function(_0x2213a9,_0x4ee716){_0x2213a9=_0x2213a9-0x0;var _0x4ab15f=_0xee14[_0x2213a9];return _0x4ab15f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4ee1('0x9')]=function(_0x573700,_0x327c18){return _0x573700[_0x4ee1('0xa')](_0x4ee1('0xb'),attributes,{'tableName':_0x4ee1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x57aec1,_0x2b6744){var _0x4597ae=function(_0x505364){while(--_0x505364){_0x57aec1['push'](_0x57aec1['shift']());}};_0x4597ae(++_0x2b6744);}(_0x187d,0x93));var _0xd187=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x187d[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index bb85564..b5eb7bc 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 _0xc9b3=['then','info','request\x20sent','debug','error','message','ServicenowAccount,\x20%s,\x20%s','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xc9b3,0x152));var _0x3c9b=function(_0x48e108,_0x348032){_0x48e108=_0x48e108-0x0;var _0x4a0170=_0xc9b3[_0x48e108];return _0x4a0170;};'use strict';var _=require(_0x3c9b('0x0'));var util=require(_0x3c9b('0x1'));var moment=require(_0x3c9b('0x2'));var BPromise=require(_0x3c9b('0x3'));var rs=require(_0x3c9b('0x4'));var fs=require('fs');var Redis=require(_0x3c9b('0x5'));var db=require(_0x3c9b('0x6'))['db'];var utils=require(_0x3c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c9b('0x8'));var jayson=require(_0x3c9b('0x9'));var client=jayson['client'][_0x3c9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c43c6,_0x12c209,_0x2a9272){return new BPromise(function(_0x2a064f,_0xa216c1){return client[_0x3c9b('0xb')](_0x1c43c6,_0x2a9272)[_0x3c9b('0xc')](function(_0x1cd62e){logger[_0x3c9b('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x12c209,_0x3c9b('0xe'));logger[_0x3c9b('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x12c209,_0x3c9b('0xe'),JSON['stringify'](_0x1cd62e));if(_0x1cd62e[_0x3c9b('0x10')]){if(_0x1cd62e[_0x3c9b('0x10')]['code']===0x1f4){logger[_0x3c9b('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x12c209,_0x1cd62e[_0x3c9b('0x10')][_0x3c9b('0x11')]);return _0xa216c1(_0x1cd62e[_0x3c9b('0x10')][_0x3c9b('0x11')]);}logger[_0x3c9b('0x10')](_0x3c9b('0x12'),_0x12c209,_0x1cd62e[_0x3c9b('0x10')][_0x3c9b('0x11')]);return _0x2a064f(_0x1cd62e[_0x3c9b('0x10')][_0x3c9b('0x11')]);}else{logger[_0x3c9b('0xd')](_0x3c9b('0x12'),_0x12c209,'request\x20sent');_0x2a064f(_0x1cd62e[_0x3c9b('0x13')]['message']);}})[_0x3c9b('0x14')](function(_0x47da8b){logger['error'](_0x3c9b('0x12'),_0x12c209,_0x47da8b);_0xa216c1(_0x47da8b);});});}exports['GetServicenowAccount']=function(_0x69fd71){var _0x530c7c=this;return new Promise(function(_0x4ffd29,_0x2e4d8b){return db[_0x3c9b('0x15')][_0x3c9b('0x16')]({'raw':_0x69fd71['options']?_0x69fd71[_0x3c9b('0x17')][_0x3c9b('0x18')]===undefined?!![]:![]:!![],'where':_0x69fd71['options']?_0x69fd71['options'][_0x3c9b('0x19')]||null:null,'attributes':_0x69fd71[_0x3c9b('0x17')]?_0x69fd71['options'][_0x3c9b('0x1a')]||null:null,'limit':_0x69fd71[_0x3c9b('0x17')]?_0x69fd71[_0x3c9b('0x17')][_0x3c9b('0x1b')]||null:null,'include':_0x69fd71[_0x3c9b('0x17')]?_0x69fd71[_0x3c9b('0x17')][_0x3c9b('0x1c')]?_['map'](_0x69fd71[_0x3c9b('0x17')][_0x3c9b('0x1c')],function(_0x31d4a7){return{'model':db[_0x31d4a7[_0x3c9b('0x1d')]],'as':_0x31d4a7['as'],'attributes':_0x31d4a7[_0x3c9b('0x1a')],'include':_0x31d4a7[_0x3c9b('0x1c')]?_[_0x3c9b('0x1e')](_0x31d4a7['include'],function(_0x58ea63){return{'model':db[_0x58ea63[_0x3c9b('0x1d')]],'as':_0x58ea63['as'],'attributes':_0x58ea63[_0x3c9b('0x1a')],'include':_0x58ea63[_0x3c9b('0x1c')]?_[_0x3c9b('0x1e')](_0x58ea63['include'],function(_0x19a429){return{'model':db[_0x19a429[_0x3c9b('0x1d')]],'as':_0x19a429['as'],'attributes':_0x19a429[_0x3c9b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x351cd1){logger['info'](_0x3c9b('0x1f'),_0x69fd71);logger[_0x3c9b('0xf')](_0x3c9b('0x1f'),_0x69fd71,JSON[_0x3c9b('0x20')](_0x351cd1));_0x4ffd29(_0x351cd1);})['catch'](function(_0x3d4e18){logger[_0x3c9b('0x10')](_0x3c9b('0x1f'),_0x3d4e18[_0x3c9b('0x11')],_0x69fd71);_0x2e4d8b(_0x530c7c[_0x3c9b('0x10')](0x1f4,_0x3d4e18[_0x3c9b('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x1b8d9c){var _0x55e21e=this;return new Promise(function(_0x41af6c,_0x85fb53){return db['ServicenowAccount'][_0x3c9b('0x21')]({'raw':_0x1b8d9c[_0x3c9b('0x17')]?_0x1b8d9c[_0x3c9b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b8d9c['options']?_0x1b8d9c[_0x3c9b('0x17')]['where']||null:null,'attributes':_0x1b8d9c[_0x3c9b('0x17')]?_0x1b8d9c[_0x3c9b('0x17')][_0x3c9b('0x1a')]||null:null,'include':_0x1b8d9c[_0x3c9b('0x17')]?_0x1b8d9c['options'][_0x3c9b('0x1c')]?_['map'](_0x1b8d9c[_0x3c9b('0x17')][_0x3c9b('0x1c')],function(_0x4f609c){return{'model':db[_0x4f609c[_0x3c9b('0x1d')]],'as':_0x4f609c['as'],'attributes':_0x4f609c[_0x3c9b('0x1a')],'include':_0x4f609c[_0x3c9b('0x1c')]?_['map'](_0x4f609c['include'],function(_0x37b227){return{'model':db[_0x37b227['model']],'as':_0x37b227['as'],'attributes':_0x37b227[_0x3c9b('0x1a')],'include':_0x37b227[_0x3c9b('0x1c')]?_[_0x3c9b('0x1e')](_0x37b227[_0x3c9b('0x1c')],function(_0xdc4fc2){return{'model':db[_0xdc4fc2['model']],'as':_0xdc4fc2['as'],'attributes':_0xdc4fc2[_0x3c9b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3c9b('0xc')](function(_0xa47519){logger['info'](_0x3c9b('0x22'),_0x1b8d9c);logger['debug'](_0x3c9b('0x22'),_0x1b8d9c,JSON[_0x3c9b('0x20')](_0xa47519));_0x41af6c(_0xa47519);})[_0x3c9b('0x14')](function(_0x51afd5){logger['error'](_0x3c9b('0x22'),_0x51afd5[_0x3c9b('0x11')],_0x1b8d9c);_0x85fb53(_0x55e21e['error'](0x1f4,_0x51afd5['message']));});});}; \ No newline at end of file +var _0xd9d8=['include','map','model','debug','catch','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd9d8,0xe0));var _0x8d9d=function(_0x184bb5,_0x4c6fb1){_0x184bb5=_0x184bb5-0x0;var _0x4250fa=_0xd9d8[_0x184bb5];return _0x4250fa;};'use strict';var _=require(_0x8d9d('0x0'));var util=require(_0x8d9d('0x1'));var moment=require(_0x8d9d('0x2'));var BPromise=require(_0x8d9d('0x3'));var rs=require(_0x8d9d('0x4'));var fs=require('fs');var Redis=require(_0x8d9d('0x5'));var db=require(_0x8d9d('0x6'))['db'];var utils=require(_0x8d9d('0x7'));var logger=require('../../config/logger')(_0x8d9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d9d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48e9b5,_0x3fdc7d,_0x15376b){return new BPromise(function(_0x48c7f1,_0x1b47a2){return client[_0x8d9d('0xa')](_0x48e9b5,_0x15376b)[_0x8d9d('0xb')](function(_0x5e7caf){logger[_0x8d9d('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x3fdc7d,_0x8d9d('0xd'));logger['debug'](_0x8d9d('0xe'),_0x3fdc7d,'request\x20sent',JSON[_0x8d9d('0xf')](_0x5e7caf));if(_0x5e7caf['error']){if(_0x5e7caf[_0x8d9d('0x10')][_0x8d9d('0x11')]===0x1f4){logger[_0x8d9d('0x10')](_0x8d9d('0x12'),_0x3fdc7d,_0x5e7caf[_0x8d9d('0x10')][_0x8d9d('0x13')]);return _0x1b47a2(_0x5e7caf[_0x8d9d('0x10')]['message']);}logger[_0x8d9d('0x10')](_0x8d9d('0x12'),_0x3fdc7d,_0x5e7caf[_0x8d9d('0x10')][_0x8d9d('0x13')]);return _0x48c7f1(_0x5e7caf['error'][_0x8d9d('0x13')]);}else{logger[_0x8d9d('0xc')](_0x8d9d('0x12'),_0x3fdc7d,_0x8d9d('0xd'));_0x48c7f1(_0x5e7caf[_0x8d9d('0x14')][_0x8d9d('0x13')]);}})['catch'](function(_0x4d73f5){logger[_0x8d9d('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x3fdc7d,_0x4d73f5);_0x1b47a2(_0x4d73f5);});});}exports[_0x8d9d('0x15')]=function(_0x36c069){var _0x52c8fd=this;return new Promise(function(_0x5ada,_0x357d6a){return db[_0x8d9d('0x16')][_0x8d9d('0x17')]({'raw':_0x36c069[_0x8d9d('0x18')]?_0x36c069['options'][_0x8d9d('0x19')]===undefined?!![]:![]:!![],'where':_0x36c069['options']?_0x36c069[_0x8d9d('0x18')]['where']||null:null,'attributes':_0x36c069[_0x8d9d('0x18')]?_0x36c069[_0x8d9d('0x18')][_0x8d9d('0x1a')]||null:null,'limit':_0x36c069[_0x8d9d('0x18')]?_0x36c069[_0x8d9d('0x18')][_0x8d9d('0x1b')]||null:null,'include':_0x36c069[_0x8d9d('0x18')]?_0x36c069[_0x8d9d('0x18')][_0x8d9d('0x1c')]?_[_0x8d9d('0x1d')](_0x36c069[_0x8d9d('0x18')]['include'],function(_0x14bda7){return{'model':db[_0x14bda7['model']],'as':_0x14bda7['as'],'attributes':_0x14bda7[_0x8d9d('0x1a')],'include':_0x14bda7[_0x8d9d('0x1c')]?_[_0x8d9d('0x1d')](_0x14bda7[_0x8d9d('0x1c')],function(_0x2346bb){return{'model':db[_0x2346bb[_0x8d9d('0x1e')]],'as':_0x2346bb['as'],'attributes':_0x2346bb[_0x8d9d('0x1a')],'include':_0x2346bb[_0x8d9d('0x1c')]?_[_0x8d9d('0x1d')](_0x2346bb[_0x8d9d('0x1c')],function(_0x4753f6){return{'model':db[_0x4753f6[_0x8d9d('0x1e')]],'as':_0x4753f6['as'],'attributes':_0x4753f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d9d('0xb')](function(_0x546955){logger[_0x8d9d('0xc')]('GetServicenowAccount',_0x36c069);logger[_0x8d9d('0x1f')]('GetServicenowAccount',_0x36c069,JSON[_0x8d9d('0xf')](_0x546955));_0x5ada(_0x546955);})[_0x8d9d('0x20')](function(_0x5c8b9f){logger['error'](_0x8d9d('0x15'),_0x5c8b9f[_0x8d9d('0x13')],_0x36c069);_0x357d6a(_0x52c8fd[_0x8d9d('0x10')](0x1f4,_0x5c8b9f['message']));});});};exports[_0x8d9d('0x21')]=function(_0x2cd9f8){var _0x3c6962=this;return new Promise(function(_0x24eeed,_0x5d42bf){return db[_0x8d9d('0x16')][_0x8d9d('0x22')]({'raw':_0x2cd9f8[_0x8d9d('0x18')]?_0x2cd9f8[_0x8d9d('0x18')][_0x8d9d('0x19')]===undefined?!![]:![]:!![],'where':_0x2cd9f8[_0x8d9d('0x18')]?_0x2cd9f8[_0x8d9d('0x18')][_0x8d9d('0x23')]||null:null,'attributes':_0x2cd9f8['options']?_0x2cd9f8[_0x8d9d('0x18')]['attributes']||null:null,'include':_0x2cd9f8['options']?_0x2cd9f8['options'][_0x8d9d('0x1c')]?_[_0x8d9d('0x1d')](_0x2cd9f8[_0x8d9d('0x18')][_0x8d9d('0x1c')],function(_0x4e33b1){return{'model':db[_0x4e33b1[_0x8d9d('0x1e')]],'as':_0x4e33b1['as'],'attributes':_0x4e33b1['attributes'],'include':_0x4e33b1['include']?_[_0x8d9d('0x1d')](_0x4e33b1['include'],function(_0x3cbab2){return{'model':db[_0x3cbab2[_0x8d9d('0x1e')]],'as':_0x3cbab2['as'],'attributes':_0x3cbab2[_0x8d9d('0x1a')],'include':_0x3cbab2[_0x8d9d('0x1c')]?_['map'](_0x3cbab2[_0x8d9d('0x1c')],function(_0x369b58){return{'model':db[_0x369b58[_0x8d9d('0x1e')]],'as':_0x369b58['as'],'attributes':_0x369b58['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d9d('0xb')](function(_0x5b82d5){logger[_0x8d9d('0xc')]('ShowServicenowAccount',_0x2cd9f8);logger[_0x8d9d('0x1f')](_0x8d9d('0x21'),_0x2cd9f8,JSON[_0x8d9d('0xf')](_0x5b82d5));_0x24eeed(_0x5b82d5);})[_0x8d9d('0x20')](function(_0x324d23){logger['error'](_0x8d9d('0x21'),_0x324d23[_0x8d9d('0x13')],_0x2cd9f8);_0x5d42bf(_0x3c6962[_0x8d9d('0x10')](0x1f4,_0x324d23[_0x8d9d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3546fda..7e9d353 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 _0xf841=['/:id/subjects','getSubjects','post','create','put','delete','exports','util','path','connect-timeout','Router','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0xf841,0x66));var _0x1f84=function(_0x4f5633,_0x3ba792){_0x4f5633=_0x4f5633-0x0;var _0x1139d3=_0xf841[_0x4f5633];return _0x1139d3;};'use strict';var multer=require('multer');var util=require(_0x1f84('0x0'));var path=require(_0x1f84('0x1'));var timeout=require(_0x1f84('0x2'));var express=require('express');var router=express[_0x1f84('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1f84('0x4'));router[_0x1f84('0x5')]('/',auth[_0x1f84('0x6')](),controller[_0x1f84('0x7')]);router[_0x1f84('0x5')](_0x1f84('0x8'),auth[_0x1f84('0x6')](),controller[_0x1f84('0x9')]);router['get'](_0x1f84('0xa'),auth[_0x1f84('0x6')](),controller[_0x1f84('0xb')]);router[_0x1f84('0x5')](_0x1f84('0xc'),auth['isAuthenticated'](),controller[_0x1f84('0xd')]);router[_0x1f84('0x5')]('/:id/descriptions',auth[_0x1f84('0x6')](),controller['getDescriptions']);router[_0x1f84('0xe')]('/',auth[_0x1f84('0x6')](),controller[_0x1f84('0xf')]);router[_0x1f84('0x10')](_0x1f84('0x8'),auth[_0x1f84('0x6')](),controller['update']);router[_0x1f84('0x11')]('/:id',auth[_0x1f84('0x6')](),controller['destroy']);module[_0x1f84('0x12')]=router; \ No newline at end of file +var _0x8e54=['../../components/interaction/service','./intServicenowConfiguration.controller','get','index','show','isAuthenticated','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b2675,_0x1423a4){var _0x2e92ae=function(_0x2268a0){while(--_0x2268a0){_0x3b2675['push'](_0x3b2675['shift']());}};_0x2e92ae(++_0x1423a4);}(_0x8e54,0x1b1));var _0x48e5=function(_0x9664c1,_0x16176f){_0x9664c1=_0x9664c1-0x0;var _0x534180=_0x8e54[_0x9664c1];return _0x534180;};'use strict';var multer=require(_0x48e5('0x0'));var util=require(_0x48e5('0x1'));var path=require('path');var timeout=require(_0x48e5('0x2'));var express=require(_0x48e5('0x3'));var router=express[_0x48e5('0x4')]();var fs_extra=require(_0x48e5('0x5'));var auth=require(_0x48e5('0x6'));var interaction=require(_0x48e5('0x7'));var config=require('../../config/environment');var controller=require(_0x48e5('0x8'));router[_0x48e5('0x9')]('/',auth['isAuthenticated'](),controller[_0x48e5('0xa')]);router[_0x48e5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x48e5('0xb')]);router['get']('/:id/fields',auth[_0x48e5('0xc')](),controller['getFields']);router[_0x48e5('0x9')]('/:id/subjects',auth[_0x48e5('0xc')](),controller['getSubjects']);router['get'](_0x48e5('0xd'),auth[_0x48e5('0xc')](),controller[_0x48e5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x48e5('0xf')]);router[_0x48e5('0x10')](_0x48e5('0x11'),auth[_0x48e5('0xc')](),controller[_0x48e5('0x12')]);router[_0x48e5('0x13')](_0x48e5('0x11'),auth[_0x48e5('0xc')](),controller[_0x48e5('0x14')]);module[_0x48e5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 071a9a4..22add41 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 _0x8b5b=['sequelize'];(function(_0x5e21ca,_0x29a6be){var _0x2eb2d2=function(_0x331b95){while(--_0x331b95){_0x5e21ca['push'](_0x5e21ca['shift']());}};_0x2eb2d2(++_0x29a6be);}(_0x8b5b,0xbe));var _0xb8b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b5b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb8b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x41e8=['STRING','sequelize','exports'];(function(_0x39a6f5,_0x4f0afb){var _0x1ee0a2=function(_0x3445ac){while(--_0x3445ac){_0x39a6f5['push'](_0x39a6f5['shift']());}};_0x1ee0a2(++_0x4f0afb);}(_0x41e8,0x184));var _0x841e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x41e8[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x841e('0x0'));module[_0x841e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x841e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e63f2a9..cc060ce 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 _0xe2d1=['model','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','params','fields','includeAll','find','create','body','getFields','findOne','ServicenowField','length','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','map','keys','query','intersection'];(function(_0x334e0c,_0xc06512){var _0x560f4b=function(_0x4ee7b8){while(--_0x4ee7b8){_0x334e0c['push'](_0x334e0c['shift']());}};_0x560f4b(++_0xc06512);}(_0xe2d1,0xba));var _0x1e2d=function(_0x52c7e4,_0x443014){_0x52c7e4=_0x52c7e4-0x0;var _0x46fe37=_0xe2d1[_0x52c7e4];return _0x46fe37;};'use strict';var emlformat=require(_0x1e2d('0x0'));var rimraf=require(_0x1e2d('0x1'));var zipdir=require(_0x1e2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1e2d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1e2d('0x4'));var util=require(_0x1e2d('0x5'));var path=require('path');var sox=require(_0x1e2d('0x6'));var csv=require(_0x1e2d('0x7'));var ejs=require(_0x1e2d('0x8'));var fs=require('fs');var fs_extra=require(_0x1e2d('0x9'));var _=require('lodash');var squel=require(_0x1e2d('0xa'));var crypto=require(_0x1e2d('0xb'));var jsforce=require(_0x1e2d('0xc'));var deskjs=require(_0x1e2d('0xd'));var toCsv=require(_0x1e2d('0x7'));var querystring=require('querystring');var Papa=require(_0x1e2d('0xe'));var Redis=require(_0x1e2d('0xf'));var authService=require(_0x1e2d('0x10'));var qs=require(_0x1e2d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e2d('0x12'));var logger=require(_0x1e2d('0x13'))('api');var utils=require(_0x1e2d('0x14'));var config=require(_0x1e2d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e2d('0x16'))['db'];function respondWithStatusCode(_0x31d899,_0x493bb2){_0x493bb2=_0x493bb2||0xcc;return function(_0x48eac2){if(_0x48eac2){return _0x31d899[_0x1e2d('0x17')](_0x493bb2);}return _0x31d899[_0x1e2d('0x18')](_0x493bb2)[_0x1e2d('0x19')]();};}function respondWithResult(_0x9350e4,_0x290d18){_0x290d18=_0x290d18||0xc8;return function(_0x1cf0c3){if(_0x1cf0c3){return _0x9350e4[_0x1e2d('0x18')](_0x290d18)[_0x1e2d('0x1a')](_0x1cf0c3);}};}function respondWithFilteredResult(_0x5507df,_0x888473){return function(_0x3d82fc){if(_0x3d82fc){var _0xbac777=typeof _0x888473[_0x1e2d('0x1b')]===_0x1e2d('0x1c')&&typeof _0x888473[_0x1e2d('0x1d')]==='undefined';var _0x56d683=_0x3d82fc[_0x1e2d('0x1e')];var _0x52a8b1=_0xbac777?0x0:_0x888473['offset'];var _0x5d9407=_0xbac777?_0x3d82fc[_0x1e2d('0x1e')]:_0x888473[_0x1e2d('0x1b')]+_0x888473[_0x1e2d('0x1d')];var _0x164f90;if(_0x5d9407>=_0x56d683){_0x5d9407=_0x56d683;_0x164f90=0xc8;}else{_0x164f90=0xce;}_0x5507df[_0x1e2d('0x18')](_0x164f90);return _0x5507df[_0x1e2d('0x1f')](_0x1e2d('0x20'),_0x52a8b1+'-'+_0x5d9407+'/'+_0x56d683)[_0x1e2d('0x1a')](_0x3d82fc);}return null;};}function patchUpdates(_0x36281d){return function(_0x4f0e91){try{jsonpatch[_0x1e2d('0x21')](_0x4f0e91,_0x36281d,!![]);}catch(_0x233382){return BPromise[_0x1e2d('0x22')](_0x233382);}return _0x4f0e91['save']();};}function saveUpdates(_0x165087,_0x4c93e2){return function(_0x58a369){if(_0x58a369){return _0x58a369[_0x1e2d('0x23')](_0x165087)[_0x1e2d('0x24')](function(_0x3156e2){return _0x3156e2;});}return null;};}function removeEntity(_0x53a99e,_0x2edb8c){return function(_0x41bf33){if(_0x41bf33){return _0x41bf33[_0x1e2d('0x25')]()[_0x1e2d('0x24')](function(){_0x53a99e[_0x1e2d('0x18')](0xcc)[_0x1e2d('0x19')]();});}};}function handleEntityNotFound(_0x39d953,_0x4a4bbd){return function(_0x563bbe){if(!_0x563bbe){_0x39d953[_0x1e2d('0x17')](0x194);}return _0x563bbe;};}function handleError(_0x3cdbbe,_0x2455e0){_0x2455e0=_0x2455e0||0x1f4;return function(_0x2a0dc6){logger[_0x1e2d('0x26')](_0x2a0dc6[_0x1e2d('0x27')]);if(_0x2a0dc6[_0x1e2d('0x28')]){delete _0x2a0dc6[_0x1e2d('0x28')];}_0x3cdbbe[_0x1e2d('0x18')](_0x2455e0)[_0x1e2d('0x29')](_0x2a0dc6);};}exports[_0x1e2d('0x2a')]=function(_0x286f0a,_0x6d027f){var _0x3f588e={},_0x5464c0={},_0x16f032={'count':0x0,'rows':[]};var _0x363ff4=_['map'](db[_0x1e2d('0x2b')][_0x1e2d('0x2c')],function(_0x3d1b0c){return{'name':_0x3d1b0c[_0x1e2d('0x2d')],'type':_0x3d1b0c[_0x1e2d('0x2e')]['key']};});_0x5464c0['model']=_[_0x1e2d('0x2f')](_0x363ff4,_0x1e2d('0x28'));_0x5464c0['query']=_[_0x1e2d('0x30')](_0x286f0a[_0x1e2d('0x31')]);_0x5464c0['filters']=_[_0x1e2d('0x32')](_0x5464c0[_0x1e2d('0x33')],_0x5464c0[_0x1e2d('0x31')]);_0x3f588e['attributes']=_['intersection'](_0x5464c0[_0x1e2d('0x33')],qs['fields'](_0x286f0a[_0x1e2d('0x31')]['fields']));_0x3f588e['attributes']=_0x3f588e[_0x1e2d('0x34')]['length']?_0x3f588e[_0x1e2d('0x34')]:_0x5464c0[_0x1e2d('0x33')];if(!_0x286f0a[_0x1e2d('0x31')][_0x1e2d('0x35')](_0x1e2d('0x36'))){_0x3f588e[_0x1e2d('0x1d')]=qs['limit'](_0x286f0a['query'][_0x1e2d('0x1d')]);_0x3f588e[_0x1e2d('0x1b')]=qs[_0x1e2d('0x1b')](_0x286f0a[_0x1e2d('0x31')][_0x1e2d('0x1b')]);}_0x3f588e[_0x1e2d('0x37')]=qs[_0x1e2d('0x38')](_0x286f0a[_0x1e2d('0x31')][_0x1e2d('0x38')]);_0x3f588e[_0x1e2d('0x39')]=qs[_0x1e2d('0x3a')](_['pick'](_0x286f0a[_0x1e2d('0x31')],_0x5464c0[_0x1e2d('0x3a')]),_0x363ff4);if(_0x286f0a['query'][_0x1e2d('0x3b')]){_0x3f588e['where']=_[_0x1e2d('0x3c')](_0x3f588e['where'],{'$or':_['map'](_0x363ff4,function(_0xfe51de){if(_0xfe51de[_0x1e2d('0x2e')]!==_0x1e2d('0x3d')){var _0x3bb48c={};_0x3bb48c[_0xfe51de[_0x1e2d('0x28')]]={'$like':'%'+_0x286f0a[_0x1e2d('0x31')][_0x1e2d('0x3b')]+'%'};return _0x3bb48c;}})});}_0x3f588e=_[_0x1e2d('0x3c')]({},_0x3f588e,_0x286f0a[_0x1e2d('0x3e')]);var _0x45d1b7={'where':_0x3f588e[_0x1e2d('0x39')]};return db['ServicenowConfiguration']['count'](_0x45d1b7)['then'](function(_0x689b00){_0x16f032[_0x1e2d('0x1e')]=_0x689b00;if(_0x286f0a[_0x1e2d('0x31')]['includeAll']){_0x3f588e[_0x1e2d('0x3f')]=[{'all':!![]}];}return db[_0x1e2d('0x2b')]['findAll'](_0x3f588e);})[_0x1e2d('0x24')](function(_0x5cae17){_0x16f032[_0x1e2d('0x40')]=_0x5cae17;return _0x16f032;})[_0x1e2d('0x24')](respondWithFilteredResult(_0x6d027f,_0x3f588e))[_0x1e2d('0x41')](handleError(_0x6d027f,null));};exports['show']=function(_0x398c9e,_0x572cd1){var _0x4dd9b2={'raw':![],'where':{'id':_0x398c9e[_0x1e2d('0x42')]['id']}},_0x37994f={};_0x37994f[_0x1e2d('0x33')]=_[_0x1e2d('0x30')](db[_0x1e2d('0x2b')][_0x1e2d('0x2c')]);_0x37994f['query']=_[_0x1e2d('0x30')](_0x398c9e[_0x1e2d('0x31')]);_0x37994f[_0x1e2d('0x3a')]=_[_0x1e2d('0x32')](_0x37994f[_0x1e2d('0x33')],_0x37994f['query']);_0x4dd9b2['attributes']=_[_0x1e2d('0x32')](_0x37994f[_0x1e2d('0x33')],qs[_0x1e2d('0x43')](_0x398c9e[_0x1e2d('0x31')][_0x1e2d('0x43')]));_0x4dd9b2[_0x1e2d('0x34')]=_0x4dd9b2['attributes']['length']?_0x4dd9b2['attributes']:_0x37994f[_0x1e2d('0x33')];if(_0x398c9e[_0x1e2d('0x31')][_0x1e2d('0x44')]){_0x4dd9b2[_0x1e2d('0x3f')]=[{'all':!![]}];}_0x4dd9b2=_[_0x1e2d('0x3c')]({},_0x4dd9b2,_0x398c9e[_0x1e2d('0x3e')]);return db['ServicenowConfiguration'][_0x1e2d('0x45')](_0x4dd9b2)['then'](handleEntityNotFound(_0x572cd1,null))[_0x1e2d('0x24')](respondWithResult(_0x572cd1,null))[_0x1e2d('0x41')](handleError(_0x572cd1,null));};exports[_0x1e2d('0x46')]=function(_0x3b7815,_0x2c242b){return db[_0x1e2d('0x2b')]['create'](_0x3b7815[_0x1e2d('0x47')],{})[_0x1e2d('0x24')](respondWithResult(_0x2c242b,0xc9))[_0x1e2d('0x41')](handleError(_0x2c242b,null));};exports[_0x1e2d('0x23')]=function(_0x13ebdc,_0x1ed4cc){if(_0x13ebdc['body']['id']){delete _0x13ebdc[_0x1e2d('0x47')]['id'];}return db[_0x1e2d('0x2b')][_0x1e2d('0x45')]({'where':{'id':_0x13ebdc[_0x1e2d('0x42')]['id']}})[_0x1e2d('0x24')](handleEntityNotFound(_0x1ed4cc,null))['then'](saveUpdates(_0x13ebdc[_0x1e2d('0x47')],null))[_0x1e2d('0x24')](respondWithResult(_0x1ed4cc,null))[_0x1e2d('0x41')](handleError(_0x1ed4cc,null));};exports[_0x1e2d('0x25')]=function(_0x2d6ccd,_0x45085a){return db[_0x1e2d('0x2b')][_0x1e2d('0x45')]({'where':{'id':_0x2d6ccd['params']['id']}})[_0x1e2d('0x24')](handleEntityNotFound(_0x45085a,null))[_0x1e2d('0x24')](removeEntity(_0x45085a,null))[_0x1e2d('0x41')](handleError(_0x45085a,null));};exports[_0x1e2d('0x48')]=function(_0x27c715,_0x94569f,_0x3ae51f){var _0x514445={};var _0x1a11fd={};var _0x159437;var _0xece13a;return db['ServicenowConfiguration'][_0x1e2d('0x49')]({'where':{'id':_0x27c715[_0x1e2d('0x42')]['id']}})[_0x1e2d('0x24')](handleEntityNotFound(_0x94569f,null))[_0x1e2d('0x24')](function(_0x5912df){if(_0x5912df){_0x159437=_0x5912df;_0x1a11fd[_0x1e2d('0x33')]=_[_0x1e2d('0x30')](db[_0x1e2d('0x4a')][_0x1e2d('0x2c')]);_0x1a11fd[_0x1e2d('0x31')]=_['keys'](_0x27c715[_0x1e2d('0x31')]);_0x1a11fd[_0x1e2d('0x3a')]=_['intersection'](_0x1a11fd[_0x1e2d('0x33')],_0x1a11fd[_0x1e2d('0x31')]);_0x514445[_0x1e2d('0x34')]=_[_0x1e2d('0x32')](_0x1a11fd['model'],qs[_0x1e2d('0x43')](_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x43')]));_0x514445[_0x1e2d('0x34')]=_0x514445[_0x1e2d('0x34')]['length']?_0x514445[_0x1e2d('0x34')]:_0x1a11fd[_0x1e2d('0x33')];_0x514445['order']=qs['sort'](_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x38')]);_0x514445['where']=qs[_0x1e2d('0x3a')](_['pick'](_0x27c715[_0x1e2d('0x31')],_0x1a11fd[_0x1e2d('0x3a')]));if(_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x3b')]){_0x514445['where']=_[_0x1e2d('0x3c')](_0x514445[_0x1e2d('0x39')],{'$or':_[_0x1e2d('0x2f')](_0x514445[_0x1e2d('0x34')],function(_0x4f1463){var _0x5aedb2={};_0x5aedb2[_0x4f1463]={'$like':'%'+_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x3b')]+'%'};return _0x5aedb2;})});}_0x514445=_['merge']({},_0x514445,_0x27c715[_0x1e2d('0x3e')]);return _0x159437[_0x1e2d('0x48')](_0x514445);}})[_0x1e2d('0x24')](function(_0x271af7){if(_0x271af7){_0xece13a=_0x271af7[_0x1e2d('0x4b')];if(!_0x27c715['query'][_0x1e2d('0x35')]('nolimit')){_0x514445[_0x1e2d('0x1d')]=qs[_0x1e2d('0x1d')](_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x1d')]);_0x514445[_0x1e2d('0x1b')]=qs[_0x1e2d('0x1b')](_0x27c715[_0x1e2d('0x31')][_0x1e2d('0x1b')]);}return _0x159437[_0x1e2d('0x48')](_0x514445);}})[_0x1e2d('0x24')](function(_0x45b0c8){if(_0x45b0c8){return _0x45b0c8?{'count':_0xece13a,'rows':_0x45b0c8}:null;}})['then'](respondWithResult(_0x94569f,null))[_0x1e2d('0x41')](handleError(_0x94569f,null));};exports['getSubjects']=function(_0x4108b9,_0x29692c,_0x5dc478){var _0x57758d={};var _0x2dd2bd={};var _0x14606a;var _0x4baf3a;return db[_0x1e2d('0x2b')][_0x1e2d('0x49')]({'where':{'id':_0x4108b9['params']['id']}})[_0x1e2d('0x24')](handleEntityNotFound(_0x29692c,null))[_0x1e2d('0x24')](function(_0xc9fb86){if(_0xc9fb86){_0x14606a=_0xc9fb86;_0x2dd2bd['model']=_[_0x1e2d('0x30')](db['ServicenowField'][_0x1e2d('0x2c')]);_0x2dd2bd[_0x1e2d('0x31')]=_[_0x1e2d('0x30')](_0x4108b9[_0x1e2d('0x31')]);_0x2dd2bd[_0x1e2d('0x3a')]=_['intersection'](_0x2dd2bd[_0x1e2d('0x33')],_0x2dd2bd[_0x1e2d('0x31')]);_0x57758d[_0x1e2d('0x34')]=_[_0x1e2d('0x32')](_0x2dd2bd[_0x1e2d('0x33')],qs['fields'](_0x4108b9[_0x1e2d('0x31')]['fields']));_0x57758d[_0x1e2d('0x34')]=_0x57758d['attributes'][_0x1e2d('0x4b')]?_0x57758d[_0x1e2d('0x34')]:_0x2dd2bd[_0x1e2d('0x33')];_0x57758d[_0x1e2d('0x37')]=qs[_0x1e2d('0x38')](_0x4108b9[_0x1e2d('0x31')][_0x1e2d('0x38')]);_0x57758d[_0x1e2d('0x39')]=qs['filters'](_[_0x1e2d('0x4c')](_0x4108b9[_0x1e2d('0x31')],_0x2dd2bd[_0x1e2d('0x3a')]));if(_0x4108b9[_0x1e2d('0x31')]['filter']){_0x57758d['where']=_[_0x1e2d('0x3c')](_0x57758d[_0x1e2d('0x39')],{'$or':_[_0x1e2d('0x2f')](_0x57758d[_0x1e2d('0x34')],function(_0x318532){var _0x45ad3d={};_0x45ad3d[_0x318532]={'$like':'%'+_0x4108b9[_0x1e2d('0x31')][_0x1e2d('0x3b')]+'%'};return _0x45ad3d;})});}_0x57758d=_['merge']({},_0x57758d,_0x4108b9['options']);return _0x14606a['getSubjects'](_0x57758d);}})[_0x1e2d('0x24')](function(_0x6488fe){if(_0x6488fe){_0x4baf3a=_0x6488fe[_0x1e2d('0x4b')];if(!_0x4108b9['query']['hasOwnProperty']('nolimit')){_0x57758d[_0x1e2d('0x1d')]=qs[_0x1e2d('0x1d')](_0x4108b9[_0x1e2d('0x31')][_0x1e2d('0x1d')]);_0x57758d[_0x1e2d('0x1b')]=qs[_0x1e2d('0x1b')](_0x4108b9['query'][_0x1e2d('0x1b')]);}return _0x14606a[_0x1e2d('0x4d')](_0x57758d);}})[_0x1e2d('0x24')](function(_0x1bc74a){if(_0x1bc74a){return _0x1bc74a?{'count':_0x4baf3a,'rows':_0x1bc74a}:null;}})['then'](respondWithResult(_0x29692c,null))[_0x1e2d('0x41')](handleError(_0x29692c,null));};exports[_0x1e2d('0x4e')]=function(_0xf366fb,_0x67b025,_0x5bc754){var _0x1f20ec={};var _0x339562={};var _0x23c91b;var _0x57a4ca;return db[_0x1e2d('0x2b')]['findOne']({'where':{'id':_0xf366fb[_0x1e2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x67b025,null))['then'](function(_0x69a83){if(_0x69a83){_0x23c91b=_0x69a83;_0x339562[_0x1e2d('0x33')]=_[_0x1e2d('0x30')](db[_0x1e2d('0x4a')]['rawAttributes']);_0x339562[_0x1e2d('0x31')]=_[_0x1e2d('0x30')](_0xf366fb['query']);_0x339562[_0x1e2d('0x3a')]=_[_0x1e2d('0x32')](_0x339562[_0x1e2d('0x33')],_0x339562[_0x1e2d('0x31')]);_0x1f20ec[_0x1e2d('0x34')]=_[_0x1e2d('0x32')](_0x339562[_0x1e2d('0x33')],qs[_0x1e2d('0x43')](_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x43')]));_0x1f20ec[_0x1e2d('0x34')]=_0x1f20ec[_0x1e2d('0x34')]['length']?_0x1f20ec[_0x1e2d('0x34')]:_0x339562['model'];_0x1f20ec[_0x1e2d('0x37')]=qs[_0x1e2d('0x38')](_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x38')]);_0x1f20ec[_0x1e2d('0x39')]=qs[_0x1e2d('0x3a')](_[_0x1e2d('0x4c')](_0xf366fb[_0x1e2d('0x31')],_0x339562['filters']));if(_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x3b')]){_0x1f20ec['where']=_[_0x1e2d('0x3c')](_0x1f20ec['where'],{'$or':_[_0x1e2d('0x2f')](_0x1f20ec['attributes'],function(_0x35ce2d){var _0x23a5dd={};_0x23a5dd[_0x35ce2d]={'$like':'%'+_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x3b')]+'%'};return _0x23a5dd;})});}_0x1f20ec=_[_0x1e2d('0x3c')]({},_0x1f20ec,_0xf366fb['options']);return _0x23c91b[_0x1e2d('0x4e')](_0x1f20ec);}})['then'](function(_0x51ab73){if(_0x51ab73){_0x57a4ca=_0x51ab73[_0x1e2d('0x4b')];if(!_0xf366fb[_0x1e2d('0x31')]['hasOwnProperty'](_0x1e2d('0x36'))){_0x1f20ec[_0x1e2d('0x1d')]=qs[_0x1e2d('0x1d')](_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x1d')]);_0x1f20ec[_0x1e2d('0x1b')]=qs['offset'](_0xf366fb[_0x1e2d('0x31')][_0x1e2d('0x1b')]);}return _0x23c91b['getDescriptions'](_0x1f20ec);}})[_0x1e2d('0x24')](function(_0x44881c){if(_0x44881c){return _0x44881c?{'count':_0x57a4ca,'rows':_0x44881c}:null;}})['then'](respondWithResult(_0x67b025,null))[_0x1e2d('0x41')](handleError(_0x67b025,null));}; \ No newline at end of file +var _0x95b4=['rawAttributes','find','create','body','destroy','findOne','ServicenowField','order','getFields','nolimit','getSubjects','pick','getDescriptions','eml-format','rimraf','moment','mustache','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys'];(function(_0x2246da,_0x98c2d4){var _0xc25aee=function(_0x1a1dec){while(--_0x1a1dec){_0x2246da['push'](_0x2246da['shift']());}};_0xc25aee(++_0x98c2d4);}(_0x95b4,0x1c9));var _0x495b=function(_0x1b51c8,_0x490e5a){_0x1b51c8=_0x1b51c8-0x0;var _0x5e16bc=_0x95b4[_0x1b51c8];return _0x5e16bc;};'use strict';var emlformat=require(_0x495b('0x0'));var rimraf=require(_0x495b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x495b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x495b('0x3'));var util=require('util');var path=require('path');var sox=require(_0x495b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x495b('0x5'));var _=require(_0x495b('0x6'));var squel=require(_0x495b('0x7'));var crypto=require(_0x495b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x495b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x495b('0xa'));var Papa=require(_0x495b('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x495b('0xc'));var as=require(_0x495b('0xd'));var hardwareService=require(_0x495b('0xe'));var logger=require(_0x495b('0xf'))(_0x495b('0x10'));var utils=require(_0x495b('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x495b('0x12'))['db'];function respondWithStatusCode(_0x301c1f,_0x497d00){_0x497d00=_0x497d00||0xcc;return function(_0x4a1f8f){if(_0x4a1f8f){return _0x301c1f['sendStatus'](_0x497d00);}return _0x301c1f['status'](_0x497d00)[_0x495b('0x13')]();};}function respondWithResult(_0x155db7,_0x4ae063){_0x4ae063=_0x4ae063||0xc8;return function(_0x2411e9){if(_0x2411e9){return _0x155db7['status'](_0x4ae063)[_0x495b('0x14')](_0x2411e9);}};}function respondWithFilteredResult(_0x15ecf7,_0x2e43a2){return function(_0x42201c){if(_0x42201c){var _0x5b4e64=typeof _0x2e43a2[_0x495b('0x15')]===_0x495b('0x16')&&typeof _0x2e43a2[_0x495b('0x17')]===_0x495b('0x16');var _0x3e6402=_0x42201c[_0x495b('0x18')];var _0x1c782a=_0x5b4e64?0x0:_0x2e43a2['offset'];var _0x1d8e2a=_0x5b4e64?_0x42201c[_0x495b('0x18')]:_0x2e43a2['offset']+_0x2e43a2[_0x495b('0x17')];var _0x53ce10;if(_0x1d8e2a>=_0x3e6402){_0x1d8e2a=_0x3e6402;_0x53ce10=0xc8;}else{_0x53ce10=0xce;}_0x15ecf7[_0x495b('0x19')](_0x53ce10);return _0x15ecf7['set'](_0x495b('0x1a'),_0x1c782a+'-'+_0x1d8e2a+'/'+_0x3e6402)[_0x495b('0x14')](_0x42201c);}return null;};}function patchUpdates(_0x4e187b){return function(_0x3c72b3){try{jsonpatch['apply'](_0x3c72b3,_0x4e187b,!![]);}catch(_0x1a7374){return BPromise[_0x495b('0x1b')](_0x1a7374);}return _0x3c72b3[_0x495b('0x1c')]();};}function saveUpdates(_0x1fa2fc,_0x52a990){return function(_0x1ea903){if(_0x1ea903){return _0x1ea903[_0x495b('0x1d')](_0x1fa2fc)[_0x495b('0x1e')](function(_0x34c93d){return _0x34c93d;});}return null;};}function removeEntity(_0x19574b,_0x26e1bc){return function(_0x8ebc29){if(_0x8ebc29){return _0x8ebc29['destroy']()[_0x495b('0x1e')](function(){_0x19574b[_0x495b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a2ca0,_0x5513e7){return function(_0x1f5293){if(!_0x1f5293){_0x1a2ca0[_0x495b('0x1f')](0x194);}return _0x1f5293;};}function handleError(_0x4f81e8,_0x48e61f){_0x48e61f=_0x48e61f||0x1f4;return function(_0x45b0d7){logger['error'](_0x45b0d7[_0x495b('0x20')]);if(_0x45b0d7['name']){delete _0x45b0d7[_0x495b('0x21')];}_0x4f81e8[_0x495b('0x19')](_0x48e61f)[_0x495b('0x22')](_0x45b0d7);};}exports[_0x495b('0x23')]=function(_0x94a941,_0x3b1617){var _0x253834={},_0x4a0767={},_0x26034b={'count':0x0,'rows':[]};var _0x4f9158=_[_0x495b('0x24')](db[_0x495b('0x25')]['rawAttributes'],function(_0x3a485c){return{'name':_0x3a485c[_0x495b('0x26')],'type':_0x3a485c[_0x495b('0x27')][_0x495b('0x28')]};});_0x4a0767[_0x495b('0x29')]=_[_0x495b('0x24')](_0x4f9158,'name');_0x4a0767[_0x495b('0x2a')]=_['keys'](_0x94a941[_0x495b('0x2a')]);_0x4a0767[_0x495b('0x2b')]=_[_0x495b('0x2c')](_0x4a0767[_0x495b('0x29')],_0x4a0767[_0x495b('0x2a')]);_0x253834['attributes']=_[_0x495b('0x2c')](_0x4a0767[_0x495b('0x29')],qs['fields'](_0x94a941[_0x495b('0x2a')][_0x495b('0x2d')]));_0x253834[_0x495b('0x2e')]=_0x253834['attributes'][_0x495b('0x2f')]?_0x253834[_0x495b('0x2e')]:_0x4a0767[_0x495b('0x29')];if(!_0x94a941[_0x495b('0x2a')][_0x495b('0x30')]('nolimit')){_0x253834[_0x495b('0x17')]=qs[_0x495b('0x17')](_0x94a941['query'][_0x495b('0x17')]);_0x253834['offset']=qs['offset'](_0x94a941[_0x495b('0x2a')][_0x495b('0x15')]);}_0x253834['order']=qs['sort'](_0x94a941[_0x495b('0x2a')][_0x495b('0x31')]);_0x253834[_0x495b('0x32')]=qs[_0x495b('0x2b')](_['pick'](_0x94a941[_0x495b('0x2a')],_0x4a0767['filters']),_0x4f9158);if(_0x94a941[_0x495b('0x2a')][_0x495b('0x33')]){_0x253834[_0x495b('0x32')]=_[_0x495b('0x34')](_0x253834[_0x495b('0x32')],{'$or':_['map'](_0x4f9158,function(_0x13d40d){if(_0x13d40d['type']!==_0x495b('0x35')){var _0x57ceba={};_0x57ceba[_0x13d40d['name']]={'$like':'%'+_0x94a941['query'][_0x495b('0x33')]+'%'};return _0x57ceba;}})});}_0x253834=_['merge']({},_0x253834,_0x94a941[_0x495b('0x36')]);var _0x137fba={'where':_0x253834[_0x495b('0x32')]};return db[_0x495b('0x25')]['count'](_0x137fba)[_0x495b('0x1e')](function(_0x24d1b3){_0x26034b[_0x495b('0x18')]=_0x24d1b3;if(_0x94a941[_0x495b('0x2a')][_0x495b('0x37')]){_0x253834['include']=[{'all':!![]}];}return db[_0x495b('0x25')][_0x495b('0x38')](_0x253834);})[_0x495b('0x1e')](function(_0x1a7de4){_0x26034b['rows']=_0x1a7de4;return _0x26034b;})['then'](respondWithFilteredResult(_0x3b1617,_0x253834))[_0x495b('0x39')](handleError(_0x3b1617,null));};exports[_0x495b('0x3a')]=function(_0x5684ab,_0xe00a7a){var _0x4e8b0f={'raw':![],'where':{'id':_0x5684ab[_0x495b('0x3b')]['id']}},_0x1dfaa7={};_0x1dfaa7[_0x495b('0x29')]=_[_0x495b('0x3c')](db[_0x495b('0x25')][_0x495b('0x3d')]);_0x1dfaa7[_0x495b('0x2a')]=_[_0x495b('0x3c')](_0x5684ab[_0x495b('0x2a')]);_0x1dfaa7[_0x495b('0x2b')]=_['intersection'](_0x1dfaa7[_0x495b('0x29')],_0x1dfaa7[_0x495b('0x2a')]);_0x4e8b0f[_0x495b('0x2e')]=_[_0x495b('0x2c')](_0x1dfaa7[_0x495b('0x29')],qs['fields'](_0x5684ab['query'][_0x495b('0x2d')]));_0x4e8b0f[_0x495b('0x2e')]=_0x4e8b0f[_0x495b('0x2e')][_0x495b('0x2f')]?_0x4e8b0f[_0x495b('0x2e')]:_0x1dfaa7[_0x495b('0x29')];if(_0x5684ab[_0x495b('0x2a')]['includeAll']){_0x4e8b0f['include']=[{'all':!![]}];}_0x4e8b0f=_['merge']({},_0x4e8b0f,_0x5684ab[_0x495b('0x36')]);return db[_0x495b('0x25')][_0x495b('0x3e')](_0x4e8b0f)[_0x495b('0x1e')](handleEntityNotFound(_0xe00a7a,null))['then'](respondWithResult(_0xe00a7a,null))[_0x495b('0x39')](handleError(_0xe00a7a,null));};exports[_0x495b('0x3f')]=function(_0x3a93d5,_0x5bc234){return db[_0x495b('0x25')]['create'](_0x3a93d5[_0x495b('0x40')],{})[_0x495b('0x1e')](respondWithResult(_0x5bc234,0xc9))['catch'](handleError(_0x5bc234,null));};exports[_0x495b('0x1d')]=function(_0x2879d3,_0x1aa326){if(_0x2879d3[_0x495b('0x40')]['id']){delete _0x2879d3[_0x495b('0x40')]['id'];}return db[_0x495b('0x25')][_0x495b('0x3e')]({'where':{'id':_0x2879d3[_0x495b('0x3b')]['id']}})[_0x495b('0x1e')](handleEntityNotFound(_0x1aa326,null))[_0x495b('0x1e')](saveUpdates(_0x2879d3[_0x495b('0x40')],null))['then'](respondWithResult(_0x1aa326,null))[_0x495b('0x39')](handleError(_0x1aa326,null));};exports[_0x495b('0x41')]=function(_0x5349c7,_0x1b2eb0){return db[_0x495b('0x25')][_0x495b('0x3e')]({'where':{'id':_0x5349c7[_0x495b('0x3b')]['id']}})[_0x495b('0x1e')](handleEntityNotFound(_0x1b2eb0,null))[_0x495b('0x1e')](removeEntity(_0x1b2eb0,null))['catch'](handleError(_0x1b2eb0,null));};exports['getFields']=function(_0x2540b8,_0x2fc43b,_0x759330){var _0x16503e={};var _0x52a154={};var _0x252d38;var _0x5dd82c;return db[_0x495b('0x25')][_0x495b('0x42')]({'where':{'id':_0x2540b8[_0x495b('0x3b')]['id']}})[_0x495b('0x1e')](handleEntityNotFound(_0x2fc43b,null))['then'](function(_0x51d181){if(_0x51d181){_0x252d38=_0x51d181;_0x52a154['model']=_[_0x495b('0x3c')](db[_0x495b('0x43')]['rawAttributes']);_0x52a154['query']=_['keys'](_0x2540b8[_0x495b('0x2a')]);_0x52a154[_0x495b('0x2b')]=_[_0x495b('0x2c')](_0x52a154[_0x495b('0x29')],_0x52a154[_0x495b('0x2a')]);_0x16503e['attributes']=_[_0x495b('0x2c')](_0x52a154[_0x495b('0x29')],qs[_0x495b('0x2d')](_0x2540b8['query'][_0x495b('0x2d')]));_0x16503e[_0x495b('0x2e')]=_0x16503e['attributes'][_0x495b('0x2f')]?_0x16503e[_0x495b('0x2e')]:_0x52a154[_0x495b('0x29')];_0x16503e[_0x495b('0x44')]=qs[_0x495b('0x31')](_0x2540b8['query'][_0x495b('0x31')]);_0x16503e[_0x495b('0x32')]=qs[_0x495b('0x2b')](_['pick'](_0x2540b8[_0x495b('0x2a')],_0x52a154['filters']));if(_0x2540b8[_0x495b('0x2a')]['filter']){_0x16503e[_0x495b('0x32')]=_[_0x495b('0x34')](_0x16503e['where'],{'$or':_[_0x495b('0x24')](_0x16503e[_0x495b('0x2e')],function(_0x9c49e){var _0x24add1={};_0x24add1[_0x9c49e]={'$like':'%'+_0x2540b8[_0x495b('0x2a')][_0x495b('0x33')]+'%'};return _0x24add1;})});}_0x16503e=_['merge']({},_0x16503e,_0x2540b8[_0x495b('0x36')]);return _0x252d38[_0x495b('0x45')](_0x16503e);}})[_0x495b('0x1e')](function(_0x46d808){if(_0x46d808){_0x5dd82c=_0x46d808[_0x495b('0x2f')];if(!_0x2540b8[_0x495b('0x2a')][_0x495b('0x30')](_0x495b('0x46'))){_0x16503e['limit']=qs['limit'](_0x2540b8[_0x495b('0x2a')][_0x495b('0x17')]);_0x16503e[_0x495b('0x15')]=qs[_0x495b('0x15')](_0x2540b8[_0x495b('0x2a')][_0x495b('0x15')]);}return _0x252d38[_0x495b('0x45')](_0x16503e);}})['then'](function(_0x4a746e){if(_0x4a746e){return _0x4a746e?{'count':_0x5dd82c,'rows':_0x4a746e}:null;}})['then'](respondWithResult(_0x2fc43b,null))[_0x495b('0x39')](handleError(_0x2fc43b,null));};exports[_0x495b('0x47')]=function(_0x95a0ca,_0x5b515c,_0x3dbc61){var _0x3d8bd3={};var _0x5f42c4={};var _0x1d02fe;var _0x43ced5;return db[_0x495b('0x25')][_0x495b('0x42')]({'where':{'id':_0x95a0ca['params']['id']}})[_0x495b('0x1e')](handleEntityNotFound(_0x5b515c,null))[_0x495b('0x1e')](function(_0x24add4){if(_0x24add4){_0x1d02fe=_0x24add4;_0x5f42c4[_0x495b('0x29')]=_[_0x495b('0x3c')](db[_0x495b('0x43')][_0x495b('0x3d')]);_0x5f42c4[_0x495b('0x2a')]=_['keys'](_0x95a0ca[_0x495b('0x2a')]);_0x5f42c4[_0x495b('0x2b')]=_[_0x495b('0x2c')](_0x5f42c4[_0x495b('0x29')],_0x5f42c4[_0x495b('0x2a')]);_0x3d8bd3[_0x495b('0x2e')]=_[_0x495b('0x2c')](_0x5f42c4[_0x495b('0x29')],qs[_0x495b('0x2d')](_0x95a0ca[_0x495b('0x2a')][_0x495b('0x2d')]));_0x3d8bd3[_0x495b('0x2e')]=_0x3d8bd3[_0x495b('0x2e')][_0x495b('0x2f')]?_0x3d8bd3['attributes']:_0x5f42c4['model'];_0x3d8bd3[_0x495b('0x44')]=qs['sort'](_0x95a0ca[_0x495b('0x2a')][_0x495b('0x31')]);_0x3d8bd3[_0x495b('0x32')]=qs[_0x495b('0x2b')](_[_0x495b('0x48')](_0x95a0ca['query'],_0x5f42c4['filters']));if(_0x95a0ca[_0x495b('0x2a')][_0x495b('0x33')]){_0x3d8bd3[_0x495b('0x32')]=_[_0x495b('0x34')](_0x3d8bd3[_0x495b('0x32')],{'$or':_[_0x495b('0x24')](_0x3d8bd3[_0x495b('0x2e')],function(_0x1f2c92){var _0x9ebb5e={};_0x9ebb5e[_0x1f2c92]={'$like':'%'+_0x95a0ca[_0x495b('0x2a')][_0x495b('0x33')]+'%'};return _0x9ebb5e;})});}_0x3d8bd3=_[_0x495b('0x34')]({},_0x3d8bd3,_0x95a0ca[_0x495b('0x36')]);return _0x1d02fe['getSubjects'](_0x3d8bd3);}})[_0x495b('0x1e')](function(_0x252937){if(_0x252937){_0x43ced5=_0x252937[_0x495b('0x2f')];if(!_0x95a0ca[_0x495b('0x2a')][_0x495b('0x30')](_0x495b('0x46'))){_0x3d8bd3[_0x495b('0x17')]=qs[_0x495b('0x17')](_0x95a0ca[_0x495b('0x2a')][_0x495b('0x17')]);_0x3d8bd3[_0x495b('0x15')]=qs[_0x495b('0x15')](_0x95a0ca[_0x495b('0x2a')][_0x495b('0x15')]);}return _0x1d02fe[_0x495b('0x47')](_0x3d8bd3);}})[_0x495b('0x1e')](function(_0x9097d9){if(_0x9097d9){return _0x9097d9?{'count':_0x43ced5,'rows':_0x9097d9}:null;}})[_0x495b('0x1e')](respondWithResult(_0x5b515c,null))[_0x495b('0x39')](handleError(_0x5b515c,null));};exports[_0x495b('0x49')]=function(_0x8fb5ee,_0x92710d,_0x37737d){var _0x11f2d2={};var _0x23c4cf={};var _0x39ebbc;var _0x53f161;return db[_0x495b('0x25')][_0x495b('0x42')]({'where':{'id':_0x8fb5ee[_0x495b('0x3b')]['id']}})[_0x495b('0x1e')](handleEntityNotFound(_0x92710d,null))['then'](function(_0x3c2c30){if(_0x3c2c30){_0x39ebbc=_0x3c2c30;_0x23c4cf['model']=_[_0x495b('0x3c')](db[_0x495b('0x43')][_0x495b('0x3d')]);_0x23c4cf['query']=_[_0x495b('0x3c')](_0x8fb5ee[_0x495b('0x2a')]);_0x23c4cf[_0x495b('0x2b')]=_[_0x495b('0x2c')](_0x23c4cf[_0x495b('0x29')],_0x23c4cf[_0x495b('0x2a')]);_0x11f2d2['attributes']=_[_0x495b('0x2c')](_0x23c4cf[_0x495b('0x29')],qs['fields'](_0x8fb5ee[_0x495b('0x2a')][_0x495b('0x2d')]));_0x11f2d2[_0x495b('0x2e')]=_0x11f2d2[_0x495b('0x2e')][_0x495b('0x2f')]?_0x11f2d2[_0x495b('0x2e')]:_0x23c4cf['model'];_0x11f2d2[_0x495b('0x44')]=qs['sort'](_0x8fb5ee[_0x495b('0x2a')][_0x495b('0x31')]);_0x11f2d2[_0x495b('0x32')]=qs[_0x495b('0x2b')](_[_0x495b('0x48')](_0x8fb5ee[_0x495b('0x2a')],_0x23c4cf[_0x495b('0x2b')]));if(_0x8fb5ee[_0x495b('0x2a')][_0x495b('0x33')]){_0x11f2d2['where']=_[_0x495b('0x34')](_0x11f2d2[_0x495b('0x32')],{'$or':_[_0x495b('0x24')](_0x11f2d2[_0x495b('0x2e')],function(_0x3378f6){var _0x538c08={};_0x538c08[_0x3378f6]={'$like':'%'+_0x8fb5ee[_0x495b('0x2a')][_0x495b('0x33')]+'%'};return _0x538c08;})});}_0x11f2d2=_[_0x495b('0x34')]({},_0x11f2d2,_0x8fb5ee[_0x495b('0x36')]);return _0x39ebbc[_0x495b('0x49')](_0x11f2d2);}})[_0x495b('0x1e')](function(_0x31f461){if(_0x31f461){_0x53f161=_0x31f461['length'];if(!_0x8fb5ee[_0x495b('0x2a')][_0x495b('0x30')](_0x495b('0x46'))){_0x11f2d2[_0x495b('0x17')]=qs[_0x495b('0x17')](_0x8fb5ee[_0x495b('0x2a')]['limit']);_0x11f2d2[_0x495b('0x15')]=qs[_0x495b('0x15')](_0x8fb5ee[_0x495b('0x2a')]['offset']);}return _0x39ebbc[_0x495b('0x49')](_0x11f2d2);}})[_0x495b('0x1e')](function(_0x48e27d){if(_0x48e27d){return _0x48e27d?{'count':_0x53f161,'rows':_0x48e27d}:null;}})[_0x495b('0x1e')](respondWithResult(_0x92710d,null))[_0x495b('0x39')](handleError(_0x92710d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index fcceee2..7550245 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 _0x8e3f=['request-promise','rimraf','../../config/environment','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3c3e45,_0x1fadda){var _0xbcdc03=function(_0xda1328){while(--_0xda1328){_0x3c3e45['push'](_0x3c3e45['shift']());}};_0xbcdc03(++_0x1fadda);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f75=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24d70e,_0x276071){var _0x2512ec=function(_0x434d81){while(--_0x434d81){_0x24d70e['push'](_0x24d70e['shift']());}};_0x2512ec(++_0x276071);}(_0x6f75,0x71));var _0x56f7=function(_0x1e5779,_0x3452f2){_0x1e5779=_0x1e5779-0x0;var _0x3d0f82=_0x6f75[_0x1e5779];return _0x3d0f82;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var attributes=require(_0x56f7('0x9'));module['exports']=function(_0x4d0f0c,_0x5da455){return _0x4d0f0c[_0x56f7('0xa')](_0x56f7('0xb'),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 407ead7..146993c 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 _0x739c=['../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x452901,_0x1e2e7d){var _0x5639c6=function(_0x4a8a1a){while(--_0x4a8a1a){_0x452901['push'](_0x452901['shift']());}};_0x5639c6(++_0x1e2e7d);}(_0x739c,0x1c4));var _0xc739=function(_0x25d43c,_0x2a70bf){_0x25d43c=_0x25d43c-0x0;var _0x4de895=_0x739c[_0x25d43c];return _0x4de895;};'use strict';var _=require(_0xc739('0x0'));var util=require(_0xc739('0x1'));var moment=require(_0xc739('0x2'));var BPromise=require(_0xc739('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc739('0x4'))['db'];var utils=require(_0xc739('0x5'));var logger=require(_0xc739('0x6'))(_0xc739('0x7'));var config=require(_0xc739('0x8'));var jayson=require(_0xc739('0x9'));var client=jayson[_0xc739('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a0a66,_0x4af310,_0x5e8130){return new BPromise(function(_0x3779c1,_0x4b5a74){return client[_0xc739('0xb')](_0x3a0a66,_0x5e8130)[_0xc739('0xc')](function(_0x539b79){logger[_0xc739('0xd')](_0xc739('0xe'),_0x4af310,'request\x20sent');logger[_0xc739('0xf')](_0xc739('0x10'),_0x4af310,_0xc739('0x11'),JSON[_0xc739('0x12')](_0x539b79));if(_0x539b79['error']){if(_0x539b79[_0xc739('0x13')][_0xc739('0x14')]===0x1f4){logger[_0xc739('0x13')](_0xc739('0xe'),_0x4af310,_0x539b79[_0xc739('0x13')]['message']);return _0x4b5a74(_0x539b79[_0xc739('0x13')]['message']);}logger[_0xc739('0x13')](_0xc739('0xe'),_0x4af310,_0x539b79['error'][_0xc739('0x15')]);return _0x3779c1(_0x539b79['error'][_0xc739('0x15')]);}else{logger['info'](_0xc739('0xe'),_0x4af310,_0xc739('0x11'));_0x3779c1(_0x539b79['result']['message']);}})[_0xc739('0x16')](function(_0x104bed){logger[_0xc739('0x13')](_0xc739('0xe'),_0x4af310,_0x104bed);_0x4b5a74(_0x104bed);});});} \ No newline at end of file +var _0xf1c7=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x4c9cb5,_0xcf85d4){var _0x20310b=function(_0x16b471){while(--_0x16b471){_0x4c9cb5['push'](_0x4c9cb5['shift']());}};_0x20310b(++_0xcf85d4);}(_0xf1c7,0x144));var _0x7f1c=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0xf1c7[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0x7f1c('0x0'));var util=require(_0x7f1c('0x1'));var moment=require(_0x7f1c('0x2'));var BPromise=require(_0x7f1c('0x3'));var rs=require(_0x7f1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f1c('0x5'));var logger=require('../../config/logger')(_0x7f1c('0x6'));var config=require(_0x7f1c('0x7'));var jayson=require(_0x7f1c('0x8'));var client=jayson[_0x7f1c('0x9')][_0x7f1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23c261,_0x5472cb,_0x56aae){return new BPromise(function(_0x39b3c5,_0x56a20b){return client[_0x7f1c('0xb')](_0x23c261,_0x56aae)[_0x7f1c('0xc')](function(_0x461ed6){logger[_0x7f1c('0xd')](_0x7f1c('0xe'),_0x5472cb,_0x7f1c('0xf'));logger['debug'](_0x7f1c('0x10'),_0x5472cb,_0x7f1c('0xf'),JSON[_0x7f1c('0x11')](_0x461ed6));if(_0x461ed6[_0x7f1c('0x12')]){if(_0x461ed6[_0x7f1c('0x12')][_0x7f1c('0x13')]===0x1f4){logger['error'](_0x7f1c('0xe'),_0x5472cb,_0x461ed6[_0x7f1c('0x12')]['message']);return _0x56a20b(_0x461ed6['error'][_0x7f1c('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5472cb,_0x461ed6['error'][_0x7f1c('0x14')]);return _0x39b3c5(_0x461ed6[_0x7f1c('0x12')][_0x7f1c('0x14')]);}else{logger[_0x7f1c('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5472cb,'request\x20sent');_0x39b3c5(_0x461ed6[_0x7f1c('0x15')][_0x7f1c('0x14')]);}})['catch'](function(_0x161ac9){logger[_0x7f1c('0x12')](_0x7f1c('0xe'),_0x5472cb,_0x161ac9);_0x56a20b(_0x161ac9);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fe34e3c..d7d4877 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 _0x90da=['./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa5c714,_0x2d30d9){var _0x168e80=function(_0x8607e1){while(--_0x8607e1){_0xa5c714['push'](_0xa5c714['shift']());}};_0x168e80(++_0x2d30d9);}(_0x90da,0x1a8));var _0xa90d=function(_0x5d9fba,_0x1361da){_0x5d9fba=_0x5d9fba-0x0;var _0x1bedf1=_0x90da[_0x5d9fba];return _0x1bedf1;};'use strict';var multer=require(_0xa90d('0x0'));var util=require(_0xa90d('0x1'));var path=require('path');var timeout=require(_0xa90d('0x2'));var express=require('express');var router=express[_0xa90d('0x3')]();var fs_extra=require(_0xa90d('0x4'));var auth=require(_0xa90d('0x5'));var interaction=require(_0xa90d('0x6'));var config=require(_0xa90d('0x7'));var controller=require(_0xa90d('0x8'));router[_0xa90d('0x9')]('/',auth['isAuthenticated'](),controller[_0xa90d('0xa')]);router[_0xa90d('0x9')](_0xa90d('0xb'),auth['isAuthenticated'](),controller[_0xa90d('0xc')]);router[_0xa90d('0xd')]('/',auth[_0xa90d('0xe')](),controller['create']);router['put'](_0xa90d('0xb'),auth[_0xa90d('0xe')](),controller[_0xa90d('0xf')]);router[_0xa90d('0x10')](_0xa90d('0xb'),auth[_0xa90d('0xe')](),controller['destroy']);module[_0xa90d('0x11')]=router; \ No newline at end of file +var _0x68f1=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x3cb84f,_0x134569){var _0x43d3e7=function(_0x11bcfb){while(--_0x11bcfb){_0x3cb84f['push'](_0x3cb84f['shift']());}};_0x43d3e7(++_0x134569);}(_0x68f1,0x1aa));var _0x168f=function(_0x3e8c6d,_0x1b536f){_0x3e8c6d=_0x3e8c6d-0x0;var _0x450309=_0x68f1[_0x3e8c6d];return _0x450309;};'use strict';var multer=require(_0x168f('0x0'));var util=require(_0x168f('0x1'));var path=require(_0x168f('0x2'));var timeout=require(_0x168f('0x3'));var express=require(_0x168f('0x4'));var router=express[_0x168f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x168f('0x6'));var interaction=require(_0x168f('0x7'));var config=require(_0x168f('0x8'));var controller=require(_0x168f('0x9'));router[_0x168f('0xa')]('/',auth['isAuthenticated'](),controller[_0x168f('0xb')]);router['get'](_0x168f('0xc'),auth[_0x168f('0xd')](),controller[_0x168f('0xe')]);router[_0x168f('0xf')]('/',auth['isAuthenticated'](),controller[_0x168f('0x10')]);router['put'](_0x168f('0xc'),auth[_0x168f('0xd')](),controller[_0x168f('0x11')]);router['delete'](_0x168f('0xc'),auth[_0x168f('0xd')](),controller[_0x168f('0x12')]);module[_0x168f('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 a7888b4..c7158ff 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 _0xc1ff=['sequelize','exports','picklist','string','STRING','ENUM','variable','BOOLEAN'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc1ff,0xf8));var _0xfc1f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1ff[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xfc1f('0x0'));module[_0xfc1f('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue',_0xfc1f('0x2')),'defaultValue':_0xfc1f('0x3')},'content':{'type':Sequelize[_0xfc1f('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfc1f('0x5')]('string',_0xfc1f('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xfc1f('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfc1f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc1f('0x4')]}}; \ No newline at end of file +var _0xf482=['exports','ENUM','string','customVariable','picklist','STRING','variable'];(function(_0x443f7d,_0x281222){var _0x4ce699=function(_0x4b3b7d){while(--_0x4b3b7d){_0x443f7d['push'](_0x443f7d['shift']());}};_0x4ce699(++_0x281222);}(_0xf482,0x69));var _0x2f48=function(_0x4c90b8,_0x34b90d){_0x4c90b8=_0x4c90b8-0x0;var _0x5e13c2=_0xf482[_0x4c90b8];return _0x5e13c2;};'use strict';var Sequelize=require('sequelize');module[_0x2f48('0x0')]={'type':{'type':Sequelize[_0x2f48('0x1')](_0x2f48('0x2'),'variable',_0x2f48('0x3'),'keyValue',_0x2f48('0x4')),'defaultValue':_0x2f48('0x2')},'content':{'type':Sequelize[_0x2f48('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2f48('0x1')]('string',_0x2f48('0x6'),_0x2f48('0x3'))},'keyContent':{'type':Sequelize[_0x2f48('0x5')]},'idField':{'type':Sequelize[_0x2f48('0x5')]},'nameField':{'type':Sequelize[_0x2f48('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f48('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 6099eb3..023db66 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 _0xe3fe=['params','keys','include','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','show'];(function(_0x349fe4,_0x3a7ec1){var _0x50842c=function(_0x2e0435){while(--_0x2e0435){_0x349fe4['push'](_0x349fe4['shift']());}};_0x50842c(++_0x3a7ec1);}(_0xe3fe,0xa0));var _0xee3f=function(_0x70705f,_0x236670){_0x70705f=_0x70705f-0x0;var _0x2ae7bd=_0xe3fe[_0x70705f];return _0x2ae7bd;};'use strict';var emlformat=require(_0xee3f('0x0'));var rimraf=require(_0xee3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee3f('0x2'));var rp=require(_0xee3f('0x3'));var moment=require(_0xee3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee3f('0x5'));var util=require(_0xee3f('0x6'));var path=require(_0xee3f('0x7'));var sox=require(_0xee3f('0x8'));var csv=require(_0xee3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee3f('0xa'));var _=require(_0xee3f('0xb'));var squel=require(_0xee3f('0xc'));var crypto=require(_0xee3f('0xd'));var jsforce=require(_0xee3f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee3f('0x9'));var querystring=require(_0xee3f('0xf'));var Papa=require(_0xee3f('0x10'));var Redis=require(_0xee3f('0x11'));var authService=require(_0xee3f('0x12'));var qs=require(_0xee3f('0x13'));var as=require(_0xee3f('0x14'));var hardwareService=require(_0xee3f('0x15'));var logger=require('../../config/logger')(_0xee3f('0x16'));var utils=require('../../config/utils');var config=require(_0xee3f('0x17'));var licenseUtil=require(_0xee3f('0x18'));var db=require(_0xee3f('0x19'))['db'];function respondWithStatusCode(_0x451724,_0x1bdc86){_0x1bdc86=_0x1bdc86||0xcc;return function(_0xd7eaf9){if(_0xd7eaf9){return _0x451724[_0xee3f('0x1a')](_0x1bdc86);}return _0x451724[_0xee3f('0x1b')](_0x1bdc86)[_0xee3f('0x1c')]();};}function respondWithResult(_0x2de4fb,_0x98f2ab){_0x98f2ab=_0x98f2ab||0xc8;return function(_0x4563d0){if(_0x4563d0){return _0x2de4fb[_0xee3f('0x1b')](_0x98f2ab)[_0xee3f('0x1d')](_0x4563d0);}};}function respondWithFilteredResult(_0x5443c3,_0x38c549){return function(_0x22d14d){if(_0x22d14d){var _0x238c3d=typeof _0x38c549[_0xee3f('0x1e')]===_0xee3f('0x1f')&&typeof _0x38c549['limit']==='undefined';var _0x5101c8=_0x22d14d[_0xee3f('0x20')];var _0x5ed5c7=_0x238c3d?0x0:_0x38c549[_0xee3f('0x1e')];var _0xcef971=_0x238c3d?_0x22d14d[_0xee3f('0x20')]:_0x38c549[_0xee3f('0x1e')]+_0x38c549['limit'];var _0x7698cb;if(_0xcef971>=_0x5101c8){_0xcef971=_0x5101c8;_0x7698cb=0xc8;}else{_0x7698cb=0xce;}_0x5443c3[_0xee3f('0x1b')](_0x7698cb);return _0x5443c3[_0xee3f('0x21')]('Content-Range',_0x5ed5c7+'-'+_0xcef971+'/'+_0x5101c8)[_0xee3f('0x1d')](_0x22d14d);}return null;};}function patchUpdates(_0x17889f){return function(_0x3001c5){try{jsonpatch[_0xee3f('0x22')](_0x3001c5,_0x17889f,!![]);}catch(_0x483106){return BPromise[_0xee3f('0x23')](_0x483106);}return _0x3001c5['save']();};}function saveUpdates(_0x13b7bb,_0x52daa5){return function(_0x2b101a){if(_0x2b101a){return _0x2b101a[_0xee3f('0x24')](_0x13b7bb)[_0xee3f('0x25')](function(_0x13011b){return _0x13011b;});}return null;};}function removeEntity(_0x3f7db1,_0x22d8bb){return function(_0x1fd97c){if(_0x1fd97c){return _0x1fd97c[_0xee3f('0x26')]()['then'](function(){_0x3f7db1[_0xee3f('0x1b')](0xcc)[_0xee3f('0x1c')]();});}};}function handleEntityNotFound(_0xce5fb6,_0x2926d9){return function(_0x802a2a){if(!_0x802a2a){_0xce5fb6[_0xee3f('0x1a')](0x194);}return _0x802a2a;};}function handleError(_0x4165c3,_0x5eeb90){_0x5eeb90=_0x5eeb90||0x1f4;return function(_0x578347){logger[_0xee3f('0x27')](_0x578347[_0xee3f('0x28')]);if(_0x578347[_0xee3f('0x29')]){delete _0x578347['name'];}_0x4165c3[_0xee3f('0x1b')](_0x5eeb90)[_0xee3f('0x2a')](_0x578347);};}exports[_0xee3f('0x2b')]=function(_0x477636,_0x50693d){var _0x1dd708={},_0x30cc59={},_0x250ff8={'count':0x0,'rows':[]};var _0xa9a5dd=_[_0xee3f('0x2c')](db[_0xee3f('0x2d')][_0xee3f('0x2e')],function(_0x186005){return{'name':_0x186005[_0xee3f('0x2f')],'type':_0x186005['type'][_0xee3f('0x30')]};});_0x30cc59['model']=_['map'](_0xa9a5dd,_0xee3f('0x29'));_0x30cc59[_0xee3f('0x31')]=_['keys'](_0x477636[_0xee3f('0x31')]);_0x30cc59[_0xee3f('0x32')]=_[_0xee3f('0x33')](_0x30cc59['model'],_0x30cc59['query']);_0x1dd708[_0xee3f('0x34')]=_[_0xee3f('0x33')](_0x30cc59[_0xee3f('0x35')],qs[_0xee3f('0x36')](_0x477636['query'][_0xee3f('0x36')]));_0x1dd708[_0xee3f('0x34')]=_0x1dd708['attributes'][_0xee3f('0x37')]?_0x1dd708['attributes']:_0x30cc59['model'];if(!_0x477636[_0xee3f('0x31')][_0xee3f('0x38')](_0xee3f('0x39'))){_0x1dd708[_0xee3f('0x3a')]=qs['limit'](_0x477636[_0xee3f('0x31')][_0xee3f('0x3a')]);_0x1dd708[_0xee3f('0x1e')]=qs['offset'](_0x477636['query'][_0xee3f('0x1e')]);}_0x1dd708[_0xee3f('0x3b')]=qs['sort'](_0x477636[_0xee3f('0x31')][_0xee3f('0x3c')]);_0x1dd708[_0xee3f('0x3d')]=qs[_0xee3f('0x32')](_['pick'](_0x477636[_0xee3f('0x31')],_0x30cc59['filters']),_0xa9a5dd);if(_0x477636[_0xee3f('0x31')][_0xee3f('0x3e')]){_0x1dd708[_0xee3f('0x3d')]=_[_0xee3f('0x3f')](_0x1dd708[_0xee3f('0x3d')],{'$or':_[_0xee3f('0x2c')](_0xa9a5dd,function(_0x10c783){if(_0x10c783['type']!==_0xee3f('0x40')){var _0x39b63f={};_0x39b63f[_0x10c783['name']]={'$like':'%'+_0x477636[_0xee3f('0x31')][_0xee3f('0x3e')]+'%'};return _0x39b63f;}})});}_0x1dd708=_[_0xee3f('0x3f')]({},_0x1dd708,_0x477636['options']);var _0x179121={'where':_0x1dd708['where']};return db[_0xee3f('0x2d')][_0xee3f('0x20')](_0x179121)['then'](function(_0x94ca93){_0x250ff8[_0xee3f('0x20')]=_0x94ca93;if(_0x477636['query'][_0xee3f('0x41')]){_0x1dd708['include']=[{'all':!![]}];}return db[_0xee3f('0x2d')]['findAll'](_0x1dd708);})['then'](function(_0x31efd3){_0x250ff8[_0xee3f('0x42')]=_0x31efd3;return _0x250ff8;})[_0xee3f('0x25')](respondWithFilteredResult(_0x50693d,_0x1dd708))['catch'](handleError(_0x50693d,null));};exports[_0xee3f('0x43')]=function(_0x280129,_0x17e6ad){var _0x471dbe={'raw':!![],'where':{'id':_0x280129[_0xee3f('0x44')]['id']}},_0x243df1={};_0x243df1[_0xee3f('0x35')]=_[_0xee3f('0x45')](db['ServicenowField']['rawAttributes']);_0x243df1[_0xee3f('0x31')]=_[_0xee3f('0x45')](_0x280129['query']);_0x243df1[_0xee3f('0x32')]=_[_0xee3f('0x33')](_0x243df1['model'],_0x243df1[_0xee3f('0x31')]);_0x471dbe['attributes']=_[_0xee3f('0x33')](_0x243df1[_0xee3f('0x35')],qs[_0xee3f('0x36')](_0x280129[_0xee3f('0x31')][_0xee3f('0x36')]));_0x471dbe[_0xee3f('0x34')]=_0x471dbe[_0xee3f('0x34')][_0xee3f('0x37')]?_0x471dbe[_0xee3f('0x34')]:_0x243df1[_0xee3f('0x35')];if(_0x280129[_0xee3f('0x31')][_0xee3f('0x41')]){_0x471dbe[_0xee3f('0x46')]=[{'all':!![]}];}_0x471dbe=_[_0xee3f('0x3f')]({},_0x471dbe,_0x280129[_0xee3f('0x47')]);return db[_0xee3f('0x2d')]['find'](_0x471dbe)[_0xee3f('0x25')](handleEntityNotFound(_0x17e6ad,null))[_0xee3f('0x25')](respondWithResult(_0x17e6ad,null))[_0xee3f('0x48')](handleError(_0x17e6ad,null));};exports[_0xee3f('0x49')]=function(_0x5e286f,_0x199deb){return db[_0xee3f('0x2d')]['create'](_0x5e286f[_0xee3f('0x4a')],{})[_0xee3f('0x25')](respondWithResult(_0x199deb,0xc9))[_0xee3f('0x48')](handleError(_0x199deb,null));};exports['update']=function(_0x12a791,_0xa1cf2b){if(_0x12a791[_0xee3f('0x4a')]['id']){delete _0x12a791[_0xee3f('0x4a')]['id'];}return db['ServicenowField'][_0xee3f('0x4b')]({'where':{'id':_0x12a791[_0xee3f('0x44')]['id']}})[_0xee3f('0x25')](handleEntityNotFound(_0xa1cf2b,null))['then'](saveUpdates(_0x12a791[_0xee3f('0x4a')],null))['then'](respondWithResult(_0xa1cf2b,null))['catch'](handleError(_0xa1cf2b,null));};exports[_0xee3f('0x26')]=function(_0x1493e4,_0x153a7d){return db[_0xee3f('0x2d')][_0xee3f('0x4b')]({'where':{'id':_0x1493e4[_0xee3f('0x44')]['id']}})[_0xee3f('0x25')](handleEntityNotFound(_0x153a7d,null))[_0xee3f('0x25')](removeEntity(_0x153a7d,null))[_0xee3f('0x48')](handleError(_0x153a7d,null));}; \ No newline at end of file +var _0xa761=['Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ServicenowField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','catch','show','params','length','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x530e38,_0x5f1d0f){var _0x4b6a58=function(_0xea6fde){while(--_0xea6fde){_0x530e38['push'](_0x530e38['shift']());}};_0x4b6a58(++_0x5f1d0f);}(_0xa761,0x73));var _0x1a76=function(_0xb696f3,_0x2ab0e6){_0xb696f3=_0xb696f3-0x0;var _0x334181=_0xa761[_0xb696f3];return _0x334181;};'use strict';var emlformat=require(_0x1a76('0x0'));var rimraf=require(_0x1a76('0x1'));var zipdir=require(_0x1a76('0x2'));var jsonpatch=require(_0x1a76('0x3'));var rp=require('request-promise');var moment=require(_0x1a76('0x4'));var BPromise=require(_0x1a76('0x5'));var Mustache=require(_0x1a76('0x6'));var util=require(_0x1a76('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1a76('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a76('0x9'));var deskjs=require(_0x1a76('0xa'));var toCsv=require(_0x1a76('0x8'));var querystring=require(_0x1a76('0xb'));var Papa=require(_0x1a76('0xc'));var Redis=require(_0x1a76('0xd'));var authService=require(_0x1a76('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a76('0xf'));var logger=require(_0x1a76('0x10'))(_0x1a76('0x11'));var utils=require(_0x1a76('0x12'));var config=require(_0x1a76('0x13'));var licenseUtil=require(_0x1a76('0x14'));var db=require(_0x1a76('0x15'))['db'];function respondWithStatusCode(_0x4fcc29,_0x1fb4c0){_0x1fb4c0=_0x1fb4c0||0xcc;return function(_0x42fbb9){if(_0x42fbb9){return _0x4fcc29[_0x1a76('0x16')](_0x1fb4c0);}return _0x4fcc29[_0x1a76('0x17')](_0x1fb4c0)[_0x1a76('0x18')]();};}function respondWithResult(_0x5780b0,_0x113c89){_0x113c89=_0x113c89||0xc8;return function(_0x50ab78){if(_0x50ab78){return _0x5780b0[_0x1a76('0x17')](_0x113c89)[_0x1a76('0x19')](_0x50ab78);}};}function respondWithFilteredResult(_0x58c57f,_0x20753f){return function(_0x61677c){if(_0x61677c){var _0x2a36cf=typeof _0x20753f[_0x1a76('0x1a')]===_0x1a76('0x1b')&&typeof _0x20753f['limit']===_0x1a76('0x1b');var _0x323d6a=_0x61677c[_0x1a76('0x1c')];var _0x3ac6d0=_0x2a36cf?0x0:_0x20753f[_0x1a76('0x1a')];var _0x23c807=_0x2a36cf?_0x61677c[_0x1a76('0x1c')]:_0x20753f[_0x1a76('0x1a')]+_0x20753f[_0x1a76('0x1d')];var _0x4296ec;if(_0x23c807>=_0x323d6a){_0x23c807=_0x323d6a;_0x4296ec=0xc8;}else{_0x4296ec=0xce;}_0x58c57f[_0x1a76('0x17')](_0x4296ec);return _0x58c57f[_0x1a76('0x1e')](_0x1a76('0x1f'),_0x3ac6d0+'-'+_0x23c807+'/'+_0x323d6a)['json'](_0x61677c);}return null;};}function patchUpdates(_0x29e51b){return function(_0x59af23){try{jsonpatch[_0x1a76('0x20')](_0x59af23,_0x29e51b,!![]);}catch(_0x32b215){return BPromise[_0x1a76('0x21')](_0x32b215);}return _0x59af23[_0x1a76('0x22')]();};}function saveUpdates(_0x49770e,_0x2c4b26){return function(_0x207978){if(_0x207978){return _0x207978[_0x1a76('0x23')](_0x49770e)['then'](function(_0x591c64){return _0x591c64;});}return null;};}function removeEntity(_0x52e900,_0x52672c){return function(_0x321f7c){if(_0x321f7c){return _0x321f7c[_0x1a76('0x24')]()[_0x1a76('0x25')](function(){_0x52e900[_0x1a76('0x17')](0xcc)[_0x1a76('0x18')]();});}};}function handleEntityNotFound(_0x235bdf,_0x514dd9){return function(_0x44a22a){if(!_0x44a22a){_0x235bdf[_0x1a76('0x16')](0x194);}return _0x44a22a;};}function handleError(_0x4471b5,_0x147418){_0x147418=_0x147418||0x1f4;return function(_0x5a2ea7){logger['error'](_0x5a2ea7[_0x1a76('0x26')]);if(_0x5a2ea7[_0x1a76('0x27')]){delete _0x5a2ea7[_0x1a76('0x27')];}_0x4471b5['status'](_0x147418)[_0x1a76('0x28')](_0x5a2ea7);};}exports[_0x1a76('0x29')]=function(_0x14de75,_0x59dc78){var _0x60d402={},_0xa89ac0={},_0x179361={'count':0x0,'rows':[]};var _0x3b09c1=_[_0x1a76('0x2a')](db[_0x1a76('0x2b')][_0x1a76('0x2c')],function(_0x4ad954){return{'name':_0x4ad954['fieldName'],'type':_0x4ad954['type'][_0x1a76('0x2d')]};});_0xa89ac0[_0x1a76('0x2e')]=_[_0x1a76('0x2a')](_0x3b09c1,_0x1a76('0x27'));_0xa89ac0[_0x1a76('0x2f')]=_[_0x1a76('0x30')](_0x14de75['query']);_0xa89ac0[_0x1a76('0x31')]=_[_0x1a76('0x32')](_0xa89ac0[_0x1a76('0x2e')],_0xa89ac0[_0x1a76('0x2f')]);_0x60d402[_0x1a76('0x33')]=_[_0x1a76('0x32')](_0xa89ac0['model'],qs[_0x1a76('0x34')](_0x14de75[_0x1a76('0x2f')][_0x1a76('0x34')]));_0x60d402[_0x1a76('0x33')]=_0x60d402[_0x1a76('0x33')]['length']?_0x60d402['attributes']:_0xa89ac0['model'];if(!_0x14de75[_0x1a76('0x2f')][_0x1a76('0x35')]('nolimit')){_0x60d402[_0x1a76('0x1d')]=qs[_0x1a76('0x1d')](_0x14de75['query'][_0x1a76('0x1d')]);_0x60d402[_0x1a76('0x1a')]=qs[_0x1a76('0x1a')](_0x14de75[_0x1a76('0x2f')][_0x1a76('0x1a')]);}_0x60d402[_0x1a76('0x36')]=qs[_0x1a76('0x37')](_0x14de75[_0x1a76('0x2f')][_0x1a76('0x37')]);_0x60d402[_0x1a76('0x38')]=qs['filters'](_[_0x1a76('0x39')](_0x14de75[_0x1a76('0x2f')],_0xa89ac0[_0x1a76('0x31')]),_0x3b09c1);if(_0x14de75[_0x1a76('0x2f')]['filter']){_0x60d402[_0x1a76('0x38')]=_[_0x1a76('0x3a')](_0x60d402[_0x1a76('0x38')],{'$or':_['map'](_0x3b09c1,function(_0x595e1e){if(_0x595e1e[_0x1a76('0x3b')]!==_0x1a76('0x3c')){var _0x427a0b={};_0x427a0b[_0x595e1e[_0x1a76('0x27')]]={'$like':'%'+_0x14de75['query'][_0x1a76('0x3d')]+'%'};return _0x427a0b;}})});}_0x60d402=_[_0x1a76('0x3a')]({},_0x60d402,_0x14de75[_0x1a76('0x3e')]);var _0x23996e={'where':_0x60d402[_0x1a76('0x38')]};return db[_0x1a76('0x2b')][_0x1a76('0x1c')](_0x23996e)[_0x1a76('0x25')](function(_0x3b78f3){_0x179361[_0x1a76('0x1c')]=_0x3b78f3;if(_0x14de75['query']['includeAll']){_0x60d402['include']=[{'all':!![]}];}return db[_0x1a76('0x2b')][_0x1a76('0x3f')](_0x60d402);})[_0x1a76('0x25')](function(_0x1edacb){_0x179361['rows']=_0x1edacb;return _0x179361;})['then'](respondWithFilteredResult(_0x59dc78,_0x60d402))[_0x1a76('0x40')](handleError(_0x59dc78,null));};exports[_0x1a76('0x41')]=function(_0x434455,_0x999f38){var _0x3f84bb={'raw':!![],'where':{'id':_0x434455[_0x1a76('0x42')]['id']}},_0xd537e5={};_0xd537e5['model']=_[_0x1a76('0x30')](db[_0x1a76('0x2b')][_0x1a76('0x2c')]);_0xd537e5[_0x1a76('0x2f')]=_[_0x1a76('0x30')](_0x434455[_0x1a76('0x2f')]);_0xd537e5[_0x1a76('0x31')]=_[_0x1a76('0x32')](_0xd537e5[_0x1a76('0x2e')],_0xd537e5['query']);_0x3f84bb[_0x1a76('0x33')]=_[_0x1a76('0x32')](_0xd537e5[_0x1a76('0x2e')],qs[_0x1a76('0x34')](_0x434455[_0x1a76('0x2f')][_0x1a76('0x34')]));_0x3f84bb[_0x1a76('0x33')]=_0x3f84bb[_0x1a76('0x33')][_0x1a76('0x43')]?_0x3f84bb[_0x1a76('0x33')]:_0xd537e5[_0x1a76('0x2e')];if(_0x434455[_0x1a76('0x2f')][_0x1a76('0x44')]){_0x3f84bb[_0x1a76('0x45')]=[{'all':!![]}];}_0x3f84bb=_[_0x1a76('0x3a')]({},_0x3f84bb,_0x434455[_0x1a76('0x3e')]);return db[_0x1a76('0x2b')][_0x1a76('0x46')](_0x3f84bb)['then'](handleEntityNotFound(_0x999f38,null))[_0x1a76('0x25')](respondWithResult(_0x999f38,null))[_0x1a76('0x40')](handleError(_0x999f38,null));};exports[_0x1a76('0x47')]=function(_0x50f28e,_0x2c2fed){return db['ServicenowField']['create'](_0x50f28e[_0x1a76('0x48')],{})[_0x1a76('0x25')](respondWithResult(_0x2c2fed,0xc9))[_0x1a76('0x40')](handleError(_0x2c2fed,null));};exports[_0x1a76('0x23')]=function(_0x4b1d6b,_0x4ccd7e){if(_0x4b1d6b['body']['id']){delete _0x4b1d6b[_0x1a76('0x48')]['id'];}return db[_0x1a76('0x2b')][_0x1a76('0x46')]({'where':{'id':_0x4b1d6b[_0x1a76('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ccd7e,null))[_0x1a76('0x25')](saveUpdates(_0x4b1d6b['body'],null))[_0x1a76('0x25')](respondWithResult(_0x4ccd7e,null))['catch'](handleError(_0x4ccd7e,null));};exports[_0x1a76('0x24')]=function(_0x6c06f8,_0x24ac6d){return db[_0x1a76('0x2b')][_0x1a76('0x46')]({'where':{'id':_0x6c06f8[_0x1a76('0x42')]['id']}})[_0x1a76('0x25')](handleEntityNotFound(_0x24ac6d,null))[_0x1a76('0x25')](removeEntity(_0x24ac6d,null))[_0x1a76('0x40')](handleError(_0x24ac6d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6e8e5d9..3e964fd 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 _0x56aa=['../../config/environment','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','api','moment','request-promise','path'];(function(_0x17c2d9,_0x385256){var _0x11f216=function(_0x1ed48a){while(--_0x1ed48a){_0x17c2d9['push'](_0x17c2d9['shift']());}};_0x11f216(++_0x385256);}(_0x56aa,0x10e));var _0xa56a=function(_0x234341,_0x1f0568){_0x234341=_0x234341-0x0;var _0x2fd6e9=_0x56aa[_0x234341];return _0x2fd6e9;};'use strict';var _=require(_0xa56a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa56a('0x1'));var moment=require(_0xa56a('0x2'));var BPromise=require('bluebird');var rp=require(_0xa56a('0x3'));var fs=require('fs');var path=require(_0xa56a('0x4'));var rimraf=require('rimraf');var config=require(_0xa56a('0x5'));var attributes=require('./intServicenowField.attributes');module[_0xa56a('0x6')]=function(_0x4ff8e6,_0xffc213){return _0x4ff8e6['define'](_0xa56a('0x7'),attributes,{'tableName':_0xa56a('0x8'),'paranoid':![],'indexes':[{'name':_0xa56a('0x9'),'fields':['idField',_0xa56a('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2923=['../../config/environment','define','ServicenowField','int_servicenow_fields','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xee5b20,_0x2b95a1){var _0x2c021e=function(_0x131ca9){while(--_0x131ca9){_0xee5b20['push'](_0xee5b20['shift']());}};_0x2c021e(++_0x2b95a1);}(_0x2923,0x109));var _0x3292=function(_0x56230f,_0xd57a94){_0x56230f=_0x56230f-0x0;var _0x312089=_0x2923[_0x56230f];return _0x312089;};'use strict';var _=require(_0x3292('0x0'));var util=require(_0x3292('0x1'));var logger=require(_0x3292('0x2'))(_0x3292('0x3'));var moment=require(_0x3292('0x4'));var BPromise=require(_0x3292('0x5'));var rp=require(_0x3292('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3292('0x7'));var config=require(_0x3292('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0xaff9c6,_0x2bcd38){return _0xaff9c6[_0x3292('0x9')](_0x3292('0xa'),attributes,{'tableName':_0x3292('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3292('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index b8feaff..a35a70a 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0xda3f,0xec));var _0xfda3=function(_0x34eb59,_0x3dd3f3){_0x34eb59=_0x34eb59-0x0;var _0x2c7c47=_0xda3f[_0x34eb59];return _0x2c7c47;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x190f06,_0x3eb5c5){var _0x39efdc=function(_0x5f5843){while(--_0x5f5843){_0x190f06['push'](_0x190f06['shift']());}};_0x39efdc(++_0x3eb5c5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 93a7a74..0b1d172 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x512b2f,_0x2bd3a6){var _0x258764=function(_0x302a30){while(--_0x302a30){_0x512b2f['push'](_0x512b2f['shift']());}};_0x258764(++_0x2bd3a6);}(_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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x50d89d,_0x4037f8){var _0x5e5fda=function(_0x55d7b8){while(--_0x55d7b8){_0x50d89d['push'](_0x50d89d['shift']());}};_0x5e5fda(++_0x4037f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 34a6f94..a76abf8 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(_0x327449,_0x2da5bd){var _0x402990=function(_0x2ba183){while(--_0x2ba183){_0x327449['push'](_0x327449['shift']());}};_0x402990(++_0x2da5bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x232a0e,_0x4ceac){var _0x3ae2f6=function(_0x4b7a5b){while(--_0x4b7a5b){_0x232a0e['push'](_0x232a0e['shift']());}};_0x3ae2f6(++_0x4ceac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 2932b31..ee9005e 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 _0xcb16=['get_module_fields','Calls','values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','options','include','rows','catch','params','includeAll','merge','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','type','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_minutes','parent_type','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired'];(function(_0xa01987,_0x3e1f40){var _0x265d89=function(_0x1b6324){while(--_0x1b6324){_0xa01987['push'](_0xa01987['shift']());}};_0x265d89(++_0x3e1f40);}(_0xcb16,0x109));var _0x6cb1=function(_0x428ca0,_0x36b497){_0x428ca0=_0x428ca0-0x0;var _0x16e3ef=_0xcb16[_0x428ca0];return _0x16e3ef;};'use strict';var emlformat=require(_0x6cb1('0x0'));var rimraf=require(_0x6cb1('0x1'));var zipdir=require(_0x6cb1('0x2'));var jsonpatch=require(_0x6cb1('0x3'));var rp=require(_0x6cb1('0x4'));var moment=require(_0x6cb1('0x5'));var BPromise=require(_0x6cb1('0x6'));var Mustache=require(_0x6cb1('0x7'));var util=require(_0x6cb1('0x8'));var path=require(_0x6cb1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6cb1('0xa'));var fs=require('fs');var fs_extra=require(_0x6cb1('0xb'));var _=require(_0x6cb1('0xc'));var squel=require(_0x6cb1('0xd'));var crypto=require(_0x6cb1('0xe'));var jsforce=require(_0x6cb1('0xf'));var deskjs=require(_0x6cb1('0x10'));var toCsv=require(_0x6cb1('0x11'));var querystring=require(_0x6cb1('0x12'));var Papa=require(_0x6cb1('0x13'));var Redis=require(_0x6cb1('0x14'));var authService=require(_0x6cb1('0x15'));var qs=require(_0x6cb1('0x16'));var as=require(_0x6cb1('0x17'));var hardwareService=require(_0x6cb1('0x18'));var logger=require('../../config/logger')(_0x6cb1('0x19'));var utils=require('../../config/utils');var config=require(_0x6cb1('0x1a'));var licenseUtil=require(_0x6cb1('0x1b'));var db=require(_0x6cb1('0x1c'))['db'];var integrations=require(_0x6cb1('0x1d'));function respondWithStatusCode(_0x56ccda,_0x448b69){_0x448b69=_0x448b69||0xcc;return function(_0x12323c){if(_0x12323c){return _0x56ccda[_0x6cb1('0x1e')](_0x448b69);}return _0x56ccda[_0x6cb1('0x1f')](_0x448b69)[_0x6cb1('0x20')]();};}function respondWithResult(_0x559ca3,_0x54daf9){_0x54daf9=_0x54daf9||0xc8;return function(_0x3b986a){if(_0x3b986a){return _0x559ca3[_0x6cb1('0x1f')](_0x54daf9)[_0x6cb1('0x21')](_0x3b986a);}};}function respondWithFilteredResult(_0x310c64,_0x26ce6b){return function(_0x1b55b8){if(_0x1b55b8){var _0x38e6d2=typeof _0x26ce6b[_0x6cb1('0x22')]===_0x6cb1('0x23')&&typeof _0x26ce6b['limit']==='undefined';var _0x38fc96=_0x1b55b8[_0x6cb1('0x24')];var _0x5742d1=_0x38e6d2?0x0:_0x26ce6b[_0x6cb1('0x22')];var _0x36e981=_0x38e6d2?_0x1b55b8[_0x6cb1('0x24')]:_0x26ce6b[_0x6cb1('0x22')]+_0x26ce6b['limit'];var _0x5d496b;if(_0x36e981>=_0x38fc96){_0x36e981=_0x38fc96;_0x5d496b=0xc8;}else{_0x5d496b=0xce;}_0x310c64[_0x6cb1('0x1f')](_0x5d496b);return _0x310c64['set'](_0x6cb1('0x25'),_0x5742d1+'-'+_0x36e981+'/'+_0x38fc96)[_0x6cb1('0x21')](_0x1b55b8);}return null;};}function patchUpdates(_0x235a81){return function(_0xe5fcd8){try{jsonpatch[_0x6cb1('0x26')](_0xe5fcd8,_0x235a81,!![]);}catch(_0x228318){return BPromise[_0x6cb1('0x27')](_0x228318);}return _0xe5fcd8[_0x6cb1('0x28')]();};}function saveUpdates(_0x204a98,_0x53cb6f){return function(_0xbdf9a8){if(_0xbdf9a8){return _0xbdf9a8[_0x6cb1('0x29')](_0x204a98)[_0x6cb1('0x2a')](function(_0x2cd9e4){return _0x2cd9e4;});}return null;};}function removeEntity(_0x57baf4,_0x196317){return function(_0x1bb7c9){if(_0x1bb7c9){return _0x1bb7c9[_0x6cb1('0x2b')]()[_0x6cb1('0x2a')](function(){_0x57baf4[_0x6cb1('0x1f')](0xcc)[_0x6cb1('0x20')]();});}};}function handleEntityNotFound(_0xd31764,_0x3aaae0){return function(_0x1b9711){if(!_0x1b9711){_0xd31764['sendStatus'](0x194);}return _0x1b9711;};}function handleError(_0x10ea24,_0x23f54d){_0x23f54d=_0x23f54d||0x1f4;return function(_0x2ba59c){logger[_0x6cb1('0x2c')](_0x2ba59c[_0x6cb1('0x2d')]);if(_0x2ba59c[_0x6cb1('0x2e')]){delete _0x2ba59c[_0x6cb1('0x2e')];}_0x10ea24['status'](_0x23f54d)['send'](_0x2ba59c);};}exports[_0x6cb1('0x2f')]=function(_0x5d4beb,_0x82c22f){var _0x46de83={},_0x5ef1c1={},_0xac321={'count':0x0,'rows':[]};var _0x4f4cde=_[_0x6cb1('0x30')](db[_0x6cb1('0x31')][_0x6cb1('0x32')],function(_0x3995e3){return{'name':_0x3995e3[_0x6cb1('0x33')],'type':_0x3995e3['type']['key']};});_0x5ef1c1[_0x6cb1('0x34')]=_[_0x6cb1('0x30')](_0x4f4cde,_0x6cb1('0x2e'));_0x5ef1c1[_0x6cb1('0x35')]=_[_0x6cb1('0x36')](_0x5d4beb[_0x6cb1('0x35')]);_0x5ef1c1[_0x6cb1('0x37')]=_['intersection'](_0x5ef1c1[_0x6cb1('0x34')],_0x5ef1c1[_0x6cb1('0x35')]);_0x46de83['attributes']=_[_0x6cb1('0x38')](_0x5ef1c1[_0x6cb1('0x34')],qs[_0x6cb1('0x39')](_0x5d4beb[_0x6cb1('0x35')]['fields']));_0x46de83[_0x6cb1('0x3a')]=_0x46de83[_0x6cb1('0x3a')][_0x6cb1('0x3b')]?_0x46de83[_0x6cb1('0x3a')]:_0x5ef1c1[_0x6cb1('0x34')];if(!_0x5d4beb['query'][_0x6cb1('0x3c')]('nolimit')){_0x46de83[_0x6cb1('0x3d')]=qs['limit'](_0x5d4beb[_0x6cb1('0x35')][_0x6cb1('0x3d')]);_0x46de83[_0x6cb1('0x22')]=qs['offset'](_0x5d4beb[_0x6cb1('0x35')][_0x6cb1('0x22')]);}_0x46de83[_0x6cb1('0x3e')]=qs['sort'](_0x5d4beb[_0x6cb1('0x35')][_0x6cb1('0x3f')]);_0x46de83[_0x6cb1('0x40')]=qs['filters'](_[_0x6cb1('0x41')](_0x5d4beb[_0x6cb1('0x35')],_0x5ef1c1['filters']),_0x4f4cde);if(_0x5d4beb[_0x6cb1('0x35')]['filter']){_0x46de83[_0x6cb1('0x40')]=_['merge'](_0x46de83['where'],{'$or':_[_0x6cb1('0x30')](_0x4f4cde,function(_0x1238bd){if(_0x1238bd['type']!=='VIRTUAL'){var _0x2f2ab4={};_0x2f2ab4[_0x1238bd['name']]={'$like':'%'+_0x5d4beb[_0x6cb1('0x35')][_0x6cb1('0x42')]+'%'};return _0x2f2ab4;}})});}_0x46de83=_['merge']({},_0x46de83,_0x5d4beb[_0x6cb1('0x43')]);var _0x2ac362={'where':_0x46de83[_0x6cb1('0x40')]};return db[_0x6cb1('0x31')]['count'](_0x2ac362)[_0x6cb1('0x2a')](function(_0x28559e){_0xac321[_0x6cb1('0x24')]=_0x28559e;if(_0x5d4beb['query']['includeAll']){_0x46de83[_0x6cb1('0x44')]=[{'all':!![]}];}return db[_0x6cb1('0x31')]['findAll'](_0x46de83);})[_0x6cb1('0x2a')](function(_0x4e4398){_0xac321[_0x6cb1('0x45')]=_0x4e4398;return _0xac321;})['then'](respondWithFilteredResult(_0x82c22f,_0x46de83))[_0x6cb1('0x46')](handleError(_0x82c22f,null));};exports['show']=function(_0xa6b94e,_0x36d1d0){var _0x296d00={'raw':![],'where':{'id':_0xa6b94e[_0x6cb1('0x47')]['id']}},_0x489536={};_0x489536[_0x6cb1('0x34')]=_[_0x6cb1('0x36')](db[_0x6cb1('0x31')][_0x6cb1('0x32')]);_0x489536[_0x6cb1('0x35')]=_[_0x6cb1('0x36')](_0xa6b94e[_0x6cb1('0x35')]);_0x489536[_0x6cb1('0x37')]=_[_0x6cb1('0x38')](_0x489536[_0x6cb1('0x34')],_0x489536['query']);_0x296d00[_0x6cb1('0x3a')]=_[_0x6cb1('0x38')](_0x489536['model'],qs[_0x6cb1('0x39')](_0xa6b94e['query'][_0x6cb1('0x39')]));_0x296d00[_0x6cb1('0x3a')]=_0x296d00['attributes']['length']?_0x296d00[_0x6cb1('0x3a')]:_0x489536[_0x6cb1('0x34')];if(_0xa6b94e[_0x6cb1('0x35')][_0x6cb1('0x48')]){_0x296d00[_0x6cb1('0x44')]=[{'all':!![]}];}_0x296d00=_[_0x6cb1('0x49')]({},_0x296d00,_0xa6b94e[_0x6cb1('0x43')]);return db[_0x6cb1('0x31')][_0x6cb1('0x4a')](_0x296d00)[_0x6cb1('0x2a')](handleEntityNotFound(_0x36d1d0,null))[_0x6cb1('0x2a')](respondWithResult(_0x36d1d0,null))[_0x6cb1('0x46')](handleError(_0x36d1d0,null));};exports['create']=function(_0x58caee,_0x250734){return db[_0x6cb1('0x31')][_0x6cb1('0x4b')](_0x58caee[_0x6cb1('0x4c')],{})[_0x6cb1('0x2a')](respondWithResult(_0x250734,0xc9))[_0x6cb1('0x46')](handleError(_0x250734,null));};exports[_0x6cb1('0x29')]=function(_0x19aa1b,_0x5f249b){if(_0x19aa1b[_0x6cb1('0x4c')]['id']){delete _0x19aa1b[_0x6cb1('0x4c')]['id'];}return db[_0x6cb1('0x31')][_0x6cb1('0x4a')]({'where':{'id':_0x19aa1b['params']['id']}})[_0x6cb1('0x2a')](handleEntityNotFound(_0x5f249b,null))[_0x6cb1('0x2a')](saveUpdates(_0x19aa1b['body'],null))[_0x6cb1('0x2a')](respondWithResult(_0x5f249b,null))[_0x6cb1('0x46')](handleError(_0x5f249b,null));};exports[_0x6cb1('0x2b')]=function(_0x1feda6,_0x2da359){return db['SugarcrmAccount']['find']({'where':{'id':_0x1feda6['params']['id']}})[_0x6cb1('0x2a')](handleEntityNotFound(_0x2da359,null))['then'](removeEntity(_0x2da359,null))[_0x6cb1('0x46')](handleError(_0x2da359,null));};exports['getConfigurations']=function(_0x278c15,_0x44a097,_0x19d780){var _0x353274={};var _0x1f6fc5={};var _0x18a5d5;var _0x2bfbbe;return db[_0x6cb1('0x31')][_0x6cb1('0x4d')]({'where':{'id':_0x278c15[_0x6cb1('0x47')]['id']}})[_0x6cb1('0x2a')](handleEntityNotFound(_0x44a097,null))[_0x6cb1('0x2a')](function(_0x8b27a2){if(_0x8b27a2){_0x18a5d5=_0x8b27a2;_0x1f6fc5[_0x6cb1('0x34')]=_[_0x6cb1('0x36')](db[_0x6cb1('0x4e')]['rawAttributes']);_0x1f6fc5[_0x6cb1('0x35')]=_[_0x6cb1('0x36')](_0x278c15['query']);_0x1f6fc5[_0x6cb1('0x37')]=_[_0x6cb1('0x38')](_0x1f6fc5[_0x6cb1('0x34')],_0x1f6fc5[_0x6cb1('0x35')]);_0x353274[_0x6cb1('0x3a')]=_['intersection'](_0x1f6fc5['model'],qs[_0x6cb1('0x39')](_0x278c15[_0x6cb1('0x35')][_0x6cb1('0x39')]));_0x353274[_0x6cb1('0x3a')]=_0x353274[_0x6cb1('0x3a')][_0x6cb1('0x3b')]?_0x353274[_0x6cb1('0x3a')]:_0x1f6fc5[_0x6cb1('0x34')];_0x353274['order']=qs[_0x6cb1('0x3f')](_0x278c15[_0x6cb1('0x35')]['sort']);_0x353274[_0x6cb1('0x40')]=qs[_0x6cb1('0x37')](_[_0x6cb1('0x41')](_0x278c15[_0x6cb1('0x35')],_0x1f6fc5[_0x6cb1('0x37')]));if(_0x278c15[_0x6cb1('0x35')][_0x6cb1('0x42')]){_0x353274[_0x6cb1('0x40')]=_[_0x6cb1('0x49')](_0x353274[_0x6cb1('0x40')],{'$or':_['map'](_0x353274['attributes'],function(_0x20d056){var _0x20c400={};_0x20c400[_0x20d056]={'$like':'%'+_0x278c15['query'][_0x6cb1('0x42')]+'%'};return _0x20c400;})});}_0x353274=_['merge']({},_0x353274,_0x278c15[_0x6cb1('0x43')]);return _0x18a5d5[_0x6cb1('0x4f')](_0x353274);}})[_0x6cb1('0x2a')](function(_0x4067da){if(_0x4067da){_0x2bfbbe=_0x4067da[_0x6cb1('0x3b')];if(!_0x278c15[_0x6cb1('0x35')][_0x6cb1('0x3c')](_0x6cb1('0x50'))){_0x353274[_0x6cb1('0x3d')]=qs[_0x6cb1('0x3d')](_0x278c15[_0x6cb1('0x35')][_0x6cb1('0x3d')]);_0x353274[_0x6cb1('0x22')]=qs[_0x6cb1('0x22')](_0x278c15[_0x6cb1('0x35')][_0x6cb1('0x22')]);}return _0x18a5d5[_0x6cb1('0x4f')](_0x353274);}})['then'](function(_0x15a5ba){if(_0x15a5ba){return _0x15a5ba?{'count':_0x2bfbbe,'rows':_0x15a5ba}:null;}})[_0x6cb1('0x2a')](respondWithResult(_0x44a097,null))['catch'](handleError(_0x44a097,null));};exports[_0x6cb1('0x51')]=function(_0x20f5de,_0x4b6818,_0x518799){if(_0x20f5de[_0x6cb1('0x4c')]['id']){delete _0x20f5de[_0x6cb1('0x4c')]['id'];}return db[_0x6cb1('0x31')][_0x6cb1('0x4d')]({'where':{'id':_0x20f5de[_0x6cb1('0x47')]['id']}})[_0x6cb1('0x2a')](handleEntityNotFound(_0x4b6818,null))[_0x6cb1('0x2a')](function(_0x26b951){if(_0x26b951){_0x20f5de['body'][_0x6cb1('0x52')]=_0x26b951['id'];_0x20f5de[_0x6cb1('0x4c')][_0x6cb1('0x53')]=integrations['getSubjects'](_0x20f5de[_0x6cb1('0x4c')][_0x6cb1('0x54')],_0x20f5de[_0x6cb1('0x4c')][_0x6cb1('0x55')]);_0x20f5de[_0x6cb1('0x4c')]['Descriptions']=integrations[_0x6cb1('0x56')](_0x20f5de['body']['channel'],_0x20f5de[_0x6cb1('0x4c')]['type']);return db[_0x6cb1('0x4e')][_0x6cb1('0x4b')](_0x20f5de['body'],{'include':[{'model':db[_0x6cb1('0x57')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x6cb1('0x58')}]});}return null;})['then'](respondWithResult(_0x4b6818,null))['catch'](handleError(_0x4b6818,null));};exports[_0x6cb1('0x59')]=function(_0x234977,_0x5d0e06,_0x484cf1){var _0x1599b5='';var _0x3fc3ae=['id','name',_0x6cb1('0x5a'),'created_by',_0x6cb1('0x5b'),_0x6cb1('0x5c'),'duration_hours',_0x6cb1('0x5d'),'parent_id',_0x6cb1('0x5e'),_0x6cb1('0x5f'),_0x6cb1('0x60')];return db['SugarcrmAccount'][_0x6cb1('0x4d')]({'where':{'id':_0x234977[_0x6cb1('0x47')]['id']},'attributes':['id','username','password',_0x6cb1('0x61')]})['then'](handleEntityNotFound(_0x5d0e06,null))[_0x6cb1('0x2a')](function(_0x364676){if(_0x364676){_0x1599b5=_0x364676['remoteUri'];var _0x40fc2d=_0x1599b5[_0x6cb1('0x62')](-0x1);if(_0x40fc2d==='/'){_0x1599b5=_0x1599b5[_0x6cb1('0x63')](0x0,_0x1599b5[_0x6cb1('0x64')](_0x40fc2d));}return rp({'method':_0x6cb1('0x65'),'uri':util[_0x6cb1('0x66')](_0x6cb1('0x67'),_0x1599b5,_0x6cb1('0x68')),'json':!![],'form':{'method':_0x6cb1('0x69'),'input_type':_0x6cb1('0x6a'),'response_type':_0x6cb1('0x6a'),'rest_data':JSON[_0x6cb1('0x6b')]({'user_auth':{'user_name':_0x364676[_0x6cb1('0x6c')],'password':_0x364676[_0x6cb1('0x6d')],'encryption':'PLAIN'},'application':_0x6cb1('0x6e')})}});}})[_0x6cb1('0x2a')](function(_0xfc44ce){if(_0xfc44ce&&_0xfc44ce[_0x6cb1('0x2e')]!==_0x6cb1('0x6f')&&_0xfc44ce[_0x6cb1('0x2e')]!==_0x6cb1('0x70')){return rp({'method':_0x6cb1('0x65'),'uri':util[_0x6cb1('0x66')]('%s%s',_0x1599b5,_0x6cb1('0x68')),'json':!![],'form':{'method':_0x6cb1('0x71'),'input_type':_0x6cb1('0x6a'),'response_type':'JSON','rest_data':JSON[_0x6cb1('0x6b')]({'session':_0xfc44ce['id'],'module_name':_0x6cb1('0x72')})}})[_0x6cb1('0x2a')](function(_0xe6d7d4){if(_0xe6d7d4){var _0x232988=_[_0x6cb1('0x73')](_0xe6d7d4[_0x6cb1('0x74')]);_[_0x6cb1('0x75')](_0x232988,function(_0x3c7a24){return _0x3fc3ae[_0x6cb1('0x76')](_0x3c7a24[_0x6cb1('0x2e')]);});return{'count':_0x232988['length'],'rows':_[_0x6cb1('0x30')](_0x232988,function(_0x564a90){return{'id':_0x564a90[_0x6cb1('0x2e')],'name':_0x564a90[_0x6cb1('0x77')],'custom':_['endsWith'](_0x564a90[_0x6cb1('0x2e')],'_c')?!![]:![],'options':_0x564a90[_0x6cb1('0x43')]?_[_0x6cb1('0x30')](_['values'](_0x564a90['options']),function(_0x48d840){return{'name':_0x48d840[_0x6cb1('0x78')],'value':_0x48d840[_0x6cb1('0x2e')]};}):[]};})};}})[_0x6cb1('0x2a')](respondWithResult(_0x5d0e06,null))[_0x6cb1('0x46')](function(_0x1a6c72){var _0x1b5a9a=_0x234977[_0x6cb1('0x35')][_0x6cb1('0x79')]?0x1f4:_0x1a6c72[_0x6cb1('0x7a')]||0x1f4;logger[_0x6cb1('0x2c')](_0x6cb1('0x7b'),_0x6cb1('0x59'),_0x1b5a9a,JSON['stringify'](_0x1a6c72));delete _0x1a6c72['name'];if(_0x1b5a9a===0x191){_0x1b5a9a=0x190;}_0x5d0e06[_0x6cb1('0x1f')](_0x1b5a9a)[_0x6cb1('0x7c')](_0x234977[_0x6cb1('0x35')][_0x6cb1('0x79')]?{'message':_0x6cb1('0x7d'),'statusCode':_0x1a6c72[_0x6cb1('0x7a')]}:_0x1a6c72);});}else{var _0x50cdd=0x1f4;_0x5d0e06[_0x6cb1('0x1f')](_0x50cdd)[_0x6cb1('0x7c')]({'message':_0x6cb1('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0689=['Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_minutes','parent_type','parent_name','username','password','slice','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','error','stack','name','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x3192a1,_0x2d6306){var _0x45378b=function(_0x1a5df5){while(--_0x1a5df5){_0x3192a1['push'](_0x3192a1['shift']());}};_0x45378b(++_0x2d6306);}(_0x0689,0x10f));var _0x9068=function(_0x36055a,_0x55613a){_0x36055a=_0x36055a-0x0;var _0x1eb71f=_0x0689[_0x36055a];return _0x1eb71f;};'use strict';var emlformat=require(_0x9068('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9068('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9068('0x2'));var moment=require(_0x9068('0x3'));var BPromise=require(_0x9068('0x4'));var Mustache=require('mustache');var util=require(_0x9068('0x5'));var path=require('path');var sox=require(_0x9068('0x6'));var csv=require(_0x9068('0x7'));var ejs=require(_0x9068('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9068('0x9'));var crypto=require(_0x9068('0xa'));var jsforce=require(_0x9068('0xb'));var deskjs=require(_0x9068('0xc'));var toCsv=require(_0x9068('0x7'));var querystring=require(_0x9068('0xd'));var Papa=require(_0x9068('0xe'));var Redis=require(_0x9068('0xf'));var authService=require(_0x9068('0x10'));var qs=require(_0x9068('0x11'));var as=require(_0x9068('0x12'));var hardwareService=require(_0x9068('0x13'));var logger=require(_0x9068('0x14'))(_0x9068('0x15'));var utils=require(_0x9068('0x16'));var config=require(_0x9068('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9068('0x18'))['db'];var integrations=require(_0x9068('0x19'));function respondWithStatusCode(_0xea5afb,_0x49c05a){_0x49c05a=_0x49c05a||0xcc;return function(_0x58b7ad){if(_0x58b7ad){return _0xea5afb[_0x9068('0x1a')](_0x49c05a);}return _0xea5afb[_0x9068('0x1b')](_0x49c05a)[_0x9068('0x1c')]();};}function respondWithResult(_0x28dc21,_0x23c32a){_0x23c32a=_0x23c32a||0xc8;return function(_0x363d6c){if(_0x363d6c){return _0x28dc21[_0x9068('0x1b')](_0x23c32a)[_0x9068('0x1d')](_0x363d6c);}};}function respondWithFilteredResult(_0xadca5a,_0x321806){return function(_0x583eee){if(_0x583eee){var _0x1544a4=typeof _0x321806[_0x9068('0x1e')]===_0x9068('0x1f')&&typeof _0x321806['limit']==='undefined';var _0x3a2f31=_0x583eee[_0x9068('0x20')];var _0x5cc176=_0x1544a4?0x0:_0x321806[_0x9068('0x1e')];var _0x1ba9dc=_0x1544a4?_0x583eee[_0x9068('0x20')]:_0x321806[_0x9068('0x1e')]+_0x321806[_0x9068('0x21')];var _0x75a678;if(_0x1ba9dc>=_0x3a2f31){_0x1ba9dc=_0x3a2f31;_0x75a678=0xc8;}else{_0x75a678=0xce;}_0xadca5a[_0x9068('0x1b')](_0x75a678);return _0xadca5a[_0x9068('0x22')](_0x9068('0x23'),_0x5cc176+'-'+_0x1ba9dc+'/'+_0x3a2f31)[_0x9068('0x1d')](_0x583eee);}return null;};}function patchUpdates(_0x123f3f){return function(_0x3ca634){try{jsonpatch['apply'](_0x3ca634,_0x123f3f,!![]);}catch(_0x390524){return BPromise[_0x9068('0x24')](_0x390524);}return _0x3ca634['save']();};}function saveUpdates(_0x4ac806,_0x4f4ac2){return function(_0x21d76f){if(_0x21d76f){return _0x21d76f[_0x9068('0x25')](_0x4ac806)['then'](function(_0x47d337){return _0x47d337;});}return null;};}function removeEntity(_0xe2f9e0,_0x76b5ec){return function(_0x284f98){if(_0x284f98){return _0x284f98[_0x9068('0x26')]()[_0x9068('0x27')](function(){_0xe2f9e0[_0x9068('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x211c76,_0x51df0b){return function(_0x15dd19){if(!_0x15dd19){_0x211c76['sendStatus'](0x194);}return _0x15dd19;};}function handleError(_0xfc9edb,_0x5b3449){_0x5b3449=_0x5b3449||0x1f4;return function(_0x18bd76){logger[_0x9068('0x28')](_0x18bd76[_0x9068('0x29')]);if(_0x18bd76[_0x9068('0x2a')]){delete _0x18bd76['name'];}_0xfc9edb[_0x9068('0x1b')](_0x5b3449)['send'](_0x18bd76);};}exports['index']=function(_0x5edc44,_0x3d12ef){var _0x51e7da={},_0x5eca60={},_0x46cb9f={'count':0x0,'rows':[]};var _0x4ee078=_[_0x9068('0x2b')](db[_0x9068('0x2c')]['rawAttributes'],function(_0x19c42b){return{'name':_0x19c42b[_0x9068('0x2d')],'type':_0x19c42b[_0x9068('0x2e')][_0x9068('0x2f')]};});_0x5eca60[_0x9068('0x30')]=_[_0x9068('0x2b')](_0x4ee078,_0x9068('0x2a'));_0x5eca60[_0x9068('0x31')]=_[_0x9068('0x32')](_0x5edc44['query']);_0x5eca60[_0x9068('0x33')]=_[_0x9068('0x34')](_0x5eca60[_0x9068('0x30')],_0x5eca60[_0x9068('0x31')]);_0x51e7da[_0x9068('0x35')]=_[_0x9068('0x34')](_0x5eca60[_0x9068('0x30')],qs[_0x9068('0x36')](_0x5edc44[_0x9068('0x31')][_0x9068('0x36')]));_0x51e7da[_0x9068('0x35')]=_0x51e7da[_0x9068('0x35')][_0x9068('0x37')]?_0x51e7da[_0x9068('0x35')]:_0x5eca60[_0x9068('0x30')];if(!_0x5edc44['query'][_0x9068('0x38')](_0x9068('0x39'))){_0x51e7da[_0x9068('0x21')]=qs[_0x9068('0x21')](_0x5edc44['query'][_0x9068('0x21')]);_0x51e7da[_0x9068('0x1e')]=qs['offset'](_0x5edc44[_0x9068('0x31')][_0x9068('0x1e')]);}_0x51e7da[_0x9068('0x3a')]=qs[_0x9068('0x3b')](_0x5edc44[_0x9068('0x31')][_0x9068('0x3b')]);_0x51e7da['where']=qs['filters'](_[_0x9068('0x3c')](_0x5edc44['query'],_0x5eca60[_0x9068('0x33')]),_0x4ee078);if(_0x5edc44[_0x9068('0x31')]['filter']){_0x51e7da[_0x9068('0x3d')]=_[_0x9068('0x3e')](_0x51e7da['where'],{'$or':_[_0x9068('0x2b')](_0x4ee078,function(_0x2f56c6){if(_0x2f56c6[_0x9068('0x2e')]!==_0x9068('0x3f')){var _0x5f2ddb={};_0x5f2ddb[_0x2f56c6[_0x9068('0x2a')]]={'$like':'%'+_0x5edc44[_0x9068('0x31')]['filter']+'%'};return _0x5f2ddb;}})});}_0x51e7da=_[_0x9068('0x3e')]({},_0x51e7da,_0x5edc44[_0x9068('0x40')]);var _0x5bdc20={'where':_0x51e7da[_0x9068('0x3d')]};return db[_0x9068('0x2c')][_0x9068('0x20')](_0x5bdc20)[_0x9068('0x27')](function(_0x13183d){_0x46cb9f[_0x9068('0x20')]=_0x13183d;if(_0x5edc44[_0x9068('0x31')][_0x9068('0x41')]){_0x51e7da[_0x9068('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x9068('0x43')](_0x51e7da);})[_0x9068('0x27')](function(_0x1fc41e){_0x46cb9f['rows']=_0x1fc41e;return _0x46cb9f;})[_0x9068('0x27')](respondWithFilteredResult(_0x3d12ef,_0x51e7da))[_0x9068('0x44')](handleError(_0x3d12ef,null));};exports['show']=function(_0x2b6032,_0x39f21b){var _0x4815c8={'raw':![],'where':{'id':_0x2b6032[_0x9068('0x45')]['id']}},_0x57d76f={};_0x57d76f[_0x9068('0x30')]=_[_0x9068('0x32')](db[_0x9068('0x2c')][_0x9068('0x46')]);_0x57d76f[_0x9068('0x31')]=_['keys'](_0x2b6032[_0x9068('0x31')]);_0x57d76f[_0x9068('0x33')]=_['intersection'](_0x57d76f[_0x9068('0x30')],_0x57d76f[_0x9068('0x31')]);_0x4815c8[_0x9068('0x35')]=_[_0x9068('0x34')](_0x57d76f[_0x9068('0x30')],qs['fields'](_0x2b6032[_0x9068('0x31')]['fields']));_0x4815c8[_0x9068('0x35')]=_0x4815c8[_0x9068('0x35')][_0x9068('0x37')]?_0x4815c8[_0x9068('0x35')]:_0x57d76f[_0x9068('0x30')];if(_0x2b6032[_0x9068('0x31')]['includeAll']){_0x4815c8[_0x9068('0x42')]=[{'all':!![]}];}_0x4815c8=_[_0x9068('0x3e')]({},_0x4815c8,_0x2b6032[_0x9068('0x40')]);return db[_0x9068('0x2c')][_0x9068('0x47')](_0x4815c8)[_0x9068('0x27')](handleEntityNotFound(_0x39f21b,null))[_0x9068('0x27')](respondWithResult(_0x39f21b,null))[_0x9068('0x44')](handleError(_0x39f21b,null));};exports[_0x9068('0x48')]=function(_0x3eee5b,_0x2d9b9a){return db[_0x9068('0x2c')]['create'](_0x3eee5b[_0x9068('0x49')],{})[_0x9068('0x27')](respondWithResult(_0x2d9b9a,0xc9))[_0x9068('0x44')](handleError(_0x2d9b9a,null));};exports[_0x9068('0x25')]=function(_0x1893e1,_0x119d68){if(_0x1893e1[_0x9068('0x49')]['id']){delete _0x1893e1[_0x9068('0x49')]['id'];}return db[_0x9068('0x2c')][_0x9068('0x47')]({'where':{'id':_0x1893e1[_0x9068('0x45')]['id']}})[_0x9068('0x27')](handleEntityNotFound(_0x119d68,null))[_0x9068('0x27')](saveUpdates(_0x1893e1['body'],null))['then'](respondWithResult(_0x119d68,null))['catch'](handleError(_0x119d68,null));};exports[_0x9068('0x26')]=function(_0x5afd02,_0x5b3e6b){return db[_0x9068('0x2c')][_0x9068('0x47')]({'where':{'id':_0x5afd02[_0x9068('0x45')]['id']}})[_0x9068('0x27')](handleEntityNotFound(_0x5b3e6b,null))['then'](removeEntity(_0x5b3e6b,null))[_0x9068('0x44')](handleError(_0x5b3e6b,null));};exports[_0x9068('0x4a')]=function(_0x1c531c,_0x4a1335,_0x4ea1a9){var _0x4c85a5={};var _0x5103fe={};var _0x2ec20b;var _0x2e60b9;return db['SugarcrmAccount'][_0x9068('0x4b')]({'where':{'id':_0x1c531c[_0x9068('0x45')]['id']}})[_0x9068('0x27')](handleEntityNotFound(_0x4a1335,null))[_0x9068('0x27')](function(_0x3360f1){if(_0x3360f1){_0x2ec20b=_0x3360f1;_0x5103fe[_0x9068('0x30')]=_[_0x9068('0x32')](db[_0x9068('0x4c')]['rawAttributes']);_0x5103fe[_0x9068('0x31')]=_['keys'](_0x1c531c[_0x9068('0x31')]);_0x5103fe[_0x9068('0x33')]=_[_0x9068('0x34')](_0x5103fe[_0x9068('0x30')],_0x5103fe[_0x9068('0x31')]);_0x4c85a5[_0x9068('0x35')]=_['intersection'](_0x5103fe['model'],qs[_0x9068('0x36')](_0x1c531c[_0x9068('0x31')][_0x9068('0x36')]));_0x4c85a5[_0x9068('0x35')]=_0x4c85a5[_0x9068('0x35')][_0x9068('0x37')]?_0x4c85a5[_0x9068('0x35')]:_0x5103fe[_0x9068('0x30')];_0x4c85a5[_0x9068('0x3a')]=qs[_0x9068('0x3b')](_0x1c531c[_0x9068('0x31')]['sort']);_0x4c85a5[_0x9068('0x3d')]=qs[_0x9068('0x33')](_[_0x9068('0x3c')](_0x1c531c[_0x9068('0x31')],_0x5103fe[_0x9068('0x33')]));if(_0x1c531c[_0x9068('0x31')][_0x9068('0x4d')]){_0x4c85a5[_0x9068('0x3d')]=_[_0x9068('0x3e')](_0x4c85a5['where'],{'$or':_[_0x9068('0x2b')](_0x4c85a5['attributes'],function(_0x452433){var _0x55424a={};_0x55424a[_0x452433]={'$like':'%'+_0x1c531c['query'][_0x9068('0x4d')]+'%'};return _0x55424a;})});}_0x4c85a5=_[_0x9068('0x3e')]({},_0x4c85a5,_0x1c531c[_0x9068('0x40')]);return _0x2ec20b[_0x9068('0x4a')](_0x4c85a5);}})[_0x9068('0x27')](function(_0x20507f){if(_0x20507f){_0x2e60b9=_0x20507f[_0x9068('0x37')];if(!_0x1c531c['query']['hasOwnProperty'](_0x9068('0x39'))){_0x4c85a5[_0x9068('0x21')]=qs['limit'](_0x1c531c[_0x9068('0x31')][_0x9068('0x21')]);_0x4c85a5[_0x9068('0x1e')]=qs[_0x9068('0x1e')](_0x1c531c[_0x9068('0x31')][_0x9068('0x1e')]);}return _0x2ec20b[_0x9068('0x4a')](_0x4c85a5);}})[_0x9068('0x27')](function(_0x233e87){if(_0x233e87){return _0x233e87?{'count':_0x2e60b9,'rows':_0x233e87}:null;}})['then'](respondWithResult(_0x4a1335,null))[_0x9068('0x44')](handleError(_0x4a1335,null));};exports[_0x9068('0x4e')]=function(_0x580b19,_0x4058f2,_0x6e00a8){if(_0x580b19[_0x9068('0x49')]['id']){delete _0x580b19['body']['id'];}return db[_0x9068('0x2c')]['findOne']({'where':{'id':_0x580b19[_0x9068('0x45')]['id']}})[_0x9068('0x27')](handleEntityNotFound(_0x4058f2,null))[_0x9068('0x27')](function(_0x1a1112){if(_0x1a1112){_0x580b19['body'][_0x9068('0x4f')]=_0x1a1112['id'];_0x580b19[_0x9068('0x49')][_0x9068('0x50')]=integrations[_0x9068('0x51')](_0x580b19['body'][_0x9068('0x52')],_0x580b19[_0x9068('0x49')][_0x9068('0x2e')]);_0x580b19[_0x9068('0x49')][_0x9068('0x53')]=integrations[_0x9068('0x54')](_0x580b19[_0x9068('0x49')][_0x9068('0x52')],_0x580b19['body']['type']);return db[_0x9068('0x4c')][_0x9068('0x48')](_0x580b19[_0x9068('0x49')],{'include':[{'model':db[_0x9068('0x55')],'as':_0x9068('0x50')},{'model':db[_0x9068('0x55')],'as':_0x9068('0x53')}]});}return null;})[_0x9068('0x27')](respondWithResult(_0x4058f2,null))[_0x9068('0x44')](handleError(_0x4058f2,null));};exports[_0x9068('0x56')]=function(_0x3471df,_0x302fcb,_0x1f3cbf){var _0x51b241='';var _0x33a3f4=['id',_0x9068('0x2a'),_0x9068('0x57'),'created_by','description',_0x9068('0x58'),'duration_hours',_0x9068('0x59'),'parent_id',_0x9068('0x5a'),_0x9068('0x5b'),'direction'];return db[_0x9068('0x2c')][_0x9068('0x4b')]({'where':{'id':_0x3471df['params']['id']},'attributes':['id',_0x9068('0x5c'),_0x9068('0x5d'),'remoteUri']})[_0x9068('0x27')](handleEntityNotFound(_0x302fcb,null))[_0x9068('0x27')](function(_0x322544){if(_0x322544){_0x51b241=_0x322544['remoteUri'];var _0x121bde=_0x51b241[_0x9068('0x5e')](-0x1);if(_0x121bde==='/'){_0x51b241=_0x51b241['substring'](0x0,_0x51b241['lastIndexOf'](_0x121bde));}return rp({'method':_0x9068('0x5f'),'uri':util[_0x9068('0x60')](_0x9068('0x61'),_0x51b241,_0x9068('0x62')),'json':!![],'form':{'method':_0x9068('0x63'),'input_type':_0x9068('0x64'),'response_type':_0x9068('0x64'),'rest_data':JSON[_0x9068('0x65')]({'user_auth':{'user_name':_0x322544[_0x9068('0x5c')],'password':_0x322544[_0x9068('0x5d')],'encryption':_0x9068('0x66')},'application':_0x9068('0x67')})}});}})[_0x9068('0x27')](function(_0x39a9c2){if(_0x39a9c2&&_0x39a9c2[_0x9068('0x2a')]!==_0x9068('0x68')&&_0x39a9c2['name']!==_0x9068('0x69')){return rp({'method':_0x9068('0x5f'),'uri':util[_0x9068('0x60')](_0x9068('0x61'),_0x51b241,_0x9068('0x62')),'json':!![],'form':{'method':_0x9068('0x6a'),'input_type':_0x9068('0x64'),'response_type':_0x9068('0x64'),'rest_data':JSON[_0x9068('0x65')]({'session':_0x39a9c2['id'],'module_name':_0x9068('0x6b')})}})[_0x9068('0x27')](function(_0x1f426d){if(_0x1f426d){var _0x34407d=_[_0x9068('0x6c')](_0x1f426d[_0x9068('0x6d')]);_[_0x9068('0x6e')](_0x34407d,function(_0xc72135){return _0x33a3f4[_0x9068('0x6f')](_0xc72135[_0x9068('0x2a')]);});return{'count':_0x34407d[_0x9068('0x37')],'rows':_[_0x9068('0x2b')](_0x34407d,function(_0x3d13af){return{'id':_0x3d13af[_0x9068('0x2a')],'name':_0x3d13af[_0x9068('0x70')],'custom':_['endsWith'](_0x3d13af[_0x9068('0x2a')],'_c')?!![]:![],'options':_0x3d13af[_0x9068('0x40')]?_[_0x9068('0x2b')](_['values'](_0x3d13af[_0x9068('0x40')]),function(_0x1ce599){return{'name':_0x1ce599[_0x9068('0x71')],'value':_0x1ce599[_0x9068('0x2a')]};}):[]};})};}})[_0x9068('0x27')](respondWithResult(_0x302fcb,null))['catch'](function(_0x4f84da){var _0x5dd125=_0x3471df[_0x9068('0x31')]['test']?0x1f4:_0x4f84da[_0x9068('0x72')]||0x1f4;logger[_0x9068('0x28')](_0x9068('0x73'),'getFields',_0x5dd125,JSON[_0x9068('0x65')](_0x4f84da));delete _0x4f84da[_0x9068('0x2a')];if(_0x5dd125===0x191){_0x5dd125=0x190;}_0x302fcb['status'](_0x5dd125)[_0x9068('0x74')](_0x3471df[_0x9068('0x31')]['test']?{'message':_0x9068('0x75'),'statusCode':_0x4f84da[_0x9068('0x72')]}:_0x4f84da);});}else{var _0x513db5=0x1f4;_0x302fcb[_0x9068('0x1b')](_0x513db5)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index a5e5e8c..8b9e51a 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 _0xf71f=['api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x3563dd,_0x586fae){var _0xc950e1=function(_0xeb5218){while(--_0xeb5218){_0x3563dd['push'](_0x3563dd['shift']());}};_0xc950e1(++_0x586fae);}(_0xf71f,0x1ab));var _0xff71=function(_0x341211,_0xd672ba){_0x341211=_0x341211-0x0;var _0x5344f9=_0xf71f[_0x341211];return _0x5344f9;};'use strict';var _=require(_0xff71('0x0'));var util=require(_0xff71('0x1'));var logger=require('../../config/logger')(_0xff71('0x2'));var moment=require(_0xff71('0x3'));var BPromise=require(_0xff71('0x4'));var rp=require(_0xff71('0x5'));var fs=require('fs');var path=require(_0xff71('0x6'));var rimraf=require('rimraf');var config=require(_0xff71('0x7'));var attributes=require(_0xff71('0x8'));var integrations=require(_0xff71('0x9'));module[_0xff71('0xa')]=function(_0xf4a368,_0x4b86f4){return _0xf4a368['define'](_0xff71('0xb'),attributes,{'tableName':_0xff71('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa000=['define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','moment','request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports'];(function(_0x5ccb51,_0x18dcf9){var _0x137386=function(_0x2803ac){while(--_0x2803ac){_0x5ccb51['push'](_0x5ccb51['shift']());}};_0x137386(++_0x18dcf9);}(_0xa000,0x18f));var _0x0a00=function(_0x322ce9,_0x2b537c){_0x322ce9=_0x322ce9-0x0;var _0x739790=_0xa000[_0x322ce9];return _0x739790;};'use strict';var _=require('lodash');var util=require(_0x0a00('0x0'));var logger=require(_0x0a00('0x1'))('api');var moment=require(_0x0a00('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a00('0x3'));var fs=require('fs');var path=require(_0x0a00('0x4'));var rimraf=require(_0x0a00('0x5'));var config=require('../../config/environment');var attributes=require(_0x0a00('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x0a00('0x7')]=function(_0xb2c74c,_0x72ffc){return _0xb2c74c[_0x0a00('0x8')](_0x0a00('0x9'),attributes,{'tableName':_0x0a00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 0b44287..234082d 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 _0x0ce3=['map','model','include','then','info','ShowSugarcrmAccount','SugarcrmAccount','find','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit'];(function(_0x20edcb,_0x4d49a8){var _0x1ced78=function(_0x417d85){while(--_0x417d85){_0x20edcb['push'](_0x20edcb['shift']());}};_0x1ced78(++_0x4d49a8);}(_0x0ce3,0x119));var _0x30ce=function(_0x2df9d3,_0x1e6151){_0x2df9d3=_0x2df9d3-0x0;var _0x1ee679=_0x0ce3[_0x2df9d3];return _0x1ee679;};'use strict';var _=require('lodash');var util=require(_0x30ce('0x0'));var moment=require(_0x30ce('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30ce('0x2'));var db=require(_0x30ce('0x3'))['db'];var utils=require(_0x30ce('0x4'));var logger=require(_0x30ce('0x5'))(_0x30ce('0x6'));var config=require('../../config/environment');var jayson=require(_0x30ce('0x7'));var client=jayson[_0x30ce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60daac,_0x43c708,_0x3bda56){return new BPromise(function(_0x330ae0,_0x22475a){return client['request'](_0x60daac,_0x3bda56)['then'](function(_0x281a2a){logger['info'](_0x30ce('0x9'),_0x43c708,'request\x20sent');logger['debug'](_0x30ce('0xa'),_0x43c708,_0x30ce('0xb'),JSON[_0x30ce('0xc')](_0x281a2a));if(_0x281a2a['error']){if(_0x281a2a[_0x30ce('0xd')][_0x30ce('0xe')]===0x1f4){logger[_0x30ce('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x43c708,_0x281a2a[_0x30ce('0xd')][_0x30ce('0xf')]);return _0x22475a(_0x281a2a['error'][_0x30ce('0xf')]);}logger['error'](_0x30ce('0x9'),_0x43c708,_0x281a2a['error'][_0x30ce('0xf')]);return _0x330ae0(_0x281a2a['error'][_0x30ce('0xf')]);}else{logger['info'](_0x30ce('0x9'),_0x43c708,_0x30ce('0xb'));_0x330ae0(_0x281a2a[_0x30ce('0x10')][_0x30ce('0xf')]);}})[_0x30ce('0x11')](function(_0x3acdbb){logger[_0x30ce('0xd')](_0x30ce('0x9'),_0x43c708,_0x3acdbb);_0x22475a(_0x3acdbb);});});}exports[_0x30ce('0x12')]=function(_0x182568){var _0x3c573d=this;return new Promise(function(_0x3be598,_0x5c4cb5){return db['SugarcrmAccount'][_0x30ce('0x13')]({'raw':_0x182568[_0x30ce('0x14')]?_0x182568[_0x30ce('0x14')][_0x30ce('0x15')]===undefined?!![]:![]:!![],'where':_0x182568[_0x30ce('0x14')]?_0x182568[_0x30ce('0x14')][_0x30ce('0x16')]||null:null,'attributes':_0x182568[_0x30ce('0x14')]?_0x182568['options'][_0x30ce('0x17')]||null:null,'limit':_0x182568[_0x30ce('0x14')]?_0x182568[_0x30ce('0x14')][_0x30ce('0x18')]||null:null,'include':_0x182568['options']?_0x182568[_0x30ce('0x14')]['include']?_[_0x30ce('0x19')](_0x182568[_0x30ce('0x14')]['include'],function(_0x50c426){return{'model':db[_0x50c426[_0x30ce('0x1a')]],'as':_0x50c426['as'],'attributes':_0x50c426[_0x30ce('0x17')],'include':_0x50c426[_0x30ce('0x1b')]?_[_0x30ce('0x19')](_0x50c426[_0x30ce('0x1b')],function(_0x319348){return{'model':db[_0x319348[_0x30ce('0x1a')]],'as':_0x319348['as'],'attributes':_0x319348[_0x30ce('0x17')],'include':_0x319348[_0x30ce('0x1b')]?_[_0x30ce('0x19')](_0x319348['include'],function(_0x3cb193){return{'model':db[_0x3cb193[_0x30ce('0x1a')]],'as':_0x3cb193['as'],'attributes':_0x3cb193[_0x30ce('0x17')]};}):[]};}):[]};}):[]:[]})[_0x30ce('0x1c')](function(_0x4a5a73){logger[_0x30ce('0x1d')](_0x30ce('0x12'),_0x182568);logger['debug'](_0x30ce('0x12'),_0x182568,JSON['stringify'](_0x4a5a73));_0x3be598(_0x4a5a73);})[_0x30ce('0x11')](function(_0x310a52){logger[_0x30ce('0xd')](_0x30ce('0x12'),_0x310a52[_0x30ce('0xf')],_0x182568);_0x5c4cb5(_0x3c573d[_0x30ce('0xd')](0x1f4,_0x310a52['message']));});});};exports[_0x30ce('0x1e')]=function(_0x748a02){var _0x59db67=this;return new Promise(function(_0x311627,_0x10326b){return db[_0x30ce('0x1f')][_0x30ce('0x20')]({'raw':_0x748a02[_0x30ce('0x14')]?_0x748a02[_0x30ce('0x14')][_0x30ce('0x15')]===undefined?!![]:![]:!![],'where':_0x748a02[_0x30ce('0x14')]?_0x748a02['options'][_0x30ce('0x16')]||null:null,'attributes':_0x748a02['options']?_0x748a02[_0x30ce('0x14')][_0x30ce('0x17')]||null:null,'include':_0x748a02['options']?_0x748a02[_0x30ce('0x14')][_0x30ce('0x1b')]?_[_0x30ce('0x19')](_0x748a02[_0x30ce('0x14')][_0x30ce('0x1b')],function(_0xabb9d8){return{'model':db[_0xabb9d8[_0x30ce('0x1a')]],'as':_0xabb9d8['as'],'attributes':_0xabb9d8[_0x30ce('0x17')],'include':_0xabb9d8[_0x30ce('0x1b')]?_[_0x30ce('0x19')](_0xabb9d8[_0x30ce('0x1b')],function(_0x26f346){return{'model':db[_0x26f346[_0x30ce('0x1a')]],'as':_0x26f346['as'],'attributes':_0x26f346[_0x30ce('0x17')],'include':_0x26f346['include']?_['map'](_0x26f346[_0x30ce('0x1b')],function(_0x21627f){return{'model':db[_0x21627f[_0x30ce('0x1a')]],'as':_0x21627f['as'],'attributes':_0x21627f[_0x30ce('0x17')]};}):[]};}):[]};}):[]:[]})[_0x30ce('0x1c')](function(_0x16a78a){logger[_0x30ce('0x1d')](_0x30ce('0x1e'),_0x748a02);logger[_0x30ce('0x21')](_0x30ce('0x1e'),_0x748a02,JSON[_0x30ce('0xc')](_0x16a78a));_0x311627(_0x16a78a);})['catch'](function(_0x5df933){logger['error'](_0x30ce('0x1e'),_0x5df933['message'],_0x748a02);_0x10326b(_0x59db67['error'](0x1f4,_0x5df933[_0x30ce('0xf')]));});});}; \ No newline at end of file +var _0xf33b=['include','model','map','then','stringify','ShowSugarcrmAccount','find','where','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit'];(function(_0x20b10b,_0x206891){var _0x314354=function(_0xccc4fc){while(--_0xccc4fc){_0x20b10b['push'](_0x20b10b['shift']());}};_0x314354(++_0x206891);}(_0xf33b,0x1ea));var _0xbf33=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xf33b[_0x4de586];return _0x46baf5;};'use strict';var _=require(_0xbf33('0x0'));var util=require(_0xbf33('0x1'));var moment=require(_0xbf33('0x2'));var BPromise=require(_0xbf33('0x3'));var rs=require(_0xbf33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf33('0x5'))['db'];var utils=require(_0xbf33('0x6'));var logger=require(_0xbf33('0x7'))('rpc');var config=require(_0xbf33('0x8'));var jayson=require(_0xbf33('0x9'));var client=jayson[_0xbf33('0xa')][_0xbf33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d53e,_0xfc09de,_0x320e31){return new BPromise(function(_0xfbac68,_0x39a9fb){return client[_0xbf33('0xc')](_0x30d53e,_0x320e31)['then'](function(_0x3089a1){logger['info'](_0xbf33('0xd'),_0xfc09de,_0xbf33('0xe'));logger[_0xbf33('0xf')](_0xbf33('0x10'),_0xfc09de,_0xbf33('0xe'),JSON['stringify'](_0x3089a1));if(_0x3089a1[_0xbf33('0x11')]){if(_0x3089a1[_0xbf33('0x11')]['code']===0x1f4){logger['error'](_0xbf33('0xd'),_0xfc09de,_0x3089a1[_0xbf33('0x11')]['message']);return _0x39a9fb(_0x3089a1[_0xbf33('0x11')][_0xbf33('0x12')]);}logger[_0xbf33('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0xfc09de,_0x3089a1['error'][_0xbf33('0x12')]);return _0xfbac68(_0x3089a1[_0xbf33('0x11')]['message']);}else{logger[_0xbf33('0x13')](_0xbf33('0xd'),_0xfc09de,_0xbf33('0xe'));_0xfbac68(_0x3089a1[_0xbf33('0x14')]['message']);}})['catch'](function(_0x36b01e){logger[_0xbf33('0x11')](_0xbf33('0xd'),_0xfc09de,_0x36b01e);_0x39a9fb(_0x36b01e);});});}exports[_0xbf33('0x15')]=function(_0x3ea301){var _0x3efcb3=this;return new Promise(function(_0x251172,_0xbce3ee){return db[_0xbf33('0x16')][_0xbf33('0x17')]({'raw':_0x3ea301[_0xbf33('0x18')]?_0x3ea301[_0xbf33('0x18')][_0xbf33('0x19')]===undefined?!![]:![]:!![],'where':_0x3ea301[_0xbf33('0x18')]?_0x3ea301[_0xbf33('0x18')]['where']||null:null,'attributes':_0x3ea301['options']?_0x3ea301[_0xbf33('0x18')][_0xbf33('0x1a')]||null:null,'limit':_0x3ea301[_0xbf33('0x18')]?_0x3ea301[_0xbf33('0x18')][_0xbf33('0x1b')]||null:null,'include':_0x3ea301[_0xbf33('0x18')]?_0x3ea301['options'][_0xbf33('0x1c')]?_['map'](_0x3ea301[_0xbf33('0x18')][_0xbf33('0x1c')],function(_0x10d477){return{'model':db[_0x10d477[_0xbf33('0x1d')]],'as':_0x10d477['as'],'attributes':_0x10d477[_0xbf33('0x1a')],'include':_0x10d477[_0xbf33('0x1c')]?_[_0xbf33('0x1e')](_0x10d477['include'],function(_0x42b3ef){return{'model':db[_0x42b3ef[_0xbf33('0x1d')]],'as':_0x42b3ef['as'],'attributes':_0x42b3ef['attributes'],'include':_0x42b3ef['include']?_[_0xbf33('0x1e')](_0x42b3ef[_0xbf33('0x1c')],function(_0x2802ca){return{'model':db[_0x2802ca[_0xbf33('0x1d')]],'as':_0x2802ca['as'],'attributes':_0x2802ca[_0xbf33('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf33('0x1f')](function(_0x589348){logger['info'](_0xbf33('0x15'),_0x3ea301);logger[_0xbf33('0xf')](_0xbf33('0x15'),_0x3ea301,JSON[_0xbf33('0x20')](_0x589348));_0x251172(_0x589348);})['catch'](function(_0x24ff49){logger[_0xbf33('0x11')]('GetSugarcrmAccount',_0x24ff49['message'],_0x3ea301);_0xbce3ee(_0x3efcb3[_0xbf33('0x11')](0x1f4,_0x24ff49[_0xbf33('0x12')]));});});};exports[_0xbf33('0x21')]=function(_0xee919a){var _0x155b40=this;return new Promise(function(_0x3c0eca,_0x36095a){return db[_0xbf33('0x16')][_0xbf33('0x22')]({'raw':_0xee919a[_0xbf33('0x18')]?_0xee919a['options'][_0xbf33('0x19')]===undefined?!![]:![]:!![],'where':_0xee919a[_0xbf33('0x18')]?_0xee919a[_0xbf33('0x18')][_0xbf33('0x23')]||null:null,'attributes':_0xee919a[_0xbf33('0x18')]?_0xee919a[_0xbf33('0x18')][_0xbf33('0x1a')]||null:null,'include':_0xee919a[_0xbf33('0x18')]?_0xee919a[_0xbf33('0x18')]['include']?_[_0xbf33('0x1e')](_0xee919a[_0xbf33('0x18')][_0xbf33('0x1c')],function(_0x583643){return{'model':db[_0x583643[_0xbf33('0x1d')]],'as':_0x583643['as'],'attributes':_0x583643[_0xbf33('0x1a')],'include':_0x583643[_0xbf33('0x1c')]?_[_0xbf33('0x1e')](_0x583643[_0xbf33('0x1c')],function(_0x18da9d){return{'model':db[_0x18da9d['model']],'as':_0x18da9d['as'],'attributes':_0x18da9d['attributes'],'include':_0x18da9d[_0xbf33('0x1c')]?_[_0xbf33('0x1e')](_0x18da9d[_0xbf33('0x1c')],function(_0x1a0aa8){return{'model':db[_0x1a0aa8[_0xbf33('0x1d')]],'as':_0x1a0aa8['as'],'attributes':_0x1a0aa8[_0xbf33('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf33('0x1f')](function(_0x503b93){logger[_0xbf33('0x13')](_0xbf33('0x21'),_0xee919a);logger['debug']('ShowSugarcrmAccount',_0xee919a,JSON[_0xbf33('0x20')](_0x503b93));_0x3c0eca(_0x503b93);})[_0xbf33('0x24')](function(_0x2c63c1){logger[_0xbf33('0x11')](_0xbf33('0x21'),_0x2c63c1[_0xbf33('0x12')],_0xee919a);_0x36095a(_0x155b40[_0xbf33('0x11')](0x1f4,_0x2c63c1[_0xbf33('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e7cfb79..35ae0cb 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 _0x6eaf=['/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index'];(function(_0x141cdd,_0x2821d2){var _0x1362c1=function(_0x38cc84){while(--_0x38cc84){_0x141cdd['push'](_0x141cdd['shift']());}};_0x1362c1(++_0x2821d2);}(_0x6eaf,0x1d8));var _0xf6ea=function(_0x13eb45,_0x4138d4){_0x13eb45=_0x13eb45-0x0;var _0x546a3b=_0x6eaf[_0x13eb45];return _0x546a3b;};'use strict';var multer=require('multer');var util=require(_0xf6ea('0x0'));var path=require(_0xf6ea('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf6ea('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf6ea('0x3'));var interaction=require(_0xf6ea('0x4'));var config=require('../../config/environment');var controller=require(_0xf6ea('0x5'));router['get']('/',auth[_0xf6ea('0x6')](),controller[_0xf6ea('0x7')]);router['get'](_0xf6ea('0x8'),auth['isAuthenticated'](),controller[_0xf6ea('0x9')]);router[_0xf6ea('0xa')]('/:id/fields',auth[_0xf6ea('0x6')](),controller['getFields']);router[_0xf6ea('0xa')](_0xf6ea('0xb'),auth[_0xf6ea('0x6')](),controller[_0xf6ea('0xc')]);router['get'](_0xf6ea('0xd'),auth[_0xf6ea('0x6')](),controller[_0xf6ea('0xe')]);router[_0xf6ea('0xf')]('/',auth[_0xf6ea('0x6')](),controller['create']);router[_0xf6ea('0x10')](_0xf6ea('0x8'),auth[_0xf6ea('0x6')](),controller[_0xf6ea('0x11')]);router['delete'](_0xf6ea('0x8'),auth[_0xf6ea('0x6')](),controller[_0xf6ea('0x12')]);module[_0xf6ea('0x13')]=router; \ No newline at end of file +var _0xadea=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service'];(function(_0x3926d1,_0x334d28){var _0x359dc3=function(_0x2e66d6){while(--_0x2e66d6){_0x3926d1['push'](_0x3926d1['shift']());}};_0x359dc3(++_0x334d28);}(_0xadea,0x154));var _0xaade=function(_0x111777,_0x43e893){_0x111777=_0x111777-0x0;var _0x18b652=_0xadea[_0x111777];return _0x18b652;};'use strict';var multer=require('multer');var util=require(_0xaade('0x0'));var path=require(_0xaade('0x1'));var timeout=require('connect-timeout');var express=require(_0xaade('0x2'));var router=express['Router']();var fs_extra=require(_0xaade('0x3'));var auth=require(_0xaade('0x4'));var interaction=require(_0xaade('0x5'));var config=require(_0xaade('0x6'));var controller=require(_0xaade('0x7'));router['get']('/',auth[_0xaade('0x8')](),controller['index']);router[_0xaade('0x9')](_0xaade('0xa'),auth[_0xaade('0x8')](),controller['show']);router[_0xaade('0x9')](_0xaade('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xaade('0x9')](_0xaade('0xc'),auth[_0xaade('0x8')](),controller[_0xaade('0xd')]);router[_0xaade('0x9')](_0xaade('0xe'),auth['isAuthenticated'](),controller[_0xaade('0xf')]);router[_0xaade('0x10')]('/',auth[_0xaade('0x8')](),controller[_0xaade('0x11')]);router[_0xaade('0x12')](_0xaade('0xa'),auth[_0xaade('0x8')](),controller[_0xaade('0x13')]);router[_0xaade('0x14')](_0xaade('0xa'),auth['isAuthenticated'](),controller[_0xaade('0x15')]);module[_0xaade('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 3d3c4b4..37ad3de 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 _0xfe66=['exports','STRING','sequelize'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xfe66,0x83));var _0x6fe6=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xfe66[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0x6fe6('0x0'));module[_0x6fe6('0x1')]={'name':{'type':Sequelize[_0x6fe6('0x2')]},'description':{'type':Sequelize[_0x6fe6('0x2')]}}; \ No newline at end of file +var _0x7a07=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a07,0x1bb));var _0x77a0=function(_0x5c6a56,_0x2b5548){_0x5c6a56=_0x5c6a56-0x0;var _0x4710eb=_0x7a07[_0x5c6a56];return _0x4710eb;};'use strict';var Sequelize=require(_0x77a0('0x0'));module[_0x77a0('0x1')]={'name':{'type':Sequelize[_0x77a0('0x2')]},'description':{'type':Sequelize[_0x77a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4e47197..3a9ff19 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 _0xd7f4=['findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','count','status','Content-Range','apply','reject','destroy','end','error','stack','name','SugarcrmConfiguration','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','merge','where','type','then','findAll','show','params','keys','rawAttributes','includeAll','options','catch','create','update','body','find','getFields','SugarcrmField','sort','nolimit','getSubjects'];(function(_0x1ff617,_0x10ebd6){var _0x3e3947=function(_0x352f30){while(--_0x352f30){_0x1ff617['push'](_0x1ff617['shift']());}};_0x3e3947(++_0x10ebd6);}(_0xd7f4,0xa2));var _0x4d7f=function(_0x47589e,_0x45a8e9){_0x47589e=_0x47589e-0x0;var _0x5c110=_0xd7f4[_0x47589e];return _0x5c110;};'use strict';var emlformat=require(_0x4d7f('0x0'));var rimraf=require(_0x4d7f('0x1'));var zipdir=require(_0x4d7f('0x2'));var jsonpatch=require(_0x4d7f('0x3'));var rp=require(_0x4d7f('0x4'));var moment=require('moment');var BPromise=require(_0x4d7f('0x5'));var Mustache=require('mustache');var util=require(_0x4d7f('0x6'));var path=require(_0x4d7f('0x7'));var sox=require(_0x4d7f('0x8'));var csv=require('to-csv');var ejs=require(_0x4d7f('0x9'));var fs=require('fs');var fs_extra=require(_0x4d7f('0xa'));var _=require(_0x4d7f('0xb'));var squel=require('squel');var crypto=require(_0x4d7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d7f('0xd'));var toCsv=require(_0x4d7f('0xe'));var querystring=require('querystring');var Papa=require(_0x4d7f('0xf'));var Redis=require(_0x4d7f('0x10'));var authService=require(_0x4d7f('0x11'));var qs=require(_0x4d7f('0x12'));var as=require(_0x4d7f('0x13'));var hardwareService=require(_0x4d7f('0x14'));var logger=require(_0x4d7f('0x15'))(_0x4d7f('0x16'));var utils=require(_0x4d7f('0x17'));var config=require(_0x4d7f('0x18'));var licenseUtil=require(_0x4d7f('0x19'));var db=require(_0x4d7f('0x1a'))['db'];function respondWithStatusCode(_0x77ee7c,_0x242593){_0x242593=_0x242593||0xcc;return function(_0x4a99d1){if(_0x4a99d1){return _0x77ee7c[_0x4d7f('0x1b')](_0x242593);}return _0x77ee7c['status'](_0x242593)['end']();};}function respondWithResult(_0x4195e5,_0x2aae45){_0x2aae45=_0x2aae45||0xc8;return function(_0x33c269){if(_0x33c269){return _0x4195e5['status'](_0x2aae45)[_0x4d7f('0x1c')](_0x33c269);}};}function respondWithFilteredResult(_0x496b9f,_0x42bd46){return function(_0x1bb4d2){if(_0x1bb4d2){var _0x328035=typeof _0x42bd46['offset']===_0x4d7f('0x1d')&&typeof _0x42bd46[_0x4d7f('0x1e')]===_0x4d7f('0x1d');var _0x49af80=_0x1bb4d2['count'];var _0xff053e=_0x328035?0x0:_0x42bd46[_0x4d7f('0x1f')];var _0xb16a6=_0x328035?_0x1bb4d2[_0x4d7f('0x20')]:_0x42bd46[_0x4d7f('0x1f')]+_0x42bd46['limit'];var _0x4f7dc7;if(_0xb16a6>=_0x49af80){_0xb16a6=_0x49af80;_0x4f7dc7=0xc8;}else{_0x4f7dc7=0xce;}_0x496b9f[_0x4d7f('0x21')](_0x4f7dc7);return _0x496b9f['set'](_0x4d7f('0x22'),_0xff053e+'-'+_0xb16a6+'/'+_0x49af80)['json'](_0x1bb4d2);}return null;};}function patchUpdates(_0x1d74b){return function(_0x243669){try{jsonpatch[_0x4d7f('0x23')](_0x243669,_0x1d74b,!![]);}catch(_0x513a22){return BPromise[_0x4d7f('0x24')](_0x513a22);}return _0x243669['save']();};}function saveUpdates(_0x5c73f7,_0x389084){return function(_0x4340b8){if(_0x4340b8){return _0x4340b8['update'](_0x5c73f7)['then'](function(_0x175e02){return _0x175e02;});}return null;};}function removeEntity(_0x2b55e7,_0x3c7908){return function(_0x3892b9){if(_0x3892b9){return _0x3892b9[_0x4d7f('0x25')]()['then'](function(){_0x2b55e7['status'](0xcc)[_0x4d7f('0x26')]();});}};}function handleEntityNotFound(_0x2244c7,_0x5d99b2){return function(_0x29fb55){if(!_0x29fb55){_0x2244c7[_0x4d7f('0x1b')](0x194);}return _0x29fb55;};}function handleError(_0x3c309f,_0x30a6f8){_0x30a6f8=_0x30a6f8||0x1f4;return function(_0xc4f50f){logger[_0x4d7f('0x27')](_0xc4f50f[_0x4d7f('0x28')]);if(_0xc4f50f[_0x4d7f('0x29')]){delete _0xc4f50f[_0x4d7f('0x29')];}_0x3c309f[_0x4d7f('0x21')](_0x30a6f8)['send'](_0xc4f50f);};}exports['index']=function(_0x546304,_0x2f5141){var _0x586d77={},_0x7eeb55={},_0x1970e0={'count':0x0,'rows':[]};var _0x581e6f=_['map'](db[_0x4d7f('0x2a')]['rawAttributes'],function(_0x3e4baf){return{'name':_0x3e4baf[_0x4d7f('0x2b')],'type':_0x3e4baf['type'][_0x4d7f('0x2c')]};});_0x7eeb55[_0x4d7f('0x2d')]=_[_0x4d7f('0x2e')](_0x581e6f,'name');_0x7eeb55[_0x4d7f('0x2f')]=_['keys'](_0x546304[_0x4d7f('0x2f')]);_0x7eeb55[_0x4d7f('0x30')]=_[_0x4d7f('0x31')](_0x7eeb55[_0x4d7f('0x2d')],_0x7eeb55[_0x4d7f('0x2f')]);_0x586d77[_0x4d7f('0x32')]=_['intersection'](_0x7eeb55[_0x4d7f('0x2d')],qs[_0x4d7f('0x33')](_0x546304['query'][_0x4d7f('0x33')]));_0x586d77[_0x4d7f('0x32')]=_0x586d77[_0x4d7f('0x32')][_0x4d7f('0x34')]?_0x586d77[_0x4d7f('0x32')]:_0x7eeb55[_0x4d7f('0x2d')];if(!_0x546304[_0x4d7f('0x2f')][_0x4d7f('0x35')]('nolimit')){_0x586d77[_0x4d7f('0x1e')]=qs[_0x4d7f('0x1e')](_0x546304[_0x4d7f('0x2f')][_0x4d7f('0x1e')]);_0x586d77[_0x4d7f('0x1f')]=qs[_0x4d7f('0x1f')](_0x546304[_0x4d7f('0x2f')]['offset']);}_0x586d77[_0x4d7f('0x36')]=qs['sort'](_0x546304[_0x4d7f('0x2f')]['sort']);_0x586d77['where']=qs[_0x4d7f('0x30')](_[_0x4d7f('0x37')](_0x546304[_0x4d7f('0x2f')],_0x7eeb55[_0x4d7f('0x30')]),_0x581e6f);if(_0x546304[_0x4d7f('0x2f')][_0x4d7f('0x38')]){_0x586d77['where']=_[_0x4d7f('0x39')](_0x586d77[_0x4d7f('0x3a')],{'$or':_['map'](_0x581e6f,function(_0x2798d5){if(_0x2798d5[_0x4d7f('0x3b')]!=='VIRTUAL'){var _0x566726={};_0x566726[_0x2798d5[_0x4d7f('0x29')]]={'$like':'%'+_0x546304[_0x4d7f('0x2f')][_0x4d7f('0x38')]+'%'};return _0x566726;}})});}_0x586d77=_[_0x4d7f('0x39')]({},_0x586d77,_0x546304['options']);var _0x4b914a={'where':_0x586d77[_0x4d7f('0x3a')]};return db['SugarcrmConfiguration'][_0x4d7f('0x20')](_0x4b914a)[_0x4d7f('0x3c')](function(_0x1cf18c){_0x1970e0[_0x4d7f('0x20')]=_0x1cf18c;if(_0x546304[_0x4d7f('0x2f')]['includeAll']){_0x586d77['include']=[{'all':!![]}];}return db[_0x4d7f('0x2a')][_0x4d7f('0x3d')](_0x586d77);})[_0x4d7f('0x3c')](function(_0x595d40){_0x1970e0['rows']=_0x595d40;return _0x1970e0;})['then'](respondWithFilteredResult(_0x2f5141,_0x586d77))['catch'](handleError(_0x2f5141,null));};exports[_0x4d7f('0x3e')]=function(_0x18a855,_0x4d130e){var _0x207ac7={'raw':![],'where':{'id':_0x18a855[_0x4d7f('0x3f')]['id']}},_0x1246e9={};_0x1246e9['model']=_[_0x4d7f('0x40')](db['SugarcrmConfiguration'][_0x4d7f('0x41')]);_0x1246e9[_0x4d7f('0x2f')]=_[_0x4d7f('0x40')](_0x18a855['query']);_0x1246e9[_0x4d7f('0x30')]=_[_0x4d7f('0x31')](_0x1246e9[_0x4d7f('0x2d')],_0x1246e9[_0x4d7f('0x2f')]);_0x207ac7[_0x4d7f('0x32')]=_[_0x4d7f('0x31')](_0x1246e9[_0x4d7f('0x2d')],qs[_0x4d7f('0x33')](_0x18a855[_0x4d7f('0x2f')][_0x4d7f('0x33')]));_0x207ac7[_0x4d7f('0x32')]=_0x207ac7[_0x4d7f('0x32')]['length']?_0x207ac7['attributes']:_0x1246e9[_0x4d7f('0x2d')];if(_0x18a855[_0x4d7f('0x2f')][_0x4d7f('0x42')]){_0x207ac7['include']=[{'all':!![]}];}_0x207ac7=_[_0x4d7f('0x39')]({},_0x207ac7,_0x18a855[_0x4d7f('0x43')]);return db['SugarcrmConfiguration']['find'](_0x207ac7)[_0x4d7f('0x3c')](handleEntityNotFound(_0x4d130e,null))[_0x4d7f('0x3c')](respondWithResult(_0x4d130e,null))[_0x4d7f('0x44')](handleError(_0x4d130e,null));};exports[_0x4d7f('0x45')]=function(_0x273c8b,_0x4b3925){return db[_0x4d7f('0x2a')]['create'](_0x273c8b['body'],{})[_0x4d7f('0x3c')](respondWithResult(_0x4b3925,0xc9))[_0x4d7f('0x44')](handleError(_0x4b3925,null));};exports[_0x4d7f('0x46')]=function(_0x37edc0,_0x436bef){if(_0x37edc0[_0x4d7f('0x47')]['id']){delete _0x37edc0['body']['id'];}return db[_0x4d7f('0x2a')][_0x4d7f('0x48')]({'where':{'id':_0x37edc0['params']['id']}})[_0x4d7f('0x3c')](handleEntityNotFound(_0x436bef,null))[_0x4d7f('0x3c')](saveUpdates(_0x37edc0[_0x4d7f('0x47')],null))[_0x4d7f('0x3c')](respondWithResult(_0x436bef,null))[_0x4d7f('0x44')](handleError(_0x436bef,null));};exports[_0x4d7f('0x25')]=function(_0x5f0945,_0x1147dd){return db['SugarcrmConfiguration'][_0x4d7f('0x48')]({'where':{'id':_0x5f0945['params']['id']}})[_0x4d7f('0x3c')](handleEntityNotFound(_0x1147dd,null))[_0x4d7f('0x3c')](removeEntity(_0x1147dd,null))['catch'](handleError(_0x1147dd,null));};exports[_0x4d7f('0x49')]=function(_0x3c293f,_0x830533,_0x55015e){var _0x2ecea4={};var _0x329554={};var _0x5d357e;var _0x856491;return db[_0x4d7f('0x2a')]['findOne']({'where':{'id':_0x3c293f[_0x4d7f('0x3f')]['id']}})[_0x4d7f('0x3c')](handleEntityNotFound(_0x830533,null))[_0x4d7f('0x3c')](function(_0x57cb90){if(_0x57cb90){_0x5d357e=_0x57cb90;_0x329554[_0x4d7f('0x2d')]=_[_0x4d7f('0x40')](db[_0x4d7f('0x4a')][_0x4d7f('0x41')]);_0x329554[_0x4d7f('0x2f')]=_[_0x4d7f('0x40')](_0x3c293f['query']);_0x329554[_0x4d7f('0x30')]=_[_0x4d7f('0x31')](_0x329554[_0x4d7f('0x2d')],_0x329554[_0x4d7f('0x2f')]);_0x2ecea4[_0x4d7f('0x32')]=_[_0x4d7f('0x31')](_0x329554[_0x4d7f('0x2d')],qs[_0x4d7f('0x33')](_0x3c293f[_0x4d7f('0x2f')][_0x4d7f('0x33')]));_0x2ecea4[_0x4d7f('0x32')]=_0x2ecea4[_0x4d7f('0x32')]['length']?_0x2ecea4[_0x4d7f('0x32')]:_0x329554[_0x4d7f('0x2d')];_0x2ecea4[_0x4d7f('0x36')]=qs[_0x4d7f('0x4b')](_0x3c293f[_0x4d7f('0x2f')][_0x4d7f('0x4b')]);_0x2ecea4['where']=qs['filters'](_['pick'](_0x3c293f[_0x4d7f('0x2f')],_0x329554[_0x4d7f('0x30')]));if(_0x3c293f['query'][_0x4d7f('0x38')]){_0x2ecea4[_0x4d7f('0x3a')]=_[_0x4d7f('0x39')](_0x2ecea4[_0x4d7f('0x3a')],{'$or':_[_0x4d7f('0x2e')](_0x2ecea4[_0x4d7f('0x32')],function(_0x4f1d68){var _0x5c825b={};_0x5c825b[_0x4f1d68]={'$like':'%'+_0x3c293f[_0x4d7f('0x2f')][_0x4d7f('0x38')]+'%'};return _0x5c825b;})});}_0x2ecea4=_['merge']({},_0x2ecea4,_0x3c293f[_0x4d7f('0x43')]);return _0x5d357e[_0x4d7f('0x49')](_0x2ecea4);}})[_0x4d7f('0x3c')](function(_0x5ad445){if(_0x5ad445){_0x856491=_0x5ad445['length'];if(!_0x3c293f[_0x4d7f('0x2f')][_0x4d7f('0x35')](_0x4d7f('0x4c'))){_0x2ecea4[_0x4d7f('0x1e')]=qs[_0x4d7f('0x1e')](_0x3c293f[_0x4d7f('0x2f')][_0x4d7f('0x1e')]);_0x2ecea4[_0x4d7f('0x1f')]=qs[_0x4d7f('0x1f')](_0x3c293f['query'][_0x4d7f('0x1f')]);}return _0x5d357e[_0x4d7f('0x49')](_0x2ecea4);}})['then'](function(_0x858696){if(_0x858696){return _0x858696?{'count':_0x856491,'rows':_0x858696}:null;}})['then'](respondWithResult(_0x830533,null))[_0x4d7f('0x44')](handleError(_0x830533,null));};exports[_0x4d7f('0x4d')]=function(_0x436a47,_0x333f14,_0x6d88ef){var _0x2d3355={};var _0x52f21a={};var _0x485268;var _0x4a7fd4;return db[_0x4d7f('0x2a')][_0x4d7f('0x4e')]({'where':{'id':_0x436a47[_0x4d7f('0x3f')]['id']}})[_0x4d7f('0x3c')](handleEntityNotFound(_0x333f14,null))[_0x4d7f('0x3c')](function(_0x14f594){if(_0x14f594){_0x485268=_0x14f594;_0x52f21a[_0x4d7f('0x2d')]=_[_0x4d7f('0x40')](db['SugarcrmField'][_0x4d7f('0x41')]);_0x52f21a[_0x4d7f('0x2f')]=_[_0x4d7f('0x40')](_0x436a47[_0x4d7f('0x2f')]);_0x52f21a[_0x4d7f('0x30')]=_[_0x4d7f('0x31')](_0x52f21a[_0x4d7f('0x2d')],_0x52f21a[_0x4d7f('0x2f')]);_0x2d3355[_0x4d7f('0x32')]=_[_0x4d7f('0x31')](_0x52f21a['model'],qs[_0x4d7f('0x33')](_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x33')]));_0x2d3355[_0x4d7f('0x32')]=_0x2d3355['attributes'][_0x4d7f('0x34')]?_0x2d3355[_0x4d7f('0x32')]:_0x52f21a[_0x4d7f('0x2d')];_0x2d3355[_0x4d7f('0x36')]=qs['sort'](_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x4b')]);_0x2d3355[_0x4d7f('0x3a')]=qs[_0x4d7f('0x30')](_['pick'](_0x436a47[_0x4d7f('0x2f')],_0x52f21a[_0x4d7f('0x30')]));if(_0x436a47[_0x4d7f('0x2f')]['filter']){_0x2d3355['where']=_['merge'](_0x2d3355[_0x4d7f('0x3a')],{'$or':_[_0x4d7f('0x2e')](_0x2d3355['attributes'],function(_0x5ca573){var _0x367a22={};_0x367a22[_0x5ca573]={'$like':'%'+_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x38')]+'%'};return _0x367a22;})});}_0x2d3355=_[_0x4d7f('0x39')]({},_0x2d3355,_0x436a47[_0x4d7f('0x43')]);return _0x485268[_0x4d7f('0x4d')](_0x2d3355);}})[_0x4d7f('0x3c')](function(_0x5283e9){if(_0x5283e9){_0x4a7fd4=_0x5283e9[_0x4d7f('0x34')];if(!_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x35')](_0x4d7f('0x4c'))){_0x2d3355[_0x4d7f('0x1e')]=qs[_0x4d7f('0x1e')](_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x1e')]);_0x2d3355[_0x4d7f('0x1f')]=qs[_0x4d7f('0x1f')](_0x436a47[_0x4d7f('0x2f')][_0x4d7f('0x1f')]);}return _0x485268[_0x4d7f('0x4d')](_0x2d3355);}})[_0x4d7f('0x3c')](function(_0x4604d6){if(_0x4604d6){return _0x4604d6?{'count':_0x4a7fd4,'rows':_0x4604d6}:null;}})[_0x4d7f('0x3c')](respondWithResult(_0x333f14,null))[_0x4d7f('0x44')](handleError(_0x333f14,null));};exports[_0x4d7f('0x4f')]=function(_0x2a1064,_0x3fa5cd,_0x193f85){var _0x395716={};var _0x1cf7d3={};var _0x37ff3b;var _0x37afa9;return db[_0x4d7f('0x2a')][_0x4d7f('0x4e')]({'where':{'id':_0x2a1064[_0x4d7f('0x3f')]['id']}})[_0x4d7f('0x3c')](handleEntityNotFound(_0x3fa5cd,null))['then'](function(_0x5bfba2){if(_0x5bfba2){_0x37ff3b=_0x5bfba2;_0x1cf7d3[_0x4d7f('0x2d')]=_[_0x4d7f('0x40')](db['SugarcrmField'][_0x4d7f('0x41')]);_0x1cf7d3['query']=_[_0x4d7f('0x40')](_0x2a1064[_0x4d7f('0x2f')]);_0x1cf7d3[_0x4d7f('0x30')]=_[_0x4d7f('0x31')](_0x1cf7d3[_0x4d7f('0x2d')],_0x1cf7d3[_0x4d7f('0x2f')]);_0x395716[_0x4d7f('0x32')]=_['intersection'](_0x1cf7d3[_0x4d7f('0x2d')],qs[_0x4d7f('0x33')](_0x2a1064[_0x4d7f('0x2f')][_0x4d7f('0x33')]));_0x395716[_0x4d7f('0x32')]=_0x395716['attributes'][_0x4d7f('0x34')]?_0x395716[_0x4d7f('0x32')]:_0x1cf7d3[_0x4d7f('0x2d')];_0x395716[_0x4d7f('0x36')]=qs[_0x4d7f('0x4b')](_0x2a1064['query'][_0x4d7f('0x4b')]);_0x395716[_0x4d7f('0x3a')]=qs[_0x4d7f('0x30')](_[_0x4d7f('0x37')](_0x2a1064[_0x4d7f('0x2f')],_0x1cf7d3[_0x4d7f('0x30')]));if(_0x2a1064[_0x4d7f('0x2f')][_0x4d7f('0x38')]){_0x395716[_0x4d7f('0x3a')]=_['merge'](_0x395716[_0x4d7f('0x3a')],{'$or':_[_0x4d7f('0x2e')](_0x395716[_0x4d7f('0x32')],function(_0x218a8c){var _0xf597e3={};_0xf597e3[_0x218a8c]={'$like':'%'+_0x2a1064[_0x4d7f('0x2f')][_0x4d7f('0x38')]+'%'};return _0xf597e3;})});}_0x395716=_['merge']({},_0x395716,_0x2a1064[_0x4d7f('0x43')]);return _0x37ff3b['getDescriptions'](_0x395716);}})[_0x4d7f('0x3c')](function(_0x18d142){if(_0x18d142){_0x37afa9=_0x18d142[_0x4d7f('0x34')];if(!_0x2a1064[_0x4d7f('0x2f')][_0x4d7f('0x35')](_0x4d7f('0x4c'))){_0x395716[_0x4d7f('0x1e')]=qs[_0x4d7f('0x1e')](_0x2a1064['query'][_0x4d7f('0x1e')]);_0x395716[_0x4d7f('0x1f')]=qs[_0x4d7f('0x1f')](_0x2a1064[_0x4d7f('0x2f')][_0x4d7f('0x1f')]);}return _0x37ff3b['getDescriptions'](_0x395716);}})[_0x4d7f('0x3c')](function(_0x5783da){if(_0x5783da){return _0x5783da?{'count':_0x37afa9,'rows':_0x5783da}:null;}})[_0x4d7f('0x3c')](respondWithResult(_0x3fa5cd,null))[_0x4d7f('0x44')](handleError(_0x3fa5cd,null));}; \ No newline at end of file +var _0x3558=['status','json','offset','undefined','count','limit','apply','reject','save','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','keys','include','find','catch','create','body','update','params','findOne','sort','getFields','hasOwnProperty','getSubjects','getDescriptions','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x3558,0x7f));var _0x8355=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3558[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x8355('0x0'));var rimraf=require(_0x8355('0x1'));var zipdir=require(_0x8355('0x2'));var jsonpatch=require(_0x8355('0x3'));var rp=require(_0x8355('0x4'));var moment=require('moment');var BPromise=require(_0x8355('0x5'));var Mustache=require(_0x8355('0x6'));var util=require('util');var path=require(_0x8355('0x7'));var sox=require(_0x8355('0x8'));var csv=require(_0x8355('0x9'));var ejs=require(_0x8355('0xa'));var fs=require('fs');var fs_extra=require(_0x8355('0xb'));var _=require(_0x8355('0xc'));var squel=require(_0x8355('0xd'));var crypto=require(_0x8355('0xe'));var jsforce=require(_0x8355('0xf'));var deskjs=require(_0x8355('0x10'));var toCsv=require(_0x8355('0x9'));var querystring=require('querystring');var Papa=require(_0x8355('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8355('0x12'));var as=require(_0x8355('0x13'));var hardwareService=require(_0x8355('0x14'));var logger=require(_0x8355('0x15'))('api');var utils=require(_0x8355('0x16'));var config=require(_0x8355('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8355('0x18'))['db'];function respondWithStatusCode(_0x37cc1f,_0x7f6a3c){_0x7f6a3c=_0x7f6a3c||0xcc;return function(_0xa8d2e8){if(_0xa8d2e8){return _0x37cc1f[_0x8355('0x19')](_0x7f6a3c);}return _0x37cc1f['status'](_0x7f6a3c)[_0x8355('0x1a')]();};}function respondWithResult(_0x243b93,_0x159f2d){_0x159f2d=_0x159f2d||0xc8;return function(_0x2612e2){if(_0x2612e2){return _0x243b93[_0x8355('0x1b')](_0x159f2d)[_0x8355('0x1c')](_0x2612e2);}};}function respondWithFilteredResult(_0x11b529,_0x534e35){return function(_0x4cdb51){if(_0x4cdb51){var _0x24d127=typeof _0x534e35[_0x8355('0x1d')]===_0x8355('0x1e')&&typeof _0x534e35['limit']==='undefined';var _0xc361bc=_0x4cdb51[_0x8355('0x1f')];var _0x4a14f5=_0x24d127?0x0:_0x534e35[_0x8355('0x1d')];var _0x3ec55a=_0x24d127?_0x4cdb51[_0x8355('0x1f')]:_0x534e35[_0x8355('0x1d')]+_0x534e35[_0x8355('0x20')];var _0x507579;if(_0x3ec55a>=_0xc361bc){_0x3ec55a=_0xc361bc;_0x507579=0xc8;}else{_0x507579=0xce;}_0x11b529[_0x8355('0x1b')](_0x507579);return _0x11b529['set']('Content-Range',_0x4a14f5+'-'+_0x3ec55a+'/'+_0xc361bc)['json'](_0x4cdb51);}return null;};}function patchUpdates(_0x4f43a7){return function(_0x55c604){try{jsonpatch[_0x8355('0x21')](_0x55c604,_0x4f43a7,!![]);}catch(_0x43d92d){return BPromise[_0x8355('0x22')](_0x43d92d);}return _0x55c604[_0x8355('0x23')]();};}function saveUpdates(_0x3dfcd7,_0xfdb3f8){return function(_0x3d6cfa){if(_0x3d6cfa){return _0x3d6cfa['update'](_0x3dfcd7)['then'](function(_0x12c443){return _0x12c443;});}return null;};}function removeEntity(_0x4cf00e,_0x2f56a2){return function(_0x1b2a1b){if(_0x1b2a1b){return _0x1b2a1b['destroy']()[_0x8355('0x24')](function(){_0x4cf00e[_0x8355('0x1b')](0xcc)[_0x8355('0x1a')]();});}};}function handleEntityNotFound(_0x5168ab,_0x46acb2){return function(_0x493d1a){if(!_0x493d1a){_0x5168ab[_0x8355('0x19')](0x194);}return _0x493d1a;};}function handleError(_0x3e0294,_0x45ab5b){_0x45ab5b=_0x45ab5b||0x1f4;return function(_0x24cc5d){logger[_0x8355('0x25')](_0x24cc5d[_0x8355('0x26')]);if(_0x24cc5d[_0x8355('0x27')]){delete _0x24cc5d[_0x8355('0x27')];}_0x3e0294[_0x8355('0x1b')](_0x45ab5b)[_0x8355('0x28')](_0x24cc5d);};}exports[_0x8355('0x29')]=function(_0x11d29e,_0x1666d3){var _0x373b1a={},_0x288024={},_0x712bec={'count':0x0,'rows':[]};var _0xe74c09=_[_0x8355('0x2a')](db[_0x8355('0x2b')][_0x8355('0x2c')],function(_0x591cfc){return{'name':_0x591cfc[_0x8355('0x2d')],'type':_0x591cfc[_0x8355('0x2e')]['key']};});_0x288024[_0x8355('0x2f')]=_[_0x8355('0x2a')](_0xe74c09,_0x8355('0x27'));_0x288024[_0x8355('0x30')]=_['keys'](_0x11d29e[_0x8355('0x30')]);_0x288024[_0x8355('0x31')]=_[_0x8355('0x32')](_0x288024[_0x8355('0x2f')],_0x288024[_0x8355('0x30')]);_0x373b1a['attributes']=_['intersection'](_0x288024[_0x8355('0x2f')],qs[_0x8355('0x33')](_0x11d29e['query'][_0x8355('0x33')]));_0x373b1a[_0x8355('0x34')]=_0x373b1a['attributes'][_0x8355('0x35')]?_0x373b1a[_0x8355('0x34')]:_0x288024[_0x8355('0x2f')];if(!_0x11d29e[_0x8355('0x30')]['hasOwnProperty']('nolimit')){_0x373b1a['limit']=qs[_0x8355('0x20')](_0x11d29e[_0x8355('0x30')][_0x8355('0x20')]);_0x373b1a[_0x8355('0x1d')]=qs[_0x8355('0x1d')](_0x11d29e['query'][_0x8355('0x1d')]);}_0x373b1a[_0x8355('0x36')]=qs['sort'](_0x11d29e['query']['sort']);_0x373b1a[_0x8355('0x37')]=qs['filters'](_[_0x8355('0x38')](_0x11d29e['query'],_0x288024[_0x8355('0x31')]),_0xe74c09);if(_0x11d29e[_0x8355('0x30')]['filter']){_0x373b1a[_0x8355('0x37')]=_[_0x8355('0x39')](_0x373b1a['where'],{'$or':_[_0x8355('0x2a')](_0xe74c09,function(_0x38130c){if(_0x38130c[_0x8355('0x2e')]!==_0x8355('0x3a')){var _0x34ee06={};_0x34ee06[_0x38130c['name']]={'$like':'%'+_0x11d29e[_0x8355('0x30')][_0x8355('0x3b')]+'%'};return _0x34ee06;}})});}_0x373b1a=_[_0x8355('0x39')]({},_0x373b1a,_0x11d29e[_0x8355('0x3c')]);var _0x3f0102={'where':_0x373b1a[_0x8355('0x37')]};return db[_0x8355('0x2b')][_0x8355('0x1f')](_0x3f0102)[_0x8355('0x24')](function(_0x3ca40c){_0x712bec['count']=_0x3ca40c;if(_0x11d29e['query'][_0x8355('0x3d')]){_0x373b1a['include']=[{'all':!![]}];}return db[_0x8355('0x2b')]['findAll'](_0x373b1a);})[_0x8355('0x24')](function(_0x49622b){_0x712bec[_0x8355('0x3e')]=_0x49622b;return _0x712bec;})[_0x8355('0x24')](respondWithFilteredResult(_0x1666d3,_0x373b1a))['catch'](handleError(_0x1666d3,null));};exports['show']=function(_0xa72b83,_0x1e1f1d){var _0x289f1e={'raw':![],'where':{'id':_0xa72b83['params']['id']}},_0x14a0da={};_0x14a0da['model']=_[_0x8355('0x3f')](db[_0x8355('0x2b')][_0x8355('0x2c')]);_0x14a0da[_0x8355('0x30')]=_[_0x8355('0x3f')](_0xa72b83[_0x8355('0x30')]);_0x14a0da['filters']=_[_0x8355('0x32')](_0x14a0da[_0x8355('0x2f')],_0x14a0da[_0x8355('0x30')]);_0x289f1e[_0x8355('0x34')]=_[_0x8355('0x32')](_0x14a0da[_0x8355('0x2f')],qs[_0x8355('0x33')](_0xa72b83[_0x8355('0x30')][_0x8355('0x33')]));_0x289f1e[_0x8355('0x34')]=_0x289f1e[_0x8355('0x34')][_0x8355('0x35')]?_0x289f1e[_0x8355('0x34')]:_0x14a0da[_0x8355('0x2f')];if(_0xa72b83[_0x8355('0x30')][_0x8355('0x3d')]){_0x289f1e[_0x8355('0x40')]=[{'all':!![]}];}_0x289f1e=_[_0x8355('0x39')]({},_0x289f1e,_0xa72b83[_0x8355('0x3c')]);return db['SugarcrmConfiguration'][_0x8355('0x41')](_0x289f1e)[_0x8355('0x24')](handleEntityNotFound(_0x1e1f1d,null))[_0x8355('0x24')](respondWithResult(_0x1e1f1d,null))[_0x8355('0x42')](handleError(_0x1e1f1d,null));};exports['create']=function(_0x15bce5,_0x45f0f6){return db[_0x8355('0x2b')][_0x8355('0x43')](_0x15bce5[_0x8355('0x44')],{})[_0x8355('0x24')](respondWithResult(_0x45f0f6,0xc9))[_0x8355('0x42')](handleError(_0x45f0f6,null));};exports[_0x8355('0x45')]=function(_0x3277ce,_0x4fff00){if(_0x3277ce[_0x8355('0x44')]['id']){delete _0x3277ce[_0x8355('0x44')]['id'];}return db[_0x8355('0x2b')][_0x8355('0x41')]({'where':{'id':_0x3277ce[_0x8355('0x46')]['id']}})[_0x8355('0x24')](handleEntityNotFound(_0x4fff00,null))[_0x8355('0x24')](saveUpdates(_0x3277ce[_0x8355('0x44')],null))[_0x8355('0x24')](respondWithResult(_0x4fff00,null))[_0x8355('0x42')](handleError(_0x4fff00,null));};exports['destroy']=function(_0x4bd12f,_0x2e163d){return db[_0x8355('0x2b')]['find']({'where':{'id':_0x4bd12f[_0x8355('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e163d,null))['then'](removeEntity(_0x2e163d,null))[_0x8355('0x42')](handleError(_0x2e163d,null));};exports['getFields']=function(_0x1cf055,_0x5d1569,_0x57ce49){var _0x3ada86={};var _0x26a11f={};var _0x4194f8;var _0xb74210;return db[_0x8355('0x2b')][_0x8355('0x47')]({'where':{'id':_0x1cf055['params']['id']}})['then'](handleEntityNotFound(_0x5d1569,null))[_0x8355('0x24')](function(_0x526f27){if(_0x526f27){_0x4194f8=_0x526f27;_0x26a11f['model']=_[_0x8355('0x3f')](db['SugarcrmField'][_0x8355('0x2c')]);_0x26a11f['query']=_[_0x8355('0x3f')](_0x1cf055['query']);_0x26a11f[_0x8355('0x31')]=_['intersection'](_0x26a11f[_0x8355('0x2f')],_0x26a11f['query']);_0x3ada86['attributes']=_[_0x8355('0x32')](_0x26a11f[_0x8355('0x2f')],qs[_0x8355('0x33')](_0x1cf055['query'][_0x8355('0x33')]));_0x3ada86[_0x8355('0x34')]=_0x3ada86['attributes'][_0x8355('0x35')]?_0x3ada86['attributes']:_0x26a11f[_0x8355('0x2f')];_0x3ada86[_0x8355('0x36')]=qs[_0x8355('0x48')](_0x1cf055[_0x8355('0x30')]['sort']);_0x3ada86[_0x8355('0x37')]=qs[_0x8355('0x31')](_[_0x8355('0x38')](_0x1cf055[_0x8355('0x30')],_0x26a11f[_0x8355('0x31')]));if(_0x1cf055[_0x8355('0x30')][_0x8355('0x3b')]){_0x3ada86[_0x8355('0x37')]=_[_0x8355('0x39')](_0x3ada86[_0x8355('0x37')],{'$or':_['map'](_0x3ada86[_0x8355('0x34')],function(_0x583fbf){var _0x3ea859={};_0x3ea859[_0x583fbf]={'$like':'%'+_0x1cf055['query'][_0x8355('0x3b')]+'%'};return _0x3ea859;})});}_0x3ada86=_['merge']({},_0x3ada86,_0x1cf055[_0x8355('0x3c')]);return _0x4194f8[_0x8355('0x49')](_0x3ada86);}})['then'](function(_0x139fbf){if(_0x139fbf){_0xb74210=_0x139fbf[_0x8355('0x35')];if(!_0x1cf055[_0x8355('0x30')][_0x8355('0x4a')]('nolimit')){_0x3ada86[_0x8355('0x20')]=qs[_0x8355('0x20')](_0x1cf055[_0x8355('0x30')][_0x8355('0x20')]);_0x3ada86['offset']=qs['offset'](_0x1cf055[_0x8355('0x30')]['offset']);}return _0x4194f8[_0x8355('0x49')](_0x3ada86);}})['then'](function(_0x24b75b){if(_0x24b75b){return _0x24b75b?{'count':_0xb74210,'rows':_0x24b75b}:null;}})[_0x8355('0x24')](respondWithResult(_0x5d1569,null))['catch'](handleError(_0x5d1569,null));};exports[_0x8355('0x4b')]=function(_0x3870e9,_0x1d7a38,_0x4ebf3d){var _0x1f0e14={};var _0x2f57fd={};var _0x56ce41;var _0x2f76b2;return db[_0x8355('0x2b')][_0x8355('0x47')]({'where':{'id':_0x3870e9[_0x8355('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d7a38,null))[_0x8355('0x24')](function(_0x5a52b8){if(_0x5a52b8){_0x56ce41=_0x5a52b8;_0x2f57fd[_0x8355('0x2f')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x2f57fd[_0x8355('0x30')]=_[_0x8355('0x3f')](_0x3870e9['query']);_0x2f57fd[_0x8355('0x31')]=_[_0x8355('0x32')](_0x2f57fd[_0x8355('0x2f')],_0x2f57fd[_0x8355('0x30')]);_0x1f0e14[_0x8355('0x34')]=_['intersection'](_0x2f57fd[_0x8355('0x2f')],qs[_0x8355('0x33')](_0x3870e9[_0x8355('0x30')][_0x8355('0x33')]));_0x1f0e14[_0x8355('0x34')]=_0x1f0e14['attributes'][_0x8355('0x35')]?_0x1f0e14[_0x8355('0x34')]:_0x2f57fd[_0x8355('0x2f')];_0x1f0e14[_0x8355('0x36')]=qs[_0x8355('0x48')](_0x3870e9['query']['sort']);_0x1f0e14[_0x8355('0x37')]=qs[_0x8355('0x31')](_[_0x8355('0x38')](_0x3870e9['query'],_0x2f57fd[_0x8355('0x31')]));if(_0x3870e9[_0x8355('0x30')][_0x8355('0x3b')]){_0x1f0e14[_0x8355('0x37')]=_['merge'](_0x1f0e14[_0x8355('0x37')],{'$or':_[_0x8355('0x2a')](_0x1f0e14[_0x8355('0x34')],function(_0xcf4d9f){var _0x15d266={};_0x15d266[_0xcf4d9f]={'$like':'%'+_0x3870e9[_0x8355('0x30')]['filter']+'%'};return _0x15d266;})});}_0x1f0e14=_[_0x8355('0x39')]({},_0x1f0e14,_0x3870e9[_0x8355('0x3c')]);return _0x56ce41[_0x8355('0x4b')](_0x1f0e14);}})[_0x8355('0x24')](function(_0x42e8a8){if(_0x42e8a8){_0x2f76b2=_0x42e8a8[_0x8355('0x35')];if(!_0x3870e9['query'][_0x8355('0x4a')]('nolimit')){_0x1f0e14[_0x8355('0x20')]=qs[_0x8355('0x20')](_0x3870e9['query'][_0x8355('0x20')]);_0x1f0e14[_0x8355('0x1d')]=qs[_0x8355('0x1d')](_0x3870e9[_0x8355('0x30')][_0x8355('0x1d')]);}return _0x56ce41[_0x8355('0x4b')](_0x1f0e14);}})[_0x8355('0x24')](function(_0x55ef95){if(_0x55ef95){return _0x55ef95?{'count':_0x2f76b2,'rows':_0x55ef95}:null;}})['then'](respondWithResult(_0x1d7a38,null))[_0x8355('0x42')](handleError(_0x1d7a38,null));};exports[_0x8355('0x4c')]=function(_0x2bfc3d,_0x2bb747,_0xa385e9){var _0x1023a1={};var _0x59a515={};var _0x544fc;var _0x9a9f7c;return db[_0x8355('0x2b')][_0x8355('0x47')]({'where':{'id':_0x2bfc3d[_0x8355('0x46')]['id']}})[_0x8355('0x24')](handleEntityNotFound(_0x2bb747,null))['then'](function(_0x3ae385){if(_0x3ae385){_0x544fc=_0x3ae385;_0x59a515[_0x8355('0x2f')]=_[_0x8355('0x3f')](db['SugarcrmField']['rawAttributes']);_0x59a515[_0x8355('0x30')]=_[_0x8355('0x3f')](_0x2bfc3d[_0x8355('0x30')]);_0x59a515[_0x8355('0x31')]=_['intersection'](_0x59a515['model'],_0x59a515[_0x8355('0x30')]);_0x1023a1[_0x8355('0x34')]=_['intersection'](_0x59a515[_0x8355('0x2f')],qs['fields'](_0x2bfc3d[_0x8355('0x30')][_0x8355('0x33')]));_0x1023a1[_0x8355('0x34')]=_0x1023a1[_0x8355('0x34')][_0x8355('0x35')]?_0x1023a1[_0x8355('0x34')]:_0x59a515[_0x8355('0x2f')];_0x1023a1[_0x8355('0x36')]=qs[_0x8355('0x48')](_0x2bfc3d[_0x8355('0x30')][_0x8355('0x48')]);_0x1023a1[_0x8355('0x37')]=qs[_0x8355('0x31')](_[_0x8355('0x38')](_0x2bfc3d[_0x8355('0x30')],_0x59a515[_0x8355('0x31')]));if(_0x2bfc3d[_0x8355('0x30')][_0x8355('0x3b')]){_0x1023a1['where']=_[_0x8355('0x39')](_0x1023a1['where'],{'$or':_[_0x8355('0x2a')](_0x1023a1[_0x8355('0x34')],function(_0x224487){var _0x3b2ae1={};_0x3b2ae1[_0x224487]={'$like':'%'+_0x2bfc3d[_0x8355('0x30')]['filter']+'%'};return _0x3b2ae1;})});}_0x1023a1=_[_0x8355('0x39')]({},_0x1023a1,_0x2bfc3d[_0x8355('0x3c')]);return _0x544fc[_0x8355('0x4c')](_0x1023a1);}})['then'](function(_0x27d136){if(_0x27d136){_0x9a9f7c=_0x27d136[_0x8355('0x35')];if(!_0x2bfc3d[_0x8355('0x30')]['hasOwnProperty']('nolimit')){_0x1023a1[_0x8355('0x20')]=qs[_0x8355('0x20')](_0x2bfc3d['query'][_0x8355('0x20')]);_0x1023a1[_0x8355('0x1d')]=qs[_0x8355('0x1d')](_0x2bfc3d[_0x8355('0x30')][_0x8355('0x1d')]);}return _0x544fc['getDescriptions'](_0x1023a1);}})[_0x8355('0x24')](function(_0x5289d8){if(_0x5289d8){return _0x5289d8?{'count':_0x9a9f7c,'rows':_0x5289d8}:null;}})[_0x8355('0x24')](respondWithResult(_0x2bb747,null))['catch'](handleError(_0x2bb747,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 49f38e2..9ade847 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 _0x1107=['define','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x1a73f7,_0x274c12){var _0x3570fa=function(_0xdb9fc0){while(--_0xdb9fc0){_0x1a73f7['push'](_0x1a73f7['shift']());}};_0x3570fa(++_0x274c12);}(_0x1107,0xb5));var _0x7110=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0x1107[_0x487a0b];return _0x4cb1ba;};'use strict';var _=require('lodash');var util=require(_0x7110('0x0'));var logger=require(_0x7110('0x1'))(_0x7110('0x2'));var moment=require('moment');var BPromise=require(_0x7110('0x3'));var rp=require(_0x7110('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7110('0x5'));var config=require(_0x7110('0x6'));var attributes=require(_0x7110('0x7'));module[_0x7110('0x8')]=function(_0x58e732,_0x39cf1e){return _0x58e732[_0x7110('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe500=['int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x477776,_0x1c5af9){var _0x471fc6=function(_0x2dbd5c){while(--_0x2dbd5c){_0x477776['push'](_0x477776['shift']());}};_0x471fc6(++_0x1c5af9);}(_0xe500,0x1c8));var _0x0e50=function(_0x1c1509,_0x2dfa81){_0x1c1509=_0x1c1509-0x0;var _0xf11b7=_0xe500[_0x1c1509];return _0xf11b7;};'use strict';var _=require('lodash');var util=require(_0x0e50('0x0'));var logger=require(_0x0e50('0x1'))(_0x0e50('0x2'));var moment=require(_0x0e50('0x3'));var BPromise=require(_0x0e50('0x4'));var rp=require(_0x0e50('0x5'));var fs=require('fs');var path=require(_0x0e50('0x6'));var rimraf=require('rimraf');var config=require(_0x0e50('0x7'));var attributes=require(_0x0e50('0x8'));module[_0x0e50('0x9')]=function(_0x52a5fa,_0x112f43){return _0x52a5fa[_0x0e50('0xa')](_0x0e50('0xb'),attributes,{'tableName':_0x0e50('0xc'),'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 9f16416..832b533 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 _0x6810=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2639c5,_0x16065f){var _0x3072dc=function(_0x42c2c4){while(--_0x42c2c4){_0x2639c5['push'](_0x2639c5['shift']());}};_0x3072dc(++_0x16065f);}(_0x6810,0x164));var _0x0681=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6810[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0681('0x0'));var util=require(_0x0681('0x1'));var moment=require('moment');var BPromise=require(_0x0681('0x2'));var rs=require(_0x0681('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0681('0x4'));var logger=require(_0x0681('0x5'))(_0x0681('0x6'));var config=require(_0x0681('0x7'));var jayson=require(_0x0681('0x8'));var client=jayson[_0x0681('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d4d71,_0x837b3,_0x397569){return new BPromise(function(_0x584507,_0x25dc3c){return client[_0x0681('0xa')](_0x2d4d71,_0x397569)[_0x0681('0xb')](function(_0x592756){logger[_0x0681('0xc')](_0x0681('0xd'),_0x837b3,'request\x20sent');logger['debug'](_0x0681('0xe'),_0x837b3,_0x0681('0xf'),JSON['stringify'](_0x592756));if(_0x592756['error']){if(_0x592756[_0x0681('0x10')][_0x0681('0x11')]===0x1f4){logger[_0x0681('0x10')](_0x0681('0xd'),_0x837b3,_0x592756[_0x0681('0x10')][_0x0681('0x12')]);return _0x25dc3c(_0x592756['error'][_0x0681('0x12')]);}logger[_0x0681('0x10')](_0x0681('0xd'),_0x837b3,_0x592756[_0x0681('0x10')]['message']);return _0x584507(_0x592756[_0x0681('0x10')][_0x0681('0x12')]);}else{logger[_0x0681('0xc')](_0x0681('0xd'),_0x837b3,_0x0681('0xf'));_0x584507(_0x592756['result'][_0x0681('0x12')]);}})[_0x0681('0x13')](function(_0x2bdb2f){logger['error'](_0x0681('0xd'),_0x837b3,_0x2bdb2f);_0x25dc3c(_0x2bdb2f);});});} \ No newline at end of file +var _0xa9c5=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x15601a,_0x61e0db){var _0xc30285=function(_0x32b15c){while(--_0x32b15c){_0x15601a['push'](_0x15601a['shift']());}};_0xc30285(++_0x61e0db);}(_0xa9c5,0x1ae));var _0x5a9c=function(_0x10b219,_0x509ad3){_0x10b219=_0x10b219-0x0;var _0x3d70f6=_0xa9c5[_0x10b219];return _0x3d70f6;};'use strict';var _=require(_0x5a9c('0x0'));var util=require('util');var moment=require(_0x5a9c('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a9c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a9c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a9c('0x4'))(_0x5a9c('0x5'));var config=require(_0x5a9c('0x6'));var jayson=require(_0x5a9c('0x7'));var client=jayson[_0x5a9c('0x8')][_0x5a9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x334b6c,_0x11c226,_0x411b8b){return new BPromise(function(_0x164903,_0x294977){return client['request'](_0x334b6c,_0x411b8b)[_0x5a9c('0xa')](function(_0x2b76b4){logger[_0x5a9c('0xb')](_0x5a9c('0xc'),_0x11c226,'request\x20sent');logger[_0x5a9c('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x11c226,_0x5a9c('0xe'),JSON[_0x5a9c('0xf')](_0x2b76b4));if(_0x2b76b4['error']){if(_0x2b76b4[_0x5a9c('0x10')][_0x5a9c('0x11')]===0x1f4){logger[_0x5a9c('0x10')](_0x5a9c('0xc'),_0x11c226,_0x2b76b4[_0x5a9c('0x10')][_0x5a9c('0x12')]);return _0x294977(_0x2b76b4['error'][_0x5a9c('0x12')]);}logger[_0x5a9c('0x10')](_0x5a9c('0xc'),_0x11c226,_0x2b76b4['error'][_0x5a9c('0x12')]);return _0x164903(_0x2b76b4[_0x5a9c('0x10')]['message']);}else{logger[_0x5a9c('0xb')](_0x5a9c('0xc'),_0x11c226,'request\x20sent');_0x164903(_0x2b76b4['result'][_0x5a9c('0x12')]);}})[_0x5a9c('0x13')](function(_0xc4ba4d){logger['error'](_0x5a9c('0xc'),_0x11c226,_0xc4ba4d);_0x294977(_0xc4ba4d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cdca45f..ea2e495 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 _0x4131=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','create','delete','exports','multer','util'];(function(_0x438075,_0x59ca9e){var _0x3c2ff0=function(_0x305e6e){while(--_0x305e6e){_0x438075['push'](_0x438075['shift']());}};_0x3c2ff0(++_0x59ca9e);}(_0x4131,0x1c9));var _0x1413=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x4131[_0x4d934b];return _0xc0338b;};'use strict';var multer=require(_0x1413('0x0'));var util=require(_0x1413('0x1'));var path=require('path');var timeout=require(_0x1413('0x2'));var express=require(_0x1413('0x3'));var router=express[_0x1413('0x4')]();var fs_extra=require(_0x1413('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1413('0x6'));var config=require(_0x1413('0x7'));var controller=require(_0x1413('0x8'));router[_0x1413('0x9')]('/',auth['isAuthenticated'](),controller[_0x1413('0xa')]);router[_0x1413('0x9')](_0x1413('0xb'),auth[_0x1413('0xc')](),controller[_0x1413('0xd')]);router['post']('/',auth[_0x1413('0xc')](),controller[_0x1413('0xe')]);router['put'](_0x1413('0xb'),auth[_0x1413('0xc')](),controller['update']);router[_0x1413('0xf')](_0x1413('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1413('0x10')]=router; \ No newline at end of file +var _0xb644=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x377c19,_0x34fe86){var _0x45b293=function(_0x131f62){while(--_0x131f62){_0x377c19['push'](_0x377c19['shift']());}};_0x45b293(++_0x34fe86);}(_0xb644,0x1b4));var _0x4b64=function(_0x4da37a,_0x5057c5){_0x4da37a=_0x4da37a-0x0;var _0x21a8cd=_0xb644[_0x4da37a];return _0x21a8cd;};'use strict';var multer=require(_0x4b64('0x0'));var util=require(_0x4b64('0x1'));var path=require('path');var timeout=require(_0x4b64('0x2'));var express=require('express');var router=express[_0x4b64('0x3')]();var fs_extra=require(_0x4b64('0x4'));var auth=require(_0x4b64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b64('0x6'));var controller=require(_0x4b64('0x7'));router[_0x4b64('0x8')]('/',auth[_0x4b64('0x9')](),controller[_0x4b64('0xa')]);router[_0x4b64('0x8')](_0x4b64('0xb'),auth[_0x4b64('0x9')](),controller[_0x4b64('0xc')]);router[_0x4b64('0xd')]('/',auth[_0x4b64('0x9')](),controller[_0x4b64('0xe')]);router[_0x4b64('0xf')](_0x4b64('0xb'),auth[_0x4b64('0x9')](),controller['update']);router[_0x4b64('0x10')](_0x4b64('0xb'),auth[_0x4b64('0x9')](),controller[_0x4b64('0x11')]);module[_0x4b64('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 6d8b6e1..94c241d 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 _0x9ddd=['STRING','ENUM','sequelize','exports','customVariable','keyValue','string'];(function(_0x2f0a33,_0x19ba70){var _0x41de71=function(_0x20b822){while(--_0x20b822){_0x2f0a33['push'](_0x2f0a33['shift']());}};_0x41de71(++_0x19ba70);}(_0x9ddd,0x136));var _0xd9dd=function(_0x282603,_0x3f87a3){_0x282603=_0x282603-0x0;var _0x3d575f=_0x9ddd[_0x282603];return _0x3d575f;};'use strict';var Sequelize=require(_0xd9dd('0x0'));module[_0xd9dd('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xd9dd('0x2'),_0xd9dd('0x3'),'picklist'),'defaultValue':_0xd9dd('0x4')},'content':{'type':Sequelize[_0xd9dd('0x5')]},'key':{'type':Sequelize[_0xd9dd('0x5')]},'keyType':{'type':Sequelize[_0xd9dd('0x6')](_0xd9dd('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd9dd('0x5')]},'idField':{'type':Sequelize[_0xd9dd('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7521=['customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7521,0xcb));var _0x1752=function(_0x4117d5,_0x4b55fd){_0x4117d5=_0x4117d5-0x0;var _0x3daf1f=_0x7521[_0x4117d5];return _0x3daf1f;};'use strict';var Sequelize=require(_0x1752('0x0'));module[_0x1752('0x1')]={'type':{'type':Sequelize[_0x1752('0x2')](_0x1752('0x3'),'variable',_0x1752('0x4'),'keyValue',_0x1752('0x5')),'defaultValue':_0x1752('0x3')},'content':{'type':Sequelize[_0x1752('0x6')]},'key':{'type':Sequelize[_0x1752('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1752('0x3'),_0x1752('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1752('0x6')]},'nameField':{'type':Sequelize[_0x1752('0x6')]},'customField':{'type':Sequelize[_0x1752('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1752('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1658f16..3acdc2d 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 _0xf41b=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','params','keys','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','sendStatus','error','stack','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x303e8d,_0x3e9115){var _0x50f44c=function(_0xf8ca96){while(--_0xf8ca96){_0x303e8d['push'](_0x303e8d['shift']());}};_0x50f44c(++_0x3e9115);}(_0xf41b,0x100));var _0xbf41=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0xf41b[_0x4bfe08];return _0x1f9125;};'use strict';var emlformat=require(_0xbf41('0x0'));var rimraf=require(_0xbf41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf41('0x2'));var rp=require(_0xbf41('0x3'));var moment=require(_0xbf41('0x4'));var BPromise=require(_0xbf41('0x5'));var Mustache=require('mustache');var util=require(_0xbf41('0x6'));var path=require(_0xbf41('0x7'));var sox=require(_0xbf41('0x8'));var csv=require(_0xbf41('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf41('0xa'));var _=require(_0xbf41('0xb'));var squel=require(_0xbf41('0xc'));var crypto=require(_0xbf41('0xd'));var jsforce=require(_0xbf41('0xe'));var deskjs=require(_0xbf41('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbf41('0x10'));var Papa=require('papaparse');var Redis=require(_0xbf41('0x11'));var authService=require(_0xbf41('0x12'));var qs=require(_0xbf41('0x13'));var as=require(_0xbf41('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf41('0x15'))(_0xbf41('0x16'));var utils=require(_0xbf41('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbf41('0x18'));var db=require(_0xbf41('0x19'))['db'];function respondWithStatusCode(_0x559ee7,_0x160e4a){_0x160e4a=_0x160e4a||0xcc;return function(_0x1660d3){if(_0x1660d3){return _0x559ee7['sendStatus'](_0x160e4a);}return _0x559ee7[_0xbf41('0x1a')](_0x160e4a)[_0xbf41('0x1b')]();};}function respondWithResult(_0x30a40b,_0x2f267e){_0x2f267e=_0x2f267e||0xc8;return function(_0x120596){if(_0x120596){return _0x30a40b[_0xbf41('0x1a')](_0x2f267e)['json'](_0x120596);}};}function respondWithFilteredResult(_0x1c1946,_0x5815ff){return function(_0x3cbdb9){if(_0x3cbdb9){var _0x3318a7=typeof _0x5815ff[_0xbf41('0x1c')]===_0xbf41('0x1d')&&typeof _0x5815ff[_0xbf41('0x1e')]===_0xbf41('0x1d');var _0x7b07f=_0x3cbdb9[_0xbf41('0x1f')];var _0x3b8939=_0x3318a7?0x0:_0x5815ff[_0xbf41('0x1c')];var _0x271c32=_0x3318a7?_0x3cbdb9[_0xbf41('0x1f')]:_0x5815ff['offset']+_0x5815ff[_0xbf41('0x1e')];var _0x1eca8b;if(_0x271c32>=_0x7b07f){_0x271c32=_0x7b07f;_0x1eca8b=0xc8;}else{_0x1eca8b=0xce;}_0x1c1946[_0xbf41('0x1a')](_0x1eca8b);return _0x1c1946[_0xbf41('0x20')]('Content-Range',_0x3b8939+'-'+_0x271c32+'/'+_0x7b07f)[_0xbf41('0x21')](_0x3cbdb9);}return null;};}function patchUpdates(_0x28e0db){return function(_0x3c9e7c){try{jsonpatch[_0xbf41('0x22')](_0x3c9e7c,_0x28e0db,!![]);}catch(_0x2ab821){return BPromise[_0xbf41('0x23')](_0x2ab821);}return _0x3c9e7c[_0xbf41('0x24')]();};}function saveUpdates(_0x2f5f40,_0x36d89b){return function(_0x46aedd){if(_0x46aedd){return _0x46aedd['update'](_0x2f5f40)['then'](function(_0x24b62d){return _0x24b62d;});}return null;};}function removeEntity(_0x1a0f46,_0x1c67f7){return function(_0x45a816){if(_0x45a816){return _0x45a816[_0xbf41('0x25')]()['then'](function(){_0x1a0f46[_0xbf41('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb0b0,_0xc0adf9){return function(_0x40f7e7){if(!_0x40f7e7){_0x1eb0b0[_0xbf41('0x26')](0x194);}return _0x40f7e7;};}function handleError(_0x3662e6,_0xe74274){_0xe74274=_0xe74274||0x1f4;return function(_0x1dbf10){logger[_0xbf41('0x27')](_0x1dbf10[_0xbf41('0x28')]);if(_0x1dbf10['name']){delete _0x1dbf10['name'];}_0x3662e6[_0xbf41('0x1a')](_0xe74274)[_0xbf41('0x29')](_0x1dbf10);};}exports[_0xbf41('0x2a')]=function(_0x398f8f,_0x5ab74e){var _0x293ecb={},_0x5d421a={},_0x24e76b={'count':0x0,'rows':[]};var _0x1f03ac=_[_0xbf41('0x2b')](db[_0xbf41('0x2c')][_0xbf41('0x2d')],function(_0x7dbf06){return{'name':_0x7dbf06[_0xbf41('0x2e')],'type':_0x7dbf06[_0xbf41('0x2f')][_0xbf41('0x30')]};});_0x5d421a[_0xbf41('0x31')]=_[_0xbf41('0x2b')](_0x1f03ac,_0xbf41('0x32'));_0x5d421a[_0xbf41('0x33')]=_['keys'](_0x398f8f[_0xbf41('0x33')]);_0x5d421a['filters']=_['intersection'](_0x5d421a[_0xbf41('0x31')],_0x5d421a[_0xbf41('0x33')]);_0x293ecb[_0xbf41('0x34')]=_[_0xbf41('0x35')](_0x5d421a[_0xbf41('0x31')],qs[_0xbf41('0x36')](_0x398f8f[_0xbf41('0x33')][_0xbf41('0x36')]));_0x293ecb[_0xbf41('0x34')]=_0x293ecb[_0xbf41('0x34')][_0xbf41('0x37')]?_0x293ecb['attributes']:_0x5d421a[_0xbf41('0x31')];if(!_0x398f8f[_0xbf41('0x33')][_0xbf41('0x38')]('nolimit')){_0x293ecb['limit']=qs[_0xbf41('0x1e')](_0x398f8f[_0xbf41('0x33')]['limit']);_0x293ecb[_0xbf41('0x1c')]=qs[_0xbf41('0x1c')](_0x398f8f[_0xbf41('0x33')]['offset']);}_0x293ecb[_0xbf41('0x39')]=qs[_0xbf41('0x3a')](_0x398f8f[_0xbf41('0x33')]['sort']);_0x293ecb[_0xbf41('0x3b')]=qs[_0xbf41('0x3c')](_['pick'](_0x398f8f[_0xbf41('0x33')],_0x5d421a[_0xbf41('0x3c')]),_0x1f03ac);if(_0x398f8f['query'][_0xbf41('0x3d')]){_0x293ecb[_0xbf41('0x3b')]=_[_0xbf41('0x3e')](_0x293ecb[_0xbf41('0x3b')],{'$or':_[_0xbf41('0x2b')](_0x1f03ac,function(_0x2101e8){if(_0x2101e8[_0xbf41('0x2f')]!==_0xbf41('0x3f')){var _0x52d00c={};_0x52d00c[_0x2101e8[_0xbf41('0x32')]]={'$like':'%'+_0x398f8f[_0xbf41('0x33')][_0xbf41('0x3d')]+'%'};return _0x52d00c;}})});}_0x293ecb=_[_0xbf41('0x3e')]({},_0x293ecb,_0x398f8f[_0xbf41('0x40')]);var _0x580956={'where':_0x293ecb[_0xbf41('0x3b')]};return db['SugarcrmField'][_0xbf41('0x1f')](_0x580956)[_0xbf41('0x41')](function(_0x2a1b0c){_0x24e76b[_0xbf41('0x1f')]=_0x2a1b0c;if(_0x398f8f['query'][_0xbf41('0x42')]){_0x293ecb['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xbf41('0x43')](_0x293ecb);})[_0xbf41('0x41')](function(_0x3c5c78){_0x24e76b[_0xbf41('0x44')]=_0x3c5c78;return _0x24e76b;})['then'](respondWithFilteredResult(_0x5ab74e,_0x293ecb))[_0xbf41('0x45')](handleError(_0x5ab74e,null));};exports['show']=function(_0x163fa7,_0x1dfbf3){var _0x5059c={'raw':!![],'where':{'id':_0x163fa7[_0xbf41('0x46')]['id']}},_0x540c29={};_0x540c29['model']=_[_0xbf41('0x47')](db[_0xbf41('0x2c')][_0xbf41('0x2d')]);_0x540c29[_0xbf41('0x33')]=_[_0xbf41('0x47')](_0x163fa7[_0xbf41('0x33')]);_0x540c29[_0xbf41('0x3c')]=_[_0xbf41('0x35')](_0x540c29[_0xbf41('0x31')],_0x540c29['query']);_0x5059c[_0xbf41('0x34')]=_[_0xbf41('0x35')](_0x540c29['model'],qs['fields'](_0x163fa7[_0xbf41('0x33')][_0xbf41('0x36')]));_0x5059c[_0xbf41('0x34')]=_0x5059c[_0xbf41('0x34')]['length']?_0x5059c[_0xbf41('0x34')]:_0x540c29[_0xbf41('0x31')];if(_0x163fa7['query']['includeAll']){_0x5059c[_0xbf41('0x48')]=[{'all':!![]}];}_0x5059c=_[_0xbf41('0x3e')]({},_0x5059c,_0x163fa7[_0xbf41('0x40')]);return db[_0xbf41('0x2c')][_0xbf41('0x49')](_0x5059c)[_0xbf41('0x41')](handleEntityNotFound(_0x1dfbf3,null))['then'](respondWithResult(_0x1dfbf3,null))[_0xbf41('0x45')](handleError(_0x1dfbf3,null));};exports[_0xbf41('0x4a')]=function(_0x5b47a9,_0x4e7fd0){return db['SugarcrmField']['create'](_0x5b47a9[_0xbf41('0x4b')],{})[_0xbf41('0x41')](respondWithResult(_0x4e7fd0,0xc9))[_0xbf41('0x45')](handleError(_0x4e7fd0,null));};exports[_0xbf41('0x4c')]=function(_0x13f431,_0x530127){if(_0x13f431[_0xbf41('0x4b')]['id']){delete _0x13f431[_0xbf41('0x4b')]['id'];}return db[_0xbf41('0x2c')]['find']({'where':{'id':_0x13f431['params']['id']}})['then'](handleEntityNotFound(_0x530127,null))[_0xbf41('0x41')](saveUpdates(_0x13f431[_0xbf41('0x4b')],null))[_0xbf41('0x41')](respondWithResult(_0x530127,null))['catch'](handleError(_0x530127,null));};exports[_0xbf41('0x25')]=function(_0x22dec8,_0xbe5b44){return db[_0xbf41('0x2c')][_0xbf41('0x49')]({'where':{'id':_0x22dec8[_0xbf41('0x46')]['id']}})[_0xbf41('0x41')](handleEntityNotFound(_0xbe5b44,null))[_0xbf41('0x41')](removeEntity(_0xbe5b44,null))['catch'](handleError(_0xbe5b44,null));}; \ No newline at end of file +var _0xf84d=['findAll','rows','catch','show','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','set','apply','save','destroy','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','SugarcrmField'];(function(_0x472fbc,_0x441a89){var _0x27a335=function(_0x675cd7){while(--_0x675cd7){_0x472fbc['push'](_0x472fbc['shift']());}};_0x27a335(++_0x441a89);}(_0xf84d,0x180));var _0xdf84=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xf84d[_0x255ac0];return _0x437bf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf84('0x0'));var zipdir=require(_0xdf84('0x1'));var jsonpatch=require(_0xdf84('0x2'));var rp=require(_0xdf84('0x3'));var moment=require(_0xdf84('0x4'));var BPromise=require(_0xdf84('0x5'));var Mustache=require('mustache');var util=require(_0xdf84('0x6'));var path=require(_0xdf84('0x7'));var sox=require(_0xdf84('0x8'));var csv=require(_0xdf84('0x9'));var ejs=require(_0xdf84('0xa'));var fs=require('fs');var fs_extra=require(_0xdf84('0xb'));var _=require(_0xdf84('0xc'));var squel=require(_0xdf84('0xd'));var crypto=require(_0xdf84('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf84('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdf84('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf84('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdf84('0x12'));var hardwareService=require(_0xdf84('0x13'));var logger=require(_0xdf84('0x14'))(_0xdf84('0x15'));var utils=require(_0xdf84('0x16'));var config=require(_0xdf84('0x17'));var licenseUtil=require(_0xdf84('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cef62,_0x5158ae){_0x5158ae=_0x5158ae||0xcc;return function(_0x1c52ac){if(_0x1c52ac){return _0x4cef62['sendStatus'](_0x5158ae);}return _0x4cef62[_0xdf84('0x19')](_0x5158ae)[_0xdf84('0x1a')]();};}function respondWithResult(_0x5451fe,_0x2b502b){_0x2b502b=_0x2b502b||0xc8;return function(_0x5d965f){if(_0x5d965f){return _0x5451fe[_0xdf84('0x19')](_0x2b502b)[_0xdf84('0x1b')](_0x5d965f);}};}function respondWithFilteredResult(_0x21094e,_0x53c9e4){return function(_0x3d6ead){if(_0x3d6ead){var _0x385176=typeof _0x53c9e4['offset']==='undefined'&&typeof _0x53c9e4[_0xdf84('0x1c')]===_0xdf84('0x1d');var _0x3ed2e3=_0x3d6ead[_0xdf84('0x1e')];var _0x238894=_0x385176?0x0:_0x53c9e4['offset'];var _0x4c3214=_0x385176?_0x3d6ead[_0xdf84('0x1e')]:_0x53c9e4['offset']+_0x53c9e4[_0xdf84('0x1c')];var _0x8803c0;if(_0x4c3214>=_0x3ed2e3){_0x4c3214=_0x3ed2e3;_0x8803c0=0xc8;}else{_0x8803c0=0xce;}_0x21094e[_0xdf84('0x19')](_0x8803c0);return _0x21094e[_0xdf84('0x1f')]('Content-Range',_0x238894+'-'+_0x4c3214+'/'+_0x3ed2e3)[_0xdf84('0x1b')](_0x3d6ead);}return null;};}function patchUpdates(_0x1ba54a){return function(_0x534d38){try{jsonpatch[_0xdf84('0x20')](_0x534d38,_0x1ba54a,!![]);}catch(_0xb1a55c){return BPromise['reject'](_0xb1a55c);}return _0x534d38[_0xdf84('0x21')]();};}function saveUpdates(_0x392c12,_0x3f023f){return function(_0x237f45){if(_0x237f45){return _0x237f45['update'](_0x392c12)['then'](function(_0x2f294e){return _0x2f294e;});}return null;};}function removeEntity(_0x43d8f1,_0x1646dd){return function(_0x365344){if(_0x365344){return _0x365344[_0xdf84('0x22')]()[_0xdf84('0x23')](function(){_0x43d8f1[_0xdf84('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162304,_0x4aec77){return function(_0x3747f1){if(!_0x3747f1){_0x162304[_0xdf84('0x24')](0x194);}return _0x3747f1;};}function handleError(_0x335bcf,_0x58057e){_0x58057e=_0x58057e||0x1f4;return function(_0x5bf9e5){logger[_0xdf84('0x25')](_0x5bf9e5[_0xdf84('0x26')]);if(_0x5bf9e5[_0xdf84('0x27')]){delete _0x5bf9e5['name'];}_0x335bcf[_0xdf84('0x19')](_0x58057e)['send'](_0x5bf9e5);};}exports[_0xdf84('0x28')]=function(_0x32bf08,_0x2eedb5){var _0x44cb4c={},_0x4583e6={},_0x21d495={'count':0x0,'rows':[]};var _0x392c16=_[_0xdf84('0x29')](db['SugarcrmField'][_0xdf84('0x2a')],function(_0x28bd3d){return{'name':_0x28bd3d[_0xdf84('0x2b')],'type':_0x28bd3d[_0xdf84('0x2c')]['key']};});_0x4583e6['model']=_[_0xdf84('0x29')](_0x392c16,_0xdf84('0x27'));_0x4583e6[_0xdf84('0x2d')]=_[_0xdf84('0x2e')](_0x32bf08[_0xdf84('0x2d')]);_0x4583e6['filters']=_[_0xdf84('0x2f')](_0x4583e6[_0xdf84('0x30')],_0x4583e6[_0xdf84('0x2d')]);_0x44cb4c[_0xdf84('0x31')]=_[_0xdf84('0x2f')](_0x4583e6[_0xdf84('0x30')],qs[_0xdf84('0x32')](_0x32bf08[_0xdf84('0x2d')]['fields']));_0x44cb4c['attributes']=_0x44cb4c[_0xdf84('0x31')][_0xdf84('0x33')]?_0x44cb4c[_0xdf84('0x31')]:_0x4583e6[_0xdf84('0x30')];if(!_0x32bf08[_0xdf84('0x2d')][_0xdf84('0x34')](_0xdf84('0x35'))){_0x44cb4c[_0xdf84('0x1c')]=qs[_0xdf84('0x1c')](_0x32bf08['query'][_0xdf84('0x1c')]);_0x44cb4c[_0xdf84('0x36')]=qs[_0xdf84('0x36')](_0x32bf08[_0xdf84('0x2d')]['offset']);}_0x44cb4c[_0xdf84('0x37')]=qs['sort'](_0x32bf08[_0xdf84('0x2d')][_0xdf84('0x38')]);_0x44cb4c[_0xdf84('0x39')]=qs['filters'](_[_0xdf84('0x3a')](_0x32bf08['query'],_0x4583e6[_0xdf84('0x3b')]),_0x392c16);if(_0x32bf08[_0xdf84('0x2d')]['filter']){_0x44cb4c[_0xdf84('0x39')]=_[_0xdf84('0x3c')](_0x44cb4c[_0xdf84('0x39')],{'$or':_['map'](_0x392c16,function(_0x5cb57f){if(_0x5cb57f['type']!==_0xdf84('0x3d')){var _0x15c00f={};_0x15c00f[_0x5cb57f[_0xdf84('0x27')]]={'$like':'%'+_0x32bf08[_0xdf84('0x2d')][_0xdf84('0x3e')]+'%'};return _0x15c00f;}})});}_0x44cb4c=_[_0xdf84('0x3c')]({},_0x44cb4c,_0x32bf08[_0xdf84('0x3f')]);var _0x2ffb35={'where':_0x44cb4c['where']};return db['SugarcrmField']['count'](_0x2ffb35)['then'](function(_0x524a9a){_0x21d495[_0xdf84('0x1e')]=_0x524a9a;if(_0x32bf08['query']['includeAll']){_0x44cb4c[_0xdf84('0x40')]=[{'all':!![]}];}return db[_0xdf84('0x41')][_0xdf84('0x42')](_0x44cb4c);})[_0xdf84('0x23')](function(_0x750b47){_0x21d495[_0xdf84('0x43')]=_0x750b47;return _0x21d495;})[_0xdf84('0x23')](respondWithFilteredResult(_0x2eedb5,_0x44cb4c))[_0xdf84('0x44')](handleError(_0x2eedb5,null));};exports[_0xdf84('0x45')]=function(_0x551e9a,_0x5b7c66){var _0x18f8a0={'raw':!![],'where':{'id':_0x551e9a[_0xdf84('0x46')]['id']}},_0x352ee5={};_0x352ee5[_0xdf84('0x30')]=_[_0xdf84('0x2e')](db[_0xdf84('0x41')][_0xdf84('0x2a')]);_0x352ee5['query']=_[_0xdf84('0x2e')](_0x551e9a[_0xdf84('0x2d')]);_0x352ee5[_0xdf84('0x3b')]=_[_0xdf84('0x2f')](_0x352ee5['model'],_0x352ee5[_0xdf84('0x2d')]);_0x18f8a0[_0xdf84('0x31')]=_['intersection'](_0x352ee5[_0xdf84('0x30')],qs['fields'](_0x551e9a[_0xdf84('0x2d')][_0xdf84('0x32')]));_0x18f8a0[_0xdf84('0x31')]=_0x18f8a0['attributes'][_0xdf84('0x33')]?_0x18f8a0['attributes']:_0x352ee5[_0xdf84('0x30')];if(_0x551e9a[_0xdf84('0x2d')]['includeAll']){_0x18f8a0[_0xdf84('0x40')]=[{'all':!![]}];}_0x18f8a0=_[_0xdf84('0x3c')]({},_0x18f8a0,_0x551e9a[_0xdf84('0x3f')]);return db[_0xdf84('0x41')][_0xdf84('0x47')](_0x18f8a0)[_0xdf84('0x23')](handleEntityNotFound(_0x5b7c66,null))[_0xdf84('0x23')](respondWithResult(_0x5b7c66,null))[_0xdf84('0x44')](handleError(_0x5b7c66,null));};exports['create']=function(_0x528f54,_0x64b5a5){return db[_0xdf84('0x41')][_0xdf84('0x48')](_0x528f54[_0xdf84('0x49')],{})[_0xdf84('0x23')](respondWithResult(_0x64b5a5,0xc9))[_0xdf84('0x44')](handleError(_0x64b5a5,null));};exports[_0xdf84('0x4a')]=function(_0x1d8411,_0x5a4fdf){if(_0x1d8411[_0xdf84('0x49')]['id']){delete _0x1d8411[_0xdf84('0x49')]['id'];}return db[_0xdf84('0x41')][_0xdf84('0x47')]({'where':{'id':_0x1d8411[_0xdf84('0x46')]['id']}})[_0xdf84('0x23')](handleEntityNotFound(_0x5a4fdf,null))[_0xdf84('0x23')](saveUpdates(_0x1d8411[_0xdf84('0x49')],null))[_0xdf84('0x23')](respondWithResult(_0x5a4fdf,null))[_0xdf84('0x44')](handleError(_0x5a4fdf,null));};exports['destroy']=function(_0x340dbc,_0x3a0f20){return db[_0xdf84('0x41')]['find']({'where':{'id':_0x340dbc[_0xdf84('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a0f20,null))[_0xdf84('0x23')](removeEntity(_0x3a0f20,null))[_0xdf84('0x44')](handleError(_0x3a0f20,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 08623f8..bc08b15 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 _0xdb22=['define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x4fc130,_0xad9bdb){var _0x3319ab=function(_0x7be8da){while(--_0x7be8da){_0x4fc130['push'](_0x4fc130['shift']());}};_0x3319ab(++_0xad9bdb);}(_0xdb22,0x17c));var _0x2db2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdb22[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x2db2('0x0'));var util=require(_0x2db2('0x1'));var logger=require(_0x2db2('0x2'))('api');var moment=require(_0x2db2('0x3'));var BPromise=require(_0x2db2('0x4'));var rp=require(_0x2db2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2db2('0x6'));var config=require(_0x2db2('0x7'));var attributes=require(_0x2db2('0x8'));module[_0x2db2('0x9')]=function(_0x2b5a91,_0x244869){return _0x2b5a91[_0x2db2('0xa')](_0x2db2('0xb'),attributes,{'tableName':_0x2db2('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x2db2('0xd'),_0x2db2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20bf=['exports','define','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes'];(function(_0xa58f6b,_0x4f166e){var _0x2a1cd0=function(_0x3bd658){while(--_0x3bd658){_0xa58f6b['push'](_0xa58f6b['shift']());}};_0x2a1cd0(++_0x4f166e);}(_0x20bf,0x163));var _0xf20b=function(_0x17b4a9,_0x5a6b1f){_0x17b4a9=_0x17b4a9-0x0;var _0x4844f3=_0x20bf[_0x17b4a9];return _0x4844f3;};'use strict';var _=require(_0xf20b('0x0'));var util=require(_0xf20b('0x1'));var logger=require(_0xf20b('0x2'))(_0xf20b('0x3'));var moment=require('moment');var BPromise=require(_0xf20b('0x4'));var rp=require(_0xf20b('0x5'));var fs=require('fs');var path=require(_0xf20b('0x6'));var rimraf=require(_0xf20b('0x7'));var config=require('../../config/environment');var attributes=require(_0xf20b('0x8'));module[_0xf20b('0x9')]=function(_0x44d909,_0x183d78){return _0x44d909[_0xf20b('0xa')](_0xf20b('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xf20b('0xc'),_0xf20b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 1079e35..8dde04d 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 _0x8c2c=['client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise'];(function(_0x49d234,_0x1e7488){var _0xefbcb3=function(_0x46de6c){while(--_0x46de6c){_0x49d234['push'](_0x49d234['shift']());}};_0xefbcb3(++_0x1e7488);}(_0x8c2c,0x15d));var _0xc8c2=function(_0x20af12,_0x319f05){_0x20af12=_0x20af12-0x0;var _0x55cb67=_0x8c2c[_0x20af12];return _0x55cb67;};'use strict';var _=require(_0xc8c2('0x0'));var util=require(_0xc8c2('0x1'));var moment=require(_0xc8c2('0x2'));var BPromise=require(_0xc8c2('0x3'));var rs=require(_0xc8c2('0x4'));var fs=require('fs');var Redis=require(_0xc8c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc8c2('0x7'));var client=jayson[_0xc8c2('0x8')][_0xc8c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4217,_0x1f3914,_0xe910d8){return new BPromise(function(_0x1635cf,_0x21c496){return client[_0xc8c2('0xa')](_0x3e4217,_0xe910d8)['then'](function(_0xd7ff8e){logger[_0xc8c2('0xb')](_0xc8c2('0xc'),_0x1f3914,_0xc8c2('0xd'));logger[_0xc8c2('0xe')](_0xc8c2('0xf'),_0x1f3914,_0xc8c2('0xd'),JSON[_0xc8c2('0x10')](_0xd7ff8e));if(_0xd7ff8e[_0xc8c2('0x11')]){if(_0xd7ff8e[_0xc8c2('0x11')]['code']===0x1f4){logger[_0xc8c2('0x11')](_0xc8c2('0xc'),_0x1f3914,_0xd7ff8e[_0xc8c2('0x11')][_0xc8c2('0x12')]);return _0x21c496(_0xd7ff8e[_0xc8c2('0x11')][_0xc8c2('0x12')]);}logger['error'](_0xc8c2('0xc'),_0x1f3914,_0xd7ff8e[_0xc8c2('0x11')][_0xc8c2('0x12')]);return _0x1635cf(_0xd7ff8e[_0xc8c2('0x11')][_0xc8c2('0x12')]);}else{logger[_0xc8c2('0xb')](_0xc8c2('0xc'),_0x1f3914,_0xc8c2('0xd'));_0x1635cf(_0xd7ff8e[_0xc8c2('0x13')]['message']);}})[_0xc8c2('0x14')](function(_0x172c34){logger[_0xc8c2('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1f3914,_0x172c34);_0x21c496(_0x172c34);});});} \ No newline at end of file +var _0x5847=['../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x39f7c8,_0x1b0705){var _0x51ac75=function(_0xd37d6e){while(--_0xd37d6e){_0x39f7c8['push'](_0x39f7c8['shift']());}};_0x51ac75(++_0x1b0705);}(_0x5847,0x164));var _0x7584=function(_0x5b246c,_0x462384){_0x5b246c=_0x5b246c-0x0;var _0x422739=_0x5847[_0x5b246c];return _0x422739;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7584('0x0'));var BPromise=require(_0x7584('0x1'));var rs=require(_0x7584('0x2'));var fs=require('fs');var Redis=require(_0x7584('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7584('0x4'));var logger=require('../../config/logger')(_0x7584('0x5'));var config=require(_0x7584('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7584('0x7')][_0x7584('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13039c,_0x56e1bc,_0x106db3){return new BPromise(function(_0xdb9fed,_0x572377){return client['request'](_0x13039c,_0x106db3)[_0x7584('0x9')](function(_0x8ae701){logger[_0x7584('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x56e1bc,_0x7584('0xb'));logger['debug'](_0x7584('0xc'),_0x56e1bc,_0x7584('0xb'),JSON[_0x7584('0xd')](_0x8ae701));if(_0x8ae701[_0x7584('0xe')]){if(_0x8ae701[_0x7584('0xe')]['code']===0x1f4){logger['error'](_0x7584('0xf'),_0x56e1bc,_0x8ae701[_0x7584('0xe')]['message']);return _0x572377(_0x8ae701[_0x7584('0xe')][_0x7584('0x10')]);}logger[_0x7584('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x56e1bc,_0x8ae701[_0x7584('0xe')]['message']);return _0xdb9fed(_0x8ae701['error']['message']);}else{logger[_0x7584('0xa')](_0x7584('0xf'),_0x56e1bc,_0x7584('0xb'));_0xdb9fed(_0x8ae701[_0x7584('0x11')][_0x7584('0x10')]);}})['catch'](function(_0x1dc00a){logger[_0x7584('0xe')](_0x7584('0xf'),_0x56e1bc,_0x1dc00a);_0x572377(_0x1dc00a);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 94efda8..c0a8f85 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 _0xb620=['update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xb620,0x1a0));var _0x0b62=function(_0x82623d,_0x173ae1){_0x82623d=_0x82623d-0x0;var _0x329267=_0xb620[_0x82623d];return _0x329267;};'use strict';var multer=require(_0x0b62('0x0'));var util=require('util');var path=require(_0x0b62('0x1'));var timeout=require(_0x0b62('0x2'));var express=require('express');var router=express[_0x0b62('0x3')]();var fs_extra=require(_0x0b62('0x4'));var auth=require(_0x0b62('0x5'));var interaction=require(_0x0b62('0x6'));var config=require(_0x0b62('0x7'));var controller=require(_0x0b62('0x8'));router['get']('/',auth[_0x0b62('0x9')](),controller[_0x0b62('0xa')]);router['get']('/:id',auth[_0x0b62('0x9')](),controller[_0x0b62('0xb')]);router[_0x0b62('0xc')](_0x0b62('0xd'),auth[_0x0b62('0x9')](),controller['getConfigurations']);router[_0x0b62('0xc')](_0x0b62('0xe'),auth[_0x0b62('0x9')](),controller[_0x0b62('0xf')]);router['post']('/',auth[_0x0b62('0x9')](),controller[_0x0b62('0x10')]);router[_0x0b62('0x11')](_0x0b62('0xd'),auth[_0x0b62('0x9')](),controller[_0x0b62('0x12')]);router[_0x0b62('0x13')](_0x0b62('0x14'),auth[_0x0b62('0x9')](),controller[_0x0b62('0x15')]);router['delete'](_0x0b62('0x14'),auth[_0x0b62('0x9')](),controller['destroy']);module[_0x0b62('0x16')]=router; \ No newline at end of file +var _0x340c=['index','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc340('0x0'));var util=require(_0xc340('0x1'));var path=require(_0xc340('0x2'));var timeout=require(_0xc340('0x3'));var express=require('express');var router=express[_0xc340('0x4')]();var fs_extra=require(_0xc340('0x5'));var auth=require(_0xc340('0x6'));var interaction=require(_0xc340('0x7'));var config=require('../../config/environment');var controller=require(_0xc340('0x8'));router[_0xc340('0x9')]('/',auth[_0xc340('0xa')](),controller[_0xc340('0xb')]);router[_0xc340('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc340('0x9')](_0xc340('0xc'),auth['isAuthenticated'](),controller[_0xc340('0xd')]);router[_0xc340('0x9')](_0xc340('0xe'),auth[_0xc340('0xa')](),controller[_0xc340('0xf')]);router['post']('/',auth[_0xc340('0xa')](),controller[_0xc340('0x10')]);router[_0xc340('0x11')]('/:id/configurations',auth[_0xc340('0xa')](),controller[_0xc340('0x12')]);router[_0xc340('0x13')](_0xc340('0x14'),auth[_0xc340('0xa')](),controller['update']);router[_0xc340('0x15')](_0xc340('0x14'),auth[_0xc340('0xa')](),controller[_0xc340('0x16')]);module[_0xc340('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 2f63c53..c0f50b3 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 _0x8de9=['sequelize','exports','STRING','HelpDesk'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x8de9,0x17c));var _0x98de=function(_0xaaea6d,_0x8610dc){_0xaaea6d=_0xaaea6d-0x0;var _0x13f849=_0x8de9[_0xaaea6d];return _0x13f849;};'use strict';var Sequelize=require(_0x98de('0x0'));module[_0x98de('0x1')]={'name':{'type':Sequelize[_0x98de('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x98de('0x2')]},'username':{'type':Sequelize[_0x98de('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x98de('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x98de('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x98de('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfa67=['STRING','HelpDesk','exports'];(function(_0x5e0ea2,_0x4ced47){var _0x3533a2=function(_0x4ccd6d){while(--_0x4ccd6d){_0x5e0ea2['push'](_0x5e0ea2['shift']());}};_0x3533a2(++_0x4ced47);}(_0xfa67,0x179));var _0x7fa6=function(_0x1a9af7,_0x5b2682){_0x1a9af7=_0x1a9af7-0x0;var _0xd59a1b=_0xfa67[_0x1a9af7];return _0xd59a1b;};'use strict';var Sequelize=require('sequelize');module[_0x7fa6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7fa6('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fa6('0x2')},'remoteUri':{'type':Sequelize[_0x7fa6('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7fa6('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 77cc604..516fc9c 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 _0xbd5e=['catch','show','params','keys','fields','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName','remoteUri','accessKey','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','result','token','GET','describe','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','VtigerAccount','then','includeAll','include','findAll'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xbd5e,0x128));var _0xebd5=function(_0x3abfdd,_0x118e8e){_0x3abfdd=_0x3abfdd-0x0;var _0x58422a=_0xbd5e[_0x3abfdd];return _0x58422a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebd5('0x0'));var jsonpatch=require(_0xebd5('0x1'));var rp=require(_0xebd5('0x2'));var moment=require(_0xebd5('0x3'));var BPromise=require(_0xebd5('0x4'));var Mustache=require(_0xebd5('0x5'));var util=require(_0xebd5('0x6'));var path=require(_0xebd5('0x7'));var sox=require(_0xebd5('0x8'));var csv=require(_0xebd5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebd5('0xa'));var _=require(_0xebd5('0xb'));var squel=require(_0xebd5('0xc'));var crypto=require(_0xebd5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebd5('0xe'));var toCsv=require(_0xebd5('0x9'));var querystring=require(_0xebd5('0xf'));var Papa=require(_0xebd5('0x10'));var Redis=require('ioredis');var authService=require(_0xebd5('0x11'));var qs=require(_0xebd5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebd5('0x13'));var logger=require(_0xebd5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xebd5('0x15'));var licenseUtil=require(_0xebd5('0x16'));var db=require(_0xebd5('0x17'))['db'];var integrations=require(_0xebd5('0x18'));function respondWithStatusCode(_0x47e829,_0x2ad689){_0x2ad689=_0x2ad689||0xcc;return function(_0x3ebde4){if(_0x3ebde4){return _0x47e829['sendStatus'](_0x2ad689);}return _0x47e829[_0xebd5('0x19')](_0x2ad689)[_0xebd5('0x1a')]();};}function respondWithResult(_0x552a12,_0x15155d){_0x15155d=_0x15155d||0xc8;return function(_0x440f8f){if(_0x440f8f){return _0x552a12['status'](_0x15155d)[_0xebd5('0x1b')](_0x440f8f);}};}function respondWithFilteredResult(_0x813290,_0x24b4ab){return function(_0x148c99){if(_0x148c99){var _0x315b57=typeof _0x24b4ab['offset']===_0xebd5('0x1c')&&typeof _0x24b4ab[_0xebd5('0x1d')]===_0xebd5('0x1c');var _0x1a6785=_0x148c99[_0xebd5('0x1e')];var _0x4a9f17=_0x315b57?0x0:_0x24b4ab[_0xebd5('0x1f')];var _0x3f9447=_0x315b57?_0x148c99[_0xebd5('0x1e')]:_0x24b4ab[_0xebd5('0x1f')]+_0x24b4ab['limit'];var _0x27301c;if(_0x3f9447>=_0x1a6785){_0x3f9447=_0x1a6785;_0x27301c=0xc8;}else{_0x27301c=0xce;}_0x813290['status'](_0x27301c);return _0x813290[_0xebd5('0x20')](_0xebd5('0x21'),_0x4a9f17+'-'+_0x3f9447+'/'+_0x1a6785)[_0xebd5('0x1b')](_0x148c99);}return null;};}function patchUpdates(_0x26253e){return function(_0x56098d){try{jsonpatch[_0xebd5('0x22')](_0x56098d,_0x26253e,!![]);}catch(_0x38e548){return BPromise[_0xebd5('0x23')](_0x38e548);}return _0x56098d[_0xebd5('0x24')]();};}function saveUpdates(_0x5deb14,_0x1be8a4){return function(_0x4ac4d6){if(_0x4ac4d6){return _0x4ac4d6[_0xebd5('0x25')](_0x5deb14)['then'](function(_0x3dae5f){return _0x3dae5f;});}return null;};}function removeEntity(_0x452dcd,_0x437bdf){return function(_0x99b163){if(_0x99b163){return _0x99b163['destroy']()['then'](function(){_0x452dcd['status'](0xcc)[_0xebd5('0x1a')]();});}};}function handleEntityNotFound(_0x413c8c,_0x496cc1){return function(_0x417133){if(!_0x417133){_0x413c8c[_0xebd5('0x26')](0x194);}return _0x417133;};}function handleError(_0x21d193,_0x4e6782){_0x4e6782=_0x4e6782||0x1f4;return function(_0x1e89e5){logger[_0xebd5('0x27')](_0x1e89e5[_0xebd5('0x28')]);if(_0x1e89e5[_0xebd5('0x29')]){delete _0x1e89e5[_0xebd5('0x29')];}_0x21d193['status'](_0x4e6782)['send'](_0x1e89e5);};}exports[_0xebd5('0x2a')]=function(_0x2be47f,_0x52ebdf){var _0x3e4a32={},_0x1d691c={},_0x5cf734={'count':0x0,'rows':[]};var _0x385641=_[_0xebd5('0x2b')](db['VtigerAccount'][_0xebd5('0x2c')],function(_0x5abfe6){return{'name':_0x5abfe6[_0xebd5('0x2d')],'type':_0x5abfe6[_0xebd5('0x2e')][_0xebd5('0x2f')]};});_0x1d691c[_0xebd5('0x30')]=_['map'](_0x385641,_0xebd5('0x29'));_0x1d691c['query']=_['keys'](_0x2be47f[_0xebd5('0x31')]);_0x1d691c[_0xebd5('0x32')]=_[_0xebd5('0x33')](_0x1d691c[_0xebd5('0x30')],_0x1d691c[_0xebd5('0x31')]);_0x3e4a32['attributes']=_[_0xebd5('0x33')](_0x1d691c[_0xebd5('0x30')],qs['fields'](_0x2be47f[_0xebd5('0x31')]['fields']));_0x3e4a32[_0xebd5('0x34')]=_0x3e4a32[_0xebd5('0x34')][_0xebd5('0x35')]?_0x3e4a32[_0xebd5('0x34')]:_0x1d691c[_0xebd5('0x30')];if(!_0x2be47f[_0xebd5('0x31')][_0xebd5('0x36')](_0xebd5('0x37'))){_0x3e4a32['limit']=qs['limit'](_0x2be47f['query'][_0xebd5('0x1d')]);_0x3e4a32[_0xebd5('0x1f')]=qs[_0xebd5('0x1f')](_0x2be47f[_0xebd5('0x31')]['offset']);}_0x3e4a32['order']=qs[_0xebd5('0x38')](_0x2be47f[_0xebd5('0x31')][_0xebd5('0x38')]);_0x3e4a32[_0xebd5('0x39')]=qs['filters'](_['pick'](_0x2be47f[_0xebd5('0x31')],_0x1d691c[_0xebd5('0x32')]),_0x385641);if(_0x2be47f[_0xebd5('0x31')][_0xebd5('0x3a')]){_0x3e4a32['where']=_['merge'](_0x3e4a32['where'],{'$or':_['map'](_0x385641,function(_0x9ab3b7){if(_0x9ab3b7['type']!==_0xebd5('0x3b')){var _0x139da6={};_0x139da6[_0x9ab3b7[_0xebd5('0x29')]]={'$like':'%'+_0x2be47f['query'][_0xebd5('0x3a')]+'%'};return _0x139da6;}})});}_0x3e4a32=_[_0xebd5('0x3c')]({},_0x3e4a32,_0x2be47f[_0xebd5('0x3d')]);var _0x214918={'where':_0x3e4a32[_0xebd5('0x39')]};return db[_0xebd5('0x3e')][_0xebd5('0x1e')](_0x214918)[_0xebd5('0x3f')](function(_0x5032bb){_0x5cf734[_0xebd5('0x1e')]=_0x5032bb;if(_0x2be47f[_0xebd5('0x31')][_0xebd5('0x40')]){_0x3e4a32[_0xebd5('0x41')]=[{'all':!![]}];}return db[_0xebd5('0x3e')][_0xebd5('0x42')](_0x3e4a32);})['then'](function(_0xcf5abc){_0x5cf734['rows']=_0xcf5abc;return _0x5cf734;})[_0xebd5('0x3f')](respondWithFilteredResult(_0x52ebdf,_0x3e4a32))[_0xebd5('0x43')](handleError(_0x52ebdf,null));};exports[_0xebd5('0x44')]=function(_0x7b2ee3,_0x362451){var _0x14e59b={'raw':![],'where':{'id':_0x7b2ee3[_0xebd5('0x45')]['id']}},_0x310fd3={};_0x310fd3[_0xebd5('0x30')]=_['keys'](db[_0xebd5('0x3e')][_0xebd5('0x2c')]);_0x310fd3['query']=_[_0xebd5('0x46')](_0x7b2ee3['query']);_0x310fd3[_0xebd5('0x32')]=_[_0xebd5('0x33')](_0x310fd3['model'],_0x310fd3['query']);_0x14e59b['attributes']=_['intersection'](_0x310fd3[_0xebd5('0x30')],qs[_0xebd5('0x47')](_0x7b2ee3[_0xebd5('0x31')]['fields']));_0x14e59b[_0xebd5('0x34')]=_0x14e59b['attributes']['length']?_0x14e59b[_0xebd5('0x34')]:_0x310fd3[_0xebd5('0x30')];if(_0x7b2ee3['query'][_0xebd5('0x40')]){_0x14e59b['include']=[{'all':!![]}];}_0x14e59b=_[_0xebd5('0x3c')]({},_0x14e59b,_0x7b2ee3[_0xebd5('0x3d')]);return db[_0xebd5('0x3e')][_0xebd5('0x48')](_0x14e59b)['then'](handleEntityNotFound(_0x362451,null))[_0xebd5('0x3f')](respondWithResult(_0x362451,null))[_0xebd5('0x43')](handleError(_0x362451,null));};exports[_0xebd5('0x49')]=function(_0x230fc6,_0x1223f0){return db[_0xebd5('0x3e')][_0xebd5('0x49')](_0x230fc6[_0xebd5('0x4a')],{})[_0xebd5('0x3f')](respondWithResult(_0x1223f0,0xc9))['catch'](handleError(_0x1223f0,null));};exports[_0xebd5('0x25')]=function(_0x17a8ae,_0x316429){if(_0x17a8ae[_0xebd5('0x4a')]['id']){delete _0x17a8ae[_0xebd5('0x4a')]['id'];}return db[_0xebd5('0x3e')][_0xebd5('0x48')]({'where':{'id':_0x17a8ae[_0xebd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x316429,null))[_0xebd5('0x3f')](saveUpdates(_0x17a8ae[_0xebd5('0x4a')],null))['then'](respondWithResult(_0x316429,null))['catch'](handleError(_0x316429,null));};exports[_0xebd5('0x4b')]=function(_0x2a0418,_0x487cd0){return db[_0xebd5('0x3e')]['find']({'where':{'id':_0x2a0418['params']['id']}})[_0xebd5('0x3f')](handleEntityNotFound(_0x487cd0,null))[_0xebd5('0x3f')](removeEntity(_0x487cd0,null))[_0xebd5('0x43')](handleError(_0x487cd0,null));};exports[_0xebd5('0x4c')]=function(_0x45f683,_0xbf692,_0x345090){var _0x17d97d={};var _0x45ac8b={};var _0x74206;var _0x406f2a;return db['VtigerAccount'][_0xebd5('0x4d')]({'where':{'id':_0x45f683[_0xebd5('0x45')]['id']}})['then'](handleEntityNotFound(_0xbf692,null))[_0xebd5('0x3f')](function(_0xe5c68c){if(_0xe5c68c){_0x74206=_0xe5c68c;_0x45ac8b[_0xebd5('0x30')]=_[_0xebd5('0x46')](db[_0xebd5('0x4e')][_0xebd5('0x2c')]);_0x45ac8b[_0xebd5('0x31')]=_[_0xebd5('0x46')](_0x45f683[_0xebd5('0x31')]);_0x45ac8b[_0xebd5('0x32')]=_['intersection'](_0x45ac8b[_0xebd5('0x30')],_0x45ac8b[_0xebd5('0x31')]);_0x17d97d[_0xebd5('0x34')]=_[_0xebd5('0x33')](_0x45ac8b[_0xebd5('0x30')],qs[_0xebd5('0x47')](_0x45f683['query'][_0xebd5('0x47')]));_0x17d97d[_0xebd5('0x34')]=_0x17d97d[_0xebd5('0x34')][_0xebd5('0x35')]?_0x17d97d['attributes']:_0x45ac8b[_0xebd5('0x30')];_0x17d97d[_0xebd5('0x4f')]=qs['sort'](_0x45f683['query'][_0xebd5('0x38')]);_0x17d97d[_0xebd5('0x39')]=qs[_0xebd5('0x32')](_[_0xebd5('0x50')](_0x45f683[_0xebd5('0x31')],_0x45ac8b[_0xebd5('0x32')]));if(_0x45f683[_0xebd5('0x31')][_0xebd5('0x3a')]){_0x17d97d[_0xebd5('0x39')]=_[_0xebd5('0x3c')](_0x17d97d['where'],{'$or':_[_0xebd5('0x2b')](_0x17d97d[_0xebd5('0x34')],function(_0x4625af){var _0x17ef90={};_0x17ef90[_0x4625af]={'$like':'%'+_0x45f683[_0xebd5('0x31')][_0xebd5('0x3a')]+'%'};return _0x17ef90;})});}_0x17d97d=_[_0xebd5('0x3c')]({},_0x17d97d,_0x45f683[_0xebd5('0x3d')]);return _0x74206['getConfigurations'](_0x17d97d);}})[_0xebd5('0x3f')](function(_0x53676d){if(_0x53676d){_0x406f2a=_0x53676d[_0xebd5('0x35')];if(!_0x45f683[_0xebd5('0x31')][_0xebd5('0x36')](_0xebd5('0x37'))){_0x17d97d['limit']=qs['limit'](_0x45f683[_0xebd5('0x31')][_0xebd5('0x1d')]);_0x17d97d['offset']=qs[_0xebd5('0x1f')](_0x45f683[_0xebd5('0x31')]['offset']);}return _0x74206[_0xebd5('0x4c')](_0x17d97d);}})[_0xebd5('0x3f')](function(_0x1bd78b){if(_0x1bd78b){return _0x1bd78b?{'count':_0x406f2a,'rows':_0x1bd78b}:null;}})[_0xebd5('0x3f')](respondWithResult(_0xbf692,null))[_0xebd5('0x43')](handleError(_0xbf692,null));};exports[_0xebd5('0x51')]=function(_0x1e5888,_0x39395a,_0x359f9f){if(_0x1e5888[_0xebd5('0x4a')]['id']){delete _0x1e5888['body']['id'];}return db[_0xebd5('0x3e')][_0xebd5('0x4d')]({'where':{'id':_0x1e5888['params']['id']}})[_0xebd5('0x3f')](handleEntityNotFound(_0x39395a,null))[_0xebd5('0x3f')](function(_0x10f41f){if(_0x10f41f){_0x1e5888[_0xebd5('0x4a')][_0xebd5('0x52')]=_0x10f41f['id'];_0x1e5888['body'][_0xebd5('0x53')]=integrations[_0xebd5('0x54')](_0x1e5888[_0xebd5('0x4a')][_0xebd5('0x55')],_0x1e5888['body'][_0xebd5('0x2e')]);_0x1e5888[_0xebd5('0x4a')][_0xebd5('0x56')]=integrations[_0xebd5('0x57')](_0x1e5888[_0xebd5('0x4a')][_0xebd5('0x55')],_0x1e5888[_0xebd5('0x4a')][_0xebd5('0x2e')]);return db['VtigerConfiguration'][_0xebd5('0x49')](_0x1e5888[_0xebd5('0x4a')],{'include':[{'model':db[_0xebd5('0x58')],'as':_0xebd5('0x53')},{'model':db[_0xebd5('0x58')],'as':_0xebd5('0x56')}]});}return null;})[_0xebd5('0x3f')](respondWithResult(_0x39395a,null))[_0xebd5('0x43')](handleError(_0x39395a,null));};var md5=require('md5');exports['getFields']=function(_0x3cd326,_0x158766,_0xfa9580){var _0x2cb318=null;var _0x2461db=null;var _0x51e075=null;var _0x2cda0b=null;var _0x1065da='';return db[_0xebd5('0x3e')]['findOne']({'where':{'id':_0x3cd326['params']['id']},'attributes':['id',_0xebd5('0x29'),_0xebd5('0x59'),_0xebd5('0x5a'),_0xebd5('0x5b'),_0xebd5('0x5c'),'serverUrl',_0xebd5('0x5d')]})[_0xebd5('0x3f')](handleEntityNotFound(_0x158766,null))[_0xebd5('0x3f')](function(_0x484215){if(_0x484215){_0x2cb318=_0x484215[_0xebd5('0x59')];_0x2461db=_0x484215[_0xebd5('0x5d')];_0x51e075=_0x484215[_0xebd5('0x5b')];_0x1065da=_0x484215[_0xebd5('0x5c')];var _0x575bec=_0x1065da['slice'](-0x1);if(_0x575bec==='/'){_0x1065da=_0x1065da['substring'](0x0,_0x1065da[_0xebd5('0x5e')](_0x575bec));}_0x2cda0b=util[_0xebd5('0x5f')](_0xebd5('0x60'),_0x1065da);var _0x1047d4={'method':'GET','uri':_0x2cda0b,'qs':{'operation':_0xebd5('0x61'),'username':_0x484215[_0xebd5('0x59')]},'json':!![]};return rp(_0x1047d4);}})[_0xebd5('0x3f')](function(_0x3d00e3){if(_0x3d00e3[_0xebd5('0x62')]){var _0x56cb17={'method':_0xebd5('0x63'),'uri':_0x2cda0b,'form':{'operation':'login','username':_0x2cb318,'accessKey':md5(_0x3d00e3[_0xebd5('0x64')][_0xebd5('0x65')]+_0x2461db)},'json':!![]};return rp(_0x56cb17);}})['then'](function(_0x3ff1e5){if(_0x3ff1e5['success']){var _0x5320cd={'method':_0xebd5('0x66'),'uri':_0x2cda0b,'qs':{'operation':_0xebd5('0x67'),'username':_0x2cb318,'sessionName':_0x3ff1e5['result']['sessionName'],'elementType':_0x51e075},'json':!![]};return rp(_0x5320cd);}})[_0xebd5('0x3f')](function(_0x487c19){if(_0x487c19[_0xebd5('0x62')]){var _0x109a2e=[_0xebd5('0x68'),_0xebd5('0x69'),'owner'];_[_0xebd5('0x6a')](_0x487c19[_0xebd5('0x64')][_0xebd5('0x47')],function(_0xb9f5bd){return _0x109a2e[_0xebd5('0x6b')](_0xb9f5bd[_0xebd5('0x2e')][_0xebd5('0x29')]);});_['remove'](_0x487c19['result'][_0xebd5('0x47')],function(_0x551717){return _0x551717[_0xebd5('0x6c')]===_0xebd5('0x6d');});return{'count':_0x487c19[_0xebd5('0x64')][_0xebd5('0x47')][_0xebd5('0x35')],'rows':_['map'](_0x487c19[_0xebd5('0x64')][_0xebd5('0x47')],function(_0x5dbcd4){return{'id':_0x5dbcd4[_0xebd5('0x29')],'name':_0x5dbcd4[_0xebd5('0x6e')],'custom':_[_0xebd5('0x6f')](_0x5dbcd4[_0xebd5('0x29')],_0xebd5('0x70'))?!![]:![],'options':_0x5dbcd4['type']['name']===_0xebd5('0x71')&&_0x5dbcd4[_0xebd5('0x2e')][_0xebd5('0x72')][_0xebd5('0x35')]>0x0?_[_0xebd5('0x2b')](_0x5dbcd4[_0xebd5('0x2e')][_0xebd5('0x72')],function(_0x2a1a85){return{'name':_0x2a1a85[_0xebd5('0x6e')],'value':_0x2a1a85[_0xebd5('0x73')]};}):[]};})};}})[_0xebd5('0x3f')](respondWithResult(_0x158766,null))['catch'](function(_0x1c1b9e){console[_0xebd5('0x74')]('vTiger\x20error:\x20'+_0x1c1b9e);var _0x5521d6=_0x3cd326[_0xebd5('0x31')]['test']?0x1f4:_0x1c1b9e[_0xebd5('0x75')]||0x1f4;logger[_0xebd5('0x27')](_0xebd5('0x76'),'getFields',_0x5521d6,JSON['stringify'](_0x1c1b9e));delete _0x1c1b9e[_0xebd5('0x29')];if(_0x5521d6===0x191){_0x5521d6=0x190;}_0x158766[_0xebd5('0x19')](_0x5521d6)[_0xebd5('0x77')](_0x3cd326['query']['test']?{'message':_0xebd5('0x78'),'statusCode':_0x1c1b9e['statusCode']}:_0x1c1b9e);});}; \ No newline at end of file +var _0x3292=['sessionName','autogenerated','reference','owner','remove','false','label','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','apply','update','then','destroy','error','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','filter','addConfiguration','AccountId','getSubjects','getDescriptions','channel','VtigerField','Subjects','Descriptions','md5','getFields','username','description','moduleName','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','token','describe','result'];(function(_0x4a622d,_0x2b757d){var _0x144700=function(_0x498c75){while(--_0x498c75){_0x4a622d['push'](_0x4a622d['shift']());}};_0x144700(++_0x2b757d);}(_0x3292,0xfe));var _0x2329=function(_0x38f6a1,_0x46c4b3){_0x38f6a1=_0x38f6a1-0x0;var _0x329e70=_0x3292[_0x38f6a1];return _0x329e70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2329('0x0'));var zipdir=require(_0x2329('0x1'));var jsonpatch=require(_0x2329('0x2'));var rp=require(_0x2329('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2329('0x4'));var util=require(_0x2329('0x5'));var path=require(_0x2329('0x6'));var sox=require('sox');var csv=require(_0x2329('0x7'));var ejs=require(_0x2329('0x8'));var fs=require('fs');var fs_extra=require(_0x2329('0x9'));var _=require(_0x2329('0xa'));var squel=require(_0x2329('0xb'));var crypto=require(_0x2329('0xc'));var jsforce=require(_0x2329('0xd'));var deskjs=require(_0x2329('0xe'));var toCsv=require(_0x2329('0x7'));var querystring=require(_0x2329('0xf'));var Papa=require(_0x2329('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2329('0x11'));var hardwareService=require(_0x2329('0x12'));var logger=require('../../config/logger')(_0x2329('0x13'));var utils=require(_0x2329('0x14'));var config=require(_0x2329('0x15'));var licenseUtil=require(_0x2329('0x16'));var db=require(_0x2329('0x17'))['db'];var integrations=require(_0x2329('0x18'));function respondWithStatusCode(_0x164fab,_0xb6c9c){_0xb6c9c=_0xb6c9c||0xcc;return function(_0x2f4798){if(_0x2f4798){return _0x164fab[_0x2329('0x19')](_0xb6c9c);}return _0x164fab[_0x2329('0x1a')](_0xb6c9c)[_0x2329('0x1b')]();};}function respondWithResult(_0x382b16,_0x570c5c){_0x570c5c=_0x570c5c||0xc8;return function(_0x235ee2){if(_0x235ee2){return _0x382b16['status'](_0x570c5c)[_0x2329('0x1c')](_0x235ee2);}};}function respondWithFilteredResult(_0x3a683e,_0x422db0){return function(_0x3db717){if(_0x3db717){var _0x29770a=typeof _0x422db0[_0x2329('0x1d')]===_0x2329('0x1e')&&typeof _0x422db0[_0x2329('0x1f')]==='undefined';var _0x8ba697=_0x3db717[_0x2329('0x20')];var _0x4b0643=_0x29770a?0x0:_0x422db0['offset'];var _0x39c588=_0x29770a?_0x3db717[_0x2329('0x20')]:_0x422db0[_0x2329('0x1d')]+_0x422db0[_0x2329('0x1f')];var _0xe72862;if(_0x39c588>=_0x8ba697){_0x39c588=_0x8ba697;_0xe72862=0xc8;}else{_0xe72862=0xce;}_0x3a683e[_0x2329('0x1a')](_0xe72862);return _0x3a683e['set']('Content-Range',_0x4b0643+'-'+_0x39c588+'/'+_0x8ba697)[_0x2329('0x1c')](_0x3db717);}return null;};}function patchUpdates(_0x530859){return function(_0xf94d02){try{jsonpatch[_0x2329('0x21')](_0xf94d02,_0x530859,!![]);}catch(_0x2d15bb){return BPromise['reject'](_0x2d15bb);}return _0xf94d02['save']();};}function saveUpdates(_0x5d04c5,_0x4fc9eb){return function(_0x3439b4){if(_0x3439b4){return _0x3439b4[_0x2329('0x22')](_0x5d04c5)[_0x2329('0x23')](function(_0x59916b){return _0x59916b;});}return null;};}function removeEntity(_0xc195f2,_0xb52a4d){return function(_0xa5f457){if(_0xa5f457){return _0xa5f457[_0x2329('0x24')]()['then'](function(){_0xc195f2[_0x2329('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cedbc,_0x175b4d){return function(_0x5bf403){if(!_0x5bf403){_0x4cedbc['sendStatus'](0x194);}return _0x5bf403;};}function handleError(_0x3f37a5,_0x5474b7){_0x5474b7=_0x5474b7||0x1f4;return function(_0x1305f5){logger[_0x2329('0x25')](_0x1305f5['stack']);if(_0x1305f5[_0x2329('0x26')]){delete _0x1305f5['name'];}_0x3f37a5[_0x2329('0x1a')](_0x5474b7)[_0x2329('0x27')](_0x1305f5);};}exports[_0x2329('0x28')]=function(_0xfa9a7,_0x26db7c){var _0x5b43fe={},_0xd69bd5={},_0x2edcd3={'count':0x0,'rows':[]};var _0x37061b=_['map'](db[_0x2329('0x29')][_0x2329('0x2a')],function(_0x15fc7b){return{'name':_0x15fc7b[_0x2329('0x2b')],'type':_0x15fc7b[_0x2329('0x2c')]['key']};});_0xd69bd5[_0x2329('0x2d')]=_[_0x2329('0x2e')](_0x37061b,'name');_0xd69bd5[_0x2329('0x2f')]=_[_0x2329('0x30')](_0xfa9a7[_0x2329('0x2f')]);_0xd69bd5[_0x2329('0x31')]=_[_0x2329('0x32')](_0xd69bd5[_0x2329('0x2d')],_0xd69bd5[_0x2329('0x2f')]);_0x5b43fe[_0x2329('0x33')]=_['intersection'](_0xd69bd5[_0x2329('0x2d')],qs[_0x2329('0x34')](_0xfa9a7[_0x2329('0x2f')][_0x2329('0x34')]));_0x5b43fe[_0x2329('0x33')]=_0x5b43fe['attributes'][_0x2329('0x35')]?_0x5b43fe['attributes']:_0xd69bd5['model'];if(!_0xfa9a7['query'][_0x2329('0x36')](_0x2329('0x37'))){_0x5b43fe[_0x2329('0x1f')]=qs[_0x2329('0x1f')](_0xfa9a7[_0x2329('0x2f')][_0x2329('0x1f')]);_0x5b43fe[_0x2329('0x1d')]=qs[_0x2329('0x1d')](_0xfa9a7['query'][_0x2329('0x1d')]);}_0x5b43fe[_0x2329('0x38')]=qs[_0x2329('0x39')](_0xfa9a7[_0x2329('0x2f')][_0x2329('0x39')]);_0x5b43fe[_0x2329('0x3a')]=qs[_0x2329('0x31')](_['pick'](_0xfa9a7['query'],_0xd69bd5['filters']),_0x37061b);if(_0xfa9a7[_0x2329('0x2f')]['filter']){_0x5b43fe[_0x2329('0x3a')]=_[_0x2329('0x3b')](_0x5b43fe[_0x2329('0x3a')],{'$or':_[_0x2329('0x2e')](_0x37061b,function(_0x73e68a){if(_0x73e68a[_0x2329('0x2c')]!==_0x2329('0x3c')){var _0x1489b8={};_0x1489b8[_0x73e68a[_0x2329('0x26')]]={'$like':'%'+_0xfa9a7['query']['filter']+'%'};return _0x1489b8;}})});}_0x5b43fe=_[_0x2329('0x3b')]({},_0x5b43fe,_0xfa9a7[_0x2329('0x3d')]);var _0x189d44={'where':_0x5b43fe[_0x2329('0x3a')]};return db[_0x2329('0x29')]['count'](_0x189d44)[_0x2329('0x23')](function(_0x305ac7){_0x2edcd3['count']=_0x305ac7;if(_0xfa9a7[_0x2329('0x2f')][_0x2329('0x3e')]){_0x5b43fe[_0x2329('0x3f')]=[{'all':!![]}];}return db['VtigerAccount'][_0x2329('0x40')](_0x5b43fe);})[_0x2329('0x23')](function(_0x45ed4c){_0x2edcd3[_0x2329('0x41')]=_0x45ed4c;return _0x2edcd3;})[_0x2329('0x23')](respondWithFilteredResult(_0x26db7c,_0x5b43fe))[_0x2329('0x42')](handleError(_0x26db7c,null));};exports[_0x2329('0x43')]=function(_0x1becaf,_0x41b70c){var _0x2ad306={'raw':![],'where':{'id':_0x1becaf[_0x2329('0x44')]['id']}},_0x32a643={};_0x32a643[_0x2329('0x2d')]=_[_0x2329('0x30')](db[_0x2329('0x29')]['rawAttributes']);_0x32a643[_0x2329('0x2f')]=_[_0x2329('0x30')](_0x1becaf['query']);_0x32a643['filters']=_[_0x2329('0x32')](_0x32a643[_0x2329('0x2d')],_0x32a643[_0x2329('0x2f')]);_0x2ad306['attributes']=_[_0x2329('0x32')](_0x32a643[_0x2329('0x2d')],qs['fields'](_0x1becaf[_0x2329('0x2f')][_0x2329('0x34')]));_0x2ad306[_0x2329('0x33')]=_0x2ad306[_0x2329('0x33')][_0x2329('0x35')]?_0x2ad306['attributes']:_0x32a643[_0x2329('0x2d')];if(_0x1becaf[_0x2329('0x2f')]['includeAll']){_0x2ad306['include']=[{'all':!![]}];}_0x2ad306=_[_0x2329('0x3b')]({},_0x2ad306,_0x1becaf[_0x2329('0x3d')]);return db[_0x2329('0x29')][_0x2329('0x45')](_0x2ad306)[_0x2329('0x23')](handleEntityNotFound(_0x41b70c,null))[_0x2329('0x23')](respondWithResult(_0x41b70c,null))[_0x2329('0x42')](handleError(_0x41b70c,null));};exports[_0x2329('0x46')]=function(_0x297a67,_0x2f819c){return db[_0x2329('0x29')][_0x2329('0x46')](_0x297a67[_0x2329('0x47')],{})[_0x2329('0x23')](respondWithResult(_0x2f819c,0xc9))['catch'](handleError(_0x2f819c,null));};exports[_0x2329('0x22')]=function(_0x26a6d9,_0x3f5756){if(_0x26a6d9[_0x2329('0x47')]['id']){delete _0x26a6d9[_0x2329('0x47')]['id'];}return db[_0x2329('0x29')][_0x2329('0x45')]({'where':{'id':_0x26a6d9[_0x2329('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f5756,null))['then'](saveUpdates(_0x26a6d9['body'],null))[_0x2329('0x23')](respondWithResult(_0x3f5756,null))['catch'](handleError(_0x3f5756,null));};exports[_0x2329('0x24')]=function(_0x1dc380,_0x46708a){return db[_0x2329('0x29')][_0x2329('0x45')]({'where':{'id':_0x1dc380[_0x2329('0x44')]['id']}})[_0x2329('0x23')](handleEntityNotFound(_0x46708a,null))['then'](removeEntity(_0x46708a,null))['catch'](handleError(_0x46708a,null));};exports[_0x2329('0x48')]=function(_0x460a10,_0x41677,_0x47de75){var _0x1a7cc4={};var _0x4268a0={};var _0x311105;var _0x284668;return db['VtigerAccount'][_0x2329('0x49')]({'where':{'id':_0x460a10[_0x2329('0x44')]['id']}})[_0x2329('0x23')](handleEntityNotFound(_0x41677,null))[_0x2329('0x23')](function(_0x4518bc){if(_0x4518bc){_0x311105=_0x4518bc;_0x4268a0['model']=_[_0x2329('0x30')](db[_0x2329('0x4a')][_0x2329('0x2a')]);_0x4268a0[_0x2329('0x2f')]=_[_0x2329('0x30')](_0x460a10[_0x2329('0x2f')]);_0x4268a0[_0x2329('0x31')]=_['intersection'](_0x4268a0[_0x2329('0x2d')],_0x4268a0[_0x2329('0x2f')]);_0x1a7cc4['attributes']=_[_0x2329('0x32')](_0x4268a0[_0x2329('0x2d')],qs[_0x2329('0x34')](_0x460a10['query'][_0x2329('0x34')]));_0x1a7cc4[_0x2329('0x33')]=_0x1a7cc4[_0x2329('0x33')]['length']?_0x1a7cc4[_0x2329('0x33')]:_0x4268a0[_0x2329('0x2d')];_0x1a7cc4[_0x2329('0x38')]=qs['sort'](_0x460a10['query'][_0x2329('0x39')]);_0x1a7cc4[_0x2329('0x3a')]=qs[_0x2329('0x31')](_['pick'](_0x460a10[_0x2329('0x2f')],_0x4268a0[_0x2329('0x31')]));if(_0x460a10[_0x2329('0x2f')][_0x2329('0x4b')]){_0x1a7cc4[_0x2329('0x3a')]=_[_0x2329('0x3b')](_0x1a7cc4['where'],{'$or':_[_0x2329('0x2e')](_0x1a7cc4[_0x2329('0x33')],function(_0x4144d6){var _0xc568eb={};_0xc568eb[_0x4144d6]={'$like':'%'+_0x460a10[_0x2329('0x2f')][_0x2329('0x4b')]+'%'};return _0xc568eb;})});}_0x1a7cc4=_[_0x2329('0x3b')]({},_0x1a7cc4,_0x460a10['options']);return _0x311105[_0x2329('0x48')](_0x1a7cc4);}})[_0x2329('0x23')](function(_0x10bf99){if(_0x10bf99){_0x284668=_0x10bf99[_0x2329('0x35')];if(!_0x460a10[_0x2329('0x2f')][_0x2329('0x36')](_0x2329('0x37'))){_0x1a7cc4[_0x2329('0x1f')]=qs[_0x2329('0x1f')](_0x460a10[_0x2329('0x2f')][_0x2329('0x1f')]);_0x1a7cc4[_0x2329('0x1d')]=qs[_0x2329('0x1d')](_0x460a10['query'][_0x2329('0x1d')]);}return _0x311105['getConfigurations'](_0x1a7cc4);}})[_0x2329('0x23')](function(_0x4ce84f){if(_0x4ce84f){return _0x4ce84f?{'count':_0x284668,'rows':_0x4ce84f}:null;}})[_0x2329('0x23')](respondWithResult(_0x41677,null))[_0x2329('0x42')](handleError(_0x41677,null));};exports[_0x2329('0x4c')]=function(_0x1c37e1,_0x271c65,_0x3f1dc1){if(_0x1c37e1[_0x2329('0x47')]['id']){delete _0x1c37e1['body']['id'];}return db[_0x2329('0x29')][_0x2329('0x49')]({'where':{'id':_0x1c37e1['params']['id']}})[_0x2329('0x23')](handleEntityNotFound(_0x271c65,null))['then'](function(_0xb968fb){if(_0xb968fb){_0x1c37e1['body'][_0x2329('0x4d')]=_0xb968fb['id'];_0x1c37e1[_0x2329('0x47')]['Subjects']=integrations[_0x2329('0x4e')](_0x1c37e1[_0x2329('0x47')]['channel'],_0x1c37e1['body'][_0x2329('0x2c')]);_0x1c37e1['body']['Descriptions']=integrations[_0x2329('0x4f')](_0x1c37e1['body'][_0x2329('0x50')],_0x1c37e1[_0x2329('0x47')][_0x2329('0x2c')]);return db[_0x2329('0x4a')][_0x2329('0x46')](_0x1c37e1[_0x2329('0x47')],{'include':[{'model':db[_0x2329('0x51')],'as':_0x2329('0x52')},{'model':db[_0x2329('0x51')],'as':_0x2329('0x53')}]});}return null;})[_0x2329('0x23')](respondWithResult(_0x271c65,null))['catch'](handleError(_0x271c65,null));};var md5=require(_0x2329('0x54'));exports[_0x2329('0x55')]=function(_0x55c12d,_0x475515,_0x50efd8){var _0x149a05=null;var _0x2b4f66=null;var _0x3036ba=null;var _0x47e506=null;var _0x349622='';return db[_0x2329('0x29')][_0x2329('0x49')]({'where':{'id':_0x55c12d[_0x2329('0x44')]['id']},'attributes':['id',_0x2329('0x26'),_0x2329('0x56'),_0x2329('0x57'),_0x2329('0x58'),'remoteUri',_0x2329('0x59'),'accessKey']})[_0x2329('0x23')](handleEntityNotFound(_0x475515,null))[_0x2329('0x23')](function(_0x4ee613){if(_0x4ee613){_0x149a05=_0x4ee613[_0x2329('0x56')];_0x2b4f66=_0x4ee613['accessKey'];_0x3036ba=_0x4ee613[_0x2329('0x58')];_0x349622=_0x4ee613[_0x2329('0x5a')];var _0x650f9b=_0x349622[_0x2329('0x5b')](-0x1);if(_0x650f9b==='/'){_0x349622=_0x349622[_0x2329('0x5c')](0x0,_0x349622[_0x2329('0x5d')](_0x650f9b));}_0x47e506=util[_0x2329('0x5e')](_0x2329('0x5f'),_0x349622);var _0x2408ee={'method':_0x2329('0x60'),'uri':_0x47e506,'qs':{'operation':'getchallenge','username':_0x4ee613[_0x2329('0x56')]},'json':!![]};return rp(_0x2408ee);}})[_0x2329('0x23')](function(_0xc8aa5d){if(_0xc8aa5d[_0x2329('0x61')]){var _0x5c6784={'method':_0x2329('0x62'),'uri':_0x47e506,'form':{'operation':_0x2329('0x63'),'username':_0x149a05,'accessKey':md5(_0xc8aa5d['result'][_0x2329('0x64')]+_0x2b4f66)},'json':!![]};return rp(_0x5c6784);}})[_0x2329('0x23')](function(_0x5c3de5){if(_0x5c3de5[_0x2329('0x61')]){var _0x2f2930={'method':_0x2329('0x60'),'uri':_0x47e506,'qs':{'operation':_0x2329('0x65'),'username':_0x149a05,'sessionName':_0x5c3de5[_0x2329('0x66')][_0x2329('0x67')],'elementType':_0x3036ba},'json':!![]};return rp(_0x2f2930);}})['then'](function(_0x4a40c0){if(_0x4a40c0[_0x2329('0x61')]){var _0x17a98a=[_0x2329('0x68'),_0x2329('0x69'),_0x2329('0x6a')];_[_0x2329('0x6b')](_0x4a40c0[_0x2329('0x66')][_0x2329('0x34')],function(_0x96d3a7){return _0x17a98a['includes'](_0x96d3a7[_0x2329('0x2c')][_0x2329('0x26')]);});_[_0x2329('0x6b')](_0x4a40c0[_0x2329('0x66')][_0x2329('0x34')],function(_0x3e2a1d){return _0x3e2a1d['editable']===_0x2329('0x6c');});return{'count':_0x4a40c0[_0x2329('0x66')][_0x2329('0x34')][_0x2329('0x35')],'rows':_[_0x2329('0x2e')](_0x4a40c0[_0x2329('0x66')][_0x2329('0x34')],function(_0x59e416){return{'id':_0x59e416[_0x2329('0x26')],'name':_0x59e416[_0x2329('0x6d')],'custom':_['startsWith'](_0x59e416[_0x2329('0x26')],_0x2329('0x6e'))?!![]:![],'options':_0x59e416[_0x2329('0x2c')][_0x2329('0x26')]===_0x2329('0x6f')&&_0x59e416[_0x2329('0x2c')][_0x2329('0x70')][_0x2329('0x35')]>0x0?_[_0x2329('0x2e')](_0x59e416[_0x2329('0x2c')][_0x2329('0x70')],function(_0x20d123){return{'name':_0x20d123[_0x2329('0x6d')],'value':_0x20d123['value']};}):[]};})};}})[_0x2329('0x23')](respondWithResult(_0x475515,null))[_0x2329('0x42')](function(_0x32530a){console[_0x2329('0x71')](_0x2329('0x72')+_0x32530a);var _0x3e26df=_0x55c12d['query']['test']?0x1f4:_0x32530a[_0x2329('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2329('0x55'),_0x3e26df,JSON[_0x2329('0x74')](_0x32530a));delete _0x32530a[_0x2329('0x26')];if(_0x3e26df===0x191){_0x3e26df=0x190;}_0x475515[_0x2329('0x1a')](_0x3e26df)[_0x2329('0x27')](_0x55c12d['query'][_0x2329('0x75')]?{'message':_0x2329('0x76'),'statusCode':_0x32530a[_0x2329('0x73')]}:_0x32530a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6c2b6bb..d273565 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 _0x8324=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger'];(function(_0x4db409,_0x3ddc95){var _0x54b56a=function(_0x4afa6d){while(--_0x4afa6d){_0x4db409['push'](_0x4db409['shift']());}};_0x54b56a(++_0x3ddc95);}(_0x8324,0x1ab));var _0x4832=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x8324[_0x193e28];return _0x20ef59;};'use strict';var _=require(_0x4832('0x0'));var util=require('util');var logger=require(_0x4832('0x1'))('api');var moment=require(_0x4832('0x2'));var BPromise=require(_0x4832('0x3'));var rp=require(_0x4832('0x4'));var fs=require('fs');var path=require(_0x4832('0x5'));var rimraf=require(_0x4832('0x6'));var config=require(_0x4832('0x7'));var attributes=require(_0x4832('0x8'));var integrations=require(_0x4832('0x9'));module['exports']=function(_0x193911,_0x5d6d3f){return _0x193911[_0x4832('0xa')](_0x4832('0xb'),attributes,{'tableName':_0x4832('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4d1=['../../config/logger','api','bluebird','request-promise','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util'];(function(_0x4349dc,_0x61c055){var _0x28a88d=function(_0x1f8aa8){while(--_0x1f8aa8){_0x4349dc['push'](_0x4349dc['shift']());}};_0x28a88d(++_0x61c055);}(_0xa4d1,0x13e));var _0x1a4d=function(_0x3610f1,_0x4112a2){_0x3610f1=_0x3610f1-0x0;var _0x115942=_0xa4d1[_0x3610f1];return _0x115942;};'use strict';var _=require('lodash');var util=require(_0x1a4d('0x0'));var logger=require(_0x1a4d('0x1'))(_0x1a4d('0x2'));var moment=require('moment');var BPromise=require(_0x1a4d('0x3'));var rp=require(_0x1a4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a4d('0x5'));var attributes=require(_0x1a4d('0x6'));var integrations=require(_0x1a4d('0x7'));module['exports']=function(_0x5cea6d,_0x2e9965){return _0x5cea6d[_0x1a4d('0x8')](_0x1a4d('0x9'),attributes,{'tableName':_0x1a4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 86d58ed..ed9e932 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 _0xeb74=['attributes','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map'];(function(_0x27d18e,_0x5b5383){var _0x333597=function(_0x5078e5){while(--_0x5078e5){_0x27d18e['push'](_0x27d18e['shift']());}};_0x333597(++_0x5b5383);}(_0xeb74,0xe3));var _0x4eb7=function(_0x1b370f,_0x278cae){_0x1b370f=_0x1b370f-0x0;var _0x117cb2=_0xeb74[_0x1b370f];return _0x117cb2;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')]({'raw':_0x3b6d41['options']?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')]['attributes']||null:null,'limit':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1d')]||null:null,'include':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0x13e871){return{'model':db[_0x13e871['model']],'as':_0x13e871['as'],'attributes':_0x13e871[_0x4eb7('0x20')],'include':_0x13e871[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x13e871[_0x4eb7('0x1e')],function(_0x3e0da2){return{'model':db[_0x3e0da2[_0x4eb7('0x21')]],'as':_0x3e0da2['as'],'attributes':_0x3e0da2[_0x4eb7('0x20')],'include':_0x3e0da2[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3e0da2[_0x4eb7('0x1e')],function(_0xf83c11){return{'model':db[_0xf83c11[_0x4eb7('0x21')]],'as':_0xf83c11['as'],'attributes':_0xf83c11[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x433794){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger[_0x4eb7('0xe')](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x22')](_0x433794));_0x302e16(_0x433794);})[_0x4eb7('0x16')](function(_0x17030a){logger[_0x4eb7('0x11')]('GetVtigerAccount',_0x17030a[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478['error'](0x1f4,_0x17030a[_0x4eb7('0x13')]));});});};exports[_0x4eb7('0x23')]=function(_0xc5aa21){var _0x1fe298=this;return new Promise(function(_0x468195,_0x1cec8e){return db[_0x4eb7('0x18')][_0x4eb7('0x24')]({'raw':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21['options'][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5aa21['options']?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0xc5aa21['options']?_0xc5aa21['options'][_0x4eb7('0x20')]||null:null,'include':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_['map'](_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0xcc9bb4){return{'model':db[_0xcc9bb4[_0x4eb7('0x21')]],'as':_0xcc9bb4['as'],'attributes':_0xcc9bb4[_0x4eb7('0x20')],'include':_0xcc9bb4['include']?_[_0x4eb7('0x1f')](_0xcc9bb4[_0x4eb7('0x1e')],function(_0x31cc6d){return{'model':db[_0x31cc6d['model']],'as':_0x31cc6d['as'],'attributes':_0x31cc6d[_0x4eb7('0x20')],'include':_0x31cc6d[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x31cc6d['include'],function(_0x70f2b2){return{'model':db[_0x70f2b2['model']],'as':_0x70f2b2['as'],'attributes':_0x70f2b2[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x392fa3){logger[_0x4eb7('0x14')]('ShowVtigerAccount',_0xc5aa21);logger[_0x4eb7('0xe')](_0x4eb7('0x23'),_0xc5aa21,JSON[_0x4eb7('0x22')](_0x392fa3));_0x468195(_0x392fa3);})[_0x4eb7('0x16')](function(_0x4f0cce){logger['error']('ShowVtigerAccount',_0x4f0cce[_0x4eb7('0x13')],_0xc5aa21);_0x1cec8e(_0x1fe298[_0x4eb7('0x11')](0x1f4,_0x4f0cce[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0x96cc=['model','map','debug','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x5a1b6b,_0x320036){var _0xca9688=function(_0x315cb0){while(--_0x315cb0){_0x5a1b6b['push'](_0x5a1b6b['shift']());}};_0xca9688(++_0x320036);}(_0x96cc,0x16c));var _0xc96c=function(_0x3fd0f3,_0x5763c6){_0x3fd0f3=_0x3fd0f3-0x0;var _0x4df1e9=_0x96cc[_0x3fd0f3];return _0x4df1e9;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')]({'raw':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1c')]||null:null,'attributes':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'limit':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1e')]||null:null,'include':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')]?_['map'](_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')],function(_0x4456bf){return{'model':db[_0x4456bf[_0xc96c('0x20')]],'as':_0x4456bf['as'],'attributes':_0x4456bf[_0xc96c('0x1d')],'include':_0x4456bf[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4456bf[_0xc96c('0x1f')],function(_0x1a77df){return{'model':db[_0x1a77df[_0xc96c('0x20')]],'as':_0x1a77df['as'],'attributes':_0x1a77df['attributes'],'include':_0x1a77df[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x1a77df[_0xc96c('0x1f')],function(_0x294fee){return{'model':db[_0x294fee['model']],'as':_0x294fee['as'],'attributes':_0x294fee['attributes']};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x12c293){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x22')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x12c293));_0x2ae19a(_0x12c293);})[_0xc96c('0x16')](function(_0xa0efbc){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0xa0efbc[_0xc96c('0x14')],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0xa0efbc[_0xc96c('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x3aa436){var _0x53c994=this;return new Promise(function(_0x3f4b0e,_0x442c7f){return db[_0xc96c('0x18')]['find']({'raw':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436['options']['where']||null:null,'attributes':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'include':_0x3aa436['options']?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x3aa436[_0xc96c('0x1a')]['include'],function(_0x4132a9){return{'model':db[_0x4132a9[_0xc96c('0x20')]],'as':_0x4132a9['as'],'attributes':_0x4132a9['attributes'],'include':_0x4132a9[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4132a9[_0xc96c('0x1f')],function(_0x2d2595){return{'model':db[_0x2d2595[_0xc96c('0x20')]],'as':_0x2d2595['as'],'attributes':_0x2d2595[_0xc96c('0x1d')],'include':_0x2d2595['include']?_[_0xc96c('0x21')](_0x2d2595[_0xc96c('0x1f')],function(_0x15b68b){return{'model':db[_0x15b68b[_0xc96c('0x20')]],'as':_0x15b68b['as'],'attributes':_0x15b68b[_0xc96c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x52d4a2){logger['info'](_0xc96c('0x23'),_0x3aa436);logger[_0xc96c('0x22')]('ShowVtigerAccount',_0x3aa436,JSON['stringify'](_0x52d4a2));_0x3f4b0e(_0x52d4a2);})[_0xc96c('0x16')](function(_0x1df393){logger[_0xc96c('0x12')](_0xc96c('0x23'),_0x1df393[_0xc96c('0x14')],_0x3aa436);_0x442c7f(_0x53c994[_0xc96c('0x12')](0x1f4,_0x1df393[_0xc96c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 998688d..512351a 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 _0x61b8=['getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0x61b8,0x13e));var _0x861b=function(_0x311c2f,_0xba6cf4){_0x311c2f=_0x311c2f-0x0;var _0x384ae0=_0x61b8[_0x311c2f];return _0x384ae0;};'use strict';var multer=require(_0x861b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x861b('0x1'));var express=require(_0x861b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x861b('0x3'));var interaction=require(_0x861b('0x4'));var config=require(_0x861b('0x5'));var controller=require(_0x861b('0x6'));router[_0x861b('0x7')]('/',auth[_0x861b('0x8')](),controller[_0x861b('0x9')]);router[_0x861b('0x7')](_0x861b('0xa'),auth[_0x861b('0x8')](),controller['show']);router[_0x861b('0x7')](_0x861b('0xb'),auth[_0x861b('0x8')](),controller[_0x861b('0xc')]);router[_0x861b('0x7')](_0x861b('0xd'),auth['isAuthenticated'](),controller[_0x861b('0xe')]);router['get'](_0x861b('0xf'),auth[_0x861b('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x861b('0x8')](),controller[_0x861b('0x10')]);router[_0x861b('0x11')](_0x861b('0xa'),auth[_0x861b('0x8')](),controller[_0x861b('0x12')]);router[_0x861b('0x13')](_0x861b('0xa'),auth[_0x861b('0x8')](),controller[_0x861b('0x14')]);module[_0x861b('0x15')]=router; \ No newline at end of file +var _0x35a9=['get','index','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getDescriptions','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller'];(function(_0xb358eb,_0x1c49c8){var _0x486599=function(_0x4c5c32){while(--_0x4c5c32){_0xb358eb['push'](_0xb358eb['shift']());}};_0x486599(++_0x1c49c8);}(_0x35a9,0x16d));var _0x935a=function(_0x220cd8,_0x44584e){_0x220cd8=_0x220cd8-0x0;var _0xc09e00=_0x35a9[_0x220cd8];return _0xc09e00;};'use strict';var multer=require(_0x935a('0x0'));var util=require(_0x935a('0x1'));var path=require(_0x935a('0x2'));var timeout=require(_0x935a('0x3'));var express=require(_0x935a('0x4'));var router=express[_0x935a('0x5')]();var fs_extra=require(_0x935a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x935a('0x7'));var config=require('../../config/environment');var controller=require(_0x935a('0x8'));router[_0x935a('0x9')]('/',auth['isAuthenticated'](),controller[_0x935a('0xa')]);router[_0x935a('0x9')](_0x935a('0xb'),auth['isAuthenticated'](),controller[_0x935a('0xc')]);router[_0x935a('0x9')](_0x935a('0xd'),auth[_0x935a('0xe')](),controller['getFields']);router['get'](_0x935a('0xf'),auth[_0x935a('0xe')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x935a('0xe')](),controller[_0x935a('0x10')]);router['post']('/',auth[_0x935a('0xe')](),controller[_0x935a('0x11')]);router['put']('/:id',auth[_0x935a('0xe')](),controller[_0x935a('0x12')]);router[_0x935a('0x13')](_0x935a('0xb'),auth[_0x935a('0xe')](),controller[_0x935a('0x14')]);module[_0x935a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 823ced7..9bca823 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 _0x560e=['STRING','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x560e,0x184));var _0xe560=function(_0x34cd17,_0x19fadb){_0x34cd17=_0x34cd17-0x0;var _0x43b81a=_0x560e[_0x34cd17];return _0x43b81a;};'use strict';var Sequelize=require(_0xe560('0x0'));module[_0xe560('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe560('0x2')]}}; \ No newline at end of file +var _0x4d89=['sequelize','STRING'];(function(_0x3f37f5,_0x431e38){var _0x5c0aff=function(_0x3c0138){while(--_0x3c0138){_0x3f37f5['push'](_0x3f37f5['shift']());}};_0x5c0aff(++_0x431e38);}(_0x4d89,0x84));var _0x94d8=function(_0x4626ba,_0x3bf82){_0x4626ba=_0x4626ba-0x0;var _0x5d5565=_0x4d89[_0x4626ba];return _0x5d5565;};'use strict';var Sequelize=require(_0x94d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x94d8('0x1')]},'description':{'type':Sequelize[_0x94d8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index c6679a1..8ac8e88 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 _0x7e35=['type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VtigerConfiguration','includeAll','include','findAll','rows','show','params','keys','intersection','length','options','find','catch','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e35,0xcc));var _0x57e3=function(_0x77b99f,_0x91bbcc){_0x77b99f=_0x77b99f-0x0;var _0x8cb50d=_0x7e35[_0x77b99f];return _0x8cb50d;};'use strict';var emlformat=require(_0x57e3('0x0'));var rimraf=require(_0x57e3('0x1'));var zipdir=require(_0x57e3('0x2'));var jsonpatch=require(_0x57e3('0x3'));var rp=require(_0x57e3('0x4'));var moment=require(_0x57e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x57e3('0x6'));var util=require(_0x57e3('0x7'));var path=require(_0x57e3('0x8'));var sox=require('sox');var csv=require(_0x57e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e3('0xa'));var _=require(_0x57e3('0xb'));var squel=require(_0x57e3('0xc'));var crypto=require(_0x57e3('0xd'));var jsforce=require(_0x57e3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x57e3('0x9'));var querystring=require(_0x57e3('0xf'));var Papa=require(_0x57e3('0x10'));var Redis=require('ioredis');var authService=require(_0x57e3('0x11'));var qs=require(_0x57e3('0x12'));var as=require(_0x57e3('0x13'));var hardwareService=require(_0x57e3('0x14'));var logger=require(_0x57e3('0x15'))('api');var utils=require(_0x57e3('0x16'));var config=require(_0x57e3('0x17'));var licenseUtil=require(_0x57e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba6d7,_0x5ebdfe){_0x5ebdfe=_0x5ebdfe||0xcc;return function(_0x12ada4){if(_0x12ada4){return _0x5ba6d7[_0x57e3('0x19')](_0x5ebdfe);}return _0x5ba6d7[_0x57e3('0x1a')](_0x5ebdfe)[_0x57e3('0x1b')]();};}function respondWithResult(_0xdd8457,_0x4ca7ce){_0x4ca7ce=_0x4ca7ce||0xc8;return function(_0x33a2e3){if(_0x33a2e3){return _0xdd8457[_0x57e3('0x1a')](_0x4ca7ce)[_0x57e3('0x1c')](_0x33a2e3);}};}function respondWithFilteredResult(_0x43436f,_0x19eb39){return function(_0x37a72d){if(_0x37a72d){var _0x210d67=typeof _0x19eb39[_0x57e3('0x1d')]===_0x57e3('0x1e')&&typeof _0x19eb39[_0x57e3('0x1f')]==='undefined';var _0x2e73e7=_0x37a72d[_0x57e3('0x20')];var _0x4b64c8=_0x210d67?0x0:_0x19eb39['offset'];var _0x5a4521=_0x210d67?_0x37a72d[_0x57e3('0x20')]:_0x19eb39[_0x57e3('0x1d')]+_0x19eb39[_0x57e3('0x1f')];var _0x1a3d7c;if(_0x5a4521>=_0x2e73e7){_0x5a4521=_0x2e73e7;_0x1a3d7c=0xc8;}else{_0x1a3d7c=0xce;}_0x43436f[_0x57e3('0x1a')](_0x1a3d7c);return _0x43436f[_0x57e3('0x21')]('Content-Range',_0x4b64c8+'-'+_0x5a4521+'/'+_0x2e73e7)[_0x57e3('0x1c')](_0x37a72d);}return null;};}function patchUpdates(_0x570242){return function(_0x3bf489){try{jsonpatch[_0x57e3('0x22')](_0x3bf489,_0x570242,!![]);}catch(_0x5e2703){return BPromise[_0x57e3('0x23')](_0x5e2703);}return _0x3bf489[_0x57e3('0x24')]();};}function saveUpdates(_0x52b8d0,_0x387744){return function(_0x29f44e){if(_0x29f44e){return _0x29f44e[_0x57e3('0x25')](_0x52b8d0)[_0x57e3('0x26')](function(_0x32c3f4){return _0x32c3f4;});}return null;};}function removeEntity(_0x5b440b,_0x5260bf){return function(_0x591eb4){if(_0x591eb4){return _0x591eb4[_0x57e3('0x27')]()[_0x57e3('0x26')](function(){_0x5b440b[_0x57e3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9fb4,_0x29558b){return function(_0x27f5f0){if(!_0x27f5f0){_0x1b9fb4['sendStatus'](0x194);}return _0x27f5f0;};}function handleError(_0x2609c9,_0x28eedf){_0x28eedf=_0x28eedf||0x1f4;return function(_0x4e1b45){logger[_0x57e3('0x28')](_0x4e1b45[_0x57e3('0x29')]);if(_0x4e1b45[_0x57e3('0x2a')]){delete _0x4e1b45[_0x57e3('0x2a')];}_0x2609c9[_0x57e3('0x1a')](_0x28eedf)[_0x57e3('0x2b')](_0x4e1b45);};}exports[_0x57e3('0x2c')]=function(_0x47e372,_0x4d2f09){var _0x3493b9={},_0x4b9301={},_0x4fa2ee={'count':0x0,'rows':[]};var _0x479d99=_[_0x57e3('0x2d')](db['VtigerConfiguration'][_0x57e3('0x2e')],function(_0x3941b1){return{'name':_0x3941b1[_0x57e3('0x2f')],'type':_0x3941b1[_0x57e3('0x30')][_0x57e3('0x31')]};});_0x4b9301[_0x57e3('0x32')]=_[_0x57e3('0x2d')](_0x479d99,_0x57e3('0x2a'));_0x4b9301[_0x57e3('0x33')]=_['keys'](_0x47e372[_0x57e3('0x33')]);_0x4b9301[_0x57e3('0x34')]=_['intersection'](_0x4b9301['model'],_0x4b9301[_0x57e3('0x33')]);_0x3493b9[_0x57e3('0x35')]=_['intersection'](_0x4b9301[_0x57e3('0x32')],qs['fields'](_0x47e372[_0x57e3('0x33')][_0x57e3('0x36')]));_0x3493b9[_0x57e3('0x35')]=_0x3493b9[_0x57e3('0x35')]['length']?_0x3493b9['attributes']:_0x4b9301[_0x57e3('0x32')];if(!_0x47e372['query'][_0x57e3('0x37')](_0x57e3('0x38'))){_0x3493b9['limit']=qs[_0x57e3('0x1f')](_0x47e372[_0x57e3('0x33')][_0x57e3('0x1f')]);_0x3493b9[_0x57e3('0x1d')]=qs[_0x57e3('0x1d')](_0x47e372[_0x57e3('0x33')]['offset']);}_0x3493b9['order']=qs[_0x57e3('0x39')](_0x47e372['query'][_0x57e3('0x39')]);_0x3493b9[_0x57e3('0x3a')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3b')](_0x47e372['query'],_0x4b9301[_0x57e3('0x34')]),_0x479d99);if(_0x47e372[_0x57e3('0x33')][_0x57e3('0x3c')]){_0x3493b9[_0x57e3('0x3a')]=_[_0x57e3('0x3d')](_0x3493b9[_0x57e3('0x3a')],{'$or':_[_0x57e3('0x2d')](_0x479d99,function(_0x3abcb8){if(_0x3abcb8['type']!==_0x57e3('0x3e')){var _0x4b2807={};_0x4b2807[_0x3abcb8[_0x57e3('0x2a')]]={'$like':'%'+_0x47e372['query'][_0x57e3('0x3c')]+'%'};return _0x4b2807;}})});}_0x3493b9=_['merge']({},_0x3493b9,_0x47e372['options']);var _0x4a7280={'where':_0x3493b9[_0x57e3('0x3a')]};return db[_0x57e3('0x3f')][_0x57e3('0x20')](_0x4a7280)[_0x57e3('0x26')](function(_0x2d85d1){_0x4fa2ee[_0x57e3('0x20')]=_0x2d85d1;if(_0x47e372[_0x57e3('0x33')][_0x57e3('0x40')]){_0x3493b9[_0x57e3('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x57e3('0x42')](_0x3493b9);})[_0x57e3('0x26')](function(_0x1b185e){_0x4fa2ee[_0x57e3('0x43')]=_0x1b185e;return _0x4fa2ee;})[_0x57e3('0x26')](respondWithFilteredResult(_0x4d2f09,_0x3493b9))['catch'](handleError(_0x4d2f09,null));};exports[_0x57e3('0x44')]=function(_0x55a0b1,_0x5dc53a){var _0x1c9bdb={'raw':![],'where':{'id':_0x55a0b1[_0x57e3('0x45')]['id']}},_0x189d3f={};_0x189d3f[_0x57e3('0x32')]=_[_0x57e3('0x46')](db['VtigerConfiguration'][_0x57e3('0x2e')]);_0x189d3f[_0x57e3('0x33')]=_[_0x57e3('0x46')](_0x55a0b1[_0x57e3('0x33')]);_0x189d3f['filters']=_[_0x57e3('0x47')](_0x189d3f[_0x57e3('0x32')],_0x189d3f[_0x57e3('0x33')]);_0x1c9bdb['attributes']=_[_0x57e3('0x47')](_0x189d3f['model'],qs[_0x57e3('0x36')](_0x55a0b1[_0x57e3('0x33')][_0x57e3('0x36')]));_0x1c9bdb['attributes']=_0x1c9bdb['attributes'][_0x57e3('0x48')]?_0x1c9bdb[_0x57e3('0x35')]:_0x189d3f[_0x57e3('0x32')];if(_0x55a0b1[_0x57e3('0x33')]['includeAll']){_0x1c9bdb[_0x57e3('0x41')]=[{'all':!![]}];}_0x1c9bdb=_['merge']({},_0x1c9bdb,_0x55a0b1[_0x57e3('0x49')]);return db[_0x57e3('0x3f')][_0x57e3('0x4a')](_0x1c9bdb)['then'](handleEntityNotFound(_0x5dc53a,null))[_0x57e3('0x26')](respondWithResult(_0x5dc53a,null))[_0x57e3('0x4b')](handleError(_0x5dc53a,null));};exports['create']=function(_0x1541ca,_0x5a6531){return db[_0x57e3('0x3f')][_0x57e3('0x4c')](_0x1541ca['body'],{})[_0x57e3('0x26')](respondWithResult(_0x5a6531,0xc9))[_0x57e3('0x4b')](handleError(_0x5a6531,null));};exports[_0x57e3('0x25')]=function(_0x30a9d5,_0x17dd07){if(_0x30a9d5[_0x57e3('0x4d')]['id']){delete _0x30a9d5[_0x57e3('0x4d')]['id'];}return db[_0x57e3('0x3f')][_0x57e3('0x4a')]({'where':{'id':_0x30a9d5[_0x57e3('0x45')]['id']}})[_0x57e3('0x26')](handleEntityNotFound(_0x17dd07,null))[_0x57e3('0x26')](saveUpdates(_0x30a9d5[_0x57e3('0x4d')],null))[_0x57e3('0x26')](respondWithResult(_0x17dd07,null))['catch'](handleError(_0x17dd07,null));};exports[_0x57e3('0x27')]=function(_0x169e14,_0x499dd2){return db['VtigerConfiguration']['find']({'where':{'id':_0x169e14[_0x57e3('0x45')]['id']}})[_0x57e3('0x26')](handleEntityNotFound(_0x499dd2,null))['then'](removeEntity(_0x499dd2,null))[_0x57e3('0x4b')](handleError(_0x499dd2,null));};exports[_0x57e3('0x4e')]=function(_0x5dcf8d,_0x2f5ae5,_0x4b9a81){var _0x5e0e70={};var _0x5f4f92={};var _0x1f41dd;var _0xfbe51c;return db[_0x57e3('0x3f')][_0x57e3('0x4f')]({'where':{'id':_0x5dcf8d[_0x57e3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f5ae5,null))[_0x57e3('0x26')](function(_0x3712af){if(_0x3712af){_0x1f41dd=_0x3712af;_0x5f4f92[_0x57e3('0x32')]=_[_0x57e3('0x46')](db[_0x57e3('0x50')]['rawAttributes']);_0x5f4f92[_0x57e3('0x33')]=_[_0x57e3('0x46')](_0x5dcf8d[_0x57e3('0x33')]);_0x5f4f92[_0x57e3('0x34')]=_[_0x57e3('0x47')](_0x5f4f92[_0x57e3('0x32')],_0x5f4f92['query']);_0x5e0e70[_0x57e3('0x35')]=_[_0x57e3('0x47')](_0x5f4f92[_0x57e3('0x32')],qs['fields'](_0x5dcf8d[_0x57e3('0x33')]['fields']));_0x5e0e70[_0x57e3('0x35')]=_0x5e0e70['attributes'][_0x57e3('0x48')]?_0x5e0e70[_0x57e3('0x35')]:_0x5f4f92[_0x57e3('0x32')];_0x5e0e70[_0x57e3('0x51')]=qs['sort'](_0x5dcf8d[_0x57e3('0x33')]['sort']);_0x5e0e70[_0x57e3('0x3a')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3b')](_0x5dcf8d[_0x57e3('0x33')],_0x5f4f92[_0x57e3('0x34')]));if(_0x5dcf8d[_0x57e3('0x33')][_0x57e3('0x3c')]){_0x5e0e70[_0x57e3('0x3a')]=_['merge'](_0x5e0e70['where'],{'$or':_['map'](_0x5e0e70[_0x57e3('0x35')],function(_0x95de06){var _0x183abb={};_0x183abb[_0x95de06]={'$like':'%'+_0x5dcf8d[_0x57e3('0x33')]['filter']+'%'};return _0x183abb;})});}_0x5e0e70=_[_0x57e3('0x3d')]({},_0x5e0e70,_0x5dcf8d['options']);return _0x1f41dd[_0x57e3('0x4e')](_0x5e0e70);}})['then'](function(_0x504f22){if(_0x504f22){_0xfbe51c=_0x504f22[_0x57e3('0x48')];if(!_0x5dcf8d[_0x57e3('0x33')]['hasOwnProperty'](_0x57e3('0x38'))){_0x5e0e70[_0x57e3('0x1f')]=qs[_0x57e3('0x1f')](_0x5dcf8d[_0x57e3('0x33')][_0x57e3('0x1f')]);_0x5e0e70[_0x57e3('0x1d')]=qs[_0x57e3('0x1d')](_0x5dcf8d['query']['offset']);}return _0x1f41dd[_0x57e3('0x4e')](_0x5e0e70);}})[_0x57e3('0x26')](function(_0x2f7e0d){if(_0x2f7e0d){return _0x2f7e0d?{'count':_0xfbe51c,'rows':_0x2f7e0d}:null;}})[_0x57e3('0x26')](respondWithResult(_0x2f5ae5,null))[_0x57e3('0x4b')](handleError(_0x2f5ae5,null));};exports[_0x57e3('0x52')]=function(_0x2f02c2,_0x50c443,_0x31fc4f){var _0x336371={};var _0x5b1a6c={};var _0x2c6eae;var _0x4ebd8f;return db[_0x57e3('0x3f')][_0x57e3('0x4f')]({'where':{'id':_0x2f02c2[_0x57e3('0x45')]['id']}})['then'](handleEntityNotFound(_0x50c443,null))[_0x57e3('0x26')](function(_0x1c0fae){if(_0x1c0fae){_0x2c6eae=_0x1c0fae;_0x5b1a6c[_0x57e3('0x32')]=_[_0x57e3('0x46')](db['VtigerField'][_0x57e3('0x2e')]);_0x5b1a6c[_0x57e3('0x33')]=_['keys'](_0x2f02c2['query']);_0x5b1a6c['filters']=_[_0x57e3('0x47')](_0x5b1a6c[_0x57e3('0x32')],_0x5b1a6c[_0x57e3('0x33')]);_0x336371['attributes']=_[_0x57e3('0x47')](_0x5b1a6c['model'],qs[_0x57e3('0x36')](_0x2f02c2[_0x57e3('0x33')][_0x57e3('0x36')]));_0x336371[_0x57e3('0x35')]=_0x336371[_0x57e3('0x35')]['length']?_0x336371[_0x57e3('0x35')]:_0x5b1a6c['model'];_0x336371[_0x57e3('0x51')]=qs['sort'](_0x2f02c2[_0x57e3('0x33')]['sort']);_0x336371[_0x57e3('0x3a')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3b')](_0x2f02c2[_0x57e3('0x33')],_0x5b1a6c[_0x57e3('0x34')]));if(_0x2f02c2[_0x57e3('0x33')][_0x57e3('0x3c')]){_0x336371['where']=_[_0x57e3('0x3d')](_0x336371['where'],{'$or':_[_0x57e3('0x2d')](_0x336371[_0x57e3('0x35')],function(_0x5606d7){var _0x1d12a4={};_0x1d12a4[_0x5606d7]={'$like':'%'+_0x2f02c2[_0x57e3('0x33')][_0x57e3('0x3c')]+'%'};return _0x1d12a4;})});}_0x336371=_[_0x57e3('0x3d')]({},_0x336371,_0x2f02c2[_0x57e3('0x49')]);return _0x2c6eae[_0x57e3('0x52')](_0x336371);}})[_0x57e3('0x26')](function(_0x2f3948){if(_0x2f3948){_0x4ebd8f=_0x2f3948[_0x57e3('0x48')];if(!_0x2f02c2['query'][_0x57e3('0x37')](_0x57e3('0x38'))){_0x336371[_0x57e3('0x1f')]=qs[_0x57e3('0x1f')](_0x2f02c2[_0x57e3('0x33')]['limit']);_0x336371[_0x57e3('0x1d')]=qs[_0x57e3('0x1d')](_0x2f02c2[_0x57e3('0x33')][_0x57e3('0x1d')]);}return _0x2c6eae[_0x57e3('0x52')](_0x336371);}})[_0x57e3('0x26')](function(_0x5466ec){if(_0x5466ec){return _0x5466ec?{'count':_0x4ebd8f,'rows':_0x5466ec}:null;}})[_0x57e3('0x26')](respondWithResult(_0x50c443,null))[_0x57e3('0x4b')](handleError(_0x50c443,null));};exports[_0x57e3('0x53')]=function(_0x2b2b78,_0x15e1ea,_0xb5f6a2){var _0x13028a={};var _0x5e5e56={};var _0x1d6759;var _0x416938;return db['VtigerConfiguration'][_0x57e3('0x4f')]({'where':{'id':_0x2b2b78[_0x57e3('0x45')]['id']}})[_0x57e3('0x26')](handleEntityNotFound(_0x15e1ea,null))[_0x57e3('0x26')](function(_0x2e4681){if(_0x2e4681){_0x1d6759=_0x2e4681;_0x5e5e56['model']=_[_0x57e3('0x46')](db['VtigerField'][_0x57e3('0x2e')]);_0x5e5e56[_0x57e3('0x33')]=_[_0x57e3('0x46')](_0x2b2b78[_0x57e3('0x33')]);_0x5e5e56[_0x57e3('0x34')]=_[_0x57e3('0x47')](_0x5e5e56[_0x57e3('0x32')],_0x5e5e56[_0x57e3('0x33')]);_0x13028a[_0x57e3('0x35')]=_[_0x57e3('0x47')](_0x5e5e56[_0x57e3('0x32')],qs[_0x57e3('0x36')](_0x2b2b78[_0x57e3('0x33')][_0x57e3('0x36')]));_0x13028a[_0x57e3('0x35')]=_0x13028a[_0x57e3('0x35')]['length']?_0x13028a['attributes']:_0x5e5e56[_0x57e3('0x32')];_0x13028a[_0x57e3('0x51')]=qs[_0x57e3('0x39')](_0x2b2b78['query'][_0x57e3('0x39')]);_0x13028a[_0x57e3('0x3a')]=qs[_0x57e3('0x34')](_[_0x57e3('0x3b')](_0x2b2b78[_0x57e3('0x33')],_0x5e5e56[_0x57e3('0x34')]));if(_0x2b2b78[_0x57e3('0x33')]['filter']){_0x13028a['where']=_[_0x57e3('0x3d')](_0x13028a['where'],{'$or':_['map'](_0x13028a[_0x57e3('0x35')],function(_0x9dc101){var _0x4291eb={};_0x4291eb[_0x9dc101]={'$like':'%'+_0x2b2b78[_0x57e3('0x33')][_0x57e3('0x3c')]+'%'};return _0x4291eb;})});}_0x13028a=_[_0x57e3('0x3d')]({},_0x13028a,_0x2b2b78['options']);return _0x1d6759[_0x57e3('0x53')](_0x13028a);}})[_0x57e3('0x26')](function(_0x9bce79){if(_0x9bce79){_0x416938=_0x9bce79[_0x57e3('0x48')];if(!_0x2b2b78[_0x57e3('0x33')][_0x57e3('0x37')]('nolimit')){_0x13028a['limit']=qs[_0x57e3('0x1f')](_0x2b2b78[_0x57e3('0x33')]['limit']);_0x13028a[_0x57e3('0x1d')]=qs[_0x57e3('0x1d')](_0x2b2b78[_0x57e3('0x33')]['offset']);}return _0x1d6759[_0x57e3('0x53')](_0x13028a);}})[_0x57e3('0x26')](function(_0x56dc21){if(_0x56dc21){return _0x56dc21?{'count':_0x416938,'rows':_0x56dc21}:null;}})[_0x57e3('0x26')](respondWithResult(_0x15e1ea,null))[_0x57e3('0x4b')](handleError(_0x15e1ea,null));}; \ No newline at end of file +var _0xeea2=['apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','VtigerConfiguration','includeAll','findAll','rows','catch','params','create','body','find','getFields','findOne','VtigerField','hasOwnProperty','nolimit','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json'];(function(_0x19da3b,_0xa8d3da){var _0x51e669=function(_0x2e125b){while(--_0x2e125b){_0x19da3b['push'](_0x19da3b['shift']());}};_0x51e669(++_0xa8d3da);}(_0xeea2,0xce));var _0x2eea=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xeea2[_0x176329];return _0x31997c;};'use strict';var emlformat=require(_0x2eea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2eea('0x1'));var rp=require(_0x2eea('0x2'));var moment=require(_0x2eea('0x3'));var BPromise=require(_0x2eea('0x4'));var Mustache=require('mustache');var util=require(_0x2eea('0x5'));var path=require(_0x2eea('0x6'));var sox=require(_0x2eea('0x7'));var csv=require(_0x2eea('0x8'));var ejs=require(_0x2eea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2eea('0xa'));var squel=require(_0x2eea('0xb'));var crypto=require(_0x2eea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2eea('0xd'));var toCsv=require(_0x2eea('0x8'));var querystring=require(_0x2eea('0xe'));var Papa=require(_0x2eea('0xf'));var Redis=require(_0x2eea('0x10'));var authService=require(_0x2eea('0x11'));var qs=require(_0x2eea('0x12'));var as=require(_0x2eea('0x13'));var hardwareService=require(_0x2eea('0x14'));var logger=require(_0x2eea('0x15'))('api');var utils=require(_0x2eea('0x16'));var config=require(_0x2eea('0x17'));var licenseUtil=require(_0x2eea('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32dc6f,_0x5f7c74){_0x5f7c74=_0x5f7c74||0xcc;return function(_0x549c75){if(_0x549c75){return _0x32dc6f['sendStatus'](_0x5f7c74);}return _0x32dc6f[_0x2eea('0x19')](_0x5f7c74)[_0x2eea('0x1a')]();};}function respondWithResult(_0x14f9f4,_0x138a70){_0x138a70=_0x138a70||0xc8;return function(_0x3513ee){if(_0x3513ee){return _0x14f9f4['status'](_0x138a70)['json'](_0x3513ee);}};}function respondWithFilteredResult(_0x139d8,_0x61418d){return function(_0x158488){if(_0x158488){var _0x468f5b=typeof _0x61418d['offset']===_0x2eea('0x1b')&&typeof _0x61418d[_0x2eea('0x1c')]===_0x2eea('0x1b');var _0x155486=_0x158488[_0x2eea('0x1d')];var _0x363805=_0x468f5b?0x0:_0x61418d['offset'];var _0x3705bf=_0x468f5b?_0x158488[_0x2eea('0x1d')]:_0x61418d[_0x2eea('0x1e')]+_0x61418d[_0x2eea('0x1c')];var _0x35c712;if(_0x3705bf>=_0x155486){_0x3705bf=_0x155486;_0x35c712=0xc8;}else{_0x35c712=0xce;}_0x139d8[_0x2eea('0x19')](_0x35c712);return _0x139d8[_0x2eea('0x1f')](_0x2eea('0x20'),_0x363805+'-'+_0x3705bf+'/'+_0x155486)[_0x2eea('0x21')](_0x158488);}return null;};}function patchUpdates(_0x29878e){return function(_0x956846){try{jsonpatch[_0x2eea('0x22')](_0x956846,_0x29878e,!![]);}catch(_0x25057c){return BPromise['reject'](_0x25057c);}return _0x956846[_0x2eea('0x23')]();};}function saveUpdates(_0x581027,_0x1b89c1){return function(_0xd7a34){if(_0xd7a34){return _0xd7a34[_0x2eea('0x24')](_0x581027)[_0x2eea('0x25')](function(_0x1c6ca2){return _0x1c6ca2;});}return null;};}function removeEntity(_0x24a387,_0x4e728c){return function(_0x1e887c){if(_0x1e887c){return _0x1e887c[_0x2eea('0x26')]()['then'](function(){_0x24a387['status'](0xcc)[_0x2eea('0x1a')]();});}};}function handleEntityNotFound(_0x7969bb,_0x133e03){return function(_0x27f5ff){if(!_0x27f5ff){_0x7969bb[_0x2eea('0x27')](0x194);}return _0x27f5ff;};}function handleError(_0x1b341d,_0x390c17){_0x390c17=_0x390c17||0x1f4;return function(_0x118b02){logger[_0x2eea('0x28')](_0x118b02[_0x2eea('0x29')]);if(_0x118b02['name']){delete _0x118b02['name'];}_0x1b341d[_0x2eea('0x19')](_0x390c17)[_0x2eea('0x2a')](_0x118b02);};}exports[_0x2eea('0x2b')]=function(_0x23f812,_0x18442f){var _0x2c72c8={},_0x25108c={},_0x14e615={'count':0x0,'rows':[]};var _0x1f37cd=_[_0x2eea('0x2c')](db['VtigerConfiguration'][_0x2eea('0x2d')],function(_0x13cfa0){return{'name':_0x13cfa0[_0x2eea('0x2e')],'type':_0x13cfa0[_0x2eea('0x2f')][_0x2eea('0x30')]};});_0x25108c[_0x2eea('0x31')]=_[_0x2eea('0x2c')](_0x1f37cd,_0x2eea('0x32'));_0x25108c[_0x2eea('0x33')]=_[_0x2eea('0x34')](_0x23f812['query']);_0x25108c['filters']=_[_0x2eea('0x35')](_0x25108c[_0x2eea('0x31')],_0x25108c[_0x2eea('0x33')]);_0x2c72c8[_0x2eea('0x36')]=_[_0x2eea('0x35')](_0x25108c[_0x2eea('0x31')],qs[_0x2eea('0x37')](_0x23f812['query'][_0x2eea('0x37')]));_0x2c72c8[_0x2eea('0x36')]=_0x2c72c8[_0x2eea('0x36')][_0x2eea('0x38')]?_0x2c72c8[_0x2eea('0x36')]:_0x25108c['model'];if(!_0x23f812[_0x2eea('0x33')]['hasOwnProperty']('nolimit')){_0x2c72c8[_0x2eea('0x1c')]=qs[_0x2eea('0x1c')](_0x23f812[_0x2eea('0x33')]['limit']);_0x2c72c8[_0x2eea('0x1e')]=qs[_0x2eea('0x1e')](_0x23f812[_0x2eea('0x33')][_0x2eea('0x1e')]);}_0x2c72c8[_0x2eea('0x39')]=qs[_0x2eea('0x3a')](_0x23f812['query'][_0x2eea('0x3a')]);_0x2c72c8[_0x2eea('0x3b')]=qs[_0x2eea('0x3c')](_[_0x2eea('0x3d')](_0x23f812['query'],_0x25108c[_0x2eea('0x3c')]),_0x1f37cd);if(_0x23f812[_0x2eea('0x33')][_0x2eea('0x3e')]){_0x2c72c8['where']=_[_0x2eea('0x3f')](_0x2c72c8[_0x2eea('0x3b')],{'$or':_[_0x2eea('0x2c')](_0x1f37cd,function(_0x336423){if(_0x336423[_0x2eea('0x2f')]!=='VIRTUAL'){var _0xf076a2={};_0xf076a2[_0x336423[_0x2eea('0x32')]]={'$like':'%'+_0x23f812[_0x2eea('0x33')][_0x2eea('0x3e')]+'%'};return _0xf076a2;}})});}_0x2c72c8=_[_0x2eea('0x3f')]({},_0x2c72c8,_0x23f812[_0x2eea('0x40')]);var _0x1082b1={'where':_0x2c72c8[_0x2eea('0x3b')]};return db[_0x2eea('0x41')][_0x2eea('0x1d')](_0x1082b1)[_0x2eea('0x25')](function(_0x1cf7da){_0x14e615[_0x2eea('0x1d')]=_0x1cf7da;if(_0x23f812[_0x2eea('0x33')][_0x2eea('0x42')]){_0x2c72c8['include']=[{'all':!![]}];}return db[_0x2eea('0x41')][_0x2eea('0x43')](_0x2c72c8);})[_0x2eea('0x25')](function(_0x3f67bd){_0x14e615[_0x2eea('0x44')]=_0x3f67bd;return _0x14e615;})[_0x2eea('0x25')](respondWithFilteredResult(_0x18442f,_0x2c72c8))[_0x2eea('0x45')](handleError(_0x18442f,null));};exports['show']=function(_0x384f2d,_0x24752e){var _0x4394b4={'raw':![],'where':{'id':_0x384f2d[_0x2eea('0x46')]['id']}},_0x588901={};_0x588901['model']=_['keys'](db[_0x2eea('0x41')][_0x2eea('0x2d')]);_0x588901['query']=_[_0x2eea('0x34')](_0x384f2d['query']);_0x588901[_0x2eea('0x3c')]=_[_0x2eea('0x35')](_0x588901[_0x2eea('0x31')],_0x588901[_0x2eea('0x33')]);_0x4394b4[_0x2eea('0x36')]=_[_0x2eea('0x35')](_0x588901['model'],qs[_0x2eea('0x37')](_0x384f2d['query'][_0x2eea('0x37')]));_0x4394b4['attributes']=_0x4394b4[_0x2eea('0x36')]['length']?_0x4394b4[_0x2eea('0x36')]:_0x588901[_0x2eea('0x31')];if(_0x384f2d[_0x2eea('0x33')]['includeAll']){_0x4394b4['include']=[{'all':!![]}];}_0x4394b4=_[_0x2eea('0x3f')]({},_0x4394b4,_0x384f2d['options']);return db[_0x2eea('0x41')]['find'](_0x4394b4)['then'](handleEntityNotFound(_0x24752e,null))[_0x2eea('0x25')](respondWithResult(_0x24752e,null))['catch'](handleError(_0x24752e,null));};exports['create']=function(_0x4a1daf,_0x46f9e8){return db[_0x2eea('0x41')][_0x2eea('0x47')](_0x4a1daf[_0x2eea('0x48')],{})['then'](respondWithResult(_0x46f9e8,0xc9))[_0x2eea('0x45')](handleError(_0x46f9e8,null));};exports[_0x2eea('0x24')]=function(_0x3e1a3e,_0x39f5b3){if(_0x3e1a3e['body']['id']){delete _0x3e1a3e[_0x2eea('0x48')]['id'];}return db[_0x2eea('0x41')]['find']({'where':{'id':_0x3e1a3e[_0x2eea('0x46')]['id']}})[_0x2eea('0x25')](handleEntityNotFound(_0x39f5b3,null))['then'](saveUpdates(_0x3e1a3e['body'],null))['then'](respondWithResult(_0x39f5b3,null))[_0x2eea('0x45')](handleError(_0x39f5b3,null));};exports[_0x2eea('0x26')]=function(_0x42740e,_0x49f8d4){return db['VtigerConfiguration'][_0x2eea('0x49')]({'where':{'id':_0x42740e['params']['id']}})[_0x2eea('0x25')](handleEntityNotFound(_0x49f8d4,null))[_0x2eea('0x25')](removeEntity(_0x49f8d4,null))[_0x2eea('0x45')](handleError(_0x49f8d4,null));};exports[_0x2eea('0x4a')]=function(_0x197891,_0x3b38b2,_0x3e63c5){var _0x4e41d0={};var _0x3f8226={};var _0x3508c6;var _0x2c2ecd;return db[_0x2eea('0x41')][_0x2eea('0x4b')]({'where':{'id':_0x197891[_0x2eea('0x46')]['id']}})[_0x2eea('0x25')](handleEntityNotFound(_0x3b38b2,null))[_0x2eea('0x25')](function(_0x1e9421){if(_0x1e9421){_0x3508c6=_0x1e9421;_0x3f8226[_0x2eea('0x31')]=_[_0x2eea('0x34')](db[_0x2eea('0x4c')]['rawAttributes']);_0x3f8226[_0x2eea('0x33')]=_[_0x2eea('0x34')](_0x197891['query']);_0x3f8226['filters']=_[_0x2eea('0x35')](_0x3f8226[_0x2eea('0x31')],_0x3f8226[_0x2eea('0x33')]);_0x4e41d0[_0x2eea('0x36')]=_['intersection'](_0x3f8226[_0x2eea('0x31')],qs[_0x2eea('0x37')](_0x197891[_0x2eea('0x33')][_0x2eea('0x37')]));_0x4e41d0['attributes']=_0x4e41d0[_0x2eea('0x36')][_0x2eea('0x38')]?_0x4e41d0['attributes']:_0x3f8226['model'];_0x4e41d0['order']=qs[_0x2eea('0x3a')](_0x197891[_0x2eea('0x33')][_0x2eea('0x3a')]);_0x4e41d0[_0x2eea('0x3b')]=qs['filters'](_['pick'](_0x197891[_0x2eea('0x33')],_0x3f8226[_0x2eea('0x3c')]));if(_0x197891[_0x2eea('0x33')][_0x2eea('0x3e')]){_0x4e41d0['where']=_[_0x2eea('0x3f')](_0x4e41d0[_0x2eea('0x3b')],{'$or':_[_0x2eea('0x2c')](_0x4e41d0[_0x2eea('0x36')],function(_0x4b3665){var _0x554497={};_0x554497[_0x4b3665]={'$like':'%'+_0x197891[_0x2eea('0x33')][_0x2eea('0x3e')]+'%'};return _0x554497;})});}_0x4e41d0=_['merge']({},_0x4e41d0,_0x197891[_0x2eea('0x40')]);return _0x3508c6['getFields'](_0x4e41d0);}})[_0x2eea('0x25')](function(_0x59b2ff){if(_0x59b2ff){_0x2c2ecd=_0x59b2ff[_0x2eea('0x38')];if(!_0x197891['query']['hasOwnProperty']('nolimit')){_0x4e41d0[_0x2eea('0x1c')]=qs[_0x2eea('0x1c')](_0x197891['query'][_0x2eea('0x1c')]);_0x4e41d0[_0x2eea('0x1e')]=qs[_0x2eea('0x1e')](_0x197891[_0x2eea('0x33')]['offset']);}return _0x3508c6[_0x2eea('0x4a')](_0x4e41d0);}})[_0x2eea('0x25')](function(_0x43e3ba){if(_0x43e3ba){return _0x43e3ba?{'count':_0x2c2ecd,'rows':_0x43e3ba}:null;}})[_0x2eea('0x25')](respondWithResult(_0x3b38b2,null))['catch'](handleError(_0x3b38b2,null));};exports['getSubjects']=function(_0x12bc01,_0x1f6ee4,_0x356e41){var _0x5f3e56={};var _0x3a9379={};var _0x321622;var _0x4eeb07;return db[_0x2eea('0x41')][_0x2eea('0x4b')]({'where':{'id':_0x12bc01['params']['id']}})[_0x2eea('0x25')](handleEntityNotFound(_0x1f6ee4,null))[_0x2eea('0x25')](function(_0x1674ff){if(_0x1674ff){_0x321622=_0x1674ff;_0x3a9379['model']=_[_0x2eea('0x34')](db[_0x2eea('0x4c')][_0x2eea('0x2d')]);_0x3a9379[_0x2eea('0x33')]=_[_0x2eea('0x34')](_0x12bc01[_0x2eea('0x33')]);_0x3a9379['filters']=_['intersection'](_0x3a9379[_0x2eea('0x31')],_0x3a9379[_0x2eea('0x33')]);_0x5f3e56['attributes']=_[_0x2eea('0x35')](_0x3a9379[_0x2eea('0x31')],qs['fields'](_0x12bc01[_0x2eea('0x33')]['fields']));_0x5f3e56['attributes']=_0x5f3e56['attributes'][_0x2eea('0x38')]?_0x5f3e56[_0x2eea('0x36')]:_0x3a9379[_0x2eea('0x31')];_0x5f3e56['order']=qs[_0x2eea('0x3a')](_0x12bc01[_0x2eea('0x33')][_0x2eea('0x3a')]);_0x5f3e56[_0x2eea('0x3b')]=qs[_0x2eea('0x3c')](_[_0x2eea('0x3d')](_0x12bc01[_0x2eea('0x33')],_0x3a9379[_0x2eea('0x3c')]));if(_0x12bc01[_0x2eea('0x33')][_0x2eea('0x3e')]){_0x5f3e56[_0x2eea('0x3b')]=_[_0x2eea('0x3f')](_0x5f3e56[_0x2eea('0x3b')],{'$or':_['map'](_0x5f3e56[_0x2eea('0x36')],function(_0x18e932){var _0xba3cfe={};_0xba3cfe[_0x18e932]={'$like':'%'+_0x12bc01[_0x2eea('0x33')][_0x2eea('0x3e')]+'%'};return _0xba3cfe;})});}_0x5f3e56=_[_0x2eea('0x3f')]({},_0x5f3e56,_0x12bc01[_0x2eea('0x40')]);return _0x321622['getSubjects'](_0x5f3e56);}})['then'](function(_0x12f890){if(_0x12f890){_0x4eeb07=_0x12f890[_0x2eea('0x38')];if(!_0x12bc01[_0x2eea('0x33')][_0x2eea('0x4d')](_0x2eea('0x4e'))){_0x5f3e56[_0x2eea('0x1c')]=qs[_0x2eea('0x1c')](_0x12bc01[_0x2eea('0x33')][_0x2eea('0x1c')]);_0x5f3e56['offset']=qs[_0x2eea('0x1e')](_0x12bc01[_0x2eea('0x33')][_0x2eea('0x1e')]);}return _0x321622['getSubjects'](_0x5f3e56);}})[_0x2eea('0x25')](function(_0x312986){if(_0x312986){return _0x312986?{'count':_0x4eeb07,'rows':_0x312986}:null;}})[_0x2eea('0x25')](respondWithResult(_0x1f6ee4,null))[_0x2eea('0x45')](handleError(_0x1f6ee4,null));};exports[_0x2eea('0x4f')]=function(_0x3acd3a,_0x1211ee,_0x25bc27){var _0x4e9bca={};var _0x2165fd={};var _0x10a94a;var _0x162812;return db[_0x2eea('0x41')][_0x2eea('0x4b')]({'where':{'id':_0x3acd3a['params']['id']}})[_0x2eea('0x25')](handleEntityNotFound(_0x1211ee,null))[_0x2eea('0x25')](function(_0x1912ac){if(_0x1912ac){_0x10a94a=_0x1912ac;_0x2165fd['model']=_[_0x2eea('0x34')](db['VtigerField'][_0x2eea('0x2d')]);_0x2165fd[_0x2eea('0x33')]=_[_0x2eea('0x34')](_0x3acd3a[_0x2eea('0x33')]);_0x2165fd[_0x2eea('0x3c')]=_['intersection'](_0x2165fd[_0x2eea('0x31')],_0x2165fd[_0x2eea('0x33')]);_0x4e9bca['attributes']=_[_0x2eea('0x35')](_0x2165fd[_0x2eea('0x31')],qs[_0x2eea('0x37')](_0x3acd3a[_0x2eea('0x33')]['fields']));_0x4e9bca[_0x2eea('0x36')]=_0x4e9bca[_0x2eea('0x36')][_0x2eea('0x38')]?_0x4e9bca[_0x2eea('0x36')]:_0x2165fd['model'];_0x4e9bca[_0x2eea('0x39')]=qs['sort'](_0x3acd3a[_0x2eea('0x33')][_0x2eea('0x3a')]);_0x4e9bca[_0x2eea('0x3b')]=qs[_0x2eea('0x3c')](_[_0x2eea('0x3d')](_0x3acd3a['query'],_0x2165fd[_0x2eea('0x3c')]));if(_0x3acd3a[_0x2eea('0x33')]['filter']){_0x4e9bca['where']=_[_0x2eea('0x3f')](_0x4e9bca['where'],{'$or':_[_0x2eea('0x2c')](_0x4e9bca[_0x2eea('0x36')],function(_0x445cdf){var _0x3c55f7={};_0x3c55f7[_0x445cdf]={'$like':'%'+_0x3acd3a['query']['filter']+'%'};return _0x3c55f7;})});}_0x4e9bca=_[_0x2eea('0x3f')]({},_0x4e9bca,_0x3acd3a[_0x2eea('0x40')]);return _0x10a94a['getDescriptions'](_0x4e9bca);}})['then'](function(_0x37cb68){if(_0x37cb68){_0x162812=_0x37cb68[_0x2eea('0x38')];if(!_0x3acd3a[_0x2eea('0x33')][_0x2eea('0x4d')](_0x2eea('0x4e'))){_0x4e9bca[_0x2eea('0x1c')]=qs[_0x2eea('0x1c')](_0x3acd3a['query']['limit']);_0x4e9bca[_0x2eea('0x1e')]=qs[_0x2eea('0x1e')](_0x3acd3a[_0x2eea('0x33')][_0x2eea('0x1e')]);}return _0x10a94a[_0x2eea('0x4f')](_0x4e9bca);}})['then'](function(_0x45a149){if(_0x45a149){return _0x45a149?{'count':_0x162812,'rows':_0x45a149}:null;}})[_0x2eea('0x25')](respondWithResult(_0x1211ee,null))['catch'](handleError(_0x1211ee,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b9fecab..6bb85ac 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 _0xbdbe=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x256f60,_0x892aa0){var _0x34f044=function(_0x4e0728){while(--_0x4e0728){_0x256f60['push'](_0x256f60['shift']());}};_0x34f044(++_0x892aa0);}(_0xbdbe,0xe3));var _0xebdb=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xbdbe[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xebdb('0x0'));var util=require(_0xebdb('0x1'));var logger=require(_0xebdb('0x2'))('api');var moment=require(_0xebdb('0x3'));var BPromise=require('bluebird');var rp=require(_0xebdb('0x4'));var fs=require('fs');var path=require(_0xebdb('0x5'));var rimraf=require(_0xebdb('0x6'));var config=require(_0xebdb('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xebdb('0x8')]=function(_0x4b2992,_0x4b0e2f){return _0x4b2992[_0xebdb('0x9')](_0xebdb('0xa'),attributes,{'tableName':_0xebdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbda=['exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','moment','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xfbda,0x93));var _0xafbd=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xfbda[_0x24259d];return _0x5a701;};'use strict';var _=require('lodash');var util=require(_0xafbd('0x0'));var logger=require(_0xafbd('0x1'))('api');var moment=require(_0xafbd('0x2'));var BPromise=require('bluebird');var rp=require(_0xafbd('0x3'));var fs=require('fs');var path=require(_0xafbd('0x4'));var rimraf=require('rimraf');var config=require(_0xafbd('0x5'));var attributes=require(_0xafbd('0x6'));module[_0xafbd('0x7')]=function(_0x2443a1,_0x38e4b1){return _0x2443a1[_0xafbd('0x8')](_0xafbd('0x9'),attributes,{'tableName':_0xafbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 42f30c1..3612444 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 _0x8d1a=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f2b66,_0x6825bd){var _0xdd99be=function(_0x4147a6){while(--_0x4147a6){_0x2f2b66['push'](_0x2f2b66['shift']());}};_0xdd99be(++_0x6825bd);}(_0x8d1a,0x76));var _0xa8d1=function(_0x48a375,_0x42fd2b){_0x48a375=_0x48a375-0x0;var _0x3b3e84=_0x8d1a[_0x48a375];return _0x3b3e84;};'use strict';var _=require(_0xa8d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa8d1('0x1'));var rs=require(_0xa8d1('0x2'));var fs=require('fs');var Redis=require(_0xa8d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8d1('0x4'));var logger=require(_0xa8d1('0x5'))(_0xa8d1('0x6'));var config=require(_0xa8d1('0x7'));var jayson=require(_0xa8d1('0x8'));var client=jayson[_0xa8d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c6c5f,_0x14cb04,_0x19b58d){return new BPromise(function(_0x4f8eea,_0x3869ff){return client[_0xa8d1('0xa')](_0x2c6c5f,_0x19b58d)[_0xa8d1('0xb')](function(_0x152ceb){logger[_0xa8d1('0xc')](_0xa8d1('0xd'),_0x14cb04,_0xa8d1('0xe'));logger[_0xa8d1('0xf')](_0xa8d1('0x10'),_0x14cb04,_0xa8d1('0xe'),JSON[_0xa8d1('0x11')](_0x152ceb));if(_0x152ceb['error']){if(_0x152ceb[_0xa8d1('0x12')][_0xa8d1('0x13')]===0x1f4){logger[_0xa8d1('0x12')](_0xa8d1('0xd'),_0x14cb04,_0x152ceb['error'][_0xa8d1('0x14')]);return _0x3869ff(_0x152ceb[_0xa8d1('0x12')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x14cb04,_0x152ceb[_0xa8d1('0x12')][_0xa8d1('0x14')]);return _0x4f8eea(_0x152ceb[_0xa8d1('0x12')][_0xa8d1('0x14')]);}else{logger[_0xa8d1('0xc')](_0xa8d1('0xd'),_0x14cb04,'request\x20sent');_0x4f8eea(_0x152ceb[_0xa8d1('0x15')][_0xa8d1('0x14')]);}})[_0xa8d1('0x16')](function(_0x30b1c3){logger['error'](_0xa8d1('0xd'),_0x14cb04,_0x30b1c3);_0x3869ff(_0x30b1c3);});});} \ No newline at end of file +var _0xdc9a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x12cdee,_0x546dba){var _0x5840fd=function(_0x2182dd){while(--_0x2182dd){_0x12cdee['push'](_0x12cdee['shift']());}};_0x5840fd(++_0x546dba);}(_0xdc9a,0x1c9));var _0xadc9=function(_0x101c18,_0x608208){_0x101c18=_0x101c18-0x0;var _0x16de76=_0xdc9a[_0x101c18];return _0x16de76;};'use strict';var _=require(_0xadc9('0x0'));var util=require(_0xadc9('0x1'));var moment=require(_0xadc9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadc9('0x3'));var db=require(_0xadc9('0x4'))['db'];var utils=require(_0xadc9('0x5'));var logger=require(_0xadc9('0x6'))(_0xadc9('0x7'));var config=require('../../config/environment');var jayson=require(_0xadc9('0x8'));var client=jayson[_0xadc9('0x9')][_0xadc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32f15d,_0x2c4738,_0x219bc2){return new BPromise(function(_0xd9dbbe,_0x107c8c){return client[_0xadc9('0xb')](_0x32f15d,_0x219bc2)[_0xadc9('0xc')](function(_0x1ee8f6){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2c4738,_0xadc9('0xd'));logger[_0xadc9('0xe')](_0xadc9('0xf'),_0x2c4738,_0xadc9('0xd'),JSON['stringify'](_0x1ee8f6));if(_0x1ee8f6['error']){if(_0x1ee8f6[_0xadc9('0x10')][_0xadc9('0x11')]===0x1f4){logger[_0xadc9('0x10')](_0xadc9('0x12'),_0x2c4738,_0x1ee8f6[_0xadc9('0x10')]['message']);return _0x107c8c(_0x1ee8f6[_0xadc9('0x10')][_0xadc9('0x13')]);}logger[_0xadc9('0x10')](_0xadc9('0x12'),_0x2c4738,_0x1ee8f6[_0xadc9('0x10')]['message']);return _0xd9dbbe(_0x1ee8f6['error'][_0xadc9('0x13')]);}else{logger[_0xadc9('0x14')](_0xadc9('0x12'),_0x2c4738,_0xadc9('0xd'));_0xd9dbbe(_0x1ee8f6[_0xadc9('0x15')]['message']);}})[_0xadc9('0x16')](function(_0x27cab5){logger[_0xadc9('0x10')](_0xadc9('0x12'),_0x2c4738,_0x27cab5);_0x107c8c(_0x27cab5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index cba3da3..770de59 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 _0xd574=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy'];(function(_0x46d221,_0x6c2a0e){var _0x34ca83=function(_0x4bbeb2){while(--_0x4bbeb2){_0x46d221['push'](_0x46d221['shift']());}};_0x34ca83(++_0x6c2a0e);}(_0xd574,0x10b));var _0x4d57=function(_0x1c1642,_0x112bbc){_0x1c1642=_0x1c1642-0x0;var _0x30f328=_0xd574[_0x1c1642];return _0x30f328;};'use strict';var multer=require(_0x4d57('0x0'));var util=require(_0x4d57('0x1'));var path=require(_0x4d57('0x2'));var timeout=require(_0x4d57('0x3'));var express=require(_0x4d57('0x4'));var router=express[_0x4d57('0x5')]();var fs_extra=require(_0x4d57('0x6'));var auth=require(_0x4d57('0x7'));var interaction=require(_0x4d57('0x8'));var config=require('../../config/environment');var controller=require(_0x4d57('0x9'));router[_0x4d57('0xa')]('/',auth[_0x4d57('0xb')](),controller['index']);router[_0x4d57('0xa')](_0x4d57('0xc'),auth[_0x4d57('0xb')](),controller[_0x4d57('0xd')]);router[_0x4d57('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4d57('0xc'),auth[_0x4d57('0xb')](),controller[_0x4d57('0xf')]);router[_0x4d57('0x10')](_0x4d57('0xc'),auth[_0x4d57('0xb')](),controller[_0x4d57('0x11')]);module[_0x4d57('0x12')]=router; \ No newline at end of file +var _0xa78a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','path'];(function(_0x18ddd0,_0x27a1fe){var _0x41e195=function(_0xae1126){while(--_0xae1126){_0x18ddd0['push'](_0x18ddd0['shift']());}};_0x41e195(++_0x27a1fe);}(_0xa78a,0x166));var _0xaa78=function(_0x52c115,_0x296c04){_0x52c115=_0x52c115-0x0;var _0x5dbee8=_0xa78a[_0x52c115];return _0x5dbee8;};'use strict';var multer=require(_0xaa78('0x0'));var util=require('util');var path=require(_0xaa78('0x1'));var timeout=require(_0xaa78('0x2'));var express=require('express');var router=express[_0xaa78('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaa78('0x4'));var interaction=require(_0xaa78('0x5'));var config=require(_0xaa78('0x6'));var controller=require(_0xaa78('0x7'));router[_0xaa78('0x8')]('/',auth[_0xaa78('0x9')](),controller[_0xaa78('0xa')]);router[_0xaa78('0x8')](_0xaa78('0xb'),auth[_0xaa78('0x9')](),controller['show']);router[_0xaa78('0xc')]('/',auth[_0xaa78('0x9')](),controller[_0xaa78('0xd')]);router['put']('/:id',auth[_0xaa78('0x9')](),controller[_0xaa78('0xe')]);router[_0xaa78('0xf')]('/:id',auth[_0xaa78('0x9')](),controller[_0xaa78('0x10')]);module[_0xaa78('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 57ab7c0..e6f3d9e 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 _0x833d=['sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN'];(function(_0x3aefc3,_0x22778b){var _0x200be9=function(_0x1a2a77){while(--_0x1a2a77){_0x3aefc3['push'](_0x3aefc3['shift']());}};_0x200be9(++_0x22778b);}(_0x833d,0x1c2));var _0xd833=function(_0xfcfa53,_0x249882){_0xfcfa53=_0xfcfa53-0x0;var _0x3e7160=_0x833d[_0xfcfa53];return _0x3e7160;};'use strict';var Sequelize=require(_0xd833('0x0'));module['exports']={'type':{'type':Sequelize[_0xd833('0x1')]('string',_0xd833('0x2'),_0xd833('0x3'),_0xd833('0x4'),_0xd833('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd833('0x6')]},'keyType':{'type':Sequelize[_0xd833('0x1')](_0xd833('0x7'),_0xd833('0x2'),_0xd833('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd833('0x6')]},'customField':{'type':Sequelize[_0xd833('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd833('0x6')]}}; \ No newline at end of file +var _0xb622=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x4099cd,_0x4118d8){var _0x284e82=function(_0x2f433c){while(--_0x2f433c){_0x4099cd['push'](_0x4099cd['shift']());}};_0x284e82(++_0x4118d8);}(_0xb622,0xee));var _0x2b62=function(_0x4a2493,_0x576722){_0x4a2493=_0x4a2493-0x0;var _0xf21d7a=_0xb622[_0x4a2493];return _0xf21d7a;};'use strict';var Sequelize=require(_0x2b62('0x0'));module['exports']={'type':{'type':Sequelize[_0x2b62('0x1')](_0x2b62('0x2'),_0x2b62('0x3'),_0x2b62('0x4'),'keyValue',_0x2b62('0x5')),'defaultValue':_0x2b62('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2b62('0x2'),_0x2b62('0x3'),_0x2b62('0x4'))},'keyContent':{'type':Sequelize[_0x2b62('0x6')]},'idField':{'type':Sequelize[_0x2b62('0x6')]},'nameField':{'type':Sequelize[_0x2b62('0x6')]},'customField':{'type':Sequelize[_0x2b62('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b62('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b682638..3c8afcd 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78ba=['error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VtigerField','includeAll','include','findAll','rows','catch','show','params','fields','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy'];(function(_0x16f8ec,_0x59ce87){var _0x3c78f2=function(_0x4dd52b){while(--_0x4dd52b){_0x16f8ec['push'](_0x16f8ec['shift']());}};_0x3c78f2(++_0x59ce87);}(_0x78ba,0xb4));var _0xa78b=function(_0x399484,_0x45be9a){_0x399484=_0x399484-0x0;var _0x3c59b4=_0x78ba[_0x399484];return _0x3c59b4;};'use strict';var emlformat=require(_0xa78b('0x0'));var rimraf=require(_0xa78b('0x1'));var zipdir=require(_0xa78b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa78b('0x3'));var moment=require(_0xa78b('0x4'));var BPromise=require(_0xa78b('0x5'));var Mustache=require(_0xa78b('0x6'));var util=require(_0xa78b('0x7'));var path=require(_0xa78b('0x8'));var sox=require(_0xa78b('0x9'));var csv=require(_0xa78b('0xa'));var ejs=require(_0xa78b('0xb'));var fs=require('fs');var fs_extra=require(_0xa78b('0xc'));var _=require(_0xa78b('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa78b('0xe'));var Papa=require(_0xa78b('0xf'));var Redis=require('ioredis');var authService=require(_0xa78b('0x10'));var qs=require(_0xa78b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa78b('0x12'));var logger=require('../../config/logger')(_0xa78b('0x13'));var utils=require(_0xa78b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa78b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e9871,_0x1dab09){_0x1dab09=_0x1dab09||0xcc;return function(_0x4b6745){if(_0x4b6745){return _0x4e9871[_0xa78b('0x16')](_0x1dab09);}return _0x4e9871[_0xa78b('0x17')](_0x1dab09)[_0xa78b('0x18')]();};}function respondWithResult(_0x2ef675,_0x5d3149){_0x5d3149=_0x5d3149||0xc8;return function(_0x1b407c){if(_0x1b407c){return _0x2ef675[_0xa78b('0x17')](_0x5d3149)[_0xa78b('0x19')](_0x1b407c);}};}function respondWithFilteredResult(_0x40b0dd,_0x8967fc){return function(_0x5c8c83){if(_0x5c8c83){var _0x3922e6=typeof _0x8967fc[_0xa78b('0x1a')]===_0xa78b('0x1b')&&typeof _0x8967fc[_0xa78b('0x1c')]===_0xa78b('0x1b');var _0x48a917=_0x5c8c83[_0xa78b('0x1d')];var _0x584b23=_0x3922e6?0x0:_0x8967fc[_0xa78b('0x1a')];var _0x2ee6f7=_0x3922e6?_0x5c8c83[_0xa78b('0x1d')]:_0x8967fc[_0xa78b('0x1a')]+_0x8967fc['limit'];var _0x63068e;if(_0x2ee6f7>=_0x48a917){_0x2ee6f7=_0x48a917;_0x63068e=0xc8;}else{_0x63068e=0xce;}_0x40b0dd[_0xa78b('0x17')](_0x63068e);return _0x40b0dd[_0xa78b('0x1e')]('Content-Range',_0x584b23+'-'+_0x2ee6f7+'/'+_0x48a917)['json'](_0x5c8c83);}return null;};}function patchUpdates(_0x589851){return function(_0x3253d1){try{jsonpatch[_0xa78b('0x1f')](_0x3253d1,_0x589851,!![]);}catch(_0x1ec183){return BPromise['reject'](_0x1ec183);}return _0x3253d1[_0xa78b('0x20')]();};}function saveUpdates(_0xdcd983,_0x2568fd){return function(_0x43e929){if(_0x43e929){return _0x43e929[_0xa78b('0x21')](_0xdcd983)[_0xa78b('0x22')](function(_0x414250){return _0x414250;});}return null;};}function removeEntity(_0x522dfc,_0x2583b2){return function(_0x44a2a5){if(_0x44a2a5){return _0x44a2a5[_0xa78b('0x23')]()[_0xa78b('0x22')](function(){_0x522dfc[_0xa78b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e601a,_0x51e09a){return function(_0x2eef1a){if(!_0x2eef1a){_0x3e601a[_0xa78b('0x16')](0x194);}return _0x2eef1a;};}function handleError(_0x129358,_0x19a3cd){_0x19a3cd=_0x19a3cd||0x1f4;return function(_0xdc21ac){logger[_0xa78b('0x24')](_0xdc21ac['stack']);if(_0xdc21ac[_0xa78b('0x25')]){delete _0xdc21ac[_0xa78b('0x25')];}_0x129358[_0xa78b('0x17')](_0x19a3cd)[_0xa78b('0x26')](_0xdc21ac);};}exports[_0xa78b('0x27')]=function(_0x32df31,_0x19e231){var _0x3b1e21={},_0x20602b={},_0x2341be={'count':0x0,'rows':[]};var _0x158623=_[_0xa78b('0x28')](db['VtigerField'][_0xa78b('0x29')],function(_0x47e8ba){return{'name':_0x47e8ba[_0xa78b('0x2a')],'type':_0x47e8ba[_0xa78b('0x2b')][_0xa78b('0x2c')]};});_0x20602b[_0xa78b('0x2d')]=_[_0xa78b('0x28')](_0x158623,_0xa78b('0x25'));_0x20602b['query']=_[_0xa78b('0x2e')](_0x32df31[_0xa78b('0x2f')]);_0x20602b[_0xa78b('0x30')]=_[_0xa78b('0x31')](_0x20602b[_0xa78b('0x2d')],_0x20602b[_0xa78b('0x2f')]);_0x3b1e21['attributes']=_[_0xa78b('0x31')](_0x20602b['model'],qs['fields'](_0x32df31[_0xa78b('0x2f')]['fields']));_0x3b1e21[_0xa78b('0x32')]=_0x3b1e21['attributes'][_0xa78b('0x33')]?_0x3b1e21[_0xa78b('0x32')]:_0x20602b['model'];if(!_0x32df31['query'][_0xa78b('0x34')](_0xa78b('0x35'))){_0x3b1e21[_0xa78b('0x1c')]=qs['limit'](_0x32df31[_0xa78b('0x2f')][_0xa78b('0x1c')]);_0x3b1e21['offset']=qs['offset'](_0x32df31['query']['offset']);}_0x3b1e21[_0xa78b('0x36')]=qs[_0xa78b('0x37')](_0x32df31[_0xa78b('0x2f')][_0xa78b('0x37')]);_0x3b1e21[_0xa78b('0x38')]=qs[_0xa78b('0x30')](_[_0xa78b('0x39')](_0x32df31[_0xa78b('0x2f')],_0x20602b[_0xa78b('0x30')]),_0x158623);if(_0x32df31[_0xa78b('0x2f')][_0xa78b('0x3a')]){_0x3b1e21[_0xa78b('0x38')]=_['merge'](_0x3b1e21['where'],{'$or':_[_0xa78b('0x28')](_0x158623,function(_0x3788e8){if(_0x3788e8[_0xa78b('0x2b')]!=='VIRTUAL'){var _0x2a4043={};_0x2a4043[_0x3788e8[_0xa78b('0x25')]]={'$like':'%'+_0x32df31[_0xa78b('0x2f')][_0xa78b('0x3a')]+'%'};return _0x2a4043;}})});}_0x3b1e21=_['merge']({},_0x3b1e21,_0x32df31['options']);var _0x588046={'where':_0x3b1e21[_0xa78b('0x38')]};return db[_0xa78b('0x3b')]['count'](_0x588046)[_0xa78b('0x22')](function(_0x402e1b){_0x2341be[_0xa78b('0x1d')]=_0x402e1b;if(_0x32df31['query'][_0xa78b('0x3c')]){_0x3b1e21[_0xa78b('0x3d')]=[{'all':!![]}];}return db[_0xa78b('0x3b')][_0xa78b('0x3e')](_0x3b1e21);})[_0xa78b('0x22')](function(_0x3a87dc){_0x2341be[_0xa78b('0x3f')]=_0x3a87dc;return _0x2341be;})[_0xa78b('0x22')](respondWithFilteredResult(_0x19e231,_0x3b1e21))[_0xa78b('0x40')](handleError(_0x19e231,null));};exports[_0xa78b('0x41')]=function(_0x48d2af,_0x242780){var _0x4855bd={'raw':!![],'where':{'id':_0x48d2af[_0xa78b('0x42')]['id']}},_0x156d47={};_0x156d47[_0xa78b('0x2d')]=_['keys'](db[_0xa78b('0x3b')][_0xa78b('0x29')]);_0x156d47['query']=_[_0xa78b('0x2e')](_0x48d2af[_0xa78b('0x2f')]);_0x156d47[_0xa78b('0x30')]=_[_0xa78b('0x31')](_0x156d47[_0xa78b('0x2d')],_0x156d47[_0xa78b('0x2f')]);_0x4855bd[_0xa78b('0x32')]=_[_0xa78b('0x31')](_0x156d47['model'],qs['fields'](_0x48d2af['query'][_0xa78b('0x43')]));_0x4855bd[_0xa78b('0x32')]=_0x4855bd[_0xa78b('0x32')]['length']?_0x4855bd[_0xa78b('0x32')]:_0x156d47['model'];if(_0x48d2af[_0xa78b('0x2f')][_0xa78b('0x3c')]){_0x4855bd[_0xa78b('0x3d')]=[{'all':!![]}];}_0x4855bd=_['merge']({},_0x4855bd,_0x48d2af[_0xa78b('0x44')]);return db[_0xa78b('0x3b')]['find'](_0x4855bd)['then'](handleEntityNotFound(_0x242780,null))[_0xa78b('0x22')](respondWithResult(_0x242780,null))[_0xa78b('0x40')](handleError(_0x242780,null));};exports[_0xa78b('0x45')]=function(_0x4e5f45,_0x2d10f8){return db[_0xa78b('0x3b')][_0xa78b('0x45')](_0x4e5f45[_0xa78b('0x46')],{})[_0xa78b('0x22')](respondWithResult(_0x2d10f8,0xc9))[_0xa78b('0x40')](handleError(_0x2d10f8,null));};exports[_0xa78b('0x21')]=function(_0x2e751d,_0x42f78f){if(_0x2e751d[_0xa78b('0x46')]['id']){delete _0x2e751d[_0xa78b('0x46')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x2e751d[_0xa78b('0x42')]['id']}})['then'](handleEntityNotFound(_0x42f78f,null))[_0xa78b('0x22')](saveUpdates(_0x2e751d[_0xa78b('0x46')],null))[_0xa78b('0x22')](respondWithResult(_0x42f78f,null))[_0xa78b('0x40')](handleError(_0x42f78f,null));};exports[_0xa78b('0x23')]=function(_0x4ec1ab,_0x538b69){return db[_0xa78b('0x3b')][_0xa78b('0x47')]({'where':{'id':_0x4ec1ab[_0xa78b('0x42')]['id']}})[_0xa78b('0x22')](handleEntityNotFound(_0x538b69,null))['then'](removeEntity(_0x538b69,null))[_0xa78b('0x40')](handleError(_0x538b69,null));}; \ No newline at end of file +var _0xcb00=['undefined','limit','count','set','json','apply','reject','update','destroy','then','error','stack','send','map','VtigerField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb00,0x106));var _0x0cb0=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0xcb00[_0x421263];return _0x34e4b5;};'use strict';var emlformat=require(_0x0cb0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0cb0('0x1'));var rp=require(_0x0cb0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0cb0('0x3'));var util=require(_0x0cb0('0x4'));var path=require(_0x0cb0('0x5'));var sox=require('sox');var csv=require(_0x0cb0('0x6'));var ejs=require(_0x0cb0('0x7'));var fs=require('fs');var fs_extra=require(_0x0cb0('0x8'));var _=require(_0x0cb0('0x9'));var squel=require(_0x0cb0('0xa'));var crypto=require(_0x0cb0('0xb'));var jsforce=require(_0x0cb0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0cb0('0x6'));var querystring=require(_0x0cb0('0xd'));var Papa=require('papaparse');var Redis=require(_0x0cb0('0xe'));var authService=require(_0x0cb0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cb0('0x10'));var logger=require('../../config/logger')(_0x0cb0('0x11'));var utils=require(_0x0cb0('0x12'));var config=require(_0x0cb0('0x13'));var licenseUtil=require(_0x0cb0('0x14'));var db=require(_0x0cb0('0x15'))['db'];function respondWithStatusCode(_0x4725e1,_0x1bb0bc){_0x1bb0bc=_0x1bb0bc||0xcc;return function(_0x2a93a2){if(_0x2a93a2){return _0x4725e1[_0x0cb0('0x16')](_0x1bb0bc);}return _0x4725e1['status'](_0x1bb0bc)[_0x0cb0('0x17')]();};}function respondWithResult(_0x31364f,_0x36469e){_0x36469e=_0x36469e||0xc8;return function(_0x5a58b7){if(_0x5a58b7){return _0x31364f[_0x0cb0('0x18')](_0x36469e)['json'](_0x5a58b7);}};}function respondWithFilteredResult(_0x1c1d14,_0x5442de){return function(_0x59318a){if(_0x59318a){var _0x111561=typeof _0x5442de[_0x0cb0('0x19')]===_0x0cb0('0x1a')&&typeof _0x5442de[_0x0cb0('0x1b')]===_0x0cb0('0x1a');var _0x149ea3=_0x59318a[_0x0cb0('0x1c')];var _0x40fd01=_0x111561?0x0:_0x5442de[_0x0cb0('0x19')];var _0x290957=_0x111561?_0x59318a[_0x0cb0('0x1c')]:_0x5442de[_0x0cb0('0x19')]+_0x5442de[_0x0cb0('0x1b')];var _0x4a2948;if(_0x290957>=_0x149ea3){_0x290957=_0x149ea3;_0x4a2948=0xc8;}else{_0x4a2948=0xce;}_0x1c1d14[_0x0cb0('0x18')](_0x4a2948);return _0x1c1d14[_0x0cb0('0x1d')]('Content-Range',_0x40fd01+'-'+_0x290957+'/'+_0x149ea3)[_0x0cb0('0x1e')](_0x59318a);}return null;};}function patchUpdates(_0x53d15f){return function(_0x382b84){try{jsonpatch[_0x0cb0('0x1f')](_0x382b84,_0x53d15f,!![]);}catch(_0x2238a0){return BPromise[_0x0cb0('0x20')](_0x2238a0);}return _0x382b84['save']();};}function saveUpdates(_0x13c064,_0xc6ecd2){return function(_0x585f75){if(_0x585f75){return _0x585f75[_0x0cb0('0x21')](_0x13c064)['then'](function(_0x1828d){return _0x1828d;});}return null;};}function removeEntity(_0x5af3a1,_0x5e94ae){return function(_0x4e8ce0){if(_0x4e8ce0){return _0x4e8ce0[_0x0cb0('0x22')]()[_0x0cb0('0x23')](function(){_0x5af3a1[_0x0cb0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab28,_0x48f259){return function(_0x5e1854){if(!_0x5e1854){_0x1ab28['sendStatus'](0x194);}return _0x5e1854;};}function handleError(_0x24f4f1,_0x2f2f99){_0x2f2f99=_0x2f2f99||0x1f4;return function(_0x1dbac1){logger[_0x0cb0('0x24')](_0x1dbac1[_0x0cb0('0x25')]);if(_0x1dbac1['name']){delete _0x1dbac1['name'];}_0x24f4f1[_0x0cb0('0x18')](_0x2f2f99)[_0x0cb0('0x26')](_0x1dbac1);};}exports['index']=function(_0x239dd3,_0x3ba983){var _0xd280ee={},_0x51a121={},_0x2e23ac={'count':0x0,'rows':[]};var _0x16ee34=_[_0x0cb0('0x27')](db[_0x0cb0('0x28')][_0x0cb0('0x29')],function(_0x46fa58){return{'name':_0x46fa58['fieldName'],'type':_0x46fa58[_0x0cb0('0x2a')][_0x0cb0('0x2b')]};});_0x51a121[_0x0cb0('0x2c')]=_[_0x0cb0('0x27')](_0x16ee34,'name');_0x51a121['query']=_[_0x0cb0('0x2d')](_0x239dd3[_0x0cb0('0x2e')]);_0x51a121[_0x0cb0('0x2f')]=_[_0x0cb0('0x30')](_0x51a121[_0x0cb0('0x2c')],_0x51a121[_0x0cb0('0x2e')]);_0xd280ee[_0x0cb0('0x31')]=_[_0x0cb0('0x30')](_0x51a121[_0x0cb0('0x2c')],qs['fields'](_0x239dd3['query'][_0x0cb0('0x32')]));_0xd280ee[_0x0cb0('0x31')]=_0xd280ee[_0x0cb0('0x31')][_0x0cb0('0x33')]?_0xd280ee[_0x0cb0('0x31')]:_0x51a121[_0x0cb0('0x2c')];if(!_0x239dd3[_0x0cb0('0x2e')][_0x0cb0('0x34')](_0x0cb0('0x35'))){_0xd280ee['limit']=qs['limit'](_0x239dd3[_0x0cb0('0x2e')]['limit']);_0xd280ee[_0x0cb0('0x19')]=qs[_0x0cb0('0x19')](_0x239dd3[_0x0cb0('0x2e')][_0x0cb0('0x19')]);}_0xd280ee[_0x0cb0('0x36')]=qs['sort'](_0x239dd3['query'][_0x0cb0('0x37')]);_0xd280ee[_0x0cb0('0x38')]=qs[_0x0cb0('0x2f')](_[_0x0cb0('0x39')](_0x239dd3[_0x0cb0('0x2e')],_0x51a121['filters']),_0x16ee34);if(_0x239dd3[_0x0cb0('0x2e')][_0x0cb0('0x3a')]){_0xd280ee[_0x0cb0('0x38')]=_[_0x0cb0('0x3b')](_0xd280ee[_0x0cb0('0x38')],{'$or':_[_0x0cb0('0x27')](_0x16ee34,function(_0x5d6ddf){if(_0x5d6ddf['type']!==_0x0cb0('0x3c')){var _0x499e9f={};_0x499e9f[_0x5d6ddf[_0x0cb0('0x3d')]]={'$like':'%'+_0x239dd3[_0x0cb0('0x2e')][_0x0cb0('0x3a')]+'%'};return _0x499e9f;}})});}_0xd280ee=_[_0x0cb0('0x3b')]({},_0xd280ee,_0x239dd3[_0x0cb0('0x3e')]);var _0xd2dacd={'where':_0xd280ee['where']};return db['VtigerField']['count'](_0xd2dacd)['then'](function(_0x467284){_0x2e23ac['count']=_0x467284;if(_0x239dd3['query'][_0x0cb0('0x3f')]){_0xd280ee[_0x0cb0('0x40')]=[{'all':!![]}];}return db[_0x0cb0('0x28')][_0x0cb0('0x41')](_0xd280ee);})['then'](function(_0x3711c0){_0x2e23ac[_0x0cb0('0x42')]=_0x3711c0;return _0x2e23ac;})['then'](respondWithFilteredResult(_0x3ba983,_0xd280ee))[_0x0cb0('0x43')](handleError(_0x3ba983,null));};exports['show']=function(_0x313679,_0x5e4312){var _0x58f01a={'raw':!![],'where':{'id':_0x313679[_0x0cb0('0x44')]['id']}},_0x31a870={};_0x31a870[_0x0cb0('0x2c')]=_['keys'](db[_0x0cb0('0x28')][_0x0cb0('0x29')]);_0x31a870[_0x0cb0('0x2e')]=_['keys'](_0x313679[_0x0cb0('0x2e')]);_0x31a870[_0x0cb0('0x2f')]=_[_0x0cb0('0x30')](_0x31a870[_0x0cb0('0x2c')],_0x31a870[_0x0cb0('0x2e')]);_0x58f01a[_0x0cb0('0x31')]=_['intersection'](_0x31a870['model'],qs['fields'](_0x313679[_0x0cb0('0x2e')][_0x0cb0('0x32')]));_0x58f01a[_0x0cb0('0x31')]=_0x58f01a[_0x0cb0('0x31')][_0x0cb0('0x33')]?_0x58f01a[_0x0cb0('0x31')]:_0x31a870[_0x0cb0('0x2c')];if(_0x313679[_0x0cb0('0x2e')][_0x0cb0('0x3f')]){_0x58f01a[_0x0cb0('0x40')]=[{'all':!![]}];}_0x58f01a=_[_0x0cb0('0x3b')]({},_0x58f01a,_0x313679[_0x0cb0('0x3e')]);return db[_0x0cb0('0x28')][_0x0cb0('0x45')](_0x58f01a)[_0x0cb0('0x23')](handleEntityNotFound(_0x5e4312,null))[_0x0cb0('0x23')](respondWithResult(_0x5e4312,null))[_0x0cb0('0x43')](handleError(_0x5e4312,null));};exports[_0x0cb0('0x46')]=function(_0x2b15fa,_0x1eb637){return db[_0x0cb0('0x28')]['create'](_0x2b15fa[_0x0cb0('0x47')],{})[_0x0cb0('0x23')](respondWithResult(_0x1eb637,0xc9))[_0x0cb0('0x43')](handleError(_0x1eb637,null));};exports[_0x0cb0('0x21')]=function(_0x347400,_0x3cb520){if(_0x347400[_0x0cb0('0x47')]['id']){delete _0x347400['body']['id'];}return db[_0x0cb0('0x28')][_0x0cb0('0x45')]({'where':{'id':_0x347400[_0x0cb0('0x44')]['id']}})[_0x0cb0('0x23')](handleEntityNotFound(_0x3cb520,null))[_0x0cb0('0x23')](saveUpdates(_0x347400[_0x0cb0('0x47')],null))[_0x0cb0('0x23')](respondWithResult(_0x3cb520,null))[_0x0cb0('0x43')](handleError(_0x3cb520,null));};exports[_0x0cb0('0x22')]=function(_0xf6f7bd,_0x45be2a){return db['VtigerField'][_0x0cb0('0x45')]({'where':{'id':_0xf6f7bd[_0x0cb0('0x44')]['id']}})['then'](handleEntityNotFound(_0x45be2a,null))[_0x0cb0('0x23')](removeEntity(_0x45be2a,null))[_0x0cb0('0x43')](handleError(_0x45be2a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 57c3a3c..3f76e7f 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 _0xbc6b=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerField','int_vtiger_fields'];(function(_0x10a610,_0x5a950c){var _0x52640e=function(_0x5009d9){while(--_0x5009d9){_0x10a610['push'](_0x10a610['shift']());}};_0x52640e(++_0x5a950c);}(_0xbc6b,0x13d));var _0xbbc6=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xbc6b[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0xbbc6('0x0'));var util=require(_0xbbc6('0x1'));var logger=require(_0xbbc6('0x2'))(_0xbbc6('0x3'));var moment=require(_0xbbc6('0x4'));var BPromise=require(_0xbbc6('0x5'));var rp=require(_0xbbc6('0x6'));var fs=require('fs');var path=require(_0xbbc6('0x7'));var rimraf=require(_0xbbc6('0x8'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xbbc6('0x9')]=function(_0x4d6fa5,_0x59e715){return _0x4d6fa5[_0xbbc6('0xa')](_0xbbc6('0xb'),attributes,{'tableName':_0xbbc6('0xc'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xbbc6('0xd'),_0xbbc6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x32aca0,_0x319117){var _0x3eaf3d=function(_0x1bf9e9){while(--_0x1bf9e9){_0x32aca0['push'](_0x32aca0['shift']());}};_0x3eaf3d(++_0x319117);}(_0x3ee1,0xa3));var _0x13ee=function(_0x116df6,_0x20cf60){_0x116df6=_0x116df6-0x0;var _0xebd5d6=_0x3ee1[_0x116df6];return _0xebd5d6;};'use strict';var _=require(_0x13ee('0x0'));var util=require(_0x13ee('0x1'));var logger=require('../../config/logger')(_0x13ee('0x2'));var moment=require(_0x13ee('0x3'));var BPromise=require(_0x13ee('0x4'));var rp=require(_0x13ee('0x5'));var fs=require('fs');var path=require(_0x13ee('0x6'));var rimraf=require(_0x13ee('0x7'));var config=require(_0x13ee('0x8'));var attributes=require(_0x13ee('0x9'));module[_0x13ee('0xa')]=function(_0x624aac,_0x501b01){return _0x624aac[_0x13ee('0xb')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x13ee('0xc'),'fields':[_0x13ee('0xd'),_0x13ee('0xe')],'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 a322dd0..870bc0b 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 _0x86e3=['../../config/environment','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../config/logger','rpc'];(function(_0x27553f,_0x13be01){var _0x3296c7=function(_0x2fb54f){while(--_0x2fb54f){_0x27553f['push'](_0x27553f['shift']());}};_0x3296c7(++_0x13be01);}(_0x86e3,0x1ac));var _0x386e=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x86e3[_0x4b7b9b];return _0x3be710;};'use strict';var _=require(_0x386e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x386e('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(_0x386e('0x2'))(_0x386e('0x3'));var config=require(_0x386e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x386e('0x5')][_0x386e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2a0c95,_0x15e00f,_0x222f61){return new BPromise(function(_0x3d3edf,_0x144e81){return client[_0x386e('0x7')](_0x2a0c95,_0x222f61)[_0x386e('0x8')](function(_0x4bf3d3){logger[_0x386e('0x9')]('VtigerField,\x20%s,\x20%s',_0x15e00f,_0x386e('0xa'));logger[_0x386e('0xb')](_0x386e('0xc'),_0x15e00f,_0x386e('0xa'),JSON['stringify'](_0x4bf3d3));if(_0x4bf3d3['error']){if(_0x4bf3d3[_0x386e('0xd')]['code']===0x1f4){logger[_0x386e('0xd')](_0x386e('0xe'),_0x15e00f,_0x4bf3d3['error'][_0x386e('0xf')]);return _0x144e81(_0x4bf3d3[_0x386e('0xd')]['message']);}logger['error'](_0x386e('0xe'),_0x15e00f,_0x4bf3d3[_0x386e('0xd')][_0x386e('0xf')]);return _0x3d3edf(_0x4bf3d3['error']['message']);}else{logger[_0x386e('0x9')](_0x386e('0xe'),_0x15e00f,_0x386e('0xa'));_0x3d3edf(_0x4bf3d3[_0x386e('0x10')][_0x386e('0xf')]);}})[_0x386e('0x11')](function(_0x171a13){logger[_0x386e('0xd')](_0x386e('0xe'),_0x15e00f,_0x171a13);_0x144e81(_0x171a13);});});} \ No newline at end of file +var _0xf411=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x3ae723,_0x16ca57){var _0x54959a=function(_0x33ef5e){while(--_0x33ef5e){_0x3ae723['push'](_0x3ae723['shift']());}};_0x54959a(++_0x16ca57);}(_0xf411,0x189));var _0x1f41=function(_0x20c8e7,_0x5e0dd6){_0x20c8e7=_0x20c8e7-0x0;var _0x32eba9=_0xf411[_0x20c8e7];return _0x32eba9;};'use strict';var _=require(_0x1f41('0x0'));var util=require('util');var moment=require(_0x1f41('0x1'));var BPromise=require(_0x1f41('0x2'));var rs=require(_0x1f41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f41('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f41('0x5'))('rpc');var config=require(_0x1f41('0x6'));var jayson=require(_0x1f41('0x7'));var client=jayson[_0x1f41('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e7b81,_0x30f19a,_0x36b97c){return new BPromise(function(_0x386eac,_0x56362a){return client[_0x1f41('0x9')](_0x1e7b81,_0x36b97c)[_0x1f41('0xa')](function(_0x5e82a6){logger[_0x1f41('0xb')](_0x1f41('0xc'),_0x30f19a,'request\x20sent');logger[_0x1f41('0xd')](_0x1f41('0xe'),_0x30f19a,_0x1f41('0xf'),JSON[_0x1f41('0x10')](_0x5e82a6));if(_0x5e82a6[_0x1f41('0x11')]){if(_0x5e82a6[_0x1f41('0x11')][_0x1f41('0x12')]===0x1f4){logger['error'](_0x1f41('0xc'),_0x30f19a,_0x5e82a6['error'][_0x1f41('0x13')]);return _0x56362a(_0x5e82a6[_0x1f41('0x11')][_0x1f41('0x13')]);}logger['error'](_0x1f41('0xc'),_0x30f19a,_0x5e82a6[_0x1f41('0x11')][_0x1f41('0x13')]);return _0x386eac(_0x5e82a6[_0x1f41('0x11')][_0x1f41('0x13')]);}else{logger[_0x1f41('0xb')](_0x1f41('0xc'),_0x30f19a,'request\x20sent');_0x386eac(_0x5e82a6[_0x1f41('0x14')][_0x1f41('0x13')]);}})[_0x1f41('0x15')](function(_0x5788b7){logger[_0x1f41('0x11')](_0x1f41('0xc'),_0x30f19a,_0x5788b7);_0x56362a(_0x5788b7);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6777693..361fc8e 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 _0xe191=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id'];(function(_0x58b62f,_0x506799){var _0x112cad=function(_0x17cd43){while(--_0x17cd43){_0x58b62f['push'](_0x58b62f['shift']());}};_0x112cad(++_0x506799);}(_0xe191,0x98));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1e19('0x0'));var util=require(_0x1e19('0x1'));var path=require(_0x1e19('0x2'));var timeout=require(_0x1e19('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e19('0x4'));var auth=require(_0x1e19('0x5'));var interaction=require(_0x1e19('0x6'));var config=require('../../config/environment');var controller=require(_0x1e19('0x7'));router[_0x1e19('0x8')]('/',auth[_0x1e19('0x9')](),controller['index']);router[_0x1e19('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e19('0xa')]);router[_0x1e19('0x8')](_0x1e19('0xb'),auth['isAuthenticated'](),controller[_0x1e19('0xc')]);router[_0x1e19('0x8')](_0x1e19('0xd'),auth[_0x1e19('0x9')](),controller[_0x1e19('0xe')]);router[_0x1e19('0xf')]('/',auth[_0x1e19('0x9')](),controller[_0x1e19('0x10')]);router[_0x1e19('0xf')](_0x1e19('0xb'),auth[_0x1e19('0x9')](),controller[_0x1e19('0x11')]);router['put'](_0x1e19('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1e19('0x12'),auth[_0x1e19('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x344f=['isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','express','fs-extra','../../config/environment','get'];(function(_0x2c3eac,_0x34d157){var _0x4feaec=function(_0x3f76cd){while(--_0x3f76cd){_0x2c3eac['push'](_0x2c3eac['shift']());}};_0x4feaec(++_0x34d157);}(_0x344f,0x14d));var _0xf344=function(_0x58de84,_0x52467b){_0x58de84=_0x58de84-0x0;var _0x8987cd=_0x344f[_0x58de84];return _0x8987cd;};'use strict';var multer=require(_0xf344('0x0'));var util=require(_0xf344('0x1'));var path=require(_0xf344('0x2'));var timeout=require('connect-timeout');var express=require(_0xf344('0x3'));var router=express['Router']();var fs_extra=require(_0xf344('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf344('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xf344('0x6')]('/',auth[_0xf344('0x7')](),controller[_0xf344('0x8')]);router[_0xf344('0x6')](_0xf344('0x9'),auth[_0xf344('0x7')](),controller['show']);router[_0xf344('0x6')](_0xf344('0xa'),auth['isAuthenticated'](),controller[_0xf344('0xb')]);router['get'](_0xf344('0xc'),auth[_0xf344('0x7')](),controller[_0xf344('0xd')]);router[_0xf344('0xe')]('/',auth['isAuthenticated'](),controller[_0xf344('0xf')]);router[_0xf344('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf344('0x10')]);router[_0xf344('0x11')](_0xf344('0x9'),auth['isAuthenticated'](),controller[_0xf344('0x12')]);router[_0xf344('0x13')](_0xf344('0x9'),auth[_0xf344('0x7')](),controller['destroy']);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 3843354..6055fc8 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 _0x9582=['remoteUri','ENUM','password','token','integrationTab','sequelize','exports','STRING','username'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x9582,0x95));var _0x2958=function(_0x1c61da,_0x42c7d9){_0x1c61da=_0x1c61da-0x0;var _0x4632ca=_0x9582[_0x1c61da];return _0x4632ca;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'name':{'type':Sequelize[_0x2958('0x2')]},'description':{'type':Sequelize[_0x2958('0x2')]},'username':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2958('0x2')]},'remoteUri':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x4')},'authType':{'type':Sequelize[_0x2958('0x5')](_0x2958('0x6'),_0x2958('0x7')),'defaultValue':_0x2958('0x6')},'serverUrl':{'type':Sequelize[_0x2958('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2958('0x5')](_0x2958('0x8'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x9e2e=['STRING','remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports'];(function(_0x32a484,_0xd197fa){var _0x3f9994=function(_0x5f5796){while(--_0x5f5796){_0x32a484['push'](_0x32a484['shift']());}};_0x3f9994(++_0xd197fa);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x256541,_0x3c9aba){_0x256541=_0x256541-0x0;var _0x4ed503=_0x9e2e[_0x256541];return _0x4ed503;};'use strict';var Sequelize=require(_0xe9e2('0x0'));module[_0xe9e2('0x1')]={'name':{'type':Sequelize[_0xe9e2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe9e2('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe9e2('0x2')]},'remoteUri':{'type':Sequelize[_0xe9e2('0x2')],'unique':_0xe9e2('0x3')},'authType':{'type':Sequelize[_0xe9e2('0x4')](_0xe9e2('0x5'),_0xe9e2('0x6')),'defaultValue':_0xe9e2('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe9e2('0x4')]('integrationTab',_0xe9e2('0x7')),'defaultValue':_0xe9e2('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 78377e0..11078a6 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 _0x1be1=['type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','options','ZendeskAccount','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','pick','length','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','ValidationError','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','status','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1be1,0x192));var _0x11be=function(_0xa446f7,_0x17d62c){_0xa446f7=_0xa446f7-0x0;var _0x28d7d2=_0x1be1[_0xa446f7];return _0x28d7d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ff31f,_0x2dad05){_0x2dad05=_0x2dad05||0xcc;return function(_0x4ce3ae){if(_0x4ce3ae){return _0x3ff31f[_0x11be('0x17')](_0x2dad05);}return _0x3ff31f['status'](_0x2dad05)['end']();};}function respondWithResult(_0x569842,_0x4b6e7e){_0x4b6e7e=_0x4b6e7e||0xc8;return function(_0x4e4efd){if(_0x4e4efd){return _0x569842['status'](_0x4b6e7e)['json'](_0x4e4efd);}};}function respondWithFilteredResult(_0x2280e2,_0x52bbef){return function(_0x31047c){if(_0x31047c){var _0x241eec=typeof _0x52bbef[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x52bbef['limit']===_0x11be('0x19');var _0x403d7a=_0x31047c['count'];var _0x299f45=_0x241eec?0x0:_0x52bbef[_0x11be('0x18')];var _0x23aa5f=_0x241eec?_0x31047c['count']:_0x52bbef['offset']+_0x52bbef[_0x11be('0x1a')];var _0x976e51;if(_0x23aa5f>=_0x403d7a){_0x23aa5f=_0x403d7a;_0x976e51=0xc8;}else{_0x976e51=0xce;}_0x2280e2[_0x11be('0x1b')](_0x976e51);return _0x2280e2[_0x11be('0x1c')]('Content-Range',_0x299f45+'-'+_0x23aa5f+'/'+_0x403d7a)[_0x11be('0x1d')](_0x31047c);}return null;};}function patchUpdates(_0x45136f){return function(_0x1c6dd4){try{jsonpatch[_0x11be('0x1e')](_0x1c6dd4,_0x45136f,!![]);}catch(_0x7c554a){return BPromise[_0x11be('0x1f')](_0x7c554a);}return _0x1c6dd4[_0x11be('0x20')]();};}function saveUpdates(_0x17678d,_0x3aea14){return function(_0x2782ae){if(_0x2782ae){return _0x2782ae['update'](_0x17678d)[_0x11be('0x21')](function(_0x46b7c2){return _0x46b7c2;});}return null;};}function removeEntity(_0x2fe43c,_0x5d1690){return function(_0x4b329b){if(_0x4b329b){return _0x4b329b[_0x11be('0x22')]()[_0x11be('0x21')](function(){_0x2fe43c[_0x11be('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x106167,_0x518e2b){return function(_0x46111f){if(!_0x46111f){_0x106167['sendStatus'](0x194);}return _0x46111f;};}function handleError(_0x28310d,_0xb11f3d){_0xb11f3d=_0xb11f3d||0x1f4;return function(_0x5002d7){logger[_0x11be('0x23')](_0x5002d7[_0x11be('0x24')]);if(_0x5002d7[_0x11be('0x25')]){delete _0x5002d7[_0x11be('0x25')];}_0x28310d[_0x11be('0x1b')](_0xb11f3d)[_0x11be('0x26')](_0x5002d7);};}exports[_0x11be('0x27')]=function(_0x2cf9aa,_0x43ab30){var _0x5966c5={},_0x32c796={},_0x4e899f={'count':0x0,'rows':[]};var _0x182f6b=_[_0x11be('0x28')](db['ZendeskAccount']['rawAttributes'],function(_0x49fd5c){return{'name':_0x49fd5c[_0x11be('0x29')],'type':_0x49fd5c[_0x11be('0x2a')][_0x11be('0x2b')]};});_0x32c796[_0x11be('0x2c')]=_[_0x11be('0x28')](_0x182f6b,_0x11be('0x25'));_0x32c796[_0x11be('0x2d')]=_[_0x11be('0x2e')](_0x2cf9aa['query']);_0x32c796[_0x11be('0x2f')]=_[_0x11be('0x30')](_0x32c796[_0x11be('0x2c')],_0x32c796[_0x11be('0x2d')]);_0x5966c5[_0x11be('0x31')]=_[_0x11be('0x30')](_0x32c796['model'],qs[_0x11be('0x32')](_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x32')]));_0x5966c5[_0x11be('0x31')]=_0x5966c5[_0x11be('0x31')]['length']?_0x5966c5[_0x11be('0x31')]:_0x32c796[_0x11be('0x2c')];if(!_0x2cf9aa[_0x11be('0x2d')]['hasOwnProperty'](_0x11be('0x33'))){_0x5966c5['limit']=qs['limit'](_0x2cf9aa['query']['limit']);_0x5966c5[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x2cf9aa[_0x11be('0x2d')]['offset']);}_0x5966c5[_0x11be('0x34')]=qs[_0x11be('0x35')](_0x2cf9aa['query'][_0x11be('0x35')]);_0x5966c5['where']=qs[_0x11be('0x2f')](_['pick'](_0x2cf9aa[_0x11be('0x2d')],_0x32c796[_0x11be('0x2f')]),_0x182f6b);if(_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x36')]){_0x5966c5['where']=_[_0x11be('0x37')](_0x5966c5[_0x11be('0x38')],{'$or':_[_0x11be('0x28')](_0x182f6b,function(_0x18d402){if(_0x18d402['type']!==_0x11be('0x39')){var _0x361877={};_0x361877[_0x18d402[_0x11be('0x25')]]={'$like':'%'+_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x36')]+'%'};return _0x361877;}})});}_0x5966c5=_[_0x11be('0x37')]({},_0x5966c5,_0x2cf9aa[_0x11be('0x3a')]);var _0x5ee47c={'where':_0x5966c5[_0x11be('0x38')]};return db[_0x11be('0x3b')]['count'](_0x5ee47c)[_0x11be('0x21')](function(_0x28df0f){_0x4e899f['count']=_0x28df0f;if(_0x2cf9aa[_0x11be('0x2d')]['includeAll']){_0x5966c5[_0x11be('0x3c')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x11be('0x3d')](_0x5966c5);})[_0x11be('0x21')](function(_0x5db494){_0x4e899f[_0x11be('0x3e')]=_0x5db494;return _0x4e899f;})['then'](respondWithFilteredResult(_0x43ab30,_0x5966c5))[_0x11be('0x3f')](handleError(_0x43ab30,null));};exports[_0x11be('0x40')]=function(_0x2deae3,_0x383604){var _0x2b847a={'raw':![],'where':{'id':_0x2deae3[_0x11be('0x41')]['id']}},_0x182c28={};_0x182c28['model']=_[_0x11be('0x2e')](db[_0x11be('0x3b')][_0x11be('0x42')]);_0x182c28[_0x11be('0x2d')]=_['keys'](_0x2deae3['query']);_0x182c28['filters']=_[_0x11be('0x30')](_0x182c28['model'],_0x182c28[_0x11be('0x2d')]);_0x2b847a['attributes']=_[_0x11be('0x30')](_0x182c28[_0x11be('0x2c')],qs[_0x11be('0x32')](_0x2deae3[_0x11be('0x2d')][_0x11be('0x32')]));_0x2b847a[_0x11be('0x31')]=_0x2b847a[_0x11be('0x31')]['length']?_0x2b847a[_0x11be('0x31')]:_0x182c28['model'];if(_0x2deae3[_0x11be('0x2d')][_0x11be('0x43')]){_0x2b847a[_0x11be('0x3c')]=[{'all':!![]}];}_0x2b847a=_['merge']({},_0x2b847a,_0x2deae3['options']);return db['ZendeskAccount'][_0x11be('0x44')](_0x2b847a)[_0x11be('0x21')](handleEntityNotFound(_0x383604,null))['then'](respondWithResult(_0x383604,null))['catch'](handleError(_0x383604,null));};exports['create']=function(_0x44e2e8,_0x1dfece){return db[_0x11be('0x3b')][_0x11be('0x45')](_0x44e2e8[_0x11be('0x46')],{})[_0x11be('0x21')](respondWithResult(_0x1dfece,0xc9))[_0x11be('0x3f')](handleError(_0x1dfece,null));};exports[_0x11be('0x47')]=function(_0x2ce110,_0x205582){if(_0x2ce110[_0x11be('0x46')]['id']){delete _0x2ce110['body']['id'];}return db[_0x11be('0x3b')][_0x11be('0x44')]({'where':{'id':_0x2ce110['params']['id']}})['then'](handleEntityNotFound(_0x205582,null))['then'](saveUpdates(_0x2ce110[_0x11be('0x46')],null))['then'](respondWithResult(_0x205582,null))[_0x11be('0x3f')](handleError(_0x205582,null));};exports[_0x11be('0x22')]=function(_0x2716dc,_0x1fb48d){return db[_0x11be('0x3b')][_0x11be('0x44')]({'where':{'id':_0x2716dc[_0x11be('0x41')]['id']}})[_0x11be('0x21')](handleEntityNotFound(_0x1fb48d,null))[_0x11be('0x21')](removeEntity(_0x1fb48d,null))['catch'](handleError(_0x1fb48d,null));};exports[_0x11be('0x48')]=function(_0x4ad866,_0x1737ef,_0x2e74f0){var _0x5a776a={};var _0x46f15b={};var _0x1164a4;var _0x4c0e37;return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x4ad866['params']['id']}})['then'](handleEntityNotFound(_0x1737ef,null))[_0x11be('0x21')](function(_0x2886ac){if(_0x2886ac){_0x1164a4=_0x2886ac;_0x46f15b['model']=_['keys'](db[_0x11be('0x4a')][_0x11be('0x42')]);_0x46f15b[_0x11be('0x2d')]=_['keys'](_0x4ad866['query']);_0x46f15b['filters']=_[_0x11be('0x30')](_0x46f15b[_0x11be('0x2c')],_0x46f15b[_0x11be('0x2d')]);_0x5a776a['attributes']=_['intersection'](_0x46f15b[_0x11be('0x2c')],qs[_0x11be('0x32')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x32')]));_0x5a776a['attributes']=_0x5a776a[_0x11be('0x31')]['length']?_0x5a776a['attributes']:_0x46f15b['model'];_0x5a776a['order']=qs[_0x11be('0x35')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x35')]);_0x5a776a[_0x11be('0x38')]=qs[_0x11be('0x2f')](_[_0x11be('0x4b')](_0x4ad866[_0x11be('0x2d')],_0x46f15b['filters']));if(_0x4ad866['query'][_0x11be('0x36')]){_0x5a776a[_0x11be('0x38')]=_[_0x11be('0x37')](_0x5a776a[_0x11be('0x38')],{'$or':_[_0x11be('0x28')](_0x5a776a[_0x11be('0x31')],function(_0xb56259){var _0x3816ab={};_0x3816ab[_0xb56259]={'$like':'%'+_0x4ad866[_0x11be('0x2d')]['filter']+'%'};return _0x3816ab;})});}_0x5a776a=_[_0x11be('0x37')]({},_0x5a776a,_0x4ad866[_0x11be('0x3a')]);return _0x1164a4[_0x11be('0x48')](_0x5a776a);}})['then'](function(_0x3b3cf9){if(_0x3b3cf9){_0x4c0e37=_0x3b3cf9[_0x11be('0x4c')];if(!_0x4ad866['query']['hasOwnProperty'](_0x11be('0x33'))){_0x5a776a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x4ad866[_0x11be('0x2d')]['limit']);_0x5a776a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x18')]);}return _0x1164a4[_0x11be('0x48')](_0x5a776a);}})[_0x11be('0x21')](function(_0x44c88d){if(_0x44c88d){return _0x44c88d?{'count':_0x4c0e37,'rows':_0x44c88d}:null;}})[_0x11be('0x21')](respondWithResult(_0x1737ef,null))[_0x11be('0x3f')](handleError(_0x1737ef,null));};exports['addConfiguration']=function(_0x558a57,_0x9237ea,_0x138156){if(_0x558a57['body']['id']){delete _0x558a57[_0x11be('0x46')]['id'];}return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x558a57[_0x11be('0x41')]['id']}})[_0x11be('0x21')](handleEntityNotFound(_0x9237ea,null))[_0x11be('0x21')](function(_0x308599){if(_0x308599){_0x558a57['body']['AccountId']=_0x308599['id'];_0x558a57[_0x11be('0x46')][_0x11be('0x4d')]=integrations[_0x11be('0x4e')](_0x558a57['body'][_0x11be('0x4f')],_0x558a57[_0x11be('0x46')][_0x11be('0x2a')]);_0x558a57[_0x11be('0x46')][_0x11be('0x50')]=integrations[_0x11be('0x51')](_0x558a57[_0x11be('0x46')][_0x11be('0x4f')],_0x558a57[_0x11be('0x46')][_0x11be('0x2a')]);return db[_0x11be('0x4a')][_0x11be('0x45')](_0x558a57[_0x11be('0x46')],{'include':[{'model':db[_0x11be('0x52')],'as':_0x11be('0x4d')},{'model':db[_0x11be('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x9237ea,null))[_0x11be('0x3f')](handleError(_0x9237ea,null));};exports['getFields']=function(_0x1c92cd,_0xbe1daf,_0x422e33){var _0x2f895f='';return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x1c92cd[_0x11be('0x41')]['id']},'attributes':['id',_0x11be('0x53'),_0x11be('0x54'),'token',_0x11be('0x55'),_0x11be('0x56')]})[_0x11be('0x21')](handleEntityNotFound(_0xbe1daf,null))['then'](function(_0x3006e2){if(_0x3006e2){_0x2f895f=_0x3006e2[_0x11be('0x56')];var _0x530c68=_0x2f895f['slice'](-0x1);if(_0x530c68==='/'){_0x2f895f=_0x2f895f['substring'](0x0,_0x2f895f['lastIndexOf'](_0x530c68));}var _0xe5d364={'method':_0x11be('0x57'),'uri':util[_0x11be('0x58')](_0x11be('0x59'),_0x2f895f,_0x11be('0x5a')),'json':!![]};switch(_0x3006e2['authType']){case _0x11be('0x54'):_0xe5d364[_0x11be('0x5b')]={'Authorization':util[_0x11be('0x58')](_0x11be('0x5c'),new Buffer(util[_0x11be('0x58')]('%s:%s',_0x3006e2[_0x11be('0x53')],_0x3006e2[_0x11be('0x54')]))[_0x11be('0x5d')](_0x11be('0x5e')))};break;case'token':_0xe5d364[_0x11be('0x5b')]={'Authorization':util[_0x11be('0x58')](_0x11be('0x5c'),new Buffer(util[_0x11be('0x58')](_0x11be('0x5f'),_0x3006e2[_0x11be('0x53')],_0x3006e2['token']))[_0x11be('0x5d')](_0x11be('0x5e')))};break;default:throw new db[(_0x11be('0x60'))][(_0x11be('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0xe5d364);}})[_0x11be('0x21')](function(_0x531953){if(_0x531953){var _0x278650=[_0x11be('0x62'),_0x11be('0x63'),_0x11be('0x64'),'assignee'];_[_0x11be('0x65')](_0x531953[_0x11be('0x5a')],function(_0x4e77ca){return _0x278650[_0x11be('0x66')](_0x4e77ca[_0x11be('0x2a')]);});return{'count':_0x531953[_0x11be('0x5a')][_0x11be('0x4c')],'rows':_['map'](_0x531953[_0x11be('0x5a')],function(_0x2ab4ce){return{'id':_0x2ab4ce['id'],'name':_0x2ab4ce[_0x11be('0x67')]>0x7?_0x2ab4ce[_0x11be('0x68')]:_0x2ab4ce[_0x11be('0x2a')],'custom':_0x2ab4ce[_0x11be('0x67')]>0x7?!![]:![],'options':_0x2ab4ce[_0x11be('0x69')]?_0x2ab4ce[_0x11be('0x69')]:_0x2ab4ce['custom_field_options']?_0x2ab4ce[_0x11be('0x6a')]:[]};})};}})['then'](respondWithResult(_0xbe1daf,null))['catch'](function(_0x151b88){var _0x658255=_0x1c92cd[_0x11be('0x2d')][_0x11be('0x6b')]?0x1f4:_0x151b88[_0x11be('0x6c')]||0x1f4;logger[_0x11be('0x23')](_0x11be('0x6d'),'getFields',_0x658255,JSON['stringify'](_0x151b88));delete _0x151b88[_0x11be('0x25')];if(_0x658255===0x191){_0x658255=0x190;}_0xbe1daf['status'](_0x658255)['send'](_0x1c92cd[_0x11be('0x2d')]['test']?{'message':_0x11be('0x6e'),'statusCode':_0x151b88[_0x11be('0x6c')]}:_0x151b88);});}; \ No newline at end of file +var _0x04b8=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x1f5f70,_0x531320){var _0x25b14b=function(_0x5e6457){while(--_0x5e6457){_0x1f5f70['push'](_0x1f5f70['shift']());}};_0x25b14b(++_0x531320);}(_0x04b8,0x159));var _0x804b=function(_0x40189e,_0x2f6e20){_0x40189e=_0x40189e-0x0;var _0x2064f3=_0x04b8[_0x40189e];return _0x2064f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['ZendeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['ZendeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['ZendeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['ZendeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['ZendeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['ZendeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['ZendeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58'),_0x804b('0x59'),'authType',_0x804b('0x5a')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x2541cd){if(_0x2541cd){_0x39ed3c=_0x2541cd[_0x804b('0x5a')];var _0x549504=_0x39ed3c[_0x804b('0x5b')](-0x1);if(_0x549504==='/'){_0x39ed3c=_0x39ed3c['substring'](0x0,_0x39ed3c[_0x804b('0x5c')](_0x549504));}var _0x3e2813={'method':_0x804b('0x5d'),'uri':util[_0x804b('0x5e')](_0x804b('0x5f'),_0x39ed3c,_0x804b('0x60')),'json':!![]};switch(_0x2541cd[_0x804b('0x61')]){case'password':_0x3e2813[_0x804b('0x62')]={'Authorization':util['format'](_0x804b('0x63'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x64'),_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x58')]))[_0x804b('0x65')](_0x804b('0x66')))};break;case _0x804b('0x59'):_0x3e2813[_0x804b('0x62')]={'Authorization':util[_0x804b('0x5e')](_0x804b('0x63'),new Buffer(util['format']('%s/token:%s',_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x59')]))[_0x804b('0x65')](_0x804b('0x66')))};break;default:throw new db['Sequelize'][(_0x804b('0x67'))](_0x804b('0x68'));}return rp(_0x3e2813);}})[_0x804b('0x26')](function(_0x3dda89){if(_0x3dda89){var _0x260419=[_0x804b('0x69'),_0x804b('0x6a'),_0x804b('0x6b'),_0x804b('0x6c')];_[_0x804b('0x6d')](_0x3dda89['ticket_fields'],function(_0x5a6661){return _0x260419[_0x804b('0x6e')](_0x5a6661[_0x804b('0x2e')]);});return{'count':_0x3dda89['ticket_fields'][_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x3dda89['ticket_fields'],function(_0x345bf7){return{'id':_0x345bf7['id'],'name':_0x345bf7['position']>0x7?_0x345bf7['title']:_0x345bf7[_0x804b('0x2e')],'custom':_0x345bf7[_0x804b('0x6f')]>0x7?!![]:![],'options':_0x345bf7['system_field_options']?_0x345bf7['system_field_options']:_0x345bf7[_0x804b('0x70')]?_0x345bf7[_0x804b('0x70')]:[]};})};}})['then'](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x5e2756){var _0x42dfc3=_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?0x1f4:_0x5e2756['statusCode']||0x1f4;logger[_0x804b('0x72')](_0x804b('0x73'),_0x804b('0x56'),_0x42dfc3,JSON[_0x804b('0x74')](_0x5e2756));delete _0x5e2756[_0x804b('0x2a')];if(_0x42dfc3===0x191){_0x42dfc3=0x190;}_0x1bb4ec[_0x804b('0x1a')](_0x42dfc3)[_0x804b('0x2b')](_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?{'message':_0x804b('0x75'),'statusCode':_0x5e2756['statusCode']}:_0x5e2756);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 956e3d5..0482537 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 _0x4c7c=['define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x4c7c,0x139));var _0xc4c7=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x4c7c[_0x1f99a0];return _0x1e0849;};'use strict';var _=require('lodash');var util=require(_0xc4c7('0x0'));var logger=require(_0xc4c7('0x1'))('api');var moment=require(_0xc4c7('0x2'));var BPromise=require(_0xc4c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4c7('0x4'));var rimraf=require(_0xc4c7('0x5'));var config=require(_0xc4c7('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x35272c,_0x3c57be){return _0x35272c[_0xc4c7('0x7')](_0xc4c7('0x8'),attributes,{'tableName':_0xc4c7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7523=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x17981a,_0xa41b41){var _0x4fcd13=function(_0x37838e){while(--_0x37838e){_0x17981a['push'](_0x17981a['shift']());}};_0x4fcd13(++_0xa41b41);}(_0x7523,0x189));var _0x3752=function(_0x16aab4,_0x2d549c){_0x16aab4=_0x16aab4-0x0;var _0x5cd727=_0x7523[_0x16aab4];return _0x5cd727;};'use strict';var _=require(_0x3752('0x0'));var util=require(_0x3752('0x1'));var logger=require(_0x3752('0x2'))('api');var moment=require(_0x3752('0x3'));var BPromise=require(_0x3752('0x4'));var rp=require(_0x3752('0x5'));var fs=require('fs');var path=require(_0x3752('0x6'));var rimraf=require(_0x3752('0x7'));var config=require(_0x3752('0x8'));var attributes=require(_0x3752('0x9'));var integrations=require(_0x3752('0xa'));module[_0x3752('0xb')]=function(_0x1269b1,_0x21a91e){return _0x1269b1[_0x3752('0xc')](_0x3752('0xd'),attributes,{'tableName':_0x3752('0xe'),'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 6f79178..793ca65 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 _0x1c0c=['where','limit','include','map','model','attributes','ShowZendeskAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetZendeskAccount','ZendeskAccount','findAll','options'];(function(_0x2f6897,_0x3a5444){var _0x58651d=function(_0x76af0f){while(--_0x76af0f){_0x2f6897['push'](_0x2f6897['shift']());}};_0x58651d(++_0x3a5444);}(_0x1c0c,0x1c5));var _0xc1c0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x1c0c[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xc1c0('0x0'));var util=require(_0xc1c0('0x1'));var moment=require(_0xc1c0('0x2'));var BPromise=require(_0xc1c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c0('0x4'));var db=require(_0xc1c0('0x5'))['db'];var utils=require(_0xc1c0('0x6'));var logger=require(_0xc1c0('0x7'))(_0xc1c0('0x8'));var config=require(_0xc1c0('0x9'));var jayson=require(_0xc1c0('0xa'));var client=jayson['client'][_0xc1c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ecbf4,_0x31e6e0,_0x4de445){return new BPromise(function(_0x59d8be,_0x2a82c){return client[_0xc1c0('0xc')](_0x2ecbf4,_0x4de445)[_0xc1c0('0xd')](function(_0x4139df){logger['info'](_0xc1c0('0xe'),_0x31e6e0,_0xc1c0('0xf'));logger[_0xc1c0('0x10')](_0xc1c0('0x11'),_0x31e6e0,'request\x20sent',JSON[_0xc1c0('0x12')](_0x4139df));if(_0x4139df[_0xc1c0('0x13')]){if(_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x14')]===0x1f4){logger[_0xc1c0('0x13')](_0xc1c0('0xe'),_0x31e6e0,_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);return _0x2a82c(_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);}logger[_0xc1c0('0x13')](_0xc1c0('0xe'),_0x31e6e0,_0x4139df[_0xc1c0('0x13')][_0xc1c0('0x15')]);return _0x59d8be(_0x4139df['error'][_0xc1c0('0x15')]);}else{logger[_0xc1c0('0x16')]('ZendeskAccount,\x20%s,\x20%s',_0x31e6e0,_0xc1c0('0xf'));_0x59d8be(_0x4139df['result']['message']);}})[_0xc1c0('0x17')](function(_0x2bbcfc){logger['error'](_0xc1c0('0xe'),_0x31e6e0,_0x2bbcfc);_0x2a82c(_0x2bbcfc);});});}exports[_0xc1c0('0x18')]=function(_0xc21080){var _0x160154=this;return new Promise(function(_0x3986e2,_0x482a59){return db[_0xc1c0('0x19')][_0xc1c0('0x1a')]({'raw':_0xc21080['options']?_0xc21080[_0xc1c0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xc21080[_0xc1c0('0x1b')]?_0xc21080['options'][_0xc1c0('0x1c')]||null:null,'attributes':_0xc21080[_0xc1c0('0x1b')]?_0xc21080[_0xc1c0('0x1b')]['attributes']||null:null,'limit':_0xc21080[_0xc1c0('0x1b')]?_0xc21080[_0xc1c0('0x1b')][_0xc1c0('0x1d')]||null:null,'include':_0xc21080['options']?_0xc21080['options'][_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0xc21080['options'][_0xc1c0('0x1e')],function(_0x5dbb14){return{'model':db[_0x5dbb14[_0xc1c0('0x20')]],'as':_0x5dbb14['as'],'attributes':_0x5dbb14['attributes'],'include':_0x5dbb14[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x5dbb14[_0xc1c0('0x1e')],function(_0x59fe9f){return{'model':db[_0x59fe9f[_0xc1c0('0x20')]],'as':_0x59fe9f['as'],'attributes':_0x59fe9f[_0xc1c0('0x21')],'include':_0x59fe9f[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x59fe9f[_0xc1c0('0x1e')],function(_0x480edb){return{'model':db[_0x480edb[_0xc1c0('0x20')]],'as':_0x480edb['as'],'attributes':_0x480edb[_0xc1c0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c0('0xd')](function(_0x47bb7e){logger['info'](_0xc1c0('0x18'),_0xc21080);logger[_0xc1c0('0x10')](_0xc1c0('0x18'),_0xc21080,JSON[_0xc1c0('0x12')](_0x47bb7e));_0x3986e2(_0x47bb7e);})[_0xc1c0('0x17')](function(_0x2c5fed){logger[_0xc1c0('0x13')](_0xc1c0('0x18'),_0x2c5fed['message'],_0xc21080);_0x482a59(_0x160154[_0xc1c0('0x13')](0x1f4,_0x2c5fed[_0xc1c0('0x15')]));});});};exports[_0xc1c0('0x22')]=function(_0x2df501){var _0xfd1891=this;return new Promise(function(_0x1229be,_0x4a361d){return db['ZendeskAccount'][_0xc1c0('0x23')]({'raw':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x24')]===undefined?!![]:![]:!![],'where':_0x2df501['options']?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1c')]||null:null,'attributes':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x21')]||null:null,'include':_0x2df501[_0xc1c0('0x1b')]?_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0x2df501[_0xc1c0('0x1b')][_0xc1c0('0x1e')],function(_0xff2611){return{'model':db[_0xff2611[_0xc1c0('0x20')]],'as':_0xff2611['as'],'attributes':_0xff2611[_0xc1c0('0x21')],'include':_0xff2611[_0xc1c0('0x1e')]?_['map'](_0xff2611[_0xc1c0('0x1e')],function(_0xb08aa8){return{'model':db[_0xb08aa8['model']],'as':_0xb08aa8['as'],'attributes':_0xb08aa8['attributes'],'include':_0xb08aa8[_0xc1c0('0x1e')]?_[_0xc1c0('0x1f')](_0xb08aa8['include'],function(_0xe1506e){return{'model':db[_0xe1506e[_0xc1c0('0x20')]],'as':_0xe1506e['as'],'attributes':_0xe1506e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1c0('0xd')](function(_0x5a7605){logger[_0xc1c0('0x16')](_0xc1c0('0x22'),_0x2df501);logger['debug'](_0xc1c0('0x22'),_0x2df501,JSON[_0xc1c0('0x12')](_0x5a7605));_0x1229be(_0x5a7605);})['catch'](function(_0xd8705a){logger[_0xc1c0('0x13')]('ShowZendeskAccount',_0xd8705a[_0xc1c0('0x15')],_0x2df501);_0x4a361d(_0xfd1891['error'](0x1f4,_0xd8705a['message']));});});}; \ No newline at end of file +var _0x2c79=['attributes','limit','include','map','model','ShowZendeskAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where'];(function(_0x3d4234,_0xe2356a){var _0x499ec8=function(_0x389deb){while(--_0x389deb){_0x3d4234['push'](_0x3d4234['shift']());}};_0x499ec8(++_0xe2356a);}(_0x2c79,0x102));var _0x92c7=function(_0x4259fd,_0x472038){_0x4259fd=_0x4259fd-0x0;var _0x538e39=_0x2c79[_0x4259fd];return _0x538e39;};'use strict';var _=require(_0x92c7('0x0'));var util=require(_0x92c7('0x1'));var moment=require('moment');var BPromise=require(_0x92c7('0x2'));var rs=require(_0x92c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92c7('0x4'))['db'];var utils=require(_0x92c7('0x5'));var logger=require('../../config/logger')(_0x92c7('0x6'));var config=require(_0x92c7('0x7'));var jayson=require(_0x92c7('0x8'));var client=jayson[_0x92c7('0x9')][_0x92c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd17552,_0x2a0c56,_0x57da32){return new BPromise(function(_0x10eed0,_0x3ab41d){return client[_0x92c7('0xb')](_0xd17552,_0x57da32)[_0x92c7('0xc')](function(_0x1649a0){logger[_0x92c7('0xd')](_0x92c7('0xe'),_0x2a0c56,'request\x20sent');logger[_0x92c7('0xf')](_0x92c7('0x10'),_0x2a0c56,_0x92c7('0x11'),JSON[_0x92c7('0x12')](_0x1649a0));if(_0x1649a0[_0x92c7('0x13')]){if(_0x1649a0['error'][_0x92c7('0x14')]===0x1f4){logger[_0x92c7('0x13')](_0x92c7('0xe'),_0x2a0c56,_0x1649a0[_0x92c7('0x13')][_0x92c7('0x15')]);return _0x3ab41d(_0x1649a0[_0x92c7('0x13')][_0x92c7('0x15')]);}logger[_0x92c7('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2a0c56,_0x1649a0['error'][_0x92c7('0x15')]);return _0x10eed0(_0x1649a0[_0x92c7('0x13')]['message']);}else{logger[_0x92c7('0xd')](_0x92c7('0xe'),_0x2a0c56,'request\x20sent');_0x10eed0(_0x1649a0[_0x92c7('0x16')][_0x92c7('0x15')]);}})[_0x92c7('0x17')](function(_0x359df0){logger['error'](_0x92c7('0xe'),_0x2a0c56,_0x359df0);_0x3ab41d(_0x359df0);});});}exports[_0x92c7('0x18')]=function(_0x4a9f9d){var _0x1909da=this;return new Promise(function(_0x5980e2,_0x35589d){return db[_0x92c7('0x19')][_0x92c7('0x1a')]({'raw':_0x4a9f9d[_0x92c7('0x1b')]?_0x4a9f9d['options'][_0x92c7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a9f9d['options']?_0x4a9f9d[_0x92c7('0x1b')][_0x92c7('0x1d')]||null:null,'attributes':_0x4a9f9d[_0x92c7('0x1b')]?_0x4a9f9d[_0x92c7('0x1b')][_0x92c7('0x1e')]||null:null,'limit':_0x4a9f9d[_0x92c7('0x1b')]?_0x4a9f9d[_0x92c7('0x1b')][_0x92c7('0x1f')]||null:null,'include':_0x4a9f9d[_0x92c7('0x1b')]?_0x4a9f9d[_0x92c7('0x1b')][_0x92c7('0x20')]?_[_0x92c7('0x21')](_0x4a9f9d[_0x92c7('0x1b')]['include'],function(_0x48bce3){return{'model':db[_0x48bce3[_0x92c7('0x22')]],'as':_0x48bce3['as'],'attributes':_0x48bce3[_0x92c7('0x1e')],'include':_0x48bce3[_0x92c7('0x20')]?_[_0x92c7('0x21')](_0x48bce3[_0x92c7('0x20')],function(_0x5f0a39){return{'model':db[_0x5f0a39['model']],'as':_0x5f0a39['as'],'attributes':_0x5f0a39[_0x92c7('0x1e')],'include':_0x5f0a39[_0x92c7('0x20')]?_[_0x92c7('0x21')](_0x5f0a39['include'],function(_0x1391f6){return{'model':db[_0x1391f6[_0x92c7('0x22')]],'as':_0x1391f6['as'],'attributes':_0x1391f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x92c7('0xc')](function(_0x35433b){logger['info'](_0x92c7('0x18'),_0x4a9f9d);logger['debug'](_0x92c7('0x18'),_0x4a9f9d,JSON[_0x92c7('0x12')](_0x35433b));_0x5980e2(_0x35433b);})['catch'](function(_0x2626ee){logger[_0x92c7('0x13')](_0x92c7('0x18'),_0x2626ee[_0x92c7('0x15')],_0x4a9f9d);_0x35589d(_0x1909da[_0x92c7('0x13')](0x1f4,_0x2626ee[_0x92c7('0x15')]));});});};exports[_0x92c7('0x23')]=function(_0x3f3d19){var _0x511f53=this;return new Promise(function(_0x6b3cea,_0x29190c){return db[_0x92c7('0x19')]['find']({'raw':_0x3f3d19[_0x92c7('0x1b')]?_0x3f3d19[_0x92c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3d19['options']?_0x3f3d19['options'][_0x92c7('0x1d')]||null:null,'attributes':_0x3f3d19[_0x92c7('0x1b')]?_0x3f3d19['options']['attributes']||null:null,'include':_0x3f3d19[_0x92c7('0x1b')]?_0x3f3d19[_0x92c7('0x1b')][_0x92c7('0x20')]?_['map'](_0x3f3d19[_0x92c7('0x1b')][_0x92c7('0x20')],function(_0x34b81a){return{'model':db[_0x34b81a[_0x92c7('0x22')]],'as':_0x34b81a['as'],'attributes':_0x34b81a['attributes'],'include':_0x34b81a[_0x92c7('0x20')]?_[_0x92c7('0x21')](_0x34b81a['include'],function(_0x5b6baa){return{'model':db[_0x5b6baa[_0x92c7('0x22')]],'as':_0x5b6baa['as'],'attributes':_0x5b6baa[_0x92c7('0x1e')],'include':_0x5b6baa[_0x92c7('0x20')]?_[_0x92c7('0x21')](_0x5b6baa['include'],function(_0x4568d1){return{'model':db[_0x4568d1['model']],'as':_0x4568d1['as'],'attributes':_0x4568d1[_0x92c7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x338e9f){logger['info'](_0x92c7('0x23'),_0x3f3d19);logger[_0x92c7('0xf')](_0x92c7('0x23'),_0x3f3d19,JSON['stringify'](_0x338e9f));_0x6b3cea(_0x338e9f);})[_0x92c7('0x17')](function(_0x2d7aed){logger[_0x92c7('0x13')]('ShowZendeskAccount',_0x2d7aed['message'],_0x3f3d19);_0x29190c(_0x511f53[_0x92c7('0x13')](0x1f4,_0x2d7aed[_0x92c7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 70d5001..794c2b0 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x198fec,_0x28e0ed){var _0x2e69d1=function(_0x18609a){while(--_0x18609a){_0x198fec['push'](_0x198fec['shift']());}};_0x2e69d1(++_0x28e0ed);}(_0xe706,0xa3));var _0x6e70=function(_0x32d6f0,_0x20bd82){_0x32d6f0=_0x32d6f0-0x0;var _0x48540f=_0xe706[_0x32d6f0];return _0x48540f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b300508..1a64a89 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 _0xd85f=['STRING','exports'];(function(_0x17cd12,_0x89acaf){var _0x483d46=function(_0x2aa8b7){while(--_0x2aa8b7){_0x17cd12['push'](_0x17cd12['shift']());}};_0x483d46(++_0x89acaf);}(_0xd85f,0x125));var _0xfd85=function(_0x29b799,_0x257e40){_0x29b799=_0x29b799-0x0;var _0x3d5893=_0xd85f[_0x29b799];return _0x3d5893;};'use strict';var Sequelize=require('sequelize');module[_0xfd85('0x0')]={'name':{'type':Sequelize[_0xfd85('0x1')]},'description':{'type':Sequelize[_0xfd85('0x1')]}}; \ No newline at end of file +var _0xfeaa=['exports','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfeaa,0xd0));var _0xafea=function(_0x11fd4a,_0x10d143){_0x11fd4a=_0x11fd4a-0x0;var _0xc76c94=_0xfeaa[_0x11fd4a];return _0xc76c94;};'use strict';var Sequelize=require('sequelize');module[_0xafea('0x0')]={'name':{'type':Sequelize[_0xafea('0x1')]},'description':{'type':Sequelize[_0xafea('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 18489f8..ad8fb5b 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 _0xe3f7=['save','destroy','then','end','sendStatus','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','count','includeAll','findAll','show','params','options','find','catch','create','body','update','getFields','findOne','ZendeskField','order','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','status','set','Content-Range','apply','reject'];(function(_0x39e9f9,_0x4deb84){var _0x2fa278=function(_0x1429b2){while(--_0x1429b2){_0x39e9f9['push'](_0x39e9f9['shift']());}};_0x2fa278(++_0x4deb84);}(_0xe3f7,0x1e1));var _0x7e3f=function(_0x35667f,_0x1d4ccb){_0x35667f=_0x35667f-0x0;var _0x36e8dd=_0xe3f7[_0x35667f];return _0x36e8dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e3f('0x0'));var zipdir=require(_0x7e3f('0x1'));var jsonpatch=require(_0x7e3f('0x2'));var rp=require(_0x7e3f('0x3'));var moment=require(_0x7e3f('0x4'));var BPromise=require(_0x7e3f('0x5'));var Mustache=require(_0x7e3f('0x6'));var util=require(_0x7e3f('0x7'));var path=require(_0x7e3f('0x8'));var sox=require(_0x7e3f('0x9'));var csv=require('to-csv');var ejs=require(_0x7e3f('0xa'));var fs=require('fs');var fs_extra=require(_0x7e3f('0xb'));var _=require(_0x7e3f('0xc'));var squel=require(_0x7e3f('0xd'));var crypto=require(_0x7e3f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7e3f('0xf'));var toCsv=require(_0x7e3f('0x10'));var querystring=require(_0x7e3f('0x11'));var Papa=require(_0x7e3f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e3f('0x13'));var as=require(_0x7e3f('0x14'));var hardwareService=require(_0x7e3f('0x15'));var logger=require(_0x7e3f('0x16'))(_0x7e3f('0x17'));var utils=require(_0x7e3f('0x18'));var config=require(_0x7e3f('0x19'));var licenseUtil=require(_0x7e3f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493e9d,_0x500820){_0x500820=_0x500820||0xcc;return function(_0x3fb2e4){if(_0x3fb2e4){return _0x493e9d['sendStatus'](_0x500820);}return _0x493e9d['status'](_0x500820)['end']();};}function respondWithResult(_0x2e806f,_0x21835f){_0x21835f=_0x21835f||0xc8;return function(_0x28b022){if(_0x28b022){return _0x2e806f['status'](_0x21835f)[_0x7e3f('0x1b')](_0x28b022);}};}function respondWithFilteredResult(_0x2c5922,_0x2a3bb1){return function(_0x5ed180){if(_0x5ed180){var _0xc1d04d=typeof _0x2a3bb1[_0x7e3f('0x1c')]===_0x7e3f('0x1d')&&typeof _0x2a3bb1['limit']==='undefined';var _0x195703=_0x5ed180['count'];var _0x476a48=_0xc1d04d?0x0:_0x2a3bb1[_0x7e3f('0x1c')];var _0x4a77f7=_0xc1d04d?_0x5ed180['count']:_0x2a3bb1[_0x7e3f('0x1c')]+_0x2a3bb1['limit'];var _0x4fb8d3;if(_0x4a77f7>=_0x195703){_0x4a77f7=_0x195703;_0x4fb8d3=0xc8;}else{_0x4fb8d3=0xce;}_0x2c5922[_0x7e3f('0x1e')](_0x4fb8d3);return _0x2c5922[_0x7e3f('0x1f')](_0x7e3f('0x20'),_0x476a48+'-'+_0x4a77f7+'/'+_0x195703)[_0x7e3f('0x1b')](_0x5ed180);}return null;};}function patchUpdates(_0xeec021){return function(_0xba873c){try{jsonpatch[_0x7e3f('0x21')](_0xba873c,_0xeec021,!![]);}catch(_0x3a69a5){return BPromise[_0x7e3f('0x22')](_0x3a69a5);}return _0xba873c[_0x7e3f('0x23')]();};}function saveUpdates(_0x37647d,_0x554dd2){return function(_0x5dde44){if(_0x5dde44){return _0x5dde44['update'](_0x37647d)['then'](function(_0x39cad6){return _0x39cad6;});}return null;};}function removeEntity(_0x3fe406,_0x58034f){return function(_0x2a2baa){if(_0x2a2baa){return _0x2a2baa[_0x7e3f('0x24')]()[_0x7e3f('0x25')](function(){_0x3fe406[_0x7e3f('0x1e')](0xcc)[_0x7e3f('0x26')]();});}};}function handleEntityNotFound(_0x410228,_0xd40035){return function(_0x5981b6){if(!_0x5981b6){_0x410228[_0x7e3f('0x27')](0x194);}return _0x5981b6;};}function handleError(_0x3b1c31,_0x1a16dc){_0x1a16dc=_0x1a16dc||0x1f4;return function(_0x2696b0){logger['error'](_0x2696b0[_0x7e3f('0x28')]);if(_0x2696b0[_0x7e3f('0x29')]){delete _0x2696b0[_0x7e3f('0x29')];}_0x3b1c31[_0x7e3f('0x1e')](_0x1a16dc)['send'](_0x2696b0);};}exports[_0x7e3f('0x2a')]=function(_0x3a7097,_0x549f3b){var _0xa8f0c4={},_0x1d1c87={},_0xa31ee0={'count':0x0,'rows':[]};var _0x208f91=_[_0x7e3f('0x2b')](db[_0x7e3f('0x2c')][_0x7e3f('0x2d')],function(_0x1477fe){return{'name':_0x1477fe[_0x7e3f('0x2e')],'type':_0x1477fe['type'][_0x7e3f('0x2f')]};});_0x1d1c87[_0x7e3f('0x30')]=_[_0x7e3f('0x2b')](_0x208f91,'name');_0x1d1c87[_0x7e3f('0x31')]=_[_0x7e3f('0x32')](_0x3a7097[_0x7e3f('0x31')]);_0x1d1c87[_0x7e3f('0x33')]=_[_0x7e3f('0x34')](_0x1d1c87['model'],_0x1d1c87[_0x7e3f('0x31')]);_0xa8f0c4[_0x7e3f('0x35')]=_['intersection'](_0x1d1c87[_0x7e3f('0x30')],qs[_0x7e3f('0x36')](_0x3a7097['query'][_0x7e3f('0x36')]));_0xa8f0c4[_0x7e3f('0x35')]=_0xa8f0c4['attributes'][_0x7e3f('0x37')]?_0xa8f0c4['attributes']:_0x1d1c87[_0x7e3f('0x30')];if(!_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x38')]('nolimit')){_0xa8f0c4['limit']=qs['limit'](_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x39')]);_0xa8f0c4['offset']=qs[_0x7e3f('0x1c')](_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x1c')]);}_0xa8f0c4['order']=qs[_0x7e3f('0x3a')](_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x3a')]);_0xa8f0c4[_0x7e3f('0x3b')]=qs[_0x7e3f('0x33')](_[_0x7e3f('0x3c')](_0x3a7097[_0x7e3f('0x31')],_0x1d1c87['filters']),_0x208f91);if(_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x3d')]){_0xa8f0c4['where']=_[_0x7e3f('0x3e')](_0xa8f0c4['where'],{'$or':_[_0x7e3f('0x2b')](_0x208f91,function(_0x1f15fa){if(_0x1f15fa[_0x7e3f('0x3f')]!=='VIRTUAL'){var _0x3a7481={};_0x3a7481[_0x1f15fa[_0x7e3f('0x29')]]={'$like':'%'+_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x3d')]+'%'};return _0x3a7481;}})});}_0xa8f0c4=_['merge']({},_0xa8f0c4,_0x3a7097['options']);var _0x511f88={'where':_0xa8f0c4[_0x7e3f('0x3b')]};return db[_0x7e3f('0x2c')][_0x7e3f('0x40')](_0x511f88)[_0x7e3f('0x25')](function(_0x13b990){_0xa31ee0[_0x7e3f('0x40')]=_0x13b990;if(_0x3a7097[_0x7e3f('0x31')][_0x7e3f('0x41')]){_0xa8f0c4['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x7e3f('0x42')](_0xa8f0c4);})[_0x7e3f('0x25')](function(_0x403767){_0xa31ee0['rows']=_0x403767;return _0xa31ee0;})[_0x7e3f('0x25')](respondWithFilteredResult(_0x549f3b,_0xa8f0c4))['catch'](handleError(_0x549f3b,null));};exports[_0x7e3f('0x43')]=function(_0x6a2227,_0x5ec86c){var _0x171c4f={'raw':![],'where':{'id':_0x6a2227[_0x7e3f('0x44')]['id']}},_0x43d0c2={};_0x43d0c2[_0x7e3f('0x30')]=_[_0x7e3f('0x32')](db[_0x7e3f('0x2c')][_0x7e3f('0x2d')]);_0x43d0c2['query']=_[_0x7e3f('0x32')](_0x6a2227['query']);_0x43d0c2[_0x7e3f('0x33')]=_[_0x7e3f('0x34')](_0x43d0c2[_0x7e3f('0x30')],_0x43d0c2[_0x7e3f('0x31')]);_0x171c4f[_0x7e3f('0x35')]=_[_0x7e3f('0x34')](_0x43d0c2[_0x7e3f('0x30')],qs[_0x7e3f('0x36')](_0x6a2227['query'][_0x7e3f('0x36')]));_0x171c4f[_0x7e3f('0x35')]=_0x171c4f[_0x7e3f('0x35')][_0x7e3f('0x37')]?_0x171c4f['attributes']:_0x43d0c2[_0x7e3f('0x30')];if(_0x6a2227['query'][_0x7e3f('0x41')]){_0x171c4f['include']=[{'all':!![]}];}_0x171c4f=_[_0x7e3f('0x3e')]({},_0x171c4f,_0x6a2227[_0x7e3f('0x45')]);return db['ZendeskConfiguration'][_0x7e3f('0x46')](_0x171c4f)[_0x7e3f('0x25')](handleEntityNotFound(_0x5ec86c,null))[_0x7e3f('0x25')](respondWithResult(_0x5ec86c,null))[_0x7e3f('0x47')](handleError(_0x5ec86c,null));};exports[_0x7e3f('0x48')]=function(_0x56cb71,_0x2cd896){return db['ZendeskConfiguration'][_0x7e3f('0x48')](_0x56cb71[_0x7e3f('0x49')],{})[_0x7e3f('0x25')](respondWithResult(_0x2cd896,0xc9))[_0x7e3f('0x47')](handleError(_0x2cd896,null));};exports[_0x7e3f('0x4a')]=function(_0x330b80,_0x2a1cbd){if(_0x330b80['body']['id']){delete _0x330b80[_0x7e3f('0x49')]['id'];}return db[_0x7e3f('0x2c')][_0x7e3f('0x46')]({'where':{'id':_0x330b80[_0x7e3f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a1cbd,null))['then'](saveUpdates(_0x330b80[_0x7e3f('0x49')],null))['then'](respondWithResult(_0x2a1cbd,null))[_0x7e3f('0x47')](handleError(_0x2a1cbd,null));};exports[_0x7e3f('0x24')]=function(_0x5dbd22,_0x3600f2){return db[_0x7e3f('0x2c')]['find']({'where':{'id':_0x5dbd22[_0x7e3f('0x44')]['id']}})[_0x7e3f('0x25')](handleEntityNotFound(_0x3600f2,null))[_0x7e3f('0x25')](removeEntity(_0x3600f2,null))['catch'](handleError(_0x3600f2,null));};exports[_0x7e3f('0x4b')]=function(_0x1111d8,_0x2d4131,_0x1685bb){var _0x40aa20={};var _0x22e549={};var _0x5bd33e;var _0x14aaac;return db[_0x7e3f('0x2c')][_0x7e3f('0x4c')]({'where':{'id':_0x1111d8['params']['id']}})['then'](handleEntityNotFound(_0x2d4131,null))['then'](function(_0x12ffae){if(_0x12ffae){_0x5bd33e=_0x12ffae;_0x22e549[_0x7e3f('0x30')]=_[_0x7e3f('0x32')](db[_0x7e3f('0x4d')][_0x7e3f('0x2d')]);_0x22e549[_0x7e3f('0x31')]=_[_0x7e3f('0x32')](_0x1111d8[_0x7e3f('0x31')]);_0x22e549[_0x7e3f('0x33')]=_[_0x7e3f('0x34')](_0x22e549['model'],_0x22e549[_0x7e3f('0x31')]);_0x40aa20['attributes']=_['intersection'](_0x22e549[_0x7e3f('0x30')],qs[_0x7e3f('0x36')](_0x1111d8[_0x7e3f('0x31')]['fields']));_0x40aa20[_0x7e3f('0x35')]=_0x40aa20['attributes'][_0x7e3f('0x37')]?_0x40aa20['attributes']:_0x22e549[_0x7e3f('0x30')];_0x40aa20[_0x7e3f('0x4e')]=qs['sort'](_0x1111d8['query'][_0x7e3f('0x3a')]);_0x40aa20[_0x7e3f('0x3b')]=qs['filters'](_[_0x7e3f('0x3c')](_0x1111d8[_0x7e3f('0x31')],_0x22e549[_0x7e3f('0x33')]));if(_0x1111d8['query'][_0x7e3f('0x3d')]){_0x40aa20['where']=_[_0x7e3f('0x3e')](_0x40aa20[_0x7e3f('0x3b')],{'$or':_['map'](_0x40aa20[_0x7e3f('0x35')],function(_0x50e94c){var _0x267944={};_0x267944[_0x50e94c]={'$like':'%'+_0x1111d8[_0x7e3f('0x31')][_0x7e3f('0x3d')]+'%'};return _0x267944;})});}_0x40aa20=_['merge']({},_0x40aa20,_0x1111d8[_0x7e3f('0x45')]);return _0x5bd33e[_0x7e3f('0x4b')](_0x40aa20);}})[_0x7e3f('0x25')](function(_0x4b4f16){if(_0x4b4f16){_0x14aaac=_0x4b4f16[_0x7e3f('0x37')];if(!_0x1111d8[_0x7e3f('0x31')][_0x7e3f('0x38')](_0x7e3f('0x4f'))){_0x40aa20[_0x7e3f('0x39')]=qs['limit'](_0x1111d8[_0x7e3f('0x31')][_0x7e3f('0x39')]);_0x40aa20[_0x7e3f('0x1c')]=qs[_0x7e3f('0x1c')](_0x1111d8[_0x7e3f('0x31')][_0x7e3f('0x1c')]);}return _0x5bd33e['getFields'](_0x40aa20);}})[_0x7e3f('0x25')](function(_0x320f87){if(_0x320f87){return _0x320f87?{'count':_0x14aaac,'rows':_0x320f87}:null;}})[_0x7e3f('0x25')](respondWithResult(_0x2d4131,null))[_0x7e3f('0x47')](handleError(_0x2d4131,null));};exports[_0x7e3f('0x50')]=function(_0x11f5f0,_0xb48a76,_0x8c32d0){var _0x4c6214={};var _0x514ff6={};var _0x27cda0;var _0x5388c5;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11f5f0[_0x7e3f('0x44')]['id']}})[_0x7e3f('0x25')](handleEntityNotFound(_0xb48a76,null))[_0x7e3f('0x25')](function(_0x46ecd3){if(_0x46ecd3){_0x27cda0=_0x46ecd3;_0x514ff6[_0x7e3f('0x30')]=_[_0x7e3f('0x32')](db[_0x7e3f('0x4d')][_0x7e3f('0x2d')]);_0x514ff6[_0x7e3f('0x31')]=_[_0x7e3f('0x32')](_0x11f5f0[_0x7e3f('0x31')]);_0x514ff6['filters']=_[_0x7e3f('0x34')](_0x514ff6[_0x7e3f('0x30')],_0x514ff6[_0x7e3f('0x31')]);_0x4c6214[_0x7e3f('0x35')]=_[_0x7e3f('0x34')](_0x514ff6[_0x7e3f('0x30')],qs[_0x7e3f('0x36')](_0x11f5f0['query'][_0x7e3f('0x36')]));_0x4c6214['attributes']=_0x4c6214[_0x7e3f('0x35')][_0x7e3f('0x37')]?_0x4c6214[_0x7e3f('0x35')]:_0x514ff6[_0x7e3f('0x30')];_0x4c6214[_0x7e3f('0x4e')]=qs[_0x7e3f('0x3a')](_0x11f5f0['query']['sort']);_0x4c6214['where']=qs[_0x7e3f('0x33')](_['pick'](_0x11f5f0[_0x7e3f('0x31')],_0x514ff6[_0x7e3f('0x33')]));if(_0x11f5f0['query'][_0x7e3f('0x3d')]){_0x4c6214['where']=_['merge'](_0x4c6214[_0x7e3f('0x3b')],{'$or':_['map'](_0x4c6214['attributes'],function(_0x235994){var _0x22fec1={};_0x22fec1[_0x235994]={'$like':'%'+_0x11f5f0[_0x7e3f('0x31')][_0x7e3f('0x3d')]+'%'};return _0x22fec1;})});}_0x4c6214=_[_0x7e3f('0x3e')]({},_0x4c6214,_0x11f5f0[_0x7e3f('0x45')]);return _0x27cda0[_0x7e3f('0x50')](_0x4c6214);}})[_0x7e3f('0x25')](function(_0x248b6e){if(_0x248b6e){_0x5388c5=_0x248b6e[_0x7e3f('0x37')];if(!_0x11f5f0[_0x7e3f('0x31')][_0x7e3f('0x38')]('nolimit')){_0x4c6214[_0x7e3f('0x39')]=qs['limit'](_0x11f5f0[_0x7e3f('0x31')][_0x7e3f('0x39')]);_0x4c6214[_0x7e3f('0x1c')]=qs['offset'](_0x11f5f0[_0x7e3f('0x31')][_0x7e3f('0x1c')]);}return _0x27cda0[_0x7e3f('0x50')](_0x4c6214);}})[_0x7e3f('0x25')](function(_0x10b03c){if(_0x10b03c){return _0x10b03c?{'count':_0x5388c5,'rows':_0x10b03c}:null;}})['then'](respondWithResult(_0xb48a76,null))['catch'](handleError(_0xb48a76,null));};exports[_0x7e3f('0x51')]=function(_0x4299f9,_0xe28996,_0x490c16){var _0x116ad7={};var _0x38305b={};var _0x92da93;var _0x5472d1;return db[_0x7e3f('0x2c')]['findOne']({'where':{'id':_0x4299f9[_0x7e3f('0x44')]['id']}})[_0x7e3f('0x25')](handleEntityNotFound(_0xe28996,null))[_0x7e3f('0x25')](function(_0x56c666){if(_0x56c666){_0x92da93=_0x56c666;_0x38305b[_0x7e3f('0x30')]=_[_0x7e3f('0x32')](db['ZendeskField']['rawAttributes']);_0x38305b['query']=_[_0x7e3f('0x32')](_0x4299f9['query']);_0x38305b[_0x7e3f('0x33')]=_[_0x7e3f('0x34')](_0x38305b[_0x7e3f('0x30')],_0x38305b['query']);_0x116ad7[_0x7e3f('0x35')]=_[_0x7e3f('0x34')](_0x38305b['model'],qs[_0x7e3f('0x36')](_0x4299f9[_0x7e3f('0x31')][_0x7e3f('0x36')]));_0x116ad7[_0x7e3f('0x35')]=_0x116ad7['attributes'][_0x7e3f('0x37')]?_0x116ad7[_0x7e3f('0x35')]:_0x38305b[_0x7e3f('0x30')];_0x116ad7['order']=qs['sort'](_0x4299f9[_0x7e3f('0x31')][_0x7e3f('0x3a')]);_0x116ad7[_0x7e3f('0x3b')]=qs[_0x7e3f('0x33')](_['pick'](_0x4299f9[_0x7e3f('0x31')],_0x38305b[_0x7e3f('0x33')]));if(_0x4299f9[_0x7e3f('0x31')]['filter']){_0x116ad7[_0x7e3f('0x3b')]=_[_0x7e3f('0x3e')](_0x116ad7[_0x7e3f('0x3b')],{'$or':_['map'](_0x116ad7[_0x7e3f('0x35')],function(_0x5805d4){var _0x74c506={};_0x74c506[_0x5805d4]={'$like':'%'+_0x4299f9[_0x7e3f('0x31')][_0x7e3f('0x3d')]+'%'};return _0x74c506;})});}_0x116ad7=_['merge']({},_0x116ad7,_0x4299f9[_0x7e3f('0x45')]);return _0x92da93[_0x7e3f('0x51')](_0x116ad7);}})[_0x7e3f('0x25')](function(_0x565a22){if(_0x565a22){_0x5472d1=_0x565a22['length'];if(!_0x4299f9[_0x7e3f('0x31')]['hasOwnProperty']('nolimit')){_0x116ad7[_0x7e3f('0x39')]=qs[_0x7e3f('0x39')](_0x4299f9[_0x7e3f('0x31')][_0x7e3f('0x39')]);_0x116ad7[_0x7e3f('0x1c')]=qs[_0x7e3f('0x1c')](_0x4299f9['query'][_0x7e3f('0x1c')]);}return _0x92da93[_0x7e3f('0x51')](_0x116ad7);}})[_0x7e3f('0x25')](function(_0x62a44f){if(_0x62a44f){return _0x62a44f?{'count':_0x5472d1,'rows':_0x62a44f}:null;}})[_0x7e3f('0x25')](respondWithResult(_0xe28996,null))[_0x7e3f('0x47')](handleError(_0xe28996,null));};exports[_0x7e3f('0x52')]=function(_0x1cd1a0,_0x32ef8a,_0x33095d){var _0x21478a={};var _0x421906={};var _0x4ca8f1;var _0x2012c1;return db['ZendeskConfiguration'][_0x7e3f('0x4c')]({'where':{'id':_0x1cd1a0['params']['id']}})[_0x7e3f('0x25')](handleEntityNotFound(_0x32ef8a,null))[_0x7e3f('0x25')](function(_0x5e7882){if(_0x5e7882){_0x4ca8f1=_0x5e7882;_0x421906['model']=_[_0x7e3f('0x32')](db[_0x7e3f('0x53')][_0x7e3f('0x2d')]);_0x421906['query']=_[_0x7e3f('0x32')](_0x1cd1a0[_0x7e3f('0x31')]);_0x421906[_0x7e3f('0x33')]=_[_0x7e3f('0x34')](_0x421906['model'],_0x421906['query']);_0x21478a[_0x7e3f('0x35')]=_[_0x7e3f('0x34')](_0x421906['model'],qs[_0x7e3f('0x36')](_0x1cd1a0[_0x7e3f('0x31')][_0x7e3f('0x36')]));_0x21478a[_0x7e3f('0x35')]=_0x21478a[_0x7e3f('0x35')]['length']?_0x21478a[_0x7e3f('0x35')]:_0x421906[_0x7e3f('0x30')];_0x21478a[_0x7e3f('0x4e')]=qs[_0x7e3f('0x3a')](_0x1cd1a0['query'][_0x7e3f('0x3a')]);_0x21478a[_0x7e3f('0x3b')]=qs[_0x7e3f('0x33')](_[_0x7e3f('0x3c')](_0x1cd1a0[_0x7e3f('0x31')],_0x421906[_0x7e3f('0x33')]));if(_0x1cd1a0[_0x7e3f('0x31')]['filter']){_0x21478a[_0x7e3f('0x3b')]=_[_0x7e3f('0x3e')](_0x21478a[_0x7e3f('0x3b')],{'$or':_[_0x7e3f('0x2b')](_0x21478a['attributes'],function(_0x3ea404){var _0x28a5bf={};_0x28a5bf[_0x3ea404]={'$like':'%'+_0x1cd1a0[_0x7e3f('0x31')]['filter']+'%'};return _0x28a5bf;})});}_0x21478a=_[_0x7e3f('0x3e')]({},_0x21478a,_0x1cd1a0[_0x7e3f('0x45')]);return _0x4ca8f1[_0x7e3f('0x52')](_0x21478a);}})['then'](function(_0x3d0ac8){if(_0x3d0ac8){_0x2012c1=_0x3d0ac8[_0x7e3f('0x37')];if(!_0x1cd1a0[_0x7e3f('0x31')][_0x7e3f('0x38')]('nolimit')){_0x21478a[_0x7e3f('0x39')]=qs[_0x7e3f('0x39')](_0x1cd1a0[_0x7e3f('0x31')][_0x7e3f('0x39')]);_0x21478a[_0x7e3f('0x1c')]=qs[_0x7e3f('0x1c')](_0x1cd1a0[_0x7e3f('0x31')]['offset']);}return _0x4ca8f1[_0x7e3f('0x52')](_0x21478a);}})[_0x7e3f('0x25')](function(_0x3d08f7){if(_0x3d08f7){return _0x3d08f7?{'count':_0x2012c1,'rows':_0x3d08f7}:null;}})['then'](respondWithResult(_0x32ef8a,null))['catch'](handleError(_0x32ef8a,null));};exports['setTags']=function(_0x93101e,_0x5897db,_0x45264e){if(_0x93101e[_0x7e3f('0x49')]['id']){delete _0x93101e[_0x7e3f('0x49')]['id'];}return db[_0x7e3f('0x2c')][_0x7e3f('0x4c')]({'where':{'id':_0x93101e[_0x7e3f('0x44')]['id']}})[_0x7e3f('0x25')](handleEntityNotFound(_0x5897db,null))[_0x7e3f('0x25')](function(_0x18384d){if(_0x18384d){return _0x18384d[_0x7e3f('0x54')](_0x93101e[_0x7e3f('0x49')][_0x7e3f('0x55')]||[]);}return null;})[_0x7e3f('0x25')](respondWithResult(_0x5897db,null))[_0x7e3f('0x47')](handleError(_0x5897db,null));}; \ No newline at end of file +var _0x1306=['fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','ZendeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','ZendeskField','order','sort','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x47dc81,_0x5913bc){var _0x13ba94=function(_0x13c87a){while(--_0x13c87a){_0x47dc81['push'](_0x47dc81['shift']());}};_0x13ba94(++_0x5913bc);}(_0x1306,0x9b));var _0x6130=function(_0x3f9b62,_0x4f697c){_0x3f9b62=_0x3f9b62-0x0;var _0x5e0ef1=_0x1306[_0x3f9b62];return _0x5e0ef1;};'use strict';var emlformat=require(_0x6130('0x0'));var rimraf=require(_0x6130('0x1'));var zipdir=require(_0x6130('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6130('0x3'));var BPromise=require(_0x6130('0x4'));var Mustache=require(_0x6130('0x5'));var util=require(_0x6130('0x6'));var path=require(_0x6130('0x7'));var sox=require(_0x6130('0x8'));var csv=require(_0x6130('0x9'));var ejs=require(_0x6130('0xa'));var fs=require('fs');var fs_extra=require(_0x6130('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6130('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6130('0xd'));var toCsv=require(_0x6130('0x9'));var querystring=require(_0x6130('0xe'));var Papa=require(_0x6130('0xf'));var Redis=require(_0x6130('0x10'));var authService=require(_0x6130('0x11'));var qs=require(_0x6130('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6130('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6130('0x14'));var config=require(_0x6130('0x15'));var licenseUtil=require(_0x6130('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc14725,_0x5a1fbf){_0x5a1fbf=_0x5a1fbf||0xcc;return function(_0x5c3713){if(_0x5c3713){return _0xc14725['sendStatus'](_0x5a1fbf);}return _0xc14725[_0x6130('0x17')](_0x5a1fbf)[_0x6130('0x18')]();};}function respondWithResult(_0x233937,_0x58aa84){_0x58aa84=_0x58aa84||0xc8;return function(_0x4dc698){if(_0x4dc698){return _0x233937[_0x6130('0x17')](_0x58aa84)[_0x6130('0x19')](_0x4dc698);}};}function respondWithFilteredResult(_0x54bded,_0x14b317){return function(_0x25fb98){if(_0x25fb98){var _0x56d261=typeof _0x14b317[_0x6130('0x1a')]===_0x6130('0x1b')&&typeof _0x14b317[_0x6130('0x1c')]===_0x6130('0x1b');var _0x148b59=_0x25fb98[_0x6130('0x1d')];var _0x105d48=_0x56d261?0x0:_0x14b317['offset'];var _0x5390cc=_0x56d261?_0x25fb98['count']:_0x14b317[_0x6130('0x1a')]+_0x14b317[_0x6130('0x1c')];var _0xcd4475;if(_0x5390cc>=_0x148b59){_0x5390cc=_0x148b59;_0xcd4475=0xc8;}else{_0xcd4475=0xce;}_0x54bded[_0x6130('0x17')](_0xcd4475);return _0x54bded['set'](_0x6130('0x1e'),_0x105d48+'-'+_0x5390cc+'/'+_0x148b59)[_0x6130('0x19')](_0x25fb98);}return null;};}function patchUpdates(_0x43d9c6){return function(_0x58bb8f){try{jsonpatch[_0x6130('0x1f')](_0x58bb8f,_0x43d9c6,!![]);}catch(_0x296d30){return BPromise[_0x6130('0x20')](_0x296d30);}return _0x58bb8f[_0x6130('0x21')]();};}function saveUpdates(_0x1a7007,_0xbad43){return function(_0xfdb06e){if(_0xfdb06e){return _0xfdb06e[_0x6130('0x22')](_0x1a7007)['then'](function(_0x1f4da7){return _0x1f4da7;});}return null;};}function removeEntity(_0x5360ab,_0x121f1b){return function(_0x513325){if(_0x513325){return _0x513325[_0x6130('0x23')]()[_0x6130('0x24')](function(){_0x5360ab[_0x6130('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xddd672,_0x714fdc){return function(_0xabeaef){if(!_0xabeaef){_0xddd672['sendStatus'](0x194);}return _0xabeaef;};}function handleError(_0x483c7f,_0x59898b){_0x59898b=_0x59898b||0x1f4;return function(_0xcfe12a){logger[_0x6130('0x25')](_0xcfe12a[_0x6130('0x26')]);if(_0xcfe12a[_0x6130('0x27')]){delete _0xcfe12a[_0x6130('0x27')];}_0x483c7f[_0x6130('0x17')](_0x59898b)[_0x6130('0x28')](_0xcfe12a);};}exports['index']=function(_0x493f6b,_0x58032f){var _0x1ee404={},_0x205db4={},_0x5be6c6={'count':0x0,'rows':[]};var _0x5026ab=_['map'](db[_0x6130('0x29')][_0x6130('0x2a')],function(_0x254f44){return{'name':_0x254f44[_0x6130('0x2b')],'type':_0x254f44['type'][_0x6130('0x2c')]};});_0x205db4[_0x6130('0x2d')]=_['map'](_0x5026ab,_0x6130('0x27'));_0x205db4['query']=_[_0x6130('0x2e')](_0x493f6b[_0x6130('0x2f')]);_0x205db4[_0x6130('0x30')]=_[_0x6130('0x31')](_0x205db4[_0x6130('0x2d')],_0x205db4[_0x6130('0x2f')]);_0x1ee404['attributes']=_[_0x6130('0x31')](_0x205db4[_0x6130('0x2d')],qs[_0x6130('0x32')](_0x493f6b[_0x6130('0x2f')][_0x6130('0x32')]));_0x1ee404[_0x6130('0x33')]=_0x1ee404[_0x6130('0x33')][_0x6130('0x34')]?_0x1ee404[_0x6130('0x33')]:_0x205db4[_0x6130('0x2d')];if(!_0x493f6b[_0x6130('0x2f')][_0x6130('0x35')](_0x6130('0x36'))){_0x1ee404[_0x6130('0x1c')]=qs[_0x6130('0x1c')](_0x493f6b[_0x6130('0x2f')][_0x6130('0x1c')]);_0x1ee404[_0x6130('0x1a')]=qs[_0x6130('0x1a')](_0x493f6b[_0x6130('0x2f')][_0x6130('0x1a')]);}_0x1ee404['order']=qs['sort'](_0x493f6b[_0x6130('0x2f')]['sort']);_0x1ee404[_0x6130('0x37')]=qs[_0x6130('0x30')](_[_0x6130('0x38')](_0x493f6b[_0x6130('0x2f')],_0x205db4[_0x6130('0x30')]),_0x5026ab);if(_0x493f6b[_0x6130('0x2f')][_0x6130('0x39')]){_0x1ee404[_0x6130('0x37')]=_['merge'](_0x1ee404[_0x6130('0x37')],{'$or':_[_0x6130('0x3a')](_0x5026ab,function(_0x1f272f){if(_0x1f272f[_0x6130('0x3b')]!==_0x6130('0x3c')){var _0x307535={};_0x307535[_0x1f272f[_0x6130('0x27')]]={'$like':'%'+_0x493f6b[_0x6130('0x2f')][_0x6130('0x39')]+'%'};return _0x307535;}})});}_0x1ee404=_[_0x6130('0x3d')]({},_0x1ee404,_0x493f6b[_0x6130('0x3e')]);var _0x10625b={'where':_0x1ee404[_0x6130('0x37')]};return db[_0x6130('0x29')][_0x6130('0x1d')](_0x10625b)['then'](function(_0x37978f){_0x5be6c6[_0x6130('0x1d')]=_0x37978f;if(_0x493f6b['query'][_0x6130('0x3f')]){_0x1ee404[_0x6130('0x40')]=[{'all':!![]}];}return db[_0x6130('0x29')][_0x6130('0x41')](_0x1ee404);})[_0x6130('0x24')](function(_0x363385){_0x5be6c6[_0x6130('0x42')]=_0x363385;return _0x5be6c6;})['then'](respondWithFilteredResult(_0x58032f,_0x1ee404))[_0x6130('0x43')](handleError(_0x58032f,null));};exports['show']=function(_0x3cae4c,_0x2cdacf){var _0x3dc525={'raw':![],'where':{'id':_0x3cae4c[_0x6130('0x44')]['id']}},_0x7c73ce={};_0x7c73ce[_0x6130('0x2d')]=_[_0x6130('0x2e')](db[_0x6130('0x29')]['rawAttributes']);_0x7c73ce[_0x6130('0x2f')]=_[_0x6130('0x2e')](_0x3cae4c[_0x6130('0x2f')]);_0x7c73ce[_0x6130('0x30')]=_[_0x6130('0x31')](_0x7c73ce[_0x6130('0x2d')],_0x7c73ce[_0x6130('0x2f')]);_0x3dc525[_0x6130('0x33')]=_[_0x6130('0x31')](_0x7c73ce[_0x6130('0x2d')],qs['fields'](_0x3cae4c[_0x6130('0x2f')][_0x6130('0x32')]));_0x3dc525[_0x6130('0x33')]=_0x3dc525[_0x6130('0x33')][_0x6130('0x34')]?_0x3dc525[_0x6130('0x33')]:_0x7c73ce[_0x6130('0x2d')];if(_0x3cae4c[_0x6130('0x2f')][_0x6130('0x3f')]){_0x3dc525[_0x6130('0x40')]=[{'all':!![]}];}_0x3dc525=_[_0x6130('0x3d')]({},_0x3dc525,_0x3cae4c[_0x6130('0x3e')]);return db[_0x6130('0x29')][_0x6130('0x45')](_0x3dc525)[_0x6130('0x24')](handleEntityNotFound(_0x2cdacf,null))[_0x6130('0x24')](respondWithResult(_0x2cdacf,null))['catch'](handleError(_0x2cdacf,null));};exports['create']=function(_0x4b37b6,_0x6b79d6){return db[_0x6130('0x29')][_0x6130('0x46')](_0x4b37b6[_0x6130('0x47')],{})[_0x6130('0x24')](respondWithResult(_0x6b79d6,0xc9))[_0x6130('0x43')](handleError(_0x6b79d6,null));};exports[_0x6130('0x22')]=function(_0x14888b,_0x313e1a){if(_0x14888b['body']['id']){delete _0x14888b[_0x6130('0x47')]['id'];}return db[_0x6130('0x29')][_0x6130('0x45')]({'where':{'id':_0x14888b[_0x6130('0x44')]['id']}})[_0x6130('0x24')](handleEntityNotFound(_0x313e1a,null))['then'](saveUpdates(_0x14888b[_0x6130('0x47')],null))[_0x6130('0x24')](respondWithResult(_0x313e1a,null))['catch'](handleError(_0x313e1a,null));};exports[_0x6130('0x23')]=function(_0x3d92ba,_0x3fd66f){return db[_0x6130('0x29')][_0x6130('0x45')]({'where':{'id':_0x3d92ba['params']['id']}})[_0x6130('0x24')](handleEntityNotFound(_0x3fd66f,null))[_0x6130('0x24')](removeEntity(_0x3fd66f,null))['catch'](handleError(_0x3fd66f,null));};exports[_0x6130('0x48')]=function(_0x563389,_0xf46f9c,_0xd22cd4){var _0x381f27={};var _0x5ce370={};var _0x25e937;var _0x3da7cc;return db[_0x6130('0x29')][_0x6130('0x49')]({'where':{'id':_0x563389[_0x6130('0x44')]['id']}})[_0x6130('0x24')](handleEntityNotFound(_0xf46f9c,null))[_0x6130('0x24')](function(_0x1dc325){if(_0x1dc325){_0x25e937=_0x1dc325;_0x5ce370[_0x6130('0x2d')]=_[_0x6130('0x2e')](db[_0x6130('0x4a')][_0x6130('0x2a')]);_0x5ce370[_0x6130('0x2f')]=_[_0x6130('0x2e')](_0x563389[_0x6130('0x2f')]);_0x5ce370[_0x6130('0x30')]=_[_0x6130('0x31')](_0x5ce370[_0x6130('0x2d')],_0x5ce370[_0x6130('0x2f')]);_0x381f27[_0x6130('0x33')]=_[_0x6130('0x31')](_0x5ce370[_0x6130('0x2d')],qs[_0x6130('0x32')](_0x563389[_0x6130('0x2f')][_0x6130('0x32')]));_0x381f27['attributes']=_0x381f27[_0x6130('0x33')][_0x6130('0x34')]?_0x381f27[_0x6130('0x33')]:_0x5ce370[_0x6130('0x2d')];_0x381f27[_0x6130('0x4b')]=qs['sort'](_0x563389[_0x6130('0x2f')]['sort']);_0x381f27[_0x6130('0x37')]=qs[_0x6130('0x30')](_[_0x6130('0x38')](_0x563389['query'],_0x5ce370[_0x6130('0x30')]));if(_0x563389['query'][_0x6130('0x39')]){_0x381f27['where']=_['merge'](_0x381f27[_0x6130('0x37')],{'$or':_[_0x6130('0x3a')](_0x381f27['attributes'],function(_0x3d53fc){var _0x55ef87={};_0x55ef87[_0x3d53fc]={'$like':'%'+_0x563389[_0x6130('0x2f')][_0x6130('0x39')]+'%'};return _0x55ef87;})});}_0x381f27=_[_0x6130('0x3d')]({},_0x381f27,_0x563389[_0x6130('0x3e')]);return _0x25e937['getFields'](_0x381f27);}})[_0x6130('0x24')](function(_0x469263){if(_0x469263){_0x3da7cc=_0x469263['length'];if(!_0x563389[_0x6130('0x2f')][_0x6130('0x35')](_0x6130('0x36'))){_0x381f27['limit']=qs[_0x6130('0x1c')](_0x563389[_0x6130('0x2f')][_0x6130('0x1c')]);_0x381f27['offset']=qs[_0x6130('0x1a')](_0x563389[_0x6130('0x2f')][_0x6130('0x1a')]);}return _0x25e937[_0x6130('0x48')](_0x381f27);}})['then'](function(_0x4363ca){if(_0x4363ca){return _0x4363ca?{'count':_0x3da7cc,'rows':_0x4363ca}:null;}})[_0x6130('0x24')](respondWithResult(_0xf46f9c,null))[_0x6130('0x43')](handleError(_0xf46f9c,null));};exports['getSubjects']=function(_0x47f553,_0x33e126,_0x5525ff){var _0x8d87d2={};var _0x4de344={};var _0x2cc40d;var _0x3d9e49;return db[_0x6130('0x29')][_0x6130('0x49')]({'where':{'id':_0x47f553[_0x6130('0x44')]['id']}})['then'](handleEntityNotFound(_0x33e126,null))[_0x6130('0x24')](function(_0x88d8a3){if(_0x88d8a3){_0x2cc40d=_0x88d8a3;_0x4de344[_0x6130('0x2d')]=_['keys'](db['ZendeskField'][_0x6130('0x2a')]);_0x4de344[_0x6130('0x2f')]=_[_0x6130('0x2e')](_0x47f553['query']);_0x4de344[_0x6130('0x30')]=_[_0x6130('0x31')](_0x4de344['model'],_0x4de344[_0x6130('0x2f')]);_0x8d87d2[_0x6130('0x33')]=_[_0x6130('0x31')](_0x4de344['model'],qs[_0x6130('0x32')](_0x47f553[_0x6130('0x2f')][_0x6130('0x32')]));_0x8d87d2['attributes']=_0x8d87d2[_0x6130('0x33')][_0x6130('0x34')]?_0x8d87d2[_0x6130('0x33')]:_0x4de344[_0x6130('0x2d')];_0x8d87d2[_0x6130('0x4b')]=qs[_0x6130('0x4c')](_0x47f553[_0x6130('0x2f')]['sort']);_0x8d87d2['where']=qs[_0x6130('0x30')](_[_0x6130('0x38')](_0x47f553[_0x6130('0x2f')],_0x4de344[_0x6130('0x30')]));if(_0x47f553[_0x6130('0x2f')][_0x6130('0x39')]){_0x8d87d2[_0x6130('0x37')]=_['merge'](_0x8d87d2[_0x6130('0x37')],{'$or':_[_0x6130('0x3a')](_0x8d87d2[_0x6130('0x33')],function(_0x206bad){var _0x223f1a={};_0x223f1a[_0x206bad]={'$like':'%'+_0x47f553[_0x6130('0x2f')]['filter']+'%'};return _0x223f1a;})});}_0x8d87d2=_[_0x6130('0x3d')]({},_0x8d87d2,_0x47f553[_0x6130('0x3e')]);return _0x2cc40d[_0x6130('0x4d')](_0x8d87d2);}})[_0x6130('0x24')](function(_0x738c20){if(_0x738c20){_0x3d9e49=_0x738c20[_0x6130('0x34')];if(!_0x47f553[_0x6130('0x2f')][_0x6130('0x35')]('nolimit')){_0x8d87d2[_0x6130('0x1c')]=qs[_0x6130('0x1c')](_0x47f553[_0x6130('0x2f')][_0x6130('0x1c')]);_0x8d87d2[_0x6130('0x1a')]=qs[_0x6130('0x1a')](_0x47f553[_0x6130('0x2f')][_0x6130('0x1a')]);}return _0x2cc40d[_0x6130('0x4d')](_0x8d87d2);}})[_0x6130('0x24')](function(_0x1f92ca){if(_0x1f92ca){return _0x1f92ca?{'count':_0x3d9e49,'rows':_0x1f92ca}:null;}})['then'](respondWithResult(_0x33e126,null))[_0x6130('0x43')](handleError(_0x33e126,null));};exports['getDescriptions']=function(_0x2dacfd,_0x2ccaf2,_0x2a13bc){var _0x151b0c={};var _0x36a759={};var _0x50de16;var _0x15d77f;return db['ZendeskConfiguration'][_0x6130('0x49')]({'where':{'id':_0x2dacfd[_0x6130('0x44')]['id']}})[_0x6130('0x24')](handleEntityNotFound(_0x2ccaf2,null))['then'](function(_0x765915){if(_0x765915){_0x50de16=_0x765915;_0x36a759['model']=_[_0x6130('0x2e')](db['ZendeskField'][_0x6130('0x2a')]);_0x36a759['query']=_[_0x6130('0x2e')](_0x2dacfd[_0x6130('0x2f')]);_0x36a759[_0x6130('0x30')]=_['intersection'](_0x36a759[_0x6130('0x2d')],_0x36a759[_0x6130('0x2f')]);_0x151b0c['attributes']=_[_0x6130('0x31')](_0x36a759[_0x6130('0x2d')],qs[_0x6130('0x32')](_0x2dacfd['query'][_0x6130('0x32')]));_0x151b0c[_0x6130('0x33')]=_0x151b0c[_0x6130('0x33')]['length']?_0x151b0c['attributes']:_0x36a759['model'];_0x151b0c[_0x6130('0x4b')]=qs[_0x6130('0x4c')](_0x2dacfd['query'][_0x6130('0x4c')]);_0x151b0c[_0x6130('0x37')]=qs[_0x6130('0x30')](_[_0x6130('0x38')](_0x2dacfd[_0x6130('0x2f')],_0x36a759['filters']));if(_0x2dacfd[_0x6130('0x2f')][_0x6130('0x39')]){_0x151b0c['where']=_['merge'](_0x151b0c[_0x6130('0x37')],{'$or':_['map'](_0x151b0c[_0x6130('0x33')],function(_0x226d13){var _0x3da737={};_0x3da737[_0x226d13]={'$like':'%'+_0x2dacfd[_0x6130('0x2f')]['filter']+'%'};return _0x3da737;})});}_0x151b0c=_[_0x6130('0x3d')]({},_0x151b0c,_0x2dacfd[_0x6130('0x3e')]);return _0x50de16[_0x6130('0x4e')](_0x151b0c);}})[_0x6130('0x24')](function(_0x12157f){if(_0x12157f){_0x15d77f=_0x12157f[_0x6130('0x34')];if(!_0x2dacfd[_0x6130('0x2f')][_0x6130('0x35')](_0x6130('0x36'))){_0x151b0c[_0x6130('0x1c')]=qs[_0x6130('0x1c')](_0x2dacfd['query'][_0x6130('0x1c')]);_0x151b0c[_0x6130('0x1a')]=qs[_0x6130('0x1a')](_0x2dacfd[_0x6130('0x2f')]['offset']);}return _0x50de16[_0x6130('0x4e')](_0x151b0c);}})[_0x6130('0x24')](function(_0x1d201c){if(_0x1d201c){return _0x1d201c?{'count':_0x15d77f,'rows':_0x1d201c}:null;}})[_0x6130('0x24')](respondWithResult(_0x2ccaf2,null))[_0x6130('0x43')](handleError(_0x2ccaf2,null));};exports[_0x6130('0x4f')]=function(_0x1776ec,_0xeb7344,_0x492c0c){var _0x4230e7={};var _0x6893c2={};var _0x3f62c0;var _0x1a5837;return db[_0x6130('0x29')][_0x6130('0x49')]({'where':{'id':_0x1776ec[_0x6130('0x44')]['id']}})[_0x6130('0x24')](handleEntityNotFound(_0xeb7344,null))['then'](function(_0xa503d5){if(_0xa503d5){_0x3f62c0=_0xa503d5;_0x6893c2[_0x6130('0x2d')]=_[_0x6130('0x2e')](db[_0x6130('0x50')]['rawAttributes']);_0x6893c2[_0x6130('0x2f')]=_['keys'](_0x1776ec['query']);_0x6893c2['filters']=_[_0x6130('0x31')](_0x6893c2['model'],_0x6893c2['query']);_0x4230e7[_0x6130('0x33')]=_[_0x6130('0x31')](_0x6893c2[_0x6130('0x2d')],qs[_0x6130('0x32')](_0x1776ec['query'][_0x6130('0x32')]));_0x4230e7[_0x6130('0x33')]=_0x4230e7[_0x6130('0x33')][_0x6130('0x34')]?_0x4230e7[_0x6130('0x33')]:_0x6893c2[_0x6130('0x2d')];_0x4230e7['order']=qs['sort'](_0x1776ec['query'][_0x6130('0x4c')]);_0x4230e7[_0x6130('0x37')]=qs['filters'](_[_0x6130('0x38')](_0x1776ec[_0x6130('0x2f')],_0x6893c2['filters']));if(_0x1776ec['query'][_0x6130('0x39')]){_0x4230e7[_0x6130('0x37')]=_['merge'](_0x4230e7[_0x6130('0x37')],{'$or':_[_0x6130('0x3a')](_0x4230e7[_0x6130('0x33')],function(_0x22dd3){var _0x16f90c={};_0x16f90c[_0x22dd3]={'$like':'%'+_0x1776ec[_0x6130('0x2f')][_0x6130('0x39')]+'%'};return _0x16f90c;})});}_0x4230e7=_[_0x6130('0x3d')]({},_0x4230e7,_0x1776ec[_0x6130('0x3e')]);return _0x3f62c0['getTags'](_0x4230e7);}})['then'](function(_0xd9e300){if(_0xd9e300){_0x1a5837=_0xd9e300['length'];if(!_0x1776ec[_0x6130('0x2f')][_0x6130('0x35')](_0x6130('0x36'))){_0x4230e7[_0x6130('0x1c')]=qs[_0x6130('0x1c')](_0x1776ec[_0x6130('0x2f')]['limit']);_0x4230e7[_0x6130('0x1a')]=qs[_0x6130('0x1a')](_0x1776ec[_0x6130('0x2f')]['offset']);}return _0x3f62c0[_0x6130('0x4f')](_0x4230e7);}})[_0x6130('0x24')](function(_0x31cc7c){if(_0x31cc7c){return _0x31cc7c?{'count':_0x1a5837,'rows':_0x31cc7c}:null;}})[_0x6130('0x24')](respondWithResult(_0xeb7344,null))['catch'](handleError(_0xeb7344,null));};exports['setTags']=function(_0x464335,_0x550150,_0x20e697){if(_0x464335[_0x6130('0x47')]['id']){delete _0x464335[_0x6130('0x47')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x464335['params']['id']}})[_0x6130('0x24')](handleEntityNotFound(_0x550150,null))[_0x6130('0x24')](function(_0x2a70ec){if(_0x2a70ec){return _0x2a70ec[_0x6130('0x51')](_0x464335[_0x6130('0x47')][_0x6130('0x52')]||[]);}return null;})[_0x6130('0x24')](respondWithResult(_0x550150,null))['catch'](handleError(_0x550150,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 844fbb8..a001402 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 _0xd824=['rimraf','../../config/environment','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0xe9902c,_0x1834d7){var _0xc7a5de=function(_0x212375){while(--_0x212375){_0xe9902c['push'](_0xe9902c['shift']());}};_0xc7a5de(++_0x1834d7);}(_0xd824,0xc2));var _0x4d82=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd824[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d82('0x2'));var BPromise=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var fs=require('fs');var path=require(_0x4d82('0x5'));var rimraf=require(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0xd00023,_0x583c7c){return _0xd00023['define'](_0x4d82('0x8'),attributes,{'tableName':_0x4d82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x48918c,_0x1d2114){var _0x4aec8f=function(_0x504478){while(--_0x504478){_0x48918c['push'](_0x48918c['shift']());}};_0x4aec8f(++_0x1d2114);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x14a139,_0x5d158a){_0x14a139=_0x14a139-0x0;var _0x4ed92a=_0xaebd[_0x14a139];return _0x4ed92a;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 3f68739..c657d96 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 _0xc8e5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x487718,_0x55b86b){var _0x451264=function(_0x24e394){while(--_0x24e394){_0x487718['push'](_0x487718['shift']());}};_0x451264(++_0x55b86b);}(_0xc8e5,0x85));var _0x5c8e=function(_0x5b1310,_0x59696c){_0x5b1310=_0x5b1310-0x0;var _0x416372=_0xc8e5[_0x5b1310];return _0x416372;};'use strict';var _=require(_0x5c8e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5c8e('0x1'));var rs=require(_0x5c8e('0x2'));var fs=require('fs');var Redis=require(_0x5c8e('0x3'));var db=require(_0x5c8e('0x4'))['db'];var utils=require(_0x5c8e('0x5'));var logger=require(_0x5c8e('0x6'))(_0x5c8e('0x7'));var config=require(_0x5c8e('0x8'));var jayson=require(_0x5c8e('0x9'));var client=jayson[_0x5c8e('0xa')][_0x5c8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8bb7e,_0x104b83,_0x2cd714){return new BPromise(function(_0x234455,_0x3a79ea){return client['request'](_0x8bb7e,_0x2cd714)[_0x5c8e('0xc')](function(_0x503495){logger[_0x5c8e('0xd')](_0x5c8e('0xe'),_0x104b83,_0x5c8e('0xf'));logger[_0x5c8e('0x10')](_0x5c8e('0x11'),_0x104b83,'request\x20sent',JSON[_0x5c8e('0x12')](_0x503495));if(_0x503495['error']){if(_0x503495['error']['code']===0x1f4){logger['error'](_0x5c8e('0xe'),_0x104b83,_0x503495['error'][_0x5c8e('0x13')]);return _0x3a79ea(_0x503495[_0x5c8e('0x14')][_0x5c8e('0x13')]);}logger[_0x5c8e('0x14')](_0x5c8e('0xe'),_0x104b83,_0x503495[_0x5c8e('0x14')]['message']);return _0x234455(_0x503495['error'][_0x5c8e('0x13')]);}else{logger[_0x5c8e('0xd')](_0x5c8e('0xe'),_0x104b83,_0x5c8e('0xf'));_0x234455(_0x503495[_0x5c8e('0x15')][_0x5c8e('0x13')]);}})[_0x5c8e('0x16')](function(_0x4c1e3f){logger['error'](_0x5c8e('0xe'),_0x104b83,_0x4c1e3f);_0x3a79ea(_0x4c1e3f);});});} \ No newline at end of file +var _0xd7d2=['jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x1de3d1,_0x5166b3){var _0x25f277=function(_0x68983c){while(--_0x68983c){_0x1de3d1['push'](_0x1de3d1['shift']());}};_0x25f277(++_0x5166b3);}(_0xd7d2,0x65));var _0x2d7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd7d2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2d7d('0x0'));var util=require('util');var moment=require(_0x2d7d('0x1'));var BPromise=require(_0x2d7d('0x2'));var rs=require(_0x2d7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d7d('0x5'))(_0x2d7d('0x6'));var config=require('../../config/environment');var jayson=require(_0x2d7d('0x7'));var client=jayson['client'][_0x2d7d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c69d7,_0x269f3f,_0x443e39){return new BPromise(function(_0x16324b,_0x2b657e){return client[_0x2d7d('0x9')](_0x5c69d7,_0x443e39)[_0x2d7d('0xa')](function(_0x24dd59){logger[_0x2d7d('0xb')](_0x2d7d('0xc'),_0x269f3f,_0x2d7d('0xd'));logger[_0x2d7d('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x269f3f,_0x2d7d('0xd'),JSON['stringify'](_0x24dd59));if(_0x24dd59[_0x2d7d('0xf')]){if(_0x24dd59[_0x2d7d('0xf')]['code']===0x1f4){logger['error'](_0x2d7d('0xc'),_0x269f3f,_0x24dd59[_0x2d7d('0xf')][_0x2d7d('0x10')]);return _0x2b657e(_0x24dd59[_0x2d7d('0xf')][_0x2d7d('0x10')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x269f3f,_0x24dd59[_0x2d7d('0xf')]['message']);return _0x16324b(_0x24dd59['error'][_0x2d7d('0x10')]);}else{logger['info'](_0x2d7d('0xc'),_0x269f3f,_0x2d7d('0xd'));_0x16324b(_0x24dd59[_0x2d7d('0x11')][_0x2d7d('0x10')]);}})['catch'](function(_0x24ec39){logger[_0x2d7d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x269f3f,_0x24ec39);_0x2b657e(_0x24ec39);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 289e008..2108a08 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 _0x16e1=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0xc60e50,_0x35c81f){var _0x37d7fc=function(_0x345d50){while(--_0x345d50){_0xc60e50['push'](_0xc60e50['shift']());}};_0x37d7fc(++_0x35c81f);}(_0x16e1,0xe8));var _0x116e=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x16e1[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require(_0x116e('0x0'));var util=require(_0x116e('0x1'));var path=require(_0x116e('0x2'));var timeout=require(_0x116e('0x3'));var express=require(_0x116e('0x4'));var router=express[_0x116e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x116e('0x6'));var interaction=require(_0x116e('0x7'));var config=require(_0x116e('0x8'));var controller=require(_0x116e('0x9'));router[_0x116e('0xa')]('/',auth[_0x116e('0xb')](),controller[_0x116e('0xc')]);router[_0x116e('0xa')](_0x116e('0xd'),auth['isAuthenticated'](),controller[_0x116e('0xe')]);router[_0x116e('0xf')]('/',auth[_0x116e('0xb')](),controller[_0x116e('0x10')]);router[_0x116e('0x11')](_0x116e('0xd'),auth['isAuthenticated'](),controller[_0x116e('0x12')]);router[_0x116e('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x116e('0x14')]=router; \ No newline at end of file +var _0x0331=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x0331,0x1d4));var _0x1033=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0x0331[_0x228641];return _0x5d5d78;};'use strict';var multer=require(_0x1033('0x0'));var util=require(_0x1033('0x1'));var path=require(_0x1033('0x2'));var timeout=require(_0x1033('0x3'));var express=require('express');var router=express[_0x1033('0x4')]();var fs_extra=require(_0x1033('0x5'));var auth=require(_0x1033('0x6'));var interaction=require(_0x1033('0x7'));var config=require(_0x1033('0x8'));var controller=require(_0x1033('0x9'));router[_0x1033('0xa')]('/',auth[_0x1033('0xb')](),controller[_0x1033('0xc')]);router[_0x1033('0xa')](_0x1033('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1033('0xe')]('/',auth[_0x1033('0xb')](),controller['create']);router[_0x1033('0xf')](_0x1033('0xd'),auth['isAuthenticated'](),controller[_0x1033('0x10')]);router['delete'](_0x1033('0xd'),auth[_0x1033('0xb')](),controller[_0x1033('0x11')]);module[_0x1033('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 1e531f1..daeaacd 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 _0x6d14=['string','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2f9cce,_0x20cffd){var _0x1f5273=function(_0x59c225){while(--_0x59c225){_0x2f9cce['push'](_0x2f9cce['shift']());}};_0x1f5273(++_0x20cffd);}(_0x6d14,0x85));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x46d1('0x0'));module[_0x46d1('0x1')]={'type':{'type':Sequelize[_0x46d1('0x2')](_0x46d1('0x3'),'variable','customVariable','keyValue',_0x46d1('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x46d1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x46d1('0x2')](_0x46d1('0x3'),_0x46d1('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x46d1('0x5')]},'idField':{'type':Sequelize[_0x46d1('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x46d1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x46d1('0x5')]}}; \ No newline at end of file +var _0xc936=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x37c99d,_0x1101db){var _0x3c94a9=function(_0x5e014c){while(--_0x5e014c){_0x37c99d['push'](_0x37c99d['shift']());}};_0x3c94a9(++_0x1101db);}(_0xc936,0x142));var _0x6c93=function(_0x16b4d3,_0x3635e6){_0x16b4d3=_0x16b4d3-0x0;var _0x4aa08a=_0xc936[_0x16b4d3];return _0x4aa08a;};'use strict';var Sequelize=require(_0x6c93('0x0'));module[_0x6c93('0x1')]={'type':{'type':Sequelize[_0x6c93('0x2')]('string',_0x6c93('0x3'),_0x6c93('0x4'),_0x6c93('0x5'),_0x6c93('0x6')),'defaultValue':_0x6c93('0x7')},'content':{'type':Sequelize[_0x6c93('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6c93('0x7'),_0x6c93('0x3'),_0x6c93('0x4'))},'keyContent':{'type':Sequelize[_0x6c93('0x8')]},'idField':{'type':Sequelize[_0x6c93('0x8')]},'nameField':{'type':Sequelize[_0x6c93('0x8')]},'customField':{'type':Sequelize[_0x6c93('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c93('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index afe724c..52de69d 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 _0x72d1=['Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72d1,0x18b));var _0x172d=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0x72d1[_0x2deac4];return _0x1c0bda;};'use strict';var emlformat=require(_0x172d('0x0'));var rimraf=require(_0x172d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x172d('0x2'));var rp=require(_0x172d('0x3'));var moment=require(_0x172d('0x4'));var BPromise=require(_0x172d('0x5'));var Mustache=require(_0x172d('0x6'));var util=require(_0x172d('0x7'));var path=require('path');var sox=require(_0x172d('0x8'));var csv=require('to-csv');var ejs=require(_0x172d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x172d('0xa'));var squel=require(_0x172d('0xb'));var crypto=require(_0x172d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x172d('0xd'));var toCsv=require(_0x172d('0xe'));var querystring=require(_0x172d('0xf'));var Papa=require(_0x172d('0x10'));var Redis=require(_0x172d('0x11'));var authService=require(_0x172d('0x12'));var qs=require(_0x172d('0x13'));var as=require(_0x172d('0x14'));var hardwareService=require(_0x172d('0x15'));var logger=require('../../config/logger')(_0x172d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x172d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x238ba5,_0x33f369){_0x33f369=_0x33f369||0xcc;return function(_0x3415de){if(_0x3415de){return _0x238ba5[_0x172d('0x18')](_0x33f369);}return _0x238ba5[_0x172d('0x19')](_0x33f369)[_0x172d('0x1a')]();};}function respondWithResult(_0x382505,_0x9abe7c){_0x9abe7c=_0x9abe7c||0xc8;return function(_0x523b26){if(_0x523b26){return _0x382505[_0x172d('0x19')](_0x9abe7c)['json'](_0x523b26);}};}function respondWithFilteredResult(_0x2508b3,_0x3e9a4f){return function(_0x489b19){if(_0x489b19){var _0x428612=typeof _0x3e9a4f['offset']===_0x172d('0x1b')&&typeof _0x3e9a4f[_0x172d('0x1c')]===_0x172d('0x1b');var _0x5bd9a2=_0x489b19['count'];var _0x34bd43=_0x428612?0x0:_0x3e9a4f[_0x172d('0x1d')];var _0x56121b=_0x428612?_0x489b19[_0x172d('0x1e')]:_0x3e9a4f[_0x172d('0x1d')]+_0x3e9a4f[_0x172d('0x1c')];var _0x25f30e;if(_0x56121b>=_0x5bd9a2){_0x56121b=_0x5bd9a2;_0x25f30e=0xc8;}else{_0x25f30e=0xce;}_0x2508b3[_0x172d('0x19')](_0x25f30e);return _0x2508b3['set'](_0x172d('0x1f'),_0x34bd43+'-'+_0x56121b+'/'+_0x5bd9a2)['json'](_0x489b19);}return null;};}function patchUpdates(_0x394caa){return function(_0x20bbef){try{jsonpatch[_0x172d('0x20')](_0x20bbef,_0x394caa,!![]);}catch(_0x459e7e){return BPromise[_0x172d('0x21')](_0x459e7e);}return _0x20bbef['save']();};}function saveUpdates(_0x49b5b2,_0x109b24){return function(_0x1b7bb8){if(_0x1b7bb8){return _0x1b7bb8[_0x172d('0x22')](_0x49b5b2)[_0x172d('0x23')](function(_0x181ee6){return _0x181ee6;});}return null;};}function removeEntity(_0x45c608,_0x15ce82){return function(_0x4c2644){if(_0x4c2644){return _0x4c2644[_0x172d('0x24')]()['then'](function(){_0x45c608[_0x172d('0x19')](0xcc)[_0x172d('0x1a')]();});}};}function handleEntityNotFound(_0x36328c,_0x4aa20b){return function(_0x34d0f9){if(!_0x34d0f9){_0x36328c[_0x172d('0x18')](0x194);}return _0x34d0f9;};}function handleError(_0xf775ed,_0x4228e8){_0x4228e8=_0x4228e8||0x1f4;return function(_0x3217ce){logger['error'](_0x3217ce[_0x172d('0x25')]);if(_0x3217ce[_0x172d('0x26')]){delete _0x3217ce['name'];}_0xf775ed[_0x172d('0x19')](_0x4228e8)[_0x172d('0x27')](_0x3217ce);};}exports[_0x172d('0x28')]=function(_0xf80bf8,_0x4be6a0){var _0x7d3fab={},_0x5d64fe={},_0x591e3b={'count':0x0,'rows':[]};var _0x5171d6=_[_0x172d('0x29')](db[_0x172d('0x2a')][_0x172d('0x2b')],function(_0x120150){return{'name':_0x120150['fieldName'],'type':_0x120150[_0x172d('0x2c')][_0x172d('0x2d')]};});_0x5d64fe['model']=_[_0x172d('0x29')](_0x5171d6,_0x172d('0x26'));_0x5d64fe[_0x172d('0x2e')]=_['keys'](_0xf80bf8['query']);_0x5d64fe[_0x172d('0x2f')]=_[_0x172d('0x30')](_0x5d64fe[_0x172d('0x31')],_0x5d64fe['query']);_0x7d3fab[_0x172d('0x32')]=_[_0x172d('0x30')](_0x5d64fe['model'],qs[_0x172d('0x33')](_0xf80bf8[_0x172d('0x2e')][_0x172d('0x33')]));_0x7d3fab[_0x172d('0x32')]=_0x7d3fab[_0x172d('0x32')]['length']?_0x7d3fab[_0x172d('0x32')]:_0x5d64fe['model'];if(!_0xf80bf8[_0x172d('0x2e')][_0x172d('0x34')](_0x172d('0x35'))){_0x7d3fab[_0x172d('0x1c')]=qs['limit'](_0xf80bf8['query']['limit']);_0x7d3fab['offset']=qs[_0x172d('0x1d')](_0xf80bf8[_0x172d('0x2e')][_0x172d('0x1d')]);}_0x7d3fab['order']=qs[_0x172d('0x36')](_0xf80bf8[_0x172d('0x2e')][_0x172d('0x36')]);_0x7d3fab[_0x172d('0x37')]=qs[_0x172d('0x2f')](_[_0x172d('0x38')](_0xf80bf8[_0x172d('0x2e')],_0x5d64fe[_0x172d('0x2f')]),_0x5171d6);if(_0xf80bf8[_0x172d('0x2e')]['filter']){_0x7d3fab[_0x172d('0x37')]=_[_0x172d('0x39')](_0x7d3fab[_0x172d('0x37')],{'$or':_[_0x172d('0x29')](_0x5171d6,function(_0x1bccce){if(_0x1bccce['type']!=='VIRTUAL'){var _0x453b6e={};_0x453b6e[_0x1bccce[_0x172d('0x26')]]={'$like':'%'+_0xf80bf8['query']['filter']+'%'};return _0x453b6e;}})});}_0x7d3fab=_[_0x172d('0x39')]({},_0x7d3fab,_0xf80bf8[_0x172d('0x3a')]);var _0x37df1f={'where':_0x7d3fab['where']};return db[_0x172d('0x2a')]['count'](_0x37df1f)[_0x172d('0x23')](function(_0x300039){_0x591e3b['count']=_0x300039;if(_0xf80bf8[_0x172d('0x2e')][_0x172d('0x3b')]){_0x7d3fab[_0x172d('0x3c')]=[{'all':!![]}];}return db[_0x172d('0x2a')][_0x172d('0x3d')](_0x7d3fab);})['then'](function(_0x27a5b6){_0x591e3b[_0x172d('0x3e')]=_0x27a5b6;return _0x591e3b;})[_0x172d('0x23')](respondWithFilteredResult(_0x4be6a0,_0x7d3fab))[_0x172d('0x3f')](handleError(_0x4be6a0,null));};exports[_0x172d('0x40')]=function(_0x2328ea,_0x36bd8d){var _0x3610f7={'raw':!![],'where':{'id':_0x2328ea[_0x172d('0x41')]['id']}},_0x5cbe3a={};_0x5cbe3a[_0x172d('0x31')]=_[_0x172d('0x42')](db[_0x172d('0x2a')][_0x172d('0x2b')]);_0x5cbe3a[_0x172d('0x2e')]=_[_0x172d('0x42')](_0x2328ea[_0x172d('0x2e')]);_0x5cbe3a[_0x172d('0x2f')]=_[_0x172d('0x30')](_0x5cbe3a['model'],_0x5cbe3a['query']);_0x3610f7[_0x172d('0x32')]=_[_0x172d('0x30')](_0x5cbe3a['model'],qs[_0x172d('0x33')](_0x2328ea['query']['fields']));_0x3610f7['attributes']=_0x3610f7['attributes'][_0x172d('0x43')]?_0x3610f7[_0x172d('0x32')]:_0x5cbe3a[_0x172d('0x31')];if(_0x2328ea[_0x172d('0x2e')][_0x172d('0x3b')]){_0x3610f7[_0x172d('0x3c')]=[{'all':!![]}];}_0x3610f7=_[_0x172d('0x39')]({},_0x3610f7,_0x2328ea[_0x172d('0x3a')]);return db[_0x172d('0x2a')][_0x172d('0x44')](_0x3610f7)[_0x172d('0x23')](handleEntityNotFound(_0x36bd8d,null))[_0x172d('0x23')](respondWithResult(_0x36bd8d,null))[_0x172d('0x3f')](handleError(_0x36bd8d,null));};exports[_0x172d('0x45')]=function(_0x4c5246,_0x699d89){return db['ZendeskField'][_0x172d('0x45')](_0x4c5246['body'],{})[_0x172d('0x23')](respondWithResult(_0x699d89,0xc9))[_0x172d('0x3f')](handleError(_0x699d89,null));};exports[_0x172d('0x22')]=function(_0x191299,_0xd1db5c){if(_0x191299['body']['id']){delete _0x191299[_0x172d('0x46')]['id'];}return db['ZendeskField'][_0x172d('0x44')]({'where':{'id':_0x191299[_0x172d('0x41')]['id']}})['then'](handleEntityNotFound(_0xd1db5c,null))['then'](saveUpdates(_0x191299[_0x172d('0x46')],null))['then'](respondWithResult(_0xd1db5c,null))[_0x172d('0x3f')](handleError(_0xd1db5c,null));};exports[_0x172d('0x24')]=function(_0x150d4b,_0x3c141f){return db[_0x172d('0x2a')]['find']({'where':{'id':_0x150d4b[_0x172d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c141f,null))[_0x172d('0x23')](removeEntity(_0x3c141f,null))['catch'](handleError(_0x3c141f,null));}; \ No newline at end of file +var _0x666b=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','ZendeskField','includeAll','include','findAll','catch','show','keys','fields','options','find','create'];(function(_0x46d777,_0x1c155a){var _0x471028=function(_0x2ce2cc){while(--_0x2ce2cc){_0x46d777['push'](_0x46d777['shift']());}};_0x471028(++_0x1c155a);}(_0x666b,0x129));var _0xb666=function(_0x4bf4a2,_0x15f64c){_0x4bf4a2=_0x4bf4a2-0x0;var _0x1eca49=_0x666b[_0x4bf4a2];return _0x1eca49;};'use strict';var emlformat=require(_0xb666('0x0'));var rimraf=require(_0xb666('0x1'));var zipdir=require(_0xb666('0x2'));var jsonpatch=require(_0xb666('0x3'));var rp=require(_0xb666('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb666('0x5'));var util=require(_0xb666('0x6'));var path=require(_0xb666('0x7'));var sox=require('sox');var csv=require(_0xb666('0x8'));var ejs=require(_0xb666('0x9'));var fs=require('fs');var fs_extra=require(_0xb666('0xa'));var _=require(_0xb666('0xb'));var squel=require('squel');var crypto=require(_0xb666('0xc'));var jsforce=require(_0xb666('0xd'));var deskjs=require(_0xb666('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb666('0xf'));var Papa=require(_0xb666('0x10'));var Redis=require(_0xb666('0x11'));var authService=require(_0xb666('0x12'));var qs=require(_0xb666('0x13'));var as=require(_0xb666('0x14'));var hardwareService=require(_0xb666('0x15'));var logger=require(_0xb666('0x16'))(_0xb666('0x17'));var utils=require(_0xb666('0x18'));var config=require(_0xb666('0x19'));var licenseUtil=require(_0xb666('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48fcc8,_0x2a31ba){_0x2a31ba=_0x2a31ba||0xcc;return function(_0x390e58){if(_0x390e58){return _0x48fcc8[_0xb666('0x1b')](_0x2a31ba);}return _0x48fcc8[_0xb666('0x1c')](_0x2a31ba)[_0xb666('0x1d')]();};}function respondWithResult(_0x4d4bac,_0x237d98){_0x237d98=_0x237d98||0xc8;return function(_0x31030a){if(_0x31030a){return _0x4d4bac[_0xb666('0x1c')](_0x237d98)[_0xb666('0x1e')](_0x31030a);}};}function respondWithFilteredResult(_0x5d8e4c,_0x543273){return function(_0x111b5a){if(_0x111b5a){var _0x30a663=typeof _0x543273[_0xb666('0x1f')]===_0xb666('0x20')&&typeof _0x543273[_0xb666('0x21')]===_0xb666('0x20');var _0x276490=_0x111b5a[_0xb666('0x22')];var _0x49c4e4=_0x30a663?0x0:_0x543273['offset'];var _0x24f2a6=_0x30a663?_0x111b5a[_0xb666('0x22')]:_0x543273[_0xb666('0x1f')]+_0x543273[_0xb666('0x21')];var _0x29bfa7;if(_0x24f2a6>=_0x276490){_0x24f2a6=_0x276490;_0x29bfa7=0xc8;}else{_0x29bfa7=0xce;}_0x5d8e4c[_0xb666('0x1c')](_0x29bfa7);return _0x5d8e4c['set'](_0xb666('0x23'),_0x49c4e4+'-'+_0x24f2a6+'/'+_0x276490)['json'](_0x111b5a);}return null;};}function patchUpdates(_0x329f44){return function(_0x30b24e){try{jsonpatch['apply'](_0x30b24e,_0x329f44,!![]);}catch(_0x2a5975){return BPromise[_0xb666('0x24')](_0x2a5975);}return _0x30b24e[_0xb666('0x25')]();};}function saveUpdates(_0x30f29d,_0x43e2c3){return function(_0x44abef){if(_0x44abef){return _0x44abef[_0xb666('0x26')](_0x30f29d)[_0xb666('0x27')](function(_0x41044e){return _0x41044e;});}return null;};}function removeEntity(_0x3f4868,_0x31a02e){return function(_0x4aa544){if(_0x4aa544){return _0x4aa544[_0xb666('0x28')]()[_0xb666('0x27')](function(){_0x3f4868[_0xb666('0x1c')](0xcc)[_0xb666('0x1d')]();});}};}function handleEntityNotFound(_0x487993,_0x1e05c3){return function(_0x501ba4){if(!_0x501ba4){_0x487993[_0xb666('0x1b')](0x194);}return _0x501ba4;};}function handleError(_0x334548,_0x1dff43){_0x1dff43=_0x1dff43||0x1f4;return function(_0x29b104){logger[_0xb666('0x29')](_0x29b104[_0xb666('0x2a')]);if(_0x29b104[_0xb666('0x2b')]){delete _0x29b104[_0xb666('0x2b')];}_0x334548[_0xb666('0x1c')](_0x1dff43)[_0xb666('0x2c')](_0x29b104);};}exports[_0xb666('0x2d')]=function(_0x34455a,_0x54063d){var _0x1343bb={},_0x1ba4bf={},_0x4d419e={'count':0x0,'rows':[]};var _0x5270ea=_[_0xb666('0x2e')](db['ZendeskField'][_0xb666('0x2f')],function(_0x35aa3b){return{'name':_0x35aa3b['fieldName'],'type':_0x35aa3b[_0xb666('0x30')][_0xb666('0x31')]};});_0x1ba4bf[_0xb666('0x32')]=_[_0xb666('0x2e')](_0x5270ea,_0xb666('0x2b'));_0x1ba4bf[_0xb666('0x33')]=_['keys'](_0x34455a[_0xb666('0x33')]);_0x1ba4bf[_0xb666('0x34')]=_[_0xb666('0x35')](_0x1ba4bf[_0xb666('0x32')],_0x1ba4bf['query']);_0x1343bb[_0xb666('0x36')]=_['intersection'](_0x1ba4bf[_0xb666('0x32')],qs['fields'](_0x34455a[_0xb666('0x33')]['fields']));_0x1343bb['attributes']=_0x1343bb[_0xb666('0x36')][_0xb666('0x37')]?_0x1343bb['attributes']:_0x1ba4bf['model'];if(!_0x34455a[_0xb666('0x33')]['hasOwnProperty'](_0xb666('0x38'))){_0x1343bb['limit']=qs['limit'](_0x34455a[_0xb666('0x33')][_0xb666('0x21')]);_0x1343bb[_0xb666('0x1f')]=qs['offset'](_0x34455a[_0xb666('0x33')][_0xb666('0x1f')]);}_0x1343bb[_0xb666('0x39')]=qs[_0xb666('0x3a')](_0x34455a[_0xb666('0x33')][_0xb666('0x3a')]);_0x1343bb['where']=qs[_0xb666('0x34')](_['pick'](_0x34455a[_0xb666('0x33')],_0x1ba4bf[_0xb666('0x34')]),_0x5270ea);if(_0x34455a['query']['filter']){_0x1343bb[_0xb666('0x3b')]=_[_0xb666('0x3c')](_0x1343bb['where'],{'$or':_[_0xb666('0x2e')](_0x5270ea,function(_0x58f7e0){if(_0x58f7e0[_0xb666('0x30')]!==_0xb666('0x3d')){var _0x556247={};_0x556247[_0x58f7e0[_0xb666('0x2b')]]={'$like':'%'+_0x34455a['query']['filter']+'%'};return _0x556247;}})});}_0x1343bb=_[_0xb666('0x3c')]({},_0x1343bb,_0x34455a['options']);var _0x318566={'where':_0x1343bb[_0xb666('0x3b')]};return db[_0xb666('0x3e')][_0xb666('0x22')](_0x318566)[_0xb666('0x27')](function(_0xb46645){_0x4d419e[_0xb666('0x22')]=_0xb46645;if(_0x34455a[_0xb666('0x33')][_0xb666('0x3f')]){_0x1343bb[_0xb666('0x40')]=[{'all':!![]}];}return db[_0xb666('0x3e')][_0xb666('0x41')](_0x1343bb);})['then'](function(_0x441015){_0x4d419e['rows']=_0x441015;return _0x4d419e;})[_0xb666('0x27')](respondWithFilteredResult(_0x54063d,_0x1343bb))[_0xb666('0x42')](handleError(_0x54063d,null));};exports[_0xb666('0x43')]=function(_0x158cb1,_0x2a110d){var _0x2cafbd={'raw':!![],'where':{'id':_0x158cb1['params']['id']}},_0x6ad5fd={};_0x6ad5fd[_0xb666('0x32')]=_[_0xb666('0x44')](db['ZendeskField'][_0xb666('0x2f')]);_0x6ad5fd[_0xb666('0x33')]=_['keys'](_0x158cb1[_0xb666('0x33')]);_0x6ad5fd[_0xb666('0x34')]=_[_0xb666('0x35')](_0x6ad5fd[_0xb666('0x32')],_0x6ad5fd[_0xb666('0x33')]);_0x2cafbd[_0xb666('0x36')]=_['intersection'](_0x6ad5fd[_0xb666('0x32')],qs[_0xb666('0x45')](_0x158cb1['query']['fields']));_0x2cafbd[_0xb666('0x36')]=_0x2cafbd[_0xb666('0x36')][_0xb666('0x37')]?_0x2cafbd[_0xb666('0x36')]:_0x6ad5fd[_0xb666('0x32')];if(_0x158cb1['query']['includeAll']){_0x2cafbd[_0xb666('0x40')]=[{'all':!![]}];}_0x2cafbd=_['merge']({},_0x2cafbd,_0x158cb1[_0xb666('0x46')]);return db[_0xb666('0x3e')][_0xb666('0x47')](_0x2cafbd)[_0xb666('0x27')](handleEntityNotFound(_0x2a110d,null))['then'](respondWithResult(_0x2a110d,null))[_0xb666('0x42')](handleError(_0x2a110d,null));};exports[_0xb666('0x48')]=function(_0x337494,_0x5b17ce){return db[_0xb666('0x3e')][_0xb666('0x48')](_0x337494[_0xb666('0x49')],{})[_0xb666('0x27')](respondWithResult(_0x5b17ce,0xc9))[_0xb666('0x42')](handleError(_0x5b17ce,null));};exports['update']=function(_0x18442a,_0x314a51){if(_0x18442a[_0xb666('0x49')]['id']){delete _0x18442a['body']['id'];}return db[_0xb666('0x3e')][_0xb666('0x47')]({'where':{'id':_0x18442a['params']['id']}})[_0xb666('0x27')](handleEntityNotFound(_0x314a51,null))[_0xb666('0x27')](saveUpdates(_0x18442a[_0xb666('0x49')],null))[_0xb666('0x27')](respondWithResult(_0x314a51,null))['catch'](handleError(_0x314a51,null));};exports['destroy']=function(_0x3df011,_0xe3ab99){return db[_0xb666('0x3e')][_0xb666('0x47')]({'where':{'id':_0x3df011['params']['id']}})[_0xb666('0x27')](handleEntityNotFound(_0xe3ab99,null))[_0xb666('0x27')](removeEntity(_0xe3ab99,null))['catch'](handleError(_0xe3ab99,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 797a87c..66e5483 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 _0x750b=['request-promise','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x750b,0x113));var _0xb750=function(_0x351b6d,_0x290aca){_0x351b6d=_0x351b6d-0x0;var _0x20370c=_0x750b[_0x351b6d];return _0x20370c;};'use strict';var _=require(_0xb750('0x0'));var util=require(_0xb750('0x1'));var logger=require('../../config/logger')(_0xb750('0x2'));var moment=require(_0xb750('0x3'));var BPromise=require(_0xb750('0x4'));var rp=require(_0xb750('0x5'));var fs=require('fs');var path=require(_0xb750('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb750('0x7'));module[_0xb750('0x8')]=function(_0x2caa4b,_0xfb4104){return _0x2caa4b['define'](_0xb750('0x9'),attributes,{'tableName':_0xb750('0xa'),'paranoid':![],'indexes':[{'name':_0xb750('0xb'),'fields':[_0xb750('0xc'),_0xb750('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x618c=['ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x13ac58,_0x5738c7){var _0x502605=function(_0x12b720){while(--_0x12b720){_0x13ac58['push'](_0x13ac58['shift']());}};_0x502605(++_0x5738c7);}(_0x618c,0x17b));var _0xc618=function(_0x349af0,_0x4167f1){_0x349af0=_0x349af0-0x0;var _0x3d107e=_0x618c[_0x349af0];return _0x3d107e;};'use strict';var _=require(_0xc618('0x0'));var util=require(_0xc618('0x1'));var logger=require('../../config/logger')(_0xc618('0x2'));var moment=require(_0xc618('0x3'));var BPromise=require(_0xc618('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc618('0x5'));var rimraf=require(_0xc618('0x6'));var config=require(_0xc618('0x7'));var attributes=require(_0xc618('0x8'));module[_0xc618('0x9')]=function(_0x48a4fa,_0x407dff){return _0x48a4fa[_0xc618('0xa')](_0xc618('0xb'),attributes,{'tableName':_0xc618('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc618('0xd'),_0xc618('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 259840d..1c5b9a5 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 _0x989b=['info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x403982,_0x5e65eb){var _0x452fb3=function(_0x30a191){while(--_0x30a191){_0x403982['push'](_0x403982['shift']());}};_0x452fb3(++_0x5e65eb);}(_0x989b,0x1ee));var _0xb989=function(_0x2755bf,_0x3aca64){_0x2755bf=_0x2755bf-0x0;var _0x33daa9=_0x989b[_0x2755bf];return _0x33daa9;};'use strict';var _=require(_0xb989('0x0'));var util=require('util');var moment=require(_0xb989('0x1'));var BPromise=require('bluebird');var rs=require(_0xb989('0x2'));var fs=require('fs');var Redis=require(_0xb989('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb989('0x4'));var logger=require(_0xb989('0x5'))(_0xb989('0x6'));var config=require(_0xb989('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb989('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27bdda,_0x5e9647,_0x41f9a3){return new BPromise(function(_0x9e3f9d,_0x4d0172){return client[_0xb989('0x9')](_0x27bdda,_0x41f9a3)['then'](function(_0x4b546a){logger[_0xb989('0xa')]('ZendeskField,\x20%s,\x20%s',_0x5e9647,_0xb989('0xb'));logger[_0xb989('0xc')](_0xb989('0xd'),_0x5e9647,_0xb989('0xb'),JSON[_0xb989('0xe')](_0x4b546a));if(_0x4b546a[_0xb989('0xf')]){if(_0x4b546a[_0xb989('0xf')][_0xb989('0x10')]===0x1f4){logger[_0xb989('0xf')](_0xb989('0x11'),_0x5e9647,_0x4b546a[_0xb989('0xf')]['message']);return _0x4d0172(_0x4b546a[_0xb989('0xf')][_0xb989('0x12')]);}logger['error'](_0xb989('0x11'),_0x5e9647,_0x4b546a[_0xb989('0xf')][_0xb989('0x12')]);return _0x9e3f9d(_0x4b546a[_0xb989('0xf')][_0xb989('0x12')]);}else{logger[_0xb989('0xa')](_0xb989('0x11'),_0x5e9647,_0xb989('0xb'));_0x9e3f9d(_0x4b546a[_0xb989('0x13')][_0xb989('0x12')]);}})[_0xb989('0x14')](function(_0xc7a4cc){logger[_0xb989('0xf')](_0xb989('0x11'),_0x5e9647,_0xc7a4cc);_0x4d0172(_0xc7a4cc);});});} \ No newline at end of file +var _0x126e=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x71700a,_0xa68bd){var _0x587d5f=function(_0xe43949){while(--_0xe43949){_0x71700a['push'](_0x71700a['shift']());}};_0x587d5f(++_0xa68bd);}(_0x126e,0x1b4));var _0xe126=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x126e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require(_0xe126('0x1'));var BPromise=require(_0xe126('0x2'));var rs=require(_0xe126('0x3'));var fs=require('fs');var Redis=require(_0xe126('0x4'));var db=require(_0xe126('0x5'))['db'];var utils=require(_0xe126('0x6'));var logger=require(_0xe126('0x7'))('rpc');var config=require(_0xe126('0x8'));var jayson=require(_0xe126('0x9'));var client=jayson[_0xe126('0xa')][_0xe126('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18138b,_0x6ba4fd,_0xf40305){return new BPromise(function(_0x13f92b,_0x38fb6f){return client[_0xe126('0xc')](_0x18138b,_0xf40305)['then'](function(_0xb49dfe){logger['info'](_0xe126('0xd'),_0x6ba4fd,_0xe126('0xe'));logger[_0xe126('0xf')](_0xe126('0x10'),_0x6ba4fd,'request\x20sent',JSON[_0xe126('0x11')](_0xb49dfe));if(_0xb49dfe[_0xe126('0x12')]){if(_0xb49dfe[_0xe126('0x12')][_0xe126('0x13')]===0x1f4){logger[_0xe126('0x12')](_0xe126('0xd'),_0x6ba4fd,_0xb49dfe[_0xe126('0x12')]['message']);return _0x38fb6f(_0xb49dfe[_0xe126('0x12')][_0xe126('0x14')]);}logger['error'](_0xe126('0xd'),_0x6ba4fd,_0xb49dfe[_0xe126('0x12')][_0xe126('0x14')]);return _0x13f92b(_0xb49dfe[_0xe126('0x12')][_0xe126('0x14')]);}else{logger[_0xe126('0x15')](_0xe126('0xd'),_0x6ba4fd,_0xe126('0xe'));_0x13f92b(_0xb49dfe[_0xe126('0x16')][_0xe126('0x14')]);}})[_0xe126('0x17')](function(_0x1ea312){logger[_0xe126('0x12')](_0xe126('0xd'),_0x6ba4fd,_0x1ea312);_0x38fb6f(_0x1ea312);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c75812f..caa6d0c 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 _0x6cb7=['./intZohoAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bb9da,_0x502962){var _0x17eef7=function(_0x94c254){while(--_0x94c254){_0x3bb9da['push'](_0x3bb9da['shift']());}};_0x17eef7(++_0x502962);}(_0x6cb7,0x114));var _0x76cb=function(_0x1bed8a,_0x24d429){_0x1bed8a=_0x1bed8a-0x0;var _0x258c57=_0x6cb7[_0x1bed8a];return _0x258c57;};'use strict';var multer=require(_0x76cb('0x0'));var util=require(_0x76cb('0x1'));var path=require(_0x76cb('0x2'));var timeout=require(_0x76cb('0x3'));var express=require(_0x76cb('0x4'));var router=express[_0x76cb('0x5')]();var fs_extra=require(_0x76cb('0x6'));var auth=require(_0x76cb('0x7'));var interaction=require(_0x76cb('0x8'));var config=require(_0x76cb('0x9'));var controller=require(_0x76cb('0xa'));router['get']('/',auth[_0x76cb('0xb')](),controller[_0x76cb('0xc')]);router['get'](_0x76cb('0xd'),auth[_0x76cb('0xb')](),controller[_0x76cb('0xe')]);router[_0x76cb('0xf')](_0x76cb('0x10'),auth[_0x76cb('0xb')](),controller[_0x76cb('0x11')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x76cb('0x12')]('/',auth[_0x76cb('0xb')](),controller[_0x76cb('0x13')]);router[_0x76cb('0x12')](_0x76cb('0x10'),auth[_0x76cb('0xb')](),controller[_0x76cb('0x14')]);router[_0x76cb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x76cb('0x16')]);router[_0x76cb('0x17')](_0x76cb('0xd'),auth[_0x76cb('0xb')](),controller[_0x76cb('0x18')]);module[_0x76cb('0x19')]=router; \ No newline at end of file +var _0x19f8=['/:id/configurations','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x195d08,_0xe40309){var _0x147d5f=function(_0x379c3a){while(--_0x379c3a){_0x195d08['push'](_0x195d08['shift']());}};_0x147d5f(++_0xe40309);}(_0x19f8,0x13e));var _0x819f=function(_0x487683,_0x58b9b8){_0x487683=_0x487683-0x0;var _0x178a4d=_0x19f8[_0x487683];return _0x178a4d;};'use strict';var multer=require('multer');var util=require(_0x819f('0x0'));var path=require(_0x819f('0x1'));var timeout=require('connect-timeout');var express=require(_0x819f('0x2'));var router=express['Router']();var fs_extra=require(_0x819f('0x3'));var auth=require(_0x819f('0x4'));var interaction=require(_0x819f('0x5'));var config=require(_0x819f('0x6'));var controller=require(_0x819f('0x7'));router[_0x819f('0x8')]('/',auth[_0x819f('0x9')](),controller[_0x819f('0xa')]);router[_0x819f('0x8')](_0x819f('0xb'),auth[_0x819f('0x9')](),controller[_0x819f('0xc')]);router['get']('/:id/configurations',auth[_0x819f('0x9')](),controller[_0x819f('0xd')]);router[_0x819f('0x8')](_0x819f('0xe'),auth[_0x819f('0x9')](),controller[_0x819f('0xf')]);router['post']('/',auth[_0x819f('0x9')](),controller[_0x819f('0x10')]);router[_0x819f('0x11')](_0x819f('0x12'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x819f('0x13')](_0x819f('0xb'),auth[_0x819f('0x9')](),controller[_0x819f('0x14')]);router[_0x819f('0x15')](_0x819f('0xb'),auth[_0x819f('0x9')](),controller[_0x819f('0x16')]);module[_0x819f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ee705c9..332b87b 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 _0xd0bb=['exports','STRING','sequelize'];(function(_0x267345,_0x365252){var _0x350b03=function(_0x1fd8d6){while(--_0x1fd8d6){_0x267345['push'](_0x267345['shift']());}};_0x350b03(++_0x365252);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x52a505,_0x5dec98){_0x52a505=_0x52a505-0x0;var _0x1fc95e=_0xd0bb[_0x52a505];return _0x1fc95e;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd0b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbd0b('0x2')]},'clientSecret':{'type':Sequelize[_0xbd0b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xbd0b('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c44=['STRING'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f2f3b41..17c071c 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 _0x4763=['mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','show','intersection','include','find','create','body','findOne','params','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','moment'];(function(_0x56857c,_0x4868cb){var _0x4027e7=function(_0x1b452f){while(--_0x1b452f){_0x56857c['push'](_0x56857c['shift']());}};_0x4027e7(++_0x4868cb);}(_0x4763,0x101));var _0x3476=function(_0x383baf,_0x496402){_0x383baf=_0x383baf-0x0;var _0x5b46e5=_0x4763[_0x383baf];return _0x5b46e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3476('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3476('0x1'));var rp=require('request-promise');var moment=require(_0x3476('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3476('0x3'));var util=require('util');var path=require(_0x3476('0x4'));var sox=require(_0x3476('0x5'));var csv=require(_0x3476('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3476('0x7'));var _=require(_0x3476('0x8'));var squel=require(_0x3476('0x9'));var crypto=require(_0x3476('0xa'));var jsforce=require(_0x3476('0xb'));var deskjs=require(_0x3476('0xc'));var toCsv=require(_0x3476('0x6'));var querystring=require('querystring');var Papa=require(_0x3476('0xd'));var Redis=require(_0x3476('0xe'));var authService=require(_0x3476('0xf'));var qs=require(_0x3476('0x10'));var as=require(_0x3476('0x11'));var hardwareService=require(_0x3476('0x12'));var logger=require(_0x3476('0x13'))(_0x3476('0x14'));var utils=require(_0x3476('0x15'));var config=require(_0x3476('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3476('0x17'));function respondWithStatusCode(_0x1950ea,_0x44325e){_0x44325e=_0x44325e||0xcc;return function(_0x2375e3){if(_0x2375e3){return _0x1950ea[_0x3476('0x18')](_0x44325e);}return _0x1950ea[_0x3476('0x19')](_0x44325e)[_0x3476('0x1a')]();};}function respondWithResult(_0x3ed165,_0x4975f6){_0x4975f6=_0x4975f6||0xc8;return function(_0x555d0b){if(_0x555d0b){return _0x3ed165[_0x3476('0x19')](_0x4975f6)[_0x3476('0x1b')](_0x555d0b);}};}function respondWithFilteredResult(_0x50a7a5,_0x2e5927){return function(_0x27ca56){if(_0x27ca56){var _0x1c3c72=typeof _0x2e5927[_0x3476('0x1c')]===_0x3476('0x1d')&&typeof _0x2e5927[_0x3476('0x1e')]===_0x3476('0x1d');var _0x27592f=_0x27ca56['count'];var _0x2e6dbb=_0x1c3c72?0x0:_0x2e5927[_0x3476('0x1c')];var _0x397cd6=_0x1c3c72?_0x27ca56[_0x3476('0x1f')]:_0x2e5927['offset']+_0x2e5927[_0x3476('0x1e')];var _0x269f5c;if(_0x397cd6>=_0x27592f){_0x397cd6=_0x27592f;_0x269f5c=0xc8;}else{_0x269f5c=0xce;}_0x50a7a5[_0x3476('0x19')](_0x269f5c);return _0x50a7a5['set'](_0x3476('0x20'),_0x2e6dbb+'-'+_0x397cd6+'/'+_0x27592f)[_0x3476('0x1b')](_0x27ca56);}return null;};}function patchUpdates(_0x26e8f3){return function(_0x4aa811){try{jsonpatch['apply'](_0x4aa811,_0x26e8f3,!![]);}catch(_0x4d32e9){return BPromise[_0x3476('0x21')](_0x4d32e9);}return _0x4aa811['save']();};}function saveUpdates(_0xacab14,_0x209dcd){return function(_0x34c249){if(_0x34c249){return _0x34c249[_0x3476('0x22')](_0xacab14)['then'](function(_0x38fb28){return _0x38fb28;});}return null;};}function removeEntity(_0x39ff50,_0x20d09c){return function(_0x4132bc){if(_0x4132bc){return _0x4132bc[_0x3476('0x23')]()[_0x3476('0x24')](function(){_0x39ff50[_0x3476('0x19')](0xcc)[_0x3476('0x1a')]();});}};}function handleEntityNotFound(_0x5b32a8,_0x5cb4da){return function(_0x225ca0){if(!_0x225ca0){_0x5b32a8[_0x3476('0x18')](0x194);}return _0x225ca0;};}function handleError(_0x1587bc,_0x29e62b){_0x29e62b=_0x29e62b||0x1f4;return function(_0x18df86){logger[_0x3476('0x25')](_0x18df86['stack']);if(_0x18df86[_0x3476('0x26')]){delete _0x18df86[_0x3476('0x26')];}_0x1587bc['status'](_0x29e62b)[_0x3476('0x27')](_0x18df86);};}exports[_0x3476('0x28')]=function(_0x3bcca8,_0x37a1f5){var _0x20a2d7={},_0x25e228={},_0x181a9a={'count':0x0,'rows':[]};var _0x2e0baa=_[_0x3476('0x29')](db[_0x3476('0x2a')][_0x3476('0x2b')],function(_0x3e81c2){return{'name':_0x3e81c2[_0x3476('0x2c')],'type':_0x3e81c2['type'][_0x3476('0x2d')]};});_0x25e228[_0x3476('0x2e')]=_['map'](_0x2e0baa,_0x3476('0x26'));_0x25e228[_0x3476('0x2f')]=_[_0x3476('0x30')](_0x3bcca8[_0x3476('0x2f')]);_0x25e228[_0x3476('0x31')]=_['intersection'](_0x25e228[_0x3476('0x2e')],_0x25e228[_0x3476('0x2f')]);_0x20a2d7[_0x3476('0x32')]=_['intersection'](_0x25e228[_0x3476('0x2e')],qs[_0x3476('0x33')](_0x3bcca8[_0x3476('0x2f')][_0x3476('0x33')]));_0x20a2d7[_0x3476('0x32')]=_0x20a2d7[_0x3476('0x32')][_0x3476('0x34')]?_0x20a2d7[_0x3476('0x32')]:_0x25e228[_0x3476('0x2e')];if(!_0x3bcca8['query'][_0x3476('0x35')](_0x3476('0x36'))){_0x20a2d7[_0x3476('0x1e')]=qs[_0x3476('0x1e')](_0x3bcca8[_0x3476('0x2f')][_0x3476('0x1e')]);_0x20a2d7[_0x3476('0x1c')]=qs[_0x3476('0x1c')](_0x3bcca8[_0x3476('0x2f')][_0x3476('0x1c')]);}_0x20a2d7[_0x3476('0x37')]=qs['sort'](_0x3bcca8[_0x3476('0x2f')]['sort']);_0x20a2d7[_0x3476('0x38')]=qs[_0x3476('0x31')](_[_0x3476('0x39')](_0x3bcca8['query'],_0x25e228[_0x3476('0x31')]),_0x2e0baa);if(_0x3bcca8[_0x3476('0x2f')]['filter']){_0x20a2d7[_0x3476('0x38')]=_[_0x3476('0x3a')](_0x20a2d7[_0x3476('0x38')],{'$or':_['map'](_0x2e0baa,function(_0x25bfba){if(_0x25bfba[_0x3476('0x3b')]!==_0x3476('0x3c')){var _0x14afa5={};_0x14afa5[_0x25bfba[_0x3476('0x26')]]={'$like':'%'+_0x3bcca8[_0x3476('0x2f')][_0x3476('0x3d')]+'%'};return _0x14afa5;}})});}_0x20a2d7=_['merge']({},_0x20a2d7,_0x3bcca8[_0x3476('0x3e')]);var _0x3b106b={'where':_0x20a2d7[_0x3476('0x38')]};return db[_0x3476('0x2a')]['count'](_0x3b106b)[_0x3476('0x24')](function(_0x524899){_0x181a9a[_0x3476('0x1f')]=_0x524899;if(_0x3bcca8['query'][_0x3476('0x3f')]){_0x20a2d7['include']=[{'all':!![]}];}return db[_0x3476('0x2a')]['findAll'](_0x20a2d7);})[_0x3476('0x24')](function(_0x258dc8){_0x181a9a[_0x3476('0x40')]=_0x258dc8;return _0x181a9a;})[_0x3476('0x24')](respondWithFilteredResult(_0x37a1f5,_0x20a2d7))[_0x3476('0x41')](handleError(_0x37a1f5,null));};exports[_0x3476('0x42')]=function(_0xd638a4,_0x18ef24){var _0x400948={'raw':![],'where':{'id':_0xd638a4['params']['id']}},_0x5c265e={};_0x5c265e['model']=_[_0x3476('0x30')](db['ZohoAccount'][_0x3476('0x2b')]);_0x5c265e[_0x3476('0x2f')]=_[_0x3476('0x30')](_0xd638a4[_0x3476('0x2f')]);_0x5c265e['filters']=_[_0x3476('0x43')](_0x5c265e[_0x3476('0x2e')],_0x5c265e[_0x3476('0x2f')]);_0x400948[_0x3476('0x32')]=_[_0x3476('0x43')](_0x5c265e[_0x3476('0x2e')],qs['fields'](_0xd638a4['query'][_0x3476('0x33')]));_0x400948[_0x3476('0x32')]=_0x400948[_0x3476('0x32')][_0x3476('0x34')]?_0x400948[_0x3476('0x32')]:_0x5c265e['model'];if(_0xd638a4[_0x3476('0x2f')][_0x3476('0x3f')]){_0x400948[_0x3476('0x44')]=[{'all':!![]}];}_0x400948=_['merge']({},_0x400948,_0xd638a4[_0x3476('0x3e')]);return db[_0x3476('0x2a')][_0x3476('0x45')](_0x400948)[_0x3476('0x24')](handleEntityNotFound(_0x18ef24,null))['then'](respondWithResult(_0x18ef24,null))[_0x3476('0x41')](handleError(_0x18ef24,null));};exports['create']=function(_0x5126f7,_0x4e69c0){return db['ZohoAccount'][_0x3476('0x46')](_0x5126f7[_0x3476('0x47')],{})[_0x3476('0x24')](respondWithResult(_0x4e69c0,0xc9))['catch'](handleError(_0x4e69c0,null));};exports['update']=function(_0xb26416,_0x27d9db){if(_0xb26416['body']['id']){delete _0xb26416['body']['id'];}return db[_0x3476('0x2a')][_0x3476('0x45')]({'where':{'id':_0xb26416['params']['id']}})[_0x3476('0x24')](handleEntityNotFound(_0x27d9db,null))[_0x3476('0x24')](saveUpdates(_0xb26416[_0x3476('0x47')],null))[_0x3476('0x24')](respondWithResult(_0x27d9db,null))[_0x3476('0x41')](handleError(_0x27d9db,null));};exports[_0x3476('0x23')]=function(_0xfdaf19,_0x204c3e){return db[_0x3476('0x2a')][_0x3476('0x45')]({'where':{'id':_0xfdaf19['params']['id']}})[_0x3476('0x24')](handleEntityNotFound(_0x204c3e,null))[_0x3476('0x24')](removeEntity(_0x204c3e,null))[_0x3476('0x41')](handleError(_0x204c3e,null));};exports['getConfigurations']=function(_0xeab126,_0x385e94,_0x1ed6f7){var _0x49ca5e={};var _0x518096={};var _0x4747b4;var _0x4f0eae;return db['ZohoAccount'][_0x3476('0x48')]({'where':{'id':_0xeab126[_0x3476('0x49')]['id']}})[_0x3476('0x24')](handleEntityNotFound(_0x385e94,null))[_0x3476('0x24')](function(_0x16f9d8){if(_0x16f9d8){_0x4747b4=_0x16f9d8;_0x518096[_0x3476('0x2e')]=_[_0x3476('0x30')](db['ZohoConfiguration'][_0x3476('0x2b')]);_0x518096[_0x3476('0x2f')]=_['keys'](_0xeab126[_0x3476('0x2f')]);_0x518096[_0x3476('0x31')]=_[_0x3476('0x43')](_0x518096[_0x3476('0x2e')],_0x518096[_0x3476('0x2f')]);_0x49ca5e[_0x3476('0x32')]=_[_0x3476('0x43')](_0x518096[_0x3476('0x2e')],qs[_0x3476('0x33')](_0xeab126['query']['fields']));_0x49ca5e['attributes']=_0x49ca5e[_0x3476('0x32')][_0x3476('0x34')]?_0x49ca5e[_0x3476('0x32')]:_0x518096['model'];_0x49ca5e[_0x3476('0x37')]=qs[_0x3476('0x4a')](_0xeab126[_0x3476('0x2f')][_0x3476('0x4a')]);_0x49ca5e['where']=qs[_0x3476('0x31')](_[_0x3476('0x39')](_0xeab126[_0x3476('0x2f')],_0x518096[_0x3476('0x31')]));if(_0xeab126[_0x3476('0x2f')][_0x3476('0x3d')]){_0x49ca5e[_0x3476('0x38')]=_[_0x3476('0x3a')](_0x49ca5e[_0x3476('0x38')],{'$or':_[_0x3476('0x29')](_0x49ca5e[_0x3476('0x32')],function(_0x7762bb){var _0x55309b={};_0x55309b[_0x7762bb]={'$like':'%'+_0xeab126[_0x3476('0x2f')]['filter']+'%'};return _0x55309b;})});}_0x49ca5e=_['merge']({},_0x49ca5e,_0xeab126[_0x3476('0x3e')]);return _0x4747b4[_0x3476('0x4b')](_0x49ca5e);}})[_0x3476('0x24')](function(_0x1fedd6){if(_0x1fedd6){_0x4f0eae=_0x1fedd6[_0x3476('0x34')];if(!_0xeab126['query'][_0x3476('0x35')](_0x3476('0x36'))){_0x49ca5e[_0x3476('0x1e')]=qs[_0x3476('0x1e')](_0xeab126[_0x3476('0x2f')][_0x3476('0x1e')]);_0x49ca5e[_0x3476('0x1c')]=qs[_0x3476('0x1c')](_0xeab126[_0x3476('0x2f')][_0x3476('0x1c')]);}return _0x4747b4[_0x3476('0x4b')](_0x49ca5e);}})[_0x3476('0x24')](function(_0x2e7982){if(_0x2e7982){return _0x2e7982?{'count':_0x4f0eae,'rows':_0x2e7982}:null;}})['then'](respondWithResult(_0x385e94,null))['catch'](handleError(_0x385e94,null));};exports[_0x3476('0x4c')]=function(_0x13c6f9,_0xe7fc62,_0x16eadf){if(_0x13c6f9['body']['id']){delete _0x13c6f9[_0x3476('0x47')]['id'];}return db[_0x3476('0x2a')][_0x3476('0x48')]({'where':{'id':_0x13c6f9[_0x3476('0x49')]['id']}})[_0x3476('0x24')](handleEntityNotFound(_0xe7fc62,null))[_0x3476('0x24')](function(_0x190ebe){if(_0x190ebe){_0x13c6f9[_0x3476('0x47')][_0x3476('0x4d')]=_0x190ebe['id'];_0x13c6f9[_0x3476('0x47')][_0x3476('0x4e')]=integrations[_0x3476('0x4f')](_0x13c6f9['body'][_0x3476('0x50')],_0x13c6f9[_0x3476('0x47')][_0x3476('0x3b')]);_0x13c6f9[_0x3476('0x47')][_0x3476('0x51')]=integrations[_0x3476('0x52')](_0x13c6f9[_0x3476('0x47')][_0x3476('0x50')],_0x13c6f9['body']['type']);return db[_0x3476('0x53')][_0x3476('0x46')](_0x13c6f9[_0x3476('0x47')],{'include':[{'model':db[_0x3476('0x54')],'as':_0x3476('0x4e')},{'model':db['ZohoField'],'as':_0x3476('0x51')}]});}return null;})[_0x3476('0x24')](respondWithResult(_0xe7fc62,null))['catch'](handleError(_0xe7fc62,null));};function getAccessToken(_0x51449b){return new Promise(function(_0x47d7f4,_0x357920){var _0x21dd79;switch(_0x51449b[_0x3476('0x55')]){case'US':_0x21dd79=_0x3476('0x56');break;case'AU':_0x21dd79=_0x3476('0x57');break;case'EU':_0x21dd79=_0x3476('0x58');break;case'IN':_0x21dd79=_0x3476('0x59');break;case'CN':_0x21dd79='https://accounts.zoho.com.cn';break;default:_0x21dd79=_0x3476('0x58');break;}var _0x2374ed={'method':'POST','uri':_0x21dd79+'/oauth/v2/token','qs':{'refresh_token':_0x51449b['refreshToken'],'client_id':_0x51449b['clientId'],'client_secret':_0x51449b[_0x3476('0x5a')],'grant_type':_0x3476('0x5b')},'json':!![]};return rp(_0x2374ed)['then'](function(_0x5211d6){if(_0x5211d6[_0x3476('0x5c')]){_0x47d7f4(_0x5211d6[_0x3476('0x5c')]);}else{_0x357920(_0x3476('0x5d'));}})[_0x3476('0x41')](function(_0x36694e){_0x357920(_0x36694e);});});}exports[_0x3476('0x5e')]=function(_0x3a1120,_0x54e721,_0x204d42){var _0x162960,_0x193384,_0x599c57,_0xf4e6d2,_0x4082be;return db[_0x3476('0x2a')][_0x3476('0x48')]({'where':{'id':_0x3a1120['params']['id']},'attributes':['id',_0x3476('0x5f'),_0x3476('0x55'),_0x3476('0x60'),_0x3476('0x5a'),'serverUrl',_0x3476('0x61'),_0x3476('0x62')]})[_0x3476('0x24')](handleEntityNotFound(_0x54e721,null))[_0x3476('0x24')](function(_0x547a18){_0x4082be=_0x547a18;_0x162960=_0x4082be[_0x3476('0x5f')];_0x193384=_0x162960===_0x3476('0x63')?'eu':_0x3476('0x64');_0x599c57=_0x4082be['serverUrl'];var _0x6d02=_0x599c57[_0x3476('0x65')](-0x1);if(_0x6d02==='/'||_0x6d02==='\x5c'||_0x6d02===':'){_0x599c57=_0x599c57[_0x3476('0x66')](0x0,_0x599c57[_0x3476('0x67')](_0x6d02));}if(!_0x4082be[_0x3476('0x62')]){throw new Error(_0x3476('0x68'));}return getAccessToken(_0x4082be);})[_0x3476('0x24')](function(_0x3b87f6){if(_0x3b87f6){return rp({'method':_0x3476('0x69'),'uri':util[_0x3476('0x6a')](_0x3476('0x6b'),_0x193384),'qs':{'module':_0x3476('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3b87f6},'json':!![]});}})[_0x3476('0x24')](function(_0x1f19cd){if(_0x1f19cd){if(_0x1f19cd[_0x3476('0x6d')]&&_0x1f19cd[_0x3476('0x6d')][_0x3476('0x25')]){throw new Error(_0x1f19cd['response'][_0x3476('0x25')][_0x3476('0x6e')]);}var _0x1b9ff9=[];var _0x5e8617=[];var _0x18f7b2=[_0x3476('0x6f'),_0x3476('0x70'),_0x3476('0x71'),_0x3476('0x72'),'Call_Duration',_0x3476('0x73'),_0x3476('0x74'),_0x3476('0x75')];_0x5e8617=_[_0x3476('0x76')](_0x1f19cd[_0x3476('0x33')],function(_0x39144a){return _0x18f7b2[_0x3476('0x77')](_0x39144a['api_name']);});for(var _0x103bb5=0x0;_0x103bb5<_0x5e8617['length'];_0x103bb5++){if(_0x5e8617[_0x103bb5]['system_mandatory']===![]){_0x1b9ff9[_0x3476('0x78')]({'id':_0x5e8617[_0x103bb5]['id'],'name':_0x5e8617[_0x103bb5][_0x3476('0x79')],'custom':_0x5e8617[_0x103bb5][_0x3476('0x7a')],'options':_0x5e8617[_0x103bb5][_0x3476('0x7b')]===_0x3476('0x7c')&&_0x5e8617[_0x103bb5][_0x3476('0x7d')][_0x3476('0x34')]>-0x1?_[_0x3476('0x29')](_0x5e8617[_0x103bb5][_0x3476('0x7d')],function(_0x6f908e){return{'name':_0x6f908e,'value':_0x6f908e};}):[]});}}return{'count':_0x1b9ff9['length'],'rows':_0x1b9ff9};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x54e721,null))[_0x3476('0x41')](function(_0x26ec92){var _0x27b433=_0x3a1120[_0x3476('0x2f')][_0x3476('0x7e')]?0x1f4:_0x26ec92[_0x3476('0x7f')]||0x1f4;logger[_0x3476('0x25')](_0x3476('0x80'),'getFields',_0x27b433,JSON[_0x3476('0x81')](_0x26ec92));delete _0x26ec92[_0x3476('0x26')];if(_0x27b433===0x191){_0x27b433=0x190;}_0x54e721[_0x3476('0x19')](_0x27b433)[_0x3476('0x27')](_0x3a1120[_0x3476('0x2f')][_0x3476('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x26ec92['statusCode']}:_0x26ec92);});}; \ No newline at end of file +var _0xf640=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0xf640,0xfc));var _0x0f64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf640[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0f64('0x0'));var rimraf=require(_0x0f64('0x1'));var zipdir=require(_0x0f64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f64('0x3'));var moment=require(_0x0f64('0x4'));var BPromise=require(_0x0f64('0x5'));var Mustache=require(_0x0f64('0x6'));var util=require(_0x0f64('0x7'));var path=require(_0x0f64('0x8'));var sox=require(_0x0f64('0x9'));var csv=require('to-csv');var ejs=require(_0x0f64('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f64('0xb'));var squel=require(_0x0f64('0xc'));var crypto=require(_0x0f64('0xd'));var jsforce=require(_0x0f64('0xe'));var deskjs=require(_0x0f64('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0f64('0x10'));var Papa=require(_0x0f64('0x11'));var Redis=require(_0x0f64('0x12'));var authService=require(_0x0f64('0x13'));var qs=require(_0x0f64('0x14'));var as=require(_0x0f64('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0f64('0x16'));var licenseUtil=require(_0x0f64('0x17'));var db=require(_0x0f64('0x18'))['db'];var integrations=require(_0x0f64('0x19'));function respondWithStatusCode(_0x26827d,_0x42518d){_0x42518d=_0x42518d||0xcc;return function(_0x2e1791){if(_0x2e1791){return _0x26827d[_0x0f64('0x1a')](_0x42518d);}return _0x26827d[_0x0f64('0x1b')](_0x42518d)[_0x0f64('0x1c')]();};}function respondWithResult(_0x3a379c,_0x47ec09){_0x47ec09=_0x47ec09||0xc8;return function(_0x28b965){if(_0x28b965){return _0x3a379c['status'](_0x47ec09)[_0x0f64('0x1d')](_0x28b965);}};}function respondWithFilteredResult(_0x5969d8,_0x15b11a){return function(_0x388457){if(_0x388457){var _0xe239cb=typeof _0x15b11a[_0x0f64('0x1e')]==='undefined'&&typeof _0x15b11a[_0x0f64('0x1f')]===_0x0f64('0x20');var _0x59bc45=_0x388457[_0x0f64('0x21')];var _0x1caafc=_0xe239cb?0x0:_0x15b11a[_0x0f64('0x1e')];var _0x53152d=_0xe239cb?_0x388457[_0x0f64('0x21')]:_0x15b11a['offset']+_0x15b11a['limit'];var _0x49e81e;if(_0x53152d>=_0x59bc45){_0x53152d=_0x59bc45;_0x49e81e=0xc8;}else{_0x49e81e=0xce;}_0x5969d8[_0x0f64('0x1b')](_0x49e81e);return _0x5969d8[_0x0f64('0x22')](_0x0f64('0x23'),_0x1caafc+'-'+_0x53152d+'/'+_0x59bc45)[_0x0f64('0x1d')](_0x388457);}return null;};}function patchUpdates(_0x1a64e5){return function(_0x3feb66){try{jsonpatch[_0x0f64('0x24')](_0x3feb66,_0x1a64e5,!![]);}catch(_0x202195){return BPromise['reject'](_0x202195);}return _0x3feb66[_0x0f64('0x25')]();};}function saveUpdates(_0x2b6546,_0x393c02){return function(_0x4b0ca4){if(_0x4b0ca4){return _0x4b0ca4[_0x0f64('0x26')](_0x2b6546)[_0x0f64('0x27')](function(_0xb68a6b){return _0xb68a6b;});}return null;};}function removeEntity(_0x52d67e,_0x1fccae){return function(_0x2d2dbb){if(_0x2d2dbb){return _0x2d2dbb[_0x0f64('0x28')]()[_0x0f64('0x27')](function(){_0x52d67e[_0x0f64('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d64d8,_0x5a5628){return function(_0x43d175){if(!_0x43d175){_0x3d64d8[_0x0f64('0x1a')](0x194);}return _0x43d175;};}function handleError(_0x3629a3,_0x3f008d){_0x3f008d=_0x3f008d||0x1f4;return function(_0x5aa3ba){logger[_0x0f64('0x29')](_0x5aa3ba[_0x0f64('0x2a')]);if(_0x5aa3ba[_0x0f64('0x2b')]){delete _0x5aa3ba['name'];}_0x3629a3[_0x0f64('0x1b')](_0x3f008d)[_0x0f64('0x2c')](_0x5aa3ba);};}exports[_0x0f64('0x2d')]=function(_0x5222de,_0x4d4f37){var _0x196e9f={},_0x211d35={},_0x1b2b55={'count':0x0,'rows':[]};var _0x379637=_[_0x0f64('0x2e')](db[_0x0f64('0x2f')][_0x0f64('0x30')],function(_0x1c6b51){return{'name':_0x1c6b51[_0x0f64('0x31')],'type':_0x1c6b51[_0x0f64('0x32')][_0x0f64('0x33')]};});_0x211d35[_0x0f64('0x34')]=_[_0x0f64('0x2e')](_0x379637,'name');_0x211d35[_0x0f64('0x35')]=_[_0x0f64('0x36')](_0x5222de[_0x0f64('0x35')]);_0x211d35['filters']=_[_0x0f64('0x37')](_0x211d35[_0x0f64('0x34')],_0x211d35['query']);_0x196e9f['attributes']=_['intersection'](_0x211d35[_0x0f64('0x34')],qs[_0x0f64('0x38')](_0x5222de['query']['fields']));_0x196e9f[_0x0f64('0x39')]=_0x196e9f[_0x0f64('0x39')][_0x0f64('0x3a')]?_0x196e9f[_0x0f64('0x39')]:_0x211d35[_0x0f64('0x34')];if(!_0x5222de[_0x0f64('0x35')][_0x0f64('0x3b')](_0x0f64('0x3c'))){_0x196e9f['limit']=qs[_0x0f64('0x1f')](_0x5222de[_0x0f64('0x35')][_0x0f64('0x1f')]);_0x196e9f[_0x0f64('0x1e')]=qs[_0x0f64('0x1e')](_0x5222de[_0x0f64('0x35')][_0x0f64('0x1e')]);}_0x196e9f['order']=qs[_0x0f64('0x3d')](_0x5222de['query']['sort']);_0x196e9f['where']=qs[_0x0f64('0x3e')](_[_0x0f64('0x3f')](_0x5222de[_0x0f64('0x35')],_0x211d35[_0x0f64('0x3e')]),_0x379637);if(_0x5222de[_0x0f64('0x35')]['filter']){_0x196e9f[_0x0f64('0x40')]=_['merge'](_0x196e9f['where'],{'$or':_[_0x0f64('0x2e')](_0x379637,function(_0x4aa66f){if(_0x4aa66f[_0x0f64('0x32')]!==_0x0f64('0x41')){var _0x41d9ed={};_0x41d9ed[_0x4aa66f['name']]={'$like':'%'+_0x5222de['query'][_0x0f64('0x42')]+'%'};return _0x41d9ed;}})});}_0x196e9f=_[_0x0f64('0x43')]({},_0x196e9f,_0x5222de[_0x0f64('0x44')]);var _0x4a0fe4={'where':_0x196e9f[_0x0f64('0x40')]};return db[_0x0f64('0x2f')][_0x0f64('0x21')](_0x4a0fe4)['then'](function(_0x10a05e){_0x1b2b55[_0x0f64('0x21')]=_0x10a05e;if(_0x5222de['query'][_0x0f64('0x45')]){_0x196e9f[_0x0f64('0x46')]=[{'all':!![]}];}return db[_0x0f64('0x2f')][_0x0f64('0x47')](_0x196e9f);})[_0x0f64('0x27')](function(_0x1c4153){_0x1b2b55[_0x0f64('0x48')]=_0x1c4153;return _0x1b2b55;})[_0x0f64('0x27')](respondWithFilteredResult(_0x4d4f37,_0x196e9f))['catch'](handleError(_0x4d4f37,null));};exports[_0x0f64('0x49')]=function(_0x27bbf8,_0xee4ddd){var _0x1fd4ad={'raw':![],'where':{'id':_0x27bbf8['params']['id']}},_0x39899d={};_0x39899d[_0x0f64('0x34')]=_[_0x0f64('0x36')](db[_0x0f64('0x2f')][_0x0f64('0x30')]);_0x39899d[_0x0f64('0x35')]=_[_0x0f64('0x36')](_0x27bbf8['query']);_0x39899d[_0x0f64('0x3e')]=_[_0x0f64('0x37')](_0x39899d[_0x0f64('0x34')],_0x39899d[_0x0f64('0x35')]);_0x1fd4ad[_0x0f64('0x39')]=_[_0x0f64('0x37')](_0x39899d[_0x0f64('0x34')],qs['fields'](_0x27bbf8[_0x0f64('0x35')][_0x0f64('0x38')]));_0x1fd4ad[_0x0f64('0x39')]=_0x1fd4ad['attributes'][_0x0f64('0x3a')]?_0x1fd4ad[_0x0f64('0x39')]:_0x39899d['model'];if(_0x27bbf8[_0x0f64('0x35')]['includeAll']){_0x1fd4ad[_0x0f64('0x46')]=[{'all':!![]}];}_0x1fd4ad=_[_0x0f64('0x43')]({},_0x1fd4ad,_0x27bbf8[_0x0f64('0x44')]);return db[_0x0f64('0x2f')][_0x0f64('0x4a')](_0x1fd4ad)[_0x0f64('0x27')](handleEntityNotFound(_0xee4ddd,null))[_0x0f64('0x27')](respondWithResult(_0xee4ddd,null))[_0x0f64('0x4b')](handleError(_0xee4ddd,null));};exports[_0x0f64('0x4c')]=function(_0x5584d6,_0x2a3bb4){return db[_0x0f64('0x2f')]['create'](_0x5584d6[_0x0f64('0x4d')],{})['then'](respondWithResult(_0x2a3bb4,0xc9))[_0x0f64('0x4b')](handleError(_0x2a3bb4,null));};exports[_0x0f64('0x26')]=function(_0x49bc2a,_0x138ffa){if(_0x49bc2a[_0x0f64('0x4d')]['id']){delete _0x49bc2a[_0x0f64('0x4d')]['id'];}return db[_0x0f64('0x2f')][_0x0f64('0x4a')]({'where':{'id':_0x49bc2a[_0x0f64('0x4e')]['id']}})[_0x0f64('0x27')](handleEntityNotFound(_0x138ffa,null))[_0x0f64('0x27')](saveUpdates(_0x49bc2a[_0x0f64('0x4d')],null))['then'](respondWithResult(_0x138ffa,null))[_0x0f64('0x4b')](handleError(_0x138ffa,null));};exports['destroy']=function(_0x112269,_0x1b5995){return db['ZohoAccount']['find']({'where':{'id':_0x112269['params']['id']}})[_0x0f64('0x27')](handleEntityNotFound(_0x1b5995,null))[_0x0f64('0x27')](removeEntity(_0x1b5995,null))[_0x0f64('0x4b')](handleError(_0x1b5995,null));};exports[_0x0f64('0x4f')]=function(_0xe9aa50,_0x4b0caa,_0x67d1b1){var _0x5491de={};var _0x71058a={};var _0x3379fc;var _0x596e7f;return db['ZohoAccount']['findOne']({'where':{'id':_0xe9aa50[_0x0f64('0x4e')]['id']}})[_0x0f64('0x27')](handleEntityNotFound(_0x4b0caa,null))['then'](function(_0x11fd7e){if(_0x11fd7e){_0x3379fc=_0x11fd7e;_0x71058a[_0x0f64('0x34')]=_['keys'](db['ZohoConfiguration'][_0x0f64('0x30')]);_0x71058a[_0x0f64('0x35')]=_[_0x0f64('0x36')](_0xe9aa50[_0x0f64('0x35')]);_0x71058a[_0x0f64('0x3e')]=_[_0x0f64('0x37')](_0x71058a[_0x0f64('0x34')],_0x71058a['query']);_0x5491de[_0x0f64('0x39')]=_[_0x0f64('0x37')](_0x71058a['model'],qs[_0x0f64('0x38')](_0xe9aa50[_0x0f64('0x35')][_0x0f64('0x38')]));_0x5491de[_0x0f64('0x39')]=_0x5491de['attributes'][_0x0f64('0x3a')]?_0x5491de['attributes']:_0x71058a[_0x0f64('0x34')];_0x5491de[_0x0f64('0x50')]=qs['sort'](_0xe9aa50[_0x0f64('0x35')][_0x0f64('0x3d')]);_0x5491de[_0x0f64('0x40')]=qs[_0x0f64('0x3e')](_[_0x0f64('0x3f')](_0xe9aa50[_0x0f64('0x35')],_0x71058a['filters']));if(_0xe9aa50[_0x0f64('0x35')][_0x0f64('0x42')]){_0x5491de[_0x0f64('0x40')]=_[_0x0f64('0x43')](_0x5491de[_0x0f64('0x40')],{'$or':_[_0x0f64('0x2e')](_0x5491de['attributes'],function(_0x49ef74){var _0x38c1={};_0x38c1[_0x49ef74]={'$like':'%'+_0xe9aa50[_0x0f64('0x35')][_0x0f64('0x42')]+'%'};return _0x38c1;})});}_0x5491de=_[_0x0f64('0x43')]({},_0x5491de,_0xe9aa50[_0x0f64('0x44')]);return _0x3379fc[_0x0f64('0x4f')](_0x5491de);}})[_0x0f64('0x27')](function(_0x1d63ce){if(_0x1d63ce){_0x596e7f=_0x1d63ce['length'];if(!_0xe9aa50['query'][_0x0f64('0x3b')](_0x0f64('0x3c'))){_0x5491de[_0x0f64('0x1f')]=qs[_0x0f64('0x1f')](_0xe9aa50['query'][_0x0f64('0x1f')]);_0x5491de['offset']=qs[_0x0f64('0x1e')](_0xe9aa50[_0x0f64('0x35')][_0x0f64('0x1e')]);}return _0x3379fc[_0x0f64('0x4f')](_0x5491de);}})[_0x0f64('0x27')](function(_0x4e344d){if(_0x4e344d){return _0x4e344d?{'count':_0x596e7f,'rows':_0x4e344d}:null;}})[_0x0f64('0x27')](respondWithResult(_0x4b0caa,null))['catch'](handleError(_0x4b0caa,null));};exports[_0x0f64('0x51')]=function(_0x1e29c0,_0x1434d2,_0x491b09){if(_0x1e29c0['body']['id']){delete _0x1e29c0[_0x0f64('0x4d')]['id'];}return db['ZohoAccount'][_0x0f64('0x52')]({'where':{'id':_0x1e29c0[_0x0f64('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1434d2,null))['then'](function(_0x112ecd){if(_0x112ecd){_0x1e29c0[_0x0f64('0x4d')][_0x0f64('0x53')]=_0x112ecd['id'];_0x1e29c0[_0x0f64('0x4d')][_0x0f64('0x54')]=integrations['getSubjects'](_0x1e29c0[_0x0f64('0x4d')][_0x0f64('0x55')],_0x1e29c0[_0x0f64('0x4d')]['type']);_0x1e29c0[_0x0f64('0x4d')][_0x0f64('0x56')]=integrations[_0x0f64('0x57')](_0x1e29c0[_0x0f64('0x4d')]['channel'],_0x1e29c0['body']['type']);return db[_0x0f64('0x58')][_0x0f64('0x4c')](_0x1e29c0[_0x0f64('0x4d')],{'include':[{'model':db['ZohoField'],'as':_0x0f64('0x54')},{'model':db[_0x0f64('0x59')],'as':_0x0f64('0x56')}]});}return null;})[_0x0f64('0x27')](respondWithResult(_0x1434d2,null))[_0x0f64('0x4b')](handleError(_0x1434d2,null));};function getAccessToken(_0x4cff16){return new Promise(function(_0x2794c9,_0x37f895){var _0x4ed874;switch(_0x4cff16[_0x0f64('0x5a')]){case'US':_0x4ed874=_0x0f64('0x5b');break;case'AU':_0x4ed874='https://accounts.zoho.com.au';break;case'EU':_0x4ed874=_0x0f64('0x5c');break;case'IN':_0x4ed874=_0x0f64('0x5d');break;case'CN':_0x4ed874=_0x0f64('0x5e');break;default:_0x4ed874=_0x0f64('0x5c');break;}var _0x1022c1={'method':'POST','uri':_0x4ed874+_0x0f64('0x5f'),'qs':{'refresh_token':_0x4cff16[_0x0f64('0x60')],'client_id':_0x4cff16[_0x0f64('0x61')],'client_secret':_0x4cff16[_0x0f64('0x62')],'grant_type':_0x0f64('0x63')},'json':!![]};return rp(_0x1022c1)['then'](function(_0x512b4c){if(_0x512b4c[_0x0f64('0x64')]){_0x2794c9(_0x512b4c[_0x0f64('0x64')]);}else{_0x37f895(_0x0f64('0x65'));}})['catch'](function(_0x558aad){_0x37f895(_0x558aad);});});}exports[_0x0f64('0x66')]=function(_0x94d3a5,_0x1251f0,_0x1c15ef){var _0x17945c,_0x495012,_0x45c720,_0xab394a,_0x3574a4;return db[_0x0f64('0x2f')]['findOne']({'where':{'id':_0x94d3a5['params']['id']},'attributes':['id',_0x0f64('0x67'),_0x0f64('0x5a'),_0x0f64('0x61'),_0x0f64('0x62'),_0x0f64('0x68'),'code','refreshToken']})[_0x0f64('0x27')](handleEntityNotFound(_0x1251f0,null))[_0x0f64('0x27')](function(_0x385ae9){_0x3574a4=_0x385ae9;_0x17945c=_0x3574a4[_0x0f64('0x67')];_0x495012=_0x17945c===_0x0f64('0x69')?'eu':_0x0f64('0x6a');_0x45c720=_0x3574a4['serverUrl'];var _0x35ccaa=_0x45c720[_0x0f64('0x6b')](-0x1);if(_0x35ccaa==='/'||_0x35ccaa==='\x5c'||_0x35ccaa===':'){_0x45c720=_0x45c720[_0x0f64('0x6c')](0x0,_0x45c720[_0x0f64('0x6d')](_0x35ccaa));}if(!_0x3574a4[_0x0f64('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3574a4);})['then'](function(_0x32f71c){if(_0x32f71c){return rp({'method':_0x0f64('0x6e'),'uri':util['format'](_0x0f64('0x6f'),_0x495012),'qs':{'module':_0x0f64('0x70')},'headers':{'Authorization':_0x0f64('0x71')+_0x32f71c},'json':!![]});}})[_0x0f64('0x27')](function(_0x427502){if(_0x427502){if(_0x427502[_0x0f64('0x72')]&&_0x427502[_0x0f64('0x72')][_0x0f64('0x29')]){throw new Error(_0x427502[_0x0f64('0x72')][_0x0f64('0x29')][_0x0f64('0x73')]);}var _0x397198=[];var _0x32c37d=[];var _0x36b759=[_0x0f64('0x74'),_0x0f64('0x75'),_0x0f64('0x76'),_0x0f64('0x77'),_0x0f64('0x78'),'Call_Result',_0x0f64('0x79'),_0x0f64('0x7a')];_0x32c37d=_['remove'](_0x427502[_0x0f64('0x38')],function(_0x271e73){return _0x36b759[_0x0f64('0x7b')](_0x271e73[_0x0f64('0x7c')]);});for(var _0x491757=0x0;_0x491757<_0x32c37d['length'];_0x491757++){if(_0x32c37d[_0x491757][_0x0f64('0x7d')]===![]){_0x397198[_0x0f64('0x7e')]({'id':_0x32c37d[_0x491757]['id'],'name':_0x32c37d[_0x491757][_0x0f64('0x7f')],'custom':_0x32c37d[_0x491757][_0x0f64('0x80')],'options':_0x32c37d[_0x491757][_0x0f64('0x81')]===_0x0f64('0x82')&&_0x32c37d[_0x491757][_0x0f64('0x83')][_0x0f64('0x3a')]>-0x1?_[_0x0f64('0x2e')](_0x32c37d[_0x491757][_0x0f64('0x83')],function(_0x2e94a2){return{'name':_0x2e94a2,'value':_0x2e94a2};}):[]});}}return{'count':_0x397198[_0x0f64('0x3a')],'rows':_0x397198};}else{return{'count':0x0,'rows':[]};}})[_0x0f64('0x27')](respondWithResult(_0x1251f0,null))[_0x0f64('0x4b')](function(_0x2b7e2e){var _0x1aa986=_0x94d3a5['query']['test']?0x1f4:_0x2b7e2e[_0x0f64('0x84')]||0x1f4;logger[_0x0f64('0x29')](_0x0f64('0x85'),_0x0f64('0x66'),_0x1aa986,JSON[_0x0f64('0x86')](_0x2b7e2e));delete _0x2b7e2e[_0x0f64('0x2b')];if(_0x1aa986===0x191){_0x1aa986=0x190;}_0x1251f0[_0x0f64('0x1b')](_0x1aa986)[_0x0f64('0x2c')](_0x94d3a5['query'][_0x0f64('0x87')]?{'message':'Wrong\x20credentials','statusCode':_0x2b7e2e[_0x0f64('0x84')]}:_0x2b7e2e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 010d241..560f75d 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 _0x1d14=['parse','refresh_token','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','slice','substring','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','lodash','util','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then'];(function(_0x5bf578,_0x52abff){var _0x2ac394=function(_0x27c2b6){while(--_0x27c2b6){_0x5bf578['push'](_0x5bf578['shift']());}};_0x2ac394(++_0x52abff);}(_0x1d14,0xda));var _0x41d1=function(_0x982a71,_0x2dcd0e){_0x982a71=_0x982a71-0x0;var _0x59a936=_0x1d14[_0x982a71];return _0x59a936;};'use strict';var _=require(_0x41d1('0x0'));var util=require(_0x41d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x41d1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41d1('0x3'));var rimraf=require(_0x41d1('0x4'));var config=require(_0x41d1('0x5'));var attributes=require(_0x41d1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x41d1('0x7')]=function(_0x1a64df,_0x25a086){return _0x1a64df[_0x41d1('0x8')](_0x41d1('0x9'),attributes,{'tableName':_0x41d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x200985,_0x5aced2,_0x539195){if(_0x200985[_0x41d1('0xb')](_0x41d1('0xc'))||_0x200985[_0x41d1('0xb')](_0x41d1('0xd'))||_0x200985[_0x41d1('0xb')](_0x41d1('0xe'))||_0x200985['changed'](_0x41d1('0xf'))||_0x200985['changed'](_0x41d1('0x10'))||_0x200985[_0x41d1('0xb')](_0x41d1('0x11'))){var _0xddca26,_0x5a9268;_0xddca26=_0x200985[_0x41d1('0xd')];var _0x380159=_0xddca26['slice'](-0x1);if(_0x380159==='/'||_0x380159==='\x5c'||_0x380159===':'){_0xddca26=_0xddca26['substring'](0x0,_0xddca26[_0x41d1('0x12')](_0x380159));}switch(_0x200985['zone']){case'US':_0x5a9268=_0x41d1('0x13');break;case'AU':_0x5a9268='https://accounts.zoho.com.au';break;case'IN':_0x5a9268=_0x41d1('0x14');break;case'CN':_0x5a9268=_0x41d1('0x15');break;default:_0x5a9268=_0x41d1('0x16');break;}var _0x40b82c={'method':_0x41d1('0x17'),'uri':_0x5a9268+_0x41d1('0x18'),'form':{'grant_type':_0x41d1('0x19'),'client_id':_0x200985[_0x41d1('0xe')],'client_secret':_0x200985['clientSecret'],'redirect_uri':_0x200985[_0x41d1('0xd')],'code':_0x200985[_0x41d1('0x10')]},'headers':{'Content-Type':_0x41d1('0x1a')}};return rp(_0x40b82c)[_0x41d1('0x1b')](function(_0x31d6ee){var _0x450358=JSON[_0x41d1('0x1c')](_0x31d6ee);if(_0x450358[_0x41d1('0x1d')]){_0x200985['refreshToken']=_0x450358[_0x41d1('0x1d')];logger['info'](util[_0x41d1('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x200985[_0x41d1('0x1f')],_0x200985['id']));}else{logger['error'](util[_0x41d1('0x1e')](_0x41d1('0x20'),_0x200985[_0x41d1('0x1f')],_0x200985['id']),util['inspect'](_0x450358,{'showHidden':![],'depth':null}));}return _0x539195(null,_0x5aced2);})[_0x41d1('0x21')](function(_0x39ceed){logger['error'](util[_0x41d1('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x200985[_0x41d1('0x1f')],_0x200985['id']),util[_0x41d1('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x539195(_0x39ceed);});}else{return _0x539195(null,_0x5aced2);}},'beforeUpdate':function(_0x5430bb,_0x5e8d23,_0x1d9431){if(_0x5430bb[_0x41d1('0xb')](_0x41d1('0xc'))||_0x5430bb[_0x41d1('0xb')](_0x41d1('0xd'))||_0x5430bb[_0x41d1('0xb')](_0x41d1('0xe'))||_0x5430bb[_0x41d1('0xb')](_0x41d1('0xf'))||_0x5430bb[_0x41d1('0xb')](_0x41d1('0x10'))||_0x5430bb[_0x41d1('0xb')](_0x41d1('0x11'))){var _0x33be8b,_0x635f1a;_0x33be8b=_0x5430bb[_0x41d1('0xd')];var _0x156c78=_0x33be8b[_0x41d1('0x23')](-0x1);if(_0x156c78==='/'||_0x156c78==='\x5c'||_0x156c78===':'){_0x33be8b=_0x33be8b[_0x41d1('0x24')](0x0,_0x33be8b['lastIndexOf'](_0x156c78));}switch(_0x5430bb[_0x41d1('0xc')]){case'US':_0x635f1a=_0x41d1('0x13');break;case'AU':_0x635f1a='https://accounts.zoho.com.au';break;case'IN':_0x635f1a=_0x41d1('0x14');break;case'CN':_0x635f1a=_0x41d1('0x15');break;default:_0x635f1a=_0x41d1('0x16');break;}var _0x526abc={'method':_0x41d1('0x17'),'uri':_0x635f1a+_0x41d1('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x5430bb[_0x41d1('0xe')],'client_secret':_0x5430bb['clientSecret'],'redirect_uri':_0x5430bb[_0x41d1('0xd')],'code':_0x5430bb[_0x41d1('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x526abc)[_0x41d1('0x1b')](function(_0x1ca2c0){var _0x3896ba=JSON['parse'](_0x1ca2c0);if(_0x3896ba[_0x41d1('0x1d')]){_0x5430bb[_0x41d1('0x25')]=_0x3896ba[_0x41d1('0x1d')];logger[_0x41d1('0x26')](util[_0x41d1('0x1e')](_0x41d1('0x27'),_0x5430bb['name'],_0x5430bb['id']));}else{logger['error'](util[_0x41d1('0x1e')](_0x41d1('0x20'),_0x5430bb[_0x41d1('0x1f')],_0x5430bb['id']),util['inspect'](_0x3896ba,{'showHidden':![],'depth':null}));}return _0x1d9431(null,_0x5e8d23);})[_0x41d1('0x21')](function(_0xa847be){logger[_0x41d1('0x28')](util[_0x41d1('0x1e')](_0x41d1('0x20'),_0x5430bb[_0x41d1('0x1f')],_0x5430bb['id']),util[_0x41d1('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d9431(_0xa847be);});}else{return _0x1d9431(null,_0x5e8d23);}}}});}; \ No newline at end of file +var _0xe66e=['code','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','then','parse','refresh_token','refreshToken','info','format','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','error','substring','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientSecret'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xe66e,0x107));var _0xee66=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xe66e[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0xee66('0x0'));var util=require(_0xee66('0x1'));var logger=require(_0xee66('0x2'))(_0xee66('0x3'));var moment=require('moment');var BPromise=require(_0xee66('0x4'));var rp=require(_0xee66('0x5'));var fs=require('fs');var path=require(_0xee66('0x6'));var rimraf=require(_0xee66('0x7'));var config=require(_0xee66('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xee66('0x9'));module[_0xee66('0xa')]=function(_0x14dd23,_0x19e602){return _0x14dd23[_0xee66('0xb')](_0xee66('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x565b51,_0x13240b,_0x9dfce){if(_0x565b51[_0xee66('0xd')](_0xee66('0xe'))||_0x565b51[_0xee66('0xd')](_0xee66('0xf'))||_0x565b51[_0xee66('0xd')]('clientId')||_0x565b51['changed'](_0xee66('0x10'))||_0x565b51['changed'](_0xee66('0x11'))||_0x565b51[_0xee66('0xd')]('host')){var _0x309ca0,_0x3a8613;_0x309ca0=_0x565b51['serverUrl'];var _0x694547=_0x309ca0[_0xee66('0x12')](-0x1);if(_0x694547==='/'||_0x694547==='\x5c'||_0x694547===':'){_0x309ca0=_0x309ca0['substring'](0x0,_0x309ca0['lastIndexOf'](_0x694547));}switch(_0x565b51[_0xee66('0xe')]){case'US':_0x3a8613=_0xee66('0x13');break;case'AU':_0x3a8613=_0xee66('0x14');break;case'IN':_0x3a8613='https://accounts.zoho.in';break;case'CN':_0x3a8613=_0xee66('0x15');break;default:_0x3a8613=_0xee66('0x16');break;}var _0x19b4ef={'method':_0xee66('0x17'),'uri':_0x3a8613+_0xee66('0x18'),'form':{'grant_type':_0xee66('0x19'),'client_id':_0x565b51[_0xee66('0x1a')],'client_secret':_0x565b51['clientSecret'],'redirect_uri':_0x565b51[_0xee66('0xf')],'code':_0x565b51[_0xee66('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x19b4ef)[_0xee66('0x1b')](function(_0x2dc767){var _0x119bff=JSON[_0xee66('0x1c')](_0x2dc767);if(_0x119bff[_0xee66('0x1d')]){_0x565b51[_0xee66('0x1e')]=_0x119bff[_0xee66('0x1d')];logger[_0xee66('0x1f')](util[_0xee66('0x20')](_0xee66('0x21'),_0x565b51[_0xee66('0x22')],_0x565b51['id']));}else{logger['error'](util['format'](_0xee66('0x23'),_0x565b51[_0xee66('0x22')],_0x565b51['id']),util[_0xee66('0x24')](_0x119bff,{'showHidden':![],'depth':null}));}return _0x9dfce(null,_0x13240b);})[_0xee66('0x25')](function(_0xb53498){logger[_0xee66('0x26')](util[_0xee66('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x565b51['name'],_0x565b51['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x9dfce(_0xb53498);});}else{return _0x9dfce(null,_0x13240b);}},'beforeUpdate':function(_0x1fed6e,_0x28532b,_0x3ca286){if(_0x1fed6e[_0xee66('0xd')](_0xee66('0xe'))||_0x1fed6e[_0xee66('0xd')](_0xee66('0xf'))||_0x1fed6e[_0xee66('0xd')]('clientId')||_0x1fed6e[_0xee66('0xd')](_0xee66('0x10'))||_0x1fed6e[_0xee66('0xd')](_0xee66('0x11'))||_0x1fed6e[_0xee66('0xd')]('host')){var _0x8cc8d0,_0x2c031b;_0x8cc8d0=_0x1fed6e[_0xee66('0xf')];var _0x561b24=_0x8cc8d0[_0xee66('0x12')](-0x1);if(_0x561b24==='/'||_0x561b24==='\x5c'||_0x561b24===':'){_0x8cc8d0=_0x8cc8d0[_0xee66('0x27')](0x0,_0x8cc8d0['lastIndexOf'](_0x561b24));}switch(_0x1fed6e['zone']){case'US':_0x2c031b='https://accounts.zoho.com';break;case'AU':_0x2c031b=_0xee66('0x14');break;case'IN':_0x2c031b='https://accounts.zoho.in';break;case'CN':_0x2c031b=_0xee66('0x15');break;default:_0x2c031b=_0xee66('0x16');break;}var _0x521020={'method':_0xee66('0x17'),'uri':_0x2c031b+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x1fed6e[_0xee66('0x1a')],'client_secret':_0x1fed6e[_0xee66('0x10')],'redirect_uri':_0x1fed6e[_0xee66('0xf')],'code':_0x1fed6e[_0xee66('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x521020)[_0xee66('0x1b')](function(_0x405564){var _0x509dbb=JSON[_0xee66('0x1c')](_0x405564);if(_0x509dbb[_0xee66('0x1d')]){_0x1fed6e[_0xee66('0x1e')]=_0x509dbb[_0xee66('0x1d')];logger[_0xee66('0x1f')](util[_0xee66('0x20')](_0xee66('0x21'),_0x1fed6e[_0xee66('0x22')],_0x1fed6e['id']));}else{logger[_0xee66('0x26')](util[_0xee66('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1fed6e[_0xee66('0x22')],_0x1fed6e['id']),util[_0xee66('0x24')](_0x509dbb,{'showHidden':![],'depth':null}));}return _0x3ca286(null,_0x28532b);})[_0xee66('0x25')](function(_0x50787e){logger['error'](util['format'](_0xee66('0x23'),_0x1fed6e[_0xee66('0x22')],_0x1fed6e['id']),util[_0xee66('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ca286(_0x50787e);});}else{return _0x3ca286(null,_0x28532b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 5dd3803..8080c5f 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 _0x34bd=['model','ShowZohoAccount','ZohoAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','options','raw','where','attributes','include','map'];(function(_0x2d4226,_0x34f0b3){var _0xeb2f8f=function(_0x4eed51){while(--_0x4eed51){_0x2d4226['push'](_0x2d4226['shift']());}};_0xeb2f8f(++_0x34f0b3);}(_0x34bd,0x1d2));var _0xd34b=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x34bd[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd34b('0x1'));var rs=require(_0xd34b('0x2'));var fs=require('fs');var Redis=require(_0xd34b('0x3'));var db=require(_0xd34b('0x4'))['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))(_0xd34b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd34b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3eb,_0x30d93b,_0x3654a5){return new BPromise(function(_0xf51a08,_0x25bce7){return client[_0xd34b('0x9')](_0x56e3eb,_0x3654a5)[_0xd34b('0xa')](function(_0x738328){logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,_0xd34b('0xd'));logger[_0xd34b('0xe')](_0xd34b('0xf'),_0x30d93b,'request\x20sent',JSON[_0xd34b('0x10')](_0x738328));if(_0x738328['error']){if(_0x738328[_0xd34b('0x11')][_0xd34b('0x12')]===0x1f4){logger[_0xd34b('0x11')](_0xd34b('0xc'),_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0x25bce7(_0x738328['error'][_0xd34b('0x13')]);}logger[_0xd34b('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0xf51a08(_0x738328[_0xd34b('0x11')]['message']);}else{logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,'request\x20sent');_0xf51a08(_0x738328[_0xd34b('0x14')]['message']);}})[_0xd34b('0x15')](function(_0x438b61){logger[_0xd34b('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x30d93b,_0x438b61);_0x25bce7(_0x438b61);});});}exports[_0xd34b('0x16')]=function(_0x193965){var _0x1bbbb1=this;return new Promise(function(_0x105f67,_0x206f16){return db['ZohoAccount']['findAll']({'raw':_0x193965[_0xd34b('0x17')]?_0x193965[_0xd34b('0x17')][_0xd34b('0x18')]===undefined?!![]:![]:!![],'where':_0x193965[_0xd34b('0x17')]?_0x193965[_0xd34b('0x17')][_0xd34b('0x19')]||null:null,'attributes':_0x193965['options']?_0x193965[_0xd34b('0x17')][_0xd34b('0x1a')]||null:null,'limit':_0x193965[_0xd34b('0x17')]?_0x193965[_0xd34b('0x17')]['limit']||null:null,'include':_0x193965[_0xd34b('0x17')]?_0x193965[_0xd34b('0x17')][_0xd34b('0x1b')]?_[_0xd34b('0x1c')](_0x193965[_0xd34b('0x17')][_0xd34b('0x1b')],function(_0x5afc42){return{'model':db[_0x5afc42[_0xd34b('0x1d')]],'as':_0x5afc42['as'],'attributes':_0x5afc42['attributes'],'include':_0x5afc42[_0xd34b('0x1b')]?_[_0xd34b('0x1c')](_0x5afc42['include'],function(_0x5f3325){return{'model':db[_0x5f3325['model']],'as':_0x5f3325['as'],'attributes':_0x5f3325[_0xd34b('0x1a')],'include':_0x5f3325[_0xd34b('0x1b')]?_[_0xd34b('0x1c')](_0x5f3325['include'],function(_0x34b192){return{'model':db[_0x34b192[_0xd34b('0x1d')]],'as':_0x34b192['as'],'attributes':_0x34b192['attributes']};}):[]};}):[]};}):[]:[]})[_0xd34b('0xa')](function(_0x38637f){logger[_0xd34b('0xb')]('GetZohoAccount',_0x193965);logger[_0xd34b('0xe')]('GetZohoAccount',_0x193965,JSON[_0xd34b('0x10')](_0x38637f));_0x105f67(_0x38637f);})[_0xd34b('0x15')](function(_0x28e20c){logger['error'](_0xd34b('0x16'),_0x28e20c['message'],_0x193965);_0x206f16(_0x1bbbb1[_0xd34b('0x11')](0x1f4,_0x28e20c['message']));});});};exports[_0xd34b('0x1e')]=function(_0x567b74){var _0x24ef6c=this;return new Promise(function(_0x3f3ff0,_0x49cdbe){return db[_0xd34b('0x1f')][_0xd34b('0x20')]({'raw':_0x567b74[_0xd34b('0x17')]?_0x567b74['options'][_0xd34b('0x18')]===undefined?!![]:![]:!![],'where':_0x567b74[_0xd34b('0x17')]?_0x567b74[_0xd34b('0x17')]['where']||null:null,'attributes':_0x567b74[_0xd34b('0x17')]?_0x567b74[_0xd34b('0x17')][_0xd34b('0x1a')]||null:null,'include':_0x567b74[_0xd34b('0x17')]?_0x567b74[_0xd34b('0x17')][_0xd34b('0x1b')]?_[_0xd34b('0x1c')](_0x567b74['options'][_0xd34b('0x1b')],function(_0x1b9a08){return{'model':db[_0x1b9a08[_0xd34b('0x1d')]],'as':_0x1b9a08['as'],'attributes':_0x1b9a08[_0xd34b('0x1a')],'include':_0x1b9a08[_0xd34b('0x1b')]?_['map'](_0x1b9a08[_0xd34b('0x1b')],function(_0x41ff08){return{'model':db[_0x41ff08[_0xd34b('0x1d')]],'as':_0x41ff08['as'],'attributes':_0x41ff08['attributes'],'include':_0x41ff08['include']?_[_0xd34b('0x1c')](_0x41ff08[_0xd34b('0x1b')],function(_0x1da2e7){return{'model':db[_0x1da2e7['model']],'as':_0x1da2e7['as'],'attributes':_0x1da2e7[_0xd34b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd34b('0xa')](function(_0x152aa8){logger[_0xd34b('0xb')]('ShowZohoAccount',_0x567b74);logger['debug'](_0xd34b('0x1e'),_0x567b74,JSON[_0xd34b('0x10')](_0x152aa8));_0x3f3ff0(_0x152aa8);})['catch'](function(_0x4a4da0){logger['error'](_0xd34b('0x1e'),_0x4a4da0[_0xd34b('0x13')],_0x567b74);_0x49cdbe(_0x24ef6c['error'](0x1f4,_0x4a4da0[_0xd34b('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ZohoAccount','lodash','util'];(function(_0x3122c6,_0x12efa7){var _0x3d5a92=function(_0x37a510){while(--_0x37a510){_0x3122c6['push'](_0x3122c6['shift']());}};_0x3d5a92(++_0x12efa7);}(_0xdb28,0x106));var _0x8db2=function(_0x38e260,_0x13393e){_0x38e260=_0x38e260-0x0;var _0x4c1cf1=_0xdb28[_0x38e260];return _0x4c1cf1;};'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')]('ZohoAccount,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['ZohoAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowZohoAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowZohoAccount',_0x302188);logger[_0x8db2('0xf')]('ShowZohoAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowZohoAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1f89c4c..e56cf48 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 _0x9a39=['getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id/fields'];(function(_0x88c5bc,_0x4dfdf5){var _0x72559=function(_0x293e9c){while(--_0x293e9c){_0x88c5bc['push'](_0x88c5bc['shift']());}};_0x72559(++_0x4dfdf5);}(_0x9a39,0x7b));var _0x99a3=function(_0x605903,_0x3a1925){_0x605903=_0x605903-0x0;var _0x48f2e3=_0x9a39[_0x605903];return _0x48f2e3;};'use strict';var multer=require('multer');var util=require(_0x99a3('0x0'));var path=require(_0x99a3('0x1'));var timeout=require(_0x99a3('0x2'));var express=require(_0x99a3('0x3'));var router=express[_0x99a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x99a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99a3('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x99a3('0x7')]('/',auth[_0x99a3('0x8')](),controller['index']);router[_0x99a3('0x7')]('/:id',auth[_0x99a3('0x8')](),controller['show']);router['get'](_0x99a3('0x9'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xa')]);router[_0x99a3('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x99a3('0xb')]);router[_0x99a3('0x7')](_0x99a3('0xc'),auth[_0x99a3('0x8')](),controller[_0x99a3('0xd')]);router[_0x99a3('0xe')]('/',auth['isAuthenticated'](),controller[_0x99a3('0xf')]);router['put']('/:id',auth[_0x99a3('0x8')](),controller['update']);router[_0x99a3('0x10')](_0x99a3('0x11'),auth[_0x99a3('0x8')](),controller[_0x99a3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6380=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x1f16de,_0x548eb9){var _0x36cd80=function(_0x4e1a45){while(--_0x4e1a45){_0x1f16de['push'](_0x1f16de['shift']());}};_0x36cd80(++_0x548eb9);}(_0x6380,0x10d));var _0x0638=function(_0x1ab35c,_0x3d3d1d){_0x1ab35c=_0x1ab35c-0x0;var _0x292240=_0x6380[_0x1ab35c];return _0x292240;};'use strict';var multer=require(_0x0638('0x0'));var util=require(_0x0638('0x1'));var path=require('path');var timeout=require(_0x0638('0x2'));var express=require(_0x0638('0x3'));var router=express[_0x0638('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0638('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0638('0x6'));var controller=require(_0x0638('0x7'));router[_0x0638('0x8')]('/',auth[_0x0638('0x9')](),controller['index']);router['get'](_0x0638('0xa'),auth[_0x0638('0x9')](),controller[_0x0638('0xb')]);router[_0x0638('0x8')](_0x0638('0xc'),auth['isAuthenticated'](),controller[_0x0638('0xd')]);router[_0x0638('0x8')](_0x0638('0xe'),auth[_0x0638('0x9')](),controller[_0x0638('0xf')]);router[_0x0638('0x8')](_0x0638('0x10'),auth[_0x0638('0x9')](),controller[_0x0638('0x11')]);router[_0x0638('0x12')]('/',auth[_0x0638('0x9')](),controller[_0x0638('0x13')]);router[_0x0638('0x14')](_0x0638('0xa'),auth[_0x0638('0x9')](),controller[_0x0638('0x15')]);router[_0x0638('0x16')]('/:id',auth[_0x0638('0x9')](),controller[_0x0638('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 87038d0..d4d42fb 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 _0x6170=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0x249154,_0x242056){var _0x26458e=function(_0x54838f){while(--_0x54838f){_0x249154['push'](_0x249154['shift']());}};_0x26458e(++_0x242056);}(_0x6170,0x18f));var _0x0617=function(_0x2a9c32,_0x5db168){_0x2a9c32=_0x2a9c32-0x0;var _0x2aaaa3=_0x6170[_0x2a9c32];return _0x2aaaa3;};'use strict';var Sequelize=require(_0x0617('0x0'));module[_0x0617('0x1')]={'name':{'type':Sequelize[_0x0617('0x2')]},'moduleCreate':{'type':Sequelize[_0x0617('0x3')](_0x0617('0x4'),_0x0617('0x5'),_0x0617('0x6')),'defaultValue':_0x0617('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x0617('0x7'),_0x0617('0x5'),_0x0617('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x0617('0x2')]}}; \ No newline at end of file +var _0xd671=['exports','STRING','contact','lead','ENUM','contact_lead','sequelize'];(function(_0x53bf6d,_0x4fb349){var _0x341fc2=function(_0x5dc3f3){while(--_0x5dc3f3){_0x53bf6d['push'](_0x53bf6d['shift']());}};_0x341fc2(++_0x4fb349);}(_0xd671,0x172));var _0x1d67=function(_0x149055,_0x42bd96){_0x149055=_0x149055-0x0;var _0x2862bf=_0xd671[_0x149055];return _0x2862bf;};'use strict';var Sequelize=require(_0x1d67('0x0'));module[_0x1d67('0x1')]={'name':{'type':Sequelize[_0x1d67('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x1d67('0x3'),'nothing'),'defaultValue':_0x1d67('0x4')},'moduleSearch':{'type':Sequelize[_0x1d67('0x5')](_0x1d67('0x6'),'contact',_0x1d67('0x4')),'defaultValue':_0x1d67('0x6')},'description':{'type':Sequelize[_0x1d67('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1b6ab67..53060d5 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 _0x7c84=['index','ZohoConfiguration','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','update','body','destroy','getFields','findOne','ZohoField','getSubjects','getDescriptions','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','then','name','send'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x7c84,0x155));var _0x47c8=function(_0x2e5c94,_0x21d47e){_0x2e5c94=_0x2e5c94-0x0;var _0x4baec4=_0x7c84[_0x2e5c94];return _0x4baec4;};'use strict';var emlformat=require(_0x47c8('0x0'));var rimraf=require(_0x47c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47c8('0x2'));var rp=require(_0x47c8('0x3'));var moment=require(_0x47c8('0x4'));var BPromise=require(_0x47c8('0x5'));var Mustache=require(_0x47c8('0x6'));var util=require('util');var path=require(_0x47c8('0x7'));var sox=require(_0x47c8('0x8'));var csv=require(_0x47c8('0x9'));var ejs=require(_0x47c8('0xa'));var fs=require('fs');var fs_extra=require(_0x47c8('0xb'));var _=require('lodash');var squel=require(_0x47c8('0xc'));var crypto=require(_0x47c8('0xd'));var jsforce=require(_0x47c8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x47c8('0x9'));var querystring=require(_0x47c8('0xf'));var Papa=require('papaparse');var Redis=require(_0x47c8('0x10'));var authService=require(_0x47c8('0x11'));var qs=require(_0x47c8('0x12'));var as=require(_0x47c8('0x13'));var hardwareService=require(_0x47c8('0x14'));var logger=require(_0x47c8('0x15'))(_0x47c8('0x16'));var utils=require('../../config/utils');var config=require(_0x47c8('0x17'));var licenseUtil=require(_0x47c8('0x18'));var db=require(_0x47c8('0x19'))['db'];function respondWithStatusCode(_0x506bca,_0x1ee5e8){_0x1ee5e8=_0x1ee5e8||0xcc;return function(_0x3e54c3){if(_0x3e54c3){return _0x506bca[_0x47c8('0x1a')](_0x1ee5e8);}return _0x506bca[_0x47c8('0x1b')](_0x1ee5e8)[_0x47c8('0x1c')]();};}function respondWithResult(_0x1651f7,_0x4edee4){_0x4edee4=_0x4edee4||0xc8;return function(_0x1af8b9){if(_0x1af8b9){return _0x1651f7[_0x47c8('0x1b')](_0x4edee4)[_0x47c8('0x1d')](_0x1af8b9);}};}function respondWithFilteredResult(_0x5688fe,_0x288584){return function(_0xaaa071){if(_0xaaa071){var _0x3ce63d=typeof _0x288584[_0x47c8('0x1e')]===_0x47c8('0x1f')&&typeof _0x288584['limit']===_0x47c8('0x1f');var _0x2c7211=_0xaaa071[_0x47c8('0x20')];var _0x550f7a=_0x3ce63d?0x0:_0x288584[_0x47c8('0x1e')];var _0x2efec9=_0x3ce63d?_0xaaa071['count']:_0x288584[_0x47c8('0x1e')]+_0x288584[_0x47c8('0x21')];var _0x485496;if(_0x2efec9>=_0x2c7211){_0x2efec9=_0x2c7211;_0x485496=0xc8;}else{_0x485496=0xce;}_0x5688fe['status'](_0x485496);return _0x5688fe[_0x47c8('0x22')]('Content-Range',_0x550f7a+'-'+_0x2efec9+'/'+_0x2c7211)['json'](_0xaaa071);}return null;};}function patchUpdates(_0xea8795){return function(_0x15bda4){try{jsonpatch[_0x47c8('0x23')](_0x15bda4,_0xea8795,!![]);}catch(_0x128368){return BPromise['reject'](_0x128368);}return _0x15bda4['save']();};}function saveUpdates(_0x4885b7,_0x908d48){return function(_0x5af6f1){if(_0x5af6f1){return _0x5af6f1['update'](_0x4885b7)[_0x47c8('0x24')](function(_0x43e016){return _0x43e016;});}return null;};}function removeEntity(_0x445937,_0x17a21d){return function(_0x1dc9d6){if(_0x1dc9d6){return _0x1dc9d6['destroy']()[_0x47c8('0x24')](function(){_0x445937[_0x47c8('0x1b')](0xcc)[_0x47c8('0x1c')]();});}};}function handleEntityNotFound(_0x5d7d05,_0x54da9c){return function(_0x1a7a8d){if(!_0x1a7a8d){_0x5d7d05[_0x47c8('0x1a')](0x194);}return _0x1a7a8d;};}function handleError(_0x4ad017,_0x17b8a2){_0x17b8a2=_0x17b8a2||0x1f4;return function(_0x401242){logger['error'](_0x401242['stack']);if(_0x401242[_0x47c8('0x25')]){delete _0x401242[_0x47c8('0x25')];}_0x4ad017[_0x47c8('0x1b')](_0x17b8a2)[_0x47c8('0x26')](_0x401242);};}exports[_0x47c8('0x27')]=function(_0xf372ca,_0x599285){var _0x1193b5={},_0x3e7382={},_0x460f6e={'count':0x0,'rows':[]};var _0xf1a92c=_['map'](db[_0x47c8('0x28')]['rawAttributes'],function(_0x331e57){return{'name':_0x331e57['fieldName'],'type':_0x331e57[_0x47c8('0x29')]['key']};});_0x3e7382[_0x47c8('0x2a')]=_[_0x47c8('0x2b')](_0xf1a92c,_0x47c8('0x25'));_0x3e7382[_0x47c8('0x2c')]=_[_0x47c8('0x2d')](_0xf372ca[_0x47c8('0x2c')]);_0x3e7382[_0x47c8('0x2e')]=_[_0x47c8('0x2f')](_0x3e7382[_0x47c8('0x2a')],_0x3e7382[_0x47c8('0x2c')]);_0x1193b5[_0x47c8('0x30')]=_['intersection'](_0x3e7382[_0x47c8('0x2a')],qs[_0x47c8('0x31')](_0xf372ca['query'][_0x47c8('0x31')]));_0x1193b5[_0x47c8('0x30')]=_0x1193b5[_0x47c8('0x30')][_0x47c8('0x32')]?_0x1193b5[_0x47c8('0x30')]:_0x3e7382[_0x47c8('0x2a')];if(!_0xf372ca[_0x47c8('0x2c')][_0x47c8('0x33')](_0x47c8('0x34'))){_0x1193b5[_0x47c8('0x21')]=qs[_0x47c8('0x21')](_0xf372ca[_0x47c8('0x2c')][_0x47c8('0x21')]);_0x1193b5[_0x47c8('0x1e')]=qs[_0x47c8('0x1e')](_0xf372ca[_0x47c8('0x2c')][_0x47c8('0x1e')]);}_0x1193b5['order']=qs['sort'](_0xf372ca['query'][_0x47c8('0x35')]);_0x1193b5[_0x47c8('0x36')]=qs[_0x47c8('0x2e')](_[_0x47c8('0x37')](_0xf372ca[_0x47c8('0x2c')],_0x3e7382[_0x47c8('0x2e')]),_0xf1a92c);if(_0xf372ca['query'][_0x47c8('0x38')]){_0x1193b5['where']=_[_0x47c8('0x39')](_0x1193b5[_0x47c8('0x36')],{'$or':_['map'](_0xf1a92c,function(_0x3dd6a7){if(_0x3dd6a7[_0x47c8('0x29')]!=='VIRTUAL'){var _0x4ad0b9={};_0x4ad0b9[_0x3dd6a7[_0x47c8('0x25')]]={'$like':'%'+_0xf372ca[_0x47c8('0x2c')][_0x47c8('0x38')]+'%'};return _0x4ad0b9;}})});}_0x1193b5=_[_0x47c8('0x39')]({},_0x1193b5,_0xf372ca[_0x47c8('0x3a')]);var _0x3bc1ba={'where':_0x1193b5['where']};return db['ZohoConfiguration'][_0x47c8('0x20')](_0x3bc1ba)[_0x47c8('0x24')](function(_0x4aca3a){_0x460f6e[_0x47c8('0x20')]=_0x4aca3a;if(_0xf372ca[_0x47c8('0x2c')][_0x47c8('0x3b')]){_0x1193b5[_0x47c8('0x3c')]=[{'all':!![]}];}return db[_0x47c8('0x28')]['findAll'](_0x1193b5);})[_0x47c8('0x24')](function(_0x7ec8d6){_0x460f6e[_0x47c8('0x3d')]=_0x7ec8d6;return _0x460f6e;})[_0x47c8('0x24')](respondWithFilteredResult(_0x599285,_0x1193b5))[_0x47c8('0x3e')](handleError(_0x599285,null));};exports[_0x47c8('0x3f')]=function(_0x577158,_0x13371e){var _0x1325c4={'raw':![],'where':{'id':_0x577158[_0x47c8('0x40')]['id']}},_0x4eaaac={};_0x4eaaac['model']=_[_0x47c8('0x2d')](db[_0x47c8('0x28')][_0x47c8('0x41')]);_0x4eaaac[_0x47c8('0x2c')]=_[_0x47c8('0x2d')](_0x577158[_0x47c8('0x2c')]);_0x4eaaac[_0x47c8('0x2e')]=_[_0x47c8('0x2f')](_0x4eaaac['model'],_0x4eaaac[_0x47c8('0x2c')]);_0x1325c4[_0x47c8('0x30')]=_['intersection'](_0x4eaaac[_0x47c8('0x2a')],qs[_0x47c8('0x31')](_0x577158['query'][_0x47c8('0x31')]));_0x1325c4['attributes']=_0x1325c4['attributes']['length']?_0x1325c4['attributes']:_0x4eaaac[_0x47c8('0x2a')];if(_0x577158[_0x47c8('0x2c')][_0x47c8('0x3b')]){_0x1325c4[_0x47c8('0x3c')]=[{'all':!![]}];}_0x1325c4=_[_0x47c8('0x39')]({},_0x1325c4,_0x577158['options']);return db[_0x47c8('0x28')][_0x47c8('0x42')](_0x1325c4)[_0x47c8('0x24')](handleEntityNotFound(_0x13371e,null))[_0x47c8('0x24')](respondWithResult(_0x13371e,null))[_0x47c8('0x3e')](handleError(_0x13371e,null));};exports['create']=function(_0x56ad22,_0x1dc0e7){return db[_0x47c8('0x28')]['create'](_0x56ad22['body'],{})[_0x47c8('0x24')](respondWithResult(_0x1dc0e7,0xc9))[_0x47c8('0x3e')](handleError(_0x1dc0e7,null));};exports[_0x47c8('0x43')]=function(_0x2d15a8,_0x3c89c6){if(_0x2d15a8['body']['id']){delete _0x2d15a8[_0x47c8('0x44')]['id'];}return db[_0x47c8('0x28')][_0x47c8('0x42')]({'where':{'id':_0x2d15a8['params']['id']}})[_0x47c8('0x24')](handleEntityNotFound(_0x3c89c6,null))[_0x47c8('0x24')](saveUpdates(_0x2d15a8[_0x47c8('0x44')],null))[_0x47c8('0x24')](respondWithResult(_0x3c89c6,null))[_0x47c8('0x3e')](handleError(_0x3c89c6,null));};exports[_0x47c8('0x45')]=function(_0x4302c1,_0x2b51f7){return db[_0x47c8('0x28')]['find']({'where':{'id':_0x4302c1['params']['id']}})[_0x47c8('0x24')](handleEntityNotFound(_0x2b51f7,null))['then'](removeEntity(_0x2b51f7,null))[_0x47c8('0x3e')](handleError(_0x2b51f7,null));};exports[_0x47c8('0x46')]=function(_0x23d514,_0x2fc745,_0x5c24fc){var _0x425a4e={};var _0x467179={};var _0x5e0e39;var _0x4ec1e6;return db[_0x47c8('0x28')][_0x47c8('0x47')]({'where':{'id':_0x23d514['params']['id']}})['then'](handleEntityNotFound(_0x2fc745,null))['then'](function(_0x4516b5){if(_0x4516b5){_0x5e0e39=_0x4516b5;_0x467179[_0x47c8('0x2a')]=_['keys'](db[_0x47c8('0x48')][_0x47c8('0x41')]);_0x467179[_0x47c8('0x2c')]=_[_0x47c8('0x2d')](_0x23d514[_0x47c8('0x2c')]);_0x467179[_0x47c8('0x2e')]=_[_0x47c8('0x2f')](_0x467179[_0x47c8('0x2a')],_0x467179[_0x47c8('0x2c')]);_0x425a4e[_0x47c8('0x30')]=_['intersection'](_0x467179['model'],qs[_0x47c8('0x31')](_0x23d514['query']['fields']));_0x425a4e[_0x47c8('0x30')]=_0x425a4e[_0x47c8('0x30')][_0x47c8('0x32')]?_0x425a4e[_0x47c8('0x30')]:_0x467179[_0x47c8('0x2a')];_0x425a4e['order']=qs[_0x47c8('0x35')](_0x23d514[_0x47c8('0x2c')][_0x47c8('0x35')]);_0x425a4e[_0x47c8('0x36')]=qs[_0x47c8('0x2e')](_[_0x47c8('0x37')](_0x23d514['query'],_0x467179[_0x47c8('0x2e')]));if(_0x23d514[_0x47c8('0x2c')][_0x47c8('0x38')]){_0x425a4e[_0x47c8('0x36')]=_[_0x47c8('0x39')](_0x425a4e[_0x47c8('0x36')],{'$or':_[_0x47c8('0x2b')](_0x425a4e['attributes'],function(_0x1eafad){var _0x471ec9={};_0x471ec9[_0x1eafad]={'$like':'%'+_0x23d514[_0x47c8('0x2c')][_0x47c8('0x38')]+'%'};return _0x471ec9;})});}_0x425a4e=_[_0x47c8('0x39')]({},_0x425a4e,_0x23d514['options']);return _0x5e0e39[_0x47c8('0x46')](_0x425a4e);}})[_0x47c8('0x24')](function(_0xe8df45){if(_0xe8df45){_0x4ec1e6=_0xe8df45[_0x47c8('0x32')];if(!_0x23d514[_0x47c8('0x2c')][_0x47c8('0x33')](_0x47c8('0x34'))){_0x425a4e[_0x47c8('0x21')]=qs['limit'](_0x23d514[_0x47c8('0x2c')][_0x47c8('0x21')]);_0x425a4e[_0x47c8('0x1e')]=qs['offset'](_0x23d514[_0x47c8('0x2c')][_0x47c8('0x1e')]);}return _0x5e0e39[_0x47c8('0x46')](_0x425a4e);}})[_0x47c8('0x24')](function(_0x541901){if(_0x541901){return _0x541901?{'count':_0x4ec1e6,'rows':_0x541901}:null;}})[_0x47c8('0x24')](respondWithResult(_0x2fc745,null))['catch'](handleError(_0x2fc745,null));};exports[_0x47c8('0x49')]=function(_0x3d88e9,_0x37f4ae,_0xa81a48){var _0x4bd4c7={};var _0x3093da={};var _0x20d89e;var _0x19cac8;return db[_0x47c8('0x28')][_0x47c8('0x47')]({'where':{'id':_0x3d88e9[_0x47c8('0x40')]['id']}})[_0x47c8('0x24')](handleEntityNotFound(_0x37f4ae,null))[_0x47c8('0x24')](function(_0x4d9623){if(_0x4d9623){_0x20d89e=_0x4d9623;_0x3093da[_0x47c8('0x2a')]=_[_0x47c8('0x2d')](db[_0x47c8('0x48')][_0x47c8('0x41')]);_0x3093da[_0x47c8('0x2c')]=_[_0x47c8('0x2d')](_0x3d88e9['query']);_0x3093da[_0x47c8('0x2e')]=_[_0x47c8('0x2f')](_0x3093da['model'],_0x3093da[_0x47c8('0x2c')]);_0x4bd4c7[_0x47c8('0x30')]=_['intersection'](_0x3093da[_0x47c8('0x2a')],qs[_0x47c8('0x31')](_0x3d88e9[_0x47c8('0x2c')][_0x47c8('0x31')]));_0x4bd4c7[_0x47c8('0x30')]=_0x4bd4c7['attributes']['length']?_0x4bd4c7[_0x47c8('0x30')]:_0x3093da[_0x47c8('0x2a')];_0x4bd4c7['order']=qs[_0x47c8('0x35')](_0x3d88e9['query'][_0x47c8('0x35')]);_0x4bd4c7[_0x47c8('0x36')]=qs['filters'](_[_0x47c8('0x37')](_0x3d88e9[_0x47c8('0x2c')],_0x3093da[_0x47c8('0x2e')]));if(_0x3d88e9['query'][_0x47c8('0x38')]){_0x4bd4c7[_0x47c8('0x36')]=_[_0x47c8('0x39')](_0x4bd4c7[_0x47c8('0x36')],{'$or':_[_0x47c8('0x2b')](_0x4bd4c7['attributes'],function(_0x58fce2){var _0x511ad9={};_0x511ad9[_0x58fce2]={'$like':'%'+_0x3d88e9[_0x47c8('0x2c')][_0x47c8('0x38')]+'%'};return _0x511ad9;})});}_0x4bd4c7=_[_0x47c8('0x39')]({},_0x4bd4c7,_0x3d88e9[_0x47c8('0x3a')]);return _0x20d89e[_0x47c8('0x49')](_0x4bd4c7);}})[_0x47c8('0x24')](function(_0x27e83b){if(_0x27e83b){_0x19cac8=_0x27e83b[_0x47c8('0x32')];if(!_0x3d88e9[_0x47c8('0x2c')][_0x47c8('0x33')](_0x47c8('0x34'))){_0x4bd4c7['limit']=qs['limit'](_0x3d88e9[_0x47c8('0x2c')]['limit']);_0x4bd4c7[_0x47c8('0x1e')]=qs[_0x47c8('0x1e')](_0x3d88e9[_0x47c8('0x2c')][_0x47c8('0x1e')]);}return _0x20d89e['getSubjects'](_0x4bd4c7);}})[_0x47c8('0x24')](function(_0xb260c0){if(_0xb260c0){return _0xb260c0?{'count':_0x19cac8,'rows':_0xb260c0}:null;}})[_0x47c8('0x24')](respondWithResult(_0x37f4ae,null))[_0x47c8('0x3e')](handleError(_0x37f4ae,null));};exports[_0x47c8('0x4a')]=function(_0xa7fce1,_0x590646,_0x1b64f5){var _0x23da0f={};var _0x2f033e={};var _0x20bbad;var _0x13d94a;return db[_0x47c8('0x28')][_0x47c8('0x47')]({'where':{'id':_0xa7fce1[_0x47c8('0x40')]['id']}})[_0x47c8('0x24')](handleEntityNotFound(_0x590646,null))[_0x47c8('0x24')](function(_0xf0bb27){if(_0xf0bb27){_0x20bbad=_0xf0bb27;_0x2f033e[_0x47c8('0x2a')]=_['keys'](db[_0x47c8('0x48')]['rawAttributes']);_0x2f033e[_0x47c8('0x2c')]=_[_0x47c8('0x2d')](_0xa7fce1[_0x47c8('0x2c')]);_0x2f033e[_0x47c8('0x2e')]=_['intersection'](_0x2f033e['model'],_0x2f033e[_0x47c8('0x2c')]);_0x23da0f[_0x47c8('0x30')]=_[_0x47c8('0x2f')](_0x2f033e[_0x47c8('0x2a')],qs['fields'](_0xa7fce1[_0x47c8('0x2c')][_0x47c8('0x31')]));_0x23da0f['attributes']=_0x23da0f['attributes']['length']?_0x23da0f[_0x47c8('0x30')]:_0x2f033e[_0x47c8('0x2a')];_0x23da0f[_0x47c8('0x4b')]=qs[_0x47c8('0x35')](_0xa7fce1[_0x47c8('0x2c')][_0x47c8('0x35')]);_0x23da0f['where']=qs[_0x47c8('0x2e')](_[_0x47c8('0x37')](_0xa7fce1[_0x47c8('0x2c')],_0x2f033e[_0x47c8('0x2e')]));if(_0xa7fce1['query'][_0x47c8('0x38')]){_0x23da0f[_0x47c8('0x36')]=_['merge'](_0x23da0f[_0x47c8('0x36')],{'$or':_[_0x47c8('0x2b')](_0x23da0f[_0x47c8('0x30')],function(_0x23024c){var _0x13330f={};_0x13330f[_0x23024c]={'$like':'%'+_0xa7fce1[_0x47c8('0x2c')][_0x47c8('0x38')]+'%'};return _0x13330f;})});}_0x23da0f=_[_0x47c8('0x39')]({},_0x23da0f,_0xa7fce1[_0x47c8('0x3a')]);return _0x20bbad['getDescriptions'](_0x23da0f);}})[_0x47c8('0x24')](function(_0x19c4fa){if(_0x19c4fa){_0x13d94a=_0x19c4fa[_0x47c8('0x32')];if(!_0xa7fce1['query']['hasOwnProperty'](_0x47c8('0x34'))){_0x23da0f[_0x47c8('0x21')]=qs[_0x47c8('0x21')](_0xa7fce1[_0x47c8('0x2c')][_0x47c8('0x21')]);_0x23da0f[_0x47c8('0x1e')]=qs[_0x47c8('0x1e')](_0xa7fce1[_0x47c8('0x2c')][_0x47c8('0x1e')]);}return _0x20bbad[_0x47c8('0x4a')](_0x23da0f);}})[_0x47c8('0x24')](function(_0x2723ec){if(_0x2723ec){return _0x2723ec?{'count':_0x13d94a,'rows':_0x2723ec}:null;}})[_0x47c8('0x24')](respondWithResult(_0x590646,null))[_0x47c8('0x3e')](handleError(_0x590646,null));}; \ No newline at end of file +var _0x849c=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','intersection','length','include','find','create','body','getFields','ZohoField','order','pick','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x5f12b5,_0x319ed2){var _0xdfb543=function(_0x497b75){while(--_0x497b75){_0x5f12b5['push'](_0x5f12b5['shift']());}};_0xdfb543(++_0x319ed2);}(_0x849c,0x1e5));var _0xc849=function(_0x142063,_0x4da73a){_0x142063=_0x142063-0x0;var _0x3e072e=_0x849c[_0x142063];return _0x3e072e;};'use strict';var emlformat=require(_0xc849('0x0'));var rimraf=require(_0xc849('0x1'));var zipdir=require(_0xc849('0x2'));var jsonpatch=require(_0xc849('0x3'));var rp=require(_0xc849('0x4'));var moment=require(_0xc849('0x5'));var BPromise=require(_0xc849('0x6'));var Mustache=require(_0xc849('0x7'));var util=require(_0xc849('0x8'));var path=require('path');var sox=require(_0xc849('0x9'));var csv=require(_0xc849('0xa'));var ejs=require(_0xc849('0xb'));var fs=require('fs');var fs_extra=require(_0xc849('0xc'));var _=require(_0xc849('0xd'));var squel=require(_0xc849('0xe'));var crypto=require(_0xc849('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc849('0x10'));var Papa=require(_0xc849('0x11'));var Redis=require(_0xc849('0x12'));var authService=require(_0xc849('0x13'));var qs=require(_0xc849('0x14'));var as=require(_0xc849('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc849('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc849('0x17'));var db=require(_0xc849('0x18'))['db'];function respondWithStatusCode(_0x4c54c0,_0x151ba4){_0x151ba4=_0x151ba4||0xcc;return function(_0xb51218){if(_0xb51218){return _0x4c54c0[_0xc849('0x19')](_0x151ba4);}return _0x4c54c0[_0xc849('0x1a')](_0x151ba4)[_0xc849('0x1b')]();};}function respondWithResult(_0x214529,_0x547553){_0x547553=_0x547553||0xc8;return function(_0x21c946){if(_0x21c946){return _0x214529[_0xc849('0x1a')](_0x547553)[_0xc849('0x1c')](_0x21c946);}};}function respondWithFilteredResult(_0x1b1c47,_0x67ed52){return function(_0x596a02){if(_0x596a02){var _0x1666c6=typeof _0x67ed52[_0xc849('0x1d')]===_0xc849('0x1e')&&typeof _0x67ed52[_0xc849('0x1f')]===_0xc849('0x1e');var _0x6ed2c2=_0x596a02[_0xc849('0x20')];var _0x1148e0=_0x1666c6?0x0:_0x67ed52[_0xc849('0x1d')];var _0x315e2c=_0x1666c6?_0x596a02['count']:_0x67ed52[_0xc849('0x1d')]+_0x67ed52[_0xc849('0x1f')];var _0x5972c9;if(_0x315e2c>=_0x6ed2c2){_0x315e2c=_0x6ed2c2;_0x5972c9=0xc8;}else{_0x5972c9=0xce;}_0x1b1c47[_0xc849('0x1a')](_0x5972c9);return _0x1b1c47[_0xc849('0x21')](_0xc849('0x22'),_0x1148e0+'-'+_0x315e2c+'/'+_0x6ed2c2)[_0xc849('0x1c')](_0x596a02);}return null;};}function patchUpdates(_0x38402a){return function(_0x516b3f){try{jsonpatch['apply'](_0x516b3f,_0x38402a,!![]);}catch(_0x2b1572){return BPromise[_0xc849('0x23')](_0x2b1572);}return _0x516b3f[_0xc849('0x24')]();};}function saveUpdates(_0x7d4a3a,_0x1897aa){return function(_0x248484){if(_0x248484){return _0x248484[_0xc849('0x25')](_0x7d4a3a)[_0xc849('0x26')](function(_0x543027){return _0x543027;});}return null;};}function removeEntity(_0x1176df,_0x50575b){return function(_0xe4431){if(_0xe4431){return _0xe4431[_0xc849('0x27')]()[_0xc849('0x26')](function(){_0x1176df[_0xc849('0x1a')](0xcc)[_0xc849('0x1b')]();});}};}function handleEntityNotFound(_0x2727f7,_0x145a10){return function(_0x1cd833){if(!_0x1cd833){_0x2727f7[_0xc849('0x19')](0x194);}return _0x1cd833;};}function handleError(_0x1dc609,_0x3b15b3){_0x3b15b3=_0x3b15b3||0x1f4;return function(_0x5e7f32){logger[_0xc849('0x28')](_0x5e7f32['stack']);if(_0x5e7f32[_0xc849('0x29')]){delete _0x5e7f32[_0xc849('0x29')];}_0x1dc609[_0xc849('0x1a')](_0x3b15b3)[_0xc849('0x2a')](_0x5e7f32);};}exports[_0xc849('0x2b')]=function(_0x3bec4b,_0x37f448){var _0x273310={},_0x21e901={},_0xa8f21c={'count':0x0,'rows':[]};var _0x37d11f=_[_0xc849('0x2c')](db[_0xc849('0x2d')][_0xc849('0x2e')],function(_0x46a411){return{'name':_0x46a411[_0xc849('0x2f')],'type':_0x46a411[_0xc849('0x30')][_0xc849('0x31')]};});_0x21e901[_0xc849('0x32')]=_[_0xc849('0x2c')](_0x37d11f,_0xc849('0x29'));_0x21e901['query']=_[_0xc849('0x33')](_0x3bec4b[_0xc849('0x34')]);_0x21e901[_0xc849('0x35')]=_['intersection'](_0x21e901['model'],_0x21e901[_0xc849('0x34')]);_0x273310[_0xc849('0x36')]=_['intersection'](_0x21e901['model'],qs['fields'](_0x3bec4b[_0xc849('0x34')][_0xc849('0x37')]));_0x273310[_0xc849('0x36')]=_0x273310[_0xc849('0x36')]['length']?_0x273310[_0xc849('0x36')]:_0x21e901[_0xc849('0x32')];if(!_0x3bec4b['query'][_0xc849('0x38')](_0xc849('0x39'))){_0x273310['limit']=qs[_0xc849('0x1f')](_0x3bec4b[_0xc849('0x34')]['limit']);_0x273310['offset']=qs['offset'](_0x3bec4b[_0xc849('0x34')][_0xc849('0x1d')]);}_0x273310['order']=qs[_0xc849('0x3a')](_0x3bec4b[_0xc849('0x34')][_0xc849('0x3a')]);_0x273310[_0xc849('0x3b')]=qs['filters'](_['pick'](_0x3bec4b[_0xc849('0x34')],_0x21e901[_0xc849('0x35')]),_0x37d11f);if(_0x3bec4b[_0xc849('0x34')][_0xc849('0x3c')]){_0x273310[_0xc849('0x3b')]=_['merge'](_0x273310[_0xc849('0x3b')],{'$or':_[_0xc849('0x2c')](_0x37d11f,function(_0x394a20){if(_0x394a20[_0xc849('0x30')]!==_0xc849('0x3d')){var _0x176554={};_0x176554[_0x394a20[_0xc849('0x29')]]={'$like':'%'+_0x3bec4b['query']['filter']+'%'};return _0x176554;}})});}_0x273310=_[_0xc849('0x3e')]({},_0x273310,_0x3bec4b[_0xc849('0x3f')]);var _0x1cbf95={'where':_0x273310[_0xc849('0x3b')]};return db['ZohoConfiguration'][_0xc849('0x20')](_0x1cbf95)[_0xc849('0x26')](function(_0x4def5f){_0xa8f21c[_0xc849('0x20')]=_0x4def5f;if(_0x3bec4b['query'][_0xc849('0x40')]){_0x273310['include']=[{'all':!![]}];}return db[_0xc849('0x2d')][_0xc849('0x41')](_0x273310);})[_0xc849('0x26')](function(_0x4fa05b){_0xa8f21c[_0xc849('0x42')]=_0x4fa05b;return _0xa8f21c;})['then'](respondWithFilteredResult(_0x37f448,_0x273310))[_0xc849('0x43')](handleError(_0x37f448,null));};exports[_0xc849('0x44')]=function(_0x5d714f,_0x2b47d8){var _0x39acbb={'raw':![],'where':{'id':_0x5d714f[_0xc849('0x45')]['id']}},_0x1ca854={};_0x1ca854[_0xc849('0x32')]=_['keys'](db[_0xc849('0x2d')][_0xc849('0x2e')]);_0x1ca854['query']=_[_0xc849('0x33')](_0x5d714f[_0xc849('0x34')]);_0x1ca854['filters']=_[_0xc849('0x46')](_0x1ca854[_0xc849('0x32')],_0x1ca854[_0xc849('0x34')]);_0x39acbb[_0xc849('0x36')]=_[_0xc849('0x46')](_0x1ca854[_0xc849('0x32')],qs[_0xc849('0x37')](_0x5d714f[_0xc849('0x34')]['fields']));_0x39acbb[_0xc849('0x36')]=_0x39acbb['attributes'][_0xc849('0x47')]?_0x39acbb['attributes']:_0x1ca854[_0xc849('0x32')];if(_0x5d714f[_0xc849('0x34')]['includeAll']){_0x39acbb[_0xc849('0x48')]=[{'all':!![]}];}_0x39acbb=_[_0xc849('0x3e')]({},_0x39acbb,_0x5d714f[_0xc849('0x3f')]);return db[_0xc849('0x2d')][_0xc849('0x49')](_0x39acbb)['then'](handleEntityNotFound(_0x2b47d8,null))[_0xc849('0x26')](respondWithResult(_0x2b47d8,null))['catch'](handleError(_0x2b47d8,null));};exports['create']=function(_0x53023b,_0x3c20c2){return db[_0xc849('0x2d')][_0xc849('0x4a')](_0x53023b['body'],{})[_0xc849('0x26')](respondWithResult(_0x3c20c2,0xc9))[_0xc849('0x43')](handleError(_0x3c20c2,null));};exports[_0xc849('0x25')]=function(_0xd67e2c,_0x26549e){if(_0xd67e2c[_0xc849('0x4b')]['id']){delete _0xd67e2c[_0xc849('0x4b')]['id'];}return db[_0xc849('0x2d')][_0xc849('0x49')]({'where':{'id':_0xd67e2c[_0xc849('0x45')]['id']}})['then'](handleEntityNotFound(_0x26549e,null))[_0xc849('0x26')](saveUpdates(_0xd67e2c[_0xc849('0x4b')],null))[_0xc849('0x26')](respondWithResult(_0x26549e,null))['catch'](handleError(_0x26549e,null));};exports[_0xc849('0x27')]=function(_0x4d2a0d,_0x5ae3d1){return db[_0xc849('0x2d')][_0xc849('0x49')]({'where':{'id':_0x4d2a0d[_0xc849('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ae3d1,null))['then'](removeEntity(_0x5ae3d1,null))['catch'](handleError(_0x5ae3d1,null));};exports[_0xc849('0x4c')]=function(_0x12d1b6,_0x5dc441,_0x3c5726){var _0x492c1a={};var _0x54e75e={};var _0x7b7f00;var _0xd5460;return db[_0xc849('0x2d')]['findOne']({'where':{'id':_0x12d1b6[_0xc849('0x45')]['id']}})[_0xc849('0x26')](handleEntityNotFound(_0x5dc441,null))[_0xc849('0x26')](function(_0xd4a38){if(_0xd4a38){_0x7b7f00=_0xd4a38;_0x54e75e[_0xc849('0x32')]=_[_0xc849('0x33')](db[_0xc849('0x4d')]['rawAttributes']);_0x54e75e[_0xc849('0x34')]=_[_0xc849('0x33')](_0x12d1b6[_0xc849('0x34')]);_0x54e75e[_0xc849('0x35')]=_[_0xc849('0x46')](_0x54e75e[_0xc849('0x32')],_0x54e75e[_0xc849('0x34')]);_0x492c1a[_0xc849('0x36')]=_[_0xc849('0x46')](_0x54e75e[_0xc849('0x32')],qs[_0xc849('0x37')](_0x12d1b6[_0xc849('0x34')][_0xc849('0x37')]));_0x492c1a[_0xc849('0x36')]=_0x492c1a['attributes']['length']?_0x492c1a['attributes']:_0x54e75e[_0xc849('0x32')];_0x492c1a[_0xc849('0x4e')]=qs[_0xc849('0x3a')](_0x12d1b6[_0xc849('0x34')][_0xc849('0x3a')]);_0x492c1a['where']=qs[_0xc849('0x35')](_[_0xc849('0x4f')](_0x12d1b6[_0xc849('0x34')],_0x54e75e[_0xc849('0x35')]));if(_0x12d1b6[_0xc849('0x34')][_0xc849('0x3c')]){_0x492c1a[_0xc849('0x3b')]=_[_0xc849('0x3e')](_0x492c1a[_0xc849('0x3b')],{'$or':_['map'](_0x492c1a['attributes'],function(_0x308c6a){var _0x2a312c={};_0x2a312c[_0x308c6a]={'$like':'%'+_0x12d1b6[_0xc849('0x34')]['filter']+'%'};return _0x2a312c;})});}_0x492c1a=_[_0xc849('0x3e')]({},_0x492c1a,_0x12d1b6[_0xc849('0x3f')]);return _0x7b7f00[_0xc849('0x4c')](_0x492c1a);}})[_0xc849('0x26')](function(_0x44762a){if(_0x44762a){_0xd5460=_0x44762a['length'];if(!_0x12d1b6[_0xc849('0x34')][_0xc849('0x38')](_0xc849('0x39'))){_0x492c1a['limit']=qs[_0xc849('0x1f')](_0x12d1b6[_0xc849('0x34')][_0xc849('0x1f')]);_0x492c1a[_0xc849('0x1d')]=qs[_0xc849('0x1d')](_0x12d1b6[_0xc849('0x34')]['offset']);}return _0x7b7f00[_0xc849('0x4c')](_0x492c1a);}})[_0xc849('0x26')](function(_0x56ef17){if(_0x56ef17){return _0x56ef17?{'count':_0xd5460,'rows':_0x56ef17}:null;}})[_0xc849('0x26')](respondWithResult(_0x5dc441,null))['catch'](handleError(_0x5dc441,null));};exports[_0xc849('0x50')]=function(_0x541ae3,_0x28e623,_0xc8b036){var _0x520e6f={};var _0x5050a5={};var _0x11f3b3;var _0x597852;return db[_0xc849('0x2d')][_0xc849('0x51')]({'where':{'id':_0x541ae3['params']['id']}})[_0xc849('0x26')](handleEntityNotFound(_0x28e623,null))[_0xc849('0x26')](function(_0x52b51a){if(_0x52b51a){_0x11f3b3=_0x52b51a;_0x5050a5[_0xc849('0x32')]=_[_0xc849('0x33')](db[_0xc849('0x4d')][_0xc849('0x2e')]);_0x5050a5[_0xc849('0x34')]=_[_0xc849('0x33')](_0x541ae3[_0xc849('0x34')]);_0x5050a5[_0xc849('0x35')]=_['intersection'](_0x5050a5[_0xc849('0x32')],_0x5050a5[_0xc849('0x34')]);_0x520e6f[_0xc849('0x36')]=_[_0xc849('0x46')](_0x5050a5[_0xc849('0x32')],qs[_0xc849('0x37')](_0x541ae3[_0xc849('0x34')][_0xc849('0x37')]));_0x520e6f[_0xc849('0x36')]=_0x520e6f[_0xc849('0x36')][_0xc849('0x47')]?_0x520e6f[_0xc849('0x36')]:_0x5050a5[_0xc849('0x32')];_0x520e6f[_0xc849('0x4e')]=qs[_0xc849('0x3a')](_0x541ae3[_0xc849('0x34')]['sort']);_0x520e6f['where']=qs['filters'](_['pick'](_0x541ae3[_0xc849('0x34')],_0x5050a5[_0xc849('0x35')]));if(_0x541ae3[_0xc849('0x34')][_0xc849('0x3c')]){_0x520e6f[_0xc849('0x3b')]=_['merge'](_0x520e6f['where'],{'$or':_['map'](_0x520e6f[_0xc849('0x36')],function(_0x41f89f){var _0x479db1={};_0x479db1[_0x41f89f]={'$like':'%'+_0x541ae3['query'][_0xc849('0x3c')]+'%'};return _0x479db1;})});}_0x520e6f=_[_0xc849('0x3e')]({},_0x520e6f,_0x541ae3[_0xc849('0x3f')]);return _0x11f3b3[_0xc849('0x50')](_0x520e6f);}})[_0xc849('0x26')](function(_0x30ec00){if(_0x30ec00){_0x597852=_0x30ec00[_0xc849('0x47')];if(!_0x541ae3[_0xc849('0x34')][_0xc849('0x38')](_0xc849('0x39'))){_0x520e6f[_0xc849('0x1f')]=qs[_0xc849('0x1f')](_0x541ae3[_0xc849('0x34')][_0xc849('0x1f')]);_0x520e6f[_0xc849('0x1d')]=qs['offset'](_0x541ae3[_0xc849('0x34')][_0xc849('0x1d')]);}return _0x11f3b3[_0xc849('0x50')](_0x520e6f);}})[_0xc849('0x26')](function(_0x4f6dd7){if(_0x4f6dd7){return _0x4f6dd7?{'count':_0x597852,'rows':_0x4f6dd7}:null;}})[_0xc849('0x26')](respondWithResult(_0x28e623,null))['catch'](handleError(_0x28e623,null));};exports[_0xc849('0x52')]=function(_0x3904c7,_0x200498,_0x988278){var _0x2434be={};var _0x434f7a={};var _0x6b600a;var _0xa63e36;return db[_0xc849('0x2d')][_0xc849('0x51')]({'where':{'id':_0x3904c7[_0xc849('0x45')]['id']}})[_0xc849('0x26')](handleEntityNotFound(_0x200498,null))[_0xc849('0x26')](function(_0x5e2fae){if(_0x5e2fae){_0x6b600a=_0x5e2fae;_0x434f7a['model']=_[_0xc849('0x33')](db[_0xc849('0x4d')][_0xc849('0x2e')]);_0x434f7a[_0xc849('0x34')]=_[_0xc849('0x33')](_0x3904c7[_0xc849('0x34')]);_0x434f7a[_0xc849('0x35')]=_['intersection'](_0x434f7a[_0xc849('0x32')],_0x434f7a[_0xc849('0x34')]);_0x2434be['attributes']=_[_0xc849('0x46')](_0x434f7a[_0xc849('0x32')],qs[_0xc849('0x37')](_0x3904c7[_0xc849('0x34')][_0xc849('0x37')]));_0x2434be[_0xc849('0x36')]=_0x2434be[_0xc849('0x36')][_0xc849('0x47')]?_0x2434be[_0xc849('0x36')]:_0x434f7a[_0xc849('0x32')];_0x2434be[_0xc849('0x4e')]=qs[_0xc849('0x3a')](_0x3904c7[_0xc849('0x34')][_0xc849('0x3a')]);_0x2434be[_0xc849('0x3b')]=qs[_0xc849('0x35')](_[_0xc849('0x4f')](_0x3904c7['query'],_0x434f7a[_0xc849('0x35')]));if(_0x3904c7[_0xc849('0x34')][_0xc849('0x3c')]){_0x2434be[_0xc849('0x3b')]=_[_0xc849('0x3e')](_0x2434be[_0xc849('0x3b')],{'$or':_[_0xc849('0x2c')](_0x2434be[_0xc849('0x36')],function(_0x1f4f77){var _0xc9af9c={};_0xc9af9c[_0x1f4f77]={'$like':'%'+_0x3904c7[_0xc849('0x34')]['filter']+'%'};return _0xc9af9c;})});}_0x2434be=_['merge']({},_0x2434be,_0x3904c7[_0xc849('0x3f')]);return _0x6b600a['getDescriptions'](_0x2434be);}})[_0xc849('0x26')](function(_0x11c193){if(_0x11c193){_0xa63e36=_0x11c193[_0xc849('0x47')];if(!_0x3904c7[_0xc849('0x34')][_0xc849('0x38')](_0xc849('0x39'))){_0x2434be[_0xc849('0x1f')]=qs[_0xc849('0x1f')](_0x3904c7[_0xc849('0x34')][_0xc849('0x1f')]);_0x2434be[_0xc849('0x1d')]=qs[_0xc849('0x1d')](_0x3904c7[_0xc849('0x34')][_0xc849('0x1d')]);}return _0x6b600a[_0xc849('0x52')](_0x2434be);}})[_0xc849('0x26')](function(_0x5ec11c){if(_0x5ec11c){return _0x5ec11c?{'count':_0xa63e36,'rows':_0x5ec11c}:null;}})['then'](respondWithResult(_0x200498,null))[_0xc849('0x43')](handleError(_0x200498,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 296b049..21631ca 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 _0x0cc9=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger','api','moment','bluebird'];(function(_0x35d68c,_0x1959c5){var _0x449b0b=function(_0x51d53d){while(--_0x51d53d){_0x35d68c['push'](_0x35d68c['shift']());}};_0x449b0b(++_0x1959c5);}(_0x0cc9,0x174));var _0x90cc=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0x0cc9[_0x5a4b16];return _0x5236dc;};'use strict';var _=require(_0x90cc('0x0'));var util=require('util');var logger=require(_0x90cc('0x1'))(_0x90cc('0x2'));var moment=require(_0x90cc('0x3'));var BPromise=require(_0x90cc('0x4'));var rp=require(_0x90cc('0x5'));var fs=require('fs');var path=require(_0x90cc('0x6'));var rimraf=require(_0x90cc('0x7'));var config=require(_0x90cc('0x8'));var attributes=require(_0x90cc('0x9'));module[_0x90cc('0xa')]=function(_0x5b05a1,_0x24a5c3){return _0x5b05a1[_0x90cc('0xb')](_0x90cc('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2871=['request-promise','path','rimraf','../../config/environment','exports','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x2d6e66,_0x3de933){var _0x42af90=function(_0x1cf6df){while(--_0x1cf6df){_0x2d6e66['push'](_0x2d6e66['shift']());}};_0x42af90(++_0x3de933);}(_0x2871,0x13c));var _0x1287=function(_0x20bf16,_0x4b37b2){_0x20bf16=_0x20bf16-0x0;var _0x4b3ffb=_0x2871[_0x20bf16];return _0x4b3ffb;};'use strict';var _=require(_0x1287('0x0'));var util=require(_0x1287('0x1'));var logger=require(_0x1287('0x2'))(_0x1287('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1287('0x4'));var fs=require('fs');var path=require(_0x1287('0x5'));var rimraf=require(_0x1287('0x6'));var config=require(_0x1287('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x1287('0x8')]=function(_0x6a3859,_0x21dbba){return _0x6a3859['define']('ZohoConfiguration',attributes,{'tableName':_0x1287('0x9'),'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 7342851..17d80d1 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 _0x162e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0xa9d70a,_0x33a1d7){var _0x221108=function(_0x209055){while(--_0x209055){_0xa9d70a['push'](_0xa9d70a['shift']());}};_0x221108(++_0x33a1d7);}(_0x162e,0x81));var _0xe162=function(_0x5054ab,_0x551e6a){_0x5054ab=_0x5054ab-0x0;var _0x56d2b7=_0x162e[_0x5054ab];return _0x56d2b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe162('0x0'));var BPromise=require(_0xe162('0x1'));var rs=require(_0xe162('0x2'));var fs=require('fs');var Redis=require(_0xe162('0x3'));var db=require(_0xe162('0x4'))['db'];var utils=require(_0xe162('0x5'));var logger=require(_0xe162('0x6'))(_0xe162('0x7'));var config=require('../../config/environment');var jayson=require(_0xe162('0x8'));var client=jayson[_0xe162('0x9')][_0xe162('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a1b32,_0x11ba2d,_0x479b9f){return new BPromise(function(_0x2de619,_0x24a225){return client['request'](_0x1a1b32,_0x479b9f)[_0xe162('0xb')](function(_0xbde14b){logger[_0xe162('0xc')](_0xe162('0xd'),_0x11ba2d,_0xe162('0xe'));logger[_0xe162('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x11ba2d,_0xe162('0xe'),JSON[_0xe162('0x10')](_0xbde14b));if(_0xbde14b[_0xe162('0x11')]){if(_0xbde14b[_0xe162('0x11')][_0xe162('0x12')]===0x1f4){logger[_0xe162('0x11')](_0xe162('0xd'),_0x11ba2d,_0xbde14b[_0xe162('0x11')]['message']);return _0x24a225(_0xbde14b[_0xe162('0x11')][_0xe162('0x13')]);}logger[_0xe162('0x11')](_0xe162('0xd'),_0x11ba2d,_0xbde14b[_0xe162('0x11')]['message']);return _0x2de619(_0xbde14b[_0xe162('0x11')][_0xe162('0x13')]);}else{logger[_0xe162('0xc')](_0xe162('0xd'),_0x11ba2d,_0xe162('0xe'));_0x2de619(_0xbde14b[_0xe162('0x14')][_0xe162('0x13')]);}})[_0xe162('0x15')](function(_0x1a60ea){logger[_0xe162('0x11')](_0xe162('0xd'),_0x11ba2d,_0x1a60ea);_0x24a225(_0x1a60ea);});});} \ No newline at end of file +var _0x41d6=['../../config/logger','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x455d78,_0x430d45){var _0x54828c=function(_0x4d81c8){while(--_0x4d81c8){_0x455d78['push'](_0x455d78['shift']());}};_0x54828c(++_0x430d45);}(_0x41d6,0xcc));var _0x641d=function(_0x426a37,_0x1d32df){_0x426a37=_0x426a37-0x0;var _0x4e9e28=_0x41d6[_0x426a37];return _0x4e9e28;};'use strict';var _=require(_0x641d('0x0'));var util=require(_0x641d('0x1'));var moment=require(_0x641d('0x2'));var BPromise=require(_0x641d('0x3'));var rs=require(_0x641d('0x4'));var fs=require('fs');var Redis=require(_0x641d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x641d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x641d('0x7'));var client=jayson[_0x641d('0x8')][_0x641d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5205c1,_0x1b2c6b,_0x398b3d){return new BPromise(function(_0x1e0dc1,_0x57c0e9){return client['request'](_0x5205c1,_0x398b3d)[_0x641d('0xa')](function(_0x64b825){logger[_0x641d('0xb')](_0x641d('0xc'),_0x1b2c6b,'request\x20sent');logger[_0x641d('0xd')](_0x641d('0xe'),_0x1b2c6b,_0x641d('0xf'),JSON[_0x641d('0x10')](_0x64b825));if(_0x64b825['error']){if(_0x64b825[_0x641d('0x11')][_0x641d('0x12')]===0x1f4){logger[_0x641d('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x1b2c6b,_0x64b825[_0x641d('0x11')]['message']);return _0x57c0e9(_0x64b825[_0x641d('0x11')][_0x641d('0x13')]);}logger[_0x641d('0x11')](_0x641d('0xc'),_0x1b2c6b,_0x64b825['error'][_0x641d('0x13')]);return _0x1e0dc1(_0x64b825[_0x641d('0x11')][_0x641d('0x13')]);}else{logger[_0x641d('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x1b2c6b,_0x641d('0xf'));_0x1e0dc1(_0x64b825[_0x641d('0x14')]['message']);}})['catch'](function(_0x12fcb4){logger[_0x641d('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x1b2c6b,_0x12fcb4);_0x57c0e9(_0x12fcb4);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 591f705..9778f3c 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 _0x684a=['show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/:id','isAuthenticated'];(function(_0x1dc9cd,_0x1e117a){var _0x1b0ec8=function(_0x5a9edb){while(--_0x5a9edb){_0x1dc9cd['push'](_0x1dc9cd['shift']());}};_0x1b0ec8(++_0x1e117a);}(_0x684a,0x127));var _0xa684=function(_0xcb5b31,_0x3455e9){_0xcb5b31=_0xcb5b31-0x0;var _0x18c860=_0x684a[_0xcb5b31];return _0x18c860;};'use strict';var multer=require(_0xa684('0x0'));var util=require(_0xa684('0x1'));var path=require(_0xa684('0x2'));var timeout=require(_0xa684('0x3'));var express=require(_0xa684('0x4'));var router=express[_0xa684('0x5')]();var fs_extra=require(_0xa684('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa684('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa684('0x8')]);router['get'](_0xa684('0x9'),auth[_0xa684('0xa')](),controller[_0xa684('0xb')]);router[_0xa684('0xc')]('/',auth[_0xa684('0xa')](),controller[_0xa684('0xd')]);router['put'](_0xa684('0x9'),auth['isAuthenticated'](),controller[_0xa684('0xe')]);router[_0xa684('0xf')](_0xa684('0x9'),auth[_0xa684('0xa')](),controller[_0xa684('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6bae=['get','show','post','create','put','/:id','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6bae,0x80));var _0xe6ba=function(_0x2b0b3b,_0x96981f){_0x2b0b3b=_0x2b0b3b-0x0;var _0x410d69=_0x6bae[_0x2b0b3b];return _0x410d69;};'use strict';var multer=require('multer');var util=require(_0xe6ba('0x0'));var path=require('path');var timeout=require(_0xe6ba('0x1'));var express=require(_0xe6ba('0x2'));var router=express['Router']();var fs_extra=require(_0xe6ba('0x3'));var auth=require(_0xe6ba('0x4'));var interaction=require(_0xe6ba('0x5'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0xe6ba('0x6')](),controller[_0xe6ba('0x7')]);router[_0xe6ba('0x8')]('/:id',auth[_0xe6ba('0x6')](),controller[_0xe6ba('0x9')]);router[_0xe6ba('0xa')]('/',auth['isAuthenticated'](),controller[_0xe6ba('0xb')]);router[_0xe6ba('0xc')](_0xe6ba('0xd'),auth[_0xe6ba('0x6')](),controller['update']);router[_0xe6ba('0xe')](_0xe6ba('0xd'),auth[_0xe6ba('0x6')](),controller[_0xe6ba('0xf')]);module[_0xe6ba('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1934c86..0199624 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 _0xcc56=['sequelize','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN'];(function(_0x4ab181,_0xa66a71){var _0x26cc6f=function(_0x947838){while(--_0x947838){_0x4ab181['push'](_0x4ab181['shift']());}};_0x26cc6f(++_0xa66a71);}(_0xcc56,0x108));var _0x6cc5=function(_0xbb126a,_0x2223ac){_0xbb126a=_0xbb126a-0x0;var _0x9bbdf4=_0xcc56[_0xbb126a];return _0x9bbdf4;};'use strict';var Sequelize=require(_0x6cc5('0x0'));module['exports']={'type':{'type':Sequelize[_0x6cc5('0x1')](_0x6cc5('0x2'),'variable',_0x6cc5('0x3'),'keyValue',_0x6cc5('0x4')),'defaultValue':_0x6cc5('0x2')},'content':{'type':Sequelize[_0x6cc5('0x5')]},'key':{'type':Sequelize[_0x6cc5('0x5')]},'keyType':{'type':Sequelize[_0x6cc5('0x1')](_0x6cc5('0x2'),_0x6cc5('0x6'),_0x6cc5('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6cc5('0x5')]},'nameField':{'type':Sequelize[_0x6cc5('0x5')]},'customField':{'type':Sequelize[_0x6cc5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6cc5('0x5')]}}; \ No newline at end of file +var _0xc454=['picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','customVariable'];(function(_0x3ebc63,_0x122af5){var _0xafdcf7=function(_0x15ac2a){while(--_0x15ac2a){_0x3ebc63['push'](_0x3ebc63['shift']());}};_0xafdcf7(++_0x122af5);}(_0xc454,0x135));var _0x4c45=function(_0x1837cb,_0x1bd146){_0x1837cb=_0x1837cb-0x0;var _0x71e4bf=_0xc454[_0x1837cb];return _0x71e4bf;};'use strict';var Sequelize=require(_0x4c45('0x0'));module[_0x4c45('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x4c45('0x2'),'keyValue',_0x4c45('0x3')),'defaultValue':_0x4c45('0x4')},'content':{'type':Sequelize[_0x4c45('0x5')]},'key':{'type':Sequelize[_0x4c45('0x5')]},'keyType':{'type':Sequelize[_0x4c45('0x6')](_0x4c45('0x4'),'variable',_0x4c45('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4c45('0x5')]},'nameField':{'type':Sequelize[_0x4c45('0x5')]},'customField':{'type':Sequelize[_0x4c45('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c45('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index fec25a4..ed1392b 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 _0xbe21=['apply','save','update','then','destroy','end','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x2b8e3c,_0x3c12c9){var _0xdfb0bc=function(_0x523082){while(--_0x523082){_0x2b8e3c['push'](_0x2b8e3c['shift']());}};_0xdfb0bc(++_0x3c12c9);}(_0xbe21,0x70));var _0x1be2=function(_0x382e58,_0x3060d9){_0x382e58=_0x382e58-0x0;var _0x34ef18=_0xbe21[_0x382e58];return _0x34ef18;};'use strict';var emlformat=require(_0x1be2('0x0'));var rimraf=require(_0x1be2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1be2('0x2'));var rp=require(_0x1be2('0x3'));var moment=require(_0x1be2('0x4'));var BPromise=require(_0x1be2('0x5'));var Mustache=require('mustache');var util=require(_0x1be2('0x6'));var path=require(_0x1be2('0x7'));var sox=require(_0x1be2('0x8'));var csv=require(_0x1be2('0x9'));var ejs=require(_0x1be2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1be2('0xb'));var squel=require(_0x1be2('0xc'));var crypto=require('crypto');var jsforce=require(_0x1be2('0xd'));var deskjs=require(_0x1be2('0xe'));var toCsv=require(_0x1be2('0x9'));var querystring=require(_0x1be2('0xf'));var Papa=require(_0x1be2('0x10'));var Redis=require(_0x1be2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1be2('0x12'));var logger=require(_0x1be2('0x13'))(_0x1be2('0x14'));var utils=require(_0x1be2('0x15'));var config=require(_0x1be2('0x16'));var licenseUtil=require(_0x1be2('0x17'));var db=require(_0x1be2('0x18'))['db'];function respondWithStatusCode(_0x23ef2d,_0x254b3e){_0x254b3e=_0x254b3e||0xcc;return function(_0x2e75a1){if(_0x2e75a1){return _0x23ef2d[_0x1be2('0x19')](_0x254b3e);}return _0x23ef2d[_0x1be2('0x1a')](_0x254b3e)['end']();};}function respondWithResult(_0x2933c0,_0x26eeaa){_0x26eeaa=_0x26eeaa||0xc8;return function(_0x390c4f){if(_0x390c4f){return _0x2933c0[_0x1be2('0x1a')](_0x26eeaa)[_0x1be2('0x1b')](_0x390c4f);}};}function respondWithFilteredResult(_0xa4d414,_0x1438c5){return function(_0x2308f4){if(_0x2308f4){var _0x2e9688=typeof _0x1438c5[_0x1be2('0x1c')]==='undefined'&&typeof _0x1438c5[_0x1be2('0x1d')]===_0x1be2('0x1e');var _0x1e29f7=_0x2308f4['count'];var _0x298dc7=_0x2e9688?0x0:_0x1438c5[_0x1be2('0x1c')];var _0x20a903=_0x2e9688?_0x2308f4[_0x1be2('0x1f')]:_0x1438c5['offset']+_0x1438c5[_0x1be2('0x1d')];var _0x37cf07;if(_0x20a903>=_0x1e29f7){_0x20a903=_0x1e29f7;_0x37cf07=0xc8;}else{_0x37cf07=0xce;}_0xa4d414[_0x1be2('0x1a')](_0x37cf07);return _0xa4d414[_0x1be2('0x20')](_0x1be2('0x21'),_0x298dc7+'-'+_0x20a903+'/'+_0x1e29f7)[_0x1be2('0x1b')](_0x2308f4);}return null;};}function patchUpdates(_0x50a655){return function(_0x50d8a3){try{jsonpatch[_0x1be2('0x22')](_0x50d8a3,_0x50a655,!![]);}catch(_0x442381){return BPromise['reject'](_0x442381);}return _0x50d8a3[_0x1be2('0x23')]();};}function saveUpdates(_0xe2dbbe,_0x588af3){return function(_0x1f970d){if(_0x1f970d){return _0x1f970d[_0x1be2('0x24')](_0xe2dbbe)[_0x1be2('0x25')](function(_0x550cb8){return _0x550cb8;});}return null;};}function removeEntity(_0x29f015,_0x3b2530){return function(_0x5c6e1a){if(_0x5c6e1a){return _0x5c6e1a[_0x1be2('0x26')]()[_0x1be2('0x25')](function(){_0x29f015[_0x1be2('0x1a')](0xcc)[_0x1be2('0x27')]();});}};}function handleEntityNotFound(_0x87b881,_0x3cc1eb){return function(_0x550a96){if(!_0x550a96){_0x87b881[_0x1be2('0x19')](0x194);}return _0x550a96;};}function handleError(_0x2e3f62,_0x16c19c){_0x16c19c=_0x16c19c||0x1f4;return function(_0x4bd8a8){logger['error'](_0x4bd8a8[_0x1be2('0x28')]);if(_0x4bd8a8[_0x1be2('0x29')]){delete _0x4bd8a8[_0x1be2('0x29')];}_0x2e3f62[_0x1be2('0x1a')](_0x16c19c)[_0x1be2('0x2a')](_0x4bd8a8);};}exports[_0x1be2('0x2b')]=function(_0x5ae1a7,_0x54f965){var _0x540b6c={},_0x3b5940={},_0x5935f6={'count':0x0,'rows':[]};var _0xf24027=_['map'](db[_0x1be2('0x2c')][_0x1be2('0x2d')],function(_0x5dc4a3){return{'name':_0x5dc4a3[_0x1be2('0x2e')],'type':_0x5dc4a3[_0x1be2('0x2f')]['key']};});_0x3b5940['model']=_['map'](_0xf24027,_0x1be2('0x29'));_0x3b5940[_0x1be2('0x30')]=_[_0x1be2('0x31')](_0x5ae1a7[_0x1be2('0x30')]);_0x3b5940['filters']=_[_0x1be2('0x32')](_0x3b5940[_0x1be2('0x33')],_0x3b5940['query']);_0x540b6c[_0x1be2('0x34')]=_[_0x1be2('0x32')](_0x3b5940[_0x1be2('0x33')],qs[_0x1be2('0x35')](_0x5ae1a7[_0x1be2('0x30')][_0x1be2('0x35')]));_0x540b6c[_0x1be2('0x34')]=_0x540b6c[_0x1be2('0x34')][_0x1be2('0x36')]?_0x540b6c[_0x1be2('0x34')]:_0x3b5940[_0x1be2('0x33')];if(!_0x5ae1a7[_0x1be2('0x30')]['hasOwnProperty'](_0x1be2('0x37'))){_0x540b6c[_0x1be2('0x1d')]=qs[_0x1be2('0x1d')](_0x5ae1a7['query'][_0x1be2('0x1d')]);_0x540b6c[_0x1be2('0x1c')]=qs[_0x1be2('0x1c')](_0x5ae1a7[_0x1be2('0x30')][_0x1be2('0x1c')]);}_0x540b6c[_0x1be2('0x38')]=qs['sort'](_0x5ae1a7[_0x1be2('0x30')][_0x1be2('0x39')]);_0x540b6c[_0x1be2('0x3a')]=qs[_0x1be2('0x3b')](_['pick'](_0x5ae1a7[_0x1be2('0x30')],_0x3b5940[_0x1be2('0x3b')]),_0xf24027);if(_0x5ae1a7[_0x1be2('0x30')][_0x1be2('0x3c')]){_0x540b6c[_0x1be2('0x3a')]=_[_0x1be2('0x3d')](_0x540b6c['where'],{'$or':_['map'](_0xf24027,function(_0x54df57){if(_0x54df57['type']!==_0x1be2('0x3e')){var _0x3b28e4={};_0x3b28e4[_0x54df57[_0x1be2('0x29')]]={'$like':'%'+_0x5ae1a7[_0x1be2('0x30')][_0x1be2('0x3c')]+'%'};return _0x3b28e4;}})});}_0x540b6c=_[_0x1be2('0x3d')]({},_0x540b6c,_0x5ae1a7['options']);var _0x46a581={'where':_0x540b6c[_0x1be2('0x3a')]};return db[_0x1be2('0x2c')]['count'](_0x46a581)['then'](function(_0x238cfb){_0x5935f6[_0x1be2('0x1f')]=_0x238cfb;if(_0x5ae1a7['query'][_0x1be2('0x3f')]){_0x540b6c[_0x1be2('0x40')]=[{'all':!![]}];}return db[_0x1be2('0x2c')]['findAll'](_0x540b6c);})[_0x1be2('0x25')](function(_0x60480e){_0x5935f6[_0x1be2('0x41')]=_0x60480e;return _0x5935f6;})['then'](respondWithFilteredResult(_0x54f965,_0x540b6c))[_0x1be2('0x42')](handleError(_0x54f965,null));};exports[_0x1be2('0x43')]=function(_0x46766a,_0x186c1b){var _0x520203={'raw':!![],'where':{'id':_0x46766a['params']['id']}},_0x6272c6={};_0x6272c6[_0x1be2('0x33')]=_[_0x1be2('0x31')](db['ZohoField'][_0x1be2('0x2d')]);_0x6272c6[_0x1be2('0x30')]=_[_0x1be2('0x31')](_0x46766a[_0x1be2('0x30')]);_0x6272c6[_0x1be2('0x3b')]=_[_0x1be2('0x32')](_0x6272c6['model'],_0x6272c6[_0x1be2('0x30')]);_0x520203[_0x1be2('0x34')]=_[_0x1be2('0x32')](_0x6272c6[_0x1be2('0x33')],qs[_0x1be2('0x35')](_0x46766a[_0x1be2('0x30')]['fields']));_0x520203[_0x1be2('0x34')]=_0x520203['attributes']['length']?_0x520203['attributes']:_0x6272c6[_0x1be2('0x33')];if(_0x46766a[_0x1be2('0x30')]['includeAll']){_0x520203[_0x1be2('0x40')]=[{'all':!![]}];}_0x520203=_[_0x1be2('0x3d')]({},_0x520203,_0x46766a[_0x1be2('0x44')]);return db[_0x1be2('0x2c')]['find'](_0x520203)[_0x1be2('0x25')](handleEntityNotFound(_0x186c1b,null))[_0x1be2('0x25')](respondWithResult(_0x186c1b,null))[_0x1be2('0x42')](handleError(_0x186c1b,null));};exports[_0x1be2('0x45')]=function(_0x412c11,_0xa900ec){return db[_0x1be2('0x2c')][_0x1be2('0x45')](_0x412c11[_0x1be2('0x46')],{})[_0x1be2('0x25')](respondWithResult(_0xa900ec,0xc9))[_0x1be2('0x42')](handleError(_0xa900ec,null));};exports['update']=function(_0x4da638,_0x3c1ed3){if(_0x4da638[_0x1be2('0x46')]['id']){delete _0x4da638[_0x1be2('0x46')]['id'];}return db[_0x1be2('0x2c')][_0x1be2('0x47')]({'where':{'id':_0x4da638[_0x1be2('0x48')]['id']}})[_0x1be2('0x25')](handleEntityNotFound(_0x3c1ed3,null))['then'](saveUpdates(_0x4da638[_0x1be2('0x46')],null))[_0x1be2('0x25')](respondWithResult(_0x3c1ed3,null))[_0x1be2('0x42')](handleError(_0x3c1ed3,null));};exports['destroy']=function(_0x5e5392,_0x2c357b){return db[_0x1be2('0x2c')][_0x1be2('0x47')]({'where':{'id':_0x5e5392[_0x1be2('0x48')]['id']}})[_0x1be2('0x25')](handleEntityNotFound(_0x2c357b,null))[_0x1be2('0x25')](removeEntity(_0x2c357b,null))[_0x1be2('0x42')](handleError(_0x2c357b,null));}; \ No newline at end of file +var _0x45e7=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','end','sendStatus','error','stack','send','index','map','ZohoField','type','key','model','name','query','keys','intersection','fields','attributes','length','order','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xdc53dc,_0x55b654){var _0x1114fe=function(_0x179ccb){while(--_0x179ccb){_0xdc53dc['push'](_0xdc53dc['shift']());}};_0x1114fe(++_0x55b654);}(_0x45e7,0x125));var _0x745e=function(_0x40ecd0,_0x27de55){_0x40ecd0=_0x40ecd0-0x0;var _0x5a9953=_0x45e7[_0x40ecd0];return _0x5a9953;};'use strict';var emlformat=require(_0x745e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x745e('0x1'));var jsonpatch=require(_0x745e('0x2'));var rp=require(_0x745e('0x3'));var moment=require(_0x745e('0x4'));var BPromise=require(_0x745e('0x5'));var Mustache=require(_0x745e('0x6'));var util=require(_0x745e('0x7'));var path=require(_0x745e('0x8'));var sox=require(_0x745e('0x9'));var csv=require(_0x745e('0xa'));var ejs=require(_0x745e('0xb'));var fs=require('fs');var fs_extra=require(_0x745e('0xc'));var _=require(_0x745e('0xd'));var squel=require(_0x745e('0xe'));var crypto=require('crypto');var jsforce=require(_0x745e('0xf'));var deskjs=require(_0x745e('0x10'));var toCsv=require(_0x745e('0xa'));var querystring=require(_0x745e('0x11'));var Papa=require(_0x745e('0x12'));var Redis=require(_0x745e('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x745e('0x14'));var hardwareService=require(_0x745e('0x15'));var logger=require(_0x745e('0x16'))(_0x745e('0x17'));var utils=require(_0x745e('0x18'));var config=require(_0x745e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x745e('0x1a'))['db'];function respondWithStatusCode(_0x367ed4,_0x1d3b67){_0x1d3b67=_0x1d3b67||0xcc;return function(_0x3dba15){if(_0x3dba15){return _0x367ed4['sendStatus'](_0x1d3b67);}return _0x367ed4[_0x745e('0x1b')](_0x1d3b67)['end']();};}function respondWithResult(_0x4549ef,_0x3139bc){_0x3139bc=_0x3139bc||0xc8;return function(_0x389c9d){if(_0x389c9d){return _0x4549ef[_0x745e('0x1b')](_0x3139bc)[_0x745e('0x1c')](_0x389c9d);}};}function respondWithFilteredResult(_0xf6d0c6,_0x319ab8){return function(_0x560fca){if(_0x560fca){var _0x3f3b12=typeof _0x319ab8['offset']==='undefined'&&typeof _0x319ab8['limit']===_0x745e('0x1d');var _0x36e5bb=_0x560fca[_0x745e('0x1e')];var _0x43b3f4=_0x3f3b12?0x0:_0x319ab8['offset'];var _0x3da944=_0x3f3b12?_0x560fca[_0x745e('0x1e')]:_0x319ab8[_0x745e('0x1f')]+_0x319ab8[_0x745e('0x20')];var _0x4ebe08;if(_0x3da944>=_0x36e5bb){_0x3da944=_0x36e5bb;_0x4ebe08=0xc8;}else{_0x4ebe08=0xce;}_0xf6d0c6[_0x745e('0x1b')](_0x4ebe08);return _0xf6d0c6[_0x745e('0x21')]('Content-Range',_0x43b3f4+'-'+_0x3da944+'/'+_0x36e5bb)[_0x745e('0x1c')](_0x560fca);}return null;};}function patchUpdates(_0x188cc2){return function(_0xbdca13){try{jsonpatch['apply'](_0xbdca13,_0x188cc2,!![]);}catch(_0x35b1ee){return BPromise[_0x745e('0x22')](_0x35b1ee);}return _0xbdca13[_0x745e('0x23')]();};}function saveUpdates(_0x1f56a8,_0x4cba6e){return function(_0x31437b){if(_0x31437b){return _0x31437b[_0x745e('0x24')](_0x1f56a8)[_0x745e('0x25')](function(_0x232169){return _0x232169;});}return null;};}function removeEntity(_0x250e65,_0x3a3e11){return function(_0xd45fd1){if(_0xd45fd1){return _0xd45fd1[_0x745e('0x26')]()[_0x745e('0x25')](function(){_0x250e65['status'](0xcc)[_0x745e('0x27')]();});}};}function handleEntityNotFound(_0x4ddb14,_0x5a05c1){return function(_0x316b35){if(!_0x316b35){_0x4ddb14[_0x745e('0x28')](0x194);}return _0x316b35;};}function handleError(_0x28fb96,_0x17bc1f){_0x17bc1f=_0x17bc1f||0x1f4;return function(_0x52ebe5){logger[_0x745e('0x29')](_0x52ebe5[_0x745e('0x2a')]);if(_0x52ebe5['name']){delete _0x52ebe5['name'];}_0x28fb96[_0x745e('0x1b')](_0x17bc1f)[_0x745e('0x2b')](_0x52ebe5);};}exports[_0x745e('0x2c')]=function(_0x462f64,_0x2157ad){var _0x4f16d0={},_0x304b5b={},_0x54dcf6={'count':0x0,'rows':[]};var _0x534b72=_[_0x745e('0x2d')](db[_0x745e('0x2e')]['rawAttributes'],function(_0x1a5945){return{'name':_0x1a5945['fieldName'],'type':_0x1a5945[_0x745e('0x2f')][_0x745e('0x30')]};});_0x304b5b[_0x745e('0x31')]=_[_0x745e('0x2d')](_0x534b72,_0x745e('0x32'));_0x304b5b[_0x745e('0x33')]=_[_0x745e('0x34')](_0x462f64[_0x745e('0x33')]);_0x304b5b['filters']=_[_0x745e('0x35')](_0x304b5b[_0x745e('0x31')],_0x304b5b[_0x745e('0x33')]);_0x4f16d0['attributes']=_[_0x745e('0x35')](_0x304b5b[_0x745e('0x31')],qs[_0x745e('0x36')](_0x462f64[_0x745e('0x33')][_0x745e('0x36')]));_0x4f16d0[_0x745e('0x37')]=_0x4f16d0['attributes'][_0x745e('0x38')]?_0x4f16d0[_0x745e('0x37')]:_0x304b5b['model'];if(!_0x462f64[_0x745e('0x33')]['hasOwnProperty']('nolimit')){_0x4f16d0[_0x745e('0x20')]=qs[_0x745e('0x20')](_0x462f64[_0x745e('0x33')][_0x745e('0x20')]);_0x4f16d0[_0x745e('0x1f')]=qs[_0x745e('0x1f')](_0x462f64['query'][_0x745e('0x1f')]);}_0x4f16d0[_0x745e('0x39')]=qs['sort'](_0x462f64[_0x745e('0x33')][_0x745e('0x3a')]);_0x4f16d0['where']=qs[_0x745e('0x3b')](_[_0x745e('0x3c')](_0x462f64['query'],_0x304b5b[_0x745e('0x3b')]),_0x534b72);if(_0x462f64[_0x745e('0x33')][_0x745e('0x3d')]){_0x4f16d0[_0x745e('0x3e')]=_[_0x745e('0x3f')](_0x4f16d0['where'],{'$or':_[_0x745e('0x2d')](_0x534b72,function(_0x4bc161){if(_0x4bc161[_0x745e('0x2f')]!==_0x745e('0x40')){var _0xd9b18b={};_0xd9b18b[_0x4bc161['name']]={'$like':'%'+_0x462f64[_0x745e('0x33')]['filter']+'%'};return _0xd9b18b;}})});}_0x4f16d0=_['merge']({},_0x4f16d0,_0x462f64['options']);var _0x1f9225={'where':_0x4f16d0['where']};return db[_0x745e('0x2e')][_0x745e('0x1e')](_0x1f9225)[_0x745e('0x25')](function(_0x3eb364){_0x54dcf6['count']=_0x3eb364;if(_0x462f64[_0x745e('0x33')]['includeAll']){_0x4f16d0[_0x745e('0x41')]=[{'all':!![]}];}return db[_0x745e('0x2e')][_0x745e('0x42')](_0x4f16d0);})['then'](function(_0x5e43ed){_0x54dcf6[_0x745e('0x43')]=_0x5e43ed;return _0x54dcf6;})[_0x745e('0x25')](respondWithFilteredResult(_0x2157ad,_0x4f16d0))[_0x745e('0x44')](handleError(_0x2157ad,null));};exports[_0x745e('0x45')]=function(_0x1277e3,_0x380829){var _0x2ffefd={'raw':!![],'where':{'id':_0x1277e3[_0x745e('0x46')]['id']}},_0x181ffb={};_0x181ffb[_0x745e('0x31')]=_[_0x745e('0x34')](db[_0x745e('0x2e')][_0x745e('0x47')]);_0x181ffb[_0x745e('0x33')]=_[_0x745e('0x34')](_0x1277e3['query']);_0x181ffb[_0x745e('0x3b')]=_[_0x745e('0x35')](_0x181ffb[_0x745e('0x31')],_0x181ffb[_0x745e('0x33')]);_0x2ffefd[_0x745e('0x37')]=_[_0x745e('0x35')](_0x181ffb[_0x745e('0x31')],qs[_0x745e('0x36')](_0x1277e3[_0x745e('0x33')]['fields']));_0x2ffefd[_0x745e('0x37')]=_0x2ffefd[_0x745e('0x37')]['length']?_0x2ffefd[_0x745e('0x37')]:_0x181ffb[_0x745e('0x31')];if(_0x1277e3[_0x745e('0x33')][_0x745e('0x48')]){_0x2ffefd[_0x745e('0x41')]=[{'all':!![]}];}_0x2ffefd=_[_0x745e('0x3f')]({},_0x2ffefd,_0x1277e3[_0x745e('0x49')]);return db[_0x745e('0x2e')][_0x745e('0x4a')](_0x2ffefd)[_0x745e('0x25')](handleEntityNotFound(_0x380829,null))[_0x745e('0x25')](respondWithResult(_0x380829,null))[_0x745e('0x44')](handleError(_0x380829,null));};exports['create']=function(_0x2a7f2f,_0x48e2ad){return db[_0x745e('0x2e')]['create'](_0x2a7f2f[_0x745e('0x4b')],{})[_0x745e('0x25')](respondWithResult(_0x48e2ad,0xc9))[_0x745e('0x44')](handleError(_0x48e2ad,null));};exports[_0x745e('0x24')]=function(_0x1d7d7c,_0x3f6b72){if(_0x1d7d7c[_0x745e('0x4b')]['id']){delete _0x1d7d7c[_0x745e('0x4b')]['id'];}return db[_0x745e('0x2e')][_0x745e('0x4a')]({'where':{'id':_0x1d7d7c[_0x745e('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f6b72,null))[_0x745e('0x25')](saveUpdates(_0x1d7d7c[_0x745e('0x4b')],null))[_0x745e('0x25')](respondWithResult(_0x3f6b72,null))[_0x745e('0x44')](handleError(_0x3f6b72,null));};exports[_0x745e('0x26')]=function(_0x122de0,_0x575aa3){return db['ZohoField'][_0x745e('0x4a')]({'where':{'id':_0x122de0[_0x745e('0x46')]['id']}})[_0x745e('0x25')](handleEntityNotFound(_0x575aa3,null))[_0x745e('0x25')](removeEntity(_0x575aa3,null))[_0x745e('0x44')](handleError(_0x575aa3,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3506285..319b60c 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 _0xb091=['./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xb091,0x16e));var _0x1b09=function(_0x2e3989,_0x424829){_0x2e3989=_0x2e3989-0x0;var _0x8e4e42=_0xb091[_0x2e3989];return _0x8e4e42;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('ZohoField',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[{'name':_0x1b09('0x9'),'fields':[_0x1b09('0xa'),_0x1b09('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fdc=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x5fdc,0x127));var _0xc5fd=function(_0x22188d,_0x3bda68){_0x22188d=_0x22188d-0x0;var _0x5a9ae9=_0x5fdc[_0x22188d];return _0x5a9ae9;};'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')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xc5fd('0xd'),_0xc5fd('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 0a6165c..ede72f4 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 _0x7619=['http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x384d39,_0xf060fc){var _0x13bf22=function(_0x5d83f2){while(--_0x5d83f2){_0x384d39['push'](_0x384d39['shift']());}};_0x13bf22(++_0xf060fc);}(_0x7619,0x1bd));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9761('0x0'));var util=require('util');var moment=require(_0x9761('0x1'));var BPromise=require(_0x9761('0x2'));var rs=require(_0x9761('0x3'));var fs=require('fs');var Redis=require(_0x9761('0x4'));var db=require(_0x9761('0x5'))['db'];var utils=require(_0x9761('0x6'));var logger=require(_0x9761('0x7'))(_0x9761('0x8'));var config=require(_0x9761('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9761('0xa')][_0x9761('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a1475,_0x446cb6,_0x417d7d){return new BPromise(function(_0x522960,_0x4233c6){return client[_0x9761('0xc')](_0x2a1475,_0x417d7d)[_0x9761('0xd')](function(_0x54a295){logger['info'](_0x9761('0xe'),_0x446cb6,_0x9761('0xf'));logger[_0x9761('0x10')](_0x9761('0x11'),_0x446cb6,'request\x20sent',JSON[_0x9761('0x12')](_0x54a295));if(_0x54a295[_0x9761('0x13')]){if(_0x54a295[_0x9761('0x13')][_0x9761('0x14')]===0x1f4){logger[_0x9761('0x13')](_0x9761('0xe'),_0x446cb6,_0x54a295[_0x9761('0x13')]['message']);return _0x4233c6(_0x54a295[_0x9761('0x13')][_0x9761('0x15')]);}logger[_0x9761('0x13')](_0x9761('0xe'),_0x446cb6,_0x54a295[_0x9761('0x13')][_0x9761('0x15')]);return _0x522960(_0x54a295[_0x9761('0x13')][_0x9761('0x15')]);}else{logger[_0x9761('0x16')](_0x9761('0xe'),_0x446cb6,'request\x20sent');_0x522960(_0x54a295[_0x9761('0x17')]['message']);}})['catch'](function(_0x5b05cd){logger[_0x9761('0x13')](_0x9761('0xe'),_0x446cb6,_0x5b05cd);_0x4233c6(_0x5b05cd);});});} \ No newline at end of file +var _0xbe99=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbe99,0xe8));var _0x9be9=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0xbe99[_0x3b8ed6];return _0x2e6223;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require(_0x9be9('0x2'));var BPromise=require(_0x9be9('0x3'));var rs=require(_0x9be9('0x4'));var fs=require('fs');var Redis=require(_0x9be9('0x5'));var db=require(_0x9be9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9be9('0x7'));var config=require('../../config/environment');var jayson=require(_0x9be9('0x8'));var client=jayson[_0x9be9('0x9')][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf05f,_0x33bb8c,_0x32a317){return new BPromise(function(_0x17baa7,_0x2682ed){return client[_0x9be9('0xb')](_0xbf05f,_0x32a317)[_0x9be9('0xc')](function(_0x59b00f){logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x33bb8c,'request\x20sent');logger[_0x9be9('0xf')](_0x9be9('0x10'),_0x33bb8c,'request\x20sent',JSON[_0x9be9('0x11')](_0x59b00f));if(_0x59b00f[_0x9be9('0x12')]){if(_0x59b00f[_0x9be9('0x12')][_0x9be9('0x13')]===0x1f4){logger[_0x9be9('0x12')](_0x9be9('0xe'),_0x33bb8c,_0x59b00f[_0x9be9('0x12')]['message']);return _0x2682ed(_0x59b00f[_0x9be9('0x12')][_0x9be9('0x14')]);}logger[_0x9be9('0x12')]('ZohoField,\x20%s,\x20%s',_0x33bb8c,_0x59b00f['error'][_0x9be9('0x14')]);return _0x17baa7(_0x59b00f['error'][_0x9be9('0x14')]);}else{logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x33bb8c,'request\x20sent');_0x17baa7(_0x59b00f[_0x9be9('0x15')][_0x9be9('0x14')]);}})[_0x9be9('0x16')](function(_0xff72a3){logger[_0x9be9('0x12')](_0x9be9('0xe'),_0x33bb8c,_0xff72a3);_0x2682ed(_0xff72a3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3309e2a..dbad76d 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(_0x29d4ac,_0x32cb1d){var _0x37d3db=function(_0x3b22e6){while(--_0x3b22e6){_0x29d4ac['push'](_0x29d4ac['shift']());}};_0x37d3db(++_0x32cb1d);}(_0xe706,0xa3));var _0x6e70=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xe706[_0x4e5552];return _0x60a338;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x16b992,_0x43d74c){var _0x385c78=function(_0x5c904){while(--_0x5c904){_0x16b992['push'](_0x16b992['shift']());}};_0x385c78(++_0x43d74c);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 697ddcd..af5e005 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 _0x4ded=['STRING','unique_name_and_version','app.js','INTEGER','state','sequelize','exports'];(function(_0x3b2059,_0x351d9d){var _0x2c7c84=function(_0x456dbd){while(--_0x456dbd){_0x3b2059['push'](_0x3b2059['shift']());}};_0x2c7c84(++_0x351d9d);}(_0x4ded,0x116));var _0xd4de=function(_0x123f19,_0x48414b){_0x123f19=_0x123f19-0x0;var _0x143b20=_0x4ded[_0x123f19];return _0x143b20;};'use strict';var Sequelize=require(_0xd4de('0x0'));module[_0xd4de('0x1')]={'name':{'type':Sequelize[_0xd4de('0x2')],'allowNull':![],'unique':_0xd4de('0x3')},'version':{'type':Sequelize[_0xd4de('0x2')],'allowNull':![],'unique':_0xd4de('0x3')},'main':{'type':Sequelize[_0xd4de('0x2')],'defaultValue':_0xd4de('0x4')},'filename':{'type':Sequelize[_0xd4de('0x2')]},'path':{'type':Sequelize[_0xd4de('0x2')]},'type':{'type':Sequelize[_0xd4de('0x2')]},'size':{'type':Sequelize[_0xd4de('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd4de('0x2')]},'logo':{'type':Sequelize[_0xd4de('0x2')]},'state':{'type':Sequelize[_0xd4de('0x2')],'unique':_0xd4de('0x6')},'description':{'type':Sequelize[_0xd4de('0x2')]},'title':{'type':Sequelize[_0xd4de('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd4de('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x6759=['unique_name_and_version','STRING','INTEGER','BOOLEAN','state','exports'];(function(_0x4a361c,_0x5233c9){var _0x3a373c=function(_0x3be1ca){while(--_0x3be1ca){_0x4a361c['push'](_0x4a361c['shift']());}};_0x3a373c(++_0x5233c9);}(_0x6759,0x10d));var _0x9675=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0x6759[_0x1945a5];return _0x5817a5;};'use strict';var Sequelize=require('sequelize');module[_0x9675('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9675('0x1')},'version':{'type':Sequelize[_0x9675('0x2')],'allowNull':![],'unique':_0x9675('0x1')},'main':{'type':Sequelize[_0x9675('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x9675('0x2')]},'path':{'type':Sequelize[_0x9675('0x2')]},'type':{'type':Sequelize[_0x9675('0x2')]},'size':{'type':Sequelize[_0x9675('0x3')]},'active':{'type':Sequelize[_0x9675('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9675('0x2')],'unique':_0x9675('0x5')},'description':{'type':Sequelize[_0x9675('0x2')]},'title':{'type':Sequelize[_0x9675('0x2')]},'remoteUri':{'type':Sequelize[_0x9675('0x2')]},'link':{'type':Sequelize[_0x9675('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 076a113..b35ed3e 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 _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x4c60,0xc1));var _0x04c6=function(_0x117ce3,_0x4e9bd3){_0x117ce3=_0x117ce3-0x0;var _0x48ece1=_0x4c60[_0x117ce3];return _0x48ece1;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));}; \ No newline at end of file +var _0x33af=['merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where'];(function(_0x3cbfcc,_0x56b4c6){var _0x5d93a7=function(_0x40e008){while(--_0x40e008){_0x3cbfcc['push'](_0x3cbfcc['shift']());}};_0x5d93a7(++_0x56b4c6);}(_0x33af,0xec));var _0xf33a=function(_0x128239,_0x30a688){_0x128239=_0x128239-0x0;var _0x5543df=_0x33af[_0x128239];return _0x5543df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['Integration'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 6e05b54..706944f 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 _0x09f5=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','integrations','lodash'];(function(_0x19103c,_0x271a1c){var _0x3313d1=function(_0x174ba5){while(--_0x174ba5){_0x19103c['push'](_0x19103c['shift']());}};_0x3313d1(++_0x271a1c);}(_0x09f5,0x18b));var _0x509f=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x09f5[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0x509f('0x0'));var util=require(_0x509f('0x1'));var logger=require(_0x509f('0x2'))('api');var moment=require(_0x509f('0x3'));var BPromise=require(_0x509f('0x4'));var rp=require(_0x509f('0x5'));var fs=require('fs');var path=require(_0x509f('0x6'));var rimraf=require('rimraf');var config=require(_0x509f('0x7'));var attributes=require(_0x509f('0x8'));module[_0x509f('0x9')]=function(_0xd10603,_0x1a081e){return _0xd10603[_0x509f('0xa')]('Integration',attributes,{'tableName':_0x509f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b8=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integration.attributes','Integration'];(function(_0xa35eb5,_0xc91775){var _0x4371f7=function(_0x589ab5){while(--_0x589ab5){_0xa35eb5['push'](_0xa35eb5['shift']());}};_0x4371f7(++_0xc91775);}(_0xc9b8,0x96));var _0x8c9b=function(_0x3a4b2e,_0x358014){_0x3a4b2e=_0x3a4b2e-0x0;var _0x6075bf=_0xc9b8[_0x3a4b2e];return _0x6075bf;};'use strict';var _=require(_0x8c9b('0x0'));var util=require('util');var logger=require(_0x8c9b('0x1'))(_0x8c9b('0x2'));var moment=require(_0x8c9b('0x3'));var BPromise=require(_0x8c9b('0x4'));var rp=require(_0x8c9b('0x5'));var fs=require('fs');var path=require(_0x8c9b('0x6'));var rimraf=require(_0x8c9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x8c9b('0x8'));module['exports']=function(_0x2d1fee,_0x5b3d9b){return _0x2d1fee['define'](_0x8c9b('0x9'),attributes,{'tableName':'integrations','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 576dfc3..67afaea 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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x48e885,_0x1b7f8a){var _0x3830a4=function(_0x27a583){while(--_0x27a583){_0x48e885['push'](_0x48e885['shift']());}};_0x3830a4(++_0x1b7f8a);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x54becc,_0x5190d5){_0x54becc=_0x54becc-0x0;var _0x44e064=_0xd7d1[_0x54becc];return _0x44e064;};'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']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\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);});});} \ No newline at end of file +var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x1fae9a,_0x3e2a48){var _0x461de5=function(_0x4967bb){while(--_0x4967bb){_0x1fae9a['push'](_0x1fae9a['shift']());}};_0x461de5(++_0x3e2a48);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 433882b..d2ecf70 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x66fa,0x117));var _0xa66f=function(_0x193137,_0x3c6011){_0x193137=_0x193137-0x0;var _0xf34e4f=_0x66fa[_0x193137];return _0xf34e4f;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xd943,0x15d));var _0x3d94=function(_0x1bd0dc,_0x585eaa){_0x1bd0dc=_0x1bd0dc-0x0;var _0xf99d8e=_0xd943[_0x1bd0dc];return _0xf99d8e;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index bab7b9e..2019328 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 _0x83d2=['RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x83d2,0xb6));var _0x283d=function(_0x29c46d,_0xd95b49){_0x29c46d=_0x29c46d-0x0;var _0x4f83a4=_0x83d2[_0x29c46d];return _0x4f83a4;};'use strict';var Sequelize=require('sequelize');module[_0x283d('0x0')]={'integration':{'type':Sequelize[_0x283d('0x1')]},'eventChannel':{'type':Sequelize[_0x283d('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x283d('0x1')]},'integrationId':{'type':Sequelize[_0x283d('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x283d('0x1')]},'calleridnum':{'type':Sequelize[_0x283d('0x1')]},'calleridname':{'type':Sequelize[_0x283d('0x1')]},'queue':{'type':Sequelize[_0x283d('0x1')]},'interface':{'type':Sequelize[_0x283d('0x1')]},'membername':{'type':Sequelize[_0x283d('0x1')]},'agentcalledAt':{'type':Sequelize[_0x283d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x283d('0x3')]},'holdtime':{'type':Sequelize[_0x283d('0x2')]},'agentcomplete':{'type':Sequelize[_0x283d('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x283d('0x3')]},'talktime':{'type':Sequelize[_0x283d('0x2')]},'agentacw':{'type':Sequelize[_0x283d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x283d('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x283d('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x283d('0x3')]},'agentdump':{'type':Sequelize[_0x283d('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x283d('0x3')]},'lastevent':{'type':Sequelize[_0x283d('0x1')]},'channel':{'type':Sequelize[_0x283d('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x283d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x283d('0x1')]},'connectedlinename':{'type':Sequelize[_0x283d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x283d('0x1')]},'context':{'type':Sequelize[_0x283d('0x1')]},'exten':{'type':Sequelize[_0x283d('0x1')]},'priority':{'type':Sequelize[_0x283d('0x1')]},'destchannel':{'type':Sequelize[_0x283d('0x1')]},'destchannelstate':{'type':Sequelize[_0x283d('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x283d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x283d('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x283d('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x283d('0x1')]},'destpriority':{'type':Sequelize[_0x283d('0x1')]},'destuniqueid':{'type':Sequelize[_0x283d('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x283d('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x283d('0x1')]},'cc':{'type':Sequelize[_0x283d('0x1')]},'attachment':{'type':Sequelize[_0x283d('0x5')]},'html':{'type':Sequelize[_0x283d('0x5')]},'text':{'type':Sequelize[_0x283d('0x5')]},'status':{'type':Sequelize['ENUM'](_0x283d('0x6'),_0x283d('0x7'),_0x283d('0x8'),_0x283d('0x9'))},'url':{'type':Sequelize[_0x283d('0x1')]},'app':{'type':Sequelize[_0x283d('0x1')]},'appdata':{'type':Sequelize[_0x283d('0x1')]},'projectId':{'type':Sequelize[_0x283d('0x2')]}}; \ No newline at end of file +var _0x822e=['RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x822e,0xf2));var _0xe822=function(_0x539dd2,_0x3fb9eb){_0x539dd2=_0x539dd2-0x0;var _0x2168ff=_0x822e[_0x539dd2];return _0x2168ff;};'use strict';var Sequelize=require(_0xe822('0x0'));module[_0xe822('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xe822('0x2')]},'exitStatus':{'type':Sequelize[_0xe822('0x2')]},'ticketId':{'type':Sequelize[_0xe822('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe822('0x2')]},'calleridnum':{'type':Sequelize[_0xe822('0x2')]},'calleridname':{'type':Sequelize[_0xe822('0x2')]},'queue':{'type':Sequelize[_0xe822('0x2')]},'interface':{'type':Sequelize[_0xe822('0x2')]},'membername':{'type':Sequelize[_0xe822('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe822('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xe822('0x4')]},'agentcomplete':{'type':Sequelize[_0xe822('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe822('0x3')]},'talktime':{'type':Sequelize[_0xe822('0x4')]},'agentacw':{'type':Sequelize[_0xe822('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe822('0x4')]},'reason':{'type':Sequelize[_0xe822('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xe822('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe822('0x3')]},'agentdump':{'type':Sequelize[_0xe822('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe822('0x3')]},'lastevent':{'type':Sequelize[_0xe822('0x2')]},'channel':{'type':Sequelize[_0xe822('0x2')]},'channelstate':{'type':Sequelize[_0xe822('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe822('0x2')]},'language':{'type':Sequelize[_0xe822('0x2')]},'accountcode':{'type':Sequelize[_0xe822('0x2')]},'context':{'type':Sequelize[_0xe822('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe822('0x2')]},'destchannel':{'type':Sequelize[_0xe822('0x2')]},'destchannelstate':{'type':Sequelize[_0xe822('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe822('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe822('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe822('0x2')]},'destlanguage':{'type':Sequelize[_0xe822('0x2')]},'destaccountcode':{'type':Sequelize[_0xe822('0x2')]},'destcontext':{'type':Sequelize[_0xe822('0x2')]},'destexten':{'type':Sequelize[_0xe822('0x2')]},'destpriority':{'type':Sequelize[_0xe822('0x2')]},'destuniqueid':{'type':Sequelize[_0xe822('0x2')]},'messageId':{'type':Sequelize[_0xe822('0x2')]},'inReplyTo':{'type':Sequelize[_0xe822('0x2')]},'subject':{'type':Sequelize[_0xe822('0x2')]},'from':{'type':Sequelize[_0xe822('0x2')]},'to':{'type':Sequelize[_0xe822('0x2')]},'cc':{'type':Sequelize[_0xe822('0x2')]},'attachment':{'type':Sequelize[_0xe822('0x6')]},'html':{'type':Sequelize[_0xe822('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xe822('0x7')](_0xe822('0x8'),_0xe822('0x9'),_0xe822('0xa'),_0xe822('0xb'))},'url':{'type':Sequelize[_0xe822('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xe822('0x2')]},'projectId':{'type':Sequelize[_0xe822('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c5b8daf..cf172e8 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 _0xe5cf=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','IntegrationReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0xe5cf,0xe4));var _0xfe5c=function(_0x106fd3,_0x50cddb){_0x106fd3=_0x106fd3-0x0;var _0x3422f9=_0xe5cf[_0x106fd3];return _0x3422f9;};'use strict';var emlformat=require(_0xfe5c('0x0'));var rimraf=require(_0xfe5c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe5c('0x2'));var rp=require(_0xfe5c('0x3'));var moment=require(_0xfe5c('0x4'));var BPromise=require(_0xfe5c('0x5'));var Mustache=require(_0xfe5c('0x6'));var util=require(_0xfe5c('0x7'));var path=require(_0xfe5c('0x8'));var sox=require('sox');var csv=require(_0xfe5c('0x9'));var ejs=require(_0xfe5c('0xa'));var fs=require('fs');var fs_extra=require(_0xfe5c('0xb'));var _=require(_0xfe5c('0xc'));var squel=require(_0xfe5c('0xd'));var crypto=require(_0xfe5c('0xe'));var jsforce=require(_0xfe5c('0xf'));var deskjs=require(_0xfe5c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfe5c('0x11'));var Papa=require(_0xfe5c('0x12'));var Redis=require('ioredis');var authService=require(_0xfe5c('0x13'));var qs=require(_0xfe5c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5c('0x15'));var logger=require(_0xfe5c('0x16'))(_0xfe5c('0x17'));var utils=require(_0xfe5c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfe5c('0x19'));var db=require(_0xfe5c('0x1a'))['db'];function respondWithStatusCode(_0x3620db,_0x2bde68){_0x2bde68=_0x2bde68||0xcc;return function(_0x5e55d8){if(_0x5e55d8){return _0x3620db[_0xfe5c('0x1b')](_0x2bde68);}return _0x3620db[_0xfe5c('0x1c')](_0x2bde68)[_0xfe5c('0x1d')]();};}function respondWithResult(_0x567ef1,_0x2b0707){_0x2b0707=_0x2b0707||0xc8;return function(_0x568e60){if(_0x568e60){return _0x567ef1['status'](_0x2b0707)[_0xfe5c('0x1e')](_0x568e60);}};}function respondWithFilteredResult(_0x22cd99,_0x5382c6){return function(_0x5a9dad){if(_0x5a9dad){var _0x1ced60=typeof _0x5382c6[_0xfe5c('0x1f')]===_0xfe5c('0x20')&&typeof _0x5382c6[_0xfe5c('0x21')]===_0xfe5c('0x20');var _0x277af9=_0x5a9dad['count'];var _0x1b4296=_0x1ced60?0x0:_0x5382c6['offset'];var _0x2a3d49=_0x1ced60?_0x5a9dad[_0xfe5c('0x22')]:_0x5382c6['offset']+_0x5382c6['limit'];var _0x34704e;if(_0x2a3d49>=_0x277af9){_0x2a3d49=_0x277af9;_0x34704e=0xc8;}else{_0x34704e=0xce;}_0x22cd99[_0xfe5c('0x1c')](_0x34704e);return _0x22cd99[_0xfe5c('0x23')](_0xfe5c('0x24'),_0x1b4296+'-'+_0x2a3d49+'/'+_0x277af9)[_0xfe5c('0x1e')](_0x5a9dad);}return null;};}function patchUpdates(_0x28221a){return function(_0x5915e4){try{jsonpatch[_0xfe5c('0x25')](_0x5915e4,_0x28221a,!![]);}catch(_0x12b552){return BPromise[_0xfe5c('0x26')](_0x12b552);}return _0x5915e4[_0xfe5c('0x27')]();};}function saveUpdates(_0xd8fb68,_0x48698e){return function(_0xc6243){if(_0xc6243){return _0xc6243[_0xfe5c('0x28')](_0xd8fb68)[_0xfe5c('0x29')](function(_0x5ba90d){return _0x5ba90d;});}return null;};}function removeEntity(_0x1e7da1,_0x5b6715){return function(_0x4b18ed){if(_0x4b18ed){return _0x4b18ed['destroy']()[_0xfe5c('0x29')](function(){_0x1e7da1[_0xfe5c('0x1c')](0xcc)[_0xfe5c('0x1d')]();});}};}function handleEntityNotFound(_0x12699e,_0x1e3674){return function(_0x16e41b){if(!_0x16e41b){_0x12699e[_0xfe5c('0x1b')](0x194);}return _0x16e41b;};}function handleError(_0x348d63,_0x458af0){_0x458af0=_0x458af0||0x1f4;return function(_0x3ead72){logger[_0xfe5c('0x2a')](_0x3ead72['stack']);if(_0x3ead72[_0xfe5c('0x2b')]){delete _0x3ead72[_0xfe5c('0x2b')];}_0x348d63[_0xfe5c('0x1c')](_0x458af0)[_0xfe5c('0x2c')](_0x3ead72);};}exports[_0xfe5c('0x2d')]=function(_0x51528a,_0x130cce){var _0x4252c0={},_0x5a9a50={},_0x3e96bb={'count':0x0,'rows':[]};var _0x34a622=_['map'](db[_0xfe5c('0x2e')][_0xfe5c('0x2f')],function(_0x64a718){return{'name':_0x64a718[_0xfe5c('0x30')],'type':_0x64a718['type'][_0xfe5c('0x31')]};});_0x5a9a50['model']=_['map'](_0x34a622,'name');_0x5a9a50['query']=_[_0xfe5c('0x32')](_0x51528a[_0xfe5c('0x33')]);_0x5a9a50[_0xfe5c('0x34')]=_[_0xfe5c('0x35')](_0x5a9a50[_0xfe5c('0x36')],_0x5a9a50['query']);_0x4252c0['attributes']=_[_0xfe5c('0x35')](_0x5a9a50[_0xfe5c('0x36')],qs['fields'](_0x51528a['query']['fields']));_0x4252c0[_0xfe5c('0x37')]=_0x4252c0[_0xfe5c('0x37')]['length']?_0x4252c0[_0xfe5c('0x37')]:_0x5a9a50['model'];if(!_0x51528a[_0xfe5c('0x33')][_0xfe5c('0x38')]('nolimit')){_0x4252c0['limit']=qs[_0xfe5c('0x21')](_0x51528a[_0xfe5c('0x33')][_0xfe5c('0x21')]);_0x4252c0[_0xfe5c('0x1f')]=qs[_0xfe5c('0x1f')](_0x51528a[_0xfe5c('0x33')][_0xfe5c('0x1f')]);}_0x4252c0[_0xfe5c('0x39')]=qs[_0xfe5c('0x3a')](_0x51528a[_0xfe5c('0x33')][_0xfe5c('0x3a')]);_0x4252c0[_0xfe5c('0x3b')]=qs[_0xfe5c('0x34')](_['pick'](_0x51528a['query'],_0x5a9a50[_0xfe5c('0x34')]),_0x34a622);if(_0x51528a['query'][_0xfe5c('0x3c')]){_0x4252c0[_0xfe5c('0x3b')]=_[_0xfe5c('0x3d')](_0x4252c0[_0xfe5c('0x3b')],{'$or':_[_0xfe5c('0x3e')](_0x34a622,function(_0x5a2b0d){if(_0x5a2b0d[_0xfe5c('0x3f')]!==_0xfe5c('0x40')){var _0x52f262={};_0x52f262[_0x5a2b0d[_0xfe5c('0x2b')]]={'$like':'%'+_0x51528a[_0xfe5c('0x33')]['filter']+'%'};return _0x52f262;}})});}_0x4252c0=_[_0xfe5c('0x3d')]({},_0x4252c0,_0x51528a[_0xfe5c('0x41')]);var _0x53de1d={'where':_0x4252c0[_0xfe5c('0x3b')]};return db['IntegrationReport'][_0xfe5c('0x22')](_0x53de1d)[_0xfe5c('0x29')](function(_0x5e0ef4){_0x3e96bb['count']=_0x5e0ef4;if(_0x51528a[_0xfe5c('0x33')][_0xfe5c('0x42')]){_0x4252c0[_0xfe5c('0x43')]=[{'all':!![]}];}return db[_0xfe5c('0x2e')]['findAll'](_0x4252c0);})[_0xfe5c('0x29')](function(_0x2ca404){_0x3e96bb[_0xfe5c('0x44')]=_0x2ca404;return _0x3e96bb;})['then'](respondWithFilteredResult(_0x130cce,_0x4252c0))[_0xfe5c('0x45')](handleError(_0x130cce,null));};exports[_0xfe5c('0x46')]=function(_0x1b2f6c,_0x1c5413){var _0x28db4f={'raw':![],'where':{'id':_0x1b2f6c[_0xfe5c('0x47')]['id']}},_0x20953d={};_0x20953d[_0xfe5c('0x36')]=_[_0xfe5c('0x32')](db[_0xfe5c('0x2e')][_0xfe5c('0x2f')]);_0x20953d[_0xfe5c('0x33')]=_[_0xfe5c('0x32')](_0x1b2f6c[_0xfe5c('0x33')]);_0x20953d[_0xfe5c('0x34')]=_[_0xfe5c('0x35')](_0x20953d[_0xfe5c('0x36')],_0x20953d[_0xfe5c('0x33')]);_0x28db4f['attributes']=_['intersection'](_0x20953d[_0xfe5c('0x36')],qs[_0xfe5c('0x48')](_0x1b2f6c[_0xfe5c('0x33')][_0xfe5c('0x48')]));_0x28db4f[_0xfe5c('0x37')]=_0x28db4f['attributes'][_0xfe5c('0x49')]?_0x28db4f['attributes']:_0x20953d[_0xfe5c('0x36')];if(_0x1b2f6c[_0xfe5c('0x33')][_0xfe5c('0x42')]){_0x28db4f[_0xfe5c('0x43')]=[{'all':!![]}];}_0x28db4f=_[_0xfe5c('0x3d')]({},_0x28db4f,_0x1b2f6c[_0xfe5c('0x41')]);return db[_0xfe5c('0x2e')][_0xfe5c('0x4a')](_0x28db4f)[_0xfe5c('0x29')](handleEntityNotFound(_0x1c5413,null))[_0xfe5c('0x29')](respondWithResult(_0x1c5413,null))['catch'](handleError(_0x1c5413,null));};exports[_0xfe5c('0x4b')]=function(_0x49100a,_0xdd2104){return db[_0xfe5c('0x2e')][_0xfe5c('0x4b')](_0x49100a['body'],{})[_0xfe5c('0x29')](respondWithResult(_0xdd2104,0xc9))[_0xfe5c('0x45')](handleError(_0xdd2104,null));};exports[_0xfe5c('0x28')]=function(_0x4d47dc,_0x338472){if(_0x4d47dc[_0xfe5c('0x4c')]['id']){delete _0x4d47dc[_0xfe5c('0x4c')]['id'];}return db[_0xfe5c('0x2e')][_0xfe5c('0x4a')]({'where':{'id':_0x4d47dc[_0xfe5c('0x47')]['id']}})[_0xfe5c('0x29')](handleEntityNotFound(_0x338472,null))['then'](saveUpdates(_0x4d47dc[_0xfe5c('0x4c')],null))['then'](respondWithResult(_0x338472,null))[_0xfe5c('0x45')](handleError(_0x338472,null));};exports[_0xfe5c('0x4d')]=function(_0x29d1dd,_0x4cd2bc){return db['IntegrationReport'][_0xfe5c('0x4a')]({'where':{'id':_0x29d1dd[_0xfe5c('0x47')]['id']}})[_0xfe5c('0x29')](handleEntityNotFound(_0x4cd2bc,null))['then'](removeEntity(_0x4cd2bc,null))[_0xfe5c('0x45')](handleError(_0x4cd2bc,null));};exports[_0xfe5c('0x4e')]=function(_0x4eea74,_0x435bc6){return db[_0xfe5c('0x2e')]['describe']()['then'](respondWithResult(_0x435bc6,null))[_0xfe5c('0x45')](handleError(_0x435bc6,null));}; \ No newline at end of file +var _0xaeba=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','then','rows','catch','options','create','body','update','params','destroy','describe','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','count','limit','set','apply','save','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xaeba,0x6a));var _0xaaeb=function(_0x39f3d9,_0x5943ab){_0x39f3d9=_0x39f3d9-0x0;var _0x58660a=_0xaeba[_0x39f3d9];return _0x58660a;};'use strict';var emlformat=require(_0xaaeb('0x0'));var rimraf=require(_0xaaeb('0x1'));var zipdir=require(_0xaaeb('0x2'));var jsonpatch=require(_0xaaeb('0x3'));var rp=require(_0xaaeb('0x4'));var moment=require(_0xaaeb('0x5'));var BPromise=require(_0xaaeb('0x6'));var Mustache=require(_0xaaeb('0x7'));var util=require(_0xaaeb('0x8'));var path=require(_0xaaeb('0x9'));var sox=require(_0xaaeb('0xa'));var csv=require('to-csv');var ejs=require(_0xaaeb('0xb'));var fs=require('fs');var fs_extra=require(_0xaaeb('0xc'));var _=require(_0xaaeb('0xd'));var squel=require(_0xaaeb('0xe'));var crypto=require(_0xaaeb('0xf'));var jsforce=require(_0xaaeb('0x10'));var deskjs=require(_0xaaeb('0x11'));var toCsv=require(_0xaaeb('0x12'));var querystring=require('querystring');var Papa=require(_0xaaeb('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaaeb('0x14'));var as=require(_0xaaeb('0x15'));var hardwareService=require(_0xaaeb('0x16'));var logger=require('../../config/logger')(_0xaaeb('0x17'));var utils=require(_0xaaeb('0x18'));var config=require(_0xaaeb('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485faf,_0x497166){_0x497166=_0x497166||0xcc;return function(_0x40c1e8){if(_0x40c1e8){return _0x485faf[_0xaaeb('0x1a')](_0x497166);}return _0x485faf[_0xaaeb('0x1b')](_0x497166)['end']();};}function respondWithResult(_0x2ca675,_0x2941ec){_0x2941ec=_0x2941ec||0xc8;return function(_0x3a2d97){if(_0x3a2d97){return _0x2ca675[_0xaaeb('0x1b')](_0x2941ec)[_0xaaeb('0x1c')](_0x3a2d97);}};}function respondWithFilteredResult(_0x53aa19,_0x3df238){return function(_0x376391){if(_0x376391){var _0x1507db=typeof _0x3df238[_0xaaeb('0x1d')]==='undefined'&&typeof _0x3df238['limit']==='undefined';var _0x463b74=_0x376391[_0xaaeb('0x1e')];var _0x11b5d3=_0x1507db?0x0:_0x3df238[_0xaaeb('0x1d')];var _0x530cf7=_0x1507db?_0x376391[_0xaaeb('0x1e')]:_0x3df238[_0xaaeb('0x1d')]+_0x3df238[_0xaaeb('0x1f')];var _0x4715f1;if(_0x530cf7>=_0x463b74){_0x530cf7=_0x463b74;_0x4715f1=0xc8;}else{_0x4715f1=0xce;}_0x53aa19[_0xaaeb('0x1b')](_0x4715f1);return _0x53aa19[_0xaaeb('0x20')]('Content-Range',_0x11b5d3+'-'+_0x530cf7+'/'+_0x463b74)[_0xaaeb('0x1c')](_0x376391);}return null;};}function patchUpdates(_0x5c1c24){return function(_0x1fff0f){try{jsonpatch[_0xaaeb('0x21')](_0x1fff0f,_0x5c1c24,!![]);}catch(_0x50ba54){return BPromise['reject'](_0x50ba54);}return _0x1fff0f[_0xaaeb('0x22')]();};}function saveUpdates(_0x5eaab4,_0x2602df){return function(_0x35b278){if(_0x35b278){return _0x35b278['update'](_0x5eaab4)['then'](function(_0x5f4bab){return _0x5f4bab;});}return null;};}function removeEntity(_0x4a77ce,_0x26a160){return function(_0x2538f9){if(_0x2538f9){return _0x2538f9['destroy']()['then'](function(){_0x4a77ce[_0xaaeb('0x1b')](0xcc)[_0xaaeb('0x23')]();});}};}function handleEntityNotFound(_0xadbef8,_0x14f68f){return function(_0x23af02){if(!_0x23af02){_0xadbef8['sendStatus'](0x194);}return _0x23af02;};}function handleError(_0x3dd66e,_0x45b4ce){_0x45b4ce=_0x45b4ce||0x1f4;return function(_0x1213f5){logger[_0xaaeb('0x24')](_0x1213f5[_0xaaeb('0x25')]);if(_0x1213f5[_0xaaeb('0x26')]){delete _0x1213f5[_0xaaeb('0x26')];}_0x3dd66e['status'](_0x45b4ce)[_0xaaeb('0x27')](_0x1213f5);};}exports[_0xaaeb('0x28')]=function(_0x4267c9,_0x4ab361){var _0x1ecd50={},_0x19c68f={},_0x2e5f9c={'count':0x0,'rows':[]};var _0x3e171d=_[_0xaaeb('0x29')](db['IntegrationReport'][_0xaaeb('0x2a')],function(_0x25be72){return{'name':_0x25be72[_0xaaeb('0x2b')],'type':_0x25be72[_0xaaeb('0x2c')][_0xaaeb('0x2d')]};});_0x19c68f[_0xaaeb('0x2e')]=_[_0xaaeb('0x29')](_0x3e171d,'name');_0x19c68f[_0xaaeb('0x2f')]=_[_0xaaeb('0x30')](_0x4267c9[_0xaaeb('0x2f')]);_0x19c68f[_0xaaeb('0x31')]=_[_0xaaeb('0x32')](_0x19c68f['model'],_0x19c68f[_0xaaeb('0x2f')]);_0x1ecd50[_0xaaeb('0x33')]=_['intersection'](_0x19c68f[_0xaaeb('0x2e')],qs[_0xaaeb('0x34')](_0x4267c9[_0xaaeb('0x2f')][_0xaaeb('0x34')]));_0x1ecd50[_0xaaeb('0x33')]=_0x1ecd50[_0xaaeb('0x33')][_0xaaeb('0x35')]?_0x1ecd50['attributes']:_0x19c68f[_0xaaeb('0x2e')];if(!_0x4267c9[_0xaaeb('0x2f')][_0xaaeb('0x36')](_0xaaeb('0x37'))){_0x1ecd50['limit']=qs[_0xaaeb('0x1f')](_0x4267c9['query']['limit']);_0x1ecd50[_0xaaeb('0x1d')]=qs['offset'](_0x4267c9[_0xaaeb('0x2f')][_0xaaeb('0x1d')]);}_0x1ecd50[_0xaaeb('0x38')]=qs[_0xaaeb('0x39')](_0x4267c9[_0xaaeb('0x2f')][_0xaaeb('0x39')]);_0x1ecd50[_0xaaeb('0x3a')]=qs[_0xaaeb('0x31')](_[_0xaaeb('0x3b')](_0x4267c9[_0xaaeb('0x2f')],_0x19c68f[_0xaaeb('0x31')]),_0x3e171d);if(_0x4267c9['query'][_0xaaeb('0x3c')]){_0x1ecd50['where']=_[_0xaaeb('0x3d')](_0x1ecd50[_0xaaeb('0x3a')],{'$or':_[_0xaaeb('0x29')](_0x3e171d,function(_0x43c7b5){if(_0x43c7b5[_0xaaeb('0x2c')]!==_0xaaeb('0x3e')){var _0x3d5691={};_0x3d5691[_0x43c7b5['name']]={'$like':'%'+_0x4267c9[_0xaaeb('0x2f')]['filter']+'%'};return _0x3d5691;}})});}_0x1ecd50=_[_0xaaeb('0x3d')]({},_0x1ecd50,_0x4267c9['options']);var _0x51467a={'where':_0x1ecd50['where']};return db[_0xaaeb('0x3f')][_0xaaeb('0x1e')](_0x51467a)['then'](function(_0x121560){_0x2e5f9c['count']=_0x121560;if(_0x4267c9[_0xaaeb('0x2f')][_0xaaeb('0x40')]){_0x1ecd50[_0xaaeb('0x41')]=[{'all':!![]}];}return db[_0xaaeb('0x3f')][_0xaaeb('0x42')](_0x1ecd50);})[_0xaaeb('0x43')](function(_0xc3a02b){_0x2e5f9c[_0xaaeb('0x44')]=_0xc3a02b;return _0x2e5f9c;})[_0xaaeb('0x43')](respondWithFilteredResult(_0x4ab361,_0x1ecd50))[_0xaaeb('0x45')](handleError(_0x4ab361,null));};exports['show']=function(_0x3f6a36,_0xdb9466){var _0x12033f={'raw':![],'where':{'id':_0x3f6a36['params']['id']}},_0x15bafb={};_0x15bafb[_0xaaeb('0x2e')]=_[_0xaaeb('0x30')](db[_0xaaeb('0x3f')]['rawAttributes']);_0x15bafb[_0xaaeb('0x2f')]=_[_0xaaeb('0x30')](_0x3f6a36[_0xaaeb('0x2f')]);_0x15bafb[_0xaaeb('0x31')]=_['intersection'](_0x15bafb['model'],_0x15bafb[_0xaaeb('0x2f')]);_0x12033f['attributes']=_[_0xaaeb('0x32')](_0x15bafb[_0xaaeb('0x2e')],qs[_0xaaeb('0x34')](_0x3f6a36[_0xaaeb('0x2f')][_0xaaeb('0x34')]));_0x12033f[_0xaaeb('0x33')]=_0x12033f['attributes'][_0xaaeb('0x35')]?_0x12033f['attributes']:_0x15bafb[_0xaaeb('0x2e')];if(_0x3f6a36[_0xaaeb('0x2f')][_0xaaeb('0x40')]){_0x12033f[_0xaaeb('0x41')]=[{'all':!![]}];}_0x12033f=_[_0xaaeb('0x3d')]({},_0x12033f,_0x3f6a36[_0xaaeb('0x46')]);return db[_0xaaeb('0x3f')]['find'](_0x12033f)[_0xaaeb('0x43')](handleEntityNotFound(_0xdb9466,null))[_0xaaeb('0x43')](respondWithResult(_0xdb9466,null))['catch'](handleError(_0xdb9466,null));};exports[_0xaaeb('0x47')]=function(_0x37ca6e,_0x28fe38){return db[_0xaaeb('0x3f')][_0xaaeb('0x47')](_0x37ca6e[_0xaaeb('0x48')],{})[_0xaaeb('0x43')](respondWithResult(_0x28fe38,0xc9))[_0xaaeb('0x45')](handleError(_0x28fe38,null));};exports[_0xaaeb('0x49')]=function(_0xab270,_0x543014){if(_0xab270[_0xaaeb('0x48')]['id']){delete _0xab270[_0xaaeb('0x48')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0xab270[_0xaaeb('0x4a')]['id']}})[_0xaaeb('0x43')](handleEntityNotFound(_0x543014,null))[_0xaaeb('0x43')](saveUpdates(_0xab270[_0xaaeb('0x48')],null))[_0xaaeb('0x43')](respondWithResult(_0x543014,null))[_0xaaeb('0x45')](handleError(_0x543014,null));};exports[_0xaaeb('0x4b')]=function(_0x2df70f,_0x388485){return db['IntegrationReport']['find']({'where':{'id':_0x2df70f['params']['id']}})[_0xaaeb('0x43')](handleEntityNotFound(_0x388485,null))['then'](removeEntity(_0x388485,null))[_0xaaeb('0x45')](handleError(_0x388485,null));};exports[_0xaaeb('0x4c')]=function(_0x400418,_0x3b0730){return db[_0xaaeb('0x3f')][_0xaaeb('0x4c')]()[_0xaaeb('0x43')](respondWithResult(_0x3b0730,null))[_0xaaeb('0x45')](handleError(_0x3b0730,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 7811d5b..885a136 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 _0xcd19=['moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','api'];(function(_0x237e94,_0x416d08){var _0x3f6126=function(_0x46aab8){while(--_0x46aab8){_0x237e94['push'](_0x237e94['shift']());}};_0x3f6126(++_0x416d08);}(_0xcd19,0x190));var _0x9cd1=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xcd19[_0x1fdb40];return _0x281f93;};'use strict';var _=require(_0x9cd1('0x0'));var util=require(_0x9cd1('0x1'));var logger=require('../../config/logger')(_0x9cd1('0x2'));var moment=require(_0x9cd1('0x3'));var BPromise=require(_0x9cd1('0x4'));var rp=require(_0x9cd1('0x5'));var fs=require('fs');var path=require(_0x9cd1('0x6'));var rimraf=require('rimraf');var config=require(_0x9cd1('0x7'));var attributes=require(_0x9cd1('0x8'));module[_0x9cd1('0x9')]=function(_0x4e5246,_0x370f43){return _0x4e5246[_0x9cd1('0xa')](_0x9cd1('0xb'),attributes,{'tableName':_0x9cd1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d16=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x49481d,_0xd95b74){var _0x27dd6e=function(_0xee3740){while(--_0xee3740){_0x49481d['push'](_0x49481d['shift']());}};_0x27dd6e(++_0xd95b74);}(_0x1d16,0x7b));var _0x61d1=function(_0x25c5a4,_0x1922b9){_0x25c5a4=_0x25c5a4-0x0;var _0x3f191b=_0x1d16[_0x25c5a4];return _0x3f191b;};'use strict';var _=require(_0x61d1('0x0'));var util=require('util');var logger=require(_0x61d1('0x1'))(_0x61d1('0x2'));var moment=require(_0x61d1('0x3'));var BPromise=require(_0x61d1('0x4'));var rp=require(_0x61d1('0x5'));var fs=require('fs');var path=require(_0x61d1('0x6'));var rimraf=require(_0x61d1('0x7'));var config=require(_0x61d1('0x8'));var attributes=require('./integrationReport.attributes');module[_0x61d1('0x9')]=function(_0x2e0686,_0x34affc){return _0x2e0686[_0x61d1('0xa')](_0x61d1('0xb'),attributes,{'tableName':_0x61d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 8ec5f08..a22ddc4 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x192ec2,_0xc3a237){var _0x4abd11=function(_0x2d0745){while(--_0x2d0745){_0x192ec2['push'](_0x192ec2['shift']());}};_0x4abd11(++_0xc3a237);}(_0x31f0,0xb7));var _0x031f=function(_0x1163d0,_0x43400f){_0x1163d0=_0x1163d0-0x0;var _0xd8e847=_0x31f0[_0x1163d0];return _0xd8e847;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x6d38=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4ee36e,_0x50e239){var _0x3685b8=function(_0x5afbaf){while(--_0x5afbaf){_0x4ee36e['push'](_0x4ee36e['shift']());}};_0x3685b8(++_0x50e239);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a13a107..b18293e 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 _0x9432=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update'];(function(_0x59a147,_0x22e727){var _0x45e92c=function(_0x4c06c6){while(--_0x4c06c6){_0x59a147['push'](_0x59a147['shift']());}};_0x45e92c(++_0x22e727);}(_0x9432,0x1e3));var _0x2943=function(_0x37954d,_0x1d204d){_0x37954d=_0x37954d-0x0;var _0xb9bf02=_0x9432[_0x37954d];return _0xb9bf02;};'use strict';var multer=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var path=require('path');var timeout=require(_0x2943('0x2'));var express=require(_0x2943('0x3'));var router=express['Router']();var fs_extra=require(_0x2943('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2943('0x5'));var controller=require(_0x2943('0x6'));router[_0x2943('0x7')]('/',auth[_0x2943('0x8')](),controller[_0x2943('0x9')]);router['get'](_0x2943('0xa'),auth[_0x2943('0x8')](),controller[_0x2943('0xb')]);router[_0x2943('0x7')]('/:id/sub_intervals',auth[_0x2943('0x8')](),controller[_0x2943('0xc')]);router[_0x2943('0xd')]('/',auth['isAuthenticated'](),controller[_0x2943('0xe')]);router['post'](_0x2943('0xf'),auth[_0x2943('0x8')](),controller[_0x2943('0x10')]);router[_0x2943('0xd')](_0x2943('0x11'),auth[_0x2943('0x8')](),controller[_0x2943('0x12')]);router[_0x2943('0x13')](_0x2943('0xa'),auth[_0x2943('0x8')](),controller[_0x2943('0x14')]);router[_0x2943('0x15')](_0x2943('0xa'),auth['isAuthenticated'](),controller[_0x2943('0x16')]);module[_0x2943('0x17')]=router; \ No newline at end of file +var _0x06bf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','/:id/sub_intervals','post','create','addInterval','put','delete','destroy','exports','multer','util','path'];(function(_0x159c4e,_0x5ca3c6){var _0x53eb5f=function(_0x51a5aa){while(--_0x51a5aa){_0x159c4e['push'](_0x159c4e['shift']());}};_0x53eb5f(++_0x5ca3c6);}(_0x06bf,0x105));var _0xf06b=function(_0x5d262f,_0x3c1b1c){_0x5d262f=_0x5d262f-0x0;var _0x5af9ee=_0x06bf[_0x5d262f];return _0x5af9ee;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require(_0xf06b('0x2'));var timeout=require(_0xf06b('0x3'));var express=require(_0xf06b('0x4'));var router=express[_0xf06b('0x5')]();var fs_extra=require(_0xf06b('0x6'));var auth=require(_0xf06b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf06b('0x8'));var controller=require(_0xf06b('0x9'));router[_0xf06b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf06b('0xb')]);router[_0xf06b('0xa')](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller['show']);router[_0xf06b('0xa')](_0xf06b('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xf06b('0xf')]('/',auth[_0xf06b('0xd')](),controller[_0xf06b('0x10')]);router[_0xf06b('0xf')](_0xf06b('0xe'),auth[_0xf06b('0xd')](),controller[_0xf06b('0x11')]);router[_0xf06b('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0xf06b('0x12')](_0xf06b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf06b('0x13')](_0xf06b('0xc'),auth['isAuthenticated'](),controller[_0xf06b('0x14')]);module[_0xf06b('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 76dedf2..dffbe18 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 _0x62c2=['STRING','sequelize'];(function(_0x5272ed,_0xa18cb4){var _0x337354=function(_0x2ea0d6){while(--_0x2ea0d6){_0x5272ed['push'](_0x5272ed['shift']());}};_0x337354(++_0xa18cb4);}(_0x62c2,0x1e1));var _0x262c=function(_0x32a4eb,_0x26b207){_0x32a4eb=_0x32a4eb-0x0;var _0x4ded40=_0x62c2[_0x32a4eb];return _0x4ded40;};'use strict';var Sequelize=require(_0x262c('0x0'));module['exports']={'name':{'type':Sequelize[_0x262c('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x262c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x64ed=['STRING','sequelize','exports'];(function(_0x46728b,_0x376bc6){var _0x5aa8e2=function(_0x111c54){while(--_0x111c54){_0x46728b['push'](_0x46728b['shift']());}};_0x5aa8e2(++_0x376bc6);}(_0x64ed,0x121));var _0xd64e=function(_0x3c0299,_0x56561d){_0x3c0299=_0x3c0299-0x0;var _0x2d2d49=_0x64ed[_0x3c0299];return _0x2d2d49;};'use strict';var Sequelize=require(_0xd64e('0x0'));module[_0xd64e('0x1')]={'name':{'type':Sequelize[_0xd64e('0x2')]},'description':{'type':Sequelize[_0xd64e('0x2')]},'interval':{'type':Sequelize[_0xd64e('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 d64a256..806a2f0 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 _0xce79=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Interval','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','addInterval','IntervalId','getIntervals','findOne','addIntervals','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x1965f5,_0x7e8b84){var _0x22e2f8=function(_0x52fb96){while(--_0x52fb96){_0x1965f5['push'](_0x1965f5['shift']());}};_0x22e2f8(++_0x7e8b84);}(_0xce79,0x7b));var _0x9ce7=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xce79[_0x4aba15];return _0x1c8122;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ce7('0x0'));var zipdir=require(_0x9ce7('0x1'));var jsonpatch=require(_0x9ce7('0x2'));var rp=require(_0x9ce7('0x3'));var moment=require(_0x9ce7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ce7('0x5'));var util=require(_0x9ce7('0x6'));var path=require(_0x9ce7('0x7'));var sox=require(_0x9ce7('0x8'));var csv=require('to-csv');var ejs=require(_0x9ce7('0x9'));var fs=require('fs');var fs_extra=require(_0x9ce7('0xa'));var _=require('lodash');var squel=require(_0x9ce7('0xb'));var crypto=require('crypto');var jsforce=require(_0x9ce7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9ce7('0xd'));var querystring=require(_0x9ce7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ce7('0xf'));var qs=require(_0x9ce7('0x10'));var as=require(_0x9ce7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ce7('0x12'))(_0x9ce7('0x13'));var utils=require(_0x9ce7('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9ce7('0x15'))['db'];var extensions=require(_0x9ce7('0x16'));function respondWithStatusCode(_0x2e0c1e,_0x503ce7){_0x503ce7=_0x503ce7||0xcc;return function(_0x4f2c6f){if(_0x4f2c6f){return _0x2e0c1e[_0x9ce7('0x17')](_0x503ce7);}return _0x2e0c1e[_0x9ce7('0x18')](_0x503ce7)[_0x9ce7('0x19')]();};}function respondWithResult(_0x491c71,_0x54026d){_0x54026d=_0x54026d||0xc8;return function(_0x35f358){if(_0x35f358){return _0x491c71[_0x9ce7('0x18')](_0x54026d)[_0x9ce7('0x1a')](_0x35f358);}};}function respondWithFilteredResult(_0x16d894,_0x2c1aab){return function(_0x3e97c2){if(_0x3e97c2){var _0x60f42d=typeof _0x2c1aab[_0x9ce7('0x1b')]===_0x9ce7('0x1c')&&typeof _0x2c1aab[_0x9ce7('0x1d')]===_0x9ce7('0x1c');var _0x1b6866=_0x3e97c2[_0x9ce7('0x1e')];var _0x59bdbd=_0x60f42d?0x0:_0x2c1aab[_0x9ce7('0x1b')];var _0x1294f0=_0x60f42d?_0x3e97c2[_0x9ce7('0x1e')]:_0x2c1aab[_0x9ce7('0x1b')]+_0x2c1aab[_0x9ce7('0x1d')];var _0x9861f7;if(_0x1294f0>=_0x1b6866){_0x1294f0=_0x1b6866;_0x9861f7=0xc8;}else{_0x9861f7=0xce;}_0x16d894[_0x9ce7('0x18')](_0x9861f7);return _0x16d894['set']('Content-Range',_0x59bdbd+'-'+_0x1294f0+'/'+_0x1b6866)['json'](_0x3e97c2);}return null;};}function patchUpdates(_0x55c965){return function(_0x377be3){try{jsonpatch[_0x9ce7('0x1f')](_0x377be3,_0x55c965,!![]);}catch(_0x378fb3){return BPromise['reject'](_0x378fb3);}return _0x377be3['save']();};}function saveUpdates(_0x309aed,_0x5b4b98){return function(_0x1cfa1b){if(_0x1cfa1b){return _0x1cfa1b[_0x9ce7('0x20')](_0x309aed)[_0x9ce7('0x21')](function(_0x757ea4){return _0x757ea4;});}return null;};}function removeEntity(_0x39a8b4,_0x300fbe){return function(_0x2eb4db){if(_0x2eb4db){return _0x2eb4db[_0x9ce7('0x22')]()[_0x9ce7('0x21')](function(){var _0x1f0904=_0x2eb4db[_0x9ce7('0x23')]({'plain':!![]});var _0x2e1a83=_0x9ce7('0x24');return db[_0x9ce7('0x25')][_0x9ce7('0x22')]({'where':{'type':_0x2e1a83,'resourceId':_0x1f0904['id']}})[_0x9ce7('0x21')](function(){return _0x2eb4db;});})[_0x9ce7('0x21')](function(){_0x39a8b4[_0x9ce7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x432231,_0x410cb8){return function(_0xd962b1){if(!_0xd962b1){_0x432231['sendStatus'](0x194);}return _0xd962b1;};}function handleError(_0x3920c4,_0x19b9e0){_0x19b9e0=_0x19b9e0||0x1f4;return function(_0x2fbf3e){logger[_0x9ce7('0x26')](_0x2fbf3e[_0x9ce7('0x27')]);if(_0x2fbf3e[_0x9ce7('0x28')]){delete _0x2fbf3e[_0x9ce7('0x28')];}_0x3920c4[_0x9ce7('0x18')](_0x19b9e0)[_0x9ce7('0x29')](_0x2fbf3e);};}exports[_0x9ce7('0x2a')]=function(_0x4aebfc,_0x3cfdcd){var _0x165f2d={},_0x308ced={},_0x405839={'count':0x0,'rows':[]};var _0x3ed452=_[_0x9ce7('0x2b')](db['Interval'][_0x9ce7('0x2c')],function(_0x5cc127){return{'name':_0x5cc127[_0x9ce7('0x2d')],'type':_0x5cc127[_0x9ce7('0x2e')][_0x9ce7('0x2f')]};});_0x308ced[_0x9ce7('0x30')]=_[_0x9ce7('0x2b')](_0x3ed452,_0x9ce7('0x28'));_0x308ced['query']=_['keys'](_0x4aebfc[_0x9ce7('0x31')]);_0x308ced[_0x9ce7('0x32')]=_[_0x9ce7('0x33')](_0x308ced[_0x9ce7('0x30')],_0x308ced[_0x9ce7('0x31')]);_0x165f2d[_0x9ce7('0x34')]=_[_0x9ce7('0x33')](_0x308ced['model'],qs['fields'](_0x4aebfc[_0x9ce7('0x31')][_0x9ce7('0x35')]));_0x165f2d['attributes']=_0x165f2d[_0x9ce7('0x34')][_0x9ce7('0x36')]?_0x165f2d[_0x9ce7('0x34')]:_0x308ced[_0x9ce7('0x30')];if(!_0x4aebfc[_0x9ce7('0x31')][_0x9ce7('0x37')](_0x9ce7('0x38'))){_0x165f2d[_0x9ce7('0x1d')]=qs[_0x9ce7('0x1d')](_0x4aebfc[_0x9ce7('0x31')]['limit']);_0x165f2d[_0x9ce7('0x1b')]=qs[_0x9ce7('0x1b')](_0x4aebfc[_0x9ce7('0x31')]['offset']);}_0x165f2d[_0x9ce7('0x39')]=qs[_0x9ce7('0x3a')](_0x4aebfc['query'][_0x9ce7('0x3a')]);_0x165f2d[_0x9ce7('0x3b')]=qs[_0x9ce7('0x32')](_[_0x9ce7('0x3c')](_0x4aebfc[_0x9ce7('0x31')],_0x308ced['filters']),_0x3ed452);if(_0x4aebfc[_0x9ce7('0x31')]['filter']){_0x165f2d[_0x9ce7('0x3b')]=_['merge'](_0x165f2d[_0x9ce7('0x3b')],{'$or':_[_0x9ce7('0x2b')](_0x3ed452,function(_0x18a63d){if(_0x18a63d[_0x9ce7('0x2e')]!==_0x9ce7('0x3d')){var _0x54694b={};_0x54694b[_0x18a63d[_0x9ce7('0x28')]]={'$like':'%'+_0x4aebfc['query'][_0x9ce7('0x3e')]+'%'};return _0x54694b;}})});}_0x165f2d=_[_0x9ce7('0x3f')]({},_0x165f2d,_0x4aebfc[_0x9ce7('0x40')]);var _0x271634={'where':_0x165f2d[_0x9ce7('0x3b')]};return db[_0x9ce7('0x41')][_0x9ce7('0x1e')](_0x271634)[_0x9ce7('0x21')](function(_0x2c307f){_0x405839[_0x9ce7('0x1e')]=_0x2c307f;if(_0x4aebfc[_0x9ce7('0x31')][_0x9ce7('0x42')]){_0x165f2d['include']=[{'all':!![]}];}return db[_0x9ce7('0x41')][_0x9ce7('0x43')](_0x165f2d);})[_0x9ce7('0x21')](function(_0x3e22f7){_0x405839[_0x9ce7('0x44')]=_0x3e22f7;return _0x405839;})[_0x9ce7('0x21')](respondWithFilteredResult(_0x3cfdcd,_0x165f2d))[_0x9ce7('0x45')](handleError(_0x3cfdcd,null));};exports[_0x9ce7('0x46')]=function(_0x1471d5,_0x313fff){var _0x4bfd74={'raw':!![],'where':{'id':_0x1471d5[_0x9ce7('0x47')]['id']}},_0x4bff37={};_0x4bff37[_0x9ce7('0x30')]=_[_0x9ce7('0x48')](db['Interval'][_0x9ce7('0x2c')]);_0x4bff37[_0x9ce7('0x31')]=_[_0x9ce7('0x48')](_0x1471d5[_0x9ce7('0x31')]);_0x4bff37[_0x9ce7('0x32')]=_[_0x9ce7('0x33')](_0x4bff37['model'],_0x4bff37[_0x9ce7('0x31')]);_0x4bfd74[_0x9ce7('0x34')]=_['intersection'](_0x4bff37[_0x9ce7('0x30')],qs[_0x9ce7('0x35')](_0x1471d5[_0x9ce7('0x31')][_0x9ce7('0x35')]));_0x4bfd74[_0x9ce7('0x34')]=_0x4bfd74[_0x9ce7('0x34')]['length']?_0x4bfd74['attributes']:_0x4bff37[_0x9ce7('0x30')];if(_0x1471d5['query'][_0x9ce7('0x42')]){_0x4bfd74['include']=[{'all':!![]}];}_0x4bfd74=_['merge']({},_0x4bfd74,_0x1471d5[_0x9ce7('0x40')]);return db[_0x9ce7('0x41')][_0x9ce7('0x49')](_0x4bfd74)[_0x9ce7('0x21')](handleEntityNotFound(_0x313fff,null))['then'](respondWithResult(_0x313fff,null))[_0x9ce7('0x45')](handleError(_0x313fff,null));};exports[_0x9ce7('0x4a')]=function(_0x31066d,_0x231248){return db[_0x9ce7('0x41')]['create'](_0x31066d[_0x9ce7('0x4b')],{})['then'](function(_0x4128e2){var _0xf16a8=_0x31066d[_0x9ce7('0x4c')]['get']({'plain':!![]});if(!_0xf16a8)throw new Error(_0x9ce7('0x4d'));if(_0xf16a8['role']===_0x9ce7('0x4c')){var _0x3c9060=_0x4128e2[_0x9ce7('0x23')]({'plain':!![]});var _0x131bb5='Intervals';return db['UserProfileSection'][_0x9ce7('0x49')]({'where':{'name':_0x131bb5,'userProfileId':_0xf16a8[_0x9ce7('0x4e')]},'raw':!![]})[_0x9ce7('0x21')](function(_0x15ca4b){if(_0x15ca4b&&_0x15ca4b[_0x9ce7('0x4f')]===0x0){return db[_0x9ce7('0x25')][_0x9ce7('0x4a')]({'name':_0x3c9060[_0x9ce7('0x28')],'resourceId':_0x3c9060['id'],'type':_0x15ca4b['name'],'sectionId':_0x15ca4b['id']},{})[_0x9ce7('0x21')](function(){return _0x4128e2;});}else{return _0x4128e2;}})[_0x9ce7('0x45')](function(_0x165a65){logger[_0x9ce7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x165a65);throw _0x165a65;});}return _0x4128e2;})[_0x9ce7('0x21')](respondWithResult(_0x231248,0xc9))[_0x9ce7('0x45')](handleError(_0x231248,null));};exports['update']=function(_0x4469ce,_0x22c1c6){if(_0x4469ce[_0x9ce7('0x4b')]['id']){delete _0x4469ce[_0x9ce7('0x4b')]['id'];}return db[_0x9ce7('0x41')]['find']({'where':{'id':_0x4469ce[_0x9ce7('0x47')]['id']}})[_0x9ce7('0x21')](handleEntityNotFound(_0x22c1c6,null))[_0x9ce7('0x21')](saveUpdates(_0x4469ce[_0x9ce7('0x4b')],null))[_0x9ce7('0x21')](respondWithResult(_0x22c1c6,null))[_0x9ce7('0x45')](handleError(_0x22c1c6,null));};exports[_0x9ce7('0x22')]=function(_0xe5d262,_0x19108c){return db['Interval']['find']({'where':{'id':_0xe5d262[_0x9ce7('0x47')]['id']}})[_0x9ce7('0x21')](handleEntityNotFound(_0x19108c,null))[_0x9ce7('0x21')](removeEntity(_0x19108c,null))['catch'](handleError(_0x19108c,null));};exports[_0x9ce7('0x50')]=function(_0x587f49,_0x48b9e2,_0x2f17fe){if(_0x587f49[_0x9ce7('0x4b')]['id']){delete _0x587f49[_0x9ce7('0x4b')]['id'];}return db[_0x9ce7('0x41')][_0x9ce7('0x49')]({'where':{'id':_0x587f49[_0x9ce7('0x47')]['id']}})['then'](handleEntityNotFound(_0x48b9e2,null))[_0x9ce7('0x21')](function(_0x5cbade){if(_0x5cbade){_0x587f49[_0x9ce7('0x4b')][_0x9ce7('0x51')]=_0x5cbade['id'];return db['Interval']['create'](_0x587f49[_0x9ce7('0x4b')]);}})[_0x9ce7('0x21')](respondWithResult(_0x48b9e2,null))['catch'](handleError(_0x48b9e2,null));};exports[_0x9ce7('0x52')]=function(_0x38d243,_0x5992f8,_0x116364){var _0x3cb4cc={};var _0x4ddfe6={};var _0x42c955;var _0x2b8e29;return db[_0x9ce7('0x41')][_0x9ce7('0x53')]({'where':{'id':_0x38d243[_0x9ce7('0x47')]['id']}})['then'](handleEntityNotFound(_0x5992f8,null))[_0x9ce7('0x21')](function(_0x43b928){if(_0x43b928){_0x42c955=_0x43b928;_0x4ddfe6[_0x9ce7('0x30')]=_[_0x9ce7('0x48')](db[_0x9ce7('0x41')][_0x9ce7('0x2c')]);_0x4ddfe6[_0x9ce7('0x31')]=_['keys'](_0x38d243[_0x9ce7('0x31')]);_0x4ddfe6['filters']=_[_0x9ce7('0x33')](_0x4ddfe6['model'],_0x4ddfe6[_0x9ce7('0x31')]);_0x3cb4cc['attributes']=_[_0x9ce7('0x33')](_0x4ddfe6[_0x9ce7('0x30')],qs[_0x9ce7('0x35')](_0x38d243['query'][_0x9ce7('0x35')]));_0x3cb4cc[_0x9ce7('0x34')]=_0x3cb4cc[_0x9ce7('0x34')][_0x9ce7('0x36')]?_0x3cb4cc[_0x9ce7('0x34')]:_0x4ddfe6['model'];_0x3cb4cc[_0x9ce7('0x39')]=qs[_0x9ce7('0x3a')](_0x38d243['query'][_0x9ce7('0x3a')]);_0x3cb4cc[_0x9ce7('0x3b')]=qs[_0x9ce7('0x32')](_['pick'](_0x38d243[_0x9ce7('0x31')],_0x4ddfe6[_0x9ce7('0x32')]));if(_0x38d243['query'][_0x9ce7('0x3e')]){_0x3cb4cc['where']=_[_0x9ce7('0x3f')](_0x3cb4cc['where'],{'$or':_['map'](_0x3cb4cc[_0x9ce7('0x34')],function(_0x29b295){var _0xb9797c={};_0xb9797c[_0x29b295]={'$like':'%'+_0x38d243[_0x9ce7('0x31')][_0x9ce7('0x3e')]+'%'};return _0xb9797c;})});}_0x3cb4cc=_[_0x9ce7('0x3f')]({},_0x3cb4cc,_0x38d243[_0x9ce7('0x40')]);return _0x42c955['getIntervals'](_0x3cb4cc);}})['then'](function(_0x34ec17){if(_0x34ec17){_0x2b8e29=_0x34ec17['length'];if(!_0x38d243['query'][_0x9ce7('0x37')](_0x9ce7('0x38'))){_0x3cb4cc[_0x9ce7('0x1d')]=qs[_0x9ce7('0x1d')](_0x38d243[_0x9ce7('0x31')][_0x9ce7('0x1d')]);_0x3cb4cc[_0x9ce7('0x1b')]=qs[_0x9ce7('0x1b')](_0x38d243['query'][_0x9ce7('0x1b')]);}return _0x42c955[_0x9ce7('0x52')](_0x3cb4cc);}})[_0x9ce7('0x21')](function(_0x43d74f){if(_0x43d74f){return _0x43d74f?{'count':_0x2b8e29,'rows':_0x43d74f}:null;}})[_0x9ce7('0x21')](respondWithResult(_0x5992f8,null))[_0x9ce7('0x45')](handleError(_0x5992f8,null));};exports[_0x9ce7('0x54')]=function(_0x55c112,_0x23cfb3,_0x1cbb1c){return db[_0x9ce7('0x41')][_0x9ce7('0x53')]({'where':{'id':_0x55c112[_0x9ce7('0x47')]['id']}})[_0x9ce7('0x21')](handleEntityNotFound(_0x23cfb3,null))[_0x9ce7('0x21')](function(_0x6823ad){if(_0x6823ad){return db['sequelize']['transaction'](function(_0x202dc3){return db[_0x9ce7('0x41')][_0x9ce7('0x22')]({'where':{'IntervalId':_0x55c112[_0x9ce7('0x47')]['id']},'transaction':_0x202dc3})['then'](function(_0x292a48){var _0x3d5506=_['map'](_0x55c112[_0x9ce7('0x4b')],function(_0x1cf753){delete _0x1cf753['id'];_0x1cf753[_0x9ce7('0x51')]=_0x55c112['params']['id'];return _0x1cf753;});return db[_0x9ce7('0x41')][_0x9ce7('0x55')](_0x3d5506,{'transaction':_0x202dc3});});})[_0x9ce7('0x21')](function(){return db[_0x9ce7('0x41')]['findAll']({'where':{'IntervalId':_0x55c112['params']['id']}});});}})[_0x9ce7('0x21')](respondWithResult(_0x23cfb3,null))[_0x9ce7('0x45')](handleError(_0x23cfb3,null));}; \ No newline at end of file +var _0x08e3=['keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','params','IntervalId','getIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query'];(function(_0x21059c,_0x34b91b){var _0x32ba05=function(_0x401d20){while(--_0x401d20){_0x21059c['push'](_0x21059c['shift']());}};_0x32ba05(++_0x34b91b);}(_0x08e3,0x13c));var _0x308e=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x08e3[_0x4310e8];return _0x301445;};'use strict';var emlformat=require(_0x308e('0x0'));var rimraf=require(_0x308e('0x1'));var zipdir=require(_0x308e('0x2'));var jsonpatch=require(_0x308e('0x3'));var rp=require(_0x308e('0x4'));var moment=require(_0x308e('0x5'));var BPromise=require(_0x308e('0x6'));var Mustache=require(_0x308e('0x7'));var util=require(_0x308e('0x8'));var path=require(_0x308e('0x9'));var sox=require(_0x308e('0xa'));var csv=require(_0x308e('0xb'));var ejs=require(_0x308e('0xc'));var fs=require('fs');var fs_extra=require(_0x308e('0xd'));var _=require(_0x308e('0xe'));var squel=require(_0x308e('0xf'));var crypto=require(_0x308e('0x10'));var jsforce=require(_0x308e('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x308e('0xb'));var querystring=require(_0x308e('0x12'));var Papa=require(_0x308e('0x13'));var Redis=require(_0x308e('0x14'));var authService=require(_0x308e('0x15'));var qs=require(_0x308e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x308e('0x17'));var logger=require(_0x308e('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x308e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x308e('0x1a'))['db'];var extensions=require(_0x308e('0x1b'));function respondWithStatusCode(_0x4e0a93,_0x371513){_0x371513=_0x371513||0xcc;return function(_0x1dcc1a){if(_0x1dcc1a){return _0x4e0a93[_0x308e('0x1c')](_0x371513);}return _0x4e0a93['status'](_0x371513)[_0x308e('0x1d')]();};}function respondWithResult(_0x4e25d9,_0xe7d4f6){_0xe7d4f6=_0xe7d4f6||0xc8;return function(_0x2f6891){if(_0x2f6891){return _0x4e25d9[_0x308e('0x1e')](_0xe7d4f6)['json'](_0x2f6891);}};}function respondWithFilteredResult(_0x58f5a3,_0x418bf8){return function(_0x19f444){if(_0x19f444){var _0x3cdcf0=typeof _0x418bf8[_0x308e('0x1f')]===_0x308e('0x20')&&typeof _0x418bf8[_0x308e('0x21')]===_0x308e('0x20');var _0x5539e7=_0x19f444[_0x308e('0x22')];var _0x347d57=_0x3cdcf0?0x0:_0x418bf8['offset'];var _0x4b9755=_0x3cdcf0?_0x19f444[_0x308e('0x22')]:_0x418bf8[_0x308e('0x1f')]+_0x418bf8[_0x308e('0x21')];var _0x561ab7;if(_0x4b9755>=_0x5539e7){_0x4b9755=_0x5539e7;_0x561ab7=0xc8;}else{_0x561ab7=0xce;}_0x58f5a3[_0x308e('0x1e')](_0x561ab7);return _0x58f5a3[_0x308e('0x23')](_0x308e('0x24'),_0x347d57+'-'+_0x4b9755+'/'+_0x5539e7)['json'](_0x19f444);}return null;};}function patchUpdates(_0x2205b9){return function(_0x2d982d){try{jsonpatch[_0x308e('0x25')](_0x2d982d,_0x2205b9,!![]);}catch(_0x630cc7){return BPromise['reject'](_0x630cc7);}return _0x2d982d[_0x308e('0x26')]();};}function saveUpdates(_0x3dd6b8,_0x32c4e8){return function(_0x1759d8){if(_0x1759d8){return _0x1759d8[_0x308e('0x27')](_0x3dd6b8)[_0x308e('0x28')](function(_0x50c29b){return _0x50c29b;});}return null;};}function removeEntity(_0x3162d3,_0xba1ee2){return function(_0x92c018){if(_0x92c018){return _0x92c018['destroy']()['then'](function(){var _0x54789a=_0x92c018[_0x308e('0x29')]({'plain':!![]});var _0x2e563c='Intervals';return db[_0x308e('0x2a')][_0x308e('0x2b')]({'where':{'type':_0x2e563c,'resourceId':_0x54789a['id']}})['then'](function(){return _0x92c018;});})[_0x308e('0x28')](function(){_0x3162d3['status'](0xcc)[_0x308e('0x1d')]();});}};}function handleEntityNotFound(_0x1bc077,_0x477774){return function(_0x11ab7c){if(!_0x11ab7c){_0x1bc077[_0x308e('0x1c')](0x194);}return _0x11ab7c;};}function handleError(_0xf8d878,_0x137c2a){_0x137c2a=_0x137c2a||0x1f4;return function(_0x59fa12){logger[_0x308e('0x2c')](_0x59fa12[_0x308e('0x2d')]);if(_0x59fa12['name']){delete _0x59fa12[_0x308e('0x2e')];}_0xf8d878[_0x308e('0x1e')](_0x137c2a)[_0x308e('0x2f')](_0x59fa12);};}exports[_0x308e('0x30')]=function(_0x59d8b4,_0x3a16e8){var _0x1d00ae={},_0xc1bcdc={},_0x4b74fb={'count':0x0,'rows':[]};var _0x34c7df=_[_0x308e('0x31')](db[_0x308e('0x32')][_0x308e('0x33')],function(_0x3f1def){return{'name':_0x3f1def[_0x308e('0x34')],'type':_0x3f1def[_0x308e('0x35')][_0x308e('0x36')]};});_0xc1bcdc['model']=_['map'](_0x34c7df,_0x308e('0x2e'));_0xc1bcdc[_0x308e('0x37')]=_[_0x308e('0x38')](_0x59d8b4[_0x308e('0x37')]);_0xc1bcdc[_0x308e('0x39')]=_[_0x308e('0x3a')](_0xc1bcdc[_0x308e('0x3b')],_0xc1bcdc['query']);_0x1d00ae[_0x308e('0x3c')]=_[_0x308e('0x3a')](_0xc1bcdc[_0x308e('0x3b')],qs[_0x308e('0x3d')](_0x59d8b4[_0x308e('0x37')][_0x308e('0x3d')]));_0x1d00ae[_0x308e('0x3c')]=_0x1d00ae[_0x308e('0x3c')]['length']?_0x1d00ae['attributes']:_0xc1bcdc[_0x308e('0x3b')];if(!_0x59d8b4[_0x308e('0x37')][_0x308e('0x3e')](_0x308e('0x3f'))){_0x1d00ae[_0x308e('0x21')]=qs['limit'](_0x59d8b4[_0x308e('0x37')][_0x308e('0x21')]);_0x1d00ae[_0x308e('0x1f')]=qs[_0x308e('0x1f')](_0x59d8b4['query'][_0x308e('0x1f')]);}_0x1d00ae[_0x308e('0x40')]=qs[_0x308e('0x41')](_0x59d8b4[_0x308e('0x37')]['sort']);_0x1d00ae[_0x308e('0x42')]=qs[_0x308e('0x39')](_[_0x308e('0x43')](_0x59d8b4['query'],_0xc1bcdc['filters']),_0x34c7df);if(_0x59d8b4[_0x308e('0x37')]['filter']){_0x1d00ae[_0x308e('0x42')]=_[_0x308e('0x44')](_0x1d00ae[_0x308e('0x42')],{'$or':_[_0x308e('0x31')](_0x34c7df,function(_0x10bccd){if(_0x10bccd[_0x308e('0x35')]!==_0x308e('0x45')){var _0xf9d946={};_0xf9d946[_0x10bccd['name']]={'$like':'%'+_0x59d8b4[_0x308e('0x37')][_0x308e('0x46')]+'%'};return _0xf9d946;}})});}_0x1d00ae=_['merge']({},_0x1d00ae,_0x59d8b4[_0x308e('0x47')]);var _0x11ce8a={'where':_0x1d00ae['where']};return db['Interval'][_0x308e('0x22')](_0x11ce8a)[_0x308e('0x28')](function(_0x4ae1df){_0x4b74fb[_0x308e('0x22')]=_0x4ae1df;if(_0x59d8b4[_0x308e('0x37')][_0x308e('0x48')]){_0x1d00ae['include']=[{'all':!![]}];}return db[_0x308e('0x32')][_0x308e('0x49')](_0x1d00ae);})[_0x308e('0x28')](function(_0x4ce1a6){_0x4b74fb[_0x308e('0x4a')]=_0x4ce1a6;return _0x4b74fb;})['then'](respondWithFilteredResult(_0x3a16e8,_0x1d00ae))[_0x308e('0x4b')](handleError(_0x3a16e8,null));};exports[_0x308e('0x4c')]=function(_0x2ca9bf,_0x41890d){var _0x4ecd80={'raw':!![],'where':{'id':_0x2ca9bf['params']['id']}},_0x320f72={};_0x320f72['model']=_[_0x308e('0x38')](db['Interval']['rawAttributes']);_0x320f72[_0x308e('0x37')]=_[_0x308e('0x38')](_0x2ca9bf[_0x308e('0x37')]);_0x320f72[_0x308e('0x39')]=_['intersection'](_0x320f72[_0x308e('0x3b')],_0x320f72['query']);_0x4ecd80[_0x308e('0x3c')]=_[_0x308e('0x3a')](_0x320f72[_0x308e('0x3b')],qs[_0x308e('0x3d')](_0x2ca9bf['query'][_0x308e('0x3d')]));_0x4ecd80[_0x308e('0x3c')]=_0x4ecd80[_0x308e('0x3c')][_0x308e('0x4d')]?_0x4ecd80[_0x308e('0x3c')]:_0x320f72[_0x308e('0x3b')];if(_0x2ca9bf['query'][_0x308e('0x48')]){_0x4ecd80['include']=[{'all':!![]}];}_0x4ecd80=_['merge']({},_0x4ecd80,_0x2ca9bf[_0x308e('0x47')]);return db[_0x308e('0x32')][_0x308e('0x4e')](_0x4ecd80)[_0x308e('0x28')](handleEntityNotFound(_0x41890d,null))[_0x308e('0x28')](respondWithResult(_0x41890d,null))[_0x308e('0x4b')](handleError(_0x41890d,null));};exports[_0x308e('0x4f')]=function(_0xdc200f,_0x1229f1){return db[_0x308e('0x32')][_0x308e('0x4f')](_0xdc200f[_0x308e('0x50')],{})[_0x308e('0x28')](function(_0x584f75){var _0x23ca7f=_0xdc200f['user'][_0x308e('0x29')]({'plain':!![]});if(!_0x23ca7f)throw new Error(_0x308e('0x51'));if(_0x23ca7f['role']==='user'){var _0x315ee6=_0x584f75[_0x308e('0x29')]({'plain':!![]});var _0xf37e17=_0x308e('0x52');return db[_0x308e('0x53')]['find']({'where':{'name':_0xf37e17,'userProfileId':_0x23ca7f[_0x308e('0x54')]},'raw':!![]})[_0x308e('0x28')](function(_0xa8632a){if(_0xa8632a&&_0xa8632a[_0x308e('0x55')]===0x0){return db[_0x308e('0x2a')]['create']({'name':_0x315ee6['name'],'resourceId':_0x315ee6['id'],'type':_0xa8632a[_0x308e('0x2e')],'sectionId':_0xa8632a['id']},{})['then'](function(){return _0x584f75;});}else{return _0x584f75;}})[_0x308e('0x4b')](function(_0x1ef830){logger[_0x308e('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ef830);throw _0x1ef830;});}return _0x584f75;})[_0x308e('0x28')](respondWithResult(_0x1229f1,0xc9))['catch'](handleError(_0x1229f1,null));};exports[_0x308e('0x27')]=function(_0x7d8db4,_0x4ef7f3){if(_0x7d8db4[_0x308e('0x50')]['id']){delete _0x7d8db4['body']['id'];}return db[_0x308e('0x32')][_0x308e('0x4e')]({'where':{'id':_0x7d8db4[_0x308e('0x56')]['id']}})[_0x308e('0x28')](handleEntityNotFound(_0x4ef7f3,null))[_0x308e('0x28')](saveUpdates(_0x7d8db4['body'],null))['then'](respondWithResult(_0x4ef7f3,null))[_0x308e('0x4b')](handleError(_0x4ef7f3,null));};exports['destroy']=function(_0x3affd2,_0xf2a98d){return db[_0x308e('0x32')]['find']({'where':{'id':_0x3affd2[_0x308e('0x56')]['id']}})[_0x308e('0x28')](handleEntityNotFound(_0xf2a98d,null))[_0x308e('0x28')](removeEntity(_0xf2a98d,null))[_0x308e('0x4b')](handleError(_0xf2a98d,null));};exports['addInterval']=function(_0x3be7d6,_0x3c516d,_0x318179){if(_0x3be7d6['body']['id']){delete _0x3be7d6[_0x308e('0x50')]['id'];}return db[_0x308e('0x32')][_0x308e('0x4e')]({'where':{'id':_0x3be7d6[_0x308e('0x56')]['id']}})[_0x308e('0x28')](handleEntityNotFound(_0x3c516d,null))['then'](function(_0x1e8866){if(_0x1e8866){_0x3be7d6['body'][_0x308e('0x57')]=_0x1e8866['id'];return db['Interval'][_0x308e('0x4f')](_0x3be7d6['body']);}})[_0x308e('0x28')](respondWithResult(_0x3c516d,null))[_0x308e('0x4b')](handleError(_0x3c516d,null));};exports[_0x308e('0x58')]=function(_0x4905e2,_0x131de6,_0x23b496){var _0x2513d1={};var _0x4c2cda={};var _0x1acaad;var _0x209fcd;return db['Interval'][_0x308e('0x59')]({'where':{'id':_0x4905e2[_0x308e('0x56')]['id']}})['then'](handleEntityNotFound(_0x131de6,null))[_0x308e('0x28')](function(_0x306456){if(_0x306456){_0x1acaad=_0x306456;_0x4c2cda[_0x308e('0x3b')]=_[_0x308e('0x38')](db[_0x308e('0x32')][_0x308e('0x33')]);_0x4c2cda[_0x308e('0x37')]=_['keys'](_0x4905e2[_0x308e('0x37')]);_0x4c2cda[_0x308e('0x39')]=_[_0x308e('0x3a')](_0x4c2cda[_0x308e('0x3b')],_0x4c2cda[_0x308e('0x37')]);_0x2513d1[_0x308e('0x3c')]=_[_0x308e('0x3a')](_0x4c2cda[_0x308e('0x3b')],qs[_0x308e('0x3d')](_0x4905e2['query'][_0x308e('0x3d')]));_0x2513d1[_0x308e('0x3c')]=_0x2513d1[_0x308e('0x3c')]['length']?_0x2513d1['attributes']:_0x4c2cda[_0x308e('0x3b')];_0x2513d1[_0x308e('0x40')]=qs['sort'](_0x4905e2['query'][_0x308e('0x41')]);_0x2513d1[_0x308e('0x42')]=qs['filters'](_[_0x308e('0x43')](_0x4905e2[_0x308e('0x37')],_0x4c2cda[_0x308e('0x39')]));if(_0x4905e2['query']['filter']){_0x2513d1[_0x308e('0x42')]=_[_0x308e('0x44')](_0x2513d1['where'],{'$or':_[_0x308e('0x31')](_0x2513d1[_0x308e('0x3c')],function(_0x21de77){var _0x573a0a={};_0x573a0a[_0x21de77]={'$like':'%'+_0x4905e2[_0x308e('0x37')][_0x308e('0x46')]+'%'};return _0x573a0a;})});}_0x2513d1=_[_0x308e('0x44')]({},_0x2513d1,_0x4905e2['options']);return _0x1acaad[_0x308e('0x58')](_0x2513d1);}})['then'](function(_0x3b29de){if(_0x3b29de){_0x209fcd=_0x3b29de[_0x308e('0x4d')];if(!_0x4905e2['query'][_0x308e('0x3e')](_0x308e('0x3f'))){_0x2513d1['limit']=qs['limit'](_0x4905e2[_0x308e('0x37')][_0x308e('0x21')]);_0x2513d1[_0x308e('0x1f')]=qs[_0x308e('0x1f')](_0x4905e2[_0x308e('0x37')][_0x308e('0x1f')]);}return _0x1acaad[_0x308e('0x58')](_0x2513d1);}})[_0x308e('0x28')](function(_0x2da53b){if(_0x2da53b){return _0x2da53b?{'count':_0x209fcd,'rows':_0x2da53b}:null;}})[_0x308e('0x28')](respondWithResult(_0x131de6,null))[_0x308e('0x4b')](handleError(_0x131de6,null));};exports['addIntervals']=function(_0x28d1e0,_0x7ca71a,_0x18a702){return db[_0x308e('0x32')]['findOne']({'where':{'id':_0x28d1e0[_0x308e('0x56')]['id']}})[_0x308e('0x28')](handleEntityNotFound(_0x7ca71a,null))[_0x308e('0x28')](function(_0xded92c){if(_0xded92c){return db[_0x308e('0x5a')][_0x308e('0x5b')](function(_0x2f6c84){return db[_0x308e('0x32')]['destroy']({'where':{'IntervalId':_0x28d1e0[_0x308e('0x56')]['id']},'transaction':_0x2f6c84})[_0x308e('0x28')](function(_0x13a27b){var _0x5877ca=_[_0x308e('0x31')](_0x28d1e0[_0x308e('0x50')],function(_0xa31fe7){delete _0xa31fe7['id'];_0xa31fe7[_0x308e('0x57')]=_0x28d1e0[_0x308e('0x56')]['id'];return _0xa31fe7;});return db[_0x308e('0x32')][_0x308e('0x5c')](_0x5877ca,{'transaction':_0x2f6c84});});})[_0x308e('0x28')](function(){return db[_0x308e('0x32')]['findAll']({'where':{'IntervalId':_0x28d1e0[_0x308e('0x56')]['id']}});});}})[_0x308e('0x28')](respondWithResult(_0x7ca71a,null))[_0x308e('0x4b')](handleError(_0x7ca71a,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 27442f0..1c1fd16 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 _0xca64=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x571bbc,_0x242132){var _0x3e8edb=function(_0x5cc0a2){while(--_0x5cc0a2){_0x571bbc['push'](_0x571bbc['shift']());}};_0x3e8edb(++_0x242132);}(_0xca64,0x1ca));var _0x4ca6=function(_0x3b1a07,_0x1c30c9){_0x3b1a07=_0x3b1a07-0x0;var _0x1cec3e=_0xca64[_0x3b1a07];return _0x1cec3e;};'use strict';var _=require(_0x4ca6('0x0'));var util=require(_0x4ca6('0x1'));var logger=require(_0x4ca6('0x2'))('api');var moment=require(_0x4ca6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ca6('0x4'));var rimraf=require(_0x4ca6('0x5'));var config=require('../../config/environment');var attributes=require(_0x4ca6('0x6'));var extensions=require(_0x4ca6('0x7'));module[_0x4ca6('0x8')]=function(_0x36662b,_0x1e7a8a){return _0x36662b[_0x4ca6('0x9')](_0x4ca6('0xa'),attributes,{'tableName':_0x4ca6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48230f,_0x3928cf){extensions['rewrite'](_0x36662b,_0x48230f);},'afterBulkCreate':function(_0x60ee85,_0x1aa997,_0x3aeabb){_0x3aeabb();extensions[_0x4ca6('0xc')](_0x36662b,_0x60ee85[0x0]);},'afterUpdate':function(_0x2bd128,_0x35e706){extensions['rewrite'](_0x36662b,_0x2bd128);},'afterDestroy':function(_0x23c915,_0x11e350){extensions[_0x4ca6('0xc')](_0x36662b,_0x23c915);}}});}; \ No newline at end of file +var _0x6201=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','api','bluebird','path'];(function(_0x442d80,_0x2f7f1b){var _0x12ad0b=function(_0x345f5b){while(--_0x345f5b){_0x442d80['push'](_0x442d80['shift']());}};_0x12ad0b(++_0x2f7f1b);}(_0x6201,0xbf));var _0x1620=function(_0x2efe12,_0x42b68d){_0x2efe12=_0x2efe12-0x0;var _0x330f7a=_0x6201[_0x2efe12];return _0x330f7a;};'use strict';var _=require('lodash');var util=require(_0x1620('0x0'));var logger=require(_0x1620('0x1'))(_0x1620('0x2'));var moment=require('moment');var BPromise=require(_0x1620('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1620('0x4'));var rimraf=require(_0x1620('0x5'));var config=require(_0x1620('0x6'));var attributes=require(_0x1620('0x7'));var extensions=require(_0x1620('0x8'));module[_0x1620('0x9')]=function(_0x55907,_0x3c2a9d){return _0x55907[_0x1620('0xa')](_0x1620('0xb'),attributes,{'tableName':_0x1620('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c576b,_0x2f21af){extensions[_0x1620('0xd')](_0x55907,_0x5c576b);},'afterBulkCreate':function(_0x499b03,_0x27b3a3,_0x19d96b){_0x19d96b();extensions[_0x1620('0xd')](_0x55907,_0x499b03[0x0]);},'afterUpdate':function(_0x5d16d7,_0x385674){extensions['rewrite'](_0x55907,_0x5d16d7);},'afterDestroy':function(_0xbc02c,_0x591d4d){extensions[_0x1620('0xd')](_0x55907,_0xbc02c);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 21c8fb5..fbac507 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index f9a6f89..58a1646 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x356329,_0x4b2464){var _0x5b23d3=function(_0x35447d){while(--_0x35447d){_0x356329['push'](_0x356329['shift']());}};_0x5b23d3(++_0x4b2464);}(_0x2ef3,0xba));var _0x32ef=function(_0x4a146c,_0x2d50b9){_0x4a146c=_0x4a146c-0x0;var _0x23f17a=_0x2ef3[_0x4a146c];return _0x23f17a;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x1c8877,_0x1a3281){var _0x2e3521=function(_0x345c46){while(--_0x345c46){_0x1c8877['push'](_0x1c8877['shift']());}};_0x2e3521(++_0x1a3281);}(_0x2032,0xd9));var _0x2203=function(_0x2ad4e7,_0x2bc0ee){_0x2ad4e7=_0x2ad4e7-0x0;var _0x3a89b9=_0x2032[_0x2ad4e7];return _0x3a89b9;};'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 8816110..06ada4b 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 _0x4891=['write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','support','MOTGUI','summary','Report','description','stringify','issuetype','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','end','status','json','parse'];(function(_0x4c8fd7,_0x5ac749){var _0xd77a98=function(_0x3a5f2a){while(--_0x3a5f2a){_0x4c8fd7['push'](_0x4c8fd7['shift']());}};_0xd77a98(++_0x5ac749);}(_0x4891,0x199));var _0x1489=function(_0x1869f7,_0x5bfc79){_0x1869f7=_0x1869f7-0x0;var _0x312167=_0x4891[_0x1869f7];return _0x312167;};'use strict';var BPromise=require(_0x1489('0x0'));var https=require(_0x1489('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x1489('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2fb84d,_0x35200f){var _0x54fd8f={'fields':{'project':{'key':_0x2fb84d['key']||_0x1489('0x3')},'summary':(_0x2fb84d[_0x1489('0x4')]||_0x1489('0x5'))+'\x20from\x20'+_0x2fb84d['ip'],'description':_0x2fb84d[_0x1489('0x6')]||JSON[_0x1489('0x7')](_0x2fb84d),'issuetype':{'name':_0x2fb84d[_0x1489('0x8')]||'Bug'}}};_0x54fd8f['fields'][_0x1489('0x9')]=_0x2fb84d[_0x1489('0xa')];_0x54fd8f[_0x1489('0xb')][_0x1489('0xc')]=_0x2fb84d[_0x1489('0xd')];_0x54fd8f['fields']['customfield_11502']=_0x2fb84d['newToken'];_0x54fd8f[_0x1489('0xb')][_0x1489('0xe')]=_0x2fb84d[_0x1489('0xf')];_0x54fd8f['fields'][_0x1489('0x10')]=_0x2fb84d[_0x1489('0x11')];_0x54fd8f['fields'][_0x1489('0x12')]=_0x2fb84d['ip'];var _0x716b1e={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x1489('0x13'),'method':_0x1489('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x1489('0x15'),'Authorization':_0x1489('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x1489('0x17')]('base64')}};var _0x3343cb=JSON[_0x1489('0x7')](_0x54fd8f);var _0x296fd0=https[_0x1489('0x18')](_0x716b1e,function(_0x243743){_0x243743[_0x1489('0x19')](_0x1489('0x1a'));var _0x2cd1ae='';_0x243743['on']('data',function(_0x5078f9){_0x2cd1ae+=_0x5078f9;});_0x243743['on'](_0x1489('0x1b'),function(){if(_0x35200f){return _0x35200f[_0x1489('0x1c')](_0x243743['statusCode'])[_0x1489('0x1d')](JSON[_0x1489('0x1e')](_0x2cd1ae));}});});_0x296fd0['on']('error',function(_0x1674b6){if(_0x35200f){return _0x35200f['status'](0x1f4)[_0x1489('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x296fd0[_0x1489('0x1f')](_0x3343cb);_0x296fd0[_0x1489('0x1b')]();}exports[_0x1489('0x20')]=openIssue;exports[_0x1489('0x21')]=function(_0x109915,_0x40caba){_0x109915[_0x1489('0x22')]['ip']=_0x109915[_0x1489('0x23')][_0x1489('0x24')]||_0x109915[_0x1489('0x25')][_0x1489('0x26')]||_0x109915[_0x1489('0x27')][_0x1489('0x26')]||_0x109915[_0x1489('0x25')][_0x1489('0x27')][_0x1489('0x26')];return openIssue(_0x109915['body'],_0x40caba);}; \ No newline at end of file +var _0x3f7f=['customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','stringify','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x3f7f,0xf2));var _0xf3f7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3f7f[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require('bluebird');var https=require(_0xf3f7('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0xf3f7('0x1');var PASSWORD=_0xf3f7('0x2');function openIssue(_0x489d62,_0x20b429){var _0x465daf={'fields':{'project':{'key':_0x489d62[_0xf3f7('0x3')]||'MOTGUI'},'summary':(_0x489d62[_0xf3f7('0x4')]||_0xf3f7('0x5'))+_0xf3f7('0x6')+_0x489d62['ip'],'description':_0x489d62['description']||JSON['stringify'](_0x489d62),'issuetype':{'name':_0x489d62[_0xf3f7('0x7')]||'Bug'}}};_0x465daf[_0xf3f7('0x8')][_0xf3f7('0x9')]=_0x489d62[_0xf3f7('0xa')];_0x465daf['fields'][_0xf3f7('0xb')]=_0x489d62[_0xf3f7('0xc')];_0x465daf[_0xf3f7('0x8')][_0xf3f7('0xd')]=_0x489d62[_0xf3f7('0xe')];_0x465daf[_0xf3f7('0x8')][_0xf3f7('0xf')]=_0x489d62['name'];_0x465daf[_0xf3f7('0x8')][_0xf3f7('0x10')]=_0x489d62['reason'];_0x465daf['fields'][_0xf3f7('0x11')]=_0x489d62['ip'];var _0x28297f={'host':_0xf3f7('0x12'),'port':0x1bb,'path':_0xf3f7('0x13'),'method':_0xf3f7('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xf3f7('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xf3f7('0x16'))}};var _0x5569bf=JSON[_0xf3f7('0x17')](_0x465daf);var _0x4c7329=https[_0xf3f7('0x18')](_0x28297f,function(_0x5e1731){_0x5e1731[_0xf3f7('0x19')](_0xf3f7('0x1a'));var _0x8fd56e='';_0x5e1731['on'](_0xf3f7('0x1b'),function(_0x58cb94){_0x8fd56e+=_0x58cb94;});_0x5e1731['on']('end',function(){if(_0x20b429){return _0x20b429[_0xf3f7('0x1c')](_0x5e1731[_0xf3f7('0x1d')])[_0xf3f7('0x1e')](JSON[_0xf3f7('0x1f')](_0x8fd56e));}});});_0x4c7329['on'](_0xf3f7('0x20'),function(_0x3f5b70){if(_0x20b429){return _0x20b429['status'](0x1f4)[_0xf3f7('0x1e')]({'errors':[{'message':_0xf3f7('0x21'),'type':'api.jira'}]});}});_0x4c7329['write'](_0x5569bf);_0x4c7329[_0xf3f7('0x22')]();}exports[_0xf3f7('0x23')]=openIssue;exports[_0xf3f7('0x24')]=function(_0x57c8ca,_0x3ce557){_0x57c8ca[_0xf3f7('0x25')]['ip']=_0x57c8ca[_0xf3f7('0x26')][_0xf3f7('0x27')]||_0x57c8ca[_0xf3f7('0x28')][_0xf3f7('0x29')]||_0x57c8ca[_0xf3f7('0x2a')][_0xf3f7('0x29')]||_0x57c8ca[_0xf3f7('0x28')][_0xf3f7('0x2a')][_0xf3f7('0x29')];return openIssue(_0x57c8ca[_0xf3f7('0x25')],_0x3ce557);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ab396c6..6b3aa4a 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 _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x49bc4e,_0x1b95ee){var _0xc8edea=function(_0x16b03d){while(--_0x16b03d){_0x49bc4e['push'](_0x49bc4e['shift']());}};_0xc8edea(++_0x1b95ee);}(_0x0bb5,0x148));var _0x50bb=function(_0x101c30,_0x111eaa){_0x101c30=_0x101c30-0x0;var _0x4a38b3=_0x0bb5[_0x101c30];return _0x4a38b3;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file +var _0xaa88=['/describe','isAuthenticated','describe','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xaa88,0x137));var _0x8aa8=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0xaa88[_0x329664];return _0x4e346e;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')]('/',auth['isAuthenticated'](),controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')](_0x8aa8('0x13'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x13'),auth['isAuthenticated'](),controller[_0x8aa8('0x15')]);module[_0x8aa8('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 5e941ca..fc864c5 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0xf48b57,_0x46c179){_0xf48b57=_0xf48b57-0x0;var _0x4a9f5c=_0x7a54[_0xf48b57];return _0x4a9f5c;};'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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x2ea311,_0x2c6e67){_0x2ea311=_0x2ea311-0x0;var _0x5169fd=_0x7a54[_0x2ea311];return _0x5169fd;};'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 befbf5d..72ec507 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 _0xd5b2=['status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','catch','show','params','fields','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','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','../../mysqldb','sendStatus'];(function(_0x3dc080,_0x224bf8){var _0x3618c9=function(_0x245d91){while(--_0x245d91){_0x3dc080['push'](_0x3dc080['shift']());}};_0x3618c9(++_0x224bf8);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd5b2[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d5b('0x0'));var zipdir=require(_0x2d5b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d5b('0x2'));var moment=require(_0x2d5b('0x3'));var BPromise=require(_0x2d5b('0x4'));var Mustache=require(_0x2d5b('0x5'));var util=require(_0x2d5b('0x6'));var path=require(_0x2d5b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d5b('0x8'));var _=require('lodash');var squel=require(_0x2d5b('0x9'));var crypto=require('crypto');var jsforce=require(_0x2d5b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2d5b('0xb'));var querystring=require(_0x2d5b('0xc'));var Papa=require(_0x2d5b('0xd'));var Redis=require(_0x2d5b('0xe'));var authService=require(_0x2d5b('0xf'));var qs=require(_0x2d5b('0x10'));var as=require(_0x2d5b('0x11'));var hardwareService=require(_0x2d5b('0x12'));var logger=require(_0x2d5b('0x13'))(_0x2d5b('0x14'));var utils=require(_0x2d5b('0x15'));var config=require(_0x2d5b('0x16'));var licenseUtil=require(_0x2d5b('0x17'));var db=require(_0x2d5b('0x18'))['db'];function respondWithStatusCode(_0x594fad,_0x4a45b6){_0x4a45b6=_0x4a45b6||0xcc;return function(_0x327b75){if(_0x327b75){return _0x594fad[_0x2d5b('0x19')](_0x4a45b6);}return _0x594fad[_0x2d5b('0x1a')](_0x4a45b6)[_0x2d5b('0x1b')]();};}function respondWithResult(_0x40ec2c,_0x461969){_0x461969=_0x461969||0xc8;return function(_0x48d993){if(_0x48d993){return _0x40ec2c[_0x2d5b('0x1a')](_0x461969)['json'](_0x48d993);}};}function respondWithFilteredResult(_0x1a5624,_0x3ffe86){return function(_0x5e22bf){if(_0x5e22bf){var _0x1c5ee6=typeof _0x3ffe86[_0x2d5b('0x1c')]==='undefined'&&typeof _0x3ffe86[_0x2d5b('0x1d')]===_0x2d5b('0x1e');var _0x4cecb5=_0x5e22bf[_0x2d5b('0x1f')];var _0x2d4715=_0x1c5ee6?0x0:_0x3ffe86[_0x2d5b('0x1c')];var _0x8c32cc=_0x1c5ee6?_0x5e22bf[_0x2d5b('0x1f')]:_0x3ffe86[_0x2d5b('0x1c')]+_0x3ffe86[_0x2d5b('0x1d')];var _0x4f81db;if(_0x8c32cc>=_0x4cecb5){_0x8c32cc=_0x4cecb5;_0x4f81db=0xc8;}else{_0x4f81db=0xce;}_0x1a5624[_0x2d5b('0x1a')](_0x4f81db);return _0x1a5624[_0x2d5b('0x20')](_0x2d5b('0x21'),_0x2d4715+'-'+_0x8c32cc+'/'+_0x4cecb5)[_0x2d5b('0x22')](_0x5e22bf);}return null;};}function patchUpdates(_0x4a5201){return function(_0x13a713){try{jsonpatch['apply'](_0x13a713,_0x4a5201,!![]);}catch(_0xc3bd09){return BPromise[_0x2d5b('0x23')](_0xc3bd09);}return _0x13a713[_0x2d5b('0x24')]();};}function saveUpdates(_0x1f4902,_0x4521b3){return function(_0x52cd78){if(_0x52cd78){return _0x52cd78[_0x2d5b('0x25')](_0x1f4902)[_0x2d5b('0x26')](function(_0x5e93a5){return _0x5e93a5;});}return null;};}function removeEntity(_0x4e8372,_0x30336e){return function(_0x3089ac){if(_0x3089ac){return _0x3089ac['destroy']()['then'](function(){_0x4e8372[_0x2d5b('0x1a')](0xcc)[_0x2d5b('0x1b')]();});}};}function handleEntityNotFound(_0x52363c,_0x1cb328){return function(_0x1ce508){if(!_0x1ce508){_0x52363c[_0x2d5b('0x19')](0x194);}return _0x1ce508;};}function handleError(_0x110207,_0x365d82){_0x365d82=_0x365d82||0x1f4;return function(_0x51e47c){logger['error'](_0x51e47c[_0x2d5b('0x27')]);if(_0x51e47c[_0x2d5b('0x28')]){delete _0x51e47c[_0x2d5b('0x28')];}_0x110207[_0x2d5b('0x1a')](_0x365d82)[_0x2d5b('0x29')](_0x51e47c);};}exports['index']=function(_0x8e8fbc,_0x3a3966){var _0x3e30ae={},_0x2254d0={},_0x57a897={'count':0x0,'rows':[]};var _0x4c95ee=_[_0x2d5b('0x2a')](db[_0x2d5b('0x2b')][_0x2d5b('0x2c')],function(_0x19058e){return{'name':_0x19058e[_0x2d5b('0x2d')],'type':_0x19058e[_0x2d5b('0x2e')][_0x2d5b('0x2f')]};});_0x2254d0[_0x2d5b('0x30')]=_['map'](_0x4c95ee,_0x2d5b('0x28'));_0x2254d0['query']=_[_0x2d5b('0x31')](_0x8e8fbc[_0x2d5b('0x32')]);_0x2254d0['filters']=_[_0x2d5b('0x33')](_0x2254d0[_0x2d5b('0x30')],_0x2254d0[_0x2d5b('0x32')]);_0x3e30ae[_0x2d5b('0x34')]=_[_0x2d5b('0x33')](_0x2254d0[_0x2d5b('0x30')],qs['fields'](_0x8e8fbc[_0x2d5b('0x32')]['fields']));_0x3e30ae['attributes']=_0x3e30ae['attributes'][_0x2d5b('0x35')]?_0x3e30ae[_0x2d5b('0x34')]:_0x2254d0[_0x2d5b('0x30')];if(!_0x8e8fbc[_0x2d5b('0x32')][_0x2d5b('0x36')](_0x2d5b('0x37'))){_0x3e30ae[_0x2d5b('0x1d')]=qs['limit'](_0x8e8fbc['query'][_0x2d5b('0x1d')]);_0x3e30ae[_0x2d5b('0x1c')]=qs[_0x2d5b('0x1c')](_0x8e8fbc['query'][_0x2d5b('0x1c')]);}_0x3e30ae[_0x2d5b('0x38')]=qs['sort'](_0x8e8fbc[_0x2d5b('0x32')][_0x2d5b('0x39')]);_0x3e30ae[_0x2d5b('0x3a')]=qs[_0x2d5b('0x3b')](_['pick'](_0x8e8fbc['query'],_0x2254d0[_0x2d5b('0x3b')]),_0x4c95ee);if(_0x8e8fbc['query'][_0x2d5b('0x3c')]){_0x3e30ae[_0x2d5b('0x3a')]=_[_0x2d5b('0x3d')](_0x3e30ae[_0x2d5b('0x3a')],{'$or':_[_0x2d5b('0x2a')](_0x4c95ee,function(_0x292d02){if(_0x292d02[_0x2d5b('0x2e')]!==_0x2d5b('0x3e')){var _0x24b0e7={};_0x24b0e7[_0x292d02['name']]={'$like':'%'+_0x8e8fbc[_0x2d5b('0x32')]['filter']+'%'};return _0x24b0e7;}})});}_0x3e30ae=_[_0x2d5b('0x3d')]({},_0x3e30ae,_0x8e8fbc[_0x2d5b('0x3f')]);var _0x3bc415={'where':_0x3e30ae[_0x2d5b('0x3a')]};return db[_0x2d5b('0x2b')][_0x2d5b('0x1f')](_0x3bc415)[_0x2d5b('0x26')](function(_0xa324c4){_0x57a897[_0x2d5b('0x1f')]=_0xa324c4;if(_0x8e8fbc[_0x2d5b('0x32')]['includeAll']){_0x3e30ae[_0x2d5b('0x40')]=[{'all':!![]}];}return db[_0x2d5b('0x2b')]['findAll'](_0x3e30ae);})[_0x2d5b('0x26')](function(_0x28302e){_0x57a897['rows']=_0x28302e;return _0x57a897;})[_0x2d5b('0x26')](respondWithFilteredResult(_0x3a3966,_0x3e30ae))[_0x2d5b('0x41')](handleError(_0x3a3966,null));};exports[_0x2d5b('0x42')]=function(_0x3aa43d,_0x39786b){var _0x1187ca={'raw':!![],'where':{'id':_0x3aa43d[_0x2d5b('0x43')]['id']}},_0x4129c8={};_0x4129c8['model']=_[_0x2d5b('0x31')](db[_0x2d5b('0x2b')]['rawAttributes']);_0x4129c8[_0x2d5b('0x32')]=_[_0x2d5b('0x31')](_0x3aa43d[_0x2d5b('0x32')]);_0x4129c8['filters']=_[_0x2d5b('0x33')](_0x4129c8[_0x2d5b('0x30')],_0x4129c8[_0x2d5b('0x32')]);_0x1187ca[_0x2d5b('0x34')]=_['intersection'](_0x4129c8[_0x2d5b('0x30')],qs['fields'](_0x3aa43d['query'][_0x2d5b('0x44')]));_0x1187ca[_0x2d5b('0x34')]=_0x1187ca[_0x2d5b('0x34')]['length']?_0x1187ca[_0x2d5b('0x34')]:_0x4129c8['model'];if(_0x3aa43d[_0x2d5b('0x32')]['includeAll']){_0x1187ca[_0x2d5b('0x40')]=[{'all':!![]}];}_0x1187ca=_[_0x2d5b('0x3d')]({},_0x1187ca,_0x3aa43d[_0x2d5b('0x3f')]);return db[_0x2d5b('0x2b')][_0x2d5b('0x45')](_0x1187ca)[_0x2d5b('0x26')](handleEntityNotFound(_0x39786b,null))[_0x2d5b('0x26')](respondWithResult(_0x39786b,null))['catch'](handleError(_0x39786b,null));};exports[_0x2d5b('0x46')]=function(_0x157262,_0x35d1d6){return db[_0x2d5b('0x2b')][_0x2d5b('0x46')](_0x157262[_0x2d5b('0x47')],{})[_0x2d5b('0x26')](respondWithResult(_0x35d1d6,0xc9))[_0x2d5b('0x41')](handleError(_0x35d1d6,null));};exports[_0x2d5b('0x25')]=function(_0x5a5d28,_0x40ee6b){if(_0x5a5d28[_0x2d5b('0x47')]['id']){delete _0x5a5d28[_0x2d5b('0x47')]['id'];}return db[_0x2d5b('0x2b')]['find']({'where':{'id':_0x5a5d28[_0x2d5b('0x43')]['id']}})[_0x2d5b('0x26')](handleEntityNotFound(_0x40ee6b,null))['then'](saveUpdates(_0x5a5d28['body'],null))[_0x2d5b('0x26')](respondWithResult(_0x40ee6b,null))[_0x2d5b('0x41')](handleError(_0x40ee6b,null));};exports[_0x2d5b('0x48')]=function(_0x325f07,_0x4d246e){return db[_0x2d5b('0x2b')]['find']({'where':{'id':_0x325f07['params']['id']}})[_0x2d5b('0x26')](handleEntityNotFound(_0x4d246e,null))[_0x2d5b('0x26')](removeEntity(_0x4d246e,null))[_0x2d5b('0x41')](handleError(_0x4d246e,null));};exports[_0x2d5b('0x49')]=function(_0x5b6dd2,_0xa8f865){return db[_0x2d5b('0x2b')][_0x2d5b('0x49')]()['then'](respondWithResult(_0xa8f865,null))[_0x2d5b('0x41')](handleError(_0xa8f865,null));}; \ No newline at end of file +var _0xa786=['rows','catch','show','params','keys','find','create','update','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','destroy','then','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x5ef08e,_0x194c66){var _0x4eba0a=function(_0x249dfe){while(--_0x249dfe){_0x5ef08e['push'](_0x5ef08e['shift']());}};_0x4eba0a(++_0x194c66);}(_0xa786,0x1d2));var _0x6a78=function(_0x19e01c,_0x4a1a92){_0x19e01c=_0x19e01c-0x0;var _0x3d3aa9=_0xa786[_0x19e01c];return _0x3d3aa9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a78('0x0'));var jsonpatch=require(_0x6a78('0x1'));var rp=require(_0x6a78('0x2'));var moment=require(_0x6a78('0x3'));var BPromise=require(_0x6a78('0x4'));var Mustache=require(_0x6a78('0x5'));var util=require(_0x6a78('0x6'));var path=require('path');var sox=require(_0x6a78('0x7'));var csv=require(_0x6a78('0x8'));var ejs=require(_0x6a78('0x9'));var fs=require('fs');var fs_extra=require(_0x6a78('0xa'));var _=require(_0x6a78('0xb'));var squel=require(_0x6a78('0xc'));var crypto=require(_0x6a78('0xd'));var jsforce=require(_0x6a78('0xe'));var deskjs=require(_0x6a78('0xf'));var toCsv=require(_0x6a78('0x8'));var querystring=require(_0x6a78('0x10'));var Papa=require(_0x6a78('0x11'));var Redis=require(_0x6a78('0x12'));var authService=require(_0x6a78('0x13'));var qs=require(_0x6a78('0x14'));var as=require(_0x6a78('0x15'));var hardwareService=require(_0x6a78('0x16'));var logger=require(_0x6a78('0x17'))(_0x6a78('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a78('0x19'));var db=require(_0x6a78('0x1a'))['db'];function respondWithStatusCode(_0x4f8b72,_0x20fd59){_0x20fd59=_0x20fd59||0xcc;return function(_0x35b334){if(_0x35b334){return _0x4f8b72[_0x6a78('0x1b')](_0x20fd59);}return _0x4f8b72[_0x6a78('0x1c')](_0x20fd59)[_0x6a78('0x1d')]();};}function respondWithResult(_0xfca4fe,_0x9df26e){_0x9df26e=_0x9df26e||0xc8;return function(_0x5ac964){if(_0x5ac964){return _0xfca4fe['status'](_0x9df26e)['json'](_0x5ac964);}};}function respondWithFilteredResult(_0x36114f,_0x2deaa9){return function(_0xe2cf95){if(_0xe2cf95){var _0x535dc8=typeof _0x2deaa9[_0x6a78('0x1e')]===_0x6a78('0x1f')&&typeof _0x2deaa9['limit']===_0x6a78('0x1f');var _0x136df2=_0xe2cf95[_0x6a78('0x20')];var _0x44f646=_0x535dc8?0x0:_0x2deaa9[_0x6a78('0x1e')];var _0xe0e5e6=_0x535dc8?_0xe2cf95[_0x6a78('0x20')]:_0x2deaa9[_0x6a78('0x1e')]+_0x2deaa9['limit'];var _0x2d6ef3;if(_0xe0e5e6>=_0x136df2){_0xe0e5e6=_0x136df2;_0x2d6ef3=0xc8;}else{_0x2d6ef3=0xce;}_0x36114f['status'](_0x2d6ef3);return _0x36114f[_0x6a78('0x21')](_0x6a78('0x22'),_0x44f646+'-'+_0xe0e5e6+'/'+_0x136df2)[_0x6a78('0x23')](_0xe2cf95);}return null;};}function patchUpdates(_0x5d135e){return function(_0x3e0dfc){try{jsonpatch['apply'](_0x3e0dfc,_0x5d135e,!![]);}catch(_0x184637){return BPromise['reject'](_0x184637);}return _0x3e0dfc[_0x6a78('0x24')]();};}function saveUpdates(_0x49eb18,_0x598cde){return function(_0x4fbf83){if(_0x4fbf83){return _0x4fbf83['update'](_0x49eb18)['then'](function(_0x3b7bea){return _0x3b7bea;});}return null;};}function removeEntity(_0x3d96a2,_0x677af6){return function(_0x590657){if(_0x590657){return _0x590657[_0x6a78('0x25')]()[_0x6a78('0x26')](function(){_0x3d96a2[_0x6a78('0x1c')](0xcc)[_0x6a78('0x1d')]();});}};}function handleEntityNotFound(_0x56b7c2,_0xa401cb){return function(_0x5ba74f){if(!_0x5ba74f){_0x56b7c2[_0x6a78('0x1b')](0x194);}return _0x5ba74f;};}function handleError(_0x14a3c6,_0x8e8513){_0x8e8513=_0x8e8513||0x1f4;return function(_0x20db54){logger['error'](_0x20db54[_0x6a78('0x27')]);if(_0x20db54[_0x6a78('0x28')]){delete _0x20db54['name'];}_0x14a3c6[_0x6a78('0x1c')](_0x8e8513)['send'](_0x20db54);};}exports[_0x6a78('0x29')]=function(_0x48c692,_0x20a593){var _0x195978={},_0x573903={},_0x31ca28={'count':0x0,'rows':[]};var _0x231f1a=_['map'](db[_0x6a78('0x2a')][_0x6a78('0x2b')],function(_0x5abf0b){return{'name':_0x5abf0b[_0x6a78('0x2c')],'type':_0x5abf0b[_0x6a78('0x2d')][_0x6a78('0x2e')]};});_0x573903[_0x6a78('0x2f')]=_[_0x6a78('0x30')](_0x231f1a,_0x6a78('0x28'));_0x573903[_0x6a78('0x31')]=_['keys'](_0x48c692[_0x6a78('0x31')]);_0x573903[_0x6a78('0x32')]=_['intersection'](_0x573903[_0x6a78('0x2f')],_0x573903['query']);_0x195978[_0x6a78('0x33')]=_[_0x6a78('0x34')](_0x573903['model'],qs[_0x6a78('0x35')](_0x48c692[_0x6a78('0x31')]['fields']));_0x195978[_0x6a78('0x33')]=_0x195978['attributes'][_0x6a78('0x36')]?_0x195978[_0x6a78('0x33')]:_0x573903['model'];if(!_0x48c692['query'][_0x6a78('0x37')](_0x6a78('0x38'))){_0x195978[_0x6a78('0x39')]=qs[_0x6a78('0x39')](_0x48c692['query']['limit']);_0x195978[_0x6a78('0x1e')]=qs['offset'](_0x48c692[_0x6a78('0x31')][_0x6a78('0x1e')]);}_0x195978['order']=qs[_0x6a78('0x3a')](_0x48c692['query'][_0x6a78('0x3a')]);_0x195978[_0x6a78('0x3b')]=qs['filters'](_[_0x6a78('0x3c')](_0x48c692['query'],_0x573903[_0x6a78('0x32')]),_0x231f1a);if(_0x48c692[_0x6a78('0x31')][_0x6a78('0x3d')]){_0x195978[_0x6a78('0x3b')]=_[_0x6a78('0x3e')](_0x195978[_0x6a78('0x3b')],{'$or':_[_0x6a78('0x30')](_0x231f1a,function(_0x24c9ac){if(_0x24c9ac[_0x6a78('0x2d')]!=='VIRTUAL'){var _0x2ede51={};_0x2ede51[_0x24c9ac[_0x6a78('0x28')]]={'$like':'%'+_0x48c692[_0x6a78('0x31')][_0x6a78('0x3d')]+'%'};return _0x2ede51;}})});}_0x195978=_[_0x6a78('0x3e')]({},_0x195978,_0x48c692[_0x6a78('0x3f')]);var _0x403a67={'where':_0x195978[_0x6a78('0x3b')]};return db[_0x6a78('0x2a')][_0x6a78('0x20')](_0x403a67)[_0x6a78('0x26')](function(_0x4d3ad7){_0x31ca28[_0x6a78('0x20')]=_0x4d3ad7;if(_0x48c692['query'][_0x6a78('0x40')]){_0x195978[_0x6a78('0x41')]=[{'all':!![]}];}return db[_0x6a78('0x2a')]['findAll'](_0x195978);})[_0x6a78('0x26')](function(_0x2ec0f9){_0x31ca28[_0x6a78('0x42')]=_0x2ec0f9;return _0x31ca28;})[_0x6a78('0x26')](respondWithFilteredResult(_0x20a593,_0x195978))[_0x6a78('0x43')](handleError(_0x20a593,null));};exports[_0x6a78('0x44')]=function(_0x1e6efd,_0x415481){var _0x3146f8={'raw':!![],'where':{'id':_0x1e6efd[_0x6a78('0x45')]['id']}},_0x27221d={};_0x27221d[_0x6a78('0x2f')]=_[_0x6a78('0x46')](db[_0x6a78('0x2a')][_0x6a78('0x2b')]);_0x27221d['query']=_[_0x6a78('0x46')](_0x1e6efd[_0x6a78('0x31')]);_0x27221d[_0x6a78('0x32')]=_[_0x6a78('0x34')](_0x27221d[_0x6a78('0x2f')],_0x27221d[_0x6a78('0x31')]);_0x3146f8[_0x6a78('0x33')]=_[_0x6a78('0x34')](_0x27221d[_0x6a78('0x2f')],qs['fields'](_0x1e6efd[_0x6a78('0x31')][_0x6a78('0x35')]));_0x3146f8['attributes']=_0x3146f8[_0x6a78('0x33')][_0x6a78('0x36')]?_0x3146f8[_0x6a78('0x33')]:_0x27221d[_0x6a78('0x2f')];if(_0x1e6efd[_0x6a78('0x31')]['includeAll']){_0x3146f8[_0x6a78('0x41')]=[{'all':!![]}];}_0x3146f8=_['merge']({},_0x3146f8,_0x1e6efd[_0x6a78('0x3f')]);return db[_0x6a78('0x2a')][_0x6a78('0x47')](_0x3146f8)[_0x6a78('0x26')](handleEntityNotFound(_0x415481,null))[_0x6a78('0x26')](respondWithResult(_0x415481,null))[_0x6a78('0x43')](handleError(_0x415481,null));};exports[_0x6a78('0x48')]=function(_0x1f35e0,_0xede538){return db[_0x6a78('0x2a')][_0x6a78('0x48')](_0x1f35e0['body'],{})[_0x6a78('0x26')](respondWithResult(_0xede538,0xc9))[_0x6a78('0x43')](handleError(_0xede538,null));};exports[_0x6a78('0x49')]=function(_0x5a64e0,_0x4400f1){if(_0x5a64e0[_0x6a78('0x4a')]['id']){delete _0x5a64e0[_0x6a78('0x4a')]['id'];}return db[_0x6a78('0x2a')][_0x6a78('0x47')]({'where':{'id':_0x5a64e0[_0x6a78('0x45')]['id']}})['then'](handleEntityNotFound(_0x4400f1,null))['then'](saveUpdates(_0x5a64e0['body'],null))[_0x6a78('0x26')](respondWithResult(_0x4400f1,null))[_0x6a78('0x43')](handleError(_0x4400f1,null));};exports[_0x6a78('0x25')]=function(_0x253376,_0x2bcb06){return db[_0x6a78('0x2a')][_0x6a78('0x47')]({'where':{'id':_0x253376[_0x6a78('0x45')]['id']}})[_0x6a78('0x26')](handleEntityNotFound(_0x2bcb06,null))[_0x6a78('0x26')](removeEntity(_0x2bcb06,null))[_0x6a78('0x43')](handleError(_0x2bcb06,null));};exports[_0x6a78('0x4b')]=function(_0x9b1b2,_0x326e59){return db[_0x6a78('0x2a')][_0x6a78('0x4b')]()[_0x6a78('0x26')](respondWithResult(_0x326e59,null))['catch'](handleError(_0x326e59,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8680644..c0577e2 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 _0x741e=['exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x741e,0x19a));var _0xe741=function(_0x5c5067,_0x17c425){_0x5c5067=_0x5c5067-0x0;var _0x1817f5=_0x741e[_0x5c5067];return _0x1817f5;};'use strict';var _=require(_0xe741('0x0'));var util=require(_0xe741('0x1'));var logger=require(_0xe741('0x2'))(_0xe741('0x3'));var moment=require(_0xe741('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe741('0x5'));var rimraf=require('rimraf');var config=require(_0xe741('0x6'));var attributes=require(_0xe741('0x7'));module[_0xe741('0x8')]=function(_0x318aed,_0x33d6bb){return _0x318aed[_0xe741('0x9')](_0xe741('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aab=['lodash','util','api','moment','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x6aab,0x1a2));var _0xb6aa=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x6aab[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xb6aa('0x0'));var util=require(_0xb6aa('0x1'));var logger=require('../../config/logger')(_0xb6aa('0x2'));var moment=require(_0xb6aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb6aa('0x4'));var fs=require('fs');var path=require(_0xb6aa('0x5'));var rimraf=require('rimraf');var config=require(_0xb6aa('0x6'));var attributes=require(_0xb6aa('0x7'));module[_0xb6aa('0x8')]=function(_0x43c001,_0x311829){return _0x43c001[_0xb6aa('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0xb6aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 3e93df7..fd28cef 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 _0x980a=['request','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x145b79,_0x741fa7){var _0x5e73de=function(_0x3bbfb9){while(--_0x3bbfb9){_0x145b79['push'](_0x145b79['shift']());}};_0x5e73de(++_0x741fa7);}(_0x980a,0x106));var _0xa980=function(_0xd3db86,_0xc74509){_0xd3db86=_0xd3db86-0x0;var _0x562a9d=_0x980a[_0xd3db86];return _0x562a9d;};'use strict';var _=require(_0xa980('0x0'));var util=require(_0xa980('0x1'));var moment=require(_0xa980('0x2'));var BPromise=require(_0xa980('0x3'));var rs=require(_0xa980('0x4'));var fs=require('fs');var Redis=require(_0xa980('0x5'));var db=require(_0xa980('0x6'))['db'];var utils=require(_0xa980('0x7'));var logger=require(_0xa980('0x8'))('rpc');var config=require(_0xa980('0x9'));var jayson=require(_0xa980('0xa'));var client=jayson[_0xa980('0xb')][_0xa980('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32f226,_0x13b687,_0x5684a6){return new BPromise(function(_0x2ca476,_0x1f93fb){return client[_0xa980('0xd')](_0x32f226,_0x5684a6)['then'](function(_0x193d6a){logger[_0xa980('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x13b687,'request\x20sent');logger[_0xa980('0xf')](_0xa980('0x10'),_0x13b687,_0xa980('0x11'),JSON[_0xa980('0x12')](_0x193d6a));if(_0x193d6a[_0xa980('0x13')]){if(_0x193d6a[_0xa980('0x13')][_0xa980('0x14')]===0x1f4){logger[_0xa980('0x13')](_0xa980('0x15'),_0x13b687,_0x193d6a[_0xa980('0x13')][_0xa980('0x16')]);return _0x1f93fb(_0x193d6a[_0xa980('0x13')][_0xa980('0x16')]);}logger['error'](_0xa980('0x15'),_0x13b687,_0x193d6a[_0xa980('0x13')]['message']);return _0x2ca476(_0x193d6a['error'][_0xa980('0x16')]);}else{logger[_0xa980('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x13b687,_0xa980('0x11'));_0x2ca476(_0x193d6a[_0xa980('0x17')][_0xa980('0x16')]);}})[_0xa980('0x18')](function(_0x57d34b){logger['error'](_0xa980('0x15'),_0x13b687,_0x57d34b);_0x1f93fb(_0x57d34b);});});} \ No newline at end of file +var _0x0908=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3e70e8,_0x18a952){var _0x1d3c23=function(_0xb2cf24){while(--_0xb2cf24){_0x3e70e8['push'](_0x3e70e8['shift']());}};_0x1d3c23(++_0x18a952);}(_0x0908,0x14c));var _0x8090=function(_0x5d4fe2,_0x2a24a2){_0x5d4fe2=_0x5d4fe2-0x0;var _0x54d8b8=_0x0908[_0x5d4fe2];return _0x54d8b8;};'use strict';var _=require(_0x8090('0x0'));var util=require(_0x8090('0x1'));var moment=require(_0x8090('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8090('0x3'));var db=require(_0x8090('0x4'))['db'];var utils=require(_0x8090('0x5'));var logger=require(_0x8090('0x6'))(_0x8090('0x7'));var config=require(_0x8090('0x8'));var jayson=require(_0x8090('0x9'));var client=jayson['client'][_0x8090('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4088ed,_0x219847,_0x3b03d4){return new BPromise(function(_0x496db3,_0x57e3fc){return client[_0x8090('0xb')](_0x4088ed,_0x3b03d4)[_0x8090('0xc')](function(_0x487600){logger[_0x8090('0xd')](_0x8090('0xe'),_0x219847,_0x8090('0xf'));logger['debug'](_0x8090('0x10'),_0x219847,_0x8090('0xf'),JSON[_0x8090('0x11')](_0x487600));if(_0x487600['error']){if(_0x487600[_0x8090('0x12')][_0x8090('0x13')]===0x1f4){logger[_0x8090('0x12')](_0x8090('0xe'),_0x219847,_0x487600[_0x8090('0x12')][_0x8090('0x14')]);return _0x57e3fc(_0x487600[_0x8090('0x12')][_0x8090('0x14')]);}logger[_0x8090('0x12')](_0x8090('0xe'),_0x219847,_0x487600[_0x8090('0x12')][_0x8090('0x14')]);return _0x496db3(_0x487600[_0x8090('0x12')][_0x8090('0x14')]);}else{logger[_0x8090('0xd')](_0x8090('0xe'),_0x219847,_0x8090('0xf'));_0x496db3(_0x487600[_0x8090('0x15')][_0x8090('0x14')]);}})[_0x8090('0x16')](function(_0x45d7b1){logger[_0x8090('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x219847,_0x45d7b1);_0x57e3fc(_0x45d7b1);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9ede7db..f2e157c 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 _0xcf34=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','create','post','/:id/clone','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcf34,0x132));var _0x4cf3=function(_0x143cc6,_0xf94536){_0x143cc6=_0x143cc6-0x0;var _0x2cedba=_0xcf34[_0x143cc6];return _0x2cedba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cf3('0x0'));var timeout=require('connect-timeout');var express=require(_0x4cf3('0x1'));var router=express[_0x4cf3('0x2')]();var fs_extra=require(_0x4cf3('0x3'));var auth=require(_0x4cf3('0x4'));var interaction=require(_0x4cf3('0x5'));var config=require(_0x4cf3('0x6'));var controller=require(_0x4cf3('0x7'));router[_0x4cf3('0x8')]('/',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0xa')]);router['get'](_0x4cf3('0xb'),auth[_0x4cf3('0x9')](),controller[_0x4cf3('0xc')]);router['get'](_0x4cf3('0xd'),auth[_0x4cf3('0x9')](),controller['getSessions']);router[_0x4cf3('0x8')](_0x4cf3('0xe'),auth[_0x4cf3('0x9')](),controller[_0x4cf3('0xf')]);router[_0x4cf3('0x8')](_0x4cf3('0x10'),auth[_0x4cf3('0x9')](),timeout(_0x4cf3('0x11')),controller['getSummary']);router['post']('/',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0x12')]);router[_0x4cf3('0x13')](_0x4cf3('0x14'),auth[_0x4cf3('0x9')](),controller['clone']);router[_0x4cf3('0x15')]('/:id',auth[_0x4cf3('0x9')](),controller[_0x4cf3('0x16')]);router[_0x4cf3('0x17')](_0x4cf3('0xb'),auth['isAuthenticated'](),controller[_0x4cf3('0x18')]);module[_0x4cf3('0x19')]=router; \ No newline at end of file +var _0x405a=['/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions'];(function(_0x23bc6b,_0x2c05a1){var _0x1b5dc9=function(_0x551ec2){while(--_0x551ec2){_0x23bc6b['push'](_0x23bc6b['shift']());}};_0x1b5dc9(++_0x2c05a1);}(_0x405a,0x169));var _0xa405=function(_0x196ce1,_0x46e836){_0x196ce1=_0x196ce1-0x0;var _0x360a64=_0x405a[_0x196ce1];return _0x360a64;};'use strict';var multer=require(_0xa405('0x0'));var util=require(_0xa405('0x1'));var path=require(_0xa405('0x2'));var timeout=require('connect-timeout');var express=require(_0xa405('0x3'));var router=express[_0xa405('0x4')]();var fs_extra=require(_0xa405('0x5'));var auth=require(_0xa405('0x6'));var interaction=require(_0xa405('0x7'));var config=require(_0xa405('0x8'));var controller=require(_0xa405('0x9'));router[_0xa405('0xa')]('/',auth[_0xa405('0xb')](),controller[_0xa405('0xc')]);router[_0xa405('0xa')](_0xa405('0xd'),auth[_0xa405('0xb')](),controller[_0xa405('0xe')]);router[_0xa405('0xa')](_0xa405('0xf'),auth[_0xa405('0xb')](),controller[_0xa405('0x10')]);router[_0xa405('0xa')](_0xa405('0x11'),auth[_0xa405('0xb')](),controller[_0xa405('0x12')]);router[_0xa405('0xa')](_0xa405('0x13'),auth[_0xa405('0xb')](),timeout(_0xa405('0x14')),controller[_0xa405('0x15')]);router[_0xa405('0x16')]('/',auth[_0xa405('0xb')](),controller['create']);router[_0xa405('0x16')](_0xa405('0x17'),auth[_0xa405('0xb')](),controller['clone']);router[_0xa405('0x18')]('/:id',auth[_0xa405('0xb')](),controller[_0xa405('0x19')]);router[_0xa405('0x1a')](_0xa405('0xd'),auth[_0xa405('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b0ec7a2..ed809ab 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 _0xeb22=['BOOLEAN','sequelize','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x2e7297,_0x1f5ca6){var _0x2d4465=function(_0x48b3ed){while(--_0x48b3ed){_0x2e7297['push'](_0x2e7297['shift']());}};_0x2d4465(++_0x1f5ca6);}(_0xeb22,0x17b));var _0x2eb2=function(_0x5d0a06,_0x2f8043){_0x5d0a06=_0x5d0a06-0x0;var _0x2350ca=_0xeb22[_0x5d0a06];return _0x2350ca;};'use strict';var Sequelize=require(_0x2eb2('0x0'));var _=require('lodash');var util=require('util');module[_0x2eb2('0x1')]={'name':{'type':Sequelize[_0x2eb2('0x2')],'unique':_0x2eb2('0x3')},'description':{'type':Sequelize[_0x2eb2('0x2')]},'formData':{'type':Sequelize[_0x2eb2('0x4')](_0x2eb2('0x5')),'set':function(_0x43a0d9){if(_[_0x2eb2('0x6')](_0x43a0d9)){this[_0x2eb2('0x7')](_0x2eb2('0x8'),JSON['stringify'](_0x43a0d9));}else if(_[_0x2eb2('0x9')](_0x43a0d9)){this[_0x2eb2('0x7')](_0x2eb2('0x8'),_0x43a0d9);}else{this[_0x2eb2('0x7')](_0x2eb2('0x8'),util['format'](_0x2eb2('0xa'),this[_0x2eb2('0xb')]('name')||'',this['getDataValue'](_0x2eb2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2eb2('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2eb2('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xa1ac=['exports','name','STRING','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','util'];(function(_0x4c2283,_0x2924eb){var _0x5e37d0=function(_0x2742ef){while(--_0x2742ef){_0x4c2283['push'](_0x4c2283['shift']());}};_0x5e37d0(++_0x2924eb);}(_0xa1ac,0x10d));var _0xca1a=function(_0x15ca17,_0x5ee5e4){_0x15ca17=_0x15ca17-0x0;var _0x346c8b=_0xa1ac[_0x15ca17];return _0x346c8b;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xca1a('0x0'));module[_0xca1a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xca1a('0x2')},'description':{'type':Sequelize[_0xca1a('0x3')]},'formData':{'type':Sequelize[_0xca1a('0x4')](_0xca1a('0x5')),'set':function(_0x5c4d45){if(_['isObjectLike'](_0x5c4d45)){this[_0xca1a('0x6')](_0xca1a('0x7'),JSON[_0xca1a('0x8')](_0x5c4d45));}else if(_[_0xca1a('0x9')](_0x5c4d45)){this[_0xca1a('0x6')](_0xca1a('0x7'),_0x5c4d45);}else{this['setDataValue'](_0xca1a('0x7'),util[_0xca1a('0xa')](_0xca1a('0xb'),this['getDataValue']('name')||'',this[_0xca1a('0xc')](_0xca1a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xca1a('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xca1a('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 1c6b8c3..aec5bbc 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 _0x7e1a=['index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Projects','UserProfileResource','sendStatus','stack','name','send'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0x4c830a,_0x1284c4){_0x4c830a=_0x4c830a-0x0;var _0x3862d8=_0x7e1a[_0x4c830a];return _0x3862d8;};'use strict';var emlformat=require(_0xa7e1('0x0'));var rimraf=require(_0xa7e1('0x1'));var zipdir=require(_0xa7e1('0x2'));var jsonpatch=require(_0xa7e1('0x3'));var rp=require(_0xa7e1('0x4'));var moment=require(_0xa7e1('0x5'));var BPromise=require(_0xa7e1('0x6'));var Mustache=require(_0xa7e1('0x7'));var util=require('util');var path=require(_0xa7e1('0x8'));var sox=require(_0xa7e1('0x9'));var csv=require(_0xa7e1('0xa'));var ejs=require(_0xa7e1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7e1('0xc'));var squel=require(_0xa7e1('0xd'));var crypto=require(_0xa7e1('0xe'));var jsforce=require(_0xa7e1('0xf'));var deskjs=require(_0xa7e1('0x10'));var toCsv=require(_0xa7e1('0xa'));var querystring=require(_0xa7e1('0x11'));var Papa=require('papaparse');var Redis=require(_0xa7e1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa7e1('0x13'));var hardwareService=require(_0xa7e1('0x14'));var logger=require(_0xa7e1('0x15'))(_0xa7e1('0x16'));var utils=require('../../config/utils');var config=require(_0xa7e1('0x17'));var licenseUtil=require(_0xa7e1('0x18'));var db=require(_0xa7e1('0x19'))['db'];function respondWithStatusCode(_0x33edcc,_0x2b9a42){_0x2b9a42=_0x2b9a42||0xcc;return function(_0x57e823){if(_0x57e823){return _0x33edcc['sendStatus'](_0x2b9a42);}return _0x33edcc[_0xa7e1('0x1a')](_0x2b9a42)[_0xa7e1('0x1b')]();};}function respondWithResult(_0x3c0edd,_0x4db6a2){_0x4db6a2=_0x4db6a2||0xc8;return function(_0x23fc30){if(_0x23fc30){return _0x3c0edd[_0xa7e1('0x1a')](_0x4db6a2)[_0xa7e1('0x1c')](_0x23fc30);}};}function respondWithFilteredResult(_0x44b1db,_0x4bbaa1){return function(_0x495ace){if(_0x495ace){var _0x25706e=typeof _0x4bbaa1[_0xa7e1('0x1d')]===_0xa7e1('0x1e')&&typeof _0x4bbaa1[_0xa7e1('0x1f')]===_0xa7e1('0x1e');var _0x351f61=_0x495ace[_0xa7e1('0x20')];var _0x1984bb=_0x25706e?0x0:_0x4bbaa1[_0xa7e1('0x1d')];var _0x737a8b=_0x25706e?_0x495ace['count']:_0x4bbaa1[_0xa7e1('0x1d')]+_0x4bbaa1['limit'];var _0xbd158b;if(_0x737a8b>=_0x351f61){_0x737a8b=_0x351f61;_0xbd158b=0xc8;}else{_0xbd158b=0xce;}_0x44b1db[_0xa7e1('0x1a')](_0xbd158b);return _0x44b1db[_0xa7e1('0x21')](_0xa7e1('0x22'),_0x1984bb+'-'+_0x737a8b+'/'+_0x351f61)[_0xa7e1('0x1c')](_0x495ace);}return null;};}function patchUpdates(_0x8840e){return function(_0x365b6e){try{jsonpatch[_0xa7e1('0x23')](_0x365b6e,_0x8840e,!![]);}catch(_0x5c8de3){return BPromise['reject'](_0x5c8de3);}return _0x365b6e[_0xa7e1('0x24')]();};}function saveUpdates(_0x22da9b,_0x4e3f24){return function(_0x3fdb4d){if(_0x3fdb4d){return _0x3fdb4d[_0xa7e1('0x25')](_0x22da9b)['then'](function(_0x264b50){return _0x264b50;});}return null;};}function removeEntity(_0x2b654d,_0x31af04){return function(_0x2c2661){if(_0x2c2661){return _0x2c2661[_0xa7e1('0x26')]()[_0xa7e1('0x27')](function(){var _0x4a644f=_0x2c2661[_0xa7e1('0x28')]({'plain':!![]});var _0x296ff4=_0xa7e1('0x29');return db[_0xa7e1('0x2a')][_0xa7e1('0x26')]({'where':{'type':_0x296ff4,'resourceId':_0x4a644f['id']}})[_0xa7e1('0x27')](function(){return _0x2c2661;});})[_0xa7e1('0x27')](function(){_0x2b654d[_0xa7e1('0x1a')](0xcc)[_0xa7e1('0x1b')]();});}};}function handleEntityNotFound(_0x830540,_0x3fe524){return function(_0x479861){if(!_0x479861){_0x830540[_0xa7e1('0x2b')](0x194);}return _0x479861;};}function handleError(_0x4696ee,_0x44f4f5){_0x44f4f5=_0x44f4f5||0x1f4;return function(_0x1263f1){logger['error'](_0x1263f1[_0xa7e1('0x2c')]);if(_0x1263f1[_0xa7e1('0x2d')]){delete _0x1263f1['name'];}_0x4696ee[_0xa7e1('0x1a')](_0x44f4f5)[_0xa7e1('0x2e')](_0x1263f1);};}exports[_0xa7e1('0x2f')]=function(_0x411c76,_0x27506f){var _0x14b513={},_0x41a06b={},_0x4feec2={'count':0x0,'rows':[]};var _0x320219=_[_0xa7e1('0x30')](db[_0xa7e1('0x31')][_0xa7e1('0x32')],function(_0x615e57){return{'name':_0x615e57[_0xa7e1('0x33')],'type':_0x615e57[_0xa7e1('0x34')][_0xa7e1('0x35')]};});_0x41a06b[_0xa7e1('0x36')]=_['map'](_0x320219,'name');_0x41a06b['query']=_[_0xa7e1('0x37')](_0x411c76['query']);_0x41a06b['filters']=_[_0xa7e1('0x38')](_0x41a06b['model'],_0x41a06b[_0xa7e1('0x39')]);_0x14b513[_0xa7e1('0x3a')]=_[_0xa7e1('0x38')](_0x41a06b[_0xa7e1('0x36')],qs[_0xa7e1('0x3b')](_0x411c76['query'][_0xa7e1('0x3b')]));_0x14b513[_0xa7e1('0x3a')]=_0x14b513[_0xa7e1('0x3a')][_0xa7e1('0x3c')]?_0x14b513[_0xa7e1('0x3a')]:_0x41a06b['model'];if(!_0x411c76[_0xa7e1('0x39')][_0xa7e1('0x3d')](_0xa7e1('0x3e'))){_0x14b513[_0xa7e1('0x1f')]=qs[_0xa7e1('0x1f')](_0x411c76[_0xa7e1('0x39')][_0xa7e1('0x1f')]);_0x14b513[_0xa7e1('0x1d')]=qs[_0xa7e1('0x1d')](_0x411c76[_0xa7e1('0x39')][_0xa7e1('0x1d')]);}_0x14b513[_0xa7e1('0x3f')]=qs[_0xa7e1('0x40')](_0x411c76['query'][_0xa7e1('0x40')]);_0x14b513['where']=qs[_0xa7e1('0x41')](_[_0xa7e1('0x42')](_0x411c76['query'],_0x41a06b['filters']),_0x320219);if(_0x411c76['query']['filter']){_0x14b513[_0xa7e1('0x43')]=_[_0xa7e1('0x44')](_0x14b513[_0xa7e1('0x43')],{'$or':_[_0xa7e1('0x30')](_0x320219,function(_0x1e27c2){if(_0x1e27c2['type']!==_0xa7e1('0x45')){var _0x75e5d8={};_0x75e5d8[_0x1e27c2[_0xa7e1('0x2d')]]={'$like':'%'+_0x411c76[_0xa7e1('0x39')][_0xa7e1('0x46')]+'%'};return _0x75e5d8;}})});}_0x14b513=_[_0xa7e1('0x44')]({},_0x14b513,_0x411c76[_0xa7e1('0x47')]);var _0x1012ab={'where':_0x14b513[_0xa7e1('0x43')]};return db[_0xa7e1('0x31')]['count'](_0x1012ab)[_0xa7e1('0x27')](function(_0x55aed7){_0x4feec2[_0xa7e1('0x20')]=_0x55aed7;if(_0x411c76['query'][_0xa7e1('0x48')]){_0x14b513[_0xa7e1('0x49')]=[{'all':!![]}];}return db[_0xa7e1('0x31')][_0xa7e1('0x4a')](_0x14b513);})[_0xa7e1('0x27')](function(_0x45950a){_0x4feec2[_0xa7e1('0x4b')]=_0x45950a;return _0x4feec2;})[_0xa7e1('0x27')](respondWithFilteredResult(_0x27506f,_0x14b513))[_0xa7e1('0x4c')](handleError(_0x27506f,null));};exports[_0xa7e1('0x4d')]=function(_0x5ec3f3,_0x1198ad){var _0x3d7b2e={'raw':![],'where':{'id':_0x5ec3f3[_0xa7e1('0x4e')]['id']}},_0x2bc0f5={};_0x2bc0f5[_0xa7e1('0x36')]=_['keys'](db['JscriptyProject'][_0xa7e1('0x32')]);_0x2bc0f5[_0xa7e1('0x39')]=_[_0xa7e1('0x37')](_0x5ec3f3[_0xa7e1('0x39')]);_0x2bc0f5[_0xa7e1('0x41')]=_[_0xa7e1('0x38')](_0x2bc0f5[_0xa7e1('0x36')],_0x2bc0f5[_0xa7e1('0x39')]);_0x3d7b2e[_0xa7e1('0x3a')]=_[_0xa7e1('0x38')](_0x2bc0f5[_0xa7e1('0x36')],qs['fields'](_0x5ec3f3[_0xa7e1('0x39')][_0xa7e1('0x3b')]));_0x3d7b2e[_0xa7e1('0x3a')]=_0x3d7b2e[_0xa7e1('0x3a')]['length']?_0x3d7b2e[_0xa7e1('0x3a')]:_0x2bc0f5[_0xa7e1('0x36')];if(_0x5ec3f3[_0xa7e1('0x39')][_0xa7e1('0x48')]){_0x3d7b2e[_0xa7e1('0x49')]=[{'all':!![]}];}_0x3d7b2e=_[_0xa7e1('0x44')]({},_0x3d7b2e,_0x5ec3f3['options']);return db[_0xa7e1('0x31')][_0xa7e1('0x4f')](_0x3d7b2e)[_0xa7e1('0x27')](handleEntityNotFound(_0x1198ad,null))[_0xa7e1('0x27')](respondWithResult(_0x1198ad,null))[_0xa7e1('0x4c')](handleError(_0x1198ad,null));};exports['create']=function(_0x5b8069,_0x5576eb){return db[_0xa7e1('0x31')][_0xa7e1('0x50')](_0x5b8069[_0xa7e1('0x51')],{})[_0xa7e1('0x27')](function(_0x5812b9){var _0x483b57=_0x5b8069[_0xa7e1('0x52')][_0xa7e1('0x28')]({'plain':!![]});if(!_0x483b57)throw new Error(_0xa7e1('0x53'));if(_0x483b57[_0xa7e1('0x54')]===_0xa7e1('0x52')){var _0x327b3c=_0x5812b9[_0xa7e1('0x28')]({'plain':!![]});var _0x3c059c=_0xa7e1('0x29');return db['UserProfileSection'][_0xa7e1('0x4f')]({'where':{'name':_0x3c059c,'userProfileId':_0x483b57[_0xa7e1('0x55')]},'raw':!![]})[_0xa7e1('0x27')](function(_0x161ab9){if(_0x161ab9&&_0x161ab9[_0xa7e1('0x56')]===0x0){return db[_0xa7e1('0x2a')][_0xa7e1('0x50')]({'name':_0x327b3c[_0xa7e1('0x2d')],'resourceId':_0x327b3c['id'],'type':_0x161ab9['name'],'sectionId':_0x161ab9['id']},{})[_0xa7e1('0x27')](function(){return _0x5812b9;});}else{return _0x5812b9;}})[_0xa7e1('0x4c')](function(_0x13620e){logger[_0xa7e1('0x57')](_0xa7e1('0x58'),_0x13620e);throw _0x13620e;});}return _0x5812b9;})[_0xa7e1('0x27')](respondWithResult(_0x5576eb,0xc9))[_0xa7e1('0x4c')](handleError(_0x5576eb,null));};exports[_0xa7e1('0x59')]=function(_0x522659,_0x5240a9){var _0x1d6527={'where':{'id':_0x522659[_0xa7e1('0x4e')]['id']}},_0x4e07a0={};_0x4e07a0[_0xa7e1('0x36')]=_[_0xa7e1('0x37')](db['JscriptyProject']['rawAttributes']);_0x1d6527[_0xa7e1('0x3a')]=_[_0xa7e1('0x38')](_0x4e07a0[_0xa7e1('0x36')],qs[_0xa7e1('0x3b')](_0x522659[_0xa7e1('0x39')][_0xa7e1('0x3b')]));_0x1d6527[_0xa7e1('0x3a')]=_0x1d6527[_0xa7e1('0x3a')][_0xa7e1('0x3c')]?_0x1d6527[_0xa7e1('0x3a')]:_0x4e07a0['model'];if(_0x522659[_0xa7e1('0x39')][_0xa7e1('0x48')]){_0x1d6527['include']=[{'all':!![]}];}_0x1d6527=_['merge']({},_0x1d6527,_0x522659[_0xa7e1('0x47')]);return db[_0xa7e1('0x31')][_0xa7e1('0x4f')](_0x1d6527)[_0xa7e1('0x27')](handleEntityNotFound(_0x5240a9,null))[_0xa7e1('0x27')](function(_0xfedc7d){if(_0xfedc7d){var _0x502b44=_0xfedc7d['get']({'plain':!![]});_0x502b44=qs[_0xa7e1('0x5a')](_0x502b44,['id',_0xa7e1('0x5b'),_0xa7e1('0x5c')]);_0x522659['body']=_[_0xa7e1('0x5a')](_0x522659[_0xa7e1('0x51')],['id','createdAt','updatedAt']);return db['JscriptyProject'][_0xa7e1('0x50')](_['merge'](_0x502b44,_0x522659[_0xa7e1('0x51')]),{'include':_0x522659[_0xa7e1('0x39')][_0xa7e1('0x48')]?[{'all':!![]}]:undefined})[_0xa7e1('0x27')](function(_0x404733){var _0xf1b94f=_0x522659[_0xa7e1('0x52')]['get']({'plain':!![]});if(!_0xf1b94f)throw new Error(_0xa7e1('0x53'));if(_0xf1b94f['role']===_0xa7e1('0x52')){var _0x445941=_0x404733['get']({'plain':!![]});var _0x13c884='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x13c884,'userProfileId':_0xf1b94f[_0xa7e1('0x55')]},'raw':!![]})[_0xa7e1('0x27')](function(_0x32512f){if(_0x32512f&&_0x32512f[_0xa7e1('0x56')]===0x0){return db[_0xa7e1('0x2a')][_0xa7e1('0x50')]({'name':_0x445941[_0xa7e1('0x2d')],'resourceId':_0x445941['id'],'type':_0x32512f[_0xa7e1('0x2d')],'sectionId':_0x32512f['id']},{})[_0xa7e1('0x27')](function(){return _0x404733;});}else{return _0x404733;}})[_0xa7e1('0x4c')](function(_0x28fe67){logger['error'](_0xa7e1('0x58'),_0x28fe67);throw _0x28fe67;});}return _0x404733;});}})[_0xa7e1('0x27')](respondWithResult(_0x5240a9,0xc9))[_0xa7e1('0x4c')](handleError(_0x5240a9,null));};exports['update']=function(_0x4b3426,_0x4bb292){if(_0x4b3426['body']['id']){delete _0x4b3426[_0xa7e1('0x51')]['id'];}return db[_0xa7e1('0x31')][_0xa7e1('0x4f')]({'where':{'id':_0x4b3426[_0xa7e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4bb292,null))[_0xa7e1('0x27')](saveUpdates(_0x4b3426[_0xa7e1('0x51')],null))[_0xa7e1('0x27')](respondWithResult(_0x4bb292,null))['catch'](handleError(_0x4bb292,null));};exports['destroy']=function(_0x40d495,_0x5e4b68){return db['JscriptyProject'][_0xa7e1('0x4f')]({'where':{'id':_0x40d495[_0xa7e1('0x4e')]['id']}})[_0xa7e1('0x27')](handleEntityNotFound(_0x5e4b68,null))[_0xa7e1('0x27')](removeEntity(_0x5e4b68,null))['catch'](handleError(_0x5e4b68,null));};exports['getSessions']=function(_0xff8e9c,_0x1aa174,_0x1c69ad){var _0x40e840={'raw':!![],'where':{}};var _0x33b8cc={};var _0x2affca={'count':0x0,'rows':[]};return db[_0xa7e1('0x31')][_0xa7e1('0x5d')]({'where':{'id':_0xff8e9c['params']['id']}})[_0xa7e1('0x27')](handleEntityNotFound(_0x1aa174,null))[_0xa7e1('0x27')](function(_0x2f7be8){if(_0x2f7be8){_0x33b8cc[_0xa7e1('0x36')]=_[_0xa7e1('0x37')](db[_0xa7e1('0x5e')][_0xa7e1('0x32')]);_0x33b8cc[_0xa7e1('0x39')]=_['keys'](_0xff8e9c[_0xa7e1('0x39')]);_0x33b8cc[_0xa7e1('0x41')]=_[_0xa7e1('0x38')](_0x33b8cc['model'],_0x33b8cc['query']);_0x40e840['attributes']=_[_0xa7e1('0x38')](_0x33b8cc[_0xa7e1('0x36')],qs[_0xa7e1('0x3b')](_0xff8e9c[_0xa7e1('0x39')][_0xa7e1('0x3b')]));_0x40e840['attributes']=_0x40e840[_0xa7e1('0x3a')][_0xa7e1('0x3c')]?_0x40e840[_0xa7e1('0x3a')]:_0x33b8cc['model'];if(!_0xff8e9c[_0xa7e1('0x39')]['hasOwnProperty'](_0xa7e1('0x3e'))){_0x40e840[_0xa7e1('0x1f')]=qs[_0xa7e1('0x1f')](_0xff8e9c[_0xa7e1('0x39')][_0xa7e1('0x1f')]);_0x40e840[_0xa7e1('0x1d')]=qs[_0xa7e1('0x1d')](_0xff8e9c[_0xa7e1('0x39')][_0xa7e1('0x1d')]);}_0x40e840[_0xa7e1('0x3f')]=qs[_0xa7e1('0x40')](_0xff8e9c[_0xa7e1('0x39')][_0xa7e1('0x40')]);_0x40e840[_0xa7e1('0x43')]=qs[_0xa7e1('0x41')](_['pick'](_0xff8e9c['query'],_0x33b8cc[_0xa7e1('0x41')]));_0x40e840[_0xa7e1('0x43')][_0xa7e1('0x5f')]=_0x2f7be8['id'];if(_0xff8e9c[_0xa7e1('0x39')]['filter']){_0x40e840[_0xa7e1('0x43')]=_[_0xa7e1('0x44')](_0x40e840[_0xa7e1('0x43')],{'$or':_[_0xa7e1('0x30')](_0x40e840[_0xa7e1('0x3a')],function(_0x49e28a){var _0x2f8166={};_0x2f8166[_0x49e28a]={'$like':'%'+_0xff8e9c[_0xa7e1('0x39')][_0xa7e1('0x46')]+'%'};return _0x2f8166;})});}_0x40e840=_[_0xa7e1('0x44')]({},_0x40e840,_0xff8e9c[_0xa7e1('0x47')]);return db[_0xa7e1('0x5e')][_0xa7e1('0x20')]({'where':_0x40e840[_0xa7e1('0x43')]})['then'](function(_0x2e069d){_0x2affca[_0xa7e1('0x20')]=_0x2e069d;if(_0xff8e9c['query'][_0xa7e1('0x48')]){_0x40e840[_0xa7e1('0x49')]=[{'all':!![]}];}return db[_0xa7e1('0x5e')]['findAll'](_0x40e840);})[_0xa7e1('0x27')](function(_0x5f3995){_0x2affca[_0xa7e1('0x4b')]=_0x5f3995;return _0x2affca;});}})['then'](respondWithFilteredResult(_0x1aa174,_0x40e840))[_0xa7e1('0x4c')](handleError(_0x1aa174,null));};exports[_0xa7e1('0x60')]=function(_0x3602cb,_0x62176d,_0x58dce2){var _0x244ca0={'raw':!![],'where':{}};var _0x2cdbaa={};var _0x15b02b={'count':0x0,'rows':[]};return db[_0xa7e1('0x31')][_0xa7e1('0x5d')]({'where':{'id':_0x3602cb[_0xa7e1('0x4e')]['id']}})[_0xa7e1('0x27')](handleEntityNotFound(_0x62176d,null))[_0xa7e1('0x27')](function(_0x25f063){if(_0x25f063){_0x2cdbaa[_0xa7e1('0x36')]=_[_0xa7e1('0x37')](db[_0xa7e1('0x61')][_0xa7e1('0x32')]);_0x2cdbaa[_0xa7e1('0x39')]=_['keys'](_0x3602cb[_0xa7e1('0x39')]);_0x2cdbaa[_0xa7e1('0x41')]=_['intersection'](_0x2cdbaa[_0xa7e1('0x36')],_0x2cdbaa[_0xa7e1('0x39')]);_0x244ca0[_0xa7e1('0x3a')]=_['intersection'](_0x2cdbaa[_0xa7e1('0x36')],qs[_0xa7e1('0x3b')](_0x3602cb[_0xa7e1('0x39')][_0xa7e1('0x3b')]));_0x244ca0['attributes']=_0x244ca0[_0xa7e1('0x3a')][_0xa7e1('0x3c')]?_0x244ca0[_0xa7e1('0x3a')]:_0x2cdbaa[_0xa7e1('0x36')];if(!_0x3602cb['query'][_0xa7e1('0x3d')](_0xa7e1('0x3e'))){_0x244ca0[_0xa7e1('0x1f')]=qs[_0xa7e1('0x1f')](_0x3602cb[_0xa7e1('0x39')]['limit']);_0x244ca0[_0xa7e1('0x1d')]=qs[_0xa7e1('0x1d')](_0x3602cb[_0xa7e1('0x39')][_0xa7e1('0x1d')]);}_0x244ca0[_0xa7e1('0x3f')]=qs[_0xa7e1('0x40')](_0x3602cb[_0xa7e1('0x39')][_0xa7e1('0x40')]);_0x244ca0[_0xa7e1('0x43')]=qs[_0xa7e1('0x41')](_['pick'](_0x3602cb['query'],_0x2cdbaa[_0xa7e1('0x41')]));_0x244ca0[_0xa7e1('0x43')]['ProjectId']=_0x25f063['id'];if(_0x3602cb[_0xa7e1('0x39')][_0xa7e1('0x46')]){_0x244ca0[_0xa7e1('0x43')]=_[_0xa7e1('0x44')](_0x244ca0[_0xa7e1('0x43')],{'$or':_[_0xa7e1('0x30')](_0x244ca0[_0xa7e1('0x3a')],function(_0x5dc6fc){var _0x433f7d={};_0x433f7d[_0x5dc6fc]={'$like':'%'+_0x3602cb[_0xa7e1('0x39')]['filter']+'%'};return _0x433f7d;})});}_0x244ca0=_[_0xa7e1('0x44')]({},_0x244ca0,_0x3602cb[_0xa7e1('0x47')]);return db[_0xa7e1('0x61')][_0xa7e1('0x20')]({'where':_0x244ca0['where']})[_0xa7e1('0x27')](function(_0x4789f6){_0x15b02b[_0xa7e1('0x20')]=_0x4789f6;if(_0x3602cb[_0xa7e1('0x39')][_0xa7e1('0x48')]){_0x244ca0[_0xa7e1('0x49')]=[{'all':!![]}];}return db[_0xa7e1('0x61')][_0xa7e1('0x4a')](_0x244ca0);})[_0xa7e1('0x27')](function(_0x1b44a6){_0x15b02b[_0xa7e1('0x4b')]=_0x1b44a6;return _0x15b02b;});}})['then'](respondWithFilteredResult(_0x62176d,_0x244ca0))[_0xa7e1('0x4c')](handleError(_0x62176d,null));};function char(_0x6ab5be){return _0xa7e1('0x62')===typeof _0x6ab5be?String[_0xa7e1('0x63')][_0xa7e1('0x23')](null,arguments):_0x6ab5be;}function needsEncapsulation(_0x2d5a7d){return!!_0x2d5a7d&&(_0x2d5a7d[_0xa7e1('0x64')]()['indexOf'](char(0xd))>=0x0||_0x2d5a7d['toString']()[_0xa7e1('0x65')](char(0xa))>=0x0||_0x2d5a7d['toString']()[_0xa7e1('0x65')](char(0x2c))>=0x0||_0x2d5a7d['toString']()[_0xa7e1('0x65')](char(0x22))>=0x0);}function encapsulate(_0x5e45ae){var _0x1753de=char(0x22),_0x16db41='\x5c'+char(0x22),_0x457f57=_0x5e45ae[_0xa7e1('0x64')]()[_0xa7e1('0x66')](new RegExp(_0x1753de,'g'),_0x16db41);return _0x1753de+_0x457f57+_0x1753de;}exports[_0xa7e1('0x67')]=function(_0x11edf1,_0x1d1df6,_0x2d0876){var _0x3b395c,_0x5491b5;var _0x493239={'where':{'ProjectId':_0x11edf1[_0xa7e1('0x4e')]['id']}};if(_0x11edf1[_0xa7e1('0x39')][_0xa7e1('0x68')]){_0x493239[_0xa7e1('0x43')][_0xa7e1('0x69')]=JSON[_0xa7e1('0x6a')](_0x11edf1[_0xa7e1('0x39')]['startTime']);}return db[_0xa7e1('0x5e')][_0xa7e1('0x4a')](_0x493239)[_0xa7e1('0x27')](handleEntityNotFound(_0x1d1df6,null))[_0xa7e1('0x27')](function(_0x142610){if(_0x142610){_0x3b395c=_0x142610;return db[_0xa7e1('0x6b')]['findAll']({'where':{'SessionId':{'$in':_[_0xa7e1('0x30')](_0x3b395c,'id')},'ProjectId':_0x11edf1[_0xa7e1('0x4e')]['id']},'order':_0xa7e1('0x6c')});}})[_0xa7e1('0x27')](handleEntityNotFound(_0x1d1df6,null))[_0xa7e1('0x27')](function(_0x4b529b){if(_0x4b529b){_0x5491b5=_0x4b529b;var _0x2fa994={};for(var _0x507744=0x0,_0xc05a34=_0x5491b5['length'];_0x507744<_0xc05a34;_0x507744++){if(!_0x2fa994['hasOwnProperty'](_0x5491b5[_0x507744][_0xa7e1('0x6d')])){_0x2fa994[_0x5491b5[_0x507744][_0xa7e1('0x6d')]]=needsEncapsulation(_0x5491b5[_0x507744][_0xa7e1('0x6e')])?encapsulate(_0x5491b5[_0x507744][_0xa7e1('0x6e')]):_0x5491b5[_0x507744][_0xa7e1('0x6e')];}}var _0x47bbcd=[],_0x495ae0={};for(var _0x445b97=0x0,_0x1225cb=_0x3b395c[_0xa7e1('0x3c')];_0x445b97<_0x1225cb;_0x445b97++){_0x495ae0={'ProjectId':_0x11edf1[_0xa7e1('0x4e')]['id'],'SessionId':_0x3b395c[_0x445b97]['id'],'StartTime':moment(_0x3b395c[_0x445b97]['starttime'])[_0xa7e1('0x6f')](_0xa7e1('0x70'))};for(var _0x3118a2=0x0,_0x4de447=_0x5491b5[_0xa7e1('0x3c')];_0x3118a2<_0x4de447;_0x3118a2++){if(_0x5491b5[_0x3118a2][_0xa7e1('0x71')]==_0x3b395c[_0x445b97]['id']&&_0x2fa994[_0xa7e1('0x3d')](_0x5491b5[_0x3118a2][_0xa7e1('0x6d')])){_0x495ae0[_0x2fa994[_0x5491b5[_0x3118a2]['questionId']]]=_0x5491b5[_0x3118a2][_0xa7e1('0x72')];}}for(var _0x31423a in _0x2fa994){if(!_0x495ae0['hasOwnProperty'](_0x2fa994[_0x31423a])){_0x495ae0[_0x2fa994[_0x31423a]]=null;}}_0x47bbcd[_0xa7e1('0x73')](_0x495ae0);}return _0x47bbcd;}})[_0xa7e1('0x27')](function(_0xaa9e38){if(!_['isEmpty'](_0xaa9e38)){var _0x42f57a=toCsv(_0xaa9e38);var _0x115371=Date[_0xa7e1('0x74')]();fs['writeFileSync'](util['format'](_0xa7e1('0x75'),_0x11edf1[_0xa7e1('0x4e')]['id'],_0x115371),_0x42f57a);_0x1d1df6[_0xa7e1('0x76')](_0xa7e1('0x77'),_0xa7e1('0x78')+util['format'](_0xa7e1('0x79'),_0x11edf1['params']['id'],_0x115371));_0x1d1df6[_0xa7e1('0x76')](_0xa7e1('0x7a'),_0xa7e1('0x7b'));return _0x1d1df6[_0xa7e1('0x7c')](util[_0xa7e1('0x6f')](_0xa7e1('0x75'),_0x11edf1[_0xa7e1('0x4e')]['id'],_0x115371));}else{return _0x1d1df6[_0xa7e1('0x2b')](0xcc);}})[_0xa7e1('0x4c')](handleError(_0x1d1df6,null));}; \ No newline at end of file +var _0xeb3b=['fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','apply','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','get','Projects','UserProfileResource','error','name','map','JscriptyProject','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xeb3b[_0x57d13b];return _0x467696;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){var _0x2bc188=_0x278fe4[_0xbeb3('0x25')]({'plain':!![]});var _0x84921a=_0xbeb3('0x26');return db[_0xbeb3('0x27')]['destroy']({'where':{'type':_0x84921a,'resourceId':_0x2bc188['id']}})['then'](function(){return _0x278fe4;});})[_0xbeb3('0x23')](function(){_0x55a59d['status'](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0xda808c,_0x138adf){return function(_0x400f65){if(!_0x400f65){_0xda808c['sendStatus'](0x194);}return _0x400f65;};}function handleError(_0x2fe7ec,_0x5bc3e1){_0x5bc3e1=_0x5bc3e1||0x1f4;return function(_0x26cd8f){logger[_0xbeb3('0x28')](_0x26cd8f['stack']);if(_0x26cd8f['name']){delete _0x26cd8f[_0xbeb3('0x29')];}_0x2fe7ec['status'](_0x5bc3e1)['send'](_0x26cd8f);};}exports['index']=function(_0x5bfef7,_0xf5dbaf){var _0x4e9a04={},_0x3767cc={},_0x3dff2d={'count':0x0,'rows':[]};var _0x1b4c2e=_[_0xbeb3('0x2a')](db[_0xbeb3('0x2b')][_0xbeb3('0x2c')],function(_0x411cd3){return{'name':_0x411cd3[_0xbeb3('0x2d')],'type':_0x411cd3[_0xbeb3('0x2e')][_0xbeb3('0x2f')]};});_0x3767cc['model']=_[_0xbeb3('0x2a')](_0x1b4c2e,_0xbeb3('0x29'));_0x3767cc['query']=_[_0xbeb3('0x30')](_0x5bfef7[_0xbeb3('0x31')]);_0x3767cc[_0xbeb3('0x32')]=_[_0xbeb3('0x33')](_0x3767cc['model'],_0x3767cc[_0xbeb3('0x31')]);_0x4e9a04[_0xbeb3('0x34')]=_[_0xbeb3('0x33')](_0x3767cc[_0xbeb3('0x35')],qs[_0xbeb3('0x36')](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x36')]));_0x4e9a04[_0xbeb3('0x34')]=_0x4e9a04[_0xbeb3('0x34')]['length']?_0x4e9a04[_0xbeb3('0x34')]:_0x3767cc['model'];if(!_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x37')](_0xbeb3('0x38'))){_0x4e9a04[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x1f')]);_0x4e9a04[_0xbeb3('0x1e')]=qs['offset'](_0x5bfef7[_0xbeb3('0x31')]['offset']);}_0x4e9a04['order']=qs['sort'](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x39')]);_0x4e9a04[_0xbeb3('0x3a')]=qs[_0xbeb3('0x32')](_[_0xbeb3('0x3b')](_0x5bfef7[_0xbeb3('0x31')],_0x3767cc['filters']),_0x1b4c2e);if(_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x3c')]){_0x4e9a04[_0xbeb3('0x3a')]=_['merge'](_0x4e9a04['where'],{'$or':_['map'](_0x1b4c2e,function(_0x46f570){if(_0x46f570[_0xbeb3('0x2e')]!==_0xbeb3('0x3d')){var _0x5d5225={};_0x5d5225[_0x46f570[_0xbeb3('0x29')]]={'$like':'%'+_0x5bfef7['query'][_0xbeb3('0x3c')]+'%'};return _0x5d5225;}})});}_0x4e9a04=_[_0xbeb3('0x3e')]({},_0x4e9a04,_0x5bfef7[_0xbeb3('0x3f')]);var _0x44632a={'where':_0x4e9a04['where']};return db['JscriptyProject'][_0xbeb3('0x1d')](_0x44632a)[_0xbeb3('0x23')](function(_0x3d4262){_0x3dff2d[_0xbeb3('0x1d')]=_0x3d4262;if(_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x40')]){_0x4e9a04[_0xbeb3('0x41')]=[{'all':!![]}];}return db[_0xbeb3('0x2b')]['findAll'](_0x4e9a04);})[_0xbeb3('0x23')](function(_0x39f2d2){_0x3dff2d[_0xbeb3('0x42')]=_0x39f2d2;return _0x3dff2d;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xf5dbaf,_0x4e9a04))[_0xbeb3('0x43')](handleError(_0xf5dbaf,null));};exports[_0xbeb3('0x44')]=function(_0x1ef1cd,_0x5234bc){var _0x284616={'raw':![],'where':{'id':_0x1ef1cd[_0xbeb3('0x45')]['id']}},_0xd0403f={};_0xd0403f[_0xbeb3('0x35')]=_[_0xbeb3('0x30')](db[_0xbeb3('0x2b')][_0xbeb3('0x2c')]);_0xd0403f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x1ef1cd[_0xbeb3('0x31')]);_0xd0403f[_0xbeb3('0x32')]=_[_0xbeb3('0x33')](_0xd0403f[_0xbeb3('0x35')],_0xd0403f['query']);_0x284616[_0xbeb3('0x34')]=_[_0xbeb3('0x33')](_0xd0403f[_0xbeb3('0x35')],qs['fields'](_0x1ef1cd['query'][_0xbeb3('0x36')]));_0x284616[_0xbeb3('0x34')]=_0x284616[_0xbeb3('0x34')][_0xbeb3('0x46')]?_0x284616['attributes']:_0xd0403f[_0xbeb3('0x35')];if(_0x1ef1cd['query']['includeAll']){_0x284616[_0xbeb3('0x41')]=[{'all':!![]}];}_0x284616=_[_0xbeb3('0x3e')]({},_0x284616,_0x1ef1cd[_0xbeb3('0x3f')]);return db[_0xbeb3('0x2b')]['find'](_0x284616)[_0xbeb3('0x23')](handleEntityNotFound(_0x5234bc,null))[_0xbeb3('0x23')](respondWithResult(_0x5234bc,null))[_0xbeb3('0x43')](handleError(_0x5234bc,null));};exports['create']=function(_0x3f93ab,_0x58c49f){return db['JscriptyProject'][_0xbeb3('0x47')](_0x3f93ab[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](function(_0x55e546){var _0x23d63c=_0x3f93ab[_0xbeb3('0x49')][_0xbeb3('0x25')]({'plain':!![]});if(!_0x23d63c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d63c[_0xbeb3('0x4a')]==='user'){var _0x39605b=_0x55e546['get']({'plain':!![]});var _0x111d0d=_0xbeb3('0x26');return db[_0xbeb3('0x4b')][_0xbeb3('0x4c')]({'where':{'name':_0x111d0d,'userProfileId':_0x23d63c[_0xbeb3('0x4d')]},'raw':!![]})[_0xbeb3('0x23')](function(_0x135ca0){if(_0x135ca0&&_0x135ca0[_0xbeb3('0x4e')]===0x0){return db['UserProfileResource'][_0xbeb3('0x47')]({'name':_0x39605b[_0xbeb3('0x29')],'resourceId':_0x39605b['id'],'type':_0x135ca0[_0xbeb3('0x29')],'sectionId':_0x135ca0['id']},{})[_0xbeb3('0x23')](function(){return _0x55e546;});}else{return _0x55e546;}})['catch'](function(_0x2771e3){logger[_0xbeb3('0x28')](_0xbeb3('0x4f'),_0x2771e3);throw _0x2771e3;});}return _0x55e546;})[_0xbeb3('0x23')](respondWithResult(_0x58c49f,0xc9))['catch'](handleError(_0x58c49f,null));};exports[_0xbeb3('0x50')]=function(_0x5e094f,_0x15d828){var _0x434300={'where':{'id':_0x5e094f['params']['id']}},_0x371845={};_0x371845[_0xbeb3('0x35')]=_[_0xbeb3('0x30')](db[_0xbeb3('0x2b')][_0xbeb3('0x2c')]);_0x434300[_0xbeb3('0x34')]=_[_0xbeb3('0x33')](_0x371845[_0xbeb3('0x35')],qs[_0xbeb3('0x36')](_0x5e094f[_0xbeb3('0x31')][_0xbeb3('0x36')]));_0x434300['attributes']=_0x434300[_0xbeb3('0x34')][_0xbeb3('0x46')]?_0x434300[_0xbeb3('0x34')]:_0x371845[_0xbeb3('0x35')];if(_0x5e094f[_0xbeb3('0x31')]['includeAll']){_0x434300['include']=[{'all':!![]}];}_0x434300=_[_0xbeb3('0x3e')]({},_0x434300,_0x5e094f[_0xbeb3('0x3f')]);return db['JscriptyProject'][_0xbeb3('0x4c')](_0x434300)[_0xbeb3('0x23')](handleEntityNotFound(_0x15d828,null))[_0xbeb3('0x23')](function(_0x1506ab){if(_0x1506ab){var _0x30024e=_0x1506ab[_0xbeb3('0x25')]({'plain':!![]});_0x30024e=qs[_0xbeb3('0x51')](_0x30024e,['id','createdAt',_0xbeb3('0x52')]);_0x5e094f[_0xbeb3('0x48')]=_[_0xbeb3('0x51')](_0x5e094f['body'],['id',_0xbeb3('0x53'),_0xbeb3('0x52')]);return db['JscriptyProject'][_0xbeb3('0x47')](_[_0xbeb3('0x3e')](_0x30024e,_0x5e094f[_0xbeb3('0x48')]),{'include':_0x5e094f[_0xbeb3('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x278d22){var _0x52888c=_0x5e094f[_0xbeb3('0x49')]['get']({'plain':!![]});if(!_0x52888c)throw new Error(_0xbeb3('0x54'));if(_0x52888c[_0xbeb3('0x4a')]===_0xbeb3('0x49')){var _0x1d9f1a=_0x278d22[_0xbeb3('0x25')]({'plain':!![]});var _0x1a53bd=_0xbeb3('0x26');return db[_0xbeb3('0x4b')][_0xbeb3('0x4c')]({'where':{'name':_0x1a53bd,'userProfileId':_0x52888c[_0xbeb3('0x4d')]},'raw':!![]})[_0xbeb3('0x23')](function(_0x143c0c){if(_0x143c0c&&_0x143c0c[_0xbeb3('0x4e')]===0x0){return db[_0xbeb3('0x27')][_0xbeb3('0x47')]({'name':_0x1d9f1a[_0xbeb3('0x29')],'resourceId':_0x1d9f1a['id'],'type':_0x143c0c[_0xbeb3('0x29')],'sectionId':_0x143c0c['id']},{})[_0xbeb3('0x23')](function(){return _0x278d22;});}else{return _0x278d22;}})['catch'](function(_0x15c890){logger[_0xbeb3('0x28')](_0xbeb3('0x4f'),_0x15c890);throw _0x15c890;});}return _0x278d22;});}})[_0xbeb3('0x23')](respondWithResult(_0x15d828,0xc9))[_0xbeb3('0x43')](handleError(_0x15d828,null));};exports['update']=function(_0x39546e,_0x53e04c){if(_0x39546e[_0xbeb3('0x48')]['id']){delete _0x39546e[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x2b')][_0xbeb3('0x4c')]({'where':{'id':_0x39546e[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x53e04c,null))[_0xbeb3('0x23')](saveUpdates(_0x39546e[_0xbeb3('0x48')],null))[_0xbeb3('0x23')](respondWithResult(_0x53e04c,null))[_0xbeb3('0x43')](handleError(_0x53e04c,null));};exports[_0xbeb3('0x24')]=function(_0x37a17e,_0x41a09d){return db[_0xbeb3('0x2b')][_0xbeb3('0x4c')]({'where':{'id':_0x37a17e[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x41a09d,null))[_0xbeb3('0x23')](removeEntity(_0x41a09d,null))[_0xbeb3('0x43')](handleError(_0x41a09d,null));};exports[_0xbeb3('0x55')]=function(_0x44191f,_0x1dc478,_0x285179){var _0x1ee0f0={'raw':!![],'where':{}};var _0x1a62b8={};var _0xf7c8be={'count':0x0,'rows':[]};return db[_0xbeb3('0x2b')][_0xbeb3('0x56')]({'where':{'id':_0x44191f[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x1dc478,null))[_0xbeb3('0x23')](function(_0xf2b381){if(_0xf2b381){_0x1a62b8[_0xbeb3('0x35')]=_[_0xbeb3('0x30')](db[_0xbeb3('0x57')][_0xbeb3('0x2c')]);_0x1a62b8['query']=_[_0xbeb3('0x30')](_0x44191f[_0xbeb3('0x31')]);_0x1a62b8['filters']=_[_0xbeb3('0x33')](_0x1a62b8[_0xbeb3('0x35')],_0x1a62b8[_0xbeb3('0x31')]);_0x1ee0f0['attributes']=_['intersection'](_0x1a62b8[_0xbeb3('0x35')],qs[_0xbeb3('0x36')](_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x36')]));_0x1ee0f0[_0xbeb3('0x34')]=_0x1ee0f0['attributes'][_0xbeb3('0x46')]?_0x1ee0f0[_0xbeb3('0x34')]:_0x1a62b8[_0xbeb3('0x35')];if(!_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x37')]('nolimit')){_0x1ee0f0[_0xbeb3('0x1f')]=qs['limit'](_0x44191f['query'][_0xbeb3('0x1f')]);_0x1ee0f0['offset']=qs[_0xbeb3('0x1e')](_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x1e')]);}_0x1ee0f0[_0xbeb3('0x58')]=qs[_0xbeb3('0x39')](_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x39')]);_0x1ee0f0['where']=qs[_0xbeb3('0x32')](_[_0xbeb3('0x3b')](_0x44191f[_0xbeb3('0x31')],_0x1a62b8['filters']));_0x1ee0f0['where'][_0xbeb3('0x59')]=_0xf2b381['id'];if(_0x44191f['query']['filter']){_0x1ee0f0['where']=_[_0xbeb3('0x3e')](_0x1ee0f0[_0xbeb3('0x3a')],{'$or':_[_0xbeb3('0x2a')](_0x1ee0f0[_0xbeb3('0x34')],function(_0x5682be){var _0x52dc94={};_0x52dc94[_0x5682be]={'$like':'%'+_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x3c')]+'%'};return _0x52dc94;})});}_0x1ee0f0=_[_0xbeb3('0x3e')]({},_0x1ee0f0,_0x44191f['options']);return db['JscriptySessionReport'][_0xbeb3('0x1d')]({'where':_0x1ee0f0[_0xbeb3('0x3a')]})[_0xbeb3('0x23')](function(_0x422e16){_0xf7c8be[_0xbeb3('0x1d')]=_0x422e16;if(_0x44191f[_0xbeb3('0x31')][_0xbeb3('0x40')]){_0x1ee0f0['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xbeb3('0x5a')](_0x1ee0f0);})[_0xbeb3('0x23')](function(_0x5a167d){_0xf7c8be['rows']=_0x5a167d;return _0xf7c8be;});}})[_0xbeb3('0x23')](respondWithFilteredResult(_0x1dc478,_0x1ee0f0))['catch'](handleError(_0x1dc478,null));};exports[_0xbeb3('0x5b')]=function(_0x2791e6,_0x20c2f2,_0x41c3bc){var _0x26dff3={'raw':!![],'where':{}};var _0x305728={};var _0x372b36={'count':0x0,'rows':[]};return db[_0xbeb3('0x2b')][_0xbeb3('0x56')]({'where':{'id':_0x2791e6[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x20c2f2,null))[_0xbeb3('0x23')](function(_0x466d62){if(_0x466d62){_0x305728[_0xbeb3('0x35')]=_[_0xbeb3('0x30')](db[_0xbeb3('0x5c')][_0xbeb3('0x2c')]);_0x305728[_0xbeb3('0x31')]=_['keys'](_0x2791e6['query']);_0x305728[_0xbeb3('0x32')]=_[_0xbeb3('0x33')](_0x305728['model'],_0x305728[_0xbeb3('0x31')]);_0x26dff3['attributes']=_[_0xbeb3('0x33')](_0x305728[_0xbeb3('0x35')],qs['fields'](_0x2791e6[_0xbeb3('0x31')][_0xbeb3('0x36')]));_0x26dff3[_0xbeb3('0x34')]=_0x26dff3[_0xbeb3('0x34')][_0xbeb3('0x46')]?_0x26dff3[_0xbeb3('0x34')]:_0x305728[_0xbeb3('0x35')];if(!_0x2791e6[_0xbeb3('0x31')][_0xbeb3('0x37')](_0xbeb3('0x38'))){_0x26dff3[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x2791e6['query'][_0xbeb3('0x1f')]);_0x26dff3[_0xbeb3('0x1e')]=qs[_0xbeb3('0x1e')](_0x2791e6[_0xbeb3('0x31')][_0xbeb3('0x1e')]);}_0x26dff3['order']=qs[_0xbeb3('0x39')](_0x2791e6[_0xbeb3('0x31')]['sort']);_0x26dff3[_0xbeb3('0x3a')]=qs['filters'](_['pick'](_0x2791e6[_0xbeb3('0x31')],_0x305728[_0xbeb3('0x32')]));_0x26dff3[_0xbeb3('0x3a')]['ProjectId']=_0x466d62['id'];if(_0x2791e6[_0xbeb3('0x31')][_0xbeb3('0x3c')]){_0x26dff3[_0xbeb3('0x3a')]=_['merge'](_0x26dff3[_0xbeb3('0x3a')],{'$or':_[_0xbeb3('0x2a')](_0x26dff3[_0xbeb3('0x34')],function(_0x54a50e){var _0xfd1399={};_0xfd1399[_0x54a50e]={'$like':'%'+_0x2791e6[_0xbeb3('0x31')][_0xbeb3('0x3c')]+'%'};return _0xfd1399;})});}_0x26dff3=_[_0xbeb3('0x3e')]({},_0x26dff3,_0x2791e6[_0xbeb3('0x3f')]);return db['JscriptyAnswerReport'][_0xbeb3('0x1d')]({'where':_0x26dff3['where']})[_0xbeb3('0x23')](function(_0x39a2c7){_0x372b36[_0xbeb3('0x1d')]=_0x39a2c7;if(_0x2791e6['query'][_0xbeb3('0x40')]){_0x26dff3[_0xbeb3('0x41')]=[{'all':!![]}];}return db[_0xbeb3('0x5c')][_0xbeb3('0x5a')](_0x26dff3);})[_0xbeb3('0x23')](function(_0x1db3a3){_0x372b36['rows']=_0x1db3a3;return _0x372b36;});}})['then'](respondWithFilteredResult(_0x20c2f2,_0x26dff3))[_0xbeb3('0x43')](handleError(_0x20c2f2,null));};function char(_0x393b66){return _0xbeb3('0x5d')===typeof _0x393b66?String['fromCharCode'][_0xbeb3('0x5e')](null,arguments):_0x393b66;}function needsEncapsulation(_0x4d5d73){return!!_0x4d5d73&&(_0x4d5d73[_0xbeb3('0x5f')]()[_0xbeb3('0x60')](char(0xd))>=0x0||_0x4d5d73['toString']()['indexOf'](char(0xa))>=0x0||_0x4d5d73[_0xbeb3('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x4d5d73[_0xbeb3('0x5f')]()[_0xbeb3('0x60')](char(0x22))>=0x0);}function encapsulate(_0x5b6988){var _0x356044=char(0x22),_0x5618be='\x5c'+char(0x22),_0x179de1=_0x5b6988['toString']()[_0xbeb3('0x61')](new RegExp(_0x356044,'g'),_0x5618be);return _0x356044+_0x179de1+_0x356044;}exports[_0xbeb3('0x62')]=function(_0x2b03e6,_0x6cf669,_0x16b25f){var _0x6bb3ba,_0x47edd7;var _0x1dc38a={'where':{'ProjectId':_0x2b03e6['params']['id']}};if(_0x2b03e6['query'][_0xbeb3('0x63')]){_0x1dc38a[_0xbeb3('0x3a')][_0xbeb3('0x64')]=JSON['parse'](_0x2b03e6[_0xbeb3('0x31')][_0xbeb3('0x63')]);}return db[_0xbeb3('0x57')][_0xbeb3('0x5a')](_0x1dc38a)[_0xbeb3('0x23')](handleEntityNotFound(_0x6cf669,null))['then'](function(_0xc36403){if(_0xc36403){_0x6bb3ba=_0xc36403;return db[_0xbeb3('0x65')][_0xbeb3('0x5a')]({'where':{'SessionId':{'$in':_['map'](_0x6bb3ba,'id')},'ProjectId':_0x2b03e6[_0xbeb3('0x45')]['id']},'order':_0xbeb3('0x66')});}})[_0xbeb3('0x23')](handleEntityNotFound(_0x6cf669,null))[_0xbeb3('0x23')](function(_0x46fe5f){if(_0x46fe5f){_0x47edd7=_0x46fe5f;var _0x3ac2bb={};for(var _0x154bd3=0x0,_0x53b974=_0x47edd7[_0xbeb3('0x46')];_0x154bd3<_0x53b974;_0x154bd3++){if(!_0x3ac2bb[_0xbeb3('0x37')](_0x47edd7[_0x154bd3][_0xbeb3('0x67')])){_0x3ac2bb[_0x47edd7[_0x154bd3][_0xbeb3('0x67')]]=needsEncapsulation(_0x47edd7[_0x154bd3][_0xbeb3('0x68')])?encapsulate(_0x47edd7[_0x154bd3][_0xbeb3('0x68')]):_0x47edd7[_0x154bd3]['question'];}}var _0x1e65d4=[],_0x1ecf10={};for(var _0x34a36a=0x0,_0x4bb151=_0x6bb3ba['length'];_0x34a36a<_0x4bb151;_0x34a36a++){_0x1ecf10={'ProjectId':_0x2b03e6['params']['id'],'SessionId':_0x6bb3ba[_0x34a36a]['id'],'StartTime':moment(_0x6bb3ba[_0x34a36a][_0xbeb3('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x1cce32=0x0,_0x52fa11=_0x47edd7['length'];_0x1cce32<_0x52fa11;_0x1cce32++){if(_0x47edd7[_0x1cce32][_0xbeb3('0x69')]==_0x6bb3ba[_0x34a36a]['id']&&_0x3ac2bb['hasOwnProperty'](_0x47edd7[_0x1cce32][_0xbeb3('0x67')])){_0x1ecf10[_0x3ac2bb[_0x47edd7[_0x1cce32][_0xbeb3('0x67')]]]=_0x47edd7[_0x1cce32][_0xbeb3('0x6a')];}}for(var _0x568d79 in _0x3ac2bb){if(!_0x1ecf10[_0xbeb3('0x37')](_0x3ac2bb[_0x568d79])){_0x1ecf10[_0x3ac2bb[_0x568d79]]=null;}}_0x1e65d4['push'](_0x1ecf10);}return _0x1e65d4;}})[_0xbeb3('0x23')](function(_0x104dd9){if(!_[_0xbeb3('0x6b')](_0x104dd9)){var _0x42a605=toCsv(_0x104dd9);var _0x3c7d4a=Date[_0xbeb3('0x6c')]();fs[_0xbeb3('0x6d')](util['format'](_0xbeb3('0x6e'),_0x2b03e6['params']['id'],_0x3c7d4a),_0x42a605);_0x6cf669['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xbeb3('0x6f')](_0xbeb3('0x70'),_0x2b03e6[_0xbeb3('0x45')]['id'],_0x3c7d4a));_0x6cf669['setHeader'](_0xbeb3('0x71'),_0xbeb3('0x72'));return _0x6cf669[_0xbeb3('0x73')](util[_0xbeb3('0x6f')](_0xbeb3('0x6e'),_0x2b03e6[_0xbeb3('0x45')]['id'],_0x3c7d4a));}else{return _0x6cf669[_0xbeb3('0x74')](0xcc);}})[_0xbeb3('0x43')](handleError(_0x6cf669,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 0be92fa..9bc6666 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 _0x308a=['./jscriptyProject.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1677a6,_0x49bcb3){var _0x5ced22=function(_0x594468){while(--_0x594468){_0x1677a6['push'](_0x1677a6['shift']());}};_0x5ced22(++_0x49bcb3);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa308('0x0'));var util=require('util');var logger=require(_0xa308('0x1'))(_0xa308('0x2'));var moment=require(_0xa308('0x3'));var BPromise=require(_0xa308('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa308('0x5'));var config=require(_0xa308('0x6'));var attributes=require(_0xa308('0x7'));module[_0xa308('0x8')]=function(_0x26d8a4,_0x322331){return _0x26d8a4[_0xa308('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x872a=['exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x872a,0x100));var _0xa872=function(_0x3776c2,_0x1ddc57){_0x3776c2=_0x3776c2-0x0;var _0x1d7493=_0x872a[_0x3776c2];return _0x1d7493;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('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 27f31ea..88e4ee9 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x139001,_0x13cbae){var _0x2cebaa=function(_0x2af075){while(--_0x2af075){_0x139001['push'](_0x139001['shift']());}};_0x2cebaa(++_0x13cbae);}(_0xe706,0xa3));var _0x6e70=function(_0x1c4866,_0x255b66){_0x1c4866=_0x1c4866-0x0;var _0x4239e6=_0xe706[_0x1c4866];return _0x4239e6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3f49d1,_0x22429c){var _0x56df48=function(_0x58af3f){while(--_0x58af3f){_0x3f49d1['push'](_0x3f49d1['shift']());}};_0x56df48(++_0x22429c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x42eb9f,_0xbaa85c){_0x42eb9f=_0x42eb9f-0x0;var _0x210f68=_0x9bde[_0x42eb9f];return _0x210f68;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 35f9bc6..86ae693 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 _0x0ba0=['path','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x56a3c2,_0x58b15f){var _0x3fb708=function(_0x39730b){while(--_0x39730b){_0x56a3c2['push'](_0x56a3c2['shift']());}};_0x3fb708(++_0x58b15f);}(_0x0ba0,0x154));var _0x00ba=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x0ba0[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0x00ba('0x0'));var util=require(_0x00ba('0x1'));var path=require(_0x00ba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x00ba('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x00ba('0x4'));var config=require(_0x00ba('0x5'));var controller=require(_0x00ba('0x6'));router[_0x00ba('0x7')]('/',auth[_0x00ba('0x8')](),controller[_0x00ba('0x9')]);router[_0x00ba('0x7')]('/describe',auth[_0x00ba('0x8')](),controller[_0x00ba('0xa')]);router['get'](_0x00ba('0xb'),auth[_0x00ba('0x8')](),controller['show']);router[_0x00ba('0xc')]('/',auth[_0x00ba('0x8')](),controller[_0x00ba('0xd')]);router[_0x00ba('0xe')](_0x00ba('0xb'),auth['isAuthenticated'](),controller[_0x00ba('0xf')]);router[_0x00ba('0x10')](_0x00ba('0xb'),auth[_0x00ba('0x8')](),controller[_0x00ba('0x11')]);module[_0x00ba('0x12')]=router; \ No newline at end of file +var _0x88d9=['/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3778f9,_0x4c24ca){var _0x191340=function(_0x547fd7){while(--_0x547fd7){_0x3778f9['push'](_0x3778f9['shift']());}};_0x191340(++_0x4c24ca);}(_0x88d9,0x90));var _0x988d=function(_0x93b460,_0x4eaea1){_0x93b460=_0x93b460-0x0;var _0x2f8719=_0x88d9[_0x93b460];return _0x2f8719;};'use strict';var multer=require(_0x988d('0x0'));var util=require('util');var path=require(_0x988d('0x1'));var timeout=require(_0x988d('0x2'));var express=require(_0x988d('0x3'));var router=express[_0x988d('0x4')]();var fs_extra=require(_0x988d('0x5'));var auth=require(_0x988d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x988d('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x988d('0x8'),auth[_0x988d('0x9')](),controller[_0x988d('0xa')]);router['get'](_0x988d('0xb'),auth[_0x988d('0x9')](),controller[_0x988d('0xc')]);router[_0x988d('0xd')]('/',auth[_0x988d('0x9')](),controller[_0x988d('0xe')]);router[_0x988d('0xf')](_0x988d('0xb'),auth['isAuthenticated'](),controller[_0x988d('0x10')]);router[_0x988d('0x11')](_0x988d('0xb'),auth[_0x988d('0x9')](),controller[_0x988d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c3917dc..495a3e7 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0xb39c2f,_0x445745){_0xb39c2f=_0xb39c2f-0x0;var _0x309e48=_0x7a54[_0xb39c2f];return _0x309e48;};'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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x4cc844,_0x227cb6){_0x4cc844=_0x4cc844-0x0;var _0x181fbe=_0x7a54[_0x4cc844];return _0x181fbe;};'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 63f6530..3b93f7a 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 _0x7c19=['order','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit'];(function(_0x20a209,_0x18c1d7){var _0x38c72f=function(_0x2fa2e8){while(--_0x2fa2e8){_0x20a209['push'](_0x20a209['shift']());}};_0x38c72f(++_0x18c1d7);}(_0x7c19,0xab));var _0x97c1=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x7c19[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c1('0x0'));var zipdir=require(_0x97c1('0x1'));var jsonpatch=require(_0x97c1('0x2'));var rp=require(_0x97c1('0x3'));var moment=require(_0x97c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x97c1('0x5'));var util=require(_0x97c1('0x6'));var path=require(_0x97c1('0x7'));var sox=require(_0x97c1('0x8'));var csv=require(_0x97c1('0x9'));var ejs=require(_0x97c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c1('0xb'));var squel=require(_0x97c1('0xc'));var crypto=require('crypto');var jsforce=require(_0x97c1('0xd'));var deskjs=require(_0x97c1('0xe'));var toCsv=require(_0x97c1('0x9'));var querystring=require(_0x97c1('0xf'));var Papa=require(_0x97c1('0x10'));var Redis=require('ioredis');var authService=require(_0x97c1('0x11'));var qs=require(_0x97c1('0x12'));var as=require(_0x97c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x97c1('0x14'));var config=require(_0x97c1('0x15'));var licenseUtil=require(_0x97c1('0x16'));var db=require(_0x97c1('0x17'))['db'];function respondWithStatusCode(_0x1cfb9d,_0x5db4c2){_0x5db4c2=_0x5db4c2||0xcc;return function(_0x26c5f5){if(_0x26c5f5){return _0x1cfb9d[_0x97c1('0x18')](_0x5db4c2);}return _0x1cfb9d[_0x97c1('0x19')](_0x5db4c2)[_0x97c1('0x1a')]();};}function respondWithResult(_0x55b6b9,_0x4fb87d){_0x4fb87d=_0x4fb87d||0xc8;return function(_0x100760){if(_0x100760){return _0x55b6b9[_0x97c1('0x19')](_0x4fb87d)[_0x97c1('0x1b')](_0x100760);}};}function respondWithFilteredResult(_0x4b7a31,_0x66a297){return function(_0x3b8f3f){if(_0x3b8f3f){var _0x63f243=typeof _0x66a297[_0x97c1('0x1c')]===_0x97c1('0x1d')&&typeof _0x66a297[_0x97c1('0x1e')]===_0x97c1('0x1d');var _0x287e3a=_0x3b8f3f[_0x97c1('0x1f')];var _0x478793=_0x63f243?0x0:_0x66a297[_0x97c1('0x1c')];var _0x2516ce=_0x63f243?_0x3b8f3f[_0x97c1('0x1f')]:_0x66a297[_0x97c1('0x1c')]+_0x66a297[_0x97c1('0x1e')];var _0x4fdda6;if(_0x2516ce>=_0x287e3a){_0x2516ce=_0x287e3a;_0x4fdda6=0xc8;}else{_0x4fdda6=0xce;}_0x4b7a31[_0x97c1('0x19')](_0x4fdda6);return _0x4b7a31[_0x97c1('0x20')](_0x97c1('0x21'),_0x478793+'-'+_0x2516ce+'/'+_0x287e3a)[_0x97c1('0x1b')](_0x3b8f3f);}return null;};}function patchUpdates(_0x1fbd63){return function(_0x5a7e57){try{jsonpatch[_0x97c1('0x22')](_0x5a7e57,_0x1fbd63,!![]);}catch(_0x5ace30){return BPromise[_0x97c1('0x23')](_0x5ace30);}return _0x5a7e57['save']();};}function saveUpdates(_0x64a539,_0x505f57){return function(_0x236a7b){if(_0x236a7b){return _0x236a7b[_0x97c1('0x24')](_0x64a539)['then'](function(_0x1b76f3){return _0x1b76f3;});}return null;};}function removeEntity(_0x49e233,_0x52c55b){return function(_0x505d05){if(_0x505d05){return _0x505d05[_0x97c1('0x25')]()['then'](function(){_0x49e233[_0x97c1('0x19')](0xcc)[_0x97c1('0x1a')]();});}};}function handleEntityNotFound(_0x3112fe,_0x12650d){return function(_0x55d140){if(!_0x55d140){_0x3112fe[_0x97c1('0x18')](0x194);}return _0x55d140;};}function handleError(_0x2fe283,_0x115e69){_0x115e69=_0x115e69||0x1f4;return function(_0x11ee3a){logger[_0x97c1('0x26')](_0x11ee3a[_0x97c1('0x27')]);if(_0x11ee3a[_0x97c1('0x28')]){delete _0x11ee3a[_0x97c1('0x28')];}_0x2fe283['status'](_0x115e69)[_0x97c1('0x29')](_0x11ee3a);};}exports[_0x97c1('0x2a')]=function(_0x263096,_0x23a30e){var _0x2cecbd={},_0x4c7a39={},_0x1afb89={'count':0x0,'rows':[]};var _0x5a1f19=_[_0x97c1('0x2b')](db[_0x97c1('0x2c')][_0x97c1('0x2d')],function(_0x583ba7){return{'name':_0x583ba7[_0x97c1('0x2e')],'type':_0x583ba7[_0x97c1('0x2f')][_0x97c1('0x30')]};});_0x4c7a39[_0x97c1('0x31')]=_[_0x97c1('0x2b')](_0x5a1f19,_0x97c1('0x28'));_0x4c7a39[_0x97c1('0x32')]=_[_0x97c1('0x33')](_0x263096[_0x97c1('0x32')]);_0x4c7a39['filters']=_[_0x97c1('0x34')](_0x4c7a39['model'],_0x4c7a39[_0x97c1('0x32')]);_0x2cecbd[_0x97c1('0x35')]=_[_0x97c1('0x34')](_0x4c7a39[_0x97c1('0x31')],qs['fields'](_0x263096[_0x97c1('0x32')][_0x97c1('0x36')]));_0x2cecbd[_0x97c1('0x35')]=_0x2cecbd[_0x97c1('0x35')][_0x97c1('0x37')]?_0x2cecbd[_0x97c1('0x35')]:_0x4c7a39[_0x97c1('0x31')];if(!_0x263096['query']['hasOwnProperty'](_0x97c1('0x38'))){_0x2cecbd[_0x97c1('0x1e')]=qs[_0x97c1('0x1e')](_0x263096[_0x97c1('0x32')]['limit']);_0x2cecbd[_0x97c1('0x1c')]=qs[_0x97c1('0x1c')](_0x263096[_0x97c1('0x32')][_0x97c1('0x1c')]);}_0x2cecbd[_0x97c1('0x39')]=qs['sort'](_0x263096['query']['sort']);_0x2cecbd[_0x97c1('0x3a')]=qs[_0x97c1('0x3b')](_[_0x97c1('0x3c')](_0x263096[_0x97c1('0x32')],_0x4c7a39[_0x97c1('0x3b')]),_0x5a1f19);if(_0x263096['query'][_0x97c1('0x3d')]){_0x2cecbd[_0x97c1('0x3a')]=_[_0x97c1('0x3e')](_0x2cecbd[_0x97c1('0x3a')],{'$or':_['map'](_0x5a1f19,function(_0x3cbd17){if(_0x3cbd17[_0x97c1('0x2f')]!==_0x97c1('0x3f')){var _0x3248f2={};_0x3248f2[_0x3cbd17[_0x97c1('0x28')]]={'$like':'%'+_0x263096['query'][_0x97c1('0x3d')]+'%'};return _0x3248f2;}})});}_0x2cecbd=_[_0x97c1('0x3e')]({},_0x2cecbd,_0x263096[_0x97c1('0x40')]);var _0x1d4275={'where':_0x2cecbd[_0x97c1('0x3a')]};return db[_0x97c1('0x2c')][_0x97c1('0x1f')](_0x1d4275)[_0x97c1('0x41')](function(_0x580b3f){_0x1afb89[_0x97c1('0x1f')]=_0x580b3f;if(_0x263096[_0x97c1('0x32')][_0x97c1('0x42')]){_0x2cecbd[_0x97c1('0x43')]=[{'all':!![]}];}return db[_0x97c1('0x2c')][_0x97c1('0x44')](_0x2cecbd);})[_0x97c1('0x41')](function(_0x3c3e56){_0x1afb89[_0x97c1('0x45')]=_0x3c3e56;return _0x1afb89;})[_0x97c1('0x41')](respondWithFilteredResult(_0x23a30e,_0x2cecbd))[_0x97c1('0x46')](handleError(_0x23a30e,null));};exports['show']=function(_0x2f7c51,_0x422c95){var _0x12ec05={'raw':!![],'where':{'id':_0x2f7c51[_0x97c1('0x47')]['id']}},_0x594e19={};_0x594e19['model']=_[_0x97c1('0x33')](db['JscriptyQuestionReport'][_0x97c1('0x2d')]);_0x594e19[_0x97c1('0x32')]=_[_0x97c1('0x33')](_0x2f7c51[_0x97c1('0x32')]);_0x594e19[_0x97c1('0x3b')]=_['intersection'](_0x594e19[_0x97c1('0x31')],_0x594e19[_0x97c1('0x32')]);_0x12ec05[_0x97c1('0x35')]=_[_0x97c1('0x34')](_0x594e19[_0x97c1('0x31')],qs['fields'](_0x2f7c51[_0x97c1('0x32')][_0x97c1('0x36')]));_0x12ec05[_0x97c1('0x35')]=_0x12ec05[_0x97c1('0x35')][_0x97c1('0x37')]?_0x12ec05['attributes']:_0x594e19[_0x97c1('0x31')];if(_0x2f7c51[_0x97c1('0x32')][_0x97c1('0x42')]){_0x12ec05[_0x97c1('0x43')]=[{'all':!![]}];}_0x12ec05=_[_0x97c1('0x3e')]({},_0x12ec05,_0x2f7c51[_0x97c1('0x40')]);return db['JscriptyQuestionReport'][_0x97c1('0x48')](_0x12ec05)[_0x97c1('0x41')](handleEntityNotFound(_0x422c95,null))[_0x97c1('0x41')](respondWithResult(_0x422c95,null))[_0x97c1('0x46')](handleError(_0x422c95,null));};exports['create']=function(_0x520199,_0x56966e){return db['JscriptyQuestionReport'][_0x97c1('0x49')](_0x520199['body'],{})['then'](respondWithResult(_0x56966e,0xc9))[_0x97c1('0x46')](handleError(_0x56966e,null));};exports['update']=function(_0x3b1e89,_0x51f4e7){if(_0x3b1e89[_0x97c1('0x4a')]['id']){delete _0x3b1e89[_0x97c1('0x4a')]['id'];}return db[_0x97c1('0x2c')][_0x97c1('0x48')]({'where':{'id':_0x3b1e89[_0x97c1('0x47')]['id']}})[_0x97c1('0x41')](handleEntityNotFound(_0x51f4e7,null))[_0x97c1('0x41')](saveUpdates(_0x3b1e89['body'],null))[_0x97c1('0x41')](respondWithResult(_0x51f4e7,null))[_0x97c1('0x46')](handleError(_0x51f4e7,null));};exports['destroy']=function(_0x10db34,_0x581890){return db[_0x97c1('0x2c')]['find']({'where':{'id':_0x10db34[_0x97c1('0x47')]['id']}})[_0x97c1('0x41')](handleEntityNotFound(_0x581890,null))['then'](removeEntity(_0x581890,null))[_0x97c1('0x46')](handleError(_0x581890,null));};exports[_0x97c1('0x4b')]=function(_0x30c31d,_0x4c5533){return db[_0x97c1('0x2c')][_0x97c1('0x4b')]()['then'](respondWithResult(_0x4c5533,null))[_0x97c1('0x46')](handleError(_0x4c5533,null));}; \ No newline at end of file +var _0x4d99=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','status','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','VIRTUAL','filter','options','count','includeAll','rows','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x4d99,0x170));var _0x94d9=function(_0x1047bf,_0x435066){_0x1047bf=_0x1047bf-0x0;var _0x5ce9cc=_0x4d99[_0x1047bf];return _0x5ce9cc;};'use strict';var emlformat=require(_0x94d9('0x0'));var rimraf=require(_0x94d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94d9('0x2'));var rp=require(_0x94d9('0x3'));var moment=require(_0x94d9('0x4'));var BPromise=require(_0x94d9('0x5'));var Mustache=require(_0x94d9('0x6'));var util=require('util');var path=require(_0x94d9('0x7'));var sox=require(_0x94d9('0x8'));var csv=require(_0x94d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x94d9('0xa'));var _=require(_0x94d9('0xb'));var squel=require('squel');var crypto=require(_0x94d9('0xc'));var jsforce=require(_0x94d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x94d9('0x9'));var querystring=require(_0x94d9('0xe'));var Papa=require(_0x94d9('0xf'));var Redis=require(_0x94d9('0x10'));var authService=require(_0x94d9('0x11'));var qs=require(_0x94d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94d9('0x13'));var logger=require(_0x94d9('0x14'))('api');var utils=require(_0x94d9('0x15'));var config=require(_0x94d9('0x16'));var licenseUtil=require(_0x94d9('0x17'));var db=require(_0x94d9('0x18'))['db'];function respondWithStatusCode(_0x1f10b3,_0x56ea86){_0x56ea86=_0x56ea86||0xcc;return function(_0x344847){if(_0x344847){return _0x1f10b3[_0x94d9('0x19')](_0x56ea86);}return _0x1f10b3['status'](_0x56ea86)[_0x94d9('0x1a')]();};}function respondWithResult(_0x5e3f41,_0x7160f8){_0x7160f8=_0x7160f8||0xc8;return function(_0x1485ee){if(_0x1485ee){return _0x5e3f41['status'](_0x7160f8)['json'](_0x1485ee);}};}function respondWithFilteredResult(_0x429cd6,_0x3bf8bc){return function(_0x2cfe66){if(_0x2cfe66){var _0x383a1a=typeof _0x3bf8bc[_0x94d9('0x1b')]===_0x94d9('0x1c')&&typeof _0x3bf8bc[_0x94d9('0x1d')]===_0x94d9('0x1c');var _0x38e248=_0x2cfe66['count'];var _0x148a22=_0x383a1a?0x0:_0x3bf8bc[_0x94d9('0x1b')];var _0x1bb905=_0x383a1a?_0x2cfe66['count']:_0x3bf8bc[_0x94d9('0x1b')]+_0x3bf8bc[_0x94d9('0x1d')];var _0x266024;if(_0x1bb905>=_0x38e248){_0x1bb905=_0x38e248;_0x266024=0xc8;}else{_0x266024=0xce;}_0x429cd6['status'](_0x266024);return _0x429cd6[_0x94d9('0x1e')](_0x94d9('0x1f'),_0x148a22+'-'+_0x1bb905+'/'+_0x38e248)[_0x94d9('0x20')](_0x2cfe66);}return null;};}function patchUpdates(_0x37f949){return function(_0x17c0f9){try{jsonpatch[_0x94d9('0x21')](_0x17c0f9,_0x37f949,!![]);}catch(_0x5005fb){return BPromise[_0x94d9('0x22')](_0x5005fb);}return _0x17c0f9[_0x94d9('0x23')]();};}function saveUpdates(_0x1b7fff,_0x46d9f1){return function(_0x447057){if(_0x447057){return _0x447057[_0x94d9('0x24')](_0x1b7fff)[_0x94d9('0x25')](function(_0x272e8e){return _0x272e8e;});}return null;};}function removeEntity(_0x4c9fb2,_0x5a3572){return function(_0x3be068){if(_0x3be068){return _0x3be068[_0x94d9('0x26')]()[_0x94d9('0x25')](function(){_0x4c9fb2['status'](0xcc)[_0x94d9('0x1a')]();});}};}function handleEntityNotFound(_0x57abba,_0x1b1809){return function(_0x5891dc){if(!_0x5891dc){_0x57abba[_0x94d9('0x19')](0x194);}return _0x5891dc;};}function handleError(_0x53a4b8,_0x53aa1b){_0x53aa1b=_0x53aa1b||0x1f4;return function(_0x22e24d){logger[_0x94d9('0x27')](_0x22e24d['stack']);if(_0x22e24d['name']){delete _0x22e24d[_0x94d9('0x28')];}_0x53a4b8[_0x94d9('0x29')](_0x53aa1b)[_0x94d9('0x2a')](_0x22e24d);};}exports[_0x94d9('0x2b')]=function(_0x19873c,_0x254eb0){var _0x16c693={},_0x1ec08f={},_0x144b5f={'count':0x0,'rows':[]};var _0x5e949b=_[_0x94d9('0x2c')](db[_0x94d9('0x2d')][_0x94d9('0x2e')],function(_0x21c60c){return{'name':_0x21c60c[_0x94d9('0x2f')],'type':_0x21c60c[_0x94d9('0x30')][_0x94d9('0x31')]};});_0x1ec08f[_0x94d9('0x32')]=_[_0x94d9('0x2c')](_0x5e949b,'name');_0x1ec08f[_0x94d9('0x33')]=_[_0x94d9('0x34')](_0x19873c[_0x94d9('0x33')]);_0x1ec08f['filters']=_[_0x94d9('0x35')](_0x1ec08f[_0x94d9('0x32')],_0x1ec08f[_0x94d9('0x33')]);_0x16c693[_0x94d9('0x36')]=_['intersection'](_0x1ec08f[_0x94d9('0x32')],qs[_0x94d9('0x37')](_0x19873c['query']['fields']));_0x16c693[_0x94d9('0x36')]=_0x16c693['attributes'][_0x94d9('0x38')]?_0x16c693[_0x94d9('0x36')]:_0x1ec08f[_0x94d9('0x32')];if(!_0x19873c['query'][_0x94d9('0x39')](_0x94d9('0x3a'))){_0x16c693['limit']=qs[_0x94d9('0x1d')](_0x19873c[_0x94d9('0x33')][_0x94d9('0x1d')]);_0x16c693['offset']=qs[_0x94d9('0x1b')](_0x19873c[_0x94d9('0x33')][_0x94d9('0x1b')]);}_0x16c693['order']=qs[_0x94d9('0x3b')](_0x19873c[_0x94d9('0x33')]['sort']);_0x16c693['where']=qs[_0x94d9('0x3c')](_['pick'](_0x19873c['query'],_0x1ec08f[_0x94d9('0x3c')]),_0x5e949b);if(_0x19873c[_0x94d9('0x33')]['filter']){_0x16c693[_0x94d9('0x3d')]=_[_0x94d9('0x3e')](_0x16c693[_0x94d9('0x3d')],{'$or':_[_0x94d9('0x2c')](_0x5e949b,function(_0x4da447){if(_0x4da447[_0x94d9('0x30')]!==_0x94d9('0x3f')){var _0x5a5500={};_0x5a5500[_0x4da447[_0x94d9('0x28')]]={'$like':'%'+_0x19873c[_0x94d9('0x33')][_0x94d9('0x40')]+'%'};return _0x5a5500;}})});}_0x16c693=_['merge']({},_0x16c693,_0x19873c[_0x94d9('0x41')]);var _0x248b39={'where':_0x16c693[_0x94d9('0x3d')]};return db[_0x94d9('0x2d')][_0x94d9('0x42')](_0x248b39)['then'](function(_0x3bd8f1){_0x144b5f[_0x94d9('0x42')]=_0x3bd8f1;if(_0x19873c[_0x94d9('0x33')][_0x94d9('0x43')]){_0x16c693['include']=[{'all':!![]}];}return db[_0x94d9('0x2d')]['findAll'](_0x16c693);})[_0x94d9('0x25')](function(_0x2b98e1){_0x144b5f[_0x94d9('0x44')]=_0x2b98e1;return _0x144b5f;})[_0x94d9('0x25')](respondWithFilteredResult(_0x254eb0,_0x16c693))['catch'](handleError(_0x254eb0,null));};exports['show']=function(_0x25ed8e,_0x221882){var _0x42ad4d={'raw':!![],'where':{'id':_0x25ed8e['params']['id']}},_0x1ca9eb={};_0x1ca9eb['model']=_['keys'](db[_0x94d9('0x2d')][_0x94d9('0x2e')]);_0x1ca9eb[_0x94d9('0x33')]=_[_0x94d9('0x34')](_0x25ed8e['query']);_0x1ca9eb[_0x94d9('0x3c')]=_[_0x94d9('0x35')](_0x1ca9eb[_0x94d9('0x32')],_0x1ca9eb[_0x94d9('0x33')]);_0x42ad4d['attributes']=_[_0x94d9('0x35')](_0x1ca9eb[_0x94d9('0x32')],qs[_0x94d9('0x37')](_0x25ed8e[_0x94d9('0x33')]['fields']));_0x42ad4d[_0x94d9('0x36')]=_0x42ad4d[_0x94d9('0x36')]['length']?_0x42ad4d[_0x94d9('0x36')]:_0x1ca9eb[_0x94d9('0x32')];if(_0x25ed8e[_0x94d9('0x33')]['includeAll']){_0x42ad4d['include']=[{'all':!![]}];}_0x42ad4d=_[_0x94d9('0x3e')]({},_0x42ad4d,_0x25ed8e[_0x94d9('0x41')]);return db[_0x94d9('0x2d')][_0x94d9('0x45')](_0x42ad4d)[_0x94d9('0x25')](handleEntityNotFound(_0x221882,null))[_0x94d9('0x25')](respondWithResult(_0x221882,null))[_0x94d9('0x46')](handleError(_0x221882,null));};exports['create']=function(_0x26b811,_0x455afe){return db['JscriptyQuestionReport'][_0x94d9('0x47')](_0x26b811['body'],{})[_0x94d9('0x25')](respondWithResult(_0x455afe,0xc9))[_0x94d9('0x46')](handleError(_0x455afe,null));};exports[_0x94d9('0x24')]=function(_0x2db0a0,_0x140a39){if(_0x2db0a0[_0x94d9('0x48')]['id']){delete _0x2db0a0[_0x94d9('0x48')]['id'];}return db[_0x94d9('0x2d')][_0x94d9('0x45')]({'where':{'id':_0x2db0a0['params']['id']}})[_0x94d9('0x25')](handleEntityNotFound(_0x140a39,null))[_0x94d9('0x25')](saveUpdates(_0x2db0a0['body'],null))[_0x94d9('0x25')](respondWithResult(_0x140a39,null))[_0x94d9('0x46')](handleError(_0x140a39,null));};exports[_0x94d9('0x26')]=function(_0x48bf4c,_0x100739){return db[_0x94d9('0x2d')][_0x94d9('0x45')]({'where':{'id':_0x48bf4c[_0x94d9('0x49')]['id']}})[_0x94d9('0x25')](handleEntityNotFound(_0x100739,null))['then'](removeEntity(_0x100739,null))['catch'](handleError(_0x100739,null));};exports['describe']=function(_0x3cef3b,_0x2d2088){return db[_0x94d9('0x2d')][_0x94d9('0x4a')]()[_0x94d9('0x25')](respondWithResult(_0x2d2088,null))[_0x94d9('0x46')](handleError(_0x2d2088,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0134d04..6900cee 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 _0xbd50=['./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0xbd50,0xd0));var _0x0bd5=function(_0x3ac0eb,_0x2360eb){_0x3ac0eb=_0x3ac0eb-0x0;var _0x565ab5=_0xbd50[_0x3ac0eb];return _0x565ab5;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var logger=require(_0x0bd5('0x2'))(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require('bluebird');var rp=require(_0x0bd5('0x5'));var fs=require('fs');var path=require(_0x0bd5('0x6'));var rimraf=require('rimraf');var config=require(_0x0bd5('0x7'));var attributes=require(_0x0bd5('0x8'));module['exports']=function(_0xa24f2d,_0x1fb9a5){return _0xa24f2d[_0x0bd5('0x9')](_0x0bd5('0xa'),attributes,{'tableName':_0x0bd5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dc4=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dc4,0x148));var _0x42dc=function(_0x3f7048,_0x1b1a0b){_0x3f7048=_0x3f7048-0x0;var _0xf42130=_0x2dc4[_0x3f7048];return _0xf42130;};'use strict';var _=require(_0x42dc('0x0'));var util=require(_0x42dc('0x1'));var logger=require(_0x42dc('0x2'))('api');var moment=require(_0x42dc('0x3'));var BPromise=require(_0x42dc('0x4'));var rp=require(_0x42dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x42dc('0x6'));var attributes=require(_0x42dc('0x7'));module[_0x42dc('0x8')]=function(_0x28118b,_0x3feef6){return _0x28118b[_0x42dc('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x42dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 3b56f7a..d5f4488 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 _0x806a=['message','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x806a,0x11f));var _0xa806=function(_0x392998,_0x3c33e0){_0x392998=_0x392998-0x0;var _0x3a3755=_0x806a[_0x392998];return _0x3a3755;};'use strict';var _=require('lodash');var util=require(_0xa806('0x0'));var moment=require(_0xa806('0x1'));var BPromise=require(_0xa806('0x2'));var rs=require(_0xa806('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa806('0x4'))(_0xa806('0x5'));var config=require(_0xa806('0x6'));var jayson=require(_0xa806('0x7'));var client=jayson[_0xa806('0x8')][_0xa806('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c77df,_0x4d5beb,_0xbf3769){return new BPromise(function(_0x246a10,_0x21c7fd){return client[_0xa806('0xa')](_0x2c77df,_0xbf3769)[_0xa806('0xb')](function(_0x221266){logger['info'](_0xa806('0xc'),_0x4d5beb,_0xa806('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4d5beb,_0xa806('0xd'),JSON[_0xa806('0xe')](_0x221266));if(_0x221266[_0xa806('0xf')]){if(_0x221266['error'][_0xa806('0x10')]===0x1f4){logger[_0xa806('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d5beb,_0x221266['error']['message']);return _0x21c7fd(_0x221266['error'][_0xa806('0x11')]);}logger[_0xa806('0xf')](_0xa806('0xc'),_0x4d5beb,_0x221266['error'][_0xa806('0x11')]);return _0x246a10(_0x221266[_0xa806('0xf')][_0xa806('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d5beb,_0xa806('0xd'));_0x246a10(_0x221266['result']['message']);}})[_0xa806('0x12')](function(_0x789f3f){logger['error'](_0xa806('0xc'),_0x4d5beb,_0x789f3f);_0x21c7fd(_0x789f3f);});});} \ No newline at end of file +var _0x6105=['client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x34c44c,_0x3956e0){var _0x212745=function(_0x24bd1f){while(--_0x24bd1f){_0x34c44c['push'](_0x34c44c['shift']());}};_0x212745(++_0x3956e0);}(_0x6105,0x195));var _0x5610=function(_0x5b3ea6,_0x28e1ac){_0x5b3ea6=_0x5b3ea6-0x0;var _0x29a08a=_0x6105[_0x5b3ea6];return _0x29a08a;};'use strict';var _=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var moment=require(_0x5610('0x2'));var BPromise=require(_0x5610('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5610('0x4'));var db=require(_0x5610('0x5'))['db'];var utils=require(_0x5610('0x6'));var logger=require(_0x5610('0x7'))('rpc');var config=require(_0x5610('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5610('0x9')][_0x5610('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36bc5b,_0x4de39f,_0x3a8068){return new BPromise(function(_0x8c2668,_0x5130f6){return client[_0x5610('0xb')](_0x36bc5b,_0x3a8068)[_0x5610('0xc')](function(_0x514038){logger[_0x5610('0xd')](_0x5610('0xe'),_0x4de39f,_0x5610('0xf'));logger[_0x5610('0x10')](_0x5610('0x11'),_0x4de39f,_0x5610('0xf'),JSON['stringify'](_0x514038));if(_0x514038[_0x5610('0x12')]){if(_0x514038[_0x5610('0x12')][_0x5610('0x13')]===0x1f4){logger[_0x5610('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4de39f,_0x514038[_0x5610('0x12')][_0x5610('0x14')]);return _0x5130f6(_0x514038[_0x5610('0x12')][_0x5610('0x14')]);}logger[_0x5610('0x12')](_0x5610('0xe'),_0x4de39f,_0x514038[_0x5610('0x12')][_0x5610('0x14')]);return _0x8c2668(_0x514038[_0x5610('0x12')][_0x5610('0x14')]);}else{logger['info'](_0x5610('0xe'),_0x4de39f,_0x5610('0xf'));_0x8c2668(_0x514038[_0x5610('0x15')][_0x5610('0x14')]);}})[_0x5610('0x16')](function(_0x1119b7){logger[_0x5610('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4de39f,_0x1119b7);_0x5130f6(_0x1119b7);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a4d25b6..92faa22 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 _0x918a=['destroy','util','path','connect-timeout','express','fs-extra','../../config/environment','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe','/:id','create','put','delete'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x918a,0x1cc));var _0xa918=function(_0x2caedc,_0x208068){_0x2caedc=_0x2caedc-0x0;var _0x3f2ec3=_0x918a[_0x2caedc];return _0x3f2ec3;};'use strict';var multer=require('multer');var util=require(_0xa918('0x0'));var path=require(_0xa918('0x1'));var timeout=require(_0xa918('0x2'));var express=require(_0xa918('0x3'));var router=express['Router']();var fs_extra=require(_0xa918('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa918('0x5'));var controller=require(_0xa918('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa918('0x7')]);router[_0xa918('0x8')](_0xa918('0x9'),auth[_0xa918('0xa')](),controller[_0xa918('0xb')]);router[_0xa918('0x8')](_0xa918('0xc'),auth[_0xa918('0xa')](),controller['show']);router['get']('/:id/questions',auth[_0xa918('0xa')](),controller['getQuestions']);router['post']('/',auth[_0xa918('0xa')](),controller[_0xa918('0xd')]);router[_0xa918('0xe')](_0xa918('0xc'),auth[_0xa918('0xa')](),controller['update']);router[_0xa918('0xf')]('/:id',auth[_0xa918('0xa')](),controller[_0xa918('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf610=['getQuestions','post','create','put','update','destroy','util','path','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/questions'];(function(_0x3889ae,_0x4770c3){var _0x6533dd=function(_0x4275f7){while(--_0x4275f7){_0x3889ae['push'](_0x3889ae['shift']());}};_0x6533dd(++_0x4770c3);}(_0xf610,0x1f4));var _0x0f61=function(_0x1d1b19,_0xcea025){_0x1d1b19=_0x1d1b19-0x0;var _0x1d07b3=_0xf610[_0x1d1b19];return _0x1d07b3;};'use strict';var multer=require('multer');var util=require(_0x0f61('0x0'));var path=require(_0x0f61('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0f61('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0f61('0x3'));var config=require(_0x0f61('0x4'));var controller=require(_0x0f61('0x5'));router[_0x0f61('0x6')]('/',auth['isAuthenticated'](),controller[_0x0f61('0x7')]);router[_0x0f61('0x6')](_0x0f61('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x0f61('0x6')](_0x0f61('0x9'),auth[_0x0f61('0xa')](),controller[_0x0f61('0xb')]);router['get'](_0x0f61('0xc'),auth[_0x0f61('0xa')](),controller[_0x0f61('0xd')]);router[_0x0f61('0xe')]('/',auth[_0x0f61('0xa')](),controller[_0x0f61('0xf')]);router[_0x0f61('0x10')](_0x0f61('0x9'),auth[_0x0f61('0xa')](),controller[_0x0f61('0x11')]);router['delete'](_0x0f61('0x9'),auth[_0x0f61('0xa')](),controller[_0x0f61('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d897fc6..1603949 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 _0x58ea=['exports','setDataValue','starttime','endtime','DATE','STRING','BOOLEAN','moment'];(function(_0x24ec08,_0x1e6017){var _0x2d72ed=function(_0x2c8b08){while(--_0x2c8b08){_0x24ec08['push'](_0x24ec08['shift']());}};_0x2d72ed(++_0x1e6017);}(_0x58ea,0xe7));var _0xa58e=function(_0x51f4ae,_0x260f27){_0x51f4ae=_0x51f4ae-0x0;var _0x2fae4f=_0x58ea[_0x51f4ae];return _0x2fae4f;};'use strict';var moment=require(_0xa58e('0x0'));var Sequelize=require('sequelize');module[_0xa58e('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4e7890){this[_0xa58e('0x2')](_0xa58e('0x3'),_0x4e7890);this['setDataValue'](_0xa58e('0x4'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xa58e('0x5')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xa58e('0x6')]},'queue':{'type':Sequelize[_0xa58e('0x6')]},'uniqueid':{'type':Sequelize[_0xa58e('0x6')]},'calleridname':{'type':Sequelize[_0xa58e('0x6')]},'calleridnum':{'type':Sequelize[_0xa58e('0x6')]},'completed':{'type':Sequelize[_0xa58e('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xf9e2=['setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','starttime'];(function(_0x545f5f,_0x4e769f){var _0x2ce316=function(_0x441b25){while(--_0x441b25){_0x545f5f['push'](_0x545f5f['shift']());}};_0x2ce316(++_0x4e769f);}(_0xf9e2,0x79));var _0x2f9e=function(_0x389fce,_0x3753ac){_0x389fce=_0x389fce-0x0;var _0x53518e=_0xf9e2[_0x389fce];return _0x53518e;};'use strict';var moment=require(_0x2f9e('0x0'));var Sequelize=require(_0x2f9e('0x1'));module[_0x2f9e('0x2')]={'starttime':{'type':Sequelize[_0x2f9e('0x3')],'set':function(_0x4c59af){this['setDataValue'](_0x2f9e('0x4'),_0x4c59af);this[_0x2f9e('0x5')]('endtime',moment()[_0x2f9e('0x6')](_0x2f9e('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2f9e('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2f9e('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2f9e('0x8')]},'calleridnum':{'type':Sequelize[_0x2f9e('0x8')]},'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 2a689b7..55c5999 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 _0x8d8b=['rows','catch','show','params','length','includeAll','find','body','describe','findOne','JscriptyQuestionReport','fast-json-patch','request-promise','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','model','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptySessionReport','include','findAll'];(function(_0x107fe7,_0x26a4de){var _0x34a0e8=function(_0x190a72){while(--_0x190a72){_0x107fe7['push'](_0x107fe7['shift']());}};_0x34a0e8(++_0x26a4de);}(_0x8d8b,0x143));var _0xb8d8=function(_0x44df67,_0x4cfb35){_0x44df67=_0x44df67-0x0;var _0x58fb10=_0x8d8b[_0x44df67];return _0x58fb10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8d8('0x0'));var rp=require(_0xb8d8('0x1'));var moment=require('moment');var BPromise=require(_0xb8d8('0x2'));var Mustache=require(_0xb8d8('0x3'));var util=require(_0xb8d8('0x4'));var path=require(_0xb8d8('0x5'));var sox=require(_0xb8d8('0x6'));var csv=require(_0xb8d8('0x7'));var ejs=require(_0xb8d8('0x8'));var fs=require('fs');var fs_extra=require(_0xb8d8('0x9'));var _=require(_0xb8d8('0xa'));var squel=require('squel');var crypto=require(_0xb8d8('0xb'));var jsforce=require(_0xb8d8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8d8('0x7'));var querystring=require(_0xb8d8('0xd'));var Papa=require(_0xb8d8('0xe'));var Redis=require(_0xb8d8('0xf'));var authService=require(_0xb8d8('0x10'));var qs=require(_0xb8d8('0x11'));var as=require(_0xb8d8('0x12'));var hardwareService=require(_0xb8d8('0x13'));var logger=require('../../config/logger')(_0xb8d8('0x14'));var utils=require(_0xb8d8('0x15'));var config=require(_0xb8d8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8d8('0x17'))['db'];function respondWithStatusCode(_0x6d5c20,_0x363c4d){_0x363c4d=_0x363c4d||0xcc;return function(_0x41b1cb){if(_0x41b1cb){return _0x6d5c20[_0xb8d8('0x18')](_0x363c4d);}return _0x6d5c20[_0xb8d8('0x19')](_0x363c4d)[_0xb8d8('0x1a')]();};}function respondWithResult(_0x26c9da,_0x20bb36){_0x20bb36=_0x20bb36||0xc8;return function(_0x1331cf){if(_0x1331cf){return _0x26c9da[_0xb8d8('0x19')](_0x20bb36)[_0xb8d8('0x1b')](_0x1331cf);}};}function respondWithFilteredResult(_0x4d7167,_0x45277e){return function(_0x2d4551){if(_0x2d4551){var _0xa77430=typeof _0x45277e[_0xb8d8('0x1c')]==='undefined'&&typeof _0x45277e[_0xb8d8('0x1d')]===_0xb8d8('0x1e');var _0x3cd154=_0x2d4551[_0xb8d8('0x1f')];var _0x376745=_0xa77430?0x0:_0x45277e[_0xb8d8('0x1c')];var _0x579a8e=_0xa77430?_0x2d4551[_0xb8d8('0x1f')]:_0x45277e[_0xb8d8('0x1c')]+_0x45277e[_0xb8d8('0x1d')];var _0x31a0dc;if(_0x579a8e>=_0x3cd154){_0x579a8e=_0x3cd154;_0x31a0dc=0xc8;}else{_0x31a0dc=0xce;}_0x4d7167['status'](_0x31a0dc);return _0x4d7167[_0xb8d8('0x20')](_0xb8d8('0x21'),_0x376745+'-'+_0x579a8e+'/'+_0x3cd154)[_0xb8d8('0x1b')](_0x2d4551);}return null;};}function patchUpdates(_0x3bc6df){return function(_0x391fe8){try{jsonpatch[_0xb8d8('0x22')](_0x391fe8,_0x3bc6df,!![]);}catch(_0x120546){return BPromise['reject'](_0x120546);}return _0x391fe8[_0xb8d8('0x23')]();};}function saveUpdates(_0x58ee0b,_0x2c9cc0){return function(_0x21a380){if(_0x21a380){return _0x21a380[_0xb8d8('0x24')](_0x58ee0b)[_0xb8d8('0x25')](function(_0x4f7bbf){return _0x4f7bbf;});}return null;};}function removeEntity(_0x3957e3,_0x466d37){return function(_0x40b538){if(_0x40b538){return _0x40b538[_0xb8d8('0x26')]()['then'](function(){_0x3957e3[_0xb8d8('0x19')](0xcc)[_0xb8d8('0x1a')]();});}};}function handleEntityNotFound(_0x4743ba,_0x3be520){return function(_0x554325){if(!_0x554325){_0x4743ba['sendStatus'](0x194);}return _0x554325;};}function handleError(_0x5c14a8,_0x98a17d){_0x98a17d=_0x98a17d||0x1f4;return function(_0x5a2483){logger[_0xb8d8('0x27')](_0x5a2483[_0xb8d8('0x28')]);if(_0x5a2483[_0xb8d8('0x29')]){delete _0x5a2483['name'];}_0x5c14a8[_0xb8d8('0x19')](_0x98a17d)['send'](_0x5a2483);};}exports[_0xb8d8('0x2a')]=function(_0x334038,_0x258c64){var _0x3899db={},_0x3b7d04={},_0x494de5={'count':0x0,'rows':[]};var _0xf17a1b=_['map'](db['JscriptySessionReport'][_0xb8d8('0x2b')],function(_0x5e7ce7){return{'name':_0x5e7ce7[_0xb8d8('0x2c')],'type':_0x5e7ce7[_0xb8d8('0x2d')][_0xb8d8('0x2e')]};});_0x3b7d04['model']=_[_0xb8d8('0x2f')](_0xf17a1b,'name');_0x3b7d04[_0xb8d8('0x30')]=_[_0xb8d8('0x31')](_0x334038['query']);_0x3b7d04['filters']=_['intersection'](_0x3b7d04[_0xb8d8('0x32')],_0x3b7d04[_0xb8d8('0x30')]);_0x3899db['attributes']=_[_0xb8d8('0x33')](_0x3b7d04[_0xb8d8('0x32')],qs['fields'](_0x334038['query'][_0xb8d8('0x34')]));_0x3899db[_0xb8d8('0x35')]=_0x3899db[_0xb8d8('0x35')]['length']?_0x3899db[_0xb8d8('0x35')]:_0x3b7d04[_0xb8d8('0x32')];if(!_0x334038[_0xb8d8('0x30')][_0xb8d8('0x36')]('nolimit')){_0x3899db[_0xb8d8('0x1d')]=qs[_0xb8d8('0x1d')](_0x334038['query'][_0xb8d8('0x1d')]);_0x3899db[_0xb8d8('0x1c')]=qs[_0xb8d8('0x1c')](_0x334038[_0xb8d8('0x30')][_0xb8d8('0x1c')]);}_0x3899db[_0xb8d8('0x37')]=qs[_0xb8d8('0x38')](_0x334038['query'][_0xb8d8('0x38')]);_0x3899db['where']=qs[_0xb8d8('0x39')](_[_0xb8d8('0x3a')](_0x334038['query'],_0x3b7d04['filters']),_0xf17a1b);if(_0x334038['query'][_0xb8d8('0x3b')]){_0x3899db[_0xb8d8('0x3c')]=_[_0xb8d8('0x3d')](_0x3899db[_0xb8d8('0x3c')],{'$or':_[_0xb8d8('0x2f')](_0xf17a1b,function(_0x180521){if(_0x180521[_0xb8d8('0x2d')]!==_0xb8d8('0x3e')){var _0xb9f661={};_0xb9f661[_0x180521[_0xb8d8('0x29')]]={'$like':'%'+_0x334038[_0xb8d8('0x30')]['filter']+'%'};return _0xb9f661;}})});}_0x3899db=_['merge']({},_0x3899db,_0x334038[_0xb8d8('0x3f')]);var _0x355fe0={'where':_0x3899db[_0xb8d8('0x3c')]};return db[_0xb8d8('0x40')][_0xb8d8('0x1f')](_0x355fe0)[_0xb8d8('0x25')](function(_0x2ce4da){_0x494de5[_0xb8d8('0x1f')]=_0x2ce4da;if(_0x334038['query']['includeAll']){_0x3899db[_0xb8d8('0x41')]=[{'all':!![]}];}return db[_0xb8d8('0x40')][_0xb8d8('0x42')](_0x3899db);})[_0xb8d8('0x25')](function(_0x2673d8){_0x494de5[_0xb8d8('0x43')]=_0x2673d8;return _0x494de5;})['then'](respondWithFilteredResult(_0x258c64,_0x3899db))[_0xb8d8('0x44')](handleError(_0x258c64,null));};exports[_0xb8d8('0x45')]=function(_0x2ab797,_0x12ef4f){var _0x5c3f51={'raw':!![],'where':{'id':_0x2ab797[_0xb8d8('0x46')]['id']}},_0x1e4f16={};_0x1e4f16[_0xb8d8('0x32')]=_[_0xb8d8('0x31')](db[_0xb8d8('0x40')][_0xb8d8('0x2b')]);_0x1e4f16[_0xb8d8('0x30')]=_[_0xb8d8('0x31')](_0x2ab797['query']);_0x1e4f16['filters']=_[_0xb8d8('0x33')](_0x1e4f16[_0xb8d8('0x32')],_0x1e4f16[_0xb8d8('0x30')]);_0x5c3f51[_0xb8d8('0x35')]=_['intersection'](_0x1e4f16[_0xb8d8('0x32')],qs[_0xb8d8('0x34')](_0x2ab797[_0xb8d8('0x30')][_0xb8d8('0x34')]));_0x5c3f51[_0xb8d8('0x35')]=_0x5c3f51[_0xb8d8('0x35')][_0xb8d8('0x47')]?_0x5c3f51[_0xb8d8('0x35')]:_0x1e4f16['model'];if(_0x2ab797['query'][_0xb8d8('0x48')]){_0x5c3f51['include']=[{'all':!![]}];}_0x5c3f51=_['merge']({},_0x5c3f51,_0x2ab797[_0xb8d8('0x3f')]);return db['JscriptySessionReport'][_0xb8d8('0x49')](_0x5c3f51)[_0xb8d8('0x25')](handleEntityNotFound(_0x12ef4f,null))[_0xb8d8('0x25')](respondWithResult(_0x12ef4f,null))[_0xb8d8('0x44')](handleError(_0x12ef4f,null));};exports['create']=function(_0x3197c9,_0x5ed041){return db[_0xb8d8('0x40')]['create'](_0x3197c9[_0xb8d8('0x4a')],{})[_0xb8d8('0x25')](respondWithResult(_0x5ed041,0xc9))[_0xb8d8('0x44')](handleError(_0x5ed041,null));};exports[_0xb8d8('0x24')]=function(_0x487121,_0x45208b){if(_0x487121[_0xb8d8('0x4a')]['id']){delete _0x487121[_0xb8d8('0x4a')]['id'];}return db[_0xb8d8('0x40')][_0xb8d8('0x49')]({'where':{'id':_0x487121[_0xb8d8('0x46')]['id']}})[_0xb8d8('0x25')](handleEntityNotFound(_0x45208b,null))[_0xb8d8('0x25')](saveUpdates(_0x487121['body'],null))[_0xb8d8('0x25')](respondWithResult(_0x45208b,null))[_0xb8d8('0x44')](handleError(_0x45208b,null));};exports['destroy']=function(_0x557529,_0x1c41e9){return db[_0xb8d8('0x40')][_0xb8d8('0x49')]({'where':{'id':_0x557529[_0xb8d8('0x46')]['id']}})[_0xb8d8('0x25')](handleEntityNotFound(_0x1c41e9,null))['then'](removeEntity(_0x1c41e9,null))[_0xb8d8('0x44')](handleError(_0x1c41e9,null));};exports[_0xb8d8('0x4b')]=function(_0x2f9b39,_0x491ba5){return db['JscriptySessionReport']['describe']()['then'](respondWithResult(_0x491ba5,null))[_0xb8d8('0x44')](handleError(_0x491ba5,null));};exports['getQuestions']=function(_0x5d2e9c,_0xa9eae2,_0x2194f0){var _0x526f23={'raw':!![],'where':{}};var _0x4960cf={};var _0x1313d4={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xb8d8('0x4c')]({'where':{'id':_0x5d2e9c['params']['id']}})[_0xb8d8('0x25')](handleEntityNotFound(_0xa9eae2,null))[_0xb8d8('0x25')](function(_0x14349f){if(_0x14349f){_0x4960cf[_0xb8d8('0x32')]=_[_0xb8d8('0x31')](db['JscriptyQuestionReport'][_0xb8d8('0x2b')]);_0x4960cf[_0xb8d8('0x30')]=_[_0xb8d8('0x31')](_0x5d2e9c[_0xb8d8('0x30')]);_0x4960cf[_0xb8d8('0x39')]=_[_0xb8d8('0x33')](_0x4960cf[_0xb8d8('0x32')],_0x4960cf[_0xb8d8('0x30')]);_0x526f23[_0xb8d8('0x35')]=_['intersection'](_0x4960cf[_0xb8d8('0x32')],qs[_0xb8d8('0x34')](_0x5d2e9c['query']['fields']));_0x526f23[_0xb8d8('0x35')]=_0x526f23[_0xb8d8('0x35')][_0xb8d8('0x47')]?_0x526f23['attributes']:_0x4960cf['model'];if(!_0x5d2e9c[_0xb8d8('0x30')]['hasOwnProperty']('nolimit')){_0x526f23[_0xb8d8('0x1d')]=qs[_0xb8d8('0x1d')](_0x5d2e9c[_0xb8d8('0x30')][_0xb8d8('0x1d')]);_0x526f23[_0xb8d8('0x1c')]=qs[_0xb8d8('0x1c')](_0x5d2e9c['query'][_0xb8d8('0x1c')]);}_0x526f23['order']=qs[_0xb8d8('0x38')](_0x5d2e9c[_0xb8d8('0x30')][_0xb8d8('0x38')]);_0x526f23['where']=qs[_0xb8d8('0x39')](_['pick'](_0x5d2e9c[_0xb8d8('0x30')],_0x4960cf['filters']));_0x526f23[_0xb8d8('0x3c')]['SessionId']=_0x14349f['id'];if(_0x5d2e9c[_0xb8d8('0x30')][_0xb8d8('0x3b')]){_0x526f23[_0xb8d8('0x3c')]=_[_0xb8d8('0x3d')](_0x526f23[_0xb8d8('0x3c')],{'$or':_[_0xb8d8('0x2f')](_0x526f23['attributes'],function(_0x79d0fb){var _0x17807e={};_0x17807e[_0x79d0fb]={'$like':'%'+_0x5d2e9c[_0xb8d8('0x30')][_0xb8d8('0x3b')]+'%'};return _0x17807e;})});}_0x526f23=_[_0xb8d8('0x3d')]({},_0x526f23,_0x5d2e9c[_0xb8d8('0x3f')]);return db[_0xb8d8('0x4d')][_0xb8d8('0x1f')]({'where':_0x526f23[_0xb8d8('0x3c')]})['then'](function(_0x5000ce){_0x1313d4[_0xb8d8('0x1f')]=_0x5000ce;if(_0x5d2e9c[_0xb8d8('0x30')][_0xb8d8('0x48')]){_0x526f23[_0xb8d8('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb8d8('0x42')](_0x526f23);})['then'](function(_0x423f4f){_0x1313d4[_0xb8d8('0x43')]=_0x423f4f;return _0x1313d4;});}})[_0xb8d8('0x25')](respondWithFilteredResult(_0xa9eae2,_0x526f23))[_0xb8d8('0x44')](handleError(_0xa9eae2,null));}; \ No newline at end of file +var _0xfa6a=['catch','show','params','create','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','length','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','JscriptySessionReport','findAll','rows'];(function(_0xe36e74,_0x73267d){var _0x314b9b=function(_0x4b4e39){while(--_0x4b4e39){_0xe36e74['push'](_0xe36e74['shift']());}};_0x314b9b(++_0x73267d);}(_0xfa6a,0xfd));var _0xafa6=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xfa6a[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xafa6('0x0'));var rimraf=require(_0xafa6('0x1'));var zipdir=require(_0xafa6('0x2'));var jsonpatch=require(_0xafa6('0x3'));var rp=require(_0xafa6('0x4'));var moment=require('moment');var BPromise=require(_0xafa6('0x5'));var Mustache=require(_0xafa6('0x6'));var util=require(_0xafa6('0x7'));var path=require(_0xafa6('0x8'));var sox=require(_0xafa6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafa6('0xa'));var _=require(_0xafa6('0xb'));var squel=require(_0xafa6('0xc'));var crypto=require('crypto');var jsforce=require(_0xafa6('0xd'));var deskjs=require(_0xafa6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafa6('0xf'));var Redis=require(_0xafa6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xafa6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafa6('0x12'))(_0xafa6('0x13'));var utils=require('../../config/utils');var config=require(_0xafa6('0x14'));var licenseUtil=require(_0xafa6('0x15'));var db=require(_0xafa6('0x16'))['db'];function respondWithStatusCode(_0x31d7c9,_0x1ec4a2){_0x1ec4a2=_0x1ec4a2||0xcc;return function(_0x559398){if(_0x559398){return _0x31d7c9[_0xafa6('0x17')](_0x1ec4a2);}return _0x31d7c9[_0xafa6('0x18')](_0x1ec4a2)[_0xafa6('0x19')]();};}function respondWithResult(_0x496722,_0x2b0bd8){_0x2b0bd8=_0x2b0bd8||0xc8;return function(_0x3434ad){if(_0x3434ad){return _0x496722[_0xafa6('0x18')](_0x2b0bd8)['json'](_0x3434ad);}};}function respondWithFilteredResult(_0x4957d2,_0x32622e){return function(_0x3a461f){if(_0x3a461f){var _0x3c70cc=typeof _0x32622e['offset']===_0xafa6('0x1a')&&typeof _0x32622e[_0xafa6('0x1b')]===_0xafa6('0x1a');var _0x373ca9=_0x3a461f['count'];var _0x5cb1d9=_0x3c70cc?0x0:_0x32622e[_0xafa6('0x1c')];var _0x4460bf=_0x3c70cc?_0x3a461f[_0xafa6('0x1d')]:_0x32622e[_0xafa6('0x1c')]+_0x32622e[_0xafa6('0x1b')];var _0x3bf699;if(_0x4460bf>=_0x373ca9){_0x4460bf=_0x373ca9;_0x3bf699=0xc8;}else{_0x3bf699=0xce;}_0x4957d2[_0xafa6('0x18')](_0x3bf699);return _0x4957d2[_0xafa6('0x1e')](_0xafa6('0x1f'),_0x5cb1d9+'-'+_0x4460bf+'/'+_0x373ca9)[_0xafa6('0x20')](_0x3a461f);}return null;};}function patchUpdates(_0x3c6600){return function(_0x5bf0da){try{jsonpatch['apply'](_0x5bf0da,_0x3c6600,!![]);}catch(_0xc29a79){return BPromise[_0xafa6('0x21')](_0xc29a79);}return _0x5bf0da[_0xafa6('0x22')]();};}function saveUpdates(_0x12cbef,_0x8aac0c){return function(_0x1229d0){if(_0x1229d0){return _0x1229d0[_0xafa6('0x23')](_0x12cbef)[_0xafa6('0x24')](function(_0xc785d3){return _0xc785d3;});}return null;};}function removeEntity(_0x5a3f44,_0x80eba9){return function(_0x5e29a3){if(_0x5e29a3){return _0x5e29a3['destroy']()[_0xafa6('0x24')](function(){_0x5a3f44[_0xafa6('0x18')](0xcc)[_0xafa6('0x19')]();});}};}function handleEntityNotFound(_0x1d8918,_0xb08571){return function(_0x17264c){if(!_0x17264c){_0x1d8918[_0xafa6('0x17')](0x194);}return _0x17264c;};}function handleError(_0x11c462,_0x30de42){_0x30de42=_0x30de42||0x1f4;return function(_0x3a5833){logger[_0xafa6('0x25')](_0x3a5833['stack']);if(_0x3a5833[_0xafa6('0x26')]){delete _0x3a5833[_0xafa6('0x26')];}_0x11c462[_0xafa6('0x18')](_0x30de42)[_0xafa6('0x27')](_0x3a5833);};}exports[_0xafa6('0x28')]=function(_0x185446,_0xe697c9){var _0x36ca8f={},_0x535737={},_0x32d38f={'count':0x0,'rows':[]};var _0x212ff8=_[_0xafa6('0x29')](db['JscriptySessionReport'][_0xafa6('0x2a')],function(_0x7fb16e){return{'name':_0x7fb16e['fieldName'],'type':_0x7fb16e[_0xafa6('0x2b')][_0xafa6('0x2c')]};});_0x535737[_0xafa6('0x2d')]=_['map'](_0x212ff8,'name');_0x535737[_0xafa6('0x2e')]=_[_0xafa6('0x2f')](_0x185446[_0xafa6('0x2e')]);_0x535737[_0xafa6('0x30')]=_[_0xafa6('0x31')](_0x535737[_0xafa6('0x2d')],_0x535737[_0xafa6('0x2e')]);_0x36ca8f[_0xafa6('0x32')]=_['intersection'](_0x535737[_0xafa6('0x2d')],qs[_0xafa6('0x33')](_0x185446['query'][_0xafa6('0x33')]));_0x36ca8f[_0xafa6('0x32')]=_0x36ca8f[_0xafa6('0x32')]['length']?_0x36ca8f[_0xafa6('0x32')]:_0x535737['model'];if(!_0x185446[_0xafa6('0x2e')][_0xafa6('0x34')](_0xafa6('0x35'))){_0x36ca8f[_0xafa6('0x1b')]=qs[_0xafa6('0x1b')](_0x185446[_0xafa6('0x2e')]['limit']);_0x36ca8f[_0xafa6('0x1c')]=qs[_0xafa6('0x1c')](_0x185446[_0xafa6('0x2e')]['offset']);}_0x36ca8f[_0xafa6('0x36')]=qs['sort'](_0x185446[_0xafa6('0x2e')][_0xafa6('0x37')]);_0x36ca8f['where']=qs['filters'](_[_0xafa6('0x38')](_0x185446[_0xafa6('0x2e')],_0x535737['filters']),_0x212ff8);if(_0x185446[_0xafa6('0x2e')][_0xafa6('0x39')]){_0x36ca8f[_0xafa6('0x3a')]=_['merge'](_0x36ca8f['where'],{'$or':_[_0xafa6('0x29')](_0x212ff8,function(_0x2ac7b6){if(_0x2ac7b6[_0xafa6('0x2b')]!==_0xafa6('0x3b')){var _0x2908e3={};_0x2908e3[_0x2ac7b6[_0xafa6('0x26')]]={'$like':'%'+_0x185446[_0xafa6('0x2e')][_0xafa6('0x39')]+'%'};return _0x2908e3;}})});}_0x36ca8f=_[_0xafa6('0x3c')]({},_0x36ca8f,_0x185446[_0xafa6('0x3d')]);var _0x5b9092={'where':_0x36ca8f[_0xafa6('0x3a')]};return db['JscriptySessionReport']['count'](_0x5b9092)[_0xafa6('0x24')](function(_0x5344b0){_0x32d38f['count']=_0x5344b0;if(_0x185446[_0xafa6('0x2e')][_0xafa6('0x3e')]){_0x36ca8f[_0xafa6('0x3f')]=[{'all':!![]}];}return db[_0xafa6('0x40')][_0xafa6('0x41')](_0x36ca8f);})[_0xafa6('0x24')](function(_0x4e4feb){_0x32d38f[_0xafa6('0x42')]=_0x4e4feb;return _0x32d38f;})[_0xafa6('0x24')](respondWithFilteredResult(_0xe697c9,_0x36ca8f))[_0xafa6('0x43')](handleError(_0xe697c9,null));};exports[_0xafa6('0x44')]=function(_0x4d6318,_0x3103bc){var _0x56bd99={'raw':!![],'where':{'id':_0x4d6318[_0xafa6('0x45')]['id']}},_0x10aadc={};_0x10aadc[_0xafa6('0x2d')]=_[_0xafa6('0x2f')](db[_0xafa6('0x40')][_0xafa6('0x2a')]);_0x10aadc[_0xafa6('0x2e')]=_['keys'](_0x4d6318[_0xafa6('0x2e')]);_0x10aadc[_0xafa6('0x30')]=_['intersection'](_0x10aadc[_0xafa6('0x2d')],_0x10aadc[_0xafa6('0x2e')]);_0x56bd99[_0xafa6('0x32')]=_[_0xafa6('0x31')](_0x10aadc[_0xafa6('0x2d')],qs['fields'](_0x4d6318[_0xafa6('0x2e')]['fields']));_0x56bd99[_0xafa6('0x32')]=_0x56bd99['attributes']['length']?_0x56bd99['attributes']:_0x10aadc['model'];if(_0x4d6318[_0xafa6('0x2e')]['includeAll']){_0x56bd99['include']=[{'all':!![]}];}_0x56bd99=_[_0xafa6('0x3c')]({},_0x56bd99,_0x4d6318['options']);return db['JscriptySessionReport']['find'](_0x56bd99)[_0xafa6('0x24')](handleEntityNotFound(_0x3103bc,null))[_0xafa6('0x24')](respondWithResult(_0x3103bc,null))[_0xafa6('0x43')](handleError(_0x3103bc,null));};exports['create']=function(_0x45dfbb,_0x130a79){return db[_0xafa6('0x40')][_0xafa6('0x46')](_0x45dfbb[_0xafa6('0x47')],{})['then'](respondWithResult(_0x130a79,0xc9))[_0xafa6('0x43')](handleError(_0x130a79,null));};exports[_0xafa6('0x23')]=function(_0x237b80,_0x2e05e0){if(_0x237b80[_0xafa6('0x47')]['id']){delete _0x237b80[_0xafa6('0x47')]['id'];}return db[_0xafa6('0x40')][_0xafa6('0x48')]({'where':{'id':_0x237b80[_0xafa6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e05e0,null))[_0xafa6('0x24')](saveUpdates(_0x237b80[_0xafa6('0x47')],null))[_0xafa6('0x24')](respondWithResult(_0x2e05e0,null))[_0xafa6('0x43')](handleError(_0x2e05e0,null));};exports[_0xafa6('0x49')]=function(_0x1d81ff,_0xb7aa31){return db[_0xafa6('0x40')][_0xafa6('0x48')]({'where':{'id':_0x1d81ff[_0xafa6('0x45')]['id']}})['then'](handleEntityNotFound(_0xb7aa31,null))[_0xafa6('0x24')](removeEntity(_0xb7aa31,null))[_0xafa6('0x43')](handleError(_0xb7aa31,null));};exports[_0xafa6('0x4a')]=function(_0x463e4b,_0x524821){return db['JscriptySessionReport'][_0xafa6('0x4a')]()[_0xafa6('0x24')](respondWithResult(_0x524821,null))[_0xafa6('0x43')](handleError(_0x524821,null));};exports[_0xafa6('0x4b')]=function(_0x529b56,_0x1996ac,_0x2ddb25){var _0x362691={'raw':!![],'where':{}};var _0x436a90={};var _0xdef06f={'count':0x0,'rows':[]};return db[_0xafa6('0x40')][_0xafa6('0x4c')]({'where':{'id':_0x529b56[_0xafa6('0x45')]['id']}})[_0xafa6('0x24')](handleEntityNotFound(_0x1996ac,null))[_0xafa6('0x24')](function(_0x2ffe2a){if(_0x2ffe2a){_0x436a90[_0xafa6('0x2d')]=_[_0xafa6('0x2f')](db[_0xafa6('0x4d')][_0xafa6('0x2a')]);_0x436a90['query']=_['keys'](_0x529b56[_0xafa6('0x2e')]);_0x436a90[_0xafa6('0x30')]=_[_0xafa6('0x31')](_0x436a90[_0xafa6('0x2d')],_0x436a90[_0xafa6('0x2e')]);_0x362691[_0xafa6('0x32')]=_[_0xafa6('0x31')](_0x436a90[_0xafa6('0x2d')],qs[_0xafa6('0x33')](_0x529b56[_0xafa6('0x2e')]['fields']));_0x362691[_0xafa6('0x32')]=_0x362691[_0xafa6('0x32')][_0xafa6('0x4e')]?_0x362691[_0xafa6('0x32')]:_0x436a90[_0xafa6('0x2d')];if(!_0x529b56[_0xafa6('0x2e')]['hasOwnProperty']('nolimit')){_0x362691[_0xafa6('0x1b')]=qs['limit'](_0x529b56['query'][_0xafa6('0x1b')]);_0x362691[_0xafa6('0x1c')]=qs[_0xafa6('0x1c')](_0x529b56[_0xafa6('0x2e')][_0xafa6('0x1c')]);}_0x362691[_0xafa6('0x36')]=qs[_0xafa6('0x37')](_0x529b56[_0xafa6('0x2e')][_0xafa6('0x37')]);_0x362691[_0xafa6('0x3a')]=qs[_0xafa6('0x30')](_[_0xafa6('0x38')](_0x529b56[_0xafa6('0x2e')],_0x436a90[_0xafa6('0x30')]));_0x362691[_0xafa6('0x3a')][_0xafa6('0x4f')]=_0x2ffe2a['id'];if(_0x529b56[_0xafa6('0x2e')][_0xafa6('0x39')]){_0x362691[_0xafa6('0x3a')]=_[_0xafa6('0x3c')](_0x362691[_0xafa6('0x3a')],{'$or':_[_0xafa6('0x29')](_0x362691[_0xafa6('0x32')],function(_0x4195e3){var _0x405cb1={};_0x405cb1[_0x4195e3]={'$like':'%'+_0x529b56[_0xafa6('0x2e')][_0xafa6('0x39')]+'%'};return _0x405cb1;})});}_0x362691=_[_0xafa6('0x3c')]({},_0x362691,_0x529b56[_0xafa6('0x3d')]);return db['JscriptyQuestionReport'][_0xafa6('0x1d')]({'where':_0x362691[_0xafa6('0x3a')]})[_0xafa6('0x24')](function(_0x1d081a){_0xdef06f[_0xafa6('0x1d')]=_0x1d081a;if(_0x529b56[_0xafa6('0x2e')][_0xafa6('0x3e')]){_0x362691[_0xafa6('0x3f')]=[{'all':!![]}];}return db[_0xafa6('0x4d')]['findAll'](_0x362691);})['then'](function(_0x691c01){_0xdef06f['rows']=_0x691c01;return _0xdef06f;});}})[_0xafa6('0x24')](respondWithFilteredResult(_0x1996ac,_0x362691))[_0xafa6('0x43')](handleError(_0x1996ac,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 0961156..677b22b 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 _0xb091=['moment','request-promise','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','util','../../config/logger','api'];(function(_0x55e4ef,_0x1f8d16){var _0x27c8c1=function(_0x505111){while(--_0x505111){_0x55e4ef['push'](_0x55e4ef['shift']());}};_0x27c8c1(++_0x1f8d16);}(_0xb091,0x16e));var _0x1b09=function(_0x11c6a5,_0x32690b){_0x11c6a5=_0x11c6a5-0x0;var _0x263b7e=_0xb091[_0x11c6a5];return _0x263b7e;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('JscriptySessionReport',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef17=['./jscriptySessionReport.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0xef17,0x136));var _0x7ef1=function(_0x403ba1,_0x20eebf){_0x403ba1=_0x403ba1-0x0;var _0x43462c=_0xef17[_0x403ba1];return _0x43462c;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var rp=require(_0x7ef1('0x6'));var fs=require('fs');var path=require(_0x7ef1('0x7'));var rimraf=require(_0x7ef1('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ef1('0x9'));module['exports']=function(_0x138ed1,_0x498596){return _0x138ed1[_0x7ef1('0xa')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 7f6b6f1..edfbdfc 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 _0x0424=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0424,0x159));var _0x4042=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x0424[_0x7e918f];return _0x5b35ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});} \ No newline at end of file +var _0xfb11=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x45c10a,_0x4b9090){var _0x3f680=function(_0x26243e){while(--_0x26243e){_0x45c10a['push'](_0x45c10a['shift']());}};_0x3f680(++_0x4b9090);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xfb11[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 82337b3..33944ca 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 _0x2ea3=['downloadLogFile','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','update','/download_log_file'];(function(_0x54fb9d,_0x38a3af){var _0x2f0a92=function(_0x2ab8ec){while(--_0x2ab8ec){_0x54fb9d['push'](_0x54fb9d['shift']());}};_0x2f0a92(++_0x38a3af);}(_0x2ea3,0x196));var _0x32ea=function(_0x471cb9,_0x2c3c51){_0x471cb9=_0x471cb9-0x0;var _0x135d0c=_0x2ea3[_0x471cb9];return _0x135d0c;};'use strict';var multer=require(_0x32ea('0x0'));var util=require(_0x32ea('0x1'));var path=require('path');var timeout=require(_0x32ea('0x2'));var express=require(_0x32ea('0x3'));var router=express[_0x32ea('0x4')]();var fs_extra=require(_0x32ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x32ea('0x6'));var config=require(_0x32ea('0x7'));var controller=require('./license.controller');router[_0x32ea('0x8')]('/',controller[_0x32ea('0x9')]);router['put'](_0x32ea('0xa'),auth[_0x32ea('0xb')](),controller[_0x32ea('0xc')]);router[_0x32ea('0x8')](_0x32ea('0xd'),auth['isAuthenticated'](),controller[_0x32ea('0xe')]);module['exports']=router; \ No newline at end of file +var _0x61e8=['isAuthenticated','downloadLogFile','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x2ec644,_0x45ddbc){var _0x3593de=function(_0x36fdf6){while(--_0x36fdf6){_0x2ec644['push'](_0x2ec644['shift']());}};_0x3593de(++_0x45ddbc);}(_0x61e8,0x18f));var _0x861e=function(_0x5626af,_0x4285c3){_0x5626af=_0x5626af-0x0;var _0x12e826=_0x61e8[_0x5626af];return _0x12e826;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x861e('0x0'));var express=require(_0x861e('0x1'));var router=express[_0x861e('0x2')]();var fs_extra=require(_0x861e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x861e('0x4'));var config=require(_0x861e('0x5'));var controller=require('./license.controller');router[_0x861e('0x6')]('/',controller[_0x861e('0x7')]);router['put']('/:id',auth[_0x861e('0x8')](),controller['update']);router[_0x861e('0x6')]('/download_log_file',auth[_0x861e('0x8')](),controller[_0x861e('0x9')]);module[_0x861e('0xa')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9170351..0473b93 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 _0x31f3=['TEXT','STRING','INTEGER','exports'];(function(_0x457bc6,_0x431adc){var _0x337f06=function(_0x158788){while(--_0x158788){_0x457bc6['push'](_0x457bc6['shift']());}};_0x337f06(++_0x431adc);}(_0x31f3,0xf7));var _0x331f=function(_0x2d747c,_0x851c49){_0x2d747c=_0x2d747c-0x0;var _0x2ac042=_0x31f3[_0x2d747c];return _0x2ac042;};'use strict';var Sequelize=require('sequelize');module[_0x331f('0x0')]={'license':{'type':Sequelize[_0x331f('0x1')]},'data1':{'type':Sequelize[_0x331f('0x2')]},'data2':{'type':Sequelize[_0x331f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x331f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb665=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x9c0c5e,_0x56615e){var _0x3ef1ca=function(_0x177c37){while(--_0x177c37){_0x9c0c5e['push'](_0x9c0c5e['shift']());}};_0x3ef1ca(++_0x56615e);}(_0xb665,0x1ce));var _0x5b66=function(_0x4bb649,_0x1e1118){_0x4bb649=_0x4bb649-0x0;var _0x19b0bc=_0xb665[_0x4bb649];return _0x19b0bc;};'use strict';var Sequelize=require(_0x5b66('0x0'));module[_0x5b66('0x1')]={'license':{'type':Sequelize[_0x5b66('0x2')]},'data1':{'type':Sequelize[_0x5b66('0x3')]},'data2':{'type':Sequelize[_0x5b66('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x5b66('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 5891fba..ab1c9e6 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 _0x56a4=['params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','set','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../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','Content-Range','json','apply','reject','save','then','error','stack','name','send','model','License','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','catch','update','body','find'];(function(_0x19cbcc,_0x44384e){var _0x44d405=function(_0x475354){while(--_0x475354){_0x19cbcc['push'](_0x19cbcc['shift']());}};_0x44d405(++_0x44384e);}(_0x56a4,0xa4));var _0x456a=function(_0x281d23,_0x20d215){_0x281d23=_0x281d23-0x0;var _0x6b91db=_0x56a4[_0x281d23];return _0x6b91db;};'use strict';var emlformat=require(_0x456a('0x0'));var rimraf=require(_0x456a('0x1'));var zipdir=require(_0x456a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x456a('0x3'));var moment=require(_0x456a('0x4'));var BPromise=require(_0x456a('0x5'));var Mustache=require(_0x456a('0x6'));var util=require(_0x456a('0x7'));var path=require(_0x456a('0x8'));var sox=require(_0x456a('0x9'));var csv=require(_0x456a('0xa'));var ejs=require(_0x456a('0xb'));var fs=require('fs');var fs_extra=require(_0x456a('0xc'));var _=require(_0x456a('0xd'));var squel=require(_0x456a('0xe'));var crypto=require(_0x456a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x456a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x456a('0x11'));var as=require(_0x456a('0x12'));var hardwareService=require(_0x456a('0x13'));var logger=require(_0x456a('0x14'))(_0x456a('0x15'));var utils=require('../../config/utils');var config=require(_0x456a('0x16'));var licenseUtil=require(_0x456a('0x17'));var db=require(_0x456a('0x18'))['db'];function respondWithStatusCode(_0x36bad2,_0x2ff2a0){_0x2ff2a0=_0x2ff2a0||0xcc;return function(_0x147919){if(_0x147919){return _0x36bad2[_0x456a('0x19')](_0x2ff2a0);}return _0x36bad2[_0x456a('0x1a')](_0x2ff2a0)[_0x456a('0x1b')]();};}function respondWithResult(_0x158b78,_0x57754b){_0x57754b=_0x57754b||0xc8;return function(_0x91bc8d){if(_0x91bc8d){return _0x158b78['status'](_0x57754b)['json'](_0x91bc8d);}};}function respondWithFilteredResult(_0x31f25d,_0x428a92){return function(_0xe6594b){if(_0xe6594b){var _0x21f694=typeof _0x428a92[_0x456a('0x1c')]===_0x456a('0x1d')&&typeof _0x428a92[_0x456a('0x1e')]===_0x456a('0x1d');var _0x324af8=_0xe6594b[_0x456a('0x1f')];var _0x42edd9=_0x21f694?0x0:_0x428a92['offset'];var _0x39424d=_0x21f694?_0xe6594b[_0x456a('0x1f')]:_0x428a92[_0x456a('0x1c')]+_0x428a92[_0x456a('0x1e')];var _0x2636f3;if(_0x39424d>=_0x324af8){_0x39424d=_0x324af8;_0x2636f3=0xc8;}else{_0x2636f3=0xce;}_0x31f25d[_0x456a('0x1a')](_0x2636f3);return _0x31f25d['set'](_0x456a('0x20'),_0x42edd9+'-'+_0x39424d+'/'+_0x324af8)[_0x456a('0x21')](_0xe6594b);}return null;};}function patchUpdates(_0x5b856c){return function(_0xcd74b6){try{jsonpatch[_0x456a('0x22')](_0xcd74b6,_0x5b856c,!![]);}catch(_0x4695e3){return BPromise[_0x456a('0x23')](_0x4695e3);}return _0xcd74b6[_0x456a('0x24')]();};}function saveUpdates(_0x302f76,_0x2f918a){return function(_0x18c042){if(_0x18c042){return _0x18c042['update'](_0x302f76)[_0x456a('0x25')](function(_0x11ccdc){return _0x11ccdc;});}return null;};}function removeEntity(_0x349214,_0x240c95){return function(_0x2b03ee){if(_0x2b03ee){return _0x2b03ee['destroy']()[_0x456a('0x25')](function(){_0x349214[_0x456a('0x1a')](0xcc)[_0x456a('0x1b')]();});}};}function handleEntityNotFound(_0x1936ba,_0x132a82){return function(_0x26ba01){if(!_0x26ba01){_0x1936ba[_0x456a('0x19')](0x194);}return _0x26ba01;};}function handleError(_0x88f338,_0x18fd7d){_0x18fd7d=_0x18fd7d||0x1f4;return function(_0x39f263){logger[_0x456a('0x26')](_0x39f263[_0x456a('0x27')]);if(_0x39f263[_0x456a('0x28')]){delete _0x39f263[_0x456a('0x28')];}_0x88f338[_0x456a('0x1a')](_0x18fd7d)[_0x456a('0x29')](_0x39f263);};}var utilLicense=require(_0x456a('0x17'));exports['index']=function(_0x49d2d1,_0x1bbb83){var _0x2a25d5={'raw':!![],'where':{'id':0x1}},_0x430666={};_0x430666[_0x456a('0x2a')]=_['keys'](db[_0x456a('0x2b')][_0x456a('0x2c')]);_0x430666[_0x456a('0x2d')]=_[_0x456a('0x2e')](_0x49d2d1['query']);_0x430666[_0x456a('0x2f')]=_[_0x456a('0x30')](_0x430666[_0x456a('0x2a')],_0x430666[_0x456a('0x2d')]);_0x2a25d5[_0x456a('0x31')]=_['intersection'](_0x430666[_0x456a('0x2a')],qs['fields'](_0x49d2d1[_0x456a('0x2d')][_0x456a('0x32')]));_0x2a25d5[_0x456a('0x31')]=_0x2a25d5['attributes'][_0x456a('0x33')]?_0x2a25d5[_0x456a('0x31')]:_0x430666['model'];_0x2a25d5=_[_0x456a('0x34')]({},_0x2a25d5,_0x49d2d1[_0x456a('0x35')]);return utilLicense['getLicense'](_0x2a25d5)[_0x456a('0x25')](respondWithResult(_0x1bbb83,null))[_0x456a('0x36')](handleError(_0x1bbb83,null));};exports[_0x456a('0x37')]=function(_0x1a7d49,_0x48696a){if(_0x1a7d49[_0x456a('0x38')]['id']){delete _0x1a7d49[_0x456a('0x38')]['id'];}return db[_0x456a('0x2b')][_0x456a('0x39')]({'where':{'id':_0x1a7d49[_0x456a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x48696a,null))[_0x456a('0x25')](function(_0x4c60df){var _0x3a7c2f=_0x4c60df[_0x456a('0x3b')]({'plain':!![]});return utilLicense[_0x456a('0x3c')](_0x3a7c2f,_0x1a7d49[_0x456a('0x38')][_0x456a('0x3d')]);})['then'](function(_0x3ac0d6){if(!_0x3ac0d6['demo']){return saveUpdates(_0x1a7d49[_0x456a('0x38')],null);}return _0x3ac0d6;})[_0x456a('0x25')](respondWithResult(_0x48696a,null))[_0x456a('0x36')](handleError(_0x48696a,null));};exports[_0x456a('0x3e')]=function(_0x479a62,_0x59ee11){var _0x1e58b2=_0x456a('0x3f');var _0x44319a=path[_0x456a('0x40')](_0x456a('0x41'),_0x456a('0x42'),_0x456a('0x43'),_0x1e58b2);_0x59ee11[_0x456a('0x44')](_0x456a('0x45'),'attachment;\x20filename='+_0x1e58b2);_0x59ee11[_0x456a('0x46')](_0x456a('0x47'),_0x456a('0x48'));_0x59ee11[_0x456a('0x49')](_0x44319a);}; \ No newline at end of file +var _0x8a15=['status','end','limit','undefined','count','offset','json','apply','save','update','then','error','stack','name','send','model','keys','rawAttributes','filters','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','find','checkLicense','key','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3572cc,_0x3b1360){var _0xa9435a=function(_0x239063){while(--_0x239063){_0x3572cc['push'](_0x3572cc['shift']());}};_0xa9435a(++_0x3b1360);}(_0x8a15,0x138));var _0x58a1=function(_0xd0255a,_0x5ba91a){_0xd0255a=_0xd0255a-0x0;var _0x265f2d=_0x8a15[_0xd0255a];return _0x265f2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58a1('0x1'));var rp=require(_0x58a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x58a1('0x3'));var util=require('util');var path=require('path');var sox=require(_0x58a1('0x4'));var csv=require(_0x58a1('0x5'));var ejs=require(_0x58a1('0x6'));var fs=require('fs');var fs_extra=require(_0x58a1('0x7'));var _=require(_0x58a1('0x8'));var squel=require('squel');var crypto=require(_0x58a1('0x9'));var jsforce=require(_0x58a1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x58a1('0x5'));var querystring=require(_0x58a1('0xb'));var Papa=require(_0x58a1('0xc'));var Redis=require(_0x58a1('0xd'));var authService=require(_0x58a1('0xe'));var qs=require(_0x58a1('0xf'));var as=require(_0x58a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x58a1('0x11'));var utils=require(_0x58a1('0x12'));var config=require(_0x58a1('0x13'));var licenseUtil=require(_0x58a1('0x14'));var db=require(_0x58a1('0x15'))['db'];function respondWithStatusCode(_0x164670,_0x3c2909){_0x3c2909=_0x3c2909||0xcc;return function(_0xbe7aa8){if(_0xbe7aa8){return _0x164670[_0x58a1('0x16')](_0x3c2909);}return _0x164670[_0x58a1('0x17')](_0x3c2909)[_0x58a1('0x18')]();};}function respondWithResult(_0x9b0eab,_0x3ffa7f){_0x3ffa7f=_0x3ffa7f||0xc8;return function(_0x4841a3){if(_0x4841a3){return _0x9b0eab[_0x58a1('0x17')](_0x3ffa7f)['json'](_0x4841a3);}};}function respondWithFilteredResult(_0x4dbab6,_0x38a0a5){return function(_0x4191ac){if(_0x4191ac){var _0x380faa=typeof _0x38a0a5['offset']==='undefined'&&typeof _0x38a0a5[_0x58a1('0x19')]===_0x58a1('0x1a');var _0x56de6c=_0x4191ac[_0x58a1('0x1b')];var _0x24e60d=_0x380faa?0x0:_0x38a0a5[_0x58a1('0x1c')];var _0x28f27e=_0x380faa?_0x4191ac['count']:_0x38a0a5[_0x58a1('0x1c')]+_0x38a0a5[_0x58a1('0x19')];var _0x2d7f1f;if(_0x28f27e>=_0x56de6c){_0x28f27e=_0x56de6c;_0x2d7f1f=0xc8;}else{_0x2d7f1f=0xce;}_0x4dbab6[_0x58a1('0x17')](_0x2d7f1f);return _0x4dbab6['set']('Content-Range',_0x24e60d+'-'+_0x28f27e+'/'+_0x56de6c)[_0x58a1('0x1d')](_0x4191ac);}return null;};}function patchUpdates(_0x1c803b){return function(_0x45a042){try{jsonpatch[_0x58a1('0x1e')](_0x45a042,_0x1c803b,!![]);}catch(_0x1b1e3f){return BPromise['reject'](_0x1b1e3f);}return _0x45a042[_0x58a1('0x1f')]();};}function saveUpdates(_0x4ea410,_0xebb544){return function(_0x6a3e9e){if(_0x6a3e9e){return _0x6a3e9e[_0x58a1('0x20')](_0x4ea410)[_0x58a1('0x21')](function(_0x2898a3){return _0x2898a3;});}return null;};}function removeEntity(_0x228501,_0x412afc){return function(_0x2c9009){if(_0x2c9009){return _0x2c9009['destroy']()['then'](function(){_0x228501['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x417d07,_0x86f1b9){return function(_0x48d0fd){if(!_0x48d0fd){_0x417d07[_0x58a1('0x16')](0x194);}return _0x48d0fd;};}function handleError(_0xe0193c,_0x4f135d){_0x4f135d=_0x4f135d||0x1f4;return function(_0x17dcb8){logger[_0x58a1('0x22')](_0x17dcb8[_0x58a1('0x23')]);if(_0x17dcb8[_0x58a1('0x24')]){delete _0x17dcb8[_0x58a1('0x24')];}_0xe0193c[_0x58a1('0x17')](_0x4f135d)[_0x58a1('0x25')](_0x17dcb8);};}var utilLicense=require(_0x58a1('0x14'));exports['index']=function(_0x363f3c,_0x16c578){var _0x1fbe3d={'raw':!![],'where':{'id':0x1}},_0x4d1b57={};_0x4d1b57[_0x58a1('0x26')]=_[_0x58a1('0x27')](db['License'][_0x58a1('0x28')]);_0x4d1b57['query']=_[_0x58a1('0x27')](_0x363f3c['query']);_0x4d1b57[_0x58a1('0x29')]=_[_0x58a1('0x2a')](_0x4d1b57['model'],_0x4d1b57[_0x58a1('0x2b')]);_0x1fbe3d[_0x58a1('0x2c')]=_[_0x58a1('0x2a')](_0x4d1b57[_0x58a1('0x26')],qs[_0x58a1('0x2d')](_0x363f3c[_0x58a1('0x2b')][_0x58a1('0x2d')]));_0x1fbe3d[_0x58a1('0x2c')]=_0x1fbe3d[_0x58a1('0x2c')][_0x58a1('0x2e')]?_0x1fbe3d['attributes']:_0x4d1b57[_0x58a1('0x26')];_0x1fbe3d=_[_0x58a1('0x2f')]({},_0x1fbe3d,_0x363f3c[_0x58a1('0x30')]);return utilLicense[_0x58a1('0x31')](_0x1fbe3d)[_0x58a1('0x21')](respondWithResult(_0x16c578,null))[_0x58a1('0x32')](handleError(_0x16c578,null));};exports[_0x58a1('0x20')]=function(_0x4f0b7d,_0x443cfd){if(_0x4f0b7d[_0x58a1('0x33')]['id']){delete _0x4f0b7d['body']['id'];}return db[_0x58a1('0x34')][_0x58a1('0x35')]({'where':{'id':_0x4f0b7d['params']['id']}})[_0x58a1('0x21')](handleEntityNotFound(_0x443cfd,null))['then'](function(_0x2a8ef4){var _0x437b95=_0x2a8ef4['get']({'plain':!![]});return utilLicense[_0x58a1('0x36')](_0x437b95,_0x4f0b7d[_0x58a1('0x33')][_0x58a1('0x37')]);})[_0x58a1('0x21')](function(_0x1d6210){if(!_0x1d6210['demo']){return saveUpdates(_0x4f0b7d[_0x58a1('0x33')],null);}return _0x1d6210;})['then'](respondWithResult(_0x443cfd,null))[_0x58a1('0x32')](handleError(_0x443cfd,null));};exports[_0x58a1('0x38')]=function(_0x3772db,_0x8be78a){var _0x5e224a='license-info.log';var _0x124e90=path[_0x58a1('0x39')](_0x58a1('0x3a'),'log',_0x58a1('0x3b'),_0x5e224a);_0x8be78a[_0x58a1('0x3c')](_0x58a1('0x3d'),_0x58a1('0x3e')+_0x5e224a);_0x8be78a[_0x58a1('0x3f')](_0x58a1('0x40'),_0x58a1('0x41'));_0x8be78a[_0x58a1('0x42')](_0x124e90);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1d0f93d..5073c7b 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 _0x5a1b=['license','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./license.attributes','exports','define','License'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5a1b,0x1c9));var _0xb5a1=function(_0x445b4f,_0xc0dfd8){_0x445b4f=_0x445b4f-0x0;var _0x33405d=_0x5a1b[_0x445b4f];return _0x33405d;};'use strict';var _=require(_0xb5a1('0x0'));var util=require(_0xb5a1('0x1'));var logger=require(_0xb5a1('0x2'))(_0xb5a1('0x3'));var moment=require(_0xb5a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xb5a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5a1('0x6'));var attributes=require(_0xb5a1('0x7'));module[_0xb5a1('0x8')]=function(_0x44704b,_0x52db2c){return _0x44704b[_0xb5a1('0x9')](_0xb5a1('0xa'),attributes,{'tableName':_0xb5a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe376=['../../config/logger','api','moment','bluebird','path','../../config/environment','./license.attributes','exports','define','License','license','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe376,0xe3));var _0x6e37=function(_0xfcfc35,_0x41125e){_0xfcfc35=_0xfcfc35-0x0;var _0x13a3c7=_0xe376[_0xfcfc35];return _0x13a3c7;};'use strict';var _=require('lodash');var util=require(_0x6e37('0x0'));var logger=require(_0x6e37('0x1'))(_0x6e37('0x2'));var moment=require(_0x6e37('0x3'));var BPromise=require(_0x6e37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e37('0x5'));var rimraf=require('rimraf');var config=require(_0x6e37('0x6'));var attributes=require(_0x6e37('0x7'));module[_0x6e37('0x8')]=function(_0x22cce4,_0x1e92e7){return _0x22cce4[_0x6e37('0x9')](_0x6e37('0xa'),attributes,{'tableName':_0x6e37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 93bd69f..92fa044 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 _0x99b0=['request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2e1591,_0x1f0cfc){var _0x43c542=function(_0x264537){while(--_0x264537){_0x2e1591['push'](_0x2e1591['shift']());}};_0x43c542(++_0x1f0cfc);}(_0x99b0,0x181));var _0x099b=function(_0x218dd4,_0x3f8280){_0x218dd4=_0x218dd4-0x0;var _0x43d7e0=_0x99b0[_0x218dd4];return _0x43d7e0;};'use strict';var _=require(_0x099b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x099b('0x1'));var rs=require(_0x099b('0x2'));var fs=require('fs');var Redis=require(_0x099b('0x3'));var db=require(_0x099b('0x4'))['db'];var utils=require(_0x099b('0x5'));var logger=require(_0x099b('0x6'))('rpc');var config=require(_0x099b('0x7'));var jayson=require(_0x099b('0x8'));var client=jayson[_0x099b('0x9')][_0x099b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22cdcb,_0x14736c,_0x17d96e){return new BPromise(function(_0x101f06,_0x214364){return client[_0x099b('0xb')](_0x22cdcb,_0x17d96e)[_0x099b('0xc')](function(_0x10dd06){logger[_0x099b('0xd')](_0x099b('0xe'),_0x14736c,'request\x20sent');logger[_0x099b('0xf')](_0x099b('0x10'),_0x14736c,_0x099b('0x11'),JSON[_0x099b('0x12')](_0x10dd06));if(_0x10dd06[_0x099b('0x13')]){if(_0x10dd06['error'][_0x099b('0x14')]===0x1f4){logger[_0x099b('0x13')](_0x099b('0xe'),_0x14736c,_0x10dd06['error']['message']);return _0x214364(_0x10dd06[_0x099b('0x13')][_0x099b('0x15')]);}logger[_0x099b('0x13')]('License,\x20%s,\x20%s',_0x14736c,_0x10dd06[_0x099b('0x13')]['message']);return _0x101f06(_0x10dd06['error'][_0x099b('0x15')]);}else{logger['info']('License,\x20%s,\x20%s',_0x14736c,_0x099b('0x11'));_0x101f06(_0x10dd06['result'][_0x099b('0x15')]);}})['catch'](function(_0x426097){logger[_0x099b('0x13')](_0x099b('0xe'),_0x14736c,_0x426097);_0x214364(_0x426097);});});} \ No newline at end of file +var _0xe4d9=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x53317c,_0x5dee5e){var _0x2900b9=function(_0x570b24){while(--_0x570b24){_0x53317c['push'](_0x53317c['shift']());}};_0x2900b9(++_0x5dee5e);}(_0xe4d9,0x1b3));var _0x9e4d=function(_0x17d091,_0x936f23){_0x17d091=_0x17d091-0x0;var _0x32c5c8=_0xe4d9[_0x17d091];return _0x32c5c8;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var moment=require(_0x9e4d('0x2'));var BPromise=require(_0x9e4d('0x3'));var rs=require(_0x9e4d('0x4'));var fs=require('fs');var Redis=require(_0x9e4d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e4d('0x6'));var logger=require(_0x9e4d('0x7'))(_0x9e4d('0x8'));var config=require(_0x9e4d('0x9'));var jayson=require(_0x9e4d('0xa'));var client=jayson[_0x9e4d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x264fa4,_0x1e6c1a,_0x16deb0){return new BPromise(function(_0x453100,_0x368e52){return client[_0x9e4d('0xc')](_0x264fa4,_0x16deb0)[_0x9e4d('0xd')](function(_0x39a0d8){logger[_0x9e4d('0xe')]('License,\x20%s,\x20%s',_0x1e6c1a,_0x9e4d('0xf'));logger['debug'](_0x9e4d('0x10'),_0x1e6c1a,_0x9e4d('0xf'),JSON[_0x9e4d('0x11')](_0x39a0d8));if(_0x39a0d8[_0x9e4d('0x12')]){if(_0x39a0d8[_0x9e4d('0x12')][_0x9e4d('0x13')]===0x1f4){logger[_0x9e4d('0x12')](_0x9e4d('0x14'),_0x1e6c1a,_0x39a0d8[_0x9e4d('0x12')]['message']);return _0x368e52(_0x39a0d8['error'][_0x9e4d('0x15')]);}logger[_0x9e4d('0x12')](_0x9e4d('0x14'),_0x1e6c1a,_0x39a0d8[_0x9e4d('0x12')][_0x9e4d('0x15')]);return _0x453100(_0x39a0d8[_0x9e4d('0x12')][_0x9e4d('0x15')]);}else{logger[_0x9e4d('0xe')](_0x9e4d('0x14'),_0x1e6c1a,_0x9e4d('0xf'));_0x453100(_0x39a0d8['result'][_0x9e4d('0x15')]);}})[_0x9e4d('0x16')](function(_0x5438fc){logger[_0x9e4d('0x12')](_0x9e4d('0x14'),_0x1e6c1a,_0x5438fc);_0x368e52(_0x5438fc);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 1221ea7..311f4d4 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 _0xf254=['getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','delete','removeImap','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers'];(function(_0x56b98e,_0x371bb6){var _0x3e17c5=function(_0x92195d){while(--_0x92195d){_0x56b98e['push'](_0x56b98e['shift']());}};_0x3e17c5(++_0x371bb6);}(_0xf254,0x111));var _0x4f25=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0xf254[_0x1f9f5f];return _0x51d649;};'use strict';var multer=require('multer');var util=require(_0x4f25('0x0'));var path=require(_0x4f25('0x1'));var timeout=require(_0x4f25('0x2'));var express=require(_0x4f25('0x3'));var router=express['Router']();var fs_extra=require(_0x4f25('0x4'));var auth=require(_0x4f25('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f25('0x6'));var controller=require(_0x4f25('0x7'));router[_0x4f25('0x8')]('/',auth['isAuthenticated'](),controller[_0x4f25('0x9')]);router[_0x4f25('0x8')](_0x4f25('0xa'),auth[_0x4f25('0xb')](),controller[_0x4f25('0xc')]);router[_0x4f25('0x8')](_0x4f25('0xd'),auth[_0x4f25('0xb')](),controller[_0x4f25('0xe')]);router[_0x4f25('0x8')](_0x4f25('0xf'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x10')]);router['get'](_0x4f25('0x11'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x12')]);router[_0x4f25('0x8')](_0x4f25('0x13'),auth['isAuthenticated'](),controller['getImap']);router[_0x4f25('0x8')](_0x4f25('0x14'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x15')]);router[_0x4f25('0x8')]('/:id/interactions',auth[_0x4f25('0xb')](),controller['getInteractions']);router[_0x4f25('0x8')](_0x4f25('0x16'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x17')]);router[_0x4f25('0x8')](_0x4f25('0x18'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x19')]);router[_0x4f25('0x8')](_0x4f25('0x1a'),auth[_0x4f25('0xb')](),controller['verifySmtp']);router[_0x4f25('0x8')](_0x4f25('0x1b'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x1c')]);router['post'](_0x4f25('0xf'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x1d')]);router[_0x4f25('0x1e')](_0x4f25('0x11'),auth['isAuthenticated'](),controller[_0x4f25('0x1f')]);router[_0x4f25('0x1e')]('/',auth[_0x4f25('0xb')](),controller['create']);router[_0x4f25('0x1e')](_0x4f25('0x13'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x20')]);router[_0x4f25('0x1e')](_0x4f25('0x14'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x21')]);router[_0x4f25('0x1e')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x4f25('0x22')]);router['post']('/:id/applications',auth[_0x4f25('0xb')](),controller[_0x4f25('0x23')]);router[_0x4f25('0x1e')]('/:id/send',auth['isAuthenticated'](),controller[_0x4f25('0x24')]);router[_0x4f25('0x1e')](_0x4f25('0x1b'),auth[_0x4f25('0xb')](),controller[_0x4f25('0x25')]);router[_0x4f25('0x26')](_0x4f25('0xd'),auth[_0x4f25('0xb')](),controller['update']);router[_0x4f25('0x27')](_0x4f25('0xf'),auth[_0x4f25('0xb')](),controller['removeDispositions']);router[_0x4f25('0x27')](_0x4f25('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x4f25('0x27')](_0x4f25('0x13'),auth['isAuthenticated'](),controller[_0x4f25('0x28')]);router[_0x4f25('0x27')](_0x4f25('0x14'),auth[_0x4f25('0xb')](),controller['removeSmtp']);router[_0x4f25('0x27')](_0x4f25('0xd'),auth[_0x4f25('0xb')](),controller['destroy']);router[_0x4f25('0x27')](_0x4f25('0x1b'),auth[_0x4f25('0xb')](),controller['removeAgents']);module[_0x4f25('0x29')]=router; \ No newline at end of file +var _0x0e9e=['getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers'];(function(_0x297873,_0x168898){var _0x33d338=function(_0x23262a){while(--_0x23262a){_0x297873['push'](_0x297873['shift']());}};_0x33d338(++_0x168898);}(_0x0e9e,0x174));var _0xe0e9=function(_0x1b8ab0,_0x383389){_0x1b8ab0=_0x1b8ab0-0x0;var _0x58ddad=_0x0e9e[_0x1b8ab0];return _0x58ddad;};'use strict';var multer=require('multer');var util=require(_0xe0e9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0e9('0x1'));var router=express[_0xe0e9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe0e9('0x3'));var interaction=require(_0xe0e9('0x4'));var config=require(_0xe0e9('0x5'));var controller=require(_0xe0e9('0x6'));router[_0xe0e9('0x7')]('/',auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x9')]);router[_0xe0e9('0x7')](_0xe0e9('0xa'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0xb')]);router[_0xe0e9('0x7')](_0xe0e9('0xc'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0xd')]);router[_0xe0e9('0x7')](_0xe0e9('0xe'),auth['isAuthenticated'](),controller[_0xe0e9('0xf')]);router[_0xe0e9('0x7')](_0xe0e9('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xe0e9('0x11'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x12')]);router[_0xe0e9('0x7')](_0xe0e9('0x13'),auth['isAuthenticated'](),controller['getSmtp']);router[_0xe0e9('0x7')]('/:id/interactions',auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x14')]);router[_0xe0e9('0x7')](_0xe0e9('0x15'),auth['isAuthenticated'](),controller[_0xe0e9('0x16')]);router[_0xe0e9('0x7')](_0xe0e9('0x17'),auth['isAuthenticated'](),controller[_0xe0e9('0x18')]);router[_0xe0e9('0x7')](_0xe0e9('0x19'),auth[_0xe0e9('0x8')](),controller['verifySmtp']);router[_0xe0e9('0x7')](_0xe0e9('0x1a'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x1b')]);router[_0xe0e9('0x1c')](_0xe0e9('0xe'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x1d')]);router['post']('/:id/canned_answers',auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x1e')]);router['post']('/',auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x1f')]);router[_0xe0e9('0x1c')](_0xe0e9('0x11'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x20')]);router[_0xe0e9('0x1c')](_0xe0e9('0x13'),auth['isAuthenticated'](),controller[_0xe0e9('0x21')]);router['post'](_0xe0e9('0x22'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x23')]);router[_0xe0e9('0x1c')](_0xe0e9('0x15'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x24')]);router[_0xe0e9('0x1c')](_0xe0e9('0x25'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x26')]);router['post'](_0xe0e9('0x1a'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x27')]);router[_0xe0e9('0x28')](_0xe0e9('0xc'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x29')]);router[_0xe0e9('0x2a')](_0xe0e9('0xe'),auth['isAuthenticated'](),controller[_0xe0e9('0x2b')]);router[_0xe0e9('0x2a')](_0xe0e9('0x10'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x2c')]);router['delete'](_0xe0e9('0x11'),auth['isAuthenticated'](),controller['removeImap']);router[_0xe0e9('0x2a')](_0xe0e9('0x13'),auth['isAuthenticated'](),controller[_0xe0e9('0x2d')]);router[_0xe0e9('0x2a')](_0xe0e9('0xc'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x2e')]);router[_0xe0e9('0x2a')](_0xe0e9('0x1a'),auth[_0xe0e9('0x8')](),controller[_0xe0e9('0x2f')]);module[_0xe0e9('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3ead684..aa93d48 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 _0x3fe9=['setDataValue','mandatoryDispositionPauseId','gmail','hotmail','yahoo','outlook365','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x599847,_0x54e953){var _0x4bab4a=function(_0x460b8f){while(--_0x460b8f){_0x599847['push'](_0x599847['shift']());}};_0x4bab4a(++_0x54e953);}(_0x3fe9,0xaa));var _0x93fe=function(_0x1f3ef0,_0x38f2e7){_0x1f3ef0=_0x1f3ef0-0x0;var _0x252111=_0x3fe9[_0x1f3ef0];return _0x252111;};'use strict';var Sequelize=require(_0x93fe('0x0'));module[_0x93fe('0x1')]={'description':{'type':Sequelize[_0x93fe('0x2')]},'name':{'type':Sequelize[_0x93fe('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x93fe('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x93fe('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x93fe('0x5')},'fontSize':{'type':Sequelize[_0x93fe('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x93fe('0x4')],'defaultValue':function(){return _0x93fe('0x7');}},'notificationSound':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x93fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x93fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x93fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x93fe('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x93fe('0x3')],'defaultValue':![],'comment':_0x93fe('0x9'),'set':function(_0x33e38c){if(!_0x33e38c)this[_0x93fe('0xa')](_0x93fe('0xb'),null);this[_0x93fe('0xa')]('mandatoryDisposition',_0x33e38c);}},'provider':{'type':Sequelize['ENUM'](_0x93fe('0xc'),_0x93fe('0xd'),_0x93fe('0xe'),_0x93fe('0xf')),'defaultValue':null,'get':function(){if(!this[_0x93fe('0x10')](_0x93fe('0x11')))return'custom';return this[_0x93fe('0x10')](_0x93fe('0x11'));},'set':function(_0x4c0702){if(_0x4c0702==='custom')_0x4c0702=null;return this[_0x93fe('0xa')](_0x93fe('0x11'),_0x4c0702);}}}; \ No newline at end of file +var _0x74d1=['outlook365','getDataValue','custom','provider','sequelize','BOOLEAN','STRING','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','yahoo'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x74d1,0xb8));var _0x174d=function(_0x66aaac,_0x5791e8){_0x66aaac=_0x66aaac-0x0;var _0x16ada0=_0x74d1[_0x66aaac];return _0x16ada0;};'use strict';var Sequelize=require(_0x174d('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x174d('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x174d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x174d('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x174d('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x174d('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x174d('0x2')],'allowNull':![],'defaultValue':_0x174d('0x3')},'fontSize':{'type':Sequelize[_0x174d('0x4')](0x2)[_0x174d('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x174d('0x6')],'defaultValue':function(){return _0x174d('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x174d('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x174d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x174d('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x174d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x174d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x174d('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x174d('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x174d('0x9'),'set':function(_0x583149){if(!_0x583149)this[_0x174d('0xa')](_0x174d('0xb'),null);this[_0x174d('0xa')](_0x174d('0xc'),_0x583149);}},'provider':{'type':Sequelize['ENUM']('gmail','hotmail',_0x174d('0xd'),_0x174d('0xe')),'defaultValue':null,'get':function(){if(!this[_0x174d('0xf')]('provider'))return _0x174d('0x10');return this[_0x174d('0xf')]('provider');},'set':function(_0xa6c288){if(_0xa6c288===_0x174d('0x10'))_0xa6c288=null;return this[_0x174d('0xa')](_0x174d('0x11'),_0xa6c288);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9fc3cd0..c3d5e88 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 _0x7509=['modernAuthentication','params','describe','MailAccountId','Disposition','create','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','provider','custom','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','send','getApplications','MailMessage','split','format','inlineCss','true','CmList','List','Contacts','DESC','%s\x20<%s>','attachments','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','ListId','messageId','from','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','CloudProvider','OAuth2','data5','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','update','destroy','get','UserProfileResource','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','includeAll','find','body','CloudProviderId'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7509,0x1c2));var _0x9750=function(_0x352d35,_0xb9100){_0x352d35=_0x352d35-0x0;var _0x3708b8=_0x7509[_0x352d35];return _0x3708b8;};'use strict';var moment=require(_0x9750('0x0'));var BPromise=require(_0x9750('0x1'));var util=require('util');var path=require(_0x9750('0x2'));var _=require(_0x9750('0x3'));var juice=require(_0x9750('0x4'));var Redis=require('ioredis');var qs=require(_0x9750('0x5'));var logger=require(_0x9750('0x6'))(_0x9750('0x7'));var config=require(_0x9750('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9750('0x9')](config[_0x9750('0xa')],{'host':_0x9750('0xb'),'port':0x18eb});var socket=require(_0x9750('0xc'))(new Redis(config['redis']));require(_0x9750('0xd'))[_0x9750('0xe')](socket);var jayson=require(_0x9750('0xf'));var client=jayson['client'][_0x9750('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x1c5680,_0x33ebff,_0x4b4cc1,_0x398528){return new BPromise(function(_0x24171f,_0x57dd28){var _0x19a73a=_0x398528||client;return _0x19a73a['request'](_0x1c5680,_0x4b4cc1)[_0x9750('0x11')](function(_0x40ca1f){logger[_0x9750('0x12')](_0x9750('0x13'),_0x33ebff,_0x9750('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x33ebff,'request\x20sent',JSON[_0x9750('0x15')](_0x40ca1f));if(_0x40ca1f[_0x9750('0x16')]){if(_0x40ca1f[_0x9750('0x16')][_0x9750('0x17')]===0x1f4){logger[_0x9750('0x16')](_0x9750('0x13'),_0x33ebff,_0x40ca1f[_0x9750('0x16')][_0x9750('0x18')]);return _0x57dd28(_0x40ca1f[_0x9750('0x16')][_0x9750('0x18')]);}logger[_0x9750('0x16')]('MailAccount,\x20%s,\x20%s',_0x33ebff,_0x40ca1f[_0x9750('0x16')][_0x9750('0x18')]);return _0x24171f(_0x40ca1f[_0x9750('0x16')][_0x9750('0x18')]);}else{logger[_0x9750('0x12')]('MailAccount,\x20%s,\x20%s',_0x33ebff,_0x9750('0x14'));_0x24171f(_0x40ca1f['result']['message']);}})[_0x9750('0x19')](function(_0x1e14ce){logger['error']('MailAccount,\x20%s,\x20%s',_0x33ebff,_0x1e14ce);_0x57dd28(_0x1e14ce);});});}function respondWithStatusCode(_0x3a32f5,_0x31c6b3){_0x31c6b3=_0x31c6b3||0xcc;return function(_0x4851de){if(_0x4851de){return _0x3a32f5[_0x9750('0x1a')](_0x31c6b3);}return _0x3a32f5[_0x9750('0x1b')](_0x31c6b3)['end']();};}function respondWithResult(_0x4e5157,_0x112e74){_0x112e74=_0x112e74||0xc8;return function(_0x14d355){if(_0x14d355){return _0x4e5157[_0x9750('0x1b')](_0x112e74)[_0x9750('0x1c')](_0x14d355);}};}function respondWithFilteredResult(_0x3dba0c,_0x5df56b){return function(_0x2b2263){if(_0x2b2263){var _0x4a79bf=typeof _0x5df56b[_0x9750('0x1d')]===_0x9750('0x1e')&&typeof _0x5df56b['limit']===_0x9750('0x1e');var _0x15b20b=_0x2b2263[_0x9750('0x1f')];var _0x22df31=_0x4a79bf?0x0:_0x5df56b[_0x9750('0x1d')];var _0x545773=_0x4a79bf?_0x2b2263[_0x9750('0x1f')]:_0x5df56b['offset']+_0x5df56b[_0x9750('0x20')];var _0x33f720;if(_0x545773>=_0x15b20b){_0x545773=_0x15b20b;_0x33f720=0xc8;}else{_0x33f720=0xce;}_0x3dba0c['status'](_0x33f720);return _0x3dba0c[_0x9750('0x21')]('Content-Range',_0x22df31+'-'+_0x545773+'/'+_0x15b20b)[_0x9750('0x1c')](_0x2b2263);}return null;};}function saveUpdates(_0x25c783){return function(_0x54e68c){if(_0x54e68c){return _0x54e68c[_0x9750('0x22')](_0x25c783)['then'](function(_0x2d42f4){return _0x2d42f4;});}return null;};}function removeEntity(_0x3d088d){return function(_0x286adc){if(_0x286adc){return _0x286adc[_0x9750('0x23')]()['then'](function(){var _0x3741b2=_0x286adc[_0x9750('0x24')]({'plain':!![]});var _0x3bc66e='MailAccounts';return db[_0x9750('0x25')]['destroy']({'where':{'type':_0x3bc66e,'resourceId':_0x3741b2['id']}})[_0x9750('0x11')](function(){return _0x286adc;});})[_0x9750('0x11')](function(){_0x3d088d[_0x9750('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1a0b){return function(_0x4fef69){if(!_0x4fef69){_0x4e1a0b['sendStatus'](0x194);}return _0x4fef69;};}function handleError(_0x2dd7e5,_0x4d0a7f){_0x4d0a7f=_0x4d0a7f||0x1f4;return function(_0x57f12b){logger['error'](_0x57f12b['stack']);if(_0x57f12b['name']){delete _0x57f12b[_0x9750('0x26')];}_0x2dd7e5[_0x9750('0x1b')](_0x4d0a7f)['send'](_0x57f12b);};}exports[_0x9750('0x27')]=function(_0xcad558,_0x1d36c0){var _0x2ab4b0={'include':[{'model':db[_0x9750('0x28')],'as':_0x9750('0x29')},{'model':db[_0x9750('0x2a')],'as':_0x9750('0x2b')},{'model':db[_0x9750('0x2c')],'as':_0x9750('0x2d')}]},_0x147515={},_0x3f8641={'count':0x0,'rows':[]};var _0x68e860=_[_0x9750('0x2e')](db[_0x9750('0x2f')][_0x9750('0x30')],function(_0x292ae1){return{'name':_0x292ae1['fieldName'],'type':_0x292ae1[_0x9750('0x31')]['key']};});_0x147515[_0x9750('0x32')]=_['map'](_0x68e860,'name');_0x147515[_0x9750('0x33')]=_[_0x9750('0x34')](_0xcad558[_0x9750('0x33')]);_0x147515[_0x9750('0x35')]=_['intersection'](_0x147515[_0x9750('0x32')],_0x147515[_0x9750('0x33')]);_0x2ab4b0[_0x9750('0x36')]=_[_0x9750('0x37')](_0x147515[_0x9750('0x32')],qs[_0x9750('0x38')](_0xcad558[_0x9750('0x33')][_0x9750('0x38')]));_0x2ab4b0[_0x9750('0x36')]=_0x2ab4b0['attributes'][_0x9750('0x39')]?_0x2ab4b0['attributes']:_0x147515['model'];if(!_0xcad558['query']['hasOwnProperty'](_0x9750('0x3a'))){_0x2ab4b0[_0x9750('0x20')]=qs[_0x9750('0x20')](_0xcad558['query']['limit']);_0x2ab4b0[_0x9750('0x1d')]=qs[_0x9750('0x1d')](_0xcad558[_0x9750('0x33')][_0x9750('0x1d')]);}_0x2ab4b0[_0x9750('0x3b')]=qs['sort'](_0xcad558['query'][_0x9750('0x3c')]);_0x2ab4b0[_0x9750('0x3d')]=qs[_0x9750('0x35')](_[_0x9750('0x3e')](_0xcad558[_0x9750('0x33')],_0x147515[_0x9750('0x35')]),_0x68e860);if(_0xcad558[_0x9750('0x33')]['filter']){_0x2ab4b0[_0x9750('0x3d')]=_[_0x9750('0x3f')](_0x2ab4b0[_0x9750('0x3d')],{'$or':_['map'](_0x68e860,function(_0x3ddf3e){if(_0x3ddf3e['type']!==_0x9750('0x40')){var _0x49f028={};_0x49f028[_0x3ddf3e[_0x9750('0x26')]]={'$like':'%'+_0xcad558[_0x9750('0x33')][_0x9750('0x41')]+'%'};return _0x49f028;}})});}_0x2ab4b0=_[_0x9750('0x3f')]({},_0x2ab4b0,_0xcad558[_0x9750('0x42')]);var _0x4ee98e={'where':_0x2ab4b0[_0x9750('0x3d')]};return db['MailAccount'][_0x9750('0x1f')](_0x4ee98e)[_0x9750('0x11')](function(_0x14e8ad){_0x3f8641[_0x9750('0x1f')]=_0x14e8ad;if(_0xcad558['query']['includeAll']){_0x2ab4b0[_0x9750('0x43')]=[{'all':!![]}];}return db['MailAccount'][_0x9750('0x44')](_0x2ab4b0);})[_0x9750('0x11')](function(_0x130acc){_0x3f8641[_0x9750('0x45')]=_0x130acc;return _0x3f8641;})[_0x9750('0x11')](respondWithFilteredResult(_0x1d36c0,_0x2ab4b0))['catch'](handleError(_0x1d36c0,null));};exports[_0x9750('0x46')]=function(_0x1fca8e,_0x4491cb){var _0x3069e3={'raw':![],'where':{'id':_0x1fca8e['params']['id']},'include':[{'model':db[_0x9750('0x28')],'as':_0x9750('0x29')},{'model':db['MailServerOut'],'as':_0x9750('0x2b')},{'model':db[_0x9750('0x2c')],'as':_0x9750('0x2d')}]},_0x1b63b7={};_0x1b63b7['model']=_[_0x9750('0x34')](db[_0x9750('0x2f')]['rawAttributes']);_0x1b63b7[_0x9750('0x33')]=_[_0x9750('0x34')](_0x1fca8e[_0x9750('0x33')]);_0x1b63b7[_0x9750('0x35')]=_[_0x9750('0x37')](_0x1b63b7[_0x9750('0x32')],_0x1b63b7['query']);_0x3069e3['attributes']=_['intersection'](_0x1b63b7[_0x9750('0x32')],qs[_0x9750('0x38')](_0x1fca8e[_0x9750('0x33')]['fields']));_0x3069e3[_0x9750('0x36')]=_0x3069e3[_0x9750('0x36')][_0x9750('0x39')]?_0x3069e3[_0x9750('0x36')]:_0x1b63b7[_0x9750('0x32')];if(_0x1fca8e[_0x9750('0x33')][_0x9750('0x47')]){_0x3069e3[_0x9750('0x43')]=[{'all':!![]}];}_0x3069e3=_['merge']({},_0x3069e3,_0x1fca8e[_0x9750('0x42')]);return db[_0x9750('0x2f')][_0x9750('0x48')](_0x3069e3)['then'](handleEntityNotFound(_0x4491cb,null))[_0x9750('0x11')](respondWithResult(_0x4491cb,null))['catch'](handleError(_0x4491cb,null));};exports[_0x9750('0x22')]=function(_0x5843e4,_0x3f76c6){if(_0x5843e4[_0x9750('0x49')]['id']){delete _0x5843e4[_0x9750('0x49')]['id'];}if(_0x5843e4[_0x9750('0x49')][_0x9750('0x29')]){if(!_0x5843e4[_0x9750('0x49')][_0x9750('0x29')]['modernAuthentication']){_0x5843e4['body'][_0x9750('0x29')][_0x9750('0x4a')]=null;}}if(_0x5843e4[_0x9750('0x49')][_0x9750('0x2b')]){if(!_0x5843e4[_0x9750('0x49')]['Smtp'][_0x9750('0x4b')]){_0x5843e4[_0x9750('0x49')]['Smtp'][_0x9750('0x4a')]=null;}}return db[_0x9750('0x2f')]['find']({'where':{'id':_0x5843e4[_0x9750('0x4c')]['id']},'include':[{'model':db[_0x9750('0x28')],'as':_0x9750('0x29')},{'model':db[_0x9750('0x2a')],'as':_0x9750('0x2b')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x9750('0x11')](handleEntityNotFound(_0x3f76c6,null))[_0x9750('0x11')](saveUpdates(_0x5843e4[_0x9750('0x49')],null))[_0x9750('0x11')](function(_0x4f00c2){if(_0x4f00c2&&_0x5843e4[_0x9750('0x49')][_0x9750('0x29')]){return db[_0x9750('0x28')][_0x9750('0x22')](_0x5843e4['body'][_0x9750('0x29')],{'where':{'MailAccountId':_0x4f00c2['id']}})[_0x9750('0x11')](function(){return _0x4f00c2;});}return _0x4f00c2;})[_0x9750('0x11')](function(_0x11f7ef){if(_0x11f7ef&&_0x5843e4[_0x9750('0x49')][_0x9750('0x2b')]){return db[_0x9750('0x2a')][_0x9750('0x22')](_0x5843e4[_0x9750('0x49')][_0x9750('0x2b')],{'where':{'MailAccountId':_0x11f7ef['id']}})[_0x9750('0x11')](function(){return _0x11f7ef;});}return _0x11f7ef;})[_0x9750('0x11')](respondWithResult(_0x3f76c6,null))['catch'](handleError(_0x3f76c6,null));};exports['describe']=function(_0x14aacc,_0x4fcbed){return db['MailAccount'][_0x9750('0x4d')]()[_0x9750('0x11')](respondWithResult(_0x4fcbed,null))[_0x9750('0x19')](handleError(_0x4fcbed,null));};exports['addDisposition']=function(_0x4068f9,_0x52da4a){if(_0x4068f9[_0x9750('0x49')]['id']){delete _0x4068f9['body']['id'];}return db[_0x9750('0x2f')][_0x9750('0x48')]({'where':{'id':_0x4068f9['params']['id']}})['then'](handleEntityNotFound(_0x52da4a,null))['then'](function(_0x52d291){if(_0x52d291){_0x4068f9[_0x9750('0x49')][_0x9750('0x4e')]=_0x52d291['id'];return db[_0x9750('0x4f')][_0x9750('0x50')](_0x4068f9[_0x9750('0x49')]);}})[_0x9750('0x11')](respondWithResult(_0x52da4a,null))['catch'](handleError(_0x52da4a,null));};exports[_0x9750('0x51')]=function(_0x51e477,_0x278f4f){var _0x3c33fd={'raw':![],'where':{}};var _0x13a997={};var _0x12bbb1={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x51e477[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x278f4f,null))[_0x9750('0x11')](function(_0x447128){if(_0x447128){_0x13a997[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0x4f')][_0x9750('0x30')]);_0x13a997[_0x9750('0x33')]=_[_0x9750('0x34')](_0x51e477[_0x9750('0x33')]);_0x13a997[_0x9750('0x35')]=_[_0x9750('0x37')](_0x13a997[_0x9750('0x32')],_0x13a997['query']);_0x3c33fd[_0x9750('0x36')]=_[_0x9750('0x37')](_0x13a997[_0x9750('0x32')],qs[_0x9750('0x38')](_0x51e477[_0x9750('0x33')][_0x9750('0x38')]));_0x3c33fd[_0x9750('0x36')]=_0x3c33fd[_0x9750('0x36')][_0x9750('0x39')]?_0x3c33fd[_0x9750('0x36')]:_0x13a997['model'];if(!_0x51e477[_0x9750('0x33')]['hasOwnProperty'](_0x9750('0x3a'))){_0x3c33fd[_0x9750('0x20')]=qs[_0x9750('0x20')](_0x51e477['query'][_0x9750('0x20')]);_0x3c33fd[_0x9750('0x1d')]=qs[_0x9750('0x1d')](_0x51e477[_0x9750('0x33')][_0x9750('0x1d')]);}_0x3c33fd['order']=qs[_0x9750('0x3c')](_0x51e477['query'][_0x9750('0x3c')]);_0x3c33fd[_0x9750('0x3d')]=qs[_0x9750('0x35')](_[_0x9750('0x3e')](_0x51e477[_0x9750('0x33')],_0x13a997[_0x9750('0x35')]));_0x3c33fd[_0x9750('0x3d')]['MailAccountId']=_0x447128['id'];if(_0x51e477['query'][_0x9750('0x41')]){_0x3c33fd[_0x9750('0x3d')]=_[_0x9750('0x3f')](_0x3c33fd[_0x9750('0x3d')],{'$or':_[_0x9750('0x2e')](_0x3c33fd['attributes'],function(_0xfc12b7){var _0x2d5ad2={};_0x2d5ad2[_0xfc12b7]={'$like':'%'+_0x51e477[_0x9750('0x33')][_0x9750('0x41')]+'%'};return _0x2d5ad2;})});}_0x3c33fd=_[_0x9750('0x3f')]({},_0x3c33fd,_0x51e477[_0x9750('0x42')]);return db['Disposition']['count']({'where':_0x3c33fd[_0x9750('0x3d')]})[_0x9750('0x11')](function(_0x1b24af){_0x12bbb1[_0x9750('0x1f')]=_0x1b24af;if(_0x51e477[_0x9750('0x33')][_0x9750('0x47')]){_0x3c33fd[_0x9750('0x43')]=[{'all':!![]}];}return db[_0x9750('0x4f')][_0x9750('0x44')](_0x3c33fd);})[_0x9750('0x11')](function(_0x462a4a){_0x12bbb1[_0x9750('0x45')]=_0x462a4a;return _0x12bbb1;});}})['then'](respondWithFilteredResult(_0x278f4f,_0x3c33fd))[_0x9750('0x19')](handleError(_0x278f4f,null));};exports[_0x9750('0x52')]=function(_0x2b78c2,_0x378327){return db[_0x9750('0x2f')][_0x9750('0x48')]({'where':{'id':_0x2b78c2[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x378327,null))['then'](function(_0x1337e7){if(_0x1337e7){return _0x1337e7[_0x9750('0x52')](_0x2b78c2[_0x9750('0x33')][_0x9750('0x53')]);}})[_0x9750('0x11')](respondWithStatusCode(_0x378327,null))['catch'](handleError(_0x378327,null));};exports[_0x9750('0x54')]=function(_0x459433,_0x2b6110){if(_0x459433[_0x9750('0x49')]['id']){delete _0x459433[_0x9750('0x49')]['id'];}return db[_0x9750('0x2f')][_0x9750('0x48')]({'where':{'id':_0x459433[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x2b6110,null))['then'](function(_0x3ce430){if(_0x3ce430){_0x459433['body']['MailAccountId']=_0x3ce430['id'];return db[_0x9750('0x55')][_0x9750('0x50')](_0x459433[_0x9750('0x49')]);}})[_0x9750('0x11')](respondWithResult(_0x2b6110,null))['catch'](handleError(_0x2b6110,null));};exports[_0x9750('0x56')]=function(_0x4bdb7a,_0x5532ee){var _0x2ef96e={'raw':![],'where':{}};var _0x4f015f={};var _0x42c450={'count':0x0,'rows':[]};return db[_0x9750('0x2f')][_0x9750('0x57')]({'where':{'id':_0x4bdb7a[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x5532ee,null))[_0x9750('0x11')](function(_0x46305e){if(_0x46305e){_0x4f015f[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0x55')][_0x9750('0x30')]);_0x4f015f[_0x9750('0x33')]=_[_0x9750('0x34')](_0x4bdb7a[_0x9750('0x33')]);_0x4f015f['filters']=_[_0x9750('0x37')](_0x4f015f[_0x9750('0x32')],_0x4f015f[_0x9750('0x33')]);_0x2ef96e['attributes']=_[_0x9750('0x37')](_0x4f015f[_0x9750('0x32')],qs[_0x9750('0x38')](_0x4bdb7a[_0x9750('0x33')]['fields']));_0x2ef96e[_0x9750('0x36')]=_0x2ef96e[_0x9750('0x36')][_0x9750('0x39')]?_0x2ef96e['attributes']:_0x4f015f[_0x9750('0x32')];if(!_0x4bdb7a[_0x9750('0x33')][_0x9750('0x58')](_0x9750('0x3a'))){_0x2ef96e[_0x9750('0x20')]=qs[_0x9750('0x20')](_0x4bdb7a[_0x9750('0x33')][_0x9750('0x20')]);_0x2ef96e[_0x9750('0x1d')]=qs[_0x9750('0x1d')](_0x4bdb7a['query'][_0x9750('0x1d')]);}_0x2ef96e[_0x9750('0x3b')]=qs['sort'](_0x4bdb7a['query']['sort']);_0x2ef96e[_0x9750('0x3d')]=qs[_0x9750('0x35')](_['pick'](_0x4bdb7a['query'],_0x4f015f[_0x9750('0x35')]));_0x2ef96e[_0x9750('0x3d')][_0x9750('0x4e')]=_0x46305e['id'];if(_0x4bdb7a['query'][_0x9750('0x41')]){_0x2ef96e[_0x9750('0x3d')]=_['merge'](_0x2ef96e[_0x9750('0x3d')],{'$or':_[_0x9750('0x2e')](_0x2ef96e['attributes'],function(_0x37b7c4){var _0x5a26d1={};_0x5a26d1[_0x37b7c4]={'$like':'%'+_0x4bdb7a['query'][_0x9750('0x41')]+'%'};return _0x5a26d1;})});}_0x2ef96e=_[_0x9750('0x3f')]({},_0x2ef96e,_0x4bdb7a['options']);return db[_0x9750('0x55')][_0x9750('0x1f')]({'where':_0x2ef96e[_0x9750('0x3d')]})['then'](function(_0x3aa232){_0x42c450[_0x9750('0x1f')]=_0x3aa232;if(_0x4bdb7a[_0x9750('0x33')]['includeAll']){_0x2ef96e['include']=[{'all':!![]}];}return db[_0x9750('0x55')][_0x9750('0x44')](_0x2ef96e);})['then'](function(_0x18bb71){_0x42c450[_0x9750('0x45')]=_0x18bb71;return _0x42c450;});}})[_0x9750('0x11')](respondWithFilteredResult(_0x5532ee,_0x2ef96e))[_0x9750('0x19')](handleError(_0x5532ee,null));};exports[_0x9750('0x59')]=function(_0xcdb107,_0x53e213){return db['MailAccount'][_0x9750('0x48')]({'where':{'id':_0xcdb107[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x53e213,null))[_0x9750('0x11')](function(_0x4d46b1){if(_0x4d46b1){return _0x4d46b1[_0x9750('0x59')](_0xcdb107[_0x9750('0x33')]['ids']);}})[_0x9750('0x11')](respondWithStatusCode(_0x53e213,null))['catch'](handleError(_0x53e213,null));};exports[_0x9750('0x50')]=function(_0x114653,_0x108bec){var _0x711536={'name':_0x114653[_0x9750('0x49')][_0x9750('0x26')],'key':_0x114653[_0x9750('0x49')]['key'],'provider':_0x114653[_0x9750('0x49')][_0x9750('0x5a')]===_0x9750('0x5b')?null:_0x114653[_0x9750('0x49')][_0x9750('0x5a')],'email':_0x114653[_0x9750('0x49')][_0x9750('0x5c')],'ListId':_0x114653[_0x9750('0x49')]['ListId'],'active':!_[_0x9750('0x5d')](_0x114653[_0x9750('0x49')][_0x9750('0x5e')])?_0x114653[_0x9750('0x49')]['active']:!![],'description':_0x114653['body'][_0x9750('0x5f')]||null,'Imap':{},'Smtp':{}};if(_0x711536['provider']){_0x711536[_0x9750('0x29')][_0x9750('0x60')]=_0x711536[_0x9750('0x2b')][_0x9750('0x60')]=_0x114653[_0x9750('0x49')][_0x9750('0x61')];_0x711536[_0x9750('0x29')][_0x9750('0x62')]=_0x711536[_0x9750('0x2b')][_0x9750('0x63')]=_0x114653[_0x9750('0x49')][_0x9750('0x62')];if(_0x114653[_0x9750('0x49')]['modernAuthentication']){_0x711536[_0x9750('0x29')][_0x9750('0x4b')]=_0x711536[_0x9750('0x2b')][_0x9750('0x4b')]=!![];_0x711536['Imap'][_0x9750('0x4a')]=_0x711536[_0x9750('0x2b')][_0x9750('0x4a')]=_0x114653[_0x9750('0x49')][_0x9750('0x4a')];_0x711536['Imap'][_0x9750('0x62')]=_0x711536[_0x9750('0x2b')][_0x9750('0x63')]=null;}else{_0x711536[_0x9750('0x29')][_0x9750('0x4a')]=_0x711536['Smtp'][_0x9750('0x4a')]=null;}_0x711536[_0x9750('0x29')][_0x9750('0x64')]=_0x711536['Smtp']['service']=null;_0x711536[_0x9750('0x29')][_0x9750('0x65')]=_0x711536[_0x9750('0x2b')][_0x9750('0x65')]=null;_0x711536[_0x9750('0x29')][_0x9750('0x66')]=_0x711536['Smtp'][_0x9750('0x66')]=null;}else{if(_0x114653[_0x9750('0x49')]['authentication']){_0x711536['Imap']['user']=_0x711536[_0x9750('0x2b')]['user']=_0x114653[_0x9750('0x49')]['username'];_0x711536['Imap'][_0x9750('0x62')]=_0x711536[_0x9750('0x2b')][_0x9750('0x63')]=_0x114653[_0x9750('0x49')]['password'];}else{_0x711536[_0x9750('0x29')][_0x9750('0x67')]=_0x711536[_0x9750('0x2b')][_0x9750('0x67')]=![];_0x711536['Imap'][_0x9750('0x60')]=_0x711536[_0x9750('0x2b')]['user']=null;_0x711536[_0x9750('0x29')][_0x9750('0x62')]=_0x711536[_0x9750('0x2b')][_0x9750('0x63')]=null;}_0x711536[_0x9750('0x29')][_0x9750('0x65')]=_0x114653[_0x9750('0x49')][_0x9750('0x29')][_0x9750('0x65')];_0x711536[_0x9750('0x29')]['port']=_0x114653[_0x9750('0x49')][_0x9750('0x29')][_0x9750('0x66')];_0x711536[_0x9750('0x2b')]['host']=_0x114653[_0x9750('0x49')][_0x9750('0x2b')][_0x9750('0x65')];_0x711536['Smtp'][_0x9750('0x66')]=_0x114653['body'][_0x9750('0x2b')][_0x9750('0x66')];}return db[_0x9750('0x2f')][_0x9750('0x50')](_0x711536,{'include':[{'model':db[_0x9750('0x2a')],'as':_0x9750('0x2b')},{'model':db[_0x9750('0x28')],'as':_0x9750('0x29')}]})[_0x9750('0x11')](function(_0x12f275){var _0xa95c5d=_0x114653['user'][_0x9750('0x24')]({'plain':!![]});if(!_0xa95c5d)throw new Error(_0x9750('0x68'));if(_0xa95c5d[_0x9750('0x69')]===_0x9750('0x60')){var _0x2dd0f9=_0x12f275[_0x9750('0x24')]({'plain':!![]});return db[_0x9750('0x6a')]['find']({'where':{'name':'MailAccounts','userProfileId':_0xa95c5d[_0x9750('0x6b')]},'raw':!![]})[_0x9750('0x11')](function(_0x5d6778){if(_0x5d6778&&_0x5d6778[_0x9750('0x6c')]===0x0){return db[_0x9750('0x25')][_0x9750('0x50')]({'name':_0x2dd0f9['name'],'resourceId':_0x2dd0f9['id'],'type':_0x5d6778[_0x9750('0x26')],'sectionId':_0x5d6778['id']},{})[_0x9750('0x11')](function(){return _0x12f275;});}else{return _0x12f275;}})[_0x9750('0x19')](function(_0x52a302){logger[_0x9750('0x16')](_0x9750('0x6d'),_0x52a302);throw _0x52a302;});}return _0x12f275;})[_0x9750('0x11')](respondWithResult(_0x108bec,0xc9))['catch'](handleError(_0x108bec,null));};exports['getImap']=function(_0x3f2e82,_0x1f3630){return db[_0x9750('0x2f')][_0x9750('0x57')]({'where':{'id':_0x3f2e82[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x1f3630,null))[_0x9750('0x11')](function(_0x53559c){if(_0x53559c){return _0x53559c[_0x9750('0x6e')]();}return null;})['then'](respondWithResult(_0x1f3630,null))[_0x9750('0x19')](handleError(_0x1f3630,null));};exports['addImap']=function(_0x24dfd5,_0xba5457){if(_0x24dfd5[_0x9750('0x49')]['id']){delete _0x24dfd5[_0x9750('0x49')]['id'];}return db[_0x9750('0x2f')]['find']({'where':{'id':_0x24dfd5[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0xba5457,null))[_0x9750('0x11')](function(_0x276717){if(_0x276717){_0x24dfd5[_0x9750('0x49')][_0x9750('0x4e')]=_0x276717['id'];return db[_0x9750('0x28')][_0x9750('0x50')](_0x24dfd5[_0x9750('0x49')]);}})[_0x9750('0x11')](respondWithResult(_0xba5457,null))[_0x9750('0x19')](handleError(_0xba5457,null));};exports[_0x9750('0x6f')]=function(_0x1e344e,_0x5a21bb){return db[_0x9750('0x2f')][_0x9750('0x57')]({'where':{'id':_0x1e344e[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x5a21bb,null))[_0x9750('0x11')](function(_0x2eee9e){if(_0x2eee9e){return _0x2eee9e[_0x9750('0x70')](null);}return null;})[_0x9750('0x11')](respondWithStatusCode(_0x5a21bb,null))[_0x9750('0x19')](handleError(_0x5a21bb,null));};exports[_0x9750('0x71')]=function(_0x26a62f,_0xf385b5){return db['MailAccount']['findOne']({'where':{'id':_0x26a62f[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0xf385b5,null))[_0x9750('0x11')](function(_0x581179){if(_0x581179){return _0x581179[_0x9750('0x71')]();}return null;})['then'](respondWithResult(_0xf385b5,null))[_0x9750('0x19')](handleError(_0xf385b5,null));};exports['addSmtp']=function(_0x141924,_0x31aa15){if(_0x141924['body']['id']){delete _0x141924[_0x9750('0x49')]['id'];}return db['MailAccount'][_0x9750('0x48')]({'where':{'id':_0x141924[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x31aa15,null))[_0x9750('0x11')](function(_0x3b8d69){if(_0x3b8d69){_0x141924[_0x9750('0x49')]['MailAccountId']=_0x3b8d69['id'];return db[_0x9750('0x2a')]['create'](_0x141924['body']);}})['then'](respondWithResult(_0x31aa15,null))[_0x9750('0x19')](handleError(_0x31aa15,null));};exports[_0x9750('0x72')]=function(_0x2cbffb,_0x48986e){return db[_0x9750('0x2f')]['findOne']({'where':{'id':_0x2cbffb[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x48986e,null))['then'](function(_0x250cf2){if(_0x250cf2){return _0x250cf2['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x48986e,null))[_0x9750('0x19')](handleError(_0x48986e,null));};exports[_0x9750('0x73')]=function(_0x4fb717,_0x4bd9a5){return db[_0x9750('0x74')]['find']({'where':{'id':_0x4fb717[_0x9750('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4bd9a5,null))[_0x9750('0x11')](function(_0xb8f2dc){if(_0xb8f2dc){return _0xb8f2dc[_0x9750('0x73')](_0x4fb717[_0x9750('0x49')][_0x9750('0x53')],_['omit'](_0x4fb717[_0x9750('0x49')],['ids','id'])||{});}})[_0x9750('0x11')](respondWithResult(_0x4bd9a5,null))[_0x9750('0x19')](handleError(_0x4bd9a5,null));};exports[_0x9750('0x75')]=function(_0x4d1d89,_0x22ea2c){var _0x20a50c={'raw':![],'where':{}};var _0x56bed8={};var _0x3d548c={'count':0x0,'rows':[]};return db['MailAccount'][_0x9750('0x57')]({'where':{'id':_0x4d1d89[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x22ea2c,null))[_0x9750('0x11')](function(_0x264f65){if(_0x264f65){_0x56bed8[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0x74')][_0x9750('0x30')]);_0x56bed8[_0x9750('0x33')]=_[_0x9750('0x34')](_0x4d1d89['query']);_0x56bed8[_0x9750('0x35')]=_['intersection'](_0x56bed8[_0x9750('0x32')],_0x56bed8[_0x9750('0x33')]);_0x20a50c['attributes']=_[_0x9750('0x37')](_0x56bed8[_0x9750('0x32')],qs[_0x9750('0x38')](_0x4d1d89[_0x9750('0x33')][_0x9750('0x38')]));_0x20a50c[_0x9750('0x36')]=_0x20a50c[_0x9750('0x36')][_0x9750('0x39')]?_0x20a50c[_0x9750('0x36')]:_0x56bed8[_0x9750('0x32')];if(!_0x4d1d89['query'][_0x9750('0x58')](_0x9750('0x3a'))){_0x20a50c['limit']=qs['limit'](_0x4d1d89['query'][_0x9750('0x20')]);_0x20a50c['offset']=qs[_0x9750('0x1d')](_0x4d1d89['query'][_0x9750('0x1d')]);}_0x20a50c[_0x9750('0x3b')]=qs['sort'](_0x4d1d89['query'][_0x9750('0x3c')]);_0x20a50c['where']=qs[_0x9750('0x35')](_[_0x9750('0x3e')](_0x4d1d89[_0x9750('0x33')],_0x56bed8[_0x9750('0x35')]));_0x20a50c[_0x9750('0x3d')][_0x9750('0x4e')]=_0x264f65['id'];if(_0x4d1d89['query']['filter']){_0x20a50c[_0x9750('0x3d')]=_['merge'](_0x20a50c['where'],{'$or':_[_0x9750('0x2e')](_0x20a50c[_0x9750('0x36')],function(_0x39d7d9){var _0x377f65={};_0x377f65[_0x39d7d9]={'$like':'%'+_0x4d1d89[_0x9750('0x33')]['filter']+'%'};return _0x377f65;})});}_0x20a50c=_[_0x9750('0x3f')]({},_0x20a50c,_0x4d1d89['options']);return db[_0x9750('0x74')]['count']({'where':_0x20a50c[_0x9750('0x3d')]})[_0x9750('0x11')](function(_0x4273e3){_0x3d548c[_0x9750('0x1f')]=_0x4273e3;if(_0x4d1d89['query']['includeAll']){_0x20a50c['include']=[{'model':db[_0x9750('0x76')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x9750('0x77'),'attributes':[_0x9750('0x26'),_0x9750('0x78'),'internal'],'required':![]},{'model':db[_0x9750('0x79')],'as':_0x9750('0x7a'),'attributes':['id',_0x9750('0x26'),_0x9750('0x7b')],'where':_0x4d1d89[_0x9750('0x33')][_0x9750('0x7c')]?{'id':_0x4d1d89[_0x9750('0x33')]['tag']}:undefined,'required':_0x4d1d89['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x9750('0x44')](_0x20a50c);})[_0x9750('0x11')](function(_0x4d8c9e){_0x3d548c[_0x9750('0x45')]=_0x4d8c9e;return _0x3d548c;});}})[_0x9750('0x11')](respondWithFilteredResult(_0x22ea2c,_0x20a50c))[_0x9750('0x19')](handleError(_0x22ea2c,null));};exports['addApplications']=function addApplications(_0x497b58,_0x2712e3){var _0xc7fa6f=_0x497b58[_0x9750('0x4c')]['id'];var _0x1f8676=_0x497b58['body'];var _0x151f17=0xc8;var _0x43e6e5=null;return db[_0x9750('0x7d')][_0x9750('0x7e')]({'isolationLevel':db[_0x9750('0x7d')][_0x9750('0x7f')][_0x9750('0x80')][_0x9750('0x81')]},function(_0x4d5069){return db[_0x9750('0x2f')]['findOne']({'where':{'id':_0xc7fa6f},'transaction':_0x4d5069})[_0x9750('0x11')](function(_0x348810){if(_0x348810){return db['MailApplication'][_0x9750('0x23')]({'where':{'MailAccountId':_0xc7fa6f},'transaction':_0x4d5069})['then'](function(){var _0x50d2eb=_[_0x9750('0x2e')](_0x1f8676,function(_0x6160d8){_0x6160d8[_0x9750('0x4e')]=_0xc7fa6f;return _0x6160d8;});return db[_0x9750('0x82')][_0x9750('0x83')](_0x50d2eb,{'transaction':_0x4d5069});});}else{_0x151f17=0x194;_0x43e6e5=[];}});})['then'](function(){if(_0x151f17!==0x194){return db[_0x9750('0x82')]['findAndCountAll']({'where':{'MailAccountId':_0xc7fa6f},'order':_0x9750('0x84')})[_0x9750('0x11')](function(_0x2196cc){_0x43e6e5=_0x2196cc;});}})[_0x9750('0x19')](function(_0x52607e){_0x151f17=0x1f4;logger[_0x9750('0x16')](_0x52607e[_0x9750('0x85')]);if(_0x52607e['name']){delete _0x52607e['name'];}_0x43e6e5=_0x52607e;})['finally'](function(){if(_0x43e6e5===null){_0x2712e3[_0x9750('0x1a')](_0x151f17);}else{if(_0x151f17===0x1f4){_0x2712e3[_0x9750('0x1b')](_0x151f17)[_0x9750('0x86')](_0x43e6e5);}else{_0x2712e3[_0x9750('0x1b')](_0x151f17)[_0x9750('0x1c')](_0x43e6e5);}}});};exports['getApplications']=function(_0x10f7b1,_0x563d37){var _0x429ac5={};var _0x4dca87={};var _0x51e69b;var _0x49d40d;return db[_0x9750('0x2f')][_0x9750('0x57')]({'where':{'id':_0x10f7b1[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x563d37,null))[_0x9750('0x11')](function(_0x1fa23b){if(_0x1fa23b){_0x51e69b=_0x1fa23b;_0x4dca87[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0x82')][_0x9750('0x30')]);_0x4dca87[_0x9750('0x33')]=_['keys'](_0x10f7b1[_0x9750('0x33')]);_0x4dca87[_0x9750('0x35')]=_['intersection'](_0x4dca87[_0x9750('0x32')],_0x4dca87['query']);_0x429ac5[_0x9750('0x36')]=_[_0x9750('0x37')](_0x4dca87['model'],qs['fields'](_0x10f7b1[_0x9750('0x33')][_0x9750('0x38')]));_0x429ac5['attributes']=_0x429ac5[_0x9750('0x36')][_0x9750('0x39')]?_0x429ac5[_0x9750('0x36')]:_0x4dca87[_0x9750('0x32')];_0x429ac5['order']=qs['sort'](_0x10f7b1[_0x9750('0x33')][_0x9750('0x3c')]);_0x429ac5[_0x9750('0x3d')]=qs[_0x9750('0x35')](_[_0x9750('0x3e')](_0x10f7b1[_0x9750('0x33')],_0x4dca87[_0x9750('0x35')]));if(_0x10f7b1['query'][_0x9750('0x41')]){_0x429ac5['where']=_[_0x9750('0x3f')](_0x429ac5[_0x9750('0x3d')],{'$or':_['map'](_0x429ac5['attributes'],function(_0x23a4af){var _0x30958d={};_0x30958d[_0x23a4af]={'$like':'%'+_0x10f7b1[_0x9750('0x33')][_0x9750('0x41')]+'%'};return _0x30958d;})});}_0x429ac5=_[_0x9750('0x3f')]({},_0x429ac5,_0x10f7b1['options']);return _0x51e69b['getApplications'](_0x429ac5);}})['then'](function(_0x5d9e36){if(_0x5d9e36){_0x49d40d=_0x5d9e36[_0x9750('0x39')];if(!_0x10f7b1[_0x9750('0x33')]['hasOwnProperty']('nolimit')){_0x429ac5[_0x9750('0x20')]=qs[_0x9750('0x20')](_0x10f7b1[_0x9750('0x33')]['limit']);_0x429ac5[_0x9750('0x1d')]=qs[_0x9750('0x1d')](_0x10f7b1[_0x9750('0x33')][_0x9750('0x1d')]);}return _0x51e69b[_0x9750('0x87')](_0x429ac5);}})[_0x9750('0x11')](function(_0x50c288){if(_0x50c288){return _0x50c288?{'count':_0x49d40d,'rows':_0x50c288}:null;}})[_0x9750('0x11')](respondWithResult(_0x563d37,null))[_0x9750('0x19')](handleError(_0x563d37,null));};exports['getMessages']=function(_0x2df264,_0x487672){var _0xcf22a={'raw':!![],'where':{}};var _0xa9d932={};var _0x494757={'count':0x0,'rows':[]};return db[_0x9750('0x2f')]['findOne']({'where':{'id':_0x2df264[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x487672,null))[_0x9750('0x11')](function(_0x1c3fce){if(_0x1c3fce){_0xa9d932[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0x88')][_0x9750('0x30')]);_0xa9d932[_0x9750('0x33')]=_[_0x9750('0x34')](_0x2df264[_0x9750('0x33')]);_0xa9d932[_0x9750('0x35')]=_['intersection'](_0xa9d932[_0x9750('0x32')],_0xa9d932[_0x9750('0x33')]);_0xcf22a[_0x9750('0x36')]=_['intersection'](_0xa9d932[_0x9750('0x32')],qs[_0x9750('0x38')](_0x2df264[_0x9750('0x33')][_0x9750('0x38')]));_0xcf22a['attributes']=_0xcf22a[_0x9750('0x36')][_0x9750('0x39')]?_0xcf22a[_0x9750('0x36')]:_0xa9d932[_0x9750('0x32')];if(!_0x2df264[_0x9750('0x33')][_0x9750('0x58')](_0x9750('0x3a'))){_0xcf22a[_0x9750('0x20')]=qs[_0x9750('0x20')](_0x2df264['query'][_0x9750('0x20')]);_0xcf22a[_0x9750('0x1d')]=qs[_0x9750('0x1d')](_0x2df264[_0x9750('0x33')]['offset']);}_0xcf22a[_0x9750('0x3b')]=qs['sort'](_0x2df264[_0x9750('0x33')][_0x9750('0x3c')]);_0xcf22a[_0x9750('0x3d')]=qs['filters'](_['pick'](_0x2df264[_0x9750('0x33')],_0xa9d932[_0x9750('0x35')]));_0xcf22a[_0x9750('0x3d')][_0x9750('0x4e')]=_0x1c3fce['id'];if(_0x2df264[_0x9750('0x33')][_0x9750('0x41')]){_0xcf22a[_0x9750('0x3d')]=_[_0x9750('0x3f')](_0xcf22a['where'],{'$or':_['map'](_0xcf22a['attributes'],function(_0xb667c3){var _0x4785f0={};_0x4785f0[_0xb667c3]={'$like':'%'+_0x2df264[_0x9750('0x33')][_0x9750('0x41')]+'%'};return _0x4785f0;})});}if(_0x2df264[_0x9750('0x33')]['$gte']){var _0x2302a8=_0x2df264[_0x9750('0x33')]['$gte'][_0x9750('0x89')](',');var _0x3130eb={};_0x3130eb[_0x2302a8[0x0]]={'$gte':moment(_0x2302a8[0x1])[_0x9750('0x8a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xcf22a[_0x9750('0x3d')]=_[_0x9750('0x3f')](_0xcf22a[_0x9750('0x3d')],_0x3130eb);}_0xcf22a=_[_0x9750('0x3f')]({},_0xcf22a,_0x2df264[_0x9750('0x42')]);return db[_0x9750('0x88')][_0x9750('0x1f')]({'where':_0xcf22a['where']})[_0x9750('0x11')](function(_0x49691f){_0x494757['count']=_0x49691f;if(_0x2df264['query'][_0x9750('0x47')]){_0xcf22a['include']=[{'all':!![]}];}return db[_0x9750('0x88')]['findAll'](_0xcf22a);})[_0x9750('0x11')](function(_0x58c3ff){if(_0x2df264[_0x9750('0x33')][_0x9750('0x8b')]===_0x9750('0x8c')){for(var _0x154a0a=0x0;_0x154a0a<_0x58c3ff['length'];_0x154a0a++){_0x58c3ff[_0x154a0a][_0x9750('0x49')]=juice(_0x58c3ff[_0x154a0a][_0x9750('0x49')]);}}_0x494757[_0x9750('0x45')]=_0x58c3ff;return _0x494757;});}})[_0x9750('0x11')](respondWithFilteredResult(_0x487672,_0xcf22a))['catch'](handleError(_0x487672,null));};exports[_0x9750('0x86')]=function(_0x3b170f,_0x277c51){var _0x323176,_0x3473ba={},_0x279a8c;if(_0x3b170f[_0x9750('0x49')]['to']){_0x279a8c=_0x3b170f['body']['to'][_0x9750('0x89')](',')[0x0];}return db[_0x9750('0x2f')][_0x9750('0x48')]({'where':{'id':_0x3b170f[_0x9750('0x4c')]['id']},'include':[{'model':db[_0x9750('0x8d')],'as':_0x9750('0x8e'),'include':[{'model':db[_0x9750('0x76')],'as':_0x9750('0x8f'),'where':{'email':_0x279a8c},'limit':0x1,'order':[['updatedAt',_0x9750('0x90')]]}]},{'model':db[_0x9750('0x2a')],'as':_0x9750('0x2b'),'raw':!![]}]})[_0x9750('0x11')](handleEntityNotFound(_0x277c51,null))[_0x9750('0x11')](function(_0x482517){if(_0x482517){_0x323176=_0x482517;if(_0x482517[_0x9750('0x2b')]){if(_[_0x9750('0x5d')](_0x3b170f[_0x9750('0x49')]['from'])){_0x3b170f[_0x9750('0x49')]['from']=util[_0x9750('0x8a')](_0x9750('0x91'),_0x482517[_0x9750('0x26')],_0x482517[_0x9750('0x5c')]||_0x482517[_0x9750('0x2b')][_0x9750('0x60')]);}if(_0x3b170f[_0x9750('0x49')][_0x9750('0x92')]&&_0x3b170f['body']['attachments'][_0x9750('0x39')]){for(var _0x1712f3=0x0;_0x1712f3<_0x3b170f['body'][_0x9750('0x92')]['length'];_0x1712f3+=0x1){_0x3b170f[_0x9750('0x49')][_0x9750('0x92')][_0x1712f3]={'filename':_0x3b170f[_0x9750('0x49')][_0x9750('0x92')][_0x1712f3]['name'],'path':path['join'](config['root'],_0x9750('0x93'),_0x3b170f[_0x9750('0x49')]['attachments'][_0x1712f3][_0x9750('0x94')])};}}var _0x233e47={'tls':{'rejectUnauthorized':![]}};if(_[_0x9750('0x5d')](_0x482517[_0x9750('0x2b')]['service'])){if(_0x482517[_0x9750('0x2b')]['authentication']){_0x233e47[_0x9750('0x95')]={'user':_0x482517[_0x9750('0x2b')][_0x9750('0x60')],'pass':_0x482517[_0x9750('0x2b')][_0x9750('0x63')]};}_0x233e47[_0x9750('0x65')]=_0x482517[_0x9750('0x2b')][_0x9750('0x65')];_0x233e47[_0x9750('0x66')]=_0x482517[_0x9750('0x2b')]['port'];_0x233e47['secure']=_0x482517[_0x9750('0x2b')][_0x9750('0x96')];}else{_0x233e47[_0x9750('0x64')]=_0x482517['Smtp'][_0x9750('0x64')];_0x233e47[_0x9750('0x95')]={'user':_0x482517[_0x9750('0x2b')][_0x9750('0x60')],'pass':_0x482517['Smtp'][_0x9750('0x63')]};}return respondWithRpcPromise('SendMail',_0x9750('0x97'),{'account':_0x233e47,'message':_0x3b170f[_0x9750('0x49')]});}else{throw new Error(_0x9750('0x98'));}}})['then'](function(_0x1081e4){if(_0x1081e4){_0x3473ba=_0x1081e4;if(_0x323176[_0x9750('0x8e')]){if(_0x323176[_0x9750('0x8e')][_0x9750('0x8f')][_0x9750('0x39')]){return _0x323176[_0x9750('0x8e')][_0x9750('0x8f')][0x0];}else{return db[_0x9750('0x76')][_0x9750('0x50')](_[_0x9750('0x9')](_0x3b170f['body'],{'firstName':_0x3b170f[_0x9750('0x49')]['to'],'email':_0x3b170f[_0x9750('0x49')]['to'],'phone':_0x3b170f[_0x9750('0x49')]['to'],'ListId':_0x323176[_0x9750('0x99')]}));}}else{throw new Error(_0x9750('0x98'));}}})[_0x9750('0x11')](function(_0x689a27){if(_0x689a27){var _0x44fb8a={'UserId':_0x3b170f[_0x9750('0x60')]['id'],'ContactId':_0x689a27['id'],'MailAccountId':_0x323176['id'],'inReplyTo':_0x3473ba[_0x9750('0x9a')],'to':_0x3b170f[_0x9750('0x49')][_0x9750('0x9b')],'cc':_0x3b170f[_0x9750('0x49')]['cc'],'subject':_0x3b170f[_0x9750('0x49')][_0x9750('0x9c')],'attach':_0x3b170f[_0x9750('0x49')][_0x9750('0x9d')],'firstMsgDirection':_0x9750('0x9e'),'lastMsgAt':moment()[_0x9750('0x8a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9750('0x9e'),'Messages':[_[_0x9750('0x3f')](_0x3b170f[_0x9750('0x49')],{'messageId':_0x3473ba[_0x9750('0x9a')],'sentAt':moment()[_0x9750('0x8a')](_0x9750('0x9f')),'read':!![],'MailAccountId':_0x323176['id'],'UserId':_0x3b170f[_0x9750('0x60')]['id'],'ContactId':_0x689a27['id']})]};if(_0x3b170f[_0x9750('0x49')]['Interaction']){_0x44fb8a=_[_0x9750('0x3f')](_0x44fb8a,_0x3b170f['body'][_0x9750('0xa0')]);}return db[_0x9750('0x74')][_0x9750('0x50')](_0x44fb8a,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x9750('0x11')](respondWithResult(_0x277c51,null))[_0x9750('0x19')](handleError(_0x277c51,null));};exports[_0x9750('0xa1')]=function(_0x588037,_0x461b12){return db[_0x9750('0x2f')]['find']({'where':{'id':_0x588037[_0x9750('0x4c')]['id']},'include':[{'model':db[_0x9750('0x2a')],'as':_0x9750('0x2b'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9750('0xa2'),'raw':!![]}]}]})[_0x9750('0x11')](handleEntityNotFound(_0x461b12,null))[_0x9750('0x11')](function(_0x1afc00){if(!_0x1afc00[_0x9750('0x2b')])return;var _0x7bfed6={'id':_0x1afc00['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1afc00[_0x9750('0x5a')]!==_0x9750('0x5b')){_0x7bfed6[_0x9750('0x64')]=_0x1afc00['provider'];}else{_0x7bfed6[_0x9750('0x65')]=_0x1afc00[_0x9750('0x2b')][_0x9750('0x65')];_0x7bfed6[_0x9750('0x66')]=_0x1afc00['Smtp']['port'];_0x7bfed6[_0x9750('0x96')]=_0x1afc00[_0x9750('0x2b')]['secure'];}if(_0x1afc00[_0x9750('0x2b')]['authentication']){if(_0x1afc00[_0x9750('0x2b')][_0x9750('0x4b')]){_0x7bfed6[_0x9750('0x95')]={'type':_0x9750('0xa3'),'user':_0x1afc00[_0x9750('0x2b')]['user'],'accessToken':_0x1afc00[_0x9750('0x2b')][_0x9750('0xa2')][_0x9750('0xa4')]};}else{_0x7bfed6[_0x9750('0x95')]={'user':_0x1afc00[_0x9750('0x2b')][_0x9750('0x60')],'pass':_0x1afc00[_0x9750('0x2b')][_0x9750('0x63')]};}}return respondWithRpcPromise('VerifySmtp',_0x9750('0xa1'),{'account':_0x7bfed6});})[_0x9750('0x11')](respondWithResult(_0x461b12,null))[_0x9750('0x19')](handleError(_0x461b12,null));};exports[_0x9750('0x23')]=function(_0x562f30,_0x311457){return db['MailAccount']['find']({'where':{'id':_0x562f30['params']['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x311457,null))[_0x9750('0x11')](function(_0x5a196e){if(_0x5a196e&&_0x5a196e[_0x9750('0x64')]){throw new db[(_0x9750('0xa5'))]['ValidationError'](_0x9750('0xa6'));}return _0x5a196e;})[_0x9750('0x11')](removeEntity(_0x311457,null))[_0x9750('0x19')](handleError(_0x311457,null));};exports[_0x9750('0xa7')]=function(_0x241861,_0xec08c0){return db['MailAccount'][_0x9750('0x48')]({'where':{'id':_0x241861[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0xec08c0,null))[_0x9750('0x11')](function(_0x1ab2e8){if(_0x1ab2e8){return _0x1ab2e8[_0x9750('0xa7')](_0x241861[_0x9750('0x49')][_0x9750('0x53')],_[_0x9750('0xa8')](_0x241861['body'],[_0x9750('0x53'),'id'])||{})['spread'](function(_0xc5b9b2){for(var _0x23fe7f=0x0;_0x23fe7f<_0x241861['body']['ids'][_0x9750('0x39')];_0x23fe7f+=0x1){socket[_0x9750('0xa9')]('userMailAccount:save',{'UserId':Number(_0x241861['body'][_0x9750('0x53')][_0x23fe7f]),'MailAccountId':Number(_0x241861[_0x9750('0x4c')]['id'])});}return _0xc5b9b2;});}})[_0x9750('0x11')](respondWithResult(_0xec08c0,null))[_0x9750('0x19')](handleError(_0xec08c0,null));};exports[_0x9750('0xaa')]=function(_0x4197b5,_0x383397){return db['MailAccount'][_0x9750('0x48')]({'where':{'id':_0x4197b5['params']['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x383397,null))[_0x9750('0x11')](function(_0x5c5c1a){if(_0x5c5c1a){return _0x5c5c1a[_0x9750('0xaa')](_0x4197b5[_0x9750('0x33')][_0x9750('0x53')])['then'](function(){if(_[_0x9750('0xab')](_0x4197b5[_0x9750('0x33')][_0x9750('0x53')])){for(var _0x181c34=0x0;_0x181c34<_0x4197b5[_0x9750('0x33')][_0x9750('0x53')][_0x9750('0x39')];_0x181c34+=0x1){socket['emit'](_0x9750('0xac'),{'UserId':Number(_0x4197b5[_0x9750('0x33')]['ids'][_0x181c34]),'MailAccountId':Number(_0x4197b5[_0x9750('0x4c')]['id'])});}}else{socket[_0x9750('0xa9')]('userMailAccount:remove',{'UserId':Number(_0x4197b5[_0x9750('0x33')]['ids']),'MailAccountId':Number(_0x4197b5['params']['id'])});}});}})[_0x9750('0x11')](respondWithStatusCode(_0x383397,null))['catch'](handleError(_0x383397,null));};exports[_0x9750('0xad')]=function(_0x473ac4,_0x5cbb8e){var _0x221c50={};var _0x1e5b6b={};var _0x57ef64;var _0x4650da;return db['MailAccount'][_0x9750('0x57')]({'where':{'id':_0x473ac4[_0x9750('0x4c')]['id']}})[_0x9750('0x11')](handleEntityNotFound(_0x5cbb8e,null))['then'](function(_0x388941){if(_0x388941){_0x57ef64=_0x388941;_0x1e5b6b[_0x9750('0x32')]=_[_0x9750('0x34')](db[_0x9750('0xae')]['rawAttributes']);_0x1e5b6b[_0x9750('0x33')]=_[_0x9750('0x34')](_0x473ac4[_0x9750('0x33')]);_0x1e5b6b[_0x9750('0x35')]=_[_0x9750('0x37')](_0x1e5b6b[_0x9750('0x32')],_0x1e5b6b[_0x9750('0x33')]);_0x221c50[_0x9750('0x36')]=_[_0x9750('0x37')](_0x1e5b6b[_0x9750('0x32')],qs['fields'](_0x473ac4[_0x9750('0x33')][_0x9750('0x38')]));_0x221c50[_0x9750('0x36')]=_0x221c50[_0x9750('0x36')][_0x9750('0x39')]?_0x221c50[_0x9750('0x36')]:_0x1e5b6b[_0x9750('0x32')];_0x221c50[_0x9750('0x3b')]=qs['sort'](_0x473ac4[_0x9750('0x33')][_0x9750('0x3c')]);_0x221c50['where']=qs[_0x9750('0x35')](_[_0x9750('0x3e')](_0x473ac4[_0x9750('0x33')],_0x1e5b6b[_0x9750('0x35')]));if(_0x473ac4[_0x9750('0x33')][_0x9750('0x41')]){_0x221c50[_0x9750('0x3d')]=_[_0x9750('0x3f')](_0x221c50[_0x9750('0x3d')],{'$or':_[_0x9750('0x2e')](_0x221c50['attributes'],function(_0x45ed4f){var _0x495a72={};_0x495a72[_0x45ed4f]={'$like':'%'+_0x473ac4[_0x9750('0x33')][_0x9750('0x41')]+'%'};return _0x495a72;})});}_0x221c50=_[_0x9750('0x3f')]({},_0x221c50,_0x473ac4[_0x9750('0x42')]);return _0x57ef64[_0x9750('0xad')](_0x221c50);}})[_0x9750('0x11')](function(_0x20e0b3){if(_0x20e0b3){_0x4650da=_0x20e0b3[_0x9750('0x39')];if(!_0x473ac4[_0x9750('0x33')][_0x9750('0x58')](_0x9750('0x3a'))){_0x221c50['limit']=qs[_0x9750('0x20')](_0x473ac4['query'][_0x9750('0x20')]);_0x221c50['offset']=qs['offset'](_0x473ac4[_0x9750('0x33')]['offset']);}return _0x57ef64[_0x9750('0xad')](_0x221c50);}})[_0x9750('0x11')](function(_0x24f0b3){if(_0x24f0b3){return _0x24f0b3?{'count':_0x4650da,'rows':_0x24f0b3}:null;}})[_0x9750('0x11')](respondWithResult(_0x5cbb8e,null))[_0x9750('0x19')](handleError(_0x5cbb8e,null));}; \ No newline at end of file +var _0xe558=['ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','get','UserProfileResource','destroy','stack','name','send','index','Imap','MailServerOut','Pause','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','MailAccount','includeAll','findAll','rows','params','MailServerIn','Smtp','mandatoryDispositionPause','rawAttributes','include','find','body','modernAuthentication','CloudProviderId','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','provider','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','MailInteraction','addInteraction','ids','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','finally','getApplications','MailMessage','$gte','inlineCss','true','split','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','ListId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','CloudProvider','data5','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','getAgents','moment','util','path','lodash','juice'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0xe558,0xb4));var _0x8e55=function(_0x33b4d1,_0x4df75a){_0x33b4d1=_0x33b4d1-0x0;var _0x3a6382=_0xe558[_0x33b4d1];return _0x3a6382;};'use strict';var moment=require(_0x8e55('0x0'));var BPromise=require('bluebird');var util=require(_0x8e55('0x1'));var path=require(_0x8e55('0x2'));var _=require(_0x8e55('0x3'));var juice=require(_0x8e55('0x4'));var Redis=require(_0x8e55('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x8e55('0x6'))('api');var config=require(_0x8e55('0x7'));var db=require(_0x8e55('0x8'))['db'];config[_0x8e55('0x9')]=_[_0x8e55('0xa')](config[_0x8e55('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e55('0xb'))(new Redis(config[_0x8e55('0x9')]));require(_0x8e55('0xc'))[_0x8e55('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8e55('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x1cc224,_0x421372,_0x1c26d5,_0x395ee1){return new BPromise(function(_0x39b8f5,_0x2c6494){var _0x20a6df=_0x395ee1||client;return _0x20a6df[_0x8e55('0xf')](_0x1cc224,_0x1c26d5)[_0x8e55('0x10')](function(_0x253941){logger['info'](_0x8e55('0x11'),_0x421372,_0x8e55('0x12'));logger[_0x8e55('0x13')](_0x8e55('0x14'),_0x421372,_0x8e55('0x12'),JSON[_0x8e55('0x15')](_0x253941));if(_0x253941[_0x8e55('0x16')]){if(_0x253941[_0x8e55('0x16')][_0x8e55('0x17')]===0x1f4){logger[_0x8e55('0x16')](_0x8e55('0x11'),_0x421372,_0x253941[_0x8e55('0x16')][_0x8e55('0x18')]);return _0x2c6494(_0x253941[_0x8e55('0x16')][_0x8e55('0x18')]);}logger[_0x8e55('0x16')]('MailAccount,\x20%s,\x20%s',_0x421372,_0x253941[_0x8e55('0x16')][_0x8e55('0x18')]);return _0x39b8f5(_0x253941[_0x8e55('0x16')][_0x8e55('0x18')]);}else{logger[_0x8e55('0x19')](_0x8e55('0x11'),_0x421372,_0x8e55('0x12'));_0x39b8f5(_0x253941['result'][_0x8e55('0x18')]);}})[_0x8e55('0x1a')](function(_0x4c8f8e){logger['error']('MailAccount,\x20%s,\x20%s',_0x421372,_0x4c8f8e);_0x2c6494(_0x4c8f8e);});});}function respondWithStatusCode(_0x45b8fa,_0x15c19a){_0x15c19a=_0x15c19a||0xcc;return function(_0xf9d07e){if(_0xf9d07e){return _0x45b8fa[_0x8e55('0x1b')](_0x15c19a);}return _0x45b8fa['status'](_0x15c19a)[_0x8e55('0x1c')]();};}function respondWithResult(_0x11cc14,_0x377083){_0x377083=_0x377083||0xc8;return function(_0x451a51){if(_0x451a51){return _0x11cc14['status'](_0x377083)[_0x8e55('0x1d')](_0x451a51);}};}function respondWithFilteredResult(_0x380bd,_0x442b7a){return function(_0x4eabc8){if(_0x4eabc8){var _0x5ea90e=typeof _0x442b7a[_0x8e55('0x1e')]===_0x8e55('0x1f')&&typeof _0x442b7a[_0x8e55('0x20')]==='undefined';var _0x5c08bf=_0x4eabc8['count'];var _0x5db39f=_0x5ea90e?0x0:_0x442b7a['offset'];var _0x4b9657=_0x5ea90e?_0x4eabc8[_0x8e55('0x21')]:_0x442b7a[_0x8e55('0x1e')]+_0x442b7a[_0x8e55('0x20')];var _0x1fdbdc;if(_0x4b9657>=_0x5c08bf){_0x4b9657=_0x5c08bf;_0x1fdbdc=0xc8;}else{_0x1fdbdc=0xce;}_0x380bd[_0x8e55('0x22')](_0x1fdbdc);return _0x380bd[_0x8e55('0x23')](_0x8e55('0x24'),_0x5db39f+'-'+_0x4b9657+'/'+_0x5c08bf)[_0x8e55('0x1d')](_0x4eabc8);}return null;};}function saveUpdates(_0x5cd71a){return function(_0x3f2c53){if(_0x3f2c53){return _0x3f2c53[_0x8e55('0x25')](_0x5cd71a)[_0x8e55('0x10')](function(_0x188327){return _0x188327;});}return null;};}function removeEntity(_0x55d8d5){return function(_0x541321){if(_0x541321){return _0x541321['destroy']()['then'](function(){var _0x7e3b9e=_0x541321[_0x8e55('0x26')]({'plain':!![]});var _0x551132='MailAccounts';return db[_0x8e55('0x27')][_0x8e55('0x28')]({'where':{'type':_0x551132,'resourceId':_0x7e3b9e['id']}})[_0x8e55('0x10')](function(){return _0x541321;});})[_0x8e55('0x10')](function(){_0x55d8d5[_0x8e55('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54927d){return function(_0x3eb387){if(!_0x3eb387){_0x54927d[_0x8e55('0x1b')](0x194);}return _0x3eb387;};}function handleError(_0x455619,_0x3b245f){_0x3b245f=_0x3b245f||0x1f4;return function(_0x34b948){logger['error'](_0x34b948[_0x8e55('0x29')]);if(_0x34b948[_0x8e55('0x2a')]){delete _0x34b948[_0x8e55('0x2a')];}_0x455619['status'](_0x3b245f)[_0x8e55('0x2b')](_0x34b948);};}exports[_0x8e55('0x2c')]=function(_0x2b8af2,_0xeab3e0){var _0x3822d7={'include':[{'model':db['MailServerIn'],'as':_0x8e55('0x2d')},{'model':db[_0x8e55('0x2e')],'as':'Smtp'},{'model':db[_0x8e55('0x2f')],'as':'mandatoryDispositionPause'}]},_0x278958={},_0x98acda={'count':0x0,'rows':[]};var _0x2e65a7=_['map'](db['MailAccount']['rawAttributes'],function(_0x5c286a){return{'name':_0x5c286a[_0x8e55('0x30')],'type':_0x5c286a['type'][_0x8e55('0x31')]};});_0x278958[_0x8e55('0x32')]=_[_0x8e55('0x33')](_0x2e65a7,'name');_0x278958[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0x2b8af2['query']);_0x278958[_0x8e55('0x36')]=_[_0x8e55('0x37')](_0x278958[_0x8e55('0x32')],_0x278958[_0x8e55('0x34')]);_0x3822d7[_0x8e55('0x38')]=_['intersection'](_0x278958['model'],qs[_0x8e55('0x39')](_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x39')]));_0x3822d7[_0x8e55('0x38')]=_0x3822d7[_0x8e55('0x38')][_0x8e55('0x3a')]?_0x3822d7[_0x8e55('0x38')]:_0x278958[_0x8e55('0x32')];if(!_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x3b')](_0x8e55('0x3c'))){_0x3822d7['limit']=qs[_0x8e55('0x20')](_0x2b8af2[_0x8e55('0x34')]['limit']);_0x3822d7[_0x8e55('0x1e')]=qs[_0x8e55('0x1e')](_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x1e')]);}_0x3822d7['order']=qs[_0x8e55('0x3d')](_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x3d')]);_0x3822d7['where']=qs['filters'](_[_0x8e55('0x3e')](_0x2b8af2[_0x8e55('0x34')],_0x278958[_0x8e55('0x36')]),_0x2e65a7);if(_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x3f')]){_0x3822d7[_0x8e55('0x40')]=_[_0x8e55('0x41')](_0x3822d7['where'],{'$or':_[_0x8e55('0x33')](_0x2e65a7,function(_0x41a5ea){if(_0x41a5ea[_0x8e55('0x42')]!=='VIRTUAL'){var _0x217bc8={};_0x217bc8[_0x41a5ea[_0x8e55('0x2a')]]={'$like':'%'+_0x2b8af2['query'][_0x8e55('0x3f')]+'%'};return _0x217bc8;}})});}_0x3822d7=_[_0x8e55('0x41')]({},_0x3822d7,_0x2b8af2[_0x8e55('0x43')]);var _0x3cc242={'where':_0x3822d7[_0x8e55('0x40')]};return db[_0x8e55('0x44')][_0x8e55('0x21')](_0x3cc242)['then'](function(_0x2ab72d){_0x98acda[_0x8e55('0x21')]=_0x2ab72d;if(_0x2b8af2[_0x8e55('0x34')][_0x8e55('0x45')]){_0x3822d7['include']=[{'all':!![]}];}return db['MailAccount'][_0x8e55('0x46')](_0x3822d7);})['then'](function(_0x288700){_0x98acda[_0x8e55('0x47')]=_0x288700;return _0x98acda;})[_0x8e55('0x10')](respondWithFilteredResult(_0xeab3e0,_0x3822d7))[_0x8e55('0x1a')](handleError(_0xeab3e0,null));};exports['show']=function(_0x1502b0,_0x595eab){var _0x49f341={'raw':![],'where':{'id':_0x1502b0[_0x8e55('0x48')]['id']},'include':[{'model':db[_0x8e55('0x49')],'as':_0x8e55('0x2d')},{'model':db['MailServerOut'],'as':_0x8e55('0x4a')},{'model':db[_0x8e55('0x2f')],'as':_0x8e55('0x4b')}]},_0x3113e3={};_0x3113e3[_0x8e55('0x32')]=_['keys'](db[_0x8e55('0x44')][_0x8e55('0x4c')]);_0x3113e3[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0x1502b0[_0x8e55('0x34')]);_0x3113e3[_0x8e55('0x36')]=_[_0x8e55('0x37')](_0x3113e3[_0x8e55('0x32')],_0x3113e3[_0x8e55('0x34')]);_0x49f341['attributes']=_[_0x8e55('0x37')](_0x3113e3[_0x8e55('0x32')],qs[_0x8e55('0x39')](_0x1502b0[_0x8e55('0x34')][_0x8e55('0x39')]));_0x49f341[_0x8e55('0x38')]=_0x49f341[_0x8e55('0x38')][_0x8e55('0x3a')]?_0x49f341['attributes']:_0x3113e3[_0x8e55('0x32')];if(_0x1502b0[_0x8e55('0x34')]['includeAll']){_0x49f341[_0x8e55('0x4d')]=[{'all':!![]}];}_0x49f341=_[_0x8e55('0x41')]({},_0x49f341,_0x1502b0[_0x8e55('0x43')]);return db[_0x8e55('0x44')][_0x8e55('0x4e')](_0x49f341)[_0x8e55('0x10')](handleEntityNotFound(_0x595eab,null))[_0x8e55('0x10')](respondWithResult(_0x595eab,null))[_0x8e55('0x1a')](handleError(_0x595eab,null));};exports[_0x8e55('0x25')]=function(_0x16cd2b,_0x390f2b){if(_0x16cd2b['body']['id']){delete _0x16cd2b[_0x8e55('0x4f')]['id'];}if(_0x16cd2b['body'][_0x8e55('0x2d')]){if(!_0x16cd2b[_0x8e55('0x4f')]['Imap'][_0x8e55('0x50')]){_0x16cd2b[_0x8e55('0x4f')][_0x8e55('0x2d')][_0x8e55('0x51')]=null;}}if(_0x16cd2b['body'][_0x8e55('0x4a')]){if(!_0x16cd2b['body'][_0x8e55('0x4a')][_0x8e55('0x50')]){_0x16cd2b['body']['Smtp']['CloudProviderId']=null;}}return db['MailAccount'][_0x8e55('0x4e')]({'where':{'id':_0x16cd2b[_0x8e55('0x48')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x8e55('0x2e')],'as':_0x8e55('0x4a')},{'model':db[_0x8e55('0x2f')],'as':'mandatoryDispositionPause'}]})[_0x8e55('0x10')](handleEntityNotFound(_0x390f2b,null))[_0x8e55('0x10')](saveUpdates(_0x16cd2b['body'],null))[_0x8e55('0x10')](function(_0x304cea){if(_0x304cea&&_0x16cd2b[_0x8e55('0x4f')][_0x8e55('0x2d')]){return db[_0x8e55('0x49')][_0x8e55('0x25')](_0x16cd2b[_0x8e55('0x4f')][_0x8e55('0x2d')],{'where':{'MailAccountId':_0x304cea['id']}})[_0x8e55('0x10')](function(){return _0x304cea;});}return _0x304cea;})[_0x8e55('0x10')](function(_0x5ce4f3){if(_0x5ce4f3&&_0x16cd2b[_0x8e55('0x4f')][_0x8e55('0x4a')]){return db[_0x8e55('0x2e')][_0x8e55('0x25')](_0x16cd2b[_0x8e55('0x4f')][_0x8e55('0x4a')],{'where':{'MailAccountId':_0x5ce4f3['id']}})[_0x8e55('0x10')](function(){return _0x5ce4f3;});}return _0x5ce4f3;})[_0x8e55('0x10')](respondWithResult(_0x390f2b,null))[_0x8e55('0x1a')](handleError(_0x390f2b,null));};exports['describe']=function(_0x2a71d4,_0x152e75){return db[_0x8e55('0x44')][_0x8e55('0x52')]()[_0x8e55('0x10')](respondWithResult(_0x152e75,null))[_0x8e55('0x1a')](handleError(_0x152e75,null));};exports['addDisposition']=function(_0x12f505,_0x3c2acd){if(_0x12f505[_0x8e55('0x4f')]['id']){delete _0x12f505[_0x8e55('0x4f')]['id'];}return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x12f505[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x3c2acd,null))[_0x8e55('0x10')](function(_0x3eb81d){if(_0x3eb81d){_0x12f505[_0x8e55('0x4f')][_0x8e55('0x53')]=_0x3eb81d['id'];return db[_0x8e55('0x54')][_0x8e55('0x55')](_0x12f505[_0x8e55('0x4f')]);}})[_0x8e55('0x10')](respondWithResult(_0x3c2acd,null))[_0x8e55('0x1a')](handleError(_0x3c2acd,null));};exports[_0x8e55('0x56')]=function(_0xa957e0,_0x188539){var _0x36450d={'raw':![],'where':{}};var _0x5655f3={};var _0x4c8ea4={'count':0x0,'rows':[]};return db[_0x8e55('0x44')][_0x8e55('0x57')]({'where':{'id':_0xa957e0[_0x8e55('0x48')]['id']}})['then'](handleEntityNotFound(_0x188539,null))['then'](function(_0x2c9620){if(_0x2c9620){_0x5655f3[_0x8e55('0x32')]=_[_0x8e55('0x35')](db[_0x8e55('0x54')][_0x8e55('0x4c')]);_0x5655f3[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0xa957e0[_0x8e55('0x34')]);_0x5655f3['filters']=_[_0x8e55('0x37')](_0x5655f3[_0x8e55('0x32')],_0x5655f3[_0x8e55('0x34')]);_0x36450d[_0x8e55('0x38')]=_['intersection'](_0x5655f3[_0x8e55('0x32')],qs[_0x8e55('0x39')](_0xa957e0[_0x8e55('0x34')][_0x8e55('0x39')]));_0x36450d[_0x8e55('0x38')]=_0x36450d['attributes']['length']?_0x36450d[_0x8e55('0x38')]:_0x5655f3['model'];if(!_0xa957e0['query']['hasOwnProperty'](_0x8e55('0x3c'))){_0x36450d[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0xa957e0[_0x8e55('0x34')]['limit']);_0x36450d[_0x8e55('0x1e')]=qs['offset'](_0xa957e0['query'][_0x8e55('0x1e')]);}_0x36450d[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0xa957e0['query']['sort']);_0x36450d[_0x8e55('0x40')]=qs[_0x8e55('0x36')](_[_0x8e55('0x3e')](_0xa957e0[_0x8e55('0x34')],_0x5655f3[_0x8e55('0x36')]));_0x36450d['where'][_0x8e55('0x53')]=_0x2c9620['id'];if(_0xa957e0['query'][_0x8e55('0x3f')]){_0x36450d[_0x8e55('0x40')]=_[_0x8e55('0x41')](_0x36450d[_0x8e55('0x40')],{'$or':_[_0x8e55('0x33')](_0x36450d[_0x8e55('0x38')],function(_0x297ada){var _0x5e6768={};_0x5e6768[_0x297ada]={'$like':'%'+_0xa957e0[_0x8e55('0x34')]['filter']+'%'};return _0x5e6768;})});}_0x36450d=_['merge']({},_0x36450d,_0xa957e0[_0x8e55('0x43')]);return db[_0x8e55('0x54')]['count']({'where':_0x36450d[_0x8e55('0x40')]})['then'](function(_0x17bd9d){_0x4c8ea4['count']=_0x17bd9d;if(_0xa957e0[_0x8e55('0x34')][_0x8e55('0x45')]){_0x36450d[_0x8e55('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x8e55('0x46')](_0x36450d);})[_0x8e55('0x10')](function(_0x4bc0a2){_0x4c8ea4[_0x8e55('0x47')]=_0x4bc0a2;return _0x4c8ea4;});}})[_0x8e55('0x10')](respondWithFilteredResult(_0x188539,_0x36450d))['catch'](handleError(_0x188539,null));};exports[_0x8e55('0x59')]=function(_0x3ba13e,_0x3b220f){return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x3ba13e[_0x8e55('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b220f,null))['then'](function(_0x399884){if(_0x399884){return _0x399884['removeDispositions'](_0x3ba13e[_0x8e55('0x34')]['ids']);}})[_0x8e55('0x10')](respondWithStatusCode(_0x3b220f,null))[_0x8e55('0x1a')](handleError(_0x3b220f,null));};exports[_0x8e55('0x5a')]=function(_0x3eaadd,_0x277fc2){if(_0x3eaadd[_0x8e55('0x4f')]['id']){delete _0x3eaadd[_0x8e55('0x4f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3eaadd[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x277fc2,null))[_0x8e55('0x10')](function(_0x4c6a8c){if(_0x4c6a8c){_0x3eaadd[_0x8e55('0x4f')]['MailAccountId']=_0x4c6a8c['id'];return db[_0x8e55('0x5b')][_0x8e55('0x55')](_0x3eaadd[_0x8e55('0x4f')]);}})[_0x8e55('0x10')](respondWithResult(_0x277fc2,null))[_0x8e55('0x1a')](handleError(_0x277fc2,null));};exports[_0x8e55('0x5c')]=function(_0x1e27de,_0x42d78a){var _0x1a72ca={'raw':![],'where':{}};var _0x3dab12={};var _0xe0759f={'count':0x0,'rows':[]};return db[_0x8e55('0x44')]['findOne']({'where':{'id':_0x1e27de['params']['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x42d78a,null))[_0x8e55('0x10')](function(_0x280be){if(_0x280be){_0x3dab12[_0x8e55('0x32')]=_[_0x8e55('0x35')](db[_0x8e55('0x5b')]['rawAttributes']);_0x3dab12[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0x1e27de[_0x8e55('0x34')]);_0x3dab12[_0x8e55('0x36')]=_['intersection'](_0x3dab12[_0x8e55('0x32')],_0x3dab12[_0x8e55('0x34')]);_0x1a72ca[_0x8e55('0x38')]=_['intersection'](_0x3dab12[_0x8e55('0x32')],qs[_0x8e55('0x39')](_0x1e27de[_0x8e55('0x34')]['fields']));_0x1a72ca[_0x8e55('0x38')]=_0x1a72ca[_0x8e55('0x38')][_0x8e55('0x3a')]?_0x1a72ca[_0x8e55('0x38')]:_0x3dab12[_0x8e55('0x32')];if(!_0x1e27de['query'][_0x8e55('0x3b')](_0x8e55('0x3c'))){_0x1a72ca[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0x1e27de[_0x8e55('0x34')][_0x8e55('0x20')]);_0x1a72ca[_0x8e55('0x1e')]=qs[_0x8e55('0x1e')](_0x1e27de[_0x8e55('0x34')][_0x8e55('0x1e')]);}_0x1a72ca[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0x1e27de[_0x8e55('0x34')][_0x8e55('0x3d')]);_0x1a72ca[_0x8e55('0x40')]=qs[_0x8e55('0x36')](_[_0x8e55('0x3e')](_0x1e27de['query'],_0x3dab12[_0x8e55('0x36')]));_0x1a72ca['where'][_0x8e55('0x53')]=_0x280be['id'];if(_0x1e27de[_0x8e55('0x34')][_0x8e55('0x3f')]){_0x1a72ca['where']=_['merge'](_0x1a72ca[_0x8e55('0x40')],{'$or':_[_0x8e55('0x33')](_0x1a72ca[_0x8e55('0x38')],function(_0x51637a){var _0xcb4574={};_0xcb4574[_0x51637a]={'$like':'%'+_0x1e27de[_0x8e55('0x34')][_0x8e55('0x3f')]+'%'};return _0xcb4574;})});}_0x1a72ca=_[_0x8e55('0x41')]({},_0x1a72ca,_0x1e27de[_0x8e55('0x43')]);return db[_0x8e55('0x5b')][_0x8e55('0x21')]({'where':_0x1a72ca[_0x8e55('0x40')]})[_0x8e55('0x10')](function(_0x1d9c19){_0xe0759f[_0x8e55('0x21')]=_0x1d9c19;if(_0x1e27de['query'][_0x8e55('0x45')]){_0x1a72ca['include']=[{'all':!![]}];}return db[_0x8e55('0x5b')][_0x8e55('0x46')](_0x1a72ca);})[_0x8e55('0x10')](function(_0x6fa0b7){_0xe0759f[_0x8e55('0x47')]=_0x6fa0b7;return _0xe0759f;});}})[_0x8e55('0x10')](respondWithFilteredResult(_0x42d78a,_0x1a72ca))['catch'](handleError(_0x42d78a,null));};exports[_0x8e55('0x5d')]=function(_0x12462e,_0x36d80d){return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x12462e[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x36d80d,null))['then'](function(_0x3008bb){if(_0x3008bb){return _0x3008bb['removeAnswers'](_0x12462e[_0x8e55('0x34')]['ids']);}})[_0x8e55('0x10')](respondWithStatusCode(_0x36d80d,null))['catch'](handleError(_0x36d80d,null));};exports['create']=function(_0x401f37,_0x829389){var _0x30d7c5={'name':_0x401f37[_0x8e55('0x4f')][_0x8e55('0x2a')],'key':_0x401f37[_0x8e55('0x4f')][_0x8e55('0x31')],'provider':_0x401f37[_0x8e55('0x4f')]['provider']===_0x8e55('0x5e')?null:_0x401f37[_0x8e55('0x4f')][_0x8e55('0x5f')],'email':_0x401f37[_0x8e55('0x4f')][_0x8e55('0x60')],'ListId':_0x401f37[_0x8e55('0x4f')]['ListId'],'active':!_[_0x8e55('0x61')](_0x401f37[_0x8e55('0x4f')][_0x8e55('0x62')])?_0x401f37[_0x8e55('0x4f')][_0x8e55('0x62')]:!![],'description':_0x401f37['body'][_0x8e55('0x63')]||null,'Imap':{},'Smtp':{}};if(_0x30d7c5[_0x8e55('0x5f')]){_0x30d7c5['Imap'][_0x8e55('0x64')]=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x64')]=_0x401f37['body'][_0x8e55('0x65')];_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x66')]=_0x30d7c5[_0x8e55('0x4a')]['pass']=_0x401f37[_0x8e55('0x4f')]['password'];if(_0x401f37['body'][_0x8e55('0x50')]){_0x30d7c5['Imap']['modernAuthentication']=_0x30d7c5['Smtp'][_0x8e55('0x50')]=!![];_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x51')]=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x51')]=_0x401f37[_0x8e55('0x4f')][_0x8e55('0x51')];_0x30d7c5[_0x8e55('0x2d')]['password']=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x67')]=null;}else{_0x30d7c5['Imap']['CloudProviderId']=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x51')]=null;}_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x68')]=_0x30d7c5[_0x8e55('0x4a')]['service']=null;_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x69')]=_0x30d7c5[_0x8e55('0x4a')]['host']=null;_0x30d7c5['Imap'][_0x8e55('0x6a')]=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x6a')]=null;}else{if(_0x401f37['body']['authentication']){_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x64')]=_0x30d7c5[_0x8e55('0x4a')]['user']=_0x401f37[_0x8e55('0x4f')][_0x8e55('0x65')];_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x66')]=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x67')]=_0x401f37[_0x8e55('0x4f')][_0x8e55('0x66')];}else{_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x6b')]=_0x30d7c5['Smtp'][_0x8e55('0x6b')]=![];_0x30d7c5[_0x8e55('0x2d')]['user']=_0x30d7c5[_0x8e55('0x4a')]['user']=null;_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x66')]=_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x67')]=null;}_0x30d7c5['Imap'][_0x8e55('0x69')]=_0x401f37[_0x8e55('0x4f')]['Imap']['host'];_0x30d7c5[_0x8e55('0x2d')][_0x8e55('0x6a')]=_0x401f37[_0x8e55('0x4f')][_0x8e55('0x2d')][_0x8e55('0x6a')];_0x30d7c5[_0x8e55('0x4a')]['host']=_0x401f37[_0x8e55('0x4f')]['Smtp'][_0x8e55('0x69')];_0x30d7c5[_0x8e55('0x4a')][_0x8e55('0x6a')]=_0x401f37['body']['Smtp'][_0x8e55('0x6a')];}return db[_0x8e55('0x44')]['create'](_0x30d7c5,{'include':[{'model':db[_0x8e55('0x2e')],'as':'Smtp'},{'model':db[_0x8e55('0x49')],'as':'Imap'}]})[_0x8e55('0x10')](function(_0x18b8b3){var _0x675256=_0x401f37['user'][_0x8e55('0x26')]({'plain':!![]});if(!_0x675256)throw new Error(_0x8e55('0x6c'));if(_0x675256[_0x8e55('0x6d')]==='user'){var _0x1a12e1=_0x18b8b3[_0x8e55('0x26')]({'plain':!![]});return db[_0x8e55('0x6e')][_0x8e55('0x4e')]({'where':{'name':'MailAccounts','userProfileId':_0x675256[_0x8e55('0x6f')]},'raw':!![]})[_0x8e55('0x10')](function(_0x330dca){if(_0x330dca&&_0x330dca[_0x8e55('0x70')]===0x0){return db[_0x8e55('0x27')][_0x8e55('0x55')]({'name':_0x1a12e1[_0x8e55('0x2a')],'resourceId':_0x1a12e1['id'],'type':_0x330dca['name'],'sectionId':_0x330dca['id']},{})[_0x8e55('0x10')](function(){return _0x18b8b3;});}else{return _0x18b8b3;}})['catch'](function(_0xeeb52c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeeb52c);throw _0xeeb52c;});}return _0x18b8b3;})['then'](respondWithResult(_0x829389,0xc9))[_0x8e55('0x1a')](handleError(_0x829389,null));};exports[_0x8e55('0x71')]=function(_0x55fe6d,_0x2e09e4){return db[_0x8e55('0x44')]['findOne']({'where':{'id':_0x55fe6d['params']['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x2e09e4,null))[_0x8e55('0x10')](function(_0x34195f){if(_0x34195f){return _0x34195f['getImap']();}return null;})[_0x8e55('0x10')](respondWithResult(_0x2e09e4,null))[_0x8e55('0x1a')](handleError(_0x2e09e4,null));};exports[_0x8e55('0x72')]=function(_0x244d30,_0xc19d58){if(_0x244d30[_0x8e55('0x4f')]['id']){delete _0x244d30[_0x8e55('0x4f')]['id'];}return db[_0x8e55('0x44')]['find']({'where':{'id':_0x244d30[_0x8e55('0x48')]['id']}})['then'](handleEntityNotFound(_0xc19d58,null))[_0x8e55('0x10')](function(_0x438d46){if(_0x438d46){_0x244d30[_0x8e55('0x4f')][_0x8e55('0x53')]=_0x438d46['id'];return db[_0x8e55('0x49')][_0x8e55('0x55')](_0x244d30[_0x8e55('0x4f')]);}})[_0x8e55('0x10')](respondWithResult(_0xc19d58,null))['catch'](handleError(_0xc19d58,null));};exports[_0x8e55('0x73')]=function(_0x522b89,_0x19bde4){return db[_0x8e55('0x44')][_0x8e55('0x57')]({'where':{'id':_0x522b89[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x19bde4,null))[_0x8e55('0x10')](function(_0x332382){if(_0x332382){return _0x332382[_0x8e55('0x74')](null);}return null;})['then'](respondWithStatusCode(_0x19bde4,null))[_0x8e55('0x1a')](handleError(_0x19bde4,null));};exports[_0x8e55('0x75')]=function(_0x5e92c8,_0x5985ee){return db[_0x8e55('0x44')]['findOne']({'where':{'id':_0x5e92c8[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x5985ee,null))['then'](function(_0x282584){if(_0x282584){return _0x282584[_0x8e55('0x75')]();}return null;})['then'](respondWithResult(_0x5985ee,null))['catch'](handleError(_0x5985ee,null));};exports[_0x8e55('0x76')]=function(_0x1d334e,_0x2b299d){if(_0x1d334e['body']['id']){delete _0x1d334e[_0x8e55('0x4f')]['id'];}return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x1d334e[_0x8e55('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b299d,null))[_0x8e55('0x10')](function(_0x447687){if(_0x447687){_0x1d334e[_0x8e55('0x4f')][_0x8e55('0x53')]=_0x447687['id'];return db[_0x8e55('0x2e')]['create'](_0x1d334e[_0x8e55('0x4f')]);}})[_0x8e55('0x10')](respondWithResult(_0x2b299d,null))[_0x8e55('0x1a')](handleError(_0x2b299d,null));};exports['removeSmtp']=function(_0x360b0b,_0x343656){return db[_0x8e55('0x44')][_0x8e55('0x57')]({'where':{'id':_0x360b0b[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x343656,null))['then'](function(_0x48139f){if(_0x48139f){return _0x48139f['setSmtp'](null);}return null;})[_0x8e55('0x10')](respondWithStatusCode(_0x343656,null))[_0x8e55('0x1a')](handleError(_0x343656,null));};exports['addInteraction']=function(_0x2cc976,_0x5d045d){return db[_0x8e55('0x77')][_0x8e55('0x4e')]({'where':{'id':_0x2cc976[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x5d045d,null))['then'](function(_0x347fcc){if(_0x347fcc){return _0x347fcc[_0x8e55('0x78')](_0x2cc976[_0x8e55('0x4f')][_0x8e55('0x79')],_[_0x8e55('0x7a')](_0x2cc976[_0x8e55('0x4f')],['ids','id'])||{});}})[_0x8e55('0x10')](respondWithResult(_0x5d045d,null))[_0x8e55('0x1a')](handleError(_0x5d045d,null));};exports[_0x8e55('0x7b')]=function(_0x3dfd13,_0x54bf62){var _0x5c8489={'raw':![],'where':{}};var _0x2a16db={};var _0x41a216={'count':0x0,'rows':[]};return db[_0x8e55('0x44')][_0x8e55('0x57')]({'where':{'id':_0x3dfd13[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x54bf62,null))[_0x8e55('0x10')](function(_0x36ac99){if(_0x36ac99){_0x2a16db[_0x8e55('0x32')]=_['keys'](db[_0x8e55('0x77')][_0x8e55('0x4c')]);_0x2a16db[_0x8e55('0x34')]=_['keys'](_0x3dfd13[_0x8e55('0x34')]);_0x2a16db[_0x8e55('0x36')]=_[_0x8e55('0x37')](_0x2a16db[_0x8e55('0x32')],_0x2a16db[_0x8e55('0x34')]);_0x5c8489[_0x8e55('0x38')]=_[_0x8e55('0x37')](_0x2a16db['model'],qs[_0x8e55('0x39')](_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x39')]));_0x5c8489[_0x8e55('0x38')]=_0x5c8489[_0x8e55('0x38')]['length']?_0x5c8489[_0x8e55('0x38')]:_0x2a16db['model'];if(!_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x3b')](_0x8e55('0x3c'))){_0x5c8489[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x20')]);_0x5c8489[_0x8e55('0x1e')]=qs['offset'](_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x1e')]);}_0x5c8489[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0x3dfd13['query'][_0x8e55('0x3d')]);_0x5c8489[_0x8e55('0x40')]=qs[_0x8e55('0x36')](_[_0x8e55('0x3e')](_0x3dfd13[_0x8e55('0x34')],_0x2a16db[_0x8e55('0x36')]));_0x5c8489['where'][_0x8e55('0x53')]=_0x36ac99['id'];if(_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x3f')]){_0x5c8489['where']=_['merge'](_0x5c8489[_0x8e55('0x40')],{'$or':_[_0x8e55('0x33')](_0x5c8489[_0x8e55('0x38')],function(_0x4db418){var _0x33a403={};_0x33a403[_0x4db418]={'$like':'%'+_0x3dfd13[_0x8e55('0x34')]['filter']+'%'};return _0x33a403;})});}_0x5c8489=_['merge']({},_0x5c8489,_0x3dfd13[_0x8e55('0x43')]);return db[_0x8e55('0x77')][_0x8e55('0x21')]({'where':_0x5c8489['where']})[_0x8e55('0x10')](function(_0x23a93a){_0x41a216[_0x8e55('0x21')]=_0x23a93a;if(_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x45')]){_0x5c8489[_0x8e55('0x4d')]=[{'model':db[_0x8e55('0x7c')],'as':_0x8e55('0x7d'),'required':![]},{'model':db[_0x8e55('0x7e')],'as':_0x8e55('0x7f'),'attributes':['name',_0x8e55('0x80'),_0x8e55('0x81')],'required':![]},{'model':db[_0x8e55('0x82')],'as':_0x8e55('0x83'),'attributes':['id',_0x8e55('0x2a'),_0x8e55('0x84')],'where':_0x3dfd13['query'][_0x8e55('0x85')]?{'id':_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x85')]}:undefined,'required':_0x3dfd13[_0x8e55('0x34')][_0x8e55('0x85')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x5c8489);})[_0x8e55('0x10')](function(_0x253bc7){_0x41a216['rows']=_0x253bc7;return _0x41a216;});}})[_0x8e55('0x10')](respondWithFilteredResult(_0x54bf62,_0x5c8489))[_0x8e55('0x1a')](handleError(_0x54bf62,null));};exports[_0x8e55('0x86')]=function addApplications(_0x4fd9fa,_0x57977d){var _0x3667cf=_0x4fd9fa[_0x8e55('0x48')]['id'];var _0x23f2fe=_0x4fd9fa['body'];var _0x17344a=0xc8;var _0x598d38=null;return db[_0x8e55('0x87')][_0x8e55('0x88')]({'isolationLevel':db[_0x8e55('0x87')]['Transaction'][_0x8e55('0x89')][_0x8e55('0x8a')]},function(_0x5f161c){return db['MailAccount'][_0x8e55('0x57')]({'where':{'id':_0x3667cf},'transaction':_0x5f161c})[_0x8e55('0x10')](function(_0x2db37c){if(_0x2db37c){return db[_0x8e55('0x8b')][_0x8e55('0x28')]({'where':{'MailAccountId':_0x3667cf},'transaction':_0x5f161c})[_0x8e55('0x10')](function(){var _0x3c5bd9=_['map'](_0x23f2fe,function(_0x2e881a){_0x2e881a['MailAccountId']=_0x3667cf;return _0x2e881a;});return db['MailApplication']['bulkCreate'](_0x3c5bd9,{'transaction':_0x5f161c});});}else{_0x17344a=0x194;_0x598d38=[];}});})[_0x8e55('0x10')](function(){if(_0x17344a!==0x194){return db[_0x8e55('0x8b')]['findAndCountAll']({'where':{'MailAccountId':_0x3667cf},'order':_0x8e55('0x8c')})['then'](function(_0x51b67b){_0x598d38=_0x51b67b;});}})[_0x8e55('0x1a')](function(_0x4e5eef){_0x17344a=0x1f4;logger[_0x8e55('0x16')](_0x4e5eef[_0x8e55('0x29')]);if(_0x4e5eef[_0x8e55('0x2a')]){delete _0x4e5eef['name'];}_0x598d38=_0x4e5eef;})[_0x8e55('0x8d')](function(){if(_0x598d38===null){_0x57977d[_0x8e55('0x1b')](_0x17344a);}else{if(_0x17344a===0x1f4){_0x57977d[_0x8e55('0x22')](_0x17344a)[_0x8e55('0x2b')](_0x598d38);}else{_0x57977d[_0x8e55('0x22')](_0x17344a)[_0x8e55('0x1d')](_0x598d38);}}});};exports[_0x8e55('0x8e')]=function(_0x5d9897,_0x4180ae){var _0x43819a={};var _0x259910={};var _0x1c3014;var _0x4d4720;return db['MailAccount'][_0x8e55('0x57')]({'where':{'id':_0x5d9897[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x4180ae,null))['then'](function(_0x27126f){if(_0x27126f){_0x1c3014=_0x27126f;_0x259910['model']=_['keys'](db[_0x8e55('0x8b')]['rawAttributes']);_0x259910[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0x5d9897['query']);_0x259910['filters']=_[_0x8e55('0x37')](_0x259910[_0x8e55('0x32')],_0x259910['query']);_0x43819a['attributes']=_[_0x8e55('0x37')](_0x259910['model'],qs['fields'](_0x5d9897['query']['fields']));_0x43819a[_0x8e55('0x38')]=_0x43819a[_0x8e55('0x38')]['length']?_0x43819a[_0x8e55('0x38')]:_0x259910['model'];_0x43819a[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0x5d9897[_0x8e55('0x34')][_0x8e55('0x3d')]);_0x43819a[_0x8e55('0x40')]=qs[_0x8e55('0x36')](_[_0x8e55('0x3e')](_0x5d9897[_0x8e55('0x34')],_0x259910[_0x8e55('0x36')]));if(_0x5d9897[_0x8e55('0x34')][_0x8e55('0x3f')]){_0x43819a[_0x8e55('0x40')]=_[_0x8e55('0x41')](_0x43819a[_0x8e55('0x40')],{'$or':_[_0x8e55('0x33')](_0x43819a[_0x8e55('0x38')],function(_0x4ea3f7){var _0x1a7ffc={};_0x1a7ffc[_0x4ea3f7]={'$like':'%'+_0x5d9897[_0x8e55('0x34')][_0x8e55('0x3f')]+'%'};return _0x1a7ffc;})});}_0x43819a=_[_0x8e55('0x41')]({},_0x43819a,_0x5d9897[_0x8e55('0x43')]);return _0x1c3014['getApplications'](_0x43819a);}})[_0x8e55('0x10')](function(_0x43faf7){if(_0x43faf7){_0x4d4720=_0x43faf7[_0x8e55('0x3a')];if(!_0x5d9897[_0x8e55('0x34')][_0x8e55('0x3b')](_0x8e55('0x3c'))){_0x43819a[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0x5d9897[_0x8e55('0x34')]['limit']);_0x43819a[_0x8e55('0x1e')]=qs['offset'](_0x5d9897[_0x8e55('0x34')]['offset']);}return _0x1c3014[_0x8e55('0x8e')](_0x43819a);}})[_0x8e55('0x10')](function(_0x1f3694){if(_0x1f3694){return _0x1f3694?{'count':_0x4d4720,'rows':_0x1f3694}:null;}})[_0x8e55('0x10')](respondWithResult(_0x4180ae,null))[_0x8e55('0x1a')](handleError(_0x4180ae,null));};exports['getMessages']=function(_0xb2229e,_0x58db12){var _0x299d83={'raw':!![],'where':{}};var _0x57440b={};var _0x1f1a20={'count':0x0,'rows':[]};return db['MailAccount'][_0x8e55('0x57')]({'where':{'id':_0xb2229e['params']['id']}})['then'](handleEntityNotFound(_0x58db12,null))[_0x8e55('0x10')](function(_0x3a6f29){if(_0x3a6f29){_0x57440b['model']=_[_0x8e55('0x35')](db[_0x8e55('0x8f')][_0x8e55('0x4c')]);_0x57440b['query']=_[_0x8e55('0x35')](_0xb2229e[_0x8e55('0x34')]);_0x57440b[_0x8e55('0x36')]=_[_0x8e55('0x37')](_0x57440b[_0x8e55('0x32')],_0x57440b[_0x8e55('0x34')]);_0x299d83[_0x8e55('0x38')]=_[_0x8e55('0x37')](_0x57440b['model'],qs[_0x8e55('0x39')](_0xb2229e['query']['fields']));_0x299d83[_0x8e55('0x38')]=_0x299d83[_0x8e55('0x38')][_0x8e55('0x3a')]?_0x299d83[_0x8e55('0x38')]:_0x57440b[_0x8e55('0x32')];if(!_0xb2229e[_0x8e55('0x34')][_0x8e55('0x3b')]('nolimit')){_0x299d83[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0xb2229e['query'][_0x8e55('0x20')]);_0x299d83[_0x8e55('0x1e')]=qs['offset'](_0xb2229e[_0x8e55('0x34')][_0x8e55('0x1e')]);}_0x299d83[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0xb2229e['query'][_0x8e55('0x3d')]);_0x299d83[_0x8e55('0x40')]=qs[_0x8e55('0x36')](_[_0x8e55('0x3e')](_0xb2229e['query'],_0x57440b[_0x8e55('0x36')]));_0x299d83['where'][_0x8e55('0x53')]=_0x3a6f29['id'];if(_0xb2229e['query'][_0x8e55('0x3f')]){_0x299d83[_0x8e55('0x40')]=_[_0x8e55('0x41')](_0x299d83[_0x8e55('0x40')],{'$or':_['map'](_0x299d83[_0x8e55('0x38')],function(_0x14c0b7){var _0x3a6e00={};_0x3a6e00[_0x14c0b7]={'$like':'%'+_0xb2229e[_0x8e55('0x34')][_0x8e55('0x3f')]+'%'};return _0x3a6e00;})});}if(_0xb2229e[_0x8e55('0x34')][_0x8e55('0x90')]){var _0x3a0caf=_0xb2229e[_0x8e55('0x34')]['$gte']['split'](',');var _0x235d30={};_0x235d30[_0x3a0caf[0x0]]={'$gte':moment(_0x3a0caf[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x299d83[_0x8e55('0x40')]=_[_0x8e55('0x41')](_0x299d83['where'],_0x235d30);}_0x299d83=_[_0x8e55('0x41')]({},_0x299d83,_0xb2229e[_0x8e55('0x43')]);return db['MailMessage'][_0x8e55('0x21')]({'where':_0x299d83[_0x8e55('0x40')]})[_0x8e55('0x10')](function(_0x1a9784){_0x1f1a20[_0x8e55('0x21')]=_0x1a9784;if(_0xb2229e['query'][_0x8e55('0x45')]){_0x299d83['include']=[{'all':!![]}];}return db['MailMessage'][_0x8e55('0x46')](_0x299d83);})['then'](function(_0x2d0b52){if(_0xb2229e['query'][_0x8e55('0x91')]===_0x8e55('0x92')){for(var _0x33e2d6=0x0;_0x33e2d6<_0x2d0b52[_0x8e55('0x3a')];_0x33e2d6++){_0x2d0b52[_0x33e2d6][_0x8e55('0x4f')]=juice(_0x2d0b52[_0x33e2d6]['body']);}}_0x1f1a20['rows']=_0x2d0b52;return _0x1f1a20;});}})[_0x8e55('0x10')](respondWithFilteredResult(_0x58db12,_0x299d83))['catch'](handleError(_0x58db12,null));};exports['send']=function(_0x2ac9bd,_0x4ea4f0){var _0x239f33,_0x386bf6={},_0x35fada;if(_0x2ac9bd['body']['to']){_0x35fada=_0x2ac9bd['body']['to'][_0x8e55('0x93')](',')[0x0];}return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x2ac9bd[_0x8e55('0x48')]['id']},'include':[{'model':db[_0x8e55('0x94')],'as':_0x8e55('0x95'),'include':[{'model':db['CmContact'],'as':_0x8e55('0x96'),'where':{'email':_0x35fada},'limit':0x1,'order':[[_0x8e55('0x97'),_0x8e55('0x98')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x8e55('0x10')](handleEntityNotFound(_0x4ea4f0,null))['then'](function(_0x48faec){if(_0x48faec){_0x239f33=_0x48faec;if(_0x48faec[_0x8e55('0x4a')]){if(_['isNil'](_0x2ac9bd[_0x8e55('0x4f')]['from'])){_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0x99')]=util[_0x8e55('0x9a')](_0x8e55('0x9b'),_0x48faec['name'],_0x48faec[_0x8e55('0x60')]||_0x48faec[_0x8e55('0x4a')][_0x8e55('0x64')]);}if(_0x2ac9bd[_0x8e55('0x4f')]['attachments']&&_0x2ac9bd[_0x8e55('0x4f')]['attachments'][_0x8e55('0x3a')]){for(var _0x3c09e1=0x0;_0x3c09e1<_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0x9c')][_0x8e55('0x3a')];_0x3c09e1+=0x1){_0x2ac9bd[_0x8e55('0x4f')]['attachments'][_0x3c09e1]={'filename':_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0x9c')][_0x3c09e1][_0x8e55('0x2a')],'path':path[_0x8e55('0x9d')](config['root'],_0x8e55('0x9e'),_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0x9c')][_0x3c09e1][_0x8e55('0x9f')])};}}var _0x3c6a9b={'tls':{'rejectUnauthorized':![]}};if(_[_0x8e55('0x61')](_0x48faec[_0x8e55('0x4a')][_0x8e55('0x68')])){if(_0x48faec['Smtp'][_0x8e55('0x6b')]){_0x3c6a9b['auth']={'user':_0x48faec[_0x8e55('0x4a')][_0x8e55('0x64')],'pass':_0x48faec[_0x8e55('0x4a')][_0x8e55('0x67')]};}_0x3c6a9b[_0x8e55('0x69')]=_0x48faec[_0x8e55('0x4a')]['host'];_0x3c6a9b[_0x8e55('0x6a')]=_0x48faec[_0x8e55('0x4a')][_0x8e55('0x6a')];_0x3c6a9b[_0x8e55('0xa0')]=_0x48faec['Smtp'][_0x8e55('0xa0')];}else{_0x3c6a9b[_0x8e55('0x68')]=_0x48faec[_0x8e55('0x4a')][_0x8e55('0x68')];_0x3c6a9b[_0x8e55('0xa1')]={'user':_0x48faec[_0x8e55('0x4a')]['user'],'pass':_0x48faec[_0x8e55('0x4a')]['pass']};}return respondWithRpcPromise(_0x8e55('0xa2'),_0x8e55('0xa3'),{'account':_0x3c6a9b,'message':_0x2ac9bd[_0x8e55('0x4f')]});}else{throw new Error(_0x8e55('0xa4'));}}})[_0x8e55('0x10')](function(_0x42fdc2){if(_0x42fdc2){_0x386bf6=_0x42fdc2;if(_0x239f33[_0x8e55('0x95')]){if(_0x239f33['List'][_0x8e55('0x96')][_0x8e55('0x3a')]){return _0x239f33[_0x8e55('0x95')][_0x8e55('0x96')][0x0];}else{return db[_0x8e55('0x7c')][_0x8e55('0x55')](_[_0x8e55('0xa')](_0x2ac9bd[_0x8e55('0x4f')],{'firstName':_0x2ac9bd[_0x8e55('0x4f')]['to'],'email':_0x2ac9bd['body']['to'],'phone':_0x2ac9bd[_0x8e55('0x4f')]['to'],'ListId':_0x239f33[_0x8e55('0xa5')]}));}}else{throw new Error(_0x8e55('0xa4'));}}})[_0x8e55('0x10')](function(_0x1658ca){if(_0x1658ca){var _0x10a47a={'UserId':_0x2ac9bd[_0x8e55('0x64')]['id'],'ContactId':_0x1658ca['id'],'MailAccountId':_0x239f33['id'],'inReplyTo':_0x386bf6['messageId'],'to':_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0x99')],'cc':_0x2ac9bd[_0x8e55('0x4f')]['cc'],'subject':_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0xa6')],'attach':_0x2ac9bd['body'][_0x8e55('0xa7')],'firstMsgDirection':_0x8e55('0xa8'),'lastMsgAt':moment()[_0x8e55('0x9a')](_0x8e55('0xa9')),'lastMsgDirection':_0x8e55('0xa8'),'Messages':[_[_0x8e55('0x41')](_0x2ac9bd[_0x8e55('0x4f')],{'messageId':_0x386bf6['messageId'],'sentAt':moment()['format'](_0x8e55('0xa9')),'read':!![],'MailAccountId':_0x239f33['id'],'UserId':_0x2ac9bd[_0x8e55('0x64')]['id'],'ContactId':_0x1658ca['id']})]};if(_0x2ac9bd[_0x8e55('0x4f')][_0x8e55('0xaa')]){_0x10a47a=_[_0x8e55('0x41')](_0x10a47a,_0x2ac9bd[_0x8e55('0x4f')]['Interaction']);}return db[_0x8e55('0x77')]['create'](_0x10a47a,{'include':[{'model':db[_0x8e55('0x8f')],'as':_0x8e55('0xab')}]});}})[_0x8e55('0x10')](respondWithResult(_0x4ea4f0,null))[_0x8e55('0x1a')](handleError(_0x4ea4f0,null));};exports['verifySmtp']=function(_0x2f30f9,_0x1493e3){return db[_0x8e55('0x44')][_0x8e55('0x4e')]({'where':{'id':_0x2f30f9[_0x8e55('0x48')]['id']},'include':[{'model':db[_0x8e55('0x2e')],'as':_0x8e55('0x4a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8e55('0xac'),'raw':!![]}]}]})[_0x8e55('0x10')](handleEntityNotFound(_0x1493e3,null))['then'](function(_0x32a3ba){if(!_0x32a3ba[_0x8e55('0x4a')])return;var _0x27413e={'id':_0x32a3ba['id'],'tls':{'rejectUnauthorized':![]}};if(_0x32a3ba[_0x8e55('0x5f')]!==_0x8e55('0x5e')){_0x27413e[_0x8e55('0x68')]=_0x32a3ba[_0x8e55('0x5f')];}else{_0x27413e[_0x8e55('0x69')]=_0x32a3ba[_0x8e55('0x4a')][_0x8e55('0x69')];_0x27413e[_0x8e55('0x6a')]=_0x32a3ba['Smtp'][_0x8e55('0x6a')];_0x27413e['secure']=_0x32a3ba[_0x8e55('0x4a')][_0x8e55('0xa0')];}if(_0x32a3ba['Smtp'][_0x8e55('0x6b')]){if(_0x32a3ba['Smtp'][_0x8e55('0x50')]){_0x27413e['auth']={'type':'OAuth2','user':_0x32a3ba['Smtp'][_0x8e55('0x64')],'accessToken':_0x32a3ba[_0x8e55('0x4a')][_0x8e55('0xac')][_0x8e55('0xad')]};}else{_0x27413e[_0x8e55('0xa1')]={'user':_0x32a3ba[_0x8e55('0x4a')][_0x8e55('0x64')],'pass':_0x32a3ba['Smtp'][_0x8e55('0x67')]};}}return respondWithRpcPromise(_0x8e55('0xae'),_0x8e55('0xaf'),{'account':_0x27413e});})[_0x8e55('0x10')](respondWithResult(_0x1493e3,null))[_0x8e55('0x1a')](handleError(_0x1493e3,null));};exports[_0x8e55('0x28')]=function(_0x23120e,_0xe49095){return db['MailAccount'][_0x8e55('0x4e')]({'where':{'id':_0x23120e[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0xe49095,null))['then'](function(_0x1296c1){if(_0x1296c1&&_0x1296c1['service']){throw new db['Sequelize'][(_0x8e55('0xb0'))](_0x8e55('0xb1'));}return _0x1296c1;})[_0x8e55('0x10')](removeEntity(_0xe49095,null))[_0x8e55('0x1a')](handleError(_0xe49095,null));};exports[_0x8e55('0xb2')]=function(_0xdeb432,_0x38264c){return db[_0x8e55('0x44')]['find']({'where':{'id':_0xdeb432[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x38264c,null))[_0x8e55('0x10')](function(_0xb42697){if(_0xb42697){return _0xb42697[_0x8e55('0xb2')](_0xdeb432['body'][_0x8e55('0x79')],_[_0x8e55('0x7a')](_0xdeb432[_0x8e55('0x4f')],[_0x8e55('0x79'),'id'])||{})[_0x8e55('0xb3')](function(_0x3777f5){for(var _0x55c2ce=0x0;_0x55c2ce<_0xdeb432['body'][_0x8e55('0x79')]['length'];_0x55c2ce+=0x1){socket['emit'](_0x8e55('0xb4'),{'UserId':Number(_0xdeb432['body'][_0x8e55('0x79')][_0x55c2ce]),'MailAccountId':Number(_0xdeb432[_0x8e55('0x48')]['id'])});}return _0x3777f5;});}})[_0x8e55('0x10')](respondWithResult(_0x38264c,null))[_0x8e55('0x1a')](handleError(_0x38264c,null));};exports[_0x8e55('0xb5')]=function(_0x54c839,_0x324c31){return db[_0x8e55('0x44')]['find']({'where':{'id':_0x54c839[_0x8e55('0x48')]['id']}})[_0x8e55('0x10')](handleEntityNotFound(_0x324c31,null))[_0x8e55('0x10')](function(_0x3a7daa){if(_0x3a7daa){return _0x3a7daa['removeAgents'](_0x54c839[_0x8e55('0x34')]['ids'])[_0x8e55('0x10')](function(){if(_[_0x8e55('0xb6')](_0x54c839[_0x8e55('0x34')]['ids'])){for(var _0x417fa0=0x0;_0x417fa0<_0x54c839['query']['ids']['length'];_0x417fa0+=0x1){socket[_0x8e55('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x54c839[_0x8e55('0x34')][_0x8e55('0x79')][_0x417fa0]),'MailAccountId':Number(_0x54c839['params']['id'])});}}else{socket[_0x8e55('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x54c839['query'][_0x8e55('0x79')]),'MailAccountId':Number(_0x54c839[_0x8e55('0x48')]['id'])});}});}})[_0x8e55('0x10')](respondWithStatusCode(_0x324c31,null))[_0x8e55('0x1a')](handleError(_0x324c31,null));};exports[_0x8e55('0xb8')]=function(_0x233c0c,_0x1c6619){var _0x48f8fc={};var _0x56a3ed={};var _0x235ffe;var _0x455edd;return db['MailAccount'][_0x8e55('0x57')]({'where':{'id':_0x233c0c[_0x8e55('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c6619,null))[_0x8e55('0x10')](function(_0x5d79c0){if(_0x5d79c0){_0x235ffe=_0x5d79c0;_0x56a3ed[_0x8e55('0x32')]=_[_0x8e55('0x35')](db[_0x8e55('0x7e')][_0x8e55('0x4c')]);_0x56a3ed[_0x8e55('0x34')]=_[_0x8e55('0x35')](_0x233c0c[_0x8e55('0x34')]);_0x56a3ed['filters']=_[_0x8e55('0x37')](_0x56a3ed[_0x8e55('0x32')],_0x56a3ed[_0x8e55('0x34')]);_0x48f8fc[_0x8e55('0x38')]=_[_0x8e55('0x37')](_0x56a3ed['model'],qs['fields'](_0x233c0c[_0x8e55('0x34')][_0x8e55('0x39')]));_0x48f8fc[_0x8e55('0x38')]=_0x48f8fc[_0x8e55('0x38')]['length']?_0x48f8fc[_0x8e55('0x38')]:_0x56a3ed[_0x8e55('0x32')];_0x48f8fc[_0x8e55('0x58')]=qs[_0x8e55('0x3d')](_0x233c0c[_0x8e55('0x34')]['sort']);_0x48f8fc[_0x8e55('0x40')]=qs['filters'](_[_0x8e55('0x3e')](_0x233c0c[_0x8e55('0x34')],_0x56a3ed[_0x8e55('0x36')]));if(_0x233c0c[_0x8e55('0x34')][_0x8e55('0x3f')]){_0x48f8fc[_0x8e55('0x40')]=_['merge'](_0x48f8fc[_0x8e55('0x40')],{'$or':_[_0x8e55('0x33')](_0x48f8fc[_0x8e55('0x38')],function(_0x1ff9ee){var _0x23e31f={};_0x23e31f[_0x1ff9ee]={'$like':'%'+_0x233c0c[_0x8e55('0x34')][_0x8e55('0x3f')]+'%'};return _0x23e31f;})});}_0x48f8fc=_[_0x8e55('0x41')]({},_0x48f8fc,_0x233c0c[_0x8e55('0x43')]);return _0x235ffe[_0x8e55('0xb8')](_0x48f8fc);}})[_0x8e55('0x10')](function(_0x3f52e8){if(_0x3f52e8){_0x455edd=_0x3f52e8['length'];if(!_0x233c0c[_0x8e55('0x34')][_0x8e55('0x3b')]('nolimit')){_0x48f8fc[_0x8e55('0x20')]=qs[_0x8e55('0x20')](_0x233c0c[_0x8e55('0x34')][_0x8e55('0x20')]);_0x48f8fc[_0x8e55('0x1e')]=qs['offset'](_0x233c0c[_0x8e55('0x34')][_0x8e55('0x1e')]);}return _0x235ffe[_0x8e55('0xb8')](_0x48f8fc);}})[_0x8e55('0x10')](function(_0x468c38){if(_0x468c38){return _0x468c38?{'count':_0x455edd,'rows':_0x468c38}:null;}})['then'](respondWithResult(_0x1c6619,null))[_0x8e55('0x1a')](handleError(_0x1c6619,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 36772d4..4a847a7 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 _0xb758=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount'];(function(_0x4d52b2,_0x486346){var _0x4b8bae=function(_0x814d2){while(--_0x814d2){_0x4d52b2['push'](_0x4d52b2['shift']());}};_0x4b8bae(++_0x486346);}(_0xb758,0x14a));var _0x8b75=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0xb758[_0x35f83e];return _0x249b05;};'use strict';var EventEmitter=require(_0x8b75('0x0'));var MailAccount=require(_0x8b75('0x1'))['db'][_0x8b75('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8b75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b75('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa6631){return function(_0x5c78b6,_0x84ef8c,_0x13929f){MailAccountEvents['emit'](_0xa6631+':'+_0x5c78b6['id'],_0x5c78b6);MailAccountEvents[_0x8b75('0x5')](_0xa6631,_0x5c78b6);_0x13929f(null);};}for(var e in events){if(events[_0x8b75('0x6')](e)){var event=events[e];MailAccount[_0x8b75('0x7')](e,emitEvent(event));}}module[_0x8b75('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x9d56=['events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14ac34,_0x8931b5){var _0x490418=function(_0x89e929){while(--_0x89e929){_0x14ac34['push'](_0x14ac34['shift']());}};_0x490418(++_0x8931b5);}(_0x9d56,0x122));var _0x69d5=function(_0x36b172,_0x162d15){_0x36b172=_0x36b172-0x0;var _0x1e98cd=_0x9d56[_0x36b172];return _0x1e98cd;};'use strict';var EventEmitter=require(_0x69d5('0x0'));var MailAccount=require(_0x69d5('0x1'))['db'][_0x69d5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x69d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x69d5('0x4'),'afterDestroy':_0x69d5('0x5')};function emitEvent(_0x19fdd4){return function(_0x447f18,_0x2d665e,_0x54d947){MailAccountEvents[_0x69d5('0x6')](_0x19fdd4+':'+_0x447f18['id'],_0x447f18);MailAccountEvents[_0x69d5('0x6')](_0x19fdd4,_0x447f18);_0x54d947(null);};}for(var e in events){if(events[_0x69d5('0x7')](e)){var event=events[e];MailAccount[_0x69d5('0x8')](e,emitEvent(event));}}module[_0x69d5('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index bbb3367..309ac70 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 _0x3fd9=['path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4c7228,_0x1aaba8){var _0x3cf548=function(_0x97e180){while(--_0x97e180){_0x4c7228['push'](_0x4c7228['shift']());}};_0x3cf548(++_0x1aaba8);}(_0x3fd9,0x133));var _0x93fd=function(_0x161df0,_0x5e9780){_0x161df0=_0x161df0-0x0;var _0x30794c=_0x3fd9[_0x161df0];return _0x30794c;};'use strict';var _=require(_0x93fd('0x0'));var util=require('util');var logger=require(_0x93fd('0x1'))(_0x93fd('0x2'));var moment=require('moment');var BPromise=require(_0x93fd('0x3'));var rp=require(_0x93fd('0x4'));var fs=require('fs');var path=require(_0x93fd('0x5'));var rimraf=require(_0x93fd('0x6'));var config=require('../../config/environment');var attributes=require(_0x93fd('0x7'));module[_0x93fd('0x8')]=function(_0x95f307,_0x11c105){return _0x95f307[_0x93fd('0x9')](_0x93fd('0xa'),attributes,{'tableName':_0x93fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5257=['mail_accounts','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x1811e0,_0x487da0){var _0x3ce439=function(_0x1abaf6){while(--_0x1abaf6){_0x1811e0['push'](_0x1811e0['shift']());}};_0x3ce439(++_0x487da0);}(_0x5257,0x115));var _0x7525=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5257[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7525('0x0'))(_0x7525('0x1'));var moment=require(_0x7525('0x2'));var BPromise=require('bluebird');var rp=require(_0x7525('0x3'));var fs=require('fs');var path=require(_0x7525('0x4'));var rimraf=require(_0x7525('0x5'));var config=require(_0x7525('0x6'));var attributes=require(_0x7525('0x7'));module[_0x7525('0x8')]=function(_0x1c1eaa,_0x291224){return _0x1c1eaa[_0x7525('0x9')](_0x7525('0xa'),attributes,{'tableName':_0x7525('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e4af24f..6c0b971 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 _0xde05=['unshift','agent','name','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','include','map','attributes','model','ShowMailAccount','find','NotifyMailAccount','body','difference','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','updatedAt','DESC','MailApplication','Applications','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','close','Contacts','create','List\x20not\x20found','contact','generate','subject','format','MailInteraction','MailMessage','Messages','messageId','inReplyTo','Contact\x20not\x20found','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User'];(function(_0x37a69b,_0x2507ed){var _0x3e65bf=function(_0x1be788){while(--_0x1be788){_0x37a69b['push'](_0x37a69b['shift']());}};_0x3e65bf(++_0x2507ed);}(_0xde05,0x1aa));var _0x5de0=function(_0x4433c6,_0x531a2a){_0x4433c6=_0x4433c6-0x0;var _0x3589c0=_0xde05[_0x4433c6];return _0x3589c0;};'use strict';var _=require(_0x5de0('0x0'));var util=require(_0x5de0('0x1'));var moment=require(_0x5de0('0x2'));var BPromise=require(_0x5de0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5de0('0x4'));var db=require(_0x5de0('0x5'))['db'];var utils=require(_0x5de0('0x6'));var logger=require(_0x5de0('0x7'))(_0x5de0('0x8'));var config=require('../../config/environment');var jayson=require(_0x5de0('0x9'));var client=jayson[_0x5de0('0xa')][_0x5de0('0xb')]({'port':0x232c});config[_0x5de0('0xc')]=_[_0x5de0('0xd')](config['redis'],{'host':_0x5de0('0xe'),'port':0x18eb});var socket=require(_0x5de0('0xf'))(new Redis(config[_0x5de0('0xc')]));require(_0x5de0('0x10'))[_0x5de0('0x11')](socket);function respondWithRpcPromise(_0x114bc,_0x1d0aca,_0x4ba373){return new BPromise(function(_0x24b200,_0x25cb53){return client[_0x5de0('0x12')](_0x114bc,_0x4ba373)[_0x5de0('0x13')](function(_0x2cfe1f){logger[_0x5de0('0x14')](_0x5de0('0x15'),_0x1d0aca,_0x5de0('0x16'));logger[_0x5de0('0x17')](_0x5de0('0x18'),_0x1d0aca,'request\x20sent',JSON[_0x5de0('0x19')](_0x2cfe1f));if(_0x2cfe1f[_0x5de0('0x1a')]){if(_0x2cfe1f[_0x5de0('0x1a')][_0x5de0('0x1b')]===0x1f4){logger[_0x5de0('0x1a')](_0x5de0('0x15'),_0x1d0aca,_0x2cfe1f[_0x5de0('0x1a')][_0x5de0('0x1c')]);return _0x25cb53(_0x2cfe1f['error'][_0x5de0('0x1c')]);}logger[_0x5de0('0x1a')](_0x5de0('0x15'),_0x1d0aca,_0x2cfe1f[_0x5de0('0x1a')][_0x5de0('0x1c')]);return _0x24b200(_0x2cfe1f[_0x5de0('0x1a')]['message']);}else{logger[_0x5de0('0x14')](_0x5de0('0x15'),_0x1d0aca,_0x5de0('0x16'));_0x24b200(_0x2cfe1f['result']['message']);}})[_0x5de0('0x1d')](function(_0x2bb1f4){logger[_0x5de0('0x1a')](_0x5de0('0x15'),_0x1d0aca,_0x2bb1f4);_0x25cb53(_0x2bb1f4);});});}exports[_0x5de0('0x1e')]=function(_0x8aefb){var _0x198d47=this;return new Promise(function(_0x524519,_0x16666a){return db[_0x5de0('0x1f')][_0x5de0('0x20')]({'raw':_0x8aefb[_0x5de0('0x21')]?_0x8aefb[_0x5de0('0x21')][_0x5de0('0x22')]===undefined?!![]:![]:!![],'where':_0x8aefb['options']?_0x8aefb['options']['where']||null:null,'attributes':_0x8aefb['options']?_0x8aefb[_0x5de0('0x21')]['attributes']||null:null,'limit':_0x8aefb['options']?_0x8aefb[_0x5de0('0x21')]['limit']||null:null,'include':_0x8aefb[_0x5de0('0x21')]?_0x8aefb[_0x5de0('0x21')][_0x5de0('0x23')]?_[_0x5de0('0x24')](_0x8aefb[_0x5de0('0x21')][_0x5de0('0x23')],function(_0x89aec9){return{'model':db[_0x89aec9['model']],'as':_0x89aec9['as'],'attributes':_0x89aec9[_0x5de0('0x25')],'include':_0x89aec9[_0x5de0('0x23')]?_[_0x5de0('0x24')](_0x89aec9[_0x5de0('0x23')],function(_0x9fa034){return{'model':db[_0x9fa034[_0x5de0('0x26')]],'as':_0x9fa034['as'],'attributes':_0x9fa034[_0x5de0('0x25')],'include':_0x9fa034[_0x5de0('0x23')]?_[_0x5de0('0x24')](_0x9fa034[_0x5de0('0x23')],function(_0x146c72){return{'model':db[_0x146c72['model']],'as':_0x146c72['as'],'attributes':_0x146c72['attributes']};}):[]};}):[]};}):[]:[]})[_0x5de0('0x13')](function(_0x36346){logger[_0x5de0('0x14')](_0x5de0('0x1e'),_0x8aefb);logger[_0x5de0('0x17')](_0x5de0('0x1e'),_0x8aefb,JSON[_0x5de0('0x19')](_0x36346));_0x524519(_0x36346);})[_0x5de0('0x1d')](function(_0x216179){logger[_0x5de0('0x1a')](_0x5de0('0x1e'),_0x216179[_0x5de0('0x1c')],_0x8aefb);_0x16666a(_0x198d47[_0x5de0('0x1a')](0x1f4,_0x216179['message']));});});};exports[_0x5de0('0x27')]=function(_0x2c7538){var _0x30438e=this;return new Promise(function(_0x770c17,_0x52b0ea){return db['MailAccount'][_0x5de0('0x28')]({'raw':_0x2c7538['options']?_0x2c7538[_0x5de0('0x21')][_0x5de0('0x22')]===undefined?!![]:![]:!![],'where':_0x2c7538[_0x5de0('0x21')]?_0x2c7538[_0x5de0('0x21')]['where']||null:null,'attributes':_0x2c7538['options']?_0x2c7538['options']['attributes']||null:null,'include':_0x2c7538[_0x5de0('0x21')]?_0x2c7538['options'][_0x5de0('0x23')]?_[_0x5de0('0x24')](_0x2c7538['options']['include'],function(_0x4d1bb4){return{'model':db[_0x4d1bb4[_0x5de0('0x26')]],'as':_0x4d1bb4['as'],'attributes':_0x4d1bb4[_0x5de0('0x25')],'include':_0x4d1bb4[_0x5de0('0x23')]?_[_0x5de0('0x24')](_0x4d1bb4[_0x5de0('0x23')],function(_0x16ad33){return{'model':db[_0x16ad33[_0x5de0('0x26')]],'as':_0x16ad33['as'],'attributes':_0x16ad33[_0x5de0('0x25')],'include':_0x16ad33['include']?_['map'](_0x16ad33[_0x5de0('0x23')],function(_0x3e582f){return{'model':db[_0x3e582f[_0x5de0('0x26')]],'as':_0x3e582f['as'],'attributes':_0x3e582f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1565c1){logger[_0x5de0('0x14')](_0x5de0('0x27'),_0x2c7538);logger[_0x5de0('0x17')](_0x5de0('0x27'),_0x2c7538,JSON[_0x5de0('0x19')](_0x1565c1));_0x770c17(_0x1565c1);})[_0x5de0('0x1d')](function(_0x2e47b4){logger[_0x5de0('0x1a')](_0x5de0('0x27'),_0x2e47b4[_0x5de0('0x1c')],_0x2c7538);_0x52b0ea(_0x30438e[_0x5de0('0x1a')](0x1f4,_0x2e47b4['message']));});});};exports[_0x5de0('0x29')]=function(_0x59ca3f){var _0x50a341=this;return new Promise(function(_0x28af2a,_0x356db9){var _0x1c0d4c={'body':_0x59ca3f[_0x5de0('0x2a')],'channel':'mail'};var _0xcd953=_[_0x5de0('0x2b')](_['keys'](db[_0x5de0('0x2c')][_0x5de0('0x2d')]),[_0x5de0('0x2e'),'updatedAt',_0x5de0('0x2f'),_0x5de0('0x30')]);var _0x1d0735=![];if(_0x59ca3f[_0x5de0('0x2a')]['id']){delete _0x59ca3f[_0x5de0('0x2a')]['id'];}if(_[_0x5de0('0x31')](_0x59ca3f['body'][_0x5de0('0x32')])){return _0x356db9(_0x50a341[_0x5de0('0x1a')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x5de0('0x31')](_0x59ca3f[_0x5de0('0x2a')]['body'])||_0x59ca3f[_0x5de0('0x2a')]['body']===''){return _0x356db9(_0x50a341[_0x5de0('0x1a')](0x1f4,_0x5de0('0x33')));}if(_[_0x5de0('0x31')](_0x59ca3f['body'][_0x5de0('0x34')])){return _0x356db9(_0x50a341[_0x5de0('0x1a')](0x1f4,_0x5de0('0x35')+_0xcd953));}if(!_[_0x5de0('0x36')](_0xcd953,_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x34')])){return _0x356db9(_0x50a341[_0x5de0('0x1a')](0x1f4,_0x5de0('0x37')+_0xcd953));}var _0x5adedd={};_0x5adedd[_0x59ca3f['body'][_0x5de0('0x34')]]=_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x32')];return db[_0x5de0('0x1f')][_0x5de0('0x28')]({'where':{'id':_0x59ca3f[_0x5de0('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x5de0('0x39'),'include':[{'model':db[_0x5de0('0x2c')],'as':'Contacts','where':_0x5adedd,'limit':0x1,'order':[[_0x5de0('0x3a'),_0x5de0('0x3b')]]}]},{'model':db[_0x5de0('0x3c')],'as':_0x5de0('0x3d')},{'model':db['MailServerOut'],'as':_0x5de0('0x3e')}]})[_0x5de0('0x13')](function(_0x1047bd){if(_0x1047bd&&_0x1047bd[_0x5de0('0x39')]){var _0x1d46d4=_0x1047bd[_0x5de0('0x3f')]({'plain':!![]});_0x1c0d4c[_0x5de0('0x38')]=_[_0x5de0('0x40')](_0x1d46d4,['Applications',_0x5de0('0x39')]);_0x1c0d4c[_0x5de0('0x41')]=_0x1d46d4[_0x5de0('0x3d')];_0x1c0d4c[_0x5de0('0x42')]=_0x1d46d4[_0x5de0('0x39')];_0x1c0d4c['applications']=_[_0x5de0('0x43')](_0x1c0d4c[_0x5de0('0x41')],[_0x5de0('0x44')],[_0x5de0('0x45')]);if(_0x1c0d4c['account']&&_0x1c0d4c[_0x5de0('0x38')][_0x5de0('0x46')]){_0x1c0d4c[_0x5de0('0x41')][_0x5de0('0x47')]({'id':0x0,'priority':_0x1c0d4c[_0x5de0('0x41')]['length']+0x1,'app':_0x5de0('0x48'),'appdata':_0x5de0('0x46'),'interval':'*,*,*,*'});}if(_0x1c0d4c['account']['Applications']){delete _0x1c0d4c[_0x5de0('0x38')][_0x5de0('0x3d')];}if(_0x1c0d4c[_0x5de0('0x38')][_0x5de0('0x39')]){delete _0x1c0d4c[_0x5de0('0x38')][_0x5de0('0x39')];}if(_0x1d46d4['List']['Contacts']['length']){return _0x1d46d4['List'][_0x5de0('0x49')][0x0];}var _0x4275a8=_[_0x5de0('0xd')](_0x59ca3f[_0x5de0('0x2a')],{'firstName':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x32')],'ListId':_0x1d46d4[_0x5de0('0x30')]});_0x4275a8[_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x34')]]=_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x32')];return db['CmContact'][_0x5de0('0x4a')](_0x4275a8);}else{throw new Error(_0x5de0('0x4b'));}})[_0x5de0('0x13')](function(_0x561500){_0x1c0d4c[_0x5de0('0x4c')]=_0x561500;if(_0x561500){if(!_0x59ca3f[_0x5de0('0x2a')]['message']['messageId']){_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['messageId']=rs[_0x5de0('0x4d')]()+'\x20'+_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x32')];}var _0x550424={'ContactId':_0x561500['id'],'MailAccountId':_0x59ca3f[_0x5de0('0x38')]['id'],'inReplyTo':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['messageId'],'to':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x32')],'cc':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['cc'],'subject':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x4e')],'attach':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['attach'],'lastMsgAt':moment()[_0x5de0('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x5de0('0x50')][_0x5de0('0x28')]({'where':{'closed':![],'MailAccountId':_0x59ca3f[_0x5de0('0x38')]['id']},'include':[{'model':db[_0x5de0('0x51')],'as':_0x5de0('0x52'),'attributes':[_0x5de0('0x53')],'where':{'messageId':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x54')]}}]})[_0x5de0('0x13')](function(_0x1605b3){if(_0x1605b3){return[_0x1605b3,![]];}return db['MailInteraction'][_0x5de0('0x4a')](_0x550424)[_0x5de0('0x13')](function(_0x35fc2b){return[_0x35fc2b,!![]];});});}else{throw new Error(_0x5de0('0x55'));}})['spread'](function(_0x1fb0c8,_0x235d3a){if(_0x1fb0c8){_0x1d0735=_0x235d3a;if(!_0x235d3a){return _0x1fb0c8['update']({'inReplyTo':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x53')],'to':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x32')],'cc':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['cc'],'subject':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x4e')],'attach':_0x1fb0c8['attach']?_0x1fb0c8[_0x5de0('0x56')]:_0x59ca3f[_0x5de0('0x2a')]['message'][_0x5de0('0x56')],'substatus':null,'substatusAt':moment()['format'](_0x5de0('0x57')),'lastMsgAt':moment()['format'](_0x5de0('0x57')),'lastMsgDirection':'in'});}else{return _0x1fb0c8;}}})[_0x5de0('0x13')](function(_0x414347){_0x1c0d4c[_0x5de0('0x58')]=_0x414347[_0x5de0('0x3f')]({'plain':!![]});_0x1c0d4c['interaction']['created']=_0x1d0735;return db[_0x5de0('0x51')][_0x5de0('0x4a')]({'body':_0x59ca3f[_0x5de0('0x2a')]['body'],'MailAccountId':_0x59ca3f['account']['id'],'MailInteractionId':_0x414347['id'],'direction':'in','ContactId':_0x1c0d4c[_0x5de0('0x4c')]['id'],'messageId':_0x59ca3f[_0x5de0('0x2a')]['message'][_0x5de0('0x53')],'from':_0x59ca3f[_0x5de0('0x2a')]['message'][_0x5de0('0x32')],'to':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')]['to'],'cc':_0x59ca3f['body'][_0x5de0('0x1c')]['cc'],'subject':_0x59ca3f['body'][_0x5de0('0x1c')][_0x5de0('0x4e')],'attach':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x56')],'Attachments':_0x59ca3f['body'][_0x5de0('0x1c')][_0x5de0('0x59')],'originTo':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x5a')],'originCc':_0x59ca3f[_0x5de0('0x2a')]['message'][_0x5de0('0x5b')],'bcc':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x5c')],'ChatWebsiteId':_0x59ca3f[_0x5de0('0x2a')]['message']['ChatWebsiteId']||null,'originChannel':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x5d')]||_0x5de0('0x5e'),'ChatOfflineMessageId':_0x59ca3f[_0x5de0('0x2a')][_0x5de0('0x1c')][_0x5de0('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x5de0('0x60')}]});})['then'](function(_0xfe4989){_0x1c0d4c['message']=_0xfe4989;if(_0x1c0d4c[_0x5de0('0x58')][_0x5de0('0x61')]){return db[_0x5de0('0x62')][_0x5de0('0x28')]({'attributes':['id','name'],'where':{'id':_0x1c0d4c[_0x5de0('0x58')][_0x5de0('0x61')]}})[_0x5de0('0x13')](function(_0x29bf11){if(_0x29bf11){_0x1c0d4c['applications'][_0x5de0('0x63')]({'id':0x0,'priority':0x0,'app':_0x5de0('0x64'),'appdata':_0x29bf11[_0x5de0('0x65')]+','+(_0x1c0d4c[_0x5de0('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x5de0('0x66')});}return respondWithRpcPromise(_0x5de0('0x67'),_0x5de0('0x68'),_0x1c0d4c);});}return respondWithRpcPromise(_0x5de0('0x67'),_0x5de0('0x68'),_0x1c0d4c);})['then'](function(_0x2d3766){_0x28af2a(_0x2d3766);})[_0x5de0('0x1d')](function(_0x9fd432){_0x356db9(_0x50a341[_0x5de0('0x1a')](0x1f4,_0x9fd432[_0x5de0('0x1c')]));});});}; \ No newline at end of file +var _0x0e70=['format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','update','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','MailAccount','options','where','limit','include','map','model','attributes','GetMailAccount','ShowMailAccount','find','raw','NotifyMailAccount','body','difference','CmContact','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','applications','list','orderBy','priority','autoclose','push','length','*,*,*,*','defaults','create','contact','messageId','generate','subject','attach'];(function(_0x70b590,_0x42347b){var _0x3ddf9f=function(_0x2f7138){while(--_0x2f7138){_0x70b590['push'](_0x70b590['shift']());}};_0x3ddf9f(++_0x42347b);}(_0x0e70,0xdc));var _0x00e7=function(_0x1187cf,_0x19848b){_0x1187cf=_0x1187cf-0x0;var _0x24a345=_0x0e70[_0x1187cf];return _0x24a345;};'use strict';var _=require(_0x00e7('0x0'));var util=require(_0x00e7('0x1'));var moment=require(_0x00e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x00e7('0x3'));var fs=require('fs');var Redis=require(_0x00e7('0x4'));var db=require(_0x00e7('0x5'))['db'];var utils=require(_0x00e7('0x6'));var logger=require(_0x00e7('0x7'))('rpc');var config=require(_0x00e7('0x8'));var jayson=require(_0x00e7('0x9'));var client=jayson['client'][_0x00e7('0xa')]({'port':0x232c});config[_0x00e7('0xb')]=_['defaults'](config[_0x00e7('0xb')],{'host':_0x00e7('0xc'),'port':0x18eb});var socket=require(_0x00e7('0xd'))(new Redis(config['redis']));require(_0x00e7('0xe'))['register'](socket);function respondWithRpcPromise(_0x562c42,_0x3285b3,_0x59eef7){return new BPromise(function(_0x1d636f,_0x2174f1){return client[_0x00e7('0xf')](_0x562c42,_0x59eef7)[_0x00e7('0x10')](function(_0x5efe6f){logger[_0x00e7('0x11')](_0x00e7('0x12'),_0x3285b3,_0x00e7('0x13'));logger[_0x00e7('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3285b3,_0x00e7('0x13'),JSON[_0x00e7('0x15')](_0x5efe6f));if(_0x5efe6f['error']){if(_0x5efe6f[_0x00e7('0x16')][_0x00e7('0x17')]===0x1f4){logger[_0x00e7('0x16')](_0x00e7('0x12'),_0x3285b3,_0x5efe6f['error'][_0x00e7('0x18')]);return _0x2174f1(_0x5efe6f['error'][_0x00e7('0x18')]);}logger[_0x00e7('0x16')](_0x00e7('0x12'),_0x3285b3,_0x5efe6f[_0x00e7('0x16')]['message']);return _0x1d636f(_0x5efe6f[_0x00e7('0x16')]['message']);}else{logger[_0x00e7('0x11')](_0x00e7('0x12'),_0x3285b3,_0x00e7('0x13'));_0x1d636f(_0x5efe6f['result'][_0x00e7('0x18')]);}})[_0x00e7('0x19')](function(_0x8547c3){logger[_0x00e7('0x16')](_0x00e7('0x12'),_0x3285b3,_0x8547c3);_0x2174f1(_0x8547c3);});});}exports['GetMailAccount']=function(_0x1c720d){var _0x1b5bc9=this;return new Promise(function(_0xd5207d,_0x54a5df){return db[_0x00e7('0x1a')]['findAll']({'raw':_0x1c720d[_0x00e7('0x1b')]?_0x1c720d[_0x00e7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1c720d['options']?_0x1c720d['options'][_0x00e7('0x1c')]||null:null,'attributes':_0x1c720d[_0x00e7('0x1b')]?_0x1c720d[_0x00e7('0x1b')]['attributes']||null:null,'limit':_0x1c720d[_0x00e7('0x1b')]?_0x1c720d[_0x00e7('0x1b')][_0x00e7('0x1d')]||null:null,'include':_0x1c720d[_0x00e7('0x1b')]?_0x1c720d[_0x00e7('0x1b')][_0x00e7('0x1e')]?_[_0x00e7('0x1f')](_0x1c720d['options'][_0x00e7('0x1e')],function(_0x3f7015){return{'model':db[_0x3f7015[_0x00e7('0x20')]],'as':_0x3f7015['as'],'attributes':_0x3f7015[_0x00e7('0x21')],'include':_0x3f7015['include']?_['map'](_0x3f7015[_0x00e7('0x1e')],function(_0x26de77){return{'model':db[_0x26de77[_0x00e7('0x20')]],'as':_0x26de77['as'],'attributes':_0x26de77[_0x00e7('0x21')],'include':_0x26de77[_0x00e7('0x1e')]?_[_0x00e7('0x1f')](_0x26de77[_0x00e7('0x1e')],function(_0xb1ba39){return{'model':db[_0xb1ba39[_0x00e7('0x20')]],'as':_0xb1ba39['as'],'attributes':_0xb1ba39[_0x00e7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x00e7('0x10')](function(_0x44d6f7){logger['info'](_0x00e7('0x22'),_0x1c720d);logger[_0x00e7('0x14')](_0x00e7('0x22'),_0x1c720d,JSON[_0x00e7('0x15')](_0x44d6f7));_0xd5207d(_0x44d6f7);})[_0x00e7('0x19')](function(_0x57e642){logger[_0x00e7('0x16')]('GetMailAccount',_0x57e642['message'],_0x1c720d);_0x54a5df(_0x1b5bc9[_0x00e7('0x16')](0x1f4,_0x57e642[_0x00e7('0x18')]));});});};exports[_0x00e7('0x23')]=function(_0x1d0fce){var _0x5608be=this;return new Promise(function(_0x2af14e,_0x230e3a){return db[_0x00e7('0x1a')][_0x00e7('0x24')]({'raw':_0x1d0fce[_0x00e7('0x1b')]?_0x1d0fce['options'][_0x00e7('0x25')]===undefined?!![]:![]:!![],'where':_0x1d0fce['options']?_0x1d0fce[_0x00e7('0x1b')][_0x00e7('0x1c')]||null:null,'attributes':_0x1d0fce[_0x00e7('0x1b')]?_0x1d0fce['options'][_0x00e7('0x21')]||null:null,'include':_0x1d0fce[_0x00e7('0x1b')]?_0x1d0fce[_0x00e7('0x1b')]['include']?_['map'](_0x1d0fce[_0x00e7('0x1b')][_0x00e7('0x1e')],function(_0x3dd29c){return{'model':db[_0x3dd29c['model']],'as':_0x3dd29c['as'],'attributes':_0x3dd29c[_0x00e7('0x21')],'include':_0x3dd29c[_0x00e7('0x1e')]?_[_0x00e7('0x1f')](_0x3dd29c[_0x00e7('0x1e')],function(_0x349455){return{'model':db[_0x349455[_0x00e7('0x20')]],'as':_0x349455['as'],'attributes':_0x349455[_0x00e7('0x21')],'include':_0x349455[_0x00e7('0x1e')]?_[_0x00e7('0x1f')](_0x349455['include'],function(_0x361036){return{'model':db[_0x361036[_0x00e7('0x20')]],'as':_0x361036['as'],'attributes':_0x361036['attributes']};}):[]};}):[]};}):[]:[]})[_0x00e7('0x10')](function(_0x516356){logger['info'](_0x00e7('0x23'),_0x1d0fce);logger[_0x00e7('0x14')](_0x00e7('0x23'),_0x1d0fce,JSON[_0x00e7('0x15')](_0x516356));_0x2af14e(_0x516356);})[_0x00e7('0x19')](function(_0x192a01){logger['error'](_0x00e7('0x23'),_0x192a01[_0x00e7('0x18')],_0x1d0fce);_0x230e3a(_0x5608be[_0x00e7('0x16')](0x1f4,_0x192a01['message']));});});};exports[_0x00e7('0x26')]=function(_0x4cbea1){var _0x10fc58=this;return new Promise(function(_0x460956,_0x3aaba2){var _0x299cbd={'body':_0x4cbea1[_0x00e7('0x27')],'channel':'mail'};var _0x34964b=_[_0x00e7('0x28')](_['keys'](db[_0x00e7('0x29')]['rawAttributes']),['createdAt',_0x00e7('0x2a'),_0x00e7('0x2b'),_0x00e7('0x2c')]);var _0x1ca0d2=![];if(_0x4cbea1[_0x00e7('0x27')]['id']){delete _0x4cbea1[_0x00e7('0x27')]['id'];}if(_[_0x00e7('0x2d')](_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x2e')])){return _0x3aaba2(_0x10fc58[_0x00e7('0x16')](0x1f4,_0x00e7('0x2f')));}if(_[_0x00e7('0x2d')](_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x27')])||_0x4cbea1['body'][_0x00e7('0x27')]===''){return _0x3aaba2(_0x10fc58[_0x00e7('0x16')](0x1f4,_0x00e7('0x30')));}if(_[_0x00e7('0x2d')](_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x31')])){return _0x3aaba2(_0x10fc58[_0x00e7('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34964b));}if(!_[_0x00e7('0x32')](_0x34964b,_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x31')])){return _0x3aaba2(_0x10fc58[_0x00e7('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34964b));}var _0x2ea73f={};_0x2ea73f[_0x4cbea1['body'][_0x00e7('0x31')]]=_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x2e')];return db['MailAccount'][_0x00e7('0x24')]({'where':{'id':_0x4cbea1[_0x00e7('0x33')]['id']},'include':[{'model':db['CmList'],'as':_0x00e7('0x34'),'include':[{'model':db['CmContact'],'as':_0x00e7('0x35'),'where':_0x2ea73f,'limit':0x1,'order':[[_0x00e7('0x2a'),_0x00e7('0x36')]]}]},{'model':db[_0x00e7('0x37')],'as':_0x00e7('0x38')},{'model':db[_0x00e7('0x39')],'as':_0x00e7('0x3a')}]})[_0x00e7('0x10')](function(_0x4e5cd9){if(_0x4e5cd9&&_0x4e5cd9[_0x00e7('0x34')]){var _0x3dc464=_0x4e5cd9['get']({'plain':!![]});_0x299cbd[_0x00e7('0x33')]=_['omit'](_0x3dc464,[_0x00e7('0x38'),_0x00e7('0x34')]);_0x299cbd[_0x00e7('0x3b')]=_0x3dc464[_0x00e7('0x38')];_0x299cbd[_0x00e7('0x3c')]=_0x3dc464[_0x00e7('0x34')];_0x299cbd[_0x00e7('0x3b')]=_[_0x00e7('0x3d')](_0x299cbd[_0x00e7('0x3b')],[_0x00e7('0x3e')],['asc']);if(_0x299cbd[_0x00e7('0x33')]&&_0x299cbd[_0x00e7('0x33')][_0x00e7('0x3f')]){_0x299cbd[_0x00e7('0x3b')][_0x00e7('0x40')]({'id':0x0,'priority':_0x299cbd[_0x00e7('0x3b')][_0x00e7('0x41')]+0x1,'app':'close','appdata':_0x00e7('0x3f'),'interval':_0x00e7('0x42')});}if(_0x299cbd[_0x00e7('0x33')][_0x00e7('0x38')]){delete _0x299cbd[_0x00e7('0x33')][_0x00e7('0x38')];}if(_0x299cbd[_0x00e7('0x33')][_0x00e7('0x34')]){delete _0x299cbd['account'][_0x00e7('0x34')];}if(_0x3dc464[_0x00e7('0x34')]['Contacts'][_0x00e7('0x41')]){return _0x3dc464[_0x00e7('0x34')]['Contacts'][0x0];}var _0x12a351=_[_0x00e7('0x43')](_0x4cbea1[_0x00e7('0x27')],{'firstName':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x2e')],'ListId':_0x3dc464[_0x00e7('0x2c')]});_0x12a351[_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x31')]]=_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x2e')];return db[_0x00e7('0x29')][_0x00e7('0x44')](_0x12a351);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x4d3f26){_0x299cbd[_0x00e7('0x45')]=_0x4d3f26;if(_0x4d3f26){if(!_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x46')]){_0x4cbea1['body'][_0x00e7('0x18')][_0x00e7('0x46')]=rs[_0x00e7('0x47')]()+'\x20'+_0x4cbea1[_0x00e7('0x27')]['message'][_0x00e7('0x2e')];}var _0x1f4e14={'ContactId':_0x4d3f26['id'],'MailAccountId':_0x4cbea1[_0x00e7('0x33')]['id'],'inReplyTo':_0x4cbea1[_0x00e7('0x27')]['message'][_0x00e7('0x46')],'to':_0x4cbea1['body'][_0x00e7('0x18')][_0x00e7('0x2e')],'cc':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')]['cc'],'subject':_0x4cbea1[_0x00e7('0x27')]['message'][_0x00e7('0x48')],'attach':_0x4cbea1['body'][_0x00e7('0x18')][_0x00e7('0x49')],'lastMsgAt':moment()[_0x00e7('0x4a')](_0x00e7('0x4b')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x4cbea1[_0x00e7('0x33')]['id']},'include':[{'model':db[_0x00e7('0x4c')],'as':_0x00e7('0x4d'),'attributes':[_0x00e7('0x46')],'where':{'messageId':_0x4cbea1['body'][_0x00e7('0x18')][_0x00e7('0x4e')]}}]})[_0x00e7('0x10')](function(_0x14d829){if(_0x14d829){return[_0x14d829,![]];}return db[_0x00e7('0x4f')][_0x00e7('0x44')](_0x1f4e14)[_0x00e7('0x10')](function(_0x36e20c){return[_0x36e20c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5850c5,_0x4c44cf){if(_0x5850c5){_0x1ca0d2=_0x4c44cf;if(!_0x4c44cf){return _0x5850c5[_0x00e7('0x50')]({'inReplyTo':_0x4cbea1[_0x00e7('0x27')]['message'][_0x00e7('0x46')],'to':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x2e')],'cc':_0x4cbea1[_0x00e7('0x27')]['message']['cc'],'subject':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x48')],'attach':_0x5850c5['attach']?_0x5850c5[_0x00e7('0x49')]:_0x4cbea1['body'][_0x00e7('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0x00e7('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x00e7('0x4a')](_0x00e7('0x4b')),'lastMsgDirection':'in'});}else{return _0x5850c5;}}})[_0x00e7('0x10')](function(_0x4fa0c6){_0x299cbd[_0x00e7('0x51')]=_0x4fa0c6['get']({'plain':!![]});_0x299cbd[_0x00e7('0x51')][_0x00e7('0x52')]=_0x1ca0d2;return db[_0x00e7('0x4c')]['create']({'body':_0x4cbea1['body'][_0x00e7('0x27')],'MailAccountId':_0x4cbea1['account']['id'],'MailInteractionId':_0x4fa0c6['id'],'direction':'in','ContactId':_0x299cbd['contact']['id'],'messageId':_0x4cbea1[_0x00e7('0x27')]['message']['messageId'],'from':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')]['from'],'to':_0x4cbea1[_0x00e7('0x27')]['message']['to'],'cc':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')]['cc'],'subject':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x48')],'attach':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x49')],'Attachments':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x53')],'originTo':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')]['originTo'],'originCc':_0x4cbea1['body'][_0x00e7('0x18')][_0x00e7('0x54')],'bcc':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x55')],'ChatWebsiteId':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x56')]||null,'originChannel':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x57')]||_0x00e7('0x58'),'ChatOfflineMessageId':_0x4cbea1[_0x00e7('0x27')][_0x00e7('0x18')][_0x00e7('0x59')]||null},{'include':[{'model':db[_0x00e7('0x5a')],'as':'Attachments'}]});})[_0x00e7('0x10')](function(_0x32ef0e){_0x299cbd[_0x00e7('0x18')]=_0x32ef0e;if(_0x299cbd[_0x00e7('0x51')][_0x00e7('0x5b')]){return db[_0x00e7('0x5c')]['find']({'attributes':['id',_0x00e7('0x5d')],'where':{'id':_0x299cbd['interaction'][_0x00e7('0x5b')]}})[_0x00e7('0x10')](function(_0x160f63){if(_0x160f63){_0x299cbd[_0x00e7('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x00e7('0x5e'),'appdata':_0x160f63[_0x00e7('0x5d')]+','+(_0x299cbd['account'][_0x00e7('0x5f')]||0xa),'interval':_0x00e7('0x42')});}return respondWithRpcPromise(_0x00e7('0x60'),_0x00e7('0x61'),_0x299cbd);});}return respondWithRpcPromise(_0x00e7('0x60'),'startRouting',_0x299cbd);})[_0x00e7('0x10')](function(_0x2f44ec){_0x460956(_0x2f44ec);})[_0x00e7('0x19')](function(_0x5074da){_0x3aaba2(_0x10fc58['error'](0x1f4,_0x5074da[_0x00e7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 6e5e8f9..0ccc410 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 _0x04a3=['removeListener','length','./mailAccount.events','save','remove','update','emit'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x04a3,0x12f));var _0x304a=function(_0x3df3ea,_0x2ba8b9){_0x3df3ea=_0x3df3ea-0x0;var _0x24ef0c=_0x04a3[_0x3df3ea];return _0x24ef0c;};'use strict';var MailAccountEvents=require(_0x304a('0x0'));var events=[_0x304a('0x1'),_0x304a('0x2'),_0x304a('0x3')];function createListener(_0x14bdc1,_0x211c24){return function(_0x3d3bd5){_0x211c24[_0x304a('0x4')](_0x14bdc1,_0x3d3bd5);};}function removeListener(_0x4a025a,_0x43cffa){return function(){MailAccountEvents[_0x304a('0x5')](_0x4a025a,_0x43cffa);};}exports['register']=function(_0x36c356){for(var _0x326855=0x0,_0x40d808=events[_0x304a('0x6')];_0x326855<_0x40d808;_0x326855++){var _0xbcd07a=events[_0x326855];var _0x5e18e7=createListener('mailAccount:'+_0xbcd07a,_0x36c356);MailAccountEvents['on'](_0xbcd07a,_0x5e18e7);}}; \ No newline at end of file +var _0xbbce=['./mailAccount.events','update','emit','removeListener'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbbce,0xb0));var _0xebbc=function(_0x1094ff,_0x3a5fb5){_0x1094ff=_0x1094ff-0x0;var _0x40878a=_0xbbce[_0x1094ff];return _0x40878a;};'use strict';var MailAccountEvents=require(_0xebbc('0x0'));var events=['save','remove',_0xebbc('0x1')];function createListener(_0x202d3d,_0x1ef858){return function(_0x4147aa){_0x1ef858[_0xebbc('0x2')](_0x202d3d,_0x4147aa);};}function removeListener(_0x255f82,_0x5e1fcd){return function(){MailAccountEvents[_0xebbc('0x3')](_0x255f82,_0x5e1fcd);};}exports['register']=function(_0x4b667f){for(var _0x1b2057=0x0,_0xd6161c=events['length'];_0x1b2057<_0xd6161c;_0x1b2057++){var _0x39a2fe=events[_0x1b2057];var _0x2c5e72=createListener('mailAccount:'+_0x39a2fe,_0x4b667f);MailAccountEvents['on'](_0x39a2fe,_0x2c5e72);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e031339..8e2da16 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 _0xd36a=['../../config/environment','./mailApplication.controller','get','/:id','put','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0xd36a,0x105));var _0xad36=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd36a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xad36('0x0'));var util=require(_0xad36('0x1'));var path=require(_0xad36('0x2'));var timeout=require(_0xad36('0x3'));var express=require(_0xad36('0x4'));var router=express[_0xad36('0x5')]();var fs_extra=require(_0xad36('0x6'));var auth=require(_0xad36('0x7'));var interaction=require(_0xad36('0x8'));var config=require(_0xad36('0x9'));var controller=require(_0xad36('0xa'));router[_0xad36('0xb')](_0xad36('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xad36('0xd')]('/:id',auth[_0xad36('0xe')](),controller['update']);router[_0xad36('0xf')]('/:id',auth[_0xad36('0xe')](),controller[_0xad36('0x10')]);module[_0xad36('0x11')]=router; \ No newline at end of file +var _0x446f=['path','express','Router','fs-extra','../../components/auth/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','exports','multer'];(function(_0x490a39,_0x519f6d){var _0x1b24a1=function(_0x30bce2){while(--_0x30bce2){_0x490a39['push'](_0x490a39['shift']());}};_0x1b24a1(++_0x519f6d);}(_0x446f,0x77));var _0xf446=function(_0x58f55e,_0x225b7b){_0x58f55e=_0x58f55e-0x0;var _0x4c4007=_0x446f[_0x58f55e];return _0x4c4007;};'use strict';var multer=require(_0xf446('0x0'));var util=require('util');var path=require(_0xf446('0x1'));var timeout=require('connect-timeout');var express=require(_0xf446('0x2'));var router=express[_0xf446('0x3')]();var fs_extra=require(_0xf446('0x4'));var auth=require(_0xf446('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf446('0x6'));router[_0xf446('0x7')]('/:id',auth[_0xf446('0x8')](),controller[_0xf446('0x9')]);router[_0xf446('0xa')](_0xf446('0xb'),auth[_0xf446('0x8')](),controller[_0xf446('0xc')]);router['delete'](_0xf446('0xb'),auth[_0xf446('0x8')](),controller[_0xf446('0xd')]);module[_0xf446('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 30fc49f..d4dfde7 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 _0x9632=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x9ea38c,_0x9d044c){var _0x2db088=function(_0x2f82dc){while(--_0x2f82dc){_0x9ea38c['push'](_0x9ea38c['shift']());}};_0x2db088(++_0x9d044c);}(_0x9632,0x1b6));var _0x2963=function(_0x37fcfb,_0x1a1015){_0x37fcfb=_0x37fcfb-0x0;var _0x33cdae=_0x9632[_0x37fcfb];return _0x33cdae;};'use strict';var Sequelize=require(_0x2963('0x0'));module[_0x2963('0x1')]={'priority':{'type':Sequelize[_0x2963('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2963('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2963('0x3')]},'interval':{'type':Sequelize[_0x2963('0x3')],'defaultValue':_0x2963('0x4')}}; \ No newline at end of file +var _0x5386=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x3b1d7a,_0x4b18ce){var _0x3c0397=function(_0xc70984){while(--_0xc70984){_0x3b1d7a['push'](_0x3b1d7a['shift']());}};_0x3c0397(++_0x4b18ce);}(_0x5386,0x1e1));var _0x6538=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0x5386[_0x3875b1];return _0x1e9c55;};'use strict';var Sequelize=require(_0x6538('0x0'));module[_0x6538('0x1')]={'priority':{'type':Sequelize[_0x6538('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6538('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6538('0x4')]()},'description':{'type':Sequelize[_0x6538('0x3')]},'interval':{'type':Sequelize[_0x6538('0x3')],'defaultValue':_0x6538('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ab63699..820a99d 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 _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xedd9,0xfc));var _0x9edd=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0xedd9[_0x57e196];return _0x5941ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x295621,_0x4286b8){var _0x36d0dd=function(_0x51d57e){while(--_0x51d57e){_0x295621['push'](_0x295621['shift']());}};_0x36d0dd(++_0x4286b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a8dcc32..a5d1e78 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 _0x47cd=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x47cd,0xbe));var _0xd47c=function(_0x442f13,_0x397185){_0x442f13=_0x442f13-0x0;var _0x457ccd=_0x47cd[_0x442f13];return _0x457ccd;};'use strict';var _=require(_0xd47c('0x0'));var util=require(_0xd47c('0x1'));var logger=require(_0xd47c('0x2'))('api');var moment=require(_0xd47c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd47c('0x4'));var rimraf=require(_0xd47c('0x5'));var config=require(_0xd47c('0x6'));var attributes=require('./mailApplication.attributes');module[_0xd47c('0x7')]=function(_0x52ea74,_0x14349c){return _0x52ea74[_0xd47c('0x8')]('MailApplication',attributes,{'tableName':_0xd47c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd47c('0xa'),'collate':_0xd47c('0xb')});}; \ No newline at end of file +var _0x2d29=['MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x2d29,0xed));var _0x92d2=function(_0x2964f3,_0x469b63){_0x2964f3=_0x2964f3-0x0;var _0x1d7897=_0x2d29[_0x2964f3];return _0x1d7897;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x92d2('0x0'));var moment=require(_0x92d2('0x1'));var BPromise=require(_0x92d2('0x2'));var rp=require(_0x92d2('0x3'));var fs=require('fs');var path=require(_0x92d2('0x4'));var rimraf=require(_0x92d2('0x5'));var config=require(_0x92d2('0x6'));var attributes=require(_0x92d2('0x7'));module[_0x92d2('0x8')]=function(_0x2b0e42,_0x264390){return _0x2b0e42[_0x92d2('0x9')](_0x92d2('0xa'),attributes,{'tableName':_0x92d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x92d2('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6e78183..88e115c 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 _0xb042=['options','raw','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','MailApplication','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb042,0x198));var _0x2b04=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0xb042[_0x4ce028];return _0x583d0c;};'use strict';var _=require(_0x2b04('0x0'));var util=require(_0x2b04('0x1'));var moment=require(_0x2b04('0x2'));var BPromise=require(_0x2b04('0x3'));var rs=require(_0x2b04('0x4'));var fs=require('fs');var Redis=require(_0x2b04('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b04('0x6'));var logger=require(_0x2b04('0x7'))(_0x2b04('0x8'));var config=require(_0x2b04('0x9'));var jayson=require(_0x2b04('0xa'));var client=jayson[_0x2b04('0xb')][_0x2b04('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x225b13,_0x3e65c9,_0x18b9e2){return new BPromise(function(_0x2033c4,_0xdf6075){return client[_0x2b04('0xd')](_0x225b13,_0x18b9e2)[_0x2b04('0xe')](function(_0x3a8acc){logger[_0x2b04('0xf')]('MailApplication,\x20%s,\x20%s',_0x3e65c9,_0x2b04('0x10'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x3e65c9,_0x2b04('0x10'),JSON['stringify'](_0x3a8acc));if(_0x3a8acc['error']){if(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x12')]===0x1f4){logger['error'](_0x2b04('0x13'),_0x3e65c9,_0x3a8acc['error'][_0x2b04('0x14')]);return _0xdf6075(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x14')]);}logger[_0x2b04('0x11')](_0x2b04('0x13'),_0x3e65c9,_0x3a8acc['error'][_0x2b04('0x14')]);return _0x2033c4(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x14')]);}else{logger[_0x2b04('0xf')](_0x2b04('0x13'),_0x3e65c9,'request\x20sent');_0x2033c4(_0x3a8acc[_0x2b04('0x15')]['message']);}})['catch'](function(_0x21f3fa){logger['error'](_0x2b04('0x13'),_0x3e65c9,_0x21f3fa);_0xdf6075(_0x21f3fa);});});}exports[_0x2b04('0x16')]=function(_0x6b6a25){var _0x260254=this;return new Promise(function(_0x126d1a,_0x12a713){return db[_0x2b04('0x17')][_0x2b04('0x18')](_0x6b6a25[_0x2b04('0x19')],{'raw':_0x6b6a25[_0x2b04('0x1a')]?_0x6b6a25[_0x2b04('0x1a')][_0x2b04('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6b6a25[_0x2b04('0x1a')]?_0x6b6a25['options'][_0x2b04('0x1c')]||null:null,'attributes':_0x6b6a25['options']?_0x6b6a25[_0x2b04('0x1a')]['attributes']||null:null,'limit':_0x6b6a25[_0x2b04('0x1a')]?_0x6b6a25['options'][_0x2b04('0x1d')]||null:null})[_0x2b04('0xe')](function(_0x44fb4a){logger[_0x2b04('0xf')](_0x2b04('0x16'),_0x6b6a25);logger['debug'](_0x2b04('0x16'),_0x6b6a25,JSON['stringify'](_0x44fb4a));_0x126d1a(_0x44fb4a);})[_0x2b04('0x1e')](function(_0xfd8891){logger[_0x2b04('0x11')](_0x2b04('0x16'),_0xfd8891[_0x2b04('0x14')],_0x6b6a25);_0x12a713(_0x260254[_0x2b04('0x11')](0x1f4,_0xfd8891[_0x2b04('0x14')]));});});}; \ No newline at end of file +var _0xcb0e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','options','raw','where','limit','debug','lodash','util'];(function(_0x40875a,_0x1d672d){var _0x2b6730=function(_0x8e6460){while(--_0x8e6460){_0x40875a['push'](_0x40875a['shift']());}};_0x2b6730(++_0x1d672d);}(_0xcb0e,0x76));var _0xecb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb0e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xecb0('0x0'));var util=require(_0xecb0('0x1'));var moment=require(_0xecb0('0x2'));var BPromise=require(_0xecb0('0x3'));var rs=require(_0xecb0('0x4'));var fs=require('fs');var Redis=require(_0xecb0('0x5'));var db=require(_0xecb0('0x6'))['db'];var utils=require(_0xecb0('0x7'));var logger=require(_0xecb0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xecb0('0x9'));var client=jayson[_0xecb0('0xa')][_0xecb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x158d56,_0x13345d,_0x1a21f7){return new BPromise(function(_0x2cf053,_0x53964f){return client[_0xecb0('0xc')](_0x158d56,_0x1a21f7)[_0xecb0('0xd')](function(_0x3aec48){logger[_0xecb0('0xe')](_0xecb0('0xf'),_0x13345d,_0xecb0('0x10'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x13345d,_0xecb0('0x10'),JSON[_0xecb0('0x11')](_0x3aec48));if(_0x3aec48[_0xecb0('0x12')]){if(_0x3aec48[_0xecb0('0x12')][_0xecb0('0x13')]===0x1f4){logger[_0xecb0('0x12')]('MailApplication,\x20%s,\x20%s',_0x13345d,_0x3aec48[_0xecb0('0x12')][_0xecb0('0x14')]);return _0x53964f(_0x3aec48['error'][_0xecb0('0x14')]);}logger['error'](_0xecb0('0xf'),_0x13345d,_0x3aec48[_0xecb0('0x12')][_0xecb0('0x14')]);return _0x2cf053(_0x3aec48['error'][_0xecb0('0x14')]);}else{logger[_0xecb0('0xe')](_0xecb0('0xf'),_0x13345d,'request\x20sent');_0x2cf053(_0x3aec48[_0xecb0('0x15')][_0xecb0('0x14')]);}})[_0xecb0('0x16')](function(_0x3250a8){logger[_0xecb0('0x12')]('MailApplication,\x20%s,\x20%s',_0x13345d,_0x3250a8);_0x53964f(_0x3250a8);});});}exports[_0xecb0('0x17')]=function(_0x4a0171){var _0xe61458=this;return new Promise(function(_0x2222b9,_0x443f00){return db[_0xecb0('0x18')]['update'](_0x4a0171['body'],{'raw':_0x4a0171[_0xecb0('0x19')]?_0x4a0171[_0xecb0('0x19')][_0xecb0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0171['options']?_0x4a0171['options'][_0xecb0('0x1b')]||null:null,'attributes':_0x4a0171[_0xecb0('0x19')]?_0x4a0171[_0xecb0('0x19')]['attributes']||null:null,'limit':_0x4a0171['options']?_0x4a0171[_0xecb0('0x19')][_0xecb0('0x1c')]||null:null})[_0xecb0('0xd')](function(_0x49814a){logger[_0xecb0('0xe')](_0xecb0('0x17'),_0x4a0171);logger[_0xecb0('0x1d')](_0xecb0('0x17'),_0x4a0171,JSON['stringify'](_0x49814a));_0x2222b9(_0x49814a);})[_0xecb0('0x16')](function(_0x5330d5){logger[_0xecb0('0x12')](_0xecb0('0x17'),_0x5330d5['message'],_0x4a0171);_0x443f00(_0xe61458[_0xecb0('0x12')](0x1f4,_0x5330d5[_0xecb0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index da5d4bb..8e1c5c6 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 _0xb56e=['tracked','mail','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','/:id/messages','/:id/tags'];(function(_0x4d8535,_0x1ba46d){var _0x4f2073=function(_0x27ef82){while(--_0x27ef82){_0x4d8535['push'](_0x4d8535['shift']());}};_0x4f2073(++_0x1ba46d);}(_0xb56e,0x9a));var _0xeb56=function(_0x5379c9,_0x2381de){_0x5379c9=_0x5379c9-0x0;var _0x1103ca=_0xb56e[_0x5379c9];return _0x1103ca;};'use strict';var express=require(_0xeb56('0x0'));var router=express[_0xeb56('0x1')]();var auth=require(_0xeb56('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xeb56('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xeb56('0x4')](_0xeb56('0x5'),auth[_0xeb56('0x6')](),controller['describe']);router[_0xeb56('0x4')](_0xeb56('0x7'),auth[_0xeb56('0x6')](),controller['show']);router[_0xeb56('0x4')]('/:id/messages',auth[_0xeb56('0x6')](),controller[_0xeb56('0x8')]);router[_0xeb56('0x4')](_0xeb56('0x9'),auth['isAuthenticated'](),controller[_0xeb56('0xa')]);router[_0xeb56('0xb')]('/',auth[_0xeb56('0x6')](),controller['create']);router['post'](_0xeb56('0xc'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xeb56('0xd'),auth[_0xeb56('0x6')](),interaction[_0xeb56('0xe')](_0xeb56('0xf'),'mailinteraction:addtags'),controller[_0xeb56('0x10')]);router[_0xeb56('0x11')](_0xeb56('0x7'),auth[_0xeb56('0x6')](),interaction[_0xeb56('0xe')]('mail',_0xeb56('0x12')),controller[_0xeb56('0x13')]);router[_0xeb56('0x14')](_0xeb56('0x7'),auth['isAuthenticated'](),interaction[_0xeb56('0xe')](_0xeb56('0xf'),_0xeb56('0x15')),controller[_0xeb56('0x16')]);router['delete'](_0xeb56('0xd'),auth[_0xeb56('0x6')](),controller['removeTags']);module[_0xeb56('0x17')]=router; \ No newline at end of file +var _0x21cd=['put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x2bc1e5,_0x93f3d7){var _0x54617c=function(_0x59c832){while(--_0x59c832){_0x2bc1e5['push'](_0x2bc1e5['shift']());}};_0x54617c(++_0x93f3d7);}(_0x21cd,0x151));var _0xd21c=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x21cd[_0x2aea9e];return _0x430b92;};'use strict';var express=require(_0xd21c('0x0'));var router=express[_0xd21c('0x1')]();var auth=require(_0xd21c('0x2'));var interaction=require(_0xd21c('0x3'));var controller=require(_0xd21c('0x4'));router[_0xd21c('0x5')]('/',auth[_0xd21c('0x6')](),controller[_0xd21c('0x7')]);router['get'](_0xd21c('0x8'),auth[_0xd21c('0x6')](),controller[_0xd21c('0x9')]);router[_0xd21c('0x5')](_0xd21c('0xa'),auth[_0xd21c('0x6')](),controller[_0xd21c('0xb')]);router[_0xd21c('0x5')](_0xd21c('0xc'),auth[_0xd21c('0x6')](),controller[_0xd21c('0xd')]);router[_0xd21c('0x5')](_0xd21c('0xe'),auth[_0xd21c('0x6')](),controller[_0xd21c('0xf')]);router[_0xd21c('0x10')]('/',auth[_0xd21c('0x6')](),controller[_0xd21c('0x11')]);router[_0xd21c('0x10')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0xd21c('0x10')](_0xd21c('0x12'),auth[_0xd21c('0x6')](),interaction[_0xd21c('0x13')](_0xd21c('0x14'),_0xd21c('0x15')),controller[_0xd21c('0x16')]);router[_0xd21c('0x17')](_0xd21c('0xa'),auth[_0xd21c('0x6')](),interaction[_0xd21c('0x13')]('mail',_0xd21c('0x18')),controller['update']);router[_0xd21c('0x19')]('/:id',auth[_0xd21c('0x6')](),interaction[_0xd21c('0x13')](_0xd21c('0x14'),_0xd21c('0x1a')),controller[_0xd21c('0x1b')]);router[_0xd21c('0x19')](_0xd21c('0x12'),auth[_0xd21c('0x6')](),controller[_0xd21c('0x1c')]);module[_0xd21c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d33084c..113206c 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 _0xc852=['ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x19f00f,_0x181deb){var _0x332a97=function(_0x21d60e){while(--_0x21d60e){_0x19f00f['push'](_0x19f00f['shift']());}};_0x332a97(++_0x181deb);}(_0xc852,0x122));var _0x2c85=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc852[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2c85('0x0'));var iconv=require(_0x2c85('0x1'));module[_0x2c85('0x2')]={'closed':{'type':Sequelize[_0x2c85('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c85('0x4')]},'disposition':{'type':Sequelize[_0x2c85('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2c85('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x2c85('0x5')]},'cc':{'type':Sequelize[_0x2c85('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x2c85('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x2c85('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x2c85('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2c85('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2c85('0x7')]('in',_0x2c85('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2c85('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbae9=['BOOLEAN','sequelize','iconv','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x120501,_0x162681){var _0x4ae9c7=function(_0x1e7453){while(--_0x1e7453){_0x120501['push'](_0x120501['shift']());}};_0x4ae9c7(++_0x162681);}(_0xbae9,0x1b1));var _0x9bae=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0xbae9[_0x127c7b];return _0x1708eb;};'use strict';var Sequelize=require(_0x9bae('0x0'));var iconv=require(_0x9bae('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9bae('0x2')]},'disposition':{'type':Sequelize[_0x9bae('0x3')]},'secondDisposition':{'type':Sequelize[_0x9bae('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9bae('0x3')]},'note':{'type':Sequelize[_0x9bae('0x3')]},'inReplyTo':{'type':Sequelize[_0x9bae('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9bae('0x3')]},'cc':{'type':Sequelize[_0x9bae('0x4')](_0x9bae('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x9bae('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x9bae('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9bae('0x6')]('in',_0x9bae('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9bae('0x6')]('in',_0x9bae('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9bae('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index dea558f..b774e83 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 _0x4975=['value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','find','text','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','length','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','setTags','spread','Tag','emit','mailInteractionTags:save','unix','server','tmp','join','attachments','format','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','build','writeFileSync','message%d.eml','download','unlinkSync','sendStatus','eml-format','zip-dir','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','forEach','push','MailMessage','findOne','out','lastMsgText','trimStart','plainBody','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','map','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages'];(function(_0x5414b9,_0x45f117){var _0x516836=function(_0x4e459e){while(--_0x4e459e){_0x5414b9['push'](_0x5414b9['shift']());}};_0x516836(++_0x45f117);}(_0x4975,0x86));var _0x5497=function(_0x5d8c1c,_0x19aa72){_0x5d8c1c=_0x5d8c1c-0x0;var _0x12c525=_0x4975[_0x5d8c1c];return _0x12c525;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var moment=require(_0x5497('0x2'));var BPromise=require(_0x5497('0x3'));var util=require(_0x5497('0x4'));var path=require(_0x5497('0x5'));var fs=require('fs');var _=require(_0x5497('0x6'));var squel=require(_0x5497('0x7'));var juice=require(_0x5497('0x8'));var Redis=require(_0x5497('0x9'));var qs=require(_0x5497('0xa'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x5497('0xb'))('api');var config=require(_0x5497('0xc'));var db=require(_0x5497('0xd'))['db'];var htmlEntities=require(_0x5497('0xe'));config['redis']=_[_0x5497('0xf')](config['redis'],{'host':_0x5497('0x10'),'port':0x18eb});var socket=require(_0x5497('0x11'))(new Redis(config[_0x5497('0x12')]));require(_0x5497('0x13'))[_0x5497('0x14')](socket);function respondWithStatusCode(_0x425288,_0x3e7886){_0x3e7886=_0x3e7886||0xcc;return function(_0x769e11){if(_0x769e11){return _0x425288['sendStatus'](_0x3e7886);}return _0x425288['status'](_0x3e7886)['end']();};}function respondWithResult(_0xc250bb,_0x1b23df){_0x1b23df=_0x1b23df||0xc8;return function(_0x1bb794){if(_0x1bb794){return _0xc250bb[_0x5497('0x15')](_0x1b23df)[_0x5497('0x16')](_0x1bb794);}};}function respondWithFilteredResult(_0x365144,_0x1f7169){return function(_0xaca97d){if(_0xaca97d){var _0x363a5b=typeof _0x1f7169[_0x5497('0x17')]==='undefined'&&typeof _0x1f7169[_0x5497('0x18')]==='undefined';var _0x4237a9=_0xaca97d[_0x5497('0x19')];var _0x19e5f3=_0x363a5b?0x0:_0x1f7169[_0x5497('0x17')];var _0x37c18e=_0x363a5b?_0xaca97d[_0x5497('0x19')]:_0x1f7169[_0x5497('0x17')]+_0x1f7169['limit'];var _0x56a788;if(_0x37c18e>=_0x4237a9){_0x37c18e=_0x4237a9;_0x56a788=0xc8;}else{_0x56a788=0xce;}_0x365144[_0x5497('0x15')](_0x56a788);return _0x365144[_0x5497('0x1a')](_0x5497('0x1b'),_0x19e5f3+'-'+_0x37c18e+'/'+_0x4237a9)['json'](_0xaca97d);}return null;};}function saveUpdates(_0xbf1ba7){return function(_0xcbd71d){if(_0xcbd71d){return _0xcbd71d[_0x5497('0x1c')](_0xbf1ba7)[_0x5497('0x1d')](function(_0x1b1b43){return _0x1b1b43;});}return null;};}function removeEntity(_0x1f6f18){return function(_0x16d378){if(_0x16d378){return _0x16d378[_0x5497('0x1e')]()[_0x5497('0x1d')](function(){_0x1f6f18[_0x5497('0x15')](0xcc)[_0x5497('0x1f')]();});}};}function handleEntityNotFound(_0x52c049){return function(_0x720767){if(!_0x720767){_0x52c049['sendStatus'](0x194);}return _0x720767;};}function handleError(_0x19200a,_0xd0868d){_0xd0868d=_0xd0868d||0x1f4;return function(_0x44265c){logger[_0x5497('0x20')](_0x44265c[_0x5497('0x21')]);if(_0x44265c[_0x5497('0x22')]){delete _0x44265c['name'];}_0x19200a['status'](_0xd0868d)[_0x5497('0x23')](_0x44265c);};}function getInteractionUsers(_0x34b97f,_0x24482a){return new BPromise(function(_0x281155,_0x5223b5){try{if(_0x24482a[_0x34b97f['id']]){_0x34b97f[_0x5497('0x24')]=_['map'](_0x24482a[_0x34b97f['id']],function(_0x1f3198){return{'id':_0x1f3198['id'],'fullname':_0x1f3198[_0x5497('0x25')]};});}}catch(_0x429d36){_0x5223b5(_0x429d36);}_0x281155(_0x34b97f);});}function getInteractionTags(_0x34a1a5,_0x163a30){return new BPromise(function(_0x31cd01,_0x48b835){try{if(_0x34a1a5[_0x5497('0x26')]){_0x34a1a5['Tags']=[];_0x34a1a5['TagIds']['split'](',')[_0x5497('0x27')](function(_0x48d146){_0x34a1a5['Tags'][_0x5497('0x28')](_0x163a30[_0x48d146]);});}delete _0x34a1a5[_0x5497('0x26')];}catch(_0x1cf908){_0x48b835(_0x1cf908);}_0x31cd01(_0x34a1a5);});}function getLastMessageText(_0x4c442a){return new BPromise(function(_0x59380f,_0x58230b){return db[_0x5497('0x29')][_0x5497('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x4c442a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5497('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})['then'](function(_0xa28dd8){if(_0xa28dd8&&_0xa28dd8['plainBody']){_0x4c442a[_0x5497('0x2c')]=_[_0x5497('0x2d')](_0xa28dd8[_0x5497('0x2e')]);}_0x59380f(_0x4c442a);})['catch'](function(_0x1d208f){_0x58230b(_0x1d208f);});});}function updateMailInteraction(_0x32aba1,_0x592c00,_0xce7cb2,_0xce2e81){return new BPromise(function(_0x331dfc,_0x489fbd){return getInteractionUsers(_0x32aba1,_0xce7cb2)[_0x5497('0x1d')](function(_0x2fe1f2){return getInteractionTags(_0x2fe1f2,_0x592c00);})[_0x5497('0x1d')](function(_0x362b96){return getStateInteraction(_0x362b96);})[_0x5497('0x1d')](function(_0x4a6459){if(_0xce2e81){_0x331dfc(getLastMessageText(_0x4a6459));}else{_0x331dfc(_0x4a6459);}})[_0x5497('0x2f')](function(_0x31ae43){_0x489fbd(_0x31ae43);});});}function getStateInteraction(_0x558a70){return new BPromise(function(_0x1ffc9b){_0x558a70[_0x5497('0x30')]=0x0;_0x558a70[_0x5497('0x31')]=0x0;_0x558a70[_0x5497('0x32')]=0x0;_0x558a70[_0x5497('0x33')]=0x0;_0x558a70[_0x5497('0x34')]=0x0;if(!_0x558a70['closed']&&!_0x558a70[_0x5497('0x35')]){_0x558a70['waiting']+=0x1;}if(!_0x558a70[_0x5497('0x36')]&&_0x558a70[_0x5497('0x35')]){_0x558a70[_0x5497('0x31')]+=0x1;if(_0x558a70['waiting']){_0x558a70['waiting']-=0x1;}}if(_0x558a70[_0x5497('0x36')]&&_0x558a70[_0x5497('0x35')]){_0x558a70[_0x5497('0x32')]+=0x1;if(_0x558a70[_0x5497('0x31')]){_0x558a70[_0x5497('0x31')]-=0x1;}}if(_0x558a70[_0x5497('0x36')]&&!_0x558a70['UserId']){_0x558a70[_0x5497('0x33')]+=0x1;if(_0x558a70[_0x5497('0x30')]){_0x558a70[_0x5497('0x30')]-=0x1;}}_0x558a70[_0x5497('0x34')]+=0x1;_0x1ffc9b(_0x558a70);});}exports[_0x5497('0x37')]=function(_0x468902,_0x1e3b6a){var _0x179635={},_0x59627b={},_0x544065={'count':0x0,'rows':[]};var _0x3bb31a=_[_0x5497('0x38')](db[_0x5497('0x39')][_0x5497('0x3a')],function(_0x15029d){return{'name':_0x15029d[_0x5497('0x3b')],'type':_0x15029d[_0x5497('0x3c')]['key']};});_0x59627b[_0x5497('0x3d')]=_[_0x5497('0x38')](_0x3bb31a,_0x5497('0x22'));_0x59627b[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x468902[_0x5497('0x3e')]);_0x59627b[_0x5497('0x40')]=_['intersection'](_0x59627b[_0x5497('0x3d')],_0x59627b[_0x5497('0x3e')]);_0x179635[_0x5497('0x41')]=_[_0x5497('0x42')](_0x59627b[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x468902[_0x5497('0x3e')][_0x5497('0x43')]));_0x179635[_0x5497('0x41')]=_0x179635[_0x5497('0x41')]['length']?_0x179635[_0x5497('0x41')]:_0x59627b['model'];if(!_0x468902[_0x5497('0x3e')][_0x5497('0x44')](_0x5497('0x45'))){_0x179635[_0x5497('0x18')]=qs[_0x5497('0x18')](_0x468902['query'][_0x5497('0x18')]);_0x179635[_0x5497('0x17')]=qs['offset'](_0x468902[_0x5497('0x3e')]['offset']);}_0x179635[_0x5497('0x46')]=qs['sort'](_0x468902[_0x5497('0x3e')][_0x5497('0x47')]);_0x179635[_0x5497('0x48')]=qs[_0x5497('0x40')](_[_0x5497('0x49')](_0x468902['query'],_0x59627b['filters']),_0x3bb31a);var _0x498de5=[];var _0x55f654=squel[_0x5497('0x4a')]()[_0x5497('0x4b')]('id')[_0x5497('0x4b')](_0x5497('0x22'))[_0x5497('0x4b')](_0x5497('0x4c'))[_0x5497('0x4d')](_0x5497('0x4e'));var _0x2626bf=squel['select']()[_0x5497('0x4b')](_0x5497('0x4f'))[_0x5497('0x4b')]('u.fullname')[_0x5497('0x4b')]('ui.MailInteractionId')[_0x5497('0x4d')](_0x5497('0x50'),'ui')[_0x5497('0x51')]('users','u',_0x5497('0x52'));var _0x356d61=squel['select']()[_0x5497('0x4d')]('mail_interactions','i')[_0x5497('0x51')]('cm_contacts','c',_0x5497('0x53'))[_0x5497('0x51')](_0x5497('0x54'),'o',_0x5497('0x55'))[_0x5497('0x51')](_0x5497('0x56'),'a',_0x5497('0x57'))[_0x5497('0x51')]('mail_messages','me',_0x5497('0x58'))['left_join']('mail_interaction_has_tags','it',_0x5497('0x59'))[_0x5497('0x51')]('tools_tags','t',_0x5497('0x5a'));var _0x3df816=squel[_0x5497('0x5b')]();var _0x3094c7=[];var _0x4ccf0e=squel[_0x5497('0x5b')]();var _0x538d18;if(_0x468902['query'][_0x5497('0x5c')]){_0x538d18=as[_0x5497('0x5d')](_0x468902[_0x5497('0x3e')]['search']);var _0x4b37d2=_0x538d18[_0x5497('0x5e')];for(var _0x5acedf=0x0;_0x5acedf<_0x538d18[_0x5497('0x5f')]['length'];_0x5acedf++){var _0x3f50ae=_0x538d18['conditions'][_0x5acedf];var _0xb1eac0='i';var _0x41138e=_['find'](_0x3bb31a,[_0x5497('0x22'),_0x3f50ae['field']]);if(!_0x41138e){switch(_0x3f50ae['field']){case _0x5497('0x60'):if(_0x3f50ae[_0x5497('0x61')]==0x1){_0x356d61['having']('`'+_0x3f50ae[_0x5497('0x4b')]+_0x5497('0x62'));}else{_0x356d61[_0x5497('0x63')]('`'+_0x3f50ae[_0x5497('0x4b')]+_0x5497('0x64'));}break;case _0x5497('0x65'):if(_0x3f50ae['operator']===_0x5497('0x66')){if(_0x3f50ae['value']['split']('\x20')['length']>0x1){_0x3df816[_0x4b37d2](_0x5497('0x67'),qs[_0x5497('0x68')](_0x3f50ae[_0x5497('0x61')]),null);}else{var _0x544085='%'+_0x3f50ae[_0x5497('0x61')]+'%';_0x3df816[_0x4b37d2]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x544085,_0x544085,_0x544085);}}else{_0x41138e=_['find'](_0x3bb31a,[_0x5497('0x22'),_0x5497('0x69')]);_0x3f50ae[_0x5497('0x4b')]=_0x5497('0x69');_0x4b4cfe=as[_0x5497('0x6a')](_0xb1eac0,_0x41138e[_0x5497('0x3c')],_0x3f50ae);_0x3df816[_0x4b37d2](_0x4b4cfe['text'],_0x4b4cfe[_0x5497('0x61')][_0x5497('0x6b')],_0x4b4cfe[_0x5497('0x61')][_0x5497('0x1f')]);}break;case'Tag':var _0x179be4=_0x3f50ae[_0x5497('0x61')][_0x5497('0x6c')](',')[_0x5497('0x38')](function(_0x5823f6){return Number(_0x5823f6);});_0x179be4[_0x5497('0x27')](function(_0x2f3c3e){_0x4ccf0e['or'](_0x5497('0x6d'),'%,'+_0x2f3c3e+',%');});_0x3094c7=_['union'](_0x3094c7,_0x179be4);break;case _0x5497('0x6e'):if(_0x3f50ae['operator']==='$substring'){_0x3df816[_0x4b37d2]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3f50ae[_0x5497('0x61')]+'%',null);}else{_0x41138e=_[_0x5497('0x6f')](_0x3bb31a,[_0x5497('0x22'),'UserId']);_0x3f50ae[_0x5497('0x4b')]=_0x5497('0x35');_0x4b4cfe=as[_0x5497('0x6a')](_0xb1eac0,_0x41138e[_0x5497('0x3c')],_0x3f50ae);_0x3df816[_0x4b37d2](_0x4b4cfe['text'],_0x4b4cfe[_0x5497('0x61')][_0x5497('0x6b')],_0x4b4cfe[_0x5497('0x61')]['end']);}break;case _0x5497('0x2e'):_0x4b4cfe=as[_0x5497('0x6a')]('me',null,_0x3f50ae);_0x3df816[_0x4b37d2](_0x4b4cfe[_0x5497('0x70')],_0x4b4cfe[_0x5497('0x61')][_0x5497('0x6b')],_0x4b4cfe[_0x5497('0x61')][_0x5497('0x1f')]);break;}}else{var _0x4b4cfe=as[_0x5497('0x6a')](_0xb1eac0,_0x41138e[_0x5497('0x3c')],_0x3f50ae);_0x3df816[_0x4b37d2](_0x4b4cfe[_0x5497('0x70')],_0x4b4cfe[_0x5497('0x61')]['start'],_0x4b4cfe['value']['end']);}}}else{var _0x305d5b=_(_0x468902[_0x5497('0x3e')])[_0x5497('0x3f')]()['map'](function(_0xc7fa29){return _[_0x5497('0x71')](_0x3bb31a,[_0x5497('0x22'),_0xc7fa29])?_0xc7fa29:undefined;})[_0x5497('0x72')]()[_0x5497('0x61')]();if(!_[_0x5497('0x73')](_0x305d5b)){_0x305d5b[_0x5497('0x27')](function(_0x23bd32){if(_0x23bd32===_0x5497('0x74')){_0x356d61[_0x5497('0x48')](_0x5497('0x75'),[]['concat'](_0x468902[_0x5497('0x3e')][_0x23bd32]));}else if(_0x23bd32===_0x5497('0x76')){var _0x238d68=JSON['parse'](_0x468902[_0x5497('0x3e')][_0x23bd32])['$gte'];var _0x21c780=JSON[_0x5497('0x77')](_0x468902['query'][_0x23bd32])[_0x5497('0x78')];_0x356d61[_0x5497('0x48')](_0x5497('0x79'),_0x238d68,_0x21c780);}else{if(_0x468902[_0x5497('0x3e')][_0x23bd32]==='null'){_0x356d61[_0x5497('0x48')]('i.'+_0x23bd32+_0x5497('0x7a'));}else{_0x356d61[_0x5497('0x48')]('i.'+_0x23bd32+'\x20=\x20?',_0x468902[_0x5497('0x3e')][_0x23bd32]);}}});}if(_0x468902[_0x5497('0x3e')]['read']){if(_0x468902[_0x5497('0x3e')][_0x5497('0x7b')]==0x1){_0x356d61[_0x5497('0x63')]('`unreadMessages`\x20=\x200');}else{_0x356d61['having'](_0x5497('0x7c'));}}if(_0x468902[_0x5497('0x3e')][_0x5497('0x7d')]){_0x3094c7=_[_0x5497('0x7e')](_0x468902[_0x5497('0x3e')][_0x5497('0x7d')])?_0x468902[_0x5497('0x3e')]['tag']:new Array(_0x468902['query'][_0x5497('0x7d')]);_0x3094c7[_0x5497('0x27')](function(_0x540362){_0x4ccf0e['or'](_0x5497('0x6d'),'%,'+_0x540362+',%');});}if(_0x468902[_0x5497('0x3e')][_0x5497('0x7f')]){var _0x510078=_0x468902[_0x5497('0x3e')][_0x5497('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x5497('0x80')](/'/g,'\x27\x27');if(qs[_0x5497('0x81')](_0x510078)){_0x3df816['or'](_0x5497('0x82'),_0x510078+'%');}else if(qs[_0x5497('0x83')](_0x510078)){_0x3df816['or'](_0x5497('0x84'),_0x510078+'%');}else{_0x3df816['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5497('0x68')](_0x510078))['or'](_0x5497('0x85'),qs[_0x5497('0x68')](_0x510078));}}}_0x356d61[_0x5497('0x48')](_0x3df816);_0x356d61[_0x5497('0x86')]('i.id');var _0x394bf3={'type':db[_0x5497('0x87')][_0x5497('0x88')][_0x5497('0x89')],'raw':!![]};var _0x521d74=_0x356d61[_0x5497('0x8a')]();_0x521d74[_0x5497('0x4b')]('i.id');_0x521d74[_0x5497('0x4b')](_0x5497('0x8b'),_0x5497('0x60'));if(_0x179635[_0x5497('0x46')]){_0x179635['order']['forEach'](function(_0x4ff64f){var _0x5343d5=_0x4ff64f[0x0]==='contactName'?_0x4ff64f[0x0]:'i.'+_0x4ff64f[0x0];_0x356d61[_0x5497('0x46')](_0x5343d5,_0x4ff64f[0x1]===_0x5497('0x8c')?![]:!![]);});}if(!_[_0x5497('0x73')](_0x3094c7)){_0x356d61[_0x5497('0x63')](_0x4ccf0e);_0x521d74[_0x5497('0x48')]('t.id\x20IN\x20?',_0x3094c7);}BPromise['resolve']()[_0x5497('0x1d')](function(){if(!_0x538d18){if(_0x468902[_0x5497('0x3e')][_0x5497('0x74')])return;_0x521d74[_0x5497('0x48')](_0x5497('0x8d'));_0x356d61[_0x5497('0x48')](_0x5497('0x8d'));return;}if(_0x468902[_0x5497('0x8e')][_0x5497('0x8f')]!==_0x5497('0x90'))return;return _0x468902['user'][_0x5497('0x91')]({'attributes':['id'],'raw':!![]})[_0x5497('0x1d')](function(_0x2868b1){if(_[_0x5497('0x73')](_0x2868b1)){_0x521d74[_0x5497('0x48')](_0x5497('0x92'));_0x356d61['where'](_0x5497('0x92'));}else{_0x521d74['where'](_0x5497('0x75'),_[_0x5497('0x38')](_0x2868b1,'id'));_0x356d61[_0x5497('0x48')]('i.MailAccountId\x20IN\x20?',_['map'](_0x2868b1,'id'));}});})[_0x5497('0x1d')](function(){if(_0x468902[_0x5497('0x8e')][_0x5497('0x8f')]===_0x5497('0x90')&&!_0x538d18&&!_0x468902[_0x5497('0x3e')][_0x5497('0x74')])return[];return db[_0x5497('0x93')][_0x5497('0x3e')](_0x521d74['toString'](),_0x394bf3);})['then'](function(_0x492372){_0x544065[_0x5497('0x19')]=_0x492372[_0x5497('0x94')];if(_0x544065[_0x5497('0x19')]===0x0)return[];return db[_0x5497('0x93')]['query'](_0x55f654['toString'](),_0x394bf3)[_0x5497('0x1d')](function(_0xf38193){_0x498de5=_['keyBy'](_0xf38193,'id');_0x394bf3=_[_0x5497('0x95')](_0x394bf3,{'model':db[_0x5497('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x468902[_0x5497('0x3e')][_0x5497('0x43')]){_0x179635['attributes']['forEach'](function(_0x55e597){_0x356d61['field']('i.'+_0x55e597);});}else{_0x356d61['field'](_0x5497('0x8b'),'unreadMessages');_0x356d61[_0x5497('0x4b')]('a.key',_0x5497('0x96'));_0x356d61[_0x5497('0x4b')](_0x5497('0x97'),_0x5497('0x98'));_0x356d61[_0x5497('0x4b')](_0x5497('0x99'),'contactName');_0x356d61[_0x5497('0x4b')]('i.id');_0x356d61[_0x5497('0x4b')](_0x5497('0x9a'));_0x356d61[_0x5497('0x4b')](_0x5497('0x9b'));_0x356d61[_0x5497('0x4b')](_0x5497('0x9c'));_0x356d61[_0x5497('0x4b')](_0x5497('0x9d'));_0x356d61[_0x5497('0x4b')](_0x5497('0x9e'));_0x356d61['field'](_0x5497('0x9f'));_0x356d61['field'](_0x5497('0xa0'));_0x356d61[_0x5497('0x4b')]('i.subject');_0x356d61[_0x5497('0x4b')](_0x5497('0xa1'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa2'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa3'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa4'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa5'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa6'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa7'));_0x356d61['field'](_0x5497('0xa8'));_0x356d61[_0x5497('0x4b')](_0x5497('0xa9'),_0x5497('0xaa'));_0x356d61[_0x5497('0x4b')]('c.lastName',_0x5497('0xab'));_0x356d61[_0x5497('0x4b')]('c.email','Contact.email');_0x356d61[_0x5497('0x4b')](_0x5497('0xac'),_0x5497('0xad'));_0x356d61[_0x5497('0x4b')](_0x5497('0xae'),'Contact.mobile');_0x356d61['field'](_0x5497('0xaf'),'Contact.fax');_0x356d61[_0x5497('0x4b')](_0x5497('0xb0'),_0x5497('0xb1'));_0x356d61[_0x5497('0x4b')](_0x5497('0xb2'),_0x5497('0xb3'));_0x356d61['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5497('0x26'));}if(_0x179635[_0x5497('0x18')])_0x356d61[_0x5497('0x18')](_0x179635['limit']);if(_0x179635[_0x5497('0x17')])_0x356d61['offset'](_0x179635[_0x5497('0x17')]);return db['sequelize']['query'](_0x356d61[_0x5497('0xb4')](),_0x394bf3);})[_0x5497('0x1d')](function(_0x4ce768){if(_0x4ce768[_0x5497('0x94')]>0x0)_0x2626bf[_0x5497('0x48')](_0x5497('0xb5'),_[_0x5497('0x38')](_0x4ce768,'id'));return db['sequelize'][_0x5497('0x3e')](_0x2626bf[_0x5497('0xb4')](),_0x394bf3)[_0x5497('0x1d')](function(_0x1bfd2a){var _0x3821fa=_['groupBy'](_0x1bfd2a,_0x5497('0xb6'));var _0x488655=[];return db[_0x5497('0xb7')][_0x5497('0x2a')]({'attributes':[_0x5497('0xb8')],'raw':!![]})[_0x5497('0x1d')](function(_0x380bed){var _0x3070c7=_0x380bed[_0x5497('0xb8')];_0x4ce768[_0x5497('0x27')](function(_0x21a8c5){_0x488655[_0x5497('0x28')](updateMailInteraction(_0x21a8c5,_0x498de5,_0x3821fa,_0x3070c7));});return BPromise[_0x5497('0xb9')](_0x488655);});});});})['then'](function(_0x28d457){_0x544065[_0x5497('0xba')]=_0x28d457;return _0x544065;})[_0x5497('0x1d')](respondWithFilteredResult(_0x1e3b6a,_0x179635))[_0x5497('0x2f')](handleError(_0x1e3b6a,null));};exports[_0x5497('0xbb')]=function(_0x4fb6bd,_0x365650){var _0x31ccde={'raw':![],'where':{'id':_0x4fb6bd[_0x5497('0xbc')]['id']}},_0x2ca8b9={};_0x2ca8b9[_0x5497('0x3d')]=_['keys'](db[_0x5497('0x39')][_0x5497('0x3a')]);_0x2ca8b9[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x4fb6bd[_0x5497('0x3e')]);_0x2ca8b9[_0x5497('0x40')]=_[_0x5497('0x42')](_0x2ca8b9[_0x5497('0x3d')],_0x2ca8b9[_0x5497('0x3e')]);_0x31ccde[_0x5497('0x41')]=_[_0x5497('0x42')](_0x2ca8b9[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x4fb6bd[_0x5497('0x3e')]['fields']));_0x31ccde['attributes']=_0x31ccde[_0x5497('0x41')][_0x5497('0x94')]?_0x31ccde[_0x5497('0x41')]:_0x2ca8b9['model'];if(_0x4fb6bd[_0x5497('0x3e')][_0x5497('0xbd')]){_0x31ccde[_0x5497('0xbe')]=[{'all':!![]}];}_0x31ccde=_[_0x5497('0x95')]({},_0x31ccde,_0x4fb6bd[_0x5497('0xbf')]);return db[_0x5497('0x39')][_0x5497('0x6f')](_0x31ccde)[_0x5497('0x1d')](handleEntityNotFound(_0x365650,null))['then'](respondWithResult(_0x365650,null))['catch'](handleError(_0x365650,null));};exports['create']=function(_0x1ce864,_0xba8dcd){return db['MailInteraction'][_0x5497('0xc0')](_0x1ce864[_0x5497('0xc1')],{})[_0x5497('0x1d')](respondWithResult(_0xba8dcd,0xc9))['catch'](handleError(_0xba8dcd,null));};exports[_0x5497('0x1c')]=function(_0x4b98a3,_0x2fe434){if(_0x4b98a3[_0x5497('0xc1')]['id']){delete _0x4b98a3[_0x5497('0xc1')]['id'];}return db['MailInteraction'][_0x5497('0x6f')]({'where':{'id':_0x4b98a3[_0x5497('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2fe434,null))[_0x5497('0x1d')](saveUpdates(_0x4b98a3[_0x5497('0xc1')],null))[_0x5497('0x1d')](respondWithResult(_0x2fe434,null))['catch'](handleError(_0x2fe434,null));};exports[_0x5497('0x1e')]=function(_0x1a5c32,_0x204a1b){return db[_0x5497('0x39')][_0x5497('0x6f')]({'where':{'id':_0x1a5c32[_0x5497('0xbc')]['id']}})[_0x5497('0x1d')](handleEntityNotFound(_0x204a1b,null))[_0x5497('0x1d')](removeEntity(_0x204a1b,null))[_0x5497('0x2f')](handleError(_0x204a1b,null));};exports[_0x5497('0xc2')]=function(_0x1db786,_0x1dfb76){return db[_0x5497('0x39')][_0x5497('0xc2')]()[_0x5497('0x1d')](respondWithResult(_0x1dfb76,null))['catch'](handleError(_0x1dfb76,null));};exports[_0x5497('0xc3')]=function(_0x5c2517,_0x367929){return db[_0x5497('0x29')]['find']({'where':{'id':_0x5c2517['params']['id']}})[_0x5497('0x1d')](handleEntityNotFound(_0x367929,null))[_0x5497('0x1d')](function(_0x2fd2e3){if(_0x2fd2e3){return _0x2fd2e3[_0x5497('0xc3')](_0x5c2517['body'][_0x5497('0xc4')],_[_0x5497('0xc5')](_0x5c2517['body'],['ids','id'])||{});}})[_0x5497('0x1d')](respondWithResult(_0x367929,null))[_0x5497('0x2f')](handleError(_0x367929,null));};exports[_0x5497('0xc6')]=function(_0x21df52,_0xb95941){var _0x4e7585={'raw':![],'where':{}};var _0x575b80={};var _0x3fd69a={'count':0x0,'rows':[]};return db[_0x5497('0x39')]['findOne']({'where':{'id':_0x21df52[_0x5497('0xbc')]['id']}})[_0x5497('0x1d')](handleEntityNotFound(_0xb95941,null))[_0x5497('0x1d')](function(_0x24f64c){if(_0x24f64c){_0x575b80[_0x5497('0x3d')]=_[_0x5497('0x3f')](db[_0x5497('0x29')][_0x5497('0x3a')]);_0x575b80[_0x5497('0x3e')]=_['keys'](_0x21df52['query']);_0x575b80[_0x5497('0x40')]=_[_0x5497('0x42')](_0x575b80[_0x5497('0x3d')],_0x575b80['query']);_0x4e7585[_0x5497('0x41')]=_[_0x5497('0x42')](_0x575b80[_0x5497('0x3d')],qs['fields'](_0x21df52[_0x5497('0x3e')][_0x5497('0x43')]));_0x4e7585['attributes']=_0x4e7585['attributes'][_0x5497('0x94')]?_0x4e7585[_0x5497('0x41')]:_0x575b80['model'];if(!_0x21df52[_0x5497('0x3e')]['hasOwnProperty'](_0x5497('0x45'))){_0x4e7585[_0x5497('0x18')]=qs[_0x5497('0x18')](_0x21df52[_0x5497('0x3e')][_0x5497('0x18')]);_0x4e7585[_0x5497('0x17')]=qs[_0x5497('0x17')](_0x21df52['query']['offset']);}_0x4e7585[_0x5497('0x46')]=qs[_0x5497('0x47')](_0x21df52['query']['sort']);_0x4e7585[_0x5497('0x48')]=qs[_0x5497('0x40')](_[_0x5497('0x49')](_0x21df52[_0x5497('0x3e')],_0x575b80[_0x5497('0x40')]));_0x4e7585[_0x5497('0x48')]['MailInteractionId']=_0x24f64c['id'];if(_0x21df52[_0x5497('0x3e')][_0x5497('0x7f')]){_0x4e7585[_0x5497('0x48')]=_[_0x5497('0x95')](_0x4e7585[_0x5497('0x48')],{'$or':_[_0x5497('0x38')](_0x4e7585['attributes'],function(_0xc433e5){var _0x56633d={};_0x56633d[_0xc433e5]={'$like':'%'+_0x21df52[_0x5497('0x3e')][_0x5497('0x7f')]+'%'};return _0x56633d;})});}if(_0x21df52[_0x5497('0x3e')]['$gte']){var _0x4007a7=_0x21df52['query']['$gte'][_0x5497('0x6c')](',');var _0x370625={};_0x370625[_0x4007a7[0x0]]={'$gte':moment(_0x4007a7[0x1])['format'](_0x5497('0xc7'))};_0x4e7585[_0x5497('0x48')]=_[_0x5497('0x95')](_0x4e7585[_0x5497('0x48')],_0x370625);}_0x4e7585=_[_0x5497('0x95')]({},_0x4e7585,_0x21df52[_0x5497('0xbf')]);return db[_0x5497('0x29')][_0x5497('0x19')]({'where':_0x4e7585[_0x5497('0x48')]})['then'](function(_0x275b41){_0x3fd69a[_0x5497('0x19')]=_0x275b41;if(_0x21df52[_0x5497('0x3e')][_0x5497('0xbd')]){_0x4e7585[_0x5497('0xbe')]=[{'all':!![]}];}return db[_0x5497('0x29')][_0x5497('0xc8')](_0x4e7585);})[_0x5497('0x1d')](function(_0x1cae63){if(_0x21df52[_0x5497('0x3e')][_0x5497('0xc9')]===_0x5497('0xca')){for(var _0x4752dd=0x0;_0x4752dd<_0x1cae63[_0x5497('0x94')];_0x4752dd++){_0x1cae63[_0x4752dd][_0x5497('0xc1')]=juice(_0x1cae63[_0x4752dd][_0x5497('0xc1')]);}}_0x3fd69a[_0x5497('0xba')]=_0x1cae63;return _0x3fd69a;});}})[_0x5497('0x1d')](respondWithFilteredResult(_0xb95941,_0x4e7585))[_0x5497('0x2f')](handleError(_0xb95941,null));};exports['addTags']=function(_0x412c4c,_0x2bfb0c){return db['MailInteraction']['find']({'where':{'id':_0x412c4c[_0x5497('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2bfb0c,null))[_0x5497('0x1d')](function(_0x255fde){if(_0x255fde){return _0x255fde[_0x5497('0xcb')](_0x412c4c[_0x5497('0xc1')][_0x5497('0xc4')],_[_0x5497('0xc5')](_0x412c4c[_0x5497('0xc1')],[_0x5497('0xc4'),'id'])||{})[_0x5497('0xcc')](function(){return db[_0x5497('0xcd')][_0x5497('0xc8')]({'attributes':['id','name',_0x5497('0x4c')],'where':{'id':_0x412c4c['body'][_0x5497('0xc4')]}});})[_0x5497('0x1d')](function(_0x452c9e){socket[_0x5497('0xce')](_0x5497('0xcf'),{'id':Number(_0x412c4c[_0x5497('0xbc')]['id']),'tags':_0x452c9e||[]});return{'id':Number(_0x412c4c[_0x5497('0xbc')]['id']),'tags':_0x452c9e||[]};});}})[_0x5497('0x1d')](respondWithResult(_0x2bfb0c,null))['catch'](handleError(_0x2bfb0c,null));};exports['removeTags']=function(_0x1718f2,_0x6329d1){return db[_0x5497('0x39')][_0x5497('0x6f')]({'where':{'id':_0x1718f2[_0x5497('0xbc')]['id']}})['then'](handleEntityNotFound(_0x6329d1,null))[_0x5497('0x1d')](function(_0x5a1f5a){if(_0x5a1f5a){return _0x5a1f5a['removeTags'](_0x1718f2['query']['ids']);}})[_0x5497('0x1d')](respondWithStatusCode(_0x6329d1,null))['catch'](handleError(_0x6329d1,null));};exports['download']=function(_0x45c820,_0x1c8be2){var _0x1e030c=moment()[_0x5497('0xd0')]()['toString']();var _0x2e62ae=path['join'](config['root'],_0x5497('0xd1'),'files',_0x5497('0xd2'));var _0x32916a=path[_0x5497('0xd3')](config['root'],_0x5497('0xd1'),'files',_0x5497('0xd4'));var _0xda040=path[_0x5497('0xd3')](_0x2e62ae,_0x1e030c);var _0x14c76a=util[_0x5497('0xd5')](_0x5497('0xd6'),_0x45c820[_0x5497('0xbc')]['id'],_0x1e030c);var _0x1b1f08=path[_0x5497('0xd3')](_0x2e62ae,_0x14c76a);var _0x5d2cee=[];if(_0x45c820[_0x5497('0x3e')][_0x5497('0xd4')]){_0x5d2cee[_0x5497('0x28')]({'model':db['Attachment'],'as':_0x5497('0xd7'),'raw':!![]});}var _0x42aa2e=[{'model':db[_0x5497('0x29')],'as':_0x5497('0xd8'),'attributes':['id',_0x5497('0xc1'),'from','to','cc',_0x5497('0xd9'),_0x5497('0xda'),_0x5497('0x76')],'where':{'secret':![]},'order':qs[_0x5497('0x47')]('id'),'include':_0x5d2cee}];return db['MailInteraction'][_0x5497('0x6f')]({'where':{'id':_0x45c820[_0x5497('0xbc')]['id']},'include':_0x42aa2e})[_0x5497('0x1d')](handleEntityNotFound(_0x1c8be2,null))[_0x5497('0x1d')](function(_0x4061dc){if(_0x4061dc&&_0x4061dc[_0x5497('0xd8')]){var _0x4220cf=_0x4061dc['get']({'plain':!![]});fs[_0x5497('0xdb')](_0xda040);return BPromise['each'](_0x4220cf[_0x5497('0xd8')],function(_0x183142,_0x55fe87){var _0x54e012={'from':_0x183142['from'],'to':_0x183142['to'],'subject':_0x183142[_0x5497('0xda')],'html':htmlEntities[_0x5497('0xdc')](_0x183142[_0x5497('0xc1')]),'headers':{'Date':moment(_0x183142[_0x5497('0x76')])['format'](_0x5497('0xdd'))},'attachments':[]};if(_0x183142['cc']){_0x54e012[_0x5497('0xde')]['Cc']=_0x183142['cc'];}if(_0x183142[_0x5497('0xd9')]){_0x54e012[_0x5497('0xde')][_0x5497('0xdf')]=_0x183142['bcc'];}return new BPromise(function(_0x5000e4,_0x56e241){if(_0x183142[_0x5497('0xd7')]){for(var _0x1fa3a4=0x0;_0x1fa3a4<_0x183142[_0x5497('0xd7')][_0x5497('0x94')];_0x1fa3a4++){var _0x5cd164=_0x183142['Attachments'][_0x1fa3a4];var _0x3cad8a=path['join'](_0x32916a,_0x5cd164[_0x5497('0xe0')]);if(fs['existsSync'](_0x3cad8a)){_0x54e012[_0x5497('0xd4')]['push']({'name':_0x5cd164[_0x5497('0x22')],'contentType':_0x5cd164[_0x5497('0x3c')],'data':fs['readFileSync'](_0x3cad8a)});}}}emlformat[_0x5497('0xe1')](_0x54e012,function(_0x22bb05,_0x2cda3b){if(_0x22bb05)return _0x56e241(_0x22bb05);fs[_0x5497('0xe2')](path['join'](_0xda040,util[_0x5497('0xd5')](_0x5497('0xe3'),_0x55fe87)),_0x2cda3b);return _0x5000e4(_0x2cda3b);});});})[_0x5497('0x1d')](function(){return new BPromise(function(_0x358877,_0x434337){zipdir(_0xda040,{'saveTo':_0x1b1f08},function(_0x3f25a3,_0x41b271){if(_0x3f25a3)return _0x434337(_0x3f25a3);return _0x358877(_0x41b271);});})[_0x5497('0x1d')](function(){return new BPromise(function(_0x1e0436,_0x10fcff){rimraf(_0xda040,function(_0x29a9e5){if(_0x29a9e5)_0x10fcff(_0x29a9e5);return _0x1e0436();});});})[_0x5497('0x1d')](function(){return _0x1c8be2[_0x5497('0xe4')](_0x1b1f08,_0x14c76a,function(_0x42148e){if(!_0x42148e)fs[_0x5497('0xe5')](_0x1b1f08);});});});}else{return _0x1c8be2[_0x5497('0xe6')](0xc8);}})[_0x5497('0x2f')](handleError(_0x1c8be2,null));}; \ No newline at end of file +var _0x3bd7=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','u.id','u.fullname','ui.MailInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','isEmpty','i.MailAccountId\x20IN\x20?','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','contactName','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','findOne','enableEmailPreview','all','show','includeAll','include','options','create','body','destroy','params','describe','addMessage','ids','format','inlineCss','true','setTags','omit','spread','findAll','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','zip-dir','moment','bluebird','path','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','push','MailMessage','plainBody','-id','lastMsgText','catch','talking','unmanaged','closed','UserId','waiting','index','MailInteraction','rawAttributes'];(function(_0x19b555,_0x3049ef){var _0x424a34=function(_0x85ae3e){while(--_0x85ae3e){_0x19b555['push'](_0x19b555['shift']());}};_0x424a34(++_0x3049ef);}(_0x3bd7,0x199));var _0x73bd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3bd7[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73bd('0x0'));var moment=require(_0x73bd('0x1'));var BPromise=require(_0x73bd('0x2'));var util=require('util');var path=require(_0x73bd('0x3'));var fs=require('fs');var _=require(_0x73bd('0x4'));var squel=require(_0x73bd('0x5'));var juice=require('juice');var Redis=require(_0x73bd('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x73bd('0x7'));var logger=require(_0x73bd('0x8'))('api');var config=require(_0x73bd('0x9'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config['redis']=_[_0x73bd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x73bd('0xb'))(new Redis(config['redis']));require(_0x73bd('0xc'))[_0x73bd('0xd')](socket);function respondWithStatusCode(_0x32bb97,_0x1abba0){_0x1abba0=_0x1abba0||0xcc;return function(_0x3fb8be){if(_0x3fb8be){return _0x32bb97[_0x73bd('0xe')](_0x1abba0);}return _0x32bb97['status'](_0x1abba0)[_0x73bd('0xf')]();};}function respondWithResult(_0x388504,_0x31c882){_0x31c882=_0x31c882||0xc8;return function(_0x41f324){if(_0x41f324){return _0x388504[_0x73bd('0x10')](_0x31c882)[_0x73bd('0x11')](_0x41f324);}};}function respondWithFilteredResult(_0x50ec11,_0x45be59){return function(_0x5c4bc8){if(_0x5c4bc8){var _0x189007=typeof _0x45be59[_0x73bd('0x12')]===_0x73bd('0x13')&&typeof _0x45be59[_0x73bd('0x14')]===_0x73bd('0x13');var _0x5ea8db=_0x5c4bc8[_0x73bd('0x15')];var _0xfdf66=_0x189007?0x0:_0x45be59[_0x73bd('0x12')];var _0x3e5933=_0x189007?_0x5c4bc8[_0x73bd('0x15')]:_0x45be59[_0x73bd('0x12')]+_0x45be59[_0x73bd('0x14')];var _0x464aa1;if(_0x3e5933>=_0x5ea8db){_0x3e5933=_0x5ea8db;_0x464aa1=0xc8;}else{_0x464aa1=0xce;}_0x50ec11[_0x73bd('0x10')](_0x464aa1);return _0x50ec11['set'](_0x73bd('0x16'),_0xfdf66+'-'+_0x3e5933+'/'+_0x5ea8db)[_0x73bd('0x11')](_0x5c4bc8);}return null;};}function saveUpdates(_0x1fbaa5){return function(_0x2a48c3){if(_0x2a48c3){return _0x2a48c3[_0x73bd('0x17')](_0x1fbaa5)[_0x73bd('0x18')](function(_0x397c60){return _0x397c60;});}return null;};}function removeEntity(_0xe9120f){return function(_0x444c5f){if(_0x444c5f){return _0x444c5f['destroy']()[_0x73bd('0x18')](function(){_0xe9120f[_0x73bd('0x10')](0xcc)[_0x73bd('0xf')]();});}};}function handleEntityNotFound(_0x5e94e6){return function(_0x4d8482){if(!_0x4d8482){_0x5e94e6['sendStatus'](0x194);}return _0x4d8482;};}function handleError(_0x10b388,_0x269e84){_0x269e84=_0x269e84||0x1f4;return function(_0x56c076){logger[_0x73bd('0x19')](_0x56c076[_0x73bd('0x1a')]);if(_0x56c076[_0x73bd('0x1b')]){delete _0x56c076[_0x73bd('0x1b')];}_0x10b388[_0x73bd('0x10')](_0x269e84)[_0x73bd('0x1c')](_0x56c076);};}function getInteractionUsers(_0x2bcd5f,_0x123dc1){return new BPromise(function(_0xbaeaed,_0x2dd70b){try{if(_0x123dc1[_0x2bcd5f['id']]){_0x2bcd5f[_0x73bd('0x1d')]=_[_0x73bd('0x1e')](_0x123dc1[_0x2bcd5f['id']],function(_0x12934b){return{'id':_0x12934b['id'],'fullname':_0x12934b[_0x73bd('0x1f')]};});}}catch(_0x388698){_0x2dd70b(_0x388698);}_0xbaeaed(_0x2bcd5f);});}function getInteractionTags(_0x52e910,_0x50957c){return new BPromise(function(_0x191727,_0x1903a5){try{if(_0x52e910['TagIds']){_0x52e910[_0x73bd('0x20')]=[];_0x52e910[_0x73bd('0x21')][_0x73bd('0x22')](',')['forEach'](function(_0x5ae04e){_0x52e910[_0x73bd('0x20')][_0x73bd('0x23')](_0x50957c[_0x5ae04e]);});}delete _0x52e910[_0x73bd('0x21')];}catch(_0x5be8d6){_0x1903a5(_0x5be8d6);}_0x191727(_0x52e910);});}function getLastMessageText(_0x163dad){return new BPromise(function(_0x544d12,_0x17a64f){return db[_0x73bd('0x24')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x163dad['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x73bd('0x25')],'order':_0x73bd('0x26'),'raw':!![]})[_0x73bd('0x18')](function(_0x1042e8){if(_0x1042e8&&_0x1042e8['plainBody']){_0x163dad[_0x73bd('0x27')]=_['trimStart'](_0x1042e8[_0x73bd('0x25')]);}_0x544d12(_0x163dad);})[_0x73bd('0x28')](function(_0xf08cb9){_0x17a64f(_0xf08cb9);});});}function updateMailInteraction(_0x19bcf6,_0x4a0efd,_0x3ba328,_0x2653f8){return new BPromise(function(_0x3ee469,_0x18bf07){return getInteractionUsers(_0x19bcf6,_0x3ba328)[_0x73bd('0x18')](function(_0x18d1f0){return getInteractionTags(_0x18d1f0,_0x4a0efd);})[_0x73bd('0x18')](function(_0x2c4362){return getStateInteraction(_0x2c4362);})['then'](function(_0x19b583){if(_0x2653f8){_0x3ee469(getLastMessageText(_0x19b583));}else{_0x3ee469(_0x19b583);}})[_0x73bd('0x28')](function(_0x533af0){_0x18bf07(_0x533af0);});});}function getStateInteraction(_0x3dac1d){return new BPromise(function(_0x177c03){_0x3dac1d['waiting']=0x0;_0x3dac1d[_0x73bd('0x29')]=0x0;_0x3dac1d['answered']=0x0;_0x3dac1d[_0x73bd('0x2a')]=0x0;_0x3dac1d['total']=0x0;if(!_0x3dac1d[_0x73bd('0x2b')]&&!_0x3dac1d[_0x73bd('0x2c')]){_0x3dac1d[_0x73bd('0x2d')]+=0x1;}if(!_0x3dac1d[_0x73bd('0x2b')]&&_0x3dac1d[_0x73bd('0x2c')]){_0x3dac1d[_0x73bd('0x29')]+=0x1;if(_0x3dac1d[_0x73bd('0x2d')]){_0x3dac1d['waiting']-=0x1;}}if(_0x3dac1d[_0x73bd('0x2b')]&&_0x3dac1d[_0x73bd('0x2c')]){_0x3dac1d['answered']+=0x1;if(_0x3dac1d[_0x73bd('0x29')]){_0x3dac1d['talking']-=0x1;}}if(_0x3dac1d[_0x73bd('0x2b')]&&!_0x3dac1d[_0x73bd('0x2c')]){_0x3dac1d[_0x73bd('0x2a')]+=0x1;if(_0x3dac1d[_0x73bd('0x2d')]){_0x3dac1d[_0x73bd('0x2d')]-=0x1;}}_0x3dac1d['total']+=0x1;_0x177c03(_0x3dac1d);});}exports[_0x73bd('0x2e')]=function(_0x2de851,_0x1094e2){var _0x59adca={},_0x2c7ea2={},_0x31fe4e={'count':0x0,'rows':[]};var _0x1d6c16=_[_0x73bd('0x1e')](db[_0x73bd('0x2f')][_0x73bd('0x30')],function(_0x57ef73){return{'name':_0x57ef73[_0x73bd('0x31')],'type':_0x57ef73['type'][_0x73bd('0x32')]};});_0x2c7ea2[_0x73bd('0x33')]=_[_0x73bd('0x1e')](_0x1d6c16,_0x73bd('0x1b'));_0x2c7ea2[_0x73bd('0x34')]=_[_0x73bd('0x35')](_0x2de851[_0x73bd('0x34')]);_0x2c7ea2['filters']=_[_0x73bd('0x36')](_0x2c7ea2[_0x73bd('0x33')],_0x2c7ea2[_0x73bd('0x34')]);_0x59adca[_0x73bd('0x37')]=_['intersection'](_0x2c7ea2[_0x73bd('0x33')],qs[_0x73bd('0x38')](_0x2de851[_0x73bd('0x34')][_0x73bd('0x38')]));_0x59adca[_0x73bd('0x37')]=_0x59adca['attributes'][_0x73bd('0x39')]?_0x59adca['attributes']:_0x2c7ea2[_0x73bd('0x33')];if(!_0x2de851['query'][_0x73bd('0x3a')](_0x73bd('0x3b'))){_0x59adca['limit']=qs[_0x73bd('0x14')](_0x2de851[_0x73bd('0x34')][_0x73bd('0x14')]);_0x59adca[_0x73bd('0x12')]=qs[_0x73bd('0x12')](_0x2de851['query'][_0x73bd('0x12')]);}_0x59adca[_0x73bd('0x3c')]=qs[_0x73bd('0x3d')](_0x2de851[_0x73bd('0x34')][_0x73bd('0x3d')]);_0x59adca[_0x73bd('0x3e')]=qs[_0x73bd('0x3f')](_[_0x73bd('0x40')](_0x2de851['query'],_0x2c7ea2['filters']),_0x1d6c16);var _0x244e6d=[];var _0x444ef3=squel[_0x73bd('0x41')]()['field']('id')[_0x73bd('0x42')]('name')[_0x73bd('0x42')](_0x73bd('0x43'))['from']('tools_tags');var _0x53e0ab=squel[_0x73bd('0x41')]()['field'](_0x73bd('0x44'))['field'](_0x73bd('0x45'))[_0x73bd('0x42')](_0x73bd('0x46'))[_0x73bd('0x47')]('user_has_mail_interactions','ui')[_0x73bd('0x48')](_0x73bd('0x49'),'u',_0x73bd('0x4a'));var _0x25a532=squel[_0x73bd('0x41')]()[_0x73bd('0x47')](_0x73bd('0x4b'),'i')[_0x73bd('0x48')]('cm_contacts','c',_0x73bd('0x4c'))[_0x73bd('0x48')]('users','o',_0x73bd('0x4d'))[_0x73bd('0x48')](_0x73bd('0x4e'),'a','a.id\x20=\x20i.MailAccountId')[_0x73bd('0x48')](_0x73bd('0x4f'),'me',_0x73bd('0x50'))[_0x73bd('0x48')](_0x73bd('0x51'),'it','it.MailInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5b1b87=squel[_0x73bd('0x52')]();var _0x430ca9=[];var _0x251bd5=squel['expr']();var _0x5d2e1b;if(_0x2de851['query'][_0x73bd('0x53')]){_0x5d2e1b=as['parseSearch'](_0x2de851[_0x73bd('0x34')]['search']);var _0x522876=_0x5d2e1b['sqlOperator'];for(var _0x36220a=0x0;_0x36220a<_0x5d2e1b[_0x73bd('0x54')][_0x73bd('0x39')];_0x36220a++){var _0x5615ba=_0x5d2e1b['conditions'][_0x36220a];var _0x134116='i';var _0x3516fb=_[_0x73bd('0x55')](_0x1d6c16,['name',_0x5615ba[_0x73bd('0x42')]]);if(!_0x3516fb){switch(_0x5615ba[_0x73bd('0x42')]){case _0x73bd('0x56'):if(_0x5615ba[_0x73bd('0x57')]==0x1){_0x25a532[_0x73bd('0x58')]('`'+_0x5615ba[_0x73bd('0x42')]+_0x73bd('0x59'));}else{_0x25a532[_0x73bd('0x58')]('`'+_0x5615ba[_0x73bd('0x42')]+_0x73bd('0x5a'));}break;case'Contact':if(_0x5615ba['operator']==='$substring'){if(_0x5615ba[_0x73bd('0x57')][_0x73bd('0x22')]('\x20')['length']>0x1){_0x5b1b87[_0x522876](_0x73bd('0x5b'),qs[_0x73bd('0x5c')](_0x5615ba[_0x73bd('0x57')]),null);}else{var _0x67e2a8='%'+_0x5615ba['value']+'%';_0x5b1b87[_0x522876](_0x73bd('0x5d'),_0x67e2a8,_0x67e2a8,_0x67e2a8);}}else{_0x3516fb=_['find'](_0x1d6c16,['name',_0x73bd('0x5e')]);_0x5615ba[_0x73bd('0x42')]='ContactId';_0x172248=as[_0x73bd('0x5f')](_0x134116,_0x3516fb[_0x73bd('0x60')],_0x5615ba);_0x5b1b87[_0x522876](_0x172248[_0x73bd('0x61')],_0x172248[_0x73bd('0x57')][_0x73bd('0x62')],_0x172248['value'][_0x73bd('0xf')]);}break;case _0x73bd('0x63'):var _0xa4a05a=_0x5615ba[_0x73bd('0x57')][_0x73bd('0x22')](',')[_0x73bd('0x1e')](function(_0x44ceb7){return Number(_0x44ceb7);});_0xa4a05a[_0x73bd('0x64')](function(_0x3efb94){_0x251bd5['or'](_0x73bd('0x65'),'%,'+_0x3efb94+',%');});_0x430ca9=_[_0x73bd('0x66')](_0x430ca9,_0xa4a05a);break;case _0x73bd('0x67'):if(_0x5615ba[_0x73bd('0x68')]==='$substring'){_0x5b1b87[_0x522876](_0x73bd('0x69'),'%'+_0x5615ba[_0x73bd('0x57')]+'%',null);}else{_0x3516fb=_[_0x73bd('0x55')](_0x1d6c16,[_0x73bd('0x1b'),_0x73bd('0x2c')]);_0x5615ba[_0x73bd('0x42')]=_0x73bd('0x2c');_0x172248=as[_0x73bd('0x5f')](_0x134116,_0x3516fb[_0x73bd('0x60')],_0x5615ba);_0x5b1b87[_0x522876](_0x172248[_0x73bd('0x61')],_0x172248[_0x73bd('0x57')]['start'],_0x172248[_0x73bd('0x57')][_0x73bd('0xf')]);}break;case _0x73bd('0x25'):_0x172248=as['buildExpression']('me',null,_0x5615ba);_0x5b1b87[_0x522876](_0x172248['text'],_0x172248[_0x73bd('0x57')][_0x73bd('0x62')],_0x172248[_0x73bd('0x57')][_0x73bd('0xf')]);break;}}else{var _0x172248=as[_0x73bd('0x5f')](_0x134116,_0x3516fb[_0x73bd('0x60')],_0x5615ba);_0x5b1b87[_0x522876](_0x172248[_0x73bd('0x61')],_0x172248['value'][_0x73bd('0x62')],_0x172248[_0x73bd('0x57')]['end']);}}}else{var _0xabeb51=_(_0x2de851[_0x73bd('0x34')])[_0x73bd('0x35')]()[_0x73bd('0x1e')](function(_0x1d901f){return _['some'](_0x1d6c16,[_0x73bd('0x1b'),_0x1d901f])?_0x1d901f:undefined;})[_0x73bd('0x6a')]()['value']();if(!_[_0x73bd('0x6b')](_0xabeb51)){_0xabeb51[_0x73bd('0x64')](function(_0x231db6){if(_0x231db6==='MailAccountId'){_0x25a532['where'](_0x73bd('0x6c'),[]['concat'](_0x2de851[_0x73bd('0x34')][_0x231db6]));}else if(_0x231db6===_0x73bd('0x6d')){var _0x5a1f4c=JSON['parse'](_0x2de851[_0x73bd('0x34')][_0x231db6])[_0x73bd('0x6e')];var _0x228ed1=JSON['parse'](_0x2de851['query'][_0x231db6])[_0x73bd('0x6f')];_0x25a532[_0x73bd('0x3e')](_0x73bd('0x70'),_0x5a1f4c,_0x228ed1);}else{if(_0x2de851[_0x73bd('0x34')][_0x231db6]===_0x73bd('0x71')){_0x25a532['where']('i.'+_0x231db6+_0x73bd('0x72'));}else{_0x25a532[_0x73bd('0x3e')]('i.'+_0x231db6+'\x20=\x20?',_0x2de851[_0x73bd('0x34')][_0x231db6]);}}});}if(_0x2de851[_0x73bd('0x34')][_0x73bd('0x73')]){if(_0x2de851[_0x73bd('0x34')][_0x73bd('0x73')]==0x1){_0x25a532['having']('`unreadMessages`\x20=\x200');}else{_0x25a532[_0x73bd('0x58')](_0x73bd('0x74'));}}if(_0x2de851[_0x73bd('0x34')][_0x73bd('0x75')]){_0x430ca9=_[_0x73bd('0x76')](_0x2de851[_0x73bd('0x34')][_0x73bd('0x75')])?_0x2de851[_0x73bd('0x34')][_0x73bd('0x75')]:new Array(_0x2de851[_0x73bd('0x34')]['tag']);_0x430ca9[_0x73bd('0x64')](function(_0x2bb373){_0x251bd5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2bb373+',%');});}if(_0x2de851[_0x73bd('0x34')][_0x73bd('0x77')]){var _0x29bcc3=_0x2de851[_0x73bd('0x34')][_0x73bd('0x77')][_0x73bd('0x78')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x73bd('0x79')](_0x29bcc3)){_0x5b1b87['or'](_0x73bd('0x7a'),_0x29bcc3+'%');}else if(qs[_0x73bd('0x7b')](_0x29bcc3)){_0x5b1b87['or'](_0x73bd('0x7c'),_0x29bcc3+'%');}else{_0x5b1b87['or'](_0x73bd('0x7d'),qs[_0x73bd('0x5c')](_0x29bcc3))['or'](_0x73bd('0x7e'),qs['getFullTextValue'](_0x29bcc3));}}}_0x25a532['where'](_0x5b1b87);_0x25a532['group'](_0x73bd('0x7f'));var _0x5d7bb5={'type':db[_0x73bd('0x80')][_0x73bd('0x81')]['SELECT'],'raw':!![]};var _0x264046=_0x25a532[_0x73bd('0x82')]();_0x264046[_0x73bd('0x42')]('i.id');_0x264046[_0x73bd('0x42')](_0x73bd('0x83'),_0x73bd('0x56'));if(_0x59adca[_0x73bd('0x3c')]){_0x59adca['order']['forEach'](function(_0x44f369){var _0x590891=_0x44f369[0x0]==='contactName'?_0x44f369[0x0]:'i.'+_0x44f369[0x0];_0x25a532[_0x73bd('0x3c')](_0x590891,_0x44f369[0x1]===_0x73bd('0x84')?![]:!![]);});}if(!_['isEmpty'](_0x430ca9)){_0x25a532[_0x73bd('0x58')](_0x251bd5);_0x264046['where']('t.id\x20IN\x20?',_0x430ca9);}BPromise['resolve']()[_0x73bd('0x18')](function(){if(!_0x5d2e1b){if(_0x2de851['query'][_0x73bd('0x85')])return;_0x264046['where'](_0x73bd('0x86'));_0x25a532['where'](_0x73bd('0x86'));return;}if(_0x2de851[_0x73bd('0x87')][_0x73bd('0x88')]!==_0x73bd('0x89'))return;return _0x2de851[_0x73bd('0x87')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x73bd('0x18')](function(_0x510b77){if(_['isEmpty'](_0x510b77)){_0x264046[_0x73bd('0x3e')](_0x73bd('0x8a'));_0x25a532[_0x73bd('0x3e')](_0x73bd('0x8a'));}else{_0x264046[_0x73bd('0x3e')](_0x73bd('0x6c'),_[_0x73bd('0x1e')](_0x510b77,'id'));_0x25a532['where']('i.MailAccountId\x20IN\x20?',_[_0x73bd('0x1e')](_0x510b77,'id'));}});})[_0x73bd('0x18')](function(){if(_0x2de851[_0x73bd('0x87')]['role']===_0x73bd('0x89')&&!_0x5d2e1b&&!_0x2de851[_0x73bd('0x34')][_0x73bd('0x85')])return[];return db[_0x73bd('0x8b')][_0x73bd('0x34')](_0x264046[_0x73bd('0x8c')](),_0x5d7bb5);})[_0x73bd('0x18')](function(_0x71ac66){_0x31fe4e[_0x73bd('0x15')]=_0x71ac66['length'];if(_0x31fe4e[_0x73bd('0x15')]===0x0)return[];return db[_0x73bd('0x8b')]['query'](_0x444ef3[_0x73bd('0x8c')](),_0x5d7bb5)['then'](function(_0x8bd1e6){_0x244e6d=_[_0x73bd('0x8d')](_0x8bd1e6,'id');_0x5d7bb5=_[_0x73bd('0x8e')](_0x5d7bb5,{'model':db[_0x73bd('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2de851[_0x73bd('0x34')][_0x73bd('0x38')]){_0x59adca[_0x73bd('0x37')][_0x73bd('0x64')](function(_0x6c3404){_0x25a532[_0x73bd('0x42')]('i.'+_0x6c3404);});}else{_0x25a532[_0x73bd('0x42')](_0x73bd('0x83'),_0x73bd('0x56'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x8f'),_0x73bd('0x90'));_0x25a532['field'](_0x73bd('0x91'),'Account.mandatoryDisposition');_0x25a532[_0x73bd('0x42')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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',_0x73bd('0x92'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x7f'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x93'));_0x25a532[_0x73bd('0x42')]('i.updatedAt');_0x25a532[_0x73bd('0x42')](_0x73bd('0x94'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x95'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x96'));_0x25a532['field'](_0x73bd('0x97'));_0x25a532['field'](_0x73bd('0x98'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x99'));_0x25a532['field'](_0x73bd('0x9a'));_0x25a532[_0x73bd('0x42')]('i.secondDisposition');_0x25a532[_0x73bd('0x42')]('i.thirdDisposition');_0x25a532[_0x73bd('0x42')](_0x73bd('0x9b'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x9c'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x9d'));_0x25a532['field'](_0x73bd('0x9e'));_0x25a532[_0x73bd('0x42')](_0x73bd('0x9f'));_0x25a532['field']('c.firstName',_0x73bd('0xa0'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xa1'),_0x73bd('0xa2'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xa3'),_0x73bd('0xa4'));_0x25a532['field'](_0x73bd('0xa5'),_0x73bd('0xa6'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xa7'),_0x73bd('0xa8'));_0x25a532['field'](_0x73bd('0xa9'),_0x73bd('0xaa'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xab'),_0x73bd('0xac'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xad'),_0x73bd('0xae'));_0x25a532[_0x73bd('0x42')](_0x73bd('0xaf'),_0x73bd('0x21'));}if(_0x59adca[_0x73bd('0x14')])_0x25a532[_0x73bd('0x14')](_0x59adca[_0x73bd('0x14')]);if(_0x59adca[_0x73bd('0x12')])_0x25a532[_0x73bd('0x12')](_0x59adca[_0x73bd('0x12')]);return db[_0x73bd('0x8b')]['query'](_0x25a532[_0x73bd('0x8c')](),_0x5d7bb5);})[_0x73bd('0x18')](function(_0x40554d){if(_0x40554d[_0x73bd('0x39')]>0x0)_0x53e0ab[_0x73bd('0x3e')](_0x73bd('0xb0'),_['map'](_0x40554d,'id'));return db[_0x73bd('0x8b')][_0x73bd('0x34')](_0x53e0ab[_0x73bd('0x8c')](),_0x5d7bb5)[_0x73bd('0x18')](function(_0xa3c53e){var _0x52c2ea=_[_0x73bd('0xb1')](_0xa3c53e,_0x73bd('0xb2'));var _0x22abc6=[];return db['Setting'][_0x73bd('0xb3')]({'attributes':[_0x73bd('0xb4')],'raw':!![]})[_0x73bd('0x18')](function(_0x3c59ca){var _0x1565f4=_0x3c59ca['enableEmailPreview'];_0x40554d[_0x73bd('0x64')](function(_0x552a68){_0x22abc6[_0x73bd('0x23')](updateMailInteraction(_0x552a68,_0x244e6d,_0x52c2ea,_0x1565f4));});return BPromise[_0x73bd('0xb5')](_0x22abc6);});});});})['then'](function(_0x59c3bc){_0x31fe4e['rows']=_0x59c3bc;return _0x31fe4e;})['then'](respondWithFilteredResult(_0x1094e2,_0x59adca))[_0x73bd('0x28')](handleError(_0x1094e2,null));};exports[_0x73bd('0xb6')]=function(_0x4c2b05,_0xb16b9a){var _0x116a1f={'raw':![],'where':{'id':_0x4c2b05['params']['id']}},_0x8808fe={};_0x8808fe['model']=_['keys'](db[_0x73bd('0x2f')][_0x73bd('0x30')]);_0x8808fe[_0x73bd('0x34')]=_['keys'](_0x4c2b05[_0x73bd('0x34')]);_0x8808fe[_0x73bd('0x3f')]=_[_0x73bd('0x36')](_0x8808fe[_0x73bd('0x33')],_0x8808fe[_0x73bd('0x34')]);_0x116a1f['attributes']=_[_0x73bd('0x36')](_0x8808fe[_0x73bd('0x33')],qs[_0x73bd('0x38')](_0x4c2b05[_0x73bd('0x34')][_0x73bd('0x38')]));_0x116a1f[_0x73bd('0x37')]=_0x116a1f[_0x73bd('0x37')]['length']?_0x116a1f[_0x73bd('0x37')]:_0x8808fe[_0x73bd('0x33')];if(_0x4c2b05[_0x73bd('0x34')][_0x73bd('0xb7')]){_0x116a1f[_0x73bd('0xb8')]=[{'all':!![]}];}_0x116a1f=_['merge']({},_0x116a1f,_0x4c2b05[_0x73bd('0xb9')]);return db[_0x73bd('0x2f')]['find'](_0x116a1f)[_0x73bd('0x18')](handleEntityNotFound(_0xb16b9a,null))[_0x73bd('0x18')](respondWithResult(_0xb16b9a,null))[_0x73bd('0x28')](handleError(_0xb16b9a,null));};exports[_0x73bd('0xba')]=function(_0x440b67,_0x5aea47){return db[_0x73bd('0x2f')][_0x73bd('0xba')](_0x440b67['body'],{})['then'](respondWithResult(_0x5aea47,0xc9))[_0x73bd('0x28')](handleError(_0x5aea47,null));};exports['update']=function(_0x591d13,_0x14e0c4){if(_0x591d13['body']['id']){delete _0x591d13[_0x73bd('0xbb')]['id'];}return db[_0x73bd('0x2f')]['find']({'where':{'id':_0x591d13['params']['id']}})[_0x73bd('0x18')](handleEntityNotFound(_0x14e0c4,null))[_0x73bd('0x18')](saveUpdates(_0x591d13[_0x73bd('0xbb')],null))['then'](respondWithResult(_0x14e0c4,null))['catch'](handleError(_0x14e0c4,null));};exports[_0x73bd('0xbc')]=function(_0x53bfe2,_0x82802c){return db[_0x73bd('0x2f')][_0x73bd('0x55')]({'where':{'id':_0x53bfe2[_0x73bd('0xbd')]['id']}})['then'](handleEntityNotFound(_0x82802c,null))[_0x73bd('0x18')](removeEntity(_0x82802c,null))[_0x73bd('0x28')](handleError(_0x82802c,null));};exports[_0x73bd('0xbe')]=function(_0x10915f,_0x36f8ef){return db[_0x73bd('0x2f')][_0x73bd('0xbe')]()[_0x73bd('0x18')](respondWithResult(_0x36f8ef,null))[_0x73bd('0x28')](handleError(_0x36f8ef,null));};exports[_0x73bd('0xbf')]=function(_0x48f158,_0x43983b){return db[_0x73bd('0x24')][_0x73bd('0x55')]({'where':{'id':_0x48f158[_0x73bd('0xbd')]['id']}})[_0x73bd('0x18')](handleEntityNotFound(_0x43983b,null))[_0x73bd('0x18')](function(_0x1e9cbf){if(_0x1e9cbf){return _0x1e9cbf['addMessage'](_0x48f158[_0x73bd('0xbb')][_0x73bd('0xc0')],_['omit'](_0x48f158[_0x73bd('0xbb')],[_0x73bd('0xc0'),'id'])||{});}})[_0x73bd('0x18')](respondWithResult(_0x43983b,null))[_0x73bd('0x28')](handleError(_0x43983b,null));};exports['getMessages']=function(_0x30f521,_0x47b4b8){var _0xe632e6={'raw':![],'where':{}};var _0x3cf284={};var _0xeb9dd8={'count':0x0,'rows':[]};return db[_0x73bd('0x2f')]['findOne']({'where':{'id':_0x30f521[_0x73bd('0xbd')]['id']}})[_0x73bd('0x18')](handleEntityNotFound(_0x47b4b8,null))[_0x73bd('0x18')](function(_0x3f7976){if(_0x3f7976){_0x3cf284['model']=_['keys'](db['MailMessage'][_0x73bd('0x30')]);_0x3cf284[_0x73bd('0x34')]=_[_0x73bd('0x35')](_0x30f521[_0x73bd('0x34')]);_0x3cf284[_0x73bd('0x3f')]=_[_0x73bd('0x36')](_0x3cf284[_0x73bd('0x33')],_0x3cf284[_0x73bd('0x34')]);_0xe632e6[_0x73bd('0x37')]=_[_0x73bd('0x36')](_0x3cf284[_0x73bd('0x33')],qs['fields'](_0x30f521[_0x73bd('0x34')][_0x73bd('0x38')]));_0xe632e6[_0x73bd('0x37')]=_0xe632e6[_0x73bd('0x37')]['length']?_0xe632e6[_0x73bd('0x37')]:_0x3cf284[_0x73bd('0x33')];if(!_0x30f521[_0x73bd('0x34')][_0x73bd('0x3a')](_0x73bd('0x3b'))){_0xe632e6['limit']=qs[_0x73bd('0x14')](_0x30f521[_0x73bd('0x34')][_0x73bd('0x14')]);_0xe632e6['offset']=qs[_0x73bd('0x12')](_0x30f521[_0x73bd('0x34')][_0x73bd('0x12')]);}_0xe632e6[_0x73bd('0x3c')]=qs[_0x73bd('0x3d')](_0x30f521['query'][_0x73bd('0x3d')]);_0xe632e6['where']=qs['filters'](_[_0x73bd('0x40')](_0x30f521[_0x73bd('0x34')],_0x3cf284[_0x73bd('0x3f')]));_0xe632e6[_0x73bd('0x3e')][_0x73bd('0xb2')]=_0x3f7976['id'];if(_0x30f521[_0x73bd('0x34')][_0x73bd('0x77')]){_0xe632e6[_0x73bd('0x3e')]=_[_0x73bd('0x8e')](_0xe632e6[_0x73bd('0x3e')],{'$or':_['map'](_0xe632e6[_0x73bd('0x37')],function(_0x35bb6f){var _0x22a4aa={};_0x22a4aa[_0x35bb6f]={'$like':'%'+_0x30f521[_0x73bd('0x34')]['filter']+'%'};return _0x22a4aa;})});}if(_0x30f521['query'][_0x73bd('0x6e')]){var _0x8f9187=_0x30f521[_0x73bd('0x34')][_0x73bd('0x6e')][_0x73bd('0x22')](',');var _0x19a2c0={};_0x19a2c0[_0x8f9187[0x0]]={'$gte':moment(_0x8f9187[0x1])[_0x73bd('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe632e6[_0x73bd('0x3e')]=_[_0x73bd('0x8e')](_0xe632e6[_0x73bd('0x3e')],_0x19a2c0);}_0xe632e6=_['merge']({},_0xe632e6,_0x30f521[_0x73bd('0xb9')]);return db['MailMessage']['count']({'where':_0xe632e6[_0x73bd('0x3e')]})[_0x73bd('0x18')](function(_0x5b4d19){_0xeb9dd8['count']=_0x5b4d19;if(_0x30f521['query'][_0x73bd('0xb7')]){_0xe632e6[_0x73bd('0xb8')]=[{'all':!![]}];}return db[_0x73bd('0x24')]['findAll'](_0xe632e6);})[_0x73bd('0x18')](function(_0x5efefe){if(_0x30f521['query'][_0x73bd('0xc2')]===_0x73bd('0xc3')){for(var _0x203734=0x0;_0x203734<_0x5efefe[_0x73bd('0x39')];_0x203734++){_0x5efefe[_0x203734][_0x73bd('0xbb')]=juice(_0x5efefe[_0x203734][_0x73bd('0xbb')]);}}_0xeb9dd8['rows']=_0x5efefe;return _0xeb9dd8;});}})[_0x73bd('0x18')](respondWithFilteredResult(_0x47b4b8,_0xe632e6))[_0x73bd('0x28')](handleError(_0x47b4b8,null));};exports['addTags']=function(_0x2fb1f6,_0x158a13){return db[_0x73bd('0x2f')][_0x73bd('0x55')]({'where':{'id':_0x2fb1f6['params']['id']}})[_0x73bd('0x18')](handleEntityNotFound(_0x158a13,null))[_0x73bd('0x18')](function(_0x5bc934){if(_0x5bc934){return _0x5bc934[_0x73bd('0xc4')](_0x2fb1f6[_0x73bd('0xbb')]['ids'],_[_0x73bd('0xc5')](_0x2fb1f6[_0x73bd('0xbb')],['ids','id'])||{})[_0x73bd('0xc6')](function(){return db['Tag'][_0x73bd('0xc7')]({'attributes':['id','name','color'],'where':{'id':_0x2fb1f6[_0x73bd('0xbb')][_0x73bd('0xc0')]}});})[_0x73bd('0x18')](function(_0x221539){socket[_0x73bd('0xc8')](_0x73bd('0xc9'),{'id':Number(_0x2fb1f6[_0x73bd('0xbd')]['id']),'tags':_0x221539||[]});return{'id':Number(_0x2fb1f6['params']['id']),'tags':_0x221539||[]};});}})['then'](respondWithResult(_0x158a13,null))[_0x73bd('0x28')](handleError(_0x158a13,null));};exports['removeTags']=function(_0x3ab564,_0x16280e){return db[_0x73bd('0x2f')][_0x73bd('0x55')]({'where':{'id':_0x3ab564[_0x73bd('0xbd')]['id']}})[_0x73bd('0x18')](handleEntityNotFound(_0x16280e,null))[_0x73bd('0x18')](function(_0x1aeed){if(_0x1aeed){return _0x1aeed[_0x73bd('0xca')](_0x3ab564[_0x73bd('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x16280e,null))['catch'](handleError(_0x16280e,null));};exports[_0x73bd('0xcb')]=function(_0x1cfa7d,_0x1524a2){var _0x3ceb17=moment()[_0x73bd('0xcc')]()['toString']();var _0x2c20c9=path[_0x73bd('0xcd')](config[_0x73bd('0xce')],'server',_0x73bd('0xcf'),_0x73bd('0xd0'));var _0x4aafba=path[_0x73bd('0xcd')](config[_0x73bd('0xce')],_0x73bd('0xd1'),_0x73bd('0xcf'),'attachments');var _0x101650=path[_0x73bd('0xcd')](_0x2c20c9,_0x3ceb17);var _0x4dda25=util[_0x73bd('0xc1')](_0x73bd('0xd2'),_0x1cfa7d[_0x73bd('0xbd')]['id'],_0x3ceb17);var _0x10c0c3=path[_0x73bd('0xcd')](_0x2c20c9,_0x4dda25);var _0x2c52d2=[];if(_0x1cfa7d[_0x73bd('0x34')][_0x73bd('0xd3')]){_0x2c52d2[_0x73bd('0x23')]({'model':db[_0x73bd('0xd4')],'as':_0x73bd('0xd5'),'raw':!![]});}var _0x233e98=[{'model':db[_0x73bd('0x24')],'as':_0x73bd('0xd6'),'attributes':['id',_0x73bd('0xbb'),_0x73bd('0x47'),'to','cc',_0x73bd('0xd7'),_0x73bd('0xd8'),_0x73bd('0x6d')],'where':{'secret':![]},'order':qs[_0x73bd('0x3d')]('id'),'include':_0x2c52d2}];return db['MailInteraction'][_0x73bd('0x55')]({'where':{'id':_0x1cfa7d['params']['id']},'include':_0x233e98})[_0x73bd('0x18')](handleEntityNotFound(_0x1524a2,null))[_0x73bd('0x18')](function(_0x3d2981){if(_0x3d2981&&_0x3d2981[_0x73bd('0xd6')]){var _0x229b3a=_0x3d2981[_0x73bd('0xd9')]({'plain':!![]});fs[_0x73bd('0xda')](_0x101650);return BPromise[_0x73bd('0xdb')](_0x229b3a['Messages'],function(_0x264432,_0x239af7){var _0x46600f={'from':_0x264432['from'],'to':_0x264432['to'],'subject':_0x264432[_0x73bd('0xd8')],'html':htmlEntities[_0x73bd('0xdc')](_0x264432['body']),'headers':{'Date':moment(_0x264432[_0x73bd('0x6d')])[_0x73bd('0xc1')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x264432['cc']){_0x46600f['headers']['Cc']=_0x264432['cc'];}if(_0x264432['bcc']){_0x46600f[_0x73bd('0xdd')][_0x73bd('0xde')]=_0x264432[_0x73bd('0xd7')];}return new BPromise(function(_0x722d31,_0x385aea){if(_0x264432[_0x73bd('0xd5')]){for(var _0x3db7e2=0x0;_0x3db7e2<_0x264432[_0x73bd('0xd5')]['length'];_0x3db7e2++){var _0x2ab8c4=_0x264432[_0x73bd('0xd5')][_0x3db7e2];var _0x3d3ca7=path[_0x73bd('0xcd')](_0x4aafba,_0x2ab8c4['basename']);if(fs[_0x73bd('0xdf')](_0x3d3ca7)){_0x46600f[_0x73bd('0xd3')][_0x73bd('0x23')]({'name':_0x2ab8c4[_0x73bd('0x1b')],'contentType':_0x2ab8c4[_0x73bd('0x60')],'data':fs[_0x73bd('0xe0')](_0x3d3ca7)});}}}emlformat[_0x73bd('0xe1')](_0x46600f,function(_0x4bac25,_0x2f070f){if(_0x4bac25)return _0x385aea(_0x4bac25);fs[_0x73bd('0xe2')](path[_0x73bd('0xcd')](_0x101650,util[_0x73bd('0xc1')](_0x73bd('0xe3'),_0x239af7)),_0x2f070f);return _0x722d31(_0x2f070f);});});})[_0x73bd('0x18')](function(){return new BPromise(function(_0x24435f,_0x3659f1){zipdir(_0x101650,{'saveTo':_0x10c0c3},function(_0x377fea,_0x41efd2){if(_0x377fea)return _0x3659f1(_0x377fea);return _0x24435f(_0x41efd2);});})[_0x73bd('0x18')](function(){return new BPromise(function(_0x59d076,_0x28b58f){rimraf(_0x101650,function(_0x43c665){if(_0x43c665)_0x28b58f(_0x43c665);return _0x59d076();});});})[_0x73bd('0x18')](function(){return _0x1524a2[_0x73bd('0xcb')](_0x10c0c3,_0x4dda25,function(_0x4026dc){if(!_0x4026dc)fs[_0x73bd('0xe4')](_0x10c0c3);});});});}else{return _0x1524a2[_0x73bd('0xe')](0xc8);}})[_0x73bd('0x28')](handleError(_0x1524a2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 057ee35..6a1da82 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 _0x6273=['emit','hasOwnProperty','hook','../../mysqldb','MailInteraction','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0x6273,0x12f));var _0x3627=function(_0x309fa3,_0x45a071){_0x309fa3=_0x309fa3-0x0;var _0x1888a7=_0x6273[_0x309fa3];return _0x1888a7;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x3627('0x0'))['db'][_0x3627('0x1')];var MailMessage=require(_0x3627('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3627('0x2')](0x0);var events={'afterCreate':_0x3627('0x3'),'afterUpdate':'update','afterDestroy':_0x3627('0x4')};function emitEvent(_0x3efa58){return function(_0xbf8a15,_0x1e6f01,_0x11b146){_0xbf8a15['getUsers']({'attributes':['id'],'raw':!![]})[_0x3627('0x5')](function(_0x38e47d){_0xbf8a15[_0x3627('0x6')](_0x3627('0x7'),_0x38e47d[_0x3627('0x8')](function(_0xa4e265){return{'id':_0xa4e265['id']};}));return MailMessage[_0x3627('0x9')]({'where':{'MailInteractionId':_0xbf8a15['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3627('0x5')](function(_0x204f4c){_0xbf8a15[_0x3627('0x6')](_0x3627('0xa'),_0x204f4c[_0x3627('0xb')]);MailInteractionEvents[_0x3627('0xc')](_0x3efa58+':'+_0xbf8a15['id'],_0xbf8a15);MailInteractionEvents[_0x3627('0xc')](_0x3efa58,_0xbf8a15);_0x11b146(null);})['catch'](_0x11b146(null));};}for(var e in events){if(events[_0x3627('0xd')](e)){var event=events[e];MailInteraction[_0x3627('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x3a75=['MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x46ad3a,_0x50650e){var _0x331850=function(_0x846deb){while(--_0x846deb){_0x46ad3a['push'](_0x46ad3a['shift']());}};_0x331850(++_0x50650e);}(_0x3a75,0x1b3));var _0x53a7=function(_0x16eb92,_0x29a8e5){_0x16eb92=_0x16eb92-0x0;var _0x42dc7c=_0x3a75[_0x16eb92];return _0x42dc7c;};'use strict';var EventEmitter=require(_0x53a7('0x0'));var MailInteraction=require(_0x53a7('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x53a7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x53a7('0x3')](0x0);var events={'afterCreate':_0x53a7('0x4'),'afterUpdate':_0x53a7('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcd6d2e){return function(_0x6a060d,_0x5824c3,_0x50ecd8){_0x6a060d[_0x53a7('0x6')]({'attributes':['id'],'raw':!![]})[_0x53a7('0x7')](function(_0xe18408){_0x6a060d[_0x53a7('0x8')](_0x53a7('0x9'),_0xe18408[_0x53a7('0xa')](function(_0x17c138){return{'id':_0x17c138['id']};}));return MailMessage[_0x53a7('0xb')]({'where':{'MailInteractionId':_0x6a060d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53a7('0x7')](function(_0x2a70d3){_0x6a060d['setDataValue'](_0x53a7('0xc'),_0x2a70d3[_0x53a7('0xd')]);MailInteractionEvents[_0x53a7('0xe')](_0xcd6d2e+':'+_0x6a060d['id'],_0x6a060d);MailInteractionEvents['emit'](_0xcd6d2e,_0x6a060d);_0x50ecd8(null);})[_0x53a7('0xf')](_0x50ecd8(null));};}for(var e in events){if(events[_0x53a7('0x10')](e)){var event=events[e];MailInteraction[_0x53a7('0x11')](e,emitEvent(event));}}module[_0x53a7('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e4402fe..6e005d8 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 _0xd494=['MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path','rimraf','./mailInteraction.attributes','exports','define','fti_mail_interactions','FULLTEXT','substatus','substatusAt','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','models','get'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xd494,0xdd));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4d49('0x0'));var util=require('util');var logger=require(_0x4d49('0x1'))(_0x4d49('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d49('0x3'));var rimraf=require(_0x4d49('0x4'));var config=require('../../config/environment');var attributes=require(_0x4d49('0x5'));module[_0x4d49('0x6')]=function(_0x157c8e,_0x34c174){return _0x157c8e[_0x4d49('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x4d49('0x8'),'fields':['subject','to'],'type':_0x4d49('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d446d,_0xd546ec,_0x94d27d){if(_0x1d446d[_0x4d49('0xa')]){_0x1d446d[_0x4d49('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1d446d[_0x4d49('0xc')]){_0x1d446d[_0x4d49('0xd')]=moment()[_0x4d49('0xe')](_0x4d49('0xf'));}_0x94d27d(null,_0xd546ec);},'beforeUpdate':function(_0x15e066,_0x11fabe,_0x3fe08c){if(_0x15e066[_0x4d49('0x10')]('substatus')){_0x15e066[_0x4d49('0xb')]=_0x15e066[_0x4d49('0xa')]?moment()[_0x4d49('0xe')](_0x4d49('0xf')):null;}if(_0x15e066[_0x4d49('0x10')](_0x4d49('0xc'))){_0x15e066[_0x4d49('0xd')]=moment()['format'](_0x4d49('0xf'));_0x15e066['substatus']=null;_0x15e066[_0x4d49('0xb')]=null;}_0x3fe08c(null,_0x15e066);},'afterUpdate':function(_0x1e521a,_0x558759,_0x5b6eda){var _0x3bff7a=_0x157c8e[_0x4d49('0x11')];var _0x52fb6e=_0x1e521a[_0x4d49('0x12')]({'plain':!![]});if(_0x52fb6e[_0x4d49('0xc')]){return _0x3bff7a[_0x4d49('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x52fb6e['id']}})[_0x4d49('0x14')](function(){_0x5b6eda();})[_0x4d49('0x15')](function(_0x480528){_0x5b6eda(_0x480528);});}else{_0x5b6eda();}}},'charset':_0x4d49('0x16'),'collate':_0x4d49('0x17')});}; \ No newline at end of file +var _0xba30=['then','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','MailMessage','update'];(function(_0x492796,_0x157a02){var _0x5a2aaf=function(_0x265859){while(--_0x265859){_0x492796['push'](_0x492796['shift']());}};_0x5a2aaf(++_0x157a02);}(_0xba30,0xff));var _0x0ba3=function(_0x32fe5b,_0x464e33){_0x32fe5b=_0x32fe5b-0x0;var _0x2440e5=_0xba30[_0x32fe5b];return _0x2440e5;};'use strict';var _=require(_0x0ba3('0x0'));var util=require('util');var logger=require(_0x0ba3('0x1'))(_0x0ba3('0x2'));var moment=require(_0x0ba3('0x3'));var BPromise=require(_0x0ba3('0x4'));var rp=require(_0x0ba3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ba3('0x6'));var config=require(_0x0ba3('0x7'));var attributes=require(_0x0ba3('0x8'));module[_0x0ba3('0x9')]=function(_0x33b5ee,_0x49e0f7){return _0x33b5ee[_0x0ba3('0xa')](_0x0ba3('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x0ba3('0xc'),'fields':[_0x0ba3('0xd'),'to'],'type':_0x0ba3('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a1293,_0x47366b,_0x20bf4a){if(_0x1a1293['substatus']){_0x1a1293[_0x0ba3('0xf')]=moment()[_0x0ba3('0x10')](_0x0ba3('0x11'));}if(_0x1a1293[_0x0ba3('0x12')]){_0x1a1293[_0x0ba3('0x13')]=moment()[_0x0ba3('0x10')](_0x0ba3('0x11'));}_0x20bf4a(null,_0x47366b);},'beforeUpdate':function(_0xd258c1,_0x34fe05,_0x494f1f){if(_0xd258c1[_0x0ba3('0x14')](_0x0ba3('0x15'))){_0xd258c1['substatusAt']=_0xd258c1[_0x0ba3('0x15')]?moment()[_0x0ba3('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xd258c1[_0x0ba3('0x14')](_0x0ba3('0x12'))){_0xd258c1[_0x0ba3('0x13')]=moment()[_0x0ba3('0x10')](_0x0ba3('0x11'));_0xd258c1[_0x0ba3('0x15')]=null;_0xd258c1[_0x0ba3('0xf')]=null;}_0x494f1f(null,_0xd258c1);},'afterUpdate':function(_0xcf96a7,_0x4f4d64,_0x3330ee){var _0x1323ad=_0x33b5ee[_0x0ba3('0x16')];var _0xd7607a=_0xcf96a7['get']({'plain':!![]});if(_0xd7607a[_0x0ba3('0x12')]){return _0x1323ad[_0x0ba3('0x17')][_0x0ba3('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0xd7607a['id']}})[_0x0ba3('0x19')](function(){_0x3330ee();})[_0x0ba3('0x1a')](function(_0x3a6d6e){_0x3330ee(_0x3a6d6e);});}else{_0x3330ee();}}},'charset':_0x0ba3('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5debced..d8333ce 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 _0xec66=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','limit','info','ids','spread','AddTags'];(function(_0x37c545,_0x151955){var _0x50696f=function(_0x54d24d){while(--_0x54d24d){_0x37c545['push'](_0x37c545['shift']());}};_0x50696f(++_0x151955);}(_0xec66,0x103));var _0x6ec6=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xec66[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0x6ec6('0x0'));var util=require(_0x6ec6('0x1'));var moment=require(_0x6ec6('0x2'));var BPromise=require(_0x6ec6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ec6('0x4'));var db=require(_0x6ec6('0x5'))['db'];var utils=require(_0x6ec6('0x6'));var logger=require('../../config/logger')(_0x6ec6('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ec6('0x8'));var client=jayson['client'][_0x6ec6('0x9')]({'port':0x232a});config[_0x6ec6('0xa')]=_[_0x6ec6('0xb')](config[_0x6ec6('0xa')],{'host':_0x6ec6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x6ec6('0xd')](socket);function respondWithRpcPromise(_0x32ee12,_0x1b7a70,_0x3d4a62){return new BPromise(function(_0x307dda,_0x16433a){return client[_0x6ec6('0xe')](_0x32ee12,_0x3d4a62)[_0x6ec6('0xf')](function(_0x16797e){logger['info'](_0x6ec6('0x10'),_0x1b7a70,_0x6ec6('0x11'));logger[_0x6ec6('0x12')](_0x6ec6('0x13'),_0x1b7a70,_0x6ec6('0x11'),JSON[_0x6ec6('0x14')](_0x16797e));if(_0x16797e[_0x6ec6('0x15')]){if(_0x16797e[_0x6ec6('0x15')][_0x6ec6('0x16')]===0x1f4){logger[_0x6ec6('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1b7a70,_0x16797e['error'][_0x6ec6('0x17')]);return _0x16433a(_0x16797e[_0x6ec6('0x15')][_0x6ec6('0x17')]);}logger[_0x6ec6('0x15')](_0x6ec6('0x10'),_0x1b7a70,_0x16797e[_0x6ec6('0x15')]['message']);return _0x307dda(_0x16797e[_0x6ec6('0x15')][_0x6ec6('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x1b7a70,_0x6ec6('0x11'));_0x307dda(_0x16797e[_0x6ec6('0x18')][_0x6ec6('0x17')]);}})[_0x6ec6('0x19')](function(_0x40b8fa){logger['error'](_0x6ec6('0x10'),_0x1b7a70,_0x40b8fa);_0x16433a(_0x40b8fa);});});}exports[_0x6ec6('0x1a')]=function(_0x18db86){var _0x3a33fe=this;return new Promise(function(_0xe0329a,_0x18c0ae){return db[_0x6ec6('0x1b')]['update'](_0x18db86[_0x6ec6('0x1c')],{'raw':_0x18db86[_0x6ec6('0x1d')]?_0x18db86['options'][_0x6ec6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18db86[_0x6ec6('0x1d')]?_0x18db86[_0x6ec6('0x1d')][_0x6ec6('0x1f')]||null:null,'attributes':_0x18db86[_0x6ec6('0x1d')]?_0x18db86[_0x6ec6('0x1d')]['attributes']||null:null,'limit':_0x18db86[_0x6ec6('0x1d')]?_0x18db86[_0x6ec6('0x1d')][_0x6ec6('0x20')]||null:null})[_0x6ec6('0xf')](function(_0x38f5d6){logger[_0x6ec6('0x21')](_0x6ec6('0x1a'),_0x18db86);logger[_0x6ec6('0x12')](_0x6ec6('0x1a'),_0x18db86,JSON['stringify'](_0x38f5d6));_0xe0329a(_0x38f5d6);})[_0x6ec6('0x19')](function(_0x52be7d){logger[_0x6ec6('0x15')](_0x6ec6('0x1a'),_0x52be7d[_0x6ec6('0x17')],_0x18db86);_0x18c0ae(_0x3a33fe[_0x6ec6('0x15')](0x1f4,_0x52be7d[_0x6ec6('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x4cf49b){return new Promise(function(_0x28d7f7,_0x580d3a){return db[_0x6ec6('0x1b')]['find']({'where':_0x4cf49b[_0x6ec6('0x1d')]?_0x4cf49b[_0x6ec6('0x1d')]['where']||null:null})[_0x6ec6('0xf')](function(_0x54a63f){if(_0x54a63f){return _0x54a63f['addTags'](_0x4cf49b[_0x6ec6('0x1c')][_0x6ec6('0x22')],_['omit'](_0x4cf49b[_0x6ec6('0x1c')],[_0x6ec6('0x22'),'id'])||{});}})[_0x6ec6('0x23')](function(_0x416d47){logger[_0x6ec6('0x21')]('AddTags',_0x4cf49b);logger[_0x6ec6('0x12')](_0x6ec6('0x24'),_0x4cf49b,JSON[_0x6ec6('0x14')](_0x416d47));_0x28d7f7(_0x416d47);})[_0x6ec6('0x19')](function(_0x53cbed){logger['error']('AddTags',_0x53cbed['message'],_0x4cf49b);_0x580d3a(_this['error'](0x1f4,_0x53cbed[_0x6ec6('0x17')]));});});}; \ No newline at end of file +var _0x6ac3=['where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','ids','omit','spread','AddTags','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','MailInteraction','update','body','options','raw'];(function(_0x3bc645,_0x9fac1){var _0x5a0236=function(_0x1d4659){while(--_0x1d4659){_0x3bc645['push'](_0x3bc645['shift']());}};_0x5a0236(++_0x9fac1);}(_0x6ac3,0x14a));var _0x36ac=function(_0x3e89f5,_0x53d75c){_0x3e89f5=_0x3e89f5-0x0;var _0x60869b=_0x6ac3[_0x3e89f5];return _0x60869b;};'use strict';var _=require(_0x36ac('0x0'));var util=require(_0x36ac('0x1'));var moment=require('moment');var BPromise=require(_0x36ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36ac('0x3'));var db=require(_0x36ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36ac('0x5'));var config=require('../../config/environment');var jayson=require(_0x36ac('0x6'));var client=jayson[_0x36ac('0x7')][_0x36ac('0x8')]({'port':0x232a});config[_0x36ac('0x9')]=_[_0x36ac('0xa')](config[_0x36ac('0x9')],{'host':_0x36ac('0xb'),'port':0x18eb});var socket=require(_0x36ac('0xc'))(new Redis(config['redis']));require(_0x36ac('0xd'))[_0x36ac('0xe')](socket);function respondWithRpcPromise(_0x25e508,_0x157d64,_0x158771){return new BPromise(function(_0x2ffeff,_0x42f895){return client['request'](_0x25e508,_0x158771)[_0x36ac('0xf')](function(_0x6c643){logger[_0x36ac('0x10')](_0x36ac('0x11'),_0x157d64,_0x36ac('0x12'));logger[_0x36ac('0x13')](_0x36ac('0x14'),_0x157d64,'request\x20sent',JSON[_0x36ac('0x15')](_0x6c643));if(_0x6c643[_0x36ac('0x16')]){if(_0x6c643[_0x36ac('0x16')]['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x157d64,_0x6c643[_0x36ac('0x16')]['message']);return _0x42f895(_0x6c643[_0x36ac('0x16')][_0x36ac('0x17')]);}logger[_0x36ac('0x16')](_0x36ac('0x11'),_0x157d64,_0x6c643['error'][_0x36ac('0x17')]);return _0x2ffeff(_0x6c643[_0x36ac('0x16')][_0x36ac('0x17')]);}else{logger[_0x36ac('0x10')](_0x36ac('0x11'),_0x157d64,_0x36ac('0x12'));_0x2ffeff(_0x6c643[_0x36ac('0x18')][_0x36ac('0x17')]);}})['catch'](function(_0x510a7){logger[_0x36ac('0x16')](_0x36ac('0x11'),_0x157d64,_0x510a7);_0x42f895(_0x510a7);});});}exports['UpdateMailInteraction']=function(_0x3890bb){var _0x529b31=this;return new Promise(function(_0x307d21,_0x4294fa){return db[_0x36ac('0x19')][_0x36ac('0x1a')](_0x3890bb[_0x36ac('0x1b')],{'raw':_0x3890bb[_0x36ac('0x1c')]?_0x3890bb['options'][_0x36ac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3890bb[_0x36ac('0x1c')]?_0x3890bb[_0x36ac('0x1c')][_0x36ac('0x1e')]||null:null,'attributes':_0x3890bb[_0x36ac('0x1c')]?_0x3890bb[_0x36ac('0x1c')][_0x36ac('0x1f')]||null:null,'limit':_0x3890bb[_0x36ac('0x1c')]?_0x3890bb['options'][_0x36ac('0x20')]||null:null})[_0x36ac('0xf')](function(_0x1355df){logger[_0x36ac('0x10')]('UpdateMailInteraction',_0x3890bb);logger[_0x36ac('0x13')](_0x36ac('0x21'),_0x3890bb,JSON[_0x36ac('0x15')](_0x1355df));_0x307d21(_0x1355df);})['catch'](function(_0xb94e51){logger[_0x36ac('0x16')](_0x36ac('0x21'),_0xb94e51['message'],_0x3890bb);_0x4294fa(_0x529b31['error'](0x1f4,_0xb94e51[_0x36ac('0x17')]));});});};exports[_0x36ac('0x22')]=function(_0x16f7ab){return new Promise(function(_0x251470,_0xeb5cd){return db[_0x36ac('0x19')]['find']({'where':_0x16f7ab[_0x36ac('0x1c')]?_0x16f7ab['options'][_0x36ac('0x1e')]||null:null})[_0x36ac('0xf')](function(_0x26f3b0){if(_0x26f3b0){return _0x26f3b0['addTags'](_0x16f7ab['body'][_0x36ac('0x23')],_[_0x36ac('0x24')](_0x16f7ab[_0x36ac('0x1b')],[_0x36ac('0x23'),'id'])||{});}})[_0x36ac('0x25')](function(_0x2f3de5){logger[_0x36ac('0x10')](_0x36ac('0x26'),_0x16f7ab);logger[_0x36ac('0x13')]('AddTags',_0x16f7ab,JSON[_0x36ac('0x15')](_0x2f3de5));_0x251470(_0x2f3de5);})[_0x36ac('0x27')](function(_0x1725c5){logger['error'](_0x36ac('0x26'),_0x1725c5[_0x36ac('0x17')],_0x16f7ab);_0xeb5cd(_this[_0x36ac('0x16')](0x1f4,_0x1725c5[_0x36ac('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 908a28f..c30d492 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 _0x30e2=['update','removeListener','length','mailInteraction:','save'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x30e2,0x10d));var _0x230e=function(_0x5ab625,_0x3d2592){_0x5ab625=_0x5ab625-0x0;var _0x3c5d40=_0x30e2[_0x5ab625];return _0x3c5d40;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x230e('0x0'),'remove',_0x230e('0x1')];function createListener(_0x37d3d7,_0x406198){return function(_0x391e22){_0x406198['emit'](_0x37d3d7,_0x391e22);};}function removeListener(_0x510bab,_0x2d9e67){return function(){MailInteractionEvents[_0x230e('0x2')](_0x510bab,_0x2d9e67);};}exports['register']=function(_0xac8fc4){for(var _0x2d6498=0x0,_0x4ad044=events[_0x230e('0x3')];_0x2d6498<_0x4ad044;_0x2d6498++){var _0x324788=events[_0x2d6498];var _0xa4b4c8=createListener(_0x230e('0x4')+_0x324788,_0xac8fc4);MailInteractionEvents['on'](_0x324788,_0xa4b4c8);}}; \ No newline at end of file +var _0x0cc5=['./mailInteraction.events','remove','emit','removeListener','register','mailInteraction:'];(function(_0x1b7226,_0x3c28ba){var _0x30b98f=function(_0x14d799){while(--_0x14d799){_0x1b7226['push'](_0x1b7226['shift']());}};_0x30b98f(++_0x3c28ba);}(_0x0cc5,0x156));var _0x50cc=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x0cc5[_0x912d27];return _0x31b918;};'use strict';var MailInteractionEvents=require(_0x50cc('0x0'));var events=['save',_0x50cc('0x1'),'update'];function createListener(_0x10b8e2,_0x396b4c){return function(_0x2e1966){_0x396b4c[_0x50cc('0x2')](_0x10b8e2,_0x2e1966);};}function removeListener(_0x141544,_0x612e9d){return function(){MailInteractionEvents[_0x50cc('0x3')](_0x141544,_0x612e9d);};}exports[_0x50cc('0x4')]=function(_0x268c46){for(var _0x280a20=0x0,_0xf0dbc4=events['length'];_0x280a20<_0xf0dbc4;_0x280a20++){var _0x37db61=events[_0x280a20];var _0x22c5ba=createListener(_0x50cc('0x5')+_0x37db61,_0x268c46);MailInteractionEvents['on'](_0x37db61,_0x22c5ba);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2d87543..d7ac62d 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 _0x78f0=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy'];(function(_0x4c912e,_0x27299d){var _0x2fa424=function(_0x4b0cfb){while(--_0x4b0cfb){_0x4c912e['push'](_0x4c912e['shift']());}};_0x2fa424(++_0x27299d);}(_0x78f0,0x15d));var _0x078f=function(_0xc6beec,_0x49fff3){_0xc6beec=_0xc6beec-0x0;var _0x19d4e0=_0x78f0[_0xc6beec];return _0x19d4e0;};'use strict';var multer=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var path=require(_0x078f('0x2'));var timeout=require(_0x078f('0x3'));var express=require(_0x078f('0x4'));var router=express[_0x078f('0x5')]();var fs_extra=require(_0x078f('0x6'));var auth=require(_0x078f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x078f('0x8'));var controller=require(_0x078f('0x9'));router[_0x078f('0xa')]('/',auth[_0x078f('0xb')](),controller['index']);router[_0x078f('0xa')](_0x078f('0xc'),auth['isAuthenticated'](),controller[_0x078f('0xd')]);router[_0x078f('0xa')](_0x078f('0xe'),auth[_0x078f('0xb')](),controller[_0x078f('0xf')]);router[_0x078f('0xa')](_0x078f('0x10'),auth[_0x078f('0xb')](),controller['download']);router[_0x078f('0x11')]('/',auth[_0x078f('0xb')](),interaction['tracked'](_0x078f('0x12'),_0x078f('0x13')),controller[_0x078f('0x14')]);router[_0x078f('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x078f('0x16')]);router[_0x078f('0x15')](_0x078f('0x17'),auth[_0x078f('0xb')](),controller['accept']);router[_0x078f('0x15')](_0x078f('0x18'),auth['isAuthenticated'](),controller[_0x078f('0x19')]);router[_0x078f('0x1a')](_0x078f('0xe'),auth[_0x078f('0xb')](),controller[_0x078f('0x1b')]);module[_0x078f('0x1c')]=router; \ No newline at end of file +var _0xc8f8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','download','mailmessage:create','update','put','/:id/accept','/:id/reject','reject','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc8f8[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x8c8f('0x0'));var util=require(_0x8c8f('0x1'));var path=require(_0x8c8f('0x2'));var timeout=require(_0x8c8f('0x3'));var express=require('express');var router=express[_0x8c8f('0x4')]();var fs_extra=require(_0x8c8f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c8f('0x6'));var config=require(_0x8c8f('0x7'));var controller=require(_0x8c8f('0x8'));router[_0x8c8f('0x9')]('/',auth[_0x8c8f('0xa')](),controller[_0x8c8f('0xb')]);router[_0x8c8f('0x9')](_0x8c8f('0xc'),auth[_0x8c8f('0xa')](),controller[_0x8c8f('0xd')]);router[_0x8c8f('0x9')](_0x8c8f('0xe'),auth[_0x8c8f('0xa')](),controller['show']);router[_0x8c8f('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x8c8f('0xf')]);router['post']('/',auth[_0x8c8f('0xa')](),interaction['tracked']('mail',_0x8c8f('0x10')),controller['create']);router['put'](_0x8c8f('0xe'),auth['isAuthenticated'](),controller[_0x8c8f('0x11')]);router[_0x8c8f('0x12')](_0x8c8f('0x13'),auth[_0x8c8f('0xa')](),controller['accept']);router['put'](_0x8c8f('0x14'),auth[_0x8c8f('0xa')](),controller[_0x8c8f('0x15')]);router['delete'](_0x8c8f('0xe'),auth[_0x8c8f('0xa')](),controller['destroy']);module[_0x8c8f('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f5cd2cb..4690e91 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 _0xb1ed=['ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash','TEXT','long','medium','BOOLEAN'];(function(_0x556c94,_0x479bd3){var _0x12d9c5=function(_0x5f03de){while(--_0x5f03de){_0x556c94['push'](_0x556c94['shift']());}};_0x12d9c5(++_0x479bd3);}(_0xb1ed,0x1f2));var _0xdb1e=function(_0xee1ec9,_0x2f0599){_0xee1ec9=_0xee1ec9-0x0;var _0x102a53=_0xb1ed[_0xee1ec9];return _0x102a53;};'use strict';var Sequelize=require(_0xdb1e('0x0'));var _=require(_0xdb1e('0x1'));module['exports']={'body':{'type':Sequelize[_0xdb1e('0x2')](_0xdb1e('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xdb1e('0x4'))},'read':{'type':Sequelize[_0xdb1e('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb1e('0x6')]('in',_0xdb1e('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdb1e('0x8')](0x1fe)},'from':{'type':Sequelize[_0xdb1e('0x8')]},'to':{'type':Sequelize[_0xdb1e('0x2')](_0xdb1e('0x3'))},'cc':{'type':Sequelize['TEXT'](_0xdb1e('0x3'))},'bcc':{'type':Sequelize[_0xdb1e('0x2')](_0xdb1e('0x3'))},'subject':{'type':Sequelize[_0xdb1e('0x2')]},'sentAt':{'type':Sequelize[_0xdb1e('0x9')]},'attach':{'type':Sequelize[_0xdb1e('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xdb1e('0x2')](_0xdb1e('0x3'))},'originCc':{'type':Sequelize[_0xdb1e('0x2')](_0xdb1e('0x3'))},'originChannel':{'type':Sequelize[_0xdb1e('0x6')]('Email','Chat'),'defaultValue':_0xdb1e('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x657c=['Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2ea098,_0x246dbc){var _0x412d87=function(_0x34d31c){while(--_0x34d31c){_0x2ea098['push'](_0x2ea098['shift']());}};_0x412d87(++_0x246dbc);}(_0x657c,0x189));var _0xc657=function(_0x30d3fe,_0x3ad2f7){_0x30d3fe=_0x30d3fe-0x0;var _0xc9cb94=_0x657c[_0x30d3fe];return _0xc9cb94;};'use strict';var Sequelize=require(_0xc657('0x0'));var _=require(_0xc657('0x1'));module[_0xc657('0x2')]={'body':{'type':Sequelize[_0xc657('0x3')](_0xc657('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xc657('0x5'))},'read':{'type':Sequelize[_0xc657('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc657('0x7')]('in','out'),'defaultValue':_0xc657('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc657('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xc657('0x3')](_0xc657('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xc657('0x4'))},'bcc':{'type':Sequelize[_0xc657('0x3')](_0xc657('0x4'))},'subject':{'type':Sequelize[_0xc657('0x3')]},'sentAt':{'type':Sequelize[_0xc657('0xa')]},'attach':{'type':Sequelize[_0xc657('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc657('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xc657('0x3')](_0xc657('0x4'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xc657('0x7')](_0xc657('0xc'),_0xc657('0xd')),'defaultValue':_0xc657('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e314033..1086f67 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 _0x4d7b=['query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','then','rows','params','rawAttributes','length','body','find','destroy','describe','create','direction','out','split','findOne','List','Contacts','MailServerOut','Smtp','isNil','service','port','secure','authentication','auth','pass','user','attachments','join','root','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','mail','read','readAt','UserId','MailInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','MailInteractionId','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','fullname','email','internal','interface','fromString','rejectmessage','download','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','basename','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','offset','undefined','count','limit','set','Content-Range','update','end','sendStatus','name','index','map','MailMessage','fieldName','type'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x4d7b,0x73));var _0xb4d7=function(_0x129bf3,_0x586d9b){_0x129bf3=_0x129bf3-0x0;var _0x2993dd=_0x4d7b[_0x129bf3];return _0x2993dd;};'use strict';var emlformat=require(_0xb4d7('0x0'));var moment=require(_0xb4d7('0x1'));var BPromise=require(_0xb4d7('0x2'));var util=require(_0xb4d7('0x3'));var path=require(_0xb4d7('0x4'));var fs=require('fs');var _=require(_0xb4d7('0x5'));var Redis=require('ioredis');var htmlToText=require(_0xb4d7('0x6'));var qs=require(_0xb4d7('0x7'));var logger=require('../../config/logger')(_0xb4d7('0x8'));var interaction_log=require(_0xb4d7('0x9'))('mail-interactions');var config=require(_0xb4d7('0xa'));var db=require(_0xb4d7('0xb'))['db'];config[_0xb4d7('0xc')]=_[_0xb4d7('0xd')](config[_0xb4d7('0xc')],{'host':_0xb4d7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4d7('0xc')]));var htmlEntities=require(_0xb4d7('0xf'));require(_0xb4d7('0x10'))[_0xb4d7('0x11')](socket);var jayson=require(_0xb4d7('0x12'));var client=jayson[_0xb4d7('0x13')]['http']({'port':0x232c});var client9003=jayson[_0xb4d7('0x13')][_0xb4d7('0x14')]({'port':0x232b});var client9002=jayson[_0xb4d7('0x13')][_0xb4d7('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x49e31d,_0x441689,_0x4a10bd,_0x51f013){return new BPromise(function(_0x54a911,_0x467c10){var _0x4b215c=_0x51f013||client;return _0x4b215c[_0xb4d7('0x15')](_0x49e31d,_0x4a10bd)['then'](function(_0x8b8956){logger[_0xb4d7('0x16')]('MailMessage,\x20%s,\x20%s',_0x441689,_0xb4d7('0x17'));logger[_0xb4d7('0x18')](_0xb4d7('0x19'),_0x441689,_0xb4d7('0x17'),JSON['stringify'](_0x8b8956));if(_0x8b8956[_0xb4d7('0x1a')]){if(_0x8b8956[_0xb4d7('0x1a')][_0xb4d7('0x1b')]===0x1f4){logger[_0xb4d7('0x1a')](_0xb4d7('0x1c'),_0x441689,_0x8b8956[_0xb4d7('0x1a')]['message']);return _0x467c10(_0x8b8956[_0xb4d7('0x1a')][_0xb4d7('0x1d')]);}logger[_0xb4d7('0x1a')](_0xb4d7('0x1c'),_0x441689,_0x8b8956[_0xb4d7('0x1a')][_0xb4d7('0x1d')]);return _0x54a911(_0x8b8956[_0xb4d7('0x1a')]['message']);}else{logger['info'](_0xb4d7('0x1c'),_0x441689,_0xb4d7('0x17'));_0x54a911(_0x8b8956['result']['message']);}})[_0xb4d7('0x1e')](function(_0x447f93){logger['error']('MailMessage,\x20%s,\x20%s',_0x441689,_0x447f93);_0x467c10(_0x447f93);});});}function respondWithResult(_0x183071,_0x2ba06e){_0x2ba06e=_0x2ba06e||0xc8;return function(_0x28b0ea){if(_0x28b0ea){return _0x183071[_0xb4d7('0x1f')](_0x2ba06e)['json'](_0x28b0ea);}};}function respondWithFilteredResult(_0x37413f,_0x3fc616){return function(_0x215879){if(_0x215879){var _0x14302d=typeof _0x3fc616[_0xb4d7('0x20')]===_0xb4d7('0x21')&&typeof _0x3fc616['limit']===_0xb4d7('0x21');var _0xc17e44=_0x215879[_0xb4d7('0x22')];var _0x3aef91=_0x14302d?0x0:_0x3fc616['offset'];var _0xd320f1=_0x14302d?_0x215879[_0xb4d7('0x22')]:_0x3fc616[_0xb4d7('0x20')]+_0x3fc616[_0xb4d7('0x23')];var _0x8186dd;if(_0xd320f1>=_0xc17e44){_0xd320f1=_0xc17e44;_0x8186dd=0xc8;}else{_0x8186dd=0xce;}_0x37413f['status'](_0x8186dd);return _0x37413f[_0xb4d7('0x24')](_0xb4d7('0x25'),_0x3aef91+'-'+_0xd320f1+'/'+_0xc17e44)['json'](_0x215879);}return null;};}function saveUpdates(_0x280da7){return function(_0x32cce9){if(_0x32cce9){return _0x32cce9[_0xb4d7('0x26')](_0x280da7)['then'](function(_0x3354b6){return _0x3354b6;});}return null;};}function removeEntity(_0x277c89){return function(_0x571efe){if(_0x571efe){return _0x571efe['destroy']()['then'](function(){_0x277c89[_0xb4d7('0x1f')](0xcc)[_0xb4d7('0x27')]();});}};}function handleEntityNotFound(_0x448dc1){return function(_0x2633ce){if(!_0x2633ce){_0x448dc1[_0xb4d7('0x28')](0x194);}return _0x2633ce;};}function handleError(_0x3a4395,_0x2778c9){_0x2778c9=_0x2778c9||0x1f4;return function(_0x229b5a){logger['error'](_0x229b5a['stack']);if(_0x229b5a[_0xb4d7('0x29')]){delete _0x229b5a[_0xb4d7('0x29')];}_0x3a4395[_0xb4d7('0x1f')](_0x2778c9)['send'](_0x229b5a);};}exports[_0xb4d7('0x2a')]=function(_0x18f27c,_0x3772c5){var _0x1ce987={},_0x5bb60f={},_0x443466={'count':0x0,'rows':[]};var _0x3819a2=_[_0xb4d7('0x2b')](db[_0xb4d7('0x2c')]['rawAttributes'],function(_0x52348f){return{'name':_0x52348f[_0xb4d7('0x2d')],'type':_0x52348f[_0xb4d7('0x2e')]['key']};});_0x5bb60f['model']=_['map'](_0x3819a2,_0xb4d7('0x29'));_0x5bb60f[_0xb4d7('0x2f')]=_[_0xb4d7('0x30')](_0x18f27c[_0xb4d7('0x2f')]);_0x5bb60f[_0xb4d7('0x31')]=_[_0xb4d7('0x32')](_0x5bb60f[_0xb4d7('0x33')],_0x5bb60f[_0xb4d7('0x2f')]);_0x1ce987[_0xb4d7('0x34')]=_[_0xb4d7('0x32')](_0x5bb60f['model'],qs[_0xb4d7('0x35')](_0x18f27c[_0xb4d7('0x2f')]['fields']));_0x1ce987[_0xb4d7('0x34')]=_0x1ce987[_0xb4d7('0x34')]['length']?_0x1ce987[_0xb4d7('0x34')]:_0x5bb60f[_0xb4d7('0x33')];if(!_0x18f27c[_0xb4d7('0x2f')][_0xb4d7('0x36')](_0xb4d7('0x37'))){_0x1ce987[_0xb4d7('0x23')]=qs[_0xb4d7('0x23')](_0x18f27c[_0xb4d7('0x2f')]['limit']);_0x1ce987[_0xb4d7('0x20')]=qs[_0xb4d7('0x20')](_0x18f27c[_0xb4d7('0x2f')][_0xb4d7('0x20')]);}_0x1ce987[_0xb4d7('0x38')]=qs[_0xb4d7('0x39')](_0x18f27c['query']['sort']);_0x1ce987[_0xb4d7('0x3a')]=qs['filters'](_[_0xb4d7('0x3b')](_0x18f27c[_0xb4d7('0x2f')],_0x5bb60f[_0xb4d7('0x31')]),_0x3819a2);if(_0x18f27c[_0xb4d7('0x2f')][_0xb4d7('0x3c')]){_0x1ce987[_0xb4d7('0x3a')]=_['merge'](_0x1ce987[_0xb4d7('0x3a')],{'$or':_['map'](_0x3819a2,function(_0x3f15d4){if(_0x3f15d4['type']!==_0xb4d7('0x3d')){var _0x30e71e={};_0x30e71e[_0x3f15d4['name']]={'$like':'%'+_0x18f27c['query'][_0xb4d7('0x3c')]+'%'};return _0x30e71e;}})});}_0x1ce987=_[_0xb4d7('0x3e')]({},_0x1ce987,_0x18f27c['options']);var _0x13ccf1={'where':_0x1ce987[_0xb4d7('0x3a')]};return db[_0xb4d7('0x2c')][_0xb4d7('0x22')](_0x13ccf1)['then'](function(_0x1fdb1a){_0x443466[_0xb4d7('0x22')]=_0x1fdb1a;if(_0x18f27c['query'][_0xb4d7('0x3f')]){_0x1ce987[_0xb4d7('0x40')]=[{'all':!![]}];}return db[_0xb4d7('0x2c')][_0xb4d7('0x41')](_0x1ce987);})[_0xb4d7('0x42')](function(_0x476bad){_0x443466[_0xb4d7('0x43')]=_0x476bad;return _0x443466;})[_0xb4d7('0x42')](respondWithFilteredResult(_0x3772c5,_0x1ce987))[_0xb4d7('0x1e')](handleError(_0x3772c5,null));};exports['show']=function(_0x28ab3a,_0x272ae9){var _0x4861ed={'raw':!![],'where':{'id':_0x28ab3a[_0xb4d7('0x44')]['id']}},_0x44407f={};_0x44407f['model']=_[_0xb4d7('0x30')](db[_0xb4d7('0x2c')][_0xb4d7('0x45')]);_0x44407f['query']=_['keys'](_0x28ab3a[_0xb4d7('0x2f')]);_0x44407f[_0xb4d7('0x31')]=_[_0xb4d7('0x32')](_0x44407f[_0xb4d7('0x33')],_0x44407f[_0xb4d7('0x2f')]);_0x4861ed[_0xb4d7('0x34')]=_[_0xb4d7('0x32')](_0x44407f[_0xb4d7('0x33')],qs[_0xb4d7('0x35')](_0x28ab3a['query']['fields']));_0x4861ed[_0xb4d7('0x34')]=_0x4861ed['attributes'][_0xb4d7('0x46')]?_0x4861ed[_0xb4d7('0x34')]:_0x44407f[_0xb4d7('0x33')];if(_0x28ab3a['query'][_0xb4d7('0x3f')]){_0x4861ed[_0xb4d7('0x40')]=[{'all':!![]}];}_0x4861ed=_[_0xb4d7('0x3e')]({},_0x4861ed,_0x28ab3a['options']);return db[_0xb4d7('0x2c')]['find'](_0x4861ed)['then'](handleEntityNotFound(_0x272ae9,null))[_0xb4d7('0x42')](respondWithResult(_0x272ae9,null))[_0xb4d7('0x1e')](handleError(_0x272ae9,null));};exports[_0xb4d7('0x26')]=function(_0x2aedfd,_0x597cae){if(_0x2aedfd[_0xb4d7('0x47')]['id']){delete _0x2aedfd[_0xb4d7('0x47')]['id'];}return db['MailMessage'][_0xb4d7('0x48')]({'where':{'id':_0x2aedfd[_0xb4d7('0x44')]['id']}})[_0xb4d7('0x42')](handleEntityNotFound(_0x597cae,null))[_0xb4d7('0x42')](saveUpdates(_0x2aedfd['body'],null))['then'](respondWithResult(_0x597cae,null))['catch'](handleError(_0x597cae,null));};exports[_0xb4d7('0x49')]=function(_0x4890eb,_0x3214f8){return db[_0xb4d7('0x2c')][_0xb4d7('0x48')]({'where':{'id':_0x4890eb[_0xb4d7('0x44')]['id']}})[_0xb4d7('0x42')](handleEntityNotFound(_0x3214f8,null))['then'](removeEntity(_0x3214f8,null))[_0xb4d7('0x1e')](handleError(_0x3214f8,null));};exports[_0xb4d7('0x4a')]=function(_0x1fd3de,_0x161675){return db[_0xb4d7('0x2c')][_0xb4d7('0x4a')]()[_0xb4d7('0x42')](respondWithResult(_0x161675,null))[_0xb4d7('0x1e')](handleError(_0x161675,null));};exports[_0xb4d7('0x4b')]=function(_0x19c352,_0x505e73){return db[_0xb4d7('0x2c')][_0xb4d7('0x4b')](_0x19c352[_0xb4d7('0x47')])[_0xb4d7('0x42')](function(_0x3809e8){if(_0x3809e8){if(_0x3809e8[_0xb4d7('0x4c')]===_0xb4d7('0x4d')&&!_0x3809e8['secret']){var _0x33a52c,_0x4f72a4,_0x49379a;if(_0x19c352['body']['to']){_0x4f72a4=_0x19c352[_0xb4d7('0x47')]['to'][_0xb4d7('0x4e')](',')[0x0];}return db['MailAccount'][_0xb4d7('0x4f')]({'where':{'id':_0x3809e8['MailAccountId']},'include':[{'model':db['CmList'],'as':_0xb4d7('0x50'),'include':[{'model':db['CmContact'],'as':_0xb4d7('0x51'),'where':{'email':_0x4f72a4},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xb4d7('0x52')],'as':_0xb4d7('0x53'),'raw':!![]}]})[_0xb4d7('0x42')](function(_0x5e01c7){_0x33a52c=_0x5e01c7;if(_0x33a52c&&_0x33a52c[_0xb4d7('0x53')]){var _0x403443={'tls':{'rejectUnauthorized':![]}};if(_[_0xb4d7('0x54')](_0x33a52c[_0xb4d7('0x53')][_0xb4d7('0x55')])){_0x403443['host']=_0x33a52c[_0xb4d7('0x53')]['host'];_0x403443[_0xb4d7('0x56')]=_0x33a52c['Smtp'][_0xb4d7('0x56')];_0x403443[_0xb4d7('0x57')]=_0x33a52c[_0xb4d7('0x53')][_0xb4d7('0x57')];if(_0x33a52c[_0xb4d7('0x53')][_0xb4d7('0x58')]){_0x403443[_0xb4d7('0x59')]={'user':_0x33a52c[_0xb4d7('0x53')]['user'],'pass':_0x33a52c[_0xb4d7('0x53')][_0xb4d7('0x5a')]};}}else{_0x403443['service']=_0x33a52c['Smtp'][_0xb4d7('0x55')];_0x403443['auth']={'user':_0x33a52c[_0xb4d7('0x53')][_0xb4d7('0x5b')],'pass':_0x33a52c['Smtp'][_0xb4d7('0x5a')]};_0x403443[_0xb4d7('0x57')]=_0x33a52c['Smtp'][_0xb4d7('0x57')];}if(_0x19c352[_0xb4d7('0x47')][_0xb4d7('0x5c')]&&_0x19c352['body'][_0xb4d7('0x5c')][_0xb4d7('0x46')]){for(var _0x5a83dc=0x0;_0x5a83dc<_0x19c352[_0xb4d7('0x47')][_0xb4d7('0x5c')]['length'];_0x5a83dc+=0x1){_0x19c352[_0xb4d7('0x47')]['attachments'][_0x5a83dc]={'filename':_0x19c352[_0xb4d7('0x47')][_0xb4d7('0x5c')][_0x5a83dc][_0xb4d7('0x29')],'path':path[_0xb4d7('0x5d')](config[_0xb4d7('0x5e')],'server/files/attachments',_0x19c352[_0xb4d7('0x47')][_0xb4d7('0x5c')][_0x5a83dc]['basename'])};}}_0x49379a={'account':_0x403443,'message':_0x19c352[_0xb4d7('0x47')]};return;}})['then'](function(){if(_0x33a52c[_0xb4d7('0x50')]){if(_0x33a52c[_0xb4d7('0x50')][_0xb4d7('0x51')][_0xb4d7('0x46')]){return _0x33a52c[_0xb4d7('0x50')][_0xb4d7('0x51')][0x0];}else{return db['CmContact'][_0xb4d7('0x4b')](_[_0xb4d7('0xd')](_0x19c352[_0xb4d7('0x47')],{'firstName':_0x19c352[_0xb4d7('0x47')]['to'],'email':_0x19c352[_0xb4d7('0x47')]['to'],'phone':_0x19c352['body']['to'],'ListId':_0x33a52c['ListId']}));}}else{throw new Error(_0xb4d7('0x5f'));}})[_0xb4d7('0x42')](function(){if(_0x49379a){return respondWithRpcPromise(_0xb4d7('0x60'),_0xb4d7('0x61'),_0x49379a,client9003)[_0xb4d7('0x42')](function(_0x490665){return _0x3809e8['update']({'read':!![],'messageId':_0x490665[_0xb4d7('0x62')],'sentAt':moment()[_0xb4d7('0x63')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb4d7('0x1e')](function(_0x14a1b7){logger[_0xb4d7('0x1a')]('%s',JSON[_0xb4d7('0x64')](_0x14a1b7));return _0x3809e8;});}return _0x3809e8;});}return _0x3809e8;}})[_0xb4d7('0x42')](respondWithResult(_0x505e73,0xc9))[_0xb4d7('0x1e')](handleError(_0x505e73,null));};exports[_0xb4d7('0x65')]=function(_0x4cdc7c,_0x509559){var _0x5b5976={'agent':{},'channel':_0xb4d7('0x66')};if(_0x4cdc7c[_0xb4d7('0x47')]['id']){delete _0x4cdc7c[_0xb4d7('0x47')]['id'];}_0x4cdc7c[_0xb4d7('0x47')][_0xb4d7('0x67')]=!![];_0x4cdc7c[_0xb4d7('0x47')][_0xb4d7('0x68')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4cdc7c['body'][_0xb4d7('0x69')]=_0x4cdc7c[_0xb4d7('0x47')]['UserId']||_0x4cdc7c[_0xb4d7('0x5b')]['id'];_0x5b5976['agent']['id']=_0x4cdc7c[_0xb4d7('0x47')][_0xb4d7('0x69')];return db['MailMessage'][_0xb4d7('0x48')]({'where':{'id':_0x4cdc7c[_0xb4d7('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x509559,null))[_0xb4d7('0x42')](saveUpdates(_0x4cdc7c['body'],null))[_0xb4d7('0x42')](function(_0x271446){if(_0x271446){_0x5b5976[_0xb4d7('0x1d')]=_0x271446['get']({'plain':!![]});return db[_0xb4d7('0x6a')][_0xb4d7('0x48')]({'where':{'id':_0x271446['MailInteractionId']}});}return null;})[_0xb4d7('0x42')](handleEntityNotFound(_0x509559,null))['then'](function(_0x5a0a28){if(_0x5a0a28){return _0x5a0a28[_0xb4d7('0x26')]({'UserId':_0x4cdc7c['body'][_0xb4d7('0x69')],'read1stAt':_[_0xb4d7('0x54')](_0x5a0a28[_0xb4d7('0x6b')])?moment()[_0xb4d7('0x63')](_0xb4d7('0x6c')):undefined});}return null;})[_0xb4d7('0x42')](function(_0x413a35){if(_0x413a35){_0x5b5976[_0xb4d7('0x6d')]=_0x413a35['get']({'plain':!![]});interaction_log[_0xb4d7('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cdc7c[_0xb4d7('0x5b')]['id'],_0x4cdc7c[_0xb4d7('0x5b')][_0xb4d7('0x29')],_0x4cdc7c[_0xb4d7('0x5b')][_0xb4d7('0x6e')],_0x5b5976[_0xb4d7('0x6d')]['id'],_0x4cdc7c[_0xb4d7('0x47')]?JSON[_0xb4d7('0x64')](_0x4cdc7c['body']):_0xb4d7('0x6f'));return respondWithRpcPromise(_0xb4d7('0x70'),_0xb4d7('0x71'),_0x5b5976);}return null;})['then'](function(_0x35d8fe){var _0x4cdba8=_0xb4d7('0x72')+_0x35d8fe['message']['ContactId'];return db[_0xb4d7('0x73')]['query'](_0x4cdba8,{'type':db[_0xb4d7('0x74')][_0xb4d7('0x75')]['SELECT'],'raw':!![]})[_0xb4d7('0x42')](function(_0x53a038){return _0x53a038;});})[_0xb4d7('0x42')](function(_0x38af18){if(_0x38af18){_0x5b5976[_0xb4d7('0x1d')][_0xb4d7('0x76')]=_0x38af18[0x0];if(!_0x4cdc7c[_0xb4d7('0x47')][_0xb4d7('0x69')])return;return db[_0xb4d7('0x77')][_0xb4d7('0x48')]({'where':{'id':_0x4cdc7c[_0xb4d7('0x47')]['UserId'],'role':_0xb4d7('0x78')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xb4d7('0x42')](function(_0x299e02){if(!_0x299e02)return null;_0x5b5976[_0xb4d7('0x1d')]['agent']=_0x299e02;return _0x5b5976;})['then'](function(_0x426633){if(_0x426633){if(_0x4cdc7c[_0xb4d7('0x47')][_0xb4d7('0x79')]){_0x5b5976['message']['interface']=util[_0xb4d7('0x63')](_0xb4d7('0x7a'),_0x4cdc7c[_0xb4d7('0x5b')]['name']);_0x5b5976[_0xb4d7('0x1d')][_0xb4d7('0x7b')]=_0x5b5976[_0xb4d7('0x7b')];_0x5b5976[_0xb4d7('0x1d')][_0xb4d7('0x7c')]=_0x5b5976[_0xb4d7('0x7b')];_0x5b5976[_0xb4d7('0x1d')][_0xb4d7('0x7d')]=_0xb4d7('0x65');_0x5b5976['message'][_0xb4d7('0x47')]=htmlToText['fromString'](_0x5b5976[_0xb4d7('0x1d')][_0xb4d7('0x47')]);return respondWithRpcPromise(_0xb4d7('0x7e'),_0xb4d7('0x7e'),{'event':_0xb4d7('0x7f'),'message':_0x5b5976['message']},client9002)['then'](function(){return _0x5b5976;});}return _0x5b5976;}return null;})[_0xb4d7('0x42')](respondWithResult(_0x509559,null))[_0xb4d7('0x1e')](handleError(_0x509559,null));};exports['reject']=function(_0x23dae4,_0x1809ee){var _0xed954b={'agent':{},'channel':_0xb4d7('0x66')};if(_0x23dae4[_0xb4d7('0x47')]['id']){delete _0x23dae4[_0xb4d7('0x47')]['id'];}_0x23dae4['body'][_0xb4d7('0x69')]=_0x23dae4[_0xb4d7('0x47')][_0xb4d7('0x69')]||_0x23dae4['user']['id'];_0xed954b[_0xb4d7('0x78')]['id']=_0x23dae4['body'][_0xb4d7('0x69')];return db[_0xb4d7('0x2c')][_0xb4d7('0x48')]({'where':{'id':_0x23dae4[_0xb4d7('0x44')]['id'],'UserId':null}})[_0xb4d7('0x42')](handleEntityNotFound(_0x1809ee,null))[_0xb4d7('0x42')](function(_0x18984a){if(_0x18984a){_0xed954b[_0xb4d7('0x1d')]=_0x18984a['get']({'plain':!![]});return db[_0xb4d7('0x6a')]['find']({'where':{'id':_0x18984a[_0xb4d7('0x80')]}});}return null;})[_0xb4d7('0x42')](handleEntityNotFound(_0x1809ee,null))[_0xb4d7('0x42')](function(_0x493607){if(_0x493607){_0xed954b[_0xb4d7('0x6d')]=_0x493607[_0xb4d7('0x81')]({'plain':!![]});interaction_log['info'](_0xb4d7('0x82'),_0x23dae4[_0xb4d7('0x5b')]['id'],_0x23dae4[_0xb4d7('0x5b')][_0xb4d7('0x29')],_0x23dae4[_0xb4d7('0x5b')][_0xb4d7('0x6e')],_0xed954b['interaction']['id'],_0x23dae4['body']?JSON[_0xb4d7('0x64')](_0x23dae4[_0xb4d7('0x47')]):_0xb4d7('0x6f'));return respondWithRpcPromise(_0xb4d7('0x83'),_0xb4d7('0x84'),_0xed954b);}return null;})['then'](function(_0x2bd39a){var _0x4f1ade=_0xb4d7('0x72')+_0x2bd39a[_0xb4d7('0x1d')][_0xb4d7('0x85')];return db[_0xb4d7('0x73')][_0xb4d7('0x2f')](_0x4f1ade,{'type':db[_0xb4d7('0x74')][_0xb4d7('0x75')][_0xb4d7('0x86')],'raw':!![]})[_0xb4d7('0x42')](function(_0x18880b){return _0x18880b;});})['then'](function(_0x393afc){if(_0x393afc){_0xed954b['message'][_0xb4d7('0x76')]=_0x393afc[0x0];if(!_0x23dae4[_0xb4d7('0x47')]['UserId'])return;return db[_0xb4d7('0x77')][_0xb4d7('0x48')]({'where':{'id':_0x23dae4[_0xb4d7('0x47')][_0xb4d7('0x69')],'role':_0xb4d7('0x78')},'attributes':['id','name',_0xb4d7('0x87'),_0xb4d7('0x88'),_0xb4d7('0x89')],'raw':!![]});}return null;})[_0xb4d7('0x42')](function(_0x4343b1){if(!_0x4343b1)return null;_0xed954b[_0xb4d7('0x1d')][_0xb4d7('0x78')]=_0x4343b1;return _0xed954b;})[_0xb4d7('0x42')](function(_0x1e20c7){if(_0x1e20c7){_0x1e20c7['message'][_0xb4d7('0x8a')]=util['format'](_0xb4d7('0x7a'),_0x23dae4['user'][_0xb4d7('0x29')]);_0x1e20c7['message'][_0xb4d7('0x7b')]=_0xed954b['channel'];_0x1e20c7[_0xb4d7('0x1d')][_0xb4d7('0x7c')]=_0xed954b[_0xb4d7('0x7b')];_0x1e20c7[_0xb4d7('0x1d')][_0xb4d7('0x7d')]='reject';_0x1e20c7[_0xb4d7('0x1d')][_0xb4d7('0x47')]=htmlToText[_0xb4d7('0x8b')](_0xed954b['message']['body']);respondWithRpcPromise(_0xb4d7('0x7e'),'EventManager',{'event':_0xb4d7('0x8c'),'message':_0x1e20c7[_0xb4d7('0x1d')]},client9002);return _0xed954b;}return null;})[_0xb4d7('0x42')](respondWithResult(_0x1809ee,null))[_0xb4d7('0x1e')](handleError(_0x1809ee,null));};exports[_0xb4d7('0x8d')]=function(_0x51263c,_0x156f7b){var _0x1b2c02=moment()['unix']()[_0xb4d7('0x8e')]();var _0x4d4edb=path[_0xb4d7('0x5d')](config[_0xb4d7('0x5e')],'server',_0xb4d7('0x8f'),_0xb4d7('0x90'));var _0x27487e=path[_0xb4d7('0x5d')](config[_0xb4d7('0x5e')],_0xb4d7('0x91'),_0xb4d7('0x8f'),_0xb4d7('0x5c'));var _0x4c5eb5=util['format'](_0xb4d7('0x92'),_0x1b2c02);return db[_0xb4d7('0x2c')][_0xb4d7('0x48')]({'where':{'id':_0x51263c[_0xb4d7('0x44')]['id']},'attributes':['id',_0xb4d7('0x47'),_0xb4d7('0x93'),'to','cc',_0xb4d7('0x94'),_0xb4d7('0x95'),_0xb4d7('0x96')],'include':_0x51263c['query'][_0xb4d7('0x5c')]?[{'model':db[_0xb4d7('0x97')],'as':_0xb4d7('0x98')}]:undefined})[_0xb4d7('0x42')](handleEntityNotFound(_0x156f7b,null))[_0xb4d7('0x42')](function(_0x135e9d){if(_0x135e9d){var _0x1b7c45=_0x135e9d;var _0x2632a2={'from':_0x1b7c45[_0xb4d7('0x93')],'to':_0x1b7c45['to'],'subject':_0x1b7c45[_0xb4d7('0x95')],'html':htmlEntities[_0xb4d7('0x99')](_0x1b7c45[_0xb4d7('0x47')]),'headers':{'Date':moment(_0x1b7c45['createdAt'])[_0xb4d7('0x63')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x135e9d['cc']){_0x2632a2[_0xb4d7('0x9a')]['Cc']=_0x135e9d['cc'];}if(_0x135e9d[_0xb4d7('0x94')]){_0x2632a2[_0xb4d7('0x9a')][_0xb4d7('0x9b')]=_0x135e9d[_0xb4d7('0x94')];}return new BPromise(function(_0x3c835b,_0xf300c8){if(_0x135e9d[_0xb4d7('0x98')]){for(var _0x568876=0x0;_0x568876<_0x135e9d[_0xb4d7('0x98')]['length'];_0x568876++){var _0x220c17=_0x135e9d['Attachments'][_0x568876];var _0x3f7d48=path[_0xb4d7('0x5d')](_0x27487e,_0x220c17[_0xb4d7('0x9c')]);if(fs[_0xb4d7('0x9d')](_0x3f7d48)){_0x2632a2[_0xb4d7('0x5c')][_0xb4d7('0x9e')]({'name':_0x220c17[_0xb4d7('0x29')],'contentType':_0x220c17[_0xb4d7('0x2e')],'data':fs[_0xb4d7('0x9f')](_0x3f7d48)});}}}emlformat[_0xb4d7('0xa0')](_0x2632a2,function(_0x1f368b,_0x5115b7){if(_0x1f368b)return _0xf300c8(_0x1f368b);fs['writeFileSync'](path[_0xb4d7('0x5d')](_0x4d4edb,_0x4c5eb5),_0x5115b7);return _0x3c835b(_0x5115b7);});});}})[_0xb4d7('0x42')](function(_0x375455){if(_0x375455){return _0x156f7b['download'](path['join'](_0x4d4edb,_0x4c5eb5),_0x4c5eb5,function(_0x580866){if(!_0x580866)fs[_0xb4d7('0xa1')](path['join'](_0x4d4edb,_0x4c5eb5));});}})[_0xb4d7('0x1e')](handleError(_0x156f7b,null));}; \ No newline at end of file +var _0x61b2=['include','rows','params','find','body','describe','create','direction','out','secret','split','MailAccount','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','isNil','service','host','Smtp','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','get','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','accept','fromString','EventManager','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','User','fullname','motionChannel','rejectmessage','download','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','build','writeFileSync','eml-format','moment','bluebird','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','defaults','redis','localhost','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','MailMessage','rawAttributes','fieldName','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll'];(function(_0x3f6c60,_0x486af8){var _0x2bbe6a=function(_0x25c875){while(--_0x25c875){_0x3f6c60['push'](_0x3f6c60['shift']());}};_0x2bbe6a(++_0x486af8);}(_0x61b2,0x1a9));var _0x261b=function(_0x3818f6,_0x1635f3){_0x3818f6=_0x3818f6-0x0;var _0x54bf1e=_0x61b2[_0x3818f6];return _0x54bf1e;};'use strict';var emlformat=require(_0x261b('0x0'));var moment=require(_0x261b('0x1'));var BPromise=require(_0x261b('0x2'));var util=require('util');var path=require(_0x261b('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x261b('0x4'));var htmlToText=require(_0x261b('0x5'));var qs=require(_0x261b('0x6'));var logger=require(_0x261b('0x7'))(_0x261b('0x8'));var interaction_log=require(_0x261b('0x7'))(_0x261b('0x9'));var config=require(_0x261b('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x261b('0xb')](config[_0x261b('0xc')],{'host':_0x261b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x261b('0xc')]));var htmlEntities=require(_0x261b('0xe'));require(_0x261b('0xf'))[_0x261b('0x10')](socket);var jayson=require(_0x261b('0x11'));var client=jayson['client'][_0x261b('0x12')]({'port':0x232c});var client9003=jayson[_0x261b('0x13')][_0x261b('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x261b('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x41773c,_0x19035c,_0x40d71a,_0x346966){return new BPromise(function(_0x1493a9,_0x2cb9eb){var _0x91b316=_0x346966||client;return _0x91b316[_0x261b('0x14')](_0x41773c,_0x40d71a)[_0x261b('0x15')](function(_0x2e2c5a){logger['info'](_0x261b('0x16'),_0x19035c,_0x261b('0x17'));logger[_0x261b('0x18')](_0x261b('0x19'),_0x19035c,_0x261b('0x17'),JSON[_0x261b('0x1a')](_0x2e2c5a));if(_0x2e2c5a[_0x261b('0x1b')]){if(_0x2e2c5a[_0x261b('0x1b')][_0x261b('0x1c')]===0x1f4){logger[_0x261b('0x1b')](_0x261b('0x16'),_0x19035c,_0x2e2c5a[_0x261b('0x1b')]['message']);return _0x2cb9eb(_0x2e2c5a[_0x261b('0x1b')][_0x261b('0x1d')]);}logger[_0x261b('0x1b')](_0x261b('0x16'),_0x19035c,_0x2e2c5a[_0x261b('0x1b')][_0x261b('0x1d')]);return _0x1493a9(_0x2e2c5a['error'][_0x261b('0x1d')]);}else{logger['info'](_0x261b('0x16'),_0x19035c,'request\x20sent');_0x1493a9(_0x2e2c5a[_0x261b('0x1e')]['message']);}})[_0x261b('0x1f')](function(_0x5ab437){logger[_0x261b('0x1b')](_0x261b('0x16'),_0x19035c,_0x5ab437);_0x2cb9eb(_0x5ab437);});});}function respondWithResult(_0x43936e,_0x25be7f){_0x25be7f=_0x25be7f||0xc8;return function(_0x5df675){if(_0x5df675){return _0x43936e[_0x261b('0x20')](_0x25be7f)['json'](_0x5df675);}};}function respondWithFilteredResult(_0x56edd2,_0x44beac){return function(_0x30f150){if(_0x30f150){var _0x5922a6=typeof _0x44beac['offset']===_0x261b('0x21')&&typeof _0x44beac[_0x261b('0x22')]==='undefined';var _0x2fa9d5=_0x30f150[_0x261b('0x23')];var _0x4803a0=_0x5922a6?0x0:_0x44beac['offset'];var _0x116a92=_0x5922a6?_0x30f150[_0x261b('0x23')]:_0x44beac[_0x261b('0x24')]+_0x44beac['limit'];var _0x2f00c4;if(_0x116a92>=_0x2fa9d5){_0x116a92=_0x2fa9d5;_0x2f00c4=0xc8;}else{_0x2f00c4=0xce;}_0x56edd2[_0x261b('0x20')](_0x2f00c4);return _0x56edd2[_0x261b('0x25')](_0x261b('0x26'),_0x4803a0+'-'+_0x116a92+'/'+_0x2fa9d5)[_0x261b('0x27')](_0x30f150);}return null;};}function saveUpdates(_0x3f4193){return function(_0x2c6918){if(_0x2c6918){return _0x2c6918[_0x261b('0x28')](_0x3f4193)[_0x261b('0x15')](function(_0x3b8e98){return _0x3b8e98;});}return null;};}function removeEntity(_0x5a978f){return function(_0x1f8f4d){if(_0x1f8f4d){return _0x1f8f4d[_0x261b('0x29')]()[_0x261b('0x15')](function(){_0x5a978f[_0x261b('0x20')](0xcc)[_0x261b('0x2a')]();});}};}function handleEntityNotFound(_0x5e5502){return function(_0xcc5319){if(!_0xcc5319){_0x5e5502[_0x261b('0x2b')](0x194);}return _0xcc5319;};}function handleError(_0x364d05,_0xc0c5b8){_0xc0c5b8=_0xc0c5b8||0x1f4;return function(_0x2068f0){logger[_0x261b('0x1b')](_0x2068f0[_0x261b('0x2c')]);if(_0x2068f0[_0x261b('0x2d')]){delete _0x2068f0[_0x261b('0x2d')];}_0x364d05[_0x261b('0x20')](_0xc0c5b8)[_0x261b('0x2e')](_0x2068f0);};}exports['index']=function(_0xdbf3b9,_0x327551){var _0x3c0707={},_0x2251be={},_0x5c5b57={'count':0x0,'rows':[]};var _0x2173b6=_['map'](db[_0x261b('0x2f')][_0x261b('0x30')],function(_0x1417e1){return{'name':_0x1417e1[_0x261b('0x31')],'type':_0x1417e1['type']['key']};});_0x2251be[_0x261b('0x32')]=_[_0x261b('0x33')](_0x2173b6,'name');_0x2251be['query']=_[_0x261b('0x34')](_0xdbf3b9[_0x261b('0x35')]);_0x2251be['filters']=_[_0x261b('0x36')](_0x2251be[_0x261b('0x32')],_0x2251be[_0x261b('0x35')]);_0x3c0707[_0x261b('0x37')]=_[_0x261b('0x36')](_0x2251be['model'],qs[_0x261b('0x38')](_0xdbf3b9[_0x261b('0x35')][_0x261b('0x38')]));_0x3c0707[_0x261b('0x37')]=_0x3c0707[_0x261b('0x37')][_0x261b('0x39')]?_0x3c0707['attributes']:_0x2251be[_0x261b('0x32')];if(!_0xdbf3b9[_0x261b('0x35')][_0x261b('0x3a')]('nolimit')){_0x3c0707[_0x261b('0x22')]=qs['limit'](_0xdbf3b9['query'][_0x261b('0x22')]);_0x3c0707[_0x261b('0x24')]=qs[_0x261b('0x24')](_0xdbf3b9[_0x261b('0x35')][_0x261b('0x24')]);}_0x3c0707[_0x261b('0x3b')]=qs[_0x261b('0x3c')](_0xdbf3b9[_0x261b('0x35')][_0x261b('0x3c')]);_0x3c0707[_0x261b('0x3d')]=qs[_0x261b('0x3e')](_[_0x261b('0x3f')](_0xdbf3b9[_0x261b('0x35')],_0x2251be[_0x261b('0x3e')]),_0x2173b6);if(_0xdbf3b9[_0x261b('0x35')][_0x261b('0x40')]){_0x3c0707['where']=_['merge'](_0x3c0707['where'],{'$or':_[_0x261b('0x33')](_0x2173b6,function(_0x477d31){if(_0x477d31[_0x261b('0x41')]!==_0x261b('0x42')){var _0x447fd5={};_0x447fd5[_0x477d31[_0x261b('0x2d')]]={'$like':'%'+_0xdbf3b9[_0x261b('0x35')][_0x261b('0x40')]+'%'};return _0x447fd5;}})});}_0x3c0707=_[_0x261b('0x43')]({},_0x3c0707,_0xdbf3b9[_0x261b('0x44')]);var _0x167e2c={'where':_0x3c0707[_0x261b('0x3d')]};return db[_0x261b('0x2f')][_0x261b('0x23')](_0x167e2c)[_0x261b('0x15')](function(_0xd71d3c){_0x5c5b57[_0x261b('0x23')]=_0xd71d3c;if(_0xdbf3b9[_0x261b('0x35')][_0x261b('0x45')]){_0x3c0707[_0x261b('0x46')]=[{'all':!![]}];}return db[_0x261b('0x2f')]['findAll'](_0x3c0707);})[_0x261b('0x15')](function(_0x22cfea){_0x5c5b57[_0x261b('0x47')]=_0x22cfea;return _0x5c5b57;})[_0x261b('0x15')](respondWithFilteredResult(_0x327551,_0x3c0707))[_0x261b('0x1f')](handleError(_0x327551,null));};exports['show']=function(_0x268448,_0x47a94d){var _0xb0fb81={'raw':!![],'where':{'id':_0x268448[_0x261b('0x48')]['id']}},_0x503103={};_0x503103[_0x261b('0x32')]=_[_0x261b('0x34')](db[_0x261b('0x2f')][_0x261b('0x30')]);_0x503103[_0x261b('0x35')]=_[_0x261b('0x34')](_0x268448[_0x261b('0x35')]);_0x503103[_0x261b('0x3e')]=_['intersection'](_0x503103[_0x261b('0x32')],_0x503103[_0x261b('0x35')]);_0xb0fb81[_0x261b('0x37')]=_[_0x261b('0x36')](_0x503103[_0x261b('0x32')],qs[_0x261b('0x38')](_0x268448[_0x261b('0x35')]['fields']));_0xb0fb81[_0x261b('0x37')]=_0xb0fb81[_0x261b('0x37')][_0x261b('0x39')]?_0xb0fb81[_0x261b('0x37')]:_0x503103[_0x261b('0x32')];if(_0x268448[_0x261b('0x35')][_0x261b('0x45')]){_0xb0fb81[_0x261b('0x46')]=[{'all':!![]}];}_0xb0fb81=_['merge']({},_0xb0fb81,_0x268448[_0x261b('0x44')]);return db[_0x261b('0x2f')][_0x261b('0x49')](_0xb0fb81)[_0x261b('0x15')](handleEntityNotFound(_0x47a94d,null))[_0x261b('0x15')](respondWithResult(_0x47a94d,null))[_0x261b('0x1f')](handleError(_0x47a94d,null));};exports[_0x261b('0x28')]=function(_0x277225,_0x1efdde){if(_0x277225[_0x261b('0x4a')]['id']){delete _0x277225['body']['id'];}return db['MailMessage'][_0x261b('0x49')]({'where':{'id':_0x277225[_0x261b('0x48')]['id']}})[_0x261b('0x15')](handleEntityNotFound(_0x1efdde,null))[_0x261b('0x15')](saveUpdates(_0x277225[_0x261b('0x4a')],null))['then'](respondWithResult(_0x1efdde,null))[_0x261b('0x1f')](handleError(_0x1efdde,null));};exports[_0x261b('0x29')]=function(_0x5e3fe1,_0x3cb90a){return db['MailMessage'][_0x261b('0x49')]({'where':{'id':_0x5e3fe1['params']['id']}})[_0x261b('0x15')](handleEntityNotFound(_0x3cb90a,null))[_0x261b('0x15')](removeEntity(_0x3cb90a,null))[_0x261b('0x1f')](handleError(_0x3cb90a,null));};exports[_0x261b('0x4b')]=function(_0x19a1df,_0x4ea8ee){return db[_0x261b('0x2f')][_0x261b('0x4b')]()['then'](respondWithResult(_0x4ea8ee,null))[_0x261b('0x1f')](handleError(_0x4ea8ee,null));};exports[_0x261b('0x4c')]=function(_0x26b40d,_0x299812){return db[_0x261b('0x2f')][_0x261b('0x4c')](_0x26b40d[_0x261b('0x4a')])[_0x261b('0x15')](function(_0x1526ee){if(_0x1526ee){if(_0x1526ee[_0x261b('0x4d')]===_0x261b('0x4e')&&!_0x1526ee[_0x261b('0x4f')]){var _0x59f4d5,_0x428e50,_0x5342ec;if(_0x26b40d[_0x261b('0x4a')]['to']){_0x428e50=_0x26b40d[_0x261b('0x4a')]['to'][_0x261b('0x50')](',')[0x0];}return db[_0x261b('0x51')]['findOne']({'where':{'id':_0x1526ee['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x261b('0x52'),'include':[{'model':db[_0x261b('0x53')],'as':_0x261b('0x54'),'where':{'email':_0x428e50},'limit':0x1,'order':[[_0x261b('0x55'),_0x261b('0x56')]]}]},{'model':db[_0x261b('0x57')],'as':'Smtp','raw':!![]}]})['then'](function(_0x1be859){_0x59f4d5=_0x1be859;if(_0x59f4d5&&_0x59f4d5['Smtp']){var _0xe907c3={'tls':{'rejectUnauthorized':![]}};if(_[_0x261b('0x58')](_0x59f4d5['Smtp'][_0x261b('0x59')])){_0xe907c3[_0x261b('0x5a')]=_0x59f4d5[_0x261b('0x5b')]['host'];_0xe907c3[_0x261b('0x5c')]=_0x59f4d5['Smtp']['port'];_0xe907c3['secure']=_0x59f4d5[_0x261b('0x5b')][_0x261b('0x5d')];if(_0x59f4d5['Smtp'][_0x261b('0x5e')]){_0xe907c3[_0x261b('0x5f')]={'user':_0x59f4d5['Smtp'][_0x261b('0x60')],'pass':_0x59f4d5[_0x261b('0x5b')]['pass']};}}else{_0xe907c3['service']=_0x59f4d5[_0x261b('0x5b')][_0x261b('0x59')];_0xe907c3[_0x261b('0x5f')]={'user':_0x59f4d5[_0x261b('0x5b')][_0x261b('0x60')],'pass':_0x59f4d5['Smtp'][_0x261b('0x61')]};_0xe907c3['secure']=_0x59f4d5[_0x261b('0x5b')][_0x261b('0x5d')];}if(_0x26b40d['body']['attachments']&&_0x26b40d['body'][_0x261b('0x62')][_0x261b('0x39')]){for(var _0x1bc727=0x0;_0x1bc727<_0x26b40d[_0x261b('0x4a')][_0x261b('0x62')]['length'];_0x1bc727+=0x1){_0x26b40d[_0x261b('0x4a')][_0x261b('0x62')][_0x1bc727]={'filename':_0x26b40d[_0x261b('0x4a')][_0x261b('0x62')][_0x1bc727][_0x261b('0x2d')],'path':path[_0x261b('0x63')](config[_0x261b('0x64')],_0x261b('0x65'),_0x26b40d[_0x261b('0x4a')][_0x261b('0x62')][_0x1bc727][_0x261b('0x66')])};}}_0x5342ec={'account':_0xe907c3,'message':_0x26b40d[_0x261b('0x4a')]};return;}})[_0x261b('0x15')](function(){if(_0x59f4d5['List']){if(_0x59f4d5[_0x261b('0x52')][_0x261b('0x54')][_0x261b('0x39')]){return _0x59f4d5[_0x261b('0x52')][_0x261b('0x54')][0x0];}else{return db[_0x261b('0x53')]['create'](_[_0x261b('0xb')](_0x26b40d[_0x261b('0x4a')],{'firstName':_0x26b40d[_0x261b('0x4a')]['to'],'email':_0x26b40d[_0x261b('0x4a')]['to'],'phone':_0x26b40d[_0x261b('0x4a')]['to'],'ListId':_0x59f4d5[_0x261b('0x67')]}));}}else{throw new Error(_0x261b('0x68'));}})[_0x261b('0x15')](function(){if(_0x5342ec){return respondWithRpcPromise(_0x261b('0x69'),_0x261b('0x6a'),_0x5342ec,client9003)[_0x261b('0x15')](function(_0x1d1aad){return _0x1526ee['update']({'read':!![],'messageId':_0x1d1aad[_0x261b('0x6b')],'sentAt':moment()[_0x261b('0x6c')](_0x261b('0x6d'))});})['catch'](function(_0x542724){logger['error']('%s',JSON[_0x261b('0x1a')](_0x542724));return _0x1526ee;});}return _0x1526ee;});}return _0x1526ee;}})[_0x261b('0x15')](respondWithResult(_0x299812,0xc9))[_0x261b('0x1f')](handleError(_0x299812,null));};exports['accept']=function(_0x446ae8,_0x49ec1e){var _0x432ac6={'agent':{},'channel':_0x261b('0x6e')};if(_0x446ae8[_0x261b('0x4a')]['id']){delete _0x446ae8[_0x261b('0x4a')]['id'];}_0x446ae8[_0x261b('0x4a')][_0x261b('0x6f')]=!![];_0x446ae8[_0x261b('0x4a')][_0x261b('0x70')]=moment()[_0x261b('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x446ae8['body'][_0x261b('0x71')]=_0x446ae8[_0x261b('0x4a')][_0x261b('0x71')]||_0x446ae8[_0x261b('0x60')]['id'];_0x432ac6['agent']['id']=_0x446ae8[_0x261b('0x4a')]['UserId'];return db[_0x261b('0x2f')][_0x261b('0x49')]({'where':{'id':_0x446ae8[_0x261b('0x48')]['id'],'UserId':null}})[_0x261b('0x15')](handleEntityNotFound(_0x49ec1e,null))[_0x261b('0x15')](saveUpdates(_0x446ae8[_0x261b('0x4a')],null))[_0x261b('0x15')](function(_0x1480bc){if(_0x1480bc){_0x432ac6[_0x261b('0x1d')]=_0x1480bc[_0x261b('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x1480bc['MailInteractionId']}});}return null;})[_0x261b('0x15')](handleEntityNotFound(_0x49ec1e,null))[_0x261b('0x15')](function(_0x50f2eb){if(_0x50f2eb){return _0x50f2eb[_0x261b('0x28')]({'UserId':_0x446ae8['body'][_0x261b('0x71')],'read1stAt':_['isNil'](_0x50f2eb[_0x261b('0x73')])?moment()[_0x261b('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x261b('0x15')](function(_0x3f5c00){if(_0x3f5c00){_0x432ac6[_0x261b('0x74')]=_0x3f5c00[_0x261b('0x72')]({'plain':!![]});interaction_log[_0x261b('0x75')](_0x261b('0x76'),_0x446ae8[_0x261b('0x60')]['id'],_0x446ae8[_0x261b('0x60')][_0x261b('0x2d')],_0x446ae8[_0x261b('0x60')][_0x261b('0x77')],_0x432ac6['interaction']['id'],_0x446ae8['body']?JSON[_0x261b('0x1a')](_0x446ae8[_0x261b('0x4a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x261b('0x78'),_0x432ac6);}return null;})[_0x261b('0x15')](function(_0x5c2142){var _0x1964e7=_0x261b('0x79')+_0x5c2142['message']['ContactId'];return db[_0x261b('0x7a')][_0x261b('0x35')](_0x1964e7,{'type':db['Sequelize'][_0x261b('0x7b')][_0x261b('0x7c')],'raw':!![]})['then'](function(_0x292c85){return _0x292c85;});})[_0x261b('0x15')](function(_0x128eee){if(_0x128eee){_0x432ac6[_0x261b('0x1d')][_0x261b('0x7d')]=_0x128eee[0x0];if(!_0x446ae8[_0x261b('0x4a')]['UserId'])return;return db['User']['find']({'where':{'id':_0x446ae8[_0x261b('0x4a')][_0x261b('0x71')],'role':_0x261b('0x7e')},'attributes':['id',_0x261b('0x2d'),'fullname',_0x261b('0x7f'),_0x261b('0x80')],'raw':!![]});}return null;})[_0x261b('0x15')](function(_0x4b3420){if(!_0x4b3420)return null;_0x432ac6[_0x261b('0x1d')][_0x261b('0x7e')]=_0x4b3420;return _0x432ac6;})[_0x261b('0x15')](function(_0x433a40){if(_0x433a40){if(_0x446ae8[_0x261b('0x4a')][_0x261b('0x81')]){_0x432ac6['message'][_0x261b('0x82')]=util[_0x261b('0x6c')](_0x261b('0x83'),_0x446ae8[_0x261b('0x60')][_0x261b('0x2d')]);_0x432ac6['message']['channel']=_0x432ac6[_0x261b('0x84')];_0x432ac6['message']['motionChannel']=_0x432ac6[_0x261b('0x84')];_0x432ac6[_0x261b('0x1d')]['event']=_0x261b('0x85');_0x432ac6['message'][_0x261b('0x4a')]=htmlToText[_0x261b('0x86')](_0x432ac6[_0x261b('0x1d')][_0x261b('0x4a')]);return respondWithRpcPromise('EventManager',_0x261b('0x87'),{'event':'acceptmessage','message':_0x432ac6[_0x261b('0x1d')]},client9002)[_0x261b('0x15')](function(){return _0x432ac6;});}return _0x432ac6;}return null;})['then'](respondWithResult(_0x49ec1e,null))[_0x261b('0x1f')](handleError(_0x49ec1e,null));};exports[_0x261b('0x88')]=function(_0x537c7a,_0x98d059){var _0x1ba275={'agent':{},'channel':_0x261b('0x6e')};if(_0x537c7a['body']['id']){delete _0x537c7a['body']['id'];}_0x537c7a['body']['UserId']=_0x537c7a[_0x261b('0x4a')]['UserId']||_0x537c7a[_0x261b('0x60')]['id'];_0x1ba275[_0x261b('0x7e')]['id']=_0x537c7a[_0x261b('0x4a')][_0x261b('0x71')];return db[_0x261b('0x2f')]['find']({'where':{'id':_0x537c7a[_0x261b('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x98d059,null))['then'](function(_0x5c2f9c){if(_0x5c2f9c){_0x1ba275[_0x261b('0x1d')]=_0x5c2f9c['get']({'plain':!![]});return db[_0x261b('0x89')][_0x261b('0x49')]({'where':{'id':_0x5c2f9c[_0x261b('0x8a')]}});}return null;})[_0x261b('0x15')](handleEntityNotFound(_0x98d059,null))[_0x261b('0x15')](function(_0x25e427){if(_0x25e427){_0x1ba275[_0x261b('0x74')]=_0x25e427[_0x261b('0x72')]({'plain':!![]});interaction_log['info'](_0x261b('0x8b'),_0x537c7a[_0x261b('0x60')]['id'],_0x537c7a['user'][_0x261b('0x2d')],_0x537c7a['user'][_0x261b('0x77')],_0x1ba275[_0x261b('0x74')]['id'],_0x537c7a[_0x261b('0x4a')]?JSON[_0x261b('0x1a')](_0x537c7a['body']):'null');return respondWithRpcPromise(_0x261b('0x8c'),'rejectMessage',_0x1ba275);}return null;})[_0x261b('0x15')](function(_0x56a24a){var _0x3989b4=_0x261b('0x79')+_0x56a24a[_0x261b('0x1d')]['ContactId'];return db['sequelize'][_0x261b('0x35')](_0x3989b4,{'type':db[_0x261b('0x8d')][_0x261b('0x7b')][_0x261b('0x7c')],'raw':!![]})['then'](function(_0x50127e){return _0x50127e;});})[_0x261b('0x15')](function(_0x525fab){if(_0x525fab){_0x1ba275['message'][_0x261b('0x7d')]=_0x525fab[0x0];if(!_0x537c7a['body'][_0x261b('0x71')])return;return db[_0x261b('0x8e')]['find']({'where':{'id':_0x537c7a[_0x261b('0x4a')]['UserId'],'role':_0x261b('0x7e')},'attributes':['id',_0x261b('0x2d'),_0x261b('0x8f'),'email',_0x261b('0x80')],'raw':!![]});}return null;})['then'](function(_0x1fb347){if(!_0x1fb347)return null;_0x1ba275['message'][_0x261b('0x7e')]=_0x1fb347;return _0x1ba275;})[_0x261b('0x15')](function(_0x52288c){if(_0x52288c){_0x52288c[_0x261b('0x1d')]['interface']=util['format'](_0x261b('0x83'),_0x537c7a[_0x261b('0x60')][_0x261b('0x2d')]);_0x52288c[_0x261b('0x1d')][_0x261b('0x84')]=_0x1ba275[_0x261b('0x84')];_0x52288c[_0x261b('0x1d')][_0x261b('0x90')]=_0x1ba275[_0x261b('0x84')];_0x52288c[_0x261b('0x1d')]['event']='reject';_0x52288c[_0x261b('0x1d')][_0x261b('0x4a')]=htmlToText[_0x261b('0x86')](_0x1ba275['message'][_0x261b('0x4a')]);respondWithRpcPromise(_0x261b('0x87'),_0x261b('0x87'),{'event':_0x261b('0x91'),'message':_0x52288c[_0x261b('0x1d')]},client9002);return _0x1ba275;}return null;})[_0x261b('0x15')](respondWithResult(_0x98d059,null))['catch'](handleError(_0x98d059,null));};exports[_0x261b('0x92')]=function(_0x2b9094,_0x258f39){var _0x4936f4=moment()['unix']()[_0x261b('0x93')]();var _0x9dc05c=path[_0x261b('0x63')](config[_0x261b('0x64')],_0x261b('0x94'),_0x261b('0x95'),_0x261b('0x96'));var _0x34876b=path[_0x261b('0x63')](config[_0x261b('0x64')],_0x261b('0x94'),_0x261b('0x95'),_0x261b('0x62'));var _0x106d7d=util[_0x261b('0x6c')](_0x261b('0x97'),_0x4936f4);return db[_0x261b('0x2f')]['find']({'where':{'id':_0x2b9094[_0x261b('0x48')]['id']},'attributes':['id','body','from','to','cc',_0x261b('0x98'),_0x261b('0x99'),_0x261b('0x9a')],'include':_0x2b9094[_0x261b('0x35')]['attachments']?[{'model':db[_0x261b('0x9b')],'as':'Attachments'}]:undefined})[_0x261b('0x15')](handleEntityNotFound(_0x258f39,null))[_0x261b('0x15')](function(_0x15327b){if(_0x15327b){var _0x416300=_0x15327b;var _0x4588dd={'from':_0x416300[_0x261b('0x9c')],'to':_0x416300['to'],'subject':_0x416300[_0x261b('0x99')],'html':htmlEntities['decode'](_0x416300[_0x261b('0x4a')]),'headers':{'Date':moment(_0x416300[_0x261b('0x9a')])[_0x261b('0x6c')](_0x261b('0x9d'))},'attachments':[]};if(_0x15327b['cc']){_0x4588dd[_0x261b('0x9e')]['Cc']=_0x15327b['cc'];}if(_0x15327b[_0x261b('0x98')]){_0x4588dd[_0x261b('0x9e')][_0x261b('0x9f')]=_0x15327b['bcc'];}return new BPromise(function(_0x4e0758,_0x44fb40){if(_0x15327b['Attachments']){for(var _0x927732=0x0;_0x927732<_0x15327b[_0x261b('0xa0')][_0x261b('0x39')];_0x927732++){var _0x3b3842=_0x15327b[_0x261b('0xa0')][_0x927732];var _0x3394b7=path[_0x261b('0x63')](_0x34876b,_0x3b3842[_0x261b('0x66')]);if(fs[_0x261b('0xa1')](_0x3394b7)){_0x4588dd[_0x261b('0x62')][_0x261b('0xa2')]({'name':_0x3b3842[_0x261b('0x2d')],'contentType':_0x3b3842[_0x261b('0x41')],'data':fs['readFileSync'](_0x3394b7)});}}}emlformat[_0x261b('0xa3')](_0x4588dd,function(_0x4c2a34,_0x1aa34c){if(_0x4c2a34)return _0x44fb40(_0x4c2a34);fs[_0x261b('0xa4')](path[_0x261b('0x63')](_0x9dc05c,_0x106d7d),_0x1aa34c);return _0x4e0758(_0x1aa34c);});});}})[_0x261b('0x15')](function(_0x3c9bcf){if(_0x3c9bcf){return _0x258f39[_0x261b('0x92')](path['join'](_0x9dc05c,_0x106d7d),_0x106d7d,function(_0x1a5c1f){if(!_0x1a5c1f)fs['unlinkSync'](path[_0x261b('0x63')](_0x9dc05c,_0x106d7d));});}})[_0x261b('0x1f')](handleError(_0x258f39,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 30d6467..3e9be52 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 _0x5402=['remove','emit','hook','exports','events','MailMessage','setMaxListeners','update'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x5402,0x9c));var _0x2540=function(_0x4bbec8,_0x9dd0e6){_0x4bbec8=_0x4bbec8-0x0;var _0x2509b9=_0x5402[_0x4bbec8];return _0x2509b9;};'use strict';var EventEmitter=require(_0x2540('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x2540('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2540('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2540('0x3'),'afterDestroy':_0x2540('0x4')};function emitEvent(_0x2e196d){return function(_0xb8b9b6,_0x39bcf4,_0x231bf0){MailMessageEvents[_0x2540('0x5')](_0x2e196d+':'+_0xb8b9b6['id'],_0xb8b9b6);MailMessageEvents[_0x2540('0x5')](_0x2e196d,_0xb8b9b6);_0x231bf0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x2540('0x6')](e,emitEvent(event));}}module[_0x2540('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x233f=['events','MailMessage','remove','emit','hook'];(function(_0x44f980,_0x105fc0){var _0x59ae66=function(_0x220b4f){while(--_0x220b4f){_0x44f980['push'](_0x44f980['shift']());}};_0x59ae66(++_0x105fc0);}(_0x233f,0xd7));var _0xf233=function(_0x5286f0,_0xa044){_0x5286f0=_0x5286f0-0x0;var _0x48adb6=_0x233f[_0x5286f0];return _0x48adb6;};'use strict';var EventEmitter=require(_0xf233('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xf233('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf233('0x2')};function emitEvent(_0x25f504){return function(_0x5bed3d,_0x3cb0bd,_0x5991bd){MailMessageEvents[_0xf233('0x3')](_0x25f504+':'+_0x5bed3d['id'],_0x5bed3d);MailMessageEvents['emit'](_0x25f504,_0x5bed3d);_0x5991bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xf233('0x4')](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 f07b8b2..5fd713c 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 _0x4933=['fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','UserId','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId'];(function(_0x926dc9,_0x26a610){var _0x42b541=function(_0x5a7f48){while(--_0x5a7f48){_0x926dc9['push'](_0x926dc9['shift']());}};_0x42b541(++_0x26a610);}(_0x4933,0x15b));var _0x3493=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x4933[_0x422be2];return _0x1b820e;};'use strict';var _=require(_0x3493('0x0'));var util=require(_0x3493('0x1'));var logger=require(_0x3493('0x2'))('api');var moment=require(_0x3493('0x3'));var BPromise=require(_0x3493('0x4'));var rp=require(_0x3493('0x5'));var htmlToText=require(_0x3493('0x6'));var fs=require('fs');var path=require(_0x3493('0x7'));var rimraf=require('rimraf');var config=require(_0x3493('0x8'));var attributes=require(_0x3493('0x9'));module['exports']=function(_0x5d4863,_0x52d471){return _0x5d4863['define'](_0x3493('0xa'),attributes,{'tableName':_0x3493('0xb'),'paranoid':![],'indexes':[{'name':_0x3493('0xc'),'fields':[_0x3493('0xc')]},{'name':_0x3493('0xd'),'fields':[_0x3493('0xe'),'subject'],'type':_0x3493('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xecaed8,_0x943562,_0x495615){if(_0xecaed8['body']){_0xecaed8[_0x3493('0xe')]=htmlToText['fromString'](_0xecaed8[_0x3493('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x495615(null,_0x943562);},'afterCreate':function(_0xa98db1,_0x4366c8,_0x42611c){var _0x3201dc=_0x5d4863[_0x3493('0x11')];var _0x42b493=_0xa98db1[_0x3493('0x12')]({'plain':!![]});if(_0x42b493[_0x3493('0x13')][_0x3493('0x14')]()==='in'||_0x42b493[_0x3493('0x13')][_0x3493('0x14')]()===_0x3493('0x15')&&!_0x42b493[_0x3493('0x16')]&&!_['isNil'](_0x42b493[_0x3493('0x17')])){_0x3201dc['MailInteraction']['findOne']({'where':{'id':_0x42b493[_0x3493('0x18')]}})['then'](function(_0x219ec7){if(_0x219ec7){_0x219ec7[_0x3493('0x19')]({'lastMsgAt':_0x42b493[_0x3493('0x1a')],'lastMsgDirection':_0x42b493[_0x3493('0x13')][_0x3493('0x14')]()});}})['catch'](function(_0x2cc9f4){console[_0x3493('0x1b')](_0x2cc9f4);});}_0x42611c();}},'charset':_0x3493('0x1c'),'collate':_0x3493('0x1d')});}; \ No newline at end of file +var _0xa78f=['path','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','get','direction','toLowerCase','secret','MailInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4d0dfe,_0x321797){var _0x27bf28=function(_0x5521cb){while(--_0x5521cb){_0x4d0dfe['push'](_0x4d0dfe['shift']());}};_0x27bf28(++_0x321797);}(_0xa78f,0xcc));var _0xfa78=function(_0x36de00,_0x42c3e3){_0x36de00=_0x36de00-0x0;var _0x250410=_0xa78f[_0x36de00];return _0x250410;};'use strict';var _=require(_0xfa78('0x0'));var util=require(_0xfa78('0x1'));var logger=require(_0xfa78('0x2'))(_0xfa78('0x3'));var moment=require(_0xfa78('0x4'));var BPromise=require(_0xfa78('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfa78('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfa78('0x7'));module[_0xfa78('0x8')]=function(_0x13b90a,_0x232449){return _0x13b90a[_0xfa78('0x9')](_0xfa78('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xfa78('0xb'),'fields':[_0xfa78('0xb')]},{'name':_0xfa78('0xc'),'fields':['plainBody',_0xfa78('0xd')],'type':_0xfa78('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10c74c,_0x45cef0,_0x3f56ff){if(_0x10c74c[_0xfa78('0xf')]){_0x10c74c[_0xfa78('0x10')]=htmlToText[_0xfa78('0x11')](_0x10c74c['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3f56ff(null,_0x45cef0);},'afterCreate':function(_0x56bfff,_0x523f16,_0x47d6c0){var _0x379d1f=_0x13b90a['models'];var _0x52c0bb=_0x56bfff[_0xfa78('0x12')]({'plain':!![]});if(_0x52c0bb[_0xfa78('0x13')][_0xfa78('0x14')]()==='in'||_0x52c0bb[_0xfa78('0x13')][_0xfa78('0x14')]()==='out'&&!_0x52c0bb[_0xfa78('0x15')]&&!_['isNil'](_0x52c0bb['UserId'])){_0x379d1f[_0xfa78('0x16')][_0xfa78('0x17')]({'where':{'id':_0x52c0bb['MailInteractionId']}})[_0xfa78('0x18')](function(_0x1232a2){if(_0x1232a2){_0x1232a2[_0xfa78('0x19')]({'lastMsgAt':_0x52c0bb['createdAt'],'lastMsgDirection':_0x52c0bb[_0xfa78('0x13')][_0xfa78('0x14')]()});}})[_0xfa78('0x1a')](function(_0x5becf6){console[_0xfa78('0x1b')](_0x5becf6);});}_0x47d6c0();}},'charset':_0xfa78('0x1c'),'collate':_0xfa78('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 6caa111..32d4a50 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 _0x1a85=['info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1a85,0x178));var _0x51a8=function(_0x9a29ea,_0x5b8b29){_0x9a29ea=_0x9a29ea-0x0;var _0x11f261=_0x1a85[_0x9a29ea];return _0x11f261;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});}exports[_0x51a8('0x19')]=function(_0x2217ce){var _0x2f2681=this;return new Promise(function(_0x2a4c4c,_0x3bc044){return db[_0x51a8('0x1a')][_0x51a8('0x1b')](_0x2217ce['body'],{'raw':_0x2217ce[_0x51a8('0x1c')]?_0x2217ce['options'][_0x51a8('0x1d')]===undefined?!![]:![]:!![]})[_0x51a8('0xd')](function(_0x8bda40){logger[_0x51a8('0xe')]('CreateMailMessage',_0x2217ce);logger[_0x51a8('0x11')]('CreateMailMessage',_0x2217ce,JSON['stringify'](_0x8bda40));_0x2a4c4c(_0x8bda40);})[_0x51a8('0x18')](function(_0x52e503){logger[_0x51a8('0x14')](_0x51a8('0x19'),_0x52e503[_0x51a8('0x16')],_0x2217ce);_0x3bc044(_0x2f2681[_0x51a8('0x14')](0x1f4,_0x52e503[_0x51a8('0x16')]));});});}; \ No newline at end of file +var _0x7d25=['client','redis','defaults','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x309191,_0x34d4a4){var _0x40c441=function(_0xb0274a){while(--_0xb0274a){_0x309191['push'](_0x309191['shift']());}};_0x40c441(++_0x34d4a4);}(_0x7d25,0x8a));var _0x57d2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x7d25[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./mailMessage.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('MailMessage,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});}exports[_0x57d2('0x17')]=function(_0x5b1b9d){var _0x1cbe4a=this;return new Promise(function(_0xcf924f,_0x55191e){return db['MailMessage'][_0x57d2('0x18')](_0x5b1b9d[_0x57d2('0x19')],{'raw':_0x5b1b9d[_0x57d2('0x1a')]?_0x5b1b9d[_0x57d2('0x1a')][_0x57d2('0x1b')]===undefined?!![]:![]:!![]})[_0x57d2('0xc')](function(_0x32c7c8){logger[_0x57d2('0xd')](_0x57d2('0x17'),_0x5b1b9d);logger[_0x57d2('0x10')](_0x57d2('0x17'),_0x5b1b9d,JSON[_0x57d2('0x12')](_0x32c7c8));_0xcf924f(_0x32c7c8);})[_0x57d2('0x1c')](function(_0x473df2){logger['error'](_0x57d2('0x17'),_0x473df2[_0x57d2('0x15')],_0x5b1b9d);_0x55191e(_0x1cbe4a[_0x57d2('0x13')](0x1f4,_0x473df2[_0x57d2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d15fedb..f349fc8 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 _0x527c=['emit','register','mailMessage:','save','update'];(function(_0x1d47d5,_0x3f86fa){var _0x527f95=function(_0x22e09c){while(--_0x22e09c){_0x1d47d5['push'](_0x1d47d5['shift']());}};_0x527f95(++_0x3f86fa);}(_0x527c,0xd0));var _0xc527=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x527c[_0x14f8ef];return _0x3b97f6;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xc527('0x0'),'remove',_0xc527('0x1')];function createListener(_0x39cd69,_0x2f4b9d){return function(_0x4afa21){_0x2f4b9d[_0xc527('0x2')](_0x39cd69,_0x4afa21);};}function removeListener(_0x5eaa50,_0x434036){return function(){MailMessageEvents['removeListener'](_0x5eaa50,_0x434036);};}exports[_0xc527('0x3')]=function(_0x4ca6dc){for(var _0x28379d=0x0,_0x42d1b1=events['length'];_0x28379d<_0x42d1b1;_0x28379d++){var _0x1fd4df=events[_0x28379d];var _0x5de073=createListener(_0xc527('0x4')+_0x1fd4df,_0x4ca6dc);MailMessageEvents['on'](_0x1fd4df,_0x5de073);}}; \ No newline at end of file +var _0xb7ec=['remove','update','emit','removeListener','register','length','mailMessage:','save'];(function(_0x78db5e,_0x3b9804){var _0x250b88=function(_0x20a40f){while(--_0x20a40f){_0x78db5e['push'](_0x78db5e['shift']());}};_0x250b88(++_0x3b9804);}(_0xb7ec,0x137));var _0xcb7e=function(_0x442087,_0x520b79){_0x442087=_0x442087-0x0;var _0x134cb5=_0xb7ec[_0x442087];return _0x134cb5;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xcb7e('0x0'),_0xcb7e('0x1'),_0xcb7e('0x2')];function createListener(_0x242048,_0xab0b45){return function(_0x5b85ce){_0xab0b45[_0xcb7e('0x3')](_0x242048,_0x5b85ce);};}function removeListener(_0x13d8c7,_0x3b3012){return function(){MailMessageEvents[_0xcb7e('0x4')](_0x13d8c7,_0x3b3012);};}exports[_0xcb7e('0x5')]=function(_0x1f8e5f){for(var _0xe97ce9=0x0,_0x54184e=events[_0xcb7e('0x6')];_0xe97ce9<_0x54184e;_0xe97ce9++){var _0x4e328c=events[_0xe97ce9];var _0x46d628=createListener(_0xcb7e('0x7')+_0x4e328c,_0x1f8e5f);MailMessageEvents['on'](_0x4e328c,_0x46d628);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0506566..751a2a5 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 _0x2c45=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put'];(function(_0x3eb4a7,_0x139626){var _0xa26dca=function(_0x3cc966){while(--_0x3cc966){_0x3eb4a7['push'](_0x3eb4a7['shift']());}};_0xa26dca(++_0x139626);}(_0x2c45,0x1d4));var _0x52c4=function(_0x3a7490,_0x265112){_0x3a7490=_0x3a7490-0x0;var _0x4209ab=_0x2c45[_0x3a7490];return _0x4209ab;};'use strict';var multer=require(_0x52c4('0x0'));var util=require(_0x52c4('0x1'));var path=require(_0x52c4('0x2'));var timeout=require(_0x52c4('0x3'));var express=require('express');var router=express[_0x52c4('0x4')]();var fs_extra=require(_0x52c4('0x5'));var auth=require(_0x52c4('0x6'));var interaction=require(_0x52c4('0x7'));var config=require(_0x52c4('0x8'));var controller=require('./mailQueue.controller');router[_0x52c4('0x9')]('/',auth[_0x52c4('0xa')](),controller[_0x52c4('0xb')]);router[_0x52c4('0x9')](_0x52c4('0xc'),auth['isAuthenticated'](),controller[_0x52c4('0xd')]);router[_0x52c4('0x9')](_0x52c4('0xe'),auth[_0x52c4('0xa')](),controller[_0x52c4('0xf')]);router[_0x52c4('0x9')](_0x52c4('0x10'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x11')]);router['get'](_0x52c4('0x12'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x13')]);router['get'](_0x52c4('0x14'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x15')]);router[_0x52c4('0x16')]('/',auth['isAuthenticated'](),controller[_0x52c4('0x17')]);router['post'](_0x52c4('0x12'),auth['isAuthenticated'](),controller[_0x52c4('0x18')]);router[_0x52c4('0x16')](_0x52c4('0x14'),auth['isAuthenticated'](),controller[_0x52c4('0x19')]);router[_0x52c4('0x1a')](_0x52c4('0xe'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x1b')]);router[_0x52c4('0x1c')](_0x52c4('0xe'),auth['isAuthenticated'](),controller[_0x52c4('0x1d')]);router['delete'](_0x52c4('0x12'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x1e')]);router['delete'](_0x52c4('0x14'),auth[_0x52c4('0xa')](),controller[_0x52c4('0x1f')]);module[_0x52c4('0x20')]=router; \ No newline at end of file +var _0xcde7=['get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ae689,_0x256781){var _0x454fdf=function(_0x50c565){while(--_0x50c565){_0x3ae689['push'](_0x3ae689['shift']());}};_0x454fdf(++_0x256781);}(_0xcde7,0x1d7));var _0x7cde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcde7[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7cde('0x0'));var util=require(_0x7cde('0x1'));var path=require(_0x7cde('0x2'));var timeout=require(_0x7cde('0x3'));var express=require(_0x7cde('0x4'));var router=express[_0x7cde('0x5')]();var fs_extra=require(_0x7cde('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7cde('0x7'));var config=require(_0x7cde('0x8'));var controller=require('./mailQueue.controller');router[_0x7cde('0x9')]('/',auth[_0x7cde('0xa')](),controller[_0x7cde('0xb')]);router[_0x7cde('0x9')]('/describe',auth[_0x7cde('0xa')](),controller[_0x7cde('0xc')]);router[_0x7cde('0x9')](_0x7cde('0xd'),auth[_0x7cde('0xa')](),controller[_0x7cde('0xe')]);router[_0x7cde('0x9')](_0x7cde('0xf'),auth['isAuthenticated'](),controller[_0x7cde('0x10')]);router[_0x7cde('0x9')](_0x7cde('0x11'),auth[_0x7cde('0xa')](),controller[_0x7cde('0x12')]);router['get'](_0x7cde('0x13'),auth['isAuthenticated'](),controller[_0x7cde('0x14')]);router[_0x7cde('0x15')]('/',auth[_0x7cde('0xa')](),controller[_0x7cde('0x16')]);router[_0x7cde('0x15')](_0x7cde('0x11'),auth[_0x7cde('0xa')](),controller[_0x7cde('0x17')]);router[_0x7cde('0x15')](_0x7cde('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7cde('0x18')](_0x7cde('0xd'),auth[_0x7cde('0xa')](),controller[_0x7cde('0x19')]);router[_0x7cde('0x1a')]('/:id',auth[_0x7cde('0xa')](),controller['destroy']);router['delete'](_0x7cde('0x11'),auth[_0x7cde('0xa')](),controller[_0x7cde('0x1b')]);router['delete']('/:id/users',auth[_0x7cde('0xa')](),controller[_0x7cde('0x1c')]);module[_0x7cde('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index eabca9b..90a94d6 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 _0x3f3a=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4f16ed,_0x26227d){var _0x333281=function(_0x186fab){while(--_0x186fab){_0x4f16ed['push'](_0x4f16ed['shift']());}};_0x333281(++_0x26227d);}(_0x3f3a,0xe0));var _0xa3f3=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x3f3a[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require('sequelize');module[_0xa3f3('0x0')]={'name':{'type':Sequelize[_0xa3f3('0x1')],'unique':_0xa3f3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa3f3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa3f3('0x4')](_0xa3f3('0x5'),_0xa3f3('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xc8ed=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x40d870,_0x6ebb5f){var _0x48db45=function(_0x56dbd7){while(--_0x56dbd7){_0x40d870['push'](_0x40d870['shift']());}};_0x48db45(++_0x6ebb5f);}(_0xc8ed,0x84));var _0xdc8e=function(_0x4a6321,_0x1732ac){_0x4a6321=_0x4a6321-0x0;var _0x948807=_0xc8ed[_0x4a6321];return _0x948807;};'use strict';var Sequelize=require(_0xdc8e('0x0'));module['exports']={'name':{'type':Sequelize[_0xdc8e('0x1')],'unique':_0xdc8e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc8e('0x1')]},'timeout':{'type':Sequelize[_0xdc8e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc8e('0x4')](_0xdc8e('0x5'),_0xdc8e('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 6e78747..85c94c5 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 _0x574d=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x574d,0x85));var _0xd574=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x574d[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd574('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd574('0x1'));var moment=require(_0xd574('0x2'));var BPromise=require(_0xd574('0x3'));var Mustache=require('mustache');var util=require(_0xd574('0x4'));var path=require(_0xd574('0x5'));var sox=require(_0xd574('0x6'));var csv=require(_0xd574('0x7'));var ejs=require(_0xd574('0x8'));var fs=require('fs');var fs_extra=require(_0xd574('0x9'));var _=require(_0xd574('0xa'));var squel=require(_0xd574('0xb'));var crypto=require(_0xd574('0xc'));var jsforce=require(_0xd574('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd574('0xe'));var Papa=require('papaparse');var Redis=require(_0xd574('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd574('0x10'));var as=require(_0xd574('0x11'));var hardwareService=require(_0xd574('0x12'));var logger=require(_0xd574('0x13'))('api');var utils=require(_0xd574('0x14'));var config=require(_0xd574('0x15'));var licenseUtil=require(_0xd574('0x16'));var db=require(_0xd574('0x17'))['db'];config['redis']=_[_0xd574('0x18')](config[_0xd574('0x19')],{'host':_0xd574('0x1a'),'port':0x18eb});var socket=require(_0xd574('0x1b'))(new Redis(config[_0xd574('0x19')]));require(_0xd574('0x1c'))[_0xd574('0x1d')](socket);function respondWithStatusCode(_0x5d6091,_0x3252aa){_0x3252aa=_0x3252aa||0xcc;return function(_0x1feb47){if(_0x1feb47){return _0x5d6091[_0xd574('0x1e')](_0x3252aa);}return _0x5d6091[_0xd574('0x1f')](_0x3252aa)[_0xd574('0x20')]();};}function respondWithResult(_0x3321a1,_0x3199b4){_0x3199b4=_0x3199b4||0xc8;return function(_0x56c109){if(_0x56c109){return _0x3321a1['status'](_0x3199b4)['json'](_0x56c109);}};}function respondWithFilteredResult(_0x1d63b1,_0x2ecbbd){return function(_0x2c5a1a){if(_0x2c5a1a){var _0x5c75a9=typeof _0x2ecbbd[_0xd574('0x21')]===_0xd574('0x22')&&typeof _0x2ecbbd['limit']===_0xd574('0x22');var _0x402d1d=_0x2c5a1a[_0xd574('0x23')];var _0xfcd11=_0x5c75a9?0x0:_0x2ecbbd['offset'];var _0x27b09f=_0x5c75a9?_0x2c5a1a[_0xd574('0x23')]:_0x2ecbbd[_0xd574('0x21')]+_0x2ecbbd[_0xd574('0x24')];var _0x24d9fa;if(_0x27b09f>=_0x402d1d){_0x27b09f=_0x402d1d;_0x24d9fa=0xc8;}else{_0x24d9fa=0xce;}_0x1d63b1['status'](_0x24d9fa);return _0x1d63b1['set'](_0xd574('0x25'),_0xfcd11+'-'+_0x27b09f+'/'+_0x402d1d)[_0xd574('0x26')](_0x2c5a1a);}return null;};}function patchUpdates(_0x3e166f){return function(_0x2f52dc){try{jsonpatch['apply'](_0x2f52dc,_0x3e166f,!![]);}catch(_0x2dfdaa){return BPromise[_0xd574('0x27')](_0x2dfdaa);}return _0x2f52dc[_0xd574('0x28')]();};}function saveUpdates(_0x38b7ea,_0x1cdbb8){return function(_0x11ba8c){if(_0x11ba8c){return _0x11ba8c[_0xd574('0x29')](_0x38b7ea)[_0xd574('0x2a')](function(_0x4c7f78){return _0x4c7f78;});}return null;};}function removeEntity(_0x468edb,_0x11f9e9){return function(_0x3a4379){if(_0x3a4379){return _0x3a4379[_0xd574('0x2b')]()['then'](function(){var _0x5b25d0=_0x3a4379['get']({'plain':!![]});var _0x50d0a9=_0xd574('0x2c');return db[_0xd574('0x2d')][_0xd574('0x2b')]({'where':{'type':_0x50d0a9,'resourceId':_0x5b25d0['id']}})[_0xd574('0x2a')](function(){return _0x3a4379;});})[_0xd574('0x2a')](function(){_0x468edb[_0xd574('0x1f')](0xcc)[_0xd574('0x20')]();});}};}function handleEntityNotFound(_0x230c72,_0x227143){return function(_0x52de22){if(!_0x52de22){_0x230c72[_0xd574('0x1e')](0x194);}return _0x52de22;};}function handleError(_0x3146c9,_0x1ebd26){_0x1ebd26=_0x1ebd26||0x1f4;return function(_0x352356){logger[_0xd574('0x2e')](_0x352356[_0xd574('0x2f')]);if(_0x352356[_0xd574('0x30')]){delete _0x352356[_0xd574('0x30')];}_0x3146c9[_0xd574('0x1f')](_0x1ebd26)['send'](_0x352356);};}exports['index']=function(_0x1ae2b4,_0x1ebdb8){var _0x11a508={},_0x2986e4={},_0x3bfde6={'count':0x0,'rows':[]};var _0x392f62=_[_0xd574('0x31')](db[_0xd574('0x32')][_0xd574('0x33')],function(_0x4a11b8){return{'name':_0x4a11b8[_0xd574('0x34')],'type':_0x4a11b8['type'][_0xd574('0x35')]};});_0x2986e4[_0xd574('0x36')]=_[_0xd574('0x31')](_0x392f62,_0xd574('0x30'));_0x2986e4[_0xd574('0x37')]=_[_0xd574('0x38')](_0x1ae2b4[_0xd574('0x37')]);_0x2986e4['filters']=_[_0xd574('0x39')](_0x2986e4[_0xd574('0x36')],_0x2986e4['query']);_0x11a508[_0xd574('0x3a')]=_[_0xd574('0x39')](_0x2986e4[_0xd574('0x36')],qs[_0xd574('0x3b')](_0x1ae2b4[_0xd574('0x37')][_0xd574('0x3b')]));_0x11a508[_0xd574('0x3a')]=_0x11a508[_0xd574('0x3a')][_0xd574('0x3c')]?_0x11a508['attributes']:_0x2986e4['model'];if(!_0x1ae2b4[_0xd574('0x37')][_0xd574('0x3d')](_0xd574('0x3e'))){_0x11a508[_0xd574('0x24')]=qs[_0xd574('0x24')](_0x1ae2b4['query'][_0xd574('0x24')]);_0x11a508[_0xd574('0x21')]=qs[_0xd574('0x21')](_0x1ae2b4[_0xd574('0x37')][_0xd574('0x21')]);}_0x11a508[_0xd574('0x3f')]=qs[_0xd574('0x40')](_0x1ae2b4[_0xd574('0x37')][_0xd574('0x40')]);_0x11a508[_0xd574('0x41')]=qs['filters'](_[_0xd574('0x42')](_0x1ae2b4[_0xd574('0x37')],_0x2986e4[_0xd574('0x43')]),_0x392f62);if(_0x1ae2b4[_0xd574('0x37')]['filter']){_0x11a508['where']=_['merge'](_0x11a508[_0xd574('0x41')],{'$or':_[_0xd574('0x31')](_0x392f62,function(_0x384d01){if(_0x384d01[_0xd574('0x44')]!==_0xd574('0x45')){var _0x5b5ef2={};_0x5b5ef2[_0x384d01[_0xd574('0x30')]]={'$like':'%'+_0x1ae2b4[_0xd574('0x37')][_0xd574('0x46')]+'%'};return _0x5b5ef2;}})});}_0x11a508=_['merge']({},_0x11a508,_0x1ae2b4[_0xd574('0x47')]);var _0x444d9e={'where':_0x11a508[_0xd574('0x41')]};return db[_0xd574('0x32')]['count'](_0x444d9e)[_0xd574('0x2a')](function(_0x3f9210){_0x3bfde6[_0xd574('0x23')]=_0x3f9210;if(_0x1ae2b4[_0xd574('0x37')][_0xd574('0x48')]){_0x11a508[_0xd574('0x49')]=[{'all':!![]}];}return db[_0xd574('0x32')][_0xd574('0x4a')](_0x11a508);})[_0xd574('0x2a')](function(_0x259b25){_0x3bfde6[_0xd574('0x4b')]=_0x259b25;return _0x3bfde6;})[_0xd574('0x2a')](respondWithFilteredResult(_0x1ebdb8,_0x11a508))[_0xd574('0x4c')](handleError(_0x1ebdb8,null));};exports[_0xd574('0x4d')]=function(_0x17d98c,_0x1830a0){var _0x97e783={'raw':!![],'where':{'id':_0x17d98c[_0xd574('0x4e')]['id']}},_0x464e21={};_0x464e21[_0xd574('0x36')]=_[_0xd574('0x38')](db[_0xd574('0x32')]['rawAttributes']);_0x464e21[_0xd574('0x37')]=_[_0xd574('0x38')](_0x17d98c['query']);_0x464e21[_0xd574('0x43')]=_[_0xd574('0x39')](_0x464e21[_0xd574('0x36')],_0x464e21[_0xd574('0x37')]);_0x97e783[_0xd574('0x3a')]=_['intersection'](_0x464e21['model'],qs[_0xd574('0x3b')](_0x17d98c[_0xd574('0x37')][_0xd574('0x3b')]));_0x97e783['attributes']=_0x97e783['attributes']['length']?_0x97e783[_0xd574('0x3a')]:_0x464e21[_0xd574('0x36')];if(_0x17d98c[_0xd574('0x37')][_0xd574('0x48')]){_0x97e783[_0xd574('0x49')]=[{'all':!![]}];}_0x97e783=_[_0xd574('0x4f')]({},_0x97e783,_0x17d98c[_0xd574('0x47')]);return db['MailQueue']['find'](_0x97e783)[_0xd574('0x2a')](handleEntityNotFound(_0x1830a0,null))[_0xd574('0x2a')](respondWithResult(_0x1830a0,null))[_0xd574('0x4c')](handleError(_0x1830a0,null));};exports[_0xd574('0x50')]=function(_0x3169de,_0x37ccf2){return db[_0xd574('0x32')]['create'](_0x3169de[_0xd574('0x51')],{})[_0xd574('0x2a')](function(_0x56b08f){var _0x3d7805=_0x3169de[_0xd574('0x52')]['get']({'plain':!![]});if(!_0x3d7805)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d7805[_0xd574('0x53')]===_0xd574('0x52')){var _0x17ab77=_0x56b08f[_0xd574('0x54')]({'plain':!![]});var _0x276e97=_0xd574('0x2c');return db[_0xd574('0x55')][_0xd574('0x56')]({'where':{'name':_0x276e97,'userProfileId':_0x3d7805[_0xd574('0x57')]},'raw':!![]})[_0xd574('0x2a')](function(_0x377f67){if(_0x377f67&&_0x377f67[_0xd574('0x58')]===0x0){return db[_0xd574('0x2d')][_0xd574('0x50')]({'name':_0x17ab77['name'],'resourceId':_0x17ab77['id'],'type':_0x377f67[_0xd574('0x30')],'sectionId':_0x377f67['id']},{})['then'](function(){return _0x56b08f;});}else{return _0x56b08f;}})[_0xd574('0x4c')](function(_0x2102b2){logger[_0xd574('0x2e')](_0xd574('0x59'),_0x2102b2);throw _0x2102b2;});}return _0x56b08f;})['then'](respondWithResult(_0x37ccf2,0xc9))[_0xd574('0x4c')](handleError(_0x37ccf2,null));};exports['update']=function(_0x4ef2a6,_0x400502){if(_0x4ef2a6['body']['id']){delete _0x4ef2a6[_0xd574('0x51')]['id'];}return db[_0xd574('0x32')][_0xd574('0x56')]({'where':{'id':_0x4ef2a6[_0xd574('0x4e')]['id']}})['then'](handleEntityNotFound(_0x400502,null))['then'](saveUpdates(_0x4ef2a6['body'],null))[_0xd574('0x2a')](respondWithResult(_0x400502,null))[_0xd574('0x4c')](handleError(_0x400502,null));};exports[_0xd574('0x2b')]=function(_0x138325,_0x509c35){return db[_0xd574('0x32')]['find']({'where':{'id':_0x138325[_0xd574('0x4e')]['id']}})['then'](handleEntityNotFound(_0x509c35,null))['then'](removeEntity(_0x509c35,null))[_0xd574('0x4c')](handleError(_0x509c35,null));};exports['describe']=function(_0x446237,_0x50da44){return db['MailQueue'][_0xd574('0x5a')]()[_0xd574('0x2a')](respondWithResult(_0x50da44,null))[_0xd574('0x4c')](handleError(_0x50da44,null));};exports[_0xd574('0x5b')]=function(_0x1dc97c,_0x3227e9,_0x3c25c0){var _0x2080cb={'raw':!![],'where':{}},_0x14713a={},_0x1f28f4;return db[_0xd574('0x32')][_0xd574('0x5c')]({'where':{'id':_0x1dc97c[_0xd574('0x4e')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x3227e9,null))[_0xd574('0x2a')](function(_0x5b6e7d){if(_0x5b6e7d){_0x1f28f4=_0x5b6e7d[_0xd574('0x54')]({'plain':!![]});_0x14713a[_0xd574('0x36')]=_[_0xd574('0x38')](db[_0xd574('0x5d')][_0xd574('0x33')]);_0x14713a[_0xd574('0x37')]=_[_0xd574('0x38')](_0x1dc97c[_0xd574('0x37')]);_0x14713a[_0xd574('0x43')]=_['intersection'](_0x14713a[_0xd574('0x36')],_0x14713a[_0xd574('0x37')]);_0x2080cb['attributes']=_[_0xd574('0x39')](_0x14713a['model'],qs[_0xd574('0x3b')](_0x1dc97c[_0xd574('0x37')][_0xd574('0x3b')]));_0x2080cb['attributes']=_0x2080cb[_0xd574('0x3a')]['length']?_0x2080cb[_0xd574('0x3a')]:_0x14713a[_0xd574('0x36')];if(!_0x1dc97c[_0xd574('0x37')][_0xd574('0x3d')](_0xd574('0x3e'))){_0x2080cb[_0xd574('0x24')]=qs[_0xd574('0x24')](_0x1dc97c[_0xd574('0x37')][_0xd574('0x24')]);_0x2080cb[_0xd574('0x21')]=qs[_0xd574('0x21')](_0x1dc97c['query'][_0xd574('0x21')]);}_0x2080cb[_0xd574('0x3f')]=qs['sort'](_0x1dc97c[_0xd574('0x37')]['sort']);_0x2080cb[_0xd574('0x41')]=qs['filters'](_['pick'](_0x1dc97c[_0xd574('0x37')],_0x14713a[_0xd574('0x43')]));_0x2080cb[_0xd574('0x41')][_0xd574('0x5e')]=_0x5b6e7d['id'];if(_0x1dc97c[_0xd574('0x37')][_0xd574('0x46')]){_0x2080cb[_0xd574('0x41')]=_['merge'](_0x2080cb[_0xd574('0x41')],{'$or':_['map'](_0x2080cb[_0xd574('0x3a')],function(_0x2d9418){var _0xa581d4={};_0xa581d4[_0x2d9418]={'$like':'%'+_0x1dc97c[_0xd574('0x37')][_0xd574('0x46')]+'%'};return _0xa581d4;})});}_0x2080cb=_['merge']({},_0x2080cb,_0x1dc97c[_0xd574('0x47')]);return db[_0xd574('0x5d')][_0xd574('0x4a')](_0x2080cb);}})[_0xd574('0x2a')](function(_0x147d22){if(_0x147d22){return db[_0xd574('0x5f')][_0xd574('0x60')]({'where':{'id':_[_0xd574('0x31')](_0x147d22,_0xd574('0x61')),'role':_0xd574('0x62')},'attributes':['id',_0xd574('0x30'),_0xd574('0x63'),_0xd574('0x64'),_0xd574('0x65')]});}})[_0xd574('0x2a')](function(_0xff62b){if(_0xff62b){return{'count':_0xff62b[_0xd574('0x23')],'rows':_['map'](_0xff62b['rows'],function(_0x4c7848){return{'membername':_0x4c7848[_0xd574('0x30')],'UserId':_0x4c7848['id'],'queue_name':_0x1f28f4[_0xd574('0x30')],'MailQueueId':_0x1f28f4['id'],'interface':util['format'](_0xd574('0x66'),_0xd574('0x67'),_0x4c7848[_0xd574('0x30')]),'penalty':0x0,'paused':_0x4c7848[_0xd574('0x63')],'createdAt':_0x4c7848[_0xd574('0x65')],'updatedAt':_0x4c7848['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd574('0x2a')](respondWithFilteredResult(_0x3227e9,_0x2080cb))[_0xd574('0x4c')](handleError(_0x3227e9,null));};exports[_0xd574('0x68')]=function(_0x30fc14,_0x368da0,_0x1a8261){var _0x24275b={};var _0x243c09={};var _0x685cd4;var _0xf249bc;return db[_0xd574('0x32')]['findOne']({'where':{'id':_0x30fc14['params']['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x368da0,null))['then'](function(_0x2490a5){if(_0x2490a5){_0x685cd4=_0x2490a5;_0x243c09[_0xd574('0x36')]=_[_0xd574('0x38')](db[_0xd574('0x69')][_0xd574('0x33')]);_0x243c09[_0xd574('0x37')]=_['keys'](_0x30fc14[_0xd574('0x37')]);_0x243c09['filters']=_['intersection'](_0x243c09[_0xd574('0x36')],_0x243c09[_0xd574('0x37')]);_0x24275b[_0xd574('0x3a')]=_['intersection'](_0x243c09[_0xd574('0x36')],qs[_0xd574('0x3b')](_0x30fc14[_0xd574('0x37')]['fields']));_0x24275b[_0xd574('0x3a')]=_0x24275b['attributes'][_0xd574('0x3c')]?_0x24275b[_0xd574('0x3a')]:_0x243c09[_0xd574('0x36')];_0x24275b[_0xd574('0x3f')]=qs['sort'](_0x30fc14['query']['sort']);_0x24275b['where']=qs[_0xd574('0x43')](_['pick'](_0x30fc14[_0xd574('0x37')],_0x243c09['filters']));if(_0x30fc14[_0xd574('0x37')][_0xd574('0x46')]){_0x24275b[_0xd574('0x41')]=_['merge'](_0x24275b[_0xd574('0x41')],{'$or':_[_0xd574('0x31')](_0x24275b[_0xd574('0x3a')],function(_0x16a773){var _0x5c6cd1={};_0x5c6cd1[_0x16a773]={'$like':'%'+_0x30fc14['query']['filter']+'%'};return _0x5c6cd1;})});}_0x24275b=_[_0xd574('0x4f')]({},_0x24275b,_0x30fc14[_0xd574('0x47')]);return _0x685cd4['getTeams'](_0x24275b);}})[_0xd574('0x2a')](function(_0x540f65){if(_0x540f65){_0xf249bc=_0x540f65['length'];if(!_0x30fc14[_0xd574('0x37')][_0xd574('0x3d')](_0xd574('0x3e'))){_0x24275b[_0xd574('0x24')]=qs[_0xd574('0x24')](_0x30fc14[_0xd574('0x37')]['limit']);_0x24275b[_0xd574('0x21')]=qs[_0xd574('0x21')](_0x30fc14[_0xd574('0x37')][_0xd574('0x21')]);}return _0x685cd4[_0xd574('0x68')](_0x24275b);}})[_0xd574('0x2a')](function(_0x40bbf4){if(_0x40bbf4){return _0x40bbf4?{'count':_0xf249bc,'rows':_0x40bbf4}:null;}})['then'](respondWithResult(_0x368da0,null))[_0xd574('0x4c')](handleError(_0x368da0,null));};exports[_0xd574('0x6a')]=function(_0x2a7bef,_0x23d6e6,_0x30fe08){var _0x23103b=_0x2a7bef[_0xd574('0x51')]['ids'];return db[_0xd574('0x69')][_0xd574('0x4a')]({'where':{'id':_0x23103b},'attributes':['id'],'include':[{'model':db[_0xd574('0x5f')],'as':_0xd574('0x6b'),'attributes':['id','name',_0xd574('0x6c'),_0xd574('0x6d'),_0xd574('0x6e')],'raw':!![]}]})['then'](function(_0x2913b1){if(_0x2913b1){var _0x27d420=_[_0xd574('0x6f')](_0x2913b1,function(_0x1c46f6){var _0x1b0459=_0x1c46f6[_0xd574('0x54')]({'plain':!![]});return _0x1b0459[_0xd574('0x6b')];});return db[_0xd574('0x32')]['find']({'where':{'id':_0x2a7bef[_0xd574('0x4e')]['id']}})[_0xd574('0x2a')](function(_0x5e13c8){return db['sequelize'][_0xd574('0x70')](function(_0x4afae4){return _0x5e13c8[_0xd574('0x6a')](_0x23103b,{'transaction':_0x4afae4})['then'](function(){return BPromise[_0xd574('0x71')](_0x27d420,function(_0x2a84f6){return db[_0xd574('0x5d')][_0xd574('0x72')]({'where':{'UserId':_0x2a84f6['id'],'MailQueueId':_0x2a7bef['params']['id']},'transaction':_0x4afae4});});})[_0xd574('0x2a')](function(){_0x27d420['forEach'](function(_0xc9f863){socket[_0xd574('0x73')](_0xd574('0x74'),{'UserId':_0xc9f863['id'],'MailQueueId':_0x5e13c8['id']});});});});});}})[_0xd574('0x2a')](respondWithStatusCode(_0x23d6e6,null))[_0xd574('0x4c')](handleError(_0x23d6e6,null));};exports[_0xd574('0x75')]=function(_0x13e2ff,_0x3e15f8,_0xf4d64a){return db[_0xd574('0x69')][_0xd574('0x4a')]({'where':{'id':_0x13e2ff[_0xd574('0x37')][_0xd574('0x76')]},'attributes':['id'],'include':[{'model':db[_0xd574('0x5f')],'as':_0xd574('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xd574('0x2a')](handleEntityNotFound(_0x3e15f8,null))[_0xd574('0x2a')](function(_0x9c8b89){var _0x17f505=_['map'](_0x9c8b89,'id');var _0xd69a3d=[];var _0x50342b=[];var _0x641203=squel[_0xd574('0x77')]();_0x641203[_0xd574('0x78')](_0xd574('0x79'))['from'](_0xd574('0x7a'),'tq')[_0xd574('0x7b')](_0xd574('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd574('0x41')](_0xd574('0x7d'),_0x13e2ff[_0xd574('0x4e')]['id']);for(var _0x577fe8=0x0;_0x577fe8<_0x9c8b89[_0xd574('0x3c')];_0x577fe8+=0x1){let _0x4733e5=_0x9c8b89[_0x577fe8];for(var _0x18d338=0x0;_0x18d338<_0x4733e5[_0xd574('0x6b')][_0xd574('0x3c')];_0x18d338+=0x1){let _0x2d2963=_0x4733e5[_0xd574('0x6b')][_0x18d338];var _0x1a2799=_0x641203[_0xd574('0x7e')]();_0x1a2799['where'](_0xd574('0x7f'),_0x2d2963['id']);_0x50342b[_0xd574('0x80')](db[_0xd574('0x81')][_0xd574('0x37')](_0x1a2799['toString'](),{'type':db[_0xd574('0x81')][_0xd574('0x82')]['SELECT']})[_0xd574('0x2a')](function(_0x2cd2dc){if(_0x2cd2dc[_0xd574('0x3c')]===0x1){return _0x2d2963['id'];}else{var _0x46cd82=_[_0xd574('0x83')](_[_0xd574('0x31')](_0x2cd2dc,_0xd574('0x84')),function(_0x14bf3e){return _[_0xd574('0x85')](_0x17f505,_0x14bf3e);});if(_0x46cd82){return _0x2d2963['id'];}}}));}}return BPromise['all'](_0x50342b)['then'](function(_0x1648d8){_0xd69a3d=_(_0xd69a3d)[_0xd574('0x86')](_0x1648d8)['compact']()[_0xd574('0x87')]();return db[_0xd574('0x32')][_0xd574('0x56')]({'where':{'id':_0x13e2ff[_0xd574('0x4e')]['id']}})[_0xd574('0x2a')](function(_0x4ffd64){return db['sequelize'][_0xd574('0x70')](function(_0x1cf4d0){return _0x4ffd64[_0xd574('0x75')](_0x13e2ff[_0xd574('0x37')][_0xd574('0x76')],{'transaction':_0x1cf4d0})['then'](function(){if(!_[_0xd574('0x88')](_0xd69a3d)){return _0x4ffd64[_0xd574('0x89')](_0xd69a3d,{'transaction':_0x1cf4d0});}})[_0xd574('0x2a')](function(){_0xd69a3d['forEach'](function(_0x1d0a73){socket[_0xd574('0x73')](_0xd574('0x8a'),{'UserId':_0x1d0a73,'MailQueueId':_0x4ffd64['id']});});});});});});})[_0xd574('0x2a')](respondWithStatusCode(_0x3e15f8,null))['catch'](handleError(_0x3e15f8,null));};exports[_0xd574('0x8b')]=function(_0x3c036a,_0x7e83a8,_0x9529eb){return db[_0xd574('0x32')][_0xd574('0x56')]({'where':{'id':_0x3c036a[_0xd574('0x4e')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x7e83a8,null))[_0xd574('0x2a')](function(_0x1c8057){if(_0x1c8057){return _0x1c8057[_0xd574('0x8b')](_0x3c036a[_0xd574('0x51')][_0xd574('0x76')],_[_0xd574('0x8c')](_0x3c036a[_0xd574('0x51')],[_0xd574('0x76'),'id'])||{})['spread'](function(_0x3c8746){for(var _0x253ac1=0x0;_0x253ac1<_0x3c036a[_0xd574('0x51')][_0xd574('0x76')][_0xd574('0x3c')];_0x253ac1+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x3c036a[_0xd574('0x51')][_0xd574('0x76')][_0x253ac1]),'MailQueueId':Number(_0x3c036a[_0xd574('0x4e')]['id'])});}return _0x3c8746;});}})[_0xd574('0x2a')](respondWithResult(_0x7e83a8,null))['catch'](handleError(_0x7e83a8,null));};exports[_0xd574('0x89')]=function(_0x1e5450,_0x436b40,_0x56771d){return db['MailQueue'][_0xd574('0x56')]({'where':{'id':_0x1e5450[_0xd574('0x4e')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x436b40,null))[_0xd574('0x2a')](function(_0x296fe4){if(_0x296fe4){return _0x296fe4[_0xd574('0x89')](_0x1e5450['query']['ids'])[_0xd574('0x2a')](function(){if(_[_0xd574('0x8d')](_0x1e5450[_0xd574('0x37')][_0xd574('0x76')])){for(var _0x3cb404=0x0;_0x3cb404<_0x1e5450[_0xd574('0x37')]['ids']['length'];_0x3cb404+=0x1){socket[_0xd574('0x73')]('userMailQueue:remove',{'UserId':Number(_0x1e5450[_0xd574('0x37')][_0xd574('0x76')][_0x3cb404]),'MailQueueId':Number(_0x1e5450[_0xd574('0x4e')]['id'])});}}else{socket[_0xd574('0x73')]('userMailQueue:remove',{'UserId':Number(_0x1e5450['query'][_0xd574('0x76')]),'MailQueueId':Number(_0x1e5450[_0xd574('0x4e')]['id'])});}});}})[_0xd574('0x2a')](respondWithStatusCode(_0x436b40,null))[_0xd574('0x4c')](handleError(_0x436b40,null));};exports[_0xd574('0x8e')]=function(_0x80d69f,_0x1b3e18,_0xa125ad){var _0x1fbb37={};var _0x1016d8={};var _0x3c342d;var _0xaf28c1;return db[_0xd574('0x32')][_0xd574('0x5c')]({'where':{'id':_0x80d69f[_0xd574('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b3e18,null))[_0xd574('0x2a')](function(_0x281726){if(_0x281726){_0x3c342d=_0x281726;_0x1016d8[_0xd574('0x36')]=_[_0xd574('0x38')](db[_0xd574('0x5f')]['rawAttributes']);_0x1016d8[_0xd574('0x37')]=_[_0xd574('0x38')](_0x80d69f[_0xd574('0x37')]);_0x1016d8['filters']=_[_0xd574('0x39')](_0x1016d8[_0xd574('0x36')],_0x1016d8['query']);_0x1fbb37[_0xd574('0x3a')]=_[_0xd574('0x39')](_0x1016d8['model'],qs[_0xd574('0x3b')](_0x80d69f['query'][_0xd574('0x3b')]));_0x1fbb37[_0xd574('0x3a')]=_0x1fbb37[_0xd574('0x3a')][_0xd574('0x3c')]?_0x1fbb37['attributes']:_0x1016d8['model'];_0x1fbb37[_0xd574('0x3f')]=qs[_0xd574('0x40')](_0x80d69f[_0xd574('0x37')][_0xd574('0x40')]);_0x1fbb37[_0xd574('0x41')]=qs[_0xd574('0x43')](_[_0xd574('0x42')](_0x80d69f[_0xd574('0x37')],_0x1016d8[_0xd574('0x43')]));if(_0x80d69f[_0xd574('0x37')][_0xd574('0x46')]){_0x1fbb37[_0xd574('0x41')]=_[_0xd574('0x4f')](_0x1fbb37[_0xd574('0x41')],{'$or':_[_0xd574('0x31')](_0x1fbb37[_0xd574('0x3a')],function(_0xcd49c3){var _0x3c4e09={};_0x3c4e09[_0xcd49c3]={'$like':'%'+_0x80d69f['query'][_0xd574('0x46')]+'%'};return _0x3c4e09;})});}_0x1fbb37=_['merge']({},_0x1fbb37,_0x80d69f['options']);return _0x3c342d[_0xd574('0x8e')](_0x1fbb37);}})[_0xd574('0x2a')](function(_0x536641){if(_0x536641){_0xaf28c1=_0x536641['length'];if(!_0x80d69f[_0xd574('0x37')][_0xd574('0x3d')](_0xd574('0x3e'))){_0x1fbb37[_0xd574('0x24')]=qs['limit'](_0x80d69f['query'][_0xd574('0x24')]);_0x1fbb37[_0xd574('0x21')]=qs[_0xd574('0x21')](_0x80d69f[_0xd574('0x37')][_0xd574('0x21')]);}return _0x3c342d['getAgents'](_0x1fbb37);}})['then'](function(_0x12f0e5){if(_0x12f0e5){return _0x12f0e5?{'count':_0xaf28c1,'rows':_0x12f0e5}:null;}})[_0xd574('0x2a')](respondWithResult(_0x1b3e18,null))[_0xd574('0x4c')](handleError(_0x1b3e18,null));}; \ No newline at end of file +var _0x5d6c=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','count','limit','set','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Team','User','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','value','isEmpty','emit','userMailQueue:remove','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x17f8cd,_0x25656a){var _0xf074f3=function(_0x5af06f){while(--_0x5af06f){_0x17f8cd['push'](_0x17f8cd['shift']());}};_0xf074f3(++_0x25656a);}(_0x5d6c,0x100));var _0xc5d6=function(_0x25bb3c,_0xa9ecf5){_0x25bb3c=_0x25bb3c-0x0;var _0x3d70cb=_0x5d6c[_0x25bb3c];return _0x3d70cb;};'use strict';var emlformat=require(_0xc5d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5d6('0x1'));var jsonpatch=require(_0xc5d6('0x2'));var rp=require(_0xc5d6('0x3'));var moment=require(_0xc5d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5d6('0x5'));var util=require(_0xc5d6('0x6'));var path=require(_0xc5d6('0x7'));var sox=require(_0xc5d6('0x8'));var csv=require(_0xc5d6('0x9'));var ejs=require(_0xc5d6('0xa'));var fs=require('fs');var fs_extra=require(_0xc5d6('0xb'));var _=require(_0xc5d6('0xc'));var squel=require(_0xc5d6('0xd'));var crypto=require(_0xc5d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc5d6('0xf'));var toCsv=require(_0xc5d6('0x9'));var querystring=require(_0xc5d6('0x10'));var Papa=require('papaparse');var Redis=require(_0xc5d6('0x11'));var authService=require(_0xc5d6('0x12'));var qs=require(_0xc5d6('0x13'));var as=require(_0xc5d6('0x14'));var hardwareService=require(_0xc5d6('0x15'));var logger=require('../../config/logger')(_0xc5d6('0x16'));var utils=require(_0xc5d6('0x17'));var config=require(_0xc5d6('0x18'));var licenseUtil=require(_0xc5d6('0x19'));var db=require(_0xc5d6('0x1a'))['db'];config[_0xc5d6('0x1b')]=_[_0xc5d6('0x1c')](config['redis'],{'host':_0xc5d6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc5d6('0x1e'))[_0xc5d6('0x1f')](socket);function respondWithStatusCode(_0x42d8eb,_0x4d3a6b){_0x4d3a6b=_0x4d3a6b||0xcc;return function(_0xaa6c82){if(_0xaa6c82){return _0x42d8eb[_0xc5d6('0x20')](_0x4d3a6b);}return _0x42d8eb[_0xc5d6('0x21')](_0x4d3a6b)[_0xc5d6('0x22')]();};}function respondWithResult(_0x92585,_0x17fdbf){_0x17fdbf=_0x17fdbf||0xc8;return function(_0x3b0155){if(_0x3b0155){return _0x92585[_0xc5d6('0x21')](_0x17fdbf)[_0xc5d6('0x23')](_0x3b0155);}};}function respondWithFilteredResult(_0xefeccf,_0x53e5ce){return function(_0x143e3a){if(_0x143e3a){var _0x3b4042=typeof _0x53e5ce[_0xc5d6('0x24')]==='undefined'&&typeof _0x53e5ce['limit']==='undefined';var _0x55806c=_0x143e3a[_0xc5d6('0x25')];var _0x137a8b=_0x3b4042?0x0:_0x53e5ce['offset'];var _0x219acf=_0x3b4042?_0x143e3a[_0xc5d6('0x25')]:_0x53e5ce[_0xc5d6('0x24')]+_0x53e5ce[_0xc5d6('0x26')];var _0x111c1;if(_0x219acf>=_0x55806c){_0x219acf=_0x55806c;_0x111c1=0xc8;}else{_0x111c1=0xce;}_0xefeccf[_0xc5d6('0x21')](_0x111c1);return _0xefeccf[_0xc5d6('0x27')]('Content-Range',_0x137a8b+'-'+_0x219acf+'/'+_0x55806c)[_0xc5d6('0x23')](_0x143e3a);}return null;};}function patchUpdates(_0x2bbee8){return function(_0x386e9c){try{jsonpatch['apply'](_0x386e9c,_0x2bbee8,!![]);}catch(_0x200a6e){return BPromise['reject'](_0x200a6e);}return _0x386e9c[_0xc5d6('0x28')]();};}function saveUpdates(_0x4ecb31,_0x3eaac){return function(_0x5b8623){if(_0x5b8623){return _0x5b8623[_0xc5d6('0x29')](_0x4ecb31)[_0xc5d6('0x2a')](function(_0x3fa5a8){return _0x3fa5a8;});}return null;};}function removeEntity(_0x21482d,_0x50c4c8){return function(_0x519643){if(_0x519643){return _0x519643[_0xc5d6('0x2b')]()[_0xc5d6('0x2a')](function(){var _0x2fcc2a=_0x519643['get']({'plain':!![]});var _0x20574b=_0xc5d6('0x2c');return db[_0xc5d6('0x2d')]['destroy']({'where':{'type':_0x20574b,'resourceId':_0x2fcc2a['id']}})[_0xc5d6('0x2a')](function(){return _0x519643;});})['then'](function(){_0x21482d[_0xc5d6('0x21')](0xcc)[_0xc5d6('0x22')]();});}};}function handleEntityNotFound(_0xda2b57,_0x5be0e1){return function(_0xd21974){if(!_0xd21974){_0xda2b57[_0xc5d6('0x20')](0x194);}return _0xd21974;};}function handleError(_0x56c1d5,_0x4eaf6c){_0x4eaf6c=_0x4eaf6c||0x1f4;return function(_0x4fba20){logger[_0xc5d6('0x2e')](_0x4fba20[_0xc5d6('0x2f')]);if(_0x4fba20[_0xc5d6('0x30')]){delete _0x4fba20[_0xc5d6('0x30')];}_0x56c1d5[_0xc5d6('0x21')](_0x4eaf6c)[_0xc5d6('0x31')](_0x4fba20);};}exports['index']=function(_0xc6f8c3,_0x5c6f02){var _0x2fe06a={},_0x57e0a4={},_0x19235d={'count':0x0,'rows':[]};var _0x4f9ab2=_[_0xc5d6('0x32')](db[_0xc5d6('0x33')][_0xc5d6('0x34')],function(_0xf91fff){return{'name':_0xf91fff[_0xc5d6('0x35')],'type':_0xf91fff[_0xc5d6('0x36')][_0xc5d6('0x37')]};});_0x57e0a4['model']=_['map'](_0x4f9ab2,_0xc5d6('0x30'));_0x57e0a4[_0xc5d6('0x38')]=_[_0xc5d6('0x39')](_0xc6f8c3[_0xc5d6('0x38')]);_0x57e0a4[_0xc5d6('0x3a')]=_[_0xc5d6('0x3b')](_0x57e0a4[_0xc5d6('0x3c')],_0x57e0a4[_0xc5d6('0x38')]);_0x2fe06a[_0xc5d6('0x3d')]=_[_0xc5d6('0x3b')](_0x57e0a4['model'],qs['fields'](_0xc6f8c3[_0xc5d6('0x38')][_0xc5d6('0x3e')]));_0x2fe06a[_0xc5d6('0x3d')]=_0x2fe06a[_0xc5d6('0x3d')][_0xc5d6('0x3f')]?_0x2fe06a[_0xc5d6('0x3d')]:_0x57e0a4['model'];if(!_0xc6f8c3['query'][_0xc5d6('0x40')]('nolimit')){_0x2fe06a[_0xc5d6('0x26')]=qs[_0xc5d6('0x26')](_0xc6f8c3[_0xc5d6('0x38')][_0xc5d6('0x26')]);_0x2fe06a[_0xc5d6('0x24')]=qs['offset'](_0xc6f8c3[_0xc5d6('0x38')]['offset']);}_0x2fe06a[_0xc5d6('0x41')]=qs[_0xc5d6('0x42')](_0xc6f8c3['query'][_0xc5d6('0x42')]);_0x2fe06a[_0xc5d6('0x43')]=qs['filters'](_[_0xc5d6('0x44')](_0xc6f8c3[_0xc5d6('0x38')],_0x57e0a4['filters']),_0x4f9ab2);if(_0xc6f8c3[_0xc5d6('0x38')][_0xc5d6('0x45')]){_0x2fe06a[_0xc5d6('0x43')]=_[_0xc5d6('0x46')](_0x2fe06a[_0xc5d6('0x43')],{'$or':_[_0xc5d6('0x32')](_0x4f9ab2,function(_0x4c820c){if(_0x4c820c[_0xc5d6('0x36')]!==_0xc5d6('0x47')){var _0x329040={};_0x329040[_0x4c820c[_0xc5d6('0x30')]]={'$like':'%'+_0xc6f8c3[_0xc5d6('0x38')][_0xc5d6('0x45')]+'%'};return _0x329040;}})});}_0x2fe06a=_['merge']({},_0x2fe06a,_0xc6f8c3[_0xc5d6('0x48')]);var _0x79f26b={'where':_0x2fe06a[_0xc5d6('0x43')]};return db[_0xc5d6('0x33')][_0xc5d6('0x25')](_0x79f26b)['then'](function(_0x1c8e9e){_0x19235d[_0xc5d6('0x25')]=_0x1c8e9e;if(_0xc6f8c3[_0xc5d6('0x38')][_0xc5d6('0x49')]){_0x2fe06a[_0xc5d6('0x4a')]=[{'all':!![]}];}return db[_0xc5d6('0x33')][_0xc5d6('0x4b')](_0x2fe06a);})['then'](function(_0x353567){_0x19235d[_0xc5d6('0x4c')]=_0x353567;return _0x19235d;})['then'](respondWithFilteredResult(_0x5c6f02,_0x2fe06a))[_0xc5d6('0x4d')](handleError(_0x5c6f02,null));};exports['show']=function(_0x5ea3dd,_0x1a7e1c){var _0x2420c6={'raw':!![],'where':{'id':_0x5ea3dd[_0xc5d6('0x4e')]['id']}},_0x4c39bf={};_0x4c39bf[_0xc5d6('0x3c')]=_[_0xc5d6('0x39')](db[_0xc5d6('0x33')][_0xc5d6('0x34')]);_0x4c39bf[_0xc5d6('0x38')]=_[_0xc5d6('0x39')](_0x5ea3dd[_0xc5d6('0x38')]);_0x4c39bf[_0xc5d6('0x3a')]=_[_0xc5d6('0x3b')](_0x4c39bf[_0xc5d6('0x3c')],_0x4c39bf['query']);_0x2420c6[_0xc5d6('0x3d')]=_[_0xc5d6('0x3b')](_0x4c39bf[_0xc5d6('0x3c')],qs[_0xc5d6('0x3e')](_0x5ea3dd[_0xc5d6('0x38')][_0xc5d6('0x3e')]));_0x2420c6['attributes']=_0x2420c6[_0xc5d6('0x3d')][_0xc5d6('0x3f')]?_0x2420c6['attributes']:_0x4c39bf[_0xc5d6('0x3c')];if(_0x5ea3dd[_0xc5d6('0x38')][_0xc5d6('0x49')]){_0x2420c6['include']=[{'all':!![]}];}_0x2420c6=_[_0xc5d6('0x46')]({},_0x2420c6,_0x5ea3dd[_0xc5d6('0x48')]);return db[_0xc5d6('0x33')][_0xc5d6('0x4f')](_0x2420c6)['then'](handleEntityNotFound(_0x1a7e1c,null))['then'](respondWithResult(_0x1a7e1c,null))['catch'](handleError(_0x1a7e1c,null));};exports[_0xc5d6('0x50')]=function(_0x24830e,_0x489ef5){return db[_0xc5d6('0x33')][_0xc5d6('0x50')](_0x24830e[_0xc5d6('0x51')],{})[_0xc5d6('0x2a')](function(_0x1a7a12){var _0x4fd70e=_0x24830e['user']['get']({'plain':!![]});if(!_0x4fd70e)throw new Error(_0xc5d6('0x52'));if(_0x4fd70e[_0xc5d6('0x53')]===_0xc5d6('0x54')){var _0x573301=_0x1a7a12[_0xc5d6('0x55')]({'plain':!![]});var _0x274cb8=_0xc5d6('0x2c');return db[_0xc5d6('0x56')][_0xc5d6('0x4f')]({'where':{'name':_0x274cb8,'userProfileId':_0x4fd70e['userProfileId']},'raw':!![]})['then'](function(_0x13dd0c){if(_0x13dd0c&&_0x13dd0c['autoAssociation']===0x0){return db[_0xc5d6('0x2d')][_0xc5d6('0x50')]({'name':_0x573301['name'],'resourceId':_0x573301['id'],'type':_0x13dd0c[_0xc5d6('0x30')],'sectionId':_0x13dd0c['id']},{})[_0xc5d6('0x2a')](function(){return _0x1a7a12;});}else{return _0x1a7a12;}})[_0xc5d6('0x4d')](function(_0x5cf9f4){logger['error'](_0xc5d6('0x57'),_0x5cf9f4);throw _0x5cf9f4;});}return _0x1a7a12;})[_0xc5d6('0x2a')](respondWithResult(_0x489ef5,0xc9))[_0xc5d6('0x4d')](handleError(_0x489ef5,null));};exports[_0xc5d6('0x29')]=function(_0x49e284,_0x3edad4){if(_0x49e284['body']['id']){delete _0x49e284[_0xc5d6('0x51')]['id'];}return db['MailQueue'][_0xc5d6('0x4f')]({'where':{'id':_0x49e284[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0x3edad4,null))[_0xc5d6('0x2a')](saveUpdates(_0x49e284[_0xc5d6('0x51')],null))[_0xc5d6('0x2a')](respondWithResult(_0x3edad4,null))['catch'](handleError(_0x3edad4,null));};exports['destroy']=function(_0x38729f,_0x314eb6){return db[_0xc5d6('0x33')]['find']({'where':{'id':_0x38729f[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0x314eb6,null))[_0xc5d6('0x2a')](removeEntity(_0x314eb6,null))[_0xc5d6('0x4d')](handleError(_0x314eb6,null));};exports[_0xc5d6('0x58')]=function(_0x5708da,_0x4a888a){return db[_0xc5d6('0x33')][_0xc5d6('0x58')]()[_0xc5d6('0x2a')](respondWithResult(_0x4a888a,null))[_0xc5d6('0x4d')](handleError(_0x4a888a,null));};exports[_0xc5d6('0x59')]=function(_0x4d0a33,_0x3b5ab7,_0x2b25e9){var _0x1cbe48={'raw':!![],'where':{}},_0x3f951a={},_0x1d3b45;return db['MailQueue'][_0xc5d6('0x5a')]({'where':{'id':_0x4d0a33[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0x3b5ab7,null))[_0xc5d6('0x2a')](function(_0x4444f2){if(_0x4444f2){_0x1d3b45=_0x4444f2[_0xc5d6('0x55')]({'plain':!![]});_0x3f951a['model']=_[_0xc5d6('0x39')](db['UserMailQueue']['rawAttributes']);_0x3f951a[_0xc5d6('0x38')]=_[_0xc5d6('0x39')](_0x4d0a33[_0xc5d6('0x38')]);_0x3f951a['filters']=_[_0xc5d6('0x3b')](_0x3f951a[_0xc5d6('0x3c')],_0x3f951a[_0xc5d6('0x38')]);_0x1cbe48[_0xc5d6('0x3d')]=_['intersection'](_0x3f951a['model'],qs[_0xc5d6('0x3e')](_0x4d0a33[_0xc5d6('0x38')][_0xc5d6('0x3e')]));_0x1cbe48[_0xc5d6('0x3d')]=_0x1cbe48[_0xc5d6('0x3d')]['length']?_0x1cbe48['attributes']:_0x3f951a[_0xc5d6('0x3c')];if(!_0x4d0a33[_0xc5d6('0x38')][_0xc5d6('0x40')](_0xc5d6('0x5b'))){_0x1cbe48[_0xc5d6('0x26')]=qs[_0xc5d6('0x26')](_0x4d0a33[_0xc5d6('0x38')]['limit']);_0x1cbe48['offset']=qs['offset'](_0x4d0a33[_0xc5d6('0x38')]['offset']);}_0x1cbe48[_0xc5d6('0x41')]=qs[_0xc5d6('0x42')](_0x4d0a33[_0xc5d6('0x38')]['sort']);_0x1cbe48[_0xc5d6('0x43')]=qs[_0xc5d6('0x3a')](_['pick'](_0x4d0a33['query'],_0x3f951a['filters']));_0x1cbe48[_0xc5d6('0x43')]['MailQueueId']=_0x4444f2['id'];if(_0x4d0a33[_0xc5d6('0x38')][_0xc5d6('0x45')]){_0x1cbe48[_0xc5d6('0x43')]=_['merge'](_0x1cbe48[_0xc5d6('0x43')],{'$or':_[_0xc5d6('0x32')](_0x1cbe48['attributes'],function(_0x456dd3){var _0x2611ff={};_0x2611ff[_0x456dd3]={'$like':'%'+_0x4d0a33[_0xc5d6('0x38')][_0xc5d6('0x45')]+'%'};return _0x2611ff;})});}_0x1cbe48=_[_0xc5d6('0x46')]({},_0x1cbe48,_0x4d0a33[_0xc5d6('0x48')]);return db[_0xc5d6('0x5c')][_0xc5d6('0x4b')](_0x1cbe48);}})['then'](function(_0x5c0dcd){if(_0x5c0dcd){return db['User'][_0xc5d6('0x5d')]({'where':{'id':_[_0xc5d6('0x32')](_0x5c0dcd,_0xc5d6('0x5e')),'role':_0xc5d6('0x5f')},'attributes':['id',_0xc5d6('0x30'),_0xc5d6('0x60'),_0xc5d6('0x61'),_0xc5d6('0x62')]});}})[_0xc5d6('0x2a')](function(_0x49b1ea){if(_0x49b1ea){return{'count':_0x49b1ea['count'],'rows':_[_0xc5d6('0x32')](_0x49b1ea[_0xc5d6('0x4c')],function(_0x22c24c){return{'membername':_0x22c24c['name'],'UserId':_0x22c24c['id'],'queue_name':_0x1d3b45[_0xc5d6('0x30')],'MailQueueId':_0x1d3b45['id'],'interface':util[_0xc5d6('0x63')](_0xc5d6('0x64'),_0xc5d6('0x65'),_0x22c24c[_0xc5d6('0x30')]),'penalty':0x0,'paused':_0x22c24c[_0xc5d6('0x60')],'createdAt':_0x22c24c['createdAt'],'updatedAt':_0x22c24c[_0xc5d6('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc5d6('0x2a')](respondWithFilteredResult(_0x3b5ab7,_0x1cbe48))[_0xc5d6('0x4d')](handleError(_0x3b5ab7,null));};exports[_0xc5d6('0x66')]=function(_0x2674ca,_0xb18506,_0x49124c){var _0x3c48f8={};var _0x5f1fbd={};var _0x3715a0;var _0xaaf802;return db[_0xc5d6('0x33')][_0xc5d6('0x5a')]({'where':{'id':_0x2674ca[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0xb18506,null))['then'](function(_0x1fed4e){if(_0x1fed4e){_0x3715a0=_0x1fed4e;_0x5f1fbd[_0xc5d6('0x3c')]=_['keys'](db['Team'][_0xc5d6('0x34')]);_0x5f1fbd[_0xc5d6('0x38')]=_[_0xc5d6('0x39')](_0x2674ca['query']);_0x5f1fbd[_0xc5d6('0x3a')]=_[_0xc5d6('0x3b')](_0x5f1fbd[_0xc5d6('0x3c')],_0x5f1fbd[_0xc5d6('0x38')]);_0x3c48f8[_0xc5d6('0x3d')]=_['intersection'](_0x5f1fbd['model'],qs[_0xc5d6('0x3e')](_0x2674ca[_0xc5d6('0x38')]['fields']));_0x3c48f8[_0xc5d6('0x3d')]=_0x3c48f8[_0xc5d6('0x3d')]['length']?_0x3c48f8[_0xc5d6('0x3d')]:_0x5f1fbd['model'];_0x3c48f8[_0xc5d6('0x41')]=qs[_0xc5d6('0x42')](_0x2674ca[_0xc5d6('0x38')][_0xc5d6('0x42')]);_0x3c48f8[_0xc5d6('0x43')]=qs['filters'](_['pick'](_0x2674ca[_0xc5d6('0x38')],_0x5f1fbd[_0xc5d6('0x3a')]));if(_0x2674ca[_0xc5d6('0x38')][_0xc5d6('0x45')]){_0x3c48f8[_0xc5d6('0x43')]=_['merge'](_0x3c48f8['where'],{'$or':_['map'](_0x3c48f8[_0xc5d6('0x3d')],function(_0x5e6489){var _0x479257={};_0x479257[_0x5e6489]={'$like':'%'+_0x2674ca[_0xc5d6('0x38')]['filter']+'%'};return _0x479257;})});}_0x3c48f8=_[_0xc5d6('0x46')]({},_0x3c48f8,_0x2674ca[_0xc5d6('0x48')]);return _0x3715a0['getTeams'](_0x3c48f8);}})['then'](function(_0x3b8be0){if(_0x3b8be0){_0xaaf802=_0x3b8be0[_0xc5d6('0x3f')];if(!_0x2674ca[_0xc5d6('0x38')][_0xc5d6('0x40')]('nolimit')){_0x3c48f8[_0xc5d6('0x26')]=qs[_0xc5d6('0x26')](_0x2674ca[_0xc5d6('0x38')][_0xc5d6('0x26')]);_0x3c48f8[_0xc5d6('0x24')]=qs[_0xc5d6('0x24')](_0x2674ca['query'][_0xc5d6('0x24')]);}return _0x3715a0[_0xc5d6('0x66')](_0x3c48f8);}})[_0xc5d6('0x2a')](function(_0xde33eb){if(_0xde33eb){return _0xde33eb?{'count':_0xaaf802,'rows':_0xde33eb}:null;}})[_0xc5d6('0x2a')](respondWithResult(_0xb18506,null))['catch'](handleError(_0xb18506,null));};exports['addTeams']=function(_0x559de5,_0x2f14cb,_0x769f88){var _0x29e773=_0x559de5[_0xc5d6('0x51')][_0xc5d6('0x67')];return db[_0xc5d6('0x68')][_0xc5d6('0x4b')]({'where':{'id':_0x29e773},'attributes':['id'],'include':[{'model':db[_0xc5d6('0x69')],'as':'Agents','attributes':['id',_0xc5d6('0x30'),_0xc5d6('0x6a'),_0xc5d6('0x6b'),_0xc5d6('0x6c')],'raw':!![]}]})[_0xc5d6('0x2a')](function(_0x25410a){if(_0x25410a){var _0x2d6478=_[_0xc5d6('0x6d')](_0x25410a,function(_0x4b818e){var _0x50de6b=_0x4b818e[_0xc5d6('0x55')]({'plain':!![]});return _0x50de6b['Agents'];});return db[_0xc5d6('0x33')]['find']({'where':{'id':_0x559de5[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](function(_0x441c6f){return db[_0xc5d6('0x6e')][_0xc5d6('0x6f')](function(_0x340ace){return _0x441c6f[_0xc5d6('0x70')](_0x29e773,{'transaction':_0x340ace})[_0xc5d6('0x2a')](function(){return BPromise[_0xc5d6('0x71')](_0x2d6478,function(_0x634a68){return db[_0xc5d6('0x5c')]['findOrCreate']({'where':{'UserId':_0x634a68['id'],'MailQueueId':_0x559de5['params']['id']},'transaction':_0x340ace});});})[_0xc5d6('0x2a')](function(){_0x2d6478[_0xc5d6('0x72')](function(_0x54a7a1){socket['emit']('userMailQueue:save',{'UserId':_0x54a7a1['id'],'MailQueueId':_0x441c6f['id']});});});});});}})[_0xc5d6('0x2a')](respondWithStatusCode(_0x2f14cb,null))['catch'](handleError(_0x2f14cb,null));};exports[_0xc5d6('0x73')]=function(_0x3033ce,_0xbe0bea,_0x5b1ff7){return db['Team'][_0xc5d6('0x4b')]({'where':{'id':_0x3033ce[_0xc5d6('0x38')][_0xc5d6('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc5d6('0x74'),'attributes':['id'],'raw':!![]}]})[_0xc5d6('0x2a')](handleEntityNotFound(_0xbe0bea,null))[_0xc5d6('0x2a')](function(_0x3476e2){var _0x220a56=_[_0xc5d6('0x32')](_0x3476e2,'id');var _0x4d3a44=[];var _0xfc8fc2=[];var _0x51ff6b=squel[_0xc5d6('0x75')]();_0x51ff6b[_0xc5d6('0x76')](_0xc5d6('0x77'))[_0xc5d6('0x78')](_0xc5d6('0x79'),'tq')[_0xc5d6('0x7a')]('user_has_teams','ut',_0xc5d6('0x7b'))[_0xc5d6('0x43')](_0xc5d6('0x7c'),_0x3033ce[_0xc5d6('0x4e')]['id']);for(var _0x5cde1f=0x0;_0x5cde1f<_0x3476e2[_0xc5d6('0x3f')];_0x5cde1f+=0x1){let _0x5c4c5b=_0x3476e2[_0x5cde1f];for(var _0x53e1cd=0x0;_0x53e1cd<_0x5c4c5b['Agents']['length'];_0x53e1cd+=0x1){let _0x51f21e=_0x5c4c5b[_0xc5d6('0x74')][_0x53e1cd];var _0x406835=_0x51ff6b['clone']();_0x406835[_0xc5d6('0x43')](_0xc5d6('0x7d'),_0x51f21e['id']);_0xfc8fc2['push'](db[_0xc5d6('0x6e')][_0xc5d6('0x38')](_0x406835[_0xc5d6('0x7e')](),{'type':db[_0xc5d6('0x6e')][_0xc5d6('0x7f')]['SELECT']})[_0xc5d6('0x2a')](function(_0x415a7f){if(_0x415a7f[_0xc5d6('0x3f')]===0x1){return _0x51f21e['id'];}else{var _0x4c6890=_[_0xc5d6('0x80')](_['map'](_0x415a7f,_0xc5d6('0x81')),function(_0x295bd4){return _[_0xc5d6('0x82')](_0x220a56,_0x295bd4);});if(_0x4c6890){return _0x51f21e['id'];}}}));}}return BPromise['all'](_0xfc8fc2)[_0xc5d6('0x2a')](function(_0x25878d){_0x4d3a44=_(_0x4d3a44)[_0xc5d6('0x83')](_0x25878d)['compact']()[_0xc5d6('0x84')]();return db['MailQueue'][_0xc5d6('0x4f')]({'where':{'id':_0x3033ce['params']['id']}})[_0xc5d6('0x2a')](function(_0x42cd59){return db['sequelize']['transaction'](function(_0x1b7ae9){return _0x42cd59[_0xc5d6('0x73')](_0x3033ce[_0xc5d6('0x38')][_0xc5d6('0x67')],{'transaction':_0x1b7ae9})[_0xc5d6('0x2a')](function(){if(!_[_0xc5d6('0x85')](_0x4d3a44)){return _0x42cd59['removeAgents'](_0x4d3a44,{'transaction':_0x1b7ae9});}})[_0xc5d6('0x2a')](function(){_0x4d3a44['forEach'](function(_0x45652e){socket[_0xc5d6('0x86')](_0xc5d6('0x87'),{'UserId':_0x45652e,'MailQueueId':_0x42cd59['id']});});});});});});})[_0xc5d6('0x2a')](respondWithStatusCode(_0xbe0bea,null))[_0xc5d6('0x4d')](handleError(_0xbe0bea,null));};exports['addAgents']=function(_0x1ae18b,_0x310ffa,_0x46e077){return db[_0xc5d6('0x33')][_0xc5d6('0x4f')]({'where':{'id':_0x1ae18b[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0x310ffa,null))[_0xc5d6('0x2a')](function(_0xb105a9){if(_0xb105a9){return _0xb105a9['addAgents'](_0x1ae18b['body'][_0xc5d6('0x67')],_['omit'](_0x1ae18b[_0xc5d6('0x51')],[_0xc5d6('0x67'),'id'])||{})['spread'](function(_0x12022e){for(var _0x2bf9af=0x0;_0x2bf9af<_0x1ae18b[_0xc5d6('0x51')]['ids'][_0xc5d6('0x3f')];_0x2bf9af+=0x1){socket[_0xc5d6('0x86')]('userMailQueue:save',{'UserId':Number(_0x1ae18b[_0xc5d6('0x51')][_0xc5d6('0x67')][_0x2bf9af]),'MailQueueId':Number(_0x1ae18b['params']['id'])});}return _0x12022e;});}})[_0xc5d6('0x2a')](respondWithResult(_0x310ffa,null))['catch'](handleError(_0x310ffa,null));};exports['removeAgents']=function(_0x4e41a9,_0x2719a2,_0x4ee9df){return db[_0xc5d6('0x33')]['find']({'where':{'id':_0x4e41a9[_0xc5d6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2719a2,null))[_0xc5d6('0x2a')](function(_0x14b4b4){if(_0x14b4b4){return _0x14b4b4[_0xc5d6('0x88')](_0x4e41a9[_0xc5d6('0x38')]['ids'])[_0xc5d6('0x2a')](function(){if(_[_0xc5d6('0x89')](_0x4e41a9[_0xc5d6('0x38')][_0xc5d6('0x67')])){for(var _0x410108=0x0;_0x410108<_0x4e41a9[_0xc5d6('0x38')][_0xc5d6('0x67')][_0xc5d6('0x3f')];_0x410108+=0x1){socket[_0xc5d6('0x86')]('userMailQueue:remove',{'UserId':Number(_0x4e41a9[_0xc5d6('0x38')][_0xc5d6('0x67')][_0x410108]),'MailQueueId':Number(_0x4e41a9[_0xc5d6('0x4e')]['id'])});}}else{socket[_0xc5d6('0x86')](_0xc5d6('0x87'),{'UserId':Number(_0x4e41a9[_0xc5d6('0x38')][_0xc5d6('0x67')]),'MailQueueId':Number(_0x4e41a9['params']['id'])});}});}})[_0xc5d6('0x2a')](respondWithStatusCode(_0x2719a2,null))[_0xc5d6('0x4d')](handleError(_0x2719a2,null));};exports[_0xc5d6('0x8a')]=function(_0x487542,_0x4b0794,_0xb93757){var _0x556857={};var _0x39434e={};var _0x2a156f;var _0x2afb09;return db[_0xc5d6('0x33')][_0xc5d6('0x5a')]({'where':{'id':_0x487542[_0xc5d6('0x4e')]['id']}})[_0xc5d6('0x2a')](handleEntityNotFound(_0x4b0794,null))[_0xc5d6('0x2a')](function(_0x2334f3){if(_0x2334f3){_0x2a156f=_0x2334f3;_0x39434e[_0xc5d6('0x3c')]=_[_0xc5d6('0x39')](db[_0xc5d6('0x69')][_0xc5d6('0x34')]);_0x39434e[_0xc5d6('0x38')]=_[_0xc5d6('0x39')](_0x487542[_0xc5d6('0x38')]);_0x39434e[_0xc5d6('0x3a')]=_[_0xc5d6('0x3b')](_0x39434e[_0xc5d6('0x3c')],_0x39434e[_0xc5d6('0x38')]);_0x556857[_0xc5d6('0x3d')]=_[_0xc5d6('0x3b')](_0x39434e[_0xc5d6('0x3c')],qs[_0xc5d6('0x3e')](_0x487542[_0xc5d6('0x38')][_0xc5d6('0x3e')]));_0x556857[_0xc5d6('0x3d')]=_0x556857[_0xc5d6('0x3d')][_0xc5d6('0x3f')]?_0x556857[_0xc5d6('0x3d')]:_0x39434e['model'];_0x556857[_0xc5d6('0x41')]=qs['sort'](_0x487542['query'][_0xc5d6('0x42')]);_0x556857[_0xc5d6('0x43')]=qs['filters'](_[_0xc5d6('0x44')](_0x487542[_0xc5d6('0x38')],_0x39434e[_0xc5d6('0x3a')]));if(_0x487542['query'][_0xc5d6('0x45')]){_0x556857['where']=_[_0xc5d6('0x46')](_0x556857['where'],{'$or':_[_0xc5d6('0x32')](_0x556857[_0xc5d6('0x3d')],function(_0x33ae89){var _0x274f74={};_0x274f74[_0x33ae89]={'$like':'%'+_0x487542['query']['filter']+'%'};return _0x274f74;})});}_0x556857=_[_0xc5d6('0x46')]({},_0x556857,_0x487542['options']);return _0x2a156f[_0xc5d6('0x8a')](_0x556857);}})[_0xc5d6('0x2a')](function(_0x657063){if(_0x657063){_0x2afb09=_0x657063[_0xc5d6('0x3f')];if(!_0x487542[_0xc5d6('0x38')][_0xc5d6('0x40')](_0xc5d6('0x5b'))){_0x556857[_0xc5d6('0x26')]=qs[_0xc5d6('0x26')](_0x487542[_0xc5d6('0x38')]['limit']);_0x556857[_0xc5d6('0x24')]=qs[_0xc5d6('0x24')](_0x487542['query']['offset']);}return _0x2a156f['getAgents'](_0x556857);}})[_0xc5d6('0x2a')](function(_0x4e61ef){if(_0x4e61ef){return _0x4e61ef?{'count':_0x2afb09,'rows':_0x4e61ef}:null;}})[_0xc5d6('0x2a')](respondWithResult(_0x4b0794,null))[_0xc5d6('0x4d')](handleError(_0x4b0794,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 91740d8..42a6125 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 _0xbdd6=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x489d34,_0x4c6d11){var _0x442c19=function(_0x34e45c){while(--_0x34e45c){_0x489d34['push'](_0x489d34['shift']());}};_0x442c19(++_0x4c6d11);}(_0xbdd6,0x13b));var _0x6bdd=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0xbdd6[_0x32f6b9];return _0x267d52;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x6bdd('0x0'))['db'][_0x6bdd('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6bdd('0x2')](0x0);var events={'afterCreate':_0x6bdd('0x3'),'afterUpdate':_0x6bdd('0x4'),'afterDestroy':_0x6bdd('0x5')};function emitEvent(_0x408e1e){return function(_0x233899,_0x82108f,_0x4ebc81){MailQueueEvents[_0x6bdd('0x6')](_0x408e1e+':'+_0x233899['id'],_0x233899);MailQueueEvents['emit'](_0x408e1e,_0x233899);_0x4ebc81(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6bdd('0x7')](e,emitEvent(event));}}module[_0x6bdd('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x9887=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0xdab50,_0x3892fa){var _0x588a9a=function(_0x425f76){while(--_0x425f76){_0xdab50['push'](_0xdab50['shift']());}};_0x588a9a(++_0x3892fa);}(_0x9887,0x163));var _0x7988=function(_0x5a55ac,_0x3d1aaf){_0x5a55ac=_0x5a55ac-0x0;var _0x4911ac=_0x9887[_0x5a55ac];return _0x4911ac;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x7988('0x0'))['db'][_0x7988('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7988('0x2')](0x0);var events={'afterCreate':_0x7988('0x3'),'afterUpdate':_0x7988('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdc7199){return function(_0x1cac69,_0x5b2b51,_0x3f2d22){MailQueueEvents[_0x7988('0x5')](_0xdc7199+':'+_0x1cac69['id'],_0x1cac69);MailQueueEvents[_0x7988('0x5')](_0xdc7199,_0x1cac69);_0x3f2d22(null);};}for(var e in events){if(events[_0x7988('0x6')](e)){var event=events[e];MailQueue[_0x7988('0x7')](e,emitEvent(event));}}module[_0x7988('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3842d24..dcd3587 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 _0xd49c=['api','moment','bluebird','request-promise','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0xd49c,0x10d));var _0xcd49=function(_0x4583a4,_0x2e0e7a){_0x4583a4=_0x4583a4-0x0;var _0x3b1672=_0xd49c[_0x4583a4];return _0x3b1672;};'use strict';var _=require(_0xcd49('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcd49('0x1'));var moment=require(_0xcd49('0x2'));var BPromise=require(_0xcd49('0x3'));var rp=require(_0xcd49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd49('0x5'));module[_0xcd49('0x6')]=function(_0xdbd674,_0x3d367c){return _0xdbd674[_0xcd49('0x7')](_0xcd49('0x8'),attributes,{'tableName':_0xcd49('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf190=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1f86df,_0x630d94){var _0x552806=function(_0x4dd57a){while(--_0x4dd57a){_0x1f86df['push'](_0x1f86df['shift']());}};_0x552806(++_0x630d94);}(_0xf190,0x157));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f19('0x0'));var util=require(_0x0f19('0x1'));var logger=require(_0x0f19('0x2'))('api');var moment=require(_0x0f19('0x3'));var BPromise=require(_0x0f19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f19('0x5'));var rimraf=require(_0x0f19('0x6'));var config=require(_0x0f19('0x7'));var attributes=require(_0x0f19('0x8'));module[_0x0f19('0x9')]=function(_0x39eb1c,_0x5cfc78){return _0x39eb1c[_0x0f19('0xa')](_0x0f19('0xb'),attributes,{'tableName':_0x0f19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 85fec43..6cf7964 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 _0x220c=['map','find','ShowMailQueue','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','model','include'];(function(_0x549325,_0x2e0adb){var _0x360a3e=function(_0x364c74){while(--_0x364c74){_0x549325['push'](_0x549325['shift']());}};_0x360a3e(++_0x2e0adb);}(_0x220c,0xf3));var _0xc220=function(_0x2a5c58,_0x812922){_0x2a5c58=_0x2a5c58-0x0;var _0x277fee=_0x220c[_0x2a5c58];return _0x277fee;};'use strict';var _=require(_0xc220('0x0'));var util=require('util');var moment=require(_0xc220('0x1'));var BPromise=require(_0xc220('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc220('0x3'));var db=require(_0xc220('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc220('0x5'));var config=require(_0xc220('0x6'));var jayson=require(_0xc220('0x7'));var client=jayson[_0xc220('0x8')]['http']({'port':0x232a});config[_0xc220('0x9')]=_[_0xc220('0xa')](config[_0xc220('0x9')],{'host':_0xc220('0xb'),'port':0x18eb});var socket=require(_0xc220('0xc'))(new Redis(config[_0xc220('0x9')]));require(_0xc220('0xd'))['register'](socket);function respondWithRpcPromise(_0x38f52e,_0x397eae,_0x2a6cf5){return new BPromise(function(_0x54d5af,_0x371675){return client[_0xc220('0xe')](_0x38f52e,_0x2a6cf5)[_0xc220('0xf')](function(_0x245fb9){logger[_0xc220('0x10')](_0xc220('0x11'),_0x397eae,'request\x20sent');logger[_0xc220('0x12')](_0xc220('0x13'),_0x397eae,_0xc220('0x14'),JSON[_0xc220('0x15')](_0x245fb9));if(_0x245fb9[_0xc220('0x16')]){if(_0x245fb9[_0xc220('0x16')][_0xc220('0x17')]===0x1f4){logger[_0xc220('0x16')](_0xc220('0x11'),_0x397eae,_0x245fb9[_0xc220('0x16')][_0xc220('0x18')]);return _0x371675(_0x245fb9[_0xc220('0x16')][_0xc220('0x18')]);}logger[_0xc220('0x16')](_0xc220('0x11'),_0x397eae,_0x245fb9[_0xc220('0x16')]['message']);return _0x54d5af(_0x245fb9['error']['message']);}else{logger[_0xc220('0x10')]('MailQueue,\x20%s,\x20%s',_0x397eae,'request\x20sent');_0x54d5af(_0x245fb9[_0xc220('0x19')][_0xc220('0x18')]);}})[_0xc220('0x1a')](function(_0x440b96){logger['error'](_0xc220('0x11'),_0x397eae,_0x440b96);_0x371675(_0x440b96);});});}exports[_0xc220('0x1b')]=function(_0x3d2747){var _0x26f7d7=this;return new Promise(function(_0x42f0b7,_0x3e07af){return db[_0xc220('0x1c')][_0xc220('0x1d')]({'raw':_0x3d2747[_0xc220('0x1e')]?_0x3d2747[_0xc220('0x1e')][_0xc220('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d2747[_0xc220('0x1e')]?_0x3d2747[_0xc220('0x1e')][_0xc220('0x20')]||null:null,'attributes':_0x3d2747[_0xc220('0x1e')]?_0x3d2747[_0xc220('0x1e')][_0xc220('0x21')]||null:null,'limit':_0x3d2747[_0xc220('0x1e')]?_0x3d2747[_0xc220('0x1e')][_0xc220('0x22')]||null:null,'include':_0x3d2747[_0xc220('0x1e')]?_0x3d2747[_0xc220('0x1e')]['include']?_['map'](_0x3d2747[_0xc220('0x1e')]['include'],function(_0x4f67ce){return{'model':db[_0x4f67ce[_0xc220('0x23')]],'as':_0x4f67ce['as'],'attributes':_0x4f67ce[_0xc220('0x21')],'include':_0x4f67ce[_0xc220('0x24')]?_['map'](_0x4f67ce['include'],function(_0x2e2a29){return{'model':db[_0x2e2a29[_0xc220('0x23')]],'as':_0x2e2a29['as'],'attributes':_0x2e2a29[_0xc220('0x21')],'include':_0x2e2a29[_0xc220('0x24')]?_[_0xc220('0x25')](_0x2e2a29[_0xc220('0x24')],function(_0x10e982){return{'model':db[_0x10e982[_0xc220('0x23')]],'as':_0x10e982['as'],'attributes':_0x10e982[_0xc220('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc220('0xf')](function(_0x3b597c){logger['info'](_0xc220('0x1b'),_0x3d2747);logger['debug'](_0xc220('0x1b'),_0x3d2747,JSON[_0xc220('0x15')](_0x3b597c));_0x42f0b7(_0x3b597c);})['catch'](function(_0x2a8e9d){logger[_0xc220('0x16')]('GetMailQueue',_0x2a8e9d[_0xc220('0x18')],_0x3d2747);_0x3e07af(_0x26f7d7[_0xc220('0x16')](0x1f4,_0x2a8e9d[_0xc220('0x18')]));});});};exports['ShowMailQueue']=function(_0x4bfe5d){var _0x5e745a=this;return new Promise(function(_0x17e0ba,_0x2d28eb){return db[_0xc220('0x1c')][_0xc220('0x26')]({'raw':_0x4bfe5d[_0xc220('0x1e')]?_0x4bfe5d[_0xc220('0x1e')][_0xc220('0x1f')]===undefined?!![]:![]:!![],'where':_0x4bfe5d['options']?_0x4bfe5d['options'][_0xc220('0x20')]||null:null,'attributes':_0x4bfe5d[_0xc220('0x1e')]?_0x4bfe5d[_0xc220('0x1e')][_0xc220('0x21')]||null:null,'include':_0x4bfe5d[_0xc220('0x1e')]?_0x4bfe5d[_0xc220('0x1e')]['include']?_[_0xc220('0x25')](_0x4bfe5d['options'][_0xc220('0x24')],function(_0x675fac){return{'model':db[_0x675fac['model']],'as':_0x675fac['as'],'attributes':_0x675fac[_0xc220('0x21')],'include':_0x675fac[_0xc220('0x24')]?_[_0xc220('0x25')](_0x675fac[_0xc220('0x24')],function(_0x10b0d8){return{'model':db[_0x10b0d8[_0xc220('0x23')]],'as':_0x10b0d8['as'],'attributes':_0x10b0d8[_0xc220('0x21')],'include':_0x10b0d8['include']?_[_0xc220('0x25')](_0x10b0d8[_0xc220('0x24')],function(_0x984784){return{'model':db[_0x984784[_0xc220('0x23')]],'as':_0x984784['as'],'attributes':_0x984784[_0xc220('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc220('0xf')](function(_0x5322db){logger[_0xc220('0x10')](_0xc220('0x27'),_0x4bfe5d);logger['debug'](_0xc220('0x27'),_0x4bfe5d,JSON[_0xc220('0x15')](_0x5322db));_0x17e0ba(_0x5322db);})['catch'](function(_0x218403){logger[_0xc220('0x16')](_0xc220('0x27'),_0x218403[_0xc220('0x18')],_0x4bfe5d);_0x2d28eb(_0x5e745a[_0xc220('0x16')](0x1f4,_0x218403[_0xc220('0x18')]));});});}; \ No newline at end of file +var _0xe42c=['ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','options','raw','where','attributes','include','map','model','then','info','debug','stringify'];(function(_0x200b92,_0xba2fad){var _0x28a446=function(_0x289dc7){while(--_0x289dc7){_0x200b92['push'](_0x200b92['shift']());}};_0x28a446(++_0xba2fad);}(_0xe42c,0x149));var _0xce42=function(_0x5ff347,_0x31f8f6){_0x5ff347=_0x5ff347-0x0;var _0xe7981c=_0xe42c[_0x5ff347];return _0xe7981c;};'use strict';var _=require(_0xce42('0x0'));var util=require(_0xce42('0x1'));var moment=require(_0xce42('0x2'));var BPromise=require(_0xce42('0x3'));var rs=require(_0xce42('0x4'));var fs=require('fs');var Redis=require(_0xce42('0x5'));var db=require(_0xce42('0x6'))['db'];var utils=require(_0xce42('0x7'));var logger=require(_0xce42('0x8'))('rpc');var config=require(_0xce42('0x9'));var jayson=require(_0xce42('0xa'));var client=jayson[_0xce42('0xb')][_0xce42('0xc')]({'port':0x232a});config[_0xce42('0xd')]=_[_0xce42('0xe')](config[_0xce42('0xd')],{'host':_0xce42('0xf'),'port':0x18eb});var socket=require(_0xce42('0x10'))(new Redis(config[_0xce42('0xd')]));require(_0xce42('0x11'))[_0xce42('0x12')](socket);function respondWithRpcPromise(_0x237fbb,_0x987215,_0x1dacc9){return new BPromise(function(_0x41d2e1,_0x4eeae7){return client[_0xce42('0x13')](_0x237fbb,_0x1dacc9)['then'](function(_0x20395b){logger['info'](_0xce42('0x14'),_0x987215,_0xce42('0x15'));logger['debug'](_0xce42('0x16'),_0x987215,_0xce42('0x15'),JSON['stringify'](_0x20395b));if(_0x20395b[_0xce42('0x17')]){if(_0x20395b[_0xce42('0x17')][_0xce42('0x18')]===0x1f4){logger[_0xce42('0x17')](_0xce42('0x14'),_0x987215,_0x20395b['error'][_0xce42('0x19')]);return _0x4eeae7(_0x20395b[_0xce42('0x17')]['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x987215,_0x20395b[_0xce42('0x17')]['message']);return _0x41d2e1(_0x20395b[_0xce42('0x17')][_0xce42('0x19')]);}else{logger['info'](_0xce42('0x14'),_0x987215,_0xce42('0x15'));_0x41d2e1(_0x20395b[_0xce42('0x1a')][_0xce42('0x19')]);}})[_0xce42('0x1b')](function(_0x211c6e){logger[_0xce42('0x17')](_0xce42('0x14'),_0x987215,_0x211c6e);_0x4eeae7(_0x211c6e);});});}exports[_0xce42('0x1c')]=function(_0x1c3815){var _0x2184c5=this;return new Promise(function(_0x33be88,_0xecf25c){return db['MailQueue']['findAll']({'raw':_0x1c3815[_0xce42('0x1d')]?_0x1c3815[_0xce42('0x1d')][_0xce42('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c3815[_0xce42('0x1d')]?_0x1c3815[_0xce42('0x1d')][_0xce42('0x1f')]||null:null,'attributes':_0x1c3815[_0xce42('0x1d')]?_0x1c3815[_0xce42('0x1d')][_0xce42('0x20')]||null:null,'limit':_0x1c3815[_0xce42('0x1d')]?_0x1c3815[_0xce42('0x1d')]['limit']||null:null,'include':_0x1c3815[_0xce42('0x1d')]?_0x1c3815[_0xce42('0x1d')][_0xce42('0x21')]?_['map'](_0x1c3815[_0xce42('0x1d')][_0xce42('0x21')],function(_0x9784a8){return{'model':db[_0x9784a8['model']],'as':_0x9784a8['as'],'attributes':_0x9784a8[_0xce42('0x20')],'include':_0x9784a8['include']?_[_0xce42('0x22')](_0x9784a8['include'],function(_0x4bf5b7){return{'model':db[_0x4bf5b7['model']],'as':_0x4bf5b7['as'],'attributes':_0x4bf5b7[_0xce42('0x20')],'include':_0x4bf5b7[_0xce42('0x21')]?_['map'](_0x4bf5b7[_0xce42('0x21')],function(_0x98f883){return{'model':db[_0x98f883[_0xce42('0x23')]],'as':_0x98f883['as'],'attributes':_0x98f883[_0xce42('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce42('0x24')](function(_0x59f6ea){logger[_0xce42('0x25')](_0xce42('0x1c'),_0x1c3815);logger[_0xce42('0x26')](_0xce42('0x1c'),_0x1c3815,JSON[_0xce42('0x27')](_0x59f6ea));_0x33be88(_0x59f6ea);})[_0xce42('0x1b')](function(_0x1f8287){logger[_0xce42('0x17')](_0xce42('0x1c'),_0x1f8287[_0xce42('0x19')],_0x1c3815);_0xecf25c(_0x2184c5[_0xce42('0x17')](0x1f4,_0x1f8287['message']));});});};exports[_0xce42('0x28')]=function(_0x405a3e){var _0x34bce4=this;return new Promise(function(_0x38f673,_0x9e31cb){return db['MailQueue']['find']({'raw':_0x405a3e['options']?_0x405a3e[_0xce42('0x1d')][_0xce42('0x1e')]===undefined?!![]:![]:!![],'where':_0x405a3e[_0xce42('0x1d')]?_0x405a3e[_0xce42('0x1d')][_0xce42('0x1f')]||null:null,'attributes':_0x405a3e['options']?_0x405a3e[_0xce42('0x1d')]['attributes']||null:null,'include':_0x405a3e[_0xce42('0x1d')]?_0x405a3e[_0xce42('0x1d')][_0xce42('0x21')]?_[_0xce42('0x22')](_0x405a3e[_0xce42('0x1d')][_0xce42('0x21')],function(_0x395746){return{'model':db[_0x395746[_0xce42('0x23')]],'as':_0x395746['as'],'attributes':_0x395746['attributes'],'include':_0x395746[_0xce42('0x21')]?_[_0xce42('0x22')](_0x395746['include'],function(_0x598fa1){return{'model':db[_0x598fa1['model']],'as':_0x598fa1['as'],'attributes':_0x598fa1[_0xce42('0x20')],'include':_0x598fa1[_0xce42('0x21')]?_[_0xce42('0x22')](_0x598fa1[_0xce42('0x21')],function(_0x456ce2){return{'model':db[_0x456ce2[_0xce42('0x23')]],'as':_0x456ce2['as'],'attributes':_0x456ce2[_0xce42('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x105b60){logger['info'](_0xce42('0x28'),_0x405a3e);logger[_0xce42('0x26')](_0xce42('0x28'),_0x405a3e,JSON[_0xce42('0x27')](_0x105b60));_0x38f673(_0x105b60);})['catch'](function(_0x427949){logger[_0xce42('0x17')](_0xce42('0x28'),_0x427949[_0xce42('0x19')],_0x405a3e);_0x9e31cb(_0x34bce4[_0xce42('0x17')](0x1f4,_0x427949['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5e8d914..844dfc6 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 _0xa1ab=['length','remove','register'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xa1ab,0x1ae));var _0xba1a=function(_0x367e46,_0x2fae7a){_0x367e46=_0x367e46-0x0;var _0x2d3547=_0xa1ab[_0x367e46];return _0x2d3547;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xba1a('0x0'),'update'];function createListener(_0x417701,_0x2d7154){return function(_0x224d7d){_0x2d7154['emit'](_0x417701,_0x224d7d);};}function removeListener(_0x3614c9,_0x4243bc){return function(){MailQueueEvents['removeListener'](_0x3614c9,_0x4243bc);};}exports[_0xba1a('0x1')]=function(_0x5fd38a){for(var _0x25ea16=0x0,_0x1d7d86=events[_0xba1a('0x2')];_0x25ea16<_0x1d7d86;_0x25ea16++){var _0x234ccf=events[_0x25ea16];var _0x42dd63=createListener('mailQueue:'+_0x234ccf,_0x5fd38a);MailQueueEvents['on'](_0x234ccf,_0x42dd63);}}; \ No newline at end of file +var _0xbae8=['update','emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x40d8fc,_0x7f3dd7){var _0x55971c=function(_0x1f5dcb){while(--_0x1f5dcb){_0x40d8fc['push'](_0x40d8fc['shift']());}};_0x55971c(++_0x7f3dd7);}(_0xbae8,0x195));var _0x8bae=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0xbae8[_0x3a16d4];return _0x31ea9c;};'use strict';var MailQueueEvents=require(_0x8bae('0x0'));var events=[_0x8bae('0x1'),_0x8bae('0x2'),_0x8bae('0x3')];function createListener(_0x506903,_0x3fc5a6){return function(_0x264119){_0x3fc5a6[_0x8bae('0x4')](_0x506903,_0x264119);};}function removeListener(_0x62e400,_0x1eabde){return function(){MailQueueEvents[_0x8bae('0x5')](_0x62e400,_0x1eabde);};}exports[_0x8bae('0x6')]=function(_0x55c816){for(var _0x4d13fa=0x0,_0x2e9507=events[_0x8bae('0x7')];_0x4d13fa<_0x2e9507;_0x4d13fa++){var _0x1770f5=events[_0x4d13fa];var _0x5eac90=createListener('mailQueue:'+_0x1770f5,_0x55c816);MailQueueEvents['on'](_0x1770f5,_0x5eac90);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bf61666..b18eb72 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 _0x21fc=['create','put','update','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x1c2aeb,_0x48433c){var _0x783379=function(_0x3e8820){while(--_0x3e8820){_0x1c2aeb['push'](_0x1c2aeb['shift']());}};_0x783379(++_0x48433c);}(_0x21fc,0x1b4));var _0xc21f=function(_0x110bb7,_0x56c479){_0x110bb7=_0x110bb7-0x0;var _0x1e6ac2=_0x21fc[_0x110bb7];return _0x1e6ac2;};'use strict';var multer=require('multer');var util=require(_0xc21f('0x0'));var path=require('path');var timeout=require(_0xc21f('0x1'));var express=require('express');var router=express[_0xc21f('0x2')]();var fs_extra=require(_0xc21f('0x3'));var auth=require(_0xc21f('0x4'));var interaction=require(_0xc21f('0x5'));var config=require(_0xc21f('0x6'));var controller=require('./mailQueueReport.controller');router[_0xc21f('0x7')]('/',auth[_0xc21f('0x8')](),controller[_0xc21f('0x9')]);router[_0xc21f('0x7')](_0xc21f('0xa'),auth[_0xc21f('0x8')](),controller['describe']);router[_0xc21f('0x7')](_0xc21f('0xb'),auth[_0xc21f('0x8')](),controller[_0xc21f('0xc')]);router[_0xc21f('0xd')]('/',auth[_0xc21f('0x8')](),controller[_0xc21f('0xe')]);router[_0xc21f('0xf')]('/:id',auth[_0xc21f('0x8')](),controller[_0xc21f('0x10')]);router[_0xc21f('0x11')](_0xc21f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8a32=['isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x4f8f63,_0x1f5ab3){var _0x4633b9=function(_0x4f1b8c){while(--_0x4f1b8c){_0x4f8f63['push'](_0x4f8f63['shift']());}};_0x4633b9(++_0x1f5ab3);}(_0x8a32,0x1af));var _0x28a3=function(_0x323148,_0xb8f95d){_0x323148=_0x323148-0x0;var _0x571747=_0x8a32[_0x323148];return _0x571747;};'use strict';var multer=require(_0x28a3('0x0'));var util=require(_0x28a3('0x1'));var path=require(_0x28a3('0x2'));var timeout=require(_0x28a3('0x3'));var express=require(_0x28a3('0x4'));var router=express['Router']();var fs_extra=require(_0x28a3('0x5'));var auth=require(_0x28a3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x28a3('0x7'));var controller=require(_0x28a3('0x8'));router[_0x28a3('0x9')]('/',auth[_0x28a3('0xa')](),controller['index']);router['get'](_0x28a3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x28a3('0x9')]('/:id',auth[_0x28a3('0xa')](),controller[_0x28a3('0xc')]);router[_0x28a3('0xd')]('/',auth['isAuthenticated'](),controller[_0x28a3('0xe')]);router[_0x28a3('0xf')](_0x28a3('0x10'),auth[_0x28a3('0xa')](),controller[_0x28a3('0x11')]);router[_0x28a3('0x12')](_0x28a3('0x10'),auth[_0x28a3('0xa')](),controller[_0x28a3('0x13')]);module[_0x28a3('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b05b0b7..b1252e8 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 _0x5ef9=['DATE','moment','sequelize','STRING'];(function(_0x4c684e,_0x2034a7){var _0x1ddd29=function(_0x3fb7d6){while(--_0x3fb7d6){_0x4c684e['push'](_0x4c684e['shift']());}};_0x1ddd29(++_0x2034a7);}(_0x5ef9,0x1b1));var _0x95ef=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x5ef9[_0x4ed4d2];return _0x15ae2e;};'use strict';var moment=require(_0x95ef('0x0'));var Sequelize=require(_0x95ef('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x95ef('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x95ef('0x2')]},'joinAt':{'type':Sequelize[_0x95ef('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x95ef('0x3')]},'exitAt':{'type':Sequelize[_0x95ef('0x3')]},'reason':{'type':Sequelize[_0x95ef('0x2')]}}; \ No newline at end of file +var _0x6bb0=['moment','DATE','STRING'];(function(_0x2a187,_0x2fcfe7){var _0xd0786d=function(_0x39cd74){while(--_0x39cd74){_0x2a187['push'](_0x2a187['shift']());}};_0xd0786d(++_0x2fcfe7);}(_0x6bb0,0x6f));var _0x06bb=function(_0x42693d,_0x434c1c){_0x42693d=_0x42693d-0x0;var _0x57f95f=_0x6bb0[_0x42693d];return _0x57f95f;};'use strict';var moment=require(_0x06bb('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x06bb('0x1')]},'leaveAt':{'type':Sequelize[_0x06bb('0x1')]},'acceptAt':{'type':Sequelize[_0x06bb('0x1')]},'exitAt':{'type':Sequelize[_0x06bb('0x1')]},'reason':{'type':Sequelize[_0x06bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c6fbf0c..0dbc5e5 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 _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../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','MailQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x542e14,_0x5dfd4b){var _0xe3bbb=function(_0x5c2ac7){while(--_0x5c2ac7){_0x542e14['push'](_0x542e14['shift']());}};_0xe3bbb(++_0x5dfd4b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['MailQueueReport'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['MailQueueReport'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file +var _0x3e24=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','eml-format'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x3e24,0x167));var _0x43e2=function(_0x3297b8,_0x17ce35){_0x3297b8=_0x3297b8-0x0;var _0x2066de=_0x3e24[_0x3297b8];return _0x2066de;};'use strict';var emlformat=require(_0x43e2('0x0'));var rimraf=require(_0x43e2('0x1'));var zipdir=require(_0x43e2('0x2'));var jsonpatch=require(_0x43e2('0x3'));var rp=require(_0x43e2('0x4'));var moment=require('moment');var BPromise=require(_0x43e2('0x5'));var Mustache=require(_0x43e2('0x6'));var util=require('util');var path=require(_0x43e2('0x7'));var sox=require(_0x43e2('0x8'));var csv=require(_0x43e2('0x9'));var ejs=require(_0x43e2('0xa'));var fs=require('fs');var fs_extra=require(_0x43e2('0xb'));var _=require(_0x43e2('0xc'));var squel=require(_0x43e2('0xd'));var crypto=require('crypto');var jsforce=require(_0x43e2('0xe'));var deskjs=require(_0x43e2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x43e2('0x10'));var Papa=require(_0x43e2('0x11'));var Redis=require('ioredis');var authService=require(_0x43e2('0x12'));var qs=require(_0x43e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43e2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x43e2('0x15'));var licenseUtil=require(_0x43e2('0x16'));var db=require(_0x43e2('0x17'))['db'];function respondWithStatusCode(_0x44781a,_0x43ba14){_0x43ba14=_0x43ba14||0xcc;return function(_0x68e82d){if(_0x68e82d){return _0x44781a[_0x43e2('0x18')](_0x43ba14);}return _0x44781a[_0x43e2('0x19')](_0x43ba14)[_0x43e2('0x1a')]();};}function respondWithResult(_0x218ae7,_0x377097){_0x377097=_0x377097||0xc8;return function(_0x3ccccd){if(_0x3ccccd){return _0x218ae7['status'](_0x377097)[_0x43e2('0x1b')](_0x3ccccd);}};}function respondWithFilteredResult(_0x40fb7b,_0xb929b5){return function(_0x2a0fb0){if(_0x2a0fb0){var _0x5cea01=typeof _0xb929b5['offset']===_0x43e2('0x1c')&&typeof _0xb929b5[_0x43e2('0x1d')]===_0x43e2('0x1c');var _0x3a27eb=_0x2a0fb0[_0x43e2('0x1e')];var _0x1b7cde=_0x5cea01?0x0:_0xb929b5[_0x43e2('0x1f')];var _0x15ecb5=_0x5cea01?_0x2a0fb0[_0x43e2('0x1e')]:_0xb929b5[_0x43e2('0x1f')]+_0xb929b5['limit'];var _0x3ee34c;if(_0x15ecb5>=_0x3a27eb){_0x15ecb5=_0x3a27eb;_0x3ee34c=0xc8;}else{_0x3ee34c=0xce;}_0x40fb7b[_0x43e2('0x19')](_0x3ee34c);return _0x40fb7b['set'](_0x43e2('0x20'),_0x1b7cde+'-'+_0x15ecb5+'/'+_0x3a27eb)['json'](_0x2a0fb0);}return null;};}function patchUpdates(_0x3bc2ce){return function(_0x13610f){try{jsonpatch[_0x43e2('0x21')](_0x13610f,_0x3bc2ce,!![]);}catch(_0x23825c){return BPromise[_0x43e2('0x22')](_0x23825c);}return _0x13610f['save']();};}function saveUpdates(_0x3b0357,_0x12d842){return function(_0x272934){if(_0x272934){return _0x272934['update'](_0x3b0357)[_0x43e2('0x23')](function(_0x32f048){return _0x32f048;});}return null;};}function removeEntity(_0x43078f,_0x11b285){return function(_0x4f20e6){if(_0x4f20e6){return _0x4f20e6[_0x43e2('0x24')]()[_0x43e2('0x23')](function(){_0x43078f[_0x43e2('0x19')](0xcc)[_0x43e2('0x1a')]();});}};}function handleEntityNotFound(_0x178223,_0x2a593e){return function(_0x3ca16b){if(!_0x3ca16b){_0x178223[_0x43e2('0x18')](0x194);}return _0x3ca16b;};}function handleError(_0xd29b7b,_0x1ec68e){_0x1ec68e=_0x1ec68e||0x1f4;return function(_0x1ea844){logger[_0x43e2('0x25')](_0x1ea844['stack']);if(_0x1ea844[_0x43e2('0x26')]){delete _0x1ea844[_0x43e2('0x26')];}_0xd29b7b['status'](_0x1ec68e)[_0x43e2('0x27')](_0x1ea844);};}exports[_0x43e2('0x28')]=function(_0x2dffa2,_0x404483){var _0x3fd232={},_0x5a896b={},_0x42f495={'count':0x0,'rows':[]};var _0xd1b43a=_[_0x43e2('0x29')](db[_0x43e2('0x2a')][_0x43e2('0x2b')],function(_0x30bdcb){return{'name':_0x30bdcb['fieldName'],'type':_0x30bdcb['type'][_0x43e2('0x2c')]};});_0x5a896b[_0x43e2('0x2d')]=_[_0x43e2('0x29')](_0xd1b43a,_0x43e2('0x26'));_0x5a896b[_0x43e2('0x2e')]=_['keys'](_0x2dffa2[_0x43e2('0x2e')]);_0x5a896b[_0x43e2('0x2f')]=_[_0x43e2('0x30')](_0x5a896b[_0x43e2('0x2d')],_0x5a896b[_0x43e2('0x2e')]);_0x3fd232[_0x43e2('0x31')]=_[_0x43e2('0x30')](_0x5a896b['model'],qs['fields'](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x32')]));_0x3fd232['attributes']=_0x3fd232[_0x43e2('0x31')][_0x43e2('0x33')]?_0x3fd232['attributes']:_0x5a896b[_0x43e2('0x2d')];if(!_0x2dffa2['query']['hasOwnProperty']('nolimit')){_0x3fd232[_0x43e2('0x1d')]=qs['limit'](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x1d')]);_0x3fd232[_0x43e2('0x1f')]=qs[_0x43e2('0x1f')](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x1f')]);}_0x3fd232[_0x43e2('0x34')]=qs[_0x43e2('0x35')](_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x35')]);_0x3fd232[_0x43e2('0x36')]=qs[_0x43e2('0x2f')](_[_0x43e2('0x37')](_0x2dffa2[_0x43e2('0x2e')],_0x5a896b[_0x43e2('0x2f')]),_0xd1b43a);if(_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x38')]){_0x3fd232['where']=_['merge'](_0x3fd232['where'],{'$or':_[_0x43e2('0x29')](_0xd1b43a,function(_0x13af7f){if(_0x13af7f['type']!=='VIRTUAL'){var _0x2b5fce={};_0x2b5fce[_0x13af7f[_0x43e2('0x26')]]={'$like':'%'+_0x2dffa2[_0x43e2('0x2e')][_0x43e2('0x38')]+'%'};return _0x2b5fce;}})});}_0x3fd232=_[_0x43e2('0x39')]({},_0x3fd232,_0x2dffa2[_0x43e2('0x3a')]);var _0x2afcdd={'where':_0x3fd232[_0x43e2('0x36')]};return db[_0x43e2('0x2a')][_0x43e2('0x1e')](_0x2afcdd)[_0x43e2('0x23')](function(_0x257de9){_0x42f495[_0x43e2('0x1e')]=_0x257de9;if(_0x2dffa2[_0x43e2('0x2e')]['includeAll']){_0x3fd232[_0x43e2('0x3b')]=[{'all':!![]}];}return db['MailQueueReport'][_0x43e2('0x3c')](_0x3fd232);})['then'](function(_0x19ce1b){_0x42f495[_0x43e2('0x3d')]=_0x19ce1b;return _0x42f495;})[_0x43e2('0x23')](respondWithFilteredResult(_0x404483,_0x3fd232))['catch'](handleError(_0x404483,null));};exports[_0x43e2('0x3e')]=function(_0x5ca5d0,_0x1ba4cf){var _0x36f94a={'raw':!![],'where':{'id':_0x5ca5d0[_0x43e2('0x3f')]['id']}},_0x34f2b5={};_0x34f2b5['model']=_['keys'](db[_0x43e2('0x2a')][_0x43e2('0x2b')]);_0x34f2b5[_0x43e2('0x2e')]=_[_0x43e2('0x40')](_0x5ca5d0['query']);_0x34f2b5[_0x43e2('0x2f')]=_[_0x43e2('0x30')](_0x34f2b5[_0x43e2('0x2d')],_0x34f2b5[_0x43e2('0x2e')]);_0x36f94a[_0x43e2('0x31')]=_['intersection'](_0x34f2b5[_0x43e2('0x2d')],qs['fields'](_0x5ca5d0[_0x43e2('0x2e')][_0x43e2('0x32')]));_0x36f94a['attributes']=_0x36f94a[_0x43e2('0x31')]['length']?_0x36f94a['attributes']:_0x34f2b5[_0x43e2('0x2d')];if(_0x5ca5d0[_0x43e2('0x2e')][_0x43e2('0x41')]){_0x36f94a[_0x43e2('0x3b')]=[{'all':!![]}];}_0x36f94a=_[_0x43e2('0x39')]({},_0x36f94a,_0x5ca5d0['options']);return db[_0x43e2('0x2a')][_0x43e2('0x42')](_0x36f94a)[_0x43e2('0x23')](handleEntityNotFound(_0x1ba4cf,null))[_0x43e2('0x23')](respondWithResult(_0x1ba4cf,null))[_0x43e2('0x43')](handleError(_0x1ba4cf,null));};exports[_0x43e2('0x44')]=function(_0x29a9ef,_0x2462db){return db['MailQueueReport'][_0x43e2('0x44')](_0x29a9ef[_0x43e2('0x45')],{})['then'](respondWithResult(_0x2462db,0xc9))[_0x43e2('0x43')](handleError(_0x2462db,null));};exports[_0x43e2('0x46')]=function(_0x466f65,_0x8bc721){if(_0x466f65['body']['id']){delete _0x466f65[_0x43e2('0x45')]['id'];}return db[_0x43e2('0x2a')][_0x43e2('0x42')]({'where':{'id':_0x466f65[_0x43e2('0x3f')]['id']}})[_0x43e2('0x23')](handleEntityNotFound(_0x8bc721,null))['then'](saveUpdates(_0x466f65['body'],null))[_0x43e2('0x23')](respondWithResult(_0x8bc721,null))[_0x43e2('0x43')](handleError(_0x8bc721,null));};exports['destroy']=function(_0x2a40a5,_0x28a101){return db[_0x43e2('0x2a')]['find']({'where':{'id':_0x2a40a5['params']['id']}})[_0x43e2('0x23')](handleEntityNotFound(_0x28a101,null))[_0x43e2('0x23')](removeEntity(_0x28a101,null))[_0x43e2('0x43')](handleError(_0x28a101,null));};exports[_0x43e2('0x47')]=function(_0x1a9283,_0x278730){return db[_0x43e2('0x2a')][_0x43e2('0x47')]()[_0x43e2('0x23')](respondWithResult(_0x278730,null))['catch'](handleError(_0x278730,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c7783c9..dc254b2 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 _0xf1d6=['../../config/logger','api','moment','request-promise','path','rimraf','define','MailQueueReport','report_mail_queue','lodash','util'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xf1d6,0x195));var _0x6f1d=function(_0x3d905f,_0x349ee9){_0x3d905f=_0x3d905f-0x0;var _0x879c82=_0xf1d6[_0x3d905f];return _0x879c82;};'use strict';var _=require(_0x6f1d('0x0'));var util=require(_0x6f1d('0x1'));var logger=require(_0x6f1d('0x2'))(_0x6f1d('0x3'));var moment=require(_0x6f1d('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f1d('0x5'));var fs=require('fs');var path=require(_0x6f1d('0x6'));var rimraf=require(_0x6f1d('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x309bb7,_0x3c52ec){return _0x309bb7[_0x6f1d('0x8')](_0x6f1d('0x9'),attributes,{'tableName':_0x6f1d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9541=['api','moment','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x3ed091,_0x3491d4){var _0x49f07c=function(_0x296cbc){while(--_0x296cbc){_0x3ed091['push'](_0x3ed091['shift']());}};_0x49f07c(++_0x3491d4);}(_0x9541,0xb3));var _0x1954=function(_0xd022c3,_0x4c3474){_0xd022c3=_0xd022c3-0x0;var _0x3bc007=_0x9541[_0xd022c3];return _0x3bc007;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var logger=require(_0x1954('0x2'))(_0x1954('0x3'));var moment=require(_0x1954('0x4'));var BPromise=require(_0x1954('0x5'));var rp=require(_0x1954('0x6'));var fs=require('fs');var path=require(_0x1954('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1954('0x8'));module[_0x1954('0x9')]=function(_0x563a5e,_0x377e71){return _0x563a5e[_0x1954('0xa')](_0x1954('0xb'),attributes,{'tableName':_0x1954('0xc'),'paranoid':![],'indexes':[{'name':_0x1954('0xd'),'fields':[_0x1954('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 08b5b46..98bd69a 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e6a18,_0x18c1f8){var _0xa02f5e=function(_0x3a1731){while(--_0x3a1731){_0x2e6a18['push'](_0x2e6a18['shift']());}};_0xa02f5e(++_0x18c1f8);}(_0x326f,0xd1));var _0xf326=function(_0x525211,_0x178cd3){_0x525211=_0x525211-0x0;var _0x10d14e=_0x326f[_0x525211];return _0x10d14e;};'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')]('MailQueueReport,\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')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2f6c38,_0x4b067a){var _0x66279f=function(_0x13c4b5){while(--_0x13c4b5){_0x2f6c38['push'](_0x2f6c38['shift']());}};_0x66279f(++_0x4b067a);}(_0xdb28,0x106));var _0x8db2=function(_0x37ecf2,_0x4411e5){_0x37ecf2=_0x37ecf2-0x0;var _0x4de227=_0xdb28[_0x37ecf2];return _0x4de227;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 9678326..de7acb1 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(_0x5ab8c2,_0x4dcd76){var _0x50ed03=function(_0x7e8a5d){while(--_0x7e8a5d){_0x5ab8c2['push'](_0x5ab8c2['shift']());}};_0x50ed03(++_0x4dcd76);}(_0x70e0,0x17b));var _0x070e=function(_0xefc89c,_0x381f7a){_0xefc89c=_0xefc89c-0x0;var _0x377604=_0x70e0[_0xefc89c];return _0x377604;};'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(_0x184b64,_0x204619){var _0x506e0e=function(_0x807a45){while(--_0x807a45){_0x184b64['push'](_0x184b64['shift']());}};_0x506e0e(++_0x204619);}(_0xe706,0xa3));var _0x6e70=function(_0x59ec7a,_0x1eb345){_0x59ec7a=_0x59ec7a-0x0;var _0x8535ed=_0xe706[_0x59ec7a];return _0x8535ed;};'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 6655179..f66d738 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 _0xb0e0=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3c61cf,_0x16fdb8){var _0x11634c=function(_0x8153f){while(--_0x8153f){_0x3c61cf['push'](_0x3c61cf['shift']());}};_0x11634c(++_0x16fdb8);}(_0xb0e0,0x72));var _0x0b0e=function(_0x1c831d,_0x214bce){_0x1c831d=_0x1c831d-0x0;var _0x2a2d4c=_0xb0e0[_0x1c831d];return _0x2a2d4c;};'use strict';var Sequelize=require('sequelize');module[_0x0b0e('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0b0e('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x0b0e('0x1')]},'password':{'type':Sequelize[_0x0b0e('0x1')]},'port':{'type':Sequelize[_0x0b0e('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x0b0e('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0b0e('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0b0e('0x1')]},'modernAuthentication':{'type':Sequelize[_0x0b0e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xee30=['sequelize','STRING','INBOX','INTEGER'];(function(_0x1ef999,_0x3f5475){var _0x2cf7c3=function(_0xdba408){while(--_0xdba408){_0x1ef999['push'](_0x1ef999['shift']());}};_0x2cf7c3(++_0x3f5475);}(_0xee30,0x120));var _0x0ee3=function(_0x66f2ff,_0x2c4ae8){_0x66f2ff=_0x66f2ff-0x0;var _0x4c10d3=_0xee30[_0x66f2ff];return _0x4c10d3;};'use strict';var Sequelize=require(_0x0ee3('0x0'));module['exports']={'description':{'type':Sequelize[_0x0ee3('0x1')]},'host':{'type':Sequelize[_0x0ee3('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x0ee3('0x1')]},'password':{'type':Sequelize[_0x0ee3('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0ee3('0x1')],'defaultValue':_0x0ee3('0x2')},'connTimeout':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0ee3('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 649850c..ae46e73 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 _0xc6b4=['api','moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc6b4,0x183));var _0x4c6b=function(_0x5864ef,_0x496812){_0x5864ef=_0x5864ef-0x0;var _0x21c244=_0xc6b4[_0x5864ef];return _0x21c244;};'use strict';var _=require(_0x4c6b('0x0'));var util=require(_0x4c6b('0x1'));var logger=require(_0x4c6b('0x2'))(_0x4c6b('0x3'));var moment=require(_0x4c6b('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c6b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c6b('0x6'));var config=require(_0x4c6b('0x7'));var attributes=require(_0x4c6b('0x8'));module[_0x4c6b('0x9')]=function(_0x290284,_0x39f45e){return _0x290284[_0x4c6b('0xa')](_0x4c6b('0xb'),attributes,{'tableName':_0x4c6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8c=['moment','request-promise','path','../../config/environment','./mailServerIn.attributes','define','MailServerIn','lodash','util','api'];(function(_0x4d7399,_0x2625c4){var _0x1c7a95=function(_0x4948a6){while(--_0x4948a6){_0x4d7399['push'](_0x4d7399['shift']());}};_0x1c7a95(++_0x2625c4);}(_0xcd8c,0x1bf));var _0xccd8=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0xcd8c[_0x99facc];return _0xd39ed0;};'use strict';var _=require(_0xccd8('0x0'));var util=require(_0xccd8('0x1'));var logger=require('../../config/logger')(_0xccd8('0x2'));var moment=require(_0xccd8('0x3'));var BPromise=require('bluebird');var rp=require(_0xccd8('0x4'));var fs=require('fs');var path=require(_0xccd8('0x5'));var rimraf=require('rimraf');var config=require(_0xccd8('0x6'));var attributes=require(_0xccd8('0x7'));module['exports']=function(_0x335177,_0x1d7d84){return _0x335177[_0xccd8('0x8')](_0xccd8('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4fa7409..88fad17 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 _0x85c8=['MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','map','model','include','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug'];(function(_0xe6a598,_0xc5868a){var _0x33cbe3=function(_0x5724d7){while(--_0x5724d7){_0xe6a598['push'](_0xe6a598['shift']());}};_0x33cbe3(++_0xc5868a);}(_0x85c8,0x1e0));var _0x885c=function(_0x32da6e,_0x6c6ce3){_0x32da6e=_0x32da6e-0x0;var _0xa5d475=_0x85c8[_0x32da6e];return _0xa5d475;};'use strict';var _=require(_0x885c('0x0'));var util=require(_0x885c('0x1'));var moment=require(_0x885c('0x2'));var BPromise=require(_0x885c('0x3'));var rs=require(_0x885c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x885c('0x5'))['db'];var utils=require(_0x885c('0x6'));var logger=require('../../config/logger')(_0x885c('0x7'));var config=require(_0x885c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x885c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4194bb,_0x3cf840,_0x3dd98f){return new BPromise(function(_0x2a2647,_0x397304){return client[_0x885c('0xa')](_0x4194bb,_0x3dd98f)[_0x885c('0xb')](function(_0x5b3b37){logger[_0x885c('0xc')](_0x885c('0xd'),_0x3cf840,'request\x20sent');logger[_0x885c('0xe')](_0x885c('0xf'),_0x3cf840,_0x885c('0x10'),JSON[_0x885c('0x11')](_0x5b3b37));if(_0x5b3b37['error']){if(_0x5b3b37[_0x885c('0x12')][_0x885c('0x13')]===0x1f4){logger['error'](_0x885c('0xd'),_0x3cf840,_0x5b3b37[_0x885c('0x12')][_0x885c('0x14')]);return _0x397304(_0x5b3b37[_0x885c('0x12')][_0x885c('0x14')]);}logger['error'](_0x885c('0xd'),_0x3cf840,_0x5b3b37['error']['message']);return _0x2a2647(_0x5b3b37['error'][_0x885c('0x14')]);}else{logger['info'](_0x885c('0xd'),_0x3cf840,'request\x20sent');_0x2a2647(_0x5b3b37[_0x885c('0x15')][_0x885c('0x14')]);}})[_0x885c('0x16')](function(_0x43033d){logger['error'](_0x885c('0xd'),_0x3cf840,_0x43033d);_0x397304(_0x43033d);});});}exports[_0x885c('0x17')]=function(_0xa59cf9){var _0x34e39c=this;return new Promise(function(_0x572cb1,_0x28b2dc){return db[_0x885c('0x18')][_0x885c('0x19')]({'raw':_0xa59cf9[_0x885c('0x1a')]?_0xa59cf9['options'][_0x885c('0x1b')]===undefined?!![]:![]:!![],'where':_0xa59cf9[_0x885c('0x1a')]?_0xa59cf9['options']['where']||null:null,'attributes':_0xa59cf9[_0x885c('0x1a')]?_0xa59cf9[_0x885c('0x1a')][_0x885c('0x1c')]||null:null,'limit':_0xa59cf9['options']?_0xa59cf9[_0x885c('0x1a')][_0x885c('0x1d')]||null:null,'include':_0xa59cf9['options']?_0xa59cf9[_0x885c('0x1a')]['include']?_[_0x885c('0x1e')](_0xa59cf9[_0x885c('0x1a')]['include'],function(_0x3b567e){return{'model':db[_0x3b567e[_0x885c('0x1f')]],'as':_0x3b567e['as'],'attributes':_0x3b567e[_0x885c('0x1c')],'include':_0x3b567e['include']?_[_0x885c('0x1e')](_0x3b567e['include'],function(_0x188456){return{'model':db[_0x188456['model']],'as':_0x188456['as'],'attributes':_0x188456[_0x885c('0x1c')],'include':_0x188456[_0x885c('0x20')]?_[_0x885c('0x1e')](_0x188456['include'],function(_0x41c4c1){return{'model':db[_0x41c4c1[_0x885c('0x1f')]],'as':_0x41c4c1['as'],'attributes':_0x41c4c1[_0x885c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x885c('0xb')](function(_0x57255d){logger['info'](_0x885c('0x17'),_0xa59cf9);logger[_0x885c('0xe')]('GetMailServerIn',_0xa59cf9,JSON[_0x885c('0x11')](_0x57255d));_0x572cb1(_0x57255d);})[_0x885c('0x16')](function(_0x1f15ba){logger[_0x885c('0x12')](_0x885c('0x17'),_0x1f15ba[_0x885c('0x14')],_0xa59cf9);_0x28b2dc(_0x34e39c[_0x885c('0x12')](0x1f4,_0x1f15ba[_0x885c('0x14')]));});});}; \ No newline at end of file +var _0xa376=['stringify','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x43d702,_0x5bd05f){var _0x1a14e9=function(_0x403984){while(--_0x403984){_0x43d702['push'](_0x43d702['shift']());}};_0x1a14e9(++_0x5bd05f);}(_0xa376,0x88));var _0x6a37=function(_0x37464b,_0xb835ab){_0x37464b=_0x37464b-0x0;var _0x3d6901=_0xa376[_0x37464b];return _0x3d6901;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a37('0x0'));var BPromise=require('bluebird');var rs=require(_0x6a37('0x1'));var fs=require('fs');var Redis=require(_0x6a37('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a37('0x3'))(_0x6a37('0x4'));var config=require(_0x6a37('0x5'));var jayson=require(_0x6a37('0x6'));var client=jayson[_0x6a37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247887,_0x155f90,_0x3d66c8){return new BPromise(function(_0x1ec441,_0xac3aa2){return client[_0x6a37('0x8')](_0x247887,_0x3d66c8)[_0x6a37('0x9')](function(_0x488b87){logger[_0x6a37('0xa')]('MailServerIn,\x20%s,\x20%s',_0x155f90,'request\x20sent');logger[_0x6a37('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x155f90,'request\x20sent',JSON['stringify'](_0x488b87));if(_0x488b87['error']){if(_0x488b87[_0x6a37('0xc')]['code']===0x1f4){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x488b87[_0x6a37('0xc')][_0x6a37('0xe')]);return _0xac3aa2(_0x488b87[_0x6a37('0xc')]['message']);}logger[_0x6a37('0xc')]('MailServerIn,\x20%s,\x20%s',_0x155f90,_0x488b87[_0x6a37('0xc')]['message']);return _0x1ec441(_0x488b87[_0x6a37('0xc')]['message']);}else{logger[_0x6a37('0xa')](_0x6a37('0xd'),_0x155f90,'request\x20sent');_0x1ec441(_0x488b87[_0x6a37('0xf')][_0x6a37('0xe')]);}})[_0x6a37('0x10')](function(_0x2f8e0a){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x2f8e0a);_0xac3aa2(_0x2f8e0a);});});}exports[_0x6a37('0x11')]=function(_0x6b525a){var _0x3ecd35=this;return new Promise(function(_0x22fc54,_0x4f91df){return db['MailServerIn'][_0x6a37('0x12')]({'raw':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x14')]===undefined?!![]:![]:!![],'where':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')]['where']||null:null,'attributes':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x15')]||null:null,'limit':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x16')]||null:null,'include':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')]['include']?_[_0x6a37('0x17')](_0x6b525a[_0x6a37('0x13')][_0x6a37('0x18')],function(_0x13fc84){return{'model':db[_0x13fc84[_0x6a37('0x19')]],'as':_0x13fc84['as'],'attributes':_0x13fc84[_0x6a37('0x15')],'include':_0x13fc84[_0x6a37('0x18')]?_['map'](_0x13fc84[_0x6a37('0x18')],function(_0xf8d82d){return{'model':db[_0xf8d82d[_0x6a37('0x19')]],'as':_0xf8d82d['as'],'attributes':_0xf8d82d[_0x6a37('0x15')],'include':_0xf8d82d[_0x6a37('0x18')]?_[_0x6a37('0x17')](_0xf8d82d[_0x6a37('0x18')],function(_0x3c25a5){return{'model':db[_0x3c25a5[_0x6a37('0x19')]],'as':_0x3c25a5['as'],'attributes':_0x3c25a5[_0x6a37('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6a37('0x9')](function(_0x1a45dd){logger[_0x6a37('0xa')](_0x6a37('0x11'),_0x6b525a);logger[_0x6a37('0xb')](_0x6a37('0x11'),_0x6b525a,JSON[_0x6a37('0x1a')](_0x1a45dd));_0x22fc54(_0x1a45dd);})[_0x6a37('0x10')](function(_0x2573e5){logger['error']('GetMailServerIn',_0x2573e5[_0x6a37('0xe')],_0x6b525a);_0x4f91df(_0x3ecd35[_0x6a37('0xc')](0x1f4,_0x2573e5[_0x6a37('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ea83db1..79e3c65 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x14fdff,_0x14fb59){_0x14fdff=_0x14fdff-0x0;var _0x5f088b=_0x7a54[_0x14fdff];return _0x5f088b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 6d6dcde..84a89fb 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 _0xb78e=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2c1878,_0x3353fa){_0x2c1878=_0x2c1878-0x0;var _0x116dca=_0xb78e[_0x2c1878];return _0x116dca;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xeb78('0x2')]},'user':{'type':Sequelize[_0xeb78('0x2')]},'pass':{'type':Sequelize[_0xeb78('0x2')]},'port':{'type':Sequelize[_0xeb78('0x3')]},'secure':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xeb78('0x2')]},'authentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe605=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x404b9a,_0xca0480){var _0x30ba61=function(_0x1cdde1){while(--_0x1cdde1){_0x404b9a['push'](_0x404b9a['shift']());}};_0x30ba61(++_0xca0480);}(_0xe605,0x92));var _0x5e60=function(_0x78a009,_0x5772db){_0x78a009=_0x78a009-0x0;var _0x53bcf6=_0xe605[_0x78a009];return _0x53bcf6;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5e60('0x2')]},'user':{'type':Sequelize[_0x5e60('0x2')]},'pass':{'type':Sequelize[_0x5e60('0x2')]},'port':{'type':Sequelize[_0x5e60('0x3')]},'secure':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x5e60('0x2')]},'authentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index eed6dd2..1a16e89 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 _0x2da3=['update','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','findAll','rows','then','catch','show','params','keys','intersection','includeAll','include','options','find','create','body'];(function(_0x405622,_0x1799fd){var _0x460c59=function(_0x6d0244){while(--_0x6d0244){_0x405622['push'](_0x405622['shift']());}};_0x460c59(++_0x1799fd);}(_0x2da3,0x1bd));var _0x32da=function(_0x772bf1,_0x576e68){_0x772bf1=_0x772bf1-0x0;var _0x330cdc=_0x2da3[_0x772bf1];return _0x330cdc;};'use strict';var emlformat=require(_0x32da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32da('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x32da('0x3'));var util=require('util');var path=require(_0x32da('0x4'));var sox=require(_0x32da('0x5'));var csv=require(_0x32da('0x6'));var ejs=require(_0x32da('0x7'));var fs=require('fs');var fs_extra=require(_0x32da('0x8'));var _=require(_0x32da('0x9'));var squel=require(_0x32da('0xa'));var crypto=require('crypto');var jsforce=require(_0x32da('0xb'));var deskjs=require(_0x32da('0xc'));var toCsv=require(_0x32da('0x6'));var querystring=require('querystring');var Papa=require(_0x32da('0xd'));var Redis=require(_0x32da('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x32da('0xf'));var as=require(_0x32da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32da('0x11'))(_0x32da('0x12'));var utils=require(_0x32da('0x13'));var config=require(_0x32da('0x14'));var licenseUtil=require(_0x32da('0x15'));var db=require(_0x32da('0x16'))['db'];function respondWithStatusCode(_0x163050,_0x323fcc){_0x323fcc=_0x323fcc||0xcc;return function(_0x38f9a4){if(_0x38f9a4){return _0x163050[_0x32da('0x17')](_0x323fcc);}return _0x163050[_0x32da('0x18')](_0x323fcc)[_0x32da('0x19')]();};}function respondWithResult(_0x415fb9,_0xfaeadc){_0xfaeadc=_0xfaeadc||0xc8;return function(_0x1e3f80){if(_0x1e3f80){return _0x415fb9[_0x32da('0x18')](_0xfaeadc)[_0x32da('0x1a')](_0x1e3f80);}};}function respondWithFilteredResult(_0x28a833,_0x4fb9a6){return function(_0x1de8c1){if(_0x1de8c1){var _0x5b0840=typeof _0x4fb9a6[_0x32da('0x1b')]===_0x32da('0x1c')&&typeof _0x4fb9a6[_0x32da('0x1d')]===_0x32da('0x1c');var _0x4b9f3f=_0x1de8c1[_0x32da('0x1e')];var _0x3ba97f=_0x5b0840?0x0:_0x4fb9a6[_0x32da('0x1b')];var _0x5899f1=_0x5b0840?_0x1de8c1[_0x32da('0x1e')]:_0x4fb9a6[_0x32da('0x1b')]+_0x4fb9a6[_0x32da('0x1d')];var _0x1d4ac7;if(_0x5899f1>=_0x4b9f3f){_0x5899f1=_0x4b9f3f;_0x1d4ac7=0xc8;}else{_0x1d4ac7=0xce;}_0x28a833[_0x32da('0x18')](_0x1d4ac7);return _0x28a833[_0x32da('0x1f')](_0x32da('0x20'),_0x3ba97f+'-'+_0x5899f1+'/'+_0x4b9f3f)[_0x32da('0x1a')](_0x1de8c1);}return null;};}function patchUpdates(_0x4709e9){return function(_0x58a2ca){try{jsonpatch[_0x32da('0x21')](_0x58a2ca,_0x4709e9,!![]);}catch(_0x5b8a5d){return BPromise[_0x32da('0x22')](_0x5b8a5d);}return _0x58a2ca[_0x32da('0x23')]();};}function saveUpdates(_0x110c1d,_0x26338d){return function(_0x3cfac6){if(_0x3cfac6){return _0x3cfac6['update'](_0x110c1d)['then'](function(_0x49ed2a){return _0x49ed2a;});}return null;};}function removeEntity(_0x42c668,_0x34ff67){return function(_0x5a76a2){if(_0x5a76a2){return _0x5a76a2[_0x32da('0x24')]()['then'](function(){_0x42c668[_0x32da('0x18')](0xcc)[_0x32da('0x19')]();});}};}function handleEntityNotFound(_0x5bfafa,_0x1e1dda){return function(_0x1b366c){if(!_0x1b366c){_0x5bfafa[_0x32da('0x17')](0x194);}return _0x1b366c;};}function handleError(_0x330513,_0x2072fd){_0x2072fd=_0x2072fd||0x1f4;return function(_0x3470dc){logger['error'](_0x3470dc[_0x32da('0x25')]);if(_0x3470dc[_0x32da('0x26')]){delete _0x3470dc[_0x32da('0x26')];}_0x330513[_0x32da('0x18')](_0x2072fd)[_0x32da('0x27')](_0x3470dc);};}exports['index']=function(_0xe988fe,_0x2455de){var _0x43be61={},_0x254693={},_0x21535a={'count':0x0,'rows':[]};var _0x237476=_[_0x32da('0x28')](db[_0x32da('0x29')][_0x32da('0x2a')],function(_0x402696){return{'name':_0x402696[_0x32da('0x2b')],'type':_0x402696[_0x32da('0x2c')][_0x32da('0x2d')]};});_0x254693['model']=_[_0x32da('0x28')](_0x237476,_0x32da('0x26'));_0x254693[_0x32da('0x2e')]=_['keys'](_0xe988fe[_0x32da('0x2e')]);_0x254693[_0x32da('0x2f')]=_['intersection'](_0x254693[_0x32da('0x30')],_0x254693[_0x32da('0x2e')]);_0x43be61[_0x32da('0x31')]=_['intersection'](_0x254693[_0x32da('0x30')],qs[_0x32da('0x32')](_0xe988fe[_0x32da('0x2e')][_0x32da('0x32')]));_0x43be61['attributes']=_0x43be61[_0x32da('0x31')][_0x32da('0x33')]?_0x43be61[_0x32da('0x31')]:_0x254693['model'];if(!_0xe988fe[_0x32da('0x2e')]['hasOwnProperty'](_0x32da('0x34'))){_0x43be61[_0x32da('0x1d')]=qs[_0x32da('0x1d')](_0xe988fe['query']['limit']);_0x43be61[_0x32da('0x1b')]=qs[_0x32da('0x1b')](_0xe988fe['query'][_0x32da('0x1b')]);}_0x43be61[_0x32da('0x35')]=qs['sort'](_0xe988fe['query']['sort']);_0x43be61[_0x32da('0x36')]=qs['filters'](_[_0x32da('0x37')](_0xe988fe[_0x32da('0x2e')],_0x254693['filters']),_0x237476);if(_0xe988fe[_0x32da('0x2e')][_0x32da('0x38')]){_0x43be61[_0x32da('0x36')]=_['merge'](_0x43be61['where'],{'$or':_[_0x32da('0x28')](_0x237476,function(_0x21d4f2){if(_0x21d4f2['type']!==_0x32da('0x39')){var _0x33e674={};_0x33e674[_0x21d4f2[_0x32da('0x26')]]={'$like':'%'+_0xe988fe[_0x32da('0x2e')][_0x32da('0x38')]+'%'};return _0x33e674;}})});}_0x43be61=_[_0x32da('0x3a')]({},_0x43be61,_0xe988fe['options']);var _0x4ec0a6={'where':_0x43be61[_0x32da('0x36')]};return db['MailServerOut'][_0x32da('0x1e')](_0x4ec0a6)['then'](function(_0xacc03f){_0x21535a[_0x32da('0x1e')]=_0xacc03f;if(_0xe988fe[_0x32da('0x2e')]['includeAll']){_0x43be61['include']=[{'all':!![]}];}return db[_0x32da('0x29')][_0x32da('0x3b')](_0x43be61);})['then'](function(_0x38944b){_0x21535a[_0x32da('0x3c')]=_0x38944b;return _0x21535a;})[_0x32da('0x3d')](respondWithFilteredResult(_0x2455de,_0x43be61))[_0x32da('0x3e')](handleError(_0x2455de,null));};exports[_0x32da('0x3f')]=function(_0x83d7fe,_0x11b5ed){var _0x10b0bb={'raw':!![],'where':{'id':_0x83d7fe[_0x32da('0x40')]['id']}},_0x41b537={};_0x41b537[_0x32da('0x30')]=_[_0x32da('0x41')](db[_0x32da('0x29')]['rawAttributes']);_0x41b537[_0x32da('0x2e')]=_[_0x32da('0x41')](_0x83d7fe[_0x32da('0x2e')]);_0x41b537[_0x32da('0x2f')]=_['intersection'](_0x41b537[_0x32da('0x30')],_0x41b537['query']);_0x10b0bb[_0x32da('0x31')]=_[_0x32da('0x42')](_0x41b537[_0x32da('0x30')],qs[_0x32da('0x32')](_0x83d7fe['query'][_0x32da('0x32')]));_0x10b0bb[_0x32da('0x31')]=_0x10b0bb['attributes'][_0x32da('0x33')]?_0x10b0bb[_0x32da('0x31')]:_0x41b537[_0x32da('0x30')];if(_0x83d7fe[_0x32da('0x2e')][_0x32da('0x43')]){_0x10b0bb[_0x32da('0x44')]=[{'all':!![]}];}_0x10b0bb=_[_0x32da('0x3a')]({},_0x10b0bb,_0x83d7fe[_0x32da('0x45')]);return db[_0x32da('0x29')][_0x32da('0x46')](_0x10b0bb)[_0x32da('0x3d')](handleEntityNotFound(_0x11b5ed,null))[_0x32da('0x3d')](respondWithResult(_0x11b5ed,null))[_0x32da('0x3e')](handleError(_0x11b5ed,null));};exports['create']=function(_0x5154c8,_0x39b7aa){return db[_0x32da('0x29')][_0x32da('0x47')](_0x5154c8[_0x32da('0x48')],{})[_0x32da('0x3d')](respondWithResult(_0x39b7aa,0xc9))[_0x32da('0x3e')](handleError(_0x39b7aa,null));};exports[_0x32da('0x49')]=function(_0x4fb6b3,_0x2a66c4){if(_0x4fb6b3[_0x32da('0x48')]['id']){delete _0x4fb6b3['body']['id'];}return db['MailServerOut'][_0x32da('0x46')]({'where':{'id':_0x4fb6b3['params']['id']}})['then'](handleEntityNotFound(_0x2a66c4,null))[_0x32da('0x3d')](saveUpdates(_0x4fb6b3[_0x32da('0x48')],null))['then'](respondWithResult(_0x2a66c4,null))[_0x32da('0x3e')](handleError(_0x2a66c4,null));};exports[_0x32da('0x24')]=function(_0x1527b7,_0x55568c){return db[_0x32da('0x29')][_0x32da('0x46')]({'where':{'id':_0x1527b7[_0x32da('0x40')]['id']}})[_0x32da('0x3d')](handleEntityNotFound(_0x55568c,null))['then'](removeEntity(_0x55568c,null))[_0x32da('0x3e')](handleError(_0x55568c,null));}; \ No newline at end of file +var _0xb400=['../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','error','stack','name','index','MailServerOut','fieldName','map','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x34886f,_0x5bd88c){var _0xdda123=function(_0x76f740){while(--_0x76f740){_0x34886f['push'](_0x34886f['shift']());}};_0xdda123(++_0x5bd88c);}(_0xb400,0xbe));var _0x0b40=function(_0x559255,_0xd76404){_0x559255=_0x559255-0x0;var _0x1efce4=_0xb400[_0x559255];return _0x1efce4;};'use strict';var emlformat=require(_0x0b40('0x0'));var rimraf=require(_0x0b40('0x1'));var zipdir=require(_0x0b40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b40('0x3'));var moment=require('moment');var BPromise=require(_0x0b40('0x4'));var Mustache=require(_0x0b40('0x5'));var util=require(_0x0b40('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0b40('0x7'));var ejs=require(_0x0b40('0x8'));var fs=require('fs');var fs_extra=require(_0x0b40('0x9'));var _=require(_0x0b40('0xa'));var squel=require(_0x0b40('0xb'));var crypto=require(_0x0b40('0xc'));var jsforce=require(_0x0b40('0xd'));var deskjs=require(_0x0b40('0xe'));var toCsv=require(_0x0b40('0x7'));var querystring=require(_0x0b40('0xf'));var Papa=require(_0x0b40('0x10'));var Redis=require(_0x0b40('0x11'));var authService=require(_0x0b40('0x12'));var qs=require(_0x0b40('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b40('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0b40('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b40('0x16'))['db'];function respondWithStatusCode(_0xd610cf,_0x837a35){_0x837a35=_0x837a35||0xcc;return function(_0x42dc93){if(_0x42dc93){return _0xd610cf[_0x0b40('0x17')](_0x837a35);}return _0xd610cf[_0x0b40('0x18')](_0x837a35)['end']();};}function respondWithResult(_0x200464,_0x3f005e){_0x3f005e=_0x3f005e||0xc8;return function(_0x3f3f54){if(_0x3f3f54){return _0x200464[_0x0b40('0x18')](_0x3f005e)['json'](_0x3f3f54);}};}function respondWithFilteredResult(_0x375831,_0x6e2a74){return function(_0x366456){if(_0x366456){var _0x157164=typeof _0x6e2a74[_0x0b40('0x19')]===_0x0b40('0x1a')&&typeof _0x6e2a74['limit']===_0x0b40('0x1a');var _0x4f97d8=_0x366456[_0x0b40('0x1b')];var _0x7c382d=_0x157164?0x0:_0x6e2a74[_0x0b40('0x19')];var _0x34c219=_0x157164?_0x366456[_0x0b40('0x1b')]:_0x6e2a74[_0x0b40('0x19')]+_0x6e2a74[_0x0b40('0x1c')];var _0x342838;if(_0x34c219>=_0x4f97d8){_0x34c219=_0x4f97d8;_0x342838=0xc8;}else{_0x342838=0xce;}_0x375831[_0x0b40('0x18')](_0x342838);return _0x375831['set'](_0x0b40('0x1d'),_0x7c382d+'-'+_0x34c219+'/'+_0x4f97d8)['json'](_0x366456);}return null;};}function patchUpdates(_0x1cacb1){return function(_0x324e30){try{jsonpatch[_0x0b40('0x1e')](_0x324e30,_0x1cacb1,!![]);}catch(_0x521d74){return BPromise['reject'](_0x521d74);}return _0x324e30[_0x0b40('0x1f')]();};}function saveUpdates(_0x36c324,_0x430a9c){return function(_0x11052a){if(_0x11052a){return _0x11052a[_0x0b40('0x20')](_0x36c324)['then'](function(_0x1ca202){return _0x1ca202;});}return null;};}function removeEntity(_0x8acf38,_0x4bef54){return function(_0x1ebebc){if(_0x1ebebc){return _0x1ebebc[_0x0b40('0x21')]()['then'](function(){_0x8acf38['status'](0xcc)[_0x0b40('0x22')]();});}};}function handleEntityNotFound(_0x112573,_0x48f43f){return function(_0x486f64){if(!_0x486f64){_0x112573[_0x0b40('0x17')](0x194);}return _0x486f64;};}function handleError(_0x234d14,_0x1fcba1){_0x1fcba1=_0x1fcba1||0x1f4;return function(_0x295908){logger[_0x0b40('0x23')](_0x295908[_0x0b40('0x24')]);if(_0x295908[_0x0b40('0x25')]){delete _0x295908[_0x0b40('0x25')];}_0x234d14['status'](_0x1fcba1)['send'](_0x295908);};}exports[_0x0b40('0x26')]=function(_0x1fa62c,_0x32923e){var _0x115668={},_0x386482={},_0x509b4f={'count':0x0,'rows':[]};var _0x1a42d9=_['map'](db[_0x0b40('0x27')]['rawAttributes'],function(_0x5eb03e){return{'name':_0x5eb03e[_0x0b40('0x28')],'type':_0x5eb03e['type']['key']};});_0x386482['model']=_[_0x0b40('0x29')](_0x1a42d9,_0x0b40('0x25'));_0x386482['query']=_[_0x0b40('0x2a')](_0x1fa62c[_0x0b40('0x2b')]);_0x386482['filters']=_[_0x0b40('0x2c')](_0x386482[_0x0b40('0x2d')],_0x386482[_0x0b40('0x2b')]);_0x115668['attributes']=_['intersection'](_0x386482[_0x0b40('0x2d')],qs[_0x0b40('0x2e')](_0x1fa62c[_0x0b40('0x2b')]['fields']));_0x115668[_0x0b40('0x2f')]=_0x115668[_0x0b40('0x2f')][_0x0b40('0x30')]?_0x115668[_0x0b40('0x2f')]:_0x386482[_0x0b40('0x2d')];if(!_0x1fa62c[_0x0b40('0x2b')][_0x0b40('0x31')](_0x0b40('0x32'))){_0x115668[_0x0b40('0x1c')]=qs[_0x0b40('0x1c')](_0x1fa62c[_0x0b40('0x2b')][_0x0b40('0x1c')]);_0x115668[_0x0b40('0x19')]=qs['offset'](_0x1fa62c['query']['offset']);}_0x115668[_0x0b40('0x33')]=qs[_0x0b40('0x34')](_0x1fa62c[_0x0b40('0x2b')][_0x0b40('0x34')]);_0x115668[_0x0b40('0x35')]=qs[_0x0b40('0x36')](_['pick'](_0x1fa62c[_0x0b40('0x2b')],_0x386482[_0x0b40('0x36')]),_0x1a42d9);if(_0x1fa62c[_0x0b40('0x2b')][_0x0b40('0x37')]){_0x115668['where']=_[_0x0b40('0x38')](_0x115668[_0x0b40('0x35')],{'$or':_[_0x0b40('0x29')](_0x1a42d9,function(_0x32e297){if(_0x32e297['type']!==_0x0b40('0x39')){var _0x3bdd3b={};_0x3bdd3b[_0x32e297['name']]={'$like':'%'+_0x1fa62c[_0x0b40('0x2b')][_0x0b40('0x37')]+'%'};return _0x3bdd3b;}})});}_0x115668=_[_0x0b40('0x38')]({},_0x115668,_0x1fa62c[_0x0b40('0x3a')]);var _0x344f5c={'where':_0x115668['where']};return db[_0x0b40('0x27')]['count'](_0x344f5c)[_0x0b40('0x3b')](function(_0x1869e4){_0x509b4f[_0x0b40('0x1b')]=_0x1869e4;if(_0x1fa62c['query'][_0x0b40('0x3c')]){_0x115668[_0x0b40('0x3d')]=[{'all':!![]}];}return db[_0x0b40('0x27')][_0x0b40('0x3e')](_0x115668);})[_0x0b40('0x3b')](function(_0x5e7c80){_0x509b4f[_0x0b40('0x3f')]=_0x5e7c80;return _0x509b4f;})[_0x0b40('0x3b')](respondWithFilteredResult(_0x32923e,_0x115668))[_0x0b40('0x40')](handleError(_0x32923e,null));};exports[_0x0b40('0x41')]=function(_0x33b8e1,_0x449f81){var _0x2ddd76={'raw':!![],'where':{'id':_0x33b8e1[_0x0b40('0x42')]['id']}},_0x10b2e2={};_0x10b2e2[_0x0b40('0x2d')]=_[_0x0b40('0x2a')](db[_0x0b40('0x27')]['rawAttributes']);_0x10b2e2[_0x0b40('0x2b')]=_[_0x0b40('0x2a')](_0x33b8e1['query']);_0x10b2e2[_0x0b40('0x36')]=_[_0x0b40('0x2c')](_0x10b2e2['model'],_0x10b2e2[_0x0b40('0x2b')]);_0x2ddd76['attributes']=_[_0x0b40('0x2c')](_0x10b2e2[_0x0b40('0x2d')],qs[_0x0b40('0x2e')](_0x33b8e1[_0x0b40('0x2b')][_0x0b40('0x2e')]));_0x2ddd76['attributes']=_0x2ddd76['attributes']['length']?_0x2ddd76[_0x0b40('0x2f')]:_0x10b2e2[_0x0b40('0x2d')];if(_0x33b8e1['query'][_0x0b40('0x3c')]){_0x2ddd76[_0x0b40('0x3d')]=[{'all':!![]}];}_0x2ddd76=_['merge']({},_0x2ddd76,_0x33b8e1[_0x0b40('0x3a')]);return db[_0x0b40('0x27')][_0x0b40('0x43')](_0x2ddd76)[_0x0b40('0x3b')](handleEntityNotFound(_0x449f81,null))[_0x0b40('0x3b')](respondWithResult(_0x449f81,null))[_0x0b40('0x40')](handleError(_0x449f81,null));};exports[_0x0b40('0x44')]=function(_0x136bce,_0x4894fb){return db[_0x0b40('0x27')]['create'](_0x136bce['body'],{})[_0x0b40('0x3b')](respondWithResult(_0x4894fb,0xc9))[_0x0b40('0x40')](handleError(_0x4894fb,null));};exports[_0x0b40('0x20')]=function(_0x479fdc,_0xb54cea){if(_0x479fdc[_0x0b40('0x45')]['id']){delete _0x479fdc[_0x0b40('0x45')]['id'];}return db[_0x0b40('0x27')][_0x0b40('0x43')]({'where':{'id':_0x479fdc['params']['id']}})[_0x0b40('0x3b')](handleEntityNotFound(_0xb54cea,null))['then'](saveUpdates(_0x479fdc['body'],null))[_0x0b40('0x3b')](respondWithResult(_0xb54cea,null))['catch'](handleError(_0xb54cea,null));};exports['destroy']=function(_0x3604e8,_0x38e687){return db[_0x0b40('0x27')][_0x0b40('0x43')]({'where':{'id':_0x3604e8['params']['id']}})[_0x0b40('0x3b')](handleEntityNotFound(_0x38e687,null))['then'](removeEntity(_0x38e687,null))[_0x0b40('0x40')](handleError(_0x38e687,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9c2e3ae..0346a83 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 _0x1a87=['bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','api'];(function(_0x34947e,_0x45c404){var _0x87404f=function(_0x5e5027){while(--_0x5e5027){_0x34947e['push'](_0x34947e['shift']());}};_0x87404f(++_0x45c404);}(_0x1a87,0x11a));var _0x71a8=function(_0xa31c9f,_0xce791f){_0xa31c9f=_0xa31c9f-0x0;var _0x345993=_0x1a87[_0xa31c9f];return _0x345993;};'use strict';var _=require(_0x71a8('0x0'));var util=require(_0x71a8('0x1'));var logger=require(_0x71a8('0x2'))(_0x71a8('0x3'));var moment=require('moment');var BPromise=require(_0x71a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71a8('0x5'));var rimraf=require(_0x71a8('0x6'));var config=require(_0x71a8('0x7'));var attributes=require(_0x71a8('0x8'));module[_0x71a8('0x9')]=function(_0x4489e0,_0x201e38){return _0x4489e0['define'](_0x71a8('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa776=['util','bluebird','request-promise','path','rimraf','../../config/environment','define','mail_servers_out','lodash'];(function(_0x19e8cd,_0x4c66c7){var _0x34b299=function(_0x1767e7){while(--_0x1767e7){_0x19e8cd['push'](_0x19e8cd['shift']());}};_0x34b299(++_0x4c66c7);}(_0xa776,0x1ca));var _0x6a77=function(_0x5a8097,_0x2c633a){_0x5a8097=_0x5a8097-0x0;var _0x59ac78=_0xa776[_0x5a8097];return _0x59ac78;};'use strict';var _=require(_0x6a77('0x0'));var util=require(_0x6a77('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6a77('0x2'));var rp=require(_0x6a77('0x3'));var fs=require('fs');var path=require(_0x6a77('0x4'));var rimraf=require(_0x6a77('0x5'));var config=require(_0x6a77('0x6'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x29412c,_0x385989){return _0x29412c[_0x6a77('0x7')]('MailServerOut',attributes,{'tableName':_0x6a77('0x8'),'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 b449ddb..63a5757 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1d6dea,_0x1f8978){var _0x1b5967=function(_0x4a95f6){while(--_0x4a95f6){_0x1d6dea['push'](_0x1d6dea['shift']());}};_0x1b5967(++_0x1f8978);}(_0xadb5,0xad));var _0x5adb=function(_0x381b92,_0x5b832b){_0x381b92=_0x381b92-0x0;var _0x6af66e=_0xadb5[_0x381b92];return _0x6af66e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _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(_0x46f868,_0x51a8c9){var _0xec84dc=function(_0x311603){while(--_0x311603){_0x46f868['push'](_0x46f868['shift']());}};_0xec84dc(++_0x51a8c9);}(_0x2ef3,0xba));var _0x32ef=function(_0x45fc4d,_0x59da9f){_0x45fc4d=_0x45fc4d-0x0;var _0x3a1da2=_0x2ef3[_0x45fc4d];return _0x3a1da2;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 169edfd..b2784fd 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 _0x2cca=['describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x1316f0,_0x344381){var _0x495643=function(_0x15a35e){while(--_0x15a35e){_0x1316f0['push'](_0x1316f0['shift']());}};_0x495643(++_0x344381);}(_0x2cca,0x106));var _0xa2cc=function(_0x1bd1c7,_0x51137d){_0x1bd1c7=_0x1bd1c7-0x0;var _0x469b71=_0x2cca[_0x1bd1c7];return _0x469b71;};'use strict';var multer=require(_0xa2cc('0x0'));var util=require(_0xa2cc('0x1'));var path=require(_0xa2cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2cc('0x3'));var router=express[_0xa2cc('0x4')]();var fs_extra=require(_0xa2cc('0x5'));var auth=require(_0xa2cc('0x6'));var interaction=require(_0xa2cc('0x7'));var config=require(_0xa2cc('0x8'));var controller=require(_0xa2cc('0x9'));router[_0xa2cc('0xa')]('/',auth[_0xa2cc('0xb')](),controller[_0xa2cc('0xc')]);router['get'](_0xa2cc('0xd'),auth[_0xa2cc('0xb')](),controller[_0xa2cc('0xe')]);router[_0xa2cc('0xa')](_0xa2cc('0xf'),auth[_0xa2cc('0xb')](),controller[_0xa2cc('0x10')]);router[_0xa2cc('0x11')]('/',auth[_0xa2cc('0xb')](),controller[_0xa2cc('0x12')]);router[_0xa2cc('0x13')]('/:id',auth[_0xa2cc('0xb')](),controller[_0xa2cc('0x14')]);router[_0xa2cc('0x15')]('/:id',auth[_0xa2cc('0xb')](),controller['destroy']);module[_0xa2cc('0x16')]=router; \ No newline at end of file +var _0xb046=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','update','destroy','exports','multer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb046,0x65));var _0x6b04=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xb046[_0x4a8418];return _0x390174;};'use strict';var multer=require(_0x6b04('0x0'));var util=require('util');var path=require(_0x6b04('0x1'));var timeout=require(_0x6b04('0x2'));var express=require(_0x6b04('0x3'));var router=express[_0x6b04('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6b04('0x5'));var config=require(_0x6b04('0x6'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x6b04('0x7')](),controller[_0x6b04('0x8')]);router[_0x6b04('0x9')](_0x6b04('0xa'),auth[_0x6b04('0x7')](),controller[_0x6b04('0xb')]);router[_0x6b04('0x9')](_0x6b04('0xc'),auth[_0x6b04('0x7')](),controller['show']);router[_0x6b04('0xd')]('/',auth[_0x6b04('0x7')](),controller['create']);router['put'](_0x6b04('0xc'),auth[_0x6b04('0x7')](),controller[_0x6b04('0xe')]);router['delete'](_0x6b04('0xc'),auth[_0x6b04('0x7')](),controller[_0x6b04('0xf')]);module[_0x6b04('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 761c30c..26ebdc0 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 _0x687b=['STRING','name','sequelize','exports'];(function(_0x5a25a9,_0xd1fbd7){var _0xe5e638=function(_0x484b8b){while(--_0x484b8b){_0x5a25a9['push'](_0x5a25a9['shift']());}};_0xe5e638(++_0xd1fbd7);}(_0x687b,0x14a));var _0xb687=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x687b[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd59=['exports','STRING','name','sequelize'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xcd59,0x14b));var _0x9cd5=function(_0x40e141,_0x4385ee){_0x40e141=_0x40e141-0x0;var _0x3ce15c=_0xcd59[_0x40e141];return _0x3ce15c;};'use strict';var Sequelize=require(_0x9cd5('0x0'));module[_0x9cd5('0x1')]={'name':{'type':Sequelize[_0x9cd5('0x2')],'unique':_0x9cd5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9cd5('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index a31af9f..46b7c52 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 _0xc6ad=['includeAll','include','findAll','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x4094d7,_0x639496){var _0x4b7e00=function(_0x4721d1){while(--_0x4721d1){_0x4094d7['push'](_0x4094d7['shift']());}};_0x4b7e00(++_0x639496);}(_0xc6ad,0xa6));var _0xdc6a=function(_0xa89b74,_0xf259b3){_0xa89b74=_0xa89b74-0x0;var _0x50be03=_0xc6ad[_0xa89b74];return _0x50be03;};'use strict';var emlformat=require(_0xdc6a('0x0'));var rimraf=require(_0xdc6a('0x1'));var zipdir=require(_0xdc6a('0x2'));var jsonpatch=require(_0xdc6a('0x3'));var rp=require(_0xdc6a('0x4'));var moment=require(_0xdc6a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc6a('0x6'));var util=require(_0xdc6a('0x7'));var path=require(_0xdc6a('0x8'));var sox=require(_0xdc6a('0x9'));var csv=require(_0xdc6a('0xa'));var ejs=require(_0xdc6a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc6a('0xc'));var squel=require(_0xdc6a('0xd'));var crypto=require(_0xdc6a('0xe'));var jsforce=require(_0xdc6a('0xf'));var deskjs=require(_0xdc6a('0x10'));var toCsv=require(_0xdc6a('0xa'));var querystring=require('querystring');var Papa=require(_0xdc6a('0x11'));var Redis=require('ioredis');var authService=require(_0xdc6a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdc6a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc6a('0x14'))(_0xdc6a('0x15'));var utils=require(_0xdc6a('0x16'));var config=require(_0xdc6a('0x17'));var licenseUtil=require(_0xdc6a('0x18'));var db=require(_0xdc6a('0x19'))['db'];function respondWithStatusCode(_0x27f28a,_0xf87814){_0xf87814=_0xf87814||0xcc;return function(_0x182c26){if(_0x182c26){return _0x27f28a[_0xdc6a('0x1a')](_0xf87814);}return _0x27f28a['status'](_0xf87814)[_0xdc6a('0x1b')]();};}function respondWithResult(_0x3a24e6,_0x4ce39f){_0x4ce39f=_0x4ce39f||0xc8;return function(_0x31a4e5){if(_0x31a4e5){return _0x3a24e6[_0xdc6a('0x1c')](_0x4ce39f)[_0xdc6a('0x1d')](_0x31a4e5);}};}function respondWithFilteredResult(_0x5be50c,_0x292b16){return function(_0x4851ac){if(_0x4851ac){var _0x77c1a6=typeof _0x292b16[_0xdc6a('0x1e')]===_0xdc6a('0x1f')&&typeof _0x292b16[_0xdc6a('0x20')]==='undefined';var _0x414930=_0x4851ac['count'];var _0x382c38=_0x77c1a6?0x0:_0x292b16[_0xdc6a('0x1e')];var _0x12bbf2=_0x77c1a6?_0x4851ac[_0xdc6a('0x21')]:_0x292b16['offset']+_0x292b16['limit'];var _0xdf384;if(_0x12bbf2>=_0x414930){_0x12bbf2=_0x414930;_0xdf384=0xc8;}else{_0xdf384=0xce;}_0x5be50c[_0xdc6a('0x1c')](_0xdf384);return _0x5be50c[_0xdc6a('0x22')](_0xdc6a('0x23'),_0x382c38+'-'+_0x12bbf2+'/'+_0x414930)[_0xdc6a('0x1d')](_0x4851ac);}return null;};}function patchUpdates(_0x595da9){return function(_0x47cee1){try{jsonpatch[_0xdc6a('0x24')](_0x47cee1,_0x595da9,!![]);}catch(_0x31a601){return BPromise[_0xdc6a('0x25')](_0x31a601);}return _0x47cee1[_0xdc6a('0x26')]();};}function saveUpdates(_0x4d3272,_0x489a86){return function(_0x13319d){if(_0x13319d){return _0x13319d[_0xdc6a('0x27')](_0x4d3272)['then'](function(_0x23dd6f){return _0x23dd6f;});}return null;};}function removeEntity(_0x1c3a74,_0x4158b0){return function(_0x3e551c){if(_0x3e551c){return _0x3e551c['destroy']()[_0xdc6a('0x28')](function(){_0x1c3a74[_0xdc6a('0x1c')](0xcc)[_0xdc6a('0x1b')]();});}};}function handleEntityNotFound(_0x326c7b,_0x1a6dbf){return function(_0xb0423){if(!_0xb0423){_0x326c7b[_0xdc6a('0x1a')](0x194);}return _0xb0423;};}function handleError(_0xb7b9a7,_0xa84ab8){_0xa84ab8=_0xa84ab8||0x1f4;return function(_0x102983){logger[_0xdc6a('0x29')](_0x102983['stack']);if(_0x102983['name']){delete _0x102983['name'];}_0xb7b9a7[_0xdc6a('0x1c')](_0xa84ab8)[_0xdc6a('0x2a')](_0x102983);};}exports[_0xdc6a('0x2b')]=function(_0x4e5866,_0x143f81){var _0x26bf04={},_0xd37b3={},_0x4b5deb={'count':0x0,'rows':[]};var _0x639724=_[_0xdc6a('0x2c')](db[_0xdc6a('0x2d')][_0xdc6a('0x2e')],function(_0x16103e){return{'name':_0x16103e[_0xdc6a('0x2f')],'type':_0x16103e[_0xdc6a('0x30')][_0xdc6a('0x31')]};});_0xd37b3[_0xdc6a('0x32')]=_[_0xdc6a('0x2c')](_0x639724,_0xdc6a('0x33'));_0xd37b3[_0xdc6a('0x34')]=_[_0xdc6a('0x35')](_0x4e5866[_0xdc6a('0x34')]);_0xd37b3[_0xdc6a('0x36')]=_[_0xdc6a('0x37')](_0xd37b3[_0xdc6a('0x32')],_0xd37b3[_0xdc6a('0x34')]);_0x26bf04[_0xdc6a('0x38')]=_[_0xdc6a('0x37')](_0xd37b3[_0xdc6a('0x32')],qs[_0xdc6a('0x39')](_0x4e5866[_0xdc6a('0x34')]['fields']));_0x26bf04[_0xdc6a('0x38')]=_0x26bf04[_0xdc6a('0x38')][_0xdc6a('0x3a')]?_0x26bf04['attributes']:_0xd37b3['model'];if(!_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x3b')](_0xdc6a('0x3c'))){_0x26bf04[_0xdc6a('0x20')]=qs[_0xdc6a('0x20')](_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x20')]);_0x26bf04[_0xdc6a('0x1e')]=qs['offset'](_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x1e')]);}_0x26bf04[_0xdc6a('0x3d')]=qs[_0xdc6a('0x3e')](_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x3e')]);_0x26bf04[_0xdc6a('0x3f')]=qs[_0xdc6a('0x36')](_[_0xdc6a('0x40')](_0x4e5866[_0xdc6a('0x34')],_0xd37b3[_0xdc6a('0x36')]),_0x639724);if(_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x41')]){_0x26bf04['where']=_[_0xdc6a('0x42')](_0x26bf04[_0xdc6a('0x3f')],{'$or':_[_0xdc6a('0x2c')](_0x639724,function(_0x5f5eb3){if(_0x5f5eb3[_0xdc6a('0x30')]!=='VIRTUAL'){var _0x1cdae7={};_0x1cdae7[_0x5f5eb3[_0xdc6a('0x33')]]={'$like':'%'+_0x4e5866[_0xdc6a('0x34')][_0xdc6a('0x41')]+'%'};return _0x1cdae7;}})});}_0x26bf04=_['merge']({},_0x26bf04,_0x4e5866[_0xdc6a('0x43')]);var _0x4c9914={'where':_0x26bf04[_0xdc6a('0x3f')]};return db[_0xdc6a('0x2d')][_0xdc6a('0x21')](_0x4c9914)[_0xdc6a('0x28')](function(_0x14bfbc){_0x4b5deb[_0xdc6a('0x21')]=_0x14bfbc;if(_0x4e5866['query'][_0xdc6a('0x44')]){_0x26bf04[_0xdc6a('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0xdc6a('0x46')](_0x26bf04);})['then'](function(_0x3a92e7){_0x4b5deb['rows']=_0x3a92e7;return _0x4b5deb;})[_0xdc6a('0x28')](respondWithFilteredResult(_0x143f81,_0x26bf04))[_0xdc6a('0x47')](handleError(_0x143f81,null));};exports['show']=function(_0x45d10f,_0x40ea0f){var _0x25ef6e={'raw':!![],'where':{'id':_0x45d10f[_0xdc6a('0x48')]['id']}},_0x20a8eb={};_0x20a8eb[_0xdc6a('0x32')]=_[_0xdc6a('0x35')](db[_0xdc6a('0x2d')]['rawAttributes']);_0x20a8eb[_0xdc6a('0x34')]=_[_0xdc6a('0x35')](_0x45d10f[_0xdc6a('0x34')]);_0x20a8eb[_0xdc6a('0x36')]=_['intersection'](_0x20a8eb[_0xdc6a('0x32')],_0x20a8eb[_0xdc6a('0x34')]);_0x25ef6e[_0xdc6a('0x38')]=_['intersection'](_0x20a8eb[_0xdc6a('0x32')],qs[_0xdc6a('0x39')](_0x45d10f['query'][_0xdc6a('0x39')]));_0x25ef6e[_0xdc6a('0x38')]=_0x25ef6e[_0xdc6a('0x38')][_0xdc6a('0x3a')]?_0x25ef6e[_0xdc6a('0x38')]:_0x20a8eb[_0xdc6a('0x32')];if(_0x45d10f[_0xdc6a('0x34')]['includeAll']){_0x25ef6e[_0xdc6a('0x45')]=[{'all':!![]}];}_0x25ef6e=_['merge']({},_0x25ef6e,_0x45d10f['options']);return db['MailSubstatus'][_0xdc6a('0x49')](_0x25ef6e)[_0xdc6a('0x28')](handleEntityNotFound(_0x40ea0f,null))[_0xdc6a('0x28')](respondWithResult(_0x40ea0f,null))[_0xdc6a('0x47')](handleError(_0x40ea0f,null));};exports[_0xdc6a('0x4a')]=function(_0x441cff,_0x4ea00e){return db['MailSubstatus'][_0xdc6a('0x4a')](_0x441cff[_0xdc6a('0x4b')],{})[_0xdc6a('0x28')](respondWithResult(_0x4ea00e,0xc9))[_0xdc6a('0x47')](handleError(_0x4ea00e,null));};exports[_0xdc6a('0x27')]=function(_0xea0138,_0x4db4bf){if(_0xea0138['body']['id']){delete _0xea0138[_0xdc6a('0x4b')]['id'];}return db[_0xdc6a('0x2d')][_0xdc6a('0x49')]({'where':{'id':_0xea0138['params']['id']}})[_0xdc6a('0x28')](handleEntityNotFound(_0x4db4bf,null))[_0xdc6a('0x28')](saveUpdates(_0xea0138['body'],null))['then'](respondWithResult(_0x4db4bf,null))[_0xdc6a('0x47')](handleError(_0x4db4bf,null));};exports[_0xdc6a('0x4c')]=function(_0x5a0d3f,_0x22522b){return db[_0xdc6a('0x2d')][_0xdc6a('0x49')]({'where':{'id':_0x5a0d3f[_0xdc6a('0x48')]['id']}})['then'](handleEntityNotFound(_0x22522b,null))[_0xdc6a('0x28')](removeEntity(_0x22522b,null))[_0xdc6a('0x47')](handleError(_0x22522b,null));};exports[_0xdc6a('0x4d')]=function(_0x503717,_0x265e7a){return db[_0xdc6a('0x2d')][_0xdc6a('0x4d')]()[_0xdc6a('0x28')](respondWithResult(_0x265e7a,null))['catch'](handleError(_0x265e7a,null));}; \ No newline at end of file +var _0xac82=['nolimit','order','where','pick','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','sendStatus','name','send','index','map','MailSubstatus','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x7b064a,_0x5838dc){var _0x4020f3=function(_0x324038){while(--_0x324038){_0x7b064a['push'](_0x7b064a['shift']());}};_0x4020f3(++_0x5838dc);}(_0xac82,0x127));var _0x2ac8=function(_0x205aec,_0x38428c){_0x205aec=_0x205aec-0x0;var _0x49569c=_0xac82[_0x205aec];return _0x49569c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ac8('0x0'));var rp=require(_0x2ac8('0x1'));var moment=require(_0x2ac8('0x2'));var BPromise=require(_0x2ac8('0x3'));var Mustache=require('mustache');var util=require(_0x2ac8('0x4'));var path=require('path');var sox=require(_0x2ac8('0x5'));var csv=require(_0x2ac8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ac8('0x7'));var _=require(_0x2ac8('0x8'));var squel=require(_0x2ac8('0x9'));var crypto=require(_0x2ac8('0xa'));var jsforce=require(_0x2ac8('0xb'));var deskjs=require(_0x2ac8('0xc'));var toCsv=require(_0x2ac8('0x6'));var querystring=require('querystring');var Papa=require(_0x2ac8('0xd'));var Redis=require(_0x2ac8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2ac8('0xf'));var as=require(_0x2ac8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ac8('0x11'))(_0x2ac8('0x12'));var utils=require(_0x2ac8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ac8('0x14'));var db=require(_0x2ac8('0x15'))['db'];function respondWithStatusCode(_0xe5cbd2,_0x447c1e){_0x447c1e=_0x447c1e||0xcc;return function(_0x28c3c1){if(_0x28c3c1){return _0xe5cbd2['sendStatus'](_0x447c1e);}return _0xe5cbd2['status'](_0x447c1e)[_0x2ac8('0x16')]();};}function respondWithResult(_0x146ae3,_0x3f2cfb){_0x3f2cfb=_0x3f2cfb||0xc8;return function(_0x5b2ef0){if(_0x5b2ef0){return _0x146ae3[_0x2ac8('0x17')](_0x3f2cfb)['json'](_0x5b2ef0);}};}function respondWithFilteredResult(_0x216c6f,_0x386de0){return function(_0x1865d1){if(_0x1865d1){var _0x40b550=typeof _0x386de0[_0x2ac8('0x18')]===_0x2ac8('0x19')&&typeof _0x386de0[_0x2ac8('0x1a')]===_0x2ac8('0x19');var _0xf79ee6=_0x1865d1['count'];var _0x9ddc0=_0x40b550?0x0:_0x386de0[_0x2ac8('0x18')];var _0x2298c6=_0x40b550?_0x1865d1[_0x2ac8('0x1b')]:_0x386de0['offset']+_0x386de0[_0x2ac8('0x1a')];var _0x4127e0;if(_0x2298c6>=_0xf79ee6){_0x2298c6=_0xf79ee6;_0x4127e0=0xc8;}else{_0x4127e0=0xce;}_0x216c6f[_0x2ac8('0x17')](_0x4127e0);return _0x216c6f[_0x2ac8('0x1c')](_0x2ac8('0x1d'),_0x9ddc0+'-'+_0x2298c6+'/'+_0xf79ee6)[_0x2ac8('0x1e')](_0x1865d1);}return null;};}function patchUpdates(_0x3af1ad){return function(_0x258c91){try{jsonpatch[_0x2ac8('0x1f')](_0x258c91,_0x3af1ad,!![]);}catch(_0x3b4c55){return BPromise['reject'](_0x3b4c55);}return _0x258c91[_0x2ac8('0x20')]();};}function saveUpdates(_0x5a0322,_0x5a63f6){return function(_0x538b3e){if(_0x538b3e){return _0x538b3e[_0x2ac8('0x21')](_0x5a0322)[_0x2ac8('0x22')](function(_0x2f53e8){return _0x2f53e8;});}return null;};}function removeEntity(_0x14d103,_0x14e1f9){return function(_0x5aafc4){if(_0x5aafc4){return _0x5aafc4['destroy']()[_0x2ac8('0x22')](function(){_0x14d103['status'](0xcc)[_0x2ac8('0x16')]();});}};}function handleEntityNotFound(_0x492256,_0x32b0dd){return function(_0xc869d2){if(!_0xc869d2){_0x492256[_0x2ac8('0x23')](0x194);}return _0xc869d2;};}function handleError(_0x23cf6c,_0x2fc87f){_0x2fc87f=_0x2fc87f||0x1f4;return function(_0x2915c9){logger['error'](_0x2915c9['stack']);if(_0x2915c9[_0x2ac8('0x24')]){delete _0x2915c9[_0x2ac8('0x24')];}_0x23cf6c['status'](_0x2fc87f)[_0x2ac8('0x25')](_0x2915c9);};}exports[_0x2ac8('0x26')]=function(_0x3e62b3,_0x840cb3){var _0x2f646d={},_0x4a94c7={},_0x151248={'count':0x0,'rows':[]};var _0x21d363=_[_0x2ac8('0x27')](db[_0x2ac8('0x28')][_0x2ac8('0x29')],function(_0x112e43){return{'name':_0x112e43[_0x2ac8('0x2a')],'type':_0x112e43['type']['key']};});_0x4a94c7[_0x2ac8('0x2b')]=_['map'](_0x21d363,_0x2ac8('0x24'));_0x4a94c7[_0x2ac8('0x2c')]=_['keys'](_0x3e62b3[_0x2ac8('0x2c')]);_0x4a94c7[_0x2ac8('0x2d')]=_[_0x2ac8('0x2e')](_0x4a94c7['model'],_0x4a94c7[_0x2ac8('0x2c')]);_0x2f646d[_0x2ac8('0x2f')]=_[_0x2ac8('0x2e')](_0x4a94c7[_0x2ac8('0x2b')],qs[_0x2ac8('0x30')](_0x3e62b3[_0x2ac8('0x2c')]['fields']));_0x2f646d[_0x2ac8('0x2f')]=_0x2f646d[_0x2ac8('0x2f')]['length']?_0x2f646d[_0x2ac8('0x2f')]:_0x4a94c7[_0x2ac8('0x2b')];if(!_0x3e62b3['query'][_0x2ac8('0x31')](_0x2ac8('0x32'))){_0x2f646d[_0x2ac8('0x1a')]=qs[_0x2ac8('0x1a')](_0x3e62b3[_0x2ac8('0x2c')][_0x2ac8('0x1a')]);_0x2f646d[_0x2ac8('0x18')]=qs[_0x2ac8('0x18')](_0x3e62b3[_0x2ac8('0x2c')][_0x2ac8('0x18')]);}_0x2f646d[_0x2ac8('0x33')]=qs['sort'](_0x3e62b3[_0x2ac8('0x2c')]['sort']);_0x2f646d[_0x2ac8('0x34')]=qs[_0x2ac8('0x2d')](_[_0x2ac8('0x35')](_0x3e62b3[_0x2ac8('0x2c')],_0x4a94c7[_0x2ac8('0x2d')]),_0x21d363);if(_0x3e62b3[_0x2ac8('0x2c')][_0x2ac8('0x36')]){_0x2f646d[_0x2ac8('0x34')]=_['merge'](_0x2f646d['where'],{'$or':_['map'](_0x21d363,function(_0x268ef6){if(_0x268ef6[_0x2ac8('0x37')]!=='VIRTUAL'){var _0x4247de={};_0x4247de[_0x268ef6[_0x2ac8('0x24')]]={'$like':'%'+_0x3e62b3[_0x2ac8('0x2c')][_0x2ac8('0x36')]+'%'};return _0x4247de;}})});}_0x2f646d=_[_0x2ac8('0x38')]({},_0x2f646d,_0x3e62b3[_0x2ac8('0x39')]);var _0x4780d6={'where':_0x2f646d[_0x2ac8('0x34')]};return db['MailSubstatus']['count'](_0x4780d6)[_0x2ac8('0x22')](function(_0x32f405){_0x151248[_0x2ac8('0x1b')]=_0x32f405;if(_0x3e62b3[_0x2ac8('0x2c')][_0x2ac8('0x3a')]){_0x2f646d[_0x2ac8('0x3b')]=[{'all':!![]}];}return db[_0x2ac8('0x28')]['findAll'](_0x2f646d);})['then'](function(_0x5bef4e){_0x151248['rows']=_0x5bef4e;return _0x151248;})[_0x2ac8('0x22')](respondWithFilteredResult(_0x840cb3,_0x2f646d))[_0x2ac8('0x3c')](handleError(_0x840cb3,null));};exports[_0x2ac8('0x3d')]=function(_0x599e0c,_0x1875da){var _0x5c155a={'raw':!![],'where':{'id':_0x599e0c[_0x2ac8('0x3e')]['id']}},_0x1fb07a={};_0x1fb07a[_0x2ac8('0x2b')]=_[_0x2ac8('0x3f')](db[_0x2ac8('0x28')][_0x2ac8('0x29')]);_0x1fb07a[_0x2ac8('0x2c')]=_['keys'](_0x599e0c[_0x2ac8('0x2c')]);_0x1fb07a['filters']=_['intersection'](_0x1fb07a[_0x2ac8('0x2b')],_0x1fb07a[_0x2ac8('0x2c')]);_0x5c155a[_0x2ac8('0x2f')]=_[_0x2ac8('0x2e')](_0x1fb07a[_0x2ac8('0x2b')],qs[_0x2ac8('0x30')](_0x599e0c['query'][_0x2ac8('0x30')]));_0x5c155a[_0x2ac8('0x2f')]=_0x5c155a[_0x2ac8('0x2f')]['length']?_0x5c155a[_0x2ac8('0x2f')]:_0x1fb07a[_0x2ac8('0x2b')];if(_0x599e0c['query']['includeAll']){_0x5c155a[_0x2ac8('0x3b')]=[{'all':!![]}];}_0x5c155a=_[_0x2ac8('0x38')]({},_0x5c155a,_0x599e0c[_0x2ac8('0x39')]);return db[_0x2ac8('0x28')][_0x2ac8('0x40')](_0x5c155a)[_0x2ac8('0x22')](handleEntityNotFound(_0x1875da,null))[_0x2ac8('0x22')](respondWithResult(_0x1875da,null))['catch'](handleError(_0x1875da,null));};exports[_0x2ac8('0x41')]=function(_0x1595f7,_0x45ee07){return db[_0x2ac8('0x28')][_0x2ac8('0x41')](_0x1595f7[_0x2ac8('0x42')],{})[_0x2ac8('0x22')](respondWithResult(_0x45ee07,0xc9))[_0x2ac8('0x3c')](handleError(_0x45ee07,null));};exports[_0x2ac8('0x21')]=function(_0x17166e,_0x4b1a03){if(_0x17166e[_0x2ac8('0x42')]['id']){delete _0x17166e['body']['id'];}return db[_0x2ac8('0x28')][_0x2ac8('0x40')]({'where':{'id':_0x17166e['params']['id']}})[_0x2ac8('0x22')](handleEntityNotFound(_0x4b1a03,null))[_0x2ac8('0x22')](saveUpdates(_0x17166e[_0x2ac8('0x42')],null))['then'](respondWithResult(_0x4b1a03,null))[_0x2ac8('0x3c')](handleError(_0x4b1a03,null));};exports[_0x2ac8('0x43')]=function(_0x166406,_0x169868){return db[_0x2ac8('0x28')][_0x2ac8('0x40')]({'where':{'id':_0x166406[_0x2ac8('0x3e')]['id']}})[_0x2ac8('0x22')](handleEntityNotFound(_0x169868,null))[_0x2ac8('0x22')](removeEntity(_0x169868,null))[_0x2ac8('0x3c')](handleError(_0x169868,null));};exports[_0x2ac8('0x44')]=function(_0x49eb12,_0x5900eb){return db[_0x2ac8('0x28')]['describe']()[_0x2ac8('0x22')](respondWithResult(_0x5900eb,null))['catch'](handleError(_0x5900eb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 6134816..56a4a35 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 _0x1198=['update','emit','hook','exports','../../mysqldb','MailSubstatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1198,0x16c));var _0x8119=function(_0xc3b49b,_0x1681d1){_0xc3b49b=_0xc3b49b-0x0;var _0x2ebd11=_0x1198[_0xc3b49b];return _0x2ebd11;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x8119('0x0'))['db'][_0x8119('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x8119('0x2')};function emitEvent(_0x4611a3){return function(_0x1c85b6,_0x5ad06a,_0x911b61){MailSubstatusEvents[_0x8119('0x3')](_0x4611a3+':'+_0x1c85b6['id'],_0x1c85b6);MailSubstatusEvents[_0x8119('0x3')](_0x4611a3,_0x1c85b6);_0x911b61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x8119('0x4')](e,emitEvent(event));}}module[_0x8119('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x7d2b=['hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','emit'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x7d2b,0x1cb));var _0xb7d2=function(_0x44d541,_0x570e67){_0x44d541=_0x44d541-0x0;var _0x2dee34=_0x7d2b[_0x44d541];return _0x2dee34;};'use strict';var EventEmitter=require(_0xb7d2('0x0'));var MailSubstatus=require(_0xb7d2('0x1'))['db'][_0xb7d2('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb7d2('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x17c908){return function(_0x1b574e,_0x2d22cc,_0x31a723){MailSubstatusEvents[_0xb7d2('0x4')](_0x17c908+':'+_0x1b574e['id'],_0x1b574e);MailSubstatusEvents[_0xb7d2('0x4')](_0x17c908,_0x1b574e);_0x31a723(null);};}for(var e in events){if(events[_0xb7d2('0x5')](e)){var event=events[e];MailSubstatus[_0xb7d2('0x6')](e,emitEvent(event));}}module[_0xb7d2('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 392535a..34210c9 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 _0xe4df=['models','define','MailSubstatus','Condition','name','mailSubstatus','then','./mailSubstatus.attributes','exports'];(function(_0x44fc22,_0x1f9c46){var _0x4f19ea=function(_0x1b49a2){while(--_0x1b49a2){_0x44fc22['push'](_0x44fc22['shift']());}};_0x4f19ea(++_0x1f9c46);}(_0xe4df,0x11e));var _0xfe4d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe4df[_0x432682];return _0x463d05;};'use strict';var attributes=require(_0xfe4d('0x0'));module[_0xfe4d('0x1')]=function(_0x70a99e){var _0x4c760f=_0x70a99e[_0xfe4d('0x2')];return _0x70a99e[_0xfe4d('0x3')](_0xfe4d('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x34a3d8,_0x567aaa,_0x18bea4){return _0x4c760f[_0xfe4d('0x5')]['update']({'value':_0x34a3d8[_0xfe4d('0x6')]},{'where':{'field':_0xfe4d('0x7'),'value':_0x34a3d8['_previousDataValues']['name']}})[_0xfe4d('0x8')](function(){_0x18bea4();})['catch'](function(_0x3fc04d){_0x18bea4(_0x3fc04d);});}}});}; \ No newline at end of file +var _0x9905=['MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9905,0x130));var _0x5990=function(_0x45f42c,_0x2f7378){_0x45f42c=_0x45f42c-0x0;var _0x58ecbb=_0x9905[_0x45f42c];return _0x58ecbb;};'use strict';var attributes=require(_0x5990('0x0'));module[_0x5990('0x1')]=function(_0x180c7d){var _0x1f8f9a=_0x180c7d[_0x5990('0x2')];return _0x180c7d[_0x5990('0x3')](_0x5990('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x24c13b,_0x25d8d8,_0x461399){return _0x1f8f9a[_0x5990('0x5')][_0x5990('0x6')]({'value':_0x24c13b[_0x5990('0x7')]},{'where':{'field':_0x5990('0x8'),'value':_0x24c13b[_0x5990('0x9')][_0x5990('0x7')]}})[_0x5990('0xa')](function(){_0x461399();})['catch'](function(_0x54cfba){_0x461399(_0x54cfba);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7e94685..ed8475a 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 _0x819b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x26fb40,_0x6a0e6f){var _0x4f8d50=function(_0x215683){while(--_0x215683){_0x26fb40['push'](_0x26fb40['shift']());}};_0x4f8d50(++_0x6a0e6f);}(_0x819b,0x83));var _0xb819=function(_0xd20b19,_0x467e87){_0xd20b19=_0xd20b19-0x0;var _0x99a02e=_0x819b[_0xd20b19];return _0x99a02e;};'use strict';var _=require(_0xb819('0x0'));var util=require(_0xb819('0x1'));var moment=require(_0xb819('0x2'));var BPromise=require('bluebird');var rs=require(_0xb819('0x3'));var fs=require('fs');var Redis=require(_0xb819('0x4'));var db=require(_0xb819('0x5'))['db'];var utils=require(_0xb819('0x6'));var logger=require(_0xb819('0x7'))(_0xb819('0x8'));var config=require(_0xb819('0x9'));var jayson=require(_0xb819('0xa'));var client=jayson[_0xb819('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181dea,_0x170858,_0x44fd24){return new BPromise(function(_0x1ed485,_0x140882){return client[_0xb819('0xc')](_0x181dea,_0x44fd24)[_0xb819('0xd')](function(_0x3f3c71){logger[_0xb819('0xe')](_0xb819('0xf'),_0x170858,_0xb819('0x10'));logger[_0xb819('0x11')](_0xb819('0x12'),_0x170858,'request\x20sent',JSON['stringify'](_0x3f3c71));if(_0x3f3c71[_0xb819('0x13')]){if(_0x3f3c71[_0xb819('0x13')][_0xb819('0x14')]===0x1f4){logger[_0xb819('0x13')](_0xb819('0xf'),_0x170858,_0x3f3c71[_0xb819('0x13')]['message']);return _0x140882(_0x3f3c71[_0xb819('0x13')]['message']);}logger[_0xb819('0x13')](_0xb819('0xf'),_0x170858,_0x3f3c71['error'][_0xb819('0x15')]);return _0x1ed485(_0x3f3c71[_0xb819('0x13')][_0xb819('0x15')]);}else{logger[_0xb819('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x170858,_0xb819('0x10'));_0x1ed485(_0x3f3c71['result'][_0xb819('0x15')]);}})['catch'](function(_0x29811e){logger[_0xb819('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x170858,_0x29811e);_0x140882(_0x29811e);});});} \ No newline at end of file +var _0x33dc=['client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1c3aab,_0x1ce4e3){var _0x41f64e=function(_0x164542){while(--_0x164542){_0x1c3aab['push'](_0x1c3aab['shift']());}};_0x41f64e(++_0x1ce4e3);}(_0x33dc,0x91));var _0xc33d=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x33dc[_0x34df4a];return _0x145c69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc33d('0x0'));var BPromise=require('bluebird');var rs=require(_0xc33d('0x1'));var fs=require('fs');var Redis=require(_0xc33d('0x2'));var db=require(_0xc33d('0x3'))['db'];var utils=require(_0xc33d('0x4'));var logger=require(_0xc33d('0x5'))(_0xc33d('0x6'));var config=require(_0xc33d('0x7'));var jayson=require(_0xc33d('0x8'));var client=jayson[_0xc33d('0x9')][_0xc33d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2634,_0x2158d1,_0xe9008f){return new BPromise(function(_0x53f659,_0xb0910f){return client['request'](_0x4c2634,_0xe9008f)[_0xc33d('0xb')](function(_0x806541){logger[_0xc33d('0xc')](_0xc33d('0xd'),_0x2158d1,_0xc33d('0xe'));logger[_0xc33d('0xf')](_0xc33d('0x10'),_0x2158d1,'request\x20sent',JSON[_0xc33d('0x11')](_0x806541));if(_0x806541['error']){if(_0x806541[_0xc33d('0x12')]['code']===0x1f4){logger['error'](_0xc33d('0xd'),_0x2158d1,_0x806541[_0xc33d('0x12')][_0xc33d('0x13')]);return _0xb0910f(_0x806541[_0xc33d('0x12')][_0xc33d('0x13')]);}logger[_0xc33d('0x12')](_0xc33d('0xd'),_0x2158d1,_0x806541[_0xc33d('0x12')][_0xc33d('0x13')]);return _0x53f659(_0x806541[_0xc33d('0x12')][_0xc33d('0x13')]);}else{logger[_0xc33d('0xc')](_0xc33d('0xd'),_0x2158d1,_0xc33d('0xe'));_0x53f659(_0x806541[_0xc33d('0x14')][_0xc33d('0x13')]);}})[_0xc33d('0x15')](function(_0x2e5c12){logger[_0xc33d('0x12')](_0xc33d('0xd'),_0x2158d1,_0x2e5c12);_0xb0910f(_0x2e5c12);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d65d2c2..fc357dd 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 _0xd8a2=['exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x573d96,_0x3cb205){var _0x14d177=function(_0x11359f){while(--_0x11359f){_0x573d96['push'](_0x573d96['shift']());}};_0x14d177(++_0x3cb205);}(_0xd8a2,0x161));var _0x2d8a=function(_0x4cc6f7,_0x47e93b){_0x4cc6f7=_0x4cc6f7-0x0;var _0x44e5f0=_0xd8a2[_0x4cc6f7];return _0x44e5f0;};'use strict';var multer=require(_0x2d8a('0x0'));var util=require(_0x2d8a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d8a('0x2'));var router=express[_0x2d8a('0x3')]();var fs_extra=require(_0x2d8a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d8a('0x5'));var config=require(_0x2d8a('0x6'));var controller=require(_0x2d8a('0x7'));router[_0x2d8a('0x8')]('/',auth['isAuthenticated'](),controller[_0x2d8a('0x9')]);router[_0x2d8a('0x8')](_0x2d8a('0xa'),auth[_0x2d8a('0xb')](),controller[_0x2d8a('0xc')]);router[_0x2d8a('0x8')](_0x2d8a('0xd'),auth['isAuthenticated'](),controller[_0x2d8a('0xe')]);router[_0x2d8a('0xf')]('/',auth[_0x2d8a('0xb')](),controller[_0x2d8a('0x10')]);router[_0x2d8a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2d8a('0x12')]);router[_0x2d8a('0x13')](_0x2d8a('0xd'),auth['isAuthenticated'](),controller[_0x2d8a('0x14')]);module[_0x2d8a('0x15')]=router; \ No newline at end of file +var _0xc886=['multer','path','connect-timeout','express','Router','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','describe','/:id','update','destroy','exports'];(function(_0xb6b35d,_0x43d0fe){var _0x5dbaeb=function(_0x399847){while(--_0x399847){_0xb6b35d['push'](_0xb6b35d['shift']());}};_0x5dbaeb(++_0x43d0fe);}(_0xc886,0x177));var _0x6c88=function(_0x228ad7,_0x4c524c){_0x228ad7=_0x228ad7-0x0;var _0x587c52=_0xc886[_0x228ad7];return _0x587c52;};'use strict';var multer=require(_0x6c88('0x0'));var util=require('util');var path=require(_0x6c88('0x1'));var timeout=require(_0x6c88('0x2'));var express=require(_0x6c88('0x3'));var router=express[_0x6c88('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c88('0x5'));var controller=require(_0x6c88('0x6'));router['get']('/',auth[_0x6c88('0x7')](),controller[_0x6c88('0x8')]);router[_0x6c88('0x9')]('/describe',auth[_0x6c88('0x7')](),controller[_0x6c88('0xa')]);router[_0x6c88('0x9')](_0x6c88('0xb'),auth[_0x6c88('0x7')](),controller['show']);router['post']('/',auth[_0x6c88('0x7')](),controller['create']);router['put'](_0x6c88('0xb'),auth[_0x6c88('0x7')](),controller[_0x6c88('0xc')]);router['delete']('/:id',auth[_0x6c88('0x7')](),controller[_0x6c88('0xd')]);module[_0x6c88('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index b7dff30..d3ced74 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2eb311,_0x5813c0){var _0x102022=function(_0x591fa5){while(--_0x591fa5){_0x2eb311['push'](_0x2eb311['shift']());}};_0x102022(++_0x5813c0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xf3cd[_0xfb42e6];return _0x27265b;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ceaf976..6f5b9b1 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 _0x1b8d=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x43c224,_0x57f952){var _0x54baab=function(_0x572115){while(--_0x572115){_0x43c224['push'](_0x43c224['shift']());}};_0x54baab(++_0x57f952);}(_0x1b8d,0x11c));var _0xd1b8=function(_0x18ae4b,_0x3fccea){_0x18ae4b=_0x18ae4b-0x0;var _0x409b8b=_0x1b8d[_0x18ae4b];return _0x409b8b;};'use strict';var emlformat=require(_0xd1b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1b8('0x1'));var jsonpatch=require(_0xd1b8('0x2'));var rp=require(_0xd1b8('0x3'));var moment=require(_0xd1b8('0x4'));var BPromise=require(_0xd1b8('0x5'));var Mustache=require(_0xd1b8('0x6'));var util=require(_0xd1b8('0x7'));var path=require(_0xd1b8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1b8('0x9'));var _=require(_0xd1b8('0xa'));var squel=require('squel');var crypto=require(_0xd1b8('0xb'));var jsforce=require(_0xd1b8('0xc'));var deskjs=require(_0xd1b8('0xd'));var toCsv=require(_0xd1b8('0xe'));var querystring=require('querystring');var Papa=require(_0xd1b8('0xf'));var Redis=require(_0xd1b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd1b8('0x11'));var as=require(_0xd1b8('0x12'));var hardwareService=require(_0xd1b8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd1b8('0x14'));var config=require(_0xd1b8('0x15'));var licenseUtil=require(_0xd1b8('0x16'));var db=require(_0xd1b8('0x17'))['db'];function respondWithStatusCode(_0xe361aa,_0x31c015){_0x31c015=_0x31c015||0xcc;return function(_0x498569){if(_0x498569){return _0xe361aa['sendStatus'](_0x31c015);}return _0xe361aa['status'](_0x31c015)[_0xd1b8('0x18')]();};}function respondWithResult(_0x4e5422,_0x31f75e){_0x31f75e=_0x31f75e||0xc8;return function(_0x2a59c3){if(_0x2a59c3){return _0x4e5422[_0xd1b8('0x19')](_0x31f75e)[_0xd1b8('0x1a')](_0x2a59c3);}};}function respondWithFilteredResult(_0x17e956,_0x5d75f6){return function(_0x4637c8){if(_0x4637c8){var _0x2006d8=typeof _0x5d75f6[_0xd1b8('0x1b')]===_0xd1b8('0x1c')&&typeof _0x5d75f6[_0xd1b8('0x1d')]==='undefined';var _0x1948d5=_0x4637c8['count'];var _0x3601aa=_0x2006d8?0x0:_0x5d75f6['offset'];var _0xb47e62=_0x2006d8?_0x4637c8[_0xd1b8('0x1e')]:_0x5d75f6[_0xd1b8('0x1b')]+_0x5d75f6[_0xd1b8('0x1d')];var _0x56594e;if(_0xb47e62>=_0x1948d5){_0xb47e62=_0x1948d5;_0x56594e=0xc8;}else{_0x56594e=0xce;}_0x17e956[_0xd1b8('0x19')](_0x56594e);return _0x17e956[_0xd1b8('0x1f')]('Content-Range',_0x3601aa+'-'+_0xb47e62+'/'+_0x1948d5)[_0xd1b8('0x1a')](_0x4637c8);}return null;};}function patchUpdates(_0x36e73a){return function(_0x16b530){try{jsonpatch[_0xd1b8('0x20')](_0x16b530,_0x36e73a,!![]);}catch(_0x1ab0ad){return BPromise[_0xd1b8('0x21')](_0x1ab0ad);}return _0x16b530[_0xd1b8('0x22')]();};}function saveUpdates(_0x17eb5a,_0x456a99){return function(_0x5a776a){if(_0x5a776a){return _0x5a776a[_0xd1b8('0x23')](_0x17eb5a)[_0xd1b8('0x24')](function(_0x4236fc){return _0x4236fc;});}return null;};}function removeEntity(_0x303735,_0x1be0d6){return function(_0x5f361f){if(_0x5f361f){return _0x5f361f['destroy']()['then'](function(){_0x303735[_0xd1b8('0x19')](0xcc)[_0xd1b8('0x18')]();});}};}function handleEntityNotFound(_0x359a31,_0x27cf43){return function(_0x2bcc8d){if(!_0x2bcc8d){_0x359a31['sendStatus'](0x194);}return _0x2bcc8d;};}function handleError(_0x228a2d,_0x931d21){_0x931d21=_0x931d21||0x1f4;return function(_0x4c3fd8){logger[_0xd1b8('0x25')](_0x4c3fd8[_0xd1b8('0x26')]);if(_0x4c3fd8[_0xd1b8('0x27')]){delete _0x4c3fd8[_0xd1b8('0x27')];}_0x228a2d['status'](_0x931d21)[_0xd1b8('0x28')](_0x4c3fd8);};}exports[_0xd1b8('0x29')]=function(_0x5ca7de,_0x39d265){var _0x452914={},_0x3bfe6c={},_0x4bd40f={'count':0x0,'rows':[]};var _0x1ee9d6=_['map'](db[_0xd1b8('0x2a')][_0xd1b8('0x2b')],function(_0x1d32f4){return{'name':_0x1d32f4[_0xd1b8('0x2c')],'type':_0x1d32f4[_0xd1b8('0x2d')][_0xd1b8('0x2e')]};});_0x3bfe6c[_0xd1b8('0x2f')]=_['map'](_0x1ee9d6,_0xd1b8('0x27'));_0x3bfe6c['query']=_['keys'](_0x5ca7de['query']);_0x3bfe6c['filters']=_[_0xd1b8('0x30')](_0x3bfe6c['model'],_0x3bfe6c[_0xd1b8('0x31')]);_0x452914[_0xd1b8('0x32')]=_[_0xd1b8('0x30')](_0x3bfe6c[_0xd1b8('0x2f')],qs['fields'](_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x33')]));_0x452914[_0xd1b8('0x32')]=_0x452914[_0xd1b8('0x32')][_0xd1b8('0x34')]?_0x452914[_0xd1b8('0x32')]:_0x3bfe6c[_0xd1b8('0x2f')];if(!_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x35')](_0xd1b8('0x36'))){_0x452914[_0xd1b8('0x1d')]=qs['limit'](_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x1d')]);_0x452914[_0xd1b8('0x1b')]=qs[_0xd1b8('0x1b')](_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x1b')]);}_0x452914[_0xd1b8('0x37')]=qs['sort'](_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x38')]);_0x452914[_0xd1b8('0x39')]=qs['filters'](_[_0xd1b8('0x3a')](_0x5ca7de[_0xd1b8('0x31')],_0x3bfe6c[_0xd1b8('0x3b')]),_0x1ee9d6);if(_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x3c')]){_0x452914['where']=_[_0xd1b8('0x3d')](_0x452914[_0xd1b8('0x39')],{'$or':_['map'](_0x1ee9d6,function(_0x55d1f2){if(_0x55d1f2[_0xd1b8('0x2d')]!==_0xd1b8('0x3e')){var _0x3cfac6={};_0x3cfac6[_0x55d1f2[_0xd1b8('0x27')]]={'$like':'%'+_0x5ca7de[_0xd1b8('0x31')][_0xd1b8('0x3c')]+'%'};return _0x3cfac6;}})});}_0x452914=_[_0xd1b8('0x3d')]({},_0x452914,_0x5ca7de[_0xd1b8('0x3f')]);var _0x40769b={'where':_0x452914[_0xd1b8('0x39')]};return db[_0xd1b8('0x2a')][_0xd1b8('0x1e')](_0x40769b)[_0xd1b8('0x24')](function(_0x5425a7){_0x4bd40f[_0xd1b8('0x1e')]=_0x5425a7;if(_0x5ca7de['query'][_0xd1b8('0x40')]){_0x452914['include']=[{'all':!![]}];}return db[_0xd1b8('0x2a')]['findAll'](_0x452914);})['then'](function(_0x32fe27){_0x4bd40f[_0xd1b8('0x41')]=_0x32fe27;return _0x4bd40f;})[_0xd1b8('0x24')](respondWithFilteredResult(_0x39d265,_0x452914))[_0xd1b8('0x42')](handleError(_0x39d265,null));};exports[_0xd1b8('0x43')]=function(_0x2c2288,_0x5984c0){var _0x4cc0d5={'raw':!![],'where':{'id':_0x2c2288[_0xd1b8('0x44')]['id']}},_0x5c921d={};_0x5c921d[_0xd1b8('0x2f')]=_[_0xd1b8('0x45')](db[_0xd1b8('0x2a')][_0xd1b8('0x2b')]);_0x5c921d['query']=_[_0xd1b8('0x45')](_0x2c2288[_0xd1b8('0x31')]);_0x5c921d[_0xd1b8('0x3b')]=_['intersection'](_0x5c921d[_0xd1b8('0x2f')],_0x5c921d[_0xd1b8('0x31')]);_0x4cc0d5[_0xd1b8('0x32')]=_['intersection'](_0x5c921d['model'],qs[_0xd1b8('0x33')](_0x2c2288[_0xd1b8('0x31')][_0xd1b8('0x33')]));_0x4cc0d5['attributes']=_0x4cc0d5[_0xd1b8('0x32')]['length']?_0x4cc0d5[_0xd1b8('0x32')]:_0x5c921d[_0xd1b8('0x2f')];if(_0x2c2288[_0xd1b8('0x31')]['includeAll']){_0x4cc0d5[_0xd1b8('0x46')]=[{'all':!![]}];}_0x4cc0d5=_[_0xd1b8('0x3d')]({},_0x4cc0d5,_0x2c2288[_0xd1b8('0x3f')]);return db[_0xd1b8('0x2a')][_0xd1b8('0x47')](_0x4cc0d5)[_0xd1b8('0x24')](handleEntityNotFound(_0x5984c0,null))[_0xd1b8('0x24')](respondWithResult(_0x5984c0,null))[_0xd1b8('0x42')](handleError(_0x5984c0,null));};exports[_0xd1b8('0x48')]=function(_0x2d04ea,_0x348ce1){return db['MailTransferReport']['create'](_0x2d04ea[_0xd1b8('0x49')],{})['then'](respondWithResult(_0x348ce1,0xc9))[_0xd1b8('0x42')](handleError(_0x348ce1,null));};exports[_0xd1b8('0x23')]=function(_0x5a4ea8,_0x14823d){if(_0x5a4ea8[_0xd1b8('0x49')]['id']){delete _0x5a4ea8[_0xd1b8('0x49')]['id'];}return db[_0xd1b8('0x2a')][_0xd1b8('0x47')]({'where':{'id':_0x5a4ea8['params']['id']}})[_0xd1b8('0x24')](handleEntityNotFound(_0x14823d,null))[_0xd1b8('0x24')](saveUpdates(_0x5a4ea8['body'],null))[_0xd1b8('0x24')](respondWithResult(_0x14823d,null))[_0xd1b8('0x42')](handleError(_0x14823d,null));};exports['destroy']=function(_0x2ff006,_0x4bae47){return db[_0xd1b8('0x2a')][_0xd1b8('0x47')]({'where':{'id':_0x2ff006[_0xd1b8('0x44')]['id']}})[_0xd1b8('0x24')](handleEntityNotFound(_0x4bae47,null))[_0xd1b8('0x24')](removeEntity(_0x4bae47,null))[_0xd1b8('0x42')](handleError(_0x4bae47,null));};exports[_0xd1b8('0x4a')]=function(_0x88d509,_0x22c09f){return db[_0xd1b8('0x2a')]['describe']()[_0xd1b8('0x24')](respondWithResult(_0x22c09f,null))[_0xd1b8('0x42')](handleError(_0x22c09f,null));}; \ No newline at end of file +var _0x9c4b=['../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','MailTransferReport','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3c7f8e,_0xfb0b44){var _0x4735c8=function(_0x3f4ac9){while(--_0x3f4ac9){_0x3c7f8e['push'](_0x3c7f8e['shift']());}};_0x4735c8(++_0xfb0b44);}(_0x9c4b,0x7e));var _0xb9c4=function(_0x3bda64,_0xbcdc32){_0x3bda64=_0x3bda64-0x0;var _0x184d63=_0x9c4b[_0x3bda64];return _0x184d63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9c4('0x0'));var zipdir=require(_0xb9c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9c4('0x2'));var moment=require(_0xb9c4('0x3'));var BPromise=require(_0xb9c4('0x4'));var Mustache=require(_0xb9c4('0x5'));var util=require('util');var path=require(_0xb9c4('0x6'));var sox=require(_0xb9c4('0x7'));var csv=require('to-csv');var ejs=require(_0xb9c4('0x8'));var fs=require('fs');var fs_extra=require(_0xb9c4('0x9'));var _=require(_0xb9c4('0xa'));var squel=require(_0xb9c4('0xb'));var crypto=require('crypto');var jsforce=require(_0xb9c4('0xc'));var deskjs=require(_0xb9c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9c4('0xe'));var Papa=require(_0xb9c4('0xf'));var Redis=require(_0xb9c4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb9c4('0x11'));var as=require(_0xb9c4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9c4('0x13'))('api');var utils=require(_0xb9c4('0x14'));var config=require(_0xb9c4('0x15'));var licenseUtil=require(_0xb9c4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6ed9,_0x513882){_0x513882=_0x513882||0xcc;return function(_0xf925dd){if(_0xf925dd){return _0x3e6ed9['sendStatus'](_0x513882);}return _0x3e6ed9['status'](_0x513882)[_0xb9c4('0x17')]();};}function respondWithResult(_0x424844,_0x26e9f3){_0x26e9f3=_0x26e9f3||0xc8;return function(_0x8e75b4){if(_0x8e75b4){return _0x424844['status'](_0x26e9f3)[_0xb9c4('0x18')](_0x8e75b4);}};}function respondWithFilteredResult(_0x19a9d5,_0x139dec){return function(_0x2c4e6d){if(_0x2c4e6d){var _0x1b9b31=typeof _0x139dec[_0xb9c4('0x19')]===_0xb9c4('0x1a')&&typeof _0x139dec[_0xb9c4('0x1b')]==='undefined';var _0x2bb632=_0x2c4e6d[_0xb9c4('0x1c')];var _0x5956d9=_0x1b9b31?0x0:_0x139dec[_0xb9c4('0x19')];var _0x5b95f5=_0x1b9b31?_0x2c4e6d[_0xb9c4('0x1c')]:_0x139dec[_0xb9c4('0x19')]+_0x139dec[_0xb9c4('0x1b')];var _0x5932e3;if(_0x5b95f5>=_0x2bb632){_0x5b95f5=_0x2bb632;_0x5932e3=0xc8;}else{_0x5932e3=0xce;}_0x19a9d5['status'](_0x5932e3);return _0x19a9d5[_0xb9c4('0x1d')]('Content-Range',_0x5956d9+'-'+_0x5b95f5+'/'+_0x2bb632)[_0xb9c4('0x18')](_0x2c4e6d);}return null;};}function patchUpdates(_0x512640){return function(_0x4310d2){try{jsonpatch[_0xb9c4('0x1e')](_0x4310d2,_0x512640,!![]);}catch(_0x18dafe){return BPromise[_0xb9c4('0x1f')](_0x18dafe);}return _0x4310d2[_0xb9c4('0x20')]();};}function saveUpdates(_0x43dac6,_0x236212){return function(_0x139a6d){if(_0x139a6d){return _0x139a6d[_0xb9c4('0x21')](_0x43dac6)[_0xb9c4('0x22')](function(_0x4d9ff7){return _0x4d9ff7;});}return null;};}function removeEntity(_0x3969ec,_0x4bcc0b){return function(_0x15093e){if(_0x15093e){return _0x15093e[_0xb9c4('0x23')]()[_0xb9c4('0x22')](function(){_0x3969ec[_0xb9c4('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1957e2,_0x3a23d9){return function(_0x2493e1){if(!_0x2493e1){_0x1957e2['sendStatus'](0x194);}return _0x2493e1;};}function handleError(_0x2dbc30,_0x1f9ed5){_0x1f9ed5=_0x1f9ed5||0x1f4;return function(_0x37f24b){logger[_0xb9c4('0x25')](_0x37f24b[_0xb9c4('0x26')]);if(_0x37f24b[_0xb9c4('0x27')]){delete _0x37f24b['name'];}_0x2dbc30[_0xb9c4('0x24')](_0x1f9ed5)[_0xb9c4('0x28')](_0x37f24b);};}exports[_0xb9c4('0x29')]=function(_0x57410e,_0x8f32){var _0x3ee46d={},_0x58ffff={},_0xb5d561={'count':0x0,'rows':[]};var _0xce4ebf=_[_0xb9c4('0x2a')](db[_0xb9c4('0x2b')][_0xb9c4('0x2c')],function(_0x17866e){return{'name':_0x17866e['fieldName'],'type':_0x17866e['type'][_0xb9c4('0x2d')]};});_0x58ffff['model']=_[_0xb9c4('0x2a')](_0xce4ebf,_0xb9c4('0x27'));_0x58ffff[_0xb9c4('0x2e')]=_[_0xb9c4('0x2f')](_0x57410e[_0xb9c4('0x2e')]);_0x58ffff['filters']=_[_0xb9c4('0x30')](_0x58ffff[_0xb9c4('0x31')],_0x58ffff['query']);_0x3ee46d['attributes']=_[_0xb9c4('0x30')](_0x58ffff['model'],qs['fields'](_0x57410e['query'][_0xb9c4('0x32')]));_0x3ee46d[_0xb9c4('0x33')]=_0x3ee46d[_0xb9c4('0x33')][_0xb9c4('0x34')]?_0x3ee46d[_0xb9c4('0x33')]:_0x58ffff[_0xb9c4('0x31')];if(!_0x57410e['query'][_0xb9c4('0x35')]('nolimit')){_0x3ee46d[_0xb9c4('0x1b')]=qs[_0xb9c4('0x1b')](_0x57410e[_0xb9c4('0x2e')][_0xb9c4('0x1b')]);_0x3ee46d[_0xb9c4('0x19')]=qs[_0xb9c4('0x19')](_0x57410e[_0xb9c4('0x2e')][_0xb9c4('0x19')]);}_0x3ee46d[_0xb9c4('0x36')]=qs[_0xb9c4('0x37')](_0x57410e[_0xb9c4('0x2e')][_0xb9c4('0x37')]);_0x3ee46d[_0xb9c4('0x38')]=qs[_0xb9c4('0x39')](_[_0xb9c4('0x3a')](_0x57410e[_0xb9c4('0x2e')],_0x58ffff['filters']),_0xce4ebf);if(_0x57410e['query']['filter']){_0x3ee46d['where']=_[_0xb9c4('0x3b')](_0x3ee46d['where'],{'$or':_[_0xb9c4('0x2a')](_0xce4ebf,function(_0x264fad){if(_0x264fad[_0xb9c4('0x3c')]!==_0xb9c4('0x3d')){var _0x643d61={};_0x643d61[_0x264fad[_0xb9c4('0x27')]]={'$like':'%'+_0x57410e[_0xb9c4('0x2e')]['filter']+'%'};return _0x643d61;}})});}_0x3ee46d=_['merge']({},_0x3ee46d,_0x57410e[_0xb9c4('0x3e')]);var _0x20708a={'where':_0x3ee46d[_0xb9c4('0x38')]};return db[_0xb9c4('0x2b')][_0xb9c4('0x1c')](_0x20708a)[_0xb9c4('0x22')](function(_0x7fd484){_0xb5d561['count']=_0x7fd484;if(_0x57410e[_0xb9c4('0x2e')][_0xb9c4('0x3f')]){_0x3ee46d['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x3ee46d);})['then'](function(_0x398d06){_0xb5d561[_0xb9c4('0x40')]=_0x398d06;return _0xb5d561;})[_0xb9c4('0x22')](respondWithFilteredResult(_0x8f32,_0x3ee46d))['catch'](handleError(_0x8f32,null));};exports[_0xb9c4('0x41')]=function(_0x945759,_0x562243){var _0x46b34b={'raw':!![],'where':{'id':_0x945759[_0xb9c4('0x42')]['id']}},_0x2bc6cb={};_0x2bc6cb[_0xb9c4('0x31')]=_['keys'](db[_0xb9c4('0x2b')]['rawAttributes']);_0x2bc6cb[_0xb9c4('0x2e')]=_['keys'](_0x945759[_0xb9c4('0x2e')]);_0x2bc6cb[_0xb9c4('0x39')]=_['intersection'](_0x2bc6cb[_0xb9c4('0x31')],_0x2bc6cb['query']);_0x46b34b[_0xb9c4('0x33')]=_[_0xb9c4('0x30')](_0x2bc6cb['model'],qs[_0xb9c4('0x32')](_0x945759[_0xb9c4('0x2e')]['fields']));_0x46b34b['attributes']=_0x46b34b[_0xb9c4('0x33')]['length']?_0x46b34b[_0xb9c4('0x33')]:_0x2bc6cb[_0xb9c4('0x31')];if(_0x945759[_0xb9c4('0x2e')]['includeAll']){_0x46b34b[_0xb9c4('0x43')]=[{'all':!![]}];}_0x46b34b=_[_0xb9c4('0x3b')]({},_0x46b34b,_0x945759[_0xb9c4('0x3e')]);return db['MailTransferReport'][_0xb9c4('0x44')](_0x46b34b)[_0xb9c4('0x22')](handleEntityNotFound(_0x562243,null))[_0xb9c4('0x22')](respondWithResult(_0x562243,null))[_0xb9c4('0x45')](handleError(_0x562243,null));};exports[_0xb9c4('0x46')]=function(_0x59606b,_0x36d2a5){return db['MailTransferReport'][_0xb9c4('0x46')](_0x59606b[_0xb9c4('0x47')],{})[_0xb9c4('0x22')](respondWithResult(_0x36d2a5,0xc9))['catch'](handleError(_0x36d2a5,null));};exports[_0xb9c4('0x21')]=function(_0x185563,_0x5dc8f1){if(_0x185563[_0xb9c4('0x47')]['id']){delete _0x185563[_0xb9c4('0x47')]['id'];}return db[_0xb9c4('0x2b')][_0xb9c4('0x44')]({'where':{'id':_0x185563[_0xb9c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x5dc8f1,null))[_0xb9c4('0x22')](saveUpdates(_0x185563[_0xb9c4('0x47')],null))[_0xb9c4('0x22')](respondWithResult(_0x5dc8f1,null))[_0xb9c4('0x45')](handleError(_0x5dc8f1,null));};exports[_0xb9c4('0x23')]=function(_0x761eda,_0x43e641){return db[_0xb9c4('0x2b')][_0xb9c4('0x44')]({'where':{'id':_0x761eda['params']['id']}})[_0xb9c4('0x22')](handleEntityNotFound(_0x43e641,null))[_0xb9c4('0x22')](removeEntity(_0x43e641,null))['catch'](handleError(_0x43e641,null));};exports[_0xb9c4('0x48')]=function(_0x39fc4f,_0x2ff1a9){return db[_0xb9c4('0x2b')][_0xb9c4('0x48')]()['then'](respondWithResult(_0x2ff1a9,null))['catch'](handleError(_0x2ff1a9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e19809e..a5e98c5 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 _0xfafb=['exports','define','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfaf('0x0'));var util=require('util');var logger=require(_0xbfaf('0x1'))(_0xbfaf('0x2'));var moment=require(_0xbfaf('0x3'));var BPromise=require(_0xbfaf('0x4'));var rp=require(_0xbfaf('0x5'));var fs=require('fs');var path=require(_0xbfaf('0x6'));var rimraf=require(_0xbfaf('0x7'));var config=require(_0xbfaf('0x8'));var attributes=require(_0xbfaf('0x9'));module[_0xbfaf('0xa')]=function(_0x2a1938,_0x48b48c){return _0x2a1938[_0xbfaf('0xb')]('MailTransferReport',attributes,{'tableName':_0xbfaf('0xc'),'paranoid':![],'indexes':[{'name':_0xbfaf('0xd'),'fields':[_0xbfaf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc61=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','MailTransferReport'];(function(_0x48422a,_0x143564){var _0x14fec5=function(_0x4ece1e){while(--_0x4ece1e){_0x48422a['push'](_0x48422a['shift']());}};_0x14fec5(++_0x143564);}(_0xbc61,0x1b2));var _0x1bc6=function(_0x4c055e,_0x47eaec){_0x4c055e=_0x4c055e-0x0;var _0x18cd27=_0xbc61[_0x4c055e];return _0x18cd27;};'use strict';var _=require(_0x1bc6('0x0'));var util=require(_0x1bc6('0x1'));var logger=require(_0x1bc6('0x2'))(_0x1bc6('0x3'));var moment=require('moment');var BPromise=require(_0x1bc6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bc6('0x5'));var rimraf=require(_0x1bc6('0x6'));var config=require('../../config/environment');var attributes=require(_0x1bc6('0x7'));module[_0x1bc6('0x8')]=function(_0x23c00e,_0x15da49){return _0x23c00e['define'](_0x1bc6('0x9'),attributes,{'tableName':_0x1bc6('0xa'),'paranoid':![],'indexes':[{'name':_0x1bc6('0xb'),'fields':[_0x1bc6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6d666fd..2f480b0 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 _0x9354=['../../config/logger','../../config/environment','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x53d54e,_0x2fda89){var _0x980b33=function(_0x230ae1){while(--_0x230ae1){_0x53d54e['push'](_0x53d54e['shift']());}};_0x980b33(++_0x2fda89);}(_0x9354,0xf6));var _0x4935=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9354[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x4935('0x0'));var util=require(_0x4935('0x1'));var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rs=require(_0x4935('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4935('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4935('0x6'))('rpc');var config=require(_0x4935('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4935('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x548b40,_0x30d295,_0x122307){return new BPromise(function(_0x43aa2e,_0x4d53e4){return client[_0x4935('0x9')](_0x548b40,_0x122307)['then'](function(_0x52ca69){logger[_0x4935('0xa')](_0x4935('0xb'),_0x30d295,_0x4935('0xc'));logger[_0x4935('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x30d295,_0x4935('0xc'),JSON[_0x4935('0xe')](_0x52ca69));if(_0x52ca69[_0x4935('0xf')]){if(_0x52ca69[_0x4935('0xf')][_0x4935('0x10')]===0x1f4){logger[_0x4935('0xf')](_0x4935('0xb'),_0x30d295,_0x52ca69[_0x4935('0xf')][_0x4935('0x11')]);return _0x4d53e4(_0x52ca69['error'][_0x4935('0x11')]);}logger[_0x4935('0xf')](_0x4935('0xb'),_0x30d295,_0x52ca69[_0x4935('0xf')][_0x4935('0x11')]);return _0x43aa2e(_0x52ca69[_0x4935('0xf')]['message']);}else{logger['info'](_0x4935('0xb'),_0x30d295,_0x4935('0xc'));_0x43aa2e(_0x52ca69['result'][_0x4935('0x11')]);}})['catch'](function(_0x5519ba){logger[_0x4935('0xf')](_0x4935('0xb'),_0x30d295,_0x5519ba);_0x4d53e4(_0x5519ba);});});} \ No newline at end of file +var _0x3cb0=['randomstring','ioredis','../../mysqldb','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x3cb0,0xf5));var _0x03cb=function(_0x74722f,_0x490089){_0x74722f=_0x74722f-0x0;var _0x2f4fcf=_0x3cb0[_0x74722f];return _0x2f4fcf;};'use strict';var _=require('lodash');var util=require(_0x03cb('0x0'));var moment=require('moment');var BPromise=require(_0x03cb('0x1'));var rs=require(_0x03cb('0x2'));var fs=require('fs');var Redis=require(_0x03cb('0x3'));var db=require(_0x03cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x03cb('0x5'));var client=jayson[_0x03cb('0x6')][_0x03cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x231a55,_0x5c5978,_0x257872){return new BPromise(function(_0x9ae477,_0x425e56){return client['request'](_0x231a55,_0x257872)[_0x03cb('0x8')](function(_0x5d3f6b){logger[_0x03cb('0x9')](_0x03cb('0xa'),_0x5c5978,_0x03cb('0xb'));logger[_0x03cb('0xc')](_0x03cb('0xd'),_0x5c5978,'request\x20sent',JSON['stringify'](_0x5d3f6b));if(_0x5d3f6b['error']){if(_0x5d3f6b[_0x03cb('0xe')][_0x03cb('0xf')]===0x1f4){logger[_0x03cb('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x5c5978,_0x5d3f6b['error'][_0x03cb('0x10')]);return _0x425e56(_0x5d3f6b[_0x03cb('0xe')][_0x03cb('0x10')]);}logger[_0x03cb('0xe')](_0x03cb('0xa'),_0x5c5978,_0x5d3f6b[_0x03cb('0xe')][_0x03cb('0x10')]);return _0x9ae477(_0x5d3f6b['error'][_0x03cb('0x10')]);}else{logger['info'](_0x03cb('0xa'),_0x5c5978,_0x03cb('0xb'));_0x9ae477(_0x5d3f6b[_0x03cb('0x11')]['message']);}})[_0x03cb('0x12')](function(_0x323b13){logger['error'](_0x03cb('0xa'),_0x5c5978,_0x323b13);_0x425e56(_0x323b13);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 8000450..6d42b19 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 _0x2347=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x2347,0x1c8));var _0x7234=function(_0x41c3ac,_0x35c6e7){_0x41c3ac=_0x41c3ac-0x0;var _0x4aaccd=_0x2347[_0x41c3ac];return _0x4aaccd;};'use strict';var multer=require(_0x7234('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7234('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7234('0x2'));var auth=require(_0x7234('0x3'));var interaction=require(_0x7234('0x4'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x7234('0x5')]('/',auth[_0x7234('0x6')](),controller[_0x7234('0x7')]);router[_0x7234('0x5')](_0x7234('0x8'),auth[_0x7234('0x6')](),controller[_0x7234('0x9')]);router[_0x7234('0x5')](_0x7234('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7234('0xb')]('/',auth[_0x7234('0x6')](),controller['create']);router[_0x7234('0xc')]('/:id',auth[_0x7234('0x6')](),controller[_0x7234('0xd')]);router[_0x7234('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7234('0xf')]);module[_0x7234('0x10')]=router; \ No newline at end of file +var _0xec42=['/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get'];(function(_0x7fe308,_0x4ffc8c){var _0x312c3d=function(_0x38bc9b){while(--_0x38bc9b){_0x7fe308['push'](_0x7fe308['shift']());}};_0x312c3d(++_0x4ffc8c);}(_0xec42,0x15d));var _0x2ec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec42[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2ec4('0x0'));var util=require(_0x2ec4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2ec4('0x2'));var router=express[_0x2ec4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2ec4('0x4'));var interaction=require(_0x2ec4('0x5'));var config=require(_0x2ec4('0x6'));var controller=require(_0x2ec4('0x7'));router['get']('/',auth[_0x2ec4('0x8')](),controller[_0x2ec4('0x9')]);router[_0x2ec4('0xa')](_0x2ec4('0xb'),auth[_0x2ec4('0x8')](),controller[_0x2ec4('0xc')]);router['get'](_0x2ec4('0xd'),auth[_0x2ec4('0x8')](),controller['show']);router[_0x2ec4('0xe')]('/',auth[_0x2ec4('0x8')](),controller[_0x2ec4('0xf')]);router[_0x2ec4('0x10')]('/:id',auth[_0x2ec4('0x8')](),controller[_0x2ec4('0x11')]);router[_0x2ec4('0x12')](_0x2ec4('0xd'),auth[_0x2ec4('0x8')](),controller['destroy']);module[_0x2ec4('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 331e7ca..d3712cc 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 _0xf2ff=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0xf2ff,0xb5));var _0xff2f=function(_0x17332a,_0x34e3bd){_0x17332a=_0x17332a-0x0;var _0x2f4caa=_0xf2ff[_0x17332a];return _0x2f4caa;};'use strict';var Sequelize=require(_0xff2f('0x0'));var moment=require('moment');module[_0xff2f('0x1')]={'channel':{'type':Sequelize[_0xff2f('0x2')]},'membername':{'type':Sequelize[_0xff2f('0x2')]},'interface':{'type':Sequelize[_0xff2f('0x2')]},'type':{'type':Sequelize[_0xff2f('0x2')],'defaultValue':_0xff2f('0x3'),'comment':_0xff2f('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xff2f('0x5')]},'exitAt':{'type':Sequelize[_0xff2f('0x5')],'set':function(_0x2899b2){var _0x16bff1=moment(_0x2899b2);var _0xd17d9=moment(this[_0xff2f('0x6')]('enterAt'));var _0x1b133e=_0x16bff1[_0xff2f('0x7')](_0xd17d9,'seconds');this[_0xff2f('0x8')]('exitAt',_0x2899b2);this[_0xff2f('0x8')](_0xff2f('0x9'),_0x1b133e>=0x0?_0x1b133e:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xff2f('0x2')],'comment':_0xff2f('0xa')},'data3':{'type':Sequelize[_0xff2f('0x2')],'comment':_0xff2f('0xb')},'data4':{'type':Sequelize[_0xff2f('0x2')],'comment':_0xff2f('0xc')},'data5':{'type':Sequelize[_0xff2f('0x2')],'comment':_0xff2f('0xd')},'role':{'type':Sequelize[_0xff2f('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xff2f('0x2')]}}; \ No newline at end of file +var _0x59a7=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','diff','seconds','setDataValue','exitAt','talk:[dial\x20string]','talk:[queue]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x59a7,0x179));var _0x759a=function(_0x4bbde4,_0x1c5b38){_0x4bbde4=_0x4bbde4-0x0;var _0x1bc1ef=_0x59a7[_0x4bbde4];return _0x1bc1ef;};'use strict';var Sequelize=require(_0x759a('0x0'));var moment=require(_0x759a('0x1'));module[_0x759a('0x2')]={'channel':{'type':Sequelize[_0x759a('0x3')]},'membername':{'type':Sequelize[_0x759a('0x3')]},'interface':{'type':Sequelize[_0x759a('0x3')]},'type':{'type':Sequelize[_0x759a('0x3')],'defaultValue':_0x759a('0x4'),'comment':_0x759a('0x5')},'duration':{'type':Sequelize[_0x759a('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x18b195){var _0x557c62=moment(_0x18b195);var _0x486c50=moment(this['getDataValue']('enterAt'));var _0xbe6af6=_0x557c62[_0x759a('0x7')](_0x486c50,_0x759a('0x8'));this[_0x759a('0x9')](_0x759a('0xa'),_0x18b195);this[_0x759a('0x9')]('duration',_0xbe6af6>=0x0?_0xbe6af6:null);}},'data1':{'type':Sequelize[_0x759a('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x759a('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x759a('0xb')},'data5':{'type':Sequelize['STRING'],'comment':_0x759a('0xc')},'role':{'type':Sequelize[_0x759a('0x3')]},'internal':{'type':Sequelize[_0x759a('0x6')]},'uniqueid':{'type':Sequelize[_0x759a('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index fc0b32b..56059f3 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55ca,0x126));var _0xa55c=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x55ca[_0x2298f0];return _0x39b136;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x55ca,0x126));var _0xa55c=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0x55ca[_0x529296];return _0x1796bf;};'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 f93dcfd..4c4ea30 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 _0xcc00=['define','membername_interface','membername','interface','lodash','../../config/logger','api','moment','request-promise','./memberReport.attributes','exports'];(function(_0x2e5f15,_0x5c62c0){var _0x4624b4=function(_0x5bf871){while(--_0x5bf871){_0x2e5f15['push'](_0x2e5f15['shift']());}};_0x4624b4(++_0x5c62c0);}(_0xcc00,0x12d));var _0x0cc0=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xcc00[_0x335271];return _0xa9fff8;};'use strict';var _=require(_0x0cc0('0x0'));var util=require('util');var logger=require(_0x0cc0('0x1'))(_0x0cc0('0x2'));var moment=require(_0x0cc0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0cc0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0cc0('0x5'));module[_0x0cc0('0x6')]=function(_0x3b5b16,_0x379cf4){return _0x3b5b16[_0x0cc0('0x7')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x0cc0('0x8'),'fields':[_0x0cc0('0x9'),_0x0cc0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9bc=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_member','membername_interface','interface'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xb9bc,0x144));var _0xcb9b=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0xb9bc[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0xcb9b('0x0'));var util=require(_0xcb9b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcb9b('0x2'));var BPromise=require(_0xcb9b('0x3'));var rp=require(_0xcb9b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb9b('0x5'));var config=require(_0xcb9b('0x6'));var attributes=require('./memberReport.attributes');module[_0xcb9b('0x7')]=function(_0x1cfa9d,_0x42cd53){return _0x1cfa9d[_0xcb9b('0x8')]('MemberReport',attributes,{'tableName':_0xcb9b('0x9'),'paranoid':![],'indexes':[{'name':_0xcb9b('0xa'),'fields':['membername',_0xcb9b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index aea37cf..1ab41b8 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 _0x2178=['info','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','raw','options','where','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','create','body','debug','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x354842,_0x123c71){var _0x10c8b4=function(_0x2690eb){while(--_0x2690eb){_0x354842['push'](_0x354842['shift']());}};_0x10c8b4(++_0x123c71);}(_0x2178,0x1b0));var _0x8217=function(_0x1927dc,_0x235225){_0x1927dc=_0x1927dc-0x0;var _0x4882dc=_0x2178[_0x1927dc];return _0x4882dc;};'use strict';var _=require(_0x8217('0x0'));var util=require('util');var moment=require(_0x8217('0x1'));var BPromise=require(_0x8217('0x2'));var rs=require(_0x8217('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8217('0x4'))['db'];var utils=require(_0x8217('0x5'));var logger=require('../../config/logger')(_0x8217('0x6'));var config=require(_0x8217('0x7'));var jayson=require(_0x8217('0x8'));var client=jayson[_0x8217('0x9')][_0x8217('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6938ca,_0x1100c8,_0x1cddd1){return new BPromise(function(_0x67d6b2,_0x5d1987){return client['request'](_0x6938ca,_0x1cddd1)[_0x8217('0xb')](function(_0x26e802){logger[_0x8217('0xc')]('MemberReport,\x20%s,\x20%s',_0x1100c8,_0x8217('0xd'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1100c8,_0x8217('0xd'),JSON[_0x8217('0xe')](_0x26e802));if(_0x26e802[_0x8217('0xf')]){if(_0x26e802[_0x8217('0xf')][_0x8217('0x10')]===0x1f4){logger[_0x8217('0xf')](_0x8217('0x11'),_0x1100c8,_0x26e802['error']['message']);return _0x5d1987(_0x26e802['error'][_0x8217('0x12')]);}logger[_0x8217('0xf')](_0x8217('0x11'),_0x1100c8,_0x26e802[_0x8217('0xf')]['message']);return _0x67d6b2(_0x26e802[_0x8217('0xf')][_0x8217('0x12')]);}else{logger[_0x8217('0xc')]('MemberReport,\x20%s,\x20%s',_0x1100c8,_0x8217('0xd'));_0x67d6b2(_0x26e802[_0x8217('0x13')][_0x8217('0x12')]);}})[_0x8217('0x14')](function(_0xe4d1ea){logger[_0x8217('0xf')](_0x8217('0x11'),_0x1100c8,_0xe4d1ea);_0x5d1987(_0xe4d1ea);});});}exports['GetMemberReport']=function(_0x407924){var _0x373d65=this;return new Promise(function(_0x5a46c2,_0x93bc83){return db[_0x8217('0x15')]['findAll']({'raw':_0x407924['options']?_0x407924['options'][_0x8217('0x16')]===undefined?!![]:![]:!![],'where':_0x407924[_0x8217('0x17')]?_0x407924[_0x8217('0x17')][_0x8217('0x18')]||null:null,'attributes':_0x407924['options']?_0x407924[_0x8217('0x17')][_0x8217('0x19')]||null:null,'limit':_0x407924[_0x8217('0x17')]?_0x407924[_0x8217('0x17')][_0x8217('0x1a')]||null:null,'include':_0x407924[_0x8217('0x17')]?_0x407924['options'][_0x8217('0x1b')]?_[_0x8217('0x1c')](_0x407924['options'][_0x8217('0x1b')],function(_0x2dead6){return{'model':db[_0x2dead6[_0x8217('0x1d')]],'as':_0x2dead6['as'],'attributes':_0x2dead6[_0x8217('0x19')],'include':_0x2dead6[_0x8217('0x1b')]?_[_0x8217('0x1c')](_0x2dead6['include'],function(_0x5087fb){return{'model':db[_0x5087fb[_0x8217('0x1d')]],'as':_0x5087fb['as'],'attributes':_0x5087fb[_0x8217('0x19')],'include':_0x5087fb[_0x8217('0x1b')]?_[_0x8217('0x1c')](_0x5087fb[_0x8217('0x1b')],function(_0x55a324){return{'model':db[_0x55a324[_0x8217('0x1d')]],'as':_0x55a324['as'],'attributes':_0x55a324[_0x8217('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8217('0xb')](function(_0x1f5838){logger['info'](_0x8217('0x1e'),_0x407924);logger['debug'](_0x8217('0x1e'),_0x407924,JSON[_0x8217('0xe')](_0x1f5838));_0x5a46c2(_0x1f5838);})[_0x8217('0x14')](function(_0x15ff1d){logger['error'](_0x8217('0x1e'),_0x15ff1d[_0x8217('0x12')],_0x407924);_0x93bc83(_0x373d65[_0x8217('0xf')](0x1f4,_0x15ff1d[_0x8217('0x12')]));});});};exports[_0x8217('0x1f')]=function(_0x234312){var _0x38d858=this;return new Promise(function(_0x5d5217,_0x538955){return db[_0x8217('0x15')][_0x8217('0x20')](_0x234312[_0x8217('0x21')],{'raw':_0x234312['options']?_0x234312[_0x8217('0x17')][_0x8217('0x16')]===undefined?!![]:![]:!![]})[_0x8217('0xb')](function(_0x14536b){logger[_0x8217('0xc')](_0x8217('0x1f'),_0x234312);logger[_0x8217('0x22')](_0x8217('0x1f'),_0x234312,JSON[_0x8217('0xe')](_0x14536b));_0x5d5217(_0x14536b);})[_0x8217('0x14')](function(_0x9af85d){logger['error'](_0x8217('0x1f'),_0x9af85d[_0x8217('0x12')],_0x234312);_0x538955(_0x38d858[_0x8217('0xf')](0x1f4,_0x9af85d[_0x8217('0x12')]));});});};exports[_0x8217('0x23')]=function(_0x2d304c){var _0x49b05c=this;return new Promise(function(_0x2e178e,_0x44cecf){return db[_0x8217('0x15')][_0x8217('0x24')](_0x2d304c[_0x8217('0x21')],{'raw':_0x2d304c[_0x8217('0x17')]?_0x2d304c[_0x8217('0x17')][_0x8217('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d304c[_0x8217('0x17')]?_0x2d304c[_0x8217('0x17')][_0x8217('0x18')]||null:null,'attributes':_0x2d304c[_0x8217('0x17')]?_0x2d304c['options'][_0x8217('0x19')]||null:null,'limit':_0x2d304c[_0x8217('0x17')]?_0x2d304c[_0x8217('0x17')][_0x8217('0x1a')]||null:null})[_0x8217('0xb')](function(_0x314a63){logger[_0x8217('0xc')](_0x8217('0x23'),_0x2d304c);logger[_0x8217('0x22')]('UpdateMemberReport',_0x2d304c,JSON['stringify'](_0x314a63));_0x2e178e(_0x314a63);})['catch'](function(_0x10fec4){logger['error']('UpdateMemberReport',_0x10fec4['message'],_0x2d304c);_0x44cecf(_0x49b05c[_0x8217('0xf')](0x1f4,_0x10fec4[_0x8217('0x12')]));});});}; \ No newline at end of file +var _0x48e3=['result','GetMemberReport','options','raw','where','limit','map','include','model','attributes','catch','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x48e3,0xe9));var _0x348e=function(_0x229acf,_0x5d38ab){_0x229acf=_0x229acf-0x0;var _0x2aa8e9=_0x48e3[_0x229acf];return _0x2aa8e9;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var moment=require('moment');var BPromise=require(_0x348e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x348e('0x3'))['db'];var utils=require(_0x348e('0x4'));var logger=require(_0x348e('0x5'))(_0x348e('0x6'));var config=require('../../config/environment');var jayson=require(_0x348e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13b150,_0x5afaa1,_0x5919ce){return new BPromise(function(_0x33295b,_0x5d908f){return client[_0x348e('0x8')](_0x13b150,_0x5919ce)[_0x348e('0x9')](function(_0x16ec91){logger[_0x348e('0xa')](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));logger[_0x348e('0xd')](_0x348e('0xe'),_0x5afaa1,_0x348e('0xc'),JSON[_0x348e('0xf')](_0x16ec91));if(_0x16ec91[_0x348e('0x10')]){if(_0x16ec91[_0x348e('0x10')][_0x348e('0x11')]===0x1f4){logger[_0x348e('0x10')]('MemberReport,\x20%s,\x20%s',_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x5d908f(_0x16ec91[_0x348e('0x10')]['message']);}logger[_0x348e('0x10')](_0x348e('0xb'),_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x33295b(_0x16ec91[_0x348e('0x10')]['message']);}else{logger['info'](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));_0x33295b(_0x16ec91[_0x348e('0x13')][_0x348e('0x12')]);}})['catch'](function(_0x378442){logger['error'](_0x348e('0xb'),_0x5afaa1,_0x378442);_0x5d908f(_0x378442);});});}exports[_0x348e('0x14')]=function(_0x409ea8){var _0x57a6fa=this;return new Promise(function(_0x2326bc,_0x548e17){return db['MemberReport']['findAll']({'raw':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'where':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['attributes']||null:null,'limit':_0x409ea8['options']?_0x409ea8[_0x348e('0x15')][_0x348e('0x18')]||null:null,'include':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['include']?_[_0x348e('0x19')](_0x409ea8[_0x348e('0x15')][_0x348e('0x1a')],function(_0x4a5a84){return{'model':db[_0x4a5a84[_0x348e('0x1b')]],'as':_0x4a5a84['as'],'attributes':_0x4a5a84[_0x348e('0x1c')],'include':_0x4a5a84[_0x348e('0x1a')]?_['map'](_0x4a5a84[_0x348e('0x1a')],function(_0x845e7f){return{'model':db[_0x845e7f[_0x348e('0x1b')]],'as':_0x845e7f['as'],'attributes':_0x845e7f['attributes'],'include':_0x845e7f[_0x348e('0x1a')]?_[_0x348e('0x19')](_0x845e7f[_0x348e('0x1a')],function(_0x23bed7){return{'model':db[_0x23bed7['model']],'as':_0x23bed7['as'],'attributes':_0x23bed7[_0x348e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x348e('0x9')](function(_0x13eabb){logger[_0x348e('0xa')](_0x348e('0x14'),_0x409ea8);logger[_0x348e('0xd')](_0x348e('0x14'),_0x409ea8,JSON['stringify'](_0x13eabb));_0x2326bc(_0x13eabb);})[_0x348e('0x1d')](function(_0xcf7f99){logger['error'](_0x348e('0x14'),_0xcf7f99[_0x348e('0x12')],_0x409ea8);_0x548e17(_0x57a6fa['error'](0x1f4,_0xcf7f99[_0x348e('0x12')]));});});};exports[_0x348e('0x1e')]=function(_0x4b6dc4){var _0x408641=this;return new Promise(function(_0x369740,_0x2f909d){return db[_0x348e('0x1f')][_0x348e('0x20')](_0x4b6dc4[_0x348e('0x21')],{'raw':_0x4b6dc4[_0x348e('0x15')]?_0x4b6dc4['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x191ccd){logger[_0x348e('0xa')](_0x348e('0x1e'),_0x4b6dc4);logger['debug'](_0x348e('0x1e'),_0x4b6dc4,JSON['stringify'](_0x191ccd));_0x369740(_0x191ccd);})['catch'](function(_0x251b0e){logger[_0x348e('0x10')](_0x348e('0x1e'),_0x251b0e[_0x348e('0x12')],_0x4b6dc4);_0x2f909d(_0x408641['error'](0x1f4,_0x251b0e[_0x348e('0x12')]));});});};exports[_0x348e('0x22')]=function(_0x1742f9){var _0x990733=this;return new Promise(function(_0x445c30,_0x3a3b2c){return db[_0x348e('0x1f')][_0x348e('0x23')](_0x1742f9['body'],{'raw':_0x1742f9['options']?_0x1742f9[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x1742f9[_0x348e('0x15')]?_0x1742f9['options'][_0x348e('0x1c')]||null:null,'limit':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')]['limit']||null:null})[_0x348e('0x9')](function(_0xca0c30){logger[_0x348e('0xa')](_0x348e('0x22'),_0x1742f9);logger[_0x348e('0xd')](_0x348e('0x22'),_0x1742f9,JSON[_0x348e('0xf')](_0xca0c30));_0x445c30(_0xca0c30);})['catch'](function(_0x37a7e7){logger[_0x348e('0x10')]('UpdateMemberReport',_0x37a7e7[_0x348e('0x12')],_0x1742f9);_0x3a3b2c(_0x990733[_0x348e('0x10')](0x1f4,_0x37a7e7[_0x348e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index c2503ed..331dc94 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 _0x3258=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path'];(function(_0x5bb206,_0x4477b3){var _0xe809db=function(_0x55f007){while(--_0x55f007){_0x5bb206['push'](_0x5bb206['shift']());}};_0xe809db(++_0x4477b3);}(_0x3258,0x135));var _0x8325=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3258[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var path=require(_0x8325('0x2'));var timeout=require(_0x8325('0x3'));var express=require(_0x8325('0x4'));var router=express[_0x8325('0x5')]();var fs_extra=require(_0x8325('0x6'));var auth=require(_0x8325('0x7'));var interaction=require(_0x8325('0x8'));var config=require(_0x8325('0x9'));var controller=require(_0x8325('0xa'));router[_0x8325('0xb')]('/',controller['index']);module[_0x8325('0xc')]=router; \ No newline at end of file +var _0xb512=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get'];(function(_0x423351,_0x1282bb){var _0xf6db1f=function(_0x3bdf3a){while(--_0x3bdf3a){_0x423351['push'](_0x423351['shift']());}};_0xf6db1f(++_0x1282bb);}(_0xb512,0xe6));var _0x2b51=function(_0x309018,_0x1bf79f){_0x309018=_0x309018-0x0;var _0xb2ee94=_0xb512[_0x309018];return _0xb2ee94;};'use strict';var multer=require(_0x2b51('0x0'));var util=require(_0x2b51('0x1'));var path=require(_0x2b51('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b51('0x3'));var router=express[_0x2b51('0x4')]();var fs_extra=require(_0x2b51('0x5'));var auth=require(_0x2b51('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2b51('0x7'));var controller=require(_0x2b51('0x8'));router[_0x2b51('0x9')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d633760..837138c 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 _0xeef6=['STRING','version','sequelize','exports'];(function(_0x15bb8e,_0x287e72){var _0x21550d=function(_0x15370d){while(--_0x15370d){_0x15bb8e['push'](_0x15bb8e['shift']());}};_0x21550d(++_0x287e72);}(_0xeef6,0xb6));var _0x6eef=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xeef6[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x6eef('0x0'));module[_0x6eef('0x1')]={'version':{'type':Sequelize[_0x6eef('0x2')],'unique':_0x6eef('0x3')}}; \ No newline at end of file +var _0x3f55=['version','sequelize','STRING'];(function(_0x47e57e,_0x34a5a1){var _0x1daff3=function(_0x36c6a0){while(--_0x36c6a0){_0x47e57e['push'](_0x47e57e['shift']());}};_0x1daff3(++_0x34a5a1);}(_0x3f55,0xd3));var _0x53f5=function(_0x3bf04a,_0x56ed90){_0x3bf04a=_0x3bf04a-0x0;var _0x241e4b=_0x3f55[_0x3bf04a];return _0x241e4b;};'use strict';var Sequelize=require(_0x53f5('0x0'));module['exports']={'version':{'type':Sequelize[_0x53f5('0x1')],'unique':_0x53f5('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index d4ed8d2..0f44212 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 _0x23fa=['json','apply','reject','save','update','then','stack','name','send','index','map','Migration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23fa,0x183));var _0xa23f=function(_0x324dd8,_0xdb542c){_0x324dd8=_0x324dd8-0x0;var _0x5a20af=_0x23fa[_0x324dd8];return _0x5a20af;};'use strict';var emlformat=require(_0xa23f('0x0'));var rimraf=require(_0xa23f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa23f('0x2'));var rp=require(_0xa23f('0x3'));var moment=require(_0xa23f('0x4'));var BPromise=require(_0xa23f('0x5'));var Mustache=require(_0xa23f('0x6'));var util=require('util');var path=require(_0xa23f('0x7'));var sox=require(_0xa23f('0x8'));var csv=require('to-csv');var ejs=require(_0xa23f('0x9'));var fs=require('fs');var fs_extra=require(_0xa23f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa23f('0xb'));var jsforce=require(_0xa23f('0xc'));var deskjs=require(_0xa23f('0xd'));var toCsv=require(_0xa23f('0xe'));var querystring=require(_0xa23f('0xf'));var Papa=require(_0xa23f('0x10'));var Redis=require('ioredis');var authService=require(_0xa23f('0x11'));var qs=require(_0xa23f('0x12'));var as=require(_0xa23f('0x13'));var hardwareService=require(_0xa23f('0x14'));var logger=require(_0xa23f('0x15'))(_0xa23f('0x16'));var utils=require('../../config/utils');var config=require(_0xa23f('0x17'));var licenseUtil=require(_0xa23f('0x18'));var db=require(_0xa23f('0x19'))['db'];function respondWithStatusCode(_0x1804f9,_0x5728ba){_0x5728ba=_0x5728ba||0xcc;return function(_0x4c5d78){if(_0x4c5d78){return _0x1804f9[_0xa23f('0x1a')](_0x5728ba);}return _0x1804f9[_0xa23f('0x1b')](_0x5728ba)[_0xa23f('0x1c')]();};}function respondWithResult(_0x88ed9f,_0x156e3d){_0x156e3d=_0x156e3d||0xc8;return function(_0x38cfad){if(_0x38cfad){return _0x88ed9f['status'](_0x156e3d)['json'](_0x38cfad);}};}function respondWithFilteredResult(_0x3fa4db,_0xd6c960){return function(_0x5eb31f){if(_0x5eb31f){var _0x13818b=typeof _0xd6c960[_0xa23f('0x1d')]===_0xa23f('0x1e')&&typeof _0xd6c960['limit']===_0xa23f('0x1e');var _0x1a5a50=_0x5eb31f[_0xa23f('0x1f')];var _0x946f8f=_0x13818b?0x0:_0xd6c960[_0xa23f('0x1d')];var _0x30383a=_0x13818b?_0x5eb31f[_0xa23f('0x1f')]:_0xd6c960[_0xa23f('0x1d')]+_0xd6c960['limit'];var _0x594848;if(_0x30383a>=_0x1a5a50){_0x30383a=_0x1a5a50;_0x594848=0xc8;}else{_0x594848=0xce;}_0x3fa4db[_0xa23f('0x1b')](_0x594848);return _0x3fa4db['set'](_0xa23f('0x20'),_0x946f8f+'-'+_0x30383a+'/'+_0x1a5a50)[_0xa23f('0x21')](_0x5eb31f);}return null;};}function patchUpdates(_0x45c4f4){return function(_0x1e9d4b){try{jsonpatch[_0xa23f('0x22')](_0x1e9d4b,_0x45c4f4,!![]);}catch(_0x460301){return BPromise[_0xa23f('0x23')](_0x460301);}return _0x1e9d4b[_0xa23f('0x24')]();};}function saveUpdates(_0x2403d3,_0xc31295){return function(_0x1851d8){if(_0x1851d8){return _0x1851d8[_0xa23f('0x25')](_0x2403d3)[_0xa23f('0x26')](function(_0x2e0d05){return _0x2e0d05;});}return null;};}function removeEntity(_0x2ae08b,_0x2df0ce){return function(_0x1e3871){if(_0x1e3871){return _0x1e3871['destroy']()[_0xa23f('0x26')](function(){_0x2ae08b['status'](0xcc)[_0xa23f('0x1c')]();});}};}function handleEntityNotFound(_0x54f22d,_0x54ce2a){return function(_0x536bfe){if(!_0x536bfe){_0x54f22d['sendStatus'](0x194);}return _0x536bfe;};}function handleError(_0x2e0f1a,_0x285a14){_0x285a14=_0x285a14||0x1f4;return function(_0x27f971){logger['error'](_0x27f971[_0xa23f('0x27')]);if(_0x27f971[_0xa23f('0x28')]){delete _0x27f971[_0xa23f('0x28')];}_0x2e0f1a[_0xa23f('0x1b')](_0x285a14)[_0xa23f('0x29')](_0x27f971);};}exports[_0xa23f('0x2a')]=function(_0x288a3a,_0x1b0997){var _0x51c70a={},_0x5a080d={},_0x211014={'count':0x0,'rows':[]};var _0x5adf7f=_[_0xa23f('0x2b')](db[_0xa23f('0x2c')]['rawAttributes'],function(_0x36b3d6){return{'name':_0x36b3d6[_0xa23f('0x2d')],'type':_0x36b3d6[_0xa23f('0x2e')][_0xa23f('0x2f')]};});_0x5a080d[_0xa23f('0x30')]=_[_0xa23f('0x2b')](_0x5adf7f,_0xa23f('0x28'));_0x5a080d[_0xa23f('0x31')]=_[_0xa23f('0x32')](_0x288a3a[_0xa23f('0x31')]);_0x5a080d[_0xa23f('0x33')]=_[_0xa23f('0x34')](_0x5a080d[_0xa23f('0x30')],_0x5a080d[_0xa23f('0x31')]);_0x51c70a[_0xa23f('0x35')]=_[_0xa23f('0x34')](_0x5a080d[_0xa23f('0x30')],qs[_0xa23f('0x36')](_0x288a3a['query'][_0xa23f('0x36')]));_0x51c70a[_0xa23f('0x35')]=_0x51c70a['attributes'][_0xa23f('0x37')]?_0x51c70a[_0xa23f('0x35')]:_0x5a080d['model'];if(!_0x288a3a[_0xa23f('0x31')][_0xa23f('0x38')](_0xa23f('0x39'))){_0x51c70a[_0xa23f('0x3a')]=qs['limit'](_0x288a3a['query']['limit']);_0x51c70a[_0xa23f('0x1d')]=qs[_0xa23f('0x1d')](_0x288a3a[_0xa23f('0x31')]['offset']);}_0x51c70a[_0xa23f('0x3b')]=qs[_0xa23f('0x3c')](_0x288a3a['query'][_0xa23f('0x3c')]);_0x51c70a['where']=qs[_0xa23f('0x33')](_[_0xa23f('0x3d')](_0x288a3a[_0xa23f('0x31')],_0x5a080d[_0xa23f('0x33')]),_0x5adf7f);if(_0x288a3a[_0xa23f('0x31')][_0xa23f('0x3e')]){_0x51c70a['where']=_[_0xa23f('0x3f')](_0x51c70a[_0xa23f('0x40')],{'$or':_[_0xa23f('0x2b')](_0x5adf7f,function(_0x54141a){if(_0x54141a['type']!=='VIRTUAL'){var _0x24cf86={};_0x24cf86[_0x54141a['name']]={'$like':'%'+_0x288a3a[_0xa23f('0x31')][_0xa23f('0x3e')]+'%'};return _0x24cf86;}})});}_0x51c70a=_['merge']({},_0x51c70a,_0x288a3a['options']);var _0x14dc48={'where':_0x51c70a[_0xa23f('0x40')]};return db[_0xa23f('0x2c')][_0xa23f('0x1f')](_0x14dc48)['then'](function(_0x1db8c8){_0x211014[_0xa23f('0x1f')]=_0x1db8c8;if(_0x288a3a[_0xa23f('0x31')][_0xa23f('0x41')]){_0x51c70a[_0xa23f('0x42')]=[{'all':!![]}];}return db[_0xa23f('0x2c')][_0xa23f('0x43')](_0x51c70a);})['then'](function(_0x44303d){_0x211014[_0xa23f('0x44')]=_0x44303d;return _0x211014;})['then'](respondWithFilteredResult(_0x1b0997,_0x51c70a))[_0xa23f('0x45')](handleError(_0x1b0997,null));}; \ No newline at end of file +var _0x7243=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','Migration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x240934,_0x13feed){var _0x4eb458=function(_0x1311ac){while(--_0x1311ac){_0x240934['push'](_0x240934['shift']());}};_0x4eb458(++_0x13feed);}(_0x7243,0x7d));var _0x3724=function(_0x504313,_0x4c6765){_0x504313=_0x504313-0x0;var _0x280f39=_0x7243[_0x504313];return _0x280f39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3724('0x0'));var zipdir=require(_0x3724('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3724('0x2'));var BPromise=require(_0x3724('0x3'));var Mustache=require(_0x3724('0x4'));var util=require(_0x3724('0x5'));var path=require(_0x3724('0x6'));var sox=require('sox');var csv=require(_0x3724('0x7'));var ejs=require(_0x3724('0x8'));var fs=require('fs');var fs_extra=require(_0x3724('0x9'));var _=require(_0x3724('0xa'));var squel=require(_0x3724('0xb'));var crypto=require(_0x3724('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3724('0xd'));var toCsv=require(_0x3724('0x7'));var querystring=require(_0x3724('0xe'));var Papa=require(_0x3724('0xf'));var Redis=require(_0x3724('0x10'));var authService=require(_0x3724('0x11'));var qs=require(_0x3724('0x12'));var as=require(_0x3724('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3724('0x14'))(_0x3724('0x15'));var utils=require(_0x3724('0x16'));var config=require(_0x3724('0x17'));var licenseUtil=require(_0x3724('0x18'));var db=require(_0x3724('0x19'))['db'];function respondWithStatusCode(_0x215755,_0x1625f3){_0x1625f3=_0x1625f3||0xcc;return function(_0x245837){if(_0x245837){return _0x215755[_0x3724('0x1a')](_0x1625f3);}return _0x215755['status'](_0x1625f3)['end']();};}function respondWithResult(_0x1b2604,_0x5b1495){_0x5b1495=_0x5b1495||0xc8;return function(_0x4ad4ec){if(_0x4ad4ec){return _0x1b2604[_0x3724('0x1b')](_0x5b1495)[_0x3724('0x1c')](_0x4ad4ec);}};}function respondWithFilteredResult(_0x44a4e3,_0x1c7741){return function(_0x4b0ae7){if(_0x4b0ae7){var _0x451869=typeof _0x1c7741[_0x3724('0x1d')]===_0x3724('0x1e')&&typeof _0x1c7741[_0x3724('0x1f')]===_0x3724('0x1e');var _0x1db760=_0x4b0ae7[_0x3724('0x20')];var _0x22a104=_0x451869?0x0:_0x1c7741[_0x3724('0x1d')];var _0x3a706e=_0x451869?_0x4b0ae7['count']:_0x1c7741['offset']+_0x1c7741[_0x3724('0x1f')];var _0x39322d;if(_0x3a706e>=_0x1db760){_0x3a706e=_0x1db760;_0x39322d=0xc8;}else{_0x39322d=0xce;}_0x44a4e3['status'](_0x39322d);return _0x44a4e3[_0x3724('0x21')](_0x3724('0x22'),_0x22a104+'-'+_0x3a706e+'/'+_0x1db760)[_0x3724('0x1c')](_0x4b0ae7);}return null;};}function patchUpdates(_0x35f85d){return function(_0x1d092e){try{jsonpatch[_0x3724('0x23')](_0x1d092e,_0x35f85d,!![]);}catch(_0x4a286f){return BPromise[_0x3724('0x24')](_0x4a286f);}return _0x1d092e[_0x3724('0x25')]();};}function saveUpdates(_0x39ef73,_0x1399fd){return function(_0x5c97a8){if(_0x5c97a8){return _0x5c97a8[_0x3724('0x26')](_0x39ef73)['then'](function(_0x5dce07){return _0x5dce07;});}return null;};}function removeEntity(_0xaf709b,_0x1703ce){return function(_0x4cc0e9){if(_0x4cc0e9){return _0x4cc0e9[_0x3724('0x27')]()[_0x3724('0x28')](function(){_0xaf709b[_0x3724('0x1b')](0xcc)[_0x3724('0x29')]();});}};}function handleEntityNotFound(_0x4785d2,_0x3b7cac){return function(_0x4a0c2f){if(!_0x4a0c2f){_0x4785d2['sendStatus'](0x194);}return _0x4a0c2f;};}function handleError(_0x44c80f,_0x1ab474){_0x1ab474=_0x1ab474||0x1f4;return function(_0x5d65be){logger[_0x3724('0x2a')](_0x5d65be[_0x3724('0x2b')]);if(_0x5d65be[_0x3724('0x2c')]){delete _0x5d65be[_0x3724('0x2c')];}_0x44c80f['status'](_0x1ab474)['send'](_0x5d65be);};}exports[_0x3724('0x2d')]=function(_0x119c8c,_0x26e60c){var _0x1da7a8={},_0x4a8f5b={},_0x31140c={'count':0x0,'rows':[]};var _0x2e465b=_['map'](db[_0x3724('0x2e')][_0x3724('0x2f')],function(_0xbf2050){return{'name':_0xbf2050[_0x3724('0x30')],'type':_0xbf2050[_0x3724('0x31')][_0x3724('0x32')]};});_0x4a8f5b[_0x3724('0x33')]=_[_0x3724('0x34')](_0x2e465b,_0x3724('0x2c'));_0x4a8f5b[_0x3724('0x35')]=_[_0x3724('0x36')](_0x119c8c[_0x3724('0x35')]);_0x4a8f5b[_0x3724('0x37')]=_[_0x3724('0x38')](_0x4a8f5b[_0x3724('0x33')],_0x4a8f5b[_0x3724('0x35')]);_0x1da7a8[_0x3724('0x39')]=_[_0x3724('0x38')](_0x4a8f5b['model'],qs[_0x3724('0x3a')](_0x119c8c['query']['fields']));_0x1da7a8['attributes']=_0x1da7a8['attributes'][_0x3724('0x3b')]?_0x1da7a8['attributes']:_0x4a8f5b[_0x3724('0x33')];if(!_0x119c8c[_0x3724('0x35')][_0x3724('0x3c')](_0x3724('0x3d'))){_0x1da7a8['limit']=qs[_0x3724('0x1f')](_0x119c8c[_0x3724('0x35')]['limit']);_0x1da7a8[_0x3724('0x1d')]=qs[_0x3724('0x1d')](_0x119c8c[_0x3724('0x35')][_0x3724('0x1d')]);}_0x1da7a8[_0x3724('0x3e')]=qs[_0x3724('0x3f')](_0x119c8c['query']['sort']);_0x1da7a8[_0x3724('0x40')]=qs[_0x3724('0x37')](_['pick'](_0x119c8c[_0x3724('0x35')],_0x4a8f5b[_0x3724('0x37')]),_0x2e465b);if(_0x119c8c['query'][_0x3724('0x41')]){_0x1da7a8[_0x3724('0x40')]=_['merge'](_0x1da7a8['where'],{'$or':_[_0x3724('0x34')](_0x2e465b,function(_0x5db868){if(_0x5db868[_0x3724('0x31')]!==_0x3724('0x42')){var _0x2afe2d={};_0x2afe2d[_0x5db868['name']]={'$like':'%'+_0x119c8c['query'][_0x3724('0x41')]+'%'};return _0x2afe2d;}})});}_0x1da7a8=_[_0x3724('0x43')]({},_0x1da7a8,_0x119c8c[_0x3724('0x44')]);var _0x4b7cbf={'where':_0x1da7a8[_0x3724('0x40')]};return db[_0x3724('0x2e')]['count'](_0x4b7cbf)[_0x3724('0x28')](function(_0x15cb34){_0x31140c['count']=_0x15cb34;if(_0x119c8c[_0x3724('0x35')]['includeAll']){_0x1da7a8[_0x3724('0x45')]=[{'all':!![]}];}return db['Migration'][_0x3724('0x46')](_0x1da7a8);})[_0x3724('0x28')](function(_0x8df92){_0x31140c[_0x3724('0x47')]=_0x8df92;return _0x31140c;})['then'](respondWithFilteredResult(_0x26e60c,_0x1da7a8))[_0x3724('0x48')](handleError(_0x26e60c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f104d8a..343dad4 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 _0x835f=['api','moment','bluebird','request-promise','path','rimraf','./migration.attributes','define','Migration','migrations','lodash','util'];(function(_0x23f8c8,_0xb536b9){var _0x3dc718=function(_0x25d719){while(--_0x25d719){_0x23f8c8['push'](_0x23f8c8['shift']());}};_0x3dc718(++_0xb536b9);}(_0x835f,0x11e));var _0xf835=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x835f[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xf835('0x0'));var util=require(_0xf835('0x1'));var logger=require('../../config/logger')(_0xf835('0x2'));var moment=require(_0xf835('0x3'));var BPromise=require(_0xf835('0x4'));var rp=require(_0xf835('0x5'));var fs=require('fs');var path=require(_0xf835('0x6'));var rimraf=require(_0xf835('0x7'));var config=require('../../config/environment');var attributes=require(_0xf835('0x8'));module['exports']=function(_0x3ceac6,_0x29418b){return _0x3ceac6[_0xf835('0x9')](_0xf835('0xa'),attributes,{'tableName':_0xf835('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5062=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','bluebird','path'];(function(_0x5e9641,_0x3c4c2f){var _0x4a98ea=function(_0x1cbc82){while(--_0x1cbc82){_0x5e9641['push'](_0x5e9641['shift']());}};_0x4a98ea(++_0x3c4c2f);}(_0x5062,0x14b));var _0x2506=function(_0x5e1577,_0x463a23){_0x5e1577=_0x5e1577-0x0;var _0x57e3b1=_0x5062[_0x5e1577];return _0x57e3b1;};'use strict';var _=require(_0x2506('0x0'));var util=require(_0x2506('0x1'));var logger=require(_0x2506('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2506('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2506('0x4'));var rimraf=require(_0x2506('0x5'));var config=require(_0x2506('0x6'));var attributes=require(_0x2506('0x7'));module[_0x2506('0x8')]=function(_0x2b0645,_0x32ae2c){return _0x2b0645[_0x2506('0x9')](_0x2506('0xa'),attributes,{'tableName':_0x2506('0xb'),'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 6741507..a587eb3 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 _0xde13=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x43d2a5,_0x1e7b89){var _0x50f164=function(_0xbc2a10){while(--_0xbc2a10){_0x43d2a5['push'](_0x43d2a5['shift']());}};_0x50f164(++_0x1e7b89);}(_0xde13,0x146));var _0x3de1=function(_0x399ab2,_0x244bee){_0x399ab2=_0x399ab2-0x0;var _0x5750d6=_0xde13[_0x399ab2];return _0x5750d6;};'use strict';var _=require(_0x3de1('0x0'));var util=require(_0x3de1('0x1'));var moment=require(_0x3de1('0x2'));var BPromise=require(_0x3de1('0x3'));var rs=require(_0x3de1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3de1('0x5'))['db'];var utils=require(_0x3de1('0x6'));var logger=require(_0x3de1('0x7'))('rpc');var config=require(_0x3de1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3de1('0x9')][_0x3de1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2169,_0x34291a,_0x5f1aff){return new BPromise(function(_0x11df45,_0x41b5bb){return client[_0x3de1('0xb')](_0x3d2169,_0x5f1aff)['then'](function(_0x4eb503){logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));logger[_0x3de1('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x34291a,_0x3de1('0xd'),JSON[_0x3de1('0xf')](_0x4eb503));if(_0x4eb503[_0x3de1('0x10')]){if(_0x4eb503['error']['code']===0x1f4){logger[_0x3de1('0x10')]('Migration,\x20%s,\x20%s',_0x34291a,_0x4eb503['error']['message']);return _0x41b5bb(_0x4eb503[_0x3de1('0x10')][_0x3de1('0x11')]);}logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x4eb503['error'][_0x3de1('0x11')]);return _0x11df45(_0x4eb503['error'][_0x3de1('0x11')]);}else{logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));_0x11df45(_0x4eb503[_0x3de1('0x12')]['message']);}})[_0x3de1('0x13')](function(_0x25f619){logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x25f619);_0x41b5bb(_0x25f619);});});} \ No newline at end of file +var _0x24cf=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3a77c7,_0x3ce314){var _0x264db4=function(_0x2c0291){while(--_0x2c0291){_0x3a77c7['push'](_0x3a77c7['shift']());}};_0x264db4(++_0x3ce314);}(_0x24cf,0x1d5));var _0xf24c=function(_0x32824a,_0xb95c09){_0x32824a=_0x32824a-0x0;var _0x93e43d=_0x24cf[_0x32824a];return _0x93e43d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 01b4ea1..22b67f2 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 _0xd868=['Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x5514fd,_0x3f53fe){var _0x36d74a=function(_0x2f41b2){while(--_0x2f41b2){_0x5514fd['push'](_0x5514fd['shift']());}};_0x36d74a(++_0x3f53fe);}(_0xd868,0x1ec));var _0x8d86=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xd868[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x8d86('0x0'));var util=require('util');var path=require(_0x8d86('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d86('0x2')]();var fs_extra=require(_0x8d86('0x3'));var auth=require(_0x8d86('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8d86('0x5'));var controller=require(_0x8d86('0x6'));router['get']('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0x8')]);router[_0x8d86('0x9')](_0x8d86('0xa'),auth[_0x8d86('0x7')](),controller[_0x8d86('0xb')]);router[_0x8d86('0xc')]('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0xd')]);router[_0x8d86('0xe')](_0x8d86('0xa'),auth[_0x8d86('0x7')](),controller[_0x8d86('0xf')]);router[_0x8d86('0x10')](_0x8d86('0xa'),auth[_0x8d86('0x7')](),controller[_0x8d86('0x11')]);module[_0x8d86('0x12')]=router; \ No newline at end of file +var _0x43d6=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x43d6,0xe9));var _0x643d=function(_0x195d18,_0x1dddb4){_0x195d18=_0x195d18-0x0;var _0x33b0cd=_0x43d6[_0x195d18];return _0x33b0cd;};'use strict';var multer=require(_0x643d('0x0'));var util=require('util');var path=require(_0x643d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x643d('0x2')]();var fs_extra=require(_0x643d('0x3'));var auth=require(_0x643d('0x4'));var interaction=require(_0x643d('0x5'));var config=require('../../config/environment');var controller=require(_0x643d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x643d('0x7')]);router[_0x643d('0x8')]('/:id',auth[_0x643d('0x9')](),controller[_0x643d('0xa')]);router[_0x643d('0xb')]('/',auth[_0x643d('0x9')](),controller[_0x643d('0xc')]);router[_0x643d('0xd')](_0x643d('0xe'),auth[_0x643d('0x9')](),controller[_0x643d('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x643d('0x10')]);module[_0x643d('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b4b74fd..f80ec23 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 _0x4244=['STRING','exports','ENUM','externip','stun','turn'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4244,0x109));var _0x4424=function(_0x306287,_0x37c1b8){_0x306287=_0x306287-0x0;var _0x1166e1=_0x4244[_0x306287];return _0x1166e1;};'use strict';var Sequelize=require('sequelize');module[_0x4424('0x0')]={'type':{'type':Sequelize[_0x4424('0x1')]('localnet',_0x4424('0x2'),_0x4424('0x3'),_0x4424('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4424('0x5')]},'password':{'type':Sequelize[_0x4424('0x5')]}}; \ No newline at end of file +var _0x11bb=['sequelize','externip','stun','turn','STRING'];(function(_0x3b3156,_0x89606a){var _0x236c5a=function(_0x2bac2d){while(--_0x2bac2d){_0x3b3156['push'](_0x3b3156['shift']());}};_0x236c5a(++_0x89606a);}(_0x11bb,0x73));var _0xb11b=function(_0x4d8715,_0x2809d8){_0x4d8715=_0x4d8715-0x0;var _0x23611e=_0x11bb[_0x4d8715];return _0x23611e;};'use strict';var Sequelize=require(_0xb11b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet',_0xb11b('0x1'),_0xb11b('0x2'),_0xb11b('0x3'))},'value':{'type':Sequelize[_0xb11b('0x4')]},'username':{'type':Sequelize[_0xb11b('0x4')]},'password':{'type':Sequelize[_0xb11b('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e1c0e46..9134b7a 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 _0x0d06=['intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','Network','includeAll','include','findAll','rows','show','params','keys','find','create','sequelize','transaction','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0d06,0x94));var _0x60d0=function(_0x5b4303,_0x225e71){_0x5b4303=_0x5b4303-0x0;var _0x1aacba=_0x0d06[_0x5b4303];return _0x1aacba;};'use strict';var emlformat=require(_0x60d0('0x0'));var rimraf=require(_0x60d0('0x1'));var zipdir=require(_0x60d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60d0('0x3'));var moment=require(_0x60d0('0x4'));var BPromise=require(_0x60d0('0x5'));var Mustache=require('mustache');var util=require(_0x60d0('0x6'));var path=require(_0x60d0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x60d0('0x8'));var fs=require('fs');var fs_extra=require(_0x60d0('0x9'));var _=require(_0x60d0('0xa'));var squel=require(_0x60d0('0xb'));var crypto=require('crypto');var jsforce=require(_0x60d0('0xc'));var deskjs=require(_0x60d0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x60d0('0xe'));var Redis=require('ioredis');var authService=require(_0x60d0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x60d0('0x10'));var hardwareService=require(_0x60d0('0x11'));var logger=require(_0x60d0('0x12'))(_0x60d0('0x13'));var utils=require(_0x60d0('0x14'));var config=require(_0x60d0('0x15'));var licenseUtil=require(_0x60d0('0x16'));var db=require(_0x60d0('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e2a96,_0x362227,_0x4e815b,_0xccf5f4){return new BPromise(function(_0x15332e,_0x428f40){var _0x5efd68=_0xccf5f4||client;return _0x5efd68['request'](_0x3e2a96,_0x4e815b)[_0x60d0('0x18')](function(_0x3c41b3){logger[_0x60d0('0x19')](_0x60d0('0x1a'),_0x362227,'request\x20sent');logger[_0x60d0('0x1b')](_0x60d0('0x1c'),_0x362227,_0x60d0('0x1d'),JSON[_0x60d0('0x1e')](_0x3c41b3));if(_0x3c41b3[_0x60d0('0x1f')]){if(_0x3c41b3[_0x60d0('0x1f')][_0x60d0('0x20')]===0x1f4){logger[_0x60d0('0x1f')](_0x60d0('0x1a'),_0x362227,_0x3c41b3[_0x60d0('0x1f')]['message']);return _0x428f40(_0x3c41b3[_0x60d0('0x1f')][_0x60d0('0x21')]);}logger[_0x60d0('0x1f')](_0x60d0('0x1a'),_0x362227,_0x3c41b3[_0x60d0('0x1f')][_0x60d0('0x21')]);return _0x15332e(_0x3c41b3[_0x60d0('0x1f')][_0x60d0('0x21')]);}else{logger[_0x60d0('0x19')](_0x60d0('0x1a'),_0x362227,_0x60d0('0x1d'));_0x15332e(_0x3c41b3[_0x60d0('0x22')][_0x60d0('0x21')]);}})[_0x60d0('0x23')](function(_0x2e1b4e){logger[_0x60d0('0x1f')]('Network,\x20%s,\x20%s',_0x362227,_0x2e1b4e);_0x428f40(_0x2e1b4e);});});}function respondWithStatusCode(_0x337edc,_0x473b8c){_0x473b8c=_0x473b8c||0xcc;return function(_0x151d32){if(_0x151d32){return _0x337edc[_0x60d0('0x24')](_0x473b8c);}return _0x337edc[_0x60d0('0x25')](_0x473b8c)[_0x60d0('0x26')]();};}function respondWithResult(_0x3d7e4f,_0x4301ef){_0x4301ef=_0x4301ef||0xc8;return function(_0x261678){if(_0x261678){return _0x3d7e4f[_0x60d0('0x25')](_0x4301ef)[_0x60d0('0x27')](_0x261678);}};}function respondWithFilteredResult(_0x2c4321,_0x54c85d){return function(_0x507f54){if(_0x507f54){var _0x298712=typeof _0x54c85d[_0x60d0('0x28')]===_0x60d0('0x29')&&typeof _0x54c85d[_0x60d0('0x2a')]===_0x60d0('0x29');var _0x503a01=_0x507f54[_0x60d0('0x2b')];var _0x4fc325=_0x298712?0x0:_0x54c85d[_0x60d0('0x28')];var _0x3f72a6=_0x298712?_0x507f54[_0x60d0('0x2b')]:_0x54c85d['offset']+_0x54c85d[_0x60d0('0x2a')];var _0x28803a;if(_0x3f72a6>=_0x503a01){_0x3f72a6=_0x503a01;_0x28803a=0xc8;}else{_0x28803a=0xce;}_0x2c4321[_0x60d0('0x25')](_0x28803a);return _0x2c4321[_0x60d0('0x2c')](_0x60d0('0x2d'),_0x4fc325+'-'+_0x3f72a6+'/'+_0x503a01)['json'](_0x507f54);}return null;};}function patchUpdates(_0x55139a){return function(_0x530f14){try{jsonpatch[_0x60d0('0x2e')](_0x530f14,_0x55139a,!![]);}catch(_0x49c730){return BPromise[_0x60d0('0x2f')](_0x49c730);}return _0x530f14[_0x60d0('0x30')]();};}function saveUpdates(_0x3688dc,_0x14b4f8){return function(_0x14affa){if(_0x14affa){return _0x14affa[_0x60d0('0x31')](_0x3688dc)[_0x60d0('0x18')](function(_0x40b4e7){return _0x40b4e7;});}return null;};}function removeEntity(_0x43888d,_0xaf52b9){return function(_0x1a21e3){if(_0x1a21e3){return _0x1a21e3[_0x60d0('0x32')]()[_0x60d0('0x18')](function(){_0x43888d['status'](0xcc)[_0x60d0('0x26')]();});}};}function handleEntityNotFound(_0x4df590,_0x4f47cc){return function(_0x2f5bca){if(!_0x2f5bca){_0x4df590[_0x60d0('0x24')](0x194);}return _0x2f5bca;};}function handleError(_0x4ce579,_0x322964){_0x322964=_0x322964||0x1f4;return function(_0x263f43){logger[_0x60d0('0x1f')](_0x263f43[_0x60d0('0x33')]);if(_0x263f43[_0x60d0('0x34')]){delete _0x263f43['name'];}_0x4ce579[_0x60d0('0x25')](_0x322964)[_0x60d0('0x35')](_0x263f43);};}exports[_0x60d0('0x36')]=function(_0x1fe300,_0x46c4a8){var _0x37c5b5={},_0x1415ec={},_0x13ca67={'count':0x0,'rows':[]};var _0x598c57=_[_0x60d0('0x37')](db['Network'][_0x60d0('0x38')],function(_0x18a6ba){return{'name':_0x18a6ba[_0x60d0('0x39')],'type':_0x18a6ba[_0x60d0('0x3a')]['key']};});_0x1415ec[_0x60d0('0x3b')]=_[_0x60d0('0x37')](_0x598c57,_0x60d0('0x34'));_0x1415ec[_0x60d0('0x3c')]=_['keys'](_0x1fe300['query']);_0x1415ec[_0x60d0('0x3d')]=_[_0x60d0('0x3e')](_0x1415ec[_0x60d0('0x3b')],_0x1415ec[_0x60d0('0x3c')]);_0x37c5b5[_0x60d0('0x3f')]=_[_0x60d0('0x3e')](_0x1415ec[_0x60d0('0x3b')],qs[_0x60d0('0x40')](_0x1fe300['query'][_0x60d0('0x40')]));_0x37c5b5[_0x60d0('0x3f')]=_0x37c5b5[_0x60d0('0x3f')][_0x60d0('0x41')]?_0x37c5b5[_0x60d0('0x3f')]:_0x1415ec[_0x60d0('0x3b')];if(!_0x1fe300['query'][_0x60d0('0x42')]('nolimit')){_0x37c5b5[_0x60d0('0x2a')]=qs[_0x60d0('0x2a')](_0x1fe300[_0x60d0('0x3c')][_0x60d0('0x2a')]);_0x37c5b5[_0x60d0('0x28')]=qs[_0x60d0('0x28')](_0x1fe300[_0x60d0('0x3c')][_0x60d0('0x28')]);}_0x37c5b5['order']=qs['sort'](_0x1fe300['query'][_0x60d0('0x43')]);_0x37c5b5[_0x60d0('0x44')]=qs[_0x60d0('0x3d')](_['pick'](_0x1fe300[_0x60d0('0x3c')],_0x1415ec[_0x60d0('0x3d')]),_0x598c57);if(_0x1fe300[_0x60d0('0x3c')][_0x60d0('0x45')]){_0x37c5b5[_0x60d0('0x44')]=_['merge'](_0x37c5b5[_0x60d0('0x44')],{'$or':_[_0x60d0('0x37')](_0x598c57,function(_0x79b3b7){if(_0x79b3b7[_0x60d0('0x3a')]!=='VIRTUAL'){var _0x3ff9b2={};_0x3ff9b2[_0x79b3b7['name']]={'$like':'%'+_0x1fe300[_0x60d0('0x3c')][_0x60d0('0x45')]+'%'};return _0x3ff9b2;}})});}_0x37c5b5=_[_0x60d0('0x46')]({},_0x37c5b5,_0x1fe300[_0x60d0('0x47')]);var _0x809739={'where':_0x37c5b5[_0x60d0('0x44')]};return db[_0x60d0('0x48')][_0x60d0('0x2b')](_0x809739)['then'](function(_0x20733c){_0x13ca67[_0x60d0('0x2b')]=_0x20733c;if(_0x1fe300[_0x60d0('0x3c')][_0x60d0('0x49')]){_0x37c5b5[_0x60d0('0x4a')]=[{'all':!![]}];}return db['Network'][_0x60d0('0x4b')](_0x37c5b5);})['then'](function(_0x33a68a){_0x13ca67[_0x60d0('0x4c')]=_0x33a68a;return _0x13ca67;})[_0x60d0('0x18')](respondWithFilteredResult(_0x46c4a8,_0x37c5b5))[_0x60d0('0x23')](handleError(_0x46c4a8,null));};exports[_0x60d0('0x4d')]=function(_0xedc34b,_0x473940){var _0x12e02a={'raw':!![],'where':{'id':_0xedc34b[_0x60d0('0x4e')]['id']}},_0x221d52={};_0x221d52[_0x60d0('0x3b')]=_['keys'](db[_0x60d0('0x48')][_0x60d0('0x38')]);_0x221d52['query']=_[_0x60d0('0x4f')](_0xedc34b[_0x60d0('0x3c')]);_0x221d52[_0x60d0('0x3d')]=_[_0x60d0('0x3e')](_0x221d52[_0x60d0('0x3b')],_0x221d52[_0x60d0('0x3c')]);_0x12e02a[_0x60d0('0x3f')]=_[_0x60d0('0x3e')](_0x221d52[_0x60d0('0x3b')],qs[_0x60d0('0x40')](_0xedc34b[_0x60d0('0x3c')][_0x60d0('0x40')]));_0x12e02a[_0x60d0('0x3f')]=_0x12e02a[_0x60d0('0x3f')][_0x60d0('0x41')]?_0x12e02a[_0x60d0('0x3f')]:_0x221d52[_0x60d0('0x3b')];if(_0xedc34b[_0x60d0('0x3c')][_0x60d0('0x49')]){_0x12e02a[_0x60d0('0x4a')]=[{'all':!![]}];}_0x12e02a=_[_0x60d0('0x46')]({},_0x12e02a,_0xedc34b[_0x60d0('0x47')]);return db[_0x60d0('0x48')][_0x60d0('0x50')](_0x12e02a)[_0x60d0('0x18')](handleEntityNotFound(_0x473940,null))['then'](respondWithResult(_0x473940,null))[_0x60d0('0x23')](handleError(_0x473940,null));};exports[_0x60d0('0x51')]=function(_0xd3001,_0x24cc1c,_0x21ac14){var _0x16cc7b;return db[_0x60d0('0x52')][_0x60d0('0x53')](function(_0x562b79){return db[_0x60d0('0x48')][_0x60d0('0x51')](_0xd3001[_0x60d0('0x54')],{'raw':!![]})[_0x60d0('0x18')](function(_0x538dc9){_0x16cc7b=_0x538dc9;return db[_0x60d0('0x48')][_0x60d0('0x4b')]({'where':{'type':_0xd3001['body'][_0x60d0('0x3a')]},'raw':!![]});})[_0x60d0('0x18')](function(_0x248743){if(_0x16cc7b['type']['toUpperCase']()==_0x60d0('0x55')){var _0x53b5c4=fs['readFileSync'](path[_0x60d0('0x56')](config[_0x60d0('0x57')],_0x60d0('0x58')),_0x60d0('0x59'));var _0x1cb537=ejs[_0x60d0('0x5a')](_0x53b5c4,{'networks':_0x248743||[]});fs[_0x60d0('0x5b')]('/etc/asterisk/stun_xcally.conf',_0x1cb537);return respondWithRpcPromise(_0x60d0('0x5c'),'create',{'module':_0x60d0('0x5d')});}else if(_0x16cc7b['type'][_0x60d0('0x5e')]()==_0x60d0('0x5f')){var _0x1aa199=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config[_0x60d0('0x57')],_0x60d0('0x61')),'utf8');var _0x3918c6=ejs[_0x60d0('0x5a')](_0x1aa199,{'networks':_0x248743||[]});fs[_0x60d0('0x5b')](_0x60d0('0x62'),_0x3918c6);return respondWithRpcPromise(_0x60d0('0x5c'),'create',{'module':_0x60d0('0x5d')});}else{var _0x392a2b=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config['root'],_0x60d0('0x63')),_0x60d0('0x59'));var _0x2083a9=ejs[_0x60d0('0x5a')](_0x392a2b,{'networks':_0x248743||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xd3001[_0x60d0('0x54')][_0x60d0('0x3a')][_0x60d0('0x64')]()),_0x2083a9);return respondWithRpcPromise(_0x60d0('0x5c'),'create',{'module':_0x60d0('0x65')});}return null;})[_0x60d0('0x18')](function(){return _0x16cc7b;});})[_0x60d0('0x18')](respondWithResult(_0x24cc1c,0xc9))['catch'](handleError(_0x24cc1c,null));};exports[_0x60d0('0x31')]=function(_0x3ea362,_0x2a6c38,_0x2b23f1){var _0x3b53b3;return db[_0x60d0('0x52')][_0x60d0('0x53')](function(_0x5d4b03){return db[_0x60d0('0x48')]['find']({'where':{'id':_0x3ea362[_0x60d0('0x4e')]['id']}})[_0x60d0('0x18')](handleEntityNotFound(_0x2a6c38,null))[_0x60d0('0x18')](saveUpdates(_0x3ea362['body'],null))[_0x60d0('0x18')](function(_0x1a0c96){if(_0x1a0c96){_0x3b53b3=_0x1a0c96;return db[_0x60d0('0x48')][_0x60d0('0x4b')]({'where':{'type':_0x3b53b3[_0x60d0('0x3a')]},'raw':!![]});}return null;})[_0x60d0('0x18')](function(_0x5dab8c){if(_0x3b53b3[_0x60d0('0x3a')]['toUpperCase']()==_0x60d0('0x55')){var _0x9656cd=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config[_0x60d0('0x57')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x4a7399=ejs[_0x60d0('0x5a')](_0x9656cd,{'networks':_0x5dab8c||[]});fs[_0x60d0('0x5b')](_0x60d0('0x66'),_0x4a7399);return respondWithRpcPromise(_0x60d0('0x5c'),_0x60d0('0x31'),{'module':_0x60d0('0x5d')});}else if(_0x3b53b3[_0x60d0('0x3a')][_0x60d0('0x5e')]()==_0x60d0('0x5f')){var _0x4889ba=fs[_0x60d0('0x60')](path['join'](config[_0x60d0('0x57')],_0x60d0('0x61')),_0x60d0('0x59'));var _0x3a0872=ejs[_0x60d0('0x5a')](_0x4889ba,{'networks':_0x5dab8c||[]});fs[_0x60d0('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x3a0872);return respondWithRpcPromise('Reload',_0x60d0('0x31'),{'module':_0x60d0('0x5d')});}else{var _0x364d1d=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config[_0x60d0('0x57')],_0x60d0('0x63')),_0x60d0('0x59'));var _0x5bc70e=ejs[_0x60d0('0x5a')](_0x364d1d,{'networks':_0x5dab8c||[]});fs[_0x60d0('0x5b')](util['format'](_0x60d0('0x67'),_0x3ea362[_0x60d0('0x54')][_0x60d0('0x3a')][_0x60d0('0x64')]()),_0x5bc70e);return respondWithRpcPromise('Reload','update',{'module':_0x60d0('0x65')});}return null;})[_0x60d0('0x18')](function(_0x3b9f2e){if(_0x3b9f2e){return _0x3b53b3;}return null;});})[_0x60d0('0x18')](respondWithResult(_0x2a6c38,null))[_0x60d0('0x23')](handleError(_0x2a6c38,null));};exports['destroy']=function(_0x19c46f,_0x5d4e83,_0x272c7d){var _0x3088c2;return db[_0x60d0('0x48')][_0x60d0('0x50')]({'where':{'id':_0x19c46f[_0x60d0('0x4e')]['id']}})['then'](function(_0x309480){_0x3088c2=_0x309480;return _0x309480;})['then'](handleEntityNotFound(_0x5d4e83,null))[_0x60d0('0x18')](removeEntity(_0x5d4e83,null))[_0x60d0('0x18')](function(){if(_0x3088c2){return db[_0x60d0('0x48')]['findAll']({'where':{'type':_0x3088c2[_0x60d0('0x3a')]},'raw':!![]});}})[_0x60d0('0x18')](function(_0x3ac32a){if(_0x3088c2[_0x60d0('0x3a')][_0x60d0('0x5e')]()==_0x60d0('0x55')){var _0x2cb0c6=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config[_0x60d0('0x57')],'server/files/templates/stun_multiple.ejs'),_0x60d0('0x59'));var _0x3adc5c=ejs[_0x60d0('0x5a')](_0x2cb0c6,{'networks':_0x3ac32a||[]});fs[_0x60d0('0x5b')](_0x60d0('0x66'),_0x3adc5c);return respondWithRpcPromise(_0x60d0('0x5c'),_0x60d0('0x32'),{'module':_0x60d0('0x5d')});}else if(_0x3088c2[_0x60d0('0x3a')][_0x60d0('0x5e')]()==_0x60d0('0x5f')){var _0x17f123=fs[_0x60d0('0x60')](path[_0x60d0('0x56')](config['root'],_0x60d0('0x61')),_0x60d0('0x59'));var _0x4b600b=ejs[_0x60d0('0x5a')](_0x17f123,{'networks':_0x3ac32a||[]});fs[_0x60d0('0x5b')](_0x60d0('0x62'),_0x4b600b);return respondWithRpcPromise(_0x60d0('0x5c'),_0x60d0('0x32'),{'module':_0x60d0('0x5d')});}else{var _0x513e0e=fs['readFileSync'](path[_0x60d0('0x56')](config['root'],_0x60d0('0x63')),_0x60d0('0x59'));var _0x3650b8=ejs[_0x60d0('0x5a')](_0x513e0e,{'networks':_0x3ac32a||[]});fs[_0x60d0('0x5b')](util[_0x60d0('0x68')](_0x60d0('0x67'),_0x19c46f[_0x60d0('0x54')]['type'][_0x60d0('0x64')]()),_0x3650b8);return respondWithRpcPromise(_0x60d0('0x5c'),'destroy',{'module':_0x60d0('0x65')});}return null;})[_0x60d0('0x23')](handleError(_0x5d4e83,null));}; \ No newline at end of file +var _0xc19f=['client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','sequelize','transaction','body','STUN','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','server/files/templates/turn_multiple.ejs','utf8','Reload','readFileSync','join','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/turn_xcally.conf','format','server/files/templates/network.ejs','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x18259f,_0x3691b6){var _0x3bf672=function(_0x56dcb1){while(--_0x56dcb1){_0x18259f['push'](_0x18259f['shift']());}};_0x3bf672(++_0x3691b6);}(_0xc19f,0xbc));var _0xfc19=function(_0x19c187,_0x1243a9){_0x19c187=_0x19c187-0x0;var _0xe3b138=_0xc19f[_0x19c187];return _0xe3b138;};'use strict';var emlformat=require(_0xfc19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc19('0x1'));var jsonpatch=require(_0xfc19('0x2'));var rp=require(_0xfc19('0x3'));var moment=require(_0xfc19('0x4'));var BPromise=require(_0xfc19('0x5'));var Mustache=require(_0xfc19('0x6'));var util=require(_0xfc19('0x7'));var path=require(_0xfc19('0x8'));var sox=require(_0xfc19('0x9'));var csv=require(_0xfc19('0xa'));var ejs=require(_0xfc19('0xb'));var fs=require('fs');var fs_extra=require(_0xfc19('0xc'));var _=require(_0xfc19('0xd'));var squel=require('squel');var crypto=require(_0xfc19('0xe'));var jsforce=require(_0xfc19('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc19('0xa'));var querystring=require('querystring');var Papa=require(_0xfc19('0x10'));var Redis=require(_0xfc19('0x11'));var authService=require(_0xfc19('0x12'));var qs=require(_0xfc19('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc19('0x14'));var logger=require('../../config/logger')(_0xfc19('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xfc19('0x16')][_0xfc19('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x2414b6,_0x4b4ac9,_0xe88590,_0x4fed09){return new BPromise(function(_0x128133,_0x30fd6b){var _0x4b0265=_0x4fed09||client;return _0x4b0265[_0xfc19('0x18')](_0x2414b6,_0xe88590)[_0xfc19('0x19')](function(_0x49a6ba){logger['info'](_0xfc19('0x1a'),_0x4b4ac9,_0xfc19('0x1b'));logger['debug'](_0xfc19('0x1c'),_0x4b4ac9,_0xfc19('0x1b'),JSON[_0xfc19('0x1d')](_0x49a6ba));if(_0x49a6ba['error']){if(_0x49a6ba[_0xfc19('0x1e')][_0xfc19('0x1f')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x4b4ac9,_0x49a6ba[_0xfc19('0x1e')][_0xfc19('0x20')]);return _0x30fd6b(_0x49a6ba['error'][_0xfc19('0x20')]);}logger[_0xfc19('0x1e')]('Network,\x20%s,\x20%s',_0x4b4ac9,_0x49a6ba['error']['message']);return _0x128133(_0x49a6ba[_0xfc19('0x1e')][_0xfc19('0x20')]);}else{logger[_0xfc19('0x21')](_0xfc19('0x1a'),_0x4b4ac9,_0xfc19('0x1b'));_0x128133(_0x49a6ba[_0xfc19('0x22')][_0xfc19('0x20')]);}})[_0xfc19('0x23')](function(_0x2e4582){logger[_0xfc19('0x1e')](_0xfc19('0x1a'),_0x4b4ac9,_0x2e4582);_0x30fd6b(_0x2e4582);});});}function respondWithStatusCode(_0xdc2c76,_0x4e4dbc){_0x4e4dbc=_0x4e4dbc||0xcc;return function(_0x2a9380){if(_0x2a9380){return _0xdc2c76[_0xfc19('0x24')](_0x4e4dbc);}return _0xdc2c76['status'](_0x4e4dbc)['end']();};}function respondWithResult(_0x1eb546,_0x5c6a00){_0x5c6a00=_0x5c6a00||0xc8;return function(_0xa7172b){if(_0xa7172b){return _0x1eb546[_0xfc19('0x25')](_0x5c6a00)[_0xfc19('0x26')](_0xa7172b);}};}function respondWithFilteredResult(_0x23f2ea,_0x1ece6d){return function(_0x3167d7){if(_0x3167d7){var _0x1fd510=typeof _0x1ece6d['offset']===_0xfc19('0x27')&&typeof _0x1ece6d[_0xfc19('0x28')]===_0xfc19('0x27');var _0x189729=_0x3167d7[_0xfc19('0x29')];var _0x5e244a=_0x1fd510?0x0:_0x1ece6d[_0xfc19('0x2a')];var _0x43ee06=_0x1fd510?_0x3167d7[_0xfc19('0x29')]:_0x1ece6d[_0xfc19('0x2a')]+_0x1ece6d[_0xfc19('0x28')];var _0x17759e;if(_0x43ee06>=_0x189729){_0x43ee06=_0x189729;_0x17759e=0xc8;}else{_0x17759e=0xce;}_0x23f2ea['status'](_0x17759e);return _0x23f2ea[_0xfc19('0x2b')]('Content-Range',_0x5e244a+'-'+_0x43ee06+'/'+_0x189729)['json'](_0x3167d7);}return null;};}function patchUpdates(_0x59d273){return function(_0x102bc8){try{jsonpatch[_0xfc19('0x2c')](_0x102bc8,_0x59d273,!![]);}catch(_0x3f0325){return BPromise['reject'](_0x3f0325);}return _0x102bc8[_0xfc19('0x2d')]();};}function saveUpdates(_0xf77a62,_0x428f48){return function(_0x201dc7){if(_0x201dc7){return _0x201dc7[_0xfc19('0x2e')](_0xf77a62)[_0xfc19('0x19')](function(_0x397e50){return _0x397e50;});}return null;};}function removeEntity(_0x500704,_0x4715ee){return function(_0x214ff3){if(_0x214ff3){return _0x214ff3[_0xfc19('0x2f')]()[_0xfc19('0x19')](function(){_0x500704[_0xfc19('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d440b,_0x48f39e){return function(_0x3e1bbd){if(!_0x3e1bbd){_0x5d440b[_0xfc19('0x24')](0x194);}return _0x3e1bbd;};}function handleError(_0x2c0921,_0x328530){_0x328530=_0x328530||0x1f4;return function(_0x4f05b6){logger['error'](_0x4f05b6[_0xfc19('0x30')]);if(_0x4f05b6[_0xfc19('0x31')]){delete _0x4f05b6[_0xfc19('0x31')];}_0x2c0921[_0xfc19('0x25')](_0x328530)[_0xfc19('0x32')](_0x4f05b6);};}exports[_0xfc19('0x33')]=function(_0x148d02,_0x108ab8){var _0x2c6f70={},_0xcd4034={},_0x2b2e8b={'count':0x0,'rows':[]};var _0x56a8c5=_[_0xfc19('0x34')](db[_0xfc19('0x35')][_0xfc19('0x36')],function(_0x38fdaa){return{'name':_0x38fdaa[_0xfc19('0x37')],'type':_0x38fdaa[_0xfc19('0x38')]['key']};});_0xcd4034['model']=_[_0xfc19('0x34')](_0x56a8c5,'name');_0xcd4034[_0xfc19('0x39')]=_[_0xfc19('0x3a')](_0x148d02['query']);_0xcd4034[_0xfc19('0x3b')]=_['intersection'](_0xcd4034[_0xfc19('0x3c')],_0xcd4034[_0xfc19('0x39')]);_0x2c6f70[_0xfc19('0x3d')]=_[_0xfc19('0x3e')](_0xcd4034[_0xfc19('0x3c')],qs[_0xfc19('0x3f')](_0x148d02[_0xfc19('0x39')][_0xfc19('0x3f')]));_0x2c6f70[_0xfc19('0x3d')]=_0x2c6f70[_0xfc19('0x3d')][_0xfc19('0x40')]?_0x2c6f70['attributes']:_0xcd4034[_0xfc19('0x3c')];if(!_0x148d02[_0xfc19('0x39')][_0xfc19('0x41')](_0xfc19('0x42'))){_0x2c6f70[_0xfc19('0x28')]=qs[_0xfc19('0x28')](_0x148d02['query'][_0xfc19('0x28')]);_0x2c6f70[_0xfc19('0x2a')]=qs[_0xfc19('0x2a')](_0x148d02[_0xfc19('0x39')]['offset']);}_0x2c6f70[_0xfc19('0x43')]=qs[_0xfc19('0x44')](_0x148d02['query']['sort']);_0x2c6f70[_0xfc19('0x45')]=qs['filters'](_[_0xfc19('0x46')](_0x148d02[_0xfc19('0x39')],_0xcd4034[_0xfc19('0x3b')]),_0x56a8c5);if(_0x148d02[_0xfc19('0x39')][_0xfc19('0x47')]){_0x2c6f70['where']=_[_0xfc19('0x48')](_0x2c6f70[_0xfc19('0x45')],{'$or':_[_0xfc19('0x34')](_0x56a8c5,function(_0x9019c1){if(_0x9019c1[_0xfc19('0x38')]!==_0xfc19('0x49')){var _0x27ac32={};_0x27ac32[_0x9019c1[_0xfc19('0x31')]]={'$like':'%'+_0x148d02[_0xfc19('0x39')][_0xfc19('0x47')]+'%'};return _0x27ac32;}})});}_0x2c6f70=_['merge']({},_0x2c6f70,_0x148d02[_0xfc19('0x4a')]);var _0x29ccba={'where':_0x2c6f70[_0xfc19('0x45')]};return db[_0xfc19('0x35')][_0xfc19('0x29')](_0x29ccba)[_0xfc19('0x19')](function(_0x3b7662){_0x2b2e8b['count']=_0x3b7662;if(_0x148d02[_0xfc19('0x39')]['includeAll']){_0x2c6f70[_0xfc19('0x4b')]=[{'all':!![]}];}return db[_0xfc19('0x35')][_0xfc19('0x4c')](_0x2c6f70);})['then'](function(_0x457732){_0x2b2e8b[_0xfc19('0x4d')]=_0x457732;return _0x2b2e8b;})['then'](respondWithFilteredResult(_0x108ab8,_0x2c6f70))['catch'](handleError(_0x108ab8,null));};exports[_0xfc19('0x4e')]=function(_0x11d6a6,_0x574c9e){var _0x1ec553={'raw':!![],'where':{'id':_0x11d6a6[_0xfc19('0x4f')]['id']}},_0x233f76={};_0x233f76['model']=_[_0xfc19('0x3a')](db[_0xfc19('0x35')]['rawAttributes']);_0x233f76[_0xfc19('0x39')]=_[_0xfc19('0x3a')](_0x11d6a6[_0xfc19('0x39')]);_0x233f76[_0xfc19('0x3b')]=_[_0xfc19('0x3e')](_0x233f76['model'],_0x233f76[_0xfc19('0x39')]);_0x1ec553['attributes']=_[_0xfc19('0x3e')](_0x233f76[_0xfc19('0x3c')],qs[_0xfc19('0x3f')](_0x11d6a6[_0xfc19('0x39')][_0xfc19('0x3f')]));_0x1ec553['attributes']=_0x1ec553[_0xfc19('0x3d')][_0xfc19('0x40')]?_0x1ec553['attributes']:_0x233f76[_0xfc19('0x3c')];if(_0x11d6a6[_0xfc19('0x39')][_0xfc19('0x50')]){_0x1ec553['include']=[{'all':!![]}];}_0x1ec553=_['merge']({},_0x1ec553,_0x11d6a6[_0xfc19('0x4a')]);return db[_0xfc19('0x35')][_0xfc19('0x51')](_0x1ec553)['then'](handleEntityNotFound(_0x574c9e,null))[_0xfc19('0x19')](respondWithResult(_0x574c9e,null))[_0xfc19('0x23')](handleError(_0x574c9e,null));};exports[_0xfc19('0x52')]=function(_0x1a638a,_0x597e05,_0x29ea57){var _0x59daf3;return db[_0xfc19('0x53')][_0xfc19('0x54')](function(_0x21dc91){return db[_0xfc19('0x35')][_0xfc19('0x52')](_0x1a638a[_0xfc19('0x55')],{'raw':!![]})['then'](function(_0x2082df){_0x59daf3=_0x2082df;return db['Network'][_0xfc19('0x4c')]({'where':{'type':_0x1a638a[_0xfc19('0x55')]['type']},'raw':!![]});})['then'](function(_0x17e562){if(_0x59daf3[_0xfc19('0x38')]['toUpperCase']()==_0xfc19('0x56')){var _0x235337=fs['readFileSync'](path['join'](config[_0xfc19('0x57')],_0xfc19('0x58')),'utf8');var _0x2d248c=ejs[_0xfc19('0x59')](_0x235337,{'networks':_0x17e562||[]});fs[_0xfc19('0x5a')](_0xfc19('0x5b'),_0x2d248c);return respondWithRpcPromise('Reload',_0xfc19('0x52'),{'module':_0xfc19('0x5c')});}else if(_0x59daf3[_0xfc19('0x38')][_0xfc19('0x5d')]()=='TURN'){var _0xa8ebf3=fs['readFileSync'](path['join'](config[_0xfc19('0x57')],_0xfc19('0x5e')),_0xfc19('0x5f'));var _0x58aa0f=ejs['render'](_0xa8ebf3,{'networks':_0x17e562||[]});fs[_0xfc19('0x5a')]('/etc/asterisk/turn_xcally.conf',_0x58aa0f);return respondWithRpcPromise(_0xfc19('0x60'),_0xfc19('0x52'),{'module':_0xfc19('0x5c')});}else{var _0x13219b=fs[_0xfc19('0x61')](path[_0xfc19('0x62')](config['root'],'server/files/templates/network.ejs'),_0xfc19('0x5f'));var _0x53441f=ejs[_0xfc19('0x59')](_0x13219b,{'networks':_0x17e562||[]});fs[_0xfc19('0x5a')](util['format'](_0xfc19('0x63'),_0x1a638a[_0xfc19('0x55')][_0xfc19('0x38')][_0xfc19('0x64')]()),_0x53441f);return respondWithRpcPromise('Reload',_0xfc19('0x52'),{'module':_0xfc19('0x65')});}return null;})[_0xfc19('0x19')](function(){return _0x59daf3;});})[_0xfc19('0x19')](respondWithResult(_0x597e05,0xc9))['catch'](handleError(_0x597e05,null));};exports['update']=function(_0x59e735,_0x7583c5,_0x2c3d81){var _0xccc5a6;return db[_0xfc19('0x53')]['transaction'](function(_0x2bc36c){return db[_0xfc19('0x35')][_0xfc19('0x51')]({'where':{'id':_0x59e735[_0xfc19('0x4f')]['id']}})[_0xfc19('0x19')](handleEntityNotFound(_0x7583c5,null))[_0xfc19('0x19')](saveUpdates(_0x59e735['body'],null))[_0xfc19('0x19')](function(_0x4388df){if(_0x4388df){_0xccc5a6=_0x4388df;return db[_0xfc19('0x35')][_0xfc19('0x4c')]({'where':{'type':_0xccc5a6[_0xfc19('0x38')]},'raw':!![]});}return null;})[_0xfc19('0x19')](function(_0x2642be){if(_0xccc5a6[_0xfc19('0x38')][_0xfc19('0x5d')]()==_0xfc19('0x56')){var _0x2d2066=fs['readFileSync'](path[_0xfc19('0x62')](config[_0xfc19('0x57')],_0xfc19('0x58')),'utf8');var _0x5f2b7d=ejs[_0xfc19('0x59')](_0x2d2066,{'networks':_0x2642be||[]});fs[_0xfc19('0x5a')]('/etc/asterisk/stun_xcally.conf',_0x5f2b7d);return respondWithRpcPromise(_0xfc19('0x60'),'update',{'module':_0xfc19('0x5c')});}else if(_0xccc5a6['type'][_0xfc19('0x5d')]()=='TURN'){var _0x27c55e=fs['readFileSync'](path[_0xfc19('0x62')](config[_0xfc19('0x57')],_0xfc19('0x5e')),_0xfc19('0x5f'));var _0x46296b=ejs[_0xfc19('0x59')](_0x27c55e,{'networks':_0x2642be||[]});fs[_0xfc19('0x5a')](_0xfc19('0x66'),_0x46296b);return respondWithRpcPromise(_0xfc19('0x60'),_0xfc19('0x2e'),{'module':_0xfc19('0x5c')});}else{var _0x381a0f=fs[_0xfc19('0x61')](path[_0xfc19('0x62')](config[_0xfc19('0x57')],'server/files/templates/network.ejs'),_0xfc19('0x5f'));var _0xbd5ca4=ejs[_0xfc19('0x59')](_0x381a0f,{'networks':_0x2642be||[]});fs[_0xfc19('0x5a')](util[_0xfc19('0x67')]('/etc/asterisk/sip_xcally_%s.conf',_0x59e735[_0xfc19('0x55')][_0xfc19('0x38')][_0xfc19('0x64')]()),_0xbd5ca4);return respondWithRpcPromise(_0xfc19('0x60'),_0xfc19('0x2e'),{'module':_0xfc19('0x65')});}return null;})['then'](function(_0x4dca3f){if(_0x4dca3f){return _0xccc5a6;}return null;});})['then'](respondWithResult(_0x7583c5,null))[_0xfc19('0x23')](handleError(_0x7583c5,null));};exports[_0xfc19('0x2f')]=function(_0x32be7d,_0x597c0c,_0x41b8c8){var _0x45dbe2;return db[_0xfc19('0x35')][_0xfc19('0x51')]({'where':{'id':_0x32be7d['params']['id']}})[_0xfc19('0x19')](function(_0x2fca55){_0x45dbe2=_0x2fca55;return _0x2fca55;})[_0xfc19('0x19')](handleEntityNotFound(_0x597c0c,null))[_0xfc19('0x19')](removeEntity(_0x597c0c,null))[_0xfc19('0x19')](function(){if(_0x45dbe2){return db['Network'][_0xfc19('0x4c')]({'where':{'type':_0x45dbe2[_0xfc19('0x38')]},'raw':!![]});}})['then'](function(_0x486eb0){if(_0x45dbe2[_0xfc19('0x38')][_0xfc19('0x5d')]()=='STUN'){var _0x28faee=fs[_0xfc19('0x61')](path['join'](config[_0xfc19('0x57')],_0xfc19('0x58')),_0xfc19('0x5f'));var _0x1cc09b=ejs[_0xfc19('0x59')](_0x28faee,{'networks':_0x486eb0||[]});fs[_0xfc19('0x5a')](_0xfc19('0x5b'),_0x1cc09b);return respondWithRpcPromise(_0xfc19('0x60'),'destroy',{'module':_0xfc19('0x5c')});}else if(_0x45dbe2[_0xfc19('0x38')]['toUpperCase']()=='TURN'){var _0x1c3b2e=fs['readFileSync'](path[_0xfc19('0x62')](config[_0xfc19('0x57')],_0xfc19('0x5e')),_0xfc19('0x5f'));var _0x31a46b=ejs[_0xfc19('0x59')](_0x1c3b2e,{'networks':_0x486eb0||[]});fs[_0xfc19('0x5a')](_0xfc19('0x66'),_0x31a46b);return respondWithRpcPromise(_0xfc19('0x60'),_0xfc19('0x2f'),{'module':_0xfc19('0x5c')});}else{var _0x1e292a=fs[_0xfc19('0x61')](path['join'](config[_0xfc19('0x57')],_0xfc19('0x68')),'utf8');var _0xd8e0a=ejs[_0xfc19('0x59')](_0x1e292a,{'networks':_0x486eb0||[]});fs[_0xfc19('0x5a')](util[_0xfc19('0x67')](_0xfc19('0x63'),_0x32be7d[_0xfc19('0x55')][_0xfc19('0x38')][_0xfc19('0x64')]()),_0xd8e0a);return respondWithRpcPromise(_0xfc19('0x60'),_0xfc19('0x2f'),{'module':_0xfc19('0x65')});}return null;})[_0xfc19('0x23')](handleError(_0x597c0c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 73cd7b5..a66af02 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 _0xb4e6=['path','rimraf','./network.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37bdaf,_0x3d8afb){var _0x1c01ec=function(_0x515a64){while(--_0x515a64){_0x37bdaf['push'](_0x37bdaf['shift']());}};_0x1c01ec(++_0x3d8afb);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xb4e6[_0x198446];return _0x38d7b7;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb53=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29a1bb,_0x52859d){var _0x19f85e=function(_0x1b1000){while(--_0x1b1000){_0x29a1bb['push'](_0x29a1bb['shift']());}};_0x19f85e(++_0x52859d);}(_0xbb53,0x121));var _0x3bb5=function(_0x7ed0a1,_0x37f69e){_0x7ed0a1=_0x7ed0a1-0x0;var _0x324343=_0xbb53[_0x7ed0a1];return _0x324343;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'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 fc1fa89..29cf78f 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x18f30d,_0x22a3fa){_0x18f30d=_0x18f30d-0x0;var _0x240c73=_0x7a54[_0x18f30d];return _0x240c73;};'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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1358fa,_0x320a8f){_0x1358fa=_0x1358fa-0x0;var _0x2d0947=_0x7a54[_0x1358fa];return _0x2d0947;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 0541dd9..436b627 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 _0x3558=['/:id/notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer'];(function(_0x92d5cb,_0x581fe6){var _0x45c608=function(_0x142eaf){while(--_0x142eaf){_0x92d5cb['push'](_0x92d5cb['shift']());}};_0x45c608(++_0x581fe6);}(_0x3558,0xef));var _0x8355=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x3558[_0x47242d];return _0x30273a;};'use strict';var multer=require(_0x8355('0x0'));var util=require(_0x8355('0x1'));var path=require(_0x8355('0x2'));var timeout=require(_0x8355('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8355('0x4'));var interaction=require(_0x8355('0x5'));var config=require(_0x8355('0x6'));var controller=require(_0x8355('0x7'));router[_0x8355('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8355('0x8')](_0x8355('0x9'),auth['isAuthenticated'](),controller[_0x8355('0xa')]);router[_0x8355('0x8')](_0x8355('0xb'),auth[_0x8355('0xc')](),controller[_0x8355('0xd')]);router[_0x8355('0x8')](_0x8355('0xe'),auth['isAuthenticated'](),controller[_0x8355('0xf')]);router[_0x8355('0x8')](_0x8355('0x10'),auth[_0x8355('0xc')](),controller[_0x8355('0x11')]);router['get'](_0x8355('0x12'),auth['isAuthenticated'](),controller[_0x8355('0x13')]);router[_0x8355('0x8')](_0x8355('0x14'),auth[_0x8355('0xc')](),controller['getInteractions']);router['get'](_0x8355('0x15'),auth[_0x8355('0xc')](),controller[_0x8355('0x16')]);router[_0x8355('0x17')]('/',auth[_0x8355('0xc')](),controller[_0x8355('0x18')]);router[_0x8355('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8355('0x19')]);router[_0x8355('0x17')](_0x8355('0x10'),auth[_0x8355('0xc')](),controller[_0x8355('0x1a')]);router[_0x8355('0x17')](_0x8355('0x1b'),controller['notify']);router[_0x8355('0x17')](_0x8355('0x12'),auth[_0x8355('0xc')](),controller[_0x8355('0x1c')]);router[_0x8355('0x17')]('/:id/users',auth[_0x8355('0xc')](),controller['addAgents']);router[_0x8355('0x17')](_0x8355('0x1d'),auth['isAuthenticated'](),controller[_0x8355('0x1e')]);router[_0x8355('0x1f')](_0x8355('0xb'),auth[_0x8355('0xc')](),controller[_0x8355('0x20')]);router[_0x8355('0x21')](_0x8355('0xb'),auth[_0x8355('0xc')](),controller[_0x8355('0x22')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8355('0x23')]);router['delete'](_0x8355('0x10'),auth[_0x8355('0xc')](),controller[_0x8355('0x24')]);router[_0x8355('0x21')](_0x8355('0x15'),auth[_0x8355('0xc')](),controller['removeAgents']);module[_0x8355('0x25')]=router; \ No newline at end of file +var _0x6e30=['removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','create','post','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers'];(function(_0x2272e9,_0x3f615e){var _0x54056=function(_0x38cc60){while(--_0x38cc60){_0x2272e9['push'](_0x2272e9['shift']());}};_0x54056(++_0x3f615e);}(_0x6e30,0xbf));var _0x06e3=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x6e30[_0x1e1965];return _0x1a2e96;};'use strict';var multer=require(_0x06e3('0x0'));var util=require(_0x06e3('0x1'));var path=require('path');var timeout=require(_0x06e3('0x2'));var express=require(_0x06e3('0x3'));var router=express['Router']();var fs_extra=require(_0x06e3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x06e3('0x5'));var config=require(_0x06e3('0x6'));var controller=require(_0x06e3('0x7'));router[_0x06e3('0x8')]('/',auth['isAuthenticated'](),controller[_0x06e3('0x9')]);router[_0x06e3('0x8')](_0x06e3('0xa'),auth[_0x06e3('0xb')](),controller[_0x06e3('0xc')]);router[_0x06e3('0x8')](_0x06e3('0xd'),auth['isAuthenticated'](),controller[_0x06e3('0xe')]);router[_0x06e3('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x06e3('0xf')]);router[_0x06e3('0x8')]('/:id/canned_answers',auth[_0x06e3('0xb')](),controller[_0x06e3('0x10')]);router['get'](_0x06e3('0x11'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x12')]);router['get'](_0x06e3('0x13'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x14')]);router[_0x06e3('0x8')](_0x06e3('0x15'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x06e3('0xb')](),controller[_0x06e3('0x16')]);router[_0x06e3('0x17')]('/:id/dispositions',auth[_0x06e3('0xb')](),controller['addDisposition']);router[_0x06e3('0x17')](_0x06e3('0x18'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x19')]);router[_0x06e3('0x17')](_0x06e3('0x1a'),controller[_0x06e3('0x1b')]);router[_0x06e3('0x17')](_0x06e3('0x11'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x1c')]);router['post'](_0x06e3('0x15'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x1d')]);router[_0x06e3('0x17')](_0x06e3('0x1e'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x1f')]);router['put'](_0x06e3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x06e3('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x06e3('0x21')]);router[_0x06e3('0x20')](_0x06e3('0x22'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x23')]);router[_0x06e3('0x20')](_0x06e3('0x18'),auth[_0x06e3('0xb')](),controller[_0x06e3('0x24')]);router[_0x06e3('0x20')]('/:id/users',auth[_0x06e3('0xb')](),controller[_0x06e3('0x25')]);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 f1c9e0c..4c84cc0 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 _0xca32=['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','STRING','name','generate'];(function(_0x59ef3d,_0x5c7aee){var _0x585558=function(_0x1f0f81){while(--_0x1f0f81){_0x59ef3d['push'](_0x59ef3d['shift']());}};_0x585558(++_0x5c7aee);}(_0xca32,0x14d));var _0x2ca3=function(_0x30fe1b,_0xa72e90){_0x30fe1b=_0x30fe1b-0x0;var _0x131d4d=_0xca32[_0x30fe1b];return _0x131d4d;};'use strict';var Sequelize=require(_0x2ca3('0x0'));var rs=require(_0x2ca3('0x1'));module['exports']={'name':{'type':Sequelize[_0x2ca3('0x2')],'unique':_0x2ca3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2ca3('0x2')]},'token':{'type':Sequelize[_0x2ca3('0x2')],'defaultValue':function(){return rs[_0x2ca3('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2ca3('0x5')],'defaultValue':function(){return _0x2ca3('0x6');}},'notificationSound':{'type':Sequelize[_0x2ca3('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ca3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2ca3('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ca3('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ca3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ca3('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2ca3('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2ca3('0x7')],'defaultValue':![],'comment':_0x2ca3('0xa'),'set':function(_0x39ac20){if(!_0x39ac20)this[_0x2ca3('0xb')](_0x2ca3('0xc'),null);this[_0x2ca3('0xb')]('mandatoryDisposition',_0x39ac20);}}}; \ No newline at end of file +var _0x999c=['sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId'];(function(_0xee9100,_0x46a615){var _0x223bad=function(_0x506452){while(--_0x506452){_0xee9100['push'](_0xee9100['shift']());}};_0x223bad(++_0x46a615);}(_0x999c,0x18c));var _0xc999=function(_0x363593,_0x558d87){_0x363593=_0x363593-0x0;var _0x31e856=_0x999c[_0x363593];return _0x31e856;};'use strict';var Sequelize=require(_0xc999('0x0'));var rs=require(_0xc999('0x1'));module[_0xc999('0x2')]={'name':{'type':Sequelize[_0xc999('0x3')],'unique':_0xc999('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc999('0x3')],'defaultValue':function(){return rs[_0xc999('0x5')]();}},'replyUri':{'type':Sequelize[_0xc999('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc999('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc999('0x6')],'defaultValue':function(){return _0xc999('0x7');}},'notificationSound':{'type':Sequelize[_0xc999('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc999('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc999('0x3')]},'queueTransfer':{'type':Sequelize[_0xc999('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc999('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc999('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x20742e){if(!_0x20742e)this['setDataValue'](_0xc999('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x20742e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 699cbc1..4eed0f3 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 _0x8bcc=['get','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','List','account','applications','orderBy','priority','asc','Applications','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','finally','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','localhost','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0xf56165,_0x58e7ce){var _0x39575d=function(_0x62bf31){while(--_0x62bf31){_0xf56165['push'](_0xf56165['shift']());}};_0x39575d(++_0x58e7ce);}(_0x8bcc,0x82));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8bc('0x0'));var zipdir=require(_0xc8bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8bc('0x2'));var moment=require(_0xc8bc('0x3'));var BPromise=require(_0xc8bc('0x4'));var Mustache=require(_0xc8bc('0x5'));var util=require(_0xc8bc('0x6'));var path=require(_0xc8bc('0x7'));var sox=require(_0xc8bc('0x8'));var csv=require(_0xc8bc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8bc('0xa'));var _=require(_0xc8bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc8bc('0xc'));var toCsv=require(_0xc8bc('0x9'));var querystring=require(_0xc8bc('0xd'));var Papa=require(_0xc8bc('0xe'));var Redis=require(_0xc8bc('0xf'));var authService=require(_0xc8bc('0x10'));var qs=require(_0xc8bc('0x11'));var as=require(_0xc8bc('0x12'));var hardwareService=require(_0xc8bc('0x13'));var logger=require('../../config/logger')(_0xc8bc('0x14'));var utils=require(_0xc8bc('0x15'));var config=require(_0xc8bc('0x16'));var licenseUtil=require(_0xc8bc('0x17'));var db=require(_0xc8bc('0x18'))['db'];config['redis']=_[_0xc8bc('0x19')](config[_0xc8bc('0x1a')],{'host':_0xc8bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc8bc('0x1c'))[_0xc8bc('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc8bc('0x1e')][_0xc8bc('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x216343,_0x381eab,_0x17788d,_0x4b8b61){return new BPromise(function(_0x1cc757,_0x448f13){var _0x26d74d=_0x4b8b61||client;return _0x26d74d[_0xc8bc('0x20')](_0x216343,_0x17788d)[_0xc8bc('0x21')](function(_0x5b71f0){logger[_0xc8bc('0x22')](_0xc8bc('0x23'),_0x381eab,_0xc8bc('0x24'));logger[_0xc8bc('0x25')](_0xc8bc('0x26'),_0x381eab,_0xc8bc('0x24'),JSON[_0xc8bc('0x27')](_0x5b71f0));if(_0x5b71f0[_0xc8bc('0x28')]){if(_0x5b71f0[_0xc8bc('0x28')]['code']===0x1f4){logger[_0xc8bc('0x28')](_0xc8bc('0x23'),_0x381eab,_0x5b71f0[_0xc8bc('0x28')]['message']);return _0x448f13(_0x5b71f0[_0xc8bc('0x28')][_0xc8bc('0x29')]);}logger[_0xc8bc('0x28')](_0xc8bc('0x23'),_0x381eab,_0x5b71f0[_0xc8bc('0x28')]['message']);return _0x1cc757(_0x5b71f0[_0xc8bc('0x28')][_0xc8bc('0x29')]);}else{logger['info'](_0xc8bc('0x23'),_0x381eab,_0xc8bc('0x24'));_0x1cc757(_0x5b71f0['result']['message']);}})[_0xc8bc('0x2a')](function(_0x508df6){logger[_0xc8bc('0x28')](_0xc8bc('0x23'),_0x381eab,_0x508df6);_0x448f13(_0x508df6);});});}function respondWithStatusCode(_0x15f869,_0xc5ea50){_0xc5ea50=_0xc5ea50||0xcc;return function(_0x2ba673){if(_0x2ba673){return _0x15f869[_0xc8bc('0x2b')](_0xc5ea50);}return _0x15f869[_0xc8bc('0x2c')](_0xc5ea50)[_0xc8bc('0x2d')]();};}function respondWithResult(_0x57b966,_0x313928){_0x313928=_0x313928||0xc8;return function(_0x3fc3db){if(_0x3fc3db){return _0x57b966[_0xc8bc('0x2c')](_0x313928)[_0xc8bc('0x2e')](_0x3fc3db);}};}function respondWithFilteredResult(_0x4de53f,_0x127c0b){return function(_0x272042){if(_0x272042){var _0xb8c140=typeof _0x127c0b['offset']===_0xc8bc('0x2f')&&typeof _0x127c0b[_0xc8bc('0x30')]==='undefined';var _0x2142cb=_0x272042[_0xc8bc('0x31')];var _0x33434b=_0xb8c140?0x0:_0x127c0b[_0xc8bc('0x32')];var _0x58ff75=_0xb8c140?_0x272042[_0xc8bc('0x31')]:_0x127c0b[_0xc8bc('0x32')]+_0x127c0b['limit'];var _0x519a3a;if(_0x58ff75>=_0x2142cb){_0x58ff75=_0x2142cb;_0x519a3a=0xc8;}else{_0x519a3a=0xce;}_0x4de53f['status'](_0x519a3a);return _0x4de53f['set'](_0xc8bc('0x33'),_0x33434b+'-'+_0x58ff75+'/'+_0x2142cb)['json'](_0x272042);}return null;};}function patchUpdates(_0x3befaa){return function(_0x411969){try{jsonpatch[_0xc8bc('0x34')](_0x411969,_0x3befaa,!![]);}catch(_0x3ead22){return BPromise[_0xc8bc('0x35')](_0x3ead22);}return _0x411969[_0xc8bc('0x36')]();};}function saveUpdates(_0x35a0c4,_0x19f380){return function(_0x17c09c){if(_0x17c09c){return _0x17c09c[_0xc8bc('0x37')](_0x35a0c4)['then'](function(_0xbc01c5){return _0xbc01c5;});}return null;};}function removeEntity(_0x20e839,_0x187a3a){return function(_0x3b3a0a){if(_0x3b3a0a){return _0x3b3a0a['destroy']()['then'](function(){var _0x28e8c7=_0x3b3a0a[_0xc8bc('0x38')]({'plain':!![]});var _0x5be222=_0xc8bc('0x39');return db[_0xc8bc('0x3a')]['destroy']({'where':{'type':_0x5be222,'resourceId':_0x28e8c7['id']}})['then'](function(){return _0x3b3a0a;});})[_0xc8bc('0x21')](function(){_0x20e839[_0xc8bc('0x2c')](0xcc)[_0xc8bc('0x2d')]();});}};}function handleEntityNotFound(_0x49e587,_0x5f1576){return function(_0x32f064){if(!_0x32f064){_0x49e587[_0xc8bc('0x2b')](0x194);}return _0x32f064;};}function handleError(_0x24988d,_0x17c660){_0x17c660=_0x17c660||0x1f4;return function(_0x526641){logger[_0xc8bc('0x28')](_0x526641['stack']);if(_0x526641[_0xc8bc('0x3b')]){delete _0x526641['name'];}_0x24988d[_0xc8bc('0x2c')](_0x17c660)[_0xc8bc('0x3c')](_0x526641);};}exports[_0xc8bc('0x3d')]=function(_0x47960f,_0x421086){var _0x4f210d={'include':[{'model':db[_0xc8bc('0x3e')],'as':'mandatoryDispositionPause'}]},_0x308fb2={},_0xb06a3d={'count':0x0,'rows':[]};var _0x28b2da=_[_0xc8bc('0x3f')](db[_0xc8bc('0x40')][_0xc8bc('0x41')],function(_0x1eec17){return{'name':_0x1eec17[_0xc8bc('0x42')],'type':_0x1eec17['type']['key']};});_0x308fb2[_0xc8bc('0x43')]=_[_0xc8bc('0x3f')](_0x28b2da,_0xc8bc('0x3b'));_0x308fb2[_0xc8bc('0x44')]=_[_0xc8bc('0x45')](_0x47960f[_0xc8bc('0x44')]);_0x308fb2[_0xc8bc('0x46')]=_[_0xc8bc('0x47')](_0x308fb2[_0xc8bc('0x43')],_0x308fb2[_0xc8bc('0x44')]);_0x4f210d[_0xc8bc('0x48')]=_['intersection'](_0x308fb2[_0xc8bc('0x43')],qs[_0xc8bc('0x49')](_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x49')]));_0x4f210d['attributes']=_0x4f210d['attributes'][_0xc8bc('0x4a')]?_0x4f210d[_0xc8bc('0x48')]:_0x308fb2[_0xc8bc('0x43')];if(!_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x4b')](_0xc8bc('0x4c'))){_0x4f210d[_0xc8bc('0x30')]=qs[_0xc8bc('0x30')](_0x47960f[_0xc8bc('0x44')]['limit']);_0x4f210d[_0xc8bc('0x32')]=qs[_0xc8bc('0x32')](_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x32')]);}_0x4f210d[_0xc8bc('0x4d')]=qs['sort'](_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x4e')]);_0x4f210d[_0xc8bc('0x4f')]=qs['filters'](_[_0xc8bc('0x50')](_0x47960f[_0xc8bc('0x44')],_0x308fb2[_0xc8bc('0x46')]),_0x28b2da);if(_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x51')]){_0x4f210d[_0xc8bc('0x4f')]=_[_0xc8bc('0x52')](_0x4f210d[_0xc8bc('0x4f')],{'$or':_['map'](_0x28b2da,function(_0x3a3d11){if(_0x3a3d11['type']!==_0xc8bc('0x53')){var _0x23378e={};_0x23378e[_0x3a3d11[_0xc8bc('0x3b')]]={'$like':'%'+_0x47960f[_0xc8bc('0x44')][_0xc8bc('0x51')]+'%'};return _0x23378e;}})});}_0x4f210d=_['merge']({},_0x4f210d,_0x47960f[_0xc8bc('0x54')]);var _0xd7bf0b={'where':_0x4f210d['where']};return db[_0xc8bc('0x40')][_0xc8bc('0x31')](_0xd7bf0b)['then'](function(_0x160485){_0xb06a3d[_0xc8bc('0x31')]=_0x160485;if(_0x47960f[_0xc8bc('0x44')]['includeAll']){_0x4f210d[_0xc8bc('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xc8bc('0x56')](_0x4f210d);})['then'](function(_0x560356){_0xb06a3d[_0xc8bc('0x57')]=_0x560356;return _0xb06a3d;})[_0xc8bc('0x21')](respondWithFilteredResult(_0x421086,_0x4f210d))[_0xc8bc('0x2a')](handleError(_0x421086,null));};exports[_0xc8bc('0x58')]=function(_0x6bc37d,_0x1f4383){var _0x2ca26e={'raw':![],'where':{'id':_0x6bc37d[_0xc8bc('0x59')]['id']},'include':[{'model':db[_0xc8bc('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3f1dec={};_0x3f1dec[_0xc8bc('0x43')]=_[_0xc8bc('0x45')](db[_0xc8bc('0x40')][_0xc8bc('0x41')]);_0x3f1dec[_0xc8bc('0x44')]=_[_0xc8bc('0x45')](_0x6bc37d[_0xc8bc('0x44')]);_0x3f1dec[_0xc8bc('0x46')]=_[_0xc8bc('0x47')](_0x3f1dec['model'],_0x3f1dec[_0xc8bc('0x44')]);_0x2ca26e['attributes']=_[_0xc8bc('0x47')](_0x3f1dec[_0xc8bc('0x43')],qs['fields'](_0x6bc37d[_0xc8bc('0x44')][_0xc8bc('0x49')]));_0x2ca26e['attributes']=_0x2ca26e['attributes'][_0xc8bc('0x4a')]?_0x2ca26e[_0xc8bc('0x48')]:_0x3f1dec[_0xc8bc('0x43')];if(_0x6bc37d['query'][_0xc8bc('0x5a')]){_0x2ca26e[_0xc8bc('0x55')]=[{'all':!![]}];}_0x2ca26e=_[_0xc8bc('0x52')]({},_0x2ca26e,_0x6bc37d[_0xc8bc('0x54')]);return db[_0xc8bc('0x40')][_0xc8bc('0x5b')](_0x2ca26e)[_0xc8bc('0x21')](handleEntityNotFound(_0x1f4383,null))[_0xc8bc('0x21')](respondWithResult(_0x1f4383,null))[_0xc8bc('0x2a')](handleError(_0x1f4383,null));};exports[_0xc8bc('0x5c')]=function(_0x39096e,_0x21a83f){return db[_0xc8bc('0x40')][_0xc8bc('0x5c')](_0x39096e[_0xc8bc('0x5d')],{})[_0xc8bc('0x21')](function(_0x163745){var _0x24b0b2=_0x39096e['user']['get']({'plain':!![]});if(!_0x24b0b2)throw new Error(_0xc8bc('0x5e'));if(_0x24b0b2[_0xc8bc('0x5f')]===_0xc8bc('0x60')){var _0x4ad96e=_0x163745[_0xc8bc('0x38')]({'plain':!![]});var _0x2535c9='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x2535c9,'userProfileId':_0x24b0b2['userProfileId']},'raw':!![]})[_0xc8bc('0x21')](function(_0x296bfc){if(_0x296bfc&&_0x296bfc[_0xc8bc('0x61')]===0x0){return db[_0xc8bc('0x3a')][_0xc8bc('0x5c')]({'name':_0x4ad96e[_0xc8bc('0x3b')],'resourceId':_0x4ad96e['id'],'type':_0x296bfc[_0xc8bc('0x3b')],'sectionId':_0x296bfc['id']},{})['then'](function(){return _0x163745;});}else{return _0x163745;}})[_0xc8bc('0x2a')](function(_0x4dc735){logger[_0xc8bc('0x28')](_0xc8bc('0x62'),_0x4dc735);throw _0x4dc735;});}return _0x163745;})[_0xc8bc('0x21')](respondWithResult(_0x21a83f,0xc9))[_0xc8bc('0x2a')](handleError(_0x21a83f,null));};exports['update']=function(_0x4c7e6e,_0x1a27a1){if(_0x4c7e6e[_0xc8bc('0x5d')]['id']){delete _0x4c7e6e['body']['id'];}return db[_0xc8bc('0x40')][_0xc8bc('0x5b')]({'where':{'id':_0x4c7e6e[_0xc8bc('0x59')]['id']},'include':[{'model':db[_0xc8bc('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1a27a1,null))[_0xc8bc('0x21')](saveUpdates(_0x4c7e6e['body'],null))[_0xc8bc('0x21')](respondWithResult(_0x1a27a1,null))[_0xc8bc('0x2a')](handleError(_0x1a27a1,null));};exports[_0xc8bc('0x63')]=function(_0x216523,_0x493c5b){return db[_0xc8bc('0x40')][_0xc8bc('0x5b')]({'where':{'id':_0x216523[_0xc8bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x493c5b,null))[_0xc8bc('0x21')](removeEntity(_0x493c5b,null))[_0xc8bc('0x2a')](handleError(_0x493c5b,null));};exports['describe']=function(_0x44a4b4,_0x3c3de3){return db['OpenchannelAccount'][_0xc8bc('0x64')]()[_0xc8bc('0x21')](respondWithResult(_0x3c3de3,null))[_0xc8bc('0x2a')](handleError(_0x3c3de3,null));};exports[_0xc8bc('0x65')]=function(_0x2402f3,_0x333a4e,_0xd21e2e){if(_0x2402f3[_0xc8bc('0x5d')]['id']){delete _0x2402f3['body']['id'];}return db['OpenchannelAccount'][_0xc8bc('0x5b')]({'where':{'id':_0x2402f3[_0xc8bc('0x59')]['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x333a4e,null))[_0xc8bc('0x21')](function(_0x3ee869){if(_0x3ee869){_0x2402f3[_0xc8bc('0x5d')][_0xc8bc('0x66')]=_0x3ee869['id'];return db['Disposition'][_0xc8bc('0x5c')](_0x2402f3['body']);}})[_0xc8bc('0x21')](respondWithResult(_0x333a4e,null))[_0xc8bc('0x2a')](handleError(_0x333a4e,null));};exports[_0xc8bc('0x67')]=function(_0x23e564,_0x3279e0,_0x1d3fec){var _0x17f6d0={'raw':![],'where':{}};var _0xe5faba={};var _0x3471e4={'count':0x0,'rows':[]};return db[_0xc8bc('0x40')][_0xc8bc('0x68')]({'where':{'id':_0x23e564['params']['id']}})['then'](handleEntityNotFound(_0x3279e0,null))[_0xc8bc('0x21')](function(_0x2e14e6){if(_0x2e14e6){_0xe5faba['model']=_['keys'](db[_0xc8bc('0x69')][_0xc8bc('0x41')]);_0xe5faba[_0xc8bc('0x44')]=_['keys'](_0x23e564['query']);_0xe5faba['filters']=_[_0xc8bc('0x47')](_0xe5faba[_0xc8bc('0x43')],_0xe5faba[_0xc8bc('0x44')]);_0x17f6d0[_0xc8bc('0x48')]=_[_0xc8bc('0x47')](_0xe5faba['model'],qs[_0xc8bc('0x49')](_0x23e564[_0xc8bc('0x44')][_0xc8bc('0x49')]));_0x17f6d0[_0xc8bc('0x48')]=_0x17f6d0[_0xc8bc('0x48')][_0xc8bc('0x4a')]?_0x17f6d0[_0xc8bc('0x48')]:_0xe5faba['model'];if(!_0x23e564[_0xc8bc('0x44')][_0xc8bc('0x4b')](_0xc8bc('0x4c'))){_0x17f6d0[_0xc8bc('0x30')]=qs[_0xc8bc('0x30')](_0x23e564[_0xc8bc('0x44')]['limit']);_0x17f6d0[_0xc8bc('0x32')]=qs[_0xc8bc('0x32')](_0x23e564[_0xc8bc('0x44')][_0xc8bc('0x32')]);}_0x17f6d0[_0xc8bc('0x4d')]=qs[_0xc8bc('0x4e')](_0x23e564[_0xc8bc('0x44')]['sort']);_0x17f6d0[_0xc8bc('0x4f')]=qs[_0xc8bc('0x46')](_[_0xc8bc('0x50')](_0x23e564[_0xc8bc('0x44')],_0xe5faba[_0xc8bc('0x46')]));_0x17f6d0[_0xc8bc('0x4f')]['OpenchannelAccountId']=_0x2e14e6['id'];if(_0x23e564[_0xc8bc('0x44')][_0xc8bc('0x51')]){_0x17f6d0[_0xc8bc('0x4f')]=_['merge'](_0x17f6d0[_0xc8bc('0x4f')],{'$or':_['map'](_0x17f6d0[_0xc8bc('0x48')],function(_0x273337){var _0x577798={};_0x577798[_0x273337]={'$like':'%'+_0x23e564[_0xc8bc('0x44')][_0xc8bc('0x51')]+'%'};return _0x577798;})});}_0x17f6d0=_['merge']({},_0x17f6d0,_0x23e564['options']);return db['Disposition'][_0xc8bc('0x31')]({'where':_0x17f6d0['where']})['then'](function(_0x3bac6b){_0x3471e4[_0xc8bc('0x31')]=_0x3bac6b;if(_0x23e564['query']['includeAll']){_0x17f6d0[_0xc8bc('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xc8bc('0x56')](_0x17f6d0);})[_0xc8bc('0x21')](function(_0x120213){_0x3471e4['rows']=_0x120213;return _0x3471e4;});}})['then'](respondWithFilteredResult(_0x3279e0,_0x17f6d0))['catch'](handleError(_0x3279e0,null));};exports[_0xc8bc('0x6a')]=function(_0x2fe561,_0x314769,_0x2dde05){return db['OpenchannelAccount'][_0xc8bc('0x5b')]({'where':{'id':_0x2fe561[_0xc8bc('0x59')]['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x314769,null))[_0xc8bc('0x21')](function(_0xf7cdf9){if(_0xf7cdf9){return _0xf7cdf9[_0xc8bc('0x6a')](_0x2fe561['query'][_0xc8bc('0x6b')]);}})[_0xc8bc('0x21')](respondWithStatusCode(_0x314769,null))['catch'](handleError(_0x314769,null));};exports[_0xc8bc('0x6c')]=function(_0x4254fd,_0x43d92a,_0x3ae9dd){if(_0x4254fd[_0xc8bc('0x5d')]['id']){delete _0x4254fd[_0xc8bc('0x5d')]['id'];}return db[_0xc8bc('0x40')][_0xc8bc('0x5b')]({'where':{'id':_0x4254fd['params']['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x43d92a,null))[_0xc8bc('0x21')](function(_0x289339){if(_0x289339){_0x4254fd[_0xc8bc('0x5d')]['OpenchannelAccountId']=_0x289339['id'];return db['CannedAnswer']['create'](_0x4254fd[_0xc8bc('0x5d')]);}})['then'](respondWithResult(_0x43d92a,null))[_0xc8bc('0x2a')](handleError(_0x43d92a,null));};exports['getAnswers']=function(_0x5ac983,_0x25fed2,_0x29d547){var _0xd643e2={'raw':![],'where':{}};var _0x2551b0={};var _0x20e397={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5ac983[_0xc8bc('0x59')]['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x25fed2,null))[_0xc8bc('0x21')](function(_0x1d8aa2){if(_0x1d8aa2){_0x2551b0[_0xc8bc('0x43')]=_['keys'](db[_0xc8bc('0x6d')][_0xc8bc('0x41')]);_0x2551b0[_0xc8bc('0x44')]=_['keys'](_0x5ac983[_0xc8bc('0x44')]);_0x2551b0['filters']=_[_0xc8bc('0x47')](_0x2551b0['model'],_0x2551b0[_0xc8bc('0x44')]);_0xd643e2[_0xc8bc('0x48')]=_['intersection'](_0x2551b0['model'],qs['fields'](_0x5ac983['query'][_0xc8bc('0x49')]));_0xd643e2['attributes']=_0xd643e2['attributes'][_0xc8bc('0x4a')]?_0xd643e2[_0xc8bc('0x48')]:_0x2551b0[_0xc8bc('0x43')];if(!_0x5ac983['query'][_0xc8bc('0x4b')](_0xc8bc('0x4c'))){_0xd643e2[_0xc8bc('0x30')]=qs[_0xc8bc('0x30')](_0x5ac983['query']['limit']);_0xd643e2[_0xc8bc('0x32')]=qs[_0xc8bc('0x32')](_0x5ac983[_0xc8bc('0x44')][_0xc8bc('0x32')]);}_0xd643e2['order']=qs['sort'](_0x5ac983[_0xc8bc('0x44')][_0xc8bc('0x4e')]);_0xd643e2[_0xc8bc('0x4f')]=qs[_0xc8bc('0x46')](_['pick'](_0x5ac983[_0xc8bc('0x44')],_0x2551b0[_0xc8bc('0x46')]));_0xd643e2[_0xc8bc('0x4f')][_0xc8bc('0x66')]=_0x1d8aa2['id'];if(_0x5ac983['query'][_0xc8bc('0x51')]){_0xd643e2[_0xc8bc('0x4f')]=_[_0xc8bc('0x52')](_0xd643e2[_0xc8bc('0x4f')],{'$or':_[_0xc8bc('0x3f')](_0xd643e2['attributes'],function(_0x1e2102){var _0x5a96c5={};_0x5a96c5[_0x1e2102]={'$like':'%'+_0x5ac983[_0xc8bc('0x44')][_0xc8bc('0x51')]+'%'};return _0x5a96c5;})});}_0xd643e2=_['merge']({},_0xd643e2,_0x5ac983[_0xc8bc('0x54')]);return db[_0xc8bc('0x6d')][_0xc8bc('0x31')]({'where':_0xd643e2[_0xc8bc('0x4f')]})[_0xc8bc('0x21')](function(_0x45547c){_0x20e397[_0xc8bc('0x31')]=_0x45547c;if(_0x5ac983[_0xc8bc('0x44')][_0xc8bc('0x5a')]){_0xd643e2[_0xc8bc('0x55')]=[{'all':!![]}];}return db[_0xc8bc('0x6d')][_0xc8bc('0x56')](_0xd643e2);})['then'](function(_0x649d7d){_0x20e397[_0xc8bc('0x57')]=_0x649d7d;return _0x20e397;});}})[_0xc8bc('0x21')](respondWithFilteredResult(_0x25fed2,_0xd643e2))[_0xc8bc('0x2a')](handleError(_0x25fed2,null));};exports[_0xc8bc('0x6e')]=function(_0x105e09,_0x99443e,_0x2689a8){return db['OpenchannelAccount'][_0xc8bc('0x5b')]({'where':{'id':_0x105e09['params']['id']}})['then'](handleEntityNotFound(_0x99443e,null))[_0xc8bc('0x21')](function(_0x8c1105){if(_0x8c1105){return _0x8c1105[_0xc8bc('0x6e')](_0x105e09[_0xc8bc('0x44')][_0xc8bc('0x6b')]);}})[_0xc8bc('0x21')](respondWithStatusCode(_0x99443e,null))['catch'](handleError(_0x99443e,null));};exports[_0xc8bc('0x6f')]=function(_0x4ab8fa,_0x11da26,_0x516faf){var _0x4fde94={'body':_0x4ab8fa[_0xc8bc('0x5d')],'channel':_0xc8bc('0x70')};var _0x4afad7=[];var _0x49c25b=[];var _0x1a76f5={};var _0x12653d=![];return db[_0xc8bc('0x71')][_0xc8bc('0x64')]()[_0xc8bc('0x21')](function(_0x1543dd){if(!_0x1543dd){throw new db[(_0xc8bc('0x72'))][(_0xc8bc('0x73'))](_0xc8bc('0x74'));}_0x4afad7=_[_0xc8bc('0x75')](_['keys'](_0x1543dd),['createdAt','updatedAt']);_0x49c25b=_[_0xc8bc('0x75')](_[_0xc8bc('0x45')](_0x1543dd),[_0xc8bc('0x76'),_0xc8bc('0x77'),'CompanyId',_0xc8bc('0x78')]);if(_0x4ab8fa[_0xc8bc('0x5d')]['id']){delete _0x4ab8fa[_0xc8bc('0x5d')]['id'];}if(_[_0xc8bc('0x79')](_0x4ab8fa['body'][_0xc8bc('0x7a')])){throw new db['Sequelize'][(_0xc8bc('0x73'))](_0xc8bc('0x7b'));}if(_['isNil'](_0x4ab8fa['body'][_0xc8bc('0x5d')])||_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x5d')]===''){throw new db[(_0xc8bc('0x72'))][(_0xc8bc('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x7c')])){throw new db[(_0xc8bc('0x72'))][(_0xc8bc('0x73'))](_0xc8bc('0x7d')+_0x49c25b);}if(!_[_0xc8bc('0x7e')](_0x49c25b,_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x7c')])){throw new db[(_0xc8bc('0x72'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49c25b);}_0x1a76f5[_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x7c')]]=_0x4ab8fa['body'][_0xc8bc('0x7a')];})[_0xc8bc('0x21')](function(){return db['OpenchannelAccount'][_0xc8bc('0x5b')]({'where':{'id':_0x4ab8fa[_0xc8bc('0x59')]['id']},'include':[{'model':db[_0xc8bc('0x7f')],'as':'List','include':[{'model':db[_0xc8bc('0x71')],'as':'Contacts','where':_0x1a76f5,'limit':0x1,'order':[[_0xc8bc('0x77'),_0xc8bc('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xc8bc('0x21')](handleEntityNotFound(_0x11da26,null))[_0xc8bc('0x21')](function(_0xc220c8){if(_0xc220c8&&_0xc220c8[_0xc8bc('0x81')]){_0x4fde94[_0xc8bc('0x82')]=_0xc220c8;_0x4fde94['applications']=_0xc220c8['Applications'];_0x4fde94['list']=_0xc220c8[_0xc8bc('0x81')];_0x4fde94[_0xc8bc('0x83')]=_[_0xc8bc('0x84')](_0x4fde94[_0xc8bc('0x83')],[_0xc8bc('0x85')],[_0xc8bc('0x86')]);if(_0x4fde94[_0xc8bc('0x82')][_0xc8bc('0x87')]){delete _0x4fde94[_0xc8bc('0x82')][_0xc8bc('0x87')];}if(_0x4fde94[_0xc8bc('0x82')][_0xc8bc('0x81')]&&_0x4fde94[_0xc8bc('0x82')][_0xc8bc('0x81')][_0xc8bc('0x88')]['length']){return _0x4fde94['account'][_0xc8bc('0x81')][_0xc8bc('0x88')][0x0];}var _0x17955f=_[_0xc8bc('0x19')](_0x4ab8fa[_0xc8bc('0x5d')],{'firstName':_0x4ab8fa[_0xc8bc('0x5d')]['from'],'ListId':_0xc220c8[_0xc8bc('0x78')]});_0x17955f[_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x7c')]]=_0x4ab8fa['body'][_0xc8bc('0x7a')];return db[_0xc8bc('0x71')][_0xc8bc('0x5c')](_0x17955f,{'fields':_0x4afad7,'raw':!![]});}})['then'](handleEntityNotFound(_0x11da26,null))[_0xc8bc('0x21')](function(_0x1e9ac3){_0x4fde94[_0xc8bc('0x89')]=_0x1e9ac3;if(_0x1e9ac3){var _0xd5a2a7={'ContactId':_0x1e9ac3['id'],'OpenchannelAccountId':_0x4ab8fa['params']['id'],'from':(_0x1e9ac3[_0xc8bc('0x8a')]||'')+'\x20'+(_0x1e9ac3[_0xc8bc('0x8b')]||'')};var _0x2204a2={'OpenchannelAccountId':_0x4ab8fa[_0xc8bc('0x59')]['id'],'closed':![]};if(_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x8c')]){_0x2204a2[_0xc8bc('0x8c')]=_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x8c')];return db[_0xc8bc('0x8d')][_0xc8bc('0x5b')]({'where':_0x2204a2})[_0xc8bc('0x21')](function(_0x25ee94){if(_0x25ee94){return[_0x25ee94,![]];}_0xd5a2a7['threadId']=_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x8c')];_0xd5a2a7[_0xc8bc('0x8e')]=_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x8e')];return db[_0xc8bc('0x8d')]['create'](_0xd5a2a7)[_0xc8bc('0x21')](function(_0x218ce0){return[_0x218ce0,!![]];});});}else{_0x2204a2[_0xc8bc('0x8c')]=null;}_0x2204a2[_0xc8bc('0x8f')]=_0x1e9ac3['id'];return db[_0xc8bc('0x8d')][_0xc8bc('0x5b')]({'where':_0x2204a2})['then'](function(_0x427744){if(_0x427744){return[_0x427744,![]];}return db[_0xc8bc('0x8d')][_0xc8bc('0x5c')](_0xd5a2a7)['then'](function(_0x31020c){return[_0x31020c,!![]];});});}})[_0xc8bc('0x90')](function(_0x14bf70,_0x3b734c){if(_0x14bf70){_0x12653d=_0x3b734c;if(!_0x3b734c){var _0x43fba1={'from':(_0x4fde94[_0xc8bc('0x89')]['firstName']||'')+'\x20'+(_0x4fde94[_0xc8bc('0x89')][_0xc8bc('0x8b')]||'')};if(_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x8c')]&&_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x91')]&&_0x4ab8fa[_0xc8bc('0x5d')]['threadId']!=_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x91')]){_0x43fba1[_0xc8bc('0x8c')]=_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x91')];}return _0x14bf70[_0xc8bc('0x37')](_0x43fba1);}else{return _0x14bf70;}}})[_0xc8bc('0x21')](function(_0x166ac8){_0x4fde94['interaction']=_0x166ac8[_0xc8bc('0x38')]({'plain':!![]});_0x4fde94[_0xc8bc('0x92')][_0xc8bc('0x93')]=_0x12653d;if(_0x4fde94['interaction']['created']){if(_0x4fde94['account']['autoclose']){_0x4fde94[_0xc8bc('0x83')][_0xc8bc('0x94')]({'id':0x0,'priority':_0x4fde94[_0xc8bc('0x83')]['length']+0x1,'app':_0xc8bc('0x95'),'appdata':'unmanaged','interval':_0xc8bc('0x96')});}}return db[_0xc8bc('0x97')]['create']({'body':_0x4ab8fa['body'][_0xc8bc('0x5d')],'OpenchannelAccountId':_0x4ab8fa[_0xc8bc('0x59')]['id'],'OpenchannelInteractionId':_0x166ac8['id'],'direction':'in','ContactId':_0x4fde94['contact']['id'],'AttachmentId':_0x4ab8fa[_0xc8bc('0x5d')][_0xc8bc('0x98')]});})['then'](function(_0x380a36){_0x4fde94[_0xc8bc('0x29')]=_0x380a36;if(_0x4fde94[_0xc8bc('0x92')][_0xc8bc('0x99')]){return db[_0xc8bc('0x9a')][_0xc8bc('0x5b')]({'attributes':['id','name'],'where':{'id':_0x4fde94['interaction'][_0xc8bc('0x99')]}})[_0xc8bc('0x21')](function(_0x4087f7){if(_0x4087f7){_0x4fde94[_0xc8bc('0x83')][_0xc8bc('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4087f7[_0xc8bc('0x3b')]+','+(_0x4fde94['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc8bc('0x96')});_0x4fde94[_0xc8bc('0x9c')]=![];}return respondWithRpcPromise(_0xc8bc('0x9d'),_0xc8bc('0x9e'),_0x4fde94);});}return respondWithRpcPromise('Start',_0xc8bc('0x9e'),_0x4fde94);})[_0xc8bc('0x21')](function(_0x914ac5){respondWithRpcPromise(_0xc8bc('0x9f'),_0xc8bc('0x9f'),{'event':'notify','message':_0x914ac5},client9002);return _0x914ac5;})[_0xc8bc('0x21')](respondWithResult(_0x11da26,null))[_0xc8bc('0x2a')](handleError(_0x11da26,null));};exports[_0xc8bc('0xa0')]=function(_0x3c91ee,_0x18db36){var _0x125c66=_0x3c91ee[_0xc8bc('0x59')]['id'];var _0x43801d=_0x3c91ee[_0xc8bc('0x5d')];var _0x5f4587=0xc8;var _0x142318=null;return db[_0xc8bc('0xa1')]['transaction']({'isolationLevel':db[_0xc8bc('0xa1')][_0xc8bc('0xa2')][_0xc8bc('0xa3')][_0xc8bc('0xa4')]},function(_0x31a95c){return db[_0xc8bc('0x40')]['findOne']({'where':{'id':_0x125c66},'transaction':_0x31a95c})[_0xc8bc('0x21')](function(_0x537a7d){if(_0x537a7d){return db[_0xc8bc('0xa5')][_0xc8bc('0x63')]({'where':{'OpenchannelAccountId':_0x125c66},'transaction':_0x31a95c})[_0xc8bc('0x21')](function(){var _0x29f6d2=_[_0xc8bc('0x3f')](_0x43801d,function(_0x5889ed){_0x5889ed['OpenchannelAccountId']=_0x125c66;return _0x5889ed;});return db[_0xc8bc('0xa5')]['bulkCreate'](_0x29f6d2,{'transaction':_0x31a95c});});}else{_0x5f4587=0x194;_0x142318=[];}});})[_0xc8bc('0x21')](function(){if(_0x5f4587!==0x194){return db[_0xc8bc('0xa5')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x125c66},'order':'priority'})[_0xc8bc('0x21')](function(_0x3cdd26){_0x142318=_0x3cdd26;});}})[_0xc8bc('0x2a')](function(_0x61df7e){_0x5f4587=0x1f4;logger['error'](_0x61df7e['stack']);if(_0x61df7e['name']){delete _0x61df7e['name'];}_0x142318=_0x61df7e;})[_0xc8bc('0xa6')](function(){if(_0x142318===null){_0x18db36[_0xc8bc('0x2b')](_0x5f4587);}else{if(_0x5f4587===0x1f4){_0x18db36['status'](_0x5f4587)[_0xc8bc('0x3c')](_0x142318);}else{_0x18db36['status'](_0x5f4587)['json'](_0x142318);}}});};exports[_0xc8bc('0xa7')]=function(_0x5d08c3,_0x33e9ca,_0x2b2ccf){var _0x4bd91c={};var _0x4a360d={};var _0xdcbe9d;var _0x1df733;return db[_0xc8bc('0x40')][_0xc8bc('0x68')]({'where':{'id':_0x5d08c3[_0xc8bc('0x59')]['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x33e9ca,null))['then'](function(_0x5e4b02){if(_0x5e4b02){_0xdcbe9d=_0x5e4b02;_0x4a360d[_0xc8bc('0x43')]=_[_0xc8bc('0x45')](db[_0xc8bc('0xa5')][_0xc8bc('0x41')]);_0x4a360d['query']=_[_0xc8bc('0x45')](_0x5d08c3[_0xc8bc('0x44')]);_0x4a360d['filters']=_[_0xc8bc('0x47')](_0x4a360d['model'],_0x4a360d[_0xc8bc('0x44')]);_0x4bd91c[_0xc8bc('0x48')]=_[_0xc8bc('0x47')](_0x4a360d[_0xc8bc('0x43')],qs[_0xc8bc('0x49')](_0x5d08c3['query'][_0xc8bc('0x49')]));_0x4bd91c[_0xc8bc('0x48')]=_0x4bd91c['attributes'][_0xc8bc('0x4a')]?_0x4bd91c['attributes']:_0x4a360d[_0xc8bc('0x43')];_0x4bd91c[_0xc8bc('0x4d')]=qs['sort'](_0x5d08c3[_0xc8bc('0x44')]['sort']);_0x4bd91c[_0xc8bc('0x4f')]=qs[_0xc8bc('0x46')](_[_0xc8bc('0x50')](_0x5d08c3[_0xc8bc('0x44')],_0x4a360d[_0xc8bc('0x46')]));if(_0x5d08c3[_0xc8bc('0x44')]['filter']){_0x4bd91c[_0xc8bc('0x4f')]=_[_0xc8bc('0x52')](_0x4bd91c[_0xc8bc('0x4f')],{'$or':_[_0xc8bc('0x3f')](_0x4bd91c[_0xc8bc('0x48')],function(_0x41b380){var _0xa99735={};_0xa99735[_0x41b380]={'$like':'%'+_0x5d08c3[_0xc8bc('0x44')][_0xc8bc('0x51')]+'%'};return _0xa99735;})});}_0x4bd91c=_[_0xc8bc('0x52')]({},_0x4bd91c,_0x5d08c3[_0xc8bc('0x54')]);return _0xdcbe9d[_0xc8bc('0xa7')](_0x4bd91c);}})[_0xc8bc('0x21')](function(_0x3f8717){if(_0x3f8717){_0x1df733=_0x3f8717[_0xc8bc('0x4a')];if(!_0x5d08c3['query']['hasOwnProperty'](_0xc8bc('0x4c'))){_0x4bd91c[_0xc8bc('0x30')]=qs[_0xc8bc('0x30')](_0x5d08c3[_0xc8bc('0x44')]['limit']);_0x4bd91c[_0xc8bc('0x32')]=qs[_0xc8bc('0x32')](_0x5d08c3['query'][_0xc8bc('0x32')]);}return _0xdcbe9d['getApplications'](_0x4bd91c);}})[_0xc8bc('0x21')](function(_0x24dc33){if(_0x24dc33){return _0x24dc33?{'count':_0x1df733,'rows':_0x24dc33}:null;}})[_0xc8bc('0x21')](respondWithResult(_0x33e9ca,null))[_0xc8bc('0x2a')](handleError(_0x33e9ca,null));};exports['getInteractions']=function(_0xe138d3,_0x5116dd,_0x415a7b){var _0x380e97={'raw':![],'where':{}};var _0x38a3e8={};var _0x3f31fd={'count':0x0,'rows':[]};return db[_0xc8bc('0x40')][_0xc8bc('0x68')]({'where':{'id':_0xe138d3[_0xc8bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x5116dd,null))[_0xc8bc('0x21')](function(_0x55ae85){if(_0x55ae85){_0x38a3e8['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x38a3e8['query']=_[_0xc8bc('0x45')](_0xe138d3[_0xc8bc('0x44')]);_0x38a3e8['filters']=_[_0xc8bc('0x47')](_0x38a3e8[_0xc8bc('0x43')],_0x38a3e8['query']);_0x380e97[_0xc8bc('0x48')]=_[_0xc8bc('0x47')](_0x38a3e8['model'],qs['fields'](_0xe138d3['query'][_0xc8bc('0x49')]));_0x380e97['attributes']=_0x380e97[_0xc8bc('0x48')][_0xc8bc('0x4a')]?_0x380e97[_0xc8bc('0x48')]:_0x38a3e8['model'];if(!_0xe138d3[_0xc8bc('0x44')][_0xc8bc('0x4b')](_0xc8bc('0x4c'))){_0x380e97[_0xc8bc('0x30')]=qs['limit'](_0xe138d3[_0xc8bc('0x44')][_0xc8bc('0x30')]);_0x380e97['offset']=qs['offset'](_0xe138d3['query'][_0xc8bc('0x32')]);}_0x380e97[_0xc8bc('0x4d')]=qs[_0xc8bc('0x4e')](_0xe138d3[_0xc8bc('0x44')][_0xc8bc('0x4e')]);_0x380e97[_0xc8bc('0x4f')]=qs['filters'](_[_0xc8bc('0x50')](_0xe138d3[_0xc8bc('0x44')],_0x38a3e8[_0xc8bc('0x46')]));_0x380e97['where']['OpenchannelAccountId']=_0x55ae85['id'];if(_0xe138d3['query'][_0xc8bc('0x51')]){_0x380e97[_0xc8bc('0x4f')]=_[_0xc8bc('0x52')](_0x380e97[_0xc8bc('0x4f')],{'$or':_[_0xc8bc('0x3f')](_0x380e97[_0xc8bc('0x48')],function(_0x411bfe){var _0x54ae21={};_0x54ae21[_0x411bfe]={'$like':'%'+_0xe138d3[_0xc8bc('0x44')]['filter']+'%'};return _0x54ae21;})});}_0x380e97=_[_0xc8bc('0x52')]({},_0x380e97,_0xe138d3['options']);return db['OpenchannelInteraction'][_0xc8bc('0x31')]({'where':_0x380e97[_0xc8bc('0x4f')]})[_0xc8bc('0x21')](function(_0x382774){_0x3f31fd['count']=_0x382774;if(_0xe138d3['query'][_0xc8bc('0x5a')]){_0x380e97[_0xc8bc('0x55')]=[{'model':db[_0xc8bc('0x71')],'as':_0xc8bc('0xa8'),'required':![]},{'model':db[_0xc8bc('0x9a')],'as':'Owner','attributes':['name',_0xc8bc('0xa9'),_0xc8bc('0xaa')],'required':![]},{'model':db[_0xc8bc('0xab')],'as':_0xc8bc('0xac'),'attributes':['id',_0xc8bc('0x3b'),_0xc8bc('0xad')],'where':_0xe138d3[_0xc8bc('0x44')][_0xc8bc('0xae')]?{'id':_0xe138d3['query'][_0xc8bc('0xae')]}:undefined,'required':_0xe138d3[_0xc8bc('0x44')][_0xc8bc('0xae')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x380e97);})[_0xc8bc('0x21')](function(_0x155e77){_0x3f31fd[_0xc8bc('0x57')]=_0x155e77;return _0x3f31fd;});}})[_0xc8bc('0x21')](respondWithFilteredResult(_0x5116dd,_0x380e97))['catch'](handleError(_0x5116dd,null));};exports[_0xc8bc('0xaf')]=function(_0x506b24,_0xb7703d,_0x5b1d13){return db[_0xc8bc('0x40')][_0xc8bc('0x5b')]({'where':{'id':_0x506b24['params']['id']}})['then'](handleEntityNotFound(_0xb7703d,null))[_0xc8bc('0x21')](function(_0x44b077){if(_0x44b077){return _0x44b077[_0xc8bc('0xaf')](_0x506b24[_0xc8bc('0x5d')][_0xc8bc('0x6b')],_[_0xc8bc('0xb0')](_0x506b24[_0xc8bc('0x5d')],['ids','id'])||{})[_0xc8bc('0x90')](function(_0x2671e5){for(var _0x25853f=0x0;_0x25853f<_0x506b24['body'][_0xc8bc('0x6b')]['length'];_0x25853f+=0x1){socket[_0xc8bc('0xb1')](_0xc8bc('0xb2'),{'UserId':Number(_0x506b24[_0xc8bc('0x5d')][_0xc8bc('0x6b')][_0x25853f]),'OpenchannelAccountId':Number(_0x506b24['params']['id'])});}return _0x2671e5;});}})[_0xc8bc('0x21')](respondWithResult(_0xb7703d,null))[_0xc8bc('0x2a')](handleError(_0xb7703d,null));};exports[_0xc8bc('0xb3')]=function(_0x7f64d,_0x22e941,_0x3df13c){return db[_0xc8bc('0x40')]['find']({'where':{'id':_0x7f64d[_0xc8bc('0x59')]['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x22e941,null))[_0xc8bc('0x21')](function(_0xe4254d){if(_0xe4254d){return _0xe4254d[_0xc8bc('0xb3')](_0x7f64d[_0xc8bc('0x44')]['ids'])[_0xc8bc('0x21')](function(){if(_['isArray'](_0x7f64d[_0xc8bc('0x44')][_0xc8bc('0x6b')])){for(var _0x32b92b=0x0;_0x32b92b<_0x7f64d[_0xc8bc('0x44')][_0xc8bc('0x6b')][_0xc8bc('0x4a')];_0x32b92b+=0x1){socket[_0xc8bc('0xb1')](_0xc8bc('0xb4'),{'UserId':Number(_0x7f64d[_0xc8bc('0x44')][_0xc8bc('0x6b')][_0x32b92b]),'OpenchannelAccountId':Number(_0x7f64d[_0xc8bc('0x59')]['id'])});}}else{socket['emit'](_0xc8bc('0xb4'),{'UserId':Number(_0x7f64d[_0xc8bc('0x44')][_0xc8bc('0x6b')]),'OpenchannelAccountId':Number(_0x7f64d[_0xc8bc('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x22e941,null))[_0xc8bc('0x2a')](handleError(_0x22e941,null));};exports[_0xc8bc('0xb5')]=function(_0x219f4b,_0x2b9a58,_0x59db70){var _0x5d54cc={};var _0x22ae41={};var _0x5d775d;var _0x1cb39d;return db[_0xc8bc('0x40')][_0xc8bc('0x68')]({'where':{'id':_0x219f4b[_0xc8bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x2b9a58,null))[_0xc8bc('0x21')](function(_0x4a3c11){if(_0x4a3c11){_0x5d775d=_0x4a3c11;_0x22ae41[_0xc8bc('0x43')]=_['keys'](db[_0xc8bc('0x9a')][_0xc8bc('0x41')]);_0x22ae41['query']=_[_0xc8bc('0x45')](_0x219f4b['query']);_0x22ae41[_0xc8bc('0x46')]=_[_0xc8bc('0x47')](_0x22ae41[_0xc8bc('0x43')],_0x22ae41['query']);_0x5d54cc[_0xc8bc('0x48')]=_[_0xc8bc('0x47')](_0x22ae41[_0xc8bc('0x43')],qs[_0xc8bc('0x49')](_0x219f4b['query'][_0xc8bc('0x49')]));_0x5d54cc[_0xc8bc('0x48')]=_0x5d54cc[_0xc8bc('0x48')][_0xc8bc('0x4a')]?_0x5d54cc['attributes']:_0x22ae41['model'];_0x5d54cc[_0xc8bc('0x4d')]=qs['sort'](_0x219f4b['query']['sort']);_0x5d54cc[_0xc8bc('0x4f')]=qs['filters'](_['pick'](_0x219f4b[_0xc8bc('0x44')],_0x22ae41[_0xc8bc('0x46')]));if(_0x219f4b[_0xc8bc('0x44')]['filter']){_0x5d54cc[_0xc8bc('0x4f')]=_[_0xc8bc('0x52')](_0x5d54cc['where'],{'$or':_[_0xc8bc('0x3f')](_0x5d54cc[_0xc8bc('0x48')],function(_0x52706f){var _0x370de2={};_0x370de2[_0x52706f]={'$like':'%'+_0x219f4b['query'][_0xc8bc('0x51')]+'%'};return _0x370de2;})});}_0x5d54cc=_[_0xc8bc('0x52')]({},_0x5d54cc,_0x219f4b[_0xc8bc('0x54')]);return _0x5d775d['getAgents'](_0x5d54cc);}})['then'](function(_0x5c525f){if(_0x5c525f){_0x1cb39d=_0x5c525f[_0xc8bc('0x4a')];if(!_0x219f4b[_0xc8bc('0x44')][_0xc8bc('0x4b')]('nolimit')){_0x5d54cc[_0xc8bc('0x30')]=qs[_0xc8bc('0x30')](_0x219f4b[_0xc8bc('0x44')][_0xc8bc('0x30')]);_0x5d54cc[_0xc8bc('0x32')]=qs[_0xc8bc('0x32')](_0x219f4b[_0xc8bc('0x44')][_0xc8bc('0x32')]);}return _0x5d775d[_0xc8bc('0xb5')](_0x5d54cc);}})[_0xc8bc('0x21')](function(_0x343b57){if(_0x343b57){return _0x343b57?{'count':_0x1cb39d,'rows':_0x343b57}:null;}})[_0xc8bc('0x21')](respondWithResult(_0x2b9a58,null))[_0xc8bc('0x2a')](handleError(_0x2b9a58,null));};exports[_0xc8bc('0x3c')]=function(_0x2df074,_0x234416,_0x3b3e91){var _0xf36186,_0x52e3e8,_0x42effe;if(_[_0xc8bc('0x79')](_0x2df074[_0xc8bc('0x5d')][_0xc8bc('0x5d')])||_0x2df074[_0xc8bc('0x5d')][_0xc8bc('0x5d')]===''){throw new db[(_0xc8bc('0x72'))][(_0xc8bc('0x73'))](_0xc8bc('0xb6'));}if(_['isNil'](_0x2df074[_0xc8bc('0x5d')]['to'])){}_0xf36186=_0x2df074[_0xc8bc('0x5d')]['to'];return db['OpenchannelAccount'][_0xc8bc('0x68')]({'where':{'id':_0x2df074['params']['id']}})[_0xc8bc('0x21')](handleEntityNotFound(_0x234416,null))[_0xc8bc('0x21')](function(_0x4cd4b7){if(_0x4cd4b7){return db[_0xc8bc('0x40')]['find']({'where':{'id':_0x4cd4b7['id']},'include':[{'model':db[_0xc8bc('0x7f')],'as':_0xc8bc('0x81'),'include':[{'model':db['CmContact'],'as':_0xc8bc('0x88'),'where':{[_0x4cd4b7[_0xc8bc('0x7c')]]:_0xf36186},'limit':0x1,'order':[['updatedAt',_0xc8bc('0x80')]]}]}]})[_0xc8bc('0x21')](handleEntityNotFound(_0x234416,null))['then'](function(_0x1ce184){if(_0x1ce184&&_0x1ce184[_0xc8bc('0x81')]){_0x52e3e8=_0x1ce184['get']({'plain':!![]});if(_0x52e3e8[_0xc8bc('0x81')]&&_0x52e3e8['List']['Contacts'][_0xc8bc('0x4a')]){return _0x52e3e8[_0xc8bc('0x81')][_0xc8bc('0x88')][0x0];}return db['CmContact']['create'](_[_0xc8bc('0x19')](_0x2df074[_0xc8bc('0x5d')],{'firstName':_0xf36186,[_0x1ce184['mapKey']]:_0xf36186,'phone':_0xf36186,'ListId':_0x52e3e8['ListId']}));}})['then'](handleEntityNotFound(_0x234416,null))[_0xc8bc('0x21')](function(_0x1fc334){if(_0x1fc334){_0x42effe=_0x1fc334;return db[_0xc8bc('0x8d')]['find']({'where':{'ContactId':_0x42effe['id'],'closed':![],'OpenchannelAccountId':_0x52e3e8['id']}})[_0xc8bc('0x21')](function(_0x42217b){if(_0x42217b){return[_0x42217b,![]];}return db[_0xc8bc('0x8d')][_0xc8bc('0x5c')]({'UserId':_0x2df074[_0xc8bc('0x60')]['id'],'ContactId':_0x42effe['id'],'OpenchannelAccountId':_0x52e3e8['id'],'lastMsgDirection':_0xc8bc('0xb7'),'Messages':[_[_0xc8bc('0x52')](_0x2df074[_0xc8bc('0x5d')],{'read':![],'body':_0x2df074['body'][_0xc8bc('0x5d')],'OpenchannelAccountId':_0x52e3e8['id'],'UserId':_0x2df074[_0xc8bc('0x60')]['id'],'ContactId':_0x42effe['id']})]},{'include':[{'model':db[_0xc8bc('0x97')],'as':_0xc8bc('0xb8')}]})[_0xc8bc('0x21')](function(_0x2a969b){return[_0x2a969b,!![]];});});}})[_0xc8bc('0x90')](function(_0x13f640,_0x5cdb54){if(_0x5cdb54){return _0x13f640;}return db[_0xc8bc('0x97')][_0xc8bc('0x5c')](_[_0xc8bc('0x52')](_0x2df074[_0xc8bc('0x5d')],{'read':![],'body':_0x2df074[_0xc8bc('0x5d')][_0xc8bc('0x5d')],'OpenchannelAccountId':_0x52e3e8['id'],'OpenchannelInteractionId':_0x13f640['id'],'UserId':_0x2df074['user']['id'],'ContactId':_0x42effe['id']}))[_0xc8bc('0x21')](function(_0x4a998f){_0x13f640['dataValues'][_0xc8bc('0xb8')]=[];_0x13f640['dataValues'][_0xc8bc('0xb8')][_0xc8bc('0x94')](_0x4a998f[_0xc8bc('0xb9')]);return _0x13f640;});});}})[_0xc8bc('0x21')](respondWithResult(_0x234416,null))[_0xc8bc('0x2a')](handleError(_0x234416,null));}; \ No newline at end of file +var _0xbbec=['findAndCountAll','finally','send','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','OpenchannelAccounts','stack','index','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','body','params','Pause','describe','addDisposition','Disposition','getDispositions','findOne','OpenchannelAccountId','findAll','removeDispositions','ids','CannedAnswer','notify','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate'];(function(_0x332b2c,_0x1f7713){var _0x32ec57=function(_0xf0f9c4){while(--_0xf0f9c4){_0x332b2c['push'](_0x332b2c['shift']());}};_0x32ec57(++_0x1f7713);}(_0xbbec,0x19b));var _0xcbbe=function(_0x3d77cd,_0x14696b){_0x3d77cd=_0x3d77cd-0x0;var _0x28c297=_0xbbec[_0x3d77cd];return _0x28c297;};'use strict';var emlformat=require(_0xcbbe('0x0'));var rimraf=require(_0xcbbe('0x1'));var zipdir=require(_0xcbbe('0x2'));var jsonpatch=require(_0xcbbe('0x3'));var rp=require(_0xcbbe('0x4'));var moment=require(_0xcbbe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbbe('0x6'));var util=require(_0xcbbe('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcbbe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbbe('0x9'));var _=require(_0xcbbe('0xa'));var squel=require(_0xcbbe('0xb'));var crypto=require(_0xcbbe('0xc'));var jsforce=require(_0xcbbe('0xd'));var deskjs=require(_0xcbbe('0xe'));var toCsv=require(_0xcbbe('0x8'));var querystring=require('querystring');var Papa=require(_0xcbbe('0xf'));var Redis=require(_0xcbbe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcbbe('0x11'));var as=require(_0xcbbe('0x12'));var hardwareService=require(_0xcbbe('0x13'));var logger=require(_0xcbbe('0x14'))(_0xcbbe('0x15'));var utils=require(_0xcbbe('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcbbe('0x17'));var db=require(_0xcbbe('0x18'))['db'];config['redis']=_[_0xcbbe('0x19')](config[_0xcbbe('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbbe('0x1b'))(new Redis(config[_0xcbbe('0x1a')]));require(_0xcbbe('0x1c'))[_0xcbbe('0x1d')](socket);var jayson=require(_0xcbbe('0x1e'));var client=jayson[_0xcbbe('0x1f')][_0xcbbe('0x20')]({'port':0x232c});var client9002=jayson[_0xcbbe('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9cf8,_0x5cc116,_0x2cad05,_0x57d7ef){return new BPromise(function(_0x4cfaf5,_0x5e70c6){var _0x1d8187=_0x57d7ef||client;return _0x1d8187['request'](_0x2e9cf8,_0x2cad05)['then'](function(_0x5ecf55){logger[_0xcbbe('0x21')](_0xcbbe('0x22'),_0x5cc116,_0xcbbe('0x23'));logger[_0xcbbe('0x24')](_0xcbbe('0x25'),_0x5cc116,_0xcbbe('0x23'),JSON[_0xcbbe('0x26')](_0x5ecf55));if(_0x5ecf55[_0xcbbe('0x27')]){if(_0x5ecf55[_0xcbbe('0x27')][_0xcbbe('0x28')]===0x1f4){logger[_0xcbbe('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x5cc116,_0x5ecf55[_0xcbbe('0x27')]['message']);return _0x5e70c6(_0x5ecf55[_0xcbbe('0x27')][_0xcbbe('0x29')]);}logger[_0xcbbe('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x5cc116,_0x5ecf55[_0xcbbe('0x27')][_0xcbbe('0x29')]);return _0x4cfaf5(_0x5ecf55[_0xcbbe('0x27')][_0xcbbe('0x29')]);}else{logger[_0xcbbe('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5cc116,_0xcbbe('0x23'));_0x4cfaf5(_0x5ecf55[_0xcbbe('0x2a')][_0xcbbe('0x29')]);}})[_0xcbbe('0x2b')](function(_0x534893){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5cc116,_0x534893);_0x5e70c6(_0x534893);});});}function respondWithStatusCode(_0x4bcf04,_0x3d9557){_0x3d9557=_0x3d9557||0xcc;return function(_0x354bf4){if(_0x354bf4){return _0x4bcf04[_0xcbbe('0x2c')](_0x3d9557);}return _0x4bcf04[_0xcbbe('0x2d')](_0x3d9557)[_0xcbbe('0x2e')]();};}function respondWithResult(_0x535648,_0x391a59){_0x391a59=_0x391a59||0xc8;return function(_0x1621f4){if(_0x1621f4){return _0x535648[_0xcbbe('0x2d')](_0x391a59)[_0xcbbe('0x2f')](_0x1621f4);}};}function respondWithFilteredResult(_0x3b7fc2,_0x5568c1){return function(_0x496cd6){if(_0x496cd6){var _0x165cea=typeof _0x5568c1['offset']===_0xcbbe('0x30')&&typeof _0x5568c1[_0xcbbe('0x31')]===_0xcbbe('0x30');var _0x2c57a7=_0x496cd6[_0xcbbe('0x32')];var _0x547cb8=_0x165cea?0x0:_0x5568c1['offset'];var _0x4e7d0d=_0x165cea?_0x496cd6[_0xcbbe('0x32')]:_0x5568c1[_0xcbbe('0x33')]+_0x5568c1[_0xcbbe('0x31')];var _0x1eea30;if(_0x4e7d0d>=_0x2c57a7){_0x4e7d0d=_0x2c57a7;_0x1eea30=0xc8;}else{_0x1eea30=0xce;}_0x3b7fc2[_0xcbbe('0x2d')](_0x1eea30);return _0x3b7fc2[_0xcbbe('0x34')](_0xcbbe('0x35'),_0x547cb8+'-'+_0x4e7d0d+'/'+_0x2c57a7)[_0xcbbe('0x2f')](_0x496cd6);}return null;};}function patchUpdates(_0x33e6cd){return function(_0x5d337c){try{jsonpatch[_0xcbbe('0x36')](_0x5d337c,_0x33e6cd,!![]);}catch(_0x3fa0e2){return BPromise[_0xcbbe('0x37')](_0x3fa0e2);}return _0x5d337c['save']();};}function saveUpdates(_0x4fbdd2,_0xfa7e3a){return function(_0x5e9ec8){if(_0x5e9ec8){return _0x5e9ec8[_0xcbbe('0x38')](_0x4fbdd2)[_0xcbbe('0x39')](function(_0x272831){return _0x272831;});}return null;};}function removeEntity(_0x29824c,_0x40d389){return function(_0xb50c98){if(_0xb50c98){return _0xb50c98[_0xcbbe('0x3a')]()['then'](function(){var _0x29614e=_0xb50c98['get']({'plain':!![]});var _0x77a761=_0xcbbe('0x3b');return db['UserProfileResource'][_0xcbbe('0x3a')]({'where':{'type':_0x77a761,'resourceId':_0x29614e['id']}})['then'](function(){return _0xb50c98;});})['then'](function(){_0x29824c[_0xcbbe('0x2d')](0xcc)[_0xcbbe('0x2e')]();});}};}function handleEntityNotFound(_0x3bf5c5,_0x51e646){return function(_0x5a51dc){if(!_0x5a51dc){_0x3bf5c5[_0xcbbe('0x2c')](0x194);}return _0x5a51dc;};}function handleError(_0x439213,_0x1f4ea5){_0x1f4ea5=_0x1f4ea5||0x1f4;return function(_0x4474e0){logger[_0xcbbe('0x27')](_0x4474e0[_0xcbbe('0x3c')]);if(_0x4474e0['name']){delete _0x4474e0['name'];}_0x439213[_0xcbbe('0x2d')](_0x1f4ea5)['send'](_0x4474e0);};}exports[_0xcbbe('0x3d')]=function(_0x500675,_0x41bfa8){var _0x1b2297={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42776c={},_0x31c0c3={'count':0x0,'rows':[]};var _0x221156=_[_0xcbbe('0x3e')](db[_0xcbbe('0x3f')][_0xcbbe('0x40')],function(_0x163fa5){return{'name':_0x163fa5[_0xcbbe('0x41')],'type':_0x163fa5[_0xcbbe('0x42')][_0xcbbe('0x43')]};});_0x42776c['model']=_[_0xcbbe('0x3e')](_0x221156,'name');_0x42776c[_0xcbbe('0x44')]=_[_0xcbbe('0x45')](_0x500675[_0xcbbe('0x44')]);_0x42776c[_0xcbbe('0x46')]=_['intersection'](_0x42776c[_0xcbbe('0x47')],_0x42776c[_0xcbbe('0x44')]);_0x1b2297['attributes']=_[_0xcbbe('0x48')](_0x42776c['model'],qs[_0xcbbe('0x49')](_0x500675[_0xcbbe('0x44')]['fields']));_0x1b2297[_0xcbbe('0x4a')]=_0x1b2297[_0xcbbe('0x4a')][_0xcbbe('0x4b')]?_0x1b2297[_0xcbbe('0x4a')]:_0x42776c[_0xcbbe('0x47')];if(!_0x500675[_0xcbbe('0x44')][_0xcbbe('0x4c')](_0xcbbe('0x4d'))){_0x1b2297[_0xcbbe('0x31')]=qs[_0xcbbe('0x31')](_0x500675['query']['limit']);_0x1b2297[_0xcbbe('0x33')]=qs[_0xcbbe('0x33')](_0x500675[_0xcbbe('0x44')][_0xcbbe('0x33')]);}_0x1b2297[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0x500675['query'][_0xcbbe('0x4f')]);_0x1b2297[_0xcbbe('0x50')]=qs[_0xcbbe('0x46')](_[_0xcbbe('0x51')](_0x500675['query'],_0x42776c['filters']),_0x221156);if(_0x500675[_0xcbbe('0x44')]['filter']){_0x1b2297[_0xcbbe('0x50')]=_[_0xcbbe('0x52')](_0x1b2297[_0xcbbe('0x50')],{'$or':_['map'](_0x221156,function(_0x5c1a52){if(_0x5c1a52[_0xcbbe('0x42')]!==_0xcbbe('0x53')){var _0x3993a0={};_0x3993a0[_0x5c1a52['name']]={'$like':'%'+_0x500675[_0xcbbe('0x44')][_0xcbbe('0x54')]+'%'};return _0x3993a0;}})});}_0x1b2297=_[_0xcbbe('0x52')]({},_0x1b2297,_0x500675[_0xcbbe('0x55')]);var _0x218bdf={'where':_0x1b2297['where']};return db[_0xcbbe('0x3f')][_0xcbbe('0x32')](_0x218bdf)[_0xcbbe('0x39')](function(_0x1b54fb){_0x31c0c3[_0xcbbe('0x32')]=_0x1b54fb;if(_0x500675['query'][_0xcbbe('0x56')]){_0x1b2297[_0xcbbe('0x57')]=[{'all':!![]}];}return db[_0xcbbe('0x3f')]['findAll'](_0x1b2297);})[_0xcbbe('0x39')](function(_0x37cf90){_0x31c0c3[_0xcbbe('0x58')]=_0x37cf90;return _0x31c0c3;})['then'](respondWithFilteredResult(_0x41bfa8,_0x1b2297))[_0xcbbe('0x2b')](handleError(_0x41bfa8,null));};exports[_0xcbbe('0x59')]=function(_0x1a662a,_0x31f275){var _0x89f18c={'raw':![],'where':{'id':_0x1a662a['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x375b5d={};_0x375b5d['model']=_[_0xcbbe('0x45')](db[_0xcbbe('0x3f')][_0xcbbe('0x40')]);_0x375b5d[_0xcbbe('0x44')]=_['keys'](_0x1a662a[_0xcbbe('0x44')]);_0x375b5d[_0xcbbe('0x46')]=_['intersection'](_0x375b5d['model'],_0x375b5d[_0xcbbe('0x44')]);_0x89f18c[_0xcbbe('0x4a')]=_[_0xcbbe('0x48')](_0x375b5d[_0xcbbe('0x47')],qs['fields'](_0x1a662a[_0xcbbe('0x44')][_0xcbbe('0x49')]));_0x89f18c[_0xcbbe('0x4a')]=_0x89f18c[_0xcbbe('0x4a')][_0xcbbe('0x4b')]?_0x89f18c[_0xcbbe('0x4a')]:_0x375b5d[_0xcbbe('0x47')];if(_0x1a662a['query'][_0xcbbe('0x56')]){_0x89f18c['include']=[{'all':!![]}];}_0x89f18c=_[_0xcbbe('0x52')]({},_0x89f18c,_0x1a662a[_0xcbbe('0x55')]);return db[_0xcbbe('0x3f')][_0xcbbe('0x5a')](_0x89f18c)[_0xcbbe('0x39')](handleEntityNotFound(_0x31f275,null))['then'](respondWithResult(_0x31f275,null))['catch'](handleError(_0x31f275,null));};exports[_0xcbbe('0x5b')]=function(_0x2fe4a3,_0x30c367){return db[_0xcbbe('0x3f')][_0xcbbe('0x5b')](_0x2fe4a3['body'],{})[_0xcbbe('0x39')](function(_0x53fae7){var _0x367668=_0x2fe4a3[_0xcbbe('0x5c')]['get']({'plain':!![]});if(!_0x367668)throw new Error(_0xcbbe('0x5d'));if(_0x367668[_0xcbbe('0x5e')]===_0xcbbe('0x5c')){var _0x49a03d=_0x53fae7[_0xcbbe('0x5f')]({'plain':!![]});var _0x519b5e='OpenchannelAccounts';return db[_0xcbbe('0x60')]['find']({'where':{'name':_0x519b5e,'userProfileId':_0x367668[_0xcbbe('0x61')]},'raw':!![]})[_0xcbbe('0x39')](function(_0x52aefb){if(_0x52aefb&&_0x52aefb[_0xcbbe('0x62')]===0x0){return db[_0xcbbe('0x63')][_0xcbbe('0x5b')]({'name':_0x49a03d[_0xcbbe('0x64')],'resourceId':_0x49a03d['id'],'type':_0x52aefb[_0xcbbe('0x64')],'sectionId':_0x52aefb['id']},{})[_0xcbbe('0x39')](function(){return _0x53fae7;});}else{return _0x53fae7;}})[_0xcbbe('0x2b')](function(_0x57392a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57392a);throw _0x57392a;});}return _0x53fae7;})[_0xcbbe('0x39')](respondWithResult(_0x30c367,0xc9))[_0xcbbe('0x2b')](handleError(_0x30c367,null));};exports[_0xcbbe('0x38')]=function(_0x23f5f2,_0x5a3c63){if(_0x23f5f2['body']['id']){delete _0x23f5f2[_0xcbbe('0x65')]['id'];}return db[_0xcbbe('0x3f')][_0xcbbe('0x5a')]({'where':{'id':_0x23f5f2[_0xcbbe('0x66')]['id']},'include':[{'model':db[_0xcbbe('0x67')],'as':'mandatoryDispositionPause'}]})[_0xcbbe('0x39')](handleEntityNotFound(_0x5a3c63,null))[_0xcbbe('0x39')](saveUpdates(_0x23f5f2[_0xcbbe('0x65')],null))['then'](respondWithResult(_0x5a3c63,null))['catch'](handleError(_0x5a3c63,null));};exports['destroy']=function(_0x1735ab,_0x1f4f62){return db[_0xcbbe('0x3f')][_0xcbbe('0x5a')]({'where':{'id':_0x1735ab['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x1f4f62,null))['then'](removeEntity(_0x1f4f62,null))['catch'](handleError(_0x1f4f62,null));};exports[_0xcbbe('0x68')]=function(_0x412e04,_0x4875f4){return db['OpenchannelAccount']['describe']()[_0xcbbe('0x39')](respondWithResult(_0x4875f4,null))[_0xcbbe('0x2b')](handleError(_0x4875f4,null));};exports[_0xcbbe('0x69')]=function(_0x107fa8,_0x44f2cd,_0x595f0e){if(_0x107fa8[_0xcbbe('0x65')]['id']){delete _0x107fa8[_0xcbbe('0x65')]['id'];}return db[_0xcbbe('0x3f')]['find']({'where':{'id':_0x107fa8[_0xcbbe('0x66')]['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x44f2cd,null))[_0xcbbe('0x39')](function(_0x4d6fc6){if(_0x4d6fc6){_0x107fa8[_0xcbbe('0x65')]['OpenchannelAccountId']=_0x4d6fc6['id'];return db[_0xcbbe('0x6a')]['create'](_0x107fa8[_0xcbbe('0x65')]);}})[_0xcbbe('0x39')](respondWithResult(_0x44f2cd,null))[_0xcbbe('0x2b')](handleError(_0x44f2cd,null));};exports[_0xcbbe('0x6b')]=function(_0xe33bb4,_0x35f815,_0x488af4){var _0x53e1d1={'raw':![],'where':{}};var _0x21a8ae={};var _0x3b8067={'count':0x0,'rows':[]};return db[_0xcbbe('0x3f')][_0xcbbe('0x6c')]({'where':{'id':_0xe33bb4['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x35f815,null))[_0xcbbe('0x39')](function(_0x4f1eda){if(_0x4f1eda){_0x21a8ae[_0xcbbe('0x47')]=_[_0xcbbe('0x45')](db[_0xcbbe('0x6a')][_0xcbbe('0x40')]);_0x21a8ae[_0xcbbe('0x44')]=_['keys'](_0xe33bb4[_0xcbbe('0x44')]);_0x21a8ae[_0xcbbe('0x46')]=_[_0xcbbe('0x48')](_0x21a8ae[_0xcbbe('0x47')],_0x21a8ae[_0xcbbe('0x44')]);_0x53e1d1[_0xcbbe('0x4a')]=_[_0xcbbe('0x48')](_0x21a8ae[_0xcbbe('0x47')],qs[_0xcbbe('0x49')](_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x49')]));_0x53e1d1[_0xcbbe('0x4a')]=_0x53e1d1[_0xcbbe('0x4a')][_0xcbbe('0x4b')]?_0x53e1d1[_0xcbbe('0x4a')]:_0x21a8ae[_0xcbbe('0x47')];if(!_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x4c')](_0xcbbe('0x4d'))){_0x53e1d1['limit']=qs[_0xcbbe('0x31')](_0xe33bb4[_0xcbbe('0x44')]['limit']);_0x53e1d1['offset']=qs[_0xcbbe('0x33')](_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x33')]);}_0x53e1d1[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x4f')]);_0x53e1d1[_0xcbbe('0x50')]=qs[_0xcbbe('0x46')](_['pick'](_0xe33bb4['query'],_0x21a8ae[_0xcbbe('0x46')]));_0x53e1d1[_0xcbbe('0x50')][_0xcbbe('0x6d')]=_0x4f1eda['id'];if(_0xe33bb4['query']['filter']){_0x53e1d1[_0xcbbe('0x50')]=_[_0xcbbe('0x52')](_0x53e1d1[_0xcbbe('0x50')],{'$or':_[_0xcbbe('0x3e')](_0x53e1d1[_0xcbbe('0x4a')],function(_0x135506){var _0x276a4e={};_0x276a4e[_0x135506]={'$like':'%'+_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x54')]+'%'};return _0x276a4e;})});}_0x53e1d1=_[_0xcbbe('0x52')]({},_0x53e1d1,_0xe33bb4[_0xcbbe('0x55')]);return db[_0xcbbe('0x6a')][_0xcbbe('0x32')]({'where':_0x53e1d1[_0xcbbe('0x50')]})[_0xcbbe('0x39')](function(_0x15f78d){_0x3b8067[_0xcbbe('0x32')]=_0x15f78d;if(_0xe33bb4[_0xcbbe('0x44')][_0xcbbe('0x56')]){_0x53e1d1['include']=[{'all':!![]}];}return db['Disposition'][_0xcbbe('0x6e')](_0x53e1d1);})['then'](function(_0x537ac6){_0x3b8067[_0xcbbe('0x58')]=_0x537ac6;return _0x3b8067;});}})[_0xcbbe('0x39')](respondWithFilteredResult(_0x35f815,_0x53e1d1))[_0xcbbe('0x2b')](handleError(_0x35f815,null));};exports[_0xcbbe('0x6f')]=function(_0x233468,_0x444362,_0x5d22d6){return db[_0xcbbe('0x3f')]['find']({'where':{'id':_0x233468['params']['id']}})['then'](handleEntityNotFound(_0x444362,null))['then'](function(_0x480ce8){if(_0x480ce8){return _0x480ce8['removeDispositions'](_0x233468[_0xcbbe('0x44')][_0xcbbe('0x70')]);}})[_0xcbbe('0x39')](respondWithStatusCode(_0x444362,null))['catch'](handleError(_0x444362,null));};exports['addAnswer']=function(_0x45ef9a,_0x51a497,_0xd78e8){if(_0x45ef9a[_0xcbbe('0x65')]['id']){delete _0x45ef9a[_0xcbbe('0x65')]['id'];}return db[_0xcbbe('0x3f')]['find']({'where':{'id':_0x45ef9a['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x51a497,null))['then'](function(_0x7ea992){if(_0x7ea992){_0x45ef9a[_0xcbbe('0x65')]['OpenchannelAccountId']=_0x7ea992['id'];return db['CannedAnswer'][_0xcbbe('0x5b')](_0x45ef9a[_0xcbbe('0x65')]);}})[_0xcbbe('0x39')](respondWithResult(_0x51a497,null))[_0xcbbe('0x2b')](handleError(_0x51a497,null));};exports['getAnswers']=function(_0x2994c8,_0x3e5cc7,_0x2432f5){var _0x2f6c7d={'raw':![],'where':{}};var _0x3d4988={};var _0x5e73f0={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xcbbe('0x6c')]({'where':{'id':_0x2994c8[_0xcbbe('0x66')]['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x3e5cc7,null))[_0xcbbe('0x39')](function(_0x5b16c9){if(_0x5b16c9){_0x3d4988[_0xcbbe('0x47')]=_[_0xcbbe('0x45')](db['CannedAnswer']['rawAttributes']);_0x3d4988[_0xcbbe('0x44')]=_[_0xcbbe('0x45')](_0x2994c8[_0xcbbe('0x44')]);_0x3d4988[_0xcbbe('0x46')]=_[_0xcbbe('0x48')](_0x3d4988[_0xcbbe('0x47')],_0x3d4988[_0xcbbe('0x44')]);_0x2f6c7d['attributes']=_['intersection'](_0x3d4988[_0xcbbe('0x47')],qs[_0xcbbe('0x49')](_0x2994c8['query'][_0xcbbe('0x49')]));_0x2f6c7d[_0xcbbe('0x4a')]=_0x2f6c7d[_0xcbbe('0x4a')]['length']?_0x2f6c7d['attributes']:_0x3d4988[_0xcbbe('0x47')];if(!_0x2994c8['query'][_0xcbbe('0x4c')](_0xcbbe('0x4d'))){_0x2f6c7d['limit']=qs[_0xcbbe('0x31')](_0x2994c8[_0xcbbe('0x44')]['limit']);_0x2f6c7d[_0xcbbe('0x33')]=qs['offset'](_0x2994c8[_0xcbbe('0x44')][_0xcbbe('0x33')]);}_0x2f6c7d[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0x2994c8[_0xcbbe('0x44')][_0xcbbe('0x4f')]);_0x2f6c7d[_0xcbbe('0x50')]=qs[_0xcbbe('0x46')](_[_0xcbbe('0x51')](_0x2994c8[_0xcbbe('0x44')],_0x3d4988[_0xcbbe('0x46')]));_0x2f6c7d[_0xcbbe('0x50')][_0xcbbe('0x6d')]=_0x5b16c9['id'];if(_0x2994c8[_0xcbbe('0x44')][_0xcbbe('0x54')]){_0x2f6c7d[_0xcbbe('0x50')]=_[_0xcbbe('0x52')](_0x2f6c7d[_0xcbbe('0x50')],{'$or':_[_0xcbbe('0x3e')](_0x2f6c7d[_0xcbbe('0x4a')],function(_0x441afd){var _0x225af7={};_0x225af7[_0x441afd]={'$like':'%'+_0x2994c8['query']['filter']+'%'};return _0x225af7;})});}_0x2f6c7d=_[_0xcbbe('0x52')]({},_0x2f6c7d,_0x2994c8[_0xcbbe('0x55')]);return db[_0xcbbe('0x71')][_0xcbbe('0x32')]({'where':_0x2f6c7d[_0xcbbe('0x50')]})[_0xcbbe('0x39')](function(_0x3bdbaa){_0x5e73f0[_0xcbbe('0x32')]=_0x3bdbaa;if(_0x2994c8[_0xcbbe('0x44')][_0xcbbe('0x56')]){_0x2f6c7d[_0xcbbe('0x57')]=[{'all':!![]}];}return db[_0xcbbe('0x71')][_0xcbbe('0x6e')](_0x2f6c7d);})['then'](function(_0x46bfcf){_0x5e73f0[_0xcbbe('0x58')]=_0x46bfcf;return _0x5e73f0;});}})[_0xcbbe('0x39')](respondWithFilteredResult(_0x3e5cc7,_0x2f6c7d))[_0xcbbe('0x2b')](handleError(_0x3e5cc7,null));};exports['removeAnswers']=function(_0x4e44fe,_0xf7b221,_0x2eef97){return db['OpenchannelAccount'][_0xcbbe('0x5a')]({'where':{'id':_0x4e44fe[_0xcbbe('0x66')]['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0xf7b221,null))[_0xcbbe('0x39')](function(_0x2167f9){if(_0x2167f9){return _0x2167f9['removeAnswers'](_0x4e44fe[_0xcbbe('0x44')]['ids']);}})['then'](respondWithStatusCode(_0xf7b221,null))['catch'](handleError(_0xf7b221,null));};exports[_0xcbbe('0x72')]=function(_0x31b69c,_0xfde518,_0x237e33){var _0x2defd6={'body':_0x31b69c['body'],'channel':_0xcbbe('0x73')};var _0x199167=[];var _0x5a4831=[];var _0x5c28fc={};var _0x2ec8cc=![];return db[_0xcbbe('0x74')][_0xcbbe('0x68')]()[_0xcbbe('0x39')](function(_0x4c2cc2){if(!_0x4c2cc2){throw new db['Sequelize'][(_0xcbbe('0x75'))]('no\x20available\x20attributes');}_0x199167=_[_0xcbbe('0x76')](_[_0xcbbe('0x45')](_0x4c2cc2),[_0xcbbe('0x77'),_0xcbbe('0x78')]);_0x5a4831=_[_0xcbbe('0x76')](_[_0xcbbe('0x45')](_0x4c2cc2),[_0xcbbe('0x77'),_0xcbbe('0x78'),_0xcbbe('0x79'),_0xcbbe('0x7a')]);if(_0x31b69c['body']['id']){delete _0x31b69c[_0xcbbe('0x65')]['id'];}if(_['isNil'](_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x7b')])){throw new db[(_0xcbbe('0x7c'))][(_0xcbbe('0x75'))](_0xcbbe('0x7d'));}if(_[_0xcbbe('0x7e')](_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x65')])||_0x31b69c['body']['body']===''){throw new db[(_0xcbbe('0x7c'))][(_0xcbbe('0x75'))](_0xcbbe('0x7f'));}if(_[_0xcbbe('0x7e')](_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x80')])){throw new db['Sequelize']['ValidationError'](_0xcbbe('0x81')+_0x5a4831);}if(!_[_0xcbbe('0x82')](_0x5a4831,_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x80')])){throw new db[(_0xcbbe('0x7c'))]['ValidationError'](_0xcbbe('0x83')+_0x5a4831);}_0x5c28fc[_0x31b69c['body'][_0xcbbe('0x80')]]=_0x31b69c['body'][_0xcbbe('0x7b')];})[_0xcbbe('0x39')](function(){return db[_0xcbbe('0x3f')]['find']({'where':{'id':_0x31b69c[_0xcbbe('0x66')]['id']},'include':[{'model':db[_0xcbbe('0x84')],'as':_0xcbbe('0x85'),'include':[{'model':db[_0xcbbe('0x74')],'as':_0xcbbe('0x86'),'where':_0x5c28fc,'limit':0x1,'order':[[_0xcbbe('0x78'),_0xcbbe('0x87')]]}]},{'model':db[_0xcbbe('0x88')],'as':_0xcbbe('0x89')}]});})['then'](handleEntityNotFound(_0xfde518,null))[_0xcbbe('0x39')](function(_0x343aec){if(_0x343aec&&_0x343aec[_0xcbbe('0x85')]){_0x2defd6[_0xcbbe('0x8a')]=_0x343aec;_0x2defd6[_0xcbbe('0x8b')]=_0x343aec[_0xcbbe('0x89')];_0x2defd6[_0xcbbe('0x8c')]=_0x343aec[_0xcbbe('0x85')];_0x2defd6[_0xcbbe('0x8b')]=_[_0xcbbe('0x8d')](_0x2defd6['applications'],[_0xcbbe('0x8e')],[_0xcbbe('0x8f')]);if(_0x2defd6[_0xcbbe('0x8a')]['Applications']){delete _0x2defd6[_0xcbbe('0x8a')][_0xcbbe('0x89')];}if(_0x2defd6['account'][_0xcbbe('0x85')]&&_0x2defd6['account']['List'][_0xcbbe('0x86')][_0xcbbe('0x4b')]){return _0x2defd6[_0xcbbe('0x8a')][_0xcbbe('0x85')]['Contacts'][0x0];}var _0x3abe2f=_[_0xcbbe('0x19')](_0x31b69c[_0xcbbe('0x65')],{'firstName':_0x31b69c['body'][_0xcbbe('0x7b')],'ListId':_0x343aec[_0xcbbe('0x7a')]});_0x3abe2f[_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x80')]]=_0x31b69c[_0xcbbe('0x65')]['from'];return db[_0xcbbe('0x74')][_0xcbbe('0x5b')](_0x3abe2f,{'fields':_0x199167,'raw':!![]});}})[_0xcbbe('0x39')](handleEntityNotFound(_0xfde518,null))[_0xcbbe('0x39')](function(_0x13187c){_0x2defd6[_0xcbbe('0x90')]=_0x13187c;if(_0x13187c){var _0x5cc74b={'ContactId':_0x13187c['id'],'OpenchannelAccountId':_0x31b69c[_0xcbbe('0x66')]['id'],'from':(_0x13187c['firstName']||'')+'\x20'+(_0x13187c[_0xcbbe('0x91')]||'')};var _0x4243d9={'OpenchannelAccountId':_0x31b69c['params']['id'],'closed':![]};if(_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x92')]){_0x4243d9[_0xcbbe('0x92')]=_0x31b69c[_0xcbbe('0x65')]['threadId'];return db[_0xcbbe('0x93')][_0xcbbe('0x5a')]({'where':_0x4243d9})[_0xcbbe('0x39')](function(_0x23abf0){if(_0x23abf0){return[_0x23abf0,![]];}_0x5cc74b[_0xcbbe('0x92')]=_0x31b69c['body']['threadId'];_0x5cc74b[_0xcbbe('0x94')]=_0x31b69c['body'][_0xcbbe('0x94')];return db[_0xcbbe('0x93')][_0xcbbe('0x5b')](_0x5cc74b)['then'](function(_0x23a636){return[_0x23a636,!![]];});});}else{_0x4243d9['threadId']=null;}_0x4243d9[_0xcbbe('0x95')]=_0x13187c['id'];return db['OpenchannelInteraction'][_0xcbbe('0x5a')]({'where':_0x4243d9})['then'](function(_0x2d6d8e){if(_0x2d6d8e){return[_0x2d6d8e,![]];}return db[_0xcbbe('0x93')]['create'](_0x5cc74b)['then'](function(_0x2c331){return[_0x2c331,!![]];});});}})[_0xcbbe('0x96')](function(_0x164f51,_0x271237){if(_0x164f51){_0x2ec8cc=_0x271237;if(!_0x271237){var _0x3860e0={'from':(_0x2defd6[_0xcbbe('0x90')][_0xcbbe('0x97')]||'')+'\x20'+(_0x2defd6[_0xcbbe('0x90')][_0xcbbe('0x91')]||'')};if(_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x92')]&&_0x31b69c['body'][_0xcbbe('0x98')]&&_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x92')]!=_0x31b69c['body'][_0xcbbe('0x98')]){_0x3860e0['threadId']=_0x31b69c[_0xcbbe('0x65')][_0xcbbe('0x98')];}return _0x164f51[_0xcbbe('0x38')](_0x3860e0);}else{return _0x164f51;}}})['then'](function(_0x368f8){_0x2defd6['interaction']=_0x368f8[_0xcbbe('0x5f')]({'plain':!![]});_0x2defd6['interaction']['created']=_0x2ec8cc;if(_0x2defd6[_0xcbbe('0x99')][_0xcbbe('0x9a')]){if(_0x2defd6['account'][_0xcbbe('0x9b')]){_0x2defd6[_0xcbbe('0x8b')]['push']({'id':0x0,'priority':_0x2defd6['applications'][_0xcbbe('0x4b')]+0x1,'app':_0xcbbe('0x9c'),'appdata':'unmanaged','interval':_0xcbbe('0x9d')});}}return db[_0xcbbe('0x9e')]['create']({'body':_0x31b69c['body'][_0xcbbe('0x65')],'OpenchannelAccountId':_0x31b69c[_0xcbbe('0x66')]['id'],'OpenchannelInteractionId':_0x368f8['id'],'direction':'in','ContactId':_0x2defd6[_0xcbbe('0x90')]['id'],'AttachmentId':_0x31b69c['body'][_0xcbbe('0x9f')]});})[_0xcbbe('0x39')](function(_0x351aa3){_0x2defd6[_0xcbbe('0x29')]=_0x351aa3;if(_0x2defd6[_0xcbbe('0x99')][_0xcbbe('0xa0')]){return db['User']['find']({'attributes':['id',_0xcbbe('0x64')],'where':{'id':_0x2defd6['interaction'][_0xcbbe('0xa0')]}})[_0xcbbe('0x39')](function(_0x357cc5){if(_0x357cc5){_0x2defd6[_0xcbbe('0x8b')][_0xcbbe('0xa1')]({'id':0x0,'priority':0x0,'app':_0xcbbe('0xa2'),'appdata':_0x357cc5[_0xcbbe('0x64')]+','+(_0x2defd6[_0xcbbe('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0xcbbe('0x9d')});_0x2defd6[_0xcbbe('0xa3')]=![];}return respondWithRpcPromise(_0xcbbe('0xa4'),_0xcbbe('0xa5'),_0x2defd6);});}return respondWithRpcPromise(_0xcbbe('0xa4'),_0xcbbe('0xa5'),_0x2defd6);})['then'](function(_0xc51c9b){respondWithRpcPromise('EventManager',_0xcbbe('0xa6'),{'event':'notify','message':_0xc51c9b},client9002);return _0xc51c9b;})['then'](respondWithResult(_0xfde518,null))['catch'](handleError(_0xfde518,null));};exports['addApplications']=function(_0x1aabf4,_0x24af7d){var _0x516765=_0x1aabf4[_0xcbbe('0x66')]['id'];var _0x4f105f=_0x1aabf4[_0xcbbe('0x65')];var _0x26f353=0xc8;var _0x346e08=null;return db[_0xcbbe('0xa7')]['transaction']({'isolationLevel':db[_0xcbbe('0xa7')]['Transaction'][_0xcbbe('0xa8')][_0xcbbe('0xa9')]},function(_0xab5bae){return db['OpenchannelAccount'][_0xcbbe('0x6c')]({'where':{'id':_0x516765},'transaction':_0xab5bae})[_0xcbbe('0x39')](function(_0x3fb044){if(_0x3fb044){return db[_0xcbbe('0x88')][_0xcbbe('0x3a')]({'where':{'OpenchannelAccountId':_0x516765},'transaction':_0xab5bae})['then'](function(){var _0x45a873=_[_0xcbbe('0x3e')](_0x4f105f,function(_0x433e1d){_0x433e1d[_0xcbbe('0x6d')]=_0x516765;return _0x433e1d;});return db[_0xcbbe('0x88')][_0xcbbe('0xaa')](_0x45a873,{'transaction':_0xab5bae});});}else{_0x26f353=0x194;_0x346e08=[];}});})[_0xcbbe('0x39')](function(){if(_0x26f353!==0x194){return db[_0xcbbe('0x88')][_0xcbbe('0xab')]({'where':{'OpenchannelAccountId':_0x516765},'order':_0xcbbe('0x8e')})[_0xcbbe('0x39')](function(_0x2e81e6){_0x346e08=_0x2e81e6;});}})['catch'](function(_0x327ea9){_0x26f353=0x1f4;logger[_0xcbbe('0x27')](_0x327ea9[_0xcbbe('0x3c')]);if(_0x327ea9[_0xcbbe('0x64')]){delete _0x327ea9[_0xcbbe('0x64')];}_0x346e08=_0x327ea9;})[_0xcbbe('0xac')](function(){if(_0x346e08===null){_0x24af7d[_0xcbbe('0x2c')](_0x26f353);}else{if(_0x26f353===0x1f4){_0x24af7d['status'](_0x26f353)[_0xcbbe('0xad')](_0x346e08);}else{_0x24af7d[_0xcbbe('0x2d')](_0x26f353)['json'](_0x346e08);}}});};exports[_0xcbbe('0xae')]=function(_0x102003,_0x3f8c1b,_0x10a78e){var _0x5d5bff={};var _0x1df835={};var _0x95759b;var _0x12fecb;return db['OpenchannelAccount'][_0xcbbe('0x6c')]({'where':{'id':_0x102003['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x3f8c1b,null))[_0xcbbe('0x39')](function(_0x217924){if(_0x217924){_0x95759b=_0x217924;_0x1df835[_0xcbbe('0x47')]=_[_0xcbbe('0x45')](db[_0xcbbe('0x88')][_0xcbbe('0x40')]);_0x1df835[_0xcbbe('0x44')]=_[_0xcbbe('0x45')](_0x102003[_0xcbbe('0x44')]);_0x1df835[_0xcbbe('0x46')]=_[_0xcbbe('0x48')](_0x1df835['model'],_0x1df835['query']);_0x5d5bff['attributes']=_[_0xcbbe('0x48')](_0x1df835[_0xcbbe('0x47')],qs['fields'](_0x102003[_0xcbbe('0x44')][_0xcbbe('0x49')]));_0x5d5bff[_0xcbbe('0x4a')]=_0x5d5bff[_0xcbbe('0x4a')]['length']?_0x5d5bff[_0xcbbe('0x4a')]:_0x1df835[_0xcbbe('0x47')];_0x5d5bff[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0x102003['query'][_0xcbbe('0x4f')]);_0x5d5bff['where']=qs[_0xcbbe('0x46')](_[_0xcbbe('0x51')](_0x102003['query'],_0x1df835[_0xcbbe('0x46')]));if(_0x102003['query']['filter']){_0x5d5bff['where']=_[_0xcbbe('0x52')](_0x5d5bff[_0xcbbe('0x50')],{'$or':_[_0xcbbe('0x3e')](_0x5d5bff['attributes'],function(_0x4a4268){var _0x2b8267={};_0x2b8267[_0x4a4268]={'$like':'%'+_0x102003['query'][_0xcbbe('0x54')]+'%'};return _0x2b8267;})});}_0x5d5bff=_['merge']({},_0x5d5bff,_0x102003[_0xcbbe('0x55')]);return _0x95759b[_0xcbbe('0xae')](_0x5d5bff);}})['then'](function(_0x48cf35){if(_0x48cf35){_0x12fecb=_0x48cf35[_0xcbbe('0x4b')];if(!_0x102003[_0xcbbe('0x44')][_0xcbbe('0x4c')]('nolimit')){_0x5d5bff['limit']=qs['limit'](_0x102003['query'][_0xcbbe('0x31')]);_0x5d5bff[_0xcbbe('0x33')]=qs['offset'](_0x102003[_0xcbbe('0x44')]['offset']);}return _0x95759b[_0xcbbe('0xae')](_0x5d5bff);}})[_0xcbbe('0x39')](function(_0x42ff78){if(_0x42ff78){return _0x42ff78?{'count':_0x12fecb,'rows':_0x42ff78}:null;}})['then'](respondWithResult(_0x3f8c1b,null))[_0xcbbe('0x2b')](handleError(_0x3f8c1b,null));};exports[_0xcbbe('0xaf')]=function(_0x3345ea,_0x24bad2,_0x5e4e92){var _0x1b5ef2={'raw':![],'where':{}};var _0x237eda={};var _0x1007dd={'count':0x0,'rows':[]};return db[_0xcbbe('0x3f')]['findOne']({'where':{'id':_0x3345ea[_0xcbbe('0x66')]['id']}})['then'](handleEntityNotFound(_0x24bad2,null))[_0xcbbe('0x39')](function(_0x465d12){if(_0x465d12){_0x237eda[_0xcbbe('0x47')]=_['keys'](db[_0xcbbe('0x93')][_0xcbbe('0x40')]);_0x237eda[_0xcbbe('0x44')]=_['keys'](_0x3345ea[_0xcbbe('0x44')]);_0x237eda[_0xcbbe('0x46')]=_[_0xcbbe('0x48')](_0x237eda[_0xcbbe('0x47')],_0x237eda[_0xcbbe('0x44')]);_0x1b5ef2[_0xcbbe('0x4a')]=_[_0xcbbe('0x48')](_0x237eda[_0xcbbe('0x47')],qs[_0xcbbe('0x49')](_0x3345ea['query']['fields']));_0x1b5ef2[_0xcbbe('0x4a')]=_0x1b5ef2['attributes'][_0xcbbe('0x4b')]?_0x1b5ef2['attributes']:_0x237eda[_0xcbbe('0x47')];if(!_0x3345ea[_0xcbbe('0x44')][_0xcbbe('0x4c')](_0xcbbe('0x4d'))){_0x1b5ef2[_0xcbbe('0x31')]=qs[_0xcbbe('0x31')](_0x3345ea[_0xcbbe('0x44')][_0xcbbe('0x31')]);_0x1b5ef2[_0xcbbe('0x33')]=qs[_0xcbbe('0x33')](_0x3345ea[_0xcbbe('0x44')][_0xcbbe('0x33')]);}_0x1b5ef2[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0x3345ea[_0xcbbe('0x44')]['sort']);_0x1b5ef2['where']=qs[_0xcbbe('0x46')](_[_0xcbbe('0x51')](_0x3345ea[_0xcbbe('0x44')],_0x237eda['filters']));_0x1b5ef2[_0xcbbe('0x50')][_0xcbbe('0x6d')]=_0x465d12['id'];if(_0x3345ea['query'][_0xcbbe('0x54')]){_0x1b5ef2[_0xcbbe('0x50')]=_[_0xcbbe('0x52')](_0x1b5ef2[_0xcbbe('0x50')],{'$or':_['map'](_0x1b5ef2[_0xcbbe('0x4a')],function(_0x4a095b){var _0x2437fb={};_0x2437fb[_0x4a095b]={'$like':'%'+_0x3345ea[_0xcbbe('0x44')][_0xcbbe('0x54')]+'%'};return _0x2437fb;})});}_0x1b5ef2=_[_0xcbbe('0x52')]({},_0x1b5ef2,_0x3345ea[_0xcbbe('0x55')]);return db['OpenchannelInteraction'][_0xcbbe('0x32')]({'where':_0x1b5ef2['where']})[_0xcbbe('0x39')](function(_0x59e883){_0x1007dd[_0xcbbe('0x32')]=_0x59e883;if(_0x3345ea['query'][_0xcbbe('0x56')]){_0x1b5ef2['include']=[{'model':db[_0xcbbe('0x74')],'as':_0xcbbe('0xb0'),'required':![]},{'model':db[_0xcbbe('0xb1')],'as':_0xcbbe('0xb2'),'attributes':[_0xcbbe('0x64'),_0xcbbe('0xb3'),_0xcbbe('0xb4')],'required':![]},{'model':db[_0xcbbe('0xb5')],'as':_0xcbbe('0xb6'),'attributes':['id',_0xcbbe('0x64'),_0xcbbe('0xb7')],'where':_0x3345ea[_0xcbbe('0x44')]['tag']?{'id':_0x3345ea['query'][_0xcbbe('0xb8')]}:undefined,'required':_0x3345ea[_0xcbbe('0x44')][_0xcbbe('0xb8')]?!![]:![]}];}return db[_0xcbbe('0x93')]['findAll'](_0x1b5ef2);})[_0xcbbe('0x39')](function(_0xc7a111){_0x1007dd[_0xcbbe('0x58')]=_0xc7a111;return _0x1007dd;});}})['then'](respondWithFilteredResult(_0x24bad2,_0x1b5ef2))['catch'](handleError(_0x24bad2,null));};exports['addAgents']=function(_0x53c75a,_0x36a854,_0x5b32b9){return db[_0xcbbe('0x3f')][_0xcbbe('0x5a')]({'where':{'id':_0x53c75a[_0xcbbe('0x66')]['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x36a854,null))[_0xcbbe('0x39')](function(_0x73d267){if(_0x73d267){return _0x73d267['addAgents'](_0x53c75a['body'][_0xcbbe('0x70')],_['omit'](_0x53c75a['body'],['ids','id'])||{})['spread'](function(_0x19b63a){for(var _0x340600=0x0;_0x340600<_0x53c75a['body'][_0xcbbe('0x70')][_0xcbbe('0x4b')];_0x340600+=0x1){socket[_0xcbbe('0xb9')](_0xcbbe('0xba'),{'UserId':Number(_0x53c75a[_0xcbbe('0x65')][_0xcbbe('0x70')][_0x340600]),'OpenchannelAccountId':Number(_0x53c75a[_0xcbbe('0x66')]['id'])});}return _0x19b63a;});}})['then'](respondWithResult(_0x36a854,null))[_0xcbbe('0x2b')](handleError(_0x36a854,null));};exports[_0xcbbe('0xbb')]=function(_0x2ea210,_0x1e1de9,_0x1c3f1a){return db['OpenchannelAccount'][_0xcbbe('0x5a')]({'where':{'id':_0x2ea210[_0xcbbe('0x66')]['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x1e1de9,null))[_0xcbbe('0x39')](function(_0x22c294){if(_0x22c294){return _0x22c294[_0xcbbe('0xbb')](_0x2ea210[_0xcbbe('0x44')][_0xcbbe('0x70')])[_0xcbbe('0x39')](function(){if(_[_0xcbbe('0xbc')](_0x2ea210[_0xcbbe('0x44')][_0xcbbe('0x70')])){for(var _0x1337ee=0x0;_0x1337ee<_0x2ea210[_0xcbbe('0x44')][_0xcbbe('0x70')][_0xcbbe('0x4b')];_0x1337ee+=0x1){socket[_0xcbbe('0xb9')](_0xcbbe('0xbd'),{'UserId':Number(_0x2ea210[_0xcbbe('0x44')][_0xcbbe('0x70')][_0x1337ee]),'OpenchannelAccountId':Number(_0x2ea210[_0xcbbe('0x66')]['id'])});}}else{socket[_0xcbbe('0xb9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2ea210[_0xcbbe('0x44')]['ids']),'OpenchannelAccountId':Number(_0x2ea210[_0xcbbe('0x66')]['id'])});}});}})[_0xcbbe('0x39')](respondWithStatusCode(_0x1e1de9,null))[_0xcbbe('0x2b')](handleError(_0x1e1de9,null));};exports[_0xcbbe('0xbe')]=function(_0x1c4205,_0x491a5e,_0x4b52cb){var _0x50fa5a={};var _0x13f7ea={};var _0x1e48bd;var _0x131fc3;return db['OpenchannelAccount'][_0xcbbe('0x6c')]({'where':{'id':_0x1c4205['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x491a5e,null))[_0xcbbe('0x39')](function(_0x27a73f){if(_0x27a73f){_0x1e48bd=_0x27a73f;_0x13f7ea[_0xcbbe('0x47')]=_['keys'](db['User'][_0xcbbe('0x40')]);_0x13f7ea[_0xcbbe('0x44')]=_[_0xcbbe('0x45')](_0x1c4205[_0xcbbe('0x44')]);_0x13f7ea[_0xcbbe('0x46')]=_[_0xcbbe('0x48')](_0x13f7ea[_0xcbbe('0x47')],_0x13f7ea['query']);_0x50fa5a[_0xcbbe('0x4a')]=_[_0xcbbe('0x48')](_0x13f7ea[_0xcbbe('0x47')],qs[_0xcbbe('0x49')](_0x1c4205['query']['fields']));_0x50fa5a[_0xcbbe('0x4a')]=_0x50fa5a[_0xcbbe('0x4a')]['length']?_0x50fa5a['attributes']:_0x13f7ea['model'];_0x50fa5a[_0xcbbe('0x4e')]=qs[_0xcbbe('0x4f')](_0x1c4205[_0xcbbe('0x44')][_0xcbbe('0x4f')]);_0x50fa5a[_0xcbbe('0x50')]=qs[_0xcbbe('0x46')](_[_0xcbbe('0x51')](_0x1c4205[_0xcbbe('0x44')],_0x13f7ea['filters']));if(_0x1c4205[_0xcbbe('0x44')][_0xcbbe('0x54')]){_0x50fa5a[_0xcbbe('0x50')]=_[_0xcbbe('0x52')](_0x50fa5a[_0xcbbe('0x50')],{'$or':_[_0xcbbe('0x3e')](_0x50fa5a[_0xcbbe('0x4a')],function(_0x54e324){var _0x6b1bfb={};_0x6b1bfb[_0x54e324]={'$like':'%'+_0x1c4205['query'][_0xcbbe('0x54')]+'%'};return _0x6b1bfb;})});}_0x50fa5a=_[_0xcbbe('0x52')]({},_0x50fa5a,_0x1c4205[_0xcbbe('0x55')]);return _0x1e48bd[_0xcbbe('0xbe')](_0x50fa5a);}})[_0xcbbe('0x39')](function(_0x484b06){if(_0x484b06){_0x131fc3=_0x484b06[_0xcbbe('0x4b')];if(!_0x1c4205[_0xcbbe('0x44')][_0xcbbe('0x4c')](_0xcbbe('0x4d'))){_0x50fa5a[_0xcbbe('0x31')]=qs['limit'](_0x1c4205[_0xcbbe('0x44')][_0xcbbe('0x31')]);_0x50fa5a['offset']=qs[_0xcbbe('0x33')](_0x1c4205[_0xcbbe('0x44')][_0xcbbe('0x33')]);}return _0x1e48bd['getAgents'](_0x50fa5a);}})[_0xcbbe('0x39')](function(_0x590e3f){if(_0x590e3f){return _0x590e3f?{'count':_0x131fc3,'rows':_0x590e3f}:null;}})[_0xcbbe('0x39')](respondWithResult(_0x491a5e,null))['catch'](handleError(_0x491a5e,null));};exports[_0xcbbe('0xad')]=function(_0x454f83,_0x6a38b4,_0x1f8271){var _0x473b15,_0x398bc0,_0x569d4c;if(_[_0xcbbe('0x7e')](_0x454f83['body'][_0xcbbe('0x65')])||_0x454f83['body'][_0xcbbe('0x65')]===''){throw new db['Sequelize']['ValidationError'](_0xcbbe('0x7f'));}if(_[_0xcbbe('0x7e')](_0x454f83[_0xcbbe('0x65')]['to'])){}_0x473b15=_0x454f83[_0xcbbe('0x65')]['to'];return db[_0xcbbe('0x3f')]['findOne']({'where':{'id':_0x454f83['params']['id']}})[_0xcbbe('0x39')](handleEntityNotFound(_0x6a38b4,null))['then'](function(_0x2e789a){if(_0x2e789a){return db['OpenchannelAccount']['find']({'where':{'id':_0x2e789a['id']},'include':[{'model':db[_0xcbbe('0x84')],'as':_0xcbbe('0x85'),'include':[{'model':db[_0xcbbe('0x74')],'as':_0xcbbe('0x86'),'where':{[_0x2e789a['mapKey']]:_0x473b15},'limit':0x1,'order':[[_0xcbbe('0x78'),_0xcbbe('0x87')]]}]}]})['then'](handleEntityNotFound(_0x6a38b4,null))[_0xcbbe('0x39')](function(_0x3b9e10){if(_0x3b9e10&&_0x3b9e10[_0xcbbe('0x85')]){_0x398bc0=_0x3b9e10[_0xcbbe('0x5f')]({'plain':!![]});if(_0x398bc0['List']&&_0x398bc0[_0xcbbe('0x85')][_0xcbbe('0x86')]['length']){return _0x398bc0[_0xcbbe('0x85')][_0xcbbe('0x86')][0x0];}return db[_0xcbbe('0x74')][_0xcbbe('0x5b')](_[_0xcbbe('0x19')](_0x454f83[_0xcbbe('0x65')],{'firstName':_0x473b15,[_0x3b9e10[_0xcbbe('0x80')]]:_0x473b15,'phone':_0x473b15,'ListId':_0x398bc0[_0xcbbe('0x7a')]}));}})[_0xcbbe('0x39')](handleEntityNotFound(_0x6a38b4,null))[_0xcbbe('0x39')](function(_0x4191ef){if(_0x4191ef){_0x569d4c=_0x4191ef;return db[_0xcbbe('0x93')]['find']({'where':{'ContactId':_0x569d4c['id'],'closed':![],'OpenchannelAccountId':_0x398bc0['id']}})['then'](function(_0x59e88a){if(_0x59e88a){return[_0x59e88a,![]];}return db['OpenchannelInteraction'][_0xcbbe('0x5b')]({'UserId':_0x454f83[_0xcbbe('0x5c')]['id'],'ContactId':_0x569d4c['id'],'OpenchannelAccountId':_0x398bc0['id'],'lastMsgDirection':_0xcbbe('0xbf'),'Messages':[_['merge'](_0x454f83[_0xcbbe('0x65')],{'read':![],'body':_0x454f83[_0xcbbe('0x65')][_0xcbbe('0x65')],'OpenchannelAccountId':_0x398bc0['id'],'UserId':_0x454f83[_0xcbbe('0x5c')]['id'],'ContactId':_0x569d4c['id']})]},{'include':[{'model':db[_0xcbbe('0x9e')],'as':'Messages'}]})[_0xcbbe('0x39')](function(_0xf65e1c){return[_0xf65e1c,!![]];});});}})[_0xcbbe('0x96')](function(_0x53a31,_0x1a239d){if(_0x1a239d){return _0x53a31;}return db[_0xcbbe('0x9e')]['create'](_[_0xcbbe('0x52')](_0x454f83['body'],{'read':![],'body':_0x454f83[_0xcbbe('0x65')][_0xcbbe('0x65')],'OpenchannelAccountId':_0x398bc0['id'],'OpenchannelInteractionId':_0x53a31['id'],'UserId':_0x454f83[_0xcbbe('0x5c')]['id'],'ContactId':_0x569d4c['id']}))['then'](function(_0x2e302c){_0x53a31[_0xcbbe('0xc0')][_0xcbbe('0xc1')]=[];_0x53a31[_0xcbbe('0xc0')][_0xcbbe('0xc1')]['push'](_0x2e302c[_0xcbbe('0xc0')]);return _0x53a31;});});}})[_0xcbbe('0x39')](respondWithResult(_0x6a38b4,null))[_0xcbbe('0x2b')](handleError(_0x6a38b4,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 4f0016a..6d7c25d 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 _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x3cafdb,_0x2cec23){var _0x3e73c4=function(_0x3c084d){while(--_0x3c084d){_0x3cafdb['push'](_0x3cafdb['shift']());}};_0x3e73c4(++_0x2cec23);}(_0x1339,0x1ed));var _0x9133=function(_0x550c05,_0x386f99){_0x550c05=_0x550c05-0x0;var _0x1e99be=_0x1339[_0x550c05];return _0x1e99be;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6c76=['update','emit','hook','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x1dd9c4,_0x288740){var _0x316962=function(_0x2012f8){while(--_0x2012f8){_0x1dd9c4['push'](_0x1dd9c4['shift']());}};_0x316962(++_0x288740);}(_0x6c76,0x184));var _0x66c7=function(_0x3dec06,_0x2eec1e){_0x3dec06=_0x3dec06-0x0;var _0x3e7afb=_0x6c76[_0x3dec06];return _0x3e7afb;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var OpenchannelAccount=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x66c7('0x6')](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 556dd01..8527509 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(_0x5c15a7,_0x3bbe28){var _0x2fe257=function(_0x1ec7b9){while(--_0x1ec7b9){_0x5c15a7['push'](_0x5c15a7['shift']());}};_0x2fe257(++_0x3bbe28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x3c9ee1,_0x4827dc){var _0x476c0e=function(_0x53b5c3){while(--_0x53b5c3){_0x3c9ee1['push'](_0x3c9ee1['shift']());}};_0x476c0e(++_0x4827dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 917e174..ae0837c 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 _0x6215=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info'];(function(_0x27a8a9,_0x2a2b4d){var _0x8da759=function(_0x21ed81){while(--_0x21ed81){_0x27a8a9['push'](_0x27a8a9['shift']());}};_0x8da759(++_0x2a2b4d);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var moment=require(_0x5621('0x2'));var BPromise=require('bluebird');var rs=require(_0x5621('0x3'));var fs=require('fs');var Redis=require(_0x5621('0x4'));var db=require(_0x5621('0x5'))['db'];var utils=require(_0x5621('0x6'));var logger=require(_0x5621('0x7'))(_0x5621('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5621('0x9')]=_[_0x5621('0xa')](config[_0x5621('0x9')],{'host':_0x5621('0xb'),'port':0x18eb});var socket=require(_0x5621('0xc'))(new Redis(config['redis']));require(_0x5621('0xd'))[_0x5621('0xe')](socket);function respondWithRpcPromise(_0x3aa022,_0x418114,_0x53625c){return new BPromise(function(_0x1f4148,_0x10bb32){return client[_0x5621('0xf')](_0x3aa022,_0x53625c)['then'](function(_0x2b0f51){logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));logger[_0x5621('0x13')](_0x5621('0x14'),_0x418114,_0x5621('0x12'),JSON[_0x5621('0x15')](_0x2b0f51));if(_0x2b0f51[_0x5621('0x16')]){if(_0x2b0f51[_0x5621('0x16')]['code']===0x1f4){logger[_0x5621('0x16')](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')]['message']);return _0x10bb32(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}logger['error'](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);return _0x1f4148(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}else{logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));_0x1f4148(_0x2b0f51[_0x5621('0x18')][_0x5621('0x17')]);}})['catch'](function(_0x1111b2){logger[_0x5621('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x418114,_0x1111b2);_0x10bb32(_0x1111b2);});});} \ No newline at end of file +var _0x757a=['redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4db8d9,_0x100e73){var _0x1e1a49=function(_0x292d49){while(--_0x292d49){_0x4db8d9['push'](_0x4db8d9['shift']());}};_0x1e1a49(++_0x100e73);}(_0x757a,0xde));var _0xa757=function(_0x4a5b89,_0x447afd){_0x4a5b89=_0x4a5b89-0x0;var _0xe767da=_0x757a[_0x4a5b89];return _0xe767da;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 8618605..56b8bf8 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 _0xf4eb=['removeListener','register','./openchannelAccount.events'];(function(_0x51ec86,_0x192ca7){var _0x25e528=function(_0x1c03a7){while(--_0x1c03a7){_0x51ec86['push'](_0x51ec86['shift']());}};_0x25e528(++_0x192ca7);}(_0xf4eb,0xec));var _0xbf4e=function(_0xe15826,_0x363eda){_0xe15826=_0xe15826-0x0;var _0x1fa0f5=_0xf4eb[_0xe15826];return _0x1fa0f5;};'use strict';var OpenchannelAccountEvents=require(_0xbf4e('0x0'));var events=['save','remove','update'];function createListener(_0x5ed5b9,_0xbbbf01){return function(_0x49d80e){_0xbbbf01['emit'](_0x5ed5b9,_0x49d80e);};}function removeListener(_0x2e3070,_0x1c7606){return function(){OpenchannelAccountEvents[_0xbf4e('0x1')](_0x2e3070,_0x1c7606);};}exports[_0xbf4e('0x2')]=function(_0xa4dcf5){for(var _0x2fcfed=0x0,_0x15b99f=events['length'];_0x2fcfed<_0x15b99f;_0x2fcfed++){var _0x449d55=events[_0x2fcfed];var _0x5013c2=createListener('openchannelAccount:'+_0x449d55,_0xa4dcf5);OpenchannelAccountEvents['on'](_0x449d55,_0x5013c2);}}; \ No newline at end of file +var _0xda65=['length','openchannelAccount:','./openchannelAccount.events','save','remove','removeListener','register'];(function(_0x1b0456,_0xc538d8){var _0x44e420=function(_0x1724f7){while(--_0x1724f7){_0x1b0456['push'](_0x1b0456['shift']());}};_0x44e420(++_0xc538d8);}(_0xda65,0x1d0));var _0x5da6=function(_0x4c2722,_0x16668c){_0x4c2722=_0x4c2722-0x0;var _0x25336d=_0xda65[_0x4c2722];return _0x25336d;};'use strict';var OpenchannelAccountEvents=require(_0x5da6('0x0'));var events=[_0x5da6('0x1'),_0x5da6('0x2'),'update'];function createListener(_0x377db8,_0x20415b){return function(_0xd35866){_0x20415b['emit'](_0x377db8,_0xd35866);};}function removeListener(_0x5c80b4,_0x73d407){return function(){OpenchannelAccountEvents[_0x5da6('0x3')](_0x5c80b4,_0x73d407);};}exports[_0x5da6('0x4')]=function(_0x32ff03){for(var _0x75126f=0x0,_0x51924c=events[_0x5da6('0x5')];_0x75126f<_0x51924c;_0x75126f++){var _0x4a7040=events[_0x75126f];var _0x55108e=createListener(_0x5da6('0x6')+_0x4a7040,_0x32ff03);OpenchannelAccountEvents['on'](_0x4a7040,_0x55108e);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 25c32ae..84eb36b 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 _0x9019=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports'];(function(_0x831b25,_0x2284dd){var _0x1c1fd2=function(_0x15b532){while(--_0x15b532){_0x831b25['push'](_0x831b25['shift']());}};_0x1c1fd2(++_0x2284dd);}(_0x9019,0x180));var _0x9901=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x9019[_0x1f3aec];return _0x409f0d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9901('0x0'));var router=express['Router']();var fs_extra=require(_0x9901('0x1'));var auth=require(_0x9901('0x2'));var interaction=require(_0x9901('0x3'));var config=require(_0x9901('0x4'));var controller=require(_0x9901('0x5'));router[_0x9901('0x6')]('/',auth[_0x9901('0x7')](),controller[_0x9901('0x8')]);router[_0x9901('0x6')](_0x9901('0x9'),auth['isAuthenticated'](),controller[_0x9901('0xa')]);router[_0x9901('0xb')]('/',auth['isAuthenticated'](),controller[_0x9901('0xc')]);router['put'](_0x9901('0x9'),auth[_0x9901('0x7')](),controller['update']);router[_0x9901('0xd')](_0x9901('0x9'),auth[_0x9901('0x7')](),controller[_0x9901('0xe')]);module[_0x9901('0xf')]=router; \ No newline at end of file +var _0xfc8a=['multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','create','put','/:id','delete','destroy'];(function(_0x4c64d7,_0x5d93e6){var _0x5d613d=function(_0xbb4090){while(--_0xbb4090){_0x4c64d7['push'](_0x4c64d7['shift']());}};_0x5d613d(++_0x5d93e6);}(_0xfc8a,0x190));var _0xafc8=function(_0x10907b,_0x5d9ebc){_0x10907b=_0x10907b-0x0;var _0x83a307=_0xfc8a[_0x10907b];return _0x83a307;};'use strict';var multer=require(_0xafc8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xafc8('0x1'));var express=require(_0xafc8('0x2'));var router=express[_0xafc8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xafc8('0x4'));var config=require(_0xafc8('0x5'));var controller=require(_0xafc8('0x6'));router[_0xafc8('0x7')]('/',auth[_0xafc8('0x8')](),controller[_0xafc8('0x9')]);router[_0xafc8('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xafc8('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xafc8('0xb')]);router[_0xafc8('0xc')](_0xafc8('0xd'),auth[_0xafc8('0x8')](),controller['update']);router[_0xafc8('0xe')](_0xafc8('0xd'),auth[_0xafc8('0x8')](),controller[_0xafc8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 41ba2f0..502b6d3 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 _0xa608=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa608,0x68));var _0x8a60=function(_0x10f17c,_0x25a5f8){_0x10f17c=_0x10f17c-0x0;var _0x53702b=_0xa608[_0x10f17c];return _0x53702b;};'use strict';var Sequelize=require(_0x8a60('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8a60('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8a60('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8a60('0x3')]()},'description':{'type':Sequelize[_0x8a60('0x2')]},'interval':{'type':Sequelize[_0x8a60('0x2')],'defaultValue':_0x8a60('0x4')}}; \ No newline at end of file +var _0x742c=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x742c,0x11b));var _0xc742=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x742c[_0x3616bb];return _0x1c0994;};'use strict';var Sequelize=require(_0xc742('0x0'));module[_0xc742('0x1')]={'priority':{'type':Sequelize[_0xc742('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc742('0x3')},'appdata':{'type':Sequelize[_0xc742('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc742('0x5')],'defaultValue':_0xc742('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index c628535..b12e878 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 _0xab7e=['end','error','stack','name','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','rimraf','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xab7e,0x188));var _0xeab7=function(_0x272ed5,_0x174b1a){_0x272ed5=_0x272ed5-0x0;var _0x2e3657=_0xab7e[_0x272ed5];return _0x2e3657;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeab7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeab7('0x1'));var BPromise=require(_0xeab7('0x2'));var Mustache=require(_0xeab7('0x3'));var util=require(_0xeab7('0x4'));var path=require('path');var sox=require(_0xeab7('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeab7('0x6'));var squel=require(_0xeab7('0x7'));var crypto=require(_0xeab7('0x8'));var jsforce=require(_0xeab7('0x9'));var deskjs=require(_0xeab7('0xa'));var toCsv=require(_0xeab7('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeab7('0xc'));var authService=require(_0xeab7('0xd'));var qs=require(_0xeab7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeab7('0xf'));var logger=require(_0xeab7('0x10'))(_0xeab7('0x11'));var utils=require(_0xeab7('0x12'));var config=require(_0xeab7('0x13'));var licenseUtil=require(_0xeab7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491937,_0x2b0e5f){_0x2b0e5f=_0x2b0e5f||0xcc;return function(_0x34aa85){if(_0x34aa85){return _0x491937[_0xeab7('0x15')](_0x2b0e5f);}return _0x491937[_0xeab7('0x16')](_0x2b0e5f)['end']();};}function respondWithResult(_0x5aa01e,_0x45ae5f){_0x45ae5f=_0x45ae5f||0xc8;return function(_0x2b1460){if(_0x2b1460){return _0x5aa01e[_0xeab7('0x16')](_0x45ae5f)[_0xeab7('0x17')](_0x2b1460);}};}function respondWithFilteredResult(_0x14d9e5,_0x5d2ca0){return function(_0x1965a2){if(_0x1965a2){var _0x3bcc1e=typeof _0x5d2ca0['offset']===_0xeab7('0x18')&&typeof _0x5d2ca0[_0xeab7('0x19')]==='undefined';var _0x2e6014=_0x1965a2[_0xeab7('0x1a')];var _0x35b90b=_0x3bcc1e?0x0:_0x5d2ca0['offset'];var _0x193988=_0x3bcc1e?_0x1965a2[_0xeab7('0x1a')]:_0x5d2ca0[_0xeab7('0x1b')]+_0x5d2ca0[_0xeab7('0x19')];var _0x1daa7f;if(_0x193988>=_0x2e6014){_0x193988=_0x2e6014;_0x1daa7f=0xc8;}else{_0x1daa7f=0xce;}_0x14d9e5['status'](_0x1daa7f);return _0x14d9e5[_0xeab7('0x1c')](_0xeab7('0x1d'),_0x35b90b+'-'+_0x193988+'/'+_0x2e6014)[_0xeab7('0x17')](_0x1965a2);}return null;};}function patchUpdates(_0x2302fa){return function(_0x3103cb){try{jsonpatch['apply'](_0x3103cb,_0x2302fa,!![]);}catch(_0x314c48){return BPromise['reject'](_0x314c48);}return _0x3103cb[_0xeab7('0x1e')]();};}function saveUpdates(_0x542dfd,_0x399264){return function(_0x1cbdb9){if(_0x1cbdb9){return _0x1cbdb9[_0xeab7('0x1f')](_0x542dfd)[_0xeab7('0x20')](function(_0x3ec370){return _0x3ec370;});}return null;};}function removeEntity(_0x78b6d0,_0x1e46d0){return function(_0x719295){if(_0x719295){return _0x719295[_0xeab7('0x21')]()['then'](function(){_0x78b6d0['status'](0xcc)[_0xeab7('0x22')]();});}};}function handleEntityNotFound(_0x1acc2e,_0x34def4){return function(_0xe3ab75){if(!_0xe3ab75){_0x1acc2e['sendStatus'](0x194);}return _0xe3ab75;};}function handleError(_0x286b73,_0x53c4ff){_0x53c4ff=_0x53c4ff||0x1f4;return function(_0x3f7a2a){logger[_0xeab7('0x23')](_0x3f7a2a[_0xeab7('0x24')]);if(_0x3f7a2a[_0xeab7('0x25')]){delete _0x3f7a2a[_0xeab7('0x25')];}_0x286b73[_0xeab7('0x16')](_0x53c4ff)['send'](_0x3f7a2a);};}exports[_0xeab7('0x26')]=function(_0x44d208,_0x5483eb){var _0xfb080e={},_0x3c153e={},_0x3d8d2e={'count':0x0,'rows':[]};var _0x8ee3c8=_[_0xeab7('0x27')](db[_0xeab7('0x28')]['rawAttributes'],function(_0x48ee2){return{'name':_0x48ee2[_0xeab7('0x29')],'type':_0x48ee2[_0xeab7('0x2a')][_0xeab7('0x2b')]};});_0x3c153e[_0xeab7('0x2c')]=_[_0xeab7('0x27')](_0x8ee3c8,'name');_0x3c153e[_0xeab7('0x2d')]=_[_0xeab7('0x2e')](_0x44d208[_0xeab7('0x2d')]);_0x3c153e[_0xeab7('0x2f')]=_[_0xeab7('0x30')](_0x3c153e[_0xeab7('0x2c')],_0x3c153e[_0xeab7('0x2d')]);_0xfb080e[_0xeab7('0x31')]=_[_0xeab7('0x30')](_0x3c153e[_0xeab7('0x2c')],qs[_0xeab7('0x32')](_0x44d208['query'][_0xeab7('0x32')]));_0xfb080e['attributes']=_0xfb080e['attributes'][_0xeab7('0x33')]?_0xfb080e[_0xeab7('0x31')]:_0x3c153e[_0xeab7('0x2c')];if(!_0x44d208[_0xeab7('0x2d')][_0xeab7('0x34')](_0xeab7('0x35'))){_0xfb080e[_0xeab7('0x19')]=qs['limit'](_0x44d208['query'][_0xeab7('0x19')]);_0xfb080e[_0xeab7('0x1b')]=qs[_0xeab7('0x1b')](_0x44d208[_0xeab7('0x2d')][_0xeab7('0x1b')]);}_0xfb080e['order']=qs[_0xeab7('0x36')](_0x44d208[_0xeab7('0x2d')]['sort']);_0xfb080e[_0xeab7('0x37')]=qs[_0xeab7('0x2f')](_[_0xeab7('0x38')](_0x44d208['query'],_0x3c153e['filters']),_0x8ee3c8);if(_0x44d208[_0xeab7('0x2d')][_0xeab7('0x39')]){_0xfb080e[_0xeab7('0x37')]=_['merge'](_0xfb080e['where'],{'$or':_[_0xeab7('0x27')](_0x8ee3c8,function(_0x444749){if(_0x444749[_0xeab7('0x2a')]!=='VIRTUAL'){var _0x687daf={};_0x687daf[_0x444749[_0xeab7('0x25')]]={'$like':'%'+_0x44d208[_0xeab7('0x2d')][_0xeab7('0x39')]+'%'};return _0x687daf;}})});}_0xfb080e=_[_0xeab7('0x3a')]({},_0xfb080e,_0x44d208[_0xeab7('0x3b')]);var _0x316ede={'where':_0xfb080e['where']};return db[_0xeab7('0x28')][_0xeab7('0x1a')](_0x316ede)['then'](function(_0x1df18b){_0x3d8d2e[_0xeab7('0x1a')]=_0x1df18b;if(_0x44d208[_0xeab7('0x2d')][_0xeab7('0x3c')]){_0xfb080e['include']=[{'all':!![]}];}return db[_0xeab7('0x28')][_0xeab7('0x3d')](_0xfb080e);})[_0xeab7('0x20')](function(_0x3377c9){_0x3d8d2e[_0xeab7('0x3e')]=_0x3377c9;return _0x3d8d2e;})[_0xeab7('0x20')](respondWithFilteredResult(_0x5483eb,_0xfb080e))[_0xeab7('0x3f')](handleError(_0x5483eb,null));};exports[_0xeab7('0x40')]=function(_0x3c8ac5,_0x2d8226){var _0x269a1f={'raw':!![],'where':{'id':_0x3c8ac5[_0xeab7('0x41')]['id']}},_0x4889f8={};_0x4889f8[_0xeab7('0x2c')]=_['keys'](db['OpenchannelApplication'][_0xeab7('0x42')]);_0x4889f8[_0xeab7('0x2d')]=_['keys'](_0x3c8ac5[_0xeab7('0x2d')]);_0x4889f8[_0xeab7('0x2f')]=_[_0xeab7('0x30')](_0x4889f8['model'],_0x4889f8[_0xeab7('0x2d')]);_0x269a1f[_0xeab7('0x31')]=_['intersection'](_0x4889f8[_0xeab7('0x2c')],qs[_0xeab7('0x32')](_0x3c8ac5['query'][_0xeab7('0x32')]));_0x269a1f[_0xeab7('0x31')]=_0x269a1f[_0xeab7('0x31')][_0xeab7('0x33')]?_0x269a1f[_0xeab7('0x31')]:_0x4889f8[_0xeab7('0x2c')];if(_0x3c8ac5[_0xeab7('0x2d')][_0xeab7('0x3c')]){_0x269a1f[_0xeab7('0x43')]=[{'all':!![]}];}_0x269a1f=_[_0xeab7('0x3a')]({},_0x269a1f,_0x3c8ac5['options']);return db['OpenchannelApplication'][_0xeab7('0x44')](_0x269a1f)[_0xeab7('0x20')](handleEntityNotFound(_0x2d8226,null))[_0xeab7('0x20')](respondWithResult(_0x2d8226,null))['catch'](handleError(_0x2d8226,null));};exports[_0xeab7('0x45')]=function(_0x3dc427,_0x2d2e5b){return db[_0xeab7('0x28')][_0xeab7('0x45')](_0x3dc427[_0xeab7('0x46')],{})[_0xeab7('0x20')](respondWithResult(_0x2d2e5b,0xc9))[_0xeab7('0x3f')](handleError(_0x2d2e5b,null));};exports[_0xeab7('0x1f')]=function(_0x2a1f59,_0x127d18){if(_0x2a1f59['body']['id']){delete _0x2a1f59[_0xeab7('0x46')]['id'];}return db[_0xeab7('0x28')][_0xeab7('0x44')]({'where':{'id':_0x2a1f59['params']['id']}})[_0xeab7('0x20')](handleEntityNotFound(_0x127d18,null))[_0xeab7('0x20')](saveUpdates(_0x2a1f59[_0xeab7('0x46')],null))[_0xeab7('0x20')](respondWithResult(_0x127d18,null))[_0xeab7('0x3f')](handleError(_0x127d18,null));};exports['destroy']=function(_0x345970,_0x405ac2){return db[_0xeab7('0x28')][_0xeab7('0x44')]({'where':{'id':_0x345970['params']['id']}})[_0xeab7('0x20')](handleEntityNotFound(_0x405ac2,null))[_0xeab7('0x20')](removeEntity(_0x405ac2,null))[_0xeab7('0x3f')](handleError(_0x405ac2,null));}; \ No newline at end of file +var _0x36cc=['merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','rows','params','keys','intersection','catch','create','body','update','destroy','find','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','filter'];(function(_0x3206db,_0x2c7a7c){var _0x24bd77=function(_0x4835d6){while(--_0x4835d6){_0x3206db['push'](_0x3206db['shift']());}};_0x24bd77(++_0x2c7a7c);}(_0x36cc,0x124));var _0xc36c=function(_0x285f34,_0x3d5dde){_0x285f34=_0x285f34-0x0;var _0x46d408=_0x36cc[_0x285f34];return _0x46d408;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc36c('0x0'));var zipdir=require(_0xc36c('0x1'));var jsonpatch=require(_0xc36c('0x2'));var rp=require('request-promise');var moment=require(_0xc36c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc36c('0x4'));var util=require(_0xc36c('0x5'));var path=require('path');var sox=require(_0xc36c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc36c('0x7'));var _=require(_0xc36c('0x8'));var squel=require(_0xc36c('0x9'));var crypto=require(_0xc36c('0xa'));var jsforce=require(_0xc36c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc36c('0xc'));var querystring=require(_0xc36c('0xd'));var Papa=require('papaparse');var Redis=require(_0xc36c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc36c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc36c('0x10'))(_0xc36c('0x11'));var utils=require('../../config/utils');var config=require(_0xc36c('0x12'));var licenseUtil=require(_0xc36c('0x13'));var db=require(_0xc36c('0x14'))['db'];function respondWithStatusCode(_0x423c5d,_0x4721b0){_0x4721b0=_0x4721b0||0xcc;return function(_0x3e97e3){if(_0x3e97e3){return _0x423c5d['sendStatus'](_0x4721b0);}return _0x423c5d[_0xc36c('0x15')](_0x4721b0)['end']();};}function respondWithResult(_0x576e40,_0x1dadea){_0x1dadea=_0x1dadea||0xc8;return function(_0x1589b3){if(_0x1589b3){return _0x576e40[_0xc36c('0x15')](_0x1dadea)[_0xc36c('0x16')](_0x1589b3);}};}function respondWithFilteredResult(_0x5d8e15,_0x99abc2){return function(_0x5506cf){if(_0x5506cf){var _0x14f0e2=typeof _0x99abc2['offset']==='undefined'&&typeof _0x99abc2[_0xc36c('0x17')]==='undefined';var _0x27b33a=_0x5506cf[_0xc36c('0x18')];var _0x1fb4b6=_0x14f0e2?0x0:_0x99abc2['offset'];var _0x259314=_0x14f0e2?_0x5506cf[_0xc36c('0x18')]:_0x99abc2[_0xc36c('0x19')]+_0x99abc2[_0xc36c('0x17')];var _0x34cd06;if(_0x259314>=_0x27b33a){_0x259314=_0x27b33a;_0x34cd06=0xc8;}else{_0x34cd06=0xce;}_0x5d8e15[_0xc36c('0x15')](_0x34cd06);return _0x5d8e15[_0xc36c('0x1a')](_0xc36c('0x1b'),_0x1fb4b6+'-'+_0x259314+'/'+_0x27b33a)[_0xc36c('0x16')](_0x5506cf);}return null;};}function patchUpdates(_0x78c7e8){return function(_0x3c8377){try{jsonpatch[_0xc36c('0x1c')](_0x3c8377,_0x78c7e8,!![]);}catch(_0x12d920){return BPromise[_0xc36c('0x1d')](_0x12d920);}return _0x3c8377[_0xc36c('0x1e')]();};}function saveUpdates(_0x366d7f,_0x2214a9){return function(_0x5d93b3){if(_0x5d93b3){return _0x5d93b3['update'](_0x366d7f)[_0xc36c('0x1f')](function(_0x3a5d5f){return _0x3a5d5f;});}return null;};}function removeEntity(_0x56d36a,_0x365bcb){return function(_0x512c81){if(_0x512c81){return _0x512c81['destroy']()['then'](function(){_0x56d36a[_0xc36c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5390a7,_0x663d7b){return function(_0x4fd38c){if(!_0x4fd38c){_0x5390a7[_0xc36c('0x20')](0x194);}return _0x4fd38c;};}function handleError(_0x41bf81,_0x358900){_0x358900=_0x358900||0x1f4;return function(_0x19a9a9){logger[_0xc36c('0x21')](_0x19a9a9[_0xc36c('0x22')]);if(_0x19a9a9[_0xc36c('0x23')]){delete _0x19a9a9['name'];}_0x41bf81['status'](_0x358900)[_0xc36c('0x24')](_0x19a9a9);};}exports[_0xc36c('0x25')]=function(_0x23944b,_0xca2ff0){var _0x30ab70={},_0x1eeb2d={},_0x444e30={'count':0x0,'rows':[]};var _0x2ee9f0=_[_0xc36c('0x26')](db['OpenchannelApplication'][_0xc36c('0x27')],function(_0x16fbb2){return{'name':_0x16fbb2[_0xc36c('0x28')],'type':_0x16fbb2[_0xc36c('0x29')][_0xc36c('0x2a')]};});_0x1eeb2d[_0xc36c('0x2b')]=_[_0xc36c('0x26')](_0x2ee9f0,_0xc36c('0x23'));_0x1eeb2d['query']=_['keys'](_0x23944b[_0xc36c('0x2c')]);_0x1eeb2d[_0xc36c('0x2d')]=_['intersection'](_0x1eeb2d['model'],_0x1eeb2d['query']);_0x30ab70[_0xc36c('0x2e')]=_['intersection'](_0x1eeb2d[_0xc36c('0x2b')],qs[_0xc36c('0x2f')](_0x23944b['query'][_0xc36c('0x2f')]));_0x30ab70[_0xc36c('0x2e')]=_0x30ab70[_0xc36c('0x2e')][_0xc36c('0x30')]?_0x30ab70[_0xc36c('0x2e')]:_0x1eeb2d['model'];if(!_0x23944b[_0xc36c('0x2c')][_0xc36c('0x31')]('nolimit')){_0x30ab70['limit']=qs[_0xc36c('0x17')](_0x23944b[_0xc36c('0x2c')][_0xc36c('0x17')]);_0x30ab70[_0xc36c('0x19')]=qs[_0xc36c('0x19')](_0x23944b[_0xc36c('0x2c')][_0xc36c('0x19')]);}_0x30ab70['order']=qs[_0xc36c('0x32')](_0x23944b['query']['sort']);_0x30ab70[_0xc36c('0x33')]=qs[_0xc36c('0x2d')](_['pick'](_0x23944b[_0xc36c('0x2c')],_0x1eeb2d['filters']),_0x2ee9f0);if(_0x23944b[_0xc36c('0x2c')][_0xc36c('0x34')]){_0x30ab70[_0xc36c('0x33')]=_[_0xc36c('0x35')](_0x30ab70[_0xc36c('0x33')],{'$or':_['map'](_0x2ee9f0,function(_0x107fa2){if(_0x107fa2[_0xc36c('0x29')]!==_0xc36c('0x36')){var _0x14e364={};_0x14e364[_0x107fa2['name']]={'$like':'%'+_0x23944b[_0xc36c('0x2c')][_0xc36c('0x34')]+'%'};return _0x14e364;}})});}_0x30ab70=_[_0xc36c('0x35')]({},_0x30ab70,_0x23944b[_0xc36c('0x37')]);var _0x5049bc={'where':_0x30ab70[_0xc36c('0x33')]};return db[_0xc36c('0x38')][_0xc36c('0x18')](_0x5049bc)['then'](function(_0xa3bfe2){_0x444e30[_0xc36c('0x18')]=_0xa3bfe2;if(_0x23944b[_0xc36c('0x2c')][_0xc36c('0x39')]){_0x30ab70[_0xc36c('0x3a')]=[{'all':!![]}];}return db[_0xc36c('0x38')]['findAll'](_0x30ab70);})[_0xc36c('0x1f')](function(_0x1921ea){_0x444e30[_0xc36c('0x3b')]=_0x1921ea;return _0x444e30;})['then'](respondWithFilteredResult(_0xca2ff0,_0x30ab70))['catch'](handleError(_0xca2ff0,null));};exports['show']=function(_0xb8dca3,_0x50eb0c){var _0x30d8a1={'raw':!![],'where':{'id':_0xb8dca3[_0xc36c('0x3c')]['id']}},_0x3bf4b4={};_0x3bf4b4['model']=_[_0xc36c('0x3d')](db['OpenchannelApplication'][_0xc36c('0x27')]);_0x3bf4b4[_0xc36c('0x2c')]=_[_0xc36c('0x3d')](_0xb8dca3[_0xc36c('0x2c')]);_0x3bf4b4[_0xc36c('0x2d')]=_[_0xc36c('0x3e')](_0x3bf4b4[_0xc36c('0x2b')],_0x3bf4b4['query']);_0x30d8a1['attributes']=_[_0xc36c('0x3e')](_0x3bf4b4[_0xc36c('0x2b')],qs['fields'](_0xb8dca3[_0xc36c('0x2c')][_0xc36c('0x2f')]));_0x30d8a1[_0xc36c('0x2e')]=_0x30d8a1[_0xc36c('0x2e')]['length']?_0x30d8a1[_0xc36c('0x2e')]:_0x3bf4b4[_0xc36c('0x2b')];if(_0xb8dca3[_0xc36c('0x2c')]['includeAll']){_0x30d8a1[_0xc36c('0x3a')]=[{'all':!![]}];}_0x30d8a1=_[_0xc36c('0x35')]({},_0x30d8a1,_0xb8dca3[_0xc36c('0x37')]);return db[_0xc36c('0x38')]['find'](_0x30d8a1)['then'](handleEntityNotFound(_0x50eb0c,null))[_0xc36c('0x1f')](respondWithResult(_0x50eb0c,null))[_0xc36c('0x3f')](handleError(_0x50eb0c,null));};exports[_0xc36c('0x40')]=function(_0x48ed90,_0x3051d7){return db['OpenchannelApplication'][_0xc36c('0x40')](_0x48ed90[_0xc36c('0x41')],{})[_0xc36c('0x1f')](respondWithResult(_0x3051d7,0xc9))[_0xc36c('0x3f')](handleError(_0x3051d7,null));};exports[_0xc36c('0x42')]=function(_0x1e408c,_0xf4b767){if(_0x1e408c['body']['id']){delete _0x1e408c[_0xc36c('0x41')]['id'];}return db[_0xc36c('0x38')]['find']({'where':{'id':_0x1e408c['params']['id']}})[_0xc36c('0x1f')](handleEntityNotFound(_0xf4b767,null))[_0xc36c('0x1f')](saveUpdates(_0x1e408c[_0xc36c('0x41')],null))['then'](respondWithResult(_0xf4b767,null))[_0xc36c('0x3f')](handleError(_0xf4b767,null));};exports[_0xc36c('0x43')]=function(_0xf3601d,_0x47251a){return db[_0xc36c('0x38')][_0xc36c('0x44')]({'where':{'id':_0xf3601d[_0xc36c('0x3c')]['id']}})[_0xc36c('0x1f')](handleEntityNotFound(_0x47251a,null))[_0xc36c('0x1f')](removeEntity(_0x47251a,null))[_0xc36c('0x3f')](handleError(_0x47251a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index cd9e963..4bf9aa3 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 _0xce98=['moment','bluebird','request-promise','path','rimraf','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x341b11,_0x8ecd4d){var _0x361b8e=function(_0x40d53a){while(--_0x40d53a){_0x341b11['push'](_0x341b11['shift']());}};_0x361b8e(++_0x8ecd4d);}(_0xce98,0x106));var _0x8ce9=function(_0x1de131,_0x3877bb){_0x1de131=_0x1de131-0x0;var _0x4b1212=_0xce98[_0x1de131];return _0x4b1212;};'use strict';var _=require(_0x8ce9('0x0'));var util=require(_0x8ce9('0x1'));var logger=require(_0x8ce9('0x2'))(_0x8ce9('0x3'));var moment=require(_0x8ce9('0x4'));var BPromise=require(_0x8ce9('0x5'));var rp=require(_0x8ce9('0x6'));var fs=require('fs');var path=require(_0x8ce9('0x7'));var rimraf=require(_0x8ce9('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x18002f,_0x2f012d){return _0x18002f[_0x8ce9('0x9')](_0x8ce9('0xa'),attributes,{'tableName':_0x8ce9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ce9('0xc'),'collate':_0x8ce9('0xd')});}; \ No newline at end of file +var _0xf9cd=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xf9cd,0x124));var _0xdf9c=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xf9cd[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xdf9c('0x0'));var util=require(_0xdf9c('0x1'));var logger=require(_0xdf9c('0x2'))(_0xdf9c('0x3'));var moment=require(_0xdf9c('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf9c('0x5'));var fs=require('fs');var path=require(_0xdf9c('0x6'));var rimraf=require(_0xdf9c('0x7'));var config=require(_0xdf9c('0x8'));var attributes=require(_0xdf9c('0x9'));module[_0xdf9c('0xa')]=function(_0x450747,_0x143b73){return _0x450747[_0xdf9c('0xb')]('OpenchannelApplication',attributes,{'tableName':_0xdf9c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdf9c('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 84c4e31..b11660a 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 _0xa775=['message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','attributes','limit','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x4b5963,_0x526267){var _0x45ea47=function(_0x22eabd){while(--_0x22eabd){_0x4b5963['push'](_0x4b5963['shift']());}};_0x45ea47(++_0x526267);}(_0xa775,0x15d));var _0x5a77=function(_0x12d016,_0xf341d6){_0x12d016=_0x12d016-0x0;var _0x327363=_0xa775[_0x12d016];return _0x327363;};'use strict';var _=require('lodash');var util=require(_0x5a77('0x0'));var moment=require(_0x5a77('0x1'));var BPromise=require(_0x5a77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a77('0x3'))['db'];var utils=require(_0x5a77('0x4'));var logger=require('../../config/logger')(_0x5a77('0x5'));var config=require(_0x5a77('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1640af,_0x3a55d2,_0x312708){return new BPromise(function(_0xe92360,_0x1bd251){return client[_0x5a77('0x7')](_0x1640af,_0x312708)[_0x5a77('0x8')](function(_0x147639){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x3a55d2,_0x5a77('0x9'));logger[_0x5a77('0xa')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3a55d2,_0x5a77('0x9'),JSON[_0x5a77('0xb')](_0x147639));if(_0x147639['error']){if(_0x147639[_0x5a77('0xc')][_0x5a77('0xd')]===0x1f4){logger[_0x5a77('0xc')](_0x5a77('0xe'),_0x3a55d2,_0x147639[_0x5a77('0xc')]['message']);return _0x1bd251(_0x147639[_0x5a77('0xc')]['message']);}logger[_0x5a77('0xc')](_0x5a77('0xe'),_0x3a55d2,_0x147639[_0x5a77('0xc')]['message']);return _0xe92360(_0x147639[_0x5a77('0xc')][_0x5a77('0xf')]);}else{logger[_0x5a77('0x10')](_0x5a77('0xe'),_0x3a55d2,_0x5a77('0x9'));_0xe92360(_0x147639[_0x5a77('0x11')][_0x5a77('0xf')]);}})['catch'](function(_0x4b80c5){logger[_0x5a77('0xc')](_0x5a77('0xe'),_0x3a55d2,_0x4b80c5);_0x1bd251(_0x4b80c5);});});}exports[_0x5a77('0x12')]=function(_0x34897a){var _0x14f0d4=this;return new Promise(function(_0x50716d,_0xf97dc9){return db[_0x5a77('0x13')][_0x5a77('0x14')](_0x34897a['body'],{'raw':_0x34897a[_0x5a77('0x15')]?_0x34897a[_0x5a77('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34897a[_0x5a77('0x15')]?_0x34897a[_0x5a77('0x15')][_0x5a77('0x16')]||null:null,'attributes':_0x34897a[_0x5a77('0x15')]?_0x34897a[_0x5a77('0x15')][_0x5a77('0x17')]||null:null,'limit':_0x34897a[_0x5a77('0x15')]?_0x34897a['options'][_0x5a77('0x18')]||null:null})[_0x5a77('0x8')](function(_0x3df27d){logger['info']('UpdateOpenchannelApplication',_0x34897a);logger['debug'](_0x5a77('0x12'),_0x34897a,JSON[_0x5a77('0xb')](_0x3df27d));_0x50716d(_0x3df27d);})[_0x5a77('0x19')](function(_0x4d7c1e){logger[_0x5a77('0xc')](_0x5a77('0x12'),_0x4d7c1e['message'],_0x34897a);_0xf97dc9(_0x14f0d4[_0x5a77('0xc')](0x1f4,_0x4d7c1e[_0x5a77('0xf')]));});});}; \ No newline at end of file +var _0xac5d=['raw','options','where','attributes','limit','UpdateOpenchannelApplication','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','OpenchannelApplication','update'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xac5d,0xa7));var _0xdac5=function(_0x37c97d,_0x3205f0){_0x37c97d=_0x37c97d-0x0;var _0x3add5c=_0xac5d[_0x37c97d];return _0x3add5c;};'use strict';var _=require(_0xdac5('0x0'));var util=require('util');var moment=require(_0xdac5('0x1'));var BPromise=require(_0xdac5('0x2'));var rs=require(_0xdac5('0x3'));var fs=require('fs');var Redis=require(_0xdac5('0x4'));var db=require(_0xdac5('0x5'))['db'];var utils=require(_0xdac5('0x6'));var logger=require(_0xdac5('0x7'))(_0xdac5('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac5('0x9'));var client=jayson[_0xdac5('0xa')][_0xdac5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x125834,_0x2c8221,_0x359cea){return new BPromise(function(_0x3b68dc,_0xcb9421){return client[_0xdac5('0xc')](_0x125834,_0x359cea)[_0xdac5('0xd')](function(_0x5c2ef2){logger['info'](_0xdac5('0xe'),_0x2c8221,_0xdac5('0xf'));logger[_0xdac5('0x10')](_0xdac5('0x11'),_0x2c8221,_0xdac5('0xf'),JSON['stringify'](_0x5c2ef2));if(_0x5c2ef2[_0xdac5('0x12')]){if(_0x5c2ef2[_0xdac5('0x12')]['code']===0x1f4){logger['error'](_0xdac5('0xe'),_0x2c8221,_0x5c2ef2[_0xdac5('0x12')]['message']);return _0xcb9421(_0x5c2ef2['error'][_0xdac5('0x13')]);}logger[_0xdac5('0x12')](_0xdac5('0xe'),_0x2c8221,_0x5c2ef2['error'][_0xdac5('0x13')]);return _0x3b68dc(_0x5c2ef2[_0xdac5('0x12')][_0xdac5('0x13')]);}else{logger[_0xdac5('0x14')](_0xdac5('0xe'),_0x2c8221,'request\x20sent');_0x3b68dc(_0x5c2ef2[_0xdac5('0x15')]['message']);}})[_0xdac5('0x16')](function(_0xb4ceee){logger[_0xdac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x2c8221,_0xb4ceee);_0xcb9421(_0xb4ceee);});});}exports['UpdateOpenchannelApplication']=function(_0x2a1c0a){var _0x172176=this;return new Promise(function(_0x283a15,_0x52d3ba){return db[_0xdac5('0x17')][_0xdac5('0x18')](_0x2a1c0a['body'],{'raw':_0x2a1c0a['options']?_0x2a1c0a['options'][_0xdac5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1c0a['options']?_0x2a1c0a[_0xdac5('0x1a')][_0xdac5('0x1b')]||null:null,'attributes':_0x2a1c0a[_0xdac5('0x1a')]?_0x2a1c0a[_0xdac5('0x1a')][_0xdac5('0x1c')]||null:null,'limit':_0x2a1c0a['options']?_0x2a1c0a[_0xdac5('0x1a')][_0xdac5('0x1d')]||null:null})[_0xdac5('0xd')](function(_0x36da59){logger[_0xdac5('0x14')](_0xdac5('0x1e'),_0x2a1c0a);logger[_0xdac5('0x10')](_0xdac5('0x1e'),_0x2a1c0a,JSON[_0xdac5('0x1f')](_0x36da59));_0x283a15(_0x36da59);})['catch'](function(_0x552013){logger[_0xdac5('0x12')]('UpdateOpenchannelApplication',_0x552013[_0xdac5('0x13')],_0x2a1c0a);_0x52d3ba(_0x172176[_0xdac5('0x12')](0x1f4,_0x552013[_0xdac5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c908091..6f93d01 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 _0x761e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','update','delete','openchannelinteraction:destroy','exports'];(function(_0x3feda6,_0xf98dd8){var _0x43afda=function(_0x34afc3){while(--_0x34afc3){_0x3feda6['push'](_0x3feda6['shift']());}};_0x43afda(++_0xf98dd8);}(_0x761e,0x168));var _0xe761=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x761e[_0x26bcec];return _0x1049dc;};'use strict';var multer=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var path=require(_0xe761('0x2'));var timeout=require('connect-timeout');var express=require(_0xe761('0x3'));var router=express[_0xe761('0x4')]();var fs_extra=require(_0xe761('0x5'));var auth=require(_0xe761('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe761('0x7'));var controller=require(_0xe761('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe761('0x9')]);router[_0xe761('0xa')](_0xe761('0xb'),auth['isAuthenticated'](),controller[_0xe761('0xc')]);router['get'](_0xe761('0xd'),auth[_0xe761('0xe')](),controller[_0xe761('0xf')]);router['get'](_0xe761('0x10'),auth[_0xe761('0xe')](),controller[_0xe761('0x11')]);router[_0xe761('0xa')]('/:id/download',auth[_0xe761('0xe')](),controller[_0xe761('0x12')]);router[_0xe761('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xe761('0x14')]);router[_0xe761('0x13')](_0xe761('0x15'),auth[_0xe761('0xe')](),interaction[_0xe761('0x16')](_0xe761('0x17'),_0xe761('0x18')),controller['addTags']);router[_0xe761('0x19')]('/:id',auth[_0xe761('0xe')](),interaction['tracked']('openchannel','openchannelinteraction:update'),controller[_0xe761('0x1a')]);router[_0xe761('0x1b')](_0xe761('0xd'),auth[_0xe761('0xe')](),interaction[_0xe761('0x16')](_0xe761('0x17'),_0xe761('0x1c')),controller['destroy']);router['delete'](_0xe761('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xe761('0x1d')]=router; \ No newline at end of file +var _0xf172=['./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','create','post','addMessage','tracked','openchannel','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xf172,0x197));var _0x2f17=function(_0x2da801,_0x4da1e9){_0x2da801=_0x2da801-0x0;var _0x11204e=_0xf172[_0x2da801];return _0x11204e;};'use strict';var multer=require(_0x2f17('0x0'));var util=require(_0x2f17('0x1'));var path=require(_0x2f17('0x2'));var timeout=require(_0x2f17('0x3'));var express=require(_0x2f17('0x4'));var router=express[_0x2f17('0x5')]();var fs_extra=require(_0x2f17('0x6'));var auth=require(_0x2f17('0x7'));var interaction=require(_0x2f17('0x8'));var config=require('../../config/environment');var controller=require(_0x2f17('0x9'));router[_0x2f17('0xa')]('/',auth[_0x2f17('0xb')](),controller[_0x2f17('0xc')]);router['get'](_0x2f17('0xd'),auth[_0x2f17('0xb')](),controller[_0x2f17('0xe')]);router[_0x2f17('0xa')](_0x2f17('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2f17('0xa')]('/:id/messages',auth[_0x2f17('0xb')](),controller[_0x2f17('0x10')]);router['get'](_0x2f17('0x11'),auth[_0x2f17('0xb')](),controller[_0x2f17('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f17('0x13')]);router[_0x2f17('0x14')]('/:id/messages',auth[_0x2f17('0xb')](),controller[_0x2f17('0x15')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x2f17('0x16')](_0x2f17('0x17'),'openchannelinteraction:addtags'),controller[_0x2f17('0x18')]);router['put'](_0x2f17('0xf'),auth[_0x2f17('0xb')](),interaction[_0x2f17('0x16')](_0x2f17('0x17'),_0x2f17('0x19')),controller[_0x2f17('0x1a')]);router[_0x2f17('0x1b')](_0x2f17('0xf'),auth[_0x2f17('0xb')](),interaction['tracked'](_0x2f17('0x17'),_0x2f17('0x1c')),controller[_0x2f17('0x1d')]);router[_0x2f17('0x1b')](_0x2f17('0x1e'),auth[_0x2f17('0xb')](),controller['removeTags']);module[_0x2f17('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 19de98a..b53bdc0 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 _0xf3cc=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x5c3578,_0x5e3db4){var _0x5deaa6=function(_0x1b9412){while(--_0x1b9412){_0x5c3578['push'](_0x5c3578['shift']());}};_0x5deaa6(++_0x5e3db4);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x37b729,_0x8f10af){_0x37b729=_0x37b729-0x0;var _0x40cd25=_0xf3cc[_0x37b729];return _0x40cd25;};'use strict';var Sequelize=require(_0xcf3c('0x0'));module[_0xcf3c('0x1')]={'closed':{'type':Sequelize[_0xcf3c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcf3c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcf3c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcf3c('0x4')]},'note':{'type':Sequelize[_0xcf3c('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xcf3c('0x4')]},'externalUrl':{'type':Sequelize[_0xcf3c('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcf3c('0x5')]('in',_0xcf3c('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xcf3c('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xcf3c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7070=['STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x43d161,_0x2adf3e){var _0x1a4158=function(_0x1d65e4){while(--_0x1d65e4){_0x43d161['push'](_0x43d161['shift']());}};_0x1a4158(++_0x2adf3e);}(_0x7070,0xa4));var _0x0707=function(_0x3a0d5c,_0x1e3d26){_0x3a0d5c=_0x3a0d5c-0x0;var _0x5f1e66=_0x7070[_0x3a0d5c];return _0x5f1e66;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x0707('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0707('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0707('0x1')]},'note':{'type':Sequelize[_0x0707('0x1')]},'read1stAt':{'type':Sequelize[_0x0707('0x2')]},'threadId':{'type':Sequelize[_0x0707('0x1')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0707('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0707('0x3')]('in',_0x0707('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0707('0x1')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 100b02d..9d0f11b 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 _0xaa0a=['hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','having','`\x20=\x200','Contact','operator','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','OpenchannelInteraction','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','params','include','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','$gte','format','options','includeAll','addTags','setTags','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','root','transcript-%d-%s.zip','CmContact','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','threadId','basename','existsSync','createReadStream','pipe','System','firstName','out','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','Users','fullname','Tags','TagIds','push','catch','answered','unmanaged','total','closed','UserId','talking','waiting','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x30cea2,_0xd9a4a9){var _0x299227=function(_0x4da389){while(--_0x4da389){_0x30cea2['push'](_0x30cea2['shift']());}};_0x299227(++_0xd9a4a9);}(_0xaa0a,0x1a1));var _0xaaa0=function(_0x14c4fa,_0x2581d1){_0x14c4fa=_0x14c4fa-0x0;var _0x2cbbf6=_0xaa0a[_0x14c4fa];return _0x2cbbf6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaaa0('0x0'));var jsonpatch=require(_0xaaa0('0x1'));var rp=require('request-promise');var moment=require(_0xaaa0('0x2'));var BPromise=require(_0xaaa0('0x3'));var Mustache=require(_0xaaa0('0x4'));var util=require(_0xaaa0('0x5'));var path=require('path');var sox=require(_0xaaa0('0x6'));var csv=require(_0xaaa0('0x7'));var ejs=require(_0xaaa0('0x8'));var fs=require('fs');var fs_extra=require(_0xaaa0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaaa0('0xa'));var deskjs=require(_0xaaa0('0xb'));var toCsv=require(_0xaaa0('0x7'));var querystring=require(_0xaaa0('0xc'));var Papa=require(_0xaaa0('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaaa0('0xe'));var as=require(_0xaaa0('0xf'));var pdf=require(_0xaaa0('0x10'));var hardwareService=require(_0xaaa0('0x11'));var logger=require('../../config/logger')(_0xaaa0('0x12'));var utils=require(_0xaaa0('0x13'));var config=require(_0xaaa0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaaa0('0x15'))['db'];config[_0xaaa0('0x16')]=_[_0xaaa0('0x17')](config['redis'],{'host':_0xaaa0('0x18'),'port':0x18eb});var socket=require(_0xaaa0('0x19'))(new Redis(config[_0xaaa0('0x16')]));require(_0xaaa0('0x1a'))['register'](socket);function respondWithStatusCode(_0x15f3e1,_0x312ccc){_0x312ccc=_0x312ccc||0xcc;return function(_0x286b77){if(_0x286b77){return _0x15f3e1['sendStatus'](_0x312ccc);}return _0x15f3e1[_0xaaa0('0x1b')](_0x312ccc)[_0xaaa0('0x1c')]();};}function respondWithResult(_0x139cc3,_0x31f62c){_0x31f62c=_0x31f62c||0xc8;return function(_0x2a9d38){if(_0x2a9d38){return _0x139cc3[_0xaaa0('0x1b')](_0x31f62c)[_0xaaa0('0x1d')](_0x2a9d38);}};}function respondWithFilteredResult(_0x4e7696,_0x1dc1b8){return function(_0x186dbf){if(_0x186dbf){var _0x1664d4=typeof _0x1dc1b8['offset']===_0xaaa0('0x1e')&&typeof _0x1dc1b8[_0xaaa0('0x1f')]===_0xaaa0('0x1e');var _0xd133be=_0x186dbf['count'];var _0x41c237=_0x1664d4?0x0:_0x1dc1b8[_0xaaa0('0x20')];var _0x5e4277=_0x1664d4?_0x186dbf[_0xaaa0('0x21')]:_0x1dc1b8['offset']+_0x1dc1b8[_0xaaa0('0x1f')];var _0xdea3db;if(_0x5e4277>=_0xd133be){_0x5e4277=_0xd133be;_0xdea3db=0xc8;}else{_0xdea3db=0xce;}_0x4e7696[_0xaaa0('0x1b')](_0xdea3db);return _0x4e7696[_0xaaa0('0x22')](_0xaaa0('0x23'),_0x41c237+'-'+_0x5e4277+'/'+_0xd133be)[_0xaaa0('0x1d')](_0x186dbf);}return null;};}function patchUpdates(_0x5e3bc7){return function(_0x2640f1){try{jsonpatch[_0xaaa0('0x24')](_0x2640f1,_0x5e3bc7,!![]);}catch(_0x1e1638){return BPromise[_0xaaa0('0x25')](_0x1e1638);}return _0x2640f1[_0xaaa0('0x26')]();};}function saveUpdates(_0x4fa900,_0x5c8006){return function(_0x218ec0){if(_0x218ec0){return _0x218ec0[_0xaaa0('0x27')](_0x4fa900)[_0xaaa0('0x28')](function(_0x431adc){return _0x431adc;});}return null;};}function removeEntity(_0x20d904,_0x22b130){return function(_0x4429e1){if(_0x4429e1){return _0x4429e1['destroy']()[_0xaaa0('0x28')](function(){_0x20d904[_0xaaa0('0x1b')](0xcc)[_0xaaa0('0x1c')]();});}};}function handleEntityNotFound(_0x31220b,_0x4e23da){return function(_0x3c9ca3){if(!_0x3c9ca3){_0x31220b[_0xaaa0('0x29')](0x194);}return _0x3c9ca3;};}function handleError(_0x3e9b93,_0x54543d){_0x54543d=_0x54543d||0x1f4;return function(_0x577829){logger['error'](_0x577829['stack']);if(_0x577829['name']){delete _0x577829[_0xaaa0('0x2a')];}_0x3e9b93[_0xaaa0('0x1b')](_0x54543d)[_0xaaa0('0x2b')](_0x577829);};}function getInteractionUsers(_0x5eff7f,_0x208e46){return new BPromise(function(_0x2eb5c7,_0x23cf88){try{if(_0x208e46[_0x5eff7f['id']]){_0x5eff7f[_0xaaa0('0x2c')]=_['map'](_0x208e46[_0x5eff7f['id']],function(_0x5eb3bc){return{'id':_0x5eb3bc['id'],'fullname':_0x5eb3bc[_0xaaa0('0x2d')]};});}}catch(_0x34a1a8){_0x23cf88(_0x34a1a8);}_0x2eb5c7(_0x5eff7f);});}function getInteractionTags(_0x334caf,_0x32ebe4){return new BPromise(function(_0x27c11c,_0x112d84){try{if(_0x334caf['TagIds']){_0x334caf[_0xaaa0('0x2e')]=[];_0x334caf[_0xaaa0('0x2f')]['split'](',')['forEach'](function(_0xe927ad){_0x334caf[_0xaaa0('0x2e')][_0xaaa0('0x30')](_0x32ebe4[_0xe927ad]);});}delete _0x334caf[_0xaaa0('0x2f')];}catch(_0x45535d){_0x112d84(_0x45535d);}_0x27c11c(_0x334caf);});}function updateOpenchannelInteraction(_0x3e4ef6,_0x1ace43,_0x4e18cb){return new BPromise(function(_0x48d695,_0x39b86f){return getInteractionUsers(_0x3e4ef6,_0x4e18cb)[_0xaaa0('0x28')](function(_0x8954d9){return getInteractionTags(_0x8954d9,_0x1ace43);})[_0xaaa0('0x28')](function(_0x732e0d){return getStateInteraction(_0x732e0d);})[_0xaaa0('0x28')](function(_0x76e579){_0x48d695(_0x76e579);})[_0xaaa0('0x31')](function(_0x414cf3){_0x39b86f(_0x414cf3);});});}function getStateInteraction(_0xf61c4d){return new BPromise(function(_0xce1877){_0xf61c4d['waiting']=0x0;_0xf61c4d['talking']=0x0;_0xf61c4d[_0xaaa0('0x32')]=0x0;_0xf61c4d[_0xaaa0('0x33')]=0x0;_0xf61c4d[_0xaaa0('0x34')]=0x0;if(!_0xf61c4d[_0xaaa0('0x35')]&&!_0xf61c4d[_0xaaa0('0x36')]){_0xf61c4d['waiting']+=0x1;}if(!_0xf61c4d['closed']&&_0xf61c4d['UserId']){_0xf61c4d[_0xaaa0('0x37')]+=0x1;if(_0xf61c4d[_0xaaa0('0x38')]){_0xf61c4d[_0xaaa0('0x38')]-=0x1;}}if(_0xf61c4d[_0xaaa0('0x35')]&&_0xf61c4d[_0xaaa0('0x36')]){_0xf61c4d['answered']+=0x1;if(_0xf61c4d['talking']){_0xf61c4d[_0xaaa0('0x37')]-=0x1;}}if(_0xf61c4d['closed']&&!_0xf61c4d[_0xaaa0('0x36')]){_0xf61c4d[_0xaaa0('0x33')]+=0x1;if(_0xf61c4d[_0xaaa0('0x38')]){_0xf61c4d[_0xaaa0('0x38')]-=0x1;}}_0xf61c4d[_0xaaa0('0x34')]+=0x1;_0xce1877(_0xf61c4d);});}exports[_0xaaa0('0x39')]=function(_0x53f064,_0x1bd971){var _0x1f5dc9={},_0x1bf3ad={},_0x6efd77={'count':0x0,'rows':[]};var _0x24158e=_[_0xaaa0('0x3a')](db['OpenchannelInteraction'][_0xaaa0('0x3b')],function(_0x3100e5){return{'name':_0x3100e5['fieldName'],'type':_0x3100e5['type'][_0xaaa0('0x3c')]};});_0x1bf3ad[_0xaaa0('0x3d')]=_[_0xaaa0('0x3a')](_0x24158e,'name');_0x1bf3ad[_0xaaa0('0x3e')]=_[_0xaaa0('0x3f')](_0x53f064['query']);_0x1bf3ad[_0xaaa0('0x40')]=_[_0xaaa0('0x41')](_0x1bf3ad[_0xaaa0('0x3d')],_0x1bf3ad[_0xaaa0('0x3e')]);_0x1f5dc9[_0xaaa0('0x42')]=_[_0xaaa0('0x41')](_0x1bf3ad['model'],qs['fields'](_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x43')]));_0x1f5dc9['attributes']=_0x1f5dc9['attributes'][_0xaaa0('0x44')]?_0x1f5dc9[_0xaaa0('0x42')]:_0x1bf3ad[_0xaaa0('0x3d')];if(!_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x45')](_0xaaa0('0x46'))){_0x1f5dc9['limit']=qs[_0xaaa0('0x1f')](_0x53f064[_0xaaa0('0x3e')]['limit']);_0x1f5dc9[_0xaaa0('0x20')]=qs['offset'](_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x20')]);}_0x1f5dc9[_0xaaa0('0x47')]=qs[_0xaaa0('0x48')](_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x48')]);_0x1f5dc9[_0xaaa0('0x49')]=qs[_0xaaa0('0x40')](_[_0xaaa0('0x4a')](_0x53f064['query'],_0x1bf3ad[_0xaaa0('0x40')]),_0x24158e);var _0x4eea04=[];var _0x4b02d4=squel[_0xaaa0('0x4b')]()[_0xaaa0('0x4c')]('id')[_0xaaa0('0x4c')](_0xaaa0('0x2a'))['field'](_0xaaa0('0x4d'))[_0xaaa0('0x4e')]('tools_tags');var _0x2f8a81=squel[_0xaaa0('0x4b')]()[_0xaaa0('0x4c')](_0xaaa0('0x4f'))[_0xaaa0('0x4c')](_0xaaa0('0x50'))[_0xaaa0('0x4c')](_0xaaa0('0x51'))[_0xaaa0('0x4e')](_0xaaa0('0x52'),'ui')[_0xaaa0('0x53')]('users','u',_0xaaa0('0x54'));var _0x220405=squel[_0xaaa0('0x4b')]()[_0xaaa0('0x4e')]('openchannel_interactions','i')[_0xaaa0('0x53')](_0xaaa0('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xaaa0('0x53')](_0xaaa0('0x56'),'o',_0xaaa0('0x57'))['left_join'](_0xaaa0('0x58'),'a',_0xaaa0('0x59'))[_0xaaa0('0x53')](_0xaaa0('0x5a'),'me',_0xaaa0('0x5b'))[_0xaaa0('0x53')](_0xaaa0('0x5c'),'it',_0xaaa0('0x5d'))[_0xaaa0('0x53')](_0xaaa0('0x5e'),'t','t.id\x20=\x20it.TagId');var _0x59635c=squel[_0xaaa0('0x5f')]();var _0x43b1ab=[];var _0x103f2b=squel['expr']();var _0x48fe56;if(_0x53f064['query'][_0xaaa0('0x60')]){_0x48fe56=as['parseSearch'](_0x53f064[_0xaaa0('0x3e')]['search']);var _0x173afc=_0x48fe56[_0xaaa0('0x61')];for(var _0x5e54c1=0x0;_0x5e54c1<_0x48fe56[_0xaaa0('0x62')][_0xaaa0('0x44')];_0x5e54c1++){var _0x51fa39=_0x48fe56[_0xaaa0('0x62')][_0x5e54c1];var _0x323eed='i';var _0x502be5=_['find'](_0x24158e,[_0xaaa0('0x2a'),_0x51fa39[_0xaaa0('0x4c')]]);if(!_0x502be5){switch(_0x51fa39[_0xaaa0('0x4c')]){case'unreadMessages':if(_0x51fa39['value']==0x1){_0x220405[_0xaaa0('0x63')]('`'+_0x51fa39[_0xaaa0('0x4c')]+_0xaaa0('0x64'));}else{_0x220405['having']('`'+_0x51fa39[_0xaaa0('0x4c')]+'`\x20>\x200');}break;case _0xaaa0('0x65'):if(_0x51fa39[_0xaaa0('0x66')]==='$substring'){if(_0x51fa39[_0xaaa0('0x67')][_0xaaa0('0x68')]('\x20')[_0xaaa0('0x44')]>0x1){_0x59635c[_0x173afc](_0xaaa0('0x69'),qs[_0xaaa0('0x6a')](_0x51fa39[_0xaaa0('0x67')]),null);}else{var _0x8acee8='%'+_0x51fa39['value']+'%';_0x59635c[_0x173afc](_0xaaa0('0x6b'),_0x8acee8,_0x8acee8,_0x8acee8);}}else{_0x502be5=_[_0xaaa0('0x6c')](_0x24158e,[_0xaaa0('0x2a'),_0xaaa0('0x6d')]);_0x51fa39['field']=_0xaaa0('0x6d');_0x114ef6=as[_0xaaa0('0x6e')](_0x323eed,_0x502be5[_0xaaa0('0x6f')],_0x51fa39);_0x59635c[_0x173afc](_0x114ef6[_0xaaa0('0x70')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x71')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x1c')]);}break;case _0xaaa0('0x72'):var _0x2a2e42=_0x51fa39[_0xaaa0('0x67')]['split'](',')[_0xaaa0('0x3a')](function(_0x31f7cb){return Number(_0x31f7cb);});_0x2a2e42[_0xaaa0('0x73')](function(_0x3c7fd6){_0x103f2b['or'](_0xaaa0('0x74'),'%,'+_0x3c7fd6+',%');});_0x43b1ab=_[_0xaaa0('0x75')](_0x43b1ab,_0x2a2e42);break;case _0xaaa0('0x76'):if(_0x51fa39[_0xaaa0('0x66')]===_0xaaa0('0x77')){_0x59635c[_0x173afc](_0xaaa0('0x78'),'%'+_0x51fa39[_0xaaa0('0x67')]+'%',null);}else{_0x502be5=_[_0xaaa0('0x6c')](_0x24158e,[_0xaaa0('0x2a'),'UserId']);_0x51fa39[_0xaaa0('0x4c')]=_0xaaa0('0x36');_0x114ef6=as['buildExpression'](_0x323eed,_0x502be5[_0xaaa0('0x6f')],_0x51fa39);_0x59635c[_0x173afc](_0x114ef6['text'],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x71')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x1c')]);}break;case _0xaaa0('0x79'):_0x114ef6=as['buildExpression']('me',null,_0x51fa39);_0x59635c[_0x173afc](_0x114ef6[_0xaaa0('0x70')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x71')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x1c')]);break;}}else{var _0x114ef6=as[_0xaaa0('0x6e')](_0x323eed,_0x502be5['type'],_0x51fa39);_0x59635c[_0x173afc](_0x114ef6[_0xaaa0('0x70')],_0x114ef6[_0xaaa0('0x67')][_0xaaa0('0x71')],_0x114ef6['value'][_0xaaa0('0x1c')]);}}}else{var _0x342219=_(_0x53f064[_0xaaa0('0x3e')])[_0xaaa0('0x3f')]()[_0xaaa0('0x3a')](function(_0x13cb49){return _[_0xaaa0('0x7a')](_0x24158e,[_0xaaa0('0x2a'),_0x13cb49])?_0x13cb49:undefined;})[_0xaaa0('0x7b')]()[_0xaaa0('0x67')]();if(!_[_0xaaa0('0x7c')](_0x342219)){_0x342219['forEach'](function(_0x5b995d){if(_0x5b995d===_0xaaa0('0x7d')){_0x220405[_0xaaa0('0x49')](_0xaaa0('0x7e'),[]['concat'](_0x53f064['query'][_0x5b995d]));}else if(_0x5b995d===_0xaaa0('0x7f')){var _0xec828e=JSON[_0xaaa0('0x80')](_0x53f064[_0xaaa0('0x3e')][_0x5b995d])['$gte'];var _0x1e7933=JSON[_0xaaa0('0x80')](_0x53f064[_0xaaa0('0x3e')][_0x5b995d])['$lte'];_0x220405['where'](_0xaaa0('0x81'),_0xec828e,_0x1e7933);}else{if(_0x53f064[_0xaaa0('0x3e')][_0x5b995d]==='null'){_0x220405[_0xaaa0('0x49')]('i.'+_0x5b995d+_0xaaa0('0x82'));}else{_0x220405['where']('i.'+_0x5b995d+_0xaaa0('0x83'),_0x53f064['query'][_0x5b995d]);}}});}if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x84')]){if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x84')]==0x1){_0x220405['having'](_0xaaa0('0x85'));}else{_0x220405['having'](_0xaaa0('0x86'));}}if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x87')]){_0x43b1ab=_[_0xaaa0('0x88')](_0x53f064['query'][_0xaaa0('0x87')])?_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x87')]:new Array(_0x53f064['query']['tag']);_0x43b1ab['forEach'](function(_0x610ddf){_0x103f2b['or'](_0xaaa0('0x74'),'%,'+_0x610ddf+',%');});}if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x89')]){var _0x524970=_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x89')][_0xaaa0('0x8a')]('\x5c','\x5c\x5c')[_0xaaa0('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x524970)){_0x59635c['or'](_0xaaa0('0x8b'),_0x524970+'%');}else{_0x59635c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x524970))['or'](_0xaaa0('0x8c'),_0x524970+'%')['or'](_0xaaa0('0x8d'),_0x524970+'%');}}}_0x220405[_0xaaa0('0x49')](_0x59635c);_0x220405[_0xaaa0('0x8e')](_0xaaa0('0x8f'));var _0x135a32={'type':db['Sequelize'][_0xaaa0('0x90')][_0xaaa0('0x91')],'raw':!![]};var _0x1c63d6=_0x220405['clone']();_0x1c63d6[_0xaaa0('0x4c')](_0xaaa0('0x8f'));_0x1c63d6[_0xaaa0('0x4c')](_0xaaa0('0x92'),_0xaaa0('0x93'));if(_0x1f5dc9[_0xaaa0('0x47')]){_0x1f5dc9[_0xaaa0('0x47')][_0xaaa0('0x73')](function(_0x969e00){var _0x24d444=_0x969e00[0x0]===_0xaaa0('0x94')?_0x969e00[0x0]:'i.'+_0x969e00[0x0];_0x220405[_0xaaa0('0x47')](_0x24d444,_0x969e00[0x1]===_0xaaa0('0x95')?![]:!![]);});}if(!_[_0xaaa0('0x7c')](_0x43b1ab)){_0x220405[_0xaaa0('0x63')](_0x103f2b);_0x1c63d6[_0xaaa0('0x49')]('t.id\x20IN\x20?',_0x43b1ab);}BPromise[_0xaaa0('0x96')]()[_0xaaa0('0x28')](function(){if(!_0x48fe56){if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x7d')])return;_0x1c63d6[_0xaaa0('0x49')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x220405[_0xaaa0('0x49')](_0xaaa0('0x97'));return;}if(_0x53f064[_0xaaa0('0x98')]['role']!=='agent')return;return _0x53f064[_0xaaa0('0x98')][_0xaaa0('0x99')]({'attributes':['id'],'raw':!![]})[_0xaaa0('0x28')](function(_0x5aa057){if(_[_0xaaa0('0x7c')](_0x5aa057)){_0x1c63d6[_0xaaa0('0x49')](_0xaaa0('0x9a'));_0x220405['where'](_0xaaa0('0x9a'));}else{_0x1c63d6[_0xaaa0('0x49')](_0xaaa0('0x7e'),_[_0xaaa0('0x3a')](_0x5aa057,'id'));_0x220405[_0xaaa0('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xaaa0('0x3a')](_0x5aa057,'id'));}});})[_0xaaa0('0x28')](function(){if(_0x53f064[_0xaaa0('0x98')][_0xaaa0('0x9b')]===_0xaaa0('0x9c')&&!_0x48fe56&&!_0x53f064['query']['OpenchannelAccountId'])return[];return db[_0xaaa0('0x9d')][_0xaaa0('0x3e')](_0x1c63d6[_0xaaa0('0x9e')](),_0x135a32);})[_0xaaa0('0x28')](function(_0x46a1fb){_0x6efd77[_0xaaa0('0x21')]=_0x46a1fb[_0xaaa0('0x44')];if(_0x6efd77[_0xaaa0('0x21')]===0x0)return[];return db['sequelize'][_0xaaa0('0x3e')](_0x4b02d4[_0xaaa0('0x9e')](),_0x135a32)['then'](function(_0x4c1718){_0x4eea04=_[_0xaaa0('0x9f')](_0x4c1718,'id');_0x135a32=_[_0xaaa0('0xa0')](_0x135a32,{'model':db[_0xaaa0('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53f064[_0xaaa0('0x3e')][_0xaaa0('0x43')]){_0x1f5dc9['attributes'][_0xaaa0('0x73')](function(_0x59fd75){_0x220405[_0xaaa0('0x4c')]('i.'+_0x59fd75);});}else{_0x220405[_0xaaa0('0x4c')](_0xaaa0('0x92'),_0xaaa0('0x93'));_0x220405[_0xaaa0('0x4c')]('a.key',_0xaaa0('0xa2'));_0x220405['field']('a.mandatoryDisposition',_0xaaa0('0xa3'));_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xa4'),'contactName');_0x220405[_0xaaa0('0x4c')]('i.*');_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xa5'),_0xaaa0('0xa6'));_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xa7'),_0xaaa0('0xa8'));_0x220405[_0xaaa0('0x4c')]('c.email',_0xaaa0('0xa9'));_0x220405['field'](_0xaaa0('0xaa'),'Contact.phone');_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xab'),_0xaaa0('0xac'));_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xad'),_0xaaa0('0xae'));_0x220405['field']('o.fullname','Owner.fullname');_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xaf'),_0xaaa0('0xb0'));_0x220405[_0xaaa0('0x4c')](_0xaaa0('0xb1'),_0xaaa0('0x2f'));}if(_0x1f5dc9[_0xaaa0('0x1f')])_0x220405[_0xaaa0('0x1f')](_0x1f5dc9[_0xaaa0('0x1f')]);if(_0x1f5dc9[_0xaaa0('0x20')])_0x220405[_0xaaa0('0x20')](_0x1f5dc9[_0xaaa0('0x20')]);return db[_0xaaa0('0x9d')][_0xaaa0('0x3e')](_0x220405[_0xaaa0('0x9e')](),_0x135a32);})[_0xaaa0('0x28')](function(_0x50851e){if(_0x50851e[_0xaaa0('0x44')]>0x0)_0x2f8a81[_0xaaa0('0x49')](_0xaaa0('0xb2'),_[_0xaaa0('0x3a')](_0x50851e,'id'));return db[_0xaaa0('0x9d')][_0xaaa0('0x3e')](_0x2f8a81[_0xaaa0('0x9e')](),_0x135a32)[_0xaaa0('0x28')](function(_0x5367e4){var _0x3874cb=_[_0xaaa0('0xb3')](_0x5367e4,_0xaaa0('0xb4'));var _0x8a8205=[];_0x50851e[_0xaaa0('0x73')](function(_0x8c53a3){_0x8a8205[_0xaaa0('0x30')](updateOpenchannelInteraction(_0x8c53a3,_0x4eea04,_0x3874cb));});return BPromise['all'](_0x8a8205);});});})[_0xaaa0('0x28')](function(_0xbbd36){_0x6efd77[_0xaaa0('0xb5')]=_0xbbd36;return _0x6efd77;})[_0xaaa0('0x28')](respondWithFilteredResult(_0x1bd971,_0x1f5dc9))['catch'](handleError(_0x1bd971,null));};exports['show']=function(_0x550c50,_0x546848){var _0x308ec6={};if(_0x550c50[_0xaaa0('0x3e')]['type']&&_0x550c50[_0xaaa0('0x3e')][_0xaaa0('0x6f')]==='from'){_0x308ec6['from']=_0x550c50[_0xaaa0('0xb6')]['id'];}else{_0x308ec6['id']=_0x550c50[_0xaaa0('0xb6')]['id'];}var _0x7bb1f5={'raw':![],'where':_0x308ec6},_0x4d1a51={};_0x4d1a51[_0xaaa0('0x3d')]=_[_0xaaa0('0x3f')](db[_0xaaa0('0xa1')][_0xaaa0('0x3b')]);_0x4d1a51[_0xaaa0('0x3e')]=_['keys'](_0x550c50[_0xaaa0('0x3e')]);_0x4d1a51[_0xaaa0('0x40')]=_[_0xaaa0('0x41')](_0x4d1a51[_0xaaa0('0x3d')],_0x4d1a51[_0xaaa0('0x3e')]);_0x7bb1f5['attributes']=_[_0xaaa0('0x41')](_0x4d1a51[_0xaaa0('0x3d')],qs[_0xaaa0('0x43')](_0x550c50[_0xaaa0('0x3e')][_0xaaa0('0x43')]));_0x7bb1f5['attributes']=_0x7bb1f5[_0xaaa0('0x42')][_0xaaa0('0x44')]?_0x7bb1f5[_0xaaa0('0x42')]:_0x4d1a51[_0xaaa0('0x3d')];if(_0x550c50[_0xaaa0('0x3e')]['includeAll']){_0x7bb1f5[_0xaaa0('0xb7')]=[{'all':!![]}];}_0x7bb1f5=_[_0xaaa0('0xa0')]({},_0x7bb1f5,_0x550c50['options']);return db[_0xaaa0('0xa1')][_0xaaa0('0x6c')](_0x7bb1f5)[_0xaaa0('0x28')](handleEntityNotFound(_0x546848,null))[_0xaaa0('0x28')](respondWithResult(_0x546848,null))[_0xaaa0('0x31')](handleError(_0x546848,null));};exports[_0xaaa0('0xb8')]=function(_0x4e741f,_0x5dd776){return db[_0xaaa0('0xa1')][_0xaaa0('0xb8')](_0x4e741f[_0xaaa0('0x79')],{})[_0xaaa0('0x28')](respondWithResult(_0x5dd776,0xc9))[_0xaaa0('0x31')](handleError(_0x5dd776,null));};exports[_0xaaa0('0x27')]=function(_0x5846ab,_0x4fb7fa){if(_0x5846ab[_0xaaa0('0x79')]['id']){delete _0x5846ab['body']['id'];}return db[_0xaaa0('0xa1')]['find']({'where':{'id':_0x5846ab['params']['id']}})['then'](handleEntityNotFound(_0x4fb7fa,null))[_0xaaa0('0x28')](saveUpdates(_0x5846ab[_0xaaa0('0x79')],null))[_0xaaa0('0x28')](respondWithResult(_0x4fb7fa,null))[_0xaaa0('0x31')](handleError(_0x4fb7fa,null));};exports[_0xaaa0('0xb9')]=function(_0x4ede6e,_0x498b84){return db[_0xaaa0('0xa1')][_0xaaa0('0x6c')]({'where':{'id':_0x4ede6e[_0xaaa0('0xb6')]['id']}})[_0xaaa0('0x28')](handleEntityNotFound(_0x498b84,null))['then'](removeEntity(_0x498b84,null))[_0xaaa0('0x31')](handleError(_0x498b84,null));};exports[_0xaaa0('0xba')]=function(_0x594a5a,_0x24574a){return db[_0xaaa0('0xa1')][_0xaaa0('0xba')]()[_0xaaa0('0x28')](respondWithResult(_0x24574a,null))['catch'](handleError(_0x24574a,null));};exports[_0xaaa0('0xbb')]=function(_0x164cbc,_0x5f50bf,_0xda9dc3){return db[_0xaaa0('0xbc')][_0xaaa0('0x6c')]({'where':{'id':_0x164cbc[_0xaaa0('0xb6')]['id']}})[_0xaaa0('0x28')](handleEntityNotFound(_0x5f50bf,null))[_0xaaa0('0x28')](function(_0x432c0d){if(_0x432c0d){return _0x432c0d['addMessage'](_0x164cbc[_0xaaa0('0x79')][_0xaaa0('0xbd')],_[_0xaaa0('0xbe')](_0x164cbc[_0xaaa0('0x79')],[_0xaaa0('0xbd'),'id'])||{});}})[_0xaaa0('0x28')](respondWithResult(_0x5f50bf,null))[_0xaaa0('0x31')](handleError(_0x5f50bf,null));};exports[_0xaaa0('0xbf')]=function(_0x119da6,_0x757b35,_0x2ba819){var _0x2c9949={'raw':![],'where':{}};var _0x1f0760={};var _0x52e88d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xaaa0('0xc0')]({'where':{'id':_0x119da6[_0xaaa0('0xb6')]['id']}})['then'](handleEntityNotFound(_0x757b35,null))[_0xaaa0('0x28')](function(_0x28dfb9){if(_0x28dfb9){_0x1f0760['model']=_[_0xaaa0('0x3f')](db['OpenchannelMessage'][_0xaaa0('0x3b')]);_0x1f0760[_0xaaa0('0x3e')]=_[_0xaaa0('0x3f')](_0x119da6['query']);_0x1f0760[_0xaaa0('0x40')]=_[_0xaaa0('0x41')](_0x1f0760[_0xaaa0('0x3d')],_0x1f0760[_0xaaa0('0x3e')]);_0x2c9949['attributes']=_[_0xaaa0('0x41')](_0x1f0760['model'],qs[_0xaaa0('0x43')](_0x119da6['query'][_0xaaa0('0x43')]));_0x2c9949['attributes']=_0x2c9949[_0xaaa0('0x42')][_0xaaa0('0x44')]?_0x2c9949[_0xaaa0('0x42')]:_0x1f0760[_0xaaa0('0x3d')];if(!_0x119da6[_0xaaa0('0x3e')][_0xaaa0('0x45')](_0xaaa0('0x46'))){_0x2c9949[_0xaaa0('0x1f')]=qs[_0xaaa0('0x1f')](_0x119da6['query']['limit']);_0x2c9949[_0xaaa0('0x20')]=qs[_0xaaa0('0x20')](_0x119da6[_0xaaa0('0x3e')][_0xaaa0('0x20')]);}_0x2c9949[_0xaaa0('0x47')]=qs[_0xaaa0('0x48')](_0x119da6[_0xaaa0('0x3e')][_0xaaa0('0x48')]);_0x2c9949[_0xaaa0('0x49')]=qs[_0xaaa0('0x40')](_['pick'](_0x119da6[_0xaaa0('0x3e')],_0x1f0760[_0xaaa0('0x40')]));_0x2c9949[_0xaaa0('0x49')][_0xaaa0('0xb4')]=_0x28dfb9['id'];if(_0x119da6[_0xaaa0('0x3e')]['filter']){_0x2c9949['where']=_[_0xaaa0('0xa0')](_0x2c9949[_0xaaa0('0x49')],{'$or':_[_0xaaa0('0x3a')](_0x2c9949[_0xaaa0('0x42')],function(_0x26320a){var _0x56ec5c={};_0x56ec5c[_0x26320a]={'$like':'%'+_0x119da6[_0xaaa0('0x3e')][_0xaaa0('0x89')]+'%'};return _0x56ec5c;})});}if(_0x119da6[_0xaaa0('0x3e')][_0xaaa0('0xc1')]){var _0x3a7584=_0x119da6[_0xaaa0('0x3e')]['$gte'][_0xaaa0('0x68')](',');var _0x58246e={};_0x58246e[_0x3a7584[0x0]]={'$gte':moment(_0x3a7584[0x1])[_0xaaa0('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2c9949[_0xaaa0('0x49')]=_[_0xaaa0('0xa0')](_0x2c9949['where'],_0x58246e);}_0x2c9949=_['merge']({},_0x2c9949,_0x119da6[_0xaaa0('0xc3')]);return db[_0xaaa0('0xbc')][_0xaaa0('0x21')]({'where':_0x2c9949[_0xaaa0('0x49')]})[_0xaaa0('0x28')](function(_0x3d5c15){_0x52e88d[_0xaaa0('0x21')]=_0x3d5c15;if(_0x119da6['query'][_0xaaa0('0xc4')]){_0x2c9949[_0xaaa0('0xb7')]=[{'all':!![]}];}return db[_0xaaa0('0xbc')]['findAll'](_0x2c9949);})[_0xaaa0('0x28')](function(_0x500118){_0x52e88d[_0xaaa0('0xb5')]=_0x500118;return _0x52e88d;});}})['then'](respondWithFilteredResult(_0x757b35,_0x2c9949))['catch'](handleError(_0x757b35,null));};exports[_0xaaa0('0xc5')]=function(_0x11eee4,_0x2e79cf,_0x5b31ff){return db[_0xaaa0('0xa1')]['find']({'where':{'id':_0x11eee4[_0xaaa0('0xb6')]['id']}})[_0xaaa0('0x28')](handleEntityNotFound(_0x2e79cf,null))[_0xaaa0('0x28')](function(_0x4cfa72){if(_0x4cfa72){return _0x4cfa72[_0xaaa0('0xc6')](_0x11eee4['body'][_0xaaa0('0xbd')],_[_0xaaa0('0xbe')](_0x11eee4[_0xaaa0('0x79')],[_0xaaa0('0xbd'),'id'])||{})['spread'](function(){return db[_0xaaa0('0x72')][_0xaaa0('0xc7')]({'attributes':['id',_0xaaa0('0x2a'),'color'],'where':{'id':_0x11eee4[_0xaaa0('0x79')]['ids']}});})[_0xaaa0('0x28')](function(_0x33cb69){socket[_0xaaa0('0xc8')](_0xaaa0('0xc9'),{'id':Number(_0x11eee4[_0xaaa0('0xb6')]['id']),'tags':_0x33cb69||[]});return{'id':Number(_0x11eee4['params']['id']),'tags':_0x33cb69||[]};});}})[_0xaaa0('0x28')](respondWithResult(_0x2e79cf,null))['catch'](handleError(_0x2e79cf,null));};exports[_0xaaa0('0xca')]=function(_0x1265ab,_0x2f7ed6,_0x58e643){return db['OpenchannelInteraction'][_0xaaa0('0x6c')]({'where':{'id':_0x1265ab[_0xaaa0('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2f7ed6,null))['then'](function(_0x5dae52){if(_0x5dae52){return _0x5dae52[_0xaaa0('0xca')](_0x1265ab[_0xaaa0('0x3e')][_0xaaa0('0xbd')]);}})[_0xaaa0('0x28')](respondWithStatusCode(_0x2f7ed6,null))[_0xaaa0('0x31')](handleError(_0x2f7ed6,null));};exports[_0xaaa0('0xcb')]=function(_0x5da860,_0x1e39d1){var _0xb0c683=moment()[_0xaaa0('0xcc')]()['toString']();var _0x22c156=path[_0xaaa0('0xcd')](config['root'],'server',_0xaaa0('0xce'),_0xaaa0('0xcf'));var _0x2f26fd=path[_0xaaa0('0xcd')](config[_0xaaa0('0xd0')],'server','files','attachments');var _0x1d132b=path[_0xaaa0('0xcd')](_0x22c156,_0xb0c683);var _0x3dfff1=util[_0xaaa0('0xc2')](_0xaaa0('0xd1'),_0x5da860[_0xaaa0('0xb6')]['id'],_0xb0c683);var _0x47f22d=path[_0xaaa0('0xcd')](_0x22c156,_0x3dfff1);var _0x212698=[];_0x212698[_0xaaa0('0x30')]({'model':db[_0xaaa0('0x76')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x212698[_0xaaa0('0x30')]({'model':db[_0xaaa0('0xd2')],'as':_0xaaa0('0x65'),'attributes':['id','firstName',_0xaaa0('0xd3')],'raw':!![]});if(_0x5da860[_0xaaa0('0x3e')][_0xaaa0('0xd4')]){_0x212698['push']({'model':db[_0xaaa0('0xd5')],'as':_0xaaa0('0xd5'),'raw':!![]});}var _0x219035=[{'model':db[_0xaaa0('0xbc')],'as':_0xaaa0('0xd6'),'attributes':['id',_0xaaa0('0x79'),'createdAt',_0xaaa0('0xd7'),_0xaaa0('0xd8'),_0xaaa0('0x84')],'include':_0x212698}];_0x219035['push']({'model':db[_0xaaa0('0xd9')],'as':_0xaaa0('0xda'),'attributes':['id',_0xaaa0('0x2a')]});_0x219035['push']({'model':db[_0xaaa0('0x76')],'as':_0xaaa0('0xdb'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xaaa0('0x6c')]({'where':{'id':_0x5da860[_0xaaa0('0xb6')]['id']},'include':_0x219035})[_0xaaa0('0x28')](handleEntityNotFound(_0x1e39d1,null))[_0xaaa0('0x28')](function(_0x509862){if(_0x509862){var _0x3ed474=_0x509862[_0xaaa0('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x1d132b);var _0x1ee240={'channel':_0xaaa0('0xdd'),'account':_0x3ed474[_0xaaa0('0xda')]['name'],'agent':_0x3ed474[_0xaaa0('0xdb')]?_0x3ed474['Owner'][_0xaaa0('0x2d')]:_0xaaa0('0xde'),'createdAt':moment(_0x3ed474['createdAt'])[_0xaaa0('0xc2')](_0xaaa0('0xdf'))[_0xaaa0('0x9e')](),'closedAt':_0x3ed474[_0xaaa0('0x35')]?moment(_0x3ed474[_0xaaa0('0xe0')])[_0xaaa0('0xc2')](_0xaaa0('0xdf'))['toString']():'','disposition':_0x3ed474['disposition'],'visibility':_0x3ed474[_0xaaa0('0xe1')]?'Public':'Private','messages':_(_0x3ed474['Messages'])[_0xaaa0('0x89')]({'secret':![]})[_0xaaa0('0x3a')](function(_0x2c3a7e){if(_0x2c3a7e[_0xaaa0('0xd5')]){var _0x220ee4=path[_0xaaa0('0xcd')](_0x2f26fd,_0x2c3a7e[_0xaaa0('0xd5')][_0xaaa0('0xe2')]);if(fs[_0xaaa0('0xe3')](_0x220ee4)){fs[_0xaaa0('0xe4')](_0x220ee4)[_0xaaa0('0xe5')](fs['createWriteStream'](path[_0xaaa0('0xcd')](_0x1d132b,_0x2c3a7e[_0xaaa0('0xd5')][_0xaaa0('0xe2')])));}}return{'date':moment(_0x2c3a7e[_0xaaa0('0x7f')])[_0xaaa0('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2c3a7e[_0xaaa0('0xd7')]==='out'?_0x2c3a7e[_0xaaa0('0x76')]?_0x2c3a7e[_0xaaa0('0x76')][_0xaaa0('0x2d')]:_0xaaa0('0xe6'):_0x2c3a7e[_0xaaa0('0x65')][_0xaaa0('0xe7')]+(_0x2c3a7e[_0xaaa0('0x65')][_0xaaa0('0xd3')]?'\x20'+_0x2c3a7e[_0xaaa0('0x65')][_0xaaa0('0xd3')]:''),'body':_0x2c3a7e[_0xaaa0('0xd5')]?_0x2c3a7e[_0xaaa0('0xd5')][_0xaaa0('0xe2')]:_0x2c3a7e['body'],'direction':_0x2c3a7e[_0xaaa0('0xd7')]===_0xaaa0('0xe8')?'A':'C','secret':_0x2c3a7e['secret'],'read':_0x2c3a7e[_0xaaa0('0x84')],'attachment':_0x2c3a7e[_0xaaa0('0xd5')]};})[_0xaaa0('0x67')]()};return ejs[_0xaaa0('0xe9')](path['join'](config[_0xaaa0('0xd0')],_0xaaa0('0xea'),_0xaaa0('0xeb'),_0xaaa0('0xec')),{'interaction':_0x1ee240})[_0xaaa0('0x28')](function(_0x34be46){var _0x257e59=path[_0xaaa0('0xcd')](_0x1d132b,_0xaaa0('0xed')+_0x3ed474['id']+'-'+_0xb0c683+_0xaaa0('0xee'));var _0x4e6fdb={'path':_0x257e59,'channel':'Openchannel','interactionId':_0x3ed474['id']};return pdf[_0xaaa0('0xef')](_0x34be46,_0x4e6fdb);})[_0xaaa0('0x28')](function(){return new BPromise(function(_0x5ccbe6,_0x43be54){zipdir(_0x1d132b,{'saveTo':_0x47f22d},function(_0x1116b4,_0x31c0d5){if(_0x1116b4)return _0x43be54(_0x1116b4);return _0x5ccbe6(_0x31c0d5);});})[_0xaaa0('0x28')](function(){return new BPromise(function(_0x3dbfe5,_0x4d58cc){rimraf(_0x1d132b,function(_0x4461ee){if(_0x4461ee)_0x4d58cc(_0x4461ee);return _0x3dbfe5();});});})[_0xaaa0('0x28')](function(){return _0x1e39d1[_0xaaa0('0xcb')](_0x47f22d,_0x3dfff1,function(_0x462173){if(_0x462173){console[_0xaaa0('0xf0')](_0xaaa0('0xf1'),_0x462173);}else{fs[_0xaaa0('0xf2')](_0x47f22d);}});});});}else{return _0x1e39d1[_0xaaa0('0x29')](0xc8);}})['catch'](handleError(_0x1e39d1,null));}; \ No newline at end of file +var _0x25f7=['i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','OpenchannelMessage','addTags','setTags','Tag','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','User','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','createReadStream','out','System','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','talking','unmanaged','total','closed','waiting','UserId','answered','index','OpenchannelInteraction','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','from','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','buildExpression','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace'];(function(_0x51941e,_0x36c32d){var _0x249aa8=function(_0x39bd1c){while(--_0x39bd1c){_0x51941e['push'](_0x51941e['shift']());}};_0x249aa8(++_0x36c32d);}(_0x25f7,0x69));var _0x725f=function(_0x3c653a,_0x3cd0e0){_0x3c653a=_0x3c653a-0x0;var _0x2ce04d=_0x25f7[_0x3c653a];return _0x2ce04d;};'use strict';var emlformat=require(_0x725f('0x0'));var rimraf=require(_0x725f('0x1'));var zipdir=require(_0x725f('0x2'));var jsonpatch=require(_0x725f('0x3'));var rp=require(_0x725f('0x4'));var moment=require(_0x725f('0x5'));var BPromise=require(_0x725f('0x6'));var Mustache=require(_0x725f('0x7'));var util=require(_0x725f('0x8'));var path=require(_0x725f('0x9'));var sox=require(_0x725f('0xa'));var csv=require(_0x725f('0xb'));var ejs=require(_0x725f('0xc'));var fs=require('fs');var fs_extra=require(_0x725f('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x725f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x725f('0xf'));var toCsv=require(_0x725f('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x725f('0x10'));var authService=require(_0x725f('0x11'));var qs=require(_0x725f('0x12'));var as=require(_0x725f('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x725f('0x14'));var logger=require(_0x725f('0x15'))('api');var utils=require(_0x725f('0x16'));var config=require(_0x725f('0x17'));var licenseUtil=require(_0x725f('0x18'));var db=require(_0x725f('0x19'))['db'];config[_0x725f('0x1a')]=_[_0x725f('0x1b')](config['redis'],{'host':_0x725f('0x1c'),'port':0x18eb});var socket=require(_0x725f('0x1d'))(new Redis(config[_0x725f('0x1a')]));require(_0x725f('0x1e'))['register'](socket);function respondWithStatusCode(_0x4a15a3,_0x47566e){_0x47566e=_0x47566e||0xcc;return function(_0x3523d7){if(_0x3523d7){return _0x4a15a3[_0x725f('0x1f')](_0x47566e);}return _0x4a15a3[_0x725f('0x20')](_0x47566e)[_0x725f('0x21')]();};}function respondWithResult(_0x101e43,_0x259742){_0x259742=_0x259742||0xc8;return function(_0x5ba7e8){if(_0x5ba7e8){return _0x101e43[_0x725f('0x20')](_0x259742)['json'](_0x5ba7e8);}};}function respondWithFilteredResult(_0x18289b,_0x4c05ac){return function(_0xf4b4cc){if(_0xf4b4cc){var _0x8f055f=typeof _0x4c05ac[_0x725f('0x22')]===_0x725f('0x23')&&typeof _0x4c05ac[_0x725f('0x24')]===_0x725f('0x23');var _0x5970bd=_0xf4b4cc[_0x725f('0x25')];var _0x4c95d=_0x8f055f?0x0:_0x4c05ac['offset'];var _0x4d69ad=_0x8f055f?_0xf4b4cc[_0x725f('0x25')]:_0x4c05ac['offset']+_0x4c05ac[_0x725f('0x24')];var _0x1023e2;if(_0x4d69ad>=_0x5970bd){_0x4d69ad=_0x5970bd;_0x1023e2=0xc8;}else{_0x1023e2=0xce;}_0x18289b[_0x725f('0x20')](_0x1023e2);return _0x18289b[_0x725f('0x26')]('Content-Range',_0x4c95d+'-'+_0x4d69ad+'/'+_0x5970bd)['json'](_0xf4b4cc);}return null;};}function patchUpdates(_0x5dc14a){return function(_0x583882){try{jsonpatch[_0x725f('0x27')](_0x583882,_0x5dc14a,!![]);}catch(_0x4ea6a9){return BPromise[_0x725f('0x28')](_0x4ea6a9);}return _0x583882[_0x725f('0x29')]();};}function saveUpdates(_0x302626,_0x1658cf){return function(_0x50e505){if(_0x50e505){return _0x50e505[_0x725f('0x2a')](_0x302626)[_0x725f('0x2b')](function(_0x4a840f){return _0x4a840f;});}return null;};}function removeEntity(_0x14d842,_0x212225){return function(_0x1e29ad){if(_0x1e29ad){return _0x1e29ad[_0x725f('0x2c')]()['then'](function(){_0x14d842[_0x725f('0x20')](0xcc)[_0x725f('0x21')]();});}};}function handleEntityNotFound(_0x24106b,_0x1248e2){return function(_0x2bcdbe){if(!_0x2bcdbe){_0x24106b['sendStatus'](0x194);}return _0x2bcdbe;};}function handleError(_0x5e38b5,_0x2f09fd){_0x2f09fd=_0x2f09fd||0x1f4;return function(_0x401c33){logger[_0x725f('0x2d')](_0x401c33[_0x725f('0x2e')]);if(_0x401c33[_0x725f('0x2f')]){delete _0x401c33[_0x725f('0x2f')];}_0x5e38b5['status'](_0x2f09fd)[_0x725f('0x30')](_0x401c33);};}function getInteractionUsers(_0x2892c9,_0x146537){return new BPromise(function(_0x33caeb,_0x278cce){try{if(_0x146537[_0x2892c9['id']]){_0x2892c9[_0x725f('0x31')]=_['map'](_0x146537[_0x2892c9['id']],function(_0x2c36d3){return{'id':_0x2c36d3['id'],'fullname':_0x2c36d3[_0x725f('0x32')]};});}}catch(_0xd43880){_0x278cce(_0xd43880);}_0x33caeb(_0x2892c9);});}function getInteractionTags(_0x35101c,_0x1a4d48){return new BPromise(function(_0xd56c01,_0x3ec38b){try{if(_0x35101c[_0x725f('0x33')]){_0x35101c[_0x725f('0x34')]=[];_0x35101c[_0x725f('0x33')][_0x725f('0x35')](',')[_0x725f('0x36')](function(_0x670042){_0x35101c[_0x725f('0x34')][_0x725f('0x37')](_0x1a4d48[_0x670042]);});}delete _0x35101c['TagIds'];}catch(_0xb79579){_0x3ec38b(_0xb79579);}_0xd56c01(_0x35101c);});}function updateOpenchannelInteraction(_0x32fe6f,_0x5036d4,_0x127891){return new BPromise(function(_0x412d89,_0x3ca6fb){return getInteractionUsers(_0x32fe6f,_0x127891)['then'](function(_0x5b7a03){return getInteractionTags(_0x5b7a03,_0x5036d4);})[_0x725f('0x2b')](function(_0x3c64fe){return getStateInteraction(_0x3c64fe);})['then'](function(_0x5a7f37){_0x412d89(_0x5a7f37);})[_0x725f('0x38')](function(_0x586a74){_0x3ca6fb(_0x586a74);});});}function getStateInteraction(_0x39371e){return new BPromise(function(_0xf155e3){_0x39371e['waiting']=0x0;_0x39371e[_0x725f('0x39')]=0x0;_0x39371e['answered']=0x0;_0x39371e[_0x725f('0x3a')]=0x0;_0x39371e[_0x725f('0x3b')]=0x0;if(!_0x39371e[_0x725f('0x3c')]&&!_0x39371e['UserId']){_0x39371e[_0x725f('0x3d')]+=0x1;}if(!_0x39371e[_0x725f('0x3c')]&&_0x39371e[_0x725f('0x3e')]){_0x39371e['talking']+=0x1;if(_0x39371e['waiting']){_0x39371e['waiting']-=0x1;}}if(_0x39371e[_0x725f('0x3c')]&&_0x39371e[_0x725f('0x3e')]){_0x39371e[_0x725f('0x3f')]+=0x1;if(_0x39371e[_0x725f('0x39')]){_0x39371e[_0x725f('0x39')]-=0x1;}}if(_0x39371e[_0x725f('0x3c')]&&!_0x39371e[_0x725f('0x3e')]){_0x39371e['unmanaged']+=0x1;if(_0x39371e['waiting']){_0x39371e['waiting']-=0x1;}}_0x39371e[_0x725f('0x3b')]+=0x1;_0xf155e3(_0x39371e);});}exports[_0x725f('0x40')]=function(_0x47150d,_0x535baf){var _0x97a4e={},_0x437901={},_0x569c66={'count':0x0,'rows':[]};var _0x4d104e=_['map'](db[_0x725f('0x41')][_0x725f('0x42')],function(_0x3b282b){return{'name':_0x3b282b['fieldName'],'type':_0x3b282b[_0x725f('0x43')][_0x725f('0x44')]};});_0x437901[_0x725f('0x45')]=_[_0x725f('0x46')](_0x4d104e,_0x725f('0x2f'));_0x437901[_0x725f('0x47')]=_[_0x725f('0x48')](_0x47150d[_0x725f('0x47')]);_0x437901[_0x725f('0x49')]=_[_0x725f('0x4a')](_0x437901[_0x725f('0x45')],_0x437901[_0x725f('0x47')]);_0x97a4e[_0x725f('0x4b')]=_['intersection'](_0x437901[_0x725f('0x45')],qs[_0x725f('0x4c')](_0x47150d[_0x725f('0x47')]['fields']));_0x97a4e[_0x725f('0x4b')]=_0x97a4e[_0x725f('0x4b')][_0x725f('0x4d')]?_0x97a4e[_0x725f('0x4b')]:_0x437901[_0x725f('0x45')];if(!_0x47150d[_0x725f('0x47')][_0x725f('0x4e')]('nolimit')){_0x97a4e['limit']=qs[_0x725f('0x24')](_0x47150d[_0x725f('0x47')][_0x725f('0x24')]);_0x97a4e[_0x725f('0x22')]=qs['offset'](_0x47150d['query'][_0x725f('0x22')]);}_0x97a4e['order']=qs[_0x725f('0x4f')](_0x47150d[_0x725f('0x47')][_0x725f('0x4f')]);_0x97a4e[_0x725f('0x50')]=qs['filters'](_[_0x725f('0x51')](_0x47150d['query'],_0x437901[_0x725f('0x49')]),_0x4d104e);var _0x1f3f82=[];var _0x10f4f8=squel[_0x725f('0x52')]()[_0x725f('0x53')]('id')[_0x725f('0x53')](_0x725f('0x2f'))[_0x725f('0x53')](_0x725f('0x54'))[_0x725f('0x55')]('tools_tags');var _0x4e8a92=squel[_0x725f('0x52')]()[_0x725f('0x53')]('u.id')[_0x725f('0x53')]('u.fullname')['field'](_0x725f('0x56'))['from']('user_has_openchannel_interactions','ui')['left_join'](_0x725f('0x57'),'u',_0x725f('0x58'));var _0x2aec0c=squel[_0x725f('0x52')]()['from'](_0x725f('0x59'),'i')[_0x725f('0x5a')](_0x725f('0x5b'),'c',_0x725f('0x5c'))['left_join'](_0x725f('0x57'),'o',_0x725f('0x5d'))['left_join']('openchannel_accounts','a',_0x725f('0x5e'))[_0x725f('0x5a')](_0x725f('0x5f'),'me',_0x725f('0x60'))[_0x725f('0x5a')](_0x725f('0x61'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x725f('0x5a')](_0x725f('0x62'),'t',_0x725f('0x63'));var _0xe92173=squel[_0x725f('0x64')]();var _0x13bd44=[];var _0x4ee68d=squel['expr']();var _0x1ff8f6;if(_0x47150d[_0x725f('0x47')][_0x725f('0x65')]){_0x1ff8f6=as[_0x725f('0x66')](_0x47150d[_0x725f('0x47')][_0x725f('0x65')]);var _0x2a9b0f=_0x1ff8f6[_0x725f('0x67')];for(var _0x461a50=0x0;_0x461a50<_0x1ff8f6[_0x725f('0x68')][_0x725f('0x4d')];_0x461a50++){var _0x3dd3dc=_0x1ff8f6[_0x725f('0x68')][_0x461a50];var _0x24b090='i';var _0x3bda5f=_[_0x725f('0x69')](_0x4d104e,[_0x725f('0x2f'),_0x3dd3dc[_0x725f('0x53')]]);if(!_0x3bda5f){switch(_0x3dd3dc[_0x725f('0x53')]){case _0x725f('0x6a'):if(_0x3dd3dc[_0x725f('0x6b')]==0x1){_0x2aec0c[_0x725f('0x6c')]('`'+_0x3dd3dc[_0x725f('0x53')]+_0x725f('0x6d'));}else{_0x2aec0c['having']('`'+_0x3dd3dc['field']+_0x725f('0x6e'));}break;case _0x725f('0x6f'):if(_0x3dd3dc[_0x725f('0x70')]===_0x725f('0x71')){if(_0x3dd3dc['value'][_0x725f('0x35')]('\x20')[_0x725f('0x4d')]>0x1){_0xe92173[_0x2a9b0f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x725f('0x72')](_0x3dd3dc[_0x725f('0x6b')]),null);}else{var _0x567431='%'+_0x3dd3dc[_0x725f('0x6b')]+'%';_0xe92173[_0x2a9b0f](_0x725f('0x73'),_0x567431,_0x567431,_0x567431);}}else{_0x3bda5f=_[_0x725f('0x69')](_0x4d104e,['name',_0x725f('0x74')]);_0x3dd3dc[_0x725f('0x53')]='ContactId';_0x29b14f=as['buildExpression'](_0x24b090,_0x3bda5f['type'],_0x3dd3dc);_0xe92173[_0x2a9b0f](_0x29b14f[_0x725f('0x75')],_0x29b14f['value'][_0x725f('0x76')],_0x29b14f[_0x725f('0x6b')][_0x725f('0x21')]);}break;case'Tag':var _0x1c0a7b=_0x3dd3dc['value'][_0x725f('0x35')](',')[_0x725f('0x46')](function(_0x58a67a){return Number(_0x58a67a);});_0x1c0a7b[_0x725f('0x36')](function(_0x1086c4){_0x4ee68d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1086c4+',%');});_0x13bd44=_['union'](_0x13bd44,_0x1c0a7b);break;case'User':if(_0x3dd3dc[_0x725f('0x70')]===_0x725f('0x71')){_0xe92173[_0x2a9b0f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3dd3dc['value']+'%',null);}else{_0x3bda5f=_[_0x725f('0x69')](_0x4d104e,[_0x725f('0x2f'),'UserId']);_0x3dd3dc[_0x725f('0x53')]=_0x725f('0x3e');_0x29b14f=as[_0x725f('0x77')](_0x24b090,_0x3bda5f['type'],_0x3dd3dc);_0xe92173[_0x2a9b0f](_0x29b14f['text'],_0x29b14f[_0x725f('0x6b')][_0x725f('0x76')],_0x29b14f['value'][_0x725f('0x21')]);}break;case'body':_0x29b14f=as['buildExpression']('me',null,_0x3dd3dc);_0xe92173[_0x2a9b0f](_0x29b14f[_0x725f('0x75')],_0x29b14f['value'][_0x725f('0x76')],_0x29b14f[_0x725f('0x6b')]['end']);break;}}else{var _0x29b14f=as[_0x725f('0x77')](_0x24b090,_0x3bda5f[_0x725f('0x43')],_0x3dd3dc);_0xe92173[_0x2a9b0f](_0x29b14f[_0x725f('0x75')],_0x29b14f['value'][_0x725f('0x76')],_0x29b14f[_0x725f('0x6b')][_0x725f('0x21')]);}}}else{var _0x339423=_(_0x47150d[_0x725f('0x47')])[_0x725f('0x48')]()[_0x725f('0x46')](function(_0x376c40){return _[_0x725f('0x78')](_0x4d104e,['name',_0x376c40])?_0x376c40:undefined;})[_0x725f('0x79')]()[_0x725f('0x6b')]();if(!_[_0x725f('0x7a')](_0x339423)){_0x339423[_0x725f('0x36')](function(_0x1ceb0c){if(_0x1ceb0c===_0x725f('0x7b')){_0x2aec0c[_0x725f('0x50')](_0x725f('0x7c'),[][_0x725f('0x7d')](_0x47150d[_0x725f('0x47')][_0x1ceb0c]));}else if(_0x1ceb0c===_0x725f('0x7e')){var _0x29c225=JSON[_0x725f('0x7f')](_0x47150d[_0x725f('0x47')][_0x1ceb0c])[_0x725f('0x80')];var _0x45b605=JSON[_0x725f('0x7f')](_0x47150d['query'][_0x1ceb0c])[_0x725f('0x81')];_0x2aec0c['where'](_0x725f('0x82'),_0x29c225,_0x45b605);}else{if(_0x47150d[_0x725f('0x47')][_0x1ceb0c]===_0x725f('0x83')){_0x2aec0c[_0x725f('0x50')]('i.'+_0x1ceb0c+'\x20IS\x20NULL');}else{_0x2aec0c[_0x725f('0x50')]('i.'+_0x1ceb0c+_0x725f('0x84'),_0x47150d[_0x725f('0x47')][_0x1ceb0c]);}}});}if(_0x47150d[_0x725f('0x47')]['read']){if(_0x47150d[_0x725f('0x47')][_0x725f('0x85')]==0x1){_0x2aec0c[_0x725f('0x6c')]('`unreadMessages`\x20=\x200');}else{_0x2aec0c[_0x725f('0x6c')](_0x725f('0x86'));}}if(_0x47150d[_0x725f('0x47')][_0x725f('0x87')]){_0x13bd44=_[_0x725f('0x88')](_0x47150d[_0x725f('0x47')][_0x725f('0x87')])?_0x47150d['query'][_0x725f('0x87')]:new Array(_0x47150d[_0x725f('0x47')][_0x725f('0x87')]);_0x13bd44[_0x725f('0x36')](function(_0x43d692){_0x4ee68d['or'](_0x725f('0x89'),'%,'+_0x43d692+',%');});}if(_0x47150d['query'][_0x725f('0x8a')]){var _0x10a91a=_0x47150d[_0x725f('0x47')][_0x725f('0x8a')][_0x725f('0x8b')]('\x5c','\x5c\x5c')[_0x725f('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x10a91a)){_0xe92173['or'](_0x725f('0x8c'),_0x10a91a+'%');}else{_0xe92173['or'](_0x725f('0x8d'),qs[_0x725f('0x72')](_0x10a91a))['or']('i.from\x20LIKE\x20?',_0x10a91a+'%')['or'](_0x725f('0x8e'),_0x10a91a+'%');}}}_0x2aec0c['where'](_0xe92173);_0x2aec0c[_0x725f('0x8f')](_0x725f('0x90'));var _0x479ccf={'type':db['Sequelize'][_0x725f('0x91')]['SELECT'],'raw':!![]};var _0x5a1523=_0x2aec0c[_0x725f('0x92')]();_0x5a1523[_0x725f('0x53')](_0x725f('0x90'));_0x5a1523[_0x725f('0x53')](_0x725f('0x93'),_0x725f('0x6a'));if(_0x97a4e[_0x725f('0x94')]){_0x97a4e[_0x725f('0x94')][_0x725f('0x36')](function(_0x4b2e0d){var _0x2db04e=_0x4b2e0d[0x0]==='contactName'?_0x4b2e0d[0x0]:'i.'+_0x4b2e0d[0x0];_0x2aec0c[_0x725f('0x94')](_0x2db04e,_0x4b2e0d[0x1]===_0x725f('0x95')?![]:!![]);});}if(!_[_0x725f('0x7a')](_0x13bd44)){_0x2aec0c[_0x725f('0x6c')](_0x4ee68d);_0x5a1523[_0x725f('0x50')](_0x725f('0x96'),_0x13bd44);}BPromise['resolve']()[_0x725f('0x2b')](function(){if(!_0x1ff8f6){if(_0x47150d[_0x725f('0x47')][_0x725f('0x7b')])return;_0x5a1523['where'](_0x725f('0x97'));_0x2aec0c['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x47150d[_0x725f('0x98')][_0x725f('0x99')]!==_0x725f('0x9a'))return;return _0x47150d[_0x725f('0x98')][_0x725f('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x399b90){if(_[_0x725f('0x7a')](_0x399b90)){_0x5a1523[_0x725f('0x50')](_0x725f('0x9c'));_0x2aec0c[_0x725f('0x50')](_0x725f('0x9c'));}else{_0x5a1523[_0x725f('0x50')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x725f('0x46')](_0x399b90,'id'));_0x2aec0c[_0x725f('0x50')](_0x725f('0x7c'),_['map'](_0x399b90,'id'));}});})['then'](function(){if(_0x47150d[_0x725f('0x98')][_0x725f('0x99')]==='agent'&&!_0x1ff8f6&&!_0x47150d[_0x725f('0x47')][_0x725f('0x7b')])return[];return db[_0x725f('0x9d')][_0x725f('0x47')](_0x5a1523[_0x725f('0x9e')](),_0x479ccf);})[_0x725f('0x2b')](function(_0x434e82){_0x569c66[_0x725f('0x25')]=_0x434e82[_0x725f('0x4d')];if(_0x569c66[_0x725f('0x25')]===0x0)return[];return db[_0x725f('0x9d')]['query'](_0x10f4f8[_0x725f('0x9e')](),_0x479ccf)[_0x725f('0x2b')](function(_0x15fdde){_0x1f3f82=_['keyBy'](_0x15fdde,'id');_0x479ccf=_[_0x725f('0x9f')](_0x479ccf,{'model':db[_0x725f('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47150d[_0x725f('0x47')]['fields']){_0x97a4e[_0x725f('0x4b')][_0x725f('0x36')](function(_0x3f88c4){_0x2aec0c['field']('i.'+_0x3f88c4);});}else{_0x2aec0c[_0x725f('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x725f('0x6a'));_0x2aec0c[_0x725f('0x53')](_0x725f('0xa0'),_0x725f('0xa1'));_0x2aec0c['field'](_0x725f('0xa2'),'Account.mandatoryDisposition');_0x2aec0c['field'](_0x725f('0xa3'),_0x725f('0xa4'));_0x2aec0c[_0x725f('0x53')](_0x725f('0xa5'));_0x2aec0c['field'](_0x725f('0xa6'),_0x725f('0xa7'));_0x2aec0c[_0x725f('0x53')](_0x725f('0xa8'),_0x725f('0xa9'));_0x2aec0c['field']('c.email','Contact.email');_0x2aec0c[_0x725f('0x53')](_0x725f('0xaa'),_0x725f('0xab'));_0x2aec0c[_0x725f('0x53')](_0x725f('0xac'),'Contact.mobile');_0x2aec0c[_0x725f('0x53')]('c.fax',_0x725f('0xad'));_0x2aec0c['field'](_0x725f('0xae'),_0x725f('0xaf'));_0x2aec0c[_0x725f('0x53')](_0x725f('0xb0'),'Owner.internal');_0x2aec0c[_0x725f('0x53')](_0x725f('0xb1'),_0x725f('0x33'));}if(_0x97a4e[_0x725f('0x24')])_0x2aec0c['limit'](_0x97a4e['limit']);if(_0x97a4e[_0x725f('0x22')])_0x2aec0c['offset'](_0x97a4e[_0x725f('0x22')]);return db[_0x725f('0x9d')][_0x725f('0x47')](_0x2aec0c[_0x725f('0x9e')](),_0x479ccf);})['then'](function(_0x301149){if(_0x301149[_0x725f('0x4d')]>0x0)_0x4e8a92['where'](_0x725f('0xb2'),_['map'](_0x301149,'id'));return db['sequelize'][_0x725f('0x47')](_0x4e8a92[_0x725f('0x9e')](),_0x479ccf)['then'](function(_0x473291){var _0x482745=_[_0x725f('0xb3')](_0x473291,_0x725f('0xb4'));var _0x291324=[];_0x301149[_0x725f('0x36')](function(_0xdf5101){_0x291324[_0x725f('0x37')](updateOpenchannelInteraction(_0xdf5101,_0x1f3f82,_0x482745));});return BPromise[_0x725f('0xb5')](_0x291324);});});})[_0x725f('0x2b')](function(_0x56b0fe){_0x569c66[_0x725f('0xb6')]=_0x56b0fe;return _0x569c66;})['then'](respondWithFilteredResult(_0x535baf,_0x97a4e))['catch'](handleError(_0x535baf,null));};exports['show']=function(_0x282717,_0x288989){var _0x473181={};if(_0x282717[_0x725f('0x47')][_0x725f('0x43')]&&_0x282717[_0x725f('0x47')][_0x725f('0x43')]===_0x725f('0x55')){_0x473181[_0x725f('0x55')]=_0x282717[_0x725f('0xb7')]['id'];}else{_0x473181['id']=_0x282717['params']['id'];}var _0x4f0895={'raw':![],'where':_0x473181},_0x1c99a5={};_0x1c99a5[_0x725f('0x45')]=_[_0x725f('0x48')](db[_0x725f('0x41')][_0x725f('0x42')]);_0x1c99a5[_0x725f('0x47')]=_['keys'](_0x282717[_0x725f('0x47')]);_0x1c99a5['filters']=_[_0x725f('0x4a')](_0x1c99a5[_0x725f('0x45')],_0x1c99a5['query']);_0x4f0895['attributes']=_[_0x725f('0x4a')](_0x1c99a5[_0x725f('0x45')],qs[_0x725f('0x4c')](_0x282717[_0x725f('0x47')][_0x725f('0x4c')]));_0x4f0895[_0x725f('0x4b')]=_0x4f0895[_0x725f('0x4b')][_0x725f('0x4d')]?_0x4f0895[_0x725f('0x4b')]:_0x1c99a5['model'];if(_0x282717[_0x725f('0x47')]['includeAll']){_0x4f0895[_0x725f('0xb8')]=[{'all':!![]}];}_0x4f0895=_['merge']({},_0x4f0895,_0x282717[_0x725f('0xb9')]);return db['OpenchannelInteraction'][_0x725f('0x69')](_0x4f0895)[_0x725f('0x2b')](handleEntityNotFound(_0x288989,null))[_0x725f('0x2b')](respondWithResult(_0x288989,null))[_0x725f('0x38')](handleError(_0x288989,null));};exports[_0x725f('0xba')]=function(_0xa8db5d,_0x36f73e){return db[_0x725f('0x41')][_0x725f('0xba')](_0xa8db5d[_0x725f('0xbb')],{})[_0x725f('0x2b')](respondWithResult(_0x36f73e,0xc9))['catch'](handleError(_0x36f73e,null));};exports['update']=function(_0x54409a,_0x199239){if(_0x54409a[_0x725f('0xbb')]['id']){delete _0x54409a[_0x725f('0xbb')]['id'];}return db['OpenchannelInteraction'][_0x725f('0x69')]({'where':{'id':_0x54409a[_0x725f('0xb7')]['id']}})[_0x725f('0x2b')](handleEntityNotFound(_0x199239,null))['then'](saveUpdates(_0x54409a['body'],null))['then'](respondWithResult(_0x199239,null))[_0x725f('0x38')](handleError(_0x199239,null));};exports[_0x725f('0x2c')]=function(_0x25876a,_0x26443c){return db['OpenchannelInteraction'][_0x725f('0x69')]({'where':{'id':_0x25876a[_0x725f('0xb7')]['id']}})[_0x725f('0x2b')](handleEntityNotFound(_0x26443c,null))[_0x725f('0x2b')](removeEntity(_0x26443c,null))[_0x725f('0x38')](handleError(_0x26443c,null));};exports[_0x725f('0xbc')]=function(_0x123cb6,_0x3563b0){return db[_0x725f('0x41')][_0x725f('0xbc')]()[_0x725f('0x2b')](respondWithResult(_0x3563b0,null))[_0x725f('0x38')](handleError(_0x3563b0,null));};exports[_0x725f('0xbd')]=function(_0x3ea86e,_0x1b2708,_0x473642){return db['OpenchannelMessage']['find']({'where':{'id':_0x3ea86e['params']['id']}})['then'](handleEntityNotFound(_0x1b2708,null))[_0x725f('0x2b')](function(_0x17513d){if(_0x17513d){return _0x17513d[_0x725f('0xbd')](_0x3ea86e[_0x725f('0xbb')][_0x725f('0xbe')],_[_0x725f('0xbf')](_0x3ea86e[_0x725f('0xbb')],[_0x725f('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x1b2708,null))['catch'](handleError(_0x1b2708,null));};exports[_0x725f('0xc0')]=function(_0x2b43be,_0x3a5ab3,_0x3ad555){var _0x2732ce={'raw':![],'where':{}};var _0x4bc14a={};var _0x33130d={'count':0x0,'rows':[]};return db[_0x725f('0x41')][_0x725f('0xc1')]({'where':{'id':_0x2b43be['params']['id']}})[_0x725f('0x2b')](handleEntityNotFound(_0x3a5ab3,null))[_0x725f('0x2b')](function(_0x332d2d){if(_0x332d2d){_0x4bc14a['model']=_['keys'](db['OpenchannelMessage'][_0x725f('0x42')]);_0x4bc14a['query']=_[_0x725f('0x48')](_0x2b43be['query']);_0x4bc14a[_0x725f('0x49')]=_[_0x725f('0x4a')](_0x4bc14a[_0x725f('0x45')],_0x4bc14a[_0x725f('0x47')]);_0x2732ce['attributes']=_[_0x725f('0x4a')](_0x4bc14a['model'],qs[_0x725f('0x4c')](_0x2b43be['query']['fields']));_0x2732ce[_0x725f('0x4b')]=_0x2732ce['attributes'][_0x725f('0x4d')]?_0x2732ce[_0x725f('0x4b')]:_0x4bc14a[_0x725f('0x45')];if(!_0x2b43be[_0x725f('0x47')][_0x725f('0x4e')](_0x725f('0xc2'))){_0x2732ce[_0x725f('0x24')]=qs[_0x725f('0x24')](_0x2b43be[_0x725f('0x47')][_0x725f('0x24')]);_0x2732ce[_0x725f('0x22')]=qs[_0x725f('0x22')](_0x2b43be[_0x725f('0x47')][_0x725f('0x22')]);}_0x2732ce[_0x725f('0x94')]=qs[_0x725f('0x4f')](_0x2b43be[_0x725f('0x47')][_0x725f('0x4f')]);_0x2732ce[_0x725f('0x50')]=qs['filters'](_['pick'](_0x2b43be[_0x725f('0x47')],_0x4bc14a[_0x725f('0x49')]));_0x2732ce['where'][_0x725f('0xb4')]=_0x332d2d['id'];if(_0x2b43be[_0x725f('0x47')][_0x725f('0x8a')]){_0x2732ce[_0x725f('0x50')]=_[_0x725f('0x9f')](_0x2732ce[_0x725f('0x50')],{'$or':_[_0x725f('0x46')](_0x2732ce[_0x725f('0x4b')],function(_0x1814b8){var _0x6acd2d={};_0x6acd2d[_0x1814b8]={'$like':'%'+_0x2b43be[_0x725f('0x47')][_0x725f('0x8a')]+'%'};return _0x6acd2d;})});}if(_0x2b43be[_0x725f('0x47')][_0x725f('0x80')]){var _0x2746f8=_0x2b43be[_0x725f('0x47')][_0x725f('0x80')]['split'](',');var _0x555065={};_0x555065[_0x2746f8[0x0]]={'$gte':moment(_0x2746f8[0x1])[_0x725f('0xc3')](_0x725f('0xc4'))};_0x2732ce[_0x725f('0x50')]=_['merge'](_0x2732ce[_0x725f('0x50')],_0x555065);}_0x2732ce=_[_0x725f('0x9f')]({},_0x2732ce,_0x2b43be['options']);return db['OpenchannelMessage'][_0x725f('0x25')]({'where':_0x2732ce['where']})[_0x725f('0x2b')](function(_0x2fedb6){_0x33130d[_0x725f('0x25')]=_0x2fedb6;if(_0x2b43be[_0x725f('0x47')][_0x725f('0xc5')]){_0x2732ce['include']=[{'all':!![]}];}return db[_0x725f('0xc6')]['findAll'](_0x2732ce);})[_0x725f('0x2b')](function(_0xd70e0c){_0x33130d[_0x725f('0xb6')]=_0xd70e0c;return _0x33130d;});}})['then'](respondWithFilteredResult(_0x3a5ab3,_0x2732ce))[_0x725f('0x38')](handleError(_0x3a5ab3,null));};exports[_0x725f('0xc7')]=function(_0x21661b,_0x2ed15d,_0x3652d4){return db[_0x725f('0x41')][_0x725f('0x69')]({'where':{'id':_0x21661b[_0x725f('0xb7')]['id']}})[_0x725f('0x2b')](handleEntityNotFound(_0x2ed15d,null))[_0x725f('0x2b')](function(_0x65fcf3){if(_0x65fcf3){return _0x65fcf3[_0x725f('0xc8')](_0x21661b['body']['ids'],_['omit'](_0x21661b[_0x725f('0xbb')],[_0x725f('0xbe'),'id'])||{})['spread'](function(){return db[_0x725f('0xc9')][_0x725f('0xca')]({'attributes':['id',_0x725f('0x2f'),_0x725f('0x54')],'where':{'id':_0x21661b[_0x725f('0xbb')][_0x725f('0xbe')]}});})[_0x725f('0x2b')](function(_0x5e5c64){socket[_0x725f('0xcb')](_0x725f('0xcc'),{'id':Number(_0x21661b['params']['id']),'tags':_0x5e5c64||[]});return{'id':Number(_0x21661b[_0x725f('0xb7')]['id']),'tags':_0x5e5c64||[]};});}})['then'](respondWithResult(_0x2ed15d,null))[_0x725f('0x38')](handleError(_0x2ed15d,null));};exports[_0x725f('0xcd')]=function(_0x2684f8,_0x50b597,_0x418aa8){return db['OpenchannelInteraction'][_0x725f('0x69')]({'where':{'id':_0x2684f8[_0x725f('0xb7')]['id']}})[_0x725f('0x2b')](handleEntityNotFound(_0x50b597,null))[_0x725f('0x2b')](function(_0x12eedd){if(_0x12eedd){return _0x12eedd['removeTags'](_0x2684f8['query'][_0x725f('0xbe')]);}})[_0x725f('0x2b')](respondWithStatusCode(_0x50b597,null))[_0x725f('0x38')](handleError(_0x50b597,null));};exports[_0x725f('0xce')]=function(_0x3ec535,_0x178e51){var _0x20c923=moment()[_0x725f('0xcf')]()[_0x725f('0x9e')]();var _0x28bcac=path['join'](config[_0x725f('0xd0')],_0x725f('0xd1'),_0x725f('0xd2'),_0x725f('0xd3'));var _0x79a58e=path[_0x725f('0xd4')](config['root'],_0x725f('0xd1'),_0x725f('0xd2'),'attachments');var _0x2eb349=path['join'](_0x28bcac,_0x20c923);var _0x3cc4eb=util[_0x725f('0xc3')]('transcript-%d-%s.zip',_0x3ec535[_0x725f('0xb7')]['id'],_0x20c923);var _0x248378=path[_0x725f('0xd4')](_0x28bcac,_0x3cc4eb);var _0x51773f=[];_0x51773f['push']({'model':db[_0x725f('0xd5')],'as':_0x725f('0xd5'),'attributes':['id',_0x725f('0x32')],'raw':!![]});_0x51773f['push']({'model':db[_0x725f('0xd6')],'as':_0x725f('0x6f'),'attributes':['id',_0x725f('0xd7'),_0x725f('0xd8')],'raw':!![]});if(_0x3ec535['query'][_0x725f('0xd9')]){_0x51773f['push']({'model':db['Attachment'],'as':_0x725f('0xda'),'raw':!![]});}var _0x1156bf=[{'model':db[_0x725f('0xc6')],'as':_0x725f('0xdb'),'attributes':['id',_0x725f('0xbb'),_0x725f('0x7e'),'direction',_0x725f('0xdc'),_0x725f('0x85')],'include':_0x51773f}];_0x1156bf[_0x725f('0x37')]({'model':db[_0x725f('0xdd')],'as':_0x725f('0xde'),'attributes':['id',_0x725f('0x2f')]});_0x1156bf[_0x725f('0x37')]({'model':db[_0x725f('0xd5')],'as':_0x725f('0xdf'),'attributes':['id',_0x725f('0x32')]});return db[_0x725f('0x41')][_0x725f('0x69')]({'where':{'id':_0x3ec535[_0x725f('0xb7')]['id']},'include':_0x1156bf})[_0x725f('0x2b')](handleEntityNotFound(_0x178e51,null))[_0x725f('0x2b')](function(_0x189552){if(_0x189552){var _0x17ed3f=_0x189552[_0x725f('0xe0')]({'plain':!![]});fs[_0x725f('0xe1')](_0x2eb349);var _0x3ee2aa={'channel':_0x725f('0xe2'),'account':_0x17ed3f[_0x725f('0xde')][_0x725f('0x2f')],'agent':_0x17ed3f['Owner']?_0x17ed3f[_0x725f('0xdf')][_0x725f('0x32')]:_0x725f('0xe3'),'createdAt':moment(_0x17ed3f[_0x725f('0x7e')])[_0x725f('0xc3')](_0x725f('0xc4'))[_0x725f('0x9e')](),'closedAt':_0x17ed3f[_0x725f('0x3c')]?moment(_0x17ed3f[_0x725f('0xe4')])[_0x725f('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x17ed3f[_0x725f('0xe5')],'visibility':_0x17ed3f[_0x725f('0xe6')]?_0x725f('0xe7'):_0x725f('0xe8'),'messages':_(_0x17ed3f[_0x725f('0xdb')])[_0x725f('0x8a')]({'secret':![]})[_0x725f('0x46')](function(_0x11060d){if(_0x11060d[_0x725f('0xda')]){var _0x1741c5=path[_0x725f('0xd4')](_0x79a58e,_0x11060d[_0x725f('0xda')][_0x725f('0xe9')]);if(fs['existsSync'](_0x1741c5)){fs[_0x725f('0xea')](_0x1741c5)['pipe'](fs['createWriteStream'](path[_0x725f('0xd4')](_0x2eb349,_0x11060d[_0x725f('0xda')][_0x725f('0xe9')])));}}return{'date':moment(_0x11060d[_0x725f('0x7e')])[_0x725f('0xc3')](_0x725f('0xc4'))[_0x725f('0x9e')](),'sender':_0x11060d['direction']===_0x725f('0xeb')?_0x11060d['User']?_0x11060d['User'][_0x725f('0x32')]:_0x725f('0xec'):_0x11060d['Contact'][_0x725f('0xd7')]+(_0x11060d['Contact'][_0x725f('0xd8')]?'\x20'+_0x11060d['Contact'][_0x725f('0xd8')]:''),'body':_0x11060d[_0x725f('0xda')]?_0x11060d[_0x725f('0xda')][_0x725f('0xe9')]:_0x11060d[_0x725f('0xbb')],'direction':_0x11060d['direction']===_0x725f('0xeb')?'A':'C','secret':_0x11060d[_0x725f('0xdc')],'read':_0x11060d[_0x725f('0x85')],'attachment':_0x11060d[_0x725f('0xda')]};})[_0x725f('0x6b')]()};return ejs['renderFile'](path[_0x725f('0xd4')](config[_0x725f('0xd0')],_0x725f('0xd1'),_0x725f('0xed'),_0x725f('0xee')),{'interaction':_0x3ee2aa})['then'](function(_0x46a864){var _0x2b7f40=path[_0x725f('0xd4')](_0x2eb349,_0x725f('0xef')+_0x17ed3f['id']+'-'+_0x20c923+_0x725f('0xf0'));var _0xf818f2={'path':_0x2b7f40,'channel':_0x725f('0xe2'),'interactionId':_0x17ed3f['id']};return pdf[_0x725f('0xf1')](_0x46a864,_0xf818f2);})[_0x725f('0x2b')](function(){return new BPromise(function(_0x1d9df3,_0x2e2702){zipdir(_0x2eb349,{'saveTo':_0x248378},function(_0x5f4807,_0x403d45){if(_0x5f4807)return _0x2e2702(_0x5f4807);return _0x1d9df3(_0x403d45);});})['then'](function(){return new BPromise(function(_0x3c4ce2,_0x4e8782){rimraf(_0x2eb349,function(_0x30bcda){if(_0x30bcda)_0x4e8782(_0x30bcda);return _0x3c4ce2();});});})[_0x725f('0x2b')](function(){return _0x178e51[_0x725f('0xce')](_0x248378,_0x3cc4eb,function(_0x1f4bc0){if(_0x1f4bc0){console[_0x725f('0xf2')](_0x725f('0xf3'),_0x1f4bc0);}else{fs[_0x725f('0xf4')](_0x248378);}});});});}else{return _0x178e51[_0x725f('0x1f')](0xc8);}})[_0x725f('0x38')](handleError(_0x178e51,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d61a158..bc2e10e 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 _0x452b=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x4ecf2b,_0x19117c){var _0x574b5d=function(_0x4369ad){while(--_0x4369ad){_0x4ecf2b['push'](_0x4ecf2b['shift']());}};_0x574b5d(++_0x19117c);}(_0x452b,0x14a));var _0xb452=function(_0x38c908,_0x5b07c4){_0x38c908=_0x38c908-0x0;var _0x4f6ffd=_0x452b[_0x38c908];return _0x4f6ffd;};'use strict';var EventEmitter=require(_0xb452('0x0'));var OpenchannelInteraction=require(_0xb452('0x1'))['db'][_0xb452('0x2')];var OpenchannelMessage=require(_0xb452('0x1'))['db'][_0xb452('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb452('0x4'),'afterDestroy':_0xb452('0x5')};function emitEvent(_0xc559e9){return function(_0x292d72,_0x34a95c,_0x1212c0){_0x292d72[_0xb452('0x6')]({'attributes':['id'],'raw':!![]})[_0xb452('0x7')](function(_0x2890b3){_0x292d72[_0xb452('0x8')](_0xb452('0x9'),_0x2890b3[_0xb452('0xa')](function(_0x1341c5){return{'id':_0x1341c5['id']};}));return OpenchannelMessage[_0xb452('0xb')]({'where':{'OpenchannelInteractionId':_0x292d72['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x123222){_0x292d72[_0xb452('0x8')](_0xb452('0xc'),_0x123222[_0xb452('0xd')]);OpenchannelInteractionEvents['emit'](_0xc559e9+':'+_0x292d72['id'],_0x292d72);OpenchannelInteractionEvents[_0xb452('0xe')](_0xc559e9,_0x292d72);_0x1212c0(null);})[_0xb452('0xf')](_0x1212c0(null));};}for(var e in events){if(events[_0xb452('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xb452('0x11')](e,emitEvent(event));}}module[_0xb452('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x83ef=['update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x557422,_0x59b68a){var _0xa09501=function(_0x33c638){while(--_0x33c638){_0x557422['push'](_0x557422['shift']());}};_0xa09501(++_0x59b68a);}(_0x83ef,0xf6));var _0xf83e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83ef[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xf83e('0x0'));var OpenchannelInteraction=require(_0xf83e('0x1'))['db'][_0xf83e('0x2')];var OpenchannelMessage=require(_0xf83e('0x1'))['db'][_0xf83e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf83e('0x4')](0x0);var events={'afterCreate':_0xf83e('0x5'),'afterUpdate':_0xf83e('0x6'),'afterDestroy':_0xf83e('0x7')};function emitEvent(_0x53f110){return function(_0x51f8f2,_0x505ea6,_0x19dfa1){_0x51f8f2['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xef3767){_0x51f8f2[_0xf83e('0x8')](_0xf83e('0x9'),_0xef3767[_0xf83e('0xa')](function(_0x52f0ef){return{'id':_0x52f0ef['id']};}));return OpenchannelMessage[_0xf83e('0xb')]({'where':{'OpenchannelInteractionId':_0x51f8f2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf83e('0xc')](function(_0xeb4903){_0x51f8f2['setDataValue'](_0xf83e('0xd'),_0xeb4903[_0xf83e('0xe')]);OpenchannelInteractionEvents[_0xf83e('0xf')](_0x53f110+':'+_0x51f8f2['id'],_0x51f8f2);OpenchannelInteractionEvents['emit'](_0x53f110,_0x51f8f2);_0x19dfa1(null);})[_0xf83e('0x10')](_0x19dfa1(null));};}for(var e in events){if(events[_0xf83e('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 668881c..2acd48c 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 _0x3139=['api','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x98ab4c,_0x30b70c){var _0x5a1b72=function(_0x3c5843){while(--_0x3c5843){_0x98ab4c['push'](_0x98ab4c['shift']());}};_0x5a1b72(++_0x30b70c);}(_0x3139,0x138));var _0x9313=function(_0x36cdb7,_0x5f580e){_0x36cdb7=_0x36cdb7-0x0;var _0xa1a436=_0x3139[_0x36cdb7];return _0xa1a436;};'use strict';var _=require(_0x9313('0x0'));var util=require(_0x9313('0x1'));var logger=require(_0x9313('0x2'))(_0x9313('0x3'));var moment=require('moment');var BPromise=require(_0x9313('0x4'));var rp=require(_0x9313('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9313('0x6'));var config=require('../../config/environment');var attributes=require(_0x9313('0x7'));module[_0x9313('0x8')]=function(_0x38676c,_0x463ab9){return _0x38676c['define']('OpenchannelInteraction',attributes,{'tableName':_0x9313('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9313('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5c5110,_0x2f97fd,_0x3a1812){if(_0x5c5110['changed'](_0x9313('0xb'))){_0x5c5110[_0x9313('0xc')]=moment()[_0x9313('0xd')](_0x9313('0xe'));}_0x3a1812(null,_0x5c5110);}}});}; \ No newline at end of file +var _0xd2a4=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x53055b,_0x568f9f){var _0x13b898=function(_0x1de3cf){while(--_0x1de3cf){_0x53055b['push'](_0x53055b['shift']());}};_0x13b898(++_0x568f9f);}(_0xd2a4,0x142));var _0x4d2a=function(_0x46cc7a,_0x24276c){_0x46cc7a=_0x46cc7a-0x0;var _0x1ca962=_0xd2a4[_0x46cc7a];return _0x1ca962;};'use strict';var _=require(_0x4d2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d2a('0x1'));var moment=require(_0x4d2a('0x2'));var BPromise=require('bluebird');var rp=require(_0x4d2a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d2a('0x4'));var attributes=require(_0x4d2a('0x5'));module[_0x4d2a('0x6')]=function(_0x307ef4,_0x3f3676){return _0x307ef4[_0x4d2a('0x7')](_0x4d2a('0x8'),attributes,{'tableName':_0x4d2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d2a('0xa'),'collate':_0x4d2a('0xb'),'hooks':{'beforeUpdate':function(_0xbb41d8,_0x2aaa1a,_0x19e70c){if(_0xbb41d8[_0x4d2a('0xc')](_0x4d2a('0xd'))){_0xbb41d8['closedAt']=moment()['format'](_0x4d2a('0xe'));}_0x19e70c(null,_0xbb41d8);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index fdaa3e2..b235ad9 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 _0xe2f3=['body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','where','attributes','limit','then','stringify'];(function(_0x19d1e3,_0x18688d){var _0x525447=function(_0x322ef3){while(--_0x322ef3){_0x19d1e3['push'](_0x19d1e3['shift']());}};_0x525447(++_0x18688d);}(_0xe2f3,0x12b));var _0x3e2f=function(_0x3557d0,_0x39f204){_0x3557d0=_0x3557d0-0x0;var _0x38d56c=_0xe2f3[_0x3557d0];return _0x38d56c;};'use strict';var _=require(_0x3e2f('0x0'));var util=require('util');var moment=require(_0x3e2f('0x1'));var BPromise=require(_0x3e2f('0x2'));var rs=require(_0x3e2f('0x3'));var fs=require('fs');var Redis=require(_0x3e2f('0x4'));var db=require(_0x3e2f('0x5'))['db'];var utils=require(_0x3e2f('0x6'));var logger=require(_0x3e2f('0x7'))(_0x3e2f('0x8'));var config=require(_0x3e2f('0x9'));var jayson=require(_0x3e2f('0xa'));var client=jayson[_0x3e2f('0xb')][_0x3e2f('0xc')]({'port':0x232a});config[_0x3e2f('0xd')]=_[_0x3e2f('0xe')](config['redis'],{'host':_0x3e2f('0xf'),'port':0x18eb});var socket=require(_0x3e2f('0x10'))(new Redis(config[_0x3e2f('0xd')]));require(_0x3e2f('0x11'))[_0x3e2f('0x12')](socket);function respondWithRpcPromise(_0x56b90f,_0x1ad351,_0x420d1d){return new BPromise(function(_0x1abb70,_0x5d4af1){return client[_0x3e2f('0x13')](_0x56b90f,_0x420d1d)['then'](function(_0x2cd00e){logger[_0x3e2f('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1ad351,'request\x20sent');logger[_0x3e2f('0x15')](_0x3e2f('0x16'),_0x1ad351,_0x3e2f('0x17'),JSON['stringify'](_0x2cd00e));if(_0x2cd00e[_0x3e2f('0x18')]){if(_0x2cd00e[_0x3e2f('0x18')]['code']===0x1f4){logger[_0x3e2f('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1ad351,_0x2cd00e[_0x3e2f('0x18')][_0x3e2f('0x19')]);return _0x5d4af1(_0x2cd00e[_0x3e2f('0x18')][_0x3e2f('0x19')]);}logger[_0x3e2f('0x18')](_0x3e2f('0x1a'),_0x1ad351,_0x2cd00e[_0x3e2f('0x18')][_0x3e2f('0x19')]);return _0x1abb70(_0x2cd00e[_0x3e2f('0x18')]['message']);}else{logger['info'](_0x3e2f('0x1a'),_0x1ad351,_0x3e2f('0x17'));_0x1abb70(_0x2cd00e[_0x3e2f('0x1b')][_0x3e2f('0x19')]);}})[_0x3e2f('0x1c')](function(_0x451e9c){logger[_0x3e2f('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1ad351,_0x451e9c);_0x5d4af1(_0x451e9c);});});}exports[_0x3e2f('0x1d')]=function(_0x24beac){var _0x389fc9=this;return new Promise(function(_0x57f76,_0x251ecc){return db[_0x3e2f('0x1e')]['update'](_0x24beac['body'],{'raw':_0x24beac[_0x3e2f('0x1f')]?_0x24beac['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24beac[_0x3e2f('0x1f')]?_0x24beac[_0x3e2f('0x1f')][_0x3e2f('0x20')]||null:null,'attributes':_0x24beac[_0x3e2f('0x1f')]?_0x24beac[_0x3e2f('0x1f')][_0x3e2f('0x21')]||null:null,'limit':_0x24beac[_0x3e2f('0x1f')]?_0x24beac['options'][_0x3e2f('0x22')]||null:null})[_0x3e2f('0x23')](function(_0x77cd8c){logger[_0x3e2f('0x14')](_0x3e2f('0x1d'),_0x24beac);logger[_0x3e2f('0x15')]('UpdateOpenchannelInteraction',_0x24beac,JSON[_0x3e2f('0x24')](_0x77cd8c));_0x57f76(_0x77cd8c);})['catch'](function(_0x3bc1da){logger[_0x3e2f('0x18')](_0x3e2f('0x1d'),_0x3bc1da[_0x3e2f('0x19')],_0x24beac);_0x251ecc(_0x389fc9[_0x3e2f('0x18')](0x1f4,_0x3bc1da[_0x3e2f('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x132467){return new Promise(function(_0x1b93ad,_0x3be057){return db[_0x3e2f('0x1e')]['find']({'where':_0x132467['options']?_0x132467['options']['where']||null:null})['then'](function(_0x3ecfba){if(_0x3ecfba){return _0x3ecfba['addTags'](_0x132467[_0x3e2f('0x25')][_0x3e2f('0x26')],_[_0x3e2f('0x27')](_0x132467[_0x3e2f('0x25')],['ids','id'])||{});}})[_0x3e2f('0x28')](function(_0x1b52fa){logger[_0x3e2f('0x14')]('AddTags',_0x132467);logger['debug'](_0x3e2f('0x29'),_0x132467,JSON[_0x3e2f('0x24')](_0x1b52fa));_0x1b93ad(_0x1b52fa);})[_0x3e2f('0x1c')](function(_0x4ece68){logger[_0x3e2f('0x18')](_0x3e2f('0x29'),_0x4ece68[_0x3e2f('0x19')],_0x132467);_0x3be057(_this[_0x3e2f('0x18')](0x1f4,_0x4ece68[_0x3e2f('0x19')]));});});}; \ No newline at end of file +var _0xd760=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5b854d,_0x356b34){var _0x48be37=function(_0x52652f){while(--_0x52652f){_0x5b854d['push'](_0x5b854d['shift']());}};_0x48be37(++_0x356b34);}(_0xd760,0xb0));var _0x0d76=function(_0x49c5a5,_0x88cad4){_0x49c5a5=_0x49c5a5-0x0;var _0x5b536a=_0xd760[_0x49c5a5];return _0x5b536a;};'use strict';var _=require(_0x0d76('0x0'));var util=require(_0x0d76('0x1'));var moment=require(_0x0d76('0x2'));var BPromise=require(_0x0d76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d76('0x4'));var db=require(_0x0d76('0x5'))['db'];var utils=require(_0x0d76('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0d76('0x7'));var client=jayson[_0x0d76('0x8')]['http']({'port':0x232a});config[_0x0d76('0x9')]=_['defaults'](config[_0x0d76('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d76('0xa'))(new Redis(config['redis']));require(_0x0d76('0xb'))['register'](socket);function respondWithRpcPromise(_0x531c63,_0x575eb9,_0x5dc95e){return new BPromise(function(_0x520ec2,_0x860266){return client['request'](_0x531c63,_0x5dc95e)[_0x0d76('0xc')](function(_0x212844){logger[_0x0d76('0xd')](_0x0d76('0xe'),_0x575eb9,_0x0d76('0xf'));logger[_0x0d76('0x10')](_0x0d76('0x11'),_0x575eb9,_0x0d76('0xf'),JSON[_0x0d76('0x12')](_0x212844));if(_0x212844[_0x0d76('0x13')]){if(_0x212844[_0x0d76('0x13')][_0x0d76('0x14')]===0x1f4){logger[_0x0d76('0x13')](_0x0d76('0xe'),_0x575eb9,_0x212844[_0x0d76('0x13')]['message']);return _0x860266(_0x212844[_0x0d76('0x13')]['message']);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x575eb9,_0x212844[_0x0d76('0x13')][_0x0d76('0x15')]);return _0x520ec2(_0x212844[_0x0d76('0x13')][_0x0d76('0x15')]);}else{logger[_0x0d76('0xd')]('OpenchannelInteraction,\x20%s,\x20%s',_0x575eb9,_0x0d76('0xf'));_0x520ec2(_0x212844[_0x0d76('0x16')][_0x0d76('0x15')]);}})[_0x0d76('0x17')](function(_0x484b82){logger[_0x0d76('0x13')](_0x0d76('0xe'),_0x575eb9,_0x484b82);_0x860266(_0x484b82);});});}exports[_0x0d76('0x18')]=function(_0x1dc0ea){var _0x35316a=this;return new Promise(function(_0x41c5ae,_0x27a3da){return db[_0x0d76('0x19')][_0x0d76('0x1a')](_0x1dc0ea['body'],{'raw':_0x1dc0ea[_0x0d76('0x1b')]?_0x1dc0ea[_0x0d76('0x1b')][_0x0d76('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dc0ea[_0x0d76('0x1b')]?_0x1dc0ea[_0x0d76('0x1b')][_0x0d76('0x1d')]||null:null,'attributes':_0x1dc0ea[_0x0d76('0x1b')]?_0x1dc0ea[_0x0d76('0x1b')][_0x0d76('0x1e')]||null:null,'limit':_0x1dc0ea['options']?_0x1dc0ea[_0x0d76('0x1b')][_0x0d76('0x1f')]||null:null})[_0x0d76('0xc')](function(_0x345878){logger['info']('UpdateOpenchannelInteraction',_0x1dc0ea);logger[_0x0d76('0x10')](_0x0d76('0x18'),_0x1dc0ea,JSON[_0x0d76('0x12')](_0x345878));_0x41c5ae(_0x345878);})[_0x0d76('0x17')](function(_0x5b3d49){logger['error'](_0x0d76('0x18'),_0x5b3d49['message'],_0x1dc0ea);_0x27a3da(_0x35316a['error'](0x1f4,_0x5b3d49['message']));});});};exports[_0x0d76('0x20')]=function(_0x30242b){return new Promise(function(_0x9c8c06,_0x39295f){return db[_0x0d76('0x19')][_0x0d76('0x21')]({'where':_0x30242b[_0x0d76('0x1b')]?_0x30242b[_0x0d76('0x1b')][_0x0d76('0x1d')]||null:null})[_0x0d76('0xc')](function(_0x529777){if(_0x529777){return _0x529777[_0x0d76('0x22')](_0x30242b[_0x0d76('0x23')][_0x0d76('0x24')],_[_0x0d76('0x25')](_0x30242b['body'],[_0x0d76('0x24'),'id'])||{});}})[_0x0d76('0x26')](function(_0x2962bf){logger[_0x0d76('0xd')](_0x0d76('0x27'),_0x30242b);logger[_0x0d76('0x10')](_0x0d76('0x27'),_0x30242b,JSON[_0x0d76('0x12')](_0x2962bf));_0x9c8c06(_0x2962bf);})[_0x0d76('0x17')](function(_0xa0f13f){logger[_0x0d76('0x13')]('AddTags',_0xa0f13f[_0x0d76('0x15')],_0x30242b);_0x39295f(_this[_0x0d76('0x13')](0x1f4,_0xa0f13f[_0x0d76('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8158ccb..3a2c421 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 _0x5946=['register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x29c9fc,_0xc00fdd){var _0x3fc0ed=function(_0x582d8f){while(--_0x582d8f){_0x29c9fc['push'](_0x29c9fc['shift']());}};_0x3fc0ed(++_0xc00fdd);}(_0x5946,0xe2));var _0x6594=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x5946[_0x496333];return _0x44256e;};'use strict';var OpenchannelInteractionEvents=require(_0x6594('0x0'));var events=[_0x6594('0x1'),_0x6594('0x2'),_0x6594('0x3')];function createListener(_0x4a93a,_0x1027d1){return function(_0x184a92){_0x1027d1[_0x6594('0x4')](_0x4a93a,_0x184a92);};}function removeListener(_0x1c523e,_0xf68973){return function(){OpenchannelInteractionEvents['removeListener'](_0x1c523e,_0xf68973);};}exports[_0x6594('0x5')]=function(_0x293cb9){for(var _0x55df3e=0x0,_0x517f33=events['length'];_0x55df3e<_0x517f33;_0x55df3e++){var _0x2781b6=events[_0x55df3e];var _0x5abb34=createListener(_0x6594('0x6')+_0x2781b6,_0x293cb9);OpenchannelInteractionEvents['on'](_0x2781b6,_0x5abb34);}}; \ No newline at end of file +var _0x5e59=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x2c09a1,_0x4c5031){var _0x515a9b=function(_0x44d225){while(--_0x44d225){_0x2c09a1['push'](_0x2c09a1['shift']());}};_0x515a9b(++_0x4c5031);}(_0x5e59,0x197));var _0x95e5=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0x5e59[_0x3cf4d3];return _0x4e547b;};'use strict';var OpenchannelInteractionEvents=require(_0x95e5('0x0'));var events=[_0x95e5('0x1'),_0x95e5('0x2'),_0x95e5('0x3')];function createListener(_0x5b6d92,_0x9e1c7d){return function(_0x34b0c9){_0x9e1c7d[_0x95e5('0x4')](_0x5b6d92,_0x34b0c9);};}function removeListener(_0xdd762f,_0x5b590a){return function(){OpenchannelInteractionEvents[_0x95e5('0x5')](_0xdd762f,_0x5b590a);};}exports[_0x95e5('0x6')]=function(_0x515162){for(var _0x2e8152=0x0,_0x4c8a20=events[_0x95e5('0x7')];_0x2e8152<_0x4c8a20;_0x2e8152++){var _0x470000=events[_0x2e8152];var _0x1823ce=createListener(_0x95e5('0x8')+_0x470000,_0x515162);OpenchannelInteractionEvents['on'](_0x470000,_0x1823ce);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 52d4792..20d6a00 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x4aa068,_0x3e53d3){var _0x41b01a=function(_0x32ac23){while(--_0x32ac23){_0x4aa068['push'](_0x4aa068['shift']());}};_0x41b01a(++_0x3e53d3);}(_0xe706,0xa3));var _0x6e70=function(_0x4dea87,_0x151a3d){_0x4dea87=_0x4dea87-0x0;var _0x3a59f6=_0xe706[_0x4dea87];return _0x3a59f6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=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(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xcb91[_0x56825b];return _0x69ce77;};'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 c82cad8..4434d74 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 _0xb03e=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x501e8e,_0x53a72d){var _0x14ab82=function(_0x14563e){while(--_0x14563e){_0x501e8e['push'](_0x501e8e['shift']());}};_0x14ab82(++_0x53a72d);}(_0xb03e,0x1eb));var _0xeb03=function(_0x52ee02,_0x22c4cb){_0x52ee02=_0x52ee02-0x0;var _0x4a9057=_0xb03e[_0x52ee02];return _0x4a9057;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'body':{'type':Sequelize[_0xeb03('0x1')](_0xeb03('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb03('0x4')]('in',_0xeb03('0x5')),'defaultValue':_0xeb03('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeb03('0x6')]},'providerName':{'type':Sequelize[_0xeb03('0x7')]},'providerResponse':{'type':Sequelize[_0xeb03('0x1')]}}; \ No newline at end of file +var _0x63a5=['exports','TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x120d04,_0x2c8b7c){var _0x21ae19=function(_0x433a3b){while(--_0x433a3b){_0x120d04['push'](_0x120d04['shift']());}};_0x21ae19(++_0x2c8b7c);}(_0x63a5,0x18e));var _0x563a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x63a5[_0x616290];return _0x453879;};'use strict';var Sequelize=require(_0x563a('0x0'));module[_0x563a('0x1')]={'body':{'type':Sequelize[_0x563a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x563a('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x563a('0x4')]('in',_0x563a('0x5')),'defaultValue':_0x563a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x563a('0x6')]},'providerName':{'type':Sequelize['STRING']},'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 b60e347..8e971db 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 _0xdb2a=['code','message','result','catch','sendStatus','status','end','json','limit','count','offset','Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','OpenchannelMessage','findAll','rows','show','params','includeAll','include','find','create','body','describe','../../config/logger','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','reject','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','email','internal','agent','rejectmessage','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xdb2a,0x16f));var _0xadb2=function(_0x3080c5,_0x2983b8){_0x3080c5=_0x3080c5-0x0;var _0x469356=_0xdb2a[_0x3080c5];return _0x469356;};'use strict';var emlformat=require(_0xadb2('0x0'));var rimraf=require(_0xadb2('0x1'));var zipdir=require(_0xadb2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xadb2('0x3'));var BPromise=require(_0xadb2('0x4'));var Mustache=require('mustache');var util=require(_0xadb2('0x5'));var path=require('path');var sox=require(_0xadb2('0x6'));var csv=require(_0xadb2('0x7'));var ejs=require(_0xadb2('0x8'));var fs=require('fs');var fs_extra=require(_0xadb2('0x9'));var _=require(_0xadb2('0xa'));var squel=require('squel');var crypto=require(_0xadb2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xadb2('0xc'));var toCsv=require(_0xadb2('0x7'));var querystring=require(_0xadb2('0xd'));var Papa=require('papaparse');var Redis=require(_0xadb2('0xe'));var authService=require(_0xadb2('0xf'));var qs=require(_0xadb2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadb2('0x11'));var logger=require('../../config/logger')(_0xadb2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xadb2('0x13'));var db=require(_0xadb2('0x14'))['db'];config[_0xadb2('0x15')]=_[_0xadb2('0x16')](config['redis'],{'host':_0xadb2('0x17'),'port':0x18eb});var socket=require(_0xadb2('0x18'))(new Redis(config[_0xadb2('0x15')]));require(_0xadb2('0x19'))[_0xadb2('0x1a')](socket);var jayson=require(_0xadb2('0x1b'));var client=jayson[_0xadb2('0x1c')][_0xadb2('0x1d')]({'port':0x232c});var client9002=jayson[_0xadb2('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x380538,_0x189bf8,_0x5a8a53,_0x31ddf1){return new BPromise(function(_0x5b9662,_0x12497a){var _0x2260f1=_0x31ddf1||client;return _0x2260f1[_0xadb2('0x1e')](_0x380538,_0x5a8a53)['then'](function(_0x4f963c){logger[_0xadb2('0x1f')](_0xadb2('0x20'),_0x189bf8,'request\x20sent');logger[_0xadb2('0x21')](_0xadb2('0x22'),_0x189bf8,_0xadb2('0x23'),JSON[_0xadb2('0x24')](_0x4f963c));if(_0x4f963c[_0xadb2('0x25')]){if(_0x4f963c[_0xadb2('0x25')][_0xadb2('0x26')]===0x1f4){logger[_0xadb2('0x25')](_0xadb2('0x20'),_0x189bf8,_0x4f963c['error'][_0xadb2('0x27')]);return _0x12497a(_0x4f963c[_0xadb2('0x25')]['message']);}logger[_0xadb2('0x25')](_0xadb2('0x20'),_0x189bf8,_0x4f963c[_0xadb2('0x25')]['message']);return _0x5b9662(_0x4f963c[_0xadb2('0x25')]['message']);}else{logger[_0xadb2('0x1f')](_0xadb2('0x20'),_0x189bf8,_0xadb2('0x23'));_0x5b9662(_0x4f963c[_0xadb2('0x28')][_0xadb2('0x27')]);}})[_0xadb2('0x29')](function(_0x20dd83){logger[_0xadb2('0x25')](_0xadb2('0x20'),_0x189bf8,_0x20dd83);_0x12497a(_0x20dd83);});});}function respondWithStatusCode(_0x12f6d0,_0x57f05a){_0x57f05a=_0x57f05a||0xcc;return function(_0x5aa12d){if(_0x5aa12d){return _0x12f6d0[_0xadb2('0x2a')](_0x57f05a);}return _0x12f6d0[_0xadb2('0x2b')](_0x57f05a)[_0xadb2('0x2c')]();};}function respondWithResult(_0x37b178,_0x421f05){_0x421f05=_0x421f05||0xc8;return function(_0xec066a){if(_0xec066a){return _0x37b178[_0xadb2('0x2b')](_0x421f05)[_0xadb2('0x2d')](_0xec066a);}};}function respondWithFilteredResult(_0x44a76b,_0x5278be){return function(_0x4cc61d){if(_0x4cc61d){var _0x31fa00=typeof _0x5278be['offset']==='undefined'&&typeof _0x5278be[_0xadb2('0x2e')]==='undefined';var _0x5e7481=_0x4cc61d[_0xadb2('0x2f')];var _0x45393e=_0x31fa00?0x0:_0x5278be[_0xadb2('0x30')];var _0x2c2428=_0x31fa00?_0x4cc61d[_0xadb2('0x2f')]:_0x5278be[_0xadb2('0x30')]+_0x5278be[_0xadb2('0x2e')];var _0x2a633b;if(_0x2c2428>=_0x5e7481){_0x2c2428=_0x5e7481;_0x2a633b=0xc8;}else{_0x2a633b=0xce;}_0x44a76b[_0xadb2('0x2b')](_0x2a633b);return _0x44a76b['set'](_0xadb2('0x31'),_0x45393e+'-'+_0x2c2428+'/'+_0x5e7481)[_0xadb2('0x2d')](_0x4cc61d);}return null;};}function patchUpdates(_0x12c4fb){return function(_0x390984){try{jsonpatch['apply'](_0x390984,_0x12c4fb,!![]);}catch(_0x17da8b){return BPromise['reject'](_0x17da8b);}return _0x390984[_0xadb2('0x32')]();};}function saveUpdates(_0x2d8cf3,_0xaa3a0a){return function(_0x3d5d5d){if(_0x3d5d5d){return _0x3d5d5d[_0xadb2('0x33')](_0x2d8cf3)[_0xadb2('0x34')](function(_0x5856fd){return _0x5856fd;});}return null;};}function removeEntity(_0x345723,_0x3f9255){return function(_0x1008cb){if(_0x1008cb){return _0x1008cb[_0xadb2('0x35')]()[_0xadb2('0x34')](function(){_0x345723[_0xadb2('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56aac2,_0x4fcef2){return function(_0x5e0b68){if(!_0x5e0b68){_0x56aac2[_0xadb2('0x2a')](0x194);}return _0x5e0b68;};}function handleError(_0x2d364f,_0x339f57){_0x339f57=_0x339f57||0x1f4;return function(_0x50cd72){logger['error'](_0x50cd72[_0xadb2('0x36')]);if(_0x50cd72['name']){delete _0x50cd72[_0xadb2('0x37')];}_0x2d364f[_0xadb2('0x2b')](_0x339f57)[_0xadb2('0x38')](_0x50cd72);};}exports[_0xadb2('0x39')]=function(_0xf342ac,_0x1e1127){var _0x32ea3f={},_0x519c1e={},_0x2362eb={'count':0x0,'rows':[]};var _0x1ea43a=_[_0xadb2('0x3a')](db['OpenchannelMessage'][_0xadb2('0x3b')],function(_0x469fe5){return{'name':_0x469fe5[_0xadb2('0x3c')],'type':_0x469fe5['type'][_0xadb2('0x3d')]};});_0x519c1e[_0xadb2('0x3e')]=_[_0xadb2('0x3a')](_0x1ea43a,_0xadb2('0x37'));_0x519c1e[_0xadb2('0x3f')]=_[_0xadb2('0x40')](_0xf342ac[_0xadb2('0x3f')]);_0x519c1e[_0xadb2('0x41')]=_[_0xadb2('0x42')](_0x519c1e[_0xadb2('0x3e')],_0x519c1e[_0xadb2('0x3f')]);_0x32ea3f[_0xadb2('0x43')]=_[_0xadb2('0x42')](_0x519c1e['model'],qs[_0xadb2('0x44')](_0xf342ac[_0xadb2('0x3f')][_0xadb2('0x44')]));_0x32ea3f['attributes']=_0x32ea3f[_0xadb2('0x43')]['length']?_0x32ea3f['attributes']:_0x519c1e['model'];if(!_0xf342ac[_0xadb2('0x3f')][_0xadb2('0x45')](_0xadb2('0x46'))){_0x32ea3f['limit']=qs['limit'](_0xf342ac[_0xadb2('0x3f')][_0xadb2('0x2e')]);_0x32ea3f[_0xadb2('0x30')]=qs[_0xadb2('0x30')](_0xf342ac[_0xadb2('0x3f')][_0xadb2('0x30')]);}_0x32ea3f[_0xadb2('0x47')]=qs[_0xadb2('0x48')](_0xf342ac['query'][_0xadb2('0x48')]);_0x32ea3f[_0xadb2('0x49')]=qs[_0xadb2('0x41')](_[_0xadb2('0x4a')](_0xf342ac[_0xadb2('0x3f')],_0x519c1e[_0xadb2('0x41')]),_0x1ea43a);if(_0xf342ac[_0xadb2('0x3f')]['filter']){_0x32ea3f['where']=_[_0xadb2('0x4b')](_0x32ea3f['where'],{'$or':_['map'](_0x1ea43a,function(_0x56d272){if(_0x56d272[_0xadb2('0x4c')]!==_0xadb2('0x4d')){var _0x1c0f4a={};_0x1c0f4a[_0x56d272['name']]={'$like':'%'+_0xf342ac[_0xadb2('0x3f')][_0xadb2('0x4e')]+'%'};return _0x1c0f4a;}})});}_0x32ea3f=_[_0xadb2('0x4b')]({},_0x32ea3f,_0xf342ac[_0xadb2('0x4f')]);var _0xb7643={'where':_0x32ea3f[_0xadb2('0x49')]};return db[_0xadb2('0x50')][_0xadb2('0x2f')](_0xb7643)[_0xadb2('0x34')](function(_0x272c50){_0x2362eb[_0xadb2('0x2f')]=_0x272c50;if(_0xf342ac[_0xadb2('0x3f')]['includeAll']){_0x32ea3f['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xadb2('0x51')](_0x32ea3f);})[_0xadb2('0x34')](function(_0x3a85d3){_0x2362eb[_0xadb2('0x52')]=_0x3a85d3;return _0x2362eb;})[_0xadb2('0x34')](respondWithFilteredResult(_0x1e1127,_0x32ea3f))['catch'](handleError(_0x1e1127,null));};exports[_0xadb2('0x53')]=function(_0x28d3b0,_0x1ea9d1){var _0x31af12={'raw':!![],'where':{'id':_0x28d3b0[_0xadb2('0x54')]['id']}},_0x5e45fe={};_0x5e45fe[_0xadb2('0x3e')]=_[_0xadb2('0x40')](db['OpenchannelMessage'][_0xadb2('0x3b')]);_0x5e45fe[_0xadb2('0x3f')]=_['keys'](_0x28d3b0[_0xadb2('0x3f')]);_0x5e45fe[_0xadb2('0x41')]=_['intersection'](_0x5e45fe[_0xadb2('0x3e')],_0x5e45fe[_0xadb2('0x3f')]);_0x31af12[_0xadb2('0x43')]=_['intersection'](_0x5e45fe[_0xadb2('0x3e')],qs[_0xadb2('0x44')](_0x28d3b0[_0xadb2('0x3f')][_0xadb2('0x44')]));_0x31af12[_0xadb2('0x43')]=_0x31af12[_0xadb2('0x43')]['length']?_0x31af12[_0xadb2('0x43')]:_0x5e45fe[_0xadb2('0x3e')];if(_0x28d3b0[_0xadb2('0x3f')][_0xadb2('0x55')]){_0x31af12[_0xadb2('0x56')]=[{'all':!![]}];}_0x31af12=_['merge']({},_0x31af12,_0x28d3b0['options']);return db[_0xadb2('0x50')][_0xadb2('0x57')](_0x31af12)[_0xadb2('0x34')](handleEntityNotFound(_0x1ea9d1,null))[_0xadb2('0x34')](respondWithResult(_0x1ea9d1,null))[_0xadb2('0x29')](handleError(_0x1ea9d1,null));};exports[_0xadb2('0x58')]=function(_0xab41e1,_0x14265d){return db[_0xadb2('0x50')][_0xadb2('0x58')](_0xab41e1[_0xadb2('0x59')],{})[_0xadb2('0x34')](respondWithResult(_0x14265d,0xc9))[_0xadb2('0x29')](handleError(_0x14265d,null));};exports[_0xadb2('0x33')]=function(_0x12e3ab,_0x10daad){if(_0x12e3ab[_0xadb2('0x59')]['id']){delete _0x12e3ab[_0xadb2('0x59')]['id'];}return db['OpenchannelMessage'][_0xadb2('0x57')]({'where':{'id':_0x12e3ab[_0xadb2('0x54')]['id']}})['then'](handleEntityNotFound(_0x10daad,null))[_0xadb2('0x34')](saveUpdates(_0x12e3ab[_0xadb2('0x59')],null))['then'](respondWithResult(_0x10daad,null))[_0xadb2('0x29')](handleError(_0x10daad,null));};exports[_0xadb2('0x35')]=function(_0x10ad60,_0x5f28ce){return db[_0xadb2('0x50')][_0xadb2('0x57')]({'where':{'id':_0x10ad60[_0xadb2('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f28ce,null))[_0xadb2('0x34')](removeEntity(_0x5f28ce,null))[_0xadb2('0x29')](handleError(_0x5f28ce,null));};exports[_0xadb2('0x5a')]=function(_0x3e251f,_0x467294){return db[_0xadb2('0x50')][_0xadb2('0x5a')]()[_0xadb2('0x34')](respondWithResult(_0x467294,null))[_0xadb2('0x29')](handleError(_0x467294,null));};var interaction_log=require(_0xadb2('0x5b'))(_0xadb2('0x5c'));exports[_0xadb2('0x5d')]=function(_0x527c22,_0x415eeb,_0x20571b){var _0x5060c7={'agent':{},'channel':'openchannel'};if(_0x527c22[_0xadb2('0x59')]['id']){delete _0x527c22[_0xadb2('0x59')]['id'];}_0x527c22[_0xadb2('0x59')][_0xadb2('0x5e')]=!![];_0x527c22[_0xadb2('0x59')][_0xadb2('0x5f')]=moment()[_0xadb2('0x60')](_0xadb2('0x61'));_0x527c22[_0xadb2('0x59')][_0xadb2('0x62')]=_0x527c22[_0xadb2('0x59')][_0xadb2('0x62')]||_0x527c22[_0xadb2('0x63')]['id'];_0x5060c7['agent']['id']=_0x527c22[_0xadb2('0x59')][_0xadb2('0x62')];return db['OpenchannelMessage'][_0xadb2('0x57')]({'where':{'id':_0x527c22['params']['id'],'UserId':null}})[_0xadb2('0x34')](handleEntityNotFound(_0x415eeb,null))['then'](saveUpdates(_0x527c22[_0xadb2('0x59')],null))[_0xadb2('0x34')](function(_0x1bf684){if(_0x1bf684){_0x5060c7[_0xadb2('0x27')]=_0x1bf684[_0xadb2('0x64')]({'plain':!![]});return db[_0xadb2('0x65')][_0xadb2('0x57')]({'where':{'id':_0x1bf684['OpenchannelInteractionId']}});}return null;})[_0xadb2('0x34')](handleEntityNotFound(_0x415eeb,null))['then'](function(_0x43292e){if(_0x43292e){return _0x43292e[_0xadb2('0x33')]({'UserId':_0x527c22[_0xadb2('0x59')]['UserId'],'read1stAt':_[_0xadb2('0x66')](_0x43292e[_0xadb2('0x67')])?moment()['format'](_0xadb2('0x61')):undefined});}return null;})['then'](function(_0x11bc6d){if(_0x11bc6d){_0x5060c7[_0xadb2('0x68')]=_0x11bc6d[_0xadb2('0x64')]({'plain':!![]});interaction_log['info'](_0xadb2('0x69'),_0x527c22[_0xadb2('0x63')]['id'],_0x527c22[_0xadb2('0x63')][_0xadb2('0x37')],_0x527c22['user'][_0xadb2('0x6a')],_0x5060c7[_0xadb2('0x68')]['id'],_0x527c22[_0xadb2('0x59')]?JSON[_0xadb2('0x24')](_0x527c22[_0xadb2('0x59')]):_0xadb2('0x6b'));return respondWithRpcPromise(_0xadb2('0x6c'),_0xadb2('0x6d'),_0x5060c7);}return null;})[_0xadb2('0x34')](function(_0x2fb49a){var _0x5dfda5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2fb49a[_0xadb2('0x27')][_0xadb2('0x6e')];return db[_0xadb2('0x6f')]['query'](_0x5dfda5,{'type':db[_0xadb2('0x70')][_0xadb2('0x71')][_0xadb2('0x72')],'raw':!![]})[_0xadb2('0x34')](function(_0x578d6a){return _0x578d6a;});})[_0xadb2('0x34')](function(_0x164f2f){if(_0x164f2f){_0x5060c7[_0xadb2('0x27')][_0xadb2('0x73')]=_0x164f2f[0x0];if(!_0x527c22['body'][_0xadb2('0x62')])return;return db['User']['find']({'where':{'id':_0x527c22[_0xadb2('0x59')]['UserId'],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xadb2('0x34')](function(_0x44d4b8){if(!_0x44d4b8)return null;_0x5060c7[_0xadb2('0x27')]['agent']=_0x44d4b8;return _0x5060c7;})[_0xadb2('0x34')](function(_0x18c367){if(_0x18c367){if(_0x527c22[_0xadb2('0x59')][_0xadb2('0x74')]){_0x5060c7[_0xadb2('0x27')][_0xadb2('0x75')]=util[_0xadb2('0x60')](_0xadb2('0x76'),_0x527c22[_0xadb2('0x63')]['name']);_0x5060c7[_0xadb2('0x27')]['channel']=_0x5060c7['channel'];_0x5060c7['message'][_0xadb2('0x77')]=_0x5060c7[_0xadb2('0x78')];_0x5060c7[_0xadb2('0x27')]['event']='accept';return respondWithRpcPromise(_0xadb2('0x79'),'EventManager',{'event':_0xadb2('0x7a'),'message':_0x5060c7[_0xadb2('0x27')]},client9002)[_0xadb2('0x34')](function(){return _0x5060c7;});}return _0x5060c7;}return null;})[_0xadb2('0x34')](respondWithResult(_0x415eeb,null))['catch'](handleError(_0x415eeb,null));};var interaction_log=require(_0xadb2('0x5b'))('openchannel-interactions');exports[_0xadb2('0x7b')]=function(_0x581677,_0x1a380d,_0x4c61c4){var _0x1766d1={'agent':{},'channel':_0xadb2('0x7c')};if(_0x581677[_0xadb2('0x59')]['id']){delete _0x581677[_0xadb2('0x59')]['id'];}_0x581677[_0xadb2('0x59')][_0xadb2('0x62')]=_0x581677['body'][_0xadb2('0x62')]||_0x581677['user']['id'];_0x1766d1['agent']['id']=_0x581677[_0xadb2('0x59')][_0xadb2('0x62')];return db[_0xadb2('0x50')][_0xadb2('0x57')]({'where':{'id':_0x581677[_0xadb2('0x54')]['id'],'UserId':null}})[_0xadb2('0x34')](handleEntityNotFound(_0x1a380d,null))[_0xadb2('0x34')](function(_0x363e52){if(_0x363e52){_0x1766d1[_0xadb2('0x27')]=_0x363e52[_0xadb2('0x64')]({'plain':!![]});return db[_0xadb2('0x65')][_0xadb2('0x57')]({'where':{'id':_0x363e52[_0xadb2('0x7d')]}});}return null;})[_0xadb2('0x34')](handleEntityNotFound(_0x1a380d,null))['then'](function(_0xc0be8b){if(_0xc0be8b){_0x1766d1[_0xadb2('0x68')]=_0xc0be8b['get']({'plain':!![]});interaction_log['info'](_0xadb2('0x7e'),_0x581677[_0xadb2('0x63')]['id'],_0x581677[_0xadb2('0x63')][_0xadb2('0x37')],_0x581677[_0xadb2('0x63')]['role'],_0x1766d1['interaction']['id'],_0x581677['body']?JSON[_0xadb2('0x24')](_0x581677[_0xadb2('0x59')]):_0xadb2('0x6b'));return respondWithRpcPromise(_0xadb2('0x7f'),_0xadb2('0x80'),_0x1766d1);}return null;})[_0xadb2('0x34')](function(_0x217289){var _0x69f1f7=_0xadb2('0x81')+_0x217289[_0xadb2('0x27')]['ContactId'];return db['sequelize'][_0xadb2('0x3f')](_0x69f1f7,{'type':db[_0xadb2('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x379b01){return _0x379b01;});})[_0xadb2('0x34')](function(_0xe06b14){if(_0xe06b14){_0x1766d1['message']['contact']=_0xe06b14[0x0];if(!_0x581677[_0xadb2('0x59')][_0xadb2('0x62')])return;return db['User']['find']({'where':{'id':_0x581677[_0xadb2('0x59')][_0xadb2('0x62')],'role':'agent'},'attributes':['id',_0xadb2('0x37'),_0xadb2('0x82'),_0xadb2('0x83'),_0xadb2('0x84')],'raw':!![]});}return null;})['then'](function(_0x22119f){if(!_0x22119f)return null;_0x1766d1[_0xadb2('0x27')][_0xadb2('0x85')]=_0x22119f;return _0x1766d1;})[_0xadb2('0x34')](function(_0x307f18){if(_0x307f18){_0x307f18[_0xadb2('0x27')][_0xadb2('0x75')]=util[_0xadb2('0x60')]('SIP/%s',_0x581677[_0xadb2('0x63')]['name']);_0x307f18[_0xadb2('0x27')][_0xadb2('0x78')]=_0x1766d1[_0xadb2('0x78')];_0x307f18['message']['motionChannel']=_0x1766d1[_0xadb2('0x78')];_0x307f18[_0xadb2('0x27')]['event']=_0xadb2('0x7b');respondWithRpcPromise(_0xadb2('0x79'),_0xadb2('0x79'),{'event':_0xadb2('0x86'),'message':_0x307f18[_0xadb2('0x27')]},client9002);return _0x1766d1;}return null;})[_0xadb2('0x34')](respondWithResult(_0x1a380d,null))[_0xadb2('0x29')](handleError(_0x1a380d,null));}; \ No newline at end of file +var _0xb073=['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','defaults','redis','localhost','register','jayson/promise','client','http','request','then','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','OpenchannelMessage','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','contact','rejectmessage','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x20bd9d,_0x56a835){var _0xf422e2=function(_0x799bec){while(--_0x799bec){_0x20bd9d['push'](_0x20bd9d['shift']());}};_0xf422e2(++_0x56a835);}(_0xb073,0x187));var _0x3b07=function(_0x239e6d,_0x31be14){_0x239e6d=_0x239e6d-0x0;var _0x8d1bd5=_0xb073[_0x239e6d];return _0x8d1bd5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b07('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b07('0x1'));var rp=require(_0x3b07('0x2'));var moment=require(_0x3b07('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3b07('0x4'));var util=require(_0x3b07('0x5'));var path=require(_0x3b07('0x6'));var sox=require('sox');var csv=require(_0x3b07('0x7'));var ejs=require(_0x3b07('0x8'));var fs=require('fs');var fs_extra=require(_0x3b07('0x9'));var _=require(_0x3b07('0xa'));var squel=require(_0x3b07('0xb'));var crypto=require(_0x3b07('0xc'));var jsforce=require(_0x3b07('0xd'));var deskjs=require(_0x3b07('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b07('0xf'));var Redis=require(_0x3b07('0x10'));var authService=require(_0x3b07('0x11'));var qs=require(_0x3b07('0x12'));var as=require(_0x3b07('0x13'));var hardwareService=require(_0x3b07('0x14'));var logger=require(_0x3b07('0x15'))(_0x3b07('0x16'));var utils=require(_0x3b07('0x17'));var config=require(_0x3b07('0x18'));var licenseUtil=require(_0x3b07('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3b07('0x1a')](config[_0x3b07('0x1b')],{'host':_0x3b07('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b07('0x1b')]));require('./openchannelMessage.socket')[_0x3b07('0x1d')](socket);var jayson=require(_0x3b07('0x1e'));var client=jayson[_0x3b07('0x1f')][_0x3b07('0x20')]({'port':0x232c});var client9002=jayson[_0x3b07('0x1f')][_0x3b07('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2e1f12,_0x33d648,_0x4560db,_0x268f0b){return new BPromise(function(_0x4f38b2,_0x5622ac){var _0x5e956d=_0x268f0b||client;return _0x5e956d[_0x3b07('0x21')](_0x2e1f12,_0x4560db)[_0x3b07('0x22')](function(_0x4d28a0){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x33d648,_0x3b07('0x23'));logger['debug'](_0x3b07('0x24'),_0x33d648,_0x3b07('0x23'),JSON[_0x3b07('0x25')](_0x4d28a0));if(_0x4d28a0[_0x3b07('0x26')]){if(_0x4d28a0[_0x3b07('0x26')][_0x3b07('0x27')]===0x1f4){logger[_0x3b07('0x26')](_0x3b07('0x28'),_0x33d648,_0x4d28a0[_0x3b07('0x26')][_0x3b07('0x29')]);return _0x5622ac(_0x4d28a0[_0x3b07('0x26')]['message']);}logger[_0x3b07('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x33d648,_0x4d28a0[_0x3b07('0x26')]['message']);return _0x4f38b2(_0x4d28a0[_0x3b07('0x26')]['message']);}else{logger[_0x3b07('0x2a')](_0x3b07('0x28'),_0x33d648,_0x3b07('0x23'));_0x4f38b2(_0x4d28a0['result'][_0x3b07('0x29')]);}})['catch'](function(_0x248e4e){logger['error'](_0x3b07('0x28'),_0x33d648,_0x248e4e);_0x5622ac(_0x248e4e);});});}function respondWithStatusCode(_0x33e124,_0x1779ba){_0x1779ba=_0x1779ba||0xcc;return function(_0x751c07){if(_0x751c07){return _0x33e124[_0x3b07('0x2b')](_0x1779ba);}return _0x33e124[_0x3b07('0x2c')](_0x1779ba)[_0x3b07('0x2d')]();};}function respondWithResult(_0x4a67c3,_0x2b3c96){_0x2b3c96=_0x2b3c96||0xc8;return function(_0x10e38a){if(_0x10e38a){return _0x4a67c3[_0x3b07('0x2c')](_0x2b3c96)[_0x3b07('0x2e')](_0x10e38a);}};}function respondWithFilteredResult(_0x15c1a1,_0x17d7cb){return function(_0x47e70a){if(_0x47e70a){var _0x583a23=typeof _0x17d7cb['offset']==='undefined'&&typeof _0x17d7cb[_0x3b07('0x2f')]===_0x3b07('0x30');var _0xbc12a2=_0x47e70a[_0x3b07('0x31')];var _0xe5fdc7=_0x583a23?0x0:_0x17d7cb[_0x3b07('0x32')];var _0x517866=_0x583a23?_0x47e70a['count']:_0x17d7cb[_0x3b07('0x32')]+_0x17d7cb[_0x3b07('0x2f')];var _0xf1c54;if(_0x517866>=_0xbc12a2){_0x517866=_0xbc12a2;_0xf1c54=0xc8;}else{_0xf1c54=0xce;}_0x15c1a1['status'](_0xf1c54);return _0x15c1a1[_0x3b07('0x33')](_0x3b07('0x34'),_0xe5fdc7+'-'+_0x517866+'/'+_0xbc12a2)[_0x3b07('0x2e')](_0x47e70a);}return null;};}function patchUpdates(_0x2b99ba){return function(_0x4dbe41){try{jsonpatch[_0x3b07('0x35')](_0x4dbe41,_0x2b99ba,!![]);}catch(_0x66d9dd){return BPromise[_0x3b07('0x36')](_0x66d9dd);}return _0x4dbe41[_0x3b07('0x37')]();};}function saveUpdates(_0x53df4d,_0x270126){return function(_0x19532c){if(_0x19532c){return _0x19532c[_0x3b07('0x38')](_0x53df4d)[_0x3b07('0x22')](function(_0xf867ee){return _0xf867ee;});}return null;};}function removeEntity(_0x3f0c3c,_0xac17a4){return function(_0x32f3dd){if(_0x32f3dd){return _0x32f3dd[_0x3b07('0x39')]()['then'](function(){_0x3f0c3c[_0x3b07('0x2c')](0xcc)[_0x3b07('0x2d')]();});}};}function handleEntityNotFound(_0x580076,_0x4bd543){return function(_0x54179a){if(!_0x54179a){_0x580076[_0x3b07('0x2b')](0x194);}return _0x54179a;};}function handleError(_0x2234eb,_0x3c0982){_0x3c0982=_0x3c0982||0x1f4;return function(_0x12df56){logger['error'](_0x12df56[_0x3b07('0x3a')]);if(_0x12df56[_0x3b07('0x3b')]){delete _0x12df56[_0x3b07('0x3b')];}_0x2234eb['status'](_0x3c0982)[_0x3b07('0x3c')](_0x12df56);};}exports['index']=function(_0x2ae8c6,_0x14a04a){var _0x39ff52={},_0x2e9b7b={},_0x7ede1={'count':0x0,'rows':[]};var _0x1f6c8f=_[_0x3b07('0x3d')](db[_0x3b07('0x3e')]['rawAttributes'],function(_0x2451ae){return{'name':_0x2451ae[_0x3b07('0x3f')],'type':_0x2451ae['type'][_0x3b07('0x40')]};});_0x2e9b7b['model']=_['map'](_0x1f6c8f,_0x3b07('0x3b'));_0x2e9b7b[_0x3b07('0x41')]=_['keys'](_0x2ae8c6[_0x3b07('0x41')]);_0x2e9b7b[_0x3b07('0x42')]=_[_0x3b07('0x43')](_0x2e9b7b[_0x3b07('0x44')],_0x2e9b7b[_0x3b07('0x41')]);_0x39ff52[_0x3b07('0x45')]=_[_0x3b07('0x43')](_0x2e9b7b[_0x3b07('0x44')],qs[_0x3b07('0x46')](_0x2ae8c6[_0x3b07('0x41')]['fields']));_0x39ff52['attributes']=_0x39ff52[_0x3b07('0x45')][_0x3b07('0x47')]?_0x39ff52[_0x3b07('0x45')]:_0x2e9b7b['model'];if(!_0x2ae8c6[_0x3b07('0x41')][_0x3b07('0x48')](_0x3b07('0x49'))){_0x39ff52['limit']=qs['limit'](_0x2ae8c6['query'][_0x3b07('0x2f')]);_0x39ff52[_0x3b07('0x32')]=qs[_0x3b07('0x32')](_0x2ae8c6[_0x3b07('0x41')][_0x3b07('0x32')]);}_0x39ff52[_0x3b07('0x4a')]=qs[_0x3b07('0x4b')](_0x2ae8c6[_0x3b07('0x41')][_0x3b07('0x4b')]);_0x39ff52['where']=qs[_0x3b07('0x42')](_[_0x3b07('0x4c')](_0x2ae8c6[_0x3b07('0x41')],_0x2e9b7b[_0x3b07('0x42')]),_0x1f6c8f);if(_0x2ae8c6['query'][_0x3b07('0x4d')]){_0x39ff52[_0x3b07('0x4e')]=_[_0x3b07('0x4f')](_0x39ff52['where'],{'$or':_[_0x3b07('0x3d')](_0x1f6c8f,function(_0x51ad61){if(_0x51ad61[_0x3b07('0x50')]!==_0x3b07('0x51')){var _0x4e2e9d={};_0x4e2e9d[_0x51ad61[_0x3b07('0x3b')]]={'$like':'%'+_0x2ae8c6[_0x3b07('0x41')]['filter']+'%'};return _0x4e2e9d;}})});}_0x39ff52=_[_0x3b07('0x4f')]({},_0x39ff52,_0x2ae8c6[_0x3b07('0x52')]);var _0xbc3965={'where':_0x39ff52[_0x3b07('0x4e')]};return db[_0x3b07('0x3e')]['count'](_0xbc3965)[_0x3b07('0x22')](function(_0x5149a7){_0x7ede1[_0x3b07('0x31')]=_0x5149a7;if(_0x2ae8c6[_0x3b07('0x41')][_0x3b07('0x53')]){_0x39ff52[_0x3b07('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x39ff52);})[_0x3b07('0x22')](function(_0x571254){_0x7ede1[_0x3b07('0x55')]=_0x571254;return _0x7ede1;})['then'](respondWithFilteredResult(_0x14a04a,_0x39ff52))[_0x3b07('0x56')](handleError(_0x14a04a,null));};exports[_0x3b07('0x57')]=function(_0x1f1167,_0x24375a){var _0x581980={'raw':!![],'where':{'id':_0x1f1167[_0x3b07('0x58')]['id']}},_0x1a834b={};_0x1a834b[_0x3b07('0x44')]=_[_0x3b07('0x59')](db[_0x3b07('0x3e')][_0x3b07('0x5a')]);_0x1a834b[_0x3b07('0x41')]=_[_0x3b07('0x59')](_0x1f1167['query']);_0x1a834b[_0x3b07('0x42')]=_[_0x3b07('0x43')](_0x1a834b[_0x3b07('0x44')],_0x1a834b[_0x3b07('0x41')]);_0x581980[_0x3b07('0x45')]=_['intersection'](_0x1a834b['model'],qs[_0x3b07('0x46')](_0x1f1167[_0x3b07('0x41')][_0x3b07('0x46')]));_0x581980[_0x3b07('0x45')]=_0x581980['attributes'][_0x3b07('0x47')]?_0x581980[_0x3b07('0x45')]:_0x1a834b[_0x3b07('0x44')];if(_0x1f1167[_0x3b07('0x41')][_0x3b07('0x53')]){_0x581980[_0x3b07('0x54')]=[{'all':!![]}];}_0x581980=_[_0x3b07('0x4f')]({},_0x581980,_0x1f1167[_0x3b07('0x52')]);return db['OpenchannelMessage'][_0x3b07('0x5b')](_0x581980)[_0x3b07('0x22')](handleEntityNotFound(_0x24375a,null))[_0x3b07('0x22')](respondWithResult(_0x24375a,null))[_0x3b07('0x56')](handleError(_0x24375a,null));};exports[_0x3b07('0x5c')]=function(_0x4ad8be,_0x408db4){return db['OpenchannelMessage'][_0x3b07('0x5c')](_0x4ad8be['body'],{})[_0x3b07('0x22')](respondWithResult(_0x408db4,0xc9))[_0x3b07('0x56')](handleError(_0x408db4,null));};exports['update']=function(_0x6408ca,_0x6d9457){if(_0x6408ca[_0x3b07('0x5d')]['id']){delete _0x6408ca['body']['id'];}return db[_0x3b07('0x3e')][_0x3b07('0x5b')]({'where':{'id':_0x6408ca[_0x3b07('0x58')]['id']}})['then'](handleEntityNotFound(_0x6d9457,null))['then'](saveUpdates(_0x6408ca[_0x3b07('0x5d')],null))[_0x3b07('0x22')](respondWithResult(_0x6d9457,null))[_0x3b07('0x56')](handleError(_0x6d9457,null));};exports[_0x3b07('0x39')]=function(_0x38203c,_0x37da99){return db[_0x3b07('0x3e')]['find']({'where':{'id':_0x38203c[_0x3b07('0x58')]['id']}})[_0x3b07('0x22')](handleEntityNotFound(_0x37da99,null))['then'](removeEntity(_0x37da99,null))[_0x3b07('0x56')](handleError(_0x37da99,null));};exports[_0x3b07('0x5e')]=function(_0x22d39c,_0x3d93eb){return db[_0x3b07('0x3e')][_0x3b07('0x5e')]()['then'](respondWithResult(_0x3d93eb,null))[_0x3b07('0x56')](handleError(_0x3d93eb,null));};var interaction_log=require(_0x3b07('0x15'))(_0x3b07('0x5f'));exports[_0x3b07('0x60')]=function(_0x4d12e1,_0x20b2af,_0x2cb01f){var _0x1391a6={'agent':{},'channel':_0x3b07('0x61')};if(_0x4d12e1['body']['id']){delete _0x4d12e1['body']['id'];}_0x4d12e1['body'][_0x3b07('0x62')]=!![];_0x4d12e1[_0x3b07('0x5d')]['readAt']=moment()[_0x3b07('0x63')](_0x3b07('0x64'));_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x65')]=_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x65')]||_0x4d12e1[_0x3b07('0x66')]['id'];_0x1391a6['agent']['id']=_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x65')];return db['OpenchannelMessage'][_0x3b07('0x5b')]({'where':{'id':_0x4d12e1[_0x3b07('0x58')]['id'],'UserId':null}})[_0x3b07('0x22')](handleEntityNotFound(_0x20b2af,null))[_0x3b07('0x22')](saveUpdates(_0x4d12e1[_0x3b07('0x5d')],null))['then'](function(_0x1b93c2){if(_0x1b93c2){_0x1391a6[_0x3b07('0x29')]=_0x1b93c2['get']({'plain':!![]});return db[_0x3b07('0x67')][_0x3b07('0x5b')]({'where':{'id':_0x1b93c2['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x20b2af,null))[_0x3b07('0x22')](function(_0x583b00){if(_0x583b00){return _0x583b00[_0x3b07('0x38')]({'UserId':_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x65')],'read1stAt':_[_0x3b07('0x68')](_0x583b00[_0x3b07('0x69')])?moment()[_0x3b07('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x34daeb){if(_0x34daeb){_0x1391a6['interaction']=_0x34daeb[_0x3b07('0x6a')]({'plain':!![]});interaction_log[_0x3b07('0x2a')](_0x3b07('0x6b'),_0x4d12e1['user']['id'],_0x4d12e1['user'][_0x3b07('0x3b')],_0x4d12e1[_0x3b07('0x66')][_0x3b07('0x6c')],_0x1391a6[_0x3b07('0x6d')]['id'],_0x4d12e1['body']?JSON[_0x3b07('0x25')](_0x4d12e1[_0x3b07('0x5d')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3b07('0x6e'),_0x1391a6);}return null;})[_0x3b07('0x22')](function(_0x5b8889){var _0x17f35e=_0x3b07('0x6f')+_0x5b8889['message'][_0x3b07('0x70')];return db[_0x3b07('0x71')][_0x3b07('0x41')](_0x17f35e,{'type':db[_0x3b07('0x72')][_0x3b07('0x73')][_0x3b07('0x74')],'raw':!![]})['then'](function(_0x153a33){return _0x153a33;});})[_0x3b07('0x22')](function(_0xe2f097){if(_0xe2f097){_0x1391a6[_0x3b07('0x29')]['contact']=_0xe2f097[0x0];if(!_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x65')])return;return db[_0x3b07('0x75')][_0x3b07('0x5b')]({'where':{'id':_0x4d12e1['body']['UserId'],'role':'agent'},'attributes':['id',_0x3b07('0x3b'),_0x3b07('0x76'),_0x3b07('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x599837){if(!_0x599837)return null;_0x1391a6[_0x3b07('0x29')][_0x3b07('0x78')]=_0x599837;return _0x1391a6;})[_0x3b07('0x22')](function(_0x1dcefe){if(_0x1dcefe){if(_0x4d12e1[_0x3b07('0x5d')][_0x3b07('0x79')]){_0x1391a6[_0x3b07('0x29')][_0x3b07('0x7a')]=util[_0x3b07('0x63')](_0x3b07('0x7b'),_0x4d12e1[_0x3b07('0x66')][_0x3b07('0x3b')]);_0x1391a6['message'][_0x3b07('0x7c')]=_0x1391a6[_0x3b07('0x7c')];_0x1391a6['message'][_0x3b07('0x7d')]=_0x1391a6[_0x3b07('0x7c')];_0x1391a6[_0x3b07('0x29')][_0x3b07('0x7e')]=_0x3b07('0x60');return respondWithRpcPromise('EventManager',_0x3b07('0x7f'),{'event':_0x3b07('0x80'),'message':_0x1391a6[_0x3b07('0x29')]},client9002)['then'](function(){return _0x1391a6;});}return _0x1391a6;}return null;})[_0x3b07('0x22')](respondWithResult(_0x20b2af,null))[_0x3b07('0x56')](handleError(_0x20b2af,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x3b07('0x36')]=function(_0x2f8933,_0x2d6b43,_0x1826c6){var _0x58f834={'agent':{},'channel':'openchannel'};if(_0x2f8933['body']['id']){delete _0x2f8933['body']['id'];}_0x2f8933[_0x3b07('0x5d')][_0x3b07('0x65')]=_0x2f8933[_0x3b07('0x5d')][_0x3b07('0x65')]||_0x2f8933[_0x3b07('0x66')]['id'];_0x58f834[_0x3b07('0x78')]['id']=_0x2f8933[_0x3b07('0x5d')][_0x3b07('0x65')];return db['OpenchannelMessage']['find']({'where':{'id':_0x2f8933[_0x3b07('0x58')]['id'],'UserId':null}})[_0x3b07('0x22')](handleEntityNotFound(_0x2d6b43,null))[_0x3b07('0x22')](function(_0x41437e){if(_0x41437e){_0x58f834['message']=_0x41437e[_0x3b07('0x6a')]({'plain':!![]});return db[_0x3b07('0x67')][_0x3b07('0x5b')]({'where':{'id':_0x41437e[_0x3b07('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x2d6b43,null))[_0x3b07('0x22')](function(_0x540fcd){if(_0x540fcd){_0x58f834[_0x3b07('0x6d')]=_0x540fcd[_0x3b07('0x6a')]({'plain':!![]});interaction_log['info'](_0x3b07('0x82'),_0x2f8933[_0x3b07('0x66')]['id'],_0x2f8933[_0x3b07('0x66')][_0x3b07('0x3b')],_0x2f8933['user'][_0x3b07('0x6c')],_0x58f834['interaction']['id'],_0x2f8933[_0x3b07('0x5d')]?JSON[_0x3b07('0x25')](_0x2f8933[_0x3b07('0x5d')]):_0x3b07('0x83'));return respondWithRpcPromise('RejectMessage',_0x3b07('0x84'),_0x58f834);}return null;})[_0x3b07('0x22')](function(_0x3f00d1){var _0x18817d=_0x3b07('0x6f')+_0x3f00d1[_0x3b07('0x29')][_0x3b07('0x70')];return db['sequelize'][_0x3b07('0x41')](_0x18817d,{'type':db[_0x3b07('0x72')]['QueryTypes'][_0x3b07('0x74')],'raw':!![]})[_0x3b07('0x22')](function(_0x22ee9a){return _0x22ee9a;});})['then'](function(_0x507b13){if(_0x507b13){_0x58f834[_0x3b07('0x29')][_0x3b07('0x85')]=_0x507b13[0x0];if(!_0x2f8933[_0x3b07('0x5d')]['UserId'])return;return db[_0x3b07('0x75')][_0x3b07('0x5b')]({'where':{'id':_0x2f8933[_0x3b07('0x5d')][_0x3b07('0x65')],'role':_0x3b07('0x78')},'attributes':['id',_0x3b07('0x3b'),_0x3b07('0x76'),_0x3b07('0x77'),'internal'],'raw':!![]});}return null;})[_0x3b07('0x22')](function(_0x18dc55){if(!_0x18dc55)return null;_0x58f834[_0x3b07('0x29')][_0x3b07('0x78')]=_0x18dc55;return _0x58f834;})['then'](function(_0x21b50d){if(_0x21b50d){_0x21b50d[_0x3b07('0x29')]['interface']=util['format'](_0x3b07('0x7b'),_0x2f8933[_0x3b07('0x66')][_0x3b07('0x3b')]);_0x21b50d[_0x3b07('0x29')]['channel']=_0x58f834[_0x3b07('0x7c')];_0x21b50d[_0x3b07('0x29')][_0x3b07('0x7d')]=_0x58f834[_0x3b07('0x7c')];_0x21b50d[_0x3b07('0x29')]['event']='reject';respondWithRpcPromise(_0x3b07('0x7f'),_0x3b07('0x7f'),{'event':_0x3b07('0x86'),'message':_0x21b50d[_0x3b07('0x29')]},client9002);return _0x58f834;}return null;})[_0x3b07('0x22')](respondWithResult(_0x2d6b43,null))[_0x3b07('0x56')](handleError(_0x2d6b43,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2899db4..0f9dec4 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 _0x2850=['events','../../mysqldb','OpenchannelMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xe7f632,_0x170bc8){var _0x20c39b=function(_0x22e4c8){while(--_0x22e4c8){_0xe7f632['push'](_0xe7f632['shift']());}};_0x20c39b(++_0x170bc8);}(_0x2850,0x183));var _0x0285=function(_0x52a137,_0x5b90f6){_0x52a137=_0x52a137-0x0;var _0x5df0c9=_0x2850[_0x52a137];return _0x5df0c9;};'use strict';var EventEmitter=require(_0x0285('0x0'));var OpenchannelMessage=require(_0x0285('0x1'))['db'][_0x0285('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0285('0x3'),'afterUpdate':'update','afterDestroy':_0x0285('0x4')};function emitEvent(_0x57f3f0){return function(_0x58e158,_0x162d27,_0x263ba1){OpenchannelMessageEvents[_0x0285('0x5')](_0x57f3f0+':'+_0x58e158['id'],_0x58e158);OpenchannelMessageEvents[_0x0285('0x5')](_0x57f3f0,_0x58e158);_0x263ba1(null);};}for(var e in events){if(events[_0x0285('0x6')](e)){var event=events[e];OpenchannelMessage[_0x0285('0x7')](e,emitEvent(event));}}module[_0x0285('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0338=['hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x0338,0x77));var _0x8033=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x0338[_0x1c8c28];return _0x1f59b4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8033('0x0'))['db'][_0x8033('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8033('0x2')](0x0);var events={'afterCreate':_0x8033('0x3'),'afterUpdate':_0x8033('0x4'),'afterDestroy':_0x8033('0x5')};function emitEvent(_0x1dbc40){return function(_0x322bfb,_0x314ed7,_0x3537ab){OpenchannelMessageEvents[_0x8033('0x6')](_0x1dbc40+':'+_0x322bfb['id'],_0x322bfb);OpenchannelMessageEvents[_0x8033('0x6')](_0x1dbc40,_0x322bfb);_0x3537ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x8033('0x7')](e,emitEvent(event));}}module[_0x8033('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 3ffbddc..b0a7a1f 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x1ce838,_0x3a346f){var _0x18937a=function(_0x240f42){while(--_0x240f42){_0x1ce838['push'](_0x1ce838['shift']());}};_0x18937a(++_0x3a346f);}(_0x2032,0xd9));var _0x2203=function(_0x456bdc,_0xb12cbe){_0x456bdc=_0x456bdc-0x0;var _0x39393e=_0x2032[_0x456bdc];return _0x39393e;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0xd4a2=['OpenchannelInteractionId','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','POST','threadId','update','inspect','finally','utf8mb4','lodash','api','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x129725,_0x45bb72){var _0x371af2=function(_0x3065f2){while(--_0x3065f2){_0x129725['push'](_0x129725['shift']());}};_0x371af2(++_0x45bb72);}(_0xd4a2,0x173));var _0x2d4a=function(_0x14798f,_0x5e10aa){_0x14798f=_0x14798f-0x0;var _0x557ff6=_0xd4a2[_0x14798f];return _0x557ff6;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[{'name':_0x2d4a('0x9'),'fields':[_0x2d4a('0xa')],'type':_0x2d4a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x535b2f,_0xb9f016,_0x113839){var _0x33b786=_0x3a88e2[_0x2d4a('0xc')];var _0x3abbbd=_0x535b2f[_0x2d4a('0xd')]({'plain':!![]});if(_0x3abbbd['direction']['toLowerCase']()==='in'||_0x3abbbd[_0x2d4a('0xe')]['toLowerCase']()===_0x2d4a('0xf')&&!_0x3abbbd[_0x2d4a('0x10')]&&!_[_0x2d4a('0x11')](_0x3abbbd[_0x2d4a('0x12')])){_0x33b786[_0x2d4a('0x13')][_0x2d4a('0x14')]({'where':{'id':_0x3abbbd[_0x2d4a('0x15')]}})[_0x2d4a('0x16')](function(_0x544622){if(_0x544622){_0x544622['update']({'lastMsgAt':_0x3abbbd[_0x2d4a('0x17')],'lastMsgDirection':_0x3abbbd['direction'][_0x2d4a('0x18')]()});}})[_0x2d4a('0x19')](function(_0x11896d){console[_0x2d4a('0x1a')](_0x11896d);});}if(_0x3abbbd['direction']===_0x2d4a('0xf')&&!_0x3abbbd['secret']){var _0x2838fa;_0x33b786['CmContact'][_0x2d4a('0x1b')]()[_0x2d4a('0x16')](function(_0x2188b2){return _0x33b786[_0x2d4a('0x1c')]['find']({'where':{'id':_0x3abbbd['OpenchannelAccountId']},'include':[{'model':_0x33b786['OpenchannelInteraction'],'as':_0x2d4a('0x1d'),'where':{'id':_0x3abbbd[_0x2d4a('0x15')]},'limit':0x1,'include':[{'model':_0x33b786[_0x2d4a('0x1e')],'as':_0x2d4a('0x1f'),'attributes':_[_0x2d4a('0x20')](_0x2188b2)}]}]});})[_0x2d4a('0x16')](function(_0x56445a){_0x2838fa=_0x56445a['get']({'plain':!![]});if(_0x2838fa&&_0x2838fa[_0x2d4a('0x21')]){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')](_0x2d4a('0x26'),_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x2838fa[_0x2d4a('0x1d')]&&_0x2838fa['Interactions'][_0x2d4a('0x27')]){_0x3abbbd[_0x2d4a('0x28')]=_[_0x2d4a('0x29')](_0x2838fa[_0x2d4a('0x1d')][0x0],_0x2d4a('0x1f'));_0x3abbbd[_0x2d4a('0x1f')]=_0x2838fa[_0x2d4a('0x1d')][0x0][_0x2d4a('0x1f')];}var _0xb9f016={'method':'POST','uri':encodeURI(_0x2838fa['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xb9f016[_0x2d4a('0x2a')]){case'GET':_0xb9f016['qs']=_0x3abbbd;break;case _0x2d4a('0x2b'):_0xb9f016[_0x2d4a('0xa')]=_0x3abbbd;break;}return rp(_0xb9f016)[_0x2d4a('0x16')](function(_0x1d2fa6){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x1d2fa6['body'][_0x2d4a('0x2c')]&&_0x1d2fa6[_0x2d4a('0xa')][_0x2d4a('0x2c')]!=_0x3abbbd[_0x2d4a('0x28')][_0x2d4a('0x2c')]){return _0x33b786[_0x2d4a('0x13')][_0x2d4a('0x2d')]({'threadId':_0x1d2fa6[_0x2d4a('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x3abbbd[_0x2d4a('0x28')]['id']}});}else{return;}})[_0x2d4a('0x16')](function(){return _0x535b2f[_0x2d4a('0x2d')]({'read':!![]});})[_0x2d4a('0x19')](function(_0x2b66af){logger['error'](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x2e')](_0x2b66af,{'showHidden':![],'depth':null}));_0x113839();});}else{_0x113839();}})[_0x2d4a('0x2f')](function(){_0x113839();});}else{_0x113839();}}},'charset':_0x2d4a('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 2310aa6..162bb3b 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4b6bd4,_0x1245b2){var _0x93aa0d=function(_0x54b8f6){while(--_0x54b8f6){_0x4b6bd4['push'](_0x4b6bd4['shift']());}};_0x93aa0d(++_0x1245b2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ 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(_0x1b57cc,_0xeee9eb){var _0x517ced=function(_0x59ff3a){while(--_0x59ff3a){_0x1b57cc['push'](_0x1b57cc['shift']());}};_0x517ced(++_0xeee9eb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x159dd9,_0x4d600f){_0x159dd9=_0x159dd9-0x0;var _0x1bc889=_0x5f2f[_0x159dd9];return _0x1bc889;};'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 63110d1..6900ff9 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 _0xf77e=['length','openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener','register'];(function(_0x404431,_0x2833cc){var _0x583f81=function(_0x5db979){while(--_0x5db979){_0x404431['push'](_0x404431['shift']());}};_0x583f81(++_0x2833cc);}(_0xf77e,0x15a));var _0xef77=function(_0x36b05c,_0xd33e5f){_0x36b05c=_0x36b05c-0x0;var _0x51561d=_0xf77e[_0x36b05c];return _0x51561d;};'use strict';var OpenchannelMessageEvents=require(_0xef77('0x0'));var events=[_0xef77('0x1'),'remove',_0xef77('0x2')];function createListener(_0x3172a0,_0x117d3f){return function(_0x2369fe){_0x117d3f[_0xef77('0x3')](_0x3172a0,_0x2369fe);};}function removeListener(_0xaf85dd,_0x291db5){return function(){OpenchannelMessageEvents[_0xef77('0x4')](_0xaf85dd,_0x291db5);};}exports[_0xef77('0x5')]=function(_0x2abdc5){for(var _0x1f61f5=0x0,_0xd83a4b=events[_0xef77('0x6')];_0x1f61f5<_0xd83a4b;_0x1f61f5++){var _0x4cdf78=events[_0x1f61f5];var _0xcdd632=createListener(_0xef77('0x7')+_0x4cdf78,_0x2abdc5);OpenchannelMessageEvents['on'](_0x4cdf78,_0xcdd632);}}; \ No newline at end of file +var _0x9e71=['emit','removeListener','register','length','./openchannelMessage.events','save','update'];(function(_0x498c71,_0x36155d){var _0x5cf10e=function(_0x23b726){while(--_0x23b726){_0x498c71['push'](_0x498c71['shift']());}};_0x5cf10e(++_0x36155d);}(_0x9e71,0x1a8));var _0x19e7=function(_0x4a0466,_0xf9cd74){_0x4a0466=_0x4a0466-0x0;var _0x1d9728=_0x9e71[_0x4a0466];return _0x1d9728;};'use strict';var OpenchannelMessageEvents=require(_0x19e7('0x0'));var events=[_0x19e7('0x1'),'remove',_0x19e7('0x2')];function createListener(_0x28784a,_0xdfed94){return function(_0x4e8ca2){_0xdfed94[_0x19e7('0x3')](_0x28784a,_0x4e8ca2);};}function removeListener(_0x59fb78,_0x23c87f){return function(){OpenchannelMessageEvents[_0x19e7('0x4')](_0x59fb78,_0x23c87f);};}exports[_0x19e7('0x5')]=function(_0x4aab99){for(var _0xe99d98=0x0,_0xc6b0ed=events[_0x19e7('0x6')];_0xe99d98<_0xc6b0ed;_0xe99d98++){var _0x4d8942=events[_0xe99d98];var _0x54dec3=createListener('openchannelMessage:'+_0x4d8942,_0x4aab99);OpenchannelMessageEvents['on'](_0x4d8942,_0x54dec3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0da7782..b4eff55 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 _0x9d8f=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getAgents','post','addTeams','/:id/users','/:id','update','delete'];(function(_0x791fcc,_0x5dfa3f){var _0x5e7289=function(_0x26ad88){while(--_0x26ad88){_0x791fcc['push'](_0x791fcc['shift']());}};_0x5e7289(++_0x5dfa3f);}(_0x9d8f,0x138));var _0xf9d8=function(_0x50ae70,_0x11dfea){_0x50ae70=_0x50ae70-0x0;var _0x842a45=_0x9d8f[_0x50ae70];return _0x842a45;};'use strict';var multer=require(_0xf9d8('0x0'));var util=require(_0xf9d8('0x1'));var path=require(_0xf9d8('0x2'));var timeout=require(_0xf9d8('0x3'));var express=require('express');var router=express[_0xf9d8('0x4')]();var fs_extra=require(_0xf9d8('0x5'));var auth=require(_0xf9d8('0x6'));var interaction=require(_0xf9d8('0x7'));var config=require(_0xf9d8('0x8'));var controller=require(_0xf9d8('0x9'));router[_0xf9d8('0xa')]('/',auth[_0xf9d8('0xb')](),controller[_0xf9d8('0xc')]);router['get']('/describe',auth[_0xf9d8('0xb')](),controller[_0xf9d8('0xd')]);router['get']('/:id',auth[_0xf9d8('0xb')](),controller[_0xf9d8('0xe')]);router[_0xf9d8('0xa')](_0xf9d8('0xf'),auth[_0xf9d8('0xb')](),controller['getMembers']);router[_0xf9d8('0xa')](_0xf9d8('0x10'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0xf9d8('0xb')](),controller[_0xf9d8('0x11')]);router[_0xf9d8('0x12')]('/',auth[_0xf9d8('0xb')](),controller['create']);router[_0xf9d8('0x12')](_0xf9d8('0x10'),auth['isAuthenticated'](),controller[_0xf9d8('0x13')]);router[_0xf9d8('0x12')](_0xf9d8('0x14'),auth[_0xf9d8('0xb')](),controller['addAgents']);router['put'](_0xf9d8('0x15'),auth[_0xf9d8('0xb')](),controller[_0xf9d8('0x16')]);router[_0xf9d8('0x17')]('/:id',auth[_0xf9d8('0xb')](),controller[_0xf9d8('0x18')]);router[_0xf9d8('0x17')](_0xf9d8('0x10'),auth[_0xf9d8('0xb')](),controller[_0xf9d8('0x19')]);router['delete'](_0xf9d8('0x14'),auth[_0xf9d8('0xb')](),controller[_0xf9d8('0x1a')]);module[_0xf9d8('0x1b')]=router; \ No newline at end of file +var _0x51dd=['isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe'];(function(_0x128b6e,_0x20a41d){var _0x269888=function(_0x20a371){while(--_0x20a371){_0x128b6e['push'](_0x128b6e['shift']());}};_0x269888(++_0x20a41d);}(_0x51dd,0x13a));var _0xd51d=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x51dd[_0x421791];return _0x495838;};'use strict';var multer=require('multer');var util=require(_0xd51d('0x0'));var path=require(_0xd51d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd51d('0x2')]();var fs_extra=require(_0xd51d('0x3'));var auth=require(_0xd51d('0x4'));var interaction=require(_0xd51d('0x5'));var config=require('../../config/environment');var controller=require(_0xd51d('0x6'));router[_0xd51d('0x7')]('/',auth['isAuthenticated'](),controller[_0xd51d('0x8')]);router[_0xd51d('0x7')](_0xd51d('0x9'),auth[_0xd51d('0xa')](),controller[_0xd51d('0xb')]);router[_0xd51d('0x7')](_0xd51d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd51d('0x7')](_0xd51d('0xd'),auth[_0xd51d('0xa')](),controller[_0xd51d('0xe')]);router[_0xd51d('0x7')]('/:id/teams',auth[_0xd51d('0xa')](),controller[_0xd51d('0xf')]);router[_0xd51d('0x7')](_0xd51d('0x10'),auth[_0xd51d('0xa')](),controller[_0xd51d('0x11')]);router[_0xd51d('0x12')]('/',auth[_0xd51d('0xa')](),controller['create']);router['post'](_0xd51d('0x13'),auth[_0xd51d('0xa')](),controller[_0xd51d('0x14')]);router[_0xd51d('0x12')](_0xd51d('0x10'),auth[_0xd51d('0xa')](),controller[_0xd51d('0x15')]);router['put']('/:id',auth[_0xd51d('0xa')](),controller[_0xd51d('0x16')]);router['delete'](_0xd51d('0xc'),auth[_0xd51d('0xa')](),controller[_0xd51d('0x17')]);router[_0xd51d('0x18')](_0xd51d('0x13'),auth['isAuthenticated'](),controller[_0xd51d('0x19')]);router[_0xd51d('0x18')](_0xd51d('0x10'),auth[_0xd51d('0xa')](),controller[_0xd51d('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index bc84e24..d257b82 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 _0x43bd=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5cf38d,_0x220054){var _0xb29b8a=function(_0x3b5dd4){while(--_0x3b5dd4){_0x5cf38d['push'](_0x5cf38d['shift']());}};_0xb29b8a(++_0x220054);}(_0x43bd,0x19d));var _0xd43b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x43bd[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xd43b('0x0'));module[_0xd43b('0x1')]={'name':{'type':Sequelize[_0xd43b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd43b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd43b('0x4')](_0xd43b('0x5'),_0xd43b('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x3dbf=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x5e57d4,_0x43f851){var _0x5a8e10=function(_0x2336b9){while(--_0x2336b9){_0x5e57d4['push'](_0x5e57d4['shift']());}};_0x5a8e10(++_0x43f851);}(_0x3dbf,0x1c0));var _0xf3db=function(_0x43528e,_0x53efff){_0x43528e=_0x43528e-0x0;var _0x55db21=_0x3dbf[_0x43528e];return _0x55db21;};'use strict';var Sequelize=require(_0xf3db('0x0'));module[_0xf3db('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf3db('0x2')]},'timeout':{'type':Sequelize[_0xf3db('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf3db('0x4')](_0xf3db('0x5'),'beepall',_0xf3db('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f31467c..d2e6c9c 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 _0x631f=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','emit','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userOpenchannelQueue:remove','getAgents','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2e6184,_0xf2fc16){var _0x1e4c2c=function(_0x1dc66b){while(--_0x1dc66b){_0x2e6184['push'](_0x2e6184['shift']());}};_0x1e4c2c(++_0xf2fc16);}(_0x631f,0x78));var _0xf631=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x631f[_0x403cff];return _0x5a7c56;};'use strict';var emlformat=require(_0xf631('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf631('0x1'));var rp=require(_0xf631('0x2'));var moment=require(_0xf631('0x3'));var BPromise=require(_0xf631('0x4'));var Mustache=require(_0xf631('0x5'));var util=require('util');var path=require(_0xf631('0x6'));var sox=require(_0xf631('0x7'));var csv=require('to-csv');var ejs=require(_0xf631('0x8'));var fs=require('fs');var fs_extra=require(_0xf631('0x9'));var _=require(_0xf631('0xa'));var squel=require(_0xf631('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf631('0xc'));var toCsv=require(_0xf631('0xd'));var querystring=require(_0xf631('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf631('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf631('0x10'));var hardwareService=require(_0xf631('0x11'));var logger=require(_0xf631('0x12'))(_0xf631('0x13'));var utils=require(_0xf631('0x14'));var config=require(_0xf631('0x15'));var licenseUtil=require(_0xf631('0x16'));var db=require(_0xf631('0x17'))['db'];config['redis']=_['defaults'](config[_0xf631('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf631('0x18')]));require(_0xf631('0x19'))[_0xf631('0x1a')](socket);function respondWithStatusCode(_0x2aaee6,_0x4783b7){_0x4783b7=_0x4783b7||0xcc;return function(_0x2520e8){if(_0x2520e8){return _0x2aaee6['sendStatus'](_0x4783b7);}return _0x2aaee6[_0xf631('0x1b')](_0x4783b7)[_0xf631('0x1c')]();};}function respondWithResult(_0x3e6796,_0x62e492){_0x62e492=_0x62e492||0xc8;return function(_0x54d595){if(_0x54d595){return _0x3e6796[_0xf631('0x1b')](_0x62e492)['json'](_0x54d595);}};}function respondWithFilteredResult(_0x1da1e5,_0x4e7b65){return function(_0x586cc0){if(_0x586cc0){var _0x27a9c1=typeof _0x4e7b65[_0xf631('0x1d')]===_0xf631('0x1e')&&typeof _0x4e7b65[_0xf631('0x1f')]===_0xf631('0x1e');var _0x11cf5e=_0x586cc0[_0xf631('0x20')];var _0x352bfc=_0x27a9c1?0x0:_0x4e7b65[_0xf631('0x1d')];var _0x1f7cd7=_0x27a9c1?_0x586cc0[_0xf631('0x20')]:_0x4e7b65[_0xf631('0x1d')]+_0x4e7b65[_0xf631('0x1f')];var _0xeb6759;if(_0x1f7cd7>=_0x11cf5e){_0x1f7cd7=_0x11cf5e;_0xeb6759=0xc8;}else{_0xeb6759=0xce;}_0x1da1e5['status'](_0xeb6759);return _0x1da1e5[_0xf631('0x21')](_0xf631('0x22'),_0x352bfc+'-'+_0x1f7cd7+'/'+_0x11cf5e)['json'](_0x586cc0);}return null;};}function patchUpdates(_0x234530){return function(_0x28c0ce){try{jsonpatch[_0xf631('0x23')](_0x28c0ce,_0x234530,!![]);}catch(_0x2ddb5b){return BPromise['reject'](_0x2ddb5b);}return _0x28c0ce[_0xf631('0x24')]();};}function saveUpdates(_0x14e1c5,_0x9cefc2){return function(_0x23d359){if(_0x23d359){return _0x23d359[_0xf631('0x25')](_0x14e1c5)[_0xf631('0x26')](function(_0x3e6390){return _0x3e6390;});}return null;};}function removeEntity(_0x3b6d35,_0x2aec85){return function(_0x44fd61){if(_0x44fd61){return _0x44fd61[_0xf631('0x27')]()['then'](function(){var _0x709242=_0x44fd61['get']({'plain':!![]});var _0x1c64e2=_0xf631('0x28');return db[_0xf631('0x29')][_0xf631('0x27')]({'where':{'type':_0x1c64e2,'resourceId':_0x709242['id']}})[_0xf631('0x26')](function(){return _0x44fd61;});})['then'](function(){_0x3b6d35[_0xf631('0x1b')](0xcc)[_0xf631('0x1c')]();});}};}function handleEntityNotFound(_0x5acc9a,_0x1cbc56){return function(_0x491155){if(!_0x491155){_0x5acc9a['sendStatus'](0x194);}return _0x491155;};}function handleError(_0x225a46,_0x794ff0){_0x794ff0=_0x794ff0||0x1f4;return function(_0x31159f){logger['error'](_0x31159f[_0xf631('0x2a')]);if(_0x31159f['name']){delete _0x31159f[_0xf631('0x2b')];}_0x225a46[_0xf631('0x1b')](_0x794ff0)[_0xf631('0x2c')](_0x31159f);};}exports[_0xf631('0x2d')]=function(_0x270b4b,_0x178691){var _0xd7070f={},_0x4b5bac={},_0x5d9bfd={'count':0x0,'rows':[]};var _0x514db8=_[_0xf631('0x2e')](db['OpenchannelQueue'][_0xf631('0x2f')],function(_0x203b75){return{'name':_0x203b75['fieldName'],'type':_0x203b75[_0xf631('0x30')]['key']};});_0x4b5bac[_0xf631('0x31')]=_[_0xf631('0x2e')](_0x514db8,_0xf631('0x2b'));_0x4b5bac[_0xf631('0x32')]=_['keys'](_0x270b4b[_0xf631('0x32')]);_0x4b5bac[_0xf631('0x33')]=_[_0xf631('0x34')](_0x4b5bac[_0xf631('0x31')],_0x4b5bac[_0xf631('0x32')]);_0xd7070f[_0xf631('0x35')]=_[_0xf631('0x34')](_0x4b5bac[_0xf631('0x31')],qs[_0xf631('0x36')](_0x270b4b[_0xf631('0x32')][_0xf631('0x36')]));_0xd7070f[_0xf631('0x35')]=_0xd7070f[_0xf631('0x35')][_0xf631('0x37')]?_0xd7070f['attributes']:_0x4b5bac[_0xf631('0x31')];if(!_0x270b4b[_0xf631('0x32')][_0xf631('0x38')]('nolimit')){_0xd7070f[_0xf631('0x1f')]=qs[_0xf631('0x1f')](_0x270b4b['query'][_0xf631('0x1f')]);_0xd7070f[_0xf631('0x1d')]=qs[_0xf631('0x1d')](_0x270b4b[_0xf631('0x32')][_0xf631('0x1d')]);}_0xd7070f['order']=qs['sort'](_0x270b4b[_0xf631('0x32')][_0xf631('0x39')]);_0xd7070f[_0xf631('0x3a')]=qs['filters'](_[_0xf631('0x3b')](_0x270b4b['query'],_0x4b5bac[_0xf631('0x33')]),_0x514db8);if(_0x270b4b[_0xf631('0x32')][_0xf631('0x3c')]){_0xd7070f['where']=_[_0xf631('0x3d')](_0xd7070f['where'],{'$or':_[_0xf631('0x2e')](_0x514db8,function(_0x11c3c8){if(_0x11c3c8[_0xf631('0x30')]!==_0xf631('0x3e')){var _0x30becf={};_0x30becf[_0x11c3c8[_0xf631('0x2b')]]={'$like':'%'+_0x270b4b[_0xf631('0x32')][_0xf631('0x3c')]+'%'};return _0x30becf;}})});}_0xd7070f=_[_0xf631('0x3d')]({},_0xd7070f,_0x270b4b[_0xf631('0x3f')]);var _0x2af6e7={'where':_0xd7070f[_0xf631('0x3a')]};return db[_0xf631('0x40')][_0xf631('0x20')](_0x2af6e7)[_0xf631('0x26')](function(_0x5a3998){_0x5d9bfd[_0xf631('0x20')]=_0x5a3998;if(_0x270b4b[_0xf631('0x32')][_0xf631('0x41')]){_0xd7070f[_0xf631('0x42')]=[{'all':!![]}];}return db[_0xf631('0x40')][_0xf631('0x43')](_0xd7070f);})[_0xf631('0x26')](function(_0x54717d){_0x5d9bfd[_0xf631('0x44')]=_0x54717d;return _0x5d9bfd;})[_0xf631('0x26')](respondWithFilteredResult(_0x178691,_0xd7070f))['catch'](handleError(_0x178691,null));};exports[_0xf631('0x45')]=function(_0x2c8212,_0x525b44){var _0x1f8a9b={'raw':!![],'where':{'id':_0x2c8212[_0xf631('0x46')]['id']}},_0x154da2={};_0x154da2[_0xf631('0x31')]=_[_0xf631('0x47')](db[_0xf631('0x40')]['rawAttributes']);_0x154da2[_0xf631('0x32')]=_['keys'](_0x2c8212[_0xf631('0x32')]);_0x154da2[_0xf631('0x33')]=_['intersection'](_0x154da2[_0xf631('0x31')],_0x154da2[_0xf631('0x32')]);_0x1f8a9b['attributes']=_[_0xf631('0x34')](_0x154da2[_0xf631('0x31')],qs[_0xf631('0x36')](_0x2c8212[_0xf631('0x32')]['fields']));_0x1f8a9b[_0xf631('0x35')]=_0x1f8a9b[_0xf631('0x35')][_0xf631('0x37')]?_0x1f8a9b[_0xf631('0x35')]:_0x154da2['model'];if(_0x2c8212[_0xf631('0x32')]['includeAll']){_0x1f8a9b['include']=[{'all':!![]}];}_0x1f8a9b=_[_0xf631('0x3d')]({},_0x1f8a9b,_0x2c8212[_0xf631('0x3f')]);return db[_0xf631('0x40')][_0xf631('0x48')](_0x1f8a9b)[_0xf631('0x26')](handleEntityNotFound(_0x525b44,null))[_0xf631('0x26')](respondWithResult(_0x525b44,null))[_0xf631('0x49')](handleError(_0x525b44,null));};exports[_0xf631('0x4a')]=function(_0x838404,_0x161201){return db[_0xf631('0x40')]['create'](_0x838404['body'],{})[_0xf631('0x26')](function(_0x5e80f1){var _0x3ebe99=_0x838404[_0xf631('0x4b')][_0xf631('0x4c')]({'plain':!![]});if(!_0x3ebe99)throw new Error(_0xf631('0x4d'));if(_0x3ebe99[_0xf631('0x4e')]===_0xf631('0x4b')){var _0x4321c2=_0x5e80f1['get']({'plain':!![]});var _0x25c070=_0xf631('0x28');return db['UserProfileSection'][_0xf631('0x48')]({'where':{'name':_0x25c070,'userProfileId':_0x3ebe99[_0xf631('0x4f')]},'raw':!![]})[_0xf631('0x26')](function(_0x37bd8d){if(_0x37bd8d&&_0x37bd8d[_0xf631('0x50')]===0x0){return db['UserProfileResource'][_0xf631('0x4a')]({'name':_0x4321c2[_0xf631('0x2b')],'resourceId':_0x4321c2['id'],'type':_0x37bd8d[_0xf631('0x2b')],'sectionId':_0x37bd8d['id']},{})[_0xf631('0x26')](function(){return _0x5e80f1;});}else{return _0x5e80f1;}})['catch'](function(_0x4dcfda){logger[_0xf631('0x51')](_0xf631('0x52'),_0x4dcfda);throw _0x4dcfda;});}return _0x5e80f1;})[_0xf631('0x26')](respondWithResult(_0x161201,0xc9))[_0xf631('0x49')](handleError(_0x161201,null));};exports['update']=function(_0x11e530,_0x17b4e6){if(_0x11e530[_0xf631('0x53')]['id']){delete _0x11e530[_0xf631('0x53')]['id'];}return db[_0xf631('0x40')][_0xf631('0x48')]({'where':{'id':_0x11e530[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0x17b4e6,null))[_0xf631('0x26')](saveUpdates(_0x11e530['body'],null))[_0xf631('0x26')](respondWithResult(_0x17b4e6,null))[_0xf631('0x49')](handleError(_0x17b4e6,null));};exports[_0xf631('0x27')]=function(_0x4fc311,_0x14bec1){return db['OpenchannelQueue'][_0xf631('0x48')]({'where':{'id':_0x4fc311[_0xf631('0x46')]['id']}})['then'](handleEntityNotFound(_0x14bec1,null))[_0xf631('0x26')](removeEntity(_0x14bec1,null))[_0xf631('0x49')](handleError(_0x14bec1,null));};exports['describe']=function(_0xec9acf,_0x59f0ec){return db[_0xf631('0x40')][_0xf631('0x54')]()['then'](respondWithResult(_0x59f0ec,null))[_0xf631('0x49')](handleError(_0x59f0ec,null));};exports[_0xf631('0x55')]=function(_0x85e579,_0x31f93c,_0x17f4c8){var _0x4709a6={'raw':!![],'where':{}},_0x303569={},_0x413df9;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x85e579[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0x31f93c,null))[_0xf631('0x26')](function(_0x53f506){if(_0x53f506){_0x413df9=_0x53f506[_0xf631('0x4c')]({'plain':!![]});_0x303569[_0xf631('0x31')]=_[_0xf631('0x47')](db[_0xf631('0x56')][_0xf631('0x2f')]);_0x303569[_0xf631('0x32')]=_[_0xf631('0x47')](_0x85e579[_0xf631('0x32')]);_0x303569['filters']=_[_0xf631('0x34')](_0x303569[_0xf631('0x31')],_0x303569[_0xf631('0x32')]);_0x4709a6[_0xf631('0x35')]=_[_0xf631('0x34')](_0x303569[_0xf631('0x31')],qs[_0xf631('0x36')](_0x85e579[_0xf631('0x32')][_0xf631('0x36')]));_0x4709a6[_0xf631('0x35')]=_0x4709a6[_0xf631('0x35')][_0xf631('0x37')]?_0x4709a6[_0xf631('0x35')]:_0x303569[_0xf631('0x31')];if(!_0x85e579['query'][_0xf631('0x38')](_0xf631('0x57'))){_0x4709a6[_0xf631('0x1f')]=qs['limit'](_0x85e579[_0xf631('0x32')][_0xf631('0x1f')]);_0x4709a6[_0xf631('0x1d')]=qs[_0xf631('0x1d')](_0x85e579[_0xf631('0x32')][_0xf631('0x1d')]);}_0x4709a6[_0xf631('0x58')]=qs[_0xf631('0x39')](_0x85e579[_0xf631('0x32')][_0xf631('0x39')]);_0x4709a6[_0xf631('0x3a')]=qs[_0xf631('0x33')](_[_0xf631('0x3b')](_0x85e579[_0xf631('0x32')],_0x303569[_0xf631('0x33')]));_0x4709a6['where'][_0xf631('0x59')]=_0x53f506['id'];if(_0x85e579[_0xf631('0x32')][_0xf631('0x3c')]){_0x4709a6['where']=_['merge'](_0x4709a6[_0xf631('0x3a')],{'$or':_[_0xf631('0x2e')](_0x4709a6['attributes'],function(_0x2f3982){var _0x4266c6={};_0x4266c6[_0x2f3982]={'$like':'%'+_0x85e579['query'][_0xf631('0x3c')]+'%'};return _0x4266c6;})});}_0x4709a6=_[_0xf631('0x3d')]({},_0x4709a6,_0x85e579[_0xf631('0x3f')]);return db[_0xf631('0x56')]['findAll'](_0x4709a6);}})[_0xf631('0x26')](function(_0x1e359f){if(_0x1e359f){return db[_0xf631('0x5a')][_0xf631('0x5b')]({'where':{'id':_[_0xf631('0x2e')](_0x1e359f,_0xf631('0x5c')),'role':_0xf631('0x5d')},'attributes':['id','name',_0xf631('0x5e'),_0xf631('0x5f'),'createdAt']});}})['then'](function(_0x4d9236){if(_0x4d9236){return{'count':_0x4d9236[_0xf631('0x20')],'rows':_[_0xf631('0x2e')](_0x4d9236[_0xf631('0x44')],function(_0x556d37){return{'membername':_0x556d37['name'],'UserId':_0x556d37['id'],'queue_name':_0x413df9[_0xf631('0x2b')],'OpenchannelQueueId':_0x413df9['id'],'interface':util['format'](_0xf631('0x60'),_0xf631('0x61'),_0x556d37[_0xf631('0x2b')]),'penalty':0x0,'paused':_0x556d37[_0xf631('0x5e')],'createdAt':_0x556d37[_0xf631('0x62')],'updatedAt':_0x556d37[_0xf631('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf631('0x26')](respondWithFilteredResult(_0x31f93c,_0x4709a6))['catch'](handleError(_0x31f93c,null));};exports[_0xf631('0x63')]=function(_0x30d882,_0x2cf64d,_0x42fc73){var _0x3b9434={};var _0x3a85e6={};var _0x2f7727;var _0x56ffa5;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x30d882[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0x2cf64d,null))[_0xf631('0x26')](function(_0x499b6b){if(_0x499b6b){_0x2f7727=_0x499b6b;_0x3a85e6['model']=_['keys'](db[_0xf631('0x64')][_0xf631('0x2f')]);_0x3a85e6[_0xf631('0x32')]=_[_0xf631('0x47')](_0x30d882['query']);_0x3a85e6[_0xf631('0x33')]=_[_0xf631('0x34')](_0x3a85e6['model'],_0x3a85e6[_0xf631('0x32')]);_0x3b9434[_0xf631('0x35')]=_[_0xf631('0x34')](_0x3a85e6[_0xf631('0x31')],qs[_0xf631('0x36')](_0x30d882[_0xf631('0x32')][_0xf631('0x36')]));_0x3b9434[_0xf631('0x35')]=_0x3b9434['attributes'][_0xf631('0x37')]?_0x3b9434[_0xf631('0x35')]:_0x3a85e6[_0xf631('0x31')];_0x3b9434[_0xf631('0x58')]=qs[_0xf631('0x39')](_0x30d882[_0xf631('0x32')][_0xf631('0x39')]);_0x3b9434[_0xf631('0x3a')]=qs[_0xf631('0x33')](_['pick'](_0x30d882['query'],_0x3a85e6['filters']));if(_0x30d882[_0xf631('0x32')][_0xf631('0x3c')]){_0x3b9434[_0xf631('0x3a')]=_[_0xf631('0x3d')](_0x3b9434['where'],{'$or':_[_0xf631('0x2e')](_0x3b9434[_0xf631('0x35')],function(_0x59389c){var _0x391809={};_0x391809[_0x59389c]={'$like':'%'+_0x30d882['query'][_0xf631('0x3c')]+'%'};return _0x391809;})});}_0x3b9434=_[_0xf631('0x3d')]({},_0x3b9434,_0x30d882['options']);return _0x2f7727[_0xf631('0x63')](_0x3b9434);}})[_0xf631('0x26')](function(_0x34a231){if(_0x34a231){_0x56ffa5=_0x34a231[_0xf631('0x37')];if(!_0x30d882[_0xf631('0x32')][_0xf631('0x38')](_0xf631('0x57'))){_0x3b9434['limit']=qs[_0xf631('0x1f')](_0x30d882[_0xf631('0x32')][_0xf631('0x1f')]);_0x3b9434[_0xf631('0x1d')]=qs[_0xf631('0x1d')](_0x30d882['query']['offset']);}return _0x2f7727[_0xf631('0x63')](_0x3b9434);}})[_0xf631('0x26')](function(_0x4da658){if(_0x4da658){return _0x4da658?{'count':_0x56ffa5,'rows':_0x4da658}:null;}})[_0xf631('0x26')](respondWithResult(_0x2cf64d,null))['catch'](handleError(_0x2cf64d,null));};exports[_0xf631('0x65')]=function(_0xd11024,_0x50729d,_0x8b8b07){var _0x1c3b73=_0xd11024[_0xf631('0x53')][_0xf631('0x66')];return db[_0xf631('0x64')]['findAll']({'where':{'id':_0x1c3b73},'attributes':['id'],'include':[{'model':db[_0xf631('0x5a')],'as':'Agents','attributes':['id',_0xf631('0x2b'),_0xf631('0x67'),_0xf631('0x68'),_0xf631('0x69')],'raw':!![]}]})[_0xf631('0x26')](function(_0x14294a){if(_0x14294a){var _0x3b1b2c=_[_0xf631('0x6a')](_0x14294a,function(_0x46aa4a){var _0x45d186=_0x46aa4a[_0xf631('0x4c')]({'plain':!![]});return _0x45d186[_0xf631('0x6b')];});return db[_0xf631('0x40')][_0xf631('0x48')]({'where':{'id':_0xd11024['params']['id']}})[_0xf631('0x26')](function(_0x3716f8){return db['sequelize'][_0xf631('0x6c')](function(_0x35ae83){return _0x3716f8['addTeams'](_0x1c3b73,{'transaction':_0x35ae83})[_0xf631('0x26')](function(){return BPromise['each'](_0x3b1b2c,function(_0x105174){return db[_0xf631('0x56')]['findOrCreate']({'where':{'UserId':_0x105174['id'],'OpenchannelQueueId':_0xd11024[_0xf631('0x46')]['id']},'transaction':_0x35ae83});});})[_0xf631('0x26')](function(){_0x3b1b2c['forEach'](function(_0x4c2def){socket[_0xf631('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x4c2def['id'],'OpenchannelQueueId':_0x3716f8['id']});});});});});}})[_0xf631('0x26')](respondWithStatusCode(_0x50729d,null))[_0xf631('0x49')](handleError(_0x50729d,null));};exports[_0xf631('0x6e')]=function(_0x45f634,_0x493512,_0x112680){return db[_0xf631('0x64')][_0xf631('0x43')]({'where':{'id':_0x45f634[_0xf631('0x32')][_0xf631('0x66')]},'attributes':['id'],'include':[{'model':db[_0xf631('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x493512,null))[_0xf631('0x26')](function(_0x2679e3){var _0x15d54a=_[_0xf631('0x2e')](_0x2679e3,'id');var _0x2daaae=[];var _0x3ffb5d=[];var _0x32cba7=squel[_0xf631('0x6f')]();_0x32cba7[_0xf631('0x70')](_0xf631('0x71'))['from'](_0xf631('0x72'),'tq')[_0xf631('0x73')](_0xf631('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf631('0x3a')](_0xf631('0x75'),_0x45f634['params']['id']);for(var _0x16a93c=0x0;_0x16a93c<_0x2679e3[_0xf631('0x37')];_0x16a93c+=0x1){let _0x234dc7=_0x2679e3[_0x16a93c];for(var _0x58f74c=0x0;_0x58f74c<_0x234dc7['Agents'][_0xf631('0x37')];_0x58f74c+=0x1){let _0x44de30=_0x234dc7['Agents'][_0x58f74c];var _0x4eebd3=_0x32cba7[_0xf631('0x76')]();_0x4eebd3[_0xf631('0x3a')](_0xf631('0x77'),_0x44de30['id']);_0x3ffb5d['push'](db['sequelize'][_0xf631('0x32')](_0x4eebd3['toString'](),{'type':db[_0xf631('0x78')][_0xf631('0x79')][_0xf631('0x7a')]})[_0xf631('0x26')](function(_0x4be277){if(_0x4be277[_0xf631('0x37')]===0x1){return _0x44de30['id'];}else{var _0x41feef=_['every'](_['map'](_0x4be277,_0xf631('0x7b')),function(_0x14c5a5){return _[_0xf631('0x7c')](_0x15d54a,_0x14c5a5);});if(_0x41feef){return _0x44de30['id'];}}}));}}return BPromise[_0xf631('0x7d')](_0x3ffb5d)[_0xf631('0x26')](function(_0x6d0205){_0x2daaae=_(_0x2daaae)[_0xf631('0x7e')](_0x6d0205)[_0xf631('0x7f')]()[_0xf631('0x80')]();return db['OpenchannelQueue'][_0xf631('0x48')]({'where':{'id':_0x45f634[_0xf631('0x46')]['id']}})[_0xf631('0x26')](function(_0x32e68c){return db[_0xf631('0x78')][_0xf631('0x6c')](function(_0x5b8e79){return _0x32e68c['removeTeams'](_0x45f634[_0xf631('0x32')][_0xf631('0x66')],{'transaction':_0x5b8e79})[_0xf631('0x26')](function(){if(!_[_0xf631('0x81')](_0x2daaae)){return _0x32e68c[_0xf631('0x82')](_0x2daaae,{'transaction':_0x5b8e79});}})[_0xf631('0x26')](function(){_0x2daaae[_0xf631('0x83')](function(_0xc17b4){socket[_0xf631('0x6d')]('userOpenchannelQueue:remove',{'UserId':_0xc17b4,'OpenchannelQueueId':_0x32e68c['id']});});});});});});})[_0xf631('0x26')](respondWithStatusCode(_0x493512,null))[_0xf631('0x49')](handleError(_0x493512,null));};exports[_0xf631('0x84')]=function(_0x318db1,_0x13b28f,_0x3072ff){return db[_0xf631('0x40')][_0xf631('0x48')]({'where':{'id':_0x318db1[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0x13b28f,null))['then'](function(_0x4efbad){if(_0x4efbad){return _0x4efbad[_0xf631('0x84')](_0x318db1[_0xf631('0x53')][_0xf631('0x66')],_[_0xf631('0x85')](_0x318db1['body'],['ids','id'])||{})[_0xf631('0x86')](function(_0x2bc67c){for(var _0x35a9c7=0x0;_0x35a9c7<_0x318db1[_0xf631('0x53')][_0xf631('0x66')][_0xf631('0x37')];_0x35a9c7+=0x1){socket[_0xf631('0x6d')]('userOpenchannelQueue:save',{'UserId':Number(_0x318db1[_0xf631('0x53')]['ids'][_0x35a9c7]),'OpenchannelQueueId':Number(_0x318db1['params']['id'])});}return _0x2bc67c;});}})[_0xf631('0x26')](respondWithResult(_0x13b28f,null))[_0xf631('0x49')](handleError(_0x13b28f,null));};exports[_0xf631('0x82')]=function(_0x308939,_0x34112f,_0xcb395){return db[_0xf631('0x40')][_0xf631('0x48')]({'where':{'id':_0x308939[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0x34112f,null))[_0xf631('0x26')](function(_0x5ef2ac){if(_0x5ef2ac){return _0x5ef2ac[_0xf631('0x82')](_0x308939['query'][_0xf631('0x66')])[_0xf631('0x26')](function(){if(_['isArray'](_0x308939[_0xf631('0x32')][_0xf631('0x66')])){for(var _0x19234d=0x0;_0x19234d<_0x308939[_0xf631('0x32')][_0xf631('0x66')][_0xf631('0x37')];_0x19234d+=0x1){socket[_0xf631('0x6d')](_0xf631('0x87'),{'UserId':Number(_0x308939['query'][_0xf631('0x66')][_0x19234d]),'OpenchannelQueueId':Number(_0x308939[_0xf631('0x46')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x308939['query'][_0xf631('0x66')]),'OpenchannelQueueId':Number(_0x308939['params']['id'])});}});}})[_0xf631('0x26')](respondWithStatusCode(_0x34112f,null))[_0xf631('0x49')](handleError(_0x34112f,null));};exports[_0xf631('0x88')]=function(_0x210e57,_0xa4015e,_0x33d312){var _0x191b52={};var _0x5f4ee6={};var _0x5e265e;var _0x330711;return db[_0xf631('0x40')][_0xf631('0x89')]({'where':{'id':_0x210e57[_0xf631('0x46')]['id']}})[_0xf631('0x26')](handleEntityNotFound(_0xa4015e,null))[_0xf631('0x26')](function(_0x2c42d3){if(_0x2c42d3){_0x5e265e=_0x2c42d3;_0x5f4ee6[_0xf631('0x31')]=_[_0xf631('0x47')](db[_0xf631('0x5a')]['rawAttributes']);_0x5f4ee6[_0xf631('0x32')]=_[_0xf631('0x47')](_0x210e57[_0xf631('0x32')]);_0x5f4ee6[_0xf631('0x33')]=_['intersection'](_0x5f4ee6['model'],_0x5f4ee6[_0xf631('0x32')]);_0x191b52[_0xf631('0x35')]=_[_0xf631('0x34')](_0x5f4ee6[_0xf631('0x31')],qs['fields'](_0x210e57[_0xf631('0x32')][_0xf631('0x36')]));_0x191b52['attributes']=_0x191b52[_0xf631('0x35')][_0xf631('0x37')]?_0x191b52[_0xf631('0x35')]:_0x5f4ee6[_0xf631('0x31')];_0x191b52[_0xf631('0x58')]=qs['sort'](_0x210e57['query'][_0xf631('0x39')]);_0x191b52[_0xf631('0x3a')]=qs['filters'](_[_0xf631('0x3b')](_0x210e57['query'],_0x5f4ee6[_0xf631('0x33')]));if(_0x210e57[_0xf631('0x32')]['filter']){_0x191b52[_0xf631('0x3a')]=_[_0xf631('0x3d')](_0x191b52[_0xf631('0x3a')],{'$or':_[_0xf631('0x2e')](_0x191b52[_0xf631('0x35')],function(_0x85c6f9){var _0x541586={};_0x541586[_0x85c6f9]={'$like':'%'+_0x210e57[_0xf631('0x32')][_0xf631('0x3c')]+'%'};return _0x541586;})});}_0x191b52=_[_0xf631('0x3d')]({},_0x191b52,_0x210e57[_0xf631('0x3f')]);return _0x5e265e[_0xf631('0x88')](_0x191b52);}})[_0xf631('0x26')](function(_0x2b06c5){if(_0x2b06c5){_0x330711=_0x2b06c5[_0xf631('0x37')];if(!_0x210e57[_0xf631('0x32')][_0xf631('0x38')](_0xf631('0x57'))){_0x191b52[_0xf631('0x1f')]=qs[_0xf631('0x1f')](_0x210e57[_0xf631('0x32')]['limit']);_0x191b52[_0xf631('0x1d')]=qs[_0xf631('0x1d')](_0x210e57['query'][_0xf631('0x1d')]);}return _0x5e265e[_0xf631('0x88')](_0x191b52);}})[_0xf631('0x26')](function(_0x324bb3){if(_0x324bb3){return _0x324bb3?{'count':_0x330711,'rows':_0x324bb3}:null;}})[_0xf631('0x26')](respondWithResult(_0xa4015e,null))[_0xf631('0x49')](handleError(_0xa4015e,null));}; \ No newline at end of file +var _0x5366=['forEach','emit','removeTeams','Agents','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','TeamId','includes','union','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','pick','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','send','index','map','OpenchannelQueue','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserOpenchannelQueue','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','openchannelPause','getTeams','findOne','Team','ids','online','flatMap','transaction','addTeams','each','findOrCreate'];(function(_0x5ac2a7,_0xb69a70){var _0x36ca38=function(_0x46813a){while(--_0x46813a){_0x5ac2a7['push'](_0x5ac2a7['shift']());}};_0x36ca38(++_0xb69a70);}(_0x5366,0x1af));var _0x6536=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x5366[_0x3e25c1];return _0x52e7f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6536('0x0'));var zipdir=require(_0x6536('0x1'));var jsonpatch=require(_0x6536('0x2'));var rp=require('request-promise');var moment=require(_0x6536('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6536('0x4'));var util=require(_0x6536('0x5'));var path=require(_0x6536('0x6'));var sox=require('sox');var csv=require(_0x6536('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6536('0x8'));var _=require(_0x6536('0x9'));var squel=require(_0x6536('0xa'));var crypto=require(_0x6536('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6536('0xc'));var toCsv=require(_0x6536('0x7'));var querystring=require(_0x6536('0xd'));var Papa=require(_0x6536('0xe'));var Redis=require('ioredis');var authService=require(_0x6536('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6536('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6536('0x11'))(_0x6536('0x12'));var utils=require(_0x6536('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6536('0x14'));var db=require(_0x6536('0x15'))['db'];config['redis']=_[_0x6536('0x16')](config[_0x6536('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6536('0x18'))(new Redis(config[_0x6536('0x17')]));require(_0x6536('0x19'))[_0x6536('0x1a')](socket);function respondWithStatusCode(_0x40432c,_0x454590){_0x454590=_0x454590||0xcc;return function(_0x54f30a){if(_0x54f30a){return _0x40432c['sendStatus'](_0x454590);}return _0x40432c['status'](_0x454590)[_0x6536('0x1b')]();};}function respondWithResult(_0x499016,_0x820df1){_0x820df1=_0x820df1||0xc8;return function(_0x1841e8){if(_0x1841e8){return _0x499016[_0x6536('0x1c')](_0x820df1)[_0x6536('0x1d')](_0x1841e8);}};}function respondWithFilteredResult(_0xb29aac,_0xf5407c){return function(_0x2db7e8){if(_0x2db7e8){var _0x317883=typeof _0xf5407c[_0x6536('0x1e')]==='undefined'&&typeof _0xf5407c[_0x6536('0x1f')]===_0x6536('0x20');var _0x55daf8=_0x2db7e8[_0x6536('0x21')];var _0x344587=_0x317883?0x0:_0xf5407c[_0x6536('0x1e')];var _0x49b219=_0x317883?_0x2db7e8[_0x6536('0x21')]:_0xf5407c[_0x6536('0x1e')]+_0xf5407c['limit'];var _0x3046ee;if(_0x49b219>=_0x55daf8){_0x49b219=_0x55daf8;_0x3046ee=0xc8;}else{_0x3046ee=0xce;}_0xb29aac[_0x6536('0x1c')](_0x3046ee);return _0xb29aac[_0x6536('0x22')](_0x6536('0x23'),_0x344587+'-'+_0x49b219+'/'+_0x55daf8)[_0x6536('0x1d')](_0x2db7e8);}return null;};}function patchUpdates(_0x530374){return function(_0x36349e){try{jsonpatch[_0x6536('0x24')](_0x36349e,_0x530374,!![]);}catch(_0xddd35c){return BPromise[_0x6536('0x25')](_0xddd35c);}return _0x36349e['save']();};}function saveUpdates(_0x384f0a,_0x2224ff){return function(_0x22fcc5){if(_0x22fcc5){return _0x22fcc5['update'](_0x384f0a)['then'](function(_0x177e29){return _0x177e29;});}return null;};}function removeEntity(_0x143913,_0x23099e){return function(_0xfaf4f3){if(_0xfaf4f3){return _0xfaf4f3[_0x6536('0x26')]()[_0x6536('0x27')](function(){var _0xf2dd2=_0xfaf4f3[_0x6536('0x28')]({'plain':!![]});var _0x1752ba=_0x6536('0x29');return db[_0x6536('0x2a')][_0x6536('0x26')]({'where':{'type':_0x1752ba,'resourceId':_0xf2dd2['id']}})['then'](function(){return _0xfaf4f3;});})[_0x6536('0x27')](function(){_0x143913[_0x6536('0x1c')](0xcc)[_0x6536('0x1b')]();});}};}function handleEntityNotFound(_0x3d7c88,_0x2511f1){return function(_0x5e1766){if(!_0x5e1766){_0x3d7c88[_0x6536('0x2b')](0x194);}return _0x5e1766;};}function handleError(_0x3315eb,_0x2ae1cf){_0x2ae1cf=_0x2ae1cf||0x1f4;return function(_0x139766){logger[_0x6536('0x2c')](_0x139766['stack']);if(_0x139766[_0x6536('0x2d')]){delete _0x139766[_0x6536('0x2d')];}_0x3315eb[_0x6536('0x1c')](_0x2ae1cf)[_0x6536('0x2e')](_0x139766);};}exports[_0x6536('0x2f')]=function(_0x461700,_0x1869b3){var _0x277b68={},_0x1c4d6b={},_0x15e65b={'count':0x0,'rows':[]};var _0x2d8f27=_[_0x6536('0x30')](db[_0x6536('0x31')]['rawAttributes'],function(_0x286678){return{'name':_0x286678['fieldName'],'type':_0x286678['type']['key']};});_0x1c4d6b[_0x6536('0x32')]=_[_0x6536('0x30')](_0x2d8f27,_0x6536('0x2d'));_0x1c4d6b[_0x6536('0x33')]=_[_0x6536('0x34')](_0x461700[_0x6536('0x33')]);_0x1c4d6b[_0x6536('0x35')]=_[_0x6536('0x36')](_0x1c4d6b[_0x6536('0x32')],_0x1c4d6b[_0x6536('0x33')]);_0x277b68[_0x6536('0x37')]=_[_0x6536('0x36')](_0x1c4d6b[_0x6536('0x32')],qs[_0x6536('0x38')](_0x461700[_0x6536('0x33')][_0x6536('0x38')]));_0x277b68[_0x6536('0x37')]=_0x277b68[_0x6536('0x37')][_0x6536('0x39')]?_0x277b68[_0x6536('0x37')]:_0x1c4d6b[_0x6536('0x32')];if(!_0x461700[_0x6536('0x33')][_0x6536('0x3a')](_0x6536('0x3b'))){_0x277b68[_0x6536('0x1f')]=qs[_0x6536('0x1f')](_0x461700[_0x6536('0x33')][_0x6536('0x1f')]);_0x277b68[_0x6536('0x1e')]=qs[_0x6536('0x1e')](_0x461700[_0x6536('0x33')][_0x6536('0x1e')]);}_0x277b68[_0x6536('0x3c')]=qs[_0x6536('0x3d')](_0x461700[_0x6536('0x33')][_0x6536('0x3d')]);_0x277b68[_0x6536('0x3e')]=qs[_0x6536('0x35')](_['pick'](_0x461700['query'],_0x1c4d6b['filters']),_0x2d8f27);if(_0x461700[_0x6536('0x33')]['filter']){_0x277b68[_0x6536('0x3e')]=_[_0x6536('0x3f')](_0x277b68['where'],{'$or':_[_0x6536('0x30')](_0x2d8f27,function(_0x3d86d5){if(_0x3d86d5[_0x6536('0x40')]!=='VIRTUAL'){var _0x538d5a={};_0x538d5a[_0x3d86d5[_0x6536('0x2d')]]={'$like':'%'+_0x461700['query'][_0x6536('0x41')]+'%'};return _0x538d5a;}})});}_0x277b68=_['merge']({},_0x277b68,_0x461700[_0x6536('0x42')]);var _0x36fbf0={'where':_0x277b68[_0x6536('0x3e')]};return db[_0x6536('0x31')][_0x6536('0x21')](_0x36fbf0)['then'](function(_0x417dc9){_0x15e65b[_0x6536('0x21')]=_0x417dc9;if(_0x461700[_0x6536('0x33')][_0x6536('0x43')]){_0x277b68['include']=[{'all':!![]}];}return db[_0x6536('0x31')][_0x6536('0x44')](_0x277b68);})['then'](function(_0x368acb){_0x15e65b[_0x6536('0x45')]=_0x368acb;return _0x15e65b;})[_0x6536('0x27')](respondWithFilteredResult(_0x1869b3,_0x277b68))[_0x6536('0x46')](handleError(_0x1869b3,null));};exports[_0x6536('0x47')]=function(_0x17570e,_0x4ebdb1){var _0x2ac566={'raw':!![],'where':{'id':_0x17570e[_0x6536('0x48')]['id']}},_0x3d1535={};_0x3d1535[_0x6536('0x32')]=_[_0x6536('0x34')](db['OpenchannelQueue'][_0x6536('0x49')]);_0x3d1535['query']=_[_0x6536('0x34')](_0x17570e['query']);_0x3d1535['filters']=_[_0x6536('0x36')](_0x3d1535[_0x6536('0x32')],_0x3d1535[_0x6536('0x33')]);_0x2ac566[_0x6536('0x37')]=_[_0x6536('0x36')](_0x3d1535[_0x6536('0x32')],qs[_0x6536('0x38')](_0x17570e[_0x6536('0x33')][_0x6536('0x38')]));_0x2ac566[_0x6536('0x37')]=_0x2ac566['attributes'][_0x6536('0x39')]?_0x2ac566['attributes']:_0x3d1535[_0x6536('0x32')];if(_0x17570e['query'][_0x6536('0x43')]){_0x2ac566[_0x6536('0x4a')]=[{'all':!![]}];}_0x2ac566=_['merge']({},_0x2ac566,_0x17570e[_0x6536('0x42')]);return db[_0x6536('0x31')][_0x6536('0x4b')](_0x2ac566)['then'](handleEntityNotFound(_0x4ebdb1,null))[_0x6536('0x27')](respondWithResult(_0x4ebdb1,null))['catch'](handleError(_0x4ebdb1,null));};exports[_0x6536('0x4c')]=function(_0x1a22a4,_0x5a1e19){return db[_0x6536('0x31')][_0x6536('0x4c')](_0x1a22a4[_0x6536('0x4d')],{})['then'](function(_0x21cce8){var _0x1344b6=_0x1a22a4['user']['get']({'plain':!![]});if(!_0x1344b6)throw new Error(_0x6536('0x4e'));if(_0x1344b6['role']==='user'){var _0xab58eb=_0x21cce8[_0x6536('0x28')]({'plain':!![]});var _0x5aac0d=_0x6536('0x29');return db[_0x6536('0x4f')]['find']({'where':{'name':_0x5aac0d,'userProfileId':_0x1344b6[_0x6536('0x50')]},'raw':!![]})[_0x6536('0x27')](function(_0x305114){if(_0x305114&&_0x305114[_0x6536('0x51')]===0x0){return db[_0x6536('0x2a')][_0x6536('0x4c')]({'name':_0xab58eb[_0x6536('0x2d')],'resourceId':_0xab58eb['id'],'type':_0x305114[_0x6536('0x2d')],'sectionId':_0x305114['id']},{})[_0x6536('0x27')](function(){return _0x21cce8;});}else{return _0x21cce8;}})['catch'](function(_0x882af3){logger[_0x6536('0x2c')](_0x6536('0x52'),_0x882af3);throw _0x882af3;});}return _0x21cce8;})[_0x6536('0x27')](respondWithResult(_0x5a1e19,0xc9))[_0x6536('0x46')](handleError(_0x5a1e19,null));};exports[_0x6536('0x53')]=function(_0x4a7033,_0x273ca8){if(_0x4a7033[_0x6536('0x4d')]['id']){delete _0x4a7033[_0x6536('0x4d')]['id'];}return db['OpenchannelQueue'][_0x6536('0x4b')]({'where':{'id':_0x4a7033['params']['id']}})[_0x6536('0x27')](handleEntityNotFound(_0x273ca8,null))[_0x6536('0x27')](saveUpdates(_0x4a7033[_0x6536('0x4d')],null))['then'](respondWithResult(_0x273ca8,null))['catch'](handleError(_0x273ca8,null));};exports[_0x6536('0x26')]=function(_0x1bdb6b,_0x58bcbe){return db[_0x6536('0x31')][_0x6536('0x4b')]({'where':{'id':_0x1bdb6b[_0x6536('0x48')]['id']}})['then'](handleEntityNotFound(_0x58bcbe,null))[_0x6536('0x27')](removeEntity(_0x58bcbe,null))[_0x6536('0x46')](handleError(_0x58bcbe,null));};exports[_0x6536('0x54')]=function(_0x1d7672,_0xe49187){return db[_0x6536('0x31')][_0x6536('0x54')]()[_0x6536('0x27')](respondWithResult(_0xe49187,null))[_0x6536('0x46')](handleError(_0xe49187,null));};exports[_0x6536('0x55')]=function(_0x51cf10,_0x204b0b,_0x21b0f2){var _0x1b66e3={'raw':!![],'where':{}},_0x31b394={},_0x8311f6;return db[_0x6536('0x31')]['findOne']({'where':{'id':_0x51cf10[_0x6536('0x48')]['id']}})[_0x6536('0x27')](handleEntityNotFound(_0x204b0b,null))[_0x6536('0x27')](function(_0x86e210){if(_0x86e210){_0x8311f6=_0x86e210[_0x6536('0x28')]({'plain':!![]});_0x31b394[_0x6536('0x32')]=_[_0x6536('0x34')](db[_0x6536('0x56')]['rawAttributes']);_0x31b394[_0x6536('0x33')]=_[_0x6536('0x34')](_0x51cf10[_0x6536('0x33')]);_0x31b394['filters']=_[_0x6536('0x36')](_0x31b394['model'],_0x31b394['query']);_0x1b66e3[_0x6536('0x37')]=_[_0x6536('0x36')](_0x31b394[_0x6536('0x32')],qs[_0x6536('0x38')](_0x51cf10[_0x6536('0x33')][_0x6536('0x38')]));_0x1b66e3[_0x6536('0x37')]=_0x1b66e3[_0x6536('0x37')]['length']?_0x1b66e3[_0x6536('0x37')]:_0x31b394['model'];if(!_0x51cf10[_0x6536('0x33')][_0x6536('0x3a')]('nolimit')){_0x1b66e3[_0x6536('0x1f')]=qs[_0x6536('0x1f')](_0x51cf10[_0x6536('0x33')][_0x6536('0x1f')]);_0x1b66e3[_0x6536('0x1e')]=qs[_0x6536('0x1e')](_0x51cf10['query'][_0x6536('0x1e')]);}_0x1b66e3[_0x6536('0x3c')]=qs[_0x6536('0x3d')](_0x51cf10[_0x6536('0x33')][_0x6536('0x3d')]);_0x1b66e3[_0x6536('0x3e')]=qs['filters'](_['pick'](_0x51cf10['query'],_0x31b394['filters']));_0x1b66e3[_0x6536('0x3e')]['OpenchannelQueueId']=_0x86e210['id'];if(_0x51cf10[_0x6536('0x33')]['filter']){_0x1b66e3[_0x6536('0x3e')]=_[_0x6536('0x3f')](_0x1b66e3[_0x6536('0x3e')],{'$or':_[_0x6536('0x30')](_0x1b66e3[_0x6536('0x37')],function(_0x55725c){var _0x10a9ef={};_0x10a9ef[_0x55725c]={'$like':'%'+_0x51cf10['query'][_0x6536('0x41')]+'%'};return _0x10a9ef;})});}_0x1b66e3=_[_0x6536('0x3f')]({},_0x1b66e3,_0x51cf10['options']);return db[_0x6536('0x56')][_0x6536('0x44')](_0x1b66e3);}})[_0x6536('0x27')](function(_0x1644f0){if(_0x1644f0){return db[_0x6536('0x57')][_0x6536('0x58')]({'where':{'id':_['map'](_0x1644f0,_0x6536('0x59')),'role':'agent'},'attributes':['id',_0x6536('0x2d'),'openchannelPause',_0x6536('0x5a'),_0x6536('0x5b')]});}})[_0x6536('0x27')](function(_0x48153c){if(_0x48153c){return{'count':_0x48153c[_0x6536('0x21')],'rows':_[_0x6536('0x30')](_0x48153c[_0x6536('0x45')],function(_0x148e2e){return{'membername':_0x148e2e[_0x6536('0x2d')],'UserId':_0x148e2e['id'],'queue_name':_0x8311f6[_0x6536('0x2d')],'OpenchannelQueueId':_0x8311f6['id'],'interface':util[_0x6536('0x5c')](_0x6536('0x5d'),'SIP',_0x148e2e[_0x6536('0x2d')]),'penalty':0x0,'paused':_0x148e2e[_0x6536('0x5e')],'createdAt':_0x148e2e['createdAt'],'updatedAt':_0x148e2e[_0x6536('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6536('0x27')](respondWithFilteredResult(_0x204b0b,_0x1b66e3))['catch'](handleError(_0x204b0b,null));};exports[_0x6536('0x5f')]=function(_0x4446b7,_0x377f4b,_0x1a9461){var _0x2f29c4={};var _0x11a44b={};var _0x3b5776;var _0x476995;return db[_0x6536('0x31')][_0x6536('0x60')]({'where':{'id':_0x4446b7['params']['id']}})[_0x6536('0x27')](handleEntityNotFound(_0x377f4b,null))[_0x6536('0x27')](function(_0x49f1b4){if(_0x49f1b4){_0x3b5776=_0x49f1b4;_0x11a44b[_0x6536('0x32')]=_['keys'](db[_0x6536('0x61')][_0x6536('0x49')]);_0x11a44b['query']=_['keys'](_0x4446b7[_0x6536('0x33')]);_0x11a44b[_0x6536('0x35')]=_[_0x6536('0x36')](_0x11a44b[_0x6536('0x32')],_0x11a44b['query']);_0x2f29c4['attributes']=_[_0x6536('0x36')](_0x11a44b[_0x6536('0x32')],qs[_0x6536('0x38')](_0x4446b7[_0x6536('0x33')][_0x6536('0x38')]));_0x2f29c4[_0x6536('0x37')]=_0x2f29c4[_0x6536('0x37')][_0x6536('0x39')]?_0x2f29c4[_0x6536('0x37')]:_0x11a44b['model'];_0x2f29c4[_0x6536('0x3c')]=qs[_0x6536('0x3d')](_0x4446b7[_0x6536('0x33')]['sort']);_0x2f29c4['where']=qs[_0x6536('0x35')](_['pick'](_0x4446b7[_0x6536('0x33')],_0x11a44b[_0x6536('0x35')]));if(_0x4446b7[_0x6536('0x33')][_0x6536('0x41')]){_0x2f29c4[_0x6536('0x3e')]=_['merge'](_0x2f29c4[_0x6536('0x3e')],{'$or':_['map'](_0x2f29c4['attributes'],function(_0x214915){var _0x2b73c0={};_0x2b73c0[_0x214915]={'$like':'%'+_0x4446b7[_0x6536('0x33')][_0x6536('0x41')]+'%'};return _0x2b73c0;})});}_0x2f29c4=_[_0x6536('0x3f')]({},_0x2f29c4,_0x4446b7[_0x6536('0x42')]);return _0x3b5776[_0x6536('0x5f')](_0x2f29c4);}})[_0x6536('0x27')](function(_0x4b7089){if(_0x4b7089){_0x476995=_0x4b7089[_0x6536('0x39')];if(!_0x4446b7[_0x6536('0x33')]['hasOwnProperty'](_0x6536('0x3b'))){_0x2f29c4[_0x6536('0x1f')]=qs['limit'](_0x4446b7[_0x6536('0x33')]['limit']);_0x2f29c4[_0x6536('0x1e')]=qs[_0x6536('0x1e')](_0x4446b7[_0x6536('0x33')][_0x6536('0x1e')]);}return _0x3b5776[_0x6536('0x5f')](_0x2f29c4);}})[_0x6536('0x27')](function(_0x21eb4c){if(_0x21eb4c){return _0x21eb4c?{'count':_0x476995,'rows':_0x21eb4c}:null;}})[_0x6536('0x27')](respondWithResult(_0x377f4b,null))[_0x6536('0x46')](handleError(_0x377f4b,null));};exports['addTeams']=function(_0x8faa78,_0x5e311f,_0x1ead41){var _0x62d760=_0x8faa78[_0x6536('0x4d')][_0x6536('0x62')];return db[_0x6536('0x61')][_0x6536('0x44')]({'where':{'id':_0x62d760},'attributes':['id'],'include':[{'model':db[_0x6536('0x57')],'as':'Agents','attributes':['id','name',_0x6536('0x63'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x51eb93){if(_0x51eb93){var _0x2d089b=_[_0x6536('0x64')](_0x51eb93,function(_0x4f337e){var _0x229ea6=_0x4f337e[_0x6536('0x28')]({'plain':!![]});return _0x229ea6['Agents'];});return db['OpenchannelQueue'][_0x6536('0x4b')]({'where':{'id':_0x8faa78['params']['id']}})[_0x6536('0x27')](function(_0x4bef58){return db['sequelize'][_0x6536('0x65')](function(_0x3c2957){return _0x4bef58[_0x6536('0x66')](_0x62d760,{'transaction':_0x3c2957})[_0x6536('0x27')](function(){return BPromise[_0x6536('0x67')](_0x2d089b,function(_0x582981){return db[_0x6536('0x56')][_0x6536('0x68')]({'where':{'UserId':_0x582981['id'],'OpenchannelQueueId':_0x8faa78[_0x6536('0x48')]['id']},'transaction':_0x3c2957});});})['then'](function(){_0x2d089b[_0x6536('0x69')](function(_0x7b61a){socket[_0x6536('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x7b61a['id'],'OpenchannelQueueId':_0x4bef58['id']});});});});});}})[_0x6536('0x27')](respondWithStatusCode(_0x5e311f,null))[_0x6536('0x46')](handleError(_0x5e311f,null));};exports[_0x6536('0x6b')]=function(_0x3ae510,_0xcedd45,_0x29b88d){return db['Team'][_0x6536('0x44')]({'where':{'id':_0x3ae510[_0x6536('0x33')][_0x6536('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6536('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x6536('0x27')](handleEntityNotFound(_0xcedd45,null))['then'](function(_0x5e08d1){var _0x3bc3d1=_[_0x6536('0x30')](_0x5e08d1,'id');var _0x104bc4=[];var _0x5589ab=[];var _0x502300=squel[_0x6536('0x6d')]();_0x502300[_0x6536('0x6e')](_0x6536('0x6f'))['from'](_0x6536('0x70'),'tq')[_0x6536('0x71')](_0x6536('0x72'),'ut',_0x6536('0x73'))[_0x6536('0x3e')]('OpenchannelQueueId\x20=\x20?',_0x3ae510[_0x6536('0x48')]['id']);for(var _0xa4e641=0x0;_0xa4e641<_0x5e08d1[_0x6536('0x39')];_0xa4e641+=0x1){let _0x5cdbc2=_0x5e08d1[_0xa4e641];for(var _0x151ac9=0x0;_0x151ac9<_0x5cdbc2[_0x6536('0x6c')][_0x6536('0x39')];_0x151ac9+=0x1){let _0x44888d=_0x5cdbc2['Agents'][_0x151ac9];var _0x5ed774=_0x502300[_0x6536('0x74')]();_0x5ed774[_0x6536('0x3e')](_0x6536('0x75'),_0x44888d['id']);_0x5589ab['push'](db[_0x6536('0x76')][_0x6536('0x33')](_0x5ed774[_0x6536('0x77')](),{'type':db['sequelize']['QueryTypes'][_0x6536('0x78')]})[_0x6536('0x27')](function(_0x3e4bb3){if(_0x3e4bb3[_0x6536('0x39')]===0x1){return _0x44888d['id'];}else{var _0x4f4b74=_['every'](_[_0x6536('0x30')](_0x3e4bb3,_0x6536('0x79')),function(_0x5d4795){return _[_0x6536('0x7a')](_0x3bc3d1,_0x5d4795);});if(_0x4f4b74){return _0x44888d['id'];}}}));}}return BPromise['all'](_0x5589ab)[_0x6536('0x27')](function(_0x185cf6){_0x104bc4=_(_0x104bc4)[_0x6536('0x7b')](_0x185cf6)['compact']()['value']();return db[_0x6536('0x31')][_0x6536('0x4b')]({'where':{'id':_0x3ae510[_0x6536('0x48')]['id']}})['then'](function(_0x31d8e2){return db[_0x6536('0x76')][_0x6536('0x65')](function(_0x471c61){return _0x31d8e2[_0x6536('0x6b')](_0x3ae510['query'][_0x6536('0x62')],{'transaction':_0x471c61})[_0x6536('0x27')](function(){if(!_[_0x6536('0x7c')](_0x104bc4)){return _0x31d8e2[_0x6536('0x7d')](_0x104bc4,{'transaction':_0x471c61});}})[_0x6536('0x27')](function(){_0x104bc4[_0x6536('0x69')](function(_0x150518){socket[_0x6536('0x6a')](_0x6536('0x7e'),{'UserId':_0x150518,'OpenchannelQueueId':_0x31d8e2['id']});});});});});});})[_0x6536('0x27')](respondWithStatusCode(_0xcedd45,null))[_0x6536('0x46')](handleError(_0xcedd45,null));};exports[_0x6536('0x7f')]=function(_0x42dc87,_0x22f680,_0x3b379c){return db[_0x6536('0x31')][_0x6536('0x4b')]({'where':{'id':_0x42dc87[_0x6536('0x48')]['id']}})[_0x6536('0x27')](handleEntityNotFound(_0x22f680,null))[_0x6536('0x27')](function(_0x44af8b){if(_0x44af8b){return _0x44af8b[_0x6536('0x7f')](_0x42dc87[_0x6536('0x4d')]['ids'],_[_0x6536('0x80')](_0x42dc87[_0x6536('0x4d')],[_0x6536('0x62'),'id'])||{})[_0x6536('0x81')](function(_0x183410){for(var _0x3574bb=0x0;_0x3574bb<_0x42dc87['body'][_0x6536('0x62')][_0x6536('0x39')];_0x3574bb+=0x1){socket[_0x6536('0x6a')](_0x6536('0x82'),{'UserId':Number(_0x42dc87[_0x6536('0x4d')][_0x6536('0x62')][_0x3574bb]),'OpenchannelQueueId':Number(_0x42dc87['params']['id'])});}return _0x183410;});}})['then'](respondWithResult(_0x22f680,null))[_0x6536('0x46')](handleError(_0x22f680,null));};exports[_0x6536('0x7d')]=function(_0x42e38e,_0x5c8f09,_0x8e92a0){return db[_0x6536('0x31')]['find']({'where':{'id':_0x42e38e[_0x6536('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c8f09,null))[_0x6536('0x27')](function(_0x418a09){if(_0x418a09){return _0x418a09[_0x6536('0x7d')](_0x42e38e[_0x6536('0x33')][_0x6536('0x62')])[_0x6536('0x27')](function(){if(_[_0x6536('0x83')](_0x42e38e[_0x6536('0x33')][_0x6536('0x62')])){for(var _0x45c9bc=0x0;_0x45c9bc<_0x42e38e[_0x6536('0x33')][_0x6536('0x62')][_0x6536('0x39')];_0x45c9bc+=0x1){socket[_0x6536('0x6a')](_0x6536('0x7e'),{'UserId':Number(_0x42e38e['query'][_0x6536('0x62')][_0x45c9bc]),'OpenchannelQueueId':Number(_0x42e38e[_0x6536('0x48')]['id'])});}}else{socket[_0x6536('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x42e38e[_0x6536('0x33')]['ids']),'OpenchannelQueueId':Number(_0x42e38e[_0x6536('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c8f09,null))[_0x6536('0x46')](handleError(_0x5c8f09,null));};exports['getAgents']=function(_0x315cdc,_0x468c7e,_0x30a35a){var _0x1a5c13={};var _0x578677={};var _0x469810;var _0x21d0c5;return db['OpenchannelQueue'][_0x6536('0x60')]({'where':{'id':_0x315cdc[_0x6536('0x48')]['id']}})['then'](handleEntityNotFound(_0x468c7e,null))[_0x6536('0x27')](function(_0x47c7bb){if(_0x47c7bb){_0x469810=_0x47c7bb;_0x578677[_0x6536('0x32')]=_[_0x6536('0x34')](db['User']['rawAttributes']);_0x578677[_0x6536('0x33')]=_['keys'](_0x315cdc[_0x6536('0x33')]);_0x578677[_0x6536('0x35')]=_['intersection'](_0x578677[_0x6536('0x32')],_0x578677['query']);_0x1a5c13[_0x6536('0x37')]=_[_0x6536('0x36')](_0x578677[_0x6536('0x32')],qs['fields'](_0x315cdc[_0x6536('0x33')][_0x6536('0x38')]));_0x1a5c13[_0x6536('0x37')]=_0x1a5c13[_0x6536('0x37')][_0x6536('0x39')]?_0x1a5c13[_0x6536('0x37')]:_0x578677[_0x6536('0x32')];_0x1a5c13[_0x6536('0x3c')]=qs['sort'](_0x315cdc[_0x6536('0x33')]['sort']);_0x1a5c13[_0x6536('0x3e')]=qs['filters'](_[_0x6536('0x84')](_0x315cdc['query'],_0x578677[_0x6536('0x35')]));if(_0x315cdc[_0x6536('0x33')][_0x6536('0x41')]){_0x1a5c13['where']=_['merge'](_0x1a5c13[_0x6536('0x3e')],{'$or':_[_0x6536('0x30')](_0x1a5c13['attributes'],function(_0x17f124){var _0x4c8285={};_0x4c8285[_0x17f124]={'$like':'%'+_0x315cdc[_0x6536('0x33')][_0x6536('0x41')]+'%'};return _0x4c8285;})});}_0x1a5c13=_[_0x6536('0x3f')]({},_0x1a5c13,_0x315cdc[_0x6536('0x42')]);return _0x469810[_0x6536('0x85')](_0x1a5c13);}})[_0x6536('0x27')](function(_0x3fa906){if(_0x3fa906){_0x21d0c5=_0x3fa906[_0x6536('0x39')];if(!_0x315cdc[_0x6536('0x33')][_0x6536('0x3a')](_0x6536('0x3b'))){_0x1a5c13[_0x6536('0x1f')]=qs[_0x6536('0x1f')](_0x315cdc[_0x6536('0x33')][_0x6536('0x1f')]);_0x1a5c13[_0x6536('0x1e')]=qs['offset'](_0x315cdc[_0x6536('0x33')][_0x6536('0x1e')]);}return _0x469810[_0x6536('0x85')](_0x1a5c13);}})[_0x6536('0x27')](function(_0x1d2093){if(_0x1d2093){return _0x1d2093?{'count':_0x21d0c5,'rows':_0x1d2093}:null;}})[_0x6536('0x27')](respondWithResult(_0x468c7e,null))[_0x6536('0x46')](handleError(_0x468c7e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4e11698..1f4fc86 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 _0xb586=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit'];(function(_0x4d776a,_0x5dbaea){var _0x8d1ae5=function(_0x1cd501){while(--_0x1cd501){_0x4d776a['push'](_0x4d776a['shift']());}};_0x8d1ae5(++_0x5dbaea);}(_0xb586,0xbf));var _0x6b58=function(_0x417774,_0x1b95e6){_0x417774=_0x417774-0x0;var _0x10015d=_0xb586[_0x417774];return _0x10015d;};'use strict';var EventEmitter=require(_0x6b58('0x0'));var OpenchannelQueue=require(_0x6b58('0x1'))['db'][_0x6b58('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6b58('0x3')](0x0);var events={'afterCreate':_0x6b58('0x4'),'afterUpdate':'update','afterDestroy':_0x6b58('0x5')};function emitEvent(_0xf66832){return function(_0x22ee56,_0x10189e,_0x2a874c){OpenchannelQueueEvents['emit'](_0xf66832+':'+_0x22ee56['id'],_0x22ee56);OpenchannelQueueEvents[_0x6b58('0x6')](_0xf66832,_0x22ee56);_0x2a874c(null);};}for(var e in events){if(events[_0x6b58('0x7')](e)){var event=events[e];OpenchannelQueue[_0x6b58('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x6505=['emit','hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x6505,0xd6));var _0x5650=function(_0x477234,_0x2e87b1){_0x477234=_0x477234-0x0;var _0x2211df=_0x6505[_0x477234];return _0x2211df;};'use strict';var EventEmitter=require(_0x5650('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x5650('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5650('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x129181){return function(_0x1f14a9,_0x42aa49,_0x5751c0){OpenchannelQueueEvents[_0x5650('0x3')](_0x129181+':'+_0x1f14a9['id'],_0x1f14a9);OpenchannelQueueEvents[_0x5650('0x3')](_0x129181,_0x1f14a9);_0x5751c0(null);};}for(var e in events){if(events[_0x5650('0x4')](e)){var event=events[e];OpenchannelQueue[_0x5650('0x5')](e,emitEvent(event));}}module[_0x5650('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index b945ca9..95daa5c 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 _0x43d2=['util','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash'];(function(_0xd5a01a,_0x34eee9){var _0x30fb60=function(_0x5d4e0a){while(--_0x5d4e0a){_0xd5a01a['push'](_0xd5a01a['shift']());}};_0x30fb60(++_0x34eee9);}(_0x43d2,0x81));var _0x243d=function(_0x11ad93,_0x49306a){_0x11ad93=_0x11ad93-0x0;var _0x50535e=_0x43d2[_0x11ad93];return _0x50535e;};'use strict';var _=require(_0x243d('0x0'));var util=require(_0x243d('0x1'));var logger=require('../../config/logger')(_0x243d('0x2'));var moment=require('moment');var BPromise=require(_0x243d('0x3'));var rp=require(_0x243d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x243d('0x5'));var config=require(_0x243d('0x6'));var attributes=require(_0x243d('0x7'));module['exports']=function(_0x551ced,_0x3229f8){return _0x551ced[_0x243d('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x243d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a8b=['openchannel_queues','lodash','../../config/logger','moment','bluebird','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x8a8b,0x1c3));var _0xb8a8=function(_0x271b32,_0x3d4e01){_0x271b32=_0x271b32-0x0;var _0x21ac9c=_0x8a8b[_0x271b32];return _0x21ac9c;};'use strict';var _=require(_0xb8a8('0x0'));var util=require('util');var logger=require(_0xb8a8('0x1'))('api');var moment=require(_0xb8a8('0x2'));var BPromise=require(_0xb8a8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb8a8('0x4'));var attributes=require(_0xb8a8('0x5'));module[_0xb8a8('0x6')]=function(_0x2566bc,_0x340142){return _0x2566bc['define'](_0xb8a8('0x7'),attributes,{'tableName':_0xb8a8('0x8'),'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 2049f53..1258e5a 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 _0x959c=['attributes','limit','include','model','map','debug','find','ShowOpenchannelQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','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','options','raw','where'];(function(_0x3a150b,_0x1c4347){var _0x48d248=function(_0x174e58){while(--_0x174e58){_0x3a150b['push'](_0x3a150b['shift']());}};_0x48d248(++_0x1c4347);}(_0x959c,0x170));var _0xc959=function(_0x5aa836,_0x4950b7){_0x5aa836=_0x5aa836-0x0;var _0x2b570b=_0x959c[_0x5aa836];return _0x2b570b;};'use strict';var _=require('lodash');var util=require(_0xc959('0x0'));var moment=require(_0xc959('0x1'));var BPromise=require(_0xc959('0x2'));var rs=require(_0xc959('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc959('0x4'))['db'];var utils=require(_0xc959('0x5'));var logger=require('../../config/logger')(_0xc959('0x6'));var config=require(_0xc959('0x7'));var jayson=require(_0xc959('0x8'));var client=jayson[_0xc959('0x9')]['http']({'port':0x232a});config[_0xc959('0xa')]=_[_0xc959('0xb')](config[_0xc959('0xa')],{'host':_0xc959('0xc'),'port':0x18eb});var socket=require(_0xc959('0xd'))(new Redis(config['redis']));require(_0xc959('0xe'))['register'](socket);function respondWithRpcPromise(_0x24545a,_0x4976c1,_0x3d0129){return new BPromise(function(_0x2083cf,_0x256a33){return client[_0xc959('0xf')](_0x24545a,_0x3d0129)[_0xc959('0x10')](function(_0x4ae294){logger[_0xc959('0x11')](_0xc959('0x12'),_0x4976c1,_0xc959('0x13'));logger['debug'](_0xc959('0x14'),_0x4976c1,_0xc959('0x13'),JSON[_0xc959('0x15')](_0x4ae294));if(_0x4ae294[_0xc959('0x16')]){if(_0x4ae294[_0xc959('0x16')][_0xc959('0x17')]===0x1f4){logger['error'](_0xc959('0x12'),_0x4976c1,_0x4ae294[_0xc959('0x16')]['message']);return _0x256a33(_0x4ae294['error'][_0xc959('0x18')]);}logger[_0xc959('0x16')](_0xc959('0x12'),_0x4976c1,_0x4ae294[_0xc959('0x16')][_0xc959('0x18')]);return _0x2083cf(_0x4ae294['error']['message']);}else{logger['info'](_0xc959('0x12'),_0x4976c1,_0xc959('0x13'));_0x2083cf(_0x4ae294[_0xc959('0x19')]['message']);}})[_0xc959('0x1a')](function(_0x3ef617){logger['error'](_0xc959('0x12'),_0x4976c1,_0x3ef617);_0x256a33(_0x3ef617);});});}exports[_0xc959('0x1b')]=function(_0x193e81){var _0x1c061c=this;return new Promise(function(_0x1e4dc7,_0x5b079a){return db[_0xc959('0x1c')]['findAll']({'raw':_0x193e81[_0xc959('0x1d')]?_0x193e81[_0xc959('0x1d')][_0xc959('0x1e')]===undefined?!![]:![]:!![],'where':_0x193e81[_0xc959('0x1d')]?_0x193e81[_0xc959('0x1d')][_0xc959('0x1f')]||null:null,'attributes':_0x193e81[_0xc959('0x1d')]?_0x193e81[_0xc959('0x1d')][_0xc959('0x20')]||null:null,'limit':_0x193e81[_0xc959('0x1d')]?_0x193e81[_0xc959('0x1d')][_0xc959('0x21')]||null:null,'include':_0x193e81[_0xc959('0x1d')]?_0x193e81[_0xc959('0x1d')][_0xc959('0x22')]?_['map'](_0x193e81[_0xc959('0x1d')][_0xc959('0x22')],function(_0x46eba3){return{'model':db[_0x46eba3[_0xc959('0x23')]],'as':_0x46eba3['as'],'attributes':_0x46eba3[_0xc959('0x20')],'include':_0x46eba3[_0xc959('0x22')]?_[_0xc959('0x24')](_0x46eba3[_0xc959('0x22')],function(_0x2de4a8){return{'model':db[_0x2de4a8['model']],'as':_0x2de4a8['as'],'attributes':_0x2de4a8[_0xc959('0x20')],'include':_0x2de4a8['include']?_[_0xc959('0x24')](_0x2de4a8['include'],function(_0x50a989){return{'model':db[_0x50a989[_0xc959('0x23')]],'as':_0x50a989['as'],'attributes':_0x50a989[_0xc959('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc959('0x10')](function(_0x1ba440){logger[_0xc959('0x11')](_0xc959('0x1b'),_0x193e81);logger[_0xc959('0x25')]('GetOpenchannelQueue',_0x193e81,JSON[_0xc959('0x15')](_0x1ba440));_0x1e4dc7(_0x1ba440);})[_0xc959('0x1a')](function(_0x4b53c3){logger[_0xc959('0x16')]('GetOpenchannelQueue',_0x4b53c3[_0xc959('0x18')],_0x193e81);_0x5b079a(_0x1c061c[_0xc959('0x16')](0x1f4,_0x4b53c3['message']));});});};exports['ShowOpenchannelQueue']=function(_0xc737dc){var _0x54d9c6=this;return new Promise(function(_0x719e01,_0x1f5be8){return db[_0xc959('0x1c')][_0xc959('0x26')]({'raw':_0xc737dc[_0xc959('0x1d')]?_0xc737dc[_0xc959('0x1d')][_0xc959('0x1e')]===undefined?!![]:![]:!![],'where':_0xc737dc[_0xc959('0x1d')]?_0xc737dc['options']['where']||null:null,'attributes':_0xc737dc[_0xc959('0x1d')]?_0xc737dc[_0xc959('0x1d')][_0xc959('0x20')]||null:null,'include':_0xc737dc[_0xc959('0x1d')]?_0xc737dc[_0xc959('0x1d')][_0xc959('0x22')]?_[_0xc959('0x24')](_0xc737dc[_0xc959('0x1d')][_0xc959('0x22')],function(_0x484869){return{'model':db[_0x484869[_0xc959('0x23')]],'as':_0x484869['as'],'attributes':_0x484869[_0xc959('0x20')],'include':_0x484869[_0xc959('0x22')]?_[_0xc959('0x24')](_0x484869[_0xc959('0x22')],function(_0xc1c936){return{'model':db[_0xc1c936[_0xc959('0x23')]],'as':_0xc1c936['as'],'attributes':_0xc1c936['attributes'],'include':_0xc1c936['include']?_[_0xc959('0x24')](_0xc1c936[_0xc959('0x22')],function(_0x4ec67e){return{'model':db[_0x4ec67e[_0xc959('0x23')]],'as':_0x4ec67e['as'],'attributes':_0x4ec67e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc959('0x10')](function(_0x3271e1){logger[_0xc959('0x11')](_0xc959('0x27'),_0xc737dc);logger[_0xc959('0x25')](_0xc959('0x27'),_0xc737dc,JSON['stringify'](_0x3271e1));_0x719e01(_0x3271e1);})[_0xc959('0x1a')](function(_0x47b8ad){logger['error'](_0xc959('0x27'),_0x47b8ad[_0xc959('0x18')],_0xc737dc);_0x1f5be8(_0x54d9c6[_0xc959('0x16')](0x1f4,_0x47b8ad[_0xc959('0x18')]));});});}; \ No newline at end of file +var _0xbe59=['localhost','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','OpenchannelQueue','options','raw','where','attributes','map','include','model','GetOpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbe59,0x1d5));var _0x9be5=function(_0x28de78,_0x4b4bc8){_0x28de78=_0x28de78-0x0;var _0x5dc827=_0xbe59[_0x28de78];return _0x5dc827;};'use strict';var _=require(_0x9be5('0x0'));var util=require(_0x9be5('0x1'));var moment=require(_0x9be5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9be5('0x3'));var db=require(_0x9be5('0x4'))['db'];var utils=require(_0x9be5('0x5'));var logger=require(_0x9be5('0x6'))(_0x9be5('0x7'));var config=require(_0x9be5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9be5('0x9')]({'port':0x232a});config[_0x9be5('0xa')]=_[_0x9be5('0xb')](config[_0x9be5('0xa')],{'host':_0x9be5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9be5('0xa')]));require(_0x9be5('0xd'))[_0x9be5('0xe')](socket);function respondWithRpcPromise(_0x55a4e7,_0x55ec7f,_0x38a708){return new BPromise(function(_0xb8d67a,_0x48adec){return client[_0x9be5('0xf')](_0x55a4e7,_0x38a708)[_0x9be5('0x10')](function(_0x318cb3){logger['info'](_0x9be5('0x11'),_0x55ec7f,_0x9be5('0x12'));logger[_0x9be5('0x13')](_0x9be5('0x14'),_0x55ec7f,_0x9be5('0x12'),JSON[_0x9be5('0x15')](_0x318cb3));if(_0x318cb3[_0x9be5('0x16')]){if(_0x318cb3['error']['code']===0x1f4){logger[_0x9be5('0x16')](_0x9be5('0x11'),_0x55ec7f,_0x318cb3[_0x9be5('0x16')][_0x9be5('0x17')]);return _0x48adec(_0x318cb3[_0x9be5('0x16')][_0x9be5('0x17')]);}logger[_0x9be5('0x16')](_0x9be5('0x11'),_0x55ec7f,_0x318cb3[_0x9be5('0x16')][_0x9be5('0x17')]);return _0xb8d67a(_0x318cb3['error'][_0x9be5('0x17')]);}else{logger[_0x9be5('0x18')](_0x9be5('0x11'),_0x55ec7f,_0x9be5('0x12'));_0xb8d67a(_0x318cb3[_0x9be5('0x19')]['message']);}})[_0x9be5('0x1a')](function(_0x4a747f){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x55ec7f,_0x4a747f);_0x48adec(_0x4a747f);});});}exports['GetOpenchannelQueue']=function(_0xddaed8){var _0x26dd71=this;return new Promise(function(_0x248995,_0x180404){return db[_0x9be5('0x1b')]['findAll']({'raw':_0xddaed8[_0x9be5('0x1c')]?_0xddaed8[_0x9be5('0x1c')][_0x9be5('0x1d')]===undefined?!![]:![]:!![],'where':_0xddaed8[_0x9be5('0x1c')]?_0xddaed8[_0x9be5('0x1c')][_0x9be5('0x1e')]||null:null,'attributes':_0xddaed8['options']?_0xddaed8[_0x9be5('0x1c')][_0x9be5('0x1f')]||null:null,'limit':_0xddaed8[_0x9be5('0x1c')]?_0xddaed8[_0x9be5('0x1c')]['limit']||null:null,'include':_0xddaed8[_0x9be5('0x1c')]?_0xddaed8[_0x9be5('0x1c')]['include']?_[_0x9be5('0x20')](_0xddaed8[_0x9be5('0x1c')][_0x9be5('0x21')],function(_0x1c37c4){return{'model':db[_0x1c37c4[_0x9be5('0x22')]],'as':_0x1c37c4['as'],'attributes':_0x1c37c4[_0x9be5('0x1f')],'include':_0x1c37c4[_0x9be5('0x21')]?_['map'](_0x1c37c4[_0x9be5('0x21')],function(_0x27f1be){return{'model':db[_0x27f1be[_0x9be5('0x22')]],'as':_0x27f1be['as'],'attributes':_0x27f1be[_0x9be5('0x1f')],'include':_0x27f1be[_0x9be5('0x21')]?_[_0x9be5('0x20')](_0x27f1be['include'],function(_0x346579){return{'model':db[_0x346579[_0x9be5('0x22')]],'as':_0x346579['as'],'attributes':_0x346579[_0x9be5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x712580){logger[_0x9be5('0x18')]('GetOpenchannelQueue',_0xddaed8);logger[_0x9be5('0x13')](_0x9be5('0x23'),_0xddaed8,JSON[_0x9be5('0x15')](_0x712580));_0x248995(_0x712580);})[_0x9be5('0x1a')](function(_0x594d49){logger[_0x9be5('0x16')](_0x9be5('0x23'),_0x594d49[_0x9be5('0x17')],_0xddaed8);_0x180404(_0x26dd71[_0x9be5('0x16')](0x1f4,_0x594d49[_0x9be5('0x17')]));});});};exports[_0x9be5('0x24')]=function(_0x35ed92){var _0x381789=this;return new Promise(function(_0x1a720f,_0x12eede){return db[_0x9be5('0x1b')]['find']({'raw':_0x35ed92[_0x9be5('0x1c')]?_0x35ed92[_0x9be5('0x1c')][_0x9be5('0x1d')]===undefined?!![]:![]:!![],'where':_0x35ed92[_0x9be5('0x1c')]?_0x35ed92[_0x9be5('0x1c')][_0x9be5('0x1e')]||null:null,'attributes':_0x35ed92['options']?_0x35ed92[_0x9be5('0x1c')][_0x9be5('0x1f')]||null:null,'include':_0x35ed92[_0x9be5('0x1c')]?_0x35ed92['options']['include']?_['map'](_0x35ed92['options'][_0x9be5('0x21')],function(_0x406fe2){return{'model':db[_0x406fe2[_0x9be5('0x22')]],'as':_0x406fe2['as'],'attributes':_0x406fe2[_0x9be5('0x1f')],'include':_0x406fe2[_0x9be5('0x21')]?_[_0x9be5('0x20')](_0x406fe2[_0x9be5('0x21')],function(_0x259296){return{'model':db[_0x259296[_0x9be5('0x22')]],'as':_0x259296['as'],'attributes':_0x259296['attributes'],'include':_0x259296[_0x9be5('0x21')]?_[_0x9be5('0x20')](_0x259296[_0x9be5('0x21')],function(_0x2495c3){return{'model':db[_0x2495c3[_0x9be5('0x22')]],'as':_0x2495c3['as'],'attributes':_0x2495c3[_0x9be5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9be5('0x10')](function(_0x5d2843){logger['info'](_0x9be5('0x24'),_0x35ed92);logger['debug'](_0x9be5('0x24'),_0x35ed92,JSON['stringify'](_0x5d2843));_0x1a720f(_0x5d2843);})[_0x9be5('0x1a')](function(_0x5bacca){logger[_0x9be5('0x16')](_0x9be5('0x24'),_0x5bacca[_0x9be5('0x17')],_0x35ed92);_0x12eede(_0x381789[_0x9be5('0x16')](0x1f4,_0x5bacca['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c260fd1..de79200 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 _0x8057=['remove','update','emit','removeListener','openchannelQueue:'];(function(_0x102660,_0x244f30){var _0x1034dd=function(_0x167009){while(--_0x167009){_0x102660['push'](_0x102660['shift']());}};_0x1034dd(++_0x244f30);}(_0x8057,0x140));var _0x7805=function(_0x201bb6,_0x15051d){_0x201bb6=_0x201bb6-0x0;var _0x124ee2=_0x8057[_0x201bb6];return _0x124ee2;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x7805('0x0'),_0x7805('0x1')];function createListener(_0x581d25,_0x396fad){return function(_0x42fcf7){_0x396fad[_0x7805('0x2')](_0x581d25,_0x42fcf7);};}function removeListener(_0x5f2844,_0x4e9a91){return function(){OpenchannelQueueEvents[_0x7805('0x3')](_0x5f2844,_0x4e9a91);};}exports['register']=function(_0x2ed71d){for(var _0xf2715b=0x0,_0x43df01=events['length'];_0xf2715b<_0x43df01;_0xf2715b++){var _0x132ac1=events[_0xf2715b];var _0x5318af=createListener(_0x7805('0x4')+_0x132ac1,_0x2ed71d);OpenchannelQueueEvents['on'](_0x132ac1,_0x5318af);}}; \ No newline at end of file +var _0x01de=['./openchannelQueue.events','save','remove','emit','removeListener','length','openchannelQueue:'];(function(_0x1a561a,_0x16a3a0){var _0x54c1f3=function(_0x1f975d){while(--_0x1f975d){_0x1a561a['push'](_0x1a561a['shift']());}};_0x54c1f3(++_0x16a3a0);}(_0x01de,0xe7));var _0xe01d=function(_0xe43e3f,_0x23b3e1){_0xe43e3f=_0xe43e3f-0x0;var _0x47fb5c=_0x01de[_0xe43e3f];return _0x47fb5c;};'use strict';var OpenchannelQueueEvents=require(_0xe01d('0x0'));var events=[_0xe01d('0x1'),_0xe01d('0x2'),'update'];function createListener(_0x4db02b,_0x4f2a73){return function(_0x80e435){_0x4f2a73[_0xe01d('0x3')](_0x4db02b,_0x80e435);};}function removeListener(_0x185f95,_0x119ea5){return function(){OpenchannelQueueEvents[_0xe01d('0x4')](_0x185f95,_0x119ea5);};}exports['register']=function(_0xd77537){for(var _0x499023=0x0,_0x34aa98=events[_0xe01d('0x5')];_0x499023<_0x34aa98;_0x499023++){var _0x1151ee=events[_0x499023];var _0x4e5382=createListener(_0xe01d('0x6')+_0x1151ee,_0xd77537);OpenchannelQueueEvents['on'](_0x1151ee,_0x4e5382);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1cecb77..e2c05a3 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 _0x1940=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x4623d3,_0x3910bb){var _0x33e622=function(_0x3b958e){while(--_0x3b958e){_0x4623d3['push'](_0x4623d3['shift']());}};_0x33e622(++_0x3910bb);}(_0x1940,0xc1));var _0x0194=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x1940[_0x1168a1];return _0xcc5ad8;};'use strict';var multer=require(_0x0194('0x0'));var util=require(_0x0194('0x1'));var path=require(_0x0194('0x2'));var timeout=require(_0x0194('0x3'));var express=require('express');var router=express[_0x0194('0x4')]();var fs_extra=require(_0x0194('0x5'));var auth=require(_0x0194('0x6'));var interaction=require(_0x0194('0x7'));var config=require(_0x0194('0x8'));var controller=require(_0x0194('0x9'));router[_0x0194('0xa')]('/',auth[_0x0194('0xb')](),controller[_0x0194('0xc')]);router[_0x0194('0xa')](_0x0194('0xd'),auth[_0x0194('0xb')](),controller['describe']);router[_0x0194('0xa')](_0x0194('0xe'),auth[_0x0194('0xb')](),controller[_0x0194('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0194('0x10')]);router[_0x0194('0x11')](_0x0194('0xe'),auth[_0x0194('0xb')](),controller[_0x0194('0x12')]);router[_0x0194('0x13')](_0x0194('0xe'),auth[_0x0194('0xb')](),controller['destroy']);module[_0x0194('0x14')]=router; \ No newline at end of file +var _0xfed2=['post','create','put','update','delete','destroy','exports','multer','Router','../../components/auth/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show'];(function(_0x21bef5,_0x27b94a){var _0x524300=function(_0x4d907f){while(--_0x4d907f){_0x21bef5['push'](_0x21bef5['shift']());}};_0x524300(++_0x27b94a);}(_0xfed2,0x139));var _0x2fed=function(_0x515e31,_0x35c05a){_0x515e31=_0x515e31-0x0;var _0x302b7c=_0xfed2[_0x515e31];return _0x302b7c;};'use strict';var multer=require(_0x2fed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fed('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x2fed('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2fed('0x3'));var controller=require('./openchannelQueueReport.controller');router[_0x2fed('0x4')]('/',auth['isAuthenticated'](),controller[_0x2fed('0x5')]);router[_0x2fed('0x4')](_0x2fed('0x6'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2fed('0x7'),auth[_0x2fed('0x8')](),controller[_0x2fed('0x9')]);router[_0x2fed('0xa')]('/',auth['isAuthenticated'](),controller[_0x2fed('0xb')]);router[_0x2fed('0xc')](_0x2fed('0x7'),auth['isAuthenticated'](),controller[_0x2fed('0xd')]);router[_0x2fed('0xe')]('/:id',auth[_0x2fed('0x8')](),controller[_0x2fed('0xf')]);module[_0x2fed('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 6341124..94508bd 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 _0xa819=['moment','exports','STRING','DATE'];(function(_0x31c8b8,_0x51b831){var _0x5da7d1=function(_0xa38a68){while(--_0xa38a68){_0x31c8b8['push'](_0x31c8b8['shift']());}};_0x5da7d1(++_0x51b831);}(_0xa819,0xa8));var _0x9a81=function(_0xce7d57,_0x620f8f){_0xce7d57=_0xce7d57-0x0;var _0x32032f=_0xa819[_0xce7d57];return _0x32032f;};'use strict';var moment=require(_0x9a81('0x0'));var Sequelize=require('sequelize');module[_0x9a81('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9a81('0x2')]},'joinAt':{'type':Sequelize[_0x9a81('0x3')]},'leaveAt':{'type':Sequelize[_0x9a81('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9a81('0x2')]}}; \ No newline at end of file +var _0x8446=['DATE','moment','sequelize','exports','STRING'];(function(_0x368e12,_0x3e103f){var _0x23add9=function(_0x21da21){while(--_0x21da21){_0x368e12['push'](_0x368e12['shift']());}};_0x23add9(++_0x3e103f);}(_0x8446,0xfb));var _0x6844=function(_0x55de31,_0x26a8a8){_0x55de31=_0x55de31-0x0;var _0x37d2f2=_0x8446[_0x55de31];return _0x37d2f2;};'use strict';var moment=require(_0x6844('0x0'));var Sequelize=require(_0x6844('0x1'));module[_0x6844('0x2')]={'uniqueid':{'type':Sequelize[_0x6844('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6844('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6844('0x4')]},'reason':{'type':Sequelize[_0x6844('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 010330c..26aedc1 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 _0x8a0d=['sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','update','then','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x38a6c6,_0x4062ca){var _0x142f0a=function(_0x1531ce){while(--_0x1531ce){_0x38a6c6['push'](_0x38a6c6['shift']());}};_0x142f0a(++_0x4062ca);}(_0x8a0d,0x1a8));var _0xd8a0=function(_0x14c3b8,_0x1e444c){_0x14c3b8=_0x14c3b8-0x0;var _0x4538c0=_0x8a0d[_0x14c3b8];return _0x4538c0;};'use strict';var emlformat=require(_0xd8a0('0x0'));var rimraf=require(_0xd8a0('0x1'));var zipdir=require(_0xd8a0('0x2'));var jsonpatch=require(_0xd8a0('0x3'));var rp=require('request-promise');var moment=require(_0xd8a0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8a0('0x5'));var util=require(_0xd8a0('0x6'));var path=require(_0xd8a0('0x7'));var sox=require('sox');var csv=require(_0xd8a0('0x8'));var ejs=require(_0xd8a0('0x9'));var fs=require('fs');var fs_extra=require(_0xd8a0('0xa'));var _=require('lodash');var squel=require(_0xd8a0('0xb'));var crypto=require(_0xd8a0('0xc'));var jsforce=require(_0xd8a0('0xd'));var deskjs=require(_0xd8a0('0xe'));var toCsv=require(_0xd8a0('0x8'));var querystring=require('querystring');var Papa=require(_0xd8a0('0xf'));var Redis=require(_0xd8a0('0x10'));var authService=require(_0xd8a0('0x11'));var qs=require(_0xd8a0('0x12'));var as=require(_0xd8a0('0x13'));var hardwareService=require(_0xd8a0('0x14'));var logger=require('../../config/logger')(_0xd8a0('0x15'));var utils=require(_0xd8a0('0x16'));var config=require(_0xd8a0('0x17'));var licenseUtil=require(_0xd8a0('0x18'));var db=require(_0xd8a0('0x19'))['db'];function respondWithStatusCode(_0x59aab0,_0x1680a7){_0x1680a7=_0x1680a7||0xcc;return function(_0x544562){if(_0x544562){return _0x59aab0[_0xd8a0('0x1a')](_0x1680a7);}return _0x59aab0[_0xd8a0('0x1b')](_0x1680a7)[_0xd8a0('0x1c')]();};}function respondWithResult(_0x5a75be,_0x30ee57){_0x30ee57=_0x30ee57||0xc8;return function(_0x2384b0){if(_0x2384b0){return _0x5a75be['status'](_0x30ee57)['json'](_0x2384b0);}};}function respondWithFilteredResult(_0x528c62,_0x396134){return function(_0x4e3ff8){if(_0x4e3ff8){var _0xd19373=typeof _0x396134['offset']===_0xd8a0('0x1d')&&typeof _0x396134[_0xd8a0('0x1e')]==='undefined';var _0x18d839=_0x4e3ff8['count'];var _0x45169e=_0xd19373?0x0:_0x396134[_0xd8a0('0x1f')];var _0x5e984c=_0xd19373?_0x4e3ff8[_0xd8a0('0x20')]:_0x396134['offset']+_0x396134['limit'];var _0x455ad0;if(_0x5e984c>=_0x18d839){_0x5e984c=_0x18d839;_0x455ad0=0xc8;}else{_0x455ad0=0xce;}_0x528c62[_0xd8a0('0x1b')](_0x455ad0);return _0x528c62[_0xd8a0('0x21')](_0xd8a0('0x22'),_0x45169e+'-'+_0x5e984c+'/'+_0x18d839)[_0xd8a0('0x23')](_0x4e3ff8);}return null;};}function patchUpdates(_0x2cdd1b){return function(_0x4683e7){try{jsonpatch[_0xd8a0('0x24')](_0x4683e7,_0x2cdd1b,!![]);}catch(_0x244903){return BPromise['reject'](_0x244903);}return _0x4683e7['save']();};}function saveUpdates(_0x51f8fc,_0x4b1ceb){return function(_0x2f8891){if(_0x2f8891){return _0x2f8891[_0xd8a0('0x25')](_0x51f8fc)[_0xd8a0('0x26')](function(_0x2375eb){return _0x2375eb;});}return null;};}function removeEntity(_0x4c5ca5,_0x536fe0){return function(_0x29186e){if(_0x29186e){return _0x29186e['destroy']()[_0xd8a0('0x26')](function(){_0x4c5ca5[_0xd8a0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c83b7,_0x5f4dae){return function(_0x27f39c){if(!_0x27f39c){_0x4c83b7['sendStatus'](0x194);}return _0x27f39c;};}function handleError(_0x2fa36e,_0x559f92){_0x559f92=_0x559f92||0x1f4;return function(_0x5cfde6){logger['error'](_0x5cfde6[_0xd8a0('0x27')]);if(_0x5cfde6[_0xd8a0('0x28')]){delete _0x5cfde6[_0xd8a0('0x28')];}_0x2fa36e[_0xd8a0('0x1b')](_0x559f92)[_0xd8a0('0x29')](_0x5cfde6);};}exports[_0xd8a0('0x2a')]=function(_0x4b82d1,_0x5308e4){var _0x1252eb={},_0x186f83={},_0x38b115={'count':0x0,'rows':[]};var _0x5ee0de=_[_0xd8a0('0x2b')](db[_0xd8a0('0x2c')][_0xd8a0('0x2d')],function(_0x17ed26){return{'name':_0x17ed26[_0xd8a0('0x2e')],'type':_0x17ed26[_0xd8a0('0x2f')][_0xd8a0('0x30')]};});_0x186f83[_0xd8a0('0x31')]=_[_0xd8a0('0x2b')](_0x5ee0de,_0xd8a0('0x28'));_0x186f83['query']=_[_0xd8a0('0x32')](_0x4b82d1[_0xd8a0('0x33')]);_0x186f83['filters']=_[_0xd8a0('0x34')](_0x186f83[_0xd8a0('0x31')],_0x186f83['query']);_0x1252eb[_0xd8a0('0x35')]=_['intersection'](_0x186f83['model'],qs[_0xd8a0('0x36')](_0x4b82d1[_0xd8a0('0x33')][_0xd8a0('0x36')]));_0x1252eb[_0xd8a0('0x35')]=_0x1252eb[_0xd8a0('0x35')][_0xd8a0('0x37')]?_0x1252eb[_0xd8a0('0x35')]:_0x186f83[_0xd8a0('0x31')];if(!_0x4b82d1[_0xd8a0('0x33')][_0xd8a0('0x38')](_0xd8a0('0x39'))){_0x1252eb[_0xd8a0('0x1e')]=qs[_0xd8a0('0x1e')](_0x4b82d1['query'][_0xd8a0('0x1e')]);_0x1252eb[_0xd8a0('0x1f')]=qs[_0xd8a0('0x1f')](_0x4b82d1[_0xd8a0('0x33')][_0xd8a0('0x1f')]);}_0x1252eb['order']=qs[_0xd8a0('0x3a')](_0x4b82d1[_0xd8a0('0x33')]['sort']);_0x1252eb[_0xd8a0('0x3b')]=qs[_0xd8a0('0x3c')](_[_0xd8a0('0x3d')](_0x4b82d1[_0xd8a0('0x33')],_0x186f83[_0xd8a0('0x3c')]),_0x5ee0de);if(_0x4b82d1[_0xd8a0('0x33')][_0xd8a0('0x3e')]){_0x1252eb['where']=_[_0xd8a0('0x3f')](_0x1252eb[_0xd8a0('0x3b')],{'$or':_[_0xd8a0('0x2b')](_0x5ee0de,function(_0x4028be){if(_0x4028be[_0xd8a0('0x2f')]!==_0xd8a0('0x40')){var _0x2ad331={};_0x2ad331[_0x4028be[_0xd8a0('0x28')]]={'$like':'%'+_0x4b82d1[_0xd8a0('0x33')]['filter']+'%'};return _0x2ad331;}})});}_0x1252eb=_['merge']({},_0x1252eb,_0x4b82d1[_0xd8a0('0x41')]);var _0xb9343d={'where':_0x1252eb['where']};return db[_0xd8a0('0x2c')][_0xd8a0('0x20')](_0xb9343d)[_0xd8a0('0x26')](function(_0x347aa8){_0x38b115[_0xd8a0('0x20')]=_0x347aa8;if(_0x4b82d1[_0xd8a0('0x33')][_0xd8a0('0x42')]){_0x1252eb[_0xd8a0('0x43')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xd8a0('0x44')](_0x1252eb);})[_0xd8a0('0x26')](function(_0x5054c0){_0x38b115['rows']=_0x5054c0;return _0x38b115;})['then'](respondWithFilteredResult(_0x5308e4,_0x1252eb))['catch'](handleError(_0x5308e4,null));};exports['show']=function(_0x2424bf,_0x352a36){var _0x3f72ef={'raw':!![],'where':{'id':_0x2424bf[_0xd8a0('0x45')]['id']}},_0x116b33={};_0x116b33[_0xd8a0('0x31')]=_['keys'](db['OpenchannelQueueReport'][_0xd8a0('0x2d')]);_0x116b33[_0xd8a0('0x33')]=_[_0xd8a0('0x32')](_0x2424bf['query']);_0x116b33['filters']=_[_0xd8a0('0x34')](_0x116b33[_0xd8a0('0x31')],_0x116b33[_0xd8a0('0x33')]);_0x3f72ef[_0xd8a0('0x35')]=_[_0xd8a0('0x34')](_0x116b33['model'],qs[_0xd8a0('0x36')](_0x2424bf[_0xd8a0('0x33')][_0xd8a0('0x36')]));_0x3f72ef[_0xd8a0('0x35')]=_0x3f72ef[_0xd8a0('0x35')][_0xd8a0('0x37')]?_0x3f72ef[_0xd8a0('0x35')]:_0x116b33[_0xd8a0('0x31')];if(_0x2424bf[_0xd8a0('0x33')][_0xd8a0('0x42')]){_0x3f72ef[_0xd8a0('0x43')]=[{'all':!![]}];}_0x3f72ef=_[_0xd8a0('0x3f')]({},_0x3f72ef,_0x2424bf[_0xd8a0('0x41')]);return db[_0xd8a0('0x2c')][_0xd8a0('0x46')](_0x3f72ef)[_0xd8a0('0x26')](handleEntityNotFound(_0x352a36,null))[_0xd8a0('0x26')](respondWithResult(_0x352a36,null))[_0xd8a0('0x47')](handleError(_0x352a36,null));};exports['create']=function(_0x299752,_0x8ef429){return db[_0xd8a0('0x2c')]['create'](_0x299752[_0xd8a0('0x48')],{})[_0xd8a0('0x26')](respondWithResult(_0x8ef429,0xc9))[_0xd8a0('0x47')](handleError(_0x8ef429,null));};exports[_0xd8a0('0x25')]=function(_0x12de06,_0x41ad4c){if(_0x12de06[_0xd8a0('0x48')]['id']){delete _0x12de06[_0xd8a0('0x48')]['id'];}return db[_0xd8a0('0x2c')]['find']({'where':{'id':_0x12de06[_0xd8a0('0x45')]['id']}})[_0xd8a0('0x26')](handleEntityNotFound(_0x41ad4c,null))['then'](saveUpdates(_0x12de06[_0xd8a0('0x48')],null))[_0xd8a0('0x26')](respondWithResult(_0x41ad4c,null))[_0xd8a0('0x47')](handleError(_0x41ad4c,null));};exports[_0xd8a0('0x49')]=function(_0x3208dd,_0x280313){return db[_0xd8a0('0x2c')][_0xd8a0('0x46')]({'where':{'id':_0x3208dd[_0xd8a0('0x45')]['id']}})[_0xd8a0('0x26')](handleEntityNotFound(_0x280313,null))[_0xd8a0('0x26')](removeEntity(_0x280313,null))[_0xd8a0('0x47')](handleError(_0x280313,null));};exports['describe']=function(_0x4f1c88,_0x5c2fcb){return db[_0xd8a0('0x2c')][_0xd8a0('0x4a')]()[_0xd8a0('0x26')](respondWithResult(_0x5c2fcb,null))[_0xd8a0('0x47')](handleError(_0x5c2fcb,null));}; \ No newline at end of file +var _0x5acd=['../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','findAll','then','rows','params','rawAttributes','keys','length','include','options','catch','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x298718,_0x31b930){var _0x2df7e1=function(_0x3a3738){while(--_0x3a3738){_0x298718['push'](_0x298718['shift']());}};_0x2df7e1(++_0x31b930);}(_0x5acd,0x7f));var _0xd5ac=function(_0x5060e9,_0xec9fb4){_0x5060e9=_0x5060e9-0x0;var _0x1c8cae=_0x5acd[_0x5060e9];return _0x1c8cae;};'use strict';var emlformat=require(_0xd5ac('0x0'));var rimraf=require(_0xd5ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd5ac('0x2'));var BPromise=require(_0xd5ac('0x3'));var Mustache=require(_0xd5ac('0x4'));var util=require(_0xd5ac('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd5ac('0x6'));var ejs=require(_0xd5ac('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5ac('0x8'));var squel=require(_0xd5ac('0x9'));var crypto=require(_0xd5ac('0xa'));var jsforce=require(_0xd5ac('0xb'));var deskjs=require(_0xd5ac('0xc'));var toCsv=require(_0xd5ac('0x6'));var querystring=require(_0xd5ac('0xd'));var Papa=require(_0xd5ac('0xe'));var Redis=require(_0xd5ac('0xf'));var authService=require(_0xd5ac('0x10'));var qs=require(_0xd5ac('0x11'));var as=require(_0xd5ac('0x12'));var hardwareService=require(_0xd5ac('0x13'));var logger=require(_0xd5ac('0x14'))(_0xd5ac('0x15'));var utils=require(_0xd5ac('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd5ac('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28101b,_0x23fecb){_0x23fecb=_0x23fecb||0xcc;return function(_0x1da645){if(_0x1da645){return _0x28101b['sendStatus'](_0x23fecb);}return _0x28101b['status'](_0x23fecb)['end']();};}function respondWithResult(_0x4fb02b,_0x467bf8){_0x467bf8=_0x467bf8||0xc8;return function(_0x372910){if(_0x372910){return _0x4fb02b[_0xd5ac('0x18')](_0x467bf8)[_0xd5ac('0x19')](_0x372910);}};}function respondWithFilteredResult(_0x52d1d2,_0x599418){return function(_0x458161){if(_0x458161){var _0x4be930=typeof _0x599418[_0xd5ac('0x1a')]===_0xd5ac('0x1b')&&typeof _0x599418[_0xd5ac('0x1c')]===_0xd5ac('0x1b');var _0x494285=_0x458161[_0xd5ac('0x1d')];var _0x1ba105=_0x4be930?0x0:_0x599418[_0xd5ac('0x1a')];var _0x5cbe3c=_0x4be930?_0x458161['count']:_0x599418[_0xd5ac('0x1a')]+_0x599418[_0xd5ac('0x1c')];var _0x15dbb8;if(_0x5cbe3c>=_0x494285){_0x5cbe3c=_0x494285;_0x15dbb8=0xc8;}else{_0x15dbb8=0xce;}_0x52d1d2[_0xd5ac('0x18')](_0x15dbb8);return _0x52d1d2[_0xd5ac('0x1e')]('Content-Range',_0x1ba105+'-'+_0x5cbe3c+'/'+_0x494285)[_0xd5ac('0x19')](_0x458161);}return null;};}function patchUpdates(_0xd872e1){return function(_0x39fdfc){try{jsonpatch[_0xd5ac('0x1f')](_0x39fdfc,_0xd872e1,!![]);}catch(_0x1b2641){return BPromise[_0xd5ac('0x20')](_0x1b2641);}return _0x39fdfc[_0xd5ac('0x21')]();};}function saveUpdates(_0x5f3505,_0x42e5a3){return function(_0xc843a5){if(_0xc843a5){return _0xc843a5[_0xd5ac('0x22')](_0x5f3505)['then'](function(_0x535a4e){return _0x535a4e;});}return null;};}function removeEntity(_0x17195a,_0x9a4134){return function(_0x1a551d){if(_0x1a551d){return _0x1a551d[_0xd5ac('0x23')]()['then'](function(){_0x17195a[_0xd5ac('0x18')](0xcc)[_0xd5ac('0x24')]();});}};}function handleEntityNotFound(_0x1fac1f,_0xbd6163){return function(_0x81b3b1){if(!_0x81b3b1){_0x1fac1f[_0xd5ac('0x25')](0x194);}return _0x81b3b1;};}function handleError(_0x8ff3d4,_0x4c669f){_0x4c669f=_0x4c669f||0x1f4;return function(_0x585273){logger[_0xd5ac('0x26')](_0x585273[_0xd5ac('0x27')]);if(_0x585273[_0xd5ac('0x28')]){delete _0x585273[_0xd5ac('0x28')];}_0x8ff3d4[_0xd5ac('0x18')](_0x4c669f)['send'](_0x585273);};}exports[_0xd5ac('0x29')]=function(_0x262712,_0x1bb3ab){var _0x30a1e4={},_0x579f8f={},_0x56d463={'count':0x0,'rows':[]};var _0x2c2280=_[_0xd5ac('0x2a')](db[_0xd5ac('0x2b')]['rawAttributes'],function(_0x8d4d3e){return{'name':_0x8d4d3e[_0xd5ac('0x2c')],'type':_0x8d4d3e[_0xd5ac('0x2d')][_0xd5ac('0x2e')]};});_0x579f8f[_0xd5ac('0x2f')]=_['map'](_0x2c2280,'name');_0x579f8f[_0xd5ac('0x30')]=_['keys'](_0x262712[_0xd5ac('0x30')]);_0x579f8f[_0xd5ac('0x31')]=_[_0xd5ac('0x32')](_0x579f8f['model'],_0x579f8f[_0xd5ac('0x30')]);_0x30a1e4[_0xd5ac('0x33')]=_[_0xd5ac('0x32')](_0x579f8f[_0xd5ac('0x2f')],qs[_0xd5ac('0x34')](_0x262712[_0xd5ac('0x30')][_0xd5ac('0x34')]));_0x30a1e4[_0xd5ac('0x33')]=_0x30a1e4['attributes']['length']?_0x30a1e4['attributes']:_0x579f8f[_0xd5ac('0x2f')];if(!_0x262712['query'][_0xd5ac('0x35')]('nolimit')){_0x30a1e4['limit']=qs[_0xd5ac('0x1c')](_0x262712['query']['limit']);_0x30a1e4[_0xd5ac('0x1a')]=qs[_0xd5ac('0x1a')](_0x262712[_0xd5ac('0x30')][_0xd5ac('0x1a')]);}_0x30a1e4[_0xd5ac('0x36')]=qs[_0xd5ac('0x37')](_0x262712[_0xd5ac('0x30')][_0xd5ac('0x37')]);_0x30a1e4['where']=qs[_0xd5ac('0x31')](_[_0xd5ac('0x38')](_0x262712[_0xd5ac('0x30')],_0x579f8f[_0xd5ac('0x31')]),_0x2c2280);if(_0x262712[_0xd5ac('0x30')]['filter']){_0x30a1e4[_0xd5ac('0x39')]=_[_0xd5ac('0x3a')](_0x30a1e4[_0xd5ac('0x39')],{'$or':_[_0xd5ac('0x2a')](_0x2c2280,function(_0x7576b4){if(_0x7576b4[_0xd5ac('0x2d')]!==_0xd5ac('0x3b')){var _0x58555e={};_0x58555e[_0x7576b4[_0xd5ac('0x28')]]={'$like':'%'+_0x262712[_0xd5ac('0x30')]['filter']+'%'};return _0x58555e;}})});}_0x30a1e4=_[_0xd5ac('0x3a')]({},_0x30a1e4,_0x262712['options']);var _0x293eab={'where':_0x30a1e4[_0xd5ac('0x39')]};return db[_0xd5ac('0x2b')][_0xd5ac('0x1d')](_0x293eab)['then'](function(_0x4c1cde){_0x56d463[_0xd5ac('0x1d')]=_0x4c1cde;if(_0x262712[_0xd5ac('0x30')][_0xd5ac('0x3c')]){_0x30a1e4['include']=[{'all':!![]}];}return db[_0xd5ac('0x2b')][_0xd5ac('0x3d')](_0x30a1e4);})[_0xd5ac('0x3e')](function(_0x34dd96){_0x56d463[_0xd5ac('0x3f')]=_0x34dd96;return _0x56d463;})[_0xd5ac('0x3e')](respondWithFilteredResult(_0x1bb3ab,_0x30a1e4))['catch'](handleError(_0x1bb3ab,null));};exports['show']=function(_0x491016,_0x5bfce5){var _0x5c88ec={'raw':!![],'where':{'id':_0x491016[_0xd5ac('0x40')]['id']}},_0x2dbc4c={};_0x2dbc4c['model']=_['keys'](db[_0xd5ac('0x2b')][_0xd5ac('0x41')]);_0x2dbc4c[_0xd5ac('0x30')]=_[_0xd5ac('0x42')](_0x491016[_0xd5ac('0x30')]);_0x2dbc4c['filters']=_[_0xd5ac('0x32')](_0x2dbc4c[_0xd5ac('0x2f')],_0x2dbc4c[_0xd5ac('0x30')]);_0x5c88ec[_0xd5ac('0x33')]=_['intersection'](_0x2dbc4c[_0xd5ac('0x2f')],qs[_0xd5ac('0x34')](_0x491016[_0xd5ac('0x30')][_0xd5ac('0x34')]));_0x5c88ec[_0xd5ac('0x33')]=_0x5c88ec[_0xd5ac('0x33')][_0xd5ac('0x43')]?_0x5c88ec[_0xd5ac('0x33')]:_0x2dbc4c[_0xd5ac('0x2f')];if(_0x491016[_0xd5ac('0x30')]['includeAll']){_0x5c88ec[_0xd5ac('0x44')]=[{'all':!![]}];}_0x5c88ec=_[_0xd5ac('0x3a')]({},_0x5c88ec,_0x491016[_0xd5ac('0x45')]);return db[_0xd5ac('0x2b')]['find'](_0x5c88ec)['then'](handleEntityNotFound(_0x5bfce5,null))[_0xd5ac('0x3e')](respondWithResult(_0x5bfce5,null))[_0xd5ac('0x46')](handleError(_0x5bfce5,null));};exports[_0xd5ac('0x47')]=function(_0x2c476c,_0x29a69a){return db[_0xd5ac('0x2b')]['create'](_0x2c476c[_0xd5ac('0x48')],{})['then'](respondWithResult(_0x29a69a,0xc9))[_0xd5ac('0x46')](handleError(_0x29a69a,null));};exports[_0xd5ac('0x22')]=function(_0x1eb32f,_0x1d56e2){if(_0x1eb32f[_0xd5ac('0x48')]['id']){delete _0x1eb32f['body']['id'];}return db[_0xd5ac('0x2b')]['find']({'where':{'id':_0x1eb32f[_0xd5ac('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d56e2,null))[_0xd5ac('0x3e')](saveUpdates(_0x1eb32f[_0xd5ac('0x48')],null))[_0xd5ac('0x3e')](respondWithResult(_0x1d56e2,null))[_0xd5ac('0x46')](handleError(_0x1d56e2,null));};exports[_0xd5ac('0x23')]=function(_0xd8fc6d,_0x687615){return db['OpenchannelQueueReport'][_0xd5ac('0x49')]({'where':{'id':_0xd8fc6d[_0xd5ac('0x40')]['id']}})[_0xd5ac('0x3e')](handleEntityNotFound(_0x687615,null))['then'](removeEntity(_0x687615,null))['catch'](handleError(_0x687615,null));};exports[_0xd5ac('0x4a')]=function(_0xc1bd2f,_0x62c920){return db[_0xd5ac('0x2b')][_0xd5ac('0x4a')]()['then'](respondWithResult(_0x62c920,null))[_0xd5ac('0x46')](handleError(_0x62c920,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2a411d1..67ceafe 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x1f459f,_0x14f210){var _0x4bd84c=function(_0x24b40b){while(--_0x24b40b){_0x1f459f['push'](_0x1f459f['shift']());}};_0x4bd84c(++_0x14f210);}(_0xe14b,0x93));var _0xbe14=function(_0x27ca33,_0x3bad8c){_0x27ca33=_0x27ca33-0x0;var _0x2aa0f2=_0xe14b[_0x27ca33];return _0x2aa0f2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x593cbe,_0x31d274){var _0x4eb29b=function(_0x55a9ed){while(--_0x55a9ed){_0x593cbe['push'](_0x593cbe['shift']());}};_0x4eb29b(++_0x31d274);}(_0x326f,0xd1));var _0xf326=function(_0x5de9a4,_0x33a6db){_0x5de9a4=_0x5de9a4-0x0;var _0x4cd694=_0x326f[_0x5de9a4];return _0x4cd694;};'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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 47389b4..d24560d 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 _0xb10b=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d130e,_0x314633){_0x1d130e=_0x1d130e-0x0;var _0x156c2f=_0xb10b[_0x1d130e];return _0x156c2f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateOpenchannelQueueReport',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};exports[_0xbb10('0x1b')]=function(_0x436104){var _0x7f2377=this;return new Promise(function(_0x395404,_0x3ba6cd){return db[_0xbb10('0x16')]['update'](_0x436104['body'],{'raw':_0x436104['options']?_0x436104[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436104[_0xbb10('0x18')]?_0x436104['options'][_0xbb10('0x1c')]||null:null,'attributes':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1d')]||null:null,'limit':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1e')]||null:null})['then'](function(_0x3796c7){logger[_0xbb10('0xd')](_0xbb10('0x1b'),_0x436104);logger[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x436104,JSON[_0xbb10('0x11')](_0x3796c7));_0x395404(_0x3796c7);})['catch'](function(_0x221624){logger['error'](_0xbb10('0x1b'),_0x221624['message'],_0x436104);_0x3ba6cd(_0x7f2377[_0xbb10('0x12')](0x1f4,_0x221624[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb574=['error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','body','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x681eab,_0x5c64a3){var _0x100e35=function(_0x2eca9c){while(--_0x2eca9c){_0x681eab['push'](_0x681eab['shift']());}};_0x100e35(++_0x5c64a3);}(_0xb574,0x106));var _0x4b57=function(_0x110da3,_0x17736a){_0x110da3=_0x110da3-0x0;var _0x102285=_0xb574[_0x110da3];return _0x102285;};'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});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')](_0xfb71cc['body'],{'raw':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![]})[_0x4b57('0xb')](function(_0xef1eae){logger[_0x4b57('0xc')]('CreateOpenchannelQueueReport',_0xfb71cc);logger[_0x4b57('0xf')](_0x4b57('0x15'),_0xfb71cc,JSON[_0x4b57('0x10')](_0xef1eae));_0x1b35ff(_0xef1eae);})['catch'](function(_0x380554){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x380554[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x380554[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1a')]=function(_0x4d07c9){var _0x3e7b96=this;return new Promise(function(_0x12dedf,_0x25d190){return db[_0x4b57('0x16')]['update'](_0x4d07c9[_0x4b57('0x1b')],{'raw':_0x4d07c9['options']?_0x4d07c9[_0x4b57('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d07c9[_0x4b57('0x18')]?_0x4d07c9[_0x4b57('0x18')][_0x4b57('0x1c')]||null:null,'attributes':_0x4d07c9[_0x4b57('0x18')]?_0x4d07c9[_0x4b57('0x18')][_0x4b57('0x1d')]||null:null,'limit':_0x4d07c9['options']?_0x4d07c9['options'][_0x4b57('0x1e')]||null:null})['then'](function(_0x1ea0cb){logger[_0x4b57('0xc')](_0x4b57('0x1a'),_0x4d07c9);logger[_0x4b57('0xf')](_0x4b57('0x1a'),_0x4d07c9,JSON[_0x4b57('0x10')](_0x1ea0cb));_0x12dedf(_0x1ea0cb);})['catch'](function(_0xab365c){logger[_0x4b57('0x11')](_0x4b57('0x1a'),_0xab365c[_0x4b57('0x12')],_0x4d07c9);_0x25d190(_0x3e7b96['error'](0x1f4,_0xab365c[_0x4b57('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ab8b658..128482a 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 _0xf515=['get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0xf515,0x7d));var _0x5f51=function(_0x2db6d7,_0x1b38a5){_0x2db6d7=_0x2db6d7-0x0;var _0x190a52=_0xf515[_0x2db6d7];return _0x190a52;};'use strict';var multer=require(_0x5f51('0x0'));var util=require('util');var path=require(_0x5f51('0x1'));var timeout=require(_0x5f51('0x2'));var express=require('express');var router=express[_0x5f51('0x3')]();var fs_extra=require(_0x5f51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f51('0x5'));var config=require(_0x5f51('0x6'));var controller=require(_0x5f51('0x7'));router[_0x5f51('0x8')]('/',auth[_0x5f51('0x9')](),controller[_0x5f51('0xa')]);router[_0x5f51('0x8')](_0x5f51('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5f51('0x8')](_0x5f51('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5f51('0xd')]('/',auth['isAuthenticated'](),controller[_0x5f51('0xe')]);router[_0x5f51('0xf')]('/:id',auth[_0x5f51('0x9')](),controller[_0x5f51('0x10')]);router[_0x5f51('0x11')](_0x5f51('0xc'),auth[_0x5f51('0x9')](),controller[_0x5f51('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3efd=['delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put'];(function(_0x2ed236,_0x15c638){var _0x921cfa=function(_0x27c25f){while(--_0x27c25f){_0x2ed236['push'](_0x2ed236['shift']());}};_0x921cfa(++_0x15c638);}(_0x3efd,0x1b2));var _0xd3ef=function(_0x30e6d7,_0x56a5c2){_0x30e6d7=_0x30e6d7-0x0;var _0x15c4e5=_0x3efd[_0x30e6d7];return _0x15c4e5;};'use strict';var multer=require(_0xd3ef('0x0'));var util=require('util');var path=require(_0xd3ef('0x1'));var timeout=require(_0xd3ef('0x2'));var express=require(_0xd3ef('0x3'));var router=express[_0xd3ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd3ef('0x5'));var interaction=require(_0xd3ef('0x6'));var config=require('../../config/environment');var controller=require(_0xd3ef('0x7'));router[_0xd3ef('0x8')]('/',auth[_0xd3ef('0x9')](),controller[_0xd3ef('0xa')]);router[_0xd3ef('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd3ef('0xb')]);router[_0xd3ef('0x8')](_0xd3ef('0xc'),auth[_0xd3ef('0x9')](),controller['show']);router[_0xd3ef('0xd')]('/',auth[_0xd3ef('0x9')](),controller[_0xd3ef('0xe')]);router[_0xd3ef('0xf')](_0xd3ef('0xc'),auth[_0xd3ef('0x9')](),controller['update']);router[_0xd3ef('0x10')](_0xd3ef('0xc'),auth['isAuthenticated'](),controller[_0xd3ef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d4aa61e..77cbb4d 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5049b5,_0x31cf0b){var _0x3006f3=function(_0x555bf3){while(--_0x555bf3){_0x5049b5['push'](_0x5049b5['shift']());}};_0x3006f3(++_0x31cf0b);}(_0xf4eb,0xec));var _0xbf4e=function(_0x420560,_0x345df6){_0x420560=_0x420560-0x0;var _0xe84156=_0xf4eb[_0x420560];return _0xe84156;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x10d108,_0x7418f0){var _0x1cde31=function(_0x544207){while(--_0x544207){_0x10d108['push'](_0x10d108['shift']());}};_0x1cde31(++_0x7418f0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9263fcc..85466dd 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 _0x3641=['describe','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','map','rawAttributes','fieldName','type','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','show','include','find','catch','create','body','params'];(function(_0x307bff,_0x33b04c){var _0x2be188=function(_0x388309){while(--_0x388309){_0x307bff['push'](_0x307bff['shift']());}};_0x2be188(++_0x33b04c);}(_0x3641,0x173));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1364('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1364('0x1'));var moment=require(_0x1364('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1364('0x3'));var util=require(_0x1364('0x4'));var path=require(_0x1364('0x5'));var sox=require('sox');var csv=require(_0x1364('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1364('0x7'));var _=require(_0x1364('0x8'));var squel=require(_0x1364('0x9'));var crypto=require('crypto');var jsforce=require(_0x1364('0xa'));var deskjs=require(_0x1364('0xb'));var toCsv=require(_0x1364('0x6'));var querystring=require(_0x1364('0xc'));var Papa=require(_0x1364('0xd'));var Redis=require(_0x1364('0xe'));var authService=require(_0x1364('0xf'));var qs=require(_0x1364('0x10'));var as=require(_0x1364('0x11'));var hardwareService=require(_0x1364('0x12'));var logger=require(_0x1364('0x13'))(_0x1364('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1364('0x15'));var db=require(_0x1364('0x16'))['db'];function respondWithStatusCode(_0x41745e,_0x39be85){_0x39be85=_0x39be85||0xcc;return function(_0x128221){if(_0x128221){return _0x41745e['sendStatus'](_0x39be85);}return _0x41745e[_0x1364('0x17')](_0x39be85)[_0x1364('0x18')]();};}function respondWithResult(_0x49fc4a,_0x13e056){_0x13e056=_0x13e056||0xc8;return function(_0x245010){if(_0x245010){return _0x49fc4a[_0x1364('0x17')](_0x13e056)[_0x1364('0x19')](_0x245010);}};}function respondWithFilteredResult(_0x54c688,_0x54ea83){return function(_0x379547){if(_0x379547){var _0x31e0cb=typeof _0x54ea83[_0x1364('0x1a')]===_0x1364('0x1b')&&typeof _0x54ea83[_0x1364('0x1c')]===_0x1364('0x1b');var _0x2ae4a1=_0x379547[_0x1364('0x1d')];var _0x4e7b68=_0x31e0cb?0x0:_0x54ea83['offset'];var _0x9423d5=_0x31e0cb?_0x379547['count']:_0x54ea83[_0x1364('0x1a')]+_0x54ea83[_0x1364('0x1c')];var _0x105d23;if(_0x9423d5>=_0x2ae4a1){_0x9423d5=_0x2ae4a1;_0x105d23=0xc8;}else{_0x105d23=0xce;}_0x54c688[_0x1364('0x17')](_0x105d23);return _0x54c688['set'](_0x1364('0x1e'),_0x4e7b68+'-'+_0x9423d5+'/'+_0x2ae4a1)[_0x1364('0x19')](_0x379547);}return null;};}function patchUpdates(_0x1e6bc0){return function(_0x5de543){try{jsonpatch[_0x1364('0x1f')](_0x5de543,_0x1e6bc0,!![]);}catch(_0x21cc10){return BPromise[_0x1364('0x20')](_0x21cc10);}return _0x5de543[_0x1364('0x21')]();};}function saveUpdates(_0x49e87e,_0x3d7b42){return function(_0x161d6b){if(_0x161d6b){return _0x161d6b[_0x1364('0x22')](_0x49e87e)[_0x1364('0x23')](function(_0x3362f7){return _0x3362f7;});}return null;};}function removeEntity(_0x2d8226,_0x8bc79d){return function(_0x1b3862){if(_0x1b3862){return _0x1b3862[_0x1364('0x24')]()[_0x1364('0x23')](function(){_0x2d8226[_0x1364('0x17')](0xcc)[_0x1364('0x18')]();});}};}function handleEntityNotFound(_0x35f0e3,_0x28254c){return function(_0x21cbdd){if(!_0x21cbdd){_0x35f0e3[_0x1364('0x25')](0x194);}return _0x21cbdd;};}function handleError(_0x12f7b9,_0x5cdbb3){_0x5cdbb3=_0x5cdbb3||0x1f4;return function(_0x117777){logger[_0x1364('0x26')](_0x117777[_0x1364('0x27')]);if(_0x117777['name']){delete _0x117777['name'];}_0x12f7b9[_0x1364('0x17')](_0x5cdbb3)['send'](_0x117777);};}exports[_0x1364('0x28')]=function(_0x1b40d2,_0x142f18){var _0x16b1cd={},_0x4f4438={},_0x178771={'count':0x0,'rows':[]};var _0x28458a=_[_0x1364('0x29')](db['OpenchannelTransferReport'][_0x1364('0x2a')],function(_0x5614ec){return{'name':_0x5614ec[_0x1364('0x2b')],'type':_0x5614ec[_0x1364('0x2c')]['key']};});_0x4f4438['model']=_[_0x1364('0x29')](_0x28458a,_0x1364('0x2d'));_0x4f4438['query']=_[_0x1364('0x2e')](_0x1b40d2[_0x1364('0x2f')]);_0x4f4438[_0x1364('0x30')]=_[_0x1364('0x31')](_0x4f4438[_0x1364('0x32')],_0x4f4438['query']);_0x16b1cd[_0x1364('0x33')]=_[_0x1364('0x31')](_0x4f4438['model'],qs[_0x1364('0x34')](_0x1b40d2[_0x1364('0x2f')][_0x1364('0x34')]));_0x16b1cd[_0x1364('0x33')]=_0x16b1cd['attributes']['length']?_0x16b1cd[_0x1364('0x33')]:_0x4f4438[_0x1364('0x32')];if(!_0x1b40d2[_0x1364('0x2f')][_0x1364('0x35')](_0x1364('0x36'))){_0x16b1cd[_0x1364('0x1c')]=qs['limit'](_0x1b40d2[_0x1364('0x2f')]['limit']);_0x16b1cd[_0x1364('0x1a')]=qs[_0x1364('0x1a')](_0x1b40d2['query'][_0x1364('0x1a')]);}_0x16b1cd[_0x1364('0x37')]=qs[_0x1364('0x38')](_0x1b40d2['query'][_0x1364('0x38')]);_0x16b1cd['where']=qs[_0x1364('0x30')](_[_0x1364('0x39')](_0x1b40d2[_0x1364('0x2f')],_0x4f4438['filters']),_0x28458a);if(_0x1b40d2['query'][_0x1364('0x3a')]){_0x16b1cd[_0x1364('0x3b')]=_[_0x1364('0x3c')](_0x16b1cd[_0x1364('0x3b')],{'$or':_['map'](_0x28458a,function(_0x97512a){if(_0x97512a[_0x1364('0x2c')]!==_0x1364('0x3d')){var _0x26046a={};_0x26046a[_0x97512a[_0x1364('0x2d')]]={'$like':'%'+_0x1b40d2['query'][_0x1364('0x3a')]+'%'};return _0x26046a;}})});}_0x16b1cd=_[_0x1364('0x3c')]({},_0x16b1cd,_0x1b40d2[_0x1364('0x3e')]);var _0x3f5291={'where':_0x16b1cd[_0x1364('0x3b')]};return db[_0x1364('0x3f')][_0x1364('0x1d')](_0x3f5291)[_0x1364('0x23')](function(_0x427829){_0x178771[_0x1364('0x1d')]=_0x427829;if(_0x1b40d2['query'][_0x1364('0x40')]){_0x16b1cd['include']=[{'all':!![]}];}return db[_0x1364('0x3f')][_0x1364('0x41')](_0x16b1cd);})[_0x1364('0x23')](function(_0x2f68a7){_0x178771['rows']=_0x2f68a7;return _0x178771;})['then'](respondWithFilteredResult(_0x142f18,_0x16b1cd))['catch'](handleError(_0x142f18,null));};exports[_0x1364('0x42')]=function(_0x3e2204,_0x1603b0){var _0x376948={'raw':!![],'where':{'id':_0x3e2204['params']['id']}},_0x562042={};_0x562042[_0x1364('0x32')]=_['keys'](db[_0x1364('0x3f')][_0x1364('0x2a')]);_0x562042['query']=_[_0x1364('0x2e')](_0x3e2204['query']);_0x562042[_0x1364('0x30')]=_[_0x1364('0x31')](_0x562042[_0x1364('0x32')],_0x562042[_0x1364('0x2f')]);_0x376948['attributes']=_[_0x1364('0x31')](_0x562042[_0x1364('0x32')],qs['fields'](_0x3e2204[_0x1364('0x2f')][_0x1364('0x34')]));_0x376948[_0x1364('0x33')]=_0x376948[_0x1364('0x33')]['length']?_0x376948['attributes']:_0x562042['model'];if(_0x3e2204['query'][_0x1364('0x40')]){_0x376948[_0x1364('0x43')]=[{'all':!![]}];}_0x376948=_[_0x1364('0x3c')]({},_0x376948,_0x3e2204[_0x1364('0x3e')]);return db[_0x1364('0x3f')][_0x1364('0x44')](_0x376948)[_0x1364('0x23')](handleEntityNotFound(_0x1603b0,null))['then'](respondWithResult(_0x1603b0,null))[_0x1364('0x45')](handleError(_0x1603b0,null));};exports[_0x1364('0x46')]=function(_0x4a2ee6,_0x568b77){return db['OpenchannelTransferReport']['create'](_0x4a2ee6[_0x1364('0x47')],{})[_0x1364('0x23')](respondWithResult(_0x568b77,0xc9))[_0x1364('0x45')](handleError(_0x568b77,null));};exports[_0x1364('0x22')]=function(_0x376edf,_0x19c545){if(_0x376edf[_0x1364('0x47')]['id']){delete _0x376edf['body']['id'];}return db['OpenchannelTransferReport'][_0x1364('0x44')]({'where':{'id':_0x376edf[_0x1364('0x48')]['id']}})[_0x1364('0x23')](handleEntityNotFound(_0x19c545,null))['then'](saveUpdates(_0x376edf[_0x1364('0x47')],null))[_0x1364('0x23')](respondWithResult(_0x19c545,null))[_0x1364('0x45')](handleError(_0x19c545,null));};exports[_0x1364('0x24')]=function(_0x350517,_0x45fc96){return db[_0x1364('0x3f')][_0x1364('0x44')]({'where':{'id':_0x350517[_0x1364('0x48')]['id']}})['then'](handleEntityNotFound(_0x45fc96,null))[_0x1364('0x23')](removeEntity(_0x45fc96,null))[_0x1364('0x45')](handleError(_0x45fc96,null));};exports[_0x1364('0x49')]=function(_0x31910a,_0x2f6f02){return db['OpenchannelTransferReport'][_0x1364('0x49')]()['then'](respondWithResult(_0x2f6f02,null))['catch'](handleError(_0x2f6f02,null));}; \ No newline at end of file +var _0x8d48=['model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type'];(function(_0x3266c3,_0x399cec){var _0x713c84=function(_0x3d7300){while(--_0x3d7300){_0x3266c3['push'](_0x3266c3['shift']());}};_0x713c84(++_0x399cec);}(_0x8d48,0x160));var _0x88d4=function(_0x157111,_0x3a9771){_0x157111=_0x157111-0x0;var _0x5b00c4=_0x8d48[_0x157111];return _0x5b00c4;};'use strict';var emlformat=require(_0x88d4('0x0'));var rimraf=require(_0x88d4('0x1'));var zipdir=require(_0x88d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88d4('0x3'));var moment=require(_0x88d4('0x4'));var BPromise=require(_0x88d4('0x5'));var Mustache=require(_0x88d4('0x6'));var util=require(_0x88d4('0x7'));var path=require(_0x88d4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x88d4('0x9'));var fs=require('fs');var fs_extra=require(_0x88d4('0xa'));var _=require(_0x88d4('0xb'));var squel=require(_0x88d4('0xc'));var crypto=require('crypto');var jsforce=require(_0x88d4('0xd'));var deskjs=require(_0x88d4('0xe'));var toCsv=require(_0x88d4('0xf'));var querystring=require('querystring');var Papa=require(_0x88d4('0x10'));var Redis=require(_0x88d4('0x11'));var authService=require(_0x88d4('0x12'));var qs=require(_0x88d4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88d4('0x14'));var logger=require(_0x88d4('0x15'))('api');var utils=require(_0x88d4('0x16'));var config=require(_0x88d4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x88d4('0x18'))['db'];function respondWithStatusCode(_0x24b703,_0x456ffe){_0x456ffe=_0x456ffe||0xcc;return function(_0x1e31f3){if(_0x1e31f3){return _0x24b703[_0x88d4('0x19')](_0x456ffe);}return _0x24b703[_0x88d4('0x1a')](_0x456ffe)[_0x88d4('0x1b')]();};}function respondWithResult(_0x1374ef,_0x2b8182){_0x2b8182=_0x2b8182||0xc8;return function(_0x453913){if(_0x453913){return _0x1374ef['status'](_0x2b8182)['json'](_0x453913);}};}function respondWithFilteredResult(_0xf13917,_0x57c1a4){return function(_0x20e576){if(_0x20e576){var _0x435a2f=typeof _0x57c1a4['offset']===_0x88d4('0x1c')&&typeof _0x57c1a4[_0x88d4('0x1d')]==='undefined';var _0x309e39=_0x20e576[_0x88d4('0x1e')];var _0x3d05bb=_0x435a2f?0x0:_0x57c1a4[_0x88d4('0x1f')];var _0x3cf385=_0x435a2f?_0x20e576['count']:_0x57c1a4[_0x88d4('0x1f')]+_0x57c1a4[_0x88d4('0x1d')];var _0x3071c2;if(_0x3cf385>=_0x309e39){_0x3cf385=_0x309e39;_0x3071c2=0xc8;}else{_0x3071c2=0xce;}_0xf13917[_0x88d4('0x1a')](_0x3071c2);return _0xf13917[_0x88d4('0x20')](_0x88d4('0x21'),_0x3d05bb+'-'+_0x3cf385+'/'+_0x309e39)[_0x88d4('0x22')](_0x20e576);}return null;};}function patchUpdates(_0x2fb40c){return function(_0x13d31a){try{jsonpatch[_0x88d4('0x23')](_0x13d31a,_0x2fb40c,!![]);}catch(_0x147ad3){return BPromise[_0x88d4('0x24')](_0x147ad3);}return _0x13d31a[_0x88d4('0x25')]();};}function saveUpdates(_0x331d99,_0x31a0c4){return function(_0x1529cb){if(_0x1529cb){return _0x1529cb['update'](_0x331d99)['then'](function(_0x44da2d){return _0x44da2d;});}return null;};}function removeEntity(_0x2a2971,_0xa510d7){return function(_0x55c91e){if(_0x55c91e){return _0x55c91e['destroy']()[_0x88d4('0x26')](function(){_0x2a2971['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2ada,_0x26e128){return function(_0x58146f){if(!_0x58146f){_0x5b2ada[_0x88d4('0x19')](0x194);}return _0x58146f;};}function handleError(_0x4de0e9,_0x1edd34){_0x1edd34=_0x1edd34||0x1f4;return function(_0x58d475){logger[_0x88d4('0x27')](_0x58d475[_0x88d4('0x28')]);if(_0x58d475['name']){delete _0x58d475['name'];}_0x4de0e9['status'](_0x1edd34)[_0x88d4('0x29')](_0x58d475);};}exports[_0x88d4('0x2a')]=function(_0x57a18e,_0x3842c8){var _0x481503={},_0x570d9c={},_0x331bca={'count':0x0,'rows':[]};var _0x38ebb4=_[_0x88d4('0x2b')](db[_0x88d4('0x2c')][_0x88d4('0x2d')],function(_0x52d4ef){return{'name':_0x52d4ef[_0x88d4('0x2e')],'type':_0x52d4ef[_0x88d4('0x2f')]['key']};});_0x570d9c[_0x88d4('0x30')]=_[_0x88d4('0x2b')](_0x38ebb4,_0x88d4('0x31'));_0x570d9c[_0x88d4('0x32')]=_[_0x88d4('0x33')](_0x57a18e['query']);_0x570d9c[_0x88d4('0x34')]=_[_0x88d4('0x35')](_0x570d9c[_0x88d4('0x30')],_0x570d9c['query']);_0x481503[_0x88d4('0x36')]=_[_0x88d4('0x35')](_0x570d9c[_0x88d4('0x30')],qs[_0x88d4('0x37')](_0x57a18e[_0x88d4('0x32')][_0x88d4('0x37')]));_0x481503[_0x88d4('0x36')]=_0x481503[_0x88d4('0x36')][_0x88d4('0x38')]?_0x481503['attributes']:_0x570d9c[_0x88d4('0x30')];if(!_0x57a18e[_0x88d4('0x32')][_0x88d4('0x39')](_0x88d4('0x3a'))){_0x481503[_0x88d4('0x1d')]=qs[_0x88d4('0x1d')](_0x57a18e[_0x88d4('0x32')][_0x88d4('0x1d')]);_0x481503[_0x88d4('0x1f')]=qs[_0x88d4('0x1f')](_0x57a18e[_0x88d4('0x32')][_0x88d4('0x1f')]);}_0x481503[_0x88d4('0x3b')]=qs['sort'](_0x57a18e['query'][_0x88d4('0x3c')]);_0x481503['where']=qs[_0x88d4('0x34')](_[_0x88d4('0x3d')](_0x57a18e['query'],_0x570d9c[_0x88d4('0x34')]),_0x38ebb4);if(_0x57a18e[_0x88d4('0x32')][_0x88d4('0x3e')]){_0x481503[_0x88d4('0x3f')]=_[_0x88d4('0x40')](_0x481503['where'],{'$or':_['map'](_0x38ebb4,function(_0x5a55b3){if(_0x5a55b3[_0x88d4('0x2f')]!==_0x88d4('0x41')){var _0x4158c2={};_0x4158c2[_0x5a55b3[_0x88d4('0x31')]]={'$like':'%'+_0x57a18e['query']['filter']+'%'};return _0x4158c2;}})});}_0x481503=_[_0x88d4('0x40')]({},_0x481503,_0x57a18e[_0x88d4('0x42')]);var _0x11f9d8={'where':_0x481503['where']};return db['OpenchannelTransferReport'][_0x88d4('0x1e')](_0x11f9d8)['then'](function(_0x20cd35){_0x331bca[_0x88d4('0x1e')]=_0x20cd35;if(_0x57a18e[_0x88d4('0x32')][_0x88d4('0x43')]){_0x481503[_0x88d4('0x44')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x88d4('0x45')](_0x481503);})[_0x88d4('0x26')](function(_0x3a355e){_0x331bca[_0x88d4('0x46')]=_0x3a355e;return _0x331bca;})['then'](respondWithFilteredResult(_0x3842c8,_0x481503))[_0x88d4('0x47')](handleError(_0x3842c8,null));};exports[_0x88d4('0x48')]=function(_0x4e8605,_0x15f335){var _0x1ecd6d={'raw':!![],'where':{'id':_0x4e8605[_0x88d4('0x49')]['id']}},_0x38010f={};_0x38010f[_0x88d4('0x30')]=_[_0x88d4('0x33')](db[_0x88d4('0x2c')][_0x88d4('0x2d')]);_0x38010f[_0x88d4('0x32')]=_['keys'](_0x4e8605[_0x88d4('0x32')]);_0x38010f['filters']=_['intersection'](_0x38010f[_0x88d4('0x30')],_0x38010f[_0x88d4('0x32')]);_0x1ecd6d[_0x88d4('0x36')]=_['intersection'](_0x38010f[_0x88d4('0x30')],qs[_0x88d4('0x37')](_0x4e8605[_0x88d4('0x32')][_0x88d4('0x37')]));_0x1ecd6d[_0x88d4('0x36')]=_0x1ecd6d[_0x88d4('0x36')]['length']?_0x1ecd6d[_0x88d4('0x36')]:_0x38010f[_0x88d4('0x30')];if(_0x4e8605[_0x88d4('0x32')]['includeAll']){_0x1ecd6d[_0x88d4('0x44')]=[{'all':!![]}];}_0x1ecd6d=_[_0x88d4('0x40')]({},_0x1ecd6d,_0x4e8605[_0x88d4('0x42')]);return db[_0x88d4('0x2c')][_0x88d4('0x4a')](_0x1ecd6d)[_0x88d4('0x26')](handleEntityNotFound(_0x15f335,null))[_0x88d4('0x26')](respondWithResult(_0x15f335,null))['catch'](handleError(_0x15f335,null));};exports['create']=function(_0x4f05d9,_0x5b7f99){return db[_0x88d4('0x2c')][_0x88d4('0x4b')](_0x4f05d9[_0x88d4('0x4c')],{})[_0x88d4('0x26')](respondWithResult(_0x5b7f99,0xc9))[_0x88d4('0x47')](handleError(_0x5b7f99,null));};exports[_0x88d4('0x4d')]=function(_0x14d1d4,_0x10e211){if(_0x14d1d4[_0x88d4('0x4c')]['id']){delete _0x14d1d4[_0x88d4('0x4c')]['id'];}return db[_0x88d4('0x2c')]['find']({'where':{'id':_0x14d1d4[_0x88d4('0x49')]['id']}})[_0x88d4('0x26')](handleEntityNotFound(_0x10e211,null))[_0x88d4('0x26')](saveUpdates(_0x14d1d4['body'],null))[_0x88d4('0x26')](respondWithResult(_0x10e211,null))[_0x88d4('0x47')](handleError(_0x10e211,null));};exports[_0x88d4('0x4e')]=function(_0x15fe2d,_0x289f39){return db[_0x88d4('0x2c')][_0x88d4('0x4a')]({'where':{'id':_0x15fe2d[_0x88d4('0x49')]['id']}})[_0x88d4('0x26')](handleEntityNotFound(_0x289f39,null))[_0x88d4('0x26')](removeEntity(_0x289f39,null))[_0x88d4('0x47')](handleError(_0x289f39,null));};exports[_0x88d4('0x4f')]=function(_0x57f5bf,_0x4c5f61){return db[_0x88d4('0x2c')]['describe']()[_0x88d4('0x26')](respondWithResult(_0x4c5f61,null))[_0x88d4('0x47')](handleError(_0x4c5f61,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7509c65..247204b 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 _0x3d20=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3d20,0x123));var _0x03d2=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x3d20[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x03d2('0x0'));var util=require(_0x03d2('0x1'));var logger=require(_0x03d2('0x2'))(_0x03d2('0x3'));var moment=require(_0x03d2('0x4'));var BPromise=require(_0x03d2('0x5'));var rp=require(_0x03d2('0x6'));var fs=require('fs');var path=require(_0x03d2('0x7'));var rimraf=require(_0x03d2('0x8'));var config=require(_0x03d2('0x9'));var attributes=require(_0x03d2('0xa'));module[_0x03d2('0xb')]=function(_0x295c3f,_0x33b8c8){return _0x295c3f[_0x03d2('0xc')](_0x03d2('0xd'),attributes,{'tableName':_0x03d2('0xe'),'paranoid':![],'indexes':[{'name':_0x03d2('0xf'),'fields':[_0x03d2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92b8=['moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','../../config/logger','api'];(function(_0x4bb227,_0x54f5c3){var _0x3def54=function(_0x563558){while(--_0x563558){_0x4bb227['push'](_0x4bb227['shift']());}};_0x3def54(++_0x54f5c3);}(_0x92b8,0x8e));var _0x892b=function(_0x5d0f95,_0xe97848){_0x5d0f95=_0x5d0f95-0x0;var _0xb26fa5=_0x92b8[_0x5d0f95];return _0xb26fa5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x892b('0x0'))(_0x892b('0x1'));var moment=require(_0x892b('0x2'));var BPromise=require(_0x892b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x892b('0x4'));var rimraf=require(_0x892b('0x5'));var config=require(_0x892b('0x6'));var attributes=require(_0x892b('0x7'));module[_0x892b('0x8')]=function(_0x18faf9,_0x1fb791){return _0x18faf9[_0x892b('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x892b('0xa'),'paranoid':![],'indexes':[{'name':_0x892b('0xb'),'fields':[_0x892b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2483222..7602b20 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 _0x938d=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x2f9dfc,_0x358e83){var _0x10526a=function(_0x4550a1){while(--_0x4550a1){_0x2f9dfc['push'](_0x2f9dfc['shift']());}};_0x10526a(++_0x358e83);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var moment=require('moment');var BPromise=require(_0xd938('0x2'));var rs=require(_0xd938('0x3'));var fs=require('fs');var Redis=require(_0xd938('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd938('0x5'))(_0xd938('0x6'));var config=require(_0xd938('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd938('0x8')][_0xd938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed46b,_0x29fcaa,_0x678164){return new BPromise(function(_0x419e0b,_0x4792db){return client[_0xd938('0xa')](_0x1ed46b,_0x678164)[_0xd938('0xb')](function(_0x19fac0){logger[_0xd938('0xc')](_0xd938('0xd'),_0x29fcaa,_0xd938('0xe'));logger['debug'](_0xd938('0xf'),_0x29fcaa,_0xd938('0xe'),JSON[_0xd938('0x10')](_0x19fac0));if(_0x19fac0[_0xd938('0x11')]){if(_0x19fac0[_0xd938('0x11')][_0xd938('0x12')]===0x1f4){logger[_0xd938('0x11')](_0xd938('0xd'),_0x29fcaa,_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);return _0x4792db(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}logger[_0xd938('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29fcaa,_0x19fac0['error']['message']);return _0x419e0b(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}else{logger[_0xd938('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29fcaa,'request\x20sent');_0x419e0b(_0x19fac0[_0xd938('0x14')][_0xd938('0x13')]);}})['catch'](function(_0x5aef15){logger['error'](_0xd938('0xd'),_0x29fcaa,_0x5aef15);_0x4792db(_0x5aef15);});});} \ No newline at end of file +var _0x1c9a=['code','OpenchannelTransferReport,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0xb0a5ca,_0x4205e5){var _0x49a864=function(_0x418cfe){while(--_0x418cfe){_0xb0a5ca['push'](_0xb0a5ca['shift']());}};_0x49a864(++_0x4205e5);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x11d673,_0x36ecfe){_0x11d673=_0x11d673-0x0;var _0x20a5e6=_0x1c9a[_0x11d673];return _0x20a5e6;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var moment=require('moment');var BPromise=require(_0xa1c9('0x2'));var rs=require(_0xa1c9('0x3'));var fs=require('fs');var Redis=require(_0xa1c9('0x4'));var db=require(_0xa1c9('0x5'))['db'];var utils=require(_0xa1c9('0x6'));var logger=require('../../config/logger')(_0xa1c9('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1c9('0x8'));var client=jayson[_0xa1c9('0x9')][_0xa1c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0c89,_0x1a0364,_0x46b19a){return new BPromise(function(_0x3b1a2c,_0xc8bc5a){return client[_0xa1c9('0xb')](_0x2b0c89,_0x46b19a)[_0xa1c9('0xc')](function(_0x2fcbcd){logger[_0xa1c9('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1a0364,'request\x20sent');logger[_0xa1c9('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x1a0364,_0xa1c9('0xf'),JSON[_0xa1c9('0x10')](_0x2fcbcd));if(_0x2fcbcd[_0xa1c9('0x11')]){if(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);return _0xc8bc5a(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);return _0x3b1a2c(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xd')](_0xa1c9('0x13'),_0x1a0364,_0xa1c9('0xf'));_0x3b1a2c(_0x2fcbcd['result'][_0xa1c9('0x14')]);}})['catch'](function(_0x12d989){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x12d989);_0xc8bc5a(_0x12d989);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 41f38bf..04ed0fc 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 _0x2a37=['../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x758841,_0x29e9df){var _0x24e623=function(_0x5474ea){while(--_0x5474ea){_0x758841['push'](_0x758841['shift']());}};_0x24e623(++_0x29e9df);}(_0x2a37,0x14e));var _0x72a3=function(_0x1737b6,_0xa55158){_0x1737b6=_0x1737b6-0x0;var _0x208f2c=_0x2a37[_0x1737b6];return _0x208f2c;};'use strict';var multer=require(_0x72a3('0x0'));var util=require(_0x72a3('0x1'));var path=require('path');var timeout=require(_0x72a3('0x2'));var express=require(_0x72a3('0x3'));var router=express[_0x72a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x72a3('0x5'));var interaction=require(_0x72a3('0x6'));var config=require(_0x72a3('0x7'));var controller=require(_0x72a3('0x8'));router[_0x72a3('0x9')]('/',auth['isAuthenticated'](),controller[_0x72a3('0xa')]);router[_0x72a3('0x9')](_0x72a3('0xb'),auth['isAuthenticated'](),controller[_0x72a3('0xc')]);router[_0x72a3('0xd')]('/',auth[_0x72a3('0xe')](),controller[_0x72a3('0xf')]);router[_0x72a3('0x10')](_0x72a3('0xb'),auth[_0x72a3('0xe')](),controller[_0x72a3('0x11')]);router[_0x72a3('0x12')](_0x72a3('0xb'),auth[_0x72a3('0xe')](),controller['destroy']);module[_0x72a3('0x13')]=router; \ No newline at end of file +var _0x2802=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x26371f,_0x3529d6){var _0x7bf77f=function(_0xaaf7ec){while(--_0xaaf7ec){_0x26371f['push'](_0x26371f['shift']());}};_0x7bf77f(++_0x3529d6);}(_0x2802,0x118));var _0x2280=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x2802[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var path=require(_0x2280('0x2'));var timeout=require(_0x2280('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2280('0x4'));var auth=require(_0x2280('0x5'));var interaction=require(_0x2280('0x6'));var config=require(_0x2280('0x7'));var controller=require(_0x2280('0x8'));router[_0x2280('0x9')]('/',auth[_0x2280('0xa')](),controller[_0x2280('0xb')]);router[_0x2280('0x9')](_0x2280('0xc'),auth[_0x2280('0xa')](),controller['show']);router[_0x2280('0xd')]('/',auth['isAuthenticated'](),controller[_0x2280('0xe')]);router[_0x2280('0xf')](_0x2280('0xc'),auth[_0x2280('0xa')](),controller[_0x2280('0x10')]);router[_0x2280('0x11')]('/:id',auth[_0x2280('0xa')](),controller[_0x2280('0x12')]);module[_0x2280('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 5017da6..5c0d3ba 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 _0x80f6=['sequelize','exports','STRING','name'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0x80f6,0xac));var _0x680f=function(_0x4cfb97,_0x1ac723){_0x4cfb97=_0x4cfb97-0x0;var _0x45c2d6=_0x80f6[_0x4cfb97];return _0x45c2d6;};'use strict';var Sequelize=require(_0x680f('0x0'));module[_0x680f('0x1')]={'name':{'type':Sequelize[_0x680f('0x2')],'unique':_0x680f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x680f('0x2')]}}; \ No newline at end of file +var _0xcd7b=['exports','STRING','name'];(function(_0x2ddd5a,_0x132cea){var _0x35a682=function(_0x2578b1){while(--_0x2578b1){_0x2ddd5a['push'](_0x2ddd5a['shift']());}};_0x35a682(++_0x132cea);}(_0xcd7b,0x72));var _0xbcd7=function(_0x3730d7,_0x1ed38c){_0x3730d7=_0x3730d7-0x0;var _0xebcff=_0xcd7b[_0x3730d7];return _0xebcff;};'use strict';var Sequelize=require('sequelize');module[_0xbcd7('0x0')]={'name':{'type':Sequelize[_0xbcd7('0x1')],'unique':_0xbcd7('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xbcd7('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 0c3d6e2..901902e 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 _0x5b4c=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','filter','includeAll','include','findAll','show','params','options','find','catch'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x5b4c,0x1d4));var _0xc5b4=function(_0x234b6d,_0x476a51){_0x234b6d=_0x234b6d-0x0;var _0x9f2cb9=_0x5b4c[_0x234b6d];return _0x9f2cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5b4('0x0'));var zipdir=require(_0xc5b4('0x1'));var jsonpatch=require(_0xc5b4('0x2'));var rp=require(_0xc5b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc5b4('0x4'));var util=require(_0xc5b4('0x5'));var path=require('path');var sox=require(_0xc5b4('0x6'));var csv=require(_0xc5b4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5b4('0x8'));var _=require(_0xc5b4('0x9'));var squel=require(_0xc5b4('0xa'));var crypto=require(_0xc5b4('0xb'));var jsforce=require(_0xc5b4('0xc'));var deskjs=require(_0xc5b4('0xd'));var toCsv=require(_0xc5b4('0x7'));var querystring=require(_0xc5b4('0xe'));var Papa=require('papaparse');var Redis=require(_0xc5b4('0xf'));var authService=require(_0xc5b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc5b4('0x11'));var hardwareService=require(_0xc5b4('0x12'));var logger=require('../../config/logger')(_0xc5b4('0x13'));var utils=require('../../config/utils');var config=require(_0xc5b4('0x14'));var licenseUtil=require(_0xc5b4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf705a6,_0x392d79){_0x392d79=_0x392d79||0xcc;return function(_0x48b009){if(_0x48b009){return _0xf705a6['sendStatus'](_0x392d79);}return _0xf705a6[_0xc5b4('0x16')](_0x392d79)[_0xc5b4('0x17')]();};}function respondWithResult(_0x44d278,_0x23e753){_0x23e753=_0x23e753||0xc8;return function(_0x2f3e23){if(_0x2f3e23){return _0x44d278[_0xc5b4('0x16')](_0x23e753)[_0xc5b4('0x18')](_0x2f3e23);}};}function respondWithFilteredResult(_0x1bee3f,_0x1c11b6){return function(_0x5bec14){if(_0x5bec14){var _0xf7f559=typeof _0x1c11b6[_0xc5b4('0x19')]==='undefined'&&typeof _0x1c11b6[_0xc5b4('0x1a')]===_0xc5b4('0x1b');var _0x2353e1=_0x5bec14[_0xc5b4('0x1c')];var _0x8a096d=_0xf7f559?0x0:_0x1c11b6['offset'];var _0x472551=_0xf7f559?_0x5bec14['count']:_0x1c11b6['offset']+_0x1c11b6[_0xc5b4('0x1a')];var _0x44b501;if(_0x472551>=_0x2353e1){_0x472551=_0x2353e1;_0x44b501=0xc8;}else{_0x44b501=0xce;}_0x1bee3f[_0xc5b4('0x16')](_0x44b501);return _0x1bee3f['set'](_0xc5b4('0x1d'),_0x8a096d+'-'+_0x472551+'/'+_0x2353e1)[_0xc5b4('0x18')](_0x5bec14);}return null;};}function patchUpdates(_0x395477){return function(_0x5ce3ef){try{jsonpatch[_0xc5b4('0x1e')](_0x5ce3ef,_0x395477,!![]);}catch(_0x2527af){return BPromise[_0xc5b4('0x1f')](_0x2527af);}return _0x5ce3ef[_0xc5b4('0x20')]();};}function saveUpdates(_0x51a68a,_0x15d95f){return function(_0x5455aa){if(_0x5455aa){return _0x5455aa[_0xc5b4('0x21')](_0x51a68a)[_0xc5b4('0x22')](function(_0x40cdc6){return _0x40cdc6;});}return null;};}function removeEntity(_0x189267,_0x3f5b25){return function(_0x5eb3c4){if(_0x5eb3c4){return _0x5eb3c4[_0xc5b4('0x23')]()[_0xc5b4('0x22')](function(){var _0x1df574=_0x5eb3c4[_0xc5b4('0x24')]({'plain':!![]});var _0x4f41af=_0xc5b4('0x25');return db[_0xc5b4('0x26')][_0xc5b4('0x23')]({'where':{'type':_0x4f41af,'resourceId':_0x1df574['id']}})[_0xc5b4('0x22')](function(){return _0x5eb3c4;});})['then'](function(){_0x189267[_0xc5b4('0x16')](0xcc)[_0xc5b4('0x17')]();});}};}function handleEntityNotFound(_0x30b9b7,_0x41c3ba){return function(_0x5c6365){if(!_0x5c6365){_0x30b9b7[_0xc5b4('0x27')](0x194);}return _0x5c6365;};}function handleError(_0x1792d8,_0x193f82){_0x193f82=_0x193f82||0x1f4;return function(_0x551e8f){logger[_0xc5b4('0x28')](_0x551e8f[_0xc5b4('0x29')]);if(_0x551e8f[_0xc5b4('0x2a')]){delete _0x551e8f[_0xc5b4('0x2a')];}_0x1792d8['status'](_0x193f82)[_0xc5b4('0x2b')](_0x551e8f);};}exports['index']=function(_0x110e58,_0x3995a6){var _0x284167={},_0x25c03c={},_0x3a29c0={'count':0x0,'rows':[]};var _0x466162=_[_0xc5b4('0x2c')](db[_0xc5b4('0x2d')][_0xc5b4('0x2e')],function(_0x5d77d6){return{'name':_0x5d77d6['fieldName'],'type':_0x5d77d6[_0xc5b4('0x2f')][_0xc5b4('0x30')]};});_0x25c03c[_0xc5b4('0x31')]=_[_0xc5b4('0x2c')](_0x466162,_0xc5b4('0x2a'));_0x25c03c[_0xc5b4('0x32')]=_[_0xc5b4('0x33')](_0x110e58['query']);_0x25c03c[_0xc5b4('0x34')]=_[_0xc5b4('0x35')](_0x25c03c[_0xc5b4('0x31')],_0x25c03c[_0xc5b4('0x32')]);_0x284167[_0xc5b4('0x36')]=_[_0xc5b4('0x35')](_0x25c03c['model'],qs['fields'](_0x110e58[_0xc5b4('0x32')][_0xc5b4('0x37')]));_0x284167['attributes']=_0x284167['attributes'][_0xc5b4('0x38')]?_0x284167[_0xc5b4('0x36')]:_0x25c03c[_0xc5b4('0x31')];if(!_0x110e58[_0xc5b4('0x32')][_0xc5b4('0x39')]('nolimit')){_0x284167['limit']=qs[_0xc5b4('0x1a')](_0x110e58['query']['limit']);_0x284167['offset']=qs[_0xc5b4('0x19')](_0x110e58[_0xc5b4('0x32')]['offset']);}_0x284167['order']=qs[_0xc5b4('0x3a')](_0x110e58[_0xc5b4('0x32')][_0xc5b4('0x3a')]);_0x284167['where']=qs['filters'](_[_0xc5b4('0x3b')](_0x110e58[_0xc5b4('0x32')],_0x25c03c[_0xc5b4('0x34')]),_0x466162);if(_0x110e58[_0xc5b4('0x32')]['filter']){_0x284167[_0xc5b4('0x3c')]=_[_0xc5b4('0x3d')](_0x284167[_0xc5b4('0x3c')],{'$or':_['map'](_0x466162,function(_0x4029a1){if(_0x4029a1[_0xc5b4('0x2f')]!=='VIRTUAL'){var _0x49acf0={};_0x49acf0[_0x4029a1[_0xc5b4('0x2a')]]={'$like':'%'+_0x110e58[_0xc5b4('0x32')][_0xc5b4('0x3e')]+'%'};return _0x49acf0;}})});}_0x284167=_[_0xc5b4('0x3d')]({},_0x284167,_0x110e58['options']);var _0x4bc099={'where':_0x284167[_0xc5b4('0x3c')]};return db[_0xc5b4('0x2d')][_0xc5b4('0x1c')](_0x4bc099)['then'](function(_0x29bf6a){_0x3a29c0['count']=_0x29bf6a;if(_0x110e58[_0xc5b4('0x32')][_0xc5b4('0x3f')]){_0x284167[_0xc5b4('0x40')]=[{'all':!![]}];}return db[_0xc5b4('0x2d')][_0xc5b4('0x41')](_0x284167);})['then'](function(_0x29b5e0){_0x3a29c0['rows']=_0x29b5e0;return _0x3a29c0;})[_0xc5b4('0x22')](respondWithFilteredResult(_0x3995a6,_0x284167))['catch'](handleError(_0x3995a6,null));};exports[_0xc5b4('0x42')]=function(_0x95a33a,_0x3e07d3){var _0xd14c2c={'raw':!![],'where':{'id':_0x95a33a[_0xc5b4('0x43')]['id']}},_0x200d9c={};_0x200d9c['model']=_['keys'](db[_0xc5b4('0x2d')][_0xc5b4('0x2e')]);_0x200d9c[_0xc5b4('0x32')]=_[_0xc5b4('0x33')](_0x95a33a['query']);_0x200d9c[_0xc5b4('0x34')]=_['intersection'](_0x200d9c[_0xc5b4('0x31')],_0x200d9c['query']);_0xd14c2c[_0xc5b4('0x36')]=_[_0xc5b4('0x35')](_0x200d9c['model'],qs['fields'](_0x95a33a[_0xc5b4('0x32')]['fields']));_0xd14c2c['attributes']=_0xd14c2c['attributes']['length']?_0xd14c2c['attributes']:_0x200d9c[_0xc5b4('0x31')];if(_0x95a33a[_0xc5b4('0x32')]['includeAll']){_0xd14c2c[_0xc5b4('0x40')]=[{'all':!![]}];}_0xd14c2c=_[_0xc5b4('0x3d')]({},_0xd14c2c,_0x95a33a[_0xc5b4('0x44')]);return db['Pause'][_0xc5b4('0x45')](_0xd14c2c)[_0xc5b4('0x22')](handleEntityNotFound(_0x3e07d3,null))[_0xc5b4('0x22')](respondWithResult(_0x3e07d3,null))[_0xc5b4('0x46')](handleError(_0x3e07d3,null));};exports[_0xc5b4('0x47')]=function(_0x1b6a6d,_0x56aaa7){return db['Pause'][_0xc5b4('0x47')](_0x1b6a6d[_0xc5b4('0x48')],{})[_0xc5b4('0x22')](function(_0x548b38){var _0x458603=_0x1b6a6d[_0xc5b4('0x49')][_0xc5b4('0x24')]({'plain':!![]});if(!_0x458603)throw new Error(_0xc5b4('0x4a'));if(_0x458603['role']===_0xc5b4('0x49')){var _0x219a1b=_0x548b38[_0xc5b4('0x24')]({'plain':!![]});var _0x40e5e9='Pauses';return db['UserProfileSection'][_0xc5b4('0x45')]({'where':{'name':_0x40e5e9,'userProfileId':_0x458603[_0xc5b4('0x4b')]},'raw':!![]})[_0xc5b4('0x22')](function(_0x16ebdb){if(_0x16ebdb&&_0x16ebdb['autoAssociation']===0x0){return db[_0xc5b4('0x26')][_0xc5b4('0x47')]({'name':_0x219a1b[_0xc5b4('0x2a')],'resourceId':_0x219a1b['id'],'type':_0x16ebdb[_0xc5b4('0x2a')],'sectionId':_0x16ebdb['id']},{})[_0xc5b4('0x22')](function(){return _0x548b38;});}else{return _0x548b38;}})[_0xc5b4('0x46')](function(_0xde61af){logger[_0xc5b4('0x28')](_0xc5b4('0x4c'),_0xde61af);throw _0xde61af;});}return _0x548b38;})[_0xc5b4('0x22')](respondWithResult(_0x56aaa7,0xc9))['catch'](handleError(_0x56aaa7,null));};exports[_0xc5b4('0x21')]=function(_0x1c9f36,_0x345e21){if(_0x1c9f36[_0xc5b4('0x48')]['id']){delete _0x1c9f36['body']['id'];}return db['Pause'][_0xc5b4('0x45')]({'where':{'id':_0x1c9f36[_0xc5b4('0x43')]['id']}})[_0xc5b4('0x22')](handleEntityNotFound(_0x345e21,null))['then'](saveUpdates(_0x1c9f36[_0xc5b4('0x48')],null))[_0xc5b4('0x22')](respondWithResult(_0x345e21,null))[_0xc5b4('0x46')](handleError(_0x345e21,null));};exports[_0xc5b4('0x23')]=function(_0x25b898,_0x5705fc){return db[_0xc5b4('0x2d')]['find']({'where':{'id':_0x25b898[_0xc5b4('0x43')]['id']}})[_0xc5b4('0x22')](handleEntityNotFound(_0x5705fc,null))['then'](removeEntity(_0x5705fc,null))['catch'](handleError(_0x5705fc,null));}; \ No newline at end of file +var _0x06a8=['sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','show','params','include','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','Pauses','end'];(function(_0x5bf508,_0x3a7c36){var _0xcda9d2=function(_0x4e8851){while(--_0x4e8851){_0x5bf508['push'](_0x5bf508['shift']());}};_0xcda9d2(++_0x3a7c36);}(_0x06a8,0x1d0));var _0x806a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x06a8[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x806a('0x0'));var rimraf=require(_0x806a('0x1'));var zipdir=require(_0x806a('0x2'));var jsonpatch=require(_0x806a('0x3'));var rp=require(_0x806a('0x4'));var moment=require('moment');var BPromise=require(_0x806a('0x5'));var Mustache=require(_0x806a('0x6'));var util=require(_0x806a('0x7'));var path=require(_0x806a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x806a('0x9'));var fs=require('fs');var fs_extra=require(_0x806a('0xa'));var _=require('lodash');var squel=require(_0x806a('0xb'));var crypto=require(_0x806a('0xc'));var jsforce=require(_0x806a('0xd'));var deskjs=require(_0x806a('0xe'));var toCsv=require(_0x806a('0xf'));var querystring=require(_0x806a('0x10'));var Papa=require('papaparse');var Redis=require(_0x806a('0x11'));var authService=require(_0x806a('0x12'));var qs=require(_0x806a('0x13'));var as=require(_0x806a('0x14'));var hardwareService=require(_0x806a('0x15'));var logger=require(_0x806a('0x16'))(_0x806a('0x17'));var utils=require(_0x806a('0x18'));var config=require(_0x806a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x806a('0x1a'))['db'];function respondWithStatusCode(_0x4c026a,_0x479f55){_0x479f55=_0x479f55||0xcc;return function(_0x306277){if(_0x306277){return _0x4c026a['sendStatus'](_0x479f55);}return _0x4c026a[_0x806a('0x1b')](_0x479f55)['end']();};}function respondWithResult(_0x32d5c2,_0x19fc30){_0x19fc30=_0x19fc30||0xc8;return function(_0x4640e6){if(_0x4640e6){return _0x32d5c2[_0x806a('0x1b')](_0x19fc30)[_0x806a('0x1c')](_0x4640e6);}};}function respondWithFilteredResult(_0x9721c2,_0x6fc262){return function(_0x592f42){if(_0x592f42){var _0x103fad=typeof _0x6fc262[_0x806a('0x1d')]===_0x806a('0x1e')&&typeof _0x6fc262[_0x806a('0x1f')]==='undefined';var _0x22310a=_0x592f42[_0x806a('0x20')];var _0x58b69c=_0x103fad?0x0:_0x6fc262[_0x806a('0x1d')];var _0x396ec9=_0x103fad?_0x592f42[_0x806a('0x20')]:_0x6fc262[_0x806a('0x1d')]+_0x6fc262[_0x806a('0x1f')];var _0x504b0b;if(_0x396ec9>=_0x22310a){_0x396ec9=_0x22310a;_0x504b0b=0xc8;}else{_0x504b0b=0xce;}_0x9721c2[_0x806a('0x1b')](_0x504b0b);return _0x9721c2[_0x806a('0x21')](_0x806a('0x22'),_0x58b69c+'-'+_0x396ec9+'/'+_0x22310a)['json'](_0x592f42);}return null;};}function patchUpdates(_0x121e12){return function(_0x428da1){try{jsonpatch['apply'](_0x428da1,_0x121e12,!![]);}catch(_0x191f7b){return BPromise[_0x806a('0x23')](_0x191f7b);}return _0x428da1['save']();};}function saveUpdates(_0x39c4d8,_0x30adca){return function(_0x28201f){if(_0x28201f){return _0x28201f['update'](_0x39c4d8)[_0x806a('0x24')](function(_0x38c491){return _0x38c491;});}return null;};}function removeEntity(_0x548f3f,_0xf39697){return function(_0x2c45da){if(_0x2c45da){return _0x2c45da['destroy']()[_0x806a('0x24')](function(){var _0x102b41=_0x2c45da[_0x806a('0x25')]({'plain':!![]});var _0xeb0fda=_0x806a('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0xeb0fda,'resourceId':_0x102b41['id']}})[_0x806a('0x24')](function(){return _0x2c45da;});})['then'](function(){_0x548f3f['status'](0xcc)[_0x806a('0x27')]();});}};}function handleEntityNotFound(_0x3d8a43,_0x2167bb){return function(_0xad3232){if(!_0xad3232){_0x3d8a43[_0x806a('0x28')](0x194);}return _0xad3232;};}function handleError(_0x4a7985,_0x2d122f){_0x2d122f=_0x2d122f||0x1f4;return function(_0x43dd30){logger[_0x806a('0x29')](_0x43dd30[_0x806a('0x2a')]);if(_0x43dd30['name']){delete _0x43dd30[_0x806a('0x2b')];}_0x4a7985['status'](_0x2d122f)[_0x806a('0x2c')](_0x43dd30);};}exports[_0x806a('0x2d')]=function(_0x4de1f4,_0x1486b6){var _0x386c59={},_0x2800cd={},_0x21fd41={'count':0x0,'rows':[]};var _0x11a158=_[_0x806a('0x2e')](db[_0x806a('0x2f')][_0x806a('0x30')],function(_0x50e9ef){return{'name':_0x50e9ef[_0x806a('0x31')],'type':_0x50e9ef[_0x806a('0x32')]['key']};});_0x2800cd[_0x806a('0x33')]=_[_0x806a('0x2e')](_0x11a158,'name');_0x2800cd[_0x806a('0x34')]=_[_0x806a('0x35')](_0x4de1f4['query']);_0x2800cd[_0x806a('0x36')]=_[_0x806a('0x37')](_0x2800cd[_0x806a('0x33')],_0x2800cd[_0x806a('0x34')]);_0x386c59[_0x806a('0x38')]=_[_0x806a('0x37')](_0x2800cd['model'],qs['fields'](_0x4de1f4[_0x806a('0x34')][_0x806a('0x39')]));_0x386c59['attributes']=_0x386c59[_0x806a('0x38')][_0x806a('0x3a')]?_0x386c59[_0x806a('0x38')]:_0x2800cd[_0x806a('0x33')];if(!_0x4de1f4[_0x806a('0x34')][_0x806a('0x3b')](_0x806a('0x3c'))){_0x386c59[_0x806a('0x1f')]=qs[_0x806a('0x1f')](_0x4de1f4['query']['limit']);_0x386c59['offset']=qs[_0x806a('0x1d')](_0x4de1f4[_0x806a('0x34')]['offset']);}_0x386c59[_0x806a('0x3d')]=qs[_0x806a('0x3e')](_0x4de1f4['query'][_0x806a('0x3e')]);_0x386c59[_0x806a('0x3f')]=qs[_0x806a('0x36')](_[_0x806a('0x40')](_0x4de1f4[_0x806a('0x34')],_0x2800cd[_0x806a('0x36')]),_0x11a158);if(_0x4de1f4[_0x806a('0x34')][_0x806a('0x41')]){_0x386c59[_0x806a('0x3f')]=_['merge'](_0x386c59[_0x806a('0x3f')],{'$or':_['map'](_0x11a158,function(_0xae5efa){if(_0xae5efa[_0x806a('0x32')]!==_0x806a('0x42')){var _0x211545={};_0x211545[_0xae5efa[_0x806a('0x2b')]]={'$like':'%'+_0x4de1f4[_0x806a('0x34')][_0x806a('0x41')]+'%'};return _0x211545;}})});}_0x386c59=_['merge']({},_0x386c59,_0x4de1f4['options']);var _0x13dac2={'where':_0x386c59[_0x806a('0x3f')]};return db[_0x806a('0x2f')][_0x806a('0x20')](_0x13dac2)[_0x806a('0x24')](function(_0x51c865){_0x21fd41[_0x806a('0x20')]=_0x51c865;if(_0x4de1f4[_0x806a('0x34')][_0x806a('0x43')]){_0x386c59['include']=[{'all':!![]}];}return db[_0x806a('0x2f')]['findAll'](_0x386c59);})[_0x806a('0x24')](function(_0x294bac){_0x21fd41['rows']=_0x294bac;return _0x21fd41;})[_0x806a('0x24')](respondWithFilteredResult(_0x1486b6,_0x386c59))['catch'](handleError(_0x1486b6,null));};exports[_0x806a('0x44')]=function(_0x54ef0b,_0x4e5fa6){var _0x43a355={'raw':!![],'where':{'id':_0x54ef0b[_0x806a('0x45')]['id']}},_0x252eeb={};_0x252eeb['model']=_['keys'](db[_0x806a('0x2f')]['rawAttributes']);_0x252eeb[_0x806a('0x34')]=_[_0x806a('0x35')](_0x54ef0b[_0x806a('0x34')]);_0x252eeb[_0x806a('0x36')]=_['intersection'](_0x252eeb[_0x806a('0x33')],_0x252eeb[_0x806a('0x34')]);_0x43a355['attributes']=_[_0x806a('0x37')](_0x252eeb[_0x806a('0x33')],qs[_0x806a('0x39')](_0x54ef0b[_0x806a('0x34')][_0x806a('0x39')]));_0x43a355[_0x806a('0x38')]=_0x43a355[_0x806a('0x38')][_0x806a('0x3a')]?_0x43a355[_0x806a('0x38')]:_0x252eeb['model'];if(_0x54ef0b[_0x806a('0x34')][_0x806a('0x43')]){_0x43a355[_0x806a('0x46')]=[{'all':!![]}];}_0x43a355=_[_0x806a('0x47')]({},_0x43a355,_0x54ef0b['options']);return db[_0x806a('0x2f')][_0x806a('0x48')](_0x43a355)[_0x806a('0x24')](handleEntityNotFound(_0x4e5fa6,null))[_0x806a('0x24')](respondWithResult(_0x4e5fa6,null))[_0x806a('0x49')](handleError(_0x4e5fa6,null));};exports[_0x806a('0x4a')]=function(_0x255663,_0x256f34){return db['Pause'][_0x806a('0x4a')](_0x255663[_0x806a('0x4b')],{})[_0x806a('0x24')](function(_0x37b3d8){var _0x36e299=_0x255663['user'][_0x806a('0x25')]({'plain':!![]});if(!_0x36e299)throw new Error(_0x806a('0x4c'));if(_0x36e299[_0x806a('0x4d')]==='user'){var _0x5ce1f7=_0x37b3d8['get']({'plain':!![]});var _0x1e73c5=_0x806a('0x26');return db[_0x806a('0x4e')][_0x806a('0x48')]({'where':{'name':_0x1e73c5,'userProfileId':_0x36e299[_0x806a('0x4f')]},'raw':!![]})['then'](function(_0x5d3832){if(_0x5d3832&&_0x5d3832[_0x806a('0x50')]===0x0){return db[_0x806a('0x51')][_0x806a('0x4a')]({'name':_0x5ce1f7['name'],'resourceId':_0x5ce1f7['id'],'type':_0x5d3832['name'],'sectionId':_0x5d3832['id']},{})[_0x806a('0x24')](function(){return _0x37b3d8;});}else{return _0x37b3d8;}})[_0x806a('0x49')](function(_0x34eb4f){logger[_0x806a('0x29')](_0x806a('0x52'),_0x34eb4f);throw _0x34eb4f;});}return _0x37b3d8;})['then'](respondWithResult(_0x256f34,0xc9))[_0x806a('0x49')](handleError(_0x256f34,null));};exports['update']=function(_0x5cc52c,_0x8499c4){if(_0x5cc52c[_0x806a('0x4b')]['id']){delete _0x5cc52c[_0x806a('0x4b')]['id'];}return db[_0x806a('0x2f')][_0x806a('0x48')]({'where':{'id':_0x5cc52c[_0x806a('0x45')]['id']}})[_0x806a('0x24')](handleEntityNotFound(_0x8499c4,null))[_0x806a('0x24')](saveUpdates(_0x5cc52c[_0x806a('0x4b')],null))[_0x806a('0x24')](respondWithResult(_0x8499c4,null))[_0x806a('0x49')](handleError(_0x8499c4,null));};exports[_0x806a('0x53')]=function(_0x5c0c00,_0x3c6e85){return db[_0x806a('0x2f')]['find']({'where':{'id':_0x5c0c00['params']['id']}})[_0x806a('0x24')](handleEntityNotFound(_0x3c6e85,null))[_0x806a('0x24')](removeEntity(_0x3c6e85,null))[_0x806a('0x49')](handleError(_0x3c6e85,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ce20121..371ce86 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x2e0090,_0x491017){var _0x2d07c0=function(_0x45419c){while(--_0x45419c){_0x2e0090['push'](_0x2e0090['shift']());}};_0x2d07c0(++_0x491017);}(_0x814b,0x1a2));var _0xb814=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x814b[_0x426711];return _0x592991;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x2f09f7,_0x461707){var _0x1b266c=function(_0xbff8dc){while(--_0xbff8dc){_0x2f09f7['push'](_0x2f09f7['shift']());}};_0x1b266c(++_0x461707);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2757ee,_0xd57bd0){_0x2757ee=_0x2757ee-0x0;var _0x563e98=_0x8ef6[_0x2757ee];return _0x563e98;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 bcb9e8f..1f8692d 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(_0x528dc0,_0x4def1c){var _0x50cbfd=function(_0x4102a1){while(--_0x4102a1){_0x528dc0['push'](_0x528dc0['shift']());}};_0x50cbfd(++_0x4def1c);}(_0xb10b,0x12a));var _0xbb10=function(_0x174125,_0x542e78){_0x174125=_0x174125-0x0;var _0x513f0c=_0xb10b[_0x174125];return _0x513f0c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x620a8a,_0x3008be){var _0x38d91a=function(_0x55ae9a){while(--_0x55ae9a){_0x620a8a['push'](_0x620a8a['shift']());}};_0x38d91a(++_0x3008be);}(_0x7a54,0x106));var _0x47a5=function(_0x1b1e0d,_0x4c6ba6){_0x1b1e0d=_0x1b1e0d-0x0;var _0x30c8f9=_0x7a54[_0x1b1e0d];return _0x30c8f9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b8be282..e57c9b9 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 _0x826a=['fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','now','post','single','file','webhookPost','put','update','delete','exports','util','connect-timeout','Router'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x826a,0x1aa));var _0xa826=function(_0x34d893,_0x272d05){_0x34d893=_0x34d893-0x0;var _0x3cf082=_0x826a[_0x34d893];return _0x3cf082;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);var upload=multer({'storage':multer[_0xa826('0x10')]({'destination':function(_0x48df82,_0xbd22fc,_0x4b4caf){_0x4b4caf(null,path[_0xa826('0x11')](config[_0xa826('0x12')],_0xa826('0x13')));},'filename':function(_0xa55bd7,_0x212fac,_0x40838f){_0x212fac[_0xa826('0x14')]=_0x212fac['originalname'][_0xa826('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40838f(null,util['format'](_0xa826('0x16'),path[_0xa826('0x17')](_0x212fac['originalname'],path['extname'](_0x212fac['originalname'])),Date[_0xa826('0x18')](),path['extname'](_0x212fac['originalname'])));}})});router[_0xa826('0x19')]('/',upload[_0xa826('0x1a')](_0xa826('0x1b')),controller['upload']);router[_0xa826('0x19')](_0xa826('0xa'),controller[_0xa826('0x1c')]);router[_0xa826('0x1d')](_0xa826('0xc'),auth['isAuthenticated'](),controller[_0xa826('0x1e')]);router[_0xa826('0x1f')](_0xa826('0xc'),auth['isAuthenticated'](),controller['delete']);module[_0xa826('0x20')]=router; \ No newline at end of file +var _0x5db8=['basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s'];(function(_0x285792,_0x14206a){var _0x5b7845=function(_0x43805c){while(--_0x43805c){_0x285792['push'](_0x285792['shift']());}};_0x5b7845(++_0x14206a);}(_0x5db8,0xbb));var _0x85db=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x5db8[_0x4854d6];return _0x3885c0;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),controller[_0x85db('0xb')]);router[_0x85db('0x8')](_0x85db('0xc'),auth['isAuthenticated'](),controller[_0x85db('0xd')]);router['get'](_0x85db('0xe'),auth[_0x85db('0x9')](),controller[_0x85db('0xf')]);var upload=multer({'storage':multer[_0x85db('0x10')]({'destination':function(_0x5491fa,_0x54feb2,_0x51fd42){_0x51fd42(null,path[_0x85db('0x11')](config[_0x85db('0x12')],'server/files/plugins'));},'filename':function(_0x11ac68,_0x541f2f,_0x437f7a){_0x541f2f[_0x85db('0x13')]=_0x541f2f[_0x85db('0x13')][_0x85db('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x437f7a(null,util[_0x85db('0x15')](_0x85db('0x16'),path[_0x85db('0x17')](_0x541f2f[_0x85db('0x13')],path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])),Date[_0x85db('0x19')](),path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])));}})});router['post']('/',upload[_0x85db('0x1a')](_0x85db('0x1b')),controller[_0x85db('0x1c')]);router[_0x85db('0x1d')](_0x85db('0xa'),controller[_0x85db('0x1e')]);router[_0x85db('0x1f')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x20')]);router[_0x85db('0x21')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0x21')]);module[_0x85db('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2c9a445..9c3ffbb 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 _0x3d9f=['adminOnly','never','always','sequelize','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x5c0fee,_0x55699d){var _0x4900db=function(_0x14905f){while(--_0x14905f){_0x5c0fee['push'](_0x5c0fee['shift']());}};_0x4900db(++_0x55699d);}(_0x3d9f,0x163));var _0xf3d9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3d9f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf3d9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf3d9('0x1')](_0xf3d9('0x2'),_0xf3d9('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xf3d9('0x4')]},'path':{'type':Sequelize[_0xf3d9('0x5')],'comment':_0xf3d9('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf3d9('0x7')},'sidebar':{'type':Sequelize[_0xf3d9('0x1')](_0xf3d9('0x8'),'agentOnly','always',_0xf3d9('0x9')),'defaultValue':_0xf3d9('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xf3d9('0x5')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xf3d9('0x5')]},'scriptName':{'type':Sequelize[_0xf3d9('0x5')]},'scriptPath':{'type':Sequelize[_0xf3d9('0x5')]}}; \ No newline at end of file +var _0xeed4=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x36a59e,_0x51cf64){var _0x4fc3f1=function(_0x292a44){while(--_0x292a44){_0x36a59e['push'](_0x36a59e['shift']());}};_0x4fc3f1(++_0x51cf64);}(_0xeed4,0x162));var _0x4eed=function(_0x36ca7f,_0x337025){_0x36ca7f=_0x36ca7f-0x0;var _0x1dedcd=_0xeed4[_0x36ca7f];return _0x1dedcd;};'use strict';var Sequelize=require(_0x4eed('0x0'));module[_0x4eed('0x1')]={'name':{'type':Sequelize[_0x4eed('0x2')]},'type':{'type':Sequelize[_0x4eed('0x3')](_0x4eed('0x4'),_0x4eed('0x5'))},'description':{'type':Sequelize[_0x4eed('0x6')]},'version':{'type':Sequelize[_0x4eed('0x6')]},'path':{'type':Sequelize[_0x4eed('0x2')],'comment':_0x4eed('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4eed('0x8')},'sidebar':{'type':Sequelize[_0x4eed('0x3')](_0x4eed('0x9'),_0x4eed('0xa'),_0x4eed('0xb'),_0x4eed('0xc')),'defaultValue':_0x4eed('0xb'),'comment':_0x4eed('0xd')},'icon':{'type':Sequelize[_0x4eed('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4eed('0x2')]},'scriptName':{'type':Sequelize[_0x4eed('0x2')]},'scriptPath':{'type':Sequelize[_0x4eed('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b4046ac..1b50d61 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 _0xdb86=['glob','**/*','dirname','basename','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20views\x20missing','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','views','admin','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','format','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe'];(function(_0x94477c,_0x5603fd){var _0x342c96=function(_0x53c60f){while(--_0x53c60f){_0x94477c['push'](_0x94477c['shift']());}};_0x342c96(++_0x5603fd);}(_0xdb86,0x199));var _0x6db8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb86[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6db8('0x0'));var rimraf=require(_0x6db8('0x1'));var zipdir=require(_0x6db8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6db8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6db8('0x4'));var util=require('util');var path=require(_0x6db8('0x5'));var sox=require(_0x6db8('0x6'));var csv=require(_0x6db8('0x7'));var ejs=require(_0x6db8('0x8'));var fs=require('fs');var fs_extra=require(_0x6db8('0x9'));var _=require(_0x6db8('0xa'));var squel=require('squel');var crypto=require(_0x6db8('0xb'));var jsforce=require(_0x6db8('0xc'));var deskjs=require(_0x6db8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6db8('0xe'));var Papa=require(_0x6db8('0xf'));var extract=require(_0x6db8('0x10'));var rimraf=require('rimraf');var archiver=require(_0x6db8('0x11'));var Redis=require(_0x6db8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6db8('0x13'));var as=require(_0x6db8('0x14'));var hardwareService=require(_0x6db8('0x15'));var logger=require(_0x6db8('0x16'))('api');var utils=require(_0x6db8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db8('0x18'));var db=require('../../mysqldb')['db'];config[_0x6db8('0x19')]=_['defaults'](config['redis'],{'host':_0x6db8('0x1a'),'port':0x18eb});var socket=require(_0x6db8('0x1b'))(new Redis(config[_0x6db8('0x19')]));require('./plugin.socket')[_0x6db8('0x1c')](socket);function respondWithStatusCode(_0x47e819,_0x48fc8c){_0x48fc8c=_0x48fc8c||0xcc;return function(_0x492b04){if(_0x492b04){return _0x47e819[_0x6db8('0x1d')](_0x48fc8c);}return _0x47e819[_0x6db8('0x1e')](_0x48fc8c)[_0x6db8('0x1f')]();};}function respondWithResult(_0x880d16,_0x2667c3){_0x2667c3=_0x2667c3||0xc8;return function(_0x5677a6){if(_0x5677a6){return _0x880d16['status'](_0x2667c3)[_0x6db8('0x20')](_0x5677a6);}};}function respondWithFilteredResult(_0x49dab0,_0x346da9){return function(_0x2fc073){if(_0x2fc073){var _0x47d284=typeof _0x346da9[_0x6db8('0x21')]===_0x6db8('0x22')&&typeof _0x346da9[_0x6db8('0x23')]===_0x6db8('0x22');var _0x27ad6d=_0x2fc073[_0x6db8('0x24')];var _0xc9ac9b=_0x47d284?0x0:_0x346da9[_0x6db8('0x21')];var _0x75b37d=_0x47d284?_0x2fc073[_0x6db8('0x24')]:_0x346da9[_0x6db8('0x21')]+_0x346da9[_0x6db8('0x23')];var _0x1a464a;if(_0x75b37d>=_0x27ad6d){_0x75b37d=_0x27ad6d;_0x1a464a=0xc8;}else{_0x1a464a=0xce;}_0x49dab0[_0x6db8('0x1e')](_0x1a464a);return _0x49dab0[_0x6db8('0x25')](_0x6db8('0x26'),_0xc9ac9b+'-'+_0x75b37d+'/'+_0x27ad6d)[_0x6db8('0x20')](_0x2fc073);}return null;};}function patchUpdates(_0x17d88c){return function(_0x30b03e){try{jsonpatch['apply'](_0x30b03e,_0x17d88c,!![]);}catch(_0x1d8777){return BPromise[_0x6db8('0x27')](_0x1d8777);}return _0x30b03e[_0x6db8('0x28')]();};}function saveUpdates(_0x40040c,_0x11e763){return function(_0x1d2f69){if(_0x1d2f69){return _0x1d2f69[_0x6db8('0x29')](_0x40040c)['then'](function(_0xf21304){return _0xf21304;});}return null;};}function removeEntity(_0x884ef7,_0xf09309){return function(_0x5d523e){if(_0x5d523e){return _0x5d523e[_0x6db8('0x2a')]()[_0x6db8('0x2b')](function(){var _0x380742=_0x5d523e['get']({'plain':!![]});var _0x40a8b1=_0x6db8('0x2c');return db[_0x6db8('0x2d')][_0x6db8('0x2a')]({'where':{'type':_0x40a8b1,'resourceId':_0x380742['id']}})[_0x6db8('0x2b')](function(){return _0x5d523e;});})[_0x6db8('0x2b')](function(){_0x884ef7['status'](0xcc)[_0x6db8('0x1f')]();});}};}function handleEntityNotFound(_0x5f106d,_0x595464){return function(_0x4efa9a){if(!_0x4efa9a){_0x5f106d[_0x6db8('0x1d')](0x194);}return _0x4efa9a;};}function handleError(_0x1470c3,_0x8dd4f2){_0x8dd4f2=_0x8dd4f2||0x1f4;return function(_0x3b68b9){logger[_0x6db8('0x2e')](_0x3b68b9[_0x6db8('0x2f')]);if(_0x3b68b9[_0x6db8('0x30')]){delete _0x3b68b9[_0x6db8('0x30')];}_0x1470c3[_0x6db8('0x1e')](_0x8dd4f2)[_0x6db8('0x31')](_0x3b68b9);};}exports[_0x6db8('0x32')]=function(_0x3462d8,_0x56fd62){var _0x278efd={},_0x4e203c={},_0x360b6d={'count':0x0,'rows':[]};var _0x29cee2=_[_0x6db8('0x33')](db[_0x6db8('0x34')][_0x6db8('0x35')],function(_0x1bf1c6){return{'name':_0x1bf1c6[_0x6db8('0x36')],'type':_0x1bf1c6[_0x6db8('0x37')][_0x6db8('0x38')]};});_0x4e203c['model']=_[_0x6db8('0x33')](_0x29cee2,_0x6db8('0x30'));_0x4e203c[_0x6db8('0x39')]=_[_0x6db8('0x3a')](_0x3462d8[_0x6db8('0x39')]);_0x4e203c[_0x6db8('0x3b')]=_[_0x6db8('0x3c')](_0x4e203c[_0x6db8('0x3d')],_0x4e203c[_0x6db8('0x39')]);_0x278efd['attributes']=_[_0x6db8('0x3c')](_0x4e203c['model'],qs[_0x6db8('0x3e')](_0x3462d8['query'][_0x6db8('0x3e')]));_0x278efd[_0x6db8('0x3f')]=_0x278efd[_0x6db8('0x3f')][_0x6db8('0x40')]?_0x278efd[_0x6db8('0x3f')]:_0x4e203c[_0x6db8('0x3d')];if(!_0x3462d8['query'][_0x6db8('0x41')](_0x6db8('0x42'))){_0x278efd[_0x6db8('0x23')]=qs[_0x6db8('0x23')](_0x3462d8[_0x6db8('0x39')][_0x6db8('0x23')]);_0x278efd[_0x6db8('0x21')]=qs[_0x6db8('0x21')](_0x3462d8[_0x6db8('0x39')][_0x6db8('0x21')]);}_0x278efd[_0x6db8('0x43')]=qs[_0x6db8('0x44')](_0x3462d8[_0x6db8('0x39')]['sort']);_0x278efd[_0x6db8('0x45')]=qs['filters'](_[_0x6db8('0x46')](_0x3462d8['query'],_0x4e203c[_0x6db8('0x3b')]),_0x29cee2);if(_0x3462d8[_0x6db8('0x39')][_0x6db8('0x47')]){_0x278efd[_0x6db8('0x45')]=_[_0x6db8('0x48')](_0x278efd[_0x6db8('0x45')],{'$or':_[_0x6db8('0x33')](_0x29cee2,function(_0x2d889d){if(_0x2d889d['type']!==_0x6db8('0x49')){var _0x277c76={};_0x277c76[_0x2d889d['name']]={'$like':'%'+_0x3462d8['query'][_0x6db8('0x47')]+'%'};return _0x277c76;}})});}_0x278efd=_[_0x6db8('0x48')]({},_0x278efd,_0x3462d8[_0x6db8('0x4a')]);var _0x2c522f={'where':_0x278efd[_0x6db8('0x45')]};return db[_0x6db8('0x34')][_0x6db8('0x24')](_0x2c522f)[_0x6db8('0x2b')](function(_0x545d86){_0x360b6d[_0x6db8('0x24')]=_0x545d86;if(_0x3462d8['query'][_0x6db8('0x4b')]){_0x278efd[_0x6db8('0x4c')]=[{'all':!![]}];}return db[_0x6db8('0x34')][_0x6db8('0x4d')](_0x278efd);})[_0x6db8('0x2b')](function(_0x3efd4b){_0x360b6d[_0x6db8('0x4e')]=_0x3efd4b;return _0x360b6d;})[_0x6db8('0x2b')](respondWithFilteredResult(_0x56fd62,_0x278efd))[_0x6db8('0x4f')](handleError(_0x56fd62,null));};exports[_0x6db8('0x50')]=function(_0x575639,_0x2e0c42){var _0x4c3e30={'raw':!![],'where':{'id':_0x575639[_0x6db8('0x51')]['id']}},_0x47c55c={};_0x47c55c[_0x6db8('0x3d')]=_[_0x6db8('0x3a')](db[_0x6db8('0x34')][_0x6db8('0x35')]);_0x47c55c[_0x6db8('0x39')]=_[_0x6db8('0x3a')](_0x575639[_0x6db8('0x39')]);_0x47c55c[_0x6db8('0x3b')]=_[_0x6db8('0x3c')](_0x47c55c[_0x6db8('0x3d')],_0x47c55c['query']);_0x4c3e30[_0x6db8('0x3f')]=_[_0x6db8('0x3c')](_0x47c55c['model'],qs['fields'](_0x575639[_0x6db8('0x39')][_0x6db8('0x3e')]));_0x4c3e30[_0x6db8('0x3f')]=_0x4c3e30[_0x6db8('0x3f')][_0x6db8('0x40')]?_0x4c3e30[_0x6db8('0x3f')]:_0x47c55c[_0x6db8('0x3d')];if(_0x575639[_0x6db8('0x39')][_0x6db8('0x4b')]){_0x4c3e30[_0x6db8('0x4c')]=[{'all':!![]}];}_0x4c3e30=_[_0x6db8('0x48')]({},_0x4c3e30,_0x575639['options']);return db[_0x6db8('0x34')][_0x6db8('0x52')](_0x4c3e30)[_0x6db8('0x2b')](handleEntityNotFound(_0x2e0c42,null))[_0x6db8('0x2b')](respondWithResult(_0x2e0c42,null))[_0x6db8('0x4f')](handleError(_0x2e0c42,null));};exports[_0x6db8('0x53')]=function(_0x24a4a4,_0x1a20c6,_0x74793b){return db['Plugin']['find']({'where':{'id':_0x24a4a4[_0x6db8('0x51')]['id']},'attributes':[_0x6db8('0x30'),'path'],'raw':!![]})[_0x6db8('0x2b')](handleEntityNotFound(_0x1a20c6,null))[_0x6db8('0x2b')](function(_0xb794da){if(_0xb794da){var _0x5aa6f7=path[_0x6db8('0x54')](config[_0x6db8('0x55')],_0x6db8('0x56'),util[_0x6db8('0x57')]('%s.zip',path['basename'](_0xb794da[_0x6db8('0x5')])));var _0x275236=fs['createWriteStream'](_0x5aa6f7);var _0x166f52=archiver(_0x6db8('0x58'),{'zlib':{'level':0x9}});_0x166f52['on']('warning',function(_0x5d8f1c){if(_0x5d8f1c[_0x6db8('0x59')]===_0x6db8('0x5a')){logger[_0x6db8('0x2e')](_0x5d8f1c);}else{throw new db[(_0x6db8('0x5b'))][(_0x6db8('0x5c'))](_0x6db8('0x5d'));}});_0x166f52['on'](_0x6db8('0x2e'),function(_0x577501){throw new db[(_0x6db8('0x5b'))][(_0x6db8('0x5c'))](_0x6db8('0x5d'));});_0x166f52[_0x6db8('0x5e')](_0x275236);_0x166f52[_0x6db8('0x5f')](_0x6db8('0x60'),{'cwd':path[_0x6db8('0x54')](config[_0x6db8('0x55')],'server/files/plugins',path[_0x6db8('0x61')](_0xb794da[_0x6db8('0x5')])),'ignore':[path[_0x6db8('0x54')](path[_0x6db8('0x62')](_0xb794da[_0x6db8('0x5')]),'node_modules/**/*'),path['join'](path['basename'](_0xb794da[_0x6db8('0x5')]),_0x6db8('0x63'))],'nodir':!![]})[_0x6db8('0x64')]();_0x275236['on'](_0x6db8('0x65'),function(){if(!fs['existsSync'](_0x5aa6f7)){throw new db[(_0x6db8('0x5b'))][(_0x6db8('0x5c'))](_0x6db8('0x66'));}return _0x1a20c6[_0x6db8('0x53')](_0x5aa6f7,util['format']('%s.zip',path[_0x6db8('0x62')](_0xb794da['path'])),function(_0x443920){if(_0x443920){throw new db[(_0x6db8('0x5b'))][(_0x6db8('0x5c'))](_0x6db8('0x67'));}fs[_0x6db8('0x68')](_0x5aa6f7);logger[_0x6db8('0x69')](_0x6db8('0x6a'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x1a20c6,null));};exports[_0x6db8('0x6b')]=function(_0x50401f,_0x17fa97,_0x5841ec){var _0x522fca=path['basename'](_0x50401f[_0x6db8('0x6c')][_0x6db8('0x6d')],path[_0x6db8('0x6e')](_0x50401f[_0x6db8('0x6c')][_0x6db8('0x6d')]));var _0x37b9a1=path['join'](config[_0x6db8('0x55')],_0x6db8('0x56'),_0x50401f[_0x6db8('0x6c')][_0x6db8('0x6d')]);var _0x5bd9cb=path[_0x6db8('0x54')](config['root'],_0x6db8('0x56'),_0x522fca);logger[_0x6db8('0x69')](_0x6db8('0x6f'),_0x37b9a1);logger[_0x6db8('0x69')](_0x6db8('0x70'),_0x5bd9cb);try{fs[_0x6db8('0x71')](_0x37b9a1,parseInt(_0x6db8('0x72'),0x8));extract(_0x37b9a1,{'dir':_0x5bd9cb},function(_0x44345d){if(_0x44345d){logger[_0x6db8('0x2e')](_0x44345d);handleError(_0x44345d,!![]);};var _0x1353e=fs[_0x6db8('0x73')](_0x5bd9cb);if(_0x1353e[_0x6db8('0x40')]>0x1){removeReferences(_0x37b9a1,_0x5bd9cb);logger[_0x6db8('0x2e')]('Invalid\x20plugin\x20structure');return _0x5841ec(new Error(_0x6db8('0x74')));}var _0x29e4a6=fs[_0x6db8('0x75')](path[_0x6db8('0x54')](_0x5bd9cb,_0x1353e[0x0]));if(_0x29e4a6[_0x6db8('0x76')]()){removeReferences(_0x37b9a1,_0x5bd9cb);logger[_0x6db8('0x2e')]('Invalid\x20plugin\x20structure');return _0x5841ec(new Error('Invalid\x20plugin\x20structure'));}if(_0x29e4a6[_0x6db8('0x77')]()){var _0x590c2e=fs[_0x6db8('0x73')](path[_0x6db8('0x54')](_0x5bd9cb,_0x1353e[0x0]));if(_0x590c2e[_0x6db8('0x40')]===0x0){removeReferences(_0x37b9a1,_0x5bd9cb);logger['error'](_0x6db8('0x74'));return _0x5841ec(new Error(_0x6db8('0x74')));}var _0x3ec4e4=_0x590c2e[_0x6db8('0x78')](function(_0x9eec61){return _0x9eec61==='manifest.json';});if(!_0x3ec4e4){return _0x5841ec(new Error(_0x6db8('0x79')));}var _0x1676a=fs[_0x6db8('0x7a')](path[_0x6db8('0x54')](_0x5bd9cb,_0x1353e[0x0],_0x6db8('0x7b')));var _0x23dc92=JSON[_0x6db8('0x7c')](_0x1676a);if(_0x6db8('0x22')==typeof _0x23dc92['name']){return _0x5841ec(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x23dc92[_0x6db8('0x37')]){return _0x5841ec(new Error(_0x6db8('0x7d')));}if(_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7e')]){return _0x5841ec(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x23dc92[_0x6db8('0x7f')]){return _0x5841ec(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x23dc92[_0x6db8('0x37')]==='html'){if(_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7f')]['views']){return _0x5841ec(new Error(_0x6db8('0x80')));}if(_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7f')]['views']['admin']&&_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7f')]['views']['agent']){return _0x5841ec(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x23dc92[_0x6db8('0x37')]===_0x6db8('0x81')){if(_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7f')][_0x6db8('0x82')]){return _0x5841ec(new Error(_0x6db8('0x83')));}if(_0x6db8('0x22')==typeof _0x23dc92[_0x6db8('0x7f')]['scriptPath']){return _0x5841ec(new Error(_0x6db8('0x84')));}}else{return _0x5841ec(new Error(_0x6db8('0x85')));}var _0x364d80=_0x23dc92['name'];var _0x461812=_0x23dc92['description'];var _0x4436a2=_0x23dc92[_0x6db8('0x37')];var _0x34302e=_0x23dc92[_0x6db8('0x86')]?_0x23dc92[_0x6db8('0x86')]:_0x6db8('0x87');var _0x21fe46=_0x23dc92['icon']?_0x23dc92['icon']:_0x6db8('0x88');var _0x212e39='';var _0x396abf='';var _0x5713d4='';var _0x33098e='';var _0x31064d=_0x23dc92[_0x6db8('0x7e')];if(_0x4436a2==='html'){if(_0x6db8('0x22')!=typeof _0x23dc92[_0x6db8('0x7f')][_0x6db8('0x89')][_0x6db8('0x8a')]){var _0x19cbac=_0x23dc92[_0x6db8('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x6db8('0x8b')](_0x19cbac)){_0x212e39=path[_0x6db8('0x54')](_0x6db8('0x8c'),_0x522fca,_0x1353e[0x0],_0x19cbac);}else{_0x212e39=_0x19cbac;}}else{logger[_0x6db8('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x6db8('0x22')!=typeof _0x23dc92[_0x6db8('0x7f')][_0x6db8('0x89')][_0x6db8('0x8d')]){var _0x578c35=_0x23dc92['parameters'][_0x6db8('0x89')][_0x6db8('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x6db8('0x8b')](_0x578c35)){_0x396abf=path[_0x6db8('0x54')](_0x6db8('0x8c'),_0x522fca,_0x1353e[0x0],_0x578c35);}else{_0x396abf=_0x578c35;}}else{logger['info'](_0x6db8('0x8e'));}}else if(_0x4436a2===_0x6db8('0x81')){_0x5713d4=_0x23dc92[_0x6db8('0x7f')][_0x6db8('0x82')];_0x33098e=_0x23dc92[_0x6db8('0x7f')]['scriptPath'];if('undefined'!=typeof _0x23dc92[_0x6db8('0x7f')][_0x6db8('0x89')]){if(_0x6db8('0x22')!=typeof _0x23dc92[_0x6db8('0x7f')]['views']['admin']){var _0x19cbac=_0x23dc92[_0x6db8('0x7f')][_0x6db8('0x89')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x6db8('0x8b')](_0x19cbac)){_0x212e39=path['join']('plugins',_0x522fca,_0x1353e[0x0],_0x19cbac);}else{_0x212e39=_0x19cbac;}}if(_0x6db8('0x22')!=typeof _0x23dc92[_0x6db8('0x7f')][_0x6db8('0x89')]['agent']){var _0x578c35=_0x23dc92[_0x6db8('0x7f')]['views'][_0x6db8('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x6db8('0x8b')](_0x578c35)){_0x396abf=path[_0x6db8('0x54')](_0x6db8('0x8c'),_0x522fca,_0x1353e[0x0],_0x578c35);}else{_0x396abf=_0x578c35;}}}}var _0x3777ec={'name':_0x364d80,'description':_0x461812,'path':path[_0x6db8('0x54')](_0x522fca,_0x1353e[0x0]),'type':_0x4436a2,'sidebar':_0x34302e,'icon':_0x21fe46,'adminUrl':_0x212e39,'agentUrl':_0x396abf,'scriptName':_0x5713d4,'scriptPath':_0x33098e,'version':_0x31064d};removeReferences(_0x37b9a1,null);return db['Plugin'][_0x6db8('0x8f')](_0x3777ec)['then'](function(_0x5f057d){var _0x1e921e={'role':_0x50401f[_0x6db8('0x90')]['role'],'userProfileId':_0x50401f[_0x6db8('0x90')][_0x6db8('0x91')]};if(!_0x1e921e)throw new Error(_0x6db8('0x92'));if(_0x1e921e[_0x6db8('0x93')]==='user'){var _0x46e4b0=_0x5f057d['get']({'plain':!![]});return db[_0x6db8('0x94')]['find']({'where':{'name':'Plugins','userProfileId':_0x1e921e[_0x6db8('0x91')]},'raw':!![]})[_0x6db8('0x2b')](function(_0x1ee177){if(_0x1ee177&&_0x1ee177[_0x6db8('0x95')]===0x0){return db[_0x6db8('0x2d')]['create']({'name':_0x46e4b0['name'],'resourceId':_0x46e4b0['id'],'type':_0x1ee177['name'],'sectionId':_0x1ee177['id']},{})[_0x6db8('0x2b')](function(){return _0x5f057d;});}else{return _0x5f057d;}})[_0x6db8('0x4f')](function(_0x1b34a4){logger['error'](_0x6db8('0x96'),_0x1b34a4);throw _0x1b34a4;});}return _0x5f057d;})[_0x6db8('0x2b')](respondWithResult(_0x17fa97,null))[_0x6db8('0x4f')](handleError(_0x17fa97,null));}});}catch(_0x1309e7){_0x17fa97['status'](0x1f4)['send'](_0x1309e7);}};function removeReferences(_0x4cd0c9,_0x2f8277){try{if(_0x4cd0c9){fs[_0x6db8('0x68')](_0x4cd0c9);logger[_0x6db8('0x69')](_0x6db8('0x97'));}if(_0x2f8277){rimraf(_0x2f8277,function(){});logger[_0x6db8('0x69')]('Extracted\x20folder\x20removed');}}catch(_0x3ad897){logger[_0x6db8('0x2e')](_0x3ad897);}}exports[_0x6db8('0x29')]=function(_0x3d65c4,_0x384748,_0x9faef2){return db['Plugin'][_0x6db8('0x52')]({'where':{'id':_0x3d65c4[_0x6db8('0x51')]['id']}})[_0x6db8('0x2b')](handleEntityNotFound(_0x384748,null))[_0x6db8('0x2b')](saveUpdates(_0x3d65c4['body'],null))[_0x6db8('0x2b')](respondWithResult(_0x384748,null))[_0x6db8('0x4f')](handleError(_0x384748,null));};exports[_0x6db8('0x98')]=function(_0x25ad6f,_0x1c25a4,_0x8a49c0){return db[_0x6db8('0x34')][_0x6db8('0x52')]({'where':{'id':_0x25ad6f[_0x6db8('0x51')]['id']}})[_0x6db8('0x2b')](function(_0x503581){if(_0x503581){return _0x503581[_0x6db8('0x2a')]();}})[_0x6db8('0x2b')](function(_0x1abfe4){rimraf(path[_0x6db8('0x54')](config[_0x6db8('0x55')],_0x6db8('0x56'),path[_0x6db8('0x61')](_0x1abfe4[_0x6db8('0x5')])),function(){});return _0x1abfe4;})[_0x6db8('0x2b')](handleEntityNotFound(_0x1c25a4,null))[_0x6db8('0x2b')](respondWithStatusCode(_0x1c25a4,null))[_0x6db8('0x4f')](handleError(_0x1c25a4,null));};exports['webhookGet']=function(_0x509fbe,_0x5234b6,_0x71e168){return BPromise['resolve']()[_0x6db8('0x2b')](function(){if(!_0x509fbe[_0x6db8('0x39')][_0x6db8('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x509fbe[_0x6db8('0x39')]['port']){throw new Error(_0x6db8('0x99'));}var _0x721581=_0x509fbe['query'][_0x6db8('0x9a')]?_0x509fbe[_0x6db8('0x39')][_0x6db8('0x9a')]+':'+_0x509fbe['query'][_0x6db8('0x9b')]:'http://localhost:'+_0x509fbe[_0x6db8('0x39')][_0x6db8('0x9b')];var _0x360ae7=_0x509fbe[_0x6db8('0x39')][_0x6db8('0x20')]?_0x509fbe[_0x6db8('0x39')][_0x6db8('0x20')]:!![];var _0x59354d=_0x509fbe[_0x6db8('0x39')][_0x6db8('0x9c')]?_0x509fbe[_0x6db8('0x39')][_0x6db8('0x9c')]:null;var _0x495b49={'method':_0x509fbe[_0x6db8('0x9d')],'uri':util[_0x6db8('0x57')](_0x6db8('0x9e'),_0x721581,_0x509fbe[_0x6db8('0x39')][_0x6db8('0x5')]),'json':_0x360ae7,'resolveWithFullResponse':!![],'encoding':_0x59354d,'qs':_0x509fbe[_0x6db8('0x39')]};if(_0x509fbe['headers']){_0x495b49['headers']=_0x509fbe[_0x6db8('0x9f')];if(_0x495b49[_0x6db8('0x9f')]['content-length']){delete _0x495b49['headers'][_0x6db8('0xa0')];}}if(_0x495b49[_0x6db8('0x9f')][_0x6db8('0xa1')]){delete _0x495b49[_0x6db8('0x9f')]['content-type'];}return rp(_0x495b49);})['then'](function(_0x414fca){if(_0x414fca){_0x5234b6[_0x6db8('0x25')](_0x414fca[_0x6db8('0x9f')]);logger['info'](_0x414fca['body']);if(_[_0x6db8('0xa2')](_0x509fbe[_0x6db8('0x39')][_0x6db8('0x5')],_0x6db8('0x53'))&&_0x414fca['statusCode']==0x1f4){return _0x5234b6[_0x6db8('0x1d')](_0x414fca[_0x6db8('0xa3')]);}else{return _0x5234b6[_0x6db8('0x1e')](_0x414fca[_0x6db8('0xa3')])[_0x6db8('0x31')](_0x414fca[_0x6db8('0x90')]);}}else{return _0x5234b6[_0x6db8('0x1d')](0xc8);}})['catch'](handleError(_0x5234b6,null));};exports[_0x6db8('0xa4')]=function(_0x224397,_0x464a6b,_0x42214e){return BPromise[_0x6db8('0xa5')]()[_0x6db8('0x2b')](function(){if(!_0x224397[_0x6db8('0x39')][_0x6db8('0x5')]){throw new Error(_0x6db8('0xa6'));}if(!_0x224397[_0x6db8('0x39')][_0x6db8('0x9b')]){throw new Error(_0x6db8('0x99'));}var _0x149f8f=_0x224397[_0x6db8('0x39')][_0x6db8('0x9a')]?_0x224397[_0x6db8('0x39')][_0x6db8('0x9a')]+':'+_0x224397['query'][_0x6db8('0x9b')]:_0x6db8('0xa7')+_0x224397['query'][_0x6db8('0x9b')];var _0x5865a6=_0x224397[_0x6db8('0x39')][_0x6db8('0x20')]?_0x224397[_0x6db8('0x39')][_0x6db8('0x20')]:!![];var _0x1ef570=_0x224397['query'][_0x6db8('0x9c')]?_0x224397[_0x6db8('0x39')][_0x6db8('0x9c')]:null;var _0xce8048={'method':_0x224397[_0x6db8('0x9d')],'uri':util[_0x6db8('0x57')](_0x6db8('0x9e'),_0x149f8f,_0x224397[_0x6db8('0x39')]['path']),'json':_0x5865a6,'resolveWithFullResponse':!![],'encoding':_0x1ef570,'body':_0x224397[_0x6db8('0x90')]};if(_0x224397[_0x6db8('0x9f')]){_0xce8048[_0x6db8('0x9f')]=_0x224397['headers'];if(_0xce8048[_0x6db8('0x9f')]['content-length']){delete _0xce8048[_0x6db8('0x9f')]['content-length'];}}if(_0xce8048[_0x6db8('0x9f')][_0x6db8('0xa1')]){delete _0xce8048[_0x6db8('0x9f')][_0x6db8('0xa1')];}return rp(_0xce8048);})[_0x6db8('0x2b')](function(_0x2a4e44){if(_0x2a4e44){_0x464a6b[_0x6db8('0x25')](_0x2a4e44['headers']);logger[_0x6db8('0x69')](_0x2a4e44[_0x6db8('0x90')]);return _0x464a6b[_0x6db8('0x1e')](_0x2a4e44['statusCode'])[_0x6db8('0x31')](_0x2a4e44[_0x6db8('0x90')]);}else{return _0x464a6b['sendStatus'](0xc8);}})[_0x6db8('0x4f')](handleError(_0x464a6b,null));}; \ No newline at end of file +var _0xb828=['Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readFileSync','manifest.json','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','end','name','send','map','Plugin','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','error','**/*','dirname','node_modules/**/*','attachments/**/*','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync'];(function(_0x33b770,_0x113bf3){var _0x5083e8=function(_0x2fbf32){while(--_0x2fbf32){_0x33b770['push'](_0x33b770['shift']());}};_0x5083e8(++_0x113bf3);}(_0xb828,0xd9));var _0x8b82=function(_0x406ae7,_0x12181b){_0x406ae7=_0x406ae7-0x0;var _0x5a5b9d=_0xb828[_0x406ae7];return _0x5a5b9d;};'use strict';var emlformat=require(_0x8b82('0x0'));var rimraf=require(_0x8b82('0x1'));var zipdir=require(_0x8b82('0x2'));var jsonpatch=require(_0x8b82('0x3'));var rp=require(_0x8b82('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8b82('0x5'));var path=require(_0x8b82('0x6'));var sox=require(_0x8b82('0x7'));var csv=require(_0x8b82('0x8'));var ejs=require(_0x8b82('0x9'));var fs=require('fs');var fs_extra=require(_0x8b82('0xa'));var _=require(_0x8b82('0xb'));var squel=require(_0x8b82('0xc'));var crypto=require(_0x8b82('0xd'));var jsforce=require(_0x8b82('0xe'));var deskjs=require(_0x8b82('0xf'));var toCsv=require(_0x8b82('0x8'));var querystring=require(_0x8b82('0x10'));var Papa=require(_0x8b82('0x11'));var extract=require(_0x8b82('0x12'));var rimraf=require(_0x8b82('0x1'));var archiver=require(_0x8b82('0x13'));var Redis=require(_0x8b82('0x14'));var authService=require(_0x8b82('0x15'));var qs=require(_0x8b82('0x16'));var as=require(_0x8b82('0x17'));var hardwareService=require(_0x8b82('0x18'));var logger=require(_0x8b82('0x19'))(_0x8b82('0x1a'));var utils=require(_0x8b82('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x8b82('0x1c'));var db=require('../../mysqldb')['db'];config[_0x8b82('0x1d')]=_[_0x8b82('0x1e')](config[_0x8b82('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b82('0x1f'))(new Redis(config['redis']));require(_0x8b82('0x20'))['register'](socket);function respondWithStatusCode(_0xc9e26a,_0x5c887e){_0x5c887e=_0x5c887e||0xcc;return function(_0x11edca){if(_0x11edca){return _0xc9e26a[_0x8b82('0x21')](_0x5c887e);}return _0xc9e26a['status'](_0x5c887e)['end']();};}function respondWithResult(_0x20864d,_0x4af11d){_0x4af11d=_0x4af11d||0xc8;return function(_0x3ba709){if(_0x3ba709){return _0x20864d[_0x8b82('0x22')](_0x4af11d)[_0x8b82('0x23')](_0x3ba709);}};}function respondWithFilteredResult(_0x50e5b2,_0x4d8e1c){return function(_0x3f7073){if(_0x3f7073){var _0x28402f=typeof _0x4d8e1c[_0x8b82('0x24')]===_0x8b82('0x25')&&typeof _0x4d8e1c[_0x8b82('0x26')]===_0x8b82('0x25');var _0x29f995=_0x3f7073[_0x8b82('0x27')];var _0x3f5811=_0x28402f?0x0:_0x4d8e1c[_0x8b82('0x24')];var _0x2cc6e5=_0x28402f?_0x3f7073['count']:_0x4d8e1c[_0x8b82('0x24')]+_0x4d8e1c[_0x8b82('0x26')];var _0x24aeef;if(_0x2cc6e5>=_0x29f995){_0x2cc6e5=_0x29f995;_0x24aeef=0xc8;}else{_0x24aeef=0xce;}_0x50e5b2[_0x8b82('0x22')](_0x24aeef);return _0x50e5b2[_0x8b82('0x28')](_0x8b82('0x29'),_0x3f5811+'-'+_0x2cc6e5+'/'+_0x29f995)['json'](_0x3f7073);}return null;};}function patchUpdates(_0xb3d200){return function(_0x4af388){try{jsonpatch[_0x8b82('0x2a')](_0x4af388,_0xb3d200,!![]);}catch(_0x1b4839){return BPromise[_0x8b82('0x2b')](_0x1b4839);}return _0x4af388[_0x8b82('0x2c')]();};}function saveUpdates(_0x480946,_0x32e534){return function(_0x37c199){if(_0x37c199){return _0x37c199[_0x8b82('0x2d')](_0x480946)['then'](function(_0x2428ca){return _0x2428ca;});}return null;};}function removeEntity(_0x1668cf,_0x3e9e08){return function(_0x408ef5){if(_0x408ef5){return _0x408ef5[_0x8b82('0x2e')]()[_0x8b82('0x2f')](function(){var _0x518992=_0x408ef5[_0x8b82('0x30')]({'plain':!![]});var _0x56a267=_0x8b82('0x31');return db['UserProfileResource'][_0x8b82('0x2e')]({'where':{'type':_0x56a267,'resourceId':_0x518992['id']}})[_0x8b82('0x2f')](function(){return _0x408ef5;});})[_0x8b82('0x2f')](function(){_0x1668cf[_0x8b82('0x22')](0xcc)[_0x8b82('0x32')]();});}};}function handleEntityNotFound(_0x503954,_0x49c855){return function(_0x14f7c8){if(!_0x14f7c8){_0x503954[_0x8b82('0x21')](0x194);}return _0x14f7c8;};}function handleError(_0x2a36b2,_0x1a6362){_0x1a6362=_0x1a6362||0x1f4;return function(_0xa97dc6){logger['error'](_0xa97dc6['stack']);if(_0xa97dc6['name']){delete _0xa97dc6[_0x8b82('0x33')];}_0x2a36b2['status'](_0x1a6362)[_0x8b82('0x34')](_0xa97dc6);};}exports['index']=function(_0x527e45,_0x23fe57){var _0x1659e8={},_0x2429d5={},_0x80a1f={'count':0x0,'rows':[]};var _0x1ca94b=_[_0x8b82('0x35')](db[_0x8b82('0x36')][_0x8b82('0x37')],function(_0x2daf88){return{'name':_0x2daf88[_0x8b82('0x38')],'type':_0x2daf88['type'][_0x8b82('0x39')]};});_0x2429d5[_0x8b82('0x3a')]=_[_0x8b82('0x35')](_0x1ca94b,_0x8b82('0x33'));_0x2429d5[_0x8b82('0x3b')]=_[_0x8b82('0x3c')](_0x527e45[_0x8b82('0x3b')]);_0x2429d5['filters']=_[_0x8b82('0x3d')](_0x2429d5[_0x8b82('0x3a')],_0x2429d5[_0x8b82('0x3b')]);_0x1659e8[_0x8b82('0x3e')]=_['intersection'](_0x2429d5[_0x8b82('0x3a')],qs[_0x8b82('0x3f')](_0x527e45['query']['fields']));_0x1659e8['attributes']=_0x1659e8[_0x8b82('0x3e')]['length']?_0x1659e8[_0x8b82('0x3e')]:_0x2429d5[_0x8b82('0x3a')];if(!_0x527e45[_0x8b82('0x3b')]['hasOwnProperty'](_0x8b82('0x40'))){_0x1659e8[_0x8b82('0x26')]=qs[_0x8b82('0x26')](_0x527e45['query'][_0x8b82('0x26')]);_0x1659e8[_0x8b82('0x24')]=qs['offset'](_0x527e45[_0x8b82('0x3b')][_0x8b82('0x24')]);}_0x1659e8[_0x8b82('0x41')]=qs[_0x8b82('0x42')](_0x527e45[_0x8b82('0x3b')]['sort']);_0x1659e8[_0x8b82('0x43')]=qs[_0x8b82('0x44')](_['pick'](_0x527e45[_0x8b82('0x3b')],_0x2429d5['filters']),_0x1ca94b);if(_0x527e45[_0x8b82('0x3b')][_0x8b82('0x45')]){_0x1659e8[_0x8b82('0x43')]=_[_0x8b82('0x46')](_0x1659e8[_0x8b82('0x43')],{'$or':_[_0x8b82('0x35')](_0x1ca94b,function(_0x1af895){if(_0x1af895[_0x8b82('0x47')]!==_0x8b82('0x48')){var _0x159dc8={};_0x159dc8[_0x1af895[_0x8b82('0x33')]]={'$like':'%'+_0x527e45[_0x8b82('0x3b')][_0x8b82('0x45')]+'%'};return _0x159dc8;}})});}_0x1659e8=_['merge']({},_0x1659e8,_0x527e45['options']);var _0x5f062f={'where':_0x1659e8[_0x8b82('0x43')]};return db[_0x8b82('0x36')][_0x8b82('0x27')](_0x5f062f)[_0x8b82('0x2f')](function(_0x481e0c){_0x80a1f[_0x8b82('0x27')]=_0x481e0c;if(_0x527e45[_0x8b82('0x3b')][_0x8b82('0x49')]){_0x1659e8[_0x8b82('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0x8b82('0x4b')](_0x1659e8);})[_0x8b82('0x2f')](function(_0x4afde6){_0x80a1f[_0x8b82('0x4c')]=_0x4afde6;return _0x80a1f;})[_0x8b82('0x2f')](respondWithFilteredResult(_0x23fe57,_0x1659e8))[_0x8b82('0x4d')](handleError(_0x23fe57,null));};exports[_0x8b82('0x4e')]=function(_0x3fd62f,_0xa46af){var _0x51a457={'raw':!![],'where':{'id':_0x3fd62f[_0x8b82('0x4f')]['id']}},_0xbb58f7={};_0xbb58f7[_0x8b82('0x3a')]=_[_0x8b82('0x3c')](db[_0x8b82('0x36')][_0x8b82('0x37')]);_0xbb58f7[_0x8b82('0x3b')]=_[_0x8b82('0x3c')](_0x3fd62f[_0x8b82('0x3b')]);_0xbb58f7[_0x8b82('0x44')]=_[_0x8b82('0x3d')](_0xbb58f7[_0x8b82('0x3a')],_0xbb58f7[_0x8b82('0x3b')]);_0x51a457[_0x8b82('0x3e')]=_['intersection'](_0xbb58f7[_0x8b82('0x3a')],qs[_0x8b82('0x3f')](_0x3fd62f['query'][_0x8b82('0x3f')]));_0x51a457['attributes']=_0x51a457['attributes'][_0x8b82('0x50')]?_0x51a457[_0x8b82('0x3e')]:_0xbb58f7['model'];if(_0x3fd62f['query'][_0x8b82('0x49')]){_0x51a457[_0x8b82('0x4a')]=[{'all':!![]}];}_0x51a457=_['merge']({},_0x51a457,_0x3fd62f[_0x8b82('0x51')]);return db['Plugin'][_0x8b82('0x52')](_0x51a457)[_0x8b82('0x2f')](handleEntityNotFound(_0xa46af,null))[_0x8b82('0x2f')](respondWithResult(_0xa46af,null))['catch'](handleError(_0xa46af,null));};exports['download']=function(_0x2ac838,_0x2d7009,_0x29fae7){return db[_0x8b82('0x36')][_0x8b82('0x52')]({'where':{'id':_0x2ac838[_0x8b82('0x4f')]['id']},'attributes':['name',_0x8b82('0x6')],'raw':!![]})[_0x8b82('0x2f')](handleEntityNotFound(_0x2d7009,null))[_0x8b82('0x2f')](function(_0x52dcff){if(_0x52dcff){var _0x349037=path[_0x8b82('0x53')](config[_0x8b82('0x54')],_0x8b82('0x55'),util[_0x8b82('0x56')](_0x8b82('0x57'),path[_0x8b82('0x58')](_0x52dcff[_0x8b82('0x6')])));var _0x494041=fs[_0x8b82('0x59')](_0x349037);var _0x3e44de=archiver(_0x8b82('0x5a'),{'zlib':{'level':0x9}});_0x3e44de['on'](_0x8b82('0x5b'),function(_0x240d06){if(_0x240d06[_0x8b82('0x5c')]==='ENOENT'){logger['error'](_0x240d06);}else{throw new db[(_0x8b82('0x5d'))][(_0x8b82('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3e44de['on'](_0x8b82('0x5f'),function(_0x105f66){throw new db[(_0x8b82('0x5d'))][(_0x8b82('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3e44de['pipe'](_0x494041);_0x3e44de['glob'](_0x8b82('0x60'),{'cwd':path[_0x8b82('0x53')](config['root'],_0x8b82('0x55'),path[_0x8b82('0x61')](_0x52dcff[_0x8b82('0x6')])),'ignore':[path[_0x8b82('0x53')](path[_0x8b82('0x58')](_0x52dcff[_0x8b82('0x6')]),_0x8b82('0x62')),path[_0x8b82('0x53')](path[_0x8b82('0x58')](_0x52dcff[_0x8b82('0x6')]),_0x8b82('0x63'))],'nodir':!![]})['finalize']();_0x494041['on']('close',function(){if(!fs['existsSync'](_0x349037)){throw new db[(_0x8b82('0x5d'))][(_0x8b82('0x5e'))]('Plugin\x20not\x20found');}return _0x2d7009[_0x8b82('0x64')](_0x349037,util[_0x8b82('0x56')]('%s.zip',path[_0x8b82('0x58')](_0x52dcff[_0x8b82('0x6')])),function(_0xa44c97){if(_0xa44c97){throw new db[(_0x8b82('0x5d'))][(_0x8b82('0x5e'))](_0x8b82('0x65'));}fs[_0x8b82('0x66')](_0x349037);logger[_0x8b82('0x67')](_0x8b82('0x68'));logger[_0x8b82('0x67')](_0x8b82('0x69'));});});}return null;})[_0x8b82('0x4d')](handleError(_0x2d7009,null));};exports['upload']=function(_0x2b00e1,_0x58ce56,_0x2aac66){var _0x144697=path[_0x8b82('0x58')](_0x2b00e1[_0x8b82('0x6a')][_0x8b82('0x6b')],path[_0x8b82('0x6c')](_0x2b00e1[_0x8b82('0x6a')][_0x8b82('0x6b')]));var _0x558ed9=path[_0x8b82('0x53')](config[_0x8b82('0x54')],'server/files/plugins',_0x2b00e1[_0x8b82('0x6a')][_0x8b82('0x6b')]);var _0x55cd4c=path[_0x8b82('0x53')](config['root'],_0x8b82('0x55'),_0x144697);logger[_0x8b82('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x558ed9);logger[_0x8b82('0x67')](_0x8b82('0x6d'),_0x55cd4c);try{fs[_0x8b82('0x6e')](_0x558ed9,parseInt(_0x8b82('0x6f'),0x8));extract(_0x558ed9,{'dir':_0x55cd4c},function(_0x3ed85b){if(_0x3ed85b){logger[_0x8b82('0x5f')](_0x3ed85b);handleError(_0x3ed85b,!![]);};var _0x2234fe=fs[_0x8b82('0x70')](_0x55cd4c);if(_0x2234fe['length']>0x1){removeReferences(_0x558ed9,_0x55cd4c);logger['error'](_0x8b82('0x71'));return _0x2aac66(new Error(_0x8b82('0x71')));}var _0x4ba418=fs[_0x8b82('0x72')](path['join'](_0x55cd4c,_0x2234fe[0x0]));if(_0x4ba418[_0x8b82('0x73')]()){removeReferences(_0x558ed9,_0x55cd4c);logger['error'](_0x8b82('0x71'));return _0x2aac66(new Error(_0x8b82('0x71')));}if(_0x4ba418[_0x8b82('0x74')]()){var _0x3d155f=fs[_0x8b82('0x70')](path[_0x8b82('0x53')](_0x55cd4c,_0x2234fe[0x0]));if(_0x3d155f[_0x8b82('0x50')]===0x0){removeReferences(_0x558ed9,_0x55cd4c);logger[_0x8b82('0x5f')](_0x8b82('0x71'));return _0x2aac66(new Error('Invalid\x20plugin\x20structure'));}var _0x250000=_0x3d155f['some'](function(_0x2be166){return _0x2be166==='manifest.json';});if(!_0x250000){return _0x2aac66(new Error('Plugin\x20manifest\x20missing'));}var _0xa5cac9=fs[_0x8b82('0x75')](path[_0x8b82('0x53')](_0x55cd4c,_0x2234fe[0x0],_0x8b82('0x76')));var _0x4b8ea3=JSON['parse'](_0xa5cac9);if('undefined'==typeof _0x4b8ea3[_0x8b82('0x33')]){return _0x2aac66(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x47')]){return _0x2aac66(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x77')]){return _0x2aac66(new Error(_0x8b82('0x78')));}if('undefined'==typeof _0x4b8ea3[_0x8b82('0x79')]){return _0x2aac66(new Error(_0x8b82('0x7a')));}if(_0x4b8ea3[_0x8b82('0x47')]===_0x8b82('0x7b')){if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')]){return _0x2aac66(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x79')]['views']['admin']&&_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x79')]['views']['agent']){return _0x2aac66(new Error(_0x8b82('0x7d')));}}else if(_0x4b8ea3[_0x8b82('0x47')]===_0x8b82('0x7e')){if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x79')]['scriptName']){return _0x2aac66(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x8b82('0x25')==typeof _0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7f')]){return _0x2aac66(new Error(_0x8b82('0x80')));}}else{return _0x2aac66(new Error(_0x8b82('0x81')));}var _0x2a5f0c=_0x4b8ea3[_0x8b82('0x33')];var _0x1c1be9=_0x4b8ea3[_0x8b82('0x82')];var _0x45ee45=_0x4b8ea3['type'];var _0x279283=_0x4b8ea3[_0x8b82('0x83')]?_0x4b8ea3['sidebar']:'always';var _0x5ef85f=_0x4b8ea3[_0x8b82('0x84')]?_0x4b8ea3[_0x8b82('0x84')]:_0x8b82('0x85');var _0x268b0a='';var _0x5d0d10='';var _0x2b4312='';var _0x2f4761='';var _0x4f16bd=_0x4b8ea3[_0x8b82('0x77')];if(_0x45ee45===_0x8b82('0x7b')){if('undefined'!=typeof _0x4b8ea3['parameters'][_0x8b82('0x7c')]['admin']){var _0x17d65f=_0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')][_0x8b82('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x8b82('0x87')](_0x17d65f)){_0x268b0a=path[_0x8b82('0x53')](_0x8b82('0x88'),_0x144697,_0x2234fe[0x0],_0x17d65f);}else{_0x268b0a=_0x17d65f;}}else{logger['info'](_0x8b82('0x89'));}if('undefined'!=typeof _0x4b8ea3['parameters'][_0x8b82('0x7c')][_0x8b82('0x8a')]){var _0x31de13=_0x4b8ea3['parameters']['views'][_0x8b82('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x8b82('0x87')](_0x31de13)){_0x5d0d10=path[_0x8b82('0x53')](_0x8b82('0x88'),_0x144697,_0x2234fe[0x0],_0x31de13);}else{_0x5d0d10=_0x31de13;}}else{logger[_0x8b82('0x67')](_0x8b82('0x8b'));}}else if(_0x45ee45===_0x8b82('0x7e')){_0x2b4312=_0x4b8ea3['parameters'][_0x8b82('0x8c')];_0x2f4761=_0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7f')];if(_0x8b82('0x25')!=typeof _0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')]){if(_0x8b82('0x25')!=typeof _0x4b8ea3['parameters']['views'][_0x8b82('0x86')]){var _0x17d65f=_0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')][_0x8b82('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x8b82('0x87')](_0x17d65f)){_0x268b0a=path[_0x8b82('0x53')](_0x8b82('0x88'),_0x144697,_0x2234fe[0x0],_0x17d65f);}else{_0x268b0a=_0x17d65f;}}if(_0x8b82('0x25')!=typeof _0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')][_0x8b82('0x8a')]){var _0x31de13=_0x4b8ea3[_0x8b82('0x79')][_0x8b82('0x7c')][_0x8b82('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x8b82('0x87')](_0x31de13)){_0x5d0d10=path[_0x8b82('0x53')](_0x8b82('0x88'),_0x144697,_0x2234fe[0x0],_0x31de13);}else{_0x5d0d10=_0x31de13;}}}}var _0x327b28={'name':_0x2a5f0c,'description':_0x1c1be9,'path':path['join'](_0x144697,_0x2234fe[0x0]),'type':_0x45ee45,'sidebar':_0x279283,'icon':_0x5ef85f,'adminUrl':_0x268b0a,'agentUrl':_0x5d0d10,'scriptName':_0x2b4312,'scriptPath':_0x2f4761,'version':_0x4f16bd};removeReferences(_0x558ed9,null);return db['Plugin']['create'](_0x327b28)['then'](function(_0x23ed8c){var _0x417fb2={'role':_0x2b00e1['body'][_0x8b82('0x8d')],'userProfileId':_0x2b00e1[_0x8b82('0x8e')][_0x8b82('0x8f')]};if(!_0x417fb2)throw new Error(_0x8b82('0x90'));if(_0x417fb2['role']===_0x8b82('0x91')){var _0x37675d=_0x23ed8c['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x8b82('0x31'),'userProfileId':_0x417fb2[_0x8b82('0x8f')]},'raw':!![]})['then'](function(_0x2b6d05){if(_0x2b6d05&&_0x2b6d05[_0x8b82('0x92')]===0x0){return db[_0x8b82('0x93')]['create']({'name':_0x37675d[_0x8b82('0x33')],'resourceId':_0x37675d['id'],'type':_0x2b6d05[_0x8b82('0x33')],'sectionId':_0x2b6d05['id']},{})[_0x8b82('0x2f')](function(){return _0x23ed8c;});}else{return _0x23ed8c;}})['catch'](function(_0x35f286){logger[_0x8b82('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35f286);throw _0x35f286;});}return _0x23ed8c;})[_0x8b82('0x2f')](respondWithResult(_0x58ce56,null))[_0x8b82('0x4d')](handleError(_0x58ce56,null));}});}catch(_0x16361e){_0x58ce56['status'](0x1f4)[_0x8b82('0x34')](_0x16361e);}};function removeReferences(_0x5bac0e,_0xa01f1c){try{if(_0x5bac0e){fs[_0x8b82('0x66')](_0x5bac0e);logger['info'](_0x8b82('0x94'));}if(_0xa01f1c){rimraf(_0xa01f1c,function(){});logger[_0x8b82('0x67')](_0x8b82('0x95'));}}catch(_0xd7c490){logger[_0x8b82('0x5f')](_0xd7c490);}}exports['update']=function(_0xe52d63,_0x2ae3fe,_0xfbbaf2){return db[_0x8b82('0x36')][_0x8b82('0x52')]({'where':{'id':_0xe52d63[_0x8b82('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2ae3fe,null))[_0x8b82('0x2f')](saveUpdates(_0xe52d63[_0x8b82('0x8e')],null))['then'](respondWithResult(_0x2ae3fe,null))[_0x8b82('0x4d')](handleError(_0x2ae3fe,null));};exports[_0x8b82('0x96')]=function(_0x227e55,_0x4aee2a,_0x220415){return db[_0x8b82('0x36')][_0x8b82('0x52')]({'where':{'id':_0x227e55[_0x8b82('0x4f')]['id']}})['then'](function(_0x2569ee){if(_0x2569ee){return _0x2569ee[_0x8b82('0x2e')]();}})[_0x8b82('0x2f')](function(_0xc717f9){rimraf(path[_0x8b82('0x53')](config[_0x8b82('0x54')],'server/files/plugins',path[_0x8b82('0x61')](_0xc717f9['path'])),function(){});return _0xc717f9;})[_0x8b82('0x2f')](handleEntityNotFound(_0x4aee2a,null))[_0x8b82('0x2f')](respondWithStatusCode(_0x4aee2a,null))['catch'](handleError(_0x4aee2a,null));};exports[_0x8b82('0x97')]=function(_0x977d5,_0x134439,_0x264b08){return BPromise[_0x8b82('0x98')]()['then'](function(){if(!_0x977d5[_0x8b82('0x3b')][_0x8b82('0x6')]){throw new Error(_0x8b82('0x99'));}if(!_0x977d5['query'][_0x8b82('0x9a')]){throw new Error(_0x8b82('0x9b'));}var _0x334b86=_0x977d5['query'][_0x8b82('0x9c')]?_0x977d5[_0x8b82('0x3b')][_0x8b82('0x9c')]+':'+_0x977d5[_0x8b82('0x3b')]['port']:_0x8b82('0x9d')+_0x977d5[_0x8b82('0x3b')][_0x8b82('0x9a')];var _0x316ffa=_0x977d5[_0x8b82('0x3b')]['json']?_0x977d5[_0x8b82('0x3b')][_0x8b82('0x23')]:!![];var _0x2447f4=_0x977d5[_0x8b82('0x3b')][_0x8b82('0x9e')]?_0x977d5[_0x8b82('0x3b')][_0x8b82('0x9e')]:null;var _0x5b2a8e={'method':_0x977d5[_0x8b82('0x9f')],'uri':util[_0x8b82('0x56')](_0x8b82('0xa0'),_0x334b86,_0x977d5['query'][_0x8b82('0x6')]),'json':_0x316ffa,'resolveWithFullResponse':!![],'encoding':_0x2447f4,'qs':_0x977d5['query']};if(_0x977d5['headers']){_0x5b2a8e[_0x8b82('0xa1')]=_0x977d5[_0x8b82('0xa1')];if(_0x5b2a8e[_0x8b82('0xa1')][_0x8b82('0xa2')]){delete _0x5b2a8e[_0x8b82('0xa1')][_0x8b82('0xa2')];}}if(_0x5b2a8e['headers'][_0x8b82('0xa3')]){delete _0x5b2a8e['headers'][_0x8b82('0xa3')];}return rp(_0x5b2a8e);})[_0x8b82('0x2f')](function(_0x154c33){if(_0x154c33){_0x134439['set'](_0x154c33['headers']);logger[_0x8b82('0x67')](_0x154c33['body']);if(_['endsWith'](_0x977d5[_0x8b82('0x3b')]['path'],_0x8b82('0x64'))&&_0x154c33['statusCode']==0x1f4){return _0x134439[_0x8b82('0x21')](_0x154c33['statusCode']);}else{return _0x134439[_0x8b82('0x22')](_0x154c33[_0x8b82('0xa4')])['send'](_0x154c33[_0x8b82('0x8e')]);}}else{return _0x134439[_0x8b82('0x21')](0xc8);}})[_0x8b82('0x4d')](handleError(_0x134439,null));};exports['webhookPost']=function(_0x2fde30,_0x4cee5d,_0x10fad5){return BPromise['resolve']()[_0x8b82('0x2f')](function(){if(!_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x6')]){throw new Error(_0x8b82('0x99'));}if(!_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x9a')]){throw new Error(_0x8b82('0x9b'));}var _0x2843a5=_0x2fde30['query'][_0x8b82('0x9c')]?_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x9c')]+':'+_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x9a')]:_0x8b82('0x9d')+_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x9a')];var _0x5612ce=_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x23')]?_0x2fde30['query'][_0x8b82('0x23')]:!![];var _0x351c34=_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x9e')]?_0x2fde30['query'][_0x8b82('0x9e')]:null;var _0xd596b2={'method':_0x2fde30['method'],'uri':util['format'](_0x8b82('0xa0'),_0x2843a5,_0x2fde30[_0x8b82('0x3b')][_0x8b82('0x6')]),'json':_0x5612ce,'resolveWithFullResponse':!![],'encoding':_0x351c34,'body':_0x2fde30[_0x8b82('0x8e')]};if(_0x2fde30[_0x8b82('0xa1')]){_0xd596b2[_0x8b82('0xa1')]=_0x2fde30[_0x8b82('0xa1')];if(_0xd596b2[_0x8b82('0xa1')][_0x8b82('0xa2')]){delete _0xd596b2[_0x8b82('0xa1')][_0x8b82('0xa2')];}}if(_0xd596b2[_0x8b82('0xa1')][_0x8b82('0xa3')]){delete _0xd596b2['headers'][_0x8b82('0xa3')];}return rp(_0xd596b2);})['then'](function(_0x585310){if(_0x585310){_0x4cee5d[_0x8b82('0x28')](_0x585310[_0x8b82('0xa1')]);logger[_0x8b82('0x67')](_0x585310[_0x8b82('0x8e')]);return _0x4cee5d[_0x8b82('0x22')](_0x585310[_0x8b82('0xa4')])['send'](_0x585310[_0x8b82('0x8e')]);}else{return _0x4cee5d[_0x8b82('0x21')](0xc8);}})[_0x8b82('0x4d')](handleError(_0x4cee5d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 97b736b..8d7f359 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 _0x1b9b=['exports','events','Plugin','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4a61eb,_0x4d801a){var _0x3e5a88=function(_0x31ae13){while(--_0x31ae13){_0x4a61eb['push'](_0x4a61eb['shift']());}};_0x3e5a88(++_0x4d801a);}(_0x1b9b,0x89));var _0xb1b9=function(_0x1f0e39,_0x3de25f){_0x1f0e39=_0x1f0e39-0x0;var _0x148330=_0x1b9b[_0x1f0e39];return _0x148330;};'use strict';var EventEmitter=require(_0xb1b9('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb1b9('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb1b9('0x2')](0x0);var events={'afterCreate':_0xb1b9('0x3'),'afterUpdate':_0xb1b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x38f77a){return function(_0x411464,_0x597f8f,_0x5c24be){PluginEvents['emit'](_0x38f77a+':'+_0x411464['id'],_0x411464);PluginEvents[_0xb1b9('0x5')](_0x38f77a,_0x411464);_0x5c24be(null);};}for(var e in events){if(events[_0xb1b9('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xb1b9('0x7')]=PluginEvents; \ No newline at end of file +var _0x6003=['../../mysqldb','Plugin','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x59d7c2,_0x242650){var _0x27d520=function(_0x3a95e6){while(--_0x3a95e6){_0x59d7c2['push'](_0x59d7c2['shift']());}};_0x27d520(++_0x242650);}(_0x6003,0xae));var _0x3600=function(_0x322395,_0x100791){_0x322395=_0x322395-0x0;var _0x18b22c=_0x6003[_0x322395];return _0x18b22c;};'use strict';var EventEmitter=require(_0x3600('0x0'));var Plugin=require(_0x3600('0x1'))['db'][_0x3600('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3600('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3600('0x4')};function emitEvent(_0x3fb36b){return function(_0x29c0fd,_0x47b8b3,_0x29fadd){PluginEvents[_0x3600('0x5')](_0x3fb36b+':'+_0x29c0fd['id'],_0x29c0fd);PluginEvents['emit'](_0x3fb36b,_0x29c0fd);_0x29fadd(null);};}for(var e in events){if(events[_0x3600('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 095717b..e318809 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 _0x0d17=['./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0d17,0x1a5));var _0x70d1=function(_0x16d6ae,_0x22e2f6){_0x16d6ae=_0x16d6ae-0x0;var _0x22377e=_0x0d17[_0x16d6ae];return _0x22377e;};'use strict';var _=require(_0x70d1('0x0'));var util=require('util');var logger=require(_0x70d1('0x1'))('api');var moment=require(_0x70d1('0x2'));var BPromise=require(_0x70d1('0x3'));var rp=require(_0x70d1('0x4'));var fs=require('fs');var path=require(_0x70d1('0x5'));var rimraf=require(_0x70d1('0x6'));var config=require(_0x70d1('0x7'));var attributes=require(_0x70d1('0x8'));module[_0x70d1('0x9')]=function(_0x4490d7,_0x29e08a){return _0x4490d7[_0x70d1('0xa')](_0x70d1('0xb'),attributes,{'tableName':_0x70d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6cb=['Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x43a65b,_0xf6f770){var _0x201e50=function(_0x8a9718){while(--_0x8a9718){_0x43a65b['push'](_0x43a65b['shift']());}};_0x201e50(++_0xf6f770);}(_0xb6cb,0x189));var _0xbb6c=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xb6cb[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0xbb6c('0x0'));var util=require(_0xbb6c('0x1'));var logger=require(_0xbb6c('0x2'))(_0xbb6c('0x3'));var moment=require(_0xbb6c('0x4'));var BPromise=require(_0xbb6c('0x5'));var rp=require(_0xbb6c('0x6'));var fs=require('fs');var path=require(_0xbb6c('0x7'));var rimraf=require(_0xbb6c('0x8'));var config=require(_0xbb6c('0x9'));var attributes=require(_0xbb6c('0xa'));module[_0xbb6c('0xb')]=function(_0x4a84b4,_0x5a87f8){return _0x4a84b4[_0xbb6c('0xc')](_0xbb6c('0xd'),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 d6f053b..b19b611 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 _0x8088=['CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','stringify','error','code','Plugin,\x20%s,\x20%s','message','info','result','catch','Plugin','create','body','options','raw'];(function(_0x2dc4c2,_0x358a9a){var _0xaeca85=function(_0x3c2865){while(--_0x3c2865){_0x2dc4c2['push'](_0x2dc4c2['shift']());}};_0xaeca85(++_0x358a9a);}(_0x8088,0x8d));var _0x8808=function(_0x5c2cdf,_0x3ab227){_0x5c2cdf=_0x5c2cdf-0x0;var _0x2f7bd6=_0x8088[_0x5c2cdf];return _0x2f7bd6;};'use strict';var _=require(_0x8808('0x0'));var util=require(_0x8808('0x1'));var moment=require(_0x8808('0x2'));var BPromise=require('bluebird');var rs=require(_0x8808('0x3'));var fs=require('fs');var Redis=require(_0x8808('0x4'));var db=require(_0x8808('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8808('0x6'));var config=require(_0x8808('0x7'));var jayson=require(_0x8808('0x8'));var client=jayson[_0x8808('0x9')][_0x8808('0xa')]({'port':0x232a});config[_0x8808('0xb')]=_[_0x8808('0xc')](config[_0x8808('0xb')],{'host':_0x8808('0xd'),'port':0x18eb});var socket=require(_0x8808('0xe'))(new Redis(config[_0x8808('0xb')]));require(_0x8808('0xf'))[_0x8808('0x10')](socket);function respondWithRpcPromise(_0x603c8e,_0xaf4488,_0x474869){return new BPromise(function(_0x8b841f,_0x5b42d3){return client[_0x8808('0x11')](_0x603c8e,_0x474869)[_0x8808('0x12')](function(_0x1f5129){logger['info']('Plugin,\x20%s,\x20%s',_0xaf4488,_0x8808('0x13'));logger[_0x8808('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0xaf4488,_0x8808('0x13'),JSON[_0x8808('0x15')](_0x1f5129));if(_0x1f5129[_0x8808('0x16')]){if(_0x1f5129[_0x8808('0x16')][_0x8808('0x17')]===0x1f4){logger[_0x8808('0x16')](_0x8808('0x18'),_0xaf4488,_0x1f5129[_0x8808('0x16')][_0x8808('0x19')]);return _0x5b42d3(_0x1f5129[_0x8808('0x16')][_0x8808('0x19')]);}logger[_0x8808('0x16')](_0x8808('0x18'),_0xaf4488,_0x1f5129[_0x8808('0x16')][_0x8808('0x19')]);return _0x8b841f(_0x1f5129[_0x8808('0x16')]['message']);}else{logger[_0x8808('0x1a')](_0x8808('0x18'),_0xaf4488,'request\x20sent');_0x8b841f(_0x1f5129[_0x8808('0x1b')]['message']);}})[_0x8808('0x1c')](function(_0x4a55b5){logger[_0x8808('0x16')](_0x8808('0x18'),_0xaf4488,_0x4a55b5);_0x5b42d3(_0x4a55b5);});});}exports['CreatePlugin']=function(_0x266a8e){var _0x3d2449=this;return new Promise(function(_0x3b9b7f,_0x17853d){return db[_0x8808('0x1d')][_0x8808('0x1e')](_0x266a8e[_0x8808('0x1f')],{'raw':_0x266a8e[_0x8808('0x20')]?_0x266a8e[_0x8808('0x20')][_0x8808('0x21')]===undefined?!![]:![]:!![]})[_0x8808('0x12')](function(_0x46c738){logger['info']('CreatePlugin',_0x266a8e);logger[_0x8808('0x14')](_0x8808('0x22'),_0x266a8e,JSON[_0x8808('0x15')](_0x46c738));_0x3b9b7f(_0x46c738);})[_0x8808('0x1c')](function(_0x40517a){logger['error'](_0x8808('0x22'),_0x40517a[_0x8808('0x19')],_0x266a8e);_0x17853d(_0x3d2449[_0x8808('0x16')](0x1f4,_0x40517a['message']));});});}; \ No newline at end of file +var _0xe6e5=['result','CreatePlugin','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','debug','stringify','error','message','info'];(function(_0x52d329,_0x2463d8){var _0x3b9680=function(_0xa5834b){while(--_0xa5834b){_0x52d329['push'](_0x52d329['shift']());}};_0x3b9680(++_0x2463d8);}(_0xe6e5,0x1e7));var _0x5e6e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe6e5[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x5e6e('0x0'));var util=require(_0x5e6e('0x1'));var moment=require(_0x5e6e('0x2'));var BPromise=require(_0x5e6e('0x3'));var rs=require(_0x5e6e('0x4'));var fs=require('fs');var Redis=require(_0x5e6e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e6e('0x6'));var logger=require(_0x5e6e('0x7'))(_0x5e6e('0x8'));var config=require(_0x5e6e('0x9'));var jayson=require(_0x5e6e('0xa'));var client=jayson['client'][_0x5e6e('0xb')]({'port':0x232a});config[_0x5e6e('0xc')]=_[_0x5e6e('0xd')](config[_0x5e6e('0xc')],{'host':_0x5e6e('0xe'),'port':0x18eb});var socket=require(_0x5e6e('0xf'))(new Redis(config[_0x5e6e('0xc')]));require('./plugin.socket')[_0x5e6e('0x10')](socket);function respondWithRpcPromise(_0x1e67bd,_0x26ea1b,_0x29f03c){return new BPromise(function(_0x5a843c,_0x6f7aac){return client[_0x5e6e('0x11')](_0x1e67bd,_0x29f03c)[_0x5e6e('0x12')](function(_0x4468f9){logger['info'](_0x5e6e('0x13'),_0x26ea1b,'request\x20sent');logger[_0x5e6e('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x26ea1b,'request\x20sent',JSON[_0x5e6e('0x15')](_0x4468f9));if(_0x4468f9[_0x5e6e('0x16')]){if(_0x4468f9[_0x5e6e('0x16')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x26ea1b,_0x4468f9['error'][_0x5e6e('0x17')]);return _0x6f7aac(_0x4468f9[_0x5e6e('0x16')][_0x5e6e('0x17')]);}logger[_0x5e6e('0x16')](_0x5e6e('0x13'),_0x26ea1b,_0x4468f9[_0x5e6e('0x16')]['message']);return _0x5a843c(_0x4468f9[_0x5e6e('0x16')][_0x5e6e('0x17')]);}else{logger[_0x5e6e('0x18')](_0x5e6e('0x13'),_0x26ea1b,'request\x20sent');_0x5a843c(_0x4468f9[_0x5e6e('0x19')][_0x5e6e('0x17')]);}})['catch'](function(_0x1a8972){logger[_0x5e6e('0x16')](_0x5e6e('0x13'),_0x26ea1b,_0x1a8972);_0x6f7aac(_0x1a8972);});});}exports[_0x5e6e('0x1a')]=function(_0x218b20){var _0x2ebda7=this;return new Promise(function(_0x42810c,_0x284ca0){return db['Plugin'][_0x5e6e('0x1b')](_0x218b20[_0x5e6e('0x1c')],{'raw':_0x218b20['options']?_0x218b20[_0x5e6e('0x1d')][_0x5e6e('0x1e')]===undefined?!![]:![]:!![]})[_0x5e6e('0x12')](function(_0x35bb90){logger[_0x5e6e('0x18')](_0x5e6e('0x1a'),_0x218b20);logger['debug'](_0x5e6e('0x1a'),_0x218b20,JSON[_0x5e6e('0x15')](_0x35bb90));_0x42810c(_0x35bb90);})[_0x5e6e('0x1f')](function(_0x2e0b66){logger[_0x5e6e('0x16')]('CreatePlugin',_0x2e0b66[_0x5e6e('0x17')],_0x218b20);_0x284ca0(_0x2ebda7[_0x5e6e('0x16')](0x1f4,_0x2e0b66[_0x5e6e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5bfbd21..d7fc973 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 _0xd023=['remove','update','emit','removeListener','register','plugin:','./plugin.events','save'];(function(_0x9b891d,_0x399394){var _0xfa74e3=function(_0x2a623b){while(--_0x2a623b){_0x9b891d['push'](_0x9b891d['shift']());}};_0xfa74e3(++_0x399394);}(_0xd023,0x1ce));var _0x3d02=function(_0x1e35bd,_0x40ee90){_0x1e35bd=_0x1e35bd-0x0;var _0x2c379d=_0xd023[_0x1e35bd];return _0x2c379d;};'use strict';var PluginEvents=require(_0x3d02('0x0'));var events=[_0x3d02('0x1'),_0x3d02('0x2'),_0x3d02('0x3')];function createListener(_0x51d190,_0x338904){return function(_0x957cf3){_0x338904[_0x3d02('0x4')](_0x51d190,_0x957cf3);};}function removeListener(_0x4e1b56,_0x237722){return function(){PluginEvents[_0x3d02('0x5')](_0x4e1b56,_0x237722);};}exports[_0x3d02('0x6')]=function(_0x513f37){for(var _0x4c896a=0x0,_0x768437=events['length'];_0x4c896a<_0x768437;_0x4c896a++){var _0x50b63f=events[_0x4c896a];var _0x57e4a1=createListener(_0x3d02('0x7')+_0x50b63f,_0x513f37);PluginEvents['on'](_0x50b63f,_0x57e4a1);}}; \ No newline at end of file +var _0x78df=['save','update','emit','removeListener','length','plugin:','./plugin.events'];(function(_0x3b562e,_0x3c47de){var _0x43664d=function(_0x281a4e){while(--_0x281a4e){_0x3b562e['push'](_0x3b562e['shift']());}};_0x43664d(++_0x3c47de);}(_0x78df,0x7d));var _0xf78d=function(_0x500982,_0x790f0a){_0x500982=_0x500982-0x0;var _0x3b8ce8=_0x78df[_0x500982];return _0x3b8ce8;};'use strict';var PluginEvents=require(_0xf78d('0x0'));var events=[_0xf78d('0x1'),'remove',_0xf78d('0x2')];function createListener(_0x3981d3,_0x3fc644){return function(_0x3114df){_0x3fc644[_0xf78d('0x3')](_0x3981d3,_0x3114df);};}function removeListener(_0x350bd6,_0x7d8d94){return function(){PluginEvents[_0xf78d('0x4')](_0x350bd6,_0x7d8d94);};}exports['register']=function(_0xc4a5b0){for(var _0x381a47=0x0,_0x419748=events[_0xf78d('0x5')];_0x381a47<_0x419748;_0x381a47++){var _0x1c10a1=events[_0x381a47];var _0x1e28a6=createListener(_0xf78d('0x6')+_0x1c10a1,_0xc4a5b0);PluginEvents['on'](_0x1c10a1,_0x1e28a6);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index bc9cb4e..e63cb16 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(_0x2c42a8,_0x49d7b4){var _0x55c280=function(_0x5ba632){while(--_0x5ba632){_0x2c42a8['push'](_0x2c42a8['shift']());}};_0x55c280(++_0x49d7b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x2d6d25,_0x5c8736){var _0x176a23=function(_0x423afa){while(--_0x423afa){_0x2d6d25['push'](_0x2d6d25['shift']());}};_0x176a23(++_0x5c8736);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 2327d44..64dda0c 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 _0x9c44=['exec','bluebird','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','motion2','length','catch','body','script','join','../../files/plugins','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','../../config/logger','api','path','child_process'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var path=require(_0x49c4('0x2'));var exec=require(_0x49c4('0x3'))[_0x49c4('0x4')];var BPromise=require(_0x49c4('0x5'));function handleEntityNotFound(_0x4e0313,_0x4941f1){return function(_0x41a183){if(!_0x41a183){_0x4e0313['sendStatus'](0x194);;}return _0x41a183;};}function respondWithResult(_0xc1278f,_0x6030ae){_0x6030ae=_0x6030ae||0xc8;return function(_0x69bc41){if(_0x69bc41){return _0xc1278f[_0x49c4('0x6')](_0x6030ae)[_0x49c4('0x7')](_0x69bc41);}return null;};}function handleError(_0x511d53,_0x11c586){_0x11c586=_0x11c586||0x1f4;return function(_0x42e4f8){logger[_0x49c4('0x8')](_0x42e4f8[_0x49c4('0x9')]);if(_0x42e4f8['name']){delete _0x42e4f8['name'];}_0x511d53[_0x49c4('0x6')](_0x11c586)[_0x49c4('0xa')](_0x42e4f8);};}function execChildProcess(){return new BPromise(function(_0x58cad7,_0xb611a1){exec(_0x49c4('0xb'),function(_0x4adb3c,_0x536d42,_0x1d19bf){logger[_0x49c4('0xc')](_0x536d42);logger['info'](_0x1d19bf);if(_0x4adb3c){logger[_0x49c4('0x8')](_0x4adb3c);return _0xb611a1(_0x4adb3c);}return _0x58cad7(_0x536d42);});});}exports[_0x49c4('0xd')]=function(_0x5f2fd9,_0x1909fe){return pm2[_0x49c4('0xe')]()[_0x49c4('0xf')](function(_0x2decee){if(_0x2decee){var _0x12777c=_[_0x49c4('0x10')](_0x2decee,function(_0x75ea8){return _0x75ea8[_0x49c4('0x11')]==='express'||_0x75ea8[_0x49c4('0x11')]===_0x49c4('0x12');});return{'rows':_0x12777c,'count':_0x12777c[_0x49c4('0x13')]};}return null;})[_0x49c4('0xf')](respondWithResult(_0x1909fe,null))[_0x49c4('0x14')](handleError(_0x1909fe,null));};exports['show']=function(_0x44e607,_0x2891f4){return pm2['describe'](_0x44e607['params']['id'])[_0x49c4('0xf')](respondWithResult(_0x2891f4,null))[_0x49c4('0xf')](handleEntityNotFound(_0x2891f4,null))[_0x49c4('0x14')](handleError(_0x2891f4,null));};exports['create']=function(_0x24856d,_0x50b151){if(_0x24856d[_0x49c4('0x15')][_0x49c4('0x11')]&&_0x24856d[_0x49c4('0x15')][_0x49c4('0x16')]){var _0x382040=path[_0x49c4('0x17')](__dirname,_0x49c4('0x18'),_0x24856d[_0x49c4('0x15')][_0x49c4('0x16')]);var _0x578447=process['cwd']();process['chdir'](path[_0x49c4('0x19')](_0x382040));return execChildProcess()['then'](function(_0x592bb8){process[_0x49c4('0x1a')](_0x578447);return pm2[_0x49c4('0x1b')]({'name':_0x24856d[_0x49c4('0x15')][_0x49c4('0x11')],'script':_0x382040});})['then'](function(_0x5850f2){pm2[_0x49c4('0x1c')]();return _0x5850f2[0x0];})[_0x49c4('0xf')](respondWithResult(_0x50b151,0xc9))['catch'](handleError(_0x50b151,null));}else{return _0x50b151[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':_0x49c4('0x1d')});}};exports[_0x49c4('0x1e')]=function(_0x531d92,_0x543ea2){if(_0x531d92[_0x49c4('0x15')]['id']){delete _0x531d92['body']['id'];}var _0x3800b7={'online':_0x49c4('0x1f'),'stopped':_0x49c4('0x20')};if(_0x3800b7[_0x49c4('0x21')](_0x531d92['body'][_0x49c4('0x6')])){return pm2[_0x3800b7[_0x531d92[_0x49c4('0x15')][_0x49c4('0x6')]]](_0x531d92[_0x49c4('0x22')]['id'])[_0x49c4('0xf')](respondWithResult(_0x543ea2,0xc8))[_0x49c4('0x14')](handleError(_0x543ea2,null));}else{return _0x543ea2[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':_0x49c4('0x23')});}};exports[_0x49c4('0x24')]=function(_0x46f7ea,_0x4ea6ea){if(_0x46f7ea['body']['id']){delete _0x46f7ea['body']['id'];}if(_0x46f7ea[_0x49c4('0x22')]['id']){return pm2[_0x49c4('0x25')](_0x46f7ea[_0x49c4('0x22')]['id'])[_0x49c4('0xf')](function(_0x28eb47){pm2['dump']();return _0x28eb47[0x0];})[_0x49c4('0xf')](respondWithResult(_0x4ea6ea,null))[_0x49c4('0x14')](handleError(_0x4ea6ea,null));}else{return _0x4ea6ea[_0x49c4('0x6')](0x1f4)[_0x49c4('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xb332=['dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20id','lodash','../../config/logger','api','child_process','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','list','reject','motion2','length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb332,0xd9));var _0x2b33=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xb332[_0xea343d];return _0x2c6e9c;};'use strict';var _=require(_0x2b33('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var path=require('path');var exec=require(_0x2b33('0x3'))['exec'];var BPromise=require(_0x2b33('0x4'));function handleEntityNotFound(_0x4c6634,_0x34b111){return function(_0x5e5e86){if(!_0x5e5e86){_0x4c6634[_0x2b33('0x5')](0x194);;}return _0x5e5e86;};}function respondWithResult(_0x22d66,_0x478214){_0x478214=_0x478214||0xc8;return function(_0x461d44){if(_0x461d44){return _0x22d66['status'](_0x478214)['json'](_0x461d44);}return null;};}function handleError(_0x4302b7,_0x5f29ab){_0x5f29ab=_0x5f29ab||0x1f4;return function(_0xb3aeab){logger[_0x2b33('0x6')](_0xb3aeab[_0x2b33('0x7')]);if(_0xb3aeab[_0x2b33('0x8')]){delete _0xb3aeab['name'];}_0x4302b7[_0x2b33('0x9')](_0x5f29ab)[_0x2b33('0xa')](_0xb3aeab);};}function execChildProcess(){return new BPromise(function(_0x1be19d,_0x1d83a6){exec(_0x2b33('0xb'),function(_0xf1e5e5,_0x5251b,_0x2b106e){logger[_0x2b33('0xc')](_0x5251b);logger[_0x2b33('0xc')](_0x2b106e);if(_0xf1e5e5){logger[_0x2b33('0x6')](_0xf1e5e5);return _0x1d83a6(_0xf1e5e5);}return _0x1be19d(_0x5251b);});});}exports['index']=function(_0x183773,_0xa44d45){return pm2[_0x2b33('0xd')]()['then'](function(_0x173c75){if(_0x173c75){var _0x4d39db=_[_0x2b33('0xe')](_0x173c75,function(_0x17292f){return _0x17292f[_0x2b33('0x8')]==='express'||_0x17292f['name']===_0x2b33('0xf');});return{'rows':_0x4d39db,'count':_0x4d39db[_0x2b33('0x10')]};}return null;})[_0x2b33('0x11')](respondWithResult(_0xa44d45,null))[_0x2b33('0x12')](handleError(_0xa44d45,null));};exports[_0x2b33('0x13')]=function(_0x4d69d0,_0x554ab3){return pm2['describe'](_0x4d69d0[_0x2b33('0x14')]['id'])['then'](respondWithResult(_0x554ab3,null))['then'](handleEntityNotFound(_0x554ab3,null))[_0x2b33('0x12')](handleError(_0x554ab3,null));};exports[_0x2b33('0x15')]=function(_0x205d8f,_0x539c5f){if(_0x205d8f[_0x2b33('0x16')]['name']&&_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]){var _0x8c8dc2=path[_0x2b33('0x18')](__dirname,_0x2b33('0x19'),_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]);var _0x4fb725=process[_0x2b33('0x1a')]();process[_0x2b33('0x1b')](path[_0x2b33('0x1c')](_0x8c8dc2));return execChildProcess()[_0x2b33('0x11')](function(_0x58998e){process[_0x2b33('0x1b')](_0x4fb725);return pm2[_0x2b33('0x1d')]({'name':_0x205d8f[_0x2b33('0x16')]['name'],'script':_0x8c8dc2});})[_0x2b33('0x11')](function(_0x1b9a48){pm2[_0x2b33('0x1e')]();return _0x1b9a48[0x0];})[_0x2b33('0x11')](respondWithResult(_0x539c5f,0xc9))['catch'](handleError(_0x539c5f,null));}else{return _0x539c5f[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x1f')});}};exports['update']=function(_0x2e74d0,_0x341e0e){if(_0x2e74d0['body']['id']){delete _0x2e74d0[_0x2b33('0x16')]['id'];}var _0x53c2ad={'online':_0x2b33('0x20'),'stopped':'stop'};if(_0x53c2ad[_0x2b33('0x21')](_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')])){return pm2[_0x53c2ad[_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')]]](_0x2e74d0[_0x2b33('0x14')]['id'])[_0x2b33('0x11')](respondWithResult(_0x341e0e,0xc8))[_0x2b33('0x12')](handleError(_0x341e0e,null));}else{return _0x341e0e[_0x2b33('0x9')](0x1f4)[_0x2b33('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x106ea0,_0x2a081c){if(_0x106ea0[_0x2b33('0x16')]['id']){delete _0x106ea0[_0x2b33('0x16')]['id'];}if(_0x106ea0[_0x2b33('0x14')]['id']){return pm2['delete'](_0x106ea0['params']['id'])[_0x2b33('0x11')](function(_0x3d2aaa){pm2[_0x2b33('0x1e')]();return _0x3d2aaa[0x0];})[_0x2b33('0x11')](respondWithResult(_0x2a081c,null))[_0x2b33('0x12')](handleError(_0x2a081c,null));}else{return _0x2a081c[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a523e45..6b4097f 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 _0x6a58=['get','/queues','getQueues','exports','express','Router','../../components/auth/service','/agents','isAuthenticated'];(function(_0x26592b,_0x1ee506){var _0x4ee592=function(_0xa6a9af){while(--_0xa6a9af){_0x26592b['push'](_0x26592b['shift']());}};_0x4ee592(++_0x1ee506);}(_0x6a58,0x16c));var _0x86a5=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x6a58[_0x555ebb];return _0x3c0a4a;};'use strict';var express=require(_0x86a5('0x0'));var router=express[_0x86a5('0x1')]();var auth=require(_0x86a5('0x2'));var controller=require('./realtime.controller');router['get'](_0x86a5('0x3'),auth[_0x86a5('0x4')](),controller['getAgents']);router[_0x86a5('0x5')](_0x86a5('0x6'),auth['isAuthenticated'](),controller[_0x86a5('0x7')]);module[_0x86a5('0x8')]=router; \ No newline at end of file +var _0x31a0=['../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','exports','express','Router'];(function(_0x4558b4,_0x18bd49){var _0xea91c1=function(_0xbbe75a){while(--_0xbbe75a){_0x4558b4['push'](_0x4558b4['shift']());}};_0xea91c1(++_0x18bd49);}(_0x31a0,0x1b7));var _0x031a=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x31a0[_0xb24a3e];return _0x4038d7;};'use strict';var express=require(_0x031a('0x0'));var router=express[_0x031a('0x1')]();var auth=require(_0x031a('0x2'));var controller=require('./realtime.controller');router[_0x031a('0x3')](_0x031a('0x4'),auth[_0x031a('0x5')](),controller[_0x031a('0x6')]);router[_0x031a('0x3')](_0x031a('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x031a('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 0bf9a34..e07d5aa 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 _0xe3da=['key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','Invalid\x20channel','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','limit','undefined','count','status','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','loggedIn','busy','find','pick','filter','queue','some','internal','toString','UserId','accountcode','online','loggedInDb','agents','User','findAll','QueueId','length','idle','unknown','unavailable','chatPause','faxPause','smsPause','voicePause','whatsappPause','every','voiceStatus','pause','chatStatus','smsStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','address','mailPause','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','openchannelPause','resolve','rawAttributes','fieldName','type'];(function(_0x4c2a8c,_0x1df943){var _0x5d734f=function(_0x1c44f5){while(--_0x1c44f5){_0x4c2a8c['push'](_0x4c2a8c['shift']());}};_0x5d734f(++_0x1df943);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0xae3d('0x0'));var _=require(_0xae3d('0x1'));var jayson=require(_0xae3d('0x2'));var qs=require(_0xae3d('0x3'));var logger=require(_0xae3d('0x4'))(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var amiClient=jayson[_0xae3d('0x7')][_0xae3d('0x8')]({'port':0x232a});var routingClient=jayson[_0xae3d('0x7')][_0xae3d('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x26282d,_0xa9a1a){return function(_0xa54808){if(_0xa54808){var _0x476579=typeof _0xa9a1a[_0xae3d('0x9')]==='undefined'&&typeof _0xa9a1a[_0xae3d('0xa')]===_0xae3d('0xb');var _0x5544fa=_0xa54808['count'];var _0x459592=_0x476579?0x0:_0xa9a1a[_0xae3d('0x9')];var _0x420e28=_0x476579?_0xa54808[_0xae3d('0xc')]:_0xa9a1a[_0xae3d('0x9')]+_0xa9a1a[_0xae3d('0xa')];var _0x4bd4ec;if(_0x420e28>=_0x5544fa){_0x420e28=_0x5544fa;_0x4bd4ec=0xc8;}else{_0x4bd4ec=0xce;}_0x26282d[_0xae3d('0xd')](_0x4bd4ec);return _0x26282d['set'](_0xae3d('0xe'),_0x459592+'-'+_0x420e28+'/'+_0x5544fa)[_0xae3d('0xf')](_0xa54808);}return null;};}function handleError(_0x7770eb,_0x172f7a){_0x172f7a=_0x172f7a||0x1f4;return function(_0x48aa74){logger[_0xae3d('0x10')](_0x48aa74[_0xae3d('0x11')]);if(_0x48aa74[_0xae3d('0x12')]){delete _0x48aa74[_0xae3d('0x12')];}_0x7770eb[_0xae3d('0xd')](_0x172f7a)[_0xae3d('0x13')](_0x48aa74);};}function getRealtimeAgents(){return new Promise(function(_0x31498d,_0x4e646f){return amiClient[_0xae3d('0x14')](_0xae3d('0x15'),{})[_0xae3d('0x16')](function(_0x230afb){if(_0x230afb[_0xae3d('0x10')])throw new Error(_0xae3d('0x17'));var _0x585160=_0x230afb[_0xae3d('0x18')];return routingClient[_0xae3d('0x14')](_0xae3d('0x15'),{})['then'](function(_0x3f8cf9){if(_0x3f8cf9[_0xae3d('0x10')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x4d931d=_0x3f8cf9[_0xae3d('0x18')];return _0x31498d(_[_0xae3d('0x19')]({},_0x585160,_0x4d931d));});})[_0xae3d('0x1a')](function(_0x377546){_0x4e646f(_0x377546);});});}function getRealtimeQueues(_0x39828a,_0x577f62){return new Promise(function(_0x121024,_0x48f00e){var _0x4a09c2=_0x577f62===_0xae3d('0x1b')?amiClient:routingClient;return _0x4a09c2[_0xae3d('0x14')](_[_0xae3d('0x1c')](_0x577f62)+_0xae3d('0x1d'),_0x39828a)[_0xae3d('0x16')](function(_0x26c419){if(_0x26c419[_0xae3d('0x10')])throw new Error(util[_0xae3d('0x1e')](_0xae3d('0x1f'),_0x577f62));return _0x121024(_0x26c419[_0xae3d('0x18')]);})[_0xae3d('0x1a')](function(_0x37f5ff){_0x48f00e(_0x37f5ff);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1b2acb,_0x44a4e0){return amiClient[_0xae3d('0x14')](_0xae3d('0x20'),{})[_0xae3d('0x16')](function(_0x2131e9){if(_0x2131e9[_0xae3d('0x10')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x1b2acb(_0x2131e9[_0xae3d('0x18')]);})[_0xae3d('0x1a')](function(_0xb5940){_0x44a4e0(_0xb5940);});});}function initializeQueues(_0x52df0f,_0x256bd0,_0x4391db,_0x8de288){var _0x54c1e1=['loggedIn',_0xae3d('0x21'),_0xae3d('0x22'),_0xae3d('0x23'),_0xae3d('0x24')];if(_0x4391db===_0xae3d('0x1b')&&_0x8de288==='outbound'){_0x54c1e1[_0xae3d('0x25')](_0xae3d('0x26'),'originated',_0xae3d('0x27'),_0xae3d('0x28'),_0xae3d('0x29'),_0xae3d('0x2a'),_0xae3d('0x2b'),_0xae3d('0x2c'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0xae3d('0x2d'),_0xae3d('0x2e'),_0xae3d('0x2f'),_0xae3d('0x30'),'predictiveIntervalAvailable',_0xae3d('0x31'),_0xae3d('0x32'),_0xae3d('0x33'),_0xae3d('0x34'),_0xae3d('0x35'),_0xae3d('0x36'));}return _0x52df0f[_0xae3d('0x37')](function(_0x5ea647){var _0x8827c3=_0x5ea647['get']({'plain':!![]});_0x8827c3['agents']=[];_0x8827c3[_0xae3d('0x24')]=0x0;_0x8827c3['loggedInDb']=0x0;_0x8827c3[_0xae3d('0x38')]=0x0;_0x8827c3['available']=0x0;_0x8827c3['waiting']=0x0;if(_0x4391db===_0xae3d('0x1b')){_0x8827c3[_0xae3d('0x23')]=0x0;_0x8827c3[_0xae3d('0x39')]=0x0;if(_0x8de288==='outbound'){_0x8827c3[_0xae3d('0x26')]=0x0;_0x8827c3['originated']=0x0;}}var _0xce647f=_[_0xae3d('0x3a')](_0x256bd0,['id',_0x8827c3['id']]);if(_0xce647f)_[_0xae3d('0x19')](_0x8827c3,_[_0xae3d('0x3b')](_0xce647f,_0x54c1e1));return _0x8827c3;});}function updateAgentVoiceStatus(_0x18c469,_0x3fc3c0,_0x33a319){var _0x21d84d=_[_0xae3d('0x3c')](_0x33a319,[_0xae3d('0x3d'),_0x3fc3c0[_0xae3d('0x12')]]);if(_0x21d84d['length']===0x0)return _0x18c469['busy']=!![];if(_[_0xae3d('0x3e')](_0x21d84d,['connectedlinenum',_0x18c469[_0xae3d('0x3f')][_0xae3d('0x40')]()]))return _0x18c469[_0xae3d('0x23')]=!![];if(!_0x18c469[_0xae3d('0x23')])return _0x18c469[_0xae3d('0x39')]=!![];}function getVoiceQueueAgents(_0x35db44,_0x238e65,_0x15350d,_0x26de54){var _0xd8cd66=_[_0xae3d('0x3a')](_0x238e65,['id',_0x35db44['id']]);if(!_0xd8cd66)return _0x35db44;return _0xd8cd66['getMembers']({'raw':!![]})[_0xae3d('0x16')](function(_0x3ab6a6){for(var _0xb82d5d=0x0;_0xb82d5d<_0x3ab6a6['length'];_0xb82d5d++){var _0x4df102=_[_0xae3d('0x3a')](_0x15350d,['id',_0x3ab6a6[_0xb82d5d][_0xae3d('0x41')]]);if(!_0x4df102){_0x4df102={'id':_0x3ab6a6[_0xb82d5d]['UserId'],'name':_0x3ab6a6[_0xb82d5d][_0xae3d('0x41')],'accountcode':'','online':![]};}var _0x43d95a={'id':_0x4df102['id'],'name':_0x4df102[_0xae3d('0x12')],'internal':_0x4df102[_0xae3d('0x42')],'online':Boolean(_0x4df102[_0xae3d('0x43')]),'paused':Boolean(_0x3ab6a6[_0xb82d5d][_0xae3d('0x24')])};if(_0x4df102['voiceStatus']===_0xae3d('0x23'))updateAgentVoiceStatus(_0x43d95a,_0x35db44,_0x26de54);if(_0x43d95a[_0xae3d('0x43')])_0x35db44[_0xae3d('0x44')]++;if(_0x43d95a[_0xae3d('0x39')])_0x35db44[_0xae3d('0x39')]++;if(_0x43d95a['paused']&&!_0x43d95a[_0xae3d('0x39')]&&!_0x43d95a['talking'])_0x35db44[_0xae3d('0x24')]++;_0x35db44[_0xae3d('0x45')][_0xae3d('0x25')](_0x43d95a);}return _0x35db44;});}function getQueueAgents(_0x1fc88f,_0x5e31d4,_0x52da45){var _0x5e924b=_0xae3d('0x46')+_[_0xae3d('0x1c')](_0x52da45)+'Queue';var _0x5a04d3=_0x52da45+'Pause';return db[_0x5e924b][_0xae3d('0x47')]({'where':{[_[_0xae3d('0x1c')](_0x52da45)+_0xae3d('0x48')]:_0x1fc88f['id']},'raw':!![]})[_0xae3d('0x16')](function(_0x399b98){for(var _0x20d217=0x0;_0x20d217<_0x399b98[_0xae3d('0x49')];_0x20d217++){var _0x5c621e=_['find'](_0x5e31d4,['id',_0x399b98[_0x20d217]['UserId']]);if(!_0x5c621e){_0x5c621e={'id':_0x399b98[_0x20d217][_0xae3d('0x41')],'name':_0x399b98[_0x20d217]['UserId'],'online':![],['pauseField']:![]};}var _0x2a3f95={'id':_0x5c621e['id'],'name':_0x5c621e[_0xae3d('0x12')],'online':Boolean(_0x5c621e[_0xae3d('0x43')]),'paused':Boolean(_0x5c621e[_0x5a04d3])};if(_0x2a3f95[_0xae3d('0x43')])_0x1fc88f[_0xae3d('0x44')]++;_0x1fc88f[_0xae3d('0x45')][_0xae3d('0x25')](_0x2a3f95);}return _0x1fc88f;});}function isIdle(_0x2a00b1){return _0x2a00b1===_0xae3d('0x4a')||_0x2a00b1===_0xae3d('0x4b')||_0x2a00b1===_0xae3d('0x4c')||_0x2a00b1==='ringing'||_['isNil'](_0x2a00b1);}function isAgentPaused(_0x5379a0,_0x154b23){var _0xc8f551=[_0x5379a0[_0xae3d('0x4d')],_0x5379a0[_0xae3d('0x4e')],_0x5379a0['mailPause'],_0x5379a0['openchannelPause'],_0x5379a0[_0xae3d('0x4f')],_0x5379a0[_0xae3d('0x50')],_0x5379a0[_0xae3d('0x51')]];if(!_0x154b23)return _[_0xae3d('0x52')](_0xc8f551);var _0x58e918=_[_0xae3d('0x3c')](_0xc8f551);return _0x58e918[_0xae3d('0x49')]>0x0&&_0x58e918[_0xae3d('0x49')]<_0xc8f551[_0xae3d('0x49')]?!![]:![];}function isAgentIdle(_0x2a6a24){if(_0x2a6a24[_0xae3d('0x53')]!==_0xae3d('0x4a')&&_0x2a6a24[_0xae3d('0x50')]){_0x2a6a24[_0xae3d('0x53')]=_0xae3d('0x54');return![];}return _[_0xae3d('0x52')]([_0x2a6a24[_0xae3d('0x55')],_0x2a6a24['faxStatus'],_0x2a6a24['mailStatus'],_0x2a6a24['openchannelStatus'],_0x2a6a24[_0xae3d('0x56')],_0x2a6a24[_0xae3d('0x53')],_0x2a6a24['whatsappStatus']],isIdle);}function getAgentStatus(_0x198247){var _0x4ccb0d='unknown';if(isAgentPaused(_0x198247))_0x4ccb0d=_0xae3d('0x54');else if(isAgentPaused(_0x198247,!![]))_0x4ccb0d=_0xae3d('0x57');else if(isAgentIdle(_0x198247))_0x4ccb0d=_0xae3d('0x4a');else _0x4ccb0d=_0xae3d('0x39');return _0x4ccb0d;}exports[_0xae3d('0x58')]=function(_0x1f0657,_0x3e2708){var _0x5efe04={'count':0x0,'rows':[]},_0x10a458={},_0x165c63,_0x24fa2a,_0xd5e300=[_0xae3d('0x59'),_0xae3d('0x43'),_0xae3d('0x5a'),_0xae3d('0x5b'),'pauseType','lastPauseAt','internal',_0xae3d('0x5c'),'chatPause','openchannelPause',_0xae3d('0x5d'),_0xae3d('0x4f'),_0xae3d('0x51'),_0xae3d('0x4e'),_0xae3d('0x50'),_0xae3d('0x5e'),'openchannelCapacity',_0xae3d('0x5f'),_0xae3d('0x60'),_0xae3d('0x61'),_0xae3d('0x62'),_0xae3d('0x63'),_0xae3d('0x64'),'mailCurrentCapacity',_0xae3d('0x65'),_0xae3d('0x66'),_0xae3d('0x67'),'chatStatus','openchannelStatus','mailStatus',_0xae3d('0x56'),_0xae3d('0x68'),'faxStatus',_0xae3d('0x53'),_0xae3d('0x69'),_0xae3d('0x6a'),'mailStatusTime',_0xae3d('0x6b'),_0xae3d('0x6c'),_0xae3d('0x6d'),_0xae3d('0x6e'),_0xae3d('0x3d'),_0xae3d('0x6f'),_0xae3d('0x70'),_0xae3d('0x71'),'phoneBarEnableAutomaticScreenRecording','routealias'],_0x486682=[_0xae3d('0x4d'),_0xae3d('0x72'),_0xae3d('0x5d'),'smsPause','whatsappPause',_0xae3d('0x4e'),_0xae3d('0x50'),_0xae3d('0x43')];Promise[_0xae3d('0x73')]()['then'](function(){var _0xd1951=_[_0xae3d('0x37')](db['User'][_0xae3d('0x74')],function(_0x2c221b){return{'name':_0x2c221b[_0xae3d('0x75')],'type':_0x2c221b[_0xae3d('0x76')][_0xae3d('0x77')]};});_0x1f0657[_0xae3d('0x78')][_0xae3d('0x79')]='agent';_0x1f0657[_0xae3d('0x78')][_0xae3d('0x43')]=!![];_0x10a458=qs[_0xae3d('0x7a')](_0xd1951,_0x1f0657);_0x10a458[_0xae3d('0x7b')]=!![];if(_0x1f0657[_0xae3d('0x7c')]['role']===_0xae3d('0x7c')){var _0xf61534={'params':{'id':_0x1f0657[_0xae3d('0x7c')][_0xae3d('0x7d')]},'query':{'section':_0xae3d('0x15'),'role':_0xae3d('0x7e'),'online':!![],'nolimit':_0x1f0657['query'][_0xae3d('0x7f')],'sort':_0x1f0657[_0xae3d('0x78')]['sort'],'filter':_0x1f0657[_0xae3d('0x78')][_0xae3d('0x3c')],'raw':!![]}};return db[_0xae3d('0x80')]['getResources'](_0xf61534);}return db['User'][_0xae3d('0x81')](_0x10a458);})[_0xae3d('0x16')](function(_0x2040b9){_0x5efe04[_0xae3d('0xc')]=_0x2040b9[_0xae3d('0xc')];_0x165c63=_0x2040b9[_0xae3d('0x82')];return getRealtimeAgents();})[_0xae3d('0x16')](function(_0x5548f9){_0x24fa2a=_0x5548f9[_0xae3d('0x82')];return _0x165c63[_0xae3d('0x37')](function(_0x4e3161){var _0x4380ae=_['find'](_0x24fa2a,['id',_0x4e3161['id']]);if(_0x4380ae)_[_0xae3d('0x19')](_0x4e3161,_[_0xae3d('0x3b')](_[_0xae3d('0x83')](_0x4380ae,_0x486682),_0xd5e300));_0x4e3161[_0xae3d('0x84')]=getAgentStatus(_0x4e3161);return _0x4e3161;});})[_0xae3d('0x16')](function(_0x52c24a){if(_0x1f0657[_0xae3d('0x78')][_0xae3d('0x85')]){var _0x2adb34=_['filter'](_0x52c24a,['globalStatus',_0x1f0657[_0xae3d('0x78')][_0xae3d('0x85')]]);if(_0x1f0657['query']['pauseTypeFilter']){_0x2adb34=_[_0xae3d('0x3c')](_0x2adb34,['pauseType',_0x1f0657[_0xae3d('0x78')]['pauseTypeFilter']]);}}_0x5efe04['rows']=_0x2adb34||_0x52c24a;return _0x5efe04;})['then'](respondWithFilteredResult(_0x3e2708,_0x10a458))['catch'](handleError(_0x3e2708,null));};exports[_0xae3d('0x86')]=function(_0x612a02,_0x5d40e9){var _0x57e296=[_0xae3d('0x87'),_0xae3d('0x88'),_0xae3d('0x89'),_0xae3d('0x8a'),_0xae3d('0x8b'),_0xae3d('0x8c'),_0xae3d('0x1b')];var _0x5e1744={'count':0x0,'rows':[]},_0x21cc63={},_0x3d6aef,_0x199993,_0x1ab2e7,_0x1d0d31,_0x3f6c2f;Promise['resolve']()[_0xae3d('0x16')](function(){if(_0x612a02[_0xae3d('0x78')]['channel']){if(!_['includes'](_0x57e296,_0x612a02[_0xae3d('0x78')][_0xae3d('0x8d')]['toLowerCase']()))throw new Error(_0xae3d('0x8e'));_0x3d6aef=_0x612a02[_0xae3d('0x78')][_0xae3d('0x8d')]['toLowerCase']();}var _0x373ebc=_[_0xae3d('0x1c')](_0x3d6aef)+'Queue';var _0x4e1d15=_[_0xae3d('0x37')](db[_0x373ebc][_0xae3d('0x74')],function(_0x37fd6b){return{'name':_0x37fd6b['fieldName'],'type':_0x37fd6b[_0xae3d('0x76')][_0xae3d('0x77')]};});_0x21cc63=qs['getOptions'](_0x4e1d15,_0x612a02);if(_0x612a02[_0xae3d('0x7c')][_0xae3d('0x79')]===_0xae3d('0x7c')){var _0x5b4815={'params':{'id':_0x612a02[_0xae3d('0x7c')][_0xae3d('0x7d')]},'query':{'section':_0x3d6aef===_0xae3d('0x1b')&&_0x612a02['query'][_0xae3d('0x76')]==='outbound'?_0xae3d('0x8f'):_['startCase'](_0x3d6aef)+'Queues','type':_0x612a02[_0xae3d('0x78')]['type'],'nolimit':!![],'sort':_0xae3d('0x12'),'filter':_0x612a02[_0xae3d('0x78')][_0xae3d('0x3c')]}};return db[_0xae3d('0x80')]['getResources'](_0x5b4815);}return db[_0x373ebc][_0xae3d('0x81')](_0x21cc63);})[_0xae3d('0x16')](function(_0x460e57){_0x5e1744[_0xae3d('0xc')]=_0x460e57[_0xae3d('0xc')];_0x199993=_0x460e57[_0xae3d('0x82')];return getRealtimeQueues(_0x612a02,_0x3d6aef);})[_0xae3d('0x16')](function(_0xa083d0){_0x1d0d31=_0xa083d0[_0xae3d('0x82')];return getRealtimeAgents();})[_0xae3d('0x16')](function(_0x18b439){_0x1ab2e7=_0x18b439[_0xae3d('0x82')];if(_0x3d6aef!=_0xae3d('0x1b'))return;return getRealtimeVoiceQueueChannels();})[_0xae3d('0x16')](function(_0xf281f5){_0x3f6c2f=_0xf281f5?_0xf281f5[_0xae3d('0x82')]:[];return initializeQueues(_0x199993,_0x1d0d31,_0x3d6aef,_0x612a02[_0xae3d('0x78')]['type']);})[_0xae3d('0x16')](function(_0x48e648){var _0x27f65b=_0x48e648[_0xae3d('0x37')](function(_0x184185){if(_0x3d6aef==='voice')return getVoiceQueueAgents(_0x184185,_0x199993,_0x1ab2e7,_0x3f6c2f);else return getQueueAgents(_0x184185,_0x1ab2e7,_0x3d6aef);});return Promise[_0xae3d('0x90')](_0x27f65b);})[_0xae3d('0x16')](function(_0x285829){_0x5e1744[_0xae3d('0x82')]=_0x285829;return _0x5e1744;})[_0xae3d('0x16')](respondWithFilteredResult(_0x5d40e9,_0x21cc63))[_0xae3d('0x1a')](handleError(_0x5d40e9,null));}; \ No newline at end of file +var _0xeda8=['count','offset','status','Content-Range','json','error','stack','name','send','request','Agents','then','result','merge','catch','voice','startCase','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','outbound','pTalking','originated','message','dialActive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','loggedIn','busy','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','online','voiceStatus','push','User','Queue','findAll','idle','unavailable','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','unknown','*pause','getAgents','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','whatsappCapacity','whatsappCurrentCapacity','whatsappStatus','openchannelStatusTime','smsStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','resolve','rawAttributes','fieldName','key','role','query','getOptions','raw','user','userProfileId','nolimit','sort','UserProfile','getResources','rows','globalStatusFilter','pauseTypeFilter','pauseType','mail','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','channel','type','Queues','findAndCountAll','all','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit'];(function(_0x4c8320,_0x2d0225){var _0x4b308b=function(_0x501662){while(--_0x501662){_0x4c8320['push'](_0x4c8320['shift']());}};_0x4b308b(++_0x2d0225);}(_0xeda8,0x104));var _0x8eda=function(_0x1c5c2c,_0x5103e6){_0x1c5c2c=_0x1c5c2c-0x0;var _0x3d1368=_0xeda8[_0x1c5c2c];return _0x3d1368;};'use strict';var util=require(_0x8eda('0x0'));var _=require(_0x8eda('0x1'));var jayson=require('jayson/promise');var qs=require(_0x8eda('0x2'));var logger=require(_0x8eda('0x3'))(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var amiClient=jayson[_0x8eda('0x6')][_0x8eda('0x7')]({'port':0x232a});var routingClient=jayson[_0x8eda('0x6')][_0x8eda('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x22dee9,_0x1f3556){return function(_0x349361){if(_0x349361){var _0x32abe8=typeof _0x1f3556['offset']===_0x8eda('0x8')&&typeof _0x1f3556[_0x8eda('0x9')]===_0x8eda('0x8');var _0x6b544f=_0x349361['count'];var _0x4f7893=_0x32abe8?0x0:_0x1f3556['offset'];var _0x4fbf0a=_0x32abe8?_0x349361[_0x8eda('0xa')]:_0x1f3556[_0x8eda('0xb')]+_0x1f3556[_0x8eda('0x9')];var _0x515c63;if(_0x4fbf0a>=_0x6b544f){_0x4fbf0a=_0x6b544f;_0x515c63=0xc8;}else{_0x515c63=0xce;}_0x22dee9[_0x8eda('0xc')](_0x515c63);return _0x22dee9['set'](_0x8eda('0xd'),_0x4f7893+'-'+_0x4fbf0a+'/'+_0x6b544f)[_0x8eda('0xe')](_0x349361);}return null;};}function handleError(_0x2fdec0,_0x1ad3df){_0x1ad3df=_0x1ad3df||0x1f4;return function(_0x337573){logger[_0x8eda('0xf')](_0x337573[_0x8eda('0x10')]);if(_0x337573[_0x8eda('0x11')]){delete _0x337573['name'];}_0x2fdec0['status'](_0x1ad3df)[_0x8eda('0x12')](_0x337573);};}function getRealtimeAgents(){return new Promise(function(_0x223dcf,_0x4fa040){return amiClient[_0x8eda('0x13')](_0x8eda('0x14'),{})[_0x8eda('0x15')](function(_0x56ff8a){if(_0x56ff8a[_0x8eda('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0xf7d764=_0x56ff8a['result'];return routingClient[_0x8eda('0x13')]('Agents',{})[_0x8eda('0x15')](function(_0x2a4d2b){if(_0x2a4d2b['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x6a6282=_0x2a4d2b[_0x8eda('0x16')];return _0x223dcf(_[_0x8eda('0x17')]({},_0xf7d764,_0x6a6282));});})[_0x8eda('0x18')](function(_0x110f36){_0x4fa040(_0x110f36);});});}function getRealtimeQueues(_0x1b46ee,_0x4fb4ee){return new Promise(function(_0x7081dd,_0x850cce){var _0x232786=_0x4fb4ee===_0x8eda('0x19')?amiClient:routingClient;return _0x232786['request'](_[_0x8eda('0x1a')](_0x4fb4ee)+'Queues',_0x1b46ee)[_0x8eda('0x15')](function(_0x5183bc){if(_0x5183bc[_0x8eda('0xf')])throw new Error(util[_0x8eda('0x1b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4fb4ee));return _0x7081dd(_0x5183bc['result']);})['catch'](function(_0x2a4c99){_0x850cce(_0x2a4c99);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x17cae8,_0x5be84f){return amiClient[_0x8eda('0x13')](_0x8eda('0x1c'),{})['then'](function(_0x25e955){if(_0x25e955[_0x8eda('0xf')])throw new Error(_0x8eda('0x1d'));return _0x17cae8(_0x25e955[_0x8eda('0x16')]);})[_0x8eda('0x18')](function(_0x5c8488){_0x5be84f(_0x5c8488);});});}function initializeQueues(_0x41b5a9,_0x5a8bed,_0x35310c,_0x2e8b2b){var _0x8337b4=['loggedIn',_0x8eda('0x1e'),_0x8eda('0x1f'),_0x8eda('0x20'),'paused'];if(_0x35310c===_0x8eda('0x19')&&_0x2e8b2b===_0x8eda('0x21')){_0x8337b4['push'](_0x8eda('0x22'),_0x8eda('0x23'),_0x8eda('0x24'),_0x8eda('0x25'),'dialMethod','Trunk','startPredictive',_0x8eda('0x26'),_0x8eda('0x27'),_0x8eda('0x28'),'erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval',_0x8eda('0x29'),_0x8eda('0x2a'),_0x8eda('0x2b'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x8eda('0x2c'),_0x8eda('0x2d'),_0x8eda('0x2e'));}return _0x41b5a9[_0x8eda('0x2f')](function(_0x3291b2){var _0x32fb2d=_0x3291b2[_0x8eda('0x30')]({'plain':!![]});_0x32fb2d[_0x8eda('0x31')]=[];_0x32fb2d[_0x8eda('0x32')]=0x0;_0x32fb2d[_0x8eda('0x33')]=0x0;_0x32fb2d[_0x8eda('0x34')]=0x0;_0x32fb2d[_0x8eda('0x1e')]=0x0;_0x32fb2d[_0x8eda('0x1f')]=0x0;if(_0x35310c===_0x8eda('0x19')){_0x32fb2d['talking']=0x0;_0x32fb2d[_0x8eda('0x35')]=0x0;if(_0x2e8b2b===_0x8eda('0x21')){_0x32fb2d[_0x8eda('0x22')]=0x0;_0x32fb2d['originated']=0x0;}}var _0x5061a3=_[_0x8eda('0x36')](_0x5a8bed,['id',_0x32fb2d['id']]);if(_0x5061a3)_[_0x8eda('0x17')](_0x32fb2d,_[_0x8eda('0x37')](_0x5061a3,_0x8337b4));return _0x32fb2d;});}function updateAgentVoiceStatus(_0x32f456,_0x5709a2,_0x443058){var _0x40efe7=_[_0x8eda('0x38')](_0x443058,[_0x8eda('0x39'),_0x5709a2[_0x8eda('0x11')]]);if(_0x40efe7[_0x8eda('0x3a')]===0x0)return _0x32f456['busy']=!![];if(_[_0x8eda('0x3b')](_0x40efe7,[_0x8eda('0x3c'),_0x32f456[_0x8eda('0x3d')][_0x8eda('0x3e')]()]))return _0x32f456[_0x8eda('0x20')]=!![];if(!_0x32f456[_0x8eda('0x20')])return _0x32f456['busy']=!![];}function getVoiceQueueAgents(_0x1067eb,_0x2007c3,_0x322393,_0x3b8527){var _0xa1e556=_['find'](_0x2007c3,['id',_0x1067eb['id']]);if(!_0xa1e556)return _0x1067eb;return _0xa1e556[_0x8eda('0x3f')]({'raw':!![]})[_0x8eda('0x15')](function(_0x44147e){for(var _0x48f636=0x0;_0x48f636<_0x44147e[_0x8eda('0x3a')];_0x48f636++){var _0x5d361e=_[_0x8eda('0x36')](_0x322393,['id',_0x44147e[_0x48f636][_0x8eda('0x40')]]);if(!_0x5d361e){_0x5d361e={'id':_0x44147e[_0x48f636][_0x8eda('0x40')],'name':_0x44147e[_0x48f636][_0x8eda('0x40')],'accountcode':'','online':![]};}var _0x17bdc1={'id':_0x5d361e['id'],'name':_0x5d361e['name'],'internal':_0x5d361e['accountcode'],'online':Boolean(_0x5d361e[_0x8eda('0x41')]),'paused':Boolean(_0x44147e[_0x48f636][_0x8eda('0x32')])};if(_0x5d361e[_0x8eda('0x42')]===_0x8eda('0x20'))updateAgentVoiceStatus(_0x17bdc1,_0x1067eb,_0x3b8527);if(_0x17bdc1[_0x8eda('0x41')])_0x1067eb[_0x8eda('0x33')]++;if(_0x17bdc1[_0x8eda('0x35')])_0x1067eb[_0x8eda('0x35')]++;if(_0x17bdc1[_0x8eda('0x32')]&&!_0x17bdc1[_0x8eda('0x35')]&&!_0x17bdc1[_0x8eda('0x20')])_0x1067eb[_0x8eda('0x32')]++;_0x1067eb[_0x8eda('0x31')][_0x8eda('0x43')](_0x17bdc1);}return _0x1067eb;});}function getQueueAgents(_0x3eed1d,_0x423173,_0x321c50){var _0x106232=_0x8eda('0x44')+_['startCase'](_0x321c50)+_0x8eda('0x45');var _0x16b9a3=_0x321c50+'Pause';return db[_0x106232][_0x8eda('0x46')]({'where':{[_[_0x8eda('0x1a')](_0x321c50)+'QueueId']:_0x3eed1d['id']},'raw':!![]})[_0x8eda('0x15')](function(_0x1fff77){for(var _0x51f2a3=0x0;_0x51f2a3<_0x1fff77[_0x8eda('0x3a')];_0x51f2a3++){var _0x74d822=_[_0x8eda('0x36')](_0x423173,['id',_0x1fff77[_0x51f2a3]['UserId']]);if(!_0x74d822){_0x74d822={'id':_0x1fff77[_0x51f2a3][_0x8eda('0x40')],'name':_0x1fff77[_0x51f2a3][_0x8eda('0x40')],'online':![],['pauseField']:![]};}var _0x3996b7={'id':_0x74d822['id'],'name':_0x74d822[_0x8eda('0x11')],'online':Boolean(_0x74d822[_0x8eda('0x41')]),'paused':Boolean(_0x74d822[_0x16b9a3])};if(_0x3996b7[_0x8eda('0x41')])_0x3eed1d[_0x8eda('0x33')]++;_0x3eed1d['agents'][_0x8eda('0x43')](_0x3996b7);}return _0x3eed1d;});}function isIdle(_0x4c1faf){return _0x4c1faf===_0x8eda('0x47')||_0x4c1faf==='unknown'||_0x4c1faf===_0x8eda('0x48')||_0x4c1faf==='ringing'||_[_0x8eda('0x49')](_0x4c1faf);}function isAgentPaused(_0x52f528,_0x32461a){var _0x3aca19=[_0x52f528[_0x8eda('0x4a')],_0x52f528[_0x8eda('0x4b')],_0x52f528[_0x8eda('0x4c')],_0x52f528[_0x8eda('0x4d')],_0x52f528[_0x8eda('0x4e')],_0x52f528[_0x8eda('0x4f')],_0x52f528[_0x8eda('0x50')]];if(!_0x32461a)return _[_0x8eda('0x51')](_0x3aca19);var _0x39eb7f=_[_0x8eda('0x38')](_0x3aca19);return _0x39eb7f['length']>0x0&&_0x39eb7f[_0x8eda('0x3a')]<_0x3aca19[_0x8eda('0x3a')]?!![]:![];}function isAgentIdle(_0x25b1eb){if(_0x25b1eb[_0x8eda('0x42')]!==_0x8eda('0x47')&&_0x25b1eb[_0x8eda('0x4f')]){_0x25b1eb[_0x8eda('0x42')]=_0x8eda('0x52');return![];}return _[_0x8eda('0x51')]([_0x25b1eb[_0x8eda('0x53')],_0x25b1eb[_0x8eda('0x54')],_0x25b1eb[_0x8eda('0x55')],_0x25b1eb[_0x8eda('0x56')],_0x25b1eb[_0x8eda('0x57')],_0x25b1eb[_0x8eda('0x42')],_0x25b1eb['whatsappStatus']],isIdle);}function getAgentStatus(_0x1b69ae){var _0x142581=_0x8eda('0x58');if(isAgentPaused(_0x1b69ae))_0x142581=_0x8eda('0x52');else if(isAgentPaused(_0x1b69ae,!![]))_0x142581=_0x8eda('0x59');else if(isAgentIdle(_0x1b69ae))_0x142581=_0x8eda('0x47');else _0x142581='busy';return _0x142581;}exports[_0x8eda('0x5a')]=function(_0x1b4942,_0x68f9cd){var _0x4d1c40={'count':0x0,'rows':[]},_0x13de08={},_0x4d4e78,_0x3d16b4,_0x299e91=['userpic',_0x8eda('0x41'),_0x8eda('0x5b'),_0x8eda('0x5c'),'pauseType',_0x8eda('0x5c'),_0x8eda('0x3d'),_0x8eda('0x5d'),_0x8eda('0x4a'),_0x8eda('0x4d'),_0x8eda('0x4c'),_0x8eda('0x4e'),_0x8eda('0x50'),_0x8eda('0x4b'),_0x8eda('0x4f'),'chatCapacity',_0x8eda('0x5e'),_0x8eda('0x5f'),'smsCapacity',_0x8eda('0x60'),'faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity',_0x8eda('0x61'),'faxCurrentCapacity',_0x8eda('0x53'),_0x8eda('0x56'),_0x8eda('0x55'),_0x8eda('0x57'),_0x8eda('0x62'),_0x8eda('0x54'),_0x8eda('0x42'),'chatStatusTime',_0x8eda('0x63'),'mailStatusTime',_0x8eda('0x64'),'whatsappStatusTime',_0x8eda('0x65'),'voiceStatusTime',_0x8eda('0x39'),_0x8eda('0x66'),_0x8eda('0x67'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias'],_0x12ccb4=[_0x8eda('0x4a'),_0x8eda('0x4d'),'mailPause',_0x8eda('0x4e'),'whatsappPause','faxPause',_0x8eda('0x4f'),_0x8eda('0x41')];Promise[_0x8eda('0x68')]()[_0x8eda('0x15')](function(){var _0x5e45ec=_['map'](db[_0x8eda('0x44')][_0x8eda('0x69')],function(_0x111177){return{'name':_0x111177[_0x8eda('0x6a')],'type':_0x111177['type'][_0x8eda('0x6b')]};});_0x1b4942['query'][_0x8eda('0x6c')]='agent';_0x1b4942[_0x8eda('0x6d')]['online']=!![];_0x13de08=qs[_0x8eda('0x6e')](_0x5e45ec,_0x1b4942);_0x13de08[_0x8eda('0x6f')]=!![];if(_0x1b4942[_0x8eda('0x70')][_0x8eda('0x6c')]===_0x8eda('0x70')){var _0x121d85={'params':{'id':_0x1b4942[_0x8eda('0x70')][_0x8eda('0x71')]},'query':{'section':_0x8eda('0x14'),'role':'agent','online':!![],'nolimit':_0x1b4942['query'][_0x8eda('0x72')],'sort':_0x1b4942['query'][_0x8eda('0x73')],'filter':_0x1b4942[_0x8eda('0x6d')][_0x8eda('0x38')],'raw':!![]}};return db[_0x8eda('0x74')][_0x8eda('0x75')](_0x121d85);}return db['User']['findAndCountAll'](_0x13de08);})[_0x8eda('0x15')](function(_0x1ad3e1){_0x4d1c40[_0x8eda('0xa')]=_0x1ad3e1[_0x8eda('0xa')];_0x4d4e78=_0x1ad3e1[_0x8eda('0x76')];return getRealtimeAgents();})[_0x8eda('0x15')](function(_0x10cda2){_0x3d16b4=_0x10cda2['rows'];return _0x4d4e78[_0x8eda('0x2f')](function(_0x4dabf6){var _0x5a36ae=_[_0x8eda('0x36')](_0x3d16b4,['id',_0x4dabf6['id']]);if(_0x5a36ae)_['merge'](_0x4dabf6,_['pick'](_['omit'](_0x5a36ae,_0x12ccb4),_0x299e91));_0x4dabf6['globalStatus']=getAgentStatus(_0x4dabf6);return _0x4dabf6;});})[_0x8eda('0x15')](function(_0x333d93){if(_0x1b4942[_0x8eda('0x6d')][_0x8eda('0x77')]){var _0xa3e405=_[_0x8eda('0x38')](_0x333d93,['globalStatus',_0x1b4942[_0x8eda('0x6d')][_0x8eda('0x77')]]);if(_0x1b4942[_0x8eda('0x6d')][_0x8eda('0x78')]){_0xa3e405=_['filter'](_0xa3e405,[_0x8eda('0x79'),_0x1b4942[_0x8eda('0x6d')][_0x8eda('0x78')]]);}}_0x4d1c40[_0x8eda('0x76')]=_0xa3e405||_0x333d93;return _0x4d1c40;})[_0x8eda('0x15')](respondWithFilteredResult(_0x68f9cd,_0x13de08))[_0x8eda('0x18')](handleError(_0x68f9cd,null));};exports['getQueues']=function(_0x22a362,_0x18b986){var _0x331b39=[_0x8eda('0x7a'),_0x8eda('0x7b'),_0x8eda('0x7c'),_0x8eda('0x7d'),_0x8eda('0x7e'),_0x8eda('0x7f'),_0x8eda('0x19')];var _0x2bdceb={'count':0x0,'rows':[]},_0xd84c42={},_0x3afd40,_0x3d823e,_0x53d7da,_0x4b90c0,_0x2c721c;Promise[_0x8eda('0x68')]()[_0x8eda('0x15')](function(){if(_0x22a362[_0x8eda('0x6d')]['channel']){if(!_[_0x8eda('0x80')](_0x331b39,_0x22a362[_0x8eda('0x6d')]['channel'][_0x8eda('0x81')]()))throw new Error('Invalid\x20channel');_0x3afd40=_0x22a362[_0x8eda('0x6d')][_0x8eda('0x82')][_0x8eda('0x81')]();}var _0x5e2a1f=_[_0x8eda('0x1a')](_0x3afd40)+_0x8eda('0x45');var _0x316e41=_['map'](db[_0x5e2a1f][_0x8eda('0x69')],function(_0x3539da){return{'name':_0x3539da[_0x8eda('0x6a')],'type':_0x3539da[_0x8eda('0x83')]['key']};});_0xd84c42=qs['getOptions'](_0x316e41,_0x22a362);if(_0x22a362[_0x8eda('0x70')][_0x8eda('0x6c')]===_0x8eda('0x70')){var _0xd93d5={'params':{'id':_0x22a362['user'][_0x8eda('0x71')]},'query':{'section':_0x3afd40===_0x8eda('0x19')&&_0x22a362[_0x8eda('0x6d')][_0x8eda('0x83')]===_0x8eda('0x21')?'QueueCampaigns':_[_0x8eda('0x1a')](_0x3afd40)+_0x8eda('0x84'),'type':_0x22a362[_0x8eda('0x6d')]['type'],'nolimit':!![],'sort':'name','filter':_0x22a362['query'][_0x8eda('0x38')]}};return db[_0x8eda('0x74')][_0x8eda('0x75')](_0xd93d5);}return db[_0x5e2a1f][_0x8eda('0x85')](_0xd84c42);})[_0x8eda('0x15')](function(_0x325adc){_0x2bdceb[_0x8eda('0xa')]=_0x325adc[_0x8eda('0xa')];_0x3d823e=_0x325adc['rows'];return getRealtimeQueues(_0x22a362,_0x3afd40);})[_0x8eda('0x15')](function(_0x437c6f){_0x4b90c0=_0x437c6f[_0x8eda('0x76')];return getRealtimeAgents();})['then'](function(_0x327c83){_0x53d7da=_0x327c83[_0x8eda('0x76')];if(_0x3afd40!=_0x8eda('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0x8eda('0x15')](function(_0x33350e){_0x2c721c=_0x33350e?_0x33350e[_0x8eda('0x76')]:[];return initializeQueues(_0x3d823e,_0x4b90c0,_0x3afd40,_0x22a362[_0x8eda('0x6d')][_0x8eda('0x83')]);})[_0x8eda('0x15')](function(_0x3b1363){var _0x1b872b=_0x3b1363['map'](function(_0x458a45){if(_0x3afd40===_0x8eda('0x19'))return getVoiceQueueAgents(_0x458a45,_0x3d823e,_0x53d7da,_0x2c721c);else return getQueueAgents(_0x458a45,_0x53d7da,_0x3afd40);});return Promise[_0x8eda('0x86')](_0x1b872b);})[_0x8eda('0x15')](function(_0x258c51){_0x2bdceb[_0x8eda('0x76')]=_0x258c51;return _0x2bdceb;})[_0x8eda('0x15')](respondWithFilteredResult(_0x18b986,_0xd84c42))[_0x8eda('0x18')](handleError(_0x18b986,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 22354f9..da50aed 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x88acc7,_0x186220){var _0x26cc24=function(_0x422209){while(--_0x422209){_0x88acc7['push'](_0x88acc7['shift']());}};_0x26cc24(++_0x186220);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xcb91[_0x5e8d3e];return _0x1348c0;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x8d4214,_0x4a45e5){var _0xdcf37a=function(_0xface0c){while(--_0xface0c){_0x8d4214['push'](_0x8d4214['shift']());}};_0xdcf37a(++_0x4a45e5);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 20ecb6e..a8e9154 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 _0x5a5a=['DATE','exports','INTEGER','STRING'];(function(_0x261170,_0x1ab294){var _0x4d398c=function(_0x43699e){while(--_0x43699e){_0x261170['push'](_0x261170['shift']());}};_0x4d398c(++_0x1ab294);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x1740ae,_0x5889d2){_0x1740ae=_0x1740ae-0x0;var _0x2eddc6=_0x5a5a[_0x1740ae];return _0x2eddc6;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'state':{'type':Sequelize[_0xa5a5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa5a5('0x2')]},'scheduledat':{'type':Sequelize[_0xa5a5('0x3')]},'uniqueid':{'type':Sequelize[_0xa5a5('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa5a5('0x3')]},'ringtime':{'type':Sequelize[_0xa5a5('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa5a5('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdded=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x4aede3,_0x1ad6dd){var _0x53817f=function(_0x36ed20){while(--_0x36ed20){_0x4aede3['push'](_0x4aede3['shift']());}};_0x53817f(++_0x1ad6dd);}(_0xdded,0x17a));var _0xddde=function(_0x44a36f,_0xa7f0a3){_0x44a36f=_0x44a36f-0x0;var _0x1d31b3=_0xdded[_0x44a36f];return _0x1d31b3;};'use strict';var Sequelize=require(_0xddde('0x0'));module[_0xddde('0x1')]={'state':{'type':Sequelize[_0xddde('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xddde('0x3')]},'scheduledat':{'type':Sequelize[_0xddde('0x4')]},'uniqueid':{'type':Sequelize[_0xddde('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xddde('0x4')]},'ringtime':{'type':Sequelize[_0xddde('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xddde('0x3')]},'campaigntype':{'type':Sequelize[_0xddde('0x3')]},'membername':{'type':Sequelize[_0xddde('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 5d61f95..d1ad0ce 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 _0xacb2=['ReportAgentPreview','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x475e16,_0xa53a2a){var _0x56e774=function(_0x71292){while(--_0x71292){_0x475e16['push'](_0x475e16['shift']());}};_0x56e774(++_0xa53a2a);}(_0xacb2,0x198));var _0x2acb=function(_0x5498d6,_0x210612){_0x5498d6=_0x5498d6-0x0;var _0x275f87=_0xacb2[_0x5498d6];return _0x275f87;};'use strict';var _=require(_0x2acb('0x0'));var util=require(_0x2acb('0x1'));var logger=require('../../config/logger')(_0x2acb('0x2'));var moment=require(_0x2acb('0x3'));var BPromise=require(_0x2acb('0x4'));var rp=require(_0x2acb('0x5'));var fs=require('fs');var path=require(_0x2acb('0x6'));var rimraf=require(_0x2acb('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x2acb('0x8')]=function(_0x55c646,_0x43e7d7){return _0x55c646[_0x2acb('0x9')](_0x2acb('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ab9=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x8ab9,0x164));var _0x98ab=function(_0x5b3979,_0x8adcf9){_0x5b3979=_0x5b3979-0x0;var _0x4c0727=_0x8ab9[_0x5b3979];return _0x4c0727;};'use strict';var _=require(_0x98ab('0x0'));var util=require(_0x98ab('0x1'));var logger=require('../../config/logger')(_0x98ab('0x2'));var moment=require(_0x98ab('0x3'));var BPromise=require(_0x98ab('0x4'));var rp=require(_0x98ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98ab('0x6'));var config=require(_0x98ab('0x7'));var attributes=require(_0x98ab('0x8'));module[_0x98ab('0x9')]=function(_0x298298,_0x1dfe1c){return _0x298298[_0x98ab('0xa')](_0x98ab('0xb'),attributes,{'tableName':_0x98ab('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 a673809..41e50a2 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 _0xf5a3=['debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0xf5a3,0x193));var _0x3f5a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf5a3[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x3f5a('0x0'));var util=require(_0x3f5a('0x1'));var moment=require('moment');var BPromise=require(_0x3f5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f5a('0x3'));var db=require(_0x3f5a('0x4'))['db'];var utils=require(_0x3f5a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3f5a('0x6'));var client=jayson[_0x3f5a('0x7')][_0x3f5a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x206c82,_0x326e65,_0x40f84b){return new BPromise(function(_0x4d3f46,_0x1988f8){return client[_0x3f5a('0x9')](_0x206c82,_0x40f84b)['then'](function(_0x4c2851){logger[_0x3f5a('0xa')](_0x3f5a('0xb'),_0x326e65,_0x3f5a('0xc'));logger[_0x3f5a('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x326e65,_0x3f5a('0xc'),JSON[_0x3f5a('0xe')](_0x4c2851));if(_0x4c2851[_0x3f5a('0xf')]){if(_0x4c2851[_0x3f5a('0xf')][_0x3f5a('0x10')]===0x1f4){logger[_0x3f5a('0xf')](_0x3f5a('0xb'),_0x326e65,_0x4c2851[_0x3f5a('0xf')][_0x3f5a('0x11')]);return _0x1988f8(_0x4c2851['error'][_0x3f5a('0x11')]);}logger['error'](_0x3f5a('0xb'),_0x326e65,_0x4c2851[_0x3f5a('0xf')][_0x3f5a('0x11')]);return _0x4d3f46(_0x4c2851[_0x3f5a('0xf')]['message']);}else{logger[_0x3f5a('0xa')](_0x3f5a('0xb'),_0x326e65,'request\x20sent');_0x4d3f46(_0x4c2851[_0x3f5a('0x12')][_0x3f5a('0x11')]);}})[_0x3f5a('0x13')](function(_0x4ede19){logger[_0x3f5a('0xf')](_0x3f5a('0xb'),_0x326e65,_0x4ede19);_0x1988f8(_0x4ede19);});});}exports[_0x3f5a('0x14')]=function(_0x4da964){var _0x46bfd7=this;return new Promise(function(_0x33c3a6,_0x2e9754){return db[_0x3f5a('0x15')][_0x3f5a('0x16')](_0x4da964[_0x3f5a('0x17')],{'raw':_0x4da964[_0x3f5a('0x18')]?_0x4da964[_0x3f5a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3f5a('0x19')](function(_0x3d9da5){logger[_0x3f5a('0xa')](_0x3f5a('0x14'),_0x4da964);logger['debug']('CreateReportAgentPreview',_0x4da964,JSON[_0x3f5a('0xe')](_0x3d9da5));_0x33c3a6(_0x3d9da5);})[_0x3f5a('0x13')](function(_0x43cdf6){logger[_0x3f5a('0xf')]('CreateReportAgentPreview',_0x43cdf6['message'],_0x4da964);_0x2e9754(_0x46bfd7[_0x3f5a('0xf')](0x1f4,_0x43cdf6[_0x3f5a('0x11')]));});});}; \ No newline at end of file +var _0x14c7=['create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14c7,0x179));var _0x714c=function(_0x3d0e7e,_0xa0b867){_0x3d0e7e=_0x3d0e7e-0x0;var _0x3d505b=_0x14c7[_0x3d0e7e];return _0x3d505b;};'use strict';var _=require(_0x714c('0x0'));var util=require(_0x714c('0x1'));var moment=require(_0x714c('0x2'));var BPromise=require(_0x714c('0x3'));var rs=require(_0x714c('0x4'));var fs=require('fs');var Redis=require(_0x714c('0x5'));var db=require(_0x714c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x714c('0x7'))(_0x714c('0x8'));var config=require(_0x714c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x714c('0xa')][_0x714c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dc7be,_0x59014b,_0x40b73b){return new BPromise(function(_0x511ce6,_0x1926f6){return client[_0x714c('0xc')](_0x1dc7be,_0x40b73b)[_0x714c('0xd')](function(_0xb576c7){logger[_0x714c('0xe')](_0x714c('0xf'),_0x59014b,_0x714c('0x10'));logger[_0x714c('0x11')](_0x714c('0x12'),_0x59014b,'request\x20sent',JSON[_0x714c('0x13')](_0xb576c7));if(_0xb576c7['error']){if(_0xb576c7[_0x714c('0x14')][_0x714c('0x15')]===0x1f4){logger['error'](_0x714c('0xf'),_0x59014b,_0xb576c7['error'][_0x714c('0x16')]);return _0x1926f6(_0xb576c7[_0x714c('0x14')]['message']);}logger[_0x714c('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x59014b,_0xb576c7[_0x714c('0x14')][_0x714c('0x16')]);return _0x511ce6(_0xb576c7['error'][_0x714c('0x16')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x59014b,_0x714c('0x10'));_0x511ce6(_0xb576c7[_0x714c('0x17')][_0x714c('0x16')]);}})['catch'](function(_0x4149e6){logger['error'](_0x714c('0xf'),_0x59014b,_0x4149e6);_0x1926f6(_0x4149e6);});});}exports[_0x714c('0x18')]=function(_0x1e3836){var _0x2431df=this;return new Promise(function(_0x373393,_0x421f26){return db[_0x714c('0x19')][_0x714c('0x1a')](_0x1e3836[_0x714c('0x1b')],{'raw':_0x1e3836[_0x714c('0x1c')]?_0x1e3836[_0x714c('0x1c')][_0x714c('0x1d')]===undefined?!![]:![]:!![]})[_0x714c('0xd')](function(_0x12ac69){logger[_0x714c('0xe')](_0x714c('0x18'),_0x1e3836);logger[_0x714c('0x11')](_0x714c('0x18'),_0x1e3836,JSON[_0x714c('0x13')](_0x12ac69));_0x373393(_0x12ac69);})[_0x714c('0x1e')](function(_0xa03b2c){logger[_0x714c('0x14')](_0x714c('0x18'),_0xa03b2c[_0x714c('0x16')],_0x1e3836);_0x421f26(_0x2431df[_0x714c('0x14')](0x1f4,_0xa03b2c[_0x714c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 91a9b1b..759eac8 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 _0x5d3a=['showVoiceQueues','put','/outbound','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','post','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id'];(function(_0x5198b7,_0x507432){var _0x217dfb=function(_0x99caa6){while(--_0x99caa6){_0x5198b7['push'](_0x5198b7['shift']());}};_0x217dfb(++_0x507432);}(_0x5d3a,0xbf));var _0xa5d3=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0x5d3a[_0x1cb0b4];return _0x525b60;};'use strict';var multer=require(_0xa5d3('0x0'));var util=require(_0xa5d3('0x1'));var path=require(_0xa5d3('0x2'));var express=require('express');var router=express[_0xa5d3('0x3')]();var auth=require(_0xa5d3('0x4'));var controller=require(_0xa5d3('0x5'));router[_0xa5d3('0x6')]('/voice/channels',auth[_0xa5d3('0x7')](),controller['voiceChannels']);router['get'](_0xa5d3('0x8'),auth[_0xa5d3('0x7')](),controller['voiceChannelMixMonitor']);router[_0xa5d3('0x6')](_0xa5d3('0x9'),auth[_0xa5d3('0x7')](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0xa')]);router[_0xa5d3('0x6')](_0xa5d3('0xb'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0xc')]);router['get'](_0xa5d3('0xd'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0xe')]);router[_0xa5d3('0x6')](_0xa5d3('0xf'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x10')]);router[_0xa5d3('0x6')]('/openchannel/queues',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x11')]);router[_0xa5d3('0x6')](_0xa5d3('0x12'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x13')]);router[_0xa5d3('0x6')](_0xa5d3('0x14'),auth[_0xa5d3('0x7')](),controller['whatsappQueues']);router[_0xa5d3('0x6')](_0xa5d3('0x15'),auth['isAuthenticated'](),controller['faxQueues']);router['get'](_0xa5d3('0x16'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x17')]);router[_0xa5d3('0x6')](_0xa5d3('0x18'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x19')]);router[_0xa5d3('0x6')](_0xa5d3('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xa5d3('0x6')](_0xa5d3('0x1b'),auth['isAuthenticated'](),controller[_0xa5d3('0x1c')]);router[_0xa5d3('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x1d')]);router[_0xa5d3('0x6')](_0xa5d3('0x1e'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x1f')]);router[_0xa5d3('0x20')](_0xa5d3('0x1e'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xa5d3('0x6')](_0xa5d3('0x21'),auth['isAuthenticated'](),controller['outbound']);router[_0xa5d3('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xa5d3('0x22')]);router['get']('/agents',auth['isAuthenticated'](),controller[_0xa5d3('0x23')]);router[_0xa5d3('0x20')](_0xa5d3('0x24'),auth['isAuthenticated'](),controller[_0xa5d3('0x25')]);router[_0xa5d3('0x6')](_0xa5d3('0x26'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x27')]);router['get']('/trunks',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x28')]);router[_0xa5d3('0x6')]('/campaigns',auth[_0xa5d3('0x7')](),controller['campaigns']);router['get']('/fax/accounts',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x29')]);router[_0xa5d3('0x6')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0xa5d3('0x6')](_0xa5d3('0x2a'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x2b')]);router[_0xa5d3('0x6')](_0xa5d3('0x2c'),auth[_0xa5d3('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0xa5d3('0x6')](_0xa5d3('0x2d'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x2e')]);router[_0xa5d3('0x6')]('/sms/queues/waitinginteractions',auth[_0xa5d3('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0xa5d3('0x6')](_0xa5d3('0x2f'),auth['isAuthenticated'](),controller[_0xa5d3('0x30')]);router[_0xa5d3('0x6')](_0xa5d3('0x31'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x32')]);router['post']('/mail/queues/:id/notify',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x33')](_0xa5d3('0x34')));router['get'](_0xa5d3('0x35'),auth['isAuthenticated'](),controller[_0xa5d3('0x36')]);router['post']('/chat/queues/:id/notify',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x33')](_0xa5d3('0x37')));router[_0xa5d3('0x6')](_0xa5d3('0x38'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0xa5d3('0x39')]('/fax/queues/:id/notify',auth[_0xa5d3('0x7')](),controller['queueNotify'](_0xa5d3('0x3a')));router[_0xa5d3('0x6')](_0xa5d3('0x3b'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x3c')]);router['post'](_0xa5d3('0x3d'),auth[_0xa5d3('0x7')](),controller['queueNotify'](_0xa5d3('0x3e')));router['get'](_0xa5d3('0x3f'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x40')]);router[_0xa5d3('0x39')]('/sms/queues/:id/notify',auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x33')](_0xa5d3('0x41')));router['post'](_0xa5d3('0x42'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x33')](_0xa5d3('0x43')));router['get'](_0xa5d3('0x44'),auth[_0xa5d3('0x7')](),controller['showSmsQueues']);router['get'](_0xa5d3('0x45'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x46')]);router['post'](_0xa5d3('0x47'),auth[_0xa5d3('0x7')](),controller[_0xa5d3('0x48')]);module[_0xa5d3('0x49')]=router; \ No newline at end of file +var _0x670d=['/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post'];(function(_0x1e85fd,_0x5a10a3){var _0x40a5d1=function(_0x420398){while(--_0x420398){_0x1e85fd['push'](_0x1e85fd['shift']());}};_0x40a5d1(++_0x5a10a3);}(_0x670d,0x166));var _0xd670=function(_0x15d061,_0x5943ea){_0x15d061=_0x15d061-0x0;var _0xa2a008=_0x670d[_0x15d061];return _0xa2a008;};'use strict';var multer=require(_0xd670('0x0'));var util=require(_0xd670('0x1'));var path=require(_0xd670('0x2'));var express=require(_0xd670('0x3'));var router=express[_0xd670('0x4')]();var auth=require(_0xd670('0x5'));var controller=require(_0xd670('0x6'));router[_0xd670('0x7')](_0xd670('0x8'),auth[_0xd670('0x9')](),controller[_0xd670('0xa')]);router['get'](_0xd670('0xb'),auth['isAuthenticated'](),controller[_0xd670('0xc')]);router['get'](_0xd670('0xd'),auth['isAuthenticated'](),controller[_0xd670('0xe')]);router[_0xd670('0x7')](_0xd670('0xf'),auth[_0xd670('0x9')](),controller[_0xd670('0x10')]);router[_0xd670('0x7')](_0xd670('0x11'),auth[_0xd670('0x9')](),controller[_0xd670('0x12')]);router[_0xd670('0x7')](_0xd670('0x13'),auth[_0xd670('0x9')](),controller[_0xd670('0x14')]);router['get'](_0xd670('0x15'),auth[_0xd670('0x9')](),controller['mailAccounts']);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0xd670('0x16')]);router[_0xd670('0x7')](_0xd670('0x17'),auth[_0xd670('0x9')](),controller[_0xd670('0x18')]);router[_0xd670('0x7')]('/whatsapp/queues',auth[_0xd670('0x9')](),controller[_0xd670('0x19')]);router[_0xd670('0x7')](_0xd670('0x1a'),auth[_0xd670('0x9')](),controller[_0xd670('0x1b')]);router[_0xd670('0x7')](_0xd670('0x1c'),auth[_0xd670('0x9')](),controller[_0xd670('0x1d')]);router[_0xd670('0x7')]('/voice/queues/channels',auth[_0xd670('0x9')](),controller[_0xd670('0x1e')]);router[_0xd670('0x7')](_0xd670('0x1f'),auth[_0xd670('0x9')](),controller['voiceQueuesChannel']);router[_0xd670('0x7')](_0xd670('0x20'),auth['isAuthenticated'](),controller[_0xd670('0x21')]);router[_0xd670('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xd670('0x9')](),controller[_0xd670('0x22')]);router[_0xd670('0x7')]('/voice/queues/:id',auth[_0xd670('0x9')](),controller[_0xd670('0x23')]);router[_0xd670('0x24')](_0xd670('0x25'),auth[_0xd670('0x9')](),controller[_0xd670('0x26')]);router[_0xd670('0x7')](_0xd670('0x27'),auth[_0xd670('0x9')](),controller[_0xd670('0x28')]);router[_0xd670('0x7')](_0xd670('0x29'),auth[_0xd670('0x9')](),controller[_0xd670('0x2a')]);router[_0xd670('0x7')](_0xd670('0x2b'),auth[_0xd670('0x9')](),controller[_0xd670('0x2c')]);router[_0xd670('0x24')](_0xd670('0x2d'),auth[_0xd670('0x9')](),controller[_0xd670('0x2e')]);router[_0xd670('0x7')](_0xd670('0x2f'),auth[_0xd670('0x9')](),controller[_0xd670('0x30')]);router[_0xd670('0x7')](_0xd670('0x31'),auth[_0xd670('0x9')](),controller['trunks']);router[_0xd670('0x7')](_0xd670('0x32'),auth[_0xd670('0x9')](),controller[_0xd670('0x33')]);router[_0xd670('0x7')]('/fax/accounts',auth[_0xd670('0x9')](),controller[_0xd670('0x34')]);router['get'](_0xd670('0x35'),auth['isAuthenticated'](),controller[_0xd670('0x36')]);router[_0xd670('0x7')](_0xd670('0x37'),auth[_0xd670('0x9')](),controller[_0xd670('0x38')]);router[_0xd670('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xd670('0x9')](),controller[_0xd670('0x39')]);router[_0xd670('0x7')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0xd670('0x3a'),auth[_0xd670('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0xd670('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0xd670('0x9')](),controller[_0xd670('0x3b')]);router[_0xd670('0x7')]('/fax/queues/waitinginteractions',auth[_0xd670('0x9')](),controller[_0xd670('0x3c')]);router[_0xd670('0x3d')](_0xd670('0x3e'),auth[_0xd670('0x9')](),controller[_0xd670('0x3f')](_0xd670('0x40')));router['get'](_0xd670('0x41'),auth[_0xd670('0x9')](),controller[_0xd670('0x42')]);router[_0xd670('0x3d')](_0xd670('0x43'),auth['isAuthenticated'](),controller['queueNotify'](_0xd670('0x44')));router[_0xd670('0x7')]('/chat/queues/:id',auth[_0xd670('0x9')](),controller[_0xd670('0x45')]);router[_0xd670('0x3d')](_0xd670('0x46'),auth['isAuthenticated'](),controller[_0xd670('0x3f')]('fax'));router['get']('/fax/queues/:id',auth[_0xd670('0x9')](),controller['showFaxQueues']);router['post'](_0xd670('0x47'),auth[_0xd670('0x9')](),controller[_0xd670('0x3f')](_0xd670('0x48')));router[_0xd670('0x7')](_0xd670('0x49'),auth[_0xd670('0x9')](),controller[_0xd670('0x4a')]);router[_0xd670('0x3d')]('/sms/queues/:id/notify',auth[_0xd670('0x9')](),controller['queueNotify'](_0xd670('0x4b')));router[_0xd670('0x3d')](_0xd670('0x4c'),auth[_0xd670('0x9')](),controller['queueNotify'](_0xd670('0x4d')));router[_0xd670('0x7')](_0xd670('0x4e'),auth[_0xd670('0x9')](),controller[_0xd670('0x4f')]);router[_0xd670('0x7')](_0xd670('0x50'),auth[_0xd670('0x9')](),controller['showWhatsappQueues']);router[_0xd670('0x3d')](_0xd670('0x51'),auth[_0xd670('0x9')](),controller[_0xd670('0x52')]);module[_0xd670('0x53')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4919766..52ba69e 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 _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x35a987,_0x59c27a){var _0x1887df=function(_0x33a126){while(--_0x33a126){_0x35a987['push'](_0x35a987['shift']());}};_0x1887df(++_0x59c27a);}(_0x6f47,0xc7));var _0x76f4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6f47[_0x502c7d];return _0x30b7ed;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file +var _0xb138=['telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','agent','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','error','code','message','result','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query','then','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','Agents','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','INTERACTION','SIP/%s','interface','internal','AgentCapacity','capacity'];(function(_0x56ab95,_0xcfb5d4){var _0x5615dc=function(_0x2c92fd){while(--_0x2c92fd){_0x56ab95['push'](_0x56ab95['shift']());}};_0x5615dc(++_0xcfb5d4);}(_0xb138,0x1dd));var _0x8b13=function(_0x416d23,_0x2ea1a7){_0x416d23=_0x416d23-0x0;var _0x1b15a3=_0xb138[_0x416d23];return _0x1b15a3;};'use strict';var BPromise=require(_0x8b13('0x0'));var moment=require(_0x8b13('0x1'));var _=require(_0x8b13('0x2'));var util=require(_0x8b13('0x3'));var db=require(_0x8b13('0x4'))['db'];var logger=require(_0x8b13('0x5'))(_0x8b13('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8b13('0x7')][_0x8b13('0x8')]({'port':0x232a});var mailClient=jayson[_0x8b13('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x8b13('0x7')][_0x8b13('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x5d51b1,_0x3fdf4d,_0x33d1a7){return new BPromise(function(_0x22e157,_0x498832){var _0x8570b0=_0x33d1a7?_0x33d1a7:amiClient;return _0x8570b0[_0x8b13('0x9')](_0x5d51b1,_0x3fdf4d)['then'](function(_0x53ae50){if(_0x53ae50[_0x8b13('0xa')]){if(_0x53ae50[_0x8b13('0xa')][_0x8b13('0xb')]===0x1f4){return _0x498832(_0x53ae50[_0x8b13('0xa')][_0x8b13('0xc')]);}return _0x22e157(_0x53ae50['error'][_0x8b13('0xc')]);}else{_0x22e157(_0x53ae50[_0x8b13('0xd')]);}})[_0x8b13('0xe')](function(_0x3f79d5){_0x498832(_0x3f79d5);});});}function respondWithResult(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xc8;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['status'](_0x1893b1)[_0x8b13('0xf')](_0x58f97e);}return _0xb227e0[_0x8b13('0x10')](0x194);};}function handleError(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0x1f4;return function(_0x479773){logger[_0x8b13('0xa')](_0x479773[_0x8b13('0x11')]);if(_0x479773[_0x8b13('0x12')]){delete _0x479773[_0x8b13('0x12')];}_0x5f12b5[_0x8b13('0x13')](_0x51a935)['send'](_0x479773);};}function findById(_0x1c6c99){return function(_0xea7881){if(!_[_0x8b13('0x14')](_0x1c6c99)&&!_[_0x8b13('0x14')](_0xea7881)&&!_[_0x8b13('0x14')](_0xea7881[_0x8b13('0x15')])){return _[_0x8b13('0x16')](_0xea7881[_0x8b13('0x15')],function(_0x4989d3){return _0x4989d3['id']==_0x1c6c99;});}return null;};}exports['voiceChannels']=function(_0xae4966,_0x335709){return respondWithRpcPromise(_0x8b13('0x17'),_0xae4966[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x335709,null))[_0x8b13('0xe')](handleError(_0x335709,null));};exports['voiceChannelMixMonitor']=function(_0x1e8a48,_0x3c4d4f){return respondWithRpcPromise(_0x8b13('0x1a'),_['merge'](_0x1e8a48['query'],_0x1e8a48[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x3c4d4f,null))['catch'](handleError(_0x3c4d4f,null));};exports[_0x8b13('0x1c')]=function(_0x2c3afb,_0x37ca5f){return respondWithRpcPromise(_0x8b13('0x1d'),_[_0x8b13('0x1e')](_0x2c3afb['query'],_0x2c3afb[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x37ca5f,null))['catch'](handleError(_0x37ca5f,null));};exports[_0x8b13('0x1f')]=function(_0x4fdd1c,_0x420772){return respondWithRpcPromise(_0x8b13('0x20'),_0x4fdd1c['query'])[_0x8b13('0x19')](respondWithResult(_0x420772,null))[_0x8b13('0xe')](handleError(_0x420772,null));};exports['showVoiceQueues']=function(_0x134c5e,_0x14a739){return respondWithRpcPromise(_0x8b13('0x20'),_0x134c5e[_0x8b13('0x18')])[_0x8b13('0x19')](findById(_0x134c5e['params']['id']))[_0x8b13('0x19')](respondWithResult(_0x14a739,null))[_0x8b13('0xe')](handleError(_0x14a739,null));};exports[_0x8b13('0x21')]=function(_0x1511bf,_0x114b01){return respondWithRpcPromise(_0x8b13('0x22'),_['merge'](_0x1511bf[_0x8b13('0x23')],_0x1511bf[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x114b01,null))[_0x8b13('0xe')](handleError(_0x114b01,null));};exports[_0x8b13('0x24')]=function(_0x29946e,_0x3304bd){return respondWithRpcPromise(_0x8b13('0x25'),_[_0x8b13('0x1e')](_0x29946e['query'],_0x29946e[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x3304bd,null))[_0x8b13('0xe')](handleError(_0x3304bd,null));};exports[_0x8b13('0x26')]=function(_0x51a334,_0x4f7d91){return respondWithRpcPromise(_0x8b13('0x27'),_0x51a334['query'])['then'](respondWithResult(_0x4f7d91,null))[_0x8b13('0xe')](handleError(_0x4f7d91,null));};exports['voiceQueuesChannel']=function(_0x2ec1ab,_0x408626){return respondWithRpcPromise(_0x8b13('0x28'),_[_0x8b13('0x1e')](_0x2ec1ab[_0x8b13('0x18')],_0x2ec1ab[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x408626,null))[_0x8b13('0xe')](handleError(_0x408626,null));};exports[_0x8b13('0x29')]=function(_0x1b313d,_0x4d45bc){return respondWithRpcPromise(_0x8b13('0x2a'),_[_0x8b13('0x1e')](_0x1b313d[_0x8b13('0x18')],_0x1b313d[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x4d45bc,null))[_0x8b13('0xe')](handleError(_0x4d45bc,null));};exports[_0x8b13('0x2b')]=function(_0x241687,_0x5c67b1){return respondWithRpcPromise(_0x8b13('0x2c'),_['merge'](_0x241687[_0x8b13('0x18')],_0x241687[_0x8b13('0x1b')]))[_0x8b13('0x19')](respondWithResult(_0x5c67b1,null))[_0x8b13('0xe')](handleError(_0x5c67b1,null));};exports[_0x8b13('0x2d')]=function(_0x327eb1,_0x4ec1a5){return respondWithRpcPromise('Outbound',_0x327eb1[_0x8b13('0x18')])['then'](respondWithResult(_0x4ec1a5,null))[_0x8b13('0xe')](handleError(_0x4ec1a5,null));};exports['outboundChannels']=function(_0x590a23,_0x3a8e06){return respondWithRpcPromise(_0x8b13('0x2e'),_0x590a23[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x3a8e06,null))['catch'](handleError(_0x3a8e06,null));};exports['agents']=function(_0x230a8c,_0x595d8d){var _0x6ba2f3;return respondWithRpcPromise(_0x8b13('0x2f'),_0x230a8c['query'])[_0x8b13('0x19')](function(_0x41d710){_0x6ba2f3=_0x41d710;return respondWithRpcPromise(_0x8b13('0x2f'),_0x230a8c[_0x8b13('0x18')],routingClient);})[_0x8b13('0x19')](function(_0x38ec75){return _[_0x8b13('0x1e')]({},_0x38ec75,_0x6ba2f3);})['then'](respondWithResult(_0x595d8d,null))['catch'](handleError(_0x595d8d,null));};exports['agentCapacity']=function(_0x3eb3c5,_0x16ec3){if(_0x3eb3c5[_0x8b13('0x23')]&&_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')]&&_0x3eb3c5[_0x8b13('0x31')]&&_0x3eb3c5['user'][_0x8b13('0x12')]){for(var _0x50e535 in _0x3eb3c5[_0x8b13('0x23')]['interaction']){if(_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x8b13('0x32')](_0x50e535)){db[_0x8b13('0x33')][_0x8b13('0x34')]({'where':{'channel':_0x50e535,'membername':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3eb3c5['body']['interaction'][_0x50e535]&&_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x8b13('0x35')]?{'$notIn':_0x3eb3c5[_0x8b13('0x23')]['interaction'][_0x50e535]}:{'$ne':null}}})['then'](function(_0x3f420d){var _0x54d19d=moment()[_0x8b13('0x36')](_0x8b13('0x37'));for(var _0x20c363=0x0,_0x28ae75=_0x3f420d[_0x8b13('0x35')];_0x20c363<_0x28ae75;_0x20c363+=0x1){_0x3f420d[_0x20c363]['updateAttributes']({'exitAt':_0x54d19d});}});for(var _0x2df766=0x0;_0x2df766<_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x8b13('0x35')];_0x2df766+=0x1){db[_0x8b13('0x33')][_0x8b13('0x38')]({'where':{'channel':_0x50e535,'membername':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')],'type':_0x8b13('0x39'),'uniqueid':_0x3eb3c5['body'][_0x8b13('0x30')][_0x50e535][_0x2df766],'exitAt':null},'defaults':{'channel':_0x50e535,'membername':_0x3eb3c5['user'][_0x8b13('0x12')],'interface':_[_0x8b13('0x14')](_0x3eb3c5[_0x8b13('0x31')]['interface'])?util[_0x8b13('0x36')](_0x8b13('0x3a'),_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x12')]):_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x3b')],'type':_0x8b13('0x39'),'enterAt':moment()['format'](_0x8b13('0x37')),'role':'agent','internal':_0x3eb3c5[_0x8b13('0x31')][_0x8b13('0x3c')],'uniqueid':_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x30')][_0x50e535][_0x2df766]}});}}}}return respondWithRpcPromise(_0x8b13('0x3d'),{'id':_0x3eb3c5[_0x8b13('0x1b')]['id'],'capacity':_0x3eb3c5[_0x8b13('0x23')][_0x8b13('0x3e')]},routingClient)[_0x8b13('0x19')](respondWithResult(_0x16ec3,null))[_0x8b13('0xe')](handleError(_0x16ec3,null));};exports[_0x8b13('0x3f')]=function(_0xddac8e,_0xd55f3b){return respondWithRpcPromise(_0x8b13('0x40'),_0xddac8e[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0xd55f3b,null))[_0x8b13('0xe')](handleError(_0xd55f3b,null));};exports['trunks']=function(_0x1699c6,_0x20e89c){return respondWithRpcPromise('Trunks',_0x1699c6[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x20e89c,null))[_0x8b13('0xe')](handleError(_0x20e89c,null));};exports[_0x8b13('0x41')]=function(_0x25cb45,_0x12549b){return respondWithRpcPromise(_0x8b13('0x42'),_0x25cb45[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x12549b,null))[_0x8b13('0xe')](handleError(_0x12549b,null));};exports[_0x8b13('0x43')]=function(_0x450b47,_0x137e8c){return respondWithRpcPromise(_0x8b13('0x44'),_0x450b47[_0x8b13('0x18')],routingClient)['then'](respondWithResult(_0x137e8c,null))[_0x8b13('0xe')](handleError(_0x137e8c,null));};exports[_0x8b13('0x45')]=function(_0x47a3fa,_0x11e8af){return respondWithRpcPromise(_0x8b13('0x44'),_0x47a3fa[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x47a3fa[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x11e8af,null))[_0x8b13('0xe')](handleError(_0x11e8af,null));};exports[_0x8b13('0x46')]=function(_0x46850a,_0x52e2a6){return respondWithRpcPromise(_0x8b13('0x47'),_0x46850a[_0x8b13('0x18')],routingClient)['then'](respondWithResult(_0x52e2a6,null))[_0x8b13('0xe')](handleError(_0x52e2a6,null));};exports[_0x8b13('0x48')]=function(_0x475c8d,_0xd29067){return respondWithRpcPromise('MailQueues',_0x475c8d[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x475c8d['params']['id']))[_0x8b13('0x19')](respondWithResult(_0xd29067,null))[_0x8b13('0xe')](handleError(_0xd29067,null));};exports[_0x8b13('0x49')]=function(_0x23a63c,_0x5d05cb){return respondWithRpcPromise(_0x8b13('0x4a'),_0x23a63c[_0x8b13('0x18')],mailClient)[_0x8b13('0x19')](respondWithResult(_0x5d05cb,null))[_0x8b13('0xe')](handleError(_0x5d05cb,null));};exports[_0x8b13('0x4b')]=function(_0x2fff4e,_0x571e89){return respondWithRpcPromise(_0x8b13('0x4c'),_0x2fff4e[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x571e89,null))['catch'](handleError(_0x571e89,null));};exports[_0x8b13('0x4d')]=function(_0x576c91,_0x122ea2){return respondWithRpcPromise(_0x8b13('0x4c'),_0x576c91['query'],routingClient)['then'](findById(_0x576c91['params']['id']))['then'](respondWithResult(_0x122ea2,null))['catch'](handleError(_0x122ea2,null));};exports[_0x8b13('0x4e')]=function(_0x1bc936,_0x574f98){return respondWithRpcPromise(_0x8b13('0x4f'),_0x1bc936['query'],routingClient)[_0x8b13('0x19')](respondWithResult(_0x574f98,null))[_0x8b13('0xe')](handleError(_0x574f98,null));};exports[_0x8b13('0x50')]=function(_0x22c4d4,_0x43f12a){return respondWithRpcPromise(_0x8b13('0x4f'),_0x22c4d4[_0x8b13('0x18')],routingClient)['then'](findById(_0x22c4d4[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x43f12a,null))[_0x8b13('0xe')](handleError(_0x43f12a,null));};exports[_0x8b13('0x51')]=function(_0x207a54,_0x11a4ba){return respondWithRpcPromise(_0x8b13('0x52'),_0x207a54[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x11a4ba,null))['catch'](handleError(_0x11a4ba,null));};exports[_0x8b13('0x53')]=function(_0x5d1174,_0x2b109c){return respondWithRpcPromise(_0x8b13('0x52'),_0x5d1174[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](findById(_0x5d1174[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x2b109c,null))['catch'](handleError(_0x2b109c,null));};exports[_0x8b13('0x54')]=function(_0x37a243,_0x5ccf4e){return respondWithRpcPromise(_0x8b13('0x55'),_0x37a243[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x5ccf4e,null))['catch'](handleError(_0x5ccf4e,null));};exports[_0x8b13('0x56')]=function(_0x215a8a,_0x15ce51){return respondWithRpcPromise(_0x8b13('0x55'),_0x215a8a['query'],routingClient)[_0x8b13('0x19')](findById(_0x215a8a[_0x8b13('0x1b')]['id']))['then'](respondWithResult(_0x15ce51,null))[_0x8b13('0xe')](handleError(_0x15ce51,null));};exports[_0x8b13('0x57')]=function(_0x69e237,_0x3734e7){return respondWithRpcPromise(_0x8b13('0x58'),_0x69e237[_0x8b13('0x18')])[_0x8b13('0x19')](respondWithResult(_0x3734e7,null))[_0x8b13('0xe')](handleError(_0x3734e7,null));};exports[_0x8b13('0x59')]=function(_0x2cace0,_0x2f2bc5){return respondWithRpcPromise(_0x8b13('0x5a'),_0x2cace0[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x2f2bc5,null))['catch'](handleError(_0x2f2bc5,null));};exports[_0x8b13('0x5b')]=function(_0x578469,_0x14dee4){return respondWithRpcPromise(_0x8b13('0x5c'),_0x578469[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x14dee4,null))['catch'](handleError(_0x14dee4,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x27ad64,_0x2236b5){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x27ad64[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x2236b5,null))[_0x8b13('0xe')](handleError(_0x2236b5,null));};exports[_0x8b13('0x5d')]=function(_0x7499cb,_0x12aa48){return respondWithRpcPromise(_0x8b13('0x5e'),_0x7499cb[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](function(_0x24211c){if(_0x7499cb['query'][_0x8b13('0x5f')]!==undefined){var _0x2e7477=_(_0x24211c['rows'])[_0x8b13('0x60')]([_0x7499cb[_0x8b13('0x18')]['type'],_0x7499cb[_0x8b13('0x1b')]['id']])[_0x8b13('0x61')](_0x8b13('0x62'))[_0x8b13('0x63')]()[_0x8b13('0x64')]();return _0x24211c[_0x8b13('0x15')][_0x8b13('0x60')](function(_0x1fde8b){return _0x2e7477['indexOf'](_0x1fde8b[_0x8b13('0x62')])>-0x1;});}else{return _0x24211c[_0x8b13('0x15')][_0x8b13('0x60')](function(_0x5e2b4c){return _0x5e2b4c[_0x8b13('0x62')]===parseInt(_0x7499cb['params']['id']);});}})[_0x8b13('0x19')](respondWithResult(_0x12aa48,null))[_0x8b13('0xe')](handleError(_0x12aa48,null));};exports[_0x8b13('0x65')]=function(_0x40fefa,_0xc74525){return respondWithRpcPromise(_0x8b13('0x66'),_0x40fefa[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0xc74525,null))[_0x8b13('0xe')](handleError(_0xc74525,null));};exports[_0x8b13('0x67')]=function(_0x595f45,_0x3dc732){return respondWithRpcPromise(_0x8b13('0x68'),_0x595f45[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x3dc732,null))[_0x8b13('0xe')](handleError(_0x3dc732,null));};exports[_0x8b13('0x69')]=function(_0x2c69f5,_0x9173d){return respondWithRpcPromise(_0x8b13('0x6a'),_0x2c69f5[_0x8b13('0x18')],routingClient)[_0x8b13('0x19')](respondWithResult(_0x9173d,null))[_0x8b13('0xe')](handleError(_0x9173d,null));};exports[_0x8b13('0x6b')]=function(_0x4bb71a){return function(_0x491bf8,_0x3870a9){var _0x512f30,_0x22e10a;var _0x38a1de=_['capitalize'](_0x4bb71a);var _0x5319a1=_0x4bb71a===_0x8b13('0x6c')?_0x8b13('0x6d'):_0x8b13('0x6e');return db[_0x38a1de+_0x8b13('0x6f')][_0x8b13('0x70')]({'raw':!![],'where':{'id':_0x491bf8['params']['id']}})[_0x8b13('0x19')](function(_0x5152d0){if(_[_0x8b13('0x14')](_0x5152d0)){throw new Error(_0x38a1de+_0x8b13('0x71'));}_0x512f30=_0x5152d0;return db[_0x38a1de+'Message'][_0x8b13('0x70')]({'where':{'id':_0x491bf8[_0x8b13('0x23')][_0x8b13('0x72')]},'include':[{'model':db[_0x38a1de+_0x8b13('0x73')],'as':_0x8b13('0x73')},{'model':db[_0x38a1de+_0x5319a1],'as':'Account'}]});})[_0x8b13('0x19')](function(_0x202c12){if(_[_0x8b13('0x14')](_0x202c12)){throw new Error(_0x38a1de+'\x20Message\x20not\x20found');}_0x22e10a=_0x202c12;return _0x202c12[_0x8b13('0x74')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3bfb06={'uniqueid':_0x4bb71a+'.'+_0x22e10a['id']+'.'+_0x22e10a[_0x8b13('0x73')]['id'],'FromUserId':_0x491bf8[_0x8b13('0x31')]['id'],'type':_0x8b13('0x75')};_0x3bfb06[_0x38a1de+_0x8b13('0x76')]=_0x22e10a['id'];_0x3bfb06[_0x38a1de+_0x8b13('0x77')]=_0x22e10a[_0x8b13('0x73')]['id'];_0x3bfb06[_0x8b13('0x78')+_0x38a1de+_0x5319a1+'Id']=_0x22e10a[_0x8b13('0x6e')]['id'];_0x3bfb06['To'+_0x38a1de+_0x8b13('0x79')]=_0x512f30['id'];return db[_0x38a1de+'TransferReport'][_0x8b13('0x7a')](_0x3bfb06);})[_0x8b13('0x19')](function(){return respondWithRpcPromise(_0x8b13('0x7b'),{'channel':_0x4bb71a,'interaction':_0x22e10a[_0x8b13('0x73')],'message':_0x22e10a,'account':_0x22e10a[_0x8b13('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x512f30[_0x8b13('0x12')]+','+(_0x22e10a[_0x8b13('0x6e')][_0x8b13('0x7c')]||0x12c),'interval':_0x8b13('0x7d')}]},routingClient);})[_0x8b13('0x19')](respondWithResult(_0x3870a9,null))[_0x8b13('0xe')](handleError(_0x3870a9,null));};};exports['agentNotify']=function(_0x24005e,_0xd2b08b){var _0x556a92,_0x1b3a1b;if(_['isNil'](_0x24005e[_0x8b13('0x23')]['channel'])){throw new Error(_0x8b13('0x7e'));}var _0x291a30=_0x24005e[_0x8b13('0x23')][_0x8b13('0x7f')];var _0x13a7ea=_[_0x8b13('0x80')](_0x291a30);var _0x165813=_0x291a30===_0x8b13('0x6c')?'Website':_0x8b13('0x6e');return db[_0x8b13('0x81')]['findOne']({'raw':!![],'where':{'id':_0x24005e[_0x8b13('0x1b')]['id'],'role':_0x8b13('0x82')}})['then'](function(_0xa97f27){if(_[_0x8b13('0x14')](_0xa97f27)){throw new Error(_0x8b13('0x83'));}_0x556a92=_0xa97f27;return db[_0x13a7ea+_0x8b13('0x84')][_0x8b13('0x70')]({'where':{'id':_0x24005e['body']['messageId']},'include':[{'model':db[_0x13a7ea+_0x8b13('0x73')],'as':_0x8b13('0x73')},{'model':db[_0x13a7ea+_0x165813],'as':_0x8b13('0x6e')}]});})[_0x8b13('0x19')](function(_0xcafeff){if(_[_0x8b13('0x14')](_0xcafeff)){throw new Error(_0x13a7ea+_0x8b13('0x85'));}_0x1b3a1b=_0xcafeff;return _0xcafeff[_0x8b13('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b13('0x19')](function(){var _0xfac180={'uniqueid':_0x291a30+'.'+_0x1b3a1b['id']+'.'+_0x1b3a1b[_0x8b13('0x73')]['id'],'FromUserId':_0x24005e[_0x8b13('0x31')]['id'],'type':_0x8b13('0x75'),'ToUserId':_0x556a92['id']};_0xfac180[_0x13a7ea+_0x8b13('0x76')]=_0x1b3a1b['id'];_0xfac180[_0x13a7ea+_0x8b13('0x77')]=_0x1b3a1b[_0x8b13('0x73')]['id'];_0xfac180['From'+_0x13a7ea+_0x165813+'Id']=_0x1b3a1b[_0x8b13('0x6e')]['id'];return db[_0x13a7ea+'TransferReport'][_0x8b13('0x7a')](_0xfac180);})[_0x8b13('0x19')](function(){return respondWithRpcPromise(_0x8b13('0x7b'),{'channel':_0x291a30,'interaction':_0x1b3a1b[_0x8b13('0x73')],'message':_0x1b3a1b,'account':_0x1b3a1b[_0x8b13('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b13('0x82'),'appdata':_0x556a92[_0x8b13('0x12')]+','+(_0x1b3a1b['Account'][_0x8b13('0x86')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x8b13('0x19')](respondWithResult(_0xd2b08b,null))[_0x8b13('0xe')](handleError(_0xd2b08b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9f36097..d0be8ae 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 _0xba41=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','post','put','delete','exports','multer','util','path'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0xba41,0x19b));var _0x1ba4=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xba41[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x1ba4('0x0'));var util=require(_0x1ba4('0x1'));var path=require(_0x1ba4('0x2'));var timeout=require(_0x1ba4('0x3'));var express=require(_0x1ba4('0x4'));var router=express[_0x1ba4('0x5')]();var fs_extra=require(_0x1ba4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ba4('0x7'));var config=require('../../config/environment');var controller=require(_0x1ba4('0x8'));router[_0x1ba4('0x9')]('/',auth[_0x1ba4('0xa')](),controller['index']);router[_0x1ba4('0x9')](_0x1ba4('0xb'),auth['isAuthenticated'](),controller[_0x1ba4('0xc')]);router[_0x1ba4('0x9')](_0x1ba4('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x1ba4('0xe')]('/',auth[_0x1ba4('0xa')](),controller['create']);router[_0x1ba4('0xf')](_0x1ba4('0xb'),auth[_0x1ba4('0xa')](),controller['update']);router[_0x1ba4('0x10')](_0x1ba4('0xb'),auth[_0x1ba4('0xa')](),controller['destroy']);module[_0x1ba4('0x11')]=router; \ No newline at end of file +var _0xe21f=['express','Router','fs-extra','../../components/auth/service','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x3ec686,_0x26507a){var _0x5bdb32=function(_0x138342){while(--_0x138342){_0x3ec686['push'](_0x3ec686['shift']());}};_0x5bdb32(++_0x26507a);}(_0xe21f,0x1f1));var _0xfe21=function(_0x5de9fb,_0x4f0cc1){_0x5de9fb=_0x5de9fb-0x0;var _0x388f4f=_0xe21f[_0x5de9fb];return _0x388f4f;};'use strict';var multer=require('multer');var util=require(_0xfe21('0x0'));var path=require(_0xfe21('0x1'));var timeout=require(_0xfe21('0x2'));var express=require(_0xfe21('0x3'));var router=express[_0xfe21('0x4')]();var fs_extra=require(_0xfe21('0x5'));var auth=require(_0xfe21('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfe21('0x7'));router[_0xfe21('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe21('0x9')]);router[_0xfe21('0x8')](_0xfe21('0xa'),auth[_0xfe21('0xb')](),controller[_0xfe21('0xc')]);router['get'](_0xfe21('0xd'),auth[_0xfe21('0xb')](),controller[_0xfe21('0xe')]);router['post']('/',auth[_0xfe21('0xb')](),controller[_0xfe21('0xf')]);router[_0xfe21('0x10')]('/:id',auth[_0xfe21('0xb')](),controller[_0xfe21('0x11')]);router[_0xfe21('0x12')]('/:id',auth[_0xfe21('0xb')](),controller[_0xfe21('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a921837..ef97d09 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 _0x0ed0=['DATE','INTEGER','ENUM','years','quarters','months','hours','minutes','days','pdf','xlsx','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x7179ba,_0x37504f){var _0x4ad820=function(_0x131107){while(--_0x131107){_0x7179ba['push'](_0x7179ba['shift']());}};_0x4ad820(++_0x37504f);}(_0x0ed0,0x13e));var _0x00ed=function(_0x1931e0,_0x3aa9c1){_0x1931e0=_0x1931e0-0x0;var _0x2c95bc=_0x0ed0[_0x1931e0];return _0x2c95bc;};'use strict';var Sequelize=require(_0x00ed('0x0'));module[_0x00ed('0x1')]={'name':{'type':Sequelize[_0x00ed('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x00ed('0x2')]},'active':{'type':Sequelize[_0x00ed('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x00ed('0x4')},'startAt':{'type':Sequelize[_0x00ed('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x00ed('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x00ed('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x00ed('0x7')](_0x00ed('0x8'),_0x00ed('0x9'),_0x00ed('0xa'),'weeks','days',_0x00ed('0xb'),_0x00ed('0xc')),'allowNull':![],'defaultValue':_0x00ed('0xd')},'output':{'type':Sequelize[_0x00ed('0x7')]('csv',_0x00ed('0xe'),_0x00ed('0xf')),'allowNull':![],'defaultValue':_0x00ed('0x10')},'type':{'type':Sequelize[_0x00ed('0x7')](_0x00ed('0x11'),'default'),'allowNull':![],'defaultValue':_0x00ed('0x11')},'sendMail':{'type':Sequelize[_0x00ed('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x00ed('0x2')]},'cc':{'type':Sequelize[_0x00ed('0x12')]},'bcc':{'type':Sequelize[_0x00ed('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x00ed('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7bb6=['csv','pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','days','minutes'];(function(_0x48d99e,_0x582f55){var _0x73951f=function(_0x136c21){while(--_0x136c21){_0x48d99e['push'](_0x48d99e['shift']());}};_0x73951f(++_0x582f55);}(_0x7bb6,0x185));var _0x67bb=function(_0x5e45b1,_0x271ebe){_0x5e45b1=_0x5e45b1-0x0;var _0x5f40b2=_0x7bb6[_0x5e45b1];return _0x5f40b2;};'use strict';var Sequelize=require(_0x67bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x67bb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x67bb('0x1')]},'active':{'type':Sequelize[_0x67bb('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x67bb('0x1')],'allowNull':![],'defaultValue':_0x67bb('0x3')},'startAt':{'type':Sequelize[_0x67bb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x67bb('0x5')](_0x67bb('0x6'),_0x67bb('0x7'),_0x67bb('0x8'),'weeks',_0x67bb('0x9'),'hours',_0x67bb('0xa')),'allowNull':![],'defaultValue':_0x67bb('0x9')},'output':{'type':Sequelize[_0x67bb('0x5')](_0x67bb('0xb'),_0x67bb('0xc'),_0x67bb('0xd')),'allowNull':![],'defaultValue':_0x67bb('0xb')},'type':{'type':Sequelize['ENUM'](_0x67bb('0xe'),'default'),'allowNull':![],'defaultValue':_0x67bb('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x67bb('0x1')]},'cc':{'type':Sequelize[_0x67bb('0xf')]},'bcc':{'type':Sequelize[_0x67bb('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x67bb('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 158dec1..fdb04fa 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 _0xdf02=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','length','sort','where','pick','merge','filter','includeAll','include','Schedule','findAll','rows','catch','params','fields','options','create','body','user'];(function(_0x500d90,_0x26cd50){var _0x518136=function(_0x5bb086){while(--_0x5bb086){_0x500d90['push'](_0x500d90['shift']());}};_0x518136(++_0x26cd50);}(_0xdf02,0x1a8));var _0x2df0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdf02[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x2df0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2df0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2df0('0x2'));var moment=require(_0x2df0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2df0('0x4'));var util=require('util');var path=require(_0x2df0('0x5'));var sox=require(_0x2df0('0x6'));var csv=require('to-csv');var ejs=require(_0x2df0('0x7'));var fs=require('fs');var fs_extra=require(_0x2df0('0x8'));var _=require(_0x2df0('0x9'));var squel=require(_0x2df0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2df0('0xb'));var authService=require(_0x2df0('0xc'));var qs=require(_0x2df0('0xd'));var as=require(_0x2df0('0xe'));var hardwareService=require(_0x2df0('0xf'));var logger=require(_0x2df0('0x10'))(_0x2df0('0x11'));var utils=require(_0x2df0('0x12'));var config=require(_0x2df0('0x13'));var licenseUtil=require(_0x2df0('0x14'));var db=require(_0x2df0('0x15'))['db'];function respondWithStatusCode(_0x3f4e0d,_0xded1d4){_0xded1d4=_0xded1d4||0xcc;return function(_0x4e0c37){if(_0x4e0c37){return _0x3f4e0d[_0x2df0('0x16')](_0xded1d4);}return _0x3f4e0d['status'](_0xded1d4)[_0x2df0('0x17')]();};}function respondWithResult(_0x427dcc,_0x216d69){_0x216d69=_0x216d69||0xc8;return function(_0x48e655){if(_0x48e655){return _0x427dcc[_0x2df0('0x18')](_0x216d69)[_0x2df0('0x19')](_0x48e655);}};}function respondWithFilteredResult(_0x5a4eb5,_0x35522f){return function(_0x4d77f4){if(_0x4d77f4){var _0x4ee6bc=typeof _0x35522f[_0x2df0('0x1a')]===_0x2df0('0x1b')&&typeof _0x35522f['limit']===_0x2df0('0x1b');var _0x45f038=_0x4d77f4[_0x2df0('0x1c')];var _0x3cf9aa=_0x4ee6bc?0x0:_0x35522f[_0x2df0('0x1a')];var _0x28cf9f=_0x4ee6bc?_0x4d77f4['count']:_0x35522f[_0x2df0('0x1a')]+_0x35522f[_0x2df0('0x1d')];var _0x13ba94;if(_0x28cf9f>=_0x45f038){_0x28cf9f=_0x45f038;_0x13ba94=0xc8;}else{_0x13ba94=0xce;}_0x5a4eb5['status'](_0x13ba94);return _0x5a4eb5[_0x2df0('0x1e')](_0x2df0('0x1f'),_0x3cf9aa+'-'+_0x28cf9f+'/'+_0x45f038)[_0x2df0('0x19')](_0x4d77f4);}return null;};}function patchUpdates(_0x168a7c){return function(_0x2da035){try{jsonpatch[_0x2df0('0x20')](_0x2da035,_0x168a7c,!![]);}catch(_0x3561e5){return BPromise[_0x2df0('0x21')](_0x3561e5);}return _0x2da035[_0x2df0('0x22')]();};}function saveUpdates(_0x135181,_0x31018a){return function(_0x1909e2){if(_0x1909e2){return _0x1909e2[_0x2df0('0x23')](_0x135181)[_0x2df0('0x24')](function(_0x5388ef){return _0x5388ef;});}return null;};}function removeEntity(_0x23de8e,_0x4d1fb2){return function(_0x20fe85){if(_0x20fe85){return _0x20fe85[_0x2df0('0x25')]()['then'](function(){var _0x2cc102=_0x20fe85[_0x2df0('0x26')]({'plain':!![]});var _0x2646a4=_0x2df0('0x27');return db[_0x2df0('0x28')][_0x2df0('0x25')]({'where':{'type':_0x2646a4,'resourceId':_0x2cc102['id']}})[_0x2df0('0x24')](function(){return _0x20fe85;});})[_0x2df0('0x24')](function(){_0x23de8e[_0x2df0('0x18')](0xcc)[_0x2df0('0x17')]();});}};}function handleEntityNotFound(_0x28e39d,_0x5bc441){return function(_0xe6cc4a){if(!_0xe6cc4a){_0x28e39d['sendStatus'](0x194);}return _0xe6cc4a;};}function handleError(_0x4e65c8,_0x254e5e){_0x254e5e=_0x254e5e||0x1f4;return function(_0x3c5080){logger['error'](_0x3c5080[_0x2df0('0x29')]);if(_0x3c5080['name']){delete _0x3c5080[_0x2df0('0x2a')];}_0x4e65c8[_0x2df0('0x18')](_0x254e5e)[_0x2df0('0x2b')](_0x3c5080);};}exports[_0x2df0('0x2c')]=function(_0x4fcbcf,_0x1c7f7e){var _0x4119af={},_0x24dd9c={},_0x182002={'count':0x0,'rows':[]};var _0x413387=_['map'](db['Schedule'][_0x2df0('0x2d')],function(_0x2f2119){return{'name':_0x2f2119[_0x2df0('0x2e')],'type':_0x2f2119[_0x2df0('0x2f')][_0x2df0('0x30')]};});_0x24dd9c['model']=_[_0x2df0('0x31')](_0x413387,_0x2df0('0x2a'));_0x24dd9c['query']=_[_0x2df0('0x32')](_0x4fcbcf['query']);_0x24dd9c[_0x2df0('0x33')]=_[_0x2df0('0x34')](_0x24dd9c[_0x2df0('0x35')],_0x24dd9c[_0x2df0('0x36')]);_0x4119af[_0x2df0('0x37')]=_[_0x2df0('0x34')](_0x24dd9c['model'],qs['fields'](_0x4fcbcf[_0x2df0('0x36')]['fields']));_0x4119af[_0x2df0('0x37')]=_0x4119af[_0x2df0('0x37')][_0x2df0('0x38')]?_0x4119af[_0x2df0('0x37')]:_0x24dd9c[_0x2df0('0x35')];if(!_0x4fcbcf[_0x2df0('0x36')]['hasOwnProperty']('nolimit')){_0x4119af[_0x2df0('0x1d')]=qs[_0x2df0('0x1d')](_0x4fcbcf['query'][_0x2df0('0x1d')]);_0x4119af[_0x2df0('0x1a')]=qs[_0x2df0('0x1a')](_0x4fcbcf[_0x2df0('0x36')][_0x2df0('0x1a')]);}_0x4119af['order']=qs[_0x2df0('0x39')](_0x4fcbcf[_0x2df0('0x36')][_0x2df0('0x39')]);_0x4119af[_0x2df0('0x3a')]=qs[_0x2df0('0x33')](_[_0x2df0('0x3b')](_0x4fcbcf[_0x2df0('0x36')],_0x24dd9c['filters']),_0x413387);if(_0x4fcbcf['query']['filter']){_0x4119af[_0x2df0('0x3a')]=_[_0x2df0('0x3c')](_0x4119af[_0x2df0('0x3a')],{'$or':_['map'](_0x413387,function(_0x5c1d26){if(_0x5c1d26[_0x2df0('0x2f')]!=='VIRTUAL'){var _0xd30cac={};_0xd30cac[_0x5c1d26['name']]={'$like':'%'+_0x4fcbcf[_0x2df0('0x36')][_0x2df0('0x3d')]+'%'};return _0xd30cac;}})});}_0x4119af=_[_0x2df0('0x3c')]({},_0x4119af,_0x4fcbcf['options']);var _0x5b8eae={'where':_0x4119af[_0x2df0('0x3a')]};return db['Schedule'][_0x2df0('0x1c')](_0x5b8eae)[_0x2df0('0x24')](function(_0x5c78aa){_0x182002[_0x2df0('0x1c')]=_0x5c78aa;if(_0x4fcbcf[_0x2df0('0x36')][_0x2df0('0x3e')]){_0x4119af[_0x2df0('0x3f')]=[{'all':!![]}];}return db[_0x2df0('0x40')][_0x2df0('0x41')](_0x4119af);})[_0x2df0('0x24')](function(_0x19267d){_0x182002[_0x2df0('0x42')]=_0x19267d;return _0x182002;})[_0x2df0('0x24')](respondWithFilteredResult(_0x1c7f7e,_0x4119af))[_0x2df0('0x43')](handleError(_0x1c7f7e,null));};exports['show']=function(_0x25280b,_0x3384e1){var _0x109205={'raw':![],'where':{'id':_0x25280b[_0x2df0('0x44')]['id']}},_0x374de4={};_0x374de4[_0x2df0('0x35')]=_[_0x2df0('0x32')](db[_0x2df0('0x40')]['rawAttributes']);_0x374de4[_0x2df0('0x36')]=_['keys'](_0x25280b[_0x2df0('0x36')]);_0x374de4[_0x2df0('0x33')]=_['intersection'](_0x374de4[_0x2df0('0x35')],_0x374de4[_0x2df0('0x36')]);_0x109205[_0x2df0('0x37')]=_['intersection'](_0x374de4[_0x2df0('0x35')],qs[_0x2df0('0x45')](_0x25280b[_0x2df0('0x36')][_0x2df0('0x45')]));_0x109205[_0x2df0('0x37')]=_0x109205['attributes'][_0x2df0('0x38')]?_0x109205[_0x2df0('0x37')]:_0x374de4[_0x2df0('0x35')];if(_0x25280b['query'][_0x2df0('0x3e')]){_0x109205['include']=[{'all':!![]}];}_0x109205=_[_0x2df0('0x3c')]({},_0x109205,_0x25280b[_0x2df0('0x46')]);return db[_0x2df0('0x40')]['find'](_0x109205)[_0x2df0('0x24')](handleEntityNotFound(_0x3384e1,null))[_0x2df0('0x24')](respondWithResult(_0x3384e1,null))[_0x2df0('0x43')](handleError(_0x3384e1,null));};exports[_0x2df0('0x47')]=function(_0x20f744,_0x1396a2){return db[_0x2df0('0x40')][_0x2df0('0x47')](_0x20f744[_0x2df0('0x48')],{})[_0x2df0('0x24')](function(_0x26b339){var _0x42231a=_0x20f744[_0x2df0('0x49')]['get']({'plain':!![]});if(!_0x42231a)throw new Error(_0x2df0('0x4a'));if(_0x42231a[_0x2df0('0x4b')]===_0x2df0('0x49')){var _0x334fd0=_0x26b339[_0x2df0('0x26')]({'plain':!![]});var _0x2ba276='Scheduler';return db[_0x2df0('0x4c')][_0x2df0('0x4d')]({'where':{'name':_0x2ba276,'userProfileId':_0x42231a[_0x2df0('0x4e')]},'raw':!![]})[_0x2df0('0x24')](function(_0x205571){if(_0x205571&&_0x205571[_0x2df0('0x4f')]===0x0){return db[_0x2df0('0x28')]['create']({'name':_0x334fd0[_0x2df0('0x2a')],'resourceId':_0x334fd0['id'],'type':_0x205571[_0x2df0('0x2a')],'sectionId':_0x205571['id']},{})[_0x2df0('0x24')](function(){return _0x26b339;});}else{return _0x26b339;}})[_0x2df0('0x43')](function(_0x1893bf){logger[_0x2df0('0x50')](_0x2df0('0x51'),_0x1893bf);throw _0x1893bf;});}return _0x26b339;})[_0x2df0('0x24')](respondWithResult(_0x1396a2,0xc9))[_0x2df0('0x43')](handleError(_0x1396a2,null));};exports[_0x2df0('0x23')]=function(_0x500411,_0x5c8b1e){if(_0x500411[_0x2df0('0x48')]['id']){delete _0x500411[_0x2df0('0x48')]['id'];}return db['Schedule']['find']({'where':{'id':_0x500411['params']['id']}})['then'](handleEntityNotFound(_0x5c8b1e,null))[_0x2df0('0x24')](saveUpdates(_0x500411[_0x2df0('0x48')],null))[_0x2df0('0x24')](respondWithResult(_0x5c8b1e,null))[_0x2df0('0x43')](handleError(_0x5c8b1e,null));};exports[_0x2df0('0x25')]=function(_0x284ac0,_0x8b888){return db['Schedule'][_0x2df0('0x4d')]({'where':{'id':_0x284ac0[_0x2df0('0x44')]['id']}})[_0x2df0('0x24')](handleEntityNotFound(_0x8b888,null))['then'](removeEntity(_0x8b888,null))[_0x2df0('0x43')](handleError(_0x8b888,null));};exports[_0x2df0('0x52')]=function(_0x38ec0f,_0x103f84,_0x4c91b3){var _0x195888=require('../../config/schedule');return db[_0x2df0('0x40')]['find']({'where':{'id':_0x38ec0f[_0x2df0('0x44')]['id']},'raw':!![]})[_0x2df0('0x24')](handleEntityNotFound(_0x103f84,null))[_0x2df0('0x24')](function(){_0x195888[_0x2df0('0x52')](_0x38ec0f[_0x2df0('0x44')]['id']);})[_0x2df0('0x24')](respondWithStatusCode(_0x103f84,null))[_0x2df0('0x43')](handleError(_0x103f84,null));}; \ No newline at end of file +var _0x9507=['undefined','limit','count','set','apply','save','update','then','destroy','Scheduler','UserProfileResource','sendStatus','error','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','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','run','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x3436b7,_0x5d838d){var _0x6f2534=function(_0x26b0ce){while(--_0x26b0ce){_0x3436b7['push'](_0x3436b7['shift']());}};_0x6f2534(++_0x5d838d);}(_0x9507,0x131));var _0x7950=function(_0xe2db91,_0x94ec53){_0xe2db91=_0xe2db91-0x0;var _0x330d79=_0x9507[_0xe2db91];return _0x330d79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7950('0x0'));var zipdir=require(_0x7950('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7950('0x2'));var moment=require(_0x7950('0x3'));var BPromise=require(_0x7950('0x4'));var Mustache=require(_0x7950('0x5'));var util=require(_0x7950('0x6'));var path=require(_0x7950('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(_0x7950('0x8'));var crypto=require(_0x7950('0x9'));var jsforce=require(_0x7950('0xa'));var deskjs=require(_0x7950('0xb'));var toCsv=require(_0x7950('0xc'));var querystring=require(_0x7950('0xd'));var Papa=require(_0x7950('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7950('0xf'));var as=require(_0x7950('0x10'));var hardwareService=require(_0x7950('0x11'));var logger=require(_0x7950('0x12'))(_0x7950('0x13'));var utils=require(_0x7950('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7950('0x15'));var db=require(_0x7950('0x16'))['db'];function respondWithStatusCode(_0x11629f,_0x19ff83){_0x19ff83=_0x19ff83||0xcc;return function(_0xd90973){if(_0xd90973){return _0x11629f['sendStatus'](_0x19ff83);}return _0x11629f[_0x7950('0x17')](_0x19ff83)[_0x7950('0x18')]();};}function respondWithResult(_0x19f21b,_0x1fabc1){_0x1fabc1=_0x1fabc1||0xc8;return function(_0xb5f5db){if(_0xb5f5db){return _0x19f21b[_0x7950('0x17')](_0x1fabc1)[_0x7950('0x19')](_0xb5f5db);}};}function respondWithFilteredResult(_0x540f10,_0x172937){return function(_0x2063e6){if(_0x2063e6){var _0xfe8c5f=typeof _0x172937[_0x7950('0x1a')]===_0x7950('0x1b')&&typeof _0x172937[_0x7950('0x1c')]===_0x7950('0x1b');var _0x1ef350=_0x2063e6[_0x7950('0x1d')];var _0xe23bd4=_0xfe8c5f?0x0:_0x172937[_0x7950('0x1a')];var _0x114680=_0xfe8c5f?_0x2063e6[_0x7950('0x1d')]:_0x172937['offset']+_0x172937['limit'];var _0x370562;if(_0x114680>=_0x1ef350){_0x114680=_0x1ef350;_0x370562=0xc8;}else{_0x370562=0xce;}_0x540f10[_0x7950('0x17')](_0x370562);return _0x540f10[_0x7950('0x1e')]('Content-Range',_0xe23bd4+'-'+_0x114680+'/'+_0x1ef350)[_0x7950('0x19')](_0x2063e6);}return null;};}function patchUpdates(_0x395a21){return function(_0x7a864f){try{jsonpatch[_0x7950('0x1f')](_0x7a864f,_0x395a21,!![]);}catch(_0x49cbdc){return BPromise['reject'](_0x49cbdc);}return _0x7a864f[_0x7950('0x20')]();};}function saveUpdates(_0x318dc3,_0x355685){return function(_0x1014ed){if(_0x1014ed){return _0x1014ed[_0x7950('0x21')](_0x318dc3)[_0x7950('0x22')](function(_0x5d4396){return _0x5d4396;});}return null;};}function removeEntity(_0x54f979,_0x428391){return function(_0x94d6d1){if(_0x94d6d1){return _0x94d6d1[_0x7950('0x23')]()[_0x7950('0x22')](function(){var _0x47dcee=_0x94d6d1['get']({'plain':!![]});var _0x44095c=_0x7950('0x24');return db[_0x7950('0x25')][_0x7950('0x23')]({'where':{'type':_0x44095c,'resourceId':_0x47dcee['id']}})[_0x7950('0x22')](function(){return _0x94d6d1;});})[_0x7950('0x22')](function(){_0x54f979[_0x7950('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c1fb,_0x41b873){return function(_0x4310ef){if(!_0x4310ef){_0x50c1fb[_0x7950('0x26')](0x194);}return _0x4310ef;};}function handleError(_0x4b5da4,_0x483b56){_0x483b56=_0x483b56||0x1f4;return function(_0x1c6054){logger[_0x7950('0x27')](_0x1c6054['stack']);if(_0x1c6054[_0x7950('0x28')]){delete _0x1c6054[_0x7950('0x28')];}_0x4b5da4['status'](_0x483b56)[_0x7950('0x29')](_0x1c6054);};}exports['index']=function(_0x109cfa,_0x5a10f5){var _0x1890bd={},_0x4726da={},_0x5ab74b={'count':0x0,'rows':[]};var _0x332120=_[_0x7950('0x2a')](db[_0x7950('0x2b')][_0x7950('0x2c')],function(_0x106b9a){return{'name':_0x106b9a[_0x7950('0x2d')],'type':_0x106b9a[_0x7950('0x2e')][_0x7950('0x2f')]};});_0x4726da[_0x7950('0x30')]=_[_0x7950('0x2a')](_0x332120,_0x7950('0x28'));_0x4726da[_0x7950('0x31')]=_['keys'](_0x109cfa[_0x7950('0x31')]);_0x4726da['filters']=_['intersection'](_0x4726da['model'],_0x4726da[_0x7950('0x31')]);_0x1890bd[_0x7950('0x32')]=_[_0x7950('0x33')](_0x4726da[_0x7950('0x30')],qs['fields'](_0x109cfa[_0x7950('0x31')][_0x7950('0x34')]));_0x1890bd[_0x7950('0x32')]=_0x1890bd[_0x7950('0x32')]['length']?_0x1890bd[_0x7950('0x32')]:_0x4726da[_0x7950('0x30')];if(!_0x109cfa[_0x7950('0x31')][_0x7950('0x35')](_0x7950('0x36'))){_0x1890bd['limit']=qs[_0x7950('0x1c')](_0x109cfa[_0x7950('0x31')][_0x7950('0x1c')]);_0x1890bd['offset']=qs[_0x7950('0x1a')](_0x109cfa[_0x7950('0x31')][_0x7950('0x1a')]);}_0x1890bd[_0x7950('0x37')]=qs[_0x7950('0x38')](_0x109cfa[_0x7950('0x31')]['sort']);_0x1890bd[_0x7950('0x39')]=qs[_0x7950('0x3a')](_[_0x7950('0x3b')](_0x109cfa['query'],_0x4726da[_0x7950('0x3a')]),_0x332120);if(_0x109cfa[_0x7950('0x31')][_0x7950('0x3c')]){_0x1890bd[_0x7950('0x39')]=_[_0x7950('0x3d')](_0x1890bd[_0x7950('0x39')],{'$or':_[_0x7950('0x2a')](_0x332120,function(_0x303fa5){if(_0x303fa5[_0x7950('0x2e')]!==_0x7950('0x3e')){var _0x502e74={};_0x502e74[_0x303fa5[_0x7950('0x28')]]={'$like':'%'+_0x109cfa[_0x7950('0x31')][_0x7950('0x3c')]+'%'};return _0x502e74;}})});}_0x1890bd=_[_0x7950('0x3d')]({},_0x1890bd,_0x109cfa[_0x7950('0x3f')]);var _0x30b550={'where':_0x1890bd['where']};return db[_0x7950('0x2b')][_0x7950('0x1d')](_0x30b550)[_0x7950('0x22')](function(_0xf13d62){_0x5ab74b[_0x7950('0x1d')]=_0xf13d62;if(_0x109cfa[_0x7950('0x31')][_0x7950('0x40')]){_0x1890bd[_0x7950('0x41')]=[{'all':!![]}];}return db[_0x7950('0x2b')][_0x7950('0x42')](_0x1890bd);})[_0x7950('0x22')](function(_0x41cb88){_0x5ab74b['rows']=_0x41cb88;return _0x5ab74b;})[_0x7950('0x22')](respondWithFilteredResult(_0x5a10f5,_0x1890bd))[_0x7950('0x43')](handleError(_0x5a10f5,null));};exports[_0x7950('0x44')]=function(_0x123845,_0xec33aa){var _0xacbddb={'raw':![],'where':{'id':_0x123845[_0x7950('0x45')]['id']}},_0xe2fb70={};_0xe2fb70[_0x7950('0x30')]=_[_0x7950('0x46')](db['Schedule']['rawAttributes']);_0xe2fb70[_0x7950('0x31')]=_[_0x7950('0x46')](_0x123845['query']);_0xe2fb70[_0x7950('0x3a')]=_['intersection'](_0xe2fb70[_0x7950('0x30')],_0xe2fb70['query']);_0xacbddb[_0x7950('0x32')]=_[_0x7950('0x33')](_0xe2fb70['model'],qs[_0x7950('0x34')](_0x123845[_0x7950('0x31')][_0x7950('0x34')]));_0xacbddb['attributes']=_0xacbddb[_0x7950('0x32')][_0x7950('0x47')]?_0xacbddb['attributes']:_0xe2fb70[_0x7950('0x30')];if(_0x123845[_0x7950('0x31')][_0x7950('0x40')]){_0xacbddb[_0x7950('0x41')]=[{'all':!![]}];}_0xacbddb=_['merge']({},_0xacbddb,_0x123845[_0x7950('0x3f')]);return db[_0x7950('0x2b')][_0x7950('0x48')](_0xacbddb)[_0x7950('0x22')](handleEntityNotFound(_0xec33aa,null))['then'](respondWithResult(_0xec33aa,null))[_0x7950('0x43')](handleError(_0xec33aa,null));};exports[_0x7950('0x49')]=function(_0x99a51b,_0x3e4ac5){return db['Schedule']['create'](_0x99a51b[_0x7950('0x4a')],{})['then'](function(_0x1b79e9){var _0x1f6fe1=_0x99a51b[_0x7950('0x4b')]['get']({'plain':!![]});if(!_0x1f6fe1)throw new Error(_0x7950('0x4c'));if(_0x1f6fe1[_0x7950('0x4d')]===_0x7950('0x4b')){var _0x3662d8=_0x1b79e9['get']({'plain':!![]});var _0x22ef96=_0x7950('0x24');return db[_0x7950('0x4e')][_0x7950('0x48')]({'where':{'name':_0x22ef96,'userProfileId':_0x1f6fe1[_0x7950('0x4f')]},'raw':!![]})[_0x7950('0x22')](function(_0x573c77){if(_0x573c77&&_0x573c77[_0x7950('0x50')]===0x0){return db[_0x7950('0x25')][_0x7950('0x49')]({'name':_0x3662d8[_0x7950('0x28')],'resourceId':_0x3662d8['id'],'type':_0x573c77['name'],'sectionId':_0x573c77['id']},{})[_0x7950('0x22')](function(){return _0x1b79e9;});}else{return _0x1b79e9;}})[_0x7950('0x43')](function(_0xf26203){logger[_0x7950('0x27')](_0x7950('0x51'),_0xf26203);throw _0xf26203;});}return _0x1b79e9;})['then'](respondWithResult(_0x3e4ac5,0xc9))[_0x7950('0x43')](handleError(_0x3e4ac5,null));};exports[_0x7950('0x21')]=function(_0x4b940b,_0x4d5966){if(_0x4b940b['body']['id']){delete _0x4b940b[_0x7950('0x4a')]['id'];}return db['Schedule'][_0x7950('0x48')]({'where':{'id':_0x4b940b[_0x7950('0x45')]['id']}})[_0x7950('0x22')](handleEntityNotFound(_0x4d5966,null))[_0x7950('0x22')](saveUpdates(_0x4b940b[_0x7950('0x4a')],null))[_0x7950('0x22')](respondWithResult(_0x4d5966,null))[_0x7950('0x43')](handleError(_0x4d5966,null));};exports[_0x7950('0x23')]=function(_0x37bab0,_0x23d1d9){return db[_0x7950('0x2b')][_0x7950('0x48')]({'where':{'id':_0x37bab0[_0x7950('0x45')]['id']}})[_0x7950('0x22')](handleEntityNotFound(_0x23d1d9,null))[_0x7950('0x22')](removeEntity(_0x23d1d9,null))['catch'](handleError(_0x23d1d9,null));};exports[_0x7950('0x52')]=function(_0x697fdd,_0x2330d3,_0x5e32d7){var _0x2f35d7=require('../../config/schedule');return db[_0x7950('0x2b')][_0x7950('0x48')]({'where':{'id':_0x697fdd[_0x7950('0x45')]['id']},'raw':!![]})[_0x7950('0x22')](handleEntityNotFound(_0x2330d3,null))[_0x7950('0x22')](function(){_0x2f35d7[_0x7950('0x52')](_0x697fdd[_0x7950('0x45')]['id']);})['then'](respondWithStatusCode(_0x2330d3,null))[_0x7950('0x43')](handleError(_0x2330d3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2418017..c70e8c4 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 _0xa16f=['./schedule.attributes','exports','define','Schedule','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa16f,0x154));var _0xfa16=function(_0x3c512a,_0xb4b102){_0x3c512a=_0x3c512a-0x0;var _0x1c6c61=_0xa16f[_0x3c512a];return _0x1c6c61;};'use strict';var _=require(_0xfa16('0x0'));var util=require(_0xfa16('0x1'));var logger=require('../../config/logger')(_0xfa16('0x2'));var moment=require(_0xfa16('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa16('0x4'));var fs=require('fs');var path=require(_0xfa16('0x5'));var rimraf=require(_0xfa16('0x6'));var config=require(_0xfa16('0x7'));var attributes=require(_0xfa16('0x8'));module[_0xfa16('0x9')]=function(_0xbe0cd8,_0x6c201c){return _0xbe0cd8[_0xfa16('0xa')](_0xfa16('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x193e=['exports','define','Schedule','tools_schedules','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x193e,0x1bc));var _0xe193=function(_0x2067a6,_0x56e35f){_0x2067a6=_0x2067a6-0x0;var _0x98e07e=_0x193e[_0x2067a6];return _0x98e07e;};'use strict';var _=require(_0xe193('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe193('0x1'));var moment=require(_0xe193('0x2'));var BPromise=require(_0xe193('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe193('0x4'));var rimraf=require(_0xe193('0x5'));var config=require(_0xe193('0x6'));var attributes=require('./schedule.attributes');module[_0xe193('0x7')]=function(_0x48eab4,_0x49e051){return _0x48eab4[_0xe193('0x8')](_0xe193('0x9'),attributes,{'tableName':_0xe193('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 d5eaf60..f379a79 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 _0xa7c7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch'];(function(_0x155f3f,_0x5a8b52){var _0x3e58ab=function(_0x1ef756){while(--_0x1ef756){_0x155f3f['push'](_0x155f3f['shift']());}};_0x3e58ab(++_0x5a8b52);}(_0xa7c7,0xdc));var _0x7a7c=function(_0x1a3f2c,_0x383e44){_0x1a3f2c=_0x1a3f2c-0x0;var _0x246d37=_0xa7c7[_0x1a3f2c];return _0x246d37;};'use strict';var _=require(_0x7a7c('0x0'));var util=require(_0x7a7c('0x1'));var moment=require(_0x7a7c('0x2'));var BPromise=require(_0x7a7c('0x3'));var rs=require(_0x7a7c('0x4'));var fs=require('fs');var Redis=require(_0x7a7c('0x5'));var db=require(_0x7a7c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a7c('0x7'));var config=require(_0x7a7c('0x8'));var jayson=require(_0x7a7c('0x9'));var client=jayson[_0x7a7c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x110a9e,_0x1623ba,_0xaaf307){return new BPromise(function(_0x49a7af,_0x521e6){return client[_0x7a7c('0xb')](_0x110a9e,_0xaaf307)['then'](function(_0x375714){logger[_0x7a7c('0xc')]('Schedule,\x20%s,\x20%s',_0x1623ba,_0x7a7c('0xd'));logger[_0x7a7c('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1623ba,'request\x20sent',JSON[_0x7a7c('0xf')](_0x375714));if(_0x375714[_0x7a7c('0x10')]){if(_0x375714['error'][_0x7a7c('0x11')]===0x1f4){logger[_0x7a7c('0x10')](_0x7a7c('0x12'),_0x1623ba,_0x375714[_0x7a7c('0x10')]['message']);return _0x521e6(_0x375714['error'][_0x7a7c('0x13')]);}logger[_0x7a7c('0x10')](_0x7a7c('0x12'),_0x1623ba,_0x375714['error'][_0x7a7c('0x13')]);return _0x49a7af(_0x375714[_0x7a7c('0x10')][_0x7a7c('0x13')]);}else{logger[_0x7a7c('0xc')](_0x7a7c('0x12'),_0x1623ba,_0x7a7c('0xd'));_0x49a7af(_0x375714[_0x7a7c('0x14')]['message']);}})[_0x7a7c('0x15')](function(_0x465c27){logger[_0x7a7c('0x10')](_0x7a7c('0x12'),_0x1623ba,_0x465c27);_0x521e6(_0x465c27);});});} \ No newline at end of file +var _0xf27e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf27e,0x151));var _0xef27=function(_0x1443d6,_0x476eb6){_0x1443d6=_0x1443d6-0x0;var _0x42dece=_0xf27e[_0x1443d6];return _0x42dece;};'use strict';var _=require(_0xef27('0x0'));var util=require(_0xef27('0x1'));var moment=require(_0xef27('0x2'));var BPromise=require(_0xef27('0x3'));var rs=require(_0xef27('0x4'));var fs=require('fs');var Redis=require(_0xef27('0x5'));var db=require(_0xef27('0x6'))['db'];var utils=require(_0xef27('0x7'));var logger=require(_0xef27('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef27('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dcb55,_0x3e7318,_0x29fedd){return new BPromise(function(_0x566bb9,_0x492400){return client[_0xef27('0xa')](_0x2dcb55,_0x29fedd)['then'](function(_0x4ab9be){logger[_0xef27('0xb')](_0xef27('0xc'),_0x3e7318,_0xef27('0xd'));logger[_0xef27('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3e7318,_0xef27('0xd'),JSON[_0xef27('0xf')](_0x4ab9be));if(_0x4ab9be[_0xef27('0x10')]){if(_0x4ab9be[_0xef27('0x10')][_0xef27('0x11')]===0x1f4){logger['error'](_0xef27('0xc'),_0x3e7318,_0x4ab9be['error']['message']);return _0x492400(_0x4ab9be[_0xef27('0x10')]['message']);}logger[_0xef27('0x10')](_0xef27('0xc'),_0x3e7318,_0x4ab9be['error'][_0xef27('0x12')]);return _0x566bb9(_0x4ab9be[_0xef27('0x10')]['message']);}else{logger[_0xef27('0xb')](_0xef27('0xc'),_0x3e7318,_0xef27('0xd'));_0x566bb9(_0x4ab9be['result'][_0xef27('0x12')]);}})[_0xef27('0x13')](function(_0x5660bc){logger[_0xef27('0x10')](_0xef27('0xc'),_0x3e7318,_0x5660bc);_0x492400(_0x5660bc);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8cfa08f..0c3f7e8 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 _0xc6b7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc6b7,0x193));var _0x7c6b=function(_0x10d9bf,_0x265884){_0x10d9bf=_0x10d9bf-0x0;var _0x22cc5f=_0xc6b7[_0x10d9bf];return _0x22cc5f;};'use strict';var multer=require('multer');var util=require(_0x7c6b('0x0'));var path=require(_0x7c6b('0x1'));var timeout=require(_0x7c6b('0x2'));var express=require(_0x7c6b('0x3'));var router=express[_0x7c6b('0x4')]();var fs_extra=require(_0x7c6b('0x5'));var auth=require(_0x7c6b('0x6'));var interaction=require(_0x7c6b('0x7'));var config=require(_0x7c6b('0x8'));var controller=require(_0x7c6b('0x9'));router[_0x7c6b('0xa')]('/',auth[_0x7c6b('0xb')](),controller[_0x7c6b('0xc')]);router[_0x7c6b('0xa')](_0x7c6b('0xd'),auth[_0x7c6b('0xb')](),controller['describe']);router[_0x7c6b('0xa')](_0x7c6b('0xe'),auth[_0x7c6b('0xb')](),controller[_0x7c6b('0xf')]);router['get']('/:id/download',auth[_0x7c6b('0xb')](),controller[_0x7c6b('0x10')]);router[_0x7c6b('0x11')]('/',auth[_0x7c6b('0xb')](),controller[_0x7c6b('0x12')]);router[_0x7c6b('0x13')](_0x7c6b('0xe'),auth['isAuthenticated'](),controller[_0x7c6b('0x14')]);router[_0x7c6b('0x15')]('/:id',auth[_0x7c6b('0xb')](),controller[_0x7c6b('0x16')]);module[_0x7c6b('0x17')]=router; \ No newline at end of file +var _0xb9ba=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xb9ba,0x72));var _0xab9b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb9ba[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xab9b('0x0'));var util=require(_0xab9b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab9b('0x2'));var router=express[_0xab9b('0x3')]();var fs_extra=require(_0xab9b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab9b('0x5'));var config=require(_0xab9b('0x6'));var controller=require(_0xab9b('0x7'));router[_0xab9b('0x8')]('/',auth[_0xab9b('0x9')](),controller[_0xab9b('0xa')]);router[_0xab9b('0x8')](_0xab9b('0xb'),auth[_0xab9b('0x9')](),controller[_0xab9b('0xc')]);router[_0xab9b('0x8')](_0xab9b('0xd'),auth['isAuthenticated'](),controller[_0xab9b('0xe')]);router[_0xab9b('0x8')](_0xab9b('0xf'),auth['isAuthenticated'](),controller[_0xab9b('0x10')]);router[_0xab9b('0x11')]('/',auth[_0xab9b('0x9')](),controller[_0xab9b('0x12')]);router[_0xab9b('0x13')]('/:id',auth[_0xab9b('0x9')](),controller[_0xab9b('0x14')]);router[_0xab9b('0x15')](_0xab9b('0xd'),auth['isAuthenticated'](),controller[_0xab9b('0x16')]);module[_0xab9b('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 08c83c6..44af44c 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 _0x161a=['value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','getDataValue','MM-DD-YYYY\x20HH:mm','toString','format','updatedAt','path','../../config/environment','VIRTUAL'];(function(_0x5763c3,_0x21ac94){var _0x21099a=function(_0x35f98d){while(--_0x35f98d){_0x5763c3['push'](_0x5763c3['shift']());}};_0x21099a(++_0x21ac94);}(_0x161a,0x140));var _0xa161=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x161a[_0xb24fad];return _0x173226;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xa161('0x0'));var config=require(_0xa161('0x1'));module['exports']={'format':{'type':Sequelize[_0xa161('0x2')],'get':function(){return this['getDataValue'](_0xa161('0x3'))?path[_0xa161('0x4')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa161('0x5')]},'channel':{'type':Sequelize[_0xa161('0x5')]},'value':{'type':Sequelize[_0xa161('0x5')],'set':function(_0x8a253b){var _0x264bd0=_0x8a253b[_0xa161('0x6')](/\\/g,'/');this[_0xa161('0x7')]('value',_0x264bd0);}},'rating':{'type':Sequelize[_0xa161('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa161('0x8')],'set':function(_0x327221){this[_0xa161('0x7')](_0xa161('0x9'),moment()[_0xa161('0xa')](_0x327221,'ms'));this[_0xa161('0x7')](_0xa161('0xb'),moment());this[_0xa161('0x7')](_0xa161('0xc'),_0x327221);}},'startedAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')](_0xa161('0x9')))['format'](_0xa161('0xf'))[_0xa161('0x10')]();}},'closedAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')]('closedAt'))[_0xa161('0x11')](_0xa161('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0xa161('0xd')],'get':function(){return moment(this[_0xa161('0xe')]('createdAt'))[_0xa161('0x11')](_0xa161('0xf'))[_0xa161('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa161('0xe')](_0xa161('0x12')))[_0xa161('0x11')](_0xa161('0xf'))[_0xa161('0x10')]();}}}; \ No newline at end of file +var _0xf567=['closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract'];(function(_0x343679,_0x52d9a1){var _0x3cba0f=function(_0x59aece){while(--_0x59aece){_0x343679['push'](_0x343679['shift']());}};_0x3cba0f(++_0x52d9a1);}(_0xf567,0x118));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x7f56('0x0'));var moment=require(_0x7f56('0x1'));var path=require(_0x7f56('0x2'));var config=require('../../config/environment');module[_0x7f56('0x3')]={'format':{'type':Sequelize[_0x7f56('0x4')],'get':function(){return this['getDataValue'](_0x7f56('0x5'))?path[_0x7f56('0x6')](this[_0x7f56('0x7')](_0x7f56('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7f56('0x8')]},'value':{'type':Sequelize[_0x7f56('0x8')],'set':function(_0x1215e3){var _0x52959a=_0x1215e3[_0x7f56('0x9')](/\\/g,'/');this[_0x7f56('0xa')](_0x7f56('0x5'),_0x52959a);}},'rating':{'type':Sequelize[_0x7f56('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7f56('0xb')],'set':function(_0x3ad7d5){this[_0x7f56('0xa')](_0x7f56('0xc'),moment()[_0x7f56('0xd')](_0x3ad7d5,'ms'));this[_0x7f56('0xa')](_0x7f56('0xe'),moment());this[_0x7f56('0xa')](_0x7f56('0xf'),_0x3ad7d5);}},'startedAt':{'type':Sequelize[_0x7f56('0x10')],'get':function(){return moment(this[_0x7f56('0x7')](_0x7f56('0xc')))[_0x7f56('0x11')](_0x7f56('0x12'))[_0x7f56('0x13')]();}},'closedAt':{'type':Sequelize[_0x7f56('0x10')],'get':function(){return moment(this[_0x7f56('0x7')](_0x7f56('0xe')))['format'](_0x7f56('0x12'))[_0x7f56('0x13')]();}},'createdAt':{'type':Sequelize[_0x7f56('0x10')],'get':function(){return moment(this['getDataValue'](_0x7f56('0x14')))[_0x7f56('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x7f56('0x13')]();}},'updatedAt':{'type':Sequelize[_0x7f56('0x10')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x7f56('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x7f56('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6e409e3..4472002 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 _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x425d,0x1e0));var _0xd425=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0x425d[_0xa4928c];return _0x27cc29;};'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(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file +var _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x425d,0x1e0));var _0xd425=function(_0x2debdf,_0x14c17){_0x2debdf=_0x2debdf-0x0;var _0xdee766=_0x425d[_0x2debdf];return _0xdee766;};'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(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f46c887..0c986b3 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 _0x08e0=['exports','define','ScreenRecording','interactionid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5ebc72,_0xfabbf1){var _0x545457=function(_0x16b672){while(--_0x16b672){_0x5ebc72['push'](_0x5ebc72['shift']());}};_0x545457(++_0xfabbf1);}(_0x08e0,0xb8));var _0x008e=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x08e0[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var logger=require('../../config/logger')(_0x008e('0x2'));var moment=require(_0x008e('0x3'));var BPromise=require(_0x008e('0x4'));var rp=require(_0x008e('0x5'));var fs=require('fs');var path=require(_0x008e('0x6'));var rimraf=require('rimraf');var config=require(_0x008e('0x7'));var attributes=require('./screenRecording.attributes');module[_0x008e('0x8')]=function(_0x544a61,_0x4f42b7){return _0x544a61[_0x008e('0x9')](_0x008e('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x008e('0xb'),'fields':[_0x008e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3ab=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x2b3ac3,_0x477bba){var _0x402a36=function(_0x74b7d){while(--_0x74b7d){_0x2b3ac3['push'](_0x2b3ac3['shift']());}};_0x402a36(++_0x477bba);}(_0xc3ab,0x19a));var _0xbc3a=function(_0x57bac8,_0x52b544){_0x57bac8=_0x57bac8-0x0;var _0x508919=_0xc3ab[_0x57bac8];return _0x508919;};'use strict';var _=require(_0xbc3a('0x0'));var util=require(_0xbc3a('0x1'));var logger=require(_0xbc3a('0x2'))(_0xbc3a('0x3'));var moment=require(_0xbc3a('0x4'));var BPromise=require(_0xbc3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc3a('0x6'));var rimraf=require(_0xbc3a('0x7'));var config=require(_0xbc3a('0x8'));var attributes=require(_0xbc3a('0x9'));module[_0xbc3a('0xa')]=function(_0x24a1e9,_0x4935a7){return _0x24a1e9[_0xbc3a('0xb')](_0xbc3a('0xc'),attributes,{'tableName':_0xbc3a('0xd'),'paranoid':![],'indexes':[{'name':_0xbc3a('0xe'),'fields':[_0xbc3a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index b28b0f2..5494152 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 _0x4779=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4fa10c,_0x13b141){var _0x37f1b7=function(_0x2bcba8){while(--_0x2bcba8){_0x4fa10c['push'](_0x4fa10c['shift']());}};_0x37f1b7(++_0x13b141);}(_0x4779,0xa3));var _0x9477=function(_0x2e9e54,_0x1c434c){_0x2e9e54=_0x2e9e54-0x0;var _0x7c01da=_0x4779[_0x2e9e54];return _0x7c01da;};'use strict';var _=require(_0x9477('0x0'));var util=require(_0x9477('0x1'));var moment=require(_0x9477('0x2'));var BPromise=require('bluebird');var rs=require(_0x9477('0x3'));var fs=require('fs');var Redis=require(_0x9477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9477('0x5'));var logger=require(_0x9477('0x6'))(_0x9477('0x7'));var config=require('../../config/environment');var jayson=require(_0x9477('0x8'));var client=jayson[_0x9477('0x9')][_0x9477('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43a092,_0x22fc26,_0xbacf72){return new BPromise(function(_0x3b07d7,_0x37820e){return client[_0x9477('0xb')](_0x43a092,_0xbacf72)[_0x9477('0xc')](function(_0x5de0fc){logger[_0x9477('0xd')](_0x9477('0xe'),_0x22fc26,_0x9477('0xf'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x22fc26,_0x9477('0xf'),JSON[_0x9477('0x10')](_0x5de0fc));if(_0x5de0fc[_0x9477('0x11')]){if(_0x5de0fc['error'][_0x9477('0x12')]===0x1f4){logger['error'](_0x9477('0xe'),_0x22fc26,_0x5de0fc[_0x9477('0x11')][_0x9477('0x13')]);return _0x37820e(_0x5de0fc[_0x9477('0x11')][_0x9477('0x13')]);}logger['error'](_0x9477('0xe'),_0x22fc26,_0x5de0fc['error'][_0x9477('0x13')]);return _0x3b07d7(_0x5de0fc[_0x9477('0x11')][_0x9477('0x13')]);}else{logger[_0x9477('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x22fc26,_0x9477('0xf'));_0x3b07d7(_0x5de0fc['result'][_0x9477('0x13')]);}})[_0x9477('0x14')](function(_0x30ea54){logger['error'](_0x9477('0xe'),_0x22fc26,_0x30ea54);_0x37820e(_0x30ea54);});});} \ No newline at end of file +var _0x1230=['rpc','../../config/environment','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b620e,_0x266273){var _0x6b7008=function(_0x337322){while(--_0x337322){_0x5b620e['push'](_0x5b620e['shift']());}};_0x6b7008(++_0x266273);}(_0x1230,0x99));var _0x0123=function(_0x17516b,_0xc85d2c){_0x17516b=_0x17516b-0x0;var _0x10bbde=_0x1230[_0x17516b];return _0x10bbde;};'use strict';var _=require('lodash');var util=require(_0x0123('0x0'));var moment=require(_0x0123('0x1'));var BPromise=require(_0x0123('0x2'));var rs=require(_0x0123('0x3'));var fs=require('fs');var Redis=require(_0x0123('0x4'));var db=require(_0x0123('0x5'))['db'];var utils=require(_0x0123('0x6'));var logger=require('../../config/logger')(_0x0123('0x7'));var config=require(_0x0123('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0123('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52325c,_0x3a3b26,_0x12197a){return new BPromise(function(_0x1d0b5e,_0x1a4a88){return client[_0x0123('0xa')](_0x52325c,_0x12197a)['then'](function(_0x4c7b3b){logger['info'](_0x0123('0xb'),_0x3a3b26,_0x0123('0xc'));logger[_0x0123('0xd')](_0x0123('0xe'),_0x3a3b26,_0x0123('0xc'),JSON[_0x0123('0xf')](_0x4c7b3b));if(_0x4c7b3b[_0x0123('0x10')]){if(_0x4c7b3b[_0x0123('0x10')]['code']===0x1f4){logger[_0x0123('0x10')](_0x0123('0xb'),_0x3a3b26,_0x4c7b3b[_0x0123('0x10')][_0x0123('0x11')]);return _0x1a4a88(_0x4c7b3b[_0x0123('0x10')][_0x0123('0x11')]);}logger[_0x0123('0x10')](_0x0123('0xb'),_0x3a3b26,_0x4c7b3b[_0x0123('0x10')][_0x0123('0x11')]);return _0x1d0b5e(_0x4c7b3b[_0x0123('0x10')][_0x0123('0x11')]);}else{logger[_0x0123('0x12')](_0x0123('0xb'),_0x3a3b26,_0x0123('0xc'));_0x1d0b5e(_0x4c7b3b['result']['message']);}})[_0x0123('0x13')](function(_0x24363){logger[_0x0123('0x10')](_0x0123('0xb'),_0x3a3b26,_0x24363);_0x1a4a88(_0x24363);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 270e022..0a59570 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 _0xa4b4=['originalname','post','single','addLogo','%s%s','file','join','preferred','favicon','put','update','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','logo','extname'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0xa4b4,0x14b));var _0x4a4b=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0xa4b4[_0x4cf0b7];return _0x545f10;};'use strict';var multer=require(_0x4a4b('0x0'));var util=require(_0x4a4b('0x1'));var path=require(_0x4a4b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a4b('0x3'));var router=express[_0x4a4b('0x4')]();var fs_extra=require(_0x4a4b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a4b('0x6'));var config=require(_0x4a4b('0x7'));var controller=require(_0x4a4b('0x8'));router[_0x4a4b('0x9')]('/',auth[_0x4a4b('0xa')](),controller[_0x4a4b('0xb')]);router[_0x4a4b('0x9')](_0x4a4b('0xc'),controller[_0x4a4b('0xd')]);router[_0x4a4b('0x9')](_0x4a4b('0xe'),controller['show']);router[_0x4a4b('0x9')](_0x4a4b('0xf'),controller[_0x4a4b('0x10')]);router[_0x4a4b('0x9')](_0x4a4b('0x11'),controller[_0x4a4b('0x12')]);router['get'](_0x4a4b('0x13'),controller[_0x4a4b('0x14')]);router[_0x4a4b('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x4a4b('0x9')](_0x4a4b('0x15'),controller[_0x4a4b('0x16')]);var upload=multer({'storage':multer[_0x4a4b('0x17')]({'destination':function(_0x1d3367,_0x17b8e3,_0x1cd7ad){_0x1cd7ad(null,path['join'](config[_0x4a4b('0x18')],_0x4a4b('0x19')));},'filename':function(_0x4f0553,_0x5dc122,_0xf2975a){_0xf2975a(null,util[_0x4a4b('0x1a')]('%s%s',_0x4a4b('0x1b'),path[_0x4a4b('0x1c')](_0x5dc122[_0x4a4b('0x1d')])));}})});router[_0x4a4b('0x1e')]('/:id/logo',upload[_0x4a4b('0x1f')]('file'),controller[_0x4a4b('0x20')]);var upload=multer({'storage':multer[_0x4a4b('0x17')]({'destination':function(_0x2ab6b9,_0xb31c9,_0x31036a){_0x31036a(null,path['join'](config[_0x4a4b('0x18')],_0x4a4b('0x19')));},'filename':function(_0x18463a,_0x5a02f1,_0x201eb2){_0x201eb2(null,util[_0x4a4b('0x1a')](_0x4a4b('0x21'),'logologin',path[_0x4a4b('0x1c')](_0x5a02f1[_0x4a4b('0x1d')])));}})});router[_0x4a4b('0x1e')](_0x4a4b('0x11'),upload[_0x4a4b('0x1f')](_0x4a4b('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x4a4b('0x17')]({'destination':function(_0x40ee,_0x1c83a0,_0x3ba525){_0x3ba525(null,path[_0x4a4b('0x23')](config[_0x4a4b('0x18')],_0x4a4b('0x19')));},'filename':function(_0x1e4915,_0x9c2364,_0x3884f7){_0x3884f7(null,util[_0x4a4b('0x1a')](_0x4a4b('0x21'),_0x4a4b('0x24'),path[_0x4a4b('0x1c')](_0x9c2364[_0x4a4b('0x1d')])));}})});router[_0x4a4b('0x1e')]('/:id/preferred',upload[_0x4a4b('0x1f')](_0x4a4b('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0x4a4b('0x17')]({'destination':function(_0x38635f,_0x4fd98a,_0x39ef68){_0x39ef68(null,path[_0x4a4b('0x23')](config[_0x4a4b('0x18')],_0x4a4b('0x19')));},'filename':function(_0x1f8d2e,_0xe6d2b7,_0xc19a69){_0xc19a69(null,util[_0x4a4b('0x1a')]('%s%s',_0x4a4b('0x25'),path[_0x4a4b('0x1c')](_0xe6d2b7['originalname'])));}})});router['post'](_0x4a4b('0x15'),upload[_0x4a4b('0x1f')](_0x4a4b('0x22')),controller['addFavicon']);router[_0x4a4b('0x26')](_0x4a4b('0xe'),auth[_0x4a4b('0xa')](),controller[_0x4a4b('0x27')]);module['exports']=router; \ No newline at end of file +var _0x98ef=['join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo','logologin','originalname','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','Router','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage'];(function(_0x4a1b9a,_0x311451){var _0x233ff9=function(_0x33c780){while(--_0x33c780){_0x4a1b9a['push'](_0x4a1b9a['shift']());}};_0x233ff9(++_0x311451);}(_0x98ef,0xba));var _0xf98e=function(_0x56a405,_0x17174b){_0x56a405=_0x56a405-0x0;var _0x16010a=_0x98ef[_0x56a405];return _0x16010a;};'use strict';var multer=require(_0xf98e('0x0'));var util=require(_0xf98e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf98e('0x2')]();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(_0xf98e('0x3'));router[_0xf98e('0x4')]('/',auth[_0xf98e('0x5')](),controller[_0xf98e('0x6')]);router[_0xf98e('0x4')](_0xf98e('0x7'),controller[_0xf98e('0x8')]);router['get'](_0xf98e('0x9'),controller[_0xf98e('0xa')]);router['get'](_0xf98e('0xb'),controller[_0xf98e('0xc')]);router[_0xf98e('0x4')](_0xf98e('0xd'),controller['getLogoLogin']);router['get'](_0xf98e('0xe'),controller[_0xf98e('0xf')]);router[_0xf98e('0x4')]('/:id/preferred',controller[_0xf98e('0x10')]);router[_0xf98e('0x4')](_0xf98e('0x11'),controller['getFavicon']);var upload=multer({'storage':multer[_0xf98e('0x12')]({'destination':function(_0x41b9b2,_0x1544db,_0x5bf190){_0x5bf190(null,path[_0xf98e('0x13')](config[_0xf98e('0x14')],_0xf98e('0x15')));},'filename':function(_0x34a886,_0x3f6dd6,_0x489e84){_0x489e84(null,util[_0xf98e('0x16')](_0xf98e('0x17'),_0xf98e('0x18'),path[_0xf98e('0x19')](_0x3f6dd6['originalname'])));}})});router[_0xf98e('0x1a')]('/:id/logo',upload[_0xf98e('0x1b')](_0xf98e('0x1c')),controller[_0xf98e('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b8621,_0x28ce94,_0x41fc54){_0x41fc54(null,path[_0xf98e('0x13')](config[_0xf98e('0x14')],_0xf98e('0x15')));},'filename':function(_0x323825,_0x8ddb51,_0x3c6f5a){_0x3c6f5a(null,util[_0xf98e('0x16')]('%s%s',_0xf98e('0x1e'),path[_0xf98e('0x19')](_0x8ddb51[_0xf98e('0x1f')])));}})});router[_0xf98e('0x1a')](_0xf98e('0xd'),upload[_0xf98e('0x1b')]('file'),controller[_0xf98e('0x20')]);var upload=multer({'storage':multer[_0xf98e('0x12')]({'destination':function(_0x16944c,_0x594f7c,_0x25ecde){_0x25ecde(null,path[_0xf98e('0x13')](config['root'],_0xf98e('0x15')));},'filename':function(_0x425a05,_0x53b4da,_0xc75e63){_0xc75e63(null,util[_0xf98e('0x16')](_0xf98e('0x17'),_0xf98e('0x21'),path[_0xf98e('0x19')](_0x53b4da[_0xf98e('0x1f')])));}})});router['post'](_0xf98e('0x22'),upload[_0xf98e('0x1b')](_0xf98e('0x1c')),controller[_0xf98e('0x23')]);var upload=multer({'storage':multer[_0xf98e('0x12')]({'destination':function(_0x160c53,_0x2072ae,_0x1dfafb){_0x1dfafb(null,path['join'](config[_0xf98e('0x14')],'server/files/images/logos/'));},'filename':function(_0x4a11d8,_0x15a3c9,_0x32f14f){_0x32f14f(null,util['format'](_0xf98e('0x17'),_0xf98e('0x24'),path['extname'](_0x15a3c9[_0xf98e('0x1f')])));}})});router[_0xf98e('0x1a')](_0xf98e('0x11'),upload['single'](_0xf98e('0x1c')),controller[_0xf98e('0x25')]);router[_0xf98e('0x26')](_0xf98e('0x9'),auth[_0xf98e('0x5')](),controller[_0xf98e('0x27')]);module[_0xf98e('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9e9d6d5..690bba9 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 _0xeb3b=['sequelize','exports','INTEGER','min_internal','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeb3b,0x19e));var _0xbeb3=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0xeb3b[_0xfb65aa];return _0x2aee31;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'min_internal':{'type':Sequelize[_0xbeb3('0x2')](0xb),'unique':_0xbeb3('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xbeb3('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xbeb3('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xbeb3('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xbeb3('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xbeb3('0x4')]},'turnusername':{'type':Sequelize[_0xbeb3('0x4')]},'turnpassword':{'type':Sequelize[_0xbeb3('0x4')]},'pageTitle':{'type':Sequelize[_0xbeb3('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xbeb3('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':_0xbeb3('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':_0xbeb3('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xbeb3('0x4')]},'defaultPreferred':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xbeb3('0x4')]},'defaultFavicon':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xbeb3('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xbeb3('0x4')]},'language':{'type':Sequelize[_0xbeb3('0x4')]},'bucket':{'type':Sequelize[_0xbeb3('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xbeb3('0x2')](0x2)[_0xbeb3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xbeb3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xbeb3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0x26bd=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x26bd,0xaa));var _0xd26b=function(_0xa6ac52,_0x4ae5c9){_0xa6ac52=_0xa6ac52-0x0;var _0x355366=_0x26bd[_0xa6ac52];return _0x355366;};'use strict';var Sequelize=require(_0xd26b('0x0'));module[_0xd26b('0x1')]={'min_internal':{'type':Sequelize[_0xd26b('0x2')](0xb),'unique':_0xd26b('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xd26b('0x2')](0xb),'unique':_0xd26b('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd26b('0x5')],'defaultValue':_0xd26b('0x6')},'logo':{'type':Sequelize[_0xd26b('0x5')]},'defaultLogo':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd26b('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xd26b('0x5')]},'turnaddr':{'type':Sequelize[_0xd26b('0x5')]},'turnusername':{'type':Sequelize[_0xd26b('0x5')]},'turnpassword':{'type':Sequelize[_0xd26b('0x5')]},'pageTitle':{'type':Sequelize[_0xd26b('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd26b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd26b('0x5')],'defaultValue':_0xd26b('0x8')},'enableEmailPreview':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xd26b('0x5')],'defaultValue':_0xd26b('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd26b('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd26b('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xd26b('0x5')]},'defaultFavicon':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xd26b('0x2')]},'transcribeRegion':{'type':Sequelize[_0xd26b('0x5')]},'sentiment':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xd26b('0x5')]},'language':{'type':Sequelize[_0xd26b('0x5')]},'bucket':{'type':Sequelize[_0xd26b('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xd26b('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd26b('0x2')](0x2)[_0xd26b('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd26b('0x2')](0x2)[_0xd26b('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd26b('0x2')](0x2)[_0xd26b('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd26b('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xd26b('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xd26b('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 432bf57..7ef18d8 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 _0x48c6=['getLicense','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','favicon','defaultLoginLogo','Sequelize','ValidationError','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x48c6,0x17d));var _0x648c=function(_0x1a3cf4,_0xbfe2a0){_0x1a3cf4=_0x1a3cf4-0x0;var _0x347223=_0x48c6[_0x1a3cf4];return _0x347223;};'use strict';var emlformat=require(_0x648c('0x0'));var rimraf=require(_0x648c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x648c('0x2'));var rp=require(_0x648c('0x3'));var moment=require('moment');var BPromise=require(_0x648c('0x4'));var Mustache=require('mustache');var util=require(_0x648c('0x5'));var path=require(_0x648c('0x6'));var sox=require(_0x648c('0x7'));var csv=require(_0x648c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x648c('0x9'));var crypto=require(_0x648c('0xa'));var jsforce=require(_0x648c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x648c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x648c('0xc'));var authService=require(_0x648c('0xd'));var qs=require(_0x648c('0xe'));var as=require(_0x648c('0xf'));var hardwareService=require(_0x648c('0x10'));var logger=require(_0x648c('0x11'))(_0x648c('0x12'));var utils=require('../../config/utils');var config=require(_0x648c('0x13'));var licenseUtil=require(_0x648c('0x14'));var db=require(_0x648c('0x15'))['db'];var jayson=require(_0x648c('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f5cc1,_0x3de2b4,_0x485d5d,_0x2d0862){return new BPromise(function(_0x5105e7,_0x35f10e){var _0xf706ad=_0x2d0862||client;return _0xf706ad[_0x648c('0x17')](_0x2f5cc1,_0x485d5d)['then'](function(_0x1dd08d){logger[_0x648c('0x18')]('Setting,\x20%s,\x20%s',_0x3de2b4,_0x648c('0x19'));logger[_0x648c('0x1a')](_0x648c('0x1b'),_0x3de2b4,'request\x20sent',JSON[_0x648c('0x1c')](_0x1dd08d));if(_0x1dd08d[_0x648c('0x1d')]){if(_0x1dd08d[_0x648c('0x1d')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x3de2b4,_0x1dd08d[_0x648c('0x1d')][_0x648c('0x1e')]);return _0x35f10e(_0x1dd08d[_0x648c('0x1d')]['message']);}logger[_0x648c('0x1d')](_0x648c('0x1f'),_0x3de2b4,_0x1dd08d['error']['message']);return _0x5105e7(_0x1dd08d[_0x648c('0x1d')]['message']);}else{logger[_0x648c('0x18')]('Setting,\x20%s,\x20%s',_0x3de2b4,_0x648c('0x19'));_0x5105e7(_0x1dd08d[_0x648c('0x20')][_0x648c('0x1e')]);}})[_0x648c('0x21')](function(_0x261785){logger['error'](_0x648c('0x1f'),_0x3de2b4,_0x261785);_0x35f10e(_0x261785);});});}function respondWithStatusCode(_0x5415f7,_0x5bdfa1){_0x5bdfa1=_0x5bdfa1||0xcc;return function(_0x422b7b){if(_0x422b7b){return _0x5415f7['sendStatus'](_0x5bdfa1);}return _0x5415f7[_0x648c('0x22')](_0x5bdfa1)[_0x648c('0x23')]();};}function respondWithResult(_0x3d9d9f,_0x1a4124){_0x1a4124=_0x1a4124||0xc8;return function(_0x4bfba7){if(_0x4bfba7){return _0x3d9d9f[_0x648c('0x22')](_0x1a4124)[_0x648c('0x24')](_0x4bfba7);}};}function respondWithFilteredResult(_0xd36efd,_0x3ff637){return function(_0x2d9b30){if(_0x2d9b30){var _0x4e5223=typeof _0x3ff637['offset']===_0x648c('0x25')&&typeof _0x3ff637[_0x648c('0x26')]===_0x648c('0x25');var _0x47c2cf=_0x2d9b30[_0x648c('0x27')];var _0x5f7323=_0x4e5223?0x0:_0x3ff637[_0x648c('0x28')];var _0x6f6768=_0x4e5223?_0x2d9b30[_0x648c('0x27')]:_0x3ff637[_0x648c('0x28')]+_0x3ff637['limit'];var _0x15ea60;if(_0x6f6768>=_0x47c2cf){_0x6f6768=_0x47c2cf;_0x15ea60=0xc8;}else{_0x15ea60=0xce;}_0xd36efd[_0x648c('0x22')](_0x15ea60);return _0xd36efd[_0x648c('0x29')]('Content-Range',_0x5f7323+'-'+_0x6f6768+'/'+_0x47c2cf)['json'](_0x2d9b30);}return null;};}function patchUpdates(_0x3d6e7e){return function(_0x52db81){try{jsonpatch[_0x648c('0x2a')](_0x52db81,_0x3d6e7e,!![]);}catch(_0x4eb89c){return BPromise[_0x648c('0x2b')](_0x4eb89c);}return _0x52db81[_0x648c('0x2c')]();};}function saveUpdates(_0x410271,_0x17fda8){return function(_0x2c191b){if(_0x2c191b){return _0x2c191b[_0x648c('0x2d')](_0x410271)[_0x648c('0x2e')](function(_0x193b3b){return _0x193b3b;});}return null;};}function removeEntity(_0x4564f8,_0x567faf){return function(_0x4b0c85){if(_0x4b0c85){return _0x4b0c85['destroy']()[_0x648c('0x2e')](function(){_0x4564f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c2a2,_0x2c9950){return function(_0x4b0a27){if(!_0x4b0a27){_0x50c2a2['sendStatus'](0x194);}return _0x4b0a27;};}function handleError(_0x4505af,_0x15fefb){_0x15fefb=_0x15fefb||0x1f4;return function(_0x138c1f){logger[_0x648c('0x1d')](_0x138c1f['stack']);if(_0x138c1f[_0x648c('0x2f')]){delete _0x138c1f[_0x648c('0x2f')];}_0x4505af[_0x648c('0x22')](_0x15fefb)[_0x648c('0x30')](_0x138c1f);};}exports[_0x648c('0x31')]=function(_0x36b36f,_0xc1c72){var _0x1dbeb1={},_0x379aba={},_0x275503={'count':0x0,'rows':[]};var _0x21ec61=_[_0x648c('0x32')](db[_0x648c('0x33')][_0x648c('0x34')],function(_0x1e277d){return{'name':_0x1e277d[_0x648c('0x35')],'type':_0x1e277d['type'][_0x648c('0x36')]};});_0x379aba[_0x648c('0x37')]=_[_0x648c('0x32')](_0x21ec61,'name');_0x379aba[_0x648c('0x38')]=_[_0x648c('0x39')](_0x36b36f[_0x648c('0x38')]);_0x379aba['filters']=_[_0x648c('0x3a')](_0x379aba[_0x648c('0x37')],_0x379aba[_0x648c('0x38')]);_0x1dbeb1[_0x648c('0x3b')]=_[_0x648c('0x3a')](_0x379aba[_0x648c('0x37')],qs[_0x648c('0x3c')](_0x36b36f[_0x648c('0x38')]['fields']));_0x1dbeb1['attributes']=_0x1dbeb1[_0x648c('0x3b')][_0x648c('0x3d')]?_0x1dbeb1[_0x648c('0x3b')]:_0x379aba[_0x648c('0x37')];if(!_0x36b36f[_0x648c('0x38')][_0x648c('0x3e')](_0x648c('0x3f'))){_0x1dbeb1[_0x648c('0x26')]=qs[_0x648c('0x26')](_0x36b36f[_0x648c('0x38')][_0x648c('0x26')]);_0x1dbeb1[_0x648c('0x28')]=qs[_0x648c('0x28')](_0x36b36f[_0x648c('0x38')][_0x648c('0x28')]);}_0x1dbeb1[_0x648c('0x40')]=qs[_0x648c('0x41')](_0x36b36f['query'][_0x648c('0x41')]);_0x1dbeb1['where']=qs['filters'](_['pick'](_0x36b36f[_0x648c('0x38')],_0x379aba[_0x648c('0x42')]),_0x21ec61);if(_0x36b36f[_0x648c('0x38')][_0x648c('0x43')]){_0x1dbeb1[_0x648c('0x44')]=_[_0x648c('0x45')](_0x1dbeb1[_0x648c('0x44')],{'$or':_[_0x648c('0x32')](_0x21ec61,function(_0x486727){if(_0x486727[_0x648c('0x46')]!==_0x648c('0x47')){var _0x76b669={};_0x76b669[_0x486727[_0x648c('0x2f')]]={'$like':'%'+_0x36b36f[_0x648c('0x38')]['filter']+'%'};return _0x76b669;}})});}_0x1dbeb1=_['merge']({},_0x1dbeb1,_0x36b36f[_0x648c('0x48')]);var _0x4d2e2a={'where':_0x1dbeb1[_0x648c('0x44')]};return db['Setting']['count'](_0x4d2e2a)[_0x648c('0x2e')](function(_0x211d31){_0x275503[_0x648c('0x27')]=_0x211d31;if(_0x36b36f[_0x648c('0x38')][_0x648c('0x49')]){_0x1dbeb1[_0x648c('0x4a')]=[{'all':!![]}];}return db[_0x648c('0x33')][_0x648c('0x4b')](_0x1dbeb1);})[_0x648c('0x2e')](function(_0xa3ef71){_0x275503['rows']=_0xa3ef71;return _0x275503;})[_0x648c('0x2e')](respondWithFilteredResult(_0xc1c72,_0x1dbeb1))['catch'](handleError(_0xc1c72,null));};exports[_0x648c('0x4c')]=function(_0x35436a,_0x14e3bc){var _0x10b0c5={'raw':![],'where':{'id':_0x35436a[_0x648c('0x4d')]['id']}},_0x533b1f={};_0x533b1f['model']=_[_0x648c('0x39')](db[_0x648c('0x33')]['rawAttributes']);_0x533b1f[_0x648c('0x38')]=_[_0x648c('0x39')](_0x35436a[_0x648c('0x38')]);_0x533b1f['filters']=_[_0x648c('0x3a')](_0x533b1f[_0x648c('0x37')],_0x533b1f[_0x648c('0x38')]);_0x10b0c5[_0x648c('0x3b')]=_[_0x648c('0x3a')](_0x533b1f['model'],qs['fields'](_0x35436a[_0x648c('0x38')][_0x648c('0x3c')]));_0x10b0c5[_0x648c('0x3b')]=_0x10b0c5['attributes']['length']?_0x10b0c5[_0x648c('0x3b')]:_0x533b1f[_0x648c('0x37')];if(_0x35436a[_0x648c('0x38')][_0x648c('0x49')]){_0x10b0c5[_0x648c('0x4a')]=[{'all':!![]}];}_0x10b0c5=_[_0x648c('0x45')]({},_0x10b0c5,_0x35436a[_0x648c('0x48')]);return db[_0x648c('0x33')][_0x648c('0x4e')](_0x10b0c5)[_0x648c('0x2e')](handleEntityNotFound(_0x14e3bc,null))['then'](respondWithResult(_0x14e3bc,null))[_0x648c('0x21')](handleError(_0x14e3bc,null));};exports[_0x648c('0x2d')]=function(_0x4d7cdc,_0x5d87ad){if(_0x4d7cdc[_0x648c('0x4f')]['id']){delete _0x4d7cdc[_0x648c('0x4f')]['id'];}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x4d7cdc[_0x648c('0x4d')]['id']}})[_0x648c('0x2e')](handleEntityNotFound(_0x5d87ad,null))[_0x648c('0x2e')](saveUpdates(_0x4d7cdc[_0x648c('0x4f')],null))[_0x648c('0x2e')](respondWithResult(_0x5d87ad,null))[_0x648c('0x21')](handleError(_0x5d87ad,null));};exports[_0x648c('0x50')]=function(_0x237279,_0x193df4,_0x590a8d){if(_0x237279[_0x648c('0x51')]&&_0x237279[_0x648c('0x51')][_0x648c('0x52')]){_0x237279[_0x648c('0x4f')][_0x648c('0x53')]=_0x237279[_0x648c('0x51')][_0x648c('0x52')];}return db[_0x648c('0x33')]['find']({'where':{'id':_0x237279[_0x648c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x193df4,null))['then'](saveUpdates(_0x237279['body'],null))[_0x648c('0x2e')](respondWithResult(_0x193df4,null))['catch'](handleError(_0x193df4,null));};exports['addLogoLogin']=function(_0x2e7b12,_0x46896f,_0x4adacc){if(_0x2e7b12['file']&&_0x2e7b12[_0x648c('0x51')][_0x648c('0x52')]){_0x2e7b12['body'][_0x648c('0x54')]=_0x2e7b12[_0x648c('0x51')][_0x648c('0x52')];}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x2e7b12[_0x648c('0x4d')]['id']}})[_0x648c('0x2e')](handleEntityNotFound(_0x46896f,null))[_0x648c('0x2e')](saveUpdates(_0x2e7b12['body'],null))[_0x648c('0x2e')](respondWithResult(_0x46896f,null))[_0x648c('0x21')](handleError(_0x46896f,null));};var utilLicense=require(_0x648c('0x14'));exports[_0x648c('0x55')]=function(_0x1f34a6,_0x5e1690,_0x315513){var _0x4544f0=_0x648c('0x56');var _0x5ecd3f={'custom':![]};return utilLicense[_0x648c('0x57')]()['then'](function(_0x48ce18){if(_0x48ce18){_0x5ecd3f=_0x48ce18;}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x1f34a6['params']['id']},'attributes':[_0x648c('0x53'),_0x648c('0x54'),_0x648c('0x58'),'favicon',_0x648c('0x59'),'defaultLoginLogo',_0x648c('0x5a'),_0x648c('0x5b')],'raw':!![]});})[_0x648c('0x2e')](handleEntityNotFound(_0x5e1690,null))[_0x648c('0x2e')](function(_0x55e55f){if(_0x55e55f){var _0x130b4b=_0x55e55f[_0x648c('0x53')]&&fs[_0x648c('0x5c')](path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4544f0,_[_0x648c('0x5f')](_0x55e55f[_0x648c('0x53')])))?path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4544f0,_[_0x648c('0x5f')](_0x55e55f[_0x648c('0x53')])):path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4544f0,_[_0x648c('0x5f')](_0x648c('0x60')));var _0x35516e=_0x648c('0x61')+_[_0x648c('0x62')](_0x648c('0x53'));if(_0x55e55f[_0x35516e]||!_0x5ecd3f[_0x648c('0x63')]){_0x130b4b=path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4544f0,_['toLower'](_0x648c('0x60')));}if(!fs['existsSync'](_0x130b4b)){throw new db['Sequelize']['ValidationError'](_[_0x648c('0x62')](_0x648c('0x53'))+_0x648c('0x64'));}return _0x5e1690[_0x648c('0x65')](_0x130b4b);}})[_0x648c('0x21')](handleError(_0x5e1690,null));};var utilLicense=require(_0x648c('0x14'));exports[_0x648c('0x66')]=function(_0x46b4ac,_0x2ffa36,_0x41a167){var _0x4e9e42='server/files/images/logos';var _0x3f0ab2={'custom':![]};return utilLicense[_0x648c('0x57')]()[_0x648c('0x2e')](function(_0x4b7f22){if(_0x4b7f22){_0x3f0ab2=_0x4b7f22;}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x46b4ac[_0x648c('0x4d')]['id']},'attributes':['logo',_0x648c('0x54'),_0x648c('0x58'),_0x648c('0x67'),_0x648c('0x59'),_0x648c('0x68'),_0x648c('0x5a'),_0x648c('0x5b')],'raw':!![]});})[_0x648c('0x2e')](handleEntityNotFound(_0x2ffa36,null))['then'](function(_0x3deb7a){if(_0x3deb7a){var _0x12e9d9=_0x3deb7a[_0x648c('0x54')]&&fs[_0x648c('0x5c')](path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4e9e42,_[_0x648c('0x5f')](_0x3deb7a[_0x648c('0x54')])))?path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4e9e42,_[_0x648c('0x5f')](_0x3deb7a[_0x648c('0x54')])):path['join'](config[_0x648c('0x5e')],_0x4e9e42,_[_0x648c('0x5f')]('default_loginLogo.svg'));var _0x21f88f=_0x648c('0x61')+_['upperFirst'](_0x648c('0x54'));if(_0x3deb7a[_0x21f88f]||!_0x3f0ab2[_0x648c('0x63')]){_0x12e9d9=path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x4e9e42,_[_0x648c('0x5f')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x12e9d9)){throw new db[(_0x648c('0x69'))][(_0x648c('0x6a'))](_[_0x648c('0x62')](_0x648c('0x54'))+_0x648c('0x64'));}return _0x2ffa36[_0x648c('0x65')](_0x12e9d9);}})[_0x648c('0x21')](handleError(_0x2ffa36,null));};exports['gdpr']=function(_0x202101,_0x37f250){return db[_0x648c('0x33')]['find']({'where':{'id':_0x202101[_0x648c('0x4d')]['id']},'attributes':[_0x648c('0x6b')]})[_0x648c('0x2e')](respondWithResult(_0x37f250,null))['catch'](handleError(_0x37f250,null));};exports[_0x648c('0x6c')]=function(_0x1ff72e,_0x28976c,_0x48063c){if(_0x1ff72e[_0x648c('0x51')]&&_0x1ff72e['file'][_0x648c('0x52')]){_0x1ff72e[_0x648c('0x4f')][_0x648c('0x58')]=_0x1ff72e['file'][_0x648c('0x52')];}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x1ff72e[_0x648c('0x4d')]['id']}})[_0x648c('0x2e')](handleEntityNotFound(_0x28976c,null))[_0x648c('0x2e')](saveUpdates(_0x1ff72e[_0x648c('0x4f')],null))['then'](respondWithResult(_0x28976c,null))[_0x648c('0x21')](handleError(_0x28976c,null));};var utilLicense=require(_0x648c('0x14'));exports[_0x648c('0x6d')]=function(_0x5582ff,_0xbbd7a5,_0x2af2ed){var _0x552390=_0x648c('0x56');var _0x4e19eb={'custom':![]};return utilLicense['getLicense']()[_0x648c('0x2e')](function(_0x46743a){if(_0x46743a){_0x4e19eb=_0x46743a;}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x5582ff['params']['id']},'attributes':['logo',_0x648c('0x54'),_0x648c('0x58'),_0x648c('0x67'),_0x648c('0x59'),'defaultLoginLogo',_0x648c('0x5a'),_0x648c('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0xbbd7a5,null))[_0x648c('0x2e')](function(_0x45451e){if(_0x45451e){var _0x323729=_0x45451e['preferred']&&fs[_0x648c('0x5c')](path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x552390,_[_0x648c('0x5f')](_0x45451e[_0x648c('0x58')])))?path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x552390,_[_0x648c('0x5f')](_0x45451e[_0x648c('0x58')])):path['join'](config[_0x648c('0x5e')],_0x552390,_[_0x648c('0x5f')](_0x648c('0x6e')));var _0x4fa36d=_0x648c('0x61')+_['upperFirst']('preferred');if(_0x45451e[_0x4fa36d]||!_0x4e19eb[_0x648c('0x63')]||!_0x4e19eb['preferred']){_0x323729=path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x552390,_['toLower'](_0x648c('0x6e')));}if(!fs[_0x648c('0x5c')](_0x323729)){throw new db[(_0x648c('0x69'))]['ValidationError'](_[_0x648c('0x62')]('preferred')+_0x648c('0x64'));}return _0xbbd7a5[_0x648c('0x65')](_0x323729);}})[_0x648c('0x21')](handleError(_0xbbd7a5,null));};exports[_0x648c('0x6f')]=function(_0x4a734b,_0x43271d,_0x100fe7){if(_0x4a734b[_0x648c('0x51')]&&_0x4a734b[_0x648c('0x51')]['filename']){_0x4a734b[_0x648c('0x4f')]['favicon']=_0x4a734b['file'][_0x648c('0x52')];}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x4a734b[_0x648c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43271d,null))['then'](saveUpdates(_0x4a734b[_0x648c('0x4f')],null))['then'](respondWithResult(_0x43271d,null))[_0x648c('0x21')](handleError(_0x43271d,null));};var utilLicense=require(_0x648c('0x14'));exports['getFavicon']=function(_0x507797,_0x265576,_0x12783d){var _0x5c012a=_0x648c('0x56');var _0x255756={'custom':![]};return utilLicense[_0x648c('0x57')]()[_0x648c('0x2e')](function(_0xf16e17){if(_0xf16e17){_0x255756=_0xf16e17;}return db[_0x648c('0x33')][_0x648c('0x4e')]({'where':{'id':_0x507797['params']['id']},'attributes':['logo','loginLogo',_0x648c('0x58'),_0x648c('0x67'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x648c('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x265576,null))[_0x648c('0x2e')](function(_0x45832f){if(_0x45832f){var _0x41f5ff=_0x45832f['favicon']&&fs[_0x648c('0x5c')](path[_0x648c('0x5d')](config['root'],_0x5c012a,_[_0x648c('0x5f')](_0x45832f[_0x648c('0x67')])))?path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x5c012a,_[_0x648c('0x5f')](_0x45832f[_0x648c('0x67')])):path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x5c012a,_[_0x648c('0x5f')](_0x648c('0x70')));var _0x499a06=_0x648c('0x61')+_['upperFirst'](_0x648c('0x67'));if(_0x45832f[_0x499a06]||!_0x255756[_0x648c('0x63')]){_0x41f5ff=path[_0x648c('0x5d')](config[_0x648c('0x5e')],_0x5c012a,_[_0x648c('0x5f')](_0x648c('0x70')));}if(!fs['existsSync'](_0x41f5ff)){throw new db[(_0x648c('0x69'))][(_0x648c('0x6a'))](_['upperFirst'](_0x648c('0x67'))+_0x648c('0x64'));}return _0x265576[_0x648c('0x65')](_0x41f5ff);}})[_0x648c('0x21')](handleError(_0x265576,null));};exports[_0x648c('0x71')]=function(_0x1201a5,_0x5151a1){var _0x202acd={'offset':moment()[_0x648c('0x72')]()};_0x202acd['now']=moment()[_0x648c('0x72')](_0x202acd[_0x648c('0x28')])[_0x648c('0x73')](_0x648c('0x74'));return _0x5151a1[_0x648c('0x22')](0xc8)['send'](_0x202acd);}; \ No newline at end of file +var _0xcb06=['fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','options','Setting','includeAll','include','findAll','rows','params','find','addLogo','file','filename','body','logo','addLogoLogin','getLogo','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','download','getLogoLogin','getLicense','preferred','defaultPreferred','default_loginLogo.svg','\x20not\x20found','addPreferred','getPreferred','server/files/images/logos','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','moment','mustache','path','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','../../config/license/util','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','sendStatus','stack','name','send','index','rawAttributes'];(function(_0x83d1d4,_0x5115e3){var _0x58ce85=function(_0x1e4e41){while(--_0x1e4e41){_0x83d1d4['push'](_0x83d1d4['shift']());}};_0x58ce85(++_0x5115e3);}(_0xcb06,0x127));var _0x6cb0=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xcb06[_0x32729c];return _0x482cfd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cb0('0x0'));var rp=require('request-promise');var moment=require(_0x6cb0('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6cb0('0x2'));var util=require('util');var path=require(_0x6cb0('0x3'));var sox=require('sox');var csv=require(_0x6cb0('0x4'));var ejs=require(_0x6cb0('0x5'));var fs=require('fs');var fs_extra=require(_0x6cb0('0x6'));var _=require(_0x6cb0('0x7'));var squel=require(_0x6cb0('0x8'));var crypto=require(_0x6cb0('0x9'));var jsforce=require(_0x6cb0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6cb0('0x4'));var querystring=require(_0x6cb0('0xb'));var Papa=require(_0x6cb0('0xc'));var Redis=require(_0x6cb0('0xd'));var authService=require(_0x6cb0('0xe'));var qs=require(_0x6cb0('0xf'));var as=require(_0x6cb0('0x10'));var hardwareService=require(_0x6cb0('0x11'));var logger=require(_0x6cb0('0x12'))(_0x6cb0('0x13'));var utils=require(_0x6cb0('0x14'));var config=require(_0x6cb0('0x15'));var licenseUtil=require(_0x6cb0('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6cb0('0x17'));var client=jayson[_0x6cb0('0x18')][_0x6cb0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3c2c2a,_0x53a11d,_0x37409f,_0x3b2b85){return new BPromise(function(_0x362fd4,_0x308793){var _0x307d33=_0x3b2b85||client;return _0x307d33[_0x6cb0('0x1a')](_0x3c2c2a,_0x37409f)['then'](function(_0x7609a){logger[_0x6cb0('0x1b')](_0x6cb0('0x1c'),_0x53a11d,'request\x20sent');logger[_0x6cb0('0x1d')](_0x6cb0('0x1e'),_0x53a11d,_0x6cb0('0x1f'),JSON[_0x6cb0('0x20')](_0x7609a));if(_0x7609a[_0x6cb0('0x21')]){if(_0x7609a[_0x6cb0('0x21')]['code']===0x1f4){logger[_0x6cb0('0x21')](_0x6cb0('0x1c'),_0x53a11d,_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);return _0x308793(_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);}logger['error']('Setting,\x20%s,\x20%s',_0x53a11d,_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);return _0x362fd4(_0x7609a['error']['message']);}else{logger[_0x6cb0('0x1b')](_0x6cb0('0x1c'),_0x53a11d,_0x6cb0('0x1f'));_0x362fd4(_0x7609a['result'][_0x6cb0('0x22')]);}})[_0x6cb0('0x23')](function(_0x3d673e){logger['error'](_0x6cb0('0x1c'),_0x53a11d,_0x3d673e);_0x308793(_0x3d673e);});});}function respondWithStatusCode(_0x3182c0,_0x412eea){_0x412eea=_0x412eea||0xcc;return function(_0x3402b3){if(_0x3402b3){return _0x3182c0['sendStatus'](_0x412eea);}return _0x3182c0[_0x6cb0('0x24')](_0x412eea)[_0x6cb0('0x25')]();};}function respondWithResult(_0x4302e0,_0x4dfe76){_0x4dfe76=_0x4dfe76||0xc8;return function(_0x2c5d78){if(_0x2c5d78){return _0x4302e0[_0x6cb0('0x24')](_0x4dfe76)[_0x6cb0('0x26')](_0x2c5d78);}};}function respondWithFilteredResult(_0x328afd,_0x10e780){return function(_0x23f25b){if(_0x23f25b){var _0x4953d5=typeof _0x10e780[_0x6cb0('0x27')]===_0x6cb0('0x28')&&typeof _0x10e780[_0x6cb0('0x29')]===_0x6cb0('0x28');var _0x5be66e=_0x23f25b[_0x6cb0('0x2a')];var _0x17e55a=_0x4953d5?0x0:_0x10e780['offset'];var _0x838416=_0x4953d5?_0x23f25b['count']:_0x10e780[_0x6cb0('0x27')]+_0x10e780[_0x6cb0('0x29')];var _0x3e1e17;if(_0x838416>=_0x5be66e){_0x838416=_0x5be66e;_0x3e1e17=0xc8;}else{_0x3e1e17=0xce;}_0x328afd[_0x6cb0('0x24')](_0x3e1e17);return _0x328afd[_0x6cb0('0x2b')](_0x6cb0('0x2c'),_0x17e55a+'-'+_0x838416+'/'+_0x5be66e)[_0x6cb0('0x26')](_0x23f25b);}return null;};}function patchUpdates(_0x57a44d){return function(_0x13e9fc){try{jsonpatch['apply'](_0x13e9fc,_0x57a44d,!![]);}catch(_0x4c797e){return BPromise[_0x6cb0('0x2d')](_0x4c797e);}return _0x13e9fc['save']();};}function saveUpdates(_0x37f724,_0x62c91b){return function(_0x3f4b65){if(_0x3f4b65){return _0x3f4b65['update'](_0x37f724)[_0x6cb0('0x2e')](function(_0x56d720){return _0x56d720;});}return null;};}function removeEntity(_0x23d05d,_0x22370d){return function(_0x4a46be){if(_0x4a46be){return _0x4a46be['destroy']()[_0x6cb0('0x2e')](function(){_0x23d05d[_0x6cb0('0x24')](0xcc)[_0x6cb0('0x25')]();});}};}function handleEntityNotFound(_0x5c9867,_0x546d51){return function(_0x24a2a7){if(!_0x24a2a7){_0x5c9867[_0x6cb0('0x2f')](0x194);}return _0x24a2a7;};}function handleError(_0x260260,_0xf78022){_0xf78022=_0xf78022||0x1f4;return function(_0x588ca0){logger[_0x6cb0('0x21')](_0x588ca0[_0x6cb0('0x30')]);if(_0x588ca0['name']){delete _0x588ca0[_0x6cb0('0x31')];}_0x260260[_0x6cb0('0x24')](_0xf78022)[_0x6cb0('0x32')](_0x588ca0);};}exports[_0x6cb0('0x33')]=function(_0x26f2e8,_0xd8bf6c){var _0x3bc191={},_0xb68de7={},_0x3076fc={'count':0x0,'rows':[]};var _0x1e7d28=_['map'](db['Setting'][_0x6cb0('0x34')],function(_0x447d3b){return{'name':_0x447d3b[_0x6cb0('0x35')],'type':_0x447d3b[_0x6cb0('0x36')][_0x6cb0('0x37')]};});_0xb68de7['model']=_[_0x6cb0('0x38')](_0x1e7d28,_0x6cb0('0x31'));_0xb68de7[_0x6cb0('0x39')]=_[_0x6cb0('0x3a')](_0x26f2e8[_0x6cb0('0x39')]);_0xb68de7[_0x6cb0('0x3b')]=_[_0x6cb0('0x3c')](_0xb68de7[_0x6cb0('0x3d')],_0xb68de7['query']);_0x3bc191[_0x6cb0('0x3e')]=_[_0x6cb0('0x3c')](_0xb68de7[_0x6cb0('0x3d')],qs[_0x6cb0('0x3f')](_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x3f')]));_0x3bc191[_0x6cb0('0x3e')]=_0x3bc191[_0x6cb0('0x3e')][_0x6cb0('0x40')]?_0x3bc191['attributes']:_0xb68de7[_0x6cb0('0x3d')];if(!_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x41')]('nolimit')){_0x3bc191[_0x6cb0('0x29')]=qs['limit'](_0x26f2e8['query'][_0x6cb0('0x29')]);_0x3bc191[_0x6cb0('0x27')]=qs[_0x6cb0('0x27')](_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x27')]);}_0x3bc191[_0x6cb0('0x42')]=qs['sort'](_0x26f2e8[_0x6cb0('0x39')]['sort']);_0x3bc191[_0x6cb0('0x43')]=qs['filters'](_[_0x6cb0('0x44')](_0x26f2e8['query'],_0xb68de7[_0x6cb0('0x3b')]),_0x1e7d28);if(_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x45')]){_0x3bc191[_0x6cb0('0x43')]=_[_0x6cb0('0x46')](_0x3bc191[_0x6cb0('0x43')],{'$or':_['map'](_0x1e7d28,function(_0x2c5f28){if(_0x2c5f28[_0x6cb0('0x36')]!=='VIRTUAL'){var _0x4a7886={};_0x4a7886[_0x2c5f28[_0x6cb0('0x31')]]={'$like':'%'+_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x45')]+'%'};return _0x4a7886;}})});}_0x3bc191=_['merge']({},_0x3bc191,_0x26f2e8[_0x6cb0('0x47')]);var _0x384cd6={'where':_0x3bc191[_0x6cb0('0x43')]};return db[_0x6cb0('0x48')][_0x6cb0('0x2a')](_0x384cd6)[_0x6cb0('0x2e')](function(_0x304bf3){_0x3076fc['count']=_0x304bf3;if(_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x49')]){_0x3bc191[_0x6cb0('0x4a')]=[{'all':!![]}];}return db[_0x6cb0('0x48')][_0x6cb0('0x4b')](_0x3bc191);})[_0x6cb0('0x2e')](function(_0x495011){_0x3076fc[_0x6cb0('0x4c')]=_0x495011;return _0x3076fc;})[_0x6cb0('0x2e')](respondWithFilteredResult(_0xd8bf6c,_0x3bc191))[_0x6cb0('0x23')](handleError(_0xd8bf6c,null));};exports['show']=function(_0x5478e2,_0x10bf91){var _0xb3ff27={'raw':![],'where':{'id':_0x5478e2[_0x6cb0('0x4d')]['id']}},_0x5331c7={};_0x5331c7[_0x6cb0('0x3d')]=_[_0x6cb0('0x3a')](db[_0x6cb0('0x48')][_0x6cb0('0x34')]);_0x5331c7['query']=_[_0x6cb0('0x3a')](_0x5478e2[_0x6cb0('0x39')]);_0x5331c7[_0x6cb0('0x3b')]=_[_0x6cb0('0x3c')](_0x5331c7[_0x6cb0('0x3d')],_0x5331c7[_0x6cb0('0x39')]);_0xb3ff27[_0x6cb0('0x3e')]=_[_0x6cb0('0x3c')](_0x5331c7['model'],qs[_0x6cb0('0x3f')](_0x5478e2[_0x6cb0('0x39')][_0x6cb0('0x3f')]));_0xb3ff27[_0x6cb0('0x3e')]=_0xb3ff27[_0x6cb0('0x3e')][_0x6cb0('0x40')]?_0xb3ff27[_0x6cb0('0x3e')]:_0x5331c7[_0x6cb0('0x3d')];if(_0x5478e2[_0x6cb0('0x39')]['includeAll']){_0xb3ff27['include']=[{'all':!![]}];}_0xb3ff27=_[_0x6cb0('0x46')]({},_0xb3ff27,_0x5478e2[_0x6cb0('0x47')]);return db['Setting']['find'](_0xb3ff27)['then'](handleEntityNotFound(_0x10bf91,null))[_0x6cb0('0x2e')](respondWithResult(_0x10bf91,null))['catch'](handleError(_0x10bf91,null));};exports['update']=function(_0x480683,_0x8c8d0c){if(_0x480683['body']['id']){delete _0x480683['body']['id'];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x480683[_0x6cb0('0x4d')]['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x8c8d0c,null))[_0x6cb0('0x2e')](saveUpdates(_0x480683['body'],null))[_0x6cb0('0x2e')](respondWithResult(_0x8c8d0c,null))[_0x6cb0('0x23')](handleError(_0x8c8d0c,null));};exports[_0x6cb0('0x4f')]=function(_0x31e754,_0x454238,_0x286ad9){if(_0x31e754[_0x6cb0('0x50')]&&_0x31e754[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x31e754[_0x6cb0('0x52')][_0x6cb0('0x53')]=_0x31e754[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db['Setting'][_0x6cb0('0x4e')]({'where':{'id':_0x31e754[_0x6cb0('0x4d')]['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x454238,null))[_0x6cb0('0x2e')](saveUpdates(_0x31e754['body'],null))[_0x6cb0('0x2e')](respondWithResult(_0x454238,null))[_0x6cb0('0x23')](handleError(_0x454238,null));};exports[_0x6cb0('0x54')]=function(_0x11283c,_0x3d5081,_0x255110){if(_0x11283c[_0x6cb0('0x50')]&&_0x11283c[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x11283c[_0x6cb0('0x52')]['loginLogo']=_0x11283c[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db['Setting']['find']({'where':{'id':_0x11283c['params']['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x3d5081,null))[_0x6cb0('0x2e')](saveUpdates(_0x11283c[_0x6cb0('0x52')],null))[_0x6cb0('0x2e')](respondWithResult(_0x3d5081,null))[_0x6cb0('0x23')](handleError(_0x3d5081,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x55')]=function(_0x5ec5aa,_0x455278,_0x3f0588){var _0x529395='server/files/images/logos';var _0x5736cd={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x563c63){if(_0x563c63){_0x5736cd=_0x563c63;}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x5ec5aa['params']['id']},'attributes':[_0x6cb0('0x53'),_0x6cb0('0x56'),'preferred',_0x6cb0('0x57'),_0x6cb0('0x58'),_0x6cb0('0x59'),'defaultPreferred',_0x6cb0('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x455278,null))[_0x6cb0('0x2e')](function(_0x1c70dd){if(_0x1c70dd){var _0x16e640=_0x1c70dd[_0x6cb0('0x53')]&&fs['existsSync'](path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x529395,_[_0x6cb0('0x5d')](_0x1c70dd['logo'])))?path['join'](config[_0x6cb0('0x5c')],_0x529395,_[_0x6cb0('0x5d')](_0x1c70dd[_0x6cb0('0x53')])):path['join'](config['root'],_0x529395,_[_0x6cb0('0x5d')](_0x6cb0('0x5e')));var _0x20d78f=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x53'));if(_0x1c70dd[_0x20d78f]||!_0x5736cd[_0x6cb0('0x61')]){_0x16e640=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x529395,_['toLower']('default_logo.svg'));}if(!fs[_0x6cb0('0x62')](_0x16e640)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')](_0x6cb0('0x53'))+'\x20not\x20found');}return _0x455278[_0x6cb0('0x65')](_0x16e640);}})[_0x6cb0('0x23')](handleError(_0x455278,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x66')]=function(_0x250d3b,_0x386127,_0x3efe68){var _0x426003='server/files/images/logos';var _0x59390a={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x31b07a){if(_0x31b07a){_0x59390a=_0x31b07a;}return db['Setting']['find']({'where':{'id':_0x250d3b['params']['id']},'attributes':['logo','loginLogo',_0x6cb0('0x68'),_0x6cb0('0x57'),_0x6cb0('0x58'),'defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x386127,null))[_0x6cb0('0x2e')](function(_0x709772){if(_0x709772){var _0x35ecf9=_0x709772[_0x6cb0('0x56')]&&fs[_0x6cb0('0x62')](path[_0x6cb0('0x5b')](config['root'],_0x426003,_['toLower'](_0x709772['loginLogo'])))?path['join'](config[_0x6cb0('0x5c')],_0x426003,_['toLower'](_0x709772[_0x6cb0('0x56')])):path['join'](config[_0x6cb0('0x5c')],_0x426003,_[_0x6cb0('0x5d')](_0x6cb0('0x6a')));var _0x2462db=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x56'));if(_0x709772[_0x2462db]||!_0x59390a[_0x6cb0('0x61')]){_0x35ecf9=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x426003,_[_0x6cb0('0x5d')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x35ecf9)){throw new db['Sequelize']['ValidationError'](_[_0x6cb0('0x60')]('loginLogo')+_0x6cb0('0x6b'));}return _0x386127[_0x6cb0('0x65')](_0x35ecf9);}})[_0x6cb0('0x23')](handleError(_0x386127,null));};exports['gdpr']=function(_0x18d748,_0x5e880a){return db[_0x6cb0('0x48')]['find']({'where':{'id':_0x18d748[_0x6cb0('0x4d')]['id']},'attributes':['securePassword']})[_0x6cb0('0x2e')](respondWithResult(_0x5e880a,null))[_0x6cb0('0x23')](handleError(_0x5e880a,null));};exports[_0x6cb0('0x6c')]=function(_0x28fb20,_0x2a07cd,_0x59e34f){if(_0x28fb20['file']&&_0x28fb20[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x28fb20[_0x6cb0('0x52')][_0x6cb0('0x68')]=_0x28fb20[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x28fb20['params']['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x2a07cd,null))['then'](saveUpdates(_0x28fb20['body'],null))['then'](respondWithResult(_0x2a07cd,null))[_0x6cb0('0x23')](handleError(_0x2a07cd,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x6d')]=function(_0x3acba1,_0x5b8026,_0x130e82){var _0x49f408=_0x6cb0('0x6e');var _0x522f8b={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x36cbf6){if(_0x36cbf6){_0x522f8b=_0x36cbf6;}return db['Setting'][_0x6cb0('0x4e')]({'where':{'id':_0x3acba1[_0x6cb0('0x4d')]['id']},'attributes':['logo',_0x6cb0('0x56'),'preferred',_0x6cb0('0x57'),'defaultLogo','defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})[_0x6cb0('0x2e')](handleEntityNotFound(_0x5b8026,null))[_0x6cb0('0x2e')](function(_0x151597){if(_0x151597){var _0xb5d208=_0x151597[_0x6cb0('0x68')]&&fs[_0x6cb0('0x62')](path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')](_0x151597[_0x6cb0('0x68')])))?path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')](_0x151597[_0x6cb0('0x68')])):path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')]('default_preferred.png'));var _0x4f1006=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x68'));if(_0x151597[_0x4f1006]||!_0x522f8b[_0x6cb0('0x61')]||!_0x522f8b[_0x6cb0('0x68')]){_0xb5d208=path[_0x6cb0('0x5b')](config['root'],_0x49f408,_['toLower']('default_preferred.png'));}if(!fs[_0x6cb0('0x62')](_0xb5d208)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')]('preferred')+'\x20not\x20found');}return _0x5b8026[_0x6cb0('0x65')](_0xb5d208);}})[_0x6cb0('0x23')](handleError(_0x5b8026,null));};exports['addFavicon']=function(_0x14effc,_0x229308,_0x107dd4){if(_0x14effc[_0x6cb0('0x50')]&&_0x14effc[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x14effc[_0x6cb0('0x52')][_0x6cb0('0x57')]=_0x14effc[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x14effc[_0x6cb0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x229308,null))[_0x6cb0('0x2e')](saveUpdates(_0x14effc[_0x6cb0('0x52')],null))['then'](respondWithResult(_0x229308,null))[_0x6cb0('0x23')](handleError(_0x229308,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x1c5251,_0x1d95cd,_0x8f379){var _0x1919f3=_0x6cb0('0x6e');var _0x5f08a2={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x5188a2){if(_0x5188a2){_0x5f08a2=_0x5188a2;}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x1c5251[_0x6cb0('0x4d')]['id']},'attributes':[_0x6cb0('0x53'),_0x6cb0('0x56'),'preferred','favicon',_0x6cb0('0x58'),'defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})[_0x6cb0('0x2e')](handleEntityNotFound(_0x1d95cd,null))[_0x6cb0('0x2e')](function(_0x2215d4){if(_0x2215d4){var _0x21f67f=_0x2215d4['favicon']&&fs['existsSync'](path['join'](config['root'],_0x1919f3,_[_0x6cb0('0x5d')](_0x2215d4[_0x6cb0('0x57')])))?path['join'](config['root'],_0x1919f3,_['toLower'](_0x2215d4[_0x6cb0('0x57')])):path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x1919f3,_[_0x6cb0('0x5d')](_0x6cb0('0x6f')));var _0x1678d2=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x57'));if(_0x2215d4[_0x1678d2]||!_0x5f08a2['custom']){_0x21f67f=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x1919f3,_['toLower'](_0x6cb0('0x6f')));}if(!fs[_0x6cb0('0x62')](_0x21f67f)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')](_0x6cb0('0x57'))+'\x20not\x20found');}return _0x1d95cd[_0x6cb0('0x65')](_0x21f67f);}})['catch'](handleError(_0x1d95cd,null));};exports[_0x6cb0('0x70')]=function(_0x2c1e8c,_0x11384b){var _0x1952d4={'offset':moment()[_0x6cb0('0x71')]()};_0x1952d4['now']=moment()[_0x6cb0('0x71')](_0x1952d4[_0x6cb0('0x27')])[_0x6cb0('0x72')](_0x6cb0('0x73'));return _0x11384b[_0x6cb0('0x24')](0xc8)[_0x6cb0('0x32')](_0x1952d4);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d7e3d48..9febc1e 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x5087b7,_0x117485){var _0x3b4c2b=function(_0x3d25db){while(--_0x3d25db){_0x5087b7['push'](_0x5087b7['shift']());}};_0x3b4c2b(++_0x117485);}(_0x008c,0x188));var _0xc008=function(_0x4f3522,_0x3e9fb){_0x4f3522=_0x4f3522-0x0;var _0x5b4de7=_0x008c[_0x4f3522];return _0x5b4de7;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7baa790..d97f223 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 _0x1d05=['raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','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','result','catch','ShowSetting','Setting','find','options'];(function(_0x3611ca,_0x27085e){var _0xb7fc99=function(_0x269a1c){while(--_0x269a1c){_0x3611ca['push'](_0x3611ca['shift']());}};_0xb7fc99(++_0x27085e);}(_0x1d05,0xed));var _0x51d0=function(_0x23d8f8,_0x79bff5){_0x23d8f8=_0x23d8f8-0x0;var _0x34019c=_0x1d05[_0x23d8f8];return _0x34019c;};'use strict';var _=require(_0x51d0('0x0'));var util=require(_0x51d0('0x1'));var moment=require(_0x51d0('0x2'));var BPromise=require(_0x51d0('0x3'));var rs=require(_0x51d0('0x4'));var fs=require('fs');var Redis=require(_0x51d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51d0('0x6'))(_0x51d0('0x7'));var config=require('../../config/environment');var jayson=require(_0x51d0('0x8'));var client=jayson[_0x51d0('0x9')][_0x51d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c9a27,_0x581cdc,_0xc9aeb0){return new BPromise(function(_0x1d5250,_0x33b136){return client['request'](_0x3c9a27,_0xc9aeb0)[_0x51d0('0xb')](function(_0x4937a3){logger[_0x51d0('0xc')](_0x51d0('0xd'),_0x581cdc,'request\x20sent');logger[_0x51d0('0xe')](_0x51d0('0xf'),_0x581cdc,_0x51d0('0x10'),JSON[_0x51d0('0x11')](_0x4937a3));if(_0x4937a3[_0x51d0('0x12')]){if(_0x4937a3[_0x51d0('0x12')][_0x51d0('0x13')]===0x1f4){logger[_0x51d0('0x12')](_0x51d0('0xd'),_0x581cdc,_0x4937a3[_0x51d0('0x12')]['message']);return _0x33b136(_0x4937a3['error']['message']);}logger['error'](_0x51d0('0xd'),_0x581cdc,_0x4937a3[_0x51d0('0x12')][_0x51d0('0x14')]);return _0x1d5250(_0x4937a3[_0x51d0('0x12')][_0x51d0('0x14')]);}else{logger[_0x51d0('0xc')](_0x51d0('0xd'),_0x581cdc,_0x51d0('0x10'));_0x1d5250(_0x4937a3[_0x51d0('0x15')][_0x51d0('0x14')]);}})[_0x51d0('0x16')](function(_0x19204d){logger[_0x51d0('0x12')](_0x51d0('0xd'),_0x581cdc,_0x19204d);_0x33b136(_0x19204d);});});}exports[_0x51d0('0x17')]=function(_0x46f0e5){var _0x11cd15=this;return new Promise(function(_0x1e1c65,_0x34102d){return db[_0x51d0('0x18')][_0x51d0('0x19')]({'raw':_0x46f0e5['options']?_0x46f0e5[_0x51d0('0x1a')][_0x51d0('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f0e5[_0x51d0('0x1a')]?_0x46f0e5['options'][_0x51d0('0x1c')]||null:null,'attributes':_0x46f0e5[_0x51d0('0x1a')]?_0x46f0e5[_0x51d0('0x1a')][_0x51d0('0x1d')]||null:null,'include':_0x46f0e5[_0x51d0('0x1a')]?_0x46f0e5[_0x51d0('0x1a')]['include']?_[_0x51d0('0x1e')](_0x46f0e5[_0x51d0('0x1a')][_0x51d0('0x1f')],function(_0x3869f6){return{'model':db[_0x3869f6[_0x51d0('0x20')]],'as':_0x3869f6['as'],'attributes':_0x3869f6[_0x51d0('0x1d')],'include':_0x3869f6['include']?_['map'](_0x3869f6[_0x51d0('0x1f')],function(_0x589141){return{'model':db[_0x589141[_0x51d0('0x20')]],'as':_0x589141['as'],'attributes':_0x589141[_0x51d0('0x1d')],'include':_0x589141[_0x51d0('0x1f')]?_[_0x51d0('0x1e')](_0x589141['include'],function(_0x2bae33){return{'model':db[_0x2bae33[_0x51d0('0x20')]],'as':_0x2bae33['as'],'attributes':_0x2bae33[_0x51d0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x51d0('0xb')](function(_0x188369){logger['info'](_0x51d0('0x17'),_0x46f0e5);logger[_0x51d0('0xe')](_0x51d0('0x17'),_0x46f0e5,JSON[_0x51d0('0x11')](_0x188369));_0x1e1c65(_0x188369);})[_0x51d0('0x16')](function(_0x3c2932){logger[_0x51d0('0x12')](_0x51d0('0x17'),_0x3c2932[_0x51d0('0x14')],_0x46f0e5);_0x34102d(_0x11cd15[_0x51d0('0x12')](0x1f4,_0x3c2932[_0x51d0('0x14')]));});});}; \ No newline at end of file +var _0x46ab=['where','include','map','model','attributes','ShowSetting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','Setting','options','raw'];(function(_0x534cea,_0x1df56d){var _0xa42b30=function(_0x56eb6e){while(--_0x56eb6e){_0x534cea['push'](_0x534cea['shift']());}};_0xa42b30(++_0x1df56d);}(_0x46ab,0x1f0));var _0xb46a=function(_0xfd7f0a,_0x49f296){_0xfd7f0a=_0xfd7f0a-0x0;var _0x7514f=_0x46ab[_0xfd7f0a];return _0x7514f;};'use strict';var _=require(_0xb46a('0x0'));var util=require(_0xb46a('0x1'));var moment=require(_0xb46a('0x2'));var BPromise=require(_0xb46a('0x3'));var rs=require(_0xb46a('0x4'));var fs=require('fs');var Redis=require(_0xb46a('0x5'));var db=require(_0xb46a('0x6'))['db'];var utils=require(_0xb46a('0x7'));var logger=require(_0xb46a('0x8'))('rpc');var config=require(_0xb46a('0x9'));var jayson=require(_0xb46a('0xa'));var client=jayson[_0xb46a('0xb')][_0xb46a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cd757,_0xc5f287,_0x3e08a8){return new BPromise(function(_0x5e6a74,_0x110366){return client[_0xb46a('0xd')](_0x1cd757,_0x3e08a8)[_0xb46a('0xe')](function(_0x3dcb7d){logger[_0xb46a('0xf')]('Setting,\x20%s,\x20%s',_0xc5f287,'request\x20sent');logger[_0xb46a('0x10')](_0xb46a('0x11'),_0xc5f287,_0xb46a('0x12'),JSON[_0xb46a('0x13')](_0x3dcb7d));if(_0x3dcb7d[_0xb46a('0x14')]){if(_0x3dcb7d[_0xb46a('0x14')][_0xb46a('0x15')]===0x1f4){logger[_0xb46a('0x14')](_0xb46a('0x16'),_0xc5f287,_0x3dcb7d[_0xb46a('0x14')][_0xb46a('0x17')]);return _0x110366(_0x3dcb7d[_0xb46a('0x14')][_0xb46a('0x17')]);}logger[_0xb46a('0x14')]('Setting,\x20%s,\x20%s',_0xc5f287,_0x3dcb7d['error'][_0xb46a('0x17')]);return _0x5e6a74(_0x3dcb7d[_0xb46a('0x14')][_0xb46a('0x17')]);}else{logger['info'](_0xb46a('0x16'),_0xc5f287,'request\x20sent');_0x5e6a74(_0x3dcb7d[_0xb46a('0x18')]['message']);}})[_0xb46a('0x19')](function(_0x3f1e4f){logger[_0xb46a('0x14')](_0xb46a('0x16'),_0xc5f287,_0x3f1e4f);_0x110366(_0x3f1e4f);});});}exports['ShowSetting']=function(_0x4f865d){var _0x1f22c9=this;return new Promise(function(_0x46aae7,_0x55044c){return db[_0xb46a('0x1a')]['find']({'raw':_0x4f865d[_0xb46a('0x1b')]?_0x4f865d[_0xb46a('0x1b')][_0xb46a('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f865d[_0xb46a('0x1b')]?_0x4f865d['options'][_0xb46a('0x1d')]||null:null,'attributes':_0x4f865d[_0xb46a('0x1b')]?_0x4f865d[_0xb46a('0x1b')]['attributes']||null:null,'include':_0x4f865d[_0xb46a('0x1b')]?_0x4f865d[_0xb46a('0x1b')][_0xb46a('0x1e')]?_[_0xb46a('0x1f')](_0x4f865d[_0xb46a('0x1b')][_0xb46a('0x1e')],function(_0x619691){return{'model':db[_0x619691[_0xb46a('0x20')]],'as':_0x619691['as'],'attributes':_0x619691['attributes'],'include':_0x619691[_0xb46a('0x1e')]?_['map'](_0x619691[_0xb46a('0x1e')],function(_0xd17d13){return{'model':db[_0xd17d13[_0xb46a('0x20')]],'as':_0xd17d13['as'],'attributes':_0xd17d13[_0xb46a('0x21')],'include':_0xd17d13[_0xb46a('0x1e')]?_[_0xb46a('0x1f')](_0xd17d13['include'],function(_0x3c581e){return{'model':db[_0x3c581e['model']],'as':_0x3c581e['as'],'attributes':_0x3c581e[_0xb46a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb46a('0xe')](function(_0x2e6d57){logger[_0xb46a('0xf')]('ShowSetting',_0x4f865d);logger[_0xb46a('0x10')](_0xb46a('0x22'),_0x4f865d,JSON['stringify'](_0x2e6d57));_0x46aae7(_0x2e6d57);})[_0xb46a('0x19')](function(_0x4eb212){logger[_0xb46a('0x14')]('ShowSetting',_0x4eb212['message'],_0x4f865d);_0x55044c(_0x1f22c9[_0xb46a('0x14')](0x1f4,_0x4eb212[_0xb46a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index fafedfe..0ed7336 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x2888aa,_0x383487){var _0x2aa568=function(_0x5d4e83){while(--_0x5d4e83){_0x2888aa['push'](_0x2888aa['shift']());}};_0x2aa568(++_0x383487);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x7fbe[_0x32b4aa];return _0x473160;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x11a111,_0x4cbd71){_0x11a111=_0x11a111-0x0;var _0x5119df=_0xf494[_0x11a111];return _0x5119df;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index bcec3b1..1a15bf0 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 _0xc706=['STRING','name','generate','ENUM','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xc706,0x6c));var _0x6c70=function(_0x55eddc,_0x5cd2cc){_0x55eddc=_0x55eddc-0x0;var _0x3aba8c=_0xc706[_0x55eddc];return _0x3aba8c;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x6c70('0x0')],'unique':_0x6c70('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x6c70('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x6c70('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0x6c70('0x0')],'defaultValue':function(){return rs[_0x6c70('0x2')]();}},'phone':{'type':Sequelize[_0x6c70('0x0')]},'type':{'type':Sequelize[_0x6c70('0x3')]('twilio','skebby',_0x6c70('0x4'),_0x6c70('0x5'),'plivo',_0x6c70('0x6'),_0x6c70('0x7'),_0x6c70('0x8'),_0x6c70('0x9'),_0x6c70('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x6c70('0x0')]},'smsMethod':{'type':Sequelize[_0x6c70('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6c70('0x0')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x6c70('0x0')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x6c70('0x0')]},'senderString':{'type':Sequelize[_0x6c70('0x0')]},'deliveryReport':{'type':Sequelize[_0x6c70('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x6c70('0x0')]},'notificationTemplate':{'type':Sequelize[_0x6c70('0xc')],'defaultValue':function(){return _0x6c70('0xd');}},'notificationSound':{'type':Sequelize[_0x6c70('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6c70('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6c70('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6c70('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6c70('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6c70('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6c70('0xb')],'defaultValue':![],'comment':_0x6c70('0xf'),'set':function(_0x57e2b3){if(!_0x57e2b3)this['setDataValue'](_0x6c70('0x10'),null);this['setDataValue'](_0x6c70('0x11'),_0x57e2b3);}}}; \ No newline at end of file +var _0x1dcc=['randomstring','exports','STRING','ENUM','skebby','connectel','clicksend','plivo','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1dcc,0x1a2));var _0xc1dc=function(_0x168d65,_0x14d39f){_0x168d65=_0x168d65-0x0;var _0x948ddb=_0x1dcc[_0x168d65];return _0x948ddb;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc1dc('0x0'));module[_0xc1dc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc1dc('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xc1dc('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc1dc('0x2')]},'type':{'type':Sequelize[_0xc1dc('0x3')]('twilio',_0xc1dc('0x4'),_0xc1dc('0x5'),_0xc1dc('0x6'),_0xc1dc('0x7'),'clickatell',_0xc1dc('0x8'),_0xc1dc('0x9'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xc1dc('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc1dc('0x2')]},'smsMethod':{'type':Sequelize[_0xc1dc('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc1dc('0x2')]},'password':{'type':Sequelize[_0xc1dc('0x2')]},'apiKey':{'type':Sequelize[_0xc1dc('0x2')]},'applicationId':{'type':Sequelize[_0xc1dc('0x2')]},'accountId':{'type':Sequelize[_0xc1dc('0x2')]},'senderString':{'type':Sequelize[_0xc1dc('0x2')]},'deliveryReport':{'type':Sequelize[_0xc1dc('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xc1dc('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc1dc('0xb')],'defaultValue':function(){return _0xc1dc('0xc');}},'notificationSound':{'type':Sequelize[_0xc1dc('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc1dc('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc1dc('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc1dc('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc1dc('0xd')],'comment':_0xc1dc('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc1dc('0xf'),'set':function(_0x4c08c0){if(!_0x4c08c0)this['setDataValue'](_0xc1dc('0x10'),null);this[_0xc1dc('0x11')](_0xc1dc('0x12'),_0x4c08c0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 60b6d86..a6413ca 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 _0xff61=['includeAll','findAll','rows','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','nolimit','pick','SmsAccountId','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','SmsMessage','ContactId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','findOne','User','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','dataValues','Messages','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL'];(function(_0x45bb15,_0x5b17b8){var _0x90347e=function(_0x1f6b21){while(--_0x1f6b21){_0x45bb15['push'](_0x45bb15['shift']());}};_0x90347e(++_0x5b17b8);}(_0xff61,0x180));var _0x1ff6=function(_0x18e54c,_0x2644da){_0x18e54c=_0x18e54c-0x0;var _0x509aa2=_0xff61[_0x18e54c];return _0x509aa2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ff6('0x0'));var zipdir=require(_0x1ff6('0x1'));var jsonpatch=require(_0x1ff6('0x2'));var rp=require(_0x1ff6('0x3'));var moment=require(_0x1ff6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ff6('0x5'));var util=require(_0x1ff6('0x6'));var path=require(_0x1ff6('0x7'));var sox=require(_0x1ff6('0x8'));var csv=require('to-csv');var ejs=require(_0x1ff6('0x9'));var fs=require('fs');var fs_extra=require(_0x1ff6('0xa'));var _=require(_0x1ff6('0xb'));var squel=require(_0x1ff6('0xc'));var crypto=require('crypto');var jsforce=require(_0x1ff6('0xd'));var deskjs=require(_0x1ff6('0xe'));var toCsv=require(_0x1ff6('0xf'));var querystring=require('querystring');var Papa=require(_0x1ff6('0x10'));var Redis=require(_0x1ff6('0x11'));var authService=require(_0x1ff6('0x12'));var qs=require(_0x1ff6('0x13'));var as=require(_0x1ff6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ff6('0x15'))(_0x1ff6('0x16'));var utils=require(_0x1ff6('0x17'));var config=require(_0x1ff6('0x18'));var licenseUtil=require(_0x1ff6('0x19'));var db=require(_0x1ff6('0x1a'))['db'];config[_0x1ff6('0x1b')]=_['defaults'](config[_0x1ff6('0x1b')],{'host':_0x1ff6('0x1c'),'port':0x18eb});var socket=require(_0x1ff6('0x1d'))(new Redis(config[_0x1ff6('0x1b')]));require(_0x1ff6('0x1e'))[_0x1ff6('0x1f')](socket);var jayson=require(_0x1ff6('0x20'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x26e274,_0x46b8b9,_0x58226c,_0xb0a294){return new BPromise(function(_0x178213,_0x331986){var _0x48931d=_0xb0a294||client;return _0x48931d[_0x1ff6('0x21')](_0x26e274,_0x58226c)[_0x1ff6('0x22')](function(_0x2ab034){logger[_0x1ff6('0x23')](_0x1ff6('0x24'),_0x46b8b9,_0x1ff6('0x25'));logger[_0x1ff6('0x26')](_0x1ff6('0x27'),_0x46b8b9,_0x1ff6('0x25'),JSON[_0x1ff6('0x28')](_0x2ab034));if(_0x2ab034[_0x1ff6('0x29')]){if(_0x2ab034['error'][_0x1ff6('0x2a')]===0x1f4){logger['error'](_0x1ff6('0x24'),_0x46b8b9,_0x2ab034['error'][_0x1ff6('0x2b')]);return _0x331986(_0x2ab034[_0x1ff6('0x29')][_0x1ff6('0x2b')]);}logger[_0x1ff6('0x29')]('SmsAccount,\x20%s,\x20%s',_0x46b8b9,_0x2ab034[_0x1ff6('0x29')]['message']);return _0x178213(_0x2ab034[_0x1ff6('0x29')][_0x1ff6('0x2b')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x46b8b9,_0x1ff6('0x25'));_0x178213(_0x2ab034['result'][_0x1ff6('0x2b')]);}})[_0x1ff6('0x2c')](function(_0x317ed0){logger[_0x1ff6('0x29')](_0x1ff6('0x24'),_0x46b8b9,_0x317ed0);_0x331986(_0x317ed0);});});}function respondWithStatusCode(_0x1a7383,_0x2b2168){_0x2b2168=_0x2b2168||0xcc;return function(_0xa737be){if(_0xa737be){return _0x1a7383[_0x1ff6('0x2d')](_0x2b2168);}return _0x1a7383[_0x1ff6('0x2e')](_0x2b2168)[_0x1ff6('0x2f')]();};}function respondWithResult(_0x4b0f9f,_0x12599a){_0x12599a=_0x12599a||0xc8;return function(_0x560cea){if(_0x560cea){return _0x4b0f9f[_0x1ff6('0x2e')](_0x12599a)[_0x1ff6('0x30')](_0x560cea);}};}function respondWithFilteredResult(_0xf48ff4,_0x2b4171){return function(_0x190e1a){if(_0x190e1a){var _0x2497b5=typeof _0x2b4171['offset']===_0x1ff6('0x31')&&typeof _0x2b4171[_0x1ff6('0x32')]===_0x1ff6('0x31');var _0x4d6a19=_0x190e1a[_0x1ff6('0x33')];var _0x53cbb8=_0x2497b5?0x0:_0x2b4171[_0x1ff6('0x34')];var _0x449e3c=_0x2497b5?_0x190e1a[_0x1ff6('0x33')]:_0x2b4171['offset']+_0x2b4171[_0x1ff6('0x32')];var _0x120468;if(_0x449e3c>=_0x4d6a19){_0x449e3c=_0x4d6a19;_0x120468=0xc8;}else{_0x120468=0xce;}_0xf48ff4[_0x1ff6('0x2e')](_0x120468);return _0xf48ff4[_0x1ff6('0x35')](_0x1ff6('0x36'),_0x53cbb8+'-'+_0x449e3c+'/'+_0x4d6a19)[_0x1ff6('0x30')](_0x190e1a);}return null;};}function patchUpdates(_0x507775){return function(_0xd372d0){try{jsonpatch[_0x1ff6('0x37')](_0xd372d0,_0x507775,!![]);}catch(_0x2fc75e){return BPromise['reject'](_0x2fc75e);}return _0xd372d0[_0x1ff6('0x38')]();};}function saveUpdates(_0x3c95b4,_0x3614cb){return function(_0x12ded4){if(_0x12ded4){return _0x12ded4[_0x1ff6('0x39')](_0x3c95b4)['then'](function(_0x5b32b9){return _0x5b32b9;});}return null;};}function removeEntity(_0x4e93d5,_0x168185){return function(_0x1da5b2){if(_0x1da5b2){return _0x1da5b2[_0x1ff6('0x3a')]()[_0x1ff6('0x22')](function(){var _0x277be5=_0x1da5b2[_0x1ff6('0x3b')]({'plain':!![]});var _0x1e53b2=_0x1ff6('0x3c');return db[_0x1ff6('0x3d')][_0x1ff6('0x3a')]({'where':{'type':_0x1e53b2,'resourceId':_0x277be5['id']}})[_0x1ff6('0x22')](function(){return _0x1da5b2;});})[_0x1ff6('0x22')](function(){_0x4e93d5[_0x1ff6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4e9e,_0x3ffe40){return function(_0x41bd58){if(!_0x41bd58){_0x1e4e9e[_0x1ff6('0x2d')](0x194);}return _0x41bd58;};}function handleError(_0x494978,_0x5228e1){_0x5228e1=_0x5228e1||0x1f4;return function(_0x11617f){logger[_0x1ff6('0x29')](_0x11617f[_0x1ff6('0x3e')]);if(_0x11617f['name']){delete _0x11617f['name'];}_0x494978['status'](_0x5228e1)['send'](_0x11617f);};}exports[_0x1ff6('0x3f')]=function(_0x4a68d7,_0x351adc){var _0x425f81={'include':[{'model':db[_0x1ff6('0x40')],'as':_0x1ff6('0x41')}]},_0xf06423={},_0x17f342={'count':0x0,'rows':[]};var _0x22a172=_['map'](db[_0x1ff6('0x42')][_0x1ff6('0x43')],function(_0x354851){return{'name':_0x354851[_0x1ff6('0x44')],'type':_0x354851[_0x1ff6('0x45')][_0x1ff6('0x46')]};});_0xf06423[_0x1ff6('0x47')]=_['map'](_0x22a172,_0x1ff6('0x48'));_0xf06423[_0x1ff6('0x49')]=_[_0x1ff6('0x4a')](_0x4a68d7[_0x1ff6('0x49')]);_0xf06423[_0x1ff6('0x4b')]=_['intersection'](_0xf06423[_0x1ff6('0x47')],_0xf06423[_0x1ff6('0x49')]);_0x425f81['attributes']=_[_0x1ff6('0x4c')](_0xf06423[_0x1ff6('0x47')],qs['fields'](_0x4a68d7[_0x1ff6('0x49')][_0x1ff6('0x4d')]));_0x425f81['attributes']=_0x425f81['attributes'][_0x1ff6('0x4e')]?_0x425f81[_0x1ff6('0x4f')]:_0xf06423['model'];if(!_0x4a68d7[_0x1ff6('0x49')][_0x1ff6('0x50')]('nolimit')){_0x425f81[_0x1ff6('0x32')]=qs[_0x1ff6('0x32')](_0x4a68d7['query']['limit']);_0x425f81[_0x1ff6('0x34')]=qs[_0x1ff6('0x34')](_0x4a68d7['query']['offset']);}_0x425f81[_0x1ff6('0x51')]=qs[_0x1ff6('0x52')](_0x4a68d7[_0x1ff6('0x49')][_0x1ff6('0x52')]);_0x425f81[_0x1ff6('0x53')]=qs['filters'](_['pick'](_0x4a68d7[_0x1ff6('0x49')],_0xf06423[_0x1ff6('0x4b')]),_0x22a172);if(_0x4a68d7[_0x1ff6('0x49')][_0x1ff6('0x54')]){_0x425f81[_0x1ff6('0x53')]=_[_0x1ff6('0x55')](_0x425f81['where'],{'$or':_[_0x1ff6('0x56')](_0x22a172,function(_0x5b79b4){if(_0x5b79b4[_0x1ff6('0x45')]!==_0x1ff6('0x57')){var _0x4e206b={};_0x4e206b[_0x5b79b4['name']]={'$like':'%'+_0x4a68d7['query']['filter']+'%'};return _0x4e206b;}})});}_0x425f81=_[_0x1ff6('0x55')]({},_0x425f81,_0x4a68d7['options']);var _0x172672={'where':_0x425f81[_0x1ff6('0x53')]};return db[_0x1ff6('0x42')][_0x1ff6('0x33')](_0x172672)[_0x1ff6('0x22')](function(_0x4a8533){_0x17f342[_0x1ff6('0x33')]=_0x4a8533;if(_0x4a68d7['query'][_0x1ff6('0x58')]){_0x425f81['include']=[{'all':!![]}];}return db['SmsAccount'][_0x1ff6('0x59')](_0x425f81);})[_0x1ff6('0x22')](function(_0x1d2ebf){_0x17f342[_0x1ff6('0x5a')]=_0x1d2ebf;return _0x17f342;})[_0x1ff6('0x22')](respondWithFilteredResult(_0x351adc,_0x425f81))[_0x1ff6('0x2c')](handleError(_0x351adc,null));};exports[_0x1ff6('0x5b')]=function(_0xb931fe,_0x31e274){var _0x5197c1={'raw':![],'where':{'id':_0xb931fe['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x29f961={};_0x29f961['model']=_['keys'](db[_0x1ff6('0x42')][_0x1ff6('0x43')]);_0x29f961['query']=_['keys'](_0xb931fe[_0x1ff6('0x49')]);_0x29f961[_0x1ff6('0x4b')]=_['intersection'](_0x29f961[_0x1ff6('0x47')],_0x29f961[_0x1ff6('0x49')]);_0x5197c1[_0x1ff6('0x4f')]=_['intersection'](_0x29f961[_0x1ff6('0x47')],qs[_0x1ff6('0x4d')](_0xb931fe[_0x1ff6('0x49')][_0x1ff6('0x4d')]));_0x5197c1[_0x1ff6('0x4f')]=_0x5197c1[_0x1ff6('0x4f')][_0x1ff6('0x4e')]?_0x5197c1[_0x1ff6('0x4f')]:_0x29f961[_0x1ff6('0x47')];if(_0xb931fe[_0x1ff6('0x49')]['includeAll']){_0x5197c1[_0x1ff6('0x5c')]=[{'all':!![]}];}_0x5197c1=_[_0x1ff6('0x55')]({},_0x5197c1,_0xb931fe['options']);return db['SmsAccount'][_0x1ff6('0x5d')](_0x5197c1)[_0x1ff6('0x22')](handleEntityNotFound(_0x31e274,null))['then'](respondWithResult(_0x31e274,null))[_0x1ff6('0x2c')](handleError(_0x31e274,null));};exports[_0x1ff6('0x5e')]=function(_0x349f14,_0x4d58a6){return db[_0x1ff6('0x42')][_0x1ff6('0x5e')](_0x349f14[_0x1ff6('0x5f')],{})['then'](function(_0x5ce177){var _0x390a90=_0x349f14[_0x1ff6('0x60')][_0x1ff6('0x3b')]({'plain':!![]});if(!_0x390a90)throw new Error(_0x1ff6('0x61'));if(_0x390a90[_0x1ff6('0x62')]===_0x1ff6('0x60')){var _0x6a1e4b=_0x5ce177[_0x1ff6('0x3b')]({'plain':!![]});var _0x2f139c=_0x1ff6('0x3c');return db[_0x1ff6('0x63')][_0x1ff6('0x5d')]({'where':{'name':_0x2f139c,'userProfileId':_0x390a90['userProfileId']},'raw':!![]})[_0x1ff6('0x22')](function(_0x1ea030){if(_0x1ea030&&_0x1ea030[_0x1ff6('0x64')]===0x0){return db['UserProfileResource'][_0x1ff6('0x5e')]({'name':_0x6a1e4b['name'],'resourceId':_0x6a1e4b['id'],'type':_0x1ea030[_0x1ff6('0x48')],'sectionId':_0x1ea030['id']},{})[_0x1ff6('0x22')](function(){return _0x5ce177;});}else{return _0x5ce177;}})[_0x1ff6('0x2c')](function(_0x461925){logger[_0x1ff6('0x29')](_0x1ff6('0x65'),_0x461925);throw _0x461925;});}return _0x5ce177;})['then'](respondWithResult(_0x4d58a6,0xc9))[_0x1ff6('0x2c')](handleError(_0x4d58a6,null));};exports['update']=function(_0x1714a3,_0x579735){if(_0x1714a3[_0x1ff6('0x5f')]['id']){delete _0x1714a3['body']['id'];}return db['SmsAccount'][_0x1ff6('0x5d')]({'where':{'id':_0x1714a3[_0x1ff6('0x66')]['id']},'include':[{'model':db['Pause'],'as':_0x1ff6('0x41')}]})[_0x1ff6('0x22')](handleEntityNotFound(_0x579735,null))[_0x1ff6('0x22')](saveUpdates(_0x1714a3[_0x1ff6('0x5f')],null))[_0x1ff6('0x22')](respondWithResult(_0x579735,null))[_0x1ff6('0x2c')](handleError(_0x579735,null));};exports[_0x1ff6('0x3a')]=function(_0x53d9a3,_0x36fc8f){return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x53d9a3[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x36fc8f,null))['then'](removeEntity(_0x36fc8f,null))['catch'](handleError(_0x36fc8f,null));};exports['describe']=function(_0x21e77c,_0x4bec6a){return db[_0x1ff6('0x42')][_0x1ff6('0x67')]()[_0x1ff6('0x22')](respondWithResult(_0x4bec6a,null))['catch'](handleError(_0x4bec6a,null));};exports[_0x1ff6('0x68')]=function(_0x3ffda1,_0x45cd58,_0x1f4561){if(_0x3ffda1[_0x1ff6('0x5f')]['id']){delete _0x3ffda1['body']['id'];}return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x3ffda1[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x45cd58,null))[_0x1ff6('0x22')](function(_0x599961){if(_0x599961){_0x3ffda1[_0x1ff6('0x5f')]['SmsAccountId']=_0x599961['id'];return db[_0x1ff6('0x69')][_0x1ff6('0x5e')](_0x3ffda1[_0x1ff6('0x5f')]);}})['then'](respondWithResult(_0x45cd58,null))['catch'](handleError(_0x45cd58,null));};exports[_0x1ff6('0x6a')]=function(_0x198c91,_0x32478f,_0x4645e4){var _0x504654={'raw':![],'where':{}};var _0x24bc5a={};var _0x2534ab={'count':0x0,'rows':[]};return db[_0x1ff6('0x42')]['findOne']({'where':{'id':_0x198c91['params']['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x32478f,null))['then'](function(_0x5442ba){if(_0x5442ba){_0x24bc5a[_0x1ff6('0x47')]=_['keys'](db['Disposition']['rawAttributes']);_0x24bc5a[_0x1ff6('0x49')]=_['keys'](_0x198c91[_0x1ff6('0x49')]);_0x24bc5a[_0x1ff6('0x4b')]=_[_0x1ff6('0x4c')](_0x24bc5a['model'],_0x24bc5a[_0x1ff6('0x49')]);_0x504654['attributes']=_['intersection'](_0x24bc5a[_0x1ff6('0x47')],qs['fields'](_0x198c91['query'][_0x1ff6('0x4d')]));_0x504654[_0x1ff6('0x4f')]=_0x504654['attributes'][_0x1ff6('0x4e')]?_0x504654[_0x1ff6('0x4f')]:_0x24bc5a[_0x1ff6('0x47')];if(!_0x198c91[_0x1ff6('0x49')][_0x1ff6('0x50')](_0x1ff6('0x6b'))){_0x504654[_0x1ff6('0x32')]=qs[_0x1ff6('0x32')](_0x198c91['query'][_0x1ff6('0x32')]);_0x504654[_0x1ff6('0x34')]=qs['offset'](_0x198c91[_0x1ff6('0x49')]['offset']);}_0x504654[_0x1ff6('0x51')]=qs['sort'](_0x198c91['query'][_0x1ff6('0x52')]);_0x504654[_0x1ff6('0x53')]=qs[_0x1ff6('0x4b')](_[_0x1ff6('0x6c')](_0x198c91['query'],_0x24bc5a[_0x1ff6('0x4b')]));_0x504654[_0x1ff6('0x53')][_0x1ff6('0x6d')]=_0x5442ba['id'];if(_0x198c91['query'][_0x1ff6('0x54')]){_0x504654['where']=_[_0x1ff6('0x55')](_0x504654['where'],{'$or':_[_0x1ff6('0x56')](_0x504654[_0x1ff6('0x4f')],function(_0x589f74){var _0x342f60={};_0x342f60[_0x589f74]={'$like':'%'+_0x198c91['query'][_0x1ff6('0x54')]+'%'};return _0x342f60;})});}_0x504654=_[_0x1ff6('0x55')]({},_0x504654,_0x198c91[_0x1ff6('0x6e')]);return db[_0x1ff6('0x69')]['count']({'where':_0x504654['where']})[_0x1ff6('0x22')](function(_0x4d317b){_0x2534ab[_0x1ff6('0x33')]=_0x4d317b;if(_0x198c91[_0x1ff6('0x49')][_0x1ff6('0x58')]){_0x504654[_0x1ff6('0x5c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x504654);})[_0x1ff6('0x22')](function(_0x5df71b){_0x2534ab[_0x1ff6('0x5a')]=_0x5df71b;return _0x2534ab;});}})['then'](respondWithFilteredResult(_0x32478f,_0x504654))[_0x1ff6('0x2c')](handleError(_0x32478f,null));};exports[_0x1ff6('0x6f')]=function(_0x2dca5f,_0x283b07,_0x1977b6){return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x2dca5f[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x283b07,null))[_0x1ff6('0x22')](function(_0x188285){if(_0x188285){return _0x188285['removeDispositions'](_0x2dca5f[_0x1ff6('0x49')][_0x1ff6('0x70')]);}})[_0x1ff6('0x22')](respondWithStatusCode(_0x283b07,null))[_0x1ff6('0x2c')](handleError(_0x283b07,null));};exports[_0x1ff6('0x71')]=function(_0x574b3d,_0x2c0637,_0x1ab276){if(_0x574b3d[_0x1ff6('0x5f')]['id']){delete _0x574b3d[_0x1ff6('0x5f')]['id'];}return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x574b3d[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x2c0637,null))[_0x1ff6('0x22')](function(_0x233baf){if(_0x233baf){_0x574b3d['body']['SmsAccountId']=_0x233baf['id'];return db[_0x1ff6('0x72')]['create'](_0x574b3d[_0x1ff6('0x5f')]);}})[_0x1ff6('0x22')](respondWithResult(_0x2c0637,null))['catch'](handleError(_0x2c0637,null));};exports[_0x1ff6('0x73')]=function(_0x4ef4e0,_0x984936,_0x538e31){var _0x5e224a={'raw':![],'where':{}};var _0x51324a={};var _0x298913={'count':0x0,'rows':[]};return db[_0x1ff6('0x42')]['findOne']({'where':{'id':_0x4ef4e0[_0x1ff6('0x66')]['id']}})['then'](handleEntityNotFound(_0x984936,null))[_0x1ff6('0x22')](function(_0x25d482){if(_0x25d482){_0x51324a[_0x1ff6('0x47')]=_['keys'](db[_0x1ff6('0x72')][_0x1ff6('0x43')]);_0x51324a['query']=_[_0x1ff6('0x4a')](_0x4ef4e0[_0x1ff6('0x49')]);_0x51324a['filters']=_['intersection'](_0x51324a[_0x1ff6('0x47')],_0x51324a[_0x1ff6('0x49')]);_0x5e224a['attributes']=_[_0x1ff6('0x4c')](_0x51324a[_0x1ff6('0x47')],qs['fields'](_0x4ef4e0['query'][_0x1ff6('0x4d')]));_0x5e224a[_0x1ff6('0x4f')]=_0x5e224a[_0x1ff6('0x4f')][_0x1ff6('0x4e')]?_0x5e224a[_0x1ff6('0x4f')]:_0x51324a[_0x1ff6('0x47')];if(!_0x4ef4e0['query'][_0x1ff6('0x50')]('nolimit')){_0x5e224a[_0x1ff6('0x32')]=qs[_0x1ff6('0x32')](_0x4ef4e0[_0x1ff6('0x49')][_0x1ff6('0x32')]);_0x5e224a[_0x1ff6('0x34')]=qs[_0x1ff6('0x34')](_0x4ef4e0[_0x1ff6('0x49')][_0x1ff6('0x34')]);}_0x5e224a[_0x1ff6('0x51')]=qs['sort'](_0x4ef4e0[_0x1ff6('0x49')][_0x1ff6('0x52')]);_0x5e224a[_0x1ff6('0x53')]=qs[_0x1ff6('0x4b')](_[_0x1ff6('0x6c')](_0x4ef4e0[_0x1ff6('0x49')],_0x51324a['filters']));_0x5e224a['where'][_0x1ff6('0x6d')]=_0x25d482['id'];if(_0x4ef4e0[_0x1ff6('0x49')]['filter']){_0x5e224a[_0x1ff6('0x53')]=_[_0x1ff6('0x55')](_0x5e224a[_0x1ff6('0x53')],{'$or':_['map'](_0x5e224a[_0x1ff6('0x4f')],function(_0x2e35d3){var _0xb5bf9e={};_0xb5bf9e[_0x2e35d3]={'$like':'%'+_0x4ef4e0[_0x1ff6('0x49')][_0x1ff6('0x54')]+'%'};return _0xb5bf9e;})});}_0x5e224a=_[_0x1ff6('0x55')]({},_0x5e224a,_0x4ef4e0[_0x1ff6('0x6e')]);return db[_0x1ff6('0x72')][_0x1ff6('0x33')]({'where':_0x5e224a[_0x1ff6('0x53')]})[_0x1ff6('0x22')](function(_0x1467bd){_0x298913[_0x1ff6('0x33')]=_0x1467bd;if(_0x4ef4e0['query'][_0x1ff6('0x58')]){_0x5e224a[_0x1ff6('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1ff6('0x59')](_0x5e224a);})['then'](function(_0x5ddc0d){_0x298913[_0x1ff6('0x5a')]=_0x5ddc0d;return _0x298913;});}})[_0x1ff6('0x22')](respondWithFilteredResult(_0x984936,_0x5e224a))['catch'](handleError(_0x984936,null));};exports[_0x1ff6('0x74')]=function(_0x1498a9,_0x16afc9,_0x219870){return db['SmsAccount'][_0x1ff6('0x5d')]({'where':{'id':_0x1498a9['params']['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x16afc9,null))[_0x1ff6('0x22')](function(_0x58efa4){if(_0x58efa4){return _0x58efa4[_0x1ff6('0x74')](_0x1498a9[_0x1ff6('0x49')][_0x1ff6('0x70')]);}})[_0x1ff6('0x22')](respondWithStatusCode(_0x16afc9,null))[_0x1ff6('0x2c')](handleError(_0x16afc9,null));};exports[_0x1ff6('0x75')]=function(_0x16b6ad,_0x32fa89,_0x492476){var _0x3e3b2e={'channel':'sms'};var _0x3d781a=[];var _0x4c7342=[];var _0x5057b2={};return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x16b6ad[_0x1ff6('0x66')]['id']},'include':[{'model':db[_0x1ff6('0x76')],'as':_0x1ff6('0x77')}]})[_0x1ff6('0x22')](handleEntityNotFound(_0x32fa89,null))[_0x1ff6('0x22')](function(_0x195efc){_0x3e3b2e[_0x1ff6('0x78')]=_0x195efc;_0x3e3b2e[_0x1ff6('0x79')]=_['orderBy'](_0x195efc[_0x1ff6('0x77')],[_0x1ff6('0x7a')],[_0x1ff6('0x7b')]);if(_0x3e3b2e['account'][_0x1ff6('0x77')]){delete _0x3e3b2e[_0x1ff6('0x78')][_0x1ff6('0x77')];}return db[_0x1ff6('0x7c')][_0x1ff6('0x67')]();})[_0x1ff6('0x22')](function(_0x458ab2){if(!_0x458ab2){throw new db[(_0x1ff6('0x7d'))]['ValidationError']('no\x20available\x20attributes');}_0x3d781a=_[_0x1ff6('0x7e')](_['keys'](_0x458ab2),['createdAt',_0x1ff6('0x7f')]);_0x4c7342=_['difference'](_['keys'](_0x458ab2),[_0x1ff6('0x80'),'updatedAt',_0x1ff6('0x81'),_0x1ff6('0x82')]);_0x3e3b2e[_0x1ff6('0x5f')]={'mapKey':_0x1ff6('0x83')};if(_0x3e3b2e['account']['type']){switch(_0x3e3b2e[_0x1ff6('0x78')][_0x1ff6('0x45')]){case _0x1ff6('0x84'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')]['From'];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x86')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')]['MessageSid'];break;case'skebby':_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]='+'+_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x88')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x89')];break;case _0x1ff6('0x8a'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x85')];_0x3e3b2e['body']['body']=_0x16b6ad['body'][_0x1ff6('0x2b')];break;case _0x1ff6('0x8b'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x85')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x5f')];_0x3e3b2e['body'][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x8c')];break;case _0x1ff6('0x8d'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad['body']['From'];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]=_0x16b6ad['body'][_0x1ff6('0x8e')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x87')]=_0x16b6ad['body'][_0x1ff6('0x8f')];break;case _0x1ff6('0x90'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]='+'+_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x91')][0x0]['from'];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')]['results'][0x0]['text'];_0x3e3b2e['body'][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')]['results'][0x0][_0x1ff6('0x87')];break;case _0x1ff6('0x92'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x93')];_0x3e3b2e['body'][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x94')][_0x1ff6('0x2b')];break;case _0x1ff6('0x95'):_0x3e3b2e['body'][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x96')];_0x3e3b2e['body'][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x89')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x97')];break;case _0x1ff6('0x98'):_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')][0x0][_0x1ff6('0x2b')]['id'];_0x3e3b2e['body'][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][0x0][_0x1ff6('0x2b')]['from'];_0x3e3b2e['body'][_0x1ff6('0x5f')]=_0x16b6ad[_0x1ff6('0x5f')][0x0][_0x1ff6('0x2b')]['text'];break;case'intelepeer':_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x85')];_0x3e3b2e[_0x1ff6('0x5f')]['body']=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x2b')];_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x87')]=_0x16b6ad[_0x1ff6('0x5f')][_0x1ff6('0x99')];break;}}if(_0x3e3b2e[_0x1ff6('0x5f')]['id']){delete _0x3e3b2e[_0x1ff6('0x5f')]['id'];}if(_[_0x1ff6('0x9a')](_0x3e3b2e[_0x1ff6('0x5f')]['from'])){throw new db[(_0x1ff6('0x7d'))][(_0x1ff6('0x9b'))](_0x1ff6('0x9c'));}if(_['isNil'](_0x3e3b2e['body']['body'])||_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')]===''){throw new db[(_0x1ff6('0x7d'))][(_0x1ff6('0x9b'))](_0x1ff6('0x9d'));}if(_['isNil'](_0x3e3b2e[_0x1ff6('0x5f')]['mapKey'])){throw new db[(_0x1ff6('0x7d'))][(_0x1ff6('0x9b'))](_0x1ff6('0x9e')+_0x4c7342);}if(!_[_0x1ff6('0x9f')](_0x4c7342,_0x3e3b2e[_0x1ff6('0x5f')]['mapKey'])){throw new db[(_0x1ff6('0x7d'))][(_0x1ff6('0x9b'))](_0x1ff6('0xa0')+_0x4c7342);}_0x5057b2[_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0xa1')]]=_0x3e3b2e[_0x1ff6('0x5f')]['from'];return db[_0x1ff6('0xa2')][_0x1ff6('0x5d')]({'where':{'id':_0x3e3b2e['account']['ListId']},'include':[{'model':db[_0x1ff6('0x7c')],'as':_0x1ff6('0xa3'),'where':_0x5057b2,'limit':0x1,'order':[[_0x1ff6('0x7f'),'DESC']]}]});})['then'](handleEntityNotFound(_0x32fa89,null))[_0x1ff6('0x22')](function(_0x341e6d){if(_0x341e6d){_0x3e3b2e[_0x1ff6('0xa4')]=_[_0x1ff6('0xa5')](_0x341e6d,['Contacts']);if(_0x341e6d[_0x1ff6('0xa3')][_0x1ff6('0x4e')]){return _0x341e6d[_0x1ff6('0xa3')][0x0];}var _0x449dee=_['defaults'](_0x3e3b2e[_0x1ff6('0x5f')],{'firstName':_0x3e3b2e[_0x1ff6('0x5f')]['from'],'ListId':_0x341e6d['id']});_0x449dee[_0x3e3b2e['body'][_0x1ff6('0xa1')]]=_0x3e3b2e['body'][_0x1ff6('0x85')];return db[_0x1ff6('0x7c')]['create'](_0x449dee,{'fields':_0x3d781a,'raw':!![]});}})[_0x1ff6('0x22')](handleEntityNotFound(_0x32fa89,null))[_0x1ff6('0x22')](function(_0x16c5c1){if(_0x16c5c1){_0x3e3b2e['contact']=_0x16c5c1;var _0x91e567={'ContactId':_0x16c5c1['id'],'phone':_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')],'SmsAccountId':_0x16b6ad['params']['id']};var _0x578cb7={'ContactId':_0x16c5c1['id'],'SmsAccountId':_0x16b6ad[_0x1ff6('0x66')]['id'],'closed':![]};return db[_0x1ff6('0xa6')]['find']({'where':_0x578cb7})[_0x1ff6('0x22')](function(_0x5e2195){if(_0x5e2195){return[_0x5e2195,![]];}return db[_0x1ff6('0xa6')][_0x1ff6('0x5e')](_0x91e567)[_0x1ff6('0x22')](function(_0x415ee7){return[_0x415ee7,!![]];});});}})[_0x1ff6('0xa7')](function(_0x3568af,_0x5a9e5a){_0x3e3b2e[_0x1ff6('0xa8')]=_0x3568af['get']({'plain':!![]});_0x3e3b2e[_0x1ff6('0xa8')][_0x1ff6('0xa9')]=![];if(_0x5a9e5a){if(_0x3e3b2e[_0x1ff6('0x78')][_0x1ff6('0xaa')]){_0x3e3b2e[_0x1ff6('0x79')][_0x1ff6('0xab')]({'id':0x0,'priority':_0x3e3b2e['applications'][_0x1ff6('0x4e')]+0x1,'app':'close','appdata':_0x1ff6('0xac'),'interval':'*,*,*,*'});}_0x3e3b2e['interaction']['created']=!![];}return db[_0x1ff6('0xad')][_0x1ff6('0x5e')]({'phone':_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x85')],'messageId':_0x3e3b2e[_0x1ff6('0x5f')]['messageId'],'body':_0x3e3b2e[_0x1ff6('0x5f')][_0x1ff6('0x5f')],'SmsAccountId':_0x16b6ad[_0x1ff6('0x66')]['id'],'SmsInteractionId':_0x3568af['id'],'direction':'in','ContactId':_0x3568af[_0x1ff6('0xae')],'AttachmentId':_0x3e3b2e[_0x1ff6('0x5f')]['AttachmentId']});})[_0x1ff6('0x22')](function(_0x28cb5a){_0x3e3b2e['message']=_0x28cb5a;if(_0x3e3b2e[_0x1ff6('0xa8')][_0x1ff6('0xaf')]){return db['User'][_0x1ff6('0x5d')]({'attributes':['id',_0x1ff6('0x48')],'where':{'id':_0x3e3b2e[_0x1ff6('0xa8')][_0x1ff6('0xaf')]}})[_0x1ff6('0x22')](function(_0x519075){if(_0x519075){_0x3e3b2e['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x1ff6('0xb0'),'appdata':_0x519075[_0x1ff6('0x48')]+','+(_0x3e3b2e[_0x1ff6('0x78')][_0x1ff6('0xb1')]||0xa),'interval':_0x1ff6('0xb2')});}return respondWithRpcPromise(_0x1ff6('0xb3'),_0x1ff6('0xb4'),_0x3e3b2e);});}return respondWithRpcPromise(_0x1ff6('0xb3'),'startRouting',_0x3e3b2e);})['then'](function(_0x48ff9e){if(_0x48ff9e){var _0x3dbe66=0xc8;var _0x211267=_0x1ff6('0xb5');logger[_0x1ff6('0x23')](_0x1ff6('0x27'),_0x211267,_0x3dbe66,_0x1ff6('0xb6'));logger[_0x1ff6('0x26')](_0x1ff6('0xb7'),_0x211267,_0x3dbe66,'entity\x20found',JSON[_0x1ff6('0x28')](_0x48ff9e));if(_0x3e3b2e[_0x1ff6('0x78')][_0x1ff6('0x45')]===_0x1ff6('0x84')){return _0x32fa89['status'](_0x3dbe66)['set'](_0x1ff6('0xb8'),_0x1ff6('0xb9'))[_0x1ff6('0xba')](_0x1ff6('0xbb'));}else{return _0x32fa89[_0x1ff6('0x2e')](_0x3dbe66)[_0x1ff6('0x30')](_0x48ff9e);}}})[_0x1ff6('0x2c')](handleError(_0x32fa89,null));};exports[_0x1ff6('0xbc')]=function(_0x6af6ff,_0x552906){var _0x349e0a=_0x6af6ff[_0x1ff6('0x66')]['id'];var _0xa8eec7=_0x6af6ff[_0x1ff6('0x5f')];var _0x531ed0=0xc8;var _0x22d8d8=null;return db[_0x1ff6('0xbd')]['transaction']({'isolationLevel':db[_0x1ff6('0xbd')][_0x1ff6('0xbe')][_0x1ff6('0xbf')][_0x1ff6('0xc0')]},function(_0x3da76c){return db[_0x1ff6('0x42')]['findOne']({'where':{'id':_0x349e0a},'transaction':_0x3da76c})[_0x1ff6('0x22')](function(_0x329d73){if(_0x329d73){return db[_0x1ff6('0x76')][_0x1ff6('0x3a')]({'where':{'SmsAccountId':_0x349e0a},'transaction':_0x3da76c})['then'](function(){var _0x4ad522=_['map'](_0xa8eec7,function(_0x28ee58){_0x28ee58['SmsAccountId']=_0x349e0a;return _0x28ee58;});return db[_0x1ff6('0x76')][_0x1ff6('0xc1')](_0x4ad522,{'transaction':_0x3da76c});});}else{_0x531ed0=0x194;_0x22d8d8=[];}});})[_0x1ff6('0x22')](function(){if(_0x531ed0!==0x194){return db[_0x1ff6('0x76')][_0x1ff6('0xc2')]({'where':{'SmsAccountId':_0x349e0a},'order':_0x1ff6('0x7a')})[_0x1ff6('0x22')](function(_0x3c76c3){_0x22d8d8=_0x3c76c3;});}})[_0x1ff6('0x2c')](function(_0x50db8f){_0x531ed0=0x1f4;logger['error'](_0x50db8f[_0x1ff6('0x3e')]);if(_0x50db8f[_0x1ff6('0x48')]){delete _0x50db8f[_0x1ff6('0x48')];}_0x22d8d8=_0x50db8f;})[_0x1ff6('0xc3')](function(){if(_0x22d8d8===null){_0x552906[_0x1ff6('0x2d')](_0x531ed0);}else{if(_0x531ed0===0x1f4){_0x552906[_0x1ff6('0x2e')](_0x531ed0)[_0x1ff6('0xba')](_0x22d8d8);}else{_0x552906['status'](_0x531ed0)[_0x1ff6('0x30')](_0x22d8d8);}}});};exports[_0x1ff6('0xc4')]=function(_0x432548,_0x2bf6a4,_0x140212){var _0x3b445a={};var _0x28068c={};var _0x26e979;var _0x2d5a92;return db[_0x1ff6('0x42')]['findOne']({'where':{'id':_0x432548[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x2bf6a4,null))[_0x1ff6('0x22')](function(_0x38f50e){if(_0x38f50e){_0x26e979=_0x38f50e;_0x28068c[_0x1ff6('0x47')]=_['keys'](db[_0x1ff6('0x76')][_0x1ff6('0x43')]);_0x28068c[_0x1ff6('0x49')]=_[_0x1ff6('0x4a')](_0x432548[_0x1ff6('0x49')]);_0x28068c[_0x1ff6('0x4b')]=_[_0x1ff6('0x4c')](_0x28068c['model'],_0x28068c['query']);_0x3b445a[_0x1ff6('0x4f')]=_[_0x1ff6('0x4c')](_0x28068c['model'],qs[_0x1ff6('0x4d')](_0x432548[_0x1ff6('0x49')][_0x1ff6('0x4d')]));_0x3b445a['attributes']=_0x3b445a[_0x1ff6('0x4f')][_0x1ff6('0x4e')]?_0x3b445a['attributes']:_0x28068c[_0x1ff6('0x47')];_0x3b445a[_0x1ff6('0x51')]=qs[_0x1ff6('0x52')](_0x432548[_0x1ff6('0x49')][_0x1ff6('0x52')]);_0x3b445a[_0x1ff6('0x53')]=qs['filters'](_[_0x1ff6('0x6c')](_0x432548[_0x1ff6('0x49')],_0x28068c[_0x1ff6('0x4b')]));if(_0x432548[_0x1ff6('0x49')][_0x1ff6('0x54')]){_0x3b445a[_0x1ff6('0x53')]=_[_0x1ff6('0x55')](_0x3b445a[_0x1ff6('0x53')],{'$or':_[_0x1ff6('0x56')](_0x3b445a['attributes'],function(_0x3c7da2){var _0x366683={};_0x366683[_0x3c7da2]={'$like':'%'+_0x432548[_0x1ff6('0x49')][_0x1ff6('0x54')]+'%'};return _0x366683;})});}_0x3b445a=_[_0x1ff6('0x55')]({},_0x3b445a,_0x432548[_0x1ff6('0x6e')]);return _0x26e979[_0x1ff6('0xc4')](_0x3b445a);}})[_0x1ff6('0x22')](function(_0x2563f6){if(_0x2563f6){_0x2d5a92=_0x2563f6['length'];if(!_0x432548[_0x1ff6('0x49')][_0x1ff6('0x50')](_0x1ff6('0x6b'))){_0x3b445a[_0x1ff6('0x32')]=qs[_0x1ff6('0x32')](_0x432548[_0x1ff6('0x49')][_0x1ff6('0x32')]);_0x3b445a[_0x1ff6('0x34')]=qs['offset'](_0x432548[_0x1ff6('0x49')]['offset']);}return _0x26e979[_0x1ff6('0xc4')](_0x3b445a);}})[_0x1ff6('0x22')](function(_0x2b56ab){if(_0x2b56ab){return _0x2b56ab?{'count':_0x2d5a92,'rows':_0x2b56ab}:null;}})[_0x1ff6('0x22')](respondWithResult(_0x2bf6a4,null))['catch'](handleError(_0x2bf6a4,null));};exports[_0x1ff6('0xc5')]=function(_0x62baba,_0x4faa28,_0x224bd8){var _0x5ed54f={'raw':![],'where':{}};var _0x1fb0f0={};var _0x28ba0f={'count':0x0,'rows':[]};return db[_0x1ff6('0x42')][_0x1ff6('0xc6')]({'where':{'id':_0x62baba[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x4faa28,null))[_0x1ff6('0x22')](function(_0x594eaf){if(_0x594eaf){_0x1fb0f0[_0x1ff6('0x47')]=_[_0x1ff6('0x4a')](db['SmsInteraction']['rawAttributes']);_0x1fb0f0[_0x1ff6('0x49')]=_[_0x1ff6('0x4a')](_0x62baba[_0x1ff6('0x49')]);_0x1fb0f0[_0x1ff6('0x4b')]=_[_0x1ff6('0x4c')](_0x1fb0f0[_0x1ff6('0x47')],_0x1fb0f0[_0x1ff6('0x49')]);_0x5ed54f['attributes']=_[_0x1ff6('0x4c')](_0x1fb0f0[_0x1ff6('0x47')],qs[_0x1ff6('0x4d')](_0x62baba[_0x1ff6('0x49')][_0x1ff6('0x4d')]));_0x5ed54f[_0x1ff6('0x4f')]=_0x5ed54f[_0x1ff6('0x4f')][_0x1ff6('0x4e')]?_0x5ed54f[_0x1ff6('0x4f')]:_0x1fb0f0['model'];if(!_0x62baba[_0x1ff6('0x49')][_0x1ff6('0x50')]('nolimit')){_0x5ed54f['limit']=qs[_0x1ff6('0x32')](_0x62baba[_0x1ff6('0x49')]['limit']);_0x5ed54f[_0x1ff6('0x34')]=qs[_0x1ff6('0x34')](_0x62baba['query'][_0x1ff6('0x34')]);}_0x5ed54f['order']=qs['sort'](_0x62baba['query']['sort']);_0x5ed54f[_0x1ff6('0x53')]=qs[_0x1ff6('0x4b')](_['pick'](_0x62baba[_0x1ff6('0x49')],_0x1fb0f0[_0x1ff6('0x4b')]));_0x5ed54f['where'][_0x1ff6('0x6d')]=_0x594eaf['id'];if(_0x62baba['query'][_0x1ff6('0x54')]){_0x5ed54f['where']=_[_0x1ff6('0x55')](_0x5ed54f['where'],{'$or':_['map'](_0x5ed54f[_0x1ff6('0x4f')],function(_0x499bcc){var _0x184704={};_0x184704[_0x499bcc]={'$like':'%'+_0x62baba['query'][_0x1ff6('0x54')]+'%'};return _0x184704;})});}_0x5ed54f=_[_0x1ff6('0x55')]({},_0x5ed54f,_0x62baba['options']);return db[_0x1ff6('0xa6')][_0x1ff6('0x33')]({'where':_0x5ed54f[_0x1ff6('0x53')]})[_0x1ff6('0x22')](function(_0x6c3470){_0x28ba0f[_0x1ff6('0x33')]=_0x6c3470;if(_0x62baba[_0x1ff6('0x49')][_0x1ff6('0x58')]){_0x5ed54f['include']=[{'model':db[_0x1ff6('0x7c')],'as':'Contact','required':![]},{'model':db[_0x1ff6('0xc7')],'as':_0x1ff6('0xc8'),'attributes':[_0x1ff6('0x48'),_0x1ff6('0xc9'),_0x1ff6('0xca')],'required':![]},{'model':db['Tag'],'as':_0x1ff6('0xcb'),'attributes':['id',_0x1ff6('0x48'),_0x1ff6('0xcc')],'where':_0x62baba[_0x1ff6('0x49')]['tag']?{'id':_0x62baba['query'][_0x1ff6('0xcd')]}:undefined,'required':_0x62baba[_0x1ff6('0x49')][_0x1ff6('0xcd')]?!![]:![]}];}return db[_0x1ff6('0xa6')]['findAll'](_0x5ed54f);})[_0x1ff6('0x22')](function(_0x59602e){_0x28ba0f['rows']=_0x59602e;return _0x28ba0f;});}})[_0x1ff6('0x22')](respondWithFilteredResult(_0x4faa28,_0x5ed54f))[_0x1ff6('0x2c')](handleError(_0x4faa28,null));};exports[_0x1ff6('0xba')]=function(_0x3e4c81,_0xfac0ce,_0x38b897){var _0x3259b3,_0x1eedc5,_0x4d4611;if(_[_0x1ff6('0x9a')](_0x3e4c81['body']['body'])||_0x3e4c81[_0x1ff6('0x5f')]['body']===''){throw new db[(_0x1ff6('0x7d'))]['ValidationError'](_0x1ff6('0x9d'));}if(_[_0x1ff6('0x9a')](_0x3e4c81[_0x1ff6('0x5f')]['to'])){throw new db['Sequelize'][(_0x1ff6('0x9b'))](_0x1ff6('0xce'));}_0x3259b3=_0x3e4c81['body']['to'];return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x3e4c81[_0x1ff6('0x66')]['id']},'include':[{'model':db[_0x1ff6('0xa2')],'as':_0x1ff6('0xcf'),'include':[{'model':db[_0x1ff6('0x7c')],'as':'Contacts','where':{'mobile':_0x3259b3},'limit':0x1,'order':[['updatedAt',_0x1ff6('0xd0')]]}]}]})['then'](handleEntityNotFound(_0xfac0ce,null))['then'](function(_0x31d0d4){if(_0x31d0d4&&_0x31d0d4[_0x1ff6('0xcf')]){_0x1eedc5=_0x31d0d4[_0x1ff6('0x3b')]({'plain':!![]});if(_0x1eedc5['List']&&_0x1eedc5[_0x1ff6('0xcf')][_0x1ff6('0xa3')][_0x1ff6('0x4e')]){return _0x1eedc5[_0x1ff6('0xcf')][_0x1ff6('0xa3')][0x0];}return db[_0x1ff6('0x7c')][_0x1ff6('0x5e')](_['defaults'](_0x3e4c81[_0x1ff6('0x5f')],{'firstName':_0x3259b3,'mobile':_0x3259b3,'phone':_0x3259b3,'ListId':_0x1eedc5['ListId']}));}})[_0x1ff6('0x22')](handleEntityNotFound(_0xfac0ce,null))[_0x1ff6('0x22')](function(_0x20e913){if(_0x20e913){_0x4d4611=_0x20e913;return db[_0x1ff6('0xa6')][_0x1ff6('0x5d')]({'where':{'ContactId':_0x4d4611['id'],'closed':![],'SmsAccountId':_0x1eedc5['id']}})[_0x1ff6('0x22')](function(_0x3c17a3){if(_0x3c17a3){return[_0x3c17a3,![]];}return db[_0x1ff6('0xa6')][_0x1ff6('0x5e')]({'UserId':_0x3e4c81[_0x1ff6('0x60')]['id'],'ContactId':_0x4d4611['id'],'SmsAccountId':_0x1eedc5['id'],'phone':_0x3259b3,'firstMsgDirection':_0x1ff6('0xd1'),'Messages':[_[_0x1ff6('0x55')](_0x3e4c81['body'],{'read':![],'body':_0x3e4c81[_0x1ff6('0x5f')]['body'],'phone':_0x3259b3,'SmsAccountId':_0x1eedc5['id'],'UserId':_0x3e4c81['user']['id'],'ContactId':_0x4d4611['id']})]},{'include':[{'model':db[_0x1ff6('0xad')],'as':'Messages'}]})[_0x1ff6('0x22')](function(_0x1cc231){return[_0x1cc231,!![]];});});}})[_0x1ff6('0xa7')](function(_0x381070,_0x461406){if(_0x461406){return _0x381070;}return db[_0x1ff6('0xad')][_0x1ff6('0x5e')](_['merge'](_0x3e4c81[_0x1ff6('0x5f')],{'read':![],'body':_0x3e4c81['body'][_0x1ff6('0x5f')],'phone':_0x3259b3,'SmsAccountId':_0x1eedc5['id'],'SmsInteractionId':_0x381070['id'],'UserId':_0x3e4c81[_0x1ff6('0x60')]['id'],'ContactId':_0x4d4611['id']}))[_0x1ff6('0x22')](function(_0x2094cb){_0x381070[_0x1ff6('0xd2')]['Messages']=[];_0x381070[_0x1ff6('0xd2')][_0x1ff6('0xd3')][_0x1ff6('0xab')](_0x2094cb[_0x1ff6('0xd2')]);return _0x381070;});})[_0x1ff6('0x22')](respondWithResult(_0xfac0ce,null))[_0x1ff6('0x2c')](handleError(_0xfac0ce,null));};exports['status']=function(_0x1f4833,_0x3669c6,_0x25a633){if(_0x1f4833[_0x1ff6('0x5f')]['id']){delete _0x1f4833[_0x1ff6('0x5f')]['id'];}var _0x4701ae,_0x942cc5,_0x147a05;return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x1f4833[_0x1ff6('0x66')]['id']}})['then'](handleEntityNotFound(_0x3669c6,null))[_0x1ff6('0x22')](function(_0x44409e){if(_0x44409e){_0x147a05=_0x44409e;logger['debug'](_0x1ff6('0x27'),_0x1ff6('0x2e'),'received\x20delivery\x20report\x20from',_0x44409e['type'],util[_0x1ff6('0xd4')](_0x1f4833['body'],{'showHidden':![],'depth':null}));switch(_0x44409e[_0x1ff6('0x45')]){case _0x1ff6('0xd5'):if(_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0xd6')]&&_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x2e')]){_0x942cc5=_0x1f4833[_0x1ff6('0x5f')]['status'];return db[_0x1ff6('0xad')][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833[_0x1ff6('0x5f')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0xd7')]&&_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0xd8')]){_0x942cc5=_0x1f4833['body'][_0x1ff6('0xd8')];return db[_0x1ff6('0xad')][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833['body'][_0x1ff6('0xd7')]}});}break;case _0x1ff6('0x8b'):if(_0x1f4833[_0x1ff6('0x5f')]['message_id']&&_0x1f4833[_0x1ff6('0x5f')]['status_code']){_0x942cc5=_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0xd9')];return db[_0x1ff6('0xad')][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833['body'][_0x1ff6('0x8c')]}});}break;case _0x1ff6('0x90'):var _0x3c3553=_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x91')][0x0];if(_0x3c3553[_0x1ff6('0x87')]&&_0x3c3553[_0x1ff6('0x2e')][_0x1ff6('0xda')]===_0x1ff6('0xdb')){_0x942cc5=_0x3c3553[_0x1ff6('0x2e')]['groupName'];return db[_0x1ff6('0xad')]['find']({'where':{'messageId':_0x3c3553[_0x1ff6('0x87')]}});}break;case _0x1ff6('0x95'):if(_0x1f4833[_0x1ff6('0x5f')]['messageId']&&_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x2e')]){_0x942cc5=_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x2e')];return db[_0x1ff6('0xad')][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833['body'][_0x1ff6('0x87')]}});}break;case _0x1ff6('0x98'):if(_0x1f4833[_0x1ff6('0x5f')][0x0][_0x1ff6('0x2b')]['id']){_0x942cc5=_0x1f4833[_0x1ff6('0x5f')][0x0][_0x1ff6('0x45')];return db['SmsMessage'][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833[_0x1ff6('0x5f')][0x0][_0x1ff6('0x2b')]['id']}});}break;case'intelepeer':if(_0x1f4833[_0x1ff6('0x5f')]['redif']&&_0x1f4833[_0x1ff6('0x5f')]['status']){_0x942cc5=_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x2e')];return db[_0x1ff6('0xad')][_0x1ff6('0x5d')]({'where':{'messageId':_0x1f4833['body'][_0x1ff6('0xdc')]}});}break;}}})[_0x1ff6('0x22')](handleEntityNotFound(_0x3669c6,null))[_0x1ff6('0x22')](function(_0x441025){if(_0x441025){_0x4701ae=_0x441025;switch(_0x147a05['type']){case'skebby':if(_0x942cc5===_0x1ff6('0xdb')){return _0x4701ae['update']({'read':!![]});}else{logger[_0x1ff6('0x29')](_0x1ff6('0x27'),_0x1ff6('0x2e'),'skebby',util[_0x1ff6('0xd4')](_0x1f4833['body'],{'showHidden':![],'depth':null}));}break;case _0x1ff6('0x8a'):if(_0x942cc5==='1'){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger[_0x1ff6('0x29')](_0x1ff6('0x27'),_0x1ff6('0x2e'),_0x1ff6('0xd5'),util[_0x1ff6('0xd4')](_0x1f4833[_0x1ff6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1ff6('0x8b'):if(!_0x1f4833[_0x1ff6('0x5f')]['error_code']&&_0x942cc5>=0xc8&&_0x942cc5<=0xce){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger[_0x1ff6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ff6('0x2e'),_0x1ff6('0x8b'),util[_0x1ff6('0xd4')](_0x1f4833[_0x1ff6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1ff6('0x90'):var _0x36108d=_0x1f4833[_0x1ff6('0x5f')][_0x1ff6('0x91')][0x0];if(_0x36108d[_0x1ff6('0x2e')][_0x1ff6('0xda')]==='DELIVERED'){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ff6('0x2e'),_0x1ff6('0x90'),util[_0x1ff6('0xd4')](_0x1f4833[_0x1ff6('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x942cc5==_0x1ff6('0xdd')||_0x942cc5==_0x1ff6('0xde')){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger['error'](_0x1ff6('0x27'),_0x1ff6('0x2e'),_0x1ff6('0x95'),util[_0x1ff6('0xd4')](_0x1f4833[_0x1ff6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x1ff6('0x98'):if(_0x942cc5==_0x1ff6('0xdf')){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger[_0x1ff6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ff6('0x2e'),'bandwidth',util[_0x1ff6('0xd4')](_0x1f4833['body'],{'showHidden':![],'depth':null}));}break;case _0x1ff6('0xe0'):if(_0x942cc5===_0x1ff6('0xe1')||_0x942cc5===_0x1ff6('0xe2')){return _0x4701ae[_0x1ff6('0x39')]({'read':!![]});}else{logger[_0x1ff6('0x29')](_0x1ff6('0x27'),_0x1ff6('0x2e'),_0x1ff6('0xe0'),util[_0x1ff6('0xd4')](_0x1f4833['body'],{'showHidden':![],'depth':null}));}break;}return _0x4701ae;}})[_0x1ff6('0x22')](respondWithResult(_0x3669c6,null))[_0x1ff6('0x2c')](handleError(_0x3669c6,null));};exports['statusGet']=function(_0x11bd6f,_0x8f5a96,_0x37f74d){var _0x1e0da6,_0x794673,_0x198acc;return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x11bd6f[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x8f5a96,null))[_0x1ff6('0x22')](function(_0x2bff6e){if(_0x2bff6e){_0x198acc=_0x2bff6e;logger['debug'](_0x1ff6('0x27'),_0x1ff6('0x2e'),'received\x20delivery\x20report\x20from',_0x2bff6e[_0x1ff6('0x45')],util[_0x1ff6('0xd4')](_0x11bd6f[_0x1ff6('0x49')],{'showHidden':![],'depth':null}));switch(_0x2bff6e[_0x1ff6('0x45')]){case _0x1ff6('0x92'):if(_0x11bd6f[_0x1ff6('0x49')][_0x1ff6('0xe3')]&&_0x11bd6f['query'][_0x1ff6('0xe4')]){_0x794673=_0x11bd6f[_0x1ff6('0x49')]['state'];return db['SmsMessage'][_0x1ff6('0x5d')]({'where':{'messageId':_0x11bd6f[_0x1ff6('0x49')][_0x1ff6('0xe3')]}});}break;}}})[_0x1ff6('0x22')](handleEntityNotFound(_0x8f5a96,null))[_0x1ff6('0x22')](function(_0x5bb403){if(_0x5bb403){_0x1e0da6=_0x5bb403;switch(_0x198acc[_0x1ff6('0x45')]){case _0x1ff6('0x92'):if(_0x794673==='2'||_0x794673==='6'){return _0x1e0da6[_0x1ff6('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ff6('0x2e'),_0x1ff6('0x92'),util[_0x1ff6('0xd4')](_0x11bd6f[_0x1ff6('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x1e0da6;}})[_0x1ff6('0x22')](respondWithResult(_0x8f5a96,null))[_0x1ff6('0x2c')](handleError(_0x8f5a96,null));};exports[_0x1ff6('0xe5')]=function(_0x1f747a,_0x33b6bc,_0x4846ed){return db[_0x1ff6('0x42')][_0x1ff6('0x5d')]({'where':{'id':_0x1f747a[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x33b6bc,null))[_0x1ff6('0x22')](function(_0xc58386){if(_0xc58386){return _0xc58386['addAgents'](_0x1f747a[_0x1ff6('0x5f')][_0x1ff6('0x70')],_[_0x1ff6('0xa5')](_0x1f747a[_0x1ff6('0x5f')],[_0x1ff6('0x70'),'id'])||{})[_0x1ff6('0xa7')](function(_0x4e8600){for(var _0x7791fd=0x0;_0x7791fd<_0x1f747a['body'][_0x1ff6('0x70')][_0x1ff6('0x4e')];_0x7791fd+=0x1){socket[_0x1ff6('0xe6')](_0x1ff6('0xe7'),{'UserId':Number(_0x1f747a[_0x1ff6('0x5f')][_0x1ff6('0x70')][_0x7791fd]),'SmsAccountId':Number(_0x1f747a[_0x1ff6('0x66')]['id'])});}return _0x4e8600;});}})[_0x1ff6('0x22')](respondWithResult(_0x33b6bc,null))[_0x1ff6('0x2c')](handleError(_0x33b6bc,null));};exports[_0x1ff6('0xe8')]=function(_0x4472b1,_0x127174,_0x377f8f){return db['SmsAccount'][_0x1ff6('0x5d')]({'where':{'id':_0x4472b1[_0x1ff6('0x66')]['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x127174,null))[_0x1ff6('0x22')](function(_0x5d7b4b){if(_0x5d7b4b){return _0x5d7b4b['removeAgents'](_0x4472b1[_0x1ff6('0x49')][_0x1ff6('0x70')])[_0x1ff6('0x22')](function(){if(_[_0x1ff6('0xe9')](_0x4472b1[_0x1ff6('0x49')][_0x1ff6('0x70')])){for(var _0x12823a=0x0;_0x12823a<_0x4472b1[_0x1ff6('0x49')][_0x1ff6('0x70')][_0x1ff6('0x4e')];_0x12823a+=0x1){socket[_0x1ff6('0xe6')](_0x1ff6('0xea'),{'UserId':Number(_0x4472b1[_0x1ff6('0x49')][_0x1ff6('0x70')][_0x12823a]),'SmsAccountId':Number(_0x4472b1['params']['id'])});}}else{socket['emit'](_0x1ff6('0xea'),{'UserId':Number(_0x4472b1[_0x1ff6('0x49')]['ids']),'SmsAccountId':Number(_0x4472b1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x127174,null))[_0x1ff6('0x2c')](handleError(_0x127174,null));};exports[_0x1ff6('0xeb')]=function(_0x1f5cc7,_0x3849f5,_0x3eff74){var _0x505e78={};var _0x2b82ce={};var _0x583136;var _0x42c405;return db['SmsAccount'][_0x1ff6('0xc6')]({'where':{'id':_0x1f5cc7['params']['id']}})[_0x1ff6('0x22')](handleEntityNotFound(_0x3849f5,null))[_0x1ff6('0x22')](function(_0x182eb0){if(_0x182eb0){_0x583136=_0x182eb0;_0x2b82ce[_0x1ff6('0x47')]=_[_0x1ff6('0x4a')](db['User'][_0x1ff6('0x43')]);_0x2b82ce[_0x1ff6('0x49')]=_[_0x1ff6('0x4a')](_0x1f5cc7['query']);_0x2b82ce[_0x1ff6('0x4b')]=_[_0x1ff6('0x4c')](_0x2b82ce[_0x1ff6('0x47')],_0x2b82ce['query']);_0x505e78['attributes']=_[_0x1ff6('0x4c')](_0x2b82ce[_0x1ff6('0x47')],qs[_0x1ff6('0x4d')](_0x1f5cc7[_0x1ff6('0x49')]['fields']));_0x505e78['attributes']=_0x505e78[_0x1ff6('0x4f')]['length']?_0x505e78[_0x1ff6('0x4f')]:_0x2b82ce[_0x1ff6('0x47')];_0x505e78[_0x1ff6('0x51')]=qs['sort'](_0x1f5cc7['query'][_0x1ff6('0x52')]);_0x505e78[_0x1ff6('0x53')]=qs[_0x1ff6('0x4b')](_[_0x1ff6('0x6c')](_0x1f5cc7['query'],_0x2b82ce[_0x1ff6('0x4b')]));if(_0x1f5cc7[_0x1ff6('0x49')][_0x1ff6('0x54')]){_0x505e78[_0x1ff6('0x53')]=_['merge'](_0x505e78['where'],{'$or':_[_0x1ff6('0x56')](_0x505e78[_0x1ff6('0x4f')],function(_0x44bc40){var _0x109e21={};_0x109e21[_0x44bc40]={'$like':'%'+_0x1f5cc7[_0x1ff6('0x49')][_0x1ff6('0x54')]+'%'};return _0x109e21;})});}_0x505e78=_[_0x1ff6('0x55')]({},_0x505e78,_0x1f5cc7[_0x1ff6('0x6e')]);return _0x583136[_0x1ff6('0xeb')](_0x505e78);}})[_0x1ff6('0x22')](function(_0x28315e){if(_0x28315e){_0x42c405=_0x28315e[_0x1ff6('0x4e')];if(!_0x1f5cc7['query'][_0x1ff6('0x50')]('nolimit')){_0x505e78[_0x1ff6('0x32')]=qs[_0x1ff6('0x32')](_0x1f5cc7[_0x1ff6('0x49')]['limit']);_0x505e78['offset']=qs[_0x1ff6('0x34')](_0x1f5cc7[_0x1ff6('0x49')][_0x1ff6('0x34')]);}return _0x583136[_0x1ff6('0xeb')](_0x505e78);}})['then'](function(_0x3b9e48){if(_0x3b9e48){return _0x3b9e48?{'count':_0x42c405,'rows':_0x3b9e48}:null;}})[_0x1ff6('0x22')](respondWithResult(_0x3849f5,null))['catch'](handleError(_0x3849f5,null));}; \ No newline at end of file +var _0x8f98=['redif','inspect','error_code','bandwidth','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','SmsAccount','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sms','Applications','account','applications','asc','CmContact','ValidationError','createdAt','updatedAt','CompanyId','ListId','from','From','MessageSid','skebby','sender','text','connectel','messageId','message_id','plivo','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','refid','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','User','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','CmList','List','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','DELIVERED','groupName','intelepeer'];(function(_0xaa2ebd,_0x3f41cc){var _0x123b2e=function(_0x56dbec){while(--_0x56dbec){_0xaa2ebd['push'](_0xaa2ebd['shift']());}};_0x123b2e(++_0x3f41cc);}(_0x8f98,0x1ca));var _0x88f9=function(_0x2ecf91,_0x44b40b){_0x2ecf91=_0x2ecf91-0x0;var _0x1ba2b4=_0x8f98[_0x2ecf91];return _0x1ba2b4;};'use strict';var emlformat=require(_0x88f9('0x0'));var rimraf=require(_0x88f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x88f9('0x2'));var moment=require(_0x88f9('0x3'));var BPromise=require(_0x88f9('0x4'));var Mustache=require('mustache');var util=require(_0x88f9('0x5'));var path=require(_0x88f9('0x6'));var sox=require(_0x88f9('0x7'));var csv=require(_0x88f9('0x8'));var ejs=require(_0x88f9('0x9'));var fs=require('fs');var fs_extra=require(_0x88f9('0xa'));var _=require('lodash');var squel=require(_0x88f9('0xb'));var crypto=require('crypto');var jsforce=require(_0x88f9('0xc'));var deskjs=require(_0x88f9('0xd'));var toCsv=require(_0x88f9('0x8'));var querystring=require(_0x88f9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x88f9('0xf'));var qs=require(_0x88f9('0x10'));var as=require(_0x88f9('0x11'));var hardwareService=require(_0x88f9('0x12'));var logger=require(_0x88f9('0x13'))('api');var utils=require(_0x88f9('0x14'));var config=require(_0x88f9('0x15'));var licenseUtil=require(_0x88f9('0x16'));var db=require('../../mysqldb')['db'];config[_0x88f9('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88f9('0x17')]));require(_0x88f9('0x18'))[_0x88f9('0x19')](socket);var jayson=require(_0x88f9('0x1a'));var client=jayson['client'][_0x88f9('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x52e4d8,_0x3f9b25,_0x3bb06e,_0x32641d){return new BPromise(function(_0x5ea21b,_0x34bae9){var _0x4369e8=_0x32641d||client;return _0x4369e8[_0x88f9('0x1c')](_0x52e4d8,_0x3bb06e)[_0x88f9('0x1d')](function(_0x2238e3){logger[_0x88f9('0x1e')](_0x88f9('0x1f'),_0x3f9b25,'request\x20sent');logger[_0x88f9('0x20')](_0x88f9('0x21'),_0x3f9b25,_0x88f9('0x22'),JSON[_0x88f9('0x23')](_0x2238e3));if(_0x2238e3[_0x88f9('0x24')]){if(_0x2238e3['error']['code']===0x1f4){logger[_0x88f9('0x24')](_0x88f9('0x1f'),_0x3f9b25,_0x2238e3[_0x88f9('0x24')][_0x88f9('0x25')]);return _0x34bae9(_0x2238e3[_0x88f9('0x24')][_0x88f9('0x25')]);}logger[_0x88f9('0x24')](_0x88f9('0x1f'),_0x3f9b25,_0x2238e3['error'][_0x88f9('0x25')]);return _0x5ea21b(_0x2238e3[_0x88f9('0x24')][_0x88f9('0x25')]);}else{logger['info'](_0x88f9('0x1f'),_0x3f9b25,'request\x20sent');_0x5ea21b(_0x2238e3[_0x88f9('0x26')]['message']);}})[_0x88f9('0x27')](function(_0x5a1a61){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3f9b25,_0x5a1a61);_0x34bae9(_0x5a1a61);});});}function respondWithStatusCode(_0x3ee805,_0x21d23c){_0x21d23c=_0x21d23c||0xcc;return function(_0x4008d1){if(_0x4008d1){return _0x3ee805[_0x88f9('0x28')](_0x21d23c);}return _0x3ee805[_0x88f9('0x29')](_0x21d23c)[_0x88f9('0x2a')]();};}function respondWithResult(_0x40b9a5,_0x3765e7){_0x3765e7=_0x3765e7||0xc8;return function(_0x432662){if(_0x432662){return _0x40b9a5[_0x88f9('0x29')](_0x3765e7)[_0x88f9('0x2b')](_0x432662);}};}function respondWithFilteredResult(_0x41c9fe,_0x34b56d){return function(_0x5eb88e){if(_0x5eb88e){var _0x1f7155=typeof _0x34b56d[_0x88f9('0x2c')]==='undefined'&&typeof _0x34b56d[_0x88f9('0x2d')]===_0x88f9('0x2e');var _0x15c9b8=_0x5eb88e[_0x88f9('0x2f')];var _0x11028d=_0x1f7155?0x0:_0x34b56d[_0x88f9('0x2c')];var _0x36b8a3=_0x1f7155?_0x5eb88e['count']:_0x34b56d[_0x88f9('0x2c')]+_0x34b56d['limit'];var _0x40b473;if(_0x36b8a3>=_0x15c9b8){_0x36b8a3=_0x15c9b8;_0x40b473=0xc8;}else{_0x40b473=0xce;}_0x41c9fe[_0x88f9('0x29')](_0x40b473);return _0x41c9fe[_0x88f9('0x30')](_0x88f9('0x31'),_0x11028d+'-'+_0x36b8a3+'/'+_0x15c9b8)[_0x88f9('0x2b')](_0x5eb88e);}return null;};}function patchUpdates(_0x23d8fc){return function(_0x3feb11){try{jsonpatch[_0x88f9('0x32')](_0x3feb11,_0x23d8fc,!![]);}catch(_0x146644){return BPromise[_0x88f9('0x33')](_0x146644);}return _0x3feb11['save']();};}function saveUpdates(_0x27cb1c,_0xd5303c){return function(_0x50e215){if(_0x50e215){return _0x50e215[_0x88f9('0x34')](_0x27cb1c)['then'](function(_0x48a755){return _0x48a755;});}return null;};}function removeEntity(_0x4605c9,_0x3399fb){return function(_0x5bf540){if(_0x5bf540){return _0x5bf540[_0x88f9('0x35')]()['then'](function(){var _0x493dd0=_0x5bf540[_0x88f9('0x36')]({'plain':!![]});var _0x179651=_0x88f9('0x37');return db[_0x88f9('0x38')]['destroy']({'where':{'type':_0x179651,'resourceId':_0x493dd0['id']}})[_0x88f9('0x1d')](function(){return _0x5bf540;});})[_0x88f9('0x1d')](function(){_0x4605c9[_0x88f9('0x29')](0xcc)[_0x88f9('0x2a')]();});}};}function handleEntityNotFound(_0x195c75,_0x410d5c){return function(_0x1c25ca){if(!_0x1c25ca){_0x195c75[_0x88f9('0x28')](0x194);}return _0x1c25ca;};}function handleError(_0xd191a8,_0x35b992){_0x35b992=_0x35b992||0x1f4;return function(_0x1be8f6){logger[_0x88f9('0x24')](_0x1be8f6[_0x88f9('0x39')]);if(_0x1be8f6[_0x88f9('0x3a')]){delete _0x1be8f6['name'];}_0xd191a8['status'](_0x35b992)[_0x88f9('0x3b')](_0x1be8f6);};}exports[_0x88f9('0x3c')]=function(_0x28756f,_0x5cce4f){var _0x506c70={'include':[{'model':db[_0x88f9('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3509b1={},_0x58ca60={'count':0x0,'rows':[]};var _0x4bc428=_['map'](db[_0x88f9('0x3e')][_0x88f9('0x3f')],function(_0x193268){return{'name':_0x193268['fieldName'],'type':_0x193268['type'][_0x88f9('0x40')]};});_0x3509b1['model']=_[_0x88f9('0x41')](_0x4bc428,_0x88f9('0x3a'));_0x3509b1['query']=_[_0x88f9('0x42')](_0x28756f[_0x88f9('0x43')]);_0x3509b1[_0x88f9('0x44')]=_[_0x88f9('0x45')](_0x3509b1[_0x88f9('0x46')],_0x3509b1[_0x88f9('0x43')]);_0x506c70[_0x88f9('0x47')]=_[_0x88f9('0x45')](_0x3509b1[_0x88f9('0x46')],qs[_0x88f9('0x48')](_0x28756f[_0x88f9('0x43')]['fields']));_0x506c70[_0x88f9('0x47')]=_0x506c70[_0x88f9('0x47')][_0x88f9('0x49')]?_0x506c70[_0x88f9('0x47')]:_0x3509b1[_0x88f9('0x46')];if(!_0x28756f[_0x88f9('0x43')][_0x88f9('0x4a')]('nolimit')){_0x506c70[_0x88f9('0x2d')]=qs[_0x88f9('0x2d')](_0x28756f['query'][_0x88f9('0x2d')]);_0x506c70['offset']=qs[_0x88f9('0x2c')](_0x28756f[_0x88f9('0x43')][_0x88f9('0x2c')]);}_0x506c70[_0x88f9('0x4b')]=qs[_0x88f9('0x4c')](_0x28756f['query'][_0x88f9('0x4c')]);_0x506c70[_0x88f9('0x4d')]=qs[_0x88f9('0x44')](_[_0x88f9('0x4e')](_0x28756f[_0x88f9('0x43')],_0x3509b1['filters']),_0x4bc428);if(_0x28756f[_0x88f9('0x43')][_0x88f9('0x4f')]){_0x506c70[_0x88f9('0x4d')]=_['merge'](_0x506c70[_0x88f9('0x4d')],{'$or':_[_0x88f9('0x41')](_0x4bc428,function(_0x35e618){if(_0x35e618[_0x88f9('0x50')]!==_0x88f9('0x51')){var _0x3bcf10={};_0x3bcf10[_0x35e618['name']]={'$like':'%'+_0x28756f[_0x88f9('0x43')][_0x88f9('0x4f')]+'%'};return _0x3bcf10;}})});}_0x506c70=_[_0x88f9('0x52')]({},_0x506c70,_0x28756f[_0x88f9('0x53')]);var _0x3a8a09={'where':_0x506c70[_0x88f9('0x4d')]};return db[_0x88f9('0x3e')][_0x88f9('0x2f')](_0x3a8a09)[_0x88f9('0x1d')](function(_0x185328){_0x58ca60[_0x88f9('0x2f')]=_0x185328;if(_0x28756f['query'][_0x88f9('0x54')]){_0x506c70[_0x88f9('0x55')]=[{'all':!![]}];}return db[_0x88f9('0x3e')][_0x88f9('0x56')](_0x506c70);})[_0x88f9('0x1d')](function(_0x281123){_0x58ca60[_0x88f9('0x57')]=_0x281123;return _0x58ca60;})['then'](respondWithFilteredResult(_0x5cce4f,_0x506c70))[_0x88f9('0x27')](handleError(_0x5cce4f,null));};exports[_0x88f9('0x58')]=function(_0x1e81e9,_0x3c4829){var _0x556865={'raw':![],'where':{'id':_0x1e81e9['params']['id']},'include':[{'model':db[_0x88f9('0x3d')],'as':_0x88f9('0x59')}]},_0x430a1d={};_0x430a1d[_0x88f9('0x46')]=_['keys'](db[_0x88f9('0x3e')]['rawAttributes']);_0x430a1d[_0x88f9('0x43')]=_['keys'](_0x1e81e9['query']);_0x430a1d[_0x88f9('0x44')]=_[_0x88f9('0x45')](_0x430a1d[_0x88f9('0x46')],_0x430a1d[_0x88f9('0x43')]);_0x556865[_0x88f9('0x47')]=_[_0x88f9('0x45')](_0x430a1d[_0x88f9('0x46')],qs[_0x88f9('0x48')](_0x1e81e9[_0x88f9('0x43')]['fields']));_0x556865[_0x88f9('0x47')]=_0x556865[_0x88f9('0x47')][_0x88f9('0x49')]?_0x556865['attributes']:_0x430a1d[_0x88f9('0x46')];if(_0x1e81e9[_0x88f9('0x43')][_0x88f9('0x54')]){_0x556865[_0x88f9('0x55')]=[{'all':!![]}];}_0x556865=_['merge']({},_0x556865,_0x1e81e9[_0x88f9('0x53')]);return db['SmsAccount']['find'](_0x556865)[_0x88f9('0x1d')](handleEntityNotFound(_0x3c4829,null))[_0x88f9('0x1d')](respondWithResult(_0x3c4829,null))[_0x88f9('0x27')](handleError(_0x3c4829,null));};exports[_0x88f9('0x5a')]=function(_0xe55599,_0x4d6c26){return db['SmsAccount']['create'](_0xe55599['body'],{})[_0x88f9('0x1d')](function(_0x3b0e53){var _0x53024c=_0xe55599[_0x88f9('0x5b')][_0x88f9('0x36')]({'plain':!![]});if(!_0x53024c)throw new Error(_0x88f9('0x5c'));if(_0x53024c['role']===_0x88f9('0x5b')){var _0x406c69=_0x3b0e53[_0x88f9('0x36')]({'plain':!![]});var _0x16cccb=_0x88f9('0x37');return db[_0x88f9('0x5d')][_0x88f9('0x5e')]({'where':{'name':_0x16cccb,'userProfileId':_0x53024c[_0x88f9('0x5f')]},'raw':!![]})[_0x88f9('0x1d')](function(_0x293e0c){if(_0x293e0c&&_0x293e0c[_0x88f9('0x60')]===0x0){return db['UserProfileResource'][_0x88f9('0x5a')]({'name':_0x406c69['name'],'resourceId':_0x406c69['id'],'type':_0x293e0c['name'],'sectionId':_0x293e0c['id']},{})['then'](function(){return _0x3b0e53;});}else{return _0x3b0e53;}})[_0x88f9('0x27')](function(_0x29c7ac){logger[_0x88f9('0x24')](_0x88f9('0x61'),_0x29c7ac);throw _0x29c7ac;});}return _0x3b0e53;})[_0x88f9('0x1d')](respondWithResult(_0x4d6c26,0xc9))[_0x88f9('0x27')](handleError(_0x4d6c26,null));};exports[_0x88f9('0x34')]=function(_0x2f38e6,_0x152273){if(_0x2f38e6[_0x88f9('0x62')]['id']){delete _0x2f38e6[_0x88f9('0x62')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2f38e6[_0x88f9('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0x88f9('0x59')}]})['then'](handleEntityNotFound(_0x152273,null))[_0x88f9('0x1d')](saveUpdates(_0x2f38e6['body'],null))[_0x88f9('0x1d')](respondWithResult(_0x152273,null))[_0x88f9('0x27')](handleError(_0x152273,null));};exports[_0x88f9('0x35')]=function(_0x2c9d44,_0x9da7d2){return db['SmsAccount'][_0x88f9('0x5e')]({'where':{'id':_0x2c9d44[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x9da7d2,null))['then'](removeEntity(_0x9da7d2,null))[_0x88f9('0x27')](handleError(_0x9da7d2,null));};exports['describe']=function(_0x45f086,_0x1e4e8b){return db['SmsAccount'][_0x88f9('0x64')]()[_0x88f9('0x1d')](respondWithResult(_0x1e4e8b,null))['catch'](handleError(_0x1e4e8b,null));};exports[_0x88f9('0x65')]=function(_0x3b3844,_0x357c83,_0x529625){if(_0x3b3844['body']['id']){delete _0x3b3844[_0x88f9('0x62')]['id'];}return db['SmsAccount'][_0x88f9('0x5e')]({'where':{'id':_0x3b3844[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x357c83,null))[_0x88f9('0x1d')](function(_0x425045){if(_0x425045){_0x3b3844['body'][_0x88f9('0x66')]=_0x425045['id'];return db[_0x88f9('0x67')][_0x88f9('0x5a')](_0x3b3844[_0x88f9('0x62')]);}})[_0x88f9('0x1d')](respondWithResult(_0x357c83,null))[_0x88f9('0x27')](handleError(_0x357c83,null));};exports[_0x88f9('0x68')]=function(_0x1f9b98,_0x5dfb7f,_0x548c1e){var _0x4ccfa4={'raw':![],'where':{}};var _0x188d11={};var _0x3b5d4e={'count':0x0,'rows':[]};return db[_0x88f9('0x3e')][_0x88f9('0x69')]({'where':{'id':_0x1f9b98[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x5dfb7f,null))[_0x88f9('0x1d')](function(_0x1ca86b){if(_0x1ca86b){_0x188d11['model']=_[_0x88f9('0x42')](db[_0x88f9('0x67')]['rawAttributes']);_0x188d11['query']=_[_0x88f9('0x42')](_0x1f9b98[_0x88f9('0x43')]);_0x188d11[_0x88f9('0x44')]=_[_0x88f9('0x45')](_0x188d11[_0x88f9('0x46')],_0x188d11['query']);_0x4ccfa4[_0x88f9('0x47')]=_[_0x88f9('0x45')](_0x188d11[_0x88f9('0x46')],qs['fields'](_0x1f9b98['query'][_0x88f9('0x48')]));_0x4ccfa4[_0x88f9('0x47')]=_0x4ccfa4[_0x88f9('0x47')][_0x88f9('0x49')]?_0x4ccfa4[_0x88f9('0x47')]:_0x188d11[_0x88f9('0x46')];if(!_0x1f9b98[_0x88f9('0x43')][_0x88f9('0x4a')](_0x88f9('0x6a'))){_0x4ccfa4['limit']=qs[_0x88f9('0x2d')](_0x1f9b98[_0x88f9('0x43')][_0x88f9('0x2d')]);_0x4ccfa4[_0x88f9('0x2c')]=qs[_0x88f9('0x2c')](_0x1f9b98[_0x88f9('0x43')]['offset']);}_0x4ccfa4[_0x88f9('0x4b')]=qs[_0x88f9('0x4c')](_0x1f9b98[_0x88f9('0x43')][_0x88f9('0x4c')]);_0x4ccfa4[_0x88f9('0x4d')]=qs['filters'](_[_0x88f9('0x4e')](_0x1f9b98[_0x88f9('0x43')],_0x188d11[_0x88f9('0x44')]));_0x4ccfa4['where'][_0x88f9('0x66')]=_0x1ca86b['id'];if(_0x1f9b98[_0x88f9('0x43')][_0x88f9('0x4f')]){_0x4ccfa4['where']=_['merge'](_0x4ccfa4['where'],{'$or':_[_0x88f9('0x41')](_0x4ccfa4[_0x88f9('0x47')],function(_0x2880d1){var _0x119c8c={};_0x119c8c[_0x2880d1]={'$like':'%'+_0x1f9b98['query'][_0x88f9('0x4f')]+'%'};return _0x119c8c;})});}_0x4ccfa4=_[_0x88f9('0x52')]({},_0x4ccfa4,_0x1f9b98[_0x88f9('0x53')]);return db['Disposition'][_0x88f9('0x2f')]({'where':_0x4ccfa4[_0x88f9('0x4d')]})['then'](function(_0x1bd4c5){_0x3b5d4e['count']=_0x1bd4c5;if(_0x1f9b98[_0x88f9('0x43')][_0x88f9('0x54')]){_0x4ccfa4[_0x88f9('0x55')]=[{'all':!![]}];}return db[_0x88f9('0x67')][_0x88f9('0x56')](_0x4ccfa4);})['then'](function(_0x1ae42d){_0x3b5d4e['rows']=_0x1ae42d;return _0x3b5d4e;});}})['then'](respondWithFilteredResult(_0x5dfb7f,_0x4ccfa4))[_0x88f9('0x27')](handleError(_0x5dfb7f,null));};exports[_0x88f9('0x6b')]=function(_0x589716,_0xc9c07a,_0xb9f8e8){return db[_0x88f9('0x3e')][_0x88f9('0x5e')]({'where':{'id':_0x589716[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0xc9c07a,null))[_0x88f9('0x1d')](function(_0x163c79){if(_0x163c79){return _0x163c79[_0x88f9('0x6b')](_0x589716[_0x88f9('0x43')][_0x88f9('0x6c')]);}})[_0x88f9('0x1d')](respondWithStatusCode(_0xc9c07a,null))['catch'](handleError(_0xc9c07a,null));};exports[_0x88f9('0x6d')]=function(_0x1d5afc,_0x14120b,_0x34e003){if(_0x1d5afc[_0x88f9('0x62')]['id']){delete _0x1d5afc[_0x88f9('0x62')]['id'];}return db['SmsAccount'][_0x88f9('0x5e')]({'where':{'id':_0x1d5afc[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x14120b,null))[_0x88f9('0x1d')](function(_0xc2e9a){if(_0xc2e9a){_0x1d5afc[_0x88f9('0x62')][_0x88f9('0x66')]=_0xc2e9a['id'];return db[_0x88f9('0x6e')]['create'](_0x1d5afc[_0x88f9('0x62')]);}})[_0x88f9('0x1d')](respondWithResult(_0x14120b,null))[_0x88f9('0x27')](handleError(_0x14120b,null));};exports['getAnswers']=function(_0x153374,_0x121744,_0x3f3d70){var _0x572445={'raw':![],'where':{}};var _0xe3746c={};var _0x29377e={'count':0x0,'rows':[]};return db[_0x88f9('0x3e')]['findOne']({'where':{'id':_0x153374[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x121744,null))[_0x88f9('0x1d')](function(_0x26e3e0){if(_0x26e3e0){_0xe3746c[_0x88f9('0x46')]=_[_0x88f9('0x42')](db[_0x88f9('0x6e')]['rawAttributes']);_0xe3746c[_0x88f9('0x43')]=_[_0x88f9('0x42')](_0x153374['query']);_0xe3746c['filters']=_['intersection'](_0xe3746c['model'],_0xe3746c['query']);_0x572445[_0x88f9('0x47')]=_[_0x88f9('0x45')](_0xe3746c[_0x88f9('0x46')],qs['fields'](_0x153374['query']['fields']));_0x572445[_0x88f9('0x47')]=_0x572445[_0x88f9('0x47')][_0x88f9('0x49')]?_0x572445['attributes']:_0xe3746c[_0x88f9('0x46')];if(!_0x153374[_0x88f9('0x43')]['hasOwnProperty'](_0x88f9('0x6a'))){_0x572445[_0x88f9('0x2d')]=qs['limit'](_0x153374[_0x88f9('0x43')][_0x88f9('0x2d')]);_0x572445[_0x88f9('0x2c')]=qs[_0x88f9('0x2c')](_0x153374[_0x88f9('0x43')][_0x88f9('0x2c')]);}_0x572445['order']=qs[_0x88f9('0x4c')](_0x153374[_0x88f9('0x43')]['sort']);_0x572445['where']=qs[_0x88f9('0x44')](_[_0x88f9('0x4e')](_0x153374[_0x88f9('0x43')],_0xe3746c[_0x88f9('0x44')]));_0x572445['where'][_0x88f9('0x66')]=_0x26e3e0['id'];if(_0x153374[_0x88f9('0x43')][_0x88f9('0x4f')]){_0x572445['where']=_[_0x88f9('0x52')](_0x572445['where'],{'$or':_['map'](_0x572445[_0x88f9('0x47')],function(_0x32d28b){var _0x50bdf3={};_0x50bdf3[_0x32d28b]={'$like':'%'+_0x153374[_0x88f9('0x43')][_0x88f9('0x4f')]+'%'};return _0x50bdf3;})});}_0x572445=_['merge']({},_0x572445,_0x153374[_0x88f9('0x53')]);return db[_0x88f9('0x6e')][_0x88f9('0x2f')]({'where':_0x572445[_0x88f9('0x4d')]})[_0x88f9('0x1d')](function(_0x48cc14){_0x29377e[_0x88f9('0x2f')]=_0x48cc14;if(_0x153374[_0x88f9('0x43')]['includeAll']){_0x572445[_0x88f9('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x88f9('0x56')](_0x572445);})[_0x88f9('0x1d')](function(_0x391add){_0x29377e[_0x88f9('0x57')]=_0x391add;return _0x29377e;});}})[_0x88f9('0x1d')](respondWithFilteredResult(_0x121744,_0x572445))[_0x88f9('0x27')](handleError(_0x121744,null));};exports[_0x88f9('0x6f')]=function(_0x4754f1,_0x1b2df3,_0x59beb5){return db['SmsAccount']['find']({'where':{'id':_0x4754f1[_0x88f9('0x63')]['id']}})['then'](handleEntityNotFound(_0x1b2df3,null))['then'](function(_0xf69848){if(_0xf69848){return _0xf69848['removeAnswers'](_0x4754f1[_0x88f9('0x43')][_0x88f9('0x6c')]);}})['then'](respondWithStatusCode(_0x1b2df3,null))['catch'](handleError(_0x1b2df3,null));};exports['notify']=function(_0x3367ae,_0x3d1b09,_0x2ddec9){var _0x1fc633={'channel':_0x88f9('0x70')};var _0x2dd698=[];var _0xc8d571=[];var _0x2be2be={};return db[_0x88f9('0x3e')][_0x88f9('0x5e')]({'where':{'id':_0x3367ae[_0x88f9('0x63')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x88f9('0x71')}]})['then'](handleEntityNotFound(_0x3d1b09,null))[_0x88f9('0x1d')](function(_0x1878aa){_0x1fc633[_0x88f9('0x72')]=_0x1878aa;_0x1fc633[_0x88f9('0x73')]=_['orderBy'](_0x1878aa['Applications'],['priority'],[_0x88f9('0x74')]);if(_0x1fc633[_0x88f9('0x72')][_0x88f9('0x71')]){delete _0x1fc633[_0x88f9('0x72')][_0x88f9('0x71')];}return db[_0x88f9('0x75')]['describe']();})['then'](function(_0x10ba56){if(!_0x10ba56){throw new db['Sequelize'][(_0x88f9('0x76'))]('no\x20available\x20attributes');}_0x2dd698=_['difference'](_[_0x88f9('0x42')](_0x10ba56),[_0x88f9('0x77'),_0x88f9('0x78')]);_0xc8d571=_['difference'](_[_0x88f9('0x42')](_0x10ba56),[_0x88f9('0x77'),'updatedAt',_0x88f9('0x79'),_0x88f9('0x7a')]);_0x1fc633[_0x88f9('0x62')]={'mapKey':'mobile'};if(_0x1fc633['account'][_0x88f9('0x50')]){switch(_0x1fc633[_0x88f9('0x72')]['type']){case'twilio':_0x1fc633['body'][_0x88f9('0x7b')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7c')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')]['Body'];_0x1fc633[_0x88f9('0x62')]['messageId']=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7d')];break;case _0x88f9('0x7e'):_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]='+'+_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7f')];_0x1fc633['body']['body']=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x80')];break;case _0x88f9('0x81'):_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]=_0x3367ae[_0x88f9('0x62')]['from'];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x25')];break;case'clicksend':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7b')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x62')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x82')]=_0x3367ae['body'][_0x88f9('0x83')];break;case _0x88f9('0x84'):_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7c')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')]['Text'];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x82')]=_0x3367ae[_0x88f9('0x62')]['MessageUUID'];break;case _0x88f9('0x85'):_0x1fc633[_0x88f9('0x62')]['from']='+'+_0x3367ae[_0x88f9('0x62')][_0x88f9('0x86')][0x0]['from'];_0x1fc633['body'][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x86')][0x0][_0x88f9('0x80')];_0x1fc633['body'][_0x88f9('0x82')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x86')][0x0][_0x88f9('0x82')];break;case _0x88f9('0x87'):_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x88')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x89')][_0x88f9('0x25')];break;case _0x88f9('0x8a'):_0x1fc633[_0x88f9('0x62')]['from']=_0x3367ae[_0x88f9('0x62')]['fromNumber'];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x80')];_0x1fc633['body'][_0x88f9('0x82')]=_0x3367ae['body'][_0x88f9('0x8b')];break;case'bandwidth':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x82')]=_0x3367ae[_0x88f9('0x62')][0x0][_0x88f9('0x25')]['id'];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')]=_0x3367ae['body'][0x0][_0x88f9('0x25')]['from'];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][0x0][_0x88f9('0x25')]['text'];break;case'intelepeer':_0x1fc633['body']['from']=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x7b')];_0x1fc633['body'][_0x88f9('0x62')]=_0x3367ae[_0x88f9('0x62')][_0x88f9('0x25')];_0x1fc633[_0x88f9('0x62')][_0x88f9('0x82')]=_0x3367ae['body'][_0x88f9('0x8c')];break;}}if(_0x1fc633[_0x88f9('0x62')]['id']){delete _0x1fc633[_0x88f9('0x62')]['id'];}if(_[_0x88f9('0x8d')](_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')])){throw new db['Sequelize'][(_0x88f9('0x76'))](_0x88f9('0x8e'));}if(_['isNil'](_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')])||_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')]===''){throw new db[(_0x88f9('0x8f'))][(_0x88f9('0x76'))](_0x88f9('0x90'));}if(_[_0x88f9('0x8d')](_0x1fc633[_0x88f9('0x62')]['mapKey'])){throw new db['Sequelize'][(_0x88f9('0x76'))](_0x88f9('0x91')+_0xc8d571);}if(!_[_0x88f9('0x92')](_0xc8d571,_0x1fc633[_0x88f9('0x62')][_0x88f9('0x93')])){throw new db['Sequelize'][(_0x88f9('0x76'))](_0x88f9('0x94')+_0xc8d571);}_0x2be2be[_0x1fc633['body'][_0x88f9('0x93')]]=_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')];return db['CmList'][_0x88f9('0x5e')]({'where':{'id':_0x1fc633[_0x88f9('0x72')][_0x88f9('0x7a')]},'include':[{'model':db['CmContact'],'as':_0x88f9('0x95'),'where':_0x2be2be,'limit':0x1,'order':[['updatedAt',_0x88f9('0x96')]]}]});})[_0x88f9('0x1d')](handleEntityNotFound(_0x3d1b09,null))[_0x88f9('0x1d')](function(_0x1e3759){if(_0x1e3759){_0x1fc633[_0x88f9('0x97')]=_[_0x88f9('0x98')](_0x1e3759,['Contacts']);if(_0x1e3759[_0x88f9('0x95')][_0x88f9('0x49')]){return _0x1e3759[_0x88f9('0x95')][0x0];}var _0x1a5d6f=_[_0x88f9('0x99')](_0x1fc633[_0x88f9('0x62')],{'firstName':_0x1fc633['body'][_0x88f9('0x7b')],'ListId':_0x1e3759['id']});_0x1a5d6f[_0x1fc633[_0x88f9('0x62')]['mapKey']]=_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')];return db[_0x88f9('0x75')][_0x88f9('0x5a')](_0x1a5d6f,{'fields':_0x2dd698,'raw':!![]});}})['then'](handleEntityNotFound(_0x3d1b09,null))[_0x88f9('0x1d')](function(_0x1aedb4){if(_0x1aedb4){_0x1fc633[_0x88f9('0x9a')]=_0x1aedb4;var _0x3fe41d={'ContactId':_0x1aedb4['id'],'phone':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')],'SmsAccountId':_0x3367ae[_0x88f9('0x63')]['id']};var _0x5ea57c={'ContactId':_0x1aedb4['id'],'SmsAccountId':_0x3367ae[_0x88f9('0x63')]['id'],'closed':![]};return db[_0x88f9('0x9b')]['find']({'where':_0x5ea57c})['then'](function(_0x11d881){if(_0x11d881){return[_0x11d881,![]];}return db[_0x88f9('0x9b')][_0x88f9('0x5a')](_0x3fe41d)[_0x88f9('0x1d')](function(_0x31009f){return[_0x31009f,!![]];});});}})['spread'](function(_0x5220b9,_0x4647b5){_0x1fc633[_0x88f9('0x9c')]=_0x5220b9[_0x88f9('0x36')]({'plain':!![]});_0x1fc633[_0x88f9('0x9c')][_0x88f9('0x9d')]=![];if(_0x4647b5){if(_0x1fc633['account'][_0x88f9('0x9e')]){_0x1fc633[_0x88f9('0x73')][_0x88f9('0x9f')]({'id':0x0,'priority':_0x1fc633[_0x88f9('0x73')][_0x88f9('0x49')]+0x1,'app':_0x88f9('0xa0'),'appdata':_0x88f9('0xa1'),'interval':_0x88f9('0xa2')});}_0x1fc633['interaction'][_0x88f9('0x9d')]=!![];}return db[_0x88f9('0xa3')]['create']({'phone':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x7b')],'messageId':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x82')],'body':_0x1fc633[_0x88f9('0x62')][_0x88f9('0x62')],'SmsAccountId':_0x3367ae[_0x88f9('0x63')]['id'],'SmsInteractionId':_0x5220b9['id'],'direction':'in','ContactId':_0x5220b9[_0x88f9('0xa4')],'AttachmentId':_0x1fc633[_0x88f9('0x62')]['AttachmentId']});})[_0x88f9('0x1d')](function(_0x2887f2){_0x1fc633[_0x88f9('0x25')]=_0x2887f2;if(_0x1fc633[_0x88f9('0x9c')]['UserId']){return db[_0x88f9('0xa5')]['find']({'attributes':['id',_0x88f9('0x3a')],'where':{'id':_0x1fc633[_0x88f9('0x9c')]['UserId']}})[_0x88f9('0x1d')](function(_0x3fe979){if(_0x3fe979){_0x1fc633[_0x88f9('0x73')]['unshift']({'id':0x0,'priority':0x0,'app':_0x88f9('0xa6'),'appdata':_0x3fe979[_0x88f9('0x3a')]+','+(_0x1fc633[_0x88f9('0x72')][_0x88f9('0xa7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x88f9('0xa8'),_0x1fc633);});}return respondWithRpcPromise(_0x88f9('0xa9'),_0x88f9('0xa8'),_0x1fc633);})['then'](function(_0x16f87e){if(_0x16f87e){var _0x5de5f7=0xc8;var _0x4c6414=_0x88f9('0xaa');logger[_0x88f9('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4c6414,_0x5de5f7,'entity\x20found');logger[_0x88f9('0x20')](_0x88f9('0xab'),_0x4c6414,_0x5de5f7,'entity\x20found',JSON[_0x88f9('0x23')](_0x16f87e));if(_0x1fc633['account'][_0x88f9('0x50')]===_0x88f9('0xac')){return _0x3d1b09[_0x88f9('0x29')](_0x5de5f7)[_0x88f9('0x30')](_0x88f9('0xad'),'text/xml')['send'](_0x88f9('0xae'));}else{return _0x3d1b09[_0x88f9('0x29')](_0x5de5f7)[_0x88f9('0x2b')](_0x16f87e);}}})[_0x88f9('0x27')](handleError(_0x3d1b09,null));};exports[_0x88f9('0xaf')]=function(_0x58c598,_0x55befa){var _0x5e765c=_0x58c598[_0x88f9('0x63')]['id'];var _0xe2fe0c=_0x58c598['body'];var _0x5693e1=0xc8;var _0x3a1c76=null;return db[_0x88f9('0xb0')][_0x88f9('0xb1')]({'isolationLevel':db['sequelize'][_0x88f9('0xb2')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x10803f){return db[_0x88f9('0x3e')][_0x88f9('0x69')]({'where':{'id':_0x5e765c},'transaction':_0x10803f})['then'](function(_0x3981da){if(_0x3981da){return db[_0x88f9('0xb3')]['destroy']({'where':{'SmsAccountId':_0x5e765c},'transaction':_0x10803f})[_0x88f9('0x1d')](function(){var _0x4b8497=_['map'](_0xe2fe0c,function(_0x4e7a9a){_0x4e7a9a[_0x88f9('0x66')]=_0x5e765c;return _0x4e7a9a;});return db[_0x88f9('0xb3')][_0x88f9('0xb4')](_0x4b8497,{'transaction':_0x10803f});});}else{_0x5693e1=0x194;_0x3a1c76=[];}});})[_0x88f9('0x1d')](function(){if(_0x5693e1!==0x194){return db[_0x88f9('0xb3')][_0x88f9('0xb5')]({'where':{'SmsAccountId':_0x5e765c},'order':_0x88f9('0xb6')})[_0x88f9('0x1d')](function(_0x278952){_0x3a1c76=_0x278952;});}})[_0x88f9('0x27')](function(_0x173756){_0x5693e1=0x1f4;logger[_0x88f9('0x24')](_0x173756['stack']);if(_0x173756[_0x88f9('0x3a')]){delete _0x173756[_0x88f9('0x3a')];}_0x3a1c76=_0x173756;})[_0x88f9('0xb7')](function(){if(_0x3a1c76===null){_0x55befa['sendStatus'](_0x5693e1);}else{if(_0x5693e1===0x1f4){_0x55befa[_0x88f9('0x29')](_0x5693e1)['send'](_0x3a1c76);}else{_0x55befa[_0x88f9('0x29')](_0x5693e1)[_0x88f9('0x2b')](_0x3a1c76);}}});};exports['getApplications']=function(_0x1b9f37,_0x2bb870,_0x4d1b79){var _0x9519d6={};var _0x40cadf={};var _0x24636c;var _0x1909f5;return db[_0x88f9('0x3e')]['findOne']({'where':{'id':_0x1b9f37[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x2bb870,null))[_0x88f9('0x1d')](function(_0xf48121){if(_0xf48121){_0x24636c=_0xf48121;_0x40cadf['model']=_[_0x88f9('0x42')](db[_0x88f9('0xb3')]['rawAttributes']);_0x40cadf['query']=_[_0x88f9('0x42')](_0x1b9f37[_0x88f9('0x43')]);_0x40cadf[_0x88f9('0x44')]=_[_0x88f9('0x45')](_0x40cadf[_0x88f9('0x46')],_0x40cadf[_0x88f9('0x43')]);_0x9519d6['attributes']=_[_0x88f9('0x45')](_0x40cadf[_0x88f9('0x46')],qs[_0x88f9('0x48')](_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x48')]));_0x9519d6[_0x88f9('0x47')]=_0x9519d6[_0x88f9('0x47')]['length']?_0x9519d6[_0x88f9('0x47')]:_0x40cadf['model'];_0x9519d6[_0x88f9('0x4b')]=qs[_0x88f9('0x4c')](_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x4c')]);_0x9519d6['where']=qs[_0x88f9('0x44')](_[_0x88f9('0x4e')](_0x1b9f37[_0x88f9('0x43')],_0x40cadf[_0x88f9('0x44')]));if(_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x4f')]){_0x9519d6[_0x88f9('0x4d')]=_['merge'](_0x9519d6[_0x88f9('0x4d')],{'$or':_[_0x88f9('0x41')](_0x9519d6[_0x88f9('0x47')],function(_0x3912ed){var _0x294f04={};_0x294f04[_0x3912ed]={'$like':'%'+_0x1b9f37[_0x88f9('0x43')]['filter']+'%'};return _0x294f04;})});}_0x9519d6=_['merge']({},_0x9519d6,_0x1b9f37['options']);return _0x24636c[_0x88f9('0xb8')](_0x9519d6);}})[_0x88f9('0x1d')](function(_0x3156bf){if(_0x3156bf){_0x1909f5=_0x3156bf[_0x88f9('0x49')];if(!_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x4a')](_0x88f9('0x6a'))){_0x9519d6[_0x88f9('0x2d')]=qs[_0x88f9('0x2d')](_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x2d')]);_0x9519d6[_0x88f9('0x2c')]=qs[_0x88f9('0x2c')](_0x1b9f37[_0x88f9('0x43')][_0x88f9('0x2c')]);}return _0x24636c[_0x88f9('0xb8')](_0x9519d6);}})[_0x88f9('0x1d')](function(_0x4087ed){if(_0x4087ed){return _0x4087ed?{'count':_0x1909f5,'rows':_0x4087ed}:null;}})[_0x88f9('0x1d')](respondWithResult(_0x2bb870,null))[_0x88f9('0x27')](handleError(_0x2bb870,null));};exports[_0x88f9('0xb9')]=function(_0x4845c1,_0x46a948,_0x23ca16){var _0x217a73={'raw':![],'where':{}};var _0x255e2c={};var _0x1971e4={'count':0x0,'rows':[]};return db[_0x88f9('0x3e')][_0x88f9('0x69')]({'where':{'id':_0x4845c1[_0x88f9('0x63')]['id']}})['then'](handleEntityNotFound(_0x46a948,null))[_0x88f9('0x1d')](function(_0x2c962c){if(_0x2c962c){_0x255e2c[_0x88f9('0x46')]=_[_0x88f9('0x42')](db[_0x88f9('0x9b')][_0x88f9('0x3f')]);_0x255e2c[_0x88f9('0x43')]=_[_0x88f9('0x42')](_0x4845c1['query']);_0x255e2c['filters']=_[_0x88f9('0x45')](_0x255e2c['model'],_0x255e2c[_0x88f9('0x43')]);_0x217a73[_0x88f9('0x47')]=_[_0x88f9('0x45')](_0x255e2c[_0x88f9('0x46')],qs[_0x88f9('0x48')](_0x4845c1[_0x88f9('0x43')]['fields']));_0x217a73[_0x88f9('0x47')]=_0x217a73['attributes'][_0x88f9('0x49')]?_0x217a73[_0x88f9('0x47')]:_0x255e2c[_0x88f9('0x46')];if(!_0x4845c1[_0x88f9('0x43')][_0x88f9('0x4a')](_0x88f9('0x6a'))){_0x217a73[_0x88f9('0x2d')]=qs['limit'](_0x4845c1[_0x88f9('0x43')][_0x88f9('0x2d')]);_0x217a73[_0x88f9('0x2c')]=qs[_0x88f9('0x2c')](_0x4845c1[_0x88f9('0x43')]['offset']);}_0x217a73['order']=qs[_0x88f9('0x4c')](_0x4845c1[_0x88f9('0x43')]['sort']);_0x217a73[_0x88f9('0x4d')]=qs[_0x88f9('0x44')](_['pick'](_0x4845c1['query'],_0x255e2c[_0x88f9('0x44')]));_0x217a73['where'][_0x88f9('0x66')]=_0x2c962c['id'];if(_0x4845c1[_0x88f9('0x43')][_0x88f9('0x4f')]){_0x217a73[_0x88f9('0x4d')]=_['merge'](_0x217a73['where'],{'$or':_['map'](_0x217a73['attributes'],function(_0x51a0fc){var _0x37937f={};_0x37937f[_0x51a0fc]={'$like':'%'+_0x4845c1[_0x88f9('0x43')][_0x88f9('0x4f')]+'%'};return _0x37937f;})});}_0x217a73=_[_0x88f9('0x52')]({},_0x217a73,_0x4845c1[_0x88f9('0x53')]);return db['SmsInteraction'][_0x88f9('0x2f')]({'where':_0x217a73['where']})[_0x88f9('0x1d')](function(_0x1b0e7e){_0x1971e4['count']=_0x1b0e7e;if(_0x4845c1[_0x88f9('0x43')][_0x88f9('0x54')]){_0x217a73[_0x88f9('0x55')]=[{'model':db[_0x88f9('0x75')],'as':'Contact','required':![]},{'model':db[_0x88f9('0xa5')],'as':_0x88f9('0xba'),'attributes':[_0x88f9('0x3a'),_0x88f9('0xbb'),_0x88f9('0xbc')],'required':![]},{'model':db[_0x88f9('0xbd')],'as':'Tags','attributes':['id',_0x88f9('0x3a'),_0x88f9('0xbe')],'where':_0x4845c1[_0x88f9('0x43')][_0x88f9('0xbf')]?{'id':_0x4845c1[_0x88f9('0x43')][_0x88f9('0xbf')]}:undefined,'required':_0x4845c1['query'][_0x88f9('0xbf')]?!![]:![]}];}return db[_0x88f9('0x9b')][_0x88f9('0x56')](_0x217a73);})['then'](function(_0xdd1590){_0x1971e4[_0x88f9('0x57')]=_0xdd1590;return _0x1971e4;});}})[_0x88f9('0x1d')](respondWithFilteredResult(_0x46a948,_0x217a73))[_0x88f9('0x27')](handleError(_0x46a948,null));};exports[_0x88f9('0x3b')]=function(_0x117922,_0x4641ea,_0x5930a6){var _0x456c2e,_0x4339f5,_0x1b8bb9;if(_[_0x88f9('0x8d')](_0x117922[_0x88f9('0x62')]['body'])||_0x117922[_0x88f9('0x62')][_0x88f9('0x62')]===''){throw new db[(_0x88f9('0x8f'))][(_0x88f9('0x76'))](_0x88f9('0x90'));}if(_[_0x88f9('0x8d')](_0x117922[_0x88f9('0x62')]['to'])){throw new db['Sequelize'][(_0x88f9('0x76'))](_0x88f9('0xc0'));}_0x456c2e=_0x117922[_0x88f9('0x62')]['to'];return db['SmsAccount'][_0x88f9('0x5e')]({'where':{'id':_0x117922[_0x88f9('0x63')]['id']},'include':[{'model':db[_0x88f9('0xc1')],'as':'List','include':[{'model':db[_0x88f9('0x75')],'as':_0x88f9('0x95'),'where':{'mobile':_0x456c2e},'limit':0x1,'order':[[_0x88f9('0x78'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x4641ea,null))[_0x88f9('0x1d')](function(_0x2de8f4){if(_0x2de8f4&&_0x2de8f4[_0x88f9('0xc2')]){_0x4339f5=_0x2de8f4[_0x88f9('0x36')]({'plain':!![]});if(_0x4339f5[_0x88f9('0xc2')]&&_0x4339f5[_0x88f9('0xc2')][_0x88f9('0x95')][_0x88f9('0x49')]){return _0x4339f5[_0x88f9('0xc2')][_0x88f9('0x95')][0x0];}return db[_0x88f9('0x75')][_0x88f9('0x5a')](_['defaults'](_0x117922[_0x88f9('0x62')],{'firstName':_0x456c2e,'mobile':_0x456c2e,'phone':_0x456c2e,'ListId':_0x4339f5[_0x88f9('0x7a')]}));}})[_0x88f9('0x1d')](handleEntityNotFound(_0x4641ea,null))[_0x88f9('0x1d')](function(_0xe640){if(_0xe640){_0x1b8bb9=_0xe640;return db[_0x88f9('0x9b')][_0x88f9('0x5e')]({'where':{'ContactId':_0x1b8bb9['id'],'closed':![],'SmsAccountId':_0x4339f5['id']}})[_0x88f9('0x1d')](function(_0x433980){if(_0x433980){return[_0x433980,![]];}return db[_0x88f9('0x9b')][_0x88f9('0x5a')]({'UserId':_0x117922[_0x88f9('0x5b')]['id'],'ContactId':_0x1b8bb9['id'],'SmsAccountId':_0x4339f5['id'],'phone':_0x456c2e,'firstMsgDirection':_0x88f9('0xc3'),'Messages':[_[_0x88f9('0x52')](_0x117922[_0x88f9('0x62')],{'read':![],'body':_0x117922[_0x88f9('0x62')][_0x88f9('0x62')],'phone':_0x456c2e,'SmsAccountId':_0x4339f5['id'],'UserId':_0x117922[_0x88f9('0x5b')]['id'],'ContactId':_0x1b8bb9['id']})]},{'include':[{'model':db[_0x88f9('0xa3')],'as':'Messages'}]})[_0x88f9('0x1d')](function(_0x3585c7){return[_0x3585c7,!![]];});});}})[_0x88f9('0xc4')](function(_0x53df71,_0x1e56a1){if(_0x1e56a1){return _0x53df71;}return db['SmsMessage']['create'](_['merge'](_0x117922[_0x88f9('0x62')],{'read':![],'body':_0x117922['body']['body'],'phone':_0x456c2e,'SmsAccountId':_0x4339f5['id'],'SmsInteractionId':_0x53df71['id'],'UserId':_0x117922[_0x88f9('0x5b')]['id'],'ContactId':_0x1b8bb9['id']}))[_0x88f9('0x1d')](function(_0x5f3f4f){_0x53df71[_0x88f9('0xc5')][_0x88f9('0xc6')]=[];_0x53df71[_0x88f9('0xc5')][_0x88f9('0xc6')][_0x88f9('0x9f')](_0x5f3f4f['dataValues']);return _0x53df71;});})[_0x88f9('0x1d')](respondWithResult(_0x4641ea,null))[_0x88f9('0x27')](handleError(_0x4641ea,null));};exports[_0x88f9('0x29')]=function(_0xc870da,_0x3b38ec,_0x3bb855){if(_0xc870da[_0x88f9('0x62')]['id']){delete _0xc870da['body']['id'];}var _0x3a3f69,_0x3373ad,_0x41216c;return db[_0x88f9('0x3e')]['find']({'where':{'id':_0xc870da[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x3b38ec,null))[_0x88f9('0x1d')](function(_0x7dcac8){if(_0x7dcac8){_0x41216c=_0x7dcac8;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x88f9('0x29'),_0x88f9('0xc7'),_0x7dcac8[_0x88f9('0x50')],util['inspect'](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));switch(_0x7dcac8[_0x88f9('0x50')]){case'skebby':if(_0xc870da['body'][_0x88f9('0xc8')]&&_0xc870da[_0x88f9('0x62')][_0x88f9('0x29')]){_0x3373ad=_0xc870da[_0x88f9('0x62')]['status'];return db['SmsMessage'][_0x88f9('0x5e')]({'where':{'messageId':_0xc870da[_0x88f9('0x62')]['skebby_dispatch_id']}});}break;case'connectel':if(_0xc870da[_0x88f9('0x62')][_0x88f9('0xc9')]&&_0xc870da[_0x88f9('0x62')][_0x88f9('0xca')]){_0x3373ad=_0xc870da[_0x88f9('0x62')][_0x88f9('0xca')];return db['SmsMessage']['find']({'where':{'messageId':_0xc870da[_0x88f9('0x62')]['requestid']}});}break;case _0x88f9('0xcb'):if(_0xc870da[_0x88f9('0x62')][_0x88f9('0x83')]&&_0xc870da[_0x88f9('0x62')][_0x88f9('0xcc')]){_0x3373ad=_0xc870da[_0x88f9('0x62')][_0x88f9('0xcc')];return db[_0x88f9('0xa3')][_0x88f9('0x5e')]({'where':{'messageId':_0xc870da[_0x88f9('0x62')][_0x88f9('0x83')]}});}break;case'infobip':var _0x5903a9=_0xc870da[_0x88f9('0x62')][_0x88f9('0x86')][0x0];if(_0x5903a9[_0x88f9('0x82')]&&_0x5903a9['status']['groupName']===_0x88f9('0xcd')){_0x3373ad=_0x5903a9[_0x88f9('0x29')][_0x88f9('0xce')];return db[_0x88f9('0xa3')][_0x88f9('0x5e')]({'where':{'messageId':_0x5903a9['messageId']}});}break;case'clickatell':if(_0xc870da[_0x88f9('0x62')]['messageId']&&_0xc870da['body'][_0x88f9('0x29')]){_0x3373ad=_0xc870da[_0x88f9('0x62')]['status'];return db['SmsMessage'][_0x88f9('0x5e')]({'where':{'messageId':_0xc870da[_0x88f9('0x62')]['messageId']}});}break;case'bandwidth':if(_0xc870da[_0x88f9('0x62')][0x0]['message']['id']){_0x3373ad=_0xc870da[_0x88f9('0x62')][0x0]['type'];return db[_0x88f9('0xa3')][_0x88f9('0x5e')]({'where':{'messageId':_0xc870da[_0x88f9('0x62')][0x0]['message']['id']}});}break;case _0x88f9('0xcf'):if(_0xc870da['body'][_0x88f9('0xd0')]&&_0xc870da[_0x88f9('0x62')][_0x88f9('0x29')]){_0x3373ad=_0xc870da[_0x88f9('0x62')][_0x88f9('0x29')];return db['SmsMessage'][_0x88f9('0x5e')]({'where':{'messageId':_0xc870da[_0x88f9('0x62')]['redif']}});}break;}}})[_0x88f9('0x1d')](handleEntityNotFound(_0x3b38ec,null))[_0x88f9('0x1d')](function(_0x318836){if(_0x318836){_0x3a3f69=_0x318836;switch(_0x41216c['type']){case _0x88f9('0x7e'):if(_0x3373ad===_0x88f9('0xcd')){return _0x3a3f69[_0x88f9('0x34')]({'read':!![]});}else{logger['error'](_0x88f9('0x21'),_0x88f9('0x29'),_0x88f9('0x7e'),util['inspect'](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x88f9('0x81'):if(_0x3373ad==='1'){return _0x3a3f69[_0x88f9('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x88f9('0x7e'),util[_0x88f9('0xd1')](_0xc870da['body'],{'showHidden':![],'depth':null}));}break;case _0x88f9('0xcb'):if(!_0xc870da[_0x88f9('0x62')][_0x88f9('0xd2')]&&_0x3373ad>=0xc8&&_0x3373ad<=0xce){return _0x3a3f69[_0x88f9('0x34')]({'read':!![]});}else{logger['error'](_0x88f9('0x21'),_0x88f9('0x29'),'clicksend',util['inspect'](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x88f9('0x85'):var _0xf6fdba=_0xc870da[_0x88f9('0x62')][_0x88f9('0x86')][0x0];if(_0xf6fdba[_0x88f9('0x29')][_0x88f9('0xce')]==='DELIVERED'){return _0x3a3f69['update']({'read':!![]});}else{logger[_0x88f9('0x24')](_0x88f9('0x21'),'status','infobip',util['inspect'](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3373ad=='DELIVERED_TO_GATEWAY'||_0x3373ad=='RECEIVED_BY_RECIPIENT'){return _0x3a3f69[_0x88f9('0x34')]({'read':!![]});}else{logger['error'](_0x88f9('0x21'),'status','clickatell',util[_0x88f9('0xd1')](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3373ad=='message-delivered'){return _0x3a3f69['update']({'read':!![]});}else{logger['error'](_0x88f9('0x21'),'status',_0x88f9('0xd3'),util[_0x88f9('0xd1')](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;case _0x88f9('0xcf'):if(_0x3373ad==='DELIVRD'||_0x3373ad==='ACCEPTD'){return _0x3a3f69[_0x88f9('0x34')]({'read':!![]});}else{logger[_0x88f9('0x24')](_0x88f9('0x21'),_0x88f9('0x29'),_0x88f9('0xcf'),util['inspect'](_0xc870da[_0x88f9('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x3a3f69;}})[_0x88f9('0x1d')](respondWithResult(_0x3b38ec,null))[_0x88f9('0x27')](handleError(_0x3b38ec,null));};exports[_0x88f9('0xd4')]=function(_0x1607d4,_0x57771e,_0x440bbc){var _0x3612d0,_0x20b8d9,_0x4b962e;return db[_0x88f9('0x3e')]['find']({'where':{'id':_0x1607d4[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x57771e,null))[_0x88f9('0x1d')](function(_0x3c1663){if(_0x3c1663){_0x4b962e=_0x3c1663;logger[_0x88f9('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x88f9('0x29'),_0x88f9('0xc7'),_0x3c1663['type'],util[_0x88f9('0xd1')](_0x1607d4['query'],{'showHidden':![],'depth':null}));switch(_0x3c1663[_0x88f9('0x50')]){case _0x88f9('0x87'):if(_0x1607d4[_0x88f9('0x43')][_0x88f9('0xd5')]&&_0x1607d4[_0x88f9('0x43')][_0x88f9('0xd6')]){_0x20b8d9=_0x1607d4[_0x88f9('0x43')][_0x88f9('0xd6')];return db[_0x88f9('0xa3')]['find']({'where':{'messageId':_0x1607d4['query']['message-id']}});}break;}}})[_0x88f9('0x1d')](handleEntityNotFound(_0x57771e,null))[_0x88f9('0x1d')](function(_0x57c9f8){if(_0x57c9f8){_0x3612d0=_0x57c9f8;switch(_0x4b962e[_0x88f9('0x50')]){case _0x88f9('0x87'):if(_0x20b8d9==='2'||_0x20b8d9==='6'){return _0x3612d0[_0x88f9('0x34')]({'read':!![]});}else{logger[_0x88f9('0x24')](_0x88f9('0x21'),_0x88f9('0x29'),'csc',util[_0x88f9('0xd1')](_0x1607d4[_0x88f9('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x3612d0;}})[_0x88f9('0x1d')](respondWithResult(_0x57771e,null))[_0x88f9('0x27')](handleError(_0x57771e,null));};exports['addAgents']=function(_0x4d9ad4,_0x12f8f3,_0x2bbf7c){return db[_0x88f9('0x3e')][_0x88f9('0x5e')]({'where':{'id':_0x4d9ad4[_0x88f9('0x63')]['id']}})[_0x88f9('0x1d')](handleEntityNotFound(_0x12f8f3,null))[_0x88f9('0x1d')](function(_0x41b394){if(_0x41b394){return _0x41b394[_0x88f9('0xd7')](_0x4d9ad4[_0x88f9('0x62')][_0x88f9('0x6c')],_[_0x88f9('0x98')](_0x4d9ad4[_0x88f9('0x62')],[_0x88f9('0x6c'),'id'])||{})['spread'](function(_0x30ac60){for(var _0x20f8bf=0x0;_0x20f8bf<_0x4d9ad4[_0x88f9('0x62')][_0x88f9('0x6c')][_0x88f9('0x49')];_0x20f8bf+=0x1){socket[_0x88f9('0xd8')](_0x88f9('0xd9'),{'UserId':Number(_0x4d9ad4[_0x88f9('0x62')][_0x88f9('0x6c')][_0x20f8bf]),'SmsAccountId':Number(_0x4d9ad4[_0x88f9('0x63')]['id'])});}return _0x30ac60;});}})[_0x88f9('0x1d')](respondWithResult(_0x12f8f3,null))[_0x88f9('0x27')](handleError(_0x12f8f3,null));};exports[_0x88f9('0xda')]=function(_0x283472,_0x5ae120,_0x376b12){return db[_0x88f9('0x3e')]['find']({'where':{'id':_0x283472[_0x88f9('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ae120,null))[_0x88f9('0x1d')](function(_0xa2d9ba){if(_0xa2d9ba){return _0xa2d9ba[_0x88f9('0xda')](_0x283472[_0x88f9('0x43')][_0x88f9('0x6c')])['then'](function(){if(_[_0x88f9('0xdb')](_0x283472[_0x88f9('0x43')][_0x88f9('0x6c')])){for(var _0x521233=0x0;_0x521233<_0x283472[_0x88f9('0x43')][_0x88f9('0x6c')]['length'];_0x521233+=0x1){socket[_0x88f9('0xd8')]('userSmsAccount:remove',{'UserId':Number(_0x283472['query']['ids'][_0x521233]),'SmsAccountId':Number(_0x283472[_0x88f9('0x63')]['id'])});}}else{socket[_0x88f9('0xd8')](_0x88f9('0xdc'),{'UserId':Number(_0x283472[_0x88f9('0x43')]['ids']),'SmsAccountId':Number(_0x283472[_0x88f9('0x63')]['id'])});}});}})[_0x88f9('0x1d')](respondWithStatusCode(_0x5ae120,null))['catch'](handleError(_0x5ae120,null));};exports[_0x88f9('0xdd')]=function(_0x3161ee,_0x161f9d,_0x209a57){var _0x234ae2={};var _0x652fcc={};var _0x3229c0;var _0x1f4200;return db[_0x88f9('0x3e')][_0x88f9('0x69')]({'where':{'id':_0x3161ee[_0x88f9('0x63')]['id']}})['then'](handleEntityNotFound(_0x161f9d,null))[_0x88f9('0x1d')](function(_0x402c7f){if(_0x402c7f){_0x3229c0=_0x402c7f;_0x652fcc[_0x88f9('0x46')]=_[_0x88f9('0x42')](db[_0x88f9('0xa5')][_0x88f9('0x3f')]);_0x652fcc[_0x88f9('0x43')]=_[_0x88f9('0x42')](_0x3161ee[_0x88f9('0x43')]);_0x652fcc['filters']=_['intersection'](_0x652fcc[_0x88f9('0x46')],_0x652fcc[_0x88f9('0x43')]);_0x234ae2['attributes']=_[_0x88f9('0x45')](_0x652fcc[_0x88f9('0x46')],qs['fields'](_0x3161ee[_0x88f9('0x43')][_0x88f9('0x48')]));_0x234ae2[_0x88f9('0x47')]=_0x234ae2[_0x88f9('0x47')][_0x88f9('0x49')]?_0x234ae2[_0x88f9('0x47')]:_0x652fcc[_0x88f9('0x46')];_0x234ae2[_0x88f9('0x4b')]=qs[_0x88f9('0x4c')](_0x3161ee[_0x88f9('0x43')]['sort']);_0x234ae2['where']=qs[_0x88f9('0x44')](_['pick'](_0x3161ee['query'],_0x652fcc[_0x88f9('0x44')]));if(_0x3161ee['query']['filter']){_0x234ae2[_0x88f9('0x4d')]=_[_0x88f9('0x52')](_0x234ae2['where'],{'$or':_['map'](_0x234ae2[_0x88f9('0x47')],function(_0x31906d){var _0x2b8a64={};_0x2b8a64[_0x31906d]={'$like':'%'+_0x3161ee['query']['filter']+'%'};return _0x2b8a64;})});}_0x234ae2=_[_0x88f9('0x52')]({},_0x234ae2,_0x3161ee[_0x88f9('0x53')]);return _0x3229c0[_0x88f9('0xdd')](_0x234ae2);}})[_0x88f9('0x1d')](function(_0x596ea6){if(_0x596ea6){_0x1f4200=_0x596ea6[_0x88f9('0x49')];if(!_0x3161ee[_0x88f9('0x43')]['hasOwnProperty'](_0x88f9('0x6a'))){_0x234ae2[_0x88f9('0x2d')]=qs[_0x88f9('0x2d')](_0x3161ee[_0x88f9('0x43')][_0x88f9('0x2d')]);_0x234ae2['offset']=qs['offset'](_0x3161ee['query'][_0x88f9('0x2c')]);}return _0x3229c0[_0x88f9('0xdd')](_0x234ae2);}})['then'](function(_0x2e28af){if(_0x2e28af){return _0x2e28af?{'count':_0x1f4200,'rows':_0x2e28af}:null;}})[_0x88f9('0x1d')](respondWithResult(_0x161f9d,null))[_0x88f9('0x27')](handleError(_0x161f9d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 4552c4f..0e5049b 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 _0xd931=['update','remove','hook','events','SmsAccount','setMaxListeners'];(function(_0x5739a0,_0xb962fd){var _0x576adf=function(_0x2fb06a){while(--_0x2fb06a){_0x5739a0['push'](_0x5739a0['shift']());}};_0x576adf(++_0xb962fd);}(_0xd931,0xa5));var _0x1d93=function(_0x445024,_0x36dca6){_0x445024=_0x445024-0x0;var _0x5ab19a=_0xd931[_0x445024];return _0x5ab19a;};'use strict';var EventEmitter=require(_0x1d93('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x1d93('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1d93('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d93('0x3'),'afterDestroy':_0x1d93('0x4')};function emitEvent(_0x19d815){return function(_0x49e1f0,_0x201d0a,_0x4cb6fa){SmsAccountEvents['emit'](_0x19d815+':'+_0x49e1f0['id'],_0x49e1f0);SmsAccountEvents['emit'](_0x19d815,_0x49e1f0);_0x4cb6fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x1d93('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x5a22=['update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x5a22,0x19c));var _0x25a2=function(_0x5df952,_0x3940da){_0x5df952=_0x5df952-0x0;var _0xf5400a=_0x5a22[_0x5df952];return _0xf5400a;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x25a2('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25a2('0x1'),'afterDestroy':_0x25a2('0x2')};function emitEvent(_0x3f7d6a){return function(_0x1b0c64,_0x1da852,_0x198206){SmsAccountEvents[_0x25a2('0x3')](_0x3f7d6a+':'+_0x1b0c64['id'],_0x1b0c64);SmsAccountEvents[_0x25a2('0x3')](_0x3f7d6a,_0x1b0c64);_0x198206(null);};}for(var e in events){if(events[_0x25a2('0x4')](e)){var event=events[e];SmsAccount[_0x25a2('0x5')](e,emitEvent(event));}}module[_0x25a2('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 7b535ca..d0cb30a 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 _0x3864=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3864,0x19a));var _0x4386=function(_0x5050a5,_0xf261b0){_0x5050a5=_0x5050a5-0x0;var _0x4a1894=_0x3864[_0x5050a5];return _0x4a1894;};'use strict';var _=require(_0x4386('0x0'));var util=require(_0x4386('0x1'));var logger=require(_0x4386('0x2'))(_0x4386('0x3'));var moment=require(_0x4386('0x4'));var BPromise=require('bluebird');var rp=require(_0x4386('0x5'));var fs=require('fs');var path=require(_0x4386('0x6'));var rimraf=require(_0x4386('0x7'));var config=require(_0x4386('0x8'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x559701,_0x3b0283){return _0x559701[_0x4386('0x9')](_0x4386('0xa'),attributes,{'tableName':_0x4386('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf08=['lodash','util','moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x5e50a6,_0xdbac2e){var _0x5df0da=function(_0x44d6b2){while(--_0x44d6b2){_0x5e50a6['push'](_0x5e50a6['shift']());}};_0x5df0da(++_0xdbac2e);}(_0xcf08,0x172));var _0x8cf0=function(_0x5b7ec7,_0x50bf3b){_0x5b7ec7=_0x5b7ec7-0x0;var _0x3c1fe9=_0xcf08[_0x5b7ec7];return _0x3c1fe9;};'use strict';var _=require(_0x8cf0('0x0'));var util=require(_0x8cf0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cf0('0x2'));var BPromise=require(_0x8cf0('0x3'));var rp=require(_0x8cf0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8cf0('0x5'));var attributes=require(_0x8cf0('0x6'));module[_0x8cf0('0x7')]=function(_0x60624a,_0x1f407a){return _0x60624a[_0x8cf0('0x8')](_0x8cf0('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e8f7f89..209dd79 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 _0xdc3a=['localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','where','attributes','map','include','model','then','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xdc3a,0xf1));var _0xadc3=function(_0x8e0fca,_0x49f808){_0x8e0fca=_0x8e0fca-0x0;var _0xe57c68=_0xdc3a[_0x8e0fca];return _0xe57c68;};'use strict';var _=require(_0xadc3('0x0'));var util=require('util');var moment=require(_0xadc3('0x1'));var BPromise=require(_0xadc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadc3('0x3'))['db'];var utils=require(_0xadc3('0x4'));var logger=require('../../config/logger')(_0xadc3('0x5'));var config=require(_0xadc3('0x6'));var jayson=require(_0xadc3('0x7'));var client=jayson[_0xadc3('0x8')][_0xadc3('0x9')]({'port':0x232a});config[_0xadc3('0xa')]=_['defaults'](config['redis'],{'host':_0xadc3('0xb'),'port':0x18eb});var socket=require(_0xadc3('0xc'))(new Redis(config[_0xadc3('0xa')]));require(_0xadc3('0xd'))[_0xadc3('0xe')](socket);function respondWithRpcPromise(_0x279ea7,_0x144d87,_0xfb7faf){return new BPromise(function(_0x490b6c,_0x711280){return client[_0xadc3('0xf')](_0x279ea7,_0xfb7faf)['then'](function(_0x32b69a){logger[_0xadc3('0x10')](_0xadc3('0x11'),_0x144d87,'request\x20sent');logger[_0xadc3('0x12')](_0xadc3('0x13'),_0x144d87,_0xadc3('0x14'),JSON[_0xadc3('0x15')](_0x32b69a));if(_0x32b69a[_0xadc3('0x16')]){if(_0x32b69a[_0xadc3('0x16')][_0xadc3('0x17')]===0x1f4){logger['error'](_0xadc3('0x11'),_0x144d87,_0x32b69a[_0xadc3('0x16')][_0xadc3('0x18')]);return _0x711280(_0x32b69a[_0xadc3('0x16')]['message']);}logger[_0xadc3('0x16')](_0xadc3('0x11'),_0x144d87,_0x32b69a[_0xadc3('0x16')][_0xadc3('0x18')]);return _0x490b6c(_0x32b69a[_0xadc3('0x16')]['message']);}else{logger['info'](_0xadc3('0x11'),_0x144d87,_0xadc3('0x14'));_0x490b6c(_0x32b69a[_0xadc3('0x19')]['message']);}})[_0xadc3('0x1a')](function(_0x5431c7){logger[_0xadc3('0x16')](_0xadc3('0x11'),_0x144d87,_0x5431c7);_0x711280(_0x5431c7);});});}exports[_0xadc3('0x1b')]=function(_0x563812){var _0x43813b=this;return new Promise(function(_0x27ca74,_0x1eae57){return db[_0xadc3('0x1c')]['find']({'raw':_0x563812[_0xadc3('0x1d')]?_0x563812[_0xadc3('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x563812[_0xadc3('0x1d')]?_0x563812[_0xadc3('0x1d')][_0xadc3('0x1e')]||null:null,'attributes':_0x563812['options']?_0x563812[_0xadc3('0x1d')][_0xadc3('0x1f')]||null:null,'include':_0x563812[_0xadc3('0x1d')]?_0x563812['options']['include']?_[_0xadc3('0x20')](_0x563812[_0xadc3('0x1d')][_0xadc3('0x21')],function(_0x4c1908){return{'model':db[_0x4c1908[_0xadc3('0x22')]],'as':_0x4c1908['as'],'attributes':_0x4c1908[_0xadc3('0x1f')],'include':_0x4c1908[_0xadc3('0x21')]?_[_0xadc3('0x20')](_0x4c1908[_0xadc3('0x21')],function(_0xfc7823){return{'model':db[_0xfc7823[_0xadc3('0x22')]],'as':_0xfc7823['as'],'attributes':_0xfc7823[_0xadc3('0x1f')],'include':_0xfc7823[_0xadc3('0x21')]?_[_0xadc3('0x20')](_0xfc7823['include'],function(_0x35639d){return{'model':db[_0x35639d['model']],'as':_0x35639d['as'],'attributes':_0x35639d[_0xadc3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xadc3('0x23')](function(_0x15159c){logger[_0xadc3('0x10')](_0xadc3('0x1b'),_0x563812);logger['debug'](_0xadc3('0x1b'),_0x563812,JSON[_0xadc3('0x15')](_0x15159c));_0x27ca74(_0x15159c);})['catch'](function(_0x15ff59){logger[_0xadc3('0x16')]('ShowSmsAccount',_0x15ff59[_0xadc3('0x18')],_0x563812);_0x1eae57(_0x43813b[_0xadc3('0x16')](0x1f4,_0x15ff59[_0xadc3('0x18')]));});});}; \ No newline at end of file +var _0x8b11=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','options','raw','where','attributes','include','map','model','ShowSmsAccount'];(function(_0x30ebd3,_0x54c1f7){var _0xff3f15=function(_0x55400e){while(--_0x55400e){_0x30ebd3['push'](_0x30ebd3['shift']());}};_0xff3f15(++_0x54c1f7);}(_0x8b11,0x10b));var _0x18b1=function(_0x8cea57,_0x290172){_0x8cea57=_0x8cea57-0x0;var _0x25ce1d=_0x8b11[_0x8cea57];return _0x25ce1d;};'use strict';var _=require(_0x18b1('0x0'));var util=require(_0x18b1('0x1'));var moment=require('moment');var BPromise=require(_0x18b1('0x2'));var rs=require(_0x18b1('0x3'));var fs=require('fs');var Redis=require(_0x18b1('0x4'));var db=require(_0x18b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x18b1('0x6'))(_0x18b1('0x7'));var config=require(_0x18b1('0x8'));var jayson=require(_0x18b1('0x9'));var client=jayson[_0x18b1('0xa')][_0x18b1('0xb')]({'port':0x232a});config[_0x18b1('0xc')]=_[_0x18b1('0xd')](config[_0x18b1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x18b1('0xe'))(new Redis(config[_0x18b1('0xc')]));require('./smsAccount.socket')[_0x18b1('0xf')](socket);function respondWithRpcPromise(_0x5ca808,_0x59d5d1,_0x29e9c9){return new BPromise(function(_0x5ef7fe,_0x208b1b){return client[_0x18b1('0x10')](_0x5ca808,_0x29e9c9)[_0x18b1('0x11')](function(_0x4f8dd4){logger[_0x18b1('0x12')](_0x18b1('0x13'),_0x59d5d1,_0x18b1('0x14'));logger[_0x18b1('0x15')](_0x18b1('0x16'),_0x59d5d1,_0x18b1('0x14'),JSON[_0x18b1('0x17')](_0x4f8dd4));if(_0x4f8dd4[_0x18b1('0x18')]){if(_0x4f8dd4['error'][_0x18b1('0x19')]===0x1f4){logger[_0x18b1('0x18')]('SmsAccount,\x20%s,\x20%s',_0x59d5d1,_0x4f8dd4[_0x18b1('0x18')][_0x18b1('0x1a')]);return _0x208b1b(_0x4f8dd4[_0x18b1('0x18')][_0x18b1('0x1a')]);}logger[_0x18b1('0x18')](_0x18b1('0x13'),_0x59d5d1,_0x4f8dd4['error'][_0x18b1('0x1a')]);return _0x5ef7fe(_0x4f8dd4[_0x18b1('0x18')]['message']);}else{logger[_0x18b1('0x12')](_0x18b1('0x13'),_0x59d5d1,'request\x20sent');_0x5ef7fe(_0x4f8dd4[_0x18b1('0x1b')][_0x18b1('0x1a')]);}})['catch'](function(_0x39d033){logger[_0x18b1('0x18')](_0x18b1('0x13'),_0x59d5d1,_0x39d033);_0x208b1b(_0x39d033);});});}exports['ShowSmsAccount']=function(_0x1e3858){var _0x35ba75=this;return new Promise(function(_0x4a66fe,_0x241842){return db['SmsAccount'][_0x18b1('0x1c')]({'raw':_0x1e3858[_0x18b1('0x1d')]?_0x1e3858[_0x18b1('0x1d')][_0x18b1('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e3858[_0x18b1('0x1d')]?_0x1e3858['options'][_0x18b1('0x1f')]||null:null,'attributes':_0x1e3858[_0x18b1('0x1d')]?_0x1e3858[_0x18b1('0x1d')][_0x18b1('0x20')]||null:null,'include':_0x1e3858[_0x18b1('0x1d')]?_0x1e3858[_0x18b1('0x1d')][_0x18b1('0x21')]?_[_0x18b1('0x22')](_0x1e3858[_0x18b1('0x1d')][_0x18b1('0x21')],function(_0x4e1a22){return{'model':db[_0x4e1a22[_0x18b1('0x23')]],'as':_0x4e1a22['as'],'attributes':_0x4e1a22['attributes'],'include':_0x4e1a22[_0x18b1('0x21')]?_[_0x18b1('0x22')](_0x4e1a22[_0x18b1('0x21')],function(_0x1efa5a){return{'model':db[_0x1efa5a[_0x18b1('0x23')]],'as':_0x1efa5a['as'],'attributes':_0x1efa5a[_0x18b1('0x20')],'include':_0x1efa5a['include']?_[_0x18b1('0x22')](_0x1efa5a[_0x18b1('0x21')],function(_0x11a6bb){return{'model':db[_0x11a6bb[_0x18b1('0x23')]],'as':_0x11a6bb['as'],'attributes':_0x11a6bb[_0x18b1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a052c){logger[_0x18b1('0x12')]('ShowSmsAccount',_0x1e3858);logger[_0x18b1('0x15')](_0x18b1('0x24'),_0x1e3858,JSON['stringify'](_0x5a052c));_0x4a66fe(_0x5a052c);})[_0x18b1('0x25')](function(_0x29c4fc){logger[_0x18b1('0x18')](_0x18b1('0x24'),_0x29c4fc[_0x18b1('0x1a')],_0x1e3858);_0x241842(_0x35ba75[_0x18b1('0x18')](0x1f4,_0x29c4fc[_0x18b1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1612304..d30ecbb 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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 diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index c7b3fe2..6ccf2c6 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x576f72,_0x3779e7){var _0x29878d=function(_0x36d076){while(--_0x36d076){_0x576f72['push'](_0x576f72['shift']());}};_0x29878d(++_0x3779e7);}(_0x3e74,0x175));var _0x43e7=function(_0x2bf644,_0x49f9e0){_0x2bf644=_0x2bf644-0x0;var _0x127daf=_0x3e74[_0x2bf644];return _0x127daf;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x12d85a,_0x8a8a3d){var _0x12a0a9=function(_0x380cc6){while(--_0x380cc6){_0x12d85a['push'](_0x12d85a['shift']());}};_0x12a0a9(++_0x8a8a3d);}(_0x3e74,0x175));var _0x43e7=function(_0x34e4bc,_0x5d2812){_0x34e4bc=_0x34e4bc-0x0;var _0x5bccd7=_0x3e74[_0x34e4bc];return _0x5bccd7;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 27a7f8f..a4a58f8 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 _0x507e=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xa1d083,_0x474e3b){var _0x192c6d=function(_0x353d96){while(--_0x353d96){_0xa1d083['push'](_0xa1d083['shift']());}};_0x192c6d(++_0x474e3b);}(_0x507e,0x1bc));var _0xe507=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0x507e[_0x2a18b7];return _0x45e74e;};'use strict';var Sequelize=require('sequelize');module[_0xe507('0x0')]={'priority':{'type':Sequelize[_0xe507('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe507('0x2')],'allowNull':![],'defaultValue':_0xe507('0x3')},'appdata':{'type':Sequelize[_0xe507('0x4')]()},'description':{'type':Sequelize[_0xe507('0x2')]},'interval':{'type':Sequelize[_0xe507('0x2')],'defaultValue':_0xe507('0x5')}}; \ No newline at end of file +var _0x09c8=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x408d4b,_0x451bad){var _0x56cdb1=function(_0x37c92f){while(--_0x37c92f){_0x408d4b['push'](_0x408d4b['shift']());}};_0x56cdb1(++_0x451bad);}(_0x09c8,0x1af));var _0x809c=function(_0x4f23ba,_0x31a525){_0x4f23ba=_0x4f23ba-0x0;var _0x35d280=_0x09c8[_0x4f23ba];return _0x35d280;};'use strict';var Sequelize=require(_0x809c('0x0'));module[_0x809c('0x1')]={'priority':{'type':Sequelize[_0x809c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x809c('0x3')],'allowNull':![],'defaultValue':_0x809c('0x4')},'appdata':{'type':Sequelize[_0x809c('0x5')]()},'description':{'type':Sequelize[_0x809c('0x3')]},'interval':{'type':Sequelize[_0x809c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6a17851..40ac6f4 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 _0xe91c=['limit','count','offset','Content-Range','reject','save','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','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'];(function(_0x50975f,_0x15dfe7){var _0x3dedca=function(_0x5ba277){while(--_0x5ba277){_0x50975f['push'](_0x50975f['shift']());}};_0x3dedca(++_0x15dfe7);}(_0xe91c,0x152));var _0xce91=function(_0x158bfb,_0x4db752){_0x158bfb=_0x158bfb-0x0;var _0x435261=_0xe91c[_0x158bfb];return _0x435261;};'use strict';var emlformat=require(_0xce91('0x0'));var rimraf=require(_0xce91('0x1'));var zipdir=require(_0xce91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce91('0x3'));var moment=require(_0xce91('0x4'));var BPromise=require(_0xce91('0x5'));var Mustache=require(_0xce91('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce91('0x7'));var fs=require('fs');var fs_extra=require(_0xce91('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce91('0x9'));var jsforce=require(_0xce91('0xa'));var deskjs=require(_0xce91('0xb'));var toCsv=require(_0xce91('0xc'));var querystring=require(_0xce91('0xd'));var Papa=require(_0xce91('0xe'));var Redis=require('ioredis');var authService=require(_0xce91('0xf'));var qs=require(_0xce91('0x10'));var as=require(_0xce91('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce91('0x12'))(_0xce91('0x13'));var utils=require(_0xce91('0x14'));var config=require(_0xce91('0x15'));var licenseUtil=require(_0xce91('0x16'));var db=require(_0xce91('0x17'))['db'];function respondWithStatusCode(_0x5ded1b,_0x3ec50e){_0x3ec50e=_0x3ec50e||0xcc;return function(_0x15b25f){if(_0x15b25f){return _0x5ded1b[_0xce91('0x18')](_0x3ec50e);}return _0x5ded1b[_0xce91('0x19')](_0x3ec50e)['end']();};}function respondWithResult(_0x5155e8,_0x3e2e26){_0x3e2e26=_0x3e2e26||0xc8;return function(_0x97035d){if(_0x97035d){return _0x5155e8['status'](_0x3e2e26)[_0xce91('0x1a')](_0x97035d);}};}function respondWithFilteredResult(_0x1b5721,_0x906699){return function(_0x291346){if(_0x291346){var _0x1cc0c7=typeof _0x906699['offset']==='undefined'&&typeof _0x906699[_0xce91('0x1b')]==='undefined';var _0x384c9f=_0x291346[_0xce91('0x1c')];var _0x492907=_0x1cc0c7?0x0:_0x906699['offset'];var _0x322387=_0x1cc0c7?_0x291346[_0xce91('0x1c')]:_0x906699[_0xce91('0x1d')]+_0x906699[_0xce91('0x1b')];var _0x4b3fde;if(_0x322387>=_0x384c9f){_0x322387=_0x384c9f;_0x4b3fde=0xc8;}else{_0x4b3fde=0xce;}_0x1b5721[_0xce91('0x19')](_0x4b3fde);return _0x1b5721['set'](_0xce91('0x1e'),_0x492907+'-'+_0x322387+'/'+_0x384c9f)[_0xce91('0x1a')](_0x291346);}return null;};}function patchUpdates(_0x40cab9){return function(_0x3e9ec9){try{jsonpatch['apply'](_0x3e9ec9,_0x40cab9,!![]);}catch(_0x5e2de6){return BPromise[_0xce91('0x1f')](_0x5e2de6);}return _0x3e9ec9[_0xce91('0x20')]();};}function saveUpdates(_0x275e4b,_0x2c9968){return function(_0x20ae02){if(_0x20ae02){return _0x20ae02['update'](_0x275e4b)['then'](function(_0x3a1933){return _0x3a1933;});}return null;};}function removeEntity(_0x3123ce,_0xf68268){return function(_0x3d09a9){if(_0x3d09a9){return _0x3d09a9['destroy']()[_0xce91('0x21')](function(){_0x3123ce['status'](0xcc)[_0xce91('0x22')]();});}};}function handleEntityNotFound(_0x4c177e,_0x5f5447){return function(_0x21a174){if(!_0x21a174){_0x4c177e[_0xce91('0x18')](0x194);}return _0x21a174;};}function handleError(_0x37cafd,_0x3a2f12){_0x3a2f12=_0x3a2f12||0x1f4;return function(_0x1268a9){logger[_0xce91('0x23')](_0x1268a9[_0xce91('0x24')]);if(_0x1268a9[_0xce91('0x25')]){delete _0x1268a9['name'];}_0x37cafd[_0xce91('0x19')](_0x3a2f12)[_0xce91('0x26')](_0x1268a9);};}exports[_0xce91('0x27')]=function(_0x51a681,_0x40cd7c){var _0x339e6a={},_0x536a33={},_0xb49663={'count':0x0,'rows':[]};var _0x1dc36e=_[_0xce91('0x28')](db[_0xce91('0x29')][_0xce91('0x2a')],function(_0x138a44){return{'name':_0x138a44[_0xce91('0x2b')],'type':_0x138a44[_0xce91('0x2c')][_0xce91('0x2d')]};});_0x536a33[_0xce91('0x2e')]=_[_0xce91('0x28')](_0x1dc36e,_0xce91('0x25'));_0x536a33[_0xce91('0x2f')]=_[_0xce91('0x30')](_0x51a681['query']);_0x536a33['filters']=_['intersection'](_0x536a33[_0xce91('0x2e')],_0x536a33['query']);_0x339e6a['attributes']=_[_0xce91('0x31')](_0x536a33[_0xce91('0x2e')],qs['fields'](_0x51a681['query']['fields']));_0x339e6a[_0xce91('0x32')]=_0x339e6a[_0xce91('0x32')][_0xce91('0x33')]?_0x339e6a[_0xce91('0x32')]:_0x536a33[_0xce91('0x2e')];if(!_0x51a681[_0xce91('0x2f')][_0xce91('0x34')]('nolimit')){_0x339e6a['limit']=qs['limit'](_0x51a681['query'][_0xce91('0x1b')]);_0x339e6a['offset']=qs[_0xce91('0x1d')](_0x51a681['query'][_0xce91('0x1d')]);}_0x339e6a[_0xce91('0x35')]=qs['sort'](_0x51a681[_0xce91('0x2f')][_0xce91('0x36')]);_0x339e6a[_0xce91('0x37')]=qs[_0xce91('0x38')](_['pick'](_0x51a681[_0xce91('0x2f')],_0x536a33[_0xce91('0x38')]),_0x1dc36e);if(_0x51a681[_0xce91('0x2f')][_0xce91('0x39')]){_0x339e6a[_0xce91('0x37')]=_[_0xce91('0x3a')](_0x339e6a['where'],{'$or':_[_0xce91('0x28')](_0x1dc36e,function(_0x5481b3){if(_0x5481b3['type']!==_0xce91('0x3b')){var _0x732dea={};_0x732dea[_0x5481b3['name']]={'$like':'%'+_0x51a681['query'][_0xce91('0x39')]+'%'};return _0x732dea;}})});}_0x339e6a=_[_0xce91('0x3a')]({},_0x339e6a,_0x51a681[_0xce91('0x3c')]);var _0x3147e1={'where':_0x339e6a['where']};return db['SmsApplication'][_0xce91('0x1c')](_0x3147e1)[_0xce91('0x21')](function(_0x101208){_0xb49663['count']=_0x101208;if(_0x51a681['query'][_0xce91('0x3d')]){_0x339e6a[_0xce91('0x3e')]=[{'all':!![]}];}return db[_0xce91('0x29')][_0xce91('0x3f')](_0x339e6a);})[_0xce91('0x21')](function(_0x55f98b){_0xb49663[_0xce91('0x40')]=_0x55f98b;return _0xb49663;})[_0xce91('0x21')](respondWithFilteredResult(_0x40cd7c,_0x339e6a))[_0xce91('0x41')](handleError(_0x40cd7c,null));};exports['show']=function(_0x50197d,_0x56d3b6){var _0x3547f0={'raw':!![],'where':{'id':_0x50197d[_0xce91('0x42')]['id']}},_0xa4a97b={};_0xa4a97b[_0xce91('0x2e')]=_[_0xce91('0x30')](db[_0xce91('0x29')][_0xce91('0x2a')]);_0xa4a97b['query']=_[_0xce91('0x30')](_0x50197d[_0xce91('0x2f')]);_0xa4a97b['filters']=_[_0xce91('0x31')](_0xa4a97b[_0xce91('0x2e')],_0xa4a97b[_0xce91('0x2f')]);_0x3547f0[_0xce91('0x32')]=_['intersection'](_0xa4a97b[_0xce91('0x2e')],qs[_0xce91('0x43')](_0x50197d[_0xce91('0x2f')][_0xce91('0x43')]));_0x3547f0['attributes']=_0x3547f0[_0xce91('0x32')][_0xce91('0x33')]?_0x3547f0[_0xce91('0x32')]:_0xa4a97b[_0xce91('0x2e')];if(_0x50197d[_0xce91('0x2f')][_0xce91('0x3d')]){_0x3547f0[_0xce91('0x3e')]=[{'all':!![]}];}_0x3547f0=_[_0xce91('0x3a')]({},_0x3547f0,_0x50197d[_0xce91('0x3c')]);return db[_0xce91('0x29')][_0xce91('0x44')](_0x3547f0)[_0xce91('0x21')](handleEntityNotFound(_0x56d3b6,null))[_0xce91('0x21')](respondWithResult(_0x56d3b6,null))[_0xce91('0x41')](handleError(_0x56d3b6,null));};exports[_0xce91('0x45')]=function(_0x2aabf2,_0xd388fb){return db[_0xce91('0x29')]['create'](_0x2aabf2[_0xce91('0x46')],{})['then'](respondWithResult(_0xd388fb,0xc9))['catch'](handleError(_0xd388fb,null));};exports[_0xce91('0x47')]=function(_0x5bb4a6,_0x4e4bfb){if(_0x5bb4a6[_0xce91('0x46')]['id']){delete _0x5bb4a6[_0xce91('0x46')]['id'];}return db['SmsApplication'][_0xce91('0x44')]({'where':{'id':_0x5bb4a6[_0xce91('0x42')]['id']}})[_0xce91('0x21')](handleEntityNotFound(_0x4e4bfb,null))[_0xce91('0x21')](saveUpdates(_0x5bb4a6[_0xce91('0x46')],null))[_0xce91('0x21')](respondWithResult(_0x4e4bfb,null))[_0xce91('0x41')](handleError(_0x4e4bfb,null));};exports[_0xce91('0x48')]=function(_0x1819df,_0x526d1b){return db[_0xce91('0x29')]['find']({'where':{'id':_0x1819df['params']['id']}})[_0xce91('0x21')](handleEntityNotFound(_0x526d1b,null))[_0xce91('0x21')](removeEntity(_0x526d1b,null))[_0xce91('0x41')](handleError(_0x526d1b,null));}; \ No newline at end of file +var _0x1e73=['limit','set','Content-Range','json','apply','reject','then','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','show','find','catch','create','update','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x296708,_0x415b70){var _0x1e4c6d=function(_0xbdda6b){while(--_0xbdda6b){_0x296708['push'](_0x296708['shift']());}};_0x1e4c6d(++_0x415b70);}(_0x1e73,0x19d));var _0x31e7=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x1e73[_0x3acee8];return _0x5046cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31e7('0x0'));var zipdir=require(_0x31e7('0x1'));var jsonpatch=require(_0x31e7('0x2'));var rp=require(_0x31e7('0x3'));var moment=require(_0x31e7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31e7('0x5'));var path=require(_0x31e7('0x6'));var sox=require(_0x31e7('0x7'));var csv=require(_0x31e7('0x8'));var ejs=require(_0x31e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31e7('0xa'));var squel=require(_0x31e7('0xb'));var crypto=require(_0x31e7('0xc'));var jsforce=require(_0x31e7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x31e7('0xe'));var Papa=require(_0x31e7('0xf'));var Redis=require(_0x31e7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31e7('0x11'));var as=require(_0x31e7('0x12'));var hardwareService=require(_0x31e7('0x13'));var logger=require(_0x31e7('0x14'))('api');var utils=require(_0x31e7('0x15'));var config=require(_0x31e7('0x16'));var licenseUtil=require(_0x31e7('0x17'));var db=require(_0x31e7('0x18'))['db'];function respondWithStatusCode(_0x4ca289,_0x2fdb9e){_0x2fdb9e=_0x2fdb9e||0xcc;return function(_0x157eae){if(_0x157eae){return _0x4ca289[_0x31e7('0x19')](_0x2fdb9e);}return _0x4ca289[_0x31e7('0x1a')](_0x2fdb9e)[_0x31e7('0x1b')]();};}function respondWithResult(_0x36b7d8,_0x141d1f){_0x141d1f=_0x141d1f||0xc8;return function(_0x3db85e){if(_0x3db85e){return _0x36b7d8['status'](_0x141d1f)['json'](_0x3db85e);}};}function respondWithFilteredResult(_0x368dd3,_0x1f61f6){return function(_0xd255a3){if(_0xd255a3){var _0x487631=typeof _0x1f61f6[_0x31e7('0x1c')]===_0x31e7('0x1d')&&typeof _0x1f61f6['limit']===_0x31e7('0x1d');var _0x2973a9=_0xd255a3[_0x31e7('0x1e')];var _0x2a53c0=_0x487631?0x0:_0x1f61f6[_0x31e7('0x1c')];var _0x524d6a=_0x487631?_0xd255a3['count']:_0x1f61f6[_0x31e7('0x1c')]+_0x1f61f6[_0x31e7('0x1f')];var _0x958c10;if(_0x524d6a>=_0x2973a9){_0x524d6a=_0x2973a9;_0x958c10=0xc8;}else{_0x958c10=0xce;}_0x368dd3[_0x31e7('0x1a')](_0x958c10);return _0x368dd3[_0x31e7('0x20')](_0x31e7('0x21'),_0x2a53c0+'-'+_0x524d6a+'/'+_0x2973a9)[_0x31e7('0x22')](_0xd255a3);}return null;};}function patchUpdates(_0x4eea33){return function(_0x1192aa){try{jsonpatch[_0x31e7('0x23')](_0x1192aa,_0x4eea33,!![]);}catch(_0x5cba25){return BPromise[_0x31e7('0x24')](_0x5cba25);}return _0x1192aa['save']();};}function saveUpdates(_0x2f90d6,_0x28a885){return function(_0x35f931){if(_0x35f931){return _0x35f931['update'](_0x2f90d6)['then'](function(_0x32d765){return _0x32d765;});}return null;};}function removeEntity(_0x3cdea1,_0x438d33){return function(_0x5a5329){if(_0x5a5329){return _0x5a5329['destroy']()[_0x31e7('0x25')](function(){_0x3cdea1['status'](0xcc)[_0x31e7('0x1b')]();});}};}function handleEntityNotFound(_0x3d756c,_0x3e5439){return function(_0x31b8cb){if(!_0x31b8cb){_0x3d756c['sendStatus'](0x194);}return _0x31b8cb;};}function handleError(_0x43dacd,_0x21f560){_0x21f560=_0x21f560||0x1f4;return function(_0x16fab3){logger[_0x31e7('0x26')](_0x16fab3[_0x31e7('0x27')]);if(_0x16fab3[_0x31e7('0x28')]){delete _0x16fab3[_0x31e7('0x28')];}_0x43dacd[_0x31e7('0x1a')](_0x21f560)[_0x31e7('0x29')](_0x16fab3);};}exports[_0x31e7('0x2a')]=function(_0x54135c,_0x18feb0){var _0x5be233={},_0x32213b={},_0x10ca28={'count':0x0,'rows':[]};var _0x2bd4a3=_['map'](db[_0x31e7('0x2b')][_0x31e7('0x2c')],function(_0x2deefa){return{'name':_0x2deefa[_0x31e7('0x2d')],'type':_0x2deefa[_0x31e7('0x2e')][_0x31e7('0x2f')]};});_0x32213b[_0x31e7('0x30')]=_['map'](_0x2bd4a3,_0x31e7('0x28'));_0x32213b[_0x31e7('0x31')]=_[_0x31e7('0x32')](_0x54135c[_0x31e7('0x31')]);_0x32213b['filters']=_[_0x31e7('0x33')](_0x32213b['model'],_0x32213b[_0x31e7('0x31')]);_0x5be233[_0x31e7('0x34')]=_[_0x31e7('0x33')](_0x32213b[_0x31e7('0x30')],qs['fields'](_0x54135c['query'][_0x31e7('0x35')]));_0x5be233['attributes']=_0x5be233[_0x31e7('0x34')][_0x31e7('0x36')]?_0x5be233[_0x31e7('0x34')]:_0x32213b[_0x31e7('0x30')];if(!_0x54135c['query'][_0x31e7('0x37')]('nolimit')){_0x5be233['limit']=qs['limit'](_0x54135c[_0x31e7('0x31')][_0x31e7('0x1f')]);_0x5be233[_0x31e7('0x1c')]=qs[_0x31e7('0x1c')](_0x54135c[_0x31e7('0x31')][_0x31e7('0x1c')]);}_0x5be233['order']=qs['sort'](_0x54135c['query'][_0x31e7('0x38')]);_0x5be233['where']=qs['filters'](_[_0x31e7('0x39')](_0x54135c[_0x31e7('0x31')],_0x32213b['filters']),_0x2bd4a3);if(_0x54135c[_0x31e7('0x31')][_0x31e7('0x3a')]){_0x5be233[_0x31e7('0x3b')]=_[_0x31e7('0x3c')](_0x5be233['where'],{'$or':_[_0x31e7('0x3d')](_0x2bd4a3,function(_0x4b11ab){if(_0x4b11ab[_0x31e7('0x2e')]!=='VIRTUAL'){var _0x30871f={};_0x30871f[_0x4b11ab[_0x31e7('0x28')]]={'$like':'%'+_0x54135c['query'][_0x31e7('0x3a')]+'%'};return _0x30871f;}})});}_0x5be233=_[_0x31e7('0x3c')]({},_0x5be233,_0x54135c[_0x31e7('0x3e')]);var _0x1e55ec={'where':_0x5be233[_0x31e7('0x3b')]};return db['SmsApplication']['count'](_0x1e55ec)[_0x31e7('0x25')](function(_0x35d752){_0x10ca28[_0x31e7('0x1e')]=_0x35d752;if(_0x54135c['query'][_0x31e7('0x3f')]){_0x5be233[_0x31e7('0x40')]=[{'all':!![]}];}return db[_0x31e7('0x2b')][_0x31e7('0x41')](_0x5be233);})[_0x31e7('0x25')](function(_0x2d5e37){_0x10ca28[_0x31e7('0x42')]=_0x2d5e37;return _0x10ca28;})['then'](respondWithFilteredResult(_0x18feb0,_0x5be233))['catch'](handleError(_0x18feb0,null));};exports[_0x31e7('0x43')]=function(_0x15a45f,_0x12d5f7){var _0x1c412a={'raw':!![],'where':{'id':_0x15a45f['params']['id']}},_0x99faa9={};_0x99faa9[_0x31e7('0x30')]=_['keys'](db[_0x31e7('0x2b')][_0x31e7('0x2c')]);_0x99faa9[_0x31e7('0x31')]=_[_0x31e7('0x32')](_0x15a45f['query']);_0x99faa9['filters']=_[_0x31e7('0x33')](_0x99faa9[_0x31e7('0x30')],_0x99faa9[_0x31e7('0x31')]);_0x1c412a[_0x31e7('0x34')]=_[_0x31e7('0x33')](_0x99faa9[_0x31e7('0x30')],qs['fields'](_0x15a45f[_0x31e7('0x31')][_0x31e7('0x35')]));_0x1c412a[_0x31e7('0x34')]=_0x1c412a['attributes'][_0x31e7('0x36')]?_0x1c412a[_0x31e7('0x34')]:_0x99faa9[_0x31e7('0x30')];if(_0x15a45f[_0x31e7('0x31')][_0x31e7('0x3f')]){_0x1c412a[_0x31e7('0x40')]=[{'all':!![]}];}_0x1c412a=_['merge']({},_0x1c412a,_0x15a45f[_0x31e7('0x3e')]);return db[_0x31e7('0x2b')][_0x31e7('0x44')](_0x1c412a)[_0x31e7('0x25')](handleEntityNotFound(_0x12d5f7,null))[_0x31e7('0x25')](respondWithResult(_0x12d5f7,null))[_0x31e7('0x45')](handleError(_0x12d5f7,null));};exports[_0x31e7('0x46')]=function(_0x105369,_0x3feb9f){return db['SmsApplication'][_0x31e7('0x46')](_0x105369['body'],{})[_0x31e7('0x25')](respondWithResult(_0x3feb9f,0xc9))[_0x31e7('0x45')](handleError(_0x3feb9f,null));};exports[_0x31e7('0x47')]=function(_0xda3c0,_0x493634){if(_0xda3c0['body']['id']){delete _0xda3c0[_0x31e7('0x48')]['id'];}return db['SmsApplication'][_0x31e7('0x44')]({'where':{'id':_0xda3c0[_0x31e7('0x49')]['id']}})[_0x31e7('0x25')](handleEntityNotFound(_0x493634,null))[_0x31e7('0x25')](saveUpdates(_0xda3c0[_0x31e7('0x48')],null))['then'](respondWithResult(_0x493634,null))[_0x31e7('0x45')](handleError(_0x493634,null));};exports['destroy']=function(_0x4f99e3,_0x1e016f){return db['SmsApplication'][_0x31e7('0x44')]({'where':{'id':_0x4f99e3['params']['id']}})[_0x31e7('0x25')](handleEntityNotFound(_0x1e016f,null))['then'](removeEntity(_0x1e016f,null))['catch'](handleError(_0x1e016f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2bc9003..4cc2794 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 _0x3b90=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','define','sms_applications'];(function(_0x39494d,_0x4bf493){var _0x351d83=function(_0x306ef6){while(--_0x306ef6){_0x39494d['push'](_0x39494d['shift']());}};_0x351d83(++_0x4bf493);}(_0x3b90,0xb6));var _0x03b9=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x3b90[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0x03b9('0x0'));var util=require('util');var logger=require(_0x03b9('0x1'))('api');var moment=require(_0x03b9('0x2'));var BPromise=require(_0x03b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03b9('0x4'));var rimraf=require(_0x03b9('0x5'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module['exports']=function(_0x50e0db,_0x1bb28a){return _0x50e0db[_0x03b9('0x6')]('SmsApplication',attributes,{'tableName':_0x03b9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03b9('0x8'),'collate':_0x03b9('0x9')});}; \ No newline at end of file +var _0xf6b5=['api','moment','request-promise','path','../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x5c42bd,_0x32f124){var _0x523af3=function(_0x14ca85){while(--_0x14ca85){_0x5c42bd['push'](_0x5c42bd['shift']());}};_0x523af3(++_0x32f124);}(_0xf6b5,0x134));var _0x5f6b=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf6b5[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x5f6b('0x0'));var util=require('util');var logger=require(_0x5f6b('0x1'))(_0x5f6b('0x2'));var moment=require(_0x5f6b('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f6b('0x4'));var fs=require('fs');var path=require(_0x5f6b('0x5'));var rimraf=require('rimraf');var config=require(_0x5f6b('0x6'));var attributes=require('./smsApplication.attributes');module[_0x5f6b('0x7')]=function(_0x77d612,_0x4a6fde){return _0x77d612['define']('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f6b('0x8'),'collate':_0x5f6b('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3490f12..2dc5259 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 _0x1c52=['code','message','info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0xea4d02,_0x407432){var _0x6fe2e=function(_0x1c6d31){while(--_0x1c6d31){_0xea4d02['push'](_0xea4d02['shift']());}};_0x6fe2e(++_0x407432);}(_0x1c52,0x7c));var _0x21c5=function(_0x38fbc6,_0x28c583){_0x38fbc6=_0x38fbc6-0x0;var _0x16c955=_0x1c52[_0x38fbc6];return _0x16c955;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('SmsApplication,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('SmsApplication,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});} \ No newline at end of file +var _0x5458=['rpc','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x5458,0x1c7));var _0x8545=function(_0x4c6d3d,_0x39c470){_0x4c6d3d=_0x4c6d3d-0x0;var _0x578c1a=_0x5458[_0x4c6d3d];return _0x578c1a;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require(_0x8545('0x6'))(_0x8545('0x7'));var config=require('../../config/environment');var jayson=require(_0x8545('0x8'));var client=jayson[_0x8545('0x9')][_0x8545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359d01,_0x5062c7,_0x291bc9){return new BPromise(function(_0x507ed8,_0x2cc4f4){return client[_0x8545('0xb')](_0x359d01,_0x291bc9)[_0x8545('0xc')](function(_0x10931d){logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));logger[_0x8545('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5062c7,_0x8545('0xf'),JSON[_0x8545('0x11')](_0x10931d));if(_0x10931d[_0x8545('0x12')]){if(_0x10931d['error'][_0x8545('0x13')]===0x1f4){logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);return _0x2cc4f4(_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);}logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d['error'][_0x8545('0x14')]);return _0x507ed8(_0x10931d[_0x8545('0x12')]['message']);}else{logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));_0x507ed8(_0x10931d['result'][_0x8545('0x14')]);}})[_0x8545('0x15')](function(_0x3374f7){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5062c7,_0x3374f7);_0x2cc4f4(_0x3374f7);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 4051eff..4d8da03 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1a4476,_0xa9880d){var _0x2d5738=function(_0x5b3ddd){while(--_0x5b3ddd){_0x1a4476['push'](_0x1a4476['shift']());}};_0x2d5738(++_0xa9880d);}(_0x2547,0x1cd));var _0x7254=function(_0xc9f4e,_0x4b2fb8){_0xc9f4e=_0xc9f4e-0x0;var _0x5e9b10=_0x2547[_0xc9f4e];return _0x5e9b10;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x36f8a3,_0x4926b8){var _0x5d4b49=function(_0x3e64a5){while(--_0x3e64a5){_0x36f8a3['push'](_0x36f8a3['shift']());}};_0x5d4b49(++_0x4926b8);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 698d5c2..2541d7c 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 _0x2e3b=['DATE','STRING','ENUM','moment','exports','BOOLEAN'];(function(_0x48f040,_0x39a09e){var _0x124764=function(_0x4926d2){while(--_0x4926d2){_0x48f040['push'](_0x48f040['shift']());}};_0x124764(++_0x39a09e);}(_0x2e3b,0x81));var _0xb2e3=function(_0x2ad98f,_0x52726a){_0x2ad98f=_0x2ad98f-0x0;var _0x1e16b1=_0x2e3b[_0x2ad98f];return _0x1e16b1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb2e3('0x0'));module[_0xb2e3('0x1')]={'closed':{'type':Sequelize[_0xb2e3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2e3('0x3')]},'disposition':{'type':Sequelize[_0xb2e3('0x4')]},'secondDisposition':{'type':Sequelize[_0xb2e3('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb2e3('0x4')]},'note':{'type':Sequelize[_0xb2e3('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb2e3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb2e3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb2e3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb2e3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb2e3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x41f2=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x457d0b,_0x2827d7){var _0x52c052=function(_0x557aa6){while(--_0x557aa6){_0x457d0b['push'](_0x457d0b['shift']());}};_0x52c052(++_0x2827d7);}(_0x41f2,0x14f));var _0x241f=function(_0xf577dc,_0x4d1204){_0xf577dc=_0xf577dc-0x0;var _0x430a06=_0x41f2[_0xf577dc];return _0x430a06;};'use strict';var Sequelize=require(_0x241f('0x0'));var moment=require(_0x241f('0x1'));module['exports']={'closed':{'type':Sequelize[_0x241f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x241f('0x3')]},'disposition':{'type':Sequelize[_0x241f('0x4')]},'secondDisposition':{'type':Sequelize[_0x241f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x241f('0x4')]},'phone':{'type':Sequelize[_0x241f('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x241f('0x5')]('in',_0x241f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x241f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x241f('0x5')]('in',_0x241f('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 0f18003..c14962c 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 _0x4927=['apply','reject','save','update','then','destroy','error','name','send','Users','map','fullname','Tags','TagIds','catch','talking','answered','unmanaged','total','closed','UserId','waiting','index','SmsInteraction','rawAttributes','key','keys','filters','query','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','field','from','tools_tags','select','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','length','conditions','unreadMessages','value','having','`\x20=\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','start','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','rows','show','params','intersection','include','options','create','body','describe','addMessage','ids','getMessages','findOne','SmsMessage','sort','merge','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','omit','color','emit','smsInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','firstName','direction','SmsAccount','Account','Owner','Sms','N.A.','closedAt','System','lastName','out','secret','downloadInteraction.ejs','.pdf','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsInteraction.socket','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4927,0xc5));var _0x7492=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4927[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7492('0x0'));var rimraf=require(_0x7492('0x1'));var zipdir=require(_0x7492('0x2'));var jsonpatch=require(_0x7492('0x3'));var rp=require(_0x7492('0x4'));var moment=require(_0x7492('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7492('0x6'));var util=require('util');var path=require(_0x7492('0x7'));var sox=require('sox');var csv=require(_0x7492('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7492('0x9'));var _=require(_0x7492('0xa'));var squel=require(_0x7492('0xb'));var crypto=require(_0x7492('0xc'));var jsforce=require(_0x7492('0xd'));var deskjs=require(_0x7492('0xe'));var toCsv=require(_0x7492('0x8'));var querystring=require(_0x7492('0xf'));var Papa=require(_0x7492('0x10'));var Redis=require(_0x7492('0x11'));var authService=require(_0x7492('0x12'));var qs=require(_0x7492('0x13'));var as=require(_0x7492('0x14'));var pdf=require(_0x7492('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7492('0x16'))(_0x7492('0x17'));var utils=require(_0x7492('0x18'));var config=require(_0x7492('0x19'));var licenseUtil=require(_0x7492('0x1a'));var db=require('../../mysqldb')['db'];config[_0x7492('0x1b')]=_[_0x7492('0x1c')](config[_0x7492('0x1b')],{'host':_0x7492('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7492('0x1b')]));require(_0x7492('0x1e'))['register'](socket);function respondWithStatusCode(_0x32772f,_0x18566c){_0x18566c=_0x18566c||0xcc;return function(_0x242845){if(_0x242845){return _0x32772f[_0x7492('0x1f')](_0x18566c);}return _0x32772f['status'](_0x18566c)[_0x7492('0x20')]();};}function respondWithResult(_0x41746f,_0x343233){_0x343233=_0x343233||0xc8;return function(_0x22201d){if(_0x22201d){return _0x41746f[_0x7492('0x21')](_0x343233)[_0x7492('0x22')](_0x22201d);}};}function respondWithFilteredResult(_0x346daf,_0x42bad1){return function(_0x283bb6){if(_0x283bb6){var _0x75e30e=typeof _0x42bad1['offset']===_0x7492('0x23')&&typeof _0x42bad1[_0x7492('0x24')]===_0x7492('0x23');var _0x2246fc=_0x283bb6['count'];var _0x3cbfa7=_0x75e30e?0x0:_0x42bad1[_0x7492('0x25')];var _0x5a883=_0x75e30e?_0x283bb6[_0x7492('0x26')]:_0x42bad1[_0x7492('0x25')]+_0x42bad1['limit'];var _0x4e1711;if(_0x5a883>=_0x2246fc){_0x5a883=_0x2246fc;_0x4e1711=0xc8;}else{_0x4e1711=0xce;}_0x346daf['status'](_0x4e1711);return _0x346daf[_0x7492('0x27')](_0x7492('0x28'),_0x3cbfa7+'-'+_0x5a883+'/'+_0x2246fc)[_0x7492('0x22')](_0x283bb6);}return null;};}function patchUpdates(_0x35049a){return function(_0x58392b){try{jsonpatch[_0x7492('0x29')](_0x58392b,_0x35049a,!![]);}catch(_0x5ebdf2){return BPromise[_0x7492('0x2a')](_0x5ebdf2);}return _0x58392b[_0x7492('0x2b')]();};}function saveUpdates(_0x27323e,_0x10b683){return function(_0x5475a2){if(_0x5475a2){return _0x5475a2[_0x7492('0x2c')](_0x27323e)[_0x7492('0x2d')](function(_0x40d64c){return _0x40d64c;});}return null;};}function removeEntity(_0x3f1d18,_0x298ebe){return function(_0x55b121){if(_0x55b121){return _0x55b121[_0x7492('0x2e')]()[_0x7492('0x2d')](function(){_0x3f1d18[_0x7492('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58341b,_0x2e1177){return function(_0x51242d){if(!_0x51242d){_0x58341b['sendStatus'](0x194);}return _0x51242d;};}function handleError(_0x3612e5,_0x4edb23){_0x4edb23=_0x4edb23||0x1f4;return function(_0x1e08e3){logger[_0x7492('0x2f')](_0x1e08e3['stack']);if(_0x1e08e3['name']){delete _0x1e08e3[_0x7492('0x30')];}_0x3612e5[_0x7492('0x21')](_0x4edb23)[_0x7492('0x31')](_0x1e08e3);};}function getInteractionUsers(_0x42af84,_0x4d832d){return new BPromise(function(_0x4ab6db,_0x29dfe1){try{if(_0x4d832d[_0x42af84['id']]){_0x42af84[_0x7492('0x32')]=_[_0x7492('0x33')](_0x4d832d[_0x42af84['id']],function(_0x559647){return{'id':_0x559647['id'],'fullname':_0x559647[_0x7492('0x34')]};});}}catch(_0x53e94b){_0x29dfe1(_0x53e94b);}_0x4ab6db(_0x42af84);});}function getInteractionTags(_0x16b23d,_0x31e4f1){return new BPromise(function(_0x19b8fa,_0x38b547){try{if(_0x16b23d['TagIds']){_0x16b23d[_0x7492('0x35')]=[];_0x16b23d['TagIds']['split'](',')['forEach'](function(_0x314c2b){_0x16b23d[_0x7492('0x35')]['push'](_0x31e4f1[_0x314c2b]);});}delete _0x16b23d[_0x7492('0x36')];}catch(_0x48e1ce){_0x38b547(_0x48e1ce);}_0x19b8fa(_0x16b23d);});}function updateSmsInteraction(_0x478aec,_0x2baf97,_0x5a51c5){return new BPromise(function(_0x32f343,_0x31a2d9){return getInteractionUsers(_0x478aec,_0x5a51c5)[_0x7492('0x2d')](function(_0x6700f0){return getInteractionTags(_0x6700f0,_0x2baf97);})[_0x7492('0x2d')](function(_0x25f876){return getStateInteraction(_0x25f876);})[_0x7492('0x2d')](function(_0x4e8f55){_0x32f343(_0x4e8f55);})[_0x7492('0x37')](function(_0x49a458){_0x31a2d9(_0x49a458);});});}function getStateInteraction(_0x3833d1){return new BPromise(function(_0x3cffef){_0x3833d1['waiting']=0x0;_0x3833d1[_0x7492('0x38')]=0x0;_0x3833d1[_0x7492('0x39')]=0x0;_0x3833d1[_0x7492('0x3a')]=0x0;_0x3833d1[_0x7492('0x3b')]=0x0;if(!_0x3833d1[_0x7492('0x3c')]&&!_0x3833d1[_0x7492('0x3d')]){_0x3833d1[_0x7492('0x3e')]+=0x1;}if(!_0x3833d1[_0x7492('0x3c')]&&_0x3833d1[_0x7492('0x3d')]){_0x3833d1['talking']+=0x1;if(_0x3833d1[_0x7492('0x3e')]){_0x3833d1[_0x7492('0x3e')]-=0x1;}}if(_0x3833d1[_0x7492('0x3c')]&&_0x3833d1['UserId']){_0x3833d1[_0x7492('0x39')]+=0x1;if(_0x3833d1['talking']){_0x3833d1['talking']-=0x1;}}if(_0x3833d1[_0x7492('0x3c')]&&!_0x3833d1[_0x7492('0x3d')]){_0x3833d1[_0x7492('0x3a')]+=0x1;if(_0x3833d1[_0x7492('0x3e')]){_0x3833d1[_0x7492('0x3e')]-=0x1;}}_0x3833d1[_0x7492('0x3b')]+=0x1;_0x3cffef(_0x3833d1);});}exports[_0x7492('0x3f')]=function(_0x549263,_0x3f4375){var _0x379085={},_0x2a1736={},_0x12a3a4={'count':0x0,'rows':[]};var _0xac22e4=_[_0x7492('0x33')](db[_0x7492('0x40')][_0x7492('0x41')],function(_0x11b065){return{'name':_0x11b065['fieldName'],'type':_0x11b065['type'][_0x7492('0x42')]};});_0x2a1736['model']=_['map'](_0xac22e4,'name');_0x2a1736['query']=_[_0x7492('0x43')](_0x549263['query']);_0x2a1736[_0x7492('0x44')]=_['intersection'](_0x2a1736['model'],_0x2a1736[_0x7492('0x45')]);_0x379085['attributes']=_['intersection'](_0x2a1736[_0x7492('0x46')],qs[_0x7492('0x47')](_0x549263[_0x7492('0x45')][_0x7492('0x47')]));_0x379085[_0x7492('0x48')]=_0x379085['attributes']['length']?_0x379085[_0x7492('0x48')]:_0x2a1736[_0x7492('0x46')];if(!_0x549263[_0x7492('0x45')][_0x7492('0x49')](_0x7492('0x4a'))){_0x379085['limit']=qs[_0x7492('0x24')](_0x549263[_0x7492('0x45')][_0x7492('0x24')]);_0x379085[_0x7492('0x25')]=qs[_0x7492('0x25')](_0x549263[_0x7492('0x45')][_0x7492('0x25')]);}_0x379085[_0x7492('0x4b')]=qs['sort'](_0x549263[_0x7492('0x45')]['sort']);_0x379085[_0x7492('0x4c')]=qs[_0x7492('0x44')](_[_0x7492('0x4d')](_0x549263[_0x7492('0x45')],_0x2a1736['filters']),_0xac22e4);var _0x35060=[];var _0x5cf07c=squel['select']()[_0x7492('0x4e')]('id')[_0x7492('0x4e')](_0x7492('0x30'))[_0x7492('0x4e')]('color')[_0x7492('0x4f')](_0x7492('0x50'));var _0x6a0b12=squel[_0x7492('0x51')]()[_0x7492('0x4e')](_0x7492('0x52'))[_0x7492('0x4e')]('u.fullname')[_0x7492('0x4e')]('ui.SmsInteractionId')[_0x7492('0x4f')](_0x7492('0x53'),'ui')[_0x7492('0x54')](_0x7492('0x55'),'u',_0x7492('0x56'));var _0x37e163=squel[_0x7492('0x51')]()['from'](_0x7492('0x57'),'i')[_0x7492('0x54')]('cm_contacts','c',_0x7492('0x58'))[_0x7492('0x54')](_0x7492('0x55'),'o',_0x7492('0x59'))['left_join'](_0x7492('0x5a'),'a',_0x7492('0x5b'))['left_join'](_0x7492('0x5c'),'me',_0x7492('0x5d'))['left_join'](_0x7492('0x5e'),'it',_0x7492('0x5f'))[_0x7492('0x54')](_0x7492('0x50'),'t','t.id\x20=\x20it.TagId');var _0x196939=squel[_0x7492('0x60')]();var _0x500e27=[];var _0x146ab1=squel[_0x7492('0x60')]();var _0x4b0e3b;if(_0x549263[_0x7492('0x45')][_0x7492('0x61')]){_0x4b0e3b=as[_0x7492('0x62')](_0x549263[_0x7492('0x45')][_0x7492('0x61')]);var _0x16b371=_0x4b0e3b[_0x7492('0x63')];for(var _0x10057e=0x0;_0x10057e<_0x4b0e3b['conditions'][_0x7492('0x64')];_0x10057e++){var _0x178d11=_0x4b0e3b[_0x7492('0x65')][_0x10057e];var _0x3346c8='i';var _0x249b7c=_['find'](_0xac22e4,[_0x7492('0x30'),_0x178d11[_0x7492('0x4e')]]);if(!_0x249b7c){switch(_0x178d11['field']){case _0x7492('0x66'):if(_0x178d11[_0x7492('0x67')]==0x1){_0x37e163[_0x7492('0x68')]('`'+_0x178d11[_0x7492('0x4e')]+_0x7492('0x69'));}else{_0x37e163[_0x7492('0x68')]('`'+_0x178d11['field']+'`\x20>\x200');}break;case _0x7492('0x6a'):if(_0x178d11['operator']===_0x7492('0x6b')){if(_0x178d11[_0x7492('0x67')][_0x7492('0x6c')]('\x20')['length']>0x1){_0x196939[_0x16b371](_0x7492('0x6d'),qs[_0x7492('0x6e')](_0x178d11[_0x7492('0x67')]),null);}else{var _0x11658e='%'+_0x178d11[_0x7492('0x67')]+'%';_0x196939[_0x16b371](_0x7492('0x6f'),_0x11658e,_0x11658e,_0x11658e);}}else{_0x249b7c=_[_0x7492('0x70')](_0xac22e4,[_0x7492('0x30'),_0x7492('0x71')]);_0x178d11['field']=_0x7492('0x71');_0x4d5a4a=as['buildExpression'](_0x3346c8,_0x249b7c[_0x7492('0x72')],_0x178d11);_0x196939[_0x16b371](_0x4d5a4a['text'],_0x4d5a4a['value']['start'],_0x4d5a4a[_0x7492('0x67')][_0x7492('0x20')]);}break;case _0x7492('0x73'):var _0x1fb15f=_0x178d11['value'][_0x7492('0x6c')](',')[_0x7492('0x33')](function(_0x216a24){return Number(_0x216a24);});_0x1fb15f[_0x7492('0x74')](function(_0x1d3e59){_0x146ab1['or'](_0x7492('0x75'),'%,'+_0x1d3e59+',%');});_0x500e27=_[_0x7492('0x76')](_0x500e27,_0x1fb15f);break;case _0x7492('0x77'):if(_0x178d11[_0x7492('0x78')]==='$substring'){_0x196939[_0x16b371](_0x7492('0x79'),'%'+_0x178d11['value']+'%',null);}else{_0x249b7c=_[_0x7492('0x70')](_0xac22e4,['name',_0x7492('0x3d')]);_0x178d11[_0x7492('0x4e')]=_0x7492('0x3d');_0x4d5a4a=as[_0x7492('0x7a')](_0x3346c8,_0x249b7c['type'],_0x178d11);_0x196939[_0x16b371](_0x4d5a4a['text'],_0x4d5a4a[_0x7492('0x67')]['start'],_0x4d5a4a['value'][_0x7492('0x20')]);}break;case'body':_0x4d5a4a=as[_0x7492('0x7a')]('me',null,_0x178d11);_0x196939[_0x16b371](_0x4d5a4a[_0x7492('0x7b')],_0x4d5a4a[_0x7492('0x67')][_0x7492('0x7c')],_0x4d5a4a[_0x7492('0x67')][_0x7492('0x20')]);break;}}else{var _0x4d5a4a=as[_0x7492('0x7a')](_0x3346c8,_0x249b7c['type'],_0x178d11);_0x196939[_0x16b371](_0x4d5a4a[_0x7492('0x7b')],_0x4d5a4a[_0x7492('0x67')][_0x7492('0x7c')],_0x4d5a4a[_0x7492('0x67')][_0x7492('0x20')]);}}}else{var _0x59d290=_(_0x549263[_0x7492('0x45')])['keys']()['map'](function(_0x14e4a2){return _[_0x7492('0x7d')](_0xac22e4,[_0x7492('0x30'),_0x14e4a2])?_0x14e4a2:undefined;})[_0x7492('0x7e')]()[_0x7492('0x67')]();if(!_[_0x7492('0x7f')](_0x59d290)){_0x59d290[_0x7492('0x74')](function(_0x222cc9){if(_0x222cc9===_0x7492('0x80')){_0x37e163[_0x7492('0x4c')](_0x7492('0x81'),[][_0x7492('0x82')](_0x549263[_0x7492('0x45')][_0x222cc9]));}else if(_0x222cc9===_0x7492('0x83')){var _0x1e11e3=JSON['parse'](_0x549263[_0x7492('0x45')][_0x222cc9])[_0x7492('0x84')];var _0x2e7fe9=JSON['parse'](_0x549263[_0x7492('0x45')][_0x222cc9])['$lte'];_0x37e163[_0x7492('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1e11e3,_0x2e7fe9);}else{if(_0x549263['query'][_0x222cc9]==='null'){_0x37e163[_0x7492('0x4c')]('i.'+_0x222cc9+_0x7492('0x85'));}else{_0x37e163[_0x7492('0x4c')]('i.'+_0x222cc9+_0x7492('0x86'),_0x549263[_0x7492('0x45')][_0x222cc9]);}}});}if(_0x549263['query']['read']){if(_0x549263['query'][_0x7492('0x87')]==0x1){_0x37e163['having'](_0x7492('0x88'));}else{_0x37e163[_0x7492('0x68')](_0x7492('0x89'));}}if(_0x549263[_0x7492('0x45')][_0x7492('0x8a')]){_0x500e27=_[_0x7492('0x8b')](_0x549263[_0x7492('0x45')][_0x7492('0x8a')])?_0x549263[_0x7492('0x45')][_0x7492('0x8a')]:new Array(_0x549263[_0x7492('0x45')][_0x7492('0x8a')]);_0x500e27[_0x7492('0x74')](function(_0x173dc3){_0x146ab1['or'](_0x7492('0x75'),'%,'+_0x173dc3+',%');});}if(_0x549263['query']['filter']){var _0x14d31f=_0x549263[_0x7492('0x45')][_0x7492('0x8c')][_0x7492('0x8d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7492('0x8e')](_0x14d31f)){_0x196939['or'](_0x7492('0x8f'),_0x14d31f+'%')['or'](_0x7492('0x90'),_0x14d31f+'%');}else{_0x196939['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14d31f))['or'](_0x7492('0x91'),_0x14d31f+'%');}}}_0x37e163['where'](_0x196939);_0x37e163[_0x7492('0x92')]('i.id');var _0x46a7f8={'type':db[_0x7492('0x93')][_0x7492('0x94')][_0x7492('0x95')],'raw':!![]};var _0x485b22=_0x37e163['clone']();_0x485b22[_0x7492('0x4e')](_0x7492('0x96'));_0x485b22[_0x7492('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x379085[_0x7492('0x4b')]){_0x379085[_0x7492('0x4b')][_0x7492('0x74')](function(_0x3fa31f){var _0x48adcb=_0x3fa31f[0x0]===_0x7492('0x97')?_0x3fa31f[0x0]:'i.'+_0x3fa31f[0x0];_0x37e163[_0x7492('0x4b')](_0x48adcb,_0x3fa31f[0x1]===_0x7492('0x98')?![]:!![]);});}if(!_[_0x7492('0x7f')](_0x500e27)){_0x37e163[_0x7492('0x68')](_0x146ab1);_0x485b22[_0x7492('0x4c')](_0x7492('0x99'),_0x500e27);}BPromise[_0x7492('0x9a')]()[_0x7492('0x2d')](function(){if(!_0x4b0e3b){if(_0x549263['query'][_0x7492('0x80')])return;_0x485b22[_0x7492('0x4c')](_0x7492('0x9b'));_0x37e163[_0x7492('0x4c')](_0x7492('0x9b'));return;}if(_0x549263['user'][_0x7492('0x9c')]!=='agent')return;return _0x549263[_0x7492('0x9d')][_0x7492('0x9e')]({'attributes':['id'],'raw':!![]})[_0x7492('0x2d')](function(_0x17515a){if(_[_0x7492('0x7f')](_0x17515a)){_0x485b22['where'](_0x7492('0x9f'));_0x37e163[_0x7492('0x4c')](_0x7492('0x9f'));}else{_0x485b22['where'](_0x7492('0x81'),_[_0x7492('0x33')](_0x17515a,'id'));_0x37e163['where'](_0x7492('0x81'),_[_0x7492('0x33')](_0x17515a,'id'));}});})['then'](function(){if(_0x549263['user'][_0x7492('0x9c')]===_0x7492('0xa0')&&!_0x4b0e3b&&!_0x549263['query']['SmsAccountId'])return[];return db[_0x7492('0xa1')]['query'](_0x485b22[_0x7492('0xa2')](),_0x46a7f8);})['then'](function(_0x2970b4){_0x12a3a4[_0x7492('0x26')]=_0x2970b4[_0x7492('0x64')];if(_0x12a3a4['count']===0x0)return[];return db[_0x7492('0xa1')][_0x7492('0x45')](_0x5cf07c[_0x7492('0xa2')](),_0x46a7f8)[_0x7492('0x2d')](function(_0x3e1236){_0x35060=_[_0x7492('0xa3')](_0x3e1236,'id');_0x46a7f8=_['merge'](_0x46a7f8,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x549263[_0x7492('0x45')][_0x7492('0x47')]){_0x379085['attributes'][_0x7492('0x74')](function(_0x4a5bf3){_0x37e163['field']('i.'+_0x4a5bf3);});}else{_0x37e163[_0x7492('0x4e')](_0x7492('0xa4'),_0x7492('0x66'));_0x37e163[_0x7492('0x4e')]('a.key',_0x7492('0xa5'));_0x37e163[_0x7492('0x4e')](_0x7492('0xa6'),_0x7492('0xa7'));_0x37e163[_0x7492('0x4e')](_0x7492('0xa8'),_0x7492('0x97'));_0x37e163[_0x7492('0x4e')](_0x7492('0xa9'));_0x37e163[_0x7492('0x4e')](_0x7492('0xaa'),'Contact.firstName');_0x37e163[_0x7492('0x4e')](_0x7492('0xab'),'Contact.lastName');_0x37e163[_0x7492('0x4e')](_0x7492('0xac'),_0x7492('0xad'));_0x37e163['field']('c.phone',_0x7492('0xae'));_0x37e163[_0x7492('0x4e')](_0x7492('0xaf'),_0x7492('0xb0'));_0x37e163['field'](_0x7492('0xb1'),_0x7492('0xb2'));_0x37e163[_0x7492('0x4e')](_0x7492('0xb3'),_0x7492('0xb4'));_0x37e163[_0x7492('0x4e')]('o.internal',_0x7492('0xb5'));_0x37e163[_0x7492('0x4e')](_0x7492('0xb6'),_0x7492('0x36'));}if(_0x379085[_0x7492('0x24')])_0x37e163[_0x7492('0x24')](_0x379085[_0x7492('0x24')]);if(_0x379085[_0x7492('0x25')])_0x37e163[_0x7492('0x25')](_0x379085[_0x7492('0x25')]);return db['sequelize'][_0x7492('0x45')](_0x37e163[_0x7492('0xa2')](),_0x46a7f8);})[_0x7492('0x2d')](function(_0x2af53a){if(_0x2af53a['length']>0x0)_0x6a0b12['where'](_0x7492('0xb7'),_[_0x7492('0x33')](_0x2af53a,'id'));return db['sequelize'][_0x7492('0x45')](_0x6a0b12['toString'](),_0x46a7f8)[_0x7492('0x2d')](function(_0x147792){var _0x40c74f=_['groupBy'](_0x147792,_0x7492('0xb8'));var _0x4c30eb=[];_0x2af53a['forEach'](function(_0x14bdfb){_0x4c30eb[_0x7492('0xb9')](updateSmsInteraction(_0x14bdfb,_0x35060,_0x40c74f));});return BPromise['all'](_0x4c30eb);});});})['then'](function(_0x32eb28){_0x12a3a4[_0x7492('0xba')]=_0x32eb28;return _0x12a3a4;})['then'](respondWithFilteredResult(_0x3f4375,_0x379085))[_0x7492('0x37')](handleError(_0x3f4375,null));};exports[_0x7492('0xbb')]=function(_0x2ef9a7,_0x31d762){var _0x44fa17={'raw':![],'where':{'id':_0x2ef9a7[_0x7492('0xbc')]['id']}},_0xbb7495={};_0xbb7495['model']=_[_0x7492('0x43')](db[_0x7492('0x40')][_0x7492('0x41')]);_0xbb7495[_0x7492('0x45')]=_[_0x7492('0x43')](_0x2ef9a7[_0x7492('0x45')]);_0xbb7495[_0x7492('0x44')]=_[_0x7492('0xbd')](_0xbb7495[_0x7492('0x46')],_0xbb7495[_0x7492('0x45')]);_0x44fa17[_0x7492('0x48')]=_[_0x7492('0xbd')](_0xbb7495[_0x7492('0x46')],qs['fields'](_0x2ef9a7[_0x7492('0x45')]['fields']));_0x44fa17[_0x7492('0x48')]=_0x44fa17['attributes'][_0x7492('0x64')]?_0x44fa17[_0x7492('0x48')]:_0xbb7495[_0x7492('0x46')];if(_0x2ef9a7[_0x7492('0x45')]['includeAll']){_0x44fa17[_0x7492('0xbe')]=[{'all':!![]}];}_0x44fa17=_['merge']({},_0x44fa17,_0x2ef9a7[_0x7492('0xbf')]);return db[_0x7492('0x40')][_0x7492('0x70')](_0x44fa17)['then'](handleEntityNotFound(_0x31d762,null))['then'](respondWithResult(_0x31d762,null))[_0x7492('0x37')](handleError(_0x31d762,null));};exports[_0x7492('0xc0')]=function(_0x1430f4,_0x2f0e9d){return db[_0x7492('0x40')]['create'](_0x1430f4[_0x7492('0xc1')],{})['then'](respondWithResult(_0x2f0e9d,0xc9))[_0x7492('0x37')](handleError(_0x2f0e9d,null));};exports[_0x7492('0x2c')]=function(_0x4f3e33,_0x4c3879){if(_0x4f3e33[_0x7492('0xc1')]['id']){delete _0x4f3e33['body']['id'];}return db[_0x7492('0x40')][_0x7492('0x70')]({'where':{'id':_0x4f3e33['params']['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x4c3879,null))[_0x7492('0x2d')](saveUpdates(_0x4f3e33['body'],null))[_0x7492('0x2d')](respondWithResult(_0x4c3879,null))[_0x7492('0x37')](handleError(_0x4c3879,null));};exports[_0x7492('0x2e')]=function(_0x57cd67,_0x2e0455){return db[_0x7492('0x40')][_0x7492('0x70')]({'where':{'id':_0x57cd67[_0x7492('0xbc')]['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x2e0455,null))['then'](removeEntity(_0x2e0455,null))[_0x7492('0x37')](handleError(_0x2e0455,null));};exports[_0x7492('0xc2')]=function(_0x58c019,_0x10ecd6){return db[_0x7492('0x40')][_0x7492('0xc2')]()[_0x7492('0x2d')](respondWithResult(_0x10ecd6,null))[_0x7492('0x37')](handleError(_0x10ecd6,null));};exports[_0x7492('0xc3')]=function(_0xe44e89,_0x29fd51,_0x8e8be8){return db['SmsMessage'][_0x7492('0x70')]({'where':{'id':_0xe44e89[_0x7492('0xbc')]['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x29fd51,null))['then'](function(_0x2474d3){if(_0x2474d3){return _0x2474d3['addMessage'](_0xe44e89[_0x7492('0xc1')][_0x7492('0xc4')],_['omit'](_0xe44e89[_0x7492('0xc1')],['ids','id'])||{});}})[_0x7492('0x2d')](respondWithResult(_0x29fd51,null))[_0x7492('0x37')](handleError(_0x29fd51,null));};exports[_0x7492('0xc5')]=function(_0x484661,_0x8bf4c6,_0x332b5a){var _0x2346f6={'raw':![],'where':{}};var _0x3d6b36={};var _0x88b648={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x7492('0xc6')]({'where':{'id':_0x484661['params']['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x8bf4c6,null))[_0x7492('0x2d')](function(_0x1887ca){if(_0x1887ca){_0x3d6b36[_0x7492('0x46')]=_[_0x7492('0x43')](db[_0x7492('0xc7')][_0x7492('0x41')]);_0x3d6b36[_0x7492('0x45')]=_[_0x7492('0x43')](_0x484661[_0x7492('0x45')]);_0x3d6b36[_0x7492('0x44')]=_[_0x7492('0xbd')](_0x3d6b36['model'],_0x3d6b36[_0x7492('0x45')]);_0x2346f6['attributes']=_[_0x7492('0xbd')](_0x3d6b36[_0x7492('0x46')],qs['fields'](_0x484661[_0x7492('0x45')][_0x7492('0x47')]));_0x2346f6[_0x7492('0x48')]=_0x2346f6[_0x7492('0x48')][_0x7492('0x64')]?_0x2346f6['attributes']:_0x3d6b36[_0x7492('0x46')];if(!_0x484661[_0x7492('0x45')][_0x7492('0x49')](_0x7492('0x4a'))){_0x2346f6['limit']=qs['limit'](_0x484661[_0x7492('0x45')][_0x7492('0x24')]);_0x2346f6[_0x7492('0x25')]=qs[_0x7492('0x25')](_0x484661[_0x7492('0x45')][_0x7492('0x25')]);}_0x2346f6[_0x7492('0x4b')]=qs['sort'](_0x484661[_0x7492('0x45')][_0x7492('0xc8')]);_0x2346f6[_0x7492('0x4c')]=qs[_0x7492('0x44')](_[_0x7492('0x4d')](_0x484661[_0x7492('0x45')],_0x3d6b36[_0x7492('0x44')]));_0x2346f6[_0x7492('0x4c')]['SmsInteractionId']=_0x1887ca['id'];if(_0x484661[_0x7492('0x45')][_0x7492('0x8c')]){_0x2346f6[_0x7492('0x4c')]=_[_0x7492('0xc9')](_0x2346f6['where'],{'$or':_[_0x7492('0x33')](_0x2346f6[_0x7492('0x48')],function(_0x243e85){var _0x4bd173={};_0x4bd173[_0x243e85]={'$like':'%'+_0x484661[_0x7492('0x45')]['filter']+'%'};return _0x4bd173;})});}if(_0x484661['query'][_0x7492('0x84')]){var _0x27b1f1=_0x484661[_0x7492('0x45')]['$gte'][_0x7492('0x6c')](',');var _0x2807b0={};_0x2807b0[_0x27b1f1[0x0]]={'$gte':moment(_0x27b1f1[0x1])[_0x7492('0xca')](_0x7492('0xcb'))};_0x2346f6[_0x7492('0x4c')]=_['merge'](_0x2346f6[_0x7492('0x4c')],_0x2807b0);}_0x2346f6=_['merge']({},_0x2346f6,_0x484661['options']);return db[_0x7492('0xc7')][_0x7492('0x26')]({'where':_0x2346f6['where']})['then'](function(_0x5beadf){_0x88b648[_0x7492('0x26')]=_0x5beadf;if(_0x484661[_0x7492('0x45')][_0x7492('0xcc')]){_0x2346f6['include']=[{'all':!![]}];}return db['SmsMessage'][_0x7492('0xcd')](_0x2346f6);})[_0x7492('0x2d')](function(_0xf80e48){_0x88b648[_0x7492('0xba')]=_0xf80e48;return _0x88b648;});}})[_0x7492('0x2d')](respondWithFilteredResult(_0x8bf4c6,_0x2346f6))[_0x7492('0x37')](handleError(_0x8bf4c6,null));};exports[_0x7492('0xce')]=function(_0x311a3e,_0x44c5e7,_0x585b0d){return db['SmsInteraction'][_0x7492('0x70')]({'where':{'id':_0x311a3e['params']['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x44c5e7,null))['then'](function(_0x1fd63f){if(_0x1fd63f){return _0x1fd63f[_0x7492('0xcf')](_0x311a3e[_0x7492('0xc1')][_0x7492('0xc4')],_[_0x7492('0xd0')](_0x311a3e[_0x7492('0xc1')],[_0x7492('0xc4'),'id'])||{})['spread'](function(){return db[_0x7492('0x73')][_0x7492('0xcd')]({'attributes':['id','name',_0x7492('0xd1')],'where':{'id':_0x311a3e[_0x7492('0xc1')][_0x7492('0xc4')]}});})[_0x7492('0x2d')](function(_0x3556b7){socket[_0x7492('0xd2')](_0x7492('0xd3'),{'id':Number(_0x311a3e[_0x7492('0xbc')]['id']),'tags':_0x3556b7||[]});return{'id':Number(_0x311a3e[_0x7492('0xbc')]['id']),'tags':_0x3556b7||[]};});}})[_0x7492('0x2d')](respondWithResult(_0x44c5e7,null))[_0x7492('0x37')](handleError(_0x44c5e7,null));};exports[_0x7492('0xd4')]=function(_0x27c233,_0x284dc6,_0x4f50cc){return db['SmsInteraction'][_0x7492('0x70')]({'where':{'id':_0x27c233[_0x7492('0xbc')]['id']}})[_0x7492('0x2d')](handleEntityNotFound(_0x284dc6,null))[_0x7492('0x2d')](function(_0x343b67){if(_0x343b67){return _0x343b67[_0x7492('0xd4')](_0x27c233['query'][_0x7492('0xc4')]);}})['then'](respondWithStatusCode(_0x284dc6,null))[_0x7492('0x37')](handleError(_0x284dc6,null));};exports['download']=function(_0x3e4549,_0xbf0ff0){var _0x5ad4e2=moment()[_0x7492('0xd5')]()[_0x7492('0xa2')]();var _0x36ec41=path[_0x7492('0xd6')](config[_0x7492('0xd7')],_0x7492('0xd8'),_0x7492('0xd9'),'tmp');var _0x462446=path[_0x7492('0xd6')](config[_0x7492('0xd7')],'server','files',_0x7492('0xda'));var _0x24a9e0=path['join'](_0x36ec41,_0x5ad4e2);var _0x30f064=util[_0x7492('0xca')](_0x7492('0xdb'),_0x3e4549[_0x7492('0xbc')]['id'],_0x5ad4e2);var _0x107aad=path['join'](_0x36ec41,_0x30f064);var _0x5c7f16=[];_0x5c7f16[_0x7492('0xb9')]({'model':db[_0x7492('0x77')],'as':_0x7492('0x77'),'attributes':['id',_0x7492('0x34')],'raw':!![]});_0x5c7f16[_0x7492('0xb9')]({'model':db['CmContact'],'as':_0x7492('0x6a'),'attributes':['id',_0x7492('0xdc'),'lastName'],'raw':!![]});var _0x104d20=[{'model':db[_0x7492('0xc7')],'as':'Messages','attributes':['id',_0x7492('0xc1'),_0x7492('0x83'),_0x7492('0xdd'),'secret','read'],'include':_0x5c7f16}];_0x104d20['push']({'model':db[_0x7492('0xde')],'as':_0x7492('0xdf'),'attributes':['id',_0x7492('0x30')]});_0x104d20['push']({'model':db['User'],'as':_0x7492('0xe0'),'attributes':['id',_0x7492('0x34')]});return db[_0x7492('0x40')][_0x7492('0x70')]({'where':{'id':_0x3e4549[_0x7492('0xbc')]['id']},'include':_0x104d20})['then'](handleEntityNotFound(_0xbf0ff0,null))['then'](function(_0x1ca513){if(_0x1ca513){var _0x176219=_0x1ca513['get']({'plain':!![]});fs['mkdirSync'](_0x24a9e0);var _0x69a7c7={'channel':_0x7492('0xe1'),'account':_0x176219[_0x7492('0xdf')]['name'],'agent':_0x176219['Owner']?_0x176219[_0x7492('0xe0')]['fullname']:_0x7492('0xe2'),'createdAt':moment(_0x176219[_0x7492('0x83')])[_0x7492('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7492('0xa2')](),'closedAt':_0x176219[_0x7492('0x3c')]?moment(_0x176219[_0x7492('0xe3')])[_0x7492('0xca')](_0x7492('0xcb'))[_0x7492('0xa2')]():'','disposition':_0x176219['disposition'],'messages':_(_0x176219['Messages'])[_0x7492('0x8c')]({'secret':![]})['map'](function(_0xd32cba){return{'date':moment(_0xd32cba[_0x7492('0x83')])[_0x7492('0xca')](_0x7492('0xcb'))['toString'](),'sender':_0xd32cba[_0x7492('0xdd')]==='out'?_0xd32cba[_0x7492('0x77')]?_0xd32cba[_0x7492('0x77')]['fullname']:_0x7492('0xe4'):_0xd32cba['Contact'][_0x7492('0xdc')]+(_0xd32cba[_0x7492('0x6a')][_0x7492('0xe5')]?'\x20'+_0xd32cba[_0x7492('0x6a')][_0x7492('0xe5')]:''),'body':_0xd32cba[_0x7492('0xc1')],'direction':_0xd32cba[_0x7492('0xdd')]===_0x7492('0xe6')?'A':'C','secret':_0xd32cba[_0x7492('0xe7')],'read':_0xd32cba[_0x7492('0x87')]};})[_0x7492('0x67')]()};return ejs['renderFile'](path[_0x7492('0xd6')](config[_0x7492('0xd7')],_0x7492('0xd8'),'views',_0x7492('0xe8')),{'interaction':_0x69a7c7})[_0x7492('0x2d')](function(_0x3d978a){var _0x43d653=path[_0x7492('0xd6')](_0x24a9e0,'transcript-'+_0x176219['id']+'-'+_0x5ad4e2+_0x7492('0xe9'));var _0x3817e9={'path':_0x43d653,'channel':'Sms','interactionId':_0x176219['id']};return pdf['createPdfFromHTML'](_0x3d978a,_0x3817e9);})[_0x7492('0x2d')](function(){return new BPromise(function(_0x410201,_0x17a657){zipdir(_0x24a9e0,{'saveTo':_0x107aad},function(_0x14f226,_0xfcabdf){if(_0x14f226)return _0x17a657(_0x14f226);return _0x410201(_0xfcabdf);});})[_0x7492('0x2d')](function(){return new BPromise(function(_0xa33e7e,_0x41c03e){rimraf(_0x24a9e0,function(_0x3d05e1){if(_0x3d05e1)_0x41c03e(_0x3d05e1);return _0xa33e7e();});});})[_0x7492('0x2d')](function(){return _0xbf0ff0[_0x7492('0xea')](_0x107aad,_0x30f064,function(_0x7902a){if(_0x7902a){console[_0x7492('0xeb')](_0x7492('0xec'),_0x7902a);}else{fs[_0x7492('0xed')](_0x107aad);}});});});}else{return _0xbf0ff0[_0x7492('0x1f')](0xc8);}})[_0x7492('0x37')](handleError(_0xbf0ff0,null));}; \ No newline at end of file +var _0xaa9a=['null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','catch','show','params','includeAll','include','create','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','SmsInteractionId','$gte','options','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','secret','SmsAccount','get','Sms','Account','Owner','format','YYYY-MM-DD\x20HH:mm:ss','disposition','direction','out','System','firstName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','fieldName','type','key','keys','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x5ab236,_0x4ccfe4){var _0x423c1a=function(_0x2347ef){while(--_0x2347ef){_0x5ab236['push'](_0x5ab236['shift']());}};_0x423c1a(++_0x4ccfe4);}(_0xaa9a,0x160));var _0xaaa9=function(_0xb82102,_0x893198){_0xb82102=_0xb82102-0x0;var _0x421905=_0xaa9a[_0xb82102];return _0x421905;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaa9('0x0'));var zipdir=require(_0xaaa9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaaa9('0x2'));var BPromise=require(_0xaaa9('0x3'));var Mustache=require(_0xaaa9('0x4'));var util=require('util');var path=require(_0xaaa9('0x5'));var sox=require(_0xaaa9('0x6'));var csv=require('to-csv');var ejs=require(_0xaaa9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaa9('0x8'));var jsforce=require(_0xaaa9('0x9'));var deskjs=require(_0xaaa9('0xa'));var toCsv=require(_0xaaa9('0xb'));var querystring=require(_0xaaa9('0xc'));var Papa=require(_0xaaa9('0xd'));var Redis=require(_0xaaa9('0xe'));var authService=require(_0xaaa9('0xf'));var qs=require(_0xaaa9('0x10'));var as=require(_0xaaa9('0x11'));var pdf=require(_0xaaa9('0x12'));var hardwareService=require(_0xaaa9('0x13'));var logger=require(_0xaaa9('0x14'))(_0xaaa9('0x15'));var utils=require(_0xaaa9('0x16'));var config=require(_0xaaa9('0x17'));var licenseUtil=require(_0xaaa9('0x18'));var db=require(_0xaaa9('0x19'))['db'];config['redis']=_[_0xaaa9('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaaa9('0x1b'))(new Redis(config['redis']));require(_0xaaa9('0x1c'))[_0xaaa9('0x1d')](socket);function respondWithStatusCode(_0x545c7a,_0x3a4522){_0x3a4522=_0x3a4522||0xcc;return function(_0x3c7133){if(_0x3c7133){return _0x545c7a[_0xaaa9('0x1e')](_0x3a4522);}return _0x545c7a[_0xaaa9('0x1f')](_0x3a4522)['end']();};}function respondWithResult(_0x3ac615,_0x5a2728){_0x5a2728=_0x5a2728||0xc8;return function(_0x4f133e){if(_0x4f133e){return _0x3ac615[_0xaaa9('0x1f')](_0x5a2728)[_0xaaa9('0x20')](_0x4f133e);}};}function respondWithFilteredResult(_0x38f318,_0x3eee33){return function(_0x344a59){if(_0x344a59){var _0x4da46d=typeof _0x3eee33[_0xaaa9('0x21')]===_0xaaa9('0x22')&&typeof _0x3eee33[_0xaaa9('0x23')]==='undefined';var _0x4c09c4=_0x344a59['count'];var _0x183747=_0x4da46d?0x0:_0x3eee33['offset'];var _0x2b3a0d=_0x4da46d?_0x344a59[_0xaaa9('0x24')]:_0x3eee33[_0xaaa9('0x21')]+_0x3eee33['limit'];var _0x29d1d;if(_0x2b3a0d>=_0x4c09c4){_0x2b3a0d=_0x4c09c4;_0x29d1d=0xc8;}else{_0x29d1d=0xce;}_0x38f318[_0xaaa9('0x1f')](_0x29d1d);return _0x38f318[_0xaaa9('0x25')]('Content-Range',_0x183747+'-'+_0x2b3a0d+'/'+_0x4c09c4)['json'](_0x344a59);}return null;};}function patchUpdates(_0x5a7275){return function(_0x479654){try{jsonpatch[_0xaaa9('0x26')](_0x479654,_0x5a7275,!![]);}catch(_0x287741){return BPromise['reject'](_0x287741);}return _0x479654[_0xaaa9('0x27')]();};}function saveUpdates(_0x50753c,_0x571bcc){return function(_0x1252bc){if(_0x1252bc){return _0x1252bc[_0xaaa9('0x28')](_0x50753c)[_0xaaa9('0x29')](function(_0x30aa43){return _0x30aa43;});}return null;};}function removeEntity(_0x329ad7,_0x298fd8){return function(_0x546df7){if(_0x546df7){return _0x546df7[_0xaaa9('0x2a')]()[_0xaaa9('0x29')](function(){_0x329ad7[_0xaaa9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3228b8,_0x96300b){return function(_0x420c1d){if(!_0x420c1d){_0x3228b8[_0xaaa9('0x1e')](0x194);}return _0x420c1d;};}function handleError(_0x496d92,_0x548108){_0x548108=_0x548108||0x1f4;return function(_0x4ca7de){logger[_0xaaa9('0x2b')](_0x4ca7de[_0xaaa9('0x2c')]);if(_0x4ca7de[_0xaaa9('0x2d')]){delete _0x4ca7de[_0xaaa9('0x2d')];}_0x496d92[_0xaaa9('0x1f')](_0x548108)[_0xaaa9('0x2e')](_0x4ca7de);};}function getInteractionUsers(_0x2497a5,_0x17cfbe){return new BPromise(function(_0x43102f,_0x5eab35){try{if(_0x17cfbe[_0x2497a5['id']]){_0x2497a5[_0xaaa9('0x2f')]=_[_0xaaa9('0x30')](_0x17cfbe[_0x2497a5['id']],function(_0xcaaa1d){return{'id':_0xcaaa1d['id'],'fullname':_0xcaaa1d[_0xaaa9('0x31')]};});}}catch(_0x1b4721){_0x5eab35(_0x1b4721);}_0x43102f(_0x2497a5);});}function getInteractionTags(_0x17f388,_0x4750e5){return new BPromise(function(_0x3a63e6,_0x37429e){try{if(_0x17f388[_0xaaa9('0x32')]){_0x17f388[_0xaaa9('0x33')]=[];_0x17f388['TagIds'][_0xaaa9('0x34')](',')[_0xaaa9('0x35')](function(_0x4c4bbb){_0x17f388[_0xaaa9('0x33')][_0xaaa9('0x36')](_0x4750e5[_0x4c4bbb]);});}delete _0x17f388['TagIds'];}catch(_0x1a1a98){_0x37429e(_0x1a1a98);}_0x3a63e6(_0x17f388);});}function updateSmsInteraction(_0x1479f4,_0x5b3094,_0x33cf72){return new BPromise(function(_0x477aa5,_0x22addd){return getInteractionUsers(_0x1479f4,_0x33cf72)[_0xaaa9('0x29')](function(_0x43cc91){return getInteractionTags(_0x43cc91,_0x5b3094);})[_0xaaa9('0x29')](function(_0x574604){return getStateInteraction(_0x574604);})[_0xaaa9('0x29')](function(_0x46c53a){_0x477aa5(_0x46c53a);})['catch'](function(_0x3c2720){_0x22addd(_0x3c2720);});});}function getStateInteraction(_0x114ac9){return new BPromise(function(_0x5ae2c0){_0x114ac9[_0xaaa9('0x37')]=0x0;_0x114ac9[_0xaaa9('0x38')]=0x0;_0x114ac9[_0xaaa9('0x39')]=0x0;_0x114ac9[_0xaaa9('0x3a')]=0x0;_0x114ac9[_0xaaa9('0x3b')]=0x0;if(!_0x114ac9[_0xaaa9('0x3c')]&&!_0x114ac9['UserId']){_0x114ac9[_0xaaa9('0x37')]+=0x1;}if(!_0x114ac9[_0xaaa9('0x3c')]&&_0x114ac9['UserId']){_0x114ac9[_0xaaa9('0x38')]+=0x1;if(_0x114ac9[_0xaaa9('0x37')]){_0x114ac9[_0xaaa9('0x37')]-=0x1;}}if(_0x114ac9[_0xaaa9('0x3c')]&&_0x114ac9[_0xaaa9('0x3d')]){_0x114ac9[_0xaaa9('0x39')]+=0x1;if(_0x114ac9[_0xaaa9('0x38')]){_0x114ac9[_0xaaa9('0x38')]-=0x1;}}if(_0x114ac9[_0xaaa9('0x3c')]&&!_0x114ac9[_0xaaa9('0x3d')]){_0x114ac9[_0xaaa9('0x3a')]+=0x1;if(_0x114ac9[_0xaaa9('0x37')]){_0x114ac9[_0xaaa9('0x37')]-=0x1;}}_0x114ac9[_0xaaa9('0x3b')]+=0x1;_0x5ae2c0(_0x114ac9);});}exports[_0xaaa9('0x3e')]=function(_0x2404f0,_0x377816){var _0x1f35b5={},_0x26704e={},_0x13fe40={'count':0x0,'rows':[]};var _0x3b0369=_['map'](db[_0xaaa9('0x3f')][_0xaaa9('0x40')],function(_0x2d74ae){return{'name':_0x2d74ae[_0xaaa9('0x41')],'type':_0x2d74ae[_0xaaa9('0x42')][_0xaaa9('0x43')]};});_0x26704e['model']=_[_0xaaa9('0x30')](_0x3b0369,_0xaaa9('0x2d'));_0x26704e['query']=_[_0xaaa9('0x44')](_0x2404f0[_0xaaa9('0x45')]);_0x26704e['filters']=_['intersection'](_0x26704e[_0xaaa9('0x46')],_0x26704e[_0xaaa9('0x45')]);_0x1f35b5['attributes']=_[_0xaaa9('0x47')](_0x26704e[_0xaaa9('0x46')],qs[_0xaaa9('0x48')](_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x48')]));_0x1f35b5[_0xaaa9('0x49')]=_0x1f35b5[_0xaaa9('0x49')]['length']?_0x1f35b5[_0xaaa9('0x49')]:_0x26704e['model'];if(!_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x4a')](_0xaaa9('0x4b'))){_0x1f35b5[_0xaaa9('0x23')]=qs['limit'](_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x23')]);_0x1f35b5[_0xaaa9('0x21')]=qs[_0xaaa9('0x21')](_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x21')]);}_0x1f35b5[_0xaaa9('0x4c')]=qs['sort'](_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x4d')]);_0x1f35b5[_0xaaa9('0x4e')]=qs['filters'](_[_0xaaa9('0x4f')](_0x2404f0[_0xaaa9('0x45')],_0x26704e[_0xaaa9('0x50')]),_0x3b0369);var _0x549fc0=[];var _0x38e26b=squel[_0xaaa9('0x51')]()[_0xaaa9('0x52')]('id')[_0xaaa9('0x52')]('name')[_0xaaa9('0x52')]('color')[_0xaaa9('0x53')](_0xaaa9('0x54'));var _0x2cb43f=squel[_0xaaa9('0x51')]()[_0xaaa9('0x52')](_0xaaa9('0x55'))[_0xaaa9('0x52')](_0xaaa9('0x56'))[_0xaaa9('0x52')](_0xaaa9('0x57'))[_0xaaa9('0x53')](_0xaaa9('0x58'),'ui')[_0xaaa9('0x59')]('users','u','u.id\x20=\x20ui.UserId');var _0x5d8788=squel[_0xaaa9('0x51')]()[_0xaaa9('0x53')](_0xaaa9('0x5a'),'i')[_0xaaa9('0x59')](_0xaaa9('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xaaa9('0x59')](_0xaaa9('0x5c'),'o',_0xaaa9('0x5d'))[_0xaaa9('0x59')](_0xaaa9('0x5e'),'a',_0xaaa9('0x5f'))[_0xaaa9('0x59')](_0xaaa9('0x60'),'me',_0xaaa9('0x61'))['left_join'](_0xaaa9('0x62'),'it',_0xaaa9('0x63'))[_0xaaa9('0x59')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x52ae1d=squel[_0xaaa9('0x64')]();var _0x2cfd75=[];var _0x35ec75=squel['expr']();var _0x1da41d;if(_0x2404f0[_0xaaa9('0x45')]['search']){_0x1da41d=as[_0xaaa9('0x65')](_0x2404f0['query'][_0xaaa9('0x66')]);var _0x5e8275=_0x1da41d[_0xaaa9('0x67')];for(var _0x339d40=0x0;_0x339d40<_0x1da41d[_0xaaa9('0x68')]['length'];_0x339d40++){var _0xf3e29=_0x1da41d['conditions'][_0x339d40];var _0xac4ef1='i';var _0x257f6d=_[_0xaaa9('0x69')](_0x3b0369,['name',_0xf3e29[_0xaaa9('0x52')]]);if(!_0x257f6d){switch(_0xf3e29[_0xaaa9('0x52')]){case _0xaaa9('0x6a'):if(_0xf3e29[_0xaaa9('0x6b')]==0x1){_0x5d8788['having']('`'+_0xf3e29[_0xaaa9('0x52')]+_0xaaa9('0x6c'));}else{_0x5d8788['having']('`'+_0xf3e29[_0xaaa9('0x52')]+_0xaaa9('0x6d'));}break;case _0xaaa9('0x6e'):if(_0xf3e29[_0xaaa9('0x6f')]==='$substring'){if(_0xf3e29[_0xaaa9('0x6b')][_0xaaa9('0x34')]('\x20')[_0xaaa9('0x70')]>0x1){_0x52ae1d[_0x5e8275](_0xaaa9('0x71'),qs[_0xaaa9('0x72')](_0xf3e29[_0xaaa9('0x6b')]),null);}else{var _0x28fffa='%'+_0xf3e29['value']+'%';_0x52ae1d[_0x5e8275](_0xaaa9('0x73'),_0x28fffa,_0x28fffa,_0x28fffa);}}else{_0x257f6d=_[_0xaaa9('0x69')](_0x3b0369,['name',_0xaaa9('0x74')]);_0xf3e29[_0xaaa9('0x52')]=_0xaaa9('0x74');_0x378c9d=as[_0xaaa9('0x75')](_0xac4ef1,_0x257f6d[_0xaaa9('0x42')],_0xf3e29);_0x52ae1d[_0x5e8275](_0x378c9d['text'],_0x378c9d[_0xaaa9('0x6b')][_0xaaa9('0x76')],_0x378c9d[_0xaaa9('0x6b')][_0xaaa9('0x77')]);}break;case _0xaaa9('0x78'):var _0x5b6636=_0xf3e29['value']['split'](',')['map'](function(_0x26e85d){return Number(_0x26e85d);});_0x5b6636[_0xaaa9('0x35')](function(_0x38b242){_0x35ec75['or'](_0xaaa9('0x79'),'%,'+_0x38b242+',%');});_0x2cfd75=_[_0xaaa9('0x7a')](_0x2cfd75,_0x5b6636);break;case _0xaaa9('0x7b'):if(_0xf3e29[_0xaaa9('0x6f')]===_0xaaa9('0x7c')){_0x52ae1d[_0x5e8275](_0xaaa9('0x7d'),'%'+_0xf3e29[_0xaaa9('0x6b')]+'%',null);}else{_0x257f6d=_['find'](_0x3b0369,[_0xaaa9('0x2d'),'UserId']);_0xf3e29[_0xaaa9('0x52')]=_0xaaa9('0x3d');_0x378c9d=as[_0xaaa9('0x75')](_0xac4ef1,_0x257f6d[_0xaaa9('0x42')],_0xf3e29);_0x52ae1d[_0x5e8275](_0x378c9d['text'],_0x378c9d[_0xaaa9('0x6b')][_0xaaa9('0x76')],_0x378c9d[_0xaaa9('0x6b')][_0xaaa9('0x77')]);}break;case _0xaaa9('0x7e'):_0x378c9d=as[_0xaaa9('0x75')]('me',null,_0xf3e29);_0x52ae1d[_0x5e8275](_0x378c9d[_0xaaa9('0x7f')],_0x378c9d[_0xaaa9('0x6b')]['start'],_0x378c9d['value'][_0xaaa9('0x77')]);break;}}else{var _0x378c9d=as[_0xaaa9('0x75')](_0xac4ef1,_0x257f6d['type'],_0xf3e29);_0x52ae1d[_0x5e8275](_0x378c9d[_0xaaa9('0x7f')],_0x378c9d['value'][_0xaaa9('0x76')],_0x378c9d[_0xaaa9('0x6b')][_0xaaa9('0x77')]);}}}else{var _0x1bf581=_(_0x2404f0[_0xaaa9('0x45')])['keys']()['map'](function(_0x54054d){return _[_0xaaa9('0x80')](_0x3b0369,[_0xaaa9('0x2d'),_0x54054d])?_0x54054d:undefined;})['compact']()[_0xaaa9('0x6b')]();if(!_[_0xaaa9('0x81')](_0x1bf581)){_0x1bf581[_0xaaa9('0x35')](function(_0x150da9){if(_0x150da9===_0xaaa9('0x82')){_0x5d8788['where'](_0xaaa9('0x83'),[][_0xaaa9('0x84')](_0x2404f0[_0xaaa9('0x45')][_0x150da9]));}else if(_0x150da9===_0xaaa9('0x85')){var _0x56095b=JSON[_0xaaa9('0x86')](_0x2404f0['query'][_0x150da9])['$gte'];var _0x4e92c9=JSON[_0xaaa9('0x86')](_0x2404f0['query'][_0x150da9])['$lte'];_0x5d8788[_0xaaa9('0x4e')](_0xaaa9('0x87'),_0x56095b,_0x4e92c9);}else{if(_0x2404f0[_0xaaa9('0x45')][_0x150da9]===_0xaaa9('0x88')){_0x5d8788[_0xaaa9('0x4e')]('i.'+_0x150da9+_0xaaa9('0x89'));}else{_0x5d8788[_0xaaa9('0x4e')]('i.'+_0x150da9+_0xaaa9('0x8a'),_0x2404f0['query'][_0x150da9]);}}});}if(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x8b')]){if(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x8b')]==0x1){_0x5d8788[_0xaaa9('0x8c')](_0xaaa9('0x8d'));}else{_0x5d8788[_0xaaa9('0x8c')](_0xaaa9('0x8e'));}}if(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x8f')]){_0x2cfd75=_[_0xaaa9('0x90')](_0x2404f0['query'][_0xaaa9('0x8f')])?_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x8f')]:new Array(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x8f')]);_0x2cfd75[_0xaaa9('0x35')](function(_0x1c204c){_0x35ec75['or'](_0xaaa9('0x79'),'%,'+_0x1c204c+',%');});}if(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x91')]){var _0x1b0ec8=_0x2404f0['query'][_0xaaa9('0x91')]['replace']('\x5c','\x5c\x5c')[_0xaaa9('0x92')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1b0ec8)){_0x52ae1d['or'](_0xaaa9('0x93'),_0x1b0ec8+'%')['or']('i.phone\x20LIKE\x20?',_0x1b0ec8+'%');}else{_0x52ae1d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xaaa9('0x72')](_0x1b0ec8))['or'](_0xaaa9('0x94'),_0x1b0ec8+'%');}}}_0x5d8788[_0xaaa9('0x4e')](_0x52ae1d);_0x5d8788['group'](_0xaaa9('0x95'));var _0x402d53={'type':db['Sequelize'][_0xaaa9('0x96')]['SELECT'],'raw':!![]};var _0x5838fd=_0x5d8788[_0xaaa9('0x97')]();_0x5838fd[_0xaaa9('0x52')](_0xaaa9('0x95'));_0x5838fd[_0xaaa9('0x52')](_0xaaa9('0x98'),_0xaaa9('0x6a'));if(_0x1f35b5[_0xaaa9('0x4c')]){_0x1f35b5[_0xaaa9('0x4c')][_0xaaa9('0x35')](function(_0x2a774a){var _0x177e54=_0x2a774a[0x0]===_0xaaa9('0x99')?_0x2a774a[0x0]:'i.'+_0x2a774a[0x0];_0x5d8788[_0xaaa9('0x4c')](_0x177e54,_0x2a774a[0x1]===_0xaaa9('0x9a')?![]:!![]);});}if(!_[_0xaaa9('0x81')](_0x2cfd75)){_0x5d8788[_0xaaa9('0x8c')](_0x35ec75);_0x5838fd[_0xaaa9('0x4e')](_0xaaa9('0x9b'),_0x2cfd75);}BPromise[_0xaaa9('0x9c')]()['then'](function(){if(!_0x1da41d){if(_0x2404f0[_0xaaa9('0x45')]['SmsAccountId'])return;_0x5838fd['where'](_0xaaa9('0x9d'));_0x5d8788[_0xaaa9('0x4e')](_0xaaa9('0x9d'));return;}if(_0x2404f0[_0xaaa9('0x9e')][_0xaaa9('0x9f')]!==_0xaaa9('0xa0'))return;return _0x2404f0['user'][_0xaaa9('0xa1')]({'attributes':['id'],'raw':!![]})[_0xaaa9('0x29')](function(_0x2f894f){if(_[_0xaaa9('0x81')](_0x2f894f)){_0x5838fd['where'](_0xaaa9('0xa2'));_0x5d8788[_0xaaa9('0x4e')](_0xaaa9('0xa2'));}else{_0x5838fd[_0xaaa9('0x4e')](_0xaaa9('0x83'),_[_0xaaa9('0x30')](_0x2f894f,'id'));_0x5d8788[_0xaaa9('0x4e')](_0xaaa9('0x83'),_['map'](_0x2f894f,'id'));}});})[_0xaaa9('0x29')](function(){if(_0x2404f0[_0xaaa9('0x9e')][_0xaaa9('0x9f')]===_0xaaa9('0xa0')&&!_0x1da41d&&!_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x82')])return[];return db[_0xaaa9('0xa3')][_0xaaa9('0x45')](_0x5838fd[_0xaaa9('0xa4')](),_0x402d53);})[_0xaaa9('0x29')](function(_0x116229){_0x13fe40[_0xaaa9('0x24')]=_0x116229[_0xaaa9('0x70')];if(_0x13fe40[_0xaaa9('0x24')]===0x0)return[];return db[_0xaaa9('0xa3')]['query'](_0x38e26b[_0xaaa9('0xa4')](),_0x402d53)[_0xaaa9('0x29')](function(_0x53c19f){_0x549fc0=_[_0xaaa9('0xa5')](_0x53c19f,'id');_0x402d53=_[_0xaaa9('0xa6')](_0x402d53,{'model':db[_0xaaa9('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2404f0[_0xaaa9('0x45')][_0xaaa9('0x48')]){_0x1f35b5[_0xaaa9('0x49')]['forEach'](function(_0x3dceed){_0x5d8788[_0xaaa9('0x52')]('i.'+_0x3dceed);});}else{_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0x98'),_0xaaa9('0x6a'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xa7'),_0xaaa9('0xa8'));_0x5d8788['field'](_0xaaa9('0xa9'),_0xaaa9('0xaa'));_0x5d8788['field'](_0xaaa9('0xab'),_0xaaa9('0x99'));_0x5d8788[_0xaaa9('0x52')]('i.*');_0x5d8788['field']('c.firstName',_0xaaa9('0xac'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xad'),_0xaaa9('0xae'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xaf'),_0xaaa9('0xb0'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb1'),'Contact.phone');_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb2'),_0xaaa9('0xb3'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb4'),'Contact.fax');_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb5'),_0xaaa9('0xb6'));_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb7'),'Owner.internal');_0x5d8788[_0xaaa9('0x52')](_0xaaa9('0xb8'),_0xaaa9('0x32'));}if(_0x1f35b5[_0xaaa9('0x23')])_0x5d8788[_0xaaa9('0x23')](_0x1f35b5[_0xaaa9('0x23')]);if(_0x1f35b5[_0xaaa9('0x21')])_0x5d8788['offset'](_0x1f35b5[_0xaaa9('0x21')]);return db[_0xaaa9('0xa3')][_0xaaa9('0x45')](_0x5d8788[_0xaaa9('0xa4')](),_0x402d53);})[_0xaaa9('0x29')](function(_0xc7d062){if(_0xc7d062['length']>0x0)_0x2cb43f[_0xaaa9('0x4e')](_0xaaa9('0xb9'),_['map'](_0xc7d062,'id'));return db[_0xaaa9('0xa3')]['query'](_0x2cb43f['toString'](),_0x402d53)['then'](function(_0x1cfc5d){var _0x31ee6f=_[_0xaaa9('0xba')](_0x1cfc5d,'SmsInteractionId');var _0xd5a433=[];_0xc7d062[_0xaaa9('0x35')](function(_0x4537c1){_0xd5a433['push'](updateSmsInteraction(_0x4537c1,_0x549fc0,_0x31ee6f));});return BPromise[_0xaaa9('0xbb')](_0xd5a433);});});})[_0xaaa9('0x29')](function(_0x523087){_0x13fe40[_0xaaa9('0xbc')]=_0x523087;return _0x13fe40;})['then'](respondWithFilteredResult(_0x377816,_0x1f35b5))[_0xaaa9('0xbd')](handleError(_0x377816,null));};exports[_0xaaa9('0xbe')]=function(_0x42b6b0,_0x20dda5){var _0x48846b={'raw':![],'where':{'id':_0x42b6b0[_0xaaa9('0xbf')]['id']}},_0x2b35fa={};_0x2b35fa[_0xaaa9('0x46')]=_[_0xaaa9('0x44')](db[_0xaaa9('0x3f')][_0xaaa9('0x40')]);_0x2b35fa['query']=_[_0xaaa9('0x44')](_0x42b6b0[_0xaaa9('0x45')]);_0x2b35fa[_0xaaa9('0x50')]=_['intersection'](_0x2b35fa[_0xaaa9('0x46')],_0x2b35fa[_0xaaa9('0x45')]);_0x48846b['attributes']=_[_0xaaa9('0x47')](_0x2b35fa[_0xaaa9('0x46')],qs[_0xaaa9('0x48')](_0x42b6b0[_0xaaa9('0x45')][_0xaaa9('0x48')]));_0x48846b['attributes']=_0x48846b['attributes']['length']?_0x48846b[_0xaaa9('0x49')]:_0x2b35fa['model'];if(_0x42b6b0[_0xaaa9('0x45')][_0xaaa9('0xc0')]){_0x48846b[_0xaaa9('0xc1')]=[{'all':!![]}];}_0x48846b=_['merge']({},_0x48846b,_0x42b6b0['options']);return db[_0xaaa9('0x3f')][_0xaaa9('0x69')](_0x48846b)['then'](handleEntityNotFound(_0x20dda5,null))[_0xaaa9('0x29')](respondWithResult(_0x20dda5,null))[_0xaaa9('0xbd')](handleError(_0x20dda5,null));};exports[_0xaaa9('0xc2')]=function(_0x17b7f1,_0x191db5){return db['SmsInteraction'][_0xaaa9('0xc2')](_0x17b7f1[_0xaaa9('0x7e')],{})[_0xaaa9('0x29')](respondWithResult(_0x191db5,0xc9))[_0xaaa9('0xbd')](handleError(_0x191db5,null));};exports[_0xaaa9('0x28')]=function(_0x29230e,_0x14e8cf){if(_0x29230e['body']['id']){delete _0x29230e[_0xaaa9('0x7e')]['id'];}return db[_0xaaa9('0x3f')]['find']({'where':{'id':_0x29230e['params']['id']}})['then'](handleEntityNotFound(_0x14e8cf,null))[_0xaaa9('0x29')](saveUpdates(_0x29230e[_0xaaa9('0x7e')],null))[_0xaaa9('0x29')](respondWithResult(_0x14e8cf,null))[_0xaaa9('0xbd')](handleError(_0x14e8cf,null));};exports['destroy']=function(_0x4ce59c,_0x19e337){return db[_0xaaa9('0x3f')][_0xaaa9('0x69')]({'where':{'id':_0x4ce59c['params']['id']}})[_0xaaa9('0x29')](handleEntityNotFound(_0x19e337,null))[_0xaaa9('0x29')](removeEntity(_0x19e337,null))[_0xaaa9('0xbd')](handleError(_0x19e337,null));};exports['describe']=function(_0x4137ca,_0x1d5317){return db[_0xaaa9('0x3f')][_0xaaa9('0xc3')]()['then'](respondWithResult(_0x1d5317,null))['catch'](handleError(_0x1d5317,null));};exports[_0xaaa9('0xc4')]=function(_0x5e3e3c,_0x1ba80e,_0x2916b0){return db['SmsMessage'][_0xaaa9('0x69')]({'where':{'id':_0x5e3e3c[_0xaaa9('0xbf')]['id']}})[_0xaaa9('0x29')](handleEntityNotFound(_0x1ba80e,null))[_0xaaa9('0x29')](function(_0x2526b3){if(_0x2526b3){return _0x2526b3[_0xaaa9('0xc4')](_0x5e3e3c[_0xaaa9('0x7e')]['ids'],_[_0xaaa9('0xc5')](_0x5e3e3c[_0xaaa9('0x7e')],[_0xaaa9('0xc6'),'id'])||{});}})[_0xaaa9('0x29')](respondWithResult(_0x1ba80e,null))[_0xaaa9('0xbd')](handleError(_0x1ba80e,null));};exports[_0xaaa9('0xc7')]=function(_0x2760b7,_0x5e07d9,_0x1dc1fe){var _0x39fe83={'raw':![],'where':{}};var _0xcea21={};var _0x13fc66={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xaaa9('0xc8')]({'where':{'id':_0x2760b7['params']['id']}})[_0xaaa9('0x29')](handleEntityNotFound(_0x5e07d9,null))[_0xaaa9('0x29')](function(_0x44f2ff){if(_0x44f2ff){_0xcea21['model']=_[_0xaaa9('0x44')](db[_0xaaa9('0xc9')][_0xaaa9('0x40')]);_0xcea21['query']=_[_0xaaa9('0x44')](_0x2760b7[_0xaaa9('0x45')]);_0xcea21['filters']=_[_0xaaa9('0x47')](_0xcea21[_0xaaa9('0x46')],_0xcea21[_0xaaa9('0x45')]);_0x39fe83[_0xaaa9('0x49')]=_['intersection'](_0xcea21[_0xaaa9('0x46')],qs['fields'](_0x2760b7[_0xaaa9('0x45')][_0xaaa9('0x48')]));_0x39fe83[_0xaaa9('0x49')]=_0x39fe83[_0xaaa9('0x49')][_0xaaa9('0x70')]?_0x39fe83['attributes']:_0xcea21[_0xaaa9('0x46')];if(!_0x2760b7[_0xaaa9('0x45')][_0xaaa9('0x4a')](_0xaaa9('0x4b'))){_0x39fe83[_0xaaa9('0x23')]=qs['limit'](_0x2760b7['query'][_0xaaa9('0x23')]);_0x39fe83[_0xaaa9('0x21')]=qs[_0xaaa9('0x21')](_0x2760b7[_0xaaa9('0x45')][_0xaaa9('0x21')]);}_0x39fe83[_0xaaa9('0x4c')]=qs['sort'](_0x2760b7[_0xaaa9('0x45')]['sort']);_0x39fe83['where']=qs['filters'](_['pick'](_0x2760b7[_0xaaa9('0x45')],_0xcea21[_0xaaa9('0x50')]));_0x39fe83[_0xaaa9('0x4e')][_0xaaa9('0xca')]=_0x44f2ff['id'];if(_0x2760b7[_0xaaa9('0x45')][_0xaaa9('0x91')]){_0x39fe83[_0xaaa9('0x4e')]=_[_0xaaa9('0xa6')](_0x39fe83[_0xaaa9('0x4e')],{'$or':_[_0xaaa9('0x30')](_0x39fe83[_0xaaa9('0x49')],function(_0x3ee99c){var _0x3dc47b={};_0x3dc47b[_0x3ee99c]={'$like':'%'+_0x2760b7['query'][_0xaaa9('0x91')]+'%'};return _0x3dc47b;})});}if(_0x2760b7[_0xaaa9('0x45')]['$gte']){var _0x225824=_0x2760b7[_0xaaa9('0x45')][_0xaaa9('0xcb')][_0xaaa9('0x34')](',');var _0x2116d9={};_0x2116d9[_0x225824[0x0]]={'$gte':moment(_0x225824[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x39fe83['where']=_['merge'](_0x39fe83[_0xaaa9('0x4e')],_0x2116d9);}_0x39fe83=_[_0xaaa9('0xa6')]({},_0x39fe83,_0x2760b7[_0xaaa9('0xcc')]);return db['SmsMessage'][_0xaaa9('0x24')]({'where':_0x39fe83[_0xaaa9('0x4e')]})[_0xaaa9('0x29')](function(_0x243934){_0x13fc66[_0xaaa9('0x24')]=_0x243934;if(_0x2760b7[_0xaaa9('0x45')]['includeAll']){_0x39fe83['include']=[{'all':!![]}];}return db[_0xaaa9('0xc9')][_0xaaa9('0xcd')](_0x39fe83);})[_0xaaa9('0x29')](function(_0x3eeb6c){_0x13fc66[_0xaaa9('0xbc')]=_0x3eeb6c;return _0x13fc66;});}})[_0xaaa9('0x29')](respondWithFilteredResult(_0x5e07d9,_0x39fe83))[_0xaaa9('0xbd')](handleError(_0x5e07d9,null));};exports[_0xaaa9('0xce')]=function(_0x320d92,_0x4377bb,_0x36e413){return db[_0xaaa9('0x3f')][_0xaaa9('0x69')]({'where':{'id':_0x320d92[_0xaaa9('0xbf')]['id']}})[_0xaaa9('0x29')](handleEntityNotFound(_0x4377bb,null))[_0xaaa9('0x29')](function(_0x15e574){if(_0x15e574){return _0x15e574[_0xaaa9('0xcf')](_0x320d92[_0xaaa9('0x7e')][_0xaaa9('0xc6')],_[_0xaaa9('0xc5')](_0x320d92['body'],[_0xaaa9('0xc6'),'id'])||{})[_0xaaa9('0xd0')](function(){return db[_0xaaa9('0x78')][_0xaaa9('0xcd')]({'attributes':['id',_0xaaa9('0x2d'),'color'],'where':{'id':_0x320d92[_0xaaa9('0x7e')][_0xaaa9('0xc6')]}});})[_0xaaa9('0x29')](function(_0x4dd962){socket[_0xaaa9('0xd1')](_0xaaa9('0xd2'),{'id':Number(_0x320d92[_0xaaa9('0xbf')]['id']),'tags':_0x4dd962||[]});return{'id':Number(_0x320d92[_0xaaa9('0xbf')]['id']),'tags':_0x4dd962||[]};});}})[_0xaaa9('0x29')](respondWithResult(_0x4377bb,null))[_0xaaa9('0xbd')](handleError(_0x4377bb,null));};exports[_0xaaa9('0xd3')]=function(_0x4c1a78,_0x30c779,_0x489479){return db[_0xaaa9('0x3f')][_0xaaa9('0x69')]({'where':{'id':_0x4c1a78[_0xaaa9('0xbf')]['id']}})[_0xaaa9('0x29')](handleEntityNotFound(_0x30c779,null))['then'](function(_0x474e39){if(_0x474e39){return _0x474e39[_0xaaa9('0xd3')](_0x4c1a78[_0xaaa9('0x45')][_0xaaa9('0xc6')]);}})[_0xaaa9('0x29')](respondWithStatusCode(_0x30c779,null))[_0xaaa9('0xbd')](handleError(_0x30c779,null));};exports[_0xaaa9('0xd4')]=function(_0x172223,_0x525232){var _0x5aaac6=moment()[_0xaaa9('0xd5')]()[_0xaaa9('0xa4')]();var _0xc78254=path['join'](config[_0xaaa9('0xd6')],_0xaaa9('0xd7'),_0xaaa9('0xd8'),_0xaaa9('0xd9'));var _0x251c8c=path[_0xaaa9('0xda')](config[_0xaaa9('0xd6')],_0xaaa9('0xd7'),_0xaaa9('0xd8'),_0xaaa9('0xdb'));var _0xa15f3e=path['join'](_0xc78254,_0x5aaac6);var _0x253d22=util['format'](_0xaaa9('0xdc'),_0x172223[_0xaaa9('0xbf')]['id'],_0x5aaac6);var _0x464f5b=path[_0xaaa9('0xda')](_0xc78254,_0x253d22);var _0x211a33=[];_0x211a33[_0xaaa9('0x36')]({'model':db[_0xaaa9('0x7b')],'as':'User','attributes':['id',_0xaaa9('0x31')],'raw':!![]});_0x211a33[_0xaaa9('0x36')]({'model':db[_0xaaa9('0xdd')],'as':'Contact','attributes':['id','firstName',_0xaaa9('0xde')],'raw':!![]});var _0x1f8889=[{'model':db[_0xaaa9('0xc9')],'as':_0xaaa9('0xdf'),'attributes':['id','body',_0xaaa9('0x85'),'direction',_0xaaa9('0xe0'),'read'],'include':_0x211a33}];_0x1f8889[_0xaaa9('0x36')]({'model':db[_0xaaa9('0xe1')],'as':'Account','attributes':['id',_0xaaa9('0x2d')]});_0x1f8889[_0xaaa9('0x36')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0xaaa9('0x3f')][_0xaaa9('0x69')]({'where':{'id':_0x172223[_0xaaa9('0xbf')]['id']},'include':_0x1f8889})['then'](handleEntityNotFound(_0x525232,null))[_0xaaa9('0x29')](function(_0x1ab503){if(_0x1ab503){var _0x13f926=_0x1ab503[_0xaaa9('0xe2')]({'plain':!![]});fs['mkdirSync'](_0xa15f3e);var _0x207dec={'channel':_0xaaa9('0xe3'),'account':_0x13f926[_0xaaa9('0xe4')][_0xaaa9('0x2d')],'agent':_0x13f926[_0xaaa9('0xe5')]?_0x13f926['Owner']['fullname']:'N.A.','createdAt':moment(_0x13f926[_0xaaa9('0x85')])[_0xaaa9('0xe6')](_0xaaa9('0xe7'))[_0xaaa9('0xa4')](),'closedAt':_0x13f926[_0xaaa9('0x3c')]?moment(_0x13f926['closedAt'])[_0xaaa9('0xe6')](_0xaaa9('0xe7'))[_0xaaa9('0xa4')]():'','disposition':_0x13f926[_0xaaa9('0xe8')],'messages':_(_0x13f926[_0xaaa9('0xdf')])[_0xaaa9('0x91')]({'secret':![]})[_0xaaa9('0x30')](function(_0x584a9d){return{'date':moment(_0x584a9d[_0xaaa9('0x85')])[_0xaaa9('0xe6')](_0xaaa9('0xe7'))[_0xaaa9('0xa4')](),'sender':_0x584a9d[_0xaaa9('0xe9')]===_0xaaa9('0xea')?_0x584a9d['User']?_0x584a9d[_0xaaa9('0x7b')][_0xaaa9('0x31')]:_0xaaa9('0xeb'):_0x584a9d[_0xaaa9('0x6e')][_0xaaa9('0xec')]+(_0x584a9d[_0xaaa9('0x6e')][_0xaaa9('0xde')]?'\x20'+_0x584a9d['Contact'][_0xaaa9('0xde')]:''),'body':_0x584a9d['body'],'direction':_0x584a9d[_0xaaa9('0xe9')]===_0xaaa9('0xea')?'A':'C','secret':_0x584a9d[_0xaaa9('0xe0')],'read':_0x584a9d[_0xaaa9('0x8b')]};})[_0xaaa9('0x6b')]()};return ejs[_0xaaa9('0xed')](path[_0xaaa9('0xda')](config['root'],_0xaaa9('0xd7'),_0xaaa9('0xee'),_0xaaa9('0xef')),{'interaction':_0x207dec})[_0xaaa9('0x29')](function(_0x1803db){var _0x560746=path[_0xaaa9('0xda')](_0xa15f3e,'transcript-'+_0x13f926['id']+'-'+_0x5aaac6+'.pdf');var _0x4003d5={'path':_0x560746,'channel':_0xaaa9('0xe3'),'interactionId':_0x13f926['id']};return pdf[_0xaaa9('0xf0')](_0x1803db,_0x4003d5);})[_0xaaa9('0x29')](function(){return new BPromise(function(_0x3764ab,_0x3f613c){zipdir(_0xa15f3e,{'saveTo':_0x464f5b},function(_0x441967,_0x4d2782){if(_0x441967)return _0x3f613c(_0x441967);return _0x3764ab(_0x4d2782);});})[_0xaaa9('0x29')](function(){return new BPromise(function(_0x1deb0c,_0x43d95e){rimraf(_0xa15f3e,function(_0x40d1e4){if(_0x40d1e4)_0x43d95e(_0x40d1e4);return _0x1deb0c();});});})[_0xaaa9('0x29')](function(){return _0x525232['download'](_0x464f5b,_0x253d22,function(_0x345973){if(_0x345973){console[_0xaaa9('0xf1')](_0xaaa9('0xf2'),_0x345973);}else{fs[_0xaaa9('0xf3')](_0x464f5b);}});});});}else{return _0x525232[_0xaaa9('0x1e')](0xc8);}})['catch'](handleError(_0x525232,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f3ffe6d..cececd4 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 _0x7708=['hook','exports','events','../../mysqldb','remove','getUsers','then','setDataValue','Users','map','length','emit','catch'];(function(_0x1b2748,_0x4b3ad2){var _0x18fe11=function(_0x561c11){while(--_0x561c11){_0x1b2748['push'](_0x1b2748['shift']());}};_0x18fe11(++_0x4b3ad2);}(_0x7708,0x188));var _0x8770=function(_0x4c6cf0,_0x826f70){_0x4c6cf0=_0x4c6cf0-0x0;var _0x108145=_0x7708[_0x4c6cf0];return _0x108145;};'use strict';var EventEmitter=require(_0x8770('0x0'));var SmsInteraction=require(_0x8770('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8770('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8770('0x2')};function emitEvent(_0x1a796d){return function(_0x577b13,_0x40d401,_0x50bab7){_0x577b13[_0x8770('0x3')]({'attributes':['id'],'raw':!![]})[_0x8770('0x4')](function(_0x2b0295){_0x577b13[_0x8770('0x5')](_0x8770('0x6'),_0x2b0295[_0x8770('0x7')](function(_0x2d4a1d){return{'id':_0x2d4a1d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x577b13['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8770('0x4')](function(_0x2ca830){_0x577b13[_0x8770('0x5')]('unreadMessages',_0x2ca830[_0x8770('0x8')]);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d+':'+_0x577b13['id'],_0x577b13);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d,_0x577b13);_0x50bab7(null);})[_0x8770('0xa')](_0x50bab7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8770('0xb')](e,emitEvent(event));}}module[_0x8770('0xc')]=SmsInteractionEvents; \ No newline at end of file +var _0x7d25=['SmsMessage','setMaxListeners','save','update','then','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0xe0ae57,_0x2f3057){var _0x430e0c=function(_0x28e625){while(--_0x28e625){_0xe0ae57['push'](_0xe0ae57['shift']());}};_0x430e0c(++_0x2f3057);}(_0x7d25,0x8a));var _0x57d2=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x7d25[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x57d2('0x0'))['db'][_0x57d2('0x1')];var SmsMessage=require(_0x57d2('0x0'))['db'][_0x57d2('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x57d2('0x3')](0x0);var events={'afterCreate':_0x57d2('0x4'),'afterUpdate':_0x57d2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5337ca){return function(_0x52a4f4,_0x5dea84,_0x3c5511){_0x52a4f4['getUsers']({'attributes':['id'],'raw':!![]})[_0x57d2('0x6')](function(_0x263d35){_0x52a4f4[_0x57d2('0x7')]('Users',_0x263d35['map'](function(_0xeb8b91){return{'id':_0xeb8b91['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x52a4f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57d2('0x6')](function(_0x5153c2){_0x52a4f4[_0x57d2('0x7')]('unreadMessages',_0x5153c2[_0x57d2('0x8')]);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca+':'+_0x52a4f4['id'],_0x52a4f4);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca,_0x52a4f4);_0x3c5511(null);})[_0x57d2('0xa')](_0x3c5511(null));};}for(var e in events){if(events[_0x57d2('0xb')](e)){var event=events[e];SmsInteraction[_0x57d2('0xc')](e,emitEvent(event));}}module[_0x57d2('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 2ccf494..c1ba878 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 _0xa1f0=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b0724,_0x518a72){var _0x313307=function(_0x32cdb7){while(--_0x32cdb7){_0x4b0724['push'](_0x4b0724['shift']());}};_0x313307(++_0x518a72);}(_0xa1f0,0x66));var _0x0a1f=function(_0x168612,_0x254c33){_0x168612=_0x168612-0x0;var _0x277381=_0xa1f0[_0x168612];return _0x277381;};'use strict';var _=require(_0x0a1f('0x0'));var util=require(_0x0a1f('0x1'));var logger=require(_0x0a1f('0x2'))(_0x0a1f('0x3'));var moment=require(_0x0a1f('0x4'));var BPromise=require(_0x0a1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a1f('0x6'));var rimraf=require('rimraf');var config=require(_0x0a1f('0x7'));var attributes=require(_0x0a1f('0x8'));module[_0x0a1f('0x9')]=function(_0x2e02b5,_0x2d09b7){return _0x2e02b5[_0x0a1f('0xa')](_0x0a1f('0xb'),attributes,{'tableName':_0x0a1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x163760,_0x1d26ce,_0x22645e){if(_0x163760['changed'](_0x0a1f('0xd'))){_0x163760[_0x0a1f('0xe')]=moment()[_0x0a1f('0xf')](_0x0a1f('0x10'));}_0x22645e(null,_0x163760);}}});}; \ No newline at end of file +var _0xc90b=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt'];(function(_0x1e5a18,_0x3525f3){var _0x18854b=function(_0x24990d){while(--_0x24990d){_0x1e5a18['push'](_0x1e5a18['shift']());}};_0x18854b(++_0x3525f3);}(_0xc90b,0x123));var _0xbc90=function(_0x2fe27f,_0x1b3464){_0x2fe27f=_0x2fe27f-0x0;var _0x9e7c20=_0xc90b[_0x2fe27f];return _0x9e7c20;};'use strict';var _=require(_0xbc90('0x0'));var util=require('util');var logger=require(_0xbc90('0x1'))(_0xbc90('0x2'));var moment=require(_0xbc90('0x3'));var BPromise=require(_0xbc90('0x4'));var rp=require(_0xbc90('0x5'));var fs=require('fs');var path=require(_0xbc90('0x6'));var rimraf=require(_0xbc90('0x7'));var config=require('../../config/environment');var attributes=require(_0xbc90('0x8'));module[_0xbc90('0x9')]=function(_0x108743,_0x46c38c){return _0x108743[_0xbc90('0xa')](_0xbc90('0xb'),attributes,{'tableName':_0xbc90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c385d,_0xaa4a9a,_0x2e5ddb){if(_0x5c385d[_0xbc90('0xd')]('closed')){_0x5c385d[_0xbc90('0xe')]=moment()[_0xbc90('0xf')](_0xbc90('0x10'));}_0x2e5ddb(null,_0x5c385d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 56fe07f..53695d2 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 _0x59bb=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message','SmsInteraction','update','options','where','attributes','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','addTags','body','ids','spread','AddTags','lodash','util','bluebird','ioredis'];(function(_0x225db5,_0x2bf9fa){var _0x136ba8=function(_0x2be904){while(--_0x2be904){_0x225db5['push'](_0x225db5['shift']());}};_0x136ba8(++_0x2bf9fa);}(_0x59bb,0x19e));var _0xb59b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x59bb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb59b('0x0'));var util=require(_0xb59b('0x1'));var moment=require('moment');var BPromise=require(_0xb59b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb59b('0x3'));var db=require(_0xb59b('0x4'))['db'];var utils=require(_0xb59b('0x5'));var logger=require('../../config/logger')(_0xb59b('0x6'));var config=require(_0xb59b('0x7'));var jayson=require(_0xb59b('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xb59b('0x9')]=_[_0xb59b('0xa')](config[_0xb59b('0x9')],{'host':_0xb59b('0xb'),'port':0x18eb});var socket=require(_0xb59b('0xc'))(new Redis(config[_0xb59b('0x9')]));require(_0xb59b('0xd'))[_0xb59b('0xe')](socket);function respondWithRpcPromise(_0x45421e,_0x2411b7,_0xd4b510){return new BPromise(function(_0x590803,_0x24d783){return client[_0xb59b('0xf')](_0x45421e,_0xd4b510)[_0xb59b('0x10')](function(_0x1d5522){logger[_0xb59b('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2411b7,_0xb59b('0x12'));logger[_0xb59b('0x13')](_0xb59b('0x14'),_0x2411b7,'request\x20sent',JSON[_0xb59b('0x15')](_0x1d5522));if(_0x1d5522[_0xb59b('0x16')]){if(_0x1d5522['error']['code']===0x1f4){logger[_0xb59b('0x16')](_0xb59b('0x17'),_0x2411b7,_0x1d5522['error'][_0xb59b('0x18')]);return _0x24d783(_0x1d5522[_0xb59b('0x16')]['message']);}logger['error'](_0xb59b('0x17'),_0x2411b7,_0x1d5522[_0xb59b('0x16')][_0xb59b('0x18')]);return _0x590803(_0x1d5522['error']['message']);}else{logger[_0xb59b('0x11')](_0xb59b('0x17'),_0x2411b7,'request\x20sent');_0x590803(_0x1d5522['result'][_0xb59b('0x18')]);}})['catch'](function(_0x18f93e){logger[_0xb59b('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2411b7,_0x18f93e);_0x24d783(_0x18f93e);});});}exports['UpdateSmsInteraction']=function(_0x2183e2){var _0x4df66c=this;return new Promise(function(_0x4081c6,_0x9dc445){return db[_0xb59b('0x19')][_0xb59b('0x1a')](_0x2183e2['body'],{'raw':_0x2183e2[_0xb59b('0x1b')]?_0x2183e2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2183e2[_0xb59b('0x1b')]?_0x2183e2['options'][_0xb59b('0x1c')]||null:null,'attributes':_0x2183e2['options']?_0x2183e2['options'][_0xb59b('0x1d')]||null:null,'limit':_0x2183e2[_0xb59b('0x1b')]?_0x2183e2['options']['limit']||null:null})[_0xb59b('0x10')](function(_0x7ba971){logger[_0xb59b('0x11')](_0xb59b('0x1e'),_0x2183e2);logger[_0xb59b('0x13')](_0xb59b('0x1e'),_0x2183e2,JSON[_0xb59b('0x15')](_0x7ba971));_0x4081c6(_0x7ba971);})[_0xb59b('0x1f')](function(_0x140d06){logger[_0xb59b('0x16')](_0xb59b('0x1e'),_0x140d06[_0xb59b('0x18')],_0x2183e2);_0x9dc445(_0x4df66c[_0xb59b('0x16')](0x1f4,_0x140d06[_0xb59b('0x18')]));});});};exports[_0xb59b('0x20')]=function(_0x28e77f){return new Promise(function(_0x54b105,_0x507251){return db[_0xb59b('0x19')]['find']({'where':_0x28e77f[_0xb59b('0x1b')]?_0x28e77f[_0xb59b('0x1b')][_0xb59b('0x1c')]||null:null})[_0xb59b('0x10')](function(_0x4d9155){if(_0x4d9155){return _0x4d9155[_0xb59b('0x21')](_0x28e77f[_0xb59b('0x22')][_0xb59b('0x23')],_['omit'](_0x28e77f[_0xb59b('0x22')],[_0xb59b('0x23'),'id'])||{});}})[_0xb59b('0x24')](function(_0x365e6b){logger['info'](_0xb59b('0x25'),_0x28e77f);logger[_0xb59b('0x13')](_0xb59b('0x25'),_0x28e77f,JSON[_0xb59b('0x15')](_0x365e6b));_0x54b105(_0x365e6b);})[_0xb59b('0x1f')](function(_0x542029){logger[_0xb59b('0x16')](_0xb59b('0x25'),_0x542029[_0xb59b('0x18')],_0x28e77f);_0x507251(_this[_0xb59b('0x16')](0x1f4,_0x542029[_0xb59b('0x18')]));});});}; \ No newline at end of file +var _0xee7b=['AddTagsToSmsInteraction','SmsInteraction','find','then','body','ids','omit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','update','options','raw','where','info','UpdateSmsInteraction','stringify'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xee7b,0x7f));var _0xbee7=function(_0x441f0e,_0x1a9b47){_0x441f0e=_0x441f0e-0x0;var _0x335309=_0xee7b[_0x441f0e];return _0x335309;};'use strict';var _=require(_0xbee7('0x0'));var util=require(_0xbee7('0x1'));var moment=require(_0xbee7('0x2'));var BPromise=require(_0xbee7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee7('0x4'));var db=require(_0xbee7('0x5'))['db'];var utils=require(_0xbee7('0x6'));var logger=require('../../config/logger')(_0xbee7('0x7'));var config=require(_0xbee7('0x8'));var jayson=require(_0xbee7('0x9'));var client=jayson[_0xbee7('0xa')][_0xbee7('0xb')]({'port':0x232a});config[_0xbee7('0xc')]=_[_0xbee7('0xd')](config[_0xbee7('0xc')],{'host':_0xbee7('0xe'),'port':0x18eb});var socket=require(_0xbee7('0xf'))(new Redis(config[_0xbee7('0xc')]));require(_0xbee7('0x10'))[_0xbee7('0x11')](socket);function respondWithRpcPromise(_0x309c21,_0x50ea7a,_0x54a5a4){return new BPromise(function(_0x409281,_0x2da31f){return client[_0xbee7('0x12')](_0x309c21,_0x54a5a4)['then'](function(_0x385156){logger['info'](_0xbee7('0x13'),_0x50ea7a,_0xbee7('0x14'));logger[_0xbee7('0x15')](_0xbee7('0x16'),_0x50ea7a,'request\x20sent',JSON['stringify'](_0x385156));if(_0x385156['error']){if(_0x385156[_0xbee7('0x17')]['code']===0x1f4){logger[_0xbee7('0x17')](_0xbee7('0x13'),_0x50ea7a,_0x385156['error'][_0xbee7('0x18')]);return _0x2da31f(_0x385156[_0xbee7('0x17')][_0xbee7('0x18')]);}logger['error'](_0xbee7('0x13'),_0x50ea7a,_0x385156[_0xbee7('0x17')][_0xbee7('0x18')]);return _0x409281(_0x385156[_0xbee7('0x17')]['message']);}else{logger['info'](_0xbee7('0x13'),_0x50ea7a,_0xbee7('0x14'));_0x409281(_0x385156['result']['message']);}})[_0xbee7('0x19')](function(_0x5dc370){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x50ea7a,_0x5dc370);_0x2da31f(_0x5dc370);});});}exports['UpdateSmsInteraction']=function(_0x1d2cf3){var _0x20a6c6=this;return new Promise(function(_0x240b3e,_0x37c449){return db['SmsInteraction'][_0xbee7('0x1a')](_0x1d2cf3['body'],{'raw':_0x1d2cf3[_0xbee7('0x1b')]?_0x1d2cf3['options'][_0xbee7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d2cf3[_0xbee7('0x1b')]?_0x1d2cf3[_0xbee7('0x1b')][_0xbee7('0x1d')]||null:null,'attributes':_0x1d2cf3[_0xbee7('0x1b')]?_0x1d2cf3[_0xbee7('0x1b')]['attributes']||null:null,'limit':_0x1d2cf3[_0xbee7('0x1b')]?_0x1d2cf3[_0xbee7('0x1b')]['limit']||null:null})['then'](function(_0x5a8d0b){logger[_0xbee7('0x1e')](_0xbee7('0x1f'),_0x1d2cf3);logger[_0xbee7('0x15')](_0xbee7('0x1f'),_0x1d2cf3,JSON[_0xbee7('0x20')](_0x5a8d0b));_0x240b3e(_0x5a8d0b);})[_0xbee7('0x19')](function(_0x4d45b4){logger[_0xbee7('0x17')](_0xbee7('0x1f'),_0x4d45b4['message'],_0x1d2cf3);_0x37c449(_0x20a6c6['error'](0x1f4,_0x4d45b4[_0xbee7('0x18')]));});});};exports[_0xbee7('0x21')]=function(_0x122441){return new Promise(function(_0x20dda6,_0x5f100e){return db[_0xbee7('0x22')][_0xbee7('0x23')]({'where':_0x122441[_0xbee7('0x1b')]?_0x122441[_0xbee7('0x1b')][_0xbee7('0x1d')]||null:null})[_0xbee7('0x24')](function(_0x5181a8){if(_0x5181a8){return _0x5181a8['addTags'](_0x122441[_0xbee7('0x25')][_0xbee7('0x26')],_[_0xbee7('0x27')](_0x122441[_0xbee7('0x25')],['ids','id'])||{});}})['spread'](function(_0x5c0b6c){logger[_0xbee7('0x1e')]('AddTags',_0x122441);logger[_0xbee7('0x15')]('AddTags',_0x122441,JSON[_0xbee7('0x20')](_0x5c0b6c));_0x20dda6(_0x5c0b6c);})[_0xbee7('0x19')](function(_0x33cdb9){logger['error']('AddTags',_0x33cdb9['message'],_0x122441);_0x5f100e(_this[_0xbee7('0x17')](0x1f4,_0x33cdb9[_0xbee7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index dfd89d3..70dfebd 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 _0x004d=['emit','removeListener','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0xc1c01a,_0x37178c){var _0x13c0d8=function(_0x1df3d3){while(--_0x1df3d3){_0xc1c01a['push'](_0xc1c01a['shift']());}};_0x13c0d8(++_0x37178c);}(_0x004d,0xfc));var _0xd004=function(_0x314ae1,_0x9b919d){_0x314ae1=_0x314ae1-0x0;var _0x4a9801=_0x004d[_0x314ae1];return _0x4a9801;};'use strict';var SmsInteractionEvents=require(_0xd004('0x0'));var events=[_0xd004('0x1'),_0xd004('0x2'),_0xd004('0x3')];function createListener(_0x3d2da5,_0x457b0b){return function(_0x52457b){_0x457b0b[_0xd004('0x4')](_0x3d2da5,_0x52457b);};}function removeListener(_0x150247,_0x4125d6){return function(){SmsInteractionEvents[_0xd004('0x5')](_0x150247,_0x4125d6);};}exports['register']=function(_0x2515af){for(var _0x1639c1=0x0,_0x46e360=events[_0xd004('0x6')];_0x1639c1<_0x46e360;_0x1639c1++){var _0x20e081=events[_0x1639c1];var _0x1c193a=createListener(_0xd004('0x7')+_0x20e081,_0x2515af);SmsInteractionEvents['on'](_0x20e081,_0x1c193a);}}; \ No newline at end of file +var _0xce3f=['remove','update','emit','removeListener','smsInteraction:','./smsInteraction.events','save'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xce3f,0x171));var _0xfce3=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xce3f[_0x2b10c6];return _0x3789d2;};'use strict';var SmsInteractionEvents=require(_0xfce3('0x0'));var events=[_0xfce3('0x1'),_0xfce3('0x2'),_0xfce3('0x3')];function createListener(_0x46f003,_0x53157f){return function(_0x2dfa58){_0x53157f[_0xfce3('0x4')](_0x46f003,_0x2dfa58);};}function removeListener(_0x5c548a,_0x3310cb){return function(){SmsInteractionEvents[_0xfce3('0x5')](_0x5c548a,_0x3310cb);};}exports['register']=function(_0x841f28){for(var _0x2dcc84=0x0,_0x2d2e57=events['length'];_0x2dcc84<_0x2d2e57;_0x2dcc84++){var _0x13b9f0=events[_0x2dcc84];var _0x2afbe3=createListener(_0xfce3('0x6')+_0x13b9f0,_0x841f28);SmsInteractionEvents['on'](_0x13b9f0,_0x2afbe3);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f52d2ce..5cf9c3a 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 _0x1049=['tracked','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','post'];(function(_0x4a87da,_0x30004b){var _0x1509f2=function(_0x5efc50){while(--_0x5efc50){_0x4a87da['push'](_0x4a87da['shift']());}};_0x1509f2(++_0x30004b);}(_0x1049,0xe5));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9104('0x0'));var util=require('util');var path=require(_0x9104('0x1'));var timeout=require('connect-timeout');var express=require(_0x9104('0x2'));var router=express[_0x9104('0x3')]();var fs_extra=require(_0x9104('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9104('0x5'));var config=require(_0x9104('0x6'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x9104('0x7')](),controller['index']);router['get'](_0x9104('0x8'),auth[_0x9104('0x7')](),controller[_0x9104('0x9')]);router[_0x9104('0xa')](_0x9104('0xb'),auth[_0x9104('0x7')](),controller[_0x9104('0xc')]);router[_0x9104('0xd')]('/',auth[_0x9104('0x7')](),interaction[_0x9104('0xe')](_0x9104('0xf'),_0x9104('0x10')),controller['create']);router[_0x9104('0xd')](_0x9104('0x11'),controller[_0x9104('0x12')]);router[_0x9104('0x13')](_0x9104('0xb'),auth[_0x9104('0x7')](),controller[_0x9104('0x14')]);router[_0x9104('0x13')](_0x9104('0x15'),auth[_0x9104('0x7')](),controller[_0x9104('0x16')]);router['put'](_0x9104('0x17'),auth['isAuthenticated'](),controller[_0x9104('0x18')]);router[_0x9104('0x19')](_0x9104('0xb'),auth[_0x9104('0x7')](),controller[_0x9104('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x728e=['describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','status','put','update','accept','reject','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x728e,0x153));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe728('0x0'));var util=require(_0xe728('0x1'));var path=require(_0xe728('0x2'));var timeout=require(_0xe728('0x3'));var express=require(_0xe728('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe728('0x5'));var interaction=require(_0xe728('0x6'));var config=require(_0xe728('0x7'));var controller=require(_0xe728('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe728('0x9')](_0xe728('0xa'),auth[_0xe728('0xb')](),controller[_0xe728('0xc')]);router['get'](_0xe728('0xd'),auth[_0xe728('0xb')](),controller[_0xe728('0xe')]);router[_0xe728('0xf')]('/',auth[_0xe728('0xb')](),interaction['tracked'](_0xe728('0x10'),_0xe728('0x11')),controller[_0xe728('0x12')]);router[_0xe728('0xf')](_0xe728('0x13'),controller[_0xe728('0x14')]);router[_0xe728('0x15')](_0xe728('0xd'),auth[_0xe728('0xb')](),controller[_0xe728('0x16')]);router[_0xe728('0x15')]('/:id/accept',auth['isAuthenticated'](),controller[_0xe728('0x17')]);router['put']('/:id/reject',auth[_0xe728('0xb')](),controller[_0xe728('0x18')]);router[_0xe728('0x19')](_0xe728('0xd'),auth[_0xe728('0xb')](),controller['destroy']);module[_0xe728('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 9bdc7db..82e4827 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 _0xa1aa=['BOOLEAN','ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x2f949e,_0x558bd0){var _0x7899da=function(_0x5f3070){while(--_0x5f3070){_0x2f949e['push'](_0x2f949e['shift']());}};_0x7899da(++_0x558bd0);}(_0xa1aa,0x1a1));var _0xaa1a=function(_0xa009c0,_0x36896b){_0xa009c0=_0xa009c0-0x0;var _0x118551=_0xa1aa[_0xa009c0];return _0x118551;};'use strict';var Sequelize=require(_0xaa1a('0x0'));module['exports']={'body':{'type':Sequelize[_0xaa1a('0x1')](_0xaa1a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa1a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa1a('0x4')]('in',_0xaa1a('0x5')),'defaultValue':_0xaa1a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaa1a('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xaa1a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaa1a('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xbb9d=['exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x24b8aa,_0x3557ac){var _0x2692b2=function(_0x151ba9){while(--_0x151ba9){_0x24b8aa['push'](_0x24b8aa['shift']());}};_0x2692b2(++_0x3557ac);}(_0xbb9d,0x1d3));var _0xdbb9=function(_0x53e928,_0x5a1d52){_0x53e928=_0x53e928-0x0;var _0x5370b2=_0xbb9d[_0x53e928];return _0x5370b2;};'use strict';var Sequelize=require(_0xdbb9('0x0'));module[_0xdbb9('0x1')]={'body':{'type':Sequelize[_0xdbb9('0x2')](_0xdbb9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdbb9('0x4')]('in',_0xdbb9('0x5')),'defaultValue':_0xdbb9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdbb9('0x6')](0xbe)},'phone':{'type':Sequelize[_0xdbb9('0x6')]},'readAt':{'type':Sequelize[_0xdbb9('0x7')]},'secret':{'type':Sequelize[_0xdbb9('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbb9('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index ab22a4c..06b547c 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 _0x6d4b=['SmsInteraction','SmsInteractionId','isNil','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','Status','plivio','inspect','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','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/license/util','redis','defaults','localhost','./smsMessage.socket','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','options','includeAll','include','findAll','rows','length','find','create','body','update','params','describe','../../config/logger','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get'];(function(_0x111b5d,_0x4cdad2){var _0x409f2c=function(_0x1ec51b){while(--_0x1ec51b){_0x111b5d['push'](_0x111b5d['shift']());}};_0x409f2c(++_0x4cdad2);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x4f5798,_0x4a1e2e){_0x4f5798=_0x4f5798-0x0;var _0x215b58=_0x6d4b[_0x4f5798];return _0x215b58;};'use strict';var emlformat=require(_0xb6d4('0x0'));var rimraf=require(_0xb6d4('0x1'));var zipdir=require(_0xb6d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6d4('0x3'));var moment=require(_0xb6d4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb6d4('0x5'));var path=require(_0xb6d4('0x6'));var sox=require(_0xb6d4('0x7'));var csv=require(_0xb6d4('0x8'));var ejs=require(_0xb6d4('0x9'));var fs=require('fs');var fs_extra=require(_0xb6d4('0xa'));var _=require(_0xb6d4('0xb'));var squel=require(_0xb6d4('0xc'));var crypto=require('crypto');var jsforce=require(_0xb6d4('0xd'));var deskjs=require(_0xb6d4('0xe'));var toCsv=require(_0xb6d4('0x8'));var querystring=require(_0xb6d4('0xf'));var Papa=require(_0xb6d4('0x10'));var Redis=require(_0xb6d4('0x11'));var authService=require(_0xb6d4('0x12'));var qs=require(_0xb6d4('0x13'));var as=require(_0xb6d4('0x14'));var hardwareService=require(_0xb6d4('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb6d4('0x16'));var db=require('../../mysqldb')['db'];config[_0xb6d4('0x17')]=_[_0xb6d4('0x18')](config[_0xb6d4('0x17')],{'host':_0xb6d4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6d4('0x17')]));require(_0xb6d4('0x1a'))['register'](socket);var jayson=require(_0xb6d4('0x1b'));var client=jayson['client'][_0xb6d4('0x1c')]({'port':0x232c});var client9002=jayson[_0xb6d4('0x1d')][_0xb6d4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b0dab,_0x9813c8,_0x247c1c,_0x77fba0){return new BPromise(function(_0x5e3b0f,_0x35f16e){var _0x14f314=_0x77fba0||client;return _0x14f314[_0xb6d4('0x1e')](_0x1b0dab,_0x247c1c)[_0xb6d4('0x1f')](function(_0x43ba1f){logger[_0xb6d4('0x20')](_0xb6d4('0x21'),_0x9813c8,_0xb6d4('0x22'));logger[_0xb6d4('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9813c8,'request\x20sent',JSON[_0xb6d4('0x24')](_0x43ba1f));if(_0x43ba1f[_0xb6d4('0x25')]){if(_0x43ba1f[_0xb6d4('0x25')][_0xb6d4('0x26')]===0x1f4){logger[_0xb6d4('0x25')]('SmsMessage,\x20%s,\x20%s',_0x9813c8,_0x43ba1f[_0xb6d4('0x25')][_0xb6d4('0x27')]);return _0x35f16e(_0x43ba1f[_0xb6d4('0x25')]['message']);}logger[_0xb6d4('0x25')]('SmsMessage,\x20%s,\x20%s',_0x9813c8,_0x43ba1f['error'][_0xb6d4('0x27')]);return _0x5e3b0f(_0x43ba1f[_0xb6d4('0x25')]['message']);}else{logger['info'](_0xb6d4('0x21'),_0x9813c8,_0xb6d4('0x22'));_0x5e3b0f(_0x43ba1f[_0xb6d4('0x28')][_0xb6d4('0x27')]);}})[_0xb6d4('0x29')](function(_0x223ca0){logger[_0xb6d4('0x25')](_0xb6d4('0x21'),_0x9813c8,_0x223ca0);_0x35f16e(_0x223ca0);});});}function respondWithStatusCode(_0x93c3b1,_0x3aedc7){_0x3aedc7=_0x3aedc7||0xcc;return function(_0xe67526){if(_0xe67526){return _0x93c3b1[_0xb6d4('0x2a')](_0x3aedc7);}return _0x93c3b1['status'](_0x3aedc7)[_0xb6d4('0x2b')]();};}function respondWithResult(_0xac7c48,_0x54ddeb){_0x54ddeb=_0x54ddeb||0xc8;return function(_0x242a44){if(_0x242a44){return _0xac7c48['status'](_0x54ddeb)[_0xb6d4('0x2c')](_0x242a44);}};}function respondWithFilteredResult(_0x3f2e8b,_0x346d4d){return function(_0x3191d2){if(_0x3191d2){var _0x1a311d=typeof _0x346d4d[_0xb6d4('0x2d')]===_0xb6d4('0x2e')&&typeof _0x346d4d[_0xb6d4('0x2f')]==='undefined';var _0x2aea11=_0x3191d2[_0xb6d4('0x30')];var _0x112d10=_0x1a311d?0x0:_0x346d4d['offset'];var _0x417d70=_0x1a311d?_0x3191d2[_0xb6d4('0x30')]:_0x346d4d['offset']+_0x346d4d[_0xb6d4('0x2f')];var _0x2a40ad;if(_0x417d70>=_0x2aea11){_0x417d70=_0x2aea11;_0x2a40ad=0xc8;}else{_0x2a40ad=0xce;}_0x3f2e8b[_0xb6d4('0x31')](_0x2a40ad);return _0x3f2e8b['set']('Content-Range',_0x112d10+'-'+_0x417d70+'/'+_0x2aea11)['json'](_0x3191d2);}return null;};}function patchUpdates(_0x13458e){return function(_0x11cf0){try{jsonpatch[_0xb6d4('0x32')](_0x11cf0,_0x13458e,!![]);}catch(_0x42a4af){return BPromise[_0xb6d4('0x33')](_0x42a4af);}return _0x11cf0[_0xb6d4('0x34')]();};}function saveUpdates(_0x52638f,_0x59e433){return function(_0x43436f){if(_0x43436f){return _0x43436f['update'](_0x52638f)['then'](function(_0x4a4572){return _0x4a4572;});}return null;};}function removeEntity(_0x5b7771,_0x3ca0d2){return function(_0x1a8201){if(_0x1a8201){return _0x1a8201['destroy']()[_0xb6d4('0x1f')](function(){_0x5b7771['status'](0xcc)[_0xb6d4('0x2b')]();});}};}function handleEntityNotFound(_0x879877,_0x389943){return function(_0x2ac83f){if(!_0x2ac83f){_0x879877[_0xb6d4('0x2a')](0x194);}return _0x2ac83f;};}function handleError(_0x3f452,_0x2b024a){_0x2b024a=_0x2b024a||0x1f4;return function(_0x55d323){logger[_0xb6d4('0x25')](_0x55d323[_0xb6d4('0x35')]);if(_0x55d323[_0xb6d4('0x36')]){delete _0x55d323['name'];}_0x3f452['status'](_0x2b024a)[_0xb6d4('0x37')](_0x55d323);};}exports[_0xb6d4('0x38')]=function(_0x12a3dc,_0x3a8d0e){var _0x7c5b7e={},_0x522a44={},_0x4167bf={'count':0x0,'rows':[]};var _0x54639e=_[_0xb6d4('0x39')](db[_0xb6d4('0x3a')][_0xb6d4('0x3b')],function(_0x4e0ac2){return{'name':_0x4e0ac2[_0xb6d4('0x3c')],'type':_0x4e0ac2['type']['key']};});_0x522a44[_0xb6d4('0x3d')]=_[_0xb6d4('0x39')](_0x54639e,_0xb6d4('0x36'));_0x522a44[_0xb6d4('0x3e')]=_[_0xb6d4('0x3f')](_0x12a3dc[_0xb6d4('0x3e')]);_0x522a44['filters']=_[_0xb6d4('0x40')](_0x522a44['model'],_0x522a44[_0xb6d4('0x3e')]);_0x7c5b7e['attributes']=_[_0xb6d4('0x40')](_0x522a44[_0xb6d4('0x3d')],qs[_0xb6d4('0x41')](_0x12a3dc[_0xb6d4('0x3e')][_0xb6d4('0x41')]));_0x7c5b7e['attributes']=_0x7c5b7e[_0xb6d4('0x42')]['length']?_0x7c5b7e[_0xb6d4('0x42')]:_0x522a44[_0xb6d4('0x3d')];if(!_0x12a3dc[_0xb6d4('0x3e')][_0xb6d4('0x43')](_0xb6d4('0x44'))){_0x7c5b7e[_0xb6d4('0x2f')]=qs['limit'](_0x12a3dc[_0xb6d4('0x3e')]['limit']);_0x7c5b7e[_0xb6d4('0x2d')]=qs[_0xb6d4('0x2d')](_0x12a3dc[_0xb6d4('0x3e')][_0xb6d4('0x2d')]);}_0x7c5b7e[_0xb6d4('0x45')]=qs[_0xb6d4('0x46')](_0x12a3dc['query']['sort']);_0x7c5b7e[_0xb6d4('0x47')]=qs['filters'](_['pick'](_0x12a3dc[_0xb6d4('0x3e')],_0x522a44[_0xb6d4('0x48')]),_0x54639e);if(_0x12a3dc[_0xb6d4('0x3e')]['filter']){_0x7c5b7e['where']=_[_0xb6d4('0x49')](_0x7c5b7e[_0xb6d4('0x47')],{'$or':_[_0xb6d4('0x39')](_0x54639e,function(_0x13d1cb){if(_0x13d1cb[_0xb6d4('0x4a')]!=='VIRTUAL'){var _0x1a3328={};_0x1a3328[_0x13d1cb[_0xb6d4('0x36')]]={'$like':'%'+_0x12a3dc[_0xb6d4('0x3e')][_0xb6d4('0x4b')]+'%'};return _0x1a3328;}})});}_0x7c5b7e=_[_0xb6d4('0x49')]({},_0x7c5b7e,_0x12a3dc[_0xb6d4('0x4c')]);var _0x5df729={'where':_0x7c5b7e['where']};return db[_0xb6d4('0x3a')]['count'](_0x5df729)['then'](function(_0x2f6f4f){_0x4167bf[_0xb6d4('0x30')]=_0x2f6f4f;if(_0x12a3dc[_0xb6d4('0x3e')][_0xb6d4('0x4d')]){_0x7c5b7e[_0xb6d4('0x4e')]=[{'all':!![]}];}return db[_0xb6d4('0x3a')][_0xb6d4('0x4f')](_0x7c5b7e);})['then'](function(_0x862453){_0x4167bf[_0xb6d4('0x50')]=_0x862453;return _0x4167bf;})[_0xb6d4('0x1f')](respondWithFilteredResult(_0x3a8d0e,_0x7c5b7e))[_0xb6d4('0x29')](handleError(_0x3a8d0e,null));};exports['show']=function(_0x59c32f,_0x59bbdf){var _0x496e0a={'raw':!![],'where':{'id':_0x59c32f['params']['id']}},_0x39a718={};_0x39a718[_0xb6d4('0x3d')]=_[_0xb6d4('0x3f')](db[_0xb6d4('0x3a')][_0xb6d4('0x3b')]);_0x39a718[_0xb6d4('0x3e')]=_[_0xb6d4('0x3f')](_0x59c32f['query']);_0x39a718['filters']=_[_0xb6d4('0x40')](_0x39a718[_0xb6d4('0x3d')],_0x39a718['query']);_0x496e0a[_0xb6d4('0x42')]=_[_0xb6d4('0x40')](_0x39a718[_0xb6d4('0x3d')],qs[_0xb6d4('0x41')](_0x59c32f[_0xb6d4('0x3e')]['fields']));_0x496e0a['attributes']=_0x496e0a['attributes'][_0xb6d4('0x51')]?_0x496e0a[_0xb6d4('0x42')]:_0x39a718[_0xb6d4('0x3d')];if(_0x59c32f[_0xb6d4('0x3e')][_0xb6d4('0x4d')]){_0x496e0a['include']=[{'all':!![]}];}_0x496e0a=_[_0xb6d4('0x49')]({},_0x496e0a,_0x59c32f['options']);return db[_0xb6d4('0x3a')][_0xb6d4('0x52')](_0x496e0a)[_0xb6d4('0x1f')](handleEntityNotFound(_0x59bbdf,null))['then'](respondWithResult(_0x59bbdf,null))[_0xb6d4('0x29')](handleError(_0x59bbdf,null));};exports[_0xb6d4('0x53')]=function(_0x554f44,_0x57374a){return db['SmsMessage']['create'](_0x554f44[_0xb6d4('0x54')],{})['then'](respondWithResult(_0x57374a,0xc9))[_0xb6d4('0x29')](handleError(_0x57374a,null));};exports[_0xb6d4('0x55')]=function(_0x505c69,_0x3efa2e){if(_0x505c69['body']['id']){delete _0x505c69[_0xb6d4('0x54')]['id'];}return db[_0xb6d4('0x3a')][_0xb6d4('0x52')]({'where':{'id':_0x505c69[_0xb6d4('0x56')]['id']}})[_0xb6d4('0x1f')](handleEntityNotFound(_0x3efa2e,null))['then'](saveUpdates(_0x505c69[_0xb6d4('0x54')],null))[_0xb6d4('0x1f')](respondWithResult(_0x3efa2e,null))[_0xb6d4('0x29')](handleError(_0x3efa2e,null));};exports['destroy']=function(_0x36a584,_0x50495e){return db[_0xb6d4('0x3a')][_0xb6d4('0x52')]({'where':{'id':_0x36a584['params']['id']}})[_0xb6d4('0x1f')](handleEntityNotFound(_0x50495e,null))[_0xb6d4('0x1f')](removeEntity(_0x50495e,null))[_0xb6d4('0x29')](handleError(_0x50495e,null));};exports[_0xb6d4('0x57')]=function(_0x54aa86,_0x580dbd){return db[_0xb6d4('0x3a')][_0xb6d4('0x57')]()['then'](respondWithResult(_0x580dbd,null))['catch'](handleError(_0x580dbd,null));};var interaction_log=require(_0xb6d4('0x58'))(_0xb6d4('0x59'));exports[_0xb6d4('0x5a')]=function(_0x57466e,_0x58628a,_0x2929ac){var _0x466d80={'agent':{},'channel':'sms'};if(_0x57466e[_0xb6d4('0x54')]['id']){delete _0x57466e[_0xb6d4('0x54')]['id'];}_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5b')]=!![];_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5c')]=moment()[_0xb6d4('0x5d')](_0xb6d4('0x5e'));_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5f')]=_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5f')]||_0x57466e[_0xb6d4('0x60')]['id'];_0x466d80[_0xb6d4('0x61')]['id']=_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5f')];return db[_0xb6d4('0x3a')][_0xb6d4('0x52')]({'where':{'id':_0x57466e[_0xb6d4('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x58628a,null))[_0xb6d4('0x1f')](saveUpdates(_0x57466e[_0xb6d4('0x54')],null))[_0xb6d4('0x1f')](function(_0x35541c){if(_0x35541c){_0x466d80[_0xb6d4('0x27')]=_0x35541c[_0xb6d4('0x62')]({'plain':!![]});return db[_0xb6d4('0x63')][_0xb6d4('0x52')]({'where':{'id':_0x35541c[_0xb6d4('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x58628a,null))[_0xb6d4('0x1f')](function(_0x12bea9){if(_0x12bea9){return _0x12bea9[_0xb6d4('0x55')]({'UserId':_0x57466e[_0xb6d4('0x54')]['UserId'],'read1stAt':_[_0xb6d4('0x65')](_0x12bea9['read1stAt'])?moment()[_0xb6d4('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x205a81){if(_0x205a81){_0x466d80[_0xb6d4('0x66')]=_0x205a81[_0xb6d4('0x62')]({'plain':!![]});interaction_log[_0xb6d4('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57466e[_0xb6d4('0x60')]['id'],_0x57466e[_0xb6d4('0x60')][_0xb6d4('0x36')],_0x57466e[_0xb6d4('0x60')][_0xb6d4('0x67')],_0x466d80[_0xb6d4('0x66')]['id'],_0x57466e['body']?JSON['stringify'](_0x57466e[_0xb6d4('0x54')]):_0xb6d4('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x466d80);}return null;})[_0xb6d4('0x1f')](function(_0x92b9eb){var _0x2c8ad2=_0xb6d4('0x69')+_0x92b9eb[_0xb6d4('0x27')][_0xb6d4('0x6a')];return db[_0xb6d4('0x6b')][_0xb6d4('0x3e')](_0x2c8ad2,{'type':db['Sequelize'][_0xb6d4('0x6c')][_0xb6d4('0x6d')],'raw':!![]})['then'](function(_0x3fb752){return _0x3fb752;});})[_0xb6d4('0x1f')](function(_0x4898a6){if(_0x4898a6){_0x466d80[_0xb6d4('0x27')][_0xb6d4('0x6e')]=_0x4898a6[0x0];if(!_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5f')])return;return db[_0xb6d4('0x6f')][_0xb6d4('0x52')]({'where':{'id':_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x5f')],'role':_0xb6d4('0x61')},'attributes':['id',_0xb6d4('0x36'),_0xb6d4('0x70'),_0xb6d4('0x71'),_0xb6d4('0x72')],'raw':!![]});}return null;})[_0xb6d4('0x1f')](function(_0x43249a){if(!_0x43249a)return null;_0x466d80[_0xb6d4('0x27')]['agent']=_0x43249a;return _0x466d80;})['then'](function(_0x5b0a3b){if(_0x5b0a3b){if(_0x57466e[_0xb6d4('0x54')][_0xb6d4('0x73')]){_0x466d80[_0xb6d4('0x27')][_0xb6d4('0x74')]=util[_0xb6d4('0x5d')](_0xb6d4('0x75'),_0x57466e[_0xb6d4('0x60')][_0xb6d4('0x36')]);_0x466d80[_0xb6d4('0x27')]['channel']=_0x466d80['channel'];_0x466d80['message'][_0xb6d4('0x76')]=_0x466d80[_0xb6d4('0x77')];_0x466d80[_0xb6d4('0x27')][_0xb6d4('0x78')]=_0xb6d4('0x5a');return respondWithRpcPromise(_0xb6d4('0x79'),_0xb6d4('0x79'),{'event':'acceptmessage','message':_0x466d80[_0xb6d4('0x27')]},client9002)[_0xb6d4('0x1f')](function(){return _0x466d80;});}return _0x466d80;}return null;})['then'](respondWithResult(_0x58628a,null))['catch'](handleError(_0x58628a,null));};var interaction_log=require(_0xb6d4('0x58'))(_0xb6d4('0x59'));exports[_0xb6d4('0x33')]=function(_0x44de4f,_0x4ea278,_0xea4ed8){var _0x30e4dc={'agent':{},'channel':_0xb6d4('0x7a')};if(_0x44de4f[_0xb6d4('0x54')]['id']){delete _0x44de4f[_0xb6d4('0x54')]['id'];}_0x44de4f[_0xb6d4('0x54')][_0xb6d4('0x5f')]=_0x44de4f['body']['UserId']||_0x44de4f[_0xb6d4('0x60')]['id'];_0x30e4dc[_0xb6d4('0x61')]['id']=_0x44de4f[_0xb6d4('0x54')][_0xb6d4('0x5f')];return db[_0xb6d4('0x3a')][_0xb6d4('0x52')]({'where':{'id':_0x44de4f[_0xb6d4('0x56')]['id'],'UserId':null}})[_0xb6d4('0x1f')](handleEntityNotFound(_0x4ea278,null))[_0xb6d4('0x1f')](function(_0x47e108){if(_0x47e108){_0x30e4dc['message']=_0x47e108['get']({'plain':!![]});return db[_0xb6d4('0x63')][_0xb6d4('0x52')]({'where':{'id':_0x47e108[_0xb6d4('0x64')]}});}return null;})[_0xb6d4('0x1f')](handleEntityNotFound(_0x4ea278,null))['then'](function(_0x3e20a6){if(_0x3e20a6){_0x30e4dc[_0xb6d4('0x66')]=_0x3e20a6[_0xb6d4('0x62')]({'plain':!![]});interaction_log[_0xb6d4('0x20')](_0xb6d4('0x7b'),_0x44de4f['user']['id'],_0x44de4f['user'][_0xb6d4('0x36')],_0x44de4f[_0xb6d4('0x60')][_0xb6d4('0x67')],_0x30e4dc[_0xb6d4('0x66')]['id'],_0x44de4f[_0xb6d4('0x54')]?JSON['stringify'](_0x44de4f['body']):_0xb6d4('0x68'));return respondWithRpcPromise(_0xb6d4('0x7c'),_0xb6d4('0x7d'),_0x30e4dc);}return null;})[_0xb6d4('0x1f')](function(_0x3a1f88){var _0x403cfe=_0xb6d4('0x69')+_0x3a1f88[_0xb6d4('0x27')][_0xb6d4('0x6a')];return db['sequelize'][_0xb6d4('0x3e')](_0x403cfe,{'type':db[_0xb6d4('0x7e')][_0xb6d4('0x6c')]['SELECT'],'raw':!![]})[_0xb6d4('0x1f')](function(_0x28a16f){return _0x28a16f;});})[_0xb6d4('0x1f')](function(_0x149966){if(_0x149966){_0x30e4dc[_0xb6d4('0x27')][_0xb6d4('0x6e')]=_0x149966[0x0];if(!_0x44de4f[_0xb6d4('0x54')]['UserId'])return;return db[_0xb6d4('0x6f')]['find']({'where':{'id':_0x44de4f[_0xb6d4('0x54')][_0xb6d4('0x5f')],'role':'agent'},'attributes':['id','name','fullname',_0xb6d4('0x71'),_0xb6d4('0x72')],'raw':!![]});}return null;})['then'](function(_0x1d5abe){if(!_0x1d5abe)return null;_0x30e4dc[_0xb6d4('0x27')][_0xb6d4('0x61')]=_0x1d5abe;return _0x30e4dc;})['then'](function(_0x581a24){if(_0x581a24){_0x581a24[_0xb6d4('0x27')][_0xb6d4('0x74')]=util[_0xb6d4('0x5d')](_0xb6d4('0x75'),_0x44de4f[_0xb6d4('0x60')][_0xb6d4('0x36')]);_0x581a24[_0xb6d4('0x27')][_0xb6d4('0x77')]=_0x30e4dc[_0xb6d4('0x77')];_0x581a24[_0xb6d4('0x27')]['motionChannel']=_0x30e4dc[_0xb6d4('0x77')];_0x581a24[_0xb6d4('0x27')][_0xb6d4('0x78')]=_0xb6d4('0x33');respondWithRpcPromise('EventManager',_0xb6d4('0x79'),{'event':'rejectmessage','message':_0x581a24[_0xb6d4('0x27')]},client9002);return _0x30e4dc;}return null;})[_0xb6d4('0x1f')](respondWithResult(_0x4ea278,null))['catch'](handleError(_0x4ea278,null));};exports[_0xb6d4('0x31')]=function(_0x486298,_0x464b43,_0x1e16b2){if(_0x486298[_0xb6d4('0x54')]['id']){delete _0x486298['body']['id'];}var _0xc6b737;return db[_0xb6d4('0x3a')]['find']({'where':{'id':_0x486298[_0xb6d4('0x56')]['id']}})[_0xb6d4('0x1f')](handleEntityNotFound(_0x464b43,null))[_0xb6d4('0x1f')](function(_0x505424){if(_0x505424){_0xc6b737=_0x505424;return db[_0xb6d4('0x7f')][_0xb6d4('0x52')]({'where':{'id':_0x505424[_0xb6d4('0x80')]}});}})['then'](handleEntityNotFound(_0x464b43,null))[_0xb6d4('0x1f')](function(_0x11f68d){if(_0x11f68d){logger[_0xb6d4('0x23')](_0xb6d4('0x81'),_0xb6d4('0x31'),_0xb6d4('0x82'),_0x11f68d[_0xb6d4('0x4a')],util['inspect'](_0x486298['body'],{'showHidden':![],'depth':null}));switch(_0x11f68d[_0xb6d4('0x4a')]){case'twilio':if(_0x486298[_0xb6d4('0x54')]['MessageSid']&&_0x486298[_0xb6d4('0x54')][_0xb6d4('0x83')]===_0xc6b737[_0xb6d4('0x84')]){return _0xc6b737[_0xb6d4('0x55')]({'read':!![]});}else{logger[_0xb6d4('0x25')](_0xb6d4('0x85'),_0xb6d4('0x31'),_0xb6d4('0x86'),util['inspect'](_0x486298[_0xb6d4('0x54')],{'showHidden':![],'depth':null}));}break;case _0xb6d4('0x87'):if(_0x486298[_0xb6d4('0x54')][_0xb6d4('0x88')]&&_0x486298[_0xb6d4('0x54')][_0xb6d4('0x88')]===_0xc6b737[_0xb6d4('0x84')]&&_[_0xb6d4('0x89')]([_0xb6d4('0x8a'),'delivered'],_0x486298[_0xb6d4('0x54')][_0xb6d4('0x8b')])>=0x0){return _0xc6b737['update']({'read':!![]});}else{logger['error'](_0xb6d4('0x85'),_0xb6d4('0x31'),_0xb6d4('0x8c'),util[_0xb6d4('0x8d')](_0x486298[_0xb6d4('0x54')],{'showHidden':![],'depth':null}));}break;case _0xb6d4('0x8e'):var _0x57852a=_0x486298[_0xb6d4('0x54')]['results'][0x0];if(_0x57852a[_0xb6d4('0x31')][_0xb6d4('0x8f')]===_0xb6d4('0x90')){return _0xc6b737[_0xb6d4('0x55')]({'read':!![]});}else{logger[_0xb6d4('0x25')](_0xb6d4('0x85'),_0xb6d4('0x31'),_0xb6d4('0x8e'),util[_0xb6d4('0x8d')](_0x486298[_0xb6d4('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xc6b737;}})[_0xb6d4('0x1f')](respondWithResult(_0x464b43,null))['catch'](handleError(_0x464b43,null));}; \ No newline at end of file +var _0xf194=['key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','create','body','find','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../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','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type'];(function(_0x42c7b1,_0x41c915){var _0x1de606=function(_0x6ba1ab){while(--_0x6ba1ab){_0x42c7b1['push'](_0x42c7b1['shift']());}};_0x1de606(++_0x41c915);}(_0xf194,0x19b));var _0x4f19=function(_0x2076c5,_0x59c713){_0x2076c5=_0x2076c5-0x0;var _0x2c4d83=_0xf194[_0x2076c5];return _0x2c4d83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f19('0x0'));var zipdir=require(_0x4f19('0x1'));var jsonpatch=require(_0x4f19('0x2'));var rp=require(_0x4f19('0x3'));var moment=require(_0x4f19('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f19('0x5'));var util=require(_0x4f19('0x6'));var path=require('path');var sox=require(_0x4f19('0x7'));var csv=require(_0x4f19('0x8'));var ejs=require(_0x4f19('0x9'));var fs=require('fs');var fs_extra=require(_0x4f19('0xa'));var _=require(_0x4f19('0xb'));var squel=require(_0x4f19('0xc'));var crypto=require(_0x4f19('0xd'));var jsforce=require(_0x4f19('0xe'));var deskjs=require(_0x4f19('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f19('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f19('0x11'));var qs=require(_0x4f19('0x12'));var as=require(_0x4f19('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f19('0x14'));var utils=require(_0x4f19('0x15'));var config=require(_0x4f19('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f19('0x17'))['db'];config[_0x4f19('0x18')]=_[_0x4f19('0x19')](config['redis'],{'host':_0x4f19('0x1a'),'port':0x18eb});var socket=require(_0x4f19('0x1b'))(new Redis(config[_0x4f19('0x18')]));require('./smsMessage.socket')[_0x4f19('0x1c')](socket);var jayson=require(_0x4f19('0x1d'));var client=jayson[_0x4f19('0x1e')][_0x4f19('0x1f')]({'port':0x232c});var client9002=jayson[_0x4f19('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d9b78,_0x4a4acf,_0x5cd9c1,_0xe6d3c1){return new BPromise(function(_0x289e85,_0x27b3ff){var _0x565255=_0xe6d3c1||client;return _0x565255[_0x4f19('0x20')](_0x4d9b78,_0x5cd9c1)[_0x4f19('0x21')](function(_0x11d1b1){logger[_0x4f19('0x22')](_0x4f19('0x23'),_0x4a4acf,_0x4f19('0x24'));logger[_0x4f19('0x25')](_0x4f19('0x26'),_0x4a4acf,_0x4f19('0x24'),JSON[_0x4f19('0x27')](_0x11d1b1));if(_0x11d1b1[_0x4f19('0x28')]){if(_0x11d1b1[_0x4f19('0x28')][_0x4f19('0x29')]===0x1f4){logger['error'](_0x4f19('0x23'),_0x4a4acf,_0x11d1b1[_0x4f19('0x28')][_0x4f19('0x2a')]);return _0x27b3ff(_0x11d1b1[_0x4f19('0x28')][_0x4f19('0x2a')]);}logger['error'](_0x4f19('0x23'),_0x4a4acf,_0x11d1b1[_0x4f19('0x28')][_0x4f19('0x2a')]);return _0x289e85(_0x11d1b1[_0x4f19('0x28')][_0x4f19('0x2a')]);}else{logger[_0x4f19('0x22')]('SmsMessage,\x20%s,\x20%s',_0x4a4acf,'request\x20sent');_0x289e85(_0x11d1b1[_0x4f19('0x2b')][_0x4f19('0x2a')]);}})[_0x4f19('0x2c')](function(_0x34c4d5){logger[_0x4f19('0x28')](_0x4f19('0x23'),_0x4a4acf,_0x34c4d5);_0x27b3ff(_0x34c4d5);});});}function respondWithStatusCode(_0xb4de7f,_0x2a54b1){_0x2a54b1=_0x2a54b1||0xcc;return function(_0x57fafa){if(_0x57fafa){return _0xb4de7f[_0x4f19('0x2d')](_0x2a54b1);}return _0xb4de7f[_0x4f19('0x2e')](_0x2a54b1)[_0x4f19('0x2f')]();};}function respondWithResult(_0x44c9e8,_0x4b72e9){_0x4b72e9=_0x4b72e9||0xc8;return function(_0x5904c3){if(_0x5904c3){return _0x44c9e8['status'](_0x4b72e9)[_0x4f19('0x30')](_0x5904c3);}};}function respondWithFilteredResult(_0x1a108d,_0x55163d){return function(_0x5c7d1d){if(_0x5c7d1d){var _0x19c709=typeof _0x55163d[_0x4f19('0x31')]===_0x4f19('0x32')&&typeof _0x55163d[_0x4f19('0x33')]==='undefined';var _0x2a47b3=_0x5c7d1d[_0x4f19('0x34')];var _0x559092=_0x19c709?0x0:_0x55163d[_0x4f19('0x31')];var _0x4ec623=_0x19c709?_0x5c7d1d[_0x4f19('0x34')]:_0x55163d[_0x4f19('0x31')]+_0x55163d['limit'];var _0x277f34;if(_0x4ec623>=_0x2a47b3){_0x4ec623=_0x2a47b3;_0x277f34=0xc8;}else{_0x277f34=0xce;}_0x1a108d[_0x4f19('0x2e')](_0x277f34);return _0x1a108d['set'](_0x4f19('0x35'),_0x559092+'-'+_0x4ec623+'/'+_0x2a47b3)[_0x4f19('0x30')](_0x5c7d1d);}return null;};}function patchUpdates(_0x5e8bb1){return function(_0x38de3a){try{jsonpatch[_0x4f19('0x36')](_0x38de3a,_0x5e8bb1,!![]);}catch(_0x280aa1){return BPromise['reject'](_0x280aa1);}return _0x38de3a[_0x4f19('0x37')]();};}function saveUpdates(_0x1bcf05,_0x35cbe9){return function(_0x3ea7f7){if(_0x3ea7f7){return _0x3ea7f7[_0x4f19('0x38')](_0x1bcf05)[_0x4f19('0x21')](function(_0x29e12d){return _0x29e12d;});}return null;};}function removeEntity(_0x597882,_0x53a2c4){return function(_0x5755a1){if(_0x5755a1){return _0x5755a1[_0x4f19('0x39')]()['then'](function(){_0x597882[_0x4f19('0x2e')](0xcc)[_0x4f19('0x2f')]();});}};}function handleEntityNotFound(_0x2afd83,_0x37ef97){return function(_0x126a33){if(!_0x126a33){_0x2afd83[_0x4f19('0x2d')](0x194);}return _0x126a33;};}function handleError(_0x5d0c28,_0x251793){_0x251793=_0x251793||0x1f4;return function(_0x10e246){logger['error'](_0x10e246[_0x4f19('0x3a')]);if(_0x10e246[_0x4f19('0x3b')]){delete _0x10e246[_0x4f19('0x3b')];}_0x5d0c28['status'](_0x251793)[_0x4f19('0x3c')](_0x10e246);};}exports[_0x4f19('0x3d')]=function(_0x512d48,_0x445ce5){var _0x71a742={},_0x1a888e={},_0x1f89ad={'count':0x0,'rows':[]};var _0xff9f1=_['map'](db[_0x4f19('0x3e')][_0x4f19('0x3f')],function(_0x4b13df){return{'name':_0x4b13df[_0x4f19('0x40')],'type':_0x4b13df[_0x4f19('0x41')][_0x4f19('0x42')]};});_0x1a888e[_0x4f19('0x43')]=_['map'](_0xff9f1,'name');_0x1a888e[_0x4f19('0x44')]=_[_0x4f19('0x45')](_0x512d48['query']);_0x1a888e[_0x4f19('0x46')]=_['intersection'](_0x1a888e['model'],_0x1a888e['query']);_0x71a742[_0x4f19('0x47')]=_[_0x4f19('0x48')](_0x1a888e[_0x4f19('0x43')],qs[_0x4f19('0x49')](_0x512d48[_0x4f19('0x44')][_0x4f19('0x49')]));_0x71a742[_0x4f19('0x47')]=_0x71a742[_0x4f19('0x47')][_0x4f19('0x4a')]?_0x71a742['attributes']:_0x1a888e[_0x4f19('0x43')];if(!_0x512d48[_0x4f19('0x44')][_0x4f19('0x4b')](_0x4f19('0x4c'))){_0x71a742[_0x4f19('0x33')]=qs[_0x4f19('0x33')](_0x512d48[_0x4f19('0x44')][_0x4f19('0x33')]);_0x71a742['offset']=qs[_0x4f19('0x31')](_0x512d48[_0x4f19('0x44')][_0x4f19('0x31')]);}_0x71a742[_0x4f19('0x4d')]=qs[_0x4f19('0x4e')](_0x512d48[_0x4f19('0x44')][_0x4f19('0x4e')]);_0x71a742['where']=qs[_0x4f19('0x46')](_[_0x4f19('0x4f')](_0x512d48[_0x4f19('0x44')],_0x1a888e['filters']),_0xff9f1);if(_0x512d48['query'][_0x4f19('0x50')]){_0x71a742[_0x4f19('0x51')]=_[_0x4f19('0x52')](_0x71a742['where'],{'$or':_[_0x4f19('0x53')](_0xff9f1,function(_0x2fe347){if(_0x2fe347[_0x4f19('0x41')]!==_0x4f19('0x54')){var _0x2bb685={};_0x2bb685[_0x2fe347[_0x4f19('0x3b')]]={'$like':'%'+_0x512d48[_0x4f19('0x44')]['filter']+'%'};return _0x2bb685;}})});}_0x71a742=_[_0x4f19('0x52')]({},_0x71a742,_0x512d48[_0x4f19('0x55')]);var _0x3bbf27={'where':_0x71a742[_0x4f19('0x51')]};return db[_0x4f19('0x3e')][_0x4f19('0x34')](_0x3bbf27)[_0x4f19('0x21')](function(_0x1bb863){_0x1f89ad['count']=_0x1bb863;if(_0x512d48[_0x4f19('0x44')][_0x4f19('0x56')]){_0x71a742['include']=[{'all':!![]}];}return db['SmsMessage'][_0x4f19('0x57')](_0x71a742);})['then'](function(_0x37c57d){_0x1f89ad[_0x4f19('0x58')]=_0x37c57d;return _0x1f89ad;})[_0x4f19('0x21')](respondWithFilteredResult(_0x445ce5,_0x71a742))['catch'](handleError(_0x445ce5,null));};exports[_0x4f19('0x59')]=function(_0x557ada,_0xf08a30){var _0x571e4a={'raw':!![],'where':{'id':_0x557ada[_0x4f19('0x5a')]['id']}},_0x596e03={};_0x596e03[_0x4f19('0x43')]=_[_0x4f19('0x45')](db['SmsMessage']['rawAttributes']);_0x596e03[_0x4f19('0x44')]=_[_0x4f19('0x45')](_0x557ada[_0x4f19('0x44')]);_0x596e03['filters']=_[_0x4f19('0x48')](_0x596e03[_0x4f19('0x43')],_0x596e03[_0x4f19('0x44')]);_0x571e4a[_0x4f19('0x47')]=_['intersection'](_0x596e03[_0x4f19('0x43')],qs[_0x4f19('0x49')](_0x557ada[_0x4f19('0x44')][_0x4f19('0x49')]));_0x571e4a[_0x4f19('0x47')]=_0x571e4a[_0x4f19('0x47')][_0x4f19('0x4a')]?_0x571e4a[_0x4f19('0x47')]:_0x596e03[_0x4f19('0x43')];if(_0x557ada['query'][_0x4f19('0x56')]){_0x571e4a['include']=[{'all':!![]}];}_0x571e4a=_[_0x4f19('0x52')]({},_0x571e4a,_0x557ada[_0x4f19('0x55')]);return db['SmsMessage']['find'](_0x571e4a)[_0x4f19('0x21')](handleEntityNotFound(_0xf08a30,null))[_0x4f19('0x21')](respondWithResult(_0xf08a30,null))[_0x4f19('0x2c')](handleError(_0xf08a30,null));};exports[_0x4f19('0x5b')]=function(_0x23be7f,_0x214fa1){return db['SmsMessage'][_0x4f19('0x5b')](_0x23be7f['body'],{})['then'](respondWithResult(_0x214fa1,0xc9))[_0x4f19('0x2c')](handleError(_0x214fa1,null));};exports[_0x4f19('0x38')]=function(_0x5539ba,_0x122ecd){if(_0x5539ba[_0x4f19('0x5c')]['id']){delete _0x5539ba[_0x4f19('0x5c')]['id'];}return db[_0x4f19('0x3e')][_0x4f19('0x5d')]({'where':{'id':_0x5539ba[_0x4f19('0x5a')]['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x122ecd,null))['then'](saveUpdates(_0x5539ba[_0x4f19('0x5c')],null))['then'](respondWithResult(_0x122ecd,null))[_0x4f19('0x2c')](handleError(_0x122ecd,null));};exports['destroy']=function(_0x313fef,_0x141bdd){return db['SmsMessage']['find']({'where':{'id':_0x313fef[_0x4f19('0x5a')]['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x141bdd,null))[_0x4f19('0x21')](removeEntity(_0x141bdd,null))['catch'](handleError(_0x141bdd,null));};exports['describe']=function(_0x32aeed,_0x17381c){return db[_0x4f19('0x3e')][_0x4f19('0x5e')]()['then'](respondWithResult(_0x17381c,null))[_0x4f19('0x2c')](handleError(_0x17381c,null));};var interaction_log=require(_0x4f19('0x5f'))(_0x4f19('0x60'));exports[_0x4f19('0x61')]=function(_0x18c63a,_0x5a0de7,_0x2b3165){var _0x1d0fc3={'agent':{},'channel':_0x4f19('0x62')};if(_0x18c63a[_0x4f19('0x5c')]['id']){delete _0x18c63a[_0x4f19('0x5c')]['id'];}_0x18c63a[_0x4f19('0x5c')][_0x4f19('0x63')]=!![];_0x18c63a[_0x4f19('0x5c')][_0x4f19('0x64')]=moment()['format'](_0x4f19('0x65'));_0x18c63a[_0x4f19('0x5c')][_0x4f19('0x66')]=_0x18c63a[_0x4f19('0x5c')]['UserId']||_0x18c63a[_0x4f19('0x67')]['id'];_0x1d0fc3[_0x4f19('0x68')]['id']=_0x18c63a[_0x4f19('0x5c')][_0x4f19('0x66')];return db[_0x4f19('0x3e')][_0x4f19('0x5d')]({'where':{'id':_0x18c63a['params']['id'],'UserId':null}})[_0x4f19('0x21')](handleEntityNotFound(_0x5a0de7,null))[_0x4f19('0x21')](saveUpdates(_0x18c63a[_0x4f19('0x5c')],null))['then'](function(_0x4de3eb){if(_0x4de3eb){_0x1d0fc3[_0x4f19('0x2a')]=_0x4de3eb[_0x4f19('0x69')]({'plain':!![]});return db[_0x4f19('0x6a')][_0x4f19('0x5d')]({'where':{'id':_0x4de3eb[_0x4f19('0x6b')]}});}return null;})[_0x4f19('0x21')](handleEntityNotFound(_0x5a0de7,null))[_0x4f19('0x21')](function(_0x125efe){if(_0x125efe){return _0x125efe[_0x4f19('0x38')]({'UserId':_0x18c63a['body']['UserId'],'read1stAt':_[_0x4f19('0x6c')](_0x125efe[_0x4f19('0x6d')])?moment()[_0x4f19('0x6e')](_0x4f19('0x65')):undefined});}return null;})[_0x4f19('0x21')](function(_0x5d6fa9){if(_0x5d6fa9){_0x1d0fc3[_0x4f19('0x6f')]=_0x5d6fa9[_0x4f19('0x69')]({'plain':!![]});interaction_log['info'](_0x4f19('0x70'),_0x18c63a['user']['id'],_0x18c63a[_0x4f19('0x67')][_0x4f19('0x3b')],_0x18c63a[_0x4f19('0x67')][_0x4f19('0x71')],_0x1d0fc3[_0x4f19('0x6f')]['id'],_0x18c63a['body']?JSON[_0x4f19('0x27')](_0x18c63a[_0x4f19('0x5c')]):'null');return respondWithRpcPromise(_0x4f19('0x72'),_0x4f19('0x73'),_0x1d0fc3);}return null;})[_0x4f19('0x21')](function(_0xe563){var _0x212a00='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe563[_0x4f19('0x2a')][_0x4f19('0x74')];return db[_0x4f19('0x75')][_0x4f19('0x44')](_0x212a00,{'type':db[_0x4f19('0x76')]['QueryTypes'][_0x4f19('0x77')],'raw':!![]})[_0x4f19('0x21')](function(_0x59ce72){return _0x59ce72;});})[_0x4f19('0x21')](function(_0x2d464c){if(_0x2d464c){_0x1d0fc3[_0x4f19('0x2a')][_0x4f19('0x78')]=_0x2d464c[0x0];if(!_0x18c63a[_0x4f19('0x5c')][_0x4f19('0x66')])return;return db[_0x4f19('0x79')][_0x4f19('0x5d')]({'where':{'id':_0x18c63a['body'][_0x4f19('0x66')],'role':_0x4f19('0x68')},'attributes':['id',_0x4f19('0x3b'),_0x4f19('0x7a'),_0x4f19('0x7b'),_0x4f19('0x7c')],'raw':!![]});}return null;})[_0x4f19('0x21')](function(_0x9c943c){if(!_0x9c943c)return null;_0x1d0fc3[_0x4f19('0x2a')][_0x4f19('0x68')]=_0x9c943c;return _0x1d0fc3;})[_0x4f19('0x21')](function(_0x29b295){if(_0x29b295){if(_0x18c63a['body'][_0x4f19('0x7d')]){_0x1d0fc3[_0x4f19('0x2a')]['interface']=util[_0x4f19('0x6e')](_0x4f19('0x7e'),_0x18c63a[_0x4f19('0x67')][_0x4f19('0x3b')]);_0x1d0fc3['message']['channel']=_0x1d0fc3[_0x4f19('0x7f')];_0x1d0fc3['message'][_0x4f19('0x80')]=_0x1d0fc3[_0x4f19('0x7f')];_0x1d0fc3[_0x4f19('0x2a')][_0x4f19('0x81')]=_0x4f19('0x61');return respondWithRpcPromise(_0x4f19('0x82'),_0x4f19('0x82'),{'event':_0x4f19('0x83'),'message':_0x1d0fc3[_0x4f19('0x2a')]},client9002)['then'](function(){return _0x1d0fc3;});}return _0x1d0fc3;}return null;})[_0x4f19('0x21')](respondWithResult(_0x5a0de7,null))[_0x4f19('0x2c')](handleError(_0x5a0de7,null));};var interaction_log=require(_0x4f19('0x5f'))(_0x4f19('0x60'));exports[_0x4f19('0x84')]=function(_0x47af0c,_0x3dcdfa,_0x1cbaea){var _0x6cff12={'agent':{},'channel':_0x4f19('0x62')};if(_0x47af0c[_0x4f19('0x5c')]['id']){delete _0x47af0c[_0x4f19('0x5c')]['id'];}_0x47af0c['body'][_0x4f19('0x66')]=_0x47af0c['body']['UserId']||_0x47af0c[_0x4f19('0x67')]['id'];_0x6cff12[_0x4f19('0x68')]['id']=_0x47af0c[_0x4f19('0x5c')][_0x4f19('0x66')];return db[_0x4f19('0x3e')][_0x4f19('0x5d')]({'where':{'id':_0x47af0c['params']['id'],'UserId':null}})[_0x4f19('0x21')](handleEntityNotFound(_0x3dcdfa,null))[_0x4f19('0x21')](function(_0x2e3f44){if(_0x2e3f44){_0x6cff12['message']=_0x2e3f44['get']({'plain':!![]});return db['SmsInteraction'][_0x4f19('0x5d')]({'where':{'id':_0x2e3f44[_0x4f19('0x6b')]}});}return null;})[_0x4f19('0x21')](handleEntityNotFound(_0x3dcdfa,null))[_0x4f19('0x21')](function(_0x7b2c24){if(_0x7b2c24){_0x6cff12[_0x4f19('0x6f')]=_0x7b2c24[_0x4f19('0x69')]({'plain':!![]});interaction_log[_0x4f19('0x22')](_0x4f19('0x85'),_0x47af0c[_0x4f19('0x67')]['id'],_0x47af0c[_0x4f19('0x67')][_0x4f19('0x3b')],_0x47af0c[_0x4f19('0x67')][_0x4f19('0x71')],_0x6cff12['interaction']['id'],_0x47af0c[_0x4f19('0x5c')]?JSON['stringify'](_0x47af0c[_0x4f19('0x5c')]):_0x4f19('0x86'));return respondWithRpcPromise(_0x4f19('0x87'),_0x4f19('0x88'),_0x6cff12);}return null;})['then'](function(_0x1d6d5a){var _0x305336=_0x4f19('0x89')+_0x1d6d5a[_0x4f19('0x2a')][_0x4f19('0x74')];return db[_0x4f19('0x75')][_0x4f19('0x44')](_0x305336,{'type':db[_0x4f19('0x76')][_0x4f19('0x8a')][_0x4f19('0x77')],'raw':!![]})[_0x4f19('0x21')](function(_0x2aff90){return _0x2aff90;});})[_0x4f19('0x21')](function(_0x207e1e){if(_0x207e1e){_0x6cff12['message'][_0x4f19('0x78')]=_0x207e1e[0x0];if(!_0x47af0c[_0x4f19('0x5c')][_0x4f19('0x66')])return;return db[_0x4f19('0x79')][_0x4f19('0x5d')]({'where':{'id':_0x47af0c[_0x4f19('0x5c')][_0x4f19('0x66')],'role':_0x4f19('0x68')},'attributes':['id',_0x4f19('0x3b'),'fullname',_0x4f19('0x7b'),_0x4f19('0x7c')],'raw':!![]});}return null;})[_0x4f19('0x21')](function(_0x4e39c9){if(!_0x4e39c9)return null;_0x6cff12['message']['agent']=_0x4e39c9;return _0x6cff12;})[_0x4f19('0x21')](function(_0x2b6c06){if(_0x2b6c06){_0x2b6c06[_0x4f19('0x2a')][_0x4f19('0x8b')]=util[_0x4f19('0x6e')](_0x4f19('0x7e'),_0x47af0c[_0x4f19('0x67')][_0x4f19('0x3b')]);_0x2b6c06['message'][_0x4f19('0x7f')]=_0x6cff12['channel'];_0x2b6c06[_0x4f19('0x2a')]['motionChannel']=_0x6cff12['channel'];_0x2b6c06['message'][_0x4f19('0x81')]=_0x4f19('0x84');respondWithRpcPromise(_0x4f19('0x82'),_0x4f19('0x82'),{'event':_0x4f19('0x8c'),'message':_0x2b6c06['message']},client9002);return _0x6cff12;}return null;})[_0x4f19('0x21')](respondWithResult(_0x3dcdfa,null))['catch'](handleError(_0x3dcdfa,null));};exports[_0x4f19('0x2e')]=function(_0xe32b6,_0x37839a,_0x38b742){if(_0xe32b6['body']['id']){delete _0xe32b6['body']['id'];}var _0x3036a4;return db['SmsMessage'][_0x4f19('0x5d')]({'where':{'id':_0xe32b6['params']['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x37839a,null))[_0x4f19('0x21')](function(_0x1e0b1a){if(_0x1e0b1a){_0x3036a4=_0x1e0b1a;return db[_0x4f19('0x8d')][_0x4f19('0x5d')]({'where':{'id':_0x1e0b1a[_0x4f19('0x8e')]}});}})[_0x4f19('0x21')](handleEntityNotFound(_0x37839a,null))[_0x4f19('0x21')](function(_0x43ae2e){if(_0x43ae2e){logger[_0x4f19('0x25')](_0x4f19('0x26'),_0x4f19('0x2e'),_0x4f19('0x8f'),_0x43ae2e[_0x4f19('0x41')],util[_0x4f19('0x90')](_0xe32b6[_0x4f19('0x5c')],{'showHidden':![],'depth':null}));switch(_0x43ae2e[_0x4f19('0x41')]){case _0x4f19('0x91'):if(_0xe32b6['body'][_0x4f19('0x92')]&&_0xe32b6[_0x4f19('0x5c')][_0x4f19('0x92')]===_0x3036a4[_0x4f19('0x93')]){return _0x3036a4[_0x4f19('0x38')]({'read':!![]});}else{logger[_0x4f19('0x28')](_0x4f19('0x94'),_0x4f19('0x2e'),'twilio',util[_0x4f19('0x90')](_0xe32b6[_0x4f19('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4f19('0x95'):if(_0xe32b6[_0x4f19('0x5c')]['MessageUUID']&&_0xe32b6[_0x4f19('0x5c')][_0x4f19('0x96')]===_0x3036a4[_0x4f19('0x93')]&&_[_0x4f19('0x97')]([_0x4f19('0x98'),_0x4f19('0x99')],_0xe32b6[_0x4f19('0x5c')][_0x4f19('0x9a')])>=0x0){return _0x3036a4[_0x4f19('0x38')]({'read':!![]});}else{logger[_0x4f19('0x28')](_0x4f19('0x94'),'status',_0x4f19('0x9b'),util[_0x4f19('0x90')](_0xe32b6[_0x4f19('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4f19('0x9c'):var _0x479cae=_0xe32b6['body']['results'][0x0];if(_0x479cae[_0x4f19('0x2e')][_0x4f19('0x9d')]===_0x4f19('0x9e')){return _0x3036a4[_0x4f19('0x38')]({'read':!![]});}else{logger[_0x4f19('0x28')](_0x4f19('0x94'),_0x4f19('0x2e'),_0x4f19('0x9c'),util['inspect'](_0xe32b6['body'],{'showHidden':![],'depth':null}));}break;}return _0x3036a4;}})[_0x4f19('0x21')](respondWithResult(_0x37839a,null))[_0x4f19('0x2c')](handleError(_0x37839a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f4c4628..0ab5ff4 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 _0x61ce=['exports','events','../../mysqldb','SmsMessage','save','update','emit','hasOwnProperty'];(function(_0xc775ea,_0x5e5895){var _0x5b5e4b=function(_0x4992b7){while(--_0x4992b7){_0xc775ea['push'](_0xc775ea['shift']());}};_0x5b5e4b(++_0x5e5895);}(_0x61ce,0x139));var _0xe61c=function(_0x45472b,_0x56787b){_0x45472b=_0x45472b-0x0;var _0x446d60=_0x61ce[_0x45472b];return _0x446d60;};'use strict';var EventEmitter=require(_0xe61c('0x0'));var SmsMessage=require(_0xe61c('0x1'))['db'][_0xe61c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe61c('0x3'),'afterUpdate':_0xe61c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3df62e){return function(_0x19db23,_0x1c7d8b,_0x1ae3a9){SmsMessageEvents['emit'](_0x3df62e+':'+_0x19db23['id'],_0x19db23);SmsMessageEvents[_0xe61c('0x5')](_0x3df62e,_0x19db23);_0x1ae3a9(null);};}for(var e in events){if(events[_0xe61c('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xe61c('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x69ce=['update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x3ac7e4,_0x50137c){var _0x22228a=function(_0x3056fa){while(--_0x3056fa){_0x3ac7e4['push'](_0x3ac7e4['shift']());}};_0x22228a(++_0x50137c);}(_0x69ce,0x175));var _0xe69c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x69ce[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0xe69c('0x0'));var SmsMessage=require(_0xe69c('0x1'))['db'][_0xe69c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe69c('0x3')](0x0);var events={'afterCreate':_0xe69c('0x4'),'afterUpdate':_0xe69c('0x5'),'afterDestroy':_0xe69c('0x6')};function emitEvent(_0x3f9daf){return function(_0x501ab5,_0x1b7a42,_0x1d3d9d){SmsMessageEvents[_0xe69c('0x7')](_0x3f9daf+':'+_0x501ab5['id'],_0x501ab5);SmsMessageEvents[_0xe69c('0x7')](_0x3f9daf,_0x501ab5);_0x1d3d9d(null);};}for(var e in events){if(events[_0xe69c('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4c9fcb6..5571b91 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 _0x5748=['createdAt','catch','error','out','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','body','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','format','toString','http_code','queued_count','data','message_id','clickSend','plivo','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','messages','Missing\x20parameters:\x20base_url','csc','login','sender','text','timestamp','keys','sort','apiKey','createHash','md5','digest','signature=','clickatell','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','messageId','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','update'];(function(_0xa3d82,_0x54661c){var _0x51f541=function(_0x1c15f9){while(--_0x1c15f9){_0xa3d82['push'](_0xa3d82['shift']());}};_0x51f541(++_0x54661c);}(_0x5748,0x15a));var _0x8574=function(_0x5d1282,_0x20d88c){_0x5d1282=_0x5d1282-0x0;var _0x46266c=_0x5748[_0x5d1282];return _0x46266c;};'use strict';var _=require(_0x8574('0x0'));var util=require('util');var logger=require(_0x8574('0x1'))('api');var moment=require(_0x8574('0x2'));var BPromise=require('bluebird');var rp=require(_0x8574('0x3'));var fs=require('fs');var path=require(_0x8574('0x4'));var rimraf=require(_0x8574('0x5'));var config=require('../../config/environment');var attributes=require(_0x8574('0x6'));module[_0x8574('0x7')]=function(_0x907433,_0x203843){return _0x907433[_0x8574('0x8')](_0x8574('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x8574('0xa'),'fields':[_0x8574('0xa')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x8574('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2699e0,_0x3a352c,_0x50ecc2){var _0x34e50c=_0x907433['models'];var _0x47acf1=_0x2699e0[_0x8574('0xc')]({'plain':!![]});if(_0x47acf1[_0x8574('0xd')][_0x8574('0xe')]()==='in'||_0x47acf1['direction'][_0x8574('0xe')]()==='out'&&!_0x47acf1[_0x8574('0xf')]&&!_[_0x8574('0x10')](_0x47acf1[_0x8574('0x11')])&&!_[_0x8574('0x10')](_0x47acf1[_0x8574('0x12')])){_0x34e50c['SmsInteraction']['findOne']({'where':{'id':_0x47acf1['SmsInteractionId']}})['then'](function(_0x51e5de){if(_0x51e5de){_0x51e5de[_0x8574('0x13')]({'lastMsgAt':_0x47acf1[_0x8574('0x14')],'lastMsgDirection':_0x47acf1['direction'][_0x8574('0xe')]()});}})[_0x8574('0x15')](function(_0x3fd896){console[_0x8574('0x16')](_0x3fd896);});}if(_0x47acf1['direction']===_0x8574('0x17')&&!_0x47acf1['secret']){var _0x1fe175;_0x34e50c[_0x8574('0x18')][_0x8574('0x19')]({'where':{'id':_0x47acf1[_0x8574('0x1a')]},'raw':!![]})[_0x8574('0x1b')](function(_0x2e4800){_0x1fe175=_0x2e4800;if(_0x1fe175&&_0x1fe175['type']){switch(_0x1fe175[_0x8574('0x1c')]){case _0x8574('0x1d'):var _0x1162f2=require('twilio');if(_0x1fe175[_0x8574('0x1e')]&&_0x1fe175[_0x8574('0x1f')]&&_0x1fe175[_0x8574('0x20')]){var _0xd7cb72=new _0x1162f2(_0x1fe175[_0x8574('0x1e')],_0x1fe175[_0x8574('0x1f')]);_0xd7cb72['messages']['create']({'body':_0x47acf1[_0x8574('0x21')],'to':_0x47acf1['phone'],'from':_0x1fe175[_0x8574('0x20')],'statusCallback':_0x1fe175[_0x8574('0x22')]+'/api/sms/messages/'+_0x47acf1['id']+'/status?token='+_0x1fe175[_0x8574('0x23')]})[_0x8574('0x1b')](function(_0x549cf8){if(_0x549cf8['sid']){return _0x2699e0['update']({'messageId':_0x549cf8[_0x8574('0x24')]});}})[_0x8574('0x15')](function(_0x2730ac){logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),'twilio',util[_0x8574('0x27')](_0x2730ac,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x254c3f=_0x8574('0x28');if(_0x1fe175[_0x8574('0x29')]&&_0x1fe175[_0x8574('0x2a')]){var _0x2e4cf6={'recipient':[_0x47acf1['phone']],'message':_0x47acf1[_0x8574('0x21')],'message_type':_0x1fe175['smsMethod']};if(_0x1fe175[_0x8574('0x2b')]&&_0x1fe175['smsMethod']!=='SI'){_0x2e4cf6['sender']=_0x1fe175['phone'];}var _0x2a6734={'url':_0x254c3f+_0x8574('0x2c')+_0x1fe175[_0x8574('0x29')]+_0x8574('0x2d')+_0x1fe175['password'],'method':_0x8574('0x2e')};rp(_0x2a6734)[_0x8574('0x1b')](function(_0x28ea0f){var _0x367e57=_0x28ea0f[_0x8574('0x2f')](';');var _0x21226a={'user_key':_0x367e57[0x0],'session_key':_0x367e57[0x1]};_0x2a6734={'url':_0x254c3f+_0x8574('0x30'),'method':_0x8574('0x31'),'headers':{'user_key':_0x21226a['user_key'],'Session_key':_0x21226a[_0x8574('0x32')]},'json':!![],'body':_0x2e4cf6};return rp(_0x2a6734);})[_0x8574('0x1b')](function(_0x501125){if(_0x501125[_0x8574('0x33')]>=0x1){var _0x11febf={'messageId':_0x501125[_0x8574('0x34')]};if(_0x1fe175[_0x8574('0x2b')]!=='GP'||!_0x1fe175[_0x8574('0x35')]){_0x11febf[_0x8574('0x36')]=!![];}return _0x2699e0[_0x8574('0x13')](_0x11febf);}else{return logger['error'](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x37'),util['inspect'](_0x501125,{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x30d3f7){return logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x37'),util[_0x8574('0x27')](_0x30d3f7,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8574('0x37'),_0x8574('0x38'));}break;case _0x8574('0x39'):if(_0x1fe175[_0x8574('0x1f')]){var _0x367aad={'recipient':_0x47acf1[_0x8574('0x20')],'message':_0x47acf1[_0x8574('0x21')],'sender':_0x1fe175[_0x8574('0x3a')]||_0x1fe175[_0x8574('0x20')],'authorization':_0x1fe175[_0x8574('0x1f')]};var _0x3a352c={'method':_0x8574('0x31'),'uri':_0x8574('0x3b'),'body':_0x367aad,'json':!![]};rp(_0x3a352c)[_0x8574('0x1b')](function(_0x43a2be){var _0x509877={'messageId':_0x43a2be[_0x8574('0x3c')]};if(!_0x1fe175[_0x8574('0x35')]){_0x509877['read']=!![];}return _0x2699e0['update'](_0x509877);})[_0x8574('0x15')](function(_0x3574d1){logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate','connectel',util['inspect'](_0x3574d1,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),'connectel',_0x8574('0x3d'));}break;case _0x8574('0x3e'):if(_0x1fe175[_0x8574('0x29')]&&_0x1fe175[_0x8574('0x2a')]){var _0x367aad={'messages':[{'source':_0x8574('0x3f'),'to':_0x47acf1[_0x8574('0x20')],'body':_0x47acf1[_0x8574('0x21')],'from':_0x1fe175[_0x8574('0x3a')]||_0x1fe175[_0x8574('0x20')]}]};var _0x369ad7=util['format']('%s:%s',_0x1fe175['username'],_0x1fe175['password']);var _0x3a352c={'method':_0x8574('0x31'),'uri':_0x8574('0x40'),'body':_0x367aad,'headers':{'Authorization':util[_0x8574('0x41')]('Basic\x20%s',new Buffer(_0x369ad7)[_0x8574('0x42')]('base64'))},'json':!![]};rp(_0x3a352c)[_0x8574('0x1b')](function(_0x49cf6e){if(_0x49cf6e['http_code']>=0xc8&&_0x49cf6e[_0x8574('0x43')]<=0xce){if(_0x49cf6e['data']&&_0x49cf6e['data'][_0x8574('0x44')]>0x0){var _0x2b708e=_['head'](_0x49cf6e[_0x8574('0x45')]['messages']);var _0x13c295={'messageId':_0x2b708e[_0x8574('0x46')]};if(!_0x1fe175['deliveryReport']){_0x13c295[_0x8574('0x36')]=!![];}return _0x2699e0[_0x8574('0x13')](_0x13c295);}else{logger['error'](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x47'),util[_0x8574('0x27')](_0x49cf6e,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x47'),util[_0x8574('0x27')](_0x49cf6e,{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x42dd4b){logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x47'),util[_0x8574('0x27')](_0x42dd4b,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate',_0x8574('0x47'),_0x8574('0x38'));}break;case _0x8574('0x48'):if(_0x1fe175['authId']&&_0x1fe175['authToken']){var _0x367aad={'dst':_0x47acf1['phone'],'text':_0x47acf1[_0x8574('0x21')],'src':_0x1fe175['senderString']||_0x1fe175['phone'],'url':_0x1fe175[_0x8574('0x22')]+'/api/sms/messages/'+_0x47acf1['id']+_0x8574('0x49')+_0x1fe175['token']};var _0x369ad7=util[_0x8574('0x41')]('%s:%s',_0x1fe175[_0x8574('0x4a')],_0x1fe175['authToken']);var _0x3a352c={'method':'POST','uri':util['format'](_0x8574('0x4b'),_0x1fe175['authId']),'body':_0x367aad,'headers':{'Authorization':util[_0x8574('0x41')](_0x8574('0x4c'),new Buffer(_0x369ad7)[_0x8574('0x42')](_0x8574('0x4d')))},'json':!![]};rp(_0x3a352c)['then'](function(_0x35f7f5){var _0x55c7d4={'messageId':_0x35f7f5['message_uuid'][0x0]};return _0x2699e0['update'](_0x55c7d4);})[_0x8574('0x15')](function(_0x32b01a){logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x48'),util[_0x8574('0x27')](_0x32b01a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8574('0x26'),_0x8574('0x48'),_0x8574('0x4e'));}break;case _0x8574('0x4f'):if(_0x1fe175[_0x8574('0x29')]&&_0x1fe175[_0x8574('0x2a')]){if(_0x1fe175[_0x8574('0x50')]){var _0x4cb66c={'method':_0x8574('0x31'),'uri':_0x1fe175[_0x8574('0x50')]+_0x8574('0x51'),'body':{'username':_0x1fe175[_0x8574('0x29')],'password':_0x1fe175[_0x8574('0x2a')]},'json':!![]};return rp(_0x4cb66c)[_0x8574('0x1b')](function(_0x2deaae){var _0x2e0702={'method':_0x8574('0x31'),'uri':_0x1fe175['baseUrl']+_0x8574('0x52'),'body':{'messages':[{'from':_0x1fe175[_0x8574('0x20')],'destinations':[{'to':_0x47acf1[_0x8574('0x20')]}],'text':_0x47acf1[_0x8574('0x21')],'notifyUrl':_0x1fe175['remote']+_0x8574('0x53')+_0x47acf1['id']+_0x8574('0x49')+_0x1fe175['token'],'notifyContentType':_0x8574('0x54'),'callbackData':_0x1fe175[_0x8574('0x20')]+';'+_0x47acf1[_0x8574('0x21')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2deaae[_0x8574('0x23')]},'json':!![]};return rp(_0x2e0702)[_0x8574('0x1b')](function(_0x22e99c){if(_0x22e99c[_0x8574('0x55')]){var _0x956dba={'messageId':_0x22e99c[_0x8574('0x55')][0x0][_0x8574('0xa')]};if(!_0x1fe175[_0x8574('0x35')]){_0x956dba[_0x8574('0x36')]=!![];}return _0x2699e0[_0x8574('0x13')](_0x956dba);}else{return logger[_0x8574('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8574('0x4f'),util[_0x8574('0x27')](_0x22e99c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x361c57){return logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x4f'),util[_0x8574('0x27')](_0x361c57,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x4f'),_0x8574('0x56'));}}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),'infobip',_0x8574('0x38'));}break;case _0x8574('0x57'):var _0x40028d=require('crypto');if(_0x1fe175['apiKey']){var _0x4a98e9={};_0x4a98e9[_0x8574('0x58')]=_0x1fe175[_0x8574('0x29')];_0x4a98e9[_0x8574('0x20')]=_0x47acf1[_0x8574('0x20')];_0x4a98e9[_0x8574('0x59')]=_0x1fe175['phone'];_0x4a98e9[_0x8574('0x5a')]=_0x47acf1['body'];_0x4a98e9[_0x8574('0x5b')]=+new Date();var _0x57e3b2='';var _0x22dab6='';var _0x5aba87=Object[_0x8574('0x5c')](_0x4a98e9);_0x5aba87[_0x8574('0x5d')]();for(var _0x1716f1=0x0;_0x1716f1<_0x5aba87['length'];_0x1716f1++){if(_0x57e3b2!=''){_0x57e3b2+='&';}_0x57e3b2+=_0x5aba87[_0x1716f1]+'='+encodeURIComponent(_0x4a98e9[_0x5aba87[_0x1716f1]]);_0x22dab6+=_0x4a98e9[_0x5aba87[_0x1716f1]];}_0x22dab6+=_0x1fe175[_0x8574('0x5e')];_0x22dab6=_0x40028d[_0x8574('0x5f')](_0x8574('0x60'))[_0x8574('0x13')](_0x22dab6)[_0x8574('0x61')]('hex');if(_0x57e3b2!==''){_0x57e3b2+='&';}_0x57e3b2+=_0x8574('0x62')+_0x22dab6;var _0x2a6734={'method':_0x8574('0x2e'),'uri':_0x1fe175[_0x8574('0x50')]+'/external/get/send.php?'+_0x57e3b2,'json':!![]};return rp(_0x2a6734)[_0x8574('0x1b')](function(_0x25a49e){var _0x1f2b17=Object[_0x8574('0x5c')](_0x25a49e);if(_0x25a49e[_0x1f2b17[0x0]]['error']&&parseInt(_0x25a49e[_0x1f2b17[0x0]]['error'])===0x0){var _0x421841={'messageId':_0x25a49e[_0x1f2b17[0x0]]['id_sms']};if(!_0x1fe175['deliveryReport']){_0x421841[_0x8574('0x36')]=!![];}return _0x2699e0['update'](_0x421841);}else{return logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),'csc',util[_0x8574('0x27')](_0x25a49e[_0x8574('0x16')],{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x14447a){return logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),'csc',util[_0x8574('0x27')](_0x14447a,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x57'),'Missing\x20parameters:\x20apiKey');}break;case _0x8574('0x63'):if(_0x1fe175['apiKey']){var _0x497ced={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1fe175[_0x8574('0x5e')]},'body':{'content':_0x47acf1['body'],'to':[_0x47acf1['phone']],'from':_0x1fe175[_0x8574('0x20')],'binary':![],'clientMessageId':_0x8574('0x64'),'charset':_0x8574('0x65')},'json':!![]};rp(_0x497ced)['then'](function(_0x5582e1){if(!_0x5582e1[_0x8574('0x16')]){var _0x3a96c2={'messageId':_0x5582e1['messages'][0x0][_0x8574('0x66')]};if(!_0x1fe175[_0x8574('0x35')]){_0x3a96c2[_0x8574('0x36')]=!![];}return _0x2699e0[_0x8574('0x13')](_0x3a96c2);}else{return logger[_0x8574('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8574('0x63'),util[_0x8574('0x27')](_0x5582e1['error'],{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x429bf6){return logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate','clickatell',util[_0x8574('0x27')](_0x429bf6,{'showHidden':![],'depth':null}));});}else{logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x63'),_0x8574('0x67'));}break;case _0x8574('0x68'):if(_0x1fe175['username']&&_0x1fe175['password']){var _0x369ad7=util[_0x8574('0x41')](_0x8574('0x69'),_0x1fe175['username'],_0x1fe175[_0x8574('0x2a')]);var _0x3a352c={'method':'POST','uri':_0x8574('0x6a')+_0x1fe175[_0x8574('0x6b')]+_0x8574('0x6c'),'body':{'to':[_0x47acf1[_0x8574('0x20')]],'text':_0x47acf1[_0x8574('0x21')],'from':_0x1fe175['phone'],'applicationId':_0x1fe175[_0x8574('0x6d')]},'headers':{'Authorization':util[_0x8574('0x41')](_0x8574('0x4c'),new Buffer(_0x369ad7)['toString'](_0x8574('0x4d')))},'json':!![]};rp(_0x3a352c)[_0x8574('0x1b')](function(_0x4b46a6){if(_0x4b46a6['id']){var _0x3a7446={'messageId':_0x4b46a6['id']};return _0x2699e0[_0x8574('0x13')](_0x3a7446);}else{logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate',_0x8574('0x68'),util['inspect'](_0x4b46a6,{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x1d12f7){logger[_0x8574('0x16')](_0x8574('0x25'),_0x8574('0x26'),_0x8574('0x68'),util[_0x8574('0x27')](_0x1d12f7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8574('0x25'),'afterCreate',_0x8574('0x68'),_0x8574('0x38'));}break;case _0x8574('0x6e'):if(_0x1fe175[_0x8574('0x5e')]){var _0x1cb908={};var _0x2a6734={'method':_0x8574('0x31'),'uri':_0x8574('0x6f'),'headers':{'Authorization':_0x8574('0x70')+_0x1fe175[_0x8574('0x5e')],'Content-Type':_0x8574('0x54')},'body':{'from':_0x1fe175[_0x8574('0x20')],'to':_0x47acf1['phone'],'text':_0x47acf1[_0x8574('0x21')]},'json':!![]};return rp(_0x2a6734)[_0x8574('0x1b')](function(_0x14d660){if(_0x14d660[_0x8574('0x71')]==0xca){_0x1cb908[_0x8574('0x72')]=_0x14d660;var _0x461f5f={'method':_0x8574('0x31'),'uri':_0x8574('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x1fe175['apiKey'],'Content-Type':_0x8574('0x54')},'body':{'refid':_0x1cb908['message']['refid']},'json':!![]};return rp(_0x461f5f)['then'](function(_0x51c256){_0x1cb908[_0x8574('0x74')]=_0x51c256;var _0x473452={'messageId':_0x1cb908[_0x8574('0x72')][_0x8574('0x75')],'read':!![]};return _0x2699e0[_0x8574('0x13')](_0x473452);});}else{return logger[_0x8574('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8574('0x26'),'intelepeer',util[_0x8574('0x27')](_0x14d660,{'showHidden':![],'depth':null}));}})[_0x8574('0x15')](function(_0x443f40){return logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate','intelepeer',util['inspect'](_0x443f40,{'showHidden':![],'depth':null}));});}else{return logger[_0x8574('0x16')](_0x8574('0x25'),'afterCreate',_0x8574('0x6e'),_0x8574('0x76'));}break;}}})[_0x8574('0x77')](function(){_0x50ecc2();});}else{_0x50ecc2();}}},'charset':_0x8574('0x78'),'collate':_0x8574('0x79')});}; \ No newline at end of file +var _0xcd4b=['GET','baseUrl','/external/get/send.php?','keys','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','direction','secret','UserId','isNil','SmsInteractionId','SmsInteraction','then','createdAt','toLowerCase','catch','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','text','timestamp','sort','length','apiKey','createHash','signature='];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xcd4b,0x93));var _0xbcd4=function(_0x20f841,_0x1c2da7){_0x20f841=_0x20f841-0x0;var _0x3264c6=_0xcd4b[_0x20f841];return _0x3264c6;};'use strict';var _=require(_0xbcd4('0x0'));var util=require(_0xbcd4('0x1'));var logger=require('../../config/logger')(_0xbcd4('0x2'));var moment=require(_0xbcd4('0x3'));var BPromise=require(_0xbcd4('0x4'));var rp=require(_0xbcd4('0x5'));var fs=require('fs');var path=require(_0xbcd4('0x6'));var rimraf=require(_0xbcd4('0x7'));var config=require(_0xbcd4('0x8'));var attributes=require(_0xbcd4('0x9'));module['exports']=function(_0x5d092f,_0x4b3f8e){return _0x5d092f[_0xbcd4('0xa')](_0xbcd4('0xb'),attributes,{'tableName':_0xbcd4('0xc'),'paranoid':![],'indexes':[{'name':_0xbcd4('0xd'),'fields':['messageId']},{'name':_0xbcd4('0xe'),'fields':[_0xbcd4('0xf')],'type':_0xbcd4('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43460d,_0x3d4717,_0x353e42){var _0x3c09b0=_0x5d092f['models'];var _0x7cdfe4=_0x43460d['get']({'plain':!![]});if(_0x7cdfe4[_0xbcd4('0x11')]['toLowerCase']()==='in'||_0x7cdfe4['direction']['toLowerCase']()==='out'&&!_0x7cdfe4[_0xbcd4('0x12')]&&!_['isNil'](_0x7cdfe4[_0xbcd4('0x13')])&&!_[_0xbcd4('0x14')](_0x7cdfe4[_0xbcd4('0x15')])){_0x3c09b0[_0xbcd4('0x16')]['findOne']({'where':{'id':_0x7cdfe4[_0xbcd4('0x15')]}})[_0xbcd4('0x17')](function(_0x2d034a){if(_0x2d034a){_0x2d034a['update']({'lastMsgAt':_0x7cdfe4[_0xbcd4('0x18')],'lastMsgDirection':_0x7cdfe4[_0xbcd4('0x11')][_0xbcd4('0x19')]()});}})[_0xbcd4('0x1a')](function(_0x280e3b){console['error'](_0x280e3b);});}if(_0x7cdfe4['direction']==='out'&&!_0x7cdfe4[_0xbcd4('0x12')]){var _0x2f8b2e;_0x3c09b0['SmsAccount']['find']({'where':{'id':_0x7cdfe4[_0xbcd4('0x1b')]},'raw':!![]})[_0xbcd4('0x17')](function(_0x478f08){_0x2f8b2e=_0x478f08;if(_0x2f8b2e&&_0x2f8b2e['type']){switch(_0x2f8b2e[_0xbcd4('0x1c')]){case _0xbcd4('0x1d'):var _0x2d8fd3=require(_0xbcd4('0x1d'));if(_0x2f8b2e[_0xbcd4('0x1e')]&&_0x2f8b2e[_0xbcd4('0x1f')]&&_0x2f8b2e[_0xbcd4('0x20')]){var _0x4e51c8=new _0x2d8fd3(_0x2f8b2e[_0xbcd4('0x1e')],_0x2f8b2e['authToken']);_0x4e51c8[_0xbcd4('0x21')][_0xbcd4('0x22')]({'body':_0x7cdfe4['body'],'to':_0x7cdfe4['phone'],'from':_0x2f8b2e[_0xbcd4('0x20')],'statusCallback':_0x2f8b2e['remote']+_0xbcd4('0x23')+_0x7cdfe4['id']+'/status?token='+_0x2f8b2e[_0xbcd4('0x24')]})[_0xbcd4('0x17')](function(_0x256b0d){if(_0x256b0d[_0xbcd4('0x25')]){return _0x43460d[_0xbcd4('0x26')]({'messageId':_0x256b0d['sid']});}})[_0xbcd4('0x1a')](function(_0x1a4245){logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x1d'),util[_0xbcd4('0x2a')](_0x1a4245,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xbcd4('0x2b'):var _0x4c3ebb=_0xbcd4('0x2c');if(_0x2f8b2e[_0xbcd4('0x2d')]&&_0x2f8b2e[_0xbcd4('0x2e')]){var _0x224a1b={'recipient':[_0x7cdfe4[_0xbcd4('0x20')]],'message':_0x7cdfe4['body'],'message_type':_0x2f8b2e['smsMethod']};if(_0x2f8b2e[_0xbcd4('0x2f')]&&_0x2f8b2e[_0xbcd4('0x2f')]!=='SI'){_0x224a1b[_0xbcd4('0x30')]=_0x2f8b2e['phone'];}var _0x589eee={'url':_0x4c3ebb+_0xbcd4('0x31')+_0x2f8b2e[_0xbcd4('0x2d')]+'&password='+_0x2f8b2e[_0xbcd4('0x2e')],'method':'GET'};rp(_0x589eee)[_0xbcd4('0x17')](function(_0x23e4da){var _0x140210=_0x23e4da[_0xbcd4('0x32')](';');var _0x2dabe8={'user_key':_0x140210[0x0],'session_key':_0x140210[0x1]};_0x589eee={'url':_0x4c3ebb+_0xbcd4('0x33'),'method':_0xbcd4('0x34'),'headers':{'user_key':_0x2dabe8[_0xbcd4('0x35')],'Session_key':_0x2dabe8[_0xbcd4('0x36')]},'json':!![],'body':_0x224a1b};return rp(_0x589eee);})[_0xbcd4('0x17')](function(_0x376968){if(_0x376968[_0xbcd4('0x37')]>=0x1){var _0x6ad9fe={'messageId':_0x376968[_0xbcd4('0x38')]};if(_0x2f8b2e[_0xbcd4('0x2f')]!=='GP'||!_0x2f8b2e[_0xbcd4('0x39')]){_0x6ad9fe[_0xbcd4('0x3a')]=!![];}return _0x43460d[_0xbcd4('0x26')](_0x6ad9fe);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0xbcd4('0x2a')](_0x376968,{'showHidden':![],'depth':null}));}})[_0xbcd4('0x1a')](function(_0x42fddb){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd4('0x29'),_0xbcd4('0x2b'),util[_0xbcd4('0x2a')](_0x42fddb,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x2b'),_0xbcd4('0x3b'));}break;case'connectel':if(_0x2f8b2e[_0xbcd4('0x1f')]){var _0xd98dbc={'recipient':_0x7cdfe4[_0xbcd4('0x20')],'message':_0x7cdfe4[_0xbcd4('0xf')],'sender':_0x2f8b2e[_0xbcd4('0x3c')]||_0x2f8b2e[_0xbcd4('0x20')],'authorization':_0x2f8b2e[_0xbcd4('0x1f')]};var _0x3d4717={'method':_0xbcd4('0x34'),'uri':_0xbcd4('0x3d'),'body':_0xd98dbc,'json':!![]};rp(_0x3d4717)[_0xbcd4('0x17')](function(_0x2428ed){var _0x577fbd={'messageId':_0x2428ed[_0xbcd4('0x3e')]};if(!_0x2f8b2e['deliveryReport']){_0x577fbd[_0xbcd4('0x3a')]=!![];}return _0x43460d[_0xbcd4('0x26')](_0x577fbd);})[_0xbcd4('0x1a')](function(_0x4b363d){logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),'connectel',util[_0xbcd4('0x2a')](_0x4b363d,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x3f'),'Missing\x20parameters:\x20authToken');}break;case _0xbcd4('0x40'):if(_0x2f8b2e[_0xbcd4('0x2d')]&&_0x2f8b2e[_0xbcd4('0x2e')]){var _0xd98dbc={'messages':[{'source':_0xbcd4('0x41'),'to':_0x7cdfe4[_0xbcd4('0x20')],'body':_0x7cdfe4[_0xbcd4('0xf')],'from':_0x2f8b2e[_0xbcd4('0x3c')]||_0x2f8b2e['phone']}]};var _0x21be61=util[_0xbcd4('0x42')](_0xbcd4('0x43'),_0x2f8b2e[_0xbcd4('0x2d')],_0x2f8b2e[_0xbcd4('0x2e')]);var _0x3d4717={'method':'POST','uri':_0xbcd4('0x44'),'body':_0xd98dbc,'headers':{'Authorization':util[_0xbcd4('0x42')](_0xbcd4('0x45'),new Buffer(_0x21be61)[_0xbcd4('0x46')](_0xbcd4('0x47')))},'json':!![]};rp(_0x3d4717)[_0xbcd4('0x17')](function(_0x175a3e){if(_0x175a3e['http_code']>=0xc8&&_0x175a3e[_0xbcd4('0x48')]<=0xce){if(_0x175a3e[_0xbcd4('0x49')]&&_0x175a3e[_0xbcd4('0x49')][_0xbcd4('0x4a')]>0x0){var _0x32213a=_[_0xbcd4('0x4b')](_0x175a3e['data'][_0xbcd4('0x21')]);var _0x48baf1={'messageId':_0x32213a['message_id']};if(!_0x2f8b2e['deliveryReport']){_0x48baf1['read']=!![];}return _0x43460d[_0xbcd4('0x26')](_0x48baf1);}else{logger[_0xbcd4('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd4('0x29'),_0xbcd4('0x4c'),util[_0xbcd4('0x2a')](_0x175a3e,{'showHidden':![],'depth':null}));}}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x4c'),util[_0xbcd4('0x2a')](_0x175a3e,{'showHidden':![],'depth':null}));}})[_0xbcd4('0x1a')](function(_0x1e7a9c){logger['error'](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x4c'),util[_0xbcd4('0x2a')](_0x1e7a9c,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x4c'),_0xbcd4('0x3b'));}break;case _0xbcd4('0x4d'):if(_0x2f8b2e[_0xbcd4('0x4e')]&&_0x2f8b2e[_0xbcd4('0x1f')]){var _0xd98dbc={'dst':_0x7cdfe4[_0xbcd4('0x20')],'text':_0x7cdfe4['body'],'src':_0x2f8b2e[_0xbcd4('0x3c')]||_0x2f8b2e['phone'],'url':_0x2f8b2e[_0xbcd4('0x4f')]+_0xbcd4('0x23')+_0x7cdfe4['id']+_0xbcd4('0x50')+_0x2f8b2e[_0xbcd4('0x24')]};var _0x21be61=util[_0xbcd4('0x42')](_0xbcd4('0x43'),_0x2f8b2e[_0xbcd4('0x4e')],_0x2f8b2e[_0xbcd4('0x1f')]);var _0x3d4717={'method':_0xbcd4('0x34'),'uri':util[_0xbcd4('0x42')](_0xbcd4('0x51'),_0x2f8b2e[_0xbcd4('0x4e')]),'body':_0xd98dbc,'headers':{'Authorization':util[_0xbcd4('0x42')](_0xbcd4('0x45'),new Buffer(_0x21be61)['toString'](_0xbcd4('0x47')))},'json':!![]};rp(_0x3d4717)['then'](function(_0x1e12c0){var _0x2fd708={'messageId':_0x1e12c0['message_uuid'][0x0]};return _0x43460d[_0xbcd4('0x26')](_0x2fd708);})[_0xbcd4('0x1a')](function(_0x1fdfc1){logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x4d'),util[_0xbcd4('0x2a')](_0x1fdfc1,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x4d'),_0xbcd4('0x52'));}break;case _0xbcd4('0x53'):if(_0x2f8b2e['username']&&_0x2f8b2e[_0xbcd4('0x2e')]){if(_0x2f8b2e['baseUrl']){var _0x20e09e={'method':_0xbcd4('0x34'),'uri':_0x2f8b2e['baseUrl']+_0xbcd4('0x54'),'body':{'username':_0x2f8b2e[_0xbcd4('0x2d')],'password':_0x2f8b2e[_0xbcd4('0x2e')]},'json':!![]};return rp(_0x20e09e)[_0xbcd4('0x17')](function(_0x5cdc3f){var _0x3ba3cc={'method':'POST','uri':_0x2f8b2e['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2f8b2e['phone'],'destinations':[{'to':_0x7cdfe4[_0xbcd4('0x20')]}],'text':_0x7cdfe4[_0xbcd4('0xf')],'notifyUrl':_0x2f8b2e[_0xbcd4('0x4f')]+_0xbcd4('0x23')+_0x7cdfe4['id']+_0xbcd4('0x50')+_0x2f8b2e['token'],'notifyContentType':_0xbcd4('0x55'),'callbackData':_0x2f8b2e[_0xbcd4('0x20')]+';'+_0x7cdfe4['body']}]},'headers':{'Authorization':_0xbcd4('0x56')+_0x5cdc3f[_0xbcd4('0x24')]},'json':!![]};return rp(_0x3ba3cc)['then'](function(_0x592e5b){if(_0x592e5b[_0xbcd4('0x21')]){var _0x2e9a04={'messageId':_0x592e5b[_0xbcd4('0x21')][0x0][_0xbcd4('0xd')]};if(!_0x2f8b2e[_0xbcd4('0x39')]){_0x2e9a04['read']=!![];}return _0x43460d[_0xbcd4('0x26')](_0x2e9a04);}else{return logger['error'](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x53'),util[_0xbcd4('0x2a')](_0x592e5b,{'showHidden':![],'depth':null}));}});})[_0xbcd4('0x1a')](function(_0xee5615){return logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x53'),util[_0xbcd4('0x2a')](_0xee5615,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd4('0x29'),_0xbcd4('0x53'),_0xbcd4('0x57'));}}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x53'),_0xbcd4('0x3b'));}break;case'csc':var _0x32e0e2=require(_0xbcd4('0x58'));if(_0x2f8b2e['apiKey']){var _0x5b023b={};_0x5b023b[_0xbcd4('0x59')]=_0x2f8b2e[_0xbcd4('0x2d')];_0x5b023b[_0xbcd4('0x20')]=_0x7cdfe4[_0xbcd4('0x20')];_0x5b023b[_0xbcd4('0x30')]=_0x2f8b2e[_0xbcd4('0x20')];_0x5b023b[_0xbcd4('0x5a')]=_0x7cdfe4[_0xbcd4('0xf')];_0x5b023b[_0xbcd4('0x5b')]=+new Date();var _0x17cc82='';var _0xfc99ff='';var _0x30d91e=Object['keys'](_0x5b023b);_0x30d91e[_0xbcd4('0x5c')]();for(var _0x413433=0x0;_0x413433<_0x30d91e[_0xbcd4('0x5d')];_0x413433++){if(_0x17cc82!=''){_0x17cc82+='&';}_0x17cc82+=_0x30d91e[_0x413433]+'='+encodeURIComponent(_0x5b023b[_0x30d91e[_0x413433]]);_0xfc99ff+=_0x5b023b[_0x30d91e[_0x413433]];}_0xfc99ff+=_0x2f8b2e[_0xbcd4('0x5e')];_0xfc99ff=_0x32e0e2[_0xbcd4('0x5f')]('md5')['update'](_0xfc99ff)['digest']('hex');if(_0x17cc82!==''){_0x17cc82+='&';}_0x17cc82+=_0xbcd4('0x60')+_0xfc99ff;var _0x589eee={'method':_0xbcd4('0x61'),'uri':_0x2f8b2e[_0xbcd4('0x62')]+_0xbcd4('0x63')+_0x17cc82,'json':!![]};return rp(_0x589eee)[_0xbcd4('0x17')](function(_0xbc5968){var _0x109b0e=Object[_0xbcd4('0x64')](_0xbc5968);if(_0xbc5968[_0x109b0e[0x0]][_0xbcd4('0x27')]&&parseInt(_0xbc5968[_0x109b0e[0x0]]['error'])===0x0){var _0x47f162={'messageId':_0xbc5968[_0x109b0e[0x0]]['id_sms']};if(!_0x2f8b2e[_0xbcd4('0x39')]){_0x47f162[_0xbcd4('0x3a')]=!![];}return _0x43460d[_0xbcd4('0x26')](_0x47f162);}else{return logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x65'),util[_0xbcd4('0x2a')](_0xbc5968[_0xbcd4('0x27')],{'showHidden':![],'depth':null}));}})[_0xbcd4('0x1a')](function(_0x2fbfbe){return logger['error'](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x65'),util['inspect'](_0x2fbfbe,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),'csc',_0xbcd4('0x66'));}break;case _0xbcd4('0x67'):if(_0x2f8b2e[_0xbcd4('0x5e')]){var _0x21a5eb={'method':_0xbcd4('0x34'),'uri':_0xbcd4('0x68'),'headers':{'Authorization':_0x2f8b2e[_0xbcd4('0x5e')]},'body':{'content':_0x7cdfe4[_0xbcd4('0xf')],'to':[_0x7cdfe4[_0xbcd4('0x20')]],'from':_0x2f8b2e[_0xbcd4('0x20')],'binary':![],'clientMessageId':_0xbcd4('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x21a5eb)[_0xbcd4('0x17')](function(_0x50d048){if(!_0x50d048[_0xbcd4('0x27')]){var _0x1912d3={'messageId':_0x50d048[_0xbcd4('0x21')][0x0][_0xbcd4('0x6a')]};if(!_0x2f8b2e[_0xbcd4('0x39')]){_0x1912d3[_0xbcd4('0x3a')]=!![];}return _0x43460d[_0xbcd4('0x26')](_0x1912d3);}else{return logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x67'),util[_0xbcd4('0x2a')](_0x50d048[_0xbcd4('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x54c66d){return logger[_0xbcd4('0x27')](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x67'),util[_0xbcd4('0x2a')](_0x54c66d,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x67'),_0xbcd4('0x66'));}break;case _0xbcd4('0x6b'):if(_0x2f8b2e[_0xbcd4('0x2d')]&&_0x2f8b2e[_0xbcd4('0x2e')]){var _0x21be61=util[_0xbcd4('0x42')]('%s:%s',_0x2f8b2e[_0xbcd4('0x2d')],_0x2f8b2e[_0xbcd4('0x2e')]);var _0x3d4717={'method':_0xbcd4('0x34'),'uri':_0xbcd4('0x6c')+_0x2f8b2e[_0xbcd4('0x6d')]+'/messages','body':{'to':[_0x7cdfe4[_0xbcd4('0x20')]],'text':_0x7cdfe4[_0xbcd4('0xf')],'from':_0x2f8b2e[_0xbcd4('0x20')],'applicationId':_0x2f8b2e[_0xbcd4('0x6e')]},'headers':{'Authorization':util[_0xbcd4('0x42')](_0xbcd4('0x45'),new Buffer(_0x21be61)[_0xbcd4('0x46')](_0xbcd4('0x47')))},'json':!![]};rp(_0x3d4717)['then'](function(_0x2dfc4a){if(_0x2dfc4a['id']){var _0x2f9808={'messageId':_0x2dfc4a['id']};return _0x43460d[_0xbcd4('0x26')](_0x2f9808);}else{logger['error'](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x6b'),util[_0xbcd4('0x2a')](_0x2dfc4a,{'showHidden':![],'depth':null}));}})[_0xbcd4('0x1a')](function(_0x12bdb0){logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),_0xbcd4('0x6b'),util['inspect'](_0x12bdb0,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd4('0x27')](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x2f8b2e[_0xbcd4('0x5e')]){var _0x2b919e={};var _0x589eee={'method':_0xbcd4('0x34'),'uri':_0xbcd4('0x6f'),'headers':{'Authorization':_0xbcd4('0x70')+_0x2f8b2e[_0xbcd4('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x2f8b2e[_0xbcd4('0x20')],'to':_0x7cdfe4[_0xbcd4('0x20')],'text':_0x7cdfe4['body']},'json':!![]};return rp(_0x589eee)[_0xbcd4('0x17')](function(_0x55ba3d){if(_0x55ba3d[_0xbcd4('0x71')]==0xca){_0x2b919e[_0xbcd4('0x72')]=_0x55ba3d;var _0x3bf058={'method':_0xbcd4('0x34'),'uri':_0xbcd4('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x2f8b2e[_0xbcd4('0x5e')],'Content-Type':_0xbcd4('0x55')},'body':{'refid':_0x2b919e[_0xbcd4('0x72')]['refid']},'json':!![]};return rp(_0x3bf058)[_0xbcd4('0x17')](function(_0x9f46e5){_0x2b919e[_0xbcd4('0x74')]=_0x9f46e5;var _0xe5c413={'messageId':_0x2b919e[_0xbcd4('0x72')][_0xbcd4('0x75')],'read':!![]};return _0x43460d[_0xbcd4('0x26')](_0xe5c413);});}else{return logger['error'](_0xbcd4('0x28'),'afterCreate',_0xbcd4('0x76'),util['inspect'](_0x55ba3d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x12859d){return logger[_0xbcd4('0x27')](_0xbcd4('0x28'),_0xbcd4('0x29'),'intelepeer',util[_0xbcd4('0x2a')](_0x12859d,{'showHidden':![],'depth':null}));});}else{return logger[_0xbcd4('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd4('0x29'),_0xbcd4('0x76'),_0xbcd4('0x77'));}break;}}})['finally'](function(){_0x353e42();});}else{_0x353e42();}}},'charset':_0xbcd4('0x78'),'collate':_0xbcd4('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index aced33a..7671660 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 _0xc0ad=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','SmsMessage','create','options','CreateSmsMessage','debug','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x2d8cca,_0x1309c0){var _0x2ce417=function(_0x3d6ca4){while(--_0x3d6ca4){_0x2d8cca['push'](_0x2d8cca['shift']());}};_0x2ce417(++_0x1309c0);}(_0xc0ad,0x1bb));var _0xdc0a=function(_0x366b3b,_0x3c8873){_0x366b3b=_0x366b3b-0x0;var _0x29c2ee=_0xc0ad[_0x366b3b];return _0x29c2ee;};'use strict';var _=require(_0xdc0a('0x0'));var util=require(_0xdc0a('0x1'));var moment=require(_0xdc0a('0x2'));var BPromise=require(_0xdc0a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc0a('0x4'));var db=require(_0xdc0a('0x5'))['db'];var utils=require(_0xdc0a('0x6'));var logger=require(_0xdc0a('0x7'))('rpc');var config=require(_0xdc0a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdc0a('0x9')][_0xdc0a('0xa')]({'port':0x232a});config['redis']=_[_0xdc0a('0xb')](config[_0xdc0a('0xc')],{'host':_0xdc0a('0xd'),'port':0x18eb});var socket=require(_0xdc0a('0xe'))(new Redis(config[_0xdc0a('0xc')]));require(_0xdc0a('0xf'))[_0xdc0a('0x10')](socket);function respondWithRpcPromise(_0x5a1c63,_0x1d9ff6,_0x35ce65){return new BPromise(function(_0x132a96,_0x487517){return client['request'](_0x5a1c63,_0x35ce65)[_0xdc0a('0x11')](function(_0x5dcd9d){logger[_0xdc0a('0x12')]('SmsMessage,\x20%s,\x20%s',_0x1d9ff6,_0xdc0a('0x13'));logger['debug'](_0xdc0a('0x14'),_0x1d9ff6,_0xdc0a('0x13'),JSON[_0xdc0a('0x15')](_0x5dcd9d));if(_0x5dcd9d[_0xdc0a('0x16')]){if(_0x5dcd9d[_0xdc0a('0x16')][_0xdc0a('0x17')]===0x1f4){logger['error'](_0xdc0a('0x18'),_0x1d9ff6,_0x5dcd9d[_0xdc0a('0x16')][_0xdc0a('0x19')]);return _0x487517(_0x5dcd9d[_0xdc0a('0x16')][_0xdc0a('0x19')]);}logger[_0xdc0a('0x16')](_0xdc0a('0x18'),_0x1d9ff6,_0x5dcd9d[_0xdc0a('0x16')][_0xdc0a('0x19')]);return _0x132a96(_0x5dcd9d['error'][_0xdc0a('0x19')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x1d9ff6,_0xdc0a('0x13'));_0x132a96(_0x5dcd9d['result'][_0xdc0a('0x19')]);}})['catch'](function(_0x3278d7){logger[_0xdc0a('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1d9ff6,_0x3278d7);_0x487517(_0x3278d7);});});}exports['CreateSmsMessage']=function(_0x9217ce){var _0x36857e=this;return new Promise(function(_0x5eba9a,_0x3804bb){return db[_0xdc0a('0x1a')][_0xdc0a('0x1b')](_0x9217ce['body'],{'raw':_0x9217ce[_0xdc0a('0x1c')]?_0x9217ce[_0xdc0a('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xdc0a('0x11')](function(_0x18f635){logger['info'](_0xdc0a('0x1d'),_0x9217ce);logger[_0xdc0a('0x1e')](_0xdc0a('0x1d'),_0x9217ce,JSON[_0xdc0a('0x15')](_0x18f635));_0x5eba9a(_0x18f635);})[_0xdc0a('0x1f')](function(_0x1ff61a){logger[_0xdc0a('0x16')](_0xdc0a('0x1d'),_0x1ff61a[_0xdc0a('0x19')],_0x9217ce);_0x3804bb(_0x36857e['error'](0x1f4,_0x1ff61a[_0xdc0a('0x19')]));});});}; \ No newline at end of file +var _0xd4b8=['util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','SmsMessage','create','body','options','raw','CreateSmsMessage','stringify','catch','lodash'];(function(_0x40ae51,_0x174323){var _0x384cc7=function(_0x1edf92){while(--_0x1edf92){_0x40ae51['push'](_0x40ae51['shift']());}};_0x384cc7(++_0x174323);}(_0xd4b8,0xf7));var _0x8d4b=function(_0x4e2eb6,_0x59f10e){_0x4e2eb6=_0x4e2eb6-0x0;var _0x14cdf3=_0xd4b8[_0x4e2eb6];return _0x14cdf3;};'use strict';var _=require(_0x8d4b('0x0'));var util=require(_0x8d4b('0x1'));var moment=require('moment');var BPromise=require(_0x8d4b('0x2'));var rs=require(_0x8d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d4b('0x4'));var logger=require('../../config/logger')(_0x8d4b('0x5'));var config=require(_0x8d4b('0x6'));var jayson=require(_0x8d4b('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x8d4b('0x8')]=_[_0x8d4b('0x9')](config[_0x8d4b('0x8')],{'host':_0x8d4b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d4b('0x8')]));require(_0x8d4b('0xb'))[_0x8d4b('0xc')](socket);function respondWithRpcPromise(_0x4a9253,_0x1be6e6,_0x3278f1){return new BPromise(function(_0x66ad7,_0x59327a){return client[_0x8d4b('0xd')](_0x4a9253,_0x3278f1)[_0x8d4b('0xe')](function(_0x383ef5){logger[_0x8d4b('0xf')](_0x8d4b('0x10'),_0x1be6e6,_0x8d4b('0x11'));logger[_0x8d4b('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1be6e6,_0x8d4b('0x11'),JSON['stringify'](_0x383ef5));if(_0x383ef5['error']){if(_0x383ef5[_0x8d4b('0x13')][_0x8d4b('0x14')]===0x1f4){logger[_0x8d4b('0x13')](_0x8d4b('0x10'),_0x1be6e6,_0x383ef5[_0x8d4b('0x13')][_0x8d4b('0x15')]);return _0x59327a(_0x383ef5[_0x8d4b('0x13')][_0x8d4b('0x15')]);}logger[_0x8d4b('0x13')](_0x8d4b('0x10'),_0x1be6e6,_0x383ef5[_0x8d4b('0x13')]['message']);return _0x66ad7(_0x383ef5['error'][_0x8d4b('0x15')]);}else{logger[_0x8d4b('0xf')]('SmsMessage,\x20%s,\x20%s',_0x1be6e6,_0x8d4b('0x11'));_0x66ad7(_0x383ef5[_0x8d4b('0x16')]['message']);}})['catch'](function(_0x442941){logger['error'](_0x8d4b('0x10'),_0x1be6e6,_0x442941);_0x59327a(_0x442941);});});}exports['CreateSmsMessage']=function(_0x2bdbaf){var _0x23bc0b=this;return new Promise(function(_0x1fb736,_0x54b876){return db[_0x8d4b('0x17')][_0x8d4b('0x18')](_0x2bdbaf[_0x8d4b('0x19')],{'raw':_0x2bdbaf['options']?_0x2bdbaf[_0x8d4b('0x1a')][_0x8d4b('0x1b')]===undefined?!![]:![]:!![]})[_0x8d4b('0xe')](function(_0x1438db){logger['info'](_0x8d4b('0x1c'),_0x2bdbaf);logger['debug'](_0x8d4b('0x1c'),_0x2bdbaf,JSON[_0x8d4b('0x1d')](_0x1438db));_0x1fb736(_0x1438db);})[_0x8d4b('0x1e')](function(_0x1e2b8a){logger[_0x8d4b('0x13')]('CreateSmsMessage',_0x1e2b8a[_0x8d4b('0x15')],_0x2bdbaf);_0x54b876(_0x23bc0b[_0x8d4b('0x13')](0x1f4,_0x1e2b8a[_0x8d4b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d0757f7..cdfc2ed 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 _0x63c9=['length','./smsMessage.events','save','remove','update','emit'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x63c9,0x97));var _0x963c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x63c9[_0x122096];return _0x3d1966;};'use strict';var SmsMessageEvents=require(_0x963c('0x0'));var events=[_0x963c('0x1'),_0x963c('0x2'),_0x963c('0x3')];function createListener(_0x583c80,_0x4757a7){return function(_0x14e37d){_0x4757a7[_0x963c('0x4')](_0x583c80,_0x14e37d);};}function removeListener(_0xd04c74,_0x54abf8){return function(){SmsMessageEvents['removeListener'](_0xd04c74,_0x54abf8);};}exports['register']=function(_0x3c0477){for(var _0x47c6d3=0x0,_0xdb94e8=events[_0x963c('0x5')];_0x47c6d3<_0xdb94e8;_0x47c6d3++){var _0x581706=events[_0x47c6d3];var _0x35c76f=createListener('smsMessage:'+_0x581706,_0x3c0477);SmsMessageEvents['on'](_0x581706,_0x35c76f);}}; \ No newline at end of file +var _0x86e6=['save','remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x265129,_0x45e239){var _0xc48ff8=function(_0x5ac215){while(--_0x5ac215){_0x265129['push'](_0x265129['shift']());}};_0xc48ff8(++_0x45e239);}(_0x86e6,0xd7));var _0x686e=function(_0xacc1e9,_0x5278e5){_0xacc1e9=_0xacc1e9-0x0;var _0x11ff56=_0x86e6[_0xacc1e9];return _0x11ff56;};'use strict';var SmsMessageEvents=require(_0x686e('0x0'));var events=[_0x686e('0x1'),_0x686e('0x2'),_0x686e('0x3')];function createListener(_0x4d5b2b,_0x5afee2){return function(_0x4aa405){_0x5afee2[_0x686e('0x4')](_0x4d5b2b,_0x4aa405);};}function removeListener(_0x4356f7,_0x2a60cb){return function(){SmsMessageEvents[_0x686e('0x5')](_0x4356f7,_0x2a60cb);};}exports[_0x686e('0x6')]=function(_0x198bef){for(var _0x2a965e=0x0,_0x3b76ae=events[_0x686e('0x7')];_0x2a965e<_0x3b76ae;_0x2a965e++){var _0x500ab0=events[_0x2a965e];var _0x41d04b=createListener(_0x686e('0x8')+_0x500ab0,_0x198bef);SmsMessageEvents['on'](_0x500ab0,_0x41d04b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b21ad93..7ca858a 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 _0xf9d1=['addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf9d1,0x8e));var _0x1f9d=function(_0x29b212,_0x2bda77){_0x29b212=_0x29b212-0x0;var _0x5400ef=_0xf9d1[_0x29b212];return _0x5400ef;};'use strict';var multer=require(_0x1f9d('0x0'));var util=require(_0x1f9d('0x1'));var path=require(_0x1f9d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f9d('0x3')]();var fs_extra=require(_0x1f9d('0x4'));var auth=require(_0x1f9d('0x5'));var interaction=require(_0x1f9d('0x6'));var config=require('../../config/environment');var controller=require(_0x1f9d('0x7'));router['get']('/',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x9')]);router['get'](_0x1f9d('0xa'),auth[_0x1f9d('0x8')](),controller['describe']);router['get'](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xc')]);router['get']('/:id/members',auth[_0x1f9d('0x8')](),controller['getMembers']);router[_0x1f9d('0xd')](_0x1f9d('0xe'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xf')]);router[_0x1f9d('0xd')](_0x1f9d('0x10'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x11')]);router[_0x1f9d('0x12')]('/',auth['isAuthenticated'](),controller[_0x1f9d('0x13')]);router[_0x1f9d('0x12')]('/:id/teams',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x14')]);router[_0x1f9d('0x12')](_0x1f9d('0x10'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x15')]);router[_0x1f9d('0x16')](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller['update']);router[_0x1f9d('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x1f9d('0x17')](_0x1f9d('0xe'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x18')]);router[_0x1f9d('0x17')](_0x1f9d('0x10'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x19')]);module[_0x1f9d('0x1a')]=router; \ No newline at end of file +var _0xc9e1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addAgents','put','delete','destroy','removeAgents'];(function(_0x53c150,_0x5854fc){var _0x132440=function(_0x29ecd9){while(--_0x29ecd9){_0x53c150['push'](_0x53c150['shift']());}};_0x132440(++_0x5854fc);}(_0xc9e1,0x1cb));var _0x1c9e=function(_0x48f086,_0x491e07){_0x48f086=_0x48f086-0x0;var _0x16aa82=_0xc9e1[_0x48f086];return _0x16aa82;};'use strict';var multer=require(_0x1c9e('0x0'));var util=require(_0x1c9e('0x1'));var path=require(_0x1c9e('0x2'));var timeout=require(_0x1c9e('0x3'));var express=require(_0x1c9e('0x4'));var router=express[_0x1c9e('0x5')]();var fs_extra=require(_0x1c9e('0x6'));var auth=require(_0x1c9e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1c9e('0x8'));var controller=require(_0x1c9e('0x9'));router[_0x1c9e('0xa')]('/',auth[_0x1c9e('0xb')](),controller[_0x1c9e('0xc')]);router[_0x1c9e('0xa')]('/describe',auth[_0x1c9e('0xb')](),controller[_0x1c9e('0xd')]);router[_0x1c9e('0xa')](_0x1c9e('0xe'),auth[_0x1c9e('0xb')](),controller[_0x1c9e('0xf')]);router[_0x1c9e('0xa')](_0x1c9e('0x10'),auth[_0x1c9e('0xb')](),controller['getMembers']);router[_0x1c9e('0xa')]('/:id/teams',auth[_0x1c9e('0xb')](),controller[_0x1c9e('0x11')]);router[_0x1c9e('0xa')](_0x1c9e('0x12'),auth['isAuthenticated'](),controller[_0x1c9e('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1c9e('0x14')](_0x1c9e('0x15'),auth[_0x1c9e('0xb')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x1c9e('0x16')]);router[_0x1c9e('0x17')](_0x1c9e('0xe'),auth[_0x1c9e('0xb')](),controller['update']);router[_0x1c9e('0x18')](_0x1c9e('0xe'),auth[_0x1c9e('0xb')](),controller[_0x1c9e('0x19')]);router[_0x1c9e('0x18')](_0x1c9e('0x15'),auth[_0x1c9e('0xb')](),controller['removeTeams']);router[_0x1c9e('0x18')](_0x1c9e('0x12'),auth['isAuthenticated'](),controller[_0x1c9e('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c1b0266..1218dc4 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 _0x3fab=['sequelize','exports','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x5c1a9f,_0xaf0926){var _0x134c44=function(_0x14bee1){while(--_0x14bee1){_0x5c1a9f['push'](_0x5c1a9f['shift']());}};_0x134c44(++_0xaf0926);}(_0x3fab,0x70));var _0xb3fa=function(_0x12ef6a,_0x92455a){_0x12ef6a=_0x12ef6a-0x0;var _0x291af2=_0x3fab[_0x12ef6a];return _0x291af2;};'use strict';var Sequelize=require(_0xb3fa('0x0'));module[_0xb3fa('0x1')]={'name':{'type':Sequelize[_0xb3fa('0x2')],'unique':_0xb3fa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb3fa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3fa('0x5')]('rrmemory','beepall',_0xb3fa('0x6'))}}; \ No newline at end of file +var _0xf1c5=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x46a567,_0x3b327d){var _0x2e298c=function(_0x48cffb){while(--_0x48cffb){_0x46a567['push'](_0x46a567['shift']());}};_0x2e298c(++_0x3b327d);}(_0xf1c5,0x1b4));var _0x5f1c=function(_0x1ee54e,_0x4c595b){_0x1ee54e=_0x1ee54e-0x0;var _0x351abe=_0xf1c5[_0x1ee54e];return _0x351abe;};'use strict';var Sequelize=require(_0x5f1c('0x0'));module[_0x5f1c('0x1')]={'name':{'type':Sequelize[_0x5f1c('0x2')],'unique':_0x5f1c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5f1c('0x2')]},'timeout':{'type':Sequelize[_0x5f1c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f1c('0x5')](_0x5f1c('0x6'),'beepall',_0x5f1c('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 465044c..460c6c4 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 _0x77e6=['ejs','lodash','jsforce','desk.js','to-csv','querystring','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','User','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x3f918e,_0x3e9626){var _0x4c8588=function(_0x3f72a0){while(--_0x3f72a0){_0x3f918e['push'](_0x3f918e['shift']());}};_0x4c8588(++_0x3e9626);}(_0x77e6,0x1a6));var _0x677e=function(_0x3b802b,_0x15aad5){_0x3b802b=_0x3b802b-0x0;var _0x313c00=_0x77e6[_0x3b802b];return _0x313c00;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];config[_0x677e('0x1a')]=_[_0x677e('0x1b')](config[_0x677e('0x1a')],{'host':_0x677e('0x1c'),'port':0x18eb});var socket=require(_0x677e('0x1d'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x213a50,_0x1dbe16){_0x1dbe16=_0x1dbe16||0xcc;return function(_0x105c88){if(_0x105c88){return _0x213a50[_0x677e('0x1e')](_0x1dbe16);}return _0x213a50[_0x677e('0x1f')](_0x1dbe16)[_0x677e('0x20')]();};}function respondWithResult(_0x24c9eb,_0xe88242){_0xe88242=_0xe88242||0xc8;return function(_0x251069){if(_0x251069){return _0x24c9eb[_0x677e('0x1f')](_0xe88242)[_0x677e('0x21')](_0x251069);}};}function respondWithFilteredResult(_0xe4d960,_0x49d428){return function(_0x1c5124){if(_0x1c5124){var _0x2ef2bf=typeof _0x49d428[_0x677e('0x22')]===_0x677e('0x23')&&typeof _0x49d428[_0x677e('0x24')]===_0x677e('0x23');var _0x52f65d=_0x1c5124[_0x677e('0x25')];var _0x4bfbb6=_0x2ef2bf?0x0:_0x49d428[_0x677e('0x22')];var _0x267aac=_0x2ef2bf?_0x1c5124[_0x677e('0x25')]:_0x49d428['offset']+_0x49d428[_0x677e('0x24')];var _0x1a6122;if(_0x267aac>=_0x52f65d){_0x267aac=_0x52f65d;_0x1a6122=0xc8;}else{_0x1a6122=0xce;}_0xe4d960[_0x677e('0x1f')](_0x1a6122);return _0xe4d960[_0x677e('0x26')](_0x677e('0x27'),_0x4bfbb6+'-'+_0x267aac+'/'+_0x52f65d)[_0x677e('0x21')](_0x1c5124);}return null;};}function patchUpdates(_0x3a7895){return function(_0x52ee8b){try{jsonpatch['apply'](_0x52ee8b,_0x3a7895,!![]);}catch(_0x52d915){return BPromise[_0x677e('0x28')](_0x52d915);}return _0x52ee8b[_0x677e('0x29')]();};}function saveUpdates(_0x31a1e4,_0x540d0e){return function(_0x424e5d){if(_0x424e5d){return _0x424e5d[_0x677e('0x2a')](_0x31a1e4)[_0x677e('0x2b')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x2c51d3,_0x3f0646){return function(_0x5e5397){if(_0x5e5397){return _0x5e5397['destroy']()[_0x677e('0x2b')](function(){var _0x184f68=_0x5e5397['get']({'plain':!![]});var _0x51e39d=_0x677e('0x2c');return db[_0x677e('0x2d')][_0x677e('0x2e')]({'where':{'type':_0x51e39d,'resourceId':_0x184f68['id']}})[_0x677e('0x2b')](function(){return _0x5e5397;});})[_0x677e('0x2b')](function(){_0x2c51d3['status'](0xcc)[_0x677e('0x20')]();});}};}function handleEntityNotFound(_0x2a6033,_0xeca8e2){return function(_0x1e2694){if(!_0x1e2694){_0x2a6033[_0x677e('0x1e')](0x194);}return _0x1e2694;};}function handleError(_0x2bd6fb,_0x9179a0){_0x9179a0=_0x9179a0||0x1f4;return function(_0x10eb66){logger[_0x677e('0x2f')](_0x10eb66['stack']);if(_0x10eb66[_0x677e('0x30')]){delete _0x10eb66[_0x677e('0x30')];}_0x2bd6fb[_0x677e('0x1f')](_0x9179a0)[_0x677e('0x31')](_0x10eb66);};}exports[_0x677e('0x32')]=function(_0x16f516,_0x34bb3d){var _0x65331={},_0x3b875f={},_0x1d9756={'count':0x0,'rows':[]};var _0x4d0c01=_[_0x677e('0x33')](db[_0x677e('0x34')][_0x677e('0x35')],function(_0x2570b9){return{'name':_0x2570b9[_0x677e('0x36')],'type':_0x2570b9[_0x677e('0x37')]['key']};});_0x3b875f[_0x677e('0x38')]=_[_0x677e('0x33')](_0x4d0c01,_0x677e('0x30'));_0x3b875f['query']=_[_0x677e('0x39')](_0x16f516[_0x677e('0x3a')]);_0x3b875f[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],_0x3b875f['query']);_0x65331[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x16f516['query'][_0x677e('0x3e')]));_0x65331[_0x677e('0x3d')]=_0x65331[_0x677e('0x3d')]['length']?_0x65331['attributes']:_0x3b875f[_0x677e('0x38')];if(!_0x16f516[_0x677e('0x3a')]['hasOwnProperty'](_0x677e('0x3f'))){_0x65331[_0x677e('0x24')]=qs['limit'](_0x16f516['query'][_0x677e('0x24')]);_0x65331[_0x677e('0x22')]=qs['offset'](_0x16f516['query'][_0x677e('0x22')]);}_0x65331[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x16f516['query'][_0x677e('0x41')]);_0x65331[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x16f516[_0x677e('0x3a')],_0x3b875f['filters']),_0x4d0c01);if(_0x16f516['query'][_0x677e('0x44')]){_0x65331[_0x677e('0x42')]=_[_0x677e('0x45')](_0x65331[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x4d0c01,function(_0x2f8ebb){if(_0x2f8ebb[_0x677e('0x37')]!==_0x677e('0x46')){var _0x78202e={};_0x78202e[_0x2f8ebb[_0x677e('0x30')]]={'$like':'%'+_0x16f516['query']['filter']+'%'};return _0x78202e;}})});}_0x65331=_[_0x677e('0x45')]({},_0x65331,_0x16f516[_0x677e('0x47')]);var _0x5abab2={'where':_0x65331[_0x677e('0x42')]};return db['SmsQueue'][_0x677e('0x25')](_0x5abab2)[_0x677e('0x2b')](function(_0x283aaa){_0x1d9756[_0x677e('0x25')]=_0x283aaa;if(_0x16f516[_0x677e('0x3a')][_0x677e('0x48')]){_0x65331['include']=[{'all':!![]}];}return db[_0x677e('0x34')][_0x677e('0x49')](_0x65331);})[_0x677e('0x2b')](function(_0x33fce2){_0x1d9756[_0x677e('0x4a')]=_0x33fce2;return _0x1d9756;})[_0x677e('0x2b')](respondWithFilteredResult(_0x34bb3d,_0x65331))['catch'](handleError(_0x34bb3d,null));};exports[_0x677e('0x4b')]=function(_0x5ca3db,_0x3211a9){var _0x2470d0={'raw':!![],'where':{'id':_0x5ca3db[_0x677e('0x4c')]['id']}},_0x3609da={};_0x3609da[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x34')][_0x677e('0x35')]);_0x3609da[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5ca3db['query']);_0x3609da[_0x677e('0x3b')]=_['intersection'](_0x3609da['model'],_0x3609da[_0x677e('0x3a')]);_0x2470d0[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3609da[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5ca3db['query'][_0x677e('0x3e')]));_0x2470d0[_0x677e('0x3d')]=_0x2470d0[_0x677e('0x3d')][_0x677e('0x4d')]?_0x2470d0[_0x677e('0x3d')]:_0x3609da['model'];if(_0x5ca3db[_0x677e('0x3a')][_0x677e('0x48')]){_0x2470d0[_0x677e('0x4e')]=[{'all':!![]}];}_0x2470d0=_['merge']({},_0x2470d0,_0x5ca3db[_0x677e('0x47')]);return db['SmsQueue'][_0x677e('0x4f')](_0x2470d0)['then'](handleEntityNotFound(_0x3211a9,null))['then'](respondWithResult(_0x3211a9,null))[_0x677e('0x50')](handleError(_0x3211a9,null));};exports[_0x677e('0x51')]=function(_0x1f767f,_0x3ff832){return db['SmsQueue'][_0x677e('0x51')](_0x1f767f[_0x677e('0x52')],{})['then'](function(_0x5e93e9){var _0x558d43=_0x1f767f[_0x677e('0x53')][_0x677e('0x54')]({'plain':!![]});if(!_0x558d43)throw new Error(_0x677e('0x55'));if(_0x558d43['role']===_0x677e('0x53')){var _0x4fa910=_0x5e93e9['get']({'plain':!![]});var _0x3bb4d8='SmsQueues';return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'name':_0x3bb4d8,'userProfileId':_0x558d43[_0x677e('0x57')]},'raw':!![]})[_0x677e('0x2b')](function(_0x410012){if(_0x410012&&_0x410012[_0x677e('0x58')]===0x0){return db[_0x677e('0x2d')]['create']({'name':_0x4fa910['name'],'resourceId':_0x4fa910['id'],'type':_0x410012['name'],'sectionId':_0x410012['id']},{})[_0x677e('0x2b')](function(){return _0x5e93e9;});}else{return _0x5e93e9;}})[_0x677e('0x50')](function(_0x108d48){logger[_0x677e('0x2f')](_0x677e('0x59'),_0x108d48);throw _0x108d48;});}return _0x5e93e9;})[_0x677e('0x2b')](respondWithResult(_0x3ff832,0xc9))['catch'](handleError(_0x3ff832,null));};exports[_0x677e('0x2a')]=function(_0xe6654c,_0x5d4ba5){if(_0xe6654c[_0x677e('0x52')]['id']){delete _0xe6654c['body']['id'];}return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0xe6654c[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x5d4ba5,null))['then'](saveUpdates(_0xe6654c[_0x677e('0x52')],null))['then'](respondWithResult(_0x5d4ba5,null))[_0x677e('0x50')](handleError(_0x5d4ba5,null));};exports[_0x677e('0x2e')]=function(_0x6e6f2e,_0x1c6f18){return db[_0x677e('0x34')]['find']({'where':{'id':_0x6e6f2e[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x1c6f18,null))[_0x677e('0x2b')](removeEntity(_0x1c6f18,null))['catch'](handleError(_0x1c6f18,null));};exports[_0x677e('0x5a')]=function(_0x8c6495,_0xaa218d){return db[_0x677e('0x34')][_0x677e('0x5a')]()[_0x677e('0x2b')](respondWithResult(_0xaa218d,null))['catch'](handleError(_0xaa218d,null));};exports[_0x677e('0x5b')]=function(_0x5eb65e,_0x4c48a4,_0x38b717){var _0x52d973={'raw':!![],'where':{}},_0x5ddc5f={},_0x69c67c;return db['SmsQueue'][_0x677e('0x5c')]({'where':{'id':_0x5eb65e[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c48a4,null))[_0x677e('0x2b')](function(_0x100be4){if(_0x100be4){_0x69c67c=_0x100be4[_0x677e('0x54')]({'plain':!![]});_0x5ddc5f[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x5d')]['rawAttributes']);_0x5ddc5f[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5eb65e[_0x677e('0x3a')]);_0x5ddc5f['filters']=_[_0x677e('0x3c')](_0x5ddc5f[_0x677e('0x38')],_0x5ddc5f[_0x677e('0x3a')]);_0x52d973[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x5ddc5f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5eb65e[_0x677e('0x3a')]['fields']));_0x52d973[_0x677e('0x3d')]=_0x52d973[_0x677e('0x3d')][_0x677e('0x4d')]?_0x52d973[_0x677e('0x3d')]:_0x5ddc5f[_0x677e('0x38')];if(!_0x5eb65e['query'][_0x677e('0x5e')](_0x677e('0x3f'))){_0x52d973[_0x677e('0x24')]=qs[_0x677e('0x24')](_0x5eb65e['query'][_0x677e('0x24')]);_0x52d973[_0x677e('0x22')]=qs[_0x677e('0x22')](_0x5eb65e[_0x677e('0x3a')][_0x677e('0x22')]);}_0x52d973[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x5eb65e[_0x677e('0x3a')][_0x677e('0x41')]);_0x52d973[_0x677e('0x42')]=qs[_0x677e('0x3b')](_['pick'](_0x5eb65e['query'],_0x5ddc5f[_0x677e('0x3b')]));_0x52d973[_0x677e('0x42')][_0x677e('0x5f')]=_0x100be4['id'];if(_0x5eb65e[_0x677e('0x3a')][_0x677e('0x44')]){_0x52d973[_0x677e('0x42')]=_['merge'](_0x52d973[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x52d973[_0x677e('0x3d')],function(_0x949a37){var _0x44b96a={};_0x44b96a[_0x949a37]={'$like':'%'+_0x5eb65e[_0x677e('0x3a')]['filter']+'%'};return _0x44b96a;})});}_0x52d973=_[_0x677e('0x45')]({},_0x52d973,_0x5eb65e['options']);return db['UserSmsQueue'][_0x677e('0x49')](_0x52d973);}})['then'](function(_0x49c583){if(_0x49c583){return db['User']['findAndCountAll']({'where':{'id':_[_0x677e('0x33')](_0x49c583,'UserId'),'role':_0x677e('0x60')},'attributes':['id',_0x677e('0x30'),'smsPause',_0x677e('0x61'),_0x677e('0x62')]});}})[_0x677e('0x2b')](function(_0x1f6412){if(_0x1f6412){return{'count':_0x1f6412[_0x677e('0x25')],'rows':_[_0x677e('0x33')](_0x1f6412['rows'],function(_0x15a176){return{'membername':_0x15a176['name'],'UserId':_0x15a176['id'],'queue_name':_0x69c67c[_0x677e('0x30')],'SmsQueueId':_0x69c67c['id'],'interface':util['format'](_0x677e('0x63'),_0x677e('0x64'),_0x15a176[_0x677e('0x30')]),'penalty':0x0,'paused':_0x15a176['smsPause'],'createdAt':_0x15a176['createdAt'],'updatedAt':_0x15a176['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4c48a4,_0x52d973))[_0x677e('0x50')](handleError(_0x4c48a4,null));};exports[_0x677e('0x65')]=function(_0x333634,_0x318eb2,_0xff9fdf){var _0x2f9c58={};var _0x2b1639={};var _0x642312;var _0x337b52;return db[_0x677e('0x34')][_0x677e('0x5c')]({'where':{'id':_0x333634['params']['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x318eb2,null))[_0x677e('0x2b')](function(_0x5b07c5){if(_0x5b07c5){_0x642312=_0x5b07c5;_0x2b1639[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x66')][_0x677e('0x35')]);_0x2b1639[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x333634[_0x677e('0x3a')]);_0x2b1639[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x2b1639['model'],_0x2b1639['query']);_0x2f9c58[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x2b1639[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x333634['query'][_0x677e('0x3e')]));_0x2f9c58[_0x677e('0x3d')]=_0x2f9c58[_0x677e('0x3d')]['length']?_0x2f9c58['attributes']:_0x2b1639['model'];_0x2f9c58[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x333634['query'][_0x677e('0x41')]);_0x2f9c58[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x333634['query'],_0x2b1639['filters']));if(_0x333634[_0x677e('0x3a')][_0x677e('0x44')]){_0x2f9c58[_0x677e('0x42')]=_[_0x677e('0x45')](_0x2f9c58['where'],{'$or':_['map'](_0x2f9c58['attributes'],function(_0x3c2ba0){var _0x24fd7b={};_0x24fd7b[_0x3c2ba0]={'$like':'%'+_0x333634['query']['filter']+'%'};return _0x24fd7b;})});}_0x2f9c58=_[_0x677e('0x45')]({},_0x2f9c58,_0x333634['options']);return _0x642312['getTeams'](_0x2f9c58);}})[_0x677e('0x2b')](function(_0x42746){if(_0x42746){_0x337b52=_0x42746[_0x677e('0x4d')];if(!_0x333634[_0x677e('0x3a')]['hasOwnProperty']('nolimit')){_0x2f9c58['limit']=qs[_0x677e('0x24')](_0x333634[_0x677e('0x3a')][_0x677e('0x24')]);_0x2f9c58[_0x677e('0x22')]=qs[_0x677e('0x22')](_0x333634[_0x677e('0x3a')]['offset']);}return _0x642312[_0x677e('0x65')](_0x2f9c58);}})['then'](function(_0x4b418d){if(_0x4b418d){return _0x4b418d?{'count':_0x337b52,'rows':_0x4b418d}:null;}})[_0x677e('0x2b')](respondWithResult(_0x318eb2,null))[_0x677e('0x50')](handleError(_0x318eb2,null));};exports['addTeams']=function(_0x1f2b4b,_0x22690c,_0x216182){var _0x4df9ba=_0x1f2b4b['body'][_0x677e('0x67')];return db['Team']['findAll']({'where':{'id':_0x4df9ba},'attributes':['id'],'include':[{'model':db[_0x677e('0x68')],'as':_0x677e('0x69'),'attributes':['id',_0x677e('0x30'),'online','voicePause',_0x677e('0x6a')],'raw':!![]}]})[_0x677e('0x2b')](function(_0x387c16){if(_0x387c16){var _0x4ebfa3=_[_0x677e('0x6b')](_0x387c16,function(_0x7edc45){var _0x5c8cd9=_0x7edc45[_0x677e('0x54')]({'plain':!![]});return _0x5c8cd9['Agents'];});return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x1f2b4b['params']['id']}})[_0x677e('0x2b')](function(_0x12cb20){return db[_0x677e('0x6c')]['transaction'](function(_0x565b36){return _0x12cb20['addTeams'](_0x4df9ba,{'transaction':_0x565b36})[_0x677e('0x2b')](function(){return BPromise[_0x677e('0x6d')](_0x4ebfa3,function(_0x17859a){return db[_0x677e('0x5d')][_0x677e('0x6e')]({'where':{'UserId':_0x17859a['id'],'SmsQueueId':_0x1f2b4b[_0x677e('0x4c')]['id']},'transaction':_0x565b36});});})[_0x677e('0x2b')](function(){_0x4ebfa3[_0x677e('0x6f')](function(_0x31ed60){socket[_0x677e('0x70')](_0x677e('0x71'),{'UserId':_0x31ed60['id'],'SmsQueueId':_0x12cb20['id']});});});});});}})[_0x677e('0x2b')](respondWithStatusCode(_0x22690c,null))['catch'](handleError(_0x22690c,null));};exports[_0x677e('0x72')]=function(_0x585593,_0x59bded,_0x487107){return db[_0x677e('0x66')][_0x677e('0x49')]({'where':{'id':_0x585593[_0x677e('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x677e('0x68')],'as':_0x677e('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59bded,null))['then'](function(_0x32edc3){var _0x59cf17=_[_0x677e('0x33')](_0x32edc3,'id');var _0x4b6280=[];var _0x1cf5a8=[];var _0x2171ec=squel['select']();_0x2171ec[_0x677e('0x73')](_0x677e('0x74'))[_0x677e('0x75')](_0x677e('0x76'),'tq')[_0x677e('0x77')](_0x677e('0x78'),'ut',_0x677e('0x79'))[_0x677e('0x42')](_0x677e('0x7a'),_0x585593[_0x677e('0x4c')]['id']);for(var _0x5a1b4a=0x0;_0x5a1b4a<_0x32edc3['length'];_0x5a1b4a+=0x1){let _0x31dd93=_0x32edc3[_0x5a1b4a];for(var _0x18bc64=0x0;_0x18bc64<_0x31dd93[_0x677e('0x69')]['length'];_0x18bc64+=0x1){let _0x1f5918=_0x31dd93[_0x677e('0x69')][_0x18bc64];var _0x12f311=_0x2171ec[_0x677e('0x7b')]();_0x12f311['where'](_0x677e('0x7c'),_0x1f5918['id']);_0x1cf5a8[_0x677e('0x7d')](db[_0x677e('0x6c')][_0x677e('0x3a')](_0x12f311['toString'](),{'type':db['sequelize'][_0x677e('0x7e')][_0x677e('0x7f')]})['then'](function(_0x368f80){if(_0x368f80[_0x677e('0x4d')]===0x1){return _0x1f5918['id'];}else{var _0x41968b=_[_0x677e('0x80')](_[_0x677e('0x33')](_0x368f80,_0x677e('0x81')),function(_0x36901a){return _[_0x677e('0x82')](_0x59cf17,_0x36901a);});if(_0x41968b){return _0x1f5918['id'];}}}));}}return BPromise[_0x677e('0x83')](_0x1cf5a8)[_0x677e('0x2b')](function(_0x4a6a8c){_0x4b6280=_(_0x4b6280)[_0x677e('0x84')](_0x4a6a8c)[_0x677e('0x85')]()[_0x677e('0x86')]();return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x585593['params']['id']}})[_0x677e('0x2b')](function(_0x6f2bee){return db['sequelize'][_0x677e('0x87')](function(_0x17c944){return _0x6f2bee[_0x677e('0x72')](_0x585593[_0x677e('0x3a')]['ids'],{'transaction':_0x17c944})[_0x677e('0x2b')](function(){if(!_[_0x677e('0x88')](_0x4b6280)){return _0x6f2bee['removeAgents'](_0x4b6280,{'transaction':_0x17c944});}})[_0x677e('0x2b')](function(){_0x4b6280[_0x677e('0x6f')](function(_0xf8fae6){socket[_0x677e('0x70')](_0x677e('0x89'),{'UserId':_0xf8fae6,'SmsQueueId':_0x6f2bee['id']});});});});});});})['then'](respondWithStatusCode(_0x59bded,null))[_0x677e('0x50')](handleError(_0x59bded,null));};exports[_0x677e('0x8a')]=function(_0x82371a,_0x49ed9c,_0x218773){return db[_0x677e('0x34')]['find']({'where':{'id':_0x82371a[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x49ed9c,null))['then'](function(_0xfc07b9){if(_0xfc07b9){return _0xfc07b9[_0x677e('0x8a')](_0x82371a[_0x677e('0x52')][_0x677e('0x67')],_[_0x677e('0x8b')](_0x82371a[_0x677e('0x52')],['ids','id'])||{})[_0x677e('0x8c')](function(_0x79e0ea){for(var _0x50a65f=0x0;_0x50a65f<_0x82371a[_0x677e('0x52')]['ids']['length'];_0x50a65f+=0x1){socket['emit'](_0x677e('0x71'),{'UserId':Number(_0x82371a[_0x677e('0x52')][_0x677e('0x67')][_0x50a65f]),'SmsQueueId':Number(_0x82371a[_0x677e('0x4c')]['id'])});}return _0x79e0ea;});}})['then'](respondWithResult(_0x49ed9c,null))['catch'](handleError(_0x49ed9c,null));};exports[_0x677e('0x8d')]=function(_0x316104,_0x48c59e,_0x122a82){return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x316104[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48c59e,null))[_0x677e('0x2b')](function(_0x4a5ded){if(_0x4a5ded){return _0x4a5ded[_0x677e('0x8d')](_0x316104['query']['ids'])[_0x677e('0x2b')](function(){if(_[_0x677e('0x8e')](_0x316104[_0x677e('0x3a')][_0x677e('0x67')])){for(var _0x11f41a=0x0;_0x11f41a<_0x316104[_0x677e('0x3a')][_0x677e('0x67')][_0x677e('0x4d')];_0x11f41a+=0x1){socket[_0x677e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x316104[_0x677e('0x3a')][_0x677e('0x67')][_0x11f41a]),'SmsQueueId':Number(_0x316104['params']['id'])});}}else{socket[_0x677e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x316104[_0x677e('0x3a')][_0x677e('0x67')]),'SmsQueueId':Number(_0x316104[_0x677e('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x48c59e,null))[_0x677e('0x50')](handleError(_0x48c59e,null));};exports[_0x677e('0x8f')]=function(_0xd330fa,_0x45fcdb,_0x335c41){var _0x3cf834={};var _0x237320={};var _0x19de60;var _0xe8559e;return db[_0x677e('0x34')][_0x677e('0x5c')]({'where':{'id':_0xd330fa[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x45fcdb,null))[_0x677e('0x2b')](function(_0x477428){if(_0x477428){_0x19de60=_0x477428;_0x237320[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x68')]['rawAttributes']);_0x237320[_0x677e('0x3a')]=_[_0x677e('0x39')](_0xd330fa[_0x677e('0x3a')]);_0x237320[_0x677e('0x3b')]=_['intersection'](_0x237320['model'],_0x237320[_0x677e('0x3a')]);_0x3cf834[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x237320[_0x677e('0x38')],qs[_0x677e('0x3e')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x3e')]));_0x3cf834[_0x677e('0x3d')]=_0x3cf834['attributes']['length']?_0x3cf834[_0x677e('0x3d')]:_0x237320[_0x677e('0x38')];_0x3cf834[_0x677e('0x40')]=qs[_0x677e('0x41')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x41')]);_0x3cf834['where']=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0xd330fa[_0x677e('0x3a')],_0x237320[_0x677e('0x3b')]));if(_0xd330fa[_0x677e('0x3a')][_0x677e('0x44')]){_0x3cf834[_0x677e('0x42')]=_['merge'](_0x3cf834['where'],{'$or':_[_0x677e('0x33')](_0x3cf834[_0x677e('0x3d')],function(_0x2a2386){var _0x949975={};_0x949975[_0x2a2386]={'$like':'%'+_0xd330fa[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x949975;})});}_0x3cf834=_[_0x677e('0x45')]({},_0x3cf834,_0xd330fa[_0x677e('0x47')]);return _0x19de60[_0x677e('0x8f')](_0x3cf834);}})[_0x677e('0x2b')](function(_0x2a163e){if(_0x2a163e){_0xe8559e=_0x2a163e['length'];if(!_0xd330fa[_0x677e('0x3a')][_0x677e('0x5e')]('nolimit')){_0x3cf834[_0x677e('0x24')]=qs[_0x677e('0x24')](_0xd330fa[_0x677e('0x3a')]['limit']);_0x3cf834[_0x677e('0x22')]=qs[_0x677e('0x22')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x19de60['getAgents'](_0x3cf834);}})[_0x677e('0x2b')](function(_0x50acd9){if(_0x50acd9){return _0x50acd9?{'count':_0xe8559e,'rows':_0x50acd9}:null;}})['then'](respondWithResult(_0x45fcdb,null))[_0x677e('0x50')](handleError(_0x45fcdb,null));}; \ No newline at end of file +var _0x5e17=['request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','SmsQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','name','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','UserId','agent','smsPause','updatedAt','SIP','getTeams','Team','pick','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userSmsQueue:save','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','isArray','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x145650,_0x508a18){var _0x23840c=function(_0x3040a9){while(--_0x3040a9){_0x145650['push'](_0x145650['shift']());}};_0x23840c(++_0x508a18);}(_0x5e17,0x1a0));var _0x75e1=function(_0x457a68,_0x107837){_0x457a68=_0x457a68-0x0;var _0xe6038=_0x5e17[_0x457a68];return _0xe6038;};'use strict';var emlformat=require(_0x75e1('0x0'));var rimraf=require(_0x75e1('0x1'));var zipdir=require(_0x75e1('0x2'));var jsonpatch=require(_0x75e1('0x3'));var rp=require(_0x75e1('0x4'));var moment=require('moment');var BPromise=require(_0x75e1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x75e1('0x6'));var sox=require('sox');var csv=require(_0x75e1('0x7'));var ejs=require(_0x75e1('0x8'));var fs=require('fs');var fs_extra=require(_0x75e1('0x9'));var _=require(_0x75e1('0xa'));var squel=require(_0x75e1('0xb'));var crypto=require('crypto');var jsforce=require(_0x75e1('0xc'));var deskjs=require(_0x75e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x75e1('0xe'));var Papa=require(_0x75e1('0xf'));var Redis=require(_0x75e1('0x10'));var authService=require(_0x75e1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x75e1('0x12'));var hardwareService=require(_0x75e1('0x13'));var logger=require(_0x75e1('0x14'))(_0x75e1('0x15'));var utils=require(_0x75e1('0x16'));var config=require(_0x75e1('0x17'));var licenseUtil=require(_0x75e1('0x18'));var db=require(_0x75e1('0x19'))['db'];config[_0x75e1('0x1a')]=_[_0x75e1('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x75e1('0x1c'))(new Redis(config[_0x75e1('0x1a')]));require(_0x75e1('0x1d'))[_0x75e1('0x1e')](socket);function respondWithStatusCode(_0x5c9fa3,_0x3ec418){_0x3ec418=_0x3ec418||0xcc;return function(_0x5db608){if(_0x5db608){return _0x5c9fa3[_0x75e1('0x1f')](_0x3ec418);}return _0x5c9fa3['status'](_0x3ec418)[_0x75e1('0x20')]();};}function respondWithResult(_0x4959dc,_0x305a83){_0x305a83=_0x305a83||0xc8;return function(_0x3a9b37){if(_0x3a9b37){return _0x4959dc[_0x75e1('0x21')](_0x305a83)[_0x75e1('0x22')](_0x3a9b37);}};}function respondWithFilteredResult(_0x42c535,_0x53b5fc){return function(_0x3bf368){if(_0x3bf368){var _0x266a22=typeof _0x53b5fc['offset']==='undefined'&&typeof _0x53b5fc[_0x75e1('0x23')]===_0x75e1('0x24');var _0x47160b=_0x3bf368[_0x75e1('0x25')];var _0x321916=_0x266a22?0x0:_0x53b5fc['offset'];var _0x3ec26e=_0x266a22?_0x3bf368[_0x75e1('0x25')]:_0x53b5fc[_0x75e1('0x26')]+_0x53b5fc[_0x75e1('0x23')];var _0x3b7b14;if(_0x3ec26e>=_0x47160b){_0x3ec26e=_0x47160b;_0x3b7b14=0xc8;}else{_0x3b7b14=0xce;}_0x42c535[_0x75e1('0x21')](_0x3b7b14);return _0x42c535[_0x75e1('0x27')](_0x75e1('0x28'),_0x321916+'-'+_0x3ec26e+'/'+_0x47160b)[_0x75e1('0x22')](_0x3bf368);}return null;};}function patchUpdates(_0x4c2217){return function(_0x108ca6){try{jsonpatch[_0x75e1('0x29')](_0x108ca6,_0x4c2217,!![]);}catch(_0x2e1dd3){return BPromise['reject'](_0x2e1dd3);}return _0x108ca6[_0x75e1('0x2a')]();};}function saveUpdates(_0x4fdf94,_0x5eff29){return function(_0x5112c5){if(_0x5112c5){return _0x5112c5[_0x75e1('0x2b')](_0x4fdf94)[_0x75e1('0x2c')](function(_0x337610){return _0x337610;});}return null;};}function removeEntity(_0x4d3937,_0x40ae8a){return function(_0x25a960){if(_0x25a960){return _0x25a960[_0x75e1('0x2d')]()[_0x75e1('0x2c')](function(){var _0x187d57=_0x25a960[_0x75e1('0x2e')]({'plain':!![]});var _0x343484='SmsQueues';return db[_0x75e1('0x2f')][_0x75e1('0x2d')]({'where':{'type':_0x343484,'resourceId':_0x187d57['id']}})['then'](function(){return _0x25a960;});})[_0x75e1('0x2c')](function(){_0x4d3937[_0x75e1('0x21')](0xcc)[_0x75e1('0x20')]();});}};}function handleEntityNotFound(_0x17fc9c,_0x18cd97){return function(_0x36ef69){if(!_0x36ef69){_0x17fc9c[_0x75e1('0x1f')](0x194);}return _0x36ef69;};}function handleError(_0x478eca,_0x5e8a50){_0x5e8a50=_0x5e8a50||0x1f4;return function(_0x206dc9){logger[_0x75e1('0x30')](_0x206dc9[_0x75e1('0x31')]);if(_0x206dc9['name']){delete _0x206dc9['name'];}_0x478eca[_0x75e1('0x21')](_0x5e8a50)[_0x75e1('0x32')](_0x206dc9);};}exports[_0x75e1('0x33')]=function(_0x5867bc,_0x238b29){var _0x2f57c1={},_0x22b6f9={},_0x228195={'count':0x0,'rows':[]};var _0x3c2bb8=_[_0x75e1('0x34')](db[_0x75e1('0x35')][_0x75e1('0x36')],function(_0x5091de){return{'name':_0x5091de[_0x75e1('0x37')],'type':_0x5091de['type']['key']};});_0x22b6f9[_0x75e1('0x38')]=_['map'](_0x3c2bb8,'name');_0x22b6f9['query']=_['keys'](_0x5867bc[_0x75e1('0x39')]);_0x22b6f9[_0x75e1('0x3a')]=_[_0x75e1('0x3b')](_0x22b6f9[_0x75e1('0x38')],_0x22b6f9['query']);_0x2f57c1[_0x75e1('0x3c')]=_[_0x75e1('0x3b')](_0x22b6f9['model'],qs['fields'](_0x5867bc['query'][_0x75e1('0x3d')]));_0x2f57c1[_0x75e1('0x3c')]=_0x2f57c1[_0x75e1('0x3c')][_0x75e1('0x3e')]?_0x2f57c1[_0x75e1('0x3c')]:_0x22b6f9['model'];if(!_0x5867bc[_0x75e1('0x39')][_0x75e1('0x3f')](_0x75e1('0x40'))){_0x2f57c1['limit']=qs[_0x75e1('0x23')](_0x5867bc[_0x75e1('0x39')][_0x75e1('0x23')]);_0x2f57c1[_0x75e1('0x26')]=qs[_0x75e1('0x26')](_0x5867bc['query'][_0x75e1('0x26')]);}_0x2f57c1[_0x75e1('0x41')]=qs[_0x75e1('0x42')](_0x5867bc[_0x75e1('0x39')][_0x75e1('0x42')]);_0x2f57c1[_0x75e1('0x43')]=qs[_0x75e1('0x3a')](_['pick'](_0x5867bc[_0x75e1('0x39')],_0x22b6f9[_0x75e1('0x3a')]),_0x3c2bb8);if(_0x5867bc[_0x75e1('0x39')][_0x75e1('0x44')]){_0x2f57c1[_0x75e1('0x43')]=_['merge'](_0x2f57c1[_0x75e1('0x43')],{'$or':_[_0x75e1('0x34')](_0x3c2bb8,function(_0x553729){if(_0x553729[_0x75e1('0x45')]!==_0x75e1('0x46')){var _0x523509={};_0x523509[_0x553729[_0x75e1('0x47')]]={'$like':'%'+_0x5867bc[_0x75e1('0x39')][_0x75e1('0x44')]+'%'};return _0x523509;}})});}_0x2f57c1=_[_0x75e1('0x48')]({},_0x2f57c1,_0x5867bc[_0x75e1('0x49')]);var _0x52e5b3={'where':_0x2f57c1[_0x75e1('0x43')]};return db['SmsQueue'][_0x75e1('0x25')](_0x52e5b3)[_0x75e1('0x2c')](function(_0xd5c4c7){_0x228195[_0x75e1('0x25')]=_0xd5c4c7;if(_0x5867bc[_0x75e1('0x39')][_0x75e1('0x4a')]){_0x2f57c1['include']=[{'all':!![]}];}return db[_0x75e1('0x35')][_0x75e1('0x4b')](_0x2f57c1);})['then'](function(_0x1ffb4b){_0x228195[_0x75e1('0x4c')]=_0x1ffb4b;return _0x228195;})[_0x75e1('0x2c')](respondWithFilteredResult(_0x238b29,_0x2f57c1))[_0x75e1('0x4d')](handleError(_0x238b29,null));};exports[_0x75e1('0x4e')]=function(_0x28130d,_0x24a401){var _0x41ebac={'raw':!![],'where':{'id':_0x28130d[_0x75e1('0x4f')]['id']}},_0x1285f1={};_0x1285f1[_0x75e1('0x38')]=_[_0x75e1('0x50')](db[_0x75e1('0x35')][_0x75e1('0x36')]);_0x1285f1['query']=_[_0x75e1('0x50')](_0x28130d[_0x75e1('0x39')]);_0x1285f1[_0x75e1('0x3a')]=_['intersection'](_0x1285f1['model'],_0x1285f1[_0x75e1('0x39')]);_0x41ebac[_0x75e1('0x3c')]=_[_0x75e1('0x3b')](_0x1285f1[_0x75e1('0x38')],qs['fields'](_0x28130d[_0x75e1('0x39')][_0x75e1('0x3d')]));_0x41ebac[_0x75e1('0x3c')]=_0x41ebac[_0x75e1('0x3c')][_0x75e1('0x3e')]?_0x41ebac['attributes']:_0x1285f1[_0x75e1('0x38')];if(_0x28130d[_0x75e1('0x39')][_0x75e1('0x4a')]){_0x41ebac[_0x75e1('0x51')]=[{'all':!![]}];}_0x41ebac=_[_0x75e1('0x48')]({},_0x41ebac,_0x28130d[_0x75e1('0x49')]);return db[_0x75e1('0x35')][_0x75e1('0x52')](_0x41ebac)['then'](handleEntityNotFound(_0x24a401,null))[_0x75e1('0x2c')](respondWithResult(_0x24a401,null))['catch'](handleError(_0x24a401,null));};exports[_0x75e1('0x53')]=function(_0x41a8cd,_0xefd3a7){return db[_0x75e1('0x35')][_0x75e1('0x53')](_0x41a8cd['body'],{})[_0x75e1('0x2c')](function(_0x47510e){var _0x40685b=_0x41a8cd['user'][_0x75e1('0x2e')]({'plain':!![]});if(!_0x40685b)throw new Error(_0x75e1('0x54'));if(_0x40685b[_0x75e1('0x55')]===_0x75e1('0x56')){var _0x9127a0=_0x47510e['get']({'plain':!![]});var _0x415484='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x415484,'userProfileId':_0x40685b[_0x75e1('0x57')]},'raw':!![]})[_0x75e1('0x2c')](function(_0x555743){if(_0x555743&&_0x555743[_0x75e1('0x58')]===0x0){return db['UserProfileResource'][_0x75e1('0x53')]({'name':_0x9127a0['name'],'resourceId':_0x9127a0['id'],'type':_0x555743[_0x75e1('0x47')],'sectionId':_0x555743['id']},{})[_0x75e1('0x2c')](function(){return _0x47510e;});}else{return _0x47510e;}})[_0x75e1('0x4d')](function(_0x359371){logger[_0x75e1('0x30')](_0x75e1('0x59'),_0x359371);throw _0x359371;});}return _0x47510e;})[_0x75e1('0x2c')](respondWithResult(_0xefd3a7,0xc9))[_0x75e1('0x4d')](handleError(_0xefd3a7,null));};exports['update']=function(_0x3285ac,_0x21aa89){if(_0x3285ac[_0x75e1('0x5a')]['id']){delete _0x3285ac[_0x75e1('0x5a')]['id'];}return db[_0x75e1('0x35')]['find']({'where':{'id':_0x3285ac['params']['id']}})[_0x75e1('0x2c')](handleEntityNotFound(_0x21aa89,null))[_0x75e1('0x2c')](saveUpdates(_0x3285ac['body'],null))[_0x75e1('0x2c')](respondWithResult(_0x21aa89,null))[_0x75e1('0x4d')](handleError(_0x21aa89,null));};exports[_0x75e1('0x2d')]=function(_0x4a8dda,_0x4ba27b){return db[_0x75e1('0x35')][_0x75e1('0x52')]({'where':{'id':_0x4a8dda[_0x75e1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4ba27b,null))[_0x75e1('0x2c')](removeEntity(_0x4ba27b,null))[_0x75e1('0x4d')](handleError(_0x4ba27b,null));};exports[_0x75e1('0x5b')]=function(_0x5f411b,_0x26efad){return db[_0x75e1('0x35')]['describe']()[_0x75e1('0x2c')](respondWithResult(_0x26efad,null))[_0x75e1('0x4d')](handleError(_0x26efad,null));};exports[_0x75e1('0x5c')]=function(_0x101a63,_0x511da8,_0xf1d2e7){var _0x4cbc1a={'raw':!![],'where':{}},_0x334cf6={},_0x1bbe25;return db[_0x75e1('0x35')][_0x75e1('0x5d')]({'where':{'id':_0x101a63[_0x75e1('0x4f')]['id']}})[_0x75e1('0x2c')](handleEntityNotFound(_0x511da8,null))[_0x75e1('0x2c')](function(_0x3430ca){if(_0x3430ca){_0x1bbe25=_0x3430ca[_0x75e1('0x2e')]({'plain':!![]});_0x334cf6[_0x75e1('0x38')]=_[_0x75e1('0x50')](db[_0x75e1('0x5e')][_0x75e1('0x36')]);_0x334cf6[_0x75e1('0x39')]=_[_0x75e1('0x50')](_0x101a63[_0x75e1('0x39')]);_0x334cf6[_0x75e1('0x3a')]=_[_0x75e1('0x3b')](_0x334cf6[_0x75e1('0x38')],_0x334cf6[_0x75e1('0x39')]);_0x4cbc1a['attributes']=_[_0x75e1('0x3b')](_0x334cf6[_0x75e1('0x38')],qs[_0x75e1('0x3d')](_0x101a63['query']['fields']));_0x4cbc1a['attributes']=_0x4cbc1a[_0x75e1('0x3c')][_0x75e1('0x3e')]?_0x4cbc1a[_0x75e1('0x3c')]:_0x334cf6[_0x75e1('0x38')];if(!_0x101a63[_0x75e1('0x39')][_0x75e1('0x3f')](_0x75e1('0x40'))){_0x4cbc1a['limit']=qs[_0x75e1('0x23')](_0x101a63[_0x75e1('0x39')]['limit']);_0x4cbc1a[_0x75e1('0x26')]=qs[_0x75e1('0x26')](_0x101a63[_0x75e1('0x39')][_0x75e1('0x26')]);}_0x4cbc1a['order']=qs[_0x75e1('0x42')](_0x101a63[_0x75e1('0x39')][_0x75e1('0x42')]);_0x4cbc1a['where']=qs[_0x75e1('0x3a')](_['pick'](_0x101a63[_0x75e1('0x39')],_0x334cf6[_0x75e1('0x3a')]));_0x4cbc1a[_0x75e1('0x43')][_0x75e1('0x5f')]=_0x3430ca['id'];if(_0x101a63[_0x75e1('0x39')]['filter']){_0x4cbc1a[_0x75e1('0x43')]=_[_0x75e1('0x48')](_0x4cbc1a[_0x75e1('0x43')],{'$or':_[_0x75e1('0x34')](_0x4cbc1a['attributes'],function(_0x3549ea){var _0x5cedf0={};_0x5cedf0[_0x3549ea]={'$like':'%'+_0x101a63[_0x75e1('0x39')][_0x75e1('0x44')]+'%'};return _0x5cedf0;})});}_0x4cbc1a=_['merge']({},_0x4cbc1a,_0x101a63['options']);return db[_0x75e1('0x5e')][_0x75e1('0x4b')](_0x4cbc1a);}})['then'](function(_0x5e7985){if(_0x5e7985){return db[_0x75e1('0x60')]['findAndCountAll']({'where':{'id':_['map'](_0x5e7985,_0x75e1('0x61')),'role':_0x75e1('0x62')},'attributes':['id',_0x75e1('0x47'),_0x75e1('0x63'),_0x75e1('0x64'),'createdAt']});}})['then'](function(_0x38f305){if(_0x38f305){return{'count':_0x38f305[_0x75e1('0x25')],'rows':_[_0x75e1('0x34')](_0x38f305[_0x75e1('0x4c')],function(_0x9d0dfa){return{'membername':_0x9d0dfa[_0x75e1('0x47')],'UserId':_0x9d0dfa['id'],'queue_name':_0x1bbe25['name'],'SmsQueueId':_0x1bbe25['id'],'interface':util['format']('%s/%s',_0x75e1('0x65'),_0x9d0dfa[_0x75e1('0x47')]),'penalty':0x0,'paused':_0x9d0dfa[_0x75e1('0x63')],'createdAt':_0x9d0dfa['createdAt'],'updatedAt':_0x9d0dfa[_0x75e1('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x511da8,_0x4cbc1a))['catch'](handleError(_0x511da8,null));};exports[_0x75e1('0x66')]=function(_0x40c033,_0x7d1d51,_0x559bea){var _0x2cf453={};var _0x279c31={};var _0x178910;var _0x229457;return db[_0x75e1('0x35')][_0x75e1('0x5d')]({'where':{'id':_0x40c033['params']['id']}})[_0x75e1('0x2c')](handleEntityNotFound(_0x7d1d51,null))['then'](function(_0x1b5190){if(_0x1b5190){_0x178910=_0x1b5190;_0x279c31[_0x75e1('0x38')]=_[_0x75e1('0x50')](db[_0x75e1('0x67')][_0x75e1('0x36')]);_0x279c31[_0x75e1('0x39')]=_[_0x75e1('0x50')](_0x40c033[_0x75e1('0x39')]);_0x279c31[_0x75e1('0x3a')]=_[_0x75e1('0x3b')](_0x279c31[_0x75e1('0x38')],_0x279c31[_0x75e1('0x39')]);_0x2cf453[_0x75e1('0x3c')]=_['intersection'](_0x279c31[_0x75e1('0x38')],qs[_0x75e1('0x3d')](_0x40c033[_0x75e1('0x39')][_0x75e1('0x3d')]));_0x2cf453[_0x75e1('0x3c')]=_0x2cf453[_0x75e1('0x3c')]['length']?_0x2cf453['attributes']:_0x279c31[_0x75e1('0x38')];_0x2cf453['order']=qs[_0x75e1('0x42')](_0x40c033['query']['sort']);_0x2cf453['where']=qs['filters'](_[_0x75e1('0x68')](_0x40c033[_0x75e1('0x39')],_0x279c31[_0x75e1('0x3a')]));if(_0x40c033[_0x75e1('0x39')][_0x75e1('0x44')]){_0x2cf453['where']=_[_0x75e1('0x48')](_0x2cf453[_0x75e1('0x43')],{'$or':_[_0x75e1('0x34')](_0x2cf453[_0x75e1('0x3c')],function(_0x5380a6){var _0x5e4557={};_0x5e4557[_0x5380a6]={'$like':'%'+_0x40c033[_0x75e1('0x39')][_0x75e1('0x44')]+'%'};return _0x5e4557;})});}_0x2cf453=_[_0x75e1('0x48')]({},_0x2cf453,_0x40c033[_0x75e1('0x49')]);return _0x178910[_0x75e1('0x66')](_0x2cf453);}})[_0x75e1('0x2c')](function(_0x4a9325){if(_0x4a9325){_0x229457=_0x4a9325[_0x75e1('0x3e')];if(!_0x40c033[_0x75e1('0x39')][_0x75e1('0x3f')](_0x75e1('0x40'))){_0x2cf453[_0x75e1('0x23')]=qs[_0x75e1('0x23')](_0x40c033[_0x75e1('0x39')][_0x75e1('0x23')]);_0x2cf453[_0x75e1('0x26')]=qs['offset'](_0x40c033[_0x75e1('0x39')][_0x75e1('0x26')]);}return _0x178910[_0x75e1('0x66')](_0x2cf453);}})[_0x75e1('0x2c')](function(_0x3433cb){if(_0x3433cb){return _0x3433cb?{'count':_0x229457,'rows':_0x3433cb}:null;}})[_0x75e1('0x2c')](respondWithResult(_0x7d1d51,null))[_0x75e1('0x4d')](handleError(_0x7d1d51,null));};exports['addTeams']=function(_0x4bec10,_0x4bfe31,_0x2a9f02){var _0x159d8a=_0x4bec10[_0x75e1('0x5a')]['ids'];return db['Team'][_0x75e1('0x4b')]({'where':{'id':_0x159d8a},'attributes':['id'],'include':[{'model':db[_0x75e1('0x60')],'as':_0x75e1('0x69'),'attributes':['id',_0x75e1('0x47'),_0x75e1('0x6a'),_0x75e1('0x6b'),_0x75e1('0x6c')],'raw':!![]}]})[_0x75e1('0x2c')](function(_0x314582){if(_0x314582){var _0x6fd226=_[_0x75e1('0x6d')](_0x314582,function(_0x2f338d){var _0x15a711=_0x2f338d[_0x75e1('0x2e')]({'plain':!![]});return _0x15a711[_0x75e1('0x69')];});return db[_0x75e1('0x35')][_0x75e1('0x52')]({'where':{'id':_0x4bec10[_0x75e1('0x4f')]['id']}})[_0x75e1('0x2c')](function(_0x48b8a7){return db[_0x75e1('0x6e')][_0x75e1('0x6f')](function(_0xf6b318){return _0x48b8a7['addTeams'](_0x159d8a,{'transaction':_0xf6b318})['then'](function(){return BPromise[_0x75e1('0x70')](_0x6fd226,function(_0x381bba){return db['UserSmsQueue'][_0x75e1('0x71')]({'where':{'UserId':_0x381bba['id'],'SmsQueueId':_0x4bec10[_0x75e1('0x4f')]['id']},'transaction':_0xf6b318});});})['then'](function(){_0x6fd226['forEach'](function(_0x5e3ff7){socket['emit'](_0x75e1('0x72'),{'UserId':_0x5e3ff7['id'],'SmsQueueId':_0x48b8a7['id']});});});});});}})[_0x75e1('0x2c')](respondWithStatusCode(_0x4bfe31,null))[_0x75e1('0x4d')](handleError(_0x4bfe31,null));};exports['removeTeams']=function(_0x1db95a,_0x584b24,_0x3939ec){return db[_0x75e1('0x67')][_0x75e1('0x4b')]({'where':{'id':_0x1db95a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x75e1('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x584b24,null))[_0x75e1('0x2c')](function(_0x5608b1){var _0x24ad6f=_[_0x75e1('0x34')](_0x5608b1,'id');var _0x5a986c=[];var _0x4f26ab=[];var _0x2afe80=squel[_0x75e1('0x73')]();_0x2afe80['field'](_0x75e1('0x74'))['from'](_0x75e1('0x75'),'tq')[_0x75e1('0x76')](_0x75e1('0x77'),'ut',_0x75e1('0x78'))[_0x75e1('0x43')]('SmsQueueId\x20=\x20?',_0x1db95a[_0x75e1('0x4f')]['id']);for(var _0x38e374=0x0;_0x38e374<_0x5608b1['length'];_0x38e374+=0x1){let _0x54cf3d=_0x5608b1[_0x38e374];for(var _0x1a6fe1=0x0;_0x1a6fe1<_0x54cf3d['Agents'][_0x75e1('0x3e')];_0x1a6fe1+=0x1){let _0x554f83=_0x54cf3d['Agents'][_0x1a6fe1];var _0x5ef0f1=_0x2afe80[_0x75e1('0x79')]();_0x5ef0f1[_0x75e1('0x43')](_0x75e1('0x7a'),_0x554f83['id']);_0x4f26ab['push'](db[_0x75e1('0x6e')][_0x75e1('0x39')](_0x5ef0f1[_0x75e1('0x7b')](),{'type':db[_0x75e1('0x6e')]['QueryTypes']['SELECT']})[_0x75e1('0x2c')](function(_0x189d15){if(_0x189d15[_0x75e1('0x3e')]===0x1){return _0x554f83['id'];}else{var _0x2ae5d7=_[_0x75e1('0x7c')](_[_0x75e1('0x34')](_0x189d15,_0x75e1('0x7d')),function(_0x579897){return _[_0x75e1('0x7e')](_0x24ad6f,_0x579897);});if(_0x2ae5d7){return _0x554f83['id'];}}}));}}return BPromise[_0x75e1('0x7f')](_0x4f26ab)[_0x75e1('0x2c')](function(_0x1e8f8d){_0x5a986c=_(_0x5a986c)[_0x75e1('0x80')](_0x1e8f8d)[_0x75e1('0x81')]()[_0x75e1('0x82')]();return db['SmsQueue']['find']({'where':{'id':_0x1db95a[_0x75e1('0x4f')]['id']}})[_0x75e1('0x2c')](function(_0x176c06){return db[_0x75e1('0x6e')]['transaction'](function(_0x38683b){return _0x176c06[_0x75e1('0x83')](_0x1db95a[_0x75e1('0x39')][_0x75e1('0x84')],{'transaction':_0x38683b})['then'](function(){if(!_[_0x75e1('0x85')](_0x5a986c)){return _0x176c06[_0x75e1('0x86')](_0x5a986c,{'transaction':_0x38683b});}})['then'](function(){_0x5a986c['forEach'](function(_0x2d3b5a){socket[_0x75e1('0x87')](_0x75e1('0x88'),{'UserId':_0x2d3b5a,'SmsQueueId':_0x176c06['id']});});});});});});})[_0x75e1('0x2c')](respondWithStatusCode(_0x584b24,null))[_0x75e1('0x4d')](handleError(_0x584b24,null));};exports[_0x75e1('0x89')]=function(_0x54c9cf,_0x5b1072,_0x1719a6){return db[_0x75e1('0x35')]['find']({'where':{'id':_0x54c9cf['params']['id']}})[_0x75e1('0x2c')](handleEntityNotFound(_0x5b1072,null))['then'](function(_0x151cb9){if(_0x151cb9){return _0x151cb9[_0x75e1('0x89')](_0x54c9cf[_0x75e1('0x5a')][_0x75e1('0x84')],_[_0x75e1('0x8a')](_0x54c9cf[_0x75e1('0x5a')],[_0x75e1('0x84'),'id'])||{})['spread'](function(_0x3bbfc7){for(var _0x4f4b40=0x0;_0x4f4b40<_0x54c9cf[_0x75e1('0x5a')][_0x75e1('0x84')][_0x75e1('0x3e')];_0x4f4b40+=0x1){socket['emit'](_0x75e1('0x72'),{'UserId':Number(_0x54c9cf[_0x75e1('0x5a')]['ids'][_0x4f4b40]),'SmsQueueId':Number(_0x54c9cf[_0x75e1('0x4f')]['id'])});}return _0x3bbfc7;});}})[_0x75e1('0x2c')](respondWithResult(_0x5b1072,null))[_0x75e1('0x4d')](handleError(_0x5b1072,null));};exports['removeAgents']=function(_0x30c519,_0xeb7c8d,_0x1a8121){return db['SmsQueue']['find']({'where':{'id':_0x30c519[_0x75e1('0x4f')]['id']}})['then'](handleEntityNotFound(_0xeb7c8d,null))['then'](function(_0xf107f0){if(_0xf107f0){return _0xf107f0['removeAgents'](_0x30c519[_0x75e1('0x39')][_0x75e1('0x84')])[_0x75e1('0x2c')](function(){if(_[_0x75e1('0x8b')](_0x30c519['query'][_0x75e1('0x84')])){for(var _0x459227=0x0;_0x459227<_0x30c519[_0x75e1('0x39')][_0x75e1('0x84')][_0x75e1('0x3e')];_0x459227+=0x1){socket['emit'](_0x75e1('0x88'),{'UserId':Number(_0x30c519['query'][_0x75e1('0x84')][_0x459227]),'SmsQueueId':Number(_0x30c519[_0x75e1('0x4f')]['id'])});}}else{socket[_0x75e1('0x87')](_0x75e1('0x88'),{'UserId':Number(_0x30c519[_0x75e1('0x39')]['ids']),'SmsQueueId':Number(_0x30c519['params']['id'])});}});}})[_0x75e1('0x2c')](respondWithStatusCode(_0xeb7c8d,null))[_0x75e1('0x4d')](handleError(_0xeb7c8d,null));};exports['getAgents']=function(_0x596cb7,_0x11315e,_0x29bfc5){var _0x556a34={};var _0x44234b={};var _0x5bbb49;var _0x54e4c7;return db['SmsQueue']['findOne']({'where':{'id':_0x596cb7[_0x75e1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x11315e,null))[_0x75e1('0x2c')](function(_0x255232){if(_0x255232){_0x5bbb49=_0x255232;_0x44234b['model']=_[_0x75e1('0x50')](db['User'][_0x75e1('0x36')]);_0x44234b[_0x75e1('0x39')]=_[_0x75e1('0x50')](_0x596cb7[_0x75e1('0x39')]);_0x44234b[_0x75e1('0x3a')]=_[_0x75e1('0x3b')](_0x44234b[_0x75e1('0x38')],_0x44234b[_0x75e1('0x39')]);_0x556a34['attributes']=_[_0x75e1('0x3b')](_0x44234b[_0x75e1('0x38')],qs[_0x75e1('0x3d')](_0x596cb7[_0x75e1('0x39')][_0x75e1('0x3d')]));_0x556a34[_0x75e1('0x3c')]=_0x556a34[_0x75e1('0x3c')]['length']?_0x556a34[_0x75e1('0x3c')]:_0x44234b[_0x75e1('0x38')];_0x556a34[_0x75e1('0x41')]=qs[_0x75e1('0x42')](_0x596cb7[_0x75e1('0x39')]['sort']);_0x556a34[_0x75e1('0x43')]=qs[_0x75e1('0x3a')](_[_0x75e1('0x68')](_0x596cb7[_0x75e1('0x39')],_0x44234b[_0x75e1('0x3a')]));if(_0x596cb7[_0x75e1('0x39')][_0x75e1('0x44')]){_0x556a34['where']=_[_0x75e1('0x48')](_0x556a34['where'],{'$or':_[_0x75e1('0x34')](_0x556a34['attributes'],function(_0x1def70){var _0x76a1b1={};_0x76a1b1[_0x1def70]={'$like':'%'+_0x596cb7[_0x75e1('0x39')][_0x75e1('0x44')]+'%'};return _0x76a1b1;})});}_0x556a34=_['merge']({},_0x556a34,_0x596cb7['options']);return _0x5bbb49['getAgents'](_0x556a34);}})[_0x75e1('0x2c')](function(_0x10b4be){if(_0x10b4be){_0x54e4c7=_0x10b4be[_0x75e1('0x3e')];if(!_0x596cb7[_0x75e1('0x39')][_0x75e1('0x3f')](_0x75e1('0x40'))){_0x556a34[_0x75e1('0x23')]=qs['limit'](_0x596cb7[_0x75e1('0x39')][_0x75e1('0x23')]);_0x556a34[_0x75e1('0x26')]=qs[_0x75e1('0x26')](_0x596cb7[_0x75e1('0x39')][_0x75e1('0x26')]);}return _0x5bbb49['getAgents'](_0x556a34);}})[_0x75e1('0x2c')](function(_0x1eca9b){if(_0x1eca9b){return _0x1eca9b?{'count':_0x54e4c7,'rows':_0x1eca9b}:null;}})['then'](respondWithResult(_0x11315e,null))[_0x75e1('0x4d')](handleError(_0x11315e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d6a5585..15bdc5f 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 _0xbc58=['emit','hasOwnProperty','hook','save','update'];(function(_0x81548b,_0x4c19c0){var _0x270149=function(_0x5948d1){while(--_0x5948d1){_0x81548b['push'](_0x81548b['shift']());}};_0x270149(++_0x4c19c0);}(_0xbc58,0x161));var _0x8bc5=function(_0xec1d70,_0x34c907){_0xec1d70=_0xec1d70-0x0;var _0x4d6368=_0xbc58[_0xec1d70];return _0x4d6368;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8bc5('0x0'),'afterUpdate':_0x8bc5('0x1'),'afterDestroy':'remove'};function emitEvent(_0xaf14c){return function(_0x381368,_0x2363b2,_0x5e5ee5){SmsQueueEvents[_0x8bc5('0x2')](_0xaf14c+':'+_0x381368['id'],_0x381368);SmsQueueEvents[_0x8bc5('0x2')](_0xaf14c,_0x381368);_0x5e5ee5(null);};}for(var e in events){if(events[_0x8bc5('0x3')](e)){var event=events[e];SmsQueue[_0x8bc5('0x4')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xb1e0=['emit','hasOwnProperty','hook','exports','SmsQueue','remove'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb1e0,0x112));var _0x0b1e=function(_0x3fa31f,_0x633a45){_0x3fa31f=_0x3fa31f-0x0;var _0x557c6c=_0xb1e0[_0x3fa31f];return _0x557c6c;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x0b1e('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b1e('0x1')};function emitEvent(_0x1f629e){return function(_0x4b964c,_0x404c42,_0x25621f){SmsQueueEvents[_0x0b1e('0x2')](_0x1f629e+':'+_0x4b964c['id'],_0x4b964c);SmsQueueEvents[_0x0b1e('0x2')](_0x1f629e,_0x4b964c);_0x25621f(null);};}for(var e in events){if(events[_0x0b1e('0x3')](e)){var event=events[e];SmsQueue[_0x0b1e('0x4')](e,emitEvent(event));}}module[_0x0b1e('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b83a0c9..c5e2a29 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 _0x571f=['bluebird','request-promise','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x24b6a5,_0x3b2d61){var _0x23d3cf=function(_0x346045){while(--_0x346045){_0x24b6a5['push'](_0x24b6a5['shift']());}};_0x23d3cf(++_0x3b2d61);}(_0x571f,0x155));var _0xf571=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0x571f[_0xf5d71c];return _0x5af672;};'use strict';var _=require(_0xf571('0x0'));var util=require(_0xf571('0x1'));var logger=require(_0xf571('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf571('0x3'));var rp=require(_0xf571('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf571('0x5'));var attributes=require('./smsQueue.attributes');module[_0xf571('0x6')]=function(_0xfbc49a,_0x449245){return _0xfbc49a[_0xf571('0x7')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38f2=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues'];(function(_0x5f0f47,_0x1aa09a){var _0xa8a6d4=function(_0x2becb9){while(--_0x2becb9){_0x5f0f47['push'](_0x5f0f47['shift']());}};_0xa8a6d4(++_0x1aa09a);}(_0x38f2,0x118));var _0x238f=function(_0x214b22,_0x2112c1){_0x214b22=_0x214b22-0x0;var _0x423b5a=_0x38f2[_0x214b22];return _0x423b5a;};'use strict';var _=require('lodash');var util=require(_0x238f('0x0'));var logger=require('../../config/logger')(_0x238f('0x1'));var moment=require(_0x238f('0x2'));var BPromise=require(_0x238f('0x3'));var rp=require(_0x238f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x238f('0x5'));var config=require(_0x238f('0x6'));var attributes=require(_0x238f('0x7'));module['exports']=function(_0x28217d,_0x569356){return _0x28217d['define'](_0x238f('0x8'),attributes,{'tableName':_0x238f('0x9'),'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 852f818..f8c0a74 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 _0x2306=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','findAll','options','where','include','model','attributes','map','GetSmsQueue','debug','stringify','catch','ShowSmsQueue','SmsQueue','raw'];(function(_0x1a3d92,_0x587799){var _0xc87a9f=function(_0x2899f5){while(--_0x2899f5){_0x1a3d92['push'](_0x1a3d92['shift']());}};_0xc87a9f(++_0x587799);}(_0x2306,0x98));var _0x6230=function(_0x363f71,_0x569c58){_0x363f71=_0x363f71-0x0;var _0x5ed881=_0x2306[_0x363f71];return _0x5ed881;};'use strict';var _=require('lodash');var util=require(_0x6230('0x0'));var moment=require(_0x6230('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6230('0x2'));var db=require(_0x6230('0x3'))['db'];var utils=require(_0x6230('0x4'));var logger=require(_0x6230('0x5'))(_0x6230('0x6'));var config=require(_0x6230('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6230('0x8')][_0x6230('0x9')]({'port':0x232a});config[_0x6230('0xa')]=_[_0x6230('0xb')](config['redis'],{'host':_0x6230('0xc'),'port':0x18eb});var socket=require(_0x6230('0xd'))(new Redis(config[_0x6230('0xa')]));require(_0x6230('0xe'))[_0x6230('0xf')](socket);function respondWithRpcPromise(_0x4cd5ff,_0x2666c4,_0x576fe2){return new BPromise(function(_0x59b5ad,_0x24550a){return client['request'](_0x4cd5ff,_0x576fe2)[_0x6230('0x10')](function(_0x172d65){logger[_0x6230('0x11')](_0x6230('0x12'),_0x2666c4,_0x6230('0x13'));logger['debug'](_0x6230('0x14'),_0x2666c4,'request\x20sent',JSON['stringify'](_0x172d65));if(_0x172d65[_0x6230('0x15')]){if(_0x172d65[_0x6230('0x15')][_0x6230('0x16')]===0x1f4){logger[_0x6230('0x15')](_0x6230('0x12'),_0x2666c4,_0x172d65[_0x6230('0x15')]['message']);return _0x24550a(_0x172d65['error'][_0x6230('0x17')]);}logger['error'](_0x6230('0x12'),_0x2666c4,_0x172d65[_0x6230('0x15')][_0x6230('0x17')]);return _0x59b5ad(_0x172d65[_0x6230('0x15')][_0x6230('0x17')]);}else{logger[_0x6230('0x11')](_0x6230('0x12'),_0x2666c4,'request\x20sent');_0x59b5ad(_0x172d65['result']['message']);}})['catch'](function(_0x3e2da1){logger[_0x6230('0x15')]('SmsQueue,\x20%s,\x20%s',_0x2666c4,_0x3e2da1);_0x24550a(_0x3e2da1);});});}exports['GetSmsQueue']=function(_0x381079){var _0x574aa0=this;return new Promise(function(_0x47ea6b,_0x310250){return db['SmsQueue'][_0x6230('0x18')]({'raw':_0x381079[_0x6230('0x19')]?_0x381079['options']['raw']===undefined?!![]:![]:!![],'where':_0x381079['options']?_0x381079[_0x6230('0x19')][_0x6230('0x1a')]||null:null,'attributes':_0x381079[_0x6230('0x19')]?_0x381079[_0x6230('0x19')]['attributes']||null:null,'limit':_0x381079[_0x6230('0x19')]?_0x381079['options']['limit']||null:null,'include':_0x381079[_0x6230('0x19')]?_0x381079['options'][_0x6230('0x1b')]?_['map'](_0x381079['options'][_0x6230('0x1b')],function(_0x369345){return{'model':db[_0x369345[_0x6230('0x1c')]],'as':_0x369345['as'],'attributes':_0x369345[_0x6230('0x1d')],'include':_0x369345[_0x6230('0x1b')]?_[_0x6230('0x1e')](_0x369345['include'],function(_0x1b3b5c){return{'model':db[_0x1b3b5c[_0x6230('0x1c')]],'as':_0x1b3b5c['as'],'attributes':_0x1b3b5c['attributes'],'include':_0x1b3b5c[_0x6230('0x1b')]?_[_0x6230('0x1e')](_0x1b3b5c['include'],function(_0x5d97d4){return{'model':db[_0x5d97d4[_0x6230('0x1c')]],'as':_0x5d97d4['as'],'attributes':_0x5d97d4[_0x6230('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6230('0x10')](function(_0x63c3cb){logger[_0x6230('0x11')](_0x6230('0x1f'),_0x381079);logger[_0x6230('0x20')](_0x6230('0x1f'),_0x381079,JSON[_0x6230('0x21')](_0x63c3cb));_0x47ea6b(_0x63c3cb);})[_0x6230('0x22')](function(_0x4e9894){logger[_0x6230('0x15')](_0x6230('0x1f'),_0x4e9894['message'],_0x381079);_0x310250(_0x574aa0['error'](0x1f4,_0x4e9894[_0x6230('0x17')]));});});};exports[_0x6230('0x23')]=function(_0xad0499){var _0x46f27e=this;return new Promise(function(_0x19e7f6,_0x15475c){return db[_0x6230('0x24')]['find']({'raw':_0xad0499[_0x6230('0x19')]?_0xad0499[_0x6230('0x19')][_0x6230('0x25')]===undefined?!![]:![]:!![],'where':_0xad0499[_0x6230('0x19')]?_0xad0499['options'][_0x6230('0x1a')]||null:null,'attributes':_0xad0499[_0x6230('0x19')]?_0xad0499[_0x6230('0x19')]['attributes']||null:null,'include':_0xad0499['options']?_0xad0499[_0x6230('0x19')]['include']?_['map'](_0xad0499['options'][_0x6230('0x1b')],function(_0x2a6e8f){return{'model':db[_0x2a6e8f['model']],'as':_0x2a6e8f['as'],'attributes':_0x2a6e8f[_0x6230('0x1d')],'include':_0x2a6e8f['include']?_[_0x6230('0x1e')](_0x2a6e8f[_0x6230('0x1b')],function(_0x51905f){return{'model':db[_0x51905f[_0x6230('0x1c')]],'as':_0x51905f['as'],'attributes':_0x51905f[_0x6230('0x1d')],'include':_0x51905f[_0x6230('0x1b')]?_[_0x6230('0x1e')](_0x51905f[_0x6230('0x1b')],function(_0x1d9052){return{'model':db[_0x1d9052[_0x6230('0x1c')]],'as':_0x1d9052['as'],'attributes':_0x1d9052[_0x6230('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6230('0x10')](function(_0x45b409){logger[_0x6230('0x11')]('ShowSmsQueue',_0xad0499);logger[_0x6230('0x20')](_0x6230('0x23'),_0xad0499,JSON[_0x6230('0x21')](_0x45b409));_0x19e7f6(_0x45b409);})[_0x6230('0x22')](function(_0x5d1d35){logger[_0x6230('0x15')](_0x6230('0x23'),_0x5d1d35['message'],_0xad0499);_0x15475c(_0x46f27e[_0x6230('0x15')](0x1f4,_0x5d1d35[_0x6230('0x17')]));});});}; \ No newline at end of file +var _0xbef9=['GetSmsQueue','SmsQueue','options','raw','attributes','limit','map','include','model','find','where','ShowSmsQueue','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x4649d8,_0x89fbe2){var _0x3f28ff=function(_0x1aefa3){while(--_0x1aefa3){_0x4649d8['push'](_0x4649d8['shift']());}};_0x3f28ff(++_0x89fbe2);}(_0xbef9,0xfc));var _0x9bef=function(_0x5a3f08,_0x4afe7d){_0x5a3f08=_0x5a3f08-0x0;var _0xb06939=_0xbef9[_0x5a3f08];return _0xb06939;};'use strict';var _=require(_0x9bef('0x0'));var util=require(_0x9bef('0x1'));var moment=require(_0x9bef('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9bef('0x4'));var logger=require(_0x9bef('0x5'))(_0x9bef('0x6'));var config=require(_0x9bef('0x7'));var jayson=require(_0x9bef('0x8'));var client=jayson[_0x9bef('0x9')][_0x9bef('0xa')]({'port':0x232a});config[_0x9bef('0xb')]=_[_0x9bef('0xc')](config['redis'],{'host':_0x9bef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bef('0xb')]));require(_0x9bef('0xe'))['register'](socket);function respondWithRpcPromise(_0x7d588,_0x5a32d8,_0x5e99fa){return new BPromise(function(_0x4848ac,_0xc204bd){return client[_0x9bef('0xf')](_0x7d588,_0x5e99fa)[_0x9bef('0x10')](function(_0x483080){logger[_0x9bef('0x11')]('SmsQueue,\x20%s,\x20%s',_0x5a32d8,_0x9bef('0x12'));logger[_0x9bef('0x13')](_0x9bef('0x14'),_0x5a32d8,_0x9bef('0x12'),JSON[_0x9bef('0x15')](_0x483080));if(_0x483080[_0x9bef('0x16')]){if(_0x483080[_0x9bef('0x16')][_0x9bef('0x17')]===0x1f4){logger['error'](_0x9bef('0x18'),_0x5a32d8,_0x483080[_0x9bef('0x16')][_0x9bef('0x19')]);return _0xc204bd(_0x483080[_0x9bef('0x16')][_0x9bef('0x19')]);}logger['error'](_0x9bef('0x18'),_0x5a32d8,_0x483080[_0x9bef('0x16')][_0x9bef('0x19')]);return _0x4848ac(_0x483080[_0x9bef('0x16')][_0x9bef('0x19')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x5a32d8,_0x9bef('0x12'));_0x4848ac(_0x483080[_0x9bef('0x1a')]['message']);}})[_0x9bef('0x1b')](function(_0xc56881){logger[_0x9bef('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5a32d8,_0xc56881);_0xc204bd(_0xc56881);});});}exports[_0x9bef('0x1c')]=function(_0x3e1771){var _0x5e8e4a=this;return new Promise(function(_0x32bd7a,_0xb7137d){return db[_0x9bef('0x1d')]['findAll']({'raw':_0x3e1771[_0x9bef('0x1e')]?_0x3e1771[_0x9bef('0x1e')][_0x9bef('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e1771[_0x9bef('0x1e')]?_0x3e1771['options']['where']||null:null,'attributes':_0x3e1771[_0x9bef('0x1e')]?_0x3e1771['options'][_0x9bef('0x20')]||null:null,'limit':_0x3e1771[_0x9bef('0x1e')]?_0x3e1771['options'][_0x9bef('0x21')]||null:null,'include':_0x3e1771[_0x9bef('0x1e')]?_0x3e1771['options']['include']?_[_0x9bef('0x22')](_0x3e1771[_0x9bef('0x1e')][_0x9bef('0x23')],function(_0x40a051){return{'model':db[_0x40a051['model']],'as':_0x40a051['as'],'attributes':_0x40a051[_0x9bef('0x20')],'include':_0x40a051['include']?_[_0x9bef('0x22')](_0x40a051[_0x9bef('0x23')],function(_0x57ff37){return{'model':db[_0x57ff37[_0x9bef('0x24')]],'as':_0x57ff37['as'],'attributes':_0x57ff37[_0x9bef('0x20')],'include':_0x57ff37[_0x9bef('0x23')]?_[_0x9bef('0x22')](_0x57ff37[_0x9bef('0x23')],function(_0x81356f){return{'model':db[_0x81356f[_0x9bef('0x24')]],'as':_0x81356f['as'],'attributes':_0x81356f['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bef('0x10')](function(_0x4cf93b){logger[_0x9bef('0x11')]('GetSmsQueue',_0x3e1771);logger[_0x9bef('0x13')]('GetSmsQueue',_0x3e1771,JSON['stringify'](_0x4cf93b));_0x32bd7a(_0x4cf93b);})[_0x9bef('0x1b')](function(_0x4af49f){logger['error'](_0x9bef('0x1c'),_0x4af49f['message'],_0x3e1771);_0xb7137d(_0x5e8e4a['error'](0x1f4,_0x4af49f[_0x9bef('0x19')]));});});};exports['ShowSmsQueue']=function(_0x28f0f1){var _0x2fbf8a=this;return new Promise(function(_0x299280,_0x2a3032){return db[_0x9bef('0x1d')][_0x9bef('0x25')]({'raw':_0x28f0f1[_0x9bef('0x1e')]?_0x28f0f1[_0x9bef('0x1e')][_0x9bef('0x1f')]===undefined?!![]:![]:!![],'where':_0x28f0f1[_0x9bef('0x1e')]?_0x28f0f1[_0x9bef('0x1e')][_0x9bef('0x26')]||null:null,'attributes':_0x28f0f1[_0x9bef('0x1e')]?_0x28f0f1[_0x9bef('0x1e')]['attributes']||null:null,'include':_0x28f0f1[_0x9bef('0x1e')]?_0x28f0f1['options'][_0x9bef('0x23')]?_['map'](_0x28f0f1[_0x9bef('0x1e')][_0x9bef('0x23')],function(_0xeedc91){return{'model':db[_0xeedc91[_0x9bef('0x24')]],'as':_0xeedc91['as'],'attributes':_0xeedc91[_0x9bef('0x20')],'include':_0xeedc91[_0x9bef('0x23')]?_[_0x9bef('0x22')](_0xeedc91['include'],function(_0x1e380d){return{'model':db[_0x1e380d[_0x9bef('0x24')]],'as':_0x1e380d['as'],'attributes':_0x1e380d[_0x9bef('0x20')],'include':_0x1e380d[_0x9bef('0x23')]?_[_0x9bef('0x22')](_0x1e380d[_0x9bef('0x23')],function(_0x12ea8f){return{'model':db[_0x12ea8f[_0x9bef('0x24')]],'as':_0x12ea8f['as'],'attributes':_0x12ea8f[_0x9bef('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9bef('0x10')](function(_0x522503){logger[_0x9bef('0x11')](_0x9bef('0x27'),_0x28f0f1);logger[_0x9bef('0x13')](_0x9bef('0x27'),_0x28f0f1,JSON[_0x9bef('0x15')](_0x522503));_0x299280(_0x522503);})['catch'](function(_0x3536ca){logger[_0x9bef('0x16')](_0x9bef('0x27'),_0x3536ca[_0x9bef('0x19')],_0x28f0f1);_0x2a3032(_0x2fbf8a[_0x9bef('0x16')](0x1f4,_0x3536ca['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 4d44f2c..eb32f33 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 _0xb7c4=['save','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xb7c4,0x1b1));var _0x4b7c=function(_0x5b4413,_0x22cbc6){_0x5b4413=_0x5b4413-0x0;var _0xd7ddf9=_0xb7c4[_0x5b4413];return _0xd7ddf9;};'use strict';var SmsQueueEvents=require(_0x4b7c('0x0'));var events=[_0x4b7c('0x1'),'remove','update'];function createListener(_0x1fb766,_0x4e4d14){return function(_0x46c924){_0x4e4d14[_0x4b7c('0x2')](_0x1fb766,_0x46c924);};}function removeListener(_0x1968c4,_0x10e192){return function(){SmsQueueEvents[_0x4b7c('0x3')](_0x1968c4,_0x10e192);};}exports[_0x4b7c('0x4')]=function(_0x210216){for(var _0x4f2ea9=0x0,_0x3cf82f=events[_0x4b7c('0x5')];_0x4f2ea9<_0x3cf82f;_0x4f2ea9++){var _0x262cc5=events[_0x4f2ea9];var _0x9c3818=createListener(_0x4b7c('0x6')+_0x262cc5,_0x210216);SmsQueueEvents['on'](_0x262cc5,_0x9c3818);}}; \ No newline at end of file +var _0xd624=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x4ee344,_0x432d3b){var _0x22bab6=function(_0x393f17){while(--_0x393f17){_0x4ee344['push'](_0x4ee344['shift']());}};_0x22bab6(++_0x432d3b);}(_0xd624,0x108));var _0x4d62=function(_0x3ad63c,_0x81c549){_0x3ad63c=_0x3ad63c-0x0;var _0x3ce35c=_0xd624[_0x3ad63c];return _0x3ce35c;};'use strict';var SmsQueueEvents=require(_0x4d62('0x0'));var events=[_0x4d62('0x1'),_0x4d62('0x2'),_0x4d62('0x3')];function createListener(_0x567533,_0x2e8481){return function(_0x513456){_0x2e8481[_0x4d62('0x4')](_0x567533,_0x513456);};}function removeListener(_0x362723,_0x4743c6){return function(){SmsQueueEvents[_0x4d62('0x5')](_0x362723,_0x4743c6);};}exports[_0x4d62('0x6')]=function(_0x480fdd){for(var _0x30b42b=0x0,_0x243e05=events[_0x4d62('0x7')];_0x30b42b<_0x243e05;_0x30b42b++){var _0x4aed25=events[_0x30b42b];var _0x386b7a=createListener(_0x4d62('0x8')+_0x4aed25,_0x480fdd);SmsQueueEvents['on'](_0x4aed25,_0x386b7a);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 9e272ee..4a88648 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 _0x21dd=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x21dd,0xdb));var _0xd21d=function(_0x396b0f,_0x5b7272){_0x396b0f=_0x396b0f-0x0;var _0x56a161=_0x21dd[_0x396b0f];return _0x56a161;};'use strict';var multer=require(_0xd21d('0x0'));var util=require(_0xd21d('0x1'));var path=require(_0xd21d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd21d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd21d('0x4'));var config=require(_0xd21d('0x5'));var controller=require(_0xd21d('0x6'));router[_0xd21d('0x7')]('/',auth['isAuthenticated'](),controller[_0xd21d('0x8')]);router[_0xd21d('0x7')](_0xd21d('0x9'),auth[_0xd21d('0xa')](),controller['describe']);router[_0xd21d('0x7')](_0xd21d('0xb'),auth[_0xd21d('0xa')](),controller[_0xd21d('0xc')]);router[_0xd21d('0xd')]('/',auth['isAuthenticated'](),controller[_0xd21d('0xe')]);router[_0xd21d('0xf')](_0xd21d('0xb'),auth[_0xd21d('0xa')](),controller['update']);router['delete'](_0xd21d('0xb'),auth[_0xd21d('0xa')](),controller[_0xd21d('0x10')]);module[_0xd21d('0x11')]=router; \ No newline at end of file +var _0x87d3=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete'];(function(_0x1cba5c,_0x3515bf){var _0x56d3d9=function(_0x55b8c7){while(--_0x55b8c7){_0x1cba5c['push'](_0x1cba5c['shift']());}};_0x56d3d9(++_0x3515bf);}(_0x87d3,0x86));var _0x387d=function(_0x2931e6,_0x4b79a2){_0x2931e6=_0x2931e6-0x0;var _0x1b1208=_0x87d3[_0x2931e6];return _0x1b1208;};'use strict';var multer=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var path=require(_0x387d('0x2'));var timeout=require(_0x387d('0x3'));var express=require(_0x387d('0x4'));var router=express[_0x387d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x387d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x387d('0x7'));var controller=require(_0x387d('0x8'));router[_0x387d('0x9')]('/',auth['isAuthenticated'](),controller[_0x387d('0xa')]);router[_0x387d('0x9')](_0x387d('0xb'),auth[_0x387d('0xc')](),controller[_0x387d('0xd')]);router[_0x387d('0x9')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0xf')]);router[_0x387d('0x10')]('/',auth[_0x387d('0xc')](),controller['create']);router[_0x387d('0x11')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0x12')]);router[_0x387d('0x13')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0x14')]);module[_0x387d('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 78c2a59..4e17d7f 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 _0x9750=['sequelize','exports','STRING','DATE','moment'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x9750,0x12b));var _0x0975=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9750[_0x618414];return _0x21c19a;};'use strict';var moment=require(_0x0975('0x0'));var Sequelize=require(_0x0975('0x1'));module[_0x0975('0x2')]={'uniqueid':{'type':Sequelize[_0x0975('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0975('0x3')]},'joinAt':{'type':Sequelize[_0x0975('0x4')]},'leaveAt':{'type':Sequelize[_0x0975('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0975('0x4')]},'reason':{'type':Sequelize[_0x0975('0x3')]}}; \ No newline at end of file +var _0x757a=['STRING','DATE','moment','sequelize','exports'];(function(_0x2cf815,_0x2c0db0){var _0x1fa01f=function(_0x50ec7b){while(--_0x50ec7b){_0x2cf815['push'](_0x2cf815['shift']());}};_0x1fa01f(++_0x2c0db0);}(_0x757a,0x110));var _0xa757=function(_0x25d8e9,_0x45ea09){_0x25d8e9=_0x25d8e9-0x0;var _0x173c31=_0x757a[_0x25d8e9];return _0x173c31;};'use strict';var moment=require(_0xa757('0x0'));var Sequelize=require(_0xa757('0x1'));module[_0xa757('0x2')]={'uniqueid':{'type':Sequelize[_0xa757('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa757('0x3')]},'joinAt':{'type':Sequelize[_0xa757('0x4')]},'leaveAt':{'type':Sequelize[_0xa757('0x4')]},'acceptAt':{'type':Sequelize[_0xa757('0x4')]},'exitAt':{'type':Sequelize[_0xa757('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index fe24bc3..18ff904 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 _0x1e08=['stack','name','send','index','map','rawAttributes','query','filters','intersection','model','attributes','length','order','sort','where','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','show','keys','fields','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error'];(function(_0x11db9c,_0x27337b){var _0xf9c21e=function(_0x277cbb){while(--_0x277cbb){_0x11db9c['push'](_0x11db9c['shift']());}};_0xf9c21e(++_0x27337b);}(_0x1e08,0x6a));var _0x81e0=function(_0x26394d,_0x547eea){_0x26394d=_0x26394d-0x0;var _0x5c7861=_0x1e08[_0x26394d];return _0x5c7861;};'use strict';var emlformat=require(_0x81e0('0x0'));var rimraf=require(_0x81e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x81e0('0x2'));var rp=require(_0x81e0('0x3'));var moment=require(_0x81e0('0x4'));var BPromise=require(_0x81e0('0x5'));var Mustache=require('mustache');var util=require(_0x81e0('0x6'));var path=require(_0x81e0('0x7'));var sox=require(_0x81e0('0x8'));var csv=require(_0x81e0('0x9'));var ejs=require(_0x81e0('0xa'));var fs=require('fs');var fs_extra=require(_0x81e0('0xb'));var _=require(_0x81e0('0xc'));var squel=require(_0x81e0('0xd'));var crypto=require('crypto');var jsforce=require(_0x81e0('0xe'));var deskjs=require(_0x81e0('0xf'));var toCsv=require(_0x81e0('0x9'));var querystring=require(_0x81e0('0x10'));var Papa=require(_0x81e0('0x11'));var Redis=require(_0x81e0('0x12'));var authService=require(_0x81e0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x81e0('0x14'));var hardwareService=require(_0x81e0('0x15'));var logger=require(_0x81e0('0x16'))('api');var utils=require(_0x81e0('0x17'));var config=require(_0x81e0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x81e0('0x19'))['db'];function respondWithStatusCode(_0x28afea,_0x58943b){_0x58943b=_0x58943b||0xcc;return function(_0x20aef4){if(_0x20aef4){return _0x28afea[_0x81e0('0x1a')](_0x58943b);}return _0x28afea[_0x81e0('0x1b')](_0x58943b)[_0x81e0('0x1c')]();};}function respondWithResult(_0x2847fe,_0x4ba040){_0x4ba040=_0x4ba040||0xc8;return function(_0x279e78){if(_0x279e78){return _0x2847fe[_0x81e0('0x1b')](_0x4ba040)['json'](_0x279e78);}};}function respondWithFilteredResult(_0x483789,_0x181320){return function(_0x1123c5){if(_0x1123c5){var _0x278001=typeof _0x181320[_0x81e0('0x1d')]===_0x81e0('0x1e')&&typeof _0x181320[_0x81e0('0x1f')]===_0x81e0('0x1e');var _0x4c9888=_0x1123c5['count'];var _0x2fa4f0=_0x278001?0x0:_0x181320['offset'];var _0x53b32f=_0x278001?_0x1123c5[_0x81e0('0x20')]:_0x181320['offset']+_0x181320[_0x81e0('0x1f')];var _0x24de46;if(_0x53b32f>=_0x4c9888){_0x53b32f=_0x4c9888;_0x24de46=0xc8;}else{_0x24de46=0xce;}_0x483789[_0x81e0('0x1b')](_0x24de46);return _0x483789[_0x81e0('0x21')]('Content-Range',_0x2fa4f0+'-'+_0x53b32f+'/'+_0x4c9888)[_0x81e0('0x22')](_0x1123c5);}return null;};}function patchUpdates(_0x1f5f01){return function(_0x330b49){try{jsonpatch[_0x81e0('0x23')](_0x330b49,_0x1f5f01,!![]);}catch(_0x911054){return BPromise[_0x81e0('0x24')](_0x911054);}return _0x330b49[_0x81e0('0x25')]();};}function saveUpdates(_0x3c6814,_0x34b2bf){return function(_0x31ffca){if(_0x31ffca){return _0x31ffca[_0x81e0('0x26')](_0x3c6814)[_0x81e0('0x27')](function(_0x31dd2b){return _0x31dd2b;});}return null;};}function removeEntity(_0x303c14,_0x43922f){return function(_0x33b477){if(_0x33b477){return _0x33b477[_0x81e0('0x28')]()[_0x81e0('0x27')](function(){_0x303c14[_0x81e0('0x1b')](0xcc)[_0x81e0('0x1c')]();});}};}function handleEntityNotFound(_0x4d43fd,_0x4ef25a){return function(_0x237216){if(!_0x237216){_0x4d43fd['sendStatus'](0x194);}return _0x237216;};}function handleError(_0x2e4b0a,_0x12f663){_0x12f663=_0x12f663||0x1f4;return function(_0x480351){logger[_0x81e0('0x29')](_0x480351[_0x81e0('0x2a')]);if(_0x480351[_0x81e0('0x2b')]){delete _0x480351['name'];}_0x2e4b0a[_0x81e0('0x1b')](_0x12f663)[_0x81e0('0x2c')](_0x480351);};}exports[_0x81e0('0x2d')]=function(_0x2f5269,_0x4dc925){var _0x5f32ed={},_0x588d80={},_0x52f4ea={'count':0x0,'rows':[]};var _0xc13cc1=_[_0x81e0('0x2e')](db['SmsQueueReport'][_0x81e0('0x2f')],function(_0x3552e5){return{'name':_0x3552e5['fieldName'],'type':_0x3552e5['type']['key']};});_0x588d80['model']=_[_0x81e0('0x2e')](_0xc13cc1,_0x81e0('0x2b'));_0x588d80[_0x81e0('0x30')]=_['keys'](_0x2f5269[_0x81e0('0x30')]);_0x588d80[_0x81e0('0x31')]=_[_0x81e0('0x32')](_0x588d80[_0x81e0('0x33')],_0x588d80[_0x81e0('0x30')]);_0x5f32ed[_0x81e0('0x34')]=_['intersection'](_0x588d80[_0x81e0('0x33')],qs['fields'](_0x2f5269['query']['fields']));_0x5f32ed[_0x81e0('0x34')]=_0x5f32ed[_0x81e0('0x34')][_0x81e0('0x35')]?_0x5f32ed[_0x81e0('0x34')]:_0x588d80[_0x81e0('0x33')];if(!_0x2f5269[_0x81e0('0x30')]['hasOwnProperty']('nolimit')){_0x5f32ed[_0x81e0('0x1f')]=qs[_0x81e0('0x1f')](_0x2f5269[_0x81e0('0x30')]['limit']);_0x5f32ed[_0x81e0('0x1d')]=qs[_0x81e0('0x1d')](_0x2f5269[_0x81e0('0x30')][_0x81e0('0x1d')]);}_0x5f32ed[_0x81e0('0x36')]=qs[_0x81e0('0x37')](_0x2f5269['query'][_0x81e0('0x37')]);_0x5f32ed[_0x81e0('0x38')]=qs[_0x81e0('0x31')](_['pick'](_0x2f5269[_0x81e0('0x30')],_0x588d80['filters']),_0xc13cc1);if(_0x2f5269[_0x81e0('0x30')][_0x81e0('0x39')]){_0x5f32ed[_0x81e0('0x38')]=_[_0x81e0('0x3a')](_0x5f32ed[_0x81e0('0x38')],{'$or':_[_0x81e0('0x2e')](_0xc13cc1,function(_0x16b1b8){if(_0x16b1b8[_0x81e0('0x3b')]!==_0x81e0('0x3c')){var _0xe54c63={};_0xe54c63[_0x16b1b8[_0x81e0('0x2b')]]={'$like':'%'+_0x2f5269[_0x81e0('0x30')][_0x81e0('0x39')]+'%'};return _0xe54c63;}})});}_0x5f32ed=_[_0x81e0('0x3a')]({},_0x5f32ed,_0x2f5269[_0x81e0('0x3d')]);var _0xc80442={'where':_0x5f32ed[_0x81e0('0x38')]};return db[_0x81e0('0x3e')][_0x81e0('0x20')](_0xc80442)['then'](function(_0x2d34e4){_0x52f4ea[_0x81e0('0x20')]=_0x2d34e4;if(_0x2f5269[_0x81e0('0x30')][_0x81e0('0x3f')]){_0x5f32ed[_0x81e0('0x40')]=[{'all':!![]}];}return db[_0x81e0('0x3e')][_0x81e0('0x41')](_0x5f32ed);})[_0x81e0('0x27')](function(_0x5800b9){_0x52f4ea['rows']=_0x5800b9;return _0x52f4ea;})[_0x81e0('0x27')](respondWithFilteredResult(_0x4dc925,_0x5f32ed))['catch'](handleError(_0x4dc925,null));};exports[_0x81e0('0x42')]=function(_0x4d60f6,_0x48004b){var _0x578055={'raw':!![],'where':{'id':_0x4d60f6['params']['id']}},_0x1ba1e5={};_0x1ba1e5[_0x81e0('0x33')]=_[_0x81e0('0x43')](db[_0x81e0('0x3e')][_0x81e0('0x2f')]);_0x1ba1e5[_0x81e0('0x30')]=_[_0x81e0('0x43')](_0x4d60f6['query']);_0x1ba1e5[_0x81e0('0x31')]=_['intersection'](_0x1ba1e5['model'],_0x1ba1e5[_0x81e0('0x30')]);_0x578055[_0x81e0('0x34')]=_[_0x81e0('0x32')](_0x1ba1e5[_0x81e0('0x33')],qs['fields'](_0x4d60f6[_0x81e0('0x30')][_0x81e0('0x44')]));_0x578055[_0x81e0('0x34')]=_0x578055['attributes'][_0x81e0('0x35')]?_0x578055[_0x81e0('0x34')]:_0x1ba1e5[_0x81e0('0x33')];if(_0x4d60f6[_0x81e0('0x30')]['includeAll']){_0x578055[_0x81e0('0x40')]=[{'all':!![]}];}_0x578055=_[_0x81e0('0x3a')]({},_0x578055,_0x4d60f6[_0x81e0('0x3d')]);return db[_0x81e0('0x3e')][_0x81e0('0x45')](_0x578055)[_0x81e0('0x27')](handleEntityNotFound(_0x48004b,null))[_0x81e0('0x27')](respondWithResult(_0x48004b,null))[_0x81e0('0x46')](handleError(_0x48004b,null));};exports['create']=function(_0xc13fc8,_0x573dca){return db['SmsQueueReport'][_0x81e0('0x47')](_0xc13fc8[_0x81e0('0x48')],{})['then'](respondWithResult(_0x573dca,0xc9))[_0x81e0('0x46')](handleError(_0x573dca,null));};exports['update']=function(_0x18fbb7,_0x3ced69){if(_0x18fbb7[_0x81e0('0x48')]['id']){delete _0x18fbb7[_0x81e0('0x48')]['id'];}return db[_0x81e0('0x3e')][_0x81e0('0x45')]({'where':{'id':_0x18fbb7['params']['id']}})[_0x81e0('0x27')](handleEntityNotFound(_0x3ced69,null))['then'](saveUpdates(_0x18fbb7[_0x81e0('0x48')],null))['then'](respondWithResult(_0x3ced69,null))['catch'](handleError(_0x3ced69,null));};exports[_0x81e0('0x28')]=function(_0x36718f,_0x522efe){return db[_0x81e0('0x3e')][_0x81e0('0x45')]({'where':{'id':_0x36718f['params']['id']}})['then'](handleEntityNotFound(_0x522efe,null))[_0x81e0('0x27')](removeEntity(_0x522efe,null))[_0x81e0('0x46')](handleError(_0x522efe,null));};exports['describe']=function(_0xac55d3,_0x20e446){return db['SmsQueueReport'][_0x81e0('0x49')]()[_0x81e0('0x27')](respondWithResult(_0x20e446,null))[_0x81e0('0x46')](handleError(_0x20e446,null));}; \ No newline at end of file +var _0xb641=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','fields','length','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','mustache','path','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','index','map','SmsQueueReport'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xb641,0xea));var _0x1b64=function(_0x2a32bb,_0x264029){_0x2a32bb=_0x2a32bb-0x0;var _0x1aaa57=_0xb641[_0x2a32bb];return _0x1aaa57;};'use strict';var emlformat=require(_0x1b64('0x0'));var rimraf=require(_0x1b64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b64('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b64('0x3'));var util=require('util');var path=require(_0x1b64('0x4'));var sox=require('sox');var csv=require(_0x1b64('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b64('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b64('0x7'));var deskjs=require(_0x1b64('0x8'));var toCsv=require(_0x1b64('0x5'));var querystring=require(_0x1b64('0x9'));var Papa=require(_0x1b64('0xa'));var Redis=require(_0x1b64('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1b64('0xc'));var as=require(_0x1b64('0xd'));var hardwareService=require(_0x1b64('0xe'));var logger=require(_0x1b64('0xf'))(_0x1b64('0x10'));var utils=require(_0x1b64('0x11'));var config=require(_0x1b64('0x12'));var licenseUtil=require(_0x1b64('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da75f,_0xb3372c){_0xb3372c=_0xb3372c||0xcc;return function(_0x3c1dea){if(_0x3c1dea){return _0x1da75f['sendStatus'](_0xb3372c);}return _0x1da75f[_0x1b64('0x14')](_0xb3372c)[_0x1b64('0x15')]();};}function respondWithResult(_0x166070,_0x18ca4d){_0x18ca4d=_0x18ca4d||0xc8;return function(_0x171b0e){if(_0x171b0e){return _0x166070[_0x1b64('0x14')](_0x18ca4d)[_0x1b64('0x16')](_0x171b0e);}};}function respondWithFilteredResult(_0x1bbebd,_0x31c7e8){return function(_0x161688){if(_0x161688){var _0x4272c7=typeof _0x31c7e8[_0x1b64('0x17')]===_0x1b64('0x18')&&typeof _0x31c7e8[_0x1b64('0x19')]===_0x1b64('0x18');var _0x410a45=_0x161688[_0x1b64('0x1a')];var _0x52f6cf=_0x4272c7?0x0:_0x31c7e8['offset'];var _0x301000=_0x4272c7?_0x161688[_0x1b64('0x1a')]:_0x31c7e8[_0x1b64('0x17')]+_0x31c7e8[_0x1b64('0x19')];var _0x5758b7;if(_0x301000>=_0x410a45){_0x301000=_0x410a45;_0x5758b7=0xc8;}else{_0x5758b7=0xce;}_0x1bbebd[_0x1b64('0x14')](_0x5758b7);return _0x1bbebd['set'](_0x1b64('0x1b'),_0x52f6cf+'-'+_0x301000+'/'+_0x410a45)[_0x1b64('0x16')](_0x161688);}return null;};}function patchUpdates(_0xfcc228){return function(_0x4cba76){try{jsonpatch[_0x1b64('0x1c')](_0x4cba76,_0xfcc228,!![]);}catch(_0x3a317e){return BPromise[_0x1b64('0x1d')](_0x3a317e);}return _0x4cba76['save']();};}function saveUpdates(_0x545a8b,_0x44095a){return function(_0x586e9e){if(_0x586e9e){return _0x586e9e[_0x1b64('0x1e')](_0x545a8b)[_0x1b64('0x1f')](function(_0x420bb5){return _0x420bb5;});}return null;};}function removeEntity(_0x486e51,_0x29988a){return function(_0x313563){if(_0x313563){return _0x313563['destroy']()[_0x1b64('0x1f')](function(){_0x486e51[_0x1b64('0x14')](0xcc)[_0x1b64('0x15')]();});}};}function handleEntityNotFound(_0x7621a9,_0x53c24f){return function(_0x1c96d8){if(!_0x1c96d8){_0x7621a9['sendStatus'](0x194);}return _0x1c96d8;};}function handleError(_0x175f4d,_0x11bb44){_0x11bb44=_0x11bb44||0x1f4;return function(_0x11b243){logger[_0x1b64('0x20')](_0x11b243['stack']);if(_0x11b243[_0x1b64('0x21')]){delete _0x11b243['name'];}_0x175f4d['status'](_0x11bb44)[_0x1b64('0x22')](_0x11b243);};}exports[_0x1b64('0x23')]=function(_0xec88b,_0x115f20){var _0x11543f={},_0x219434={},_0x33c24e={'count':0x0,'rows':[]};var _0x51d5cd=_[_0x1b64('0x24')](db[_0x1b64('0x25')][_0x1b64('0x26')],function(_0x1480f9){return{'name':_0x1480f9[_0x1b64('0x27')],'type':_0x1480f9[_0x1b64('0x28')][_0x1b64('0x29')]};});_0x219434[_0x1b64('0x2a')]=_[_0x1b64('0x24')](_0x51d5cd,_0x1b64('0x21'));_0x219434[_0x1b64('0x2b')]=_[_0x1b64('0x2c')](_0xec88b[_0x1b64('0x2b')]);_0x219434['filters']=_[_0x1b64('0x2d')](_0x219434[_0x1b64('0x2a')],_0x219434['query']);_0x11543f[_0x1b64('0x2e')]=_[_0x1b64('0x2d')](_0x219434['model'],qs['fields'](_0xec88b[_0x1b64('0x2b')]['fields']));_0x11543f[_0x1b64('0x2e')]=_0x11543f['attributes']['length']?_0x11543f['attributes']:_0x219434[_0x1b64('0x2a')];if(!_0xec88b[_0x1b64('0x2b')]['hasOwnProperty'](_0x1b64('0x2f'))){_0x11543f[_0x1b64('0x19')]=qs[_0x1b64('0x19')](_0xec88b[_0x1b64('0x2b')][_0x1b64('0x19')]);_0x11543f[_0x1b64('0x17')]=qs[_0x1b64('0x17')](_0xec88b[_0x1b64('0x2b')][_0x1b64('0x17')]);}_0x11543f[_0x1b64('0x30')]=qs[_0x1b64('0x31')](_0xec88b[_0x1b64('0x2b')]['sort']);_0x11543f[_0x1b64('0x32')]=qs['filters'](_[_0x1b64('0x33')](_0xec88b[_0x1b64('0x2b')],_0x219434[_0x1b64('0x34')]),_0x51d5cd);if(_0xec88b['query']['filter']){_0x11543f[_0x1b64('0x32')]=_['merge'](_0x11543f[_0x1b64('0x32')],{'$or':_[_0x1b64('0x24')](_0x51d5cd,function(_0x3c2d83){if(_0x3c2d83[_0x1b64('0x28')]!=='VIRTUAL'){var _0xd95105={};_0xd95105[_0x3c2d83[_0x1b64('0x21')]]={'$like':'%'+_0xec88b['query'][_0x1b64('0x35')]+'%'};return _0xd95105;}})});}_0x11543f=_[_0x1b64('0x36')]({},_0x11543f,_0xec88b[_0x1b64('0x37')]);var _0x299884={'where':_0x11543f[_0x1b64('0x32')]};return db['SmsQueueReport'][_0x1b64('0x1a')](_0x299884)['then'](function(_0x5a8958){_0x33c24e[_0x1b64('0x1a')]=_0x5a8958;if(_0xec88b[_0x1b64('0x2b')][_0x1b64('0x38')]){_0x11543f[_0x1b64('0x39')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x1b64('0x3a')](_0x11543f);})['then'](function(_0x4dc4e8){_0x33c24e[_0x1b64('0x3b')]=_0x4dc4e8;return _0x33c24e;})[_0x1b64('0x1f')](respondWithFilteredResult(_0x115f20,_0x11543f))[_0x1b64('0x3c')](handleError(_0x115f20,null));};exports['show']=function(_0x55f9c2,_0x4696e8){var _0x27dfaf={'raw':!![],'where':{'id':_0x55f9c2['params']['id']}},_0x519961={};_0x519961[_0x1b64('0x2a')]=_[_0x1b64('0x2c')](db['SmsQueueReport']['rawAttributes']);_0x519961[_0x1b64('0x2b')]=_['keys'](_0x55f9c2[_0x1b64('0x2b')]);_0x519961[_0x1b64('0x34')]=_[_0x1b64('0x2d')](_0x519961[_0x1b64('0x2a')],_0x519961[_0x1b64('0x2b')]);_0x27dfaf[_0x1b64('0x2e')]=_[_0x1b64('0x2d')](_0x519961[_0x1b64('0x2a')],qs['fields'](_0x55f9c2['query'][_0x1b64('0x3d')]));_0x27dfaf[_0x1b64('0x2e')]=_0x27dfaf[_0x1b64('0x2e')][_0x1b64('0x3e')]?_0x27dfaf[_0x1b64('0x2e')]:_0x519961[_0x1b64('0x2a')];if(_0x55f9c2[_0x1b64('0x2b')][_0x1b64('0x38')]){_0x27dfaf[_0x1b64('0x39')]=[{'all':!![]}];}_0x27dfaf=_[_0x1b64('0x36')]({},_0x27dfaf,_0x55f9c2[_0x1b64('0x37')]);return db[_0x1b64('0x25')][_0x1b64('0x3f')](_0x27dfaf)[_0x1b64('0x1f')](handleEntityNotFound(_0x4696e8,null))[_0x1b64('0x1f')](respondWithResult(_0x4696e8,null))[_0x1b64('0x3c')](handleError(_0x4696e8,null));};exports[_0x1b64('0x40')]=function(_0x263c9e,_0x1761b9){return db['SmsQueueReport']['create'](_0x263c9e[_0x1b64('0x41')],{})[_0x1b64('0x1f')](respondWithResult(_0x1761b9,0xc9))[_0x1b64('0x3c')](handleError(_0x1761b9,null));};exports[_0x1b64('0x1e')]=function(_0x2c0615,_0x142422){if(_0x2c0615[_0x1b64('0x41')]['id']){delete _0x2c0615[_0x1b64('0x41')]['id'];}return db[_0x1b64('0x25')][_0x1b64('0x3f')]({'where':{'id':_0x2c0615[_0x1b64('0x42')]['id']}})[_0x1b64('0x1f')](handleEntityNotFound(_0x142422,null))[_0x1b64('0x1f')](saveUpdates(_0x2c0615[_0x1b64('0x41')],null))[_0x1b64('0x1f')](respondWithResult(_0x142422,null))['catch'](handleError(_0x142422,null));};exports[_0x1b64('0x43')]=function(_0x477478,_0x3deb65){return db[_0x1b64('0x25')]['find']({'where':{'id':_0x477478[_0x1b64('0x42')]['id']}})[_0x1b64('0x1f')](handleEntityNotFound(_0x3deb65,null))[_0x1b64('0x1f')](removeEntity(_0x3deb65,null))['catch'](handleError(_0x3deb65,null));};exports['describe']=function(_0x4353b3,_0x4bfc37){return db[_0x1b64('0x25')]['describe']()[_0x1b64('0x1f')](respondWithResult(_0x4bfc37,null))[_0x1b64('0x3c')](handleError(_0x4bfc37,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 261e9b5..f4ce3a3 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2be9fe,_0x4a9835){var _0x458853=function(_0x5cfb39){while(--_0x5cfb39){_0x2be9fe['push'](_0x2be9fe['shift']());}};_0x458853(++_0x4a9835);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xb2a7fc,_0x410140){var _0x1d7e03=function(_0x773b35){while(--_0x773b35){_0xb2a7fc['push'](_0xb2a7fc['shift']());}};_0x1d7e03(++_0x410140);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 77a958a..c0dcc52 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 _0x42bd=['CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','where','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1bc221,_0x286d7f){var _0x55166f=function(_0x47ec32){while(--_0x47ec32){_0x1bc221['push'](_0x1bc221['shift']());}};_0x55166f(++_0x286d7f);}(_0x42bd,0x109));var _0xd42b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x42bd[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xd42b('0x0'));var util=require(_0xd42b('0x1'));var moment=require('moment');var BPromise=require(_0xd42b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd42b('0x3'));var db=require(_0xd42b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd42b('0x5'))(_0xd42b('0x6'));var config=require('../../config/environment');var jayson=require(_0xd42b('0x7'));var client=jayson[_0xd42b('0x8')][_0xd42b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7e2f09,_0x26162b,_0x48e5db){return new BPromise(function(_0xf15503,_0x207549){return client[_0xd42b('0xa')](_0x7e2f09,_0x48e5db)[_0xd42b('0xb')](function(_0x34a3ca){logger[_0xd42b('0xc')](_0xd42b('0xd'),_0x26162b,_0xd42b('0xe'));logger[_0xd42b('0xf')](_0xd42b('0x10'),_0x26162b,_0xd42b('0xe'),JSON[_0xd42b('0x11')](_0x34a3ca));if(_0x34a3ca[_0xd42b('0x12')]){if(_0x34a3ca['error'][_0xd42b('0x13')]===0x1f4){logger[_0xd42b('0x12')](_0xd42b('0xd'),_0x26162b,_0x34a3ca[_0xd42b('0x12')][_0xd42b('0x14')]);return _0x207549(_0x34a3ca[_0xd42b('0x12')]['message']);}logger[_0xd42b('0x12')](_0xd42b('0xd'),_0x26162b,_0x34a3ca['error'][_0xd42b('0x14')]);return _0xf15503(_0x34a3ca[_0xd42b('0x12')][_0xd42b('0x14')]);}else{logger['info'](_0xd42b('0xd'),_0x26162b,_0xd42b('0xe'));_0xf15503(_0x34a3ca[_0xd42b('0x15')]['message']);}})[_0xd42b('0x16')](function(_0x1e384f){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x26162b,_0x1e384f);_0x207549(_0x1e384f);});});}exports[_0xd42b('0x17')]=function(_0x387d5f){var _0x5da272=this;return new Promise(function(_0x3b7f5c,_0x503afb){return db[_0xd42b('0x18')][_0xd42b('0x19')](_0x387d5f[_0xd42b('0x1a')],{'raw':_0x387d5f[_0xd42b('0x1b')]?_0x387d5f['options'][_0xd42b('0x1c')]===undefined?!![]:![]:!![]})[_0xd42b('0xb')](function(_0x49f9db){logger[_0xd42b('0xc')]('CreateSmsQueueReport',_0x387d5f);logger['debug']('CreateSmsQueueReport',_0x387d5f,JSON[_0xd42b('0x11')](_0x49f9db));_0x3b7f5c(_0x49f9db);})[_0xd42b('0x16')](function(_0x33a407){logger[_0xd42b('0x12')](_0xd42b('0x17'),_0x33a407['message'],_0x387d5f);_0x503afb(_0x5da272[_0xd42b('0x12')](0x1f4,_0x33a407[_0xd42b('0x14')]));});});};exports[_0xd42b('0x1d')]=function(_0x132a69){var _0x474ba8=this;return new Promise(function(_0x467857,_0x2db176){return db[_0xd42b('0x18')]['update'](_0x132a69[_0xd42b('0x1a')],{'raw':_0x132a69[_0xd42b('0x1b')]?_0x132a69[_0xd42b('0x1b')][_0xd42b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132a69['options']?_0x132a69[_0xd42b('0x1b')][_0xd42b('0x1e')]||null:null,'attributes':_0x132a69['options']?_0x132a69[_0xd42b('0x1b')]['attributes']||null:null,'limit':_0x132a69[_0xd42b('0x1b')]?_0x132a69[_0xd42b('0x1b')][_0xd42b('0x1f')]||null:null})[_0xd42b('0xb')](function(_0x2531f9){logger[_0xd42b('0xc')](_0xd42b('0x1d'),_0x132a69);logger[_0xd42b('0xf')]('UpdateSmsQueueReport',_0x132a69,JSON[_0xd42b('0x11')](_0x2531f9));_0x467857(_0x2531f9);})['catch'](function(_0x17c68b){logger[_0xd42b('0x12')](_0xd42b('0x1d'),_0x17c68b[_0xd42b('0x14')],_0x132a69);_0x2db176(_0x474ba8['error'](0x1f4,_0x17c68b[_0xd42b('0x14')]));});});}; \ No newline at end of file +var _0xba04=['info','UpdateSmsQueueReport','update','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw'];(function(_0x4eee5e,_0x199407){var _0x1537ee=function(_0x5c005f){while(--_0x5c005f){_0x4eee5e['push'](_0x4eee5e['shift']());}};_0x1537ee(++_0x199407);}(_0xba04,0xb8));var _0x4ba0=function(_0x58d5d9,_0x5d104e){_0x58d5d9=_0x58d5d9-0x0;var _0x23d483=_0xba04[_0x58d5d9];return _0x23d483;};'use strict';var _=require(_0x4ba0('0x0'));var util=require(_0x4ba0('0x1'));var moment=require('moment');var BPromise=require(_0x4ba0('0x2'));var rs=require(_0x4ba0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ba0('0x4'))['db'];var utils=require(_0x4ba0('0x5'));var logger=require('../../config/logger')(_0x4ba0('0x6'));var config=require(_0x4ba0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ba0('0x8')][_0x4ba0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43a905,_0x4fdf19,_0x41eda2){return new BPromise(function(_0x4c6994,_0x1e197a){return client['request'](_0x43a905,_0x41eda2)[_0x4ba0('0xa')](function(_0x52afce){logger['info'](_0x4ba0('0xb'),_0x4fdf19,_0x4ba0('0xc'));logger[_0x4ba0('0xd')](_0x4ba0('0xe'),_0x4fdf19,_0x4ba0('0xc'),JSON[_0x4ba0('0xf')](_0x52afce));if(_0x52afce[_0x4ba0('0x10')]){if(_0x52afce[_0x4ba0('0x10')]['code']===0x1f4){logger[_0x4ba0('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x4fdf19,_0x52afce[_0x4ba0('0x10')]['message']);return _0x1e197a(_0x52afce[_0x4ba0('0x10')][_0x4ba0('0x11')]);}logger['error'](_0x4ba0('0xb'),_0x4fdf19,_0x52afce[_0x4ba0('0x10')][_0x4ba0('0x11')]);return _0x4c6994(_0x52afce[_0x4ba0('0x10')][_0x4ba0('0x11')]);}else{logger['info'](_0x4ba0('0xb'),_0x4fdf19,_0x4ba0('0xc'));_0x4c6994(_0x52afce[_0x4ba0('0x12')]['message']);}})[_0x4ba0('0x13')](function(_0x2b9490){logger[_0x4ba0('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x4fdf19,_0x2b9490);_0x1e197a(_0x2b9490);});});}exports[_0x4ba0('0x14')]=function(_0x64dcef){var _0x5ecd3f=this;return new Promise(function(_0x408b62,_0x49721c){return db[_0x4ba0('0x15')][_0x4ba0('0x16')](_0x64dcef[_0x4ba0('0x17')],{'raw':_0x64dcef[_0x4ba0('0x18')]?_0x64dcef['options'][_0x4ba0('0x19')]===undefined?!![]:![]:!![]})[_0x4ba0('0xa')](function(_0x505c57){logger[_0x4ba0('0x1a')](_0x4ba0('0x14'),_0x64dcef);logger[_0x4ba0('0xd')](_0x4ba0('0x14'),_0x64dcef,JSON[_0x4ba0('0xf')](_0x505c57));_0x408b62(_0x505c57);})[_0x4ba0('0x13')](function(_0x3b515e){logger[_0x4ba0('0x10')](_0x4ba0('0x14'),_0x3b515e[_0x4ba0('0x11')],_0x64dcef);_0x49721c(_0x5ecd3f[_0x4ba0('0x10')](0x1f4,_0x3b515e[_0x4ba0('0x11')]));});});};exports[_0x4ba0('0x1b')]=function(_0x2db911){var _0x29ef7d=this;return new Promise(function(_0x3edb9b,_0x1c059c){return db[_0x4ba0('0x15')][_0x4ba0('0x1c')](_0x2db911['body'],{'raw':_0x2db911[_0x4ba0('0x18')]?_0x2db911[_0x4ba0('0x18')][_0x4ba0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2db911[_0x4ba0('0x18')]?_0x2db911[_0x4ba0('0x18')]['where']||null:null,'attributes':_0x2db911[_0x4ba0('0x18')]?_0x2db911[_0x4ba0('0x18')]['attributes']||null:null,'limit':_0x2db911[_0x4ba0('0x18')]?_0x2db911[_0x4ba0('0x18')][_0x4ba0('0x1d')]||null:null})[_0x4ba0('0xa')](function(_0x36e311){logger[_0x4ba0('0x1a')]('UpdateSmsQueueReport',_0x2db911);logger['debug'](_0x4ba0('0x1b'),_0x2db911,JSON[_0x4ba0('0xf')](_0x36e311));_0x3edb9b(_0x36e311);})['catch'](function(_0x97f1d7){logger[_0x4ba0('0x10')]('UpdateSmsQueueReport',_0x97f1d7[_0x4ba0('0x11')],_0x2db911);_0x1c059c(_0x29ef7d['error'](0x1f4,_0x97f1d7[_0x4ba0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 60ae31e..708b82d 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 _0xfd20=['get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xfd20,0x66));var _0x0fd2=function(_0x12a2ef,_0x59a691){_0x12a2ef=_0x12a2ef-0x0;var _0xef8691=_0xfd20[_0x12a2ef];return _0xef8691;};'use strict';var multer=require('multer');var util=require(_0x0fd2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fd2('0x1'));var router=express[_0x0fd2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0fd2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0fd2('0x4'));var controller=require(_0x0fd2('0x5'));router[_0x0fd2('0x6')]('/',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x8')]);router['get']('/describe',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x9')]);router[_0x0fd2('0x6')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xb')]);router[_0x0fd2('0xc')]('/',auth['isAuthenticated'](),controller[_0x0fd2('0xd')]);router[_0x0fd2('0xe')]('/:id',auth[_0x0fd2('0x7')](),controller['update']);router[_0x0fd2('0xf')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x10')]);module[_0x0fd2('0x11')]=router; \ No newline at end of file +var _0x56e7=['put','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x39eda4,_0x55c0d9){var _0x24a975=function(_0xeb42c7){while(--_0xeb42c7){_0x39eda4['push'](_0x39eda4['shift']());}};_0x24a975(++_0x55c0d9);}(_0x56e7,0x7b));var _0x756e=function(_0x42ed53,_0x127905){_0x42ed53=_0x42ed53-0x0;var _0x1fccff=_0x56e7[_0x42ed53];return _0x1fccff;};'use strict';var multer=require('multer');var util=require(_0x756e('0x0'));var path=require(_0x756e('0x1'));var timeout=require('connect-timeout');var express=require(_0x756e('0x2'));var router=express[_0x756e('0x3')]();var fs_extra=require(_0x756e('0x4'));var auth=require(_0x756e('0x5'));var interaction=require(_0x756e('0x6'));var config=require(_0x756e('0x7'));var controller=require(_0x756e('0x8'));router['get']('/',auth[_0x756e('0x9')](),controller[_0x756e('0xa')]);router[_0x756e('0xb')](_0x756e('0xc'),auth['isAuthenticated'](),controller[_0x756e('0xd')]);router['get'](_0x756e('0xe'),auth[_0x756e('0x9')](),controller[_0x756e('0xf')]);router[_0x756e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x756e('0x11')](_0x756e('0xe'),auth[_0x756e('0x9')](),controller['update']);router[_0x756e('0x12')](_0x756e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x756e('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 576fc10..787b26e 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x12b13a,_0x4227d1){var _0x4b5ba3=function(_0x5de822){while(--_0x5de822){_0x12b13a['push'](_0x12b13a['shift']());}};_0x4b5ba3(++_0x4227d1);}(_0xaa88,0x137));var _0x8aa8=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xaa88[_0x235482];return _0x5f5bea;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x008c,0x188));var _0xc008=function(_0x45cbcf,_0xfbdbc2){_0x45cbcf=_0x45cbcf-0x0;var _0x52ece8=_0x008c[_0x45cbcf];return _0x52ece8;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 67dca28..eb4f6df 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 _0xcee3=['show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcee3,0x9b));var _0x3cee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcee3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3cee('0x0'));var rimraf=require(_0x3cee('0x1'));var zipdir=require(_0x3cee('0x2'));var jsonpatch=require(_0x3cee('0x3'));var rp=require(_0x3cee('0x4'));var moment=require(_0x3cee('0x5'));var BPromise=require(_0x3cee('0x6'));var Mustache=require(_0x3cee('0x7'));var util=require(_0x3cee('0x8'));var path=require(_0x3cee('0x9'));var sox=require('sox');var csv=require(_0x3cee('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cee('0xb'));var squel=require(_0x3cee('0xc'));var crypto=require(_0x3cee('0xd'));var jsforce=require(_0x3cee('0xe'));var deskjs=require(_0x3cee('0xf'));var toCsv=require(_0x3cee('0xa'));var querystring=require(_0x3cee('0x10'));var Papa=require(_0x3cee('0x11'));var Redis=require('ioredis');var authService=require(_0x3cee('0x12'));var qs=require(_0x3cee('0x13'));var as=require(_0x3cee('0x14'));var hardwareService=require(_0x3cee('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x3cee('0x16'));var config=require(_0x3cee('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3cee('0x18'))['db'];function respondWithStatusCode(_0x27f441,_0x5a44f3){_0x5a44f3=_0x5a44f3||0xcc;return function(_0x59b00c){if(_0x59b00c){return _0x27f441['sendStatus'](_0x5a44f3);}return _0x27f441[_0x3cee('0x19')](_0x5a44f3)['end']();};}function respondWithResult(_0x3d71da,_0x42a96a){_0x42a96a=_0x42a96a||0xc8;return function(_0x3b7207){if(_0x3b7207){return _0x3d71da[_0x3cee('0x19')](_0x42a96a)[_0x3cee('0x1a')](_0x3b7207);}};}function respondWithFilteredResult(_0x20b517,_0x513521){return function(_0x18263c){if(_0x18263c){var _0x953878=typeof _0x513521[_0x3cee('0x1b')]===_0x3cee('0x1c')&&typeof _0x513521[_0x3cee('0x1d')]==='undefined';var _0x9fe05c=_0x18263c[_0x3cee('0x1e')];var _0x16f4fb=_0x953878?0x0:_0x513521['offset'];var _0xf7f132=_0x953878?_0x18263c[_0x3cee('0x1e')]:_0x513521[_0x3cee('0x1b')]+_0x513521[_0x3cee('0x1d')];var _0x5a207e;if(_0xf7f132>=_0x9fe05c){_0xf7f132=_0x9fe05c;_0x5a207e=0xc8;}else{_0x5a207e=0xce;}_0x20b517[_0x3cee('0x19')](_0x5a207e);return _0x20b517[_0x3cee('0x1f')](_0x3cee('0x20'),_0x16f4fb+'-'+_0xf7f132+'/'+_0x9fe05c)[_0x3cee('0x1a')](_0x18263c);}return null;};}function patchUpdates(_0x4861b4){return function(_0x1a3cc4){try{jsonpatch[_0x3cee('0x21')](_0x1a3cc4,_0x4861b4,!![]);}catch(_0x34c877){return BPromise[_0x3cee('0x22')](_0x34c877);}return _0x1a3cc4[_0x3cee('0x23')]();};}function saveUpdates(_0x288be9,_0x6dd81){return function(_0x18e9a5){if(_0x18e9a5){return _0x18e9a5[_0x3cee('0x24')](_0x288be9)[_0x3cee('0x25')](function(_0x1c350a){return _0x1c350a;});}return null;};}function removeEntity(_0x36054b,_0x293cb5){return function(_0x5838f2){if(_0x5838f2){return _0x5838f2[_0x3cee('0x26')]()[_0x3cee('0x25')](function(){_0x36054b['status'](0xcc)[_0x3cee('0x27')]();});}};}function handleEntityNotFound(_0x3554d7,_0x3715c1){return function(_0x251769){if(!_0x251769){_0x3554d7['sendStatus'](0x194);}return _0x251769;};}function handleError(_0x3e7f86,_0x12ce25){_0x12ce25=_0x12ce25||0x1f4;return function(_0x5c54aa){logger['error'](_0x5c54aa[_0x3cee('0x28')]);if(_0x5c54aa[_0x3cee('0x29')]){delete _0x5c54aa['name'];}_0x3e7f86[_0x3cee('0x19')](_0x12ce25)['send'](_0x5c54aa);};}exports[_0x3cee('0x2a')]=function(_0x42f45b,_0x5652eb){var _0x17eeb8={},_0x15688d={},_0xc0d5ed={'count':0x0,'rows':[]};var _0x1a1211=_[_0x3cee('0x2b')](db[_0x3cee('0x2c')][_0x3cee('0x2d')],function(_0x65614b){return{'name':_0x65614b[_0x3cee('0x2e')],'type':_0x65614b[_0x3cee('0x2f')]['key']};});_0x15688d[_0x3cee('0x30')]=_['map'](_0x1a1211,_0x3cee('0x29'));_0x15688d['query']=_[_0x3cee('0x31')](_0x42f45b[_0x3cee('0x32')]);_0x15688d[_0x3cee('0x33')]=_[_0x3cee('0x34')](_0x15688d[_0x3cee('0x30')],_0x15688d[_0x3cee('0x32')]);_0x17eeb8[_0x3cee('0x35')]=_[_0x3cee('0x34')](_0x15688d[_0x3cee('0x30')],qs[_0x3cee('0x36')](_0x42f45b[_0x3cee('0x32')][_0x3cee('0x36')]));_0x17eeb8[_0x3cee('0x35')]=_0x17eeb8[_0x3cee('0x35')][_0x3cee('0x37')]?_0x17eeb8[_0x3cee('0x35')]:_0x15688d[_0x3cee('0x30')];if(!_0x42f45b['query'][_0x3cee('0x38')](_0x3cee('0x39'))){_0x17eeb8[_0x3cee('0x1d')]=qs[_0x3cee('0x1d')](_0x42f45b[_0x3cee('0x32')][_0x3cee('0x1d')]);_0x17eeb8[_0x3cee('0x1b')]=qs[_0x3cee('0x1b')](_0x42f45b['query'][_0x3cee('0x1b')]);}_0x17eeb8[_0x3cee('0x3a')]=qs[_0x3cee('0x3b')](_0x42f45b['query'][_0x3cee('0x3b')]);_0x17eeb8[_0x3cee('0x3c')]=qs[_0x3cee('0x33')](_['pick'](_0x42f45b[_0x3cee('0x32')],_0x15688d[_0x3cee('0x33')]),_0x1a1211);if(_0x42f45b[_0x3cee('0x32')][_0x3cee('0x3d')]){_0x17eeb8['where']=_[_0x3cee('0x3e')](_0x17eeb8[_0x3cee('0x3c')],{'$or':_[_0x3cee('0x2b')](_0x1a1211,function(_0x24b8f8){if(_0x24b8f8[_0x3cee('0x2f')]!=='VIRTUAL'){var _0x27655b={};_0x27655b[_0x24b8f8[_0x3cee('0x29')]]={'$like':'%'+_0x42f45b['query'][_0x3cee('0x3d')]+'%'};return _0x27655b;}})});}_0x17eeb8=_[_0x3cee('0x3e')]({},_0x17eeb8,_0x42f45b[_0x3cee('0x3f')]);var _0x571f59={'where':_0x17eeb8['where']};return db['SmsTransferReport']['count'](_0x571f59)['then'](function(_0xddbe65){_0xc0d5ed[_0x3cee('0x1e')]=_0xddbe65;if(_0x42f45b[_0x3cee('0x32')]['includeAll']){_0x17eeb8[_0x3cee('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x3cee('0x41')](_0x17eeb8);})[_0x3cee('0x25')](function(_0x583682){_0xc0d5ed['rows']=_0x583682;return _0xc0d5ed;})[_0x3cee('0x25')](respondWithFilteredResult(_0x5652eb,_0x17eeb8))[_0x3cee('0x42')](handleError(_0x5652eb,null));};exports[_0x3cee('0x43')]=function(_0x1a5edc,_0x6fd7d3){var _0x208168={'raw':!![],'where':{'id':_0x1a5edc['params']['id']}},_0x4e032a={};_0x4e032a[_0x3cee('0x30')]=_[_0x3cee('0x31')](db['SmsTransferReport'][_0x3cee('0x2d')]);_0x4e032a[_0x3cee('0x32')]=_[_0x3cee('0x31')](_0x1a5edc[_0x3cee('0x32')]);_0x4e032a[_0x3cee('0x33')]=_[_0x3cee('0x34')](_0x4e032a[_0x3cee('0x30')],_0x4e032a['query']);_0x208168[_0x3cee('0x35')]=_[_0x3cee('0x34')](_0x4e032a[_0x3cee('0x30')],qs[_0x3cee('0x36')](_0x1a5edc[_0x3cee('0x32')][_0x3cee('0x36')]));_0x208168[_0x3cee('0x35')]=_0x208168[_0x3cee('0x35')][_0x3cee('0x37')]?_0x208168[_0x3cee('0x35')]:_0x4e032a[_0x3cee('0x30')];if(_0x1a5edc[_0x3cee('0x32')][_0x3cee('0x44')]){_0x208168[_0x3cee('0x40')]=[{'all':!![]}];}_0x208168=_[_0x3cee('0x3e')]({},_0x208168,_0x1a5edc[_0x3cee('0x3f')]);return db['SmsTransferReport'][_0x3cee('0x45')](_0x208168)[_0x3cee('0x25')](handleEntityNotFound(_0x6fd7d3,null))[_0x3cee('0x25')](respondWithResult(_0x6fd7d3,null))[_0x3cee('0x42')](handleError(_0x6fd7d3,null));};exports[_0x3cee('0x46')]=function(_0x562027,_0x392be5){return db[_0x3cee('0x2c')][_0x3cee('0x46')](_0x562027[_0x3cee('0x47')],{})[_0x3cee('0x25')](respondWithResult(_0x392be5,0xc9))[_0x3cee('0x42')](handleError(_0x392be5,null));};exports[_0x3cee('0x24')]=function(_0x257c94,_0x4c35d6){if(_0x257c94[_0x3cee('0x47')]['id']){delete _0x257c94['body']['id'];}return db[_0x3cee('0x2c')][_0x3cee('0x45')]({'where':{'id':_0x257c94[_0x3cee('0x48')]['id']}})[_0x3cee('0x25')](handleEntityNotFound(_0x4c35d6,null))['then'](saveUpdates(_0x257c94[_0x3cee('0x47')],null))[_0x3cee('0x25')](respondWithResult(_0x4c35d6,null))[_0x3cee('0x42')](handleError(_0x4c35d6,null));};exports[_0x3cee('0x26')]=function(_0x4ecd1e,_0x3b2bca){return db[_0x3cee('0x2c')][_0x3cee('0x45')]({'where':{'id':_0x4ecd1e[_0x3cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b2bca,null))[_0x3cee('0x25')](removeEntity(_0x3b2bca,null))[_0x3cee('0x42')](handleError(_0x3b2bca,null));};exports[_0x3cee('0x49')]=function(_0x150511,_0x305230){return db[_0x3cee('0x2c')][_0x3cee('0x49')]()[_0x3cee('0x25')](respondWithResult(_0x305230,null))[_0x3cee('0x42')](handleError(_0x305230,null));}; \ No newline at end of file +var _0x01f0=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','index','SmsTransferReport','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type'];(function(_0x314453,_0x3751ca){var _0x3ac2dc=function(_0x175910){while(--_0x175910){_0x314453['push'](_0x314453['shift']());}};_0x3ac2dc(++_0x3751ca);}(_0x01f0,0xac));var _0x001f=function(_0x45a87a,_0x4c6946){_0x45a87a=_0x45a87a-0x0;var _0x38baa3=_0x01f0[_0x45a87a];return _0x38baa3;};'use strict';var emlformat=require(_0x001f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x001f('0x1'));var jsonpatch=require(_0x001f('0x2'));var rp=require(_0x001f('0x3'));var moment=require(_0x001f('0x4'));var BPromise=require(_0x001f('0x5'));var Mustache=require(_0x001f('0x6'));var util=require('util');var path=require(_0x001f('0x7'));var sox=require(_0x001f('0x8'));var csv=require(_0x001f('0x9'));var ejs=require(_0x001f('0xa'));var fs=require('fs');var fs_extra=require(_0x001f('0xb'));var _=require('lodash');var squel=require(_0x001f('0xc'));var crypto=require('crypto');var jsforce=require(_0x001f('0xd'));var deskjs=require(_0x001f('0xe'));var toCsv=require(_0x001f('0x9'));var querystring=require(_0x001f('0xf'));var Papa=require(_0x001f('0x10'));var Redis=require(_0x001f('0x11'));var authService=require(_0x001f('0x12'));var qs=require(_0x001f('0x13'));var as=require(_0x001f('0x14'));var hardwareService=require(_0x001f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x001f('0x16'));var config=require(_0x001f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x001f('0x18'))['db'];function respondWithStatusCode(_0x276b11,_0x2df2df){_0x2df2df=_0x2df2df||0xcc;return function(_0x1f787d){if(_0x1f787d){return _0x276b11[_0x001f('0x19')](_0x2df2df);}return _0x276b11[_0x001f('0x1a')](_0x2df2df)['end']();};}function respondWithResult(_0x199617,_0x56514b){_0x56514b=_0x56514b||0xc8;return function(_0x58d8f8){if(_0x58d8f8){return _0x199617['status'](_0x56514b)[_0x001f('0x1b')](_0x58d8f8);}};}function respondWithFilteredResult(_0x2299d2,_0x462c81){return function(_0x1a38f2){if(_0x1a38f2){var _0x233da1=typeof _0x462c81[_0x001f('0x1c')]===_0x001f('0x1d')&&typeof _0x462c81['limit']===_0x001f('0x1d');var _0x1f55e8=_0x1a38f2[_0x001f('0x1e')];var _0x59b274=_0x233da1?0x0:_0x462c81['offset'];var _0x1006dd=_0x233da1?_0x1a38f2['count']:_0x462c81['offset']+_0x462c81[_0x001f('0x1f')];var _0x3c7349;if(_0x1006dd>=_0x1f55e8){_0x1006dd=_0x1f55e8;_0x3c7349=0xc8;}else{_0x3c7349=0xce;}_0x2299d2[_0x001f('0x1a')](_0x3c7349);return _0x2299d2[_0x001f('0x20')](_0x001f('0x21'),_0x59b274+'-'+_0x1006dd+'/'+_0x1f55e8)[_0x001f('0x1b')](_0x1a38f2);}return null;};}function patchUpdates(_0x249470){return function(_0x43065f){try{jsonpatch[_0x001f('0x22')](_0x43065f,_0x249470,!![]);}catch(_0x14a9ce){return BPromise[_0x001f('0x23')](_0x14a9ce);}return _0x43065f[_0x001f('0x24')]();};}function saveUpdates(_0x5d051a,_0x4415d6){return function(_0x1baa63){if(_0x1baa63){return _0x1baa63['update'](_0x5d051a)[_0x001f('0x25')](function(_0xb7027e){return _0xb7027e;});}return null;};}function removeEntity(_0x135d29,_0x3cac9a){return function(_0x237ab1){if(_0x237ab1){return _0x237ab1[_0x001f('0x26')]()[_0x001f('0x25')](function(){_0x135d29[_0x001f('0x1a')](0xcc)[_0x001f('0x27')]();});}};}function handleEntityNotFound(_0x2cf854,_0x4bc3f0){return function(_0x4b2a27){if(!_0x4b2a27){_0x2cf854[_0x001f('0x19')](0x194);}return _0x4b2a27;};}function handleError(_0x40b9fe,_0x3d1d76){_0x3d1d76=_0x3d1d76||0x1f4;return function(_0x124736){logger[_0x001f('0x28')](_0x124736['stack']);if(_0x124736[_0x001f('0x29')]){delete _0x124736[_0x001f('0x29')];}_0x40b9fe[_0x001f('0x1a')](_0x3d1d76)['send'](_0x124736);};}exports[_0x001f('0x2a')]=function(_0x5e3c67,_0x4cb3da){var _0x4a0ab2={},_0x3e9833={},_0xbb96f4={'count':0x0,'rows':[]};var _0x1ab6ad=_['map'](db[_0x001f('0x2b')][_0x001f('0x2c')],function(_0x2fabf6){return{'name':_0x2fabf6[_0x001f('0x2d')],'type':_0x2fabf6['type']['key']};});_0x3e9833[_0x001f('0x2e')]=_[_0x001f('0x2f')](_0x1ab6ad,'name');_0x3e9833[_0x001f('0x30')]=_[_0x001f('0x31')](_0x5e3c67[_0x001f('0x30')]);_0x3e9833[_0x001f('0x32')]=_['intersection'](_0x3e9833[_0x001f('0x2e')],_0x3e9833[_0x001f('0x30')]);_0x4a0ab2[_0x001f('0x33')]=_[_0x001f('0x34')](_0x3e9833['model'],qs[_0x001f('0x35')](_0x5e3c67['query'][_0x001f('0x35')]));_0x4a0ab2[_0x001f('0x33')]=_0x4a0ab2[_0x001f('0x33')]['length']?_0x4a0ab2[_0x001f('0x33')]:_0x3e9833[_0x001f('0x2e')];if(!_0x5e3c67['query'][_0x001f('0x36')](_0x001f('0x37'))){_0x4a0ab2[_0x001f('0x1f')]=qs['limit'](_0x5e3c67[_0x001f('0x30')][_0x001f('0x1f')]);_0x4a0ab2['offset']=qs[_0x001f('0x1c')](_0x5e3c67['query']['offset']);}_0x4a0ab2[_0x001f('0x38')]=qs[_0x001f('0x39')](_0x5e3c67[_0x001f('0x30')][_0x001f('0x39')]);_0x4a0ab2['where']=qs[_0x001f('0x32')](_[_0x001f('0x3a')](_0x5e3c67[_0x001f('0x30')],_0x3e9833[_0x001f('0x32')]),_0x1ab6ad);if(_0x5e3c67['query'][_0x001f('0x3b')]){_0x4a0ab2[_0x001f('0x3c')]=_['merge'](_0x4a0ab2['where'],{'$or':_[_0x001f('0x2f')](_0x1ab6ad,function(_0x13941a){if(_0x13941a[_0x001f('0x3d')]!==_0x001f('0x3e')){var _0x4b3220={};_0x4b3220[_0x13941a[_0x001f('0x29')]]={'$like':'%'+_0x5e3c67[_0x001f('0x30')][_0x001f('0x3b')]+'%'};return _0x4b3220;}})});}_0x4a0ab2=_['merge']({},_0x4a0ab2,_0x5e3c67[_0x001f('0x3f')]);var _0x4eeff7={'where':_0x4a0ab2['where']};return db['SmsTransferReport'][_0x001f('0x1e')](_0x4eeff7)[_0x001f('0x25')](function(_0x5b16bc){_0xbb96f4[_0x001f('0x1e')]=_0x5b16bc;if(_0x5e3c67['query'][_0x001f('0x40')]){_0x4a0ab2[_0x001f('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x001f('0x42')](_0x4a0ab2);})['then'](function(_0x1e8485){_0xbb96f4[_0x001f('0x43')]=_0x1e8485;return _0xbb96f4;})[_0x001f('0x25')](respondWithFilteredResult(_0x4cb3da,_0x4a0ab2))[_0x001f('0x44')](handleError(_0x4cb3da,null));};exports[_0x001f('0x45')]=function(_0x504de1,_0x1183f0){var _0x44e28d={'raw':!![],'where':{'id':_0x504de1[_0x001f('0x46')]['id']}},_0x160abd={};_0x160abd['model']=_[_0x001f('0x31')](db[_0x001f('0x2b')]['rawAttributes']);_0x160abd[_0x001f('0x30')]=_[_0x001f('0x31')](_0x504de1[_0x001f('0x30')]);_0x160abd['filters']=_[_0x001f('0x34')](_0x160abd[_0x001f('0x2e')],_0x160abd[_0x001f('0x30')]);_0x44e28d[_0x001f('0x33')]=_[_0x001f('0x34')](_0x160abd['model'],qs['fields'](_0x504de1[_0x001f('0x30')][_0x001f('0x35')]));_0x44e28d[_0x001f('0x33')]=_0x44e28d[_0x001f('0x33')][_0x001f('0x47')]?_0x44e28d[_0x001f('0x33')]:_0x160abd[_0x001f('0x2e')];if(_0x504de1[_0x001f('0x30')]['includeAll']){_0x44e28d['include']=[{'all':!![]}];}_0x44e28d=_[_0x001f('0x48')]({},_0x44e28d,_0x504de1[_0x001f('0x3f')]);return db[_0x001f('0x2b')][_0x001f('0x49')](_0x44e28d)[_0x001f('0x25')](handleEntityNotFound(_0x1183f0,null))['then'](respondWithResult(_0x1183f0,null))[_0x001f('0x44')](handleError(_0x1183f0,null));};exports[_0x001f('0x4a')]=function(_0x1acfa0,_0xb64eb5){return db['SmsTransferReport'][_0x001f('0x4a')](_0x1acfa0[_0x001f('0x4b')],{})[_0x001f('0x25')](respondWithResult(_0xb64eb5,0xc9))[_0x001f('0x44')](handleError(_0xb64eb5,null));};exports[_0x001f('0x4c')]=function(_0x1c37a3,_0x3ac6dd){if(_0x1c37a3[_0x001f('0x4b')]['id']){delete _0x1c37a3[_0x001f('0x4b')]['id'];}return db[_0x001f('0x2b')]['find']({'where':{'id':_0x1c37a3[_0x001f('0x46')]['id']}})[_0x001f('0x25')](handleEntityNotFound(_0x3ac6dd,null))[_0x001f('0x25')](saveUpdates(_0x1c37a3[_0x001f('0x4b')],null))[_0x001f('0x25')](respondWithResult(_0x3ac6dd,null))[_0x001f('0x44')](handleError(_0x3ac6dd,null));};exports['destroy']=function(_0x2dcaec,_0x1415f1){return db[_0x001f('0x2b')]['find']({'where':{'id':_0x2dcaec[_0x001f('0x46')]['id']}})[_0x001f('0x25')](handleEntityNotFound(_0x1415f1,null))[_0x001f('0x25')](removeEntity(_0x1415f1,null))['catch'](handleError(_0x1415f1,null));};exports[_0x001f('0x4d')]=function(_0x1bb07b,_0x3414a0){return db[_0x001f('0x2b')]['describe']()[_0x001f('0x25')](respondWithResult(_0x3414a0,null))[_0x001f('0x44')](handleError(_0x3414a0,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0686565..4e56cc5 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 _0xbdba=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./smsTransferReport.attributes','exports','define'];(function(_0x558303,_0x574a65){var _0x2633fd=function(_0x1f564b){while(--_0x1f564b){_0x558303['push'](_0x558303['shift']());}};_0x2633fd(++_0x574a65);}(_0xbdba,0x107));var _0xabdb=function(_0xdb344f,_0xd0f413){_0xdb344f=_0xdb344f-0x0;var _0x1addba=_0xbdba[_0xdb344f];return _0x1addba;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var moment=require(_0xabdb('0x3'));var BPromise=require(_0xabdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabdb('0x5'));var rimraf=require(_0xabdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xabdb('0x7'));module[_0xabdb('0x8')]=function(_0x235516,_0x5eed78){return _0x235516[_0xabdb('0x9')](_0xabdb('0xa'),attributes,{'tableName':_0xabdb('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xabdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['moment','bluebird','request-promise','path','rimraf','exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x45496a,_0x3a2857){var _0x1232e1=function(_0x6e66cb){while(--_0x6e66cb){_0x45496a['push'](_0x45496a['shift']());}};_0x1232e1(++_0x3a2857);}(_0x867f,0xe6));var _0xf867=function(_0x132fb6,_0x7a257b){_0x132fb6=_0x132fb6-0x0;var _0x2ca9d5=_0x867f[_0x132fb6];return _0x2ca9d5;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf867('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 f56434d..bb59ee8 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 _0x3663=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result'];(function(_0x40a984,_0x4ac12e){var _0x5a9344=function(_0x1d1ad7){while(--_0x1d1ad7){_0x40a984['push'](_0x40a984['shift']());}};_0x5a9344(++_0x4ac12e);}(_0x3663,0x1cf));var _0x3366=function(_0x342696,_0x146f50){_0x342696=_0x342696-0x0;var _0x15b8e4=_0x3663[_0x342696];return _0x15b8e4;};'use strict';var _=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var moment=require(_0x3366('0x2'));var BPromise=require('bluebird');var rs=require(_0x3366('0x3'));var fs=require('fs');var Redis=require(_0x3366('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3366('0x5'));var logger=require(_0x3366('0x6'))(_0x3366('0x7'));var config=require(_0x3366('0x8'));var jayson=require(_0x3366('0x9'));var client=jayson['client'][_0x3366('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348f53,_0x4c734f,_0x5c10c1){return new BPromise(function(_0x1d802b,_0x304f68){return client['request'](_0x348f53,_0x5c10c1)[_0x3366('0xb')](function(_0x2a681e){logger[_0x3366('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4c734f,_0x3366('0xd'));logger[_0x3366('0xe')](_0x3366('0xf'),_0x4c734f,_0x3366('0xd'),JSON[_0x3366('0x10')](_0x2a681e));if(_0x2a681e[_0x3366('0x11')]){if(_0x2a681e[_0x3366('0x11')]['code']===0x1f4){logger['error'](_0x3366('0x12'),_0x4c734f,_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);return _0x304f68(_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);}logger[_0x3366('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4c734f,_0x2a681e['error'][_0x3366('0x13')]);return _0x1d802b(_0x2a681e['error'][_0x3366('0x13')]);}else{logger[_0x3366('0xc')](_0x3366('0x12'),_0x4c734f,_0x3366('0xd'));_0x1d802b(_0x2a681e[_0x3366('0x14')]['message']);}})[_0x3366('0x15')](function(_0x14139a){logger[_0x3366('0x11')](_0x3366('0x12'),_0x4c734f,_0x14139a);_0x304f68(_0x14139a);});});} \ No newline at end of file +var _0xe700=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2971c0,_0x1d3988){var _0x13e881=function(_0xa50317){while(--_0xa50317){_0x2971c0['push'](_0x2971c0['shift']());}};_0x13e881(++_0x1d3988);}(_0xe700,0x16a));var _0x0e70=function(_0x52fb2d,_0x7a88dc){_0x52fb2d=_0x52fb2d-0x0;var _0x1d2f82=_0xe700[_0x52fb2d];return _0x1d2f82;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var moment=require(_0x0e70('0x2'));var BPromise=require(_0x0e70('0x3'));var rs=require(_0x0e70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e70('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e70('0x6'))(_0x0e70('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e70('0x8')][_0x0e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4415bb,_0x65a900,_0x51382d){return new BPromise(function(_0x33f0c3,_0x37da83){return client[_0x0e70('0xa')](_0x4415bb,_0x51382d)[_0x0e70('0xb')](function(_0x151c76){logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,'request\x20sent');logger[_0x0e70('0xe')](_0x0e70('0xf'),_0x65a900,_0x0e70('0x10'),JSON['stringify'](_0x151c76));if(_0x151c76[_0x0e70('0x11')]){if(_0x151c76[_0x0e70('0x11')][_0x0e70('0x12')]===0x1f4){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')]['message']);return _0x37da83(_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);}logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);return _0x33f0c3(_0x151c76['error']['message']);}else{logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,_0x0e70('0x10'));_0x33f0c3(_0x151c76['result'][_0x0e70('0x13')]);}})[_0x0e70('0x14')](function(_0x3c9545){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x3c9545);_0x37da83(_0x3c9545);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index b6e3aca..dd88bad 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 _0x52a9=['extname','now','single','file','create','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x52a9,0x9c));var _0x952a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x52a9[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x952a('0x0'));var util=require(_0x952a('0x1'));var path=require(_0x952a('0x2'));var timeout=require(_0x952a('0x3'));var express=require(_0x952a('0x4'));var router=express[_0x952a('0x5')]();var fs_extra=require(_0x952a('0x6'));var auth=require(_0x952a('0x7'));var interaction=require(_0x952a('0x8'));var config=require(_0x952a('0x9'));var controller=require('./sound.controller');router[_0x952a('0xa')]('/',auth[_0x952a('0xb')](),controller[_0x952a('0xc')]);router[_0x952a('0xa')](_0x952a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x952a('0xa')](_0x952a('0xe'),auth['isAuthenticated'](),controller[_0x952a('0xf')]);var upload=multer({'storage':multer[_0x952a('0x10')]({'destination':function(_0x5aeaef,_0x41c443,_0x4e76fe){_0x4e76fe(null,path[_0x952a('0x11')](config[_0x952a('0x12')],_0x952a('0x13')));},'filename':function(_0x1ec09d,_0x9e59a9,_0xc119a2){_0x9e59a9[_0x952a('0x14')]=_0x9e59a9[_0x952a('0x14')][_0x952a('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc119a2(null,util[_0x952a('0x16')](_0x952a('0x17'),path['basename'](_0x9e59a9['originalname'],path[_0x952a('0x18')](_0x9e59a9[_0x952a('0x14')])),Date[_0x952a('0x19')](),path[_0x952a('0x18')](_0x9e59a9['originalname'])));}})});router['post']('/',upload[_0x952a('0x1a')](_0x952a('0x1b')),controller[_0x952a('0x1c')]);router['put']('/:id',auth[_0x952a('0xb')](),controller['update']);router[_0x952a('0x1d')](_0x952a('0xd'),auth[_0x952a('0xb')](),controller[_0x952a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x95ae=['extname','post','single','file','create','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','index','/:id','show','isAuthenticated','diskStorage','join','root','originalname','format','%s-%s%s','basename','now'];(function(_0x225042,_0x2c6432){var _0x1797bc=function(_0x217bef){while(--_0x217bef){_0x225042['push'](_0x225042['shift']());}};_0x1797bc(++_0x2c6432);}(_0x95ae,0x19b));var _0xe95a=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x95ae[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xe95a('0x0'));var util=require(_0xe95a('0x1'));var path=require('path');var timeout=require(_0xe95a('0x2'));var express=require(_0xe95a('0x3'));var router=express[_0xe95a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe95a('0x5'));var interaction=require(_0xe95a('0x6'));var config=require('../../config/environment');var controller=require(_0xe95a('0x7'));router[_0xe95a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe95a('0x9')]);router['get'](_0xe95a('0xa'),auth['isAuthenticated'](),controller[_0xe95a('0xb')]);router[_0xe95a('0x8')]('/:id/download',auth[_0xe95a('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xe95a('0xd')]({'destination':function(_0xbe5721,_0x1b175b,_0x1d3036){_0x1d3036(null,path[_0xe95a('0xe')](config[_0xe95a('0xf')],'server/files/sounds/original/'));},'filename':function(_0x9cff05,_0x4ca8c6,_0x1497e8){_0x4ca8c6[_0xe95a('0x10')]=_0x4ca8c6['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1497e8(null,util[_0xe95a('0x11')](_0xe95a('0x12'),path[_0xe95a('0x13')](_0x4ca8c6[_0xe95a('0x10')],path['extname'](_0x4ca8c6[_0xe95a('0x10')])),Date[_0xe95a('0x14')](),path[_0xe95a('0x15')](_0x4ca8c6[_0xe95a('0x10')])));}})});router[_0xe95a('0x16')]('/',upload[_0xe95a('0x17')](_0xe95a('0x18')),controller[_0xe95a('0x19')]);router['put']('/:id',auth[_0xe95a('0xc')](),controller['update']);router[_0xe95a('0x1a')]('/:id',auth[_0xe95a('0xc')](),controller[_0xe95a('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a1a0816..3a809f0 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 _0x22d0=['FLOAT','INTEGER','BIGINT','sequelize','exports','STRING','name'];(function(_0x3643fe,_0x52e887){var _0x45f267=function(_0x1ca04c){while(--_0x1ca04c){_0x3643fe['push'](_0x3643fe['shift']());}};_0x45f267(++_0x52e887);}(_0x22d0,0x106));var _0x022d=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0x22d0[_0x11fc8b];return _0x4ea86e;};'use strict';var Sequelize=require(_0x022d('0x0'));module[_0x022d('0x1')]={'name':{'type':Sequelize[_0x022d('0x2')],'unique':_0x022d('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x022d('0x2')]},'display_name':{'type':Sequelize[_0x022d('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x022d('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x022d('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x022d('0x5')]},'original_bitRate':{'type':Sequelize[_0x022d('0x6')]},'original_sampleRate':{'type':Sequelize[_0x022d('0x5')]},'converted_format':{'type':Sequelize[_0x022d('0x2')]},'converted_duration':{'type':Sequelize[_0x022d('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x022d('0x5')]},'converted_bitRate':{'type':Sequelize[_0x022d('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x022d('0x5')]}}; \ No newline at end of file +var _0x65d3=['INTEGER','FLOAT','exports','STRING','name','BIGINT'];(function(_0x16fad7,_0x48e3bd){var _0x570fa1=function(_0x242de8){while(--_0x242de8){_0x16fad7['push'](_0x16fad7['shift']());}};_0x570fa1(++_0x48e3bd);}(_0x65d3,0x134));var _0x365d=function(_0x7bcc35,_0x450fd0){_0x7bcc35=_0x7bcc35-0x0;var _0xa5cad9=_0x65d3[_0x7bcc35];return _0xa5cad9;};'use strict';var Sequelize=require('sequelize');module[_0x365d('0x0')]={'name':{'type':Sequelize[_0x365d('0x1')],'unique':_0x365d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x365d('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x365d('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x365d('0x3')]},'original_channelCount':{'type':Sequelize[_0x365d('0x4')]},'original_bitRate':{'type':Sequelize[_0x365d('0x3')]},'original_sampleRate':{'type':Sequelize[_0x365d('0x4')]},'converted_format':{'type':Sequelize[_0x365d('0x1')]},'converted_duration':{'type':Sequelize[_0x365d('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x365d('0x4')]},'converted_bitRate':{'type':Sequelize[_0x365d('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x365d('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c934a19..2010016 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 _0xf88a=['query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','catch','keys','fields','download','find','params','save_name','converted_format','existsSync','join','root','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','%s.%s','format','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','map','Sound','fieldName','type'];(function(_0x49cadd,_0x2f8d0b){var _0x27836c=function(_0x571096){while(--_0x571096){_0x49cadd['push'](_0x49cadd['shift']());}};_0x27836c(++_0x2f8d0b);}(_0xf88a,0x13c));var _0xaf88=function(_0x22f306,_0x2caec5){_0x22f306=_0x22f306-0x0;var _0xb246a1=_0xf88a[_0x22f306];return _0xb246a1;};'use strict';var emlformat=require(_0xaf88('0x0'));var rimraf=require(_0xaf88('0x1'));var zipdir=require(_0xaf88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf88('0x3'));var BPromise=require(_0xaf88('0x4'));var Mustache=require(_0xaf88('0x5'));var util=require('util');var path=require(_0xaf88('0x6'));var sox=require('sox');var csv=require(_0xaf88('0x7'));var ejs=require(_0xaf88('0x8'));var fs=require('fs');var fs_extra=require(_0xaf88('0x9'));var _=require(_0xaf88('0xa'));var squel=require(_0xaf88('0xb'));var crypto=require(_0xaf88('0xc'));var jsforce=require(_0xaf88('0xd'));var deskjs=require(_0xaf88('0xe'));var toCsv=require(_0xaf88('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf88('0xf'));var authService=require(_0xaf88('0x10'));var qs=require(_0xaf88('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf88('0x12'));var logger=require(_0xaf88('0x13'))('api');var utils=require(_0xaf88('0x14'));var config=require(_0xaf88('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf88('0x16'))['db'];function respondWithStatusCode(_0x2f560a,_0x361c4b){_0x361c4b=_0x361c4b||0xcc;return function(_0x19ee3b){if(_0x19ee3b){return _0x2f560a['sendStatus'](_0x361c4b);}return _0x2f560a[_0xaf88('0x17')](_0x361c4b)[_0xaf88('0x18')]();};}function respondWithResult(_0x4ef983,_0x13533b){_0x13533b=_0x13533b||0xc8;return function(_0x3b96aa){if(_0x3b96aa){return _0x4ef983['status'](_0x13533b)[_0xaf88('0x19')](_0x3b96aa);}};}function respondWithFilteredResult(_0x34da4c,_0x3802a9){return function(_0xf0a3c9){if(_0xf0a3c9){var _0x5ef9c1=typeof _0x3802a9['offset']===_0xaf88('0x1a')&&typeof _0x3802a9[_0xaf88('0x1b')]===_0xaf88('0x1a');var _0x50fd3d=_0xf0a3c9[_0xaf88('0x1c')];var _0x42e802=_0x5ef9c1?0x0:_0x3802a9[_0xaf88('0x1d')];var _0x11b4c8=_0x5ef9c1?_0xf0a3c9[_0xaf88('0x1c')]:_0x3802a9[_0xaf88('0x1d')]+_0x3802a9[_0xaf88('0x1b')];var _0x44ce8c;if(_0x11b4c8>=_0x50fd3d){_0x11b4c8=_0x50fd3d;_0x44ce8c=0xc8;}else{_0x44ce8c=0xce;}_0x34da4c['status'](_0x44ce8c);return _0x34da4c[_0xaf88('0x1e')](_0xaf88('0x1f'),_0x42e802+'-'+_0x11b4c8+'/'+_0x50fd3d)[_0xaf88('0x19')](_0xf0a3c9);}return null;};}function patchUpdates(_0x56b92f){return function(_0x37cdd7){try{jsonpatch[_0xaf88('0x20')](_0x37cdd7,_0x56b92f,!![]);}catch(_0x26eca7){return BPromise['reject'](_0x26eca7);}return _0x37cdd7[_0xaf88('0x21')]();};}function saveUpdates(_0x4d668e,_0x171f42){return function(_0x1c4115){if(_0x1c4115){return _0x1c4115[_0xaf88('0x22')](_0x4d668e)[_0xaf88('0x23')](function(_0x34f807){return _0x34f807;});}return null;};}function removeEntity(_0x2d00e5,_0x26d159){return function(_0x153890){if(_0x153890){return _0x153890[_0xaf88('0x24')]()[_0xaf88('0x23')](function(){var _0x3693be=_0x153890[_0xaf88('0x25')]({'plain':!![]});var _0x3ccdf1='Sounds';return db[_0xaf88('0x26')][_0xaf88('0x24')]({'where':{'type':_0x3ccdf1,'resourceId':_0x3693be['id']}})['then'](function(){return _0x153890;});})['then'](function(){_0x2d00e5[_0xaf88('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209129,_0x1bbcc9){return function(_0x178706){if(!_0x178706){_0x209129[_0xaf88('0x27')](0x194);}return _0x178706;};}function handleError(_0x53ec7a,_0x3f3a28){_0x3f3a28=_0x3f3a28||0x1f4;return function(_0x935c24){logger[_0xaf88('0x28')](_0x935c24['stack']);if(_0x935c24[_0xaf88('0x29')]){delete _0x935c24[_0xaf88('0x29')];}_0x53ec7a[_0xaf88('0x17')](_0x3f3a28)['send'](_0x935c24);};}exports[_0xaf88('0x2a')]=function(_0x1de46f,_0x4a3d4c){var _0x40b085={},_0x203aa1={},_0x2ae039={'count':0x0,'rows':[]};var _0x2de0cf=_[_0xaf88('0x2b')](db[_0xaf88('0x2c')]['rawAttributes'],function(_0x3f0d2f){return{'name':_0x3f0d2f[_0xaf88('0x2d')],'type':_0x3f0d2f[_0xaf88('0x2e')]['key']};});_0x203aa1['model']=_[_0xaf88('0x2b')](_0x2de0cf,_0xaf88('0x29'));_0x203aa1[_0xaf88('0x2f')]=_['keys'](_0x1de46f['query']);_0x203aa1[_0xaf88('0x30')]=_[_0xaf88('0x31')](_0x203aa1[_0xaf88('0x32')],_0x203aa1[_0xaf88('0x2f')]);_0x40b085['attributes']=_[_0xaf88('0x31')](_0x203aa1[_0xaf88('0x32')],qs['fields'](_0x1de46f[_0xaf88('0x2f')]['fields']));_0x40b085[_0xaf88('0x33')]=_0x40b085[_0xaf88('0x33')][_0xaf88('0x34')]?_0x40b085[_0xaf88('0x33')]:_0x203aa1['model'];if(!_0x1de46f[_0xaf88('0x2f')][_0xaf88('0x35')](_0xaf88('0x36'))){_0x40b085[_0xaf88('0x1b')]=qs[_0xaf88('0x1b')](_0x1de46f[_0xaf88('0x2f')]['limit']);_0x40b085[_0xaf88('0x1d')]=qs[_0xaf88('0x1d')](_0x1de46f[_0xaf88('0x2f')][_0xaf88('0x1d')]);}_0x40b085[_0xaf88('0x37')]=qs['sort'](_0x1de46f[_0xaf88('0x2f')][_0xaf88('0x38')]);_0x40b085[_0xaf88('0x39')]=qs[_0xaf88('0x30')](_['pick'](_0x1de46f[_0xaf88('0x2f')],_0x203aa1[_0xaf88('0x30')]),_0x2de0cf);if(_0x1de46f[_0xaf88('0x2f')][_0xaf88('0x3a')]){_0x40b085[_0xaf88('0x39')]=_[_0xaf88('0x3b')](_0x40b085[_0xaf88('0x39')],{'$or':_[_0xaf88('0x2b')](_0x2de0cf,function(_0x4d8c3c){if(_0x4d8c3c[_0xaf88('0x2e')]!=='VIRTUAL'){var _0x337937={};_0x337937[_0x4d8c3c[_0xaf88('0x29')]]={'$like':'%'+_0x1de46f[_0xaf88('0x2f')][_0xaf88('0x3a')]+'%'};return _0x337937;}})});}_0x40b085=_[_0xaf88('0x3b')]({},_0x40b085,_0x1de46f[_0xaf88('0x3c')]);var _0x45b535={'where':_0x40b085[_0xaf88('0x39')]};return db[_0xaf88('0x2c')][_0xaf88('0x1c')](_0x45b535)[_0xaf88('0x23')](function(_0x1d3a5c){_0x2ae039[_0xaf88('0x1c')]=_0x1d3a5c;if(_0x1de46f['query']['includeAll']){_0x40b085[_0xaf88('0x3d')]=[{'all':!![]}];}return db[_0xaf88('0x2c')]['findAll'](_0x40b085);})[_0xaf88('0x23')](function(_0x42ca9a){_0x2ae039['rows']=_0x42ca9a;return _0x2ae039;})['then'](respondWithFilteredResult(_0x4a3d4c,_0x40b085))[_0xaf88('0x3e')](handleError(_0x4a3d4c,null));};exports['show']=function(_0x5b9305,_0x287f3a){var _0x3bf475={'raw':!![],'where':{'id':_0x5b9305['params']['id']}},_0x327a59={};_0x327a59[_0xaf88('0x32')]=_['keys'](db['Sound']['rawAttributes']);_0x327a59[_0xaf88('0x2f')]=_[_0xaf88('0x3f')](_0x5b9305[_0xaf88('0x2f')]);_0x327a59[_0xaf88('0x30')]=_[_0xaf88('0x31')](_0x327a59[_0xaf88('0x32')],_0x327a59[_0xaf88('0x2f')]);_0x3bf475[_0xaf88('0x33')]=_[_0xaf88('0x31')](_0x327a59['model'],qs['fields'](_0x5b9305[_0xaf88('0x2f')][_0xaf88('0x40')]));_0x3bf475[_0xaf88('0x33')]=_0x3bf475['attributes'][_0xaf88('0x34')]?_0x3bf475[_0xaf88('0x33')]:_0x327a59[_0xaf88('0x32')];if(_0x5b9305[_0xaf88('0x2f')]['includeAll']){_0x3bf475['include']=[{'all':!![]}];}_0x3bf475=_[_0xaf88('0x3b')]({},_0x3bf475,_0x5b9305[_0xaf88('0x3c')]);return db[_0xaf88('0x2c')]['find'](_0x3bf475)[_0xaf88('0x23')](handleEntityNotFound(_0x287f3a,null))[_0xaf88('0x23')](respondWithResult(_0x287f3a,null))['catch'](handleError(_0x287f3a,null));};exports[_0xaf88('0x41')]=function(_0x47ef22,_0x2f04f4,_0x31c36f){return db[_0xaf88('0x2c')][_0xaf88('0x42')]({'where':{'id':_0x47ef22[_0xaf88('0x43')]['id']},'attributes':[_0xaf88('0x29'),_0xaf88('0x44'),_0xaf88('0x45')],'raw':!![]})[_0xaf88('0x23')](handleEntityNotFound(_0x2f04f4,null))[_0xaf88('0x23')](function(_0x16d330){if(_0x16d330){if(!fs[_0xaf88('0x46')](path[_0xaf88('0x47')](config[_0xaf88('0x48')],'server/files/sounds/converted',_0x16d330['save_name']+'.'+_0x16d330[_0xaf88('0x45')]))){throw new db['Sequelize'][(_0xaf88('0x49'))](_0xaf88('0x4a'));}return _0x2f04f4[_0xaf88('0x41')](path['join'](config[_0xaf88('0x48')],_0xaf88('0x4b'),util['format'](_0xaf88('0x4c'),_0x16d330['save_name'],_0x16d330['converted_format'])),util[_0xaf88('0x4d')](_0xaf88('0x4c'),_0x16d330[_0xaf88('0x29')],_0x16d330[_0xaf88('0x45')]));}return null;})[_0xaf88('0x3e')](handleError(_0x2f04f4,null));};exports[_0xaf88('0x4e')]=function(_0x35fd89,_0x197d46,_0x2a31c3){var _0xff8fe6={'name':path['basename'](_0x35fd89[_0xaf88('0x4f')][_0xaf88('0x50')],path[_0xaf88('0x51')](_0x35fd89['file']['originalname'])),'save_name':path[_0xaf88('0x52')](_0x35fd89[_0xaf88('0x4f')][_0xaf88('0x53')],path[_0xaf88('0x51')](_0x35fd89['file'][_0xaf88('0x53')])),'original_format':path[_0xaf88('0x51')](_0x35fd89['file'][_0xaf88('0x50')])[_0xaf88('0x54')](0x1),'converted_format':_0xaf88('0x55')};var _0x1bd83b=path['join'](config[_0xaf88('0x48')],_0xaf88('0x56'),_0x35fd89[_0xaf88('0x4f')][_0xaf88('0x53')]);var _0x88e86e=path['join'](config[_0xaf88('0x48')],'server/files/sounds/converted',util[_0xaf88('0x4d')](_0xaf88('0x4c'),path[_0xaf88('0x52')](_0x35fd89['file'][_0xaf88('0x53')],path['extname'](_0x35fd89[_0xaf88('0x4f')][_0xaf88('0x53')])),_0xff8fe6[_0xaf88('0x45')]));logger['info'](_0xaf88('0x57'),_0x1bd83b);logger[_0xaf88('0x58')](_0xaf88('0x59'),_0x88e86e);try{fs[_0xaf88('0x5a')](_0x1bd83b,parseInt(_0xaf88('0x5b'),0x8));var _0x581471=sox[_0xaf88('0x5c')](_0x1bd83b,_0x88e86e,{'sampleRate':0x1f40,'format':_0xaf88('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x581471['on'](_0xaf88('0x28'),function(_0x53cdda){fs[_0xaf88('0x5d')](_0x1bd83b);_0x197d46[_0xaf88('0x17')](0x1f4)[_0xaf88('0x5e')](_0x53cdda);});_0x581471['on'](_0xaf88('0x5f'),function(_0x3ef107){_0xff8fe6[_0xaf88('0x60')]=isNaN(_0x3ef107['duration'])?null:_0x3ef107[_0xaf88('0x61')]*0x3e8;_0xff8fe6['original_sampleCount']=isNaN(_0x3ef107[_0xaf88('0x62')])?null:_0x3ef107[_0xaf88('0x62')];_0xff8fe6[_0xaf88('0x63')]=isNaN(_0x3ef107[_0xaf88('0x64')])?null:_0x3ef107[_0xaf88('0x64')];_0xff8fe6['original_bitRate']=isNaN(_0x3ef107[_0xaf88('0x65')])?null:_0x3ef107[_0xaf88('0x65')];_0xff8fe6['original_sampleRate']=isNaN(_0x3ef107[_0xaf88('0x66')])?null:_0x3ef107['sampleRate'];});_0x581471['on'](_0xaf88('0x67'),function(_0x5ed695){_0xff8fe6[_0xaf88('0x68')]=isNaN(_0x5ed695['duration'])?null:_0x5ed695[_0xaf88('0x61')]*0x3e8;_0xff8fe6['converted_sampleCount']=isNaN(_0x5ed695[_0xaf88('0x62')])?null:_0x5ed695['sampleCount'];_0xff8fe6['converted_channelCount']=isNaN(_0x5ed695['channelCount'])?null:_0x5ed695[_0xaf88('0x64')];_0xff8fe6[_0xaf88('0x69')]=isNaN(_0x5ed695[_0xaf88('0x65')])?null:_0x5ed695[_0xaf88('0x65')];_0xff8fe6[_0xaf88('0x6a')]=isNaN(_0x5ed695[_0xaf88('0x66')])?null:_0x5ed695[_0xaf88('0x66')];});_0x581471['on'](_0xaf88('0x18'),function(){fs[_0xaf88('0x5a')](_0x88e86e,parseInt(_0xaf88('0x5b'),0x8));return db[_0xaf88('0x2c')][_0xaf88('0x4e')](_0xff8fe6)[_0xaf88('0x23')](function(_0x47cd72){var _0xeda084={'role':_0x35fd89[_0xaf88('0x6b')][_0xaf88('0x6c')],'userProfileId':_0x35fd89[_0xaf88('0x6b')][_0xaf88('0x6d')]};if(!_0xeda084)throw new Error(_0xaf88('0x6e'));if(_0xeda084[_0xaf88('0x6c')]===_0xaf88('0x6f')){var _0x607b8e=_0x47cd72['get']({'plain':!![]});return db[_0xaf88('0x70')][_0xaf88('0x42')]({'where':{'name':_0xaf88('0x71'),'userProfileId':_0xeda084['userProfileId']},'raw':!![]})[_0xaf88('0x23')](function(_0x479365){if(_0x479365&&_0x479365[_0xaf88('0x72')]===0x0){return db[_0xaf88('0x26')][_0xaf88('0x4e')]({'name':_0x607b8e[_0xaf88('0x29')],'resourceId':_0x607b8e['id'],'type':_0x479365[_0xaf88('0x29')],'sectionId':_0x479365['id']},{})[_0xaf88('0x23')](function(){return _0x47cd72;});}else{return _0x47cd72;}})[_0xaf88('0x3e')](function(_0x1e7ae7){logger['error'](_0xaf88('0x73'),_0x1e7ae7);throw _0x1e7ae7;});}return _0x47cd72;})[_0xaf88('0x23')](respondWithResult(_0x197d46,null))[_0xaf88('0x3e')](handleError(_0x197d46,null));});_0x581471[_0xaf88('0x74')]();}catch(_0x4c6cd8){_0x197d46[_0xaf88('0x17')](0x1f4)[_0xaf88('0x5e')](_0x4c6cd8);}};exports[_0xaf88('0x22')]=function(_0x358c27,_0x7b510b,_0x440b84){return db['Sound']['find']({'where':{'id':_0x358c27[_0xaf88('0x43')]['id']}})[_0xaf88('0x23')](handleEntityNotFound(_0x7b510b,null))[_0xaf88('0x23')](saveUpdates(_[_0xaf88('0x75')](_0x358c27[_0xaf88('0x6b')],['name',_0xaf88('0x76')]),null))[_0xaf88('0x23')](respondWithResult(_0x7b510b,null))['catch'](handleError(_0x7b510b,null));};exports[_0xaf88('0x77')]=function(_0xd194ac,_0x4e7151,_0x35635f){return db[_0xaf88('0x2c')][_0xaf88('0x42')]({'where':{'id':_0xd194ac[_0xaf88('0x43')]['id']}})['then'](function(_0x39f1d1){if(_0x39f1d1){return _0x39f1d1[_0xaf88('0x24')]();}})['then'](function(_0x4916d4){var _0x35a96f=path['join'](config[_0xaf88('0x48')],'server/files/sounds/original',util['format'](_0xaf88('0x4c'),_0x4916d4[_0xaf88('0x44')],_0x4916d4[_0xaf88('0x78')]));var _0x6210f1=path[_0xaf88('0x47')](config[_0xaf88('0x48')],_0xaf88('0x4b'),util[_0xaf88('0x4d')]('%s.%s',_0x4916d4[_0xaf88('0x44')],_0x4916d4[_0xaf88('0x45')]));fs[_0xaf88('0x5d')](_0x35a96f);fs[_0xaf88('0x5d')](_0x6210f1);return _0x4916d4;})[_0xaf88('0x23')](function(_0x1e254b){if(_0x1e254b){return _0x4e7151['status'](0xcc)['end']();}})[_0xaf88('0x23')](handleEntityNotFound(_0x4e7151,null))[_0xaf88('0x3e')](handleError(_0x4e7151,null));}; \ No newline at end of file +var _0xa9b1=['%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','format','info','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','bitRate','converted_sampleRate','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','send','index','map','Sound','type','key','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','show','params','fields','includeAll','include','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa9b1,0xa2));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1a9b('0x0'));var rimraf=require(_0x1a9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a9b('0x2'));var rp=require(_0x1a9b('0x3'));var moment=require('moment');var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require(_0x1a9b('0x6'));var path=require(_0x1a9b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a9b('0x8'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x9'));var _=require(_0x1a9b('0xa'));var squel=require('squel');var crypto=require(_0x1a9b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1a9b('0xc'));var querystring=require(_0x1a9b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a9b('0xe'));var qs=require(_0x1a9b('0xf'));var as=require(_0x1a9b('0x10'));var hardwareService=require(_0x1a9b('0x11'));var logger=require(_0x1a9b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1a9b('0x13'));var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x402d2f,_0x12214a){_0x12214a=_0x12214a||0xcc;return function(_0x143ac5){if(_0x143ac5){return _0x402d2f['sendStatus'](_0x12214a);}return _0x402d2f['status'](_0x12214a)[_0x1a9b('0x16')]();};}function respondWithResult(_0x2e9d61,_0x752a2b){_0x752a2b=_0x752a2b||0xc8;return function(_0x1871d9){if(_0x1871d9){return _0x2e9d61[_0x1a9b('0x17')](_0x752a2b)['json'](_0x1871d9);}};}function respondWithFilteredResult(_0x4fa026,_0x5195e2){return function(_0x319f28){if(_0x319f28){var _0x279915=typeof _0x5195e2[_0x1a9b('0x18')]==='undefined'&&typeof _0x5195e2[_0x1a9b('0x19')]===_0x1a9b('0x1a');var _0xf16d08=_0x319f28['count'];var _0x2e7ea6=_0x279915?0x0:_0x5195e2[_0x1a9b('0x18')];var _0x2ffc1a=_0x279915?_0x319f28[_0x1a9b('0x1b')]:_0x5195e2['offset']+_0x5195e2[_0x1a9b('0x19')];var _0x10dc42;if(_0x2ffc1a>=_0xf16d08){_0x2ffc1a=_0xf16d08;_0x10dc42=0xc8;}else{_0x10dc42=0xce;}_0x4fa026[_0x1a9b('0x17')](_0x10dc42);return _0x4fa026[_0x1a9b('0x1c')](_0x1a9b('0x1d'),_0x2e7ea6+'-'+_0x2ffc1a+'/'+_0xf16d08)['json'](_0x319f28);}return null;};}function patchUpdates(_0x4a1b7e){return function(_0x1910ca){try{jsonpatch[_0x1a9b('0x1e')](_0x1910ca,_0x4a1b7e,!![]);}catch(_0x3c7c85){return BPromise[_0x1a9b('0x1f')](_0x3c7c85);}return _0x1910ca[_0x1a9b('0x20')]();};}function saveUpdates(_0x259047,_0x37ecd1){return function(_0x10002e){if(_0x10002e){return _0x10002e[_0x1a9b('0x21')](_0x259047)[_0x1a9b('0x22')](function(_0x4e2036){return _0x4e2036;});}return null;};}function removeEntity(_0xed3acb,_0x14d6f2){return function(_0x4a61e9){if(_0x4a61e9){return _0x4a61e9[_0x1a9b('0x23')]()[_0x1a9b('0x22')](function(){var _0x2a5229=_0x4a61e9[_0x1a9b('0x24')]({'plain':!![]});var _0x5b6fad=_0x1a9b('0x25');return db[_0x1a9b('0x26')][_0x1a9b('0x23')]({'where':{'type':_0x5b6fad,'resourceId':_0x2a5229['id']}})[_0x1a9b('0x22')](function(){return _0x4a61e9;});})[_0x1a9b('0x22')](function(){_0xed3acb[_0x1a9b('0x17')](0xcc)[_0x1a9b('0x16')]();});}};}function handleEntityNotFound(_0x2d830c,_0x5ed485){return function(_0x3a10cf){if(!_0x3a10cf){_0x2d830c['sendStatus'](0x194);}return _0x3a10cf;};}function handleError(_0x42ea08,_0x49a1b4){_0x49a1b4=_0x49a1b4||0x1f4;return function(_0xf1fb09){logger[_0x1a9b('0x27')](_0xf1fb09[_0x1a9b('0x28')]);if(_0xf1fb09['name']){delete _0xf1fb09['name'];}_0x42ea08[_0x1a9b('0x17')](_0x49a1b4)[_0x1a9b('0x29')](_0xf1fb09);};}exports[_0x1a9b('0x2a')]=function(_0x2e39a7,_0x3bd2e2){var _0x2d517c={},_0x5a0bb4={},_0xc95086={'count':0x0,'rows':[]};var _0x3211fc=_[_0x1a9b('0x2b')](db[_0x1a9b('0x2c')]['rawAttributes'],function(_0x166182){return{'name':_0x166182['fieldName'],'type':_0x166182[_0x1a9b('0x2d')][_0x1a9b('0x2e')]};});_0x5a0bb4[_0x1a9b('0x2f')]=_[_0x1a9b('0x2b')](_0x3211fc,_0x1a9b('0x30'));_0x5a0bb4[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x2e39a7[_0x1a9b('0x31')]);_0x5a0bb4[_0x1a9b('0x33')]=_[_0x1a9b('0x34')](_0x5a0bb4[_0x1a9b('0x2f')],_0x5a0bb4[_0x1a9b('0x31')]);_0x2d517c[_0x1a9b('0x35')]=_[_0x1a9b('0x34')](_0x5a0bb4['model'],qs['fields'](_0x2e39a7[_0x1a9b('0x31')]['fields']));_0x2d517c[_0x1a9b('0x35')]=_0x2d517c['attributes']['length']?_0x2d517c[_0x1a9b('0x35')]:_0x5a0bb4['model'];if(!_0x2e39a7[_0x1a9b('0x31')][_0x1a9b('0x36')]('nolimit')){_0x2d517c[_0x1a9b('0x19')]=qs[_0x1a9b('0x19')](_0x2e39a7[_0x1a9b('0x31')][_0x1a9b('0x19')]);_0x2d517c[_0x1a9b('0x18')]=qs['offset'](_0x2e39a7[_0x1a9b('0x31')][_0x1a9b('0x18')]);}_0x2d517c['order']=qs[_0x1a9b('0x37')](_0x2e39a7[_0x1a9b('0x31')]['sort']);_0x2d517c[_0x1a9b('0x38')]=qs['filters'](_[_0x1a9b('0x39')](_0x2e39a7[_0x1a9b('0x31')],_0x5a0bb4[_0x1a9b('0x33')]),_0x3211fc);if(_0x2e39a7[_0x1a9b('0x31')]['filter']){_0x2d517c[_0x1a9b('0x38')]=_[_0x1a9b('0x3a')](_0x2d517c[_0x1a9b('0x38')],{'$or':_['map'](_0x3211fc,function(_0x4ffd47){if(_0x4ffd47['type']!==_0x1a9b('0x3b')){var _0x1656c6={};_0x1656c6[_0x4ffd47['name']]={'$like':'%'+_0x2e39a7[_0x1a9b('0x31')][_0x1a9b('0x3c')]+'%'};return _0x1656c6;}})});}_0x2d517c=_['merge']({},_0x2d517c,_0x2e39a7[_0x1a9b('0x3d')]);var _0x10e17e={'where':_0x2d517c[_0x1a9b('0x38')]};return db['Sound']['count'](_0x10e17e)[_0x1a9b('0x22')](function(_0x11b85e){_0xc95086[_0x1a9b('0x1b')]=_0x11b85e;if(_0x2e39a7['query']['includeAll']){_0x2d517c['include']=[{'all':!![]}];}return db[_0x1a9b('0x2c')][_0x1a9b('0x3e')](_0x2d517c);})['then'](function(_0x5b40ca){_0xc95086['rows']=_0x5b40ca;return _0xc95086;})[_0x1a9b('0x22')](respondWithFilteredResult(_0x3bd2e2,_0x2d517c))[_0x1a9b('0x3f')](handleError(_0x3bd2e2,null));};exports[_0x1a9b('0x40')]=function(_0x5af47a,_0x3f6a3e){var _0x59930e={'raw':!![],'where':{'id':_0x5af47a[_0x1a9b('0x41')]['id']}},_0x5a9687={};_0x5a9687['model']=_[_0x1a9b('0x32')](db[_0x1a9b('0x2c')]['rawAttributes']);_0x5a9687[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x5af47a['query']);_0x5a9687[_0x1a9b('0x33')]=_[_0x1a9b('0x34')](_0x5a9687[_0x1a9b('0x2f')],_0x5a9687[_0x1a9b('0x31')]);_0x59930e['attributes']=_[_0x1a9b('0x34')](_0x5a9687['model'],qs[_0x1a9b('0x42')](_0x5af47a[_0x1a9b('0x31')][_0x1a9b('0x42')]));_0x59930e[_0x1a9b('0x35')]=_0x59930e[_0x1a9b('0x35')]['length']?_0x59930e[_0x1a9b('0x35')]:_0x5a9687[_0x1a9b('0x2f')];if(_0x5af47a[_0x1a9b('0x31')][_0x1a9b('0x43')]){_0x59930e[_0x1a9b('0x44')]=[{'all':!![]}];}_0x59930e=_[_0x1a9b('0x3a')]({},_0x59930e,_0x5af47a[_0x1a9b('0x3d')]);return db['Sound'][_0x1a9b('0x45')](_0x59930e)[_0x1a9b('0x22')](handleEntityNotFound(_0x3f6a3e,null))[_0x1a9b('0x22')](respondWithResult(_0x3f6a3e,null))[_0x1a9b('0x3f')](handleError(_0x3f6a3e,null));};exports['download']=function(_0x1640ce,_0x91de6c,_0x3ce024){return db[_0x1a9b('0x2c')][_0x1a9b('0x45')]({'where':{'id':_0x1640ce[_0x1a9b('0x41')]['id']},'attributes':[_0x1a9b('0x30'),_0x1a9b('0x46'),_0x1a9b('0x47')],'raw':!![]})[_0x1a9b('0x22')](handleEntityNotFound(_0x91de6c,null))[_0x1a9b('0x22')](function(_0x1fc113){if(_0x1fc113){if(!fs[_0x1a9b('0x48')](path[_0x1a9b('0x49')](config[_0x1a9b('0x4a')],_0x1a9b('0x4b'),_0x1fc113['save_name']+'.'+_0x1fc113[_0x1a9b('0x47')]))){throw new db[(_0x1a9b('0x4c'))][(_0x1a9b('0x4d'))](_0x1a9b('0x4e'));}return _0x91de6c[_0x1a9b('0x4f')](path[_0x1a9b('0x49')](config[_0x1a9b('0x4a')],_0x1a9b('0x4b'),util['format'](_0x1a9b('0x50'),_0x1fc113['save_name'],_0x1fc113[_0x1a9b('0x47')])),util['format'](_0x1a9b('0x50'),_0x1fc113[_0x1a9b('0x30')],_0x1fc113[_0x1a9b('0x47')]));}return null;})[_0x1a9b('0x3f')](handleError(_0x91de6c,null));};exports[_0x1a9b('0x51')]=function(_0xbef32e,_0x36cf3f,_0x56fad7){var _0x1216ab={'name':path[_0x1a9b('0x52')](_0xbef32e['file'][_0x1a9b('0x53')],path[_0x1a9b('0x54')](_0xbef32e[_0x1a9b('0x55')][_0x1a9b('0x53')])),'save_name':path['basename'](_0xbef32e[_0x1a9b('0x55')][_0x1a9b('0x56')],path[_0x1a9b('0x54')](_0xbef32e[_0x1a9b('0x55')][_0x1a9b('0x56')])),'original_format':path['extname'](_0xbef32e['file']['originalname'])[_0x1a9b('0x57')](0x1),'converted_format':_0x1a9b('0x58')};var _0x550a2c=path[_0x1a9b('0x49')](config[_0x1a9b('0x4a')],_0x1a9b('0x59'),_0xbef32e[_0x1a9b('0x55')]['filename']);var _0x27ab8d=path[_0x1a9b('0x49')](config[_0x1a9b('0x4a')],_0x1a9b('0x4b'),util[_0x1a9b('0x5a')]('%s.%s',path['basename'](_0xbef32e[_0x1a9b('0x55')][_0x1a9b('0x56')],path[_0x1a9b('0x54')](_0xbef32e[_0x1a9b('0x55')][_0x1a9b('0x56')])),_0x1216ab[_0x1a9b('0x47')]));logger[_0x1a9b('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x550a2c);logger[_0x1a9b('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x27ab8d);try{fs[_0x1a9b('0x5c')](_0x550a2c,parseInt('0777',0x8));var _0x4a2c89=sox[_0x1a9b('0x5d')](_0x550a2c,_0x27ab8d,{'sampleRate':0x1f40,'format':_0x1a9b('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a2c89['on'](_0x1a9b('0x27'),function(_0x1d740d){fs[_0x1a9b('0x5e')](_0x550a2c);_0x36cf3f[_0x1a9b('0x17')](0x1f4)[_0x1a9b('0x29')](_0x1d740d);});_0x4a2c89['on'](_0x1a9b('0x5f'),function(_0x3f567e){_0x1216ab[_0x1a9b('0x60')]=isNaN(_0x3f567e['duration'])?null:_0x3f567e[_0x1a9b('0x61')]*0x3e8;_0x1216ab[_0x1a9b('0x62')]=isNaN(_0x3f567e[_0x1a9b('0x63')])?null:_0x3f567e[_0x1a9b('0x63')];_0x1216ab['original_channelCount']=isNaN(_0x3f567e['channelCount'])?null:_0x3f567e[_0x1a9b('0x64')];_0x1216ab[_0x1a9b('0x65')]=isNaN(_0x3f567e['bitRate'])?null:_0x3f567e['bitRate'];_0x1216ab[_0x1a9b('0x66')]=isNaN(_0x3f567e[_0x1a9b('0x67')])?null:_0x3f567e[_0x1a9b('0x67')];});_0x4a2c89['on'](_0x1a9b('0x68'),function(_0x16b637){_0x1216ab[_0x1a9b('0x69')]=isNaN(_0x16b637[_0x1a9b('0x61')])?null:_0x16b637[_0x1a9b('0x61')]*0x3e8;_0x1216ab[_0x1a9b('0x6a')]=isNaN(_0x16b637[_0x1a9b('0x63')])?null:_0x16b637[_0x1a9b('0x63')];_0x1216ab[_0x1a9b('0x6b')]=isNaN(_0x16b637[_0x1a9b('0x64')])?null:_0x16b637[_0x1a9b('0x64')];_0x1216ab['converted_bitRate']=isNaN(_0x16b637[_0x1a9b('0x6c')])?null:_0x16b637[_0x1a9b('0x6c')];_0x1216ab[_0x1a9b('0x6d')]=isNaN(_0x16b637[_0x1a9b('0x67')])?null:_0x16b637[_0x1a9b('0x67')];});_0x4a2c89['on'](_0x1a9b('0x16'),function(){fs[_0x1a9b('0x5c')](_0x27ab8d,parseInt(_0x1a9b('0x6e'),0x8));return db[_0x1a9b('0x2c')][_0x1a9b('0x51')](_0x1216ab)[_0x1a9b('0x22')](function(_0x118b7e){var _0x58096c={'role':_0xbef32e[_0x1a9b('0x6f')]['role'],'userProfileId':_0xbef32e['body'][_0x1a9b('0x70')]};if(!_0x58096c)throw new Error(_0x1a9b('0x71'));if(_0x58096c[_0x1a9b('0x72')]==='user'){var _0x96d552=_0x118b7e[_0x1a9b('0x24')]({'plain':!![]});return db[_0x1a9b('0x73')][_0x1a9b('0x45')]({'where':{'name':'Sounds','userProfileId':_0x58096c['userProfileId']},'raw':!![]})[_0x1a9b('0x22')](function(_0x1885f6){if(_0x1885f6&&_0x1885f6[_0x1a9b('0x74')]===0x0){return db['UserProfileResource']['create']({'name':_0x96d552[_0x1a9b('0x30')],'resourceId':_0x96d552['id'],'type':_0x1885f6[_0x1a9b('0x30')],'sectionId':_0x1885f6['id']},{})['then'](function(){return _0x118b7e;});}else{return _0x118b7e;}})[_0x1a9b('0x3f')](function(_0x1d9157){logger[_0x1a9b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d9157);throw _0x1d9157;});}return _0x118b7e;})['then'](respondWithResult(_0x36cf3f,null))[_0x1a9b('0x3f')](handleError(_0x36cf3f,null));});_0x4a2c89[_0x1a9b('0x75')]();}catch(_0x4edc05){_0x36cf3f[_0x1a9b('0x17')](0x1f4)[_0x1a9b('0x29')](_0x4edc05);}};exports['update']=function(_0x58bef2,_0x3335a1,_0x279823){return db[_0x1a9b('0x2c')]['find']({'where':{'id':_0x58bef2[_0x1a9b('0x41')]['id']}})[_0x1a9b('0x22')](handleEntityNotFound(_0x3335a1,null))['then'](saveUpdates(_[_0x1a9b('0x39')](_0x58bef2[_0x1a9b('0x6f')],[_0x1a9b('0x30'),_0x1a9b('0x76')]),null))[_0x1a9b('0x22')](respondWithResult(_0x3335a1,null))['catch'](handleError(_0x3335a1,null));};exports[_0x1a9b('0x77')]=function(_0x3a3d2c,_0x2196ef,_0x26af0d){return db[_0x1a9b('0x2c')][_0x1a9b('0x45')]({'where':{'id':_0x3a3d2c['params']['id']}})[_0x1a9b('0x22')](function(_0x5520d0){if(_0x5520d0){return _0x5520d0[_0x1a9b('0x23')]();}})[_0x1a9b('0x22')](function(_0x2722e7){var _0x35fa4f=path['join'](config[_0x1a9b('0x4a')],_0x1a9b('0x59'),util[_0x1a9b('0x5a')](_0x1a9b('0x50'),_0x2722e7[_0x1a9b('0x46')],_0x2722e7[_0x1a9b('0x78')]));var _0x117b10=path['join'](config['root'],_0x1a9b('0x4b'),util['format'](_0x1a9b('0x50'),_0x2722e7['save_name'],_0x2722e7['converted_format']));fs[_0x1a9b('0x5e')](_0x35fa4f);fs['unlinkSync'](_0x117b10);return _0x2722e7;})['then'](function(_0x42810d){if(_0x42810d){return _0x2196ef['status'](0xcc)['end']();}})[_0x1a9b('0x22')](handleEntityNotFound(_0x2196ef,null))[_0x1a9b('0x3f')](handleError(_0x2196ef,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2e54da6..4565e9f 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 _0xf54c=['moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x4d1779,_0x1654ca){var _0x18a582=function(_0x43c715){while(--_0x43c715){_0x4d1779['push'](_0x4d1779['shift']());}};_0x18a582(++_0x1654ca);}(_0xf54c,0x114));var _0xcf54=function(_0x280238,_0x50d4a7){_0x280238=_0x280238-0x0;var _0x2eeb3b=_0xf54c[_0x280238];return _0x2eeb3b;};'use strict';var _=require(_0xcf54('0x0'));var util=require(_0xcf54('0x1'));var logger=require(_0xcf54('0x2'))(_0xcf54('0x3'));var moment=require(_0xcf54('0x4'));var BPromise=require(_0xcf54('0x5'));var rp=require(_0xcf54('0x6'));var fs=require('fs');var path=require(_0xcf54('0x7'));var rimraf=require(_0xcf54('0x8'));var config=require('../../config/environment');var attributes=require(_0xcf54('0x9'));module[_0xcf54('0xa')]=function(_0x1a2749,_0x24fe7b){return _0x1a2749[_0xcf54('0xb')](_0xcf54('0xc'),attributes,{'tableName':_0xcf54('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf2e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds'];(function(_0x1a0864,_0x3dba44){var _0x2c0b0a=function(_0x2a8072){while(--_0x2a8072){_0x1a0864['push'](_0x1a0864['shift']());}};_0x2c0b0a(++_0x3dba44);}(_0xcf2e,0x138));var _0xecf2=function(_0xd3c939,_0x356e38){_0xd3c939=_0xd3c939-0x0;var _0x2cb033=_0xcf2e[_0xd3c939];return _0x2cb033;};'use strict';var _=require(_0xecf2('0x0'));var util=require(_0xecf2('0x1'));var logger=require(_0xecf2('0x2'))(_0xecf2('0x3'));var moment=require(_0xecf2('0x4'));var BPromise=require(_0xecf2('0x5'));var rp=require(_0xecf2('0x6'));var fs=require('fs');var path=require(_0xecf2('0x7'));var rimraf=require(_0xecf2('0x8'));var config=require(_0xecf2('0x9'));var attributes=require(_0xecf2('0xa'));module['exports']=function(_0x263f71,_0x442b1f){return _0x263f71['define'](_0xecf2('0xb'),attributes,{'tableName':_0xecf2('0xc'),'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 65dc50d..2775498 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 _0x59a5=['rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','find','options','raw','where','include','map','model','attributes','ShowSound','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x43f97f,_0x12f156){var _0x154522=function(_0xabc96c){while(--_0xabc96c){_0x43f97f['push'](_0x43f97f['shift']());}};_0x154522(++_0x12f156);}(_0x59a5,0x7b));var _0x559a=function(_0xb5b1f9,_0x42ee9d){_0xb5b1f9=_0xb5b1f9-0x0;var _0x4e2caa=_0x59a5[_0xb5b1f9];return _0x4e2caa;};'use strict';var _=require('lodash');var util=require(_0x559a('0x0'));var moment=require('moment');var BPromise=require(_0x559a('0x1'));var rs=require(_0x559a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x559a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x559a('0x4'))(_0x559a('0x5'));var config=require('../../config/environment');var jayson=require(_0x559a('0x6'));var client=jayson[_0x559a('0x7')][_0x559a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x405574,_0x28dd43,_0x4cc4d5){return new BPromise(function(_0x49bd23,_0x16ebfd){return client[_0x559a('0x9')](_0x405574,_0x4cc4d5)[_0x559a('0xa')](function(_0x563acb){logger[_0x559a('0xb')](_0x559a('0xc'),_0x28dd43,_0x559a('0xd'));logger[_0x559a('0xe')](_0x559a('0xf'),_0x28dd43,_0x559a('0xd'),JSON[_0x559a('0x10')](_0x563acb));if(_0x563acb['error']){if(_0x563acb[_0x559a('0x11')][_0x559a('0x12')]===0x1f4){logger['error'](_0x559a('0xc'),_0x28dd43,_0x563acb['error'][_0x559a('0x13')]);return _0x16ebfd(_0x563acb[_0x559a('0x11')][_0x559a('0x13')]);}logger[_0x559a('0x11')](_0x559a('0xc'),_0x28dd43,_0x563acb[_0x559a('0x11')][_0x559a('0x13')]);return _0x49bd23(_0x563acb[_0x559a('0x11')][_0x559a('0x13')]);}else{logger[_0x559a('0xb')]('Sound,\x20%s,\x20%s',_0x28dd43,_0x559a('0xd'));_0x49bd23(_0x563acb[_0x559a('0x14')][_0x559a('0x13')]);}})[_0x559a('0x15')](function(_0x4a3310){logger[_0x559a('0x11')](_0x559a('0xc'),_0x28dd43,_0x4a3310);_0x16ebfd(_0x4a3310);});});}exports['ShowSound']=function(_0x126cb9){var _0x1f9be5=this;return new Promise(function(_0x3ef4c6,_0x361506){return db[_0x559a('0x16')][_0x559a('0x17')]({'raw':_0x126cb9['options']?_0x126cb9[_0x559a('0x18')][_0x559a('0x19')]===undefined?!![]:![]:!![],'where':_0x126cb9[_0x559a('0x18')]?_0x126cb9[_0x559a('0x18')][_0x559a('0x1a')]||null:null,'attributes':_0x126cb9[_0x559a('0x18')]?_0x126cb9['options']['attributes']||null:null,'include':_0x126cb9['options']?_0x126cb9[_0x559a('0x18')][_0x559a('0x1b')]?_[_0x559a('0x1c')](_0x126cb9[_0x559a('0x18')]['include'],function(_0x26285e){return{'model':db[_0x26285e[_0x559a('0x1d')]],'as':_0x26285e['as'],'attributes':_0x26285e['attributes'],'include':_0x26285e[_0x559a('0x1b')]?_[_0x559a('0x1c')](_0x26285e['include'],function(_0x2701c1){return{'model':db[_0x2701c1[_0x559a('0x1d')]],'as':_0x2701c1['as'],'attributes':_0x2701c1[_0x559a('0x1e')],'include':_0x2701c1[_0x559a('0x1b')]?_[_0x559a('0x1c')](_0x2701c1[_0x559a('0x1b')],function(_0x5454ef){return{'model':db[_0x5454ef[_0x559a('0x1d')]],'as':_0x5454ef['as'],'attributes':_0x5454ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x559a('0xa')](function(_0x39fa2e){logger[_0x559a('0xb')](_0x559a('0x1f'),_0x126cb9);logger['debug'](_0x559a('0x1f'),_0x126cb9,JSON[_0x559a('0x10')](_0x39fa2e));_0x3ef4c6(_0x39fa2e);})[_0x559a('0x15')](function(_0x53cb0b){logger[_0x559a('0x11')](_0x559a('0x1f'),_0x53cb0b[_0x559a('0x13')],_0x126cb9);_0x361506(_0x1f9be5[_0x559a('0x11')](0x1f4,_0x53cb0b[_0x559a('0x13')]));});});}; \ No newline at end of file +var _0xfefc=['options','raw','model','include','attributes','debug','catch','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSound','Sound','find'];(function(_0x41c1ff,_0x1f887d){var _0x1b44a7=function(_0x2682d7){while(--_0x2682d7){_0x41c1ff['push'](_0x41c1ff['shift']());}};_0x1b44a7(++_0x1f887d);}(_0xfefc,0xc4));var _0xcfef=function(_0x4af102,_0x2dbd1d){_0x4af102=_0x4af102-0x0;var _0x572ba4=_0xfefc[_0x4af102];return _0x572ba4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfef('0x0'));var fs=require('fs');var Redis=require(_0xcfef('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfef('0x2'));var logger=require('../../config/logger')(_0xcfef('0x3'));var config=require(_0xcfef('0x4'));var jayson=require(_0xcfef('0x5'));var client=jayson[_0xcfef('0x6')][_0xcfef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cde4c,_0x14727e,_0xb8ce3){return new BPromise(function(_0x14932a,_0x33732d){return client['request'](_0x1cde4c,_0xb8ce3)['then'](function(_0x1e2619){logger[_0xcfef('0x8')](_0xcfef('0x9'),_0x14727e,_0xcfef('0xa'));logger['debug'](_0xcfef('0xb'),_0x14727e,_0xcfef('0xa'),JSON[_0xcfef('0xc')](_0x1e2619));if(_0x1e2619[_0xcfef('0xd')]){if(_0x1e2619[_0xcfef('0xd')][_0xcfef('0xe')]===0x1f4){logger['error'](_0xcfef('0x9'),_0x14727e,_0x1e2619[_0xcfef('0xd')][_0xcfef('0xf')]);return _0x33732d(_0x1e2619[_0xcfef('0xd')][_0xcfef('0xf')]);}logger[_0xcfef('0xd')](_0xcfef('0x9'),_0x14727e,_0x1e2619[_0xcfef('0xd')][_0xcfef('0xf')]);return _0x14932a(_0x1e2619[_0xcfef('0xd')][_0xcfef('0xf')]);}else{logger[_0xcfef('0x8')]('Sound,\x20%s,\x20%s',_0x14727e,'request\x20sent');_0x14932a(_0x1e2619[_0xcfef('0x10')][_0xcfef('0xf')]);}})['catch'](function(_0x2c4888){logger[_0xcfef('0xd')](_0xcfef('0x9'),_0x14727e,_0x2c4888);_0x33732d(_0x2c4888);});});}exports[_0xcfef('0x11')]=function(_0x396a48){var _0x29d0c9=this;return new Promise(function(_0x4c330d,_0x386b4f){return db[_0xcfef('0x12')][_0xcfef('0x13')]({'raw':_0x396a48[_0xcfef('0x14')]?_0x396a48['options'][_0xcfef('0x15')]===undefined?!![]:![]:!![],'where':_0x396a48['options']?_0x396a48['options']['where']||null:null,'attributes':_0x396a48[_0xcfef('0x14')]?_0x396a48['options']['attributes']||null:null,'include':_0x396a48[_0xcfef('0x14')]?_0x396a48[_0xcfef('0x14')]['include']?_['map'](_0x396a48[_0xcfef('0x14')]['include'],function(_0x21b21e){return{'model':db[_0x21b21e[_0xcfef('0x16')]],'as':_0x21b21e['as'],'attributes':_0x21b21e['attributes'],'include':_0x21b21e[_0xcfef('0x17')]?_['map'](_0x21b21e[_0xcfef('0x17')],function(_0x3aa6da){return{'model':db[_0x3aa6da['model']],'as':_0x3aa6da['as'],'attributes':_0x3aa6da['attributes'],'include':_0x3aa6da[_0xcfef('0x17')]?_['map'](_0x3aa6da['include'],function(_0x48a67f){return{'model':db[_0x48a67f['model']],'as':_0x48a67f['as'],'attributes':_0x48a67f[_0xcfef('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6367d1){logger[_0xcfef('0x8')]('ShowSound',_0x396a48);logger[_0xcfef('0x19')](_0xcfef('0x11'),_0x396a48,JSON[_0xcfef('0xc')](_0x6367d1));_0x4c330d(_0x6367d1);})[_0xcfef('0x1a')](function(_0x2788bf){logger[_0xcfef('0xd')](_0xcfef('0x11'),_0x2788bf[_0xcfef('0xf')],_0x396a48);_0x386b4f(_0x29d0c9[_0xcfef('0xd')](0x1f4,_0x2788bf[_0xcfef('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a66b934..f3d7bda 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x462c67,_0x1acb4f){var _0x487815=function(_0x180671){while(--_0x180671){_0x462c67['push'](_0x462c67['shift']());}};_0x487815(++_0x1acb4f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x5eb8[_0x40df5f];return _0x1573f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1eaf66,_0x3e0e05){var _0x296791=function(_0x1b4171){while(--_0x1b4171){_0x1eaf66['push'](_0x1eaf66['shift']());}};_0x296791(++_0x3e0e05);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 33545b7..eb599e0 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 _0x4dce=['ENUM','out','sequelize','STRING','TEXT','medium'];(function(_0x5a3322,_0x15587e){var _0x227c5f=function(_0x4d73cc){while(--_0x4d73cc){_0x5a3322['push'](_0x5a3322['shift']());}};_0x227c5f(++_0x15587e);}(_0x4dce,0x164));var _0xe4dc=function(_0x5814ca,_0x3b6713){_0x5814ca=_0x5814ca-0x0;var _0xeb1833=_0x4dce[_0x5814ca];return _0xeb1833;};'use strict';var Sequelize=require(_0xe4dc('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe4dc('0x1')]},'body':{'type':Sequelize[_0xe4dc('0x2')](_0xe4dc('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe4dc('0x4')]('in',_0xe4dc('0x5')),'defaultValue':_0xe4dc('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe4dc('0x2')]}}; \ No newline at end of file +var _0xc86a=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0xc86a,0x15e));var _0xac86=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xc86a[_0x50bf5a];return _0x4ddc1d;};'use strict';var Sequelize=require(_0xac86('0x0'));module[_0xac86('0x1')]={'uniqueid':{'type':Sequelize[_0xac86('0x2')]},'body':{'type':Sequelize[_0xac86('0x3')](_0xac86('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xac86('0x5')]('in',_0xac86('0x6')),'defaultValue':_0xac86('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xac86('0x2')]},'providerResponse':{'type':Sequelize[_0xac86('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b798269..7a117c9 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 _0xb5c6=['body','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','find','catch','create'];(function(_0x2baf64,_0x5ddeda){var _0x52f0cd=function(_0x31bf9c){while(--_0x31bf9c){_0x2baf64['push'](_0x2baf64['shift']());}};_0x52f0cd(++_0x5ddeda);}(_0xb5c6,0xe5));var _0x6b5c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb5c6[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b5c('0x0'));var zipdir=require(_0x6b5c('0x1'));var jsonpatch=require(_0x6b5c('0x2'));var rp=require(_0x6b5c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6b5c('0x4'));var sox=require(_0x6b5c('0x5'));var csv=require('to-csv');var ejs=require(_0x6b5c('0x6'));var fs=require('fs');var fs_extra=require(_0x6b5c('0x7'));var _=require('lodash');var squel=require(_0x6b5c('0x8'));var crypto=require(_0x6b5c('0x9'));var jsforce=require(_0x6b5c('0xa'));var deskjs=require(_0x6b5c('0xb'));var toCsv=require(_0x6b5c('0xc'));var querystring=require(_0x6b5c('0xd'));var Papa=require(_0x6b5c('0xe'));var Redis=require(_0x6b5c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6b5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b5c('0x11'));var logger=require(_0x6b5c('0x12'))(_0x6b5c('0x13'));var utils=require(_0x6b5c('0x14'));var config=require(_0x6b5c('0x15'));var licenseUtil=require(_0x6b5c('0x16'));var db=require(_0x6b5c('0x17'))['db'];function respondWithStatusCode(_0x51a5b2,_0x4b09ff){_0x4b09ff=_0x4b09ff||0xcc;return function(_0x106f0a){if(_0x106f0a){return _0x51a5b2[_0x6b5c('0x18')](_0x4b09ff);}return _0x51a5b2['status'](_0x4b09ff)[_0x6b5c('0x19')]();};}function respondWithResult(_0x6814e5,_0x78f542){_0x78f542=_0x78f542||0xc8;return function(_0x18e91f){if(_0x18e91f){return _0x6814e5[_0x6b5c('0x1a')](_0x78f542)[_0x6b5c('0x1b')](_0x18e91f);}};}function respondWithFilteredResult(_0x244957,_0x533ee3){return function(_0xee6d65){if(_0xee6d65){var _0x57bf3c=typeof _0x533ee3[_0x6b5c('0x1c')]===_0x6b5c('0x1d')&&typeof _0x533ee3['limit']===_0x6b5c('0x1d');var _0x5b3747=_0xee6d65[_0x6b5c('0x1e')];var _0x203d62=_0x57bf3c?0x0:_0x533ee3[_0x6b5c('0x1c')];var _0x2b8d63=_0x57bf3c?_0xee6d65['count']:_0x533ee3['offset']+_0x533ee3[_0x6b5c('0x1f')];var _0x150204;if(_0x2b8d63>=_0x5b3747){_0x2b8d63=_0x5b3747;_0x150204=0xc8;}else{_0x150204=0xce;}_0x244957[_0x6b5c('0x1a')](_0x150204);return _0x244957[_0x6b5c('0x20')](_0x6b5c('0x21'),_0x203d62+'-'+_0x2b8d63+'/'+_0x5b3747)[_0x6b5c('0x1b')](_0xee6d65);}return null;};}function patchUpdates(_0x4e20da){return function(_0x51582d){try{jsonpatch[_0x6b5c('0x22')](_0x51582d,_0x4e20da,!![]);}catch(_0x588e16){return BPromise['reject'](_0x588e16);}return _0x51582d[_0x6b5c('0x23')]();};}function saveUpdates(_0x50cc26,_0xe0100d){return function(_0x4fb14c){if(_0x4fb14c){return _0x4fb14c[_0x6b5c('0x24')](_0x50cc26)[_0x6b5c('0x25')](function(_0x650f46){return _0x650f46;});}return null;};}function removeEntity(_0x1814a8,_0x19ff66){return function(_0x2983cb){if(_0x2983cb){return _0x2983cb[_0x6b5c('0x26')]()['then'](function(){_0x1814a8[_0x6b5c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6b14,_0x104a4f){return function(_0x55349c){if(!_0x55349c){_0x4d6b14['sendStatus'](0x194);}return _0x55349c;};}function handleError(_0x30ccd5,_0x5d0ac7){_0x5d0ac7=_0x5d0ac7||0x1f4;return function(_0x4d4180){logger[_0x6b5c('0x27')](_0x4d4180[_0x6b5c('0x28')]);if(_0x4d4180['name']){delete _0x4d4180[_0x6b5c('0x29')];}_0x30ccd5[_0x6b5c('0x1a')](_0x5d0ac7)[_0x6b5c('0x2a')](_0x4d4180);};}exports['index']=function(_0x48993d,_0x15dfac){var _0x513f30={},_0x3ec63b={},_0x5968f8={'count':0x0,'rows':[]};var _0x6ab6d1=_[_0x6b5c('0x2b')](db[_0x6b5c('0x2c')][_0x6b5c('0x2d')],function(_0x39d491){return{'name':_0x39d491[_0x6b5c('0x2e')],'type':_0x39d491[_0x6b5c('0x2f')][_0x6b5c('0x30')]};});_0x3ec63b[_0x6b5c('0x31')]=_[_0x6b5c('0x2b')](_0x6ab6d1,_0x6b5c('0x29'));_0x3ec63b[_0x6b5c('0x32')]=_[_0x6b5c('0x33')](_0x48993d[_0x6b5c('0x32')]);_0x3ec63b[_0x6b5c('0x34')]=_['intersection'](_0x3ec63b['model'],_0x3ec63b[_0x6b5c('0x32')]);_0x513f30[_0x6b5c('0x35')]=_[_0x6b5c('0x36')](_0x3ec63b[_0x6b5c('0x31')],qs[_0x6b5c('0x37')](_0x48993d[_0x6b5c('0x32')][_0x6b5c('0x37')]));_0x513f30[_0x6b5c('0x35')]=_0x513f30[_0x6b5c('0x35')][_0x6b5c('0x38')]?_0x513f30[_0x6b5c('0x35')]:_0x3ec63b[_0x6b5c('0x31')];if(!_0x48993d['query'][_0x6b5c('0x39')](_0x6b5c('0x3a'))){_0x513f30[_0x6b5c('0x1f')]=qs[_0x6b5c('0x1f')](_0x48993d[_0x6b5c('0x32')]['limit']);_0x513f30[_0x6b5c('0x1c')]=qs[_0x6b5c('0x1c')](_0x48993d[_0x6b5c('0x32')]['offset']);}_0x513f30[_0x6b5c('0x3b')]=qs[_0x6b5c('0x3c')](_0x48993d[_0x6b5c('0x32')][_0x6b5c('0x3c')]);_0x513f30['where']=qs[_0x6b5c('0x34')](_[_0x6b5c('0x3d')](_0x48993d['query'],_0x3ec63b['filters']),_0x6ab6d1);if(_0x48993d['query']['filter']){_0x513f30[_0x6b5c('0x3e')]=_[_0x6b5c('0x3f')](_0x513f30[_0x6b5c('0x3e')],{'$or':_[_0x6b5c('0x2b')](_0x6ab6d1,function(_0x1540f8){if(_0x1540f8[_0x6b5c('0x2f')]!==_0x6b5c('0x40')){var _0xa4734c={};_0xa4734c[_0x1540f8['name']]={'$like':'%'+_0x48993d[_0x6b5c('0x32')][_0x6b5c('0x41')]+'%'};return _0xa4734c;}})});}_0x513f30=_['merge']({},_0x513f30,_0x48993d['options']);var _0x1c005e={'where':_0x513f30['where']};return db[_0x6b5c('0x2c')]['count'](_0x1c005e)[_0x6b5c('0x25')](function(_0xdadc8a){_0x5968f8[_0x6b5c('0x1e')]=_0xdadc8a;if(_0x48993d[_0x6b5c('0x32')]['includeAll']){_0x513f30[_0x6b5c('0x42')]=[{'all':!![]}];}return db[_0x6b5c('0x2c')][_0x6b5c('0x43')](_0x513f30);})['then'](function(_0x5f169e){_0x5968f8[_0x6b5c('0x44')]=_0x5f169e;return _0x5968f8;})[_0x6b5c('0x25')](respondWithFilteredResult(_0x15dfac,_0x513f30))['catch'](handleError(_0x15dfac,null));};exports[_0x6b5c('0x45')]=function(_0x2ccb3d,_0x5ae07e){var _0x34c073={'raw':!![],'where':{'id':_0x2ccb3d[_0x6b5c('0x46')]['id']}},_0x14c293={};_0x14c293[_0x6b5c('0x31')]=_[_0x6b5c('0x33')](db[_0x6b5c('0x2c')]['rawAttributes']);_0x14c293[_0x6b5c('0x32')]=_['keys'](_0x2ccb3d['query']);_0x14c293[_0x6b5c('0x34')]=_[_0x6b5c('0x36')](_0x14c293[_0x6b5c('0x31')],_0x14c293[_0x6b5c('0x32')]);_0x34c073[_0x6b5c('0x35')]=_[_0x6b5c('0x36')](_0x14c293[_0x6b5c('0x31')],qs['fields'](_0x2ccb3d[_0x6b5c('0x32')][_0x6b5c('0x37')]));_0x34c073[_0x6b5c('0x35')]=_0x34c073[_0x6b5c('0x35')][_0x6b5c('0x38')]?_0x34c073[_0x6b5c('0x35')]:_0x14c293[_0x6b5c('0x31')];if(_0x2ccb3d[_0x6b5c('0x32')][_0x6b5c('0x47')]){_0x34c073[_0x6b5c('0x42')]=[{'all':!![]}];}_0x34c073=_[_0x6b5c('0x3f')]({},_0x34c073,_0x2ccb3d['options']);return db['SquareMessage'][_0x6b5c('0x48')](_0x34c073)[_0x6b5c('0x25')](handleEntityNotFound(_0x5ae07e,null))[_0x6b5c('0x25')](respondWithResult(_0x5ae07e,null))[_0x6b5c('0x49')](handleError(_0x5ae07e,null));};exports[_0x6b5c('0x4a')]=function(_0x4d1caa,_0x502b3a){return db['SquareMessage'][_0x6b5c('0x4a')](_0x4d1caa[_0x6b5c('0x4b')],{})['then'](respondWithResult(_0x502b3a,0xc9))[_0x6b5c('0x49')](handleError(_0x502b3a,null));};exports[_0x6b5c('0x24')]=function(_0x3908b0,_0x513fd1){if(_0x3908b0[_0x6b5c('0x4b')]['id']){delete _0x3908b0[_0x6b5c('0x4b')]['id'];}return db[_0x6b5c('0x2c')][_0x6b5c('0x48')]({'where':{'id':_0x3908b0[_0x6b5c('0x46')]['id']}})['then'](handleEntityNotFound(_0x513fd1,null))[_0x6b5c('0x25')](saveUpdates(_0x3908b0[_0x6b5c('0x4b')],null))[_0x6b5c('0x25')](respondWithResult(_0x513fd1,null))[_0x6b5c('0x49')](handleError(_0x513fd1,null));};exports[_0x6b5c('0x26')]=function(_0x1a95b4,_0x32e792){return db[_0x6b5c('0x2c')]['find']({'where':{'id':_0x1a95b4[_0x6b5c('0x46')]['id']}})[_0x6b5c('0x25')](handleEntityNotFound(_0x32e792,null))[_0x6b5c('0x25')](removeEntity(_0x32e792,null))[_0x6b5c('0x49')](handleError(_0x32e792,null));}; \ No newline at end of file +var _0x4eab=['Content-Range','apply','reject','update','destroy','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','then','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0x4eab,0x194));var _0xb4ea=function(_0x3974a6,_0x5651c2){_0x3974a6=_0x3974a6-0x0;var _0x17e1f0=_0x4eab[_0x3974a6];return _0x17e1f0;};'use strict';var emlformat=require(_0xb4ea('0x0'));var rimraf=require(_0xb4ea('0x1'));var zipdir=require(_0xb4ea('0x2'));var jsonpatch=require(_0xb4ea('0x3'));var rp=require(_0xb4ea('0x4'));var moment=require(_0xb4ea('0x5'));var BPromise=require(_0xb4ea('0x6'));var Mustache=require('mustache');var util=require(_0xb4ea('0x7'));var path=require(_0xb4ea('0x8'));var sox=require(_0xb4ea('0x9'));var csv=require(_0xb4ea('0xa'));var ejs=require(_0xb4ea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ea('0xc'));var squel=require('squel');var crypto=require(_0xb4ea('0xd'));var jsforce=require(_0xb4ea('0xe'));var deskjs=require(_0xb4ea('0xf'));var toCsv=require(_0xb4ea('0xa'));var querystring=require(_0xb4ea('0x10'));var Papa=require(_0xb4ea('0x11'));var Redis=require(_0xb4ea('0x12'));var authService=require(_0xb4ea('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4ea('0x14'));var logger=require(_0xb4ea('0x15'))(_0xb4ea('0x16'));var utils=require('../../config/utils');var config=require(_0xb4ea('0x17'));var licenseUtil=require(_0xb4ea('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x528d1c,_0x1fe577){_0x1fe577=_0x1fe577||0xcc;return function(_0x29e492){if(_0x29e492){return _0x528d1c[_0xb4ea('0x19')](_0x1fe577);}return _0x528d1c[_0xb4ea('0x1a')](_0x1fe577)[_0xb4ea('0x1b')]();};}function respondWithResult(_0x217a65,_0x584e34){_0x584e34=_0x584e34||0xc8;return function(_0x59590d){if(_0x59590d){return _0x217a65[_0xb4ea('0x1a')](_0x584e34)[_0xb4ea('0x1c')](_0x59590d);}};}function respondWithFilteredResult(_0x3c92e0,_0x1cb7e5){return function(_0x3cc4b0){if(_0x3cc4b0){var _0x24049d=typeof _0x1cb7e5[_0xb4ea('0x1d')]===_0xb4ea('0x1e')&&typeof _0x1cb7e5[_0xb4ea('0x1f')]===_0xb4ea('0x1e');var _0x1d4d58=_0x3cc4b0[_0xb4ea('0x20')];var _0x4567aa=_0x24049d?0x0:_0x1cb7e5[_0xb4ea('0x1d')];var _0x73b5e1=_0x24049d?_0x3cc4b0['count']:_0x1cb7e5[_0xb4ea('0x1d')]+_0x1cb7e5[_0xb4ea('0x1f')];var _0x807934;if(_0x73b5e1>=_0x1d4d58){_0x73b5e1=_0x1d4d58;_0x807934=0xc8;}else{_0x807934=0xce;}_0x3c92e0[_0xb4ea('0x1a')](_0x807934);return _0x3c92e0[_0xb4ea('0x21')](_0xb4ea('0x22'),_0x4567aa+'-'+_0x73b5e1+'/'+_0x1d4d58)[_0xb4ea('0x1c')](_0x3cc4b0);}return null;};}function patchUpdates(_0x3005cd){return function(_0xe3a711){try{jsonpatch[_0xb4ea('0x23')](_0xe3a711,_0x3005cd,!![]);}catch(_0x46ffdf){return BPromise[_0xb4ea('0x24')](_0x46ffdf);}return _0xe3a711['save']();};}function saveUpdates(_0x240b0c,_0x307c16){return function(_0x5c08e6){if(_0x5c08e6){return _0x5c08e6[_0xb4ea('0x25')](_0x240b0c)['then'](function(_0x3fd71c){return _0x3fd71c;});}return null;};}function removeEntity(_0x48f97e,_0x28dc89){return function(_0x39a387){if(_0x39a387){return _0x39a387[_0xb4ea('0x26')]()['then'](function(){_0x48f97e[_0xb4ea('0x1a')](0xcc)[_0xb4ea('0x1b')]();});}};}function handleEntityNotFound(_0x382172,_0x314de3){return function(_0x1ca9ed){if(!_0x1ca9ed){_0x382172[_0xb4ea('0x19')](0x194);}return _0x1ca9ed;};}function handleError(_0x3343f4,_0x221ab2){_0x221ab2=_0x221ab2||0x1f4;return function(_0x4a8791){logger['error'](_0x4a8791['stack']);if(_0x4a8791[_0xb4ea('0x27')]){delete _0x4a8791[_0xb4ea('0x27')];}_0x3343f4[_0xb4ea('0x1a')](_0x221ab2)['send'](_0x4a8791);};}exports[_0xb4ea('0x28')]=function(_0x355701,_0x3557b1){var _0x48ab5b={},_0x527992={},_0x1ce75e={'count':0x0,'rows':[]};var _0x2d9067=_[_0xb4ea('0x29')](db[_0xb4ea('0x2a')][_0xb4ea('0x2b')],function(_0x3a1b00){return{'name':_0x3a1b00[_0xb4ea('0x2c')],'type':_0x3a1b00[_0xb4ea('0x2d')][_0xb4ea('0x2e')]};});_0x527992['model']=_[_0xb4ea('0x29')](_0x2d9067,'name');_0x527992[_0xb4ea('0x2f')]=_[_0xb4ea('0x30')](_0x355701['query']);_0x527992[_0xb4ea('0x31')]=_[_0xb4ea('0x32')](_0x527992[_0xb4ea('0x33')],_0x527992[_0xb4ea('0x2f')]);_0x48ab5b[_0xb4ea('0x34')]=_['intersection'](_0x527992[_0xb4ea('0x33')],qs['fields'](_0x355701[_0xb4ea('0x2f')]['fields']));_0x48ab5b[_0xb4ea('0x34')]=_0x48ab5b['attributes'][_0xb4ea('0x35')]?_0x48ab5b[_0xb4ea('0x34')]:_0x527992[_0xb4ea('0x33')];if(!_0x355701[_0xb4ea('0x2f')]['hasOwnProperty'](_0xb4ea('0x36'))){_0x48ab5b['limit']=qs[_0xb4ea('0x1f')](_0x355701[_0xb4ea('0x2f')][_0xb4ea('0x1f')]);_0x48ab5b[_0xb4ea('0x1d')]=qs[_0xb4ea('0x1d')](_0x355701['query']['offset']);}_0x48ab5b[_0xb4ea('0x37')]=qs[_0xb4ea('0x38')](_0x355701['query'][_0xb4ea('0x38')]);_0x48ab5b['where']=qs[_0xb4ea('0x31')](_[_0xb4ea('0x39')](_0x355701[_0xb4ea('0x2f')],_0x527992[_0xb4ea('0x31')]),_0x2d9067);if(_0x355701['query'][_0xb4ea('0x3a')]){_0x48ab5b[_0xb4ea('0x3b')]=_[_0xb4ea('0x3c')](_0x48ab5b[_0xb4ea('0x3b')],{'$or':_[_0xb4ea('0x29')](_0x2d9067,function(_0x1e8b4d){if(_0x1e8b4d['type']!=='VIRTUAL'){var _0x10d72c={};_0x10d72c[_0x1e8b4d[_0xb4ea('0x27')]]={'$like':'%'+_0x355701['query'][_0xb4ea('0x3a')]+'%'};return _0x10d72c;}})});}_0x48ab5b=_[_0xb4ea('0x3c')]({},_0x48ab5b,_0x355701[_0xb4ea('0x3d')]);var _0xdb7334={'where':_0x48ab5b[_0xb4ea('0x3b')]};return db['SquareMessage'][_0xb4ea('0x20')](_0xdb7334)['then'](function(_0x1516c6){_0x1ce75e['count']=_0x1516c6;if(_0x355701['query'][_0xb4ea('0x3e')]){_0x48ab5b[_0xb4ea('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0xb4ea('0x40')](_0x48ab5b);})[_0xb4ea('0x41')](function(_0x4335df){_0x1ce75e['rows']=_0x4335df;return _0x1ce75e;})[_0xb4ea('0x41')](respondWithFilteredResult(_0x3557b1,_0x48ab5b))[_0xb4ea('0x42')](handleError(_0x3557b1,null));};exports[_0xb4ea('0x43')]=function(_0x22e2a1,_0x1ac8e5){var _0x46e865={'raw':!![],'where':{'id':_0x22e2a1[_0xb4ea('0x44')]['id']}},_0x41546c={};_0x41546c[_0xb4ea('0x33')]=_[_0xb4ea('0x30')](db[_0xb4ea('0x2a')]['rawAttributes']);_0x41546c[_0xb4ea('0x2f')]=_[_0xb4ea('0x30')](_0x22e2a1[_0xb4ea('0x2f')]);_0x41546c[_0xb4ea('0x31')]=_['intersection'](_0x41546c[_0xb4ea('0x33')],_0x41546c['query']);_0x46e865[_0xb4ea('0x34')]=_[_0xb4ea('0x32')](_0x41546c['model'],qs[_0xb4ea('0x45')](_0x22e2a1[_0xb4ea('0x2f')][_0xb4ea('0x45')]));_0x46e865[_0xb4ea('0x34')]=_0x46e865[_0xb4ea('0x34')][_0xb4ea('0x35')]?_0x46e865[_0xb4ea('0x34')]:_0x41546c[_0xb4ea('0x33')];if(_0x22e2a1[_0xb4ea('0x2f')][_0xb4ea('0x3e')]){_0x46e865['include']=[{'all':!![]}];}_0x46e865=_[_0xb4ea('0x3c')]({},_0x46e865,_0x22e2a1[_0xb4ea('0x3d')]);return db['SquareMessage'][_0xb4ea('0x46')](_0x46e865)['then'](handleEntityNotFound(_0x1ac8e5,null))[_0xb4ea('0x41')](respondWithResult(_0x1ac8e5,null))[_0xb4ea('0x42')](handleError(_0x1ac8e5,null));};exports['create']=function(_0x2a159c,_0x166d2c){return db[_0xb4ea('0x2a')][_0xb4ea('0x47')](_0x2a159c[_0xb4ea('0x48')],{})['then'](respondWithResult(_0x166d2c,0xc9))[_0xb4ea('0x42')](handleError(_0x166d2c,null));};exports[_0xb4ea('0x25')]=function(_0x4e0d56,_0x3ea63e){if(_0x4e0d56[_0xb4ea('0x48')]['id']){delete _0x4e0d56['body']['id'];}return db['SquareMessage'][_0xb4ea('0x46')]({'where':{'id':_0x4e0d56[_0xb4ea('0x44')]['id']}})[_0xb4ea('0x41')](handleEntityNotFound(_0x3ea63e,null))[_0xb4ea('0x41')](saveUpdates(_0x4e0d56['body'],null))[_0xb4ea('0x41')](respondWithResult(_0x3ea63e,null))[_0xb4ea('0x42')](handleError(_0x3ea63e,null));};exports['destroy']=function(_0x162f3e,_0x1807f7){return db['SquareMessage'][_0xb4ea('0x46')]({'where':{'id':_0x162f3e[_0xb4ea('0x44')]['id']}})[_0xb4ea('0x41')](handleEntityNotFound(_0x1807f7,null))[_0xb4ea('0x41')](removeEntity(_0x1807f7,null))[_0xb4ea('0x42')](handleError(_0x1807f7,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3309d3e..7cd1879 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 _0xb7cb=['bluebird','path','rimraf','../../config/environment','exports','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xb7cb,0x157));var _0xbb7c=function(_0x44799d,_0x26c23a){_0x44799d=_0x44799d-0x0;var _0x4f4a20=_0xb7cb[_0x44799d];return _0x4f4a20;};'use strict';var _=require(_0xbb7c('0x0'));var util=require(_0xbb7c('0x1'));var logger=require(_0xbb7c('0x2'))(_0xbb7c('0x3'));var moment=require(_0xbb7c('0x4'));var BPromise=require(_0xbb7c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb7c('0x6'));var rimraf=require(_0xbb7c('0x7'));var config=require(_0xbb7c('0x8'));var attributes=require('./squareMessage.attributes');module[_0xbb7c('0x9')]=function(_0x11a8ba,_0x34e984){return _0x11a8ba['define'](_0xbb7c('0xa'),attributes,{'tableName':_0xbb7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bab=['request-promise','path','./squareMessage.attributes','exports','SquareMessage','square_messages','util','moment','bluebird'];(function(_0x48bc49,_0x19554e){var _0x2ba4aa=function(_0x9d1c2b){while(--_0x9d1c2b){_0x48bc49['push'](_0x48bc49['shift']());}};_0x2ba4aa(++_0x19554e);}(_0x6bab,0x15c));var _0xb6ba=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0x6bab[_0x2272b5];return _0x110156;};'use strict';var _=require('lodash');var util=require(_0xb6ba('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb6ba('0x1'));var BPromise=require(_0xb6ba('0x2'));var rp=require(_0xb6ba('0x3'));var fs=require('fs');var path=require(_0xb6ba('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb6ba('0x5'));module[_0xb6ba('0x6')]=function(_0x1cbb11,_0x3eb088){return _0x1cbb11['define'](_0xb6ba('0x7'),attributes,{'tableName':_0xb6ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index f0e0995..d3a6e2e 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 _0xd01c=['client','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','catch','body','options','raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x42d31b,_0x42e99a){var _0x70d12d=function(_0x1a72ad){while(--_0x1a72ad){_0x42d31b['push'](_0x42d31b['shift']());}};_0x70d12d(++_0x42e99a);}(_0xd01c,0x1ad));var _0xcd01=function(_0x1b5491,_0x2b50da){_0x1b5491=_0x1b5491-0x0;var _0x5f29f0=_0xd01c[_0x1b5491];return _0x5f29f0;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var moment=require(_0xcd01('0x2'));var BPromise=require(_0xcd01('0x3'));var rs=require(_0xcd01('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd01('0x5'))['db'];var utils=require(_0xcd01('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcd01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd01('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a08f7,_0x326cfa,_0x24a4df){return new BPromise(function(_0x300153,_0x25ce2d){return client[_0xcd01('0x9')](_0x3a08f7,_0x24a4df)['then'](function(_0x138553){logger[_0xcd01('0xa')]('SquareMessage,\x20%s,\x20%s',_0x326cfa,_0xcd01('0xb'));logger[_0xcd01('0xc')](_0xcd01('0xd'),_0x326cfa,_0xcd01('0xb'),JSON[_0xcd01('0xe')](_0x138553));if(_0x138553[_0xcd01('0xf')]){if(_0x138553[_0xcd01('0xf')]['code']===0x1f4){logger[_0xcd01('0xf')](_0xcd01('0x10'),_0x326cfa,_0x138553[_0xcd01('0xf')]['message']);return _0x25ce2d(_0x138553[_0xcd01('0xf')][_0xcd01('0x11')]);}logger['error'](_0xcd01('0x10'),_0x326cfa,_0x138553['error'][_0xcd01('0x11')]);return _0x300153(_0x138553[_0xcd01('0xf')][_0xcd01('0x11')]);}else{logger[_0xcd01('0xa')]('SquareMessage,\x20%s,\x20%s',_0x326cfa,_0xcd01('0xb'));_0x300153(_0x138553['result'][_0xcd01('0x11')]);}})[_0xcd01('0x12')](function(_0x219753){logger[_0xcd01('0xf')](_0xcd01('0x10'),_0x326cfa,_0x219753);_0x25ce2d(_0x219753);});});}exports['CreateSquareMessage']=function(_0x103c01){var _0x394397=this;return new Promise(function(_0x3cd0a5,_0x5c77a7){return db['SquareMessage']['create'](_0x103c01[_0xcd01('0x13')],{'raw':_0x103c01['options']?_0x103c01[_0xcd01('0x14')][_0xcd01('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x1df836){logger[_0xcd01('0xa')](_0xcd01('0x16'),_0x103c01);logger[_0xcd01('0xc')]('CreateSquareMessage',_0x103c01,JSON[_0xcd01('0xe')](_0x1df836));_0x3cd0a5(_0x1df836);})['catch'](function(_0x1bc630){logger[_0xcd01('0xf')](_0xcd01('0x16'),_0x1bc630[_0xcd01('0x11')],_0x103c01);_0x5c77a7(_0x394397[_0xcd01('0xf')](0x1f4,_0x1bc630[_0xcd01('0x11')]));});});}; \ No newline at end of file +var _0x90a1=['body','options','raw','CreateSquareMessage','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xf0fc26,_0x489d84){var _0x260ed3=function(_0x14abf3){while(--_0x14abf3){_0xf0fc26['push'](_0xf0fc26['shift']());}};_0x260ed3(++_0x489d84);}(_0x90a1,0x1f2));var _0x190a=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x90a1[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var util=require(_0x190a('0x0'));var moment=require(_0x190a('0x1'));var BPromise=require(_0x190a('0x2'));var rs=require(_0x190a('0x3'));var fs=require('fs');var Redis=require(_0x190a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x190a('0x5'))(_0x190a('0x6'));var config=require('../../config/environment');var jayson=require(_0x190a('0x7'));var client=jayson['client'][_0x190a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d60ff,_0x2720ab,_0x4308f2){return new BPromise(function(_0x22b27e,_0x4b684a){return client[_0x190a('0x9')](_0x5d60ff,_0x4308f2)[_0x190a('0xa')](function(_0x4f06ac){logger[_0x190a('0xb')](_0x190a('0xc'),_0x2720ab,'request\x20sent');logger[_0x190a('0xd')](_0x190a('0xe'),_0x2720ab,'request\x20sent',JSON[_0x190a('0xf')](_0x4f06ac));if(_0x4f06ac['error']){if(_0x4f06ac[_0x190a('0x10')][_0x190a('0x11')]===0x1f4){logger['error'](_0x190a('0xc'),_0x2720ab,_0x4f06ac[_0x190a('0x10')][_0x190a('0x12')]);return _0x4b684a(_0x4f06ac[_0x190a('0x10')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x2720ab,_0x4f06ac[_0x190a('0x10')][_0x190a('0x12')]);return _0x22b27e(_0x4f06ac[_0x190a('0x10')][_0x190a('0x12')]);}else{logger[_0x190a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x2720ab,_0x190a('0x13'));_0x22b27e(_0x4f06ac[_0x190a('0x14')][_0x190a('0x12')]);}})[_0x190a('0x15')](function(_0x2ba79e){logger['error'](_0x190a('0xc'),_0x2720ab,_0x2ba79e);_0x4b684a(_0x2ba79e);});});}exports['CreateSquareMessage']=function(_0x9a9bba){var _0x32c1e1=this;return new Promise(function(_0x479c9d,_0x49511){return db['SquareMessage']['create'](_0x9a9bba[_0x190a('0x16')],{'raw':_0x9a9bba[_0x190a('0x17')]?_0x9a9bba[_0x190a('0x17')][_0x190a('0x18')]===undefined?!![]:![]:!![]})[_0x190a('0xa')](function(_0x8f67d8){logger[_0x190a('0xb')](_0x190a('0x19'),_0x9a9bba);logger[_0x190a('0xd')](_0x190a('0x19'),_0x9a9bba,JSON[_0x190a('0xf')](_0x8f67d8));_0x479c9d(_0x8f67d8);})[_0x190a('0x15')](function(_0x15c523){logger[_0x190a('0x10')](_0x190a('0x19'),_0x15c523[_0x190a('0x12')],_0x9a9bba);_0x49511(_0x32c1e1[_0x190a('0x10')](0x1f4,_0x15c523[_0x190a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9e9dead..fbb2a31 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 _0x8caa=['get','/:id','isAuthenticated','show','/:id/test','15s','post','create','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller'];(function(_0x1b7683,_0x6c5a86){var _0xaa19db=function(_0x52442b){while(--_0x52442b){_0x1b7683['push'](_0x1b7683['shift']());}};_0xaa19db(++_0x6c5a86);}(_0x8caa,0xac));var _0xa8ca=function(_0x57a4d0,_0xa6e6b){_0x57a4d0=_0x57a4d0-0x0;var _0xaaadee=_0x8caa[_0x57a4d0];return _0xaaadee;};'use strict';var multer=require(_0xa8ca('0x0'));var util=require(_0xa8ca('0x1'));var path=require('path');var timeout=require(_0xa8ca('0x2'));var express=require(_0xa8ca('0x3'));var router=express['Router']();var fs_extra=require(_0xa8ca('0x4'));var auth=require(_0xa8ca('0x5'));var interaction=require(_0xa8ca('0x6'));var config=require('../../config/environment');var controller=require(_0xa8ca('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa8ca('0x8')](_0xa8ca('0x9'),auth[_0xa8ca('0xa')](),controller[_0xa8ca('0xb')]);router[_0xa8ca('0x8')](_0xa8ca('0xc'),auth[_0xa8ca('0xa')](),timeout(_0xa8ca('0xd')),controller['test']);router[_0xa8ca('0xe')]('/',auth[_0xa8ca('0xa')](),controller[_0xa8ca('0xf')]);router['put'](_0xa8ca('0x9'),auth[_0xa8ca('0xa')](),controller[_0xa8ca('0x10')]);router['delete'](_0xa8ca('0x9'),auth['isAuthenticated'](),controller[_0xa8ca('0x11')]);module['exports']=router; \ No newline at end of file +var _0xada8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','update','delete'];(function(_0xb91692,_0x2f9883){var _0x228cde=function(_0x8348b5){while(--_0x8348b5){_0xb91692['push'](_0xb91692['shift']());}};_0x228cde(++_0x2f9883);}(_0xada8,0xdd));var _0x8ada=function(_0x38ef90,_0x114944){_0x38ef90=_0x38ef90-0x0;var _0x563680=_0xada8[_0x38ef90];return _0x563680;};'use strict';var multer=require(_0x8ada('0x0'));var util=require(_0x8ada('0x1'));var path=require(_0x8ada('0x2'));var timeout=require(_0x8ada('0x3'));var express=require('express');var router=express[_0x8ada('0x4')]();var fs_extra=require(_0x8ada('0x5'));var auth=require(_0x8ada('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ada('0x7'));var controller=require(_0x8ada('0x8'));router[_0x8ada('0x9')]('/',auth[_0x8ada('0xa')](),controller[_0x8ada('0xb')]);router[_0x8ada('0x9')](_0x8ada('0xc'),auth[_0x8ada('0xa')](),controller[_0x8ada('0xd')]);router[_0x8ada('0x9')]('/:id/test',auth[_0x8ada('0xa')](),timeout('15s'),controller[_0x8ada('0xe')]);router['post']('/',auth[_0x8ada('0xa')](),controller['create']);router['put'](_0x8ada('0xc'),auth[_0x8ada('0xa')](),controller[_0x8ada('0xf')]);router[_0x8ada('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index d4a46a2..2b49d0a 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 _0x086c=['STRING','exports'];(function(_0x45f7d6,_0x36e444){var _0x513cf7=function(_0x30cc6b){while(--_0x30cc6b){_0x45f7d6['push'](_0x45f7d6['shift']());}};_0x513cf7(++_0x36e444);}(_0x086c,0x1c7));var _0xc086=function(_0x2971e6,_0x4a962e){_0x2971e6=_0x2971e6-0x0;var _0x5e6392=_0x086c[_0x2971e6];return _0x5e6392;};'use strict';var Sequelize=require('sequelize');module[_0xc086('0x0')]={'name':{'type':Sequelize[_0xc086('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc086('0x1')]},'description':{'type':Sequelize[_0xc086('0x1')]}}; \ No newline at end of file +var _0xcd8c=['STRING','name','sequelize','exports'];(function(_0x2d836f,_0x3e46d4){var _0xa98e4e=function(_0x3f9b17){while(--_0x3f9b17){_0x2d836f['push'](_0x2d836f['shift']());}};_0xa98e4e(++_0x3e46d4);}(_0xcd8c,0x1da));var _0xccd8=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0xcd8c[_0x59987a];return _0x460646;};'use strict';var Sequelize=require(_0xccd8('0x0'));module[_0xccd8('0x1')]={'name':{'type':Sequelize[_0xccd8('0x2')],'unique':_0xccd8('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xccd8('0x2')]},'description':{'type':Sequelize[_0xccd8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8fdfd05..d8b2d2c 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 _0x858f=['get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x858f,0x170));var _0xf858=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x858f[_0x556634];return _0x4429fd;};'use strict';var emlformat=require(_0xf858('0x0'));var rimraf=require(_0xf858('0x1'));var zipdir=require(_0xf858('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf858('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf858('0x4'));var util=require(_0xf858('0x5'));var path=require('path');var sox=require(_0xf858('0x6'));var csv=require(_0xf858('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf858('0x8'));var _=require(_0xf858('0x9'));var squel=require(_0xf858('0xa'));var crypto=require(_0xf858('0xb'));var jsforce=require(_0xf858('0xc'));var deskjs=require(_0xf858('0xd'));var toCsv=require(_0xf858('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf858('0xe'));var authService=require(_0xf858('0xf'));var qs=require(_0xf858('0x10'));var as=require(_0xf858('0x11'));var hardwareService=require(_0xf858('0x12'));var logger=require(_0xf858('0x13'))('api');var utils=require(_0xf858('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf858('0x15'));var db=require(_0xf858('0x16'))['db'];function respondWithStatusCode(_0x464657,_0x4098dc){_0x4098dc=_0x4098dc||0xcc;return function(_0x11e6cc){if(_0x11e6cc){return _0x464657[_0xf858('0x17')](_0x4098dc);}return _0x464657[_0xf858('0x18')](_0x4098dc)[_0xf858('0x19')]();};}function respondWithResult(_0xba25bd,_0x40e90e){_0x40e90e=_0x40e90e||0xc8;return function(_0x5b5cd2){if(_0x5b5cd2){return _0xba25bd[_0xf858('0x18')](_0x40e90e)[_0xf858('0x1a')](_0x5b5cd2);}};}function respondWithFilteredResult(_0x20345b,_0x15f4a6){return function(_0x371b84){if(_0x371b84){var _0x1815c5=typeof _0x15f4a6[_0xf858('0x1b')]===_0xf858('0x1c')&&typeof _0x15f4a6['limit']===_0xf858('0x1c');var _0x1e8da3=_0x371b84[_0xf858('0x1d')];var _0x186b9d=_0x1815c5?0x0:_0x15f4a6[_0xf858('0x1b')];var _0x45a9e6=_0x1815c5?_0x371b84['count']:_0x15f4a6[_0xf858('0x1b')]+_0x15f4a6['limit'];var _0x1a15dd;if(_0x45a9e6>=_0x1e8da3){_0x45a9e6=_0x1e8da3;_0x1a15dd=0xc8;}else{_0x1a15dd=0xce;}_0x20345b['status'](_0x1a15dd);return _0x20345b['set']('Content-Range',_0x186b9d+'-'+_0x45a9e6+'/'+_0x1e8da3)[_0xf858('0x1a')](_0x371b84);}return null;};}function patchUpdates(_0x801ead){return function(_0x5beb73){try{jsonpatch[_0xf858('0x1e')](_0x5beb73,_0x801ead,!![]);}catch(_0x282667){return BPromise['reject'](_0x282667);}return _0x5beb73['save']();};}function saveUpdates(_0x530f8c,_0x47e39e){return function(_0x4eff3b){if(_0x4eff3b){return _0x4eff3b['update'](_0x530f8c)[_0xf858('0x1f')](function(_0x530874){return _0x530874;});}return null;};}function removeEntity(_0x3c3da3,_0x3feb3e){return function(_0x2b7695){if(_0x2b7695){return _0x2b7695['destroy']()['then'](function(){var _0x2e98a5=_0x2b7695[_0xf858('0x20')]({'plain':!![]});var _0x3b4892=_0xf858('0x21');return db[_0xf858('0x22')]['destroy']({'where':{'type':_0x3b4892,'resourceId':_0x2e98a5['id']}})[_0xf858('0x1f')](function(){return _0x2b7695;});})[_0xf858('0x1f')](function(){_0x3c3da3[_0xf858('0x18')](0xcc)[_0xf858('0x19')]();});}};}function handleEntityNotFound(_0x3d024d,_0x41094a){return function(_0x14fe70){if(!_0x14fe70){_0x3d024d[_0xf858('0x17')](0x194);}return _0x14fe70;};}function handleError(_0x1a5b1c,_0x52407d){_0x52407d=_0x52407d||0x1f4;return function(_0x143d33){logger[_0xf858('0x23')](_0x143d33[_0xf858('0x24')]);if(_0x143d33[_0xf858('0x25')]){delete _0x143d33[_0xf858('0x25')];}_0x1a5b1c[_0xf858('0x18')](_0x52407d)[_0xf858('0x26')](_0x143d33);};}exports[_0xf858('0x27')]=function(_0x266a8b,_0x3983cc){var _0x1f7509={},_0x305ea6={},_0x502402={'count':0x0,'rows':[]};var _0x5d175c=_[_0xf858('0x28')](db[_0xf858('0x29')][_0xf858('0x2a')],function(_0x2a9bc6){return{'name':_0x2a9bc6[_0xf858('0x2b')],'type':_0x2a9bc6[_0xf858('0x2c')][_0xf858('0x2d')]};});_0x305ea6[_0xf858('0x2e')]=_[_0xf858('0x28')](_0x5d175c,_0xf858('0x25'));_0x305ea6['query']=_['keys'](_0x266a8b[_0xf858('0x2f')]);_0x305ea6['filters']=_[_0xf858('0x30')](_0x305ea6[_0xf858('0x2e')],_0x305ea6[_0xf858('0x2f')]);_0x1f7509[_0xf858('0x31')]=_[_0xf858('0x30')](_0x305ea6['model'],qs['fields'](_0x266a8b[_0xf858('0x2f')][_0xf858('0x32')]));_0x1f7509[_0xf858('0x31')]=_0x1f7509[_0xf858('0x31')]['length']?_0x1f7509[_0xf858('0x31')]:_0x305ea6['model'];if(!_0x266a8b[_0xf858('0x2f')][_0xf858('0x33')](_0xf858('0x34'))){_0x1f7509[_0xf858('0x35')]=qs['limit'](_0x266a8b[_0xf858('0x2f')][_0xf858('0x35')]);_0x1f7509[_0xf858('0x1b')]=qs[_0xf858('0x1b')](_0x266a8b[_0xf858('0x2f')][_0xf858('0x1b')]);}_0x1f7509[_0xf858('0x36')]=qs[_0xf858('0x37')](_0x266a8b[_0xf858('0x2f')][_0xf858('0x37')]);_0x1f7509[_0xf858('0x38')]=qs['filters'](_[_0xf858('0x39')](_0x266a8b[_0xf858('0x2f')],_0x305ea6[_0xf858('0x3a')]),_0x5d175c);if(_0x266a8b[_0xf858('0x2f')]['filter']){_0x1f7509[_0xf858('0x38')]=_[_0xf858('0x3b')](_0x1f7509[_0xf858('0x38')],{'$or':_[_0xf858('0x28')](_0x5d175c,function(_0x7b4d49){if(_0x7b4d49['type']!=='VIRTUAL'){var _0x100544={};_0x100544[_0x7b4d49['name']]={'$like':'%'+_0x266a8b[_0xf858('0x2f')][_0xf858('0x3c')]+'%'};return _0x100544;}})});}_0x1f7509=_[_0xf858('0x3b')]({},_0x1f7509,_0x266a8b[_0xf858('0x3d')]);var _0x3bbe50={'where':_0x1f7509[_0xf858('0x38')]};return db[_0xf858('0x29')][_0xf858('0x1d')](_0x3bbe50)[_0xf858('0x1f')](function(_0x3e28f6){_0x502402[_0xf858('0x1d')]=_0x3e28f6;if(_0x266a8b[_0xf858('0x2f')][_0xf858('0x3e')]){_0x1f7509[_0xf858('0x3f')]=[{'all':!![]}];}return db['SquareOdbc'][_0xf858('0x40')](_0x1f7509);})['then'](function(_0x29968c){_0x502402['rows']=_0x29968c;return _0x502402;})[_0xf858('0x1f')](respondWithFilteredResult(_0x3983cc,_0x1f7509))[_0xf858('0x41')](handleError(_0x3983cc,null));};exports['show']=function(_0x17206f,_0x2a36e8){var _0x4b7806={'raw':!![],'where':{'id':_0x17206f['params']['id']}},_0x28a40a={};_0x28a40a[_0xf858('0x2e')]=_[_0xf858('0x42')](db[_0xf858('0x29')][_0xf858('0x2a')]);_0x28a40a['query']=_['keys'](_0x17206f[_0xf858('0x2f')]);_0x28a40a[_0xf858('0x3a')]=_['intersection'](_0x28a40a[_0xf858('0x2e')],_0x28a40a[_0xf858('0x2f')]);_0x4b7806[_0xf858('0x31')]=_[_0xf858('0x30')](_0x28a40a['model'],qs[_0xf858('0x32')](_0x17206f[_0xf858('0x2f')][_0xf858('0x32')]));_0x4b7806['attributes']=_0x4b7806[_0xf858('0x31')]['length']?_0x4b7806[_0xf858('0x31')]:_0x28a40a[_0xf858('0x2e')];if(_0x17206f[_0xf858('0x2f')][_0xf858('0x3e')]){_0x4b7806[_0xf858('0x3f')]=[{'all':!![]}];}_0x4b7806=_['merge']({},_0x4b7806,_0x17206f[_0xf858('0x3d')]);return db[_0xf858('0x29')][_0xf858('0x43')](_0x4b7806)['then'](handleEntityNotFound(_0x2a36e8,null))[_0xf858('0x1f')](respondWithResult(_0x2a36e8,null))[_0xf858('0x41')](handleError(_0x2a36e8,null));};exports[_0xf858('0x44')]=function(_0x550828,_0x58ac3a){return db[_0xf858('0x29')][_0xf858('0x44')](_0x550828[_0xf858('0x45')],{})['then'](function(_0x21ba8d){var _0x22800c=_0x550828[_0xf858('0x46')]['get']({'plain':!![]});if(!_0x22800c)throw new Error(_0xf858('0x47'));if(_0x22800c[_0xf858('0x48')]===_0xf858('0x46')){var _0x213a96=_0x21ba8d['get']({'plain':!![]});var _0x286f6b=_0xf858('0x21');return db['UserProfileSection'][_0xf858('0x43')]({'where':{'name':_0x286f6b,'userProfileId':_0x22800c[_0xf858('0x49')]},'raw':!![]})[_0xf858('0x1f')](function(_0x666f92){if(_0x666f92&&_0x666f92['autoAssociation']===0x0){return db[_0xf858('0x22')][_0xf858('0x44')]({'name':_0x213a96[_0xf858('0x25')],'resourceId':_0x213a96['id'],'type':_0x666f92[_0xf858('0x25')],'sectionId':_0x666f92['id']},{})[_0xf858('0x1f')](function(){return _0x21ba8d;});}else{return _0x21ba8d;}})[_0xf858('0x41')](function(_0x1ccb6c){logger['error'](_0xf858('0x4a'),_0x1ccb6c);throw _0x1ccb6c;});}return _0x21ba8d;})[_0xf858('0x1f')](respondWithResult(_0x58ac3a,0xc9))[_0xf858('0x41')](handleError(_0x58ac3a,null));};exports[_0xf858('0x4b')]=function(_0x201720,_0x363db6){if(_0x201720[_0xf858('0x45')]['id']){delete _0x201720[_0xf858('0x45')]['id'];}return db[_0xf858('0x29')]['find']({'where':{'id':_0x201720[_0xf858('0x4c')]['id']}})[_0xf858('0x1f')](handleEntityNotFound(_0x363db6,null))['then'](saveUpdates(_0x201720[_0xf858('0x45')],null))[_0xf858('0x1f')](respondWithResult(_0x363db6,null))[_0xf858('0x41')](handleError(_0x363db6,null));};exports['destroy']=function(_0x526425,_0x109439){return db[_0xf858('0x29')][_0xf858('0x43')]({'where':{'id':_0x526425[_0xf858('0x4c')]['id']}})[_0xf858('0x1f')](handleEntityNotFound(_0x109439,null))[_0xf858('0x1f')](removeEntity(_0x109439,null))[_0xf858('0x41')](handleError(_0x109439,null));};exports['test']=function(_0x6d64c6,_0x1a3cd6,_0x5239f9){var _0x1ed734;return db['SquareOdbc'][_0xf858('0x43')]({'where':{'id':_0x6d64c6[_0xf858('0x4c')]['id']},'attributes':['id',_0xf858('0x4d')]})['then'](handleEntityNotFound(_0x1a3cd6,null))[_0xf858('0x1f')](function(_0x5bb7f6){if(_0x5bb7f6){var _0x224378=require(_0xf858('0x4e'))();_0x224378['openSync'](_0x5bb7f6[_0xf858('0x4d')]);_0x224378[_0xf858('0x4f')]();return _0x5bb7f6;}})['then'](respondWithResult(_0x1a3cd6,null))[_0xf858('0x41')](handleError(_0x1a3cd6,null));}; \ No newline at end of file +var _0xfc0f=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','odbc','dsn','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','ODBC','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SquareOdbc','includeAll','include','findAll','catch','show','params','options','find'];(function(_0x2b7961,_0x1a8c5d){var _0x22e798=function(_0x30f494){while(--_0x30f494){_0x2b7961['push'](_0x2b7961['shift']());}};_0x22e798(++_0x1a8c5d);}(_0xfc0f,0x15a));var _0xffc0=function(_0x455bbb,_0x4c24e9){_0x455bbb=_0x455bbb-0x0;var _0x4cf4cc=_0xfc0f[_0x455bbb];return _0x4cf4cc;};'use strict';var emlformat=require(_0xffc0('0x0'));var rimraf=require(_0xffc0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffc0('0x2'));var rp=require(_0xffc0('0x3'));var moment=require(_0xffc0('0x4'));var BPromise=require(_0xffc0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xffc0('0x6'));var sox=require(_0xffc0('0x7'));var csv=require(_0xffc0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffc0('0x9'));var _=require(_0xffc0('0xa'));var squel=require(_0xffc0('0xb'));var crypto=require(_0xffc0('0xc'));var jsforce=require(_0xffc0('0xd'));var deskjs=require(_0xffc0('0xe'));var toCsv=require(_0xffc0('0x8'));var querystring=require(_0xffc0('0xf'));var Papa=require(_0xffc0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xffc0('0x11'));var hardwareService=require(_0xffc0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xffc0('0x13'));var config=require(_0xffc0('0x14'));var licenseUtil=require(_0xffc0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bce46,_0x2a25e8){_0x2a25e8=_0x2a25e8||0xcc;return function(_0x176b65){if(_0x176b65){return _0x2bce46['sendStatus'](_0x2a25e8);}return _0x2bce46[_0xffc0('0x16')](_0x2a25e8)[_0xffc0('0x17')]();};}function respondWithResult(_0x5c382b,_0x5721d0){_0x5721d0=_0x5721d0||0xc8;return function(_0x7042d8){if(_0x7042d8){return _0x5c382b[_0xffc0('0x16')](_0x5721d0)[_0xffc0('0x18')](_0x7042d8);}};}function respondWithFilteredResult(_0x374d79,_0x2ed935){return function(_0x18bbc9){if(_0x18bbc9){var _0x118496=typeof _0x2ed935[_0xffc0('0x19')]===_0xffc0('0x1a')&&typeof _0x2ed935[_0xffc0('0x1b')]===_0xffc0('0x1a');var _0x4eeeba=_0x18bbc9[_0xffc0('0x1c')];var _0x2631b8=_0x118496?0x0:_0x2ed935[_0xffc0('0x19')];var _0x282692=_0x118496?_0x18bbc9['count']:_0x2ed935[_0xffc0('0x19')]+_0x2ed935[_0xffc0('0x1b')];var _0x1d1a54;if(_0x282692>=_0x4eeeba){_0x282692=_0x4eeeba;_0x1d1a54=0xc8;}else{_0x1d1a54=0xce;}_0x374d79[_0xffc0('0x16')](_0x1d1a54);return _0x374d79['set'](_0xffc0('0x1d'),_0x2631b8+'-'+_0x282692+'/'+_0x4eeeba)[_0xffc0('0x18')](_0x18bbc9);}return null;};}function patchUpdates(_0x4506cf){return function(_0x2a8313){try{jsonpatch[_0xffc0('0x1e')](_0x2a8313,_0x4506cf,!![]);}catch(_0x2d35a4){return BPromise[_0xffc0('0x1f')](_0x2d35a4);}return _0x2a8313['save']();};}function saveUpdates(_0x383e8f,_0x3d46ab){return function(_0x312eec){if(_0x312eec){return _0x312eec[_0xffc0('0x20')](_0x383e8f)[_0xffc0('0x21')](function(_0x45b211){return _0x45b211;});}return null;};}function removeEntity(_0x56e3c7,_0x3bdda8){return function(_0x31f440){if(_0x31f440){return _0x31f440['destroy']()['then'](function(){var _0x5b277f=_0x31f440['get']({'plain':!![]});var _0x1bdd92=_0xffc0('0x22');return db[_0xffc0('0x23')]['destroy']({'where':{'type':_0x1bdd92,'resourceId':_0x5b277f['id']}})[_0xffc0('0x21')](function(){return _0x31f440;});})[_0xffc0('0x21')](function(){_0x56e3c7[_0xffc0('0x16')](0xcc)[_0xffc0('0x17')]();});}};}function handleEntityNotFound(_0x36eef5,_0x58f433){return function(_0x3d57e4){if(!_0x3d57e4){_0x36eef5[_0xffc0('0x24')](0x194);}return _0x3d57e4;};}function handleError(_0x2c3a87,_0x10b50e){_0x10b50e=_0x10b50e||0x1f4;return function(_0x2f0f4b){logger['error'](_0x2f0f4b[_0xffc0('0x25')]);if(_0x2f0f4b['name']){delete _0x2f0f4b[_0xffc0('0x26')];}_0x2c3a87[_0xffc0('0x16')](_0x10b50e)[_0xffc0('0x27')](_0x2f0f4b);};}exports[_0xffc0('0x28')]=function(_0x453fcb,_0xe37fd8){var _0x1963f2={},_0x15b2d3={},_0x5d8e30={'count':0x0,'rows':[]};var _0x5bc2ef=_[_0xffc0('0x29')](db['SquareOdbc'][_0xffc0('0x2a')],function(_0x30108a){return{'name':_0x30108a['fieldName'],'type':_0x30108a[_0xffc0('0x2b')]['key']};});_0x15b2d3[_0xffc0('0x2c')]=_[_0xffc0('0x29')](_0x5bc2ef,_0xffc0('0x26'));_0x15b2d3[_0xffc0('0x2d')]=_[_0xffc0('0x2e')](_0x453fcb[_0xffc0('0x2d')]);_0x15b2d3[_0xffc0('0x2f')]=_[_0xffc0('0x30')](_0x15b2d3['model'],_0x15b2d3['query']);_0x1963f2[_0xffc0('0x31')]=_[_0xffc0('0x30')](_0x15b2d3['model'],qs['fields'](_0x453fcb['query'][_0xffc0('0x32')]));_0x1963f2[_0xffc0('0x31')]=_0x1963f2[_0xffc0('0x31')][_0xffc0('0x33')]?_0x1963f2[_0xffc0('0x31')]:_0x15b2d3[_0xffc0('0x2c')];if(!_0x453fcb['query']['hasOwnProperty'](_0xffc0('0x34'))){_0x1963f2[_0xffc0('0x1b')]=qs[_0xffc0('0x1b')](_0x453fcb[_0xffc0('0x2d')][_0xffc0('0x1b')]);_0x1963f2[_0xffc0('0x19')]=qs[_0xffc0('0x19')](_0x453fcb[_0xffc0('0x2d')][_0xffc0('0x19')]);}_0x1963f2[_0xffc0('0x35')]=qs['sort'](_0x453fcb[_0xffc0('0x2d')][_0xffc0('0x36')]);_0x1963f2[_0xffc0('0x37')]=qs[_0xffc0('0x2f')](_[_0xffc0('0x38')](_0x453fcb['query'],_0x15b2d3[_0xffc0('0x2f')]),_0x5bc2ef);if(_0x453fcb['query'][_0xffc0('0x39')]){_0x1963f2[_0xffc0('0x37')]=_[_0xffc0('0x3a')](_0x1963f2[_0xffc0('0x37')],{'$or':_[_0xffc0('0x29')](_0x5bc2ef,function(_0x4995ab){if(_0x4995ab[_0xffc0('0x2b')]!==_0xffc0('0x3b')){var _0x296a3e={};_0x296a3e[_0x4995ab[_0xffc0('0x26')]]={'$like':'%'+_0x453fcb[_0xffc0('0x2d')][_0xffc0('0x39')]+'%'};return _0x296a3e;}})});}_0x1963f2=_['merge']({},_0x1963f2,_0x453fcb['options']);var _0x31af7c={'where':_0x1963f2[_0xffc0('0x37')]};return db[_0xffc0('0x3c')]['count'](_0x31af7c)['then'](function(_0xb851cf){_0x5d8e30[_0xffc0('0x1c')]=_0xb851cf;if(_0x453fcb[_0xffc0('0x2d')][_0xffc0('0x3d')]){_0x1963f2[_0xffc0('0x3e')]=[{'all':!![]}];}return db[_0xffc0('0x3c')][_0xffc0('0x3f')](_0x1963f2);})[_0xffc0('0x21')](function(_0x3aaaab){_0x5d8e30['rows']=_0x3aaaab;return _0x5d8e30;})[_0xffc0('0x21')](respondWithFilteredResult(_0xe37fd8,_0x1963f2))[_0xffc0('0x40')](handleError(_0xe37fd8,null));};exports[_0xffc0('0x41')]=function(_0x5fe2ba,_0x33ba0f){var _0x1cd7c5={'raw':!![],'where':{'id':_0x5fe2ba[_0xffc0('0x42')]['id']}},_0x46cac1={};_0x46cac1[_0xffc0('0x2c')]=_[_0xffc0('0x2e')](db[_0xffc0('0x3c')][_0xffc0('0x2a')]);_0x46cac1[_0xffc0('0x2d')]=_['keys'](_0x5fe2ba[_0xffc0('0x2d')]);_0x46cac1[_0xffc0('0x2f')]=_['intersection'](_0x46cac1[_0xffc0('0x2c')],_0x46cac1[_0xffc0('0x2d')]);_0x1cd7c5[_0xffc0('0x31')]=_[_0xffc0('0x30')](_0x46cac1['model'],qs[_0xffc0('0x32')](_0x5fe2ba['query'][_0xffc0('0x32')]));_0x1cd7c5[_0xffc0('0x31')]=_0x1cd7c5[_0xffc0('0x31')][_0xffc0('0x33')]?_0x1cd7c5[_0xffc0('0x31')]:_0x46cac1['model'];if(_0x5fe2ba['query']['includeAll']){_0x1cd7c5[_0xffc0('0x3e')]=[{'all':!![]}];}_0x1cd7c5=_[_0xffc0('0x3a')]({},_0x1cd7c5,_0x5fe2ba[_0xffc0('0x43')]);return db[_0xffc0('0x3c')][_0xffc0('0x44')](_0x1cd7c5)[_0xffc0('0x21')](handleEntityNotFound(_0x33ba0f,null))['then'](respondWithResult(_0x33ba0f,null))['catch'](handleError(_0x33ba0f,null));};exports[_0xffc0('0x45')]=function(_0x1608f0,_0x11be01){return db[_0xffc0('0x3c')][_0xffc0('0x45')](_0x1608f0[_0xffc0('0x46')],{})[_0xffc0('0x21')](function(_0x42d6fa){var _0x4acde5=_0x1608f0[_0xffc0('0x47')][_0xffc0('0x48')]({'plain':!![]});if(!_0x4acde5)throw new Error(_0xffc0('0x49'));if(_0x4acde5[_0xffc0('0x4a')]===_0xffc0('0x47')){var _0x9801eb=_0x42d6fa[_0xffc0('0x48')]({'plain':!![]});var _0x2f1ac9='ODBC';return db['UserProfileSection'][_0xffc0('0x44')]({'where':{'name':_0x2f1ac9,'userProfileId':_0x4acde5[_0xffc0('0x4b')]},'raw':!![]})[_0xffc0('0x21')](function(_0x327e6a){if(_0x327e6a&&_0x327e6a[_0xffc0('0x4c')]===0x0){return db['UserProfileResource'][_0xffc0('0x45')]({'name':_0x9801eb[_0xffc0('0x26')],'resourceId':_0x9801eb['id'],'type':_0x327e6a['name'],'sectionId':_0x327e6a['id']},{})[_0xffc0('0x21')](function(){return _0x42d6fa;});}else{return _0x42d6fa;}})[_0xffc0('0x40')](function(_0x2ef0fe){logger[_0xffc0('0x4d')](_0xffc0('0x4e'),_0x2ef0fe);throw _0x2ef0fe;});}return _0x42d6fa;})[_0xffc0('0x21')](respondWithResult(_0x11be01,0xc9))[_0xffc0('0x40')](handleError(_0x11be01,null));};exports['update']=function(_0x4cec93,_0x231d81){if(_0x4cec93['body']['id']){delete _0x4cec93[_0xffc0('0x46')]['id'];}return db[_0xffc0('0x3c')]['find']({'where':{'id':_0x4cec93['params']['id']}})[_0xffc0('0x21')](handleEntityNotFound(_0x231d81,null))[_0xffc0('0x21')](saveUpdates(_0x4cec93[_0xffc0('0x46')],null))['then'](respondWithResult(_0x231d81,null))[_0xffc0('0x40')](handleError(_0x231d81,null));};exports[_0xffc0('0x4f')]=function(_0x10e886,_0x4983fc){return db[_0xffc0('0x3c')][_0xffc0('0x44')]({'where':{'id':_0x10e886[_0xffc0('0x42')]['id']}})['then'](handleEntityNotFound(_0x4983fc,null))[_0xffc0('0x21')](removeEntity(_0x4983fc,null))[_0xffc0('0x40')](handleError(_0x4983fc,null));};exports['test']=function(_0x26eb71,_0x559e48,_0x19bec0){var _0x5153f6;return db[_0xffc0('0x3c')]['find']({'where':{'id':_0x26eb71[_0xffc0('0x42')]['id']},'attributes':['id','dsn']})[_0xffc0('0x21')](handleEntityNotFound(_0x559e48,null))[_0xffc0('0x21')](function(_0x61341b){if(_0x61341b){var _0x3230f8=require(_0xffc0('0x50'))();_0x3230f8['openSync'](_0x61341b[_0xffc0('0x51')]);_0x3230f8[_0xffc0('0x52')]();return _0x61341b;}})[_0xffc0('0x21')](respondWithResult(_0x559e48,null))[_0xffc0('0x40')](handleError(_0x559e48,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 476146e..4909a14 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 _0x7d9d=['path','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','../../config/logger','moment'];(function(_0x3826a5,_0x4ce828){var _0x124601=function(_0x103699){while(--_0x103699){_0x3826a5['push'](_0x3826a5['shift']());}};_0x124601(++_0x4ce828);}(_0x7d9d,0x1ee));var _0xd7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd7d9('0x0'))('api');var moment=require(_0xd7d9('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7d9('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7d9('0x3'));module[_0xd7d9('0x4')]=function(_0x1d7aae,_0x4a2e49){return _0x1d7aae[_0xd7d9('0x5')](_0xd7d9('0x6'),attributes,{'tableName':_0xd7d9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc624=['../../config/environment','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x334945,_0x35451b){var _0x42557c=function(_0x314ca3){while(--_0x314ca3){_0x334945['push'](_0x334945['shift']());}};_0x42557c(++_0x35451b);}(_0xc624,0xcc));var _0x4c62=function(_0x4bfd05,_0x207fc9){_0x4bfd05=_0x4bfd05-0x0;var _0x3efdde=_0xc624[_0x4bfd05];return _0x3efdde;};'use strict';var _=require(_0x4c62('0x0'));var util=require('util');var logger=require(_0x4c62('0x1'))(_0x4c62('0x2'));var moment=require(_0x4c62('0x3'));var BPromise=require(_0x4c62('0x4'));var rp=require(_0x4c62('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c62('0x6'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x458548,_0x467fc0){return _0x458548[_0x4c62('0x7')](_0x4c62('0x8'),attributes,{'tableName':_0x4c62('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 82d9d1f..1b042ab 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 _0xbba2=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','find','options','raw','where','attributes','map','model','include','ShowSquareOdbc','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xbba2,0x1e4));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2bba('0x0'));var util=require(_0x2bba('0x1'));var moment=require('moment');var BPromise=require(_0x2bba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bba('0x3'))['db'];var utils=require(_0x2bba('0x4'));var logger=require(_0x2bba('0x5'))('rpc');var config=require(_0x2bba('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2bba('0x7')][_0x2bba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x415a5e,_0x96119a,_0x4044c8){return new BPromise(function(_0x36e58f,_0x485c8d){return client[_0x2bba('0x9')](_0x415a5e,_0x4044c8)[_0x2bba('0xa')](function(_0x373b3d){logger[_0x2bba('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x96119a,_0x2bba('0xc'));logger[_0x2bba('0xd')](_0x2bba('0xe'),_0x96119a,_0x2bba('0xc'),JSON[_0x2bba('0xf')](_0x373b3d));if(_0x373b3d[_0x2bba('0x10')]){if(_0x373b3d['error'][_0x2bba('0x11')]===0x1f4){logger[_0x2bba('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x96119a,_0x373b3d[_0x2bba('0x10')][_0x2bba('0x12')]);return _0x485c8d(_0x373b3d['error'][_0x2bba('0x12')]);}logger[_0x2bba('0x10')](_0x2bba('0x13'),_0x96119a,_0x373b3d[_0x2bba('0x10')]['message']);return _0x36e58f(_0x373b3d['error'][_0x2bba('0x12')]);}else{logger[_0x2bba('0xb')](_0x2bba('0x13'),_0x96119a,_0x2bba('0xc'));_0x36e58f(_0x373b3d[_0x2bba('0x14')][_0x2bba('0x12')]);}})[_0x2bba('0x15')](function(_0x547386){logger[_0x2bba('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x96119a,_0x547386);_0x485c8d(_0x547386);});});}exports['ShowSquareOdbc']=function(_0x47a6f5){var _0x43e17a=this;return new Promise(function(_0x391a9a,_0x51deda){return db['SquareOdbc'][_0x2bba('0x16')]({'raw':_0x47a6f5[_0x2bba('0x17')]?_0x47a6f5[_0x2bba('0x17')][_0x2bba('0x18')]===undefined?!![]:![]:!![],'where':_0x47a6f5['options']?_0x47a6f5[_0x2bba('0x17')][_0x2bba('0x19')]||null:null,'attributes':_0x47a6f5[_0x2bba('0x17')]?_0x47a6f5[_0x2bba('0x17')][_0x2bba('0x1a')]||null:null,'include':_0x47a6f5[_0x2bba('0x17')]?_0x47a6f5[_0x2bba('0x17')]['include']?_[_0x2bba('0x1b')](_0x47a6f5[_0x2bba('0x17')]['include'],function(_0x319c69){return{'model':db[_0x319c69[_0x2bba('0x1c')]],'as':_0x319c69['as'],'attributes':_0x319c69['attributes'],'include':_0x319c69[_0x2bba('0x1d')]?_[_0x2bba('0x1b')](_0x319c69[_0x2bba('0x1d')],function(_0x1f1d91){return{'model':db[_0x1f1d91['model']],'as':_0x1f1d91['as'],'attributes':_0x1f1d91[_0x2bba('0x1a')],'include':_0x1f1d91['include']?_[_0x2bba('0x1b')](_0x1f1d91[_0x2bba('0x1d')],function(_0x1cdafc){return{'model':db[_0x1cdafc[_0x2bba('0x1c')]],'as':_0x1cdafc['as'],'attributes':_0x1cdafc[_0x2bba('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x170df6){logger[_0x2bba('0xb')](_0x2bba('0x1e'),_0x47a6f5);logger['debug']('ShowSquareOdbc',_0x47a6f5,JSON['stringify'](_0x170df6));_0x391a9a(_0x170df6);})[_0x2bba('0x15')](function(_0x5192da){logger['error'](_0x2bba('0x1e'),_0x5192da[_0x2bba('0x12')],_0x47a6f5);_0x51deda(_0x43e17a[_0x2bba('0x10')](0x1f4,_0x5192da[_0x2bba('0x12')]));});});}; \ No newline at end of file +var _0x4754=['where','attributes','include','map','model','ShowSquareOdbc','stringify','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','message','result','find','options'];(function(_0x4cd149,_0x5a8680){var _0x4dcb9f=function(_0x3b66d8){while(--_0x3b66d8){_0x4cd149['push'](_0x4cd149['shift']());}};_0x4dcb9f(++_0x5a8680);}(_0x4754,0xb0));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4475('0x0'));var util=require(_0x4475('0x1'));var moment=require(_0x4475('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4475('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4475('0x4'));var logger=require(_0x4475('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4475('0x6'));var client=jayson[_0x4475('0x7')][_0x4475('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c6395,_0x39bbbe,_0x3242e2){return new BPromise(function(_0xe5d8b2,_0x23b375){return client[_0x4475('0x9')](_0x5c6395,_0x3242e2)[_0x4475('0xa')](function(_0x4eedff){logger[_0x4475('0xb')](_0x4475('0xc'),_0x39bbbe,_0x4475('0xd'));logger[_0x4475('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x39bbbe,_0x4475('0xd'),JSON['stringify'](_0x4eedff));if(_0x4eedff[_0x4475('0xf')]){if(_0x4eedff[_0x4475('0xf')]['code']===0x1f4){logger[_0x4475('0xf')](_0x4475('0xc'),_0x39bbbe,_0x4eedff['error'][_0x4475('0x10')]);return _0x23b375(_0x4eedff[_0x4475('0xf')][_0x4475('0x10')]);}logger[_0x4475('0xf')](_0x4475('0xc'),_0x39bbbe,_0x4eedff[_0x4475('0xf')][_0x4475('0x10')]);return _0xe5d8b2(_0x4eedff[_0x4475('0xf')]['message']);}else{logger['info'](_0x4475('0xc'),_0x39bbbe,_0x4475('0xd'));_0xe5d8b2(_0x4eedff[_0x4475('0x11')][_0x4475('0x10')]);}})['catch'](function(_0x3c07f7){logger[_0x4475('0xf')](_0x4475('0xc'),_0x39bbbe,_0x3c07f7);_0x23b375(_0x3c07f7);});});}exports['ShowSquareOdbc']=function(_0x3b5c75){var _0x30b9d6=this;return new Promise(function(_0x4ea19c,_0x55fc66){return db['SquareOdbc'][_0x4475('0x12')]({'raw':_0x3b5c75[_0x4475('0x13')]?_0x3b5c75[_0x4475('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3b5c75[_0x4475('0x13')]?_0x3b5c75[_0x4475('0x13')][_0x4475('0x14')]||null:null,'attributes':_0x3b5c75['options']?_0x3b5c75['options'][_0x4475('0x15')]||null:null,'include':_0x3b5c75[_0x4475('0x13')]?_0x3b5c75[_0x4475('0x13')][_0x4475('0x16')]?_[_0x4475('0x17')](_0x3b5c75['options'][_0x4475('0x16')],function(_0x50098d){return{'model':db[_0x50098d[_0x4475('0x18')]],'as':_0x50098d['as'],'attributes':_0x50098d[_0x4475('0x15')],'include':_0x50098d['include']?_['map'](_0x50098d['include'],function(_0x22b91f){return{'model':db[_0x22b91f[_0x4475('0x18')]],'as':_0x22b91f['as'],'attributes':_0x22b91f['attributes'],'include':_0x22b91f[_0x4475('0x16')]?_[_0x4475('0x17')](_0x22b91f[_0x4475('0x16')],function(_0x74ce82){return{'model':db[_0x74ce82[_0x4475('0x18')]],'as':_0x74ce82['as'],'attributes':_0x74ce82['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x77509c){logger[_0x4475('0xb')](_0x4475('0x19'),_0x3b5c75);logger[_0x4475('0xe')](_0x4475('0x19'),_0x3b5c75,JSON[_0x4475('0x1a')](_0x77509c));_0x4ea19c(_0x77509c);})[_0x4475('0x1b')](function(_0x37cb1f){logger[_0x4475('0xf')](_0x4475('0x19'),_0x37cb1f[_0x4475('0x10')],_0x3b5c75);_0x55fc66(_0x30b9d6[_0x4475('0xf')](0x1f4,_0x37cb1f[_0x4475('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 88716de..5f9f112 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 _0x7880=['../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','create','post','put','update','delete','removeUsers','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x23a7aa,_0x51647e){var _0x5a6172=function(_0x21b1d9){while(--_0x21b1d9){_0x23a7aa['push'](_0x23a7aa['shift']());}};_0x5a6172(++_0x51647e);}(_0x7880,0x1f4));var _0x0788=function(_0x2b84c8,_0x183d8e){_0x2b84c8=_0x2b84c8-0x0;var _0x5cea29=_0x7880[_0x2b84c8];return _0x5cea29;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['addUsers']);router[_0x0788('0x12')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);router[_0x0788('0x14')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller['destroy']);router[_0x0788('0x14')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc5df=['delete','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','post','addUsers','update'];(function(_0x2a22eb,_0x3da482){var _0x427fec=function(_0x30fe08){while(--_0x30fe08){_0x2a22eb['push'](_0x2a22eb['shift']());}};_0x427fec(++_0x3da482);}(_0xc5df,0x80));var _0xfc5d=function(_0x1128a6,_0x5ad2f8){_0x1128a6=_0x1128a6-0x0;var _0x2c0812=_0xc5df[_0x1128a6];return _0x2c0812;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfc5d('0x0'));var timeout=require(_0xfc5d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfc5d('0x2'));var auth=require(_0xfc5d('0x3'));var interaction=require(_0xfc5d('0x4'));var config=require(_0xfc5d('0x5'));var controller=require(_0xfc5d('0x6'));router['get']('/',auth[_0xfc5d('0x7')](),controller[_0xfc5d('0x8')]);router[_0xfc5d('0x9')](_0xfc5d('0xa'),auth[_0xfc5d('0x7')](),controller[_0xfc5d('0xb')]);router['get'](_0xfc5d('0xc'),auth[_0xfc5d('0x7')](),controller['getUsers']);router[_0xfc5d('0xd')]('/',auth[_0xfc5d('0x7')](),controller['create']);router[_0xfc5d('0xd')](_0xfc5d('0xc'),auth[_0xfc5d('0x7')](),controller[_0xfc5d('0xe')]);router['put'](_0xfc5d('0xa'),auth[_0xfc5d('0x7')](),controller[_0xfc5d('0xf')]);router['delete'](_0xfc5d('0xa'),auth[_0xfc5d('0x7')](),controller['destroy']);router[_0xfc5d('0x10')]('/:id/users',auth[_0xfc5d('0x7')](),controller['removeUsers']);module[_0xfc5d('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 c745f55..0138d04 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 _0x2c70=['getDataValue','preproduction','toString','utf8','BLOB','long','production','DATE','sequelize','STRING','TEXT'];(function(_0xff4b91,_0x4ee6bf){var _0x4268f8=function(_0x1e9563){while(--_0x1e9563){_0xff4b91['push'](_0xff4b91['shift']());}};_0x4268f8(++_0x4ee6bf);}(_0x2c70,0x19f));var _0x02c7=function(_0x5293a1,_0x351c64){_0x5293a1=_0x5293a1-0x0;var _0x5085aa=_0x2c70[_0x5293a1];return _0x5085aa;};'use strict';var Sequelize=require(_0x02c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x02c7('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x02c7('0x2')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x02c7('0x3')](_0x02c7('0x4'))){return this['getDataValue'](_0x02c7('0x4'))[_0x02c7('0x5')](_0x02c7('0x6'));}}},'production':{'type':Sequelize[_0x02c7('0x7')](_0x02c7('0x8')),'get':function(){if(this[_0x02c7('0x3')](_0x02c7('0x9'))){return this['getDataValue'](_0x02c7('0x9'))['toString'](_0x02c7('0x6'));}}},'savedAt':{'type':Sequelize[_0x02c7('0xa')]},'publishedAt':{'type':Sequelize[_0x02c7('0xa')]}}; \ No newline at end of file +var _0x0f82=['exports','name','STRING','TEXT','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x4de003,_0x1677e9){var _0x2875b9=function(_0x686fda){while(--_0x686fda){_0x4de003['push'](_0x4de003['shift']());}};_0x2875b9(++_0x1677e9);}(_0x0f82,0x155));var _0x20f8=function(_0x24eab8,_0x2f471c){_0x24eab8=_0x24eab8-0x0;var _0x41d883=_0x0f82[_0x24eab8];return _0x41d883;};'use strict';var Sequelize=require('sequelize');module[_0x20f8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x20f8('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x20f8('0x2')]},'notes':{'type':Sequelize[_0x20f8('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x20f8('0x4')),'get':function(){if(this[_0x20f8('0x5')](_0x20f8('0x6'))){return this[_0x20f8('0x5')](_0x20f8('0x6'))[_0x20f8('0x7')](_0x20f8('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x20f8('0x5')](_0x20f8('0x9'))){return this[_0x20f8('0x5')](_0x20f8('0x9'))[_0x20f8('0x7')](_0x20f8('0x8'));}}},'savedAt':{'type':Sequelize[_0x20f8('0xa')]},'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 14b2eb8..8ada5f8 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 _0xc48f=['set','json','reject','save','update','destroy','SquareProjects','UserProfileResource','then','error','name','index','map','SquareProject','fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','omit','ids','removeUsers','length','emit','userSquareProject:remove','getUsers','findOne','User','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x45b36c,_0x4efbfe){var _0x1dad2f=function(_0x1532af){while(--_0x1532af){_0x45b36c['push'](_0x45b36c['shift']());}};_0x1dad2f(++_0x4efbfe);}(_0xc48f,0x1bb));var _0xfc48=function(_0x515d8d,_0x5a7b53){_0x515d8d=_0x515d8d-0x0;var _0x296990=_0xc48f[_0x515d8d];return _0x296990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc48('0x0'));var zipdir=require(_0xfc48('0x1'));var jsonpatch=require(_0xfc48('0x2'));var rp=require(_0xfc48('0x3'));var moment=require(_0xfc48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc48('0x5'));var util=require('util');var path=require(_0xfc48('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc48('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc48('0x8'));var squel=require(_0xfc48('0x9'));var crypto=require('crypto');var jsforce=require(_0xfc48('0xa'));var deskjs=require(_0xfc48('0xb'));var toCsv=require(_0xfc48('0xc'));var querystring=require(_0xfc48('0xd'));var Papa=require('papaparse');var Redis=require(_0xfc48('0xe'));var authService=require(_0xfc48('0xf'));var qs=require(_0xfc48('0x10'));var as=require(_0xfc48('0x11'));var hardwareService=require(_0xfc48('0x12'));var logger=require(_0xfc48('0x13'))(_0xfc48('0x14'));var utils=require(_0xfc48('0x15'));var config=require(_0xfc48('0x16'));var licenseUtil=require(_0xfc48('0x17'));var db=require(_0xfc48('0x18'))['db'];config[_0xfc48('0x19')]=_[_0xfc48('0x1a')](config[_0xfc48('0x19')],{'host':_0xfc48('0x1b'),'port':0x18eb});var socket=require(_0xfc48('0x1c'))(new Redis(config[_0xfc48('0x19')]));require('./squareProject.socket')[_0xfc48('0x1d')](socket);function respondWithStatusCode(_0x489316,_0x30f41a){_0x30f41a=_0x30f41a||0xcc;return function(_0x13cea4){if(_0x13cea4){return _0x489316[_0xfc48('0x1e')](_0x30f41a);}return _0x489316[_0xfc48('0x1f')](_0x30f41a)[_0xfc48('0x20')]();};}function respondWithResult(_0x42fdf4,_0x1ba618){_0x1ba618=_0x1ba618||0xc8;return function(_0x17e94f){if(_0x17e94f){return _0x42fdf4[_0xfc48('0x1f')](_0x1ba618)['json'](_0x17e94f);}};}function respondWithFilteredResult(_0x14db06,_0x455f85){return function(_0x1f70b3){if(_0x1f70b3){var _0x5c3121=typeof _0x455f85[_0xfc48('0x21')]===_0xfc48('0x22')&&typeof _0x455f85[_0xfc48('0x23')]===_0xfc48('0x22');var _0x4f3420=_0x1f70b3[_0xfc48('0x24')];var _0x30324c=_0x5c3121?0x0:_0x455f85[_0xfc48('0x21')];var _0xd75073=_0x5c3121?_0x1f70b3[_0xfc48('0x24')]:_0x455f85[_0xfc48('0x21')]+_0x455f85['limit'];var _0x226bab;if(_0xd75073>=_0x4f3420){_0xd75073=_0x4f3420;_0x226bab=0xc8;}else{_0x226bab=0xce;}_0x14db06[_0xfc48('0x1f')](_0x226bab);return _0x14db06[_0xfc48('0x25')]('Content-Range',_0x30324c+'-'+_0xd75073+'/'+_0x4f3420)[_0xfc48('0x26')](_0x1f70b3);}return null;};}function patchUpdates(_0x8ed009){return function(_0x5cd9af){try{jsonpatch['apply'](_0x5cd9af,_0x8ed009,!![]);}catch(_0x2d3415){return BPromise[_0xfc48('0x27')](_0x2d3415);}return _0x5cd9af[_0xfc48('0x28')]();};}function saveUpdates(_0x22bad6,_0x1ce2ca){return function(_0x49b620){if(_0x49b620){return _0x49b620[_0xfc48('0x29')](_0x22bad6)['then'](function(_0x43128d){return _0x43128d;});}return null;};}function removeEntity(_0x17b114,_0x57d987){return function(_0x559894){if(_0x559894){return _0x559894[_0xfc48('0x2a')]()['then'](function(){var _0x4444be=_0x559894['get']({'plain':!![]});var _0x3f187a=_0xfc48('0x2b');return db[_0xfc48('0x2c')][_0xfc48('0x2a')]({'where':{'type':_0x3f187a,'resourceId':_0x4444be['id']}})[_0xfc48('0x2d')](function(){return _0x559894;});})[_0xfc48('0x2d')](function(){_0x17b114[_0xfc48('0x1f')](0xcc)[_0xfc48('0x20')]();});}};}function handleEntityNotFound(_0x3823fb,_0x3dd196){return function(_0x4a2aa2){if(!_0x4a2aa2){_0x3823fb[_0xfc48('0x1e')](0x194);}return _0x4a2aa2;};}function handleError(_0x3c1fb1,_0xc30f9c){_0xc30f9c=_0xc30f9c||0x1f4;return function(_0x684a31){logger[_0xfc48('0x2e')](_0x684a31['stack']);if(_0x684a31[_0xfc48('0x2f')]){delete _0x684a31[_0xfc48('0x2f')];}_0x3c1fb1['status'](_0xc30f9c)['send'](_0x684a31);};}exports[_0xfc48('0x30')]=function(_0x448b86,_0x1c9046){var _0x123417={},_0x2ac764={},_0x11041a={'count':0x0,'rows':[]};var _0x32b30a=_[_0xfc48('0x31')](db[_0xfc48('0x32')]['rawAttributes'],function(_0x4bc7ac){return{'name':_0x4bc7ac[_0xfc48('0x33')],'type':_0x4bc7ac['type']['key']};});_0x2ac764['model']=_['map'](_0x32b30a,'name');_0x2ac764['query']=_['keys'](_0x448b86[_0xfc48('0x34')]);_0x2ac764[_0xfc48('0x35')]=_[_0xfc48('0x36')](_0x2ac764[_0xfc48('0x37')],_0x2ac764['query']);_0x123417[_0xfc48('0x38')]=_[_0xfc48('0x36')](_0x2ac764[_0xfc48('0x37')],qs[_0xfc48('0x39')](_0x448b86[_0xfc48('0x34')][_0xfc48('0x39')]));_0x123417[_0xfc48('0x38')]=_0x123417[_0xfc48('0x38')]['length']?_0x123417['attributes']:_0x2ac764[_0xfc48('0x37')];if(!_0x448b86[_0xfc48('0x34')][_0xfc48('0x3a')](_0xfc48('0x3b'))){_0x123417[_0xfc48('0x23')]=qs['limit'](_0x448b86['query'][_0xfc48('0x23')]);_0x123417[_0xfc48('0x21')]=qs['offset'](_0x448b86[_0xfc48('0x34')]['offset']);}_0x123417['order']=qs[_0xfc48('0x3c')](_0x448b86[_0xfc48('0x34')]['sort']);_0x123417[_0xfc48('0x3d')]=qs[_0xfc48('0x35')](_[_0xfc48('0x3e')](_0x448b86[_0xfc48('0x34')],_0x2ac764[_0xfc48('0x35')]),_0x32b30a);if(_0x448b86[_0xfc48('0x34')][_0xfc48('0x3f')]){_0x123417[_0xfc48('0x3d')]=_[_0xfc48('0x40')](_0x123417[_0xfc48('0x3d')],{'$or':_[_0xfc48('0x31')](_0x32b30a,function(_0x11e5d9){if(_0x11e5d9[_0xfc48('0x41')]!=='VIRTUAL'){var _0xe4fdac={};_0xe4fdac[_0x11e5d9[_0xfc48('0x2f')]]={'$like':'%'+_0x448b86[_0xfc48('0x34')][_0xfc48('0x3f')]+'%'};return _0xe4fdac;}})});}_0x123417=_[_0xfc48('0x40')]({},_0x123417,_0x448b86[_0xfc48('0x42')]);var _0x2b2e58={'where':_0x123417[_0xfc48('0x3d')]};return db[_0xfc48('0x32')]['count'](_0x2b2e58)[_0xfc48('0x2d')](function(_0x376e0d){_0x11041a[_0xfc48('0x24')]=_0x376e0d;if(_0x448b86[_0xfc48('0x34')][_0xfc48('0x43')]){_0x123417[_0xfc48('0x44')]=[{'all':!![]}];}return db[_0xfc48('0x32')][_0xfc48('0x45')](_0x123417);})[_0xfc48('0x2d')](function(_0x202b84){_0x11041a[_0xfc48('0x46')]=_0x202b84;return _0x11041a;})[_0xfc48('0x2d')](respondWithFilteredResult(_0x1c9046,_0x123417))[_0xfc48('0x47')](handleError(_0x1c9046,null));};exports[_0xfc48('0x48')]=function(_0x8f3d88,_0x1df825){var _0x80efd8={'raw':![],'where':{'id':_0x8f3d88[_0xfc48('0x49')]['id']}},_0x1167fe={};_0x1167fe[_0xfc48('0x37')]=_[_0xfc48('0x4a')](db['SquareProject'][_0xfc48('0x4b')]);_0x1167fe[_0xfc48('0x34')]=_[_0xfc48('0x4a')](_0x8f3d88[_0xfc48('0x34')]);_0x1167fe[_0xfc48('0x35')]=_[_0xfc48('0x36')](_0x1167fe[_0xfc48('0x37')],_0x1167fe['query']);_0x80efd8[_0xfc48('0x38')]=_[_0xfc48('0x36')](_0x1167fe[_0xfc48('0x37')],qs['fields'](_0x8f3d88[_0xfc48('0x34')]['fields']));_0x80efd8[_0xfc48('0x38')]=_0x80efd8[_0xfc48('0x38')]['length']?_0x80efd8[_0xfc48('0x38')]:_0x1167fe[_0xfc48('0x37')];if(_0x8f3d88['query']['includeAll']){_0x80efd8[_0xfc48('0x44')]=[{'all':!![]}];}_0x80efd8=_['merge']({},_0x80efd8,_0x8f3d88[_0xfc48('0x42')]);return db['SquareProject']['find'](_0x80efd8)[_0xfc48('0x2d')](handleEntityNotFound(_0x1df825,null))[_0xfc48('0x2d')](respondWithResult(_0x1df825,null))[_0xfc48('0x47')](handleError(_0x1df825,null));};exports[_0xfc48('0x4c')]=function(_0x57ce91,_0x43f6fe){return db[_0xfc48('0x32')][_0xfc48('0x4c')](_0x57ce91['body'],{})['then'](function(_0x24d0e7){var _0x3376ec=_0x57ce91[_0xfc48('0x4d')]['get']({'plain':!![]});if(!_0x3376ec)throw new Error(_0xfc48('0x4e'));if(_0x3376ec[_0xfc48('0x4f')]===_0xfc48('0x4d')){var _0x444811=_0x24d0e7[_0xfc48('0x50')]({'plain':!![]});var _0x51a5ae=_0xfc48('0x2b');return db[_0xfc48('0x51')][_0xfc48('0x52')]({'where':{'name':_0x51a5ae,'userProfileId':_0x3376ec['userProfileId']},'raw':!![]})[_0xfc48('0x2d')](function(_0x271808){if(_0x271808&&_0x271808['autoAssociation']===0x0){return db[_0xfc48('0x2c')][_0xfc48('0x4c')]({'name':_0x444811[_0xfc48('0x2f')],'resourceId':_0x444811['id'],'type':_0x271808[_0xfc48('0x2f')],'sectionId':_0x271808['id']},{})[_0xfc48('0x2d')](function(){return _0x24d0e7;});}else{return _0x24d0e7;}})[_0xfc48('0x47')](function(_0x456d2f){logger['error'](_0xfc48('0x53'),_0x456d2f);throw _0x456d2f;});}return _0x24d0e7;})[_0xfc48('0x2d')](respondWithResult(_0x43f6fe,0xc9))[_0xfc48('0x47')](handleError(_0x43f6fe,null));};exports[_0xfc48('0x29')]=function(_0x50fb1f,_0x454625){if(_0x50fb1f[_0xfc48('0x54')]['id']){delete _0x50fb1f[_0xfc48('0x54')]['id'];}return db[_0xfc48('0x32')]['find']({'where':{'id':_0x50fb1f['params']['id']}})[_0xfc48('0x2d')](handleEntityNotFound(_0x454625,null))['then'](saveUpdates(_0x50fb1f[_0xfc48('0x54')],null))[_0xfc48('0x2d')](respondWithResult(_0x454625,null))[_0xfc48('0x47')](handleError(_0x454625,null));};exports['destroy']=function(_0x2b5ead,_0x5e64ee){return db[_0xfc48('0x32')][_0xfc48('0x52')]({'where':{'id':_0x2b5ead[_0xfc48('0x49')]['id']}})[_0xfc48('0x2d')](handleEntityNotFound(_0x5e64ee,null))[_0xfc48('0x2d')](removeEntity(_0x5e64ee,null))[_0xfc48('0x47')](handleError(_0x5e64ee,null));};exports[_0xfc48('0x55')]=function(_0xb0af6,_0x4f13ab,_0xfce586){return db[_0xfc48('0x32')]['find']({'where':{'id':_0xb0af6['params']['id']}})[_0xfc48('0x2d')](handleEntityNotFound(_0x4f13ab,null))[_0xfc48('0x2d')](function(_0x125ed7){if(_0x125ed7){return _0x125ed7[_0xfc48('0x55')](_0xb0af6[_0xfc48('0x54')]['ids'],_[_0xfc48('0x56')](_0xb0af6[_0xfc48('0x54')],[_0xfc48('0x57'),'id'])||{});}})['then'](respondWithResult(_0x4f13ab,null))[_0xfc48('0x47')](handleError(_0x4f13ab,null));};exports['removeUsers']=function(_0x133d15,_0x486ac2,_0x163083){return db[_0xfc48('0x32')][_0xfc48('0x52')]({'where':{'id':_0x133d15[_0xfc48('0x49')]['id']}})[_0xfc48('0x2d')](handleEntityNotFound(_0x486ac2,null))['then'](function(_0x539c59){if(_0x539c59){return _0x539c59[_0xfc48('0x58')](_0x133d15[_0xfc48('0x34')][_0xfc48('0x57')])[_0xfc48('0x2d')](function(){if(_['isArray'](_0x133d15[_0xfc48('0x34')][_0xfc48('0x57')])){for(var _0x490ce4=0x0;_0x490ce4<_0x133d15[_0xfc48('0x34')][_0xfc48('0x57')][_0xfc48('0x59')];_0x490ce4+=0x1){socket[_0xfc48('0x5a')](_0xfc48('0x5b'),{'UserId':Number(_0x133d15[_0xfc48('0x34')]['ids'][_0x490ce4]),'SquareProjectId':Number(_0x133d15[_0xfc48('0x49')]['id'])});}}else{socket['emit'](_0xfc48('0x5b'),{'UserId':Number(_0x133d15[_0xfc48('0x34')][_0xfc48('0x57')]),'SquareProjectId':Number(_0x133d15[_0xfc48('0x49')]['id'])});}});}})[_0xfc48('0x2d')](respondWithStatusCode(_0x486ac2,null))[_0xfc48('0x47')](handleError(_0x486ac2,null));};exports[_0xfc48('0x5c')]=function(_0x4e6047,_0x578ce9,_0x34cb7a){var _0x11baa5={};var _0x847cb0={};var _0x145b06;var _0x580c8b;return db['SquareProject'][_0xfc48('0x5d')]({'where':{'id':_0x4e6047['params']['id']}})[_0xfc48('0x2d')](handleEntityNotFound(_0x578ce9,null))[_0xfc48('0x2d')](function(_0x4dc330){if(_0x4dc330){_0x145b06=_0x4dc330;_0x847cb0['model']=_[_0xfc48('0x4a')](db[_0xfc48('0x5e')][_0xfc48('0x4b')]);_0x847cb0[_0xfc48('0x34')]=_['keys'](_0x4e6047[_0xfc48('0x34')]);_0x847cb0[_0xfc48('0x35')]=_[_0xfc48('0x36')](_0x847cb0['model'],_0x847cb0[_0xfc48('0x34')]);_0x11baa5[_0xfc48('0x38')]=_[_0xfc48('0x36')](_0x847cb0[_0xfc48('0x37')],qs[_0xfc48('0x39')](_0x4e6047[_0xfc48('0x34')][_0xfc48('0x39')]));_0x11baa5['attributes']=_0x11baa5['attributes'][_0xfc48('0x59')]?_0x11baa5[_0xfc48('0x38')]:_0x847cb0[_0xfc48('0x37')];_0x11baa5[_0xfc48('0x5f')]=qs[_0xfc48('0x3c')](_0x4e6047['query'][_0xfc48('0x3c')]);_0x11baa5[_0xfc48('0x3d')]=qs[_0xfc48('0x35')](_[_0xfc48('0x3e')](_0x4e6047[_0xfc48('0x34')],_0x847cb0[_0xfc48('0x35')]));if(_0x4e6047[_0xfc48('0x34')]['filter']){_0x11baa5['where']=_['merge'](_0x11baa5[_0xfc48('0x3d')],{'$or':_[_0xfc48('0x31')](_0x11baa5[_0xfc48('0x38')],function(_0x2ed361){var _0x3f6690={};_0x3f6690[_0x2ed361]={'$like':'%'+_0x4e6047[_0xfc48('0x34')][_0xfc48('0x3f')]+'%'};return _0x3f6690;})});}_0x11baa5=_[_0xfc48('0x40')]({},_0x11baa5,_0x4e6047[_0xfc48('0x42')]);return _0x145b06[_0xfc48('0x5c')](_0x11baa5);}})[_0xfc48('0x2d')](function(_0x3417f6){if(_0x3417f6){_0x580c8b=_0x3417f6['length'];if(!_0x4e6047[_0xfc48('0x34')][_0xfc48('0x3a')](_0xfc48('0x3b'))){_0x11baa5[_0xfc48('0x23')]=qs[_0xfc48('0x23')](_0x4e6047[_0xfc48('0x34')][_0xfc48('0x23')]);_0x11baa5['offset']=qs[_0xfc48('0x21')](_0x4e6047[_0xfc48('0x34')][_0xfc48('0x21')]);}return _0x145b06[_0xfc48('0x5c')](_0x11baa5);}})['then'](function(_0x195206){if(_0x195206){return _0x195206?{'count':_0x580c8b,'rows':_0x195206}:null;}})[_0xfc48('0x2d')](respondWithResult(_0x578ce9,null))[_0xfc48('0x47')](handleError(_0x578ce9,null));}; \ No newline at end of file +var _0x0f98=['SquareProjects','UserProfileResource','error','stack','name','send','index','SquareProject','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addUsers','omit','removeUsers','isArray','ids','emit','userSquareProject:remove','getUsers','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then'];(function(_0x2fa776,_0x3a831c){var _0x2e5bb1=function(_0x499c2a){while(--_0x499c2a){_0x2fa776['push'](_0x2fa776['shift']());}};_0x2e5bb1(++_0x3a831c);}(_0x0f98,0x9d));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x80f9('0x0'));var rimraf=require(_0x80f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80f9('0x2'));var rp=require(_0x80f9('0x3'));var moment=require(_0x80f9('0x4'));var BPromise=require(_0x80f9('0x5'));var Mustache=require(_0x80f9('0x6'));var util=require(_0x80f9('0x7'));var path=require(_0x80f9('0x8'));var sox=require(_0x80f9('0x9'));var csv=require(_0x80f9('0xa'));var ejs=require(_0x80f9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x80f9('0xc'));var crypto=require(_0x80f9('0xd'));var jsforce=require(_0x80f9('0xe'));var deskjs=require(_0x80f9('0xf'));var toCsv=require(_0x80f9('0xa'));var querystring=require(_0x80f9('0x10'));var Papa=require('papaparse');var Redis=require(_0x80f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x80f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80f9('0x13'));var logger=require(_0x80f9('0x14'))('api');var utils=require(_0x80f9('0x15'));var config=require(_0x80f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x80f9('0x17'))['db'];config['redis']=_[_0x80f9('0x18')](config[_0x80f9('0x19')],{'host':_0x80f9('0x1a'),'port':0x18eb});var socket=require(_0x80f9('0x1b'))(new Redis(config[_0x80f9('0x19')]));require('./squareProject.socket')[_0x80f9('0x1c')](socket);function respondWithStatusCode(_0x2c39b6,_0x50f718){_0x50f718=_0x50f718||0xcc;return function(_0x582ce5){if(_0x582ce5){return _0x2c39b6[_0x80f9('0x1d')](_0x50f718);}return _0x2c39b6[_0x80f9('0x1e')](_0x50f718)[_0x80f9('0x1f')]();};}function respondWithResult(_0xa1e18,_0x5b05a5){_0x5b05a5=_0x5b05a5||0xc8;return function(_0x3303a4){if(_0x3303a4){return _0xa1e18[_0x80f9('0x1e')](_0x5b05a5)[_0x80f9('0x20')](_0x3303a4);}};}function respondWithFilteredResult(_0x1b565e,_0x36252e){return function(_0x1f63d8){if(_0x1f63d8){var _0x2187aa=typeof _0x36252e[_0x80f9('0x21')]===_0x80f9('0x22')&&typeof _0x36252e['limit']===_0x80f9('0x22');var _0x443599=_0x1f63d8['count'];var _0x142708=_0x2187aa?0x0:_0x36252e['offset'];var _0x3b72fd=_0x2187aa?_0x1f63d8[_0x80f9('0x23')]:_0x36252e[_0x80f9('0x21')]+_0x36252e[_0x80f9('0x24')];var _0x55e95b;if(_0x3b72fd>=_0x443599){_0x3b72fd=_0x443599;_0x55e95b=0xc8;}else{_0x55e95b=0xce;}_0x1b565e[_0x80f9('0x1e')](_0x55e95b);return _0x1b565e[_0x80f9('0x25')](_0x80f9('0x26'),_0x142708+'-'+_0x3b72fd+'/'+_0x443599)[_0x80f9('0x20')](_0x1f63d8);}return null;};}function patchUpdates(_0x424033){return function(_0x2d54cb){try{jsonpatch[_0x80f9('0x27')](_0x2d54cb,_0x424033,!![]);}catch(_0x1edf22){return BPromise[_0x80f9('0x28')](_0x1edf22);}return _0x2d54cb['save']();};}function saveUpdates(_0x28e5eb,_0x4be1f9){return function(_0xaf423){if(_0xaf423){return _0xaf423[_0x80f9('0x29')](_0x28e5eb)[_0x80f9('0x2a')](function(_0x1ff081){return _0x1ff081;});}return null;};}function removeEntity(_0x7565e9,_0x520ef0){return function(_0x84a49f){if(_0x84a49f){return _0x84a49f['destroy']()[_0x80f9('0x2a')](function(){var _0x3c0102=_0x84a49f['get']({'plain':!![]});var _0xaac947=_0x80f9('0x2b');return db[_0x80f9('0x2c')]['destroy']({'where':{'type':_0xaac947,'resourceId':_0x3c0102['id']}})['then'](function(){return _0x84a49f;});})[_0x80f9('0x2a')](function(){_0x7565e9['status'](0xcc)[_0x80f9('0x1f')]();});}};}function handleEntityNotFound(_0x7f4621,_0x114afb){return function(_0xfac5bd){if(!_0xfac5bd){_0x7f4621['sendStatus'](0x194);}return _0xfac5bd;};}function handleError(_0x77c03c,_0x53c3a0){_0x53c3a0=_0x53c3a0||0x1f4;return function(_0x25dc32){logger[_0x80f9('0x2d')](_0x25dc32[_0x80f9('0x2e')]);if(_0x25dc32[_0x80f9('0x2f')]){delete _0x25dc32[_0x80f9('0x2f')];}_0x77c03c['status'](_0x53c3a0)[_0x80f9('0x30')](_0x25dc32);};}exports[_0x80f9('0x31')]=function(_0x41adb1,_0x48ceaf){var _0x531ab4={},_0x45b2ac={},_0x731715={'count':0x0,'rows':[]};var _0x3fb9cd=_['map'](db[_0x80f9('0x32')]['rawAttributes'],function(_0x180367){return{'name':_0x180367[_0x80f9('0x33')],'type':_0x180367[_0x80f9('0x34')][_0x80f9('0x35')]};});_0x45b2ac[_0x80f9('0x36')]=_[_0x80f9('0x37')](_0x3fb9cd,'name');_0x45b2ac[_0x80f9('0x38')]=_['keys'](_0x41adb1[_0x80f9('0x38')]);_0x45b2ac[_0x80f9('0x39')]=_[_0x80f9('0x3a')](_0x45b2ac[_0x80f9('0x36')],_0x45b2ac['query']);_0x531ab4[_0x80f9('0x3b')]=_['intersection'](_0x45b2ac[_0x80f9('0x36')],qs[_0x80f9('0x3c')](_0x41adb1['query'][_0x80f9('0x3c')]));_0x531ab4['attributes']=_0x531ab4[_0x80f9('0x3b')]['length']?_0x531ab4['attributes']:_0x45b2ac['model'];if(!_0x41adb1[_0x80f9('0x38')][_0x80f9('0x3d')](_0x80f9('0x3e'))){_0x531ab4[_0x80f9('0x24')]=qs['limit'](_0x41adb1[_0x80f9('0x38')]['limit']);_0x531ab4[_0x80f9('0x21')]=qs[_0x80f9('0x21')](_0x41adb1[_0x80f9('0x38')][_0x80f9('0x21')]);}_0x531ab4[_0x80f9('0x3f')]=qs[_0x80f9('0x40')](_0x41adb1[_0x80f9('0x38')]['sort']);_0x531ab4[_0x80f9('0x41')]=qs[_0x80f9('0x39')](_[_0x80f9('0x42')](_0x41adb1[_0x80f9('0x38')],_0x45b2ac[_0x80f9('0x39')]),_0x3fb9cd);if(_0x41adb1[_0x80f9('0x38')][_0x80f9('0x43')]){_0x531ab4[_0x80f9('0x41')]=_[_0x80f9('0x44')](_0x531ab4[_0x80f9('0x41')],{'$or':_[_0x80f9('0x37')](_0x3fb9cd,function(_0x844176){if(_0x844176['type']!==_0x80f9('0x45')){var _0x35580a={};_0x35580a[_0x844176[_0x80f9('0x2f')]]={'$like':'%'+_0x41adb1[_0x80f9('0x38')][_0x80f9('0x43')]+'%'};return _0x35580a;}})});}_0x531ab4=_[_0x80f9('0x44')]({},_0x531ab4,_0x41adb1[_0x80f9('0x46')]);var _0x376212={'where':_0x531ab4[_0x80f9('0x41')]};return db['SquareProject'][_0x80f9('0x23')](_0x376212)[_0x80f9('0x2a')](function(_0x28a3c4){_0x731715['count']=_0x28a3c4;if(_0x41adb1[_0x80f9('0x38')][_0x80f9('0x47')]){_0x531ab4[_0x80f9('0x48')]=[{'all':!![]}];}return db[_0x80f9('0x32')][_0x80f9('0x49')](_0x531ab4);})['then'](function(_0x221e26){_0x731715['rows']=_0x221e26;return _0x731715;})[_0x80f9('0x2a')](respondWithFilteredResult(_0x48ceaf,_0x531ab4))[_0x80f9('0x4a')](handleError(_0x48ceaf,null));};exports[_0x80f9('0x4b')]=function(_0x4adbe2,_0xa15aca){var _0x14c405={'raw':![],'where':{'id':_0x4adbe2[_0x80f9('0x4c')]['id']}},_0x113ac5={};_0x113ac5['model']=_[_0x80f9('0x4d')](db[_0x80f9('0x32')][_0x80f9('0x4e')]);_0x113ac5[_0x80f9('0x38')]=_['keys'](_0x4adbe2[_0x80f9('0x38')]);_0x113ac5[_0x80f9('0x39')]=_['intersection'](_0x113ac5['model'],_0x113ac5[_0x80f9('0x38')]);_0x14c405['attributes']=_[_0x80f9('0x3a')](_0x113ac5[_0x80f9('0x36')],qs[_0x80f9('0x3c')](_0x4adbe2[_0x80f9('0x38')][_0x80f9('0x3c')]));_0x14c405[_0x80f9('0x3b')]=_0x14c405[_0x80f9('0x3b')][_0x80f9('0x4f')]?_0x14c405[_0x80f9('0x3b')]:_0x113ac5[_0x80f9('0x36')];if(_0x4adbe2[_0x80f9('0x38')]['includeAll']){_0x14c405[_0x80f9('0x48')]=[{'all':!![]}];}_0x14c405=_[_0x80f9('0x44')]({},_0x14c405,_0x4adbe2[_0x80f9('0x46')]);return db[_0x80f9('0x32')][_0x80f9('0x50')](_0x14c405)[_0x80f9('0x2a')](handleEntityNotFound(_0xa15aca,null))[_0x80f9('0x2a')](respondWithResult(_0xa15aca,null))[_0x80f9('0x4a')](handleError(_0xa15aca,null));};exports[_0x80f9('0x51')]=function(_0x4ee15a,_0x16b446){return db[_0x80f9('0x32')][_0x80f9('0x51')](_0x4ee15a['body'],{})[_0x80f9('0x2a')](function(_0x4363fe){var _0x1c6c7a=_0x4ee15a[_0x80f9('0x52')][_0x80f9('0x53')]({'plain':!![]});if(!_0x1c6c7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c6c7a[_0x80f9('0x54')]==='user'){var _0x349fc4=_0x4363fe[_0x80f9('0x53')]({'plain':!![]});var _0x1a48a3=_0x80f9('0x2b');return db[_0x80f9('0x55')][_0x80f9('0x50')]({'where':{'name':_0x1a48a3,'userProfileId':_0x1c6c7a[_0x80f9('0x56')]},'raw':!![]})['then'](function(_0x509044){if(_0x509044&&_0x509044[_0x80f9('0x57')]===0x0){return db[_0x80f9('0x2c')][_0x80f9('0x51')]({'name':_0x349fc4[_0x80f9('0x2f')],'resourceId':_0x349fc4['id'],'type':_0x509044[_0x80f9('0x2f')],'sectionId':_0x509044['id']},{})[_0x80f9('0x2a')](function(){return _0x4363fe;});}else{return _0x4363fe;}})[_0x80f9('0x4a')](function(_0x507333){logger[_0x80f9('0x2d')](_0x80f9('0x58'),_0x507333);throw _0x507333;});}return _0x4363fe;})[_0x80f9('0x2a')](respondWithResult(_0x16b446,0xc9))[_0x80f9('0x4a')](handleError(_0x16b446,null));};exports[_0x80f9('0x29')]=function(_0x29f296,_0x1d55df){if(_0x29f296[_0x80f9('0x59')]['id']){delete _0x29f296['body']['id'];}return db['SquareProject'][_0x80f9('0x50')]({'where':{'id':_0x29f296[_0x80f9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d55df,null))[_0x80f9('0x2a')](saveUpdates(_0x29f296['body'],null))[_0x80f9('0x2a')](respondWithResult(_0x1d55df,null))[_0x80f9('0x4a')](handleError(_0x1d55df,null));};exports[_0x80f9('0x5a')]=function(_0x41e871,_0x3a1b7a){return db[_0x80f9('0x32')][_0x80f9('0x50')]({'where':{'id':_0x41e871[_0x80f9('0x4c')]['id']}})[_0x80f9('0x2a')](handleEntityNotFound(_0x3a1b7a,null))[_0x80f9('0x2a')](removeEntity(_0x3a1b7a,null))[_0x80f9('0x4a')](handleError(_0x3a1b7a,null));};exports[_0x80f9('0x5b')]=function(_0x43d9f6,_0x479fab,_0x647ec8){return db[_0x80f9('0x32')]['find']({'where':{'id':_0x43d9f6[_0x80f9('0x4c')]['id']}})[_0x80f9('0x2a')](handleEntityNotFound(_0x479fab,null))['then'](function(_0xd99cb){if(_0xd99cb){return _0xd99cb[_0x80f9('0x5b')](_0x43d9f6[_0x80f9('0x59')]['ids'],_[_0x80f9('0x5c')](_0x43d9f6[_0x80f9('0x59')],['ids','id'])||{});}})[_0x80f9('0x2a')](respondWithResult(_0x479fab,null))[_0x80f9('0x4a')](handleError(_0x479fab,null));};exports[_0x80f9('0x5d')]=function(_0x5da3a0,_0x32a0a9,_0x3aaa52){return db['SquareProject']['find']({'where':{'id':_0x5da3a0[_0x80f9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32a0a9,null))['then'](function(_0x125659){if(_0x125659){return _0x125659[_0x80f9('0x5d')](_0x5da3a0[_0x80f9('0x38')]['ids'])[_0x80f9('0x2a')](function(){if(_[_0x80f9('0x5e')](_0x5da3a0[_0x80f9('0x38')][_0x80f9('0x5f')])){for(var _0x23d134=0x0;_0x23d134<_0x5da3a0['query'][_0x80f9('0x5f')][_0x80f9('0x4f')];_0x23d134+=0x1){socket[_0x80f9('0x60')](_0x80f9('0x61'),{'UserId':Number(_0x5da3a0[_0x80f9('0x38')][_0x80f9('0x5f')][_0x23d134]),'SquareProjectId':Number(_0x5da3a0[_0x80f9('0x4c')]['id'])});}}else{socket[_0x80f9('0x60')](_0x80f9('0x61'),{'UserId':Number(_0x5da3a0[_0x80f9('0x38')][_0x80f9('0x5f')]),'SquareProjectId':Number(_0x5da3a0[_0x80f9('0x4c')]['id'])});}});}})[_0x80f9('0x2a')](respondWithStatusCode(_0x32a0a9,null))[_0x80f9('0x4a')](handleError(_0x32a0a9,null));};exports[_0x80f9('0x62')]=function(_0xb49fb7,_0x7075c0,_0x166f27){var _0x2f1b92={};var _0x7a1981={};var _0x436097;var _0x5da3c0;return db['SquareProject'][_0x80f9('0x63')]({'where':{'id':_0xb49fb7[_0x80f9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7075c0,null))[_0x80f9('0x2a')](function(_0x2a98e9){if(_0x2a98e9){_0x436097=_0x2a98e9;_0x7a1981['model']=_[_0x80f9('0x4d')](db['User'][_0x80f9('0x4e')]);_0x7a1981[_0x80f9('0x38')]=_[_0x80f9('0x4d')](_0xb49fb7[_0x80f9('0x38')]);_0x7a1981[_0x80f9('0x39')]=_[_0x80f9('0x3a')](_0x7a1981['model'],_0x7a1981[_0x80f9('0x38')]);_0x2f1b92[_0x80f9('0x3b')]=_[_0x80f9('0x3a')](_0x7a1981[_0x80f9('0x36')],qs[_0x80f9('0x3c')](_0xb49fb7['query'][_0x80f9('0x3c')]));_0x2f1b92[_0x80f9('0x3b')]=_0x2f1b92['attributes']['length']?_0x2f1b92[_0x80f9('0x3b')]:_0x7a1981[_0x80f9('0x36')];_0x2f1b92['order']=qs[_0x80f9('0x40')](_0xb49fb7[_0x80f9('0x38')][_0x80f9('0x40')]);_0x2f1b92[_0x80f9('0x41')]=qs['filters'](_[_0x80f9('0x42')](_0xb49fb7['query'],_0x7a1981[_0x80f9('0x39')]));if(_0xb49fb7[_0x80f9('0x38')][_0x80f9('0x43')]){_0x2f1b92[_0x80f9('0x41')]=_[_0x80f9('0x44')](_0x2f1b92[_0x80f9('0x41')],{'$or':_[_0x80f9('0x37')](_0x2f1b92['attributes'],function(_0x50a46f){var _0x2dfa22={};_0x2dfa22[_0x50a46f]={'$like':'%'+_0xb49fb7[_0x80f9('0x38')][_0x80f9('0x43')]+'%'};return _0x2dfa22;})});}_0x2f1b92=_[_0x80f9('0x44')]({},_0x2f1b92,_0xb49fb7['options']);return _0x436097[_0x80f9('0x62')](_0x2f1b92);}})[_0x80f9('0x2a')](function(_0x4dcd3b){if(_0x4dcd3b){_0x5da3c0=_0x4dcd3b['length'];if(!_0xb49fb7[_0x80f9('0x38')]['hasOwnProperty'](_0x80f9('0x3e'))){_0x2f1b92[_0x80f9('0x24')]=qs[_0x80f9('0x24')](_0xb49fb7['query']['limit']);_0x2f1b92[_0x80f9('0x21')]=qs['offset'](_0xb49fb7[_0x80f9('0x38')][_0x80f9('0x21')]);}return _0x436097['getUsers'](_0x2f1b92);}})[_0x80f9('0x2a')](function(_0xbc793a){if(_0xbc793a){return _0xbc793a?{'count':_0x5da3c0,'rows':_0xbc793a}:null;}})[_0x80f9('0x2a')](respondWithResult(_0x7075c0,null))[_0x80f9('0x4a')](handleError(_0x7075c0,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c8e866e..616d06f 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 _0x9ec4=['save','remove','emit','hasOwnProperty','events'];(function(_0x4ef268,_0x2c9891){var _0x42426a=function(_0x44c9b6){while(--_0x44c9b6){_0x4ef268['push'](_0x4ef268['shift']());}};_0x42426a(++_0x2c9891);}(_0x9ec4,0xe5));var _0x49ec=function(_0x1d4b6b,_0x388d04){_0x1d4b6b=_0x1d4b6b-0x0;var _0x2dad31=_0x9ec4[_0x1d4b6b];return _0x2dad31;};'use strict';var EventEmitter=require(_0x49ec('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x49ec('0x1'),'afterUpdate':'update','afterDestroy':_0x49ec('0x2')};function emitEvent(_0xe6aca4){return function(_0x5a4a19,_0x47a2a0,_0x3bce4e){SquareProjectEvents[_0x49ec('0x3')](_0xe6aca4+':'+_0x5a4a19['id'],_0x5a4a19);SquareProjectEvents[_0x49ec('0x3')](_0xe6aca4,_0x5a4a19);_0x3bce4e(null);};}for(var e in events){if(events[_0x49ec('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x3d19=['hasOwnProperty','hook','SquareProject','save','update','remove','emit'];(function(_0x4562be,_0x145ff2){var _0x216e44=function(_0x38c857){while(--_0x38c857){_0x4562be['push'](_0x4562be['shift']());}};_0x216e44(++_0x145ff2);}(_0x3d19,0x144));var _0x93d1=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3d19[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x93d1('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93d1('0x1'),'afterUpdate':_0x93d1('0x2'),'afterDestroy':_0x93d1('0x3')};function emitEvent(_0x35ebf6){return function(_0x496645,_0x43e4ec,_0x2bf704){SquareProjectEvents[_0x93d1('0x4')](_0x35ebf6+':'+_0x496645['id'],_0x496645);SquareProjectEvents[_0x93d1('0x4')](_0x35ebf6,_0x496645);_0x2bf704(null);};}for(var e in events){if(events[_0x93d1('0x5')](e)){var event=events[e];SquareProject[_0x93d1('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 1c70246..27d3945 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 _0xbf2c=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf2c,0x113));var _0xcbf2=function(_0x479f58,_0x42ff6e){_0x479f58=_0x479f58-0x0;var _0x1cb3a6=_0xbf2c[_0x479f58];return _0x1cb3a6;};'use strict';var _=require(_0xcbf2('0x0'));var util=require(_0xcbf2('0x1'));var logger=require(_0xcbf2('0x2'))(_0xcbf2('0x3'));var moment=require('moment');var BPromise=require(_0xcbf2('0x4'));var rp=require(_0xcbf2('0x5'));var fs=require('fs');var path=require(_0xcbf2('0x6'));var rimraf=require(_0xcbf2('0x7'));var config=require(_0xcbf2('0x8'));var attributes=require(_0xcbf2('0x9'));module[_0xcbf2('0xa')]=function(_0x3ad0e0,_0x36e60c){return _0x3ad0e0[_0xcbf2('0xb')]('SquareProject',attributes,{'tableName':_0xcbf2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cad6a,_0x57495e,_0x45a709){if(_0x2cad6a['changed'](_0xcbf2('0xd'))){_0x2cad6a[_0xcbf2('0xe')]=moment()['format'](_0xcbf2('0xf'));}if(_0x2cad6a[_0xcbf2('0x10')](_0xcbf2('0x11'))){_0x2cad6a[_0xcbf2('0x12')]=moment()[_0xcbf2('0x13')]('YYYY-MM-DD\x20HH:mm:ss');}_0x45a709(null,_0x2cad6a);}}});}; \ No newline at end of file +var _0xaecf=['rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5f5ba5,_0x59f514){var _0x3ab779=function(_0x272198){while(--_0x272198){_0x5f5ba5['push'](_0x5f5ba5['shift']());}};_0x3ab779(++_0x59f514);}(_0xaecf,0x162));var _0xfaec=function(_0x2a154e,_0x40b301){_0x2a154e=_0x2a154e-0x0;var _0x40bb08=_0xaecf[_0x2a154e];return _0x40bb08;};'use strict';var _=require('lodash');var util=require(_0xfaec('0x0'));var logger=require(_0xfaec('0x1'))(_0xfaec('0x2'));var moment=require(_0xfaec('0x3'));var BPromise=require(_0xfaec('0x4'));var rp=require(_0xfaec('0x5'));var fs=require('fs');var path=require(_0xfaec('0x6'));var rimraf=require(_0xfaec('0x7'));var config=require(_0xfaec('0x8'));var attributes=require('./squareProject.attributes');module[_0xfaec('0x9')]=function(_0x59d30a,_0x5b1415){return _0x59d30a[_0xfaec('0xa')](_0xfaec('0xb'),attributes,{'tableName':_0xfaec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x272696,_0x4041ff,_0x25b559){if(_0x272696[_0xfaec('0xd')](_0xfaec('0xe'))){_0x272696[_0xfaec('0xf')]=moment()[_0xfaec('0x10')](_0xfaec('0x11'));}if(_0x272696[_0xfaec('0xd')]('production')){_0x272696[_0xfaec('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x25b559(null,_0x272696);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index dac29dc..64e9b8e 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 _0x9f1a=['stringify','error','code','message','info','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','./squareProject.socket','register','request','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9f1a,0x122));var _0xa9f1=function(_0xb191f2,_0x450655){_0xb191f2=_0xb191f2-0x0;var _0x3e416e=_0x9f1a[_0xb191f2];return _0x3e416e;};'use strict';var _=require(_0xa9f1('0x0'));var util=require('util');var moment=require(_0xa9f1('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9f1('0x3'))['db'];var utils=require(_0xa9f1('0x4'));var logger=require(_0xa9f1('0x5'))(_0xa9f1('0x6'));var config=require(_0xa9f1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa9f1('0x8')]=_['defaults'](config[_0xa9f1('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9f1('0x8')]));require(_0xa9f1('0x9'))[_0xa9f1('0xa')](socket);function respondWithRpcPromise(_0x287db,_0x5f5173,_0x519804){return new BPromise(function(_0x302baa,_0xb47170){return client[_0xa9f1('0xb')](_0x287db,_0x519804)['then'](function(_0xec1a6d){logger['info'](_0xa9f1('0xc'),_0x5f5173,_0xa9f1('0xd'));logger[_0xa9f1('0xe')](_0xa9f1('0xf'),_0x5f5173,_0xa9f1('0xd'),JSON[_0xa9f1('0x10')](_0xec1a6d));if(_0xec1a6d[_0xa9f1('0x11')]){if(_0xec1a6d[_0xa9f1('0x11')][_0xa9f1('0x12')]===0x1f4){logger['error'](_0xa9f1('0xc'),_0x5f5173,_0xec1a6d[_0xa9f1('0x11')][_0xa9f1('0x13')]);return _0xb47170(_0xec1a6d['error']['message']);}logger[_0xa9f1('0x11')](_0xa9f1('0xc'),_0x5f5173,_0xec1a6d[_0xa9f1('0x11')][_0xa9f1('0x13')]);return _0x302baa(_0xec1a6d['error'][_0xa9f1('0x13')]);}else{logger[_0xa9f1('0x14')]('SquareProject,\x20%s,\x20%s',_0x5f5173,_0xa9f1('0xd'));_0x302baa(_0xec1a6d[_0xa9f1('0x15')]['message']);}})[_0xa9f1('0x16')](function(_0x1111ee){logger[_0xa9f1('0x11')]('SquareProject,\x20%s,\x20%s',_0x5f5173,_0x1111ee);_0xb47170(_0x1111ee);});});}exports[_0xa9f1('0x17')]=function(_0x2ee3ca){var _0x4517a6=this;return new Promise(function(_0x1b3cd3,_0x5250fc){return db[_0xa9f1('0x18')][_0xa9f1('0x19')]({'raw':_0x2ee3ca['options']?_0x2ee3ca[_0xa9f1('0x1a')][_0xa9f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ee3ca[_0xa9f1('0x1a')]?_0x2ee3ca[_0xa9f1('0x1a')][_0xa9f1('0x1c')]||null:null,'attributes':_0x2ee3ca[_0xa9f1('0x1a')]?_0x2ee3ca[_0xa9f1('0x1a')][_0xa9f1('0x1d')]||null:null,'include':_0x2ee3ca[_0xa9f1('0x1a')]?_0x2ee3ca[_0xa9f1('0x1a')][_0xa9f1('0x1e')]?_[_0xa9f1('0x1f')](_0x2ee3ca[_0xa9f1('0x1a')]['include'],function(_0x40c22c){return{'model':db[_0x40c22c[_0xa9f1('0x20')]],'as':_0x40c22c['as'],'attributes':_0x40c22c[_0xa9f1('0x1d')],'include':_0x40c22c[_0xa9f1('0x1e')]?_[_0xa9f1('0x1f')](_0x40c22c['include'],function(_0xc81607){return{'model':db[_0xc81607[_0xa9f1('0x20')]],'as':_0xc81607['as'],'attributes':_0xc81607[_0xa9f1('0x1d')],'include':_0xc81607[_0xa9f1('0x1e')]?_[_0xa9f1('0x1f')](_0xc81607[_0xa9f1('0x1e')],function(_0xc5a4c7){return{'model':db[_0xc5a4c7[_0xa9f1('0x20')]],'as':_0xc5a4c7['as'],'attributes':_0xc5a4c7['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9f1('0x21')](function(_0x1b75cb){logger[_0xa9f1('0x14')](_0xa9f1('0x17'),_0x2ee3ca);logger[_0xa9f1('0xe')](_0xa9f1('0x17'),_0x2ee3ca,JSON['stringify'](_0x1b75cb));_0x1b3cd3(_0x1b75cb);})[_0xa9f1('0x16')](function(_0x325678){logger[_0xa9f1('0x11')](_0xa9f1('0x17'),_0x325678['message'],_0x2ee3ca);_0x5250fc(_0x4517a6['error'](0x1f4,_0x325678['message']));});});}; \ No newline at end of file +var _0x93bb=['map','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareProject','options','where','attributes','include'];(function(_0x25912d,_0x5822e1){var _0x16b383=function(_0x40aa4b){while(--_0x40aa4b){_0x25912d['push'](_0x25912d['shift']());}};_0x16b383(++_0x5822e1);}(_0x93bb,0x135));var _0xb93b=function(_0x3a5af5,_0x43e639){_0x3a5af5=_0x3a5af5-0x0;var _0x2abb11=_0x93bb[_0x3a5af5];return _0x2abb11;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var rs=require(_0xb93b('0x4'));var fs=require('fs');var Redis=require(_0xb93b('0x5'));var db=require(_0xb93b('0x6'))['db'];var utils=require(_0xb93b('0x7'));var logger=require(_0xb93b('0x8'))(_0xb93b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb93b('0xa'));var client=jayson[_0xb93b('0xb')]['http']({'port':0x232a});config[_0xb93b('0xc')]=_[_0xb93b('0xd')](config['redis'],{'host':_0xb93b('0xe'),'port':0x18eb});var socket=require(_0xb93b('0xf'))(new Redis(config[_0xb93b('0xc')]));require(_0xb93b('0x10'))[_0xb93b('0x11')](socket);function respondWithRpcPromise(_0x5a5ad6,_0x920671,_0xf4d838){return new BPromise(function(_0x22a3d6,_0x434b6a){return client[_0xb93b('0x12')](_0x5a5ad6,_0xf4d838)['then'](function(_0x6090e5){logger[_0xb93b('0x13')](_0xb93b('0x14'),_0x920671,_0xb93b('0x15'));logger['debug'](_0xb93b('0x16'),_0x920671,_0xb93b('0x15'),JSON[_0xb93b('0x17')](_0x6090e5));if(_0x6090e5[_0xb93b('0x18')]){if(_0x6090e5[_0xb93b('0x18')][_0xb93b('0x19')]===0x1f4){logger[_0xb93b('0x18')]('SquareProject,\x20%s,\x20%s',_0x920671,_0x6090e5[_0xb93b('0x18')][_0xb93b('0x1a')]);return _0x434b6a(_0x6090e5[_0xb93b('0x18')][_0xb93b('0x1a')]);}logger[_0xb93b('0x18')](_0xb93b('0x14'),_0x920671,_0x6090e5['error'][_0xb93b('0x1a')]);return _0x22a3d6(_0x6090e5['error'][_0xb93b('0x1a')]);}else{logger[_0xb93b('0x13')](_0xb93b('0x14'),_0x920671,_0xb93b('0x15'));_0x22a3d6(_0x6090e5[_0xb93b('0x1b')][_0xb93b('0x1a')]);}})['catch'](function(_0x302b5e){logger[_0xb93b('0x18')](_0xb93b('0x14'),_0x920671,_0x302b5e);_0x434b6a(_0x302b5e);});});}exports[_0xb93b('0x1c')]=function(_0x1a70c7){var _0x42e71b=this;return new Promise(function(_0x58fd35,_0x57adc7){return db['SquareProject']['find']({'raw':_0x1a70c7[_0xb93b('0x1d')]?_0x1a70c7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a70c7[_0xb93b('0x1d')]?_0x1a70c7[_0xb93b('0x1d')][_0xb93b('0x1e')]||null:null,'attributes':_0x1a70c7['options']?_0x1a70c7[_0xb93b('0x1d')][_0xb93b('0x1f')]||null:null,'include':_0x1a70c7['options']?_0x1a70c7[_0xb93b('0x1d')][_0xb93b('0x20')]?_[_0xb93b('0x21')](_0x1a70c7[_0xb93b('0x1d')][_0xb93b('0x20')],function(_0x1942d9){return{'model':db[_0x1942d9['model']],'as':_0x1942d9['as'],'attributes':_0x1942d9[_0xb93b('0x1f')],'include':_0x1942d9[_0xb93b('0x20')]?_[_0xb93b('0x21')](_0x1942d9[_0xb93b('0x20')],function(_0x53c665){return{'model':db[_0x53c665[_0xb93b('0x22')]],'as':_0x53c665['as'],'attributes':_0x53c665[_0xb93b('0x1f')],'include':_0x53c665[_0xb93b('0x20')]?_[_0xb93b('0x21')](_0x53c665[_0xb93b('0x20')],function(_0x3edafd){return{'model':db[_0x3edafd[_0xb93b('0x22')]],'as':_0x3edafd['as'],'attributes':_0x3edafd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb93b('0x23')](function(_0x5a9182){logger[_0xb93b('0x13')](_0xb93b('0x1c'),_0x1a70c7);logger[_0xb93b('0x24')](_0xb93b('0x1c'),_0x1a70c7,JSON[_0xb93b('0x17')](_0x5a9182));_0x58fd35(_0x5a9182);})[_0xb93b('0x25')](function(_0xb2e875){logger[_0xb93b('0x18')](_0xb93b('0x1c'),_0xb2e875['message'],_0x1a70c7);_0x57adc7(_0x42e71b['error'](0x1f4,_0xb2e875[_0xb93b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 6265438..070d1b6 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 _0xf1e6=['save','remove','removeListener','register','squareProject:'];(function(_0x161ecf,_0xbb7357){var _0xcb61a6=function(_0x279f85){while(--_0x279f85){_0x161ecf['push'](_0x161ecf['shift']());}};_0xcb61a6(++_0xbb7357);}(_0xf1e6,0x82));var _0x6f1e=function(_0x573752,_0x17ae4){_0x573752=_0x573752-0x0;var _0x2cb020=_0xf1e6[_0x573752];return _0x2cb020;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6f1e('0x0'),_0x6f1e('0x1'),'update'];function createListener(_0xb8faff,_0x363faf){return function(_0x21f616){_0x363faf['emit'](_0xb8faff,_0x21f616);};}function removeListener(_0x3cb767,_0x23290f){return function(){SquareProjectEvents[_0x6f1e('0x2')](_0x3cb767,_0x23290f);};}exports[_0x6f1e('0x3')]=function(_0x49b786){for(var _0x3cab30=0x0,_0x376ced=events['length'];_0x3cab30<_0x376ced;_0x3cab30++){var _0xe90215=events[_0x3cab30];var _0x24b556=createListener(_0x6f1e('0x4')+_0xe90215,_0x49b786);SquareProjectEvents['on'](_0xe90215,_0x24b556);}}; \ No newline at end of file +var _0x6b83=['./squareProject.events','save','update','emit','removeListener','register','length'];(function(_0xc9b699,_0x4c41d8){var _0x387e66=function(_0x3e007a){while(--_0x3e007a){_0xc9b699['push'](_0xc9b699['shift']());}};_0x387e66(++_0x4c41d8);}(_0x6b83,0xa1));var _0x36b8=function(_0x3b9aa6,_0x3f0c03){_0x3b9aa6=_0x3b9aa6-0x0;var _0x12a0a9=_0x6b83[_0x3b9aa6];return _0x12a0a9;};'use strict';var SquareProjectEvents=require(_0x36b8('0x0'));var events=[_0x36b8('0x1'),'remove',_0x36b8('0x2')];function createListener(_0x541926,_0xf901e9){return function(_0x138646){_0xf901e9[_0x36b8('0x3')](_0x541926,_0x138646);};}function removeListener(_0x406346,_0x378dd8){return function(){SquareProjectEvents[_0x36b8('0x4')](_0x406346,_0x378dd8);};}exports[_0x36b8('0x5')]=function(_0x454d38){for(var _0x4636fd=0x0,_0x1d1b3a=events[_0x36b8('0x6')];_0x4636fd<_0x1d1b3a;_0x4636fd++){var _0x911d1e=events[_0x4636fd];var _0x2e3ac4=createListener('squareProject:'+_0x911d1e,_0x454d38);SquareProjectEvents['on'](_0x911d1e,_0x2e3ac4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b01c3d4..48ff9e9 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x213d33,_0x2afea9){var _0x570137=function(_0x4cb6b7){while(--_0x4cb6b7){_0x213d33['push'](_0x213d33['shift']());}};_0x570137(++_0x2afea9);}(_0x326f,0xd1));var _0xf326=function(_0x38f305,_0x4fdd94){_0x38f305=_0x38f305-0x0;var _0x2bfc25=_0x326f[_0x38f305];return _0x2bfc25;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x1f6b61,_0x57e23f){var _0x2f4299=function(_0xb29648){while(--_0xb29648){_0x1f6b61['push'](_0x1f6b61['shift']());}};_0x2f4299(++_0x57e23f);}(_0x1261,0x144));var _0x1126=function(_0x4afdce,_0x2d1a6a){_0x4afdce=_0x4afdce-0x0;var _0x5a163f=_0x1261[_0x4afdce];return _0x5a163f;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2b8cc2b..93d0474 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 _0xed1f=['lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','substring'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xed1f,0x6a));var _0xfed1=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xed1f[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'uniqueid':{'type':Sequelize[_0xfed1('0x2')]},'callerid':{'type':Sequelize[_0xfed1('0x2')]},'calleridname':{'type':Sequelize[_0xfed1('0x2')]},'context':{'type':Sequelize[_0xfed1('0x2')]},'extension':{'type':Sequelize[_0xfed1('0x2')]},'priority':{'type':Sequelize[_0xfed1('0x2')]},'accountcode':{'type':Sequelize[_0xfed1('0x2')]},'dnid':{'type':Sequelize[_0xfed1('0x2')]},'projectName':{'type':Sequelize[_0xfed1('0x2')]},'saveName':{'type':Sequelize[_0xfed1('0x2')]},'filename':{'type':Sequelize[_0xfed1('0x2')]},'savePath':{'type':Sequelize[_0xfed1('0x2')]},'format':{'type':Sequelize[_0xfed1('0x3')],'get':function(){var _0x612b38='';var _0x2a6082=this[_0xfed1('0x4')]('savePath');if(_0x2a6082){_0x612b38=_0x2a6082[_0xfed1('0x5')](_0x2a6082[_0xfed1('0x6')]('.'));}return _0x612b38;}}}; \ No newline at end of file +var _0xb138=['getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x4fddf7,_0x73a405){var _0x55e133=function(_0x5ae736){while(--_0x5ae736){_0x4fddf7['push'](_0x4fddf7['shift']());}};_0x55e133(++_0x73a405);}(_0xb138,0x1dd));var _0x8b13=function(_0x1785cd,_0x1e4753){_0x1785cd=_0x1785cd-0x0;var _0x10a79d=_0xb138[_0x1785cd];return _0x10a79d;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'callerid':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'extension':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'dnid':{'type':Sequelize[_0x8b13('0x2')]},'projectName':{'type':Sequelize[_0x8b13('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8b13('0x2')]},'savePath':{'type':Sequelize[_0x8b13('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x3fdf4d='';var _0x33d1a7=this[_0x8b13('0x3')]('savePath');if(_0x33d1a7){_0x3fdf4d=_0x33d1a7[_0x8b13('0x4')](_0x33d1a7[_0x8b13('0x5')]('.'));}return _0x3fdf4d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ecdff65..fe49814 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 _0x4bd3=['rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','length','includeAll','catch','create','body','update','params','download','type','uniqueid','find','savePath','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','SquareRecording'];(function(_0x57959c,_0x38d2e0){var _0x1596cc=function(_0x44638a){while(--_0x44638a){_0x57959c['push'](_0x57959c['shift']());}};_0x1596cc(++_0x38d2e0);}(_0x4bd3,0x14c));var _0x34bd=function(_0x160de6,_0x35ad90){_0x160de6=_0x160de6-0x0;var _0x5a306b=_0x4bd3[_0x160de6];return _0x5a306b;};'use strict';var emlformat=require(_0x34bd('0x0'));var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require(_0x34bd('0x3'));var rp=require(_0x34bd('0x4'));var moment=require(_0x34bd('0x5'));var BPromise=require(_0x34bd('0x6'));var Mustache=require('mustache');var util=require(_0x34bd('0x7'));var path=require(_0x34bd('0x8'));var sox=require(_0x34bd('0x9'));var csv=require(_0x34bd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34bd('0xb'));var _=require(_0x34bd('0xc'));var squel=require(_0x34bd('0xd'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xe'));var deskjs=require(_0x34bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x34bd('0x10'));var Papa=require('papaparse');var Redis=require(_0x34bd('0x11'));var authService=require(_0x34bd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x34bd('0x13'));var hardwareService=require(_0x34bd('0x14'));var logger=require(_0x34bd('0x15'))('api');var utils=require(_0x34bd('0x16'));var config=require(_0x34bd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x34bd('0x18'))['db'];function respondWithStatusCode(_0x1145bf,_0x4b2b24){_0x4b2b24=_0x4b2b24||0xcc;return function(_0x5b0c94){if(_0x5b0c94){return _0x1145bf[_0x34bd('0x19')](_0x4b2b24);}return _0x1145bf[_0x34bd('0x1a')](_0x4b2b24)[_0x34bd('0x1b')]();};}function respondWithResult(_0x54c831,_0x4d5f2a){_0x4d5f2a=_0x4d5f2a||0xc8;return function(_0x27f7c4){if(_0x27f7c4){return _0x54c831[_0x34bd('0x1a')](_0x4d5f2a)[_0x34bd('0x1c')](_0x27f7c4);}};}function respondWithFilteredResult(_0x607bea,_0x3ecfcc){return function(_0x27f716){if(_0x27f716){var _0x42fb12=typeof _0x3ecfcc[_0x34bd('0x1d')]===_0x34bd('0x1e')&&typeof _0x3ecfcc['limit']===_0x34bd('0x1e');var _0x309328=_0x27f716[_0x34bd('0x1f')];var _0x10a759=_0x42fb12?0x0:_0x3ecfcc[_0x34bd('0x1d')];var _0x3c58f5=_0x42fb12?_0x27f716['count']:_0x3ecfcc[_0x34bd('0x1d')]+_0x3ecfcc[_0x34bd('0x20')];var _0x3070b1;if(_0x3c58f5>=_0x309328){_0x3c58f5=_0x309328;_0x3070b1=0xc8;}else{_0x3070b1=0xce;}_0x607bea[_0x34bd('0x1a')](_0x3070b1);return _0x607bea['set'](_0x34bd('0x21'),_0x10a759+'-'+_0x3c58f5+'/'+_0x309328)[_0x34bd('0x1c')](_0x27f716);}return null;};}function patchUpdates(_0x520862){return function(_0x5f4e9b){try{jsonpatch[_0x34bd('0x22')](_0x5f4e9b,_0x520862,!![]);}catch(_0x5f4ce3){return BPromise[_0x34bd('0x23')](_0x5f4ce3);}return _0x5f4e9b[_0x34bd('0x24')]();};}function saveUpdates(_0x53902e,_0x1951fc){return function(_0xa27b26){if(_0xa27b26){return _0xa27b26['update'](_0x53902e)[_0x34bd('0x25')](function(_0x57e4bf){return _0x57e4bf;});}return null;};}function removeEntity(_0x418e1f,_0x351ffa){return function(_0x3faac0){if(_0x3faac0){return _0x3faac0[_0x34bd('0x26')]()[_0x34bd('0x25')](function(){_0x418e1f['status'](0xcc)[_0x34bd('0x1b')]();});}};}function handleEntityNotFound(_0x3f96f3,_0x45633d){return function(_0x48763c){if(!_0x48763c){_0x3f96f3[_0x34bd('0x19')](0x194);}return _0x48763c;};}function handleError(_0x7b31b0,_0x3aa92e){_0x3aa92e=_0x3aa92e||0x1f4;return function(_0x7e6d7e){logger['error'](_0x7e6d7e[_0x34bd('0x27')]);if(_0x7e6d7e[_0x34bd('0x28')]){delete _0x7e6d7e[_0x34bd('0x28')];}_0x7b31b0[_0x34bd('0x1a')](_0x3aa92e)[_0x34bd('0x29')](_0x7e6d7e);};}exports[_0x34bd('0x2a')]=function(_0x1d60be,_0x5c2498){var _0x1487c6={},_0x3f2254={},_0x42cdc0={'count':0x0,'rows':[]};var _0x4c9395=_['map'](db[_0x34bd('0x2b')][_0x34bd('0x2c')],function(_0x4a9604){return{'name':_0x4a9604['fieldName'],'type':_0x4a9604['type']['key']};});_0x3f2254[_0x34bd('0x2d')]=_[_0x34bd('0x2e')](_0x4c9395,'name');_0x3f2254[_0x34bd('0x2f')]=_[_0x34bd('0x30')](_0x1d60be[_0x34bd('0x2f')]);_0x3f2254[_0x34bd('0x31')]=_[_0x34bd('0x32')](_0x3f2254[_0x34bd('0x2d')],_0x3f2254[_0x34bd('0x2f')]);_0x1487c6[_0x34bd('0x33')]=_[_0x34bd('0x32')](_0x3f2254[_0x34bd('0x2d')],qs[_0x34bd('0x34')](_0x1d60be['query'][_0x34bd('0x34')]));_0x1487c6[_0x34bd('0x33')]=_0x1487c6[_0x34bd('0x33')]['length']?_0x1487c6[_0x34bd('0x33')]:_0x3f2254['model'];if(!_0x1d60be[_0x34bd('0x2f')]['hasOwnProperty']('nolimit')){_0x1487c6[_0x34bd('0x20')]=qs['limit'](_0x1d60be[_0x34bd('0x2f')][_0x34bd('0x20')]);_0x1487c6['offset']=qs[_0x34bd('0x1d')](_0x1d60be[_0x34bd('0x2f')]['offset']);}_0x1487c6[_0x34bd('0x35')]=qs[_0x34bd('0x36')](_0x1d60be[_0x34bd('0x2f')]['sort']);_0x1487c6[_0x34bd('0x37')]=qs[_0x34bd('0x31')](_['pick'](_0x1d60be['query'],_0x3f2254[_0x34bd('0x31')]),_0x4c9395);if(_0x1d60be['query'][_0x34bd('0x38')]){_0x1487c6['where']=_[_0x34bd('0x39')](_0x1487c6[_0x34bd('0x37')],{'$or':_[_0x34bd('0x2e')](_0x4c9395,function(_0x256623){if(_0x256623['type']!==_0x34bd('0x3a')){var _0x213911={};_0x213911[_0x256623[_0x34bd('0x28')]]={'$like':'%'+_0x1d60be[_0x34bd('0x2f')][_0x34bd('0x38')]+'%'};return _0x213911;}})});}_0x1487c6=_['merge']({},_0x1487c6,_0x1d60be[_0x34bd('0x3b')]);var _0x138710={'where':_0x1487c6[_0x34bd('0x37')]};return db[_0x34bd('0x2b')]['count'](_0x138710)['then'](function(_0xd3e729){_0x42cdc0[_0x34bd('0x1f')]=_0xd3e729;if(_0x1d60be[_0x34bd('0x2f')]['includeAll']){_0x1487c6[_0x34bd('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0x34bd('0x3d')](_0x1487c6);})[_0x34bd('0x25')](function(_0x48941e){_0x42cdc0[_0x34bd('0x3e')]=_0x48941e;return _0x42cdc0;})[_0x34bd('0x25')](respondWithFilteredResult(_0x5c2498,_0x1487c6))['catch'](handleError(_0x5c2498,null));};exports[_0x34bd('0x3f')]=function(_0x40a9bb,_0x2b7e6f){var _0x449444={'raw':!![],'where':{'id':_0x40a9bb['params']['id']}},_0x3a1668={};_0x3a1668['model']=_[_0x34bd('0x30')](db[_0x34bd('0x2b')]['rawAttributes']);_0x3a1668[_0x34bd('0x2f')]=_[_0x34bd('0x30')](_0x40a9bb[_0x34bd('0x2f')]);_0x3a1668[_0x34bd('0x31')]=_['intersection'](_0x3a1668[_0x34bd('0x2d')],_0x3a1668[_0x34bd('0x2f')]);_0x449444[_0x34bd('0x33')]=_['intersection'](_0x3a1668[_0x34bd('0x2d')],qs[_0x34bd('0x34')](_0x40a9bb['query'][_0x34bd('0x34')]));_0x449444[_0x34bd('0x33')]=_0x449444[_0x34bd('0x33')][_0x34bd('0x40')]?_0x449444[_0x34bd('0x33')]:_0x3a1668[_0x34bd('0x2d')];if(_0x40a9bb[_0x34bd('0x2f')][_0x34bd('0x41')]){_0x449444[_0x34bd('0x3c')]=[{'all':!![]}];}_0x449444=_[_0x34bd('0x39')]({},_0x449444,_0x40a9bb[_0x34bd('0x3b')]);return db[_0x34bd('0x2b')]['find'](_0x449444)[_0x34bd('0x25')](handleEntityNotFound(_0x2b7e6f,null))[_0x34bd('0x25')](respondWithResult(_0x2b7e6f,null))[_0x34bd('0x42')](handleError(_0x2b7e6f,null));};exports[_0x34bd('0x43')]=function(_0x10c629,_0x1ac29a){return db[_0x34bd('0x2b')][_0x34bd('0x43')](_0x10c629[_0x34bd('0x44')],{})[_0x34bd('0x25')](respondWithResult(_0x1ac29a,0xc9))[_0x34bd('0x42')](handleError(_0x1ac29a,null));};exports[_0x34bd('0x45')]=function(_0x592463,_0x137ffc){if(_0x592463['body']['id']){delete _0x592463[_0x34bd('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x592463[_0x34bd('0x46')]['id']}})[_0x34bd('0x25')](handleEntityNotFound(_0x137ffc,null))[_0x34bd('0x25')](saveUpdates(_0x592463['body'],null))[_0x34bd('0x25')](respondWithResult(_0x137ffc,null))['catch'](handleError(_0x137ffc,null));};exports[_0x34bd('0x47')]=function(_0x16255e,_0x150c79,_0x5df0a2){var _0x3e6551=require('../../components/encryptor');var _0x51c9de=![];var _0x1b3408={};if(_0x16255e[_0x34bd('0x2f')]['type']&&_0x16255e['query'][_0x34bd('0x48')]===_0x34bd('0x49')){_0x1b3408[_0x34bd('0x49')]=_0x16255e[_0x34bd('0x46')]['id'];}else{_0x1b3408['id']=_0x16255e[_0x34bd('0x46')]['id'];}return db[_0x34bd('0x2b')][_0x34bd('0x4a')]({'where':_0x1b3408,'attributes':['id',_0x34bd('0x4b'),'filename'],'raw':!![]})[_0x34bd('0x25')](handleEntityNotFound(_0x150c79,null))[_0x34bd('0x25')](function(_0x223749){if(_0x223749){var _0x3311ed=_0x223749[_0x34bd('0x4b')];var _0x19a5c7=util['format'](_0x34bd('0x4c'),_0x3311ed);if(fs['existsSync'](_0x19a5c7)){_0x51c9de=!![];return _0x3e6551[_0x34bd('0x4d')](_0x19a5c7,_0x3311ed,config['secrets'][_0x34bd('0x4e')])['then'](function(){return _0x223749;});}return _0x223749;}})[_0x34bd('0x25')](function(_0x21e63b){if(_0x21e63b){var _0x5bf295=_0x21e63b[_0x34bd('0x4b')];if(!fs[_0x34bd('0x4f')](_0x5bf295)){throw new db[(_0x34bd('0x50'))][(_0x34bd('0x51'))]('SquareRecording\x20not\x20found');}if(_0x21e63b[_0x34bd('0x52')]){return _0x150c79[_0x34bd('0x47')](_0x5bf295,_0x21e63b['filename']+path[_0x34bd('0x53')](_0x5bf295),function(){if(_0x51c9de){fs['unlink'](_0x5bf295);}});}else{return _0x150c79[_0x34bd('0x47')](_0x5bf295,function(_0x8f5980){if(_0x51c9de){fs[_0x34bd('0x54')](_0x5bf295);}});}}})[_0x34bd('0x42')](function(_0x3043d8){if(_0x3043d8['message']===_0x34bd('0x55')){_0x150c79[_0x34bd('0x1a')](0x194)[_0x34bd('0x29')](_0x34bd('0x56'));}else{return handleError(_0x150c79,null);}});};exports[_0x34bd('0x26')]=function(_0x5cf0b4,_0x560beb){return db[_0x34bd('0x2b')][_0x34bd('0x4a')]({'where':{'id':_0x5cf0b4[_0x34bd('0x46')]['id']}})[_0x34bd('0x25')](function(_0x26553e){if(_[_0x34bd('0x57')](_0x26553e)){throw new ReferenceError(_0x34bd('0x58'));}return _0x26553e;})[_0x34bd('0x25')](function(_0x5e08d0){var _0xe9c8cd=_0x5e08d0[_0x34bd('0x4b')];logger[_0x34bd('0x59')](_0x34bd('0x5a'),_0xe9c8cd);if(!_[_0x34bd('0x57')](_0x5e08d0[_0x34bd('0x4b')])&&fs['existsSync'](_0xe9c8cd)){logger[_0x34bd('0x59')]('File:\x20\x22'+_0xe9c8cd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xe9c8cd);}_0xe9c8cd=_0xe9c8cd+'.cypher';if(!_[_0x34bd('0x57')](_0x5e08d0[_0x34bd('0x4b')])&&fs[_0x34bd('0x4f')](_0xe9c8cd)){logger['info'](_0x34bd('0x5b')+_0xe9c8cd+_0x34bd('0x5c'));fs[_0x34bd('0x5d')](_0xe9c8cd);}return _0x5e08d0;})['then'](function(_0x2d9c61){if(!_0x2d9c61)throw new InternalError();return _0x2d9c61[_0x34bd('0x26')]();})['then'](function(){_0x560beb[_0x34bd('0x1a')](0xcc)[_0x34bd('0x1b')]();})[_0x34bd('0x42')](handleError(_0x560beb,null));}; \ No newline at end of file +var _0x3995=['send','index','SquareRecording','rawAttributes','fieldName','type','key','map','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','options','includeAll','catch','show','params','keys','find','create','body','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','end','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','name'];(function(_0x2b4b46,_0x5877fc){var _0x328049=function(_0x2605be){while(--_0x2605be){_0x2b4b46['push'](_0x2b4b46['shift']());}};_0x328049(++_0x5877fc);}(_0x3995,0x1ae));var _0x5399=function(_0x18d1d0,_0x37068c){_0x18d1d0=_0x18d1d0-0x0;var _0x5a2551=_0x3995[_0x18d1d0];return _0x5a2551;};'use strict';var emlformat=require(_0x5399('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5399('0x1'));var jsonpatch=require(_0x5399('0x2'));var rp=require(_0x5399('0x3'));var moment=require(_0x5399('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5399('0x5'));var util=require(_0x5399('0x6'));var path=require(_0x5399('0x7'));var sox=require('sox');var csv=require(_0x5399('0x8'));var ejs=require(_0x5399('0x9'));var fs=require('fs');var fs_extra=require(_0x5399('0xa'));var _=require(_0x5399('0xb'));var squel=require(_0x5399('0xc'));var crypto=require(_0x5399('0xd'));var jsforce=require(_0x5399('0xe'));var deskjs=require(_0x5399('0xf'));var toCsv=require(_0x5399('0x8'));var querystring=require(_0x5399('0x10'));var Papa=require(_0x5399('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5399('0x12'));var as=require(_0x5399('0x13'));var hardwareService=require(_0x5399('0x14'));var logger=require('../../config/logger')(_0x5399('0x15'));var utils=require('../../config/utils');var config=require(_0x5399('0x16'));var licenseUtil=require(_0x5399('0x17'));var db=require(_0x5399('0x18'))['db'];function respondWithStatusCode(_0x3185e4,_0x1ad6c8){_0x1ad6c8=_0x1ad6c8||0xcc;return function(_0xf3ffe6){if(_0xf3ffe6){return _0x3185e4[_0x5399('0x19')](_0x1ad6c8);}return _0x3185e4['status'](_0x1ad6c8)['end']();};}function respondWithResult(_0x4ead6b,_0x4953fa){_0x4953fa=_0x4953fa||0xc8;return function(_0x2215c4){if(_0x2215c4){return _0x4ead6b[_0x5399('0x1a')](_0x4953fa)['json'](_0x2215c4);}};}function respondWithFilteredResult(_0x490f5b,_0x1219dd){return function(_0x5dfeeb){if(_0x5dfeeb){var _0x40da73=typeof _0x1219dd[_0x5399('0x1b')]==='undefined'&&typeof _0x1219dd['limit']===_0x5399('0x1c');var _0x27f028=_0x5dfeeb[_0x5399('0x1d')];var _0x30e31e=_0x40da73?0x0:_0x1219dd['offset'];var _0x8a8b06=_0x40da73?_0x5dfeeb['count']:_0x1219dd[_0x5399('0x1b')]+_0x1219dd[_0x5399('0x1e')];var _0x54274c;if(_0x8a8b06>=_0x27f028){_0x8a8b06=_0x27f028;_0x54274c=0xc8;}else{_0x54274c=0xce;}_0x490f5b['status'](_0x54274c);return _0x490f5b['set'](_0x5399('0x1f'),_0x30e31e+'-'+_0x8a8b06+'/'+_0x27f028)[_0x5399('0x20')](_0x5dfeeb);}return null;};}function patchUpdates(_0x40b87a){return function(_0x581411){try{jsonpatch[_0x5399('0x21')](_0x581411,_0x40b87a,!![]);}catch(_0x39a99e){return BPromise[_0x5399('0x22')](_0x39a99e);}return _0x581411[_0x5399('0x23')]();};}function saveUpdates(_0x3f9a69,_0x2dac0b){return function(_0x1563f1){if(_0x1563f1){return _0x1563f1[_0x5399('0x24')](_0x3f9a69)[_0x5399('0x25')](function(_0x3b734c){return _0x3b734c;});}return null;};}function removeEntity(_0x330cd2,_0x46255c){return function(_0x5a7e83){if(_0x5a7e83){return _0x5a7e83[_0x5399('0x26')]()[_0x5399('0x25')](function(){_0x330cd2[_0x5399('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14082d,_0x1f9e8e){return function(_0x2ed31e){if(!_0x2ed31e){_0x14082d['sendStatus'](0x194);}return _0x2ed31e;};}function handleError(_0x32247a,_0x5490e2){_0x5490e2=_0x5490e2||0x1f4;return function(_0x5eea64){logger['error'](_0x5eea64['stack']);if(_0x5eea64[_0x5399('0x27')]){delete _0x5eea64[_0x5399('0x27')];}_0x32247a['status'](_0x5490e2)[_0x5399('0x28')](_0x5eea64);};}exports[_0x5399('0x29')]=function(_0x253c9b,_0x12b5a6){var _0x20e8da={},_0x47e00c={},_0x5adf71={'count':0x0,'rows':[]};var _0x195a26=_['map'](db[_0x5399('0x2a')][_0x5399('0x2b')],function(_0x26682e){return{'name':_0x26682e[_0x5399('0x2c')],'type':_0x26682e[_0x5399('0x2d')][_0x5399('0x2e')]};});_0x47e00c['model']=_[_0x5399('0x2f')](_0x195a26,_0x5399('0x27'));_0x47e00c[_0x5399('0x30')]=_['keys'](_0x253c9b[_0x5399('0x30')]);_0x47e00c['filters']=_['intersection'](_0x47e00c[_0x5399('0x31')],_0x47e00c['query']);_0x20e8da[_0x5399('0x32')]=_[_0x5399('0x33')](_0x47e00c[_0x5399('0x31')],qs[_0x5399('0x34')](_0x253c9b[_0x5399('0x30')][_0x5399('0x34')]));_0x20e8da[_0x5399('0x32')]=_0x20e8da[_0x5399('0x32')][_0x5399('0x35')]?_0x20e8da[_0x5399('0x32')]:_0x47e00c[_0x5399('0x31')];if(!_0x253c9b['query'][_0x5399('0x36')]('nolimit')){_0x20e8da[_0x5399('0x1e')]=qs[_0x5399('0x1e')](_0x253c9b[_0x5399('0x30')][_0x5399('0x1e')]);_0x20e8da[_0x5399('0x1b')]=qs[_0x5399('0x1b')](_0x253c9b[_0x5399('0x30')][_0x5399('0x1b')]);}_0x20e8da[_0x5399('0x37')]=qs[_0x5399('0x38')](_0x253c9b['query'][_0x5399('0x38')]);_0x20e8da[_0x5399('0x39')]=qs['filters'](_[_0x5399('0x3a')](_0x253c9b['query'],_0x47e00c[_0x5399('0x3b')]),_0x195a26);if(_0x253c9b[_0x5399('0x30')]['filter']){_0x20e8da[_0x5399('0x39')]=_[_0x5399('0x3c')](_0x20e8da[_0x5399('0x39')],{'$or':_['map'](_0x195a26,function(_0x314e4b){if(_0x314e4b[_0x5399('0x2d')]!=='VIRTUAL'){var _0x3f714d={};_0x3f714d[_0x314e4b[_0x5399('0x27')]]={'$like':'%'+_0x253c9b[_0x5399('0x30')]['filter']+'%'};return _0x3f714d;}})});}_0x20e8da=_[_0x5399('0x3c')]({},_0x20e8da,_0x253c9b[_0x5399('0x3d')]);var _0x5cdc54={'where':_0x20e8da[_0x5399('0x39')]};return db[_0x5399('0x2a')][_0x5399('0x1d')](_0x5cdc54)['then'](function(_0x3e2283){_0x5adf71[_0x5399('0x1d')]=_0x3e2283;if(_0x253c9b[_0x5399('0x30')][_0x5399('0x3e')]){_0x20e8da['include']=[{'all':!![]}];}return db[_0x5399('0x2a')]['findAll'](_0x20e8da);})[_0x5399('0x25')](function(_0x47cefd){_0x5adf71['rows']=_0x47cefd;return _0x5adf71;})[_0x5399('0x25')](respondWithFilteredResult(_0x12b5a6,_0x20e8da))[_0x5399('0x3f')](handleError(_0x12b5a6,null));};exports[_0x5399('0x40')]=function(_0x5c37eb,_0x494d16){var _0x38aaf1={'raw':!![],'where':{'id':_0x5c37eb[_0x5399('0x41')]['id']}},_0x544296={};_0x544296['model']=_[_0x5399('0x42')](db['SquareRecording'][_0x5399('0x2b')]);_0x544296[_0x5399('0x30')]=_[_0x5399('0x42')](_0x5c37eb[_0x5399('0x30')]);_0x544296[_0x5399('0x3b')]=_[_0x5399('0x33')](_0x544296[_0x5399('0x31')],_0x544296[_0x5399('0x30')]);_0x38aaf1[_0x5399('0x32')]=_[_0x5399('0x33')](_0x544296['model'],qs['fields'](_0x5c37eb[_0x5399('0x30')][_0x5399('0x34')]));_0x38aaf1[_0x5399('0x32')]=_0x38aaf1[_0x5399('0x32')][_0x5399('0x35')]?_0x38aaf1[_0x5399('0x32')]:_0x544296[_0x5399('0x31')];if(_0x5c37eb[_0x5399('0x30')][_0x5399('0x3e')]){_0x38aaf1['include']=[{'all':!![]}];}_0x38aaf1=_[_0x5399('0x3c')]({},_0x38aaf1,_0x5c37eb[_0x5399('0x3d')]);return db[_0x5399('0x2a')][_0x5399('0x43')](_0x38aaf1)[_0x5399('0x25')](handleEntityNotFound(_0x494d16,null))[_0x5399('0x25')](respondWithResult(_0x494d16,null))[_0x5399('0x3f')](handleError(_0x494d16,null));};exports['create']=function(_0x17262b,_0x29b8b0){return db[_0x5399('0x2a')][_0x5399('0x44')](_0x17262b[_0x5399('0x45')],{})['then'](respondWithResult(_0x29b8b0,0xc9))[_0x5399('0x3f')](handleError(_0x29b8b0,null));};exports[_0x5399('0x24')]=function(_0x4bae56,_0x319773){if(_0x4bae56[_0x5399('0x45')]['id']){delete _0x4bae56[_0x5399('0x45')]['id'];}return db[_0x5399('0x2a')][_0x5399('0x43')]({'where':{'id':_0x4bae56['params']['id']}})['then'](handleEntityNotFound(_0x319773,null))['then'](saveUpdates(_0x4bae56[_0x5399('0x45')],null))[_0x5399('0x25')](respondWithResult(_0x319773,null))[_0x5399('0x3f')](handleError(_0x319773,null));};exports[_0x5399('0x46')]=function(_0x2b8cb5,_0x51350f,_0x438dca){var _0x394511=require('../../components/encryptor');var _0x24dc00=![];var _0x49db1b={};if(_0x2b8cb5[_0x5399('0x30')][_0x5399('0x2d')]&&_0x2b8cb5[_0x5399('0x30')]['type']===_0x5399('0x47')){_0x49db1b['uniqueid']=_0x2b8cb5['params']['id'];}else{_0x49db1b['id']=_0x2b8cb5[_0x5399('0x41')]['id'];}return db[_0x5399('0x2a')]['find']({'where':_0x49db1b,'attributes':['id',_0x5399('0x48'),_0x5399('0x49')],'raw':!![]})[_0x5399('0x25')](handleEntityNotFound(_0x51350f,null))['then'](function(_0x8ebb20){if(_0x8ebb20){var _0x2cc2eb=_0x8ebb20['savePath'];var _0x233daf=util[_0x5399('0x4a')]('%s.cypher',_0x2cc2eb);if(fs[_0x5399('0x4b')](_0x233daf)){_0x24dc00=!![];return _0x394511[_0x5399('0x4c')](_0x233daf,_0x2cc2eb,config[_0x5399('0x4d')][_0x5399('0x4e')])[_0x5399('0x25')](function(){return _0x8ebb20;});}return _0x8ebb20;}})[_0x5399('0x25')](function(_0x3337f6){if(_0x3337f6){var _0x11e6d5=_0x3337f6[_0x5399('0x48')];if(!fs[_0x5399('0x4b')](_0x11e6d5)){throw new db['Sequelize'][(_0x5399('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x3337f6['filename']){return _0x51350f[_0x5399('0x46')](_0x11e6d5,_0x3337f6[_0x5399('0x49')]+path[_0x5399('0x50')](_0x11e6d5),function(){if(_0x24dc00){fs[_0x5399('0x51')](_0x11e6d5);}});}else{return _0x51350f[_0x5399('0x46')](_0x11e6d5,function(_0x5dc564){if(_0x24dc00){fs['unlink'](_0x11e6d5);}});}}})[_0x5399('0x3f')](function(_0x3d5b31){if(_0x3d5b31[_0x5399('0x52')]===_0x5399('0x53')){_0x51350f[_0x5399('0x1a')](0x194)[_0x5399('0x28')](_0x5399('0x54'));}else{return handleError(_0x51350f,null);}});};exports[_0x5399('0x26')]=function(_0x61417a,_0x1a0a7e){return db['SquareRecording'][_0x5399('0x43')]({'where':{'id':_0x61417a[_0x5399('0x41')]['id']}})[_0x5399('0x25')](function(_0x53c030){if(_['isNil'](_0x53c030)){throw new ReferenceError(_0x5399('0x55'));}return _0x53c030;})['then'](function(_0x56a418){var _0x2701f0=_0x56a418['savePath'];logger[_0x5399('0x56')](_0x5399('0x57'),_0x2701f0);if(!_['isNil'](_0x56a418[_0x5399('0x48')])&&fs[_0x5399('0x4b')](_0x2701f0)){logger[_0x5399('0x56')](_0x5399('0x58')+_0x2701f0+_0x5399('0x59'));fs[_0x5399('0x5a')](_0x2701f0);}_0x2701f0=_0x2701f0+_0x5399('0x5b');if(!_[_0x5399('0x5c')](_0x56a418[_0x5399('0x48')])&&fs[_0x5399('0x4b')](_0x2701f0)){logger[_0x5399('0x56')](_0x5399('0x58')+_0x2701f0+_0x5399('0x59'));fs[_0x5399('0x5a')](_0x2701f0);}return _0x56a418;})['then'](function(_0x2d73ce){if(!_0x2d73ce)throw new InternalError();return _0x2d73ce['destroy']();})['then'](function(){_0x1a0a7e[_0x5399('0x1a')](0xcc)[_0x5399('0x5d')]();})['catch'](handleError(_0x1a0a7e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 190df38..6397675 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 _0x5ae0=['path','rimraf','exports','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird'];(function(_0x6c0a23,_0x29b948){var _0x381c87=function(_0x3c0cc0){while(--_0x3c0cc0){_0x6c0a23['push'](_0x6c0a23['shift']());}};_0x381c87(++_0x29b948);}(_0x5ae0,0xf8));var _0x05ae=function(_0x40cb07,_0x1fce53){_0x40cb07=_0x40cb07-0x0;var _0x265bb0=_0x5ae0[_0x40cb07];return _0x265bb0;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var logger=require(_0x05ae('0x1'))('api');var moment=require(_0x05ae('0x2'));var BPromise=require(_0x05ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05ae('0x4'));var rimraf=require(_0x05ae('0x5'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x05ae('0x6')]=function(_0x40b966,_0x2c4e6c){return _0x40b966['define'](_0x05ae('0x7'),attributes,{'tableName':_0x05ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','SquareRecording','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x524e,0x15e));var _0xe524=function(_0x55e1c9,_0x234a1a){_0x55e1c9=_0x55e1c9-0x0;var _0x47cfef=_0x524e[_0x55e1c9];return _0x47cfef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index fa8bc68..fa4f91e 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 _0x5adb=['SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareRecording','create','body','options','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x2fa215,_0x1e1058){var _0x43dfab=function(_0x47ff45){while(--_0x47ff45){_0x2fa215['push'](_0x2fa215['shift']());}};_0x43dfab(++_0x1e1058);}(_0x5adb,0x1e8));var _0xb5ad=function(_0x3759fa,_0x4a1baa){_0x3759fa=_0x3759fa-0x0;var _0x4e512e=_0x5adb[_0x3759fa];return _0x4e512e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb5ad('0x0'));var BPromise=require('bluebird');var rs=require(_0xb5ad('0x1'));var fs=require('fs');var Redis=require(_0xb5ad('0x2'));var db=require(_0xb5ad('0x3'))['db'];var utils=require(_0xb5ad('0x4'));var logger=require(_0xb5ad('0x5'))(_0xb5ad('0x6'));var config=require(_0xb5ad('0x7'));var jayson=require(_0xb5ad('0x8'));var client=jayson[_0xb5ad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6b99,_0x29c8c6,_0x15d39c){return new BPromise(function(_0x12c193,_0x1e2dd5){return client['request'](_0x5e6b99,_0x15d39c)[_0xb5ad('0xa')](function(_0x38d62b){logger[_0xb5ad('0xb')](_0xb5ad('0xc'),_0x29c8c6,'request\x20sent');logger['debug'](_0xb5ad('0xd'),_0x29c8c6,_0xb5ad('0xe'),JSON[_0xb5ad('0xf')](_0x38d62b));if(_0x38d62b[_0xb5ad('0x10')]){if(_0x38d62b[_0xb5ad('0x10')]['code']===0x1f4){logger[_0xb5ad('0x10')]('SquareRecording,\x20%s,\x20%s',_0x29c8c6,_0x38d62b[_0xb5ad('0x10')][_0xb5ad('0x11')]);return _0x1e2dd5(_0x38d62b[_0xb5ad('0x10')]['message']);}logger['error'](_0xb5ad('0xc'),_0x29c8c6,_0x38d62b[_0xb5ad('0x10')][_0xb5ad('0x11')]);return _0x12c193(_0x38d62b['error'][_0xb5ad('0x11')]);}else{logger[_0xb5ad('0xb')]('SquareRecording,\x20%s,\x20%s',_0x29c8c6,_0xb5ad('0xe'));_0x12c193(_0x38d62b[_0xb5ad('0x12')][_0xb5ad('0x11')]);}})[_0xb5ad('0x13')](function(_0x2f84cc){logger[_0xb5ad('0x10')](_0xb5ad('0xc'),_0x29c8c6,_0x2f84cc);_0x1e2dd5(_0x2f84cc);});});}exports[_0xb5ad('0x14')]=function(_0xf96f5d){var _0x173eeb=this;return new Promise(function(_0x435006,_0x3623e9){return db['SquareRecording'][_0xb5ad('0x15')](_0xf96f5d[_0xb5ad('0x16')],{'raw':_0xf96f5d[_0xb5ad('0x17')]?_0xf96f5d[_0xb5ad('0x17')][_0xb5ad('0x18')]===undefined?!![]:![]:!![]})[_0xb5ad('0xa')](function(_0xca1dfc){logger['info'](_0xb5ad('0x14'),_0xf96f5d);logger['debug'](_0xb5ad('0x14'),_0xf96f5d,JSON[_0xb5ad('0xf')](_0xca1dfc));_0x435006(_0xca1dfc);})['catch'](function(_0x293ad7){logger[_0xb5ad('0x10')](_0xb5ad('0x14'),_0x293ad7['message'],_0xf96f5d);_0x3623e9(_0x173eeb[_0xb5ad('0x10')](0x1f4,_0x293ad7[_0xb5ad('0x11')]));});});}; \ No newline at end of file +var _0x4ea0=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','debug','lodash','util','moment','randomstring'];(function(_0x24a2b0,_0x264053){var _0x477d85=function(_0x14f481){while(--_0x14f481){_0x24a2b0['push'](_0x24a2b0['shift']());}};_0x477d85(++_0x264053);}(_0x4ea0,0x1c7));var _0x04ea=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x4ea0[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x04ea('0x0'));var util=require(_0x04ea('0x1'));var moment=require(_0x04ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x04ea('0x3'));var fs=require('fs');var Redis=require(_0x04ea('0x4'));var db=require(_0x04ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x04ea('0x6'))('rpc');var config=require(_0x04ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55acad,_0x50148f,_0x2b789e){return new BPromise(function(_0x12b985,_0x57c90e){return client[_0x04ea('0x9')](_0x55acad,_0x2b789e)[_0x04ea('0xa')](function(_0x172671){logger[_0x04ea('0xb')](_0x04ea('0xc'),_0x50148f,_0x04ea('0xd'));logger['debug'](_0x04ea('0xe'),_0x50148f,_0x04ea('0xd'),JSON[_0x04ea('0xf')](_0x172671));if(_0x172671[_0x04ea('0x10')]){if(_0x172671[_0x04ea('0x10')][_0x04ea('0x11')]===0x1f4){logger[_0x04ea('0x10')](_0x04ea('0xc'),_0x50148f,_0x172671[_0x04ea('0x10')]['message']);return _0x57c90e(_0x172671['error'][_0x04ea('0x12')]);}logger[_0x04ea('0x10')](_0x04ea('0xc'),_0x50148f,_0x172671[_0x04ea('0x10')]['message']);return _0x12b985(_0x172671[_0x04ea('0x10')][_0x04ea('0x12')]);}else{logger['info'](_0x04ea('0xc'),_0x50148f,_0x04ea('0xd'));_0x12b985(_0x172671['result'][_0x04ea('0x12')]);}})[_0x04ea('0x13')](function(_0xb8c0ce){logger[_0x04ea('0x10')](_0x04ea('0xc'),_0x50148f,_0xb8c0ce);_0x57c90e(_0xb8c0ce);});});}exports[_0x04ea('0x14')]=function(_0xd09a38){var _0x53f0c6=this;return new Promise(function(_0x53d8db,_0x43b5c7){return db[_0x04ea('0x15')][_0x04ea('0x16')](_0xd09a38[_0x04ea('0x17')],{'raw':_0xd09a38[_0x04ea('0x18')]?_0xd09a38[_0x04ea('0x18')][_0x04ea('0x19')]===undefined?!![]:![]:!![]})[_0x04ea('0xa')](function(_0x1cd3b7){logger[_0x04ea('0xb')](_0x04ea('0x14'),_0xd09a38);logger[_0x04ea('0x1a')](_0x04ea('0x14'),_0xd09a38,JSON[_0x04ea('0xf')](_0x1cd3b7));_0x53d8db(_0x1cd3b7);})[_0x04ea('0x13')](function(_0x41578b){logger[_0x04ea('0x10')]('CreateSquareRecording',_0x41578b['message'],_0xd09a38);_0x43b5c7(_0x53f0c6[_0x04ea('0x10')](0x1f4,_0x41578b[_0x04ea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 2e3ed36..addf3f8 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x17aa90,_0x2e1502){var _0x3ac392=function(_0x2a0cbe){while(--_0x2a0cbe){_0x17aa90['push'](_0x17aa90['shift']());}};_0x3ac392(++_0x2e1502);}(_0xe706,0xa3));var _0x6e70=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0xe706[_0x2118ad];return _0x4b5715;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x4dab55,_0x30b8e9){var _0x15ad0e=function(_0x4e6773){while(--_0x4e6773){_0x4dab55['push'](_0x4dab55['shift']());}};_0x15ad0e(++_0x30b8e9);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 876800a..f2dc78c 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 _0x345e=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x345e,0x156));var _0xe345=function(_0x3cda26,_0x31a42a){_0x3cda26=_0x3cda26-0x0;var _0x45469f=_0x345e[_0x3cda26];return _0x45469f;};'use strict';var Sequelize=require(_0xe345('0x0'));module[_0xe345('0x1')]={'network':{'type':Sequelize[_0xe345('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe345('0x2')]},'language':{'type':Sequelize[_0xe345('0x2')]},'type':{'type':Sequelize[_0xe345('0x2')]},'uniqueid':{'type':Sequelize[_0xe345('0x2')]},'version':{'type':Sequelize[_0xe345('0x2')]},'callerid':{'type':Sequelize[_0xe345('0x2')]},'calleridname':{'type':Sequelize[_0xe345('0x2')]},'callingpres':{'type':Sequelize[_0xe345('0x2')]},'callingani2':{'type':Sequelize[_0xe345('0x2')]},'callington':{'type':Sequelize[_0xe345('0x2')]},'callingtns':{'type':Sequelize[_0xe345('0x2')]},'dnid':{'type':Sequelize[_0xe345('0x2')]},'rdnis':{'type':Sequelize[_0xe345('0x2')]},'context':{'type':Sequelize[_0xe345('0x2')]},'extension':{'type':Sequelize[_0xe345('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xe345('0x2')]},'accountcode':{'type':Sequelize[_0xe345('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe345('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xe345('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf75d=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xf75d,0xa7));var _0xdf75=function(_0x56aad3,_0x3d48bc){_0x56aad3=_0x56aad3-0x0;var _0x1d165a=_0xf75d[_0x56aad3];return _0x1d165a;};'use strict';var Sequelize=require(_0xdf75('0x0'));module[_0xdf75('0x1')]={'network':{'type':Sequelize[_0xdf75('0x2')]},'network_script':{'type':Sequelize[_0xdf75('0x2')]},'request':{'type':Sequelize[_0xdf75('0x2')]},'channel':{'type':Sequelize[_0xdf75('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdf75('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdf75('0x2')]},'calleridname':{'type':Sequelize[_0xdf75('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xdf75('0x2')]},'callington':{'type':Sequelize[_0xdf75('0x2')]},'callingtns':{'type':Sequelize[_0xdf75('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xdf75('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf75('0x2')]},'threadid':{'type':Sequelize[_0xdf75('0x2')]},'project_name':{'type':Sequelize[_0xdf75('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdf75('0x3')]},'bot':{'type':Sequelize[_0xdf75('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 25e6522..d6dab3c 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 _0xb7f4=['rows','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','map','SquareReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll'];(function(_0x575d32,_0x5e12f9){var _0x31d359=function(_0x5692ce){while(--_0x5692ce){_0x575d32['push'](_0x575d32['shift']());}};_0x31d359(++_0x5e12f9);}(_0xb7f4,0x1d8));var _0x4b7f=function(_0x59824b,_0x3f52d9){_0x59824b=_0x59824b-0x0;var _0x252276=_0xb7f4[_0x59824b];return _0x252276;};'use strict';var emlformat=require(_0x4b7f('0x0'));var rimraf=require(_0x4b7f('0x1'));var zipdir=require(_0x4b7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b7f('0x3'));var moment=require(_0x4b7f('0x4'));var BPromise=require(_0x4b7f('0x5'));var Mustache=require('mustache');var util=require(_0x4b7f('0x6'));var path=require(_0x4b7f('0x7'));var sox=require('sox');var csv=require(_0x4b7f('0x8'));var ejs=require(_0x4b7f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b7f('0xa'));var squel=require('squel');var crypto=require(_0x4b7f('0xb'));var jsforce=require(_0x4b7f('0xc'));var deskjs=require(_0x4b7f('0xd'));var toCsv=require(_0x4b7f('0x8'));var querystring=require(_0x4b7f('0xe'));var Papa=require(_0x4b7f('0xf'));var Redis=require(_0x4b7f('0x10'));var authService=require(_0x4b7f('0x11'));var qs=require(_0x4b7f('0x12'));var as=require(_0x4b7f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b7f('0x14'))(_0x4b7f('0x15'));var utils=require('../../config/utils');var config=require(_0x4b7f('0x16'));var licenseUtil=require(_0x4b7f('0x17'));var db=require(_0x4b7f('0x18'))['db'];function respondWithStatusCode(_0x279c16,_0xe6410a){_0xe6410a=_0xe6410a||0xcc;return function(_0x272d70){if(_0x272d70){return _0x279c16[_0x4b7f('0x19')](_0xe6410a);}return _0x279c16['status'](_0xe6410a)[_0x4b7f('0x1a')]();};}function respondWithResult(_0x3b5efe,_0x1079da){_0x1079da=_0x1079da||0xc8;return function(_0x2f1e73){if(_0x2f1e73){return _0x3b5efe[_0x4b7f('0x1b')](_0x1079da)[_0x4b7f('0x1c')](_0x2f1e73);}};}function respondWithFilteredResult(_0x41e5c9,_0x490e1e){return function(_0x264d13){if(_0x264d13){var _0x4a37cf=typeof _0x490e1e[_0x4b7f('0x1d')]===_0x4b7f('0x1e')&&typeof _0x490e1e[_0x4b7f('0x1f')]===_0x4b7f('0x1e');var _0x4916ae=_0x264d13[_0x4b7f('0x20')];var _0xc67667=_0x4a37cf?0x0:_0x490e1e['offset'];var _0x2805b3=_0x4a37cf?_0x264d13[_0x4b7f('0x20')]:_0x490e1e[_0x4b7f('0x1d')]+_0x490e1e['limit'];var _0x46aaed;if(_0x2805b3>=_0x4916ae){_0x2805b3=_0x4916ae;_0x46aaed=0xc8;}else{_0x46aaed=0xce;}_0x41e5c9['status'](_0x46aaed);return _0x41e5c9[_0x4b7f('0x21')](_0x4b7f('0x22'),_0xc67667+'-'+_0x2805b3+'/'+_0x4916ae)[_0x4b7f('0x1c')](_0x264d13);}return null;};}function patchUpdates(_0x2266f2){return function(_0x330dbd){try{jsonpatch['apply'](_0x330dbd,_0x2266f2,!![]);}catch(_0x40fcbb){return BPromise[_0x4b7f('0x23')](_0x40fcbb);}return _0x330dbd[_0x4b7f('0x24')]();};}function saveUpdates(_0x5bcf57,_0x699c96){return function(_0x4a88f2){if(_0x4a88f2){return _0x4a88f2['update'](_0x5bcf57)['then'](function(_0x62804f){return _0x62804f;});}return null;};}function removeEntity(_0x3fac17,_0x5710cc){return function(_0x9eee87){if(_0x9eee87){return _0x9eee87[_0x4b7f('0x25')]()[_0x4b7f('0x26')](function(){_0x3fac17[_0x4b7f('0x1b')](0xcc)[_0x4b7f('0x1a')]();});}};}function handleEntityNotFound(_0x3837af,_0x5d663f){return function(_0x31ac45){if(!_0x31ac45){_0x3837af[_0x4b7f('0x19')](0x194);}return _0x31ac45;};}function handleError(_0x2efbf6,_0x181cf1){_0x181cf1=_0x181cf1||0x1f4;return function(_0x162e53){logger[_0x4b7f('0x27')](_0x162e53[_0x4b7f('0x28')]);if(_0x162e53[_0x4b7f('0x29')]){delete _0x162e53['name'];}_0x2efbf6[_0x4b7f('0x1b')](_0x181cf1)[_0x4b7f('0x2a')](_0x162e53);};}exports[_0x4b7f('0x2b')]=function(_0x57240c,_0x11d47c){var _0x1e88be={},_0x65191e={},_0x12d4a3={'count':0x0,'rows':[]};var _0x4a3ad9=_[_0x4b7f('0x2c')](db[_0x4b7f('0x2d')]['rawAttributes'],function(_0x27ff18){return{'name':_0x27ff18[_0x4b7f('0x2e')],'type':_0x27ff18['type'][_0x4b7f('0x2f')]};});_0x65191e[_0x4b7f('0x30')]=_[_0x4b7f('0x2c')](_0x4a3ad9,_0x4b7f('0x29'));_0x65191e[_0x4b7f('0x31')]=_[_0x4b7f('0x32')](_0x57240c[_0x4b7f('0x31')]);_0x65191e[_0x4b7f('0x33')]=_[_0x4b7f('0x34')](_0x65191e[_0x4b7f('0x30')],_0x65191e['query']);_0x1e88be[_0x4b7f('0x35')]=_[_0x4b7f('0x34')](_0x65191e[_0x4b7f('0x30')],qs[_0x4b7f('0x36')](_0x57240c[_0x4b7f('0x31')][_0x4b7f('0x36')]));_0x1e88be[_0x4b7f('0x35')]=_0x1e88be[_0x4b7f('0x35')][_0x4b7f('0x37')]?_0x1e88be['attributes']:_0x65191e[_0x4b7f('0x30')];if(!_0x57240c[_0x4b7f('0x31')]['hasOwnProperty']('nolimit')){_0x1e88be[_0x4b7f('0x1f')]=qs[_0x4b7f('0x1f')](_0x57240c[_0x4b7f('0x31')]['limit']);_0x1e88be['offset']=qs[_0x4b7f('0x1d')](_0x57240c[_0x4b7f('0x31')]['offset']);}_0x1e88be[_0x4b7f('0x38')]=qs[_0x4b7f('0x39')](_0x57240c[_0x4b7f('0x31')][_0x4b7f('0x39')]);_0x1e88be[_0x4b7f('0x3a')]=qs[_0x4b7f('0x33')](_[_0x4b7f('0x3b')](_0x57240c[_0x4b7f('0x31')],_0x65191e[_0x4b7f('0x33')]),_0x4a3ad9);if(_0x57240c['query'][_0x4b7f('0x3c')]){_0x1e88be[_0x4b7f('0x3a')]=_[_0x4b7f('0x3d')](_0x1e88be['where'],{'$or':_[_0x4b7f('0x2c')](_0x4a3ad9,function(_0x32a1b9){if(_0x32a1b9[_0x4b7f('0x3e')]!=='VIRTUAL'){var _0x39ea28={};_0x39ea28[_0x32a1b9['name']]={'$like':'%'+_0x57240c[_0x4b7f('0x31')]['filter']+'%'};return _0x39ea28;}})});}_0x1e88be=_[_0x4b7f('0x3d')]({},_0x1e88be,_0x57240c[_0x4b7f('0x3f')]);var _0x385e00={'where':_0x1e88be[_0x4b7f('0x3a')]};return db[_0x4b7f('0x2d')][_0x4b7f('0x20')](_0x385e00)[_0x4b7f('0x26')](function(_0x5747ad){_0x12d4a3[_0x4b7f('0x20')]=_0x5747ad;if(_0x57240c['query'][_0x4b7f('0x40')]){_0x1e88be[_0x4b7f('0x41')]=[{'all':!![]}];}return db[_0x4b7f('0x2d')][_0x4b7f('0x42')](_0x1e88be);})[_0x4b7f('0x26')](function(_0x2af470){_0x12d4a3[_0x4b7f('0x43')]=_0x2af470;return _0x12d4a3;})['then'](respondWithFilteredResult(_0x11d47c,_0x1e88be))[_0x4b7f('0x44')](handleError(_0x11d47c,null));};exports[_0x4b7f('0x45')]=function(_0x5f48fc,_0x3eca99){var _0x498e04={'raw':!![],'where':{'id':_0x5f48fc[_0x4b7f('0x46')]['id']}},_0x3f9785={};_0x3f9785[_0x4b7f('0x30')]=_['keys'](db['SquareReport'][_0x4b7f('0x47')]);_0x3f9785[_0x4b7f('0x31')]=_['keys'](_0x5f48fc[_0x4b7f('0x31')]);_0x3f9785[_0x4b7f('0x33')]=_[_0x4b7f('0x34')](_0x3f9785[_0x4b7f('0x30')],_0x3f9785[_0x4b7f('0x31')]);_0x498e04['attributes']=_[_0x4b7f('0x34')](_0x3f9785[_0x4b7f('0x30')],qs['fields'](_0x5f48fc['query'][_0x4b7f('0x36')]));_0x498e04['attributes']=_0x498e04[_0x4b7f('0x35')][_0x4b7f('0x37')]?_0x498e04[_0x4b7f('0x35')]:_0x3f9785[_0x4b7f('0x30')];if(_0x5f48fc[_0x4b7f('0x31')][_0x4b7f('0x40')]){_0x498e04['include']=[{'all':!![]}];}_0x498e04=_[_0x4b7f('0x3d')]({},_0x498e04,_0x5f48fc['options']);return db[_0x4b7f('0x2d')][_0x4b7f('0x48')](_0x498e04)[_0x4b7f('0x26')](handleEntityNotFound(_0x3eca99,null))[_0x4b7f('0x26')](respondWithResult(_0x3eca99,null))[_0x4b7f('0x44')](handleError(_0x3eca99,null));};exports[_0x4b7f('0x49')]=function(_0x497eef,_0x5a86c9){return db[_0x4b7f('0x2d')][_0x4b7f('0x49')](_0x497eef[_0x4b7f('0x4a')],{})[_0x4b7f('0x26')](respondWithResult(_0x5a86c9,0xc9))[_0x4b7f('0x44')](handleError(_0x5a86c9,null));};exports[_0x4b7f('0x4b')]=function(_0x4d914a,_0x581750){if(_0x4d914a[_0x4b7f('0x4a')]['id']){delete _0x4d914a['body']['id'];}return db[_0x4b7f('0x2d')]['find']({'where':{'id':_0x4d914a[_0x4b7f('0x46')]['id']}})['then'](handleEntityNotFound(_0x581750,null))[_0x4b7f('0x26')](saveUpdates(_0x4d914a['body'],null))[_0x4b7f('0x26')](respondWithResult(_0x581750,null))[_0x4b7f('0x44')](handleError(_0x581750,null));};exports['destroy']=function(_0x26141f,_0x568ba8){return db[_0x4b7f('0x2d')]['find']({'where':{'id':_0x26141f[_0x4b7f('0x46')]['id']}})[_0x4b7f('0x26')](handleEntityNotFound(_0x568ba8,null))[_0x4b7f('0x26')](removeEntity(_0x568ba8,null))[_0x4b7f('0x44')](handleError(_0x568ba8,null));};exports[_0x4b7f('0x4c')]=function(_0xbfb775,_0x4c8f23){return db[_0x4b7f('0x2d')]['describe']()[_0x4b7f('0x26')](respondWithResult(_0x4c8f23,null))[_0x4b7f('0x44')](handleError(_0x4c8f23,null));}; \ No newline at end of file +var _0x0070=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x33e864,_0x2d8439){var _0x1787d7=function(_0x12b679){while(--_0x12b679){_0x33e864['push'](_0x33e864['shift']());}};_0x1787d7(++_0x2d8439);}(_0x0070,0x179));var _0x0007=function(_0x40f470,_0x3a5975){_0x40f470=_0x40f470-0x0;var _0x46ce5f=_0x0070[_0x40f470];return _0x46ce5f;};'use strict';var emlformat=require(_0x0007('0x0'));var rimraf=require(_0x0007('0x1'));var zipdir=require(_0x0007('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0007('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0007('0x4'));var util=require(_0x0007('0x5'));var path=require(_0x0007('0x6'));var sox=require(_0x0007('0x7'));var csv=require(_0x0007('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0007('0x9'));var _=require(_0x0007('0xa'));var squel=require(_0x0007('0xb'));var crypto=require(_0x0007('0xc'));var jsforce=require(_0x0007('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0007('0x8'));var querystring=require(_0x0007('0xe'));var Papa=require(_0x0007('0xf'));var Redis=require(_0x0007('0x10'));var authService=require(_0x0007('0x11'));var qs=require(_0x0007('0x12'));var as=require(_0x0007('0x13'));var hardwareService=require(_0x0007('0x14'));var logger=require(_0x0007('0x15'))(_0x0007('0x16'));var utils=require(_0x0007('0x17'));var config=require(_0x0007('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0007('0x19'))['db'];function respondWithStatusCode(_0x2f0cff,_0x493eaa){_0x493eaa=_0x493eaa||0xcc;return function(_0x4384a2){if(_0x4384a2){return _0x2f0cff['sendStatus'](_0x493eaa);}return _0x2f0cff[_0x0007('0x1a')](_0x493eaa)[_0x0007('0x1b')]();};}function respondWithResult(_0x34b175,_0x1a4c8d){_0x1a4c8d=_0x1a4c8d||0xc8;return function(_0x3331a5){if(_0x3331a5){return _0x34b175[_0x0007('0x1a')](_0x1a4c8d)[_0x0007('0x1c')](_0x3331a5);}};}function respondWithFilteredResult(_0x177407,_0x134d63){return function(_0x11119e){if(_0x11119e){var _0x353e71=typeof _0x134d63['offset']===_0x0007('0x1d')&&typeof _0x134d63[_0x0007('0x1e')]===_0x0007('0x1d');var _0x8912d1=_0x11119e[_0x0007('0x1f')];var _0x34e3aa=_0x353e71?0x0:_0x134d63[_0x0007('0x20')];var _0x2eca58=_0x353e71?_0x11119e[_0x0007('0x1f')]:_0x134d63[_0x0007('0x20')]+_0x134d63[_0x0007('0x1e')];var _0x5daf37;if(_0x2eca58>=_0x8912d1){_0x2eca58=_0x8912d1;_0x5daf37=0xc8;}else{_0x5daf37=0xce;}_0x177407[_0x0007('0x1a')](_0x5daf37);return _0x177407['set']('Content-Range',_0x34e3aa+'-'+_0x2eca58+'/'+_0x8912d1)[_0x0007('0x1c')](_0x11119e);}return null;};}function patchUpdates(_0x2ce4c1){return function(_0x310ee4){try{jsonpatch[_0x0007('0x21')](_0x310ee4,_0x2ce4c1,!![]);}catch(_0x38bcd3){return BPromise[_0x0007('0x22')](_0x38bcd3);}return _0x310ee4[_0x0007('0x23')]();};}function saveUpdates(_0x12c7a8,_0x5a8a19){return function(_0x19f82e){if(_0x19f82e){return _0x19f82e[_0x0007('0x24')](_0x12c7a8)[_0x0007('0x25')](function(_0x175ebc){return _0x175ebc;});}return null;};}function removeEntity(_0x5b567c,_0x1c7c3c){return function(_0x26f14d){if(_0x26f14d){return _0x26f14d[_0x0007('0x26')]()['then'](function(){_0x5b567c['status'](0xcc)[_0x0007('0x1b')]();});}};}function handleEntityNotFound(_0x2a5f9f,_0x537011){return function(_0x56ced5){if(!_0x56ced5){_0x2a5f9f[_0x0007('0x27')](0x194);}return _0x56ced5;};}function handleError(_0x5e47e5,_0x43ae4e){_0x43ae4e=_0x43ae4e||0x1f4;return function(_0xe70d66){logger[_0x0007('0x28')](_0xe70d66[_0x0007('0x29')]);if(_0xe70d66[_0x0007('0x2a')]){delete _0xe70d66[_0x0007('0x2a')];}_0x5e47e5['status'](_0x43ae4e)[_0x0007('0x2b')](_0xe70d66);};}exports[_0x0007('0x2c')]=function(_0x5e9287,_0x440a5e){var _0x2c9d63={},_0x195c72={},_0x2afd98={'count':0x0,'rows':[]};var _0x5a993=_[_0x0007('0x2d')](db[_0x0007('0x2e')][_0x0007('0x2f')],function(_0x21edb8){return{'name':_0x21edb8[_0x0007('0x30')],'type':_0x21edb8[_0x0007('0x31')][_0x0007('0x32')]};});_0x195c72[_0x0007('0x33')]=_[_0x0007('0x2d')](_0x5a993,_0x0007('0x2a'));_0x195c72['query']=_[_0x0007('0x34')](_0x5e9287[_0x0007('0x35')]);_0x195c72['filters']=_[_0x0007('0x36')](_0x195c72['model'],_0x195c72[_0x0007('0x35')]);_0x2c9d63[_0x0007('0x37')]=_['intersection'](_0x195c72['model'],qs[_0x0007('0x38')](_0x5e9287[_0x0007('0x35')]['fields']));_0x2c9d63['attributes']=_0x2c9d63[_0x0007('0x37')]['length']?_0x2c9d63[_0x0007('0x37')]:_0x195c72[_0x0007('0x33')];if(!_0x5e9287[_0x0007('0x35')][_0x0007('0x39')](_0x0007('0x3a'))){_0x2c9d63[_0x0007('0x1e')]=qs[_0x0007('0x1e')](_0x5e9287[_0x0007('0x35')][_0x0007('0x1e')]);_0x2c9d63['offset']=qs['offset'](_0x5e9287[_0x0007('0x35')][_0x0007('0x20')]);}_0x2c9d63[_0x0007('0x3b')]=qs[_0x0007('0x3c')](_0x5e9287['query'][_0x0007('0x3c')]);_0x2c9d63[_0x0007('0x3d')]=qs[_0x0007('0x3e')](_[_0x0007('0x3f')](_0x5e9287[_0x0007('0x35')],_0x195c72['filters']),_0x5a993);if(_0x5e9287[_0x0007('0x35')][_0x0007('0x40')]){_0x2c9d63[_0x0007('0x3d')]=_[_0x0007('0x41')](_0x2c9d63['where'],{'$or':_['map'](_0x5a993,function(_0x5352b3){if(_0x5352b3['type']!==_0x0007('0x42')){var _0x90b112={};_0x90b112[_0x5352b3['name']]={'$like':'%'+_0x5e9287['query'][_0x0007('0x40')]+'%'};return _0x90b112;}})});}_0x2c9d63=_[_0x0007('0x41')]({},_0x2c9d63,_0x5e9287[_0x0007('0x43')]);var _0x515eed={'where':_0x2c9d63[_0x0007('0x3d')]};return db['SquareReport'][_0x0007('0x1f')](_0x515eed)[_0x0007('0x25')](function(_0x24e751){_0x2afd98[_0x0007('0x1f')]=_0x24e751;if(_0x5e9287[_0x0007('0x35')][_0x0007('0x44')]){_0x2c9d63['include']=[{'all':!![]}];}return db['SquareReport'][_0x0007('0x45')](_0x2c9d63);})[_0x0007('0x25')](function(_0x1b1d98){_0x2afd98[_0x0007('0x46')]=_0x1b1d98;return _0x2afd98;})[_0x0007('0x25')](respondWithFilteredResult(_0x440a5e,_0x2c9d63))[_0x0007('0x47')](handleError(_0x440a5e,null));};exports[_0x0007('0x48')]=function(_0x5bddf2,_0x565836){var _0x1c0e20={'raw':!![],'where':{'id':_0x5bddf2[_0x0007('0x49')]['id']}},_0x596595={};_0x596595['model']=_[_0x0007('0x34')](db[_0x0007('0x2e')]['rawAttributes']);_0x596595['query']=_[_0x0007('0x34')](_0x5bddf2[_0x0007('0x35')]);_0x596595[_0x0007('0x3e')]=_[_0x0007('0x36')](_0x596595[_0x0007('0x33')],_0x596595[_0x0007('0x35')]);_0x1c0e20[_0x0007('0x37')]=_[_0x0007('0x36')](_0x596595[_0x0007('0x33')],qs[_0x0007('0x38')](_0x5bddf2[_0x0007('0x35')][_0x0007('0x38')]));_0x1c0e20[_0x0007('0x37')]=_0x1c0e20['attributes']['length']?_0x1c0e20[_0x0007('0x37')]:_0x596595[_0x0007('0x33')];if(_0x5bddf2[_0x0007('0x35')][_0x0007('0x44')]){_0x1c0e20[_0x0007('0x4a')]=[{'all':!![]}];}_0x1c0e20=_['merge']({},_0x1c0e20,_0x5bddf2['options']);return db[_0x0007('0x2e')][_0x0007('0x4b')](_0x1c0e20)[_0x0007('0x25')](handleEntityNotFound(_0x565836,null))['then'](respondWithResult(_0x565836,null))['catch'](handleError(_0x565836,null));};exports['create']=function(_0x9eea1b,_0x5657c3){return db[_0x0007('0x2e')][_0x0007('0x4c')](_0x9eea1b[_0x0007('0x4d')],{})[_0x0007('0x25')](respondWithResult(_0x5657c3,0xc9))[_0x0007('0x47')](handleError(_0x5657c3,null));};exports[_0x0007('0x24')]=function(_0x4eb666,_0x37aa46){if(_0x4eb666['body']['id']){delete _0x4eb666['body']['id'];}return db[_0x0007('0x2e')][_0x0007('0x4b')]({'where':{'id':_0x4eb666[_0x0007('0x49')]['id']}})[_0x0007('0x25')](handleEntityNotFound(_0x37aa46,null))[_0x0007('0x25')](saveUpdates(_0x4eb666['body'],null))[_0x0007('0x25')](respondWithResult(_0x37aa46,null))[_0x0007('0x47')](handleError(_0x37aa46,null));};exports[_0x0007('0x26')]=function(_0x2a2702,_0x40ecff){return db['SquareReport'][_0x0007('0x4b')]({'where':{'id':_0x2a2702[_0x0007('0x49')]['id']}})[_0x0007('0x25')](handleEntityNotFound(_0x40ecff,null))[_0x0007('0x25')](removeEntity(_0x40ecff,null))['catch'](handleError(_0x40ecff,null));};exports[_0x0007('0x4e')]=function(_0x4dd4cd,_0x17be08){return db[_0x0007('0x2e')][_0x0007('0x4e')]()[_0x0007('0x25')](respondWithResult(_0x17be08,null))[_0x0007('0x47')](handleError(_0x17be08,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 80a4ec9..778213e 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 _0xb4cf=['uid_pname','leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square'];(function(_0x3d4fa1,_0x1b25a6){var _0x3b2ea8=function(_0x21a951){while(--_0x21a951){_0x3d4fa1['push'](_0x3d4fa1['shift']());}};_0x3b2ea8(++_0x1b25a6);}(_0xb4cf,0x192));var _0xfb4c=function(_0x688f5a,_0x3a70a9){_0x688f5a=_0x688f5a-0x0;var _0x229031=_0xb4cf[_0x688f5a];return _0x229031;};'use strict';var _=require(_0xfb4c('0x0'));var util=require(_0xfb4c('0x1'));var logger=require(_0xfb4c('0x2'))('api');var moment=require(_0xfb4c('0x3'));var BPromise=require(_0xfb4c('0x4'));var rp=require(_0xfb4c('0x5'));var fs=require('fs');var path=require(_0xfb4c('0x6'));var rimraf=require(_0xfb4c('0x7'));var config=require(_0xfb4c('0x8'));var attributes=require(_0xfb4c('0x9'));module[_0xfb4c('0xa')]=function(_0xbc8d7,_0x3d93bd){return _0xbc8d7[_0xfb4c('0xb')](_0xfb4c('0xc'),attributes,{'tableName':_0xfb4c('0xd'),'paranoid':![],'indexes':[{'name':_0xfb4c('0xe'),'fields':['uniqueid','project_name']},{'name':_0xfb4c('0xf'),'fields':[_0xfb4c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x997f=['SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define'];(function(_0x7276bc,_0x33a080){var _0x576887=function(_0xd2d872){while(--_0xd2d872){_0x7276bc['push'](_0x7276bc['shift']());}};_0x576887(++_0x33a080);}(_0x997f,0x176));var _0xf997=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x997f[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xf997('0x0'));var util=require(_0xf997('0x1'));var logger=require('../../config/logger')(_0xf997('0x2'));var moment=require(_0xf997('0x3'));var BPromise=require(_0xf997('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf997('0x5'));var rimraf=require(_0xf997('0x6'));var config=require(_0xf997('0x7'));var attributes=require(_0xf997('0x8'));module['exports']=function(_0x4a77d3,_0xffb8fc){return _0x4a77d3[_0xf997('0x9')](_0xf997('0xa'),attributes,{'tableName':_0xf997('0xb'),'paranoid':![],'indexes':[{'name':_0xf997('0xc'),'fields':[_0xf997('0xd'),_0xf997('0xe')]},{'name':_0xf997('0xf'),'fields':[_0xf997('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0998a8f..149f5db 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 _0xa02f=['update','body','attributes','then','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateSquareReport','SquareReport','create','options','raw','debug','stringify','UpdateSquareReport'];(function(_0x2d9048,_0x4d0261){var _0x206444=function(_0x58af6f){while(--_0x58af6f){_0x2d9048['push'](_0x2d9048['shift']());}};_0x206444(++_0x4d0261);}(_0xa02f,0x84));var _0xfa02=function(_0x533fb1,_0x4a7ec3){_0x533fb1=_0x533fb1-0x0;var _0x25b456=_0xa02f[_0x533fb1];return _0x25b456;};'use strict';var _=require(_0xfa02('0x0'));var util=require(_0xfa02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa02('0x2'));var db=require(_0xfa02('0x3'))['db'];var utils=require(_0xfa02('0x4'));var logger=require(_0xfa02('0x5'))(_0xfa02('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa02('0x7'));var client=jayson[_0xfa02('0x8')][_0xfa02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce357,_0x5884bc,_0x451529){return new BPromise(function(_0x151ad5,_0x3f2de4){return client[_0xfa02('0xa')](_0x3ce357,_0x451529)['then'](function(_0x548bc5){logger['info'](_0xfa02('0xb'),_0x5884bc,_0xfa02('0xc'));logger['debug'](_0xfa02('0xd'),_0x5884bc,_0xfa02('0xc'),JSON['stringify'](_0x548bc5));if(_0x548bc5['error']){if(_0x548bc5['error'][_0xfa02('0xe')]===0x1f4){logger[_0xfa02('0xf')]('SquareReport,\x20%s,\x20%s',_0x5884bc,_0x548bc5['error'][_0xfa02('0x10')]);return _0x3f2de4(_0x548bc5[_0xfa02('0xf')][_0xfa02('0x10')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x5884bc,_0x548bc5[_0xfa02('0xf')][_0xfa02('0x10')]);return _0x151ad5(_0x548bc5[_0xfa02('0xf')][_0xfa02('0x10')]);}else{logger[_0xfa02('0x11')]('SquareReport,\x20%s,\x20%s',_0x5884bc,'request\x20sent');_0x151ad5(_0x548bc5[_0xfa02('0x12')][_0xfa02('0x10')]);}})[_0xfa02('0x13')](function(_0xe0eafd){logger[_0xfa02('0xf')](_0xfa02('0xb'),_0x5884bc,_0xe0eafd);_0x3f2de4(_0xe0eafd);});});}exports[_0xfa02('0x14')]=function(_0x41d292){var _0x205636=this;return new Promise(function(_0x49c868,_0x2187d8){return db[_0xfa02('0x15')][_0xfa02('0x16')](_0x41d292['body'],{'raw':_0x41d292[_0xfa02('0x17')]?_0x41d292[_0xfa02('0x17')][_0xfa02('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9c3793){logger[_0xfa02('0x11')](_0xfa02('0x14'),_0x41d292);logger[_0xfa02('0x19')](_0xfa02('0x14'),_0x41d292,JSON[_0xfa02('0x1a')](_0x9c3793));_0x49c868(_0x9c3793);})[_0xfa02('0x13')](function(_0x2d36f5){logger['error'](_0xfa02('0x14'),_0x2d36f5['message'],_0x41d292);_0x2187d8(_0x205636[_0xfa02('0xf')](0x1f4,_0x2d36f5[_0xfa02('0x10')]));});});};exports[_0xfa02('0x1b')]=function(_0x472943){var _0x28721e=this;return new Promise(function(_0x2f9eb4,_0x5acf30){return db[_0xfa02('0x15')][_0xfa02('0x1c')](_0x472943[_0xfa02('0x1d')],{'raw':_0x472943[_0xfa02('0x17')]?_0x472943['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472943[_0xfa02('0x17')]?_0x472943[_0xfa02('0x17')]['where']||null:null,'attributes':_0x472943[_0xfa02('0x17')]?_0x472943[_0xfa02('0x17')][_0xfa02('0x1e')]||null:null,'limit':_0x472943['options']?_0x472943[_0xfa02('0x17')]['limit']||null:null})[_0xfa02('0x1f')](function(_0x2699d7){logger[_0xfa02('0x11')]('UpdateSquareReport',_0x472943);logger[_0xfa02('0x19')](_0xfa02('0x1b'),_0x472943,JSON[_0xfa02('0x1a')](_0x2699d7));_0x2f9eb4(_0x2699d7);})[_0xfa02('0x13')](function(_0x568855){logger[_0xfa02('0xf')](_0xfa02('0x1b'),_0x568855[_0xfa02('0x10')],_0x472943);_0x5acf30(_0x28721e[_0xfa02('0xf')](0x1f4,_0x568855[_0xfa02('0x10')]));});});}; \ No newline at end of file +var _0x395e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','then','stringify','raw','where','attributes','limit','UpdateSquareReport','debug','util','moment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x395e,0x169));var _0xe395=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x395e[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xe395('0x0'));var moment=require(_0xe395('0x1'));var BPromise=require('bluebird');var rs=require(_0xe395('0x2'));var fs=require('fs');var Redis=require(_0xe395('0x3'));var db=require(_0xe395('0x4'))['db'];var utils=require(_0xe395('0x5'));var logger=require(_0xe395('0x6'))('rpc');var config=require(_0xe395('0x7'));var jayson=require(_0xe395('0x8'));var client=jayson[_0xe395('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126304,_0x3ff7b6,_0x280b0d){return new BPromise(function(_0x592ca9,_0x3bc9bb){return client[_0xe395('0xa')](_0x126304,_0x280b0d)['then'](function(_0x5d86f5){logger['info'](_0xe395('0xb'),_0x3ff7b6,'request\x20sent');logger['debug'](_0xe395('0xc'),_0x3ff7b6,_0xe395('0xd'),JSON['stringify'](_0x5d86f5));if(_0x5d86f5[_0xe395('0xe')]){if(_0x5d86f5[_0xe395('0xe')][_0xe395('0xf')]===0x1f4){logger[_0xe395('0xe')](_0xe395('0xb'),_0x3ff7b6,_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);return _0x3bc9bb(_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);}logger[_0xe395('0xe')]('SquareReport,\x20%s,\x20%s',_0x3ff7b6,_0x5d86f5[_0xe395('0xe')]['message']);return _0x592ca9(_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);}else{logger[_0xe395('0x11')](_0xe395('0xb'),_0x3ff7b6,'request\x20sent');_0x592ca9(_0x5d86f5[_0xe395('0x12')][_0xe395('0x10')]);}})[_0xe395('0x13')](function(_0x5ae26a){logger[_0xe395('0xe')](_0xe395('0xb'),_0x3ff7b6,_0x5ae26a);_0x3bc9bb(_0x5ae26a);});});}exports[_0xe395('0x14')]=function(_0x2b0361){var _0x5e4946=this;return new Promise(function(_0x500bb3,_0x5b4094){return db[_0xe395('0x15')][_0xe395('0x16')](_0x2b0361[_0xe395('0x17')],{'raw':_0x2b0361[_0xe395('0x18')]?_0x2b0361['options']['raw']===undefined?!![]:![]:!![]})[_0xe395('0x19')](function(_0x4247fb){logger['info'](_0xe395('0x14'),_0x2b0361);logger['debug'](_0xe395('0x14'),_0x2b0361,JSON[_0xe395('0x1a')](_0x4247fb));_0x500bb3(_0x4247fb);})[_0xe395('0x13')](function(_0x5022b3){logger[_0xe395('0xe')](_0xe395('0x14'),_0x5022b3['message'],_0x2b0361);_0x5b4094(_0x5e4946[_0xe395('0xe')](0x1f4,_0x5022b3[_0xe395('0x10')]));});});};exports['UpdateSquareReport']=function(_0x4df2af){var _0x4a57c4=this;return new Promise(function(_0x82f8c4,_0x286038){return db[_0xe395('0x15')]['update'](_0x4df2af[_0xe395('0x17')],{'raw':_0x4df2af['options']?_0x4df2af[_0xe395('0x18')][_0xe395('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4df2af[_0xe395('0x18')]?_0x4df2af[_0xe395('0x18')][_0xe395('0x1c')]||null:null,'attributes':_0x4df2af[_0xe395('0x18')]?_0x4df2af[_0xe395('0x18')][_0xe395('0x1d')]||null:null,'limit':_0x4df2af[_0xe395('0x18')]?_0x4df2af[_0xe395('0x18')][_0xe395('0x1e')]||null:null})[_0xe395('0x19')](function(_0x31dc2f){logger['info'](_0xe395('0x1f'),_0x4df2af);logger[_0xe395('0x20')](_0xe395('0x1f'),_0x4df2af,JSON[_0xe395('0x1a')](_0x31dc2f));_0x82f8c4(_0x31dc2f);})[_0xe395('0x13')](function(_0x135d30){logger['error'](_0xe395('0x1f'),_0x135d30[_0xe395('0x10')],_0x4df2af);_0x286038(_0x4a57c4[_0xe395('0xe')](0x1f4,_0x135d30[_0xe395('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4e20b7c..32c88e9 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 _0xb422=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete','/:id','multer','util','path'];(function(_0x53e7d9,_0x22a861){var _0x2647f7=function(_0x4ab1f3){while(--_0x4ab1f3){_0x53e7d9['push'](_0x53e7d9['shift']());}};_0x2647f7(++_0x22a861);}(_0xb422,0x1dd));var _0x2b42=function(_0x4c5034,_0x264da9){_0x4c5034=_0x4c5034-0x0;var _0x139f2f=_0xb422[_0x4c5034];return _0x139f2f;};'use strict';var multer=require(_0x2b42('0x0'));var util=require(_0x2b42('0x1'));var path=require(_0x2b42('0x2'));var timeout=require(_0x2b42('0x3'));var express=require(_0x2b42('0x4'));var router=express[_0x2b42('0x5')]();var fs_extra=require(_0x2b42('0x6'));var auth=require(_0x2b42('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b42('0x8'));router[_0x2b42('0x9')]('/',auth[_0x2b42('0xa')](),controller[_0x2b42('0xb')]);router['get'](_0x2b42('0xc'),auth[_0x2b42('0xa')](),controller[_0x2b42('0xd')]);router[_0x2b42('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2b42('0xe')]('/',auth[_0x2b42('0xa')](),controller[_0x2b42('0xf')]);router[_0x2b42('0x10')]('/:id',auth[_0x2b42('0xa')](),controller[_0x2b42('0x11')]);router[_0x2b42('0x12')](_0x2b42('0x13'),auth[_0x2b42('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf5b5=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller'];(function(_0x1f6eb2,_0x135e0c){var _0x559842=function(_0x43ffb9){while(--_0x43ffb9){_0x1f6eb2['push'](_0x1f6eb2['shift']());}};_0x559842(++_0x135e0c);}(_0xf5b5,0x10f));var _0x5f5b=function(_0x244563,_0x48f03c){_0x244563=_0x244563-0x0;var _0x148a93=_0xf5b5[_0x244563];return _0x148a93;};'use strict';var multer=require(_0x5f5b('0x0'));var util=require(_0x5f5b('0x1'));var path=require(_0x5f5b('0x2'));var timeout=require(_0x5f5b('0x3'));var express=require('express');var router=express[_0x5f5b('0x4')]();var fs_extra=require(_0x5f5b('0x5'));var auth=require(_0x5f5b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f5b('0x7'));var controller=require(_0x5f5b('0x8'));router[_0x5f5b('0x9')]('/',auth[_0x5f5b('0xa')](),controller[_0x5f5b('0xb')]);router['get'](_0x5f5b('0xc'),auth['isAuthenticated'](),controller[_0x5f5b('0xd')]);router[_0x5f5b('0x9')](_0x5f5b('0xe'),auth['isAuthenticated'](),controller[_0x5f5b('0xf')]);router[_0x5f5b('0x10')]('/',auth[_0x5f5b('0xa')](),controller['create']);router[_0x5f5b('0x11')](_0x5f5b('0xe'),auth[_0x5f5b('0xa')](),controller[_0x5f5b('0x12')]);router['delete'](_0x5f5b('0xe'),auth[_0x5f5b('0xa')](),controller['destroy']);module[_0x5f5b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index af8e2ab..0e622e0 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 _0x8187=['STRING','TEXT','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8187,0x10a));var _0x7818=function(_0xad83ce,_0x3ddd0c){_0xad83ce=_0xad83ce-0x0;var _0x30bbb5=_0x8187[_0xad83ce];return _0x30bbb5;};'use strict';var Sequelize=require(_0x7818('0x0'));module[_0x7818('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x7818('0x2')]},'application':{'type':Sequelize[_0x7818('0x2')]},'data':{'type':Sequelize[_0x7818('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7818('0x2')]}}; \ No newline at end of file +var _0x1d91=['STRING','sequelize','exports'];(function(_0x238dfb,_0x358d10){var _0x2aa7ea=function(_0x557de9){while(--_0x557de9){_0x238dfb['push'](_0x238dfb['shift']());}};_0x2aa7ea(++_0x358d10);}(_0x1d91,0xac));var _0x11d9=function(_0x2de3df,_0x4e7b03){_0x2de3df=_0x2de3df-0x0;var _0x387876=_0x1d91[_0x2de3df];return _0x387876;};'use strict';var Sequelize=require(_0x11d9('0x0'));module[_0x11d9('0x1')]={'uniqueid':{'type':Sequelize[_0x11d9('0x2')]},'node':{'type':Sequelize[_0x11d9('0x2')]},'application':{'type':Sequelize[_0x11d9('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x11d9('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 45dd163..342cf00 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 _0xa2ff=['order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x5efb9e,_0x47e288){var _0x571f58=function(_0x3f6a8){while(--_0x3f6a8){_0x5efb9e['push'](_0x5efb9e['shift']());}};_0x571f58(++_0x47e288);}(_0xa2ff,0x156));var _0xfa2f=function(_0x5c57e4,_0x530a2b){_0x5c57e4=_0x5c57e4-0x0;var _0x1d21e2=_0xa2ff[_0x5c57e4];return _0x1d21e2;};'use strict';var emlformat=require(_0xfa2f('0x0'));var rimraf=require(_0xfa2f('0x1'));var zipdir=require(_0xfa2f('0x2'));var jsonpatch=require(_0xfa2f('0x3'));var rp=require(_0xfa2f('0x4'));var moment=require(_0xfa2f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfa2f('0x6'));var util=require('util');var path=require(_0xfa2f('0x7'));var sox=require(_0xfa2f('0x8'));var csv=require(_0xfa2f('0x9'));var ejs=require(_0xfa2f('0xa'));var fs=require('fs');var fs_extra=require(_0xfa2f('0xb'));var _=require(_0xfa2f('0xc'));var squel=require(_0xfa2f('0xd'));var crypto=require(_0xfa2f('0xe'));var jsforce=require(_0xfa2f('0xf'));var deskjs=require(_0xfa2f('0x10'));var toCsv=require(_0xfa2f('0x9'));var querystring=require('querystring');var Papa=require(_0xfa2f('0x11'));var Redis=require(_0xfa2f('0x12'));var authService=require(_0xfa2f('0x13'));var qs=require(_0xfa2f('0x14'));var as=require(_0xfa2f('0x15'));var hardwareService=require(_0xfa2f('0x16'));var logger=require(_0xfa2f('0x17'))('api');var utils=require(_0xfa2f('0x18'));var config=require(_0xfa2f('0x19'));var licenseUtil=require(_0xfa2f('0x1a'));var db=require(_0xfa2f('0x1b'))['db'];function respondWithStatusCode(_0x3ea8d3,_0x57b131){_0x57b131=_0x57b131||0xcc;return function(_0x398cb8){if(_0x398cb8){return _0x3ea8d3[_0xfa2f('0x1c')](_0x57b131);}return _0x3ea8d3[_0xfa2f('0x1d')](_0x57b131)[_0xfa2f('0x1e')]();};}function respondWithResult(_0x273a32,_0x542916){_0x542916=_0x542916||0xc8;return function(_0x399a28){if(_0x399a28){return _0x273a32[_0xfa2f('0x1d')](_0x542916)[_0xfa2f('0x1f')](_0x399a28);}};}function respondWithFilteredResult(_0x5ad83b,_0x2c455c){return function(_0x58e75a){if(_0x58e75a){var _0x3f7d23=typeof _0x2c455c['offset']===_0xfa2f('0x20')&&typeof _0x2c455c['limit']===_0xfa2f('0x20');var _0x2636fb=_0x58e75a['count'];var _0xba2a9b=_0x3f7d23?0x0:_0x2c455c[_0xfa2f('0x21')];var _0x25acaa=_0x3f7d23?_0x58e75a[_0xfa2f('0x22')]:_0x2c455c[_0xfa2f('0x21')]+_0x2c455c[_0xfa2f('0x23')];var _0x4da92f;if(_0x25acaa>=_0x2636fb){_0x25acaa=_0x2636fb;_0x4da92f=0xc8;}else{_0x4da92f=0xce;}_0x5ad83b['status'](_0x4da92f);return _0x5ad83b[_0xfa2f('0x24')](_0xfa2f('0x25'),_0xba2a9b+'-'+_0x25acaa+'/'+_0x2636fb)['json'](_0x58e75a);}return null;};}function patchUpdates(_0x5b31a7){return function(_0x53f40c){try{jsonpatch[_0xfa2f('0x26')](_0x53f40c,_0x5b31a7,!![]);}catch(_0x489f4b){return BPromise[_0xfa2f('0x27')](_0x489f4b);}return _0x53f40c[_0xfa2f('0x28')]();};}function saveUpdates(_0x421e0a,_0x483c51){return function(_0x357acd){if(_0x357acd){return _0x357acd['update'](_0x421e0a)['then'](function(_0x27533c){return _0x27533c;});}return null;};}function removeEntity(_0x223895,_0x1c6a6c){return function(_0x49babf){if(_0x49babf){return _0x49babf[_0xfa2f('0x29')]()[_0xfa2f('0x2a')](function(){_0x223895[_0xfa2f('0x1d')](0xcc)[_0xfa2f('0x1e')]();});}};}function handleEntityNotFound(_0xf1ea25,_0x2133fd){return function(_0x3dfbc8){if(!_0x3dfbc8){_0xf1ea25[_0xfa2f('0x1c')](0x194);}return _0x3dfbc8;};}function handleError(_0x45cdfb,_0x106f1c){_0x106f1c=_0x106f1c||0x1f4;return function(_0x27dc0e){logger[_0xfa2f('0x2b')](_0x27dc0e[_0xfa2f('0x2c')]);if(_0x27dc0e['name']){delete _0x27dc0e[_0xfa2f('0x2d')];}_0x45cdfb[_0xfa2f('0x1d')](_0x106f1c)[_0xfa2f('0x2e')](_0x27dc0e);};}exports[_0xfa2f('0x2f')]=function(_0x5ac1e3,_0x2913d9){var _0xcb2ac9={},_0x343274={},_0x411d38={'count':0x0,'rows':[]};var _0x1125cd=_[_0xfa2f('0x30')](db[_0xfa2f('0x31')][_0xfa2f('0x32')],function(_0x46979e){return{'name':_0x46979e['fieldName'],'type':_0x46979e[_0xfa2f('0x33')][_0xfa2f('0x34')]};});_0x343274[_0xfa2f('0x35')]=_[_0xfa2f('0x30')](_0x1125cd,_0xfa2f('0x2d'));_0x343274[_0xfa2f('0x36')]=_[_0xfa2f('0x37')](_0x5ac1e3[_0xfa2f('0x36')]);_0x343274[_0xfa2f('0x38')]=_[_0xfa2f('0x39')](_0x343274[_0xfa2f('0x35')],_0x343274['query']);_0xcb2ac9['attributes']=_[_0xfa2f('0x39')](_0x343274['model'],qs[_0xfa2f('0x3a')](_0x5ac1e3['query'][_0xfa2f('0x3a')]));_0xcb2ac9[_0xfa2f('0x3b')]=_0xcb2ac9[_0xfa2f('0x3b')][_0xfa2f('0x3c')]?_0xcb2ac9[_0xfa2f('0x3b')]:_0x343274[_0xfa2f('0x35')];if(!_0x5ac1e3[_0xfa2f('0x36')][_0xfa2f('0x3d')](_0xfa2f('0x3e'))){_0xcb2ac9[_0xfa2f('0x23')]=qs['limit'](_0x5ac1e3[_0xfa2f('0x36')][_0xfa2f('0x23')]);_0xcb2ac9['offset']=qs['offset'](_0x5ac1e3['query']['offset']);}_0xcb2ac9[_0xfa2f('0x3f')]=qs[_0xfa2f('0x40')](_0x5ac1e3[_0xfa2f('0x36')]['sort']);_0xcb2ac9[_0xfa2f('0x41')]=qs[_0xfa2f('0x38')](_[_0xfa2f('0x42')](_0x5ac1e3[_0xfa2f('0x36')],_0x343274[_0xfa2f('0x38')]),_0x1125cd);if(_0x5ac1e3[_0xfa2f('0x36')]['filter']){_0xcb2ac9['where']=_[_0xfa2f('0x43')](_0xcb2ac9[_0xfa2f('0x41')],{'$or':_[_0xfa2f('0x30')](_0x1125cd,function(_0x75e27){if(_0x75e27[_0xfa2f('0x33')]!==_0xfa2f('0x44')){var _0x33663a={};_0x33663a[_0x75e27['name']]={'$like':'%'+_0x5ac1e3[_0xfa2f('0x36')][_0xfa2f('0x45')]+'%'};return _0x33663a;}})});}_0xcb2ac9=_[_0xfa2f('0x43')]({},_0xcb2ac9,_0x5ac1e3['options']);var _0x14dc7a={'where':_0xcb2ac9[_0xfa2f('0x41')]};return db[_0xfa2f('0x31')][_0xfa2f('0x22')](_0x14dc7a)[_0xfa2f('0x2a')](function(_0x476ea1){_0x411d38[_0xfa2f('0x22')]=_0x476ea1;if(_0x5ac1e3[_0xfa2f('0x36')]['includeAll']){_0xcb2ac9[_0xfa2f('0x46')]=[{'all':!![]}];}return db[_0xfa2f('0x31')][_0xfa2f('0x47')](_0xcb2ac9);})['then'](function(_0xc76278){_0x411d38[_0xfa2f('0x48')]=_0xc76278;return _0x411d38;})['then'](respondWithFilteredResult(_0x2913d9,_0xcb2ac9))[_0xfa2f('0x49')](handleError(_0x2913d9,null));};exports[_0xfa2f('0x4a')]=function(_0x51ce96,_0x221cf7){var _0x312925={'raw':!![],'where':{'id':_0x51ce96[_0xfa2f('0x4b')]['id']}},_0xeeccae={};_0xeeccae['model']=_[_0xfa2f('0x37')](db[_0xfa2f('0x31')][_0xfa2f('0x32')]);_0xeeccae[_0xfa2f('0x36')]=_[_0xfa2f('0x37')](_0x51ce96['query']);_0xeeccae[_0xfa2f('0x38')]=_[_0xfa2f('0x39')](_0xeeccae[_0xfa2f('0x35')],_0xeeccae['query']);_0x312925['attributes']=_[_0xfa2f('0x39')](_0xeeccae[_0xfa2f('0x35')],qs[_0xfa2f('0x3a')](_0x51ce96[_0xfa2f('0x36')][_0xfa2f('0x3a')]));_0x312925[_0xfa2f('0x3b')]=_0x312925[_0xfa2f('0x3b')]['length']?_0x312925[_0xfa2f('0x3b')]:_0xeeccae['model'];if(_0x51ce96['query'][_0xfa2f('0x4c')]){_0x312925[_0xfa2f('0x46')]=[{'all':!![]}];}_0x312925=_[_0xfa2f('0x43')]({},_0x312925,_0x51ce96['options']);return db[_0xfa2f('0x31')][_0xfa2f('0x4d')](_0x312925)[_0xfa2f('0x2a')](handleEntityNotFound(_0x221cf7,null))['then'](respondWithResult(_0x221cf7,null))[_0xfa2f('0x49')](handleError(_0x221cf7,null));};exports[_0xfa2f('0x4e')]=function(_0x16160c,_0x7edc6b){return db[_0xfa2f('0x31')]['create'](_0x16160c[_0xfa2f('0x4f')],{})['then'](respondWithResult(_0x7edc6b,0xc9))[_0xfa2f('0x49')](handleError(_0x7edc6b,null));};exports[_0xfa2f('0x50')]=function(_0x1d09ae,_0x29dcaa){if(_0x1d09ae['body']['id']){delete _0x1d09ae['body']['id'];}return db[_0xfa2f('0x31')][_0xfa2f('0x4d')]({'where':{'id':_0x1d09ae[_0xfa2f('0x4b')]['id']}})[_0xfa2f('0x2a')](handleEntityNotFound(_0x29dcaa,null))[_0xfa2f('0x2a')](saveUpdates(_0x1d09ae['body'],null))['then'](respondWithResult(_0x29dcaa,null))[_0xfa2f('0x49')](handleError(_0x29dcaa,null));};exports[_0xfa2f('0x29')]=function(_0x2530bf,_0x12a6ee){return db[_0xfa2f('0x31')][_0xfa2f('0x4d')]({'where':{'id':_0x2530bf['params']['id']}})[_0xfa2f('0x2a')](handleEntityNotFound(_0x12a6ee,null))['then'](removeEntity(_0x12a6ee,null))[_0xfa2f('0x49')](handleError(_0x12a6ee,null));};exports['describe']=function(_0x522906,_0x14a734){return db['SquareDetailsReport']['describe']()[_0xfa2f('0x2a')](respondWithResult(_0x14a734,null))[_0xfa2f('0x49')](handleError(_0x14a734,null));}; \ No newline at end of file +var _0xc74b=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0xc74b,0x88));var _0xbc74=function(_0x5a942f,_0x5d4cb1){_0x5a942f=_0x5a942f-0x0;var _0x1569e3=_0xc74b[_0x5a942f];return _0x1569e3;};'use strict';var emlformat=require(_0xbc74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc74('0x1'));var jsonpatch=require(_0xbc74('0x2'));var rp=require(_0xbc74('0x3'));var moment=require(_0xbc74('0x4'));var BPromise=require(_0xbc74('0x5'));var Mustache=require(_0xbc74('0x6'));var util=require(_0xbc74('0x7'));var path=require(_0xbc74('0x8'));var sox=require(_0xbc74('0x9'));var csv=require(_0xbc74('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc74('0xb'));var _=require(_0xbc74('0xc'));var squel=require(_0xbc74('0xd'));var crypto=require(_0xbc74('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbc74('0xf'));var toCsv=require(_0xbc74('0xa'));var querystring=require(_0xbc74('0x10'));var Papa=require(_0xbc74('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc74('0x12'));var as=require(_0xbc74('0x13'));var hardwareService=require(_0xbc74('0x14'));var logger=require('../../config/logger')(_0xbc74('0x15'));var utils=require(_0xbc74('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbc74('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xed5491,_0x4f216c){_0x4f216c=_0x4f216c||0xcc;return function(_0x3e9480){if(_0x3e9480){return _0xed5491[_0xbc74('0x18')](_0x4f216c);}return _0xed5491[_0xbc74('0x19')](_0x4f216c)[_0xbc74('0x1a')]();};}function respondWithResult(_0x7d81f3,_0x14ed3e){_0x14ed3e=_0x14ed3e||0xc8;return function(_0x4f2543){if(_0x4f2543){return _0x7d81f3['status'](_0x14ed3e)['json'](_0x4f2543);}};}function respondWithFilteredResult(_0x571b2e,_0x5f21de){return function(_0xcd6cbf){if(_0xcd6cbf){var _0x2eedf6=typeof _0x5f21de[_0xbc74('0x1b')]===_0xbc74('0x1c')&&typeof _0x5f21de['limit']==='undefined';var _0x24e7bf=_0xcd6cbf[_0xbc74('0x1d')];var _0x397abe=_0x2eedf6?0x0:_0x5f21de['offset'];var _0x139cbc=_0x2eedf6?_0xcd6cbf[_0xbc74('0x1d')]:_0x5f21de[_0xbc74('0x1b')]+_0x5f21de[_0xbc74('0x1e')];var _0x5b9f2b;if(_0x139cbc>=_0x24e7bf){_0x139cbc=_0x24e7bf;_0x5b9f2b=0xc8;}else{_0x5b9f2b=0xce;}_0x571b2e[_0xbc74('0x19')](_0x5b9f2b);return _0x571b2e['set'](_0xbc74('0x1f'),_0x397abe+'-'+_0x139cbc+'/'+_0x24e7bf)['json'](_0xcd6cbf);}return null;};}function patchUpdates(_0x48c7a8){return function(_0x1f18ad){try{jsonpatch[_0xbc74('0x20')](_0x1f18ad,_0x48c7a8,!![]);}catch(_0x40d50b){return BPromise[_0xbc74('0x21')](_0x40d50b);}return _0x1f18ad['save']();};}function saveUpdates(_0x4ba4d5,_0x3afdbb){return function(_0x431249){if(_0x431249){return _0x431249['update'](_0x4ba4d5)[_0xbc74('0x22')](function(_0x3066d6){return _0x3066d6;});}return null;};}function removeEntity(_0x493c9f,_0x552044){return function(_0x5a2b67){if(_0x5a2b67){return _0x5a2b67[_0xbc74('0x23')]()[_0xbc74('0x22')](function(){_0x493c9f[_0xbc74('0x19')](0xcc)[_0xbc74('0x1a')]();});}};}function handleEntityNotFound(_0x2ce013,_0x302e21){return function(_0x27d8b2){if(!_0x27d8b2){_0x2ce013['sendStatus'](0x194);}return _0x27d8b2;};}function handleError(_0x5398b0,_0x45701d){_0x45701d=_0x45701d||0x1f4;return function(_0x2db869){logger[_0xbc74('0x24')](_0x2db869[_0xbc74('0x25')]);if(_0x2db869['name']){delete _0x2db869[_0xbc74('0x26')];}_0x5398b0[_0xbc74('0x19')](_0x45701d)[_0xbc74('0x27')](_0x2db869);};}exports['index']=function(_0x14a54f,_0x1ce80b){var _0xb6fbf8={},_0x4d6adc={},_0x52497f={'count':0x0,'rows':[]};var _0x10a897=_[_0xbc74('0x28')](db[_0xbc74('0x29')][_0xbc74('0x2a')],function(_0x39195c){return{'name':_0x39195c[_0xbc74('0x2b')],'type':_0x39195c[_0xbc74('0x2c')]['key']};});_0x4d6adc[_0xbc74('0x2d')]=_[_0xbc74('0x28')](_0x10a897,'name');_0x4d6adc[_0xbc74('0x2e')]=_['keys'](_0x14a54f['query']);_0x4d6adc['filters']=_[_0xbc74('0x2f')](_0x4d6adc[_0xbc74('0x2d')],_0x4d6adc[_0xbc74('0x2e')]);_0xb6fbf8[_0xbc74('0x30')]=_['intersection'](_0x4d6adc[_0xbc74('0x2d')],qs[_0xbc74('0x31')](_0x14a54f[_0xbc74('0x2e')]['fields']));_0xb6fbf8[_0xbc74('0x30')]=_0xb6fbf8[_0xbc74('0x30')]['length']?_0xb6fbf8[_0xbc74('0x30')]:_0x4d6adc[_0xbc74('0x2d')];if(!_0x14a54f['query'][_0xbc74('0x32')](_0xbc74('0x33'))){_0xb6fbf8[_0xbc74('0x1e')]=qs[_0xbc74('0x1e')](_0x14a54f[_0xbc74('0x2e')][_0xbc74('0x1e')]);_0xb6fbf8[_0xbc74('0x1b')]=qs[_0xbc74('0x1b')](_0x14a54f[_0xbc74('0x2e')][_0xbc74('0x1b')]);}_0xb6fbf8[_0xbc74('0x34')]=qs[_0xbc74('0x35')](_0x14a54f['query']['sort']);_0xb6fbf8[_0xbc74('0x36')]=qs[_0xbc74('0x37')](_[_0xbc74('0x38')](_0x14a54f[_0xbc74('0x2e')],_0x4d6adc[_0xbc74('0x37')]),_0x10a897);if(_0x14a54f[_0xbc74('0x2e')][_0xbc74('0x39')]){_0xb6fbf8['where']=_[_0xbc74('0x3a')](_0xb6fbf8['where'],{'$or':_[_0xbc74('0x28')](_0x10a897,function(_0x46fd23){if(_0x46fd23[_0xbc74('0x2c')]!==_0xbc74('0x3b')){var _0x5e9c1a={};_0x5e9c1a[_0x46fd23[_0xbc74('0x26')]]={'$like':'%'+_0x14a54f[_0xbc74('0x2e')][_0xbc74('0x39')]+'%'};return _0x5e9c1a;}})});}_0xb6fbf8=_['merge']({},_0xb6fbf8,_0x14a54f[_0xbc74('0x3c')]);var _0x4fe547={'where':_0xb6fbf8['where']};return db[_0xbc74('0x29')][_0xbc74('0x1d')](_0x4fe547)[_0xbc74('0x22')](function(_0x2c809a){_0x52497f[_0xbc74('0x1d')]=_0x2c809a;if(_0x14a54f[_0xbc74('0x2e')][_0xbc74('0x3d')]){_0xb6fbf8[_0xbc74('0x3e')]=[{'all':!![]}];}return db[_0xbc74('0x29')][_0xbc74('0x3f')](_0xb6fbf8);})['then'](function(_0x18b4ed){_0x52497f[_0xbc74('0x40')]=_0x18b4ed;return _0x52497f;})[_0xbc74('0x22')](respondWithFilteredResult(_0x1ce80b,_0xb6fbf8))[_0xbc74('0x41')](handleError(_0x1ce80b,null));};exports[_0xbc74('0x42')]=function(_0x54ec9f,_0x258f51){var _0x357c98={'raw':!![],'where':{'id':_0x54ec9f[_0xbc74('0x43')]['id']}},_0xc726e5={};_0xc726e5['model']=_[_0xbc74('0x44')](db[_0xbc74('0x29')]['rawAttributes']);_0xc726e5[_0xbc74('0x2e')]=_['keys'](_0x54ec9f[_0xbc74('0x2e')]);_0xc726e5[_0xbc74('0x37')]=_[_0xbc74('0x2f')](_0xc726e5[_0xbc74('0x2d')],_0xc726e5['query']);_0x357c98[_0xbc74('0x30')]=_[_0xbc74('0x2f')](_0xc726e5['model'],qs[_0xbc74('0x31')](_0x54ec9f['query'][_0xbc74('0x31')]));_0x357c98['attributes']=_0x357c98[_0xbc74('0x30')][_0xbc74('0x45')]?_0x357c98[_0xbc74('0x30')]:_0xc726e5[_0xbc74('0x2d')];if(_0x54ec9f[_0xbc74('0x2e')][_0xbc74('0x3d')]){_0x357c98[_0xbc74('0x3e')]=[{'all':!![]}];}_0x357c98=_[_0xbc74('0x3a')]({},_0x357c98,_0x54ec9f[_0xbc74('0x3c')]);return db['SquareDetailsReport'][_0xbc74('0x46')](_0x357c98)[_0xbc74('0x22')](handleEntityNotFound(_0x258f51,null))[_0xbc74('0x22')](respondWithResult(_0x258f51,null))[_0xbc74('0x41')](handleError(_0x258f51,null));};exports['create']=function(_0xd3b6e6,_0x20381a){return db['SquareDetailsReport'][_0xbc74('0x47')](_0xd3b6e6[_0xbc74('0x48')],{})['then'](respondWithResult(_0x20381a,0xc9))[_0xbc74('0x41')](handleError(_0x20381a,null));};exports['update']=function(_0x32c115,_0x4ff772){if(_0x32c115[_0xbc74('0x48')]['id']){delete _0x32c115[_0xbc74('0x48')]['id'];}return db[_0xbc74('0x29')][_0xbc74('0x46')]({'where':{'id':_0x32c115['params']['id']}})[_0xbc74('0x22')](handleEntityNotFound(_0x4ff772,null))[_0xbc74('0x22')](saveUpdates(_0x32c115[_0xbc74('0x48')],null))[_0xbc74('0x22')](respondWithResult(_0x4ff772,null))[_0xbc74('0x41')](handleError(_0x4ff772,null));};exports[_0xbc74('0x23')]=function(_0x6a2c1f,_0x40712a){return db[_0xbc74('0x29')][_0xbc74('0x46')]({'where':{'id':_0x6a2c1f[_0xbc74('0x43')]['id']}})[_0xbc74('0x22')](handleEntityNotFound(_0x40712a,null))['then'](removeEntity(_0x40712a,null))[_0xbc74('0x41')](handleError(_0x40712a,null));};exports[_0xbc74('0x49')]=function(_0x45d8d4,_0x50010c){return db['SquareDetailsReport'][_0xbc74('0x49')]()[_0xbc74('0x22')](respondWithResult(_0x50010c,null))[_0xbc74('0x41')](handleError(_0x50010c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 7475c1c..326b90a 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 _0x607e=['exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x607e,0xdb));var _0xe607=function(_0xc18746,_0x7387a9){_0xc18746=_0xc18746-0x0;var _0x56c6cd=_0x607e[_0xc18746];return _0x56c6cd;};'use strict';var _=require(_0xe607('0x0'));var util=require(_0xe607('0x1'));var logger=require(_0xe607('0x2'))(_0xe607('0x3'));var moment=require(_0xe607('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe607('0x5'));var rimraf=require(_0xe607('0x6'));var config=require(_0xe607('0x7'));var attributes=require(_0xe607('0x8'));module[_0xe607('0x9')]=function(_0x5bcab8,_0x5e3d32){return _0x5bcab8['define'](_0xe607('0xa'),attributes,{'tableName':_0xe607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf59e=['define','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x40c010,_0x4e903d){var _0x17921b=function(_0x1f094f){while(--_0x1f094f){_0x40c010['push'](_0x40c010['shift']());}};_0x17921b(++_0x4e903d);}(_0xf59e,0xf3));var _0xef59=function(_0xb34695,_0x26f961){_0xb34695=_0xb34695-0x0;var _0x3e4005=_0xf59e[_0xb34695];return _0x3e4005;};'use strict';var _=require(_0xef59('0x0'));var util=require(_0xef59('0x1'));var logger=require(_0xef59('0x2'))(_0xef59('0x3'));var moment=require(_0xef59('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef59('0x5'));var rimraf=require(_0xef59('0x6'));var config=require(_0xef59('0x7'));var attributes=require(_0xef59('0x8'));module[_0xef59('0x9')]=function(_0x5113eb,_0x55ef87){return _0x5113eb[_0xef59('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7ed1776..ffbea23 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 _0x056b=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x342b4d,_0x30bba9){var _0x4f3fdb=function(_0x5f23ad){while(--_0x5f23ad){_0x342b4d['push'](_0x342b4d['shift']());}};_0x4f3fdb(++_0x30bba9);}(_0x056b,0xb6));var _0xb056=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0x056b[_0x4b6507];return _0x2001ec;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateSquareDetailsReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateSquareDetailsReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});}; \ No newline at end of file +var _0x531a=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x5a038c,_0x383677){var _0x36ffe5=function(_0x408490){while(--_0x408490){_0x5a038c['push'](_0x5a038c['shift']());}};_0x36ffe5(++_0x383677);}(_0x531a,0x100));var _0xa531=function(_0x21e3d5,_0x443510){_0x21e3d5=_0x21e3d5-0x0;var _0x37fff5=_0x531a[_0x21e3d5];return _0x37fff5;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}exports[_0xa531('0x19')]=function(_0x5124a1){var _0x412b84=this;return new Promise(function(_0x146013,_0x4fb62e){return db['SquareDetailsReport'][_0xa531('0x1a')](_0x5124a1[_0xa531('0x1b')],{'raw':_0x5124a1[_0xa531('0x1c')]?_0x5124a1['options'][_0xa531('0x1d')]===undefined?!![]:![]:!![]})[_0xa531('0xd')](function(_0x4096f0){logger['info'](_0xa531('0x19'),_0x5124a1);logger[_0xa531('0x11')]('CreateSquareDetailsReport',_0x5124a1,JSON[_0xa531('0x13')](_0x4096f0));_0x146013(_0x4096f0);})[_0xa531('0x18')](function(_0x3a2016){logger[_0xa531('0x14')](_0xa531('0x19'),_0x3a2016[_0xa531('0x16')],_0x5124a1);_0x4fb62e(_0x412b84[_0xa531('0x14')](0x1f4,_0x3a2016[_0xa531('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 94d793c..e7239c5 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 _0x60a7=['get','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x21a7aa,_0x2248dc){var _0x20c622=function(_0x464a2b){while(--_0x464a2b){_0x21a7aa['push'](_0x21a7aa['shift']());}};_0x20c622(++_0x2248dc);}(_0x60a7,0x1d1));var _0x760a=function(_0x99e676,_0x36cdc8){_0x99e676=_0x99e676-0x0;var _0x692bc5=_0x60a7[_0x99e676];return _0x692bc5;};'use strict';var express=require(_0x760a('0x0'));var router=express[_0x760a('0x1')]();var auth=require(_0x760a('0x2'));var controller=require(_0x760a('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x760a('0x4')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x760a('0x5')]);module[_0x760a('0x6')]=router; \ No newline at end of file +var _0x07d9=['index','killProcess','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x07d9,0x17c));var _0x907d=function(_0x1b2243,_0x190b30){_0x1b2243=_0x1b2243-0x0;var _0x5df63d=_0x07d9[_0x1b2243];return _0x5df63d;};'use strict';var express=require('express');var router=express[_0x907d('0x0')]();var auth=require(_0x907d('0x1'));var controller=require(_0x907d('0x2'));router[_0x907d('0x3')]('/',auth[_0x907d('0x4')](),controller[_0x907d('0x5')]);router[_0x907d('0x3')]('/process/:pid/kill',auth[_0x907d('0x4')](),controller[_0x907d('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index b90fe38..74acefa 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 _0xb396=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','format','catch','killProcess','exec','../../config/logger','api','util'];(function(_0x31b147,_0x418fab){var _0x37a4bf=function(_0xcff27d){while(--_0xcff27d){_0x31b147['push'](_0x31b147['shift']());}};_0x37a4bf(++_0x418fab);}(_0xb396,0x168));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x6b39('0x0')];var logger=require(_0x6b39('0x1'))(_0x6b39('0x2'));var util=require(_0x6b39('0x3'));var BPromise=require(_0x6b39('0x4'));var _=require(_0x6b39('0x5'));function handleError(_0x367c4b,_0x59985d,_0x3639e8){_0x59985d=_0x59985d||0x1f4;return function(_0x395a95){logger[_0x6b39('0x6')](_0x6b39('0x7'),_0x3639e8,_0x59985d,util[_0x6b39('0x8')](_0x395a95,{'showHidden':![],'depth':null}));delete _0x395a95[_0x6b39('0x9')];_0x367c4b[_0x6b39('0xa')](_0x59985d)[_0x6b39('0xb')](_0x395a95);};}exports[_0x6b39('0xc')]=function(_0x317612,_0x24b1bf){return info[_0x6b39('0xd')]()[_0x6b39('0xe')](function(_0x56d019){return _0x24b1bf[_0x6b39('0xa')](0xc8)['json'](_0x56d019);})['catch'](function(_0x5397b5){return _0x24b1bf[_0x6b39('0xa')](0x1f4)[_0x6b39('0xf')](_0x5397b5);});};exports['killProcess']=function(_0x16b3a5,_0x3dbf9c){var _0x24a562=[_0x6b39('0x10')];return new BPromise(function(_0x30d11b,_0x40ccd1){return exec(util['format'](_0x6b39('0x11'),_0x16b3a5[_0x6b39('0x12')][_0x6b39('0x13')]),function(_0x40ed5d,_0x22b897,_0x59c1c6){if(_0x40ed5d){return _0x40ccd1(_0x40ed5d);}return _0x30d11b(_0x22b897);});})['then'](function(_0x2f1f68){var _0x327e8f=![];var _0x54013c=_0x2f1f68[_0x6b39('0x14')](/\n/);for(var _0x1511b7=0x0,_0x2930f9=_0x24a562[_0x6b39('0x15')];_0x1511b7<_0x2930f9,_0x327e8f===![];_0x1511b7+=0x1){if(_0x2f1f68[_0x6b39('0x16')](_0x24a562[_0x1511b7])>=0x0){_0x327e8f=!![];}}if(!_0x327e8f){throw new Error(util['format'](_0x6b39('0x17'),_0x16b3a5[_0x6b39('0x12')][_0x6b39('0x13')]));}process[_0x6b39('0x18')](_0x16b3a5[_0x6b39('0x12')][_0x6b39('0x13')],'SIGINT');return _0x3dbf9c['status'](0xc8)['json']({'message':util[_0x6b39('0x19')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x16b3a5[_0x6b39('0x12')][_0x6b39('0x13')])});})[_0x6b39('0x1a')](handleError(_0x3dbf9c,null,_0x6b39('0x1b')));}; \ No newline at end of file +var _0x60bf=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','then','json','catch','components/import/cm'];(function(_0x3412fc,_0x29f1e5){var _0xb8346e=function(_0x16f5d9){while(--_0x16f5d9){_0x3412fc['push'](_0x3412fc['shift']());}};_0xb8346e(++_0x29f1e5);}(_0x60bf,0x1dd));var _0xf60b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x60bf[_0x187ee1];return _0x388160;};'use strict';var info=require(_0xf60b('0x0'));var exec=require(_0xf60b('0x1'))[_0xf60b('0x2')];var logger=require(_0xf60b('0x3'))('api');var util=require(_0xf60b('0x4'));var BPromise=require(_0xf60b('0x5'));var _=require(_0xf60b('0x6'));function handleError(_0x548ed7,_0x42d5e5,_0x4acdde){_0x42d5e5=_0x42d5e5||0x1f4;return function(_0x59476e){logger[_0xf60b('0x7')](_0xf60b('0x8'),_0x4acdde,_0x42d5e5,util['inspect'](_0x59476e,{'showHidden':![],'depth':null}));delete _0x59476e[_0xf60b('0x9')];_0x548ed7[_0xf60b('0xa')](_0x42d5e5)['send'](_0x59476e);};}exports[_0xf60b('0xb')]=function(_0x56eea1,_0x4bc455){return info[_0xf60b('0xc')]()[_0xf60b('0xd')](function(_0x3435f3){return _0x4bc455[_0xf60b('0xa')](0xc8)[_0xf60b('0xe')](_0x3435f3);})[_0xf60b('0xf')](function(_0x19d4b4){return _0x4bc455[_0xf60b('0xa')](0x1f4)[_0xf60b('0xe')](_0x19d4b4);});};exports['killProcess']=function(_0x473122,_0x5c823d){var _0x385dad=[_0xf60b('0x10')];return new BPromise(function(_0x5213cf,_0x456508){return exec(util[_0xf60b('0x11')](_0xf60b('0x12'),_0x473122[_0xf60b('0x13')][_0xf60b('0x14')]),function(_0x557eeb,_0x4b8583,_0x5da61c){if(_0x557eeb){return _0x456508(_0x557eeb);}return _0x5213cf(_0x4b8583);});})[_0xf60b('0xd')](function(_0x2f12b0){var _0x296acb=![];var _0x4f88dd=_0x2f12b0['split'](/\n/);for(var _0xd8e191=0x0,_0x1853b5=_0x385dad[_0xf60b('0x15')];_0xd8e191<_0x1853b5,_0x296acb===![];_0xd8e191+=0x1){if(_0x2f12b0[_0xf60b('0x16')](_0x385dad[_0xd8e191])>=0x0){_0x296acb=!![];}}if(!_0x296acb){throw new Error(util[_0xf60b('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x473122[_0xf60b('0x13')]['pid']));}process[_0xf60b('0x17')](_0x473122[_0xf60b('0x13')]['pid'],'SIGINT');return _0x5c823d[_0xf60b('0xa')](0xc8)[_0xf60b('0xe')]({'message':util[_0xf60b('0x11')](_0xf60b('0x18'),_0x473122[_0xf60b('0x13')]['pid'])});})['catch'](handleError(_0x5c823d,null,_0xf60b('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3e9ed58..4c00b89 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 _0xada7=['../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1a1068,_0x1ab828){var _0x3edc2b=function(_0x6d9dec){while(--_0x6d9dec){_0x1a1068['push'](_0x1a1068['shift']());}};_0x3edc2b(++_0x1ab828);}(_0xada7,0x186));var _0x7ada=function(_0x5d99df,_0x11ff32){_0x5d99df=_0x5d99df-0x0;var _0x568bae=_0xada7[_0x5d99df];return _0x568bae;};'use strict';var multer=require(_0x7ada('0x0'));var util=require(_0x7ada('0x1'));var path=require('path');var timeout=require(_0x7ada('0x2'));var express=require(_0x7ada('0x3'));var router=express[_0x7ada('0x4')]();var fs_extra=require(_0x7ada('0x5'));var auth=require(_0x7ada('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ada('0x7'));var controller=require(_0x7ada('0x8'));router[_0x7ada('0x9')]('/',auth[_0x7ada('0xa')](),controller[_0x7ada('0xb')]);router[_0x7ada('0x9')]('/:id',auth[_0x7ada('0xa')](),controller['show']);router['post']('/',auth[_0x7ada('0xa')](),controller[_0x7ada('0xc')]);router['put'](_0x7ada('0xd'),auth[_0x7ada('0xa')](),controller[_0x7ada('0xe')]);router[_0x7ada('0xf')](_0x7ada('0xd'),auth['isAuthenticated'](),controller[_0x7ada('0x10')]);module[_0x7ada('0x11')]=router; \ No newline at end of file +var _0xdca3=['delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','create','put','update'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xdca3,0x13d));var _0x3dca=function(_0x2afbdf,_0x391259){_0x2afbdf=_0x2afbdf-0x0;var _0x507278=_0xdca3[_0x2afbdf];return _0x507278;};'use strict';var multer=require('multer');var util=require(_0x3dca('0x0'));var path=require('path');var timeout=require(_0x3dca('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3dca('0x2'));var auth=require(_0x3dca('0x3'));var interaction=require(_0x3dca('0x4'));var config=require(_0x3dca('0x5'));var controller=require('./tag.controller');router[_0x3dca('0x6')]('/',auth['isAuthenticated'](),controller[_0x3dca('0x7')]);router[_0x3dca('0x6')]('/:id',auth[_0x3dca('0x8')](),controller[_0x3dca('0x9')]);router['post']('/',auth[_0x3dca('0x8')](),controller[_0x3dca('0xa')]);router[_0x3dca('0xb')]('/:id',auth[_0x3dca('0x8')](),controller[_0x3dca('0xc')]);router[_0x3dca('0xd')]('/:id',auth[_0x3dca('0x8')](),controller[_0x3dca('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a1d49d2..e93611a 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 _0xad13=['#0091EA','sequelize','STRING','name'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xad13,0x79));var _0x3ad1=function(_0x14c1a7,_0x23ab91){_0x14c1a7=_0x14c1a7-0x0;var _0x2fd145=_0xad13[_0x14c1a7];return _0x2fd145;};'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 +var _0x8322=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3de4f6,_0x43f477){var _0x53e653=function(_0x50c1aa){while(--_0x50c1aa){_0x3de4f6['push'](_0x3de4f6['shift']());}};_0x53e653(++_0x43f477);}(_0x8322,0x186));var _0x2832=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x8322[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x2832('0x0'));module[_0x2832('0x1')]={'name':{'type':Sequelize[_0x2832('0x2')],'unique':_0x2832('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2832('0x2')],'defaultValue':_0x2832('0x4')},'description':{'type':Sequelize[_0x2832('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a63045d..a6366d0 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 _0xec56=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','Tag','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0xec56,0x1bd));var _0x6ec5=function(_0x11afe1,_0x5581db){_0x11afe1=_0x11afe1-0x0;var _0xb4dac4=_0xec56[_0x11afe1];return _0xb4dac4;};'use strict';var emlformat=require(_0x6ec5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ec5('0x1'));var rp=require(_0x6ec5('0x2'));var moment=require(_0x6ec5('0x3'));var BPromise=require(_0x6ec5('0x4'));var Mustache=require(_0x6ec5('0x5'));var util=require(_0x6ec5('0x6'));var path=require(_0x6ec5('0x7'));var sox=require(_0x6ec5('0x8'));var csv=require(_0x6ec5('0x9'));var ejs=require(_0x6ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x6ec5('0xb'));var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0x9'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var as=require(_0x6ec5('0x15'));var hardwareService=require(_0x6ec5('0x16'));var logger=require(_0x6ec5('0x17'))(_0x6ec5('0x18'));var utils=require(_0x6ec5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6ec5('0x1a'));var db=require(_0x6ec5('0x1b'))['db'];function respondWithStatusCode(_0x2b1f61,_0xb04ab6){_0xb04ab6=_0xb04ab6||0xcc;return function(_0x135aaf){if(_0x135aaf){return _0x2b1f61[_0x6ec5('0x1c')](_0xb04ab6);}return _0x2b1f61[_0x6ec5('0x1d')](_0xb04ab6)[_0x6ec5('0x1e')]();};}function respondWithResult(_0x5166ad,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x4d1510){if(_0x4d1510){return _0x5166ad[_0x6ec5('0x1d')](_0x3ed07a)[_0x6ec5('0x1f')](_0x4d1510);}};}function respondWithFilteredResult(_0x4a4e3c,_0x9fc0e7){return function(_0xdc0b10){if(_0xdc0b10){var _0x4d09fe=typeof _0x9fc0e7[_0x6ec5('0x20')]===_0x6ec5('0x21')&&typeof _0x9fc0e7[_0x6ec5('0x22')]===_0x6ec5('0x21');var _0x23b3e3=_0xdc0b10[_0x6ec5('0x23')];var _0x1dbee9=_0x4d09fe?0x0:_0x9fc0e7[_0x6ec5('0x20')];var _0x2608c0=_0x4d09fe?_0xdc0b10[_0x6ec5('0x23')]:_0x9fc0e7[_0x6ec5('0x20')]+_0x9fc0e7[_0x6ec5('0x22')];var _0x437f0f;if(_0x2608c0>=_0x23b3e3){_0x2608c0=_0x23b3e3;_0x437f0f=0xc8;}else{_0x437f0f=0xce;}_0x4a4e3c[_0x6ec5('0x1d')](_0x437f0f);return _0x4a4e3c[_0x6ec5('0x24')](_0x6ec5('0x25'),_0x1dbee9+'-'+_0x2608c0+'/'+_0x23b3e3)[_0x6ec5('0x1f')](_0xdc0b10);}return null;};}function patchUpdates(_0x4abd5d){return function(_0x272532){try{jsonpatch[_0x6ec5('0x26')](_0x272532,_0x4abd5d,!![]);}catch(_0xd045b){return BPromise[_0x6ec5('0x27')](_0xd045b);}return _0x272532[_0x6ec5('0x28')]();};}function saveUpdates(_0x38a821,_0x18243f){return function(_0x48733b){if(_0x48733b){return _0x48733b[_0x6ec5('0x29')](_0x38a821)[_0x6ec5('0x2a')](function(_0x358d18){return _0x358d18;});}return null;};}function removeEntity(_0x1560c6,_0x57060c){return function(_0x27f631){if(_0x27f631){return _0x27f631[_0x6ec5('0x2b')]()['then'](function(){var _0x2dc0a7=_0x27f631[_0x6ec5('0x2c')]({'plain':!![]});var _0xb4d269='Tags';return db[_0x6ec5('0x2d')][_0x6ec5('0x2b')]({'where':{'type':_0xb4d269,'resourceId':_0x2dc0a7['id']}})[_0x6ec5('0x2a')](function(){return _0x27f631;});})[_0x6ec5('0x2a')](function(){_0x1560c6[_0x6ec5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171e2a,_0x267a30){return function(_0x4a9860){if(!_0x4a9860){_0x171e2a[_0x6ec5('0x1c')](0x194);}return _0x4a9860;};}function handleError(_0x3f5ee0,_0x5c8c7d){_0x5c8c7d=_0x5c8c7d||0x1f4;return function(_0x3d36cb){logger[_0x6ec5('0x2e')](_0x3d36cb[_0x6ec5('0x2f')]);if(_0x3d36cb[_0x6ec5('0x30')]){delete _0x3d36cb[_0x6ec5('0x30')];}_0x3f5ee0['status'](_0x5c8c7d)[_0x6ec5('0x31')](_0x3d36cb);};}exports[_0x6ec5('0x32')]=function(_0x24aff9,_0x174164){var _0x3e6d33={},_0x22c3d3={},_0x394132={'count':0x0,'rows':[]};var _0x59a6de=_[_0x6ec5('0x33')](db['Tag'][_0x6ec5('0x34')],function(_0x5c6517){return{'name':_0x5c6517[_0x6ec5('0x35')],'type':_0x5c6517[_0x6ec5('0x36')]['key']};});_0x22c3d3['model']=_[_0x6ec5('0x33')](_0x59a6de,_0x6ec5('0x30'));_0x22c3d3['query']=_[_0x6ec5('0x37')](_0x24aff9[_0x6ec5('0x38')]);_0x22c3d3['filters']=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],_0x22c3d3[_0x6ec5('0x38')]);_0x3e6d33[_0x6ec5('0x3b')]=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],qs[_0x6ec5('0x3c')](_0x24aff9[_0x6ec5('0x38')]['fields']));_0x3e6d33[_0x6ec5('0x3b')]=_0x3e6d33['attributes'][_0x6ec5('0x3d')]?_0x3e6d33[_0x6ec5('0x3b')]:_0x22c3d3[_0x6ec5('0x3a')];if(!_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x3e')](_0x6ec5('0x3f'))){_0x3e6d33[_0x6ec5('0x22')]=qs[_0x6ec5('0x22')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x22')]);_0x3e6d33[_0x6ec5('0x20')]=qs['offset'](_0x24aff9['query'][_0x6ec5('0x20')]);}_0x3e6d33['order']=qs[_0x6ec5('0x40')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x40')]);_0x3e6d33[_0x6ec5('0x41')]=qs[_0x6ec5('0x42')](_[_0x6ec5('0x43')](_0x24aff9[_0x6ec5('0x38')],_0x22c3d3['filters']),_0x59a6de);if(_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x44')]){_0x3e6d33[_0x6ec5('0x41')]=_[_0x6ec5('0x45')](_0x3e6d33[_0x6ec5('0x41')],{'$or':_[_0x6ec5('0x33')](_0x59a6de,function(_0x74e78b){if(_0x74e78b[_0x6ec5('0x36')]!==_0x6ec5('0x46')){var _0x53dcd8={};_0x53dcd8[_0x74e78b[_0x6ec5('0x30')]]={'$like':'%'+_0x24aff9['query'][_0x6ec5('0x44')]+'%'};return _0x53dcd8;}})});}_0x3e6d33=_['merge']({},_0x3e6d33,_0x24aff9[_0x6ec5('0x47')]);var _0x45de3c={'where':_0x3e6d33['where']};return db[_0x6ec5('0x48')][_0x6ec5('0x23')](_0x45de3c)[_0x6ec5('0x2a')](function(_0x48c019){_0x394132[_0x6ec5('0x23')]=_0x48c019;if(_0x24aff9[_0x6ec5('0x38')]['includeAll']){_0x3e6d33[_0x6ec5('0x49')]=[{'all':!![]}];}return db[_0x6ec5('0x48')][_0x6ec5('0x4a')](_0x3e6d33);})[_0x6ec5('0x2a')](function(_0x43d858){_0x394132[_0x6ec5('0x4b')]=_0x43d858;return _0x394132;})[_0x6ec5('0x2a')](respondWithFilteredResult(_0x174164,_0x3e6d33))[_0x6ec5('0x4c')](handleError(_0x174164,null));};exports[_0x6ec5('0x4d')]=function(_0x5a7b9c,_0x96340b){var _0x4ee5f5={'raw':!![],'where':{'id':_0x5a7b9c[_0x6ec5('0x4e')]['id']}},_0x17cfed={};_0x17cfed[_0x6ec5('0x3a')]=_[_0x6ec5('0x37')](db['Tag'][_0x6ec5('0x34')]);_0x17cfed[_0x6ec5('0x38')]=_['keys'](_0x5a7b9c[_0x6ec5('0x38')]);_0x17cfed['filters']=_[_0x6ec5('0x39')](_0x17cfed[_0x6ec5('0x3a')],_0x17cfed[_0x6ec5('0x38')]);_0x4ee5f5[_0x6ec5('0x3b')]=_['intersection'](_0x17cfed['model'],qs[_0x6ec5('0x3c')](_0x5a7b9c['query'][_0x6ec5('0x3c')]));_0x4ee5f5[_0x6ec5('0x3b')]=_0x4ee5f5[_0x6ec5('0x3b')][_0x6ec5('0x3d')]?_0x4ee5f5[_0x6ec5('0x3b')]:_0x17cfed['model'];if(_0x5a7b9c['query'][_0x6ec5('0x4f')]){_0x4ee5f5[_0x6ec5('0x49')]=[{'all':!![]}];}_0x4ee5f5=_[_0x6ec5('0x45')]({},_0x4ee5f5,_0x5a7b9c[_0x6ec5('0x47')]);return db[_0x6ec5('0x48')][_0x6ec5('0x50')](_0x4ee5f5)[_0x6ec5('0x2a')](handleEntityNotFound(_0x96340b,null))[_0x6ec5('0x2a')](respondWithResult(_0x96340b,null))[_0x6ec5('0x4c')](handleError(_0x96340b,null));};exports[_0x6ec5('0x51')]=function(_0xd265c,_0x1c5e2f){return db[_0x6ec5('0x48')][_0x6ec5('0x51')](_0xd265c['body'],{})[_0x6ec5('0x2a')](function(_0x51709d){var _0x40b9cc=_0xd265c[_0x6ec5('0x52')]['get']({'plain':!![]});if(!_0x40b9cc)throw new Error(_0x6ec5('0x53'));if(_0x40b9cc[_0x6ec5('0x54')]==='user'){var _0x23a64d=_0x51709d[_0x6ec5('0x2c')]({'plain':!![]});var _0x486552='Tags';return db[_0x6ec5('0x55')]['find']({'where':{'name':_0x486552,'userProfileId':_0x40b9cc['userProfileId']},'raw':!![]})[_0x6ec5('0x2a')](function(_0x101966){if(_0x101966&&_0x101966[_0x6ec5('0x56')]===0x0){return db[_0x6ec5('0x2d')]['create']({'name':_0x23a64d[_0x6ec5('0x30')],'resourceId':_0x23a64d['id'],'type':_0x101966[_0x6ec5('0x30')],'sectionId':_0x101966['id']},{})[_0x6ec5('0x2a')](function(){return _0x51709d;});}else{return _0x51709d;}})[_0x6ec5('0x4c')](function(_0x9bde51){logger[_0x6ec5('0x2e')](_0x6ec5('0x57'),_0x9bde51);throw _0x9bde51;});}return _0x51709d;})[_0x6ec5('0x2a')](respondWithResult(_0x1c5e2f,0xc9))[_0x6ec5('0x4c')](handleError(_0x1c5e2f,null));};exports[_0x6ec5('0x29')]=function(_0x29317f,_0x4370f2){if(_0x29317f[_0x6ec5('0x58')]['id']){delete _0x29317f['body']['id'];}return db[_0x6ec5('0x48')][_0x6ec5('0x50')]({'where':{'id':_0x29317f['params']['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x4370f2,null))[_0x6ec5('0x2a')](saveUpdates(_0x29317f[_0x6ec5('0x58')],null))[_0x6ec5('0x2a')](respondWithResult(_0x4370f2,null))[_0x6ec5('0x4c')](handleError(_0x4370f2,null));};exports['destroy']=function(_0x5f3d3f,_0x282cbc){return db['Tag'][_0x6ec5('0x50')]({'where':{'id':_0x5f3d3f[_0x6ec5('0x4e')]['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x282cbc,null))[_0x6ec5('0x2a')](removeEntity(_0x282cbc,null))[_0x6ec5('0x4c')](handleError(_0x282cbc,null));}; \ No newline at end of file +var _0x16d2=['error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get'];(function(_0x5a8fca,_0x37ea65){var _0x151606=function(_0x4bc6ae){while(--_0x4bc6ae){_0x5a8fca['push'](_0x5a8fca['shift']());}};_0x151606(++_0x37ea65);}(_0x16d2,0x123));var _0x216d=function(_0x2bbcde,_0x3ab905){_0x2bbcde=_0x2bbcde-0x0;var _0x3dd874=_0x16d2[_0x2bbcde];return _0x3dd874;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['Tag'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['Tag'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e122724..68a90ec 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 _0x2f05=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2f05,0x1ee));var _0x52f0=function(_0x9d9c10,_0x4d7b1c){_0x9d9c10=_0x9d9c10-0x0;var _0x3ec785=_0x2f05[_0x9d9c10];return _0x3ec785;};'use strict';var _=require(_0x52f0('0x0'));var util=require(_0x52f0('0x1'));var logger=require(_0x52f0('0x2'))('api');var moment=require(_0x52f0('0x3'));var BPromise=require('bluebird');var rp=require(_0x52f0('0x4'));var fs=require('fs');var path=require(_0x52f0('0x5'));var rimraf=require(_0x52f0('0x6'));var config=require(_0x52f0('0x7'));var attributes=require('./tag.attributes');module[_0x52f0('0x8')]=function(_0x306a03,_0x2a5b61){return _0x306a03[_0x52f0('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda5d=['Tag','tools_tags','util','../../config/logger','api','moment','request-promise','path','rimraf','./tag.attributes','exports'];(function(_0x4aefb9,_0x55959c){var _0x3152dc=function(_0x5f5bd5){while(--_0x5f5bd5){_0x4aefb9['push'](_0x4aefb9['shift']());}};_0x3152dc(++_0x55959c);}(_0xda5d,0xc8));var _0xdda5=function(_0x10409b,_0x54b196){_0x10409b=_0x10409b-0x0;var _0x5ea943=_0xda5d[_0x10409b];return _0x5ea943;};'use strict';var _=require('lodash');var util=require(_0xdda5('0x0'));var logger=require(_0xdda5('0x1'))(_0xdda5('0x2'));var moment=require(_0xdda5('0x3'));var BPromise=require('bluebird');var rp=require(_0xdda5('0x4'));var fs=require('fs');var path=require(_0xdda5('0x5'));var rimraf=require(_0xdda5('0x6'));var config=require('../../config/environment');var attributes=require(_0xdda5('0x7'));module[_0xdda5('0x8')]=function(_0x188bc6,_0x1d981e){return _0x188bc6['define'](_0xdda5('0x9'),attributes,{'tableName':_0xdda5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index a93f780..9dcc5b3 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 _0xb903=['http','request','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','Tag,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x345a96,_0x412e33){var _0x340f3f=function(_0x291a01){while(--_0x291a01){_0x345a96['push'](_0x345a96['shift']());}};_0x340f3f(++_0x412e33);}(_0xb903,0x185));var _0x3b90=function(_0x27f612,_0x42fdd5){_0x27f612=_0x27f612-0x0;var _0x34f480=_0xb903[_0x27f612];return _0x34f480;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('Tag,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('Tag,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file +var _0xed95=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x3f3185,_0x3ce4e7){var _0x118057=function(_0x3670ec){while(--_0x3670ec){_0x3f3185['push'](_0x3f3185['shift']());}};_0x118057(++_0x3ce4e7);}(_0xed95,0xb9));var _0x5ed9=function(_0x5179e8,_0x5cdafa){_0x5179e8=_0x5179e8-0x0;var _0x5afb7a=_0xed95[_0x5179e8];return _0x5afb7a;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var moment=require(_0x5ed9('0x2'));var BPromise=require(_0x5ed9('0x3'));var rs=require(_0x5ed9('0x4'));var fs=require('fs');var Redis=require(_0x5ed9('0x5'));var db=require(_0x5ed9('0x6'))['db'];var utils=require(_0x5ed9('0x7'));var logger=require(_0x5ed9('0x8'))(_0x5ed9('0x9'));var config=require(_0x5ed9('0xa'));var jayson=require(_0x5ed9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2612a8,_0x217c71,_0x2fe2dd){return new BPromise(function(_0x34688d,_0x2d5474){return client[_0x5ed9('0xc')](_0x2612a8,_0x2fe2dd)['then'](function(_0x487047){logger[_0x5ed9('0xd')](_0x5ed9('0xe'),_0x217c71,_0x5ed9('0xf'));logger[_0x5ed9('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x217c71,'request\x20sent',JSON[_0x5ed9('0x11')](_0x487047));if(_0x487047[_0x5ed9('0x12')]){if(_0x487047[_0x5ed9('0x12')][_0x5ed9('0x13')]===0x1f4){logger['error'](_0x5ed9('0xe'),_0x217c71,_0x487047[_0x5ed9('0x12')][_0x5ed9('0x14')]);return _0x2d5474(_0x487047['error']['message']);}logger[_0x5ed9('0x12')](_0x5ed9('0xe'),_0x217c71,_0x487047['error'][_0x5ed9('0x14')]);return _0x34688d(_0x487047[_0x5ed9('0x12')]['message']);}else{logger['info'](_0x5ed9('0xe'),_0x217c71,_0x5ed9('0xf'));_0x34688d(_0x487047['result'][_0x5ed9('0x14')]);}})[_0x5ed9('0x15')](function(_0x50b9e8){logger[_0x5ed9('0x12')](_0x5ed9('0xe'),_0x217c71,_0x50b9e8);_0x2d5474(_0x50b9e8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 70ba368..2ce13df 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 459567c..01405f0 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 _0x757a=['exports','STRING'];(function(_0x332751,_0x4294b8){var _0x46578f=function(_0x392c04){while(--_0x392c04){_0x332751['push'](_0x332751['shift']());}};_0x46578f(++_0x4294b8);}(_0x757a,0xde));var _0xa757=function(_0x11ce23,_0x10e9af){_0x11ce23=_0x11ce23-0x0;var _0x25575e=_0x757a[_0x11ce23];return _0x25575e;};'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 _0xe706=['STRING','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe706,0xa3));var _0x6e70=function(_0x465c3b,_0x384cf1){_0x465c3b=_0x465c3b-0x0;var _0x67f5d8=_0xe706[_0x465c3b];return _0x67f5d8;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index dd01d53..0eeface 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 _0x039a=['pick','Queues','addQueues','removeQueues','ValidationError','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','removeAgents','isArray','Queue:remove','getAgents','User','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./team.socket','register','sendStatus','status','undefined','count','offset','set','json','apply','reject','save','update','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','options','include','findAll','rows','then','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Teams','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x039a,0x150));var _0xa039=function(_0x3977dc,_0x18499a){_0x3977dc=_0x3977dc-0x0;var _0x40e46e=_0x039a[_0x3977dc];return _0x40e46e;};'use strict';var emlformat=require(_0xa039('0x0'));var rimraf=require(_0xa039('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa039('0x2'));var rp=require(_0xa039('0x3'));var moment=require(_0xa039('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa039('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa039('0x6'));var csv=require(_0xa039('0x7'));var ejs=require(_0xa039('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa039('0x9'));var crypto=require(_0xa039('0xa'));var jsforce=require(_0xa039('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa039('0x7'));var querystring=require(_0xa039('0xc'));var Papa=require(_0xa039('0xd'));var Redis=require(_0xa039('0xe'));var authService=require(_0xa039('0xf'));var qs=require(_0xa039('0x10'));var as=require(_0xa039('0x11'));var hardwareService=require(_0xa039('0x12'));var logger=require('../../config/logger')(_0xa039('0x13'));var utils=require(_0xa039('0x14'));var config=require(_0xa039('0x15'));var licenseUtil=require(_0xa039('0x16'));var db=require(_0xa039('0x17'))['db'];config['redis']=_[_0xa039('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa039('0x19'))[_0xa039('0x1a')](socket);function respondWithStatusCode(_0x1f7c1e,_0x4f511d){_0x4f511d=_0x4f511d||0xcc;return function(_0x36c0ec){if(_0x36c0ec){return _0x1f7c1e[_0xa039('0x1b')](_0x4f511d);}return _0x1f7c1e[_0xa039('0x1c')](_0x4f511d)['end']();};}function respondWithResult(_0x2ed7ca,_0x11a0b1){_0x11a0b1=_0x11a0b1||0xc8;return function(_0x494649){if(_0x494649){return _0x2ed7ca[_0xa039('0x1c')](_0x11a0b1)['json'](_0x494649);}};}function respondWithFilteredResult(_0x47407d,_0x543fc1){return function(_0x1aad8c){if(_0x1aad8c){var _0x4d2138=typeof _0x543fc1['offset']===_0xa039('0x1d')&&typeof _0x543fc1['limit']==='undefined';var _0x291160=_0x1aad8c[_0xa039('0x1e')];var _0x3f306b=_0x4d2138?0x0:_0x543fc1[_0xa039('0x1f')];var _0x3f2420=_0x4d2138?_0x1aad8c[_0xa039('0x1e')]:_0x543fc1[_0xa039('0x1f')]+_0x543fc1['limit'];var _0x2447cd;if(_0x3f2420>=_0x291160){_0x3f2420=_0x291160;_0x2447cd=0xc8;}else{_0x2447cd=0xce;}_0x47407d[_0xa039('0x1c')](_0x2447cd);return _0x47407d[_0xa039('0x20')]('Content-Range',_0x3f306b+'-'+_0x3f2420+'/'+_0x291160)[_0xa039('0x21')](_0x1aad8c);}return null;};}function patchUpdates(_0x2eba1d){return function(_0x1855d8){try{jsonpatch[_0xa039('0x22')](_0x1855d8,_0x2eba1d,!![]);}catch(_0x1a1544){return BPromise[_0xa039('0x23')](_0x1a1544);}return _0x1855d8[_0xa039('0x24')]();};}function saveUpdates(_0x5aa706,_0x294a44){return function(_0x528a71){if(_0x528a71){return _0x528a71[_0xa039('0x25')](_0x5aa706)['then'](function(_0x24225d){return _0x24225d;});}return null;};}function handleEntityNotFound(_0x236fd4,_0x19c3a6){return function(_0x3f3b94){if(!_0x3f3b94){_0x236fd4['sendStatus'](0x194);}return _0x3f3b94;};}function handleError(_0x9a91b1,_0x46c33e){_0x46c33e=_0x46c33e||0x1f4;return function(_0x5c6f84){logger[_0xa039('0x26')](_0x5c6f84[_0xa039('0x27')]);if(_0x5c6f84[_0xa039('0x28')]){delete _0x5c6f84[_0xa039('0x28')];}_0x9a91b1[_0xa039('0x1c')](_0x46c33e)[_0xa039('0x29')](_0x5c6f84);};}exports[_0xa039('0x2a')]=function(_0x3fd1f8,_0x21cdad){var _0x3afae7={},_0x1e5487={},_0x1592e8={'count':0x0,'rows':[]};var _0x23dac0=_['map'](db[_0xa039('0x2b')][_0xa039('0x2c')],function(_0x3aba36){return{'name':_0x3aba36[_0xa039('0x2d')],'type':_0x3aba36[_0xa039('0x2e')][_0xa039('0x2f')]};});_0x1e5487[_0xa039('0x30')]=_[_0xa039('0x31')](_0x23dac0,_0xa039('0x28'));_0x1e5487[_0xa039('0x32')]=_[_0xa039('0x33')](_0x3fd1f8[_0xa039('0x32')]);_0x1e5487[_0xa039('0x34')]=_['intersection'](_0x1e5487[_0xa039('0x30')],_0x1e5487[_0xa039('0x32')]);_0x3afae7[_0xa039('0x35')]=_[_0xa039('0x36')](_0x1e5487[_0xa039('0x30')],qs[_0xa039('0x37')](_0x3fd1f8['query']['fields']));_0x3afae7[_0xa039('0x35')]=_0x3afae7[_0xa039('0x35')][_0xa039('0x38')]?_0x3afae7[_0xa039('0x35')]:_0x1e5487[_0xa039('0x30')];if(!_0x3fd1f8[_0xa039('0x32')][_0xa039('0x39')]('nolimit')){_0x3afae7[_0xa039('0x3a')]=qs[_0xa039('0x3a')](_0x3fd1f8[_0xa039('0x32')][_0xa039('0x3a')]);_0x3afae7[_0xa039('0x1f')]=qs[_0xa039('0x1f')](_0x3fd1f8[_0xa039('0x32')][_0xa039('0x1f')]);}_0x3afae7[_0xa039('0x3b')]=qs['sort'](_0x3fd1f8['query'][_0xa039('0x3c')]);_0x3afae7[_0xa039('0x3d')]=qs[_0xa039('0x34')](_['pick'](_0x3fd1f8['query'],_0x1e5487[_0xa039('0x34')]),_0x23dac0);if(_0x3fd1f8[_0xa039('0x32')][_0xa039('0x3e')]){_0x3afae7[_0xa039('0x3d')]=_['merge'](_0x3afae7[_0xa039('0x3d')],{'$or':_[_0xa039('0x31')](_0x23dac0,function(_0x1a7cb0){if(_0x1a7cb0[_0xa039('0x2e')]!=='VIRTUAL'){var _0x5169ef={};_0x5169ef[_0x1a7cb0['name']]={'$like':'%'+_0x3fd1f8[_0xa039('0x32')][_0xa039('0x3e')]+'%'};return _0x5169ef;}})});}_0x3afae7=_[_0xa039('0x3f')]({},_0x3afae7,_0x3fd1f8[_0xa039('0x40')]);var _0x2c7b28={'where':_0x3afae7[_0xa039('0x3d')]};return db[_0xa039('0x2b')][_0xa039('0x1e')](_0x2c7b28)['then'](function(_0x321e88){_0x1592e8[_0xa039('0x1e')]=_0x321e88;if(_0x3fd1f8[_0xa039('0x32')]['includeAll']){_0x3afae7[_0xa039('0x41')]=[{'all':!![]}];}return db[_0xa039('0x2b')][_0xa039('0x42')](_0x3afae7);})['then'](function(_0x82d8d4){_0x1592e8[_0xa039('0x43')]=_0x82d8d4;return _0x1592e8;})[_0xa039('0x44')](respondWithFilteredResult(_0x21cdad,_0x3afae7))[_0xa039('0x45')](handleError(_0x21cdad,null));};exports[_0xa039('0x46')]=function(_0x5373c6,_0x4fcbf8){var _0x31d059={'raw':![],'where':{'id':_0x5373c6[_0xa039('0x47')]['id']}},_0x3da350={};_0x3da350[_0xa039('0x30')]=_[_0xa039('0x33')](db[_0xa039('0x2b')][_0xa039('0x2c')]);_0x3da350[_0xa039('0x32')]=_[_0xa039('0x33')](_0x5373c6['query']);_0x3da350[_0xa039('0x34')]=_[_0xa039('0x36')](_0x3da350['model'],_0x3da350[_0xa039('0x32')]);_0x31d059[_0xa039('0x35')]=_[_0xa039('0x36')](_0x3da350[_0xa039('0x30')],qs[_0xa039('0x37')](_0x5373c6[_0xa039('0x32')]['fields']));_0x31d059[_0xa039('0x35')]=_0x31d059[_0xa039('0x35')][_0xa039('0x38')]?_0x31d059[_0xa039('0x35')]:_0x3da350[_0xa039('0x30')];if(_0x5373c6[_0xa039('0x32')][_0xa039('0x48')]){_0x31d059[_0xa039('0x41')]=[{'all':!![]}];}_0x31d059=_[_0xa039('0x3f')]({},_0x31d059,_0x5373c6[_0xa039('0x40')]);return db['Team']['find'](_0x31d059)[_0xa039('0x44')](handleEntityNotFound(_0x4fcbf8,null))[_0xa039('0x44')](respondWithResult(_0x4fcbf8,null))[_0xa039('0x45')](handleError(_0x4fcbf8,null));};exports[_0xa039('0x49')]=function(_0xc1d340,_0x206f0d){return db[_0xa039('0x2b')]['create'](_0xc1d340['body'],{})[_0xa039('0x44')](function(_0x41ab8f){var _0x2537b1=_0xc1d340[_0xa039('0x4a')]['get']({'plain':!![]});if(!_0x2537b1)throw new Error(_0xa039('0x4b'));if(_0x2537b1['role']===_0xa039('0x4a')){var _0x22aed9=_0x41ab8f[_0xa039('0x4c')]({'plain':!![]});var _0x51eb2c=_0xa039('0x4d');return db['UserProfileSection'][_0xa039('0x4e')]({'where':{'name':_0x51eb2c,'userProfileId':_0x2537b1['userProfileId']},'raw':!![]})[_0xa039('0x44')](function(_0x4fbd71){if(_0x4fbd71&&_0x4fbd71['autoAssociation']===0x0){return db[_0xa039('0x4f')]['create']({'name':_0x22aed9[_0xa039('0x28')],'resourceId':_0x22aed9['id'],'type':_0x4fbd71[_0xa039('0x28')],'sectionId':_0x4fbd71['id']},{})[_0xa039('0x44')](function(){return _0x41ab8f;});}else{return _0x41ab8f;}})[_0xa039('0x45')](function(_0x10d685){logger['error'](_0xa039('0x50'),_0x10d685);throw _0x10d685;});}return _0x41ab8f;})[_0xa039('0x44')](respondWithResult(_0x206f0d,0xc9))[_0xa039('0x45')](handleError(_0x206f0d,null));};exports[_0xa039('0x25')]=function(_0x45eb20,_0x2ba536){if(_0x45eb20[_0xa039('0x51')]['id']){delete _0x45eb20['body']['id'];}return db[_0xa039('0x2b')]['find']({'where':{'id':_0x45eb20[_0xa039('0x47')]['id']}})[_0xa039('0x44')](handleEntityNotFound(_0x2ba536,null))[_0xa039('0x44')](saveUpdates(_0x45eb20[_0xa039('0x51')],null))['then'](respondWithResult(_0x2ba536,null))[_0xa039('0x45')](handleError(_0x2ba536,null));};exports[_0xa039('0x52')]=function(_0x5b9afe,_0x220aed){var _0x370e54=_0x5b9afe[_0xa039('0x47')]['id'];var _0x57d387=[];return db[_0xa039('0x53')][_0xa039('0x54')](function(_0x2e8b80){var _0x411701=_0xa039('0x55')+_0x370e54;return db[_0xa039('0x53')]['query'](_0x411701,{'type':db['Sequelize'][_0xa039('0x56')][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80})['then'](function(_0x24c625){_0x57d387=_[_0xa039('0x31')](_0x24c625,function(_0x3996ab){return Number(_0x3996ab['UserId']);});})[_0xa039('0x44')](function(){var _0x1d8cb3=_0xa039('0x58')+_0x370e54;return db['sequelize'][_0xa039('0x32')](_0x1d8cb3,{'type':db[_0xa039('0x59')][_0xa039('0x56')][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x328dc0){var _0x5d2d50=_[_0xa039('0x31')](_0x328dc0,function(_0x506699){return Number(_0x506699['VoiceQueueId']);});return db[_0xa039('0x5a')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'VoiceQueueId':{'$in':_0x5d2d50}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){var _0x49602f=_0xa039('0x5b')+_0x370e54;return db[_0xa039('0x53')][_0xa039('0x32')](_0x49602f,{'type':db[_0xa039('0x59')][_0xa039('0x56')][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})['then'](function(_0x2d87d9){var _0x14a745=_[_0xa039('0x31')](_0x2d87d9,function(_0x52bb0c){return Number(_0x52bb0c[_0xa039('0x5c')]);});return db[_0xa039('0x5d')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'MailQueueId':{'$in':_0x14a745}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){var _0x2d2e0e=_0xa039('0x5e')+_0x370e54;return db['sequelize'][_0xa039('0x32')](_0x2d2e0e,{'type':db['Sequelize']['QueryTypes'][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x57928f){var _0x310eb9=_[_0xa039('0x31')](_0x57928f,function(_0x316a81){return Number(_0x316a81[_0xa039('0x5f')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x57d387},'SmsQueueId':{'$in':_0x310eb9}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){var _0x3e48fb=_0xa039('0x60')+_0x370e54;return db[_0xa039('0x53')][_0xa039('0x32')](_0x3e48fb,{'type':db[_0xa039('0x59')][_0xa039('0x56')][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x54a663){var _0x213def=_[_0xa039('0x31')](_0x54a663,function(_0x3a4803){return Number(_0x3a4803['ChatQueueId']);});return db[_0xa039('0x61')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'ChatQueueId':{'$in':_0x213def}},'transaction':_0x2e8b80});})['then'](function(){var _0x110653=_0xa039('0x62')+_0x370e54;return db[_0xa039('0x53')]['query'](_0x110653,{'type':db[_0xa039('0x59')][_0xa039('0x56')]['SELECT'],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x5f5750){var _0x1406ba=_[_0xa039('0x31')](_0x5f5750,function(_0x222967){return Number(_0x222967[_0xa039('0x63')]);});return db[_0xa039('0x64')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'FaxQueueId':{'$in':_0x1406ba}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){var _0x16d724='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x370e54;return db[_0xa039('0x53')]['query'](_0x16d724,{'type':db[_0xa039('0x59')][_0xa039('0x56')][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x3c2fee){var _0x4b9ae5=_[_0xa039('0x31')](_0x3c2fee,function(_0x54e659){return Number(_0x54e659[_0xa039('0x65')]);});return db['UserOpenchannelQueue'][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'OpenchannelQueueId':{'$in':_0x4b9ae5}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){var _0x56f0db=_0xa039('0x66')+_0x370e54;return db[_0xa039('0x53')]['query'](_0x56f0db,{'type':db[_0xa039('0x59')]['QueryTypes'][_0xa039('0x57')],'raw':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x3a3194){var _0x3d6a07=_[_0xa039('0x31')](_0x3a3194,function(_0x5c9e7f){return Number(_0x5c9e7f[_0xa039('0x67')]);});return db[_0xa039('0x68')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'WhatsappQueueId':{'$in':_0x3d6a07}},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){return db[_0xa039('0x69')][_0xa039('0x4e')]({'where':{'TeamId':_0x370e54}});})[_0xa039('0x44')](function(_0x3b59f6){if(_0x3b59f6===null){return;}return db[_0xa039('0x6a')][_0xa039('0x52')]({'where':{'UserId':{'$in':_0x57d387},'VoicePrefixId':_0x3b59f6[_0xa039('0x6b')]},'transaction':_0x2e8b80});})[_0xa039('0x44')](function(){return db[_0xa039('0x2b')][_0xa039('0x52')]({'where':{'id':_0x370e54},'cascade':!![],'transaction':_0x2e8b80});})[_0xa039('0x44')](function(_0x41b66){if(_0x41b66===0x0){_0x220aed['sendStatus'](0x194);}else{return db[_0xa039('0x4f')][_0xa039('0x52')]({'where':{'type':_0xa039('0x4d'),'resourceId':_0x370e54},'cascade':!![],'transaction':_0x2e8b80})[_0xa039('0x44')](function(){_0x220aed[_0xa039('0x1c')](0xcc)[_0xa039('0x6c')]();});}})[_0xa039('0x45')](function(_0x460196){_0x220aed[_0xa039('0x1c')](0x1f4)[_0xa039('0x29')](_0x460196);});});};exports[_0xa039('0x6d')]=function(_0x5522ac,_0x22002e,_0x45946a){return db[_0xa039('0x2b')][_0xa039('0x6e')]({'where':{'id':_0x5522ac[_0xa039('0x47')]['id']}})[_0xa039('0x44')](handleEntityNotFound(_0x22002e,null))[_0xa039('0x44')](function(_0x64ef1){if(!_0x5522ac[_0xa039('0x32')][_0xa039('0x6f')]||!utils[_0xa039('0x70')](_0x5522ac[_0xa039('0x32')][_0xa039('0x6f')])){throw new db[(_0xa039('0x59'))]['ValidationError'](_0xa039('0x71'));}var _0x325230={};var _0x4abbc6={};_0x4abbc6['model']=_['keys'](db[_[_0xa039('0x72')](_0x5522ac['query'][_0xa039('0x6f')][_0xa039('0x73')]())+_0xa039('0x74')][_0xa039('0x2c')]);_0x4abbc6[_0xa039('0x32')]=_[_0xa039('0x33')](_0x5522ac[_0xa039('0x32')]);_0x4abbc6['filters']=_[_0xa039('0x36')](_0x4abbc6[_0xa039('0x30')],_0x4abbc6[_0xa039('0x32')]);_0x325230[_0xa039('0x35')]=_[_0xa039('0x36')](_0x4abbc6['model'],qs[_0xa039('0x37')](_0x5522ac[_0xa039('0x32')]['fields']));_0x325230[_0xa039('0x35')]=_0x325230[_0xa039('0x35')][_0xa039('0x38')]?_0x325230[_0xa039('0x35')]:_0x4abbc6[_0xa039('0x30')];_0x325230[_0xa039('0x3a')]=qs[_0xa039('0x3a')](_0x5522ac[_0xa039('0x32')][_0xa039('0x3a')]);_0x325230[_0xa039('0x1f')]=qs[_0xa039('0x1f')](_0x5522ac['query']['offset']);_0x325230[_0xa039('0x3b')]=qs[_0xa039('0x3c')](_0x5522ac['query']['sort']);_0x325230['where']=qs[_0xa039('0x34')](_[_0xa039('0x75')](_0x5522ac['query'],_0x4abbc6[_0xa039('0x34')]));_0x325230=_[_0xa039('0x3f')]({},_0x325230,_0x5522ac[_0xa039('0x40')]);return _0x64ef1[_0xa039('0x4c')+_[_0xa039('0x72')](_0x5522ac[_0xa039('0x32')]['channel'][_0xa039('0x73')]())+_0xa039('0x76')](_0x325230);})[_0xa039('0x44')](respondWithResult(_0x22002e,null))[_0xa039('0x45')](handleError(_0x22002e,null));};exports[_0xa039('0x77')]=function(_0x42b6c8,_0x4fada2,_0x4c28ba){return db[_0xa039('0x2b')][_0xa039('0x6e')]({'where':{'id':_0x42b6c8['params']['id']}})['then'](function(_0x4e0146){if(_0x4e0146){if(!_0x42b6c8[_0xa039('0x51')][_0xa039('0x6f')]||!utils[_0xa039('0x70')](_0x42b6c8[_0xa039('0x51')][_0xa039('0x6f')])){throw new db[(_0xa039('0x59'))]['ValidationError'](_0xa039('0x71'));}return _0x4e0146['add'+_[_0xa039('0x72')](_0x42b6c8[_0xa039('0x51')]['channel'][_0xa039('0x73')]())+_0xa039('0x76')](_0x42b6c8[_0xa039('0x51')]['ids']);}return null;})['then'](handleEntityNotFound(_0x4fada2,null))['then'](respondWithStatusCode(_0x4fada2,null))[_0xa039('0x45')](handleError(_0x4fada2,null));};exports[_0xa039('0x78')]=function(_0x37252e,_0xe43901,_0xd1f67f){return db['Team']['findOne']({'where':{'id':_0x37252e[_0xa039('0x47')]['id']}})['then'](function(_0x45c001){if(_0x45c001){if(!_0x37252e[_0xa039('0x32')][_0xa039('0x6f')]||!utils[_0xa039('0x70')](_0x37252e[_0xa039('0x32')][_0xa039('0x6f')])){throw new db[(_0xa039('0x59'))][(_0xa039('0x79'))]('Unknown\x20channel');}return _0x45c001[_0xa039('0x7a')+_[_0xa039('0x72')](_0x37252e[_0xa039('0x32')][_0xa039('0x6f')][_0xa039('0x73')]())+_0xa039('0x76')](_0x37252e['query'][_0xa039('0x7b')]);}return null;})[_0xa039('0x44')](handleEntityNotFound(_0xe43901,null))['then'](respondWithStatusCode(_0xe43901,null))[_0xa039('0x45')](handleError(_0xe43901,null));};exports[_0xa039('0x7c')]=function(_0x2f2183,_0x4ac75b){var _0x1fb250=_['isArray'](_0x2f2183[_0xa039('0x51')][_0xa039('0x7b')])?_0x2f2183[_0xa039('0x51')][_0xa039('0x7b')]:[_0x2f2183['body'][_0xa039('0x7b')]];var _0x121da5=_0x2f2183[_0xa039('0x47')]['id'];return db['Team'][_0xa039('0x4e')]({'where':{'id':_0x121da5}})[_0xa039('0x44')](handleEntityNotFound(_0x4ac75b,null))[_0xa039('0x44')](function(_0x438bb9){if(_0x438bb9){var _0x61832=[_0xa039('0x7d'),_0xa039('0x7e'),_0xa039('0x7f'),_0xa039('0x80'),_0xa039('0x81'),_0xa039('0x82'),_0xa039('0x83')];return db[_0xa039('0x53')][_0xa039('0x54')](function(_0x1ea6d1){var _0x483405=_[_0xa039('0x31')](_0x61832,function(_0x376638){var _0x1af81f={'attributes':['id',_0xa039('0x28')]};if(_0x376638==='Voice'){_0x1af81f[_0xa039('0x84')]={'attributes':[_0xa039('0x85')]};}return _0x438bb9[_0xa039('0x4c')+_0x376638+_0xa039('0x76')](_0x1af81f)[_0xa039('0x44')](function(_0x207121){var _0x11b709=_[_0xa039('0x31')](_0x207121,function(_0x5c9dd1){var _0x314993=_[_0xa039('0x31')](_0x1fb250,function(_0x21fc7c){var _0x15bc81={'where':{'UserId':_0x21fc7c,[_0x376638+_0xa039('0x86')]:_0x5c9dd1['id']},'transaction':_0x1ea6d1};if(_0x376638===_0xa039('0x7d')){_0x15bc81[_0xa039('0x18')]={'penalty':_0x5c9dd1[_0xa039('0x87')][_0xa039('0x85')]};}return db['User'+_0x376638+_0xa039('0x74')]['findOrCreate'](_0x15bc81)[_0xa039('0x44')](function(){socket[_0xa039('0x88')]('user'+_0x376638+_0xa039('0x89'),{'UserId':_0x21fc7c,[_0x376638+_0xa039('0x86')]:_0x5c9dd1['id']});if(_0x376638!=='Voice'){return;}return db['User'][_0xa039('0x42')]({'where':{'id':_0x1fb250,'online':0x1},'attributes':['id','name',_0xa039('0x8a'),'voicePause',_0xa039('0x8b')],'raw':!![]})['then'](function(_0x43ad1a){var _0x4f82bd=_['map'](_0x43ad1a,function(_0x49e040){return db[_0xa039('0x8c')][_0xa039('0x8d')]({'membername':_0x49e040[_0xa039('0x28')],'UserId':_0x49e040['id'],'queue_name':_0x5c9dd1[_0xa039('0x28')],'VoiceQueueId':_0x5c9dd1['id'],'interface':_['isNil'](_0x49e040[_0xa039('0x8b')])?util[_0xa039('0x8e')](_0xa039('0x8f'),_0x49e040[_0xa039('0x28')]):_0x49e040['interface'],'paused':_0x49e040['voicePause']||![],'penalty':_0x5c9dd1['TeamVoiceQueue'][_0xa039('0x85')]},{'transaction':_0x1ea6d1});});return Promise['all'](_0x4f82bd);});});});return Promise[_0xa039('0x90')](_0x314993);});return Promise[_0xa039('0x90')](_0x11b709);})['then'](function(){return db[_0xa039('0x69')]['findOne']({'where':{'teamId':_0x121da5}})[_0xa039('0x44')](function(_0x5211fe){if(_0x5211fe){var _0x24512d=_[_0xa039('0x31')](_0x1fb250,function(_0x524f75){db[_0xa039('0x6a')]['upsert']({'UserId':_0x524f75,'VoicePrefixId':_0x5211fe['VoicePrefixId']});});return Promise[_0xa039('0x90')](_0x24512d);}});});});return Promise[_0xa039('0x90')](_0x483405)[_0xa039('0x44')](function(){return _0x438bb9[_0xa039('0x7c')](_0x1fb250,{'transaction':_0x1ea6d1})['spread'](function(_0x53b175){return _0x53b175;});});});}})[_0xa039('0x44')](respondWithResult(_0x4ac75b,null))[_0xa039('0x45')](handleError(_0x4ac75b,null));};exports[_0xa039('0x91')]=function(_0xf29efb,_0x59e79f){var _0x3023b9=_[_0xa039('0x92')](_0xf29efb[_0xa039('0x32')]['ids'])?_0xf29efb[_0xa039('0x32')][_0xa039('0x7b')]:[_0xf29efb['query'][_0xa039('0x7b')]];var _0x1a769f=_0xf29efb[_0xa039('0x47')]['id'];return db[_0xa039('0x2b')][_0xa039('0x4e')]({'where':{'id':_0x1a769f}})[_0xa039('0x44')](handleEntityNotFound(_0x59e79f,null))[_0xa039('0x44')](function(_0x551376){if(_0x551376){var _0x3ee11b=[_0xa039('0x7d'),_0xa039('0x7e'),_0xa039('0x7f'),_0xa039('0x80'),_0xa039('0x81'),_0xa039('0x82'),_0xa039('0x83')];return db[_0xa039('0x53')][_0xa039('0x54')](function(_0x118626){var _0x570f62=_[_0xa039('0x31')](_0x3ee11b,function(_0x4dfad8){var _0xdf7983={'attributes':['id',_0xa039('0x28')]};return _0x551376[_0xa039('0x4c')+_0x4dfad8+_0xa039('0x76')](_0xdf7983)[_0xa039('0x44')](function(_0x2348cd){var _0x5970d9=_[_0xa039('0x31')](_0x2348cd,function(_0x4a8a4d){return _0x4a8a4d[_0xa039('0x91')](_0x3023b9,{'transaction':_0x118626})['then'](function(){var _0x2caccd=_[_0xa039('0x31')](_0x3023b9,function(_0x22f909){socket['emit'](_0xa039('0x4a')+_0x4dfad8+_0xa039('0x93'),{'UserId':Number(_0x22f909),[_0x4dfad8+_0xa039('0x86')]:_0x4a8a4d['id']});if(_0x4dfad8!=='Voice'){return;}return db[_0xa039('0x8c')][_0xa039('0x52')]({'where':{'VoiceQueueId':_0x4a8a4d['id'],'UserId':_0x22f909},'transaction':_0x118626});});return Promise['all'](_0x2caccd);});});return Promise[_0xa039('0x90')](_0x5970d9);});});return Promise[_0xa039('0x90')](_0x570f62)['then'](function(){return _0x551376['removeAgents'](_0x3023b9,{'transaction':_0x118626});})[_0xa039('0x44')](function(){return db[_0xa039('0x69')][_0xa039('0x6e')]({'where':{'teamId':_0x1a769f}})[_0xa039('0x44')](function(_0x35a382){if(_0x35a382){var _0x2844e5=_[_0xa039('0x31')](_0x3023b9,function(_0x295482){db['UserVoicePrefix'][_0xa039('0x52')]({'where':{'UserId':_0x295482,'VoicePrefixId':_0x35a382[_0xa039('0x6b')]}});});return Promise['all'](_0x2844e5);}});});});}})[_0xa039('0x44')](respondWithStatusCode(_0x59e79f,null))[_0xa039('0x45')](handleError(_0x59e79f,null));};exports[_0xa039('0x94')]=function(_0x2c442f,_0x5860d7,_0x256b09){var _0x5b84f1={};var _0x2906c1={};var _0x57224a;var _0x2609be;return db[_0xa039('0x2b')][_0xa039('0x6e')]({'where':{'id':_0x2c442f[_0xa039('0x47')]['id']}})['then'](handleEntityNotFound(_0x5860d7,null))['then'](function(_0x49f7e4){if(_0x49f7e4){_0x57224a=_0x49f7e4;_0x2906c1['model']=_['keys'](db[_0xa039('0x95')][_0xa039('0x2c')]);_0x2906c1[_0xa039('0x32')]=_[_0xa039('0x33')](_0x2c442f[_0xa039('0x32')]);_0x2906c1[_0xa039('0x34')]=_[_0xa039('0x36')](_0x2906c1[_0xa039('0x30')],_0x2906c1['query']);_0x5b84f1[_0xa039('0x35')]=_['intersection'](_0x2906c1[_0xa039('0x30')],qs[_0xa039('0x37')](_0x2c442f[_0xa039('0x32')][_0xa039('0x37')]));_0x5b84f1[_0xa039('0x35')]=_0x5b84f1[_0xa039('0x35')][_0xa039('0x38')]?_0x5b84f1[_0xa039('0x35')]:_0x2906c1['model'];_0x5b84f1[_0xa039('0x3b')]=qs[_0xa039('0x3c')](_0x2c442f['query'][_0xa039('0x3c')]);_0x5b84f1['where']=qs[_0xa039('0x34')](_['pick'](_0x2c442f[_0xa039('0x32')],_0x2906c1[_0xa039('0x34')]));if(_0x2c442f[_0xa039('0x32')][_0xa039('0x3e')]){_0x5b84f1[_0xa039('0x3d')]=_[_0xa039('0x3f')](_0x5b84f1[_0xa039('0x3d')],{'$or':_['map'](_0x5b84f1[_0xa039('0x35')],function(_0x5cfe0b){var _0x45b97c={};_0x45b97c[_0x5cfe0b]={'$like':'%'+_0x2c442f[_0xa039('0x32')][_0xa039('0x3e')]+'%'};return _0x45b97c;})});}_0x5b84f1=_[_0xa039('0x3f')]({},_0x5b84f1,_0x2c442f[_0xa039('0x40')]);return _0x57224a['getAgents'](_0x5b84f1);}})[_0xa039('0x44')](function(_0x1f1646){if(_0x1f1646){_0x2609be=_0x1f1646[_0xa039('0x38')];if(!_0x2c442f[_0xa039('0x32')]['hasOwnProperty'](_0xa039('0x96'))){_0x5b84f1[_0xa039('0x3a')]=qs[_0xa039('0x3a')](_0x2c442f[_0xa039('0x32')][_0xa039('0x3a')]);_0x5b84f1['offset']=qs[_0xa039('0x1f')](_0x2c442f[_0xa039('0x32')][_0xa039('0x1f')]);}return _0x57224a[_0xa039('0x94')](_0x5b84f1);}})['then'](function(_0x2f9ae5){if(_0x2f9ae5){return _0x2f9ae5?{'count':_0x2609be,'rows':_0x2f9ae5}:null;}})[_0xa039('0x44')](respondWithResult(_0x5860d7,null))[_0xa039('0x45')](handleError(_0x5860d7,null));}; \ No newline at end of file +var _0x7f3b=['ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','error','name','send','index','map','Team','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','user','get','Teams','autoAssociation','UserProfileResource','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','VoiceQueueId','UserVoiceQueue','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','order','toLowerCase','addQueues','isValidChannel','add','Queues','removeQueues','remove','ids','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','through','penalty','User','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','TeamVoiceQueue','all','upsert','removeAgents','Chat','Fax','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0xfce1e,_0x29cef3){var _0x774129=function(_0x28ff11){while(--_0x28ff11){_0xfce1e['push'](_0xfce1e['shift']());}};_0x774129(++_0x29cef3);}(_0x7f3b,0x8d));var _0xb7f3=function(_0x2b94d0,_0x41f3d6){_0x2b94d0=_0x2b94d0-0x0;var _0x27fd7e=_0x7f3b[_0x2b94d0];return _0x27fd7e;};'use strict';var emlformat=require(_0xb7f3('0x0'));var rimraf=require(_0xb7f3('0x1'));var zipdir=require(_0xb7f3('0x2'));var jsonpatch=require(_0xb7f3('0x3'));var rp=require(_0xb7f3('0x4'));var moment=require('moment');var BPromise=require(_0xb7f3('0x5'));var Mustache=require(_0xb7f3('0x6'));var util=require(_0xb7f3('0x7'));var path=require(_0xb7f3('0x8'));var sox=require(_0xb7f3('0x9'));var csv=require(_0xb7f3('0xa'));var ejs=require(_0xb7f3('0xb'));var fs=require('fs');var fs_extra=require(_0xb7f3('0xc'));var _=require(_0xb7f3('0xd'));var squel=require('squel');var crypto=require(_0xb7f3('0xe'));var jsforce=require(_0xb7f3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb7f3('0xa'));var querystring=require('querystring');var Papa=require(_0xb7f3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb7f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7f3('0x12'));var logger=require(_0xb7f3('0x13'))('api');var utils=require(_0xb7f3('0x14'));var config=require(_0xb7f3('0x15'));var licenseUtil=require(_0xb7f3('0x16'));var db=require(_0xb7f3('0x17'))['db'];config['redis']=_[_0xb7f3('0x18')](config[_0xb7f3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7f3('0x1a'))(new Redis(config[_0xb7f3('0x19')]));require(_0xb7f3('0x1b'))[_0xb7f3('0x1c')](socket);function respondWithStatusCode(_0x51eeca,_0x32930b){_0x32930b=_0x32930b||0xcc;return function(_0x57ef90){if(_0x57ef90){return _0x51eeca[_0xb7f3('0x1d')](_0x32930b);}return _0x51eeca[_0xb7f3('0x1e')](_0x32930b)[_0xb7f3('0x1f')]();};}function respondWithResult(_0x2478ee,_0x14cb10){_0x14cb10=_0x14cb10||0xc8;return function(_0x1e4df6){if(_0x1e4df6){return _0x2478ee[_0xb7f3('0x1e')](_0x14cb10)[_0xb7f3('0x20')](_0x1e4df6);}};}function respondWithFilteredResult(_0x207288,_0x29c170){return function(_0x201684){if(_0x201684){var _0x3791fc=typeof _0x29c170[_0xb7f3('0x21')]==='undefined'&&typeof _0x29c170[_0xb7f3('0x22')]==='undefined';var _0xff8607=_0x201684['count'];var _0x161b12=_0x3791fc?0x0:_0x29c170[_0xb7f3('0x21')];var _0x510b44=_0x3791fc?_0x201684[_0xb7f3('0x23')]:_0x29c170['offset']+_0x29c170[_0xb7f3('0x22')];var _0x45ce23;if(_0x510b44>=_0xff8607){_0x510b44=_0xff8607;_0x45ce23=0xc8;}else{_0x45ce23=0xce;}_0x207288['status'](_0x45ce23);return _0x207288['set'](_0xb7f3('0x24'),_0x161b12+'-'+_0x510b44+'/'+_0xff8607)['json'](_0x201684);}return null;};}function patchUpdates(_0x12acd8){return function(_0x56bdb8){try{jsonpatch['apply'](_0x56bdb8,_0x12acd8,!![]);}catch(_0x49a3c1){return BPromise[_0xb7f3('0x25')](_0x49a3c1);}return _0x56bdb8[_0xb7f3('0x26')]();};}function saveUpdates(_0x14b12c,_0x3494cd){return function(_0x51237f){if(_0x51237f){return _0x51237f[_0xb7f3('0x27')](_0x14b12c)[_0xb7f3('0x28')](function(_0x15ceee){return _0x15ceee;});}return null;};}function handleEntityNotFound(_0x595b7d,_0x4806a6){return function(_0x57ad03){if(!_0x57ad03){_0x595b7d[_0xb7f3('0x1d')](0x194);}return _0x57ad03;};}function handleError(_0x5e76fa,_0x27430c){_0x27430c=_0x27430c||0x1f4;return function(_0x3ef8be){logger[_0xb7f3('0x29')](_0x3ef8be['stack']);if(_0x3ef8be[_0xb7f3('0x2a')]){delete _0x3ef8be[_0xb7f3('0x2a')];}_0x5e76fa[_0xb7f3('0x1e')](_0x27430c)[_0xb7f3('0x2b')](_0x3ef8be);};}exports[_0xb7f3('0x2c')]=function(_0x1b89f9,_0x41b72e){var _0x3b9791={},_0x32f381={},_0x138766={'count':0x0,'rows':[]};var _0x34c5f5=_[_0xb7f3('0x2d')](db[_0xb7f3('0x2e')][_0xb7f3('0x2f')],function(_0x2a7e9b){return{'name':_0x2a7e9b[_0xb7f3('0x30')],'type':_0x2a7e9b[_0xb7f3('0x31')]['key']};});_0x32f381[_0xb7f3('0x32')]=_[_0xb7f3('0x2d')](_0x34c5f5,_0xb7f3('0x2a'));_0x32f381['query']=_[_0xb7f3('0x33')](_0x1b89f9[_0xb7f3('0x34')]);_0x32f381['filters']=_[_0xb7f3('0x35')](_0x32f381[_0xb7f3('0x32')],_0x32f381[_0xb7f3('0x34')]);_0x3b9791[_0xb7f3('0x36')]=_[_0xb7f3('0x35')](_0x32f381[_0xb7f3('0x32')],qs[_0xb7f3('0x37')](_0x1b89f9['query'][_0xb7f3('0x37')]));_0x3b9791['attributes']=_0x3b9791[_0xb7f3('0x36')]['length']?_0x3b9791[_0xb7f3('0x36')]:_0x32f381[_0xb7f3('0x32')];if(!_0x1b89f9[_0xb7f3('0x34')]['hasOwnProperty'](_0xb7f3('0x38'))){_0x3b9791[_0xb7f3('0x22')]=qs[_0xb7f3('0x22')](_0x1b89f9[_0xb7f3('0x34')][_0xb7f3('0x22')]);_0x3b9791[_0xb7f3('0x21')]=qs['offset'](_0x1b89f9[_0xb7f3('0x34')][_0xb7f3('0x21')]);}_0x3b9791['order']=qs[_0xb7f3('0x39')](_0x1b89f9['query'][_0xb7f3('0x39')]);_0x3b9791[_0xb7f3('0x3a')]=qs[_0xb7f3('0x3b')](_[_0xb7f3('0x3c')](_0x1b89f9[_0xb7f3('0x34')],_0x32f381['filters']),_0x34c5f5);if(_0x1b89f9['query'][_0xb7f3('0x3d')]){_0x3b9791[_0xb7f3('0x3a')]=_['merge'](_0x3b9791[_0xb7f3('0x3a')],{'$or':_[_0xb7f3('0x2d')](_0x34c5f5,function(_0x341f66){if(_0x341f66[_0xb7f3('0x31')]!==_0xb7f3('0x3e')){var _0x25688a={};_0x25688a[_0x341f66[_0xb7f3('0x2a')]]={'$like':'%'+_0x1b89f9[_0xb7f3('0x34')][_0xb7f3('0x3d')]+'%'};return _0x25688a;}})});}_0x3b9791=_[_0xb7f3('0x3f')]({},_0x3b9791,_0x1b89f9[_0xb7f3('0x40')]);var _0x1495c0={'where':_0x3b9791[_0xb7f3('0x3a')]};return db[_0xb7f3('0x2e')][_0xb7f3('0x23')](_0x1495c0)[_0xb7f3('0x28')](function(_0x92b420){_0x138766['count']=_0x92b420;if(_0x1b89f9[_0xb7f3('0x34')][_0xb7f3('0x41')]){_0x3b9791['include']=[{'all':!![]}];}return db[_0xb7f3('0x2e')][_0xb7f3('0x42')](_0x3b9791);})[_0xb7f3('0x28')](function(_0x319781){_0x138766[_0xb7f3('0x43')]=_0x319781;return _0x138766;})[_0xb7f3('0x28')](respondWithFilteredResult(_0x41b72e,_0x3b9791))['catch'](handleError(_0x41b72e,null));};exports[_0xb7f3('0x44')]=function(_0x46552d,_0x166b41){var _0xf68dc4={'raw':![],'where':{'id':_0x46552d[_0xb7f3('0x45')]['id']}},_0x2c5388={};_0x2c5388[_0xb7f3('0x32')]=_[_0xb7f3('0x33')](db[_0xb7f3('0x2e')][_0xb7f3('0x2f')]);_0x2c5388[_0xb7f3('0x34')]=_['keys'](_0x46552d[_0xb7f3('0x34')]);_0x2c5388['filters']=_['intersection'](_0x2c5388[_0xb7f3('0x32')],_0x2c5388[_0xb7f3('0x34')]);_0xf68dc4['attributes']=_[_0xb7f3('0x35')](_0x2c5388[_0xb7f3('0x32')],qs[_0xb7f3('0x37')](_0x46552d[_0xb7f3('0x34')][_0xb7f3('0x37')]));_0xf68dc4[_0xb7f3('0x36')]=_0xf68dc4[_0xb7f3('0x36')][_0xb7f3('0x46')]?_0xf68dc4[_0xb7f3('0x36')]:_0x2c5388[_0xb7f3('0x32')];if(_0x46552d[_0xb7f3('0x34')][_0xb7f3('0x41')]){_0xf68dc4[_0xb7f3('0x47')]=[{'all':!![]}];}_0xf68dc4=_[_0xb7f3('0x3f')]({},_0xf68dc4,_0x46552d[_0xb7f3('0x40')]);return db['Team'][_0xb7f3('0x48')](_0xf68dc4)[_0xb7f3('0x28')](handleEntityNotFound(_0x166b41,null))[_0xb7f3('0x28')](respondWithResult(_0x166b41,null))[_0xb7f3('0x49')](handleError(_0x166b41,null));};exports[_0xb7f3('0x4a')]=function(_0x1f2a2d,_0x4356eb){return db[_0xb7f3('0x2e')][_0xb7f3('0x4a')](_0x1f2a2d[_0xb7f3('0x4b')],{})[_0xb7f3('0x28')](function(_0x2c237e){var _0x36de72=_0x1f2a2d[_0xb7f3('0x4c')]['get']({'plain':!![]});if(!_0x36de72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36de72['role']===_0xb7f3('0x4c')){var _0x43ccee=_0x2c237e[_0xb7f3('0x4d')]({'plain':!![]});var _0x52e04d=_0xb7f3('0x4e');return db['UserProfileSection'][_0xb7f3('0x48')]({'where':{'name':_0x52e04d,'userProfileId':_0x36de72['userProfileId']},'raw':!![]})[_0xb7f3('0x28')](function(_0x1fadf3){if(_0x1fadf3&&_0x1fadf3[_0xb7f3('0x4f')]===0x0){return db[_0xb7f3('0x50')]['create']({'name':_0x43ccee[_0xb7f3('0x2a')],'resourceId':_0x43ccee['id'],'type':_0x1fadf3[_0xb7f3('0x2a')],'sectionId':_0x1fadf3['id']},{})[_0xb7f3('0x28')](function(){return _0x2c237e;});}else{return _0x2c237e;}})[_0xb7f3('0x49')](function(_0x4a3891){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a3891);throw _0x4a3891;});}return _0x2c237e;})['then'](respondWithResult(_0x4356eb,0xc9))[_0xb7f3('0x49')](handleError(_0x4356eb,null));};exports['update']=function(_0x58034f,_0x4d3d02){if(_0x58034f[_0xb7f3('0x4b')]['id']){delete _0x58034f['body']['id'];}return db[_0xb7f3('0x2e')]['find']({'where':{'id':_0x58034f['params']['id']}})[_0xb7f3('0x28')](handleEntityNotFound(_0x4d3d02,null))[_0xb7f3('0x28')](saveUpdates(_0x58034f['body'],null))[_0xb7f3('0x28')](respondWithResult(_0x4d3d02,null))[_0xb7f3('0x49')](handleError(_0x4d3d02,null));};exports[_0xb7f3('0x51')]=function(_0x1de189,_0x30756b){var _0x2bd3d6=_0x1de189['params']['id'];var _0x3e6348=[];return db[_0xb7f3('0x52')][_0xb7f3('0x53')](function(_0x1f0bd0){var _0x1009bf=_0xb7f3('0x54')+_0x2bd3d6;return db['sequelize'][_0xb7f3('0x34')](_0x1009bf,{'type':db['Sequelize'][_0xb7f3('0x55')]['SELECT'],'raw':!![],'transaction':_0x1f0bd0})[_0xb7f3('0x28')](function(_0x15673b){_0x3e6348=_[_0xb7f3('0x2d')](_0x15673b,function(_0x2ba54e){return Number(_0x2ba54e[_0xb7f3('0x56')]);});})[_0xb7f3('0x28')](function(){var _0x48e302=_0xb7f3('0x57')+_0x2bd3d6;return db[_0xb7f3('0x52')][_0xb7f3('0x34')](_0x48e302,{'type':db[_0xb7f3('0x58')][_0xb7f3('0x55')][_0xb7f3('0x59')],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x4d434d){var _0xa24263=_[_0xb7f3('0x2d')](_0x4d434d,function(_0x472107){return Number(_0x472107[_0xb7f3('0x5a')]);});return db[_0xb7f3('0x5b')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'VoiceQueueId':{'$in':_0xa24263}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){var _0x2c6e4e='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2bd3d6;return db[_0xb7f3('0x52')][_0xb7f3('0x34')](_0x2c6e4e,{'type':db['Sequelize']['QueryTypes'][_0xb7f3('0x59')],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x44a530){var _0x451f8b=_[_0xb7f3('0x2d')](_0x44a530,function(_0x2ea768){return Number(_0x2ea768[_0xb7f3('0x5c')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x3e6348},'MailQueueId':{'$in':_0x451f8b}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){var _0x4beb34=_0xb7f3('0x5d')+_0x2bd3d6;return db[_0xb7f3('0x52')][_0xb7f3('0x34')](_0x4beb34,{'type':db['Sequelize'][_0xb7f3('0x55')]['SELECT'],'raw':!![],'transaction':_0x1f0bd0});})['then'](function(_0x5c8c9e){var _0x19b01b=_[_0xb7f3('0x2d')](_0x5c8c9e,function(_0x40d52b){return Number(_0x40d52b[_0xb7f3('0x5e')]);});return db[_0xb7f3('0x5f')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'SmsQueueId':{'$in':_0x19b01b}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){var _0x1e17d1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2bd3d6;return db[_0xb7f3('0x52')][_0xb7f3('0x34')](_0x1e17d1,{'type':db['Sequelize'][_0xb7f3('0x55')][_0xb7f3('0x59')],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x5f01bd){var _0x1c4bfa=_['map'](_0x5f01bd,function(_0x4c3943){return Number(_0x4c3943['ChatQueueId']);});return db[_0xb7f3('0x60')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'ChatQueueId':{'$in':_0x1c4bfa}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){var _0x292e6f=_0xb7f3('0x61')+_0x2bd3d6;return db['sequelize']['query'](_0x292e6f,{'type':db[_0xb7f3('0x58')]['QueryTypes'][_0xb7f3('0x59')],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x2220f6){var _0xa97d27=_[_0xb7f3('0x2d')](_0x2220f6,function(_0x2573ac){return Number(_0x2573ac[_0xb7f3('0x62')]);});return db['UserFaxQueue'][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'FaxQueueId':{'$in':_0xa97d27}},'transaction':_0x1f0bd0});})['then'](function(){var _0x1731d9=_0xb7f3('0x63')+_0x2bd3d6;return db['sequelize']['query'](_0x1731d9,{'type':db[_0xb7f3('0x58')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x1112c6){var _0x212d68=_['map'](_0x1112c6,function(_0x4f93a5){return Number(_0x4f93a5[_0xb7f3('0x64')]);});return db[_0xb7f3('0x65')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'OpenchannelQueueId':{'$in':_0x212d68}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){var _0x32fed2=_0xb7f3('0x66')+_0x2bd3d6;return db['sequelize'][_0xb7f3('0x34')](_0x32fed2,{'type':db[_0xb7f3('0x58')][_0xb7f3('0x55')][_0xb7f3('0x59')],'raw':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x30ec89){var _0x4fda14=_[_0xb7f3('0x2d')](_0x30ec89,function(_0x325deb){return Number(_0x325deb[_0xb7f3('0x67')]);});return db[_0xb7f3('0x68')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'WhatsappQueueId':{'$in':_0x4fda14}},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){return db[_0xb7f3('0x69')][_0xb7f3('0x48')]({'where':{'TeamId':_0x2bd3d6}});})[_0xb7f3('0x28')](function(_0x2cbc45){if(_0x2cbc45===null){return;}return db[_0xb7f3('0x6a')][_0xb7f3('0x51')]({'where':{'UserId':{'$in':_0x3e6348},'VoicePrefixId':_0x2cbc45[_0xb7f3('0x6b')]},'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(){return db[_0xb7f3('0x2e')]['destroy']({'where':{'id':_0x2bd3d6},'cascade':!![],'transaction':_0x1f0bd0});})[_0xb7f3('0x28')](function(_0x5c5e0c){if(_0x5c5e0c===0x0){_0x30756b[_0xb7f3('0x1d')](0x194);}else{return db[_0xb7f3('0x50')][_0xb7f3('0x51')]({'where':{'type':'Teams','resourceId':_0x2bd3d6},'cascade':!![],'transaction':_0x1f0bd0})[_0xb7f3('0x28')](function(){_0x30756b['status'](0xcc)[_0xb7f3('0x1f')]();});}})[_0xb7f3('0x49')](function(_0x5065b4){_0x30756b[_0xb7f3('0x1e')](0x1f4)[_0xb7f3('0x2b')](_0x5065b4);});});};exports[_0xb7f3('0x6c')]=function(_0x9c0d60,_0x2f7b93,_0x237c1d){return db[_0xb7f3('0x2e')][_0xb7f3('0x6d')]({'where':{'id':_0x9c0d60[_0xb7f3('0x45')]['id']}})[_0xb7f3('0x28')](handleEntityNotFound(_0x2f7b93,null))['then'](function(_0x221379){if(!_0x9c0d60[_0xb7f3('0x34')]['channel']||!utils['isValidChannel'](_0x9c0d60[_0xb7f3('0x34')][_0xb7f3('0x6e')])){throw new db[(_0xb7f3('0x58'))][(_0xb7f3('0x6f'))](_0xb7f3('0x70'));}var _0x5ec7b2={};var _0x3a8ccc={};_0x3a8ccc[_0xb7f3('0x32')]=_[_0xb7f3('0x33')](db[_[_0xb7f3('0x71')](_0x9c0d60['query']['channel']['toLowerCase']())+'Queue'][_0xb7f3('0x2f')]);_0x3a8ccc[_0xb7f3('0x34')]=_[_0xb7f3('0x33')](_0x9c0d60[_0xb7f3('0x34')]);_0x3a8ccc[_0xb7f3('0x3b')]=_['intersection'](_0x3a8ccc[_0xb7f3('0x32')],_0x3a8ccc['query']);_0x5ec7b2[_0xb7f3('0x36')]=_[_0xb7f3('0x35')](_0x3a8ccc['model'],qs['fields'](_0x9c0d60[_0xb7f3('0x34')]['fields']));_0x5ec7b2['attributes']=_0x5ec7b2[_0xb7f3('0x36')]['length']?_0x5ec7b2[_0xb7f3('0x36')]:_0x3a8ccc['model'];_0x5ec7b2['limit']=qs[_0xb7f3('0x22')](_0x9c0d60[_0xb7f3('0x34')]['limit']);_0x5ec7b2[_0xb7f3('0x21')]=qs[_0xb7f3('0x21')](_0x9c0d60[_0xb7f3('0x34')][_0xb7f3('0x21')]);_0x5ec7b2[_0xb7f3('0x72')]=qs['sort'](_0x9c0d60['query'][_0xb7f3('0x39')]);_0x5ec7b2['where']=qs[_0xb7f3('0x3b')](_['pick'](_0x9c0d60[_0xb7f3('0x34')],_0x3a8ccc[_0xb7f3('0x3b')]));_0x5ec7b2=_[_0xb7f3('0x3f')]({},_0x5ec7b2,_0x9c0d60['options']);return _0x221379[_0xb7f3('0x4d')+_[_0xb7f3('0x71')](_0x9c0d60[_0xb7f3('0x34')][_0xb7f3('0x6e')][_0xb7f3('0x73')]())+'Queues'](_0x5ec7b2);})[_0xb7f3('0x28')](respondWithResult(_0x2f7b93,null))[_0xb7f3('0x49')](handleError(_0x2f7b93,null));};exports[_0xb7f3('0x74')]=function(_0x356328,_0x4cd25d,_0x13469e){return db[_0xb7f3('0x2e')][_0xb7f3('0x6d')]({'where':{'id':_0x356328[_0xb7f3('0x45')]['id']}})[_0xb7f3('0x28')](function(_0x1c0490){if(_0x1c0490){if(!_0x356328['body'][_0xb7f3('0x6e')]||!utils[_0xb7f3('0x75')](_0x356328[_0xb7f3('0x4b')][_0xb7f3('0x6e')])){throw new db[(_0xb7f3('0x58'))][(_0xb7f3('0x6f'))](_0xb7f3('0x70'));}return _0x1c0490[_0xb7f3('0x76')+_[_0xb7f3('0x71')](_0x356328[_0xb7f3('0x4b')][_0xb7f3('0x6e')][_0xb7f3('0x73')]())+_0xb7f3('0x77')](_0x356328[_0xb7f3('0x4b')]['ids']);}return null;})[_0xb7f3('0x28')](handleEntityNotFound(_0x4cd25d,null))['then'](respondWithStatusCode(_0x4cd25d,null))[_0xb7f3('0x49')](handleError(_0x4cd25d,null));};exports[_0xb7f3('0x78')]=function(_0x56e7cd,_0x5dd903,_0x4c15ed){return db['Team'][_0xb7f3('0x6d')]({'where':{'id':_0x56e7cd['params']['id']}})['then'](function(_0x24700e){if(_0x24700e){if(!_0x56e7cd['query'][_0xb7f3('0x6e')]||!utils[_0xb7f3('0x75')](_0x56e7cd[_0xb7f3('0x34')][_0xb7f3('0x6e')])){throw new db[(_0xb7f3('0x58'))][(_0xb7f3('0x6f'))](_0xb7f3('0x70'));}return _0x24700e[_0xb7f3('0x79')+_['capitalize'](_0x56e7cd[_0xb7f3('0x34')][_0xb7f3('0x6e')][_0xb7f3('0x73')]())+_0xb7f3('0x77')](_0x56e7cd[_0xb7f3('0x34')][_0xb7f3('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x5dd903,null))['then'](respondWithStatusCode(_0x5dd903,null))['catch'](handleError(_0x5dd903,null));};exports[_0xb7f3('0x7b')]=function(_0x2b14db,_0x2fe9dd){var _0x37d46=_[_0xb7f3('0x7c')](_0x2b14db[_0xb7f3('0x4b')][_0xb7f3('0x7a')])?_0x2b14db[_0xb7f3('0x4b')][_0xb7f3('0x7a')]:[_0x2b14db[_0xb7f3('0x4b')][_0xb7f3('0x7a')]];var _0x52b1d=_0x2b14db[_0xb7f3('0x45')]['id'];return db[_0xb7f3('0x2e')][_0xb7f3('0x48')]({'where':{'id':_0x52b1d}})[_0xb7f3('0x28')](handleEntityNotFound(_0x2fe9dd,null))[_0xb7f3('0x28')](function(_0x2ceafb){if(_0x2ceafb){var _0x3bdd3d=[_0xb7f3('0x7d'),'Chat',_0xb7f3('0x7e'),_0xb7f3('0x7f'),'Fax',_0xb7f3('0x80'),_0xb7f3('0x81')];return db[_0xb7f3('0x52')]['transaction'](function(_0x49d949){var _0xd1dc8c=_[_0xb7f3('0x2d')](_0x3bdd3d,function(_0x23870d){var _0x26e184={'attributes':['id',_0xb7f3('0x2a')]};if(_0x23870d===_0xb7f3('0x7d')){_0x26e184[_0xb7f3('0x82')]={'attributes':[_0xb7f3('0x83')]};}return _0x2ceafb[_0xb7f3('0x4d')+_0x23870d+_0xb7f3('0x77')](_0x26e184)[_0xb7f3('0x28')](function(_0x20da51){var _0x5261b8=_[_0xb7f3('0x2d')](_0x20da51,function(_0x2e223b){var _0x47deee=_[_0xb7f3('0x2d')](_0x37d46,function(_0x300c67){var _0x5c9d49={'where':{'UserId':_0x300c67,[_0x23870d+'QueueId']:_0x2e223b['id']},'transaction':_0x49d949};if(_0x23870d==='Voice'){_0x5c9d49[_0xb7f3('0x18')]={'penalty':_0x2e223b['TeamVoiceQueue'][_0xb7f3('0x83')]};}return db[_0xb7f3('0x84')+_0x23870d+'Queue']['findOrCreate'](_0x5c9d49)[_0xb7f3('0x28')](function(){socket[_0xb7f3('0x85')](_0xb7f3('0x4c')+_0x23870d+_0xb7f3('0x86'),{'UserId':_0x300c67,[_0x23870d+_0xb7f3('0x87')]:_0x2e223b['id']});if(_0x23870d!==_0xb7f3('0x7d')){return;}return db[_0xb7f3('0x84')][_0xb7f3('0x42')]({'where':{'id':_0x37d46,'online':0x1},'attributes':['id','name',_0xb7f3('0x88'),_0xb7f3('0x89'),_0xb7f3('0x8a')],'raw':!![]})['then'](function(_0x311bb3){var _0x35fa2c=_[_0xb7f3('0x2d')](_0x311bb3,function(_0x18cfad){return db[_0xb7f3('0x8b')]['upsert']({'membername':_0x18cfad[_0xb7f3('0x2a')],'UserId':_0x18cfad['id'],'queue_name':_0x2e223b['name'],'VoiceQueueId':_0x2e223b['id'],'interface':_[_0xb7f3('0x8c')](_0x18cfad[_0xb7f3('0x8a')])?util[_0xb7f3('0x8d')](_0xb7f3('0x8e'),_0x18cfad['name']):_0x18cfad[_0xb7f3('0x8a')],'paused':_0x18cfad['voicePause']||![],'penalty':_0x2e223b[_0xb7f3('0x8f')][_0xb7f3('0x83')]},{'transaction':_0x49d949});});return Promise['all'](_0x35fa2c);});});});return Promise[_0xb7f3('0x90')](_0x47deee);});return Promise[_0xb7f3('0x90')](_0x5261b8);})[_0xb7f3('0x28')](function(){return db[_0xb7f3('0x69')][_0xb7f3('0x6d')]({'where':{'teamId':_0x52b1d}})[_0xb7f3('0x28')](function(_0xd3d184){if(_0xd3d184){var _0x178e13=_[_0xb7f3('0x2d')](_0x37d46,function(_0x4d9f2e){db[_0xb7f3('0x6a')][_0xb7f3('0x91')]({'UserId':_0x4d9f2e,'VoicePrefixId':_0xd3d184[_0xb7f3('0x6b')]});});return Promise[_0xb7f3('0x90')](_0x178e13);}});});});return Promise['all'](_0xd1dc8c)[_0xb7f3('0x28')](function(){return _0x2ceafb[_0xb7f3('0x7b')](_0x37d46,{'transaction':_0x49d949})['spread'](function(_0x4b4cdc){return _0x4b4cdc;});});});}})[_0xb7f3('0x28')](respondWithResult(_0x2fe9dd,null))[_0xb7f3('0x49')](handleError(_0x2fe9dd,null));};exports[_0xb7f3('0x92')]=function(_0xf8b437,_0x3a83cf){var _0x194c15=_['isArray'](_0xf8b437[_0xb7f3('0x34')][_0xb7f3('0x7a')])?_0xf8b437[_0xb7f3('0x34')]['ids']:[_0xf8b437[_0xb7f3('0x34')][_0xb7f3('0x7a')]];var _0x32af07=_0xf8b437[_0xb7f3('0x45')]['id'];return db[_0xb7f3('0x2e')][_0xb7f3('0x48')]({'where':{'id':_0x32af07}})[_0xb7f3('0x28')](handleEntityNotFound(_0x3a83cf,null))['then'](function(_0x5ab0a3){if(_0x5ab0a3){var _0x4dee6b=[_0xb7f3('0x7d'),_0xb7f3('0x93'),_0xb7f3('0x7e'),_0xb7f3('0x7f'),_0xb7f3('0x94'),_0xb7f3('0x80'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x226a06){var _0xd09b39=_[_0xb7f3('0x2d')](_0x4dee6b,function(_0xdd7ddc){var _0x32ca50={'attributes':['id',_0xb7f3('0x2a')]};return _0x5ab0a3[_0xb7f3('0x4d')+_0xdd7ddc+'Queues'](_0x32ca50)[_0xb7f3('0x28')](function(_0x563041){var _0x2d2e6d=_[_0xb7f3('0x2d')](_0x563041,function(_0x3b0229){return _0x3b0229[_0xb7f3('0x92')](_0x194c15,{'transaction':_0x226a06})[_0xb7f3('0x28')](function(){var _0xf7501b=_[_0xb7f3('0x2d')](_0x194c15,function(_0x3b63f3){socket[_0xb7f3('0x85')](_0xb7f3('0x4c')+_0xdd7ddc+_0xb7f3('0x95'),{'UserId':Number(_0x3b63f3),[_0xdd7ddc+_0xb7f3('0x87')]:_0x3b0229['id']});if(_0xdd7ddc!==_0xb7f3('0x7d')){return;}return db[_0xb7f3('0x8b')][_0xb7f3('0x51')]({'where':{'VoiceQueueId':_0x3b0229['id'],'UserId':_0x3b63f3},'transaction':_0x226a06});});return Promise[_0xb7f3('0x90')](_0xf7501b);});});return Promise[_0xb7f3('0x90')](_0x2d2e6d);});});return Promise['all'](_0xd09b39)['then'](function(){return _0x5ab0a3['removeAgents'](_0x194c15,{'transaction':_0x226a06});})['then'](function(){return db[_0xb7f3('0x69')]['findOne']({'where':{'teamId':_0x32af07}})[_0xb7f3('0x28')](function(_0x29480b){if(_0x29480b){var _0x39c407=_[_0xb7f3('0x2d')](_0x194c15,function(_0x5a6260){db['UserVoicePrefix'][_0xb7f3('0x51')]({'where':{'UserId':_0x5a6260,'VoicePrefixId':_0x29480b[_0xb7f3('0x6b')]}});});return Promise[_0xb7f3('0x90')](_0x39c407);}});});});}})['then'](respondWithStatusCode(_0x3a83cf,null))['catch'](handleError(_0x3a83cf,null));};exports[_0xb7f3('0x96')]=function(_0x36a0ea,_0x49a6ce,_0x545b39){var _0x40f6a4={};var _0x17b554={};var _0x418f73;var _0x434557;return db[_0xb7f3('0x2e')][_0xb7f3('0x6d')]({'where':{'id':_0x36a0ea[_0xb7f3('0x45')]['id']}})[_0xb7f3('0x28')](handleEntityNotFound(_0x49a6ce,null))[_0xb7f3('0x28')](function(_0x3718ed){if(_0x3718ed){_0x418f73=_0x3718ed;_0x17b554[_0xb7f3('0x32')]=_['keys'](db[_0xb7f3('0x84')][_0xb7f3('0x2f')]);_0x17b554['query']=_[_0xb7f3('0x33')](_0x36a0ea[_0xb7f3('0x34')]);_0x17b554['filters']=_['intersection'](_0x17b554[_0xb7f3('0x32')],_0x17b554[_0xb7f3('0x34')]);_0x40f6a4['attributes']=_[_0xb7f3('0x35')](_0x17b554[_0xb7f3('0x32')],qs[_0xb7f3('0x37')](_0x36a0ea[_0xb7f3('0x34')][_0xb7f3('0x37')]));_0x40f6a4[_0xb7f3('0x36')]=_0x40f6a4[_0xb7f3('0x36')]['length']?_0x40f6a4['attributes']:_0x17b554[_0xb7f3('0x32')];_0x40f6a4[_0xb7f3('0x72')]=qs['sort'](_0x36a0ea['query'][_0xb7f3('0x39')]);_0x40f6a4['where']=qs[_0xb7f3('0x3b')](_[_0xb7f3('0x3c')](_0x36a0ea[_0xb7f3('0x34')],_0x17b554[_0xb7f3('0x3b')]));if(_0x36a0ea[_0xb7f3('0x34')][_0xb7f3('0x3d')]){_0x40f6a4[_0xb7f3('0x3a')]=_[_0xb7f3('0x3f')](_0x40f6a4[_0xb7f3('0x3a')],{'$or':_['map'](_0x40f6a4[_0xb7f3('0x36')],function(_0x3b5862){var _0x1fa542={};_0x1fa542[_0x3b5862]={'$like':'%'+_0x36a0ea[_0xb7f3('0x34')][_0xb7f3('0x3d')]+'%'};return _0x1fa542;})});}_0x40f6a4=_[_0xb7f3('0x3f')]({},_0x40f6a4,_0x36a0ea[_0xb7f3('0x40')]);return _0x418f73['getAgents'](_0x40f6a4);}})[_0xb7f3('0x28')](function(_0x20d3ca){if(_0x20d3ca){_0x434557=_0x20d3ca[_0xb7f3('0x46')];if(!_0x36a0ea[_0xb7f3('0x34')][_0xb7f3('0x97')](_0xb7f3('0x38'))){_0x40f6a4[_0xb7f3('0x22')]=qs[_0xb7f3('0x22')](_0x36a0ea[_0xb7f3('0x34')][_0xb7f3('0x22')]);_0x40f6a4['offset']=qs[_0xb7f3('0x21')](_0x36a0ea['query'][_0xb7f3('0x21')]);}return _0x418f73[_0xb7f3('0x96')](_0x40f6a4);}})['then'](function(_0x521108){if(_0x521108){return _0x521108?{'count':_0x434557,'rows':_0x521108}:null;}})[_0xb7f3('0x28')](respondWithResult(_0x49a6ce,null))[_0xb7f3('0x49')](handleError(_0x49a6ce,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 52edf23..637b982 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 _0x0577=['emit','hasOwnProperty','hook','events','../../mysqldb','Team','save','remove'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0577,0x153));var _0x7057=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x0577[_0x344a3f];return _0x264712;};'use strict';var EventEmitter=require(_0x7057('0x0'));var Team=require(_0x7057('0x1'))['db'][_0x7057('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7057('0x3'),'afterUpdate':'update','afterDestroy':_0x7057('0x4')};function emitEvent(_0x26e0b2){return function(_0x389679,_0x2547bb,_0x1a70af){TeamEvents[_0x7057('0x5')](_0x26e0b2+':'+_0x389679['id'],_0x389679);TeamEvents[_0x7057('0x5')](_0x26e0b2,_0x389679);_0x1a70af(null);};}for(var e in events){if(events[_0x7057('0x6')](e)){var event=events[e];Team[_0x7057('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc243=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x3e23fd,_0x324cb8){var _0x23e70d=function(_0x34ce32){while(--_0x34ce32){_0x3e23fd['push'](_0x3e23fd['shift']());}};_0x23e70d(++_0x324cb8);}(_0xc243,0xe8));var _0x3c24=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0xc243[_0x3b085];return _0x476a57;};'use strict';var EventEmitter=require(_0x3c24('0x0'));var Team=require(_0x3c24('0x1'))['db'][_0x3c24('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3c24('0x3')](0x0);var events={'afterCreate':_0x3c24('0x4'),'afterUpdate':_0x3c24('0x5'),'afterDestroy':_0x3c24('0x6')};function emitEvent(_0x1351d8){return function(_0x1d291a,_0x5ba66d,_0x43b108){TeamEvents[_0x3c24('0x7')](_0x1351d8+':'+_0x1d291a['id'],_0x1d291a);TeamEvents['emit'](_0x1351d8,_0x1d291a);_0x43b108(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x3c24('0x8')](e,emitEvent(event));}}module[_0x3c24('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 886358b..15d6a4b 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 _0xaeda=['./team.attributes','define','Team','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c4c6e,_0x5646c8){var _0x10cf4b=function(_0x276e48){while(--_0x276e48){_0x3c4c6e['push'](_0x3c4c6e['shift']());}};_0x10cf4b(++_0x5646c8);}(_0xaeda,0x86));var _0xaaed=function(_0x35a829,_0x3c43ea){_0x35a829=_0x35a829-0x0;var _0x5b1b5f=_0xaeda[_0x35a829];return _0x5b1b5f;};'use strict';var _=require(_0xaaed('0x0'));var util=require(_0xaaed('0x1'));var logger=require(_0xaaed('0x2'))(_0xaaed('0x3'));var moment=require(_0xaaed('0x4'));var BPromise=require(_0xaaed('0x5'));var rp=require(_0xaaed('0x6'));var fs=require('fs');var path=require(_0xaaed('0x7'));var rimraf=require(_0xaaed('0x8'));var config=require('../../config/environment');var attributes=require(_0xaaed('0x9'));module['exports']=function(_0x224764,_0x4a7ac2){return _0x224764[_0xaaed('0xa')](_0xaaed('0xb'),attributes,{'tableName':_0xaaed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8267=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams'];(function(_0x45d174,_0x47c6bb){var _0x3a0128=function(_0xdd4c62){while(--_0xdd4c62){_0x45d174['push'](_0x45d174['shift']());}};_0x3a0128(++_0x47c6bb);}(_0x8267,0x134));var _0x7826=function(_0x36f694,_0x45f0ce){_0x36f694=_0x36f694-0x0;var _0x442ba9=_0x8267[_0x36f694];return _0x442ba9;};'use strict';var _=require(_0x7826('0x0'));var util=require('util');var logger=require(_0x7826('0x1'))(_0x7826('0x2'));var moment=require(_0x7826('0x3'));var BPromise=require(_0x7826('0x4'));var rp=require(_0x7826('0x5'));var fs=require('fs');var path=require(_0x7826('0x6'));var rimraf=require(_0x7826('0x7'));var config=require(_0x7826('0x8'));var attributes=require(_0x7826('0x9'));module[_0x7826('0xa')]=function(_0x809e43,_0x4b99b7){return _0x809e43[_0x7826('0xb')](_0x7826('0xc'),attributes,{'tableName':_0x7826('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 161c084..b19447d 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 _0x8621=['ioredis','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','randomstring'];(function(_0x3c9b55,_0xf40d61){var _0x5ac8c2=function(_0x44ca09){while(--_0x44ca09){_0x3c9b55['push'](_0x3c9b55['shift']());}};_0x5ac8c2(++_0xf40d61);}(_0x8621,0x1c5));var _0x1862=function(_0x3509dc,_0x58bcf9){_0x3509dc=_0x3509dc-0x0;var _0x941d4b=_0x8621[_0x3509dc];return _0x941d4b;};'use strict';var _=require('lodash');var util=require(_0x1862('0x0'));var moment=require(_0x1862('0x1'));var BPromise=require('bluebird');var rs=require(_0x1862('0x2'));var fs=require('fs');var Redis=require(_0x1862('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1862('0x4'))('rpc');var config=require(_0x1862('0x5'));var jayson=require(_0x1862('0x6'));var client=jayson['client'][_0x1862('0x7')]({'port':0x232a});config[_0x1862('0x8')]=_['defaults'](config['redis'],{'host':_0x1862('0x9'),'port':0x18eb});var socket=require(_0x1862('0xa'))(new Redis(config[_0x1862('0x8')]));require(_0x1862('0xb'))[_0x1862('0xc')](socket);function respondWithRpcPromise(_0x39d8ef,_0x3dd8a6,_0x59f004){return new BPromise(function(_0x15fb3a,_0x331fb6){return client[_0x1862('0xd')](_0x39d8ef,_0x59f004)[_0x1862('0xe')](function(_0x294533){logger[_0x1862('0xf')](_0x1862('0x10'),_0x3dd8a6,_0x1862('0x11'));logger[_0x1862('0x12')](_0x1862('0x13'),_0x3dd8a6,_0x1862('0x11'),JSON[_0x1862('0x14')](_0x294533));if(_0x294533[_0x1862('0x15')]){if(_0x294533['error']['code']===0x1f4){logger[_0x1862('0x15')](_0x1862('0x10'),_0x3dd8a6,_0x294533['error'][_0x1862('0x16')]);return _0x331fb6(_0x294533[_0x1862('0x15')][_0x1862('0x16')]);}logger[_0x1862('0x15')](_0x1862('0x10'),_0x3dd8a6,_0x294533[_0x1862('0x15')][_0x1862('0x16')]);return _0x15fb3a(_0x294533[_0x1862('0x15')]['message']);}else{logger['info'](_0x1862('0x10'),_0x3dd8a6,_0x1862('0x11'));_0x15fb3a(_0x294533[_0x1862('0x17')][_0x1862('0x16')]);}})['catch'](function(_0x177a2b){logger[_0x1862('0x15')](_0x1862('0x10'),_0x3dd8a6,_0x177a2b);_0x331fb6(_0x177a2b);});});} \ No newline at end of file +var _0x220a=['socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x220a,0x13b));var _0xa220=function(_0x537614,_0x290721){_0x537614=_0x537614-0x0;var _0xb77b8a=_0x220a[_0x537614];return _0xb77b8a;};'use strict';var _=require(_0xa220('0x0'));var util=require(_0xa220('0x1'));var moment=require(_0xa220('0x2'));var BPromise=require(_0xa220('0x3'));var rs=require(_0xa220('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa220('0x5'))['db'];var utils=require(_0xa220('0x6'));var logger=require(_0xa220('0x7'))(_0xa220('0x8'));var config=require(_0xa220('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa220('0xa')][_0xa220('0xb')]({'port':0x232a});config[_0xa220('0xc')]=_[_0xa220('0xd')](config['redis'],{'host':_0xa220('0xe'),'port':0x18eb});var socket=require(_0xa220('0xf'))(new Redis(config[_0xa220('0xc')]));require(_0xa220('0x10'))[_0xa220('0x11')](socket);function respondWithRpcPromise(_0x167ae7,_0x4ddb31,_0x393a71){return new BPromise(function(_0x322da7,_0x582cbc){return client[_0xa220('0x12')](_0x167ae7,_0x393a71)[_0xa220('0x13')](function(_0x3f5628){logger[_0xa220('0x14')](_0xa220('0x15'),_0x4ddb31,_0xa220('0x16'));logger[_0xa220('0x17')](_0xa220('0x18'),_0x4ddb31,_0xa220('0x16'),JSON[_0xa220('0x19')](_0x3f5628));if(_0x3f5628[_0xa220('0x1a')]){if(_0x3f5628[_0xa220('0x1a')]['code']===0x1f4){logger['error'](_0xa220('0x15'),_0x4ddb31,_0x3f5628[_0xa220('0x1a')][_0xa220('0x1b')]);return _0x582cbc(_0x3f5628[_0xa220('0x1a')][_0xa220('0x1b')]);}logger['error']('Team,\x20%s,\x20%s',_0x4ddb31,_0x3f5628[_0xa220('0x1a')][_0xa220('0x1b')]);return _0x322da7(_0x3f5628[_0xa220('0x1a')][_0xa220('0x1b')]);}else{logger['info'](_0xa220('0x15'),_0x4ddb31,_0xa220('0x16'));_0x322da7(_0x3f5628[_0xa220('0x1c')][_0xa220('0x1b')]);}})[_0xa220('0x1d')](function(_0xd32080){logger['error'](_0xa220('0x15'),_0x4ddb31,_0xd32080);_0x582cbc(_0xd32080);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f86b6f3..cf51bf2 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 _0x240b=['register','./team.events','save','remove','update','removeListener'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x240b,0xd9));var _0xb240=function(_0xe6fb8,_0x469e38){_0xe6fb8=_0xe6fb8-0x0;var _0x36b73d=_0x240b[_0xe6fb8];return _0x36b73d;};'use strict';var TeamEvents=require(_0xb240('0x0'));var events=[_0xb240('0x1'),_0xb240('0x2'),_0xb240('0x3')];function createListener(_0x5cdc0a,_0x350fd2){return function(_0x39eaa1){_0x350fd2['emit'](_0x5cdc0a,_0x39eaa1);};}function removeListener(_0x1c2577,_0x334901){return function(){TeamEvents[_0xb240('0x4')](_0x1c2577,_0x334901);};}exports[_0xb240('0x5')]=function(_0x1c4376){for(var _0x226854=0x0,_0x192ec2=events['length'];_0x226854<_0x192ec2;_0x226854++){var _0x31cb97=events[_0x226854];var _0x102043=createListener('team:'+_0x31cb97,_0x1c4376);TeamEvents['on'](_0x31cb97,_0x102043);}}; \ No newline at end of file +var _0x6a7c=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x45f235,_0x4eee79){var _0x4bab9c=function(_0x4fcbe9){while(--_0x4fcbe9){_0x45f235['push'](_0x45f235['shift']());}};_0x4bab9c(++_0x4eee79);}(_0x6a7c,0x166));var _0xc6a7=function(_0x49e90c,_0x310d75){_0x49e90c=_0x49e90c-0x0;var _0xbb0d3d=_0x6a7c[_0x49e90c];return _0xbb0d3d;};'use strict';var TeamEvents=require(_0xc6a7('0x0'));var events=[_0xc6a7('0x1'),_0xc6a7('0x2'),_0xc6a7('0x3')];function createListener(_0xc3a079,_0x5a07ad){return function(_0x2d35e4){_0x5a07ad[_0xc6a7('0x4')](_0xc3a079,_0x2d35e4);};}function removeListener(_0x3c4e93,_0x343e33){return function(){TeamEvents[_0xc6a7('0x5')](_0x3c4e93,_0x343e33);};}exports[_0xc6a7('0x6')]=function(_0x6868eb){for(var _0x4a6d2d=0x0,_0x32e569=events[_0xc6a7('0x7')];_0x4a6d2d<_0x32e569;_0x4a6d2d++){var _0xec4861=events[_0x4a6d2d];var _0x4ffd04=createListener(_0xc6a7('0x8')+_0xec4861,_0x6868eb);TeamEvents['on'](_0xec4861,_0x4ffd04);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 6739687..1a23b62 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 _0x906c=['sequelize','exports','INTEGER'];(function(_0x153f3d,_0x2bdb33){var _0x31ddbd=function(_0xd32d1f){while(--_0xd32d1f){_0x153f3d['push'](_0x153f3d['shift']());}};_0x31ddbd(++_0x2bdb33);}(_0x906c,0x195));var _0xc906=function(_0x32b3ec,_0x440aff){_0x32b3ec=_0x32b3ec-0x0;var _0x159054=_0x906c[_0x32b3ec];return _0x159054;};'use strict';var Sequelize=require(_0xc906('0x0'));module[_0xc906('0x1')]={'TeamId':{'type':Sequelize[_0xc906('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4584=['INTEGER','sequelize'];(function(_0x5968fc,_0x58aad1){var _0x262ccf=function(_0x390589){while(--_0x390589){_0x5968fc['push'](_0x5968fc['shift']());}};_0x262ccf(++_0x58aad1);}(_0x4584,0x1cf));var _0x4458=function(_0x1bbfe6,_0x3dd9fd){_0x1bbfe6=_0x1bbfe6-0x0;var _0x57c56d=_0x4584[_0x1bbfe6];return _0x57c56d;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x4458('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x4458('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a65ccbb..a636d80 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 _0x6888=['TeamVoicePrefix','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./teamVoicePrefix.attributes','exports','define'];(function(_0x36a49e,_0x2bfa8c){var _0x40cc2b=function(_0x119a2d){while(--_0x119a2d){_0x36a49e['push'](_0x36a49e['shift']());}};_0x40cc2b(++_0x2bfa8c);}(_0x6888,0xd2));var _0x8688=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x6888[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var logger=require(_0x8688('0x1'))(_0x8688('0x2'));var moment=require(_0x8688('0x3'));var BPromise=require(_0x8688('0x4'));var rp=require(_0x8688('0x5'));var fs=require('fs');var path=require(_0x8688('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8688('0x7'));module[_0x8688('0x8')]=function(_0x37c051,_0x33a806){return _0x37c051[_0x8688('0x9')](_0x8688('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc29b=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0xc29b,0x12d));var _0xbc29=function(_0x483b1c,_0x336b90){_0x483b1c=_0x483b1c-0x0;var _0x1e3373=_0xc29b[_0x483b1c];return _0x1e3373;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var logger=require(_0xbc29('0x2'))('api');var moment=require(_0xbc29('0x3'));var BPromise=require(_0xbc29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc29('0x5'));var rimraf=require(_0xbc29('0x6'));var config=require(_0xbc29('0x7'));var attributes=require(_0xbc29('0x8'));module[_0xbc29('0x9')]=function(_0x2b8a98,_0x3ac58d){return _0x2b8a98[_0xbc29('0xa')](_0xbc29('0xb'),attributes,{'tableName':_0xbc29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5d295f2..b664635 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x9e5c95,_0x34c8c0){var _0x2a95d9=function(_0x24d394){while(--_0x24d394){_0x9e5c95['push'](_0x9e5c95['shift']());}};_0x2a95d9(++_0x34c8c0);}(_0xedd9,0xfc));var _0x9edd=function(_0x5159b2,_0x5073a3){_0x5159b2=_0x5159b2-0x0;var _0x3e0ade=_0xedd9[_0x5159b2];return _0x3e0ade;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4f232d,_0x50c2fd){var _0x494086=function(_0x163bfa){while(--_0x163bfa){_0x4f232d['push'](_0x4f232d['shift']());}};_0x494086(++_0x50c2fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index e2aa5ff..5f1b2b9 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 _0xfca5=['INTEGER','sequelize','exports'];(function(_0x255adc,_0x2eb889){var _0x8620ee=function(_0x527449){while(--_0x527449){_0x255adc['push'](_0x255adc['shift']());}};_0x8620ee(++_0x2eb889);}(_0xfca5,0x1cf));var _0x5fca=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0xfca5[_0x2f1114];return _0x2fe856;};'use strict';var Sequelize=require(_0x5fca('0x0'));module[_0x5fca('0x1')]={'penalty':{'type':Sequelize[_0x5fca('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcf76=['INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf76,0x1df));var _0x6cf7=function(_0x59e5f6,_0x655a92){_0x59e5f6=_0x59e5f6-0x0;var _0x3ae6e2=_0xcf76[_0x59e5f6];return _0x3ae6e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x6cf7('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 3fd69be..375baef 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 _0x76a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','TeamVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x84bd5d,_0x132a0d){var _0x3fa3f1=function(_0x5106e3){while(--_0x5106e3){_0x84bd5d['push'](_0x84bd5d['shift']());}};_0x3fa3f1(++_0x132a0d);}(_0x76a3,0xf8));var _0x376a=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0x76a3[_0x6287b6];return _0x5d6be4;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var logger=require(_0x376a('0x2'))(_0x376a('0x3'));var moment=require(_0x376a('0x4'));var BPromise=require(_0x376a('0x5'));var rp=require(_0x376a('0x6'));var fs=require('fs');var path=require(_0x376a('0x7'));var rimraf=require(_0x376a('0x8'));var config=require(_0x376a('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x19ea68,_0x22904c){return _0x19ea68[_0x376a('0xa')](_0x376a('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55e0=['./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x55e0,0xdc));var _0x055e=function(_0x4c68f5,_0x528106){_0x4c68f5=_0x4c68f5-0x0;var _0x10ee7d=_0x55e0[_0x4c68f5];return _0x10ee7d;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index adfdc9a..ecbccb3 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 _0x0a60=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3196bb,_0x36b4b0){var _0x1f98d8=function(_0x29ea77){while(--_0x29ea77){_0x3196bb['push'](_0x3196bb['shift']());}};_0x1f98d8(++_0x36b4b0);}(_0x0a60,0x170));var _0x00a6=function(_0xb63dc6,_0xbe659c){_0xb63dc6=_0xb63dc6-0x0;var _0x225de3=_0x0a60[_0xb63dc6];return _0x225de3;};'use strict';var _=require(_0x00a6('0x0'));var util=require('util');var moment=require(_0x00a6('0x1'));var BPromise=require(_0x00a6('0x2'));var rs=require(_0x00a6('0x3'));var fs=require('fs');var Redis=require(_0x00a6('0x4'));var db=require(_0x00a6('0x5'))['db'];var utils=require(_0x00a6('0x6'));var logger=require(_0x00a6('0x7'))(_0x00a6('0x8'));var config=require(_0x00a6('0x9'));var jayson=require(_0x00a6('0xa'));var client=jayson[_0x00a6('0xb')][_0x00a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23026d,_0x3db5b2,_0x163294){return new BPromise(function(_0x2b7f7e,_0x54810e){return client[_0x00a6('0xd')](_0x23026d,_0x163294)['then'](function(_0x184d20){logger[_0x00a6('0xe')](_0x00a6('0xf'),_0x3db5b2,_0x00a6('0x10'));logger['debug'](_0x00a6('0x11'),_0x3db5b2,_0x00a6('0x10'),JSON[_0x00a6('0x12')](_0x184d20));if(_0x184d20['error']){if(_0x184d20[_0x00a6('0x13')]['code']===0x1f4){logger[_0x00a6('0x13')](_0x00a6('0xf'),_0x3db5b2,_0x184d20['error']['message']);return _0x54810e(_0x184d20[_0x00a6('0x13')][_0x00a6('0x14')]);}logger[_0x00a6('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3db5b2,_0x184d20[_0x00a6('0x13')][_0x00a6('0x14')]);return _0x2b7f7e(_0x184d20[_0x00a6('0x13')][_0x00a6('0x14')]);}else{logger[_0x00a6('0xe')](_0x00a6('0xf'),_0x3db5b2,_0x00a6('0x10'));_0x2b7f7e(_0x184d20['result']['message']);}})[_0x00a6('0x15')](function(_0x27cf86){logger[_0x00a6('0x13')](_0x00a6('0xf'),_0x3db5b2,_0x27cf86);_0x54810e(_0x27cf86);});});} \ No newline at end of file +var _0x1429=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x1429,0x1d9));var _0x9142=function(_0x2e236c,_0x3b91c6){_0x2e236c=_0x2e236c-0x0;var _0x3479e3=_0x1429[_0x2e236c];return _0x3479e3;};'use strict';var _=require(_0x9142('0x0'));var util=require(_0x9142('0x1'));var moment=require(_0x9142('0x2'));var BPromise=require(_0x9142('0x3'));var rs=require(_0x9142('0x4'));var fs=require('fs');var Redis=require(_0x9142('0x5'));var db=require(_0x9142('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9142('0x7'))(_0x9142('0x8'));var config=require(_0x9142('0x9'));var jayson=require(_0x9142('0xa'));var client=jayson[_0x9142('0xb')][_0x9142('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25091d,_0x1df588,_0x86c57c){return new BPromise(function(_0x10bb60,_0x6b55b3){return client[_0x9142('0xd')](_0x25091d,_0x86c57c)[_0x9142('0xe')](function(_0x58dd6e){logger[_0x9142('0xf')](_0x9142('0x10'),_0x1df588,'request\x20sent');logger[_0x9142('0x11')](_0x9142('0x12'),_0x1df588,_0x9142('0x13'),JSON[_0x9142('0x14')](_0x58dd6e));if(_0x58dd6e[_0x9142('0x15')]){if(_0x58dd6e[_0x9142('0x15')]['code']===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x1df588,_0x58dd6e[_0x9142('0x15')]['message']);return _0x6b55b3(_0x58dd6e[_0x9142('0x15')][_0x9142('0x16')]);}logger['error'](_0x9142('0x10'),_0x1df588,_0x58dd6e[_0x9142('0x15')][_0x9142('0x16')]);return _0x10bb60(_0x58dd6e[_0x9142('0x15')][_0x9142('0x16')]);}else{logger[_0x9142('0xf')](_0x9142('0x10'),_0x1df588,_0x9142('0x13'));_0x10bb60(_0x58dd6e['result'][_0x9142('0x16')]);}})[_0x9142('0x17')](function(_0x62eab0){logger[_0x9142('0x15')](_0x9142('0x10'),_0x1df588,_0x62eab0);_0x6b55b3(_0x62eab0);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 0831e17..89f21f5 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 _0xcf37=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x557570,_0x2e1c05){var _0x1f5a35=function(_0x507e78){while(--_0x507e78){_0x557570['push'](_0x557570['shift']());}};_0x1f5a35(++_0x2e1c05);}(_0xcf37,0xdc));var _0x7cf3=function(_0x30dd50,_0x45a959){_0x30dd50=_0x30dd50-0x0;var _0x4c7d24=_0xcf37[_0x30dd50];return _0x4c7d24;};'use strict';var multer=require('multer');var util=require(_0x7cf3('0x0'));var path=require(_0x7cf3('0x1'));var timeout=require(_0x7cf3('0x2'));var express=require(_0x7cf3('0x3'));var router=express[_0x7cf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7cf3('0x5'));var interaction=require(_0x7cf3('0x6'));var config=require(_0x7cf3('0x7'));var controller=require(_0x7cf3('0x8'));router[_0x7cf3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x7cf3('0xa')](),controller[_0x7cf3('0xb')]);router[_0x7cf3('0xc')]('/',auth['isAuthenticated'](),controller[_0x7cf3('0xd')]);router[_0x7cf3('0xe')](_0x7cf3('0xf'),auth[_0x7cf3('0xa')](),controller[_0x7cf3('0x10')]);router[_0x7cf3('0x11')]('/:id',auth[_0x7cf3('0xa')](),controller[_0x7cf3('0x12')]);module[_0x7cf3('0x13')]=router; \ No newline at end of file +var _0x3f35=['/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./template.controller','isAuthenticated','index','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3f35,0x1ae));var _0x53f3=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x3f35[_0x2a55f8];return _0x245efd;};'use strict';var multer=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var path=require(_0x53f3('0x2'));var timeout=require(_0x53f3('0x3'));var express=require(_0x53f3('0x4'));var router=express[_0x53f3('0x5')]();var fs_extra=require(_0x53f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x53f3('0x7'));var config=require('../../config/environment');var controller=require(_0x53f3('0x8'));router['get']('/',auth[_0x53f3('0x9')](),controller[_0x53f3('0xa')]);router[_0x53f3('0xb')](_0x53f3('0xc'),auth['isAuthenticated'](),controller[_0x53f3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x53f3('0xe')](_0x53f3('0xc'),auth[_0x53f3('0x9')](),controller[_0x53f3('0xf')]);router['delete']('/:id',auth[_0x53f3('0x9')](),controller[_0x53f3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index cf19cf7..f313ca1 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 _0xef2a=['sequelize','exports','STRING','TEXT'];(function(_0x45f854,_0x489480){var _0xc85f7d=function(_0x5d7085){while(--_0x5d7085){_0x45f854['push'](_0x45f854['shift']());}};_0xc85f7d(++_0x489480);}(_0xef2a,0x160));var _0xaef2=function(_0x49dc86,_0x6ab788){_0x49dc86=_0x49dc86-0x0;var _0x369f16=_0xef2a[_0x49dc86];return _0x369f16;};'use strict';var Sequelize=require(_0xaef2('0x0'));module[_0xaef2('0x1')]={'name':{'type':Sequelize[_0xaef2('0x2')]},'description':{'type':Sequelize[_0xaef2('0x2')]},'html':{'type':Sequelize[_0xaef2('0x3')]}}; \ No newline at end of file +var _0x3fff=['TEXT','sequelize','exports','STRING'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x3fff,0xa9));var _0xf3ff=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0x3fff[_0x46e3ff];return _0x4bf847;};'use strict';var Sequelize=require(_0xf3ff('0x0'));module[_0xf3ff('0x1')]={'name':{'type':Sequelize[_0xf3ff('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xf3ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 2cd11c4..2afa65f 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 _0x4e14=['order','sort','filter','merge','where','VIRTUAL','options','Template','includeAll','include','findAll','show','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','params','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Templates','UserProfileResource','end','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x24afd3,_0x28da36){var _0x1f4eb2=function(_0x4e9997){while(--_0x4e9997){_0x24afd3['push'](_0x24afd3['shift']());}};_0x1f4eb2(++_0x28da36);}(_0x4e14,0x165));var _0x44e1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4e14[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x44e1('0x0'));var jsonpatch=require(_0x44e1('0x1'));var rp=require(_0x44e1('0x2'));var moment=require(_0x44e1('0x3'));var BPromise=require(_0x44e1('0x4'));var Mustache=require('mustache');var util=require(_0x44e1('0x5'));var path=require('path');var sox=require(_0x44e1('0x6'));var csv=require(_0x44e1('0x7'));var ejs=require(_0x44e1('0x8'));var fs=require('fs');var fs_extra=require(_0x44e1('0x9'));var _=require(_0x44e1('0xa'));var squel=require(_0x44e1('0xb'));var crypto=require(_0x44e1('0xc'));var jsforce=require(_0x44e1('0xd'));var deskjs=require(_0x44e1('0xe'));var toCsv=require(_0x44e1('0x7'));var querystring=require(_0x44e1('0xf'));var Papa=require(_0x44e1('0x10'));var Redis=require(_0x44e1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x44e1('0x12'));var as=require(_0x44e1('0x13'));var hardwareService=require(_0x44e1('0x14'));var logger=require(_0x44e1('0x15'))('api');var utils=require(_0x44e1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x44e1('0x17'));var db=require(_0x44e1('0x18'))['db'];function respondWithStatusCode(_0x45fde5,_0x3994c2){_0x3994c2=_0x3994c2||0xcc;return function(_0x24b08d){if(_0x24b08d){return _0x45fde5[_0x44e1('0x19')](_0x3994c2);}return _0x45fde5[_0x44e1('0x1a')](_0x3994c2)['end']();};}function respondWithResult(_0x594848,_0x4da6ae){_0x4da6ae=_0x4da6ae||0xc8;return function(_0x4727ec){if(_0x4727ec){return _0x594848[_0x44e1('0x1a')](_0x4da6ae)[_0x44e1('0x1b')](_0x4727ec);}};}function respondWithFilteredResult(_0x143730,_0x5a6692){return function(_0x3a0637){if(_0x3a0637){var _0x409681=typeof _0x5a6692[_0x44e1('0x1c')]===_0x44e1('0x1d')&&typeof _0x5a6692[_0x44e1('0x1e')]===_0x44e1('0x1d');var _0x16cce4=_0x3a0637[_0x44e1('0x1f')];var _0xbb3ae7=_0x409681?0x0:_0x5a6692[_0x44e1('0x1c')];var _0x34a385=_0x409681?_0x3a0637['count']:_0x5a6692[_0x44e1('0x1c')]+_0x5a6692[_0x44e1('0x1e')];var _0x3118dc;if(_0x34a385>=_0x16cce4){_0x34a385=_0x16cce4;_0x3118dc=0xc8;}else{_0x3118dc=0xce;}_0x143730[_0x44e1('0x1a')](_0x3118dc);return _0x143730['set'](_0x44e1('0x20'),_0xbb3ae7+'-'+_0x34a385+'/'+_0x16cce4)[_0x44e1('0x1b')](_0x3a0637);}return null;};}function patchUpdates(_0x512b42){return function(_0x4207ce){try{jsonpatch[_0x44e1('0x21')](_0x4207ce,_0x512b42,!![]);}catch(_0xe7fa86){return BPromise[_0x44e1('0x22')](_0xe7fa86);}return _0x4207ce[_0x44e1('0x23')]();};}function saveUpdates(_0x58be53,_0x45c381){return function(_0x52eea8){if(_0x52eea8){return _0x52eea8['update'](_0x58be53)[_0x44e1('0x24')](function(_0x2d9f12){return _0x2d9f12;});}return null;};}function removeEntity(_0x1a92c9,_0x26e616){return function(_0x220b53){if(_0x220b53){return _0x220b53[_0x44e1('0x25')]()['then'](function(){var _0x568404=_0x220b53[_0x44e1('0x26')]({'plain':!![]});var _0x46f0ed=_0x44e1('0x27');return db[_0x44e1('0x28')][_0x44e1('0x25')]({'where':{'type':_0x46f0ed,'resourceId':_0x568404['id']}})[_0x44e1('0x24')](function(){return _0x220b53;});})[_0x44e1('0x24')](function(){_0x1a92c9[_0x44e1('0x1a')](0xcc)[_0x44e1('0x29')]();});}};}function handleEntityNotFound(_0x14e3c9,_0x9ab132){return function(_0x1933e0){if(!_0x1933e0){_0x14e3c9['sendStatus'](0x194);}return _0x1933e0;};}function handleError(_0x24c125,_0x152f8e){_0x152f8e=_0x152f8e||0x1f4;return function(_0x48401d){logger['error'](_0x48401d['stack']);if(_0x48401d[_0x44e1('0x2a')]){delete _0x48401d['name'];}_0x24c125['status'](_0x152f8e)['send'](_0x48401d);};}exports['index']=function(_0x3e6213,_0x17465b){var _0x2fa090={},_0x31e685={},_0xef9eef={'count':0x0,'rows':[]};var _0x1b8569=_[_0x44e1('0x2b')](db['Template'][_0x44e1('0x2c')],function(_0x1cc986){return{'name':_0x1cc986[_0x44e1('0x2d')],'type':_0x1cc986[_0x44e1('0x2e')][_0x44e1('0x2f')]};});_0x31e685['model']=_[_0x44e1('0x2b')](_0x1b8569,'name');_0x31e685['query']=_[_0x44e1('0x30')](_0x3e6213[_0x44e1('0x31')]);_0x31e685[_0x44e1('0x32')]=_[_0x44e1('0x33')](_0x31e685[_0x44e1('0x34')],_0x31e685[_0x44e1('0x31')]);_0x2fa090[_0x44e1('0x35')]=_[_0x44e1('0x33')](_0x31e685['model'],qs[_0x44e1('0x36')](_0x3e6213[_0x44e1('0x31')][_0x44e1('0x36')]));_0x2fa090[_0x44e1('0x35')]=_0x2fa090[_0x44e1('0x35')][_0x44e1('0x37')]?_0x2fa090[_0x44e1('0x35')]:_0x31e685[_0x44e1('0x34')];if(!_0x3e6213[_0x44e1('0x31')][_0x44e1('0x38')](_0x44e1('0x39'))){_0x2fa090[_0x44e1('0x1e')]=qs[_0x44e1('0x1e')](_0x3e6213[_0x44e1('0x31')][_0x44e1('0x1e')]);_0x2fa090[_0x44e1('0x1c')]=qs[_0x44e1('0x1c')](_0x3e6213['query'][_0x44e1('0x1c')]);}_0x2fa090[_0x44e1('0x3a')]=qs[_0x44e1('0x3b')](_0x3e6213[_0x44e1('0x31')][_0x44e1('0x3b')]);_0x2fa090['where']=qs['filters'](_['pick'](_0x3e6213[_0x44e1('0x31')],_0x31e685[_0x44e1('0x32')]),_0x1b8569);if(_0x3e6213[_0x44e1('0x31')][_0x44e1('0x3c')]){_0x2fa090['where']=_[_0x44e1('0x3d')](_0x2fa090[_0x44e1('0x3e')],{'$or':_[_0x44e1('0x2b')](_0x1b8569,function(_0xfe9ade){if(_0xfe9ade[_0x44e1('0x2e')]!==_0x44e1('0x3f')){var _0x3faa57={};_0x3faa57[_0xfe9ade[_0x44e1('0x2a')]]={'$like':'%'+_0x3e6213[_0x44e1('0x31')][_0x44e1('0x3c')]+'%'};return _0x3faa57;}})});}_0x2fa090=_[_0x44e1('0x3d')]({},_0x2fa090,_0x3e6213[_0x44e1('0x40')]);var _0x4e0bc4={'where':_0x2fa090['where']};return db[_0x44e1('0x41')][_0x44e1('0x1f')](_0x4e0bc4)['then'](function(_0x27382b){_0xef9eef[_0x44e1('0x1f')]=_0x27382b;if(_0x3e6213['query'][_0x44e1('0x42')]){_0x2fa090[_0x44e1('0x43')]=[{'all':!![]}];}return db['Template'][_0x44e1('0x44')](_0x2fa090);})['then'](function(_0x54df0b){_0xef9eef['rows']=_0x54df0b;return _0xef9eef;})[_0x44e1('0x24')](respondWithFilteredResult(_0x17465b,_0x2fa090))['catch'](handleError(_0x17465b,null));};exports[_0x44e1('0x45')]=function(_0x129638,_0x368d4a){var _0x1f086b={'raw':!![],'where':{'id':_0x129638['params']['id']}},_0x105813={};_0x105813[_0x44e1('0x34')]=_[_0x44e1('0x30')](db[_0x44e1('0x41')][_0x44e1('0x2c')]);_0x105813[_0x44e1('0x31')]=_[_0x44e1('0x30')](_0x129638[_0x44e1('0x31')]);_0x105813[_0x44e1('0x32')]=_['intersection'](_0x105813[_0x44e1('0x34')],_0x105813[_0x44e1('0x31')]);_0x1f086b[_0x44e1('0x35')]=_[_0x44e1('0x33')](_0x105813['model'],qs[_0x44e1('0x36')](_0x129638[_0x44e1('0x31')]['fields']));_0x1f086b[_0x44e1('0x35')]=_0x1f086b['attributes'][_0x44e1('0x37')]?_0x1f086b[_0x44e1('0x35')]:_0x105813[_0x44e1('0x34')];if(_0x129638[_0x44e1('0x31')][_0x44e1('0x42')]){_0x1f086b['include']=[{'all':!![]}];}_0x1f086b=_[_0x44e1('0x3d')]({},_0x1f086b,_0x129638[_0x44e1('0x40')]);return db[_0x44e1('0x41')]['find'](_0x1f086b)[_0x44e1('0x24')](handleEntityNotFound(_0x368d4a,null))[_0x44e1('0x24')](respondWithResult(_0x368d4a,null))[_0x44e1('0x46')](handleError(_0x368d4a,null));};exports[_0x44e1('0x47')]=function(_0x3bd396,_0x693d0b){return db[_0x44e1('0x41')][_0x44e1('0x47')](_0x3bd396[_0x44e1('0x48')],{})[_0x44e1('0x24')](function(_0x5e9014){var _0x286c4f=_0x3bd396[_0x44e1('0x49')]['get']({'plain':!![]});if(!_0x286c4f)throw new Error(_0x44e1('0x4a'));if(_0x286c4f[_0x44e1('0x4b')]===_0x44e1('0x49')){var _0x40df9f=_0x5e9014[_0x44e1('0x26')]({'plain':!![]});var _0x3fe022=_0x44e1('0x27');return db[_0x44e1('0x4c')]['find']({'where':{'name':_0x3fe022,'userProfileId':_0x286c4f[_0x44e1('0x4d')]},'raw':!![]})[_0x44e1('0x24')](function(_0x319e44){if(_0x319e44&&_0x319e44[_0x44e1('0x4e')]===0x0){return db[_0x44e1('0x28')][_0x44e1('0x47')]({'name':_0x40df9f[_0x44e1('0x2a')],'resourceId':_0x40df9f['id'],'type':_0x319e44[_0x44e1('0x2a')],'sectionId':_0x319e44['id']},{})[_0x44e1('0x24')](function(){return _0x5e9014;});}else{return _0x5e9014;}})[_0x44e1('0x46')](function(_0x3a9f66){logger['error'](_0x44e1('0x4f'),_0x3a9f66);throw _0x3a9f66;});}return _0x5e9014;})['then'](respondWithResult(_0x693d0b,0xc9))[_0x44e1('0x46')](handleError(_0x693d0b,null));};exports[_0x44e1('0x50')]=function(_0x23f609,_0x11713d){if(_0x23f609['body']['id']){delete _0x23f609[_0x44e1('0x48')]['id'];}return db[_0x44e1('0x41')]['find']({'where':{'id':_0x23f609[_0x44e1('0x51')]['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x11713d,null))[_0x44e1('0x24')](saveUpdates(_0x23f609['body'],null))[_0x44e1('0x24')](respondWithResult(_0x11713d,null))[_0x44e1('0x46')](handleError(_0x11713d,null));};exports[_0x44e1('0x25')]=function(_0x531591,_0x1e9f0b){return db[_0x44e1('0x41')][_0x44e1('0x52')]({'where':{'id':_0x531591['params']['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x1e9f0b,null))[_0x44e1('0x24')](removeEntity(_0x1e9f0b,null))['catch'](handleError(_0x1e9f0b,null));}; \ No newline at end of file +var _0xc8b5=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','Templates','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x54b0f3,_0x1fe2f7){var _0x5ae957=function(_0x2749eb){while(--_0x2749eb){_0x54b0f3['push'](_0x54b0f3['shift']());}};_0x5ae957(++_0x1fe2f7);}(_0xc8b5,0x146));var _0x5c8b=function(_0x5187c7,_0x27a0b0){_0x5187c7=_0x5187c7-0x0;var _0x5bf95f=_0xc8b5[_0x5187c7];return _0x5bf95f;};'use strict';var emlformat=require(_0x5c8b('0x0'));var rimraf=require(_0x5c8b('0x1'));var zipdir=require(_0x5c8b('0x2'));var jsonpatch=require(_0x5c8b('0x3'));var rp=require(_0x5c8b('0x4'));var moment=require(_0x5c8b('0x5'));var BPromise=require(_0x5c8b('0x6'));var Mustache=require(_0x5c8b('0x7'));var util=require(_0x5c8b('0x8'));var path=require(_0x5c8b('0x9'));var sox=require(_0x5c8b('0xa'));var csv=require(_0x5c8b('0xb'));var ejs=require(_0x5c8b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5c8b('0xd'));var crypto=require(_0x5c8b('0xe'));var jsforce=require(_0x5c8b('0xf'));var deskjs=require(_0x5c8b('0x10'));var toCsv=require(_0x5c8b('0xb'));var querystring=require(_0x5c8b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c8b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c8b('0x13'));var logger=require('../../config/logger')(_0x5c8b('0x14'));var utils=require(_0x5c8b('0x15'));var config=require(_0x5c8b('0x16'));var licenseUtil=require(_0x5c8b('0x17'));var db=require(_0x5c8b('0x18'))['db'];function respondWithStatusCode(_0x47b329,_0x507ae9){_0x507ae9=_0x507ae9||0xcc;return function(_0xb7299f){if(_0xb7299f){return _0x47b329[_0x5c8b('0x19')](_0x507ae9);}return _0x47b329[_0x5c8b('0x1a')](_0x507ae9)[_0x5c8b('0x1b')]();};}function respondWithResult(_0x39325e,_0x5b025e){_0x5b025e=_0x5b025e||0xc8;return function(_0x1a7215){if(_0x1a7215){return _0x39325e[_0x5c8b('0x1a')](_0x5b025e)[_0x5c8b('0x1c')](_0x1a7215);}};}function respondWithFilteredResult(_0x3beccd,_0x3e4699){return function(_0x21c396){if(_0x21c396){var _0x56d353=typeof _0x3e4699['offset']===_0x5c8b('0x1d')&&typeof _0x3e4699['limit']==='undefined';var _0x56a107=_0x21c396['count'];var _0x2baa82=_0x56d353?0x0:_0x3e4699[_0x5c8b('0x1e')];var _0x2b6ecd=_0x56d353?_0x21c396[_0x5c8b('0x1f')]:_0x3e4699[_0x5c8b('0x1e')]+_0x3e4699['limit'];var _0x2f8534;if(_0x2b6ecd>=_0x56a107){_0x2b6ecd=_0x56a107;_0x2f8534=0xc8;}else{_0x2f8534=0xce;}_0x3beccd[_0x5c8b('0x1a')](_0x2f8534);return _0x3beccd[_0x5c8b('0x20')](_0x5c8b('0x21'),_0x2baa82+'-'+_0x2b6ecd+'/'+_0x56a107)[_0x5c8b('0x1c')](_0x21c396);}return null;};}function patchUpdates(_0x52ec77){return function(_0x4d5a4f){try{jsonpatch[_0x5c8b('0x22')](_0x4d5a4f,_0x52ec77,!![]);}catch(_0x5a4abf){return BPromise[_0x5c8b('0x23')](_0x5a4abf);}return _0x4d5a4f[_0x5c8b('0x24')]();};}function saveUpdates(_0x43b9d1,_0x517789){return function(_0x4ceaaa){if(_0x4ceaaa){return _0x4ceaaa[_0x5c8b('0x25')](_0x43b9d1)['then'](function(_0x272734){return _0x272734;});}return null;};}function removeEntity(_0x3dbf09,_0x4a35f6){return function(_0xd00b16){if(_0xd00b16){return _0xd00b16[_0x5c8b('0x26')]()[_0x5c8b('0x27')](function(){var _0x972cf5=_0xd00b16[_0x5c8b('0x28')]({'plain':!![]});var _0x574e17='Templates';return db[_0x5c8b('0x29')]['destroy']({'where':{'type':_0x574e17,'resourceId':_0x972cf5['id']}})[_0x5c8b('0x27')](function(){return _0xd00b16;});})[_0x5c8b('0x27')](function(){_0x3dbf09[_0x5c8b('0x1a')](0xcc)[_0x5c8b('0x1b')]();});}};}function handleEntityNotFound(_0x147210,_0x16c929){return function(_0xad3993){if(!_0xad3993){_0x147210[_0x5c8b('0x19')](0x194);}return _0xad3993;};}function handleError(_0xab9ad7,_0x1cfd5a){_0x1cfd5a=_0x1cfd5a||0x1f4;return function(_0x48af31){logger[_0x5c8b('0x2a')](_0x48af31[_0x5c8b('0x2b')]);if(_0x48af31[_0x5c8b('0x2c')]){delete _0x48af31[_0x5c8b('0x2c')];}_0xab9ad7[_0x5c8b('0x1a')](_0x1cfd5a)[_0x5c8b('0x2d')](_0x48af31);};}exports[_0x5c8b('0x2e')]=function(_0x393978,_0x2a9911){var _0x16d5a7={},_0x511ce3={},_0x35e662={'count':0x0,'rows':[]};var _0x48d2cf=_[_0x5c8b('0x2f')](db[_0x5c8b('0x30')][_0x5c8b('0x31')],function(_0x1c9464){return{'name':_0x1c9464['fieldName'],'type':_0x1c9464[_0x5c8b('0x32')][_0x5c8b('0x33')]};});_0x511ce3['model']=_[_0x5c8b('0x2f')](_0x48d2cf,_0x5c8b('0x2c'));_0x511ce3[_0x5c8b('0x34')]=_[_0x5c8b('0x35')](_0x393978[_0x5c8b('0x34')]);_0x511ce3[_0x5c8b('0x36')]=_[_0x5c8b('0x37')](_0x511ce3['model'],_0x511ce3[_0x5c8b('0x34')]);_0x16d5a7['attributes']=_['intersection'](_0x511ce3[_0x5c8b('0x38')],qs[_0x5c8b('0x39')](_0x393978[_0x5c8b('0x34')][_0x5c8b('0x39')]));_0x16d5a7[_0x5c8b('0x3a')]=_0x16d5a7[_0x5c8b('0x3a')][_0x5c8b('0x3b')]?_0x16d5a7[_0x5c8b('0x3a')]:_0x511ce3[_0x5c8b('0x38')];if(!_0x393978[_0x5c8b('0x34')][_0x5c8b('0x3c')](_0x5c8b('0x3d'))){_0x16d5a7['limit']=qs[_0x5c8b('0x3e')](_0x393978[_0x5c8b('0x34')][_0x5c8b('0x3e')]);_0x16d5a7[_0x5c8b('0x1e')]=qs['offset'](_0x393978['query']['offset']);}_0x16d5a7[_0x5c8b('0x3f')]=qs[_0x5c8b('0x40')](_0x393978['query']['sort']);_0x16d5a7[_0x5c8b('0x41')]=qs[_0x5c8b('0x36')](_['pick'](_0x393978[_0x5c8b('0x34')],_0x511ce3['filters']),_0x48d2cf);if(_0x393978[_0x5c8b('0x34')][_0x5c8b('0x42')]){_0x16d5a7[_0x5c8b('0x41')]=_[_0x5c8b('0x43')](_0x16d5a7[_0x5c8b('0x41')],{'$or':_['map'](_0x48d2cf,function(_0x9811c2){if(_0x9811c2['type']!=='VIRTUAL'){var _0xb610fa={};_0xb610fa[_0x9811c2[_0x5c8b('0x2c')]]={'$like':'%'+_0x393978[_0x5c8b('0x34')]['filter']+'%'};return _0xb610fa;}})});}_0x16d5a7=_['merge']({},_0x16d5a7,_0x393978[_0x5c8b('0x44')]);var _0x3c7ab4={'where':_0x16d5a7['where']};return db['Template'][_0x5c8b('0x1f')](_0x3c7ab4)['then'](function(_0x5da4da){_0x35e662['count']=_0x5da4da;if(_0x393978[_0x5c8b('0x34')][_0x5c8b('0x45')]){_0x16d5a7[_0x5c8b('0x46')]=[{'all':!![]}];}return db[_0x5c8b('0x30')][_0x5c8b('0x47')](_0x16d5a7);})[_0x5c8b('0x27')](function(_0xa95246){_0x35e662[_0x5c8b('0x48')]=_0xa95246;return _0x35e662;})[_0x5c8b('0x27')](respondWithFilteredResult(_0x2a9911,_0x16d5a7))[_0x5c8b('0x49')](handleError(_0x2a9911,null));};exports[_0x5c8b('0x4a')]=function(_0x187030,_0xd6de41){var _0x1f0351={'raw':!![],'where':{'id':_0x187030[_0x5c8b('0x4b')]['id']}},_0x1f7042={};_0x1f7042[_0x5c8b('0x38')]=_[_0x5c8b('0x35')](db[_0x5c8b('0x30')][_0x5c8b('0x31')]);_0x1f7042['query']=_[_0x5c8b('0x35')](_0x187030['query']);_0x1f7042[_0x5c8b('0x36')]=_['intersection'](_0x1f7042[_0x5c8b('0x38')],_0x1f7042[_0x5c8b('0x34')]);_0x1f0351['attributes']=_[_0x5c8b('0x37')](_0x1f7042[_0x5c8b('0x38')],qs[_0x5c8b('0x39')](_0x187030['query'][_0x5c8b('0x39')]));_0x1f0351[_0x5c8b('0x3a')]=_0x1f0351['attributes']['length']?_0x1f0351['attributes']:_0x1f7042[_0x5c8b('0x38')];if(_0x187030[_0x5c8b('0x34')]['includeAll']){_0x1f0351['include']=[{'all':!![]}];}_0x1f0351=_['merge']({},_0x1f0351,_0x187030[_0x5c8b('0x44')]);return db['Template'][_0x5c8b('0x4c')](_0x1f0351)[_0x5c8b('0x27')](handleEntityNotFound(_0xd6de41,null))[_0x5c8b('0x27')](respondWithResult(_0xd6de41,null))[_0x5c8b('0x49')](handleError(_0xd6de41,null));};exports[_0x5c8b('0x4d')]=function(_0x58e4d5,_0x2b0305){return db[_0x5c8b('0x30')][_0x5c8b('0x4d')](_0x58e4d5['body'],{})[_0x5c8b('0x27')](function(_0x4343b3){var _0x373f5f=_0x58e4d5[_0x5c8b('0x4e')]['get']({'plain':!![]});if(!_0x373f5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x373f5f[_0x5c8b('0x4f')]===_0x5c8b('0x4e')){var _0x5ce02a=_0x4343b3[_0x5c8b('0x28')]({'plain':!![]});var _0x12b6fb=_0x5c8b('0x50');return db[_0x5c8b('0x51')][_0x5c8b('0x4c')]({'where':{'name':_0x12b6fb,'userProfileId':_0x373f5f[_0x5c8b('0x52')]},'raw':!![]})[_0x5c8b('0x27')](function(_0x5b07f4){if(_0x5b07f4&&_0x5b07f4[_0x5c8b('0x53')]===0x0){return db[_0x5c8b('0x29')][_0x5c8b('0x4d')]({'name':_0x5ce02a[_0x5c8b('0x2c')],'resourceId':_0x5ce02a['id'],'type':_0x5b07f4[_0x5c8b('0x2c')],'sectionId':_0x5b07f4['id']},{})[_0x5c8b('0x27')](function(){return _0x4343b3;});}else{return _0x4343b3;}})[_0x5c8b('0x49')](function(_0x7acb7b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7acb7b);throw _0x7acb7b;});}return _0x4343b3;})[_0x5c8b('0x27')](respondWithResult(_0x2b0305,0xc9))[_0x5c8b('0x49')](handleError(_0x2b0305,null));};exports[_0x5c8b('0x25')]=function(_0x4bd025,_0x46bac0){if(_0x4bd025[_0x5c8b('0x54')]['id']){delete _0x4bd025[_0x5c8b('0x54')]['id'];}return db[_0x5c8b('0x30')][_0x5c8b('0x4c')]({'where':{'id':_0x4bd025[_0x5c8b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46bac0,null))[_0x5c8b('0x27')](saveUpdates(_0x4bd025[_0x5c8b('0x54')],null))[_0x5c8b('0x27')](respondWithResult(_0x46bac0,null))[_0x5c8b('0x49')](handleError(_0x46bac0,null));};exports['destroy']=function(_0x209c02,_0x5b476b){return db[_0x5c8b('0x30')][_0x5c8b('0x4c')]({'where':{'id':_0x209c02['params']['id']}})['then'](handleEntityNotFound(_0x5b476b,null))[_0x5c8b('0x27')](removeEntity(_0x5b476b,null))[_0x5c8b('0x49')](handleError(_0x5b476b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1d5e90a..1d26cf1 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 _0xe0db=['../../config/logger','api','moment','path','../../config/environment','./template.attributes','define','lodash','util'];(function(_0x2af4ca,_0x1732e4){var _0x4cbaec=function(_0x54dea6){while(--_0x54dea6){_0x2af4ca['push'](_0x2af4ca['shift']());}};_0x4cbaec(++_0x1732e4);}(_0xe0db,0x127));var _0xbe0d=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xe0db[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0xbe0d('0x0'));var util=require(_0xbe0d('0x1'));var logger=require(_0xbe0d('0x2'))(_0xbe0d('0x3'));var moment=require(_0xbe0d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe0d('0x5'));var rimraf=require('rimraf');var config=require(_0xbe0d('0x6'));var attributes=require(_0xbe0d('0x7'));module['exports']=function(_0x42b40f,_0x21526f){return _0x42b40f[_0xbe0d('0x8')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb6a=['define','Template','lodash','util','../../config/logger','api','bluebird','request-promise','path','./template.attributes'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xcb6a,0xca));var _0xacb6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcb6a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xacb6('0x0'));var util=require(_0xacb6('0x1'));var logger=require(_0xacb6('0x2'))(_0xacb6('0x3'));var moment=require('moment');var BPromise=require(_0xacb6('0x4'));var rp=require(_0xacb6('0x5'));var fs=require('fs');var path=require(_0xacb6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xacb6('0x7'));module['exports']=function(_0x109295,_0x3626d2){return _0x109295[_0xacb6('0x8')](_0xacb6('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index c68907e..5381f9d 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 _0x9e2a=['then','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','options','raw','where','limit','include','map','model','attributes'];(function(_0x1bebf8,_0x4e470c){var _0xa491b1=function(_0x59cd35){while(--_0x59cd35){_0x1bebf8['push'](_0x1bebf8['shift']());}};_0xa491b1(++_0x4e470c);}(_0x9e2a,0xe1));var _0xa9e2=function(_0x49fa57,_0x143b26){_0x49fa57=_0x49fa57-0x0;var _0x3e8d07=_0x9e2a[_0x49fa57];return _0x3e8d07;};'use strict';var _=require(_0xa9e2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9e2('0x1'));var db=require(_0xa9e2('0x2'))['db'];var utils=require(_0xa9e2('0x3'));var logger=require(_0xa9e2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa9e2('0x5')][_0xa9e2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xde042e,_0x205f5c,_0x2d2bd1){return new BPromise(function(_0x30b222,_0x5c0af8){return client[_0xa9e2('0x7')](_0xde042e,_0x2d2bd1)['then'](function(_0x5e44d6){logger[_0xa9e2('0x8')]('Template,\x20%s,\x20%s',_0x205f5c,_0xa9e2('0x9'));logger[_0xa9e2('0xa')](_0xa9e2('0xb'),_0x205f5c,'request\x20sent',JSON[_0xa9e2('0xc')](_0x5e44d6));if(_0x5e44d6[_0xa9e2('0xd')]){if(_0x5e44d6[_0xa9e2('0xd')]['code']===0x1f4){logger[_0xa9e2('0xd')](_0xa9e2('0xe'),_0x205f5c,_0x5e44d6[_0xa9e2('0xd')][_0xa9e2('0xf')]);return _0x5c0af8(_0x5e44d6[_0xa9e2('0xd')][_0xa9e2('0xf')]);}logger[_0xa9e2('0xd')](_0xa9e2('0xe'),_0x205f5c,_0x5e44d6[_0xa9e2('0xd')][_0xa9e2('0xf')]);return _0x30b222(_0x5e44d6['error'][_0xa9e2('0xf')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x205f5c,_0xa9e2('0x9'));_0x30b222(_0x5e44d6['result']['message']);}})[_0xa9e2('0x10')](function(_0x2deaed){logger[_0xa9e2('0xd')](_0xa9e2('0xe'),_0x205f5c,_0x2deaed);_0x5c0af8(_0x2deaed);});});}exports[_0xa9e2('0x11')]=function(_0x12229e){var _0x4b14fb=this;return new Promise(function(_0x31c91a,_0x458e31){return db[_0xa9e2('0x12')]['findAll']({'raw':_0x12229e[_0xa9e2('0x13')]?_0x12229e['options'][_0xa9e2('0x14')]===undefined?!![]:![]:!![],'where':_0x12229e['options']?_0x12229e[_0xa9e2('0x13')][_0xa9e2('0x15')]||null:null,'attributes':_0x12229e['options']?_0x12229e['options']['attributes']||null:null,'limit':_0x12229e['options']?_0x12229e[_0xa9e2('0x13')][_0xa9e2('0x16')]||null:null,'include':_0x12229e[_0xa9e2('0x13')]?_0x12229e['options'][_0xa9e2('0x17')]?_[_0xa9e2('0x18')](_0x12229e[_0xa9e2('0x13')][_0xa9e2('0x17')],function(_0x5a90ff){return{'model':db[_0x5a90ff['model']],'as':_0x5a90ff['as'],'attributes':_0x5a90ff['attributes'],'include':_0x5a90ff['include']?_['map'](_0x5a90ff[_0xa9e2('0x17')],function(_0x2cd269){return{'model':db[_0x2cd269[_0xa9e2('0x19')]],'as':_0x2cd269['as'],'attributes':_0x2cd269[_0xa9e2('0x1a')],'include':_0x2cd269[_0xa9e2('0x17')]?_[_0xa9e2('0x18')](_0x2cd269[_0xa9e2('0x17')],function(_0x5f3e4c){return{'model':db[_0x5f3e4c[_0xa9e2('0x19')]],'as':_0x5f3e4c['as'],'attributes':_0x5f3e4c[_0xa9e2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa9e2('0x1b')](function(_0x279c89){logger['info'](_0xa9e2('0x11'),_0x12229e);logger['debug'](_0xa9e2('0x11'),_0x12229e,JSON[_0xa9e2('0xc')](_0x279c89));_0x31c91a(_0x279c89);})[_0xa9e2('0x10')](function(_0x30b7b2){logger[_0xa9e2('0xd')](_0xa9e2('0x11'),_0x30b7b2['message'],_0x12229e);_0x458e31(_0x4b14fb[_0xa9e2('0xd')](0x1f4,_0x30b7b2[_0xa9e2('0xf')]));});});}; \ No newline at end of file +var _0x24fe=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Template,\x20%s,\x20%s','result','catch','GetTemplate','findAll','options','raw','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird'];(function(_0xddc06c,_0x3a86ef){var _0x1c7053=function(_0x4c580d){while(--_0x4c580d){_0xddc06c['push'](_0xddc06c['shift']());}};_0x1c7053(++_0x3a86ef);}(_0x24fe,0x10a));var _0xe24f=function(_0x2f6976,_0x54ae30){_0x2f6976=_0x2f6976-0x0;var _0x5186d4=_0x24fe[_0x2f6976];return _0x5186d4;};'use strict';var _=require(_0xe24f('0x0'));var util=require(_0xe24f('0x1'));var moment=require(_0xe24f('0x2'));var BPromise=require(_0xe24f('0x3'));var rs=require(_0xe24f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe24f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe24f('0x6'))(_0xe24f('0x7'));var config=require('../../config/environment');var jayson=require(_0xe24f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xccc43e,_0x10c668,_0x597cf0){return new BPromise(function(_0x392396,_0xc93bd9){return client['request'](_0xccc43e,_0x597cf0)['then'](function(_0x48a275){logger[_0xe24f('0x9')]('Template,\x20%s,\x20%s',_0x10c668,_0xe24f('0xa'));logger['debug'](_0xe24f('0xb'),_0x10c668,_0xe24f('0xa'),JSON[_0xe24f('0xc')](_0x48a275));if(_0x48a275['error']){if(_0x48a275[_0xe24f('0xd')][_0xe24f('0xe')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x10c668,_0x48a275['error'][_0xe24f('0xf')]);return _0xc93bd9(_0x48a275['error']['message']);}logger['error']('Template,\x20%s,\x20%s',_0x10c668,_0x48a275[_0xe24f('0xd')][_0xe24f('0xf')]);return _0x392396(_0x48a275[_0xe24f('0xd')][_0xe24f('0xf')]);}else{logger[_0xe24f('0x9')](_0xe24f('0x10'),_0x10c668,_0xe24f('0xa'));_0x392396(_0x48a275[_0xe24f('0x11')][_0xe24f('0xf')]);}})[_0xe24f('0x12')](function(_0x5c5ef4){logger[_0xe24f('0xd')]('Template,\x20%s,\x20%s',_0x10c668,_0x5c5ef4);_0xc93bd9(_0x5c5ef4);});});}exports[_0xe24f('0x13')]=function(_0x3ec7b0){var _0x191254=this;return new Promise(function(_0x206058,_0xcd9c9f){return db['Template'][_0xe24f('0x14')]({'raw':_0x3ec7b0[_0xe24f('0x15')]?_0x3ec7b0[_0xe24f('0x15')][_0xe24f('0x16')]===undefined?!![]:![]:!![],'where':_0x3ec7b0['options']?_0x3ec7b0[_0xe24f('0x15')][_0xe24f('0x17')]||null:null,'attributes':_0x3ec7b0[_0xe24f('0x15')]?_0x3ec7b0[_0xe24f('0x15')][_0xe24f('0x18')]||null:null,'limit':_0x3ec7b0['options']?_0x3ec7b0[_0xe24f('0x15')]['limit']||null:null,'include':_0x3ec7b0[_0xe24f('0x15')]?_0x3ec7b0[_0xe24f('0x15')][_0xe24f('0x19')]?_[_0xe24f('0x1a')](_0x3ec7b0[_0xe24f('0x15')][_0xe24f('0x19')],function(_0x228c34){return{'model':db[_0x228c34[_0xe24f('0x1b')]],'as':_0x228c34['as'],'attributes':_0x228c34[_0xe24f('0x18')],'include':_0x228c34[_0xe24f('0x19')]?_[_0xe24f('0x1a')](_0x228c34[_0xe24f('0x19')],function(_0x468329){return{'model':db[_0x468329[_0xe24f('0x1b')]],'as':_0x468329['as'],'attributes':_0x468329['attributes'],'include':_0x468329[_0xe24f('0x19')]?_[_0xe24f('0x1a')](_0x468329[_0xe24f('0x19')],function(_0x5257f9){return{'model':db[_0x5257f9[_0xe24f('0x1b')]],'as':_0x5257f9['as'],'attributes':_0x5257f9[_0xe24f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe24f('0x1c')](function(_0x3fcee1){logger[_0xe24f('0x9')](_0xe24f('0x13'),_0x3ec7b0);logger[_0xe24f('0x1d')]('GetTemplate',_0x3ec7b0,JSON['stringify'](_0x3fcee1));_0x206058(_0x3fcee1);})[_0xe24f('0x12')](function(_0xf6da5b){logger['error']('GetTemplate',_0xf6da5b[_0xe24f('0xf')],_0x3ec7b0);_0xcd9c9f(_0x191254[_0xe24f('0xd')](0x1f4,_0xf6da5b[_0xe24f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index f53e81f..554abc4 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 _0x3144=['../../config/environment','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x26b5d2,_0x5de89a){var _0x6b48a=function(_0x305ba0){while(--_0x305ba0){_0x26b5d2['push'](_0x26b5d2['shift']());}};_0x6b48a(++_0x5de89a);}(_0x3144,0x1dd));var _0x4314=function(_0x5a0d34,_0x114c96){_0x5a0d34=_0x5a0d34-0x0;var _0x1a3b8c=_0x3144[_0x5a0d34];return _0x1a3b8c;};'use strict';var multer=require(_0x4314('0x0'));var util=require('util');var path=require(_0x4314('0x1'));var timeout=require(_0x4314('0x2'));var express=require(_0x4314('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4314('0x4'));var interaction=require(_0x4314('0x5'));var config=require(_0x4314('0x6'));var controller=require('./trigger.controller');router[_0x4314('0x7')]('/',auth[_0x4314('0x8')](),controller['index']);router[_0x4314('0x7')]('/:id',auth[_0x4314('0x8')](),controller[_0x4314('0x9')]);router['get'](_0x4314('0xa'),auth[_0x4314('0x8')](),controller[_0x4314('0xb')]);router[_0x4314('0x7')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x4314('0xc')]);router['get'](_0x4314('0xd'),auth[_0x4314('0x8')](),controller[_0x4314('0xe')]);router[_0x4314('0xf')]('/',auth[_0x4314('0x8')](),controller['create']);router['post']('/:id/all_conditions',auth[_0x4314('0x8')](),controller[_0x4314('0x10')]);router[_0x4314('0xf')](_0x4314('0x11'),auth[_0x4314('0x8')](),controller[_0x4314('0x12')]);router[_0x4314('0xf')]('/:id/actions',auth[_0x4314('0x8')](),controller[_0x4314('0x13')]);router[_0x4314('0x14')]('/:id',auth[_0x4314('0x8')](),controller[_0x4314('0x15')]);router['delete']('/:id',auth[_0x4314('0x8')](),controller[_0x4314('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0124=['../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','update','delete','destroy','util','path','express','Router','../../components/auth/service'];(function(_0x133ccc,_0x4f9a55){var _0x230ac9=function(_0x96253d){while(--_0x96253d){_0x133ccc['push'](_0x133ccc['shift']());}};_0x230ac9(++_0x4f9a55);}(_0x0124,0xa3));var _0x4012=function(_0x106895,_0xf6b6be){_0x106895=_0x106895-0x0;var _0x3ee675=_0x0124[_0x106895];return _0x3ee675;};'use strict';var multer=require('multer');var util=require(_0x4012('0x0'));var path=require(_0x4012('0x1'));var timeout=require('connect-timeout');var express=require(_0x4012('0x2'));var router=express[_0x4012('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4012('0x4'));var interaction=require(_0x4012('0x5'));var config=require(_0x4012('0x6'));var controller=require(_0x4012('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4012('0x8')](_0x4012('0x9'),auth[_0x4012('0xa')](),controller['show']);router[_0x4012('0x8')](_0x4012('0xb'),auth[_0x4012('0xa')](),controller[_0x4012('0xc')]);router[_0x4012('0x8')](_0x4012('0xd'),auth[_0x4012('0xa')](),controller['getAnyConditions']);router[_0x4012('0x8')](_0x4012('0xe'),auth[_0x4012('0xa')](),controller[_0x4012('0xf')]);router[_0x4012('0x10')]('/',auth[_0x4012('0xa')](),controller[_0x4012('0x11')]);router[_0x4012('0x10')](_0x4012('0xb'),auth[_0x4012('0xa')](),controller[_0x4012('0x12')]);router['post']('/:id/any_conditions',auth[_0x4012('0xa')](),controller['addAnyCondition']);router[_0x4012('0x10')](_0x4012('0xe'),auth[_0x4012('0xa')](),controller[_0x4012('0x13')]);router[_0x4012('0x14')]('/:id',auth[_0x4012('0xa')](),controller[_0x4012('0x15')]);router[_0x4012('0x16')](_0x4012('0x9'),auth[_0x4012('0xa')](),controller[_0x4012('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 86ba821..a98b2d9 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 _0xd39f=['sequelize','exports','BOOLEAN'];(function(_0x510d04,_0x4aabb3){var _0x846cab=function(_0x24e39c){while(--_0x24e39c){_0x510d04['push'](_0x510d04['shift']());}};_0x846cab(++_0x4aabb3);}(_0xd39f,0xc6));var _0xfd39=function(_0x366f48,_0x49f58f){_0x366f48=_0x366f48-0x0;var _0x273155=_0xd39f[_0x366f48];return _0x273155;};'use strict';var Sequelize=require(_0xfd39('0x0'));module[_0xfd39('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xfd39('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xff92=['exports','STRING','BOOLEAN','sequelize'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0xff92,0x67));var _0x2ff9=function(_0x36471a,_0x433222){_0x36471a=_0x36471a-0x0;var _0x569516=_0xff92[_0x36471a];return _0x569516;};'use strict';var Sequelize=require(_0x2ff9('0x0'));module[_0x2ff9('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2ff9('0x2')]},'description':{'type':Sequelize[_0x2ff9('0x2')]},'status':{'type':Sequelize[_0x2ff9('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 a8bb942..b036eb8 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 _0xe219=['Trigger','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','order','getAnyConditions','findOne','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','set','json','apply','reject','save','update','then','destroy','Triggers','error','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe219,0x14f));var _0x9e21=function(_0x227052,_0x1fb36c){_0x227052=_0x227052-0x0;var _0x4fd067=_0xe219[_0x227052];return _0x4fd067;};'use strict';var emlformat=require(_0x9e21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e21('0x1'));var jsonpatch=require(_0x9e21('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e21('0x3'));var Mustache=require(_0x9e21('0x4'));var util=require(_0x9e21('0x5'));var path=require(_0x9e21('0x6'));var sox=require('sox');var csv=require(_0x9e21('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e21('0x8'));var _=require(_0x9e21('0x9'));var squel=require(_0x9e21('0xa'));var crypto=require(_0x9e21('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9e21('0xc'));var toCsv=require(_0x9e21('0x7'));var querystring=require(_0x9e21('0xd'));var Papa=require('papaparse');var Redis=require(_0x9e21('0xe'));var authService=require(_0x9e21('0xf'));var qs=require(_0x9e21('0x10'));var as=require(_0x9e21('0x11'));var hardwareService=require(_0x9e21('0x12'));var logger=require(_0x9e21('0x13'))('api');var utils=require(_0x9e21('0x14'));var config=require(_0x9e21('0x15'));var licenseUtil=require(_0x9e21('0x16'));var db=require(_0x9e21('0x17'))['db'];function respondWithStatusCode(_0x5eb739,_0x342126){_0x342126=_0x342126||0xcc;return function(_0x1571c2){if(_0x1571c2){return _0x5eb739[_0x9e21('0x18')](_0x342126);}return _0x5eb739['status'](_0x342126)[_0x9e21('0x19')]();};}function respondWithResult(_0x17f454,_0x2202af){_0x2202af=_0x2202af||0xc8;return function(_0x18b456){if(_0x18b456){return _0x17f454['status'](_0x2202af)['json'](_0x18b456);}};}function respondWithFilteredResult(_0x13b06f,_0x15a68b){return function(_0x3c536e){if(_0x3c536e){var _0x438c71=typeof _0x15a68b[_0x9e21('0x1a')]==='undefined'&&typeof _0x15a68b['limit']===_0x9e21('0x1b');var _0x5b9c51=_0x3c536e[_0x9e21('0x1c')];var _0x287f52=_0x438c71?0x0:_0x15a68b[_0x9e21('0x1a')];var _0x269ba0=_0x438c71?_0x3c536e[_0x9e21('0x1c')]:_0x15a68b['offset']+_0x15a68b['limit'];var _0x16effb;if(_0x269ba0>=_0x5b9c51){_0x269ba0=_0x5b9c51;_0x16effb=0xc8;}else{_0x16effb=0xce;}_0x13b06f[_0x9e21('0x1d')](_0x16effb);return _0x13b06f[_0x9e21('0x1e')]('Content-Range',_0x287f52+'-'+_0x269ba0+'/'+_0x5b9c51)[_0x9e21('0x1f')](_0x3c536e);}return null;};}function patchUpdates(_0x2a7342){return function(_0x814934){try{jsonpatch[_0x9e21('0x20')](_0x814934,_0x2a7342,!![]);}catch(_0x52b9f9){return BPromise[_0x9e21('0x21')](_0x52b9f9);}return _0x814934[_0x9e21('0x22')]();};}function saveUpdates(_0x3eadd7,_0x35311a){return function(_0x23619c){if(_0x23619c){return _0x23619c[_0x9e21('0x23')](_0x3eadd7)[_0x9e21('0x24')](function(_0x44737a){return _0x44737a;});}return null;};}function removeEntity(_0x1e0105,_0x4e2b25){return function(_0x130774){if(_0x130774){return _0x130774[_0x9e21('0x25')]()[_0x9e21('0x24')](function(){var _0xfa3122=_0x130774['get']({'plain':!![]});var _0x82687d=_0x9e21('0x26');return db['UserProfileResource'][_0x9e21('0x25')]({'where':{'type':_0x82687d,'resourceId':_0xfa3122['id']}})[_0x9e21('0x24')](function(){return _0x130774;});})['then'](function(){_0x1e0105[_0x9e21('0x1d')](0xcc)[_0x9e21('0x19')]();});}};}function handleEntityNotFound(_0x4c3f8b,_0xeb2769){return function(_0x10f4fb){if(!_0x10f4fb){_0x4c3f8b[_0x9e21('0x18')](0x194);}return _0x10f4fb;};}function handleError(_0x43d1c8,_0x3ced7d){_0x3ced7d=_0x3ced7d||0x1f4;return function(_0x8fec9c){logger[_0x9e21('0x27')](_0x8fec9c[_0x9e21('0x28')]);if(_0x8fec9c[_0x9e21('0x29')]){delete _0x8fec9c[_0x9e21('0x29')];}_0x43d1c8[_0x9e21('0x1d')](_0x3ced7d)[_0x9e21('0x2a')](_0x8fec9c);};}exports[_0x9e21('0x2b')]=function(_0x19d618,_0x4b9fca){var _0x92df41={},_0x407550={},_0x409c57={'count':0x0,'rows':[]};var _0x4754ba=_[_0x9e21('0x2c')](db[_0x9e21('0x2d')][_0x9e21('0x2e')],function(_0x3807b5){return{'name':_0x3807b5[_0x9e21('0x2f')],'type':_0x3807b5['type']['key']};});_0x407550[_0x9e21('0x30')]=_[_0x9e21('0x2c')](_0x4754ba,'name');_0x407550['query']=_[_0x9e21('0x31')](_0x19d618['query']);_0x407550[_0x9e21('0x32')]=_[_0x9e21('0x33')](_0x407550[_0x9e21('0x30')],_0x407550[_0x9e21('0x34')]);_0x92df41[_0x9e21('0x35')]=_[_0x9e21('0x33')](_0x407550[_0x9e21('0x30')],qs[_0x9e21('0x36')](_0x19d618['query'][_0x9e21('0x36')]));_0x92df41[_0x9e21('0x35')]=_0x92df41[_0x9e21('0x35')][_0x9e21('0x37')]?_0x92df41['attributes']:_0x407550[_0x9e21('0x30')];if(!_0x19d618[_0x9e21('0x34')][_0x9e21('0x38')](_0x9e21('0x39'))){_0x92df41[_0x9e21('0x3a')]=qs[_0x9e21('0x3a')](_0x19d618[_0x9e21('0x34')][_0x9e21('0x3a')]);_0x92df41[_0x9e21('0x1a')]=qs['offset'](_0x19d618['query'][_0x9e21('0x1a')]);}_0x92df41['order']=qs[_0x9e21('0x3b')](_0x19d618['query'][_0x9e21('0x3b')]);_0x92df41[_0x9e21('0x3c')]=qs[_0x9e21('0x32')](_[_0x9e21('0x3d')](_0x19d618[_0x9e21('0x34')],_0x407550['filters']),_0x4754ba);if(_0x19d618['query'][_0x9e21('0x3e')]){_0x92df41[_0x9e21('0x3c')]=_[_0x9e21('0x3f')](_0x92df41['where'],{'$or':_[_0x9e21('0x2c')](_0x4754ba,function(_0x582adc){if(_0x582adc[_0x9e21('0x40')]!==_0x9e21('0x41')){var _0x1d0fe8={};_0x1d0fe8[_0x582adc[_0x9e21('0x29')]]={'$like':'%'+_0x19d618['query'][_0x9e21('0x3e')]+'%'};return _0x1d0fe8;}})});}_0x92df41=_[_0x9e21('0x3f')]({},_0x92df41,_0x19d618[_0x9e21('0x42')]);var _0x3c5375={'where':_0x92df41['where']};return db[_0x9e21('0x2d')][_0x9e21('0x1c')](_0x3c5375)[_0x9e21('0x24')](function(_0x177051){_0x409c57['count']=_0x177051;if(_0x19d618[_0x9e21('0x34')][_0x9e21('0x43')]){_0x92df41[_0x9e21('0x44')]=[{'all':!![]}];}return db[_0x9e21('0x2d')][_0x9e21('0x45')](_0x92df41);})['then'](function(_0xb8c6a9){_0x409c57['rows']=_0xb8c6a9;return _0x409c57;})[_0x9e21('0x24')](respondWithFilteredResult(_0x4b9fca,_0x92df41))[_0x9e21('0x46')](handleError(_0x4b9fca,null));};exports[_0x9e21('0x47')]=function(_0x42f983,_0x4625a5){var _0x335d49={'raw':![],'where':{'id':_0x42f983['params']['id']}},_0x417ed8={};_0x417ed8[_0x9e21('0x30')]=_[_0x9e21('0x31')](db[_0x9e21('0x2d')][_0x9e21('0x2e')]);_0x417ed8[_0x9e21('0x34')]=_[_0x9e21('0x31')](_0x42f983[_0x9e21('0x34')]);_0x417ed8['filters']=_['intersection'](_0x417ed8[_0x9e21('0x30')],_0x417ed8['query']);_0x335d49[_0x9e21('0x35')]=_[_0x9e21('0x33')](_0x417ed8[_0x9e21('0x30')],qs[_0x9e21('0x36')](_0x42f983[_0x9e21('0x34')][_0x9e21('0x36')]));_0x335d49[_0x9e21('0x35')]=_0x335d49[_0x9e21('0x35')]['length']?_0x335d49[_0x9e21('0x35')]:_0x417ed8['model'];if(_0x42f983[_0x9e21('0x34')][_0x9e21('0x43')]){_0x335d49['include']=[{'all':!![]}];}_0x335d49=_[_0x9e21('0x3f')]({},_0x335d49,_0x42f983['options']);return db[_0x9e21('0x2d')][_0x9e21('0x48')](_0x335d49)['then'](handleEntityNotFound(_0x4625a5,null))[_0x9e21('0x24')](respondWithResult(_0x4625a5,null))[_0x9e21('0x46')](handleError(_0x4625a5,null));};exports[_0x9e21('0x49')]=function(_0x327543,_0x11642a){return db[_0x9e21('0x2d')][_0x9e21('0x49')](_0x327543[_0x9e21('0x4a')],{})[_0x9e21('0x24')](function(_0x298335){var _0x4e91a7=_0x327543['user'][_0x9e21('0x4b')]({'plain':!![]});if(!_0x4e91a7)throw new Error(_0x9e21('0x4c'));if(_0x4e91a7['role']===_0x9e21('0x4d')){var _0x1efd67=_0x298335[_0x9e21('0x4b')]({'plain':!![]});var _0x2ab8c8=_0x9e21('0x26');return db['UserProfileSection'][_0x9e21('0x48')]({'where':{'name':_0x2ab8c8,'userProfileId':_0x4e91a7[_0x9e21('0x4e')]},'raw':!![]})[_0x9e21('0x24')](function(_0x2da6b5){if(_0x2da6b5&&_0x2da6b5[_0x9e21('0x4f')]===0x0){return db[_0x9e21('0x50')]['create']({'name':_0x1efd67[_0x9e21('0x29')],'resourceId':_0x1efd67['id'],'type':_0x2da6b5[_0x9e21('0x29')],'sectionId':_0x2da6b5['id']},{})[_0x9e21('0x24')](function(){return _0x298335;});}else{return _0x298335;}})[_0x9e21('0x46')](function(_0x3ed96c){logger[_0x9e21('0x27')](_0x9e21('0x51'),_0x3ed96c);throw _0x3ed96c;});}return _0x298335;})[_0x9e21('0x24')](respondWithResult(_0x11642a,0xc9))['catch'](handleError(_0x11642a,null));};exports[_0x9e21('0x23')]=function(_0x39c8ac,_0x328f2a){if(_0x39c8ac[_0x9e21('0x4a')]['id']){delete _0x39c8ac[_0x9e21('0x4a')]['id'];}return db[_0x9e21('0x2d')][_0x9e21('0x48')]({'where':{'id':_0x39c8ac['params']['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0x328f2a,null))[_0x9e21('0x24')](saveUpdates(_0x39c8ac[_0x9e21('0x4a')],null))[_0x9e21('0x24')](respondWithResult(_0x328f2a,null))[_0x9e21('0x46')](handleError(_0x328f2a,null));};exports[_0x9e21('0x25')]=function(_0x3611ef,_0x4c0239){return db[_0x9e21('0x2d')][_0x9e21('0x48')]({'where':{'id':_0x3611ef[_0x9e21('0x52')]['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0x4c0239,null))['then'](removeEntity(_0x4c0239,null))['catch'](handleError(_0x4c0239,null));};exports[_0x9e21('0x53')]=function(_0x212c86,_0x32d322,_0x4b7508){if(_0x212c86[_0x9e21('0x4a')]['id']){delete _0x212c86[_0x9e21('0x4a')]['id'];}return db[_0x9e21('0x2d')][_0x9e21('0x48')]({'where':{'id':_0x212c86[_0x9e21('0x52')]['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0x32d322,null))[_0x9e21('0x24')](function(_0x3798fb){if(_0x3798fb){_0x212c86[_0x9e21('0x4a')][_0x9e21('0x54')]=_0x3798fb['id'];return db[_0x9e21('0x55')][_0x9e21('0x49')](_0x212c86[_0x9e21('0x4a')]);}})[_0x9e21('0x24')](respondWithResult(_0x32d322,null))['catch'](handleError(_0x32d322,null));};exports[_0x9e21('0x56')]=function(_0x2a40ac,_0x2b5acb,_0x3af6d6){if(_0x2a40ac[_0x9e21('0x4a')]['id']){delete _0x2a40ac[_0x9e21('0x4a')]['id'];}return db['Trigger'][_0x9e21('0x48')]({'where':{'id':_0x2a40ac[_0x9e21('0x52')]['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0x2b5acb,null))[_0x9e21('0x24')](function(_0x15ba2b){if(_0x15ba2b){_0x2a40ac[_0x9e21('0x4a')][_0x9e21('0x57')]=_0x15ba2b['id'];return db[_0x9e21('0x55')][_0x9e21('0x49')](_0x2a40ac['body']);}})[_0x9e21('0x24')](respondWithResult(_0x2b5acb,null))[_0x9e21('0x46')](handleError(_0x2b5acb,null));};exports[_0x9e21('0x58')]=function(_0x1e338b,_0x1610a6,_0x4e51c3){var _0x1f91dc={};var _0x5e7e7c={};var _0x823c9f;var _0x3ec6b7;return db['Trigger']['findOne']({'where':{'id':_0x1e338b['params']['id']}})['then'](handleEntityNotFound(_0x1610a6,null))[_0x9e21('0x24')](function(_0x5ec79a){if(_0x5ec79a){_0x823c9f=_0x5ec79a;_0x5e7e7c[_0x9e21('0x30')]=_[_0x9e21('0x31')](db[_0x9e21('0x55')][_0x9e21('0x2e')]);_0x5e7e7c['query']=_[_0x9e21('0x31')](_0x1e338b['query']);_0x5e7e7c[_0x9e21('0x32')]=_[_0x9e21('0x33')](_0x5e7e7c[_0x9e21('0x30')],_0x5e7e7c['query']);_0x1f91dc[_0x9e21('0x35')]=_[_0x9e21('0x33')](_0x5e7e7c['model'],qs[_0x9e21('0x36')](_0x1e338b['query'][_0x9e21('0x36')]));_0x1f91dc[_0x9e21('0x35')]=_0x1f91dc['attributes'][_0x9e21('0x37')]?_0x1f91dc[_0x9e21('0x35')]:_0x5e7e7c[_0x9e21('0x30')];_0x1f91dc[_0x9e21('0x59')]=qs[_0x9e21('0x3b')](_0x1e338b[_0x9e21('0x34')][_0x9e21('0x3b')]);_0x1f91dc[_0x9e21('0x3c')]=qs[_0x9e21('0x32')](_[_0x9e21('0x3d')](_0x1e338b['query'],_0x5e7e7c[_0x9e21('0x32')]));if(_0x1e338b[_0x9e21('0x34')][_0x9e21('0x3e')]){_0x1f91dc['where']=_[_0x9e21('0x3f')](_0x1f91dc[_0x9e21('0x3c')],{'$or':_[_0x9e21('0x2c')](_0x1f91dc[_0x9e21('0x35')],function(_0x44a4c6){var _0x460f3b={};_0x460f3b[_0x44a4c6]={'$like':'%'+_0x1e338b['query'][_0x9e21('0x3e')]+'%'};return _0x460f3b;})});}_0x1f91dc=_[_0x9e21('0x3f')]({},_0x1f91dc,_0x1e338b['options']);return _0x823c9f[_0x9e21('0x58')](_0x1f91dc);}})[_0x9e21('0x24')](function(_0x408e86){if(_0x408e86){_0x3ec6b7=_0x408e86[_0x9e21('0x37')];if(!_0x1e338b[_0x9e21('0x34')]['hasOwnProperty'](_0x9e21('0x39'))){_0x1f91dc[_0x9e21('0x3a')]=qs['limit'](_0x1e338b['query']['limit']);_0x1f91dc[_0x9e21('0x1a')]=qs[_0x9e21('0x1a')](_0x1e338b[_0x9e21('0x34')]['offset']);}return _0x823c9f[_0x9e21('0x58')](_0x1f91dc);}})[_0x9e21('0x24')](function(_0x491068){if(_0x491068){return _0x491068?{'count':_0x3ec6b7,'rows':_0x491068}:null;}})[_0x9e21('0x24')](respondWithResult(_0x1610a6,null))[_0x9e21('0x46')](handleError(_0x1610a6,null));};exports[_0x9e21('0x5a')]=function(_0x40b6b1,_0x3cdbad,_0x545693){var _0x205303={};var _0x86dd25={};var _0x3360eb;var _0x59c7a0;return db[_0x9e21('0x2d')][_0x9e21('0x5b')]({'where':{'id':_0x40b6b1[_0x9e21('0x52')]['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0x3cdbad,null))['then'](function(_0x4aa871){if(_0x4aa871){_0x3360eb=_0x4aa871;_0x86dd25[_0x9e21('0x30')]=_[_0x9e21('0x31')](db['Condition']['rawAttributes']);_0x86dd25[_0x9e21('0x34')]=_[_0x9e21('0x31')](_0x40b6b1[_0x9e21('0x34')]);_0x86dd25[_0x9e21('0x32')]=_[_0x9e21('0x33')](_0x86dd25[_0x9e21('0x30')],_0x86dd25[_0x9e21('0x34')]);_0x205303[_0x9e21('0x35')]=_[_0x9e21('0x33')](_0x86dd25[_0x9e21('0x30')],qs[_0x9e21('0x36')](_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x36')]));_0x205303['attributes']=_0x205303[_0x9e21('0x35')]['length']?_0x205303[_0x9e21('0x35')]:_0x86dd25[_0x9e21('0x30')];_0x205303[_0x9e21('0x59')]=qs['sort'](_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x3b')]);_0x205303[_0x9e21('0x3c')]=qs[_0x9e21('0x32')](_[_0x9e21('0x3d')](_0x40b6b1[_0x9e21('0x34')],_0x86dd25[_0x9e21('0x32')]));if(_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x3e')]){_0x205303[_0x9e21('0x3c')]=_[_0x9e21('0x3f')](_0x205303['where'],{'$or':_[_0x9e21('0x2c')](_0x205303[_0x9e21('0x35')],function(_0x35bc7a){var _0x5990f7={};_0x5990f7[_0x35bc7a]={'$like':'%'+_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x3e')]+'%'};return _0x5990f7;})});}_0x205303=_[_0x9e21('0x3f')]({},_0x205303,_0x40b6b1[_0x9e21('0x42')]);return _0x3360eb[_0x9e21('0x5a')](_0x205303);}})[_0x9e21('0x24')](function(_0x35c274){if(_0x35c274){_0x59c7a0=_0x35c274[_0x9e21('0x37')];if(!_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x38')](_0x9e21('0x39'))){_0x205303[_0x9e21('0x3a')]=qs['limit'](_0x40b6b1[_0x9e21('0x34')]['limit']);_0x205303[_0x9e21('0x1a')]=qs[_0x9e21('0x1a')](_0x40b6b1[_0x9e21('0x34')][_0x9e21('0x1a')]);}return _0x3360eb[_0x9e21('0x5a')](_0x205303);}})[_0x9e21('0x24')](function(_0x33454e){if(_0x33454e){return _0x33454e?{'count':_0x59c7a0,'rows':_0x33454e}:null;}})[_0x9e21('0x24')](respondWithResult(_0x3cdbad,null))['catch'](handleError(_0x3cdbad,null));};exports[_0x9e21('0x5c')]=function(_0x25f1c0,_0x5e209a,_0x4bfad2){if(_0x25f1c0[_0x9e21('0x4a')]['id']){delete _0x25f1c0['body']['id'];}return db['Trigger'][_0x9e21('0x48')]({'where':{'id':_0x25f1c0['params']['id']}})['then'](handleEntityNotFound(_0x5e209a,null))[_0x9e21('0x24')](function(_0x197ab5){if(_0x197ab5){_0x25f1c0[_0x9e21('0x4a')]['TriggerId']=_0x197ab5['id'];return db['Action']['create'](_0x25f1c0['body']);}})[_0x9e21('0x24')](respondWithResult(_0x5e209a,null))[_0x9e21('0x46')](handleError(_0x5e209a,null));};exports['getActions']=function(_0x1114bd,_0xc9ea40,_0x561dbc){var _0x38f329={};var _0x2e6367={};var _0x352ae9;var _0x2e93e7;return db[_0x9e21('0x2d')][_0x9e21('0x5b')]({'where':{'id':_0x1114bd[_0x9e21('0x52')]['id']}})[_0x9e21('0x24')](handleEntityNotFound(_0xc9ea40,null))[_0x9e21('0x24')](function(_0x5ef5d0){if(_0x5ef5d0){_0x352ae9=_0x5ef5d0;_0x2e6367[_0x9e21('0x30')]=_[_0x9e21('0x31')](db[_0x9e21('0x5d')]['rawAttributes']);_0x2e6367[_0x9e21('0x34')]=_['keys'](_0x1114bd['query']);_0x2e6367[_0x9e21('0x32')]=_['intersection'](_0x2e6367[_0x9e21('0x30')],_0x2e6367['query']);_0x38f329[_0x9e21('0x35')]=_[_0x9e21('0x33')](_0x2e6367[_0x9e21('0x30')],qs[_0x9e21('0x36')](_0x1114bd[_0x9e21('0x34')][_0x9e21('0x36')]));_0x38f329[_0x9e21('0x35')]=_0x38f329[_0x9e21('0x35')][_0x9e21('0x37')]?_0x38f329[_0x9e21('0x35')]:_0x2e6367['model'];_0x38f329[_0x9e21('0x59')]=qs[_0x9e21('0x3b')](_0x1114bd[_0x9e21('0x34')][_0x9e21('0x3b')]);_0x38f329[_0x9e21('0x3c')]=qs[_0x9e21('0x32')](_['pick'](_0x1114bd['query'],_0x2e6367[_0x9e21('0x32')]));if(_0x1114bd[_0x9e21('0x34')][_0x9e21('0x3e')]){_0x38f329[_0x9e21('0x3c')]=_[_0x9e21('0x3f')](_0x38f329[_0x9e21('0x3c')],{'$or':_[_0x9e21('0x2c')](_0x38f329[_0x9e21('0x35')],function(_0x7ed992){var _0x326b1d={};_0x326b1d[_0x7ed992]={'$like':'%'+_0x1114bd[_0x9e21('0x34')][_0x9e21('0x3e')]+'%'};return _0x326b1d;})});}_0x38f329=_[_0x9e21('0x3f')]({},_0x38f329,_0x1114bd[_0x9e21('0x42')]);return _0x352ae9[_0x9e21('0x5e')](_0x38f329);}})['then'](function(_0x13e39b){if(_0x13e39b){_0x2e93e7=_0x13e39b[_0x9e21('0x37')];if(!_0x1114bd[_0x9e21('0x34')][_0x9e21('0x38')](_0x9e21('0x39'))){_0x38f329['limit']=qs[_0x9e21('0x3a')](_0x1114bd[_0x9e21('0x34')][_0x9e21('0x3a')]);_0x38f329['offset']=qs[_0x9e21('0x1a')](_0x1114bd[_0x9e21('0x34')][_0x9e21('0x1a')]);}return _0x352ae9[_0x9e21('0x5e')](_0x38f329);}})['then'](function(_0x3796a3){if(_0x3796a3){return _0x3796a3?{'count':_0x2e93e7,'rows':_0x3796a3}:null;}})[_0x9e21('0x24')](respondWithResult(_0xc9ea40,null))[_0x9e21('0x46')](handleError(_0xc9ea40,null));}; \ No newline at end of file +var _0x2880=['Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','Trigger','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','findOne','pick','getAllConditions','getAnyConditions','addAction','TriggerId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2880,0x1ec));var _0x0288=function(_0x3f70bb,_0x329d02){_0x3f70bb=_0x3f70bb-0x0;var _0x865b97=_0x2880[_0x3f70bb];return _0x865b97;};'use strict';var emlformat=require(_0x0288('0x0'));var rimraf=require(_0x0288('0x1'));var zipdir=require(_0x0288('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0288('0x3'));var moment=require(_0x0288('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0288('0x5'));var util=require(_0x0288('0x6'));var path=require(_0x0288('0x7'));var sox=require(_0x0288('0x8'));var csv=require('to-csv');var ejs=require(_0x0288('0x9'));var fs=require('fs');var fs_extra=require(_0x0288('0xa'));var _=require('lodash');var squel=require(_0x0288('0xb'));var crypto=require(_0x0288('0xc'));var jsforce=require(_0x0288('0xd'));var deskjs=require(_0x0288('0xe'));var toCsv=require(_0x0288('0xf'));var querystring=require(_0x0288('0x10'));var Papa=require(_0x0288('0x11'));var Redis=require(_0x0288('0x12'));var authService=require(_0x0288('0x13'));var qs=require(_0x0288('0x14'));var as=require(_0x0288('0x15'));var hardwareService=require(_0x0288('0x16'));var logger=require(_0x0288('0x17'))(_0x0288('0x18'));var utils=require('../../config/utils');var config=require(_0x0288('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0288('0x1a'))['db'];function respondWithStatusCode(_0x8c61c1,_0x14b99f){_0x14b99f=_0x14b99f||0xcc;return function(_0x2affae){if(_0x2affae){return _0x8c61c1[_0x0288('0x1b')](_0x14b99f);}return _0x8c61c1[_0x0288('0x1c')](_0x14b99f)[_0x0288('0x1d')]();};}function respondWithResult(_0x181b50,_0x1ed94f){_0x1ed94f=_0x1ed94f||0xc8;return function(_0x169edd){if(_0x169edd){return _0x181b50[_0x0288('0x1c')](_0x1ed94f)[_0x0288('0x1e')](_0x169edd);}};}function respondWithFilteredResult(_0x30236c,_0x34fff4){return function(_0x2e7118){if(_0x2e7118){var _0x11a9f3=typeof _0x34fff4[_0x0288('0x1f')]===_0x0288('0x20')&&typeof _0x34fff4[_0x0288('0x21')]===_0x0288('0x20');var _0x46e40f=_0x2e7118[_0x0288('0x22')];var _0x5aeb2a=_0x11a9f3?0x0:_0x34fff4['offset'];var _0x2101c6=_0x11a9f3?_0x2e7118[_0x0288('0x22')]:_0x34fff4['offset']+_0x34fff4['limit'];var _0x5c51be;if(_0x2101c6>=_0x46e40f){_0x2101c6=_0x46e40f;_0x5c51be=0xc8;}else{_0x5c51be=0xce;}_0x30236c[_0x0288('0x1c')](_0x5c51be);return _0x30236c[_0x0288('0x23')](_0x0288('0x24'),_0x5aeb2a+'-'+_0x2101c6+'/'+_0x46e40f)['json'](_0x2e7118);}return null;};}function patchUpdates(_0x195c0d){return function(_0x1c5c88){try{jsonpatch['apply'](_0x1c5c88,_0x195c0d,!![]);}catch(_0x22b0c5){return BPromise[_0x0288('0x25')](_0x22b0c5);}return _0x1c5c88[_0x0288('0x26')]();};}function saveUpdates(_0x37b0a3,_0x3e2be7){return function(_0x26596f){if(_0x26596f){return _0x26596f[_0x0288('0x27')](_0x37b0a3)['then'](function(_0x31dcb5){return _0x31dcb5;});}return null;};}function removeEntity(_0x5825d0,_0xdefef2){return function(_0x38f878){if(_0x38f878){return _0x38f878[_0x0288('0x28')]()['then'](function(){var _0x5cf3c3=_0x38f878['get']({'plain':!![]});var _0x501aff='Triggers';return db['UserProfileResource'][_0x0288('0x28')]({'where':{'type':_0x501aff,'resourceId':_0x5cf3c3['id']}})[_0x0288('0x29')](function(){return _0x38f878;});})[_0x0288('0x29')](function(){_0x5825d0['status'](0xcc)[_0x0288('0x1d')]();});}};}function handleEntityNotFound(_0x356238,_0x31f2fa){return function(_0x51048b){if(!_0x51048b){_0x356238[_0x0288('0x1b')](0x194);}return _0x51048b;};}function handleError(_0x3c892b,_0x4633e4){_0x4633e4=_0x4633e4||0x1f4;return function(_0x194caf){logger[_0x0288('0x2a')](_0x194caf[_0x0288('0x2b')]);if(_0x194caf[_0x0288('0x2c')]){delete _0x194caf[_0x0288('0x2c')];}_0x3c892b[_0x0288('0x1c')](_0x4633e4)[_0x0288('0x2d')](_0x194caf);};}exports['index']=function(_0x2c1b42,_0x2527f1){var _0x300d7b={},_0x399a70={},_0x1e33df={'count':0x0,'rows':[]};var _0x47a234=_[_0x0288('0x2e')](db[_0x0288('0x2f')][_0x0288('0x30')],function(_0x16c8f5){return{'name':_0x16c8f5[_0x0288('0x31')],'type':_0x16c8f5['type'][_0x0288('0x32')]};});_0x399a70['model']=_[_0x0288('0x2e')](_0x47a234,'name');_0x399a70[_0x0288('0x33')]=_[_0x0288('0x34')](_0x2c1b42[_0x0288('0x33')]);_0x399a70[_0x0288('0x35')]=_[_0x0288('0x36')](_0x399a70[_0x0288('0x37')],_0x399a70[_0x0288('0x33')]);_0x300d7b[_0x0288('0x38')]=_[_0x0288('0x36')](_0x399a70[_0x0288('0x37')],qs[_0x0288('0x39')](_0x2c1b42[_0x0288('0x33')][_0x0288('0x39')]));_0x300d7b['attributes']=_0x300d7b['attributes'][_0x0288('0x3a')]?_0x300d7b[_0x0288('0x38')]:_0x399a70[_0x0288('0x37')];if(!_0x2c1b42['query'][_0x0288('0x3b')](_0x0288('0x3c'))){_0x300d7b[_0x0288('0x21')]=qs[_0x0288('0x21')](_0x2c1b42['query'][_0x0288('0x21')]);_0x300d7b[_0x0288('0x1f')]=qs[_0x0288('0x1f')](_0x2c1b42[_0x0288('0x33')][_0x0288('0x1f')]);}_0x300d7b[_0x0288('0x3d')]=qs[_0x0288('0x3e')](_0x2c1b42['query'][_0x0288('0x3e')]);_0x300d7b['where']=qs[_0x0288('0x35')](_['pick'](_0x2c1b42[_0x0288('0x33')],_0x399a70[_0x0288('0x35')]),_0x47a234);if(_0x2c1b42[_0x0288('0x33')][_0x0288('0x3f')]){_0x300d7b[_0x0288('0x40')]=_[_0x0288('0x41')](_0x300d7b[_0x0288('0x40')],{'$or':_[_0x0288('0x2e')](_0x47a234,function(_0x2a4ee1){if(_0x2a4ee1['type']!==_0x0288('0x42')){var _0x5686bd={};_0x5686bd[_0x2a4ee1[_0x0288('0x2c')]]={'$like':'%'+_0x2c1b42['query'][_0x0288('0x3f')]+'%'};return _0x5686bd;}})});}_0x300d7b=_[_0x0288('0x41')]({},_0x300d7b,_0x2c1b42[_0x0288('0x43')]);var _0x13b1f8={'where':_0x300d7b[_0x0288('0x40')]};return db[_0x0288('0x2f')][_0x0288('0x22')](_0x13b1f8)[_0x0288('0x29')](function(_0x32a047){_0x1e33df[_0x0288('0x22')]=_0x32a047;if(_0x2c1b42[_0x0288('0x33')][_0x0288('0x44')]){_0x300d7b[_0x0288('0x45')]=[{'all':!![]}];}return db[_0x0288('0x2f')][_0x0288('0x46')](_0x300d7b);})['then'](function(_0xad4976){_0x1e33df[_0x0288('0x47')]=_0xad4976;return _0x1e33df;})[_0x0288('0x29')](respondWithFilteredResult(_0x2527f1,_0x300d7b))['catch'](handleError(_0x2527f1,null));};exports['show']=function(_0x1fa671,_0x5d6024){var _0x109c26={'raw':![],'where':{'id':_0x1fa671[_0x0288('0x48')]['id']}},_0x10ca8a={};_0x10ca8a[_0x0288('0x37')]=_[_0x0288('0x34')](db[_0x0288('0x2f')]['rawAttributes']);_0x10ca8a[_0x0288('0x33')]=_['keys'](_0x1fa671[_0x0288('0x33')]);_0x10ca8a['filters']=_['intersection'](_0x10ca8a[_0x0288('0x37')],_0x10ca8a[_0x0288('0x33')]);_0x109c26[_0x0288('0x38')]=_[_0x0288('0x36')](_0x10ca8a['model'],qs['fields'](_0x1fa671[_0x0288('0x33')][_0x0288('0x39')]));_0x109c26[_0x0288('0x38')]=_0x109c26[_0x0288('0x38')][_0x0288('0x3a')]?_0x109c26[_0x0288('0x38')]:_0x10ca8a['model'];if(_0x1fa671[_0x0288('0x33')]['includeAll']){_0x109c26[_0x0288('0x45')]=[{'all':!![]}];}_0x109c26=_[_0x0288('0x41')]({},_0x109c26,_0x1fa671[_0x0288('0x43')]);return db[_0x0288('0x2f')]['find'](_0x109c26)['then'](handleEntityNotFound(_0x5d6024,null))[_0x0288('0x29')](respondWithResult(_0x5d6024,null))[_0x0288('0x49')](handleError(_0x5d6024,null));};exports[_0x0288('0x4a')]=function(_0x5d4422,_0x4dd2e9){return db[_0x0288('0x2f')][_0x0288('0x4a')](_0x5d4422[_0x0288('0x4b')],{})[_0x0288('0x29')](function(_0x6feffc){var _0x443218=_0x5d4422[_0x0288('0x4c')]['get']({'plain':!![]});if(!_0x443218)throw new Error(_0x0288('0x4d'));if(_0x443218[_0x0288('0x4e')]===_0x0288('0x4c')){var _0xde506=_0x6feffc['get']({'plain':!![]});var _0x52d0f1=_0x0288('0x4f');return db[_0x0288('0x50')][_0x0288('0x51')]({'where':{'name':_0x52d0f1,'userProfileId':_0x443218[_0x0288('0x52')]},'raw':!![]})[_0x0288('0x29')](function(_0x3741cb){if(_0x3741cb&&_0x3741cb[_0x0288('0x53')]===0x0){return db[_0x0288('0x54')]['create']({'name':_0xde506[_0x0288('0x2c')],'resourceId':_0xde506['id'],'type':_0x3741cb[_0x0288('0x2c')],'sectionId':_0x3741cb['id']},{})[_0x0288('0x29')](function(){return _0x6feffc;});}else{return _0x6feffc;}})[_0x0288('0x49')](function(_0x266b3f){logger[_0x0288('0x2a')](_0x0288('0x55'),_0x266b3f);throw _0x266b3f;});}return _0x6feffc;})[_0x0288('0x29')](respondWithResult(_0x4dd2e9,0xc9))[_0x0288('0x49')](handleError(_0x4dd2e9,null));};exports[_0x0288('0x27')]=function(_0x24a20e,_0x376086){if(_0x24a20e[_0x0288('0x4b')]['id']){delete _0x24a20e['body']['id'];}return db[_0x0288('0x2f')][_0x0288('0x51')]({'where':{'id':_0x24a20e[_0x0288('0x48')]['id']}})[_0x0288('0x29')](handleEntityNotFound(_0x376086,null))[_0x0288('0x29')](saveUpdates(_0x24a20e[_0x0288('0x4b')],null))['then'](respondWithResult(_0x376086,null))[_0x0288('0x49')](handleError(_0x376086,null));};exports[_0x0288('0x28')]=function(_0x11af72,_0x31d813){return db[_0x0288('0x2f')][_0x0288('0x51')]({'where':{'id':_0x11af72[_0x0288('0x48')]['id']}})['then'](handleEntityNotFound(_0x31d813,null))[_0x0288('0x29')](removeEntity(_0x31d813,null))[_0x0288('0x49')](handleError(_0x31d813,null));};exports[_0x0288('0x56')]=function(_0x2f5adf,_0x2842ff,_0x3b3c64){if(_0x2f5adf[_0x0288('0x4b')]['id']){delete _0x2f5adf[_0x0288('0x4b')]['id'];}return db[_0x0288('0x2f')][_0x0288('0x51')]({'where':{'id':_0x2f5adf[_0x0288('0x48')]['id']}})[_0x0288('0x29')](handleEntityNotFound(_0x2842ff,null))[_0x0288('0x29')](function(_0x5f3767){if(_0x5f3767){_0x2f5adf[_0x0288('0x4b')][_0x0288('0x57')]=_0x5f3767['id'];return db[_0x0288('0x58')][_0x0288('0x4a')](_0x2f5adf['body']);}})['then'](respondWithResult(_0x2842ff,null))[_0x0288('0x49')](handleError(_0x2842ff,null));};exports[_0x0288('0x59')]=function(_0x347b6a,_0x493b4e,_0x3adf5d){if(_0x347b6a[_0x0288('0x4b')]['id']){delete _0x347b6a[_0x0288('0x4b')]['id'];}return db[_0x0288('0x2f')][_0x0288('0x51')]({'where':{'id':_0x347b6a[_0x0288('0x48')]['id']}})['then'](handleEntityNotFound(_0x493b4e,null))[_0x0288('0x29')](function(_0x59e66e){if(_0x59e66e){_0x347b6a['body']['TriggerAnyId']=_0x59e66e['id'];return db[_0x0288('0x58')]['create'](_0x347b6a[_0x0288('0x4b')]);}})[_0x0288('0x29')](respondWithResult(_0x493b4e,null))[_0x0288('0x49')](handleError(_0x493b4e,null));};exports['getAllConditions']=function(_0x20f2b9,_0x46c0e6,_0xe0a135){var _0xd763fa={};var _0x14ff31={};var _0x450cbc;var _0x2e3250;return db['Trigger'][_0x0288('0x5a')]({'where':{'id':_0x20f2b9[_0x0288('0x48')]['id']}})[_0x0288('0x29')](handleEntityNotFound(_0x46c0e6,null))['then'](function(_0xff6842){if(_0xff6842){_0x450cbc=_0xff6842;_0x14ff31[_0x0288('0x37')]=_[_0x0288('0x34')](db['Condition']['rawAttributes']);_0x14ff31[_0x0288('0x33')]=_[_0x0288('0x34')](_0x20f2b9[_0x0288('0x33')]);_0x14ff31[_0x0288('0x35')]=_[_0x0288('0x36')](_0x14ff31[_0x0288('0x37')],_0x14ff31[_0x0288('0x33')]);_0xd763fa['attributes']=_[_0x0288('0x36')](_0x14ff31[_0x0288('0x37')],qs[_0x0288('0x39')](_0x20f2b9[_0x0288('0x33')][_0x0288('0x39')]));_0xd763fa[_0x0288('0x38')]=_0xd763fa[_0x0288('0x38')][_0x0288('0x3a')]?_0xd763fa[_0x0288('0x38')]:_0x14ff31[_0x0288('0x37')];_0xd763fa[_0x0288('0x3d')]=qs[_0x0288('0x3e')](_0x20f2b9['query'][_0x0288('0x3e')]);_0xd763fa[_0x0288('0x40')]=qs[_0x0288('0x35')](_[_0x0288('0x5b')](_0x20f2b9['query'],_0x14ff31[_0x0288('0x35')]));if(_0x20f2b9['query']['filter']){_0xd763fa['where']=_[_0x0288('0x41')](_0xd763fa[_0x0288('0x40')],{'$or':_[_0x0288('0x2e')](_0xd763fa[_0x0288('0x38')],function(_0x34bb46){var _0x445f50={};_0x445f50[_0x34bb46]={'$like':'%'+_0x20f2b9[_0x0288('0x33')]['filter']+'%'};return _0x445f50;})});}_0xd763fa=_['merge']({},_0xd763fa,_0x20f2b9['options']);return _0x450cbc[_0x0288('0x5c')](_0xd763fa);}})[_0x0288('0x29')](function(_0x5fa318){if(_0x5fa318){_0x2e3250=_0x5fa318['length'];if(!_0x20f2b9['query']['hasOwnProperty'](_0x0288('0x3c'))){_0xd763fa[_0x0288('0x21')]=qs[_0x0288('0x21')](_0x20f2b9[_0x0288('0x33')][_0x0288('0x21')]);_0xd763fa[_0x0288('0x1f')]=qs[_0x0288('0x1f')](_0x20f2b9[_0x0288('0x33')]['offset']);}return _0x450cbc[_0x0288('0x5c')](_0xd763fa);}})[_0x0288('0x29')](function(_0x1c3e57){if(_0x1c3e57){return _0x1c3e57?{'count':_0x2e3250,'rows':_0x1c3e57}:null;}})['then'](respondWithResult(_0x46c0e6,null))[_0x0288('0x49')](handleError(_0x46c0e6,null));};exports[_0x0288('0x5d')]=function(_0x1c41e2,_0x37fa3f,_0x1f4753){var _0x5e0216={};var _0x2eb726={};var _0x22e546;var _0x4c7b94;return db[_0x0288('0x2f')][_0x0288('0x5a')]({'where':{'id':_0x1c41e2[_0x0288('0x48')]['id']}})['then'](handleEntityNotFound(_0x37fa3f,null))[_0x0288('0x29')](function(_0x46c97e){if(_0x46c97e){_0x22e546=_0x46c97e;_0x2eb726[_0x0288('0x37')]=_[_0x0288('0x34')](db[_0x0288('0x58')][_0x0288('0x30')]);_0x2eb726[_0x0288('0x33')]=_[_0x0288('0x34')](_0x1c41e2[_0x0288('0x33')]);_0x2eb726[_0x0288('0x35')]=_['intersection'](_0x2eb726[_0x0288('0x37')],_0x2eb726['query']);_0x5e0216['attributes']=_[_0x0288('0x36')](_0x2eb726[_0x0288('0x37')],qs[_0x0288('0x39')](_0x1c41e2[_0x0288('0x33')]['fields']));_0x5e0216[_0x0288('0x38')]=_0x5e0216[_0x0288('0x38')][_0x0288('0x3a')]?_0x5e0216[_0x0288('0x38')]:_0x2eb726[_0x0288('0x37')];_0x5e0216[_0x0288('0x3d')]=qs['sort'](_0x1c41e2['query'][_0x0288('0x3e')]);_0x5e0216[_0x0288('0x40')]=qs['filters'](_[_0x0288('0x5b')](_0x1c41e2[_0x0288('0x33')],_0x2eb726[_0x0288('0x35')]));if(_0x1c41e2['query'][_0x0288('0x3f')]){_0x5e0216[_0x0288('0x40')]=_[_0x0288('0x41')](_0x5e0216[_0x0288('0x40')],{'$or':_[_0x0288('0x2e')](_0x5e0216[_0x0288('0x38')],function(_0x5c3ca8){var _0x5c1915={};_0x5c1915[_0x5c3ca8]={'$like':'%'+_0x1c41e2['query'][_0x0288('0x3f')]+'%'};return _0x5c1915;})});}_0x5e0216=_[_0x0288('0x41')]({},_0x5e0216,_0x1c41e2[_0x0288('0x43')]);return _0x22e546[_0x0288('0x5d')](_0x5e0216);}})['then'](function(_0x52993e){if(_0x52993e){_0x4c7b94=_0x52993e[_0x0288('0x3a')];if(!_0x1c41e2[_0x0288('0x33')][_0x0288('0x3b')](_0x0288('0x3c'))){_0x5e0216[_0x0288('0x21')]=qs[_0x0288('0x21')](_0x1c41e2['query'][_0x0288('0x21')]);_0x5e0216[_0x0288('0x1f')]=qs[_0x0288('0x1f')](_0x1c41e2[_0x0288('0x33')]['offset']);}return _0x22e546[_0x0288('0x5d')](_0x5e0216);}})[_0x0288('0x29')](function(_0x213c22){if(_0x213c22){return _0x213c22?{'count':_0x4c7b94,'rows':_0x213c22}:null;}})[_0x0288('0x29')](respondWithResult(_0x37fa3f,null))[_0x0288('0x49')](handleError(_0x37fa3f,null));};exports[_0x0288('0x5e')]=function(_0x1c76ae,_0x95c657,_0x34f6f7){if(_0x1c76ae[_0x0288('0x4b')]['id']){delete _0x1c76ae[_0x0288('0x4b')]['id'];}return db[_0x0288('0x2f')][_0x0288('0x51')]({'where':{'id':_0x1c76ae[_0x0288('0x48')]['id']}})[_0x0288('0x29')](handleEntityNotFound(_0x95c657,null))['then'](function(_0x1a4f58){if(_0x1a4f58){_0x1c76ae[_0x0288('0x4b')][_0x0288('0x5f')]=_0x1a4f58['id'];return db['Action'][_0x0288('0x4a')](_0x1c76ae['body']);}})[_0x0288('0x29')](respondWithResult(_0x95c657,null))['catch'](handleError(_0x95c657,null));};exports['getActions']=function(_0x1228b9,_0x5334fb,_0x36ce29){var _0x1f3b9e={};var _0xf846c4={};var _0x868992;var _0x199cc3;return db[_0x0288('0x2f')][_0x0288('0x5a')]({'where':{'id':_0x1228b9[_0x0288('0x48')]['id']}})[_0x0288('0x29')](handleEntityNotFound(_0x5334fb,null))[_0x0288('0x29')](function(_0x18941d){if(_0x18941d){_0x868992=_0x18941d;_0xf846c4[_0x0288('0x37')]=_[_0x0288('0x34')](db[_0x0288('0x60')][_0x0288('0x30')]);_0xf846c4[_0x0288('0x33')]=_[_0x0288('0x34')](_0x1228b9[_0x0288('0x33')]);_0xf846c4[_0x0288('0x35')]=_['intersection'](_0xf846c4[_0x0288('0x37')],_0xf846c4['query']);_0x1f3b9e[_0x0288('0x38')]=_[_0x0288('0x36')](_0xf846c4[_0x0288('0x37')],qs['fields'](_0x1228b9[_0x0288('0x33')]['fields']));_0x1f3b9e[_0x0288('0x38')]=_0x1f3b9e[_0x0288('0x38')][_0x0288('0x3a')]?_0x1f3b9e['attributes']:_0xf846c4[_0x0288('0x37')];_0x1f3b9e[_0x0288('0x3d')]=qs['sort'](_0x1228b9[_0x0288('0x33')][_0x0288('0x3e')]);_0x1f3b9e[_0x0288('0x40')]=qs[_0x0288('0x35')](_[_0x0288('0x5b')](_0x1228b9[_0x0288('0x33')],_0xf846c4[_0x0288('0x35')]));if(_0x1228b9['query'][_0x0288('0x3f')]){_0x1f3b9e[_0x0288('0x40')]=_[_0x0288('0x41')](_0x1f3b9e['where'],{'$or':_[_0x0288('0x2e')](_0x1f3b9e[_0x0288('0x38')],function(_0x406a74){var _0x3d09aa={};_0x3d09aa[_0x406a74]={'$like':'%'+_0x1228b9[_0x0288('0x33')]['filter']+'%'};return _0x3d09aa;})});}_0x1f3b9e=_['merge']({},_0x1f3b9e,_0x1228b9[_0x0288('0x43')]);return _0x868992[_0x0288('0x61')](_0x1f3b9e);}})[_0x0288('0x29')](function(_0x17f2b2){if(_0x17f2b2){_0x199cc3=_0x17f2b2[_0x0288('0x3a')];if(!_0x1228b9[_0x0288('0x33')][_0x0288('0x3b')](_0x0288('0x3c'))){_0x1f3b9e[_0x0288('0x21')]=qs[_0x0288('0x21')](_0x1228b9[_0x0288('0x33')]['limit']);_0x1f3b9e[_0x0288('0x1f')]=qs[_0x0288('0x1f')](_0x1228b9[_0x0288('0x33')]['offset']);}return _0x868992['getActions'](_0x1f3b9e);}})[_0x0288('0x29')](function(_0x122a55){if(_0x122a55){return _0x122a55?{'count':_0x199cc3,'rows':_0x122a55}:null;}})[_0x0288('0x29')](respondWithResult(_0x5334fb,null))[_0x0288('0x49')](handleError(_0x5334fb,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 9791883..0db7d6f 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 _0x79a8=['define','Trigger','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x104697,_0x1786eb){var _0x50a8bc=function(_0x3a276e){while(--_0x3a276e){_0x104697['push'](_0x104697['shift']());}};_0x50a8bc(++_0x1786eb);}(_0x79a8,0x1d0));var _0x879a=function(_0xe111b0,_0x33b1cb){_0xe111b0=_0xe111b0-0x0;var _0x370295=_0x79a8[_0xe111b0];return _0x370295;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require(_0x879a('0x7'));module[_0x879a('0x8')]=function(_0x1808f1,_0x3cb89c){return _0x1808f1[_0x879a('0x9')](_0x879a('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97d5=['rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3cfb97,_0x52372a){var _0x43dc2d=function(_0x2940b8){while(--_0x2940b8){_0x3cfb97['push'](_0x3cfb97['shift']());}};_0x43dc2d(++_0x52372a);}(_0x97d5,0x199));var _0x597d=function(_0xb8eac,_0x576343){_0xb8eac=_0xb8eac-0x0;var _0x920f0=_0x97d5[_0xb8eac];return _0x920f0;};'use strict';var _=require(_0x597d('0x0'));var util=require(_0x597d('0x1'));var logger=require(_0x597d('0x2'))(_0x597d('0x3'));var moment=require(_0x597d('0x4'));var BPromise=require(_0x597d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x597d('0x6'));var rimraf=require(_0x597d('0x7'));var config=require(_0x597d('0x8'));var attributes=require('./trigger.attributes');module[_0x597d('0x9')]=function(_0x2bafef,_0x2a6640){return _0x2bafef[_0x597d('0xa')](_0x597d('0xb'),attributes,{'tableName':_0x597d('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 1838fee..7d4b726 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 _0x5ec3=['attributes','map','ShowTrigger','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrigger','findAll','options','raw','where','limit','include','model'];(function(_0x5a2fba,_0x25b9d9){var _0xfb0b78=function(_0x40155c){while(--_0x40155c){_0x5a2fba['push'](_0x5a2fba['shift']());}};_0xfb0b78(++_0x25b9d9);}(_0x5ec3,0xf2));var _0x35ec=function(_0x2b921e,_0x2d4b00){_0x2b921e=_0x2b921e-0x0;var _0x41a642=_0x5ec3[_0x2b921e];return _0x41a642;};'use strict';var _=require(_0x35ec('0x0'));var util=require('util');var moment=require(_0x35ec('0x1'));var BPromise=require(_0x35ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ec('0x3'));var db=require(_0x35ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ec('0x5'))(_0x35ec('0x6'));var config=require(_0x35ec('0x7'));var jayson=require(_0x35ec('0x8'));var client=jayson[_0x35ec('0x9')][_0x35ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc6c653,_0x13b8a1,_0x40528f){return new BPromise(function(_0x4dacf4,_0x1659d0){return client[_0x35ec('0xb')](_0xc6c653,_0x40528f)[_0x35ec('0xc')](function(_0x166fb6){logger['info'](_0x35ec('0xd'),_0x13b8a1,_0x35ec('0xe'));logger['debug'](_0x35ec('0xf'),_0x13b8a1,_0x35ec('0xe'),JSON[_0x35ec('0x10')](_0x166fb6));if(_0x166fb6[_0x35ec('0x11')]){if(_0x166fb6[_0x35ec('0x11')]['code']===0x1f4){logger[_0x35ec('0x11')]('Trigger,\x20%s,\x20%s',_0x13b8a1,_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);return _0x1659d0(_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);}logger[_0x35ec('0x11')](_0x35ec('0xd'),_0x13b8a1,_0x166fb6['error']['message']);return _0x4dacf4(_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);}else{logger[_0x35ec('0x13')](_0x35ec('0xd'),_0x13b8a1,'request\x20sent');_0x4dacf4(_0x166fb6[_0x35ec('0x14')][_0x35ec('0x12')]);}})[_0x35ec('0x15')](function(_0x588f50){logger[_0x35ec('0x11')]('Trigger,\x20%s,\x20%s',_0x13b8a1,_0x588f50);_0x1659d0(_0x588f50);});});}exports[_0x35ec('0x16')]=function(_0x1f4ccf){var _0x4e50a9=this;return new Promise(function(_0x2ba6fc,_0x18e6d3){return db['Trigger'][_0x35ec('0x17')]({'raw':_0x1f4ccf[_0x35ec('0x18')]?_0x1f4ccf[_0x35ec('0x18')][_0x35ec('0x19')]===undefined?!![]:![]:!![],'where':_0x1f4ccf[_0x35ec('0x18')]?_0x1f4ccf[_0x35ec('0x18')][_0x35ec('0x1a')]||null:null,'attributes':_0x1f4ccf[_0x35ec('0x18')]?_0x1f4ccf[_0x35ec('0x18')]['attributes']||null:null,'limit':_0x1f4ccf[_0x35ec('0x18')]?_0x1f4ccf[_0x35ec('0x18')][_0x35ec('0x1b')]||null:null,'include':_0x1f4ccf[_0x35ec('0x18')]?_0x1f4ccf[_0x35ec('0x18')][_0x35ec('0x1c')]?_['map'](_0x1f4ccf['options']['include'],function(_0x57babe){return{'model':db[_0x57babe[_0x35ec('0x1d')]],'as':_0x57babe['as'],'attributes':_0x57babe[_0x35ec('0x1e')],'include':_0x57babe[_0x35ec('0x1c')]?_['map'](_0x57babe[_0x35ec('0x1c')],function(_0x2b6cc2){return{'model':db[_0x2b6cc2[_0x35ec('0x1d')]],'as':_0x2b6cc2['as'],'attributes':_0x2b6cc2[_0x35ec('0x1e')],'include':_0x2b6cc2[_0x35ec('0x1c')]?_[_0x35ec('0x1f')](_0x2b6cc2[_0x35ec('0x1c')],function(_0x558747){return{'model':db[_0x558747[_0x35ec('0x1d')]],'as':_0x558747['as'],'attributes':_0x558747[_0x35ec('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x311932){logger[_0x35ec('0x13')](_0x35ec('0x16'),_0x1f4ccf);logger['debug'](_0x35ec('0x16'),_0x1f4ccf,JSON[_0x35ec('0x10')](_0x311932));_0x2ba6fc(_0x311932);})[_0x35ec('0x15')](function(_0x349878){logger[_0x35ec('0x11')](_0x35ec('0x16'),_0x349878[_0x35ec('0x12')],_0x1f4ccf);_0x18e6d3(_0x4e50a9[_0x35ec('0x11')](0x1f4,_0x349878['message']));});});};exports[_0x35ec('0x20')]=function(_0x3e6319){var _0xd017e6=this;return new Promise(function(_0x33b7e7,_0x12b487){return db['Trigger'][_0x35ec('0x21')]({'raw':_0x3e6319[_0x35ec('0x18')]?_0x3e6319[_0x35ec('0x18')][_0x35ec('0x19')]===undefined?!![]:![]:!![],'where':_0x3e6319[_0x35ec('0x18')]?_0x3e6319[_0x35ec('0x18')][_0x35ec('0x1a')]||null:null,'attributes':_0x3e6319[_0x35ec('0x18')]?_0x3e6319['options'][_0x35ec('0x1e')]||null:null,'include':_0x3e6319['options']?_0x3e6319['options'][_0x35ec('0x1c')]?_[_0x35ec('0x1f')](_0x3e6319['options'][_0x35ec('0x1c')],function(_0x1f1f73){return{'model':db[_0x1f1f73[_0x35ec('0x1d')]],'as':_0x1f1f73['as'],'attributes':_0x1f1f73[_0x35ec('0x1e')],'include':_0x1f1f73[_0x35ec('0x1c')]?_[_0x35ec('0x1f')](_0x1f1f73[_0x35ec('0x1c')],function(_0x62cb1d){return{'model':db[_0x62cb1d[_0x35ec('0x1d')]],'as':_0x62cb1d['as'],'attributes':_0x62cb1d[_0x35ec('0x1e')],'include':_0x62cb1d[_0x35ec('0x1c')]?_[_0x35ec('0x1f')](_0x62cb1d['include'],function(_0xab3cf9){return{'model':db[_0xab3cf9[_0x35ec('0x1d')]],'as':_0xab3cf9['as'],'attributes':_0xab3cf9[_0x35ec('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35ec('0xc')](function(_0x5de5eb){logger[_0x35ec('0x13')](_0x35ec('0x20'),_0x3e6319);logger['debug']('ShowTrigger',_0x3e6319,JSON[_0x35ec('0x10')](_0x5de5eb));_0x33b7e7(_0x5de5eb);})['catch'](function(_0x2c6d9b){logger['error'](_0x35ec('0x20'),_0x2c6d9b[_0x35ec('0x12')],_0x3e6319);_0x12b487(_0xd017e6['error'](0x1f4,_0x2c6d9b[_0x35ec('0x12')]));});});}; \ No newline at end of file +var _0x3132=['GetTrigger','Trigger','findAll','options','raw','where','include','map','model','attributes','find','ShowTrigger','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trigger,\x20%s,\x20%s','result'];(function(_0x3b58d0,_0x52f2f9){var _0x1ecd43=function(_0x48d458){while(--_0x48d458){_0x3b58d0['push'](_0x3b58d0['shift']());}};_0x1ecd43(++_0x52f2f9);}(_0x3132,0x7f));var _0x2313=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x3132[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x2313('0x0'));var util=require(_0x2313('0x1'));var moment=require('moment');var BPromise=require(_0x2313('0x2'));var rs=require(_0x2313('0x3'));var fs=require('fs');var Redis=require(_0x2313('0x4'));var db=require(_0x2313('0x5'))['db'];var utils=require(_0x2313('0x6'));var logger=require(_0x2313('0x7'))(_0x2313('0x8'));var config=require(_0x2313('0x9'));var jayson=require(_0x2313('0xa'));var client=jayson[_0x2313('0xb')][_0x2313('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53dc37,_0x175f23,_0xb8bbea){return new BPromise(function(_0x2fb7c8,_0xe7aa48){return client[_0x2313('0xd')](_0x53dc37,_0xb8bbea)[_0x2313('0xe')](function(_0x8c636){logger[_0x2313('0xf')]('Trigger,\x20%s,\x20%s',_0x175f23,'request\x20sent');logger[_0x2313('0x10')](_0x2313('0x11'),_0x175f23,_0x2313('0x12'),JSON[_0x2313('0x13')](_0x8c636));if(_0x8c636[_0x2313('0x14')]){if(_0x8c636[_0x2313('0x14')][_0x2313('0x15')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x175f23,_0x8c636[_0x2313('0x14')][_0x2313('0x16')]);return _0xe7aa48(_0x8c636['error'][_0x2313('0x16')]);}logger[_0x2313('0x14')](_0x2313('0x17'),_0x175f23,_0x8c636[_0x2313('0x14')][_0x2313('0x16')]);return _0x2fb7c8(_0x8c636[_0x2313('0x14')][_0x2313('0x16')]);}else{logger[_0x2313('0xf')]('Trigger,\x20%s,\x20%s',_0x175f23,_0x2313('0x12'));_0x2fb7c8(_0x8c636[_0x2313('0x18')][_0x2313('0x16')]);}})['catch'](function(_0x41e7c6){logger[_0x2313('0x14')]('Trigger,\x20%s,\x20%s',_0x175f23,_0x41e7c6);_0xe7aa48(_0x41e7c6);});});}exports[_0x2313('0x19')]=function(_0x39db1b){var _0x5cbf9c=this;return new Promise(function(_0x3f5a73,_0x181b35){return db[_0x2313('0x1a')][_0x2313('0x1b')]({'raw':_0x39db1b[_0x2313('0x1c')]?_0x39db1b['options'][_0x2313('0x1d')]===undefined?!![]:![]:!![],'where':_0x39db1b[_0x2313('0x1c')]?_0x39db1b['options'][_0x2313('0x1e')]||null:null,'attributes':_0x39db1b['options']?_0x39db1b[_0x2313('0x1c')]['attributes']||null:null,'limit':_0x39db1b[_0x2313('0x1c')]?_0x39db1b[_0x2313('0x1c')]['limit']||null:null,'include':_0x39db1b['options']?_0x39db1b['options'][_0x2313('0x1f')]?_[_0x2313('0x20')](_0x39db1b[_0x2313('0x1c')]['include'],function(_0x50a82a){return{'model':db[_0x50a82a[_0x2313('0x21')]],'as':_0x50a82a['as'],'attributes':_0x50a82a['attributes'],'include':_0x50a82a[_0x2313('0x1f')]?_[_0x2313('0x20')](_0x50a82a[_0x2313('0x1f')],function(_0x4a6566){return{'model':db[_0x4a6566['model']],'as':_0x4a6566['as'],'attributes':_0x4a6566[_0x2313('0x22')],'include':_0x4a6566['include']?_[_0x2313('0x20')](_0x4a6566[_0x2313('0x1f')],function(_0x1d134d){return{'model':db[_0x1d134d[_0x2313('0x21')]],'as':_0x1d134d['as'],'attributes':_0x1d134d[_0x2313('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2313('0xe')](function(_0x32b0e6){logger[_0x2313('0xf')]('GetTrigger',_0x39db1b);logger[_0x2313('0x10')](_0x2313('0x19'),_0x39db1b,JSON[_0x2313('0x13')](_0x32b0e6));_0x3f5a73(_0x32b0e6);})['catch'](function(_0x432931){logger[_0x2313('0x14')](_0x2313('0x19'),_0x432931[_0x2313('0x16')],_0x39db1b);_0x181b35(_0x5cbf9c[_0x2313('0x14')](0x1f4,_0x432931[_0x2313('0x16')]));});});};exports['ShowTrigger']=function(_0x572257){var _0x576935=this;return new Promise(function(_0x21746a,_0xe6ee59){return db[_0x2313('0x1a')][_0x2313('0x23')]({'raw':_0x572257[_0x2313('0x1c')]?_0x572257[_0x2313('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x572257[_0x2313('0x1c')]?_0x572257['options'][_0x2313('0x1e')]||null:null,'attributes':_0x572257[_0x2313('0x1c')]?_0x572257[_0x2313('0x1c')][_0x2313('0x22')]||null:null,'include':_0x572257['options']?_0x572257['options'][_0x2313('0x1f')]?_[_0x2313('0x20')](_0x572257[_0x2313('0x1c')][_0x2313('0x1f')],function(_0x3bff88){return{'model':db[_0x3bff88[_0x2313('0x21')]],'as':_0x3bff88['as'],'attributes':_0x3bff88[_0x2313('0x22')],'include':_0x3bff88[_0x2313('0x1f')]?_['map'](_0x3bff88[_0x2313('0x1f')],function(_0x4eedf3){return{'model':db[_0x4eedf3[_0x2313('0x21')]],'as':_0x4eedf3['as'],'attributes':_0x4eedf3[_0x2313('0x22')],'include':_0x4eedf3[_0x2313('0x1f')]?_['map'](_0x4eedf3[_0x2313('0x1f')],function(_0x40384d){return{'model':db[_0x40384d[_0x2313('0x21')]],'as':_0x40384d['as'],'attributes':_0x40384d[_0x2313('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2313('0xe')](function(_0x26f36f){logger[_0x2313('0xf')](_0x2313('0x24'),_0x572257);logger[_0x2313('0x10')](_0x2313('0x24'),_0x572257,JSON[_0x2313('0x13')](_0x26f36f));_0x21746a(_0x26f36f);})[_0x2313('0x25')](function(_0x49ca39){logger[_0x2313('0x14')](_0x2313('0x24'),_0x49ca39[_0x2313('0x16')],_0x572257);_0xe6ee59(_0x576935[_0x2313('0x14')](0x1f4,_0x49ca39[_0x2313('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 1709887..bc09876 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 _0x38c9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x46e9e2,_0x1ae6bd){var _0xe5c755=function(_0x515e3a){while(--_0x515e3a){_0x46e9e2['push'](_0x46e9e2['shift']());}};_0xe5c755(++_0x1ae6bd);}(_0x38c9,0x1de));var _0x938c=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x38c9[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var path=require(_0x938c('0x2'));var timeout=require(_0x938c('0x3'));var express=require(_0x938c('0x4'));var router=express[_0x938c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x938c('0x6'));var interaction=require(_0x938c('0x7'));var config=require(_0x938c('0x8'));var controller=require(_0x938c('0x9'));router[_0x938c('0xa')]('/',auth[_0x938c('0xb')](),controller['index']);router[_0x938c('0xa')](_0x938c('0xc'),auth['isAuthenticated'](),controller[_0x938c('0xd')]);router[_0x938c('0xe')](_0x938c('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x938c('0xe')]('/',auth[_0x938c('0xb')](),controller[_0x938c('0x10')]);router[_0x938c('0x11')](_0x938c('0xc'),auth[_0x938c('0xb')](),controller[_0x938c('0x12')]);router[_0x938c('0x13')](_0x938c('0xc'),auth[_0x938c('0xb')](),controller[_0x938c('0x14')]);module[_0x938c('0x15')]=router; \ No newline at end of file +var _0xa8ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','create','update','delete','destroy','exports','util','path','express','Router'];(function(_0x4a3187,_0x155952){var _0x3ac45=function(_0x587bc5){while(--_0x587bc5){_0x4a3187['push'](_0x4a3187['shift']());}};_0x3ac45(++_0x155952);}(_0xa8ed,0x8f));var _0xda8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8ed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xda8e('0x0'));var path=require(_0xda8e('0x1'));var timeout=require('connect-timeout');var express=require(_0xda8e('0x2'));var router=express[_0xda8e('0x3')]();var fs_extra=require(_0xda8e('0x4'));var auth=require(_0xda8e('0x5'));var interaction=require(_0xda8e('0x6'));var config=require(_0xda8e('0x7'));var controller=require(_0xda8e('0x8'));router[_0xda8e('0x9')]('/',auth[_0xda8e('0xa')](),controller[_0xda8e('0xb')]);router[_0xda8e('0x9')](_0xda8e('0xc'),auth[_0xda8e('0xa')](),controller[_0xda8e('0xd')]);router['post'](_0xda8e('0xe'),auth['isAuthenticated'](),controller[_0xda8e('0xf')]);router['post']('/',auth[_0xda8e('0xa')](),controller[_0xda8e('0x10')]);router['put'](_0xda8e('0xc'),auth[_0xda8e('0xa')](),controller[_0xda8e('0x11')]);router[_0xda8e('0x12')](_0xda8e('0xc'),auth[_0xda8e('0xa')](),controller[_0xda8e('0x13')]);module[_0xda8e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index adec2a4..9b3e600 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 _0xf86a=['active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','refuse','originate','uac','uas','certificate'];(function(_0x1e4c37,_0xdf253e){var _0xec3469=function(_0x169c0e){while(--_0x169c0e){_0x1e4c37['push'](_0x1e4c37['shift']());}};_0xec3469(++_0xdf253e);}(_0xf86a,0x18f));var _0xaf86=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf86a[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaf86('0x0')],'allowNull':![],'unique':_0xaf86('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x3'),_0xaf86('0x4'),'peer'),'allowNull':![],'defaultValue':_0xaf86('0x3')},'context':{'type':Sequelize[_0xaf86('0x0')],'allowNull':![],'defaultValue':_0xaf86('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xaf86('0x6'),'ALLOWED_PASSED_SCREEN',_0xaf86('0x7'),_0xaf86('0x8'),_0xaf86('0x9'),_0xaf86('0xa'),_0xaf86('0xb'),_0xaf86('0xc'))},'deny':{'type':Sequelize[_0xaf86('0x0')]},'permit':{'type':Sequelize[_0xaf86('0x0')]},'secret':{'type':Sequelize[_0xaf86('0x0')]},'md5secret':{'type':Sequelize[_0xaf86('0x0')]},'remotesecret':{'type':Sequelize[_0xaf86('0x0')]},'transport':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':_0xaf86('0xd'),'set':function(_0x1399a3){this[_0xaf86('0xe')](_0xaf86('0xf'),_0x1399a3?_0x1399a3[_0xaf86('0x10')](','):null);},'get':function(){return this[_0xaf86('0x11')](_0xaf86('0xf'))?this[_0xaf86('0x11')](_0xaf86('0xf'))[_0xaf86('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x13'),_0xaf86('0x14'),_0xaf86('0x15'),'inband',_0xaf86('0x16')),'defaultValue':_0xaf86('0x13')},'directmedia':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no','nonat',_0xaf86('0x18'),_0xaf86('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xaf86('0x0')]},'directmediadeny':{'type':Sequelize[_0xaf86('0x0')]},'nat':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':_0xaf86('0x1a'),'set':function(_0x4f9f7a){this[_0xaf86('0xe')](_0xaf86('0x1b'),_0x4f9f7a?_0x4f9f7a[_0xaf86('0x10')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xaf86('0x11')](_0xaf86('0x1b'))[_0xaf86('0x12')](','):null;},'comment':_0xaf86('0x1c')},'callgroup':{'type':Sequelize[_0xaf86('0x0')]},'namedcallgroup':{'type':Sequelize[_0xaf86('0x0')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xaf86('0x0')]},'language':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaf86('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xaf86('0x0')],'allowNull':![],'defaultValue':_0xaf86('0x1d'),'set':function(_0x200664){this[_0xaf86('0xe')]('allow',_0x200664?_0x200664[_0xaf86('0x10')](';'):_0xaf86('0x1d'));},'get':function(){return this[_0xaf86('0x11')]('allow')?this[_0xaf86('0x11')](_0xaf86('0x1e'))[_0xaf86('0x12')](';'):null;},'comment':_0xaf86('0x1f')},'autoframing':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'insecure':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':_0xaf86('0x20'),'set':function(_0x59c563){this['setDataValue']('insecure',_0x59c563?_0x59c563[_0xaf86('0x10')](','):null);},'get':function(){return this[_0xaf86('0x11')](_0xaf86('0x21'))?this[_0xaf86('0x11')](_0xaf86('0x21'))[_0xaf86('0x12')](','):null;},'comment':_0xaf86('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0xaf86('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xaf86('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xaf86('0x2')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0xaf86('0x2')]('yes','no')},'useclientcode':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'accountcode':{'type':Sequelize[_0xaf86('0x23')](0xb)},'setvar':{'type':Sequelize[_0xaf86('0x0')]},'callerid':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':_0xaf86('0x24')},'amaflags':{'type':Sequelize[_0xaf86('0x0')]},'callcounter':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xaf86('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xaf86('0x2')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xaf86('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xaf86('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xaf86('0x0')]},'template':{'type':Sequelize[_0xaf86('0x0')]},'videosupport':{'type':Sequelize[_0xaf86('0x2')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'mailbox':{'type':Sequelize[_0xaf86('0x0')]},'session_timers':{'type':Sequelize[_0xaf86('0x2')]('accept',_0xaf86('0x25'),_0xaf86('0x26'))},'session_expires':{'type':Sequelize[_0xaf86('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xaf86('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x27'),_0xaf86('0x28')),'defaultValue':_0xaf86('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xaf86('0x0')]},'fromdomain':{'type':Sequelize[_0xaf86('0x0')]},'fromuser':{'type':Sequelize[_0xaf86('0x0')]},'port':{'type':Sequelize[_0xaf86('0x23')](0x5)},'qualify':{'type':Sequelize[_0xaf86('0x2')]('yes','no'),'defaultValue':_0xaf86('0x17')},'keepalive':{'type':Sequelize[_0xaf86('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xaf86('0x0')]},'defaultuser':{'type':Sequelize[_0xaf86('0x0')]},'rtptimeout':{'type':Sequelize[_0xaf86('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xaf86('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaf86('0x0')]},'callbackextension':{'type':Sequelize[_0xaf86('0x0')]},'timert1':{'type':Sequelize[_0xaf86('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xaf86('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xaf86('0x0')]},'contactdeny':{'type':Sequelize[_0xaf86('0x0')]},'contactacl':{'type':Sequelize[_0xaf86('0x0')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xaf86('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xaf86('0x17'),'no')},'force_avp':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'icesupport':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xaf86('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0xaf86('0x29'))},'dtlsrekey':{'type':Sequelize[_0xaf86('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xaf86('0x0')]},'dtlsprivatekey':{'type':Sequelize[_0xaf86('0x0')]},'dtlscipher':{'type':Sequelize[_0xaf86('0x0')]},'dtlscafile':{'type':Sequelize[_0xaf86('0x0')]},'dtlscapath':{'type':Sequelize[_0xaf86('0x0')]},'dtlssetup':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x2a'),_0xaf86('0x2b'),_0xaf86('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xaf86('0x0')]},'call_limit':{'type':Sequelize[_0xaf86('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xaf86('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0xaf86('0x0')]},'mohinterpret':{'type':Sequelize[_0xaf86('0x0')]},'mohsuggest':{'type':Sequelize[_0xaf86('0x0')]},'parkinglot':{'type':Sequelize[_0xaf86('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xaf86('0x2d')},'canreinvite':{'type':Sequelize[_0xaf86('0x2')](_0xaf86('0x17'),'no',_0xaf86('0x2e'),_0xaf86('0x18'),_0xaf86('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xaf86('0x0')]},'otherFields':{'type':Sequelize[_0xaf86('0x0')]},'active':{'type':Sequelize[_0xaf86('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xaf86('0x0')],'defaultValue':'no'}}; \ No newline at end of file +var _0xa801=['info','shortinfo','inband','auto','nonat','update','yes','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','active','passive','actpass','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0xa801,0x86));var _0x1a80=function(_0x351dc3,_0x477f29){_0x351dc3=_0x351dc3-0x0;var _0x273a5b=_0xa801[_0x351dc3];return _0x273a5b;};'use strict';var Sequelize=require(_0x1a80('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a80('0x1')],'allowNull':![],'unique':_0x1a80('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1a80('0x3'),_0x1a80('0x4'),_0x1a80('0x5')),'allowNull':![],'defaultValue':_0x1a80('0x3')},'context':{'type':Sequelize[_0x1a80('0x1')],'allowNull':![],'defaultValue':_0x1a80('0x6')},'callingpres':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x8'),_0x1a80('0x9'),_0x1a80('0xa'),_0x1a80('0xb'),_0x1a80('0xc'),_0x1a80('0xd'),_0x1a80('0xe'),_0x1a80('0xf'))},'deny':{'type':Sequelize[_0x1a80('0x1')]},'permit':{'type':Sequelize[_0x1a80('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x1a80('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x1a80('0x10'),'set':function(_0x516768){this[_0x1a80('0x11')]('transport',_0x516768?_0x516768['join'](','):null);},'get':function(){return this[_0x1a80('0x12')]('transport')?this[_0x1a80('0x12')]('transport')[_0x1a80('0x13')](','):null;},'comment':_0x1a80('0x14')},'dtmfmode':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x15'),_0x1a80('0x16'),_0x1a80('0x17'),_0x1a80('0x18'),_0x1a80('0x19')),'defaultValue':_0x1a80('0x15')},'directmedia':{'type':Sequelize[_0x1a80('0x7')]('yes','no',_0x1a80('0x1a'),_0x1a80('0x1b'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1a80('0x1')]},'directmediadeny':{'type':Sequelize[_0x1a80('0x1')]},'nat':{'type':Sequelize[_0x1a80('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x2b6d81){this[_0x1a80('0x11')]('nat',_0x2b6d81?_0x2b6d81[_0x1a80('0x1d')](','):null);},'get':function(){return this[_0x1a80('0x12')](_0x1a80('0x1e'))?this[_0x1a80('0x12')]('nat')['split'](','):null;},'comment':_0x1a80('0x1f')},'callgroup':{'type':Sequelize[_0x1a80('0x1')]},'namedcallgroup':{'type':Sequelize[_0x1a80('0x1')]},'pickupgroup':{'type':Sequelize[_0x1a80('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x1a80('0x1')]},'language':{'type':Sequelize[_0x1a80('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1a80('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1a80('0x1')],'defaultValue':_0x1a80('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1a80('0x21'),'set':function(_0x54a845){this[_0x1a80('0x11')](_0x1a80('0x22'),_0x54a845?_0x54a845[_0x1a80('0x1d')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x1a80('0x22'))?this['getDataValue']('allow')[_0x1a80('0x13')](';'):null;},'comment':_0x1a80('0x23')},'autoframing':{'type':Sequelize['ENUM'](_0x1a80('0x1c'),'no')},'insecure':{'type':Sequelize[_0x1a80('0x1')],'defaultValue':_0x1a80('0x24'),'set':function(_0x5f0afe){this[_0x1a80('0x11')]('insecure',_0x5f0afe?_0x5f0afe['join'](','):null);},'get':function(){return this[_0x1a80('0x12')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0x1a80('0x25')},'trustrpid':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1a80('0x7')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1a80('0x7')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x1a80('0x7')]('yes','no')},'useclientcode':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x1a80('0x26')](0xb)},'setvar':{'type':Sequelize[_0x1a80('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x1a80('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no'),'defaultValue':_0x1a80('0x1c')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1a80('0x7')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0x1a80('0x7')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x1a80('0x7')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x1a80('0x1')]},'videosupport':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no',_0x1a80('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1a80('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x1a80('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x1a80('0x29'),_0x1a80('0x2a'),_0x1a80('0x2b'))},'session_expires':{'type':Sequelize[_0x1a80('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x1a80('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x2c'),_0x1a80('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1a80('0x1')]},'regexten':{'type':Sequelize[_0x1a80('0x1')]},'fromdomain':{'type':Sequelize[_0x1a80('0x1')]},'fromuser':{'type':Sequelize[_0x1a80('0x1')]},'port':{'type':Sequelize[_0x1a80('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x1a80('0x1c'),'no'),'defaultValue':_0x1a80('0x1c')},'keepalive':{'type':Sequelize[_0x1a80('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x1a80('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1a80('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no',_0x1a80('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1a80('0x1')]},'callbackextension':{'type':Sequelize[_0x1a80('0x1')]},'timert1':{'type':Sequelize[_0x1a80('0x26')](0xb)},'timerb':{'type':Sequelize[_0x1a80('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1a80('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x1a80('0x1')]},'contactdeny':{'type':Sequelize[_0x1a80('0x1')]},'contactacl':{'type':Sequelize[_0x1a80('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x1a80('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x1a80('0x26')](0xb)},'encryption':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1a80('0x1c'),'no')},'force_avp':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'icesupport':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x1a80('0x7')]('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x1a80('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x1a80('0x1')]},'dtlscipher':{'type':Sequelize[_0x1a80('0x1')]},'dtlscafile':{'type':Sequelize[_0x1a80('0x1')]},'dtlscapath':{'type':Sequelize[_0x1a80('0x1')]},'dtlssetup':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x2f'),_0x1a80('0x30'),_0x1a80('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1a80('0x1')]},'usereqphone':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1a80('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no')},'vmexten':{'type':Sequelize[_0x1a80('0x1')]},'mohinterpret':{'type':Sequelize[_0x1a80('0x1')]},'mohsuggest':{'type':Sequelize[_0x1a80('0x1')]},'parkinglot':{'type':Sequelize[_0x1a80('0x1')]},'description':{'type':Sequelize[_0x1a80('0x1')]},'host':{'type':Sequelize[_0x1a80('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x1a80('0x7')](_0x1a80('0x1c'),'no',_0x1a80('0x1a'),_0x1a80('0x1b'),_0x1a80('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1a80('0x1')]},'otherFields':{'type':Sequelize[_0x1a80('0x1')]},'active':{'type':Sequelize[_0x1a80('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1a80('0x1')],'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 65ecdc8..cea65db 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 _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x161f85,_0x1b1968){var _0x3f98ad=function(_0x44b3d5){while(--_0x44b3d5){_0x161f85['push'](_0x161f85['shift']());}};_0x3f98ad(++_0x1b1968);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x24ca[_0x5235dd];return _0x13059d;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x4060e0,_0x30b222){var _0x3ebfc6=function(_0x3a6a6e){while(--_0x3a6a6e){_0x4060e0['push'](_0x4060e0['shift']());}};_0x3ebfc6(++_0x30b222);}(_0xedd9,0xfc));var _0x9edd=function(_0x47e09e,_0xc0f2ac){_0x47e09e=_0x47e09e-0x0;var _0x1c1423=_0xedd9[_0x47e09e];return _0x1c1423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index bf24309..d033813 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 _0x99a3=['Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x20cd5c,_0x5e1af5){var _0x5144de=function(_0x2d15af){while(--_0x2d15af){_0x20cd5c['push'](_0x20cd5c['shift']());}};_0x5144de(++_0x5e1af5);}(_0x99a3,0x1c4));var _0x399a=function(_0x505675,_0x34bef5){_0x505675=_0x505675-0x0;var _0x40c8e7=_0x99a3[_0x505675];return _0x40c8e7;};'use strict';var _=require(_0x399a('0x0'));var util=require(_0x399a('0x1'));var logger=require(_0x399a('0x2'))(_0x399a('0x3'));var moment=require(_0x399a('0x4'));var BPromise=require(_0x399a('0x5'));var rp=require(_0x399a('0x6'));var fs=require('fs');var path=require(_0x399a('0x7'));var rimraf=require(_0x399a('0x8'));var config=require(_0x399a('0x9'));var attributes=require(_0x399a('0xa'));module[_0x399a('0xb')]=function(_0x4e56a5,_0x16170){return _0x4e56a5[_0x399a('0xc')](_0x399a('0xd'),attributes,{'tableName':_0x399a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x556a=['../../config/environment','./trunk.attributes','define','util','api','request-promise','path','rimraf'];(function(_0x8403f6,_0x566fcc){var _0x9e11cf=function(_0x178360){while(--_0x178360){_0x8403f6['push'](_0x8403f6['shift']());}};_0x9e11cf(++_0x566fcc);}(_0x556a,0x1ab));var _0xa556=function(_0x2843d2,_0x27cfa5){_0x2843d2=_0x2843d2-0x0;var _0x214d1b=_0x556a[_0x2843d2];return _0x214d1b;};'use strict';var _=require('lodash');var util=require(_0xa556('0x0'));var logger=require('../../config/logger')(_0xa556('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa556('0x2'));var fs=require('fs');var path=require(_0xa556('0x3'));var rimraf=require(_0xa556('0x4'));var config=require(_0xa556('0x5'));var attributes=require(_0xa556('0x6'));module['exports']=function(_0x28d695,_0x2b311c){return _0x28d695[_0xa556('0x7')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 152e2df..021db9f 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 _0x8995=['stringify','catch','Trunk','find','where','ShowTrunk','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrunk','findAll','options','raw','attributes','include','model','map','debug'];(function(_0x3dd68e,_0x457a8b){var _0x6e19f9=function(_0x5884d9){while(--_0x5884d9){_0x3dd68e['push'](_0x3dd68e['shift']());}};_0x6e19f9(++_0x457a8b);}(_0x8995,0x11e));var _0x5899=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0x8995[_0x151721];return _0x2deaa7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5899('0x0'));var BPromise=require('bluebird');var rs=require(_0x5899('0x1'));var fs=require('fs');var Redis=require(_0x5899('0x2'));var db=require(_0x5899('0x3'))['db'];var utils=require(_0x5899('0x4'));var logger=require(_0x5899('0x5'))(_0x5899('0x6'));var config=require(_0x5899('0x7'));var jayson=require(_0x5899('0x8'));var client=jayson[_0x5899('0x9')][_0x5899('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57fdf0,_0x11b0d5,_0x5b23a4){return new BPromise(function(_0x362853,_0x49a6cb){return client['request'](_0x57fdf0,_0x5b23a4)[_0x5899('0xb')](function(_0x49e37a){logger[_0x5899('0xc')](_0x5899('0xd'),_0x11b0d5,_0x5899('0xe'));logger['debug'](_0x5899('0xf'),_0x11b0d5,_0x5899('0xe'),JSON['stringify'](_0x49e37a));if(_0x49e37a[_0x5899('0x10')]){if(_0x49e37a[_0x5899('0x10')][_0x5899('0x11')]===0x1f4){logger[_0x5899('0x10')](_0x5899('0xd'),_0x11b0d5,_0x49e37a[_0x5899('0x10')][_0x5899('0x12')]);return _0x49a6cb(_0x49e37a[_0x5899('0x10')][_0x5899('0x12')]);}logger[_0x5899('0x10')]('Trunk,\x20%s,\x20%s',_0x11b0d5,_0x49e37a['error'][_0x5899('0x12')]);return _0x362853(_0x49e37a[_0x5899('0x10')]['message']);}else{logger[_0x5899('0xc')]('Trunk,\x20%s,\x20%s',_0x11b0d5,'request\x20sent');_0x362853(_0x49e37a[_0x5899('0x13')][_0x5899('0x12')]);}})['catch'](function(_0x1d44d4){logger['error'](_0x5899('0xd'),_0x11b0d5,_0x1d44d4);_0x49a6cb(_0x1d44d4);});});}exports[_0x5899('0x14')]=function(_0xbf961){var _0x59e88e=this;return new Promise(function(_0x9c2cba,_0x52b188){return db['Trunk'][_0x5899('0x15')]({'raw':_0xbf961[_0x5899('0x16')]?_0xbf961['options'][_0x5899('0x17')]===undefined?!![]:![]:!![],'where':_0xbf961[_0x5899('0x16')]?_0xbf961[_0x5899('0x16')]['where']||null:null,'attributes':_0xbf961[_0x5899('0x16')]?_0xbf961[_0x5899('0x16')][_0x5899('0x18')]||null:null,'limit':_0xbf961[_0x5899('0x16')]?_0xbf961[_0x5899('0x16')]['limit']||null:null,'include':_0xbf961[_0x5899('0x16')]?_0xbf961['options'][_0x5899('0x19')]?_['map'](_0xbf961[_0x5899('0x16')][_0x5899('0x19')],function(_0x11c0c4){return{'model':db[_0x11c0c4[_0x5899('0x1a')]],'as':_0x11c0c4['as'],'attributes':_0x11c0c4[_0x5899('0x18')],'include':_0x11c0c4['include']?_[_0x5899('0x1b')](_0x11c0c4[_0x5899('0x19')],function(_0x3c994b){return{'model':db[_0x3c994b[_0x5899('0x1a')]],'as':_0x3c994b['as'],'attributes':_0x3c994b[_0x5899('0x18')],'include':_0x3c994b[_0x5899('0x19')]?_[_0x5899('0x1b')](_0x3c994b[_0x5899('0x19')],function(_0x4fd882){return{'model':db[_0x4fd882[_0x5899('0x1a')]],'as':_0x4fd882['as'],'attributes':_0x4fd882[_0x5899('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x599d2f){logger[_0x5899('0xc')](_0x5899('0x14'),_0xbf961);logger[_0x5899('0x1c')](_0x5899('0x14'),_0xbf961,JSON[_0x5899('0x1d')](_0x599d2f));_0x9c2cba(_0x599d2f);})[_0x5899('0x1e')](function(_0x57eb9c){logger['error'](_0x5899('0x14'),_0x57eb9c['message'],_0xbf961);_0x52b188(_0x59e88e[_0x5899('0x10')](0x1f4,_0x57eb9c[_0x5899('0x12')]));});});};exports['ShowTrunk']=function(_0x2fc098){var _0x28d462=this;return new Promise(function(_0x22c2c8,_0x8ae48c){return db[_0x5899('0x1f')][_0x5899('0x20')]({'raw':_0x2fc098[_0x5899('0x16')]?_0x2fc098[_0x5899('0x16')][_0x5899('0x17')]===undefined?!![]:![]:!![],'where':_0x2fc098['options']?_0x2fc098[_0x5899('0x16')][_0x5899('0x21')]||null:null,'attributes':_0x2fc098[_0x5899('0x16')]?_0x2fc098[_0x5899('0x16')]['attributes']||null:null,'include':_0x2fc098['options']?_0x2fc098[_0x5899('0x16')][_0x5899('0x19')]?_[_0x5899('0x1b')](_0x2fc098[_0x5899('0x16')][_0x5899('0x19')],function(_0x39b45d){return{'model':db[_0x39b45d[_0x5899('0x1a')]],'as':_0x39b45d['as'],'attributes':_0x39b45d[_0x5899('0x18')],'include':_0x39b45d[_0x5899('0x19')]?_[_0x5899('0x1b')](_0x39b45d[_0x5899('0x19')],function(_0x710fda){return{'model':db[_0x710fda[_0x5899('0x1a')]],'as':_0x710fda['as'],'attributes':_0x710fda[_0x5899('0x18')],'include':_0x710fda['include']?_[_0x5899('0x1b')](_0x710fda[_0x5899('0x19')],function(_0x28487c){return{'model':db[_0x28487c[_0x5899('0x1a')]],'as':_0x28487c['as'],'attributes':_0x28487c[_0x5899('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5899('0xb')](function(_0x423cc0){logger[_0x5899('0xc')](_0x5899('0x22'),_0x2fc098);logger['debug'](_0x5899('0x22'),_0x2fc098,JSON[_0x5899('0x1d')](_0x423cc0));_0x22c2c8(_0x423cc0);})[_0x5899('0x1e')](function(_0x5f02e8){logger[_0x5899('0x10')](_0x5899('0x22'),_0x5f02e8[_0x5899('0x12')],_0x2fc098);_0x8ae48c(_0x28d462[_0x5899('0x10')](0x1f4,_0x5f02e8[_0x5899('0x12')]));});});}; \ No newline at end of file +var _0xe744=['rpc','../../config/environment','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','then','debug','stringify','ShowTrunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15ef17,_0x33f73f){var _0x340ba7=function(_0x4e5eba){while(--_0x4e5eba){_0x15ef17['push'](_0x15ef17['shift']());}};_0x340ba7(++_0x33f73f);}(_0xe744,0x14e));var _0x4e74=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe744[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x4e74('0x0'));var util=require(_0x4e74('0x1'));var moment=require(_0x4e74('0x2'));var BPromise=require(_0x4e74('0x3'));var rs=require(_0x4e74('0x4'));var fs=require('fs');var Redis=require(_0x4e74('0x5'));var db=require(_0x4e74('0x6'))['db'];var utils=require(_0x4e74('0x7'));var logger=require('../../config/logger')(_0x4e74('0x8'));var config=require(_0x4e74('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4e74('0xa')][_0x4e74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bcffb,_0x1b0d4b,_0x5529e3){return new BPromise(function(_0x56b799,_0x2a3ee6){return client[_0x4e74('0xc')](_0x2bcffb,_0x5529e3)['then'](function(_0x16c128){logger[_0x4e74('0xd')](_0x4e74('0xe'),_0x1b0d4b,_0x4e74('0xf'));logger['debug'](_0x4e74('0x10'),_0x1b0d4b,_0x4e74('0xf'),JSON['stringify'](_0x16c128));if(_0x16c128[_0x4e74('0x11')]){if(_0x16c128[_0x4e74('0x11')][_0x4e74('0x12')]===0x1f4){logger[_0x4e74('0x11')](_0x4e74('0xe'),_0x1b0d4b,_0x16c128[_0x4e74('0x11')][_0x4e74('0x13')]);return _0x2a3ee6(_0x16c128['error'][_0x4e74('0x13')]);}logger['error'](_0x4e74('0xe'),_0x1b0d4b,_0x16c128[_0x4e74('0x11')][_0x4e74('0x13')]);return _0x56b799(_0x16c128['error'][_0x4e74('0x13')]);}else{logger[_0x4e74('0xd')](_0x4e74('0xe'),_0x1b0d4b,_0x4e74('0xf'));_0x56b799(_0x16c128[_0x4e74('0x14')]['message']);}})[_0x4e74('0x15')](function(_0x2a1f52){logger[_0x4e74('0x11')](_0x4e74('0xe'),_0x1b0d4b,_0x2a1f52);_0x2a3ee6(_0x2a1f52);});});}exports[_0x4e74('0x16')]=function(_0x2ce8e2){var _0x297617=this;return new Promise(function(_0x172950,_0x3afdb4){return db[_0x4e74('0x17')][_0x4e74('0x18')]({'raw':_0x2ce8e2[_0x4e74('0x19')]?_0x2ce8e2[_0x4e74('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2ce8e2[_0x4e74('0x19')]?_0x2ce8e2[_0x4e74('0x19')][_0x4e74('0x1a')]||null:null,'attributes':_0x2ce8e2[_0x4e74('0x19')]?_0x2ce8e2[_0x4e74('0x19')][_0x4e74('0x1b')]||null:null,'limit':_0x2ce8e2[_0x4e74('0x19')]?_0x2ce8e2[_0x4e74('0x19')][_0x4e74('0x1c')]||null:null,'include':_0x2ce8e2[_0x4e74('0x19')]?_0x2ce8e2[_0x4e74('0x19')][_0x4e74('0x1d')]?_[_0x4e74('0x1e')](_0x2ce8e2[_0x4e74('0x19')][_0x4e74('0x1d')],function(_0x1a5d4c){return{'model':db[_0x1a5d4c[_0x4e74('0x1f')]],'as':_0x1a5d4c['as'],'attributes':_0x1a5d4c[_0x4e74('0x1b')],'include':_0x1a5d4c['include']?_[_0x4e74('0x1e')](_0x1a5d4c[_0x4e74('0x1d')],function(_0x4a73bc){return{'model':db[_0x4a73bc[_0x4e74('0x1f')]],'as':_0x4a73bc['as'],'attributes':_0x4a73bc[_0x4e74('0x1b')],'include':_0x4a73bc[_0x4e74('0x1d')]?_['map'](_0x4a73bc[_0x4e74('0x1d')],function(_0x559ce7){return{'model':db[_0x559ce7[_0x4e74('0x1f')]],'as':_0x559ce7['as'],'attributes':_0x559ce7[_0x4e74('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4e74('0x20')](function(_0x22e4ca){logger['info'](_0x4e74('0x16'),_0x2ce8e2);logger[_0x4e74('0x21')]('GetTrunk',_0x2ce8e2,JSON[_0x4e74('0x22')](_0x22e4ca));_0x172950(_0x22e4ca);})[_0x4e74('0x15')](function(_0x561261){logger[_0x4e74('0x11')](_0x4e74('0x16'),_0x561261[_0x4e74('0x13')],_0x2ce8e2);_0x3afdb4(_0x297617[_0x4e74('0x11')](0x1f4,_0x561261[_0x4e74('0x13')]));});});};exports[_0x4e74('0x23')]=function(_0x59492a){var _0x3e1d4c=this;return new Promise(function(_0x2bd08a,_0x4de75e){return db[_0x4e74('0x17')][_0x4e74('0x24')]({'raw':_0x59492a['options']?_0x59492a[_0x4e74('0x19')][_0x4e74('0x25')]===undefined?!![]:![]:!![],'where':_0x59492a[_0x4e74('0x19')]?_0x59492a[_0x4e74('0x19')][_0x4e74('0x1a')]||null:null,'attributes':_0x59492a[_0x4e74('0x19')]?_0x59492a[_0x4e74('0x19')]['attributes']||null:null,'include':_0x59492a[_0x4e74('0x19')]?_0x59492a[_0x4e74('0x19')]['include']?_[_0x4e74('0x1e')](_0x59492a[_0x4e74('0x19')][_0x4e74('0x1d')],function(_0x1f6682){return{'model':db[_0x1f6682[_0x4e74('0x1f')]],'as':_0x1f6682['as'],'attributes':_0x1f6682[_0x4e74('0x1b')],'include':_0x1f6682[_0x4e74('0x1d')]?_[_0x4e74('0x1e')](_0x1f6682[_0x4e74('0x1d')],function(_0x149bd7){return{'model':db[_0x149bd7[_0x4e74('0x1f')]],'as':_0x149bd7['as'],'attributes':_0x149bd7[_0x4e74('0x1b')],'include':_0x149bd7[_0x4e74('0x1d')]?_[_0x4e74('0x1e')](_0x149bd7[_0x4e74('0x1d')],function(_0x33fd9d){return{'model':db[_0x33fd9d[_0x4e74('0x1f')]],'as':_0x33fd9d['as'],'attributes':_0x33fd9d[_0x4e74('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdcaaef){logger[_0x4e74('0xd')](_0x4e74('0x23'),_0x59492a);logger[_0x4e74('0x21')](_0x4e74('0x23'),_0x59492a,JSON[_0x4e74('0x22')](_0xdcaaef));_0x2bd08a(_0xdcaaef);})[_0x4e74('0x15')](function(_0x306b3e){logger['error']('ShowTrunk',_0x306b3e[_0x4e74('0x13')],_0x59492a);_0x4de75e(_0x3e1d4c['error'](0x1f4,_0x306b3e[_0x4e74('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 861aabd..7f5b257 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 _0xeea5=['Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x586e4b,_0x2dcc8b){var _0x3bccd1=function(_0x572d24){while(--_0x572d24){_0x586e4b['push'](_0x586e4b['shift']());}};_0x3bccd1(++_0x2dcc8b);}(_0xeea5,0x16f));var _0x5eea=function(_0x34b8fe,_0x1d9033){_0x34b8fe=_0x34b8fe-0x0;var _0xe4660d=_0xeea5[_0x34b8fe];return _0xe4660d;};'use strict';var express=require(_0x5eea('0x0'));var router=express[_0x5eea('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5eea('0x2'));router[_0x5eea('0x3')](_0x5eea('0x4'),auth[_0x5eea('0x5')](),controller[_0x5eea('0x6')]);module[_0x5eea('0x7')]=router; \ No newline at end of file +var _0x1786=['put','isAuthenticated','update','exports','../../components/auth/service','./user-setting.controller'];(function(_0x5c4176,_0xa6c8fc){var _0x168b38=function(_0x25f075){while(--_0x25f075){_0x5c4176['push'](_0x5c4176['shift']());}};_0x168b38(++_0xa6c8fc);}(_0x1786,0xa6));var _0x6178=function(_0x418937,_0x3d0e4d){_0x418937=_0x418937-0x0;var _0x54952c=_0x1786[_0x418937];return _0x54952c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x6178('0x0'));var controller=require(_0x6178('0x1'));router[_0x6178('0x2')]('/:id',auth[_0x6178('0x3')](),controller[_0x6178('0x4')]);module[_0x6178('0x5')]=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 3bb6672..35f1483 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 _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x3d4886,_0x43f2f2){var _0x26a4d3=function(_0x49425c){while(--_0x49425c){_0x3d4886['push'](_0x3d4886['shift']());}};_0x26a4d3(++_0x43f2f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x47cb71,_0x5d39f9){var _0x764044=function(_0x306c42){while(--_0x306c42){_0x47cb71['push'](_0x47cb71['shift']());}};_0x764044(++_0x5d39f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ 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 de9d041..e04b743 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 _0xd82a=['update','then','sendStatus','error','name','status','user','role','admin','params','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','json'];(function(_0x12915f,_0x4e18fb){var _0x141f12=function(_0x654343){while(--_0x654343){_0x12915f['push'](_0x12915f['shift']());}};_0x141f12(++_0x4e18fb);}(_0xd82a,0xbd));var _0xad82=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xd82a[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xad82('0x0'));var Redis=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))(_0xad82('0x3'));var config=require('../../config/environment');var db=require(_0xad82('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xad82('0x5')]));require(_0xad82('0x6'))[_0xad82('0x7')](socket);config[_0xad82('0x5')]=_[_0xad82('0x8')](config[_0xad82('0x5')],{'host':_0xad82('0x9'),'port':0x18eb});function respondWithResult(_0x45b835,_0x3cd50f){_0x3cd50f=_0x3cd50f||0xc8;return function(_0x2d37c8){if(_0x2d37c8){return _0x45b835['status'](_0x3cd50f)[_0xad82('0xa')](_0x2d37c8);}};}function saveUpdates(_0x1c55bb){return function(_0x1d0720){if(_0x1d0720){return _0x1d0720[_0xad82('0xb')](_0x1c55bb)[_0xad82('0xc')](function(_0x3dcbdd){return _0x3dcbdd;});}return null;};}function handleEntityNotFound(_0x3d4823){return function(_0x1d5b0d){if(!_0x1d5b0d){_0x3d4823[_0xad82('0xd')](0x194);}return _0x1d5b0d;};}function handleError(_0x1e3aa4,_0x1650b4){_0x1650b4=_0x1650b4||0x1f4;return function(_0x2f8efb){logger[_0xad82('0xe')](_0x2f8efb['stack']);if(_0x2f8efb[_0xad82('0xf')]){delete _0x2f8efb['name'];}_0x1e3aa4[_0xad82('0x10')](_0x1650b4)['send'](_0x2f8efb);};}exports[_0xad82('0xb')]=function(_0xd8239d,_0xaaf129){if(_0xd8239d[_0xad82('0x11')][_0xad82('0x12')]!==_0xad82('0x13'))throw new Error('Unauthorized');if(isNaN(Number(_0xd8239d[_0xad82('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xad82('0x15')][_0xad82('0x16')]({'where':{'id':_0xd8239d[_0xad82('0x14')]['id']}})[_0xad82('0xc')](handleEntityNotFound(_0xaaf129,null))[_0xad82('0xc')](saveUpdates(_0xd8239d[_0xad82('0x17')],null))[_0xad82('0xc')](respondWithResult(_0xaaf129,null))[_0xad82('0x18')](handleError(_0xaaf129,null));}; \ No newline at end of file +var _0x79d8=['ioredis','../../config/logger','api','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','localhost','status','json','update','sendStatus','error','stack','name','user','role','admin','Unauthorized','params','find','body','then','catch','lodash'];(function(_0x4d30ac,_0x4ad69d){var _0xdc854a=function(_0x1ba2e5){while(--_0x1ba2e5){_0x4d30ac['push'](_0x4d30ac['shift']());}};_0xdc854a(++_0x4ad69d);}(_0x79d8,0x67));var _0x879d=function(_0x51a286,_0x4cd7a9){_0x51a286=_0x51a286-0x0;var _0x446037=_0x79d8[_0x51a286];return _0x446037;};'use strict';var _=require(_0x879d('0x0'));var Redis=require(_0x879d('0x1'));var logger=require(_0x879d('0x2'))(_0x879d('0x3'));var config=require('../../config/environment');var db=require(_0x879d('0x4'))['db'];var socket=require(_0x879d('0x5'))(new Redis(config['redis']));require(_0x879d('0x6'))[_0x879d('0x7')](socket);config[_0x879d('0x8')]=_['defaults'](config[_0x879d('0x8')],{'host':_0x879d('0x9'),'port':0x18eb});function respondWithResult(_0x142181,_0xc70b64){_0xc70b64=_0xc70b64||0xc8;return function(_0x49c05d){if(_0x49c05d){return _0x142181[_0x879d('0xa')](_0xc70b64)[_0x879d('0xb')](_0x49c05d);}};}function saveUpdates(_0x8de508){return function(_0x1b90b0){if(_0x1b90b0){return _0x1b90b0[_0x879d('0xc')](_0x8de508)['then'](function(_0x1cc5bf){return _0x1cc5bf;});}return null;};}function handleEntityNotFound(_0x4920b5){return function(_0x5d93f2){if(!_0x5d93f2){_0x4920b5[_0x879d('0xd')](0x194);}return _0x5d93f2;};}function handleError(_0x35bbff,_0x1930d9){_0x1930d9=_0x1930d9||0x1f4;return function(_0x5780a5){logger[_0x879d('0xe')](_0x5780a5[_0x879d('0xf')]);if(_0x5780a5['name']){delete _0x5780a5[_0x879d('0x10')];}_0x35bbff[_0x879d('0xa')](_0x1930d9)['send'](_0x5780a5);};}exports[_0x879d('0xc')]=function(_0x57889a,_0x1fd482){if(_0x57889a[_0x879d('0x11')][_0x879d('0x12')]!==_0x879d('0x13'))throw new Error(_0x879d('0x14'));if(isNaN(Number(_0x57889a[_0x879d('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x879d('0x16')]({'where':{'id':_0x57889a[_0x879d('0x15')]['id']}})['then'](handleEntityNotFound(_0x1fd482,null))['then'](saveUpdates(_0x57889a[_0x879d('0x17')],null))[_0x879d('0x18')](respondWithResult(_0x1fd482,null))[_0x879d('0x19')](handleError(_0x1fd482,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 da426f0..2c97e6f 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 _0x68cd=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserSetting'];(function(_0x141c26,_0x164343){var _0x122ccc=function(_0x59aadb){while(--_0x59aadb){_0x141c26['push'](_0x141c26['shift']());}};_0x122ccc(++_0x164343);}(_0x68cd,0x85));var _0xd68c=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x68cd[_0x343090];return _0x3ff3e8;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xd68c('0x0'))['db'][_0xd68c('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd68c('0x2'),'afterUpdate':_0xd68c('0x3'),'afterDestroy':_0xd68c('0x4')};function emitEvent(_0x2f362c){return function(_0x1ce749,_0x51d2d8,_0x9ab635){UserSettingEvents[_0xd68c('0x5')](_0x2f362c+':'+_0x1ce749['id'],_0x1ce749);UserSettingEvents[_0xd68c('0x5')](_0x2f362c,_0x1ce749);_0x9ab635(null);};}for(var e in events){if(events[_0xd68c('0x6')](e)){var event=events[e];UserSetting[_0xd68c('0x7')](e,emitEvent(event));}}module[_0xd68c('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x876e=['hook','exports','events','../../mysqldb','UserSetting','save','update','emit','hasOwnProperty'];(function(_0x3a5c4d,_0x46e890){var _0x3b2937=function(_0x1d5c59){while(--_0x1d5c59){_0x3a5c4d['push'](_0x3a5c4d['shift']());}};_0x3b2937(++_0x46e890);}(_0x876e,0x65));var _0xe876=function(_0x504b71,_0x41efa8){_0x504b71=_0x504b71-0x0;var _0x45b84e=_0x876e[_0x504b71];return _0x45b84e;};'use strict';var EventEmitter=require(_0xe876('0x0'));var UserSetting=require(_0xe876('0x1'))['db'][_0xe876('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe876('0x3'),'afterUpdate':_0xe876('0x4'),'afterDestroy':'remove'};function emitEvent(_0xce77c0){return function(_0x2e82f5,_0x979403,_0x121965){UserSettingEvents['emit'](_0xce77c0+':'+_0x2e82f5['id'],_0x2e82f5);UserSettingEvents[_0xe876('0x5')](_0xce77c0,_0x2e82f5);_0x121965(null);};}for(var e in events){if(events[_0xe876('0x6')](e)){var event=events[e];UserSetting[_0xe876('0x7')](e,emitEvent(event));}}module[_0xe876('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index d4209b6..3dae998 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 _0xa7fa=['user_settings','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting'];(function(_0x15ce41,_0x2da3ed){var _0x4cc8df=function(_0x18e455){while(--_0x18e455){_0x15ce41['push'](_0x15ce41['shift']());}};_0x4cc8df(++_0x2da3ed);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0xaa7f('0x0'));module['exports']=function(_0x5f4cc1){return _0x5f4cc1[_0xaa7f('0x1')](_0xaa7f('0x2'),attributes,{'tableName':_0xaa7f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x236e94){if(!_0x236e94['clientSideLoggingEnabled'])_0x236e94[_0xaa7f('0x4')]=null;else if(_0x236e94[_0xaa7f('0x4')]===null)_0x236e94[_0xaa7f('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x33d2=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x7f));var _0x233d=function(_0x57c9ac,_0x15e943){_0x57c9ac=_0x57c9ac-0x0;var _0x3d0908=_0x33d2[_0x57c9ac];return _0x3d0908;};'use strict';var attributes=require(_0x233d('0x0'));module[_0x233d('0x1')]=function(_0x54d233){return _0x54d233['define'](_0x233d('0x2'),attributes,{'tableName':_0x233d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5dd59e){if(!_0x5dd59e[_0x233d('0x4')])_0x5dd59e[_0x233d('0x5')]=null;else if(_0x5dd59e[_0x233d('0x5')]===null)_0x5dd59e[_0x233d('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index e246484..54e5029 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 _0x8d5f=['length','user-setting:','./user-setting.events','remove','update','emit','user-setting:update','user-setting:update:user-','UserId'];(function(_0x113506,_0x63499a){var _0x1c5246=function(_0x5a25ec){while(--_0x5a25ec){_0x113506['push'](_0x113506['shift']());}};_0x1c5246(++_0x63499a);}(_0x8d5f,0x13d));var _0xf8d5=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x8d5f[_0x4063a4];return _0x17908d;};'use strict';var UserSettingEvents=require(_0xf8d5('0x0'));var events=['save',_0xf8d5('0x1'),_0xf8d5('0x2')];function createListener(_0x442f67,_0x16675f){return function(_0x66f7e4){_0x16675f[_0xf8d5('0x3')](_0x442f67,_0x66f7e4);if(_0x442f67===_0xf8d5('0x4')){_0x16675f['emit'](_0xf8d5('0x5')+_0x66f7e4[_0xf8d5('0x6')],_0x66f7e4);}};}exports['register']=function(_0x4683fb){for(var _0x267d19=0x0,_0x3af6e0=events[_0xf8d5('0x7')];_0x267d19<_0x3af6e0;_0x267d19++){var _0x5f3c49=events[_0x267d19];var _0x15db8c=createListener(_0xf8d5('0x8')+_0x5f3c49,_0x4683fb);UserSettingEvents['on'](_0x5f3c49,_0x15db8c);}}; \ No newline at end of file +var _0x0273=['./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','register','length','user-setting:'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x0273,0x172));var _0x3027=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0273[_0x14add3];return _0x4a174f;};'use strict';var UserSettingEvents=require(_0x3027('0x0'));var events=[_0x3027('0x1'),_0x3027('0x2'),_0x3027('0x3')];function createListener(_0x2c93f1,_0x178bf1){return function(_0x15ce69){_0x178bf1[_0x3027('0x4')](_0x2c93f1,_0x15ce69);if(_0x2c93f1===_0x3027('0x5')){_0x178bf1['emit'](_0x3027('0x6')+_0x15ce69['UserId'],_0x15ce69);}};}exports[_0x3027('0x7')]=function(_0x315c04){for(var _0x318d0c=0x0,_0x3a8499=events[_0x3027('0x8')];_0x318d0c<_0x3a8499;_0x318d0c++){var _0x486f54=events[_0x318d0c];var _0xf25f3=createListener(_0x3027('0x9')+_0x486f54,_0x315c04);UserSettingEvents['on'](_0x486f54,_0xf25f3);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index ebec089..b900915 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 _0x53f6=['/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','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','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/api_key','createApiKey','put','/:id/password','changePassword','/:id/queues','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get','/describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups'];(function(_0x4cd7b2,_0x127ae4){var _0x43ddf5=function(_0x17dc78){while(--_0x17dc78){_0x4cd7b2['push'](_0x4cd7b2['shift']());}};_0x43ddf5(++_0x127ae4);}(_0x53f6,0xda));var _0x653f=function(_0x4468b2,_0x4f0703){_0x4468b2=_0x4468b2-0x0;var _0x4fb044=_0x53f6[_0x4468b2];return _0x4fb044;};'use strict';var multer=require(_0x653f('0x0'));var util=require(_0x653f('0x1'));var path=require(_0x653f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x653f('0x3'));var auth=require(_0x653f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x653f('0x5'));var controller=require('./user.controller');router[_0x653f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x653f('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x653f('0x6')](_0x653f('0x8'),auth[_0x653f('0x9')](),controller[_0x653f('0xa')]);router[_0x653f('0x6')](_0x653f('0xb'),auth['isAuthenticated'](),controller[_0x653f('0xc')]);router[_0x653f('0x6')](_0x653f('0xd'),auth[_0x653f('0x9')](),controller['show']);router[_0x653f('0x6')]('/:id/avatar',controller['getAvatar']);router[_0x653f('0x6')](_0x653f('0xe'),auth[_0x653f('0x9')](),controller[_0x653f('0xf')]);router['get'](_0x653f('0x10'),auth[_0x653f('0x9')](),controller[_0x653f('0x11')]);router['get']('/:id/queues',auth[_0x653f('0x9')](),controller[_0x653f('0x12')]);router[_0x653f('0x6')](_0x653f('0x13'),auth[_0x653f('0x9')](),controller[_0x653f('0x14')]);router[_0x653f('0x6')](_0x653f('0x15'),auth[_0x653f('0x9')](),controller['getGroups']);router[_0x653f('0x6')](_0x653f('0x16'),auth['isAuthenticated'](),controller[_0x653f('0x17')]);router['get'](_0x653f('0x18'),auth[_0x653f('0x9')](),controller[_0x653f('0x19')]);router['get'](_0x653f('0x1a'),auth[_0x653f('0x9')](),controller[_0x653f('0x1b')]);router[_0x653f('0x6')](_0x653f('0x1c'),auth['isAuthenticated'](),controller[_0x653f('0x1d')]);router[_0x653f('0x6')](_0x653f('0x1e'),auth[_0x653f('0x9')](),controller[_0x653f('0x1f')]);router['get'](_0x653f('0x20'),auth[_0x653f('0x9')](),controller[_0x653f('0x21')]);router[_0x653f('0x6')](_0x653f('0x22'),auth[_0x653f('0x9')](),controller['getFaxInteractions']);router[_0x653f('0x6')](_0x653f('0x23'),auth[_0x653f('0x9')](),controller[_0x653f('0x24')]);router[_0x653f('0x6')](_0x653f('0x25'),auth['isAuthenticated'](),controller[_0x653f('0x26')]);router[_0x653f('0x6')](_0x653f('0x27'),auth[_0x653f('0x9')](),controller[_0x653f('0x28')]);router['get'](_0x653f('0x29'),auth[_0x653f('0x9')](),controller['getAgents']);router[_0x653f('0x6')](_0x653f('0x2a'),auth[_0x653f('0x9')](),controller[_0x653f('0x2b')]);router[_0x653f('0x6')](_0x653f('0x2c'),auth[_0x653f('0x9')](),controller['getFaxAccounts']);router[_0x653f('0x6')](_0x653f('0x2d'),auth[_0x653f('0x9')](),controller['getMailAccounts']);router[_0x653f('0x6')](_0x653f('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x653f('0x2f'),auth[_0x653f('0x9')](),controller[_0x653f('0x30')]);router[_0x653f('0x6')](_0x653f('0x31'),auth[_0x653f('0x9')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0x653f('0x9')](),controller['getWhatsappAccounts']);router[_0x653f('0x6')](_0x653f('0x32'),auth[_0x653f('0x9')](),controller[_0x653f('0x33')]);router[_0x653f('0x6')](_0x653f('0x34'),auth[_0x653f('0x9')](),controller[_0x653f('0x35')]);router[_0x653f('0x6')]('/:id/api_key',auth[_0x653f('0x9')](),controller['getApiKey']);router[_0x653f('0x36')](_0x653f('0x10'),auth[_0x653f('0x9')](),controller[_0x653f('0x37')]);router['post']('/',auth[_0x653f('0x9')](),controller[_0x653f('0x38')]);router[_0x653f('0x36')](_0x653f('0x39'),auth['isAuthenticated'](),controller[_0x653f('0x3a')]);router[_0x653f('0x36')]('/:id/queues',auth[_0x653f('0x9')](),controller[_0x653f('0x3b')]);var upload=multer({'storage':multer[_0x653f('0x3c')]({'destination':function(_0x2d2806,_0x544c09,_0x4f0ef4){_0x4f0ef4(null,path[_0x653f('0x3d')](config[_0x653f('0x3e')],_0x653f('0x3f')));},'filename':function(_0x3c7914,_0x276133,_0xac5c8a){_0xac5c8a(null,util[_0x653f('0x40')](_0x653f('0x41'),Date[_0x653f('0x42')](),_0x276133[_0x653f('0x43')]));}})});router[_0x653f('0x36')]('/:id/avatar',upload[_0x653f('0x44')](_0x653f('0x45')),controller['addAvatar']);router[_0x653f('0x36')](_0x653f('0x46'),auth[_0x653f('0x9')](),controller[_0x653f('0x47')]);router[_0x653f('0x36')](_0x653f('0x48'),auth['isAuthenticated'](),controller[_0x653f('0x49')]);router[_0x653f('0x36')](_0x653f('0x4a'),auth['isAuthenticated'](),controller[_0x653f('0x4b')]);router[_0x653f('0x36')](_0x653f('0x4c'),auth[_0x653f('0x9')](),controller[_0x653f('0x4d')]);router[_0x653f('0x36')](_0x653f('0x25'),auth[_0x653f('0x9')](),controller[_0x653f('0x4e')]);router['post'](_0x653f('0x4f'),auth[_0x653f('0x9')](),controller[_0x653f('0x50')]);router[_0x653f('0x36')](_0x653f('0x51'),auth[_0x653f('0x9')](),controller[_0x653f('0x52')]);router[_0x653f('0x36')](_0x653f('0x53'),auth['isAuthenticated'](),controller[_0x653f('0x54')]);router['post'](_0x653f('0x55'),auth[_0x653f('0x9')](),controller[_0x653f('0x56')]);router[_0x653f('0x36')](_0x653f('0x57'),auth['isAuthenticated'](),controller[_0x653f('0x58')]);router['post'](_0x653f('0x59'),auth[_0x653f('0x9')](),controller[_0x653f('0x5a')]);router[_0x653f('0x36')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x653f('0x5b')]);router[_0x653f('0x36')](_0x653f('0x2d'),auth['isAuthenticated'](),controller[_0x653f('0x5c')]);router[_0x653f('0x36')](_0x653f('0x2e'),auth['isAuthenticated'](),controller[_0x653f('0x5d')]);router[_0x653f('0x36')](_0x653f('0x2f'),auth[_0x653f('0x9')](),controller[_0x653f('0x5e')]);router[_0x653f('0x36')](_0x653f('0x31'),auth[_0x653f('0x9')](),controller[_0x653f('0x5f')]);router[_0x653f('0x36')](_0x653f('0x60'),auth[_0x653f('0x9')](),controller[_0x653f('0x61')]);router[_0x653f('0x36')]('/:id/square_projects',auth[_0x653f('0x9')](),controller['addSquareProjects']);router[_0x653f('0x36')](_0x653f('0x62'),auth[_0x653f('0x9')](),controller[_0x653f('0x63')]);router['put']('/:id',auth[_0x653f('0x9')](),controller['update']);router[_0x653f('0x64')](_0x653f('0x65'),auth['isAuthenticated'](),controller[_0x653f('0x66')]);router['delete'](_0x653f('0x67'),auth[_0x653f('0x9')](),controller[_0x653f('0x68')]);router[_0x653f('0x69')](_0x653f('0x25'),auth['isAuthenticated'](),controller[_0x653f('0x6a')]);router['delete'](_0x653f('0xd'),auth[_0x653f('0x9')](),controller[_0x653f('0x6b')]);router[_0x653f('0x69')](_0x653f('0x4f'),auth[_0x653f('0x9')](),controller[_0x653f('0x6c')]);router['delete'](_0x653f('0x51'),auth[_0x653f('0x9')](),controller[_0x653f('0x6d')]);router[_0x653f('0x69')](_0x653f('0x53'),auth[_0x653f('0x9')](),controller[_0x653f('0x6e')]);router[_0x653f('0x69')](_0x653f('0x55'),auth[_0x653f('0x9')](),controller[_0x653f('0x6f')]);router[_0x653f('0x69')](_0x653f('0x57'),auth[_0x653f('0x9')](),controller['removeOpenchannelInteractions']);router[_0x653f('0x69')](_0x653f('0x59'),auth[_0x653f('0x9')](),controller[_0x653f('0x70')]);router['delete'](_0x653f('0x2c'),auth[_0x653f('0x9')](),controller[_0x653f('0x71')]);router[_0x653f('0x69')](_0x653f('0x2d'),auth['isAuthenticated'](),controller[_0x653f('0x72')]);router[_0x653f('0x69')](_0x653f('0x2e'),auth[_0x653f('0x9')](),controller[_0x653f('0x73')]);router[_0x653f('0x69')](_0x653f('0x2f'),auth[_0x653f('0x9')](),controller[_0x653f('0x74')]);router['delete'](_0x653f('0x31'),auth[_0x653f('0x9')](),controller[_0x653f('0x75')]);router[_0x653f('0x69')](_0x653f('0x60'),auth[_0x653f('0x9')](),controller[_0x653f('0x76')]);router[_0x653f('0x69')](_0x653f('0x32'),auth[_0x653f('0x9')](),controller['removeSquareProjects']);router[_0x653f('0x69')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0x653f('0x77')]=router; \ No newline at end of file +var _0x87b5=['removeWhatsappInteractions','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','index','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','post','create','/create_many','bulkCreate','addQueues','root','format','%s-%s','originalname','single','file','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions'];(function(_0x4948aa,_0x12cc52){var _0x4510c8=function(_0x5ec9e5){while(--_0x5ec9e5){_0x4948aa['push'](_0x4948aa['shift']());}};_0x4510c8(++_0x12cc52);}(_0x87b5,0x1ad));var _0x587b=function(_0x4ff2e8,_0x463596){_0x4ff2e8=_0x4ff2e8-0x0;var _0x275b8e=_0x87b5[_0x4ff2e8];return _0x275b8e;};'use strict';var multer=require(_0x587b('0x0'));var util=require(_0x587b('0x1'));var path=require(_0x587b('0x2'));var timeout=require(_0x587b('0x3'));var express=require(_0x587b('0x4'));var router=express['Router']();var fs_extra=require(_0x587b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x587b('0x6'));var controller=require(_0x587b('0x7'));router[_0x587b('0x8')]('/',auth[_0x587b('0x9')](),controller[_0x587b('0xa')]);router['get']('/describe',auth[_0x587b('0x9')](),controller['describe']);router[_0x587b('0x8')](_0x587b('0xb'),auth[_0x587b('0x9')](),controller['whoami']);router[_0x587b('0x8')](_0x587b('0xc'),auth[_0x587b('0x9')](),controller[_0x587b('0xd')]);router[_0x587b('0x8')](_0x587b('0xe'),auth[_0x587b('0x9')](),controller[_0x587b('0xf')]);router[_0x587b('0x8')](_0x587b('0x10'),controller[_0x587b('0x11')]);router[_0x587b('0x8')](_0x587b('0x12'),auth['isAuthenticated'](),controller[_0x587b('0x13')]);router['get'](_0x587b('0x14'),auth[_0x587b('0x9')](),controller[_0x587b('0x15')]);router['get'](_0x587b('0x16'),auth[_0x587b('0x9')](),controller[_0x587b('0x17')]);router[_0x587b('0x8')]('/:id/queues_rt',auth[_0x587b('0x9')](),controller[_0x587b('0x18')]);router[_0x587b('0x8')](_0x587b('0x19'),auth[_0x587b('0x9')](),controller[_0x587b('0x1a')]);router[_0x587b('0x8')](_0x587b('0x1b'),auth[_0x587b('0x9')](),controller[_0x587b('0x1c')]);router[_0x587b('0x8')](_0x587b('0x1d'),auth['isAuthenticated'](),controller[_0x587b('0x1e')]);router[_0x587b('0x8')]('/:id/chat/interactions',auth[_0x587b('0x9')](),controller['getChatInteractions']);router[_0x587b('0x8')](_0x587b('0x1f'),auth[_0x587b('0x9')](),controller['getOpenchannelInteractions']);router[_0x587b('0x8')](_0x587b('0x20'),auth[_0x587b('0x9')](),controller['getMailInteractions']);router[_0x587b('0x8')](_0x587b('0x21'),auth[_0x587b('0x9')](),controller[_0x587b('0x22')]);router['get'](_0x587b('0x23'),auth[_0x587b('0x9')](),controller['getFaxInteractions']);router[_0x587b('0x8')](_0x587b('0x24'),auth[_0x587b('0x9')](),controller[_0x587b('0x25')]);router[_0x587b('0x8')](_0x587b('0x26'),auth[_0x587b('0x9')](),controller[_0x587b('0x27')]);router['get']('/:id/lists',auth[_0x587b('0x9')](),controller['getLists']);router[_0x587b('0x8')]('/:id/agents',auth[_0x587b('0x9')](),controller[_0x587b('0x28')]);router[_0x587b('0x8')](_0x587b('0x29'),auth[_0x587b('0x9')](),controller['getVoicePrefixes']);router[_0x587b('0x8')]('/:id/fax_accounts',auth[_0x587b('0x9')](),controller['getFaxAccounts']);router['get'](_0x587b('0x2a'),auth[_0x587b('0x9')](),controller[_0x587b('0x2b')]);router[_0x587b('0x8')](_0x587b('0x2c'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x587b('0x8')](_0x587b('0x2d'),auth[_0x587b('0x9')](),controller['getSmsAccounts']);router[_0x587b('0x8')](_0x587b('0x2e'),auth[_0x587b('0x9')](),controller[_0x587b('0x2f')]);router[_0x587b('0x8')](_0x587b('0x30'),auth[_0x587b('0x9')](),controller[_0x587b('0x31')]);router[_0x587b('0x8')](_0x587b('0x32'),auth['isAuthenticated'](),controller[_0x587b('0x33')]);router['get'](_0x587b('0x34'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x587b('0x8')]('/:id/api_key',auth[_0x587b('0x9')](),controller['getApiKey']);router['post'](_0x587b('0x14'),auth[_0x587b('0x9')](),controller['addContacts']);router[_0x587b('0x35')]('/',auth[_0x587b('0x9')](),controller[_0x587b('0x36')]);router[_0x587b('0x35')](_0x587b('0x37'),auth['isAuthenticated'](),controller[_0x587b('0x38')]);router[_0x587b('0x35')](_0x587b('0x16'),auth['isAuthenticated'](),controller[_0x587b('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3114b0,_0x3b3ec5,_0x167e23){_0x167e23(null,path['join'](config[_0x587b('0x3a')],'server/files/images/'));},'filename':function(_0x309853,_0x3b3215,_0x587b92){_0x587b92(null,util[_0x587b('0x3b')](_0x587b('0x3c'),Date['now'](),_0x3b3215[_0x587b('0x3d')]));}})});router[_0x587b('0x35')](_0x587b('0x10'),upload[_0x587b('0x3e')](_0x587b('0x3f')),controller['addAvatar']);router[_0x587b('0x35')]('/:id/login',auth[_0x587b('0x9')](),controller[_0x587b('0x40')]);router[_0x587b('0x35')]('/:id/logout',auth['isAuthenticated'](),controller[_0x587b('0x41')]);router['post'](_0x587b('0x42'),auth[_0x587b('0x9')](),controller[_0x587b('0x43')]);router[_0x587b('0x35')](_0x587b('0x44'),auth['isAuthenticated'](),controller[_0x587b('0x45')]);router['post'](_0x587b('0x26'),auth[_0x587b('0x9')](),controller[_0x587b('0x46')]);router[_0x587b('0x35')](_0x587b('0x47'),auth['isAuthenticated'](),controller[_0x587b('0x48')]);router['post'](_0x587b('0x49'),auth['isAuthenticated'](),controller['addMailInteractions']);router['post'](_0x587b('0x4a'),auth['isAuthenticated'](),controller[_0x587b('0x4b')]);router[_0x587b('0x35')](_0x587b('0x4c'),auth[_0x587b('0x9')](),controller[_0x587b('0x4d')]);router['post'](_0x587b('0x4e'),auth['isAuthenticated'](),controller[_0x587b('0x4f')]);router['post']('/:id/whatsapp_interactions',auth[_0x587b('0x9')](),controller[_0x587b('0x50')]);router[_0x587b('0x35')]('/:id/fax_accounts',auth[_0x587b('0x9')](),controller[_0x587b('0x51')]);router[_0x587b('0x35')](_0x587b('0x2a'),auth['isAuthenticated'](),controller[_0x587b('0x52')]);router['post']('/:id/openchannel_accounts',auth[_0x587b('0x9')](),controller[_0x587b('0x53')]);router[_0x587b('0x35')](_0x587b('0x2d'),auth[_0x587b('0x9')](),controller[_0x587b('0x54')]);router[_0x587b('0x35')](_0x587b('0x2e'),auth['isAuthenticated'](),controller[_0x587b('0x55')]);router[_0x587b('0x35')](_0x587b('0x30'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x587b('0x35')](_0x587b('0x32'),auth[_0x587b('0x9')](),controller[_0x587b('0x56')]);router[_0x587b('0x35')](_0x587b('0x57'),auth[_0x587b('0x9')](),controller[_0x587b('0x58')]);router[_0x587b('0x59')](_0x587b('0xe'),auth[_0x587b('0x9')](),controller['update']);router[_0x587b('0x59')](_0x587b('0x5a'),auth[_0x587b('0x9')](),controller[_0x587b('0x5b')]);router[_0x587b('0x5c')](_0x587b('0x16'),auth[_0x587b('0x9')](),controller[_0x587b('0x5d')]);router[_0x587b('0x5c')](_0x587b('0x26'),auth[_0x587b('0x9')](),controller['removeTeams']);router[_0x587b('0x5c')](_0x587b('0xe'),auth[_0x587b('0x9')](),controller[_0x587b('0x5e')]);router[_0x587b('0x5c')](_0x587b('0x47'),auth[_0x587b('0x9')](),controller[_0x587b('0x5f')]);router[_0x587b('0x5c')](_0x587b('0x49'),auth[_0x587b('0x9')](),controller[_0x587b('0x60')]);router['delete'](_0x587b('0x4a'),auth['isAuthenticated'](),controller[_0x587b('0x61')]);router[_0x587b('0x5c')](_0x587b('0x4c'),auth['isAuthenticated'](),controller[_0x587b('0x62')]);router[_0x587b('0x5c')](_0x587b('0x4e'),auth[_0x587b('0x9')](),controller[_0x587b('0x63')]);router['delete'](_0x587b('0x64'),auth[_0x587b('0x9')](),controller[_0x587b('0x65')]);router[_0x587b('0x5c')]('/:id/fax_accounts',auth[_0x587b('0x9')](),controller['removeFaxAccounts']);router[_0x587b('0x5c')](_0x587b('0x2a'),auth[_0x587b('0x9')](),controller['removeMailAccounts']);router[_0x587b('0x5c')](_0x587b('0x2c'),auth[_0x587b('0x9')](),controller['removeOpenchannelAccounts']);router[_0x587b('0x5c')]('/:id/sms_accounts',auth[_0x587b('0x9')](),controller[_0x587b('0x66')]);router[_0x587b('0x5c')](_0x587b('0x2e'),auth[_0x587b('0x9')](),controller[_0x587b('0x67')]);router[_0x587b('0x5c')](_0x587b('0x30'),auth[_0x587b('0x9')](),controller[_0x587b('0x68')]);router[_0x587b('0x5c')]('/:id/square_projects',auth[_0x587b('0x9')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x587b('0x9')](),controller[_0x587b('0x69')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4c196fe..c56980d 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 _0xa21f=['dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','split','info','shortinfo','inband','rfc2833','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','refuse','uac','fingerprint','certificate','active','passive','actpass','nonat','update','update,nonat','TEXT','get','transport','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify'];(function(_0x5d3975,_0x589a79){var _0x10264d=function(_0xbb34bb){while(--_0xbb34bb){_0x5d3975['push'](_0x5d3975['shift']());}};_0x10264d(++_0x589a79);}(_0xa21f,0x1c7));var _0xfa21=function(_0x40110f,_0x106509){_0x40110f=_0x40110f-0x0;var _0xd384cb=_0xa21f[_0x40110f];return _0xd384cb;};'use strict';var Sequelize=require(_0xfa21('0x0'));var moment=require(_0xfa21('0x1'));var util=require(_0xfa21('0x2'));var _=require('lodash');module[_0xfa21('0x3')]={'name':{'type':Sequelize[_0xfa21('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4aab4c){this[_0xfa21('0x5')](_0xfa21('0x6'),_0x4aab4c);this[_0xfa21('0x5')](_0xfa21('0x7'),_0x4aab4c);},'comment':_0xfa21('0x8')},'fullname':{'type':Sequelize[_0xfa21('0x4')],'allowNull':![],'set':function(_0x21925a){this[_0xfa21('0x5')](_0xfa21('0x9'),_0x21925a);this['setDataValue'](_0xfa21('0xa'),util[_0xfa21('0xb')]('\x22%s\x22\x20<%s>',_0x21925a,this[_0xfa21('0xc')](_0xfa21('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa21('0xe'),'validate':{'isEmail':!![]},'set':function(_0x3a5e51){if(_0x3a5e51){this[_0xfa21('0x5')](_0xfa21('0xe'),_0x3a5e51[_0xfa21('0xf')]());}}},'role':{'type':Sequelize[_0xfa21('0x10')]('admin',_0xfa21('0x11'),_0xfa21('0x12'),_0xfa21('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xfa21('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfa21('0x4')],'defaultValue':_0xfa21('0x14')},'internal':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':![],'unique':_0xfa21('0xd'),'set':function(_0x508f88){this['setDataValue'](_0xfa21('0xd'),_0x508f88);this[_0xfa21('0x5')]('accountcode',_0x508f88);this['setDataValue'](_0xfa21('0xa'),util[_0xfa21('0xb')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xfa21('0x9')),_0x508f88));}},'salt':{'type':Sequelize[_0xfa21('0x4')]},'phone':{'type':Sequelize[_0xfa21('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xfa21('0x4')]},'city':{'type':Sequelize[_0xfa21('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfa21('0x17')]},'voicePause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfa21('0x4')],'defaultValue':_0xfa21('0x18')},'lastPauseAt':{'type':Sequelize[_0xfa21('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![],'defaultValue':_0xfa21('0x19')},'ipaddr':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfa21('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x1a'),_0xfa21('0x11'),_0xfa21('0x1b')),'allowNull':!![],'defaultValue':_0xfa21('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfa21('0x1c')},'callingpres':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x1d'),_0xfa21('0x1e'),_0xfa21('0x1f'),_0xfa21('0x20'),_0xfa21('0x21'),'PROHIB_PASSED_SCREEN',_0xfa21('0x22'),_0xfa21('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![],'defaultValue':_0xfa21('0x24'),'set':function(_0x5145ed){this[_0xfa21('0x5')]('transport',_0x5145ed?_0x5145ed[_0xfa21('0x25')](','):null);},'get':function(){return this[_0xfa21('0xc')]('transport')?this['getDataValue']('transport')[_0xfa21('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xfa21('0x10')]('rfc2833',_0xfa21('0x27'),_0xfa21('0x28'),_0xfa21('0x29'),'auto'),'allowNull':!![],'defaultValue':_0xfa21('0x2a')},'directmedia':{'type':Sequelize[_0xfa21('0x10')]('yes','no','nonat','update',_0xfa21('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![],'defaultValue':_0xfa21('0x2d'),'set':function(_0x55808d){this['setDataValue']('nat',_0x55808d?_0x55808d[_0xfa21('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xfa21('0x2e'))?this['getDataValue']('nat')[_0xfa21('0x26')](','):null;},'comment':_0xfa21('0x2f')},'callgroup':{'type':Sequelize[_0xfa21('0x4')]},'namedcallgroup':{'type':Sequelize[_0xfa21('0x4')]},'pickupgroup':{'type':Sequelize[_0xfa21('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xfa21('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfa21('0x4')]},'disallow':{'type':Sequelize[_0xfa21('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfa21('0x4')],'allowNull':![],'defaultValue':_0xfa21('0x30'),'set':function(_0x60e215){this[_0xfa21('0x5')](_0xfa21('0x31'),_0x60e215?_0x60e215[_0xfa21('0x25')](';'):_0xfa21('0x30'));},'get':function(){return this[_0xfa21('0xc')](_0xfa21('0x31'))?this[_0xfa21('0xc')](_0xfa21('0x31'))[_0xfa21('0x26')](';'):null;},'comment':_0xfa21('0x32')},'autoframing':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![],'set':function(_0x16d27c){this['setDataValue'](_0xfa21('0x33'),_0x16d27c?_0x16d27c['join'](','):null);},'get':function(){return this[_0xfa21('0xc')]('insecure')?this[_0xfa21('0xc')]('insecure')[_0xfa21('0x26')](','):null;},'comment':_0xfa21('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfa21('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfa21('0x10')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![],'defaultValue':_0xfa21('0x35')},'amaflags':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xfa21('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfa21('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfa21('0x10')]('accept',_0xfa21('0x36'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xfa21('0x37'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xfa21('0x2c')},'keepalive':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xfa21('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfa21('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no',_0xfa21('0x38'),_0xfa21('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xfa21('0x3a'),_0xfa21('0x3b'),_0xfa21('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xfa21('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfa21('0x10')](_0xfa21('0x2c'),'no',_0xfa21('0x3d'),_0xfa21('0x3e'),_0xfa21('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfa21('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfa21('0x17')]},'passwordResetAt':{'type':Sequelize[_0xfa21('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfa21('0x40')]},'showWebBar':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0,'set':function(_0x5d392c){this[_0xfa21('0x5')]('showWebBar',_0x5d392c);var _0x146b8c=this[_0xfa21('0x41')]({'plain':!![]});switch(_0x5d392c){case 0x0:case 0x1:var _0x49bb5d=_0x146b8c[_0xfa21('0x42')]?_['isArray'](_0x146b8c['transport'])?_0x146b8c[_0xfa21('0x42')]['join']():_0x146b8c[_0xfa21('0x42')]:_0xfa21('0x24');if(_0x49bb5d===_0xfa21('0x43')){_0x49bb5d='udp';}this[_0xfa21('0x5')](_0xfa21('0x42'),_0x49bb5d);this[_0xfa21('0x5')]('encryption','no');this[_0xfa21('0x5')](_0xfa21('0x44'),null);this[_0xfa21('0x5')](_0xfa21('0x45'),null);this[_0xfa21('0x5')](_0xfa21('0x46'),null);this[_0xfa21('0x5')](_0xfa21('0x47'),null);this[_0xfa21('0x5')](_0xfa21('0x48'),null);this['setDataValue'](_0xfa21('0x49'),null);this[_0xfa21('0x5')](_0xfa21('0x4a'),null);this[_0xfa21('0x5')](_0xfa21('0x4b'),null);this[_0xfa21('0x5')](_0xfa21('0x4c'),'no');break;case 0x2:this['setDataValue'](_0xfa21('0x42'),'wss');this['setDataValue']('encryption',_0xfa21('0x2c'));this[_0xfa21('0x5')](_0xfa21('0x44'),_0xfa21('0x2c'));this['setDataValue'](_0xfa21('0x45'),'yes');this[_0xfa21('0x5')](_0xfa21('0x46'),'yes');this[_0xfa21('0x5')](_0xfa21('0x47'),_0xfa21('0x2c'));this[_0xfa21('0x5')]('dtlsverify','no');this[_0xfa21('0x5')](_0xfa21('0x49'),_0xfa21('0x3c'));this[_0xfa21('0x5')](_0xfa21('0x4a'),_0x146b8c[_0xfa21('0x4a')]||_0xfa21('0x4d'));this[_0xfa21('0x5')](_0xfa21('0x4b'),_0x146b8c['dtlsprivatekey']||_0xfa21('0x4e'));this[_0xfa21('0x5')](_0xfa21('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x35bbd5){this['setDataValue']('permissions',_0x35bbd5?_0x35bbd5[_0xfa21('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0xfa21('0x4f'))?_[_0xfa21('0x50')](this[_0xfa21('0xc')](_0xfa21('0x4f'))[_0xfa21('0x26')](','),function(_0x13f7c0){return parseInt(_0x13f7c0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfa21('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfa21('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfa21('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfa21('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfa21('0x51')],'get':function(){return this[_0xfa21('0xc')](_0xfa21('0x52'))?this[_0xfa21('0xc')](_0xfa21('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfa21('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfa21('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![],'set':function(_0x391cde){if(typeof _0x391cde==='string'){var _0x4617c1=_0x391cde==='1'?!![]:_0x391cde==='0'?![]:_0x391cde==='true'?!![]:_0x391cde===_0xfa21('0x53')?![]:![];this[_0xfa21('0x5')](_0xfa21('0x54'),_0x4617c1);}else{this['setDataValue'](_0xfa21('0x54'),_0x391cde);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x59c57f){this[_0xfa21('0x5')](_0xfa21('0x55'),_0x59c57f);if(_0x59c57f===!![]){this[_0xfa21('0x5')]('blockedAt',moment());this[_0xfa21('0x5')]('loginAttempts',0x0);}else{this[_0xfa21('0x5')](_0xfa21('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xfa21('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xfa21('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xfa21('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xd9f1=['nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','originate','uac','uas','fingerprint','active','passive','actpass','nonat','update,nonat','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','toLowerCase','user','agent','telephone','local','INTEGER','internal','accountcode','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','update','outgoing','force_rport,comedia'];(function(_0x4f08f1,_0x5bf508){var _0x180d43=function(_0x370265){while(--_0x370265){_0x4f08f1['push'](_0x4f08f1['shift']());}};_0x180d43(++_0x5bf508);}(_0xd9f1,0x8e));var _0x1d9f=function(_0x314965,_0x270cbf){_0x314965=_0x314965-0x0;var _0x5f5521=_0xd9f1[_0x314965];return _0x5f5521;};'use strict';var Sequelize=require(_0x1d9f('0x0'));var moment=require(_0x1d9f('0x1'));var util=require('util');var _=require(_0x1d9f('0x2'));module[_0x1d9f('0x3')]={'name':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':![],'unique':_0x1d9f('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2abf49){this[_0x1d9f('0x6')](_0x1d9f('0x5'),_0x2abf49);this['setDataValue'](_0x1d9f('0x7'),_0x2abf49);},'comment':_0x1d9f('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5488be){this[_0x1d9f('0x6')](_0x1d9f('0x9'),_0x5488be);this['setDataValue'](_0x1d9f('0xa'),util['format'](_0x1d9f('0xb'),_0x5488be,this[_0x1d9f('0xc')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x5e5e90){if(_0x5e5e90){this[_0x1d9f('0x6')]('email',_0x5e5e90[_0x1d9f('0xd')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x1d9f('0xe'),_0x1d9f('0xf'),_0x1d9f('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1d9f('0x4')],'defaultValue':_0x1d9f('0x11')},'internal':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4243fc){this[_0x1d9f('0x6')](_0x1d9f('0x13'),_0x4243fc);this['setDataValue'](_0x1d9f('0x14'),_0x4243fc);this[_0x1d9f('0x6')](_0x1d9f('0xa'),util[_0x1d9f('0x15')]('\x22%s\x22\x20<%s>',this[_0x1d9f('0xc')](_0x1d9f('0x9')),_0x4243fc));}},'salt':{'type':Sequelize[_0x1d9f('0x4')]},'phone':{'type':Sequelize[_0x1d9f('0x4')]},'mobile':{'type':Sequelize[_0x1d9f('0x4')]},'address':{'type':Sequelize[_0x1d9f('0x4')]},'zipcode':{'type':Sequelize[_0x1d9f('0x4')]},'userpic':{'type':Sequelize[_0x1d9f('0x4')]},'city':{'type':Sequelize[_0x1d9f('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1d9f('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1d9f('0x4')],'defaultValue':_0x1d9f('0x18')},'lastPauseAt':{'type':Sequelize[_0x1d9f('0x17')]},'chatCapacity':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x1d9f('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1d9f('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'defaultValue':_0x1d9f('0x19')},'ipaddr':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x1d9f('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x1b'),'user',_0x1d9f('0x1c')),'allowNull':!![],'defaultValue':_0x1d9f('0x1b')},'context':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'defaultValue':_0x1d9f('0x1d')},'callingpres':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x1e'),_0x1d9f('0x1f'),_0x1d9f('0x20'),_0x1d9f('0x21'),_0x1d9f('0x22'),_0x1d9f('0x23'),_0x1d9f('0x24'),_0x1d9f('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x22c735){this[_0x1d9f('0x6')](_0x1d9f('0x26'),_0x22c735?_0x22c735[_0x1d9f('0x27')](','):null);},'get':function(){return this[_0x1d9f('0xc')](_0x1d9f('0x26'))?this[_0x1d9f('0xc')](_0x1d9f('0x26'))[_0x1d9f('0x28')](','):null;},'comment':_0x1d9f('0x29')},'dtmfmode':{'type':Sequelize['ENUM'](_0x1d9f('0x2a'),_0x1d9f('0x2b'),'shortinfo',_0x1d9f('0x2c'),_0x1d9f('0x2d')),'allowNull':!![],'defaultValue':_0x1d9f('0x2a')},'directmedia':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no','nonat',_0x1d9f('0x2f'),_0x1d9f('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'defaultValue':_0x1d9f('0x31'),'set':function(_0x521daf){this[_0x1d9f('0x6')](_0x1d9f('0x32'),_0x521daf?_0x521daf[_0x1d9f('0x27')](','):null);},'get':function(){return this[_0x1d9f('0xc')](_0x1d9f('0x32'))?this[_0x1d9f('0xc')](_0x1d9f('0x32'))[_0x1d9f('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1d9f('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x1d9f('0x4')]},'language':{'type':Sequelize[_0x1d9f('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1d9f('0x4')]},'disallow':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':![],'defaultValue':_0x1d9f('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1d9f('0x34'),'set':function(_0xa6f32c){this['setDataValue'](_0x1d9f('0x35'),_0xa6f32c?_0xa6f32c[_0x1d9f('0x27')](';'):_0x1d9f('0x34'));},'get':function(){return this[_0x1d9f('0xc')]('allow')?this[_0x1d9f('0xc')](_0x1d9f('0x35'))['split'](';'):null;},'comment':_0x1d9f('0x36')},'autoframing':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'set':function(_0x42ae97){this['setDataValue'](_0x1d9f('0x37'),_0x42ae97?_0x42ae97['join'](','):null);},'get':function(){return this['getDataValue'](_0x1d9f('0x37'))?this['getDataValue'](_0x1d9f('0x37'))['split'](','):null;},'comment':_0x1d9f('0x38')},'trustrpid':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no',_0x1d9f('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![],'defaultValue':_0x1d9f('0x3a')},'amaflags':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x1d9f('0x2e')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1d9f('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1d9f('0x1a')]('yes','no',_0x1d9f('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1d9f('0x1a')]('accept','refuse',_0x1d9f('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x3d'),_0x1d9f('0x3e')),'allowNull':!![],'defaultValue':_0x1d9f('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x1d9f('0x2e')},'keepalive':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1d9f('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1d9f('0x1a')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no',_0x1d9f('0x3f'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x40'),_0x1d9f('0x41'),_0x1d9f('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1d9f('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1d9f('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1d9f('0x1a')](_0x1d9f('0x2e'),'no',_0x1d9f('0x43'),'update',_0x1d9f('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x1d9f('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0,'set':function(_0x3f4ffc){this[_0x1d9f('0x6')](_0x1d9f('0x45'),_0x3f4ffc);var _0x382007=this[_0x1d9f('0x46')]({'plain':!![]});switch(_0x3f4ffc){case 0x0:case 0x1:var _0x5e0d7e=_0x382007['transport']?_[_0x1d9f('0x47')](_0x382007['transport'])?_0x382007[_0x1d9f('0x26')][_0x1d9f('0x27')]():_0x382007[_0x1d9f('0x26')]:'udp';if(_0x5e0d7e===_0x1d9f('0x48')){_0x5e0d7e=_0x1d9f('0x49');}this['setDataValue']('transport',_0x5e0d7e);this['setDataValue'](_0x1d9f('0x4a'),'no');this[_0x1d9f('0x6')](_0x1d9f('0x4b'),null);this[_0x1d9f('0x6')](_0x1d9f('0x4c'),null);this[_0x1d9f('0x6')]('icesupport',null);this['setDataValue'](_0x1d9f('0x4d'),null);this[_0x1d9f('0x6')](_0x1d9f('0x4e'),null);this[_0x1d9f('0x6')](_0x1d9f('0x4f'),null);this[_0x1d9f('0x6')](_0x1d9f('0x50'),null);this[_0x1d9f('0x6')](_0x1d9f('0x51'),null);this[_0x1d9f('0x6')](_0x1d9f('0x52'),'no');break;case 0x2:this['setDataValue'](_0x1d9f('0x26'),_0x1d9f('0x48'));this[_0x1d9f('0x6')](_0x1d9f('0x4a'),_0x1d9f('0x2e'));this[_0x1d9f('0x6')]('avpf',_0x1d9f('0x2e'));this['setDataValue'](_0x1d9f('0x4c'),_0x1d9f('0x2e'));this['setDataValue'](_0x1d9f('0x53'),_0x1d9f('0x2e'));this[_0x1d9f('0x6')]('dtlsenable',_0x1d9f('0x2e'));this[_0x1d9f('0x6')](_0x1d9f('0x4e'),'no');this['setDataValue'](_0x1d9f('0x4f'),_0x1d9f('0x42'));this[_0x1d9f('0x6')]('dtlscertfile',_0x382007['dtlscertfile']||_0x1d9f('0x54'));this[_0x1d9f('0x6')]('dtlsprivatekey',_0x382007[_0x1d9f('0x51')]||_0x1d9f('0x55'));this['setDataValue']('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x1d9f('0x56')],'set':function(_0x182e45){this[_0x1d9f('0x6')](_0x1d9f('0x57'),_0x182e45?_0x182e45['join'](','):[]);},'get':function(){return this[_0x1d9f('0xc')](_0x1d9f('0x57'))?_[_0x1d9f('0x58')](this[_0x1d9f('0xc')](_0x1d9f('0x57'))[_0x1d9f('0x28')](','),function(_0x361f28){return parseInt(_0x361f28,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1d9f('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1d9f('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1d9f('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1d9f('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x1d9f('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1d9f('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1d9f('0x59')],'get':function(){return this[_0x1d9f('0xc')](_0x1d9f('0x5a'))?this[_0x1d9f('0xc')](_0x1d9f('0x5a')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1d9f('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1d9f('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xfbca31){if(typeof _0xfbca31===_0x1d9f('0x5b')){var _0x7e12c3=_0xfbca31==='1'?!![]:_0xfbca31==='0'?![]:_0xfbca31==='true'?!![]:_0xfbca31===_0x1d9f('0x5c')?![]:![];this[_0x1d9f('0x6')](_0x1d9f('0x5d'),_0x7e12c3);}else{this[_0x1d9f('0x6')](_0x1d9f('0x5d'),_0xfbca31);}}},'blocked':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![],'set':function(_0x56f22c){this['setDataValue']('blocked',_0x56f22c);if(_0x56f22c===!![]){this[_0x1d9f('0x6')]('blockedAt',moment());this['setDataValue'](_0x1d9f('0x5e'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x1d9f('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1d9f('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x1d9f('0x5f')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1d9f('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 035cb25..9128558 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 _0x650f=['getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','LOGININPAUSE','resolve','logout','pause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','QueuePause','unpause','manual','set','%s%s','Pause','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','Queue:save','VoicePrefixId','removeTeams','getMailQueues','Fax','UserVoicePrefix','getLists','getAgents','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','queues','teams','inbound','col','desc','asc','substring','uniqBy','result','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','bluebird','path','lodash','jayson/promise','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','offset','Content-Range','update','role','admin','Users','user','Agents','agent','Telephones','ignore','map','value','find','UserProfileResource','destroy','stack','name','send','User','rawAttributes','fieldName','type','key','filter','includes','password','salt','where','count','includeAll','query','true','include','UserSetting','userSetting','attributes','push','rows','openTabs','chat','sms','dataValues','mail','whatsapp','all','params','model','keys','filters','intersection','fields','length','merge','options','fax','body','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','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','105','106','108','109','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','findAll','userProfileId','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','previousPasswords','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','emit','VoiceQueue','get','voice','online','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','QueueId','addAvatar','file','filename','getAvatar','join','userpic','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','concat','getContacts','order','sort','hasOwnProperty','CmList','List','Tag','color','tag','nolimit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction'];(function(_0xa957b6,_0x5c5808){var _0x4ee7f5=function(_0x3c2717){while(--_0x3c2717){_0xa957b6['push'](_0xa957b6['shift']());}};_0x4ee7f5(++_0x5c5808);}(_0x650f,0xb8));var _0xf650=function(_0x37d9eb,_0x1b6708){_0x37d9eb=_0x37d9eb-0x0;var _0x2c9240=_0x650f[_0x37d9eb];return _0x2c9240;};'use strict';var moment=require('moment');var BPromise=require(_0xf650('0x0'));var util=require('util');var path=require(_0xf650('0x1'));var fs=require('fs');var _=require(_0xf650('0x2'));var squel=require('squel');var jayson=require(_0xf650('0x3'));var Redis=require(_0xf650('0x4'));var authService=require(_0xf650('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf650('0x6'));var utils=require(_0xf650('0x7'));var config=require(_0xf650('0x8'));var licenseUtil=require('../../config/license/util');var db=require(_0xf650('0x9'))['db'];var socket=require(_0xf650('0xa'))(new Redis(config[_0xf650('0xb')]));require('./user.socket')[_0xf650('0xc')](socket);config[_0xf650('0xb')]=_[_0xf650('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x5d49bf,_0x252d63,_0x18638a,_0x10a39c){return new BPromise(function(_0x3ea899,_0x51db03){var _0x21d1c7=_0x10a39c||client;return _0x21d1c7[_0xf650('0xe')](_0x5d49bf,_0x18638a)[_0xf650('0xf')](function(_0x5214a1){logger[_0xf650('0x10')](_0xf650('0x11'),_0x252d63,'request\x20sent');logger[_0xf650('0x12')](_0xf650('0x13'),_0x252d63,_0xf650('0x14'),JSON[_0xf650('0x15')](_0x5214a1));if(_0x5214a1['error']){if(_0x5214a1[_0xf650('0x16')][_0xf650('0x17')]===0x1f4){logger[_0xf650('0x16')](_0xf650('0x11'),_0x252d63,_0x5214a1[_0xf650('0x16')][_0xf650('0x18')]);return _0x51db03(_0x5214a1[_0xf650('0x16')][_0xf650('0x18')]);}logger[_0xf650('0x16')](_0xf650('0x11'),_0x252d63,_0x5214a1[_0xf650('0x16')]['message']);return _0x3ea899(_0x5214a1[_0xf650('0x16')][_0xf650('0x18')]);}else{logger[_0xf650('0x10')](_0xf650('0x11'),_0x252d63,_0xf650('0x14'));_0x3ea899(_0x5214a1['result'][_0xf650('0x18')]);}})[_0xf650('0x19')](function(_0x4ce80b){logger[_0xf650('0x16')](_0xf650('0x11'),_0x252d63,_0x4ce80b);_0x51db03(_0x4ce80b);});});}function respondWithStatusCode(_0x467dda,_0xc9d401){_0xc9d401=_0xc9d401||0xcc;return function(_0x354281){if(_0x354281){return _0x467dda[_0xf650('0x1a')](_0xc9d401);}return _0x467dda[_0xf650('0x1b')](_0xc9d401)[_0xf650('0x1c')]();};}function respondWithResult(_0x24c67c,_0x5af9a5){_0x5af9a5=_0x5af9a5||0xc8;return function(_0x2f5b4d){if(_0x2f5b4d){return _0x24c67c[_0xf650('0x1b')](_0x5af9a5)[_0xf650('0x1d')](_0x2f5b4d);}};}function respondWithFilteredResult(_0x510921,_0x15ff1e){return function(_0x1dad18){if(_0x1dad18){var _0x261db5=typeof _0x15ff1e['offset']===_0xf650('0x1e')&&typeof _0x15ff1e[_0xf650('0x1f')]===_0xf650('0x1e');var _0x1ced70=_0x1dad18['count'];var _0x320b1a=_0x261db5?0x0:_0x15ff1e[_0xf650('0x20')];var _0x878311=_0x261db5?_0x1dad18['count']:_0x15ff1e[_0xf650('0x20')]+_0x15ff1e['limit'];var _0x11aa01;if(_0x878311>=_0x1ced70){_0x878311=_0x1ced70;_0x11aa01=0xc8;}else{_0x11aa01=0xce;}_0x510921[_0xf650('0x1b')](_0x11aa01);return _0x510921['set'](_0xf650('0x21'),_0x320b1a+'-'+_0x878311+'/'+_0x1ced70)[_0xf650('0x1d')](_0x1dad18);}return null;};}function saveUpdates(_0x5e0887){return function(_0x516960){if(_0x516960){return _0x516960[_0xf650('0x22')](_0x5e0887)[_0xf650('0xf')](function(_0x4b83b9){return _0x4b83b9;});}return null;};}function removeEntity(_0x91dd47){return function(_0x1a619f){if(_0x1a619f){return _0x1a619f['destroy']()[_0xf650('0xf')](function(){var _0x1ea350=_0x1a619f['get']({'plain':!![]});if(_0x1ea350[_0xf650('0x23')]===_0xf650('0x24'))return;var _0x2ae671=[{'name':_0xf650('0x25'),'value':_0xf650('0x26'),'ignore':!![]},{'name':_0xf650('0x27'),'value':_0xf650('0x28'),'ignore':![]},{'name':_0xf650('0x29'),'value':'telephone','ignore':![]}];var _0x43917e=_(_0x2ae671)['filter'](_0xf650('0x2a'))[_0xf650('0x2b')](_0xf650('0x2c'))[_0xf650('0x2c')]();if(_['includes'](_0x43917e,_0x1ea350[_0xf650('0x23')])){return;}var _0x12b035=_[_0xf650('0x2d')](_0x2ae671,[_0xf650('0x2c'),_0x1ea350['role']])['name'];return db[_0xf650('0x2e')][_0xf650('0x2f')]({'where':{'type':_0x12b035,'resourceId':_0x1ea350['id']}})[_0xf650('0xf')](function(){return _0x1a619f;});})['then'](function(){_0x91dd47[_0xf650('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48cb41){return function(_0x34fea0){if(!_0x34fea0){_0x48cb41['sendStatus'](0x194);}return _0x34fea0;};}function handleError(_0xf27765,_0x556d30){_0x556d30=_0x556d30||0x1f4;return function(_0x4af491){logger[_0xf650('0x16')](_0x4af491[_0xf650('0x30')]);if(_0x4af491['name']){delete _0x4af491[_0xf650('0x31')];}_0xf27765[_0xf650('0x1b')](_0x556d30)[_0xf650('0x32')](_0x4af491);};}exports['index']=function(_0x18a537,_0x576185){var _0x2aa49a={},_0x55b420={'count':0x0,'rows':[]};var _0x4a318f=_(db[_0xf650('0x33')][_0xf650('0x34')])['map'](function(_0xaf7576){return{'name':_0xaf7576[_0xf650('0x35')],'type':_0xaf7576[_0xf650('0x36')][_0xf650('0x37')]};})[_0xf650('0x38')](function(_0x240926){return!_[_0xf650('0x39')]([_0xf650('0x3a'),_0xf650('0x3b')],_0x240926[_0xf650('0x31')]);})[_0xf650('0x2c')]();_0x2aa49a=qs['getOptions'](_0x4a318f,_0x18a537);var _0x2f53b4={'where':_0x2aa49a[_0xf650('0x3c')]};return db[_0xf650('0x33')]['count'](_0x2f53b4)[_0xf650('0xf')](function(_0x2ea645){_0x55b420[_0xf650('0x3d')]=_0x2ea645;if(_0x18a537['query'][_0xf650('0x3e')]){_0x2aa49a['include']=[{'all':!![]}];}if(_0x18a537[_0xf650('0x3f')]['userSetting']===_0xf650('0x40')){_0x2aa49a[_0xf650('0x41')]=[{'model':db[_0xf650('0x42')],'as':_0xf650('0x43')}];}if(!_[_0xf650('0x39')](_0x2aa49a[_0xf650('0x44')],'id')){_0x2aa49a[_0xf650('0x44')][_0xf650('0x45')]('id');}return db[_0xf650('0x33')]['findAll'](_0x2aa49a);})[_0xf650('0xf')](function(_0x269409){_0x55b420[_0xf650('0x46')]=_0x269409;if(_0x18a537['query'][_0xf650('0x47')]===_0xf650('0x40')){var _0x32f856=[];for(var _0x485483=0x0;_0x485483<_0x55b420[_0xf650('0x46')]['length'];_0x485483++){_0x32f856[_0xf650('0x45')](get_open_tabs(_0xf650('0x48'),_0x55b420[_0xf650('0x46')][_0x485483]['dataValues']));_0x32f856[_0xf650('0x45')](get_open_tabs(_0xf650('0x49'),_0x55b420[_0xf650('0x46')][_0x485483]['dataValues']));_0x32f856[_0xf650('0x45')](get_open_tabs('fax',_0x55b420['rows'][_0x485483][_0xf650('0x4a')]));_0x32f856[_0xf650('0x45')](get_open_tabs(_0xf650('0x4b'),_0x55b420['rows'][_0x485483][_0xf650('0x4a')]));_0x32f856[_0xf650('0x45')](get_open_tabs('openchannel',_0x55b420[_0xf650('0x46')][_0x485483]['dataValues']));_0x32f856['push'](get_open_tabs(_0xf650('0x4c'),_0x55b420['rows'][_0x485483][_0xf650('0x4a')]));}return BPromise[_0xf650('0x4d')](_0x32f856)[_0xf650('0xf')](function(){return _0x55b420;});}else{return _0x55b420;}})[_0xf650('0xf')](respondWithFilteredResult(_0x576185,_0x2aa49a))[_0xf650('0x19')](handleError(_0x576185,null));};exports['show']=function(_0x2a1f94,_0x3b9a62){var _0x5c54d4={'raw':![],'where':{'id':_0x2a1f94[_0xf650('0x4e')]['id']}},_0x4676a5={};_0x4676a5[_0xf650('0x4f')]=_['differenceBy'](_[_0xf650('0x50')](db['User']['rawAttributes']),[_0xf650('0x3a'),_0xf650('0x3b')]);_0x4676a5[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x2a1f94[_0xf650('0x3f')]);_0x4676a5[_0xf650('0x51')]=_[_0xf650('0x52')](_0x4676a5[_0xf650('0x4f')],_0x4676a5['query']);_0x5c54d4[_0xf650('0x44')]=_[_0xf650('0x52')](_0x4676a5[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x2a1f94[_0xf650('0x3f')][_0xf650('0x53')]));_0x5c54d4[_0xf650('0x44')]=_0x5c54d4[_0xf650('0x44')][_0xf650('0x54')]?_0x5c54d4[_0xf650('0x44')]:_0x4676a5[_0xf650('0x4f')];if(_0x2a1f94[_0xf650('0x3f')][_0xf650('0x3e')]){_0x5c54d4[_0xf650('0x41')]=[{'all':!![]}];}if(_0x2a1f94['query'][_0xf650('0x43')]===_0xf650('0x40')){_0x5c54d4[_0xf650('0x41')]=[{'model':db[_0xf650('0x42')],'as':_0xf650('0x43')}];}_0x5c54d4=_[_0xf650('0x55')]({},_0x5c54d4,_0x2a1f94[_0xf650('0x56')]);if(!_[_0xf650('0x39')](_0x5c54d4[_0xf650('0x44')],'id')){_0x5c54d4[_0xf650('0x44')][_0xf650('0x45')]('id');}return db[_0xf650('0x33')][_0xf650('0x2d')](_0x5c54d4)['then'](handleEntityNotFound(_0x3b9a62,null))[_0xf650('0xf')](function(_0x5be5fe){var _0x26a063=[];values=_0x5be5fe;if(_0x2a1f94['query'][_0xf650('0x47')]==='true'){_0x26a063['push'](get_open_tabs(_0xf650('0x48'),_0x5be5fe['dataValues']));_0x26a063['push'](get_open_tabs('sms',_0x5be5fe[_0xf650('0x4a')]));_0x26a063[_0xf650('0x45')](get_open_tabs('openchannel',_0x5be5fe[_0xf650('0x4a')]));_0x26a063['push'](get_open_tabs('whatsapp',_0x5be5fe['dataValues']));_0x26a063[_0xf650('0x45')](get_open_tabs(_0xf650('0x57'),_0x5be5fe[_0xf650('0x4a')]));_0x26a063[_0xf650('0x45')](get_open_tabs(_0xf650('0x4b'),_0x5be5fe[_0xf650('0x4a')]));return BPromise['all'](_0x26a063);}else{return values;}})[_0xf650('0xf')](function(){return values;})['then'](respondWithResult(_0x3b9a62,null))['catch'](handleError(_0x3b9a62,null));};exports[_0xf650('0x22')]=function(_0x5637a0,_0x131fd3){if(_0x5637a0[_0xf650('0x58')]['id']){delete _0x5637a0[_0xf650('0x58')]['id'];}delete _0x5637a0['body'][_0xf650('0x23')];return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x5637a0['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x131fd3,null))[_0xf650('0xf')](saveUpdates(_0x5637a0[_0xf650('0x58')],null))['then'](respondWithResult(_0x131fd3,null))[_0xf650('0x19')](handleError(_0x131fd3,null));};exports[_0xf650('0x59')]=function(_0x509f58,_0x50b013){return db[_0xf650('0x33')][_0xf650('0x59')]()[_0xf650('0xf')](respondWithResult(_0x50b013,null))['catch'](handleError(_0x50b013,null));};exports[_0xf650('0x5a')]=function(_0x3908a5,_0x14af8e){return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x3908a5['params']['id']}})['then'](handleEntityNotFound(_0x14af8e,null))[_0xf650('0xf')](function(_0x1208e0){if(_0x1208e0){return _0x1208e0[_0xf650('0x5a')](_0x3908a5['body'][_0xf650('0x5b')],_[_0xf650('0x5c')](_0x3908a5[_0xf650('0x58')],[_0xf650('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x14af8e,null))['catch'](handleError(_0x14af8e,null));};function validateUser(_0x1151a8){return new BPromise(function(_0x453de2,_0x2458af){if(_0x1151a8[_0xf650('0x5d')])return _0x453de2(_0x1151a8);return db[_0xf650('0x5e')][_0xf650('0x5f')](0x1)[_0xf650('0xf')](function(_0x4c509b){if(_0x4c509b[_0xf650('0x60')])authService[_0xf650('0x61')](_0x1151a8[_0xf650('0x3a')]);db[_0xf650('0x33')][_0xf650('0x62')](_0xf650('0x5d'))[_0xf650('0xf')](function(_0x4c4846){if(_[_0xf650('0x63')](_0x4c4846)){_0x1151a8[_0xf650('0x5d')]=_0x4c509b[_0xf650('0x64')]||0x1;return;}if(_[_0xf650('0x63')](_0x4c509b[_0xf650('0x64')])||_0x4c509b[_0xf650('0x64')]===_0x4c4846){_0x1151a8['internal']=_0x4c4846+0x1;return;}if(_0x4c509b[_0xf650('0x64')]>_0x4c4846){_0x1151a8['internal']=_0x4c509b[_0xf650('0x64')];return;}return db[_0xf650('0x65')]['query'](_0xf650('0x66'),{'type':db[_0xf650('0x65')][_0xf650('0x67')][_0xf650('0x68')]})[_0xf650('0xf')](function(_0x531cfe){if(_0x531cfe&&_0x531cfe[_0xf650('0x54')]){for(var _0x4dab2c=0x0,_0x1315af=_0x531cfe['length'];_0x4dab2c<_0x1315af&&_[_0xf650('0x63')](_0x1151a8[_0xf650('0x5d')]);_0x4dab2c++){if(_0x4c509b[_0xf650('0x64')]<=_0x531cfe[_0x4dab2c][_0xf650('0x69')]){_0x1151a8[_0xf650('0x5d')]=_0x531cfe[_0x4dab2c][_0xf650('0x69')];}else if(_0x4c509b[_0xf650('0x64')]>_0x531cfe[_0x4dab2c][_0xf650('0x69')]&&_0x4c509b[_0xf650('0x64')]<=_0x531cfe[_0x4dab2c]['to']){_0x1151a8[_0xf650('0x5d')]=_0x4c509b[_0xf650('0x64')];}}}if(_['isNil'](_0x1151a8[_0xf650('0x5d')])){_0x1151a8[_0xf650('0x5d')]=_0x4c4846+0x1;}return _0x453de2(_0x1151a8);});});})[_0xf650('0x19')](function(_0x1dccff){_0x2458af(_0x1dccff);});});}function updateUser(_0x1e975f){return new BPromise(function(_0x532e75,_0x3340be){try{if(_0x1e975f[_0xf650('0x6a')]){_0x1e975f[_0xf650('0x6b')]=_0x1e975f[_0xf650('0x5d')];_0x1e975f[_0xf650('0x6c')]={'mailbox':_0x1e975f[_0xf650('0x5d')],'password':_0x1e975f['password'],'fullname':_0x1e975f[_0xf650('0x6d')],'email':_0x1e975f[_0xf650('0x6e')]};}if(_0x1e975f[_0xf650('0x23')]===_0xf650('0x28')){if(!_0x1e975f['permissions'])_0x1e975f[_0xf650('0x6f')]=[_0xf650('0x70'),'102',_0xf650('0x71'),_0xf650('0x72'),'110','104',_0xf650('0x73'),_0xf650('0x74'),'107',_0xf650('0x75'),_0xf650('0x76'),_0xf650('0x77'),_0xf650('0x78'),'114',_0xf650('0x79')];}_0x532e75(_0x1e975f);}catch(_0x2ee484){_0x3340be(_0x2ee484);}});}exports[_0xf650('0x7a')]=function(_0x51f6d7,_0x36e3c2){if(_0x51f6d7[_0xf650('0x26')][_0xf650('0x23')]===_0xf650('0x28'))throw new Error(_0xf650('0x7b'));if(_0x51f6d7['body'][_0xf650('0x23')]==='user'&&_0x51f6d7[_0xf650('0x26')][_0xf650('0x23')]!==_0xf650('0x24')){throw new Error(_0xf650('0x7c'));}if(_0x51f6d7['body']['role']==='admin'&&_0x51f6d7[_0xf650('0x26')]['role']!==_0xf650('0x24')){throw new Error(_0xf650('0x7d'));}return licenseUtil[_0xf650('0x7e')]([_0x51f6d7[_0xf650('0x58')]])[_0xf650('0xf')](function(){return validateUser(_0x51f6d7[_0xf650('0x58')]);})[_0xf650('0xf')](function(_0x24706f){return updateUser(_0x24706f)['then'](function(_0x9b4d5f){if(_0x9b4d5f[_0xf650('0x23')]==='admin'){_0x9b4d5f[_0xf650('0x7f')]=_0x51f6d7[_0xf650('0x26')][_0xf650('0x7f')];delete _0x9b4d5f['userProfileId'];}return _0x9b4d5f;});})['then'](function(_0x28a575){return db['User']['create'](_0x28a575,{'include':[{'model':db[_0xf650('0x6c')],'as':'VoiceMail'}]});})[_0xf650('0xf')](function(_0x5bf4b0){if(_0x51f6d7[_0xf650('0x58')][_0xf650('0x23')]===_0xf650('0x26'))return _0x5bf4b0;if(_0x51f6d7[_0xf650('0x26')][_0xf650('0x23')]!==_0xf650('0x26'))return _0x5bf4b0;return db[_0xf650('0x80')][_0xf650('0x2d')]({'where':{'name':_0x5bf4b0[_0xf650('0x23')]===_0xf650('0x28')?'Agents':_0xf650('0x29'),'userProfileId':_0x51f6d7[_0xf650('0x26')]['userProfileId']},'raw':!![]})[_0xf650('0xf')](function(_0x4c9045){if(!_0x4c9045||_0x4c9045[_0xf650('0x81')]!=0x0)return _0x5bf4b0;return db[_0xf650('0x2e')][_0xf650('0x7a')]({'name':_0x5bf4b0[_0xf650('0x31')],'resourceId':_0x5bf4b0['id'],'type':_0x4c9045[_0xf650('0x31')],'sectionId':_0x4c9045['id']},{})[_0xf650('0xf')](function(){return _0x5bf4b0;});})[_0xf650('0x19')](function(_0x1edb7e){logger[_0xf650('0x16')](_0xf650('0x82'),_0x1edb7e);throw _0x1edb7e;});})['then'](respondWithResult(_0x36e3c2,0xc9))[_0xf650('0x19')](handleError(_0x36e3c2,null));};exports['bulkCreate']=function(_0x3e7f63,_0x57adf9){var _0x1ae81f=_0x3e7f63['body'];var _0xb9c1c2=[];if(_0x3e7f63['user'][_0xf650('0x23')]===_0xf650('0x28'))throw new Error(_0xf650('0x7b'));if(_[_0xf650('0x83')](_0x1ae81f,[_0xf650('0x23'),_0xf650('0x26')])&&_0x3e7f63[_0xf650('0x26')][_0xf650('0x23')]!=='admin'){throw new Error(_0xf650('0x7c'));}if(_['some'](_0x1ae81f,[_0xf650('0x23'),_0xf650('0x24')])&&_0x3e7f63[_0xf650('0x26')][_0xf650('0x23')]!=='admin'){throw new Error(_0xf650('0x84'));}return licenseUtil['checkUserLimits'](_0x1ae81f)[_0xf650('0xf')](function(){return validateUser(_0x1ae81f[0x0]);})['then'](function(){for(var _0x42102a=0x1;_0x42102a<_0x1ae81f[_0xf650('0x54')];_0x42102a++){var _0x336972=_0x1ae81f[_0x42102a-0x1][_0xf650('0x5d')];if(!_0x1ae81f[_0x42102a][_0xf650('0x5d')])_0x1ae81f[_0x42102a][_0xf650('0x5d')]=_0x336972+0x1;_0xb9c1c2['push'](validateUser(_0x1ae81f[_0x42102a]));}return BPromise[_0xf650('0x4d')](_0xb9c1c2);})[_0xf650('0xf')](function(){_0xb9c1c2=[];for(var _0x3f9137=0x0;_0x3f9137<_0x1ae81f[_0xf650('0x54')];_0x3f9137++){_0xb9c1c2[_0xf650('0x45')](updateUser(_0x1ae81f[_0x3f9137]));}return BPromise['all'](_0xb9c1c2);})['then'](function(){return BPromise[_0xf650('0x85')](_0x1ae81f,function(_0x5a47b9){return db['User'][_0xf650('0x7a')](_0x5a47b9,{'include':[{'model':db[_0xf650('0x6c')],'as':_0xf650('0x6c')}]})['then'](function(_0x2c1168){_0x5a47b9['id']=_0x2c1168['id'];return _0x5a47b9;});});})['then'](function(_0x3766a8){if(_0x3e7f63[_0xf650('0x58')][_0xf650('0x23')]===_0xf650('0x26'))return _0x3766a8;if(_0x3e7f63[_0xf650('0x26')][_0xf650('0x23')]!=='user')return _0x3766a8;var _0x7ae6f2=_['some'](_0x3766a8,function(_0x5e88db){return _0x5e88db['role']===_0xf650('0x28')||_0x5e88db[_0xf650('0x23')]===_0xf650('0x86');});if(!_0x7ae6f2)return _0x3766a8;return db['UserProfileSection'][_0xf650('0x87')]({'where':{'name':{'$or':[_0xf650('0x27'),_0xf650('0x29')]},'userProfileId':_0x3e7f63[_0xf650('0x26')][_0xf650('0x88')]},'raw':!![]})[_0xf650('0xf')](function(_0x2de37a){if(_[_0xf650('0x89')](_0x2de37a)||!_[_0xf650('0x83')](_0x2de37a,[_0xf650('0x81'),0x0]))return _0x3766a8;_0xb9c1c2=[];var _0x5c98da=_(_0x2de37a)[_0xf650('0x2b')](function(_0x1d4975){if(_0x1d4975[_0xf650('0x81')]===0x1)return;return _0x1d4975[_0xf650('0x31')]==='Agents'?'agent':'telephone';})[_0xf650('0x8a')]()[_0xf650('0x2c')]();for(var _0x26d7b8=0x0;_0x26d7b8<_0x3766a8[_0xf650('0x54')];_0x26d7b8++){if(!_[_0xf650('0x39')](_0x5c98da,_0x3766a8[_0x26d7b8][_0xf650('0x23')]))return;var _0xe490dc=_0x3766a8[_0x26d7b8]['role']==='agent'?_0xf650('0x27'):'Telephones';_0xb9c1c2[_0xf650('0x45')](db[_0xf650('0x2e')]['create']({'name':_0x3766a8[_0x26d7b8]['name'],'resourceId':_0x3766a8[_0x26d7b8]['id'],'type':_0xe490dc,'sectionId':_['find'](_0x2de37a,['name',_0xe490dc])['id']},{}));}return BPromise[_0xf650('0x4d')](_0xb9c1c2);});})[_0xf650('0xf')](respondWithResult(_0x57adf9,0xc9))['catch'](handleError(_0x57adf9,null));};exports[_0xf650('0x8b')]=function(_0x160cc7,_0x535e5a){if(_0x160cc7[_0xf650('0x58')]['id']){delete _0x160cc7[_0xf650('0x58')]['id'];}return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x160cc7['params']['id']}})[_0xf650('0xf')](function(_0x24c1ac){if(!_0x24c1ac)return null;if(_0x24c1ac['id']===_0x160cc7[_0xf650('0x26')]['id']){if(!_0x160cc7[_0xf650('0x58')][_0xf650('0x8c')]||!_0x160cc7['body'][_0xf650('0x8d')]){throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x24c1ac[_0xf650('0x90')](_0x160cc7[_0xf650('0x58')]['oldPassword'])){throw new db[(_0xf650('0x8e'))]['ValidationError'](_0xf650('0x91'));}if(_0x160cc7[_0xf650('0x58')][_0xf650('0x8c')]===_0x160cc7[_0xf650('0x58')][_0xf650('0x8d')]){throw new db[(_0xf650('0x8e'))]['ValidationError'](_0xf650('0x92'));}}else if(_0x160cc7[_0xf650('0x26')][_0xf650('0x23')]===_0xf650('0x24')){if(!_0x160cc7[_0xf650('0x58')][_0xf650('0x8d')]){throw new db['Sequelize'][(_0xf650('0x8f'))](_0xf650('0x93'));}}else if(_0x160cc7[_0xf650('0x26')][_0xf650('0x23')]===_0xf650('0x26')){if(!_0x160cc7['body'][_0xf650('0x8d')]){throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))](_0xf650('0x93'));}if(_0x24c1ac[_0xf650('0x23')]!==_0xf650('0x28')){throw new db['Sequelize'][(_0xf650('0x8f'))](_0xf650('0x7b'));}}else{throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))](_0xf650('0x7b'));}return _0x24c1ac;})[_0xf650('0xf')](handleEntityNotFound(_0x535e5a,null))[_0xf650('0xf')](function(_0x234d28){return db['Setting'][_0xf650('0x94')]({'attributes':['id',_0xf650('0x60'),_0xf650('0x95'),'passwordHistoryLimit']})['then'](function(_0xae7603){if(_0xae7603['securePassword'])authService['validatePasswordPattern'](_0x160cc7['body'][_0xf650('0x8d')]);if(!_0xae7603[_0xf650('0x95')]||!_0x234d28['previousPasswords'])return _0x234d28;authService[_0xf650('0x96')](_0x160cc7[_0xf650('0x58')][_0xf650('0x8d')],_0x234d28['previousPasswords'],_0xae7603[_0xf650('0x97')]);return _0x234d28;})['then'](saveUpdates({'password':_0x160cc7[_0xf650('0x58')][_0xf650('0x8d')],'passwordResetAt':_0x160cc7[_0xf650('0x26')]['id']==_0x160cc7[_0xf650('0x4e')]['id']?moment():null,'previousPasswords':authService[_0xf650('0x98')](_0x160cc7[_0xf650('0x58')]['newPassword'],_0x234d28[_0xf650('0x99')])},null));})[_0xf650('0xf')](respondWithResult(_0x535e5a,null))['catch'](handleError(_0x535e5a,null));};exports[_0xf650('0x9a')]=function(_0x3bdbc8,_0x410dc7){var _0x414a4e=_0x3bdbc8[_0xf650('0x58')][_0xf650('0x9b')];return db['User'][_0xf650('0x2d')]({'where':{'id':_0x3bdbc8['params']['id']},'attributes':['id',_0xf650('0x31'),'role','online',_0xf650('0x9c'),_0xf650('0x9d'),_0xf650('0x9e')]})['then'](handleEntityNotFound(_0x410dc7,null))[_0xf650('0xf')](function(_0x148225){if(_0x148225){if(!utils[_0xf650('0x9f')](_0x414a4e)){throw new db[(_0xf650('0x8e'))]['ValidationError'](_0xf650('0xa0'));}return _0x148225[_0xf650('0xa1')+_['capitalize'](_0x414a4e[_0xf650('0xa2')]())+_0xf650('0xa3')](_0x3bdbc8[_0xf650('0x58')][_0xf650('0x5b')],{'penalty':_0x3bdbc8[_0xf650('0x58')][_0xf650('0xa4')]||0x0})[_0xf650('0xa5')](function(_0x352e7a){for(var _0x181e38=0x0;_0x181e38<_0x3bdbc8[_0xf650('0x58')][_0xf650('0x5b')][_0xf650('0x54')];_0x181e38+=0x1){var _0x10ca61={'UserId':Number(_0x3bdbc8[_0xf650('0x4e')]['id'])};_0x10ca61[_[_0xf650('0xa6')](_0x414a4e[_0xf650('0xa2')]())+'QueueId']=Number(_0x3bdbc8['body']['ids'][_0x181e38]);socket[_0xf650('0xa7')](_0xf650('0x26')+_[_0xf650('0xa6')](_0x414a4e[_0xf650('0xa2')]())+'Queue:save',_0x10ca61);}return _0x352e7a;})[_0xf650('0xf')](function(){if(_0x414a4e==='voice'){return db[_0xf650('0xa8')][_0xf650('0x87')]({'where':{'id':_0x3bdbc8[_0xf650('0x58')][_0xf650('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xf650('0xf')](function(_0x50d188){var _0x3b4b0e=_0x148225[_0xf650('0xa9')]({'plain':!![]});var _0x4dd67e=[];if(_0x414a4e===_0xf650('0xaa')&&_0x3b4b0e[_0xf650('0x23')]==='agent'&&_0x3b4b0e[_0xf650('0xab')]){for(var _0x23c657=0x0;_0x23c657<_0x50d188[_0xf650('0x54')];_0x23c657+=0x1){_0x4dd67e[_0xf650('0x45')]({'membername':_0x3b4b0e[_0xf650('0x31')],'UserId':_0x3b4b0e['id'],'queue_name':_0x50d188[_0x23c657][_0xf650('0x31')],'VoiceQueueId':_0x50d188[_0x23c657]['id'],'interface':_[_0xf650('0x63')](_0x3b4b0e['interface'])?util['format'](_0xf650('0xac'),_0x3b4b0e[_0xf650('0x31')]):_0x3b4b0e['interface'],'paused':_0x3b4b0e[_0xf650('0x9d')]||![],'penalty':_0x3bdbc8[_0xf650('0x58')][_0xf650('0xa4')]||0x0});}return BPromise[_0xf650('0x85')](_0x4dd67e,function(_0x334e4c){return db[_0xf650('0xad')][_0xf650('0xae')](_0x334e4c);});}return _0x148225;});}})[_0xf650('0xf')](respondWithStatusCode(_0x410dc7,null))[_0xf650('0x19')](handleError(_0x410dc7,null));};exports[_0xf650('0xaf')]=function(_0x1426f9,_0x17f878){var _0x14a9c4,_0x269154;return db['User']['find']({'where':{'id':_0x1426f9[_0xf650('0x4e')]['id']},'attributes':['id',_0xf650('0x31'),'role']})[_0xf650('0xf')](handleEntityNotFound(_0x17f878,null))[_0xf650('0xf')](function(_0x1a742a){if(_0x1a742a){_0x14a9c4=_0x1a742a;if(!_0x1426f9['query']['channel']||!utils[_0xf650('0x9f')](_0x1426f9[_0xf650('0x3f')][_0xf650('0x9b')])){throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))]('Unknown\x20channel');}return _0x1a742a[_0xf650('0xb0')+_[_0xf650('0xa6')](_0x1426f9[_0xf650('0x3f')]['channel'][_0xf650('0xa2')]())+'Queues'](_0x1426f9[_0xf650('0x3f')][_0xf650('0x5b')]);}})[_0xf650('0xf')](function(_0x5c6155){if(_[_0xf650('0xb1')](_0x1426f9[_0xf650('0x3f')][_0xf650('0x5b')])){for(var _0x2ce16e=0x0;_0x2ce16e<_0x1426f9[_0xf650('0x3f')][_0xf650('0x5b')][_0xf650('0x54')];_0x2ce16e+=0x1){_0x269154={'UserId':Number(_0x1426f9[_0xf650('0x4e')]['id'])};_0x269154[_['capitalize'](_0x1426f9['query']['channel'][_0xf650('0xa2')]())+'QueueId']=Number(_0x1426f9[_0xf650('0x3f')]['ids'][_0x2ce16e]);socket[_0xf650('0xa7')](_0xf650('0x26')+_[_0xf650('0xa6')](_0x1426f9[_0xf650('0x3f')][_0xf650('0x9b')][_0xf650('0xa2')]())+_0xf650('0xb2'),_0x269154);}}else{_0x269154={'UserId':Number(_0x1426f9[_0xf650('0x4e')]['id'])};_0x269154[_[_0xf650('0xa6')](_0x1426f9[_0xf650('0x3f')][_0xf650('0x9b')][_0xf650('0xa2')]())+_0xf650('0xb3')]=Number(_0x1426f9[_0xf650('0x3f')][_0xf650('0x5b')]);socket[_0xf650('0xa7')](_0xf650('0x26')+_[_0xf650('0xa6')](_0x1426f9['query'][_0xf650('0x9b')][_0xf650('0xa2')]())+_0xf650('0xb2'),_0x269154);}return _0x5c6155;})[_0xf650('0xf')](function(){if(_0x1426f9[_0xf650('0x3f')][_0xf650('0x9b')]==='voice'){return db[_0xf650('0xad')]['destroy']({'where':{'UserId':_0x1426f9[_0xf650('0x4e')]['id'],'VoiceQueueId':_0x1426f9[_0xf650('0x3f')][_0xf650('0x5b')]},'individualHooks':!![]})[_0xf650('0xf')](function(){return _0x14a9c4;});}return _0x14a9c4;})[_0xf650('0xf')](respondWithStatusCode(_0x17f878,null))['catch'](handleError(_0x17f878,null));};exports[_0xf650('0xb4')]=function(_0x54121d,_0x4b0267){_0x54121d[_0xf650('0x58')]['userpic']=_0x54121d[_0xf650('0xb5')][_0xf650('0xb6')];return db['User'][_0xf650('0x2d')]({'where':{'id':_0x54121d[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x4b0267,null))[_0xf650('0xf')](saveUpdates(_0x54121d[_0xf650('0x58')],null))[_0xf650('0xf')](respondWithResult(_0x4b0267,null))[_0xf650('0x19')](handleError(_0x4b0267,null));};exports[_0xf650('0xb7')]=function(_0x504ed6,_0x237248){var _0x3daf5e=path[_0xf650('0xb8')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xf650('0x33')]['find']({'where':{'id':_0x504ed6[_0xf650('0x4e')]['id']},'attributes':['id',_0xf650('0xb9')],'raw':!![]})[_0xf650('0xf')](handleEntityNotFound(_0x237248,null))['then'](function(_0x72ad33){if(_0x72ad33){if(_[_0xf650('0x63')](_0x72ad33[_0xf650('0xb9')])){return _0x237248[_0xf650('0xba')](_0x3daf5e);}else{if(!fs[_0xf650('0xbb')](path[_0xf650('0xb8')](config[_0xf650('0xbc')],_0xf650('0xbd'),_0x72ad33[_0xf650('0xb9')]))){return _0x237248[_0xf650('0xba')](_0x3daf5e);}return _0x237248[_0xf650('0xba')](path[_0xf650('0xb8')](config[_0xf650('0xbc')],_0xf650('0xbd'),_0x72ad33[_0xf650('0xb9')]));}}})[_0xf650('0x19')](handleError(_0x237248,null));};exports[_0xf650('0xbe')]=function(_0xd4b838,_0x33cc7c){return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0xd4b838['params']['id']},'attributes':['id']})[_0xf650('0xf')](handleEntityNotFound(_0x33cc7c,null))[_0xf650('0xf')](function(_0x4da6f9){var _0x3dbbc7=[];values=_0x4da6f9[_0xf650('0x4a')];_0x3dbbc7['push'](get_open_tabs(_0xf650('0x48'),_0x4da6f9['dataValues']));_0x3dbbc7[_0xf650('0x45')](get_open_tabs(_0xf650('0x49'),_0x4da6f9['dataValues']));_0x3dbbc7[_0xf650('0x45')](get_open_tabs('openchannel',_0x4da6f9[_0xf650('0x4a')]));_0x3dbbc7[_0xf650('0x45')](get_open_tabs(_0xf650('0x4c'),_0x4da6f9[_0xf650('0x4a')]));_0x3dbbc7[_0xf650('0x45')](get_open_tabs('fax',_0x4da6f9[_0xf650('0x4a')]));_0x3dbbc7[_0xf650('0x45')](get_open_tabs('mail',_0x4da6f9[_0xf650('0x4a')]));return BPromise[_0xf650('0x4d')](_0x3dbbc7);})[_0xf650('0xf')](function(_0x239a53){if(_0x239a53){var _0x5b373f=_[_0xf650('0x2b')](values[_0xf650('0xbf')],function(_0x5b27e1){return{'channel':_0xf650('0xc0'),'id':_0x5b27e1['id'],'createdAt':_0x5b27e1[_0xf650('0xc1')]};});var _0x36ec36=_[_0xf650('0x2b')](values['FaxOpenTabs'],function(_0x1c14da){return{'channel':'FAX','id':_0x1c14da['id'],'createdAt':_0x1c14da[_0xf650('0xc1')]};});var _0x204798=_[_0xf650('0x2b')](values[_0xf650('0xc2')],function(_0x2baec5){return{'channel':_0xf650('0xc3'),'id':_0x2baec5['id'],'createdAt':_0x2baec5[_0xf650('0xc1')]};});var _0x3748ce=_['map'](values[_0xf650('0xc4')],function(_0x16c68e){return{'channel':'MAIL','id':_0x16c68e['id'],'createdAt':_0x16c68e[_0xf650('0xc1')]};});var _0x91bbfd=_[_0xf650('0x2b')](values[_0xf650('0xc5')],function(_0x1a7b34){return{'channel':_0xf650('0xc6'),'id':_0x1a7b34['id'],'createdAt':_0x1a7b34[_0xf650('0xc1')]};});var _0x24c34e=_[_0xf650('0x2b')](values['WhatsappOpenTabs'],function(_0x5a4431){return{'channel':'WHATSAPP','id':_0x5a4431['id'],'createdAt':_0x5a4431[_0xf650('0xc1')]};});var _0x20248f=_[_0xf650('0xc7')](_0x5b373f,_0x36ec36,_0x204798,_0x3748ce,_0x91bbfd,_0x24c34e);var _0x594464={'count':_0x20248f['length'],'rows':_0x20248f};return _0x594464;}else return null;})[_0xf650('0xf')](respondWithResult(_0x33cc7c,null))['catch'](handleError(_0x33cc7c,null));};exports[_0xf650('0xc8')]=function(_0x2f89f4,_0x4d1cec){var _0x2d190a={};var _0x4a5c29={};var _0x3ca522;var _0x160acd;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x2f89f4[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x4d1cec,null))[_0xf650('0xf')](function(_0x3b0376){if(_0x3b0376){_0x3ca522=_0x3b0376;_0x4a5c29['model']=_['keys'](db['CmContact'][_0xf650('0x34')]);_0x4a5c29[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x2f89f4['query']);_0x4a5c29[_0xf650('0x51')]=_[_0xf650('0x52')](_0x4a5c29[_0xf650('0x4f')],_0x4a5c29[_0xf650('0x3f')]);_0x2d190a[_0xf650('0x44')]=_[_0xf650('0x52')](_0x4a5c29[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x2f89f4[_0xf650('0x3f')][_0xf650('0x53')]));_0x2d190a['attributes']=_0x2d190a['attributes'][_0xf650('0x54')]?_0x2d190a[_0xf650('0x44')]:_0x4a5c29[_0xf650('0x4f')];_0x2d190a[_0xf650('0xc9')]=qs['sort'](_0x2f89f4[_0xf650('0x3f')][_0xf650('0xca')]);_0x2d190a['where']=qs[_0xf650('0x51')](_['pick'](_0x2f89f4[_0xf650('0x3f')],_0x4a5c29[_0xf650('0x51')]));if(_0x2f89f4[_0xf650('0x3f')]['filter']){_0x2d190a['where']=_[_0xf650('0x55')](_0x2d190a['where'],{'$or':_[_0xf650('0x2b')](_0x2d190a[_0xf650('0x44')],function(_0x453ebe){var _0x40d096={};_0x40d096[_0x453ebe]={'$like':'%'+_0x2f89f4[_0xf650('0x3f')]['filter']+'%'};return _0x40d096;})});}_0x2d190a=_[_0xf650('0x55')]({},_0x2d190a,_0x2f89f4[_0xf650('0x56')]);return _0x3ca522[_0xf650('0xc8')](_0x2d190a);}})['then'](function(_0x4c804b){if(_0x4c804b){_0x160acd=_0x4c804b['length'];if(_0x2f89f4['query'][_0xf650('0xcb')](_0xf650('0x3e'))){_0x2d190a['include']=[{'model':db[_0xf650('0xcc')],'as':_0xf650('0xcd'),'required':![]},{'model':db[_0xf650('0xce')],'as':'Tags','attributes':['id','name',_0xf650('0xcf')],'where':_0x2f89f4[_0xf650('0x3f')][_0xf650('0xd0')]?{'id':_0x2f89f4[_0xf650('0x3f')][_0xf650('0xd0')]}:undefined,'required':_0x2f89f4[_0xf650('0x3f')][_0xf650('0xd0')]?!![]:![]}];}if(!_0x2f89f4[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x2d190a[_0xf650('0x1f')]=qs['limit'](_0x2f89f4['query']['limit']);_0x2d190a[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x2f89f4[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x3ca522[_0xf650('0xc8')](_0x2d190a);}})[_0xf650('0xf')](function(_0x1476a6){if(_0x1476a6){return _0x1476a6?{'count':_0x160acd,'rows':_0x1476a6}:null;}})[_0xf650('0xf')](respondWithResult(_0x4d1cec,null))['catch'](handleError(_0x4d1cec,null));};exports[_0xf650('0xd2')]=function(_0x291344,_0x106dc3){var _0x581780;var _0xe6028b={};var _0x5ba5ea;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x291344[_0xf650('0x4e')]['id']},'attributes':['id',_0xf650('0x31'),_0xf650('0x23')]})['then'](handleEntityNotFound(_0x106dc3,null))[_0xf650('0xf')](function(_0x2953fc){if(!utils[_0xf650('0x9f')](_0x291344[_0xf650('0x3f')][_0xf650('0x9b')])){throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))](_0xf650('0xa0'));}_0x581780=_0x2953fc;var _0x2708bc={};_0x2708bc[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_['capitalize'](_0x291344['query'][_0xf650('0x9b')])+_0xf650('0xd3')][_0xf650('0x34')]);_0x2708bc['query']=_[_0xf650('0x50')](_0x291344['query']);_0x2708bc[_0xf650('0x51')]=_[_0xf650('0x52')](_0x2708bc[_0xf650('0x4f')],_0x2708bc[_0xf650('0x3f')]);_0xe6028b[_0xf650('0x44')]=_[_0xf650('0x52')](_0x2708bc['model'],qs[_0xf650('0x53')](_0x291344['query'][_0xf650('0x53')]));_0xe6028b[_0xf650('0x44')]=_0xe6028b[_0xf650('0x44')][_0xf650('0x54')]?_0xe6028b['attributes']:_0x2708bc['model'];_0xe6028b[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0x291344[_0xf650('0x3f')][_0xf650('0xca')]);_0xe6028b['where']=qs['filters'](_[_0xf650('0xd4')](_0x291344[_0xf650('0x3f')],_0x2708bc[_0xf650('0x51')]));if(_0x291344[_0xf650('0x3f')][_0xf650('0x38')]){_0xe6028b['where']=_['merge'](_0xe6028b[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0xe6028b[_0xf650('0x44')],function(_0x508db5){var _0x48d547={};_0x48d547[_0x508db5]={'$like':'%'+_0x291344[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x48d547;})});}_0xe6028b=_['merge']({},_0xe6028b,_0x291344[_0xf650('0x56')]);switch(_0x581780[_0xf650('0x23')]){case _0xf650('0x24'):return db[_[_0xf650('0xa6')](_0x291344[_0xf650('0x3f')][_0xf650('0x9b')])+_0xf650('0xd3')][_0xf650('0x87')](_0xe6028b);case _0xf650('0x26'):case _0xf650('0x28'):return _0x581780[_0xf650('0xa9')+_[_0xf650('0xa6')](_0x291344[_0xf650('0x3f')]['channel'])+_0xf650('0xa3')](_0xe6028b);default:throw new db['Sequelize'][(_0xf650('0x8f'))](_0xf650('0xd5'));}})[_0xf650('0xf')](function(_0x20a140){_0x5ba5ea=_0x20a140[_0xf650('0x54')];if(!_0x291344[_0xf650('0x3f')]['hasOwnProperty']('nolimit')){_0xe6028b['limit']=qs[_0xf650('0x1f')](_0x291344[_0xf650('0x3f')][_0xf650('0x1f')]);_0xe6028b[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x291344[_0xf650('0x3f')]['offset']);}switch(_0x581780[_0xf650('0x23')]){case _0xf650('0x24'):return db[_[_0xf650('0xa6')](_0x291344['query'][_0xf650('0x9b')])+'Queue'][_0xf650('0x87')](_0xe6028b);case'user':case'agent':return _0x581780['get'+_['capitalize'](_0x291344[_0xf650('0x3f')][_0xf650('0x9b')])+_0xf650('0xa3')](_0xe6028b);}})[_0xf650('0xf')](function(_0x41058d){return{'count':_0x5ba5ea,'rows':_0x41058d};})['then'](respondWithResult(_0x106dc3,null))[_0xf650('0x19')](handleError(_0x106dc3,null));};exports['getVoiceQueuesRt']=function(_0x90302c,_0x1085c7){var _0x279e37={};var _0x3702da={};var _0x506f48;var _0x5d48cd;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x90302c[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x1085c7,null))[_0xf650('0xf')](function(_0x5a5a11){if(_0x5a5a11){_0x506f48=_0x5a5a11;_0x3702da[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0xad')][_0xf650('0x34')]);_0x3702da[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x90302c[_0xf650('0x3f')]);_0x3702da['filters']=_[_0xf650('0x52')](_0x3702da[_0xf650('0x4f')],_0x3702da[_0xf650('0x3f')]);_0x279e37[_0xf650('0x44')]=_[_0xf650('0x52')](_0x3702da[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x90302c['query'][_0xf650('0x53')]));_0x279e37[_0xf650('0x44')]=_0x279e37[_0xf650('0x44')]['length']?_0x279e37[_0xf650('0x44')]:_0x3702da[_0xf650('0x4f')];_0x279e37['order']=qs[_0xf650('0xca')](_0x90302c['query'][_0xf650('0xca')]);_0x279e37['where']=qs['filters'](_['pick'](_0x90302c[_0xf650('0x3f')],_0x3702da[_0xf650('0x51')]));if(_0x90302c[_0xf650('0x3f')][_0xf650('0x38')]){_0x279e37[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x279e37['where'],{'$or':_[_0xf650('0x2b')](_0x279e37[_0xf650('0x44')],function(_0x235ac5){var _0x387298={};_0x387298[_0x235ac5]={'$like':'%'+_0x90302c[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x387298;})});}_0x279e37=_[_0xf650('0x55')]({},_0x279e37,_0x90302c[_0xf650('0x56')]);return _0x506f48[_0xf650('0xd6')](_0x279e37);}})[_0xf650('0xf')](function(_0x5a0811){if(_0x5a0811){_0x5d48cd=_0x5a0811[_0xf650('0x54')];if(!_0x90302c[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x279e37[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x90302c[_0xf650('0x3f')]['limit']);_0x279e37[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x90302c[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x506f48[_0xf650('0xd6')](_0x279e37);}})[_0xf650('0xf')](function(_0x53be81){if(_0x53be81){return _0x53be81?{'count':_0x5d48cd,'rows':_0x53be81}:null;}})[_0xf650('0xf')](respondWithResult(_0x1085c7,null))[_0xf650('0x19')](handleError(_0x1085c7,null));};exports[_0xf650('0xd7')]=function(_0xab1a64,_0x529924){var _0x4d0628={};var _0x3e6d00={};var _0x23f424;var _0x4024e5;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0xab1a64['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x529924,null))[_0xf650('0xf')](function(_0x395df1){if(_0x395df1){_0x23f424=_0x395df1;_0x3e6d00['model']=_[_0xf650('0x50')](db[_0xf650('0xd8')][_0xf650('0x34')]);_0x3e6d00[_0xf650('0x3f')]=_[_0xf650('0x50')](_0xab1a64[_0xf650('0x3f')]);_0x3e6d00[_0xf650('0x51')]=_[_0xf650('0x52')](_0x3e6d00[_0xf650('0x4f')],_0x3e6d00['query']);_0x4d0628[_0xf650('0x44')]=_[_0xf650('0x52')](_0x3e6d00['model'],qs[_0xf650('0x53')](_0xab1a64[_0xf650('0x3f')]['fields']));_0x4d0628[_0xf650('0x44')]=_0x4d0628['attributes'][_0xf650('0x54')]?_0x4d0628[_0xf650('0x44')]:_0x3e6d00[_0xf650('0x4f')];_0x4d0628[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0xab1a64[_0xf650('0x3f')][_0xf650('0xca')]);_0x4d0628['where']=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0xab1a64[_0xf650('0x3f')],_0x3e6d00[_0xf650('0x51')]));if(_0xab1a64['query'][_0xf650('0x38')]){_0x4d0628[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x4d0628['where'],{'$or':_['map'](_0x4d0628['attributes'],function(_0x112673){var _0x4de677={};_0x4de677[_0x112673]={'$like':'%'+_0xab1a64[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x4de677;})});}_0x4d0628=_[_0xf650('0x55')]({},_0x4d0628,_0xab1a64['options']);return _0x23f424['getGroups'](_0x4d0628);}})['then'](function(_0x318871){if(_0x318871){_0x4024e5=_0x318871[_0xf650('0x54')];if(!_0xab1a64[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x4d0628[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0xab1a64[_0xf650('0x3f')]['limit']);_0x4d0628[_0xf650('0x20')]=qs[_0xf650('0x20')](_0xab1a64[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x23f424[_0xf650('0xd7')](_0x4d0628);}})[_0xf650('0xf')](function(_0x201265){if(_0x201265){return _0x201265?{'count':_0x4024e5,'rows':_0x201265}:null;}})[_0xf650('0xf')](respondWithResult(_0x529924,null))[_0xf650('0x19')](handleError(_0x529924,null));};exports['getRecordings']=function(_0x52cb6c,_0xd52c7c){var _0x1b65c1={'raw':!![],'where':{}};var _0x5d83c4={};var _0x557ca3={'count':0x0,'rows':[]};return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x52cb6c[_0xf650('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd52c7c,null))[_0xf650('0xf')](function(_0x3ccd42){if(_0x3ccd42){_0x5d83c4['model']=_[_0xf650('0x50')](db[_0xf650('0xd9')][_0xf650('0x34')]);_0x5d83c4['query']=_[_0xf650('0x50')](_0x52cb6c[_0xf650('0x3f')]);_0x5d83c4[_0xf650('0x51')]=_[_0xf650('0x52')](_0x5d83c4['model'],_0x5d83c4['query']);_0x1b65c1[_0xf650('0x44')]=_[_0xf650('0x52')](_0x5d83c4[_0xf650('0x4f')],qs['fields'](_0x52cb6c['query'][_0xf650('0x53')]));_0x1b65c1[_0xf650('0x44')]=_0x1b65c1['attributes']['length']?_0x1b65c1[_0xf650('0x44')]:_0x5d83c4[_0xf650('0x4f')];if(!_0x52cb6c[_0xf650('0x3f')]['hasOwnProperty'](_0xf650('0xd1'))){_0x1b65c1['limit']=qs[_0xf650('0x1f')](_0x52cb6c['query'][_0xf650('0x1f')]);_0x1b65c1['offset']=qs[_0xf650('0x20')](_0x52cb6c[_0xf650('0x3f')][_0xf650('0x20')]);}_0x1b65c1[_0xf650('0xc9')]=qs['sort'](_0x52cb6c['query']['sort']);_0x1b65c1['where']=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x52cb6c[_0xf650('0x3f')],_0x5d83c4['filters']));_0x1b65c1[_0xf650('0x3c')][_0xf650('0xda')]=_0x3ccd42['id'];if(_0x52cb6c[_0xf650('0x3f')][_0xf650('0x38')]){_0x1b65c1['where']=_[_0xf650('0x55')](_0x1b65c1[_0xf650('0x3c')],{'$or':_['map'](_0x1b65c1[_0xf650('0x44')],function(_0x2302f6){var _0x395a6a={};_0x395a6a[_0x2302f6]={'$like':'%'+_0x52cb6c[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x395a6a;})});}_0x1b65c1=_['merge']({},_0x1b65c1,_0x52cb6c[_0xf650('0x56')]);return db[_0xf650('0xd9')][_0xf650('0x3d')]({'where':_0x1b65c1[_0xf650('0x3c')]})[_0xf650('0xf')](function(_0x5d6fc2){_0x557ca3[_0xf650('0x3d')]=_0x5d6fc2;if(_0x52cb6c[_0xf650('0x3f')][_0xf650('0x3e')]){_0x1b65c1[_0xf650('0x41')]=[{'all':!![]}];}return db[_0xf650('0xd9')][_0xf650('0x87')](_0x1b65c1);})[_0xf650('0xf')](function(_0x4f81c2){_0x557ca3[_0xf650('0x46')]=_0x4f81c2;return _0x557ca3;});}})[_0xf650('0xf')](respondWithFilteredResult(_0xd52c7c,_0x1b65c1))[_0xf650('0x19')](handleError(_0xd52c7c,null));};exports[_0xf650('0xdb')]=function(_0xa5a24c,_0x2b5045){var _0x40dd68={'raw':!![],'where':{}};var _0x17ad2f={};var _0x456cbb={'count':0x0,'rows':[]};return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0xa5a24c['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x2b5045,null))[_0xf650('0xf')](function(_0x108326){if(_0x108326){_0x17ad2f[_0xf650('0x4f')]=_['keys'](db[_0xf650('0xdc')][_0xf650('0x34')]);_0x17ad2f['query']=_['keys'](_0xa5a24c[_0xf650('0x3f')]);_0x17ad2f['filters']=_['intersection'](_0x17ad2f[_0xf650('0x4f')],_0x17ad2f[_0xf650('0x3f')]);_0x40dd68[_0xf650('0x44')]=_['intersection'](_0x17ad2f['model'],qs[_0xf650('0x53')](_0xa5a24c[_0xf650('0x3f')]['fields']));_0x40dd68['attributes']=_0x40dd68[_0xf650('0x44')][_0xf650('0x54')]?_0x40dd68[_0xf650('0x44')]:_0x17ad2f[_0xf650('0x4f')];if(!_0xa5a24c[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x40dd68[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0xa5a24c['query'][_0xf650('0x1f')]);_0x40dd68[_0xf650('0x20')]=qs['offset'](_0xa5a24c['query'][_0xf650('0x20')]);}_0x40dd68[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0xa5a24c[_0xf650('0x3f')]['sort']);_0x40dd68[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0xa5a24c['query'],_0x17ad2f['filters']));_0x40dd68[_0xf650('0x3c')][_0xf650('0xda')]=_0x108326['id'];if(_0xa5a24c[_0xf650('0x3f')][_0xf650('0x38')]){_0x40dd68[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x40dd68[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0x40dd68[_0xf650('0x44')],function(_0x1b4e0f){var _0x429bf6={};_0x429bf6[_0x1b4e0f]={'$like':'%'+_0xa5a24c['query']['filter']+'%'};return _0x429bf6;})});}_0x40dd68=_[_0xf650('0x55')]({},_0x40dd68,_0xa5a24c[_0xf650('0x56')]);return db[_0xf650('0xdc')][_0xf650('0x3d')]({'where':_0x40dd68[_0xf650('0x3c')]})['then'](function(_0x5079e7){_0x456cbb[_0xf650('0x3d')]=_0x5079e7;if(_0xa5a24c[_0xf650('0x3f')][_0xf650('0x3e')]){_0x40dd68['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xf650('0x87')](_0x40dd68);})[_0xf650('0xf')](function(_0x459d2d){_0x456cbb[_0xf650('0x46')]=_0x459d2d;return _0x456cbb;});}})[_0xf650('0xf')](respondWithFilteredResult(_0x2b5045,_0x40dd68))[_0xf650('0x19')](handleError(_0x2b5045,null));};exports[_0xf650('0xdd')]=function(_0x2b2393,_0x412ca4){var _0x74225f={};var _0x342d6e={};var _0xd360b7;var _0x2c9b80;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x2b2393['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x412ca4,null))['then'](function(_0x215684){if(_0x215684){_0xd360b7=_0x215684;_0x342d6e[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0xde')]['rawAttributes']);_0x342d6e[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x2b2393['query']);_0x342d6e[_0xf650('0x51')]=_[_0xf650('0x52')](_0x342d6e[_0xf650('0x4f')],_0x342d6e['query']);_0x74225f[_0xf650('0x44')]=_[_0xf650('0x52')](_0x342d6e['model'],qs[_0xf650('0x53')](_0x2b2393['query'][_0xf650('0x53')]));_0x74225f[_0xf650('0x44')]=_0x74225f[_0xf650('0x44')][_0xf650('0x54')]?_0x74225f[_0xf650('0x44')]:_0x342d6e[_0xf650('0x4f')];_0x74225f['order']=qs[_0xf650('0xca')](_0x2b2393[_0xf650('0x3f')]['sort']);_0x74225f[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x2b2393[_0xf650('0x3f')],_0x342d6e[_0xf650('0x51')]));if(_0x2b2393[_0xf650('0x3f')][_0xf650('0x38')]){_0x74225f['where']=_[_0xf650('0x55')](_0x74225f[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0x74225f['attributes'],function(_0x4be81c){var _0x281280={};_0x281280[_0x4be81c]={'$like':'%'+_0x2b2393['query'][_0xf650('0x38')]+'%'};return _0x281280;})});}_0x74225f=_[_0xf650('0x55')]({},_0x74225f,_0x2b2393[_0xf650('0x56')]);return _0xd360b7[_0xf650('0xdd')](_0x74225f);}})['then'](function(_0x153426){if(_0x153426){_0x2c9b80=_0x153426[_0xf650('0x54')];if(!_0x2b2393[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x74225f[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x2b2393['query'][_0xf650('0x1f')]);_0x74225f[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x2b2393[_0xf650('0x3f')][_0xf650('0x20')]);}return _0xd360b7[_0xf650('0xdd')](_0x74225f);}})['then'](function(_0x3097d9){if(_0x3097d9){return _0x3097d9?{'count':_0x2c9b80,'rows':_0x3097d9}:null;}})[_0xf650('0xf')](respondWithResult(_0x412ca4,null))['catch'](handleError(_0x412ca4,null));};exports['getOpenchannelInteractions']=function(_0x27bff8,_0x27fb5e){var _0x3a6d0d={};var _0x5a55cf={};var _0x20c34b;var _0x1bc72c;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x27bff8['params']['id']}})['then'](handleEntityNotFound(_0x27fb5e,null))[_0xf650('0xf')](function(_0x19c2c8){if(_0x19c2c8){_0x20c34b=_0x19c2c8;_0x5a55cf['model']=_[_0xf650('0x50')](db['OpenchannelInteraction']['rawAttributes']);_0x5a55cf['query']=_['keys'](_0x27bff8['query']);_0x5a55cf[_0xf650('0x51')]=_['intersection'](_0x5a55cf[_0xf650('0x4f')],_0x5a55cf[_0xf650('0x3f')]);_0x3a6d0d[_0xf650('0x44')]=_['intersection'](_0x5a55cf[_0xf650('0x4f')],qs['fields'](_0x27bff8[_0xf650('0x3f')][_0xf650('0x53')]));_0x3a6d0d[_0xf650('0x44')]=_0x3a6d0d[_0xf650('0x44')][_0xf650('0x54')]?_0x3a6d0d[_0xf650('0x44')]:_0x5a55cf[_0xf650('0x4f')];_0x3a6d0d[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0x27bff8[_0xf650('0x3f')]['sort']);_0x3a6d0d[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x27bff8[_0xf650('0x3f')],_0x5a55cf['filters']));if(_0x27bff8[_0xf650('0x3f')][_0xf650('0x38')]){_0x3a6d0d[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x3a6d0d[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0x3a6d0d[_0xf650('0x44')],function(_0x23a06f){var _0x148ae0={};_0x148ae0[_0x23a06f]={'$like':'%'+_0x27bff8[_0xf650('0x3f')]['filter']+'%'};return _0x148ae0;})});}_0x3a6d0d=_['merge']({},_0x3a6d0d,_0x27bff8[_0xf650('0x56')]);return _0x20c34b[_0xf650('0xdf')](_0x3a6d0d);}})[_0xf650('0xf')](function(_0x599da4){if(_0x599da4){_0x1bc72c=_0x599da4[_0xf650('0x54')];if(!_0x27bff8[_0xf650('0x3f')]['hasOwnProperty'](_0xf650('0xd1'))){_0x3a6d0d[_0xf650('0x1f')]=qs['limit'](_0x27bff8[_0xf650('0x3f')][_0xf650('0x1f')]);_0x3a6d0d['offset']=qs[_0xf650('0x20')](_0x27bff8[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x20c34b[_0xf650('0xdf')](_0x3a6d0d);}})[_0xf650('0xf')](function(_0x1bdd60){if(_0x1bdd60){return _0x1bdd60?{'count':_0x1bc72c,'rows':_0x1bdd60}:null;}})[_0xf650('0xf')](respondWithResult(_0x27fb5e,null))[_0xf650('0x19')](handleError(_0x27fb5e,null));};exports[_0xf650('0xe0')]=function(_0x51294e,_0x3db7df){var _0x52628a={'raw':!![],'where':{}};var _0x2d41b1={};var _0xf8514e={'count':0x0,'rows':[]};return db['User'][_0xf650('0x94')]({'where':{'id':_0x51294e[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x3db7df,null))[_0xf650('0xf')](function(_0x516de7){if(_0x516de7){_0x2d41b1[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0xe1')]['rawAttributes']);_0x2d41b1[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x51294e[_0xf650('0x3f')]);_0x2d41b1['filters']=_[_0xf650('0x52')](_0x2d41b1['model'],_0x2d41b1[_0xf650('0x3f')]);_0x52628a['attributes']=_[_0xf650('0x52')](_0x2d41b1[_0xf650('0x4f')],qs['fields'](_0x51294e['query']['fields']));_0x52628a['attributes']=_0x52628a[_0xf650('0x44')][_0xf650('0x54')]?_0x52628a[_0xf650('0x44')]:_0x2d41b1[_0xf650('0x4f')];if(!_0x51294e[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x52628a[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x51294e['query']['limit']);_0x52628a[_0xf650('0x20')]=qs['offset'](_0x51294e[_0xf650('0x3f')][_0xf650('0x20')]);}_0x52628a[_0xf650('0xc9')]=qs['sort'](_0x51294e[_0xf650('0x3f')][_0xf650('0xca')]);_0x52628a['where']=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x51294e[_0xf650('0x3f')],_0x2d41b1[_0xf650('0x51')]));_0x52628a['where'][_0xf650('0xda')]=_0x516de7['id'];if(_0x51294e[_0xf650('0x3f')][_0xf650('0x38')]){_0x52628a[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x52628a[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0x52628a[_0xf650('0x44')],function(_0x4c86e2){var _0x1d8992={};_0x1d8992[_0x4c86e2]={'$like':'%'+_0x51294e['query'][_0xf650('0x38')]+'%'};return _0x1d8992;})});}_0x52628a=_[_0xf650('0x55')]({},_0x52628a,_0x51294e[_0xf650('0x56')]);return db[_0xf650('0xe1')][_0xf650('0x3d')]({'where':_0x52628a[_0xf650('0x3c')]})[_0xf650('0xf')](function(_0x27a002){_0xf8514e[_0xf650('0x3d')]=_0x27a002;if(_0x51294e[_0xf650('0x3f')][_0xf650('0x3e')]){_0x52628a[_0xf650('0x41')]=[{'all':!![]}];}return db[_0xf650('0xe1')]['findAll'](_0x52628a);})[_0xf650('0xf')](function(_0x305546){_0xf8514e[_0xf650('0x46')]=_0x305546;return _0xf8514e;});}})[_0xf650('0xf')](respondWithFilteredResult(_0x3db7df,_0x52628a))[_0xf650('0x19')](handleError(_0x3db7df,null));};exports['getSmsInteractions']=function(_0x509215,_0x437c56){var _0x776a54={};var _0x5e4147={};var _0x191e96;var _0xdea928;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x509215[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x437c56,null))[_0xf650('0xf')](function(_0x3a969c){if(_0x3a969c){_0x191e96=_0x3a969c;_0x5e4147[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0xe2')]['rawAttributes']);_0x5e4147[_0xf650('0x3f')]=_['keys'](_0x509215[_0xf650('0x3f')]);_0x5e4147['filters']=_[_0xf650('0x52')](_0x5e4147['model'],_0x5e4147[_0xf650('0x3f')]);_0x776a54[_0xf650('0x44')]=_[_0xf650('0x52')](_0x5e4147[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x509215[_0xf650('0x3f')][_0xf650('0x53')]));_0x776a54['attributes']=_0x776a54[_0xf650('0x44')][_0xf650('0x54')]?_0x776a54[_0xf650('0x44')]:_0x5e4147[_0xf650('0x4f')];_0x776a54[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0x509215[_0xf650('0x3f')][_0xf650('0xca')]);_0x776a54['where']=qs[_0xf650('0x51')](_['pick'](_0x509215['query'],_0x5e4147[_0xf650('0x51')]));if(_0x509215[_0xf650('0x3f')][_0xf650('0x38')]){_0x776a54[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x776a54['where'],{'$or':_[_0xf650('0x2b')](_0x776a54[_0xf650('0x44')],function(_0x57cac8){var _0x4fe51d={};_0x4fe51d[_0x57cac8]={'$like':'%'+_0x509215[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x4fe51d;})});}_0x776a54=_[_0xf650('0x55')]({},_0x776a54,_0x509215[_0xf650('0x56')]);return _0x191e96[_0xf650('0xe3')](_0x776a54);}})['then'](function(_0x38e46c){if(_0x38e46c){_0xdea928=_0x38e46c[_0xf650('0x54')];if(!_0x509215['query'][_0xf650('0xcb')](_0xf650('0xd1'))){_0x776a54['limit']=qs[_0xf650('0x1f')](_0x509215[_0xf650('0x3f')][_0xf650('0x1f')]);_0x776a54[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x509215[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x191e96['getSmsInteractions'](_0x776a54);}})[_0xf650('0xf')](function(_0x6fa80d){if(_0x6fa80d){return _0x6fa80d?{'count':_0xdea928,'rows':_0x6fa80d}:null;}})[_0xf650('0xf')](respondWithResult(_0x437c56,null))[_0xf650('0x19')](handleError(_0x437c56,null));};exports['getFaxInteractions']=function(_0x552fe6,_0x2cc5f5){var _0x31aed2={};var _0x3721f6={};var _0x3b7fd1;var _0x1b021b;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x552fe6[_0xf650('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2cc5f5,null))[_0xf650('0xf')](function(_0x29cd11){if(_0x29cd11){_0x3b7fd1=_0x29cd11;_0x3721f6[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0xe4')][_0xf650('0x34')]);_0x3721f6[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x552fe6[_0xf650('0x3f')]);_0x3721f6['filters']=_['intersection'](_0x3721f6[_0xf650('0x4f')],_0x3721f6['query']);_0x31aed2['attributes']=_['intersection'](_0x3721f6[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x552fe6['query'][_0xf650('0x53')]));_0x31aed2[_0xf650('0x44')]=_0x31aed2['attributes'][_0xf650('0x54')]?_0x31aed2[_0xf650('0x44')]:_0x3721f6[_0xf650('0x4f')];_0x31aed2[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0x552fe6[_0xf650('0x3f')][_0xf650('0xca')]);_0x31aed2[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x552fe6[_0xf650('0x3f')],_0x3721f6[_0xf650('0x51')]));if(_0x552fe6['query'][_0xf650('0x38')]){_0x31aed2[_0xf650('0x3c')]=_['merge'](_0x31aed2['where'],{'$or':_[_0xf650('0x2b')](_0x31aed2[_0xf650('0x44')],function(_0x43b353){var _0x1d877e={};_0x1d877e[_0x43b353]={'$like':'%'+_0x552fe6[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x1d877e;})});}_0x31aed2=_[_0xf650('0x55')]({},_0x31aed2,_0x552fe6[_0xf650('0x56')]);return _0x3b7fd1['getFaxInteractions'](_0x31aed2);}})[_0xf650('0xf')](function(_0x30a301){if(_0x30a301){_0x1b021b=_0x30a301[_0xf650('0x54')];if(!_0x552fe6[_0xf650('0x3f')]['hasOwnProperty'](_0xf650('0xd1'))){_0x31aed2['limit']=qs[_0xf650('0x1f')](_0x552fe6[_0xf650('0x3f')][_0xf650('0x1f')]);_0x31aed2['offset']=qs[_0xf650('0x20')](_0x552fe6[_0xf650('0x3f')]['offset']);}return _0x3b7fd1[_0xf650('0xe5')](_0x31aed2);}})['then'](function(_0xb50ae9){if(_0xb50ae9){return _0xb50ae9?{'count':_0x1b021b,'rows':_0xb50ae9}:null;}})[_0xf650('0xf')](respondWithResult(_0x2cc5f5,null))['catch'](handleError(_0x2cc5f5,null));};exports[_0xf650('0xe6')]=function(_0x2208bf,_0x3cea1f){var _0x3820dc={};var _0x372fb5={};var _0x4b235d;var _0xed6faf;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x2208bf['params']['id']}})['then'](handleEntityNotFound(_0x3cea1f,null))['then'](function(_0x6704a3){if(_0x6704a3){_0x4b235d=_0x6704a3;_0x372fb5['model']=_[_0xf650('0x50')](db[_0xf650('0xe7')][_0xf650('0x34')]);_0x372fb5[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x2208bf[_0xf650('0x3f')]);_0x372fb5[_0xf650('0x51')]=_[_0xf650('0x52')](_0x372fb5['model'],_0x372fb5['query']);_0x3820dc['attributes']=_[_0xf650('0x52')](_0x372fb5['model'],qs[_0xf650('0x53')](_0x2208bf[_0xf650('0x3f')][_0xf650('0x53')]));_0x3820dc['attributes']=_0x3820dc['attributes'][_0xf650('0x54')]?_0x3820dc[_0xf650('0x44')]:_0x372fb5[_0xf650('0x4f')];_0x3820dc['order']=qs['sort'](_0x2208bf[_0xf650('0x3f')][_0xf650('0xca')]);_0x3820dc[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x2208bf[_0xf650('0x3f')],_0x372fb5[_0xf650('0x51')]));if(_0x2208bf[_0xf650('0x3f')]['filter']){_0x3820dc[_0xf650('0x3c')]=_['merge'](_0x3820dc[_0xf650('0x3c')],{'$or':_['map'](_0x3820dc[_0xf650('0x44')],function(_0x44c5d0){var _0x59ba82={};_0x59ba82[_0x44c5d0]={'$like':'%'+_0x2208bf['query'][_0xf650('0x38')]+'%'};return _0x59ba82;})});}_0x3820dc=_['merge']({},_0x3820dc,_0x2208bf['options']);return _0x4b235d[_0xf650('0xe6')](_0x3820dc);}})[_0xf650('0xf')](function(_0x704e41){if(_0x704e41){_0xed6faf=_0x704e41['length'];if(!_0x2208bf[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x3820dc[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x2208bf[_0xf650('0x3f')][_0xf650('0x1f')]);_0x3820dc[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x2208bf[_0xf650('0x3f')]['offset']);}return _0x4b235d[_0xf650('0xe6')](_0x3820dc);}})['then'](function(_0x11f951){if(_0x11f951){return _0x11f951?{'count':_0xed6faf,'rows':_0x11f951}:null;}})[_0xf650('0xf')](respondWithResult(_0x3cea1f,null))[_0xf650('0x19')](handleError(_0x3cea1f,null));};exports[_0xf650('0xe8')]=function(_0x5dc536,_0x356528,_0x4c9e1e){var _0x2a9292;var _0x5bd53a;var _0xe049e7;var _0x42e825=!_[_0xf650('0x63')](_0x5dc536[_0xf650('0x4e')]['id'])?_0x5dc536['params']['id']:!_[_0xf650('0x63')](_0x5dc536[_0xf650('0x26')]['id'])?_0x5dc536[_0xf650('0x26')]['id']:null;return db[_0xf650('0x33')]['find']({'where':{'id':_0x42e825,'role':{'$or':['admin',_0xf650('0x26'),_0xf650('0x28')]}},'attributes':['id','name',_0xf650('0xe9'),'mobile',_0xf650('0x23'),_0xf650('0x5d'),_0xf650('0x9c')]})[_0xf650('0xf')](function(_0x2412a6){if(_0x2412a6){if(_0x2412a6[_0xf650('0x23')]===_0xf650('0x28')){_0x2a9292=_0x2412a6;if(_0x5dc536[_0xf650('0x58')][_0xf650('0x9e')]){_0xe049e7=util[_0xf650('0xea')](_0xf650('0xeb'),_0x2a9292[_0x5dc536[_0xf650('0x58')][_0xf650('0x9e')]]);}else if(_0x5dc536[_0xf650('0x58')]['intrf']){_0xe049e7=util[_0xf650('0xea')](_0xf650('0xac'),_0x5dc536[_0xf650('0x58')][_0xf650('0xec')]);}else{_0xe049e7=util[_0xf650('0xea')]('SIP/%s',_0x2a9292[_0xf650('0x31')]);}socket['to'](util[_0xf650('0xea')](_0xf650('0xed'),_0x2a9292['name']))[_0xf650('0xa7')](_0xf650('0xee'),{'user':{'id':_0x2a9292['id'],'name':_0x2a9292['name']},'ip':_0x5dc536[_0xf650('0xef')]['x-forwarded-for']||_0x5dc536[_0xf650('0xf0')][_0xf650('0xf1')]||_0x5dc536[_0xf650('0xf2')][_0xf650('0xf1')]||_0x5dc536['connection'][_0xf650('0xf2')][_0xf650('0xf1')]});return db[_0xf650('0xad')][_0xf650('0x2f')]({'where':{'membername':_0x2a9292[_0xf650('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x2a9292){return _0x2a9292[_0xf650('0xf3')]({'raw':!![]});}})[_0xf650('0xf')](function(_0x51a650){if(_0x2a9292){var _0x401bfb=[];if(_0x51a650){_0x5bd53a=_0x51a650;if(_0x5bd53a[_0xf650('0x54')]){for(var _0x36b1bc=0x0;_0x36b1bc<_0x5bd53a['length'];_0x36b1bc++){_0x401bfb['push']({'membername':_0x2a9292['name'],'UserId':_0x2a9292['id'],'queue_name':_0x5bd53a[_0x36b1bc]['name'],'VoiceQueueId':_0x5bd53a[_0x36b1bc]['id'],'interface':_0xe049e7,'paused':_0x2a9292[_0xf650('0x9c')]||![],'penalty':_0x5bd53a[_0x36b1bc]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xf650('0x85')](_0x401bfb,function(_0x4d7590){return db[_0xf650('0xad')]['upsert'](_0x4d7590);});}}}})['then'](function(){if(_0x2a9292){return db[_0xf650('0xf4')]['findAll']({'where':{'membername':_0x2a9292['name'],'exitAt':null}});}})[_0xf650('0xf')](function(_0x4bcbdd){if(_0x2a9292){var _0x2a53da=[];_0x4bcbdd['forEach'](function(_0x10a471){_0x2a53da[_0xf650('0x45')](_0x10a471['update']({'exitAt':moment()[_0xf650('0xea')](_0xf650('0xf5'))}));});return BPromise['all'](_0x2a53da);}})[_0xf650('0xf')](function(){if(_0x2a9292){var _0x1f85f5=[];var _0x4a441d=[];var _0x3de24a=utils[_0xf650('0xf6')]();var _0x10065b={'membername':_0x2a9292[_0xf650('0x31')],'interface':_0xe049e7,'enterAt':moment()[_0xf650('0xea')](_0xf650('0xf5')),'role':_0x2a9292[_0xf650('0x23')],'internal':_0x2a9292[_0xf650('0x5d')]};_0x3de24a[_0xf650('0xf7')](function(_0x3fa677){_0x1f85f5[_0xf650('0x45')](_['merge']({'channel':_0x3fa677,'type':_0xf650('0xf8'),'data1':_0x5dc536[_0xf650('0x58')]['device'],'data2':_0xe049e7},_0x10065b));if(_0x2a9292[_0xf650('0x9c')]){_0x4a441d['push'](_[_0xf650('0x55')]({'channel':_0x3fa677,'type':'PAUSE','data1':_0xf650('0xf9')},_0x10065b));}});return db['MemberReport']['bulkCreate'](_0x1f85f5[_0xf650('0xc7')](_0x4a441d),{'individualHooks':!![]});}})['then'](function(){if(_0x2a9292){return _0x2a9292[_0xf650('0x22')]({'online':!![],'lastLoginAt':moment()[_0xf650('0xea')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2a9292['loginInPause']||![],'mailPause':_0x2a9292[_0xf650('0x9c')]||![],'chatPause':_0x2a9292[_0xf650('0x9c')]||![],'faxPause':_0x2a9292[_0xf650('0x9c')]||![],'smsPause':_0x2a9292['loginInPause']||![],'openchannelPause':_0x2a9292[_0xf650('0x9c')]||![],'whatsappPause':_0x2a9292[_0xf650('0x9c')]||![],'pauseType':_0x2a9292[_0xf650('0x9c')]?_0xf650('0xf9'):null,'interface':_0xe049e7,'lastPauseAt':moment()['format'](_0xf650('0xf5'))});}})[_0xf650('0xf')](function(_0x13b355){if(_0x5dc536['isMiddleware']){return _0x4c9e1e();}else{return BPromise[_0xf650('0xfa')](_0x13b355)['then'](respondWithResult(_0x356528,null));}})[_0xf650('0x19')](handleError(_0x356528,null));};exports[_0xf650('0xfb')]=function(_0x97c626,_0x426bd0){var _0x56aeb5;return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x97c626[_0xf650('0x4e')]['id'],'role':_0xf650('0x28')},'attributes':['id',_0xf650('0x31'),_0xf650('0x23')]})[_0xf650('0xf')](handleEntityNotFound(_0x426bd0,null))['then'](function(_0x243de1){if(_0x243de1){_0x56aeb5=_0x243de1;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x56aeb5[_0xf650('0x31')]},'individualHooks':!![]});}})[_0xf650('0xf')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x56aeb5[_0xf650('0x31')],'exitAt':null}});})[_0xf650('0xf')](function(_0x253e59){var _0x11d943=[];_0x253e59[_0xf650('0xf7')](function(_0x4dfac3){_0x11d943[_0xf650('0x45')](_0x4dfac3['update']({'exitAt':moment()[_0xf650('0xea')](_0xf650('0xf5'))}));});return BPromise[_0xf650('0x4d')](_0x11d943);})[_0xf650('0xf')](function(){return _0x56aeb5['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x426bd0,null))[_0xf650('0x19')](handleError(_0x426bd0,null));};exports[_0xf650('0xfc')]=function(_0x556e4b,_0x1cc686){var _0x2bb9cd;return db[_0xf650('0xad')][_0xf650('0x22')]({'paused':0x1},{'where':{'UserId':_0x556e4b[_0xf650('0x4e')]['id']},'individualHooks':!![]})[_0xf650('0xf')](function(){return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x556e4b[_0xf650('0x4e')]['id'],'role':_0xf650('0x28')},'attributes':['id','name','role',_0xf650('0x5d'),'interface']});})['then'](handleEntityNotFound(_0x1cc686,null))[_0xf650('0xf')](function(_0x57b9bb){if(_0x57b9bb){_0x2bb9cd=_0x57b9bb;return respondWithRpcPromise('QueuePause',_0xf650('0xfc'),{'id':_0x2bb9cd['id'],'name':_0x2bb9cd['name'],'pause':!![]});}})[_0xf650('0xf')](function(){if(_0x2bb9cd){return db[_0xf650('0xf4')][_0xf650('0x87')]({'where':{'membername':_0x2bb9cd[_0xf650('0x31')],'type':_0xf650('0xfd'),'exitAt':null}});}})['then'](function(_0x48fe5a){if(_0x48fe5a['length']){var _0x1dbacc=moment()[_0xf650('0xea')](_0xf650('0xf5'));for(var _0x2076bb=0x0,_0x2ea094=_0x48fe5a[_0xf650('0x54')];_0x2076bb<_0x2ea094;_0x2076bb++){_0x48fe5a[_0x2076bb][_0xf650('0xfe')]({'exitAt':_0x1dbacc});}}})['then'](function(){var _0x2e76e4=[];var _0x135a98=utils[_0xf650('0xf6')]();_0x135a98[_0xf650('0xf7')](function(_0x164dfd){_0x2e76e4[_0xf650('0x45')]({'channel':_0x164dfd,'membername':_0x2bb9cd[_0xf650('0x31')],'interface':_[_0xf650('0x63')](_0x2bb9cd['interface'])?util['format'](_0xf650('0xac'),_0x2bb9cd['name']):_0x2bb9cd[_0xf650('0x9e')],'type':_0xf650('0xfd'),'enterAt':moment()[_0xf650('0xea')](_0xf650('0xf5')),'data1':_0x556e4b[_0xf650('0x58')][_0xf650('0x36')]||_0xf650('0xff'),'role':_0x2bb9cd[_0xf650('0x23')],'internal':_0x2bb9cd[_0xf650('0x5d')]});});return db[_0xf650('0xf4')][_0xf650('0x100')](_0x2e76e4,{'individualHooks':!![]});})[_0xf650('0xf')](function(){return _0x2bb9cd[_0xf650('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x556e4b[_0xf650('0x58')][_0xf650('0x36')]||_0xf650('0xff'),'lastPauseAt':moment()['format'](_0xf650('0xf5'))});})['then'](respondWithResult(_0x1cc686,null))[_0xf650('0x19')](handleError(_0x1cc686,null));};exports['unpause']=function(_0x1d68aa,_0x4106d1){var _0x251022;return db[_0xf650('0x33')][_0xf650('0x2d')]({'where':{'id':_0x1d68aa[_0xf650('0x4e')]['id']},'attributes':['id',_0xf650('0x31'),_0xf650('0x23'),'voicePause',_0xf650('0x101'),'chatPause',_0xf650('0x102'),_0xf650('0x103'),_0xf650('0x104'),_0xf650('0x105'),_0xf650('0x106'),_0xf650('0x107')]})[_0xf650('0xf')](handleEntityNotFound(_0x4106d1,null))[_0xf650('0xf')](function(_0x167b47){if(_0x167b47){_0x251022=_0x167b47;if(_0x1d68aa[_0xf650('0x58')][_0xf650('0x9b')]&&!utils[_0xf650('0x9f')](_0x1d68aa[_0xf650('0x58')]['channel'])){throw new db[(_0xf650('0x8e'))][(_0xf650('0x8f'))]('Unknown\x20channel');}switch(_0x1d68aa['body'][_0xf650('0x9b')]){case _0xf650('0xaa'):return respondWithRpcPromise(_0xf650('0x108'),_0xf650('0x109'),{'id':_0x251022['id'],'name':_0x251022[_0xf650('0x31')],'pause':![]})[_0xf650('0xf')](function(){return db[_0xf650('0xad')][_0xf650('0x22')]({'paused':0x0},{'where':{'UserId':_0x251022['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0xf650('0x2d')]({'where':{'channel':_0x1d68aa['body'][_0xf650('0x9b')],'membername':_0x251022[_0xf650('0x31')],'type':_0xf650('0xfd'),'exitAt':null}});})[_0xf650('0xf')](function(_0x3af4c2){if(_0x3af4c2){return _0x3af4c2[_0xf650('0x22')]({'exitAt':moment()[_0xf650('0xea')](_0xf650('0xf5')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xf650('0xf')](function(){return _0x251022['update']({'voicePause':![]});});case _0xf650('0x4b'):case _0xf650('0x48'):case _0xf650('0x57'):case _0xf650('0x49'):case'whatsapp':case'openchannel':return db[_0xf650('0xf4')][_0xf650('0x2d')]({'where':{'channel':_0x1d68aa[_0xf650('0x58')][_0xf650('0x9b')],'membername':_0x251022[_0xf650('0x31')],'type':'PAUSE','exitAt':null}})['then'](function(_0xaf3309){if(_0xaf3309){return _0xaf3309[_0xf650('0x22')]({'exitAt':moment()[_0xf650('0xea')](_0xf650('0xf5')),'data2':_0xf650('0x10a')},{'individualHooks':!![]});}return null;})[_0xf650('0xf')](function(){var _0x217585={};_[_0xf650('0x10b')](_0x217585,util[_0xf650('0xea')](_0xf650('0x10c'),_0x1d68aa['body'][_0xf650('0x9b')],_0xf650('0x10d')),![]);return _0x251022['update'](_0x217585);});default:return respondWithRpcPromise(_0xf650('0x108'),'unpause',{'id':_0x251022['id'],'name':_0x251022[_0xf650('0x31')],'pause':![]})[_0xf650('0xf')](function(){return db[_0xf650('0xad')][_0xf650('0x22')]({'paused':0x0},{'where':{'UserId':_0x251022['id']}});})['then'](function(){return db[_0xf650('0xf4')][_0xf650('0x87')]({'where':{'membername':_0x251022[_0xf650('0x31')],'type':_0xf650('0xfd'),'exitAt':null}});})[_0xf650('0xf')](function(_0x21c5d2){var _0x357bbd=[];_0x21c5d2[_0xf650('0xf7')](function(_0x334e55){_0x357bbd[_0xf650('0x45')](_0x334e55[_0xf650('0x22')]({'exitAt':moment()[_0xf650('0xea')](_0xf650('0xf5')),'data2':_0xf650('0x10a')}));});return BPromise['all'](_0x357bbd);})[_0xf650('0xf')](function(){return _0x251022[_0xf650('0x22')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xf650('0xf')](respondWithResult(_0x4106d1,null))[_0xf650('0x19')](handleError(_0x4106d1,null));};exports['getTeams']=function(_0x1490a1,_0x39b9e3){var _0x3d04fb={};var _0x2c0639={};var _0x29cb6a;var _0x112258;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x1490a1[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x39b9e3,null))[_0xf650('0xf')](function(_0x32d592){if(_0x32d592){_0x29cb6a=_0x32d592;_0x2c0639[_0xf650('0x4f')]=_[_0xf650('0x50')](db['Team'][_0xf650('0x34')]);_0x2c0639[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x1490a1['query']);_0x2c0639['filters']=_[_0xf650('0x52')](_0x2c0639[_0xf650('0x4f')],_0x2c0639['query']);_0x3d04fb[_0xf650('0x44')]=_[_0xf650('0x52')](_0x2c0639[_0xf650('0x4f')],qs['fields'](_0x1490a1[_0xf650('0x3f')][_0xf650('0x53')]));_0x3d04fb['attributes']=_0x3d04fb[_0xf650('0x44')]['length']?_0x3d04fb[_0xf650('0x44')]:_0x2c0639[_0xf650('0x4f')];_0x3d04fb['order']=qs[_0xf650('0xca')](_0x1490a1['query'][_0xf650('0xca')]);_0x3d04fb[_0xf650('0x3c')]=qs[_0xf650('0x51')](_[_0xf650('0xd4')](_0x1490a1[_0xf650('0x3f')],_0x2c0639['filters']));if(_0x1490a1[_0xf650('0x3f')][_0xf650('0x38')]){_0x3d04fb[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x3d04fb['where'],{'$or':_[_0xf650('0x2b')](_0x3d04fb['attributes'],function(_0xd37351){var _0x157190={};_0x157190[_0xd37351]={'$like':'%'+_0x1490a1['query']['filter']+'%'};return _0x157190;})});}_0x3d04fb=_[_0xf650('0x55')]({},_0x3d04fb,_0x1490a1[_0xf650('0x56')]);return _0x29cb6a['getTeams'](_0x3d04fb);}})[_0xf650('0xf')](function(_0x3d763b){if(_0x3d763b){_0x112258=_0x3d763b[_0xf650('0x54')];if(!_0x1490a1[_0xf650('0x3f')]['hasOwnProperty']('nolimit')){_0x3d04fb[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x1490a1[_0xf650('0x3f')][_0xf650('0x1f')]);_0x3d04fb[_0xf650('0x20')]=qs[_0xf650('0x20')](_0x1490a1[_0xf650('0x3f')][_0xf650('0x20')]);}return _0x29cb6a[_0xf650('0x10e')](_0x3d04fb);}})[_0xf650('0xf')](function(_0x39eebb){if(_0x39eebb){return _0x39eebb?{'count':_0x112258,'rows':_0x39eebb}:null;}})[_0xf650('0xf')](respondWithResult(_0x39b9e3,null))[_0xf650('0x19')](handleError(_0x39b9e3,null));};exports[_0xf650('0x10f')]=function(_0x41ee86,_0x5ad16a){return db[_0xf650('0x33')]['find']({'where':{'id':_0x41ee86['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x5ad16a,null))[_0xf650('0xf')](function(_0xeb4d59){if(_0xeb4d59){var _0x5e2d20=_0xeb4d59[_0xf650('0xa9')]({'plain':!![]});return _0xeb4d59[_0xf650('0x10f')](_0x41ee86['body'][_0xf650('0x5b')],_['omit'](_0x41ee86['body'],[_0xf650('0x5b'),'id'])||{})[_0xf650('0xf')](function(){for(var _0x1be5d0=0x0;_0x1be5d0<_0x41ee86['body']['ids'][_0xf650('0x54')];_0x1be5d0++){var _0x370834=[];var _0x398c31={};db[_0xf650('0x110')][_0xf650('0x94')]({'where':{'id':_0x41ee86[_0xf650('0x58')][_0xf650('0x5b')][_0x1be5d0]}})[_0xf650('0xf')](function(_0x43b920){_0x398c31=_0x43b920[_0xf650('0x4a')];_0x370834[_0xf650('0x45')](_0x43b920[_0xf650('0xf3')]()[_0xf650('0xf')](function(_0x29cf8e){for(var _0x3295db=0x0;_0x3295db<_0x29cf8e[_0xf650('0x54')];_0x3295db++){_0x29cf8e[_0x3295db][_0xf650('0x111')](_0xf650('0x9b'),_0xf650('0x112'));}return _0x29cf8e;}));_0x370834[_0xf650('0x45')](_0x43b920[_0xf650('0x113')]()['then'](function(_0x4be946){for(var _0x3bfa09=0x0;_0x3bfa09<_0x4be946[_0xf650('0x54')];_0x3bfa09++){_0x4be946[_0x3bfa09][_0xf650('0x111')]('channel',_0xf650('0x114'));}return _0x4be946;}));_0x370834[_0xf650('0x45')](_0x43b920['getMailQueues']()[_0xf650('0xf')](function(_0x510f9b){for(var _0x20b05a=0x0;_0x20b05a<_0x510f9b[_0xf650('0x54')];_0x20b05a++){_0x510f9b[_0x20b05a][_0xf650('0x111')]('channel',_0xf650('0x115'));}return _0x510f9b;}));_0x370834['push'](_0x43b920[_0xf650('0x116')]()[_0xf650('0xf')](function(_0x475759){for(var _0x327082=0x0;_0x327082<_0x475759[_0xf650('0x54')];_0x327082++){_0x475759[_0x327082][_0xf650('0x111')](_0xf650('0x9b'),_0xf650('0x117'));}return _0x475759;}));_0x370834['push'](_0x43b920[_0xf650('0x118')]()['then'](function(_0x3004bc){for(var _0x1e127e=0x0;_0x1e127e<_0x3004bc[_0xf650('0x54')];_0x1e127e++){_0x3004bc[_0x1e127e]['setDataValue']('channel',_0xf650('0x119'));}return _0x3004bc;}));_0x370834[_0xf650('0x45')](_0x43b920[_0xf650('0x11a')]()['then'](function(_0x2d5bec){for(var _0x5ea9ae=0x0;_0x5ea9ae<_0x2d5bec[_0xf650('0x54')];_0x5ea9ae++){_0x2d5bec[_0x5ea9ae][_0xf650('0x111')](_0xf650('0x9b'),'Fax');}return _0x2d5bec;}));_0x370834[_0xf650('0x45')](_0x43b920[_0xf650('0x11b')]()[_0xf650('0xf')](function(_0x35c8f2){for(var _0x4430f5=0x0;_0x4430f5<_0x35c8f2[_0xf650('0x54')];_0x4430f5++){_0x35c8f2[_0x4430f5]['setDataValue']('channel',_0xf650('0x11c'));}return _0x35c8f2;}));return BPromise[_0xf650('0x4d')](_0x370834);})[_0xf650('0xf')](function(_0x3d278c){var _0x41ef29=_[_0xf650('0x11d')](_0x3d278c);_0x370834=[];return db[_0xf650('0x65')][_0xf650('0x11e')](function(_0x342655){for(var _0x4d1335=0x0;_0x4d1335<_0x41ef29[_0xf650('0x54')];_0x4d1335++){_0x370834['push'](_0x41ef29[_0x4d1335]['addAgent'](_0x5e2d20['id']),{'transaction':_0x342655});}return BPromise[_0xf650('0x4d')](_0x370834)['then'](function(){if(_0x5e2d20['online']){return BPromise[_0xf650('0x85')](_['filter'](_0x41ef29,function(_0xd3db32){return _0xd3db32[_0xf650('0x11f')]('channel')===_0xf650('0x112');}),function(_0x552395){return db[_0xf650('0xad')][_0xf650('0xae')]({'membername':_0x5e2d20[_0xf650('0x31')],'UserId':_0x5e2d20['id'],'queue_name':_0x552395[_0xf650('0x31')],'VoiceQueueId':_0x552395['id'],'interface':_[_0xf650('0x63')](_0x5e2d20[_0xf650('0x9e')])?util[_0xf650('0xea')](_0xf650('0xac'),_0x5e2d20['name']):_0x5e2d20[_0xf650('0x9e')],'paused':_0x5e2d20[_0xf650('0x9d')]||![],'penalty':_0x5e2d20[_0xf650('0xa4')]},{'transaction':_0x342655});});}else{return;}})[_0xf650('0xf')](function(){for(var _0xa43838=0x0;_0xa43838<_0x41ef29[_0xf650('0x54')];_0xa43838++){var _0x53f174=_0x41ef29[_0xa43838][_0xf650('0x11f')]('channel');var _0x29529a=_0x53f174+'QueueId';socket[_0xf650('0xa7')]('user'+_0x53f174+_0xf650('0x120'),{'UserId':_0x5e2d20['id'],['queueField']:_0x41ef29[_0xa43838]['id']});}});});})[_0xf650('0xf')](function(){db['TeamVoicePrefix'][_0xf650('0x94')]({'where':{'teamId':_0x398c31['id']}})[_0xf650('0xf')](function(_0x44b3eb){if(_0x44b3eb){db['UserVoicePrefix'][_0xf650('0x7a')]({'UserId':_0x41ee86[_0xf650('0x4e')]['id'],'VoicePrefixId':_0x44b3eb[_0xf650('0x121')]});}});});}});}})[_0xf650('0xf')](respondWithStatusCode(_0x5ad16a,null))[_0xf650('0x19')](handleError(_0x5ad16a,null));};exports[_0xf650('0x122')]=function(_0x1f7eb7,_0x3816bf){return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x1f7eb7[_0xf650('0x4e')]['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x3816bf,null))['then'](function(_0xbe23a9){if(_0xbe23a9){var _0x313dda=_0xbe23a9[_0xf650('0xa9')]({'plain':!![]});var _0x590751=_0x1f7eb7[_0xf650('0x3f')]['ids'];return _0xbe23a9[_0xf650('0x122')](_0x590751)['then'](function(){for(var _0x44e376=0x0;_0x44e376<_0x590751[_0xf650('0x54')];_0x44e376++){var _0x82655b=[];var _0x32839b={};db[_0xf650('0x110')][_0xf650('0x94')]({'where':{'id':_0x590751[_0x44e376]}})[_0xf650('0xf')](function(_0x41423e){_0x32839b=_0x41423e['dataValues'];_0x82655b[_0xf650('0x45')](_0x41423e[_0xf650('0xf3')]()[_0xf650('0xf')](function(_0xad4935){for(var _0x302a92=0x0;_0x302a92<_0xad4935[_0xf650('0x54')];_0x302a92++){_0xad4935[_0x302a92][_0xf650('0x111')]('channel','Voice');}return _0xad4935;}));_0x82655b[_0xf650('0x45')](_0x41423e[_0xf650('0x113')]()[_0xf650('0xf')](function(_0x2c8525){for(var _0x53ef8a=0x0;_0x53ef8a<_0x2c8525[_0xf650('0x54')];_0x53ef8a++){_0x2c8525[_0x53ef8a]['setDataValue']('channel',_0xf650('0x114'));}return _0x2c8525;}));_0x82655b[_0xf650('0x45')](_0x41423e[_0xf650('0x123')]()['then'](function(_0x208017){for(var _0x4f20db=0x0;_0x4f20db<_0x208017[_0xf650('0x54')];_0x4f20db++){_0x208017[_0x4f20db]['setDataValue'](_0xf650('0x9b'),_0xf650('0x115'));}return _0x208017;}));_0x82655b['push'](_0x41423e[_0xf650('0x116')]()['then'](function(_0x5366fe){for(var _0x192a16=0x0;_0x192a16<_0x5366fe[_0xf650('0x54')];_0x192a16++){_0x5366fe[_0x192a16][_0xf650('0x111')]('channel',_0xf650('0x117'));}return _0x5366fe;}));_0x82655b[_0xf650('0x45')](_0x41423e['getWhatsappQueues']()[_0xf650('0xf')](function(_0x3b4f52){for(var _0x685e24=0x0;_0x685e24<_0x3b4f52[_0xf650('0x54')];_0x685e24++){_0x3b4f52[_0x685e24][_0xf650('0x111')](_0xf650('0x9b'),_0xf650('0x119'));}return _0x3b4f52;}));_0x82655b[_0xf650('0x45')](_0x41423e[_0xf650('0x11a')]()[_0xf650('0xf')](function(_0x415455){for(var _0x5e7fa9=0x0;_0x5e7fa9<_0x415455['length'];_0x5e7fa9++){_0x415455[_0x5e7fa9][_0xf650('0x111')](_0xf650('0x9b'),_0xf650('0x124'));}return _0x415455;}));_0x82655b['push'](_0x41423e[_0xf650('0x11b')]()[_0xf650('0xf')](function(_0x508951){for(var _0xf89bf3=0x0;_0xf89bf3<_0x508951[_0xf650('0x54')];_0xf89bf3++){_0x508951[_0xf89bf3]['setDataValue'](_0xf650('0x9b'),_0xf650('0x11c'));}return _0x508951;}));return BPromise['all'](_0x82655b);})[_0xf650('0xf')](function(_0x1b46b6){var _0x51917e=_[_0xf650('0x11d')](_0x1b46b6);_0x82655b=[];return db['sequelize'][_0xf650('0x11e')](function(_0x396d2b){for(var _0x50189f=0x0;_0x50189f<_0x51917e[_0xf650('0x54')];_0x50189f++){_0x82655b['push'](_0x51917e[_0x50189f]['removeAgent'](_0x313dda['id']),{'transaction':_0x396d2b});}return BPromise['all'](_0x82655b)[_0xf650('0xf')](function(){if(_0x313dda[_0xf650('0xab')]){return BPromise[_0xf650('0x85')](_[_0xf650('0x38')](_0x51917e,function(_0x272fea){return _0x272fea[_0xf650('0x11f')](_0xf650('0x9b'))==='Voice';}),function(_0x5f38be){return db[_0xf650('0xad')][_0xf650('0x2f')]({'where':{'VoiceQueueId':_0x5f38be['id'],'UserId':_0x313dda['id']},'transaction':_0x396d2b});});}else{return;}})['then'](function(){db['TeamVoicePrefix'][_0xf650('0x94')]({'where':{'teamId':_0x32839b['id']}})[_0xf650('0xf')](function(_0x45c243){if(_0x45c243){return db[_0xf650('0x125')][_0xf650('0x2f')]({'where':{'UserId':_0x313dda['id'],'VoicePrefixId':_0x45c243[_0xf650('0x4a')]['VoicePrefixId']}});}});})[_0xf650('0xf')](function(){for(var _0x442f4b=0x0;_0x442f4b<_0x51917e[_0xf650('0x54')];_0x442f4b++){var _0x2c0852=_0x51917e[_0x442f4b][_0xf650('0x11f')]('channel');var _0x428233=_0x2c0852+_0xf650('0xb3');socket['emit']('user'+_0x2c0852+_0xf650('0xb2'),{'UserId':_0x313dda['id'],['queueField']:_0x51917e[_0x442f4b]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x3816bf,null))[_0xf650('0x19')](handleError(_0x3816bf,null));};exports[_0xf650('0x126')]=function(_0x55f2ff,_0x3df05f){var _0x334c6f={};var _0x274af5={};var _0x5223aa;var _0x11126d;return db[_0xf650('0x33')]['findOne']({'where':{'id':_0x55f2ff['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x3df05f,null))[_0xf650('0xf')](function(_0x3057d5){if(_0x3057d5){_0x5223aa=_0x3057d5;_0x274af5['model']=_[_0xf650('0x50')](db['CmList']['rawAttributes']);_0x274af5[_0xf650('0x3f')]=_[_0xf650('0x50')](_0x55f2ff[_0xf650('0x3f')]);_0x274af5['filters']=_[_0xf650('0x52')](_0x274af5[_0xf650('0x4f')],_0x274af5[_0xf650('0x3f')]);_0x334c6f['attributes']=_[_0xf650('0x52')](_0x274af5['model'],qs[_0xf650('0x53')](_0x55f2ff['query'][_0xf650('0x53')]));_0x334c6f['attributes']=_0x334c6f[_0xf650('0x44')][_0xf650('0x54')]?_0x334c6f[_0xf650('0x44')]:_0x274af5['model'];_0x334c6f[_0xf650('0xc9')]=qs[_0xf650('0xca')](_0x55f2ff['query']['sort']);_0x334c6f[_0xf650('0x3c')]=qs['filters'](_['pick'](_0x55f2ff[_0xf650('0x3f')],_0x274af5[_0xf650('0x51')]));if(_0x55f2ff[_0xf650('0x3f')][_0xf650('0x38')]){_0x334c6f[_0xf650('0x3c')]=_[_0xf650('0x55')](_0x334c6f[_0xf650('0x3c')],{'$or':_[_0xf650('0x2b')](_0x334c6f['attributes'],function(_0x164833){var _0x14f40a={};_0x14f40a[_0x164833]={'$like':'%'+_0x55f2ff[_0xf650('0x3f')][_0xf650('0x38')]+'%'};return _0x14f40a;})});}_0x334c6f=_[_0xf650('0x55')]({},_0x334c6f,_0x55f2ff[_0xf650('0x56')]);return _0x5223aa[_0xf650('0x126')](_0x334c6f);}})[_0xf650('0xf')](function(_0x3703fe){if(_0x3703fe){_0x11126d=_0x3703fe[_0xf650('0x54')];if(!_0x55f2ff[_0xf650('0x3f')][_0xf650('0xcb')](_0xf650('0xd1'))){_0x334c6f[_0xf650('0x1f')]=qs[_0xf650('0x1f')](_0x55f2ff['query']['limit']);_0x334c6f[_0xf650('0x20')]=qs['offset'](_0x55f2ff['query'][_0xf650('0x20')]);}return _0x5223aa['getLists'](_0x334c6f);}})[_0xf650('0xf')](function(_0x232f2d){if(_0x232f2d){return _0x232f2d?{'count':_0x11126d,'rows':_0x232f2d}:null;}})['then'](respondWithResult(_0x3df05f,null))[_0xf650('0x19')](handleError(_0x3df05f,null));};exports[_0xf650('0x127')]=function(_0x1432ed,_0x50a4b4){var _0x2ed3a7={};var _0x34baa0={};var _0xac476a;return db[_0xf650('0x33')][_0xf650('0x94')]({'where':{'id':_0x1432ed['params']['id']}})[_0xf650('0xf')](handleEntityNotFound(_0x50a4b4,null))[_0xf650('0xf')](function(_0x29e165){if(_0x29e165){_0xac476a=_0x29e165;_0x34baa0[_0xf650('0x4f')]=_[_0xf650('0x50')](db[_0xf650('0x33')]['rawAttributes']);_0x34baa0['query']=_[_0xf650('0x50')](_0x1432ed['query']);_0x34baa0[_0xf650('0x51')]=_[_0xf650('0x52')](_0x34baa0['model'],_0x34baa0[_0xf650('0x3f')]);_0x2ed3a7[_0xf650('0x44')]=_[_0xf650('0x52')](_0x34baa0[_0xf650('0x4f')],qs[_0xf650('0x53')](_0x1432ed[_0xf650('0x3f')][_0xf650('0x53')]));_0x2ed3a7[_0xf650('0x44')]=_0x2ed3a7[_0xf650('0x44')][_0xf650('0x54')]?_0x2ed3a7[_0xf650('0x44')]:_0x34baa0[_0xf650('0x4f')];_0x2ed3a7['order']=qs[_0xf650('0xca')](_0x1432ed['query'][_0xf650('0xca')]);_0x2ed3a7[_0xf650('0x3c')]=qs[_0xf650('0x51')](_['pick'](_0x1432ed[_0xf650('0x3f')],_0x34baa0[_0xf650('0x51')]));if(_0x1432ed[_0xf650('0x3f')][_0xf650('0x38')]){_0x2ed3a7['where']=_['merge'](_0x2ed3a7[_0xf650('0x3c')],{'$or':_['map'](_0x2ed3a7[_0xf650('0x44')],function(_0x18b281){var _0x38786e={};_0x38786e[_0x18b281]={'$like':'%'+_0x1432ed['query'][_0xf650('0x38')]+'%'};return _0x38786e;})});}_0x2ed3a7[_0xf650('0x4f')]=db['User'];_0x2ed3a7['as']=_0xf650('0x27');_0x2ed3a7=_[_0xf650('0x55')]({},_0x2ed3a7,_0x1432ed[_0xf650('0x56')]);return _0xac476a[_0xf650('0xf3')]({'include':[_0x2ed3a7]});}})['then'](function(_0x46b86f){if(_0x46b86f){var _0x13105a={},_0x71e26e=[];for(var _0x35ed57=0x0;_0x35ed57<_0x46b86f[_0xf650('0x54')];_0x35ed57+=0x1){for(var _0x59822c=0x0,_0x4ad5a1;_0x59822c<_0x46b86f[_0x35ed57][_0xf650('0x27')][_0xf650('0x54')];_0x59822c+=0x1){_0x4ad5a1=_0x46b86f[_0x35ed57][_0xf650('0x27')][_0x59822c]['get']({'plain':!![]});_0x13105a[_0x4ad5a1['id']]=_0x4ad5a1;}}_0x13105a=_['values'](_0x13105a);for(var _0x5162d4=qs[_0xf650('0x20')](_0x1432ed['query'][_0xf650('0x20')]);_0x5162d4<_0x13105a['length']&&_0x71e26e[_0xf650('0x54')]=_0x436ef2){_0x2131ee=_0x436ef2;_0x2cf67e=0xc8;}else{_0x2cf67e=0xce;}_0x2e4145[_0x50aa('0x20')](_0x2cf67e);return _0x2e4145[_0x50aa('0x26')](_0x50aa('0x27'),_0xb0a005+'-'+_0x2131ee+'/'+_0x436ef2)[_0x50aa('0x21')](_0x2edb90);}return null;};}function saveUpdates(_0x3c2fb2){return function(_0x22cdf6){if(_0x22cdf6){return _0x22cdf6[_0x50aa('0x28')](_0x3c2fb2)['then'](function(_0x2f39cd){return _0x2f39cd;});}return null;};}function removeEntity(_0x362c15){return function(_0x55710a){if(_0x55710a){return _0x55710a[_0x50aa('0x29')]()[_0x50aa('0x15')](function(){var _0x4f7660=_0x55710a[_0x50aa('0x2a')]({'plain':!![]});if(_0x4f7660['role']===_0x50aa('0x2b'))return;var _0x4486c1=[{'name':_0x50aa('0x2c'),'value':'user','ignore':!![]},{'name':_0x50aa('0x2d'),'value':_0x50aa('0x2e'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3cad53=_(_0x4486c1)[_0x50aa('0x2f')]('ignore')[_0x50aa('0x30')](_0x50aa('0x31'))['value']();if(_[_0x50aa('0x32')](_0x3cad53,_0x4f7660[_0x50aa('0x33')])){return;}var _0x150ca4=_[_0x50aa('0x34')](_0x4486c1,[_0x50aa('0x31'),_0x4f7660[_0x50aa('0x33')]])[_0x50aa('0x35')];return db['UserProfileResource'][_0x50aa('0x29')]({'where':{'type':_0x150ca4,'resourceId':_0x4f7660['id']}})[_0x50aa('0x15')](function(){return _0x55710a;});})[_0x50aa('0x15')](function(){_0x362c15[_0x50aa('0x20')](0xcc)[_0x50aa('0x36')]();});}};}function handleEntityNotFound(_0x41ae1c){return function(_0x2d8213){if(!_0x2d8213){_0x41ae1c[_0x50aa('0x37')](0x194);}return _0x2d8213;};}function handleError(_0x1c317c,_0x39b078){_0x39b078=_0x39b078||0x1f4;return function(_0x4403c9){logger[_0x50aa('0x1c')](_0x4403c9[_0x50aa('0x38')]);if(_0x4403c9[_0x50aa('0x35')]){delete _0x4403c9[_0x50aa('0x35')];}_0x1c317c[_0x50aa('0x20')](_0x39b078)[_0x50aa('0x39')](_0x4403c9);};}exports[_0x50aa('0x3a')]=function(_0x505777,_0x11f8e1){var _0xef8550={},_0x5c4b7e={'count':0x0,'rows':[]};var _0x4c6f44=_(db['User']['rawAttributes'])[_0x50aa('0x30')](function(_0xe73b89){return{'name':_0xe73b89[_0x50aa('0x3b')],'type':_0xe73b89['type']['key']};})[_0x50aa('0x2f')](function(_0x53307c){return!_['includes']([_0x50aa('0x3c'),_0x50aa('0x3d')],_0x53307c['name']);})[_0x50aa('0x31')]();_0xef8550=qs['getOptions'](_0x4c6f44,_0x505777);var _0x1e6e9d={'where':_0xef8550[_0x50aa('0x3e')]};return db['User'][_0x50aa('0x24')](_0x1e6e9d)[_0x50aa('0x15')](function(_0x426b33){_0x5c4b7e[_0x50aa('0x24')]=_0x426b33;if(_0x505777['query'][_0x50aa('0x3f')]){_0xef8550[_0x50aa('0x40')]=[{'all':!![]}];}if(_0x505777['query'][_0x50aa('0x41')]===_0x50aa('0x42')){_0xef8550[_0x50aa('0x40')]=[{'model':db[_0x50aa('0x43')],'as':_0x50aa('0x41')}];}if(!_[_0x50aa('0x32')](_0xef8550[_0x50aa('0x44')],'id')){_0xef8550[_0x50aa('0x44')]['push']('id');}return db[_0x50aa('0x45')][_0x50aa('0x46')](_0xef8550);})[_0x50aa('0x15')](function(_0x36ebf3){_0x5c4b7e['rows']=_0x36ebf3;if(_0x505777[_0x50aa('0x47')]['openTabs']===_0x50aa('0x42')){var _0x44e984=[];for(var _0x65ffcf=0x0;_0x65ffcf<_0x5c4b7e[_0x50aa('0x48')][_0x50aa('0x49')];_0x65ffcf++){_0x44e984[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4b'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));_0x44e984['push'](get_open_tabs(_0x50aa('0x4d'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));_0x44e984['push'](get_open_tabs(_0x50aa('0x4e'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));_0x44e984[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4f'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));_0x44e984[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x50'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));_0x44e984['push'](get_open_tabs(_0x50aa('0x51'),_0x5c4b7e[_0x50aa('0x48')][_0x65ffcf][_0x50aa('0x4c')]));}return BPromise[_0x50aa('0x52')](_0x44e984)[_0x50aa('0x15')](function(){return _0x5c4b7e;});}else{return _0x5c4b7e;}})['then'](respondWithFilteredResult(_0x11f8e1,_0xef8550))['catch'](handleError(_0x11f8e1,null));};exports[_0x50aa('0x53')]=function(_0x4ac728,_0x3a30b5){var _0x15ad91={'raw':![],'where':{'id':_0x4ac728[_0x50aa('0x54')]['id']}},_0x5bf0fc={};_0x5bf0fc['model']=_[_0x50aa('0x55')](_[_0x50aa('0x56')](db[_0x50aa('0x45')][_0x50aa('0x57')]),[_0x50aa('0x3c'),_0x50aa('0x3d')]);_0x5bf0fc[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x4ac728[_0x50aa('0x47')]);_0x5bf0fc[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x5bf0fc[_0x50aa('0x5a')],_0x5bf0fc[_0x50aa('0x47')]);_0x15ad91[_0x50aa('0x44')]=_['intersection'](_0x5bf0fc[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x4ac728[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x15ad91[_0x50aa('0x44')]=_0x15ad91[_0x50aa('0x44')][_0x50aa('0x49')]?_0x15ad91[_0x50aa('0x44')]:_0x5bf0fc[_0x50aa('0x5a')];if(_0x4ac728[_0x50aa('0x47')][_0x50aa('0x3f')]){_0x15ad91[_0x50aa('0x40')]=[{'all':!![]}];}if(_0x4ac728[_0x50aa('0x47')][_0x50aa('0x41')]===_0x50aa('0x42')){_0x15ad91['include']=[{'model':db[_0x50aa('0x43')],'as':_0x50aa('0x41')}];}_0x15ad91=_[_0x50aa('0x5c')]({},_0x15ad91,_0x4ac728['options']);if(!_[_0x50aa('0x32')](_0x15ad91[_0x50aa('0x44')],'id')){_0x15ad91[_0x50aa('0x44')][_0x50aa('0x4a')]('id');}return db['User']['find'](_0x15ad91)[_0x50aa('0x15')](handleEntityNotFound(_0x3a30b5,null))['then'](function(_0x3db7c4){var _0x1b8249=[];values=_0x3db7c4;if(_0x4ac728[_0x50aa('0x47')]['openTabs']==='true'){_0x1b8249[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4b'),_0x3db7c4[_0x50aa('0x4c')]));_0x1b8249[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4d'),_0x3db7c4[_0x50aa('0x4c')]));_0x1b8249[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x50'),_0x3db7c4[_0x50aa('0x4c')]));_0x1b8249['push'](get_open_tabs(_0x50aa('0x51'),_0x3db7c4['dataValues']));_0x1b8249['push'](get_open_tabs(_0x50aa('0x4e'),_0x3db7c4['dataValues']));_0x1b8249[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4f'),_0x3db7c4[_0x50aa('0x4c')]));return BPromise[_0x50aa('0x52')](_0x1b8249);}else{return values;}})[_0x50aa('0x15')](function(){return values;})[_0x50aa('0x15')](respondWithResult(_0x3a30b5,null))[_0x50aa('0x1f')](handleError(_0x3a30b5,null));};exports['update']=function(_0xd43ea7,_0x21bee6){if(_0xd43ea7[_0x50aa('0x5d')]['id']){delete _0xd43ea7[_0x50aa('0x5d')]['id'];}delete _0xd43ea7[_0x50aa('0x5d')][_0x50aa('0x33')];return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0xd43ea7[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x21bee6,null))[_0x50aa('0x15')](saveUpdates(_0xd43ea7['body'],null))[_0x50aa('0x15')](respondWithResult(_0x21bee6,null))[_0x50aa('0x1f')](handleError(_0x21bee6,null));};exports[_0x50aa('0x5e')]=function(_0x915450,_0x3a9cf4){return db[_0x50aa('0x45')][_0x50aa('0x5e')]()[_0x50aa('0x15')](respondWithResult(_0x3a9cf4,null))[_0x50aa('0x1f')](handleError(_0x3a9cf4,null));};exports['addContacts']=function(_0x12f6bd,_0xe63cec){return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x12f6bd['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0xe63cec,null))[_0x50aa('0x15')](function(_0xaad9c3){if(_0xaad9c3){return _0xaad9c3['addContacts'](_0x12f6bd['body'][_0x50aa('0x5f')],_[_0x50aa('0x60')](_0x12f6bd[_0x50aa('0x5d')],[_0x50aa('0x5f'),'id'])||{});}})[_0x50aa('0x15')](respondWithResult(_0xe63cec,null))[_0x50aa('0x1f')](handleError(_0xe63cec,null));};function validateUser(_0x25e14c){return new BPromise(function(_0x427218,_0x2af4b9){if(_0x25e14c[_0x50aa('0x61')])return _0x427218(_0x25e14c);return db[_0x50aa('0x62')][_0x50aa('0x63')](0x1)[_0x50aa('0x15')](function(_0x4cdba8){if(_0x4cdba8[_0x50aa('0x64')])authService[_0x50aa('0x65')](_0x25e14c[_0x50aa('0x3c')]);db['User'][_0x50aa('0x66')]('internal')['then'](function(_0x1b3cfd){if(_['isNil'](_0x1b3cfd)){_0x25e14c[_0x50aa('0x61')]=_0x4cdba8[_0x50aa('0x67')]||0x1;return;}if(_[_0x50aa('0x68')](_0x4cdba8[_0x50aa('0x67')])||_0x4cdba8[_0x50aa('0x67')]===_0x1b3cfd){_0x25e14c['internal']=_0x1b3cfd+0x1;return;}if(_0x4cdba8[_0x50aa('0x67')]>_0x1b3cfd){_0x25e14c['internal']=_0x4cdba8['min_internal'];return;}return db[_0x50aa('0x69')]['query'](_0x50aa('0x6a'),{'type':db[_0x50aa('0x69')][_0x50aa('0x6b')]['SELECT']})[_0x50aa('0x15')](function(_0x70d041){if(_0x70d041&&_0x70d041[_0x50aa('0x49')]){for(var _0x9e77bb=0x0,_0x5f8092=_0x70d041[_0x50aa('0x49')];_0x9e77bb<_0x5f8092&&_[_0x50aa('0x68')](_0x25e14c[_0x50aa('0x61')]);_0x9e77bb++){if(_0x4cdba8[_0x50aa('0x67')]<=_0x70d041[_0x9e77bb][_0x50aa('0x6c')]){_0x25e14c['internal']=_0x70d041[_0x9e77bb][_0x50aa('0x6c')];}else if(_0x4cdba8[_0x50aa('0x67')]>_0x70d041[_0x9e77bb]['from']&&_0x4cdba8[_0x50aa('0x67')]<=_0x70d041[_0x9e77bb]['to']){_0x25e14c[_0x50aa('0x61')]=_0x4cdba8[_0x50aa('0x67')];}}}if(_[_0x50aa('0x68')](_0x25e14c[_0x50aa('0x61')])){_0x25e14c[_0x50aa('0x61')]=_0x1b3cfd+0x1;}return _0x427218(_0x25e14c);});});})[_0x50aa('0x1f')](function(_0x2eaa2f){_0x2af4b9(_0x2eaa2f);});});}function updateUser(_0x130e12){return new BPromise(function(_0x11fae6,_0x3da640){try{if(_0x130e12[_0x50aa('0x6d')]){_0x130e12['mailbox']=_0x130e12[_0x50aa('0x61')];_0x130e12[_0x50aa('0x6e')]={'mailbox':_0x130e12['internal'],'password':_0x130e12[_0x50aa('0x3c')],'fullname':_0x130e12[_0x50aa('0x6f')],'email':_0x130e12[_0x50aa('0x70')]};}if(_0x130e12[_0x50aa('0x33')]===_0x50aa('0x2e')){if(!_0x130e12['permissions'])_0x130e12['permissions']=[_0x50aa('0x71'),'102',_0x50aa('0x72'),_0x50aa('0x73'),_0x50aa('0x74'),_0x50aa('0x75'),'105','106','107','108',_0x50aa('0x76'),_0x50aa('0x77'),'111','114',_0x50aa('0x78')];}_0x11fae6(_0x130e12);}catch(_0xf18463){_0x3da640(_0xf18463);}});}exports[_0x50aa('0x79')]=function(_0x41aa65,_0x2de885){if(_0x41aa65[_0x50aa('0x7a')][_0x50aa('0x33')]===_0x50aa('0x2e'))throw new Error(_0x50aa('0x7b'));if(_0x41aa65[_0x50aa('0x5d')][_0x50aa('0x33')]===_0x50aa('0x7a')&&_0x41aa65[_0x50aa('0x7a')][_0x50aa('0x33')]!==_0x50aa('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x41aa65['body'][_0x50aa('0x33')]===_0x50aa('0x2b')&&_0x41aa65[_0x50aa('0x7a')]['role']!=='admin'){throw new Error(_0x50aa('0x7c'));}return licenseUtil[_0x50aa('0x7d')]([_0x41aa65[_0x50aa('0x5d')]])[_0x50aa('0x15')](function(){return validateUser(_0x41aa65['body']);})[_0x50aa('0x15')](function(_0x249545){return updateUser(_0x249545)['then'](function(_0x4b6c01){if(_0x4b6c01[_0x50aa('0x33')]===_0x50aa('0x2b')){_0x4b6c01[_0x50aa('0x7e')]=_0x41aa65[_0x50aa('0x7a')]['settingsEnabled'];delete _0x4b6c01[_0x50aa('0x7f')];}return _0x4b6c01;});})['then'](function(_0x47e88e){return db[_0x50aa('0x45')][_0x50aa('0x79')](_0x47e88e,{'include':[{'model':db[_0x50aa('0x6e')],'as':_0x50aa('0x6e')}]});})[_0x50aa('0x15')](function(_0x4590fa){if(_0x41aa65[_0x50aa('0x5d')][_0x50aa('0x33')]==='user')return _0x4590fa;if(_0x41aa65[_0x50aa('0x7a')]['role']!==_0x50aa('0x7a'))return _0x4590fa;return db[_0x50aa('0x80')][_0x50aa('0x34')]({'where':{'name':_0x4590fa[_0x50aa('0x33')]==='agent'?_0x50aa('0x2d'):_0x50aa('0x81'),'userProfileId':_0x41aa65[_0x50aa('0x7a')][_0x50aa('0x7f')]},'raw':!![]})['then'](function(_0x16065d){if(!_0x16065d||_0x16065d[_0x50aa('0x82')]!=0x0)return _0x4590fa;return db[_0x50aa('0x83')][_0x50aa('0x79')]({'name':_0x4590fa[_0x50aa('0x35')],'resourceId':_0x4590fa['id'],'type':_0x16065d[_0x50aa('0x35')],'sectionId':_0x16065d['id']},{})[_0x50aa('0x15')](function(){return _0x4590fa;});})['catch'](function(_0x346320){logger[_0x50aa('0x1c')](_0x50aa('0x84'),_0x346320);throw _0x346320;});})[_0x50aa('0x15')](respondWithResult(_0x2de885,0xc9))['catch'](handleError(_0x2de885,null));};exports[_0x50aa('0x85')]=function(_0x2b7482,_0x4baab3){var _0x40c95f=_0x2b7482[_0x50aa('0x5d')];var _0x1032ec=[];if(_0x2b7482['user'][_0x50aa('0x33')]==='agent')throw new Error(_0x50aa('0x7b'));if(_[_0x50aa('0x86')](_0x40c95f,['role',_0x50aa('0x7a')])&&_0x2b7482[_0x50aa('0x7a')][_0x50aa('0x33')]!==_0x50aa('0x2b')){throw new Error(_0x50aa('0x87'));}if(_[_0x50aa('0x86')](_0x40c95f,['role',_0x50aa('0x2b')])&&_0x2b7482[_0x50aa('0x7a')]['role']!==_0x50aa('0x2b')){throw new Error(_0x50aa('0x88'));}return licenseUtil['checkUserLimits'](_0x40c95f)[_0x50aa('0x15')](function(){return validateUser(_0x40c95f[0x0]);})[_0x50aa('0x15')](function(){for(var _0x138453=0x1;_0x138453<_0x40c95f[_0x50aa('0x49')];_0x138453++){var _0x27da63=_0x40c95f[_0x138453-0x1][_0x50aa('0x61')];if(!_0x40c95f[_0x138453][_0x50aa('0x61')])_0x40c95f[_0x138453]['internal']=_0x27da63+0x1;_0x1032ec[_0x50aa('0x4a')](validateUser(_0x40c95f[_0x138453]));}return BPromise[_0x50aa('0x52')](_0x1032ec);})['then'](function(){_0x1032ec=[];for(var _0x126d82=0x0;_0x126d82<_0x40c95f[_0x50aa('0x49')];_0x126d82++){_0x1032ec[_0x50aa('0x4a')](updateUser(_0x40c95f[_0x126d82]));}return BPromise[_0x50aa('0x52')](_0x1032ec);})[_0x50aa('0x15')](function(){return BPromise[_0x50aa('0x89')](_0x40c95f,function(_0x1de1b1){return db[_0x50aa('0x45')][_0x50aa('0x79')](_0x1de1b1,{'include':[{'model':db[_0x50aa('0x6e')],'as':_0x50aa('0x6e')}]})[_0x50aa('0x15')](function(_0x46190d){_0x1de1b1['id']=_0x46190d['id'];return _0x1de1b1;});});})[_0x50aa('0x15')](function(_0x104635){if(_0x2b7482[_0x50aa('0x5d')][_0x50aa('0x33')]===_0x50aa('0x7a'))return _0x104635;if(_0x2b7482[_0x50aa('0x7a')][_0x50aa('0x33')]!==_0x50aa('0x7a'))return _0x104635;var _0x29bda1=_['some'](_0x104635,function(_0x2da1eb){return _0x2da1eb[_0x50aa('0x33')]===_0x50aa('0x2e')||_0x2da1eb[_0x50aa('0x33')]===_0x50aa('0x8a');});if(!_0x29bda1)return _0x104635;return db['UserProfileSection'][_0x50aa('0x46')]({'where':{'name':{'$or':['Agents',_0x50aa('0x81')]},'userProfileId':_0x2b7482[_0x50aa('0x7a')][_0x50aa('0x7f')]},'raw':!![]})['then'](function(_0x408592){if(_['isEmpty'](_0x408592)||!_[_0x50aa('0x86')](_0x408592,[_0x50aa('0x82'),0x0]))return _0x104635;_0x1032ec=[];var _0x2681d6=_(_0x408592)[_0x50aa('0x30')](function(_0x517800){if(_0x517800[_0x50aa('0x82')]===0x1)return;return _0x517800[_0x50aa('0x35')]===_0x50aa('0x2d')?_0x50aa('0x2e'):_0x50aa('0x8a');})[_0x50aa('0x8b')]()['value']();for(var _0x162f20=0x0;_0x162f20<_0x104635[_0x50aa('0x49')];_0x162f20++){if(!_[_0x50aa('0x32')](_0x2681d6,_0x104635[_0x162f20]['role']))return;var _0x3f5e6a=_0x104635[_0x162f20][_0x50aa('0x33')]===_0x50aa('0x2e')?_0x50aa('0x2d'):'Telephones';_0x1032ec[_0x50aa('0x4a')](db['UserProfileResource'][_0x50aa('0x79')]({'name':_0x104635[_0x162f20][_0x50aa('0x35')],'resourceId':_0x104635[_0x162f20]['id'],'type':_0x3f5e6a,'sectionId':_['find'](_0x408592,[_0x50aa('0x35'),_0x3f5e6a])['id']},{}));}return BPromise[_0x50aa('0x52')](_0x1032ec);});})[_0x50aa('0x15')](respondWithResult(_0x4baab3,0xc9))[_0x50aa('0x1f')](handleError(_0x4baab3,null));};exports[_0x50aa('0x8c')]=function(_0x9c7e4c,_0x1dfd0e){if(_0x9c7e4c['body']['id']){delete _0x9c7e4c[_0x50aa('0x5d')]['id'];}return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x9c7e4c[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](function(_0x32c695){if(!_0x32c695)return null;if(_0x32c695['id']===_0x9c7e4c[_0x50aa('0x7a')]['id']){if(!_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8d')]||!_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')]){throw new db[(_0x50aa('0x8f'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x32c695[_0x50aa('0x90')](_0x9c7e4c[_0x50aa('0x5d')]['oldPassword'])){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x92'));}if(_0x9c7e4c[_0x50aa('0x5d')]['oldPassword']===_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')]){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x93'));}}else if(_0x9c7e4c[_0x50aa('0x7a')][_0x50aa('0x33')]===_0x50aa('0x2b')){if(!_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')]){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x94'));}}else if(_0x9c7e4c['user']['role']==='user'){if(!_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')]){throw new db[(_0x50aa('0x8f'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x32c695[_0x50aa('0x33')]!=='agent'){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x7b'));}}else{throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x7b'));}return _0x32c695;})[_0x50aa('0x15')](handleEntityNotFound(_0x1dfd0e,null))[_0x50aa('0x15')](function(_0x324657){return db[_0x50aa('0x62')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x50aa('0x95')]})['then'](function(_0x49f9aa){if(_0x49f9aa['securePassword'])authService[_0x50aa('0x65')](_0x9c7e4c[_0x50aa('0x5d')]['newPassword']);if(!_0x49f9aa[_0x50aa('0x96')]||!_0x324657[_0x50aa('0x97')])return _0x324657;authService[_0x50aa('0x98')](_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')],_0x324657[_0x50aa('0x97')],_0x49f9aa[_0x50aa('0x95')]);return _0x324657;})['then'](saveUpdates({'password':_0x9c7e4c[_0x50aa('0x5d')][_0x50aa('0x8e')],'passwordResetAt':_0x9c7e4c[_0x50aa('0x7a')]['id']==_0x9c7e4c[_0x50aa('0x54')]['id']?moment():null,'previousPasswords':authService[_0x50aa('0x99')](_0x9c7e4c['body'][_0x50aa('0x8e')],_0x324657[_0x50aa('0x97')])},null));})[_0x50aa('0x15')](respondWithResult(_0x1dfd0e,null))[_0x50aa('0x1f')](handleError(_0x1dfd0e,null));};exports[_0x50aa('0x9a')]=function(_0xdabda8,_0x54756d){var _0x17c383=_0xdabda8[_0x50aa('0x5d')][_0x50aa('0x9b')];return db['User'][_0x50aa('0x34')]({'where':{'id':_0xdabda8[_0x50aa('0x54')]['id']},'attributes':['id',_0x50aa('0x35'),_0x50aa('0x33'),'online',_0x50aa('0x9c'),_0x50aa('0x9d'),'interface']})['then'](handleEntityNotFound(_0x54756d,null))[_0x50aa('0x15')](function(_0x175c92){if(_0x175c92){if(!utils[_0x50aa('0x9e')](_0x17c383)){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x9f'));}return _0x175c92[_0x50aa('0xa0')+_[_0x50aa('0xa1')](_0x17c383['toLowerCase']())+_0x50aa('0xa2')](_0xdabda8['body'][_0x50aa('0x5f')],{'penalty':_0xdabda8['body'][_0x50aa('0xa3')]||0x0})[_0x50aa('0xa4')](function(_0x2a5aee){for(var _0x3a1326=0x0;_0x3a1326<_0xdabda8[_0x50aa('0x5d')][_0x50aa('0x5f')]['length'];_0x3a1326+=0x1){var _0x2853b8={'UserId':Number(_0xdabda8['params']['id'])};_0x2853b8[_[_0x50aa('0xa1')](_0x17c383[_0x50aa('0xa5')]())+_0x50aa('0xa6')]=Number(_0xdabda8[_0x50aa('0x5d')][_0x50aa('0x5f')][_0x3a1326]);socket[_0x50aa('0xa7')](_0x50aa('0x7a')+_['capitalize'](_0x17c383['toLowerCase']())+'Queue:save',_0x2853b8);}return _0x2a5aee;})[_0x50aa('0x15')](function(){if(_0x17c383===_0x50aa('0xa8')){return db[_0x50aa('0xa9')]['findAll']({'where':{'id':_0xdabda8[_0x50aa('0x5d')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x69e492){var _0x3f8612=_0x175c92[_0x50aa('0x2a')]({'plain':!![]});var _0x421175=[];if(_0x17c383===_0x50aa('0xa8')&&_0x3f8612[_0x50aa('0x33')]===_0x50aa('0x2e')&&_0x3f8612[_0x50aa('0xaa')]){for(var _0x26fb58=0x0;_0x26fb58<_0x69e492[_0x50aa('0x49')];_0x26fb58+=0x1){_0x421175[_0x50aa('0x4a')]({'membername':_0x3f8612[_0x50aa('0x35')],'UserId':_0x3f8612['id'],'queue_name':_0x69e492[_0x26fb58][_0x50aa('0x35')],'VoiceQueueId':_0x69e492[_0x26fb58]['id'],'interface':_[_0x50aa('0x68')](_0x3f8612[_0x50aa('0xab')])?util[_0x50aa('0xac')]('SIP/%s',_0x3f8612[_0x50aa('0x35')]):_0x3f8612[_0x50aa('0xab')],'paused':_0x3f8612[_0x50aa('0x9d')]||![],'penalty':_0xdabda8[_0x50aa('0x5d')][_0x50aa('0xa3')]||0x0});}return BPromise['each'](_0x421175,function(_0xe3417a){return db['UserVoiceQueueRt']['upsert'](_0xe3417a);});}return _0x175c92;});}})[_0x50aa('0x15')](respondWithStatusCode(_0x54756d,null))['catch'](handleError(_0x54756d,null));};exports[_0x50aa('0xad')]=function(_0x4086f5,_0x4ce72e){var _0x49e1f5,_0x55cd18;return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x4086f5[_0x50aa('0x54')]['id']},'attributes':['id','name',_0x50aa('0x33')]})['then'](handleEntityNotFound(_0x4ce72e,null))[_0x50aa('0x15')](function(_0x435824){if(_0x435824){_0x49e1f5=_0x435824;if(!_0x4086f5[_0x50aa('0x47')][_0x50aa('0x9b')]||!utils[_0x50aa('0x9e')](_0x4086f5['query'][_0x50aa('0x9b')])){throw new db['Sequelize'][(_0x50aa('0x91'))](_0x50aa('0x9f'));}return _0x435824[_0x50aa('0xae')+_[_0x50aa('0xa1')](_0x4086f5[_0x50aa('0x47')][_0x50aa('0x9b')][_0x50aa('0xa5')]())+_0x50aa('0xa2')](_0x4086f5[_0x50aa('0x47')]['ids']);}})[_0x50aa('0x15')](function(_0x653548){if(_[_0x50aa('0xaf')](_0x4086f5['query'][_0x50aa('0x5f')])){for(var _0x4b541b=0x0;_0x4b541b<_0x4086f5['query'][_0x50aa('0x5f')][_0x50aa('0x49')];_0x4b541b+=0x1){_0x55cd18={'UserId':Number(_0x4086f5[_0x50aa('0x54')]['id'])};_0x55cd18[_[_0x50aa('0xa1')](_0x4086f5[_0x50aa('0x47')][_0x50aa('0x9b')][_0x50aa('0xa5')]())+'QueueId']=Number(_0x4086f5[_0x50aa('0x47')][_0x50aa('0x5f')][_0x4b541b]);socket['emit'](_0x50aa('0x7a')+_[_0x50aa('0xa1')](_0x4086f5[_0x50aa('0x47')]['channel'][_0x50aa('0xa5')]())+'Queue:remove',_0x55cd18);}}else{_0x55cd18={'UserId':Number(_0x4086f5['params']['id'])};_0x55cd18[_[_0x50aa('0xa1')](_0x4086f5[_0x50aa('0x47')][_0x50aa('0x9b')][_0x50aa('0xa5')]())+_0x50aa('0xa6')]=Number(_0x4086f5[_0x50aa('0x47')]['ids']);socket[_0x50aa('0xa7')](_0x50aa('0x7a')+_[_0x50aa('0xa1')](_0x4086f5[_0x50aa('0x47')]['channel']['toLowerCase']())+_0x50aa('0xb0'),_0x55cd18);}return _0x653548;})[_0x50aa('0x15')](function(){if(_0x4086f5[_0x50aa('0x47')]['channel']===_0x50aa('0xa8')){return db['UserVoiceQueueRt'][_0x50aa('0x29')]({'where':{'UserId':_0x4086f5[_0x50aa('0x54')]['id'],'VoiceQueueId':_0x4086f5[_0x50aa('0x47')][_0x50aa('0x5f')]},'individualHooks':!![]})['then'](function(){return _0x49e1f5;});}return _0x49e1f5;})['then'](respondWithStatusCode(_0x4ce72e,null))[_0x50aa('0x1f')](handleError(_0x4ce72e,null));};exports[_0x50aa('0xb1')]=function(_0x5526c6,_0x59862d){_0x5526c6[_0x50aa('0x5d')][_0x50aa('0xb2')]=_0x5526c6['file'][_0x50aa('0xb3')];return db['User']['find']({'where':{'id':_0x5526c6['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x59862d,null))['then'](saveUpdates(_0x5526c6['body'],null))[_0x50aa('0x15')](respondWithResult(_0x59862d,null))[_0x50aa('0x1f')](handleError(_0x59862d,null));};exports[_0x50aa('0xb4')]=function(_0x14795c,_0x5ab47a){var _0x67a5c3=path[_0x50aa('0xb5')](config[_0x50aa('0xb6')],_0x50aa('0xb7'));return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x14795c[_0x50aa('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x50aa('0x15')](handleEntityNotFound(_0x5ab47a,null))[_0x50aa('0x15')](function(_0x250a2c){if(_0x250a2c){if(_[_0x50aa('0x68')](_0x250a2c['userpic'])){return _0x5ab47a['download'](_0x67a5c3);}else{if(!fs[_0x50aa('0xb8')](path[_0x50aa('0xb5')](config['root'],'server/files/images/',_0x250a2c['userpic']))){return _0x5ab47a['download'](_0x67a5c3);}return _0x5ab47a[_0x50aa('0xb9')](path['join'](config['root'],_0x50aa('0xba'),_0x250a2c['userpic']));}}})['catch'](handleError(_0x5ab47a,null));};exports[_0x50aa('0xbb')]=function(_0xa3a159,_0x4932ab){return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0xa3a159[_0x50aa('0x54')]['id']},'attributes':['id']})[_0x50aa('0x15')](handleEntityNotFound(_0x4932ab,null))['then'](function(_0xfda619){var _0x11f6b6=[];values=_0xfda619[_0x50aa('0x4c')];_0x11f6b6[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4b'),_0xfda619[_0x50aa('0x4c')]));_0x11f6b6[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4d'),_0xfda619[_0x50aa('0x4c')]));_0x11f6b6['push'](get_open_tabs(_0x50aa('0x50'),_0xfda619['dataValues']));_0x11f6b6[_0x50aa('0x4a')](get_open_tabs('whatsapp',_0xfda619[_0x50aa('0x4c')]));_0x11f6b6[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4e'),_0xfda619[_0x50aa('0x4c')]));_0x11f6b6[_0x50aa('0x4a')](get_open_tabs(_0x50aa('0x4f'),_0xfda619[_0x50aa('0x4c')]));return BPromise['all'](_0x11f6b6);})[_0x50aa('0x15')](function(_0x44c0e8){if(_0x44c0e8){var _0x2562cb=_[_0x50aa('0x30')](values['ChatOpenTabs'],function(_0x3a59b4){return{'channel':_0x50aa('0xbc'),'id':_0x3a59b4['id'],'createdAt':_0x3a59b4[_0x50aa('0xbd')]};});var _0x52a211=_[_0x50aa('0x30')](values[_0x50aa('0xbe')],function(_0x46c859){return{'channel':'FAX','id':_0x46c859['id'],'createdAt':_0x46c859['createdAt']};});var _0x375c14=_[_0x50aa('0x30')](values[_0x50aa('0xbf')],function(_0x2b5c76){return{'channel':'OPENCHANNEL','id':_0x2b5c76['id'],'createdAt':_0x2b5c76[_0x50aa('0xbd')]};});var _0x55f5f4=_[_0x50aa('0x30')](values['MailOpenTabs'],function(_0x301625){return{'channel':_0x50aa('0xc0'),'id':_0x301625['id'],'createdAt':_0x301625[_0x50aa('0xbd')]};});var _0x270b1c=_[_0x50aa('0x30')](values[_0x50aa('0xc1')],function(_0x3d3ce8){return{'channel':_0x50aa('0xc2'),'id':_0x3d3ce8['id'],'createdAt':_0x3d3ce8[_0x50aa('0xbd')]};});var _0x321e29=_[_0x50aa('0x30')](values[_0x50aa('0xc3')],function(_0x287b1c){return{'channel':_0x50aa('0xc4'),'id':_0x287b1c['id'],'createdAt':_0x287b1c[_0x50aa('0xbd')]};});var _0x5c2712=_[_0x50aa('0xc5')](_0x2562cb,_0x52a211,_0x375c14,_0x55f5f4,_0x270b1c,_0x321e29);var _0x3e4bd3={'count':_0x5c2712[_0x50aa('0x49')],'rows':_0x5c2712};return _0x3e4bd3;}else return null;})['then'](respondWithResult(_0x4932ab,null))[_0x50aa('0x1f')](handleError(_0x4932ab,null));};exports[_0x50aa('0xc6')]=function(_0x422976,_0x36f408){var _0x559c27={};var _0x239ec7={};var _0x4d2412;var _0x3051ff;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x422976[_0x50aa('0x54')]['id']}})['then'](handleEntityNotFound(_0x36f408,null))[_0x50aa('0x15')](function(_0xeb70c2){if(_0xeb70c2){_0x4d2412=_0xeb70c2;_0x239ec7[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db['CmContact']['rawAttributes']);_0x239ec7[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x422976[_0x50aa('0x47')]);_0x239ec7['filters']=_['intersection'](_0x239ec7['model'],_0x239ec7[_0x50aa('0x47')]);_0x559c27[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x239ec7[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x422976['query'][_0x50aa('0x5b')]));_0x559c27[_0x50aa('0x44')]=_0x559c27['attributes'][_0x50aa('0x49')]?_0x559c27['attributes']:_0x239ec7[_0x50aa('0x5a')];_0x559c27[_0x50aa('0xc8')]=qs['sort'](_0x422976['query'][_0x50aa('0xc9')]);_0x559c27[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_['pick'](_0x422976[_0x50aa('0x47')],_0x239ec7[_0x50aa('0x58')]));if(_0x422976[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x559c27['where']=_[_0x50aa('0x5c')](_0x559c27[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x559c27['attributes'],function(_0x3897f4){var _0x14c50d={};_0x14c50d[_0x3897f4]={'$like':'%'+_0x422976[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x14c50d;})});}_0x559c27=_[_0x50aa('0x5c')]({},_0x559c27,_0x422976[_0x50aa('0xca')]);return _0x4d2412[_0x50aa('0xc6')](_0x559c27);}})[_0x50aa('0x15')](function(_0xe12b27){if(_0xe12b27){_0x3051ff=_0xe12b27[_0x50aa('0x49')];if(_0x422976['query'][_0x50aa('0xcb')](_0x50aa('0x3f'))){_0x559c27[_0x50aa('0x40')]=[{'model':db[_0x50aa('0xcc')],'as':_0x50aa('0xcd'),'required':![]},{'model':db[_0x50aa('0xce')],'as':_0x50aa('0xcf'),'attributes':['id','name',_0x50aa('0xd0')],'where':_0x422976[_0x50aa('0x47')][_0x50aa('0xd1')]?{'id':_0x422976['query'][_0x50aa('0xd1')]}:undefined,'required':_0x422976[_0x50aa('0x47')][_0x50aa('0xd1')]?!![]:![]}];}if(!_0x422976[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x559c27['limit']=qs[_0x50aa('0x25')](_0x422976[_0x50aa('0x47')][_0x50aa('0x25')]);_0x559c27[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x422976[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x4d2412[_0x50aa('0xc6')](_0x559c27);}})[_0x50aa('0x15')](function(_0x30734d){if(_0x30734d){return _0x30734d?{'count':_0x3051ff,'rows':_0x30734d}:null;}})[_0x50aa('0x15')](respondWithResult(_0x36f408,null))[_0x50aa('0x1f')](handleError(_0x36f408,null));};exports[_0x50aa('0xd3')]=function(_0x4ccd39,_0x1fe63f){var _0x3a42ac;var _0x530a6f={};var _0x10eac8;return db['User'][_0x50aa('0xc7')]({'where':{'id':_0x4ccd39[_0x50aa('0x54')]['id']},'attributes':['id',_0x50aa('0x35'),_0x50aa('0x33')]})[_0x50aa('0x15')](handleEntityNotFound(_0x1fe63f,null))[_0x50aa('0x15')](function(_0x12681b){if(!utils[_0x50aa('0x9e')](_0x4ccd39['query']['channel'])){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x9f'));}_0x3a42ac=_0x12681b;var _0x53449f={};_0x53449f[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_[_0x50aa('0xa1')](_0x4ccd39['query'][_0x50aa('0x9b')])+_0x50aa('0xd4')][_0x50aa('0x57')]);_0x53449f[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x4ccd39[_0x50aa('0x47')]);_0x53449f[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x53449f['model'],_0x53449f[_0x50aa('0x47')]);_0x530a6f['attributes']=_[_0x50aa('0x59')](_0x53449f[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x530a6f[_0x50aa('0x44')]=_0x530a6f['attributes'][_0x50aa('0x49')]?_0x530a6f[_0x50aa('0x44')]:_0x53449f[_0x50aa('0x5a')];_0x530a6f['order']=qs[_0x50aa('0xc9')](_0x4ccd39['query'][_0x50aa('0xc9')]);_0x530a6f[_0x50aa('0x3e')]=qs['filters'](_[_0x50aa('0xd5')](_0x4ccd39[_0x50aa('0x47')],_0x53449f['filters']));if(_0x4ccd39['query'][_0x50aa('0x2f')]){_0x530a6f[_0x50aa('0x3e')]=_['merge'](_0x530a6f['where'],{'$or':_['map'](_0x530a6f['attributes'],function(_0x34e0c8){var _0x81a03b={};_0x81a03b[_0x34e0c8]={'$like':'%'+_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x81a03b;})});}_0x530a6f=_[_0x50aa('0x5c')]({},_0x530a6f,_0x4ccd39['options']);switch(_0x3a42ac['role']){case _0x50aa('0x2b'):return db[_[_0x50aa('0xa1')](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x9b')])+'Queue'][_0x50aa('0x46')](_0x530a6f);case _0x50aa('0x7a'):case _0x50aa('0x2e'):return _0x3a42ac[_0x50aa('0x2a')+_['capitalize'](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x9b')])+_0x50aa('0xa2')](_0x530a6f);default:throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))]('Unknown\x20role');}})['then'](function(_0x498c82){_0x10eac8=_0x498c82[_0x50aa('0x49')];if(!_0x4ccd39[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x530a6f[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x25')]);_0x530a6f[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x22')]);}switch(_0x3a42ac[_0x50aa('0x33')]){case _0x50aa('0x2b'):return db[_[_0x50aa('0xa1')](_0x4ccd39['query'][_0x50aa('0x9b')])+_0x50aa('0xd4')][_0x50aa('0x46')](_0x530a6f);case _0x50aa('0x7a'):case _0x50aa('0x2e'):return _0x3a42ac[_0x50aa('0x2a')+_[_0x50aa('0xa1')](_0x4ccd39[_0x50aa('0x47')][_0x50aa('0x9b')])+_0x50aa('0xa2')](_0x530a6f);}})[_0x50aa('0x15')](function(_0x3eda0e){return{'count':_0x10eac8,'rows':_0x3eda0e};})[_0x50aa('0x15')](respondWithResult(_0x1fe63f,null))['catch'](handleError(_0x1fe63f,null));};exports[_0x50aa('0xd6')]=function(_0x4fa22e,_0x5708cf){var _0x348aa5={};var _0x53a89b={};var _0x1fc384;var _0x4d717e;return db['User'][_0x50aa('0xc7')]({'where':{'id':_0x4fa22e['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x5708cf,null))['then'](function(_0xb484a8){if(_0xb484a8){_0x1fc384=_0xb484a8;_0x53a89b['model']=_['keys'](db[_0x50aa('0xd7')]['rawAttributes']);_0x53a89b['query']=_[_0x50aa('0x56')](_0x4fa22e[_0x50aa('0x47')]);_0x53a89b['filters']=_[_0x50aa('0x59')](_0x53a89b['model'],_0x53a89b['query']);_0x348aa5[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x53a89b[_0x50aa('0x5a')],qs['fields'](_0x4fa22e[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x348aa5['attributes']=_0x348aa5['attributes'][_0x50aa('0x49')]?_0x348aa5[_0x50aa('0x44')]:_0x53a89b[_0x50aa('0x5a')];_0x348aa5['order']=qs[_0x50aa('0xc9')](_0x4fa22e['query'][_0x50aa('0xc9')]);_0x348aa5[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x4fa22e[_0x50aa('0x47')],_0x53a89b[_0x50aa('0x58')]));if(_0x4fa22e[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x348aa5[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x348aa5[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x348aa5['attributes'],function(_0x3b2142){var _0x1e6507={};_0x1e6507[_0x3b2142]={'$like':'%'+_0x4fa22e[_0x50aa('0x47')]['filter']+'%'};return _0x1e6507;})});}_0x348aa5=_[_0x50aa('0x5c')]({},_0x348aa5,_0x4fa22e['options']);return _0x1fc384[_0x50aa('0xd6')](_0x348aa5);}})[_0x50aa('0x15')](function(_0xbb30a9){if(_0xbb30a9){_0x4d717e=_0xbb30a9[_0x50aa('0x49')];if(!_0x4fa22e[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x348aa5[_0x50aa('0x25')]=qs['limit'](_0x4fa22e[_0x50aa('0x47')]['limit']);_0x348aa5[_0x50aa('0x22')]=qs['offset'](_0x4fa22e[_0x50aa('0x47')]['offset']);}return _0x1fc384['getVoiceQueuesRt'](_0x348aa5);}})[_0x50aa('0x15')](function(_0x50138a){if(_0x50138a){return _0x50138a?{'count':_0x4d717e,'rows':_0x50138a}:null;}})['then'](respondWithResult(_0x5708cf,null))[_0x50aa('0x1f')](handleError(_0x5708cf,null));};exports[_0x50aa('0xd8')]=function(_0x3a780c,_0x3dd058){var _0xca62bf={};var _0x4d3cf3={};var _0x148afb;var _0x1e702b;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x3a780c[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x3dd058,null))['then'](function(_0x34926c){if(_0x34926c){_0x148afb=_0x34926c;_0x4d3cf3['model']=_[_0x50aa('0x56')](db[_0x50aa('0xd9')][_0x50aa('0x57')]);_0x4d3cf3[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x3a780c['query']);_0x4d3cf3['filters']=_[_0x50aa('0x59')](_0x4d3cf3[_0x50aa('0x5a')],_0x4d3cf3['query']);_0xca62bf['attributes']=_[_0x50aa('0x59')](_0x4d3cf3[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x3a780c['query'][_0x50aa('0x5b')]));_0xca62bf[_0x50aa('0x44')]=_0xca62bf[_0x50aa('0x44')][_0x50aa('0x49')]?_0xca62bf[_0x50aa('0x44')]:_0x4d3cf3[_0x50aa('0x5a')];_0xca62bf[_0x50aa('0xc8')]=qs[_0x50aa('0xc9')](_0x3a780c[_0x50aa('0x47')]['sort']);_0xca62bf['where']=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x3a780c[_0x50aa('0x47')],_0x4d3cf3[_0x50aa('0x58')]));if(_0x3a780c['query'][_0x50aa('0x2f')]){_0xca62bf[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0xca62bf[_0x50aa('0x3e')],{'$or':_['map'](_0xca62bf['attributes'],function(_0x48429b){var _0x26644f={};_0x26644f[_0x48429b]={'$like':'%'+_0x3a780c[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x26644f;})});}_0xca62bf=_[_0x50aa('0x5c')]({},_0xca62bf,_0x3a780c[_0x50aa('0xca')]);return _0x148afb['getGroups'](_0xca62bf);}})['then'](function(_0x315c26){if(_0x315c26){_0x1e702b=_0x315c26['length'];if(!_0x3a780c[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0xca62bf[_0x50aa('0x25')]=qs['limit'](_0x3a780c[_0x50aa('0x47')][_0x50aa('0x25')]);_0xca62bf['offset']=qs[_0x50aa('0x22')](_0x3a780c[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x148afb[_0x50aa('0xd8')](_0xca62bf);}})[_0x50aa('0x15')](function(_0x23b9e5){if(_0x23b9e5){return _0x23b9e5?{'count':_0x1e702b,'rows':_0x23b9e5}:null;}})[_0x50aa('0x15')](respondWithResult(_0x3dd058,null))[_0x50aa('0x1f')](handleError(_0x3dd058,null));};exports[_0x50aa('0xda')]=function(_0x430e68,_0x4fbdd5){var _0x4e5c64={'raw':!![],'where':{}};var _0x337afd={};var _0x22f740={'count':0x0,'rows':[]};return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x430e68[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x4fbdd5,null))['then'](function(_0x25e265){if(_0x25e265){_0x337afd[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_0x50aa('0xdb')]['rawAttributes']);_0x337afd[_0x50aa('0x47')]=_['keys'](_0x430e68[_0x50aa('0x47')]);_0x337afd[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x337afd[_0x50aa('0x5a')],_0x337afd['query']);_0x4e5c64[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x337afd[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x430e68[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x4e5c64['attributes']=_0x4e5c64['attributes'][_0x50aa('0x49')]?_0x4e5c64[_0x50aa('0x44')]:_0x337afd['model'];if(!_0x430e68[_0x50aa('0x47')][_0x50aa('0xcb')]('nolimit')){_0x4e5c64[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x430e68[_0x50aa('0x47')][_0x50aa('0x25')]);_0x4e5c64[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x430e68['query'][_0x50aa('0x22')]);}_0x4e5c64[_0x50aa('0xc8')]=qs['sort'](_0x430e68['query']['sort']);_0x4e5c64['where']=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x430e68[_0x50aa('0x47')],_0x337afd[_0x50aa('0x58')]));_0x4e5c64[_0x50aa('0x3e')][_0x50aa('0xdc')]=_0x25e265['id'];if(_0x430e68[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x4e5c64['where']=_['merge'](_0x4e5c64[_0x50aa('0x3e')],{'$or':_['map'](_0x4e5c64['attributes'],function(_0x2c2a28){var _0x3c9eb3={};_0x3c9eb3[_0x2c2a28]={'$like':'%'+_0x430e68[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x3c9eb3;})});}_0x4e5c64=_[_0x50aa('0x5c')]({},_0x4e5c64,_0x430e68[_0x50aa('0xca')]);return db['VoiceRecording'][_0x50aa('0x24')]({'where':_0x4e5c64[_0x50aa('0x3e')]})['then'](function(_0x2c7790){_0x22f740['count']=_0x2c7790;if(_0x430e68[_0x50aa('0x47')][_0x50aa('0x3f')]){_0x4e5c64[_0x50aa('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x50aa('0x46')](_0x4e5c64);})['then'](function(_0xa70741){_0x22f740[_0x50aa('0x48')]=_0xa70741;return _0x22f740;});}})[_0x50aa('0x15')](respondWithFilteredResult(_0x4fbdd5,_0x4e5c64))[_0x50aa('0x1f')](handleError(_0x4fbdd5,null));};exports[_0x50aa('0xdd')]=function(_0x59fb69,_0xdf09e5){var _0x3d3d85={'raw':!![],'where':{}};var _0x4c6d64={};var _0x7d530f={'count':0x0,'rows':[]};return db[_0x50aa('0x45')]['findOne']({'where':{'id':_0x59fb69[_0x50aa('0x54')]['id']}})['then'](handleEntityNotFound(_0xdf09e5,null))['then'](function(_0xcd6502){if(_0xcd6502){_0x4c6d64[_0x50aa('0x5a')]=_['keys'](db[_0x50aa('0xde')]['rawAttributes']);_0x4c6d64[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x59fb69[_0x50aa('0x47')]);_0x4c6d64[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x4c6d64[_0x50aa('0x5a')],_0x4c6d64['query']);_0x3d3d85[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x4c6d64[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x59fb69[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x3d3d85[_0x50aa('0x44')]=_0x3d3d85[_0x50aa('0x44')]['length']?_0x3d3d85[_0x50aa('0x44')]:_0x4c6d64[_0x50aa('0x5a')];if(!_0x59fb69['query'][_0x50aa('0xcb')]('nolimit')){_0x3d3d85[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x59fb69[_0x50aa('0x47')][_0x50aa('0x25')]);_0x3d3d85[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x59fb69['query'][_0x50aa('0x22')]);}_0x3d3d85[_0x50aa('0xc8')]=qs['sort'](_0x59fb69['query'][_0x50aa('0xc9')]);_0x3d3d85[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_['pick'](_0x59fb69[_0x50aa('0x47')],_0x4c6d64[_0x50aa('0x58')]));_0x3d3d85[_0x50aa('0x3e')]['UserId']=_0xcd6502['id'];if(_0x59fb69[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x3d3d85[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x3d3d85[_0x50aa('0x3e')],{'$or':_['map'](_0x3d3d85['attributes'],function(_0x1de3ef){var _0x333242={};_0x333242[_0x1de3ef]={'$like':'%'+_0x59fb69[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x333242;})});}_0x3d3d85=_[_0x50aa('0x5c')]({},_0x3d3d85,_0x59fb69[_0x50aa('0xca')]);return db[_0x50aa('0xde')][_0x50aa('0x24')]({'where':_0x3d3d85[_0x50aa('0x3e')]})[_0x50aa('0x15')](function(_0x4c7951){_0x7d530f[_0x50aa('0x24')]=_0x4c7951;if(_0x59fb69[_0x50aa('0x47')][_0x50aa('0x3f')]){_0x3d3d85['include']=[{'all':!![]}];}return db[_0x50aa('0xde')][_0x50aa('0x46')](_0x3d3d85);})[_0x50aa('0x15')](function(_0x55c1d7){_0x7d530f[_0x50aa('0x48')]=_0x55c1d7;return _0x7d530f;});}})['then'](respondWithFilteredResult(_0xdf09e5,_0x3d3d85))[_0x50aa('0x1f')](handleError(_0xdf09e5,null));};exports[_0x50aa('0xdf')]=function(_0x3a1e64,_0x1317a0){var _0x5935aa={};var _0x5e649a={};var _0x4da999;var _0x5141e4;return db['User'][_0x50aa('0xc7')]({'where':{'id':_0x3a1e64[_0x50aa('0x54')]['id']}})['then'](handleEntityNotFound(_0x1317a0,null))[_0x50aa('0x15')](function(_0x252cdf){if(_0x252cdf){_0x4da999=_0x252cdf;_0x5e649a[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_0x50aa('0xe0')][_0x50aa('0x57')]);_0x5e649a[_0x50aa('0x47')]=_['keys'](_0x3a1e64[_0x50aa('0x47')]);_0x5e649a['filters']=_[_0x50aa('0x59')](_0x5e649a[_0x50aa('0x5a')],_0x5e649a[_0x50aa('0x47')]);_0x5935aa[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x5e649a[_0x50aa('0x5a')],qs['fields'](_0x3a1e64[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x5935aa[_0x50aa('0x44')]=_0x5935aa['attributes'][_0x50aa('0x49')]?_0x5935aa[_0x50aa('0x44')]:_0x5e649a[_0x50aa('0x5a')];_0x5935aa['order']=qs[_0x50aa('0xc9')](_0x3a1e64[_0x50aa('0x47')]['sort']);_0x5935aa[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x3a1e64[_0x50aa('0x47')],_0x5e649a[_0x50aa('0x58')]));if(_0x3a1e64[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x5935aa[_0x50aa('0x3e')]=_['merge'](_0x5935aa['where'],{'$or':_[_0x50aa('0x30')](_0x5935aa[_0x50aa('0x44')],function(_0x4c4932){var _0x10a3b3={};_0x10a3b3[_0x4c4932]={'$like':'%'+_0x3a1e64[_0x50aa('0x47')]['filter']+'%'};return _0x10a3b3;})});}_0x5935aa=_[_0x50aa('0x5c')]({},_0x5935aa,_0x3a1e64['options']);return _0x4da999[_0x50aa('0xdf')](_0x5935aa);}})[_0x50aa('0x15')](function(_0x2e6f37){if(_0x2e6f37){_0x5141e4=_0x2e6f37[_0x50aa('0x49')];if(!_0x3a1e64['query']['hasOwnProperty'](_0x50aa('0xd2'))){_0x5935aa[_0x50aa('0x25')]=qs['limit'](_0x3a1e64['query']['limit']);_0x5935aa[_0x50aa('0x22')]=qs['offset'](_0x3a1e64['query'][_0x50aa('0x22')]);}return _0x4da999[_0x50aa('0xdf')](_0x5935aa);}})['then'](function(_0x3c96c7){if(_0x3c96c7){return _0x3c96c7?{'count':_0x5141e4,'rows':_0x3c96c7}:null;}})[_0x50aa('0x15')](respondWithResult(_0x1317a0,null))[_0x50aa('0x1f')](handleError(_0x1317a0,null));};exports['getOpenchannelInteractions']=function(_0x77b730,_0x3b5750){var _0x132444={};var _0x5f578f={};var _0x3d67ea;var _0x44e9cd;return db['User'][_0x50aa('0xc7')]({'where':{'id':_0x77b730[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x3b5750,null))[_0x50aa('0x15')](function(_0x3f5537){if(_0x3f5537){_0x3d67ea=_0x3f5537;_0x5f578f[_0x50aa('0x5a')]=_['keys'](db['OpenchannelInteraction'][_0x50aa('0x57')]);_0x5f578f[_0x50aa('0x47')]=_['keys'](_0x77b730[_0x50aa('0x47')]);_0x5f578f[_0x50aa('0x58')]=_['intersection'](_0x5f578f['model'],_0x5f578f[_0x50aa('0x47')]);_0x132444[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x5f578f[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x77b730['query']['fields']));_0x132444['attributes']=_0x132444[_0x50aa('0x44')][_0x50aa('0x49')]?_0x132444[_0x50aa('0x44')]:_0x5f578f[_0x50aa('0x5a')];_0x132444['order']=qs[_0x50aa('0xc9')](_0x77b730[_0x50aa('0x47')][_0x50aa('0xc9')]);_0x132444[_0x50aa('0x3e')]=qs['filters'](_[_0x50aa('0xd5')](_0x77b730[_0x50aa('0x47')],_0x5f578f[_0x50aa('0x58')]));if(_0x77b730[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x132444[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x132444[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x132444[_0x50aa('0x44')],function(_0x3078ed){var _0x2c3fa2={};_0x2c3fa2[_0x3078ed]={'$like':'%'+_0x77b730[_0x50aa('0x47')]['filter']+'%'};return _0x2c3fa2;})});}_0x132444=_[_0x50aa('0x5c')]({},_0x132444,_0x77b730['options']);return _0x3d67ea[_0x50aa('0xe1')](_0x132444);}})[_0x50aa('0x15')](function(_0x3fd78d){if(_0x3fd78d){_0x44e9cd=_0x3fd78d[_0x50aa('0x49')];if(!_0x77b730[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x132444[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x77b730[_0x50aa('0x47')]['limit']);_0x132444['offset']=qs[_0x50aa('0x22')](_0x77b730[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x3d67ea[_0x50aa('0xe1')](_0x132444);}})[_0x50aa('0x15')](function(_0xc09db8){if(_0xc09db8){return _0xc09db8?{'count':_0x44e9cd,'rows':_0xc09db8}:null;}})[_0x50aa('0x15')](respondWithResult(_0x3b5750,null))[_0x50aa('0x1f')](handleError(_0x3b5750,null));};exports[_0x50aa('0xe2')]=function(_0x44912d,_0xe54630){var _0x48c3c6={'raw':!![],'where':{}};var _0x1f4631={};var _0x44c41d={'count':0x0,'rows':[]};return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x44912d[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0xe54630,null))[_0x50aa('0x15')](function(_0x22ece4){if(_0x22ece4){_0x1f4631['model']=_[_0x50aa('0x56')](db[_0x50aa('0xe3')][_0x50aa('0x57')]);_0x1f4631[_0x50aa('0x47')]=_['keys'](_0x44912d['query']);_0x1f4631['filters']=_[_0x50aa('0x59')](_0x1f4631[_0x50aa('0x5a')],_0x1f4631['query']);_0x48c3c6['attributes']=_['intersection'](_0x1f4631[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x44912d[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x48c3c6[_0x50aa('0x44')]=_0x48c3c6[_0x50aa('0x44')]['length']?_0x48c3c6[_0x50aa('0x44')]:_0x1f4631[_0x50aa('0x5a')];if(!_0x44912d[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x48c3c6[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x44912d[_0x50aa('0x47')][_0x50aa('0x25')]);_0x48c3c6[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x44912d[_0x50aa('0x47')][_0x50aa('0x22')]);}_0x48c3c6[_0x50aa('0xc8')]=qs[_0x50aa('0xc9')](_0x44912d[_0x50aa('0x47')]['sort']);_0x48c3c6[_0x50aa('0x3e')]=qs['filters'](_[_0x50aa('0xd5')](_0x44912d[_0x50aa('0x47')],_0x1f4631['filters']));_0x48c3c6[_0x50aa('0x3e')][_0x50aa('0xdc')]=_0x22ece4['id'];if(_0x44912d[_0x50aa('0x47')]['filter']){_0x48c3c6[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x48c3c6['where'],{'$or':_[_0x50aa('0x30')](_0x48c3c6[_0x50aa('0x44')],function(_0x3f5f57){var _0x3d2244={};_0x3d2244[_0x3f5f57]={'$like':'%'+_0x44912d[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x3d2244;})});}_0x48c3c6=_[_0x50aa('0x5c')]({},_0x48c3c6,_0x44912d[_0x50aa('0xca')]);return db['MailInteraction']['count']({'where':_0x48c3c6[_0x50aa('0x3e')]})['then'](function(_0x20020b){_0x44c41d['count']=_0x20020b;if(_0x44912d['query'][_0x50aa('0x3f')]){_0x48c3c6[_0x50aa('0x40')]=[{'all':!![]}];}return db[_0x50aa('0xe3')]['findAll'](_0x48c3c6);})[_0x50aa('0x15')](function(_0x18b838){_0x44c41d[_0x50aa('0x48')]=_0x18b838;return _0x44c41d;});}})[_0x50aa('0x15')](respondWithFilteredResult(_0xe54630,_0x48c3c6))[_0x50aa('0x1f')](handleError(_0xe54630,null));};exports[_0x50aa('0xe4')]=function(_0x2c9e8f,_0x18d106){var _0xf6d17f={};var _0x18f92c={};var _0x3ae41d;var _0xdd5a21;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x2c9e8f[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x18d106,null))[_0x50aa('0x15')](function(_0x4b8812){if(_0x4b8812){_0x3ae41d=_0x4b8812;_0x18f92c[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_0x50aa('0xe5')][_0x50aa('0x57')]);_0x18f92c[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x2c9e8f['query']);_0x18f92c[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x18f92c[_0x50aa('0x5a')],_0x18f92c['query']);_0xf6d17f[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x18f92c['model'],qs[_0x50aa('0x5b')](_0x2c9e8f[_0x50aa('0x47')][_0x50aa('0x5b')]));_0xf6d17f['attributes']=_0xf6d17f[_0x50aa('0x44')][_0x50aa('0x49')]?_0xf6d17f[_0x50aa('0x44')]:_0x18f92c[_0x50aa('0x5a')];_0xf6d17f['order']=qs[_0x50aa('0xc9')](_0x2c9e8f['query'][_0x50aa('0xc9')]);_0xf6d17f[_0x50aa('0x3e')]=qs['filters'](_['pick'](_0x2c9e8f[_0x50aa('0x47')],_0x18f92c[_0x50aa('0x58')]));if(_0x2c9e8f[_0x50aa('0x47')]['filter']){_0xf6d17f[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0xf6d17f[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0xf6d17f['attributes'],function(_0x40034c){var _0x10c923={};_0x10c923[_0x40034c]={'$like':'%'+_0x2c9e8f[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x10c923;})});}_0xf6d17f=_[_0x50aa('0x5c')]({},_0xf6d17f,_0x2c9e8f[_0x50aa('0xca')]);return _0x3ae41d['getSmsInteractions'](_0xf6d17f);}})['then'](function(_0xfd6d16){if(_0xfd6d16){_0xdd5a21=_0xfd6d16[_0x50aa('0x49')];if(!_0x2c9e8f[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0xf6d17f[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x2c9e8f['query'][_0x50aa('0x25')]);_0xf6d17f[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x2c9e8f[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x3ae41d[_0x50aa('0xe4')](_0xf6d17f);}})[_0x50aa('0x15')](function(_0x5591b3){if(_0x5591b3){return _0x5591b3?{'count':_0xdd5a21,'rows':_0x5591b3}:null;}})[_0x50aa('0x15')](respondWithResult(_0x18d106,null))[_0x50aa('0x1f')](handleError(_0x18d106,null));};exports['getFaxInteractions']=function(_0xdff408,_0x43057c){var _0x14e8dc={};var _0x3b84b5={};var _0x4bcca6;var _0x68ad0e;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0xdff408['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x43057c,null))['then'](function(_0x10b160){if(_0x10b160){_0x4bcca6=_0x10b160;_0x3b84b5[_0x50aa('0x5a')]=_['keys'](db[_0x50aa('0xe6')][_0x50aa('0x57')]);_0x3b84b5[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0xdff408[_0x50aa('0x47')]);_0x3b84b5['filters']=_[_0x50aa('0x59')](_0x3b84b5['model'],_0x3b84b5[_0x50aa('0x47')]);_0x14e8dc['attributes']=_[_0x50aa('0x59')](_0x3b84b5[_0x50aa('0x5a')],qs['fields'](_0xdff408[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x14e8dc['attributes']=_0x14e8dc[_0x50aa('0x44')]['length']?_0x14e8dc[_0x50aa('0x44')]:_0x3b84b5[_0x50aa('0x5a')];_0x14e8dc[_0x50aa('0xc8')]=qs[_0x50aa('0xc9')](_0xdff408['query'][_0x50aa('0xc9')]);_0x14e8dc[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0xdff408[_0x50aa('0x47')],_0x3b84b5[_0x50aa('0x58')]));if(_0xdff408[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x14e8dc[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x14e8dc[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x14e8dc[_0x50aa('0x44')],function(_0x3d2349){var _0x3b0d77={};_0x3b0d77[_0x3d2349]={'$like':'%'+_0xdff408[_0x50aa('0x47')]['filter']+'%'};return _0x3b0d77;})});}_0x14e8dc=_['merge']({},_0x14e8dc,_0xdff408[_0x50aa('0xca')]);return _0x4bcca6['getFaxInteractions'](_0x14e8dc);}})[_0x50aa('0x15')](function(_0x42af94){if(_0x42af94){_0x68ad0e=_0x42af94[_0x50aa('0x49')];if(!_0xdff408['query'][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x14e8dc[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0xdff408[_0x50aa('0x47')]['limit']);_0x14e8dc['offset']=qs[_0x50aa('0x22')](_0xdff408[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x4bcca6['getFaxInteractions'](_0x14e8dc);}})[_0x50aa('0x15')](function(_0x3e6723){if(_0x3e6723){return _0x3e6723?{'count':_0x68ad0e,'rows':_0x3e6723}:null;}})[_0x50aa('0x15')](respondWithResult(_0x43057c,null))[_0x50aa('0x1f')](handleError(_0x43057c,null));};exports['getWhatsappInteractions']=function(_0x498c73,_0x342e7c){var _0x18f27a={};var _0x368b26={};var _0x424cc8;var _0x5d4680;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x498c73[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x342e7c,null))[_0x50aa('0x15')](function(_0x217acb){if(_0x217acb){_0x424cc8=_0x217acb;_0x368b26[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_0x50aa('0xe7')][_0x50aa('0x57')]);_0x368b26[_0x50aa('0x47')]=_['keys'](_0x498c73['query']);_0x368b26[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x368b26['model'],_0x368b26[_0x50aa('0x47')]);_0x18f27a[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x368b26[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x498c73['query'][_0x50aa('0x5b')]));_0x18f27a[_0x50aa('0x44')]=_0x18f27a[_0x50aa('0x44')][_0x50aa('0x49')]?_0x18f27a[_0x50aa('0x44')]:_0x368b26[_0x50aa('0x5a')];_0x18f27a[_0x50aa('0xc8')]=qs[_0x50aa('0xc9')](_0x498c73[_0x50aa('0x47')][_0x50aa('0xc9')]);_0x18f27a[_0x50aa('0x3e')]=qs['filters'](_[_0x50aa('0xd5')](_0x498c73[_0x50aa('0x47')],_0x368b26[_0x50aa('0x58')]));if(_0x498c73[_0x50aa('0x47')]['filter']){_0x18f27a[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x18f27a['where'],{'$or':_[_0x50aa('0x30')](_0x18f27a['attributes'],function(_0x51565c){var _0x5801a5={};_0x5801a5[_0x51565c]={'$like':'%'+_0x498c73['query'][_0x50aa('0x2f')]+'%'};return _0x5801a5;})});}_0x18f27a=_[_0x50aa('0x5c')]({},_0x18f27a,_0x498c73[_0x50aa('0xca')]);return _0x424cc8[_0x50aa('0xe8')](_0x18f27a);}})[_0x50aa('0x15')](function(_0x11d3eb){if(_0x11d3eb){_0x5d4680=_0x11d3eb[_0x50aa('0x49')];if(!_0x498c73[_0x50aa('0x47')][_0x50aa('0xcb')]('nolimit')){_0x18f27a[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x498c73[_0x50aa('0x47')][_0x50aa('0x25')]);_0x18f27a[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x498c73['query']['offset']);}return _0x424cc8[_0x50aa('0xe8')](_0x18f27a);}})[_0x50aa('0x15')](function(_0x325191){if(_0x325191){return _0x325191?{'count':_0x5d4680,'rows':_0x325191}:null;}})['then'](respondWithResult(_0x342e7c,null))[_0x50aa('0x1f')](handleError(_0x342e7c,null));};exports[_0x50aa('0xe9')]=function(_0x15986b,_0x110629,_0x11d1b7){var _0x30e8ee;var _0x5ee7d0;var _0xfb23ed;var _0x57339d=!_[_0x50aa('0x68')](_0x15986b['params']['id'])?_0x15986b[_0x50aa('0x54')]['id']:!_[_0x50aa('0x68')](_0x15986b[_0x50aa('0x7a')]['id'])?_0x15986b[_0x50aa('0x7a')]['id']:null;return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x57339d,'role':{'$or':[_0x50aa('0x2b'),_0x50aa('0x7a'),_0x50aa('0x2e')]}},'attributes':['id',_0x50aa('0x35'),_0x50aa('0xea'),_0x50aa('0xeb'),_0x50aa('0x33'),'internal','loginInPause']})[_0x50aa('0x15')](function(_0x43e206){if(_0x43e206){if(_0x43e206['role']===_0x50aa('0x2e')){_0x30e8ee=_0x43e206;if(_0x15986b['body']['interface']){_0xfb23ed=util[_0x50aa('0xac')](_0x50aa('0xec'),_0x30e8ee[_0x15986b[_0x50aa('0x5d')][_0x50aa('0xab')]]);}else if(_0x15986b[_0x50aa('0x5d')][_0x50aa('0xed')]){_0xfb23ed=util[_0x50aa('0xac')]('SIP/%s',_0x15986b['body'][_0x50aa('0xed')]);}else{_0xfb23ed=util['format'](_0x50aa('0xee'),_0x30e8ee['name']);}socket['to'](util[_0x50aa('0xac')](_0x50aa('0xef'),_0x30e8ee[_0x50aa('0x35')]))[_0x50aa('0xa7')](_0x50aa('0xf0'),{'user':{'id':_0x30e8ee['id'],'name':_0x30e8ee[_0x50aa('0x35')]},'ip':_0x15986b['headers']['x-forwarded-for']||_0x15986b['connection'][_0x50aa('0xf1')]||_0x15986b[_0x50aa('0xf2')][_0x50aa('0xf1')]||_0x15986b[_0x50aa('0xf3')][_0x50aa('0xf2')][_0x50aa('0xf1')]});return db[_0x50aa('0xd7')][_0x50aa('0x29')]({'where':{'membername':_0x30e8ee[_0x50aa('0x35')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x50aa('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x50aa('0x15')](function(){if(_0x30e8ee){return _0x30e8ee['getVoiceQueues']({'raw':!![]});}})[_0x50aa('0x15')](function(_0xfc9042){if(_0x30e8ee){var _0x10cd82=[];if(_0xfc9042){_0x5ee7d0=_0xfc9042;if(_0x5ee7d0[_0x50aa('0x49')]){for(var _0x365571=0x0;_0x365571<_0x5ee7d0['length'];_0x365571++){_0x10cd82['push']({'membername':_0x30e8ee[_0x50aa('0x35')],'UserId':_0x30e8ee['id'],'queue_name':_0x5ee7d0[_0x365571][_0x50aa('0x35')],'VoiceQueueId':_0x5ee7d0[_0x365571]['id'],'interface':_0xfb23ed,'paused':_0x30e8ee[_0x50aa('0x9c')]||![],'penalty':_0x5ee7d0[_0x365571][_0x50aa('0xf4')]||0x0});}return BPromise['each'](_0x10cd82,function(_0x322d84){return db[_0x50aa('0xd7')]['upsert'](_0x322d84);});}}}})[_0x50aa('0x15')](function(){if(_0x30e8ee){return db[_0x50aa('0xf5')]['findAll']({'where':{'membername':_0x30e8ee[_0x50aa('0x35')],'exitAt':null}});}})[_0x50aa('0x15')](function(_0x52aa02){if(_0x30e8ee){var _0x36fd0a=[];_0x52aa02[_0x50aa('0xf6')](function(_0x49a307){_0x36fd0a[_0x50aa('0x4a')](_0x49a307[_0x50aa('0x28')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x50aa('0x52')](_0x36fd0a);}})[_0x50aa('0x15')](function(){if(_0x30e8ee){var _0x337a21=[];var _0x1f804e=[];var _0x232561=utils[_0x50aa('0xf7')]();var _0x448968={'membername':_0x30e8ee[_0x50aa('0x35')],'interface':_0xfb23ed,'enterAt':moment()['format'](_0x50aa('0xf8')),'role':_0x30e8ee['role'],'internal':_0x30e8ee['internal']};_0x232561['forEach'](function(_0x5bc704){_0x337a21['push'](_[_0x50aa('0x5c')]({'channel':_0x5bc704,'type':'LOGIN','data1':_0x15986b[_0x50aa('0x5d')]['device'],'data2':_0xfb23ed},_0x448968));if(_0x30e8ee[_0x50aa('0x9c')]){_0x1f804e[_0x50aa('0x4a')](_[_0x50aa('0x5c')]({'channel':_0x5bc704,'type':_0x50aa('0xf9'),'data1':_0x50aa('0xfa')},_0x448968));}});return db[_0x50aa('0xf5')]['bulkCreate'](_0x337a21['concat'](_0x1f804e),{'individualHooks':!![]});}})[_0x50aa('0x15')](function(){if(_0x30e8ee){return _0x30e8ee[_0x50aa('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x50aa('0xf8')),'voicePause':_0x30e8ee[_0x50aa('0x9c')]||![],'mailPause':_0x30e8ee[_0x50aa('0x9c')]||![],'chatPause':_0x30e8ee['loginInPause']||![],'faxPause':_0x30e8ee['loginInPause']||![],'smsPause':_0x30e8ee[_0x50aa('0x9c')]||![],'openchannelPause':_0x30e8ee['loginInPause']||![],'whatsappPause':_0x30e8ee[_0x50aa('0x9c')]||![],'pauseType':_0x30e8ee[_0x50aa('0x9c')]?_0x50aa('0xfa'):null,'interface':_0xfb23ed,'lastPauseAt':moment()[_0x50aa('0xac')](_0x50aa('0xf8'))});}})['then'](function(_0x413b03){if(_0x15986b[_0x50aa('0xfb')]){return _0x11d1b7();}else{return BPromise[_0x50aa('0xfc')](_0x413b03)[_0x50aa('0x15')](respondWithResult(_0x110629,null));}})[_0x50aa('0x1f')](handleError(_0x110629,null));};exports['logout']=function(_0x309679,_0x4a5a20){var _0x5e4ff8;return db[_0x50aa('0x45')][_0x50aa('0x34')]({'where':{'id':_0x309679[_0x50aa('0x54')]['id'],'role':'agent'},'attributes':['id',_0x50aa('0x35'),_0x50aa('0x33')]})[_0x50aa('0x15')](handleEntityNotFound(_0x4a5a20,null))[_0x50aa('0x15')](function(_0x40efcd){if(_0x40efcd){_0x5e4ff8=_0x40efcd;return db[_0x50aa('0xd7')][_0x50aa('0x29')]({'where':{'membername':_0x5e4ff8[_0x50aa('0x35')]},'individualHooks':!![]});}})['then'](function(){return db[_0x50aa('0xf5')]['findAll']({'where':{'membername':_0x5e4ff8[_0x50aa('0x35')],'exitAt':null}});})[_0x50aa('0x15')](function(_0x2231ab){var _0x4b3a71=[];_0x2231ab[_0x50aa('0xf6')](function(_0x35f433){_0x4b3a71['push'](_0x35f433[_0x50aa('0x28')]({'exitAt':moment()[_0x50aa('0xac')](_0x50aa('0xf8'))}));});return BPromise['all'](_0x4b3a71);})[_0x50aa('0x15')](function(){return _0x5e4ff8[_0x50aa('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x50aa('0x15')](respondWithResult(_0x4a5a20,null))[_0x50aa('0x1f')](handleError(_0x4a5a20,null));};exports['pause']=function(_0x3dea75,_0x447fe6){var _0x3b54ac;return db[_0x50aa('0xd7')][_0x50aa('0x28')]({'paused':0x1},{'where':{'UserId':_0x3dea75[_0x50aa('0x54')]['id']},'individualHooks':!![]})[_0x50aa('0x15')](function(){return db['User']['find']({'where':{'id':_0x3dea75['params']['id'],'role':_0x50aa('0x2e')},'attributes':['id',_0x50aa('0x35'),_0x50aa('0x33'),_0x50aa('0x61'),_0x50aa('0xab')]});})['then'](handleEntityNotFound(_0x447fe6,null))[_0x50aa('0x15')](function(_0x1788ad){if(_0x1788ad){_0x3b54ac=_0x1788ad;return respondWithRpcPromise(_0x50aa('0xfd'),_0x50aa('0xfe'),{'id':_0x3b54ac['id'],'name':_0x3b54ac[_0x50aa('0x35')],'pause':!![]});}})['then'](function(){if(_0x3b54ac){return db[_0x50aa('0xf5')][_0x50aa('0x46')]({'where':{'membername':_0x3b54ac['name'],'type':_0x50aa('0xf9'),'exitAt':null}});}})['then'](function(_0xe0a78c){if(_0xe0a78c['length']){var _0x5c8505=moment()[_0x50aa('0xac')](_0x50aa('0xf8'));for(var _0x1b262d=0x0,_0x28ba2f=_0xe0a78c[_0x50aa('0x49')];_0x1b262d<_0x28ba2f;_0x1b262d++){_0xe0a78c[_0x1b262d][_0x50aa('0xff')]({'exitAt':_0x5c8505});}}})[_0x50aa('0x15')](function(){var _0x959d9b=[];var _0x42f1c2=utils[_0x50aa('0xf7')]();_0x42f1c2['forEach'](function(_0x5d9c30){_0x959d9b[_0x50aa('0x4a')]({'channel':_0x5d9c30,'membername':_0x3b54ac[_0x50aa('0x35')],'interface':_[_0x50aa('0x68')](_0x3b54ac[_0x50aa('0xab')])?util[_0x50aa('0xac')]('SIP/%s',_0x3b54ac[_0x50aa('0x35')]):_0x3b54ac[_0x50aa('0xab')],'type':'PAUSE','enterAt':moment()[_0x50aa('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3dea75[_0x50aa('0x5d')][_0x50aa('0x100')]||_0x50aa('0x101'),'role':_0x3b54ac['role'],'internal':_0x3b54ac[_0x50aa('0x61')]});});return db[_0x50aa('0xf5')][_0x50aa('0x85')](_0x959d9b,{'individualHooks':!![]});})[_0x50aa('0x15')](function(){return _0x3b54ac[_0x50aa('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3dea75[_0x50aa('0x5d')][_0x50aa('0x100')]||_0x50aa('0x101'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x447fe6,null))[_0x50aa('0x1f')](handleError(_0x447fe6,null));};exports[_0x50aa('0x102')]=function(_0x3f7b94,_0x52d92e){var _0x5760d7;return db['User']['find']({'where':{'id':_0x3f7b94['params']['id']},'attributes':['id',_0x50aa('0x35'),_0x50aa('0x33'),_0x50aa('0x9d'),_0x50aa('0x103'),_0x50aa('0x104'),_0x50aa('0x105'),_0x50aa('0x106'),_0x50aa('0x107'),_0x50aa('0x108'),_0x50aa('0x109'),_0x50aa('0x10a')]})[_0x50aa('0x15')](handleEntityNotFound(_0x52d92e,null))[_0x50aa('0x15')](function(_0x1adb58){if(_0x1adb58){_0x5760d7=_0x1adb58;if(_0x3f7b94['body'][_0x50aa('0x9b')]&&!utils['isValidChannel'](_0x3f7b94[_0x50aa('0x5d')][_0x50aa('0x9b')])){throw new db[(_0x50aa('0x8f'))][(_0x50aa('0x91'))](_0x50aa('0x9f'));}switch(_0x3f7b94['body'][_0x50aa('0x9b')]){case _0x50aa('0xa8'):return respondWithRpcPromise('QueuePause',_0x50aa('0x102'),{'id':_0x5760d7['id'],'name':_0x5760d7['name'],'pause':![]})[_0x50aa('0x15')](function(){return db[_0x50aa('0xd7')][_0x50aa('0x28')]({'paused':0x0},{'where':{'UserId':_0x5760d7['id']},'individualHooks':!![]});})[_0x50aa('0x15')](function(){return db[_0x50aa('0xf5')][_0x50aa('0x34')]({'where':{'channel':_0x3f7b94[_0x50aa('0x5d')][_0x50aa('0x9b')],'membername':_0x5760d7[_0x50aa('0x35')],'type':_0x50aa('0xf9'),'exitAt':null}});})[_0x50aa('0x15')](function(_0x3d75ed){if(_0x3d75ed){return _0x3d75ed[_0x50aa('0x28')]({'exitAt':moment()[_0x50aa('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x50aa('0x10b')},{'individualHooks':!![]});}return null;})[_0x50aa('0x15')](function(){return _0x5760d7[_0x50aa('0x28')]({'voicePause':![]});});case _0x50aa('0x4f'):case _0x50aa('0x4b'):case'fax':case'sms':case _0x50aa('0x51'):case _0x50aa('0x50'):return db[_0x50aa('0xf5')][_0x50aa('0x34')]({'where':{'channel':_0x3f7b94[_0x50aa('0x5d')][_0x50aa('0x9b')],'membername':_0x5760d7['name'],'type':'PAUSE','exitAt':null}})[_0x50aa('0x15')](function(_0x306629){if(_0x306629){return _0x306629[_0x50aa('0x28')]({'exitAt':moment()[_0x50aa('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x50aa('0x10b')},{'individualHooks':!![]});}return null;})[_0x50aa('0x15')](function(){var _0x76bacb={};_['set'](_0x76bacb,util[_0x50aa('0xac')](_0x50aa('0x10c'),_0x3f7b94[_0x50aa('0x5d')][_0x50aa('0x9b')],'Pause'),![]);return _0x5760d7[_0x50aa('0x28')](_0x76bacb);});default:return respondWithRpcPromise(_0x50aa('0xfd'),_0x50aa('0x102'),{'id':_0x5760d7['id'],'name':_0x5760d7[_0x50aa('0x35')],'pause':![]})[_0x50aa('0x15')](function(){return db[_0x50aa('0xd7')]['update']({'paused':0x0},{'where':{'UserId':_0x5760d7['id']}});})['then'](function(){return db[_0x50aa('0xf5')][_0x50aa('0x46')]({'where':{'membername':_0x5760d7[_0x50aa('0x35')],'type':_0x50aa('0xf9'),'exitAt':null}});})[_0x50aa('0x15')](function(_0x1b2d7d){var _0x4c8ab8=[];_0x1b2d7d[_0x50aa('0xf6')](function(_0x424435){_0x4c8ab8[_0x50aa('0x4a')](_0x424435['update']({'exitAt':moment()[_0x50aa('0xac')](_0x50aa('0xf8')),'data2':_0x50aa('0x10b')}));});return BPromise[_0x50aa('0x52')](_0x4c8ab8);})['then'](function(){return _0x5760d7[_0x50aa('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x52d92e,null))['catch'](handleError(_0x52d92e,null));};exports[_0x50aa('0x10d')]=function(_0x1eaf8c,_0x3cc23e){var _0x16c403={};var _0x56cc0e={};var _0x5db785;var _0x4578be;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x1eaf8c['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x3cc23e,null))[_0x50aa('0x15')](function(_0xfd09a8){if(_0xfd09a8){_0x5db785=_0xfd09a8;_0x56cc0e[_0x50aa('0x5a')]=_['keys'](db[_0x50aa('0x10e')][_0x50aa('0x57')]);_0x56cc0e[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x1eaf8c[_0x50aa('0x47')]);_0x56cc0e[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x56cc0e[_0x50aa('0x5a')],_0x56cc0e[_0x50aa('0x47')]);_0x16c403[_0x50aa('0x44')]=_['intersection'](_0x56cc0e[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x1eaf8c['query'][_0x50aa('0x5b')]));_0x16c403['attributes']=_0x16c403[_0x50aa('0x44')]['length']?_0x16c403[_0x50aa('0x44')]:_0x56cc0e['model'];_0x16c403['order']=qs[_0x50aa('0xc9')](_0x1eaf8c['query'][_0x50aa('0xc9')]);_0x16c403[_0x50aa('0x3e')]=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x1eaf8c[_0x50aa('0x47')],_0x56cc0e[_0x50aa('0x58')]));if(_0x1eaf8c[_0x50aa('0x47')][_0x50aa('0x2f')]){_0x16c403[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x16c403[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x16c403[_0x50aa('0x44')],function(_0x5c1ea4){var _0x15b808={};_0x15b808[_0x5c1ea4]={'$like':'%'+_0x1eaf8c['query']['filter']+'%'};return _0x15b808;})});}_0x16c403=_[_0x50aa('0x5c')]({},_0x16c403,_0x1eaf8c['options']);return _0x5db785[_0x50aa('0x10d')](_0x16c403);}})[_0x50aa('0x15')](function(_0x3b5a09){if(_0x3b5a09){_0x4578be=_0x3b5a09[_0x50aa('0x49')];if(!_0x1eaf8c[_0x50aa('0x47')]['hasOwnProperty'](_0x50aa('0xd2'))){_0x16c403[_0x50aa('0x25')]=qs['limit'](_0x1eaf8c['query'][_0x50aa('0x25')]);_0x16c403['offset']=qs[_0x50aa('0x22')](_0x1eaf8c['query']['offset']);}return _0x5db785[_0x50aa('0x10d')](_0x16c403);}})['then'](function(_0x2a7440){if(_0x2a7440){return _0x2a7440?{'count':_0x4578be,'rows':_0x2a7440}:null;}})[_0x50aa('0x15')](respondWithResult(_0x3cc23e,null))[_0x50aa('0x1f')](handleError(_0x3cc23e,null));};exports['addTeams']=function(_0x16b244,_0x1cfc17){return db[_0x50aa('0x45')]['find']({'where':{'id':_0x16b244[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x1cfc17,null))[_0x50aa('0x15')](function(_0x87669e){if(_0x87669e){var _0x34d52b=_0x87669e['get']({'plain':!![]});return _0x87669e[_0x50aa('0x10f')](_0x16b244['body']['ids'],_['omit'](_0x16b244[_0x50aa('0x5d')],[_0x50aa('0x5f'),'id'])||{})[_0x50aa('0x15')](function(){for(var _0x2572c9=0x0;_0x2572c9<_0x16b244[_0x50aa('0x5d')][_0x50aa('0x5f')][_0x50aa('0x49')];_0x2572c9++){var _0x1e07bb=[];var _0x2de028={};db[_0x50aa('0x10e')][_0x50aa('0xc7')]({'where':{'id':_0x16b244['body'][_0x50aa('0x5f')][_0x2572c9]}})[_0x50aa('0x15')](function(_0x3c195f){_0x2de028=_0x3c195f[_0x50aa('0x4c')];_0x1e07bb[_0x50aa('0x4a')](_0x3c195f['getVoiceQueues']()[_0x50aa('0x15')](function(_0x21b9d8){for(var _0x801085=0x0;_0x801085<_0x21b9d8[_0x50aa('0x49')];_0x801085++){_0x21b9d8[_0x801085][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x111'));}return _0x21b9d8;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f['getChatQueues']()[_0x50aa('0x15')](function(_0x3a196e){for(var _0x44ee9b=0x0;_0x44ee9b<_0x3a196e[_0x50aa('0x49')];_0x44ee9b++){_0x3a196e[_0x44ee9b][_0x50aa('0x110')]('channel','Chat');}return _0x3a196e;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f['getMailQueues']()[_0x50aa('0x15')](function(_0x24b62d){for(var _0x41fe92=0x0;_0x41fe92<_0x24b62d[_0x50aa('0x49')];_0x41fe92++){_0x24b62d[_0x41fe92][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x112'));}return _0x24b62d;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f['getSmsQueues']()['then'](function(_0x583dae){for(var _0x5de8e1=0x0;_0x5de8e1<_0x583dae['length'];_0x5de8e1++){_0x583dae[_0x5de8e1][_0x50aa('0x110')]('channel',_0x50aa('0x113'));}return _0x583dae;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f[_0x50aa('0x114')]()[_0x50aa('0x15')](function(_0x4aa82f){for(var _0x4e9b8=0x0;_0x4e9b8<_0x4aa82f[_0x50aa('0x49')];_0x4e9b8++){_0x4aa82f[_0x4e9b8]['setDataValue']('channel',_0x50aa('0x115'));}return _0x4aa82f;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f[_0x50aa('0x116')]()[_0x50aa('0x15')](function(_0x3cc426){for(var _0x432413=0x0;_0x432413<_0x3cc426[_0x50aa('0x49')];_0x432413++){_0x3cc426[_0x432413][_0x50aa('0x110')](_0x50aa('0x9b'),'Fax');}return _0x3cc426;}));_0x1e07bb[_0x50aa('0x4a')](_0x3c195f[_0x50aa('0x117')]()['then'](function(_0x2dac2d){for(var _0x18f4fc=0x0;_0x18f4fc<_0x2dac2d[_0x50aa('0x49')];_0x18f4fc++){_0x2dac2d[_0x18f4fc][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x118'));}return _0x2dac2d;}));return BPromise[_0x50aa('0x52')](_0x1e07bb);})['then'](function(_0x3c8c04){var _0x3162bd=_['flatten'](_0x3c8c04);_0x1e07bb=[];return db[_0x50aa('0x69')][_0x50aa('0x119')](function(_0x54978a){for(var _0xc30b6=0x0;_0xc30b6<_0x3162bd['length'];_0xc30b6++){_0x1e07bb['push'](_0x3162bd[_0xc30b6][_0x50aa('0x11a')](_0x34d52b['id']),{'transaction':_0x54978a});}return BPromise[_0x50aa('0x52')](_0x1e07bb)[_0x50aa('0x15')](function(){if(_0x34d52b[_0x50aa('0xaa')]){return BPromise['each'](_[_0x50aa('0x2f')](_0x3162bd,function(_0x4ea004){return _0x4ea004['getDataValue'](_0x50aa('0x9b'))==='Voice';}),function(_0x15e7f7){return db[_0x50aa('0xd7')][_0x50aa('0x11b')]({'membername':_0x34d52b[_0x50aa('0x35')],'UserId':_0x34d52b['id'],'queue_name':_0x15e7f7[_0x50aa('0x35')],'VoiceQueueId':_0x15e7f7['id'],'interface':_[_0x50aa('0x68')](_0x34d52b['interface'])?util[_0x50aa('0xac')](_0x50aa('0xee'),_0x34d52b[_0x50aa('0x35')]):_0x34d52b[_0x50aa('0xab')],'paused':_0x34d52b['voicePause']||![],'penalty':_0x34d52b[_0x50aa('0xa3')]},{'transaction':_0x54978a});});}else{return;}})[_0x50aa('0x15')](function(){for(var _0x5b47aa=0x0;_0x5b47aa<_0x3162bd[_0x50aa('0x49')];_0x5b47aa++){var _0x4f14df=_0x3162bd[_0x5b47aa][_0x50aa('0x11c')]('channel');var _0x2ff5dc=_0x4f14df+_0x50aa('0xa6');socket[_0x50aa('0xa7')](_0x50aa('0x7a')+_0x4f14df+_0x50aa('0x11d'),{'UserId':_0x34d52b['id'],['queueField']:_0x3162bd[_0x5b47aa]['id']});}});});})[_0x50aa('0x15')](function(){db['TeamVoicePrefix'][_0x50aa('0xc7')]({'where':{'teamId':_0x2de028['id']}})[_0x50aa('0x15')](function(_0x5b49e8){if(_0x5b49e8){db[_0x50aa('0x11e')][_0x50aa('0x79')]({'UserId':_0x16b244[_0x50aa('0x54')]['id'],'VoicePrefixId':_0x5b49e8[_0x50aa('0x11f')]});}});});}});}})[_0x50aa('0x15')](respondWithStatusCode(_0x1cfc17,null))[_0x50aa('0x1f')](handleError(_0x1cfc17,null));};exports[_0x50aa('0x120')]=function(_0x445eed,_0x33e97b){return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x445eed['params']['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x33e97b,null))[_0x50aa('0x15')](function(_0x507146){if(_0x507146){var _0x4776c4=_0x507146[_0x50aa('0x2a')]({'plain':!![]});var _0x18b63e=_0x445eed['query']['ids'];return _0x507146[_0x50aa('0x120')](_0x18b63e)['then'](function(){for(var _0x4f2a83=0x0;_0x4f2a83<_0x18b63e[_0x50aa('0x49')];_0x4f2a83++){var _0x219bfa=[];var _0x3447bb={};db[_0x50aa('0x10e')][_0x50aa('0xc7')]({'where':{'id':_0x18b63e[_0x4f2a83]}})[_0x50aa('0x15')](function(_0xdfcc56){_0x3447bb=_0xdfcc56[_0x50aa('0x4c')];_0x219bfa['push'](_0xdfcc56[_0x50aa('0x121')]()[_0x50aa('0x15')](function(_0x1bb4ff){for(var _0x27f993=0x0;_0x27f993<_0x1bb4ff[_0x50aa('0x49')];_0x27f993++){_0x1bb4ff[_0x27f993][_0x50aa('0x110')](_0x50aa('0x9b'),'Voice');}return _0x1bb4ff;}));_0x219bfa[_0x50aa('0x4a')](_0xdfcc56[_0x50aa('0x122')]()['then'](function(_0xc310c){for(var _0x329ed1=0x0;_0x329ed1<_0xc310c[_0x50aa('0x49')];_0x329ed1++){_0xc310c[_0x329ed1][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x123'));}return _0xc310c;}));_0x219bfa[_0x50aa('0x4a')](_0xdfcc56[_0x50aa('0x124')]()[_0x50aa('0x15')](function(_0x466ad5){for(var _0x41d82b=0x0;_0x41d82b<_0x466ad5[_0x50aa('0x49')];_0x41d82b++){_0x466ad5[_0x41d82b][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x112'));}return _0x466ad5;}));_0x219bfa['push'](_0xdfcc56[_0x50aa('0x125')]()[_0x50aa('0x15')](function(_0x43af1b){for(var _0xa160f9=0x0;_0xa160f9<_0x43af1b[_0x50aa('0x49')];_0xa160f9++){_0x43af1b[_0xa160f9][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x113'));}return _0x43af1b;}));_0x219bfa[_0x50aa('0x4a')](_0xdfcc56['getWhatsappQueues']()[_0x50aa('0x15')](function(_0x4f4453){for(var _0xc61f66=0x0;_0xc61f66<_0x4f4453[_0x50aa('0x49')];_0xc61f66++){_0x4f4453[_0xc61f66][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x115'));}return _0x4f4453;}));_0x219bfa[_0x50aa('0x4a')](_0xdfcc56[_0x50aa('0x116')]()['then'](function(_0x3c94b6){for(var _0x411c3a=0x0;_0x411c3a<_0x3c94b6[_0x50aa('0x49')];_0x411c3a++){_0x3c94b6[_0x411c3a][_0x50aa('0x110')]('channel',_0x50aa('0x126'));}return _0x3c94b6;}));_0x219bfa[_0x50aa('0x4a')](_0xdfcc56[_0x50aa('0x117')]()['then'](function(_0x1273a6){for(var _0x3c7afc=0x0;_0x3c7afc<_0x1273a6[_0x50aa('0x49')];_0x3c7afc++){_0x1273a6[_0x3c7afc][_0x50aa('0x110')](_0x50aa('0x9b'),_0x50aa('0x118'));}return _0x1273a6;}));return BPromise[_0x50aa('0x52')](_0x219bfa);})['then'](function(_0x40b874){var _0x272b7f=_[_0x50aa('0x127')](_0x40b874);_0x219bfa=[];return db[_0x50aa('0x69')][_0x50aa('0x119')](function(_0x4bf4d5){for(var _0x3d13fa=0x0;_0x3d13fa<_0x272b7f[_0x50aa('0x49')];_0x3d13fa++){_0x219bfa[_0x50aa('0x4a')](_0x272b7f[_0x3d13fa][_0x50aa('0x128')](_0x4776c4['id']),{'transaction':_0x4bf4d5});}return BPromise[_0x50aa('0x52')](_0x219bfa)['then'](function(){if(_0x4776c4['online']){return BPromise['each'](_['filter'](_0x272b7f,function(_0x4f0a17){return _0x4f0a17['getDataValue'](_0x50aa('0x9b'))===_0x50aa('0x111');}),function(_0x3ab758){return db[_0x50aa('0xd7')][_0x50aa('0x29')]({'where':{'VoiceQueueId':_0x3ab758['id'],'UserId':_0x4776c4['id']},'transaction':_0x4bf4d5});});}else{return;}})[_0x50aa('0x15')](function(){db['TeamVoicePrefix'][_0x50aa('0xc7')]({'where':{'teamId':_0x3447bb['id']}})[_0x50aa('0x15')](function(_0x34d9ea){if(_0x34d9ea){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x4776c4['id'],'VoicePrefixId':_0x34d9ea[_0x50aa('0x4c')][_0x50aa('0x11f')]}});}});})[_0x50aa('0x15')](function(){for(var _0x260466=0x0;_0x260466<_0x272b7f[_0x50aa('0x49')];_0x260466++){var _0x567f19=_0x272b7f[_0x260466]['getDataValue']('channel');var _0x53f0fc=_0x567f19+'QueueId';socket['emit'](_0x50aa('0x7a')+_0x567f19+_0x50aa('0xb0'),{'UserId':_0x4776c4['id'],['queueField']:_0x272b7f[_0x260466]['id']});}});});});}});}})[_0x50aa('0x15')](respondWithStatusCode(_0x33e97b,null))[_0x50aa('0x1f')](handleError(_0x33e97b,null));};exports[_0x50aa('0x129')]=function(_0x45369e,_0x198654){var _0x4c4cbc={};var _0x4e942a={};var _0x17dfba;var _0x2cd50b;return db[_0x50aa('0x45')][_0x50aa('0xc7')]({'where':{'id':_0x45369e[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x198654,null))['then'](function(_0x3ea4ce){if(_0x3ea4ce){_0x17dfba=_0x3ea4ce;_0x4e942a[_0x50aa('0x5a')]=_[_0x50aa('0x56')](db[_0x50aa('0xcc')][_0x50aa('0x57')]);_0x4e942a[_0x50aa('0x47')]=_[_0x50aa('0x56')](_0x45369e['query']);_0x4e942a[_0x50aa('0x58')]=_['intersection'](_0x4e942a[_0x50aa('0x5a')],_0x4e942a[_0x50aa('0x47')]);_0x4c4cbc['attributes']=_[_0x50aa('0x59')](_0x4e942a['model'],qs[_0x50aa('0x5b')](_0x45369e[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x4c4cbc[_0x50aa('0x44')]=_0x4c4cbc['attributes']['length']?_0x4c4cbc[_0x50aa('0x44')]:_0x4e942a[_0x50aa('0x5a')];_0x4c4cbc['order']=qs[_0x50aa('0xc9')](_0x45369e[_0x50aa('0x47')][_0x50aa('0xc9')]);_0x4c4cbc[_0x50aa('0x3e')]=qs['filters'](_['pick'](_0x45369e[_0x50aa('0x47')],_0x4e942a[_0x50aa('0x58')]));if(_0x45369e[_0x50aa('0x47')]['filter']){_0x4c4cbc[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x4c4cbc[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x4c4cbc[_0x50aa('0x44')],function(_0x229fad){var _0x22596a={};_0x22596a[_0x229fad]={'$like':'%'+_0x45369e[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x22596a;})});}_0x4c4cbc=_[_0x50aa('0x5c')]({},_0x4c4cbc,_0x45369e['options']);return _0x17dfba['getLists'](_0x4c4cbc);}})[_0x50aa('0x15')](function(_0x202b82){if(_0x202b82){_0x2cd50b=_0x202b82[_0x50aa('0x49')];if(!_0x45369e[_0x50aa('0x47')][_0x50aa('0xcb')](_0x50aa('0xd2'))){_0x4c4cbc[_0x50aa('0x25')]=qs[_0x50aa('0x25')](_0x45369e[_0x50aa('0x47')][_0x50aa('0x25')]);_0x4c4cbc[_0x50aa('0x22')]=qs[_0x50aa('0x22')](_0x45369e[_0x50aa('0x47')][_0x50aa('0x22')]);}return _0x17dfba['getLists'](_0x4c4cbc);}})[_0x50aa('0x15')](function(_0x753670){if(_0x753670){return _0x753670?{'count':_0x2cd50b,'rows':_0x753670}:null;}})[_0x50aa('0x15')](respondWithResult(_0x198654,null))[_0x50aa('0x1f')](handleError(_0x198654,null));};exports[_0x50aa('0x12a')]=function(_0x40cbfa,_0x31b7b7){var _0x2c1c02={};var _0x57b508={};var _0x570fb4;return db[_0x50aa('0x45')]['findOne']({'where':{'id':_0x40cbfa[_0x50aa('0x54')]['id']}})[_0x50aa('0x15')](handleEntityNotFound(_0x31b7b7,null))[_0x50aa('0x15')](function(_0x26d929){if(_0x26d929){_0x570fb4=_0x26d929;_0x57b508[_0x50aa('0x5a')]=_['keys'](db[_0x50aa('0x45')][_0x50aa('0x57')]);_0x57b508['query']=_[_0x50aa('0x56')](_0x40cbfa['query']);_0x57b508[_0x50aa('0x58')]=_[_0x50aa('0x59')](_0x57b508[_0x50aa('0x5a')],_0x57b508[_0x50aa('0x47')]);_0x2c1c02[_0x50aa('0x44')]=_[_0x50aa('0x59')](_0x57b508[_0x50aa('0x5a')],qs[_0x50aa('0x5b')](_0x40cbfa[_0x50aa('0x47')][_0x50aa('0x5b')]));_0x2c1c02['attributes']=_0x2c1c02[_0x50aa('0x44')]['length']?_0x2c1c02[_0x50aa('0x44')]:_0x57b508[_0x50aa('0x5a')];_0x2c1c02['order']=qs['sort'](_0x40cbfa['query'][_0x50aa('0xc9')]);_0x2c1c02['where']=qs[_0x50aa('0x58')](_[_0x50aa('0xd5')](_0x40cbfa[_0x50aa('0x47')],_0x57b508['filters']));if(_0x40cbfa[_0x50aa('0x47')]['filter']){_0x2c1c02[_0x50aa('0x3e')]=_[_0x50aa('0x5c')](_0x2c1c02[_0x50aa('0x3e')],{'$or':_[_0x50aa('0x30')](_0x2c1c02[_0x50aa('0x44')],function(_0x47a8f8){var _0x47e632={};_0x47e632[_0x47a8f8]={'$like':'%'+_0x40cbfa[_0x50aa('0x47')][_0x50aa('0x2f')]+'%'};return _0x47e632;})});}_0x2c1c02[_0x50aa('0x5a')]=db[_0x50aa('0x45')];_0x2c1c02['as']=_0x50aa('0x2d');_0x2c1c02=_[_0x50aa('0x5c')]({},_0x2c1c02,_0x40cbfa[_0x50aa('0xca')]);return _0x570fb4[_0x50aa('0x121')]({'include':[_0x2c1c02]});}})[_0x50aa('0x15')](function(_0x206166){if(_0x206166){var _0x27278b={},_0x447419=[];for(var _0x247238=0x0;_0x247238<_0x206166['length'];_0x247238+=0x1){for(var _0x47f559=0x0,_0x3464f0;_0x47f559<_0x206166[_0x247238][_0x50aa('0x2d')]['length'];_0x47f559+=0x1){_0x3464f0=_0x206166[_0x247238][_0x50aa('0x2d')][_0x47f559][_0x50aa('0x2a')]({'plain':!![]});_0x27278b[_0x3464f0['id']]=_0x3464f0;}}_0x27278b=_['values'](_0x27278b);for(var _0x526f4c=qs[_0x50aa('0x22')](_0x40cbfa['query'][_0x50aa('0x22')]);_0x526f4c<_0x27278b[_0x50aa('0x49')]&&_0x447419['length']=_0x422844[_0x0c39('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x0c39('0xe')](function(){if(_0x390619){return db[_0x0c39('0x51')][_0x0c39('0x46')]({'where':{'membername':_0x390619[_0x0c39('0x26')]},'individualHooks':!![]});}})[_0x0c39('0xe')](function(){if(_0x390619){return _0x390619[_0x0c39('0x52')]({'raw':!![]});}})[_0x0c39('0xe')](function(_0x15153f){if(_0x390619){if(_0x15153f){var _0x20c8bb=[];_0x40c294=_0x15153f;if(_0x40c294[_0x0c39('0x2c')]){for(var _0x58373d=0x0;_0x58373d<_0x40c294[_0x0c39('0x2c')];_0x58373d++){_0x20c8bb[_0x0c39('0x30')](db[_0x0c39('0x51')][_0x0c39('0x53')]({'membername':_0x390619['name'],'UserId':_0x390619['id'],'queue_name':_0x40c294[_0x58373d][_0x0c39('0x26')],'VoiceQueueId':_0x40c294[_0x58373d]['id'],'interface':_0x2de23e,'paused':_0x390619[_0x0c39('0x4b')]||![],'penalty':_0x40c294[_0x58373d][_0x0c39('0x54')]||0x0}));}return BPromise[_0x0c39('0x47')](_0x20c8bb);}}}})['then'](function(){if(_0x390619){return db[_0x0c39('0x2b')][_0x0c39('0x19')]({'where':{'membername':_0x390619[_0x0c39('0x26')],'exitAt':null}});}})['then'](function(_0x11ed5b){if(_0x390619){if(_0x11ed5b&&_0x11ed5b[_0x0c39('0x2c')]){var _0x45a62d=[];_0x11ed5b[_0x0c39('0x2f')](function(_0x2d387e){_0x45a62d[_0x0c39('0x30')](_0x2d387e[_0x0c39('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0c39('0x47')](_0x45a62d);}}})[_0x0c39('0xe')](function(_0x23136c){if(_0x390619){var _0x26cb44=[];var _0xdf5a42=[];var _0x2e08c1=utils[_0x0c39('0x55')]();var _0x5656ee={'membername':_0x390619[_0x0c39('0x26')],'interface':_0x2de23e,'enterAt':moment()[_0x0c39('0x2d')](_0x0c39('0x33')),'role':_0x390619[_0x0c39('0x27')],'internal':_0x390619[_0x0c39('0x28')]};_0x2e08c1['forEach'](function(_0xb7b9ef){_0x26cb44[_0x0c39('0x30')](_['merge']({'channel':_0xb7b9ef,'type':_0x0c39('0x56'),'data1':'callysquare','data2':_0x2de23e},_0x5656ee));if(_0x390619[_0x0c39('0x4b')]){_0xdf5a42[_0x0c39('0x30')](_[_0x0c39('0x57')]({'channel':_0xb7b9ef,'type':_0x0c39('0x32'),'data1':_0x0c39('0x58')},_0x5656ee));}});return db[_0x0c39('0x2b')][_0x0c39('0x59')](_0x26cb44[_0x0c39('0x5a')](_0xdf5a42),{'individualHooks':!![]});}})[_0x0c39('0xe')](function(){if(_0x390619){return _0x390619[_0x0c39('0x2a')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x390619[_0x0c39('0x4b')]||![],'mailPause':_0x390619[_0x0c39('0x4b')]||![],'chatPause':_0x390619[_0x0c39('0x4b')]||![],'faxPause':_0x390619['loginInPause']||![],'smsPause':_0x390619[_0x0c39('0x4b')]||![],'openchannelPause':_0x390619[_0x0c39('0x4b')]||![],'pauseType':_0x390619['loginInPause']?_0x0c39('0x58'):null,'lastPauseAt':moment()[_0x0c39('0x2d')](_0x0c39('0x33')),'interface':_0x2de23e});}})['then'](function(_0x2597b4){_0x1a176c(_0x2597b4);})['catch'](function(_0x295e90){_0x5309d2(_0x508cef['error'](0x1f4,_0x295e90[_0x0c39('0x14')]));});});}; \ No newline at end of file +var _0x6ca4=['YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','isNil','interface','body','uniqueid','MemberReport','bulkCreate','update','type','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','voice','system','chat','fax','sms','whatsapp','set','Pause','push','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','User','findAll','options','raw','where','limit','map','include','model','GetUser','catch','ShowUser','attributes','find','name','role','internal','UserVoiceQueueRt','PAUSE','length','format'];(function(_0x3b8302,_0x511fa1){var _0x21b6a9=function(_0x15b50d){while(--_0x15b50d){_0x3b8302['push'](_0x3b8302['shift']());}};_0x21b6a9(++_0x511fa1);}(_0x6ca4,0x1e7));var _0x46ca=function(_0x5d6d75,_0x388f8e){_0x5d6d75=_0x5d6d75-0x0;var _0x39d015=_0x6ca4[_0x5d6d75];return _0x39d015;};'use strict';var _=require(_0x46ca('0x0'));var util=require(_0x46ca('0x1'));var moment=require(_0x46ca('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46ca('0x3'));var db=require(_0x46ca('0x4'))['db'];var utils=require(_0x46ca('0x5'));var logger=require(_0x46ca('0x6'))(_0x46ca('0x7'));var config=require(_0x46ca('0x8'));var jayson=require(_0x46ca('0x9'));var client=jayson[_0x46ca('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x46ca('0xb')],{'host':_0x46ca('0xc'),'port':0x18eb});var socket=require(_0x46ca('0xd'))(new Redis(config[_0x46ca('0xb')]));require(_0x46ca('0xe'))[_0x46ca('0xf')](socket);function respondWithRpcPromise(_0x119c1d,_0x517409,_0xfe47e7){return new BPromise(function(_0x2f0c8b,_0x82e321){return client[_0x46ca('0x10')](_0x119c1d,_0xfe47e7)[_0x46ca('0x11')](function(_0x44b54e){logger[_0x46ca('0x12')](_0x46ca('0x13'),_0x517409,_0x46ca('0x14'));logger[_0x46ca('0x15')](_0x46ca('0x16'),_0x517409,_0x46ca('0x14'),JSON[_0x46ca('0x17')](_0x44b54e));if(_0x44b54e[_0x46ca('0x18')]){if(_0x44b54e[_0x46ca('0x18')]['code']===0x1f4){logger['error'](_0x46ca('0x13'),_0x517409,_0x44b54e['error']['message']);return _0x82e321(_0x44b54e[_0x46ca('0x18')]['message']);}logger['error'](_0x46ca('0x13'),_0x517409,_0x44b54e[_0x46ca('0x18')][_0x46ca('0x19')]);return _0x2f0c8b(_0x44b54e[_0x46ca('0x18')]['message']);}else{logger[_0x46ca('0x12')](_0x46ca('0x13'),_0x517409,_0x46ca('0x14'));_0x2f0c8b(_0x44b54e['result'][_0x46ca('0x19')]);}})['catch'](function(_0x5ce260){logger[_0x46ca('0x18')](_0x46ca('0x13'),_0x517409,_0x5ce260);_0x82e321(_0x5ce260);});});}exports['GetUser']=function(_0x2698e1){var _0x5c53e2=this;return new Promise(function(_0x417cac,_0xb4c61c){return db[_0x46ca('0x1a')][_0x46ca('0x1b')]({'raw':_0x2698e1[_0x46ca('0x1c')]?_0x2698e1[_0x46ca('0x1c')][_0x46ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x2698e1[_0x46ca('0x1c')]?_0x2698e1['options'][_0x46ca('0x1e')]||null:null,'attributes':_0x2698e1[_0x46ca('0x1c')]?_0x2698e1[_0x46ca('0x1c')]['attributes']||null:null,'limit':_0x2698e1['options']?_0x2698e1[_0x46ca('0x1c')][_0x46ca('0x1f')]||null:null,'include':_0x2698e1[_0x46ca('0x1c')]?_0x2698e1[_0x46ca('0x1c')]['include']?_[_0x46ca('0x20')](_0x2698e1[_0x46ca('0x1c')][_0x46ca('0x21')],function(_0xe0107e){return{'model':db[_0xe0107e[_0x46ca('0x22')]],'as':_0xe0107e['as'],'attributes':_0xe0107e['attributes'],'include':_0xe0107e[_0x46ca('0x21')]?_['map'](_0xe0107e[_0x46ca('0x21')],function(_0x3f4d7d){return{'model':db[_0x3f4d7d['model']],'as':_0x3f4d7d['as'],'attributes':_0x3f4d7d['attributes'],'include':_0x3f4d7d['include']?_[_0x46ca('0x20')](_0x3f4d7d[_0x46ca('0x21')],function(_0x27c34b){return{'model':db[_0x27c34b[_0x46ca('0x22')]],'as':_0x27c34b['as'],'attributes':_0x27c34b['attributes']};}):[]};}):[]};}):[]:[]})[_0x46ca('0x11')](function(_0x23fbe6){logger[_0x46ca('0x12')](_0x46ca('0x23'),_0x2698e1);logger[_0x46ca('0x15')](_0x46ca('0x23'),_0x2698e1,JSON['stringify'](_0x23fbe6));_0x417cac(_0x23fbe6);})[_0x46ca('0x24')](function(_0x1be25d){logger[_0x46ca('0x18')](_0x46ca('0x23'),_0x1be25d['message'],_0x2698e1);_0xb4c61c(_0x5c53e2[_0x46ca('0x18')](0x1f4,_0x1be25d['message']));});});};exports[_0x46ca('0x25')]=function(_0x57cadf){var _0x47c711=this;return new Promise(function(_0x4f55eb,_0x19ce1b){return db[_0x46ca('0x1a')]['find']({'raw':_0x57cadf[_0x46ca('0x1c')]?_0x57cadf[_0x46ca('0x1c')][_0x46ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x57cadf[_0x46ca('0x1c')]?_0x57cadf[_0x46ca('0x1c')]['where']||null:null,'attributes':_0x57cadf['options']?_0x57cadf['options']['attributes']||null:null,'include':_0x57cadf[_0x46ca('0x1c')]?_0x57cadf[_0x46ca('0x1c')]['include']?_[_0x46ca('0x20')](_0x57cadf['options']['include'],function(_0x32e373){return{'model':db[_0x32e373[_0x46ca('0x22')]],'as':_0x32e373['as'],'attributes':_0x32e373[_0x46ca('0x26')],'include':_0x32e373[_0x46ca('0x21')]?_[_0x46ca('0x20')](_0x32e373[_0x46ca('0x21')],function(_0x308819){return{'model':db[_0x308819[_0x46ca('0x22')]],'as':_0x308819['as'],'attributes':_0x308819[_0x46ca('0x26')],'include':_0x308819[_0x46ca('0x21')]?_['map'](_0x308819[_0x46ca('0x21')],function(_0x6ce342){return{'model':db[_0x6ce342[_0x46ca('0x22')]],'as':_0x6ce342['as'],'attributes':_0x6ce342[_0x46ca('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b25a0){logger[_0x46ca('0x12')](_0x46ca('0x25'),_0x57cadf);logger[_0x46ca('0x15')](_0x46ca('0x25'),_0x57cadf,JSON[_0x46ca('0x17')](_0x3b25a0));_0x4f55eb(_0x3b25a0);})[_0x46ca('0x24')](function(_0x1128a9){logger[_0x46ca('0x18')](_0x46ca('0x25'),_0x1128a9[_0x46ca('0x19')],_0x57cadf);_0x19ce1b(_0x47c711['error'](0x1f4,_0x1128a9[_0x46ca('0x19')]));});});};exports['PauseUser']=function(_0x120e6d){var _0x5082b8=this;return new Promise(function(_0x5576bd,_0x19512e){var _0x3bc07a;return db[_0x46ca('0x1a')][_0x46ca('0x27')]({'where':_0x120e6d[_0x46ca('0x1c')]['where']||{},'attributes':['id',_0x46ca('0x28'),_0x46ca('0x29'),_0x46ca('0x2a'),'interface']})[_0x46ca('0x11')](function(_0x3fc3a8){if(_0x3fc3a8){_0x3bc07a=_0x3fc3a8;return db[_0x46ca('0x2b')]['update']({'paused':0x1},{'where':{'UserId':_0x3bc07a['id']},'individualHooks':!![]});}})[_0x46ca('0x11')](function(){if(_0x3bc07a){return db['MemberReport'][_0x46ca('0x1b')]({'where':{'membername':_0x3bc07a['name'],'type':_0x46ca('0x2c'),'exitAt':null}});}})['then'](function(_0x29e893){if(_0x3bc07a){if(_0x29e893&&_0x29e893[_0x46ca('0x2d')]){var _0x14369a=moment()[_0x46ca('0x2e')](_0x46ca('0x2f'));for(var _0x1a71cc=0x0,_0x2c7b89=_0x29e893[_0x46ca('0x2d')];_0x1a71cc<_0x2c7b89;_0x1a71cc++){_0x29e893[_0x1a71cc]['updateAttributes']({'exitAt':_0x14369a});}}}})[_0x46ca('0x11')](function(){if(_0x3bc07a){var _0x2d9108=[];var _0x238074=utils[_0x46ca('0x30')]();_0x238074[_0x46ca('0x31')](function(_0x34ee5b){_0x2d9108['push']({'channel':_0x34ee5b,'membername':_0x3bc07a[_0x46ca('0x28')],'interface':_[_0x46ca('0x32')](_0x3bc07a['interface'])?util['format']('SIP/%s',_0x3bc07a[_0x46ca('0x28')]):_0x3bc07a[_0x46ca('0x33')],'type':_0x46ca('0x2c'),'enterAt':moment()[_0x46ca('0x2e')](_0x46ca('0x2f')),'data1':_0x120e6d[_0x46ca('0x34')]['type']||'DEFAULT\x20PAUSE','role':_0x3bc07a[_0x46ca('0x29')],'internal':_0x3bc07a[_0x46ca('0x2a')],'uniqueid':_0x120e6d[_0x46ca('0x34')][_0x46ca('0x35')]||null});});return db[_0x46ca('0x36')][_0x46ca('0x37')](_0x2d9108,{'individualHooks':!![]});}})[_0x46ca('0x11')](function(){if(_0x3bc07a){return _0x3bc07a[_0x46ca('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x120e6d[_0x46ca('0x34')][_0x46ca('0x39')]||_0x46ca('0x3a'),'lastPauseAt':moment()['format'](_0x46ca('0x2f'))});}})['then'](function(_0x5396d8){_0x5576bd(_0x5396d8);})[_0x46ca('0x24')](function(_0x55c8c3){_0x19512e(_0x5082b8[_0x46ca('0x18')](0x1f4,_0x55c8c3[_0x46ca('0x19')]));});});};exports[_0x46ca('0x3b')]=function(_0x50f212){var _0x4df265=this;return new Promise(function(_0x2839cd,_0x2e76fc){var _0x509f3a;return db[_0x46ca('0x1a')][_0x46ca('0x3c')]({'where':_0x50f212[_0x46ca('0x1c')]['where']||{},'attributes':['id',_0x46ca('0x28')]})[_0x46ca('0x11')](function(_0x276b61){if(_0x276b61){_0x509f3a=_0x276b61;if(_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')]&&!utils[_0x46ca('0x3e')](_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')])){throw new Error('Unknown\x20channel');}switch(_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')]){case _0x46ca('0x3f'):return db[_0x46ca('0x2b')][_0x46ca('0x38')]({'paused':0x0},{'where':{'UserId':_0x509f3a['id']}})[_0x46ca('0x11')](function(){return db[_0x46ca('0x36')][_0x46ca('0x27')]({'where':{'channel':_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')],'membername':_0x509f3a['name'],'type':'PAUSE','exitAt':null}});})[_0x46ca('0x11')](function(_0x36eebf){if(_0x36eebf){return _0x36eebf['update']({'exitAt':moment()[_0x46ca('0x2e')](_0x46ca('0x2f')),'data2':_0x46ca('0x40')},{'individualHooks':!![]});}return null;})[_0x46ca('0x11')](function(){return _0x509f3a['update']({'voicePause':![]});});case'mail':case _0x46ca('0x41'):case _0x46ca('0x42'):case _0x46ca('0x43'):case'openchannel':case _0x46ca('0x44'):return db[_0x46ca('0x36')][_0x46ca('0x27')]({'where':{'channel':_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')],'membername':_0x509f3a[_0x46ca('0x28')],'type':_0x46ca('0x2c'),'exitAt':null}})['then'](function(_0x1ed5c1){return _0x1ed5c1[_0x46ca('0x38')]({'exitAt':moment()['format'](_0x46ca('0x2f')),'data2':_0x46ca('0x40')},{'individualHooks':!![]});})[_0x46ca('0x11')](function(){var _0x5a3f56={};_[_0x46ca('0x45')](_0x5a3f56,util[_0x46ca('0x2e')]('%s%s',_0x50f212[_0x46ca('0x34')][_0x46ca('0x3d')],_0x46ca('0x46')),![]);return _0x509f3a[_0x46ca('0x38')](_0x5a3f56);});default:return db[_0x46ca('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x509f3a['id']}})[_0x46ca('0x11')](function(){return db[_0x46ca('0x36')][_0x46ca('0x1b')]({'where':{'membername':_0x509f3a['name'],'type':'PAUSE','exitAt':null}});})[_0x46ca('0x11')](function(_0x575bf1){var _0x2d8d8f=[];_0x575bf1[_0x46ca('0x31')](function(_0x836646){_0x2d8d8f[_0x46ca('0x47')](_0x836646['update']({'exitAt':moment()['format'](_0x46ca('0x2f')),'data2':_0x46ca('0x40')}));});return BPromise[_0x46ca('0x48')](_0x2d8d8f);})[_0x46ca('0x11')](function(){return _0x509f3a[_0x46ca('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x46ca('0x11')](function(_0x32b97e){_0x2839cd(_0x32b97e);})['catch'](function(_0xe5b7e4){_0x2e76fc(_0x4df265[_0x46ca('0x18')](0x1f4,_0xe5b7e4['message']));});});};exports[_0x46ca('0x49')]=function(_0x51f434){var _0x288fb8=this;return new Promise(function(_0x8ee6f1,_0x102f11){var _0x3b1cfc;return db[_0x46ca('0x1a')][_0x46ca('0x3c')]({'where':_0x51f434[_0x46ca('0x1c')][_0x46ca('0x1e')]||{},'attributes':['id','name']})[_0x46ca('0x11')](function(_0x96c808){if(_0x96c808){_0x3b1cfc=_0x96c808;return db[_0x46ca('0x2b')][_0x46ca('0x4a')]({'where':{'membername':_0x3b1cfc['name']},'individualHooks':!![]});}})[_0x46ca('0x11')](function(){if(_0x3b1cfc){return db['MemberReport']['findAll']({'where':{'membername':_0x3b1cfc[_0x46ca('0x28')],'exitAt':null}});}})[_0x46ca('0x11')](function(_0x5644bb){if(_0x3b1cfc){if(_0x5644bb&&_0x5644bb['length']){var _0x30dbfb=[];_0x5644bb[_0x46ca('0x31')](function(_0x519330){_0x30dbfb[_0x46ca('0x47')](_0x519330['update']({'exitAt':moment()[_0x46ca('0x2e')](_0x46ca('0x2f'))}));});return BPromise['all'](_0x30dbfb);}}})[_0x46ca('0x11')](function(){if(_0x3b1cfc){return _0x3b1cfc[_0x46ca('0x38')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x46ca('0x11')](function(_0x28e3dd){_0x8ee6f1(_0x28e3dd);})[_0x46ca('0x24')](function(_0x22408f){_0x102f11(_0x288fb8['error'](0x1f4,_0x22408f[_0x46ca('0x19')]));});});};exports[_0x46ca('0x4b')]=function(_0x4c7eff){var _0x3c8cd0=this;return new Promise(function(_0x12fff7,_0x2454fb){var _0x3dee32;var _0x5e4122;var _0x50ee14;var _0x51f572;return db[_0x46ca('0x1a')][_0x46ca('0x3c')]({'where':_0x4c7eff['options'][_0x46ca('0x1e')]||{},'attributes':['id',_0x46ca('0x28'),_0x46ca('0x29'),_0x46ca('0x4c'),_0x46ca('0x4d'),_0x46ca('0x2a'),_0x46ca('0x4e'),_0x46ca('0x33')]})[_0x46ca('0x11')](function(_0x15b96f){if(_0x15b96f){_0x3dee32=_0x15b96f;_0x51f572=_0x4c7eff['body'][_0x46ca('0x33')]?_0x4c7eff[_0x46ca('0x34')][_0x46ca('0x33')]:util[_0x46ca('0x2e')](_0x46ca('0x4f'),_0x3dee32[_0x46ca('0x28')]);return db['User'][_0x46ca('0x50')]({'where':{'role':_0x46ca('0x51'),'online':!![],'id':{'$ne':_0x3dee32['id']}}});}})[_0x46ca('0x11')](function(_0xfa402c){if(_0xfa402c){_0x50ee14=_0xfa402c;return require('../../config/license/util')[_0x46ca('0x52')]();}})['then'](function(_0x5c9695){if(_0x5c9695&&_0x5c9695[_0x46ca('0x53')]&&_0x50ee14>=_0x5c9695['agents']){throw new Error(_0x46ca('0x54'));}})[_0x46ca('0x11')](function(){if(_0x3dee32){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3dee32['name']},'individualHooks':!![]});}})['then'](function(){if(_0x3dee32){return _0x3dee32[_0x46ca('0x55')]({'raw':!![]});}})[_0x46ca('0x11')](function(_0x23ef04){if(_0x3dee32){if(_0x23ef04){var _0xe1211c=[];_0x5e4122=_0x23ef04;if(_0x5e4122[_0x46ca('0x2d')]){for(var _0x54547=0x0;_0x54547<_0x5e4122[_0x46ca('0x2d')];_0x54547++){_0xe1211c[_0x46ca('0x47')](db[_0x46ca('0x2b')]['upsert']({'membername':_0x3dee32[_0x46ca('0x28')],'UserId':_0x3dee32['id'],'queue_name':_0x5e4122[_0x54547][_0x46ca('0x28')],'VoiceQueueId':_0x5e4122[_0x54547]['id'],'interface':_0x51f572,'paused':_0x3dee32[_0x46ca('0x4e')]||![],'penalty':_0x5e4122[_0x54547][_0x46ca('0x56')]||0x0}));}return BPromise[_0x46ca('0x48')](_0xe1211c);}}}})[_0x46ca('0x11')](function(){if(_0x3dee32){return db[_0x46ca('0x36')][_0x46ca('0x1b')]({'where':{'membername':_0x3dee32['name'],'exitAt':null}});}})[_0x46ca('0x11')](function(_0x28a212){if(_0x3dee32){if(_0x28a212&&_0x28a212[_0x46ca('0x2d')]){var _0x310c6f=[];_0x28a212[_0x46ca('0x31')](function(_0x47769b){_0x310c6f['push'](_0x47769b[_0x46ca('0x38')]({'exitAt':moment()[_0x46ca('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x46ca('0x48')](_0x310c6f);}}})['then'](function(_0x304dd7){if(_0x3dee32){var _0x18b587=[];var _0x2ad065=[];var _0x12742f=utils['getChannels']();var _0x52d67f={'membername':_0x3dee32[_0x46ca('0x28')],'interface':_0x51f572,'enterAt':moment()[_0x46ca('0x2e')](_0x46ca('0x2f')),'role':_0x3dee32[_0x46ca('0x29')],'internal':_0x3dee32[_0x46ca('0x2a')]};_0x12742f[_0x46ca('0x31')](function(_0x1ba777){_0x18b587[_0x46ca('0x47')](_['merge']({'channel':_0x1ba777,'type':'LOGIN','data1':'callysquare','data2':_0x51f572},_0x52d67f));if(_0x3dee32['loginInPause']){_0x2ad065[_0x46ca('0x47')](_[_0x46ca('0x57')]({'channel':_0x1ba777,'type':_0x46ca('0x2c'),'data1':'LOGININPAUSE'},_0x52d67f));}});return db[_0x46ca('0x36')][_0x46ca('0x37')](_0x18b587[_0x46ca('0x58')](_0x2ad065),{'individualHooks':!![]});}})['then'](function(){if(_0x3dee32){return _0x3dee32[_0x46ca('0x38')]({'online':!![],'lastLoginAt':moment()[_0x46ca('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3dee32[_0x46ca('0x4e')]||![],'mailPause':_0x3dee32['loginInPause']||![],'chatPause':_0x3dee32['loginInPause']||![],'faxPause':_0x3dee32[_0x46ca('0x4e')]||![],'smsPause':_0x3dee32[_0x46ca('0x4e')]||![],'openchannelPause':_0x3dee32[_0x46ca('0x4e')]||![],'pauseType':_0x3dee32[_0x46ca('0x4e')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x46ca('0x2e')](_0x46ca('0x2f')),'interface':_0x51f572});}})[_0x46ca('0x11')](function(_0x391d7b){_0x12fff7(_0x391d7b);})['catch'](function(_0x1e15a9){_0x2454fb(_0x3c8cd0[_0x46ca('0x18')](0x1f4,_0x1e15a9[_0x46ca('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3eb17c4..c8b70dc 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 _0x1424=['length','save','remove','emit','register'];(function(_0x219f47,_0x31759b){var _0x54cc7b=function(_0x213298){while(--_0x213298){_0x219f47['push'](_0x219f47['shift']());}};_0x54cc7b(++_0x31759b);}(_0x1424,0xe7));var _0x4142=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x1424[_0x137d1d];return _0x485108;};'use strict';var UserEvents=require('./user.events');var events=[_0x4142('0x0'),_0x4142('0x1'),'update'];function createListener(_0xacef75,_0x552cfe){return function(_0x18a971){_0x552cfe[_0x4142('0x2')](_0xacef75,_0x18a971);};}function removeListener(_0x5e3c52,_0x3841ba){return function(){UserEvents['removeListener'](_0x5e3c52,_0x3841ba);};}exports[_0x4142('0x3')]=function(_0x243a28){for(var _0x2eba80=0x0,_0x35de44=events[_0x4142('0x4')];_0x2eba80<_0x35de44;_0x2eba80++){var _0x57f141=events[_0x2eba80];var _0x14c65b=createListener('user:'+_0x57f141,_0x243a28);UserEvents['on'](_0x57f141,_0x14c65b);}}; \ No newline at end of file +var _0x53ab=['removeListener','register','length','user:','./user.events','save','remove','emit'];(function(_0x3bb3b5,_0x4fa5b3){var _0x489540=function(_0x2ab4a4){while(--_0x2ab4a4){_0x3bb3b5['push'](_0x3bb3b5['shift']());}};_0x489540(++_0x4fa5b3);}(_0x53ab,0x194));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0xb53a('0x0'));var events=[_0xb53a('0x1'),_0xb53a('0x2'),'update'];function createListener(_0x498f8d,_0x5e2c9b){return function(_0x4ebcb2){_0x5e2c9b[_0xb53a('0x3')](_0x498f8d,_0x4ebcb2);};}function removeListener(_0x242883,_0x442ac8){return function(){UserEvents[_0xb53a('0x4')](_0x242883,_0x442ac8);};}exports[_0xb53a('0x5')]=function(_0x536188){for(var _0x18514e=0x0,_0x3d8bdb=events[_0xb53a('0x6')];_0x18514e<_0x3d8bdb;_0x18514e++){var _0x9ad1e8=events[_0x18514e];var _0x1ec145=createListener(_0xb53a('0x7')+_0x9ad1e8,_0x536188);UserEvents['on'](_0x9ad1e8,_0x1ec145);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4a0a81e..741b1c0 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3230af,_0x57f028){var _0x194441=function(_0x507255){while(--_0x507255){_0x3230af['push'](_0x3230af['shift']());}};_0x194441(++_0x57f028);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2e3dca,_0xfb9521){var _0xd92992=function(_0x528ca0){while(--_0x528ca0){_0x2e3dca['push'](_0x2e3dca['shift']());}};_0xd92992(++_0xfb9521);}(_0x70e0,0x17b));var _0x070e=function(_0x3b6ef9,_0x2135a0){_0x3b6ef9=_0x3b6ef9-0x0;var _0x39c947=_0x70e0[_0x3b6ef9];return _0x39c947;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4c0a68f..1975ab0 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 _0xa4d8=['exports','INTEGER','sequelize'];(function(_0x42cb74,_0xd030f0){var _0x264737=function(_0x4ac595){while(--_0x4ac595){_0x42cb74['push'](_0x42cb74['shift']());}};_0x264737(++_0xd030f0);}(_0xa4d8,0x1dc));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a4d('0x0'));module[_0x8a4d('0x1')]={'penalty':{'type':Sequelize[_0x8a4d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74ae=['exports','INTEGER','sequelize'];(function(_0x474c79,_0x57bae0){var _0x4ae54e=function(_0x32a0b4){while(--_0x32a0b4){_0x474c79['push'](_0x474c79['shift']());}};_0x4ae54e(++_0x57bae0);}(_0x74ae,0x1d6));var _0xe74a=function(_0x14a129,_0x319fc4){_0x14a129=_0x14a129-0x0;var _0x20d46d=_0x74ae[_0x14a129];return _0x20d46d;};'use strict';var Sequelize=require(_0xe74a('0x0'));module[_0xe74a('0x1')]={'penalty':{'type':Sequelize[_0xe74a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 5bf7d4b..2186782 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 _0x9528=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9528,0x84));var _0x8952=function(_0x455953,_0x21b0b7){_0x455953=_0x455953-0x0;var _0x437e47=_0x9528[_0x455953];return _0x437e47;};'use strict';var _=require(_0x8952('0x0'));var util=require(_0x8952('0x1'));var logger=require(_0x8952('0x2'))(_0x8952('0x3'));var moment=require(_0x8952('0x4'));var BPromise=require(_0x8952('0x5'));var rp=require(_0x8952('0x6'));var fs=require('fs');var path=require(_0x8952('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8952('0x8'));module['exports']=function(_0xd70e92,_0x3329cb){return _0xd70e92[_0x8952('0x9')](_0x8952('0xa'),attributes,{'tableName':_0x8952('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22e2=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x4fea04,_0x313518){var _0x112f54=function(_0x5579c1){while(--_0x5579c1){_0x4fea04['push'](_0x4fea04['shift']());}};_0x112f54(++_0x313518);}(_0x22e2,0x115));var _0x222e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x22e2[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x222e('0x0'));var logger=require(_0x222e('0x1'))(_0x222e('0x2'));var moment=require('moment');var BPromise=require(_0x222e('0x3'));var rp=require(_0x222e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x222e('0x5'));var config=require(_0x222e('0x6'));var attributes=require(_0x222e('0x7'));module[_0x222e('0x8')]=function(_0x2a73b2,_0x9d6422){return _0x2a73b2['define'](_0x222e('0x9'),attributes,{'tableName':_0x222e('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 9bbd16e..e3c2227 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 _0x16a8=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3b589,_0x28d2b3){var _0x5b0952=function(_0x2ed9f6){while(--_0x2ed9f6){_0x3b589['push'](_0x3b589['shift']());}};_0x5b0952(++_0x28d2b3);}(_0x16a8,0x93));var _0x816a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x16a8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x816a('0x0'));var util=require('util');var moment=require(_0x816a('0x1'));var BPromise=require(_0x816a('0x2'));var rs=require(_0x816a('0x3'));var fs=require('fs');var Redis=require(_0x816a('0x4'));var db=require(_0x816a('0x5'))['db'];var utils=require(_0x816a('0x6'));var logger=require(_0x816a('0x7'))(_0x816a('0x8'));var config=require(_0x816a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x816a('0xa')][_0x816a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dbb73,_0x203dac,_0x1f000c){return new BPromise(function(_0x21f59c,_0x352b69){return client[_0x816a('0xc')](_0x1dbb73,_0x1f000c)[_0x816a('0xd')](function(_0x236da6){logger[_0x816a('0xe')](_0x816a('0xf'),_0x203dac,_0x816a('0x10'));logger[_0x816a('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x203dac,'request\x20sent',JSON['stringify'](_0x236da6));if(_0x236da6[_0x816a('0x12')]){if(_0x236da6[_0x816a('0x12')]['code']===0x1f4){logger[_0x816a('0x12')](_0x816a('0xf'),_0x203dac,_0x236da6[_0x816a('0x12')]['message']);return _0x352b69(_0x236da6[_0x816a('0x12')][_0x816a('0x13')]);}logger[_0x816a('0x12')](_0x816a('0xf'),_0x203dac,_0x236da6['error']['message']);return _0x21f59c(_0x236da6['error'][_0x816a('0x13')]);}else{logger[_0x816a('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x203dac,_0x816a('0x10'));_0x21f59c(_0x236da6['result'][_0x816a('0x13')]);}})['catch'](function(_0x20eb39){logger['error'](_0x816a('0xf'),_0x203dac,_0x20eb39);_0x352b69(_0x20eb39);});});} \ No newline at end of file +var _0xe8a8=['client','request','then','info','request\x20sent','debug','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','jayson/promise'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xe8a8,0x14f));var _0x8e8a=function(_0x4fa2fb,_0x10c529){_0x4fa2fb=_0x4fa2fb-0x0;var _0x676c63=_0xe8a8[_0x4fa2fb];return _0x676c63;};'use strict';var _=require(_0x8e8a('0x0'));var util=require(_0x8e8a('0x1'));var moment=require(_0x8e8a('0x2'));var BPromise=require(_0x8e8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8e8a('0x4'));var client=jayson[_0x8e8a('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb078,_0x4627e2,_0x14ee72){return new BPromise(function(_0x3dfb93,_0x515401){return client[_0x8e8a('0x6')](_0x1bb078,_0x14ee72)[_0x8e8a('0x7')](function(_0x37258f){logger[_0x8e8a('0x8')]('UserChatQueue,\x20%s,\x20%s',_0x4627e2,_0x8e8a('0x9'));logger[_0x8e8a('0xa')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4627e2,_0x8e8a('0x9'),JSON[_0x8e8a('0xb')](_0x37258f));if(_0x37258f[_0x8e8a('0xc')]){if(_0x37258f[_0x8e8a('0xc')][_0x8e8a('0xd')]===0x1f4){logger[_0x8e8a('0xc')](_0x8e8a('0xe'),_0x4627e2,_0x37258f[_0x8e8a('0xc')][_0x8e8a('0xf')]);return _0x515401(_0x37258f[_0x8e8a('0xc')][_0x8e8a('0xf')]);}logger['error'](_0x8e8a('0xe'),_0x4627e2,_0x37258f[_0x8e8a('0xc')][_0x8e8a('0xf')]);return _0x3dfb93(_0x37258f['error'][_0x8e8a('0xf')]);}else{logger[_0x8e8a('0x8')](_0x8e8a('0xe'),_0x4627e2,_0x8e8a('0x9'));_0x3dfb93(_0x37258f['result'][_0x8e8a('0xf')]);}})[_0x8e8a('0x10')](function(_0x259f85){logger[_0x8e8a('0xc')](_0x8e8a('0xe'),_0x4627e2,_0x259f85);_0x515401(_0x259f85);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 12406a7..9076b55 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4685a6,_0xe3db7b){var _0x57b88b=function(_0x28fa4c){while(--_0x28fa4c){_0x4685a6['push'](_0x4685a6['shift']());}};_0x57b88b(++_0xe3db7b);}(_0xe706,0xa3));var _0x6e70=function(_0xd45112,_0x68c8b4){_0xd45112=_0xd45112-0x0;var _0x2cddb8=_0xe706[_0xd45112];return _0x2cddb8;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x442869,_0x3fcd60){var _0x4ffa2b=function(_0x429d6e){while(--_0x429d6e){_0x442869['push'](_0x442869['shift']());}};_0x4ffa2b(++_0x3fcd60);}(_0xe706,0xa3));var _0x6e70=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0xe706[_0x3fa4bd];return _0x358c95;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 11c1da0..41a4699 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 _0xf618=['INTEGER','STRING','sequelize','exports'];(function(_0x5a96c4,_0x282c99){var _0x32bc81=function(_0x175754){while(--_0x175754){_0x5a96c4['push'](_0x5a96c4['shift']());}};_0x32bc81(++_0x282c99);}(_0xf618,0x17e));var _0x8f61=function(_0x177435,_0x4c0b3d){_0x177435=_0x177435-0x0;var _0x381b98=_0xf618[_0x177435];return _0x381b98;};'use strict';var Sequelize=require(_0x8f61('0x0'));module[_0x8f61('0x1')]={'penalty':{'type':Sequelize[_0x8f61('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8f61('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8f61('0x3')]}}; \ No newline at end of file +var _0x0be1=['INTEGER','STRING','sequelize','exports'];(function(_0x50a329,_0x32611d){var _0x58b3a8=function(_0xe3cfa0){while(--_0xe3cfa0){_0x50a329['push'](_0x50a329['shift']());}};_0x58b3a8(++_0x32611d);}(_0x0be1,0x1e2));var _0x10be=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x0be1[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0x10be('0x0'));module[_0x10be('0x1')]={'penalty':{'type':Sequelize[_0x10be('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x10be('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 56819d4..fe0df2e 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 _0x58ca=['define','UserFaxQueue','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x2329d7,_0x7d5a9f){var _0x201f68=function(_0x54a95d){while(--_0x54a95d){_0x2329d7['push'](_0x2329d7['shift']());}};_0x201f68(++_0x7d5a9f);}(_0x58ca,0x16d));var _0xa58c=function(_0x46d842,_0x470d32){_0x46d842=_0x46d842-0x0;var _0x4fb5dc=_0x58ca[_0x46d842];return _0x4fb5dc;};'use strict';var _=require(_0xa58c('0x0'));var util=require('util');var logger=require(_0xa58c('0x1'))('api');var moment=require(_0xa58c('0x2'));var BPromise=require(_0xa58c('0x3'));var rp=require(_0xa58c('0x4'));var fs=require('fs');var path=require(_0xa58c('0x5'));var rimraf=require(_0xa58c('0x6'));var config=require(_0xa58c('0x7'));var attributes=require(_0xa58c('0x8'));module['exports']=function(_0x4431b3,_0x20b2f3){return _0x4431b3[_0xa58c('0x9')](_0xa58c('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6675=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x3b1666,_0xea4e07){var _0x4b6de4=function(_0x58da95){while(--_0x58da95){_0x3b1666['push'](_0x3b1666['shift']());}};_0x4b6de4(++_0xea4e07);}(_0x6675,0x194));var _0x5667=function(_0x366358,_0x1b1a41){_0x366358=_0x366358-0x0;var _0x4c6e99=_0x6675[_0x366358];return _0x4c6e99;};'use strict';var _=require(_0x5667('0x0'));var util=require(_0x5667('0x1'));var logger=require(_0x5667('0x2'))(_0x5667('0x3'));var moment=require(_0x5667('0x4'));var BPromise=require(_0x5667('0x5'));var rp=require(_0x5667('0x6'));var fs=require('fs');var path=require(_0x5667('0x7'));var rimraf=require(_0x5667('0x8'));var config=require('../../config/environment');var attributes=require(_0x5667('0x9'));module[_0x5667('0xa')]=function(_0x701819,_0x3a0564){return _0x701819[_0x5667('0xb')](_0x5667('0xc'),attributes,{'tableName':_0x5667('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index b3dde16..bdafdf8 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 _0x9516=['info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9516,0x15b));var _0x6951=function(_0x414cf2,_0x2136dd){_0x414cf2=_0x414cf2-0x0;var _0x27c0dc=_0x9516[_0x414cf2];return _0x27c0dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6951('0x0'));var rs=require(_0x6951('0x1'));var fs=require('fs');var Redis=require(_0x6951('0x2'));var db=require(_0x6951('0x3'))['db'];var utils=require(_0x6951('0x4'));var logger=require(_0x6951('0x5'))(_0x6951('0x6'));var config=require(_0x6951('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6951('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbbab0c,_0x40c1c0,_0x4bc492){return new BPromise(function(_0x5569a7,_0x28d1bb){return client['request'](_0xbbab0c,_0x4bc492)[_0x6951('0x9')](function(_0x3854a2){logger[_0x6951('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x40c1c0,_0x6951('0xb'));logger[_0x6951('0xc')](_0x6951('0xd'),_0x40c1c0,_0x6951('0xb'),JSON[_0x6951('0xe')](_0x3854a2));if(_0x3854a2[_0x6951('0xf')]){if(_0x3854a2['error'][_0x6951('0x10')]===0x1f4){logger[_0x6951('0xf')](_0x6951('0x11'),_0x40c1c0,_0x3854a2['error'][_0x6951('0x12')]);return _0x28d1bb(_0x3854a2[_0x6951('0xf')][_0x6951('0x12')]);}logger[_0x6951('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x40c1c0,_0x3854a2[_0x6951('0xf')]['message']);return _0x5569a7(_0x3854a2[_0x6951('0xf')][_0x6951('0x12')]);}else{logger[_0x6951('0xa')](_0x6951('0x11'),_0x40c1c0,'request\x20sent');_0x5569a7(_0x3854a2[_0x6951('0x13')][_0x6951('0x12')]);}})[_0x6951('0x14')](function(_0x21b121){logger[_0x6951('0xf')](_0x6951('0x11'),_0x40c1c0,_0x21b121);_0x28d1bb(_0x21b121);});});} \ No newline at end of file +var _0x5d4f=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xcbe533,_0x2bb831){var _0x5100fe=function(_0x80b474){while(--_0x80b474){_0xcbe533['push'](_0xcbe533['shift']());}};_0x5100fe(++_0x2bb831);}(_0x5d4f,0x1f1));var _0xf5d4=function(_0x56b7a5,_0x56e148){_0x56b7a5=_0x56b7a5-0x0;var _0x1bbce0=_0x5d4f[_0x56b7a5];return _0x1bbce0;};'use strict';var _=require(_0xf5d4('0x0'));var util=require(_0xf5d4('0x1'));var moment=require(_0xf5d4('0x2'));var BPromise=require(_0xf5d4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5d4('0x4'));var db=require(_0xf5d4('0x5'))['db'];var utils=require(_0xf5d4('0x6'));var logger=require(_0xf5d4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b0fa9,_0xd85f0e,_0x45a61f){return new BPromise(function(_0x2b166e,_0x34d7d2){return client['request'](_0x5b0fa9,_0x45a61f)[_0xf5d4('0x9')](function(_0x151b40){logger[_0xf5d4('0xa')](_0xf5d4('0xb'),_0xd85f0e,_0xf5d4('0xc'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xd85f0e,_0xf5d4('0xc'),JSON[_0xf5d4('0xd')](_0x151b40));if(_0x151b40[_0xf5d4('0xe')]){if(_0x151b40['error']['code']===0x1f4){logger[_0xf5d4('0xe')](_0xf5d4('0xb'),_0xd85f0e,_0x151b40[_0xf5d4('0xe')]['message']);return _0x34d7d2(_0x151b40[_0xf5d4('0xe')][_0xf5d4('0xf')]);}logger[_0xf5d4('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0xd85f0e,_0x151b40['error'][_0xf5d4('0xf')]);return _0x2b166e(_0x151b40[_0xf5d4('0xe')][_0xf5d4('0xf')]);}else{logger['info'](_0xf5d4('0xb'),_0xd85f0e,_0xf5d4('0xc'));_0x2b166e(_0x151b40['result'][_0xf5d4('0xf')]);}})[_0xf5d4('0x10')](function(_0x2ad3ac){logger[_0xf5d4('0xe')](_0xf5d4('0xb'),_0xd85f0e,_0x2ad3ac);_0x34d7d2(_0x2ad3ac);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2e97d3f..d43a1c1 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3da7a0,_0x56bd01){var _0x21dcc3=function(_0x34d304){while(--_0x34d304){_0x3da7a0['push'](_0x3da7a0['shift']());}};_0x21dcc3(++_0x56bd01);}(_0x70e0,0x17b));var _0x070e=function(_0x1de1cf,_0x2267a6){_0x1de1cf=_0x1de1cf-0x0;var _0x4beac9=_0x70e0[_0x1de1cf];return _0x4beac9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x219542,_0x58570c){var _0x1ab3bd=function(_0x16bf33){while(--_0x16bf33){_0x219542['push'](_0x219542['shift']());}};_0x1ab3bd(++_0x58570c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 0ba0b58..3231ea6 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 _0x73da=['INTEGER','sequelize','exports'];(function(_0x58fb16,_0x5aebc0){var _0x11b2c0=function(_0x211158){while(--_0x211158){_0x58fb16['push'](_0x58fb16['shift']());}};_0x11b2c0(++_0x5aebc0);}(_0x73da,0x136));var _0xa73d=function(_0x4d2aea,_0x4a8f11){_0x4d2aea=_0x4d2aea-0x0;var _0x1715b8=_0x73da[_0x4d2aea];return _0x1715b8;};'use strict';var Sequelize=require(_0xa73d('0x0'));module[_0xa73d('0x1')]={'penalty':{'type':Sequelize[_0xa73d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd4ec=['exports','INTEGER','sequelize'];(function(_0x3c10d8,_0x2cd66d){var _0x2bd126=function(_0x4bc1f4){while(--_0x4bc1f4){_0x3c10d8['push'](_0x3c10d8['shift']());}};_0x2bd126(++_0x2cd66d);}(_0xd4ec,0x1eb));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcd4e('0x0'));module[_0xcd4e('0x1')]={'penalty':{'type':Sequelize[_0xcd4e('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 1412b39..11293dd 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 _0xec79=['./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bea6a,_0x3d229c){var _0x17376a=function(_0x4fb88f){while(--_0x4fb88f){_0x3bea6a['push'](_0x3bea6a['shift']());}};_0x17376a(++_0x3d229c);}(_0xec79,0xfc));var _0x9ec7=function(_0x221d0f,_0x37c51d){_0x221d0f=_0x221d0f-0x0;var _0x178f23=_0xec79[_0x221d0f];return _0x178f23;};'use strict';var _=require(_0x9ec7('0x0'));var util=require(_0x9ec7('0x1'));var logger=require('../../config/logger')(_0x9ec7('0x2'));var moment=require('moment');var BPromise=require(_0x9ec7('0x3'));var rp=require(_0x9ec7('0x4'));var fs=require('fs');var path=require(_0x9ec7('0x5'));var rimraf=require(_0x9ec7('0x6'));var config=require(_0x9ec7('0x7'));var attributes=require(_0x9ec7('0x8'));module[_0x9ec7('0x9')]=function(_0x294dfc,_0x2e09a6){return _0x294dfc[_0x9ec7('0xa')](_0x9ec7('0xb'),attributes,{'tableName':_0x9ec7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x733d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x56c4f1,_0x50768e){var _0x3e2b0b=function(_0x28ee0d){while(--_0x28ee0d){_0x56c4f1['push'](_0x56c4f1['shift']());}};_0x3e2b0b(++_0x50768e);}(_0x733d,0xc2));var _0xd733=function(_0x29ce74,_0x4c6b8c){_0x29ce74=_0x29ce74-0x0;var _0x44bf9c=_0x733d[_0x29ce74];return _0x44bf9c;};'use strict';var _=require(_0xd733('0x0'));var util=require(_0xd733('0x1'));var logger=require(_0xd733('0x2'))(_0xd733('0x3'));var moment=require(_0xd733('0x4'));var BPromise=require(_0xd733('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd733('0x6'));var rimraf=require(_0xd733('0x7'));var config=require(_0xd733('0x8'));var attributes=require(_0xd733('0x9'));module[_0xd733('0xa')]=function(_0x339904,_0x4780fd){return _0x339904[_0xd733('0xb')](_0xd733('0xc'),attributes,{'tableName':_0xd733('0xd'),'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 461efbe..641f1e3 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5230f9,_0xe2f334){var _0x257707=function(_0x1047cc){while(--_0x1047cc){_0x5230f9['push'](_0x5230f9['shift']());}};_0x257707(++_0xe2f334);}(_0x8ef6,0xf2));var _0x68ef=function(_0x27befd,_0x3de31e){_0x27befd=_0x27befd-0x0;var _0x331192=_0x8ef6[_0x27befd];return _0x331192;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x4d10de,_0x3c2cd6){var _0x29afc2=function(_0x31688a){while(--_0x31688a){_0x4d10de['push'](_0x4d10de['shift']());}};_0x29afc2(++_0x3c2cd6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x4b84[_0x2c9b79];return _0x265032;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 2a59fbf..655d0e7 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 _0x6844=['post','isAuthenticated','sendUserNotification','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7cd0a9,_0x1de1b6){var _0x3f7df0=function(_0x77a77c){while(--_0x77a77c){_0x7cd0a9['push'](_0x7cd0a9['shift']());}};_0x3f7df0(++_0x1de1b6);}(_0x6844,0xdf));var _0x4684=function(_0x46405e,_0x31e92c){_0x46405e=_0x46405e-0x0;var _0x1116a9=_0x6844[_0x46405e];return _0x1116a9;};'use strict';var multer=require('multer');var util=require(_0x4684('0x0'));var path=require(_0x4684('0x1'));var timeout=require(_0x4684('0x2'));var express=require(_0x4684('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4684('0x4'));var interaction=require(_0x4684('0x5'));var config=require(_0x4684('0x6'));var controller=require('./userNotification.controller');router[_0x4684('0x7')]('/',auth[_0x4684('0x8')](),controller[_0x4684('0x9')]);module['exports']=router; \ No newline at end of file +var _0x83b9=['post','isAuthenticated','sendUserNotification','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller'];(function(_0x41fb98,_0x470189){var _0x4b0044=function(_0xf8b2ec){while(--_0xf8b2ec){_0x41fb98['push'](_0x41fb98['shift']());}};_0x4b0044(++_0x470189);}(_0x83b9,0x1c0));var _0x983b=function(_0xda21e8,_0x19d184){_0xda21e8=_0xda21e8-0x0;var _0x28904b=_0x83b9[_0xda21e8];return _0x28904b;};'use strict';var multer=require('multer');var util=require(_0x983b('0x0'));var path=require('path');var timeout=require(_0x983b('0x1'));var express=require(_0x983b('0x2'));var router=express[_0x983b('0x3')]();var fs_extra=require(_0x983b('0x4'));var auth=require(_0x983b('0x5'));var interaction=require(_0x983b('0x6'));var config=require('../../config/environment');var controller=require(_0x983b('0x7'));router[_0x983b('0x8')]('/',auth[_0x983b('0x9')](),controller[_0x983b('0xa')]);module[_0x983b('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 8cddef3..135e005 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 _0xf4c4=['TEXT','STRING'];(function(_0x56498e,_0x4dace1){var _0x3873bf=function(_0x454553){while(--_0x454553){_0x56498e['push'](_0x56498e['shift']());}};_0x3873bf(++_0x4dace1);}(_0xf4c4,0x185));var _0x4f4c=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xf4c4[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x4f4c('0x0')]},'recipientsId':{'type':Sequelize[_0x4f4c('0x1')]},'recipientsDescription':{'type':Sequelize[_0x4f4c('0x0')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xe944=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x3580d6,_0x144740){var _0x1f7503=function(_0x11688a){while(--_0x11688a){_0x3580d6['push'](_0x3580d6['shift']());}};_0x1f7503(++_0x144740);}(_0xe944,0x12a));var _0x4e94=function(_0x288947,_0x45bb93){_0x288947=_0x288947-0x0;var _0x34e00a=_0xe944[_0x288947];return _0x34e00a;};'use strict';var Sequelize=require(_0x4e94('0x0'));module[_0x4e94('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x4e94('0x2')]},'recipientsId':{'type':Sequelize[_0x4e94('0x3')]},'recipientsDescription':{'type':Sequelize[_0x4e94('0x2')]},'beep':{'type':Sequelize[_0x4e94('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6f8ccd6..6210cf4 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 _0x26b9=['some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','join','sequelize','transaction','create','recipient','emit','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','queue','Queue','forEach','push','flatten','findOne','getAgents','map','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','team','user'];(function(_0xe2b1f3,_0x453b5b){var _0x43733f=function(_0x2c6fcf){while(--_0x2c6fcf){_0xe2b1f3['push'](_0xe2b1f3['shift']());}};_0x43733f(++_0x453b5b);}(_0x26b9,0x150));var _0x926b=function(_0x117926,_0x268445){_0x117926=_0x117926-0x0;var _0xc34604=_0x26b9[_0x117926];return _0xc34604;};'use strict';var emlformat=require(_0x926b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x926b('0x1'));var jsonpatch=require(_0x926b('0x2'));var rp=require('request-promise');var moment=require(_0x926b('0x3'));var BPromise=require(_0x926b('0x4'));var Mustache=require(_0x926b('0x5'));var util=require(_0x926b('0x6'));var path=require(_0x926b('0x7'));var sox=require('sox');var csv=require(_0x926b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x926b('0x9'));var squel=require(_0x926b('0xa'));var crypto=require(_0x926b('0xb'));var jsforce=require(_0x926b('0xc'));var deskjs=require(_0x926b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x926b('0xe'));var Papa=require(_0x926b('0xf'));var Redis=require(_0x926b('0x10'));var authService=require(_0x926b('0x11'));var qs=require(_0x926b('0x12'));var as=require(_0x926b('0x13'));var hardwareService=require(_0x926b('0x14'));var logger=require(_0x926b('0x15'))(_0x926b('0x16'));var utils=require(_0x926b('0x17'));var config=require(_0x926b('0x18'));var licenseUtil=require(_0x926b('0x19'));var db=require('../../mysqldb')['db'];config[_0x926b('0x1a')]=_[_0x926b('0x1b')](config[_0x926b('0x1a')],{'host':_0x926b('0x1c'),'port':0x18eb});var socket=require(_0x926b('0x1d'))(new Redis(config[_0x926b('0x1a')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x28c455,_0x3d8c2a){_0x3d8c2a=_0x3d8c2a||0xcc;return function(_0x19767a){if(_0x19767a){return _0x28c455[_0x926b('0x1e')](_0x3d8c2a);}return _0x28c455['status'](_0x3d8c2a)[_0x926b('0x1f')]();};}function respondWithResult(_0x57ec45,_0x649bea){_0x649bea=_0x649bea||0xc8;return function(_0x383ea2){if(_0x383ea2){return _0x57ec45[_0x926b('0x20')](_0x649bea)[_0x926b('0x21')](_0x383ea2);}};}function respondWithFilteredResult(_0x1d5c4a,_0x551b9e){return function(_0x8ab350){if(_0x8ab350){var _0x26348e=typeof _0x551b9e[_0x926b('0x22')]===_0x926b('0x23')&&typeof _0x551b9e['limit']===_0x926b('0x23');var _0x563e5f=_0x8ab350[_0x926b('0x24')];var _0x206e68=_0x26348e?0x0:_0x551b9e[_0x926b('0x22')];var _0x295b2b=_0x26348e?_0x8ab350[_0x926b('0x24')]:_0x551b9e[_0x926b('0x22')]+_0x551b9e[_0x926b('0x25')];var _0x2e6298;if(_0x295b2b>=_0x563e5f){_0x295b2b=_0x563e5f;_0x2e6298=0xc8;}else{_0x2e6298=0xce;}_0x1d5c4a[_0x926b('0x20')](_0x2e6298);return _0x1d5c4a[_0x926b('0x26')](_0x926b('0x27'),_0x206e68+'-'+_0x295b2b+'/'+_0x563e5f)[_0x926b('0x21')](_0x8ab350);}return null;};}function patchUpdates(_0x26f217){return function(_0x3934c8){try{jsonpatch[_0x926b('0x28')](_0x3934c8,_0x26f217,!![]);}catch(_0x54a358){return BPromise[_0x926b('0x29')](_0x54a358);}return _0x3934c8[_0x926b('0x2a')]();};}function saveUpdates(_0x3d09d0,_0x1c92b7){return function(_0x55e20b){if(_0x55e20b){return _0x55e20b['update'](_0x3d09d0)[_0x926b('0x2b')](function(_0x2d131d){return _0x2d131d;});}return null;};}function removeEntity(_0x1895b2,_0x5ed46c){return function(_0x1bd891){if(_0x1bd891){return _0x1bd891[_0x926b('0x2c')]()[_0x926b('0x2b')](function(){_0x1895b2[_0x926b('0x20')](0xcc)[_0x926b('0x1f')]();});}};}function handleEntityNotFound(_0x266de0,_0x4f3629){return function(_0x5f2f93){if(!_0x5f2f93){_0x266de0[_0x926b('0x1e')](0x194);}return _0x5f2f93;};}function handleError(_0x48051a,_0x58121b){_0x58121b=_0x58121b||0x1f4;return function(_0x465fe4){logger['error'](_0x465fe4[_0x926b('0x2d')]);if(_0x465fe4[_0x926b('0x2e')]){delete _0x465fe4[_0x926b('0x2e')];}_0x48051a[_0x926b('0x20')](_0x58121b)[_0x926b('0x2f')](_0x465fe4);};}exports[_0x926b('0x30')]=function(_0xc3aee,_0x191b0f,_0x30e017){if(!_0xc3aee[_0x926b('0x31')][_0x926b('0x32')](_0x926b('0x33'))&&!_0xc3aee[_0x926b('0x31')][_0x926b('0x32')](_0x926b('0x34'))){throw new db['Sequelize'][(_0x926b('0x35'))](_0x926b('0x36'));}else{if(_0xc3aee[_0x926b('0x31')][_0x926b('0x32')]('TemplateId')&&!_0xc3aee[_0x926b('0x31')][_0x926b('0x32')](_0x926b('0x37'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0xc3aee['body'][_0x926b('0x32')]('recipients')){throw new db[(_0x926b('0x38'))]['ValidationError'](_0x926b('0x39'));}else{try{var _0x1533d7=JSON[_0x926b('0x3a')](_0xc3aee[_0x926b('0x31')][_0x926b('0x3b')]);}catch(_0x463bd3){logger[_0x926b('0x3c')](_0x463bd3);throw new db['Sequelize']['ValidationError'](_0x926b('0x3d'));}var _0x4d1b2d=[_0x926b('0x3e'),_0x926b('0x3f'),_0x926b('0x40'),_0x926b('0x41'),'smsqueue','voicequeue','whatsappqueue',_0x926b('0x42'),_0x926b('0x43')];if(_[_0x926b('0x44')](_0x1533d7,function(_0x4ae7ea){return!_[_0x926b('0x45')](_0x4d1b2d,_0x4ae7ea['model']['toLowerCase']());})){throw new db[(_0x926b('0x38'))][(_0x926b('0x35'))](_0x926b('0x46'));}}}var _0x2038bf={};_0x2038bf[_0x926b('0x47')]=_0xc3aee[_0x926b('0x31')][_0x926b('0x32')]('senderName')?_0xc3aee[_0x926b('0x31')][_0x926b('0x47')]:_0xc3aee['user'][_0x926b('0x48')];_0x2038bf[_0x926b('0x49')]=_['isEmpty'](_0xc3aee[_0x926b('0x31')][_0x926b('0x49')])?null:_0xc3aee[_0x926b('0x31')][_0x926b('0x49')];_0x2038bf[_0x926b('0x4a')]=_0xc3aee[_0x926b('0x31')][_0x926b('0x4a')]||![];_0x2038bf[_0x926b('0x4b')]=_0xc3aee[_0x926b('0x43')]['id'];return getContent(_0xc3aee[_0x926b('0x31')])[_0x926b('0x2b')](function(_0x4b8d60){_0x2038bf[_0x926b('0x31')]=_0x4b8d60;return getRecipients(_0x1533d7);})[_0x926b('0x2b')](function(_0x4b1431){_0x2038bf[_0x926b('0x4c')]=_['sortBy'](_0x4b1431)[_0x926b('0x4d')](',');return db[_0x926b('0x4e')][_0x926b('0x4f')](function(_0x53363d){return db['UserNotification'][_0x926b('0x50')](_0x2038bf,{'raw':!![],'transaction':_0x53363d})[_0x926b('0x2b')](function(_0x3f2edb){var _0x3a2452={'sender':_0x2038bf[_0x926b('0x47')],'description':_0x2038bf[_0x926b('0x49')],'content':_0x2038bf[_0x926b('0x31')],'beep':_0x2038bf[_0x926b('0x4a')]};_0x4b1431['forEach'](function(_0x1ba973){_0x3a2452[_0x926b('0x51')]=_0x1ba973;socket[_0x926b('0x52')]('userNotification:send',_0x3a2452);});return _0x3f2edb;});});})[_0x926b('0x2b')](respondWithResult(_0x191b0f,0xc9))[_0x926b('0x53')](handleError(_0x191b0f,null));};function getContent(_0x340602){return new BPromise(function(_0x301ca8,_0xdd55b){if(_0x340602[_0x926b('0x33')]){_0x301ca8(_0x340602[_0x926b('0x33')]);return;}return db[_0x926b('0x54')]['findOne']({'attributes':[_0x926b('0x55')],'where':{'id':_0x340602[_0x926b('0x34')]},'raw':!![]})[_0x926b('0x2b')](function(_0x243be4){if(!_0x243be4)throw new db[(_0x926b('0x38'))][(_0x926b('0x35'))](_0x926b('0x56'));var _0x262ca5=Mustache[_0x926b('0x57')](_0x243be4[_0x926b('0x55')],_0x340602['view']);_0x301ca8(_0x262ca5);})[_0x926b('0x53')](function(_0xae47d1){_0xdd55b(_0xae47d1);});});}function getRecipients(_0xb33b65){return new BPromise(function(_0x131208,_0x3a6a70){var _0x54f813=[];var _0x279664=[];_0xb33b65['forEach'](function(_0x10b312){var _0x286748=_[_0x926b('0x58')](_0x10b312[_0x926b('0x59')]['toLowerCase']());if(_0x286748===_0x926b('0x5a')){_0x54f813=_[_0x926b('0x5b')](_0x54f813,_0x10b312[_0x926b('0x5c')]);}else{if(_[_0x926b('0x45')](_0x286748,'queue'))_0x286748=_0x286748['replace'](_0x926b('0x5d'),_0x926b('0x5e'));_0x10b312['ids'][_0x926b('0x5f')](function(_0x31c504){_0x279664[_0x926b('0x60')](getAgents(_0x286748,_0x31c504));});}});return BPromise['all'](_0x279664)['then'](function(_0x330724){_0x54f813=_[_0x926b('0x5b')](_0x54f813,_[_0x926b('0x61')](_0x330724));_0x131208(_0x54f813);})['catch'](function(_0x4ff628){_0x3a6a70(_0x4ff628);});});}function getAgents(_0x2a5385,_0x15b8c9){return new BPromise(function(_0x203b31,_0x314aca){return db[_0x2a5385][_0x926b('0x62')]({'where':{'id':_0x15b8c9}})[_0x926b('0x2b')](function(_0x41411a){return _0x41411a[_0x926b('0x63')]({'attributes':['id'],'raw':!![]})[_0x926b('0x2b')](function(_0x18c9d2){var _0x2f6ca3=_[_0x926b('0x64')](_0x18c9d2,'id');_0x203b31(_0x2f6ca3);});})[_0x926b('0x53')](function(_0x577c40){_0x314aca(_0x577c40);});});} \ No newline at end of file +var _0x3690=['fullname','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','catch','User','union','queue','replace','ids','push','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','update','then','end','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','voicequeue','user','some','includes','toLowerCase','senderName'];(function(_0x43d2da,_0xa697db){var _0x35ed48=function(_0x5bb83a){while(--_0x5bb83a){_0x43d2da['push'](_0x43d2da['shift']());}};_0x35ed48(++_0xa697db);}(_0x3690,0xd3));var _0x0369=function(_0x17a95a,_0x4c5d16){_0x17a95a=_0x17a95a-0x0;var _0x186974=_0x3690[_0x17a95a];return _0x186974;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0369('0x0'));var zipdir=require(_0x0369('0x1'));var jsonpatch=require(_0x0369('0x2'));var rp=require(_0x0369('0x3'));var moment=require(_0x0369('0x4'));var BPromise=require(_0x0369('0x5'));var Mustache=require(_0x0369('0x6'));var util=require('util');var path=require(_0x0369('0x7'));var sox=require(_0x0369('0x8'));var csv=require('to-csv');var ejs=require(_0x0369('0x9'));var fs=require('fs');var fs_extra=require(_0x0369('0xa'));var _=require(_0x0369('0xb'));var squel=require(_0x0369('0xc'));var crypto=require(_0x0369('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0369('0xe'));var toCsv=require(_0x0369('0xf'));var querystring=require(_0x0369('0x10'));var Papa=require(_0x0369('0x11'));var Redis=require(_0x0369('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0369('0x13'));var as=require(_0x0369('0x14'));var hardwareService=require(_0x0369('0x15'));var logger=require(_0x0369('0x16'))('api');var utils=require(_0x0369('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0369('0x18'))['db'];config[_0x0369('0x19')]=_[_0x0369('0x1a')](config[_0x0369('0x19')],{'host':_0x0369('0x1b'),'port':0x18eb});var socket=require(_0x0369('0x1c'))(new Redis(config[_0x0369('0x19')]));require('./userNotification.socket')[_0x0369('0x1d')](socket);function respondWithStatusCode(_0x97399c,_0x323510){_0x323510=_0x323510||0xcc;return function(_0x4d7fcc){if(_0x4d7fcc){return _0x97399c[_0x0369('0x1e')](_0x323510);}return _0x97399c[_0x0369('0x1f')](_0x323510)['end']();};}function respondWithResult(_0x51c8fe,_0x4f43f9){_0x4f43f9=_0x4f43f9||0xc8;return function(_0x28810f){if(_0x28810f){return _0x51c8fe['status'](_0x4f43f9)[_0x0369('0x20')](_0x28810f);}};}function respondWithFilteredResult(_0x569903,_0x59cd55){return function(_0x38c0a0){if(_0x38c0a0){var _0x575700=typeof _0x59cd55[_0x0369('0x21')]==='undefined'&&typeof _0x59cd55[_0x0369('0x22')]===_0x0369('0x23');var _0x354332=_0x38c0a0['count'];var _0x2a67f1=_0x575700?0x0:_0x59cd55[_0x0369('0x21')];var _0x105897=_0x575700?_0x38c0a0['count']:_0x59cd55[_0x0369('0x21')]+_0x59cd55['limit'];var _0x620382;if(_0x105897>=_0x354332){_0x105897=_0x354332;_0x620382=0xc8;}else{_0x620382=0xce;}_0x569903[_0x0369('0x1f')](_0x620382);return _0x569903[_0x0369('0x24')](_0x0369('0x25'),_0x2a67f1+'-'+_0x105897+'/'+_0x354332)[_0x0369('0x20')](_0x38c0a0);}return null;};}function patchUpdates(_0x3b1471){return function(_0x1f546b){try{jsonpatch[_0x0369('0x26')](_0x1f546b,_0x3b1471,!![]);}catch(_0x382720){return BPromise['reject'](_0x382720);}return _0x1f546b['save']();};}function saveUpdates(_0x56095f,_0x13f204){return function(_0x314aba){if(_0x314aba){return _0x314aba[_0x0369('0x27')](_0x56095f)[_0x0369('0x28')](function(_0x4e562b){return _0x4e562b;});}return null;};}function removeEntity(_0x242fe8,_0x344c09){return function(_0x3e35a0){if(_0x3e35a0){return _0x3e35a0['destroy']()['then'](function(){_0x242fe8[_0x0369('0x1f')](0xcc)[_0x0369('0x29')]();});}};}function handleEntityNotFound(_0x156fc1,_0x4a7160){return function(_0x33f7a3){if(!_0x33f7a3){_0x156fc1[_0x0369('0x1e')](0x194);}return _0x33f7a3;};}function handleError(_0x4299be,_0x3752a9){_0x3752a9=_0x3752a9||0x1f4;return function(_0x488344){logger[_0x0369('0x2a')](_0x488344['stack']);if(_0x488344[_0x0369('0x2b')]){delete _0x488344[_0x0369('0x2b')];}_0x4299be[_0x0369('0x1f')](_0x3752a9)[_0x0369('0x2c')](_0x488344);};}exports[_0x0369('0x2d')]=function(_0x2e23b4,_0x56109a,_0x5f11d9){if(!_0x2e23b4[_0x0369('0x2e')][_0x0369('0x2f')](_0x0369('0x30'))&&!_0x2e23b4['body']['hasOwnProperty'](_0x0369('0x31'))){throw new db['Sequelize'][(_0x0369('0x32'))](_0x0369('0x33'));}else{if(_0x2e23b4[_0x0369('0x2e')][_0x0369('0x2f')](_0x0369('0x31'))&&!_0x2e23b4[_0x0369('0x2e')][_0x0369('0x2f')]('view')){throw new db[(_0x0369('0x34'))][(_0x0369('0x32'))](_0x0369('0x35'));}if(!_0x2e23b4['body'][_0x0369('0x2f')](_0x0369('0x36'))){throw new db[(_0x0369('0x34'))][(_0x0369('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4e50c2=JSON[_0x0369('0x37')](_0x2e23b4[_0x0369('0x2e')][_0x0369('0x36')]);}catch(_0x479df9){logger[_0x0369('0x2a')](_0x479df9);throw new db[(_0x0369('0x34'))]['ValidationError'](_0x0369('0x38'));}var _0x1907f2=[_0x0369('0x39'),_0x0369('0x3a'),'mailqueue','openchannelqueue','smsqueue',_0x0369('0x3b'),'whatsappqueue','team',_0x0369('0x3c')];if(_[_0x0369('0x3d')](_0x4e50c2,function(_0x413dbb){return!_[_0x0369('0x3e')](_0x1907f2,_0x413dbb['model'][_0x0369('0x3f')]());})){throw new db[(_0x0369('0x34'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0xd2bee={};_0xd2bee[_0x0369('0x40')]=_0x2e23b4[_0x0369('0x2e')][_0x0369('0x2f')](_0x0369('0x40'))?_0x2e23b4[_0x0369('0x2e')][_0x0369('0x40')]:_0x2e23b4['user'][_0x0369('0x41')];_0xd2bee[_0x0369('0x42')]=_['isEmpty'](_0x2e23b4[_0x0369('0x2e')][_0x0369('0x42')])?null:_0x2e23b4[_0x0369('0x2e')][_0x0369('0x42')];_0xd2bee[_0x0369('0x43')]=_0x2e23b4['body']['beep']||![];_0xd2bee['SenderId']=_0x2e23b4[_0x0369('0x3c')]['id'];return getContent(_0x2e23b4[_0x0369('0x2e')])['then'](function(_0x486334){_0xd2bee[_0x0369('0x2e')]=_0x486334;return getRecipients(_0x4e50c2);})[_0x0369('0x28')](function(_0x46eb26){_0xd2bee[_0x0369('0x44')]=_[_0x0369('0x45')](_0x46eb26)[_0x0369('0x46')](',');return db[_0x0369('0x47')][_0x0369('0x48')](function(_0x449144){return db[_0x0369('0x49')]['create'](_0xd2bee,{'raw':!![],'transaction':_0x449144})[_0x0369('0x28')](function(_0x3cc4a4){var _0x12ff4c={'sender':_0xd2bee[_0x0369('0x40')],'description':_0xd2bee[_0x0369('0x42')],'content':_0xd2bee[_0x0369('0x2e')],'beep':_0xd2bee[_0x0369('0x43')]};_0x46eb26[_0x0369('0x4a')](function(_0x42a235){_0x12ff4c[_0x0369('0x4b')]=_0x42a235;socket[_0x0369('0x4c')](_0x0369('0x4d'),_0x12ff4c);});return _0x3cc4a4;});});})['then'](respondWithResult(_0x56109a,0xc9))['catch'](handleError(_0x56109a,null));};function getContent(_0x1823b2){return new BPromise(function(_0x5a76d2,_0x1a4941){if(_0x1823b2[_0x0369('0x30')]){_0x5a76d2(_0x1823b2[_0x0369('0x30')]);return;}return db[_0x0369('0x4e')][_0x0369('0x4f')]({'attributes':[_0x0369('0x50')],'where':{'id':_0x1823b2['TemplateId']},'raw':!![]})['then'](function(_0x5a07ff){if(!_0x5a07ff)throw new db[(_0x0369('0x34'))][(_0x0369('0x32'))](_0x0369('0x51'));var _0x30e692=Mustache['render'](_0x5a07ff[_0x0369('0x50')],_0x1823b2[_0x0369('0x52')]);_0x5a76d2(_0x30e692);})[_0x0369('0x53')](function(_0x232bd5){_0x1a4941(_0x232bd5);});});}function getRecipients(_0x9f72b3){return new BPromise(function(_0x13945a,_0x2a24a9){var _0x562ba6=[];var _0x5770ca=[];_0x9f72b3[_0x0369('0x4a')](function(_0x36de95){var _0x18d2aa=_['startCase'](_0x36de95['model'][_0x0369('0x3f')]());if(_0x18d2aa===_0x0369('0x54')){_0x562ba6=_[_0x0369('0x55')](_0x562ba6,_0x36de95['ids']);}else{if(_[_0x0369('0x3e')](_0x18d2aa,_0x0369('0x56')))_0x18d2aa=_0x18d2aa[_0x0369('0x57')](_0x0369('0x56'),'Queue');_0x36de95[_0x0369('0x58')][_0x0369('0x4a')](function(_0x520a2c){_0x5770ca[_0x0369('0x59')](getAgents(_0x18d2aa,_0x520a2c));});}});return BPromise['all'](_0x5770ca)[_0x0369('0x28')](function(_0x256227){_0x562ba6=_[_0x0369('0x55')](_0x562ba6,_['flatten'](_0x256227));_0x13945a(_0x562ba6);})[_0x0369('0x53')](function(_0x2a4155){_0x2a24a9(_0x2a4155);});});}function getAgents(_0x961cff,_0x29ef25){return new BPromise(function(_0xe92ea6,_0x242ca8){return db[_0x961cff][_0x0369('0x4f')]({'where':{'id':_0x29ef25}})[_0x0369('0x28')](function(_0x455569){return _0x455569[_0x0369('0x5a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x55898f){var _0x428358=_[_0x0369('0x5b')](_0x55898f,'id');_0xe92ea6(_0x428358);});})[_0x0369('0x53')](function(_0x4e819c){_0x242ca8(_0x4e819c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 67fa5d7..21e09ae 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 _0xa53d=['save','update','remove','emit','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x13e9d3,_0x8e54bd){var _0x5f88e5=function(_0x5b5f34){while(--_0x5b5f34){_0x13e9d3['push'](_0x13e9d3['shift']());}};_0x5f88e5(++_0x8e54bd);}(_0xa53d,0x145));var _0xda53=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0xa53d[_0x21d0c3];return _0x4df18e;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xda53('0x0'))['db'][_0xda53('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xda53('0x2')](0x0);var events={'afterCreate':_0xda53('0x3'),'afterUpdate':_0xda53('0x4'),'afterDestroy':_0xda53('0x5')};function emitEvent(_0x24d995){return function(_0xb8f5,_0x17c155,_0x3e739e){UserNotificationEvents[_0xda53('0x6')](_0x24d995+':'+_0xb8f5['id'],_0xb8f5);UserNotificationEvents[_0xda53('0x6')](_0x24d995,_0xb8f5);_0x3e739e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xda53('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xa969=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x185708,_0x64bda0){var _0x5d7048=function(_0x439557){while(--_0x439557){_0x185708['push'](_0x185708['shift']());}};_0x5d7048(++_0x64bda0);}(_0xa969,0xd7));var _0x9a96=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa969[_0x298ed3];return _0x5aad28;};'use strict';var EventEmitter=require(_0x9a96('0x0'));var UserNotification=require(_0x9a96('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9a96('0x2')](0x0);var events={'afterCreate':_0x9a96('0x3'),'afterUpdate':_0x9a96('0x4'),'afterDestroy':_0x9a96('0x5')};function emitEvent(_0x4559d4){return function(_0x15aa43,_0x2b3589,_0x1862fc){UserNotificationEvents['emit'](_0x4559d4+':'+_0x15aa43['id'],_0x15aa43);UserNotificationEvents[_0x9a96('0x6')](_0x4559d4,_0x15aa43);_0x1862fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9a96('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 91e1ef0..874a1c4 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 _0xd147=['UserNotification','utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0xd147,0xf2));var _0x7d14=function(_0x599c27,_0x49465d){_0x599c27=_0x599c27-0x0;var _0x71dfa7=_0xd147[_0x599c27];return _0x71dfa7;};'use strict';var _=require('lodash');var util=require(_0x7d14('0x0'));var logger=require(_0x7d14('0x1'))(_0x7d14('0x2'));var moment=require(_0x7d14('0x3'));var BPromise=require(_0x7d14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d14('0x5'));var rimraf=require(_0x7d14('0x6'));var config=require(_0x7d14('0x7'));var attributes=require('./userNotification.attributes');module['exports']=function(_0xdda86d,_0x42a1ed){return _0xdda86d['define'](_0x7d14('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d14('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf2fe=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x25a1fd,_0x3a6dc6){var _0x2e88c2=function(_0x171bdb){while(--_0x171bdb){_0x25a1fd['push'](_0x25a1fd['shift']());}};_0x2e88c2(++_0x3a6dc6);}(_0xf2fe,0x78));var _0xef2f=function(_0x5cf938,_0x3f5144){_0x5cf938=_0x5cf938-0x0;var _0x12078a=_0xf2fe[_0x5cf938];return _0x12078a;};'use strict';var _=require(_0xef2f('0x0'));var util=require(_0xef2f('0x1'));var logger=require('../../config/logger')(_0xef2f('0x2'));var moment=require(_0xef2f('0x3'));var BPromise=require(_0xef2f('0x4'));var rp=require(_0xef2f('0x5'));var fs=require('fs');var path=require(_0xef2f('0x6'));var rimraf=require(_0xef2f('0x7'));var config=require(_0xef2f('0x8'));var attributes=require(_0xef2f('0x9'));module[_0xef2f('0xa')]=function(_0x50849e,_0x1e4742){return _0x50849e['define'](_0xef2f('0xb'),attributes,{'tableName':_0xef2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef2f('0xd'),'collate':_0xef2f('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 18aa985..d2df58b 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 _0x38b2=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0xec8735,_0x31fbd9){var _0x4fb776=function(_0x47a02d){while(--_0x47a02d){_0xec8735['push'](_0xec8735['shift']());}};_0x4fb776(++_0x31fbd9);}(_0x38b2,0x18f));var _0x238b=function(_0x42bb65,_0x2a7f13){_0x42bb65=_0x42bb65-0x0;var _0x16c0a7=_0x38b2[_0x42bb65];return _0x16c0a7;};'use strict';var _=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var moment=require(_0x238b('0x2'));var BPromise=require(_0x238b('0x3'));var rs=require(_0x238b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x238b('0x5'))['db'];var utils=require(_0x238b('0x6'));var logger=require(_0x238b('0x7'))('rpc');var config=require(_0x238b('0x8'));var jayson=require(_0x238b('0x9'));var client=jayson[_0x238b('0xa')][_0x238b('0xb')]({'port':0x232a});config[_0x238b('0xc')]=_[_0x238b('0xd')](config[_0x238b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x238b('0xe'))(new Redis(config['redis']));require(_0x238b('0xf'))[_0x238b('0x10')](socket);function respondWithRpcPromise(_0x3ae480,_0x5b7adb,_0x539ac6){return new BPromise(function(_0x4f9b97,_0x1a069d){return client['request'](_0x3ae480,_0x539ac6)[_0x238b('0x11')](function(_0x338e47){logger[_0x238b('0x12')](_0x238b('0x13'),_0x5b7adb,_0x238b('0x14'));logger['debug'](_0x238b('0x15'),_0x5b7adb,_0x238b('0x14'),JSON[_0x238b('0x16')](_0x338e47));if(_0x338e47[_0x238b('0x17')]){if(_0x338e47[_0x238b('0x17')][_0x238b('0x18')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x5b7adb,_0x338e47['error'][_0x238b('0x19')]);return _0x1a069d(_0x338e47[_0x238b('0x17')][_0x238b('0x19')]);}logger[_0x238b('0x17')](_0x238b('0x13'),_0x5b7adb,_0x338e47[_0x238b('0x17')]['message']);return _0x4f9b97(_0x338e47['error'][_0x238b('0x19')]);}else{logger[_0x238b('0x12')]('UserNotification,\x20%s,\x20%s',_0x5b7adb,'request\x20sent');_0x4f9b97(_0x338e47[_0x238b('0x1a')][_0x238b('0x19')]);}})[_0x238b('0x1b')](function(_0x5c0fac){logger['error'](_0x238b('0x13'),_0x5b7adb,_0x5c0fac);_0x1a069d(_0x5c0fac);});});} \ No newline at end of file +var _0xf367=['../../config/environment','jayson/promise','localhost','socket.io-emitter','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf367,0x1a0));var _0x7f36=function(_0x44225c,_0x66589d){_0x44225c=_0x44225c-0x0;var _0x25010d=_0xf367[_0x44225c];return _0x25010d;};'use strict';var _=require(_0x7f36('0x0'));var util=require(_0x7f36('0x1'));var moment=require(_0x7f36('0x2'));var BPromise=require(_0x7f36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f36('0x4'));var db=require(_0x7f36('0x5'))['db'];var utils=require(_0x7f36('0x6'));var logger=require(_0x7f36('0x7'))(_0x7f36('0x8'));var config=require(_0x7f36('0x9'));var jayson=require(_0x7f36('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x7f36('0xb'),'port':0x18eb});var socket=require(_0x7f36('0xc'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x183e5d,_0x1f555a,_0x13146c){return new BPromise(function(_0x397226,_0x4fddc8){return client[_0x7f36('0xd')](_0x183e5d,_0x13146c)[_0x7f36('0xe')](function(_0xe16c5){logger[_0x7f36('0xf')](_0x7f36('0x10'),_0x1f555a,_0x7f36('0x11'));logger[_0x7f36('0x12')](_0x7f36('0x13'),_0x1f555a,_0x7f36('0x11'),JSON[_0x7f36('0x14')](_0xe16c5));if(_0xe16c5[_0x7f36('0x15')]){if(_0xe16c5['error']['code']===0x1f4){logger[_0x7f36('0x15')](_0x7f36('0x10'),_0x1f555a,_0xe16c5['error']['message']);return _0x4fddc8(_0xe16c5['error']['message']);}logger[_0x7f36('0x15')](_0x7f36('0x10'),_0x1f555a,_0xe16c5['error']['message']);return _0x397226(_0xe16c5[_0x7f36('0x15')][_0x7f36('0x16')]);}else{logger['info'](_0x7f36('0x10'),_0x1f555a,'request\x20sent');_0x397226(_0xe16c5[_0x7f36('0x17')]['message']);}})[_0x7f36('0x18')](function(_0x188b79){logger[_0x7f36('0x15')]('UserNotification,\x20%s,\x20%s',_0x1f555a,_0x188b79);_0x4fddc8(_0x188b79);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4fc12ad..122edc3 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 _0xa06f=['save','emit','removeListener','length','userNotification:'];(function(_0x3a5cbc,_0x55b20c){var _0x106336=function(_0x4fca7c){while(--_0x4fca7c){_0x3a5cbc['push'](_0x3a5cbc['shift']());}};_0x106336(++_0x55b20c);}(_0xa06f,0x91));var _0xfa06=function(_0x49fceb,_0x596073){_0x49fceb=_0x49fceb-0x0;var _0x5d9321=_0xa06f[_0x49fceb];return _0x5d9321;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xfa06('0x0'),'remove','update'];function createListener(_0x197160,_0x52d8aa){return function(_0x6910e7){_0x52d8aa[_0xfa06('0x1')](_0x197160,_0x6910e7);};}function removeListener(_0x4ecb6a,_0x1c3ad5){return function(){UserNotificationEvents[_0xfa06('0x2')](_0x4ecb6a,_0x1c3ad5);};}exports['register']=function(_0x23be80){for(var _0x5f11f6=0x0,_0x4773d0=events[_0xfa06('0x3')];_0x5f11f6<_0x4773d0;_0x5f11f6++){var _0x325cf4=events[_0x5f11f6];var _0x4b3c87=createListener(_0xfa06('0x4')+_0x325cf4,_0x23be80);UserNotificationEvents['on'](_0x325cf4,_0x4b3c87);}}; \ No newline at end of file +var _0x0c74=['save','update','emit','register','length','userNotification:','./userNotification.events'];(function(_0x40c7f7,_0x42bc78){var _0x479755=function(_0x502b1e){while(--_0x502b1e){_0x40c7f7['push'](_0x40c7f7['shift']());}};_0x479755(++_0x42bc78);}(_0x0c74,0x1db));var _0x40c7=function(_0x4781b1,_0x109c44){_0x4781b1=_0x4781b1-0x0;var _0x13ecb1=_0x0c74[_0x4781b1];return _0x13ecb1;};'use strict';var UserNotificationEvents=require(_0x40c7('0x0'));var events=[_0x40c7('0x1'),'remove',_0x40c7('0x2')];function createListener(_0x19bad3,_0x42db46){return function(_0xba390a){_0x42db46[_0x40c7('0x3')](_0x19bad3,_0xba390a);};}function removeListener(_0x5f5d38,_0x359f0b){return function(){UserNotificationEvents['removeListener'](_0x5f5d38,_0x359f0b);};}exports[_0x40c7('0x4')]=function(_0x2bdd9d){for(var _0x1a1e62=0x0,_0x2c5172=events[_0x40c7('0x5')];_0x1a1e62<_0x2c5172;_0x1a1e62++){var _0x304bc9=events[_0x1a1e62];var _0x11349f=createListener(_0x40c7('0x6')+_0x304bc9,_0x2bdd9d);UserNotificationEvents['on'](_0x304bc9,_0x11349f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8e094a5..9c0771f 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x13f808,_0x563547){var _0xdb1375=function(_0x323412){while(--_0x323412){_0x13f808['push'](_0x13f808['shift']());}};_0xdb1375(++_0x563547);}(_0xedd9,0xfc));var _0x9edd=function(_0x35128d,_0x1e013c){_0x35128d=_0x35128d-0x0;var _0x4dcb37=_0xedd9[_0x35128d];return _0x4dcb37;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x36dd4f,_0x137131){var _0x786bfb=function(_0x323542){while(--_0x323542){_0x36dd4f['push'](_0x36dd4f['shift']());}};_0x786bfb(++_0x137131);}(_0x70e0,0x17b));var _0x070e=function(_0x4ad43a,_0x22ffdf){_0x4ad43a=_0x4ad43a-0x0;var _0x3c46b1=_0x70e0[_0x4ad43a];return _0x3c46b1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 447adb7..279860b 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 _0xda4a=['sequelize','INTEGER'];(function(_0x2f9aee,_0x29b9d4){var _0x39581e=function(_0x534fa6){while(--_0x534fa6){_0x2f9aee['push'](_0x2f9aee['shift']());}};_0x39581e(++_0x29b9d4);}(_0xda4a,0xa4));var _0xada4=function(_0x51fd6b,_0x4777f3){_0x51fd6b=_0x51fd6b-0x0;var _0x15e754=_0xda4a[_0x51fd6b];return _0x15e754;};'use strict';var Sequelize=require(_0xada4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xada4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa681=['sequelize','INTEGER'];(function(_0xbe253c,_0xc05172){var _0x77b20e=function(_0x37138a){while(--_0x37138a){_0xbe253c['push'](_0xbe253c['shift']());}};_0x77b20e(++_0xc05172);}(_0xa681,0x6a));var _0x1a68=function(_0x4ef2f9,_0x32a5dd){_0x4ef2f9=_0x4ef2f9-0x0;var _0x4e1b46=_0xa681[_0x4ef2f9];return _0x4e1b46;};'use strict';var Sequelize=require(_0x1a68('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1a68('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 2aeccd4..55665b1 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 _0x5c7a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x5c7a,0x1b8));var _0xa5c7=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x5c7a[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xa5c7('0x0'));var util=require(_0xa5c7('0x1'));var logger=require(_0xa5c7('0x2'))(_0xa5c7('0x3'));var moment=require(_0xa5c7('0x4'));var BPromise=require(_0xa5c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5c7('0x6'));var rimraf=require(_0xa5c7('0x7'));var config=require(_0xa5c7('0x8'));var attributes=require(_0xa5c7('0x9'));module[_0xa5c7('0xa')]=function(_0x2b62e1,_0x57ab6b){return _0x2b62e1['define'](_0xa5c7('0xb'),attributes,{'tableName':_0xa5c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59dd=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues'];(function(_0x704be3,_0x229070){var _0x24940b=function(_0x1aab0c){while(--_0x1aab0c){_0x704be3['push'](_0x704be3['shift']());}};_0x24940b(++_0x229070);}(_0x59dd,0x6c));var _0xd59d=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x59dd[_0x35da42];return _0x370035;};'use strict';var _=require(_0xd59d('0x0'));var util=require('util');var logger=require(_0xd59d('0x1'))(_0xd59d('0x2'));var moment=require('moment');var BPromise=require(_0xd59d('0x3'));var rp=require(_0xd59d('0x4'));var fs=require('fs');var path=require(_0xd59d('0x5'));var rimraf=require(_0xd59d('0x6'));var config=require(_0xd59d('0x7'));var attributes=require(_0xd59d('0x8'));module[_0xd59d('0x9')]=function(_0x1692ca,_0x5011c0){return _0x1692ca[_0xd59d('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xd59d('0xb'),'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 a7fbb59..cd609fb 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 _0x4f48=['../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4f48,0x185));var _0x84f4=function(_0x352dec,_0x3aca02){_0x352dec=_0x352dec-0x0;var _0x4776d3=_0x4f48[_0x352dec];return _0x4776d3;};'use strict';var _=require(_0x84f4('0x0'));var util=require(_0x84f4('0x1'));var moment=require('moment');var BPromise=require(_0x84f4('0x2'));var rs=require(_0x84f4('0x3'));var fs=require('fs');var Redis=require(_0x84f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x84f4('0x5'));var logger=require(_0x84f4('0x6'))('rpc');var config=require(_0x84f4('0x7'));var jayson=require(_0x84f4('0x8'));var client=jayson[_0x84f4('0x9')][_0x84f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc59fb4,_0x1e8589,_0x3b590c){return new BPromise(function(_0x19271a,_0x5e4146){return client[_0x84f4('0xb')](_0xc59fb4,_0x3b590c)['then'](function(_0x1df26a){logger[_0x84f4('0xc')](_0x84f4('0xd'),_0x1e8589,_0x84f4('0xe'));logger[_0x84f4('0xf')](_0x84f4('0x10'),_0x1e8589,_0x84f4('0xe'),JSON[_0x84f4('0x11')](_0x1df26a));if(_0x1df26a[_0x84f4('0x12')]){if(_0x1df26a[_0x84f4('0x12')]['code']===0x1f4){logger[_0x84f4('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1e8589,_0x1df26a[_0x84f4('0x12')][_0x84f4('0x13')]);return _0x5e4146(_0x1df26a['error'][_0x84f4('0x13')]);}logger[_0x84f4('0x12')](_0x84f4('0xd'),_0x1e8589,_0x1df26a['error']['message']);return _0x19271a(_0x1df26a[_0x84f4('0x12')][_0x84f4('0x13')]);}else{logger[_0x84f4('0xc')](_0x84f4('0xd'),_0x1e8589,'request\x20sent');_0x19271a(_0x1df26a[_0x84f4('0x14')][_0x84f4('0x13')]);}})[_0x84f4('0x15')](function(_0x25a4cb){logger[_0x84f4('0x12')](_0x84f4('0xd'),_0x1e8589,_0x25a4cb);_0x5e4146(_0x25a4cb);});});} \ No newline at end of file +var _0xd369=['message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x140daf,_0x1039e5){var _0x48e309=function(_0x5b450f){while(--_0x5b450f){_0x140daf['push'](_0x140daf['shift']());}};_0x48e309(++_0x1039e5);}(_0xd369,0x6a));var _0x9d36=function(_0x18ce9d,_0x1801c6){_0x18ce9d=_0x18ce9d-0x0;var _0xc3af89=_0xd369[_0x18ce9d];return _0xc3af89;};'use strict';var _=require(_0x9d36('0x0'));var util=require(_0x9d36('0x1'));var moment=require('moment');var BPromise=require(_0x9d36('0x2'));var rs=require(_0x9d36('0x3'));var fs=require('fs');var Redis=require(_0x9d36('0x4'));var db=require(_0x9d36('0x5'))['db'];var utils=require(_0x9d36('0x6'));var logger=require(_0x9d36('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9d36('0x8'));var client=jayson[_0x9d36('0x9')][_0x9d36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6e4e,_0xac684b,_0xa8f267){return new BPromise(function(_0x1c2caa,_0x3a3898){return client['request'](_0x4b6e4e,_0xa8f267)[_0x9d36('0xb')](function(_0x3fc4fe){logger[_0x9d36('0xc')](_0x9d36('0xd'),_0xac684b,'request\x20sent');logger[_0x9d36('0xe')](_0x9d36('0xf'),_0xac684b,_0x9d36('0x10'),JSON[_0x9d36('0x11')](_0x3fc4fe));if(_0x3fc4fe[_0x9d36('0x12')]){if(_0x3fc4fe[_0x9d36('0x12')][_0x9d36('0x13')]===0x1f4){logger['error'](_0x9d36('0xd'),_0xac684b,_0x3fc4fe[_0x9d36('0x12')][_0x9d36('0x14')]);return _0x3a3898(_0x3fc4fe[_0x9d36('0x12')][_0x9d36('0x14')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xac684b,_0x3fc4fe['error']['message']);return _0x1c2caa(_0x3fc4fe['error'][_0x9d36('0x14')]);}else{logger[_0x9d36('0xc')](_0x9d36('0xd'),_0xac684b,_0x9d36('0x10'));_0x1c2caa(_0x3fc4fe['result']['message']);}})['catch'](function(_0x3dfc06){logger[_0x9d36('0x12')](_0x9d36('0xd'),_0xac684b,_0x3dfc06);_0x3a3898(_0x3dfc06);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7b97474..bfac1fc 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 _0x024f=['exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','update','delete','/:id','destroy','removeSections'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x024f,0xf4));var _0xf024=function(_0x53d6a4,_0x5e6e3b){_0x53d6a4=_0x53d6a4-0x0;var _0x363d5e=_0x024f[_0x53d6a4];return _0x363d5e;};'use strict';var multer=require(_0xf024('0x0'));var util=require('util');var path=require(_0xf024('0x1'));var timeout=require(_0xf024('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf024('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf024('0x4'));var config=require(_0xf024('0x5'));var controller=require(_0xf024('0x6'));router[_0xf024('0x7')]('/',auth[_0xf024('0x8')](),controller['index']);router['get'](_0xf024('0x9'),auth[_0xf024('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf024('0xa')]);router[_0xf024('0x7')](_0xf024('0xb'),auth[_0xf024('0x8')](),controller[_0xf024('0xc')]);router[_0xf024('0x7')](_0xf024('0xd'),auth[_0xf024('0x8')](),controller[_0xf024('0xe')]);router[_0xf024('0xf')]('/',auth['isAuthenticated'](),controller[_0xf024('0x10')]);router[_0xf024('0xf')](_0xf024('0x11'),auth[_0xf024('0x8')](),controller[_0xf024('0x12')]);router[_0xf024('0xf')](_0xf024('0xb'),auth[_0xf024('0x8')](),controller[_0xf024('0x13')]);router[_0xf024('0xf')](_0xf024('0xd'),auth[_0xf024('0x8')](),controller['addResources']);router[_0xf024('0x14')]('/:id',auth[_0xf024('0x8')](),controller[_0xf024('0x15')]);router[_0xf024('0x16')](_0xf024('0x17'),auth[_0xf024('0x8')](),controller[_0xf024('0x18')]);router[_0xf024('0x16')](_0xf024('0xb'),auth[_0xf024('0x8')](),controller[_0xf024('0x19')]);router[_0xf024('0x16')](_0xf024('0xd'),auth[_0xf024('0x8')](),controller['removeResources']);module[_0xf024('0x1a')]=router; \ No newline at end of file +var _0x0da5=['clone','addSections','addResources','put','/:id','update','delete','destroy','removeResources','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show','/:id/sections','/:id/resources','post','/:id/clone'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0da5,0x1d4));var _0x50da=function(_0x1fcd7a,_0x24064d){_0x1fcd7a=_0x1fcd7a-0x0;var _0x53d8b3=_0x0da5[_0x1fcd7a];return _0x53d8b3;};'use strict';var multer=require(_0x50da('0x0'));var util=require(_0x50da('0x1'));var path=require(_0x50da('0x2'));var timeout=require(_0x50da('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x50da('0x4'));var auth=require(_0x50da('0x5'));var interaction=require(_0x50da('0x6'));var config=require('../../config/environment');var controller=require(_0x50da('0x7'));router[_0x50da('0x8')]('/',auth[_0x50da('0x9')](),controller[_0x50da('0xa')]);router[_0x50da('0x8')](_0x50da('0xb'),auth[_0x50da('0x9')](),controller[_0x50da('0xc')]);router[_0x50da('0x8')]('/:id',auth[_0x50da('0x9')](),controller[_0x50da('0xd')]);router[_0x50da('0x8')](_0x50da('0xe'),auth['isAuthenticated'](),controller['getSections']);router['get'](_0x50da('0xf'),auth['isAuthenticated'](),controller['getResources']);router[_0x50da('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x50da('0x10')](_0x50da('0x11'),auth[_0x50da('0x9')](),controller[_0x50da('0x12')]);router[_0x50da('0x10')](_0x50da('0xe'),auth[_0x50da('0x9')](),controller[_0x50da('0x13')]);router[_0x50da('0x10')](_0x50da('0xf'),auth[_0x50da('0x9')](),controller[_0x50da('0x14')]);router[_0x50da('0x15')](_0x50da('0x16'),auth[_0x50da('0x9')](),controller[_0x50da('0x17')]);router[_0x50da('0x18')](_0x50da('0x16'),auth[_0x50da('0x9')](),controller[_0x50da('0x19')]);router[_0x50da('0x18')](_0x50da('0xe'),auth[_0x50da('0x9')](),controller['removeSections']);router[_0x50da('0x18')](_0x50da('0xf'),auth[_0x50da('0x9')](),controller[_0x50da('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index d8ef308..39a5c9e 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 _0x1e4f=['setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x118b81,_0x3a4090){var _0x1a208f=function(_0x27d790){while(--_0x27d790){_0x118b81['push'](_0x118b81['shift']());}};_0x1a208f(++_0x3a4090);}(_0x1e4f,0x1c5));var _0xf1e4=function(_0x4fc583,_0x1c9563){_0x4fc583=_0x4fc583-0x0;var _0x3b884d=_0x1e4f[_0x4fc583];return _0x3b884d;};'use strict';var Sequelize=require(_0xf1e4('0x0'));module['exports']={'name':{'type':Sequelize[_0xf1e4('0x1')],'allowNull':![],'unique':_0xf1e4('0x2')},'crudPermissions':{'type':Sequelize[_0xf1e4('0x1')],'set':function(_0x2406de){this[_0xf1e4('0x3')](_0xf1e4('0x4'),_0x2406de?_0x2406de['join'](''):[]);},'get':function(){return this[_0xf1e4('0x5')](_0xf1e4('0x4'))?this[_0xf1e4('0x5')](_0xf1e4('0x4'))[_0xf1e4('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf1e4('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf1e4('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4bd3=['STRING','join','getDataValue','crudPermissions','BOOLEAN'];(function(_0x1a9b87,_0x4b9987){var _0x3e5a50=function(_0x488ffa){while(--_0x488ffa){_0x1a9b87['push'](_0x1a9b87['shift']());}};_0x3e5a50(++_0x4b9987);}(_0x4bd3,0x13b));var _0x34bd=function(_0x36e491,_0x46e31f){_0x36e491=_0x36e491-0x0;var _0x276b43=_0x4bd3[_0x36e491];return _0x276b43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x34bd('0x0')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x34bd('0x0')],'set':function(_0x2a6609){this['setDataValue']('crudPermissions',_0x2a6609?_0x2a6609[_0x34bd('0x1')](''):[]);},'get':function(){return this[_0x34bd('0x2')](_0x34bd('0x3'))?this['getDataValue'](_0x34bd('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x34bd('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x34bd('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 41573bd..6c1f5d8 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 _0xb4f8=['push','removeSections','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','clone','get','omit','createdAt','updatedAt','sequelize','UserProfileSection','each','autoAssociation','userProfileId','Resources','create','UserProfileResource','destroy','transaction','sectionId'];(function(_0x486d65,_0x3b7523){var _0x49bd9f=function(_0x37e501){while(--_0x37e501){_0x486d65['push'](_0x486d65['shift']());}};_0x49bd9f(++_0x3b7523);}(_0xb4f8,0x83));var _0x8b4f=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0xb4f8[_0x462999];return _0x4b1366;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b4f('0x0'));var zipdir=require(_0x8b4f('0x1'));var jsonpatch=require(_0x8b4f('0x2'));var rp=require(_0x8b4f('0x3'));var moment=require(_0x8b4f('0x4'));var BPromise=require(_0x8b4f('0x5'));var Mustache=require('mustache');var util=require(_0x8b4f('0x6'));var path=require('path');var sox=require(_0x8b4f('0x7'));var csv=require(_0x8b4f('0x8'));var ejs=require(_0x8b4f('0x9'));var fs=require('fs');var fs_extra=require(_0x8b4f('0xa'));var _=require(_0x8b4f('0xb'));var squel=require('squel');var crypto=require(_0x8b4f('0xc'));var jsforce=require(_0x8b4f('0xd'));var deskjs=require(_0x8b4f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8b4f('0xf'));var Papa=require(_0x8b4f('0x10'));var Redis=require(_0x8b4f('0x11'));var authService=require(_0x8b4f('0x12'));var qs=require(_0x8b4f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b4f('0x14'));var logger=require(_0x8b4f('0x15'))('api');var utils=require(_0x8b4f('0x16'));var config=require(_0x8b4f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b4f('0x18'))['db'];config[_0x8b4f('0x19')]=_['defaults'](config[_0x8b4f('0x19')],{'host':_0x8b4f('0x1a'),'port':0x18eb});var socket=require(_0x8b4f('0x1b'))(new Redis(config[_0x8b4f('0x19')]));require('./userProfile.socket')[_0x8b4f('0x1c')](socket);function respondWithStatusCode(_0x45c430,_0x28aa70){_0x28aa70=_0x28aa70||0xcc;return function(_0x3c42f1){if(_0x3c42f1){return _0x45c430[_0x8b4f('0x1d')](_0x28aa70);}return _0x45c430[_0x8b4f('0x1e')](_0x28aa70)['end']();};}function respondWithResult(_0x201da6,_0x6713b4){_0x6713b4=_0x6713b4||0xc8;return function(_0x43c99d){if(_0x43c99d){return _0x201da6[_0x8b4f('0x1e')](_0x6713b4)[_0x8b4f('0x1f')](_0x43c99d);}};}function respondWithFilteredResult(_0x15d545,_0x29dfaa){return function(_0x578062){if(_0x578062){var _0x24307f=typeof _0x29dfaa[_0x8b4f('0x20')]===_0x8b4f('0x21')&&typeof _0x29dfaa[_0x8b4f('0x22')]==='undefined';var _0xca93c9=_0x578062['count'];var _0x39c8d4=_0x24307f?0x0:_0x29dfaa[_0x8b4f('0x20')];var _0x5dda4c=_0x24307f?_0x578062[_0x8b4f('0x23')]:_0x29dfaa['offset']+_0x29dfaa['limit'];var _0x4b85fe;if(_0x5dda4c>=_0xca93c9){_0x5dda4c=_0xca93c9;_0x4b85fe=0xc8;}else{_0x4b85fe=0xce;}_0x15d545[_0x8b4f('0x1e')](_0x4b85fe);return _0x15d545[_0x8b4f('0x24')](_0x8b4f('0x25'),_0x39c8d4+'-'+_0x5dda4c+'/'+_0xca93c9)[_0x8b4f('0x1f')](_0x578062);}return null;};}function patchUpdates(_0x4dad29){return function(_0x4b02be){try{jsonpatch[_0x8b4f('0x26')](_0x4b02be,_0x4dad29,!![]);}catch(_0x31934a){return BPromise[_0x8b4f('0x27')](_0x31934a);}return _0x4b02be[_0x8b4f('0x28')]();};}function saveUpdates(_0x584aa0,_0x470145){return function(_0x1de6aa){if(_0x1de6aa){return _0x1de6aa[_0x8b4f('0x29')](_0x584aa0)[_0x8b4f('0x2a')](function(_0x547c76){return _0x547c76;});}return null;};}function removeEntity(_0x28afda,_0x4e9b54){return function(_0x56307d){if(_0x56307d){return _0x56307d['destroy']()['then'](function(){_0x28afda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x545008,_0x3ce625){return function(_0x109a51){if(!_0x109a51){_0x545008['sendStatus'](0x194);}return _0x109a51;};}function handleError(_0x4087d4,_0x2ffbbc){_0x2ffbbc=_0x2ffbbc||0x1f4;return function(_0x3bc8fe){logger[_0x8b4f('0x2b')](_0x3bc8fe[_0x8b4f('0x2c')]);if(_0x3bc8fe[_0x8b4f('0x2d')]){delete _0x3bc8fe[_0x8b4f('0x2d')];}_0x4087d4[_0x8b4f('0x1e')](_0x2ffbbc)[_0x8b4f('0x2e')](_0x3bc8fe);};}exports[_0x8b4f('0x2f')]=function(_0x2b9981,_0x492ce3){var _0x3ba8ba={},_0x4e2858={},_0x5e05e6={'count':0x0,'rows':[]};var _0x2a9170=_[_0x8b4f('0x30')](db[_0x8b4f('0x31')][_0x8b4f('0x32')],function(_0x457ca6){return{'name':_0x457ca6[_0x8b4f('0x33')],'type':_0x457ca6['type'][_0x8b4f('0x34')]};});_0x4e2858[_0x8b4f('0x35')]=_[_0x8b4f('0x30')](_0x2a9170,_0x8b4f('0x2d'));_0x4e2858[_0x8b4f('0x36')]=_[_0x8b4f('0x37')](_0x2b9981[_0x8b4f('0x36')]);_0x4e2858[_0x8b4f('0x38')]=_[_0x8b4f('0x39')](_0x4e2858[_0x8b4f('0x35')],_0x4e2858[_0x8b4f('0x36')]);_0x3ba8ba[_0x8b4f('0x3a')]=_[_0x8b4f('0x39')](_0x4e2858[_0x8b4f('0x35')],qs[_0x8b4f('0x3b')](_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x3b')]));_0x3ba8ba[_0x8b4f('0x3a')]=_0x3ba8ba[_0x8b4f('0x3a')][_0x8b4f('0x3c')]?_0x3ba8ba[_0x8b4f('0x3a')]:_0x4e2858[_0x8b4f('0x35')];if(!_0x2b9981['query'][_0x8b4f('0x3d')](_0x8b4f('0x3e'))){_0x3ba8ba[_0x8b4f('0x22')]=qs[_0x8b4f('0x22')](_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x22')]);_0x3ba8ba['offset']=qs['offset'](_0x2b9981[_0x8b4f('0x36')]['offset']);}_0x3ba8ba[_0x8b4f('0x3f')]=qs[_0x8b4f('0x40')](_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x40')]);_0x3ba8ba['where']=qs['filters'](_[_0x8b4f('0x41')](_0x2b9981[_0x8b4f('0x36')],_0x4e2858['filters']),_0x2a9170);if(_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x42')]){_0x3ba8ba[_0x8b4f('0x43')]=_[_0x8b4f('0x44')](_0x3ba8ba[_0x8b4f('0x43')],{'$or':_[_0x8b4f('0x30')](_0x2a9170,function(_0x1395c1){if(_0x1395c1[_0x8b4f('0x45')]!==_0x8b4f('0x46')){var _0xfd49e8={};_0xfd49e8[_0x1395c1[_0x8b4f('0x2d')]]={'$like':'%'+_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x42')]+'%'};return _0xfd49e8;}})});}_0x3ba8ba=_[_0x8b4f('0x44')]({},_0x3ba8ba,_0x2b9981[_0x8b4f('0x47')]);var _0x27dc6b={'where':_0x3ba8ba[_0x8b4f('0x43')]};return db[_0x8b4f('0x31')][_0x8b4f('0x23')](_0x27dc6b)[_0x8b4f('0x2a')](function(_0x54420c){_0x5e05e6[_0x8b4f('0x23')]=_0x54420c;if(_0x2b9981[_0x8b4f('0x36')][_0x8b4f('0x48')]){_0x3ba8ba[_0x8b4f('0x49')]=[{'all':!![]}];}return db[_0x8b4f('0x31')][_0x8b4f('0x4a')](_0x3ba8ba);})[_0x8b4f('0x2a')](function(_0x4b89a8){_0x5e05e6[_0x8b4f('0x4b')]=_0x4b89a8;return _0x5e05e6;})[_0x8b4f('0x2a')](respondWithFilteredResult(_0x492ce3,_0x3ba8ba))['catch'](handleError(_0x492ce3,null));};exports[_0x8b4f('0x4c')]=function(_0x3d6074,_0x3913b1){var _0xcde552={'raw':![],'where':{'id':_0x3d6074[_0x8b4f('0x4d')]['id']}},_0x27acd1={};_0x27acd1[_0x8b4f('0x35')]=_[_0x8b4f('0x37')](db[_0x8b4f('0x31')][_0x8b4f('0x32')]);_0x27acd1[_0x8b4f('0x36')]=_['keys'](_0x3d6074[_0x8b4f('0x36')]);_0x27acd1[_0x8b4f('0x38')]=_[_0x8b4f('0x39')](_0x27acd1['model'],_0x27acd1['query']);_0xcde552[_0x8b4f('0x3a')]=_[_0x8b4f('0x39')](_0x27acd1['model'],qs[_0x8b4f('0x3b')](_0x3d6074[_0x8b4f('0x36')][_0x8b4f('0x3b')]));_0xcde552[_0x8b4f('0x3a')]=_0xcde552[_0x8b4f('0x3a')][_0x8b4f('0x3c')]?_0xcde552[_0x8b4f('0x3a')]:_0x27acd1[_0x8b4f('0x35')];if(_0x3d6074[_0x8b4f('0x36')][_0x8b4f('0x48')]){_0xcde552[_0x8b4f('0x49')]=[{'all':!![]}];}_0xcde552=_[_0x8b4f('0x44')]({},_0xcde552,_0x3d6074[_0x8b4f('0x47')]);return db[_0x8b4f('0x31')][_0x8b4f('0x4e')](_0xcde552)[_0x8b4f('0x2a')](handleEntityNotFound(_0x3913b1,null))[_0x8b4f('0x2a')](respondWithResult(_0x3913b1,null))[_0x8b4f('0x4f')](handleError(_0x3913b1,null));};exports['create']=function(_0x3fc566,_0x22af19){return db['UserProfile']['create'](_0x3fc566[_0x8b4f('0x50')],{})[_0x8b4f('0x2a')](respondWithResult(_0x22af19,0xc9))[_0x8b4f('0x4f')](handleError(_0x22af19,null));};exports[_0x8b4f('0x51')]=function(_0x47bedd,_0x166ced){var _0x5096ad={'where':{'id':_0x47bedd[_0x8b4f('0x4d')]['id']}},_0x12f7cb={};_0x12f7cb[_0x8b4f('0x35')]=_[_0x8b4f('0x37')](db[_0x8b4f('0x31')]['rawAttributes']);_0x5096ad[_0x8b4f('0x3a')]=_['intersection'](_0x12f7cb[_0x8b4f('0x35')],qs['fields'](_0x47bedd[_0x8b4f('0x36')][_0x8b4f('0x3b')]));_0x5096ad['attributes']=_0x5096ad[_0x8b4f('0x3a')][_0x8b4f('0x3c')]?_0x5096ad[_0x8b4f('0x3a')]:_0x12f7cb[_0x8b4f('0x35')];if(_0x47bedd[_0x8b4f('0x36')][_0x8b4f('0x48')]){_0x5096ad['include']=[{'all':!![]}];}_0x5096ad=_[_0x8b4f('0x44')]({},_0x5096ad,_0x47bedd[_0x8b4f('0x47')]);return db[_0x8b4f('0x31')][_0x8b4f('0x4e')](_0x5096ad)['then'](handleEntityNotFound(_0x166ced,null))[_0x8b4f('0x2a')](function(_0x1c1e21){if(_0x1c1e21){var _0x356a32=_0x1c1e21[_0x8b4f('0x52')]({'plain':!![]});_0x356a32=qs[_0x8b4f('0x53')](_0x356a32,['id',_0x8b4f('0x54'),_0x8b4f('0x55'),'crudPermissions']);_0x47bedd[_0x8b4f('0x50')]=_[_0x8b4f('0x53')](_0x47bedd[_0x8b4f('0x50')],['id','createdAt','updatedAt']);return db[_0x8b4f('0x56')]['transaction'](function(_0x2a18aa){return db[_0x8b4f('0x31')]['create'](_[_0x8b4f('0x44')](_0x356a32,_0x47bedd[_0x8b4f('0x50')]),{'include':_0x47bedd[_0x8b4f('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2a18aa})[_0x8b4f('0x2a')](function(_0x2d3bad){var _0x419e71=_0x2d3bad[_0x8b4f('0x52')]({'plain':!![]});return db[_0x8b4f('0x57')][_0x8b4f('0x4a')]({'where':{'userProfileId':_0x47bedd[_0x8b4f('0x4d')]['id']},'raw':!![]})['then'](function(_0x14c85c){if(_0x14c85c){return BPromise[_0x8b4f('0x58')](_0x14c85c,function(_0x1d081e){return new BPromise(function(_0x378b05,_0x16689a){if(_0x1d081e[_0x8b4f('0x59')]===null||_0x1d081e[_0x8b4f('0x59')]===0x1)_0x378b05(null);return db['UserProfileResource'][_0x8b4f('0x4a')]({'where':{'sectionId':_0x1d081e['id']},'raw':!![]})[_0x8b4f('0x2a')](function(_0x1dd5aa){var _0x3e7cc6=_[_0x8b4f('0x30')](_0x1dd5aa,function(_0x40f964){return qs[_0x8b4f('0x53')](_0x40f964,['id',_0x8b4f('0x54'),'updatedAt','sectionId']);});_0x378b05(_0x3e7cc6);})[_0x8b4f('0x4f')](function(_0x5dbe16){_0x16689a(_0x5dbe16);});})['then'](function(_0x2c161d){var _0x129526=qs[_0x8b4f('0x53')](_0x1d081e,['id',_0x8b4f('0x54'),_0x8b4f('0x55')]);_0x129526[_0x8b4f('0x5a')]=_0x419e71['id'];if(_0x2c161d)_0x129526[_0x8b4f('0x5b')]=_0x2c161d;return _0x129526;})[_0x8b4f('0x2a')](function(_0x501b00){return db['UserProfileSection'][_0x8b4f('0x5c')](_0x501b00,{'include':[{'model':db[_0x8b4f('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x2a18aa});});})['then'](function(){return _0x419e71;});}});});});}})[_0x8b4f('0x2a')](respondWithResult(_0x166ced,0xc9))['catch'](handleError(_0x166ced,null));};exports['update']=function(_0x16e537,_0x4baaff){if(_0x16e537[_0x8b4f('0x50')]['id']){delete _0x16e537[_0x8b4f('0x50')]['id'];}return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x16e537['params']['id']}})[_0x8b4f('0x2a')](handleEntityNotFound(_0x4baaff,null))[_0x8b4f('0x2a')](saveUpdates(_0x16e537[_0x8b4f('0x50')],null))['then'](respondWithResult(_0x4baaff,null))[_0x8b4f('0x4f')](handleError(_0x4baaff,null));};exports[_0x8b4f('0x5e')]=function(_0x215b59,_0x73d045){return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x215b59[_0x8b4f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x73d045,null))[_0x8b4f('0x2a')](removeEntity(_0x73d045,null))['catch'](handleError(_0x73d045,null));};exports['describe']=function(_0x1c5847,_0xe3ef33){return db[_0x8b4f('0x31')]['describe']()[_0x8b4f('0x2a')](respondWithResult(_0xe3ef33,null))[_0x8b4f('0x4f')](handleError(_0xe3ef33,null));};exports['addSections']=function(_0x4e8b5a,_0x3f58c8){var _0x5e41ad=_0x4e8b5a[_0x8b4f('0x50')];return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x4e8b5a[_0x8b4f('0x4d')]['id']}})[_0x8b4f('0x2a')](handleEntityNotFound(_0x3f58c8,null))[_0x8b4f('0x2a')](function(_0x49daf4){if(_0x49daf4){return db['sequelize'][_0x8b4f('0x5f')](function(_0x561e61){return db[_0x8b4f('0x57')][_0x8b4f('0x5e')]({'where':{'userProfileId':_0x4e8b5a[_0x8b4f('0x4d')]['id'],'sectionId':_[_0x8b4f('0x30')](_0x5e41ad,function(_0x2f8726){return _0x2f8726[_0x8b4f('0x60')];})},'transaction':_0x561e61})[_0x8b4f('0x2a')](function(){var _0x71a067=_[_0x8b4f('0x30')](_0x5e41ad,function(_0xce5915){_0xce5915[_0x8b4f('0x5a')]=_0x4e8b5a['params']['id'];return _0xce5915;});var _0x1909f4=[];return BPromise[_0x8b4f('0x58')](_0x71a067,function(_0x1f0083){return db[_0x8b4f('0x57')][_0x8b4f('0x5c')](_0x1f0083,{'include':[{'model':db[_0x8b4f('0x5d')],'as':_0x8b4f('0x5b')}],'raw':!![],'transaction':_0x561e61})[_0x8b4f('0x2a')](function(_0x3ee09d){_0x1909f4[_0x8b4f('0x61')](_0x3ee09d[_0x8b4f('0x52')]({'plain':!![]}));});})['then'](function(){return _0x1909f4;});});});}})[_0x8b4f('0x2a')](function(_0x98313d){return _0x98313d;})[_0x8b4f('0x2a')](respondWithResult(_0x3f58c8,null))['catch'](handleError(_0x3f58c8,null));};exports[_0x8b4f('0x62')]=function(_0x4ea1cd,_0x57103c){var _0x5bf9dd;return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x4ea1cd[_0x8b4f('0x4d')]['id']},'attributes':['id',_0x8b4f('0x2d')]})[_0x8b4f('0x2a')](handleEntityNotFound(_0x57103c,null))[_0x8b4f('0x2a')](function(_0x7cbf4a){if(_0x7cbf4a){_0x5bf9dd=_0x7cbf4a;return db['UserProfileSection'][_0x8b4f('0x5e')]({'where':{'userProfileId':_0x4ea1cd[_0x8b4f('0x4d')]['id'],'sectionId':_0x4ea1cd['query']['ids']}});}})['then'](function(){return _0x5bf9dd;})['then'](respondWithStatusCode(_0x57103c,null))[_0x8b4f('0x4f')](handleError(_0x57103c,null));};exports[_0x8b4f('0x63')]=function(_0x278873,_0x1b4f35){var _0x31d5fb=[];var _0xa87b62=[];return db[_0x8b4f('0x57')][_0x8b4f('0x4a')]({'where':{'userProfileId':_0x278873[_0x8b4f('0x4d')]['id']},'raw':!![]})['then'](function(_0x344e56){_0x31d5fb=_[_0x8b4f('0x42')](_0x344e56,function(_0x181e01){return _0x181e01[_0x8b4f('0x64')]===0x1||_[_0x8b4f('0x65')]([0x3eb,0x709],_0x181e01[_0x8b4f('0x60')]);});if(!_['isEmpty'](_0x31d5fb)){return _[_0x8b4f('0x30')](_0x31d5fb,function(_0xc63f54){return _0xc63f54['sectionId'];});}else{return;}})[_0x8b4f('0x2a')](function(_0x27a23d){if(_0x27a23d)_0xa87b62=_0x27a23d;if(_['includes'](_0xa87b62,0x64)){var _0x9b8fe9=_[_0x8b4f('0x4e')](_0x31d5fb,{'sectionId':0x64});return hasDefaultDashboard(_0x9b8fe9)[_0x8b4f('0x2a')](function(_0x3a8d22){return _[_0x8b4f('0x30')](_0x31d5fb,function(_0x1b6bd5){if(_0x1b6bd5[_0x8b4f('0x60')]===0x64){_0x1b6bd5['subsections']=_0x3a8d22;}return _0x1b6bd5;});});}else{return;}})['then'](function(_0x175009){if(_0x175009)_0x31d5fb=_0x175009;if(_['includes'](_0xa87b62,0x3eb)){var _0x3e737d=_[_0x8b4f('0x4e')](_0x31d5fb,{'sectionId':0x3eb});return getCustomDashboards(_0x3e737d)['then'](function(_0x2ab97c){return _[_0x8b4f('0x30')](_0x31d5fb,function(_0x32aa18){if(_0x3e737d[_0x8b4f('0x64')]){if(_0x32aa18['sectionId']===0x3eb){_0x32aa18['subsections']=_0x2ab97c;}}else{if(_0x32aa18[_0x8b4f('0x60')]===0x64){_0x32aa18[_0x8b4f('0x66')]=_0x2ab97c;}}return _0x32aa18;});});}else{return;}})[_0x8b4f('0x2a')](function(_0x2fa994){if(_0x2fa994)_0x31d5fb=_0x2fa994;if(_[_0x8b4f('0x65')](_0xa87b62,0x709)){var _0x5233b1=_[_0x8b4f('0x4e')](_0x31d5fb,{'sectionId':0x709});return getPlugins(_0x5233b1)[_0x8b4f('0x2a')](function(_0xccaafd){if(_0x5233b1[_0x8b4f('0x64')]){return _[_0x8b4f('0x30')](_0x31d5fb,function(_0x2007e0){if(_0x2007e0[_0x8b4f('0x60')]===0x709){_0x2007e0[_0x8b4f('0x66')]=_0xccaafd;}return _0x2007e0;});}else{var _0x4a30ee={'sectionId':0x76c,'enabled':0x1,'subsections':_0xccaafd};var _0x492fd0=_[_0x8b4f('0x30')](_0x31d5fb);_0x492fd0['push'](_0x4a30ee);return _0x492fd0;}});}else{return;}})[_0x8b4f('0x2a')](function(_0x1c66a8){if(_0x1c66a8)_0x31d5fb=_0x1c66a8;return _[_0x8b4f('0x42')](_0x31d5fb,[_0x8b4f('0x64'),0x1]);})[_0x8b4f('0x2a')](respondWithResult(_0x1b4f35,null))[_0x8b4f('0x4f')](handleError(_0x1b4f35,null));};function hasDefaultDashboard(_0x84445){var _0x46b005=[0x65];return new BPromise(function(_0x15221a,_0x53197c){try{if(_0x84445[_0x8b4f('0x59')]){_0x15221a(_0x46b005);}else{return db[_0x8b4f('0x5d')][_0x8b4f('0x67')]({'where':{'sectionId':_0x84445['id']},'raw':!![]})[_0x8b4f('0x2a')](function(_0x591520){_0x591520?_0x15221a(_0x46b005):_0x15221a();});}}catch(_0x5b1d93){_0x53197c(_0x5b1d93);}});}function getCustomDashboards(_0x52c106){var _0x2817f1=[];return new BPromise(function(_0x16a413,_0x883808){try{if(_0x52c106[_0x8b4f('0x59')]){return db[_0x8b4f('0x68')][_0x8b4f('0x4a')]({'raw':!![]})[_0x8b4f('0x2a')](function(_0x1c9e59){_0x1c9e59['forEach'](function(_0x18f868){_0x2817f1['push'](_0x18f868['id']+0x1869f);});_0x16a413(_0x2817f1);});}else{return db[_0x8b4f('0x5d')][_0x8b4f('0x4a')]({'where':{'sectionId':_0x52c106['id']},'raw':!![]})[_0x8b4f('0x2a')](function(_0x4014ac){_0x4014ac[_0x8b4f('0x69')](function(_0x39ae78){_0x2817f1[_0x8b4f('0x61')](_0x39ae78[_0x8b4f('0x6a')]+0x1869f);});_0x16a413(_0x2817f1);});}}catch(_0x3fe931){_0x883808(_0x3fe931);}});}function getPlugins(_0x237f11){var _0x225904=[];return new BPromise(function(_0x6d285c,_0x4203e3){try{if(_0x237f11[_0x8b4f('0x59')]){return db['Plugin'][_0x8b4f('0x4a')]({'raw':!![]})[_0x8b4f('0x2a')](function(_0x390b99){_0x390b99[_0x8b4f('0x69')](function(_0x3a3939){_0x225904[_0x8b4f('0x61')](_0x3a3939['id']+0x15b38);});_0x6d285c(_0x225904);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x237f11['id']},'raw':!![]})[_0x8b4f('0x2a')](function(_0x51618e){_0x51618e[_0x8b4f('0x69')](function(_0x25a761){_0x225904[_0x8b4f('0x61')](_0x25a761[_0x8b4f('0x6a')]+0x15b38);});_0x6d285c(_0x225904);});}}catch(_0x3cbbb7){_0x4203e3(_0x3cbbb7);}});}exports[_0x8b4f('0x6b')]=function(_0x328b63,_0x326a1f){return db['UserProfile'][_0x8b4f('0x4e')]({'where':{'id':_0x328b63['params']['id']}})[_0x8b4f('0x2a')](handleEntityNotFound(_0x326a1f,null))['then'](function(_0x182f17){if(_0x182f17){return db[_0x8b4f('0x56')]['transaction'](function(_0x7f2a48){return db[_0x8b4f('0x57')]['findAll']({'where':{'userProfileId':_0x328b63['params']['id']},'attributes':['id'],'raw':!![]})[_0x8b4f('0x2a')](function(_0x263abe){if(_0x263abe){return db[_0x8b4f('0x57')][_0x8b4f('0x5e')]({'where':{'userProfileId':_0x328b63['params']['id'],'id':_['map'](_0x263abe,function(_0xcd987c){return _0xcd987c['id'];})},'transaction':_0x7f2a48});}})[_0x8b4f('0x2a')](function(_0x21d43f){var _0x5e23af=_[_0x8b4f('0x30')](_0x328b63[_0x8b4f('0x50')],function(_0x2f683b){_0x2f683b[_0x8b4f('0x5a')]=_0x328b63[_0x8b4f('0x4d')]['id'];return _0x2f683b;});return db[_0x8b4f('0x57')]['bulkCreate'](_0x5e23af,{'raw':!![],'transaction':_0x7f2a48});})[_0x8b4f('0x2a')](function(_0x348678){var _0x5e3689=_[_0x8b4f('0x42')](_[_0x8b4f('0x30')](_0x348678,function(_0x575a75){return _0x575a75['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5e3689){return db[_0x8b4f('0x57')]['findAll']({'where':{'userProfileId':_0x328b63['params']['id'],'sectionId':_['map'](_0x5e3689,function(_0x25cd85){return _0x25cd85[_0x8b4f('0x60')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x8b4f('0x2a')](function(_0x24d42c){var _0x57e12c=_[_0x8b4f('0x30')](_0x328b63[_0x8b4f('0x50')],function(_0x92212){_0x92212[_0x8b4f('0x5a')]=_0x328b63[_0x8b4f('0x4d')]['id'];return _0x92212;});return db[_0x8b4f('0x5d')][_0x8b4f('0x6c')](_0x57e12c,{'raw':!![],'transaction':_0x7f2a48});});}})[_0x8b4f('0x4f')](handleError(_0x326a1f,null));});}})[_0x8b4f('0x2a')](function(_0x339f27){var _0x115688=_[_0x8b4f('0x30')](_0x339f27,function(_0x537217){return _0x537217[_0x8b4f('0x52')]({'plain':!![]});});})[_0x8b4f('0x2a')](respondWithResult(_0x326a1f,null))[_0x8b4f('0x4f')](handleError(_0x326a1f,null));};exports[_0x8b4f('0x6d')]=function(_0x39a636,_0x5adb11,_0x461464){return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x39a636[_0x8b4f('0x4d')]['id']}})[_0x8b4f('0x2a')](handleEntityNotFound(_0x5adb11,null))[_0x8b4f('0x2a')](function(_0x2d5f1c){if(_0x2d5f1c){return _0x2d5f1c[_0x8b4f('0x6d')](_0x39a636[_0x8b4f('0x36')]['ids']);}})[_0x8b4f('0x2a')](respondWithStatusCode(_0x5adb11,null))[_0x8b4f('0x4f')](handleError(_0x5adb11,null));};exports[_0x8b4f('0x6e')]=function(_0x276510,_0x367388){var _0x20a2e3={};if(!_0x276510[_0x8b4f('0x36')][_0x8b4f('0x6f')])throw new Error(_0x8b4f('0x70'));if(!_0x276510[_0x8b4f('0x36')]['hasOwnProperty'](_0x8b4f('0x3e'))){_0x20a2e3[_0x8b4f('0x22')]=qs['limit'](_0x276510[_0x8b4f('0x36')]['limit']);_0x20a2e3[_0x8b4f('0x20')]=qs[_0x8b4f('0x20')](_0x276510[_0x8b4f('0x36')][_0x8b4f('0x20')]);}return db[_0x8b4f('0x31')][_0x8b4f('0x4e')]({'where':{'id':_0x276510['params']['id']}})[_0x8b4f('0x2a')](function(_0x48eb67){if(!_0x48eb67)throw new Error(_0x8b4f('0x71')+_0x276510[_0x8b4f('0x4d')]['id']);return db[_0x8b4f('0x31')]['getResources'](_0x276510);})[_0x8b4f('0x2a')](respondWithFilteredResult(_0x367388,_0x20a2e3))['catch'](handleError(_0x367388,null));}; \ No newline at end of file +var _0x5eed=['userProfileId','Resources','update','describe','addSections','sequelize','transaction','sectionId','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','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','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','keys','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','UserProfile','includeAll','rows','catch','show','params','create','body','clone','include','options','find','get','omit','createdAt','updatedAt','crudPermissions','UserProfileSection','autoAssociation','UserProfileResource','findAll'];(function(_0x29589e,_0x37eb3c){var _0x1ed4d8=function(_0x443160){while(--_0x443160){_0x29589e['push'](_0x29589e['shift']());}};_0x1ed4d8(++_0x37eb3c);}(_0x5eed,0x10a));var _0xd5ee=function(_0x11405a,_0x4baf04){_0x11405a=_0x11405a-0x0;var _0xfbd9a7=_0x5eed[_0x11405a];return _0xfbd9a7;};'use strict';var emlformat=require(_0xd5ee('0x0'));var rimraf=require(_0xd5ee('0x1'));var zipdir=require(_0xd5ee('0x2'));var jsonpatch=require(_0xd5ee('0x3'));var rp=require(_0xd5ee('0x4'));var moment=require(_0xd5ee('0x5'));var BPromise=require(_0xd5ee('0x6'));var Mustache=require(_0xd5ee('0x7'));var util=require(_0xd5ee('0x8'));var path=require(_0xd5ee('0x9'));var sox=require('sox');var csv=require(_0xd5ee('0xa'));var ejs=require(_0xd5ee('0xb'));var fs=require('fs');var fs_extra=require(_0xd5ee('0xc'));var _=require(_0xd5ee('0xd'));var squel=require(_0xd5ee('0xe'));var crypto=require(_0xd5ee('0xf'));var jsforce=require(_0xd5ee('0x10'));var deskjs=require(_0xd5ee('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ee('0x12'));var authService=require(_0xd5ee('0x13'));var qs=require(_0xd5ee('0x14'));var as=require(_0xd5ee('0x15'));var hardwareService=require(_0xd5ee('0x16'));var logger=require(_0xd5ee('0x17'))(_0xd5ee('0x18'));var utils=require(_0xd5ee('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd5ee('0x1a'));var db=require(_0xd5ee('0x1b'))['db'];config['redis']=_[_0xd5ee('0x1c')](config[_0xd5ee('0x1d')],{'host':_0xd5ee('0x1e'),'port':0x18eb});var socket=require(_0xd5ee('0x1f'))(new Redis(config[_0xd5ee('0x1d')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x51a9bc,_0xc7f206){_0xc7f206=_0xc7f206||0xcc;return function(_0x30a4d2){if(_0x30a4d2){return _0x51a9bc['sendStatus'](_0xc7f206);}return _0x51a9bc['status'](_0xc7f206)[_0xd5ee('0x20')]();};}function respondWithResult(_0x28baf5,_0x555c3a){_0x555c3a=_0x555c3a||0xc8;return function(_0xa0862d){if(_0xa0862d){return _0x28baf5[_0xd5ee('0x21')](_0x555c3a)[_0xd5ee('0x22')](_0xa0862d);}};}function respondWithFilteredResult(_0x234bed,_0x2b71e8){return function(_0x39799c){if(_0x39799c){var _0x13c899=typeof _0x2b71e8[_0xd5ee('0x23')]===_0xd5ee('0x24')&&typeof _0x2b71e8[_0xd5ee('0x25')]==='undefined';var _0x2e0c27=_0x39799c[_0xd5ee('0x26')];var _0x218bad=_0x13c899?0x0:_0x2b71e8[_0xd5ee('0x23')];var _0x3f7c29=_0x13c899?_0x39799c['count']:_0x2b71e8[_0xd5ee('0x23')]+_0x2b71e8[_0xd5ee('0x25')];var _0x5cb6c1;if(_0x3f7c29>=_0x2e0c27){_0x3f7c29=_0x2e0c27;_0x5cb6c1=0xc8;}else{_0x5cb6c1=0xce;}_0x234bed[_0xd5ee('0x21')](_0x5cb6c1);return _0x234bed[_0xd5ee('0x27')](_0xd5ee('0x28'),_0x218bad+'-'+_0x3f7c29+'/'+_0x2e0c27)[_0xd5ee('0x22')](_0x39799c);}return null;};}function patchUpdates(_0x432a2b){return function(_0x3fa9b7){try{jsonpatch[_0xd5ee('0x29')](_0x3fa9b7,_0x432a2b,!![]);}catch(_0x3c2a1b){return BPromise[_0xd5ee('0x2a')](_0x3c2a1b);}return _0x3fa9b7[_0xd5ee('0x2b')]();};}function saveUpdates(_0x608bbc,_0x49558c){return function(_0x62a274){if(_0x62a274){return _0x62a274['update'](_0x608bbc)[_0xd5ee('0x2c')](function(_0x18d53){return _0x18d53;});}return null;};}function removeEntity(_0x2a26c3,_0xd35299){return function(_0x459a47){if(_0x459a47){return _0x459a47[_0xd5ee('0x2d')]()[_0xd5ee('0x2c')](function(){_0x2a26c3[_0xd5ee('0x21')](0xcc)[_0xd5ee('0x20')]();});}};}function handleEntityNotFound(_0x5b6042,_0x7014d4){return function(_0x586d7d){if(!_0x586d7d){_0x5b6042[_0xd5ee('0x2e')](0x194);}return _0x586d7d;};}function handleError(_0x48106e,_0x3bd3a4){_0x3bd3a4=_0x3bd3a4||0x1f4;return function(_0x315b55){logger[_0xd5ee('0x2f')](_0x315b55['stack']);if(_0x315b55[_0xd5ee('0x30')]){delete _0x315b55['name'];}_0x48106e[_0xd5ee('0x21')](_0x3bd3a4)[_0xd5ee('0x31')](_0x315b55);};}exports[_0xd5ee('0x32')]=function(_0x416978,_0x3865c3){var _0xa8bba3={},_0x1a38f7={},_0x4ae18b={'count':0x0,'rows':[]};var _0x1075f2=_[_0xd5ee('0x33')](db['UserProfile'][_0xd5ee('0x34')],function(_0x41bdaa){return{'name':_0x41bdaa['fieldName'],'type':_0x41bdaa[_0xd5ee('0x35')][_0xd5ee('0x36')]};});_0x1a38f7['model']=_['map'](_0x1075f2,_0xd5ee('0x30'));_0x1a38f7['query']=_[_0xd5ee('0x37')](_0x416978['query']);_0x1a38f7[_0xd5ee('0x38')]=_['intersection'](_0x1a38f7[_0xd5ee('0x39')],_0x1a38f7['query']);_0xa8bba3[_0xd5ee('0x3a')]=_[_0xd5ee('0x3b')](_0x1a38f7[_0xd5ee('0x39')],qs[_0xd5ee('0x3c')](_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x3c')]));_0xa8bba3['attributes']=_0xa8bba3[_0xd5ee('0x3a')][_0xd5ee('0x3e')]?_0xa8bba3[_0xd5ee('0x3a')]:_0x1a38f7[_0xd5ee('0x39')];if(!_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x3f')](_0xd5ee('0x40'))){_0xa8bba3[_0xd5ee('0x25')]=qs[_0xd5ee('0x25')](_0x416978['query'][_0xd5ee('0x25')]);_0xa8bba3['offset']=qs[_0xd5ee('0x23')](_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x23')]);}_0xa8bba3[_0xd5ee('0x41')]=qs['sort'](_0x416978[_0xd5ee('0x3d')]['sort']);_0xa8bba3[_0xd5ee('0x42')]=qs[_0xd5ee('0x38')](_[_0xd5ee('0x43')](_0x416978[_0xd5ee('0x3d')],_0x1a38f7['filters']),_0x1075f2);if(_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x44')]){_0xa8bba3[_0xd5ee('0x42')]=_[_0xd5ee('0x45')](_0xa8bba3[_0xd5ee('0x42')],{'$or':_[_0xd5ee('0x33')](_0x1075f2,function(_0x2617c6){if(_0x2617c6[_0xd5ee('0x35')]!=='VIRTUAL'){var _0x4403b2={};_0x4403b2[_0x2617c6['name']]={'$like':'%'+_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x44')]+'%'};return _0x4403b2;}})});}_0xa8bba3=_[_0xd5ee('0x45')]({},_0xa8bba3,_0x416978['options']);var _0x5a396d={'where':_0xa8bba3[_0xd5ee('0x42')]};return db[_0xd5ee('0x46')]['count'](_0x5a396d)['then'](function(_0x271ef5){_0x4ae18b[_0xd5ee('0x26')]=_0x271ef5;if(_0x416978[_0xd5ee('0x3d')][_0xd5ee('0x47')]){_0xa8bba3['include']=[{'all':!![]}];}return db[_0xd5ee('0x46')]['findAll'](_0xa8bba3);})[_0xd5ee('0x2c')](function(_0x374466){_0x4ae18b[_0xd5ee('0x48')]=_0x374466;return _0x4ae18b;})[_0xd5ee('0x2c')](respondWithFilteredResult(_0x3865c3,_0xa8bba3))[_0xd5ee('0x49')](handleError(_0x3865c3,null));};exports[_0xd5ee('0x4a')]=function(_0x360d63,_0x56d433){var _0x4cd580={'raw':![],'where':{'id':_0x360d63[_0xd5ee('0x4b')]['id']}},_0x41ee7b={};_0x41ee7b[_0xd5ee('0x39')]=_['keys'](db[_0xd5ee('0x46')]['rawAttributes']);_0x41ee7b['query']=_['keys'](_0x360d63[_0xd5ee('0x3d')]);_0x41ee7b['filters']=_[_0xd5ee('0x3b')](_0x41ee7b['model'],_0x41ee7b[_0xd5ee('0x3d')]);_0x4cd580[_0xd5ee('0x3a')]=_['intersection'](_0x41ee7b[_0xd5ee('0x39')],qs[_0xd5ee('0x3c')](_0x360d63['query'][_0xd5ee('0x3c')]));_0x4cd580['attributes']=_0x4cd580[_0xd5ee('0x3a')][_0xd5ee('0x3e')]?_0x4cd580['attributes']:_0x41ee7b[_0xd5ee('0x39')];if(_0x360d63[_0xd5ee('0x3d')][_0xd5ee('0x47')]){_0x4cd580['include']=[{'all':!![]}];}_0x4cd580=_['merge']({},_0x4cd580,_0x360d63['options']);return db['UserProfile']['find'](_0x4cd580)[_0xd5ee('0x2c')](handleEntityNotFound(_0x56d433,null))[_0xd5ee('0x2c')](respondWithResult(_0x56d433,null))[_0xd5ee('0x49')](handleError(_0x56d433,null));};exports[_0xd5ee('0x4c')]=function(_0x45b1c5,_0x5e03a9){return db[_0xd5ee('0x46')][_0xd5ee('0x4c')](_0x45b1c5[_0xd5ee('0x4d')],{})['then'](respondWithResult(_0x5e03a9,0xc9))[_0xd5ee('0x49')](handleError(_0x5e03a9,null));};exports[_0xd5ee('0x4e')]=function(_0x21e494,_0x4b8b33){var _0x3823ad={'where':{'id':_0x21e494[_0xd5ee('0x4b')]['id']}},_0x3ce539={};_0x3ce539[_0xd5ee('0x39')]=_['keys'](db[_0xd5ee('0x46')][_0xd5ee('0x34')]);_0x3823ad[_0xd5ee('0x3a')]=_[_0xd5ee('0x3b')](_0x3ce539[_0xd5ee('0x39')],qs[_0xd5ee('0x3c')](_0x21e494['query']['fields']));_0x3823ad[_0xd5ee('0x3a')]=_0x3823ad[_0xd5ee('0x3a')][_0xd5ee('0x3e')]?_0x3823ad[_0xd5ee('0x3a')]:_0x3ce539[_0xd5ee('0x39')];if(_0x21e494['query']['includeAll']){_0x3823ad[_0xd5ee('0x4f')]=[{'all':!![]}];}_0x3823ad=_['merge']({},_0x3823ad,_0x21e494[_0xd5ee('0x50')]);return db[_0xd5ee('0x46')][_0xd5ee('0x51')](_0x3823ad)[_0xd5ee('0x2c')](handleEntityNotFound(_0x4b8b33,null))['then'](function(_0x55bd57){if(_0x55bd57){var _0x16c01d=_0x55bd57[_0xd5ee('0x52')]({'plain':!![]});_0x16c01d=qs[_0xd5ee('0x53')](_0x16c01d,['id',_0xd5ee('0x54'),_0xd5ee('0x55'),_0xd5ee('0x56')]);_0x21e494[_0xd5ee('0x4d')]=_['omit'](_0x21e494[_0xd5ee('0x4d')],['id','createdAt',_0xd5ee('0x55')]);return db['sequelize']['transaction'](function(_0x34810b){return db[_0xd5ee('0x46')][_0xd5ee('0x4c')](_[_0xd5ee('0x45')](_0x16c01d,_0x21e494[_0xd5ee('0x4d')]),{'include':_0x21e494[_0xd5ee('0x3d')][_0xd5ee('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x34810b})[_0xd5ee('0x2c')](function(_0x187ff5){var _0x4598f7=_0x187ff5[_0xd5ee('0x52')]({'plain':!![]});return db[_0xd5ee('0x57')]['findAll']({'where':{'userProfileId':_0x21e494[_0xd5ee('0x4b')]['id']},'raw':!![]})[_0xd5ee('0x2c')](function(_0x109252){if(_0x109252){return BPromise['each'](_0x109252,function(_0x1e02ef){return new BPromise(function(_0x209ff3,_0x5ba7a3){if(_0x1e02ef[_0xd5ee('0x58')]===null||_0x1e02ef['autoAssociation']===0x1)_0x209ff3(null);return db[_0xd5ee('0x59')][_0xd5ee('0x5a')]({'where':{'sectionId':_0x1e02ef['id']},'raw':!![]})['then'](function(_0xa7c215){var _0x11b9b5=_[_0xd5ee('0x33')](_0xa7c215,function(_0x4cd0f3){return qs[_0xd5ee('0x53')](_0x4cd0f3,['id',_0xd5ee('0x54'),_0xd5ee('0x55'),'sectionId']);});_0x209ff3(_0x11b9b5);})[_0xd5ee('0x49')](function(_0x5189d7){_0x5ba7a3(_0x5189d7);});})[_0xd5ee('0x2c')](function(_0x301866){var _0x4f4f9e=qs[_0xd5ee('0x53')](_0x1e02ef,['id','createdAt','updatedAt']);_0x4f4f9e[_0xd5ee('0x5b')]=_0x4598f7['id'];if(_0x301866)_0x4f4f9e['Resources']=_0x301866;return _0x4f4f9e;})[_0xd5ee('0x2c')](function(_0x4db3ad){return db[_0xd5ee('0x57')][_0xd5ee('0x4c')](_0x4db3ad,{'include':[{'model':db['UserProfileResource'],'as':_0xd5ee('0x5c')}],'raw':!![],'transaction':_0x34810b});});})[_0xd5ee('0x2c')](function(){return _0x4598f7;});}});});});}})[_0xd5ee('0x2c')](respondWithResult(_0x4b8b33,0xc9))[_0xd5ee('0x49')](handleError(_0x4b8b33,null));};exports[_0xd5ee('0x5d')]=function(_0x25ba5c,_0x184bfc){if(_0x25ba5c[_0xd5ee('0x4d')]['id']){delete _0x25ba5c['body']['id'];}return db[_0xd5ee('0x46')][_0xd5ee('0x51')]({'where':{'id':_0x25ba5c['params']['id']}})[_0xd5ee('0x2c')](handleEntityNotFound(_0x184bfc,null))[_0xd5ee('0x2c')](saveUpdates(_0x25ba5c[_0xd5ee('0x4d')],null))[_0xd5ee('0x2c')](respondWithResult(_0x184bfc,null))[_0xd5ee('0x49')](handleError(_0x184bfc,null));};exports['destroy']=function(_0x5333c8,_0x60d580){return db['UserProfile']['find']({'where':{'id':_0x5333c8[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x2c')](handleEntityNotFound(_0x60d580,null))[_0xd5ee('0x2c')](removeEntity(_0x60d580,null))[_0xd5ee('0x49')](handleError(_0x60d580,null));};exports[_0xd5ee('0x5e')]=function(_0x3638bd,_0x5bdfbc){return db['UserProfile'][_0xd5ee('0x5e')]()[_0xd5ee('0x2c')](respondWithResult(_0x5bdfbc,null))['catch'](handleError(_0x5bdfbc,null));};exports[_0xd5ee('0x5f')]=function(_0x4b5a15,_0x1d9f78){var _0x5bbc78=_0x4b5a15[_0xd5ee('0x4d')];return db[_0xd5ee('0x46')][_0xd5ee('0x51')]({'where':{'id':_0x4b5a15['params']['id']}})['then'](handleEntityNotFound(_0x1d9f78,null))[_0xd5ee('0x2c')](function(_0xf9c862){if(_0xf9c862){return db[_0xd5ee('0x60')][_0xd5ee('0x61')](function(_0x5d0046){return db[_0xd5ee('0x57')]['destroy']({'where':{'userProfileId':_0x4b5a15[_0xd5ee('0x4b')]['id'],'sectionId':_[_0xd5ee('0x33')](_0x5bbc78,function(_0xbcdd74){return _0xbcdd74[_0xd5ee('0x62')];})},'transaction':_0x5d0046})[_0xd5ee('0x2c')](function(){var _0x52f898=_[_0xd5ee('0x33')](_0x5bbc78,function(_0x1f3b0e){_0x1f3b0e[_0xd5ee('0x5b')]=_0x4b5a15[_0xd5ee('0x4b')]['id'];return _0x1f3b0e;});var _0x5c22e5=[];return BPromise['each'](_0x52f898,function(_0x4e6541){return db[_0xd5ee('0x57')]['create'](_0x4e6541,{'include':[{'model':db['UserProfileResource'],'as':_0xd5ee('0x5c')}],'raw':!![],'transaction':_0x5d0046})[_0xd5ee('0x2c')](function(_0x1001ad){_0x5c22e5['push'](_0x1001ad[_0xd5ee('0x52')]({'plain':!![]}));});})[_0xd5ee('0x2c')](function(){return _0x5c22e5;});});});}})[_0xd5ee('0x2c')](function(_0x54d9bf){return _0x54d9bf;})[_0xd5ee('0x2c')](respondWithResult(_0x1d9f78,null))[_0xd5ee('0x49')](handleError(_0x1d9f78,null));};exports[_0xd5ee('0x63')]=function(_0x571572,_0x572ac5){var _0x467974;return db[_0xd5ee('0x46')][_0xd5ee('0x51')]({'where':{'id':_0x571572['params']['id']},'attributes':['id',_0xd5ee('0x30')]})['then'](handleEntityNotFound(_0x572ac5,null))[_0xd5ee('0x2c')](function(_0x400654){if(_0x400654){_0x467974=_0x400654;return db[_0xd5ee('0x57')][_0xd5ee('0x2d')]({'where':{'userProfileId':_0x571572[_0xd5ee('0x4b')]['id'],'sectionId':_0x571572[_0xd5ee('0x3d')][_0xd5ee('0x64')]}});}})[_0xd5ee('0x2c')](function(){return _0x467974;})[_0xd5ee('0x2c')](respondWithStatusCode(_0x572ac5,null))['catch'](handleError(_0x572ac5,null));};exports[_0xd5ee('0x65')]=function(_0x458198,_0x47cb48){var _0x5ea25f=[];var _0x3bc29c=[];return db[_0xd5ee('0x57')][_0xd5ee('0x5a')]({'where':{'userProfileId':_0x458198[_0xd5ee('0x4b')]['id']},'raw':!![]})[_0xd5ee('0x2c')](function(_0x3ad970){_0x5ea25f=_['filter'](_0x3ad970,function(_0x433129){return _0x433129[_0xd5ee('0x66')]===0x1||_['includes']([0x3eb,0x709],_0x433129[_0xd5ee('0x62')]);});if(!_[_0xd5ee('0x67')](_0x5ea25f)){return _[_0xd5ee('0x33')](_0x5ea25f,function(_0x1cfbd3){return _0x1cfbd3['sectionId'];});}else{return;}})[_0xd5ee('0x2c')](function(_0x523631){if(_0x523631)_0x3bc29c=_0x523631;if(_[_0xd5ee('0x68')](_0x3bc29c,0x64)){var _0x49405f=_[_0xd5ee('0x51')](_0x5ea25f,{'sectionId':0x64});return hasDefaultDashboard(_0x49405f)[_0xd5ee('0x2c')](function(_0xf8b09a){return _[_0xd5ee('0x33')](_0x5ea25f,function(_0x594376){if(_0x594376[_0xd5ee('0x62')]===0x64){_0x594376['subsections']=_0xf8b09a;}return _0x594376;});});}else{return;}})[_0xd5ee('0x2c')](function(_0x6b39be){if(_0x6b39be)_0x5ea25f=_0x6b39be;if(_['includes'](_0x3bc29c,0x3eb)){var _0x47b0f0=_[_0xd5ee('0x51')](_0x5ea25f,{'sectionId':0x3eb});return getCustomDashboards(_0x47b0f0)[_0xd5ee('0x2c')](function(_0x570bfa){return _[_0xd5ee('0x33')](_0x5ea25f,function(_0x47e9e5){if(_0x47b0f0[_0xd5ee('0x66')]){if(_0x47e9e5[_0xd5ee('0x62')]===0x3eb){_0x47e9e5[_0xd5ee('0x69')]=_0x570bfa;}}else{if(_0x47e9e5[_0xd5ee('0x62')]===0x64){_0x47e9e5[_0xd5ee('0x69')]=_0x570bfa;}}return _0x47e9e5;});});}else{return;}})[_0xd5ee('0x2c')](function(_0x3d1b22){if(_0x3d1b22)_0x5ea25f=_0x3d1b22;if(_['includes'](_0x3bc29c,0x709)){var _0x27a470=_[_0xd5ee('0x51')](_0x5ea25f,{'sectionId':0x709});return getPlugins(_0x27a470)[_0xd5ee('0x2c')](function(_0x1e94d8){if(_0x27a470[_0xd5ee('0x66')]){return _[_0xd5ee('0x33')](_0x5ea25f,function(_0x74d81c){if(_0x74d81c['sectionId']===0x709){_0x74d81c[_0xd5ee('0x69')]=_0x1e94d8;}return _0x74d81c;});}else{var _0x498d3c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e94d8};var _0x2982fd=_[_0xd5ee('0x33')](_0x5ea25f);_0x2982fd[_0xd5ee('0x6a')](_0x498d3c);return _0x2982fd;}});}else{return;}})[_0xd5ee('0x2c')](function(_0x3cee9a){if(_0x3cee9a)_0x5ea25f=_0x3cee9a;return _[_0xd5ee('0x44')](_0x5ea25f,['enabled',0x1]);})[_0xd5ee('0x2c')](respondWithResult(_0x47cb48,null))[_0xd5ee('0x49')](handleError(_0x47cb48,null));};function hasDefaultDashboard(_0x467f15){var _0x4c045e=[0x65];return new BPromise(function(_0x5260d6,_0x3c6bec){try{if(_0x467f15['autoAssociation']){_0x5260d6(_0x4c045e);}else{return db['UserProfileResource'][_0xd5ee('0x6b')]({'where':{'sectionId':_0x467f15['id']},'raw':!![]})[_0xd5ee('0x2c')](function(_0x2334a2){_0x2334a2?_0x5260d6(_0x4c045e):_0x5260d6();});}}catch(_0x556ad5){_0x3c6bec(_0x556ad5);}});}function getCustomDashboards(_0x48ea66){var _0x364437=[];return new BPromise(function(_0x5bb657,_0x1816a7){try{if(_0x48ea66[_0xd5ee('0x58')]){return db[_0xd5ee('0x6c')][_0xd5ee('0x5a')]({'raw':!![]})[_0xd5ee('0x2c')](function(_0xe3f08e){_0xe3f08e[_0xd5ee('0x6d')](function(_0x2ce511){_0x364437['push'](_0x2ce511['id']+0x1869f);});_0x5bb657(_0x364437);});}else{return db[_0xd5ee('0x59')]['findAll']({'where':{'sectionId':_0x48ea66['id']},'raw':!![]})[_0xd5ee('0x2c')](function(_0x18b729){_0x18b729[_0xd5ee('0x6d')](function(_0x7113de){_0x364437[_0xd5ee('0x6a')](_0x7113de[_0xd5ee('0x6e')]+0x1869f);});_0x5bb657(_0x364437);});}}catch(_0x23ea8e){_0x1816a7(_0x23ea8e);}});}function getPlugins(_0x43c891){var _0x5b1fa4=[];return new BPromise(function(_0x1caef1,_0x386930){try{if(_0x43c891[_0xd5ee('0x58')]){return db[_0xd5ee('0x6f')]['findAll']({'raw':!![]})[_0xd5ee('0x2c')](function(_0x1b5ecf){_0x1b5ecf['forEach'](function(_0x4a66e0){_0x5b1fa4[_0xd5ee('0x6a')](_0x4a66e0['id']+0x15b38);});_0x1caef1(_0x5b1fa4);});}else{return db[_0xd5ee('0x59')][_0xd5ee('0x5a')]({'where':{'sectionId':_0x43c891['id']},'raw':!![]})['then'](function(_0x41ec47){_0x41ec47[_0xd5ee('0x6d')](function(_0x2a66da){_0x5b1fa4['push'](_0x2a66da['resourceId']+0x15b38);});_0x1caef1(_0x5b1fa4);});}}catch(_0x150fd9){_0x386930(_0x150fd9);}});}exports[_0xd5ee('0x70')]=function(_0x1206cf,_0x5dadd3){return db[_0xd5ee('0x46')][_0xd5ee('0x51')]({'where':{'id':_0x1206cf['params']['id']}})[_0xd5ee('0x2c')](handleEntityNotFound(_0x5dadd3,null))[_0xd5ee('0x2c')](function(_0x47ffcf){if(_0x47ffcf){return db[_0xd5ee('0x60')][_0xd5ee('0x61')](function(_0x2bd53f){return db[_0xd5ee('0x57')][_0xd5ee('0x5a')]({'where':{'userProfileId':_0x1206cf['params']['id']},'attributes':['id'],'raw':!![]})[_0xd5ee('0x2c')](function(_0x4bb13d){if(_0x4bb13d){return db['UserProfileSection'][_0xd5ee('0x2d')]({'where':{'userProfileId':_0x1206cf[_0xd5ee('0x4b')]['id'],'id':_[_0xd5ee('0x33')](_0x4bb13d,function(_0x5cce99){return _0x5cce99['id'];})},'transaction':_0x2bd53f});}})[_0xd5ee('0x2c')](function(_0x29465c){var _0x409098=_[_0xd5ee('0x33')](_0x1206cf[_0xd5ee('0x4d')],function(_0x3c5cdf){_0x3c5cdf[_0xd5ee('0x5b')]=_0x1206cf[_0xd5ee('0x4b')]['id'];return _0x3c5cdf;});return db[_0xd5ee('0x57')][_0xd5ee('0x71')](_0x409098,{'raw':!![],'transaction':_0x2bd53f});})[_0xd5ee('0x2c')](function(_0x16fbab){var _0x28f898=_[_0xd5ee('0x44')](_[_0xd5ee('0x33')](_0x16fbab,function(_0x2761cb){return _0x2761cb[_0xd5ee('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x28f898){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1206cf['params']['id'],'sectionId':_[_0xd5ee('0x33')](_0x28f898,function(_0x1597ed){return _0x1597ed[_0xd5ee('0x62')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd5ee('0x2c')](function(_0x41ffe1){var _0x560f2b=_[_0xd5ee('0x33')](_0x1206cf[_0xd5ee('0x4d')],function(_0x1937ac){_0x1937ac[_0xd5ee('0x5b')]=_0x1206cf[_0xd5ee('0x4b')]['id'];return _0x1937ac;});return db[_0xd5ee('0x59')][_0xd5ee('0x71')](_0x560f2b,{'raw':!![],'transaction':_0x2bd53f});});}})['catch'](handleError(_0x5dadd3,null));});}})[_0xd5ee('0x2c')](function(_0xc909c2){var _0x5d37a3=_[_0xd5ee('0x33')](_0xc909c2,function(_0x36c167){return _0x36c167['get']({'plain':!![]});});})[_0xd5ee('0x2c')](respondWithResult(_0x5dadd3,null))[_0xd5ee('0x49')](handleError(_0x5dadd3,null));};exports[_0xd5ee('0x72')]=function(_0x49d1b6,_0x296a20,_0x16eff0){return db[_0xd5ee('0x46')][_0xd5ee('0x51')]({'where':{'id':_0x49d1b6['params']['id']}})[_0xd5ee('0x2c')](handleEntityNotFound(_0x296a20,null))[_0xd5ee('0x2c')](function(_0x5b8dc6){if(_0x5b8dc6){return _0x5b8dc6[_0xd5ee('0x72')](_0x49d1b6[_0xd5ee('0x3d')][_0xd5ee('0x64')]);}})[_0xd5ee('0x2c')](respondWithStatusCode(_0x296a20,null))[_0xd5ee('0x49')](handleError(_0x296a20,null));};exports['getResources']=function(_0xe57939,_0x52e43d){var _0x2b5257={};if(!_0xe57939[_0xd5ee('0x3d')][_0xd5ee('0x73')])throw new Error(_0xd5ee('0x74'));if(!_0xe57939[_0xd5ee('0x3d')][_0xd5ee('0x3f')]('nolimit')){_0x2b5257[_0xd5ee('0x25')]=qs['limit'](_0xe57939['query'][_0xd5ee('0x25')]);_0x2b5257[_0xd5ee('0x23')]=qs[_0xd5ee('0x23')](_0xe57939[_0xd5ee('0x3d')][_0xd5ee('0x23')]);}return db[_0xd5ee('0x46')]['find']({'where':{'id':_0xe57939[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x2c')](function(_0x1c2f92){if(!_0x1c2f92)throw new Error(_0xd5ee('0x75')+_0xe57939[_0xd5ee('0x4b')]['id']);return db[_0xd5ee('0x46')][_0xd5ee('0x76')](_0xe57939);})[_0xd5ee('0x2c')](respondWithFilteredResult(_0x52e43d,_0x2b5257))[_0xd5ee('0x49')](handleError(_0x52e43d,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 455b777..408004a 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 _0xc838=['../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc838,0xbd));var _0x8c83=function(_0x15191a,_0x1bbdf7){_0x15191a=_0x15191a-0x0;var _0x4586a7=_0xc838[_0x15191a];return _0x4586a7;};'use strict';var EventEmitter=require(_0x8c83('0x0'));var UserProfile=require(_0x8c83('0x1'))['db'][_0x8c83('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8c83('0x3')](0x0);var events={'afterCreate':_0x8c83('0x4'),'afterUpdate':_0x8c83('0x5'),'afterDestroy':_0x8c83('0x6')};function emitEvent(_0x25a345){return function(_0x2bb018,_0x85c36d,_0x37a3d9){UserProfileEvents[_0x8c83('0x7')](_0x25a345+':'+_0x2bb018['id'],_0x2bb018);UserProfileEvents[_0x8c83('0x7')](_0x25a345,_0x2bb018);_0x37a3d9(null);};}for(var e in events){if(events[_0x8c83('0x8')](e)){var event=events[e];UserProfile[_0x8c83('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x073d=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3bdf48,_0x1979a2){var _0x8b4812=function(_0x44d545){while(--_0x44d545){_0x3bdf48['push'](_0x3bdf48['shift']());}};_0x8b4812(++_0x1979a2);}(_0x073d,0xd2));var _0xd073=function(_0x14a3d9,_0x12f232){_0x14a3d9=_0x14a3d9-0x0;var _0xeef905=_0x073d[_0x14a3d9];return _0xeef905;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd073('0x0'))['db'][_0xd073('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd073('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd073('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ad2eb){return function(_0x423dc8,_0x494f81,_0x11bd94){UserProfileEvents[_0xd073('0x4')](_0x3ad2eb+':'+_0x423dc8['id'],_0x423dc8);UserProfileEvents[_0xd073('0x4')](_0x3ad2eb,_0x423dc8);_0x11bd94(null);};}for(var e in events){if(events[_0xd073('0x5')](e)){var event=events[e];UserProfile[_0xd073('0x6')](e,emitEvent(event));}}module[_0xd073('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 1e53bb0..51d7dd6 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 _0xc411=['chatqueues','ChatQueue','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','QueueCampaigns','outbound','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','union','model','length','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','include','reportType','default','DefaultReports','CustomReports','count','rows','includeAll','color','tag','ThroughTags','openTabs','true','chat','sms','fax','dataValues','mail','openchannel','whatsapp','exports','filter','field','value','findAll','then','associatedResources','map','resolve','AnalyticExtractedReport','type','resourceId','catch','toLowerCase','SquareProject','odbc','childModel','SquareRecording','SquareProjects','name','projectName','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField'];(function(_0x492191,_0x25123f){var _0x4d6fa3=function(_0x1cf28a){while(--_0x1cf28a){_0x492191['push'](_0x492191['shift']());}};_0x4d6fa3(++_0x25123f);}(_0xc411,0x160));var _0x1c41=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0xc411[_0x2984d0];return _0x2885f2;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x1c41('0x0')]=function(_0x334e69){var _0x1f756b=_0x334e69['models'];function _0x41e601(_0x4c3942,_0x198286){return new Promise(function(_0x51559c,_0x2448c7){if(!_0x198286)return _0x51559c(null);var _0x3f9be9=_0x198286[_0x1c41('0x1')]?{[_0x198286[_0x1c41('0x1')][_0x1c41('0x2')]]:_0x198286[_0x1c41('0x1')][_0x1c41('0x3')]}:undefined;return _0x1f756b[_0x4c3942][_0x1c41('0x4')]({'where':_0x3f9be9,'raw':!![]})[_0x1c41('0x5')](function(_0x1bcb26){_0x198286[_0x1c41('0x6')]=_['map'](_0x1bcb26,'id');_0x51559c(_0x198286);})['catch'](function(_0xec129){_0x2448c7(_0xec129);});});}function _0x4a15e3(_0xfa4f0f,_0x3ebb34){return new Promise(function(_0x50749d,_0x1be824){var _0x3f06b1=_0xfa4f0f[_0x1c41('0x1')]?{[_0xfa4f0f['filter'][_0x1c41('0x2')]]:_0xfa4f0f[_0x1c41('0x1')][_0x1c41('0x3')]}:undefined;return _0x1f756b[_0xfa4f0f['model']]['findAll']({'where':_0x3f06b1,'raw':!![]})[_0x1c41('0x5')](function(_0x14804d){_0x3ebb34['associatedResources']=_[_0x1c41('0x7')](_0x14804d,function(_0x459e7e){return _0x459e7e['name'];});_0x50749d(_0x3ebb34);})['catch'](function(_0x24a800){_0x1be824(_0x24a800);});});}function _0x136f21(_0x2c4421,_0x5ed34f,_0x30a92e){if(!_0x5ed34f)return Promise[_0x1c41('0x8')](null);return new Promise(function(_0x518a7a,_0x507569){return _0x1f756b['UserProfileResource'][_0x1c41('0x4')]({'where':{'sectionId':_0x5ed34f['id']},'raw':!![]})[_0x1c41('0x5')](function(_0x502a60){if(_0x2c4421['field']&&_0x2c4421[_0x1c41('0x2')]!=='id'){_0x5ed34f[_0x1c41('0x6')]=_[_0x1c41('0x7')](_0x502a60,function(_0xd7fbe0){return _0xd7fbe0[_0x2c4421['field']];});}else{if(_0x30a92e===_0x1c41('0x9')){_0x5ed34f[_0x1c41('0x6')]=_[_0x1c41('0x7')](_0x502a60,function(_0x2b2634){return{'id':_0x2b2634['resourceId'],'type':_0x2b2634[_0x1c41('0xa')]};});}else{_0x5ed34f[_0x1c41('0x6')]=_[_0x1c41('0x7')](_0x502a60,function(_0x42a3d3){return _0x42a3d3[_0x1c41('0xb')];});}}_0x518a7a(_0x5ed34f);})[_0x1c41('0xc')](function(_0x226674){_0x507569(_0x226674);});});}function _0x507af3(_0x64ced7,_0x465bb8){var _0x5459f7={'parentSections':[]};switch(_0x64ced7[_0x1c41('0xd')]()){case'squareprojects':_0x5459f7['childModel']=_0x1c41('0xe');break;case _0x1c41('0xf'):_0x5459f7[_0x1c41('0x10')]='SquareOdbc';break;case'squarerecordings':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x11');_0x5459f7['parentSections']=[{'name':_0x1c41('0x12'),'field':_0x1c41('0x13'),'foreignKey':_0x1c41('0x14')}];break;case _0x1c41('0x15'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x16');break;case'contacts':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x17');_0x5459f7[_0x1c41('0x18')]=[{'name':_0x1c41('0x19'),'field':'id','foreignKey':_0x1c41('0x1a')}];break;case'lists':_0x5459f7['childModel']=_0x1c41('0x1b');break;case _0x1c41('0x1c'):_0x5459f7['childModel']=_0x1c41('0x1d');break;case _0x1c41('0x1e'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x1f');break;case _0x1c41('0x20'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x21');break;case'chatwebsites':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x22');break;case _0x1c41('0x23'):_0x5459f7[_0x1c41('0x10')]='FaxQueue';break;case'faxaccounts':_0x5459f7[_0x1c41('0x10')]='FaxAccount';break;case _0x1c41('0x24'):case _0x1c41('0x25'):case _0x1c41('0x26'):_0x5459f7['childModel']=_0x1c41('0x27');break;case _0x1c41('0x28'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x29');break;case'voicemails':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x2a');break;case _0x1c41('0x2b'):_0x5459f7[_0x1c41('0x10')]='VoiceRecording';_0x5459f7[_0x1c41('0x18')]=[{'name':_0x1c41('0x2c'),'field':'name','foreignKey':_0x1c41('0x2d'),'model':_0x1c41('0x2e'),'filter':{'field':_0x1c41('0x2f'),'value':[_0x1c41('0x30')]}},{'name':_0x1c41('0x31'),'field':_0x1c41('0x13'),'foreignKey':_0x1c41('0x2d'),'model':_0x1c41('0x2e'),'filter':{'field':'role','value':[_0x1c41('0x32')]}},{'name':'VoiceQueues','field':_0x1c41('0x13'),'foreignKey':_0x1c41('0x33'),'model':_0x1c41('0x34'),'filter':{'field':_0x1c41('0xa'),'value':['inbound']}},{'name':_0x1c41('0x35'),'field':'name','foreignKey':_0x1c41('0x33'),'model':_0x1c41('0x34'),'filter':{'field':_0x1c41('0xa'),'value':[_0x1c41('0x36')]}}];break;case'musiconholds':_0x5459f7[_0x1c41('0x10')]='VoiceMusicOnHold';break;case _0x1c41('0x37'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x38');break;case'voiceprefixes':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x39');break;case _0x1c41('0x3a'):_0x5459f7['childModel']='Campaign';break;case _0x1c41('0x3b'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x3c');break;case _0x1c41('0x3d'):_0x5459f7[_0x1c41('0x10')]='MailAccount';break;case _0x1c41('0x3e'):_0x5459f7['childModel']=_0x1c41('0x3f');break;case'openchannelqueues':_0x5459f7[_0x1c41('0x10')]='OpenchannelQueue';break;case _0x1c41('0x40'):_0x5459f7['childModel']=_0x1c41('0x41');break;case _0x1c41('0x42'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x43');break;case _0x1c41('0x44'):_0x5459f7[_0x1c41('0x10')]='SmsAccount';break;case _0x1c41('0x45'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x46');break;case _0x1c41('0x47'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x48');break;case _0x1c41('0x49'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x4a');break;case _0x1c41('0x4b'):case _0x1c41('0x4c'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x34');if(_0x465bb8){_0x5459f7[_0x1c41('0x18')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x1c41('0x4d'):case'agents':case _0x1c41('0x4e'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x2e');if(_0x465bb8){_0x5459f7[_0x1c41('0x18')]=[{'name':_0x1c41('0x4f'),'filter':{'field':_0x1c41('0x2f'),'value':[_0x1c41('0x50'),_0x1c41('0x51')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x52');break;case _0x1c41('0x53'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x54');break;case'freshdeskaccounts':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x55');break;case _0x1c41('0x56'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x57');break;case _0x1c41('0x58'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x59');break;case _0x1c41('0x5a'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x5b');break;case _0x1c41('0x5c'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x2e');break;case _0x1c41('0x5d'):_0x5459f7[_0x1c41('0x10')]='CannedAnswer';break;case _0x1c41('0x5e'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x5f');break;case _0x1c41('0x60'):_0x5459f7['childModel']=_0x1c41('0x61');break;case _0x1c41('0x62'):_0x5459f7['childModel']=_0x1c41('0x63');break;case _0x1c41('0x64'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x65');break;case _0x1c41('0x66'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x67');break;case _0x1c41('0x68'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x69');break;case _0x1c41('0x6a'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x6b');break;case _0x1c41('0x6c'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x6d');break;case _0x1c41('0x6e'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x6f');break;case'trunks':_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x70');break;case _0x1c41('0x71'):_0x5459f7['childModel']='Variable';break;case _0x1c41('0x72'):_0x5459f7['childModel']=_0x1c41('0x73');break;case _0x1c41('0x74'):_0x5459f7['childModel']=_0x1c41('0x9');_0x5459f7[_0x1c41('0x18')]=[{'name':_0x1c41('0x75'),'field':'id','foreignKey':_0x1c41('0x76')}];break;case _0x1c41('0x77'):_0x5459f7[_0x1c41('0x10')]=_0x1c41('0x78');break;}return _0x5459f7;}function _0x9e9404(_0x562d42,_0x3fff19){var _0x441447=_0x562d42['charAt'](0x0)[_0x1c41('0x79')]()+_0x562d42[_0x1c41('0x7a')](0x1);var _0x2ffa67={'type':_0x1f756b[_0x1c41('0x7b')][_0x1c41('0x7c')][_0x1c41('0x7d')],'raw':!![]};return new Promise(function(_0x562a19,_0x2c9bb6){var _0x234593=squel['select']()[_0x1c41('0x2')](_0x1c41('0x7e')+_0x441447+_0x1c41('0x7f'),'id')[_0x1c41('0x2')](_0x1c41('0x80'))[_0x1c41('0x81')](_0x1c41('0x82')+_0x562d42+_0x1c41('0x83'),'ui')['where']('ui.UserId\x20=\x20?',_0x3fff19['id']);return _0x1f756b[_0x1c41('0x84')][_0x1c41('0x85')](_0x234593[_0x1c41('0x86')](),_0x2ffa67)[_0x1c41('0x5')](function(_0x5ea34d){_0x3fff19[_0x441447+_0x1c41('0x87')]=_0x5ea34d;_0x562a19(_0x5ea34d);})[_0x1c41('0xc')](function(_0x18425b){_0x2c9bb6(_0x18425b);});});}return _0x334e69[_0x1c41('0x88')]('UserProfile',attributes,{'tableName':_0x1c41('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3e7d5e){var _0x175f98={'raw':_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0x8a')],'where':{}};var _0x531a06={};var _0x74300b={'count':0x0,'rows':[]};var _0x5101d9=_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0x8b')];var _0x46393f=_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0x8c')]||![];var _0x12f0d6=_0x507af3(_0x5101d9,_0x46393f);if(!_0x12f0d6[_0x1c41('0x10')])throw new Error(_0x1c41('0x8d')+_0x5101d9+'\x27');var _0x4087e0=[{'name':_0x5101d9}];if(!_[_0x1c41('0x8e')](_0x12f0d6['parentSections']))_0x4087e0=_0x12f0d6[_0x1c41('0x18')];var _0x2e1401=[];for(var _0x167dec=0x0;_0x167dec<_0x4087e0['length'];_0x167dec++){_0x2e1401[_0x1c41('0x8f')](_0x1f756b[_0x1c41('0x90')][_0x1c41('0x91')]({'where':{'userProfileId':_0x3e7d5e[_0x1c41('0x92')]['id'],'name':_0x4087e0[_0x167dec][_0x1c41('0x13')]},'raw':!![]}));}return Promise[_0x1c41('0x93')](_0x2e1401)[_0x1c41('0x5')](function(_0x73a45e){var _0x21f0f7=_[_0x1c41('0x1')](_0x73a45e,function(_0x441ea2){return _0x441ea2?_0x441ea2:undefined;});var _0x1a50b2=_[_0x1c41('0x1')](_0x4087e0,[_0x1c41('0x94'),!![]]);var _0x1dcde1=_[_0x1c41('0x8e')](_0x21f0f7)&&_[_0x1c41('0x8e')](_0x1a50b2)?null:_[_0x1c41('0x95')](_0x1a50b2,_0x21f0f7);if(!_0x1dcde1)return null;var _0x527817=[];for(var _0x57b3e2=0x0;_0x57b3e2<_0x1dcde1['length'];_0x57b3e2++){var _0x271126=_[_0x1c41('0x91')](_0x4087e0,function(_0x1aa958){return _0x1dcde1[_0x57b3e2]?_0x1aa958[_0x1c41('0x13')]===_0x1dcde1[_0x57b3e2]['name']:null;});if(_0x271126){if(_0x1dcde1[_0x57b3e2][_0x1c41('0x94')]){_0x527817[_0x1c41('0x8f')](_0x41e601(_0x12f0d6[_0x1c41('0x10')],_0x1dcde1[_0x57b3e2]));}else{if(!_0x1dcde1[_0x57b3e2]['autoAssociation']){_0x527817['push'](_0x136f21(_0x271126,_0x1dcde1[_0x57b3e2],_0x12f0d6[_0x1c41('0x10')]));}else{if(_0x271126[_0x1c41('0x96')]){_0x527817[_0x1c41('0x8f')](_0x4a15e3(_0x271126,_0x1dcde1[_0x57b3e2]));}}}}}return Promise['all'](_0x527817);})[_0x1c41('0x5')](function(_0x282a22){var _0x3daac4=_0x282a22;var _0x15756b=null;if(_0x3daac4){_0x15756b=_0x3daac4[_0x1c41('0x97')]===0x1?_0x3daac4[0x0]:null;}if(!_0x15756b&&!_0x3daac4)return _0x74300b;var _0x5dbac4=_0x1f756b[_0x12f0d6[_0x1c41('0x10')]][_0x1c41('0x98')];_0x531a06[_0x1c41('0x96')]=_[_0x1c41('0x99')](_0x5dbac4);_0x531a06[_0x1c41('0x85')]=_['keys'](_0x3e7d5e[_0x1c41('0x85')]);_0x531a06[_0x1c41('0x9a')]=_[_0x1c41('0x9b')](_0x531a06[_0x1c41('0x96')],_0x531a06[_0x1c41('0x85')]);_0x175f98[_0x1c41('0x9c')]=_[_0x1c41('0x9b')](_0x531a06[_0x1c41('0x96')],qs[_0x1c41('0x9d')](_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0x9d')]));_0x175f98[_0x1c41('0x9c')]=_0x175f98['attributes'][_0x1c41('0x97')]?_0x175f98[_0x1c41('0x9c')]:_0x531a06[_0x1c41('0x96')];if(!_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0x9e')]('nolimit')){_0x175f98[_0x1c41('0x9f')]=qs['limit'](_0x3e7d5e[_0x1c41('0x85')]['limit']);_0x175f98[_0x1c41('0xa0')]=qs[_0x1c41('0xa0')](_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xa0')]);}_0x175f98[_0x1c41('0xa1')]=qs['sort'](_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xa2')]);_0x175f98[_0x1c41('0xa3')]=qs[_0x1c41('0x9a')](_[_0x1c41('0xa4')](_0x3e7d5e['query'],_0x531a06[_0x1c41('0x9a')]));if(_0x3e7d5e['query']['filter']){_0x175f98[_0x1c41('0xa3')]=_[_0x1c41('0xa5')](_0x175f98[_0x1c41('0xa3')],{'$or':_[_0x1c41('0x7')](_0x5dbac4,function(_0x453050){if(_0x453050[_0x1c41('0xa')][_0x1c41('0xa6')]!==_0x1c41('0xa7')){var _0x4f59a1={};_0x4f59a1[_0x453050['field']]={'$like':'%'+_0x3e7d5e[_0x1c41('0x85')]['filter']+'%'};return _0x4f59a1;}})});}var _0x3ae43b=[];var _0x2c15a9=null;var _0x129480={};if(_0x15756b){_0x2c15a9=_[_0x1c41('0x91')](_0x4087e0,[_0x1c41('0x13'),_0x15756b['name']]);if(_0x2c15a9[_0x1c41('0x2')]){_0x129480={};if(_0x12f0d6[_0x1c41('0x10')]===_0x1c41('0x9')){_0x129480[_0x2c15a9['foreignKey']]=_[_0x1c41('0x7')](_0x15756b['associatedResources'],'id');}else{_0x129480[_0x2c15a9[_0x1c41('0xa8')]]=_0x15756b[_0x1c41('0x6')];}_0x3ae43b[_0x1c41('0x8f')](_0x129480);}else{_0x175f98[_0x1c41('0xa3')]['id']=_0x15756b[_0x1c41('0x6')];}}else{for(var _0x2bad3d=0x0;_0x2bad3d<_0x3daac4['length'];_0x2bad3d++){_0x2c15a9=_[_0x1c41('0x91')](_0x4087e0,[_0x1c41('0x13'),_0x3daac4[_0x2bad3d][_0x1c41('0x13')]]);if(_0x2c15a9[_0x1c41('0x2')]){_0x129480={};_0x129480[_0x2c15a9[_0x1c41('0xa8')]]=_0x3daac4[_0x2bad3d][_0x1c41('0x6')];_0x3ae43b['push'](_0x129480);}else{if(!_0x175f98[_0x1c41('0xa3')]['id'])_0x175f98['where']['id']=[];_0x3daac4[_0x2bad3d][_0x1c41('0x6')][_0x1c41('0xa9')](function(_0x401c0a){_0x175f98['where']['id']['push'](_0x401c0a);});}}}if(!_[_0x1c41('0x8e')](_0x3ae43b)){_0x175f98[_0x1c41('0xa3')]=_['merge'](_0x175f98[_0x1c41('0xa3')],{'$and':{'$or':_0x3ae43b}});}_0x175f98=_[_0x1c41('0xa5')]({},_0x175f98,_0x3e7d5e[_0x1c41('0xaa')]);if(_0x15756b&&!_0x15756b[_0x1c41('0xab')]&&_0x12f0d6[_0x1c41('0x10')]===_0x1c41('0x9')){if(_0x3e7d5e[_0x1c41('0x85')]['includeAll']){_0x175f98[_0x1c41('0xac')]=[{'all':!![]}];}return _0x1f756b[_0x12f0d6[_0x1c41('0x10')]]['findAll'](_0x175f98)[_0x1c41('0x5')](function(_0x3f9f41){var _0x3a7f98=[];_0x3f9f41[_0x1c41('0xa9')](function(_0x54e8a1){var _0x54941d;switch(_0x54e8a1[_0x1c41('0xad')]){case _0x1c41('0xae'):_0x54941d=_[_0x1c41('0x91')](_0x15756b[_0x1c41('0x6')],function(_0x296362){return _0x296362['id']===_0x54e8a1[_0x1c41('0x76')]&&_0x296362[_0x1c41('0xa')]===_0x1c41('0xaf');});break;case'custom':_0x54941d=_[_0x1c41('0x91')](_0x15756b[_0x1c41('0x6')],function(_0x4484bd){return _0x4484bd['id']===_0x54e8a1['reportId']&&_0x4484bd[_0x1c41('0xa')]===_0x1c41('0xb0');});break;}if(_0x54941d)_0x3a7f98[_0x1c41('0x8f')](_0x54e8a1);});_0x74300b[_0x1c41('0xb1')]=_0x3a7f98[_0x1c41('0x97')];_0x74300b[_0x1c41('0xb2')]=_0x3a7f98;return _0x74300b;});}else{return _0x1f756b[_0x12f0d6[_0x1c41('0x10')]][_0x1c41('0xb1')]({'where':_0x175f98[_0x1c41('0xa3')]})[_0x1c41('0x5')](function(_0x12c7a1){_0x74300b['count']=_0x12c7a1;if(_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xb3')]){if(_0x12f0d6[_0x1c41('0x10')]===_0x1c41('0x17')){_0x175f98['include']=[{'model':_0x1f756b[_0x1c41('0x6b')],'as':'Tags','attributes':['id','name',_0x1c41('0xb4')],'required':_0x3e7d5e['query'][_0x1c41('0xb5')]?!![]:![]},{'model':_0x1f756b[_0x1c41('0x6b')],'as':_0x1c41('0xb6'),'attributes':['id',_0x1c41('0x13'),_0x1c41('0xb4')],'through':_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xb5')]?{'attributes':[],'where':{'TagId':_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xb5')]||undefined}}:{},'required':_0x3e7d5e[_0x1c41('0x85')]['tag']?!![]:![]}];}else{_0x175f98[_0x1c41('0xac')]=[{'all':!![]}];}}return _0x1f756b[_0x12f0d6[_0x1c41('0x10')]][_0x1c41('0x4')](_0x175f98);})['then'](function(_0x3288be){_0x74300b[_0x1c41('0xb2')]=_0x3288be;if(_0x5101d9==='Agents'&&_0x3e7d5e[_0x1c41('0x85')][_0x1c41('0xb7')]===_0x1c41('0xb8')){var _0xf39965=[];for(var _0x1d3f35=0x0;_0x1d3f35<_0x74300b['rows'][_0x1c41('0x97')];_0x1d3f35++){_0xf39965[_0x1c41('0x8f')](_0x9e9404(_0x1c41('0xb9'),_0x74300b['rows'][_0x1d3f35]['dataValues']));_0xf39965[_0x1c41('0x8f')](_0x9e9404(_0x1c41('0xba'),_0x74300b[_0x1c41('0xb2')][_0x1d3f35]['dataValues']));_0xf39965['push'](_0x9e9404(_0x1c41('0xbb'),_0x74300b[_0x1c41('0xb2')][_0x1d3f35][_0x1c41('0xbc')]));_0xf39965[_0x1c41('0x8f')](_0x9e9404(_0x1c41('0xbd'),_0x74300b['rows'][_0x1d3f35]['dataValues']));_0xf39965[_0x1c41('0x8f')](_0x9e9404(_0x1c41('0xbe'),_0x74300b['rows'][_0x1d3f35][_0x1c41('0xbc')]));_0xf39965['push'](_0x9e9404(_0x1c41('0xbf'),_0x74300b['rows'][_0x1d3f35][_0x1c41('0xbc')]));}return Promise[_0x1c41('0x93')](_0xf39965)[_0x1c41('0x5')](function(){return _0x74300b;});}return _0x74300b;});}});}}});}; \ No newline at end of file +var _0x0cc3=['openchannelqueues','OpenchannelQueue','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','users','agents','telephones','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Dashboard','intervals','Schedule','sounds','tags','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','raw','mergeResources','length','push','find','params','all','ignore','isEmpty','union','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','include','reportType','default','DefaultReports','custom','count','rows','includeAll','color','tag','Tag','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','squel','exports','models','filter','field','value','findAll','map','catch','model','then','associatedResources','name','resolve','UserProfileResource','resourceId','type','squareprojects','childModel','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x0cc3,0x1eb));var _0x30cc=function(_0x256f4a,_0x83fc6b){_0x256f4a=_0x256f4a-0x0;var _0x26081e=_0x0cc3[_0x256f4a];return _0x26081e;};'use strict';var _=require(_0x30cc('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require(_0x30cc('0x1'));module[_0x30cc('0x2')]=function(_0x151a26){var _0x559789=_0x151a26[_0x30cc('0x3')];function _0x44f647(_0x528a5c,_0x295581){return new Promise(function(_0x4bb393,_0x36a86c){if(!_0x295581)return _0x4bb393(null);var _0x36e8f4=_0x295581[_0x30cc('0x4')]?{[_0x295581['filter'][_0x30cc('0x5')]]:_0x295581[_0x30cc('0x4')][_0x30cc('0x6')]}:undefined;return _0x559789[_0x528a5c][_0x30cc('0x7')]({'where':_0x36e8f4,'raw':!![]})['then'](function(_0x1f85e7){_0x295581['associatedResources']=_[_0x30cc('0x8')](_0x1f85e7,'id');_0x4bb393(_0x295581);})[_0x30cc('0x9')](function(_0x5a5c3e){_0x36a86c(_0x5a5c3e);});});}function _0x4f3c76(_0x590cd4,_0x55de8c){return new Promise(function(_0x48e5b9,_0x1d4710){var _0x56210=_0x590cd4[_0x30cc('0x4')]?{[_0x590cd4[_0x30cc('0x4')][_0x30cc('0x5')]]:_0x590cd4[_0x30cc('0x4')][_0x30cc('0x6')]}:undefined;return _0x559789[_0x590cd4[_0x30cc('0xa')]][_0x30cc('0x7')]({'where':_0x56210,'raw':!![]})[_0x30cc('0xb')](function(_0x4e2cd2){_0x55de8c[_0x30cc('0xc')]=_[_0x30cc('0x8')](_0x4e2cd2,function(_0x1b4fc6){return _0x1b4fc6[_0x30cc('0xd')];});_0x48e5b9(_0x55de8c);})[_0x30cc('0x9')](function(_0x3b4f6b){_0x1d4710(_0x3b4f6b);});});}function _0x26e122(_0x35abe4,_0x505e59,_0x458282){if(!_0x505e59)return Promise[_0x30cc('0xe')](null);return new Promise(function(_0xdbe212,_0x14b2c0){return _0x559789[_0x30cc('0xf')][_0x30cc('0x7')]({'where':{'sectionId':_0x505e59['id']},'raw':!![]})[_0x30cc('0xb')](function(_0x383653){if(_0x35abe4[_0x30cc('0x5')]&&_0x35abe4[_0x30cc('0x5')]!=='id'){_0x505e59[_0x30cc('0xc')]=_['map'](_0x383653,function(_0x607c96){return _0x607c96[_0x35abe4[_0x30cc('0x5')]];});}else{if(_0x458282==='AnalyticExtractedReport'){_0x505e59[_0x30cc('0xc')]=_[_0x30cc('0x8')](_0x383653,function(_0x737d83){return{'id':_0x737d83[_0x30cc('0x10')],'type':_0x737d83[_0x30cc('0x11')]};});}else{_0x505e59[_0x30cc('0xc')]=_[_0x30cc('0x8')](_0x383653,function(_0x4a9301){return _0x4a9301[_0x30cc('0x10')];});}}_0xdbe212(_0x505e59);})['catch'](function(_0x11afe5){_0x14b2c0(_0x11afe5);});});}function _0x1c646a(_0x3312b9,_0x40edc6){var _0x1939cd={'parentSections':[]};switch(_0x3312b9['toLowerCase']()){case _0x30cc('0x12'):_0x1939cd[_0x30cc('0x13')]='SquareProject';break;case _0x30cc('0x14'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x15');break;case'squarerecordings':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x16');_0x1939cd[_0x30cc('0x17')]=[{'name':_0x30cc('0x18'),'field':_0x30cc('0xd'),'foreignKey':_0x30cc('0x19')}];break;case _0x30cc('0x1a'):_0x1939cd['childModel']=_0x30cc('0x1b');break;case _0x30cc('0x1c'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x1d');_0x1939cd[_0x30cc('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0x30cc('0x1e')}];break;case _0x30cc('0x1f'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x20');break;case _0x30cc('0x21'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x22');break;case _0x30cc('0x23'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x24');break;case _0x30cc('0x25'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x26');break;case _0x30cc('0x27'):_0x1939cd['childModel']=_0x30cc('0x28');break;case'faxqueues':_0x1939cd['childModel']=_0x30cc('0x29');break;case _0x30cc('0x2a'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x2b');break;case'inboundroutes':case _0x30cc('0x2c'):case'outboundroutes':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x2d');break;case _0x30cc('0x2e'):_0x1939cd['childModel']='VoiceContext';break;case _0x30cc('0x2f'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x30');break;case _0x30cc('0x31'):_0x1939cd['childModel']=_0x30cc('0x32');_0x1939cd[_0x30cc('0x17')]=[{'name':'Agents','field':'name','foreignKey':_0x30cc('0x33'),'model':_0x30cc('0x34'),'filter':{'field':_0x30cc('0x35'),'value':[_0x30cc('0x36')]}},{'name':_0x30cc('0x37'),'field':'name','foreignKey':_0x30cc('0x33'),'model':_0x30cc('0x34'),'filter':{'field':_0x30cc('0x35'),'value':['telephone']}},{'name':_0x30cc('0x38'),'field':'name','foreignKey':_0x30cc('0x39'),'model':_0x30cc('0x3a'),'filter':{'field':_0x30cc('0x11'),'value':[_0x30cc('0x3b')]}},{'name':_0x30cc('0x3c'),'field':_0x30cc('0xd'),'foreignKey':'queue','model':_0x30cc('0x3a'),'filter':{'field':'type','value':[_0x30cc('0x3d')]}}];break;case _0x30cc('0x3e'):_0x1939cd['childModel']=_0x30cc('0x3f');break;case _0x30cc('0x40'):_0x1939cd['childModel']='VoiceChanSpy';break;case _0x30cc('0x41'):_0x1939cd['childModel']=_0x30cc('0x42');break;case'ivrcampaigns':_0x1939cd[_0x30cc('0x13')]='Campaign';break;case _0x30cc('0x43'):_0x1939cd['childModel']=_0x30cc('0x44');break;case _0x30cc('0x45'):_0x1939cd['childModel']=_0x30cc('0x46');break;case _0x30cc('0x47'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x48');break;case _0x30cc('0x49'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x4a');break;case'openchannelaccounts':_0x1939cd[_0x30cc('0x13')]='OpenchannelAccount';break;case'smsqueues':_0x1939cd['childModel']=_0x30cc('0x4b');break;case _0x30cc('0x4c'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x4d');break;case _0x30cc('0x4e'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x4f');break;case _0x30cc('0x50'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x51');break;case _0x30cc('0x52'):_0x1939cd['childModel']='Team';break;case _0x30cc('0x53'):case'queuecampaigns':_0x1939cd['childModel']=_0x30cc('0x3a');if(_0x40edc6){_0x1939cd[_0x30cc('0x17')]=[{'name':'VoiceQueues'},{'name':_0x30cc('0x3c')}];}break;case _0x30cc('0x54'):case _0x30cc('0x55'):case _0x30cc('0x56'):_0x1939cd['childModel']=_0x30cc('0x34');if(_0x40edc6){_0x1939cd[_0x30cc('0x17')]=[{'name':'Users','filter':{'field':'role','value':['admin',_0x30cc('0x57')]},'ignore':!![]},{'name':_0x30cc('0x58')},{'name':_0x30cc('0x37')}];}break;case _0x30cc('0x59'):_0x1939cd['childModel']=_0x30cc('0x5a');break;case _0x30cc('0x5b'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x5c');break;case _0x30cc('0x5d'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x5e');break;case _0x30cc('0x5f'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x60');break;case'deskaccounts':_0x1939cd[_0x30cc('0x13')]='DeskAccount';break;case _0x30cc('0x61'):_0x1939cd['childModel']=_0x30cc('0x62');break;case'vtigeraccounts':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x34');break;case _0x30cc('0x63'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x64');break;case'dispositions':_0x1939cd[_0x30cc('0x13')]='Disposition';break;case'customdashboards':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x65');break;case _0x30cc('0x66'):_0x1939cd[_0x30cc('0x13')]='Interval';break;case'pauses':_0x1939cd[_0x30cc('0x13')]='Pause';break;case'scheduler':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x67');break;case _0x30cc('0x68'):_0x1939cd[_0x30cc('0x13')]='Sound';break;case _0x30cc('0x69'):_0x1939cd[_0x30cc('0x13')]='Tag';break;case _0x30cc('0x6a'):_0x1939cd['childModel']=_0x30cc('0x6b');break;case _0x30cc('0x6c'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x6d');break;case'trunks':_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x6e');break;case _0x30cc('0x6f'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x70');break;case _0x30cc('0x71'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x72');break;case _0x30cc('0x73'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x74');_0x1939cd[_0x30cc('0x17')]=[{'name':_0x30cc('0x75'),'field':'id','foreignKey':_0x30cc('0x76')}];break;case _0x30cc('0x77'):_0x1939cd[_0x30cc('0x13')]=_0x30cc('0x78');break;}return _0x1939cd;}function _0xefab4a(_0x345e6e,_0x2be676){var _0x2e5430=_0x345e6e[_0x30cc('0x79')](0x0)[_0x30cc('0x7a')]()+_0x345e6e[_0x30cc('0x7b')](0x1);var _0x4d2687={'type':_0x559789[_0x30cc('0x7c')][_0x30cc('0x7d')]['SELECT'],'raw':!![]};return new Promise(function(_0x5539ca,_0x3f6733){var _0x1180dd=squel[_0x30cc('0x7e')]()['field']('ui.'+_0x2e5430+_0x30cc('0x7f'),'id')[_0x30cc('0x5')](_0x30cc('0x80'))[_0x30cc('0x81')](_0x30cc('0x82')+_0x345e6e+_0x30cc('0x83'),'ui')['where'](_0x30cc('0x84'),_0x2be676['id']);return _0x559789[_0x30cc('0x85')][_0x30cc('0x86')](_0x1180dd[_0x30cc('0x87')](),_0x4d2687)[_0x30cc('0xb')](function(_0x4b16f3){_0x2be676[_0x2e5430+'OpenTabs']=_0x4b16f3;_0x5539ca(_0x4b16f3);})[_0x30cc('0x9')](function(_0x38297f){_0x3f6733(_0x38297f);});});}return _0x151a26[_0x30cc('0x88')](_0x30cc('0x89'),attributes,{'tableName':_0x30cc('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x29bebc){var _0x1e0d01={'raw':_0x29bebc[_0x30cc('0x86')][_0x30cc('0x8b')],'where':{}};var _0xc9c739={};var _0x510778={'count':0x0,'rows':[]};var _0x42e87e=_0x29bebc['query']['section'];var _0x4dbc5f=_0x29bebc[_0x30cc('0x86')][_0x30cc('0x8c')]||![];var _0x4f6654=_0x1c646a(_0x42e87e,_0x4dbc5f);if(!_0x4f6654[_0x30cc('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x42e87e+'\x27');var _0x1ea8d0=[{'name':_0x42e87e}];if(!_['isEmpty'](_0x4f6654[_0x30cc('0x17')]))_0x1ea8d0=_0x4f6654[_0x30cc('0x17')];var _0x56be1a=[];for(var _0x5ddacc=0x0;_0x5ddacc<_0x1ea8d0[_0x30cc('0x8d')];_0x5ddacc++){_0x56be1a[_0x30cc('0x8e')](_0x559789['UserProfileSection'][_0x30cc('0x8f')]({'where':{'userProfileId':_0x29bebc[_0x30cc('0x90')]['id'],'name':_0x1ea8d0[_0x5ddacc][_0x30cc('0xd')]},'raw':!![]}));}return Promise[_0x30cc('0x91')](_0x56be1a)[_0x30cc('0xb')](function(_0xcd65a3){var _0x3344cf=_['filter'](_0xcd65a3,function(_0x532940){return _0x532940?_0x532940:undefined;});var _0x283a40=_['filter'](_0x1ea8d0,[_0x30cc('0x92'),!![]]);var _0x66bfb2=_[_0x30cc('0x93')](_0x3344cf)&&_[_0x30cc('0x93')](_0x283a40)?null:_[_0x30cc('0x94')](_0x283a40,_0x3344cf);if(!_0x66bfb2)return null;var _0x489f79=[];for(var _0x2cfa33=0x0;_0x2cfa33<_0x66bfb2[_0x30cc('0x8d')];_0x2cfa33++){var _0x45e220=_[_0x30cc('0x8f')](_0x1ea8d0,function(_0x1ab4fd){return _0x66bfb2[_0x2cfa33]?_0x1ab4fd['name']===_0x66bfb2[_0x2cfa33][_0x30cc('0xd')]:null;});if(_0x45e220){if(_0x66bfb2[_0x2cfa33]['ignore']){_0x489f79[_0x30cc('0x8e')](_0x44f647(_0x4f6654[_0x30cc('0x13')],_0x66bfb2[_0x2cfa33]));}else{if(!_0x66bfb2[_0x2cfa33]['autoAssociation']){_0x489f79[_0x30cc('0x8e')](_0x26e122(_0x45e220,_0x66bfb2[_0x2cfa33],_0x4f6654[_0x30cc('0x13')]));}else{if(_0x45e220[_0x30cc('0xa')]){_0x489f79['push'](_0x4f3c76(_0x45e220,_0x66bfb2[_0x2cfa33]));}}}}}return Promise['all'](_0x489f79);})[_0x30cc('0xb')](function(_0x2e2929){var _0x3d607c=_0x2e2929;var _0x5a0fc4=null;if(_0x3d607c){_0x5a0fc4=_0x3d607c['length']===0x1?_0x3d607c[0x0]:null;}if(!_0x5a0fc4&&!_0x3d607c)return _0x510778;var _0x3a5700=_0x559789[_0x4f6654[_0x30cc('0x13')]][_0x30cc('0x95')];_0xc9c739[_0x30cc('0xa')]=_[_0x30cc('0x96')](_0x3a5700);_0xc9c739[_0x30cc('0x86')]=_['keys'](_0x29bebc[_0x30cc('0x86')]);_0xc9c739[_0x30cc('0x97')]=_['intersection'](_0xc9c739['model'],_0xc9c739[_0x30cc('0x86')]);_0x1e0d01[_0x30cc('0x98')]=_[_0x30cc('0x99')](_0xc9c739[_0x30cc('0xa')],qs[_0x30cc('0x9a')](_0x29bebc[_0x30cc('0x86')][_0x30cc('0x9a')]));_0x1e0d01[_0x30cc('0x98')]=_0x1e0d01[_0x30cc('0x98')]['length']?_0x1e0d01[_0x30cc('0x98')]:_0xc9c739['model'];if(!_0x29bebc[_0x30cc('0x86')][_0x30cc('0x9b')](_0x30cc('0x9c'))){_0x1e0d01['limit']=qs[_0x30cc('0x9d')](_0x29bebc[_0x30cc('0x86')][_0x30cc('0x9d')]);_0x1e0d01[_0x30cc('0x9e')]=qs[_0x30cc('0x9e')](_0x29bebc['query'][_0x30cc('0x9e')]);}_0x1e0d01[_0x30cc('0x9f')]=qs[_0x30cc('0xa0')](_0x29bebc[_0x30cc('0x86')]['sort']);_0x1e0d01[_0x30cc('0xa1')]=qs[_0x30cc('0x97')](_[_0x30cc('0xa2')](_0x29bebc[_0x30cc('0x86')],_0xc9c739['filters']));if(_0x29bebc['query'][_0x30cc('0x4')]){_0x1e0d01[_0x30cc('0xa1')]=_['merge'](_0x1e0d01[_0x30cc('0xa1')],{'$or':_[_0x30cc('0x8')](_0x3a5700,function(_0x4c9154){if(_0x4c9154[_0x30cc('0x11')][_0x30cc('0xa3')]!==_0x30cc('0xa4')){var _0x456a77={};_0x456a77[_0x4c9154[_0x30cc('0x5')]]={'$like':'%'+_0x29bebc['query']['filter']+'%'};return _0x456a77;}})});}var _0x50fc23=[];var _0x1e08ce=null;var _0x2c7292={};if(_0x5a0fc4){_0x1e08ce=_[_0x30cc('0x8f')](_0x1ea8d0,['name',_0x5a0fc4[_0x30cc('0xd')]]);if(_0x1e08ce[_0x30cc('0x5')]){_0x2c7292={};if(_0x4f6654['childModel']===_0x30cc('0x74')){_0x2c7292[_0x1e08ce[_0x30cc('0xa5')]]=_[_0x30cc('0x8')](_0x5a0fc4[_0x30cc('0xc')],'id');}else{_0x2c7292[_0x1e08ce[_0x30cc('0xa5')]]=_0x5a0fc4['associatedResources'];}_0x50fc23[_0x30cc('0x8e')](_0x2c7292);}else{_0x1e0d01[_0x30cc('0xa1')]['id']=_0x5a0fc4[_0x30cc('0xc')];}}else{for(var _0x1f09df=0x0;_0x1f09df<_0x3d607c[_0x30cc('0x8d')];_0x1f09df++){_0x1e08ce=_['find'](_0x1ea8d0,[_0x30cc('0xd'),_0x3d607c[_0x1f09df][_0x30cc('0xd')]]);if(_0x1e08ce[_0x30cc('0x5')]){_0x2c7292={};_0x2c7292[_0x1e08ce[_0x30cc('0xa5')]]=_0x3d607c[_0x1f09df][_0x30cc('0xc')];_0x50fc23['push'](_0x2c7292);}else{if(!_0x1e0d01[_0x30cc('0xa1')]['id'])_0x1e0d01[_0x30cc('0xa1')]['id']=[];_0x3d607c[_0x1f09df]['associatedResources'][_0x30cc('0xa6')](function(_0x5bf89f){_0x1e0d01[_0x30cc('0xa1')]['id'][_0x30cc('0x8e')](_0x5bf89f);});}}}if(!_['isEmpty'](_0x50fc23)){_0x1e0d01[_0x30cc('0xa1')]=_[_0x30cc('0xa7')](_0x1e0d01[_0x30cc('0xa1')],{'$and':{'$or':_0x50fc23}});}_0x1e0d01=_[_0x30cc('0xa7')]({},_0x1e0d01,_0x29bebc[_0x30cc('0xa8')]);if(_0x5a0fc4&&!_0x5a0fc4[_0x30cc('0xa9')]&&_0x4f6654[_0x30cc('0x13')]==='AnalyticExtractedReport'){if(_0x29bebc[_0x30cc('0x86')]['includeAll']){_0x1e0d01[_0x30cc('0xaa')]=[{'all':!![]}];}return _0x559789[_0x4f6654[_0x30cc('0x13')]]['findAll'](_0x1e0d01)[_0x30cc('0xb')](function(_0x4dc548){var _0x4bd93a=[];_0x4dc548[_0x30cc('0xa6')](function(_0xa348d2){var _0x3fca91;switch(_0xa348d2[_0x30cc('0xab')]){case _0x30cc('0xac'):_0x3fca91=_['find'](_0x5a0fc4['associatedResources'],function(_0x22f0cf){return _0x22f0cf['id']===_0xa348d2[_0x30cc('0x76')]&&_0x22f0cf[_0x30cc('0x11')]===_0x30cc('0xad');});break;case _0x30cc('0xae'):_0x3fca91=_[_0x30cc('0x8f')](_0x5a0fc4[_0x30cc('0xc')],function(_0x2f9053){return _0x2f9053['id']===_0xa348d2['reportId']&&_0x2f9053['type']==='CustomReports';});break;}if(_0x3fca91)_0x4bd93a[_0x30cc('0x8e')](_0xa348d2);});_0x510778[_0x30cc('0xaf')]=_0x4bd93a[_0x30cc('0x8d')];_0x510778[_0x30cc('0xb0')]=_0x4bd93a;return _0x510778;});}else{return _0x559789[_0x4f6654[_0x30cc('0x13')]][_0x30cc('0xaf')]({'where':_0x1e0d01[_0x30cc('0xa1')]})['then'](function(_0x1f06d8){_0x510778[_0x30cc('0xaf')]=_0x1f06d8;if(_0x29bebc[_0x30cc('0x86')][_0x30cc('0xb1')]){if(_0x4f6654['childModel']==='CmContact'){_0x1e0d01['include']=[{'model':_0x559789['Tag'],'as':'Tags','attributes':['id',_0x30cc('0xd'),_0x30cc('0xb2')],'required':_0x29bebc['query'][_0x30cc('0xb3')]?!![]:![]},{'model':_0x559789[_0x30cc('0xb4')],'as':'ThroughTags','attributes':['id','name',_0x30cc('0xb2')],'through':_0x29bebc[_0x30cc('0x86')][_0x30cc('0xb3')]?{'attributes':[],'where':{'TagId':_0x29bebc[_0x30cc('0x86')]['tag']||undefined}}:{},'required':_0x29bebc['query'][_0x30cc('0xb3')]?!![]:![]}];}else{_0x1e0d01['include']=[{'all':!![]}];}}return _0x559789[_0x4f6654['childModel']]['findAll'](_0x1e0d01);})[_0x30cc('0xb')](function(_0x5308c5){_0x510778[_0x30cc('0xb0')]=_0x5308c5;if(_0x42e87e===_0x30cc('0x58')&&_0x29bebc[_0x30cc('0x86')]['openTabs']===_0x30cc('0xb5')){var _0x392784=[];for(var _0x5ddcdf=0x0;_0x5ddcdf<_0x510778['rows'][_0x30cc('0x8d')];_0x5ddcdf++){_0x392784['push'](_0xefab4a(_0x30cc('0xb6'),_0x510778[_0x30cc('0xb0')][_0x5ddcdf][_0x30cc('0xb7')]));_0x392784['push'](_0xefab4a(_0x30cc('0xb8'),_0x510778[_0x30cc('0xb0')][_0x5ddcdf][_0x30cc('0xb7')]));_0x392784[_0x30cc('0x8e')](_0xefab4a(_0x30cc('0xb9'),_0x510778['rows'][_0x5ddcdf][_0x30cc('0xb7')]));_0x392784[_0x30cc('0x8e')](_0xefab4a(_0x30cc('0xba'),_0x510778[_0x30cc('0xb0')][_0x5ddcdf][_0x30cc('0xb7')]));_0x392784['push'](_0xefab4a('openchannel',_0x510778[_0x30cc('0xb0')][_0x5ddcdf][_0x30cc('0xb7')]));_0x392784[_0x30cc('0x8e')](_0xefab4a(_0x30cc('0xbb'),_0x510778[_0x30cc('0xb0')][_0x5ddcdf]['dataValues']));}return Promise[_0x30cc('0x91')](_0x392784)[_0x30cc('0xb')](function(){return _0x510778;});}return _0x510778;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 24385f9..28b511c 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 _0x032e=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','info','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x032e,0x1cc));var _0xe032=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x032e[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0xe032('0x0'));var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require(_0xe032('0x3'));var fs=require('fs');var Redis=require(_0xe032('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe032('0x5'));var logger=require(_0xe032('0x6'))(_0xe032('0x7'));var config=require(_0xe032('0x8'));var jayson=require(_0xe032('0x9'));var client=jayson[_0xe032('0xa')][_0xe032('0xb')]({'port':0x232a});config['redis']=_[_0xe032('0xc')](config[_0xe032('0xd')],{'host':_0xe032('0xe'),'port':0x18eb});var socket=require(_0xe032('0xf'))(new Redis(config[_0xe032('0xd')]));require(_0xe032('0x10'))['register'](socket);function respondWithRpcPromise(_0x359454,_0xfcdc67,_0x41aaac){return new BPromise(function(_0x5960cf,_0x3cd83b){return client['request'](_0x359454,_0x41aaac)['then'](function(_0x58bbf1){logger[_0xe032('0x11')]('UserProfile,\x20%s,\x20%s',_0xfcdc67,_0xe032('0x12'));logger['debug'](_0xe032('0x13'),_0xfcdc67,_0xe032('0x12'),JSON[_0xe032('0x14')](_0x58bbf1));if(_0x58bbf1[_0xe032('0x15')]){if(_0x58bbf1[_0xe032('0x15')][_0xe032('0x16')]===0x1f4){logger[_0xe032('0x15')](_0xe032('0x17'),_0xfcdc67,_0x58bbf1[_0xe032('0x15')][_0xe032('0x18')]);return _0x3cd83b(_0x58bbf1[_0xe032('0x15')][_0xe032('0x18')]);}logger[_0xe032('0x15')](_0xe032('0x17'),_0xfcdc67,_0x58bbf1[_0xe032('0x15')][_0xe032('0x18')]);return _0x5960cf(_0x58bbf1['error']['message']);}else{logger[_0xe032('0x11')]('UserProfile,\x20%s,\x20%s',_0xfcdc67,_0xe032('0x12'));_0x5960cf(_0x58bbf1[_0xe032('0x19')][_0xe032('0x18')]);}})[_0xe032('0x1a')](function(_0x3a6a04){logger[_0xe032('0x15')](_0xe032('0x17'),_0xfcdc67,_0x3a6a04);_0x3cd83b(_0x3a6a04);});});} \ No newline at end of file +var _0x2272=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x144592,_0x33541c){var _0x465379=function(_0x513d37){while(--_0x513d37){_0x144592['push'](_0x144592['shift']());}};_0x465379(++_0x33541c);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'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);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index b299833..9185933 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 _0x96c8=['./userProfile.events','save','remove','emit','removeListener','register','length'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x96c8,0x1ea));var _0x896c=function(_0xc7ae,_0x1895e8){_0xc7ae=_0xc7ae-0x0;var _0x3157ff=_0x96c8[_0xc7ae];return _0x3157ff;};'use strict';var UserProfileEvents=require(_0x896c('0x0'));var events=[_0x896c('0x1'),_0x896c('0x2'),'update'];function createListener(_0x38a83b,_0x336890){return function(_0x968a56){_0x336890[_0x896c('0x3')](_0x38a83b,_0x968a56);};}function removeListener(_0x4932ac,_0x58c1ce){return function(){UserProfileEvents[_0x896c('0x4')](_0x4932ac,_0x58c1ce);};}exports[_0x896c('0x5')]=function(_0x19e6aa){for(var _0x23e26=0x0,_0x5e7ae0=events[_0x896c('0x6')];_0x23e26<_0x5e7ae0;_0x23e26++){var _0x2ea5fa=events[_0x23e26];var _0x216d6a=createListener('userProfile:'+_0x2ea5fa,_0x19e6aa);UserProfileEvents['on'](_0x2ea5fa,_0x216d6a);}}; \ No newline at end of file +var _0x0a8d=['emit','removeListener','register','length','save','remove','update'];(function(_0x51ea57,_0x1c2d5b){var _0x4016ff=function(_0x36fb9b){while(--_0x36fb9b){_0x51ea57['push'](_0x51ea57['shift']());}};_0x4016ff(++_0x1c2d5b);}(_0x0a8d,0x138));var _0xd0a8=function(_0x52f7e1,_0x41fc27){_0x52f7e1=_0x52f7e1-0x0;var _0x285d0e=_0x0a8d[_0x52f7e1];return _0x285d0e;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xd0a8('0x0'),_0xd0a8('0x1'),_0xd0a8('0x2')];function createListener(_0x343d12,_0x300f2f){return function(_0x111d0f){_0x300f2f[_0xd0a8('0x3')](_0x343d12,_0x111d0f);};}function removeListener(_0x2a5c90,_0x12f392){return function(){UserProfileEvents[_0xd0a8('0x4')](_0x2a5c90,_0x12f392);};}exports[_0xd0a8('0x5')]=function(_0x3445de){for(var _0x2e66c5=0x0,_0x1d907d=events[_0xd0a8('0x6')];_0x2e66c5<_0x1d907d;_0x2e66c5++){var _0xd457a5=events[_0x2e66c5];var _0x4746f6=createListener('userProfile:'+_0xd457a5,_0x3445de);UserProfileEvents['on'](_0xd457a5,_0x4746f6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5f46dfb..8077666 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 _0x76d4=['get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x76d4,0x14e));var _0x476d=function(_0x2ee0c0,_0x5cb4ba){_0x2ee0c0=_0x2ee0c0-0x0;var _0x27756e=_0x76d4[_0x2ee0c0];return _0x27756e;};'use strict';var multer=require(_0x476d('0x0'));var util=require(_0x476d('0x1'));var path=require(_0x476d('0x2'));var timeout=require(_0x476d('0x3'));var express=require('express');var router=express[_0x476d('0x4')]();var fs_extra=require(_0x476d('0x5'));var auth=require(_0x476d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x476d('0x7'));var controller=require('./userProfileResource.controller');router[_0x476d('0x8')]('/',auth[_0x476d('0x9')](),controller[_0x476d('0xa')]);router['get'](_0x476d('0xb'),auth[_0x476d('0x9')](),controller[_0x476d('0xc')]);router['get'](_0x476d('0xd'),auth[_0x476d('0x9')](),controller['show']);router[_0x476d('0xe')]('/',auth[_0x476d('0x9')](),controller[_0x476d('0xf')]);router['put']('/:id',auth[_0x476d('0x9')](),controller[_0x476d('0x10')]);router[_0x476d('0x11')](_0x476d('0xd'),auth[_0x476d('0x9')](),controller[_0x476d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xec70=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','create','put','/:id','update','exports','multer','util','path'];(function(_0x163f5b,_0x54a6d0){var _0x202408=function(_0x497ca8){while(--_0x497ca8){_0x163f5b['push'](_0x163f5b['shift']());}};_0x202408(++_0x54a6d0);}(_0xec70,0x16d));var _0x0ec7=function(_0x218f3c,_0x37b118){_0x218f3c=_0x218f3c-0x0;var _0x5e1443=_0xec70[_0x218f3c];return _0x5e1443;};'use strict';var multer=require(_0x0ec7('0x0'));var util=require(_0x0ec7('0x1'));var path=require(_0x0ec7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0ec7('0x3'));var auth=require(_0x0ec7('0x4'));var interaction=require(_0x0ec7('0x5'));var config=require(_0x0ec7('0x6'));var controller=require('./userProfileResource.controller');router[_0x0ec7('0x7')]('/',auth[_0x0ec7('0x8')](),controller[_0x0ec7('0x9')]);router[_0x0ec7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x0ec7('0xa')]);router['get']('/:id',auth[_0x0ec7('0x8')](),controller['show']);router['post']('/',auth[_0x0ec7('0x8')](),controller[_0x0ec7('0xb')]);router[_0x0ec7('0xc')](_0x0ec7('0xd'),auth['isAuthenticated'](),controller[_0x0ec7('0xe')]);router['delete'](_0x0ec7('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x0ec7('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 7fbf29f..53e4ff1 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 _0x6aa7=['exports','STRING','INTEGER','sequelize'];(function(_0x4025ff,_0x2fcf3d){var _0x41e49c=function(_0x4a6e69){while(--_0x4a6e69){_0x4025ff['push'](_0x4025ff['shift']());}};_0x41e49c(++_0x2fcf3d);}(_0x6aa7,0x1ef));var _0x76aa=function(_0x123bbc,_0x4372b7){_0x123bbc=_0x123bbc-0x0;var _0x3dc8f1=_0x6aa7[_0x123bbc];return _0x3dc8f1;};'use strict';var Sequelize=require(_0x76aa('0x0'));module[_0x76aa('0x1')]={'name':{'type':Sequelize[_0x76aa('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x76aa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x76aa('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb282=['sequelize','exports','STRING','INTEGER'];(function(_0x16b52a,_0x2e6470){var _0x1c760f=function(_0x21cc4c){while(--_0x21cc4c){_0x16b52a['push'](_0x16b52a['shift']());}};_0x1c760f(++_0x2e6470);}(_0xb282,0x158));var _0x2b28=function(_0x5b7890,_0x5cf077){_0x5b7890=_0x5b7890-0x0;var _0x17395e=_0xb282[_0x5b7890];return _0x17395e;};'use strict';var Sequelize=require(_0x2b28('0x0'));module[_0x2b28('0x1')]={'name':{'type':Sequelize[_0x2b28('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2b28('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2b28('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 e54856f..ecbd666 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 _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x3ec271,_0x304bad){var _0x4648e5=function(_0x133dd1){while(--_0x133dd1){_0x3ec271['push'](_0x3ec271['shift']());}};_0x4648e5(++_0x304bad);}(_0x7a54,0x106));var _0x47a5=function(_0x234840,_0x3cdbce){_0x234840=_0x234840-0x0;var _0x4b35c4=_0x7a54[_0x234840];return _0x4b35c4;};'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['UserProfileResource'][_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['UserProfileResource']['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['UserProfileResource']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['UserProfileResource'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../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','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x35bad0,_0x21927d){var _0x4fe50f=function(_0x1873df){while(--_0x1873df){_0x35bad0['push'](_0x35bad0['shift']());}};_0x4fe50f(++_0x21927d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'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')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 9d39cbc..bf9f7cf 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 _0x75ad=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId'];(function(_0xcd38ae,_0x54d0a8){var _0x2e46fb=function(_0x42ddf8){while(--_0x42ddf8){_0xcd38ae['push'](_0xcd38ae['shift']());}};_0x2e46fb(++_0x54d0a8);}(_0x75ad,0xe0));var _0xd75a=function(_0x14ac84,_0x3a51a7){_0x14ac84=_0x14ac84-0x0;var _0x3f4a28=_0x75ad[_0x14ac84];return _0x3f4a28;};'use strict';var _=require(_0xd75a('0x0'));var util=require(_0xd75a('0x1'));var logger=require(_0xd75a('0x2'))(_0xd75a('0x3'));var moment=require(_0xd75a('0x4'));var BPromise=require(_0xd75a('0x5'));var rp=require(_0xd75a('0x6'));var fs=require('fs');var path=require(_0xd75a('0x7'));var rimraf=require(_0xd75a('0x8'));var config=require(_0xd75a('0x9'));var attributes=require(_0xd75a('0xa'));module[_0xd75a('0xb')]=function(_0x4c7613,_0x2e0fa6){return _0x4c7613['define'](_0xd75a('0xc'),attributes,{'tableName':_0xd75a('0xd'),'paranoid':![],'indexes':[{'name':_0xd75a('0xe'),'fields':['resourceId',_0xd75a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc6a=['define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2af8ee,_0x3d475c){var _0x1b8e6f=function(_0x246882){while(--_0x246882){_0x2af8ee['push'](_0x2af8ee['shift']());}};_0x1b8e6f(++_0x3d475c);}(_0xbc6a,0x1aa));var _0xabc6=function(_0x5967d1,_0x3b46f1){_0x5967d1=_0x5967d1-0x0;var _0x496d48=_0xbc6a[_0x5967d1];return _0x496d48;};'use strict';var _=require(_0xabc6('0x0'));var util=require(_0xabc6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xabc6('0x2'));var rp=require(_0xabc6('0x3'));var fs=require('fs');var path=require(_0xabc6('0x4'));var rimraf=require(_0xabc6('0x5'));var config=require(_0xabc6('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xabc6('0x7')]=function(_0x100bb4,_0x282805){return _0x100bb4[_0xabc6('0x8')](_0xabc6('0x9'),attributes,{'tableName':_0xabc6('0xa'),'paranoid':![],'indexes':[{'name':_0xabc6('0xb'),'fields':[_0xabc6('0xc'),_0xabc6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 744ad92..d72bc2c 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 _0xd125=['jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd125,0x176));var _0x5d12=function(_0x4ba265,_0x5eec90){_0x4ba265=_0x4ba265-0x0;var _0x2c13a7=_0xd125[_0x4ba265];return _0x2c13a7;};'use strict';var _=require(_0x5d12('0x0'));var util=require(_0x5d12('0x1'));var moment=require('moment');var BPromise=require(_0x5d12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5d12('0x3'));var logger=require(_0x5d12('0x4'))(_0x5d12('0x5'));var config=require('../../config/environment');var jayson=require(_0x5d12('0x6'));var client=jayson[_0x5d12('0x7')][_0x5d12('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32dc1f,_0x42cefe,_0x548594){return new BPromise(function(_0x2f854d,_0x4fa78b){return client[_0x5d12('0x9')](_0x32dc1f,_0x548594)[_0x5d12('0xa')](function(_0x1765af){logger[_0x5d12('0xb')](_0x5d12('0xc'),_0x42cefe,_0x5d12('0xd'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x42cefe,'request\x20sent',JSON[_0x5d12('0xe')](_0x1765af));if(_0x1765af[_0x5d12('0xf')]){if(_0x1765af[_0x5d12('0xf')][_0x5d12('0x10')]===0x1f4){logger['error'](_0x5d12('0xc'),_0x42cefe,_0x1765af['error']['message']);return _0x4fa78b(_0x1765af['error']['message']);}logger[_0x5d12('0xf')](_0x5d12('0xc'),_0x42cefe,_0x1765af[_0x5d12('0xf')]['message']);return _0x2f854d(_0x1765af[_0x5d12('0xf')][_0x5d12('0x11')]);}else{logger['info'](_0x5d12('0xc'),_0x42cefe,_0x5d12('0xd'));_0x2f854d(_0x1765af[_0x5d12('0x12')][_0x5d12('0x11')]);}})[_0x5d12('0x13')](function(_0xc9fadc){logger[_0x5d12('0xf')](_0x5d12('0xc'),_0x42cefe,_0xc9fadc);_0x4fa78b(_0xc9fadc);});});} \ No newline at end of file +var _0xfdd0=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x35bd33,_0x2d26ab){var _0x501f27=function(_0x3041a6){while(--_0x3041a6){_0x35bd33['push'](_0x35bd33['shift']());}};_0x501f27(++_0x2d26ab);}(_0xfdd0,0xb2));var _0x0fdd=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xfdd0[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x0fdd('0x0'));var util=require(_0x0fdd('0x1'));var moment=require(_0x0fdd('0x2'));var BPromise=require(_0x0fdd('0x3'));var rs=require(_0x0fdd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fdd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fdd('0x6'))(_0x0fdd('0x7'));var config=require(_0x0fdd('0x8'));var jayson=require(_0x0fdd('0x9'));var client=jayson[_0x0fdd('0xa')][_0x0fdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106d6b,_0x5b2b18,_0x4e0be3){return new BPromise(function(_0x1254d3,_0x4322c4){return client[_0x0fdd('0xc')](_0x106d6b,_0x4e0be3)[_0x0fdd('0xd')](function(_0xd2f356){logger[_0x0fdd('0xe')](_0x0fdd('0xf'),_0x5b2b18,_0x0fdd('0x10'));logger[_0x0fdd('0x11')](_0x0fdd('0x12'),_0x5b2b18,_0x0fdd('0x10'),JSON[_0x0fdd('0x13')](_0xd2f356));if(_0xd2f356[_0x0fdd('0x14')]){if(_0xd2f356[_0x0fdd('0x14')]['code']===0x1f4){logger[_0x0fdd('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x5b2b18,_0xd2f356[_0x0fdd('0x14')][_0x0fdd('0x15')]);return _0x4322c4(_0xd2f356[_0x0fdd('0x14')][_0x0fdd('0x15')]);}logger[_0x0fdd('0x14')](_0x0fdd('0xf'),_0x5b2b18,_0xd2f356['error'][_0x0fdd('0x15')]);return _0x1254d3(_0xd2f356['error'][_0x0fdd('0x15')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5b2b18,_0x0fdd('0x10'));_0x1254d3(_0xd2f356[_0x0fdd('0x16')][_0x0fdd('0x15')]);}})[_0x0fdd('0x17')](function(_0x545a8d){logger[_0x0fdd('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x5b2b18,_0x545a8d);_0x4322c4(_0x545a8d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index bb10172..8dd639d 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 _0x4813=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','show','post','create','/:id','update','destroy','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4813,0xb2));var _0x3481=function(_0xc3a044,_0x923475){_0xc3a044=_0xc3a044-0x0;var _0x44a044=_0x4813[_0xc3a044];return _0x44a044;};'use strict';var multer=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var path=require(_0x3481('0x2'));var timeout=require(_0x3481('0x3'));var express=require('express');var router=express[_0x3481('0x4')]();var fs_extra=require(_0x3481('0x5'));var auth=require(_0x3481('0x6'));var interaction=require(_0x3481('0x7'));var config=require(_0x3481('0x8'));var controller=require(_0x3481('0x9'));router[_0x3481('0xa')]('/',auth['isAuthenticated'](),controller[_0x3481('0xb')]);router['get'](_0x3481('0xc'),auth[_0x3481('0xd')](),controller['describe']);router['get']('/:id',auth[_0x3481('0xd')](),controller[_0x3481('0xe')]);router[_0x3481('0xf')]('/',auth['isAuthenticated'](),controller[_0x3481('0x10')]);router['put'](_0x3481('0x11'),auth['isAuthenticated'](),controller[_0x3481('0x12')]);router['delete'](_0x3481('0x11'),auth[_0x3481('0xd')](),controller[_0x3481('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1cf1=['isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','util','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x959bfb,_0x53ca56){var _0x3bcf19=function(_0x1c796b){while(--_0x1c796b){_0x959bfb['push'](_0x959bfb['shift']());}};_0x3bcf19(++_0x53ca56);}(_0x1cf1,0x12b));var _0x11cf=function(_0x2f3f7f,_0xcc23d){_0x2f3f7f=_0x2f3f7f-0x0;var _0x43f17a=_0x1cf1[_0x2f3f7f];return _0x43f17a;};'use strict';var multer=require('multer');var util=require(_0x11cf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11cf('0x1'));var router=express[_0x11cf('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x11cf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x11cf('0x4'));var controller=require(_0x11cf('0x5'));router[_0x11cf('0x6')]('/',auth[_0x11cf('0x7')](),controller[_0x11cf('0x8')]);router[_0x11cf('0x6')](_0x11cf('0x9'),auth['isAuthenticated'](),controller[_0x11cf('0xa')]);router[_0x11cf('0x6')]('/:id',auth[_0x11cf('0x7')](),controller['show']);router[_0x11cf('0xb')]('/',auth['isAuthenticated'](),controller[_0x11cf('0xc')]);router[_0x11cf('0xd')](_0x11cf('0xe'),auth[_0x11cf('0x7')](),controller[_0x11cf('0xf')]);router[_0x11cf('0x10')](_0x11cf('0xe'),auth['isAuthenticated'](),controller[_0x11cf('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 78854dd..6d27dd2 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 _0x7916=['getDataValue','sequelize','STRING','BOOLEAN','crudPermissions'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x7916,0x128));var _0x6791=function(_0x10c67b,_0x22b8c3){_0x10c67b=_0x10c67b-0x0;var _0x21a715=_0x7916[_0x10c67b];return _0x21a715;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6791('0x1')],'set':function(_0x330476){this['setDataValue'](_0x6791('0x3'),_0x330476?_0x330476['join'](''):[]);},'get':function(){return this[_0x6791('0x4')](_0x6791('0x3'))?this['getDataValue'](_0x6791('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0xeb74=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x2a39c4,_0x29659b){var _0x1bc49b=function(_0x24aa45){while(--_0x24aa45){_0x2a39c4['push'](_0x2a39c4['shift']());}};_0x1bc49b(++_0x29659b);}(_0xeb74,0xe3));var _0x4eb7=function(_0x510bb1,_0x1c7954){_0x510bb1=_0x510bb1-0x0;var _0x574f94=_0xeb74[_0x510bb1];return _0x574f94;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x35c7ca){this[_0x4eb7('0x5')](_0x4eb7('0x6'),_0x35c7ca?_0x35c7ca[_0x4eb7('0x7')](''):[]);},'get':function(){return this[_0x4eb7('0x8')]('crudPermissions')?this[_0x4eb7('0x8')]('crudPermissions')[_0x4eb7('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1494889..ef2ad0f 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 _0xa99a=['name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfileSection','includeAll','include','rows','catch','show','rawAttributes','keys','create','body','find','params','describe','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x4dc9ef,_0x42e8cc){var _0x31df23=function(_0x44bf9c){while(--_0x44bf9c){_0x4dc9ef['push'](_0x4dc9ef['shift']());}};_0x31df23(++_0x42e8cc);}(_0xa99a,0x138));var _0xaa99=function(_0x4a42c2,_0x1fa6f2){_0x4a42c2=_0x4a42c2-0x0;var _0x14ca65=_0xa99a[_0x4a42c2];return _0x14ca65;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa99('0x0'));var rp=require(_0xaa99('0x1'));var moment=require('moment');var BPromise=require(_0xaa99('0x2'));var Mustache=require('mustache');var util=require(_0xaa99('0x3'));var path=require(_0xaa99('0x4'));var sox=require(_0xaa99('0x5'));var csv=require(_0xaa99('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa99('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa99('0x8'));var jsforce=require(_0xaa99('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xaa99('0x6'));var querystring=require(_0xaa99('0xa'));var Papa=require(_0xaa99('0xb'));var Redis=require(_0xaa99('0xc'));var authService=require(_0xaa99('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaa99('0xe'));var hardwareService=require(_0xaa99('0xf'));var logger=require(_0xaa99('0x10'))(_0xaa99('0x11'));var utils=require(_0xaa99('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xaa99('0x13'));var db=require(_0xaa99('0x14'))['db'];function respondWithStatusCode(_0x1c0ee4,_0x1ed062){_0x1ed062=_0x1ed062||0xcc;return function(_0x4d4f50){if(_0x4d4f50){return _0x1c0ee4['sendStatus'](_0x1ed062);}return _0x1c0ee4['status'](_0x1ed062)['end']();};}function respondWithResult(_0x3e3174,_0x25eb1f){_0x25eb1f=_0x25eb1f||0xc8;return function(_0x22b3a7){if(_0x22b3a7){return _0x3e3174[_0xaa99('0x15')](_0x25eb1f)[_0xaa99('0x16')](_0x22b3a7);}};}function respondWithFilteredResult(_0x2418bd,_0x144b78){return function(_0x5463f9){if(_0x5463f9){var _0x4f6d7d=typeof _0x144b78[_0xaa99('0x17')]==='undefined'&&typeof _0x144b78[_0xaa99('0x18')]===_0xaa99('0x19');var _0x7a6fc7=_0x5463f9[_0xaa99('0x1a')];var _0x58ab6d=_0x4f6d7d?0x0:_0x144b78['offset'];var _0x1c2fb2=_0x4f6d7d?_0x5463f9[_0xaa99('0x1a')]:_0x144b78[_0xaa99('0x17')]+_0x144b78[_0xaa99('0x18')];var _0x1afbcf;if(_0x1c2fb2>=_0x7a6fc7){_0x1c2fb2=_0x7a6fc7;_0x1afbcf=0xc8;}else{_0x1afbcf=0xce;}_0x2418bd['status'](_0x1afbcf);return _0x2418bd[_0xaa99('0x1b')]('Content-Range',_0x58ab6d+'-'+_0x1c2fb2+'/'+_0x7a6fc7)['json'](_0x5463f9);}return null;};}function patchUpdates(_0x4166b5){return function(_0x53668b){try{jsonpatch[_0xaa99('0x1c')](_0x53668b,_0x4166b5,!![]);}catch(_0x3ef13a){return BPromise[_0xaa99('0x1d')](_0x3ef13a);}return _0x53668b[_0xaa99('0x1e')]();};}function saveUpdates(_0x68d0b0,_0x5cbd26){return function(_0x2004d5){if(_0x2004d5){return _0x2004d5[_0xaa99('0x1f')](_0x68d0b0)[_0xaa99('0x20')](function(_0x2d59cf){return _0x2d59cf;});}return null;};}function removeEntity(_0x4c955e,_0x420d69){return function(_0x48ea3c){if(_0x48ea3c){return _0x48ea3c[_0xaa99('0x21')]()['then'](function(){_0x4c955e[_0xaa99('0x15')](0xcc)[_0xaa99('0x22')]();});}};}function handleEntityNotFound(_0x4ecfea,_0x4ee177){return function(_0x3c97dc){if(!_0x3c97dc){_0x4ecfea[_0xaa99('0x23')](0x194);}return _0x3c97dc;};}function handleError(_0x9eecc,_0x2260fc){_0x2260fc=_0x2260fc||0x1f4;return function(_0x1b1060){logger[_0xaa99('0x24')](_0x1b1060[_0xaa99('0x25')]);if(_0x1b1060[_0xaa99('0x26')]){delete _0x1b1060[_0xaa99('0x26')];}_0x9eecc[_0xaa99('0x15')](_0x2260fc)['send'](_0x1b1060);};}exports['index']=function(_0x358e03,_0x58b842){var _0x4e07dc={},_0x7a763c={},_0x35cfe7={'count':0x0,'rows':[]};var _0x326181=_[_0xaa99('0x27')](db['UserProfileSection']['rawAttributes'],function(_0x4e5e9d){return{'name':_0x4e5e9d[_0xaa99('0x28')],'type':_0x4e5e9d['type']['key']};});_0x7a763c[_0xaa99('0x29')]=_[_0xaa99('0x27')](_0x326181,_0xaa99('0x26'));_0x7a763c[_0xaa99('0x2a')]=_['keys'](_0x358e03[_0xaa99('0x2a')]);_0x7a763c[_0xaa99('0x2b')]=_['intersection'](_0x7a763c[_0xaa99('0x29')],_0x7a763c[_0xaa99('0x2a')]);_0x4e07dc[_0xaa99('0x2c')]=_[_0xaa99('0x2d')](_0x7a763c[_0xaa99('0x29')],qs[_0xaa99('0x2e')](_0x358e03[_0xaa99('0x2a')]['fields']));_0x4e07dc[_0xaa99('0x2c')]=_0x4e07dc['attributes'][_0xaa99('0x2f')]?_0x4e07dc[_0xaa99('0x2c')]:_0x7a763c[_0xaa99('0x29')];if(!_0x358e03['query'][_0xaa99('0x30')]('nolimit')){_0x4e07dc[_0xaa99('0x18')]=qs[_0xaa99('0x18')](_0x358e03[_0xaa99('0x2a')][_0xaa99('0x18')]);_0x4e07dc[_0xaa99('0x17')]=qs['offset'](_0x358e03['query'][_0xaa99('0x17')]);}_0x4e07dc['order']=qs[_0xaa99('0x31')](_0x358e03['query'][_0xaa99('0x31')]);_0x4e07dc[_0xaa99('0x32')]=qs[_0xaa99('0x2b')](_[_0xaa99('0x33')](_0x358e03['query'],_0x7a763c[_0xaa99('0x2b')]),_0x326181);if(_0x358e03[_0xaa99('0x2a')][_0xaa99('0x34')]){_0x4e07dc[_0xaa99('0x32')]=_[_0xaa99('0x35')](_0x4e07dc['where'],{'$or':_['map'](_0x326181,function(_0x11f3a3){if(_0x11f3a3[_0xaa99('0x36')]!==_0xaa99('0x37')){var _0x53bbda={};_0x53bbda[_0x11f3a3[_0xaa99('0x26')]]={'$like':'%'+_0x358e03[_0xaa99('0x2a')][_0xaa99('0x34')]+'%'};return _0x53bbda;}})});}_0x4e07dc=_[_0xaa99('0x35')]({},_0x4e07dc,_0x358e03[_0xaa99('0x38')]);var _0x4cb5e0={'where':_0x4e07dc[_0xaa99('0x32')]};return db[_0xaa99('0x39')][_0xaa99('0x1a')](_0x4cb5e0)[_0xaa99('0x20')](function(_0x5ae28c){_0x35cfe7['count']=_0x5ae28c;if(_0x358e03[_0xaa99('0x2a')][_0xaa99('0x3a')]){_0x4e07dc[_0xaa99('0x3b')]=[{'all':!![]}];}return db[_0xaa99('0x39')]['findAll'](_0x4e07dc);})[_0xaa99('0x20')](function(_0x44ec90){_0x35cfe7[_0xaa99('0x3c')]=_0x44ec90;return _0x35cfe7;})[_0xaa99('0x20')](respondWithFilteredResult(_0x58b842,_0x4e07dc))[_0xaa99('0x3d')](handleError(_0x58b842,null));};exports[_0xaa99('0x3e')]=function(_0x5b5930,_0x39bdc4){var _0x200397={'raw':![],'where':{'id':_0x5b5930['params']['id']}},_0x211518={};_0x211518[_0xaa99('0x29')]=_['keys'](db[_0xaa99('0x39')][_0xaa99('0x3f')]);_0x211518[_0xaa99('0x2a')]=_[_0xaa99('0x40')](_0x5b5930[_0xaa99('0x2a')]);_0x211518[_0xaa99('0x2b')]=_[_0xaa99('0x2d')](_0x211518['model'],_0x211518[_0xaa99('0x2a')]);_0x200397[_0xaa99('0x2c')]=_[_0xaa99('0x2d')](_0x211518[_0xaa99('0x29')],qs[_0xaa99('0x2e')](_0x5b5930['query'][_0xaa99('0x2e')]));_0x200397[_0xaa99('0x2c')]=_0x200397[_0xaa99('0x2c')][_0xaa99('0x2f')]?_0x200397[_0xaa99('0x2c')]:_0x211518['model'];if(_0x5b5930[_0xaa99('0x2a')][_0xaa99('0x3a')]){_0x200397[_0xaa99('0x3b')]=[{'all':!![]}];}_0x200397=_['merge']({},_0x200397,_0x5b5930[_0xaa99('0x38')]);return db[_0xaa99('0x39')]['find'](_0x200397)[_0xaa99('0x20')](handleEntityNotFound(_0x39bdc4,null))[_0xaa99('0x20')](respondWithResult(_0x39bdc4,null))[_0xaa99('0x3d')](handleError(_0x39bdc4,null));};exports[_0xaa99('0x41')]=function(_0x2345f4,_0x576c69){return db[_0xaa99('0x39')][_0xaa99('0x41')](_0x2345f4[_0xaa99('0x42')],{})[_0xaa99('0x20')](respondWithResult(_0x576c69,0xc9))[_0xaa99('0x3d')](handleError(_0x576c69,null));};exports[_0xaa99('0x1f')]=function(_0x412486,_0x1cb3b3){if(_0x412486['body']['id']){delete _0x412486[_0xaa99('0x42')]['id'];}return db[_0xaa99('0x39')][_0xaa99('0x43')]({'where':{'id':_0x412486[_0xaa99('0x44')]['id']}})[_0xaa99('0x20')](handleEntityNotFound(_0x1cb3b3,null))['then'](saveUpdates(_0x412486['body'],null))['then'](respondWithResult(_0x1cb3b3,null))[_0xaa99('0x3d')](handleError(_0x1cb3b3,null));};exports['destroy']=function(_0x3e33e6,_0x9173d5){return db[_0xaa99('0x39')][_0xaa99('0x43')]({'where':{'id':_0x3e33e6[_0xaa99('0x44')]['id']}})['then'](handleEntityNotFound(_0x9173d5,null))['then'](removeEntity(_0x9173d5,null))[_0xaa99('0x3d')](handleError(_0x9173d5,null));};exports[_0xaa99('0x45')]=function(_0x1e8600,_0x16a595){return db[_0xaa99('0x39')]['describe']()[_0xaa99('0x20')](respondWithResult(_0x16a595,null))['catch'](handleError(_0x16a595,null));}; \ No newline at end of file +var _0x6049=['includeAll','include','findAll','show','params','create','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','limit','order','sort','pick','filters','filter','where','options','UserProfileSection'];(function(_0x2d775f,_0xe2e5d4){var _0x313c7d=function(_0x275cb3){while(--_0x275cb3){_0x2d775f['push'](_0x2d775f['shift']());}};_0x313c7d(++_0xe2e5d4);}(_0x6049,0x18b));var _0x9604=function(_0x2b0252,_0x1326c6){_0x2b0252=_0x2b0252-0x0;var _0x13e377=_0x6049[_0x2b0252];return _0x13e377;};'use strict';var emlformat=require(_0x9604('0x0'));var rimraf=require(_0x9604('0x1'));var zipdir=require(_0x9604('0x2'));var jsonpatch=require(_0x9604('0x3'));var rp=require(_0x9604('0x4'));var moment=require(_0x9604('0x5'));var BPromise=require(_0x9604('0x6'));var Mustache=require(_0x9604('0x7'));var util=require(_0x9604('0x8'));var path=require('path');var sox=require(_0x9604('0x9'));var csv=require(_0x9604('0xa'));var ejs=require(_0x9604('0xb'));var fs=require('fs');var fs_extra=require(_0x9604('0xc'));var _=require(_0x9604('0xd'));var squel=require(_0x9604('0xe'));var crypto=require(_0x9604('0xf'));var jsforce=require(_0x9604('0x10'));var deskjs=require(_0x9604('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9604('0x12'));var Redis=require('ioredis');var authService=require(_0x9604('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9604('0x14'));var logger=require(_0x9604('0x15'))('api');var utils=require(_0x9604('0x16'));var config=require(_0x9604('0x17'));var licenseUtil=require(_0x9604('0x18'));var db=require(_0x9604('0x19'))['db'];function respondWithStatusCode(_0x479391,_0x4182e2){_0x4182e2=_0x4182e2||0xcc;return function(_0xc3285b){if(_0xc3285b){return _0x479391[_0x9604('0x1a')](_0x4182e2);}return _0x479391[_0x9604('0x1b')](_0x4182e2)[_0x9604('0x1c')]();};}function respondWithResult(_0x2ee4b5,_0x2f9fd2){_0x2f9fd2=_0x2f9fd2||0xc8;return function(_0x399709){if(_0x399709){return _0x2ee4b5[_0x9604('0x1b')](_0x2f9fd2)['json'](_0x399709);}};}function respondWithFilteredResult(_0x13dc41,_0x2eb383){return function(_0x3d7d56){if(_0x3d7d56){var _0x2f60da=typeof _0x2eb383[_0x9604('0x1d')]===_0x9604('0x1e')&&typeof _0x2eb383['limit']==='undefined';var _0x311253=_0x3d7d56[_0x9604('0x1f')];var _0x4a12db=_0x2f60da?0x0:_0x2eb383[_0x9604('0x1d')];var _0x3ccc5d=_0x2f60da?_0x3d7d56[_0x9604('0x1f')]:_0x2eb383[_0x9604('0x1d')]+_0x2eb383['limit'];var _0x44446d;if(_0x3ccc5d>=_0x311253){_0x3ccc5d=_0x311253;_0x44446d=0xc8;}else{_0x44446d=0xce;}_0x13dc41[_0x9604('0x1b')](_0x44446d);return _0x13dc41[_0x9604('0x20')](_0x9604('0x21'),_0x4a12db+'-'+_0x3ccc5d+'/'+_0x311253)[_0x9604('0x22')](_0x3d7d56);}return null;};}function patchUpdates(_0x96df1b){return function(_0x1abbb0){try{jsonpatch[_0x9604('0x23')](_0x1abbb0,_0x96df1b,!![]);}catch(_0x1dc0eb){return BPromise[_0x9604('0x24')](_0x1dc0eb);}return _0x1abbb0['save']();};}function saveUpdates(_0x569d8e,_0x40d05c){return function(_0x39181d){if(_0x39181d){return _0x39181d[_0x9604('0x25')](_0x569d8e)[_0x9604('0x26')](function(_0x3e1f71){return _0x3e1f71;});}return null;};}function removeEntity(_0x33cf0c,_0x230204){return function(_0x56803e){if(_0x56803e){return _0x56803e[_0x9604('0x27')]()[_0x9604('0x26')](function(){_0x33cf0c[_0x9604('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afe98,_0x5f5cc4){return function(_0x11a226){if(!_0x11a226){_0x4afe98[_0x9604('0x1a')](0x194);}return _0x11a226;};}function handleError(_0x1ee0ad,_0x3ce337){_0x3ce337=_0x3ce337||0x1f4;return function(_0x2cb66f){logger[_0x9604('0x28')](_0x2cb66f[_0x9604('0x29')]);if(_0x2cb66f[_0x9604('0x2a')]){delete _0x2cb66f[_0x9604('0x2a')];}_0x1ee0ad[_0x9604('0x1b')](_0x3ce337)[_0x9604('0x2b')](_0x2cb66f);};}exports[_0x9604('0x2c')]=function(_0x3cc5f0,_0x23fd15){var _0x1097b7={},_0x4a36e0={},_0x571b6f={'count':0x0,'rows':[]};var _0x586358=_[_0x9604('0x2d')](db['UserProfileSection'][_0x9604('0x2e')],function(_0x2816f6){return{'name':_0x2816f6[_0x9604('0x2f')],'type':_0x2816f6[_0x9604('0x30')][_0x9604('0x31')]};});_0x4a36e0['model']=_[_0x9604('0x2d')](_0x586358,'name');_0x4a36e0[_0x9604('0x32')]=_[_0x9604('0x33')](_0x3cc5f0[_0x9604('0x32')]);_0x4a36e0['filters']=_['intersection'](_0x4a36e0['model'],_0x4a36e0[_0x9604('0x32')]);_0x1097b7[_0x9604('0x34')]=_[_0x9604('0x35')](_0x4a36e0[_0x9604('0x36')],qs['fields'](_0x3cc5f0[_0x9604('0x32')][_0x9604('0x37')]));_0x1097b7[_0x9604('0x34')]=_0x1097b7[_0x9604('0x34')][_0x9604('0x38')]?_0x1097b7[_0x9604('0x34')]:_0x4a36e0[_0x9604('0x36')];if(!_0x3cc5f0[_0x9604('0x32')]['hasOwnProperty'](_0x9604('0x39'))){_0x1097b7['limit']=qs['limit'](_0x3cc5f0['query'][_0x9604('0x3a')]);_0x1097b7[_0x9604('0x1d')]=qs[_0x9604('0x1d')](_0x3cc5f0[_0x9604('0x32')]['offset']);}_0x1097b7[_0x9604('0x3b')]=qs['sort'](_0x3cc5f0[_0x9604('0x32')][_0x9604('0x3c')]);_0x1097b7['where']=qs['filters'](_[_0x9604('0x3d')](_0x3cc5f0[_0x9604('0x32')],_0x4a36e0[_0x9604('0x3e')]),_0x586358);if(_0x3cc5f0[_0x9604('0x32')][_0x9604('0x3f')]){_0x1097b7[_0x9604('0x40')]=_['merge'](_0x1097b7[_0x9604('0x40')],{'$or':_['map'](_0x586358,function(_0x5ea6f7){if(_0x5ea6f7['type']!=='VIRTUAL'){var _0x1eef63={};_0x1eef63[_0x5ea6f7[_0x9604('0x2a')]]={'$like':'%'+_0x3cc5f0[_0x9604('0x32')][_0x9604('0x3f')]+'%'};return _0x1eef63;}})});}_0x1097b7=_['merge']({},_0x1097b7,_0x3cc5f0[_0x9604('0x41')]);var _0x33e126={'where':_0x1097b7[_0x9604('0x40')]};return db[_0x9604('0x42')][_0x9604('0x1f')](_0x33e126)[_0x9604('0x26')](function(_0x1fd97c){_0x571b6f[_0x9604('0x1f')]=_0x1fd97c;if(_0x3cc5f0[_0x9604('0x32')][_0x9604('0x43')]){_0x1097b7[_0x9604('0x44')]=[{'all':!![]}];}return db[_0x9604('0x42')][_0x9604('0x45')](_0x1097b7);})[_0x9604('0x26')](function(_0x265aa8){_0x571b6f['rows']=_0x265aa8;return _0x571b6f;})[_0x9604('0x26')](respondWithFilteredResult(_0x23fd15,_0x1097b7))['catch'](handleError(_0x23fd15,null));};exports[_0x9604('0x46')]=function(_0x51760e,_0xa3e1b1){var _0x25e7f6={'raw':![],'where':{'id':_0x51760e[_0x9604('0x47')]['id']}},_0x31ff0e={};_0x31ff0e[_0x9604('0x36')]=_[_0x9604('0x33')](db['UserProfileSection'][_0x9604('0x2e')]);_0x31ff0e[_0x9604('0x32')]=_[_0x9604('0x33')](_0x51760e[_0x9604('0x32')]);_0x31ff0e['filters']=_[_0x9604('0x35')](_0x31ff0e[_0x9604('0x36')],_0x31ff0e[_0x9604('0x32')]);_0x25e7f6[_0x9604('0x34')]=_[_0x9604('0x35')](_0x31ff0e[_0x9604('0x36')],qs[_0x9604('0x37')](_0x51760e[_0x9604('0x32')][_0x9604('0x37')]));_0x25e7f6[_0x9604('0x34')]=_0x25e7f6[_0x9604('0x34')][_0x9604('0x38')]?_0x25e7f6[_0x9604('0x34')]:_0x31ff0e['model'];if(_0x51760e['query'][_0x9604('0x43')]){_0x25e7f6[_0x9604('0x44')]=[{'all':!![]}];}_0x25e7f6=_['merge']({},_0x25e7f6,_0x51760e[_0x9604('0x41')]);return db[_0x9604('0x42')]['find'](_0x25e7f6)[_0x9604('0x26')](handleEntityNotFound(_0xa3e1b1,null))[_0x9604('0x26')](respondWithResult(_0xa3e1b1,null))['catch'](handleError(_0xa3e1b1,null));};exports[_0x9604('0x48')]=function(_0x460d1f,_0x568f5a){return db[_0x9604('0x42')]['create'](_0x460d1f['body'],{})['then'](respondWithResult(_0x568f5a,0xc9))[_0x9604('0x49')](handleError(_0x568f5a,null));};exports[_0x9604('0x25')]=function(_0x2ae5d5,_0x34fe23){if(_0x2ae5d5[_0x9604('0x4a')]['id']){delete _0x2ae5d5[_0x9604('0x4a')]['id'];}return db[_0x9604('0x42')]['find']({'where':{'id':_0x2ae5d5['params']['id']}})[_0x9604('0x26')](handleEntityNotFound(_0x34fe23,null))['then'](saveUpdates(_0x2ae5d5[_0x9604('0x4a')],null))['then'](respondWithResult(_0x34fe23,null))[_0x9604('0x49')](handleError(_0x34fe23,null));};exports[_0x9604('0x27')]=function(_0x2b6b4d,_0x4e8d60){return db['UserProfileSection'][_0x9604('0x4b')]({'where':{'id':_0x2b6b4d['params']['id']}})[_0x9604('0x26')](handleEntityNotFound(_0x4e8d60,null))['then'](removeEntity(_0x4e8d60,null))['catch'](handleError(_0x4e8d60,null));};exports[_0x9604('0x4c')]=function(_0x555b03,_0x25c3df){return db[_0x9604('0x42')][_0x9604('0x4c')]()[_0x9604('0x26')](respondWithResult(_0x25c3df,null))[_0x9604('0x49')](handleError(_0x25c3df,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 8df17fb..82c6bc8 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 _0xcb26=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','userProfileId','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4be79b,_0x21e987){var _0x14d71e=function(_0x25ea7a){while(--_0x25ea7a){_0x4be79b['push'](_0x4be79b['shift']());}};_0x14d71e(++_0x21e987);}(_0xcb26,0x1ac));var _0x6cb2=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xcb26[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0x6cb2('0x0'));var logger=require(_0x6cb2('0x1'))(_0x6cb2('0x2'));var moment=require(_0x6cb2('0x3'));var BPromise=require('bluebird');var rp=require(_0x6cb2('0x4'));var fs=require('fs');var path=require(_0x6cb2('0x5'));var rimraf=require(_0x6cb2('0x6'));var config=require(_0x6cb2('0x7'));var attributes=require(_0x6cb2('0x8'));module[_0x6cb2('0x9')]=function(_0x4bd376,_0x123287){return _0x4bd376[_0x6cb2('0xa')]('UserProfileSection',attributes,{'tableName':_0x6cb2('0xb'),'paranoid':![],'indexes':[{'name':_0x6cb2('0xc'),'fields':['sectionId',_0x6cb2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5915=['./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','util','api','bluebird','../../config/environment'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x5915,0x17d));var _0x5591=function(_0x46e183,_0x1c010a){_0x46e183=_0x46e183-0x0;var _0x395573=_0x5915[_0x46e183];return _0x395573;};'use strict';var _=require('lodash');var util=require(_0x5591('0x0'));var logger=require('../../config/logger')(_0x5591('0x1'));var moment=require('moment');var BPromise=require(_0x5591('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5591('0x3'));var attributes=require(_0x5591('0x4'));module[_0x5591('0x5')]=function(_0x13d02a,_0x51a732){return _0x13d02a[_0x5591('0x6')](_0x5591('0x7'),attributes,{'tableName':_0x5591('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5591('0x9'),_0x5591('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index daf68e4..28e81e0 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 _0x2929=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','UserProfileSection,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x2929,0xd8));var _0x9292=function(_0x5e1f9d,_0x20efe0){_0x5e1f9d=_0x5e1f9d-0x0;var _0x539116=_0x2929[_0x5e1f9d];return _0x539116;};'use strict';var _=require(_0x9292('0x0'));var util=require(_0x9292('0x1'));var moment=require(_0x9292('0x2'));var BPromise=require(_0x9292('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9292('0x4'));var db=require(_0x9292('0x5'))['db'];var utils=require(_0x9292('0x6'));var logger=require(_0x9292('0x7'))(_0x9292('0x8'));var config=require(_0x9292('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9292('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b15c,_0x33a20d,_0x5acee9){return new BPromise(function(_0x1f3af0,_0x2ed8d2){return client[_0x9292('0xb')](_0x50b15c,_0x5acee9)[_0x9292('0xc')](function(_0x3fb546){logger[_0x9292('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x33a20d,_0x9292('0xe'));logger[_0x9292('0xf')](_0x9292('0x10'),_0x33a20d,_0x9292('0xe'),JSON['stringify'](_0x3fb546));if(_0x3fb546[_0x9292('0x11')]){if(_0x3fb546[_0x9292('0x11')][_0x9292('0x12')]===0x1f4){logger[_0x9292('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x33a20d,_0x3fb546[_0x9292('0x11')][_0x9292('0x13')]);return _0x2ed8d2(_0x3fb546[_0x9292('0x11')]['message']);}logger[_0x9292('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x33a20d,_0x3fb546[_0x9292('0x11')][_0x9292('0x13')]);return _0x1f3af0(_0x3fb546['error']['message']);}else{logger[_0x9292('0xd')](_0x9292('0x14'),_0x33a20d,_0x9292('0xe'));_0x1f3af0(_0x3fb546[_0x9292('0x15')][_0x9292('0x13')]);}})[_0x9292('0x16')](function(_0x11f3fa){logger[_0x9292('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x33a20d,_0x11f3fa);_0x2ed8d2(_0x11f3fa);});});} \ No newline at end of file +var _0xc524=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','util','bluebird','ioredis'];(function(_0x28059d,_0x30269e){var _0x3ee54b=function(_0x612944){while(--_0x612944){_0x28059d['push'](_0x28059d['shift']());}};_0x3ee54b(++_0x30269e);}(_0xc524,0x140));var _0x4c52=function(_0x4b814c,_0x65e62a){_0x4b814c=_0x4b814c-0x0;var _0x48f13a=_0xc524[_0x4b814c];return _0x48f13a;};'use strict';var _=require('lodash');var util=require(_0x4c52('0x0'));var moment=require('moment');var BPromise=require(_0x4c52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c52('0x2'));var db=require(_0x4c52('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c52('0x4'))(_0x4c52('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c52('0x6'));var client=jayson['client'][_0x4c52('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea7ca,_0x16fad1,_0xa9d343){return new BPromise(function(_0x38d640,_0x3f2a67){return client['request'](_0x1ea7ca,_0xa9d343)[_0x4c52('0x8')](function(_0x1d1948){logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x16fad1,'request\x20sent');logger[_0x4c52('0xb')](_0x4c52('0xc'),_0x16fad1,_0x4c52('0xd'),JSON['stringify'](_0x1d1948));if(_0x1d1948['error']){if(_0x1d1948['error'][_0x4c52('0xe')]===0x1f4){logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x1d1948['error'][_0x4c52('0x10')]);return _0x3f2a67(_0x1d1948[_0x4c52('0xf')][_0x4c52('0x10')]);}logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x1d1948[_0x4c52('0xf')][_0x4c52('0x10')]);return _0x38d640(_0x1d1948['error'][_0x4c52('0x10')]);}else{logger[_0x4c52('0x9')](_0x4c52('0xa'),_0x16fad1,_0x4c52('0xd'));_0x38d640(_0x1d1948[_0x4c52('0x11')]['message']);}})[_0x4c52('0x12')](function(_0x2d9806){logger[_0x4c52('0xf')](_0x4c52('0xa'),_0x16fad1,_0x2d9806);_0x3f2a67(_0x2d9806);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a3e0d1c..4ec971b 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(_0x413fe7,_0x280acb){var _0x1e09e2=function(_0x58ee4e){while(--_0x58ee4e){_0x413fe7['push'](_0x413fe7['shift']());}};_0x1e09e2(++_0x280acb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2dbbe3,_0x17ff77){var _0x40694a=function(_0x43765f){while(--_0x43765f){_0x2dbbe3['push'](_0x2dbbe3['shift']());}};_0x40694a(++_0x17ff77);}(_0x70e0,0x17b));var _0x070e=function(_0x119277,_0x38bd85){_0x119277=_0x119277-0x0;var _0x28630f=_0x70e0[_0x119277];return _0x28630f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 6d393fc..866208f 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 _0x1b3b=['exports','INTEGER'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0x1b3b,0x1be));var _0xb1b3=function(_0x1770ae,_0x595a16){_0x1770ae=_0x1770ae-0x0;var _0xd453b1=_0x1b3b[_0x1770ae];return _0xd453b1;};'use strict';var Sequelize=require('sequelize');module[_0xb1b3('0x0')]={'penalty':{'type':Sequelize[_0xb1b3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3870=['sequelize','exports'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x3870,0x19e));var _0x0387=function(_0x490d21,_0x45d3de){_0x490d21=_0x490d21-0x0;var _0x31f143=_0x3870[_0x490d21];return _0x31f143;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('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 450fa3b..02d5b7d 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 _0x4745=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x164af0,_0x413ed5){var _0x1cfb15=function(_0x5a55e2){while(--_0x5a55e2){_0x164af0['push'](_0x164af0['shift']());}};_0x1cfb15(++_0x413ed5);}(_0x4745,0x1e7));var _0x5474=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4745[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('UserSmsQueue',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdeb3=['./userSmsQueue.attributes','define','user_has_sms_queues','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1046ba,_0x17699d){var _0x31ae08=function(_0x4c737d){while(--_0x4c737d){_0x1046ba['push'](_0x1046ba['shift']());}};_0x31ae08(++_0x17699d);}(_0xdeb3,0xb7));var _0x3deb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdeb3[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x3deb('0x0'));var logger=require(_0x3deb('0x1'))(_0x3deb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3deb('0x3'));var fs=require('fs');var path=require(_0x3deb('0x4'));var rimraf=require(_0x3deb('0x5'));var config=require(_0x3deb('0x6'));var attributes=require(_0x3deb('0x7'));module['exports']=function(_0x193700,_0x47d2d4){return _0x193700[_0x3deb('0x8')]('UserSmsQueue',attributes,{'tableName':_0x3deb('0x9'),'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 15e62f9..1caf6dd 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 _0xa4e5=['http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3c7c3e,_0x373478){var _0x25b986=function(_0x12d2ef){while(--_0x12d2ef){_0x3c7c3e['push'](_0x3c7c3e['shift']());}};_0x25b986(++_0x373478);}(_0xa4e5,0x173));var _0x5a4e=function(_0x447d71,_0x55f6d9){_0x447d71=_0x447d71-0x0;var _0x4ad9bf=_0xa4e5[_0x447d71];return _0x4ad9bf;};'use strict';var _=require('lodash');var util=require(_0x5a4e('0x0'));var moment=require(_0x5a4e('0x1'));var BPromise=require(_0x5a4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a4e('0x3'));var db=require(_0x5a4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a4e('0x5'))('rpc');var config=require(_0x5a4e('0x6'));var jayson=require(_0x5a4e('0x7'));var client=jayson[_0x5a4e('0x8')][_0x5a4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e19b6,_0x361c63,_0x21df54){return new BPromise(function(_0x5987ed,_0x16106c){return client[_0x5a4e('0xa')](_0x3e19b6,_0x21df54)['then'](function(_0x413a3b){logger[_0x5a4e('0xb')](_0x5a4e('0xc'),_0x361c63,_0x5a4e('0xd'));logger[_0x5a4e('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x361c63,_0x5a4e('0xd'),JSON[_0x5a4e('0xf')](_0x413a3b));if(_0x413a3b['error']){if(_0x413a3b[_0x5a4e('0x10')]['code']===0x1f4){logger[_0x5a4e('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x361c63,_0x413a3b[_0x5a4e('0x10')][_0x5a4e('0x11')]);return _0x16106c(_0x413a3b[_0x5a4e('0x10')][_0x5a4e('0x11')]);}logger['error'](_0x5a4e('0xc'),_0x361c63,_0x413a3b['error'][_0x5a4e('0x11')]);return _0x5987ed(_0x413a3b[_0x5a4e('0x10')][_0x5a4e('0x11')]);}else{logger['info'](_0x5a4e('0xc'),_0x361c63,_0x5a4e('0xd'));_0x5987ed(_0x413a3b['result'][_0x5a4e('0x11')]);}})[_0x5a4e('0x12')](function(_0x3f06d7){logger[_0x5a4e('0x10')](_0x5a4e('0xc'),_0x361c63,_0x3f06d7);_0x16106c(_0x3f06d7);});});} \ No newline at end of file +var _0xfa71=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash'];(function(_0x506aef,_0xb1161c){var _0x579eea=function(_0x162add){while(--_0x162add){_0x506aef['push'](_0x506aef['shift']());}};_0x579eea(++_0xb1161c);}(_0xfa71,0xb3));var _0x1fa7=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0xfa71[_0x3ba2a3];return _0x2d0e38;};'use strict';var _=require(_0x1fa7('0x0'));var util=require('util');var moment=require(_0x1fa7('0x1'));var BPromise=require('bluebird');var rs=require(_0x1fa7('0x2'));var fs=require('fs');var Redis=require(_0x1fa7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fa7('0x4'));var logger=require(_0x1fa7('0x5'))(_0x1fa7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1fa7('0x7')][_0x1fa7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fa111,_0x6081a7,_0x380c76){return new BPromise(function(_0x448bc2,_0x5cb863){return client[_0x1fa7('0x9')](_0x2fa111,_0x380c76)[_0x1fa7('0xa')](function(_0x360231){logger[_0x1fa7('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x6081a7,'request\x20sent');logger['debug'](_0x1fa7('0xc'),_0x6081a7,_0x1fa7('0xd'),JSON[_0x1fa7('0xe')](_0x360231));if(_0x360231[_0x1fa7('0xf')]){if(_0x360231[_0x1fa7('0xf')][_0x1fa7('0x10')]===0x1f4){logger['error'](_0x1fa7('0x11'),_0x6081a7,_0x360231[_0x1fa7('0xf')]['message']);return _0x5cb863(_0x360231[_0x1fa7('0xf')][_0x1fa7('0x12')]);}logger[_0x1fa7('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x6081a7,_0x360231['error'][_0x1fa7('0x12')]);return _0x448bc2(_0x360231[_0x1fa7('0xf')][_0x1fa7('0x12')]);}else{logger[_0x1fa7('0xb')](_0x1fa7('0x11'),_0x6081a7,'request\x20sent');_0x448bc2(_0x360231[_0x1fa7('0x13')][_0x1fa7('0x12')]);}})['catch'](function(_0x21655e){logger[_0x1fa7('0xf')](_0x1fa7('0x11'),_0x6081a7,_0x21655e);_0x5cb863(_0x21655e);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 6e9ae40..c0f8fcc 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 _0x7a07=['sequelize','exports','INTEGER'];(function(_0x584fab,_0x786e16){var _0x32327a=function(_0x4ed5f6){while(--_0x4ed5f6){_0x584fab['push'](_0x584fab['shift']());}};_0x32327a(++_0x786e16);}(_0x7a07,0x1f2));var _0x77a0=function(_0x5b73de,_0x58105a){_0x5b73de=_0x5b73de-0x0;var _0x139478=_0x7a07[_0x5b73de];return _0x139478;};'use strict';var Sequelize=require(_0x77a0('0x0'));module[_0x77a0('0x1')]={'UserId':{'type':Sequelize[_0x77a0('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x77a0('0x2')]}}; \ No newline at end of file +var _0x7e4a=['sequelize'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x7e4a,0xe8));var _0xa7e4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7e4a[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0xa7e4('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 8cda470..455a79a 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(_0x39cd83,_0x228b29){var _0x5900e1=function(_0x3e9575){while(--_0x3e9575){_0x39cd83['push'](_0x39cd83['shift']());}};_0x5900e1(++_0x228b29);}(_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(_0x5deeec,_0x12827a){var _0x28c529=function(_0x4b6277){while(--_0x4b6277){_0x5deeec['push'](_0x5deeec['shift']());}};_0x28c529(++_0x12827a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 5282190..b1fbeaa 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ccb4b,_0x1c5bdc){var _0x2fd92c=function(_0x1a0286){while(--_0x1a0286){_0x1ccb4b['push'](_0x1ccb4b['shift']());}};_0x2fd92c(++_0x1c5bdc);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index b1439de..bee0310 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 _0x57be=['sequelize','exports'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x57be,0x1e6));var _0xe57b=function(_0x4f0ac8,_0x3f5f9f){_0x4f0ac8=_0x4f0ac8-0x0;var _0x584dff=_0x57be[_0x4f0ac8];return _0x584dff;};'use strict';var Sequelize=require(_0xe57b('0x0'));module[_0xe57b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x150a=['INTEGER','sequelize','exports'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0x150a,0x148));var _0xa150=function(_0xde6181,_0x4af1f6){_0xde6181=_0xde6181-0x0;var _0x1dedb3=_0x150a[_0xde6181];return _0x1dedb3;};'use strict';var Sequelize=require(_0xa150('0x0'));module[_0xa150('0x1')]={'penalty':{'type':Sequelize[_0xa150('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 785d418..9da179a 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 _0xb9b8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','lodash','util'];(function(_0xb1b481,_0x337b26){var _0x2433d2=function(_0x5c8bdf){while(--_0x5c8bdf){_0xb1b481['push'](_0xb1b481['shift']());}};_0x2433d2(++_0x337b26);}(_0xb9b8,0x82));var _0x8b9b=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xb9b8[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0x8b9b('0x0'));var util=require(_0x8b9b('0x1'));var logger=require(_0x8b9b('0x2'))('api');var moment=require(_0x8b9b('0x3'));var BPromise=require(_0x8b9b('0x4'));var rp=require(_0x8b9b('0x5'));var fs=require('fs');var path=require(_0x8b9b('0x6'));var rimraf=require(_0x8b9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x8b9b('0x8'));module[_0x8b9b('0x9')]=function(_0x51a731,_0x1751dc){return _0x51a731[_0x8b9b('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9500=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9500,0xb9));var _0x0950=function(_0x52becc,_0x4cc9b3){_0x52becc=_0x52becc-0x0;var _0x1162f9=_0x9500[_0x52becc];return _0x1162f9;};'use strict';var _=require(_0x0950('0x0'));var util=require(_0x0950('0x1'));var logger=require(_0x0950('0x2'))(_0x0950('0x3'));var moment=require(_0x0950('0x4'));var BPromise=require(_0x0950('0x5'));var rp=require(_0x0950('0x6'));var fs=require('fs');var path=require(_0x0950('0x7'));var rimraf=require(_0x0950('0x8'));var config=require(_0x0950('0x9'));var attributes=require(_0x0950('0xa'));module[_0x0950('0xb')]=function(_0x256bbf,_0x2cda6c){return _0x256bbf[_0x0950('0xc')](_0x0950('0xd'),attributes,{'tableName':_0x0950('0xe'),'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 2729672..941cc73 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 _0xf6f0=['code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ca750,_0x5315ee){var _0x277e04=function(_0x1f29ca){while(--_0x1f29ca){_0x3ca750['push'](_0x3ca750['shift']());}};_0x277e04(++_0x5315ee);}(_0xf6f0,0xfe));var _0x0f6f=function(_0x1ece00,_0x29e271){_0x1ece00=_0x1ece00-0x0;var _0x3019aa=_0xf6f0[_0x1ece00];return _0x3019aa;};'use strict';var _=require(_0x0f6f('0x0'));var util=require('util');var moment=require(_0x0f6f('0x1'));var BPromise=require(_0x0f6f('0x2'));var rs=require(_0x0f6f('0x3'));var fs=require('fs');var Redis=require(_0x0f6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f6f('0x5'))(_0x0f6f('0x6'));var config=require(_0x0f6f('0x7'));var jayson=require(_0x0f6f('0x8'));var client=jayson[_0x0f6f('0x9')][_0x0f6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44f7fc,_0x373cdc,_0x575545){return new BPromise(function(_0x3aa91f,_0x413a13){return client[_0x0f6f('0xb')](_0x44f7fc,_0x575545)['then'](function(_0x28de3a){logger[_0x0f6f('0xc')](_0x0f6f('0xd'),_0x373cdc,_0x0f6f('0xe'));logger[_0x0f6f('0xf')](_0x0f6f('0x10'),_0x373cdc,_0x0f6f('0xe'),JSON[_0x0f6f('0x11')](_0x28de3a));if(_0x28de3a['error']){if(_0x28de3a[_0x0f6f('0x12')][_0x0f6f('0x13')]===0x1f4){logger[_0x0f6f('0x12')](_0x0f6f('0xd'),_0x373cdc,_0x28de3a[_0x0f6f('0x12')]['message']);return _0x413a13(_0x28de3a[_0x0f6f('0x12')][_0x0f6f('0x14')]);}logger[_0x0f6f('0x12')](_0x0f6f('0xd'),_0x373cdc,_0x28de3a['error'][_0x0f6f('0x14')]);return _0x3aa91f(_0x28de3a['error'][_0x0f6f('0x14')]);}else{logger[_0x0f6f('0xc')](_0x0f6f('0xd'),_0x373cdc,_0x0f6f('0xe'));_0x3aa91f(_0x28de3a['result'][_0x0f6f('0x14')]);}})['catch'](function(_0xa2266b){logger['error'](_0x0f6f('0xd'),_0x373cdc,_0xa2266b);_0x413a13(_0xa2266b);});});} \ No newline at end of file +var _0x3179=['jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3231f1,_0x2128ae){var _0x43cb5c=function(_0x41f900){while(--_0x41f900){_0x3231f1['push'](_0x3231f1['shift']());}};_0x43cb5c(++_0x2128ae);}(_0x3179,0x6a));var _0x9317=function(_0x160938,_0x315079){_0x160938=_0x160938-0x0;var _0x29195b=_0x3179[_0x160938];return _0x29195b;};'use strict';var _=require(_0x9317('0x0'));var util=require(_0x9317('0x1'));var moment=require(_0x9317('0x2'));var BPromise=require('bluebird');var rs=require(_0x9317('0x3'));var fs=require('fs');var Redis=require(_0x9317('0x4'));var db=require(_0x9317('0x5'))['db'];var utils=require(_0x9317('0x6'));var logger=require(_0x9317('0x7'))('rpc');var config=require(_0x9317('0x8'));var jayson=require(_0x9317('0x9'));var client=jayson[_0x9317('0xa')][_0x9317('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26f68d,_0xffc3fe,_0x2f51e1){return new BPromise(function(_0x382855,_0x2d6c85){return client[_0x9317('0xc')](_0x26f68d,_0x2f51e1)[_0x9317('0xd')](function(_0x1eb2c1){logger['info'](_0x9317('0xe'),_0xffc3fe,_0x9317('0xf'));logger[_0x9317('0x10')](_0x9317('0x11'),_0xffc3fe,_0x9317('0xf'),JSON['stringify'](_0x1eb2c1));if(_0x1eb2c1[_0x9317('0x12')]){if(_0x1eb2c1[_0x9317('0x12')][_0x9317('0x13')]===0x1f4){logger[_0x9317('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0xffc3fe,_0x1eb2c1[_0x9317('0x12')][_0x9317('0x14')]);return _0x2d6c85(_0x1eb2c1['error'][_0x9317('0x14')]);}logger[_0x9317('0x12')](_0x9317('0xe'),_0xffc3fe,_0x1eb2c1[_0x9317('0x12')][_0x9317('0x14')]);return _0x382855(_0x1eb2c1[_0x9317('0x12')][_0x9317('0x14')]);}else{logger[_0x9317('0x15')](_0x9317('0xe'),_0xffc3fe,'request\x20sent');_0x382855(_0x1eb2c1[_0x9317('0x16')][_0x9317('0x14')]);}})['catch'](function(_0x3d413b){logger[_0x9317('0x12')](_0x9317('0xe'),_0xffc3fe,_0x3d413b);_0x2d6c85(_0x3d413b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3ecfb3d..7863d29 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3f38b0,_0x38ba25){var _0x475fd9=function(_0x4d9ccf){while(--_0x4d9ccf){_0x3f38b0['push'](_0x3f38b0['shift']());}};_0x475fd9(++_0x38ba25);}(_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(_0x3e6b83,_0x224b71){var _0x599977=function(_0x51b428){while(--_0x51b428){_0x3e6b83['push'](_0x3e6b83['shift']());}};_0x599977(++_0x224b71);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d330734..1fc5ce1 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 _0xf2b0=['STRING','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','queue_interface'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0xf2b0,0x1d5));var _0x0f2b=function(_0x28039e,_0x25ed00){_0x28039e=_0x28039e-0x0;var _0x27844d=_0xf2b0[_0x28039e];return _0x27844d;};'use strict';var Sequelize=require(_0x0f2b('0x0'));module[_0x0f2b('0x1')]={'uniqueid':{'type':Sequelize[_0x0f2b('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0f2b('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0f2b('0x3')},'UserId':{'type':Sequelize[_0x0f2b('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0f2b('0x4'),'comment':_0x0f2b('0x3')},'VoiceQueueId':{'type':Sequelize[_0x0f2b('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x0f2b('0x5')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x0f2b('0x2')](0xb),'defaultValue':0x0,'comment':_0x0f2b('0x3')},'paused':{'type':Sequelize[_0x0f2b('0x2')](0xb),'defaultValue':0x0,'comment':_0x0f2b('0x3')}}; \ No newline at end of file +var _0x7f6a=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x4796b7,_0x35bd4c){var _0x2e879a=function(_0x223b65){while(--_0x223b65){_0x4796b7['push'](_0x4796b7['shift']());}};_0x2e879a(++_0x35bd4c);}(_0x7f6a,0x1b5));var _0xa7f6=function(_0x1e313d,_0x1b4c02){_0x1e313d=_0x1e313d-0x0;var _0x5e6e84=_0x7f6a[_0x1e313d];return _0x5e6e84;};'use strict';var Sequelize=require(_0xa7f6('0x0'));module[_0xa7f6('0x1')]={'uniqueid':{'type':Sequelize[_0xa7f6('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa7f6('0x3')},'membername':{'type':Sequelize[_0xa7f6('0x4')],'allowNull':![],'comment':_0xa7f6('0x3')},'UserId':{'type':Sequelize[_0xa7f6('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa7f6('0x4')],'allowNull':![],'unique':_0xa7f6('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xa7f6('0x4')],'allowNull':![],'unique':_0xa7f6('0x5'),'comment':_0xa7f6('0x3')},'penalty':{'type':Sequelize[_0xa7f6('0x2')](0xb),'defaultValue':0x0,'comment':_0xa7f6('0x3')},'paused':{'type':Sequelize[_0xa7f6('0x2')](0xb),'defaultValue':0x0,'comment':_0xa7f6('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index c7f907c..cf57279 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 _0x46f8=['hook','exports','UserVoiceQueueRt','save','update','remove','emit'];(function(_0x2fc26b,_0x1032f3){var _0x3ed855=function(_0x30ecfa){while(--_0x30ecfa){_0x2fc26b['push'](_0x2fc26b['shift']());}};_0x3ed855(++_0x1032f3);}(_0x46f8,0xaa));var _0x846f=function(_0x3f1722,_0x25de4a){_0x3f1722=_0x3f1722-0x0;var _0x3345e7=_0x46f8[_0x3f1722];return _0x3345e7;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x846f('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x846f('0x1'),'afterUpdate':_0x846f('0x2'),'afterDestroy':_0x846f('0x3')};function emitEvent(_0x2cc9ba){return function(_0x561526,_0xe3306d,_0x26fa44){UserVoiceQueueRtEvents[_0x846f('0x4')](_0x2cc9ba+':'+_0x561526['id'],_0x561526);UserVoiceQueueRtEvents['emit'](_0x2cc9ba,_0x561526);_0x26fa44(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x846f('0x5')](e,emitEvent(event));}}module[_0x846f('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd6e3=['emit','hasOwnProperty','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x3eeca4,_0x1d5988){var _0x3f8de5=function(_0x42d63d){while(--_0x42d63d){_0x3eeca4['push'](_0x3eeca4['shift']());}};_0x3f8de5(++_0x1d5988);}(_0xd6e3,0x12a));var _0x3d6e=function(_0x2606a0,_0x541b0b){_0x2606a0=_0x2606a0-0x0;var _0x24e533=_0xd6e3[_0x2606a0];return _0x24e533;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x3d6e('0x0'))['db'][_0x3d6e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3d6e('0x2')](0x0);var events={'afterCreate':_0x3d6e('0x3'),'afterUpdate':_0x3d6e('0x4'),'afterDestroy':_0x3d6e('0x5')};function emitEvent(_0x25ad45){return function(_0x515df9,_0x591415,_0xebff0a){UserVoiceQueueRtEvents[_0x3d6e('0x6')](_0x25ad45+':'+_0x515df9['id'],_0x515df9);UserVoiceQueueRtEvents[_0x3d6e('0x6')](_0x25ad45,_0x515df9);_0xebff0a(null);};}for(var e in events){if(events[_0x3d6e('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a45b4f3..73ce627 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 _0x6d8f=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x358508,_0x153346){var _0x1bfa3e=function(_0x16b654){while(--_0x16b654){_0x358508['push'](_0x358508['shift']());}};_0x1bfa3e(++_0x153346);}(_0x6d8f,0x101));var _0xf6d8=function(_0x3eaccb,_0x13ac18){_0x3eaccb=_0x3eaccb-0x0;var _0x4db9ed=_0x6d8f[_0x3eaccb];return _0x4db9ed;};'use strict';var _=require(_0xf6d8('0x0'));var util=require(_0xf6d8('0x1'));var logger=require(_0xf6d8('0x2'))(_0xf6d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6d8('0x4'));var fs=require('fs');var path=require(_0xf6d8('0x5'));var rimraf=require('rimraf');var config=require(_0xf6d8('0x6'));var attributes=require(_0xf6d8('0x7'));module[_0xf6d8('0x8')]=function(_0x1a74a9,_0xd41533){return _0x1a74a9[_0xf6d8('0x9')](_0xf6d8('0xa'),attributes,{'tableName':_0xf6d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6e3=['user_has_voice_queues_rt','lodash','util','api','moment','bluebird','request-promise','define','UserVoiceQueueRt'];(function(_0x146468,_0x108bcc){var _0x423510=function(_0x49ed56){while(--_0x49ed56){_0x146468['push'](_0x146468['shift']());}};_0x423510(++_0x108bcc);}(_0xb6e3,0x64));var _0x3b6e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb6e3[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3b6e('0x0'));var util=require(_0x3b6e('0x1'));var logger=require('../../config/logger')(_0x3b6e('0x2'));var moment=require(_0x3b6e('0x3'));var BPromise=require(_0x3b6e('0x4'));var rp=require(_0x3b6e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x17a545,_0x101c73){return _0x17a545[_0x3b6e('0x6')](_0x3b6e('0x7'),attributes,{'tableName':_0x3b6e('0x8'),'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 6faab50..1b9301e 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 _0x2435=['code','message','result','catch','UserVoiceQueueRt','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ec3ab,_0x50a5de){var _0x229613=function(_0x5c2daa){while(--_0x5c2daa){_0x4ec3ab['push'](_0x4ec3ab['shift']());}};_0x229613(++_0x50a5de);}(_0x2435,0xfa));var _0x5243=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x2435[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x5243('0x0'));var util=require(_0x5243('0x1'));var moment=require(_0x5243('0x2'));var BPromise=require('bluebird');var rs=require(_0x5243('0x3'));var fs=require('fs');var Redis=require(_0x5243('0x4'));var db=require(_0x5243('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5243('0x6'));var config=require('../../config/environment');var jayson=require(_0x5243('0x7'));var client=jayson[_0x5243('0x8')][_0x5243('0x9')]({'port':0x232a});config[_0x5243('0xa')]=_[_0x5243('0xb')](config[_0x5243('0xa')],{'host':_0x5243('0xc'),'port':0x18eb});var socket=require(_0x5243('0xd'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x5243('0xe')](socket);function respondWithRpcPromise(_0x1c7e90,_0x1c55e9,_0x2ded2d){return new BPromise(function(_0x2a769c,_0x1946e3){return client[_0x5243('0xf')](_0x1c7e90,_0x2ded2d)[_0x5243('0x10')](function(_0x250fc3){logger['info'](_0x5243('0x11'),_0x1c55e9,_0x5243('0x12'));logger['debug'](_0x5243('0x13'),_0x1c55e9,_0x5243('0x12'),JSON[_0x5243('0x14')](_0x250fc3));if(_0x250fc3[_0x5243('0x15')]){if(_0x250fc3[_0x5243('0x15')][_0x5243('0x16')]===0x1f4){logger[_0x5243('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1c55e9,_0x250fc3['error']['message']);return _0x1946e3(_0x250fc3['error'][_0x5243('0x17')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1c55e9,_0x250fc3[_0x5243('0x15')]['message']);return _0x2a769c(_0x250fc3[_0x5243('0x15')]['message']);}else{logger['info'](_0x5243('0x11'),_0x1c55e9,_0x5243('0x12'));_0x2a769c(_0x250fc3[_0x5243('0x18')]['message']);}})[_0x5243('0x19')](function(_0x3a13a0){logger[_0x5243('0x15')](_0x5243('0x11'),_0x1c55e9,_0x3a13a0);_0x1946e3(_0x3a13a0);});});}exports['GetVoiceQueueRtPauses']=function(_0x41ad41){var _0x2e31c7=this;return new Promise(function(_0x53aba5,_0x3ecea1){return db[_0x5243('0x1a')]['findAll']({'raw':_0x41ad41[_0x5243('0x1b')]?_0x41ad41['options'][_0x5243('0x1c')]===undefined?!![]:![]:!![],'where':_0x41ad41[_0x5243('0x1b')]?_0x41ad41[_0x5243('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x5243('0x1d')]['fn']('IF',db['sequelize'][_0x5243('0x1e')](_0x5243('0x1f')))),_0x5243('0x20')]]})[_0x5243('0x10')](function(_0x387f2e){logger['info'](_0x5243('0x21'),_0x41ad41);logger['debug'](_0x5243('0x21'),_0x41ad41,JSON['stringify'](_0x387f2e));_0x53aba5(_0x387f2e);})[_0x5243('0x19')](function(_0x1aee87){logger[_0x5243('0x15')](_0x5243('0x21'),_0x1aee87[_0x5243('0x17')],_0x41ad41);_0x3ecea1(_0x2e31c7['error'](0x1f4,_0x1aee87[_0x5243('0x17')]));});});}; \ No newline at end of file +var _0xb51d=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb51d,0x199));var _0xdb51=function(_0x5a1cab,_0x291879){_0x5a1cab=_0x5a1cab-0x0;var _0x19bb2c=_0xb51d[_0x5a1cab];return _0x19bb2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb51('0x0'));var BPromise=require(_0xdb51('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb51('0x2'));var db=require(_0xdb51('0x3'))['db'];var utils=require(_0xdb51('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdb51('0x5'));var client=jayson[_0xdb51('0x6')][_0xdb51('0x7')]({'port':0x232a});config[_0xdb51('0x8')]=_[_0xdb51('0x9')](config[_0xdb51('0x8')],{'host':_0xdb51('0xa'),'port':0x18eb});var socket=require(_0xdb51('0xb'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xdb51('0xc')](socket);function respondWithRpcPromise(_0x1a6453,_0x2a0265,_0x1a5460){return new BPromise(function(_0x54572b,_0x2f6844){return client[_0xdb51('0xd')](_0x1a6453,_0x1a5460)['then'](function(_0x5d4548){logger[_0xdb51('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2a0265,_0xdb51('0xf'));logger['debug'](_0xdb51('0x10'),_0x2a0265,_0xdb51('0xf'),JSON[_0xdb51('0x11')](_0x5d4548));if(_0x5d4548['error']){if(_0x5d4548[_0xdb51('0x12')][_0xdb51('0x13')]===0x1f4){logger[_0xdb51('0x12')](_0xdb51('0x14'),_0x2a0265,_0x5d4548[_0xdb51('0x12')][_0xdb51('0x15')]);return _0x2f6844(_0x5d4548['error']['message']);}logger[_0xdb51('0x12')](_0xdb51('0x14'),_0x2a0265,_0x5d4548[_0xdb51('0x12')][_0xdb51('0x15')]);return _0x54572b(_0x5d4548[_0xdb51('0x12')][_0xdb51('0x15')]);}else{logger[_0xdb51('0xe')](_0xdb51('0x14'),_0x2a0265,_0xdb51('0xf'));_0x54572b(_0x5d4548[_0xdb51('0x16')][_0xdb51('0x15')]);}})[_0xdb51('0x17')](function(_0x3efe27){logger[_0xdb51('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2a0265,_0x3efe27);_0x2f6844(_0x3efe27);});});}exports[_0xdb51('0x18')]=function(_0x3b47cd){var _0x5582a4=this;return new Promise(function(_0xe2ff8,_0x1952e1){return db['UserVoiceQueueRt'][_0xdb51('0x19')]({'raw':_0x3b47cd[_0xdb51('0x1a')]?_0x3b47cd['options'][_0xdb51('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b47cd[_0xdb51('0x1a')]?_0x3b47cd[_0xdb51('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xdb51('0x1c'),db[_0xdb51('0x1d')]['fn']('IF',db[_0xdb51('0x1d')][_0xdb51('0x1e')](_0xdb51('0x1f')))),'outboundQueuePauses']]})['then'](function(_0x52c133){logger['info']('GetVoiceQueueRtPauses',_0x3b47cd);logger[_0xdb51('0x20')](_0xdb51('0x18'),_0x3b47cd,JSON['stringify'](_0x52c133));_0xe2ff8(_0x52c133);})[_0xdb51('0x17')](function(_0x482156){logger[_0xdb51('0x12')](_0xdb51('0x18'),_0x482156[_0xdb51('0x15')],_0x3b47cd);_0x1952e1(_0x5582a4['error'](0x1f4,_0x482156[_0xdb51('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index e2a8a0c..3789a6d 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 _0x2428=['length','save','remove','update','emit','removeListener','register'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x2428,0xd3));var _0x8242=function(_0x30dbf4,_0x4337d8){_0x30dbf4=_0x30dbf4-0x0;var _0x200640=_0x2428[_0x30dbf4];return _0x200640;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x8242('0x0'),_0x8242('0x1'),_0x8242('0x2')];function createListener(_0x3f0f24,_0x9528a2){return function(_0x3fea1d){_0x9528a2[_0x8242('0x3')](_0x3f0f24,_0x3fea1d);};}function removeListener(_0x29feea,_0x1ee0d4){return function(){UserVoiceQueueRtEvents[_0x8242('0x4')](_0x29feea,_0x1ee0d4);};}exports[_0x8242('0x5')]=function(_0x484baa){for(var _0x38153d=0x0,_0x11da5f=events[_0x8242('0x6')];_0x38153d<_0x11da5f;_0x38153d++){var _0x3712f3=events[_0x38153d];var _0x1501e8=createListener('userVoiceQueueRt:'+_0x3712f3,_0x484baa);UserVoiceQueueRtEvents['on'](_0x3712f3,_0x1501e8);}}; \ No newline at end of file +var _0xd2bb=['save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x336595,_0x3f900f){var _0x337f47=function(_0x9f2698){while(--_0x9f2698){_0x336595['push'](_0x336595['shift']());}};_0x337f47(++_0x3f900f);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x3bbf33,_0x4d1eb5){_0x3bbf33=_0x3bbf33-0x0;var _0x2b3bd4=_0xd2bb[_0x3bbf33];return _0x2b3bd4;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xbd2b('0x0'),'remove',_0xbd2b('0x1')];function createListener(_0x1b0c46,_0x29f98f){return function(_0x334128){_0x29f98f[_0xbd2b('0x2')](_0x1b0c46,_0x334128);};}function removeListener(_0x3c67c1,_0x5c41c7){return function(){UserVoiceQueueRtEvents[_0xbd2b('0x3')](_0x3c67c1,_0x5c41c7);};}exports[_0xbd2b('0x4')]=function(_0xdcd8bd){for(var _0x2f64a8=0x0,_0x296d68=events[_0xbd2b('0x5')];_0x2f64a8<_0x296d68;_0x2f64a8++){var _0x42fee1=events[_0x2f64a8];var _0x30cd3f=createListener(_0xbd2b('0x6')+_0x42fee1,_0xdcd8bd);UserVoiceQueueRtEvents['on'](_0x42fee1,_0x30cd3f);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 9c31acb..357bd16 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3d3994,_0x3a8d61){var _0x56319b=function(_0x26b899){while(--_0x26b899){_0x3d3994['push'](_0x3d3994['shift']());}};_0x56319b(++_0x3a8d61);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0xcb91[_0x10dbf6];return _0x452147;};'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(_0x244a2b,_0x3b12ab){var _0x137803=function(_0x44c9c1){while(--_0x44c9c1){_0x244a2b['push'](_0x244a2b['shift']());}};_0x137803(++_0x3b12ab);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xcb91[_0x217c2e];return _0x22b7d8;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 12e2be9..e85742f 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 _0x321f=['INTEGER','sequelize'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x321f,0x91));var _0xf321=function(_0xe336e0,_0x18f796){_0xe336e0=_0xe336e0-0x0;var _0x19d2c6=_0x321f[_0xe336e0];return _0x19d2c6;};'use strict';var Sequelize=require(_0xf321('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf321('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc95f=['INTEGER','sequelize','exports'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0xc95f,0xe2));var _0xfc95=function(_0x3766f4,_0x580673){_0x3766f4=_0x3766f4-0x0;var _0x183f88=_0xc95f[_0x3766f4];return _0x183f88;};'use strict';var Sequelize=require(_0xfc95('0x0'));module[_0xfc95('0x1')]={'penalty':{'type':Sequelize[_0xfc95('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 744effb..e995b3d 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 _0x04e9=['api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0xcbfc95,_0x396927){var _0x55ae4a=function(_0x361a4c){while(--_0x361a4c){_0xcbfc95['push'](_0xcbfc95['shift']());}};_0x55ae4a(++_0x396927);}(_0x04e9,0x11e));var _0x904e=function(_0xcda531,_0x420fff){_0xcda531=_0xcda531-0x0;var _0x5b52e4=_0x04e9[_0xcda531];return _0x5b52e4;};'use strict';var _=require(_0x904e('0x0'));var util=require(_0x904e('0x1'));var logger=require('../../config/logger')(_0x904e('0x2'));var moment=require(_0x904e('0x3'));var BPromise=require(_0x904e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x904e('0x5'));var rimraf=require(_0x904e('0x6'));var config=require(_0x904e('0x7'));var attributes=require(_0x904e('0x8'));module['exports']=function(_0x10544a,_0x3aa298){return _0x10544a[_0x904e('0x9')](_0x904e('0xa'),attributes,{'tableName':_0x904e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x754a=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x21e6d6,_0x5f19cc){var _0x2d16a6=function(_0x4a6c7a){while(--_0x4a6c7a){_0x21e6d6['push'](_0x21e6d6['shift']());}};_0x2d16a6(++_0x5f19cc);}(_0x754a,0xa2));var _0xa754=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x754a[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var util=require(_0xa754('0x0'));var logger=require(_0xa754('0x1'))('api');var moment=require(_0xa754('0x2'));var BPromise=require(_0xa754('0x3'));var rp=require(_0xa754('0x4'));var fs=require('fs');var path=require(_0xa754('0x5'));var rimraf=require(_0xa754('0x6'));var config=require(_0xa754('0x7'));var attributes=require(_0xa754('0x8'));module[_0xa754('0x9')]=function(_0x348f3b,_0x170444){return _0x348f3b[_0xa754('0xa')](_0xa754('0xb'),attributes,{'tableName':_0xa754('0xc'),'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 310b973..c144e5b 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 _0xf8f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x47f8ad,_0x3b56d4){var _0x29e26b=function(_0x3e3a56){while(--_0x3e3a56){_0x47f8ad['push'](_0x47f8ad['shift']());}};_0x29e26b(++_0x3b56d4);}(_0xf8f2,0x1b7));var _0x2f8f=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0xf8f2[_0x260ce2];return _0x16b105;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f8f('0x2'));var db=require(_0x2f8f('0x3'))['db'];var utils=require(_0x2f8f('0x4'));var logger=require(_0x2f8f('0x5'))(_0x2f8f('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f8f('0x7'));var client=jayson[_0x2f8f('0x8')][_0x2f8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b9141,_0x412d43,_0x2ca5f0){return new BPromise(function(_0x5d1618,_0x364bac){return client[_0x2f8f('0xa')](_0x1b9141,_0x2ca5f0)[_0x2f8f('0xb')](function(_0x1dc0fa){logger[_0x2f8f('0xc')](_0x2f8f('0xd'),_0x412d43,_0x2f8f('0xe'));logger['debug'](_0x2f8f('0xf'),_0x412d43,'request\x20sent',JSON[_0x2f8f('0x10')](_0x1dc0fa));if(_0x1dc0fa[_0x2f8f('0x11')]){if(_0x1dc0fa[_0x2f8f('0x11')][_0x2f8f('0x12')]===0x1f4){logger[_0x2f8f('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x412d43,_0x1dc0fa[_0x2f8f('0x11')][_0x2f8f('0x13')]);return _0x364bac(_0x1dc0fa['error'][_0x2f8f('0x13')]);}logger['error'](_0x2f8f('0xd'),_0x412d43,_0x1dc0fa['error']['message']);return _0x5d1618(_0x1dc0fa[_0x2f8f('0x11')]['message']);}else{logger[_0x2f8f('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x412d43,_0x2f8f('0xe'));_0x5d1618(_0x1dc0fa[_0x2f8f('0x14')][_0x2f8f('0x13')]);}})['catch'](function(_0x4142c2){logger[_0x2f8f('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x412d43,_0x4142c2);_0x364bac(_0x4142c2);});});} \ No newline at end of file +var _0xe1e8=['rpc','../../config/environment','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe1e8,0x174));var _0x8e1e=function(_0x314968,_0x69b686){_0x314968=_0x314968-0x0;var _0x19bf35=_0xe1e8[_0x314968];return _0x19bf35;};'use strict';var _=require('lodash');var util=require(_0x8e1e('0x0'));var moment=require(_0x8e1e('0x1'));var BPromise=require(_0x8e1e('0x2'));var rs=require(_0x8e1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e1e('0x4'))['db'];var utils=require(_0x8e1e('0x5'));var logger=require('../../config/logger')(_0x8e1e('0x6'));var config=require(_0x8e1e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8e1e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11e71c,_0xcff607,_0x110d9e){return new BPromise(function(_0x152bd0,_0x31fb19){return client[_0x8e1e('0x9')](_0x11e71c,_0x110d9e)[_0x8e1e('0xa')](function(_0xc1e463){logger['info'](_0x8e1e('0xb'),_0xcff607,_0x8e1e('0xc'));logger[_0x8e1e('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xcff607,'request\x20sent',JSON[_0x8e1e('0xe')](_0xc1e463));if(_0xc1e463[_0x8e1e('0xf')]){if(_0xc1e463[_0x8e1e('0xf')][_0x8e1e('0x10')]===0x1f4){logger[_0x8e1e('0xf')](_0x8e1e('0xb'),_0xcff607,_0xc1e463[_0x8e1e('0xf')]['message']);return _0x31fb19(_0xc1e463['error'][_0x8e1e('0x11')]);}logger[_0x8e1e('0xf')](_0x8e1e('0xb'),_0xcff607,_0xc1e463[_0x8e1e('0xf')]['message']);return _0x152bd0(_0xc1e463['error'][_0x8e1e('0x11')]);}else{logger[_0x8e1e('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0xcff607,_0x8e1e('0xc'));_0x152bd0(_0xc1e463[_0x8e1e('0x13')][_0x8e1e('0x11')]);}})[_0x8e1e('0x14')](function(_0x5e8d57){logger[_0x8e1e('0xf')](_0x8e1e('0xb'),_0xcff607,_0x5e8d57);_0x31fb19(_0x5e8d57);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index db3a9fd..ab8e74f 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 _0xe105=['exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0xe105,0xef));var _0x5e10=function(_0x558b16,_0x568db8){_0x558b16=_0x558b16-0x0;var _0x142ee6=_0xe105[_0x558b16];return _0x142ee6;};'use strict';var multer=require(_0x5e10('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e10('0x1')]();var fs_extra=require(_0x5e10('0x2'));var auth=require(_0x5e10('0x3'));var interaction=require(_0x5e10('0x4'));var config=require('../../config/environment');var controller=require(_0x5e10('0x5'));router[_0x5e10('0x6')]('/',auth['isAuthenticated'](),controller[_0x5e10('0x7')]);router['get']('/:id',auth[_0x5e10('0x8')](),controller[_0x5e10('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5e10('0xa')]);router[_0x5e10('0xb')](_0x5e10('0xc'),auth['isAuthenticated'](),controller[_0x5e10('0xd')]);router[_0x5e10('0xe')]('/:id',auth[_0x5e10('0x8')](),controller[_0x5e10('0xf')]);module[_0x5e10('0x10')]=router; \ No newline at end of file +var _0x5395=['index','/:id','post','create','put','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0xb983c4,_0x679e53){var _0x4d4570=function(_0x55a876){while(--_0x55a876){_0xb983c4['push'](_0xb983c4['shift']());}};_0x4d4570(++_0x679e53);}(_0x5395,0x150));var _0x5539=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5395[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['show']);router[_0x5539('0xb')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router[_0x5539('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5539('0xa'),auth['isAuthenticated'](),controller[_0x5539('0xe')]);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 02a5216..a031352 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 _0x4a99=['sequelize','name','STRING'];(function(_0x2f2df4,_0x360812){var _0x5055ca=function(_0x535698){while(--_0x535698){_0x2f2df4['push'](_0x2f2df4['shift']());}};_0x5055ca(++_0x360812);}(_0x4a99,0x1aa));var _0x94a9=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x4a99[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x94a9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x94a9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x94a9('0x2')]}}; \ No newline at end of file +var _0x64e1=['STRING','name','sequelize','exports'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x64e1,0x9a));var _0x164e=function(_0xa86f0e,_0x48f50b){_0xa86f0e=_0xa86f0e-0x0;var _0x31815f=_0x64e1[_0xa86f0e];return _0x31815f;};'use strict';var Sequelize=require(_0x164e('0x0'));module[_0x164e('0x1')]={'name':{'type':Sequelize[_0x164e('0x2')],'unique':_0x164e('0x3'),'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 118bc6f..3486a7c 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 _0xb0a5=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Variables','UserProfileResource','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb0a5,0x16d));var _0x5b0a=function(_0x49d280,_0x33d68f){_0x49d280=_0x49d280-0x0;var _0x25274a=_0xb0a5[_0x49d280];return _0x25274a;};'use strict';var emlformat=require(_0x5b0a('0x0'));var rimraf=require(_0x5b0a('0x1'));var zipdir=require(_0x5b0a('0x2'));var jsonpatch=require(_0x5b0a('0x3'));var rp=require(_0x5b0a('0x4'));var moment=require(_0x5b0a('0x5'));var BPromise=require(_0x5b0a('0x6'));var Mustache=require(_0x5b0a('0x7'));var util=require(_0x5b0a('0x8'));var path=require(_0x5b0a('0x9'));var sox=require(_0x5b0a('0xa'));var csv=require(_0x5b0a('0xb'));var ejs=require(_0x5b0a('0xc'));var fs=require('fs');var fs_extra=require(_0x5b0a('0xd'));var _=require(_0x5b0a('0xe'));var squel=require(_0x5b0a('0xf'));var crypto=require(_0x5b0a('0x10'));var jsforce=require(_0x5b0a('0x11'));var deskjs=require(_0x5b0a('0x12'));var toCsv=require(_0x5b0a('0xb'));var querystring=require(_0x5b0a('0x13'));var Papa=require(_0x5b0a('0x14'));var Redis=require(_0x5b0a('0x15'));var authService=require(_0x5b0a('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b0a('0x17'));var logger=require('../../config/logger')(_0x5b0a('0x18'));var utils=require(_0x5b0a('0x19'));var config=require(_0x5b0a('0x1a'));var licenseUtil=require(_0x5b0a('0x1b'));var db=require(_0x5b0a('0x1c'))['db'];function respondWithStatusCode(_0x18ab7a,_0x56c275){_0x56c275=_0x56c275||0xcc;return function(_0xb5917d){if(_0xb5917d){return _0x18ab7a[_0x5b0a('0x1d')](_0x56c275);}return _0x18ab7a['status'](_0x56c275)[_0x5b0a('0x1e')]();};}function respondWithResult(_0x239a01,_0x3aeda6){_0x3aeda6=_0x3aeda6||0xc8;return function(_0x316226){if(_0x316226){return _0x239a01[_0x5b0a('0x1f')](_0x3aeda6)[_0x5b0a('0x20')](_0x316226);}};}function respondWithFilteredResult(_0x1070b4,_0x4d8376){return function(_0x1db8b6){if(_0x1db8b6){var _0x380454=typeof _0x4d8376[_0x5b0a('0x21')]===_0x5b0a('0x22')&&typeof _0x4d8376[_0x5b0a('0x23')]===_0x5b0a('0x22');var _0x3ca398=_0x1db8b6[_0x5b0a('0x24')];var _0x1e6bed=_0x380454?0x0:_0x4d8376[_0x5b0a('0x21')];var _0x365424=_0x380454?_0x1db8b6[_0x5b0a('0x24')]:_0x4d8376[_0x5b0a('0x21')]+_0x4d8376[_0x5b0a('0x23')];var _0x17b43a;if(_0x365424>=_0x3ca398){_0x365424=_0x3ca398;_0x17b43a=0xc8;}else{_0x17b43a=0xce;}_0x1070b4['status'](_0x17b43a);return _0x1070b4[_0x5b0a('0x25')](_0x5b0a('0x26'),_0x1e6bed+'-'+_0x365424+'/'+_0x3ca398)[_0x5b0a('0x20')](_0x1db8b6);}return null;};}function patchUpdates(_0x29c6e7){return function(_0x4c382a){try{jsonpatch[_0x5b0a('0x27')](_0x4c382a,_0x29c6e7,!![]);}catch(_0x1a692b){return BPromise['reject'](_0x1a692b);}return _0x4c382a[_0x5b0a('0x28')]();};}function saveUpdates(_0x59ed97,_0x43687a){return function(_0x3eeae2){if(_0x3eeae2){return _0x3eeae2[_0x5b0a('0x29')](_0x59ed97)[_0x5b0a('0x2a')](function(_0xebea21){return _0xebea21;});}return null;};}function removeEntity(_0x42aeb4,_0x34f849){return function(_0x1265fe){if(_0x1265fe){return _0x1265fe['destroy']()['then'](function(){var _0x4a1999=_0x1265fe[_0x5b0a('0x2b')]({'plain':!![]});var _0x283809=_0x5b0a('0x2c');return db[_0x5b0a('0x2d')]['destroy']({'where':{'type':_0x283809,'resourceId':_0x4a1999['id']}})[_0x5b0a('0x2a')](function(){return _0x1265fe;});})[_0x5b0a('0x2a')](function(){_0x42aeb4[_0x5b0a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39807d,_0x231cb9){return function(_0x5ca1ff){if(!_0x5ca1ff){_0x39807d[_0x5b0a('0x1d')](0x194);}return _0x5ca1ff;};}function handleError(_0x33cc83,_0x45cc3a){_0x45cc3a=_0x45cc3a||0x1f4;return function(_0x1af553){logger['error'](_0x1af553[_0x5b0a('0x2e')]);if(_0x1af553[_0x5b0a('0x2f')]){delete _0x1af553[_0x5b0a('0x2f')];}_0x33cc83[_0x5b0a('0x1f')](_0x45cc3a)[_0x5b0a('0x30')](_0x1af553);};}exports[_0x5b0a('0x31')]=function(_0x417722,_0x5dac7f){var _0x54e02b={},_0x195ac4={},_0x8b8e41={'count':0x0,'rows':[]};var _0x1d58e5=_[_0x5b0a('0x32')](db[_0x5b0a('0x33')][_0x5b0a('0x34')],function(_0x42b251){return{'name':_0x42b251[_0x5b0a('0x35')],'type':_0x42b251[_0x5b0a('0x36')][_0x5b0a('0x37')]};});_0x195ac4[_0x5b0a('0x38')]=_['map'](_0x1d58e5,'name');_0x195ac4[_0x5b0a('0x39')]=_[_0x5b0a('0x3a')](_0x417722[_0x5b0a('0x39')]);_0x195ac4[_0x5b0a('0x3b')]=_[_0x5b0a('0x3c')](_0x195ac4[_0x5b0a('0x38')],_0x195ac4[_0x5b0a('0x39')]);_0x54e02b['attributes']=_['intersection'](_0x195ac4['model'],qs[_0x5b0a('0x3d')](_0x417722[_0x5b0a('0x39')][_0x5b0a('0x3d')]));_0x54e02b[_0x5b0a('0x3e')]=_0x54e02b[_0x5b0a('0x3e')][_0x5b0a('0x3f')]?_0x54e02b['attributes']:_0x195ac4['model'];if(!_0x417722[_0x5b0a('0x39')][_0x5b0a('0x40')](_0x5b0a('0x41'))){_0x54e02b[_0x5b0a('0x23')]=qs[_0x5b0a('0x23')](_0x417722[_0x5b0a('0x39')][_0x5b0a('0x23')]);_0x54e02b[_0x5b0a('0x21')]=qs[_0x5b0a('0x21')](_0x417722[_0x5b0a('0x39')]['offset']);}_0x54e02b[_0x5b0a('0x42')]=qs['sort'](_0x417722[_0x5b0a('0x39')]['sort']);_0x54e02b['where']=qs['filters'](_['pick'](_0x417722[_0x5b0a('0x39')],_0x195ac4['filters']),_0x1d58e5);if(_0x417722[_0x5b0a('0x39')]['filter']){_0x54e02b[_0x5b0a('0x43')]=_[_0x5b0a('0x44')](_0x54e02b['where'],{'$or':_[_0x5b0a('0x32')](_0x1d58e5,function(_0x125e0d){if(_0x125e0d[_0x5b0a('0x36')]!==_0x5b0a('0x45')){var _0x1762b2={};_0x1762b2[_0x125e0d[_0x5b0a('0x2f')]]={'$like':'%'+_0x417722['query'][_0x5b0a('0x46')]+'%'};return _0x1762b2;}})});}_0x54e02b=_[_0x5b0a('0x44')]({},_0x54e02b,_0x417722[_0x5b0a('0x47')]);var _0x3a69d3={'where':_0x54e02b[_0x5b0a('0x43')]};return db['Variable']['count'](_0x3a69d3)[_0x5b0a('0x2a')](function(_0x3dc22e){_0x8b8e41['count']=_0x3dc22e;if(_0x417722[_0x5b0a('0x39')][_0x5b0a('0x48')]){_0x54e02b[_0x5b0a('0x49')]=[{'all':!![]}];}return db[_0x5b0a('0x33')][_0x5b0a('0x4a')](_0x54e02b);})[_0x5b0a('0x2a')](function(_0x715638){_0x8b8e41[_0x5b0a('0x4b')]=_0x715638;return _0x8b8e41;})[_0x5b0a('0x2a')](respondWithFilteredResult(_0x5dac7f,_0x54e02b))[_0x5b0a('0x4c')](handleError(_0x5dac7f,null));};exports['show']=function(_0x38f978,_0x4d95e8){var _0xde6167={'raw':!![],'where':{'id':_0x38f978[_0x5b0a('0x4d')]['id']}},_0x35d57c={};_0x35d57c['model']=_[_0x5b0a('0x3a')](db['Variable'][_0x5b0a('0x34')]);_0x35d57c['query']=_[_0x5b0a('0x3a')](_0x38f978[_0x5b0a('0x39')]);_0x35d57c[_0x5b0a('0x3b')]=_[_0x5b0a('0x3c')](_0x35d57c[_0x5b0a('0x38')],_0x35d57c[_0x5b0a('0x39')]);_0xde6167[_0x5b0a('0x3e')]=_['intersection'](_0x35d57c['model'],qs[_0x5b0a('0x3d')](_0x38f978['query']['fields']));_0xde6167[_0x5b0a('0x3e')]=_0xde6167['attributes'][_0x5b0a('0x3f')]?_0xde6167['attributes']:_0x35d57c[_0x5b0a('0x38')];if(_0x38f978[_0x5b0a('0x39')]['includeAll']){_0xde6167[_0x5b0a('0x49')]=[{'all':!![]}];}_0xde6167=_[_0x5b0a('0x44')]({},_0xde6167,_0x38f978[_0x5b0a('0x47')]);return db['Variable'][_0x5b0a('0x4e')](_0xde6167)['then'](handleEntityNotFound(_0x4d95e8,null))[_0x5b0a('0x2a')](respondWithResult(_0x4d95e8,null))['catch'](handleError(_0x4d95e8,null));};exports[_0x5b0a('0x4f')]=function(_0xa67b85,_0x41101d){return db[_0x5b0a('0x33')][_0x5b0a('0x4f')](_0xa67b85['body'],{})[_0x5b0a('0x2a')](function(_0x4e82a6){var _0x4d2eff=_0xa67b85[_0x5b0a('0x50')][_0x5b0a('0x2b')]({'plain':!![]});if(!_0x4d2eff)throw new Error(_0x5b0a('0x51'));if(_0x4d2eff[_0x5b0a('0x52')]===_0x5b0a('0x50')){var _0x48a381=_0x4e82a6['get']({'plain':!![]});var _0x479744=_0x5b0a('0x2c');return db[_0x5b0a('0x53')][_0x5b0a('0x4e')]({'where':{'name':_0x479744,'userProfileId':_0x4d2eff[_0x5b0a('0x54')]},'raw':!![]})[_0x5b0a('0x2a')](function(_0xe5be15){if(_0xe5be15&&_0xe5be15[_0x5b0a('0x55')]===0x0){return db[_0x5b0a('0x2d')][_0x5b0a('0x4f')]({'name':_0x48a381[_0x5b0a('0x2f')],'resourceId':_0x48a381['id'],'type':_0xe5be15[_0x5b0a('0x2f')],'sectionId':_0xe5be15['id']},{})['then'](function(){return _0x4e82a6;});}else{return _0x4e82a6;}})[_0x5b0a('0x4c')](function(_0x3f97fd){logger[_0x5b0a('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f97fd);throw _0x3f97fd;});}return _0x4e82a6;})['then'](respondWithResult(_0x41101d,0xc9))[_0x5b0a('0x4c')](handleError(_0x41101d,null));};exports[_0x5b0a('0x29')]=function(_0x2d17d0,_0x19ed4b){if(_0x2d17d0[_0x5b0a('0x57')]['id']){delete _0x2d17d0[_0x5b0a('0x57')]['id'];}return db['Variable']['find']({'where':{'id':_0x2d17d0[_0x5b0a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x19ed4b,null))[_0x5b0a('0x2a')](saveUpdates(_0x2d17d0[_0x5b0a('0x57')],null))['then'](respondWithResult(_0x19ed4b,null))[_0x5b0a('0x4c')](handleError(_0x19ed4b,null));};exports[_0x5b0a('0x58')]=function(_0x22f135,_0x3f0807){return db[_0x5b0a('0x33')][_0x5b0a('0x4e')]({'where':{'id':_0x22f135[_0x5b0a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3f0807,null))[_0x5b0a('0x2a')](removeEntity(_0x3f0807,null))[_0x5b0a('0x4c')](handleError(_0x3f0807,null));}; \ No newline at end of file +var _0xd5b4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','rawAttributes','includeAll','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','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5b4,0x105));var _0x4d5b=function(_0xc065a,_0x252b07){_0xc065a=_0xc065a-0x0;var _0x144f27=_0xd5b4[_0xc065a];return _0x144f27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d5b('0x0'));var zipdir=require(_0x4d5b('0x1'));var jsonpatch=require(_0x4d5b('0x2'));var rp=require(_0x4d5b('0x3'));var moment=require(_0x4d5b('0x4'));var BPromise=require(_0x4d5b('0x5'));var Mustache=require(_0x4d5b('0x6'));var util=require(_0x4d5b('0x7'));var path=require(_0x4d5b('0x8'));var sox=require(_0x4d5b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d5b('0xa'));var _=require('lodash');var squel=require(_0x4d5b('0xb'));var crypto=require(_0x4d5b('0xc'));var jsforce=require(_0x4d5b('0xd'));var deskjs=require(_0x4d5b('0xe'));var toCsv=require(_0x4d5b('0xf'));var querystring=require(_0x4d5b('0x10'));var Papa=require(_0x4d5b('0x11'));var Redis=require(_0x4d5b('0x12'));var authService=require(_0x4d5b('0x13'));var qs=require(_0x4d5b('0x14'));var as=require(_0x4d5b('0x15'));var hardwareService=require(_0x4d5b('0x16'));var logger=require(_0x4d5b('0x17'))(_0x4d5b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6b38,_0x161be7){_0x161be7=_0x161be7||0xcc;return function(_0x5c1188){if(_0x5c1188){return _0x1b6b38[_0x4d5b('0x19')](_0x161be7);}return _0x1b6b38['status'](_0x161be7)[_0x4d5b('0x1a')]();};}function respondWithResult(_0x2b1ab0,_0x27d497){_0x27d497=_0x27d497||0xc8;return function(_0x22da25){if(_0x22da25){return _0x2b1ab0[_0x4d5b('0x1b')](_0x27d497)[_0x4d5b('0x1c')](_0x22da25);}};}function respondWithFilteredResult(_0x2c32fa,_0x116f87){return function(_0x31468c){if(_0x31468c){var _0x31e439=typeof _0x116f87[_0x4d5b('0x1d')]==='undefined'&&typeof _0x116f87[_0x4d5b('0x1e')]===_0x4d5b('0x1f');var _0x25ade1=_0x31468c['count'];var _0x4d0571=_0x31e439?0x0:_0x116f87['offset'];var _0x19f706=_0x31e439?_0x31468c[_0x4d5b('0x20')]:_0x116f87[_0x4d5b('0x1d')]+_0x116f87[_0x4d5b('0x1e')];var _0x53c5c2;if(_0x19f706>=_0x25ade1){_0x19f706=_0x25ade1;_0x53c5c2=0xc8;}else{_0x53c5c2=0xce;}_0x2c32fa[_0x4d5b('0x1b')](_0x53c5c2);return _0x2c32fa[_0x4d5b('0x21')](_0x4d5b('0x22'),_0x4d0571+'-'+_0x19f706+'/'+_0x25ade1)[_0x4d5b('0x1c')](_0x31468c);}return null;};}function patchUpdates(_0x473bb9){return function(_0x12944f){try{jsonpatch['apply'](_0x12944f,_0x473bb9,!![]);}catch(_0x46797f){return BPromise[_0x4d5b('0x23')](_0x46797f);}return _0x12944f[_0x4d5b('0x24')]();};}function saveUpdates(_0x5a09de,_0x43adc8){return function(_0x167a4c){if(_0x167a4c){return _0x167a4c['update'](_0x5a09de)[_0x4d5b('0x25')](function(_0x46f590){return _0x46f590;});}return null;};}function removeEntity(_0x5e768a,_0x250a00){return function(_0x339d49){if(_0x339d49){return _0x339d49[_0x4d5b('0x26')]()[_0x4d5b('0x25')](function(){var _0x597b9e=_0x339d49[_0x4d5b('0x27')]({'plain':!![]});var _0x5ad944=_0x4d5b('0x28');return db[_0x4d5b('0x29')][_0x4d5b('0x26')]({'where':{'type':_0x5ad944,'resourceId':_0x597b9e['id']}})[_0x4d5b('0x25')](function(){return _0x339d49;});})[_0x4d5b('0x25')](function(){_0x5e768a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55500b,_0x42afcb){return function(_0x3a0dd7){if(!_0x3a0dd7){_0x55500b['sendStatus'](0x194);}return _0x3a0dd7;};}function handleError(_0x50fc4c,_0x30b9ac){_0x30b9ac=_0x30b9ac||0x1f4;return function(_0x760aaa){logger[_0x4d5b('0x2a')](_0x760aaa[_0x4d5b('0x2b')]);if(_0x760aaa[_0x4d5b('0x2c')]){delete _0x760aaa['name'];}_0x50fc4c[_0x4d5b('0x1b')](_0x30b9ac)[_0x4d5b('0x2d')](_0x760aaa);};}exports['index']=function(_0x2294b1,_0x6ca4cf){var _0x1a6f63={},_0x6d2065={},_0xb7f973={'count':0x0,'rows':[]};var _0x52bd9b=_[_0x4d5b('0x2e')](db[_0x4d5b('0x2f')]['rawAttributes'],function(_0x16cd4d){return{'name':_0x16cd4d[_0x4d5b('0x30')],'type':_0x16cd4d[_0x4d5b('0x31')][_0x4d5b('0x32')]};});_0x6d2065[_0x4d5b('0x33')]=_['map'](_0x52bd9b,_0x4d5b('0x2c'));_0x6d2065[_0x4d5b('0x34')]=_[_0x4d5b('0x35')](_0x2294b1['query']);_0x6d2065[_0x4d5b('0x36')]=_[_0x4d5b('0x37')](_0x6d2065['model'],_0x6d2065[_0x4d5b('0x34')]);_0x1a6f63[_0x4d5b('0x38')]=_[_0x4d5b('0x37')](_0x6d2065[_0x4d5b('0x33')],qs[_0x4d5b('0x39')](_0x2294b1[_0x4d5b('0x34')][_0x4d5b('0x39')]));_0x1a6f63[_0x4d5b('0x38')]=_0x1a6f63[_0x4d5b('0x38')][_0x4d5b('0x3a')]?_0x1a6f63[_0x4d5b('0x38')]:_0x6d2065[_0x4d5b('0x33')];if(!_0x2294b1[_0x4d5b('0x34')][_0x4d5b('0x3b')](_0x4d5b('0x3c'))){_0x1a6f63[_0x4d5b('0x1e')]=qs[_0x4d5b('0x1e')](_0x2294b1[_0x4d5b('0x34')][_0x4d5b('0x1e')]);_0x1a6f63[_0x4d5b('0x1d')]=qs[_0x4d5b('0x1d')](_0x2294b1['query']['offset']);}_0x1a6f63[_0x4d5b('0x3d')]=qs['sort'](_0x2294b1[_0x4d5b('0x34')][_0x4d5b('0x3e')]);_0x1a6f63[_0x4d5b('0x3f')]=qs[_0x4d5b('0x36')](_[_0x4d5b('0x40')](_0x2294b1['query'],_0x6d2065[_0x4d5b('0x36')]),_0x52bd9b);if(_0x2294b1['query']['filter']){_0x1a6f63[_0x4d5b('0x3f')]=_[_0x4d5b('0x41')](_0x1a6f63[_0x4d5b('0x3f')],{'$or':_[_0x4d5b('0x2e')](_0x52bd9b,function(_0x2b7fbe){if(_0x2b7fbe[_0x4d5b('0x31')]!==_0x4d5b('0x42')){var _0x59c15c={};_0x59c15c[_0x2b7fbe[_0x4d5b('0x2c')]]={'$like':'%'+_0x2294b1['query'][_0x4d5b('0x43')]+'%'};return _0x59c15c;}})});}_0x1a6f63=_['merge']({},_0x1a6f63,_0x2294b1[_0x4d5b('0x44')]);var _0x4144d={'where':_0x1a6f63['where']};return db['Variable'][_0x4d5b('0x20')](_0x4144d)[_0x4d5b('0x25')](function(_0x3ebd0e){_0xb7f973[_0x4d5b('0x20')]=_0x3ebd0e;if(_0x2294b1[_0x4d5b('0x34')]['includeAll']){_0x1a6f63['include']=[{'all':!![]}];}return db[_0x4d5b('0x2f')][_0x4d5b('0x45')](_0x1a6f63);})[_0x4d5b('0x25')](function(_0x129668){_0xb7f973[_0x4d5b('0x46')]=_0x129668;return _0xb7f973;})[_0x4d5b('0x25')](respondWithFilteredResult(_0x6ca4cf,_0x1a6f63))[_0x4d5b('0x47')](handleError(_0x6ca4cf,null));};exports[_0x4d5b('0x48')]=function(_0x3bc599,_0x2df63d){var _0x3b4439={'raw':!![],'where':{'id':_0x3bc599[_0x4d5b('0x49')]['id']}},_0x36b898={};_0x36b898[_0x4d5b('0x33')]=_[_0x4d5b('0x35')](db[_0x4d5b('0x2f')][_0x4d5b('0x4a')]);_0x36b898[_0x4d5b('0x34')]=_['keys'](_0x3bc599['query']);_0x36b898[_0x4d5b('0x36')]=_[_0x4d5b('0x37')](_0x36b898[_0x4d5b('0x33')],_0x36b898['query']);_0x3b4439[_0x4d5b('0x38')]=_['intersection'](_0x36b898[_0x4d5b('0x33')],qs[_0x4d5b('0x39')](_0x3bc599[_0x4d5b('0x34')][_0x4d5b('0x39')]));_0x3b4439[_0x4d5b('0x38')]=_0x3b4439[_0x4d5b('0x38')][_0x4d5b('0x3a')]?_0x3b4439['attributes']:_0x36b898[_0x4d5b('0x33')];if(_0x3bc599[_0x4d5b('0x34')][_0x4d5b('0x4b')]){_0x3b4439['include']=[{'all':!![]}];}_0x3b4439=_[_0x4d5b('0x41')]({},_0x3b4439,_0x3bc599[_0x4d5b('0x44')]);return db[_0x4d5b('0x2f')][_0x4d5b('0x4c')](_0x3b4439)[_0x4d5b('0x25')](handleEntityNotFound(_0x2df63d,null))['then'](respondWithResult(_0x2df63d,null))[_0x4d5b('0x47')](handleError(_0x2df63d,null));};exports[_0x4d5b('0x4d')]=function(_0xc88722,_0x38b5c0){return db[_0x4d5b('0x2f')]['create'](_0xc88722[_0x4d5b('0x4e')],{})[_0x4d5b('0x25')](function(_0x5bd773){var _0x56ca60=_0xc88722[_0x4d5b('0x4f')][_0x4d5b('0x27')]({'plain':!![]});if(!_0x56ca60)throw new Error(_0x4d5b('0x50'));if(_0x56ca60[_0x4d5b('0x51')]===_0x4d5b('0x4f')){var _0x2ca701=_0x5bd773[_0x4d5b('0x27')]({'plain':!![]});var _0x299967='Variables';return db[_0x4d5b('0x52')]['find']({'where':{'name':_0x299967,'userProfileId':_0x56ca60[_0x4d5b('0x53')]},'raw':!![]})[_0x4d5b('0x25')](function(_0x5cb2d9){if(_0x5cb2d9&&_0x5cb2d9[_0x4d5b('0x54')]===0x0){return db[_0x4d5b('0x29')]['create']({'name':_0x2ca701[_0x4d5b('0x2c')],'resourceId':_0x2ca701['id'],'type':_0x5cb2d9[_0x4d5b('0x2c')],'sectionId':_0x5cb2d9['id']},{})['then'](function(){return _0x5bd773;});}else{return _0x5bd773;}})[_0x4d5b('0x47')](function(_0x74ac0c){logger[_0x4d5b('0x2a')](_0x4d5b('0x55'),_0x74ac0c);throw _0x74ac0c;});}return _0x5bd773;})[_0x4d5b('0x25')](respondWithResult(_0x38b5c0,0xc9))['catch'](handleError(_0x38b5c0,null));};exports[_0x4d5b('0x56')]=function(_0x2f56c9,_0x4e793f){if(_0x2f56c9['body']['id']){delete _0x2f56c9['body']['id'];}return db['Variable'][_0x4d5b('0x4c')]({'where':{'id':_0x2f56c9['params']['id']}})[_0x4d5b('0x25')](handleEntityNotFound(_0x4e793f,null))[_0x4d5b('0x25')](saveUpdates(_0x2f56c9['body'],null))[_0x4d5b('0x25')](respondWithResult(_0x4e793f,null))[_0x4d5b('0x47')](handleError(_0x4e793f,null));};exports['destroy']=function(_0x36d1a6,_0x15df75){return db[_0x4d5b('0x2f')][_0x4d5b('0x4c')]({'where':{'id':_0x36d1a6[_0x4d5b('0x49')]['id']}})[_0x4d5b('0x25')](handleEntityNotFound(_0x15df75,null))[_0x4d5b('0x25')](removeEntity(_0x15df75,null))[_0x4d5b('0x47')](handleError(_0x15df75,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c8fbbbf..9d73611 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 _0xea25=['tools_variables','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x36c270,_0x2569ff){var _0x276c73=function(_0x27ea41){while(--_0x27ea41){_0x36c270['push'](_0x36c270['shift']());}};_0x276c73(++_0x2569ff);}(_0xea25,0x12a));var _0x5ea2=function(_0x80c9b4,_0x381c5e){_0x80c9b4=_0x80c9b4-0x0;var _0x1386fc=_0xea25[_0x80c9b4];return _0x1386fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ea2('0x0'))(_0x5ea2('0x1'));var moment=require('moment');var BPromise=require(_0x5ea2('0x2'));var rp=require(_0x5ea2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ea2('0x4'));var config=require(_0x5ea2('0x5'));var attributes=require(_0x5ea2('0x6'));module[_0x5ea2('0x7')]=function(_0x3e02fa,_0x50602f){return _0x3e02fa[_0x5ea2('0x8')](_0x5ea2('0x9'),attributes,{'tableName':_0x5ea2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','tools_variables','lodash','util','../../config/logger','api'];(function(_0x5643cf,_0x119e2f){var _0x451164=function(_0x111e37){while(--_0x111e37){_0x5643cf['push'](_0x5643cf['shift']());}};_0x451164(++_0x119e2f);}(_0xf8fa,0x64));var _0xaf8f=function(_0x4912f2,_0x1d2a00){_0x4912f2=_0x4912f2-0x0;var _0x2f2b52=_0xf8fa[_0x4912f2];return _0x2f2b52;};'use strict';var _=require(_0xaf8f('0x0'));var util=require(_0xaf8f('0x1'));var logger=require(_0xaf8f('0x2'))(_0xaf8f('0x3'));var moment=require(_0xaf8f('0x4'));var BPromise=require(_0xaf8f('0x5'));var rp=require(_0xaf8f('0x6'));var fs=require('fs');var path=require(_0xaf8f('0x7'));var rimraf=require(_0xaf8f('0x8'));var config=require(_0xaf8f('0x9'));var attributes=require(_0xaf8f('0xa'));module[_0xaf8f('0xb')]=function(_0x26b07e,_0x1c2975){return _0x26b07e['define']('Variable',attributes,{'tableName':_0xaf8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 7881bee..3390327 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x485028,_0x362e6e){var _0x4d947f=function(_0xb9080a){while(--_0xb9080a){_0x485028['push'](_0x485028['shift']());}};_0x4d947f(++_0x362e6e);}(_0xabce,0x103));var _0xeabc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xabce[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _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(_0x5ca3a0,_0x59d06d){var _0x17c2dc=function(_0x40c81f){while(--_0x40c81f){_0x5ca3a0['push'](_0x5ca3a0['shift']());}};_0x17c2dc(++_0x59d06d);}(_0x6aa7,0x178));var _0x76aa=function(_0x404e6d,_0x4ecb00){_0x404e6d=_0x404e6d-0x0;var _0x2c0125=_0x6aa7[_0x404e6d];return _0x2c0125;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 863abca..ae176f3 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 _0x9700=['express','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/restart','restart','/migrations'];(function(_0x2a6ab8,_0x5eb621){var _0x5752ab=function(_0x49766d){while(--_0x49766d){_0x2a6ab8['push'](_0x2a6ab8['shift']());}};_0x5752ab(++_0x5eb621);}(_0x9700,0x111));var _0x0970=function(_0x3a960b,_0x29391a){_0x3a960b=_0x3a960b-0x0;var _0x4267b3=_0x9700[_0x3a960b];return _0x4267b3;};'use strict';var express=require(_0x0970('0x0'));var router=express['Router']();var auth=require(_0x0970('0x1'));var controller=require('./version.controller');router[_0x0970('0x2')]('/',controller[_0x0970('0x3')]);router[_0x0970('0x2')](_0x0970('0x4'),auth[_0x0970('0x5')](),auth[_0x0970('0x6')](),controller[_0x0970('0x7')]);router[_0x0970('0x2')](_0x0970('0x8'),auth[_0x0970('0x5')](),auth['canUpdate'](),controller[_0x0970('0x9')]);router[_0x0970('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x0970('0x6')](),controller['pull']);router[_0x0970('0x2')](_0x0970('0xa'),auth[_0x0970('0x5')](),controller[_0x0970('0xb')]);router[_0x0970('0x2')](_0x0970('0xc'),controller['migrations']);module['exports']=router; \ No newline at end of file +var _0xb5e4=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xb5e4,0x1ca));var _0x4b5e=function(_0x57ff08,_0x2626ee){_0x57ff08=_0x57ff08-0x0;var _0x403304=_0xb5e4[_0x57ff08];return _0x403304;};'use strict';var express=require(_0x4b5e('0x0'));var router=express[_0x4b5e('0x1')]();var auth=require(_0x4b5e('0x2'));var controller=require(_0x4b5e('0x3'));router[_0x4b5e('0x4')]('/',controller[_0x4b5e('0x5')]);router['get'](_0x4b5e('0x6'),auth[_0x4b5e('0x7')](),auth[_0x4b5e('0x8')](),controller[_0x4b5e('0x9')]);router[_0x4b5e('0x4')](_0x4b5e('0xa'),auth['isAuthenticated'](),auth[_0x4b5e('0x8')](),controller[_0x4b5e('0xb')]);router[_0x4b5e('0x4')](_0x4b5e('0xc'),auth[_0x4b5e('0x7')](),auth['canUpdate'](),controller['pull']);router[_0x4b5e('0x4')](_0x4b5e('0xd'),auth[_0x4b5e('0x7')](),controller['restart']);router[_0x4b5e('0x4')]('/migrations',controller[_0x4b5e('0xe')]);module[_0x4b5e('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e811a15..cd6a983 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 _0x5745=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','migrations','Database\x20migrated\x20successfully\x20from\x20version\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','query','latest','fetch','version','2.0.0','status','json','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then'];(function(_0x5b4c80,_0x482ff5){var _0x56b612=function(_0x41d9f3){while(--_0x41d9f3){_0x5b4c80['push'](_0x5b4c80['shift']());}};_0x56b612(++_0x482ff5);}(_0x5745,0xe3));var _0x5574=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5745[_0x3947c9];return _0x2e7871;};'use strict';var Umzug=require(_0x5574('0x0'));var path=require(_0x5574('0x1'));var fs=require('fs');var _=require(_0x5574('0x2'));var pkginfo=require(_0x5574('0x3'))(module,'version');var compareVersions=require(_0x5574('0x4'));var exec=require('child_process')['exec'];var db=require(_0x5574('0x5'))['db'];var config=require(_0x5574('0x6'));var pm2=require(_0x5574('0x7'));var logger=require('../../config/logger')(_0x5574('0x8'));var git=require(_0x5574('0x9'))(config[_0x5574('0xa')]);exports['index']=function(_0x166770,_0x3e22d2){var _0x249f15={'current':module[_0x5574('0xb')]['version'],'phonebar':0x2};if(_0x166770['query']&&_0x166770[_0x5574('0xc')][_0x5574('0xd')]){return git[_0x5574('0xe')]()['tags'](function(_0x2c90cd,_0x2a1445){_0x249f15[_0x5574('0xd')]=(_0x2c90cd?module['exports'][_0x5574('0xf')]:_0x2a1445[_0x5574('0xd')])||_0x5574('0x10');return _0x3e22d2[_0x5574('0x11')](0xc8)[_0x5574('0x12')](_0x249f15);});}else{return _0x3e22d2[_0x5574('0x11')](0xc8)[_0x5574('0x12')](_0x249f15);}};exports[_0x5574('0xe')]=function(_0x333abc,_0xd6cf2e){return git[_0x5574('0xe')](['origin','master'],function(_0x405928){if(_0x405928){logger[_0x5574('0x13')](_0x405928);return _0xd6cf2e[_0x5574('0x11')](0x1f4)['json'](_0x405928);}logger[_0x5574('0x14')](_0x5574('0x15'));return _0xd6cf2e[_0x5574('0x11')](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x16')});});};exports[_0x5574('0x17')]=function(_0x21333f,_0x3ac426){return git[_0x5574('0x17')]([_0x5574('0x18'),_0x5574('0x19')],function(_0x1d9f4b){if(_0x1d9f4b){logger[_0x5574('0x13')](_0x1d9f4b);return _0x3ac426['status'](0x1f4)[_0x5574('0x12')](_0x1d9f4b);}logger[_0x5574('0x14')](_0x5574('0x1a'));return _0x3ac426['status'](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x1b')});});};exports[_0x5574('0x1c')]=function(_0x42c5ef,_0x5a7029){exec(_0x5574('0x1d'),function(_0x3d247e,_0x272916,_0x118eae){logger[_0x5574('0x14')](_0x272916);logger[_0x5574('0x14')](_0x118eae);if(_0x3d247e){logger[_0x5574('0x13')](_0x3d247e);return _0x5a7029[_0x5574('0x11')](0x1f4)['json'](_0x3d247e);}return _0x5a7029['status'](0xc8)[_0x5574('0x12')]({'output':_0x272916});});};exports[_0x5574('0x1e')]=function(_0x354c96,_0x551f09){return pm2[_0x5574('0x1e')](_0x5574('0x1f'))[_0x5574('0x20')](function(_0x8703b0){logger[_0x5574('0x14')](_0x5574('0x21'),_0x8703b0);return _0x551f09[_0x5574('0x11')](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x22')});})['catch'](function(_0x154eb4){logger[_0x5574('0x13')](_0x154eb4);return _0x551f09[_0x5574('0x11')](0x1f4)[_0x5574('0x12')](_0x154eb4);});};exports['migrations']=function(_0x15bb3c,_0x26f52e){var _0x4aef58=fs[_0x5574('0x23')](path[_0x5574('0x24')](config[_0x5574('0xa')],'server','migrations'));var _0x56fb9a=[];for(var _0x2e88b1=0x0;_0x2e88b1<_0x4aef58['length'];_0x2e88b1++){var _0x58ddae=_0x4aef58[_0x2e88b1][_0x5574('0x25')](_0x5574('0x26'),'');if(compareVersions(module[_0x5574('0xb')][_0x5574('0xf')],_0x58ddae)===-0x1){_0x56fb9a[_0x5574('0x27')](_0x58ddae);}}if(_0x56fb9a[_0x5574('0x28')]){var _0x5489d7=_0x56fb9a[_0x5574('0x29')](compareVersions);var _0xae354d=new Umzug({'storage':_0x5574('0x2a'),'storageOptions':{'model':db[_0x5574('0x2b')],'modelName':_0x5574('0x2b'),'columnName':_0x5574('0xf')},'migrations':{'params':[db[_0x5574('0x2a')][_0x5574('0x2c')](),db[_0x5574('0x2a')]['constructor'],function(){throw new Error(_0x5574('0x2d'));}],'path':path[_0x5574('0x24')](config['root'],_0x5574('0x2e'),_0x5574('0x2f')),'pattern':/\.js$/}});_0xae354d['up']({'migrations':_['map'](_0x5489d7,function(_0x3b749f){return _0x3b749f+_0x5574('0x26');})})[_0x5574('0x20')](function(){return _0x26f52e[_0x5574('0x11')](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x30')+module[_0x5574('0xb')][_0x5574('0xf')]+'\x20to\x20'+_['last'](_0x5489d7),'migrations':_[_0x5574('0x24')](_0x5489d7)});})[_0x5574('0x31')](function(_0x40e0da){if(_0x40e0da instanceof db[_0x5574('0x2a')][_0x5574('0x32')]){return _0x26f52e[_0x5574('0x11')](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x33')});}else{return _0x26f52e[_0x5574('0x11')](0x1f4)[_0x5574('0x12')](_0x40e0da);}});}else{return _0x26f52e[_0x5574('0x11')](0xc8)[_0x5574('0x12')]({'output':_0x5574('0x33')});}}; \ No newline at end of file +var _0x2229=['status','json','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','error','info','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','server','migrations','length','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0'];(function(_0x1f5671,_0x46d35e){var _0x46c5a2=function(_0x8303f3){while(--_0x8303f3){_0x1f5671['push'](_0x1f5671['shift']());}};_0x46c5a2(++_0x46d35e);}(_0x2229,0x81));var _0x9222=function(_0x57267d,_0x9501f5){_0x57267d=_0x57267d-0x0;var _0x58a459=_0x2229[_0x57267d];return _0x58a459;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x9222('0x0'));var pkginfo=require(_0x9222('0x1'))(module,_0x9222('0x2'));var compareVersions=require(_0x9222('0x3'));var exec=require(_0x9222('0x4'))[_0x9222('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x9222('0x6'));var pm2=require(_0x9222('0x7'));var logger=require(_0x9222('0x8'))('update');var git=require(_0x9222('0x9'))(config[_0x9222('0xa')]);exports[_0x9222('0xb')]=function(_0x4bb706,_0x58c912){var _0x2c12ed={'current':module[_0x9222('0xc')][_0x9222('0x2')],'phonebar':0x2};if(_0x4bb706[_0x9222('0xd')]&&_0x4bb706['query'][_0x9222('0xe')]){return git[_0x9222('0xf')]()[_0x9222('0x10')](function(_0x37fbbf,_0x155988){_0x2c12ed[_0x9222('0xe')]=(_0x37fbbf?module[_0x9222('0xc')][_0x9222('0x2')]:_0x155988['latest'])||_0x9222('0x11');return _0x58c912[_0x9222('0x12')](0xc8)['json'](_0x2c12ed);});}else{return _0x58c912['status'](0xc8)[_0x9222('0x13')](_0x2c12ed);}};exports[_0x9222('0xf')]=function(_0x137a1b,_0x5e0898){return git[_0x9222('0xf')]([_0x9222('0x14'),_0x9222('0x15')],function(_0x33d2e5){if(_0x33d2e5){logger['error'](_0x33d2e5);return _0x5e0898['status'](0x1f4)[_0x9222('0x13')](_0x33d2e5);}logger['info'](_0x9222('0x16'));return _0x5e0898[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':_0x9222('0x17')});});};exports[_0x9222('0x18')]=function(_0x2414a4,_0x496738){return git['reset'](['--hard',_0x9222('0x19')],function(_0x139701){if(_0x139701){logger[_0x9222('0x1a')](_0x139701);return _0x496738[_0x9222('0x12')](0x1f4)[_0x9222('0x13')](_0x139701);}logger[_0x9222('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x496738[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x2c16b4,_0x3c0a0e){exec(_0x9222('0x1c'),function(_0x207353,_0x47c6d3,_0x301c14){logger[_0x9222('0x1b')](_0x47c6d3);logger[_0x9222('0x1b')](_0x301c14);if(_0x207353){logger[_0x9222('0x1a')](_0x207353);return _0x3c0a0e['status'](0x1f4)['json'](_0x207353);}return _0x3c0a0e[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':_0x47c6d3});});};exports[_0x9222('0x1d')]=function(_0x764613,_0x47e947){return pm2[_0x9222('0x1d')](_0x9222('0x1e'))[_0x9222('0x1f')](function(_0x1c5431){logger[_0x9222('0x1b')](_0x9222('0x20'),_0x1c5431);return _0x47e947[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9222('0x21')](function(_0x1c1dc0){logger[_0x9222('0x1a')](_0x1c1dc0);return _0x47e947[_0x9222('0x12')](0x1f4)[_0x9222('0x13')](_0x1c1dc0);});};exports['migrations']=function(_0x1a1a1b,_0x518376){var _0x32b0e4=fs[_0x9222('0x22')](path[_0x9222('0x23')](config[_0x9222('0xa')],_0x9222('0x24'),_0x9222('0x25')));var _0x4ada95=[];for(var _0x5211c0=0x0;_0x5211c0<_0x32b0e4[_0x9222('0x26')];_0x5211c0++){var _0x152ebe=_0x32b0e4[_0x5211c0]['replace'](_0x9222('0x27'),'');if(compareVersions(module['exports'][_0x9222('0x2')],_0x152ebe)===-0x1){_0x4ada95[_0x9222('0x28')](_0x152ebe);}}if(_0x4ada95['length']){var _0x322de8=_0x4ada95[_0x9222('0x29')](compareVersions);var _0x34c81f=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9222('0x2a')],'modelName':_0x9222('0x2a'),'columnName':_0x9222('0x2')},'migrations':{'params':[db[_0x9222('0x2b')]['getQueryInterface'](),db['sequelize'][_0x9222('0x2c')],function(){throw new Error(_0x9222('0x2d'));}],'path':path[_0x9222('0x23')](config['root'],_0x9222('0x24'),_0x9222('0x25')),'pattern':/\.js$/}});_0x34c81f['up']({'migrations':_['map'](_0x322de8,function(_0x35d5eb){return _0x35d5eb+_0x9222('0x27');})})[_0x9222('0x1f')](function(){return _0x518376[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':_0x9222('0x2e')+module[_0x9222('0xc')]['version']+'\x20to\x20'+_['last'](_0x322de8),'migrations':_[_0x9222('0x23')](_0x322de8)});})[_0x9222('0x21')](function(_0x3ae872){if(_0x3ae872 instanceof db['sequelize'][_0x9222('0x2f')]){return _0x518376[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':_0x9222('0x30')});}else{return _0x518376[_0x9222('0x12')](0x1f4)[_0x9222('0x13')](_0x3ae872);}});}else{return _0x518376[_0x9222('0x12')](0xc8)[_0x9222('0x13')]({'output':_0x9222('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d71695e..7d1653d 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 _0x309c=['../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','connect-timeout','express','Router'];(function(_0x52ae96,_0x560c09){var _0xefb94a=function(_0x244686){while(--_0x244686){_0x52ae96['push'](_0x52ae96['shift']());}};_0xefb94a(++_0x560c09);}(_0x309c,0x14d));var _0xc309=function(_0x1f6faf,_0x2f8ab8){_0x1f6faf=_0x1f6faf-0x0;var _0x3bb01c=_0x309c[_0x1f6faf];return _0x3bb01c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc309('0x0'));var express=require(_0xc309('0x1'));var router=express[_0xc309('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc309('0x3'));var interaction=require(_0xc309('0x4'));var config=require('../../config/environment');var controller=require(_0xc309('0x5'));router[_0xc309('0x6')]('/',auth[_0xc309('0x7')](),controller['index']);router['get'](_0xc309('0x8'),auth[_0xc309('0x7')](),controller[_0xc309('0x9')]);router[_0xc309('0x6')](_0xc309('0xa'),auth[_0xc309('0x7')](),controller[_0xc309('0xb')]);router[_0xc309('0xc')]('/',auth[_0xc309('0x7')](),controller['create']);router[_0xc309('0xd')](_0xc309('0xa'),auth[_0xc309('0x7')](),controller['update']);router[_0xc309('0xe')](_0xc309('0xa'),auth[_0xc309('0x7')](),controller[_0xc309('0xf')]);module['exports']=router; \ No newline at end of file +var _0x561a=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x3698e7,_0x279fbc){var _0x3ae310=function(_0x3f8f9f){while(--_0x3f8f9f){_0x3698e7['push'](_0x3698e7['shift']());}};_0x3ae310(++_0x279fbc);}(_0x561a,0x157));var _0xa561=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x561a[_0x191154];return _0x3dcd73;};'use strict';var multer=require(_0xa561('0x0'));var util=require(_0xa561('0x1'));var path=require('path');var timeout=require(_0xa561('0x2'));var express=require(_0xa561('0x3'));var router=express[_0xa561('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa561('0x5'));var interaction=require(_0xa561('0x6'));var config=require(_0xa561('0x7'));var controller=require(_0xa561('0x8'));router[_0xa561('0x9')]('/',auth[_0xa561('0xa')](),controller[_0xa561('0xb')]);router[_0xa561('0x9')]('/describe',auth[_0xa561('0xa')](),controller[_0xa561('0xc')]);router['get'](_0xa561('0xd'),auth['isAuthenticated'](),controller[_0xa561('0xe')]);router[_0xa561('0xf')]('/',auth[_0xa561('0xa')](),controller[_0xa561('0x10')]);router[_0xa561('0x11')](_0xa561('0xd'),auth[_0xa561('0xa')](),controller['update']);router['delete'](_0xa561('0xd'),auth[_0xa561('0xa')](),controller['destroy']);module[_0xa561('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 107e674..36cdc1a 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4325=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5432('0x2')]},'calleridnum':{'type':Sequelize[_0x5432('0x2')]},'calleridname':{'type':Sequelize[_0x5432('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5432('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5432('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5432('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5432('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5432('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5432('0x5')]},'agentacw':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5432('0x5')]},'reason':{'type':Sequelize[_0x5432('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5432('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'connectedlinename':{'type':Sequelize[_0x5432('0x2')]},'language':{'type':Sequelize[_0x5432('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5432('0x2')]},'priority':{'type':Sequelize[_0x5432('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5432('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5432('0x2')]},'destcalleridname':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5432('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5432('0x2')]},'destexten':{'type':Sequelize[_0x5432('0x2')]},'destpriority':{'type':Sequelize[_0x5432('0x2')]},'destuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5432('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5432('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5432('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5432('0x2')]},'agententerreason':{'type':Sequelize[_0x5432('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x51c5=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x419446,_0x2d057f){var _0x2a7795=function(_0x108448){while(--_0x108448){_0x419446['push'](_0x419446['shift']());}};_0x2a7795(++_0x2d057f);}(_0x51c5,0x8f));var _0x551c=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x51c5[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x551c('0x0'));module[_0x551c('0x1')]={'type':{'type':Sequelize[_0x551c('0x2')]},'uniqueid':{'type':Sequelize[_0x551c('0x2')]},'calleridnum':{'type':Sequelize[_0x551c('0x2')]},'calleridname':{'type':Sequelize[_0x551c('0x2')]},'queue':{'type':Sequelize[_0x551c('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x551c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x551c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x551c('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x551c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x551c('0x3')]},'agentdumpAt':{'type':Sequelize[_0x551c('0x3')]},'holdtime':{'type':Sequelize[_0x551c('0x4')]},'agentcomplete':{'type':Sequelize[_0x551c('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x551c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x551c('0x4')]},'agentacw':{'type':Sequelize[_0x551c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x551c('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x551c('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x551c('0x2')]},'language':{'type':Sequelize[_0x551c('0x2')]},'accountcode':{'type':Sequelize[_0x551c('0x2')]},'context':{'type':Sequelize[_0x551c('0x2')]},'exten':{'type':Sequelize[_0x551c('0x2')]},'priority':{'type':Sequelize[_0x551c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x551c('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x551c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x551c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x551c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x551c('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x551c('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x551c('0x2')]},'destpriority':{'type':Sequelize[_0x551c('0x2')]},'destuniqueid':{'type':Sequelize[_0x551c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x551c('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x551c('0x2')],'comment':_0x551c('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x551c('0x2')]},'agententerreason':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 90eafdc..a07a3f4 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 0eca0b1..c4965ba 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 _0x379e=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','destuniqueid','lodash','moment','bluebird','request-promise'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x379e,0x104));var _0xe379=function(_0x52b040,_0x9f2531){_0x52b040=_0x52b040-0x0;var _0x55bc53=_0x379e[_0x52b040];return _0x55bc53;};'use strict';var _=require(_0xe379('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe379('0x1'));var BPromise=require(_0xe379('0x2'));var rp=require(_0xe379('0x3'));var fs=require('fs');var path=require(_0xe379('0x4'));var rimraf=require(_0xe379('0x5'));var config=require(_0xe379('0x6'));var attributes=require(_0xe379('0x7'));module['exports']=function(_0x1f6c46,_0x24221c){return _0x1f6c46[_0xe379('0x8')](_0xe379('0x9'),attributes,{'tableName':_0xe379('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xe379('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4dc=['moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util'];(function(_0x204ef6,_0x14dc9b){var _0x5e3a4b=function(_0x4a6480){while(--_0x4a6480){_0x204ef6['push'](_0x204ef6['shift']());}};_0x5e3a4b(++_0x14dc9b);}(_0xa4dc,0x16a));var _0xca4d=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xa4dc[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca4d('0x2'));var BPromise=require(_0xca4d('0x3'));var rp=require(_0xca4d('0x4'));var fs=require('fs');var path=require(_0xca4d('0x5'));var rimraf=require(_0xca4d('0x6'));var config=require('../../config/environment');var attributes=require(_0xca4d('0x7'));module[_0xca4d('0x8')]=function(_0x1b60f4,_0x51470b){return _0x1b60f4[_0xca4d('0x9')]('VoiceAgentReport',attributes,{'tableName':_0xca4d('0xa'),'paranoid':![],'indexes':[{'fields':[_0xca4d('0xb'),_0xca4d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index fe5c5ad..734de92 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 _0x0600=['then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','catch','UpdateVoiceAgentReport','body','raw','where','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3112f5,_0x357e8f){var _0x3744f7=function(_0x56145b){while(--_0x56145b){_0x3112f5['push'](_0x3112f5['shift']());}};_0x3744f7(++_0x357e8f);}(_0x0600,0x78));var _0x0060=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x0600[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0x0060('0x0'));var util=require('util');var moment=require(_0x0060('0x1'));var BPromise=require(_0x0060('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0060('0x3'))['db'];var utils=require(_0x0060('0x4'));var logger=require(_0x0060('0x5'))(_0x0060('0x6'));var config=require(_0x0060('0x7'));var jayson=require(_0x0060('0x8'));var client=jayson[_0x0060('0x9')][_0x0060('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7ba7e1,_0x37e3a7,_0x5ccca9){return new BPromise(function(_0x16358f,_0x323141){return client[_0x0060('0xb')](_0x7ba7e1,_0x5ccca9)[_0x0060('0xc')](function(_0x25221d){logger[_0x0060('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x37e3a7,_0x0060('0xe'));logger[_0x0060('0xf')](_0x0060('0x10'),_0x37e3a7,_0x0060('0xe'),JSON[_0x0060('0x11')](_0x25221d));if(_0x25221d[_0x0060('0x12')]){if(_0x25221d['error'][_0x0060('0x13')]===0x1f4){logger['error'](_0x0060('0x14'),_0x37e3a7,_0x25221d[_0x0060('0x12')][_0x0060('0x15')]);return _0x323141(_0x25221d[_0x0060('0x12')][_0x0060('0x15')]);}logger[_0x0060('0x12')](_0x0060('0x14'),_0x37e3a7,_0x25221d[_0x0060('0x12')][_0x0060('0x15')]);return _0x16358f(_0x25221d[_0x0060('0x12')][_0x0060('0x15')]);}else{logger[_0x0060('0xd')](_0x0060('0x14'),_0x37e3a7,'request\x20sent');_0x16358f(_0x25221d[_0x0060('0x16')][_0x0060('0x15')]);}})['catch'](function(_0x51d218){logger[_0x0060('0x12')](_0x0060('0x14'),_0x37e3a7,_0x51d218);_0x323141(_0x51d218);});});}exports[_0x0060('0x17')]=function(_0x43d94d){var _0x13e1fa=this;return new Promise(function(_0x3562b1,_0x439f4e){return db[_0x0060('0x18')][_0x0060('0x19')](_0x43d94d['body'],{'raw':_0x43d94d[_0x0060('0x1a')]?_0x43d94d[_0x0060('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0060('0xc')](function(_0x4731e8){logger[_0x0060('0xd')](_0x0060('0x17'),_0x43d94d);logger[_0x0060('0xf')](_0x0060('0x17'),_0x43d94d,JSON[_0x0060('0x11')](_0x4731e8));_0x3562b1(_0x4731e8);})[_0x0060('0x1b')](function(_0x466602){logger[_0x0060('0x12')](_0x0060('0x17'),_0x466602[_0x0060('0x15')],_0x43d94d);_0x439f4e(_0x13e1fa[_0x0060('0x12')](0x1f4,_0x466602[_0x0060('0x15')]));});});};exports[_0x0060('0x1c')]=function(_0x4a8774){var _0xae74d5=this;return new Promise(function(_0x310e64,_0xd60855){return db[_0x0060('0x18')]['update'](_0x4a8774[_0x0060('0x1d')],{'raw':_0x4a8774[_0x0060('0x1a')]?_0x4a8774['options'][_0x0060('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a8774[_0x0060('0x1a')]?_0x4a8774[_0x0060('0x1a')][_0x0060('0x1f')]||null:null,'attributes':_0x4a8774[_0x0060('0x1a')]?_0x4a8774[_0x0060('0x1a')]['attributes']||null:null,'limit':_0x4a8774[_0x0060('0x1a')]?_0x4a8774['options'][_0x0060('0x20')]||null:null})['then'](function(_0x22c240){logger[_0x0060('0xd')](_0x0060('0x1c'),_0x4a8774);logger[_0x0060('0xf')](_0x0060('0x1c'),_0x4a8774,JSON[_0x0060('0x11')](_0x22c240));_0x310e64(_0x22c240);})['catch'](function(_0x39118a){logger['error'](_0x0060('0x1c'),_0x39118a[_0x0060('0x15')],_0x4a8774);_0xd60855(_0xae74d5['error'](0x1f4,_0x39118a[_0x0060('0x15')]));});});}; \ No newline at end of file +var _0xf910=['catch','create','body','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','options','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xead5f0,_0x30581c){var _0x73c2a6=function(_0x27f32d){while(--_0x27f32d){_0xead5f0['push'](_0xead5f0['shift']());}};_0x73c2a6(++_0x30581c);}(_0xf910,0x153));var _0x0f91=function(_0x29c455,_0x7a9f1e){_0x29c455=_0x29c455-0x0;var _0x10d573=_0xf910[_0x29c455];return _0x10d573;};'use strict';var _=require('lodash');var util=require(_0x0f91('0x0'));var moment=require(_0x0f91('0x1'));var BPromise=require(_0x0f91('0x2'));var rs=require(_0x0f91('0x3'));var fs=require('fs');var Redis=require(_0x0f91('0x4'));var db=require(_0x0f91('0x5'))['db'];var utils=require(_0x0f91('0x6'));var logger=require(_0x0f91('0x7'))(_0x0f91('0x8'));var config=require(_0x0f91('0x9'));var jayson=require(_0x0f91('0xa'));var client=jayson['client'][_0x0f91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c8ce,_0x5c1405,_0x4790dc){return new BPromise(function(_0x430f70,_0x202e44){return client[_0x0f91('0xc')](_0x40c8ce,_0x4790dc)[_0x0f91('0xd')](function(_0xaf1217){logger[_0x0f91('0xe')](_0x0f91('0xf'),_0x5c1405,_0x0f91('0x10'));logger[_0x0f91('0x11')](_0x0f91('0x12'),_0x5c1405,_0x0f91('0x10'),JSON[_0x0f91('0x13')](_0xaf1217));if(_0xaf1217['error']){if(_0xaf1217[_0x0f91('0x14')][_0x0f91('0x15')]===0x1f4){logger['error'](_0x0f91('0xf'),_0x5c1405,_0xaf1217['error'][_0x0f91('0x16')]);return _0x202e44(_0xaf1217[_0x0f91('0x14')]['message']);}logger['error'](_0x0f91('0xf'),_0x5c1405,_0xaf1217['error'][_0x0f91('0x16')]);return _0x430f70(_0xaf1217[_0x0f91('0x14')]['message']);}else{logger[_0x0f91('0xe')](_0x0f91('0xf'),_0x5c1405,_0x0f91('0x10'));_0x430f70(_0xaf1217[_0x0f91('0x17')][_0x0f91('0x16')]);}})[_0x0f91('0x18')](function(_0x5b1458){logger[_0x0f91('0x14')](_0x0f91('0xf'),_0x5c1405,_0x5b1458);_0x202e44(_0x5b1458);});});}exports['CreateVoiceAgentReport']=function(_0x290ab1){var _0x157aa7=this;return new Promise(function(_0x26a548,_0x392c0a){return db['VoiceAgentReport'][_0x0f91('0x19')](_0x290ab1[_0x0f91('0x1a')],{'raw':_0x290ab1['options']?_0x290ab1['options'][_0x0f91('0x1b')]===undefined?!![]:![]:!![]})[_0x0f91('0xd')](function(_0x3b898b){logger[_0x0f91('0xe')]('CreateVoiceAgentReport',_0x290ab1);logger[_0x0f91('0x11')]('CreateVoiceAgentReport',_0x290ab1,JSON['stringify'](_0x3b898b));_0x26a548(_0x3b898b);})[_0x0f91('0x18')](function(_0x3c9bc5){logger[_0x0f91('0x14')](_0x0f91('0x1c'),_0x3c9bc5[_0x0f91('0x16')],_0x290ab1);_0x392c0a(_0x157aa7[_0x0f91('0x14')](0x1f4,_0x3c9bc5[_0x0f91('0x16')]));});});};exports[_0x0f91('0x1d')]=function(_0x5b4568){var _0x510a23=this;return new Promise(function(_0x5802e1,_0x206abd){return db['VoiceAgentReport']['update'](_0x5b4568[_0x0f91('0x1a')],{'raw':_0x5b4568['options']?_0x5b4568['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4568[_0x0f91('0x1e')]?_0x5b4568['options'][_0x0f91('0x1f')]||null:null,'attributes':_0x5b4568[_0x0f91('0x1e')]?_0x5b4568[_0x0f91('0x1e')][_0x0f91('0x20')]||null:null,'limit':_0x5b4568[_0x0f91('0x1e')]?_0x5b4568['options']['limit']||null:null})[_0x0f91('0xd')](function(_0x187183){logger['info'](_0x0f91('0x1d'),_0x5b4568);logger[_0x0f91('0x11')](_0x0f91('0x1d'),_0x5b4568,JSON[_0x0f91('0x13')](_0x187183));_0x5802e1(_0x187183);})['catch'](function(_0x1315b8){logger[_0x0f91('0x14')](_0x0f91('0x1d'),_0x1315b8[_0x0f91('0x16')],_0x5b4568);_0x206abd(_0x510a23['error'](0x1f4,_0x1315b8[_0x0f91('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index db55db4..d97de12 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 _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x28d231,_0x55888a){var _0x3814c5=function(_0x55a0a1){while(--_0x55a0a1){_0x28d231['push'](_0x28d231['shift']());}};_0x3814c5(++_0x55888a);}(_0x0e85,0x7c));var _0x50e8=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x0e85[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['show']);router[_0x50e8('0xc')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x50e8('0x11')]);module[_0x50e8('0x12')]=router; \ No newline at end of file +var _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0xf006,0x146));var _0x6f00=function(_0x4af51b,_0x52721f){_0x4af51b=_0x4af51b-0x0;var _0x487cc3=_0xf006[_0x4af51b];return _0x487cc3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 0671770..4ac7eb6 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 _0xa051=['ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xa051,0x189));var _0x1a05=function(_0x58d79a,_0x322927){_0x58d79a=_0x58d79a-0x0;var _0x290152=_0xa051[_0x58d79a];return _0x290152;};'use strict';var Sequelize=require(_0x1a05('0x0'));module[_0x1a05('0x1')]={'uniqueid':{'type':Sequelize[_0x1a05('0x2')]},'type':{'type':Sequelize[_0x1a05('0x3')](_0x1a05('0x4'),_0x1a05('0x5'),'outbound',_0x1a05('0x6'),_0x1a05('0x7'),_0x1a05('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1a05('0x2')]},'source':{'type':Sequelize[_0x1a05('0x2')]},'destination':{'type':Sequelize[_0x1a05('0x2')]},'destinationcontext':{'type':Sequelize[_0x1a05('0x2')]},'callerid':{'type':Sequelize[_0x1a05('0x2')]},'channel':{'type':Sequelize[_0x1a05('0x2')]},'destinationchannel':{'type':Sequelize[_0x1a05('0x2')]},'lastapplication':{'type':Sequelize[_0x1a05('0x2')]},'lastdata':{'type':Sequelize[_0x1a05('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1a05('0xa')]},'answertime':{'type':Sequelize[_0x1a05('0xa')]},'endtime':{'type':Sequelize[_0x1a05('0xa')]},'duration':{'type':Sequelize[_0x1a05('0xb')]},'billableseconds':{'type':Sequelize[_0x1a05('0xb')]},'mohtime':{'type':Sequelize[_0x1a05('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1a05('0x2')]},'amaflags':{'type':Sequelize[_0x1a05('0x2')]},'userfield':{'type':Sequelize[_0x1a05('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x1a05('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1a05('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x1a05('0xb')]},'sipcallid':{'type':Sequelize[_0x1a05('0x2')]}}; \ No newline at end of file +var _0x5f4d=['INTEGER','sequelize','exports','STRING','inbound','internal','outbound-fax','TEXT','DATE'];(function(_0x1bc353,_0x179b48){var _0x1a471c=function(_0x10d990){while(--_0x10d990){_0x1bc353['push'](_0x1bc353['shift']());}};_0x1a471c(++_0x179b48);}(_0x5f4d,0x91));var _0xd5f4=function(_0x3cff41,_0x6d45b6){_0x3cff41=_0x3cff41-0x0;var _0x16ab1f=_0x5f4d[_0x3cff41];return _0x16ab1f;};'use strict';var Sequelize=require(_0xd5f4('0x0'));module[_0xd5f4('0x1')]={'uniqueid':{'type':Sequelize[_0xd5f4('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd5f4('0x3'),_0xd5f4('0x4'),'outbound','inbound-fax',_0xd5f4('0x5'),'dialer')},'tag':{'type':Sequelize[_0xd5f4('0x2')]},'accountcode':{'type':Sequelize[_0xd5f4('0x2')]},'source':{'type':Sequelize[_0xd5f4('0x2')]},'destination':{'type':Sequelize[_0xd5f4('0x2')]},'destinationcontext':{'type':Sequelize[_0xd5f4('0x2')]},'callerid':{'type':Sequelize[_0xd5f4('0x2')]},'channel':{'type':Sequelize[_0xd5f4('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xd5f4('0x2')]},'lastdata':{'type':Sequelize[_0xd5f4('0x6')]},'starttime':{'type':Sequelize[_0xd5f4('0x7')]},'systemanswertime':{'type':Sequelize[_0xd5f4('0x7')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd5f4('0x7')]},'duration':{'type':Sequelize[_0xd5f4('0x8')]},'billableseconds':{'type':Sequelize[_0xd5f4('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd5f4('0x2')]},'amaflags':{'type':Sequelize[_0xd5f4('0x2')]},'userfield':{'type':Sequelize[_0xd5f4('0x2')]},'userDisposition':{'type':Sequelize[_0xd5f4('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xd5f4('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd5f4('0x2')]},'prefix':{'type':Sequelize[_0xd5f4('0x2')]},'routeid':{'type':Sequelize[_0xd5f4('0x8')]},'sipcallid':{'type':Sequelize[_0xd5f4('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index eb34217..60bd8c4 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x5f2f,0x73));var _0xf5f2=function(_0x27764c,_0x5910b7){_0x27764c=_0x27764c-0x0;var _0x4c354a=_0x5f2f[_0x27764c];return _0x4c354a;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0xadb5,0xad));var _0x5adb=function(_0x3eb51c,_0xe24c99){_0x3eb51c=_0x3eb51c-0x0;var _0x29dd90=_0xadb5[_0x3eb51c];return _0x29dd90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 08d1402..ec42002 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 _0x706b=['VoiceCallReport','report_call','uniqueid','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x34c1d1,_0x53c647){var _0x4574d8=function(_0xb352cf){while(--_0xb352cf){_0x34c1d1['push'](_0x34c1d1['shift']());}};_0x4574d8(++_0x53c647);}(_0x706b,0x1cb));var _0xb706=function(_0x4c3e22,_0x36c8ce){_0x4c3e22=_0x4c3e22-0x0;var _0x23eea1=_0x706b[_0x4c3e22];return _0x23eea1;};'use strict';var _=require(_0xb706('0x0'));var util=require(_0xb706('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb706('0x2'));var BPromise=require(_0xb706('0x3'));var rp=require(_0xb706('0x4'));var fs=require('fs');var path=require(_0xb706('0x5'));var rimraf=require('rimraf');var config=require(_0xb706('0x6'));var attributes=require(_0xb706('0x7'));module[_0xb706('0x8')]=function(_0x48462a,_0x134d6e){return _0x48462a['define'](_0xb706('0x9'),attributes,{'tableName':_0xb706('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb706('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x19e6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0x19e6,0x1ac));var _0x619e=function(_0x2d9ea3,_0x2c6a9e){_0x2d9ea3=_0x2d9ea3-0x0;var _0x3c0307=_0x19e6[_0x2d9ea3];return _0x3c0307;};'use strict';var _=require(_0x619e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x619e('0x1'));var moment=require(_0x619e('0x2'));var BPromise=require(_0x619e('0x3'));var rp=require(_0x619e('0x4'));var fs=require('fs');var path=require(_0x619e('0x5'));var rimraf=require(_0x619e('0x6'));var config=require(_0x619e('0x7'));var attributes=require(_0x619e('0x8'));module[_0x619e('0x9')]=function(_0xa80512,_0x3ad1ff){return _0xa80512[_0x619e('0xa')](_0x619e('0xb'),attributes,{'tableName':_0x619e('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d31baab..f2d198c 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 _0x28e6=['limit','include','attributes','map','then','CreateVoiceCallReport','VoiceCallReport','create','body','stringify','UpdateVoiceCallReport','update','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where'];(function(_0x5b8a68,_0x57354a){var _0x5d4359=function(_0x2035dc){while(--_0x2035dc){_0x5b8a68['push'](_0x5b8a68['shift']());}};_0x5d4359(++_0x57354a);}(_0x28e6,0x162));var _0x628e=function(_0x357b8e,_0x168da1){_0x357b8e=_0x357b8e-0x0;var _0x24831c=_0x28e6[_0x357b8e];return _0x24831c;};'use strict';var _=require('lodash');var util=require(_0x628e('0x0'));var moment=require('moment');var BPromise=require(_0x628e('0x1'));var rs=require(_0x628e('0x2'));var fs=require('fs');var Redis=require(_0x628e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x628e('0x4'));var logger=require(_0x628e('0x5'))(_0x628e('0x6'));var config=require(_0x628e('0x7'));var jayson=require(_0x628e('0x8'));var client=jayson['client'][_0x628e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa52a,_0x4848e9,_0x4c52cf){return new BPromise(function(_0x56082d,_0x5c8582){return client[_0x628e('0xa')](_0x4aa52a,_0x4c52cf)['then'](function(_0x49705a){logger[_0x628e('0xb')](_0x628e('0xc'),_0x4848e9,_0x628e('0xd'));logger[_0x628e('0xe')](_0x628e('0xf'),_0x4848e9,_0x628e('0xd'),JSON['stringify'](_0x49705a));if(_0x49705a[_0x628e('0x10')]){if(_0x49705a['error'][_0x628e('0x11')]===0x1f4){logger[_0x628e('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x4848e9,_0x49705a[_0x628e('0x10')][_0x628e('0x12')]);return _0x5c8582(_0x49705a[_0x628e('0x10')][_0x628e('0x12')]);}logger[_0x628e('0x10')](_0x628e('0xc'),_0x4848e9,_0x49705a['error'][_0x628e('0x12')]);return _0x56082d(_0x49705a['error'][_0x628e('0x12')]);}else{logger['info'](_0x628e('0xc'),_0x4848e9,_0x628e('0xd'));_0x56082d(_0x49705a[_0x628e('0x13')][_0x628e('0x12')]);}})[_0x628e('0x14')](function(_0x12243b){logger[_0x628e('0x10')](_0x628e('0xc'),_0x4848e9,_0x12243b);_0x5c8582(_0x12243b);});});}exports[_0x628e('0x15')]=function(_0x5e7c79){var _0x19ebf2=this;return new Promise(function(_0x5f179f,_0x2ff807){return db['VoiceCallReport'][_0x628e('0x16')]({'raw':_0x5e7c79[_0x628e('0x17')]?_0x5e7c79[_0x628e('0x17')][_0x628e('0x18')]===undefined?!![]:![]:!![],'where':_0x5e7c79[_0x628e('0x17')]?_0x5e7c79[_0x628e('0x17')][_0x628e('0x19')]||null:null,'attributes':_0x5e7c79[_0x628e('0x17')]?_0x5e7c79[_0x628e('0x17')]['attributes']||null:null,'limit':_0x5e7c79[_0x628e('0x17')]?_0x5e7c79[_0x628e('0x17')][_0x628e('0x1a')]||null:null,'include':_0x5e7c79[_0x628e('0x17')]?_0x5e7c79[_0x628e('0x17')][_0x628e('0x1b')]?_['map'](_0x5e7c79[_0x628e('0x17')][_0x628e('0x1b')],function(_0xaa6637){return{'model':db[_0xaa6637['model']],'as':_0xaa6637['as'],'attributes':_0xaa6637[_0x628e('0x1c')],'include':_0xaa6637['include']?_[_0x628e('0x1d')](_0xaa6637[_0x628e('0x1b')],function(_0x584139){return{'model':db[_0x584139['model']],'as':_0x584139['as'],'attributes':_0x584139[_0x628e('0x1c')],'include':_0x584139[_0x628e('0x1b')]?_[_0x628e('0x1d')](_0x584139[_0x628e('0x1b')],function(_0x14b480){return{'model':db[_0x14b480['model']],'as':_0x14b480['as'],'attributes':_0x14b480[_0x628e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x628e('0x1e')](function(_0xc43a76){logger[_0x628e('0xb')](_0x628e('0x15'),_0x5e7c79);logger['debug']('GetVoiceCallReport',_0x5e7c79,JSON['stringify'](_0xc43a76));_0x5f179f(_0xc43a76);})[_0x628e('0x14')](function(_0x45a244){logger[_0x628e('0x10')]('GetVoiceCallReport',_0x45a244[_0x628e('0x12')],_0x5e7c79);_0x2ff807(_0x19ebf2[_0x628e('0x10')](0x1f4,_0x45a244[_0x628e('0x12')]));});});};exports[_0x628e('0x1f')]=function(_0x28b871){var _0x29523a=this;return new Promise(function(_0x120403,_0x57c865){return db[_0x628e('0x20')][_0x628e('0x21')](_0x28b871[_0x628e('0x22')],{'raw':_0x28b871[_0x628e('0x17')]?_0x28b871[_0x628e('0x17')][_0x628e('0x18')]===undefined?!![]:![]:!![]})[_0x628e('0x1e')](function(_0x563661){logger['info'](_0x628e('0x1f'),_0x28b871);logger[_0x628e('0xe')](_0x628e('0x1f'),_0x28b871,JSON[_0x628e('0x23')](_0x563661));_0x120403(_0x563661);})[_0x628e('0x14')](function(_0x4b2544){logger[_0x628e('0x10')](_0x628e('0x1f'),_0x4b2544[_0x628e('0x12')],_0x28b871);_0x57c865(_0x29523a[_0x628e('0x10')](0x1f4,_0x4b2544['message']));});});};exports[_0x628e('0x24')]=function(_0x4ca55c){var _0x290d83=this;return new Promise(function(_0x15b2dc,_0x50819f){return db[_0x628e('0x20')][_0x628e('0x25')](_0x4ca55c[_0x628e('0x22')],{'raw':_0x4ca55c[_0x628e('0x17')]?_0x4ca55c[_0x628e('0x17')][_0x628e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca55c['options']?_0x4ca55c[_0x628e('0x17')][_0x628e('0x19')]||null:null,'attributes':_0x4ca55c[_0x628e('0x17')]?_0x4ca55c[_0x628e('0x17')]['attributes']||null:null,'limit':_0x4ca55c[_0x628e('0x17')]?_0x4ca55c['options'][_0x628e('0x1a')]||null:null})[_0x628e('0x1e')](function(_0x393f13){logger[_0x628e('0xb')]('UpdateVoiceCallReport',_0x4ca55c);logger['debug'](_0x628e('0x24'),_0x4ca55c,JSON[_0x628e('0x23')](_0x393f13));_0x15b2dc(_0x393f13);})['catch'](function(_0x5c6d09){logger[_0x628e('0x10')](_0x628e('0x24'),_0x5c6d09[_0x628e('0x12')],_0x4ca55c);_0x50819f(_0x290d83['error'](0x1f4,_0x5c6d09[_0x628e('0x12')]));});});}; \ No newline at end of file +var _0x3087=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','create','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','VoiceCallReport,\x20%s,\x20%s'];(function(_0x3499f7,_0x32f3e1){var _0x31b8c9=function(_0x5aab19){while(--_0x5aab19){_0x3499f7['push'](_0x3499f7['shift']());}};_0x31b8c9(++_0x32f3e1);}(_0x3087,0xd1));var _0x7308=function(_0x39482,_0x3402fc){_0x39482=_0x39482-0x0;var _0x953067=_0x3087[_0x39482];return _0x953067;};'use strict';var _=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var moment=require('moment');var BPromise=require(_0x7308('0x2'));var rs=require(_0x7308('0x3'));var fs=require('fs');var Redis=require(_0x7308('0x4'));var db=require(_0x7308('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7308('0x6'));var config=require(_0x7308('0x7'));var jayson=require(_0x7308('0x8'));var client=jayson['client'][_0x7308('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f7a7a,_0x28a85b,_0x3a53fd){return new BPromise(function(_0x15c480,_0x2e13a5){return client['request'](_0x8f7a7a,_0x3a53fd)[_0x7308('0xa')](function(_0x4b5ee4){logger[_0x7308('0xb')](_0x7308('0xc'),_0x28a85b,_0x7308('0xd'));logger[_0x7308('0xe')](_0x7308('0xf'),_0x28a85b,_0x7308('0xd'),JSON[_0x7308('0x10')](_0x4b5ee4));if(_0x4b5ee4[_0x7308('0x11')]){if(_0x4b5ee4[_0x7308('0x11')][_0x7308('0x12')]===0x1f4){logger[_0x7308('0x11')](_0x7308('0xc'),_0x28a85b,_0x4b5ee4[_0x7308('0x11')][_0x7308('0x13')]);return _0x2e13a5(_0x4b5ee4[_0x7308('0x11')]['message']);}logger[_0x7308('0x11')](_0x7308('0xc'),_0x28a85b,_0x4b5ee4[_0x7308('0x11')]['message']);return _0x15c480(_0x4b5ee4[_0x7308('0x11')][_0x7308('0x13')]);}else{logger[_0x7308('0xb')](_0x7308('0xc'),_0x28a85b,_0x7308('0xd'));_0x15c480(_0x4b5ee4['result']['message']);}})['catch'](function(_0x53031d){logger[_0x7308('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x28a85b,_0x53031d);_0x2e13a5(_0x53031d);});});}exports[_0x7308('0x14')]=function(_0x49c9b4){var _0xc7d268=this;return new Promise(function(_0x589843,_0x46be82){return db[_0x7308('0x15')][_0x7308('0x16')]({'raw':_0x49c9b4[_0x7308('0x17')]?_0x49c9b4[_0x7308('0x17')][_0x7308('0x18')]===undefined?!![]:![]:!![],'where':_0x49c9b4[_0x7308('0x17')]?_0x49c9b4[_0x7308('0x17')][_0x7308('0x19')]||null:null,'attributes':_0x49c9b4['options']?_0x49c9b4[_0x7308('0x17')][_0x7308('0x1a')]||null:null,'limit':_0x49c9b4[_0x7308('0x17')]?_0x49c9b4['options'][_0x7308('0x1b')]||null:null,'include':_0x49c9b4[_0x7308('0x17')]?_0x49c9b4['options'][_0x7308('0x1c')]?_['map'](_0x49c9b4[_0x7308('0x17')][_0x7308('0x1c')],function(_0x2cf850){return{'model':db[_0x2cf850['model']],'as':_0x2cf850['as'],'attributes':_0x2cf850[_0x7308('0x1a')],'include':_0x2cf850['include']?_[_0x7308('0x1d')](_0x2cf850['include'],function(_0x46ca50){return{'model':db[_0x46ca50[_0x7308('0x1e')]],'as':_0x46ca50['as'],'attributes':_0x46ca50[_0x7308('0x1a')],'include':_0x46ca50[_0x7308('0x1c')]?_[_0x7308('0x1d')](_0x46ca50[_0x7308('0x1c')],function(_0x32b996){return{'model':db[_0x32b996[_0x7308('0x1e')]],'as':_0x32b996['as'],'attributes':_0x32b996[_0x7308('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7308('0xa')](function(_0x10492e){logger[_0x7308('0xb')]('GetVoiceCallReport',_0x49c9b4);logger['debug'](_0x7308('0x14'),_0x49c9b4,JSON[_0x7308('0x10')](_0x10492e));_0x589843(_0x10492e);})[_0x7308('0x1f')](function(_0x4b138f){logger[_0x7308('0x11')](_0x7308('0x14'),_0x4b138f['message'],_0x49c9b4);_0x46be82(_0xc7d268['error'](0x1f4,_0x4b138f['message']));});});};exports['CreateVoiceCallReport']=function(_0x5224c4){var _0x576834=this;return new Promise(function(_0x3685a1,_0x1a028b){return db['VoiceCallReport'][_0x7308('0x20')](_0x5224c4['body'],{'raw':_0x5224c4[_0x7308('0x17')]?_0x5224c4['options'][_0x7308('0x18')]===undefined?!![]:![]:!![]})[_0x7308('0xa')](function(_0x2c4a07){logger[_0x7308('0xb')](_0x7308('0x21'),_0x5224c4);logger[_0x7308('0xe')](_0x7308('0x21'),_0x5224c4,JSON['stringify'](_0x2c4a07));_0x3685a1(_0x2c4a07);})[_0x7308('0x1f')](function(_0x4fa226){logger[_0x7308('0x11')](_0x7308('0x21'),_0x4fa226['message'],_0x5224c4);_0x1a028b(_0x576834[_0x7308('0x11')](0x1f4,_0x4fa226[_0x7308('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x58911c){var _0x57ae2d=this;return new Promise(function(_0x26b5e0,_0x386bec){return db['VoiceCallReport'][_0x7308('0x22')](_0x58911c[_0x7308('0x23')],{'raw':_0x58911c[_0x7308('0x17')]?_0x58911c[_0x7308('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58911c[_0x7308('0x17')]?_0x58911c['options'][_0x7308('0x19')]||null:null,'attributes':_0x58911c[_0x7308('0x17')]?_0x58911c[_0x7308('0x17')]['attributes']||null:null,'limit':_0x58911c[_0x7308('0x17')]?_0x58911c[_0x7308('0x17')][_0x7308('0x1b')]||null:null})['then'](function(_0x210830){logger[_0x7308('0xb')](_0x7308('0x24'),_0x58911c);logger[_0x7308('0xe')]('UpdateVoiceCallReport',_0x58911c,JSON[_0x7308('0x10')](_0x210830));_0x26b5e0(_0x210830);})[_0x7308('0x1f')](function(_0x38522f){logger[_0x7308('0x11')](_0x7308('0x24'),_0x38522f['message'],_0x58911c);_0x386bec(_0x57ae2d['error'](0x1f4,_0x38522f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 4997359..cc936d8 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 _0x3974=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x3974,0x17d));var _0x4397=function(_0x490c0e,_0x562b74){_0x490c0e=_0x490c0e-0x0;var _0x41a12b=_0x3974[_0x490c0e];return _0x41a12b;};'use strict';var multer=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var path=require(_0x4397('0x2'));var timeout=require(_0x4397('0x3'));var express=require(_0x4397('0x4'));var router=express[_0x4397('0x5')]();var fs_extra=require(_0x4397('0x6'));var auth=require(_0x4397('0x7'));var interaction=require(_0x4397('0x8'));var config=require(_0x4397('0x9'));var controller=require(_0x4397('0xa'));router[_0x4397('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4397('0xb')](_0x4397('0xc'),auth[_0x4397('0xd')](),controller[_0x4397('0xe')]);router[_0x4397('0xf')]('/',auth[_0x4397('0xd')](),controller[_0x4397('0x10')]);router[_0x4397('0x11')]('/:id',auth[_0x4397('0xd')](),controller['update']);router[_0x4397('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4397('0x13')]);module[_0x4397('0x14')]=router; \ No newline at end of file +var _0xb286=['exports','multer','util','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x5e9467,_0xe9270){var _0x25ad84=function(_0x568fe3){while(--_0x568fe3){_0x5e9467['push'](_0x5e9467['shift']());}};_0x25ad84(++_0xe9270);}(_0xb286,0x151));var _0x6b28=function(_0x14e8d1,_0x265dfe){_0x14e8d1=_0x14e8d1-0x0;var _0x39153c=_0xb286[_0x14e8d1];return _0x39153c;};'use strict';var multer=require(_0x6b28('0x0'));var util=require(_0x6b28('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6b28('0x2'));var config=require(_0x6b28('0x3'));var controller=require(_0x6b28('0x4'));router[_0x6b28('0x5')]('/',auth[_0x6b28('0x6')](),controller['index']);router[_0x6b28('0x5')](_0x6b28('0x7'),auth[_0x6b28('0x6')](),controller[_0x6b28('0x8')]);router[_0x6b28('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b28('0xa')]);router[_0x6b28('0xb')](_0x6b28('0x7'),auth[_0x6b28('0x6')](),controller[_0x6b28('0xc')]);router['delete'](_0x6b28('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b28('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ff021d7..a249236 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 _0x8330=['split','BOOLEAN','sequelize','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x4d01c0,_0xd5931a){var _0xce55ea=function(_0x52cbc2){while(--_0x52cbc2){_0x4d01c0['push'](_0x4d01c0['shift']());}};_0xce55ea(++_0xd5931a);}(_0x8330,0xf5));var _0x0833=function(_0x5665f2,_0x3353eb){_0x5665f2=_0x5665f2-0x0;var _0x56896a=_0x8330[_0x5665f2];return _0x56896a;};'use strict';var Sequelize=require(_0x0833('0x0'));module['exports']={'name':{'type':Sequelize[_0x0833('0x1')]},'prefix':{'type':Sequelize[_0x0833('0x1')],'unique':_0x0833('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5b4a01){this[_0x0833('0x3')](_0x0833('0x4'),_0x5b4a01?_0x5b4a01[_0x0833('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x0833('0x4'))?this[_0x0833('0x6')]('options')[_0x0833('0x7')](''):[];}},'auth':{'type':Sequelize[_0x0833('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x0833('0x1')]},'record':{'type':Sequelize[_0x0833('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0833('0x1')]},'description':{'type':Sequelize[_0x0833('0x1')]}}; \ No newline at end of file +var _0x083b=['sequelize','exports','STRING','setDataValue','options','join','BOOLEAN'];(function(_0x1a9f85,_0x2f5e14){var _0x2ab703=function(_0x35b957){while(--_0x35b957){_0x1a9f85['push'](_0x1a9f85['shift']());}};_0x2ab703(++_0x2f5e14);}(_0x083b,0xee));var _0xb083=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x083b[_0x2f2360];return _0x1cc8d3;};'use strict';var Sequelize=require(_0xb083('0x0'));module[_0xb083('0x1')]={'name':{'type':Sequelize[_0xb083('0x2')]},'prefix':{'type':Sequelize[_0xb083('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xb083('0x2')],'set':function(_0x31d26f){this[_0xb083('0x3')](_0xb083('0x4'),_0x31d26f?_0x31d26f[_0xb083('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb083('0x4'))?this['getDataValue'](_0xb083('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xb083('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb083('0x2')]},'description':{'type':Sequelize[_0xb083('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9e9313b..902f138 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 _0x938c=['api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','ChanSpies','UserProfileResource','destroy','sendStatus','error','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','update','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x10120d,_0x872fac){var _0x4ec0da=function(_0x458f6c){while(--_0x458f6c){_0x10120d['push'](_0x10120d['shift']());}};_0x4ec0da(++_0x872fac);}(_0x938c,0x11f));var _0xc938=function(_0x4ea910,_0x4c067b){_0x4ea910=_0x4ea910-0x0;var _0x3ee094=_0x938c[_0x4ea910];return _0x3ee094;};'use strict';var emlformat=require(_0xc938('0x0'));var rimraf=require(_0xc938('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc938('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc938('0x3'));var Mustache=require('mustache');var util=require(_0xc938('0x4'));var path=require(_0xc938('0x5'));var sox=require(_0xc938('0x6'));var csv=require(_0xc938('0x7'));var ejs=require(_0xc938('0x8'));var fs=require('fs');var fs_extra=require(_0xc938('0x9'));var _=require('lodash');var squel=require(_0xc938('0xa'));var crypto=require(_0xc938('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc938('0xc'));var toCsv=require(_0xc938('0x7'));var querystring=require('querystring');var Papa=require(_0xc938('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc938('0xe'));var as=require(_0xc938('0xf'));var hardwareService=require(_0xc938('0x10'));var logger=require('../../config/logger')(_0xc938('0x11'));var utils=require(_0xc938('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc938('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3020c0,_0x134bef){_0x134bef=_0x134bef||0xcc;return function(_0x3ec5e5){if(_0x3ec5e5){return _0x3020c0['sendStatus'](_0x134bef);}return _0x3020c0[_0xc938('0x14')](_0x134bef)[_0xc938('0x15')]();};}function respondWithResult(_0x416c26,_0x4d9dab){_0x4d9dab=_0x4d9dab||0xc8;return function(_0x4bc776){if(_0x4bc776){return _0x416c26['status'](_0x4d9dab)[_0xc938('0x16')](_0x4bc776);}};}function respondWithFilteredResult(_0x271c1d,_0x34e3a7){return function(_0x52a56b){if(_0x52a56b){var _0x143c42=typeof _0x34e3a7['offset']===_0xc938('0x17')&&typeof _0x34e3a7[_0xc938('0x18')]==='undefined';var _0x278c2d=_0x52a56b[_0xc938('0x19')];var _0x4ef24e=_0x143c42?0x0:_0x34e3a7[_0xc938('0x1a')];var _0x566758=_0x143c42?_0x52a56b[_0xc938('0x19')]:_0x34e3a7[_0xc938('0x1a')]+_0x34e3a7[_0xc938('0x18')];var _0x523bf1;if(_0x566758>=_0x278c2d){_0x566758=_0x278c2d;_0x523bf1=0xc8;}else{_0x523bf1=0xce;}_0x271c1d[_0xc938('0x14')](_0x523bf1);return _0x271c1d[_0xc938('0x1b')](_0xc938('0x1c'),_0x4ef24e+'-'+_0x566758+'/'+_0x278c2d)[_0xc938('0x16')](_0x52a56b);}return null;};}function patchUpdates(_0x33d533){return function(_0x474d1b){try{jsonpatch[_0xc938('0x1d')](_0x474d1b,_0x33d533,!![]);}catch(_0x2675d1){return BPromise['reject'](_0x2675d1);}return _0x474d1b[_0xc938('0x1e')]();};}function saveUpdates(_0xc4b20f,_0x5858b7){return function(_0xa43304){if(_0xa43304){return _0xa43304['update'](_0xc4b20f)[_0xc938('0x1f')](function(_0x4b8aac){return _0x4b8aac;});}return null;};}function removeEntity(_0x196481,_0x388391){return function(_0x20734d){if(_0x20734d){return _0x20734d['destroy']()[_0xc938('0x1f')](function(){var _0x229c62=_0x20734d['get']({'plain':!![]});var _0x4902fa=_0xc938('0x20');return db[_0xc938('0x21')][_0xc938('0x22')]({'where':{'type':_0x4902fa,'resourceId':_0x229c62['id']}})[_0xc938('0x1f')](function(){return _0x20734d;});})[_0xc938('0x1f')](function(){_0x196481[_0xc938('0x14')](0xcc)[_0xc938('0x15')]();});}};}function handleEntityNotFound(_0x156126,_0x2f1c44){return function(_0x232362){if(!_0x232362){_0x156126[_0xc938('0x23')](0x194);}return _0x232362;};}function handleError(_0x3334cb,_0x1a149f){_0x1a149f=_0x1a149f||0x1f4;return function(_0xa84e9){logger[_0xc938('0x24')](_0xa84e9['stack']);if(_0xa84e9[_0xc938('0x25')]){delete _0xa84e9[_0xc938('0x25')];}_0x3334cb[_0xc938('0x14')](_0x1a149f)[_0xc938('0x26')](_0xa84e9);};}exports['index']=function(_0x328dd7,_0x3056f4){var _0x1bc0a8={},_0xeb24d={},_0x373200={'count':0x0,'rows':[]};var _0x186c4e=_[_0xc938('0x27')](db[_0xc938('0x28')][_0xc938('0x29')],function(_0x5284ba){return{'name':_0x5284ba[_0xc938('0x2a')],'type':_0x5284ba[_0xc938('0x2b')][_0xc938('0x2c')]};});_0xeb24d[_0xc938('0x2d')]=_[_0xc938('0x27')](_0x186c4e,_0xc938('0x25'));_0xeb24d[_0xc938('0x2e')]=_[_0xc938('0x2f')](_0x328dd7[_0xc938('0x2e')]);_0xeb24d[_0xc938('0x30')]=_[_0xc938('0x31')](_0xeb24d[_0xc938('0x2d')],_0xeb24d['query']);_0x1bc0a8[_0xc938('0x32')]=_[_0xc938('0x31')](_0xeb24d[_0xc938('0x2d')],qs['fields'](_0x328dd7[_0xc938('0x2e')][_0xc938('0x33')]));_0x1bc0a8['attributes']=_0x1bc0a8[_0xc938('0x32')]['length']?_0x1bc0a8['attributes']:_0xeb24d[_0xc938('0x2d')];if(!_0x328dd7[_0xc938('0x2e')]['hasOwnProperty'](_0xc938('0x34'))){_0x1bc0a8[_0xc938('0x18')]=qs[_0xc938('0x18')](_0x328dd7['query'][_0xc938('0x18')]);_0x1bc0a8['offset']=qs[_0xc938('0x1a')](_0x328dd7[_0xc938('0x2e')]['offset']);}_0x1bc0a8['order']=qs['sort'](_0x328dd7[_0xc938('0x2e')][_0xc938('0x35')]);_0x1bc0a8[_0xc938('0x36')]=qs[_0xc938('0x30')](_[_0xc938('0x37')](_0x328dd7[_0xc938('0x2e')],_0xeb24d[_0xc938('0x30')]),_0x186c4e);if(_0x328dd7[_0xc938('0x2e')]['filter']){_0x1bc0a8[_0xc938('0x36')]=_[_0xc938('0x38')](_0x1bc0a8[_0xc938('0x36')],{'$or':_[_0xc938('0x27')](_0x186c4e,function(_0x5e0698){if(_0x5e0698['type']!=='VIRTUAL'){var _0x2d36e4={};_0x2d36e4[_0x5e0698[_0xc938('0x25')]]={'$like':'%'+_0x328dd7[_0xc938('0x2e')][_0xc938('0x39')]+'%'};return _0x2d36e4;}})});}_0x1bc0a8=_[_0xc938('0x38')]({},_0x1bc0a8,_0x328dd7[_0xc938('0x3a')]);var _0x4513f9={'where':_0x1bc0a8['where']};return db[_0xc938('0x28')][_0xc938('0x19')](_0x4513f9)[_0xc938('0x1f')](function(_0x1ae77a){_0x373200['count']=_0x1ae77a;if(_0x328dd7[_0xc938('0x2e')]['includeAll']){_0x1bc0a8[_0xc938('0x3b')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xc938('0x3c')](_0x1bc0a8);})[_0xc938('0x1f')](function(_0x3c4667){_0x373200[_0xc938('0x3d')]=_0x3c4667;return _0x373200;})[_0xc938('0x1f')](respondWithFilteredResult(_0x3056f4,_0x1bc0a8))[_0xc938('0x3e')](handleError(_0x3056f4,null));};exports[_0xc938('0x3f')]=function(_0x56a7c4,_0x44a13e){var _0x2f9285={'raw':![],'where':{'id':_0x56a7c4[_0xc938('0x40')]['id']}},_0x22338a={};_0x22338a[_0xc938('0x2d')]=_[_0xc938('0x2f')](db[_0xc938('0x28')][_0xc938('0x29')]);_0x22338a[_0xc938('0x2e')]=_[_0xc938('0x2f')](_0x56a7c4[_0xc938('0x2e')]);_0x22338a[_0xc938('0x30')]=_[_0xc938('0x31')](_0x22338a['model'],_0x22338a['query']);_0x2f9285['attributes']=_['intersection'](_0x22338a[_0xc938('0x2d')],qs[_0xc938('0x33')](_0x56a7c4[_0xc938('0x2e')][_0xc938('0x33')]));_0x2f9285[_0xc938('0x32')]=_0x2f9285[_0xc938('0x32')][_0xc938('0x41')]?_0x2f9285[_0xc938('0x32')]:_0x22338a['model'];if(_0x56a7c4['query'][_0xc938('0x42')]){_0x2f9285[_0xc938('0x3b')]=[{'all':!![]}];}_0x2f9285=_['merge']({},_0x2f9285,_0x56a7c4[_0xc938('0x3a')]);return db[_0xc938('0x28')][_0xc938('0x43')](_0x2f9285)['then'](handleEntityNotFound(_0x44a13e,null))[_0xc938('0x1f')](respondWithResult(_0x44a13e,null))[_0xc938('0x3e')](handleError(_0x44a13e,null));};exports[_0xc938('0x44')]=function(_0x1a9bd7,_0x390b40){return db['VoiceChanSpy']['create'](_0x1a9bd7[_0xc938('0x45')],{})['then'](function(_0x38435a){var _0x45e4ba=_0x1a9bd7['user'][_0xc938('0x46')]({'plain':!![]});if(!_0x45e4ba)throw new Error(_0xc938('0x47'));if(_0x45e4ba['role']===_0xc938('0x48')){var _0x130abf=_0x38435a['get']({'plain':!![]});var _0x2fe7fc='ChanSpies';return db[_0xc938('0x49')][_0xc938('0x43')]({'where':{'name':_0x2fe7fc,'userProfileId':_0x45e4ba['userProfileId']},'raw':!![]})[_0xc938('0x1f')](function(_0x44b058){if(_0x44b058&&_0x44b058[_0xc938('0x4a')]===0x0){return db[_0xc938('0x21')][_0xc938('0x44')]({'name':_0x130abf[_0xc938('0x25')],'resourceId':_0x130abf['id'],'type':_0x44b058['name'],'sectionId':_0x44b058['id']},{})[_0xc938('0x1f')](function(){return _0x38435a;});}else{return _0x38435a;}})[_0xc938('0x3e')](function(_0x28bbfd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28bbfd);throw _0x28bbfd;});}return _0x38435a;})['then'](respondWithResult(_0x390b40,0xc9))[_0xc938('0x3e')](handleError(_0x390b40,null));};exports[_0xc938('0x4b')]=function(_0x43af75,_0x37fe9b){if(_0x43af75[_0xc938('0x45')]['id']){delete _0x43af75[_0xc938('0x45')]['id'];}return db[_0xc938('0x28')]['find']({'where':{'id':_0x43af75['params']['id']}})[_0xc938('0x1f')](handleEntityNotFound(_0x37fe9b,null))[_0xc938('0x1f')](saveUpdates(_0x43af75[_0xc938('0x45')],null))[_0xc938('0x1f')](respondWithResult(_0x37fe9b,null))[_0xc938('0x3e')](handleError(_0x37fe9b,null));};exports[_0xc938('0x22')]=function(_0x48114f,_0x551536){return db[_0xc938('0x28')][_0xc938('0x43')]({'where':{'id':_0x48114f[_0xc938('0x40')]['id']}})[_0xc938('0x1f')](handleEntityNotFound(_0x551536,null))[_0xc938('0x1f')](removeEntity(_0x551536,null))[_0xc938('0x3e')](handleError(_0x551536,null));}; \ No newline at end of file +var _0xcff8=['mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','params','keys','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x5b418f,_0x29ef45){var _0x49b763=function(_0x10c23d){while(--_0x10c23d){_0x5b418f['push'](_0x5b418f['shift']());}};_0x49b763(++_0x29ef45);}(_0xcff8,0x14b));var _0x8cff=function(_0x39b97c,_0x47f8e1){_0x39b97c=_0x39b97c-0x0;var _0xe2739a=_0xcff8[_0x39b97c];return _0xe2739a;};'use strict';var emlformat=require(_0x8cff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cff('0x1'));var jsonpatch=require(_0x8cff('0x2'));var rp=require('request-promise');var moment=require(_0x8cff('0x3'));var BPromise=require(_0x8cff('0x4'));var Mustache=require(_0x8cff('0x5'));var util=require(_0x8cff('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cff('0x7'));var _=require(_0x8cff('0x8'));var squel=require(_0x8cff('0x9'));var crypto=require(_0x8cff('0xa'));var jsforce=require(_0x8cff('0xb'));var deskjs=require(_0x8cff('0xc'));var toCsv=require(_0x8cff('0xd'));var querystring=require('querystring');var Papa=require(_0x8cff('0xe'));var Redis=require(_0x8cff('0xf'));var authService=require(_0x8cff('0x10'));var qs=require(_0x8cff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cff('0x12'));var logger=require(_0x8cff('0x13'))(_0x8cff('0x14'));var utils=require(_0x8cff('0x15'));var config=require(_0x8cff('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cff('0x17'))['db'];function respondWithStatusCode(_0x2b469c,_0x20acb7){_0x20acb7=_0x20acb7||0xcc;return function(_0x3e642b){if(_0x3e642b){return _0x2b469c[_0x8cff('0x18')](_0x20acb7);}return _0x2b469c['status'](_0x20acb7)[_0x8cff('0x19')]();};}function respondWithResult(_0x5097c1,_0x4b3faf){_0x4b3faf=_0x4b3faf||0xc8;return function(_0x1d8c09){if(_0x1d8c09){return _0x5097c1[_0x8cff('0x1a')](_0x4b3faf)[_0x8cff('0x1b')](_0x1d8c09);}};}function respondWithFilteredResult(_0x3b352f,_0x26d516){return function(_0xac398f){if(_0xac398f){var _0x31214d=typeof _0x26d516[_0x8cff('0x1c')]===_0x8cff('0x1d')&&typeof _0x26d516[_0x8cff('0x1e')]===_0x8cff('0x1d');var _0x138d87=_0xac398f[_0x8cff('0x1f')];var _0x5d8d55=_0x31214d?0x0:_0x26d516[_0x8cff('0x1c')];var _0x4f12ab=_0x31214d?_0xac398f['count']:_0x26d516['offset']+_0x26d516[_0x8cff('0x1e')];var _0x541104;if(_0x4f12ab>=_0x138d87){_0x4f12ab=_0x138d87;_0x541104=0xc8;}else{_0x541104=0xce;}_0x3b352f[_0x8cff('0x1a')](_0x541104);return _0x3b352f[_0x8cff('0x20')](_0x8cff('0x21'),_0x5d8d55+'-'+_0x4f12ab+'/'+_0x138d87)[_0x8cff('0x1b')](_0xac398f);}return null;};}function patchUpdates(_0x594a1d){return function(_0x2ab819){try{jsonpatch[_0x8cff('0x22')](_0x2ab819,_0x594a1d,!![]);}catch(_0x225065){return BPromise[_0x8cff('0x23')](_0x225065);}return _0x2ab819[_0x8cff('0x24')]();};}function saveUpdates(_0x314fe0,_0x2d4770){return function(_0x53a9af){if(_0x53a9af){return _0x53a9af[_0x8cff('0x25')](_0x314fe0)[_0x8cff('0x26')](function(_0x54c3c6){return _0x54c3c6;});}return null;};}function removeEntity(_0x4e171c,_0x4b211e){return function(_0x1d4c93){if(_0x1d4c93){return _0x1d4c93[_0x8cff('0x27')]()[_0x8cff('0x26')](function(){var _0x284c87=_0x1d4c93[_0x8cff('0x28')]({'plain':!![]});var _0xacab79=_0x8cff('0x29');return db[_0x8cff('0x2a')]['destroy']({'where':{'type':_0xacab79,'resourceId':_0x284c87['id']}})[_0x8cff('0x26')](function(){return _0x1d4c93;});})['then'](function(){_0x4e171c[_0x8cff('0x1a')](0xcc)[_0x8cff('0x19')]();});}};}function handleEntityNotFound(_0x30ebab,_0x1ddf50){return function(_0x18221a){if(!_0x18221a){_0x30ebab[_0x8cff('0x18')](0x194);}return _0x18221a;};}function handleError(_0x447836,_0x3d3ea5){_0x3d3ea5=_0x3d3ea5||0x1f4;return function(_0x2f36c6){logger[_0x8cff('0x2b')](_0x2f36c6[_0x8cff('0x2c')]);if(_0x2f36c6[_0x8cff('0x2d')]){delete _0x2f36c6['name'];}_0x447836['status'](_0x3d3ea5)[_0x8cff('0x2e')](_0x2f36c6);};}exports[_0x8cff('0x2f')]=function(_0x43d693,_0x2f7e49){var _0x59f74b={},_0x4d1313={},_0x485fda={'count':0x0,'rows':[]};var _0x141d5a=_['map'](db[_0x8cff('0x30')]['rawAttributes'],function(_0x2bfee3){return{'name':_0x2bfee3['fieldName'],'type':_0x2bfee3['type'][_0x8cff('0x31')]};});_0x4d1313['model']=_[_0x8cff('0x32')](_0x141d5a,'name');_0x4d1313[_0x8cff('0x33')]=_['keys'](_0x43d693['query']);_0x4d1313[_0x8cff('0x34')]=_[_0x8cff('0x35')](_0x4d1313[_0x8cff('0x36')],_0x4d1313[_0x8cff('0x33')]);_0x59f74b[_0x8cff('0x37')]=_[_0x8cff('0x35')](_0x4d1313[_0x8cff('0x36')],qs[_0x8cff('0x38')](_0x43d693[_0x8cff('0x33')][_0x8cff('0x38')]));_0x59f74b[_0x8cff('0x37')]=_0x59f74b['attributes'][_0x8cff('0x39')]?_0x59f74b[_0x8cff('0x37')]:_0x4d1313['model'];if(!_0x43d693[_0x8cff('0x33')][_0x8cff('0x3a')](_0x8cff('0x3b'))){_0x59f74b[_0x8cff('0x1e')]=qs[_0x8cff('0x1e')](_0x43d693['query'][_0x8cff('0x1e')]);_0x59f74b['offset']=qs[_0x8cff('0x1c')](_0x43d693[_0x8cff('0x33')][_0x8cff('0x1c')]);}_0x59f74b[_0x8cff('0x3c')]=qs['sort'](_0x43d693[_0x8cff('0x33')]['sort']);_0x59f74b[_0x8cff('0x3d')]=qs[_0x8cff('0x34')](_[_0x8cff('0x3e')](_0x43d693[_0x8cff('0x33')],_0x4d1313[_0x8cff('0x34')]),_0x141d5a);if(_0x43d693[_0x8cff('0x33')][_0x8cff('0x3f')]){_0x59f74b['where']=_[_0x8cff('0x40')](_0x59f74b['where'],{'$or':_[_0x8cff('0x32')](_0x141d5a,function(_0x455813){if(_0x455813[_0x8cff('0x41')]!==_0x8cff('0x42')){var _0x545948={};_0x545948[_0x455813[_0x8cff('0x2d')]]={'$like':'%'+_0x43d693[_0x8cff('0x33')][_0x8cff('0x3f')]+'%'};return _0x545948;}})});}_0x59f74b=_[_0x8cff('0x40')]({},_0x59f74b,_0x43d693['options']);var _0x28e29a={'where':_0x59f74b[_0x8cff('0x3d')]};return db['VoiceChanSpy'][_0x8cff('0x1f')](_0x28e29a)['then'](function(_0x5c78a1){_0x485fda[_0x8cff('0x1f')]=_0x5c78a1;if(_0x43d693[_0x8cff('0x33')][_0x8cff('0x43')]){_0x59f74b[_0x8cff('0x44')]=[{'all':!![]}];}return db[_0x8cff('0x30')]['findAll'](_0x59f74b);})[_0x8cff('0x26')](function(_0x3c72eb){_0x485fda[_0x8cff('0x45')]=_0x3c72eb;return _0x485fda;})[_0x8cff('0x26')](respondWithFilteredResult(_0x2f7e49,_0x59f74b))[_0x8cff('0x46')](handleError(_0x2f7e49,null));};exports['show']=function(_0x4f1655,_0xf8b144){var _0x54638d={'raw':![],'where':{'id':_0x4f1655[_0x8cff('0x47')]['id']}},_0x52f58d={};_0x52f58d['model']=_[_0x8cff('0x48')](db[_0x8cff('0x30')][_0x8cff('0x49')]);_0x52f58d[_0x8cff('0x33')]=_[_0x8cff('0x48')](_0x4f1655['query']);_0x52f58d[_0x8cff('0x34')]=_['intersection'](_0x52f58d[_0x8cff('0x36')],_0x52f58d[_0x8cff('0x33')]);_0x54638d[_0x8cff('0x37')]=_['intersection'](_0x52f58d[_0x8cff('0x36')],qs[_0x8cff('0x38')](_0x4f1655['query'][_0x8cff('0x38')]));_0x54638d['attributes']=_0x54638d['attributes'][_0x8cff('0x39')]?_0x54638d['attributes']:_0x52f58d[_0x8cff('0x36')];if(_0x4f1655[_0x8cff('0x33')]['includeAll']){_0x54638d[_0x8cff('0x44')]=[{'all':!![]}];}_0x54638d=_['merge']({},_0x54638d,_0x4f1655[_0x8cff('0x4a')]);return db['VoiceChanSpy']['find'](_0x54638d)['then'](handleEntityNotFound(_0xf8b144,null))[_0x8cff('0x26')](respondWithResult(_0xf8b144,null))[_0x8cff('0x46')](handleError(_0xf8b144,null));};exports[_0x8cff('0x4b')]=function(_0x1b0810,_0x3501c5){return db['VoiceChanSpy'][_0x8cff('0x4b')](_0x1b0810[_0x8cff('0x4c')],{})[_0x8cff('0x26')](function(_0x1df172){var _0x5d6d13=_0x1b0810[_0x8cff('0x4d')]['get']({'plain':!![]});if(!_0x5d6d13)throw new Error(_0x8cff('0x4e'));if(_0x5d6d13[_0x8cff('0x4f')]==='user'){var _0x3c392f=_0x1df172[_0x8cff('0x28')]({'plain':!![]});var _0x5c5d='ChanSpies';return db[_0x8cff('0x50')]['find']({'where':{'name':_0x5c5d,'userProfileId':_0x5d6d13[_0x8cff('0x51')]},'raw':!![]})[_0x8cff('0x26')](function(_0x54a9de){if(_0x54a9de&&_0x54a9de['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3c392f['name'],'resourceId':_0x3c392f['id'],'type':_0x54a9de['name'],'sectionId':_0x54a9de['id']},{})[_0x8cff('0x26')](function(){return _0x1df172;});}else{return _0x1df172;}})[_0x8cff('0x46')](function(_0x5a43bd){logger[_0x8cff('0x2b')](_0x8cff('0x52'),_0x5a43bd);throw _0x5a43bd;});}return _0x1df172;})[_0x8cff('0x26')](respondWithResult(_0x3501c5,0xc9))[_0x8cff('0x46')](handleError(_0x3501c5,null));};exports[_0x8cff('0x25')]=function(_0x2e77a3,_0x54644d){if(_0x2e77a3['body']['id']){delete _0x2e77a3[_0x8cff('0x4c')]['id'];}return db[_0x8cff('0x30')][_0x8cff('0x53')]({'where':{'id':_0x2e77a3[_0x8cff('0x47')]['id']}})[_0x8cff('0x26')](handleEntityNotFound(_0x54644d,null))[_0x8cff('0x26')](saveUpdates(_0x2e77a3[_0x8cff('0x4c')],null))['then'](respondWithResult(_0x54644d,null))[_0x8cff('0x46')](handleError(_0x54644d,null));};exports[_0x8cff('0x27')]=function(_0x1f1e02,_0x27157e){return db['VoiceChanSpy'][_0x8cff('0x53')]({'where':{'id':_0x1f1e02[_0x8cff('0x47')]['id']}})[_0x8cff('0x26')](handleEntityNotFound(_0x27157e,null))[_0x8cff('0x26')](removeEntity(_0x27157e,null))[_0x8cff('0x46')](handleError(_0x27157e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 31b2835..dca792c 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 _0x194c=['destroy','util','bluebird','from-sip','format','%s%s','prefix','system','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','password','SIP/%s,%s','name','length','concat','internal','User','findAll','catch','define','then','VoiceExtension','bulkCreate'];(function(_0x126fac,_0x4451d9){var _0x267cfe=function(_0x155e99){while(--_0x155e99){_0x126fac['push'](_0x126fac['shift']());}};_0x267cfe(++_0x4451d9);}(_0x194c,0x140));var _0xc194=function(_0x444f8d,_0x125453){_0x444f8d=_0x444f8d-0x0;var _0x4fc701=_0x194c[_0x444f8d];return _0x4fc701;};'use strict';var _=require('lodash');var util=require(_0xc194('0x0'));var BPromise=require(_0xc194('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0xd431d2,_0x2ab7d4,_0x504ed0){var _0x1a7f37=0x1;var _0x1dc93f=[];var _0x1f1225={'context':_0x2ab7d4['context']||_0xc194('0x2'),'exten':util[_0xc194('0x3')](_0xc194('0x4'),_0xd431d2[_0xc194('0x5')],_0x504ed0),'type':_0xc194('0x6'),'isApp':![],'ChanSpyId':_0xd431d2['id'],'UserId':_0x2ab7d4['id']};_0x1dc93f['push'](_['merge']({'app':'Set','appdata':util[_0xc194('0x3')](_0xc194('0x7'),'chanspy'),'priority':_0x1a7f37++},_0x1f1225));if(_0xd431d2[_0xc194('0x8')]){_0x1dc93f['push'](_[_0xc194('0x9')]({'app':_0xc194('0xa'),'appdata':util[_0xc194('0x3')](_0xc194('0xb'),_0xd431d2[_0xc194('0xc')]),'priority':_0x1a7f37++},_0x1f1225));}if(_0xd431d2[_0xc194('0xd')]){_0x1dc93f[_0xc194('0xe')](_['merge']({'app':'Authenticate','appdata':_0xd431d2[_0xc194('0xf')],'priority':_0x1a7f37++},_0x1f1225));}_0x1dc93f[_0xc194('0xe')](_[_0xc194('0x9')]({'app':'ChanSpy','appdata':util[_0xc194('0x3')](_0xc194('0x10'),_0x2ab7d4[_0xc194('0x11')],_0xd431d2['options']?_0xd431d2['options']['join'](''):''),'priority':_0x1a7f37++},_0x1f1225));if(_0xd431d2['record']){_0x1dc93f[_0xc194('0xe')](_[_0xc194('0x9')]({'app':'StopMixMonitor','priority':_0x1a7f37++},_0x1f1225));}return _0x1dc93f;};var getChanSpyApplications=function(_0x3b1ef1,_0x33537b){var _0x56fd42=[];for(var _0x9fada0=0x0,_0x4559c0=0x1;_0x9fada0<_0x33537b[_0xc194('0x12')];_0x9fada0++,_0x4559c0=0x1){_0x56fd42=_0x56fd42[_0xc194('0x13')](getUserApplications(_0x3b1ef1,_0x33537b[_0x9fada0],_0x33537b[_0x9fada0][_0xc194('0x14')]));if(_0x33537b[_0x9fada0][_0xc194('0x14')]!=_0x33537b[_0x9fada0][_0xc194('0x11')]){_0x56fd42=_0x56fd42['concat'](getUserApplications(_0x3b1ef1,_0x33537b[_0x9fada0],_0x33537b[_0x9fada0][_0xc194('0x11')]));}}return _0x56fd42;};var getChanSpyPromise=function(_0x383913,_0x414e8e){return new BPromise(function(_0x52a9a0,_0x29dd46){return _0x383913[_0xc194('0x15')][_0xc194('0x16')]({'attributes':['id','name',_0xc194('0x14')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x1679ac){if(_0x1679ac){return _0x52a9a0(getChanSpyApplications(_0x414e8e,_0x1679ac));}return _0x52a9a0([]);})[_0xc194('0x17')](function(_0x138b7f){_0x29dd46(_0x138b7f);});});};module['exports']=function(_0x330afa,_0x39d8be){var _0x4807e7=_0x330afa['models'];return _0x330afa[_0xc194('0x18')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34b7d6,_0x5f271c,_0x5c4888){return getChanSpyPromise(_0x4807e7,_0x34b7d6)[_0xc194('0x19')](function(_0x231a70){if(_0x231a70&&_0x231a70['length']){return _0x4807e7[_0xc194('0x1a')][_0xc194('0x1b')](_0x231a70);}})[_0xc194('0x19')](function(){_0x5c4888();})[_0xc194('0x17')](function(_0x2a0387){_0x5c4888(_0x2a0387);});},'afterUpdate':function(_0x1fd1e4,_0x295eee,_0x2ad9f5){return _0x4807e7['VoiceExtension'][_0xc194('0x1c')]({'where':{'ChanSpyId':_0x1fd1e4['id']}})[_0xc194('0x19')](function(){return getChanSpyPromise(_0x4807e7,_0x1fd1e4);})[_0xc194('0x19')](function(_0x311efe){if(_0x311efe&&_0x311efe[_0xc194('0x12')]){return _0x4807e7['VoiceExtension'][_0xc194('0x1b')](_0x311efe);}})[_0xc194('0x19')](function(){_0x2ad9f5();})[_0xc194('0x17')](function(_0x5111ee){_0x2ad9f5(_0x5111ee);});},'afterDestroy':function(_0x47426c,_0x392f18,_0x5b5608){return _0x4807e7[_0xc194('0x1a')][_0xc194('0x1c')]({'where':{'ChanSpyId':_0x47426c['id']}})[_0xc194('0x19')](function(){_0x5b5608();})[_0xc194('0x17')](function(_0x45efb9){_0x5b5608(_0x45efb9);});}}});}; \ No newline at end of file +var _0x4ef5=['bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','CDR(type)=%s','record','MixMonitor','recordingFormat','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4ef5,0x17f));var _0x54ef=function(_0x77a355,_0x527485){_0x77a355=_0x77a355-0x0;var _0x2cefac=_0x4ef5[_0x77a355];return _0x2cefac;};'use strict';var _=require('lodash');var util=require(_0x54ef('0x0'));var BPromise=require(_0x54ef('0x1'));var attributes=require(_0x54ef('0x2'));var getUserApplications=function(_0x26203b,_0x393618,_0x8e4799){var _0x864bc9=0x1;var _0x460f45=[];var _0x234a06={'context':_0x393618[_0x54ef('0x3')]||_0x54ef('0x4'),'exten':util[_0x54ef('0x5')](_0x54ef('0x6'),_0x26203b[_0x54ef('0x7')],_0x8e4799),'type':_0x54ef('0x8'),'isApp':![],'ChanSpyId':_0x26203b['id'],'UserId':_0x393618['id']};_0x460f45[_0x54ef('0x9')](_['merge']({'app':'Set','appdata':util[_0x54ef('0x5')](_0x54ef('0xa'),'chanspy'),'priority':_0x864bc9++},_0x234a06));if(_0x26203b[_0x54ef('0xb')]){_0x460f45['push'](_['merge']({'app':_0x54ef('0xc'),'appdata':util[_0x54ef('0x5')]('${UNIQUEID}.%s,a',_0x26203b[_0x54ef('0xd')]),'priority':_0x864bc9++},_0x234a06));}if(_0x26203b[_0x54ef('0xe')]){_0x460f45[_0x54ef('0x9')](_[_0x54ef('0xf')]({'app':_0x54ef('0x10'),'appdata':_0x26203b[_0x54ef('0x11')],'priority':_0x864bc9++},_0x234a06));}_0x460f45[_0x54ef('0x9')](_[_0x54ef('0xf')]({'app':_0x54ef('0x12'),'appdata':util[_0x54ef('0x5')](_0x54ef('0x13'),_0x393618[_0x54ef('0x14')],_0x26203b[_0x54ef('0x15')]?_0x26203b[_0x54ef('0x15')][_0x54ef('0x16')](''):''),'priority':_0x864bc9++},_0x234a06));if(_0x26203b[_0x54ef('0xb')]){_0x460f45['push'](_[_0x54ef('0xf')]({'app':'StopMixMonitor','priority':_0x864bc9++},_0x234a06));}return _0x460f45;};var getChanSpyApplications=function(_0x5e59df,_0x2d2587){var _0x19f9a3=[];for(var _0x565428=0x0,_0x4b2dea=0x1;_0x565428<_0x2d2587[_0x54ef('0x17')];_0x565428++,_0x4b2dea=0x1){_0x19f9a3=_0x19f9a3[_0x54ef('0x18')](getUserApplications(_0x5e59df,_0x2d2587[_0x565428],_0x2d2587[_0x565428]['internal']));if(_0x2d2587[_0x565428][_0x54ef('0x19')]!=_0x2d2587[_0x565428]['name']){_0x19f9a3=_0x19f9a3[_0x54ef('0x18')](getUserApplications(_0x5e59df,_0x2d2587[_0x565428],_0x2d2587[_0x565428][_0x54ef('0x14')]));}}return _0x19f9a3;};var getChanSpyPromise=function(_0x1b713e,_0x5bf285){return new BPromise(function(_0x5c18f7,_0x330dc0){return _0x1b713e[_0x54ef('0x1a')][_0x54ef('0x1b')]({'attributes':['id',_0x54ef('0x14'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x358b7d){if(_0x358b7d){return _0x5c18f7(getChanSpyApplications(_0x5bf285,_0x358b7d));}return _0x5c18f7([]);})['catch'](function(_0x2d8d3d){_0x330dc0(_0x2d8d3d);});});};module[_0x54ef('0x1c')]=function(_0x470cc9,_0x497416){var _0x5655df=_0x470cc9[_0x54ef('0x1d')];return _0x470cc9[_0x54ef('0x1e')](_0x54ef('0x1f'),attributes,{'tableName':_0x54ef('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xf3a954,_0x35b112,_0x3335a9){return getChanSpyPromise(_0x5655df,_0xf3a954)[_0x54ef('0x21')](function(_0x2ab5b3){if(_0x2ab5b3&&_0x2ab5b3[_0x54ef('0x17')]){return _0x5655df[_0x54ef('0x22')][_0x54ef('0x23')](_0x2ab5b3);}})[_0x54ef('0x21')](function(){_0x3335a9();})[_0x54ef('0x24')](function(_0x51c02e){_0x3335a9(_0x51c02e);});},'afterUpdate':function(_0x4a3f8f,_0xca1e25,_0x205dd4){return _0x5655df[_0x54ef('0x22')][_0x54ef('0x25')]({'where':{'ChanSpyId':_0x4a3f8f['id']}})['then'](function(){return getChanSpyPromise(_0x5655df,_0x4a3f8f);})[_0x54ef('0x21')](function(_0x11bb53){if(_0x11bb53&&_0x11bb53[_0x54ef('0x17')]){return _0x5655df['VoiceExtension'][_0x54ef('0x23')](_0x11bb53);}})[_0x54ef('0x21')](function(){_0x205dd4();})[_0x54ef('0x24')](function(_0x2a53a8){_0x205dd4(_0x2a53a8);});},'afterDestroy':function(_0x464821,_0x27684e,_0x3b196e){return _0x5655df[_0x54ef('0x22')][_0x54ef('0x25')]({'where':{'ChanSpyId':_0x464821['id']}})[_0x54ef('0x21')](function(){_0x3b196e();})[_0x54ef('0x24')](function(_0x2aaff5){_0x3b196e(_0x2aaff5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2f7acd2..74b26c5 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 _0x9f4d=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x21a8a4,_0xf62896){var _0xd6736=function(_0x257ab9){while(--_0x257ab9){_0x21a8a4['push'](_0x21a8a4['shift']());}};_0xd6736(++_0xf62896);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x1613d9,_0x2f583e){_0x1613d9=_0x1613d9-0x0;var _0x1ab5e0=_0x9f4d[_0x1613d9];return _0x1ab5e0;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc036,_0x366b9d,_0x5cf448){return new BPromise(function(_0x6b13b5,_0x18305f){return client['request'](_0x2cc036,_0x5cf448)[_0xd9f4('0xc')](function(_0x47d52f){logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));logger[_0xd9f4('0x10')](_0xd9f4('0x11'),_0x366b9d,'request\x20sent',JSON[_0xd9f4('0x12')](_0x47d52f));if(_0x47d52f[_0xd9f4('0x13')]){if(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x14')]===0x1f4){logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x18305f(_0x47d52f['error'][_0xd9f4('0x15')]);}logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x6b13b5(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);}else{logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));_0x6b13b5(_0x47d52f[_0xd9f4('0x16')][_0xd9f4('0x15')]);}})[_0xd9f4('0x17')](function(_0x5e7da1){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x366b9d,_0x5e7da1);_0x18305f(_0x5e7da1);});});} \ No newline at end of file +var _0xf72b=['../../config/environment','jayson/promise','client','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x494299,_0x1b6f2a){var _0x5637a9=function(_0x381c66){while(--_0x381c66){_0x494299['push'](_0x494299['shift']());}};_0x5637a9(++_0x1b6f2a);}(_0xf72b,0x1d9));var _0xbf72=function(_0x475f3b,_0x1805d1){_0x475f3b=_0x475f3b-0x0;var _0x57ecb0=_0xf72b[_0x475f3b];return _0x57ecb0;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ebc2f9a..74a46ea 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 _0x8b28=['put','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','post','create'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0x8b28,0x15a));var _0x88b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b28[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x88b2('0x0'));var path=require(_0x88b2('0x1'));var timeout=require(_0x88b2('0x2'));var express=require(_0x88b2('0x3'));var router=express['Router']();var fs_extra=require(_0x88b2('0x4'));var auth=require(_0x88b2('0x5'));var interaction=require(_0x88b2('0x6'));var config=require(_0x88b2('0x7'));var controller=require(_0x88b2('0x8'));router[_0x88b2('0x9')]('/',auth[_0x88b2('0xa')](),controller[_0x88b2('0xb')]);router[_0x88b2('0x9')]('/:id',auth[_0x88b2('0xa')](),controller['show']);router[_0x88b2('0xc')]('/',auth[_0x88b2('0xa')](),controller[_0x88b2('0xd')]);router[_0x88b2('0xe')](_0x88b2('0xf'),auth[_0x88b2('0xa')](),controller['update']);router['delete'](_0x88b2('0xf'),auth[_0x88b2('0xa')](),controller[_0x88b2('0x10')]);module[_0x88b2('0x11')]=router; \ No newline at end of file +var _0xb259=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2ce840,_0x49f898){var _0x2fb534=function(_0x1b75b1){while(--_0x1b75b1){_0x2ce840['push'](_0x2ce840['shift']());}};_0x2fb534(++_0x49f898);}(_0xb259,0x64));var _0x9b25=function(_0x56355a,_0x138baf){_0x56355a=_0x56355a-0x0;var _0x573afa=_0xb259[_0x56355a];return _0x573afa;};'use strict';var multer=require('multer');var util=require(_0x9b25('0x0'));var path=require(_0x9b25('0x1'));var timeout=require(_0x9b25('0x2'));var express=require(_0x9b25('0x3'));var router=express[_0x9b25('0x4')]();var fs_extra=require(_0x9b25('0x5'));var auth=require(_0x9b25('0x6'));var interaction=require(_0x9b25('0x7'));var config=require(_0x9b25('0x8'));var controller=require(_0x9b25('0x9'));router[_0x9b25('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9b25('0xa')](_0x9b25('0xb'),auth[_0x9b25('0xc')](),controller[_0x9b25('0xd')]);router[_0x9b25('0xe')]('/',auth['isAuthenticated'](),controller[_0x9b25('0xf')]);router[_0x9b25('0x10')]('/:id',auth[_0x9b25('0xc')](),controller[_0x9b25('0x11')]);router[_0x9b25('0x12')]('/:id',auth[_0x9b25('0xc')](),controller[_0x9b25('0x13')]);module[_0x9b25('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index b0536a3..b34e23a 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 _0xcd8f=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd8f,0x1c0));var _0xfcd8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xcd8f[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xfcd8('0x0'));module[_0xfcd8('0x1')]={'name':{'type':Sequelize[_0xfcd8('0x2')],'unique':_0xfcd8('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfcd8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd33=['STRING','name','BOOLEAN','exports'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0xcd33,0xf3));var _0x3cd3=function(_0x18445a,_0x26ee18){_0x18445a=_0x18445a-0x0;var _0x985a84=_0xcd33[_0x18445a];return _0x985a84;};'use strict';var Sequelize=require('sequelize');module[_0x3cd3('0x0')]={'name':{'type':Sequelize[_0x3cd3('0x1')],'unique':_0x3cd3('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3cd3('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 60a6cda..f42367f 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 _0xa629=['update','destroy','Contexts','UserProfileResource','end','stack','name','send','index','VoiceContext','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','get','UserProfileSection','find','userProfileId','autoAssociation','render','Reload','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range'];(function(_0x534368,_0x44d9a5){var _0x19dd26=function(_0x24b02c){while(--_0x24b02c){_0x534368['push'](_0x534368['shift']());}};_0x19dd26(++_0x44d9a5);}(_0xa629,0x102));var _0x9a62=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa629[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a62('0x0'));var rimraf=require(_0x9a62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a62('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a62('0x3'));var Mustache=require(_0x9a62('0x4'));var util=require(_0x9a62('0x5'));var path=require(_0x9a62('0x6'));var sox=require('sox');var csv=require(_0x9a62('0x7'));var ejs=require(_0x9a62('0x8'));var fs=require('fs');var fs_extra=require(_0x9a62('0x9'));var _=require(_0x9a62('0xa'));var squel=require(_0x9a62('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a62('0xc'));var toCsv=require(_0x9a62('0x7'));var querystring=require('querystring');var Papa=require(_0x9a62('0xd'));var Redis=require(_0x9a62('0xe'));var authService=require(_0x9a62('0xf'));var qs=require(_0x9a62('0x10'));var as=require(_0x9a62('0x11'));var hardwareService=require(_0x9a62('0x12'));var logger=require(_0x9a62('0x13'))(_0x9a62('0x14'));var utils=require(_0x9a62('0x15'));var config=require(_0x9a62('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a62('0x17'))['db'];var jayson=require(_0x9a62('0x18'));var client=jayson[_0x9a62('0x19')][_0x9a62('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x49b5db,_0x5bdb0c,_0x16b46e,_0x40e5b2){return new BPromise(function(_0x4a769c,_0x5a86ea){var _0xb94cfe=_0x40e5b2||client;return _0xb94cfe[_0x9a62('0x1b')](_0x49b5db,_0x16b46e)[_0x9a62('0x1c')](function(_0x54af62){logger[_0x9a62('0x1d')](_0x9a62('0x1e'),_0x5bdb0c,_0x9a62('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5bdb0c,_0x9a62('0x1f'),JSON[_0x9a62('0x20')](_0x54af62));if(_0x54af62['error']){if(_0x54af62[_0x9a62('0x21')]['code']===0x1f4){logger[_0x9a62('0x21')](_0x9a62('0x1e'),_0x5bdb0c,_0x54af62[_0x9a62('0x21')][_0x9a62('0x22')]);return _0x5a86ea(_0x54af62[_0x9a62('0x21')][_0x9a62('0x22')]);}logger[_0x9a62('0x21')]('VoiceContext,\x20%s,\x20%s',_0x5bdb0c,_0x54af62['error']['message']);return _0x4a769c(_0x54af62[_0x9a62('0x21')][_0x9a62('0x22')]);}else{logger[_0x9a62('0x1d')](_0x9a62('0x1e'),_0x5bdb0c,_0x9a62('0x1f'));_0x4a769c(_0x54af62[_0x9a62('0x23')][_0x9a62('0x22')]);}})[_0x9a62('0x24')](function(_0x528ed0){logger[_0x9a62('0x21')](_0x9a62('0x1e'),_0x5bdb0c,_0x528ed0);_0x5a86ea(_0x528ed0);});});}function respondWithStatusCode(_0x285651,_0x4bc77d){_0x4bc77d=_0x4bc77d||0xcc;return function(_0x5a97bd){if(_0x5a97bd){return _0x285651[_0x9a62('0x25')](_0x4bc77d);}return _0x285651[_0x9a62('0x26')](_0x4bc77d)['end']();};}function respondWithResult(_0x1a3ea0,_0x363d68){_0x363d68=_0x363d68||0xc8;return function(_0x5e19ae){if(_0x5e19ae){return _0x1a3ea0[_0x9a62('0x26')](_0x363d68)[_0x9a62('0x27')](_0x5e19ae);}};}function respondWithFilteredResult(_0x228c4b,_0x5922d6){return function(_0x11b63f){if(_0x11b63f){var _0xdb43d9=typeof _0x5922d6[_0x9a62('0x28')]===_0x9a62('0x29')&&typeof _0x5922d6['limit']==='undefined';var _0x1c5bbb=_0x11b63f['count'];var _0x1cb6e6=_0xdb43d9?0x0:_0x5922d6[_0x9a62('0x28')];var _0x6d389f=_0xdb43d9?_0x11b63f[_0x9a62('0x2a')]:_0x5922d6['offset']+_0x5922d6[_0x9a62('0x2b')];var _0x2095d7;if(_0x6d389f>=_0x1c5bbb){_0x6d389f=_0x1c5bbb;_0x2095d7=0xc8;}else{_0x2095d7=0xce;}_0x228c4b[_0x9a62('0x26')](_0x2095d7);return _0x228c4b['set'](_0x9a62('0x2c'),_0x1cb6e6+'-'+_0x6d389f+'/'+_0x1c5bbb)['json'](_0x11b63f);}return null;};}function patchUpdates(_0x65c968){return function(_0x1cf8ea){try{jsonpatch['apply'](_0x1cf8ea,_0x65c968,!![]);}catch(_0x53aaab){return BPromise['reject'](_0x53aaab);}return _0x1cf8ea['save']();};}function saveUpdates(_0x40bf37,_0x100d4a){return function(_0x2b7b0b){if(_0x2b7b0b){return _0x2b7b0b[_0x9a62('0x2d')](_0x40bf37)['then'](function(_0x31a427){return _0x31a427;});}return null;};}function removeEntity(_0x2f840a,_0x51a056){return function(_0x22eabc){if(_0x22eabc){return _0x22eabc[_0x9a62('0x2e')]()[_0x9a62('0x1c')](function(){var _0x263355=_0x22eabc['get']({'plain':!![]});var _0x924ed0=_0x9a62('0x2f');return db[_0x9a62('0x30')][_0x9a62('0x2e')]({'where':{'type':_0x924ed0,'resourceId':_0x263355['id']}})['then'](function(){return _0x22eabc;});})[_0x9a62('0x1c')](function(){_0x2f840a[_0x9a62('0x26')](0xcc)[_0x9a62('0x31')]();});}};}function handleEntityNotFound(_0x3365c2,_0x7a36c){return function(_0x56424a){if(!_0x56424a){_0x3365c2['sendStatus'](0x194);}return _0x56424a;};}function handleError(_0x438386,_0x5097ac){_0x5097ac=_0x5097ac||0x1f4;return function(_0x51f637){logger['error'](_0x51f637[_0x9a62('0x32')]);if(_0x51f637[_0x9a62('0x33')]){delete _0x51f637[_0x9a62('0x33')];}_0x438386['status'](_0x5097ac)[_0x9a62('0x34')](_0x51f637);};}exports[_0x9a62('0x35')]=function(_0x24aea8,_0x90994b){var _0x31b722={},_0x1365ad={},_0x219eea={'count':0x0,'rows':[]};var _0x2a1e85=_['map'](db[_0x9a62('0x36')][_0x9a62('0x37')],function(_0x2346da){return{'name':_0x2346da[_0x9a62('0x38')],'type':_0x2346da['type'][_0x9a62('0x39')]};});_0x1365ad[_0x9a62('0x3a')]=_[_0x9a62('0x3b')](_0x2a1e85,_0x9a62('0x33'));_0x1365ad[_0x9a62('0x3c')]=_['keys'](_0x24aea8['query']);_0x1365ad[_0x9a62('0x3d')]=_[_0x9a62('0x3e')](_0x1365ad['model'],_0x1365ad[_0x9a62('0x3c')]);_0x31b722[_0x9a62('0x3f')]=_[_0x9a62('0x3e')](_0x1365ad['model'],qs[_0x9a62('0x40')](_0x24aea8[_0x9a62('0x3c')][_0x9a62('0x40')]));_0x31b722[_0x9a62('0x3f')]=_0x31b722[_0x9a62('0x3f')][_0x9a62('0x41')]?_0x31b722[_0x9a62('0x3f')]:_0x1365ad[_0x9a62('0x3a')];if(!_0x24aea8[_0x9a62('0x3c')]['hasOwnProperty']('nolimit')){_0x31b722[_0x9a62('0x2b')]=qs[_0x9a62('0x2b')](_0x24aea8[_0x9a62('0x3c')][_0x9a62('0x2b')]);_0x31b722[_0x9a62('0x28')]=qs[_0x9a62('0x28')](_0x24aea8[_0x9a62('0x3c')][_0x9a62('0x28')]);}_0x31b722[_0x9a62('0x42')]=qs[_0x9a62('0x43')](_0x24aea8['query'][_0x9a62('0x43')]);_0x31b722[_0x9a62('0x44')]=qs[_0x9a62('0x3d')](_[_0x9a62('0x45')](_0x24aea8[_0x9a62('0x3c')],_0x1365ad['filters']),_0x2a1e85);if(_0x24aea8['query'][_0x9a62('0x46')]){_0x31b722[_0x9a62('0x44')]=_[_0x9a62('0x47')](_0x31b722[_0x9a62('0x44')],{'$or':_[_0x9a62('0x3b')](_0x2a1e85,function(_0x557f25){if(_0x557f25[_0x9a62('0x48')]!==_0x9a62('0x49')){var _0x1d4926={};_0x1d4926[_0x557f25[_0x9a62('0x33')]]={'$like':'%'+_0x24aea8['query'][_0x9a62('0x46')]+'%'};return _0x1d4926;}})});}_0x31b722=_['merge']({},_0x31b722,_0x24aea8[_0x9a62('0x4a')]);var _0x4d2177={'where':_0x31b722[_0x9a62('0x44')]};return db[_0x9a62('0x36')][_0x9a62('0x2a')](_0x4d2177)[_0x9a62('0x1c')](function(_0x3615f4){_0x219eea['count']=_0x3615f4;if(_0x24aea8[_0x9a62('0x3c')][_0x9a62('0x4b')]){_0x31b722[_0x9a62('0x4c')]=[{'all':!![]}];}return db[_0x9a62('0x36')][_0x9a62('0x4d')](_0x31b722);})[_0x9a62('0x1c')](function(_0x383341){_0x219eea[_0x9a62('0x4e')]=_0x383341;return _0x219eea;})['then'](respondWithFilteredResult(_0x90994b,_0x31b722))['catch'](handleError(_0x90994b,null));};exports[_0x9a62('0x4f')]=function(_0x2f189f,_0x17be89){var _0xcf9a21={'raw':![],'where':{'id':_0x2f189f[_0x9a62('0x50')]['id']}},_0x34118a={};_0x34118a[_0x9a62('0x3a')]=_[_0x9a62('0x51')](db[_0x9a62('0x36')][_0x9a62('0x37')]);_0x34118a[_0x9a62('0x3c')]=_[_0x9a62('0x51')](_0x2f189f[_0x9a62('0x3c')]);_0x34118a['filters']=_['intersection'](_0x34118a[_0x9a62('0x3a')],_0x34118a['query']);_0xcf9a21[_0x9a62('0x3f')]=_[_0x9a62('0x3e')](_0x34118a['model'],qs['fields'](_0x2f189f['query'][_0x9a62('0x40')]));_0xcf9a21[_0x9a62('0x3f')]=_0xcf9a21[_0x9a62('0x3f')][_0x9a62('0x41')]?_0xcf9a21[_0x9a62('0x3f')]:_0x34118a[_0x9a62('0x3a')];if(_0x2f189f[_0x9a62('0x3c')][_0x9a62('0x4b')]){_0xcf9a21['include']=[{'all':!![]}];}_0xcf9a21=_['merge']({},_0xcf9a21,_0x2f189f[_0x9a62('0x4a')]);return db[_0x9a62('0x36')]['find'](_0xcf9a21)['then'](handleEntityNotFound(_0x17be89,null))[_0x9a62('0x1c')](respondWithResult(_0x17be89,null))[_0x9a62('0x24')](handleError(_0x17be89,null));};exports[_0x9a62('0x52')]=function(_0x9c23ea,_0x279e38,_0x1beae4){var _0x3d5e9c;return db[_0x9a62('0x36')][_0x9a62('0x52')](_0x9c23ea[_0x9a62('0x53')],{'raw':!![]})[_0x9a62('0x1c')](function(_0x1b942a){_0x3d5e9c=_0x1b942a;return db[_0x9a62('0x36')][_0x9a62('0x4d')]({'raw':!![]});})[_0x9a62('0x1c')](function(_0x4cf8b0){var _0x2f0fd0=fs[_0x9a62('0x54')](path[_0x9a62('0x55')](config[_0x9a62('0x56')],_0x9a62('0x57')),_0x9a62('0x58'));var _0x462411=ejs['render'](_0x2f0fd0,{'contexts':_0x4cf8b0||[]});fs[_0x9a62('0x59')](_0x9a62('0x5a'),_0x462411);})['then'](function(){return respondWithRpcPromise('Reload',_0x9a62('0x52'),{'module':_0x9a62('0x5b')});})['then'](function(){var _0x58d777=_0x9c23ea[_0x9a62('0x5c')]['get']({'plain':!![]});if(!_0x58d777)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d777[_0x9a62('0x5d')]==='user'){var _0x29045b=_0x3d5e9c[_0x9a62('0x5e')]({'plain':!![]});return db[_0x9a62('0x5f')][_0x9a62('0x60')]({'where':{'name':_0x9a62('0x2f'),'userProfileId':_0x58d777[_0x9a62('0x61')]},'raw':!![]})[_0x9a62('0x1c')](function(_0xb6bf55){if(_0xb6bf55&&_0xb6bf55[_0x9a62('0x62')]===0x0){return db[_0x9a62('0x30')]['create']({'name':_0x29045b[_0x9a62('0x33')],'resourceId':_0x29045b['id'],'type':_0xb6bf55[_0x9a62('0x33')],'sectionId':_0xb6bf55['id']},{})[_0x9a62('0x1c')](function(){return _0x3d5e9c;});}else{return _0x3d5e9c;}})[_0x9a62('0x24')](function(_0x2d367a){logger[_0x9a62('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d367a);throw _0x2d367a;});}return _0x3d5e9c;})['then'](respondWithResult(_0x279e38,0xc9))[_0x9a62('0x24')](handleError(_0x279e38,null));};exports[_0x9a62('0x2d')]=function(_0x5301e1,_0x37407f,_0x4e4dee){var _0x32d563;return db[_0x9a62('0x36')][_0x9a62('0x60')]({'where':{'id':_0x5301e1[_0x9a62('0x50')]['id']}})[_0x9a62('0x1c')](handleEntityNotFound(_0x37407f,null))[_0x9a62('0x1c')](saveUpdates(_0x5301e1[_0x9a62('0x53')],null))[_0x9a62('0x1c')](function(_0x13d5c9){if(_0x13d5c9){_0x32d563=_0x13d5c9;return db['VoiceContext'][_0x9a62('0x4d')]({'raw':!![]});}})[_0x9a62('0x1c')](function(_0x82954a){var _0x43b78d=fs['readFileSync'](path[_0x9a62('0x55')](config[_0x9a62('0x56')],_0x9a62('0x57')),_0x9a62('0x58'));var _0x806d84=ejs[_0x9a62('0x63')](_0x43b78d,{'contexts':_0x82954a||[]});fs['writeFileSync'](_0x9a62('0x5a'),_0x806d84);})[_0x9a62('0x1c')](function(){return respondWithRpcPromise(_0x9a62('0x64'),_0x9a62('0x2d'),{'module':_0x9a62('0x5b')});})[_0x9a62('0x1c')](function(){return _0x32d563;})[_0x9a62('0x1c')](respondWithResult(_0x37407f,null))[_0x9a62('0x24')](handleError(_0x37407f,null));};exports['destroy']=function(_0x22d33b,_0x477f69,_0x139e0a){var _0x4d2799;return db[_0x9a62('0x36')][_0x9a62('0x60')]({'where':{'id':_0x22d33b['params']['id']}})['then'](handleEntityNotFound(_0x477f69,null))['then'](removeEntity(_0x477f69,null))['then'](function(){return db[_0x9a62('0x36')][_0x9a62('0x4d')]({'raw':!![]});})['then'](function(_0x3a6fb9){var _0xa248e9=fs[_0x9a62('0x54')](path['join'](config[_0x9a62('0x56')],_0x9a62('0x57')),_0x9a62('0x58'));var _0x42f107=ejs[_0x9a62('0x63')](_0xa248e9,{'contexts':_0x3a6fb9});fs[_0x9a62('0x59')](_0x9a62('0x5a'),_0x42f107);return respondWithRpcPromise(_0x9a62('0x64'),_0x9a62('0x2e'),{'module':_0x9a62('0x5b')});})[_0x9a62('0x24')](handleError(_0x477f69,null));}; \ No newline at end of file +var _0x211e=['root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','Reload','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','status','end','json','undefined','limit','count','offset','set','apply','reject','update','destroy','get','sendStatus','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','join'];(function(_0x2d6708,_0x1b3585){var _0x1e9cba=function(_0xea7015){while(--_0xea7015){_0x2d6708['push'](_0x2d6708['shift']());}};_0x1e9cba(++_0x1b3585);}(_0x211e,0x1b9));var _0xe211=function(_0x54bdbb,_0x3588e8){_0x54bdbb=_0x54bdbb-0x0;var _0x39d2cd=_0x211e[_0x54bdbb];return _0x39d2cd;};'use strict';var emlformat=require(_0xe211('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe211('0x1'));var jsonpatch=require(_0xe211('0x2'));var rp=require('request-promise');var moment=require(_0xe211('0x3'));var BPromise=require(_0xe211('0x4'));var Mustache=require(_0xe211('0x5'));var util=require('util');var path=require(_0xe211('0x6'));var sox=require(_0xe211('0x7'));var csv=require('to-csv');var ejs=require(_0xe211('0x8'));var fs=require('fs');var fs_extra=require(_0xe211('0x9'));var _=require(_0xe211('0xa'));var squel=require(_0xe211('0xb'));var crypto=require(_0xe211('0xc'));var jsforce=require(_0xe211('0xd'));var deskjs=require(_0xe211('0xe'));var toCsv=require(_0xe211('0xf'));var querystring=require('querystring');var Papa=require(_0xe211('0x10'));var Redis=require(_0xe211('0x11'));var authService=require(_0xe211('0x12'));var qs=require(_0xe211('0x13'));var as=require(_0xe211('0x14'));var hardwareService=require(_0xe211('0x15'));var logger=require(_0xe211('0x16'))(_0xe211('0x17'));var utils=require(_0xe211('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe211('0x19'))['db'];var jayson=require(_0xe211('0x1a'));var client=jayson[_0xe211('0x1b')][_0xe211('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x159a12,_0x59d2c0,_0x2ba5be,_0x4ca928){return new BPromise(function(_0x11468d,_0x24e01f){var _0x53d588=_0x4ca928||client;return _0x53d588[_0xe211('0x1d')](_0x159a12,_0x2ba5be)[_0xe211('0x1e')](function(_0x94c0cf){logger[_0xe211('0x1f')](_0xe211('0x20'),_0x59d2c0,_0xe211('0x21'));logger['debug'](_0xe211('0x22'),_0x59d2c0,_0xe211('0x21'),JSON[_0xe211('0x23')](_0x94c0cf));if(_0x94c0cf['error']){if(_0x94c0cf['error'][_0xe211('0x24')]===0x1f4){logger[_0xe211('0x25')](_0xe211('0x20'),_0x59d2c0,_0x94c0cf[_0xe211('0x25')]['message']);return _0x24e01f(_0x94c0cf[_0xe211('0x25')][_0xe211('0x26')]);}logger[_0xe211('0x25')](_0xe211('0x20'),_0x59d2c0,_0x94c0cf['error'][_0xe211('0x26')]);return _0x11468d(_0x94c0cf[_0xe211('0x25')][_0xe211('0x26')]);}else{logger['info'](_0xe211('0x20'),_0x59d2c0,_0xe211('0x21'));_0x11468d(_0x94c0cf['result']['message']);}})[_0xe211('0x27')](function(_0x1b3881){logger[_0xe211('0x25')](_0xe211('0x20'),_0x59d2c0,_0x1b3881);_0x24e01f(_0x1b3881);});});}function respondWithStatusCode(_0x23b92d,_0x551f3a){_0x551f3a=_0x551f3a||0xcc;return function(_0x1db13e){if(_0x1db13e){return _0x23b92d['sendStatus'](_0x551f3a);}return _0x23b92d[_0xe211('0x28')](_0x551f3a)[_0xe211('0x29')]();};}function respondWithResult(_0x3c0f61,_0x18731e){_0x18731e=_0x18731e||0xc8;return function(_0x1105b6){if(_0x1105b6){return _0x3c0f61[_0xe211('0x28')](_0x18731e)[_0xe211('0x2a')](_0x1105b6);}};}function respondWithFilteredResult(_0xfa0995,_0x4f4022){return function(_0x22f3d4){if(_0x22f3d4){var _0x304394=typeof _0x4f4022['offset']===_0xe211('0x2b')&&typeof _0x4f4022[_0xe211('0x2c')]===_0xe211('0x2b');var _0x5ab9f7=_0x22f3d4[_0xe211('0x2d')];var _0x5bf9b6=_0x304394?0x0:_0x4f4022['offset'];var _0x4f2f0e=_0x304394?_0x22f3d4['count']:_0x4f4022[_0xe211('0x2e')]+_0x4f4022['limit'];var _0x1a0cde;if(_0x4f2f0e>=_0x5ab9f7){_0x4f2f0e=_0x5ab9f7;_0x1a0cde=0xc8;}else{_0x1a0cde=0xce;}_0xfa0995[_0xe211('0x28')](_0x1a0cde);return _0xfa0995[_0xe211('0x2f')]('Content-Range',_0x5bf9b6+'-'+_0x4f2f0e+'/'+_0x5ab9f7)[_0xe211('0x2a')](_0x22f3d4);}return null;};}function patchUpdates(_0x145d86){return function(_0x5256ed){try{jsonpatch[_0xe211('0x30')](_0x5256ed,_0x145d86,!![]);}catch(_0x13ba60){return BPromise[_0xe211('0x31')](_0x13ba60);}return _0x5256ed['save']();};}function saveUpdates(_0x41bd68,_0x25f935){return function(_0x357355){if(_0x357355){return _0x357355[_0xe211('0x32')](_0x41bd68)[_0xe211('0x1e')](function(_0x58bb6b){return _0x58bb6b;});}return null;};}function removeEntity(_0x103993,_0xd6d709){return function(_0x2994d9){if(_0x2994d9){return _0x2994d9[_0xe211('0x33')]()[_0xe211('0x1e')](function(){var _0x5c4f09=_0x2994d9[_0xe211('0x34')]({'plain':!![]});var _0x3230c5='Contexts';return db['UserProfileResource'][_0xe211('0x33')]({'where':{'type':_0x3230c5,'resourceId':_0x5c4f09['id']}})[_0xe211('0x1e')](function(){return _0x2994d9;});})[_0xe211('0x1e')](function(){_0x103993[_0xe211('0x28')](0xcc)[_0xe211('0x29')]();});}};}function handleEntityNotFound(_0x2146d0,_0x200f53){return function(_0x40c2c5){if(!_0x40c2c5){_0x2146d0[_0xe211('0x35')](0x194);}return _0x40c2c5;};}function handleError(_0x2d34c4,_0x5a5aa7){_0x5a5aa7=_0x5a5aa7||0x1f4;return function(_0x3e8997){logger[_0xe211('0x25')](_0x3e8997[_0xe211('0x36')]);if(_0x3e8997[_0xe211('0x37')]){delete _0x3e8997[_0xe211('0x37')];}_0x2d34c4[_0xe211('0x28')](_0x5a5aa7)['send'](_0x3e8997);};}exports[_0xe211('0x38')]=function(_0x34e302,_0x3a137d){var _0x424a09={},_0x325304={},_0x81b345={'count':0x0,'rows':[]};var _0x42a114=_[_0xe211('0x39')](db[_0xe211('0x3a')][_0xe211('0x3b')],function(_0x187399){return{'name':_0x187399[_0xe211('0x3c')],'type':_0x187399[_0xe211('0x3d')][_0xe211('0x3e')]};});_0x325304[_0xe211('0x3f')]=_['map'](_0x42a114,_0xe211('0x37'));_0x325304[_0xe211('0x40')]=_[_0xe211('0x41')](_0x34e302['query']);_0x325304[_0xe211('0x42')]=_[_0xe211('0x43')](_0x325304[_0xe211('0x3f')],_0x325304['query']);_0x424a09[_0xe211('0x44')]=_['intersection'](_0x325304[_0xe211('0x3f')],qs[_0xe211('0x45')](_0x34e302[_0xe211('0x40')]['fields']));_0x424a09['attributes']=_0x424a09[_0xe211('0x44')][_0xe211('0x46')]?_0x424a09[_0xe211('0x44')]:_0x325304[_0xe211('0x3f')];if(!_0x34e302[_0xe211('0x40')][_0xe211('0x47')]('nolimit')){_0x424a09[_0xe211('0x2c')]=qs[_0xe211('0x2c')](_0x34e302[_0xe211('0x40')][_0xe211('0x2c')]);_0x424a09['offset']=qs[_0xe211('0x2e')](_0x34e302[_0xe211('0x40')]['offset']);}_0x424a09[_0xe211('0x48')]=qs[_0xe211('0x49')](_0x34e302[_0xe211('0x40')][_0xe211('0x49')]);_0x424a09[_0xe211('0x4a')]=qs[_0xe211('0x42')](_[_0xe211('0x4b')](_0x34e302[_0xe211('0x40')],_0x325304[_0xe211('0x42')]),_0x42a114);if(_0x34e302[_0xe211('0x40')][_0xe211('0x4c')]){_0x424a09[_0xe211('0x4a')]=_[_0xe211('0x4d')](_0x424a09['where'],{'$or':_[_0xe211('0x39')](_0x42a114,function(_0x51c016){if(_0x51c016[_0xe211('0x3d')]!=='VIRTUAL'){var _0x584f7b={};_0x584f7b[_0x51c016['name']]={'$like':'%'+_0x34e302[_0xe211('0x40')]['filter']+'%'};return _0x584f7b;}})});}_0x424a09=_[_0xe211('0x4d')]({},_0x424a09,_0x34e302[_0xe211('0x4e')]);var _0x4bb5a3={'where':_0x424a09[_0xe211('0x4a')]};return db[_0xe211('0x3a')][_0xe211('0x2d')](_0x4bb5a3)['then'](function(_0x2d5fef){_0x81b345[_0xe211('0x2d')]=_0x2d5fef;if(_0x34e302[_0xe211('0x40')][_0xe211('0x4f')]){_0x424a09[_0xe211('0x50')]=[{'all':!![]}];}return db[_0xe211('0x3a')][_0xe211('0x51')](_0x424a09);})[_0xe211('0x1e')](function(_0x31d4bd){_0x81b345[_0xe211('0x52')]=_0x31d4bd;return _0x81b345;})['then'](respondWithFilteredResult(_0x3a137d,_0x424a09))['catch'](handleError(_0x3a137d,null));};exports[_0xe211('0x53')]=function(_0x55163d,_0x57f741){var _0x1faf10={'raw':![],'where':{'id':_0x55163d[_0xe211('0x54')]['id']}},_0x2ffa9a={};_0x2ffa9a[_0xe211('0x3f')]=_[_0xe211('0x41')](db['VoiceContext'][_0xe211('0x3b')]);_0x2ffa9a['query']=_[_0xe211('0x41')](_0x55163d[_0xe211('0x40')]);_0x2ffa9a['filters']=_[_0xe211('0x43')](_0x2ffa9a[_0xe211('0x3f')],_0x2ffa9a[_0xe211('0x40')]);_0x1faf10[_0xe211('0x44')]=_[_0xe211('0x43')](_0x2ffa9a[_0xe211('0x3f')],qs[_0xe211('0x45')](_0x55163d['query']['fields']));_0x1faf10[_0xe211('0x44')]=_0x1faf10[_0xe211('0x44')]['length']?_0x1faf10['attributes']:_0x2ffa9a['model'];if(_0x55163d[_0xe211('0x40')]['includeAll']){_0x1faf10[_0xe211('0x50')]=[{'all':!![]}];}_0x1faf10=_[_0xe211('0x4d')]({},_0x1faf10,_0x55163d['options']);return db[_0xe211('0x3a')][_0xe211('0x55')](_0x1faf10)[_0xe211('0x1e')](handleEntityNotFound(_0x57f741,null))[_0xe211('0x1e')](respondWithResult(_0x57f741,null))[_0xe211('0x27')](handleError(_0x57f741,null));};exports[_0xe211('0x56')]=function(_0x2e8294,_0x21d3b7,_0x29112e){var _0x4795eb;return db[_0xe211('0x3a')]['create'](_0x2e8294[_0xe211('0x57')],{'raw':!![]})[_0xe211('0x1e')](function(_0xaf90b5){_0x4795eb=_0xaf90b5;return db[_0xe211('0x3a')]['findAll']({'raw':!![]});})[_0xe211('0x1e')](function(_0x254f98){var _0x36ebd6=fs['readFileSync'](path[_0xe211('0x58')](config[_0xe211('0x59')],_0xe211('0x5a')),_0xe211('0x5b'));var _0x2bbff8=ejs[_0xe211('0x5c')](_0x36ebd6,{'contexts':_0x254f98||[]});fs[_0xe211('0x5d')](_0xe211('0x5e'),_0x2bbff8);})[_0xe211('0x1e')](function(){return respondWithRpcPromise('Reload',_0xe211('0x56'),{'module':_0xe211('0x5f')});})[_0xe211('0x1e')](function(){var _0x29bf5e=_0x2e8294[_0xe211('0x60')][_0xe211('0x34')]({'plain':!![]});if(!_0x29bf5e)throw new Error(_0xe211('0x61'));if(_0x29bf5e[_0xe211('0x62')]===_0xe211('0x60')){var _0x356618=_0x4795eb['get']({'plain':!![]});return db[_0xe211('0x63')][_0xe211('0x55')]({'where':{'name':_0xe211('0x64'),'userProfileId':_0x29bf5e['userProfileId']},'raw':!![]})[_0xe211('0x1e')](function(_0x7bb13f){if(_0x7bb13f&&_0x7bb13f[_0xe211('0x65')]===0x0){return db[_0xe211('0x66')]['create']({'name':_0x356618[_0xe211('0x37')],'resourceId':_0x356618['id'],'type':_0x7bb13f[_0xe211('0x37')],'sectionId':_0x7bb13f['id']},{})[_0xe211('0x1e')](function(){return _0x4795eb;});}else{return _0x4795eb;}})['catch'](function(_0x4c9cd9){logger[_0xe211('0x25')](_0xe211('0x67'),_0x4c9cd9);throw _0x4c9cd9;});}return _0x4795eb;})['then'](respondWithResult(_0x21d3b7,0xc9))[_0xe211('0x27')](handleError(_0x21d3b7,null));};exports[_0xe211('0x32')]=function(_0x4f8d5e,_0x2c0566,_0x29139e){var _0x4d9d09;return db[_0xe211('0x3a')]['find']({'where':{'id':_0x4f8d5e['params']['id']}})[_0xe211('0x1e')](handleEntityNotFound(_0x2c0566,null))[_0xe211('0x1e')](saveUpdates(_0x4f8d5e[_0xe211('0x57')],null))[_0xe211('0x1e')](function(_0x1395ad){if(_0x1395ad){_0x4d9d09=_0x1395ad;return db[_0xe211('0x3a')][_0xe211('0x51')]({'raw':!![]});}})[_0xe211('0x1e')](function(_0x16aaca){var _0x2cb47c=fs[_0xe211('0x68')](path[_0xe211('0x58')](config[_0xe211('0x59')],_0xe211('0x5a')),_0xe211('0x5b'));var _0x55562d=ejs[_0xe211('0x5c')](_0x2cb47c,{'contexts':_0x16aaca||[]});fs[_0xe211('0x5d')](_0xe211('0x5e'),_0x55562d);})['then'](function(){return respondWithRpcPromise(_0xe211('0x69'),_0xe211('0x32'),{'module':_0xe211('0x5f')});})[_0xe211('0x1e')](function(){return _0x4d9d09;})['then'](respondWithResult(_0x2c0566,null))[_0xe211('0x27')](handleError(_0x2c0566,null));};exports['destroy']=function(_0x2da69d,_0x9e08aa,_0x48846f){var _0x52d7cc;return db[_0xe211('0x3a')][_0xe211('0x55')]({'where':{'id':_0x2da69d['params']['id']}})[_0xe211('0x1e')](handleEntityNotFound(_0x9e08aa,null))[_0xe211('0x1e')](removeEntity(_0x9e08aa,null))[_0xe211('0x1e')](function(){return db[_0xe211('0x3a')][_0xe211('0x51')]({'raw':!![]});})[_0xe211('0x1e')](function(_0x21b471){var _0x479d1f=fs[_0xe211('0x68')](path[_0xe211('0x58')](config[_0xe211('0x59')],'server/files/templates/context.ejs'),_0xe211('0x5b'));var _0x202d09=ejs['render'](_0x479d1f,{'contexts':_0x21b471});fs['writeFileSync'](_0xe211('0x5e'),_0x202d09);return respondWithRpcPromise(_0xe211('0x69'),_0xe211('0x33'),{'module':_0xe211('0x5f')});})['catch'](handleError(_0x9e08aa,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2a07e53..8c9925b 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 _0xb52a=['../../config/logger','api','moment','request-promise','path','./voiceContext.attributes','define','voice_contexts','lodash','util'];(function(_0x5041a3,_0x405c74){var _0x7d6589=function(_0x4fd50b){while(--_0x4fd50b){_0x5041a3['push'](_0x5041a3['shift']());}};_0x7d6589(++_0x405c74);}(_0xb52a,0x148));var _0xab52=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb52a[_0x246148];return _0x453d94;};'use strict';var _=require(_0xab52('0x0'));var util=require(_0xab52('0x1'));var logger=require(_0xab52('0x2'))(_0xab52('0x3'));var moment=require(_0xab52('0x4'));var BPromise=require('bluebird');var rp=require(_0xab52('0x5'));var fs=require('fs');var path=require(_0xab52('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab52('0x7'));module['exports']=function(_0x1219ac,_0xd90221){return _0x1219ac[_0xab52('0x8')]('VoiceContext',attributes,{'tableName':_0xab52('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4293=['../../config/environment','exports','define','voice_contexts','lodash','util','api','bluebird','rimraf'];(function(_0x363f66,_0x575f12){var _0xe93b02=function(_0x5b2eeb){while(--_0x5b2eeb){_0x363f66['push'](_0x363f66['shift']());}};_0xe93b02(++_0x575f12);}(_0x4293,0x163));var _0x3429=function(_0x1df471,_0x385d1c){_0x1df471=_0x1df471-0x0;var _0x27b89d=_0x4293[_0x1df471];return _0x27b89d;};'use strict';var _=require(_0x3429('0x0'));var util=require(_0x3429('0x1'));var logger=require('../../config/logger')(_0x3429('0x2'));var moment=require('moment');var BPromise=require(_0x3429('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3429('0x4'));var config=require(_0x3429('0x5'));var attributes=require('./voiceContext.attributes');module[_0x3429('0x6')]=function(_0x439e14,_0x432c4f){return _0x439e14[_0x3429('0x7')]('VoiceContext',attributes,{'tableName':_0x3429('0x8'),'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 5b4fb21..3cdf835 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 _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23464b,_0x326eb7){var _0x3ee87d=function(_0x449300){while(--_0x449300){_0x23464b['push'](_0x23464b['shift']());}};_0x3ee87d(++_0x326eb7);}(_0xc6d7,0x71));var _0x7c6d=function(_0x2ef38e,_0x6fe2ad){_0x2ef38e=_0x2ef38e-0x0;var _0x183848=_0xc6d7[_0x2ef38e];return _0x183848;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('VoiceContext,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});} \ No newline at end of file +var _0xdbf0=['request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdbf0,0x1db));var _0x0dbf=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xdbf0[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x0dbf('0x0'));var moment=require(_0x0dbf('0x1'));var BPromise=require(_0x0dbf('0x2'));var rs=require(_0x0dbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dbf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0dbf('0x5'));var config=require(_0x0dbf('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0dbf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37e21d,_0x277276,_0x81ed92){return new BPromise(function(_0x3a493e,_0x58af25){return client[_0x0dbf('0x8')](_0x37e21d,_0x81ed92)[_0x0dbf('0x9')](function(_0x206ef0){logger['info']('VoiceContext,\x20%s,\x20%s',_0x277276,_0x0dbf('0xa'));logger[_0x0dbf('0xb')](_0x0dbf('0xc'),_0x277276,_0x0dbf('0xa'),JSON[_0x0dbf('0xd')](_0x206ef0));if(_0x206ef0[_0x0dbf('0xe')]){if(_0x206ef0[_0x0dbf('0xe')][_0x0dbf('0xf')]===0x1f4){logger['error'](_0x0dbf('0x10'),_0x277276,_0x206ef0[_0x0dbf('0xe')][_0x0dbf('0x11')]);return _0x58af25(_0x206ef0[_0x0dbf('0xe')][_0x0dbf('0x11')]);}logger[_0x0dbf('0xe')](_0x0dbf('0x10'),_0x277276,_0x206ef0[_0x0dbf('0xe')]['message']);return _0x3a493e(_0x206ef0[_0x0dbf('0xe')][_0x0dbf('0x11')]);}else{logger[_0x0dbf('0x12')](_0x0dbf('0x10'),_0x277276,_0x0dbf('0xa'));_0x3a493e(_0x206ef0[_0x0dbf('0x13')][_0x0dbf('0x11')]);}})[_0x0dbf('0x14')](function(_0x2c0908){logger[_0x0dbf('0xe')](_0x0dbf('0x10'),_0x277276,_0x2c0908);_0x58af25(_0x2c0908);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 29ffeae..452a536 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 _0xeb81=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','destroy'];(function(_0x4a7159,_0x1bea62){var _0x4de646=function(_0xda1448){while(--_0xda1448){_0x4a7159['push'](_0x4a7159['shift']());}};_0x4de646(++_0x1bea62);}(_0xeb81,0x100));var _0x1eb8=function(_0x2f85b3,_0x416a6f){_0x2f85b3=_0x2f85b3-0x0;var _0x99349d=_0xeb81[_0x2f85b3];return _0x99349d;};'use strict';var multer=require(_0x1eb8('0x0'));var util=require('util');var path=require(_0x1eb8('0x1'));var timeout=require('connect-timeout');var express=require(_0x1eb8('0x2'));var router=express[_0x1eb8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1eb8('0x4'));var interaction=require(_0x1eb8('0x5'));var config=require('../../config/environment');var controller=require(_0x1eb8('0x6'));router[_0x1eb8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x1eb8('0x8')](),controller[_0x1eb8('0x9')]);router[_0x1eb8('0x7')](_0x1eb8('0xa'),auth['isAuthenticated'](),controller[_0x1eb8('0xb')]);router[_0x1eb8('0xc')]('/',auth[_0x1eb8('0x8')](),controller[_0x1eb8('0xd')]);router[_0x1eb8('0xe')](_0x1eb8('0xa'),auth[_0x1eb8('0x8')](),controller['update']);router['delete']('/:id',auth[_0x1eb8('0x8')](),controller[_0x1eb8('0xf')]);module[_0x1eb8('0x10')]=router; \ No newline at end of file +var _0xb9ee=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','destroy','exports','multer','util','path'];(function(_0x1d0458,_0x4ed6d4){var _0x2fad3c=function(_0x44b181){while(--_0x44b181){_0x1d0458['push'](_0x1d0458['shift']());}};_0x2fad3c(++_0x4ed6d4);}(_0xb9ee,0x12d));var _0xeb9e=function(_0x39f375,_0x3aa8ec){_0x39f375=_0x39f375-0x0;var _0x463f93=_0xb9ee[_0x39f375];return _0x463f93;};'use strict';var multer=require(_0xeb9e('0x0'));var util=require(_0xeb9e('0x1'));var path=require(_0xeb9e('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb9e('0x3'));var router=express[_0xeb9e('0x4')]();var fs_extra=require(_0xeb9e('0x5'));var auth=require(_0xeb9e('0x6'));var interaction=require(_0xeb9e('0x7'));var config=require('../../config/environment');var controller=require(_0xeb9e('0x8'));router[_0xeb9e('0x9')]('/',auth[_0xeb9e('0xa')](),controller['index']);router[_0xeb9e('0x9')](_0xeb9e('0xb'),auth[_0xeb9e('0xa')](),controller['describe']);router[_0xeb9e('0x9')](_0xeb9e('0xc'),auth[_0xeb9e('0xa')](),controller[_0xeb9e('0xd')]);router[_0xeb9e('0xe')]('/',auth['isAuthenticated'](),controller[_0xeb9e('0xf')]);router[_0xeb9e('0x10')](_0xeb9e('0xc'),auth[_0xeb9e('0xa')](),controller['update']);router['delete']('/:id',auth[_0xeb9e('0xa')](),controller[_0xeb9e('0x11')]);module[_0xeb9e('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 cdb5c92..8668bd4 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3e74,0x175));var _0x43e7=function(_0xec955d,_0x3053b6){_0xec955d=_0xec955d-0x0;var _0x2a3d00=_0x3e74[_0xec955d];return _0x2a3d00;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x3e74,0x175));var _0x43e7=function(_0x2ecabd,_0x3a4ec9){_0x2ecabd=_0x2ecabd-0x0;var _0x36163f=_0x3e74[_0x2ecabd];return _0x36163f;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index bcb7b47..76bfcfd 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 _0x7549=['undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','options','includeAll','VoiceDialReport','findAll','rows','show','find','catch','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7549,0x150));var _0x9754=function(_0xee3cfe,_0x5cad73){_0xee3cfe=_0xee3cfe-0x0;var _0x2716a4=_0x7549[_0xee3cfe];return _0x2716a4;};'use strict';var emlformat=require(_0x9754('0x0'));var rimraf=require(_0x9754('0x1'));var zipdir=require(_0x9754('0x2'));var jsonpatch=require(_0x9754('0x3'));var rp=require(_0x9754('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9754('0x5'));var path=require(_0x9754('0x6'));var sox=require('sox');var csv=require(_0x9754('0x7'));var ejs=require(_0x9754('0x8'));var fs=require('fs');var fs_extra=require(_0x9754('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9754('0xa'));var jsforce=require(_0x9754('0xb'));var deskjs=require(_0x9754('0xc'));var toCsv=require(_0x9754('0x7'));var querystring=require(_0x9754('0xd'));var Papa=require(_0x9754('0xe'));var Redis=require(_0x9754('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9754('0x10'));var logger=require(_0x9754('0x11'))('api');var utils=require(_0x9754('0x12'));var config=require(_0x9754('0x13'));var licenseUtil=require(_0x9754('0x14'));var db=require(_0x9754('0x15'))['db'];function respondWithStatusCode(_0x112ba0,_0x32f644){_0x32f644=_0x32f644||0xcc;return function(_0x52c464){if(_0x52c464){return _0x112ba0[_0x9754('0x16')](_0x32f644);}return _0x112ba0['status'](_0x32f644)['end']();};}function respondWithResult(_0x2705bc,_0x338e14){_0x338e14=_0x338e14||0xc8;return function(_0x3d557a){if(_0x3d557a){return _0x2705bc['status'](_0x338e14)[_0x9754('0x17')](_0x3d557a);}};}function respondWithFilteredResult(_0x17bf42,_0x1d30ca){return function(_0x37f207){if(_0x37f207){var _0x2609ea=typeof _0x1d30ca['offset']===_0x9754('0x18')&&typeof _0x1d30ca[_0x9754('0x19')]===_0x9754('0x18');var _0x17cc83=_0x37f207['count'];var _0x2ef412=_0x2609ea?0x0:_0x1d30ca[_0x9754('0x1a')];var _0x117bd1=_0x2609ea?_0x37f207[_0x9754('0x1b')]:_0x1d30ca[_0x9754('0x1a')]+_0x1d30ca[_0x9754('0x19')];var _0x1cc920;if(_0x117bd1>=_0x17cc83){_0x117bd1=_0x17cc83;_0x1cc920=0xc8;}else{_0x1cc920=0xce;}_0x17bf42['status'](_0x1cc920);return _0x17bf42[_0x9754('0x1c')](_0x9754('0x1d'),_0x2ef412+'-'+_0x117bd1+'/'+_0x17cc83)['json'](_0x37f207);}return null;};}function patchUpdates(_0x33ff10){return function(_0x3eac06){try{jsonpatch[_0x9754('0x1e')](_0x3eac06,_0x33ff10,!![]);}catch(_0x113f86){return BPromise[_0x9754('0x1f')](_0x113f86);}return _0x3eac06[_0x9754('0x20')]();};}function saveUpdates(_0x3a0589,_0x57d20b){return function(_0x3f3b35){if(_0x3f3b35){return _0x3f3b35[_0x9754('0x21')](_0x3a0589)[_0x9754('0x22')](function(_0x62bbb5){return _0x62bbb5;});}return null;};}function removeEntity(_0x25a2e6,_0x542fcc){return function(_0x32124d){if(_0x32124d){return _0x32124d['destroy']()[_0x9754('0x22')](function(){_0x25a2e6['status'](0xcc)[_0x9754('0x23')]();});}};}function handleEntityNotFound(_0x863982,_0x3a9288){return function(_0x5706b4){if(!_0x5706b4){_0x863982[_0x9754('0x16')](0x194);}return _0x5706b4;};}function handleError(_0x4b4d72,_0x432da3){_0x432da3=_0x432da3||0x1f4;return function(_0xb6e4d2){logger[_0x9754('0x24')](_0xb6e4d2[_0x9754('0x25')]);if(_0xb6e4d2[_0x9754('0x26')]){delete _0xb6e4d2['name'];}_0x4b4d72['status'](_0x432da3)[_0x9754('0x27')](_0xb6e4d2);};}exports[_0x9754('0x28')]=function(_0x268f61,_0x363a7b){var _0x446ff5={},_0x310c13={},_0xee8372={'count':0x0,'rows':[]};var _0x351e48=_[_0x9754('0x29')](db['VoiceDialReport'][_0x9754('0x2a')],function(_0xcb3f96){return{'name':_0xcb3f96[_0x9754('0x2b')],'type':_0xcb3f96[_0x9754('0x2c')][_0x9754('0x2d')]};});_0x310c13[_0x9754('0x2e')]=_[_0x9754('0x29')](_0x351e48,_0x9754('0x26'));_0x310c13['query']=_[_0x9754('0x2f')](_0x268f61[_0x9754('0x30')]);_0x310c13[_0x9754('0x31')]=_['intersection'](_0x310c13[_0x9754('0x2e')],_0x310c13[_0x9754('0x30')]);_0x446ff5['attributes']=_[_0x9754('0x32')](_0x310c13[_0x9754('0x2e')],qs[_0x9754('0x33')](_0x268f61[_0x9754('0x30')][_0x9754('0x33')]));_0x446ff5[_0x9754('0x34')]=_0x446ff5['attributes'][_0x9754('0x35')]?_0x446ff5[_0x9754('0x34')]:_0x310c13[_0x9754('0x2e')];if(!_0x268f61[_0x9754('0x30')][_0x9754('0x36')](_0x9754('0x37'))){_0x446ff5[_0x9754('0x19')]=qs['limit'](_0x268f61[_0x9754('0x30')][_0x9754('0x19')]);_0x446ff5[_0x9754('0x1a')]=qs[_0x9754('0x1a')](_0x268f61[_0x9754('0x30')]['offset']);}_0x446ff5['order']=qs['sort'](_0x268f61[_0x9754('0x30')]['sort']);_0x446ff5[_0x9754('0x38')]=qs[_0x9754('0x31')](_[_0x9754('0x39')](_0x268f61[_0x9754('0x30')],_0x310c13[_0x9754('0x31')]),_0x351e48);if(_0x268f61['query']['filter']){_0x446ff5[_0x9754('0x38')]=_[_0x9754('0x3a')](_0x446ff5['where'],{'$or':_[_0x9754('0x29')](_0x351e48,function(_0x1a8d11){if(_0x1a8d11[_0x9754('0x2c')]!==_0x9754('0x3b')){var _0xb3bf3={};_0xb3bf3[_0x1a8d11['name']]={'$like':'%'+_0x268f61[_0x9754('0x30')]['filter']+'%'};return _0xb3bf3;}})});}_0x446ff5=_[_0x9754('0x3a')]({},_0x446ff5,_0x268f61[_0x9754('0x3c')]);var _0x4614ef={'where':_0x446ff5[_0x9754('0x38')]};return db['VoiceDialReport'][_0x9754('0x1b')](_0x4614ef)[_0x9754('0x22')](function(_0x216483){_0xee8372[_0x9754('0x1b')]=_0x216483;if(_0x268f61[_0x9754('0x30')][_0x9754('0x3d')]){_0x446ff5['include']=[{'all':!![]}];}return db[_0x9754('0x3e')][_0x9754('0x3f')](_0x446ff5);})['then'](function(_0x1cb8dc){_0xee8372[_0x9754('0x40')]=_0x1cb8dc;return _0xee8372;})['then'](respondWithFilteredResult(_0x363a7b,_0x446ff5))['catch'](handleError(_0x363a7b,null));};exports[_0x9754('0x41')]=function(_0x340ea2,_0x31bb73){var _0x21f446={'raw':!![],'where':{'id':_0x340ea2['params']['id']}},_0x5463a4={};_0x5463a4[_0x9754('0x2e')]=_[_0x9754('0x2f')](db['VoiceDialReport'][_0x9754('0x2a')]);_0x5463a4[_0x9754('0x30')]=_[_0x9754('0x2f')](_0x340ea2[_0x9754('0x30')]);_0x5463a4[_0x9754('0x31')]=_[_0x9754('0x32')](_0x5463a4['model'],_0x5463a4['query']);_0x21f446[_0x9754('0x34')]=_[_0x9754('0x32')](_0x5463a4[_0x9754('0x2e')],qs['fields'](_0x340ea2[_0x9754('0x30')][_0x9754('0x33')]));_0x21f446[_0x9754('0x34')]=_0x21f446[_0x9754('0x34')]['length']?_0x21f446[_0x9754('0x34')]:_0x5463a4[_0x9754('0x2e')];if(_0x340ea2[_0x9754('0x30')][_0x9754('0x3d')]){_0x21f446['include']=[{'all':!![]}];}_0x21f446=_[_0x9754('0x3a')]({},_0x21f446,_0x340ea2['options']);return db['VoiceDialReport'][_0x9754('0x42')](_0x21f446)['then'](handleEntityNotFound(_0x31bb73,null))[_0x9754('0x22')](respondWithResult(_0x31bb73,null))[_0x9754('0x43')](handleError(_0x31bb73,null));};exports['create']=function(_0x24e44f,_0x3cf283){return db[_0x9754('0x3e')]['create'](_0x24e44f[_0x9754('0x44')],{})['then'](respondWithResult(_0x3cf283,0xc9))['catch'](handleError(_0x3cf283,null));};exports['update']=function(_0x29d325,_0x18c9ed){if(_0x29d325[_0x9754('0x44')]['id']){delete _0x29d325['body']['id'];}return db[_0x9754('0x3e')][_0x9754('0x42')]({'where':{'id':_0x29d325['params']['id']}})['then'](handleEntityNotFound(_0x18c9ed,null))[_0x9754('0x22')](saveUpdates(_0x29d325[_0x9754('0x44')],null))['then'](respondWithResult(_0x18c9ed,null))['catch'](handleError(_0x18c9ed,null));};exports[_0x9754('0x45')]=function(_0x1d3b0b,_0xc40dce){return db['VoiceDialReport'][_0x9754('0x42')]({'where':{'id':_0x1d3b0b[_0x9754('0x46')]['id']}})[_0x9754('0x22')](handleEntityNotFound(_0xc40dce,null))['then'](removeEntity(_0xc40dce,null))[_0x9754('0x43')](handleError(_0xc40dce,null));};exports['describe']=function(_0x790f78,_0x4f1d54){return db[_0x9754('0x3e')][_0x9754('0x47')]()[_0x9754('0x22')](respondWithResult(_0x4f1d54,null))[_0x9754('0x43')](handleError(_0x4f1d54,null));}; \ No newline at end of file +var _0x9685=['name','send','index','VoiceDialReport','rawAttributes','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','limit','order','sort','filter','merge','VIRTUAL','options','where','count','include','findAll','rows','includeAll','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','status','set','apply','reject','save','update','then','destroy','error','stack'];(function(_0x17b783,_0x33ec0e){var _0x3a57ef=function(_0x57fbf3){while(--_0x57fbf3){_0x17b783['push'](_0x17b783['shift']());}};_0x3a57ef(++_0x33ec0e);}(_0x9685,0xfe));var _0x5968=function(_0x4665b6,_0x12328b){_0x4665b6=_0x4665b6-0x0;var _0x2f46df=_0x9685[_0x4665b6];return _0x2f46df;};'use strict';var emlformat=require(_0x5968('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5968('0x1'));var jsonpatch=require(_0x5968('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5968('0x3'));var Mustache=require(_0x5968('0x4'));var util=require('util');var path=require(_0x5968('0x5'));var sox=require('sox');var csv=require(_0x5968('0x6'));var ejs=require(_0x5968('0x7'));var fs=require('fs');var fs_extra=require(_0x5968('0x8'));var _=require('lodash');var squel=require(_0x5968('0x9'));var crypto=require('crypto');var jsforce=require(_0x5968('0xa'));var deskjs=require(_0x5968('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5968('0xc'));var Papa=require(_0x5968('0xd'));var Redis=require(_0x5968('0xe'));var authService=require(_0x5968('0xf'));var qs=require(_0x5968('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5968('0x11'));var logger=require(_0x5968('0x12'))(_0x5968('0x13'));var utils=require(_0x5968('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5968('0x15'));var db=require(_0x5968('0x16'))['db'];function respondWithStatusCode(_0x6dfb26,_0x51914b){_0x51914b=_0x51914b||0xcc;return function(_0x5e6b94){if(_0x5e6b94){return _0x6dfb26[_0x5968('0x17')](_0x51914b);}return _0x6dfb26['status'](_0x51914b)[_0x5968('0x18')]();};}function respondWithResult(_0x5d9a18,_0xe9af92){_0xe9af92=_0xe9af92||0xc8;return function(_0x3231b0){if(_0x3231b0){return _0x5d9a18['status'](_0xe9af92)[_0x5968('0x19')](_0x3231b0);}};}function respondWithFilteredResult(_0xf040c0,_0x2f1cd0){return function(_0x272c82){if(_0x272c82){var _0x7bcc5b=typeof _0x2f1cd0[_0x5968('0x1a')]===_0x5968('0x1b')&&typeof _0x2f1cd0['limit']===_0x5968('0x1b');var _0x531d7a=_0x272c82['count'];var _0x103987=_0x7bcc5b?0x0:_0x2f1cd0['offset'];var _0x894c07=_0x7bcc5b?_0x272c82['count']:_0x2f1cd0[_0x5968('0x1a')]+_0x2f1cd0['limit'];var _0x3bcaf2;if(_0x894c07>=_0x531d7a){_0x894c07=_0x531d7a;_0x3bcaf2=0xc8;}else{_0x3bcaf2=0xce;}_0xf040c0[_0x5968('0x1c')](_0x3bcaf2);return _0xf040c0[_0x5968('0x1d')]('Content-Range',_0x103987+'-'+_0x894c07+'/'+_0x531d7a)['json'](_0x272c82);}return null;};}function patchUpdates(_0x45b97b){return function(_0x29b9b3){try{jsonpatch[_0x5968('0x1e')](_0x29b9b3,_0x45b97b,!![]);}catch(_0x27aeda){return BPromise[_0x5968('0x1f')](_0x27aeda);}return _0x29b9b3[_0x5968('0x20')]();};}function saveUpdates(_0x5272f5,_0x2fe868){return function(_0x647e2c){if(_0x647e2c){return _0x647e2c[_0x5968('0x21')](_0x5272f5)[_0x5968('0x22')](function(_0xd7d2b8){return _0xd7d2b8;});}return null;};}function removeEntity(_0x5dc231,_0x3994ce){return function(_0xbc8331){if(_0xbc8331){return _0xbc8331[_0x5968('0x23')]()[_0x5968('0x22')](function(){_0x5dc231[_0x5968('0x1c')](0xcc)[_0x5968('0x18')]();});}};}function handleEntityNotFound(_0x1e6ccf,_0x679310){return function(_0x10a012){if(!_0x10a012){_0x1e6ccf[_0x5968('0x17')](0x194);}return _0x10a012;};}function handleError(_0x860c75,_0x4a5960){_0x4a5960=_0x4a5960||0x1f4;return function(_0x4c6d29){logger[_0x5968('0x24')](_0x4c6d29[_0x5968('0x25')]);if(_0x4c6d29['name']){delete _0x4c6d29[_0x5968('0x26')];}_0x860c75[_0x5968('0x1c')](_0x4a5960)[_0x5968('0x27')](_0x4c6d29);};}exports[_0x5968('0x28')]=function(_0x2d0d4b,_0x334327){var _0x58fe5c={},_0x1497f8={},_0x321aec={'count':0x0,'rows':[]};var _0x5dc499=_['map'](db[_0x5968('0x29')][_0x5968('0x2a')],function(_0x4999fc){return{'name':_0x4999fc['fieldName'],'type':_0x4999fc[_0x5968('0x2b')][_0x5968('0x2c')]};});_0x1497f8['model']=_[_0x5968('0x2d')](_0x5dc499,_0x5968('0x26'));_0x1497f8[_0x5968('0x2e')]=_[_0x5968('0x2f')](_0x2d0d4b[_0x5968('0x2e')]);_0x1497f8[_0x5968('0x30')]=_['intersection'](_0x1497f8['model'],_0x1497f8['query']);_0x58fe5c[_0x5968('0x31')]=_[_0x5968('0x32')](_0x1497f8[_0x5968('0x33')],qs['fields'](_0x2d0d4b[_0x5968('0x2e')][_0x5968('0x34')]));_0x58fe5c[_0x5968('0x31')]=_0x58fe5c[_0x5968('0x31')][_0x5968('0x35')]?_0x58fe5c['attributes']:_0x1497f8[_0x5968('0x33')];if(!_0x2d0d4b[_0x5968('0x2e')]['hasOwnProperty']('nolimit')){_0x58fe5c[_0x5968('0x36')]=qs[_0x5968('0x36')](_0x2d0d4b[_0x5968('0x2e')][_0x5968('0x36')]);_0x58fe5c[_0x5968('0x1a')]=qs[_0x5968('0x1a')](_0x2d0d4b[_0x5968('0x2e')][_0x5968('0x1a')]);}_0x58fe5c[_0x5968('0x37')]=qs['sort'](_0x2d0d4b[_0x5968('0x2e')][_0x5968('0x38')]);_0x58fe5c['where']=qs[_0x5968('0x30')](_['pick'](_0x2d0d4b[_0x5968('0x2e')],_0x1497f8['filters']),_0x5dc499);if(_0x2d0d4b['query'][_0x5968('0x39')]){_0x58fe5c['where']=_[_0x5968('0x3a')](_0x58fe5c['where'],{'$or':_[_0x5968('0x2d')](_0x5dc499,function(_0x70bf1d){if(_0x70bf1d[_0x5968('0x2b')]!==_0x5968('0x3b')){var _0x33811a={};_0x33811a[_0x70bf1d[_0x5968('0x26')]]={'$like':'%'+_0x2d0d4b[_0x5968('0x2e')][_0x5968('0x39')]+'%'};return _0x33811a;}})});}_0x58fe5c=_['merge']({},_0x58fe5c,_0x2d0d4b[_0x5968('0x3c')]);var _0x3e5b1b={'where':_0x58fe5c[_0x5968('0x3d')]};return db[_0x5968('0x29')]['count'](_0x3e5b1b)['then'](function(_0x2259e9){_0x321aec[_0x5968('0x3e')]=_0x2259e9;if(_0x2d0d4b['query']['includeAll']){_0x58fe5c[_0x5968('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x5968('0x40')](_0x58fe5c);})[_0x5968('0x22')](function(_0x24570c){_0x321aec[_0x5968('0x41')]=_0x24570c;return _0x321aec;})[_0x5968('0x22')](respondWithFilteredResult(_0x334327,_0x58fe5c))['catch'](handleError(_0x334327,null));};exports['show']=function(_0x5f59b0,_0x4290a5){var _0x557cb4={'raw':!![],'where':{'id':_0x5f59b0['params']['id']}},_0x344252={};_0x344252[_0x5968('0x33')]=_[_0x5968('0x2f')](db['VoiceDialReport'][_0x5968('0x2a')]);_0x344252[_0x5968('0x2e')]=_[_0x5968('0x2f')](_0x5f59b0[_0x5968('0x2e')]);_0x344252[_0x5968('0x30')]=_['intersection'](_0x344252[_0x5968('0x33')],_0x344252[_0x5968('0x2e')]);_0x557cb4['attributes']=_['intersection'](_0x344252['model'],qs[_0x5968('0x34')](_0x5f59b0[_0x5968('0x2e')][_0x5968('0x34')]));_0x557cb4[_0x5968('0x31')]=_0x557cb4[_0x5968('0x31')]['length']?_0x557cb4['attributes']:_0x344252[_0x5968('0x33')];if(_0x5f59b0[_0x5968('0x2e')][_0x5968('0x42')]){_0x557cb4[_0x5968('0x3f')]=[{'all':!![]}];}_0x557cb4=_[_0x5968('0x3a')]({},_0x557cb4,_0x5f59b0['options']);return db['VoiceDialReport']['find'](_0x557cb4)[_0x5968('0x22')](handleEntityNotFound(_0x4290a5,null))['then'](respondWithResult(_0x4290a5,null))[_0x5968('0x43')](handleError(_0x4290a5,null));};exports[_0x5968('0x44')]=function(_0x8982b,_0x5cf86b){return db[_0x5968('0x29')][_0x5968('0x44')](_0x8982b['body'],{})[_0x5968('0x22')](respondWithResult(_0x5cf86b,0xc9))[_0x5968('0x43')](handleError(_0x5cf86b,null));};exports[_0x5968('0x21')]=function(_0x299468,_0x47ef74){if(_0x299468[_0x5968('0x45')]['id']){delete _0x299468[_0x5968('0x45')]['id'];}return db[_0x5968('0x29')][_0x5968('0x46')]({'where':{'id':_0x299468[_0x5968('0x47')]['id']}})['then'](handleEntityNotFound(_0x47ef74,null))['then'](saveUpdates(_0x299468['body'],null))[_0x5968('0x22')](respondWithResult(_0x47ef74,null))['catch'](handleError(_0x47ef74,null));};exports[_0x5968('0x23')]=function(_0xc7759c,_0x3b40f7){return db[_0x5968('0x29')]['find']({'where':{'id':_0xc7759c['params']['id']}})['then'](handleEntityNotFound(_0x3b40f7,null))[_0x5968('0x22')](removeEntity(_0x3b40f7,null))[_0x5968('0x43')](handleError(_0x3b40f7,null));};exports['describe']=function(_0x2576ce,_0x5bcb52){return db[_0x5968('0x29')][_0x5968('0x48')]()[_0x5968('0x22')](respondWithResult(_0x5bcb52,null))['catch'](handleError(_0x5bcb52,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 26f8fd0..b11b42d 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 _0x7b1b=['../../config/logger','moment','request-promise','rimraf','define','VoiceDialReport','report_dial','uniqueid','lodash'];(function(_0x568039,_0x570f8e){var _0x1595fc=function(_0x50ac8f){while(--_0x50ac8f){_0x568039['push'](_0x568039['shift']());}};_0x1595fc(++_0x570f8e);}(_0x7b1b,0xa1));var _0xb7b1=function(_0x33c403,_0xc73abd){_0x33c403=_0x33c403-0x0;var _0x2ef41d=_0x7b1b[_0x33c403];return _0x2ef41d;};'use strict';var _=require(_0xb7b1('0x0'));var util=require('util');var logger=require(_0xb7b1('0x1'))('api');var moment=require(_0xb7b1('0x2'));var BPromise=require('bluebird');var rp=require(_0xb7b1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7b1('0x4'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x4fb22d,_0x5bae5a){return _0x4fb22d[_0xb7b1('0x5')](_0xb7b1('0x6'),attributes,{'tableName':_0xb7b1('0x7'),'paranoid':![],'indexes':[{'fields':[_0xb7b1('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88f4=['uniqueid','util','api','moment','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x53f005,_0xfae300){var _0x3c3464=function(_0xb01fe8){while(--_0xb01fe8){_0x53f005['push'](_0x53f005['shift']());}};_0x3c3464(++_0xfae300);}(_0x88f4,0xfb));var _0x488f=function(_0x30bb46,_0x585e54){_0x30bb46=_0x30bb46-0x0;var _0x412959=_0x88f4[_0x30bb46];return _0x412959;};'use strict';var _=require('lodash');var util=require(_0x488f('0x0'));var logger=require('../../config/logger')(_0x488f('0x1'));var moment=require(_0x488f('0x2'));var BPromise=require('bluebird');var rp=require(_0x488f('0x3'));var fs=require('fs');var path=require(_0x488f('0x4'));var rimraf=require('rimraf');var config=require(_0x488f('0x5'));var attributes=require(_0x488f('0x6'));module[_0x488f('0x7')]=function(_0x541d9d,_0x157611){return _0x541d9d[_0x488f('0x8')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x488f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 371912c..f769205 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 _0xce43=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateVoiceDialReport','create','body','options','raw','stringify','catch','UpdateVoiceDialReport','update','where','attributes','limit','util','bluebird','randomstring'];(function(_0x22a3fd,_0x4bcdef){var _0x477357=function(_0x5b191e){while(--_0x5b191e){_0x22a3fd['push'](_0x22a3fd['shift']());}};_0x477357(++_0x4bcdef);}(_0xce43,0x93));var _0x3ce4=function(_0x185406,_0x105b9d){_0x185406=_0x185406-0x0;var _0x2723a1=_0xce43[_0x185406];return _0x2723a1;};'use strict';var _=require('lodash');var util=require(_0x3ce4('0x0'));var moment=require('moment');var BPromise=require(_0x3ce4('0x1'));var rs=require(_0x3ce4('0x2'));var fs=require('fs');var Redis=require(_0x3ce4('0x3'));var db=require(_0x3ce4('0x4'))['db'];var utils=require(_0x3ce4('0x5'));var logger=require(_0x3ce4('0x6'))('rpc');var config=require(_0x3ce4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ce4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a4e9a,_0x330535,_0x37de47){return new BPromise(function(_0x287adb,_0x5f325f){return client['request'](_0x2a4e9a,_0x37de47)[_0x3ce4('0x9')](function(_0x471074){logger['info'](_0x3ce4('0xa'),_0x330535,_0x3ce4('0xb'));logger[_0x3ce4('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x330535,'request\x20sent',JSON['stringify'](_0x471074));if(_0x471074[_0x3ce4('0xd')]){if(_0x471074[_0x3ce4('0xd')][_0x3ce4('0xe')]===0x1f4){logger[_0x3ce4('0xd')](_0x3ce4('0xa'),_0x330535,_0x471074['error'][_0x3ce4('0xf')]);return _0x5f325f(_0x471074[_0x3ce4('0xd')][_0x3ce4('0xf')]);}logger[_0x3ce4('0xd')](_0x3ce4('0xa'),_0x330535,_0x471074[_0x3ce4('0xd')][_0x3ce4('0xf')]);return _0x287adb(_0x471074['error'][_0x3ce4('0xf')]);}else{logger[_0x3ce4('0x10')](_0x3ce4('0xa'),_0x330535,'request\x20sent');_0x287adb(_0x471074[_0x3ce4('0x11')][_0x3ce4('0xf')]);}})['catch'](function(_0x3c676f){logger[_0x3ce4('0xd')](_0x3ce4('0xa'),_0x330535,_0x3c676f);_0x5f325f(_0x3c676f);});});}exports[_0x3ce4('0x12')]=function(_0x42a8f0){var _0x3a69c8=this;return new Promise(function(_0x31f32c,_0x37caa0){return db['VoiceDialReport'][_0x3ce4('0x13')](_0x42a8f0[_0x3ce4('0x14')],{'raw':_0x42a8f0[_0x3ce4('0x15')]?_0x42a8f0[_0x3ce4('0x15')][_0x3ce4('0x16')]===undefined?!![]:![]:!![]})[_0x3ce4('0x9')](function(_0x5f0b7c){logger['info']('CreateVoiceDialReport',_0x42a8f0);logger[_0x3ce4('0xc')](_0x3ce4('0x12'),_0x42a8f0,JSON[_0x3ce4('0x17')](_0x5f0b7c));_0x31f32c(_0x5f0b7c);})[_0x3ce4('0x18')](function(_0x29a63c){logger[_0x3ce4('0xd')](_0x3ce4('0x12'),_0x29a63c[_0x3ce4('0xf')],_0x42a8f0);_0x37caa0(_0x3a69c8[_0x3ce4('0xd')](0x1f4,_0x29a63c[_0x3ce4('0xf')]));});});};exports[_0x3ce4('0x19')]=function(_0x5ad2){var _0x46d0e3=this;return new Promise(function(_0xd9bad,_0xfef5a){return db['VoiceDialReport'][_0x3ce4('0x1a')](_0x5ad2['body'],{'raw':_0x5ad2[_0x3ce4('0x15')]?_0x5ad2[_0x3ce4('0x15')][_0x3ce4('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ad2[_0x3ce4('0x15')]?_0x5ad2[_0x3ce4('0x15')][_0x3ce4('0x1b')]||null:null,'attributes':_0x5ad2['options']?_0x5ad2[_0x3ce4('0x15')][_0x3ce4('0x1c')]||null:null,'limit':_0x5ad2[_0x3ce4('0x15')]?_0x5ad2[_0x3ce4('0x15')][_0x3ce4('0x1d')]||null:null})[_0x3ce4('0x9')](function(_0x47a2f4){logger['info']('UpdateVoiceDialReport',_0x5ad2);logger[_0x3ce4('0xc')](_0x3ce4('0x19'),_0x5ad2,JSON[_0x3ce4('0x17')](_0x47a2f4));_0xd9bad(_0x47a2f4);})[_0x3ce4('0x18')](function(_0x133f62){logger['error'](_0x3ce4('0x19'),_0x133f62[_0x3ce4('0xf')],_0x5ad2);_0xfef5a(_0x46d0e3['error'](0x1f4,_0x133f62[_0x3ce4('0xf')]));});});}; \ No newline at end of file +var _0xb2c6=['debug','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent'];(function(_0x3d0880,_0x297bed){var _0x17a13f=function(_0x502e44){while(--_0x502e44){_0x3d0880['push'](_0x3d0880['shift']());}};_0x17a13f(++_0x297bed);}(_0xb2c6,0x127));var _0x6b2c=function(_0x3b29b8,_0x1f662b){_0x3b29b8=_0x3b29b8-0x0;var _0x27bec8=_0xb2c6[_0x3b29b8];return _0x27bec8;};'use strict';var _=require(_0x6b2c('0x0'));var util=require(_0x6b2c('0x1'));var moment=require(_0x6b2c('0x2'));var BPromise=require(_0x6b2c('0x3'));var rs=require(_0x6b2c('0x4'));var fs=require('fs');var Redis=require(_0x6b2c('0x5'));var db=require(_0x6b2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b2c('0x7'))(_0x6b2c('0x8'));var config=require(_0x6b2c('0x9'));var jayson=require(_0x6b2c('0xa'));var client=jayson[_0x6b2c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ecf8d,_0x2b784e,_0x20182f){return new BPromise(function(_0x3f5fa5,_0x58f730){return client['request'](_0x5ecf8d,_0x20182f)[_0x6b2c('0xc')](function(_0x13095d){logger[_0x6b2c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x2b784e,_0x6b2c('0xe'));logger[_0x6b2c('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2b784e,'request\x20sent',JSON[_0x6b2c('0x10')](_0x13095d));if(_0x13095d['error']){if(_0x13095d['error']['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2b784e,_0x13095d[_0x6b2c('0x11')]['message']);return _0x58f730(_0x13095d[_0x6b2c('0x11')][_0x6b2c('0x12')]);}logger['error'](_0x6b2c('0x13'),_0x2b784e,_0x13095d[_0x6b2c('0x11')][_0x6b2c('0x12')]);return _0x3f5fa5(_0x13095d[_0x6b2c('0x11')][_0x6b2c('0x12')]);}else{logger[_0x6b2c('0xd')](_0x6b2c('0x13'),_0x2b784e,_0x6b2c('0xe'));_0x3f5fa5(_0x13095d[_0x6b2c('0x14')]['message']);}})[_0x6b2c('0x15')](function(_0x299df3){logger[_0x6b2c('0x11')](_0x6b2c('0x13'),_0x2b784e,_0x299df3);_0x58f730(_0x299df3);});});}exports[_0x6b2c('0x16')]=function(_0x366e52){var _0x25ed31=this;return new Promise(function(_0x4a5158,_0x598e1d){return db[_0x6b2c('0x17')]['create'](_0x366e52[_0x6b2c('0x18')],{'raw':_0x366e52['options']?_0x366e52[_0x6b2c('0x19')][_0x6b2c('0x1a')]===undefined?!![]:![]:!![]})[_0x6b2c('0xc')](function(_0x171cbb){logger['info'](_0x6b2c('0x16'),_0x366e52);logger[_0x6b2c('0xf')]('CreateVoiceDialReport',_0x366e52,JSON[_0x6b2c('0x10')](_0x171cbb));_0x4a5158(_0x171cbb);})[_0x6b2c('0x15')](function(_0x1bf54a){logger['error']('CreateVoiceDialReport',_0x1bf54a[_0x6b2c('0x12')],_0x366e52);_0x598e1d(_0x25ed31[_0x6b2c('0x11')](0x1f4,_0x1bf54a['message']));});});};exports['UpdateVoiceDialReport']=function(_0x386b02){var _0x27ed8e=this;return new Promise(function(_0x113ed7,_0x1001c8){return db[_0x6b2c('0x17')]['update'](_0x386b02[_0x6b2c('0x18')],{'raw':_0x386b02[_0x6b2c('0x19')]?_0x386b02[_0x6b2c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386b02['options']?_0x386b02[_0x6b2c('0x19')][_0x6b2c('0x1b')]||null:null,'attributes':_0x386b02[_0x6b2c('0x19')]?_0x386b02[_0x6b2c('0x19')][_0x6b2c('0x1c')]||null:null,'limit':_0x386b02[_0x6b2c('0x19')]?_0x386b02[_0x6b2c('0x19')][_0x6b2c('0x1d')]||null:null})[_0x6b2c('0xc')](function(_0x3df9af){logger[_0x6b2c('0xd')](_0x6b2c('0x1e'),_0x386b02);logger[_0x6b2c('0xf')](_0x6b2c('0x1e'),_0x386b02,JSON['stringify'](_0x3df9af));_0x113ed7(_0x3df9af);})[_0x6b2c('0x15')](function(_0x3704c9){logger[_0x6b2c('0x11')](_0x6b2c('0x1e'),_0x3704c9[_0x6b2c('0x12')],_0x386b02);_0x1001c8(_0x27ed8e['error'](0x1f4,_0x3704c9[_0x6b2c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0d3c242..c595ada 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 _0xb9da=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xbec881,_0x26a98c){var _0x95d9e5=function(_0x308c18){while(--_0x308c18){_0xbec881['push'](_0xbec881['shift']());}};_0x95d9e5(++_0x26a98c);}(_0xb9da,0xb5));var _0xab9d=function(_0x417955,_0x4ed8c8){_0x417955=_0x417955-0x0;var _0x3a94ef=_0xb9da[_0x417955];return _0x3a94ef;};'use strict';var multer=require(_0xab9d('0x0'));var util=require(_0xab9d('0x1'));var path=require(_0xab9d('0x2'));var timeout=require(_0xab9d('0x3'));var express=require(_0xab9d('0x4'));var router=express[_0xab9d('0x5')]();var fs_extra=require(_0xab9d('0x6'));var auth=require(_0xab9d('0x7'));var interaction=require(_0xab9d('0x8'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xab9d('0x9')]('/',auth[_0xab9d('0xa')](),controller[_0xab9d('0xb')]);router[_0xab9d('0x9')](_0xab9d('0xc'),auth[_0xab9d('0xa')](),controller[_0xab9d('0xd')]);router['post']('/',auth[_0xab9d('0xa')](),controller[_0xab9d('0xe')]);router[_0xab9d('0xf')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xab9d('0x10')](_0xab9d('0xc'),auth[_0xab9d('0xa')](),controller[_0xab9d('0x11')]);router[_0xab9d('0x12')](_0xab9d('0xc'),auth[_0xab9d('0xa')](),controller[_0xab9d('0x13')]);module[_0xab9d('0x14')]=router; \ No newline at end of file +var _0x0d50=['isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy','exports','path','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x84131b,_0x59c69f){var _0x31e458=function(_0x466c6f){while(--_0x466c6f){_0x84131b['push'](_0x84131b['shift']());}};_0x31e458(++_0x59c69f);}(_0x0d50,0xc0));var _0x00d5=function(_0x407844,_0x47eedc){_0x407844=_0x407844-0x0;var _0x36f5df=_0x0d50[_0x407844];return _0x36f5df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00d5('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x00d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x00d5('0x2'));var config=require(_0x00d5('0x3'));var controller=require(_0x00d5('0x4'));router[_0x00d5('0x5')]('/',auth[_0x00d5('0x6')](),controller[_0x00d5('0x7')]);router['get'](_0x00d5('0x8'),auth[_0x00d5('0x6')](),controller[_0x00d5('0x9')]);router[_0x00d5('0xa')]('/',auth['isAuthenticated'](),controller[_0x00d5('0xb')]);router['post'](_0x00d5('0xc'),auth[_0x00d5('0x6')](),controller[_0x00d5('0xd')]);router[_0x00d5('0xe')](_0x00d5('0x8'),auth[_0x00d5('0x6')](),controller['update']);router[_0x00d5('0xf')](_0x00d5('0x8'),auth[_0x00d5('0x6')](),controller[_0x00d5('0x10')]);module[_0x00d5('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b58b06b..a154fb2 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 _0x9445=['INTEGER','wav','VIRTUAL','getDataValue','exten','exports','compositeIndex','STRING','NoOp','ENUM','inbound','internal','inbound-fax','system','*,*,*,*','BOOLEAN'];(function(_0x21a824,_0x263086){var _0x2615da=function(_0x198e98){while(--_0x198e98){_0x21a824['push'](_0x21a824['shift']());}};_0x2615da(++_0x263086);}(_0x9445,0xf5));var _0x5944=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9445[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x5944('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5944('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5944('0x2')],'allowNull':![],'unique':_0x5944('0x1')},'priority':{'type':Sequelize[_0x5944('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5944('0x1')},'tag':{'type':Sequelize[_0x5944('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5944('0x3')},'appdata':{'type':Sequelize[_0x5944('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5944('0x4')](_0x5944('0x5'),'outbound',_0x5944('0x6'),_0x5944('0x7'),'outbound-fax',_0x5944('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5944('0x2')],'allowNull':![],'defaultValue':_0x5944('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x5944('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5944('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5944('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x5944('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5944('0xb')]},'recordingFormat':{'type':Sequelize[_0x5944('0x2')],'defaultValue':_0x5944('0xc')},'answer':{'type':Sequelize[_0x5944('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5944('0xd')],'get':function(_0x176892){return this[_0x5944('0xe')](_0x5944('0xf'));}},'alias':{'type':Sequelize[_0x5944('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2dda=['NoOp','outbound','internal','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','sequelize','STRING','compositeIndex'];(function(_0x5f44a3,_0x1079d8){var _0x525cb4=function(_0x74cf07){while(--_0x74cf07){_0x5f44a3['push'](_0x5f44a3['shift']());}};_0x525cb4(++_0x1079d8);}(_0x2dda,0x159));var _0xa2dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dda[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa2dd('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa2dd('0x1')],'allowNull':![],'unique':_0xa2dd('0x2')},'priority':{'type':Sequelize[_0xa2dd('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xa2dd('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa2dd('0x1')],'allowNull':![],'defaultValue':_0xa2dd('0x3')},'appdata':{'type':Sequelize[_0xa2dd('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xa2dd('0x4'),_0xa2dd('0x5'),'inbound-fax','outbound-fax',_0xa2dd('0x6'),_0xa2dd('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xa2dd('0x1')]},'interval':{'type':Sequelize[_0xa2dd('0x1')],'allowNull':![],'defaultValue':_0xa2dd('0x8')},'IntervalId':{'type':Sequelize[_0xa2dd('0x9')]},'isApp':{'type':Sequelize[_0xa2dd('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa2dd('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xa2dd('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xa2dd('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xa2dd('0x1')],'defaultValue':_0xa2dd('0xb')},'answer':{'type':Sequelize[_0xa2dd('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xb8a70c){return this['getDataValue']('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 571b688..bda9b95 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 _0xeb66=['context','description','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','sendStatus','ioredis','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','find','type','name','UserProfileResource','destroy','then','stack','send','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','filter','VIRTUAL','merge','include','VoiceExtension','findAll','rows','catch','params','includeAll','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','update','pick'];(function(_0x37ab7b,_0x509b5b){var _0x3b871f=function(_0x11c741){while(--_0x11c741){_0x37ab7b['push'](_0x37ab7b['shift']());}};_0x3b871f(++_0x509b5b);}(_0xeb66,0x169));var _0x6eb6=function(_0x45107a,_0x38b878){_0x45107a=_0x45107a-0x0;var _0x43d4b6=_0xeb66[_0x45107a];return _0x43d4b6;};'use strict';var _=require('lodash');var Redis=require(_0x6eb6('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6eb6('0x1'));var config=require(_0x6eb6('0x2'));var db=require('../../mysqldb')['db'];config[_0x6eb6('0x3')]=_['defaults'](config[_0x6eb6('0x3')],{'host':_0x6eb6('0x4'),'port':0x18eb});var socket=require(_0x6eb6('0x5'))(new Redis(config['redis']));require(_0x6eb6('0x6'))[_0x6eb6('0x7')](socket);function respondWithStatusCode(_0x468363,_0x528e0a){_0x528e0a=_0x528e0a||0xcc;return function(_0x2edf0f){if(_0x2edf0f){return _0x468363['sendStatus'](_0x528e0a);}return _0x468363[_0x6eb6('0x8')](_0x528e0a)['end']();};}function respondWithResult(_0x546fd2,_0x1e98b6){_0x1e98b6=_0x1e98b6||0xc8;return function(_0x43ec37){if(_0x43ec37){return _0x546fd2[_0x6eb6('0x8')](_0x1e98b6)[_0x6eb6('0x9')](_0x43ec37);}};}function respondWithFilteredResult(_0x56582e,_0x259e77){return function(_0x172661){if(_0x172661){var _0xd4cfcc=typeof _0x259e77['offset']==='undefined'&&typeof _0x259e77[_0x6eb6('0xa')]===_0x6eb6('0xb');var _0x376e4e=_0x172661[_0x6eb6('0xc')];var _0x247eaa=_0xd4cfcc?0x0:_0x259e77[_0x6eb6('0xd')];var _0x20e2b7=_0xd4cfcc?_0x172661[_0x6eb6('0xc')]:_0x259e77[_0x6eb6('0xd')]+_0x259e77['limit'];var _0x47a49d;if(_0x20e2b7>=_0x376e4e){_0x20e2b7=_0x376e4e;_0x47a49d=0xc8;}else{_0x47a49d=0xce;}_0x56582e[_0x6eb6('0x8')](_0x47a49d);return _0x56582e[_0x6eb6('0xe')](_0x6eb6('0xf'),_0x247eaa+'-'+_0x20e2b7+'/'+_0x376e4e)[_0x6eb6('0x9')](_0x172661);}return null;};}function removeEntity(_0x3d9b47){return function(_0xfd8db5){if(_0xfd8db5){return _0xfd8db5['destroy']()['then'](function(){var _0x5b78cd=_0xfd8db5[_0x6eb6('0x10')]({'plain':!![]});var _0x5a4b09=[{'name':_0x6eb6('0x11'),'value':_0x6eb6('0x12'),'ignore':![]},{'name':_0x6eb6('0x13'),'value':_0x6eb6('0x14'),'ignore':![]},{'name':_0x6eb6('0x15'),'value':_0x6eb6('0x16'),'ignore':![]}];var _0x638b96=_(_0x5a4b09)['filter'](_0x6eb6('0x17'))[_0x6eb6('0x18')]('value')[_0x6eb6('0x19')]();if(_[_0x6eb6('0x1a')](_0x638b96,_0x5b78cd['type'])){return;}var _0xf86237=_[_0x6eb6('0x1b')](_0x5a4b09,[_0x6eb6('0x19'),_0x5b78cd[_0x6eb6('0x1c')]])[_0x6eb6('0x1d')];return db[_0x6eb6('0x1e')][_0x6eb6('0x1f')]({'where':{'type':_0xf86237,'resourceId':_0x5b78cd['id']}})[_0x6eb6('0x20')](function(){return _0xfd8db5;});})[_0x6eb6('0x20')](function(){_0x3d9b47[_0x6eb6('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b973){return function(_0x1b1829){if(!_0x1b1829){_0x52b973['sendStatus'](0x194);}return _0x1b1829;};}function handleError(_0x265225,_0x99578a){_0x99578a=_0x99578a||0x1f4;return function(_0x26f8ce){logger['error'](_0x26f8ce[_0x6eb6('0x21')]);if(_0x26f8ce['name']){delete _0x26f8ce[_0x6eb6('0x1d')];}_0x265225['status'](_0x99578a)[_0x6eb6('0x22')](_0x26f8ce);};}exports['index']=function(_0x2878db,_0x178356){var _0x1020be={},_0x41a630={},_0x39a419={'count':0x0,'rows':[]};var _0x3cc9c8=_[_0x6eb6('0x18')](db['VoiceExtension']['rawAttributes'],function(_0x2bc584){return{'name':_0x2bc584['fieldName'],'type':_0x2bc584['type'][_0x6eb6('0x23')]};});_0x41a630['model']=_[_0x6eb6('0x18')](_0x3cc9c8,_0x6eb6('0x1d'));_0x41a630[_0x6eb6('0x24')]=_[_0x6eb6('0x25')](_0x2878db['query']);_0x41a630[_0x6eb6('0x26')]=_['intersection'](_0x41a630[_0x6eb6('0x27')],_0x41a630[_0x6eb6('0x24')]);_0x1020be[_0x6eb6('0x28')]=_[_0x6eb6('0x29')](_0x41a630[_0x6eb6('0x27')],qs['fields'](_0x2878db[_0x6eb6('0x24')][_0x6eb6('0x2a')]));_0x1020be[_0x6eb6('0x28')]=_0x1020be['attributes'][_0x6eb6('0x2b')]?_0x1020be['attributes']:_0x41a630[_0x6eb6('0x27')];if(!_0x2878db['query']['hasOwnProperty']('nolimit')){_0x1020be['limit']=qs[_0x6eb6('0xa')](_0x2878db[_0x6eb6('0x24')][_0x6eb6('0xa')]);_0x1020be[_0x6eb6('0xd')]=qs['offset'](_0x2878db[_0x6eb6('0x24')][_0x6eb6('0xd')]);}_0x1020be[_0x6eb6('0x2c')]=qs[_0x6eb6('0x2d')](_0x2878db[_0x6eb6('0x24')]['sort']);_0x1020be[_0x6eb6('0x2e')]=qs[_0x6eb6('0x26')](_['pick'](_0x2878db[_0x6eb6('0x24')],_0x41a630[_0x6eb6('0x26')]),_0x3cc9c8);if(_0x2878db[_0x6eb6('0x24')][_0x6eb6('0x2f')]){_0x1020be['where']=_['merge'](_0x1020be['where'],{'$or':_[_0x6eb6('0x18')](_0x3cc9c8,function(_0x404221){if(_0x404221[_0x6eb6('0x1c')]!==_0x6eb6('0x30')){var _0xb4c0d9={};_0xb4c0d9[_0x404221[_0x6eb6('0x1d')]]={'$like':'%'+_0x2878db[_0x6eb6('0x24')][_0x6eb6('0x2f')]+'%'};return _0xb4c0d9;}})});}_0x1020be=_[_0x6eb6('0x31')]({},_0x1020be,_0x2878db['options']);var _0x2bd11d={'where':_0x1020be[_0x6eb6('0x2e')]};return db['VoiceExtension']['count'](_0x2bd11d)[_0x6eb6('0x20')](function(_0x33d8d2){_0x39a419[_0x6eb6('0xc')]=_0x33d8d2;if(_0x2878db[_0x6eb6('0x24')]['includeAll']){_0x1020be[_0x6eb6('0x32')]=[{'all':!![]}];}return db[_0x6eb6('0x33')][_0x6eb6('0x34')](_0x1020be);})['then'](function(_0x51ab37){_0x39a419[_0x6eb6('0x35')]=_0x51ab37;return _0x39a419;})[_0x6eb6('0x20')](respondWithFilteredResult(_0x178356,_0x1020be))[_0x6eb6('0x36')](handleError(_0x178356,null));};exports['show']=function(_0x3099db,_0x78ea14){var _0x208a17={'raw':![],'where':{'id':_0x3099db[_0x6eb6('0x37')]['id']}},_0x560c87={};_0x560c87[_0x6eb6('0x27')]=_[_0x6eb6('0x25')](db[_0x6eb6('0x33')]['rawAttributes']);_0x560c87['query']=_[_0x6eb6('0x25')](_0x3099db[_0x6eb6('0x24')]);_0x560c87[_0x6eb6('0x26')]=_['intersection'](_0x560c87[_0x6eb6('0x27')],_0x560c87[_0x6eb6('0x24')]);_0x208a17['attributes']=_[_0x6eb6('0x29')](_0x560c87[_0x6eb6('0x27')],qs[_0x6eb6('0x2a')](_0x3099db[_0x6eb6('0x24')][_0x6eb6('0x2a')]));_0x208a17[_0x6eb6('0x28')]=_0x208a17[_0x6eb6('0x28')][_0x6eb6('0x2b')]?_0x208a17['attributes']:_0x560c87[_0x6eb6('0x27')];if(_0x3099db['query'][_0x6eb6('0x38')]){_0x208a17[_0x6eb6('0x32')]=[{'all':!![]}];}_0x208a17=_[_0x6eb6('0x31')]({},_0x208a17,_0x3099db['options']);return db['VoiceExtension'][_0x6eb6('0x1b')](_0x208a17)['then'](handleEntityNotFound(_0x78ea14,null))['then'](respondWithResult(_0x78ea14,null))[_0x6eb6('0x36')](handleError(_0x78ea14,null));};exports[_0x6eb6('0x1f')]=function(_0x34f954,_0x4edff7){return db['VoiceExtension']['find']({'where':{'id':_0x34f954[_0x6eb6('0x37')]['id']}})[_0x6eb6('0x20')](handleEntityNotFound(_0x4edff7,null))[_0x6eb6('0x20')](removeEntity(_0x4edff7,null))[_0x6eb6('0x36')](handleError(_0x4edff7,null));};exports['create']=function(_0x5caa13,_0x440c80){if(_0x5caa13[_0x6eb6('0x39')]['type']===_0x6eb6('0x14')&&!_['startsWith'](_0x5caa13[_0x6eb6('0x39')][_0x6eb6('0x3a')],'_')){_0x5caa13[_0x6eb6('0x39')][_0x6eb6('0x3a')]='_'[_0x6eb6('0x3b')](_0x5caa13[_0x6eb6('0x39')][_0x6eb6('0x3a')]);}return db[_0x6eb6('0x33')]['create'](_0x5caa13[_0x6eb6('0x39')],{'raw':![]})[_0x6eb6('0x20')](function(_0x3746d8){var _0x3b31bd=_0x5caa13[_0x6eb6('0x3c')][_0x6eb6('0x10')]({'plain':!![]});if(!_0x3b31bd)throw new Error(_0x6eb6('0x3d'));if(_0x3b31bd['role']==='user'){var _0x22dd7f=_0x3746d8[_0x6eb6('0x10')]({'plain':!![]});var _0x3862ae=[{'name':_0x6eb6('0x11'),'value':_0x6eb6('0x12')},{'name':_0x6eb6('0x13'),'value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x37fbd0=_[_0x6eb6('0x1b')](_0x3862ae,[_0x6eb6('0x19'),_0x22dd7f[_0x6eb6('0x1c')]])[_0x6eb6('0x1d')];return db[_0x6eb6('0x3e')]['find']({'where':{'name':_0x37fbd0,'userProfileId':_0x3b31bd[_0x6eb6('0x3f')]},'raw':!![]})['then'](function(_0x80c9f0){if(_0x80c9f0&&_0x80c9f0[_0x6eb6('0x40')]===0x0){return db[_0x6eb6('0x1e')][_0x6eb6('0x41')]({'name':_0x22dd7f['name'],'resourceId':_0x22dd7f['id'],'type':_0x80c9f0[_0x6eb6('0x1d')],'sectionId':_0x80c9f0['id']},{})['then'](function(){return _0x3746d8;});}else{return _0x3746d8;}})[_0x6eb6('0x36')](function(_0x2ff392){logger[_0x6eb6('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ff392);throw _0x2ff392;});}return _0x3746d8;})[_0x6eb6('0x20')](respondWithResult(_0x440c80,0xc9))['catch'](handleError(_0x440c80,null));};exports[_0x6eb6('0x43')]=function(_0x2d862a,_0x307d4f){if(_0x2d862a[_0x6eb6('0x39')]['id']){delete _0x2d862a[_0x6eb6('0x39')]['id'];}return db['VoiceExtension'][_0x6eb6('0x1b')]({'where':{'id':_0x2d862a[_0x6eb6('0x37')]['id']}})[_0x6eb6('0x20')](handleEntityNotFound(_0x307d4f,null))[_0x6eb6('0x20')](function(_0x1a493f){if(_0x1a493f){return db[_0x6eb6('0x33')][_0x6eb6('0x43')](_[_0x6eb6('0x44')](_0x2d862a['body'],[_0x6eb6('0x3a'),_0x6eb6('0x45'),_0x6eb6('0x46'),_0x6eb6('0x47'),_0x6eb6('0x48'),'mandatoryDisposition',_0x6eb6('0x49')]),{'where':{'context':_0x1a493f['context'],'exten':_0x1a493f['exten']},'individualHooks':!![]})[_0x6eb6('0x20')](function(_0x2e77bf){return _0x2e77bf;});}return null;})['then'](respondWithStatusCode(_0x307d4f,null))[_0x6eb6('0x36')](handleError(_0x307d4f,null));};exports[_0x6eb6('0x4a')]=function(_0x282915,_0x3158a7){var _0x41f85a=_0x282915[_0x6eb6('0x37')]['id'];var _0x3e9201=_0x282915[_0x6eb6('0x39')];var _0x5982da=0xc8;var _0x1c4690=null;return db['sequelize'][_0x6eb6('0x4b')]({'isolationLevel':db[_0x6eb6('0x4c')][_0x6eb6('0x4d')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x2c591a){return db['VoiceExtension'][_0x6eb6('0x4e')]({'where':{'id':_0x41f85a},'transaction':_0x2c591a})[_0x6eb6('0x20')](function(_0x112018){if(_0x112018){return db[_0x6eb6('0x33')][_0x6eb6('0x1f')]({'where':{'VoiceExtensionId':_0x41f85a},'transaction':_0x2c591a})[_0x6eb6('0x20')](function(){var _0x219b99=_[_0x6eb6('0x18')](_0x3e9201,function(_0x3fdb7f){_0x3fdb7f[_0x6eb6('0x4f')]=_0x41f85a;_0x3fdb7f[_0x6eb6('0x50')]=!![];return _0x3fdb7f;});return _0x112018[_0x6eb6('0x51')](_0x219b99);})[_0x6eb6('0x20')](function(_0x34d93c){return db[_0x6eb6('0x33')]['bulkCreate'](_0x34d93c,{'transaction':_0x2c591a});});}else{_0x5982da=0x194;_0x1c4690=[];}});})[_0x6eb6('0x20')](function(){if(_0x5982da!==0x194){return db[_0x6eb6('0x33')][_0x6eb6('0x52')]({'where':{'isApp':!![],'VoiceExtensionId':_0x41f85a},'order':_0x6eb6('0x53')})['then'](function(_0x1599bc){_0x1c4690=_0x1599bc;});}})['catch'](function(_0x5cfb33){_0x5982da=0x1f4;logger[_0x6eb6('0x42')](_0x5cfb33[_0x6eb6('0x21')]);if(_0x5cfb33[_0x6eb6('0x1d')]){delete _0x5cfb33[_0x6eb6('0x1d')];}_0x1c4690=_0x5cfb33;})[_0x6eb6('0x54')](function(){if(_0x1c4690===null){_0x3158a7[_0x6eb6('0x55')](_0x5982da);}else{if(_0x5982da===0x1f4){_0x3158a7[_0x6eb6('0x8')](_0x5982da)['send'](_0x1c4690);}else{_0x3158a7[_0x6eb6('0x8')](_0x5982da)['json'](_0x1c4690);}}});}; \ No newline at end of file +var _0x026e=['alias','sequelize','transaction','Transaction','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','inbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','stack','send','VoiceExtension','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x026e,0x11d));var _0xe026=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x026e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var Redis=require(_0xe026('0x0'));var qs=require(_0xe026('0x1'));var logger=require(_0xe026('0x2'))(_0xe026('0x3'));var config=require(_0xe026('0x4'));var db=require('../../mysqldb')['db'];config[_0xe026('0x5')]=_[_0xe026('0x6')](config[_0xe026('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xe026('0x7'))(new Redis(config[_0xe026('0x5')]));require(_0xe026('0x8'))[_0xe026('0x9')](socket);function respondWithStatusCode(_0x55de1a,_0x330d48){_0x330d48=_0x330d48||0xcc;return function(_0xb975dc){if(_0xb975dc){return _0x55de1a[_0xe026('0xa')](_0x330d48);}return _0x55de1a[_0xe026('0xb')](_0x330d48)['end']();};}function respondWithResult(_0x1ba3e7,_0xb9f603){_0xb9f603=_0xb9f603||0xc8;return function(_0x18199c){if(_0x18199c){return _0x1ba3e7[_0xe026('0xb')](_0xb9f603)[_0xe026('0xc')](_0x18199c);}};}function respondWithFilteredResult(_0x453ad0,_0x4d8234){return function(_0xfece4a){if(_0xfece4a){var _0x143fc3=typeof _0x4d8234[_0xe026('0xd')]===_0xe026('0xe')&&typeof _0x4d8234[_0xe026('0xf')]==='undefined';var _0x3ad206=_0xfece4a['count'];var _0x31a824=_0x143fc3?0x0:_0x4d8234[_0xe026('0xd')];var _0x302fcd=_0x143fc3?_0xfece4a[_0xe026('0x10')]:_0x4d8234['offset']+_0x4d8234[_0xe026('0xf')];var _0x4dcc7e;if(_0x302fcd>=_0x3ad206){_0x302fcd=_0x3ad206;_0x4dcc7e=0xc8;}else{_0x4dcc7e=0xce;}_0x453ad0[_0xe026('0xb')](_0x4dcc7e);return _0x453ad0[_0xe026('0x11')]('Content-Range',_0x31a824+'-'+_0x302fcd+'/'+_0x3ad206)[_0xe026('0xc')](_0xfece4a);}return null;};}function removeEntity(_0x58fc4d){return function(_0x303297){if(_0x303297){return _0x303297[_0xe026('0x12')]()[_0xe026('0x13')](function(){var _0x25e684=_0x303297[_0xe026('0x14')]({'plain':!![]});var _0x18134f=[{'name':_0xe026('0x15'),'value':_0xe026('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xe026('0x17'),'value':_0xe026('0x18'),'ignore':![]}];var _0x3cf225=_(_0x18134f)[_0xe026('0x19')](_0xe026('0x1a'))[_0xe026('0x1b')](_0xe026('0x1c'))[_0xe026('0x1c')]();if(_['includes'](_0x3cf225,_0x25e684[_0xe026('0x1d')])){return;}var _0x1183ff=_[_0xe026('0x1e')](_0x18134f,['value',_0x25e684['type']])[_0xe026('0x1f')];return db[_0xe026('0x20')][_0xe026('0x12')]({'where':{'type':_0x1183ff,'resourceId':_0x25e684['id']}})[_0xe026('0x13')](function(){return _0x303297;});})[_0xe026('0x13')](function(){_0x58fc4d['status'](0xcc)[_0xe026('0x21')]();});}};}function handleEntityNotFound(_0x26973a){return function(_0xc2e2df){if(!_0xc2e2df){_0x26973a['sendStatus'](0x194);}return _0xc2e2df;};}function handleError(_0x136438,_0x217d7b){_0x217d7b=_0x217d7b||0x1f4;return function(_0x34c749){logger[_0xe026('0x22')](_0x34c749[_0xe026('0x23')]);if(_0x34c749[_0xe026('0x1f')]){delete _0x34c749[_0xe026('0x1f')];}_0x136438[_0xe026('0xb')](_0x217d7b)[_0xe026('0x24')](_0x34c749);};}exports['index']=function(_0x2846d9,_0x141eb2){var _0x292afe={},_0x17f809={},_0x2b8c0f={'count':0x0,'rows':[]};var _0x1e8107=_[_0xe026('0x1b')](db[_0xe026('0x25')][_0xe026('0x26')],function(_0x1cf79b){return{'name':_0x1cf79b[_0xe026('0x27')],'type':_0x1cf79b[_0xe026('0x1d')]['key']};});_0x17f809['model']=_[_0xe026('0x1b')](_0x1e8107,_0xe026('0x1f'));_0x17f809[_0xe026('0x28')]=_[_0xe026('0x29')](_0x2846d9[_0xe026('0x28')]);_0x17f809[_0xe026('0x2a')]=_[_0xe026('0x2b')](_0x17f809['model'],_0x17f809[_0xe026('0x28')]);_0x292afe[_0xe026('0x2c')]=_[_0xe026('0x2b')](_0x17f809[_0xe026('0x2d')],qs[_0xe026('0x2e')](_0x2846d9['query'][_0xe026('0x2e')]));_0x292afe[_0xe026('0x2c')]=_0x292afe[_0xe026('0x2c')][_0xe026('0x2f')]?_0x292afe[_0xe026('0x2c')]:_0x17f809[_0xe026('0x2d')];if(!_0x2846d9['query']['hasOwnProperty']('nolimit')){_0x292afe['limit']=qs['limit'](_0x2846d9[_0xe026('0x28')][_0xe026('0xf')]);_0x292afe[_0xe026('0xd')]=qs['offset'](_0x2846d9[_0xe026('0x28')]['offset']);}_0x292afe['order']=qs[_0xe026('0x30')](_0x2846d9[_0xe026('0x28')]['sort']);_0x292afe[_0xe026('0x31')]=qs[_0xe026('0x2a')](_['pick'](_0x2846d9[_0xe026('0x28')],_0x17f809[_0xe026('0x2a')]),_0x1e8107);if(_0x2846d9[_0xe026('0x28')][_0xe026('0x19')]){_0x292afe[_0xe026('0x31')]=_['merge'](_0x292afe[_0xe026('0x31')],{'$or':_[_0xe026('0x1b')](_0x1e8107,function(_0xe21920){if(_0xe21920[_0xe026('0x1d')]!==_0xe026('0x32')){var _0x3109d0={};_0x3109d0[_0xe21920[_0xe026('0x1f')]]={'$like':'%'+_0x2846d9[_0xe026('0x28')][_0xe026('0x19')]+'%'};return _0x3109d0;}})});}_0x292afe=_[_0xe026('0x33')]({},_0x292afe,_0x2846d9[_0xe026('0x34')]);var _0x3124d2={'where':_0x292afe[_0xe026('0x31')]};return db[_0xe026('0x25')]['count'](_0x3124d2)[_0xe026('0x13')](function(_0x144efa){_0x2b8c0f[_0xe026('0x10')]=_0x144efa;if(_0x2846d9[_0xe026('0x28')][_0xe026('0x35')]){_0x292afe[_0xe026('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0xe026('0x37')](_0x292afe);})[_0xe026('0x13')](function(_0x268693){_0x2b8c0f[_0xe026('0x38')]=_0x268693;return _0x2b8c0f;})[_0xe026('0x13')](respondWithFilteredResult(_0x141eb2,_0x292afe))['catch'](handleError(_0x141eb2,null));};exports[_0xe026('0x39')]=function(_0x463704,_0xe3798d){var _0x164c8f={'raw':![],'where':{'id':_0x463704[_0xe026('0x3a')]['id']}},_0x1e0a3a={};_0x1e0a3a[_0xe026('0x2d')]=_[_0xe026('0x29')](db[_0xe026('0x25')]['rawAttributes']);_0x1e0a3a['query']=_['keys'](_0x463704[_0xe026('0x28')]);_0x1e0a3a[_0xe026('0x2a')]=_[_0xe026('0x2b')](_0x1e0a3a['model'],_0x1e0a3a[_0xe026('0x28')]);_0x164c8f['attributes']=_[_0xe026('0x2b')](_0x1e0a3a[_0xe026('0x2d')],qs['fields'](_0x463704['query']['fields']));_0x164c8f[_0xe026('0x2c')]=_0x164c8f[_0xe026('0x2c')][_0xe026('0x2f')]?_0x164c8f[_0xe026('0x2c')]:_0x1e0a3a['model'];if(_0x463704[_0xe026('0x28')]['includeAll']){_0x164c8f[_0xe026('0x36')]=[{'all':!![]}];}_0x164c8f=_[_0xe026('0x33')]({},_0x164c8f,_0x463704['options']);return db[_0xe026('0x25')][_0xe026('0x1e')](_0x164c8f)['then'](handleEntityNotFound(_0xe3798d,null))[_0xe026('0x13')](respondWithResult(_0xe3798d,null))[_0xe026('0x3b')](handleError(_0xe3798d,null));};exports[_0xe026('0x12')]=function(_0x271569,_0x5c0bc8){return db['VoiceExtension'][_0xe026('0x1e')]({'where':{'id':_0x271569['params']['id']}})[_0xe026('0x13')](handleEntityNotFound(_0x5c0bc8,null))[_0xe026('0x13')](removeEntity(_0x5c0bc8,null))['catch'](handleError(_0x5c0bc8,null));};exports[_0xe026('0x3c')]=function(_0x11e730,_0x569053){if(_0x11e730[_0xe026('0x3d')]['type']==='outbound'&&!_[_0xe026('0x3e')](_0x11e730[_0xe026('0x3d')][_0xe026('0x3f')],'_')){_0x11e730['body']['exten']='_'[_0xe026('0x40')](_0x11e730[_0xe026('0x3d')][_0xe026('0x3f')]);}return db[_0xe026('0x25')][_0xe026('0x3c')](_0x11e730[_0xe026('0x3d')],{'raw':![]})[_0xe026('0x13')](function(_0x3cd558){var _0x2d9c17=_0x11e730[_0xe026('0x41')][_0xe026('0x14')]({'plain':!![]});if(!_0x2d9c17)throw new Error(_0xe026('0x42'));if(_0x2d9c17['role']==='user'){var _0x32fe1e=_0x3cd558['get']({'plain':!![]});var _0x3ef835=[{'name':_0xe026('0x15'),'value':_0xe026('0x16')},{'name':'OutboundRoutes','value':_0xe026('0x43')},{'name':_0xe026('0x17'),'value':'internal'}];var _0x45bfe6=_['find'](_0x3ef835,[_0xe026('0x1c'),_0x32fe1e[_0xe026('0x1d')]])['name'];return db[_0xe026('0x44')][_0xe026('0x1e')]({'where':{'name':_0x45bfe6,'userProfileId':_0x2d9c17[_0xe026('0x45')]},'raw':!![]})['then'](function(_0x2ff961){if(_0x2ff961&&_0x2ff961[_0xe026('0x46')]===0x0){return db[_0xe026('0x20')][_0xe026('0x3c')]({'name':_0x32fe1e[_0xe026('0x1f')],'resourceId':_0x32fe1e['id'],'type':_0x2ff961[_0xe026('0x1f')],'sectionId':_0x2ff961['id']},{})['then'](function(){return _0x3cd558;});}else{return _0x3cd558;}})[_0xe026('0x3b')](function(_0x5deedc){logger['error'](_0xe026('0x47'),_0x5deedc);throw _0x5deedc;});}return _0x3cd558;})['then'](respondWithResult(_0x569053,0xc9))[_0xe026('0x3b')](handleError(_0x569053,null));};exports['update']=function(_0x3629a3,_0x25ccc5){if(_0x3629a3['body']['id']){delete _0x3629a3[_0xe026('0x3d')]['id'];}return db['VoiceExtension'][_0xe026('0x1e')]({'where':{'id':_0x3629a3['params']['id']}})['then'](handleEntityNotFound(_0x25ccc5,null))[_0xe026('0x13')](function(_0x202e65){if(_0x202e65){return db[_0xe026('0x25')][_0xe026('0x48')](_[_0xe026('0x49')](_0x3629a3[_0xe026('0x3d')],[_0xe026('0x3f'),_0xe026('0x4a'),_0xe026('0x4b'),_0xe026('0x4c'),_0xe026('0x4d'),_0xe026('0x4e'),_0xe026('0x4f')]),{'where':{'context':_0x202e65[_0xe026('0x4a')],'exten':_0x202e65[_0xe026('0x3f')]},'individualHooks':!![]})[_0xe026('0x13')](function(_0x49f444){return _0x49f444;});}return null;})[_0xe026('0x13')](respondWithStatusCode(_0x25ccc5,null))[_0xe026('0x3b')](handleError(_0x25ccc5,null));};exports['addApplications']=function(_0x30b2b0,_0x1effe1){var _0x4037a8=_0x30b2b0[_0xe026('0x3a')]['id'];var _0x3ec880=_0x30b2b0[_0xe026('0x3d')];var _0x4a64b3=0xc8;var _0x467c56=null;return db[_0xe026('0x50')][_0xe026('0x51')]({'isolationLevel':db[_0xe026('0x50')][_0xe026('0x52')]['ISOLATION_LEVELS'][_0xe026('0x53')]},function(_0x5ab862){return db[_0xe026('0x25')][_0xe026('0x54')]({'where':{'id':_0x4037a8},'transaction':_0x5ab862})['then'](function(_0x1fd4d1){if(_0x1fd4d1){return db[_0xe026('0x25')][_0xe026('0x12')]({'where':{'VoiceExtensionId':_0x4037a8},'transaction':_0x5ab862})[_0xe026('0x13')](function(){var _0x3ac3da=_[_0xe026('0x1b')](_0x3ec880,function(_0x94f005){_0x94f005['VoiceExtensionId']=_0x4037a8;_0x94f005[_0xe026('0x55')]=!![];return _0x94f005;});return _0x1fd4d1[_0xe026('0x56')](_0x3ac3da);})[_0xe026('0x13')](function(_0x29544e){return db[_0xe026('0x25')][_0xe026('0x57')](_0x29544e,{'transaction':_0x5ab862});});}else{_0x4a64b3=0x194;_0x467c56=[];}});})['then'](function(){if(_0x4a64b3!==0x194){return db['VoiceExtension'][_0xe026('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4037a8},'order':_0xe026('0x59')})[_0xe026('0x13')](function(_0xd99048){_0x467c56=_0xd99048;});}})[_0xe026('0x3b')](function(_0x33a1b6){_0x4a64b3=0x1f4;logger[_0xe026('0x22')](_0x33a1b6['stack']);if(_0x33a1b6[_0xe026('0x1f')]){delete _0x33a1b6[_0xe026('0x1f')];}_0x467c56=_0x33a1b6;})[_0xe026('0x5a')](function(){if(_0x467c56===null){_0x1effe1[_0xe026('0xa')](_0x4a64b3);}else{if(_0x4a64b3===0x1f4){_0x1effe1[_0xe026('0xb')](_0x4a64b3)[_0xe026('0x24')](_0x467c56);}else{_0x1effe1['status'](_0x4a64b3)['json'](_0x467c56);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 8527ff2..595ca59 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 _0xe416=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3dfda5,_0x36ee69){var _0x375b57=function(_0x5fa550){while(--_0x5fa550){_0x3dfda5['push'](_0x3dfda5['shift']());}};_0x375b57(++_0x36ee69);}(_0xe416,0x14f));var _0x6e41=function(_0x477e37,_0x20c259){_0x477e37=_0x477e37-0x0;var _0x2f8317=_0xe416[_0x477e37];return _0x2f8317;};'use strict';var EventEmitter=require(_0x6e41('0x0'));var VoiceExtension=require(_0x6e41('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6e41('0x2')](0x0);var events={'afterCreate':_0x6e41('0x3'),'afterUpdate':_0x6e41('0x4'),'afterDestroy':_0x6e41('0x5')};function emitEvent(_0x259cbe){return function(_0x448997,_0xc7d7fc,_0x13a825){VoiceExtensionEvents[_0x6e41('0x6')](_0x259cbe+':'+_0x448997['id'],_0x448997);VoiceExtensionEvents[_0x6e41('0x6')](_0x259cbe,_0x448997);_0x13a825(null);};}for(var e in events){if(events[_0x6e41('0x7')](e)){var event=events[e];VoiceExtension[_0x6e41('0x8')](e,emitEvent(event));}}module[_0x6e41('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd95c=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xd95c,0xb8));var _0xcd95=function(_0x2b010e,_0x3dddb7){_0x2b010e=_0x2b010e-0x0;var _0x47cdb5=_0xd95c[_0x2b010e];return _0x47cdb5;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xcd95('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xcd95('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd95('0x2'),'afterDestroy':_0xcd95('0x3')};function emitEvent(_0x2653b5){return function(_0x14823c,_0x1cd56e,_0x23bf8d){VoiceExtensionEvents[_0xcd95('0x4')](_0x2653b5+':'+_0x14823c['id'],_0x14823c);VoiceExtensionEvents['emit'](_0x2653b5,_0x14823c);_0x23bf8d(null);};}for(var e in events){if(events[_0xcd95('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xcd95('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 5be95e5..00c819c 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 _0x9ec3=['split','name','param','prefix','phone','SIP','join','indexOf','replace','U(xcally-mixmonitor-context)','isEmpty','interval','then','*,*,*,*','map','filter','IntervalId','toLowerCase','tag','CDR(tag)=','intervals','length','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime','outboundDial','appdata','priority','last','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','type','Set','CDR(type)=','NoOp','alias','context','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ec3,0xcd));var _0x39ec=function(_0x4f9478,_0x134ef3){_0x4f9478=_0x4f9478-0x0;var _0x3464c9=_0x9ec3[_0x4f9478];return _0x3464c9;};'use strict';var _=require(_0x39ec('0x0'));var attributes=require(_0x39ec('0x1'));module['exports']=function(_0x4dfde3){var _0x3295d1=_0x4dfde3['models'];function _0x388a9d(_0xa0b2a1){var _0x3ef850=0x2;var _0x2e696d=[{'type':_0xa0b2a1[_0x39ec('0x2')],'app':_0x39ec('0x3'),'appdata':_0x39ec('0x4')+_0xa0b2a1[_0x39ec('0x2')],'context':_0xa0b2a1['context'],'exten':_0xa0b2a1['exten'],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']},{'type':_0xa0b2a1[_0x39ec('0x2')],'app':_0xa0b2a1['alias']?_0x39ec('0x3'):_0x39ec('0x5'),'appdata':_0xa0b2a1[_0x39ec('0x6')]?'CDR(routeAlias)='+_0xa0b2a1[_0x39ec('0x6')]:'No\x20alias\x20set','context':_0xa0b2a1[_0x39ec('0x7')],'exten':_0xa0b2a1[_0x39ec('0x8')],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']}];if(_0xa0b2a1['type']===_0x39ec('0x9')){_0x2e696d[_0x39ec('0xa')]({'type':_0x39ec('0x9'),'app':'Set','appdata':'CDR(routeid)='+_0xa0b2a1['id'],'context':_0xa0b2a1[_0x39ec('0x7')],'exten':_0xa0b2a1[_0x39ec('0x8')],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']});}_0x2e696d['push']({'type':_0xa0b2a1[_0x39ec('0x2')],'app':_0x39ec('0x3'),'appdata':_0x39ec('0xb'),'context':_0xa0b2a1['context'],'exten':_0xa0b2a1[_0x39ec('0x8')],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']},{'type':_0xa0b2a1[_0x39ec('0x2')],'app':_0x39ec('0x3'),'appdata':_0x39ec('0xc'),'context':_0xa0b2a1[_0x39ec('0x7')],'exten':_0xa0b2a1['exten'],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']},{'type':_0xa0b2a1[_0x39ec('0x2')],'app':_0x39ec('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0xa0b2a1[_0x39ec('0x7')],'exten':_0xa0b2a1['exten'],'priority':_0x3ef850++,'VoiceExtensionId':_0xa0b2a1['id']});return _0x2e696d;}function _0x303173(_0x390fa5){var _0x2ada19=0x2;var _0x54996c=[{'type':_0x39ec('0xd'),'app':_0x39ec('0x3'),'appdata':_0x39ec('0xe'),'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':'outbound','app':_0x390fa5['alias']?_0x39ec('0x3'):'NoOp','appdata':_0x390fa5[_0x39ec('0x6')]?_0x39ec('0xf')+_0x390fa5[_0x39ec('0x6')]:_0x39ec('0x10'),'context':_0x390fa5['context'],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':'outbound','app':'Set','appdata':_0x39ec('0x11')+(_0x390fa5[_0x39ec('0x12')]?_0x39ec('0x13')+_0x390fa5[_0x39ec('0x12')]+'}':_0x39ec('0x14')),'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':_0x39ec('0x3'),'appdata':_0x39ec('0x15')+_0x390fa5['id'],'context':_0x390fa5['context'],'exten':_0x390fa5['exten'],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':_0x39ec('0x16'),'appdata':_0x39ec('0x17')+(_0x2ada19+0x2)+_0x39ec('0x18')+(_0x2ada19+0x1)+')','context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5['exten'],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':_0x39ec('0x3'),'appdata':_0x390fa5[_0x39ec('0x12')]?_0x39ec('0x19')+_0x390fa5['cutdigits']+'}':_0x39ec('0x1a'),'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':'outbound','app':_0x39ec('0x3'),'appdata':_0x39ec('0xb'),'context':_0x390fa5['context'],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':_0x39ec('0x3'),'appdata':_0x39ec('0xc'),'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':'Set','appdata':_0x39ec('0x1b'),'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':'Set','appdata':_0x39ec('0x1c')+_0x390fa5['id'],'context':_0x390fa5[_0x39ec('0x7')],'exten':_0x390fa5[_0x39ec('0x8')],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']}];if(_0x390fa5[_0x39ec('0x1d')](_0x39ec('0x1e'))&&_0x390fa5['recordingFormat']!==_0x39ec('0x1f')){_0x54996c[_0x39ec('0xa')]({'type':'outbound','app':_0x39ec('0x3'),'appdata':_0x39ec('0x20'),'context':_0x390fa5['context'],'exten':_0x390fa5['exten'],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']},{'type':_0x39ec('0xd'),'app':_0x39ec('0x3'),'appdata':_0x39ec('0x21')+_0x390fa5[_0x39ec('0x1e')]||_0x39ec('0x22'),'context':_0x390fa5['context'],'exten':_0x390fa5['exten'],'priority':_0x2ada19++,'VoiceExtensionId':_0x390fa5['id']});}return _0x54996c;}function _0x29ee7b(_0xa2da5a,_0x5e1bdd){var _0x106c49=[{'name':_0x39ec('0x23'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x39ec('0x24'),'param':0x2},{'name':_0x39ec('0x25'),'param':0x3}];var _0x42ba02={};var _0x327746=_0x5e1bdd[_0x39ec('0x26')](',');var _0x1cee91=[];for(var _0x46c859=0x0;_0x46c859<_0x106c49['length'];_0x46c859++){switch(_0x106c49[_0x46c859][_0x39ec('0x27')]){case _0x39ec('0x23'):_0x42ba02[_0x39ec('0x23')]=_0x327746[_0x106c49[_0x46c859][_0x39ec('0x28')]][_0x39ec('0x26')]('/')[0x1];_0x42ba02['phone']=_0x327746[_0x106c49[_0x46c859][_0x39ec('0x28')]][_0x39ec('0x26')]('/')[0x2];_0x42ba02[_0x39ec('0x29')]=_0x42ba02[_0x39ec('0x2a')]?_0x42ba02[_0x39ec('0x2a')][_0x39ec('0x26')]('$')[0x0]:undefined;_0x42ba02[_0x39ec('0x2a')]=_0xa2da5a['cutdigits']?(_0x42ba02['prefix']||'')+_0x39ec('0x13')+_0xa2da5a[_0x39ec('0x12')]+'}':(_0x42ba02[_0x39ec('0x29')]||'')+_0x39ec('0x14');_0x1cee91[_0x106c49[_0x46c859][_0x39ec('0x28')]]=[_0x39ec('0x2b'),_0x42ba02['trunk'],_0x42ba02[_0x39ec('0x2a')]][_0x39ec('0x2c')]('/');break;case _0x39ec('0x24'):_0x42ba02['options']=_0x327746[_0x106c49[_0x46c859][_0x39ec('0x28')]];if(_0xa2da5a['recordingFormat']!==_0x39ec('0x1f')){if(_0x42ba02['options'][_0x39ec('0x2d')]('U(xcally-mixmonitor-context)')<0x0){_0x42ba02['options']+='U(xcally-mixmonitor-context)';}}else{_0x42ba02['options']=_0x42ba02['options'][_0x39ec('0x2e')](_0x39ec('0x2f'),'');}_0x1cee91[_0x106c49[_0x46c859]['param']]=_0x42ba02['options'];break;default:_0x1cee91[_0x106c49[_0x46c859][_0x39ec('0x28')]]=_0x327746[_0x106c49[_0x46c859][_0x39ec('0x28')]];}}return _0x1cee91['join'](',');}function _0x6d216(_0x3cd953,_0x2547a1,_0x3532de){return new Promise(function(_0x10b980,_0x52176c){var _0x2f20b5=[];if(_[_0x39ec('0x30')](_0x2547a1))return _0x10b980(_0x2f20b5);_0x3295d1['Interval']['findAll']({'attributes':['id',_0x39ec('0x31'),'IntervalId'],'raw':!![]})[_0x39ec('0x32')](function(_0x25a5be){for(var _0xa820e=0x0,_0x3c4ae2=0x0;_0xa820e<_0x2547a1['length'];_0xa820e++,_0x3c4ae2=0x0){var _0x200e68=_0x2547a1[_0xa820e];var _0x51efb7=[];var _0x6b09c6=[];delete _0x200e68['id'];if(_0x200e68[_0x39ec('0x31')]!==_0x39ec('0x33')){_0x200e68['intervals']=[_0x200e68['interval']];}else{_0x200e68['intervals']=_0x200e68['IntervalId']?_[_0x39ec('0x34')](_[_0x39ec('0x35')](_0x25a5be,{'IntervalId':_0x200e68[_0x39ec('0x36')]}),_0x39ec('0x31')):[];}_0x200e68[_0x39ec('0x7')]=_0x3cd953[_0x39ec('0x7')];_0x200e68[_0x39ec('0x8')]=_0x3cd953[_0x39ec('0x8')];if(_0x200e68[_0x39ec('0x2')])_0x200e68[_0x39ec('0x2')]=_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')]();if(_0x3cd953[_0x39ec('0x2')]==='outbound'){if(_0x200e68['hasOwnProperty'](_0x39ec('0x38'))&&_0x200e68[_0x39ec('0x38')]&&_0x200e68[_0x39ec('0x38')]!=='--'){_0x51efb7['push']({'type':_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')](),'app':_0x39ec('0x3'),'appdata':_0x39ec('0x39')+_0x200e68[_0x39ec('0x38')],'context':_0x3cd953['context'],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68[_0x39ec('0x3a')][_0x39ec('0x3b')]+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});}_0x51efb7[_0x39ec('0xa')]({'type':_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')](),'app':_0x39ec('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x200e68[_0x39ec('0x3c')]?_0x39ec('0x3d')+_0x200e68[_0x39ec('0x3c')]+')':_0x39ec('0x3e')),'context':_0x3cd953[_0x39ec('0x7')],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68[_0x39ec('0x3a')][_0x39ec('0x3b')]+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});}else{if(_0x200e68['hasOwnProperty']('answer')){if([_0x39ec('0x3f'),_0x39ec('0x40')][_0x39ec('0x41')](_0x200e68[_0x39ec('0x42')][_0x39ec('0x37')]())&&_0x200e68[_0x39ec('0x43')]!==_0x39ec('0x44')){if(_0x200e68[_0x39ec('0x45')]){_0x51efb7[_0x39ec('0xa')]({'type':_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')](),'app':_0x39ec('0x16'),'appdata':_0x39ec('0x46'),'context':_0x3cd953[_0x39ec('0x7')],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68[_0x39ec('0x3a')][_0x39ec('0x3b')]+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});_0x51efb7['push']({'type':_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')](),'app':_0x39ec('0x3'),'appdata':_0x39ec('0x47'),'context':_0x3cd953[_0x39ec('0x7')],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68['intervals'][_0x39ec('0x3b')]+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});}else{_0x51efb7[_0x39ec('0xa')]({'type':_0x200e68[_0x39ec('0x2')][_0x39ec('0x37')](),'app':_0x39ec('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3cd953[_0x39ec('0x7')],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68['intervals']['length']+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});_0x51efb7[_0x39ec('0xa')]({'type':_0x200e68['type'][_0x39ec('0x37')](),'app':_0x39ec('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3cd953[_0x39ec('0x7')],'exten':_0x3cd953[_0x39ec('0x8')],'priority':_0x200e68[_0x39ec('0x3a')]['length']+_0x3532de+_0x3c4ae2++,'VoiceExtensionId':_0x3cd953['id']});}}}}for(var _0x51cac2=0x0;_0x51cac2<_0x200e68['intervals'][_0x39ec('0x3b')];_0x51cac2++){var _0x2b0e8b=_0x3532de+_0x200e68[_0x39ec('0x3a')][_0x39ec('0x3b')];var _0x5163b8=_0x51cac2===_0x200e68[_0x39ec('0x3a')][_0x39ec('0x3b')]-0x1?_0x3532de+_0x51efb7['length']+_0x6b09c6['length']+0x2:_0x3532de+_0x51cac2+0x1;_0x51efb7[_0x39ec('0x48')](_0x51cac2,0x0,{'type':_0x3cd953[_0x39ec('0x2')],'app':_0x39ec('0x49'),'appdata':_0x200e68[_0x39ec('0x3a')][_0x51cac2]+'?'+_0x3cd953[_0x39ec('0x7')]+',${EXTEN},'+_0x2b0e8b+':'+_0x3cd953[_0x39ec('0x7')]+',${EXTEN},'+_0x5163b8,'exten':_0x3cd953[_0x39ec('0x8')],'context':_0x3cd953['context'],'priority':_0x3532de+_0x51cac2,'VoiceExtensionId':_0x3cd953['id']});}if(_0x200e68[_0x39ec('0x43')]===_0x39ec('0x4a'))_0x200e68[_0x39ec('0x4b')]=_0x29ee7b(_0x3cd953,_0x200e68['appdata']);_0x200e68[_0x39ec('0x4c')]=_0x51efb7[_0x39ec('0x3b')]?_['last'](_0x51efb7)[_0x39ec('0x4c')]+0x1:_0x3532de;_0x2f20b5=_['concat'](_0x2f20b5,_0x51efb7,[_0x200e68],_0x6b09c6);_0x3532de=_[_0x39ec('0x4d')](_0x2f20b5)['priority']+0x1;}return _0x10b980(_0x2f20b5);})['catch'](function(_0x36f780){_0x52176c(_0x36f780);});});}return _0x4dfde3['define'](_0x39ec('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x213200){var _0x213b99=this[_0x39ec('0x4f')]({'plain':!![]});var _0xfab99d=_0x213b99[_0x39ec('0x2')]==='outbound'?_0x303173(_0x213b99):_0x388a9d(_0x213b99);return _0x6d216(_0x213b99,_0x213200,_[_0x39ec('0x4d')](_0xfab99d)[_0x39ec('0x4c')]+0x1)['then'](function(_0x57dbcc){var _0x38cf71=_['concat'](_0xfab99d,_0x57dbcc);_0x38cf71[_0x39ec('0xa')]({'type':_0x213b99[_0x39ec('0x2')],'app':_0x39ec('0x50'),'exten':_0x213b99[_0x39ec('0x8')],'context':_0x213b99[_0x39ec('0x7')],'priority':_[_0x39ec('0x4d')](_0x38cf71)['priority']+0x1,'VoiceExtensionId':_0x213b99['id']});return _0x38cf71;});}}});}; \ No newline at end of file +var _0x97d5=['push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','findAll','IntervalId','then','interval','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp'];(function(_0x4e672b,_0x2b4f06){var _0x39d2ef=function(_0x3813d4){while(--_0x3813d4){_0x4e672b['push'](_0x4e672b['shift']());}};_0x39d2ef(++_0x2b4f06);}(_0x97d5,0x199));var _0x597d=function(_0x4b5f75,_0x5849e4){_0x4b5f75=_0x4b5f75-0x0;var _0x46a9ae=_0x97d5[_0x4b5f75];return _0x46a9ae;};'use strict';var _=require(_0x597d('0x0'));var attributes=require(_0x597d('0x1'));module[_0x597d('0x2')]=function(_0x552974){var _0x5907c6=_0x552974[_0x597d('0x3')];function _0x484c73(_0x3324dc){var _0x2d89ef=0x2;var _0x10ecda=[{'type':_0x3324dc['type'],'app':_0x597d('0x4'),'appdata':_0x597d('0x5')+_0x3324dc[_0x597d('0x6')],'context':_0x3324dc[_0x597d('0x7')],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']},{'type':_0x3324dc[_0x597d('0x6')],'app':_0x3324dc[_0x597d('0x9')]?'Set':_0x597d('0xa'),'appdata':_0x3324dc[_0x597d('0x9')]?'CDR(routeAlias)='+_0x3324dc[_0x597d('0x9')]:'No\x20alias\x20set','context':_0x3324dc[_0x597d('0x7')],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']}];if(_0x3324dc['type']==='inbound'){_0x10ecda[_0x597d('0xb')]({'type':_0x597d('0xc'),'app':_0x597d('0x4'),'appdata':'CDR(routeid)='+_0x3324dc['id'],'context':_0x3324dc[_0x597d('0x7')],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']});}_0x10ecda[_0x597d('0xb')]({'type':_0x3324dc[_0x597d('0x6')],'app':_0x597d('0x4'),'appdata':_0x597d('0xd'),'context':_0x3324dc[_0x597d('0x7')],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']},{'type':_0x3324dc[_0x597d('0x6')],'app':_0x597d('0x4'),'appdata':_0x597d('0xe'),'context':_0x3324dc[_0x597d('0x7')],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']},{'type':_0x3324dc[_0x597d('0x6')],'app':'Set','appdata':_0x597d('0xf'),'context':_0x3324dc['context'],'exten':_0x3324dc[_0x597d('0x8')],'priority':_0x2d89ef++,'VoiceExtensionId':_0x3324dc['id']});return _0x10ecda;}function _0x18f646(_0x50d7af){var _0x38844b=0x2;var _0x52c211=[{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':'CDR(type)=outbound','context':_0x50d7af['context'],'exten':_0x50d7af['exten'],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x50d7af[_0x597d('0x9')]?_0x597d('0x4'):_0x597d('0xa'),'appdata':_0x50d7af[_0x597d('0x9')]?_0x597d('0x11')+_0x50d7af[_0x597d('0x9')]:_0x597d('0x12'),'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':'outbound','app':_0x597d('0x4'),'appdata':_0x597d('0x13')+(_0x50d7af[_0x597d('0x14')]?_0x597d('0x15')+_0x50d7af[_0x597d('0x14')]+'}':_0x597d('0x16')),'context':_0x50d7af['context'],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':_0x597d('0x17')+_0x50d7af['id'],'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af['exten'],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x18'),'appdata':_0x597d('0x19')+(_0x38844b+0x2)+'):Goto('+(_0x38844b+0x1)+')','context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':_0x50d7af[_0x597d('0x14')]?_0x597d('0x1a')+_0x50d7af[_0x597d('0x14')]+'}':_0x597d('0x1b'),'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':_0x597d('0xd'),'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':'outbound','app':'Set','appdata':_0x597d('0xf'),'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af['exten'],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':_0x597d('0x1c')+_0x50d7af['id'],'context':_0x50d7af['context'],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']}];if(_0x50d7af['hasOwnProperty'](_0x597d('0x1d'))&&_0x50d7af['recordingFormat']!=='none'){_0x52c211['push']({'type':'outbound','app':'Set','appdata':_0x597d('0x1e'),'context':_0x50d7af[_0x597d('0x7')],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']},{'type':_0x597d('0x10'),'app':_0x597d('0x4'),'appdata':_0x597d('0x1f')+_0x50d7af[_0x597d('0x1d')]||_0x597d('0x20'),'context':_0x50d7af['context'],'exten':_0x50d7af[_0x597d('0x8')],'priority':_0x38844b++,'VoiceExtensionId':_0x50d7af['id']});}return _0x52c211;}function _0x1ea943(_0x1df4bf,_0x2d56a1){var _0x581541=[{'name':_0x597d('0x21'),'param':0x0},{'name':_0x597d('0x22'),'param':0x1},{'name':_0x597d('0x23'),'param':0x2},{'name':_0x597d('0x24'),'param':0x3}];var _0x1ce9e6={};var _0x474966=_0x2d56a1[_0x597d('0x25')](',');var _0x1cf849=[];for(var _0x193381=0x0;_0x193381<_0x581541[_0x597d('0x26')];_0x193381++){switch(_0x581541[_0x193381][_0x597d('0x27')]){case _0x597d('0x21'):_0x1ce9e6[_0x597d('0x21')]=_0x474966[_0x581541[_0x193381][_0x597d('0x28')]][_0x597d('0x25')]('/')[0x1];_0x1ce9e6[_0x597d('0x29')]=_0x474966[_0x581541[_0x193381][_0x597d('0x28')]][_0x597d('0x25')]('/')[0x2];_0x1ce9e6[_0x597d('0x2a')]=_0x1ce9e6[_0x597d('0x29')]?_0x1ce9e6['phone']['split']('$')[0x0]:undefined;_0x1ce9e6[_0x597d('0x29')]=_0x1df4bf['cutdigits']?(_0x1ce9e6[_0x597d('0x2a')]||'')+_0x597d('0x15')+_0x1df4bf['cutdigits']+'}':(_0x1ce9e6['prefix']||'')+_0x597d('0x16');_0x1cf849[_0x581541[_0x193381]['param']]=[_0x597d('0x2b'),_0x1ce9e6[_0x597d('0x21')],_0x1ce9e6[_0x597d('0x29')]][_0x597d('0x2c')]('/');break;case'options':_0x1ce9e6[_0x597d('0x23')]=_0x474966[_0x581541[_0x193381][_0x597d('0x28')]];if(_0x1df4bf[_0x597d('0x1d')]!==_0x597d('0x2d')){if(_0x1ce9e6[_0x597d('0x23')][_0x597d('0x2e')](_0x597d('0x2f'))<0x0){_0x1ce9e6['options']+=_0x597d('0x2f');}}else{_0x1ce9e6[_0x597d('0x23')]=_0x1ce9e6['options'][_0x597d('0x30')](_0x597d('0x2f'),'');}_0x1cf849[_0x581541[_0x193381][_0x597d('0x28')]]=_0x1ce9e6[_0x597d('0x23')];break;default:_0x1cf849[_0x581541[_0x193381][_0x597d('0x28')]]=_0x474966[_0x581541[_0x193381][_0x597d('0x28')]];}}return _0x1cf849[_0x597d('0x2c')](',');}function _0x1cf87e(_0x38091a,_0x720418,_0x22d5b9){return new Promise(function(_0x106c58,_0x1886db){var _0xf0afee=[];if(_['isEmpty'](_0x720418))return _0x106c58(_0xf0afee);_0x5907c6['Interval'][_0x597d('0x31')]({'attributes':['id','interval',_0x597d('0x32')],'raw':!![]})[_0x597d('0x33')](function(_0x248359){for(var _0x45f91b=0x0,_0x1b92bf=0x0;_0x45f91b<_0x720418[_0x597d('0x26')];_0x45f91b++,_0x1b92bf=0x0){var _0x526ca1=_0x720418[_0x45f91b];var _0x221cb6=[];var _0x4d77f8=[];delete _0x526ca1['id'];if(_0x526ca1[_0x597d('0x34')]!==_0x597d('0x35')){_0x526ca1['intervals']=[_0x526ca1['interval']];}else{_0x526ca1[_0x597d('0x36')]=_0x526ca1[_0x597d('0x32')]?_['map'](_[_0x597d('0x37')](_0x248359,{'IntervalId':_0x526ca1[_0x597d('0x32')]}),_0x597d('0x34')):[];}_0x526ca1['context']=_0x38091a[_0x597d('0x7')];_0x526ca1[_0x597d('0x8')]=_0x38091a[_0x597d('0x8')];if(_0x526ca1[_0x597d('0x6')])_0x526ca1[_0x597d('0x6')]=_0x526ca1['type'][_0x597d('0x38')]();if(_0x38091a[_0x597d('0x6')]===_0x597d('0x10')){if(_0x526ca1[_0x597d('0x39')](_0x597d('0x3a'))&&_0x526ca1[_0x597d('0x3a')]&&_0x526ca1['tag']!=='--'){_0x221cb6[_0x597d('0xb')]({'type':_0x526ca1[_0x597d('0x6')][_0x597d('0x38')](),'app':_0x597d('0x4'),'appdata':'CDR(tag)='+_0x526ca1[_0x597d('0x3a')],'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a[_0x597d('0x8')],'priority':_0x526ca1[_0x597d('0x36')][_0x597d('0x26')]+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});}_0x221cb6[_0x597d('0xb')]({'type':_0x526ca1['type'][_0x597d('0x38')](),'app':_0x597d('0x18'),'appdata':_0x597d('0x3b')+(_0x526ca1[_0x597d('0x3c')]?_0x597d('0x3d')+_0x526ca1[_0x597d('0x3c')]+')':_0x597d('0x3e')),'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a[_0x597d('0x8')],'priority':_0x526ca1['intervals'][_0x597d('0x26')]+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});}else{if(_0x526ca1[_0x597d('0x39')](_0x597d('0x3f'))){if(['queue','playback'][_0x597d('0x40')](_0x526ca1['app'][_0x597d('0x38')]())&&_0x526ca1[_0x597d('0x41')]!==_0x597d('0x42')){if(_0x526ca1['answer']){_0x221cb6[_0x597d('0xb')]({'type':_0x526ca1['type'][_0x597d('0x38')](),'app':_0x597d('0x18'),'appdata':_0x597d('0x43'),'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a[_0x597d('0x8')],'priority':_0x526ca1['intervals'][_0x597d('0x26')]+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});_0x221cb6['push']({'type':_0x526ca1[_0x597d('0x6')]['toLowerCase'](),'app':_0x597d('0x4'),'appdata':_0x597d('0x44'),'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a['exten'],'priority':_0x526ca1[_0x597d('0x36')][_0x597d('0x26')]+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});}else{_0x221cb6[_0x597d('0xb')]({'type':_0x526ca1['type'][_0x597d('0x38')](),'app':_0x597d('0x18'),'appdata':_0x597d('0x45'),'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a[_0x597d('0x8')],'priority':_0x526ca1['intervals']['length']+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});_0x221cb6[_0x597d('0xb')]({'type':_0x526ca1[_0x597d('0x6')]['toLowerCase'](),'app':_0x597d('0x4'),'appdata':_0x597d('0x46'),'context':_0x38091a[_0x597d('0x7')],'exten':_0x38091a[_0x597d('0x8')],'priority':_0x526ca1[_0x597d('0x36')][_0x597d('0x26')]+_0x22d5b9+_0x1b92bf++,'VoiceExtensionId':_0x38091a['id']});}}}}for(var _0x283612=0x0;_0x283612<_0x526ca1[_0x597d('0x36')][_0x597d('0x26')];_0x283612++){var _0x4d5cf7=_0x22d5b9+_0x526ca1[_0x597d('0x36')][_0x597d('0x26')];var _0x18dc63=_0x283612===_0x526ca1['intervals'][_0x597d('0x26')]-0x1?_0x22d5b9+_0x221cb6[_0x597d('0x26')]+_0x4d77f8['length']+0x2:_0x22d5b9+_0x283612+0x1;_0x221cb6[_0x597d('0x47')](_0x283612,0x0,{'type':_0x38091a['type'],'app':_0x597d('0x48'),'appdata':_0x526ca1[_0x597d('0x36')][_0x283612]+'?'+_0x38091a[_0x597d('0x7')]+_0x597d('0x49')+_0x4d5cf7+':'+_0x38091a[_0x597d('0x7')]+_0x597d('0x49')+_0x18dc63,'exten':_0x38091a[_0x597d('0x8')],'context':_0x38091a[_0x597d('0x7')],'priority':_0x22d5b9+_0x283612,'VoiceExtensionId':_0x38091a['id']});}if(_0x526ca1[_0x597d('0x41')]===_0x597d('0x4a'))_0x526ca1[_0x597d('0x4b')]=_0x1ea943(_0x38091a,_0x526ca1[_0x597d('0x4b')]);_0x526ca1[_0x597d('0x4c')]=_0x221cb6[_0x597d('0x26')]?_[_0x597d('0x4d')](_0x221cb6)['priority']+0x1:_0x22d5b9;_0xf0afee=_['concat'](_0xf0afee,_0x221cb6,[_0x526ca1],_0x4d77f8);_0x22d5b9=_['last'](_0xf0afee)[_0x597d('0x4c')]+0x1;}return _0x106c58(_0xf0afee);})[_0x597d('0x4e')](function(_0x4a2f4d){_0x1886db(_0x4a2f4d);});});}return _0x552974[_0x597d('0x4f')]('VoiceExtension',attributes,{'tableName':_0x597d('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x285e8c){var _0x3fad43=this[_0x597d('0x51')]({'plain':!![]});var _0x5bffb2=_0x3fad43[_0x597d('0x6')]==='outbound'?_0x18f646(_0x3fad43):_0x484c73(_0x3fad43);return _0x1cf87e(_0x3fad43,_0x285e8c,_['last'](_0x5bffb2)[_0x597d('0x4c')]+0x1)[_0x597d('0x33')](function(_0x1b9818){var _0x3fce3c=_[_0x597d('0x52')](_0x5bffb2,_0x1b9818);_0x3fce3c[_0x597d('0xb')]({'type':_0x3fad43[_0x597d('0x6')],'app':_0x597d('0x53'),'exten':_0x3fad43['exten'],'context':_0x3fad43[_0x597d('0x7')],'priority':_[_0x597d('0x4d')](_0x3fce3c)['priority']+0x1,'VoiceExtensionId':_0x3fad43['id']});return _0x3fce3c;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ce3a6b6..329ecb1 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 _0xab86=['attributes','limit','include','map','model','stringify','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where'];(function(_0x26f7b7,_0x20fe0b){var _0x81adc3=function(_0x2f72f6){while(--_0x2f72f6){_0x26f7b7['push'](_0x26f7b7['shift']());}};_0x81adc3(++_0x20fe0b);}(_0xab86,0x13e));var _0x6ab8=function(_0x504846,_0x5c8a21){_0x504846=_0x504846-0x0;var _0x183e51=_0xab86[_0x504846];return _0x183e51;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var moment=require(_0x6ab8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ab8('0x4'));var logger=require('../../config/logger')(_0x6ab8('0x5'));var config=require(_0x6ab8('0x6'));var jayson=require(_0x6ab8('0x7'));var client=jayson[_0x6ab8('0x8')][_0x6ab8('0x9')]({'port':0x232a});config[_0x6ab8('0xa')]=_[_0x6ab8('0xb')](config[_0x6ab8('0xa')],{'host':_0x6ab8('0xc'),'port':0x18eb});var socket=require(_0x6ab8('0xd'))(new Redis(config[_0x6ab8('0xa')]));require(_0x6ab8('0xe'))[_0x6ab8('0xf')](socket);function respondWithRpcPromise(_0x5127eb,_0x5ea6e6,_0x383594){return new BPromise(function(_0x5b7732,_0x18d3a3){return client[_0x6ab8('0x10')](_0x5127eb,_0x383594)[_0x6ab8('0x11')](function(_0x52d636){logger[_0x6ab8('0x12')](_0x6ab8('0x13'),_0x5ea6e6,'request\x20sent');logger[_0x6ab8('0x14')](_0x6ab8('0x15'),_0x5ea6e6,_0x6ab8('0x16'),JSON['stringify'](_0x52d636));if(_0x52d636[_0x6ab8('0x17')]){if(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x18')]===0x1f4){logger[_0x6ab8('0x17')](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x18d3a3(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);}logger['error'](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x5b7732(_0x52d636['error'][_0x6ab8('0x19')]);}else{logger[_0x6ab8('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,'request\x20sent');_0x5b7732(_0x52d636[_0x6ab8('0x1a')]['message']);}})[_0x6ab8('0x1b')](function(_0x292b36){logger[_0x6ab8('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,_0x292b36);_0x18d3a3(_0x292b36);});});}exports[_0x6ab8('0x1c')]=function(_0x3de5b3){var _0x2d2a80=this;return new Promise(function(_0x312183,_0x5227c6){return db[_0x6ab8('0x1d')][_0x6ab8('0x1e')]({'raw':_0x3de5b3['options']?_0x3de5b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x20')]||null:null,'attributes':_0x3de5b3['options']?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x21')]||null:null,'limit':_0x3de5b3['options']?_0x3de5b3['options'][_0x6ab8('0x22')]||null:null,'include':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3['options'][_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x23')],function(_0x3ddaeb){return{'model':db[_0x3ddaeb[_0x6ab8('0x25')]],'as':_0x3ddaeb['as'],'attributes':_0x3ddaeb[_0x6ab8('0x21')],'include':_0x3ddaeb[_0x6ab8('0x23')]?_['map'](_0x3ddaeb['include'],function(_0x334e21){return{'model':db[_0x334e21['model']],'as':_0x334e21['as'],'attributes':_0x334e21[_0x6ab8('0x21')],'include':_0x334e21[_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x334e21['include'],function(_0x525687){return{'model':db[_0x525687['model']],'as':_0x525687['as'],'attributes':_0x525687[_0x6ab8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6ab8('0x11')](function(_0x3723a7){logger[_0x6ab8('0x12')](_0x6ab8('0x1c'),_0x3de5b3);logger[_0x6ab8('0x14')](_0x6ab8('0x1c'),_0x3de5b3,JSON[_0x6ab8('0x26')](_0x3723a7));_0x312183(_0x3723a7);})[_0x6ab8('0x1b')](function(_0x1f6dbc){logger[_0x6ab8('0x17')](_0x6ab8('0x1c'),_0x1f6dbc[_0x6ab8('0x19')],_0x3de5b3);_0x5227c6(_0x2d2a80['error'](0x1f4,_0x1f6dbc['message']));});});}; \ No newline at end of file +var _0xb2f1=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','attributes'];(function(_0x389d9a,_0x2bb263){var _0x36f558=function(_0x2557b6){while(--_0x2557b6){_0x389d9a['push'](_0x389d9a['shift']());}};_0x36f558(++_0x2bb263);}(_0xb2f1,0xee));var _0x1b2f=function(_0x2de4a4,_0x238dc7){_0x2de4a4=_0x2de4a4-0x0;var _0x5db5f4=_0xb2f1[_0x2de4a4];return _0x5db5f4;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require('moment');var BPromise=require(_0x1b2f('0x2'));var rs=require(_0x1b2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x4'))['db'];var utils=require(_0x1b2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b2f('0x6'));var jayson=require(_0x1b2f('0x7'));var client=jayson[_0x1b2f('0x8')][_0x1b2f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1b2f('0xa')],{'host':_0x1b2f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b2f('0xa')]));require(_0x1b2f('0xc'))['register'](socket);function respondWithRpcPromise(_0x1a2aab,_0x2f3963,_0x402620){return new BPromise(function(_0x26842c,_0xe9ab8f){return client[_0x1b2f('0xd')](_0x1a2aab,_0x402620)[_0x1b2f('0xe')](function(_0x5cf8b8){logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x2f3963,_0x1b2f('0x11'));logger['debug'](_0x1b2f('0x12'),_0x2f3963,'request\x20sent',JSON[_0x1b2f('0x13')](_0x5cf8b8));if(_0x5cf8b8[_0x1b2f('0x14')]){if(_0x5cf8b8[_0x1b2f('0x14')][_0x1b2f('0x15')]===0x1f4){logger[_0x1b2f('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x2f3963,_0x5cf8b8[_0x1b2f('0x14')][_0x1b2f('0x16')]);return _0xe9ab8f(_0x5cf8b8[_0x1b2f('0x14')][_0x1b2f('0x16')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2f3963,_0x5cf8b8[_0x1b2f('0x14')]['message']);return _0x26842c(_0x5cf8b8['error']['message']);}else{logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x2f3963,'request\x20sent');_0x26842c(_0x5cf8b8['result'][_0x1b2f('0x16')]);}})[_0x1b2f('0x17')](function(_0xc2aa72){logger['error'](_0x1b2f('0x10'),_0x2f3963,_0xc2aa72);_0xe9ab8f(_0xc2aa72);});});}exports[_0x1b2f('0x18')]=function(_0x1623c8){var _0x3b8da6=this;return new Promise(function(_0x421919,_0xc79653){return db[_0x1b2f('0x19')][_0x1b2f('0x1a')]({'raw':_0x1623c8[_0x1b2f('0x1b')]?_0x1623c8['options'][_0x1b2f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1623c8['options']?_0x1623c8[_0x1b2f('0x1b')][_0x1b2f('0x1d')]||null:null,'attributes':_0x1623c8[_0x1b2f('0x1b')]?_0x1623c8[_0x1b2f('0x1b')]['attributes']||null:null,'limit':_0x1623c8[_0x1b2f('0x1b')]?_0x1623c8[_0x1b2f('0x1b')][_0x1b2f('0x1e')]||null:null,'include':_0x1623c8[_0x1b2f('0x1b')]?_0x1623c8['options'][_0x1b2f('0x1f')]?_[_0x1b2f('0x20')](_0x1623c8['options'][_0x1b2f('0x1f')],function(_0x4da5b0){return{'model':db[_0x4da5b0['model']],'as':_0x4da5b0['as'],'attributes':_0x4da5b0[_0x1b2f('0x21')],'include':_0x4da5b0[_0x1b2f('0x1f')]?_[_0x1b2f('0x20')](_0x4da5b0[_0x1b2f('0x1f')],function(_0x31b952){return{'model':db[_0x31b952['model']],'as':_0x31b952['as'],'attributes':_0x31b952[_0x1b2f('0x21')],'include':_0x31b952[_0x1b2f('0x1f')]?_[_0x1b2f('0x20')](_0x31b952[_0x1b2f('0x1f')],function(_0x54fb5e){return{'model':db[_0x54fb5e['model']],'as':_0x54fb5e['as'],'attributes':_0x54fb5e[_0x1b2f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b2f('0xe')](function(_0x2eaf02){logger[_0x1b2f('0xf')](_0x1b2f('0x18'),_0x1623c8);logger['debug']('GetVoiceExtension',_0x1623c8,JSON[_0x1b2f('0x13')](_0x2eaf02));_0x421919(_0x2eaf02);})[_0x1b2f('0x17')](function(_0x5d9d94){logger[_0x1b2f('0x14')](_0x1b2f('0x18'),_0x5d9d94[_0x1b2f('0x16')],_0x1623c8);_0xc79653(_0x3b8da6[_0x1b2f('0x14')](0x1f4,_0x5d9d94[_0x1b2f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 34ef1b7..3645b9b 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 _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x1b13d5,_0x167bb7){var _0x4261e4=function(_0xd1158a){while(--_0xd1158a){_0x1b13d5['push'](_0x1b13d5['shift']());}};_0x4261e4(++_0x167bb7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x7fbe[_0x25efdf];return _0x22c495;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x1dc7e5,_0x2054ae){var _0xa03cac=function(_0x428852){while(--_0x428852){_0x1dc7e5['push'](_0x1dc7e5['shift']());}};_0xa03cac(++_0x2054ae);}(_0xe14b,0x93));var _0xbe14=function(_0xa04f7,_0x192832){_0xa04f7=_0xa04f7-0x0;var _0x9f84c9=_0xe14b[_0xa04f7];return _0x9f84c9;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index e17ef75..cc1fd66 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 _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x6d11,0xbf));var _0x16d1=function(_0x35f45c,_0xf5d860){_0x35f45c=_0x35f45c-0x0;var _0x562ecd=_0x6d11[_0x35f45c];return _0x562ecd;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1623=['/:id','show','get','/:id/messages','getMessages','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','isAuthenticated','index'];(function(_0x51516b,_0x5194c2){var _0x450902=function(_0x3b98a5){while(--_0x3b98a5){_0x51516b['push'](_0x51516b['shift']());}};_0x450902(++_0x5194c2);}(_0x1623,0xab));var _0x3162=function(_0x4ec9be,_0x579731){_0x4ec9be=_0x4ec9be-0x0;var _0x48e96b=_0x1623[_0x4ec9be];return _0x48e96b;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0xf')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0x11')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);module[_0x3162('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 60109e3..5b49252 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 _0x2251=['TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x25eab8,_0x5b293c){var _0x189886=function(_0x79ba04){while(--_0x79ba04){_0x25eab8['push'](_0x25eab8['shift']());}};_0x189886(++_0x5b293c);}(_0x2251,0x6b));var _0x1225=function(_0x25b5af,_0x233898){_0x25b5af=_0x25b5af-0x0;var _0x302d3c=_0x2251[_0x25b5af];return _0x302d3c;};'use strict';var Sequelize=require('sequelize');module[_0x1225('0x0')]={'customer_id':{'type':Sequelize[_0x1225('0x1')]},'context':{'type':Sequelize[_0x1225('0x1')],'defaultValue':_0x1225('0x2'),'unique':_0x1225('0x3')},'mailbox':{'type':Sequelize[_0x1225('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x1225('0x1')]},'fullname':{'type':Sequelize[_0x1225('0x1')]},'email':{'type':Sequelize[_0x1225('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5ebaf9){this[_0x1225('0x4')](_0x1225('0x5'),typeof _0x5ebaf9===_0x1225('0x6')&&_0x5ebaf9[_0x1225('0x7')]()?_0x5ebaf9['trim']():null);}},'pager':{'type':Sequelize[_0x1225('0x1')]},'tz':{'type':Sequelize[_0x1225('0x1')],'defaultValue':_0x1225('0x8')},'attach':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':_0x1225('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':_0x1225('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1225('0x1')]},'callback':{'type':Sequelize[_0x1225('0x1')]},'review':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1225('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':_0x1225('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1225('0x9')](_0x1225('0xa'),'no'),'defaultValue':_0x1225('0xa'),'allowNull':![]},'stamp':{'type':_0x1225('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x1225('0x1')]},'maxsecs':{'type':Sequelize[_0x1225('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1225('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1225('0xe')]('fullname')+_0x1225('0xf')+this[_0x1225('0xe')](_0x1225('0x10'));}}}; \ No newline at end of file +var _0x6ff1=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','central','yes','ENUM'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x6ff1,0xc2));var _0x16ff=function(_0x5aa0cb,_0x28d154){_0x5aa0cb=_0x5aa0cb-0x0;var _0x10cded=_0x6ff1[_0x5aa0cb];return _0x10cded;};'use strict';var Sequelize=require(_0x16ff('0x0'));module[_0x16ff('0x1')]={'customer_id':{'type':Sequelize[_0x16ff('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x16ff('0x3'),'unique':_0x16ff('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x16ff('0x4')},'password':{'type':Sequelize[_0x16ff('0x2')]},'fullname':{'type':Sequelize[_0x16ff('0x2')]},'email':{'type':Sequelize[_0x16ff('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2bb382){this[_0x16ff('0x5')](_0x16ff('0x6'),typeof _0x2bb382==='string'&&_0x2bb382['trim']()?_0x2bb382['trim']():null);}},'pager':{'type':Sequelize[_0x16ff('0x2')]},'tz':{'type':Sequelize[_0x16ff('0x2')],'defaultValue':_0x16ff('0x7')},'attach':{'type':Sequelize['ENUM'](_0x16ff('0x8'),'no'),'defaultValue':_0x16ff('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x16ff('0x9')](_0x16ff('0x8'),'no'),'defaultValue':_0x16ff('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x16ff('0x2')]},'callback':{'type':Sequelize[_0x16ff('0x2')]},'review':{'type':Sequelize['ENUM'](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x16ff('0x9')](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x16ff('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x16ff('0x9')](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x16ff('0x9')](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x16ff('0x9')]('yes','no'),'defaultValue':_0x16ff('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x16ff('0x9')](_0x16ff('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x16ff('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x16ff('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x16ff('0xa')},'emailsubject':{'type':Sequelize[_0x16ff('0x2')]},'emailbody':{'type':Sequelize[_0x16ff('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x16ff('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x16ff('0xc')],'get':function(){return this[_0x16ff('0xd')](_0x16ff('0xe'))+_0x16ff('0xf')+this['getDataValue'](_0x16ff('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d31196a..1903781 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(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0xb574,0x106));var _0x4b57=function(_0xf1b312,_0x17fb97){_0xf1b312=_0xf1b312-0x0;var _0xba79d3=_0xb574[_0xf1b312];return _0xba79d3;};'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 _0xd8b0=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','findOne','VoiceMailMessage','rawAttributes','nolimit','order','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','Voicemails','error','name','index','VoiceMail','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options'];(function(_0x4ff471,_0x32968e){var _0x4132df=function(_0x4143ac){while(--_0x4143ac){_0x4ff471['push'](_0x4ff471['shift']());}};_0x4132df(++_0x32968e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x26');return db['UserProfileResource'][_0x0d8b('0x25')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)[_0x0d8b('0x1a')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x18')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x27')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x28')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x19')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x29')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=_['map'](db[_0x0d8b('0x2a')]['rawAttributes'],function(_0x3cdf3c){return{'name':_0x3cdf3c['fieldName'],'type':_0x3cdf3c['type'][_0x0d8b('0x2b')]};});_0x2c058d[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0x4c80a2,_0x0d8b('0x28'));_0x2c058d[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x544735[_0x0d8b('0x2e')]);_0x2c058d[_0x0d8b('0x30')]=_['intersection'](_0x2c058d[_0x0d8b('0x2c')],_0x2c058d[_0x0d8b('0x2e')]);_0x106e4c['attributes']=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x2c')],qs[_0x0d8b('0x32')](_0x544735['query'][_0x0d8b('0x32')]));_0x106e4c[_0x0d8b('0x33')]=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x34')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x35')]('nolimit')){_0x106e4c[_0x0d8b('0x36')]=qs[_0x0d8b('0x36')](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x106e4c[_0x0d8b('0x1c')]=qs['offset'](_0x544735['query'][_0x0d8b('0x1c')]);}_0x106e4c['order']=qs['sort'](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x30')](_[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2e')],_0x2c058d['filters']),_0x4c80a2);if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x106e4c[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x4c80a2,function(_0xf1680e){if(_0xf1680e['type']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0xf1680e[_0x0d8b('0x28')]]={'$like':'%'+_0x544735[_0x0d8b('0x2e')]['filter']+'%'};return _0x34acb5;}})});}_0x106e4c=_[_0x0d8b('0x3b')]({},_0x106e4c,_0x544735['options']);var _0x37b26c={'where':_0x106e4c[_0x0d8b('0x38')]};return db[_0x0d8b('0x2a')][_0x0d8b('0x1e')](_0x37b26c)[_0x0d8b('0x24')](function(_0x3e632e){_0x56120a[_0x0d8b('0x1e')]=_0x3e632e;if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x106e4c[_0x0d8b('0x3e')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x106e4c);})['then'](function(_0x4d0811){_0x56120a['rows']=_0x4d0811;return _0x56120a;})[_0x0d8b('0x24')](respondWithFilteredResult(_0x3c8887,_0x106e4c))[_0x0d8b('0x3f')](handleError(_0x3c8887,null));};exports[_0x0d8b('0x40')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x41')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x2f')](db[_0x0d8b('0x2a')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x2f')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x30')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x2e')]);_0x1b216d[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x32')]));_0x1b216d[_0x0d8b('0x33')]=_0x1b216d[_0x0d8b('0x33')]['length']?_0x1b216d[_0x0d8b('0x33')]:_0x192de1[_0x0d8b('0x2c')];if(_0x5100cf[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x1b216d[_0x0d8b('0x3e')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x3b')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x42')]);return db[_0x0d8b('0x2a')][_0x0d8b('0x43')](_0x1b216d)[_0x0d8b('0x24')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x24')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x3f')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x2a')][_0x0d8b('0x44')](_0x3e569b[_0x0d8b('0x45')],{})[_0x0d8b('0x24')](function(_0x574b90){var _0x371fa0=_0x3e569b['user']['get']({'plain':!![]});if(!_0x371fa0)throw new Error(_0x0d8b('0x46'));if(_0x371fa0[_0x0d8b('0x47')]===_0x0d8b('0x48')){var _0x4396b5=_0x574b90['get']({'plain':!![]});var _0x131579=_0x0d8b('0x26');return db[_0x0d8b('0x49')][_0x0d8b('0x43')]({'where':{'name':_0x131579,'userProfileId':_0x371fa0[_0x0d8b('0x4a')]},'raw':!![]})['then'](function(_0x5c0824){if(_0x5c0824&&_0x5c0824['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d8b('0x44')]({'name':_0x4396b5[_0x0d8b('0x28')],'resourceId':_0x4396b5['id'],'type':_0x5c0824['name'],'sectionId':_0x5c0824['id']},{})['then'](function(){return _0x574b90;});}else{return _0x574b90;}})[_0x0d8b('0x3f')](function(_0x3d3cb6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3cb6);throw _0x3d3cb6;});}return _0x574b90;})[_0x0d8b('0x24')](respondWithResult(_0x570af8,0xc9))[_0x0d8b('0x3f')](handleError(_0x570af8,null));};exports[_0x0d8b('0x23')]=function(_0x346c0d,_0x2d5519){if(_0x346c0d['body']['id']){delete _0x346c0d[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x2a')]['find']({'where':{'id':_0x346c0d['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x2d5519,null))[_0x0d8b('0x24')](saveUpdates(_0x346c0d['body'],null))['then'](respondWithResult(_0x2d5519,null))[_0x0d8b('0x3f')](handleError(_0x2d5519,null));};exports[_0x0d8b('0x25')]=function(_0x377027,_0xb58818){return db['VoiceMail'][_0x0d8b('0x43')]({'where':{'id':_0x377027['params']['id']}})['then'](handleEntityNotFound(_0xb58818,null))[_0x0d8b('0x24')](removeEntity(_0xb58818,null))[_0x0d8b('0x3f')](handleError(_0xb58818,null));};exports['getMessages']=function(_0x4a8f33,_0x44ed23,_0x3d7161){return db[_0x0d8b('0x2a')][_0x0d8b('0x4b')]({'where':{'id':_0x4a8f33[_0x0d8b('0x41')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x44ed23,null))[_0x0d8b('0x24')](function(_0x3bead7){var _0x5418d8;var _0x24a859={},_0x37dc9f={};_0x37dc9f[_0x0d8b('0x2c')]=_[_0x0d8b('0x2f')](db[_0x0d8b('0x4c')][_0x0d8b('0x4d')]);_0x37dc9f[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x4a8f33[_0x0d8b('0x2e')]);_0x37dc9f['filters']=_[_0x0d8b('0x31')](_0x37dc9f[_0x0d8b('0x2c')],_0x37dc9f[_0x0d8b('0x2e')]);_0x24a859[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x37dc9f['model'],qs[_0x0d8b('0x32')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x32')]));_0x24a859[_0x0d8b('0x33')]=_0x24a859[_0x0d8b('0x33')]['length']?_0x24a859['attributes']:_0x37dc9f[_0x0d8b('0x2c')];if(!_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x35')](_0x0d8b('0x4e'))){_0x24a859['limit']=qs[_0x0d8b('0x36')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x24a859['offset']=qs[_0x0d8b('0x1c')](_0x4a8f33['query'][_0x0d8b('0x1c')]);}_0x24a859[_0x0d8b('0x4f')]=qs[_0x0d8b('0x37')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x24a859[_0x0d8b('0x38')]=qs['filters'](_[_0x0d8b('0x39')](_0x4a8f33['query'],_0x37dc9f[_0x0d8b('0x30')]));if(_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x24a859[_0x0d8b('0x38')]=_['merge'](_0x24a859[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x24a859[_0x0d8b('0x33')],function(_0x2332fc){var _0x2ccdae={};_0x2ccdae[_0x2332fc]={'$like':'%'+_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]+'%'};return _0x2ccdae;})});}_0x24a859[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x24a859[_0x0d8b('0x38')],{'mailboxuser':_0x3bead7['mailbox']});_0x24a859=_['merge']({},_0x24a859,_0x4a8f33[_0x0d8b('0x42')]);return db[_0x0d8b('0x4c')]['findAndCountAll'](_0x24a859)[_0x0d8b('0x24')](respondWithFilteredResult(_0x44ed23,_0x24a859));})['catch'](handleError(_0x44ed23,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ff1b9fc..c660246 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 _0x2a3c=['moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api'];(function(_0x2e0d00,_0x44b921){var _0x3d1f05=function(_0x35a0e5){while(--_0x35a0e5){_0x2e0d00['push'](_0x2e0d00['shift']());}};_0x3d1f05(++_0x44b921);}(_0x2a3c,0x122));var _0xc2a3=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x2a3c[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xc2a3('0x0'));var util=require(_0xc2a3('0x1'));var logger=require(_0xc2a3('0x2'))(_0xc2a3('0x3'));var moment=require(_0xc2a3('0x4'));var BPromise=require(_0xc2a3('0x5'));var rp=require(_0xc2a3('0x6'));var fs=require('fs');var path=require(_0xc2a3('0x7'));var rimraf=require('rimraf');var config=require(_0xc2a3('0x8'));var attributes=require(_0xc2a3('0x9'));module['exports']=function(_0x256722,_0x5bc130){return _0x256722['define']('VoiceMail',attributes,{'tableName':_0xc2a3('0xa'),'paranoid':![],'indexes':[{'name':_0xc2a3('0xb'),'fields':[_0xc2a3('0xc'),_0xc2a3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7650=['mailbox_context','mailbox','context','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail'];(function(_0x2e93d0,_0x5d6526){var _0x2a88a6=function(_0x9bcb0f){while(--_0x9bcb0f){_0x2e93d0['push'](_0x2e93d0['shift']());}};_0x2a88a6(++_0x5d6526);}(_0x7650,0x9f));var _0x0765=function(_0x33025b,_0x196851){_0x33025b=_0x33025b-0x0;var _0x3d549a=_0x7650[_0x33025b];return _0x3d549a;};'use strict';var _=require('lodash');var util=require(_0x0765('0x0'));var logger=require(_0x0765('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0765('0x2'));var rp=require(_0x0765('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0765('0x4'));var config=require(_0x0765('0x5'));var attributes=require(_0x0765('0x6'));module[_0x0765('0x7')]=function(_0x9f226d,_0x237b3e){return _0x9f226d['define'](_0x0765('0x8'),attributes,{'tableName':_0x0765('0x9'),'paranoid':![],'indexes':[{'name':_0x0765('0xa'),'fields':[_0x0765('0xb'),_0x0765('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 718643a..b28405b 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 _0x3887=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x436e53,_0x480991){var _0xe867c7=function(_0x4a4ed8){while(--_0x4a4ed8){_0x436e53['push'](_0x436e53['shift']());}};_0xe867c7(++_0x480991);}(_0x3887,0xdd));var _0x7388=function(_0x264b79,_0xc62859){_0x264b79=_0x264b79-0x0;var _0x548c85=_0x3887[_0x264b79];return _0x548c85;};'use strict';var _=require(_0x7388('0x0'));var util=require(_0x7388('0x1'));var moment=require(_0x7388('0x2'));var BPromise=require(_0x7388('0x3'));var rs=require(_0x7388('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7388('0x5'));var logger=require(_0x7388('0x6'))(_0x7388('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7388('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3af3c1,_0x55e0c4,_0x2dae67){return new BPromise(function(_0x195e4,_0x305c85){return client[_0x7388('0x9')](_0x3af3c1,_0x2dae67)[_0x7388('0xa')](function(_0x6b6c20){logger[_0x7388('0xb')](_0x7388('0xc'),_0x55e0c4,_0x7388('0xd'));logger[_0x7388('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x55e0c4,_0x7388('0xd'),JSON[_0x7388('0xf')](_0x6b6c20));if(_0x6b6c20[_0x7388('0x10')]){if(_0x6b6c20[_0x7388('0x10')][_0x7388('0x11')]===0x1f4){logger['error'](_0x7388('0xc'),_0x55e0c4,_0x6b6c20[_0x7388('0x10')][_0x7388('0x12')]);return _0x305c85(_0x6b6c20[_0x7388('0x10')]['message']);}logger[_0x7388('0x10')]('VoiceMail,\x20%s,\x20%s',_0x55e0c4,_0x6b6c20[_0x7388('0x10')][_0x7388('0x12')]);return _0x195e4(_0x6b6c20[_0x7388('0x10')][_0x7388('0x12')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x55e0c4,_0x7388('0xd'));_0x195e4(_0x6b6c20['result'][_0x7388('0x12')]);}})[_0x7388('0x13')](function(_0xf5a6be){logger[_0x7388('0x10')](_0x7388('0xc'),_0x55e0c4,_0xf5a6be);_0x305c85(_0xf5a6be);});});} \ No newline at end of file +var _0xa5a2=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5c99d5,_0x41a4ac){var _0x1e6020=function(_0x51d9c9){while(--_0x51d9c9){_0x5c99d5['push'](_0x5c99d5['shift']());}};_0x1e6020(++_0x41a4ac);}(_0xa5a2,0x1b9));var _0x2a5a=function(_0x22c168,_0x1530f3){_0x22c168=_0x22c168-0x0;var _0x41efd4=_0xa5a2[_0x22c168];return _0x41efd4;};'use strict';var _=require(_0x2a5a('0x0'));var util=require(_0x2a5a('0x1'));var moment=require('moment');var BPromise=require(_0x2a5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a5a('0x3'));var db=require(_0x2a5a('0x4'))['db'];var utils=require(_0x2a5a('0x5'));var logger=require(_0x2a5a('0x6'))(_0x2a5a('0x7'));var config=require(_0x2a5a('0x8'));var jayson=require(_0x2a5a('0x9'));var client=jayson[_0x2a5a('0xa')][_0x2a5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c0ba,_0x17f7c3,_0x1f3ab1){return new BPromise(function(_0xa1f931,_0x4fd1f8){return client[_0x2a5a('0xc')](_0x55c0ba,_0x1f3ab1)[_0x2a5a('0xd')](function(_0x4bfd8e){logger[_0x2a5a('0xe')](_0x2a5a('0xf'),_0x17f7c3,_0x2a5a('0x10'));logger[_0x2a5a('0x11')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x17f7c3,'request\x20sent',JSON[_0x2a5a('0x12')](_0x4bfd8e));if(_0x4bfd8e[_0x2a5a('0x13')]){if(_0x4bfd8e[_0x2a5a('0x13')]['code']===0x1f4){logger['error'](_0x2a5a('0xf'),_0x17f7c3,_0x4bfd8e[_0x2a5a('0x13')][_0x2a5a('0x14')]);return _0x4fd1f8(_0x4bfd8e[_0x2a5a('0x13')][_0x2a5a('0x14')]);}logger[_0x2a5a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x17f7c3,_0x4bfd8e[_0x2a5a('0x13')][_0x2a5a('0x14')]);return _0xa1f931(_0x4bfd8e['error'][_0x2a5a('0x14')]);}else{logger['info'](_0x2a5a('0xf'),_0x17f7c3,_0x2a5a('0x10'));_0xa1f931(_0x4bfd8e[_0x2a5a('0x15')][_0x2a5a('0x14')]);}})[_0x2a5a('0x16')](function(_0x23f070){logger[_0x2a5a('0x13')](_0x2a5a('0xf'),_0x17f7c3,_0x23f070);_0x4fd1f8(_0x23f070);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 7b2648a..6fe7598 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 _0x099b=['delete','/:id','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/download','download','create','put','update'];(function(_0x20f4e0,_0x7ed506){var _0x44ab7f=function(_0x1beafc){while(--_0x1beafc){_0x20f4e0['push'](_0x20f4e0['shift']());}};_0x44ab7f(++_0x7ed506);}(_0x099b,0x1f1));var _0xb099=function(_0xe2e455,_0x4e7d63){_0xe2e455=_0xe2e455-0x0;var _0x55a58e=_0x099b[_0xe2e455];return _0x55a58e;};'use strict';var multer=require('multer');var util=require(_0xb099('0x0'));var path=require(_0xb099('0x1'));var timeout=require(_0xb099('0x2'));var express=require(_0xb099('0x3'));var router=express['Router']();var fs_extra=require(_0xb099('0x4'));var auth=require(_0xb099('0x5'));var interaction=require(_0xb099('0x6'));var config=require(_0xb099('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xb099('0x8')](),controller[_0xb099('0x9')]);router['get']('/:id',auth[_0xb099('0x8')](),controller['show']);router[_0xb099('0xa')](_0xb099('0xb'),auth[_0xb099('0x8')](),controller[_0xb099('0xc')]);router['post']('/',auth[_0xb099('0x8')](),controller[_0xb099('0xd')]);router[_0xb099('0xe')]('/:id',auth[_0xb099('0x8')](),controller[_0xb099('0xf')]);router[_0xb099('0x10')](_0xb099('0x11'),auth['isAuthenticated'](),controller[_0xb099('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd011=['get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller'];(function(_0x24a15e,_0x4862ce){var _0x10256f=function(_0x43ed6e){while(--_0x43ed6e){_0x24a15e['push'](_0x24a15e['shift']());}};_0x10256f(++_0x4862ce);}(_0xd011,0x76));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1d01('0x0'));var util=require(_0x1d01('0x1'));var path=require(_0x1d01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1d01('0x3')]();var fs_extra=require(_0x1d01('0x4'));var auth=require(_0x1d01('0x5'));var interaction=require(_0x1d01('0x6'));var config=require('../../config/environment');var controller=require(_0x1d01('0x7'));router[_0x1d01('0x8')]('/',auth[_0x1d01('0x9')](),controller['index']);router['get'](_0x1d01('0xa'),auth['isAuthenticated'](),controller[_0x1d01('0xb')]);router[_0x1d01('0x8')](_0x1d01('0xc'),auth['isAuthenticated'](),controller[_0x1d01('0xd')]);router[_0x1d01('0xe')]('/',auth[_0x1d01('0x9')](),controller[_0x1d01('0xf')]);router[_0x1d01('0x10')](_0x1d01('0xa'),auth[_0x1d01('0x9')](),controller[_0x1d01('0x11')]);router[_0x1d01('0x12')](_0x1d01('0xa'),auth[_0x1d01('0x9')](),controller[_0x1d01('0x13')]);module[_0x1d01('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a661c1d..a18006c 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 _0x4e1a=['STRING','BLOB','TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x4e1a,0xe7));var _0xa4e1=function(_0x3713e5,_0x3ae610){_0x3713e5=_0x3713e5-0x0;var _0x4fa812=_0x4e1a[_0x3713e5];return _0x4fa812;};'use strict';var Sequelize=require('sequelize');module[_0xa4e1('0x0')]={'name':{'type':Sequelize[_0xa4e1('0x1')],'get':function(_0x317764){return this[_0xa4e1('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xa4e1('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa4e1('0x3')],'defaultValue':''},'stamp':{'type':_0xa4e1('0x5'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x495d=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x495d,0x1b8));var _0xd495=function(_0x12108f,_0x4dc044){_0x12108f=_0x12108f-0x0;var _0x29196e=_0x495d[_0x12108f];return _0x29196e;};'use strict';var Sequelize=require('sequelize');module[_0xd495('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5827c9){return this[_0xd495('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xd495('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd495('0x4')](_0xd495('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd495('0x3')],'defaultValue':''},'stamp':{'type':_0xd495('0x6'),'defaultValue':Sequelize[_0xd495('0x7')](_0xd495('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index f9f7096..204f850 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 _0x4fe8=['set','Content-Range','json','save','update','then','end','sendStatus','name','send','index','map','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','VoiceMailMessage','catch','show','params','rawAttributes','include','find','create','body','destroy','download','recording','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x5ed944,_0x2720b9){var _0x55fbd7=function(_0xd07c6d){while(--_0xd07c6d){_0x5ed944['push'](_0x5ed944['shift']());}};_0x55fbd7(++_0x2720b9);}(_0x4fe8,0x18d));var _0x84fe=function(_0x47d75e,_0x238af3){_0x47d75e=_0x47d75e-0x0;var _0x2de6fd=_0x4fe8[_0x47d75e];return _0x2de6fd;};'use strict';var emlformat=require(_0x84fe('0x0'));var rimraf=require(_0x84fe('0x1'));var zipdir=require(_0x84fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x84fe('0x3'));var BPromise=require(_0x84fe('0x4'));var Mustache=require(_0x84fe('0x5'));var util=require(_0x84fe('0x6'));var path=require(_0x84fe('0x7'));var sox=require(_0x84fe('0x8'));var csv=require(_0x84fe('0x9'));var ejs=require(_0x84fe('0xa'));var fs=require('fs');var fs_extra=require(_0x84fe('0xb'));var _=require('lodash');var squel=require(_0x84fe('0xc'));var crypto=require(_0x84fe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x84fe('0xe'));var toCsv=require(_0x84fe('0x9'));var querystring=require(_0x84fe('0xf'));var Papa=require(_0x84fe('0x10'));var Redis=require(_0x84fe('0x11'));var authService=require(_0x84fe('0x12'));var qs=require(_0x84fe('0x13'));var as=require(_0x84fe('0x14'));var hardwareService=require(_0x84fe('0x15'));var logger=require(_0x84fe('0x16'))(_0x84fe('0x17'));var utils=require(_0x84fe('0x18'));var config=require(_0x84fe('0x19'));var licenseUtil=require(_0x84fe('0x1a'));var db=require(_0x84fe('0x1b'))['db'];function respondWithStatusCode(_0x212d5d,_0x468771){_0x468771=_0x468771||0xcc;return function(_0x2c592d){if(_0x2c592d){return _0x212d5d['sendStatus'](_0x468771);}return _0x212d5d['status'](_0x468771)['end']();};}function respondWithResult(_0x5ea68c,_0x3caca8){_0x3caca8=_0x3caca8||0xc8;return function(_0x12ec01){if(_0x12ec01){return _0x5ea68c[_0x84fe('0x1c')](_0x3caca8)['json'](_0x12ec01);}};}function respondWithFilteredResult(_0x2151e3,_0x31e68c){return function(_0x4df287){if(_0x4df287){var _0xf025f7=typeof _0x31e68c[_0x84fe('0x1d')]===_0x84fe('0x1e')&&typeof _0x31e68c[_0x84fe('0x1f')]==='undefined';var _0x2d4323=_0x4df287[_0x84fe('0x20')];var _0x53b40b=_0xf025f7?0x0:_0x31e68c[_0x84fe('0x1d')];var _0x4d29ec=_0xf025f7?_0x4df287[_0x84fe('0x20')]:_0x31e68c['offset']+_0x31e68c[_0x84fe('0x1f')];var _0x228c8a;if(_0x4d29ec>=_0x2d4323){_0x4d29ec=_0x2d4323;_0x228c8a=0xc8;}else{_0x228c8a=0xce;}_0x2151e3['status'](_0x228c8a);return _0x2151e3[_0x84fe('0x21')](_0x84fe('0x22'),_0x53b40b+'-'+_0x4d29ec+'/'+_0x2d4323)[_0x84fe('0x23')](_0x4df287);}return null;};}function patchUpdates(_0x2abbfc){return function(_0x43ae2c){try{jsonpatch['apply'](_0x43ae2c,_0x2abbfc,!![]);}catch(_0x356028){return BPromise['reject'](_0x356028);}return _0x43ae2c[_0x84fe('0x24')]();};}function saveUpdates(_0x40eb25,_0x55f5da){return function(_0x1c5df4){if(_0x1c5df4){return _0x1c5df4[_0x84fe('0x25')](_0x40eb25)[_0x84fe('0x26')](function(_0x5137b4){return _0x5137b4;});}return null;};}function removeEntity(_0x4b93bc,_0x186b2b){return function(_0x193180){if(_0x193180){return _0x193180['destroy']()[_0x84fe('0x26')](function(){_0x4b93bc['status'](0xcc)[_0x84fe('0x27')]();});}};}function handleEntityNotFound(_0x407908,_0x3a7efa){return function(_0x2a61fa){if(!_0x2a61fa){_0x407908[_0x84fe('0x28')](0x194);}return _0x2a61fa;};}function handleError(_0x47efa4,_0x28e7fb){_0x28e7fb=_0x28e7fb||0x1f4;return function(_0x3cd93c){logger['error'](_0x3cd93c['stack']);if(_0x3cd93c[_0x84fe('0x29')]){delete _0x3cd93c[_0x84fe('0x29')];}_0x47efa4['status'](_0x28e7fb)[_0x84fe('0x2a')](_0x3cd93c);};}exports[_0x84fe('0x2b')]=function(_0xc781d1,_0x1a942b){var _0xcf1155={},_0x5d1adf={},_0x392e70={'count':0x0,'rows':[]};var _0x362d86=_[_0x84fe('0x2c')](db['VoiceMailMessage']['rawAttributes'],function(_0x3d2634){return{'name':_0x3d2634[_0x84fe('0x2d')],'type':_0x3d2634['type']['key']};});_0x5d1adf[_0x84fe('0x2e')]=_[_0x84fe('0x2f')](_[_0x84fe('0x2c')](_0x362d86,_0x84fe('0x29')),[_0x84fe('0x29')]);_0x5d1adf[_0x84fe('0x30')]=_[_0x84fe('0x31')](_0xc781d1[_0x84fe('0x30')]);_0x5d1adf[_0x84fe('0x32')]=_[_0x84fe('0x33')](_0x5d1adf[_0x84fe('0x2e')],_0x5d1adf[_0x84fe('0x30')]);_0xcf1155[_0x84fe('0x34')]=_[_0x84fe('0x33')](_0x5d1adf['model'],qs[_0x84fe('0x35')](_0xc781d1[_0x84fe('0x30')][_0x84fe('0x35')]));_0xcf1155['attributes']=_0xcf1155['attributes'][_0x84fe('0x36')]?_0xcf1155['attributes']:_0x5d1adf[_0x84fe('0x2e')];if(!_0xc781d1[_0x84fe('0x30')][_0x84fe('0x37')](_0x84fe('0x38'))){_0xcf1155[_0x84fe('0x1f')]=qs[_0x84fe('0x1f')](_0xc781d1[_0x84fe('0x30')][_0x84fe('0x1f')]);_0xcf1155['offset']=qs[_0x84fe('0x1d')](_0xc781d1[_0x84fe('0x30')][_0x84fe('0x1d')]);}_0xcf1155[_0x84fe('0x39')]=qs[_0x84fe('0x3a')](_0xc781d1[_0x84fe('0x30')]['sort']);_0xcf1155[_0x84fe('0x3b')]=qs[_0x84fe('0x32')](_[_0x84fe('0x3c')](_0xc781d1[_0x84fe('0x30')],_0x5d1adf[_0x84fe('0x32')]),_0x362d86);if(_0xc781d1['query'][_0x84fe('0x3d')]){_0xcf1155['where']=_[_0x84fe('0x3e')](_0xcf1155[_0x84fe('0x3b')],{'$or':_[_0x84fe('0x2c')](_0x362d86,function(_0x2abc76){if(_0x2abc76[_0x84fe('0x3f')]!==_0x84fe('0x40')){var _0x448da6={};_0x448da6[_0x2abc76[_0x84fe('0x29')]]={'$like':'%'+_0xc781d1[_0x84fe('0x30')]['filter']+'%'};return _0x448da6;}})});}_0xcf1155=_[_0x84fe('0x3e')]({},_0xcf1155,_0xc781d1[_0x84fe('0x41')]);var _0x4711a0={'where':_0xcf1155[_0x84fe('0x3b')]};return db['VoiceMailMessage'][_0x84fe('0x20')](_0x4711a0)[_0x84fe('0x26')](function(_0x147ea5){_0x392e70['count']=_0x147ea5;if(_0xc781d1[_0x84fe('0x30')][_0x84fe('0x42')]){_0xcf1155['include']=[{'all':!![]}];}return db[_0x84fe('0x43')]['findAll'](_0xcf1155);})['then'](function(_0x3d861c){_0x392e70['rows']=_0x3d861c;return _0x392e70;})['then'](respondWithFilteredResult(_0x1a942b,_0xcf1155))[_0x84fe('0x44')](handleError(_0x1a942b,null));};exports[_0x84fe('0x45')]=function(_0x38e8a9,_0x7a990e){var _0x13a5fa={'raw':!![],'where':{'id':_0x38e8a9[_0x84fe('0x46')]['id']}},_0x21b10f={};_0x21b10f[_0x84fe('0x2e')]=_[_0x84fe('0x31')](db[_0x84fe('0x43')][_0x84fe('0x47')]);_0x21b10f[_0x84fe('0x30')]=_[_0x84fe('0x31')](_0x38e8a9['query']);_0x21b10f[_0x84fe('0x32')]=_[_0x84fe('0x33')](_0x21b10f[_0x84fe('0x2e')],_0x21b10f[_0x84fe('0x30')]);_0x13a5fa['attributes']=_[_0x84fe('0x33')](_0x21b10f[_0x84fe('0x2e')],qs[_0x84fe('0x35')](_0x38e8a9[_0x84fe('0x30')][_0x84fe('0x35')]));_0x13a5fa['attributes']=_0x13a5fa['attributes']['length']?_0x13a5fa[_0x84fe('0x34')]:_0x21b10f[_0x84fe('0x2e')];if(_0x38e8a9[_0x84fe('0x30')]['includeAll']){_0x13a5fa[_0x84fe('0x48')]=[{'all':!![]}];}_0x13a5fa=_[_0x84fe('0x3e')]({},_0x13a5fa,_0x38e8a9['options']);return db['VoiceMailMessage'][_0x84fe('0x49')](_0x13a5fa)['then'](handleEntityNotFound(_0x7a990e,null))['then'](respondWithResult(_0x7a990e,null))[_0x84fe('0x44')](handleError(_0x7a990e,null));};exports['create']=function(_0x556f47,_0xcebc7d){return db[_0x84fe('0x43')][_0x84fe('0x4a')](_0x556f47[_0x84fe('0x4b')],{})[_0x84fe('0x26')](respondWithResult(_0xcebc7d,0xc9))[_0x84fe('0x44')](handleError(_0xcebc7d,null));};exports[_0x84fe('0x25')]=function(_0xcd69d,_0x389eb4){if(_0xcd69d[_0x84fe('0x4b')]['id']){delete _0xcd69d['body']['id'];}return db[_0x84fe('0x43')][_0x84fe('0x49')]({'where':{'id':_0xcd69d[_0x84fe('0x46')]['id']}})[_0x84fe('0x26')](handleEntityNotFound(_0x389eb4,null))[_0x84fe('0x26')](saveUpdates(_0xcd69d[_0x84fe('0x4b')],null))[_0x84fe('0x26')](respondWithResult(_0x389eb4,null))[_0x84fe('0x44')](handleError(_0x389eb4,null));};exports[_0x84fe('0x4c')]=function(_0x11655b,_0x3c8593){return db['VoiceMailMessage'][_0x84fe('0x49')]({'where':{'id':_0x11655b[_0x84fe('0x46')]['id']}})[_0x84fe('0x26')](handleEntityNotFound(_0x3c8593,null))[_0x84fe('0x26')](removeEntity(_0x3c8593,null))['catch'](handleError(_0x3c8593,null));};exports[_0x84fe('0x4d')]=function(_0xe3e4c3,_0x514cc6,_0x15d4d4){return db['VoiceMailMessage'][_0x84fe('0x49')]({'where':{'id':_0xe3e4c3[_0x84fe('0x46')]['id']},'attributes':['id',_0x84fe('0x4e'),'msg_id']})[_0x84fe('0x26')](handleEntityNotFound(_0x514cc6,null))[_0x84fe('0x26')](function(_0x51fbe6){if(_0x51fbe6){if(!_0x51fbe6[_0x84fe('0x4e')]){throw new db['Sequelize'][(_0x84fe('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x2fceef={'Content-Type':_0x84fe('0x50'),'Content-Disposition':_0x84fe('0x51')};if(_0x51fbe6[_0x84fe('0x52')]){_0x2fceef[_0x84fe('0x53')]=_0x84fe('0x54')+_0x51fbe6[_0x84fe('0x52')]+_0x84fe('0x55');}_0x514cc6[_0x84fe('0x21')](_0x2fceef);return _0x514cc6[_0x84fe('0x2a')](new Buffer(_0x51fbe6[_0x84fe('0x4e')]));}})[_0x84fe('0x44')](handleError(_0x514cc6,null));}; \ No newline at end of file +var _0x6052=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','apply','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','update','download','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6052,0x17f));var _0x2605=function(_0x5e3731,_0x35699a){_0x5e3731=_0x5e3731-0x0;var _0x34131e=_0x6052[_0x5e3731];return _0x34131e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2605('0x0'));var zipdir=require(_0x2605('0x1'));var jsonpatch=require(_0x2605('0x2'));var rp=require(_0x2605('0x3'));var moment=require(_0x2605('0x4'));var BPromise=require(_0x2605('0x5'));var Mustache=require(_0x2605('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2605('0x7'));var csv=require(_0x2605('0x8'));var ejs=require(_0x2605('0x9'));var fs=require('fs');var fs_extra=require(_0x2605('0xa'));var _=require(_0x2605('0xb'));var squel=require(_0x2605('0xc'));var crypto=require(_0x2605('0xd'));var jsforce=require(_0x2605('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2605('0x8'));var querystring=require(_0x2605('0xf'));var Papa=require('papaparse');var Redis=require(_0x2605('0x10'));var authService=require(_0x2605('0x11'));var qs=require(_0x2605('0x12'));var as=require(_0x2605('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2605('0x14'));var utils=require(_0x2605('0x15'));var config=require(_0x2605('0x16'));var licenseUtil=require(_0x2605('0x17'));var db=require(_0x2605('0x18'))['db'];function respondWithStatusCode(_0x41f60b,_0x112a24){_0x112a24=_0x112a24||0xcc;return function(_0x1ea0f7){if(_0x1ea0f7){return _0x41f60b[_0x2605('0x19')](_0x112a24);}return _0x41f60b[_0x2605('0x1a')](_0x112a24)[_0x2605('0x1b')]();};}function respondWithResult(_0x5c8bcd,_0x5bd686){_0x5bd686=_0x5bd686||0xc8;return function(_0x76cd1a){if(_0x76cd1a){return _0x5c8bcd[_0x2605('0x1a')](_0x5bd686)['json'](_0x76cd1a);}};}function respondWithFilteredResult(_0x3357a3,_0x1ed55c){return function(_0x1d8988){if(_0x1d8988){var _0xc71c8d=typeof _0x1ed55c[_0x2605('0x1c')]==='undefined'&&typeof _0x1ed55c['limit']==='undefined';var _0x37ecc9=_0x1d8988[_0x2605('0x1d')];var _0x9ae1d9=_0xc71c8d?0x0:_0x1ed55c[_0x2605('0x1c')];var _0x502a1d=_0xc71c8d?_0x1d8988[_0x2605('0x1d')]:_0x1ed55c[_0x2605('0x1c')]+_0x1ed55c[_0x2605('0x1e')];var _0xbe3b2a;if(_0x502a1d>=_0x37ecc9){_0x502a1d=_0x37ecc9;_0xbe3b2a=0xc8;}else{_0xbe3b2a=0xce;}_0x3357a3[_0x2605('0x1a')](_0xbe3b2a);return _0x3357a3[_0x2605('0x1f')]('Content-Range',_0x9ae1d9+'-'+_0x502a1d+'/'+_0x37ecc9)['json'](_0x1d8988);}return null;};}function patchUpdates(_0x308afd){return function(_0x470b1b){try{jsonpatch[_0x2605('0x20')](_0x470b1b,_0x308afd,!![]);}catch(_0x2d11c6){return BPromise['reject'](_0x2d11c6);}return _0x470b1b['save']();};}function saveUpdates(_0xb1915,_0x360e10){return function(_0x3b6e28){if(_0x3b6e28){return _0x3b6e28['update'](_0xb1915)[_0x2605('0x21')](function(_0x35b48b){return _0x35b48b;});}return null;};}function removeEntity(_0x543952,_0x2d0621){return function(_0x1839b8){if(_0x1839b8){return _0x1839b8[_0x2605('0x22')]()['then'](function(){_0x543952[_0x2605('0x1a')](0xcc)[_0x2605('0x1b')]();});}};}function handleEntityNotFound(_0x54d444,_0x4cf3e7){return function(_0x5113ce){if(!_0x5113ce){_0x54d444[_0x2605('0x19')](0x194);}return _0x5113ce;};}function handleError(_0x3aec75,_0x597308){_0x597308=_0x597308||0x1f4;return function(_0x43003b){logger[_0x2605('0x23')](_0x43003b[_0x2605('0x24')]);if(_0x43003b[_0x2605('0x25')]){delete _0x43003b['name'];}_0x3aec75[_0x2605('0x1a')](_0x597308)[_0x2605('0x26')](_0x43003b);};}exports[_0x2605('0x27')]=function(_0x1b460f,_0x2739dd){var _0x2b4221={},_0x462e1e={},_0x148ec6={'count':0x0,'rows':[]};var _0xa32a07=_[_0x2605('0x28')](db[_0x2605('0x29')][_0x2605('0x2a')],function(_0x288f5e){return{'name':_0x288f5e['fieldName'],'type':_0x288f5e['type'][_0x2605('0x2b')]};});_0x462e1e[_0x2605('0x2c')]=_['differenceBy'](_[_0x2605('0x28')](_0xa32a07,_0x2605('0x25')),['name']);_0x462e1e[_0x2605('0x2d')]=_[_0x2605('0x2e')](_0x1b460f[_0x2605('0x2d')]);_0x462e1e[_0x2605('0x2f')]=_[_0x2605('0x30')](_0x462e1e[_0x2605('0x2c')],_0x462e1e['query']);_0x2b4221[_0x2605('0x31')]=_[_0x2605('0x30')](_0x462e1e[_0x2605('0x2c')],qs[_0x2605('0x32')](_0x1b460f[_0x2605('0x2d')][_0x2605('0x32')]));_0x2b4221['attributes']=_0x2b4221[_0x2605('0x31')][_0x2605('0x33')]?_0x2b4221[_0x2605('0x31')]:_0x462e1e[_0x2605('0x2c')];if(!_0x1b460f[_0x2605('0x2d')][_0x2605('0x34')](_0x2605('0x35'))){_0x2b4221[_0x2605('0x1e')]=qs[_0x2605('0x1e')](_0x1b460f[_0x2605('0x2d')][_0x2605('0x1e')]);_0x2b4221['offset']=qs[_0x2605('0x1c')](_0x1b460f['query'][_0x2605('0x1c')]);}_0x2b4221[_0x2605('0x36')]=qs['sort'](_0x1b460f[_0x2605('0x2d')][_0x2605('0x37')]);_0x2b4221['where']=qs[_0x2605('0x2f')](_[_0x2605('0x38')](_0x1b460f[_0x2605('0x2d')],_0x462e1e['filters']),_0xa32a07);if(_0x1b460f[_0x2605('0x2d')][_0x2605('0x39')]){_0x2b4221[_0x2605('0x3a')]=_['merge'](_0x2b4221[_0x2605('0x3a')],{'$or':_['map'](_0xa32a07,function(_0x5f5c50){if(_0x5f5c50['type']!==_0x2605('0x3b')){var _0x4ee4d0={};_0x4ee4d0[_0x5f5c50[_0x2605('0x25')]]={'$like':'%'+_0x1b460f[_0x2605('0x2d')][_0x2605('0x39')]+'%'};return _0x4ee4d0;}})});}_0x2b4221=_['merge']({},_0x2b4221,_0x1b460f[_0x2605('0x3c')]);var _0x4fa46b={'where':_0x2b4221[_0x2605('0x3a')]};return db[_0x2605('0x29')][_0x2605('0x1d')](_0x4fa46b)[_0x2605('0x21')](function(_0x313deb){_0x148ec6[_0x2605('0x1d')]=_0x313deb;if(_0x1b460f[_0x2605('0x2d')][_0x2605('0x3d')]){_0x2b4221[_0x2605('0x3e')]=[{'all':!![]}];}return db[_0x2605('0x29')][_0x2605('0x3f')](_0x2b4221);})[_0x2605('0x21')](function(_0x2f9b13){_0x148ec6['rows']=_0x2f9b13;return _0x148ec6;})[_0x2605('0x21')](respondWithFilteredResult(_0x2739dd,_0x2b4221))[_0x2605('0x40')](handleError(_0x2739dd,null));};exports[_0x2605('0x41')]=function(_0x39766d,_0x1ea07d){var _0x386f78={'raw':!![],'where':{'id':_0x39766d[_0x2605('0x42')]['id']}},_0x282977={};_0x282977[_0x2605('0x2c')]=_[_0x2605('0x2e')](db['VoiceMailMessage']['rawAttributes']);_0x282977[_0x2605('0x2d')]=_[_0x2605('0x2e')](_0x39766d['query']);_0x282977[_0x2605('0x2f')]=_[_0x2605('0x30')](_0x282977[_0x2605('0x2c')],_0x282977[_0x2605('0x2d')]);_0x386f78[_0x2605('0x31')]=_[_0x2605('0x30')](_0x282977[_0x2605('0x2c')],qs[_0x2605('0x32')](_0x39766d[_0x2605('0x2d')][_0x2605('0x32')]));_0x386f78[_0x2605('0x31')]=_0x386f78[_0x2605('0x31')][_0x2605('0x33')]?_0x386f78[_0x2605('0x31')]:_0x282977['model'];if(_0x39766d[_0x2605('0x2d')][_0x2605('0x3d')]){_0x386f78[_0x2605('0x3e')]=[{'all':!![]}];}_0x386f78=_[_0x2605('0x43')]({},_0x386f78,_0x39766d[_0x2605('0x3c')]);return db[_0x2605('0x29')][_0x2605('0x44')](_0x386f78)[_0x2605('0x21')](handleEntityNotFound(_0x1ea07d,null))[_0x2605('0x21')](respondWithResult(_0x1ea07d,null))['catch'](handleError(_0x1ea07d,null));};exports[_0x2605('0x45')]=function(_0x535911,_0xe0472e){return db[_0x2605('0x29')][_0x2605('0x45')](_0x535911[_0x2605('0x46')],{})[_0x2605('0x21')](respondWithResult(_0xe0472e,0xc9))[_0x2605('0x40')](handleError(_0xe0472e,null));};exports[_0x2605('0x47')]=function(_0x32fafb,_0x2b0985){if(_0x32fafb['body']['id']){delete _0x32fafb[_0x2605('0x46')]['id'];}return db['VoiceMailMessage'][_0x2605('0x44')]({'where':{'id':_0x32fafb[_0x2605('0x42')]['id']}})[_0x2605('0x21')](handleEntityNotFound(_0x2b0985,null))[_0x2605('0x21')](saveUpdates(_0x32fafb[_0x2605('0x46')],null))[_0x2605('0x21')](respondWithResult(_0x2b0985,null))[_0x2605('0x40')](handleError(_0x2b0985,null));};exports[_0x2605('0x22')]=function(_0x3efdb0,_0x33ff9e){return db[_0x2605('0x29')][_0x2605('0x44')]({'where':{'id':_0x3efdb0[_0x2605('0x42')]['id']}})[_0x2605('0x21')](handleEntityNotFound(_0x33ff9e,null))[_0x2605('0x21')](removeEntity(_0x33ff9e,null))[_0x2605('0x40')](handleError(_0x33ff9e,null));};exports[_0x2605('0x48')]=function(_0x26a575,_0x2703c7,_0x328c2e){return db[_0x2605('0x29')][_0x2605('0x44')]({'where':{'id':_0x26a575['params']['id']},'attributes':['id','recording',_0x2605('0x49')]})[_0x2605('0x21')](handleEntityNotFound(_0x2703c7,null))[_0x2605('0x21')](function(_0x2484bf){if(_0x2484bf){if(!_0x2484bf[_0x2605('0x4a')]){throw new db[(_0x2605('0x4b'))]['ValidationError'](_0x2605('0x4c'));}var _0x37db75={'Content-Type':_0x2605('0x4d'),'Content-Disposition':_0x2605('0x4e')};if(_0x2484bf['msg_id']){_0x37db75[_0x2605('0x4f')]=_0x2605('0x50')+_0x2484bf[_0x2605('0x49')]+'.wav\x22';}_0x2703c7['set'](_0x37db75);return _0x2703c7[_0x2605('0x26')](new Buffer(_0x2484bf['recording']));}})[_0x2605('0x40')](handleError(_0x2703c7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4ba2743..629fcae 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 _0xe581=['voice_voicemail_messages','dir','lodash','util','../../config/logger','bluebird','path','rimraf','exports','define','VoiceMailMessage'];(function(_0x312bb1,_0x3452cb){var _0x1577e2=function(_0x102d26){while(--_0x102d26){_0x312bb1['push'](_0x312bb1['shift']());}};_0x1577e2(++_0x3452cb);}(_0xe581,0x9c));var _0x1e58=function(_0x5e2217,_0xcc09c0){_0x5e2217=_0x5e2217-0x0;var _0xcdcd1c=_0xe581[_0x5e2217];return _0xcdcd1c;};'use strict';var _=require(_0x1e58('0x0'));var util=require(_0x1e58('0x1'));var logger=require(_0x1e58('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e58('0x4'));var rimraf=require(_0x1e58('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x1e58('0x6')]=function(_0x9807da,_0x2c4e11){return _0x9807da[_0x1e58('0x7')](_0x1e58('0x8'),attributes,{'tableName':_0x1e58('0x9'),'paranoid':![],'indexes':[{'name':_0x1e58('0xa'),'fields':[_0x1e58('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3c79=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x3c79,0xbd));var _0x93c7=function(_0x238c90,_0x29e1a0){_0x238c90=_0x238c90-0x0;var _0x45c1b3=_0x3c79[_0x238c90];return _0x45c1b3;};'use strict';var _=require(_0x93c7('0x0'));var util=require(_0x93c7('0x1'));var logger=require(_0x93c7('0x2'))('api');var moment=require(_0x93c7('0x3'));var BPromise=require(_0x93c7('0x4'));var rp=require(_0x93c7('0x5'));var fs=require('fs');var path=require(_0x93c7('0x6'));var rimraf=require(_0x93c7('0x7'));var config=require(_0x93c7('0x8'));var attributes=require(_0x93c7('0x9'));module[_0x93c7('0xa')]=function(_0x522ecb,_0x171ef8){return _0x522ecb[_0x93c7('0xb')](_0x93c7('0xc'),attributes,{'tableName':_0x93c7('0xd'),'paranoid':![],'indexes':[{'name':_0x93c7('0xe'),'fields':[_0x93c7('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index ffb0819..6f420f9 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 _0x34e0=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x3904df,_0x3a7813){var _0x18e3fb=function(_0x4e1d1e){while(--_0x4e1d1e){_0x3904df['push'](_0x3904df['shift']());}};_0x18e3fb(++_0x3a7813);}(_0x34e0,0xc4));var _0x034e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x34e0[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x034e('0x0'));var util=require(_0x034e('0x1'));var moment=require('moment');var BPromise=require(_0x034e('0x2'));var rs=require(_0x034e('0x3'));var fs=require('fs');var Redis=require(_0x034e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x034e('0x5'));var logger=require(_0x034e('0x6'))(_0x034e('0x7'));var config=require(_0x034e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x034e('0x9')][_0x034e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa67b9d,_0x435357,_0x5e22f0){return new BPromise(function(_0x33974b,_0x42fb59){return client[_0x034e('0xb')](_0xa67b9d,_0x5e22f0)[_0x034e('0xc')](function(_0x120a33){logger[_0x034e('0xd')](_0x034e('0xe'),_0x435357,_0x034e('0xf'));logger[_0x034e('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x435357,'request\x20sent',JSON[_0x034e('0x11')](_0x120a33));if(_0x120a33['error']){if(_0x120a33['error']['code']===0x1f4){logger[_0x034e('0x12')](_0x034e('0xe'),_0x435357,_0x120a33[_0x034e('0x12')][_0x034e('0x13')]);return _0x42fb59(_0x120a33[_0x034e('0x12')][_0x034e('0x13')]);}logger['error'](_0x034e('0xe'),_0x435357,_0x120a33[_0x034e('0x12')][_0x034e('0x13')]);return _0x33974b(_0x120a33[_0x034e('0x12')][_0x034e('0x13')]);}else{logger[_0x034e('0xd')](_0x034e('0xe'),_0x435357,_0x034e('0xf'));_0x33974b(_0x120a33[_0x034e('0x14')]['message']);}})[_0x034e('0x15')](function(_0x1ad256){logger[_0x034e('0x12')](_0x034e('0xe'),_0x435357,_0x1ad256);_0x42fb59(_0x1ad256);});});} \ No newline at end of file +var _0x9e76=['jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x9e76,0x161));var _0x69e7=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x9e76[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x69e7('0x0'));var util=require(_0x69e7('0x1'));var moment=require(_0x69e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x69e7('0x3'));var fs=require('fs');var Redis=require(_0x69e7('0x4'));var db=require(_0x69e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x69e7('0x6'));var config=require('../../config/environment');var jayson=require(_0x69e7('0x7'));var client=jayson['client'][_0x69e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a346,_0x26ed49,_0x381334){return new BPromise(function(_0xba0c37,_0x429c4c){return client[_0x69e7('0x9')](_0x38a346,_0x381334)[_0x69e7('0xa')](function(_0x44b1b5){logger[_0x69e7('0xb')](_0x69e7('0xc'),_0x26ed49,_0x69e7('0xd'));logger[_0x69e7('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x26ed49,_0x69e7('0xd'),JSON[_0x69e7('0xf')](_0x44b1b5));if(_0x44b1b5[_0x69e7('0x10')]){if(_0x44b1b5['error'][_0x69e7('0x11')]===0x1f4){logger[_0x69e7('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x26ed49,_0x44b1b5[_0x69e7('0x10')][_0x69e7('0x12')]);return _0x429c4c(_0x44b1b5[_0x69e7('0x10')][_0x69e7('0x12')]);}logger[_0x69e7('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x26ed49,_0x44b1b5['error']['message']);return _0xba0c37(_0x44b1b5[_0x69e7('0x10')][_0x69e7('0x12')]);}else{logger[_0x69e7('0xb')](_0x69e7('0xc'),_0x26ed49,'request\x20sent');_0xba0c37(_0x44b1b5['result'][_0x69e7('0x12')]);}})[_0x69e7('0x13')](function(_0x2235a0){logger[_0x69e7('0x10')](_0x69e7('0xc'),_0x26ed49,_0x2235a0);_0x429c4c(_0x2235a0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 86c9c50..2995189 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 _0xd060=['/:id/sounds','getSounds','post','create','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show'];(function(_0x5bdf8e,_0x45d970){var _0x3e0750=function(_0x41298b){while(--_0x41298b){_0x5bdf8e['push'](_0x5bdf8e['shift']());}};_0x3e0750(++_0x45d970);}(_0xd060,0x11b));var _0x0d06=function(_0x429623,_0x23c38a){_0x429623=_0x429623-0x0;var _0x30d8fa=_0xd060[_0x429623];return _0x30d8fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d06('0x0'));var timeout=require(_0x0d06('0x1'));var express=require(_0x0d06('0x2'));var router=express['Router']();var fs_extra=require(_0x0d06('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0d06('0x4'));var config=require(_0x0d06('0x5'));var controller=require(_0x0d06('0x6'));router[_0x0d06('0x7')]('/',auth[_0x0d06('0x8')](),controller['index']);router[_0x0d06('0x7')](_0x0d06('0x9'),auth[_0x0d06('0x8')](),controller[_0x0d06('0xa')]);router[_0x0d06('0x7')](_0x0d06('0xb'),auth[_0x0d06('0x8')](),controller[_0x0d06('0xc')]);router[_0x0d06('0xd')]('/',auth[_0x0d06('0x8')](),controller[_0x0d06('0xe')]);router[_0x0d06('0xd')](_0x0d06('0xb'),auth[_0x0d06('0x8')](),controller['addSound']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0d06('0xf')]);router['delete'](_0x0d06('0x9'),auth[_0x0d06('0x8')](),controller[_0x0d06('0x10')]);router[_0x0d06('0x11')](_0x0d06('0x12'),auth[_0x0d06('0x8')](),controller[_0x0d06('0x13')]);module[_0x0d06('0x14')]=router; \ No newline at end of file +var _0x3f0c=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','destroy','/:id/sounds/:id2','exports','multer','util','path','Router'];(function(_0x25f22f,_0x1ab277){var _0x3faf05=function(_0x446781){while(--_0x446781){_0x25f22f['push'](_0x25f22f['shift']());}};_0x3faf05(++_0x1ab277);}(_0x3f0c,0x11c));var _0xc3f0=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0x3f0c[_0x3a1cca];return _0x53b71c;};'use strict';var multer=require(_0xc3f0('0x0'));var util=require(_0xc3f0('0x1'));var path=require(_0xc3f0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc3f0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc3f0('0x4'));var interaction=require(_0xc3f0('0x5'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xc3f0('0x6')]('/',auth[_0xc3f0('0x7')](),controller[_0xc3f0('0x8')]);router[_0xc3f0('0x6')](_0xc3f0('0x9'),auth[_0xc3f0('0x7')](),controller[_0xc3f0('0xa')]);router['get'](_0xc3f0('0xb'),auth['isAuthenticated'](),controller[_0xc3f0('0xc')]);router[_0xc3f0('0xd')]('/',auth['isAuthenticated'](),controller[_0xc3f0('0xe')]);router['post'](_0xc3f0('0xb'),auth[_0xc3f0('0x7')](),controller['addSound']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xc3f0('0x9'),auth['isAuthenticated'](),controller[_0xc3f0('0xf')]);router['delete'](_0xc3f0('0x10'),auth[_0xc3f0('0x7')](),controller['removeSound']);module[_0xc3f0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index bb4f553..f4806d0 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 _0x3fa9=['quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','files','mp3nb'];(function(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x3fa9,0x170));var _0x93fa=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3fa9[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x93fa('0x0'));module[_0x93fa('0x1')]={'name':{'type':Sequelize[_0x93fa('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x93fa('0x3')]('custom',_0x93fa('0x4'),_0x93fa('0x5'),_0x93fa('0x6'),_0x93fa('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x93fa('0x4')},'directory':{'type':Sequelize[_0x93fa('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x93fa('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x93fa('0x2')],'allowNull':!![],'defaultValue':_0x93fa('0x8')},'format':{'type':Sequelize[_0x93fa('0x2')],'allowNull':!![]},'stamp':{'type':_0x93fa('0x9')},'defaultEntry':{'type':Sequelize[_0x93fa('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x47ff=['quietmp3','mp3','TIMESTAMP','sequelize','exports','STRING','name','ENUM','files','mp3nb'];(function(_0x4d6935,_0x511735){var _0xcb7993=function(_0x42097e){while(--_0x42097e){_0x4d6935['push'](_0x4d6935['shift']());}};_0xcb7993(++_0x511735);}(_0x47ff,0xc1));var _0xf47f=function(_0xce1a87,_0x372c44){_0xce1a87=_0xce1a87-0x0;var _0x26669d=_0x47ff[_0xce1a87];return _0x26669d;};'use strict';var Sequelize=require(_0xf47f('0x0'));module[_0xf47f('0x1')]={'name':{'type':Sequelize[_0xf47f('0x2')],'allowNull':![],'unique':_0xf47f('0x3')},'mode':{'type':Sequelize[_0xf47f('0x4')]('custom',_0xf47f('0x5'),_0xf47f('0x6'),'quietmp3nb',_0xf47f('0x7'),_0xf47f('0x8')),'allowNull':!![],'defaultValue':_0xf47f('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xf47f('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf47f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xf47f('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 f16d3e5..30353ee 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 _0x921e=['server/files/moh','create','user','role','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','join','rmdirSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','findOne','id2','message','getSounds','order','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','destroy','get','UserProfileResource','then','error','stack','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','include','rows','catch','show','params','includeAll','options','find','update','body','sequelize','mode','files','directory','root'];(function(_0x25a45a,_0x156e4b){var _0x237f87=function(_0x17c9e5){while(--_0x17c9e5){_0x25a45a['push'](_0x25a45a['shift']());}};_0x237f87(++_0x156e4b);}(_0x921e,0x8d));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('request-promise');var moment=require(_0xe921('0x4'));var BPromise=require(_0xe921('0x5'));var Mustache=require(_0xe921('0x6'));var util=require(_0xe921('0x7'));var path=require(_0xe921('0x8'));var sox=require(_0xe921('0x9'));var csv=require(_0xe921('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe921('0xb'));var _=require(_0xe921('0xc'));var squel=require(_0xe921('0xd'));var crypto=require(_0xe921('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe921('0xf'));var toCsv=require(_0xe921('0xa'));var querystring=require(_0xe921('0x10'));var Papa=require(_0xe921('0x11'));var Redis=require('ioredis');var authService=require(_0xe921('0x12'));var qs=require(_0xe921('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe921('0x14'));var logger=require(_0xe921('0x15'))(_0xe921('0x16'));var utils=require(_0xe921('0x17'));var config=require(_0xe921('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe921('0x19'))['db'];function respondWithStatusCode(_0x261568,_0x4ac72c){_0x4ac72c=_0x4ac72c||0xcc;return function(_0x46d5f4){if(_0x46d5f4){return _0x261568[_0xe921('0x1a')](_0x4ac72c);}return _0x261568[_0xe921('0x1b')](_0x4ac72c)[_0xe921('0x1c')]();};}function respondWithResult(_0x305791,_0x332f95){_0x332f95=_0x332f95||0xc8;return function(_0x5e9207){if(_0x5e9207){return _0x305791[_0xe921('0x1b')](_0x332f95)['json'](_0x5e9207);}};}function respondWithFilteredResult(_0x15e165,_0x115d1b){return function(_0x245ce2){if(_0x245ce2){var _0x1c1d77=typeof _0x115d1b['offset']===_0xe921('0x1d')&&typeof _0x115d1b[_0xe921('0x1e')]===_0xe921('0x1d');var _0x44a342=_0x245ce2[_0xe921('0x1f')];var _0xb1c436=_0x1c1d77?0x0:_0x115d1b[_0xe921('0x20')];var _0x2aebc5=_0x1c1d77?_0x245ce2['count']:_0x115d1b[_0xe921('0x20')]+_0x115d1b['limit'];var _0x19e861;if(_0x2aebc5>=_0x44a342){_0x2aebc5=_0x44a342;_0x19e861=0xc8;}else{_0x19e861=0xce;}_0x15e165[_0xe921('0x1b')](_0x19e861);return _0x15e165[_0xe921('0x21')](_0xe921('0x22'),_0xb1c436+'-'+_0x2aebc5+'/'+_0x44a342)[_0xe921('0x23')](_0x245ce2);}return null;};}function patchUpdates(_0x49e209){return function(_0x413f04){try{jsonpatch[_0xe921('0x24')](_0x413f04,_0x49e209,!![]);}catch(_0x48f034){return BPromise['reject'](_0x48f034);}return _0x413f04[_0xe921('0x25')]();};}function saveUpdates(_0x34b0b2,_0xe3ec56){return function(_0x330895){if(_0x330895){return _0x330895['update'](_0x34b0b2)['then'](function(_0x282d5b){return _0x282d5b;});}return null;};}function removeEntity(_0x46ae5a,_0x15aeb8){return function(_0x47ba17){if(_0x47ba17){return _0x47ba17[_0xe921('0x26')]()['then'](function(){var _0x2d3eb4=_0x47ba17[_0xe921('0x27')]({'plain':!![]});var _0x3708bc='MusicOnHolds';return db[_0xe921('0x28')]['destroy']({'where':{'type':_0x3708bc,'resourceId':_0x2d3eb4['id']}})[_0xe921('0x29')](function(){return _0x47ba17;});})[_0xe921('0x29')](function(){_0x46ae5a[_0xe921('0x1b')](0xcc)[_0xe921('0x1c')]();});}};}function handleEntityNotFound(_0x2162da,_0x2f365a){return function(_0x33867c){if(!_0x33867c){_0x2162da['sendStatus'](0x194);}return _0x33867c;};}function handleError(_0x4f95f7,_0xa0b42c){_0xa0b42c=_0xa0b42c||0x1f4;return function(_0x28fba2){logger[_0xe921('0x2a')](_0x28fba2[_0xe921('0x2b')]);if(_0x28fba2['name']){delete _0x28fba2['name'];}_0x4f95f7['status'](_0xa0b42c)['send'](_0x28fba2);};}exports['index']=function(_0x2a9a3e,_0x594bee){var _0xeb0877={},_0x1b2f4a={},_0x21c260={'count':0x0,'rows':[]};var _0x4c6ff=_[_0xe921('0x2c')](db[_0xe921('0x2d')][_0xe921('0x2e')],function(_0x23a449){return{'name':_0x23a449[_0xe921('0x2f')],'type':_0x23a449['type'][_0xe921('0x30')]};});_0x1b2f4a[_0xe921('0x31')]=_[_0xe921('0x2c')](_0x4c6ff,_0xe921('0x32'));_0x1b2f4a[_0xe921('0x33')]=_[_0xe921('0x34')](_0x2a9a3e[_0xe921('0x33')]);_0x1b2f4a[_0xe921('0x35')]=_[_0xe921('0x36')](_0x1b2f4a[_0xe921('0x31')],_0x1b2f4a[_0xe921('0x33')]);_0xeb0877[_0xe921('0x37')]=_[_0xe921('0x36')](_0x1b2f4a[_0xe921('0x31')],qs[_0xe921('0x38')](_0x2a9a3e[_0xe921('0x33')][_0xe921('0x38')]));_0xeb0877['attributes']=_0xeb0877['attributes'][_0xe921('0x39')]?_0xeb0877['attributes']:_0x1b2f4a[_0xe921('0x31')];if(!_0x2a9a3e[_0xe921('0x33')][_0xe921('0x3a')](_0xe921('0x3b'))){_0xeb0877['limit']=qs[_0xe921('0x1e')](_0x2a9a3e['query'][_0xe921('0x1e')]);_0xeb0877[_0xe921('0x20')]=qs[_0xe921('0x20')](_0x2a9a3e[_0xe921('0x33')][_0xe921('0x20')]);}_0xeb0877['order']=qs[_0xe921('0x3c')](_0x2a9a3e[_0xe921('0x33')][_0xe921('0x3c')]);delete _0x2a9a3e[_0xe921('0x33')][_0xe921('0x3c')];_0xeb0877[_0xe921('0x3d')]=qs['filters'](_['pick'](_0x2a9a3e['query'],_0x1b2f4a[_0xe921('0x35')]),_0x4c6ff);if(_0x2a9a3e['query']['filter']){_0xeb0877[_0xe921('0x3d')]=_['merge'](_0xeb0877['where'],{'$or':_[_0xe921('0x2c')](_0x4c6ff,function(_0x5352b8){if(_0x5352b8[_0xe921('0x3e')]!==_0xe921('0x3f')){var _0x423ae0={};_0x423ae0[_0x5352b8[_0xe921('0x32')]]={'$like':'%'+_0x2a9a3e[_0xe921('0x33')][_0xe921('0x40')]+'%'};return _0x423ae0;}})});}_0xeb0877=_[_0xe921('0x41')]({},_0xeb0877,_0x2a9a3e['options']);var _0x56a771={'where':_0xeb0877[_0xe921('0x3d')]};return db['VoiceMusicOnHold'][_0xe921('0x1f')](_0x56a771)[_0xe921('0x29')](function(_0x2c85d9){_0x21c260[_0xe921('0x1f')]=_0x2c85d9;if(_0x2a9a3e[_0xe921('0x33')]['includeAll']){_0xeb0877[_0xe921('0x42')]=[{'all':!![]}];}return db[_0xe921('0x2d')]['findAll'](_0xeb0877);})[_0xe921('0x29')](function(_0x2fa865){_0x21c260[_0xe921('0x43')]=_0x2fa865;return _0x21c260;})[_0xe921('0x29')](respondWithFilteredResult(_0x594bee,_0xeb0877))[_0xe921('0x44')](handleError(_0x594bee,null));};exports[_0xe921('0x45')]=function(_0x58db79,_0x3c555f){var _0x1354b2={'raw':![],'where':{'id':_0x58db79[_0xe921('0x46')]['id']}},_0x4c0a32={};_0x4c0a32[_0xe921('0x31')]=_[_0xe921('0x34')](db[_0xe921('0x2d')][_0xe921('0x2e')]);_0x4c0a32['query']=_[_0xe921('0x34')](_0x58db79['query']);_0x4c0a32['filters']=_['intersection'](_0x4c0a32['model'],_0x4c0a32['query']);_0x1354b2[_0xe921('0x37')]=_[_0xe921('0x36')](_0x4c0a32[_0xe921('0x31')],qs[_0xe921('0x38')](_0x58db79[_0xe921('0x33')][_0xe921('0x38')]));_0x1354b2[_0xe921('0x37')]=_0x1354b2[_0xe921('0x37')][_0xe921('0x39')]?_0x1354b2['attributes']:_0x4c0a32[_0xe921('0x31')];if(_0x58db79[_0xe921('0x33')][_0xe921('0x47')]){_0x1354b2[_0xe921('0x42')]=[{'all':!![]}];}_0x1354b2=_['merge']({},_0x1354b2,_0x58db79[_0xe921('0x48')]);return db['VoiceMusicOnHold'][_0xe921('0x49')](_0x1354b2)['then'](handleEntityNotFound(_0x3c555f,null))[_0xe921('0x29')](respondWithResult(_0x3c555f,null))[_0xe921('0x44')](handleError(_0x3c555f,null));};exports[_0xe921('0x4a')]=function(_0x44ccfb,_0x10f5d7){if(_0x44ccfb[_0xe921('0x4b')]['id']){delete _0x44ccfb[_0xe921('0x4b')]['id'];}return db[_0xe921('0x2d')][_0xe921('0x49')]({'where':{'id':_0x44ccfb[_0xe921('0x46')]['id']}})[_0xe921('0x29')](handleEntityNotFound(_0x10f5d7,null))[_0xe921('0x29')](saveUpdates(_0x44ccfb[_0xe921('0x4b')],null))[_0xe921('0x29')](respondWithResult(_0x10f5d7,null))[_0xe921('0x44')](handleError(_0x10f5d7,null));};exports['create']=function(_0x599699,_0x125379,_0x362aa7){return db[_0xe921('0x4c')]['transaction'](function(_0x2ef8b6){if(_0x599699[_0xe921('0x4b')][_0xe921('0x4d')]===_0xe921('0x4e')){_0x599699[_0xe921('0x4b')][_0xe921('0x4f')]=path['join'](config[_0xe921('0x50')],_0xe921('0x51'),_0x599699[_0xe921('0x4b')][_0xe921('0x32')]);}return db['VoiceMusicOnHold'][_0xe921('0x52')](_0x599699['body'],{'transaction':_0x2ef8b6})[_0xe921('0x29')](function(_0x8e765a){if(_0x599699[_0xe921('0x4b')]['mode']==='files'){fs['mkdirSync'](_0x8e765a[_0xe921('0x4f')],parseInt('0777',0x8));}var _0x194391=_0x599699[_0xe921('0x53')][_0xe921('0x27')]({'plain':!![]});if(!_0x194391)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x194391[_0xe921('0x54')]==='user'){var _0x32eddb=_0x8e765a[_0xe921('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe921('0x55'),'userProfileId':_0x194391[_0xe921('0x56')]},'raw':!![]})[_0xe921('0x29')](function(_0x4232df){if(_0x4232df&&_0x4232df[_0xe921('0x57')]===0x0){return db[_0xe921('0x28')][_0xe921('0x52')]({'name':_0x32eddb['name'],'resourceId':_0x32eddb['id'],'type':_0x4232df[_0xe921('0x32')],'sectionId':_0x4232df['id']},{})[_0xe921('0x29')](function(){return _0x8e765a;});}else{return _0x8e765a;}})[_0xe921('0x44')](function(_0x30afd7){logger[_0xe921('0x2a')](_0xe921('0x58'),_0x30afd7);});}return _0x8e765a;});})[_0xe921('0x29')](respondWithResult(_0x125379,0xc9))[_0xe921('0x44')](handleError(_0x125379,null));};exports[_0xe921('0x26')]=function(_0xc606a4,_0x44646d,_0x3b1d71){var _0x598a3d;return db[_0xe921('0x2d')][_0xe921('0x49')]({'where':{'id':_0xc606a4['params']['id']}})[_0xe921('0x29')](function(_0x1caa3a){if(_0x1caa3a){return db[_0xe921('0x4c')][_0xe921('0x59')](function(_0xbaa00e){return _0x1caa3a[_0xe921('0x26')]({'transaction':_0xbaa00e,'raw':!![]})[_0xe921('0x29')](function(_0x367e8a){if(_0x367e8a[_0xe921('0x4f')]){fs[_0xe921('0x5a')](_0x367e8a[_0xe921('0x4f')])['forEach'](function(_0x510952){fs[_0xe921('0x5b')](path[_0xe921('0x5c')](_0x367e8a['directory'],_0x510952));});fs[_0xe921('0x5d')](_0x367e8a[_0xe921('0x4f')]);}return _0x367e8a;});})[_0xe921('0x44')](function(_0x4022af){throw new db[(_0xe921('0x5e'))][(_0xe921('0x5f'))](_0x4022af['message']);});}})['then'](handleEntityNotFound(_0x44646d,null))[_0xe921('0x29')](removeEntity(_0x44646d,null))['catch'](handleError(_0x44646d,null));};exports['addSound']=function(_0x461c84,_0x5ad224,_0x587138){return db[_0xe921('0x4c')][_0xe921('0x59')](function(_0x1ab6c){var _0x400213;return db[_0xe921('0x2d')][_0xe921('0x49')]({'where':{'id':_0x461c84[_0xe921('0x46')]['id']}})[_0xe921('0x29')](function(_0x2c9677){if(_0x2c9677){_0x400213=_0x2c9677;return _0x2c9677[_0xe921('0x60')](_0x461c84[_0xe921('0x4b')]['id'],{'transaction':_0x1ab6c});}})[_0xe921('0x29')](function(_0x3704d9){if(_0x3704d9){return db[_0xe921('0x61')]['findOne']({'where':{'id':_0x461c84['body']['id']},'attributes':['id','name',_0xe921('0x62'),_0xe921('0x63'),_0xe921('0x64')],'raw':!![]});}})[_0xe921('0x29')](function(_0xc27b7d){if(_0xc27b7d){var _0x6c2083=path[_0xe921('0x5c')](config['root'],_0xe921('0x65'),util[_0xe921('0x66')](_0xe921('0x67'),path[_0xe921('0x68')](_0xc27b7d[_0xe921('0x62')],path['extname'](_0xc27b7d[_0xe921('0x62')])),_0xc27b7d[_0xe921('0x63')]));var _0x277b2b=path[_0xe921('0x5c')](config[_0xe921('0x50')],'server/files/moh',_0x400213[_0xe921('0x32')],util[_0xe921('0x66')]('%s.%s',_0xc27b7d[_0xe921('0x32')],_0xc27b7d['converted_format']));fs['symlinkSync'](_0x6c2083,_0x277b2b);return _0xc27b7d;}})[_0xe921('0x44')](function(_0x2a9982){throw new db[(_0xe921('0x5e'))]['ValidationError'](_0x2a9982['message']);});})['then'](handleEntityNotFound(_0x5ad224,null))[_0xe921('0x29')](respondWithResult(_0x5ad224,0xc9))[_0xe921('0x44')](handleError(_0x5ad224,null));};exports['removeSound']=function(_0x92de7b,_0x3c2233,_0x290e59){return db['sequelize'][_0xe921('0x59')](function(_0x760dc0){var _0x5a2485;return db[_0xe921('0x2d')][_0xe921('0x69')]({'where':{'id':_0x92de7b[_0xe921('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c2233,null))[_0xe921('0x29')](function(_0x3cd342){if(_0x3cd342){_0x5a2485=_0x3cd342;return _0x3cd342['removeSound'](_0x92de7b[_0xe921('0x46')]['id2']);}})[_0xe921('0x29')](function(_0x5c0a22){if(_0x5c0a22){return db[_0xe921('0x61')]['findOne']({'where':{'id':_0x92de7b[_0xe921('0x46')][_0xe921('0x6a')]},'attributes':['id',_0xe921('0x32'),'save_name',_0xe921('0x63'),_0xe921('0x64')],'raw':!![]});}})[_0xe921('0x29')](function(_0x464043){if(_0x464043){fs['unlinkSync'](path[_0xe921('0x5c')](_0x5a2485[_0xe921('0x4f')],util['format'](_0xe921('0x67'),_0x464043[_0xe921('0x32')],_0x464043[_0xe921('0x63')])));return _0x464043;}})['catch'](function(_0x5ea950){throw new db['Sequelize'][(_0xe921('0x5f'))](_0x5ea950[_0xe921('0x6b')]);});})['then'](handleEntityNotFound(_0x3c2233,null))['then'](respondWithStatusCode(_0x3c2233,0xcc))['catch'](handleError(_0x3c2233,null));};exports[_0xe921('0x6c')]=function(_0x136a4b,_0x337b26,_0x2dfc3e){var _0x36304a={};var _0x4e51ce={};var _0x4151f0;var _0x3a311a;return db[_0xe921('0x2d')][_0xe921('0x69')]({'where':{'id':_0x136a4b[_0xe921('0x46')]['id']}})['then'](handleEntityNotFound(_0x337b26,null))['then'](function(_0x4c63b9){if(_0x4c63b9){_0x4151f0=_0x4c63b9;_0x4e51ce[_0xe921('0x31')]=_[_0xe921('0x34')](db['Sound']['rawAttributes']);_0x4e51ce[_0xe921('0x33')]=_[_0xe921('0x34')](_0x136a4b['query']);_0x4e51ce[_0xe921('0x35')]=_[_0xe921('0x36')](_0x4e51ce['model'],_0x4e51ce['query']);_0x36304a[_0xe921('0x37')]=_[_0xe921('0x36')](_0x4e51ce['model'],qs[_0xe921('0x38')](_0x136a4b['query'][_0xe921('0x38')]));_0x36304a[_0xe921('0x37')]=_0x36304a[_0xe921('0x37')][_0xe921('0x39')]?_0x36304a['attributes']:_0x4e51ce['model'];_0x36304a[_0xe921('0x6d')]=qs[_0xe921('0x3c')](_0x136a4b[_0xe921('0x33')]['sort']);_0x36304a[_0xe921('0x3d')]=qs[_0xe921('0x35')](_[_0xe921('0x6e')](_0x136a4b[_0xe921('0x33')],_0x4e51ce['filters']));if(_0x136a4b['query']['filter']){_0x36304a[_0xe921('0x3d')]=_[_0xe921('0x41')](_0x36304a[_0xe921('0x3d')],{'$or':_[_0xe921('0x2c')](_0x36304a[_0xe921('0x37')],function(_0x1dc95e){var _0x1df99b={};_0x1df99b[_0x1dc95e]={'$like':'%'+_0x136a4b[_0xe921('0x33')][_0xe921('0x40')]+'%'};return _0x1df99b;})});}_0x36304a=_['merge']({},_0x36304a,_0x136a4b[_0xe921('0x48')]);return _0x4151f0[_0xe921('0x6c')](_0x36304a);}})[_0xe921('0x29')](function(_0x123ecb){if(_0x123ecb){_0x3a311a=_0x123ecb[_0xe921('0x39')];if(!_0x136a4b[_0xe921('0x33')][_0xe921('0x3a')]('nolimit')){_0x36304a['limit']=qs['limit'](_0x136a4b[_0xe921('0x33')][_0xe921('0x1e')]);_0x36304a[_0xe921('0x20')]=qs[_0xe921('0x20')](_0x136a4b[_0xe921('0x33')][_0xe921('0x20')]);}return _0x4151f0[_0xe921('0x6c')](_0x36304a);}})[_0xe921('0x29')](function(_0x15c3cf){if(_0x15c3cf){return _0x15c3cf?{'count':_0x3a311a,'rows':_0x15c3cf}:null;}})[_0xe921('0x29')](respondWithResult(_0x337b26,null))['catch'](handleError(_0x337b26,null));}; \ No newline at end of file +var _0x990f=['apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','body','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','sequelize','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','message','removeSound','findOne','id2','order','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0xed6ed0,_0x28e1ad){var _0x20a428=function(_0x5b2603){while(--_0x5b2603){_0xed6ed0['push'](_0xed6ed0['shift']());}};_0x20a428(++_0x28e1ad);}(_0x990f,0xbe));var _0xf990=function(_0x42dc6d,_0x42f28e){_0x42dc6d=_0x42dc6d-0x0;var _0x403779=_0x990f[_0x42dc6d];return _0x403779;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf990('0x0'));var jsonpatch=require(_0xf990('0x1'));var rp=require(_0xf990('0x2'));var moment=require(_0xf990('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf990('0x4'));var util=require(_0xf990('0x5'));var path=require('path');var sox=require(_0xf990('0x6'));var csv=require(_0xf990('0x7'));var ejs=require(_0xf990('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf990('0x9'));var squel=require(_0xf990('0xa'));var crypto=require(_0xf990('0xb'));var jsforce=require(_0xf990('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf990('0xd'));var Redis=require(_0xf990('0xe'));var authService=require(_0xf990('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf990('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf990('0x11'))(_0xf990('0x12'));var utils=require('../../config/utils');var config=require(_0xf990('0x13'));var licenseUtil=require(_0xf990('0x14'));var db=require(_0xf990('0x15'))['db'];function respondWithStatusCode(_0x1b5a09,_0x1f4446){_0x1f4446=_0x1f4446||0xcc;return function(_0x46b6cf){if(_0x46b6cf){return _0x1b5a09[_0xf990('0x16')](_0x1f4446);}return _0x1b5a09[_0xf990('0x17')](_0x1f4446)[_0xf990('0x18')]();};}function respondWithResult(_0x47a6d0,_0x2ae2c8){_0x2ae2c8=_0x2ae2c8||0xc8;return function(_0x63a669){if(_0x63a669){return _0x47a6d0[_0xf990('0x17')](_0x2ae2c8)['json'](_0x63a669);}};}function respondWithFilteredResult(_0x112289,_0x3dede5){return function(_0x1a6c3f){if(_0x1a6c3f){var _0x1c833f=typeof _0x3dede5[_0xf990('0x19')]===_0xf990('0x1a')&&typeof _0x3dede5[_0xf990('0x1b')]===_0xf990('0x1a');var _0x509249=_0x1a6c3f[_0xf990('0x1c')];var _0x5b1130=_0x1c833f?0x0:_0x3dede5['offset'];var _0x263907=_0x1c833f?_0x1a6c3f[_0xf990('0x1c')]:_0x3dede5['offset']+_0x3dede5[_0xf990('0x1b')];var _0x35cd30;if(_0x263907>=_0x509249){_0x263907=_0x509249;_0x35cd30=0xc8;}else{_0x35cd30=0xce;}_0x112289['status'](_0x35cd30);return _0x112289[_0xf990('0x1d')](_0xf990('0x1e'),_0x5b1130+'-'+_0x263907+'/'+_0x509249)[_0xf990('0x1f')](_0x1a6c3f);}return null;};}function patchUpdates(_0x20b4a9){return function(_0x55003b){try{jsonpatch[_0xf990('0x20')](_0x55003b,_0x20b4a9,!![]);}catch(_0x2b9101){return BPromise[_0xf990('0x21')](_0x2b9101);}return _0x55003b['save']();};}function saveUpdates(_0x4f1487,_0x353090){return function(_0x11e6f9){if(_0x11e6f9){return _0x11e6f9[_0xf990('0x22')](_0x4f1487)[_0xf990('0x23')](function(_0x1c8c86){return _0x1c8c86;});}return null;};}function removeEntity(_0x589e0a,_0x4a7acd){return function(_0x3884f4){if(_0x3884f4){return _0x3884f4[_0xf990('0x24')]()[_0xf990('0x23')](function(){var _0x369be3=_0x3884f4[_0xf990('0x25')]({'plain':!![]});var _0xabd96a=_0xf990('0x26');return db[_0xf990('0x27')][_0xf990('0x24')]({'where':{'type':_0xabd96a,'resourceId':_0x369be3['id']}})[_0xf990('0x23')](function(){return _0x3884f4;});})[_0xf990('0x23')](function(){_0x589e0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d61fd,_0x24f617){return function(_0x29904f){if(!_0x29904f){_0x1d61fd[_0xf990('0x16')](0x194);}return _0x29904f;};}function handleError(_0x54e77e,_0x3e92d1){_0x3e92d1=_0x3e92d1||0x1f4;return function(_0x33fbe3){logger[_0xf990('0x28')](_0x33fbe3[_0xf990('0x29')]);if(_0x33fbe3[_0xf990('0x2a')]){delete _0x33fbe3[_0xf990('0x2a')];}_0x54e77e[_0xf990('0x17')](_0x3e92d1)['send'](_0x33fbe3);};}exports[_0xf990('0x2b')]=function(_0x274a9b,_0x248c81){var _0x35069e={},_0x1654c5={},_0x856f72={'count':0x0,'rows':[]};var _0x5c5051=_['map'](db[_0xf990('0x2c')][_0xf990('0x2d')],function(_0x101829){return{'name':_0x101829[_0xf990('0x2e')],'type':_0x101829[_0xf990('0x2f')]['key']};});_0x1654c5[_0xf990('0x30')]=_['map'](_0x5c5051,_0xf990('0x2a'));_0x1654c5[_0xf990('0x31')]=_[_0xf990('0x32')](_0x274a9b[_0xf990('0x31')]);_0x1654c5['filters']=_[_0xf990('0x33')](_0x1654c5[_0xf990('0x30')],_0x1654c5['query']);_0x35069e['attributes']=_[_0xf990('0x33')](_0x1654c5[_0xf990('0x30')],qs[_0xf990('0x34')](_0x274a9b[_0xf990('0x31')][_0xf990('0x34')]));_0x35069e[_0xf990('0x35')]=_0x35069e['attributes'][_0xf990('0x36')]?_0x35069e[_0xf990('0x35')]:_0x1654c5[_0xf990('0x30')];if(!_0x274a9b[_0xf990('0x31')]['hasOwnProperty'](_0xf990('0x37'))){_0x35069e['limit']=qs[_0xf990('0x1b')](_0x274a9b['query'][_0xf990('0x1b')]);_0x35069e[_0xf990('0x19')]=qs[_0xf990('0x19')](_0x274a9b[_0xf990('0x31')][_0xf990('0x19')]);}_0x35069e['order']=qs[_0xf990('0x38')](_0x274a9b[_0xf990('0x31')]['sort']);delete _0x274a9b[_0xf990('0x31')]['sort'];_0x35069e[_0xf990('0x39')]=qs[_0xf990('0x3a')](_[_0xf990('0x3b')](_0x274a9b['query'],_0x1654c5[_0xf990('0x3a')]),_0x5c5051);if(_0x274a9b[_0xf990('0x31')][_0xf990('0x3c')]){_0x35069e[_0xf990('0x39')]=_[_0xf990('0x3d')](_0x35069e[_0xf990('0x39')],{'$or':_[_0xf990('0x3e')](_0x5c5051,function(_0x58cd58){if(_0x58cd58[_0xf990('0x2f')]!==_0xf990('0x3f')){var _0x4f32cd={};_0x4f32cd[_0x58cd58[_0xf990('0x2a')]]={'$like':'%'+_0x274a9b[_0xf990('0x31')][_0xf990('0x3c')]+'%'};return _0x4f32cd;}})});}_0x35069e=_['merge']({},_0x35069e,_0x274a9b[_0xf990('0x40')]);var _0x5526dd={'where':_0x35069e[_0xf990('0x39')]};return db['VoiceMusicOnHold'][_0xf990('0x1c')](_0x5526dd)[_0xf990('0x23')](function(_0x4036f1){_0x856f72[_0xf990('0x1c')]=_0x4036f1;if(_0x274a9b['query'][_0xf990('0x41')]){_0x35069e['include']=[{'all':!![]}];}return db[_0xf990('0x2c')][_0xf990('0x42')](_0x35069e);})[_0xf990('0x23')](function(_0x2521af){_0x856f72[_0xf990('0x43')]=_0x2521af;return _0x856f72;})[_0xf990('0x23')](respondWithFilteredResult(_0x248c81,_0x35069e))[_0xf990('0x44')](handleError(_0x248c81,null));};exports[_0xf990('0x45')]=function(_0x572450,_0x1e2973){var _0x11e193={'raw':![],'where':{'id':_0x572450[_0xf990('0x46')]['id']}},_0x313dd7={};_0x313dd7[_0xf990('0x30')]=_['keys'](db[_0xf990('0x2c')][_0xf990('0x2d')]);_0x313dd7[_0xf990('0x31')]=_['keys'](_0x572450['query']);_0x313dd7[_0xf990('0x3a')]=_['intersection'](_0x313dd7[_0xf990('0x30')],_0x313dd7[_0xf990('0x31')]);_0x11e193[_0xf990('0x35')]=_[_0xf990('0x33')](_0x313dd7[_0xf990('0x30')],qs[_0xf990('0x34')](_0x572450['query'][_0xf990('0x34')]));_0x11e193[_0xf990('0x35')]=_0x11e193[_0xf990('0x35')][_0xf990('0x36')]?_0x11e193['attributes']:_0x313dd7[_0xf990('0x30')];if(_0x572450[_0xf990('0x31')][_0xf990('0x41')]){_0x11e193['include']=[{'all':!![]}];}_0x11e193=_[_0xf990('0x3d')]({},_0x11e193,_0x572450['options']);return db[_0xf990('0x2c')][_0xf990('0x47')](_0x11e193)[_0xf990('0x23')](handleEntityNotFound(_0x1e2973,null))[_0xf990('0x23')](respondWithResult(_0x1e2973,null))[_0xf990('0x44')](handleError(_0x1e2973,null));};exports[_0xf990('0x22')]=function(_0x577e91,_0x1878d2){if(_0x577e91[_0xf990('0x48')]['id']){delete _0x577e91[_0xf990('0x48')]['id'];}return db[_0xf990('0x2c')][_0xf990('0x47')]({'where':{'id':_0x577e91['params']['id']}})['then'](handleEntityNotFound(_0x1878d2,null))[_0xf990('0x23')](saveUpdates(_0x577e91[_0xf990('0x48')],null))['then'](respondWithResult(_0x1878d2,null))[_0xf990('0x44')](handleError(_0x1878d2,null));};exports['create']=function(_0x269b74,_0x2f86f5,_0x5dd675){return db['sequelize'][_0xf990('0x49')](function(_0x38d90e){if(_0x269b74[_0xf990('0x48')][_0xf990('0x4a')]===_0xf990('0x4b')){_0x269b74[_0xf990('0x48')][_0xf990('0x4c')]=path['join'](config[_0xf990('0x4d')],_0xf990('0x4e'),_0x269b74[_0xf990('0x48')][_0xf990('0x2a')]);}return db[_0xf990('0x2c')]['create'](_0x269b74[_0xf990('0x48')],{'transaction':_0x38d90e})[_0xf990('0x23')](function(_0x3e8443){if(_0x269b74[_0xf990('0x48')][_0xf990('0x4a')]===_0xf990('0x4b')){fs[_0xf990('0x4f')](_0x3e8443[_0xf990('0x4c')],parseInt(_0xf990('0x50'),0x8));}var _0x1b291a=_0x269b74['user'][_0xf990('0x25')]({'plain':!![]});if(!_0x1b291a)throw new Error(_0xf990('0x51'));if(_0x1b291a[_0xf990('0x52')]===_0xf990('0x53')){var _0xe2968c=_0x3e8443[_0xf990('0x25')]({'plain':!![]});return db[_0xf990('0x54')][_0xf990('0x47')]({'where':{'name':_0xf990('0x26'),'userProfileId':_0x1b291a[_0xf990('0x55')]},'raw':!![]})[_0xf990('0x23')](function(_0x3f3056){if(_0x3f3056&&_0x3f3056[_0xf990('0x56')]===0x0){return db[_0xf990('0x27')][_0xf990('0x57')]({'name':_0xe2968c['name'],'resourceId':_0xe2968c['id'],'type':_0x3f3056[_0xf990('0x2a')],'sectionId':_0x3f3056['id']},{})[_0xf990('0x23')](function(){return _0x3e8443;});}else{return _0x3e8443;}})[_0xf990('0x44')](function(_0x1771ca){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1771ca);});}return _0x3e8443;});})[_0xf990('0x23')](respondWithResult(_0x2f86f5,0xc9))[_0xf990('0x44')](handleError(_0x2f86f5,null));};exports[_0xf990('0x24')]=function(_0x336a7d,_0x4b3060,_0x328b85){var _0x14bb45;return db['VoiceMusicOnHold'][_0xf990('0x47')]({'where':{'id':_0x336a7d[_0xf990('0x46')]['id']}})[_0xf990('0x23')](function(_0xfbb25e){if(_0xfbb25e){return db[_0xf990('0x58')]['transaction'](function(_0x51b387){return _0xfbb25e[_0xf990('0x24')]({'transaction':_0x51b387,'raw':!![]})[_0xf990('0x23')](function(_0x184e32){if(_0x184e32['directory']){fs[_0xf990('0x59')](_0x184e32[_0xf990('0x4c')])[_0xf990('0x5a')](function(_0x4c3f2e){fs[_0xf990('0x5b')](path['join'](_0x184e32['directory'],_0x4c3f2e));});fs['rmdirSync'](_0x184e32[_0xf990('0x4c')]);}return _0x184e32;});})[_0xf990('0x44')](function(_0x5496d3){throw new db[(_0xf990('0x5c'))][(_0xf990('0x5d'))](_0x5496d3['message']);});}})['then'](handleEntityNotFound(_0x4b3060,null))[_0xf990('0x23')](removeEntity(_0x4b3060,null))[_0xf990('0x44')](handleError(_0x4b3060,null));};exports[_0xf990('0x5e')]=function(_0x475f16,_0x4798f9,_0x36a1d0){return db[_0xf990('0x58')][_0xf990('0x49')](function(_0x4d6a04){var _0x5d44df;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x475f16['params']['id']}})[_0xf990('0x23')](function(_0x1aa561){if(_0x1aa561){_0x5d44df=_0x1aa561;return _0x1aa561[_0xf990('0x5e')](_0x475f16[_0xf990('0x48')]['id'],{'transaction':_0x4d6a04});}})[_0xf990('0x23')](function(_0x488e97){if(_0x488e97){return db[_0xf990('0x5f')]['findOne']({'where':{'id':_0x475f16[_0xf990('0x48')]['id']},'attributes':['id',_0xf990('0x2a'),_0xf990('0x60'),_0xf990('0x61'),_0xf990('0x62')],'raw':!![]});}})[_0xf990('0x23')](function(_0x339dbc){if(_0x339dbc){var _0x46b45e=path[_0xf990('0x63')](config[_0xf990('0x4d')],_0xf990('0x64'),util[_0xf990('0x65')](_0xf990('0x66'),path[_0xf990('0x67')](_0x339dbc[_0xf990('0x60')],path['extname'](_0x339dbc[_0xf990('0x60')])),_0x339dbc['converted_format']));var _0x173c65=path[_0xf990('0x63')](config[_0xf990('0x4d')],_0xf990('0x4e'),_0x5d44df[_0xf990('0x2a')],util[_0xf990('0x65')]('%s.%s',_0x339dbc['name'],_0x339dbc[_0xf990('0x61')]));fs[_0xf990('0x68')](_0x46b45e,_0x173c65);return _0x339dbc;}})[_0xf990('0x44')](function(_0x3a17ba){throw new db[(_0xf990('0x5c'))][(_0xf990('0x5d'))](_0x3a17ba[_0xf990('0x69')]);});})['then'](handleEntityNotFound(_0x4798f9,null))[_0xf990('0x23')](respondWithResult(_0x4798f9,0xc9))[_0xf990('0x44')](handleError(_0x4798f9,null));};exports[_0xf990('0x6a')]=function(_0x1d7101,_0x5a81ae,_0x37454c){return db[_0xf990('0x58')][_0xf990('0x49')](function(_0x34aea0){var _0x3b42d6;return db[_0xf990('0x2c')][_0xf990('0x6b')]({'where':{'id':_0x1d7101[_0xf990('0x46')]['id']}})[_0xf990('0x23')](handleEntityNotFound(_0x5a81ae,null))[_0xf990('0x23')](function(_0x129603){if(_0x129603){_0x3b42d6=_0x129603;return _0x129603[_0xf990('0x6a')](_0x1d7101['params']['id2']);}})['then'](function(_0x27fd5d){if(_0x27fd5d){return db[_0xf990('0x5f')][_0xf990('0x6b')]({'where':{'id':_0x1d7101['params'][_0xf990('0x6c')]},'attributes':['id',_0xf990('0x2a'),_0xf990('0x60'),'converted_format','createdAt'],'raw':!![]});}})[_0xf990('0x23')](function(_0x82ae59){if(_0x82ae59){fs[_0xf990('0x5b')](path[_0xf990('0x63')](_0x3b42d6[_0xf990('0x4c')],util['format'](_0xf990('0x66'),_0x82ae59[_0xf990('0x2a')],_0x82ae59[_0xf990('0x61')])));return _0x82ae59;}})[_0xf990('0x44')](function(_0x4f3b0f){throw new db['Sequelize']['ValidationError'](_0x4f3b0f[_0xf990('0x69')]);});})[_0xf990('0x23')](handleEntityNotFound(_0x5a81ae,null))[_0xf990('0x23')](respondWithStatusCode(_0x5a81ae,0xcc))[_0xf990('0x44')](handleError(_0x5a81ae,null));};exports['getSounds']=function(_0x1a9c02,_0x3c0a69,_0x1d8c7b){var _0x2477d1={};var _0x1afd9={};var _0x31031d;var _0x193d66;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x1a9c02['params']['id']}})[_0xf990('0x23')](handleEntityNotFound(_0x3c0a69,null))[_0xf990('0x23')](function(_0x2aeab2){if(_0x2aeab2){_0x31031d=_0x2aeab2;_0x1afd9[_0xf990('0x30')]=_[_0xf990('0x32')](db['Sound'][_0xf990('0x2d')]);_0x1afd9[_0xf990('0x31')]=_[_0xf990('0x32')](_0x1a9c02['query']);_0x1afd9[_0xf990('0x3a')]=_['intersection'](_0x1afd9['model'],_0x1afd9[_0xf990('0x31')]);_0x2477d1[_0xf990('0x35')]=_['intersection'](_0x1afd9['model'],qs[_0xf990('0x34')](_0x1a9c02['query'][_0xf990('0x34')]));_0x2477d1['attributes']=_0x2477d1[_0xf990('0x35')][_0xf990('0x36')]?_0x2477d1['attributes']:_0x1afd9[_0xf990('0x30')];_0x2477d1[_0xf990('0x6d')]=qs[_0xf990('0x38')](_0x1a9c02[_0xf990('0x31')][_0xf990('0x38')]);_0x2477d1[_0xf990('0x39')]=qs[_0xf990('0x3a')](_[_0xf990('0x3b')](_0x1a9c02['query'],_0x1afd9[_0xf990('0x3a')]));if(_0x1a9c02[_0xf990('0x31')][_0xf990('0x3c')]){_0x2477d1['where']=_['merge'](_0x2477d1['where'],{'$or':_[_0xf990('0x3e')](_0x2477d1['attributes'],function(_0x5df166){var _0x152e70={};_0x152e70[_0x5df166]={'$like':'%'+_0x1a9c02[_0xf990('0x31')][_0xf990('0x3c')]+'%'};return _0x152e70;})});}_0x2477d1=_[_0xf990('0x3d')]({},_0x2477d1,_0x1a9c02[_0xf990('0x40')]);return _0x31031d['getSounds'](_0x2477d1);}})[_0xf990('0x23')](function(_0x7c2cc8){if(_0x7c2cc8){_0x193d66=_0x7c2cc8['length'];if(!_0x1a9c02[_0xf990('0x31')][_0xf990('0x6e')]('nolimit')){_0x2477d1['limit']=qs[_0xf990('0x1b')](_0x1a9c02[_0xf990('0x31')][_0xf990('0x1b')]);_0x2477d1['offset']=qs[_0xf990('0x19')](_0x1a9c02[_0xf990('0x31')][_0xf990('0x19')]);}return _0x31031d['getSounds'](_0x2477d1);}})[_0xf990('0x23')](function(_0x3e0742){if(_0x3e0742){return _0x3e0742?{'count':_0x193d66,'rows':_0x3e0742}:null;}})[_0xf990('0x23')](respondWithResult(_0x3c0a69,null))[_0xf990('0x44')](handleError(_0x3c0a69,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index f45ebdd..17faba2 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 _0x8426=['rimraf','../../config/environment','exports','define','voice_musiconhold','lodash','util','moment','bluebird','request-promise','path'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x8426,0x15a));var _0x6842=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x8426[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x6842('0x0'));var util=require(_0x6842('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6842('0x2'));var BPromise=require(_0x6842('0x3'));var rp=require(_0x6842('0x4'));var fs=require('fs');var path=require(_0x6842('0x5'));var rimraf=require(_0x6842('0x6'));var config=require(_0x6842('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x6842('0x8')]=function(_0x12d86a,_0x2686df){return _0x12d86a[_0x6842('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x6842('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x517e=['exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5c986a,_0xac38a4){var _0x11bda8=function(_0x2c8a90){while(--_0x2c8a90){_0x5c986a['push'](_0x5c986a['shift']());}};_0x11bda8(++_0xac38a4);}(_0x517e,0x87));var _0xe517=function(_0xf1d26c,_0x1463d0){_0xf1d26c=_0xf1d26c-0x0;var _0x11c159=_0x517e[_0xf1d26c];return _0x11c159;};'use strict';var _=require(_0xe517('0x0'));var util=require(_0xe517('0x1'));var logger=require(_0xe517('0x2'))(_0xe517('0x3'));var moment=require('moment');var BPromise=require(_0xe517('0x4'));var rp=require(_0xe517('0x5'));var fs=require('fs');var path=require(_0xe517('0x6'));var rimraf=require(_0xe517('0x7'));var config=require(_0xe517('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xe517('0x9')]=function(_0x31df91,_0x54ebb2){return _0x31df91['define'](_0xe517('0xa'),attributes,{'tableName':_0xe517('0xb'),'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 4ebf0e1..dc431f8 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x96453f,_0x2424f3){var _0x4b2a38=function(_0x3efea3){while(--_0x3efea3){_0x96453f['push'](_0x96453f['shift']());}};_0x4b2a38(++_0x2424f3);}(_0x34e8,0x12c));var _0x834e=function(_0x210597,_0x15b8d0){_0x210597=_0x210597-0x0;var _0x3b444d=_0x34e8[_0x210597];return _0x3b444d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e561f,_0x5749ab){var _0x4e9703=function(_0x3499b7){while(--_0x3499b7){_0x5e561f['push'](_0x5e561f['shift']());}};_0x4e9703(++_0x5749ab);}(_0xe706,0xa3));var _0x6e70=function(_0x1dd997,_0x578bf5){_0x1dd997=_0x1dd997-0x0;var _0x440e4b=_0xe706[_0x1dd997];return _0x440e4b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 4caf811..94b1439 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 _0x40c2=['post','addAgents','addTeams','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','/:id/teams','getTeams'];(function(_0x366c34,_0x499049){var _0x423165=function(_0x146552){while(--_0x146552){_0x366c34['push'](_0x366c34['shift']());}};_0x423165(++_0x499049);}(_0x40c2,0x10d));var _0x240c=function(_0x2283aa,_0xad1438){_0x2283aa=_0x2283aa-0x0;var _0x4635b3=_0x40c2[_0x2283aa];return _0x4635b3;};'use strict';var multer=require('multer');var util=require(_0x240c('0x0'));var path=require(_0x240c('0x1'));var timeout=require(_0x240c('0x2'));var express=require(_0x240c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x240c('0x4'));var interaction=require(_0x240c('0x5'));var config=require(_0x240c('0x6'));var controller=require(_0x240c('0x7'));router[_0x240c('0x8')]('/',auth[_0x240c('0x9')](),controller[_0x240c('0xa')]);router['get'](_0x240c('0xb'),auth[_0x240c('0x9')](),controller[_0x240c('0xc')]);router[_0x240c('0x8')](_0x240c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x240c('0x8')](_0x240c('0xe'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x240c('0xf'),auth[_0x240c('0x9')](),controller[_0x240c('0x10')]);router[_0x240c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x240c('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x240c('0x12')]);router[_0x240c('0x11')](_0x240c('0xf'),auth[_0x240c('0x9')](),controller[_0x240c('0x13')]);router[_0x240c('0x14')]('/:id',auth[_0x240c('0x9')](),controller[_0x240c('0x15')]);router[_0x240c('0x16')](_0x240c('0xd'),auth[_0x240c('0x9')](),controller[_0x240c('0x17')]);router[_0x240c('0x16')](_0x240c('0xe'),auth[_0x240c('0x9')](),controller[_0x240c('0x18')]);router[_0x240c('0x16')]('/:id/teams',auth[_0x240c('0x9')](),controller['removeTeams']);module[_0x240c('0x19')]=router; \ No newline at end of file +var _0x5f90=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/teams','post','/:id/users','addAgents','put','delete','/:id','destroy','removeAgents','removeTeams','exports','multer'];(function(_0x1949fe,_0x4ed8ed){var _0x4333f6=function(_0x3d7ebf){while(--_0x3d7ebf){_0x1949fe['push'](_0x1949fe['shift']());}};_0x4333f6(++_0x4ed8ed);}(_0x5f90,0xae));var _0x05f9=function(_0x244bbb,_0x17877e){_0x244bbb=_0x244bbb-0x0;var _0x10b074=_0x5f90[_0x244bbb];return _0x10b074;};'use strict';var multer=require(_0x05f9('0x0'));var util=require('util');var path=require(_0x05f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x05f9('0x2'));var router=express['Router']();var fs_extra=require(_0x05f9('0x3'));var auth=require(_0x05f9('0x4'));var interaction=require(_0x05f9('0x5'));var config=require(_0x05f9('0x6'));var controller=require(_0x05f9('0x7'));router['get']('/',auth[_0x05f9('0x8')](),controller[_0x05f9('0x9')]);router[_0x05f9('0xa')](_0x05f9('0xb'),auth[_0x05f9('0x8')](),controller[_0x05f9('0xc')]);router['get']('/:id',auth[_0x05f9('0x8')](),controller[_0x05f9('0xd')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x05f9('0xe'),auth[_0x05f9('0x8')](),controller['getTeams']);router['post']('/',auth[_0x05f9('0x8')](),controller['create']);router[_0x05f9('0xf')](_0x05f9('0x10'),auth[_0x05f9('0x8')](),controller[_0x05f9('0x11')]);router[_0x05f9('0xf')](_0x05f9('0xe'),auth[_0x05f9('0x8')](),controller['addTeams']);router[_0x05f9('0x12')]('/:id',auth[_0x05f9('0x8')](),controller['update']);router[_0x05f9('0x13')](_0x05f9('0x14'),auth['isAuthenticated'](),controller[_0x05f9('0x15')]);router[_0x05f9('0x13')](_0x05f9('0x10'),auth[_0x05f9('0x8')](),controller[_0x05f9('0x16')]);router['delete']('/:id/teams',auth[_0x05f9('0x8')](),controller[_0x05f9('0x17')]);module[_0x05f9('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 7dbe69d..330812f 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 _0x193a=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x426784,_0x2870d6){var _0x606b78=function(_0x1e715d){while(--_0x1e715d){_0x426784['push'](_0x426784['shift']());}};_0x606b78(++_0x2870d6);}(_0x193a,0x92));var _0xa193=function(_0x20a6ae,_0x32a071){_0x20a6ae=_0x20a6ae-0x0;var _0x5ea721=_0x193a[_0x20a6ae];return _0x5ea721;};'use strict';var Sequelize=require(_0xa193('0x0'));module[_0xa193('0x1')]={'name':{'type':Sequelize[_0xa193('0x2')],'allowNull':![],'unique':_0xa193('0x3')},'prefix':{'type':Sequelize[_0xa193('0x4')],'get':function(_0x5a36a3){return _0xa193('0x5')+this[_0xa193('0x6')](_0xa193('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xa193('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xa193('0x7')]}}; \ No newline at end of file +var _0x4725=['name','system-','getDataValue','INTEGER','STRING'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0x4725,0xdb));var _0x5472=function(_0x57b127,_0x2ebdef){_0x57b127=_0x57b127-0x0;var _0x2cee9e=_0x4725[_0x57b127];return _0x2cee9e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5472('0x0')],'allowNull':![],'unique':_0x5472('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x317014){return _0x5472('0x2')+this[_0x5472('0x3')](_0x5472('0x1'))+'-';}},'description':{'type':Sequelize[_0x5472('0x0')]},'callerIdAll':{'type':Sequelize[_0x5472('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0x5472('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 61ab334..9b6317a 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 _0x351d=['isEmpty','forEach','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','VoicePrefixes','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','VoicePrefix','findAll','catch','show','params','length','merge','options','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','CDR(prefix)=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x351d,0x90));var _0xd351=function(_0x718bbe,_0x21fcca){_0x718bbe=_0x718bbe-0x0;var _0x583a22=_0x351d[_0x718bbe];return _0x583a22;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd351('0x13')]=_[_0xd351('0x14')](config[_0xd351('0x13')],{'host':_0xd351('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd351('0x13')]));require(_0xd351('0x16'))['register'](socket);function respondWithStatusCode(_0xc5a145,_0xb106ef){_0xb106ef=_0xb106ef||0xcc;return function(_0x3c2299){if(_0x3c2299){return _0xc5a145[_0xd351('0x17')](_0xb106ef);}return _0xc5a145[_0xd351('0x18')](_0xb106ef)['end']();};}function respondWithResult(_0x9f790f,_0x49d8bb){_0x49d8bb=_0x49d8bb||0xc8;return function(_0x5bdc03){if(_0x5bdc03){return _0x9f790f[_0xd351('0x18')](_0x49d8bb)['json'](_0x5bdc03);}};}function respondWithFilteredResult(_0x21e591,_0x1de35f){return function(_0x4e0164){if(_0x4e0164){var _0x4c6693=typeof _0x1de35f[_0xd351('0x19')]===_0xd351('0x1a')&&typeof _0x1de35f[_0xd351('0x1b')]===_0xd351('0x1a');var _0x51f265=_0x4e0164[_0xd351('0x1c')];var _0x4abbed=_0x4c6693?0x0:_0x1de35f['offset'];var _0x37d3ac=_0x4c6693?_0x4e0164['count']:_0x1de35f[_0xd351('0x19')]+_0x1de35f[_0xd351('0x1b')];var _0x3634c9;if(_0x37d3ac>=_0x51f265){_0x37d3ac=_0x51f265;_0x3634c9=0xc8;}else{_0x3634c9=0xce;}_0x21e591[_0xd351('0x18')](_0x3634c9);return _0x21e591[_0xd351('0x1d')]('Content-Range',_0x4abbed+'-'+_0x37d3ac+'/'+_0x51f265)[_0xd351('0x1e')](_0x4e0164);}return null;};}function patchUpdates(_0xbbc58){return function(_0x241265){try{jsonpatch['apply'](_0x241265,_0xbbc58,!![]);}catch(_0x1ce7f7){return BPromise[_0xd351('0x1f')](_0x1ce7f7);}return _0x241265[_0xd351('0x20')]();};}function saveUpdates(_0x59fb6d,_0x1ce279){return function(_0x34a5cb){if(_0x34a5cb){return _0x34a5cb[_0xd351('0x21')](_0x59fb6d)[_0xd351('0x22')](function(_0x489c9a){return _0x489c9a;});}return null;};}function removeEntity(_0x40f7f3,_0x483c92){return function(_0x358bff){if(_0x358bff){return _0x358bff[_0xd351('0x23')]()['then'](function(){var _0x2648d0=_0x358bff['get']({'plain':!![]});var _0x50d67e=_0xd351('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x50d67e,'resourceId':_0x2648d0['id']}})[_0xd351('0x22')](function(){return _0x358bff;});})['then'](function(){_0x40f7f3[_0xd351('0x18')](0xcc)[_0xd351('0x25')]();});}};}function handleEntityNotFound(_0x407b50,_0x4d3f48){return function(_0x71ce9c){if(!_0x71ce9c){_0x407b50['sendStatus'](0x194);}return _0x71ce9c;};}function handleError(_0x1c826b,_0x50039b){_0x50039b=_0x50039b||0x1f4;return function(_0x5f07b1){logger[_0xd351('0x26')](_0x5f07b1[_0xd351('0x27')]);if(_0x5f07b1[_0xd351('0x28')]){delete _0x5f07b1[_0xd351('0x28')];}_0x1c826b['status'](_0x50039b)[_0xd351('0x29')](_0x5f07b1);};}exports[_0xd351('0x2a')]=function(_0x38023c,_0x41da60){var _0x140591={},_0x205c79={},_0x103a7b={'count':0x0,'rows':[]};var _0x898949=_[_0xd351('0x2b')](db['VoicePrefix'][_0xd351('0x2c')],function(_0x453270){return{'name':_0x453270[_0xd351('0x2d')],'type':_0x453270[_0xd351('0x2e')]['key']};});_0x205c79[_0xd351('0x2f')]=_[_0xd351('0x2b')](_0x898949,_0xd351('0x28'));_0x205c79[_0xd351('0x30')]=_[_0xd351('0x31')](_0x38023c[_0xd351('0x30')]);_0x205c79[_0xd351('0x32')]=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],_0x205c79['query']);_0x140591['attributes']=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x38023c[_0xd351('0x30')][_0xd351('0x34')]));_0x140591[_0xd351('0x35')]=_0x140591['attributes']['length']?_0x140591[_0xd351('0x35')]:_0x205c79['model'];if(!_0x38023c[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x140591[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x38023c[_0xd351('0x30')][_0xd351('0x1b')]);_0x140591[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38023c[_0xd351('0x30')][_0xd351('0x19')]);}_0x140591['order']=qs[_0xd351('0x38')](_0x38023c['query'][_0xd351('0x38')]);_0x140591[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x38023c[_0xd351('0x30')],_0x205c79[_0xd351('0x32')]),_0x898949);if(_0x38023c['query'][_0xd351('0x3b')]){_0x140591[_0xd351('0x39')]=_['merge'](_0x140591[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x898949,function(_0x382f5b){if(_0x382f5b[_0xd351('0x2e')]!==_0xd351('0x3c')){var _0x5cc105={};_0x5cc105[_0x382f5b['name']]={'$like':'%'+_0x38023c[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x5cc105;}})});}_0x140591=_['merge']({},_0x140591,_0x38023c['options']);var _0x16677f={'where':_0x140591[_0xd351('0x39')]};return db['VoicePrefix']['count'](_0x16677f)[_0xd351('0x22')](function(_0x18f9d1){_0x103a7b[_0xd351('0x1c')]=_0x18f9d1;if(_0x38023c[_0xd351('0x30')][_0xd351('0x3d')]){_0x140591[_0xd351('0x3e')]=[{'all':!![]}];}return db[_0xd351('0x3f')][_0xd351('0x40')](_0x140591);})[_0xd351('0x22')](function(_0x553360){_0x103a7b['rows']=_0x553360;return _0x103a7b;})[_0xd351('0x22')](respondWithFilteredResult(_0x41da60,_0x140591))[_0xd351('0x41')](handleError(_0x41da60,null));};exports[_0xd351('0x42')]=function(_0x35f38f,_0x2bdd8f){var _0x4332e7={'raw':![],'where':{'id':_0x35f38f[_0xd351('0x43')]['id']}},_0xeaf4dc={};_0xeaf4dc[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x3f')][_0xd351('0x2c')]);_0xeaf4dc[_0xd351('0x30')]=_[_0xd351('0x31')](_0x35f38f[_0xd351('0x30')]);_0xeaf4dc[_0xd351('0x32')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],_0xeaf4dc[_0xd351('0x30')]);_0x4332e7[_0xd351('0x35')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x35f38f[_0xd351('0x30')][_0xd351('0x34')]));_0x4332e7[_0xd351('0x35')]=_0x4332e7['attributes'][_0xd351('0x44')]?_0x4332e7['attributes']:_0xeaf4dc[_0xd351('0x2f')];if(_0x35f38f[_0xd351('0x30')]['includeAll']){_0x4332e7['include']=[{'all':!![]}];}_0x4332e7=_[_0xd351('0x45')]({},_0x4332e7,_0x35f38f[_0xd351('0x46')]);return db[_0xd351('0x3f')]['find'](_0x4332e7)[_0xd351('0x22')](handleEntityNotFound(_0x2bdd8f,null))[_0xd351('0x22')](respondWithResult(_0x2bdd8f,null))['catch'](handleError(_0x2bdd8f,null));};exports[_0xd351('0x23')]=function(_0x53a2e8,_0x1eb5f3){return db[_0xd351('0x3f')]['find']({'where':{'id':_0x53a2e8['params']['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x1eb5f3,null))['then'](removeEntity(_0x1eb5f3,null))[_0xd351('0x41')](handleError(_0x1eb5f3,null));};exports[_0xd351('0x47')]=function(_0x9f1cd0,_0x4a27e3){return db[_0xd351('0x3f')]['describe']()['then'](respondWithResult(_0x4a27e3,null))['catch'](handleError(_0x4a27e3,null));};exports[_0xd351('0x48')]=function(_0x292af3,_0x334029){var _0x5a2e9b;return db['sequelize'][_0xd351('0x49')](function(_0x42f248){return db['VoicePrefix'][_0xd351('0x48')](_0x292af3[_0xd351('0x4a')],{'transaction':_0x42f248})['then'](function(_0x24ee0f){_0x5a2e9b=_0x24ee0f['get']({'plain':!![]});return db[_0xd351('0x4b')]['find']({'where':{'id':_0x5a2e9b[_0xd351('0x4c')]},'raw':!![]})[_0xd351('0x22')](function(_0x169ab1){return createVoicePrefixExtensions(_0x5a2e9b,_0x169ab1,_0x42f248);});});})[_0xd351('0x22')](function(){var _0xb5f3ee=_0x292af3[_0xd351('0x4d')][_0xd351('0x4e')]({'plain':!![]});if(!_0xb5f3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5f3ee['role']===_0xd351('0x4d')){var _0x624224=_0x5a2e9b;return db['UserProfileSection'][_0xd351('0x4f')]({'where':{'name':_0xd351('0x24'),'userProfileId':_0xb5f3ee[_0xd351('0x50')]},'raw':!![]})['then'](function(_0x169122){if(_0x169122&&_0x169122['autoAssociation']===0x0){return db['UserProfileResource'][_0xd351('0x48')]({'name':_0x624224[_0xd351('0x28')],'resourceId':_0x624224['id'],'type':_0x169122['name'],'sectionId':_0x169122['id']},{})[_0xd351('0x22')](function(){return _0x5a2e9b;});}else{return _0x5a2e9b;}})[_0xd351('0x41')](function(_0x2d9747){logger[_0xd351('0x26')](_0xd351('0x51'),_0x2d9747);throw _0x2d9747;});}return _0x5a2e9b;})[_0xd351('0x22')](respondWithResult(_0x334029,null))['catch'](handleError(_0x334029,null));};function Extension(_0x1e1173,_0x2a7390,_0x36fb5b,_0x8461b){this[_0xd351('0x52')]=_0xd351('0x53');this[_0xd351('0x54')]=_0x1e1173;this['app']=_0x36fb5b;this[_0xd351('0x2e')]='system';this[_0xd351('0x55')]=_0xd351('0x56');this[_0xd351('0x57')]=_0x2a7390;this[_0xd351('0x58')]=_0x8461b;}function createVoicePrefixExtensions(_0x70cdb,_0x4eaf18,_0x413931){return new BPromise(function(_0x4c8038,_0x4685fa){var _0x45bcc7=new Extension(formatPrefixName(_0x70cdb[_0xd351('0x59')]),0x1,_0xd351('0x5a'),_0xd351('0x5b'));_0x45bcc7['VoicePrefixId']=_0x70cdb['id'];return db['VoiceExtension'][_0xd351('0x48')](_0x45bcc7,{'transaction':_0x413931})[_0xd351('0x22')](function(_0x4b9367){var _0x2d2655=_0x4b9367[_0xd351('0x4e')]({'plain':!![]});var _0x2718e9=_['map'](addVoicePrefixExtensions(_0x70cdb,_0x4eaf18),function(_0x2b47ab){_0x2b47ab[_0xd351('0x4c')]=_0x2d2655['id'];_0x2b47ab[_0xd351('0x5c')]=_0x70cdb['id'];return _0x2b47ab;});return db[_0xd351('0x4b')]['bulkCreate'](_0x2718e9,{'transaction':_0x413931})['then'](function(_0x40c78b){if(!_0x40c78b){return _0x4685fa(_0xd351('0x5d'));}else{return _0x4c8038(_0x40c78b);}})[_0xd351('0x41')](function(_0xa000b4){return _0x4685fa(_0xa000b4);});});;});};function addVoicePrefixExtensions(_0x36b38f,_0x3b0993){var _0x2c83fe=[];var _0x5e2e06=formatPrefixName(_0x36b38f[_0xd351('0x59')]);_0x2c83fe['push'](new Extension(_0x5e2e06,0x2,'Set',_0xd351('0x5e')+_0x36b38f[_0xd351('0x28')]));if(_0x36b38f['callerIdAll']){_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,'Set','PREFIX-CALLERIDALL='+_0x36b38f['callerIdAll']));}else{_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,_0xd351('0x5a'),_0xd351('0x60')));}_0x2c83fe['push'](new Extension(_0x5e2e06,0x4,_0xd351('0x61'),_0x3b0993[_0xd351('0x52')]+','+_0xd351('0x62')+(0x8+_0x36b38f[_0xd351('0x28')][_0xd351('0x44')])+'}'+','+0x1));return _0x2c83fe;}function formatPrefixName(_0x475534){var _0x15fcab='_';for(var _0x6bf19c=0x0;_0x6bf19c<_0x475534[_0xd351('0x44')];_0x6bf19c++){if(_0x475534[_0xd351('0x63')](_0x6bf19c)=='-'){_0x15fcab+=_0x475534[_0xd351('0x63')](_0x6bf19c);}else{_0x15fcab+='['+_0x475534['charAt'](_0x6bf19c)+']';}}_0x15fcab+='.';return _0x15fcab;}exports[_0xd351('0x21')]=function(_0x2d59a5,_0x431e91,_0xcc7a10){var _0xf24a29=_0x2d59a5[_0xd351('0x4a')];_0xf24a29['prefix']=_0xd351('0x64')+_0xf24a29[_0xd351('0x28')]+'-';return db['sequelize']['transaction'](function(_0x436e1d){return db[_0xd351('0x3f')][_0xd351('0x21')](_0xf24a29,{'where':{'id':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x23')]({'where':{'VoicePrefixId':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x4f')]({'where':{'id':_0xf24a29['VoiceExtensionId']},'raw':!![]})[_0xd351('0x22')](function(_0x129623){return createVoicePrefixExtensions(_0xf24a29,_0x129623,_0x436e1d);});});});})['then'](function(){return db[_0xd351('0x3f')]['findById'](_0xf24a29['id']);})[_0xd351('0x22')](respondWithResult(_0x431e91,null))['catch'](handleError(_0x431e91,null));};exports[_0xd351('0x65')]=function(_0x406d8a,_0xbd31ca,_0x451445){return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x406d8a[_0xd351('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd31ca,null))[_0xd351('0x22')](function(_0x2558b4){if(_0x2558b4){return _0x2558b4[_0xd351('0x65')](_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')],_['omit'](_0x406d8a[_0xd351('0x4a')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x67')](function(_0x54b38c){for(var _0x38a3ec=0x0;_0x38a3ec<_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0xd351('0x44')];_0x38a3ec+=0x1){socket[_0xd351('0x68')](_0xd351('0x69'),{'UserId':Number(_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0x38a3ec]),'VoicePrefixId':Number(_0x406d8a[_0xd351('0x43')]['id'])});}return _0x54b38c;});}})['then'](respondWithResult(_0xbd31ca,null))[_0xd351('0x41')](handleError(_0xbd31ca,null));};exports[_0xd351('0x6a')]=function(_0x5036e6,_0x44df63,_0x4c1468){return db['VoicePrefix']['find']({'where':{'id':_0x5036e6[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x44df63,null))[_0xd351('0x22')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9[_0xd351('0x6a')](_0x5036e6['query'][_0xd351('0x66')])['then'](function(){if(_[_0xd351('0x6b')](_0x5036e6[_0xd351('0x30')][_0xd351('0x66')])){for(var _0x16dd16=0x0;_0x16dd16<_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0xd351('0x44')];_0x16dd16+=0x1){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0x16dd16]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}}else{socket['emit'](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}});}})[_0xd351('0x22')](respondWithStatusCode(_0x44df63,null))['catch'](handleError(_0x44df63,null));};exports[_0xd351('0x6d')]=function(_0x1e6c85,_0x2adab4,_0x2a1ea4){var _0x4a4b25={};var _0x1fda25={};var _0x36bbee;var _0x48b5ee;return db[_0xd351('0x3f')][_0xd351('0x6e')]({'where':{'id':_0x1e6c85[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x2adab4,null))['then'](function(_0x523895){if(_0x523895){_0x36bbee=_0x523895;_0x1fda25[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x6f')][_0xd351('0x2c')]);_0x1fda25['query']=_[_0xd351('0x31')](_0x1e6c85[_0xd351('0x30')]);_0x1fda25[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1fda25[_0xd351('0x2f')],_0x1fda25['query']);_0x4a4b25[_0xd351('0x35')]=_[_0xd351('0x33')](_0x1fda25['model'],qs[_0xd351('0x34')](_0x1e6c85[_0xd351('0x30')]['fields']));_0x4a4b25[_0xd351('0x35')]=_0x4a4b25['attributes'][_0xd351('0x44')]?_0x4a4b25['attributes']:_0x1fda25[_0xd351('0x2f')];_0x4a4b25[_0xd351('0x70')]=qs[_0xd351('0x38')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x38')]);_0x4a4b25[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x1e6c85[_0xd351('0x30')],_0x1fda25['filters']));if(_0x1e6c85[_0xd351('0x30')][_0xd351('0x3b')]){_0x4a4b25[_0xd351('0x39')]=_[_0xd351('0x45')](_0x4a4b25[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x4a4b25[_0xd351('0x35')],function(_0x54041b){var _0x56458b={};_0x56458b[_0x54041b]={'$like':'%'+_0x1e6c85[_0xd351('0x30')]['filter']+'%'};return _0x56458b;})});}_0x4a4b25=_[_0xd351('0x45')]({},_0x4a4b25,_0x1e6c85[_0xd351('0x46')]);return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x2d5e2b){if(_0x2d5e2b){_0x48b5ee=_0x2d5e2b['length'];if(!_0x1e6c85[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x4a4b25[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x1b')]);_0x4a4b25[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x19')]);}return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x4ddd65){if(_0x4ddd65){return _0x4ddd65?{'count':_0x48b5ee,'rows':_0x4ddd65}:null;}})['then'](respondWithResult(_0x2adab4,null))[_0xd351('0x41')](handleError(_0x2adab4,null));};exports['getTeams']=function(_0x5c202f,_0x426964,_0x4557ed){var _0x3f6826={};var _0x1a5e8e={};var _0x54fc9c;var _0x2443bd;return db['VoicePrefix']['findOne']({'where':{'id':_0x5c202f[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x426964,null))[_0xd351('0x22')](function(_0x15690b){if(_0x15690b){_0x54fc9c=_0x15690b;_0x1a5e8e[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x71')]['rawAttributes']);_0x1a5e8e[_0xd351('0x30')]=_[_0xd351('0x31')](_0x5c202f[_0xd351('0x30')]);_0x1a5e8e[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1a5e8e[_0xd351('0x2f')],_0x1a5e8e['query']);_0x3f6826['attributes']=_[_0xd351('0x33')](_0x1a5e8e['model'],qs[_0xd351('0x34')](_0x5c202f[_0xd351('0x30')]['fields']));_0x3f6826[_0xd351('0x35')]=_0x3f6826[_0xd351('0x35')][_0xd351('0x44')]?_0x3f6826[_0xd351('0x35')]:_0x1a5e8e[_0xd351('0x2f')];_0x3f6826['order']=qs[_0xd351('0x38')](_0x5c202f['query'][_0xd351('0x38')]);_0x3f6826[_0xd351('0x39')]=qs['filters'](_[_0xd351('0x3a')](_0x5c202f[_0xd351('0x30')],_0x1a5e8e[_0xd351('0x32')]));if(_0x5c202f[_0xd351('0x30')]['filter']){_0x3f6826['where']=_['merge'](_0x3f6826[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x3f6826[_0xd351('0x35')],function(_0x40740e){var _0x3606b1={};_0x3606b1[_0x40740e]={'$like':'%'+_0x5c202f[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x3606b1;})});}_0x3f6826=_['merge']({},_0x3f6826,_0x5c202f[_0xd351('0x46')]);return _0x54fc9c['getTeams'](_0x3f6826);}})[_0xd351('0x22')](function(_0x55d564){if(_0x55d564){_0x2443bd=_0x55d564['length'];if(!_0x5c202f[_0xd351('0x30')]['hasOwnProperty'](_0xd351('0x37'))){_0x3f6826[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x5c202f[_0xd351('0x30')][_0xd351('0x1b')]);_0x3f6826[_0xd351('0x19')]=qs['offset'](_0x5c202f['query'][_0xd351('0x19')]);}return _0x54fc9c[_0xd351('0x72')](_0x3f6826);}})['then'](function(_0x3d3cfa){if(_0x3d3cfa){return _0x3d3cfa?{'count':_0x2443bd,'rows':_0x3d3cfa}:null;}})['then'](respondWithResult(_0x426964,null))[_0xd351('0x41')](handleError(_0x426964,null));};exports[_0xd351('0x73')]=function(_0x6fd03b,_0x19d16a,_0x127bf9){var _0x4ab9b9=_0x6fd03b[_0xd351('0x4a')]['ids'];var _0x581e66;return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x4ab9b9},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':'Agents','attributes':['id','name',_0xd351('0x74'),_0xd351('0x75'),_0xd351('0x76')],'raw':!![]}]})[_0xd351('0x22')](function(_0x1ddacf){if(_0x1ddacf){_0x581e66=_0x1ddacf;var _0x4cadbe=_[_0xd351('0x77')](_0x1ddacf,function(_0x269bf6){var _0x3da123=_0x269bf6[_0xd351('0x4e')]({'plain':!![]});return _0x3da123['Agents'];});return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x6fd03b['params']['id']}})[_0xd351('0x22')](function(_0x46745f){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x37d882){return _0x46745f['addTeams'](_0x4ab9b9,{'transaction':_0x37d882})[_0xd351('0x22')](function(){return BPromise[_0xd351('0x79')](_0x581e66,function(_0x5ceda1){return db[_0xd351('0x7a')]['upsert']({'TeamId':_0x5ceda1['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},{'transaction':_0x37d882});});})[_0xd351('0x22')](function(){return BPromise['each'](_0x4cadbe,function(_0x1f0812){return db[_0xd351('0x7b')][_0xd351('0x7c')]({'where':{'UserId':_0x1f0812['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},'transaction':_0x37d882});});})[_0xd351('0x22')](function(){_0x4cadbe['forEach'](function(_0x23b2fe){socket['emit'](_0xd351('0x69'),{'UserId':_0x23b2fe['id'],'VoicePrefixId':_0x46745f['id']});});});});});}})[_0xd351('0x22')](respondWithStatusCode(_0x19d16a,null))[_0xd351('0x41')](handleError(_0x19d16a,null));};exports[_0xd351('0x7d')]=function(_0x160102,_0x24ac40,_0x3b2690){return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x160102['query'][_0xd351('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':_0xd351('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xd351('0x22')](handleEntityNotFound(_0x24ac40,null))['then'](function(_0x280220){var _0x4f8f00=_[_0xd351('0x2b')](_0x280220,'id');var _0x107886=[];var _0x3a3633=[];var _0x403312=squel[_0xd351('0x7f')]();_0x403312['field'](_0xd351('0x80'))[_0xd351('0x81')]('team_has_voice_prefixes','tq')['join'](_0xd351('0x82'),'ut',_0xd351('0x83'))[_0xd351('0x39')](_0xd351('0x84'),_0x160102[_0xd351('0x43')]['id']);for(var _0x1373c0=0x0;_0x1373c0<_0x280220[_0xd351('0x44')];_0x1373c0+=0x1){let _0x78b55c=_0x280220[_0x1373c0];for(var _0x2de03c=0x0;_0x2de03c<_0x78b55c[_0xd351('0x7e')][_0xd351('0x44')];_0x2de03c+=0x1){let _0x6f4c1e=_0x78b55c[_0xd351('0x7e')][_0x2de03c];var _0x56b88b=_0x403312['clone']();_0x56b88b[_0xd351('0x39')]('ut.UserId\x20=\x20?',_0x6f4c1e['id']);_0x3a3633[_0xd351('0x5f')](db[_0xd351('0x78')][_0xd351('0x30')](_0x56b88b[_0xd351('0x85')](),{'type':db[_0xd351('0x78')][_0xd351('0x86')]['SELECT']})[_0xd351('0x22')](function(_0x2725c4){if(_0x2725c4['length']===0x1){return _0x6f4c1e['id'];}else{var _0x31c1dc=_['every'](_['map'](_0x2725c4,_0xd351('0x87')),function(_0x2f188b){return _['includes'](_0x4f8f00,_0x2f188b);});if(_0x31c1dc){return _0x6f4c1e['id'];}}}));}}return BPromise[_0xd351('0x88')](_0x3a3633)[_0xd351('0x22')](function(_0x5126a1){_0x107886=_(_0x107886)[_0xd351('0x89')](_0x5126a1)[_0xd351('0x8a')]()[_0xd351('0x8b')]();return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x160102['params']['id']}})[_0xd351('0x22')](function(_0x1db9db){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x2ef116){return _0x1db9db[_0xd351('0x7d')](_0x160102[_0xd351('0x30')][_0xd351('0x66')],{'transaction':_0x2ef116})[_0xd351('0x22')](function(){if(!_[_0xd351('0x8c')](_0x107886)){return _0x1db9db[_0xd351('0x6a')](_0x107886,{'transaction':_0x2ef116});}})[_0xd351('0x22')](function(){_0x107886[_0xd351('0x8d')](function(_0x585e94){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':_0x585e94,'VoicePrefixId':_0x1db9db['id']});});});});});});})[_0xd351('0x22')](respondWithStatusCode(_0x24ac40,null))[_0xd351('0x41')](handleError(_0x24ac40,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(_0xd56c6b,_0x23090d){var _0x190ccb=function(_0x233def){while(--_0x233def){_0xd56c6b['push'](_0xd56c6b['shift']());}};_0x190ccb(++_0x23090d);}(_0x4fc2,0x111));var _0x24fc=function(_0x204e14,_0x430bda){_0x204e14=_0x204e14-0x0;var _0x218450=_0x4fc2[_0x204e14];return _0x218450;};'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 4448171..275b0d9 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 _0xb38d=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xd97e55,_0xe97088){var _0x536dbf=function(_0x433d47){while(--_0x433d47){_0xd97e55['push'](_0xd97e55['shift']());}};_0x536dbf(++_0xe97088);}(_0xb38d,0x1ee));var _0xdb38=function(_0x20e882,_0x16185c){_0x20e882=_0x20e882-0x0;var _0x3e0dbe=_0xb38d[_0x20e882];return _0x3e0dbe;};'use strict';var EventEmitter=require(_0xdb38('0x0'));var VoicePrefix=require(_0xdb38('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdb38('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb38('0x3'),'afterDestroy':_0xdb38('0x4')};function emitEvent(_0x270731){return function(_0x4036e2,_0x20882c,_0x4605f4){VoicePrefixEvents['emit'](_0x270731+':'+_0x4036e2['id'],_0x4036e2);VoicePrefixEvents[_0xdb38('0x5')](_0x270731,_0x4036e2);_0x4605f4(null);};}for(var e in events){if(events[_0xdb38('0x6')](e)){var event=events[e];VoicePrefix[_0xdb38('0x7')](e,emitEvent(event));}}module[_0xdb38('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x8cfe=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x513b02,_0x5b80cc){var _0x5b06a6=function(_0x4f2347){while(--_0x4f2347){_0x513b02['push'](_0x513b02['shift']());}};_0x5b06a6(++_0x5b80cc);}(_0x8cfe,0xbf));var _0xe8cf=function(_0x557401,_0xe7bf56){_0x557401=_0x557401-0x0;var _0x16dc9f=_0x8cfe[_0x557401];return _0x16dc9f;};'use strict';var EventEmitter=require(_0xe8cf('0x0'));var VoicePrefix=require(_0xe8cf('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe8cf('0x2')](0x0);var events={'afterCreate':_0xe8cf('0x3'),'afterUpdate':_0xe8cf('0x4'),'afterDestroy':_0xe8cf('0x5')};function emitEvent(_0x419d2d){return function(_0x1edac5,_0xa03f85,_0x430219){VoicePrefixEvents['emit'](_0x419d2d+':'+_0x1edac5['id'],_0x1edac5);VoicePrefixEvents[_0xe8cf('0x6')](_0x419d2d,_0x1edac5);_0x430219(null);};}for(var e in events){if(events[_0xe8cf('0x7')](e)){var event=events[e];VoicePrefix[_0xe8cf('0x8')](e,emitEvent(event));}}module[_0xe8cf('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 1424973..dc2b3ee 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 _0xefb1=['../../config/logger','api','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xefb1,0x153));var _0x1efb=function(_0x206171,_0x16edef){_0x206171=_0x206171-0x0;var _0x411c85=_0xefb1[_0x206171];return _0x411c85;};'use strict';var _=require(_0x1efb('0x0'));var util=require(_0x1efb('0x1'));var logger=require(_0x1efb('0x2'))(_0x1efb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1efb('0x4'));var fs=require('fs');var path=require(_0x1efb('0x5'));var rimraf=require(_0x1efb('0x6'));var config=require('../../config/environment');var attributes=require(_0x1efb('0x7'));module[_0x1efb('0x8')]=function(_0x3fba91,_0x2321f1){return _0x3fba91[_0x1efb('0x9')](_0x1efb('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e1e=['util','../../config/logger','api','moment','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x9e1e,0xa7));var _0xe9e1=function(_0x2b5689,_0x3a8cdf){_0x2b5689=_0x2b5689-0x0;var _0x3b4248=_0x9e1e[_0x2b5689];return _0x3b4248;};'use strict';var _=require(_0xe9e1('0x0'));var util=require(_0xe9e1('0x1'));var logger=require(_0xe9e1('0x2'))(_0xe9e1('0x3'));var moment=require(_0xe9e1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9e1('0x5'));var rimraf=require(_0xe9e1('0x6'));var config=require('../../config/environment');var attributes=require(_0xe9e1('0x7'));module[_0xe9e1('0x8')]=function(_0x44195e,_0x3bf6d8){return _0x44195e[_0xe9e1('0x9')](_0xe9e1('0xa'),attributes,{'tableName':_0xe9e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 233bc52..61d7e54 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 _0xe056=['message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0xe056,0xdb));var _0x6e05=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xe056[_0x5678b5];return _0x4c09a5;};'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});config[_0x6e05('0x7')]=_[_0x6e05('0x8')](config['redis'],{'host':_0x6e05('0x9'),'port':0x18eb});var socket=require(_0x6e05('0xa'))(new Redis(config[_0x6e05('0x7')]));require(_0x6e05('0xb'))[_0x6e05('0xc')](socket);function respondWithRpcPromise(_0x52b72b,_0x330e12,_0x110d8e){return new BPromise(function(_0x321ee5,_0x178c9f){return client[_0x6e05('0xd')](_0x52b72b,_0x110d8e)[_0x6e05('0xe')](function(_0x4ff533){logger[_0x6e05('0xf')](_0x6e05('0x10'),_0x330e12,_0x6e05('0x11'));logger['debug'](_0x6e05('0x12'),_0x330e12,_0x6e05('0x11'),JSON[_0x6e05('0x13')](_0x4ff533));if(_0x4ff533[_0x6e05('0x14')]){if(_0x4ff533[_0x6e05('0x14')]['code']===0x1f4){logger[_0x6e05('0x14')](_0x6e05('0x10'),_0x330e12,_0x4ff533['error']['message']);return _0x178c9f(_0x4ff533[_0x6e05('0x14')][_0x6e05('0x15')]);}logger[_0x6e05('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x330e12,_0x4ff533[_0x6e05('0x14')]['message']);return _0x321ee5(_0x4ff533[_0x6e05('0x14')][_0x6e05('0x15')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x330e12,_0x6e05('0x11'));_0x321ee5(_0x4ff533[_0x6e05('0x16')][_0x6e05('0x15')]);}})[_0x6e05('0x17')](function(_0x41d22c){logger['error'](_0x6e05('0x10'),_0x330e12,_0x41d22c);_0x178c9f(_0x41d22c);});});} \ No newline at end of file +var _0xd5f9=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x51cb8b,_0x341ddb){var _0x248ae5=function(_0x14c592){while(--_0x14c592){_0x51cb8b['push'](_0x51cb8b['shift']());}};_0x248ae5(++_0x341ddb);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x43bed9,_0x26adca){_0x43bed9=_0x43bed9-0x0;var _0x27b03d=_0xd5f9[_0x43bed9];return _0x27b03d;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var moment=require(_0x9d5f('0x2'));var BPromise=require(_0x9d5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5f('0x4'));var db=require(_0x9d5f('0x5'))['db'];var utils=require(_0x9d5f('0x6'));var logger=require(_0x9d5f('0x7'))(_0x9d5f('0x8'));var config=require(_0x9d5f('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9d5f('0xa')]=_[_0x9d5f('0xb')](config['redis'],{'host':_0x9d5f('0xc'),'port':0x18eb});var socket=require(_0x9d5f('0xd'))(new Redis(config['redis']));require(_0x9d5f('0xe'))[_0x9d5f('0xf')](socket);function respondWithRpcPromise(_0x4c3def,_0xff9bab,_0x554793){return new BPromise(function(_0x3d0fdf,_0x3b71ed){return client[_0x9d5f('0x10')](_0x4c3def,_0x554793)[_0x9d5f('0x11')](function(_0x32a6f4){logger['info'](_0x9d5f('0x12'),_0xff9bab,_0x9d5f('0x13'));logger[_0x9d5f('0x14')](_0x9d5f('0x15'),_0xff9bab,_0x9d5f('0x13'),JSON[_0x9d5f('0x16')](_0x32a6f4));if(_0x32a6f4[_0x9d5f('0x17')]){if(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x18')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xff9bab,_0x32a6f4['error']['message']);return _0x3b71ed(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);}logger['error'](_0x9d5f('0x12'),_0xff9bab,_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);return _0x3d0fdf(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);}else{logger['info'](_0x9d5f('0x12'),_0xff9bab,_0x9d5f('0x13'));_0x3d0fdf(_0x32a6f4[_0x9d5f('0x1a')][_0x9d5f('0x19')]);}})[_0x9d5f('0x1b')](function(_0x3df923){logger[_0x9d5f('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xff9bab,_0x3df923);_0x3b71ed(_0x3df923);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 84e5c0f..cb51bf3 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 _0xf6e8=['removeListener','register','length','voicePrefix:','save','remove','update'];(function(_0x35b8bd,_0x330fc2){var _0x21d8c7=function(_0x3d6d6f){while(--_0x3d6d6f){_0x35b8bd['push'](_0x35b8bd['shift']());}};_0x21d8c7(++_0x330fc2);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x248d85,_0x279d4f){_0x248d85=_0x248d85-0x0;var _0x1ed743=_0xf6e8[_0x248d85];return _0x1ed743;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x8f6e('0x0'),_0x8f6e('0x1'),_0x8f6e('0x2')];function createListener(_0x1a5d5b,_0x3c2632){return function(_0x24d74f){_0x3c2632['emit'](_0x1a5d5b,_0x24d74f);};}function removeListener(_0xac263e,_0x55673a){return function(){VoicePrefixEvents[_0x8f6e('0x3')](_0xac263e,_0x55673a);};}exports[_0x8f6e('0x4')]=function(_0x5a5609){for(var _0x7b6df3=0x0,_0x233158=events[_0x8f6e('0x5')];_0x7b6df3<_0x233158;_0x7b6df3++){var _0x71b52c=events[_0x7b6df3];var _0x423ed4=createListener(_0x8f6e('0x6')+_0x71b52c,_0x5a5609);VoicePrefixEvents['on'](_0x71b52c,_0x423ed4);}}; \ No newline at end of file +var _0x25a3=['voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener','register','length'];(function(_0x459014,_0x54395f){var _0x3d392c=function(_0x403392){while(--_0x403392){_0x459014['push'](_0x459014['shift']());}};_0x3d392c(++_0x54395f);}(_0x25a3,0x121));var _0x325a=function(_0x4b696e,_0x991223){_0x4b696e=_0x4b696e-0x0;var _0x95873f=_0x25a3[_0x4b696e];return _0x95873f;};'use strict';var VoicePrefixEvents=require(_0x325a('0x0'));var events=[_0x325a('0x1'),_0x325a('0x2'),'update'];function createListener(_0x81800a,_0x50e9ba){return function(_0x46df7b){_0x50e9ba[_0x325a('0x3')](_0x81800a,_0x46df7b);};}function removeListener(_0x1f6e3d,_0x5d829e){return function(){VoicePrefixEvents[_0x325a('0x4')](_0x1f6e3d,_0x5d829e);};}exports[_0x325a('0x5')]=function(_0x272122){for(var _0x56e8fb=0x0,_0x533867=events[_0x325a('0x6')];_0x56e8fb<_0x533867;_0x56e8fb++){var _0x209f5e=events[_0x56e8fb];var _0x43bd79=createListener(_0x325a('0x7')+_0x209f5e,_0x272122);VoicePrefixEvents['on'](_0x209f5e,_0x43bd79);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2148083..e65b801 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(_0xd1788c,_0x4830a2){var _0x9ce47f=function(_0x150888){while(--_0x150888){_0xd1788c['push'](_0xd1788c['shift']());}};_0x9ce47f(++_0x4830a2);}(_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/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(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0xb10b,0x12a));var _0xbb10=function(_0x254761,_0x550307){_0x254761=_0x254761-0x0;var _0x4236de=_0xb10b[_0x254761];return _0x4236de;};'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 b40a827..3abc48a 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 _0xf843=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','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','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xf843,0x65));var _0x3f84=function(_0x522203,_0x136fc0){_0x522203=_0x522203-0x0;var _0x13810c=_0xf843[_0x522203];return _0x13810c;};'use strict';var Sequelize=require(_0x3f84('0x0'));module[_0x3f84('0x1')]={'name':{'type':Sequelize[_0x3f84('0x2')],'allowNull':![],'unique':_0x3f84('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x5'),_0x3f84('0x6')),'allowNull':![],'defaultValue':_0x3f84('0x5')},'musiconhold':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':_0x3f84('0x7')},'announce':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x3f84('0x8'),_0x3f84('0x9'),_0x3f84('0xa'),_0x3f84('0xb'),_0x3f84('0xc'),_0x3f84('0xd'),_0x3f84('0xe'),'rrordered'),'allowNull':![],'defaultValue':_0x3f84('0x8'),'set':function(_0x45f99d){this[_0x3f84('0xf')](_0x3f84('0x10'),_0x45f99d?_0x45f99d:'rrmemory');},'get':function(){var _0x53ae10=this[_0x3f84('0x11')](_0x3f84('0x12'));var _0x2f0ff1=this['getDataValue'](_0x3f84('0x13'));var _0x27cac1=this['getDataValue']('strategy');if(_0x53ae10===_0x3f84('0x5')){return _0x27cac1;}if(_0x2f0ff1===_0x3f84('0x14')&&_0x27cac1===_0x3f84('0xc')||_0x2f0ff1===_0x3f84('0x14')&&_0x27cac1===_0x3f84('0x15')){return _0x27cac1;}if(_0x2f0ff1===_0x3f84('0x16')||_0x2f0ff1==='predictive'||_0x2f0ff1===_0x3f84('0x17')){return _0x27cac1;}return null;}},'servicelevel':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3f84('0x2')]},'weight':{'type':Sequelize[_0x3f84('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3f84('0x4')]('yes','no'),'defaultValue':_0x3f84('0x19')},'autopause':{'type':Sequelize['ENUM'](_0x3f84('0x19'),'no',_0x3f84('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3f84('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x3f84('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x3f84('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x3f84('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3f84('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3f84('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3f84('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3f84('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no'),'defaultValue':_0x3f84('0x19')},'announce_holdtime':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no',_0x3f84('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3f84('0x2')]},'queue_youarenext':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3f84('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3f84('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3f84('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x3f84('0x2')]},'queue_less_than':{'type':Sequelize[_0x3f84('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1a5607){this[_0x3f84('0xf')]('periodic_announce',_0x1a5607?_0x1a5607[_0x3f84('0x1c')](','):[]);},'get':function(){return this[_0x3f84('0x11')](_0x3f84('0x1d'))?this['getDataValue'](_0x3f84('0x1d'))[_0x3f84('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x3f84('0x19'),'set':function(_0x2f8354){this[_0x3f84('0xf')]('joinempty',_0x2f8354?_0x2f8354[_0x3f84('0x1c')](','):undefined);},'get':function(){return this[_0x3f84('0x11')]('joinempty')?this[_0x3f84('0x11')](_0x3f84('0x1f'))[_0x3f84('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':'no','set':function(_0x44c594){this[_0x3f84('0xf')](_0x3f84('0x20'),_0x44c594?_0x44c594[_0x3f84('0x1c')](','):undefined);},'get':function(){return this[_0x3f84('0x11')](_0x3f84('0x20'))?this[_0x3f84('0x11')](_0x3f84('0x20'))[_0x3f84('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x3f84('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3f84('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3f84('0x2')]},'description':{'type':Sequelize[_0x3f84('0x2')]},'acw':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':0x0,'set':function(_0x561b05){this['setDataValue'](_0x3f84('0x22'),_0x561b05);if(_0x561b05){if(this[_0x3f84('0x11')](_0x3f84('0x23'))<0x2){this['setDataValue'](_0x3f84('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x24'),'progressive',_0x3f84('0x17'),_0x3f84('0x25'),_0x3f84('0x14')),'defaultValue':_0x3f84('0x16'),'comment':_0x3f84('0x26')},'dialLimitChannel':{'type':Sequelize[_0x3f84('0x18')](0x4)[_0x3f84('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3f84('0x28')},'dialLimitQueue':{'type':Sequelize[_0x3f84('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x3f84('0x29')](0x2)[_0x3f84('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3f84('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x2b'),_0x3f84('0x2c')),'defaultValue':_0x3f84('0x2c'),'comment':_0x3f84('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3f84('0x29')](0x2)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3f84('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3f84('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x30')},'dialQueueOptions':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':_0x3f84('0x31'),'comment':_0x3f84('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x33')},'dialQueueProject':{'type':Sequelize[_0x3f84('0x2')],'comment':_0x3f84('0x34')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x35')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x36')},'dialBusyMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'comment':_0x3f84('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x39')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x3f84('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3f84('0x4')](_0x3f84('0x3a'),_0x3f84('0x3b'),_0x3f84('0x3c')),'defaultValue':_0x3f84('0x3a')},'dialAMDActive':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':0x0,'comment':_0x3f84('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x3f84('0x18')](0x9)[_0x3f84('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3f84('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x3f84('0x18')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3f84('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3f84('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3f84('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3f84('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3f84('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x3f84('0x18')](0x9)[_0x3f84('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3f84('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3f84('0x18')](0x9)[_0x3f84('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3f84('0x18')](0x9)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3f84('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3f84('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3f84('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3f84('0x45')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x3f84('0x46')),'defaultValue':_0x3f84('0x47')},'dialQueueProject2':{'type':Sequelize[_0x3f84('0x2')],'comment':_0x3f84('0x34')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3f84('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3f84('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x3f84('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f84('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f84('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3f84('0x18')](0x5)[_0x3f84('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f84('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3f84('0x18')],'allowNull':!![],'comment':_0x3f84('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':![],'comment':_0x3f84('0x51'),'set':function(_0xd6e1f){if(!_0xd6e1f)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x3f84('0xf')]('mandatoryDisposition',_0xd6e1f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3f84('0x18')](0x3)[_0x3f84('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3f84('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0xc87d=['inbound','ENUM','leastrecent','fewestcalls','rrmemory','rrordered','ringall','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','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)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\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','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xc87d,0x18c));var _0xdc87=function(_0x82f5e4,_0xdc1848){_0x82f5e4=_0x82f5e4-0x0;var _0x369635=_0xc87d[_0x82f5e4];return _0x369635;};'use strict';var Sequelize=require(_0xdc87('0x0'));module[_0xdc87('0x1')]={'name':{'type':Sequelize[_0xdc87('0x2')],'allowNull':![],'unique':_0xdc87('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0xdc87('0x4')},'musiconhold':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xdc87('0x5')]('rr','ringall',_0xdc87('0x6'),_0xdc87('0x7'),'random',_0xdc87('0x8'),'linear','wrandom',_0xdc87('0x9')),'allowNull':![],'defaultValue':_0xdc87('0xa'),'set':function(_0x1b6393){this[_0xdc87('0xb')](_0xdc87('0xc'),_0x1b6393?_0x1b6393:'rrmemory');},'get':function(){var _0x5bdb0f=this['getDataValue'](_0xdc87('0xd'));var _0x5bac0f=this[_0xdc87('0xe')](_0xdc87('0xf'));var _0x1cac06=this['getDataValue'](_0xdc87('0xc'));if(_0x5bdb0f===_0xdc87('0x4')){return _0x1cac06;}if(_0x5bac0f===_0xdc87('0x10')&&_0x1cac06==='rrmemory'||_0x5bac0f===_0xdc87('0x10')&&_0x1cac06===_0xdc87('0x11')){return _0x1cac06;}if(_0x5bac0f===_0xdc87('0x12')||_0x5bac0f==='predictive'||_0x5bac0f===_0xdc87('0x13')){return _0x1cac06;}return null;}},'servicelevel':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdc87('0x2')]},'weight':{'type':Sequelize[_0xdc87('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xdc87('0x15'),'no'),'defaultValue':_0xdc87('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xdc87('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdc87('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xdc87('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdc87('0x5')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdc87('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdc87('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdc87('0x5')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xdc87('0x15'),'no'),'defaultValue':_0xdc87('0x15')},'announce_holdtime':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no',_0xdc87('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdc87('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xdc87('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdc87('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdc87('0x2')]},'queue_youarenext':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdc87('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xdc87('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xdc87('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xdc87('0x17')],'set':function(_0xb4011f){this['setDataValue'](_0xdc87('0x18'),_0xb4011f?_0xb4011f[_0xdc87('0x19')](','):[]);},'get':function(){return this[_0xdc87('0xe')](_0xdc87('0x18'))?this[_0xdc87('0xe')]('periodic_announce')[_0xdc87('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':'yes','set':function(_0x454c33){this[_0xdc87('0xb')](_0xdc87('0x1b'),_0x454c33?_0x454c33['join'](','):undefined);},'get':function(){return this[_0xdc87('0xe')](_0xdc87('0x1b'))?this['getDataValue'](_0xdc87('0x1b'))[_0xdc87('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':'no','set':function(_0x3bf270){this[_0xdc87('0xb')]('leavewhenempty',_0x3bf270?_0x3bf270[_0xdc87('0x19')](','):undefined);},'get':function(){return this[_0xdc87('0xe')](_0xdc87('0x1c'))?this[_0xdc87('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xdc87('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':0x0,'set':function(_0xc2c5a8){this[_0xdc87('0xb')](_0xdc87('0x1e'),_0xc2c5a8);if(_0xc2c5a8){if(this[_0xdc87('0xe')](_0xdc87('0x1f'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdc87('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':0x0,'comment':_0xdc87('0x20')},'dialMethod':{'type':Sequelize[_0xdc87('0x5')]('preview','progressive',_0xdc87('0x13'),_0xdc87('0x21'),'booked'),'defaultValue':_0xdc87('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xdc87('0x14')](0x4)[_0xdc87('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xdc87('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xdc87('0x23')](0x2)[_0xdc87('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdc87('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x25'),'dropRate'),'defaultValue':_0xdc87('0x26'),'comment':_0xdc87('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdc87('0x23')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdc87('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0xdc87('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdc87('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdc87('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdc87('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':_0xdc87('0x2a'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x2b')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xdc87('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'comment':_0xdc87('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdc87('0x31')},'dialTimezone':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':_0xdc87('0x32')},'dialPrefix':{'type':Sequelize[_0xdc87('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x33'),_0xdc87('0x34'),_0xdc87('0x35')),'defaultValue':_0xdc87('0x33')},'dialAMDActive':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':0x0,'comment':_0xdc87('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdc87('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdc87('0x37')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xdc87('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdc87('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdc87('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xdc87('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc87('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xdc87('0x14')](0x9)[_0xdc87('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdc87('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdc87('0x14')](0x9)[_0xdc87('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdc87('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdc87('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdc87('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdc87('0x14')](0x9)[_0xdc87('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc87('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdc87('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':0x0,'comment':_0xdc87('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdc87('0x5')](_0xdc87('0x41'),_0xdc87('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xdc87('0x2')],'comment':_0xdc87('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdc87('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc87('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc87('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdc87('0x14')](0x5)[_0xdc87('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc87('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc87('0x14')],'allowNull':!![],'comment':_0xdc87('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':![],'comment':_0xdc87('0x4e'),'set':function(_0x5d6beb){if(!_0x5d6beb)this[_0xdc87('0xb')]('mandatoryDispositionPauseId',null);this[_0xdc87('0xb')](_0xdc87('0x4f'),_0x5d6beb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdc87('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xdc87('0x14')](0x3)[_0xdc87('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xdc87('0x1d')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index c1bbe3f..f2f7c28 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 _0x8700=['key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','length','create','user','role','UserProfileSection','UserProfileResource','updatedAt','omit','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','push','format','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ContactId','ListId','field','phone','NOW()','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','sendStatus','error','stack','send','VoiceQueue','rawAttributes','fieldName'];(function(_0x98023f,_0x158398){var _0x2e33b3=function(_0x28e99b){while(--_0x28e99b){_0x98023f['push'](_0x98023f['shift']());}};_0x2e33b3(++_0x158398);}(_0x8700,0x13c));var _0x0870=function(_0x34f61c,_0x518d10){_0x34f61c=_0x34f61c-0x0;var _0x297cf1=_0x8700[_0x34f61c];return _0x297cf1;};'use strict';var emlformat=require(_0x0870('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0870('0x1'));var jsonpatch=require(_0x0870('0x2'));var rp=require('request-promise');var moment=require(_0x0870('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0870('0x4'));var util=require(_0x0870('0x5'));var path=require(_0x0870('0x6'));var sox=require(_0x0870('0x7'));var csv=require(_0x0870('0x8'));var ejs=require(_0x0870('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0870('0xa'));var squel=require('squel');var crypto=require(_0x0870('0xb'));var jsforce=require(_0x0870('0xc'));var deskjs=require(_0x0870('0xd'));var toCsv=require(_0x0870('0x8'));var querystring=require(_0x0870('0xe'));var Papa=require(_0x0870('0xf'));var Redis=require(_0x0870('0x10'));var authService=require(_0x0870('0x11'));var qs=require(_0x0870('0x12'));var as=require(_0x0870('0x13'));var hardwareService=require(_0x0870('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0870('0x15'));var config=require(_0x0870('0x16'));var licenseUtil=require(_0x0870('0x17'));var db=require(_0x0870('0x18'))['db'];config[_0x0870('0x19')]=_[_0x0870('0x1a')](config['redis'],{'host':_0x0870('0x1b'),'port':0x18eb});var socket=require(_0x0870('0x1c'))(new Redis(config[_0x0870('0x19')]));require(_0x0870('0x1d'))[_0x0870('0x1e')](socket);function respondWithStatusCode(_0x5d5f0f,_0x708fc2){_0x708fc2=_0x708fc2||0xcc;return function(_0x45a699){if(_0x45a699){return _0x5d5f0f['sendStatus'](_0x708fc2);}return _0x5d5f0f[_0x0870('0x1f')](_0x708fc2)[_0x0870('0x20')]();};}function respondWithResult(_0x4dcf4c,_0x365d8c){_0x365d8c=_0x365d8c||0xc8;return function(_0x4ca43d){if(_0x4ca43d){return _0x4dcf4c['status'](_0x365d8c)[_0x0870('0x21')](_0x4ca43d);}};}function respondWithFilteredResult(_0x3a1866,_0x16bb57){return function(_0x37d95a){if(_0x37d95a){var _0x495630=typeof _0x16bb57[_0x0870('0x22')]==='undefined'&&typeof _0x16bb57[_0x0870('0x23')]===_0x0870('0x24');var _0x14ed67=_0x37d95a['count'];var _0x1658ab=_0x495630?0x0:_0x16bb57[_0x0870('0x22')];var _0x1024de=_0x495630?_0x37d95a[_0x0870('0x25')]:_0x16bb57[_0x0870('0x22')]+_0x16bb57[_0x0870('0x23')];var _0x50530a;if(_0x1024de>=_0x14ed67){_0x1024de=_0x14ed67;_0x50530a=0xc8;}else{_0x50530a=0xce;}_0x3a1866[_0x0870('0x1f')](_0x50530a);return _0x3a1866[_0x0870('0x26')](_0x0870('0x27'),_0x1658ab+'-'+_0x1024de+'/'+_0x14ed67)[_0x0870('0x21')](_0x37d95a);}return null;};}function patchUpdates(_0x1bc5c6){return function(_0x5360d1){try{jsonpatch[_0x0870('0x28')](_0x5360d1,_0x1bc5c6,!![]);}catch(_0x3a2548){return BPromise['reject'](_0x3a2548);}return _0x5360d1[_0x0870('0x29')]();};}function saveUpdates(_0x294301,_0x1d3cb1){return function(_0x17e025){if(_0x17e025){return _0x17e025[_0x0870('0x2a')](_0x294301)[_0x0870('0x2b')](function(_0x260bf2){return _0x260bf2;});}return null;};}function removeEntity(_0x5a9400,_0x5ee5f8){return function(_0x3cc269){if(_0x3cc269){return _0x3cc269[_0x0870('0x2c')]()['then'](function(){var _0x17042a=_0x3cc269[_0x0870('0x2d')]({'plain':!![]});var _0x88a595=[{'name':_0x0870('0x2e'),'value':_0x0870('0x2f'),'ignore':![]},{'name':_0x0870('0x30'),'value':_0x0870('0x31'),'ignore':![]}];var _0x21d195=_(_0x88a595)[_0x0870('0x32')](_0x0870('0x33'))[_0x0870('0x34')]('value')[_0x0870('0x35')]();if(_['includes'](_0x21d195,_0x17042a[_0x0870('0x36')])){return;}var _0x347ac7=_[_0x0870('0x37')](_0x88a595,['value',_0x17042a[_0x0870('0x36')]])[_0x0870('0x38')];return db['UserProfileResource'][_0x0870('0x2c')]({'where':{'type':_0x347ac7,'resourceId':_0x17042a['id']}})[_0x0870('0x2b')](function(){return _0x3cc269;});})['then'](function(){_0x5a9400[_0x0870('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb558,_0x9ed958){return function(_0x572176){if(!_0x572176){_0x5bb558[_0x0870('0x39')](0x194);}return _0x572176;};}function handleError(_0x394139,_0x1f5715){_0x1f5715=_0x1f5715||0x1f4;return function(_0x20deda){logger[_0x0870('0x3a')](_0x20deda[_0x0870('0x3b')]);if(_0x20deda['name']){delete _0x20deda['name'];}_0x394139[_0x0870('0x1f')](_0x1f5715)[_0x0870('0x3c')](_0x20deda);};}exports['index']=function(_0x7928ec,_0x1f0792){var _0x32cdb8={},_0x4dc9a4={},_0xc3839a={'count':0x0,'rows':[]};var _0x32d4d3=_[_0x0870('0x34')](db[_0x0870('0x3d')][_0x0870('0x3e')],function(_0x593f51){return{'name':_0x593f51[_0x0870('0x3f')],'type':_0x593f51['type'][_0x0870('0x40')]};});_0x4dc9a4[_0x0870('0x41')]=_[_0x0870('0x34')](_0x32d4d3,_0x0870('0x38'));_0x4dc9a4[_0x0870('0x42')]=_[_0x0870('0x43')](_0x7928ec[_0x0870('0x42')]);_0x4dc9a4[_0x0870('0x44')]=_[_0x0870('0x45')](_0x4dc9a4['model'],_0x4dc9a4[_0x0870('0x42')]);_0x32cdb8[_0x0870('0x46')]=_[_0x0870('0x45')](_0x4dc9a4[_0x0870('0x41')],qs[_0x0870('0x47')](_0x7928ec[_0x0870('0x42')]['fields']));_0x32cdb8['attributes']=_0x32cdb8['attributes']['length']?_0x32cdb8[_0x0870('0x46')]:_0x4dc9a4[_0x0870('0x41')];if(!_0x7928ec[_0x0870('0x42')]['hasOwnProperty']('nolimit')){_0x32cdb8[_0x0870('0x23')]=qs[_0x0870('0x23')](_0x7928ec[_0x0870('0x42')][_0x0870('0x23')]);_0x32cdb8[_0x0870('0x22')]=qs['offset'](_0x7928ec[_0x0870('0x42')][_0x0870('0x22')]);}_0x32cdb8[_0x0870('0x48')]=qs['sort'](_0x7928ec[_0x0870('0x42')][_0x0870('0x49')]);_0x32cdb8[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x7928ec[_0x0870('0x42')],_0x4dc9a4[_0x0870('0x44')]),_0x32d4d3);if(_0x7928ec['query'][_0x0870('0x32')]){_0x32cdb8[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x32cdb8[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x32d4d3,function(_0x1a564e){if(_0x1a564e[_0x0870('0x36')]!=='VIRTUAL'){var _0x7ea8f9={};_0x7ea8f9[_0x1a564e[_0x0870('0x38')]]={'$like':'%'+_0x7928ec['query'][_0x0870('0x32')]+'%'};return _0x7ea8f9;}})});}_0x32cdb8=_[_0x0870('0x4c')]({},_0x32cdb8,_0x7928ec[_0x0870('0x4d')]);var _0x5c7893={'where':_0x32cdb8[_0x0870('0x4a')]};return db[_0x0870('0x3d')][_0x0870('0x25')](_0x5c7893)[_0x0870('0x2b')](function(_0x4fc4c8){_0xc3839a[_0x0870('0x25')]=_0x4fc4c8;if(_0x7928ec['query'][_0x0870('0x4e')]){_0x32cdb8[_0x0870('0x4f')]=[{'all':!![]}];}return db[_0x0870('0x3d')][_0x0870('0x50')](_0x32cdb8);})[_0x0870('0x2b')](function(_0x38b601){_0xc3839a[_0x0870('0x51')]=_0x38b601;return _0xc3839a;})[_0x0870('0x2b')](respondWithFilteredResult(_0x1f0792,_0x32cdb8))[_0x0870('0x52')](handleError(_0x1f0792,null));};exports['show']=function(_0x4162cc,_0x5a0b62){var _0x4b4b45={'raw':![],'where':{'id':_0x4162cc[_0x0870('0x53')]['id']}},_0x183d7e={};_0x183d7e[_0x0870('0x41')]=_[_0x0870('0x43')](db['VoiceQueue'][_0x0870('0x3e')]);_0x183d7e[_0x0870('0x42')]=_['keys'](_0x4162cc[_0x0870('0x42')]);_0x183d7e[_0x0870('0x44')]=_['intersection'](_0x183d7e['model'],_0x183d7e[_0x0870('0x42')]);_0x4b4b45[_0x0870('0x46')]=_[_0x0870('0x45')](_0x183d7e['model'],qs['fields'](_0x4162cc[_0x0870('0x42')]['fields']));_0x4b4b45[_0x0870('0x46')]=_0x4b4b45[_0x0870('0x46')][_0x0870('0x54')]?_0x4b4b45[_0x0870('0x46')]:_0x183d7e[_0x0870('0x41')];if(_0x4162cc[_0x0870('0x42')][_0x0870('0x4e')]){_0x4b4b45[_0x0870('0x4f')]=[{'all':!![]}];}_0x4b4b45=_[_0x0870('0x4c')]({},_0x4b4b45,_0x4162cc[_0x0870('0x4d')]);return db['VoiceQueue'][_0x0870('0x37')](_0x4b4b45)[_0x0870('0x2b')](handleEntityNotFound(_0x5a0b62,null))['then'](respondWithResult(_0x5a0b62,null))[_0x0870('0x52')](handleError(_0x5a0b62,null));};exports[_0x0870('0x55')]=function(_0x2d0a6b,_0x174fb8){return db[_0x0870('0x3d')]['create'](_0x2d0a6b['body'],{})[_0x0870('0x2b')](function(_0x46fc63){var _0x6ed60a=_0x2d0a6b[_0x0870('0x56')][_0x0870('0x2d')]({'plain':!![]});if(!_0x6ed60a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6ed60a[_0x0870('0x57')]===_0x0870('0x56')){var _0x1a168c=_0x46fc63[_0x0870('0x2d')]({'plain':!![]});var _0x1e0f22=[{'name':_0x0870('0x2e'),'value':'inbound'},{'name':_0x0870('0x30'),'value':'outbound'}];var _0x1b9c19=_['find'](_0x1e0f22,[_0x0870('0x35'),_0x1a168c[_0x0870('0x36')]])['name'];return db[_0x0870('0x58')][_0x0870('0x37')]({'where':{'name':_0x1b9c19,'userProfileId':_0x6ed60a['userProfileId']},'raw':!![]})[_0x0870('0x2b')](function(_0xc45f76){if(_0xc45f76&&_0xc45f76['autoAssociation']===0x0){return db[_0x0870('0x59')][_0x0870('0x55')]({'name':_0x1a168c['name'],'resourceId':_0x1a168c['id'],'type':_0xc45f76[_0x0870('0x38')],'sectionId':_0xc45f76['id']},{})['then'](function(){return _0x46fc63;});}else{return _0x46fc63;}})[_0x0870('0x52')](function(_0x16b85d){logger[_0x0870('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16b85d);throw _0x16b85d;});}return _0x46fc63;})[_0x0870('0x2b')](respondWithResult(_0x174fb8,0xc9))[_0x0870('0x52')](handleError(_0x174fb8,null));};exports['clone']=function(_0x183ec4,_0x26e332){var _0x4cd3b3={'where':{'id':_0x183ec4[_0x0870('0x53')]['id']}},_0x3b45ff={};_0x3b45ff[_0x0870('0x41')]=_['keys'](db[_0x0870('0x3d')]['rawAttributes']);_0x4cd3b3[_0x0870('0x46')]=_[_0x0870('0x45')](_0x3b45ff[_0x0870('0x41')],qs[_0x0870('0x47')](_0x183ec4[_0x0870('0x42')][_0x0870('0x47')]));_0x4cd3b3[_0x0870('0x46')]=_0x4cd3b3['attributes'][_0x0870('0x54')]?_0x4cd3b3[_0x0870('0x46')]:_0x3b45ff['model'];if(_0x183ec4[_0x0870('0x42')][_0x0870('0x4e')]){_0x4cd3b3[_0x0870('0x4f')]=[{'all':!![]}];}_0x4cd3b3=_[_0x0870('0x4c')]({},_0x4cd3b3,_0x183ec4[_0x0870('0x4d')]);return db[_0x0870('0x3d')][_0x0870('0x37')](_0x4cd3b3)['then'](handleEntityNotFound(_0x26e332,null))[_0x0870('0x2b')](function(_0x54a8cd){if(_0x54a8cd){var _0x290e4b=_0x54a8cd[_0x0870('0x2d')]({'plain':!![]});_0x290e4b=qs['omit'](_0x290e4b,['id','createdAt',_0x0870('0x5a')]);_0x183ec4['body']=_[_0x0870('0x5b')](_0x183ec4[_0x0870('0x5c')],['id',_0x0870('0x5d'),_0x0870('0x5a')]);return db[_0x0870('0x3d')]['create'](_[_0x0870('0x4c')](_0x290e4b,_0x183ec4[_0x0870('0x5c')]),{'include':_0x183ec4[_0x0870('0x42')][_0x0870('0x4e')]?[{'all':!![]}]:undefined})[_0x0870('0x2b')](function(_0x1ae9bc){var _0x542655=_0x183ec4[_0x0870('0x56')]['get']({'plain':!![]});if(!_0x542655)throw new Error(_0x0870('0x5e'));if(_0x542655[_0x0870('0x57')]===_0x0870('0x56')){var _0x52b4b6=_0x1ae9bc[_0x0870('0x2d')]({'plain':!![]});var _0x3abf39=[{'name':'VoiceQueues','value':_0x0870('0x2f')},{'name':_0x0870('0x30'),'value':'outbound'}];var _0x327145=_[_0x0870('0x37')](_0x3abf39,[_0x0870('0x35'),_0x52b4b6[_0x0870('0x36')]])[_0x0870('0x38')];return db[_0x0870('0x58')][_0x0870('0x37')]({'where':{'name':_0x327145,'userProfileId':_0x542655[_0x0870('0x5f')]},'raw':!![]})['then'](function(_0x14784f){if(_0x14784f&&_0x14784f[_0x0870('0x60')]===0x0){return db[_0x0870('0x59')][_0x0870('0x55')]({'name':_0x52b4b6[_0x0870('0x38')],'resourceId':_0x52b4b6['id'],'type':_0x14784f[_0x0870('0x38')],'sectionId':_0x14784f['id']},{})[_0x0870('0x2b')](function(){return _0x1ae9bc;});}else{return _0x1ae9bc;}})[_0x0870('0x52')](function(_0x5c3978){logger[_0x0870('0x3a')](_0x0870('0x61'),_0x5c3978);throw _0x5c3978;});}return _0x1ae9bc;});}})['then'](respondWithResult(_0x26e332,0xc9))[_0x0870('0x52')](handleError(_0x26e332,null));};exports['update']=function(_0x1dbb67,_0x11d5bb){if(_0x1dbb67[_0x0870('0x5c')]['id']){delete _0x1dbb67[_0x0870('0x5c')]['id'];}return db['VoiceQueue'][_0x0870('0x37')]({'where':{'id':_0x1dbb67[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x11d5bb,null))['then'](saveUpdates(_0x1dbb67[_0x0870('0x5c')],null))[_0x0870('0x2b')](respondWithResult(_0x11d5bb,null))[_0x0870('0x52')](handleError(_0x11d5bb,null));};exports[_0x0870('0x2c')]=function(_0x59b9e2,_0x327c37){return db[_0x0870('0x3d')][_0x0870('0x37')]({'where':{'id':_0x59b9e2[_0x0870('0x53')]['id']}})['then'](handleEntityNotFound(_0x327c37,null))[_0x0870('0x2b')](removeEntity(_0x327c37,null))[_0x0870('0x52')](handleError(_0x327c37,null));};exports[_0x0870('0x62')]=function(_0xffe809,_0x1ade53,_0x3e1884){var _0x47f0a0={'raw':![],'where':{}};var _0x4137bd={};var _0x338e27={'count':0x0,'rows':[]};return db[_0x0870('0x3d')]['findOne']({'where':{'id':_0xffe809['params']['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x1ade53,null))[_0x0870('0x2b')](function(_0x1bdb5b){if(_0x1bdb5b){_0x4137bd[_0x0870('0x41')]=_[_0x0870('0x43')](db[_0x0870('0x63')][_0x0870('0x3e')]);_0x4137bd[_0x0870('0x42')]=_[_0x0870('0x43')](_0xffe809[_0x0870('0x42')]);_0x4137bd[_0x0870('0x44')]=_[_0x0870('0x45')](_0x4137bd[_0x0870('0x41')],_0x4137bd['query']);_0x47f0a0[_0x0870('0x46')]=_[_0x0870('0x45')](_0x4137bd[_0x0870('0x41')],qs[_0x0870('0x47')](_0xffe809['query'][_0x0870('0x47')]));_0x47f0a0[_0x0870('0x46')]=_0x47f0a0[_0x0870('0x46')]['length']?_0x47f0a0['attributes']:_0x4137bd['model'];if(!_0xffe809[_0x0870('0x42')][_0x0870('0x64')](_0x0870('0x65'))){_0x47f0a0[_0x0870('0x23')]=qs[_0x0870('0x23')](_0xffe809['query']['limit']);_0x47f0a0['offset']=qs[_0x0870('0x22')](_0xffe809[_0x0870('0x42')][_0x0870('0x22')]);}_0x47f0a0[_0x0870('0x48')]=qs['sort'](_0xffe809['query'][_0x0870('0x49')]);_0x47f0a0[_0x0870('0x4a')]=qs[_0x0870('0x44')](_['pick'](_0xffe809[_0x0870('0x42')],_0x4137bd['filters']));_0x47f0a0[_0x0870('0x4a')][_0x0870('0x66')]=_0x1bdb5b['id'];if(_0xffe809[_0x0870('0x42')][_0x0870('0x32')]){_0x47f0a0[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x47f0a0[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x47f0a0[_0x0870('0x46')],function(_0x4c23a4){var _0x3bb360={};_0x3bb360[_0x4c23a4]={'$like':'%'+_0xffe809['query'][_0x0870('0x32')]+'%'};return _0x3bb360;})});}_0x47f0a0=_[_0x0870('0x4c')]({},_0x47f0a0,_0xffe809['options']);return db[_0x0870('0x63')][_0x0870('0x25')]({'where':_0x47f0a0[_0x0870('0x4a')]})[_0x0870('0x2b')](function(_0x2a8cbd){_0x338e27[_0x0870('0x25')]=_0x2a8cbd;if(_0xffe809[_0x0870('0x42')][_0x0870('0x4e')]){_0x47f0a0[_0x0870('0x4f')]=[{'all':!![]}];}return db[_0x0870('0x63')]['findAll'](_0x47f0a0);})[_0x0870('0x2b')](function(_0x5ac724){_0x338e27[_0x0870('0x51')]=_0x5ac724;return _0x338e27;});}})['then'](respondWithFilteredResult(_0x1ade53,_0x47f0a0))[_0x0870('0x52')](handleError(_0x1ade53,null));};exports['getHopperHistories']=function(_0x3cc4f9,_0x3a0485,_0x291fe3){var _0x4707e2={'raw':!![],'where':{}};var _0x31dbad={};var _0x14ff43={'count':0x0,'rows':[]};return db[_0x0870('0x3d')][_0x0870('0x67')]({'where':{'id':_0x3cc4f9[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x3a0485,null))[_0x0870('0x2b')](function(_0x3f3d25){if(_0x3f3d25){_0x31dbad[_0x0870('0x41')]=_[_0x0870('0x43')](db[_0x0870('0x68')][_0x0870('0x3e')]);_0x31dbad[_0x0870('0x42')]=_[_0x0870('0x43')](_0x3cc4f9[_0x0870('0x42')]);_0x31dbad[_0x0870('0x44')]=_[_0x0870('0x45')](_0x31dbad[_0x0870('0x41')],_0x31dbad[_0x0870('0x42')]);_0x4707e2['attributes']=_[_0x0870('0x45')](_0x31dbad['model'],qs[_0x0870('0x47')](_0x3cc4f9[_0x0870('0x42')]['fields']));_0x4707e2[_0x0870('0x46')]=_0x4707e2[_0x0870('0x46')][_0x0870('0x54')]?_0x4707e2[_0x0870('0x46')]:_0x31dbad[_0x0870('0x41')];if(!_0x3cc4f9[_0x0870('0x42')][_0x0870('0x64')]('nolimit')){_0x4707e2[_0x0870('0x23')]=qs[_0x0870('0x23')](_0x3cc4f9['query'][_0x0870('0x23')]);_0x4707e2[_0x0870('0x22')]=qs[_0x0870('0x22')](_0x3cc4f9['query']['offset']);}_0x4707e2[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x3cc4f9[_0x0870('0x42')]['sort']);_0x4707e2[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x3cc4f9['query'],_0x31dbad[_0x0870('0x44')]));_0x4707e2[_0x0870('0x4a')][_0x0870('0x66')]=_0x3f3d25['id'];if(_0x3cc4f9['query'][_0x0870('0x32')]){_0x4707e2[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x4707e2[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x4707e2['attributes'],function(_0x2e8e45){var _0x233d6f={};_0x233d6f[_0x2e8e45]={'$like':'%'+_0x3cc4f9['query'][_0x0870('0x32')]+'%'};return _0x233d6f;})});}_0x4707e2=_[_0x0870('0x4c')]({},_0x4707e2,_0x3cc4f9[_0x0870('0x4d')]);return db[_0x0870('0x68')][_0x0870('0x25')]({'where':_0x4707e2[_0x0870('0x4a')]})[_0x0870('0x2b')](function(_0x2e699f){_0x14ff43['count']=_0x2e699f;if(_0x3cc4f9[_0x0870('0x42')][_0x0870('0x4e')]){_0x4707e2[_0x0870('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4707e2);})[_0x0870('0x2b')](function(_0x40b6a0){_0x14ff43[_0x0870('0x51')]=_0x40b6a0;return _0x14ff43;});}})[_0x0870('0x2b')](respondWithFilteredResult(_0x3a0485,_0x4707e2))[_0x0870('0x52')](handleError(_0x3a0485,null));};exports[_0x0870('0x69')]=function(_0x327333,_0x49baa7,_0x3fd965){var _0x5dcf1d={'raw':!![],'where':{}};var _0x482287={};var _0x459889={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0870('0x67')]({'where':{'id':_0x327333[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x49baa7,null))['then'](function(_0x405340){if(_0x405340){_0x482287[_0x0870('0x41')]=_[_0x0870('0x43')](db[_0x0870('0x6a')]['rawAttributes']);_0x482287['query']=_['keys'](_0x327333['query']);_0x482287['filters']=_['intersection'](_0x482287[_0x0870('0x41')],_0x482287[_0x0870('0x42')]);_0x5dcf1d[_0x0870('0x46')]=_[_0x0870('0x45')](_0x482287[_0x0870('0x41')],qs[_0x0870('0x47')](_0x327333[_0x0870('0x42')][_0x0870('0x47')]));_0x5dcf1d[_0x0870('0x46')]=_0x5dcf1d[_0x0870('0x46')][_0x0870('0x54')]?_0x5dcf1d[_0x0870('0x46')]:_0x482287[_0x0870('0x41')];if(!_0x327333['query'][_0x0870('0x64')]('nolimit')){_0x5dcf1d[_0x0870('0x23')]=qs['limit'](_0x327333[_0x0870('0x42')][_0x0870('0x23')]);_0x5dcf1d[_0x0870('0x22')]=qs[_0x0870('0x22')](_0x327333[_0x0870('0x42')][_0x0870('0x22')]);}_0x5dcf1d[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x327333[_0x0870('0x42')][_0x0870('0x49')]);_0x5dcf1d[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x327333[_0x0870('0x42')],_0x482287[_0x0870('0x44')]));_0x5dcf1d['where'][_0x0870('0x66')]=_0x405340['id'];if(_0x327333['query']['filter']){_0x5dcf1d[_0x0870('0x4a')]=_['merge'](_0x5dcf1d[_0x0870('0x4a')],{'$or':_['map'](_0x5dcf1d[_0x0870('0x46')],function(_0x1d352d){var _0x5052db={};_0x5052db[_0x1d352d]={'$like':'%'+_0x327333['query'][_0x0870('0x32')]+'%'};return _0x5052db;})});}_0x5dcf1d=_[_0x0870('0x4c')]({},_0x5dcf1d,_0x327333[_0x0870('0x4d')]);return db[_0x0870('0x6a')][_0x0870('0x25')]({'where':_0x5dcf1d['where']})['then'](function(_0xb7f82f){_0x459889[_0x0870('0x25')]=_0xb7f82f;if(_0x327333['query'][_0x0870('0x4e')]){_0x5dcf1d[_0x0870('0x4f')]=[{'all':!![]}];}return db[_0x0870('0x6a')][_0x0870('0x50')](_0x5dcf1d);})[_0x0870('0x2b')](function(_0xf33861){_0x459889[_0x0870('0x51')]=_0xf33861;return _0x459889;});}})[_0x0870('0x2b')](respondWithFilteredResult(_0x49baa7,_0x5dcf1d))[_0x0870('0x52')](handleError(_0x49baa7,null));};exports[_0x0870('0x6b')]=function(_0x5988f5,_0x3a9d11,_0x425d9f){var _0x5e5ce7={'raw':!![],'where':{}};var _0x120e44={};var _0x1763f5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0870('0x67')]({'where':{'id':_0x5988f5[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x3a9d11,null))[_0x0870('0x2b')](function(_0x518660){if(_0x518660){_0x120e44['model']=_[_0x0870('0x43')](db[_0x0870('0x6c')][_0x0870('0x3e')]);_0x120e44[_0x0870('0x42')]=_[_0x0870('0x43')](_0x5988f5[_0x0870('0x42')]);_0x120e44[_0x0870('0x44')]=_[_0x0870('0x45')](_0x120e44[_0x0870('0x41')],_0x120e44[_0x0870('0x42')]);_0x5e5ce7[_0x0870('0x46')]=_[_0x0870('0x45')](_0x120e44[_0x0870('0x41')],qs[_0x0870('0x47')](_0x5988f5[_0x0870('0x42')][_0x0870('0x47')]));_0x5e5ce7[_0x0870('0x46')]=_0x5e5ce7[_0x0870('0x46')]['length']?_0x5e5ce7[_0x0870('0x46')]:_0x120e44[_0x0870('0x41')];if(!_0x5988f5[_0x0870('0x42')][_0x0870('0x64')]('nolimit')){_0x5e5ce7['limit']=qs[_0x0870('0x23')](_0x5988f5[_0x0870('0x42')]['limit']);_0x5e5ce7[_0x0870('0x22')]=qs['offset'](_0x5988f5['query']['offset']);}_0x5e5ce7[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x5988f5[_0x0870('0x42')]['sort']);_0x5e5ce7[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x5988f5[_0x0870('0x42')],_0x120e44[_0x0870('0x44')]));_0x5e5ce7[_0x0870('0x4a')]['VoiceQueueId']=_0x518660['id'];if(_0x5988f5[_0x0870('0x42')][_0x0870('0x32')]){_0x5e5ce7[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x5e5ce7[_0x0870('0x4a')],{'$or':_['map'](_0x5e5ce7[_0x0870('0x46')],function(_0x625420){var _0x6e0c0d={};_0x6e0c0d[_0x625420]={'$like':'%'+_0x5988f5[_0x0870('0x42')][_0x0870('0x32')]+'%'};return _0x6e0c0d;})});}_0x5e5ce7=_[_0x0870('0x4c')]({},_0x5e5ce7,_0x5988f5['options']);return db['CmHopperBlack']['count']({'where':_0x5e5ce7['where']})[_0x0870('0x2b')](function(_0x550ea8){_0x1763f5[_0x0870('0x25')]=_0x550ea8;if(_0x5988f5[_0x0870('0x42')]['includeAll']){_0x5e5ce7[_0x0870('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5e5ce7);})['then'](function(_0x1dffea){_0x1763f5['rows']=_0x1dffea;return _0x1763f5;});}})[_0x0870('0x2b')](respondWithFilteredResult(_0x3a9d11,_0x5e5ce7))[_0x0870('0x52')](handleError(_0x3a9d11,null));};exports['getTeams']=function(_0x3e1b65,_0x420cf9,_0x27cc7f){var _0x1b6d96={};var _0x57df82={};var _0x2f955d;var _0x1f8243;return db[_0x0870('0x3d')][_0x0870('0x67')]({'where':{'id':_0x3e1b65[_0x0870('0x53')]['id']}})['then'](handleEntityNotFound(_0x420cf9,null))[_0x0870('0x2b')](function(_0x5d740e){if(_0x5d740e){_0x2f955d=_0x5d740e;_0x57df82['model']=_[_0x0870('0x43')](db[_0x0870('0x6d')][_0x0870('0x3e')]);_0x57df82[_0x0870('0x42')]=_['keys'](_0x3e1b65[_0x0870('0x42')]);_0x57df82[_0x0870('0x44')]=_['intersection'](_0x57df82['model'],_0x57df82[_0x0870('0x42')]);_0x1b6d96['attributes']=_['intersection'](_0x57df82[_0x0870('0x41')],qs['fields'](_0x3e1b65[_0x0870('0x42')][_0x0870('0x47')]));_0x1b6d96[_0x0870('0x46')]=_0x1b6d96[_0x0870('0x46')][_0x0870('0x54')]?_0x1b6d96[_0x0870('0x46')]:_0x57df82[_0x0870('0x41')];_0x1b6d96[_0x0870('0x48')]=qs['sort'](_0x3e1b65[_0x0870('0x42')][_0x0870('0x49')]);_0x1b6d96[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x3e1b65[_0x0870('0x42')],_0x57df82[_0x0870('0x44')]));if(_0x3e1b65['query'][_0x0870('0x32')]){_0x1b6d96[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x1b6d96[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x1b6d96['attributes'],function(_0x230518){var _0x4cb0f9={};_0x4cb0f9[_0x230518]={'$like':'%'+_0x3e1b65[_0x0870('0x42')][_0x0870('0x32')]+'%'};return _0x4cb0f9;})});}_0x1b6d96=_['merge']({},_0x1b6d96,_0x3e1b65[_0x0870('0x4d')]);return _0x2f955d[_0x0870('0x6e')](_0x1b6d96);}})[_0x0870('0x2b')](function(_0x1264e5){if(_0x1264e5){_0x1f8243=_0x1264e5[_0x0870('0x54')];if(!_0x3e1b65[_0x0870('0x42')][_0x0870('0x64')](_0x0870('0x65'))){_0x1b6d96[_0x0870('0x23')]=qs['limit'](_0x3e1b65['query']['limit']);_0x1b6d96[_0x0870('0x22')]=qs['offset'](_0x3e1b65[_0x0870('0x42')]['offset']);}return _0x2f955d[_0x0870('0x6e')](_0x1b6d96);}})[_0x0870('0x2b')](function(_0x591ad4){if(_0x591ad4){return _0x591ad4?{'count':_0x1f8243,'rows':_0x591ad4}:null;}})['then'](respondWithResult(_0x420cf9,null))[_0x0870('0x52')](handleError(_0x420cf9,null));};exports[_0x0870('0x6f')]=function(_0x8c595a,_0x37bd4f,_0x35aca0){var _0x427c67=_0x8c595a[_0x0870('0x5c')]['teams'];var _0x20a8c0=_['map'](_0x427c67,'id');return db['Team'][_0x0870('0x50')]({'where':{'id':_0x20a8c0},'attributes':['id'],'include':[{'model':db[_0x0870('0x70')],'as':'Agents','attributes':['id',_0x0870('0x38'),_0x0870('0x71'),_0x0870('0x72'),_0x0870('0x73')],'raw':!![]}]})[_0x0870('0x2b')](function(_0x1a507e){if(_0x1a507e){var _0x110134=_[_0x0870('0x74')](_0x1a507e,function(_0x447a46){var _0x50bf26=_0x447a46[_0x0870('0x2d')]({'plain':!![]});_0x50bf26[_0x0870('0x75')][_0x0870('0x76')](function(_0x193623){_0x193623[_0x0870('0x77')]=_[_0x0870('0x37')](_0x427c67,{'id':_0x50bf26['id']})[_0x0870('0x77')];});return _0x50bf26[_0x0870('0x75')];});return db[_0x0870('0x3d')]['find']({'where':{'id':_0x8c595a[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](function(_0x26cfdf){return db[_0x0870('0x78')][_0x0870('0x79')](function(_0x538153){return _0x26cfdf['addTeams'](_0x20a8c0,{'transaction':_0x538153})[_0x0870('0x2b')](function(){return BPromise[_0x0870('0x7a')](_0x427c67,function(_0x3beb02){return db[_0x0870('0x7b')][_0x0870('0x7c')]({'TeamId':_0x3beb02['id'],'VoiceQueueId':_0x8c595a['params']['id'],'penalty':_0x3beb02[_0x0870('0x77')]},{'transaction':_0x538153});});})['then'](function(){return BPromise[_0x0870('0x7a')](_0x110134,function(_0x3742e0){return db[_0x0870('0x7d')][_0x0870('0x7e')]({'where':{'UserId':_0x3742e0['id'],'VoiceQueueId':_0x8c595a['params']['id']},'defaults':{'penalty':_0x3742e0['penalty']},'transaction':_0x538153});});})[_0x0870('0x2b')](function(){return BPromise[_0x0870('0x7a')](_[_0x0870('0x32')](_0x110134,{'online':!![]}),function(_0x2e4e8e){return db[_0x0870('0x7f')]['upsert']({'membername':_0x2e4e8e[_0x0870('0x38')],'UserId':_0x2e4e8e['id'],'queue_name':_0x26cfdf[_0x0870('0x38')],'VoiceQueueId':_0x26cfdf['id'],'interface':_[_0x0870('0x80')](_0x2e4e8e['interface'])?util['format']('SIP/%s',_0x2e4e8e[_0x0870('0x38')]):_0x2e4e8e[_0x0870('0x73')],'paused':_0x2e4e8e[_0x0870('0x72')]||![],'penalty':_0x2e4e8e[_0x0870('0x77')]},{'transaction':_0x538153});});})[_0x0870('0x2b')](function(){_0x110134[_0x0870('0x76')](function(_0x2200ce){socket[_0x0870('0x81')](_0x0870('0x82'),{'UserId':_0x2200ce['id'],'VoiceQueueId':_0x26cfdf['id']});});});});});}})[_0x0870('0x2b')](respondWithStatusCode(_0x37bd4f,null))['catch'](handleError(_0x37bd4f,null));};exports[_0x0870('0x83')]=function(_0x311436,_0xce737b,_0x57e1c3){return db[_0x0870('0x6d')][_0x0870('0x50')]({'where':{'id':_0x311436[_0x0870('0x42')][_0x0870('0x84')]},'attributes':['id'],'include':[{'model':db[_0x0870('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0870('0x2b')](handleEntityNotFound(_0xce737b,null))['then'](function(_0x17bd07){var _0x10107c=_[_0x0870('0x34')](_0x17bd07,'id');var _0x3ffd1d=[];var _0x123870=[];var _0x769a5c=squel[_0x0870('0x85')]();_0x769a5c['field'](_0x0870('0x86'))[_0x0870('0x87')](_0x0870('0x88'),'tq')['join'](_0x0870('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0870('0x4a')](_0x0870('0x8a'),_0x311436['params']['id']);for(var _0x430964=0x0;_0x430964<_0x17bd07[_0x0870('0x54')];_0x430964+=0x1){let _0x4984e3=_0x17bd07[_0x430964];for(var _0x1b8696=0x0;_0x1b8696<_0x4984e3[_0x0870('0x75')][_0x0870('0x54')];_0x1b8696+=0x1){let _0x3094a0=_0x4984e3[_0x0870('0x75')][_0x1b8696];var _0x2b4c9b=_0x769a5c[_0x0870('0x8b')]();_0x2b4c9b[_0x0870('0x4a')](_0x0870('0x8c'),_0x3094a0['id']);_0x123870['push'](db[_0x0870('0x78')][_0x0870('0x42')](_0x2b4c9b['toString'](),{'type':db[_0x0870('0x78')][_0x0870('0x8d')][_0x0870('0x8e')]})[_0x0870('0x2b')](function(_0x34db1b){if(_0x34db1b[_0x0870('0x54')]===0x1){return _0x3094a0['id'];}else{var _0x1d5c45=_[_0x0870('0x8f')](_[_0x0870('0x34')](_0x34db1b,_0x0870('0x90')),function(_0x27c046){return _[_0x0870('0x91')](_0x10107c,_0x27c046);});if(_0x1d5c45){return _0x3094a0['id'];}}}));}}return BPromise['all'](_0x123870)[_0x0870('0x2b')](function(_0x836f42){_0x3ffd1d=_(_0x3ffd1d)[_0x0870('0x92')](_0x836f42)[_0x0870('0x93')]()['value']();return db[_0x0870('0x3d')]['find']({'where':{'id':_0x311436[_0x0870('0x53')]['id']}})['then'](function(_0x4b1996){return db[_0x0870('0x78')][_0x0870('0x79')](function(_0x476beb){return _0x4b1996[_0x0870('0x83')](_0x311436[_0x0870('0x42')]['ids'],{'transaction':_0x476beb})[_0x0870('0x2b')](function(){if(!_['isEmpty'](_0x3ffd1d)){return _0x4b1996[_0x0870('0x94')](_0x3ffd1d,{'transaction':_0x476beb})[_0x0870('0x2b')](function(){return db[_0x0870('0x7f')][_0x0870('0x2c')]({'where':{'VoiceQueueId':_0x311436['params']['id'],'UserId':_0x3ffd1d},'transaction':_0x476beb});});}})['then'](function(){_0x3ffd1d[_0x0870('0x76')](function(_0x47b9a4){socket['emit'](_0x0870('0x95'),{'UserId':_0x47b9a4,'VoiceQueueId':_0x4b1996['id']});});});});});});})['then'](respondWithStatusCode(_0xce737b,null))[_0x0870('0x52')](handleError(_0xce737b,null));};exports[_0x0870('0x96')]=function(_0x5946e5,_0x5cc277,_0x7fa183){var _0x1df81e,_0x47e6f0;return db[_0x0870('0x3d')][_0x0870('0x37')]({'where':{'id':_0x5946e5[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x5cc277,null))[_0x0870('0x2b')](function(_0x355625){if(_0x355625){_0x47e6f0=_0x355625;return _0x355625[_0x0870('0x96')](_0x5946e5[_0x0870('0x5c')][_0x0870('0x84')],_[_0x0870('0x5b')](_0x5946e5[_0x0870('0x5c')],[_0x0870('0x84'),'id'])||{})[_0x0870('0x97')](function(_0x2e19c3){for(var _0x2d30a7=0x0;_0x2d30a7<_0x5946e5[_0x0870('0x5c')][_0x0870('0x84')][_0x0870('0x54')];_0x2d30a7+=0x1){socket[_0x0870('0x81')](_0x0870('0x82'),{'UserId':Number(_0x5946e5['body'][_0x0870('0x84')][_0x2d30a7]),'VoiceQueueId':Number(_0x5946e5['params']['id'])});}return _0x2e19c3;});}})[_0x0870('0x2b')](function(_0x5dcafc){_0x1df81e=_0x5dcafc||[];if(_0x47e6f0){return db[_0x0870('0x70')][_0x0870('0x50')]({'where':{'id':_0x5946e5['body']['ids']},'attributes':['id',_0x0870('0x38'),_0x0870('0x71'),_0x0870('0x72'),_0x0870('0x73')],'raw':!![]});}})[_0x0870('0x2b')](function(_0x228413){if(!_[_0x0870('0x98')](_0x228413)){var _0x32ecc2=[];for(var _0x4c771=0x0;_0x4c771<_0x228413[_0x0870('0x54')];_0x4c771++){if(_0x228413[_0x4c771]['online']){_0x32ecc2[_0x0870('0x99')](db[_0x0870('0x7f')][_0x0870('0x7c')]({'membername':_0x228413[_0x4c771][_0x0870('0x38')],'UserId':_0x228413[_0x4c771]['id'],'queue_name':_0x47e6f0[_0x0870('0x38')],'VoiceQueueId':_0x47e6f0['id'],'interface':_[_0x0870('0x80')](_0x228413[_0x4c771]['interface'])?util[_0x0870('0x9a')](_0x0870('0x9b'),_0x228413[_0x4c771][_0x0870('0x38')]):_0x228413[_0x4c771]['interface'],'paused':_0x228413[_0x4c771]['voicePause']||![],'penalty':_0x5946e5[_0x0870('0x5c')]['penalty']||0x0}));}}return BPromise['all'](_0x32ecc2);}})[_0x0870('0x2b')](function(){return _0x1df81e;})['then'](respondWithResult(_0x5cc277,null))[_0x0870('0x52')](handleError(_0x5cc277,null));};exports[_0x0870('0x94')]=function(_0x3dcc59,_0x164246,_0x1474e6){return db[_0x0870('0x3d')][_0x0870('0x37')]({'where':{'id':_0x3dcc59['params']['id']}})['then'](handleEntityNotFound(_0x164246,null))[_0x0870('0x2b')](function(_0x4a7592){if(_0x4a7592){return _0x4a7592[_0x0870('0x94')](_0x3dcc59[_0x0870('0x42')][_0x0870('0x84')])['then'](function(){if(_[_0x0870('0x9c')](_0x3dcc59[_0x0870('0x42')][_0x0870('0x84')])){for(var _0x55f926=0x0;_0x55f926<_0x3dcc59[_0x0870('0x42')][_0x0870('0x84')][_0x0870('0x54')];_0x55f926+=0x1){socket[_0x0870('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x3dcc59[_0x0870('0x42')]['ids'][_0x55f926]),'VoiceQueueId':Number(_0x3dcc59[_0x0870('0x53')]['id'])});}}else{socket[_0x0870('0x81')](_0x0870('0x95'),{'UserId':Number(_0x3dcc59[_0x0870('0x42')][_0x0870('0x84')]),'VoiceQueueId':Number(_0x3dcc59[_0x0870('0x53')]['id'])});}});}})[_0x0870('0x2b')](function(_0x2ae87f){return db['UserVoiceQueueRt'][_0x0870('0x2c')]({'where':{'VoiceQueueId':_0x3dcc59[_0x0870('0x53')]['id'],'UserId':_0x3dcc59[_0x0870('0x42')][_0x0870('0x84')]}})[_0x0870('0x2b')](function(){return _0x2ae87f;});})[_0x0870('0x2b')](respondWithStatusCode(_0x164246,null))[_0x0870('0x52')](handleError(_0x164246,null));};exports[_0x0870('0x9d')]=function(_0x2a14d5,_0x3d99e4,_0x1a04cc){var _0x28e0f2={};var _0x5a1e81={};var _0x1c5f71;var _0x53cd96;return db[_0x0870('0x3d')][_0x0870('0x67')]({'where':{'id':_0x2a14d5['params']['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x3d99e4,null))[_0x0870('0x2b')](function(_0x5afa85){if(_0x5afa85){_0x1c5f71=_0x5afa85;_0x5a1e81[_0x0870('0x41')]=_['keys'](db['User'][_0x0870('0x3e')]);_0x5a1e81[_0x0870('0x42')]=_[_0x0870('0x43')](_0x2a14d5[_0x0870('0x42')]);_0x5a1e81['filters']=_[_0x0870('0x45')](_0x5a1e81[_0x0870('0x41')],_0x5a1e81[_0x0870('0x42')]);_0x28e0f2[_0x0870('0x46')]=_['intersection'](_0x5a1e81[_0x0870('0x41')],qs[_0x0870('0x47')](_0x2a14d5[_0x0870('0x42')][_0x0870('0x47')]));_0x28e0f2['attributes']=_0x28e0f2[_0x0870('0x46')][_0x0870('0x54')]?_0x28e0f2[_0x0870('0x46')]:_0x5a1e81[_0x0870('0x41')];_0x28e0f2['order']=qs[_0x0870('0x49')](_0x2a14d5[_0x0870('0x42')][_0x0870('0x49')]);_0x28e0f2[_0x0870('0x4a')]=qs[_0x0870('0x44')](_['pick'](_0x2a14d5[_0x0870('0x42')],_0x5a1e81['filters']));if(_0x2a14d5['query'][_0x0870('0x32')]){_0x28e0f2['where']=_[_0x0870('0x4c')](_0x28e0f2[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x28e0f2[_0x0870('0x46')],function(_0x3b1f22){var _0x536403={};_0x536403[_0x3b1f22]={'$like':'%'+_0x2a14d5[_0x0870('0x42')]['filter']+'%'};return _0x536403;})});}_0x28e0f2=_[_0x0870('0x4c')]({},_0x28e0f2,_0x2a14d5['options']);return _0x1c5f71[_0x0870('0x9d')](_0x28e0f2);}})[_0x0870('0x2b')](function(_0x2f25c7){if(_0x2f25c7){_0x53cd96=_0x2f25c7[_0x0870('0x54')];if(!_0x2a14d5['query'][_0x0870('0x64')](_0x0870('0x65'))){_0x28e0f2['limit']=qs[_0x0870('0x23')](_0x2a14d5[_0x0870('0x42')][_0x0870('0x23')]);_0x28e0f2[_0x0870('0x22')]=qs[_0x0870('0x22')](_0x2a14d5[_0x0870('0x42')][_0x0870('0x22')]);}return _0x1c5f71[_0x0870('0x9d')](_0x28e0f2);}})[_0x0870('0x2b')](function(_0x8c1405){if(_0x8c1405){return _0x8c1405?{'count':_0x53cd96,'rows':_0x8c1405}:null;}})['then'](respondWithResult(_0x3d99e4,null))[_0x0870('0x52')](handleError(_0x3d99e4,null));};exports[_0x0870('0x9e')]=function(_0x3dcfb8,_0x35fdd1,_0x3bec57){var _0x3be160={};var _0x2ee52e={};var _0x2f4c1e;var _0x48cba9;return db[_0x0870('0x3d')][_0x0870('0x67')]({'where':{'id':_0x3dcfb8[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x35fdd1,null))['then'](function(_0x10e378){if(_0x10e378){_0x2f4c1e=_0x10e378;_0x2ee52e[_0x0870('0x41')]=_[_0x0870('0x43')](db[_0x0870('0x7f')][_0x0870('0x3e')]);_0x2ee52e[_0x0870('0x42')]=_[_0x0870('0x43')](_0x3dcfb8[_0x0870('0x42')]);_0x2ee52e[_0x0870('0x44')]=_[_0x0870('0x45')](_0x2ee52e[_0x0870('0x41')],_0x2ee52e[_0x0870('0x42')]);_0x3be160[_0x0870('0x46')]=_[_0x0870('0x45')](_0x2ee52e[_0x0870('0x41')],qs[_0x0870('0x47')](_0x3dcfb8['query'][_0x0870('0x47')]));_0x3be160['attributes']=_0x3be160[_0x0870('0x46')][_0x0870('0x54')]?_0x3be160[_0x0870('0x46')]:_0x2ee52e[_0x0870('0x41')];_0x3be160[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x3dcfb8[_0x0870('0x42')][_0x0870('0x49')]);_0x3be160['where']=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x3dcfb8[_0x0870('0x42')],_0x2ee52e[_0x0870('0x44')]));if(_0x3dcfb8[_0x0870('0x42')][_0x0870('0x32')]){_0x3be160[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x3be160[_0x0870('0x4a')],{'$or':_['map'](_0x3be160['attributes'],function(_0x32e8b6){var _0x120d00={};_0x120d00[_0x32e8b6]={'$like':'%'+_0x3dcfb8[_0x0870('0x42')]['filter']+'%'};return _0x120d00;})});}_0x3be160=_[_0x0870('0x4c')]({},_0x3be160,_0x3dcfb8[_0x0870('0x4d')]);return _0x2f4c1e[_0x0870('0x9e')](_0x3be160);}})[_0x0870('0x2b')](function(_0x469486){if(_0x469486){_0x48cba9=_0x469486[_0x0870('0x54')];if(!_0x3dcfb8[_0x0870('0x42')][_0x0870('0x64')]('nolimit')){_0x3be160[_0x0870('0x23')]=qs[_0x0870('0x23')](_0x3dcfb8[_0x0870('0x42')][_0x0870('0x23')]);_0x3be160['offset']=qs[_0x0870('0x22')](_0x3dcfb8[_0x0870('0x42')][_0x0870('0x22')]);}return _0x2f4c1e[_0x0870('0x9e')](_0x3be160);}})['then'](function(_0x3e8eed){return _0x3e8eed?{'count':_0x48cba9,'rows':_0x3e8eed}:null;})[_0x0870('0x2b')](respondWithResult(_0x35fdd1,null))[_0x0870('0x52')](handleError(_0x35fdd1,null));};exports[_0x0870('0x9f')]=function(_0x41dda6,_0x5a193b,_0x5a1665){var _0x5d5992={};var _0x133229={};var _0x1f4901;var _0x3f94f2;return db['VoiceQueue'][_0x0870('0x67')]({'where':{'id':_0x41dda6['params']['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x5a193b,null))[_0x0870('0x2b')](function(_0x2d8bce){if(_0x2d8bce){_0x1f4901=_0x2d8bce;_0x133229['model']=_[_0x0870('0x43')](db[_0x0870('0xa0')][_0x0870('0x3e')]);_0x133229[_0x0870('0x42')]=_[_0x0870('0x43')](_0x41dda6[_0x0870('0x42')]);_0x133229['filters']=_[_0x0870('0x45')](_0x133229[_0x0870('0x41')],_0x133229['query']);_0x5d5992[_0x0870('0x46')]=_[_0x0870('0x45')](_0x133229[_0x0870('0x41')],qs[_0x0870('0x47')](_0x41dda6[_0x0870('0x42')]['fields']));_0x5d5992[_0x0870('0x46')]=_0x5d5992[_0x0870('0x46')][_0x0870('0x54')]?_0x5d5992[_0x0870('0x46')]:_0x133229[_0x0870('0x41')];_0x5d5992[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x41dda6[_0x0870('0x42')][_0x0870('0x49')]);_0x5d5992[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x41dda6[_0x0870('0x42')],_0x133229[_0x0870('0x44')]));if(_0x41dda6[_0x0870('0x42')][_0x0870('0x32')]){_0x5d5992['where']=_[_0x0870('0x4c')](_0x5d5992['where'],{'$or':_['map'](_0x5d5992['attributes'],function(_0x935b1a){var _0x28a86f={};_0x28a86f[_0x935b1a]={'$like':'%'+_0x41dda6['query'][_0x0870('0x32')]+'%'};return _0x28a86f;})});}_0x5d5992=_[_0x0870('0x4c')]({},_0x5d5992,_0x41dda6['options']);return _0x1f4901[_0x0870('0x9f')](_0x5d5992);}})[_0x0870('0x2b')](function(_0x1080c3){if(_0x1080c3){_0x3f94f2=_0x1080c3[_0x0870('0x54')];if(!_0x41dda6[_0x0870('0x42')][_0x0870('0x64')](_0x0870('0x65'))){_0x5d5992['limit']=qs['limit'](_0x41dda6[_0x0870('0x42')][_0x0870('0x23')]);_0x5d5992[_0x0870('0x22')]=qs[_0x0870('0x22')](_0x41dda6[_0x0870('0x42')][_0x0870('0x22')]);}return _0x1f4901[_0x0870('0x9f')](_0x5d5992);}})[_0x0870('0x2b')](function(_0x586e3d){if(_0x586e3d){return _0x586e3d?{'count':_0x3f94f2,'rows':_0x586e3d}:null;}})[_0x0870('0x2b')](respondWithResult(_0x5a193b,null))[_0x0870('0x52')](handleError(_0x5a193b,null));};exports['addLists']=function(_0x854100,_0x3ac3b7,_0x27fe59){var _0x2269f0,_0x68f5cb;return db['VoiceQueue'][_0x0870('0x37')]({'where':{'id':_0x854100['params']['id']}})['then'](handleEntityNotFound(_0x3ac3b7,null))['then'](function(_0x4e0f4c){if(_0x4e0f4c){_0x68f5cb=_0x4e0f4c;return _0x4e0f4c[_0x0870('0xa1')](_0x854100[_0x0870('0x5c')][_0x0870('0x84')],_[_0x0870('0x5b')](_0x854100['body'],['ids','id'])||{});}return null;})[_0x0870('0x97')](function(_0x2ff888){var _0x572937;_0x2269f0=_0x2ff888||[];var _0xd02e32=[];if(_0x2ff888){for(var _0x3e83b4=0x0;_0x3e83b4<_0x2ff888['length'];_0x3e83b4+=0x1){var _0x1134e7=_0x2ff888[_0x3e83b4][_0x0870('0x2d')]({'plain':!![]});_0x68f5cb[_0x0870('0xa2')]=_0x854100[_0x0870('0x5c')][_0x0870('0xa2')]?_0x854100['body']['dialCheckDuplicateType']:_0x68f5cb[_0x0870('0xa2')];switch(_0x68f5cb['dialCheckDuplicateType']){case _0x0870('0xa3'):_0x572937=squel['insert']()[_0x0870('0xa4')](_0x0870('0xa5'))[_0x0870('0xa6')](['phone','scheduledAt',_0x0870('0xa7'),_0x0870('0xa8'),_0x0870('0x66'),_0x0870('0x5d'),_0x0870('0x5a')],squel[_0x0870('0x85')]()[_0x0870('0xa9')](_0x0870('0xaa'),_0x0870('0xaa'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0xac'))[_0x0870('0xa9')]('id',_0x0870('0xa7'))[_0x0870('0xa9')](_0x1134e7[_0x0870('0xad')]['toString'](),_0x0870('0xa8'))[_0x0870('0xa9')](_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')](),_0x0870('0x66'))[_0x0870('0xa9')]('NOW()',_0x0870('0x5d'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0x5a'))['from'](_0x0870('0xaf'))['where'](_0x0870('0xb0'))[_0x0870('0x4a')](_0x0870('0xb1'),_0x1134e7[_0x0870('0xad')][_0x0870('0xae')]())['where'](_0x0870('0xb2'))[_0x0870('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0870('0x85')]()[_0x0870('0xa9')](_0x0870('0xb3'))[_0x0870('0x87')]('cm_hopper_final')[_0x0870('0x4a')](_0x0870('0x8a'),_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')]()))['where'](_0x0870('0xb4'),squel[_0x0870('0x85')]()['field'](_0x0870('0xb5'))[_0x0870('0x87')](_0x0870('0xa5'))['where'](_0x0870('0x8a'),_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')]())))[_0x0870('0xae')]();break;case _0x0870('0xb6'):_0x572937=squel[_0x0870('0xb7')]()[_0x0870('0xa4')](_0x0870('0xa5'))[_0x0870('0xa6')]([_0x0870('0xaa'),'scheduledAt',_0x0870('0xa7'),_0x0870('0xa8'),'VoiceQueueId',_0x0870('0x5d'),'updatedAt'],squel[_0x0870('0x85')]()[_0x0870('0xa9')](_0x0870('0xaa'),_0x0870('0xaa'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0xac'))['field']('id',_0x0870('0xa7'))[_0x0870('0xa9')](_0x1134e7[_0x0870('0xad')][_0x0870('0xae')](),_0x0870('0xa8'))[_0x0870('0xa9')](_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')](),_0x0870('0x66'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0x5d'))['field']('NOW()',_0x0870('0x5a'))[_0x0870('0x87')](_0x0870('0xaf'))[_0x0870('0x4a')]('deletedAt\x20IS\x20NULL')[_0x0870('0x4a')](_0x0870('0xb1'),_0x1134e7['CmListId'][_0x0870('0xae')]())[_0x0870('0x4a')](_0x0870('0xb2'))[_0x0870('0x4a')](_0x0870('0xb4'),squel[_0x0870('0x85')]()[_0x0870('0xa9')]('COALESCE(phone,\x27\x27)')[_0x0870('0x87')](_0x0870('0xa5'))[_0x0870('0x4a')]('VoiceQueueId\x20=\x20?',_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')]())))[_0x0870('0xae')]();break;default:_0x572937=squel[_0x0870('0xb7')]()[_0x0870('0xa4')](_0x0870('0xa5'))[_0x0870('0xa6')]([_0x0870('0xaa'),_0x0870('0xac'),_0x0870('0xa7'),_0x0870('0xa8'),_0x0870('0x66'),_0x0870('0x5d'),_0x0870('0x5a')],squel[_0x0870('0x85')]()['field']('phone',_0x0870('0xaa'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0xac'))[_0x0870('0xa9')]('id',_0x0870('0xa7'))['field'](_0x1134e7[_0x0870('0xad')][_0x0870('0xae')](),_0x0870('0xa8'))['field'](_0x854100[_0x0870('0x53')]['id'][_0x0870('0xae')](),_0x0870('0x66'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0x5d'))[_0x0870('0xa9')](_0x0870('0xab'),_0x0870('0x5a'))[_0x0870('0x87')](_0x0870('0xaf'))[_0x0870('0x4a')](_0x0870('0xb0'))[_0x0870('0x4a')](_0x0870('0xb1'),_0x1134e7[_0x0870('0xad')][_0x0870('0xae')]())['where'](_0x0870('0xb2')))[_0x0870('0xae')]();}_0xd02e32['push'](db[_0x0870('0x78')]['query'](_0x572937));}return BPromise[_0x0870('0xb8')](_0xd02e32);}})[_0x0870('0x2b')](function(){return _0x2269f0;})['then'](respondWithResult(_0x3ac3b7,null))[_0x0870('0x52')](handleError(_0x3ac3b7,null));};exports[_0x0870('0xb9')]=function(_0x514725,_0x1be384,_0x223cf3){return db['VoiceQueue'][_0x0870('0x37')]({'where':{'id':_0x514725['params']['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x1be384,null))[_0x0870('0x2b')](function(_0x5c7e61){if(_0x5c7e61){return _0x5c7e61['removeLists'](_0x514725[_0x0870('0x42')][_0x0870('0x84')]);}})[_0x0870('0x2b')](function(_0x3f57eb){if(_0x3f57eb){return db[_0x0870('0x63')][_0x0870('0x2c')]({'where':{'ListId':_0x514725['query']['ids'],'VoiceQueueId':_0x514725[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](function(){return _0x3f57eb;});}})[_0x0870('0x2b')](respondWithStatusCode(_0x1be384,null))[_0x0870('0x52')](handleError(_0x1be384,null));};exports[_0x0870('0xba')]=function(_0x17a6de,_0x35bae0,_0x40f690){var _0x5d36ef={};var _0x13c0ef={};var _0x8f9631;var _0x20cc7e;return db[_0x0870('0x3d')][_0x0870('0x67')]({'where':{'id':_0x17a6de[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x35bae0,null))[_0x0870('0x2b')](function(_0x57c6a9){if(_0x57c6a9){_0x8f9631=_0x57c6a9;_0x13c0ef[_0x0870('0x41')]=_['keys'](db[_0x0870('0xa0')]['rawAttributes']);_0x13c0ef[_0x0870('0x42')]=_[_0x0870('0x43')](_0x17a6de[_0x0870('0x42')]);_0x13c0ef[_0x0870('0x44')]=_['intersection'](_0x13c0ef[_0x0870('0x41')],_0x13c0ef[_0x0870('0x42')]);_0x5d36ef['attributes']=_[_0x0870('0x45')](_0x13c0ef[_0x0870('0x41')],qs[_0x0870('0x47')](_0x17a6de[_0x0870('0x42')][_0x0870('0x47')]));_0x5d36ef[_0x0870('0x46')]=_0x5d36ef['attributes'][_0x0870('0x54')]?_0x5d36ef[_0x0870('0x46')]:_0x13c0ef[_0x0870('0x41')];_0x5d36ef[_0x0870('0x48')]=qs[_0x0870('0x49')](_0x17a6de[_0x0870('0x42')][_0x0870('0x49')]);_0x5d36ef[_0x0870('0x4a')]=qs[_0x0870('0x44')](_[_0x0870('0x4b')](_0x17a6de[_0x0870('0x42')],_0x13c0ef['filters']));if(_0x17a6de[_0x0870('0x42')]['filter']){_0x5d36ef[_0x0870('0x4a')]=_[_0x0870('0x4c')](_0x5d36ef[_0x0870('0x4a')],{'$or':_[_0x0870('0x34')](_0x5d36ef[_0x0870('0x46')],function(_0x5dd424){var _0xbb395f={};_0xbb395f[_0x5dd424]={'$like':'%'+_0x17a6de[_0x0870('0x42')]['filter']+'%'};return _0xbb395f;})});}_0x5d36ef=_[_0x0870('0x4c')]({},_0x5d36ef,_0x17a6de['options']);return _0x8f9631[_0x0870('0xba')](_0x5d36ef);}})[_0x0870('0x2b')](function(_0x99a8af){if(_0x99a8af){_0x20cc7e=_0x99a8af[_0x0870('0x54')];if(!_0x17a6de[_0x0870('0x42')][_0x0870('0x64')](_0x0870('0x65'))){_0x5d36ef['limit']=qs[_0x0870('0x23')](_0x17a6de[_0x0870('0x42')][_0x0870('0x23')]);_0x5d36ef[_0x0870('0x22')]=qs[_0x0870('0x22')](_0x17a6de['query'][_0x0870('0x22')]);}return _0x8f9631['getBlackLists'](_0x5d36ef);}})[_0x0870('0x2b')](function(_0x44d3b0){if(_0x44d3b0){return _0x44d3b0?{'count':_0x20cc7e,'rows':_0x44d3b0}:null;}})[_0x0870('0x2b')](respondWithResult(_0x35bae0,null))['catch'](handleError(_0x35bae0,null));};exports[_0x0870('0xbb')]=function(_0x9b7a48,_0x1a4f2a,_0x6c660e){var _0x50f242,_0x9f0883;return db['VoiceQueue'][_0x0870('0x37')]({'where':{'id':_0x9b7a48[_0x0870('0x53')]['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x1a4f2a,null))[_0x0870('0x2b')](function(_0x15a4ac){if(_0x15a4ac){_0x9f0883=_0x15a4ac;return _0x15a4ac[_0x0870('0xbb')](_0x9b7a48[_0x0870('0x5c')][_0x0870('0x84')],_[_0x0870('0x5b')](_0x9b7a48[_0x0870('0x5c')],['ids','id'])||{});}return null;})['spread'](function(_0x2d5b11){var _0x509ef5;_0x50f242=_0x2d5b11||[];var _0x4293ab=[];if(_0x2d5b11){for(var _0x3bd510=0x0;_0x3bd510<_0x2d5b11['length'];_0x3bd510+=0x1){var _0x5f4110=_0x2d5b11[_0x3bd510][_0x0870('0x2d')]({'plain':!![]});_0x509ef5=squel[_0x0870('0xb7')]()[_0x0870('0xa4')](_0x0870('0xbc'))[_0x0870('0xa6')](['phone',_0x0870('0xa7'),_0x0870('0xa8'),'VoiceQueueId',_0x0870('0x5d'),_0x0870('0x5a')],squel[_0x0870('0x85')]()['field'](_0x0870('0xaa'),_0x0870('0xaa'))['field']('id','ContactId')[_0x0870('0xa9')](_0x5f4110[_0x0870('0xad')]['toString'](),_0x0870('0xa8'))[_0x0870('0xa9')](_0x9b7a48[_0x0870('0x53')]['id'][_0x0870('0xae')](),_0x0870('0x66'))[_0x0870('0xa9')]('NOW()',_0x0870('0x5d'))['field'](_0x0870('0xab'),_0x0870('0x5a'))[_0x0870('0x87')](_0x0870('0xaf'))[_0x0870('0x4a')](_0x0870('0xb0'))[_0x0870('0x4a')](_0x0870('0xb1'),_0x5f4110[_0x0870('0xad')][_0x0870('0xae')]())[_0x0870('0x4a')](_0x0870('0xb2')))[_0x0870('0xae')]();_0x4293ab['push'](db[_0x0870('0x78')][_0x0870('0x42')](_0x509ef5));}return BPromise[_0x0870('0xb8')](_0x4293ab);}})[_0x0870('0x2b')](function(){return _0x50f242;})['then'](respondWithResult(_0x1a4f2a,null))[_0x0870('0x52')](handleError(_0x1a4f2a,null));};exports['removeBlackLists']=function(_0x2e7a01,_0x2b04cb,_0x343648){return db[_0x0870('0x3d')]['find']({'where':{'id':_0x2e7a01['params']['id']}})[_0x0870('0x2b')](handleEntityNotFound(_0x2b04cb,null))[_0x0870('0x2b')](function(_0x5d0f3d){if(_0x5d0f3d){return _0x5d0f3d[_0x0870('0xbd')](_0x2e7a01[_0x0870('0x42')][_0x0870('0x84')]);}})[_0x0870('0x2b')](function(_0x46f379){if(_0x46f379){return db[_0x0870('0x6c')][_0x0870('0x2c')]({'where':{'ListId':_0x2e7a01[_0x0870('0x42')][_0x0870('0x84')],'VoiceQueueId':_0x2e7a01['params']['id']}})[_0x0870('0x2b')](function(){return _0x46f379;});}})[_0x0870('0x2b')](respondWithStatusCode(_0x2b04cb,null))['catch'](handleError(_0x2b04cb,null));}; \ No newline at end of file +var _0x130e=['type','find','name','send','VoiceQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','updatedAt','createdAt','UserProfileSection','UserProfileResource','error','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','addTeams','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','push','isNil','isArray','emit','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','select','phone','NOW()','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','removeLists','CmList','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x130e,0x143));var _0xe130=function(_0x48092d,_0x4e1c8a){_0x48092d=_0x48092d-0x0;var _0x2cb71c=_0x130e[_0x48092d];return _0x2cb71c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe130('0x0'));var zipdir=require(_0xe130('0x1'));var jsonpatch=require(_0xe130('0x2'));var rp=require(_0xe130('0x3'));var moment=require('moment');var BPromise=require(_0xe130('0x4'));var Mustache=require(_0xe130('0x5'));var util=require('util');var path=require(_0xe130('0x6'));var sox=require(_0xe130('0x7'));var csv=require(_0xe130('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe130('0x9'));var squel=require(_0xe130('0xa'));var crypto=require(_0xe130('0xb'));var jsforce=require(_0xe130('0xc'));var deskjs=require(_0xe130('0xd'));var toCsv=require(_0xe130('0x8'));var querystring=require('querystring');var Papa=require(_0xe130('0xe'));var Redis=require(_0xe130('0xf'));var authService=require(_0xe130('0x10'));var qs=require(_0xe130('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe130('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe130('0x13'));var config=require(_0xe130('0x14'));var licenseUtil=require(_0xe130('0x15'));var db=require(_0xe130('0x16'))['db'];config['redis']=_[_0xe130('0x17')](config['redis'],{'host':_0xe130('0x18'),'port':0x18eb});var socket=require(_0xe130('0x19'))(new Redis(config[_0xe130('0x1a')]));require(_0xe130('0x1b'))[_0xe130('0x1c')](socket);function respondWithStatusCode(_0x4aa807,_0x2bead0){_0x2bead0=_0x2bead0||0xcc;return function(_0x39a45b){if(_0x39a45b){return _0x4aa807[_0xe130('0x1d')](_0x2bead0);}return _0x4aa807[_0xe130('0x1e')](_0x2bead0)[_0xe130('0x1f')]();};}function respondWithResult(_0x3268dd,_0x59c686){_0x59c686=_0x59c686||0xc8;return function(_0x31b891){if(_0x31b891){return _0x3268dd['status'](_0x59c686)[_0xe130('0x20')](_0x31b891);}};}function respondWithFilteredResult(_0x1ed5d6,_0x10f6c1){return function(_0x422dce){if(_0x422dce){var _0x5173f9=typeof _0x10f6c1['offset']===_0xe130('0x21')&&typeof _0x10f6c1[_0xe130('0x22')]==='undefined';var _0x344184=_0x422dce['count'];var _0x53d64f=_0x5173f9?0x0:_0x10f6c1[_0xe130('0x23')];var _0x38a03f=_0x5173f9?_0x422dce[_0xe130('0x24')]:_0x10f6c1[_0xe130('0x23')]+_0x10f6c1[_0xe130('0x22')];var _0x1f62f7;if(_0x38a03f>=_0x344184){_0x38a03f=_0x344184;_0x1f62f7=0xc8;}else{_0x1f62f7=0xce;}_0x1ed5d6['status'](_0x1f62f7);return _0x1ed5d6[_0xe130('0x25')](_0xe130('0x26'),_0x53d64f+'-'+_0x38a03f+'/'+_0x344184)[_0xe130('0x20')](_0x422dce);}return null;};}function patchUpdates(_0x34694a){return function(_0x50dc0c){try{jsonpatch[_0xe130('0x27')](_0x50dc0c,_0x34694a,!![]);}catch(_0x29c8c1){return BPromise[_0xe130('0x28')](_0x29c8c1);}return _0x50dc0c[_0xe130('0x29')]();};}function saveUpdates(_0x1b464d,_0xcf322e){return function(_0x189eae){if(_0x189eae){return _0x189eae[_0xe130('0x2a')](_0x1b464d)[_0xe130('0x2b')](function(_0x12b49a){return _0x12b49a;});}return null;};}function removeEntity(_0xebdd33,_0x2d0f1a){return function(_0x325cde){if(_0x325cde){return _0x325cde[_0xe130('0x2c')]()[_0xe130('0x2b')](function(){var _0x3f5fb8=_0x325cde[_0xe130('0x2d')]({'plain':!![]});var _0x298ead=[{'name':_0xe130('0x2e'),'value':_0xe130('0x2f'),'ignore':![]},{'name':_0xe130('0x30'),'value':_0xe130('0x31'),'ignore':![]}];var _0x12589a=_(_0x298ead)[_0xe130('0x32')](_0xe130('0x33'))[_0xe130('0x34')](_0xe130('0x35'))[_0xe130('0x35')]();if(_[_0xe130('0x36')](_0x12589a,_0x3f5fb8[_0xe130('0x37')])){return;}var _0x399728=_[_0xe130('0x38')](_0x298ead,[_0xe130('0x35'),_0x3f5fb8['type']])[_0xe130('0x39')];return db['UserProfileResource'][_0xe130('0x2c')]({'where':{'type':_0x399728,'resourceId':_0x3f5fb8['id']}})[_0xe130('0x2b')](function(){return _0x325cde;});})[_0xe130('0x2b')](function(){_0xebdd33['status'](0xcc)[_0xe130('0x1f')]();});}};}function handleEntityNotFound(_0xd906bc,_0x1ceded){return function(_0x153719){if(!_0x153719){_0xd906bc[_0xe130('0x1d')](0x194);}return _0x153719;};}function handleError(_0x222dce,_0x3f8011){_0x3f8011=_0x3f8011||0x1f4;return function(_0x221f3f){logger['error'](_0x221f3f['stack']);if(_0x221f3f[_0xe130('0x39')]){delete _0x221f3f[_0xe130('0x39')];}_0x222dce[_0xe130('0x1e')](_0x3f8011)[_0xe130('0x3a')](_0x221f3f);};}exports['index']=function(_0x327848,_0x2160c3){var _0x24af8e={},_0x32f68c={},_0x3196db={'count':0x0,'rows':[]};var _0x30bb72=_[_0xe130('0x34')](db[_0xe130('0x3b')][_0xe130('0x3c')],function(_0x2e442a){return{'name':_0x2e442a[_0xe130('0x3d')],'type':_0x2e442a[_0xe130('0x37')]['key']};});_0x32f68c[_0xe130('0x3e')]=_[_0xe130('0x34')](_0x30bb72,'name');_0x32f68c[_0xe130('0x3f')]=_['keys'](_0x327848['query']);_0x32f68c[_0xe130('0x40')]=_[_0xe130('0x41')](_0x32f68c['model'],_0x32f68c[_0xe130('0x3f')]);_0x24af8e[_0xe130('0x42')]=_[_0xe130('0x41')](_0x32f68c[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x327848['query'][_0xe130('0x43')]));_0x24af8e[_0xe130('0x42')]=_0x24af8e[_0xe130('0x42')][_0xe130('0x44')]?_0x24af8e[_0xe130('0x42')]:_0x32f68c[_0xe130('0x3e')];if(!_0x327848[_0xe130('0x3f')][_0xe130('0x45')](_0xe130('0x46'))){_0x24af8e[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x327848[_0xe130('0x3f')]['limit']);_0x24af8e[_0xe130('0x23')]=qs[_0xe130('0x23')](_0x327848[_0xe130('0x3f')][_0xe130('0x23')]);}_0x24af8e[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x327848[_0xe130('0x3f')][_0xe130('0x48')]);_0x24af8e[_0xe130('0x49')]=qs['filters'](_['pick'](_0x327848[_0xe130('0x3f')],_0x32f68c[_0xe130('0x40')]),_0x30bb72);if(_0x327848[_0xe130('0x3f')][_0xe130('0x32')]){_0x24af8e[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x24af8e[_0xe130('0x49')],{'$or':_[_0xe130('0x34')](_0x30bb72,function(_0x3a5c16){if(_0x3a5c16[_0xe130('0x37')]!==_0xe130('0x4b')){var _0x22a8e3={};_0x22a8e3[_0x3a5c16['name']]={'$like':'%'+_0x327848[_0xe130('0x3f')]['filter']+'%'};return _0x22a8e3;}})});}_0x24af8e=_[_0xe130('0x4a')]({},_0x24af8e,_0x327848[_0xe130('0x4c')]);var _0x45e247={'where':_0x24af8e[_0xe130('0x49')]};return db[_0xe130('0x3b')][_0xe130('0x24')](_0x45e247)[_0xe130('0x2b')](function(_0x6767fa){_0x3196db[_0xe130('0x24')]=_0x6767fa;if(_0x327848[_0xe130('0x3f')]['includeAll']){_0x24af8e[_0xe130('0x4d')]=[{'all':!![]}];}return db[_0xe130('0x3b')][_0xe130('0x4e')](_0x24af8e);})[_0xe130('0x2b')](function(_0x307f6e){_0x3196db[_0xe130('0x4f')]=_0x307f6e;return _0x3196db;})['then'](respondWithFilteredResult(_0x2160c3,_0x24af8e))[_0xe130('0x50')](handleError(_0x2160c3,null));};exports[_0xe130('0x51')]=function(_0x24d4e3,_0x104787){var _0x23fe52={'raw':![],'where':{'id':_0x24d4e3[_0xe130('0x52')]['id']}},_0x47eca1={};_0x47eca1['model']=_[_0xe130('0x53')](db['VoiceQueue'][_0xe130('0x3c')]);_0x47eca1[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x24d4e3['query']);_0x47eca1[_0xe130('0x40')]=_[_0xe130('0x41')](_0x47eca1['model'],_0x47eca1['query']);_0x23fe52[_0xe130('0x42')]=_[_0xe130('0x41')](_0x47eca1[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x24d4e3['query'][_0xe130('0x43')]));_0x23fe52[_0xe130('0x42')]=_0x23fe52[_0xe130('0x42')][_0xe130('0x44')]?_0x23fe52[_0xe130('0x42')]:_0x47eca1[_0xe130('0x3e')];if(_0x24d4e3[_0xe130('0x3f')]['includeAll']){_0x23fe52['include']=[{'all':!![]}];}_0x23fe52=_[_0xe130('0x4a')]({},_0x23fe52,_0x24d4e3[_0xe130('0x4c')]);return db[_0xe130('0x3b')]['find'](_0x23fe52)['then'](handleEntityNotFound(_0x104787,null))[_0xe130('0x2b')](respondWithResult(_0x104787,null))['catch'](handleError(_0x104787,null));};exports[_0xe130('0x54')]=function(_0x3de81d,_0x4ea4f7){return db[_0xe130('0x3b')][_0xe130('0x54')](_0x3de81d[_0xe130('0x55')],{})['then'](function(_0x2ec041){var _0x415198=_0x3de81d[_0xe130('0x56')][_0xe130('0x2d')]({'plain':!![]});if(!_0x415198)throw new Error(_0xe130('0x57'));if(_0x415198[_0xe130('0x58')]===_0xe130('0x56')){var _0x48263e=_0x2ec041[_0xe130('0x2d')]({'plain':!![]});var _0x3c4fce=[{'name':_0xe130('0x2e'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xe130('0x31')}];var _0x320c2b=_[_0xe130('0x38')](_0x3c4fce,[_0xe130('0x35'),_0x48263e['type']])[_0xe130('0x39')];return db['UserProfileSection'][_0xe130('0x38')]({'where':{'name':_0x320c2b,'userProfileId':_0x415198[_0xe130('0x59')]},'raw':!![]})['then'](function(_0x3dfa42){if(_0x3dfa42&&_0x3dfa42[_0xe130('0x5a')]===0x0){return db['UserProfileResource'][_0xe130('0x54')]({'name':_0x48263e[_0xe130('0x39')],'resourceId':_0x48263e['id'],'type':_0x3dfa42['name'],'sectionId':_0x3dfa42['id']},{})[_0xe130('0x2b')](function(){return _0x2ec041;});}else{return _0x2ec041;}})[_0xe130('0x50')](function(_0x44121c){logger['error'](_0xe130('0x5b'),_0x44121c);throw _0x44121c;});}return _0x2ec041;})[_0xe130('0x2b')](respondWithResult(_0x4ea4f7,0xc9))['catch'](handleError(_0x4ea4f7,null));};exports['clone']=function(_0x15ddb6,_0x264eed){var _0x47c396={'where':{'id':_0x15ddb6[_0xe130('0x52')]['id']}},_0x546221={};_0x546221[_0xe130('0x3e')]=_[_0xe130('0x53')](db[_0xe130('0x3b')][_0xe130('0x3c')]);_0x47c396['attributes']=_[_0xe130('0x41')](_0x546221[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x15ddb6['query'][_0xe130('0x43')]));_0x47c396[_0xe130('0x42')]=_0x47c396[_0xe130('0x42')][_0xe130('0x44')]?_0x47c396[_0xe130('0x42')]:_0x546221[_0xe130('0x3e')];if(_0x15ddb6[_0xe130('0x3f')][_0xe130('0x5c')]){_0x47c396[_0xe130('0x4d')]=[{'all':!![]}];}_0x47c396=_[_0xe130('0x4a')]({},_0x47c396,_0x15ddb6[_0xe130('0x4c')]);return db[_0xe130('0x3b')][_0xe130('0x38')](_0x47c396)[_0xe130('0x2b')](handleEntityNotFound(_0x264eed,null))[_0xe130('0x2b')](function(_0x22a06e){if(_0x22a06e){var _0x140222=_0x22a06e[_0xe130('0x2d')]({'plain':!![]});_0x140222=qs[_0xe130('0x5d')](_0x140222,['id','createdAt',_0xe130('0x5e')]);_0x15ddb6[_0xe130('0x55')]=_[_0xe130('0x5d')](_0x15ddb6[_0xe130('0x55')],['id',_0xe130('0x5f'),_0xe130('0x5e')]);return db[_0xe130('0x3b')]['create'](_['merge'](_0x140222,_0x15ddb6['body']),{'include':_0x15ddb6[_0xe130('0x3f')][_0xe130('0x5c')]?[{'all':!![]}]:undefined})[_0xe130('0x2b')](function(_0x8ebc5e){var _0x4fb567=_0x15ddb6[_0xe130('0x56')]['get']({'plain':!![]});if(!_0x4fb567)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fb567['role']===_0xe130('0x56')){var _0x1425f4=_0x8ebc5e[_0xe130('0x2d')]({'plain':!![]});var _0x21e37d=[{'name':_0xe130('0x2e'),'value':_0xe130('0x2f')},{'name':_0xe130('0x30'),'value':_0xe130('0x31')}];var _0x4638e4=_[_0xe130('0x38')](_0x21e37d,['value',_0x1425f4[_0xe130('0x37')]])[_0xe130('0x39')];return db[_0xe130('0x60')][_0xe130('0x38')]({'where':{'name':_0x4638e4,'userProfileId':_0x4fb567[_0xe130('0x59')]},'raw':!![]})[_0xe130('0x2b')](function(_0x358286){if(_0x358286&&_0x358286[_0xe130('0x5a')]===0x0){return db[_0xe130('0x61')][_0xe130('0x54')]({'name':_0x1425f4[_0xe130('0x39')],'resourceId':_0x1425f4['id'],'type':_0x358286['name'],'sectionId':_0x358286['id']},{})[_0xe130('0x2b')](function(){return _0x8ebc5e;});}else{return _0x8ebc5e;}})[_0xe130('0x50')](function(_0x2088d4){logger[_0xe130('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2088d4);throw _0x2088d4;});}return _0x8ebc5e;});}})['then'](respondWithResult(_0x264eed,0xc9))['catch'](handleError(_0x264eed,null));};exports[_0xe130('0x2a')]=function(_0x125088,_0x883df9){if(_0x125088[_0xe130('0x55')]['id']){delete _0x125088[_0xe130('0x55')]['id'];}return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x125088[_0xe130('0x52')]['id']}})['then'](handleEntityNotFound(_0x883df9,null))[_0xe130('0x2b')](saveUpdates(_0x125088[_0xe130('0x55')],null))[_0xe130('0x2b')](respondWithResult(_0x883df9,null))[_0xe130('0x50')](handleError(_0x883df9,null));};exports[_0xe130('0x2c')]=function(_0x818412,_0x10dbcb){return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x818412[_0xe130('0x52')]['id']}})['then'](handleEntityNotFound(_0x10dbcb,null))[_0xe130('0x2b')](removeEntity(_0x10dbcb,null))['catch'](handleError(_0x10dbcb,null));};exports[_0xe130('0x63')]=function(_0x1012df,_0x13f8f2,_0x40ed43){var _0x242afd={'raw':![],'where':{}};var _0xc41262={};var _0x54eb20={'count':0x0,'rows':[]};return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x1012df[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x13f8f2,null))[_0xe130('0x2b')](function(_0x4d3e15){if(_0x4d3e15){_0xc41262['model']=_[_0xe130('0x53')](db[_0xe130('0x65')][_0xe130('0x3c')]);_0xc41262[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x1012df['query']);_0xc41262[_0xe130('0x40')]=_[_0xe130('0x41')](_0xc41262['model'],_0xc41262[_0xe130('0x3f')]);_0x242afd[_0xe130('0x42')]=_[_0xe130('0x41')](_0xc41262[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x1012df[_0xe130('0x3f')][_0xe130('0x43')]));_0x242afd[_0xe130('0x42')]=_0x242afd[_0xe130('0x42')][_0xe130('0x44')]?_0x242afd[_0xe130('0x42')]:_0xc41262[_0xe130('0x3e')];if(!_0x1012df[_0xe130('0x3f')][_0xe130('0x45')](_0xe130('0x46'))){_0x242afd[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x1012df['query'][_0xe130('0x22')]);_0x242afd['offset']=qs['offset'](_0x1012df['query']['offset']);}_0x242afd[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x1012df['query'][_0xe130('0x48')]);_0x242afd[_0xe130('0x49')]=qs[_0xe130('0x40')](_['pick'](_0x1012df[_0xe130('0x3f')],_0xc41262['filters']));_0x242afd[_0xe130('0x49')][_0xe130('0x66')]=_0x4d3e15['id'];if(_0x1012df[_0xe130('0x3f')][_0xe130('0x32')]){_0x242afd[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x242afd['where'],{'$or':_[_0xe130('0x34')](_0x242afd['attributes'],function(_0x11c464){var _0x2e24fe={};_0x2e24fe[_0x11c464]={'$like':'%'+_0x1012df[_0xe130('0x3f')]['filter']+'%'};return _0x2e24fe;})});}_0x242afd=_[_0xe130('0x4a')]({},_0x242afd,_0x1012df['options']);return db[_0xe130('0x65')][_0xe130('0x24')]({'where':_0x242afd[_0xe130('0x49')]})[_0xe130('0x2b')](function(_0x4ef2b2){_0x54eb20[_0xe130('0x24')]=_0x4ef2b2;if(_0x1012df[_0xe130('0x3f')][_0xe130('0x5c')]){_0x242afd['include']=[{'all':!![]}];}return db[_0xe130('0x65')][_0xe130('0x4e')](_0x242afd);})['then'](function(_0x22ce34){_0x54eb20[_0xe130('0x4f')]=_0x22ce34;return _0x54eb20;});}})['then'](respondWithFilteredResult(_0x13f8f2,_0x242afd))[_0xe130('0x50')](handleError(_0x13f8f2,null));};exports[_0xe130('0x67')]=function(_0x27e5a3,_0x33683d,_0x302576){var _0x186c27={'raw':!![],'where':{}};var _0x4a36f6={};var _0x2967fa={'count':0x0,'rows':[]};return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x27e5a3[_0xe130('0x52')]['id']}})['then'](handleEntityNotFound(_0x33683d,null))[_0xe130('0x2b')](function(_0x56cb5c){if(_0x56cb5c){_0x4a36f6[_0xe130('0x3e')]=_[_0xe130('0x53')](db[_0xe130('0x68')][_0xe130('0x3c')]);_0x4a36f6[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x27e5a3['query']);_0x4a36f6[_0xe130('0x40')]=_[_0xe130('0x41')](_0x4a36f6['model'],_0x4a36f6['query']);_0x186c27[_0xe130('0x42')]=_[_0xe130('0x41')](_0x4a36f6['model'],qs['fields'](_0x27e5a3[_0xe130('0x3f')][_0xe130('0x43')]));_0x186c27[_0xe130('0x42')]=_0x186c27[_0xe130('0x42')][_0xe130('0x44')]?_0x186c27[_0xe130('0x42')]:_0x4a36f6[_0xe130('0x3e')];if(!_0x27e5a3[_0xe130('0x3f')][_0xe130('0x45')](_0xe130('0x46'))){_0x186c27[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x27e5a3[_0xe130('0x3f')][_0xe130('0x22')]);_0x186c27[_0xe130('0x23')]=qs[_0xe130('0x23')](_0x27e5a3[_0xe130('0x3f')][_0xe130('0x23')]);}_0x186c27[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x27e5a3[_0xe130('0x3f')]['sort']);_0x186c27[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0x27e5a3['query'],_0x4a36f6[_0xe130('0x40')]));_0x186c27[_0xe130('0x49')][_0xe130('0x66')]=_0x56cb5c['id'];if(_0x27e5a3[_0xe130('0x3f')]['filter']){_0x186c27[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x186c27['where'],{'$or':_[_0xe130('0x34')](_0x186c27[_0xe130('0x42')],function(_0x17770e){var _0x412e91={};_0x412e91[_0x17770e]={'$like':'%'+_0x27e5a3[_0xe130('0x3f')][_0xe130('0x32')]+'%'};return _0x412e91;})});}_0x186c27=_[_0xe130('0x4a')]({},_0x186c27,_0x27e5a3[_0xe130('0x4c')]);return db[_0xe130('0x68')]['count']({'where':_0x186c27[_0xe130('0x49')]})[_0xe130('0x2b')](function(_0x2d60d6){_0x2967fa[_0xe130('0x24')]=_0x2d60d6;if(_0x27e5a3['query'][_0xe130('0x5c')]){_0x186c27[_0xe130('0x4d')]=[{'all':!![]}];}return db[_0xe130('0x68')]['findAll'](_0x186c27);})[_0xe130('0x2b')](function(_0x1a8b17){_0x2967fa[_0xe130('0x4f')]=_0x1a8b17;return _0x2967fa;});}})[_0xe130('0x2b')](respondWithFilteredResult(_0x33683d,_0x186c27))[_0xe130('0x50')](handleError(_0x33683d,null));};exports[_0xe130('0x6a')]=function(_0x45ac66,_0x1a2995,_0x48dcf3){var _0x1da04f={'raw':!![],'where':{}};var _0x303bb6={};var _0x1de07e={'count':0x0,'rows':[]};return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x45ac66['params']['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x1a2995,null))[_0xe130('0x2b')](function(_0x3c96ae){if(_0x3c96ae){_0x303bb6[_0xe130('0x3e')]=_[_0xe130('0x53')](db['CmHopperFinal']['rawAttributes']);_0x303bb6[_0xe130('0x3f')]=_['keys'](_0x45ac66[_0xe130('0x3f')]);_0x303bb6[_0xe130('0x40')]=_['intersection'](_0x303bb6[_0xe130('0x3e')],_0x303bb6[_0xe130('0x3f')]);_0x1da04f[_0xe130('0x42')]=_['intersection'](_0x303bb6[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x45ac66[_0xe130('0x3f')][_0xe130('0x43')]));_0x1da04f['attributes']=_0x1da04f['attributes']['length']?_0x1da04f['attributes']:_0x303bb6[_0xe130('0x3e')];if(!_0x45ac66[_0xe130('0x3f')][_0xe130('0x45')](_0xe130('0x46'))){_0x1da04f[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x45ac66[_0xe130('0x3f')][_0xe130('0x22')]);_0x1da04f['offset']=qs[_0xe130('0x23')](_0x45ac66[_0xe130('0x3f')]['offset']);}_0x1da04f[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x45ac66['query'][_0xe130('0x48')]);_0x1da04f[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0x45ac66[_0xe130('0x3f')],_0x303bb6[_0xe130('0x40')]));_0x1da04f[_0xe130('0x49')][_0xe130('0x66')]=_0x3c96ae['id'];if(_0x45ac66['query'][_0xe130('0x32')]){_0x1da04f[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x1da04f['where'],{'$or':_[_0xe130('0x34')](_0x1da04f[_0xe130('0x42')],function(_0xb0ac99){var _0x513585={};_0x513585[_0xb0ac99]={'$like':'%'+_0x45ac66[_0xe130('0x3f')][_0xe130('0x32')]+'%'};return _0x513585;})});}_0x1da04f=_['merge']({},_0x1da04f,_0x45ac66['options']);return db[_0xe130('0x6b')][_0xe130('0x24')]({'where':_0x1da04f['where']})[_0xe130('0x2b')](function(_0x3659f4){_0x1de07e['count']=_0x3659f4;if(_0x45ac66[_0xe130('0x3f')][_0xe130('0x5c')]){_0x1da04f[_0xe130('0x4d')]=[{'all':!![]}];}return db[_0xe130('0x6b')][_0xe130('0x4e')](_0x1da04f);})[_0xe130('0x2b')](function(_0x188db4){_0x1de07e[_0xe130('0x4f')]=_0x188db4;return _0x1de07e;});}})[_0xe130('0x2b')](respondWithFilteredResult(_0x1a2995,_0x1da04f))['catch'](handleError(_0x1a2995,null));};exports[_0xe130('0x6c')]=function(_0xa07e86,_0x4c6691,_0x26fa16){var _0x21422a={'raw':!![],'where':{}};var _0x11340c={};var _0x122fbf={'count':0x0,'rows':[]};return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0xa07e86[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x4c6691,null))[_0xe130('0x2b')](function(_0x496ec9){if(_0x496ec9){_0x11340c['model']=_['keys'](db[_0xe130('0x6d')][_0xe130('0x3c')]);_0x11340c['query']=_[_0xe130('0x53')](_0xa07e86['query']);_0x11340c['filters']=_[_0xe130('0x41')](_0x11340c['model'],_0x11340c[_0xe130('0x3f')]);_0x21422a[_0xe130('0x42')]=_[_0xe130('0x41')](_0x11340c['model'],qs[_0xe130('0x43')](_0xa07e86[_0xe130('0x3f')][_0xe130('0x43')]));_0x21422a['attributes']=_0x21422a[_0xe130('0x42')][_0xe130('0x44')]?_0x21422a['attributes']:_0x11340c['model'];if(!_0xa07e86['query'][_0xe130('0x45')]('nolimit')){_0x21422a[_0xe130('0x22')]=qs[_0xe130('0x22')](_0xa07e86['query'][_0xe130('0x22')]);_0x21422a[_0xe130('0x23')]=qs[_0xe130('0x23')](_0xa07e86['query']['offset']);}_0x21422a[_0xe130('0x47')]=qs[_0xe130('0x48')](_0xa07e86[_0xe130('0x3f')][_0xe130('0x48')]);_0x21422a[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0xa07e86['query'],_0x11340c[_0xe130('0x40')]));_0x21422a[_0xe130('0x49')]['VoiceQueueId']=_0x496ec9['id'];if(_0xa07e86[_0xe130('0x3f')][_0xe130('0x32')]){_0x21422a['where']=_[_0xe130('0x4a')](_0x21422a['where'],{'$or':_['map'](_0x21422a[_0xe130('0x42')],function(_0x51a8b6){var _0x3e79b9={};_0x3e79b9[_0x51a8b6]={'$like':'%'+_0xa07e86[_0xe130('0x3f')][_0xe130('0x32')]+'%'};return _0x3e79b9;})});}_0x21422a=_[_0xe130('0x4a')]({},_0x21422a,_0xa07e86[_0xe130('0x4c')]);return db[_0xe130('0x6d')][_0xe130('0x24')]({'where':_0x21422a[_0xe130('0x49')]})[_0xe130('0x2b')](function(_0x22ac81){_0x122fbf[_0xe130('0x24')]=_0x22ac81;if(_0xa07e86['query'][_0xe130('0x5c')]){_0x21422a[_0xe130('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe130('0x4e')](_0x21422a);})[_0xe130('0x2b')](function(_0x2320ee){_0x122fbf['rows']=_0x2320ee;return _0x122fbf;});}})['then'](respondWithFilteredResult(_0x4c6691,_0x21422a))[_0xe130('0x50')](handleError(_0x4c6691,null));};exports[_0xe130('0x6e')]=function(_0x2b959d,_0x492758,_0x4d002e){var _0x56d007={};var _0x5db504={};var _0xbeabc0;var _0x467783;return db[_0xe130('0x3b')]['findOne']({'where':{'id':_0x2b959d[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x492758,null))[_0xe130('0x2b')](function(_0x42eb6f){if(_0x42eb6f){_0xbeabc0=_0x42eb6f;_0x5db504[_0xe130('0x3e')]=_[_0xe130('0x53')](db[_0xe130('0x6f')]['rawAttributes']);_0x5db504['query']=_[_0xe130('0x53')](_0x2b959d[_0xe130('0x3f')]);_0x5db504[_0xe130('0x40')]=_[_0xe130('0x41')](_0x5db504[_0xe130('0x3e')],_0x5db504[_0xe130('0x3f')]);_0x56d007['attributes']=_['intersection'](_0x5db504['model'],qs[_0xe130('0x43')](_0x2b959d[_0xe130('0x3f')][_0xe130('0x43')]));_0x56d007['attributes']=_0x56d007[_0xe130('0x42')][_0xe130('0x44')]?_0x56d007[_0xe130('0x42')]:_0x5db504[_0xe130('0x3e')];_0x56d007[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x2b959d[_0xe130('0x3f')][_0xe130('0x48')]);_0x56d007[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0x2b959d['query'],_0x5db504[_0xe130('0x40')]));if(_0x2b959d[_0xe130('0x3f')][_0xe130('0x32')]){_0x56d007[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x56d007[_0xe130('0x49')],{'$or':_[_0xe130('0x34')](_0x56d007['attributes'],function(_0x25f79b){var _0x53efe2={};_0x53efe2[_0x25f79b]={'$like':'%'+_0x2b959d[_0xe130('0x3f')][_0xe130('0x32')]+'%'};return _0x53efe2;})});}_0x56d007=_[_0xe130('0x4a')]({},_0x56d007,_0x2b959d[_0xe130('0x4c')]);return _0xbeabc0[_0xe130('0x6e')](_0x56d007);}})[_0xe130('0x2b')](function(_0x5c250e){if(_0x5c250e){_0x467783=_0x5c250e[_0xe130('0x44')];if(!_0x2b959d[_0xe130('0x3f')]['hasOwnProperty'](_0xe130('0x46'))){_0x56d007[_0xe130('0x22')]=qs['limit'](_0x2b959d[_0xe130('0x3f')][_0xe130('0x22')]);_0x56d007[_0xe130('0x23')]=qs['offset'](_0x2b959d[_0xe130('0x3f')][_0xe130('0x23')]);}return _0xbeabc0[_0xe130('0x6e')](_0x56d007);}})['then'](function(_0x25a2f1){if(_0x25a2f1){return _0x25a2f1?{'count':_0x467783,'rows':_0x25a2f1}:null;}})[_0xe130('0x2b')](respondWithResult(_0x492758,null))[_0xe130('0x50')](handleError(_0x492758,null));};exports['addTeams']=function(_0x43186c,_0x35fb1d,_0x1343fb){var _0x2d414b=_0x43186c[_0xe130('0x55')][_0xe130('0x70')];var _0x292d7d=_[_0xe130('0x34')](_0x2d414b,'id');return db[_0xe130('0x6f')][_0xe130('0x4e')]({'where':{'id':_0x292d7d},'attributes':['id'],'include':[{'model':db[_0xe130('0x71')],'as':_0xe130('0x72'),'attributes':['id',_0xe130('0x39'),_0xe130('0x73'),_0xe130('0x74'),_0xe130('0x75')],'raw':!![]}]})[_0xe130('0x2b')](function(_0x1e83d8){if(_0x1e83d8){var _0x4a6bfa=_[_0xe130('0x76')](_0x1e83d8,function(_0x11b8c3){var _0x2dfa33=_0x11b8c3[_0xe130('0x2d')]({'plain':!![]});_0x2dfa33[_0xe130('0x72')]['forEach'](function(_0x12043e){_0x12043e[_0xe130('0x77')]=_[_0xe130('0x38')](_0x2d414b,{'id':_0x2dfa33['id']})[_0xe130('0x77')];});return _0x2dfa33[_0xe130('0x72')];});return db[_0xe130('0x3b')]['find']({'where':{'id':_0x43186c[_0xe130('0x52')]['id']}})['then'](function(_0xb9b166){return db[_0xe130('0x78')]['transaction'](function(_0x225829){return _0xb9b166[_0xe130('0x79')](_0x292d7d,{'transaction':_0x225829})[_0xe130('0x2b')](function(){return BPromise[_0xe130('0x7a')](_0x2d414b,function(_0x3b1556){return db[_0xe130('0x7b')]['upsert']({'TeamId':_0x3b1556['id'],'VoiceQueueId':_0x43186c[_0xe130('0x52')]['id'],'penalty':_0x3b1556[_0xe130('0x77')]},{'transaction':_0x225829});});})['then'](function(){return BPromise['each'](_0x4a6bfa,function(_0x5697cd){return db[_0xe130('0x7c')][_0xe130('0x7d')]({'where':{'UserId':_0x5697cd['id'],'VoiceQueueId':_0x43186c['params']['id']},'defaults':{'penalty':_0x5697cd[_0xe130('0x77')]},'transaction':_0x225829});});})[_0xe130('0x2b')](function(){return BPromise[_0xe130('0x7a')](_[_0xe130('0x32')](_0x4a6bfa,{'online':!![]}),function(_0x28e861){return db[_0xe130('0x7e')][_0xe130('0x7f')]({'membername':_0x28e861[_0xe130('0x39')],'UserId':_0x28e861['id'],'queue_name':_0xb9b166[_0xe130('0x39')],'VoiceQueueId':_0xb9b166['id'],'interface':_['isNil'](_0x28e861[_0xe130('0x75')])?util[_0xe130('0x80')](_0xe130('0x81'),_0x28e861['name']):_0x28e861['interface'],'paused':_0x28e861[_0xe130('0x74')]||![],'penalty':_0x28e861[_0xe130('0x77')]},{'transaction':_0x225829});});})[_0xe130('0x2b')](function(){_0x4a6bfa[_0xe130('0x82')](function(_0x2998a6){socket['emit'](_0xe130('0x83'),{'UserId':_0x2998a6['id'],'VoiceQueueId':_0xb9b166['id']});});});});});}})[_0xe130('0x2b')](respondWithStatusCode(_0x35fb1d,null))['catch'](handleError(_0x35fb1d,null));};exports[_0xe130('0x84')]=function(_0x19de21,_0x45476d,_0x498346){return db['Team'][_0xe130('0x4e')]({'where':{'id':_0x19de21['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe130('0x71')],'as':_0xe130('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x45476d,null))[_0xe130('0x2b')](function(_0x5766ea){var _0x3828bd=_['map'](_0x5766ea,'id');var _0x2fa5b6=[];var _0x1358fc=[];var _0x5540aa=squel['select']();_0x5540aa[_0xe130('0x85')](_0xe130('0x86'))[_0xe130('0x87')](_0xe130('0x88'),'tq')[_0xe130('0x89')]('user_has_teams','ut',_0xe130('0x8a'))[_0xe130('0x49')]('VoiceQueueId\x20=\x20?',_0x19de21[_0xe130('0x52')]['id']);for(var _0x54513e=0x0;_0x54513e<_0x5766ea[_0xe130('0x44')];_0x54513e+=0x1){let _0xfc0cc=_0x5766ea[_0x54513e];for(var _0x48c47e=0x0;_0x48c47e<_0xfc0cc['Agents'][_0xe130('0x44')];_0x48c47e+=0x1){let _0x393eba=_0xfc0cc[_0xe130('0x72')][_0x48c47e];var _0x5ed421=_0x5540aa['clone']();_0x5ed421[_0xe130('0x49')](_0xe130('0x8b'),_0x393eba['id']);_0x1358fc['push'](db[_0xe130('0x78')][_0xe130('0x3f')](_0x5ed421[_0xe130('0x8c')](),{'type':db[_0xe130('0x78')]['QueryTypes'][_0xe130('0x8d')]})[_0xe130('0x2b')](function(_0x233f9c){if(_0x233f9c['length']===0x1){return _0x393eba['id'];}else{var _0xfbf564=_[_0xe130('0x8e')](_[_0xe130('0x34')](_0x233f9c,_0xe130('0x8f')),function(_0x381c49){return _['includes'](_0x3828bd,_0x381c49);});if(_0xfbf564){return _0x393eba['id'];}}}));}}return BPromise[_0xe130('0x90')](_0x1358fc)[_0xe130('0x2b')](function(_0x26cd48){_0x2fa5b6=_(_0x2fa5b6)[_0xe130('0x91')](_0x26cd48)[_0xe130('0x92')]()[_0xe130('0x35')]();return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x19de21[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](function(_0x5b21fb){return db[_0xe130('0x78')]['transaction'](function(_0x2099ef){return _0x5b21fb['removeTeams'](_0x19de21['query'][_0xe130('0x93')],{'transaction':_0x2099ef})[_0xe130('0x2b')](function(){if(!_[_0xe130('0x94')](_0x2fa5b6)){return _0x5b21fb[_0xe130('0x95')](_0x2fa5b6,{'transaction':_0x2099ef})['then'](function(){return db[_0xe130('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x19de21[_0xe130('0x52')]['id'],'UserId':_0x2fa5b6},'transaction':_0x2099ef});});}})[_0xe130('0x2b')](function(){_0x2fa5b6['forEach'](function(_0x5d9b43){socket['emit'](_0xe130('0x96'),{'UserId':_0x5d9b43,'VoiceQueueId':_0x5b21fb['id']});});});});});});})[_0xe130('0x2b')](respondWithStatusCode(_0x45476d,null))[_0xe130('0x50')](handleError(_0x45476d,null));};exports[_0xe130('0x97')]=function(_0x3e8266,_0x12a609,_0x44e97a){var _0x7954dd,_0x481043;return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x3e8266['params']['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x12a609,null))[_0xe130('0x2b')](function(_0x244117){if(_0x244117){_0x481043=_0x244117;return _0x244117[_0xe130('0x97')](_0x3e8266[_0xe130('0x55')]['ids'],_[_0xe130('0x5d')](_0x3e8266[_0xe130('0x55')],[_0xe130('0x93'),'id'])||{})[_0xe130('0x98')](function(_0x376d8c){for(var _0xd315eb=0x0;_0xd315eb<_0x3e8266[_0xe130('0x55')][_0xe130('0x93')][_0xe130('0x44')];_0xd315eb+=0x1){socket['emit'](_0xe130('0x83'),{'UserId':Number(_0x3e8266[_0xe130('0x55')][_0xe130('0x93')][_0xd315eb]),'VoiceQueueId':Number(_0x3e8266[_0xe130('0x52')]['id'])});}return _0x376d8c;});}})[_0xe130('0x2b')](function(_0x12ded2){_0x7954dd=_0x12ded2||[];if(_0x481043){return db[_0xe130('0x71')][_0xe130('0x4e')]({'where':{'id':_0x3e8266[_0xe130('0x55')][_0xe130('0x93')]},'attributes':['id',_0xe130('0x39'),_0xe130('0x73'),_0xe130('0x74'),'interface'],'raw':!![]});}})['then'](function(_0xa6370a){if(!_[_0xe130('0x94')](_0xa6370a)){var _0x30698e=[];for(var _0x173c54=0x0;_0x173c54<_0xa6370a[_0xe130('0x44')];_0x173c54++){if(_0xa6370a[_0x173c54][_0xe130('0x73')]){_0x30698e[_0xe130('0x99')](db[_0xe130('0x7e')][_0xe130('0x7f')]({'membername':_0xa6370a[_0x173c54][_0xe130('0x39')],'UserId':_0xa6370a[_0x173c54]['id'],'queue_name':_0x481043[_0xe130('0x39')],'VoiceQueueId':_0x481043['id'],'interface':_[_0xe130('0x9a')](_0xa6370a[_0x173c54]['interface'])?util['format'](_0xe130('0x81'),_0xa6370a[_0x173c54]['name']):_0xa6370a[_0x173c54][_0xe130('0x75')],'paused':_0xa6370a[_0x173c54][_0xe130('0x74')]||![],'penalty':_0x3e8266[_0xe130('0x55')][_0xe130('0x77')]||0x0}));}}return BPromise['all'](_0x30698e);}})[_0xe130('0x2b')](function(){return _0x7954dd;})[_0xe130('0x2b')](respondWithResult(_0x12a609,null))['catch'](handleError(_0x12a609,null));};exports['removeAgents']=function(_0x448abc,_0x25d696,_0x4baec4){return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x448abc['params']['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x25d696,null))[_0xe130('0x2b')](function(_0x43e94c){if(_0x43e94c){return _0x43e94c[_0xe130('0x95')](_0x448abc[_0xe130('0x3f')][_0xe130('0x93')])[_0xe130('0x2b')](function(){if(_[_0xe130('0x9b')](_0x448abc[_0xe130('0x3f')][_0xe130('0x93')])){for(var _0x5ee5eb=0x0;_0x5ee5eb<_0x448abc[_0xe130('0x3f')][_0xe130('0x93')][_0xe130('0x44')];_0x5ee5eb+=0x1){socket[_0xe130('0x9c')]('userVoiceQueue:remove',{'UserId':Number(_0x448abc[_0xe130('0x3f')][_0xe130('0x93')][_0x5ee5eb]),'VoiceQueueId':Number(_0x448abc[_0xe130('0x52')]['id'])});}}else{socket[_0xe130('0x9c')](_0xe130('0x96'),{'UserId':Number(_0x448abc[_0xe130('0x3f')][_0xe130('0x93')]),'VoiceQueueId':Number(_0x448abc[_0xe130('0x52')]['id'])});}});}})['then'](function(_0x2ac3a2){return db[_0xe130('0x7e')][_0xe130('0x2c')]({'where':{'VoiceQueueId':_0x448abc[_0xe130('0x52')]['id'],'UserId':_0x448abc[_0xe130('0x3f')][_0xe130('0x93')]}})[_0xe130('0x2b')](function(){return _0x2ac3a2;});})['then'](respondWithStatusCode(_0x25d696,null))[_0xe130('0x50')](handleError(_0x25d696,null));};exports[_0xe130('0x9d')]=function(_0x108be2,_0xfcd625,_0x402e71){var _0x5d7349={};var _0x3e6a18={};var _0x55c8d4;var _0x36e30b;return db['VoiceQueue']['findOne']({'where':{'id':_0x108be2[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0xfcd625,null))[_0xe130('0x2b')](function(_0x4e1127){if(_0x4e1127){_0x55c8d4=_0x4e1127;_0x3e6a18[_0xe130('0x3e')]=_[_0xe130('0x53')](db['User'][_0xe130('0x3c')]);_0x3e6a18[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x108be2[_0xe130('0x3f')]);_0x3e6a18['filters']=_[_0xe130('0x41')](_0x3e6a18[_0xe130('0x3e')],_0x3e6a18[_0xe130('0x3f')]);_0x5d7349[_0xe130('0x42')]=_[_0xe130('0x41')](_0x3e6a18[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x108be2[_0xe130('0x3f')]['fields']));_0x5d7349[_0xe130('0x42')]=_0x5d7349[_0xe130('0x42')][_0xe130('0x44')]?_0x5d7349[_0xe130('0x42')]:_0x3e6a18['model'];_0x5d7349[_0xe130('0x47')]=qs['sort'](_0x108be2['query']['sort']);_0x5d7349[_0xe130('0x49')]=qs[_0xe130('0x40')](_['pick'](_0x108be2['query'],_0x3e6a18[_0xe130('0x40')]));if(_0x108be2['query'][_0xe130('0x32')]){_0x5d7349[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x5d7349['where'],{'$or':_['map'](_0x5d7349[_0xe130('0x42')],function(_0x794f8c){var _0x3254c8={};_0x3254c8[_0x794f8c]={'$like':'%'+_0x108be2['query'][_0xe130('0x32')]+'%'};return _0x3254c8;})});}_0x5d7349=_[_0xe130('0x4a')]({},_0x5d7349,_0x108be2[_0xe130('0x4c')]);return _0x55c8d4[_0xe130('0x9d')](_0x5d7349);}})[_0xe130('0x2b')](function(_0x2a9987){if(_0x2a9987){_0x36e30b=_0x2a9987[_0xe130('0x44')];if(!_0x108be2[_0xe130('0x3f')]['hasOwnProperty'](_0xe130('0x46'))){_0x5d7349['limit']=qs[_0xe130('0x22')](_0x108be2['query'][_0xe130('0x22')]);_0x5d7349[_0xe130('0x23')]=qs[_0xe130('0x23')](_0x108be2[_0xe130('0x3f')][_0xe130('0x23')]);}return _0x55c8d4[_0xe130('0x9d')](_0x5d7349);}})[_0xe130('0x2b')](function(_0x2fe142){if(_0x2fe142){return _0x2fe142?{'count':_0x36e30b,'rows':_0x2fe142}:null;}})['then'](respondWithResult(_0xfcd625,null))[_0xe130('0x50')](handleError(_0xfcd625,null));};exports[_0xe130('0x9e')]=function(_0x4fad0a,_0x22bd29,_0x12cfa5){var _0x2a0242={};var _0xfd191e={};var _0x1af469;var _0x7d7030;return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x4fad0a[_0xe130('0x52')]['id']}})['then'](handleEntityNotFound(_0x22bd29,null))[_0xe130('0x2b')](function(_0x5dc3e4){if(_0x5dc3e4){_0x1af469=_0x5dc3e4;_0xfd191e[_0xe130('0x3e')]=_[_0xe130('0x53')](db['UserVoiceQueueRt']['rawAttributes']);_0xfd191e[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x4fad0a[_0xe130('0x3f')]);_0xfd191e[_0xe130('0x40')]=_[_0xe130('0x41')](_0xfd191e['model'],_0xfd191e[_0xe130('0x3f')]);_0x2a0242[_0xe130('0x42')]=_[_0xe130('0x41')](_0xfd191e[_0xe130('0x3e')],qs['fields'](_0x4fad0a['query'][_0xe130('0x43')]));_0x2a0242[_0xe130('0x42')]=_0x2a0242[_0xe130('0x42')][_0xe130('0x44')]?_0x2a0242[_0xe130('0x42')]:_0xfd191e[_0xe130('0x3e')];_0x2a0242['order']=qs[_0xe130('0x48')](_0x4fad0a[_0xe130('0x3f')][_0xe130('0x48')]);_0x2a0242[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0x4fad0a['query'],_0xfd191e[_0xe130('0x40')]));if(_0x4fad0a[_0xe130('0x3f')][_0xe130('0x32')]){_0x2a0242[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x2a0242[_0xe130('0x49')],{'$or':_[_0xe130('0x34')](_0x2a0242[_0xe130('0x42')],function(_0x38e2aa){var _0x3b9810={};_0x3b9810[_0x38e2aa]={'$like':'%'+_0x4fad0a[_0xe130('0x3f')][_0xe130('0x32')]+'%'};return _0x3b9810;})});}_0x2a0242=_['merge']({},_0x2a0242,_0x4fad0a[_0xe130('0x4c')]);return _0x1af469[_0xe130('0x9e')](_0x2a0242);}})['then'](function(_0x31c1bc){if(_0x31c1bc){_0x7d7030=_0x31c1bc[_0xe130('0x44')];if(!_0x4fad0a['query'][_0xe130('0x45')](_0xe130('0x46'))){_0x2a0242[_0xe130('0x22')]=qs['limit'](_0x4fad0a[_0xe130('0x3f')][_0xe130('0x22')]);_0x2a0242[_0xe130('0x23')]=qs['offset'](_0x4fad0a[_0xe130('0x3f')][_0xe130('0x23')]);}return _0x1af469[_0xe130('0x9e')](_0x2a0242);}})['then'](function(_0x51f62c){return _0x51f62c?{'count':_0x7d7030,'rows':_0x51f62c}:null;})[_0xe130('0x2b')](respondWithResult(_0x22bd29,null))[_0xe130('0x50')](handleError(_0x22bd29,null));};exports[_0xe130('0x9f')]=function(_0x46475c,_0x10e343,_0x1c5c3d){var _0x17568d={};var _0x4c687e={};var _0x34a58a;var _0x415f03;return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x46475c['params']['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x10e343,null))[_0xe130('0x2b')](function(_0x1f8c25){if(_0x1f8c25){_0x34a58a=_0x1f8c25;_0x4c687e[_0xe130('0x3e')]=_[_0xe130('0x53')](db['CmList'][_0xe130('0x3c')]);_0x4c687e[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x46475c[_0xe130('0x3f')]);_0x4c687e[_0xe130('0x40')]=_[_0xe130('0x41')](_0x4c687e['model'],_0x4c687e[_0xe130('0x3f')]);_0x17568d[_0xe130('0x42')]=_['intersection'](_0x4c687e['model'],qs[_0xe130('0x43')](_0x46475c['query'][_0xe130('0x43')]));_0x17568d[_0xe130('0x42')]=_0x17568d[_0xe130('0x42')]['length']?_0x17568d[_0xe130('0x42')]:_0x4c687e[_0xe130('0x3e')];_0x17568d['order']=qs['sort'](_0x46475c['query']['sort']);_0x17568d[_0xe130('0x49')]=qs[_0xe130('0x40')](_[_0xe130('0x69')](_0x46475c[_0xe130('0x3f')],_0x4c687e[_0xe130('0x40')]));if(_0x46475c[_0xe130('0x3f')][_0xe130('0x32')]){_0x17568d[_0xe130('0x49')]=_[_0xe130('0x4a')](_0x17568d['where'],{'$or':_[_0xe130('0x34')](_0x17568d[_0xe130('0x42')],function(_0x4ccce6){var _0x38bc55={};_0x38bc55[_0x4ccce6]={'$like':'%'+_0x46475c['query'][_0xe130('0x32')]+'%'};return _0x38bc55;})});}_0x17568d=_['merge']({},_0x17568d,_0x46475c['options']);return _0x34a58a[_0xe130('0x9f')](_0x17568d);}})[_0xe130('0x2b')](function(_0x387dff){if(_0x387dff){_0x415f03=_0x387dff['length'];if(!_0x46475c[_0xe130('0x3f')][_0xe130('0x45')](_0xe130('0x46'))){_0x17568d[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x46475c[_0xe130('0x3f')][_0xe130('0x22')]);_0x17568d[_0xe130('0x23')]=qs[_0xe130('0x23')](_0x46475c[_0xe130('0x3f')][_0xe130('0x23')]);}return _0x34a58a['getLists'](_0x17568d);}})[_0xe130('0x2b')](function(_0xaa8763){if(_0xaa8763){return _0xaa8763?{'count':_0x415f03,'rows':_0xaa8763}:null;}})['then'](respondWithResult(_0x10e343,null))['catch'](handleError(_0x10e343,null));};exports['addLists']=function(_0x2240a4,_0x2e84f3,_0x252829){var _0x196ca6,_0x3538aa;return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x2240a4[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x2e84f3,null))[_0xe130('0x2b')](function(_0x20c7ba){if(_0x20c7ba){_0x3538aa=_0x20c7ba;return _0x20c7ba[_0xe130('0xa0')](_0x2240a4[_0xe130('0x55')][_0xe130('0x93')],_[_0xe130('0x5d')](_0x2240a4['body'],[_0xe130('0x93'),'id'])||{});}return null;})[_0xe130('0x98')](function(_0x51bed8){var _0x47481f;_0x196ca6=_0x51bed8||[];var _0x49dfed=[];if(_0x51bed8){for(var _0x1c3ee0=0x0;_0x1c3ee0<_0x51bed8[_0xe130('0x44')];_0x1c3ee0+=0x1){var _0x46c615=_0x51bed8[_0x1c3ee0][_0xe130('0x2d')]({'plain':!![]});_0x3538aa[_0xe130('0xa1')]=_0x2240a4['body'][_0xe130('0xa1')]?_0x2240a4[_0xe130('0x55')][_0xe130('0xa1')]:_0x3538aa[_0xe130('0xa1')];switch(_0x3538aa[_0xe130('0xa1')]){case _0xe130('0xa2'):_0x47481f=squel[_0xe130('0xa3')]()[_0xe130('0xa4')]('cm_hopper')[_0xe130('0xa5')](['phone',_0xe130('0xa6'),_0xe130('0xa7'),'ListId',_0xe130('0x66'),_0xe130('0x5f'),_0xe130('0x5e')],squel[_0xe130('0xa8')]()[_0xe130('0x85')](_0xe130('0xa9'),_0xe130('0xa9'))[_0xe130('0x85')](_0xe130('0xaa'),_0xe130('0xa6'))[_0xe130('0x85')]('id','ContactId')[_0xe130('0x85')](_0x46c615[_0xe130('0xab')][_0xe130('0x8c')](),_0xe130('0xac'))[_0xe130('0x85')](_0x2240a4[_0xe130('0x52')]['id']['toString'](),_0xe130('0x66'))[_0xe130('0x85')](_0xe130('0xaa'),_0xe130('0x5f'))['field'](_0xe130('0xaa'),_0xe130('0x5e'))[_0xe130('0x87')](_0xe130('0xad'))[_0xe130('0x49')](_0xe130('0xae'))[_0xe130('0x49')](_0xe130('0xaf'),_0x46c615[_0xe130('0xab')][_0xe130('0x8c')]())[_0xe130('0x49')](_0xe130('0xb0'))[_0xe130('0x49')](_0xe130('0xb1'),squel[_0xe130('0xa8')]()['field'](_0xe130('0xb2'))[_0xe130('0x87')](_0xe130('0xb3'))[_0xe130('0x49')](_0xe130('0xb4'),_0x2240a4[_0xe130('0x52')]['id'][_0xe130('0x8c')]()))[_0xe130('0x49')](_0xe130('0xb1'),squel[_0xe130('0xa8')]()['field'](_0xe130('0xb5'))[_0xe130('0x87')](_0xe130('0xb6'))[_0xe130('0x49')](_0xe130('0xb4'),_0x2240a4[_0xe130('0x52')]['id'][_0xe130('0x8c')]())))[_0xe130('0x8c')]();break;case _0xe130('0xb7'):_0x47481f=squel[_0xe130('0xa3')]()['into'](_0xe130('0xb6'))['fromQuery'](['phone','scheduledAt','ContactId',_0xe130('0xac'),_0xe130('0x66'),'createdAt',_0xe130('0x5e')],squel[_0xe130('0xa8')]()['field'](_0xe130('0xa9'),_0xe130('0xa9'))['field'](_0xe130('0xaa'),'scheduledAt')['field']('id',_0xe130('0xa7'))[_0xe130('0x85')](_0x46c615[_0xe130('0xab')][_0xe130('0x8c')](),_0xe130('0xac'))['field'](_0x2240a4[_0xe130('0x52')]['id'][_0xe130('0x8c')](),_0xe130('0x66'))[_0xe130('0x85')](_0xe130('0xaa'),_0xe130('0x5f'))['field'](_0xe130('0xaa'),'updatedAt')[_0xe130('0x87')](_0xe130('0xad'))[_0xe130('0x49')]('deletedAt\x20IS\x20NULL')[_0xe130('0x49')](_0xe130('0xaf'),_0x46c615['CmListId'][_0xe130('0x8c')]())['where'](_0xe130('0xb0'))[_0xe130('0x49')](_0xe130('0xb1'),squel[_0xe130('0xa8')]()['field'](_0xe130('0xb5'))['from'](_0xe130('0xb6'))[_0xe130('0x49')](_0xe130('0xb4'),_0x2240a4[_0xe130('0x52')]['id'][_0xe130('0x8c')]())))[_0xe130('0x8c')]();break;default:_0x47481f=squel[_0xe130('0xa3')]()['into'](_0xe130('0xb6'))[_0xe130('0xa5')](['phone',_0xe130('0xa6'),_0xe130('0xa7'),_0xe130('0xac'),_0xe130('0x66'),_0xe130('0x5f'),_0xe130('0x5e')],squel[_0xe130('0xa8')]()[_0xe130('0x85')](_0xe130('0xa9'),_0xe130('0xa9'))[_0xe130('0x85')](_0xe130('0xaa'),_0xe130('0xa6'))[_0xe130('0x85')]('id',_0xe130('0xa7'))['field'](_0x46c615[_0xe130('0xab')][_0xe130('0x8c')](),_0xe130('0xac'))[_0xe130('0x85')](_0x2240a4['params']['id']['toString'](),'VoiceQueueId')['field'](_0xe130('0xaa'),'createdAt')['field'](_0xe130('0xaa'),_0xe130('0x5e'))[_0xe130('0x87')](_0xe130('0xad'))[_0xe130('0x49')](_0xe130('0xae'))[_0xe130('0x49')](_0xe130('0xaf'),_0x46c615['CmListId'][_0xe130('0x8c')]())[_0xe130('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xe130('0x8c')]();}_0x49dfed[_0xe130('0x99')](db['sequelize'][_0xe130('0x3f')](_0x47481f));}return BPromise[_0xe130('0x90')](_0x49dfed);}})[_0xe130('0x2b')](function(){return _0x196ca6;})[_0xe130('0x2b')](respondWithResult(_0x2e84f3,null))[_0xe130('0x50')](handleError(_0x2e84f3,null));};exports[_0xe130('0xb8')]=function(_0xf7abde,_0x56b073,_0x31abbb){return db['VoiceQueue'][_0xe130('0x38')]({'where':{'id':_0xf7abde[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x56b073,null))[_0xe130('0x2b')](function(_0x597074){if(_0x597074){return _0x597074[_0xe130('0xb8')](_0xf7abde['query'][_0xe130('0x93')]);}})['then'](function(_0x227c39){if(_0x227c39){return db[_0xe130('0x65')][_0xe130('0x2c')]({'where':{'ListId':_0xf7abde[_0xe130('0x3f')]['ids'],'VoiceQueueId':_0xf7abde[_0xe130('0x52')]['id']}})['then'](function(){return _0x227c39;});}})['then'](respondWithStatusCode(_0x56b073,null))['catch'](handleError(_0x56b073,null));};exports['getBlackLists']=function(_0x334dd6,_0x1079d8,_0x5161dd){var _0x5da7d2={};var _0x2a4af8={};var _0x4e0e7d;var _0x18b4c9;return db[_0xe130('0x3b')][_0xe130('0x64')]({'where':{'id':_0x334dd6[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x1079d8,null))[_0xe130('0x2b')](function(_0x21b33b){if(_0x21b33b){_0x4e0e7d=_0x21b33b;_0x2a4af8['model']=_[_0xe130('0x53')](db[_0xe130('0xb9')][_0xe130('0x3c')]);_0x2a4af8[_0xe130('0x3f')]=_[_0xe130('0x53')](_0x334dd6[_0xe130('0x3f')]);_0x2a4af8['filters']=_['intersection'](_0x2a4af8[_0xe130('0x3e')],_0x2a4af8['query']);_0x5da7d2[_0xe130('0x42')]=_[_0xe130('0x41')](_0x2a4af8[_0xe130('0x3e')],qs[_0xe130('0x43')](_0x334dd6[_0xe130('0x3f')][_0xe130('0x43')]));_0x5da7d2[_0xe130('0x42')]=_0x5da7d2['attributes'][_0xe130('0x44')]?_0x5da7d2[_0xe130('0x42')]:_0x2a4af8[_0xe130('0x3e')];_0x5da7d2[_0xe130('0x47')]=qs[_0xe130('0x48')](_0x334dd6['query'][_0xe130('0x48')]);_0x5da7d2[_0xe130('0x49')]=qs['filters'](_[_0xe130('0x69')](_0x334dd6[_0xe130('0x3f')],_0x2a4af8[_0xe130('0x40')]));if(_0x334dd6[_0xe130('0x3f')][_0xe130('0x32')]){_0x5da7d2[_0xe130('0x49')]=_['merge'](_0x5da7d2[_0xe130('0x49')],{'$or':_[_0xe130('0x34')](_0x5da7d2[_0xe130('0x42')],function(_0x4add3e){var _0x2d2a99={};_0x2d2a99[_0x4add3e]={'$like':'%'+_0x334dd6[_0xe130('0x3f')]['filter']+'%'};return _0x2d2a99;})});}_0x5da7d2=_[_0xe130('0x4a')]({},_0x5da7d2,_0x334dd6['options']);return _0x4e0e7d[_0xe130('0xba')](_0x5da7d2);}})[_0xe130('0x2b')](function(_0x590bfa){if(_0x590bfa){_0x18b4c9=_0x590bfa[_0xe130('0x44')];if(!_0x334dd6['query'][_0xe130('0x45')]('nolimit')){_0x5da7d2[_0xe130('0x22')]=qs[_0xe130('0x22')](_0x334dd6[_0xe130('0x3f')][_0xe130('0x22')]);_0x5da7d2[_0xe130('0x23')]=qs[_0xe130('0x23')](_0x334dd6[_0xe130('0x3f')][_0xe130('0x23')]);}return _0x4e0e7d[_0xe130('0xba')](_0x5da7d2);}})[_0xe130('0x2b')](function(_0x47bb6e){if(_0x47bb6e){return _0x47bb6e?{'count':_0x18b4c9,'rows':_0x47bb6e}:null;}})['then'](respondWithResult(_0x1079d8,null))[_0xe130('0x50')](handleError(_0x1079d8,null));};exports[_0xe130('0xbb')]=function(_0x4f2615,_0x16dc8d,_0x1be94e){var _0x11b4e0,_0x30961f;return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x4f2615[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x16dc8d,null))[_0xe130('0x2b')](function(_0x4b4e1e){if(_0x4b4e1e){_0x30961f=_0x4b4e1e;return _0x4b4e1e[_0xe130('0xbb')](_0x4f2615['body'][_0xe130('0x93')],_['omit'](_0x4f2615[_0xe130('0x55')],[_0xe130('0x93'),'id'])||{});}return null;})[_0xe130('0x98')](function(_0x23851e){var _0xf783e9;_0x11b4e0=_0x23851e||[];var _0x2c3fa9=[];if(_0x23851e){for(var _0x2294b9=0x0;_0x2294b9<_0x23851e[_0xe130('0x44')];_0x2294b9+=0x1){var _0x5dcd95=_0x23851e[_0x2294b9]['get']({'plain':!![]});_0xf783e9=squel[_0xe130('0xa3')]()[_0xe130('0xa4')]('cm_hopper_black')[_0xe130('0xa5')]([_0xe130('0xa9'),_0xe130('0xa7'),_0xe130('0xac'),_0xe130('0x66'),'createdAt','updatedAt'],squel[_0xe130('0xa8')]()[_0xe130('0x85')]('phone',_0xe130('0xa9'))['field']('id',_0xe130('0xa7'))[_0xe130('0x85')](_0x5dcd95[_0xe130('0xab')][_0xe130('0x8c')](),_0xe130('0xac'))[_0xe130('0x85')](_0x4f2615[_0xe130('0x52')]['id'][_0xe130('0x8c')](),_0xe130('0x66'))[_0xe130('0x85')](_0xe130('0xaa'),_0xe130('0x5f'))[_0xe130('0x85')]('NOW()',_0xe130('0x5e'))[_0xe130('0x87')](_0xe130('0xad'))[_0xe130('0x49')](_0xe130('0xae'))[_0xe130('0x49')](_0xe130('0xaf'),_0x5dcd95['CmListId'][_0xe130('0x8c')]())[_0xe130('0x49')](_0xe130('0xb0')))[_0xe130('0x8c')]();_0x2c3fa9[_0xe130('0x99')](db['sequelize']['query'](_0xf783e9));}return BPromise[_0xe130('0x90')](_0x2c3fa9);}})[_0xe130('0x2b')](function(){return _0x11b4e0;})[_0xe130('0x2b')](respondWithResult(_0x16dc8d,null))[_0xe130('0x50')](handleError(_0x16dc8d,null));};exports[_0xe130('0xbc')]=function(_0x1c0318,_0x162ea5,_0x9f6423){return db[_0xe130('0x3b')][_0xe130('0x38')]({'where':{'id':_0x1c0318[_0xe130('0x52')]['id']}})[_0xe130('0x2b')](handleEntityNotFound(_0x162ea5,null))[_0xe130('0x2b')](function(_0x7da072){if(_0x7da072){return _0x7da072['removeBlackLists'](_0x1c0318['query'][_0xe130('0x93')]);}})[_0xe130('0x2b')](function(_0x41108a){if(_0x41108a){return db[_0xe130('0x6d')][_0xe130('0x2c')]({'where':{'ListId':_0x1c0318['query'][_0xe130('0x93')],'VoiceQueueId':_0x1c0318['params']['id']}})[_0xe130('0x2b')](function(){return _0x41108a;});}})[_0xe130('0x2b')](respondWithStatusCode(_0x162ea5,null))[_0xe130('0x50')](handleError(_0x162ea5,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 78d7b6e..06ea203 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 _0x6fbd=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x336e7a,_0x211e1a){var _0x3764db=function(_0x19fdbd){while(--_0x19fdbd){_0x336e7a['push'](_0x336e7a['shift']());}};_0x3764db(++_0x211e1a);}(_0x6fbd,0x140));var _0xd6fb=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x6fbd[_0x31b9cf];return _0x357b8a;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xd6fb('0x0'))['db'][_0xd6fb('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd6fb('0x2')](0x0);var events={'afterCreate':_0xd6fb('0x3'),'afterUpdate':_0xd6fb('0x4'),'afterDestroy':_0xd6fb('0x5')};function emitEvent(_0x1582f6){return function(_0x5806a5,_0x406459,_0x5f52f8){VoiceQueueEvents[_0xd6fb('0x6')](_0x1582f6+':'+_0x5806a5['id'],_0x5806a5);VoiceQueueEvents[_0xd6fb('0x6')](_0x1582f6,_0x5806a5);_0x5f52f8(null);};}for(var e in events){if(events[_0xd6fb('0x7')](e)){var event=events[e];VoiceQueue[_0xd6fb('0x8')](e,emitEvent(event));}}module[_0xd6fb('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xf525=['../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x241932,_0x3bef6){var _0x461054=function(_0x30b891){while(--_0x30b891){_0x241932['push'](_0x241932['shift']());}};_0x461054(++_0x3bef6);}(_0xf525,0x15e));var _0x5f52=function(_0x4bdedf,_0x34b3ec){_0x4bdedf=_0x4bdedf-0x0;var _0x5027d1=_0xf525[_0x4bdedf];return _0x5027d1;};'use strict';var EventEmitter=require(_0x5f52('0x0'));var VoiceQueue=require(_0x5f52('0x1'))['db'][_0x5f52('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5f52('0x3'),'afterUpdate':_0x5f52('0x4'),'afterDestroy':_0x5f52('0x5')};function emitEvent(_0x29c4d5){return function(_0x6c7082,_0x451468,_0x5812dd){VoiceQueueEvents[_0x5f52('0x6')](_0x29c4d5+':'+_0x6c7082['id'],_0x6c7082);VoiceQueueEvents[_0x5f52('0x6')](_0x29c4d5,_0x6c7082);_0x5812dd(null);};}for(var e in events){if(events[_0x5f52('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x5f52('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 1f243a3..c3ec1b2 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x4bde49,_0x204599){var _0x574857=function(_0x3b38cd){while(--_0x3b38cd){_0x4bde49['push'](_0x4bde49['shift']());}};_0x574857(++_0x204599);}(_0x34e8,0x12c));var _0x834e=function(_0x4db7f1,_0x5826a4){_0x4db7f1=_0x4db7f1-0x0;var _0x90ee49=_0x34e8[_0x4db7f1];return _0x90ee49;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x31a437,_0xf91821){var _0x50eedf=function(_0x5e9a4c){while(--_0x5e9a4c){_0x31a437['push'](_0x31a437['shift']());}};_0x50eedf(++_0xf91821);}(_0x70e0,0x17b));var _0x070e=function(_0x2fe51e,_0x3b1ccc){_0x2fe51e=_0x2fe51e-0x0;var _0x36da94=_0x70e0[_0x2fe51e];return _0x36da94;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index ac496e5..6d03b4f 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 _0x6371=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6371,0x140));var _0x1637=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x6371[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0x1637('0x0'));var util=require(_0x1637('0x1'));var moment=require(_0x1637('0x2'));var BPromise=require(_0x1637('0x3'));var rs=require(_0x1637('0x4'));var fs=require('fs');var Redis=require(_0x1637('0x5'));var db=require(_0x1637('0x6'))['db'];var utils=require(_0x1637('0x7'));var logger=require(_0x1637('0x8'))(_0x1637('0x9'));var config=require(_0x1637('0xa'));var jayson=require(_0x1637('0xb'));var client=jayson[_0x1637('0xc')][_0x1637('0xd')]({'port':0x232a});config[_0x1637('0xe')]=_[_0x1637('0xf')](config[_0x1637('0xe')],{'host':_0x1637('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1637('0xe')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x504971,_0xb9cff0,_0x3d7a79){return new BPromise(function(_0x1580da,_0x3286d8){return client['request'](_0x504971,_0x3d7a79)[_0x1637('0x11')](function(_0x3d996a){logger[_0x1637('0x12')](_0x1637('0x13'),_0xb9cff0,_0x1637('0x14'));logger[_0x1637('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xb9cff0,_0x1637('0x14'),JSON[_0x1637('0x16')](_0x3d996a));if(_0x3d996a[_0x1637('0x17')]){if(_0x3d996a[_0x1637('0x17')]['code']===0x1f4){logger[_0x1637('0x17')]('VoiceQueue,\x20%s,\x20%s',_0xb9cff0,_0x3d996a[_0x1637('0x17')][_0x1637('0x18')]);return _0x3286d8(_0x3d996a[_0x1637('0x17')][_0x1637('0x18')]);}logger[_0x1637('0x17')](_0x1637('0x13'),_0xb9cff0,_0x3d996a[_0x1637('0x17')][_0x1637('0x18')]);return _0x1580da(_0x3d996a[_0x1637('0x17')][_0x1637('0x18')]);}else{logger[_0x1637('0x12')](_0x1637('0x13'),_0xb9cff0,_0x1637('0x14'));_0x1580da(_0x3d996a[_0x1637('0x19')][_0x1637('0x18')]);}})[_0x1637('0x1a')](function(_0x4bf0b1){logger[_0x1637('0x17')]('VoiceQueue,\x20%s,\x20%s',_0xb9cff0,_0x4bf0b1);_0x3286d8(_0x4bf0b1);});});}exports[_0x1637('0x1b')]=function(_0xd1a54c){var _0x4c8da8=this;return new Promise(function(_0x48ec76,_0x53f678){return db[_0x1637('0x1c')][_0x1637('0x1d')]({'raw':_0xd1a54c[_0x1637('0x1e')]?_0xd1a54c[_0x1637('0x1e')][_0x1637('0x1f')]===undefined?!![]:![]:!![],'where':_0xd1a54c[_0x1637('0x1e')]?_0xd1a54c['options'][_0x1637('0x20')]||null:null,'attributes':_0xd1a54c[_0x1637('0x1e')]?_0xd1a54c['options'][_0x1637('0x21')]||null:null,'limit':_0xd1a54c[_0x1637('0x1e')]?_0xd1a54c[_0x1637('0x1e')][_0x1637('0x22')]||null:null,'include':_0xd1a54c[_0x1637('0x1e')]?_0xd1a54c[_0x1637('0x1e')][_0x1637('0x23')]?_[_0x1637('0x24')](_0xd1a54c[_0x1637('0x1e')][_0x1637('0x23')],function(_0x4c820d){return{'model':db[_0x4c820d['model']],'as':_0x4c820d['as'],'attributes':_0x4c820d[_0x1637('0x21')],'include':_0x4c820d['include']?_['map'](_0x4c820d[_0x1637('0x23')],function(_0x9e4de3){return{'model':db[_0x9e4de3[_0x1637('0x25')]],'as':_0x9e4de3['as'],'attributes':_0x9e4de3[_0x1637('0x21')],'include':_0x9e4de3[_0x1637('0x23')]?_['map'](_0x9e4de3['include'],function(_0x8363b4){return{'model':db[_0x8363b4[_0x1637('0x25')]],'as':_0x8363b4['as'],'attributes':_0x8363b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1637('0x11')](function(_0x1d945a){logger[_0x1637('0x12')](_0x1637('0x1b'),_0xd1a54c);logger[_0x1637('0x15')](_0x1637('0x1b'),_0xd1a54c,JSON['stringify'](_0x1d945a));_0x48ec76(_0x1d945a);})[_0x1637('0x1a')](function(_0x416fa8){logger[_0x1637('0x17')](_0x1637('0x1b'),_0x416fa8[_0x1637('0x18')],_0xd1a54c);_0x53f678(_0x4c8da8[_0x1637('0x17')](0x1f4,_0x416fa8[_0x1637('0x18')]));});});};exports[_0x1637('0x26')]=function(_0x54d4ff){var _0x160829=this;return new Promise(function(_0x3ac43b,_0x2e84dd){return db[_0x1637('0x1c')][_0x1637('0x27')]({'raw':_0x54d4ff[_0x1637('0x1e')]?_0x54d4ff[_0x1637('0x1e')][_0x1637('0x1f')]===undefined?!![]:![]:!![],'where':_0x54d4ff[_0x1637('0x1e')]?_0x54d4ff['options'][_0x1637('0x20')]||null:null,'attributes':_0x54d4ff[_0x1637('0x1e')]?_0x54d4ff[_0x1637('0x1e')][_0x1637('0x21')]||null:null,'include':_0x54d4ff[_0x1637('0x1e')]?_0x54d4ff['options']['include']?_[_0x1637('0x24')](_0x54d4ff[_0x1637('0x1e')][_0x1637('0x23')],function(_0x5adbef){return{'model':db[_0x5adbef['model']],'as':_0x5adbef['as'],'attributes':_0x5adbef[_0x1637('0x21')],'include':_0x5adbef[_0x1637('0x23')]?_[_0x1637('0x24')](_0x5adbef[_0x1637('0x23')],function(_0x3c7c8d){return{'model':db[_0x3c7c8d['model']],'as':_0x3c7c8d['as'],'attributes':_0x3c7c8d[_0x1637('0x21')],'include':_0x3c7c8d[_0x1637('0x23')]?_['map'](_0x3c7c8d[_0x1637('0x23')],function(_0x1c4416){return{'model':db[_0x1c4416[_0x1637('0x25')]],'as':_0x1c4416['as'],'attributes':_0x1c4416[_0x1637('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1637('0x11')](function(_0x142609){logger[_0x1637('0x12')](_0x1637('0x26'),_0x54d4ff);logger[_0x1637('0x15')](_0x1637('0x26'),_0x54d4ff,JSON[_0x1637('0x16')](_0x142609));_0x3ac43b(_0x142609);})[_0x1637('0x1a')](function(_0x2165b2){logger[_0x1637('0x17')](_0x1637('0x26'),_0x2165b2[_0x1637('0x18')],_0x54d4ff);_0x2e84dd(_0x160829[_0x1637('0x17')](0x1f4,_0x2165b2[_0x1637('0x18')]));});});}; \ No newline at end of file +var _0x40e3=['findAll','options','where','attributes','limit','include','map','model','then','catch','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueue','VoiceQueue'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x40e3,0xfb));var _0x340e=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0x40e3[_0x30fdf9];return _0x3c43bb;};'use strict';var _=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var moment=require(_0x340e('0x2'));var BPromise=require(_0x340e('0x3'));var rs=require(_0x340e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340e('0x5'))['db'];var utils=require(_0x340e('0x6'));var logger=require('../../config/logger')(_0x340e('0x7'));var config=require(_0x340e('0x8'));var jayson=require(_0x340e('0x9'));var client=jayson[_0x340e('0xa')][_0x340e('0xb')]({'port':0x232a});config[_0x340e('0xc')]=_['defaults'](config[_0x340e('0xc')],{'host':_0x340e('0xd'),'port':0x18eb});var socket=require(_0x340e('0xe'))(new Redis(config[_0x340e('0xc')]));require(_0x340e('0xf'))[_0x340e('0x10')](socket);function respondWithRpcPromise(_0x1d1a30,_0x5d8577,_0x27a2b7){return new BPromise(function(_0x46f055,_0x185542){return client[_0x340e('0x11')](_0x1d1a30,_0x27a2b7)['then'](function(_0x3fafad){logger[_0x340e('0x12')](_0x340e('0x13'),_0x5d8577,_0x340e('0x14'));logger[_0x340e('0x15')](_0x340e('0x16'),_0x5d8577,'request\x20sent',JSON[_0x340e('0x17')](_0x3fafad));if(_0x3fafad[_0x340e('0x18')]){if(_0x3fafad['error']['code']===0x1f4){logger[_0x340e('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x5d8577,_0x3fafad[_0x340e('0x18')][_0x340e('0x19')]);return _0x185542(_0x3fafad['error']['message']);}logger[_0x340e('0x18')](_0x340e('0x13'),_0x5d8577,_0x3fafad[_0x340e('0x18')][_0x340e('0x19')]);return _0x46f055(_0x3fafad[_0x340e('0x18')][_0x340e('0x19')]);}else{logger['info'](_0x340e('0x13'),_0x5d8577,_0x340e('0x14'));_0x46f055(_0x3fafad[_0x340e('0x1a')]['message']);}})['catch'](function(_0x3819ce){logger[_0x340e('0x18')](_0x340e('0x13'),_0x5d8577,_0x3819ce);_0x185542(_0x3819ce);});});}exports[_0x340e('0x1b')]=function(_0x5a744f){var _0x26baa4=this;return new Promise(function(_0x5b9e61,_0x134151){return db[_0x340e('0x1c')][_0x340e('0x1d')]({'raw':_0x5a744f[_0x340e('0x1e')]?_0x5a744f[_0x340e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5a744f[_0x340e('0x1e')]?_0x5a744f[_0x340e('0x1e')][_0x340e('0x1f')]||null:null,'attributes':_0x5a744f[_0x340e('0x1e')]?_0x5a744f['options'][_0x340e('0x20')]||null:null,'limit':_0x5a744f[_0x340e('0x1e')]?_0x5a744f['options'][_0x340e('0x21')]||null:null,'include':_0x5a744f[_0x340e('0x1e')]?_0x5a744f['options'][_0x340e('0x22')]?_[_0x340e('0x23')](_0x5a744f[_0x340e('0x1e')][_0x340e('0x22')],function(_0x12e164){return{'model':db[_0x12e164[_0x340e('0x24')]],'as':_0x12e164['as'],'attributes':_0x12e164[_0x340e('0x20')],'include':_0x12e164['include']?_['map'](_0x12e164[_0x340e('0x22')],function(_0x1ba1e6){return{'model':db[_0x1ba1e6[_0x340e('0x24')]],'as':_0x1ba1e6['as'],'attributes':_0x1ba1e6['attributes'],'include':_0x1ba1e6[_0x340e('0x22')]?_[_0x340e('0x23')](_0x1ba1e6[_0x340e('0x22')],function(_0x322e79){return{'model':db[_0x322e79[_0x340e('0x24')]],'as':_0x322e79['as'],'attributes':_0x322e79[_0x340e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x340e('0x25')](function(_0x3a9b14){logger[_0x340e('0x12')](_0x340e('0x1b'),_0x5a744f);logger['debug']('GetVoiceQueue',_0x5a744f,JSON['stringify'](_0x3a9b14));_0x5b9e61(_0x3a9b14);})[_0x340e('0x26')](function(_0x362081){logger[_0x340e('0x18')](_0x340e('0x1b'),_0x362081[_0x340e('0x19')],_0x5a744f);_0x134151(_0x26baa4['error'](0x1f4,_0x362081[_0x340e('0x19')]));});});};exports[_0x340e('0x27')]=function(_0x2f3221){var _0x38c78c=this;return new Promise(function(_0x30e1c2,_0xdded65){return db[_0x340e('0x1c')]['find']({'raw':_0x2f3221[_0x340e('0x1e')]?_0x2f3221[_0x340e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2f3221['options']?_0x2f3221[_0x340e('0x1e')][_0x340e('0x1f')]||null:null,'attributes':_0x2f3221['options']?_0x2f3221[_0x340e('0x1e')][_0x340e('0x20')]||null:null,'include':_0x2f3221['options']?_0x2f3221['options'][_0x340e('0x22')]?_[_0x340e('0x23')](_0x2f3221[_0x340e('0x1e')][_0x340e('0x22')],function(_0x807be7){return{'model':db[_0x807be7[_0x340e('0x24')]],'as':_0x807be7['as'],'attributes':_0x807be7[_0x340e('0x20')],'include':_0x807be7[_0x340e('0x22')]?_['map'](_0x807be7[_0x340e('0x22')],function(_0x329812){return{'model':db[_0x329812[_0x340e('0x24')]],'as':_0x329812['as'],'attributes':_0x329812[_0x340e('0x20')],'include':_0x329812[_0x340e('0x22')]?_[_0x340e('0x23')](_0x329812[_0x340e('0x22')],function(_0x13a734){return{'model':db[_0x13a734[_0x340e('0x24')]],'as':_0x13a734['as'],'attributes':_0x13a734[_0x340e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x340e('0x25')](function(_0x40267c){logger[_0x340e('0x12')](_0x340e('0x27'),_0x2f3221);logger[_0x340e('0x15')](_0x340e('0x27'),_0x2f3221,JSON[_0x340e('0x17')](_0x40267c));_0x30e1c2(_0x40267c);})[_0x340e('0x26')](function(_0x298ef0){logger[_0x340e('0x18')]('ShowVoiceQueue',_0x298ef0[_0x340e('0x19')],_0x2f3221);_0xdded65(_0x38c78c[_0x340e('0x18')](0x1f4,_0x298ef0[_0x340e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 858cd07..e6cd530 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 _0x4dac=['./voiceQueue.events','save','update','removeListener','register','length','voiceQueue:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4dac,0x157));var _0xc4da=function(_0x35116d,_0x30c8c7){_0x35116d=_0x35116d-0x0;var _0x16b2ab=_0x4dac[_0x35116d];return _0x16b2ab;};'use strict';var VoiceQueueEvents=require(_0xc4da('0x0'));var events=[_0xc4da('0x1'),'remove',_0xc4da('0x2')];function createListener(_0x2ff3ba,_0x1f6ee2){return function(_0x4506d0){_0x1f6ee2['emit'](_0x2ff3ba,_0x4506d0);};}function removeListener(_0xaa5d0f,_0x82438d){return function(){VoiceQueueEvents[_0xc4da('0x3')](_0xaa5d0f,_0x82438d);};}exports[_0xc4da('0x4')]=function(_0x273679){for(var _0x1adf02=0x0,_0x105d31=events[_0xc4da('0x5')];_0x1adf02<_0x105d31;_0x1adf02++){var _0x1f3664=events[_0x1adf02];var _0x39fccf=createListener(_0xc4da('0x6')+_0x1f3664,_0x273679);VoiceQueueEvents['on'](_0x1f3664,_0x39fccf);}}; \ No newline at end of file +var _0x6417=['remove','emit','removeListener','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x25e546,_0x8b0354){var _0xc60623=function(_0x4e578f){while(--_0x4e578f){_0x25e546['push'](_0x25e546['shift']());}};_0xc60623(++_0x8b0354);}(_0x6417,0x1b7));var _0x7641=function(_0x4bbaea,_0x2c95e7){_0x4bbaea=_0x4bbaea-0x0;var _0x49d24b=_0x6417[_0x4bbaea];return _0x49d24b;};'use strict';var VoiceQueueEvents=require(_0x7641('0x0'));var events=[_0x7641('0x1'),_0x7641('0x2'),'update'];function createListener(_0x1e5700,_0x4fafc0){return function(_0x18e662){_0x4fafc0[_0x7641('0x3')](_0x1e5700,_0x18e662);};}function removeListener(_0x63e767,_0x484ce8){return function(){VoiceQueueEvents[_0x7641('0x4')](_0x63e767,_0x484ce8);};}exports[_0x7641('0x5')]=function(_0x2e8202){for(var _0xa4b8f0=0x0,_0x5ac0c8=events['length'];_0xa4b8f0<_0x5ac0c8;_0xa4b8f0++){var _0x342a54=events[_0xa4b8f0];var _0x13554d=createListener(_0x7641('0x6')+_0x342a54,_0x2e8202);VoiceQueueEvents['on'](_0x342a54,_0x13554d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index d5de562..507208c 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 _0x446e=['create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x446e,0x1b9));var _0xe446=function(_0x3f9c2f,_0x417431){_0x3f9c2f=_0x3f9c2f-0x0;var _0x50b7c6=_0x446e[_0x3f9c2f];return _0x50b7c6;};'use strict';var multer=require(_0xe446('0x0'));var util=require(_0xe446('0x1'));var path=require(_0xe446('0x2'));var timeout=require('connect-timeout');var express=require(_0xe446('0x3'));var router=express[_0xe446('0x4')]();var fs_extra=require(_0xe446('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe446('0x6'));var config=require('../../config/environment');var controller=require(_0xe446('0x7'));router[_0xe446('0x8')]('/',auth[_0xe446('0x9')](),controller['index']);router[_0xe446('0x8')](_0xe446('0xa'),auth[_0xe446('0x9')](),controller[_0xe446('0xb')]);router[_0xe446('0x8')]('/index',auth[_0xe446('0x9')](),controller['getVoiceQueuesReport']);router[_0xe446('0x8')](_0xe446('0xc'),auth['isAuthenticated'](),controller[_0xe446('0xd')]);router[_0xe446('0xe')]('/',auth['isAuthenticated'](),controller[_0xe446('0xf')]);router[_0xe446('0x10')](_0xe446('0xc'),auth[_0xe446('0x9')](),controller['update']);router[_0xe446('0x11')]('/:id',auth[_0xe446('0x9')](),controller['destroy']);module[_0xe446('0x12')]=router; \ No newline at end of file +var _0x6d59=['describe','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xdcc574,_0x31bc35){var _0x1691a4=function(_0x51a7af){while(--_0x51a7af){_0xdcc574['push'](_0xdcc574['shift']());}};_0x1691a4(++_0x31bc35);}(_0x6d59,0xa5));var _0x96d5=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6d59[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x96d5('0x0'));var util=require(_0x96d5('0x1'));var path=require(_0x96d5('0x2'));var timeout=require(_0x96d5('0x3'));var express=require(_0x96d5('0x4'));var router=express[_0x96d5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x96d5('0x6'));var interaction=require(_0x96d5('0x7'));var config=require(_0x96d5('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x96d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x96d5('0xa')]);router[_0x96d5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x96d5('0xb')]);router[_0x96d5('0x9')]('/index',auth[_0x96d5('0xc')](),controller[_0x96d5('0xd')]);router[_0x96d5('0x9')](_0x96d5('0xe'),auth[_0x96d5('0xc')](),controller[_0x96d5('0xf')]);router[_0x96d5('0x10')]('/',auth[_0x96d5('0xc')](),controller[_0x96d5('0x11')]);router[_0x96d5('0x12')](_0x96d5('0xe'),auth[_0x96d5('0xc')](),controller['update']);router[_0x96d5('0x13')](_0x96d5('0xe'),auth[_0x96d5('0xc')](),controller[_0x96d5('0x14')]);module[_0x96d5('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index e46a34a..0b3f197 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 _0x0653=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE'];(function(_0x5b6fb2,_0x1d697c){var _0x48b135=function(_0x160ab9){while(--_0x160ab9){_0x5b6fb2['push'](_0x5b6fb2['shift']());}};_0x48b135(++_0x1d697c);}(_0x0653,0xdb));var _0x3065=function(_0x4220af,_0x15c4b2){_0x4220af=_0x4220af-0x0;var _0x327535=_0x0653[_0x4220af];return _0x327535;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x3065('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3065('0x0')]},'queue':{'type':Sequelize[_0x3065('0x0')]},'queuecallerjoinAt':{'type':Sequelize[_0x3065('0x1')]},'queuecallerleaveAt':{'type':Sequelize[_0x3065('0x1')],'set':function(_0xb1be44){var _0x1e9bd8=moment(_0xb1be44);var _0x329e8e=moment(this[_0x3065('0x2')](_0x3065('0x3')))[_0x3065('0x4')](_0x3065('0x5'));var _0x7c157b=_0x1e9bd8[_0x3065('0x6')](_0x329e8e,_0x3065('0x7'));this['setDataValue']('queuecallerleaveAt',_0xb1be44);this[_0x3065('0x8')]('holdtime',_0x7c157b||null);}},'position':{'type':Sequelize[_0x3065('0x9')]},'count':{'type':Sequelize[_0x3065('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3065('0x1')]},'queuecallercomplete':{'type':Sequelize[_0x3065('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3065('0x1')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3065('0x1')]},'queuecallerexitreason':{'type':Sequelize[_0x3065('0x0')],'comment':_0x3065('0xb')},'originalposition':{'type':Sequelize[_0x3065('0x9')]},'channel':{'type':Sequelize[_0x3065('0x0')]},'connectedlinenum':{'type':Sequelize[_0x3065('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3065('0x0')]},'priority':{'type':Sequelize[_0x3065('0x0')]},'holdtime':{'type':Sequelize[_0x3065('0x9')]},'mohtime':{'type':Sequelize[_0x3065('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3065('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3065('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3065('0x0')],'comment':_0x3065('0xc')},'transferexten':{'type':Sequelize[_0x3065('0x0')]},'transferuniqueid':{'type':Sequelize[_0x3065('0x0')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3065('0x0')]},'thirdDisposition':{'type':Sequelize[_0x3065('0x0')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4859=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x1fbd03,_0x2a16ba){var _0x54b3e8=function(_0x49f55f){while(--_0x49f55f){_0x1fbd03['push'](_0x1fbd03['shift']());}};_0x54b3e8(++_0x2a16ba);}(_0x4859,0x1ea));var _0x9485=function(_0x4a1f15,_0x3f3ac6){_0x4a1f15=_0x4a1f15-0x0;var _0x3d6ffd=_0x4859[_0x4a1f15];return _0x3d6ffd;};'use strict';var Sequelize=require(_0x9485('0x0'));var moment=require(_0x9485('0x1'));module[_0x9485('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9485('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9485('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9485('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9485('0x4')],'set':function(_0x44ca76){var _0x45d96c=moment(_0x44ca76);var _0x2bbaaa=moment(this['getDataValue'](_0x9485('0x5')))[_0x9485('0x6')](_0x9485('0x7'));var _0x4818fa=_0x45d96c[_0x9485('0x8')](_0x2bbaaa,'seconds');this['setDataValue'](_0x9485('0x9'),_0x44ca76);this[_0x9485('0xa')]('holdtime',_0x4818fa||null);}},'position':{'type':Sequelize[_0x9485('0xb')]},'count':{'type':Sequelize[_0x9485('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x9485('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9485('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9485('0x4')]},'queuecallerexit':{'type':Sequelize[_0x9485('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9485('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x9485('0x3')],'comment':_0x9485('0xd')},'originalposition':{'type':Sequelize[_0x9485('0xb')]},'channel':{'type':Sequelize[_0x9485('0x3')]},'connectedlinenum':{'type':Sequelize[_0x9485('0x3')]},'connectedlinename':{'type':Sequelize[_0x9485('0x3')]},'accountcode':{'type':Sequelize[_0x9485('0x3')]},'context':{'type':Sequelize[_0x9485('0x3')]},'exten':{'type':Sequelize[_0x9485('0x3')]},'priority':{'type':Sequelize[_0x9485('0x3')]},'holdtime':{'type':Sequelize[_0x9485('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9485('0x3')]},'transfer':{'type':Sequelize[_0x9485('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9485('0x3')],'comment':_0x9485('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9485('0x3')]},'secondDisposition':{'type':Sequelize[_0x9485('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9485('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 426661d..d3e3b0d 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 _0x2d37=['order','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','name','index','VoiceQueueReport','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getVoiceQueuesReport'];(function(_0x58d4ce,_0x154425){var _0x3c5170=function(_0x235a0a){while(--_0x235a0a){_0x58d4ce['push'](_0x58d4ce['shift']());}};_0x3c5170(++_0x154425);}(_0x2d37,0xf8));var _0x72d3=function(_0x539da7,_0x472242){_0x539da7=_0x539da7-0x0;var _0x278b44=_0x2d37[_0x539da7];return _0x278b44;};'use strict';var emlformat=require(_0x72d3('0x0'));var rimraf=require(_0x72d3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d3('0x2'));var rp=require(_0x72d3('0x3'));var moment=require(_0x72d3('0x4'));var BPromise=require(_0x72d3('0x5'));var Mustache=require(_0x72d3('0x6'));var util=require('util');var path=require(_0x72d3('0x7'));var sox=require(_0x72d3('0x8'));var csv=require(_0x72d3('0x9'));var ejs=require(_0x72d3('0xa'));var fs=require('fs');var fs_extra=require(_0x72d3('0xb'));var _=require(_0x72d3('0xc'));var squel=require(_0x72d3('0xd'));var crypto=require(_0x72d3('0xe'));var jsforce=require(_0x72d3('0xf'));var deskjs=require(_0x72d3('0x10'));var toCsv=require(_0x72d3('0x9'));var querystring=require(_0x72d3('0x11'));var Papa=require(_0x72d3('0x12'));var Redis=require(_0x72d3('0x13'));var authService=require(_0x72d3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x72d3('0x15'));var hardwareService=require(_0x72d3('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x72d3('0x17'));var config=require(_0x72d3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x72d3('0x19'))['db'];config[_0x72d3('0x1a')]=_[_0x72d3('0x1b')](config[_0x72d3('0x1a')],{'host':_0x72d3('0x1c'),'port':0x18eb});var socket=require(_0x72d3('0x1d'))(new Redis(config[_0x72d3('0x1a')]));require(_0x72d3('0x1e'))[_0x72d3('0x1f')](socket);function respondWithStatusCode(_0x48532d,_0x12ff03){_0x12ff03=_0x12ff03||0xcc;return function(_0x78a4ca){if(_0x78a4ca){return _0x48532d[_0x72d3('0x20')](_0x12ff03);}return _0x48532d['status'](_0x12ff03)[_0x72d3('0x21')]();};}function respondWithResult(_0x36135c,_0x23f23c){_0x23f23c=_0x23f23c||0xc8;return function(_0x132642){if(_0x132642){return _0x36135c[_0x72d3('0x22')](_0x23f23c)['json'](_0x132642);}};}function respondWithFilteredResult(_0x3a641c,_0x3dd8dd){return function(_0x65b7f2){if(_0x65b7f2){var _0x18ce1b=typeof _0x3dd8dd[_0x72d3('0x23')]===_0x72d3('0x24')&&typeof _0x3dd8dd[_0x72d3('0x25')]===_0x72d3('0x24');var _0x3a24db=_0x65b7f2['count'];var _0x58fe41=_0x18ce1b?0x0:_0x3dd8dd[_0x72d3('0x23')];var _0x36d425=_0x18ce1b?_0x65b7f2[_0x72d3('0x26')]:_0x3dd8dd['offset']+_0x3dd8dd[_0x72d3('0x25')];var _0xa440b5;if(_0x36d425>=_0x3a24db){_0x36d425=_0x3a24db;_0xa440b5=0xc8;}else{_0xa440b5=0xce;}_0x3a641c['status'](_0xa440b5);return _0x3a641c[_0x72d3('0x27')]('Content-Range',_0x58fe41+'-'+_0x36d425+'/'+_0x3a24db)[_0x72d3('0x28')](_0x65b7f2);}return null;};}function patchUpdates(_0xc23f0c){return function(_0x501f20){try{jsonpatch[_0x72d3('0x29')](_0x501f20,_0xc23f0c,!![]);}catch(_0x21b9fc){return BPromise[_0x72d3('0x2a')](_0x21b9fc);}return _0x501f20[_0x72d3('0x2b')]();};}function saveUpdates(_0x13db1,_0x3ab033){return function(_0x124e19){if(_0x124e19){return _0x124e19[_0x72d3('0x2c')](_0x13db1)[_0x72d3('0x2d')](function(_0x539915){return _0x539915;});}return null;};}function removeEntity(_0x467fea,_0x32e56c){return function(_0x13521f){if(_0x13521f){return _0x13521f[_0x72d3('0x2e')]()[_0x72d3('0x2d')](function(){_0x467fea[_0x72d3('0x22')](0xcc)[_0x72d3('0x21')]();});}};}function handleEntityNotFound(_0xf6204d,_0x2b81dc){return function(_0x24658c){if(!_0x24658c){_0xf6204d[_0x72d3('0x20')](0x194);}return _0x24658c;};}function handleError(_0xa56f4,_0x170f8c){_0x170f8c=_0x170f8c||0x1f4;return function(_0x2ef33a){logger['error'](_0x2ef33a['stack']);if(_0x2ef33a['name']){delete _0x2ef33a[_0x72d3('0x2f')];}_0xa56f4['status'](_0x170f8c)['send'](_0x2ef33a);};}exports[_0x72d3('0x30')]=function(_0x1e689a,_0x49b16a){var _0x3e58d0={},_0x58f182={},_0x1367a6={'count':0x0,'rows':[]};var _0x194120=_['map'](db[_0x72d3('0x31')][_0x72d3('0x32')],function(_0x14c3d2){return{'name':_0x14c3d2['fieldName'],'type':_0x14c3d2[_0x72d3('0x33')]['key']};});_0x58f182[_0x72d3('0x34')]=_[_0x72d3('0x35')](_0x194120,_0x72d3('0x2f'));_0x58f182[_0x72d3('0x36')]=_[_0x72d3('0x37')](_0x1e689a[_0x72d3('0x36')]);_0x58f182['filters']=_[_0x72d3('0x38')](_0x58f182[_0x72d3('0x34')],_0x58f182[_0x72d3('0x36')]);_0x3e58d0[_0x72d3('0x39')]=_['intersection'](_0x58f182[_0x72d3('0x34')],qs['fields'](_0x1e689a[_0x72d3('0x36')][_0x72d3('0x3a')]));_0x3e58d0[_0x72d3('0x39')]=_0x3e58d0[_0x72d3('0x39')][_0x72d3('0x3b')]?_0x3e58d0['attributes']:_0x58f182['model'];if(!_0x1e689a[_0x72d3('0x36')][_0x72d3('0x3c')](_0x72d3('0x3d'))){_0x3e58d0['limit']=qs[_0x72d3('0x25')](_0x1e689a[_0x72d3('0x36')][_0x72d3('0x25')]);_0x3e58d0[_0x72d3('0x23')]=qs[_0x72d3('0x23')](_0x1e689a[_0x72d3('0x36')][_0x72d3('0x23')]);}_0x3e58d0['order']=qs[_0x72d3('0x3e')](_0x1e689a[_0x72d3('0x36')][_0x72d3('0x3e')]);_0x3e58d0['where']=qs[_0x72d3('0x3f')](_[_0x72d3('0x40')](_0x1e689a[_0x72d3('0x36')],_0x58f182[_0x72d3('0x3f')]),_0x194120);if(_0x1e689a[_0x72d3('0x36')][_0x72d3('0x41')]){_0x3e58d0[_0x72d3('0x42')]=_[_0x72d3('0x43')](_0x3e58d0[_0x72d3('0x42')],{'$or':_[_0x72d3('0x35')](_0x194120,function(_0x5c45a4){if(_0x5c45a4[_0x72d3('0x33')]!==_0x72d3('0x44')){var _0x3316d9={};_0x3316d9[_0x5c45a4[_0x72d3('0x2f')]]={'$like':'%'+_0x1e689a['query'][_0x72d3('0x41')]+'%'};return _0x3316d9;}})});}_0x3e58d0=_['merge']({},_0x3e58d0,_0x1e689a[_0x72d3('0x45')]);var _0x2e5696={'where':_0x3e58d0[_0x72d3('0x42')]};return db[_0x72d3('0x31')]['count'](_0x2e5696)[_0x72d3('0x2d')](function(_0x729e64){_0x1367a6['count']=_0x729e64;if(_0x1e689a[_0x72d3('0x36')][_0x72d3('0x46')]){_0x3e58d0[_0x72d3('0x47')]=[{'all':!![]}];}return db[_0x72d3('0x31')]['findAll'](_0x3e58d0);})['then'](function(_0xb503d7){_0x1367a6[_0x72d3('0x48')]=_0xb503d7;return _0x1367a6;})[_0x72d3('0x2d')](respondWithFilteredResult(_0x49b16a,_0x3e58d0))[_0x72d3('0x49')](handleError(_0x49b16a,null));};exports[_0x72d3('0x4a')]=function(_0x5311bc,_0x4284c8){var _0x3287a5={'raw':![],'where':{'id':_0x5311bc[_0x72d3('0x4b')]['id']}},_0x20eb63={};_0x20eb63[_0x72d3('0x34')]=_[_0x72d3('0x37')](db[_0x72d3('0x31')][_0x72d3('0x32')]);_0x20eb63[_0x72d3('0x36')]=_[_0x72d3('0x37')](_0x5311bc[_0x72d3('0x36')]);_0x20eb63[_0x72d3('0x3f')]=_[_0x72d3('0x38')](_0x20eb63[_0x72d3('0x34')],_0x20eb63['query']);_0x3287a5[_0x72d3('0x39')]=_[_0x72d3('0x38')](_0x20eb63[_0x72d3('0x34')],qs[_0x72d3('0x3a')](_0x5311bc['query'][_0x72d3('0x3a')]));_0x3287a5[_0x72d3('0x39')]=_0x3287a5[_0x72d3('0x39')][_0x72d3('0x3b')]?_0x3287a5[_0x72d3('0x39')]:_0x20eb63[_0x72d3('0x34')];if(_0x5311bc[_0x72d3('0x36')][_0x72d3('0x46')]){_0x3287a5[_0x72d3('0x47')]=[{'all':!![]}];}_0x3287a5=_[_0x72d3('0x43')]({},_0x3287a5,_0x5311bc['options']);return db[_0x72d3('0x31')]['find'](_0x3287a5)[_0x72d3('0x2d')](handleEntityNotFound(_0x4284c8,null))[_0x72d3('0x2d')](respondWithResult(_0x4284c8,null))[_0x72d3('0x49')](handleError(_0x4284c8,null));};exports[_0x72d3('0x4c')]=function(_0x676a84,_0x3ae5e7){return db[_0x72d3('0x31')][_0x72d3('0x4c')](_0x676a84[_0x72d3('0x4d')],{})[_0x72d3('0x2d')](respondWithResult(_0x3ae5e7,0xc9))[_0x72d3('0x49')](handleError(_0x3ae5e7,null));};exports[_0x72d3('0x2c')]=function(_0x539caa,_0x40537a){if(_0x539caa['body']['id']){delete _0x539caa[_0x72d3('0x4d')]['id'];}return db[_0x72d3('0x31')]['find']({'where':{'id':_0x539caa[_0x72d3('0x4b')]['id']}})[_0x72d3('0x2d')](handleEntityNotFound(_0x40537a,null))[_0x72d3('0x2d')](saveUpdates(_0x539caa[_0x72d3('0x4d')],null))[_0x72d3('0x2d')](respondWithResult(_0x40537a,null))['catch'](handleError(_0x40537a,null));};exports[_0x72d3('0x2e')]=function(_0x4c9d5e,_0x140930){return db[_0x72d3('0x31')][_0x72d3('0x4e')]({'where':{'id':_0x4c9d5e[_0x72d3('0x4b')]['id']}})[_0x72d3('0x2d')](handleEntityNotFound(_0x140930,null))[_0x72d3('0x2d')](removeEntity(_0x140930,null))[_0x72d3('0x49')](handleError(_0x140930,null));};exports['describe']=function(_0x491b3e,_0xf7af75){return db[_0x72d3('0x31')]['describe']()[_0x72d3('0x2d')](respondWithResult(_0xf7af75,null))[_0x72d3('0x49')](handleError(_0xf7af75,null));};exports[_0x72d3('0x4f')]=function(_0x465576,_0xda8081){var _0x14a082={},_0x5dc22a={},_0x40b30d={'count':0x0,'rows':[]};_0x5dc22a['model']=_[_0x72d3('0x37')](db[_0x72d3('0x31')]['rawAttributes']);_0x5dc22a['query']=_[_0x72d3('0x37')](_0x465576[_0x72d3('0x36')]);_0x5dc22a[_0x72d3('0x3f')]=_[_0x72d3('0x38')](_0x5dc22a['model'],_0x5dc22a['query']);_0x14a082[_0x72d3('0x39')]=_['intersection'](_0x5dc22a['model'],qs[_0x72d3('0x3a')](_0x465576[_0x72d3('0x36')][_0x72d3('0x3a')]));_0x14a082[_0x72d3('0x39')]=_0x14a082[_0x72d3('0x39')][_0x72d3('0x3b')]?_0x14a082[_0x72d3('0x39')]:_0x5dc22a[_0x72d3('0x34')];if(!_0x465576[_0x72d3('0x36')][_0x72d3('0x3c')](_0x72d3('0x3d'))){_0x14a082[_0x72d3('0x25')]=qs[_0x72d3('0x25')](_0x465576['query'][_0x72d3('0x25')]);_0x14a082[_0x72d3('0x23')]=qs[_0x72d3('0x23')](_0x465576['query'][_0x72d3('0x23')]);}_0x14a082[_0x72d3('0x50')]=qs[_0x72d3('0x3e')](_0x465576[_0x72d3('0x36')]['sort']);_0x14a082[_0x72d3('0x42')]=qs[_0x72d3('0x3f')](_[_0x72d3('0x40')](_0x465576['query'],_0x5dc22a[_0x72d3('0x3f')]));if(_0x465576['query'][_0x72d3('0x41')]){_0x14a082[_0x72d3('0x42')]=_[_0x72d3('0x43')](_0x14a082[_0x72d3('0x42')],{'$or':_[_0x72d3('0x35')](_0x14a082[_0x72d3('0x39')],function(_0xbc590a){var _0x309b50={};_0x309b50[_0xbc590a]={'$like':'%'+_0x465576[_0x72d3('0x36')][_0x72d3('0x41')]+'%'};return _0x309b50;})});}_0x14a082=_[_0x72d3('0x43')]({},_0x14a082,_0x465576[_0x72d3('0x45')]);var _0x202dde={'where':_0x14a082[_0x72d3('0x42')]};return db[_0x72d3('0x31')][_0x72d3('0x26')](_0x202dde)[_0x72d3('0x2d')](function(_0x324068){_0x40b30d[_0x72d3('0x26')]=_0x324068;if(_0x465576[_0x72d3('0x36')][_0x72d3('0x46')]){_0x14a082[_0x72d3('0x47')]=[{'all':!![]}];}return db[_0x72d3('0x31')][_0x72d3('0x51')](_0x14a082);})[_0x72d3('0x2d')](function(_0x46f914){_0x40b30d[_0x72d3('0x48')]=_0x46f914;return _0x40b30d;})['then'](respondWithFilteredResult(_0xda8081,_0x14a082,'getVoiceQueuesReport'))['catch'](handleError(_0xda8081,null,_0x72d3('0x4f')));}; \ No newline at end of file +var _0x74a2=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','VoiceQueueReport','findAll','rows','catch','show','options','find','create','body','params','describe','getVoiceQueuesReport','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','lodash','crypto'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0x74a2,0x98));var _0x274a=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x74a2[_0x256b72];return _0x2183e3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x274a('0x0'));var jsonpatch=require(_0x274a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x274a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x274a('0x3'));var csv=require(_0x274a('0x4'));var ejs=require(_0x274a('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x274a('0x6'));var squel=require('squel');var crypto=require(_0x274a('0x7'));var jsforce=require(_0x274a('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x274a('0x9'));var Papa=require(_0x274a('0xa'));var Redis=require(_0x274a('0xb'));var authService=require(_0x274a('0xc'));var qs=require(_0x274a('0xd'));var as=require(_0x274a('0xe'));var hardwareService=require(_0x274a('0xf'));var logger=require(_0x274a('0x10'))(_0x274a('0x11'));var utils=require(_0x274a('0x12'));var config=require(_0x274a('0x13'));var licenseUtil=require(_0x274a('0x14'));var db=require(_0x274a('0x15'))['db'];config['redis']=_[_0x274a('0x16')](config[_0x274a('0x17')],{'host':_0x274a('0x18'),'port':0x18eb});var socket=require(_0x274a('0x19'))(new Redis(config['redis']));require(_0x274a('0x1a'))[_0x274a('0x1b')](socket);function respondWithStatusCode(_0x48f46f,_0xe29ca1){_0xe29ca1=_0xe29ca1||0xcc;return function(_0x420932){if(_0x420932){return _0x48f46f[_0x274a('0x1c')](_0xe29ca1);}return _0x48f46f[_0x274a('0x1d')](_0xe29ca1)[_0x274a('0x1e')]();};}function respondWithResult(_0x48a762,_0x14bb81){_0x14bb81=_0x14bb81||0xc8;return function(_0x33b8c1){if(_0x33b8c1){return _0x48a762[_0x274a('0x1d')](_0x14bb81)['json'](_0x33b8c1);}};}function respondWithFilteredResult(_0x31f5c0,_0x5cef52){return function(_0x763f33){if(_0x763f33){var _0x171eb6=typeof _0x5cef52[_0x274a('0x1f')]==='undefined'&&typeof _0x5cef52[_0x274a('0x20')]===_0x274a('0x21');var _0x9216ee=_0x763f33[_0x274a('0x22')];var _0x59f0d4=_0x171eb6?0x0:_0x5cef52[_0x274a('0x1f')];var _0x272e32=_0x171eb6?_0x763f33[_0x274a('0x22')]:_0x5cef52[_0x274a('0x1f')]+_0x5cef52[_0x274a('0x20')];var _0x1f55e0;if(_0x272e32>=_0x9216ee){_0x272e32=_0x9216ee;_0x1f55e0=0xc8;}else{_0x1f55e0=0xce;}_0x31f5c0[_0x274a('0x1d')](_0x1f55e0);return _0x31f5c0[_0x274a('0x23')]('Content-Range',_0x59f0d4+'-'+_0x272e32+'/'+_0x9216ee)['json'](_0x763f33);}return null;};}function patchUpdates(_0x40f908){return function(_0x5a21cc){try{jsonpatch[_0x274a('0x24')](_0x5a21cc,_0x40f908,!![]);}catch(_0x20bcac){return BPromise[_0x274a('0x25')](_0x20bcac);}return _0x5a21cc[_0x274a('0x26')]();};}function saveUpdates(_0x4242f7,_0x2ab238){return function(_0x19dcde){if(_0x19dcde){return _0x19dcde[_0x274a('0x27')](_0x4242f7)[_0x274a('0x28')](function(_0x35b5ff){return _0x35b5ff;});}return null;};}function removeEntity(_0x177fec,_0x4650ed){return function(_0x529f82){if(_0x529f82){return _0x529f82[_0x274a('0x29')]()[_0x274a('0x28')](function(){_0x177fec[_0x274a('0x1d')](0xcc)[_0x274a('0x1e')]();});}};}function handleEntityNotFound(_0x3153e4,_0x2a5e3a){return function(_0x275c1a){if(!_0x275c1a){_0x3153e4[_0x274a('0x1c')](0x194);}return _0x275c1a;};}function handleError(_0x19837e,_0x1e5be8){_0x1e5be8=_0x1e5be8||0x1f4;return function(_0x497f98){logger[_0x274a('0x2a')](_0x497f98[_0x274a('0x2b')]);if(_0x497f98[_0x274a('0x2c')]){delete _0x497f98[_0x274a('0x2c')];}_0x19837e[_0x274a('0x1d')](_0x1e5be8)[_0x274a('0x2d')](_0x497f98);};}exports[_0x274a('0x2e')]=function(_0x417903,_0x21511e){var _0x545fec={},_0x361a00={},_0x23cc18={'count':0x0,'rows':[]};var _0xfbd4f3=_['map'](db['VoiceQueueReport'][_0x274a('0x2f')],function(_0x316396){return{'name':_0x316396[_0x274a('0x30')],'type':_0x316396[_0x274a('0x31')][_0x274a('0x32')]};});_0x361a00['model']=_[_0x274a('0x33')](_0xfbd4f3,_0x274a('0x2c'));_0x361a00[_0x274a('0x34')]=_[_0x274a('0x35')](_0x417903[_0x274a('0x34')]);_0x361a00['filters']=_[_0x274a('0x36')](_0x361a00[_0x274a('0x37')],_0x361a00[_0x274a('0x34')]);_0x545fec[_0x274a('0x38')]=_['intersection'](_0x361a00[_0x274a('0x37')],qs['fields'](_0x417903[_0x274a('0x34')][_0x274a('0x39')]));_0x545fec[_0x274a('0x38')]=_0x545fec[_0x274a('0x38')][_0x274a('0x3a')]?_0x545fec['attributes']:_0x361a00['model'];if(!_0x417903[_0x274a('0x34')][_0x274a('0x3b')](_0x274a('0x3c'))){_0x545fec[_0x274a('0x20')]=qs[_0x274a('0x20')](_0x417903[_0x274a('0x34')]['limit']);_0x545fec[_0x274a('0x1f')]=qs[_0x274a('0x1f')](_0x417903[_0x274a('0x34')]['offset']);}_0x545fec[_0x274a('0x3d')]=qs[_0x274a('0x3e')](_0x417903[_0x274a('0x34')][_0x274a('0x3e')]);_0x545fec[_0x274a('0x3f')]=qs[_0x274a('0x40')](_['pick'](_0x417903[_0x274a('0x34')],_0x361a00[_0x274a('0x40')]),_0xfbd4f3);if(_0x417903[_0x274a('0x34')][_0x274a('0x41')]){_0x545fec[_0x274a('0x3f')]=_[_0x274a('0x42')](_0x545fec[_0x274a('0x3f')],{'$or':_[_0x274a('0x33')](_0xfbd4f3,function(_0x2efca0){if(_0x2efca0['type']!=='VIRTUAL'){var _0x2af866={};_0x2af866[_0x2efca0['name']]={'$like':'%'+_0x417903['query']['filter']+'%'};return _0x2af866;}})});}_0x545fec=_[_0x274a('0x42')]({},_0x545fec,_0x417903['options']);var _0x3af7cb={'where':_0x545fec['where']};return db['VoiceQueueReport']['count'](_0x3af7cb)[_0x274a('0x28')](function(_0x149aa8){_0x23cc18['count']=_0x149aa8;if(_0x417903['query']['includeAll']){_0x545fec[_0x274a('0x43')]=[{'all':!![]}];}return db[_0x274a('0x44')][_0x274a('0x45')](_0x545fec);})['then'](function(_0x47cb53){_0x23cc18[_0x274a('0x46')]=_0x47cb53;return _0x23cc18;})[_0x274a('0x28')](respondWithFilteredResult(_0x21511e,_0x545fec))[_0x274a('0x47')](handleError(_0x21511e,null));};exports[_0x274a('0x48')]=function(_0x369c61,_0xd72480){var _0x1296bd={'raw':![],'where':{'id':_0x369c61['params']['id']}},_0x30e7ec={};_0x30e7ec[_0x274a('0x37')]=_[_0x274a('0x35')](db[_0x274a('0x44')][_0x274a('0x2f')]);_0x30e7ec[_0x274a('0x34')]=_[_0x274a('0x35')](_0x369c61[_0x274a('0x34')]);_0x30e7ec[_0x274a('0x40')]=_[_0x274a('0x36')](_0x30e7ec[_0x274a('0x37')],_0x30e7ec[_0x274a('0x34')]);_0x1296bd[_0x274a('0x38')]=_[_0x274a('0x36')](_0x30e7ec[_0x274a('0x37')],qs['fields'](_0x369c61['query'][_0x274a('0x39')]));_0x1296bd['attributes']=_0x1296bd[_0x274a('0x38')][_0x274a('0x3a')]?_0x1296bd['attributes']:_0x30e7ec[_0x274a('0x37')];if(_0x369c61[_0x274a('0x34')]['includeAll']){_0x1296bd[_0x274a('0x43')]=[{'all':!![]}];}_0x1296bd=_['merge']({},_0x1296bd,_0x369c61[_0x274a('0x49')]);return db[_0x274a('0x44')][_0x274a('0x4a')](_0x1296bd)[_0x274a('0x28')](handleEntityNotFound(_0xd72480,null))[_0x274a('0x28')](respondWithResult(_0xd72480,null))[_0x274a('0x47')](handleError(_0xd72480,null));};exports['create']=function(_0x12ebdb,_0x2d558d){return db[_0x274a('0x44')][_0x274a('0x4b')](_0x12ebdb[_0x274a('0x4c')],{})[_0x274a('0x28')](respondWithResult(_0x2d558d,0xc9))[_0x274a('0x47')](handleError(_0x2d558d,null));};exports[_0x274a('0x27')]=function(_0x58868e,_0x424fa6){if(_0x58868e[_0x274a('0x4c')]['id']){delete _0x58868e[_0x274a('0x4c')]['id'];}return db[_0x274a('0x44')]['find']({'where':{'id':_0x58868e[_0x274a('0x4d')]['id']}})[_0x274a('0x28')](handleEntityNotFound(_0x424fa6,null))[_0x274a('0x28')](saveUpdates(_0x58868e['body'],null))['then'](respondWithResult(_0x424fa6,null))[_0x274a('0x47')](handleError(_0x424fa6,null));};exports['destroy']=function(_0x2a7702,_0x4b25ea){return db['VoiceQueueReport']['find']({'where':{'id':_0x2a7702[_0x274a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b25ea,null))[_0x274a('0x28')](removeEntity(_0x4b25ea,null))[_0x274a('0x47')](handleError(_0x4b25ea,null));};exports[_0x274a('0x4e')]=function(_0x587b95,_0x149b92){return db[_0x274a('0x44')][_0x274a('0x4e')]()[_0x274a('0x28')](respondWithResult(_0x149b92,null))[_0x274a('0x47')](handleError(_0x149b92,null));};exports[_0x274a('0x4f')]=function(_0x182679,_0x278d01){var _0x454d09={},_0x59ae9e={},_0x5d73b0={'count':0x0,'rows':[]};_0x59ae9e[_0x274a('0x37')]=_[_0x274a('0x35')](db[_0x274a('0x44')][_0x274a('0x2f')]);_0x59ae9e[_0x274a('0x34')]=_['keys'](_0x182679[_0x274a('0x34')]);_0x59ae9e[_0x274a('0x40')]=_[_0x274a('0x36')](_0x59ae9e[_0x274a('0x37')],_0x59ae9e[_0x274a('0x34')]);_0x454d09[_0x274a('0x38')]=_[_0x274a('0x36')](_0x59ae9e[_0x274a('0x37')],qs['fields'](_0x182679[_0x274a('0x34')][_0x274a('0x39')]));_0x454d09[_0x274a('0x38')]=_0x454d09['attributes'][_0x274a('0x3a')]?_0x454d09[_0x274a('0x38')]:_0x59ae9e[_0x274a('0x37')];if(!_0x182679['query'][_0x274a('0x3b')](_0x274a('0x3c'))){_0x454d09[_0x274a('0x20')]=qs['limit'](_0x182679[_0x274a('0x34')]['limit']);_0x454d09[_0x274a('0x1f')]=qs[_0x274a('0x1f')](_0x182679[_0x274a('0x34')]['offset']);}_0x454d09[_0x274a('0x3d')]=qs['sort'](_0x182679[_0x274a('0x34')][_0x274a('0x3e')]);_0x454d09['where']=qs['filters'](_['pick'](_0x182679[_0x274a('0x34')],_0x59ae9e[_0x274a('0x40')]));if(_0x182679[_0x274a('0x34')][_0x274a('0x41')]){_0x454d09[_0x274a('0x3f')]=_[_0x274a('0x42')](_0x454d09[_0x274a('0x3f')],{'$or':_['map'](_0x454d09['attributes'],function(_0x4f9bc1){var _0x267314={};_0x267314[_0x4f9bc1]={'$like':'%'+_0x182679[_0x274a('0x34')]['filter']+'%'};return _0x267314;})});}_0x454d09=_[_0x274a('0x42')]({},_0x454d09,_0x182679[_0x274a('0x49')]);var _0x3f3c04={'where':_0x454d09[_0x274a('0x3f')]};return db[_0x274a('0x44')][_0x274a('0x22')](_0x3f3c04)[_0x274a('0x28')](function(_0x1d3193){_0x5d73b0[_0x274a('0x22')]=_0x1d3193;if(_0x182679[_0x274a('0x34')]['includeAll']){_0x454d09['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x454d09);})[_0x274a('0x28')](function(_0x4a9549){_0x5d73b0[_0x274a('0x46')]=_0x4a9549;return _0x5d73b0;})[_0x274a('0x28')](respondWithFilteredResult(_0x278d01,_0x454d09,_0x274a('0x4f')))[_0x274a('0x47')](handleError(_0x278d01,null,_0x274a('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a3f6f4c..fe3f127 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 _0xfde8=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x442632,_0x3b8163){var _0x2bbbf2=function(_0x5959ac){while(--_0x5959ac){_0x442632['push'](_0x442632['shift']());}};_0x2bbbf2(++_0x3b8163);}(_0xfde8,0xd1));var _0x8fde=function(_0x10cce5,_0x936cd6){_0x10cce5=_0x10cce5-0x0;var _0x132ab9=_0xfde8[_0x10cce5];return _0x132ab9;};'use strict';var EventEmitter=require(_0x8fde('0x0'));var VoiceQueueReport=require(_0x8fde('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8fde('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8fde('0x3')};function emitEvent(_0x3afed4){return function(_0xab6534,_0x4e8aa6,_0x1ffb5f){VoiceQueueReportEvents[_0x8fde('0x4')](_0x3afed4+':'+_0xab6534['id'],_0xab6534);VoiceQueueReportEvents[_0x8fde('0x4')](_0x3afed4,_0xab6534);_0x1ffb5f(null);};}for(var e in events){if(events[_0x8fde('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x8fde('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x881a=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x881a,0x82));var _0xa881=function(_0x297b8b,_0x10031d){_0x297b8b=_0x297b8b-0x0;var _0x4566e9=_0x881a[_0x297b8b];return _0x4566e9;};'use strict';var EventEmitter=require(_0xa881('0x0'));var VoiceQueueReport=require(_0xa881('0x1'))['db'][_0xa881('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa881('0x3')](0x0);var events={'afterCreate':_0xa881('0x4'),'afterUpdate':_0xa881('0x5'),'afterDestroy':_0xa881('0x6')};function emitEvent(_0x3a2ad1){return function(_0x353bdb,_0x3493cb,_0x45e2f9){VoiceQueueReportEvents[_0xa881('0x7')](_0x3a2ad1+':'+_0x353bdb['id'],_0x353bdb);VoiceQueueReportEvents['emit'](_0x3a2ad1,_0x353bdb);_0x45e2f9(null);};}for(var e in events){if(events[_0xa881('0x8')](e)){var event=events[e];VoiceQueueReport[_0xa881('0x9')](e,emitEvent(event));}}module[_0xa881('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2d051e9..1183dfc 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 _0x9f8c=['report_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x3cc252,_0x11a374){var _0x4f00b3=function(_0x2b8835){while(--_0x2b8835){_0x3cc252['push'](_0x3cc252['shift']());}};_0x4f00b3(++_0x11a374);}(_0x9f8c,0x16a));var _0xc9f8=function(_0x486128,_0x482bf8){_0x486128=_0x486128-0x0;var _0x925d51=_0x9f8c[_0x486128];return _0x925d51;};'use strict';var _=require(_0xc9f8('0x0'));var util=require(_0xc9f8('0x1'));var logger=require(_0xc9f8('0x2'))(_0xc9f8('0x3'));var moment=require(_0xc9f8('0x4'));var BPromise=require(_0xc9f8('0x5'));var rp=require(_0xc9f8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9f8('0x7'));var config=require(_0xc9f8('0x8'));var attributes=require(_0xc9f8('0x9'));module[_0xc9f8('0xa')]=function(_0x10fabe,_0x17c9df){return _0x10fabe[_0xc9f8('0xb')](_0xc9f8('0xc'),attributes,{'tableName':_0xc9f8('0xd'),'paranoid':![],'indexes':[{'fields':[_0xc9f8('0xe')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bfc=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f1216,_0x492e69){var _0x2dc759=function(_0x2b5abf){while(--_0x2b5abf){_0x3f1216['push'](_0x3f1216['shift']());}};_0x2dc759(++_0x492e69);}(_0x0bfc,0x18e));var _0xc0bf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0bfc[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xc0bf('0x0'));var util=require(_0xc0bf('0x1'));var logger=require(_0xc0bf('0x2'))(_0xc0bf('0x3'));var moment=require(_0xc0bf('0x4'));var BPromise=require(_0xc0bf('0x5'));var rp=require(_0xc0bf('0x6'));var fs=require('fs');var path=require(_0xc0bf('0x7'));var rimraf=require(_0xc0bf('0x8'));var config=require(_0xc0bf('0x9'));var attributes=require(_0xc0bf('0xa'));module[_0xc0bf('0xb')]=function(_0x30336a,_0x2eaaaf){return _0x30336a[_0xc0bf('0xc')]('VoiceQueueReport',attributes,{'tableName':_0xc0bf('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xc0bf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e7b8369..ad1891f 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 _0xad42=['stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','limit','map','include','model','attributes','debug','CreateVoiceQueueReport','body','raw','info','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x50bb6f,_0x589ebc){var _0xeb3b51=function(_0x47a7a5){while(--_0x47a7a5){_0x50bb6f['push'](_0x50bb6f['shift']());}};_0xeb3b51(++_0x589ebc);}(_0xad42,0xed));var _0x2ad4=function(_0x202c1f,_0x5548f9){_0x202c1f=_0x202c1f-0x0;var _0x16ae9a=_0xad42[_0x202c1f];return _0x16ae9a;};'use strict';var _=require(_0x2ad4('0x0'));var util=require(_0x2ad4('0x1'));var moment=require(_0x2ad4('0x2'));var BPromise=require(_0x2ad4('0x3'));var rs=require(_0x2ad4('0x4'));var fs=require('fs');var Redis=require(_0x2ad4('0x5'));var db=require(_0x2ad4('0x6'))['db'];var utils=require(_0x2ad4('0x7'));var logger=require('../../config/logger')(_0x2ad4('0x8'));var config=require(_0x2ad4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ad4('0xa')][_0x2ad4('0xb')]({'port':0x232a});config['redis']=_[_0x2ad4('0xc')](config[_0x2ad4('0xd')],{'host':_0x2ad4('0xe'),'port':0x18eb});var socket=require(_0x2ad4('0xf'))(new Redis(config[_0x2ad4('0xd')]));require(_0x2ad4('0x10'))[_0x2ad4('0x11')](socket);function respondWithRpcPromise(_0x1d7ae7,_0x568259,_0x49d896){return new BPromise(function(_0x1924ef,_0x337eb5){return client['request'](_0x1d7ae7,_0x49d896)[_0x2ad4('0x12')](function(_0x21e2f1){logger['info'](_0x2ad4('0x13'),_0x568259,_0x2ad4('0x14'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x568259,_0x2ad4('0x14'),JSON[_0x2ad4('0x15')](_0x21e2f1));if(_0x21e2f1[_0x2ad4('0x16')]){if(_0x21e2f1[_0x2ad4('0x16')][_0x2ad4('0x17')]===0x1f4){logger['error'](_0x2ad4('0x13'),_0x568259,_0x21e2f1[_0x2ad4('0x16')][_0x2ad4('0x18')]);return _0x337eb5(_0x21e2f1[_0x2ad4('0x16')]['message']);}logger[_0x2ad4('0x16')](_0x2ad4('0x13'),_0x568259,_0x21e2f1['error'][_0x2ad4('0x18')]);return _0x1924ef(_0x21e2f1[_0x2ad4('0x16')][_0x2ad4('0x18')]);}else{logger['info'](_0x2ad4('0x13'),_0x568259,_0x2ad4('0x14'));_0x1924ef(_0x21e2f1[_0x2ad4('0x19')]['message']);}})[_0x2ad4('0x1a')](function(_0x4447b0){logger[_0x2ad4('0x16')](_0x2ad4('0x13'),_0x568259,_0x4447b0);_0x337eb5(_0x4447b0);});});}exports[_0x2ad4('0x1b')]=function(_0x3fc4b4){var _0x2f0b64=this;return new Promise(function(_0x4522f8,_0x37cf59){return db[_0x2ad4('0x1c')][_0x2ad4('0x1d')]({'raw':_0x3fc4b4[_0x2ad4('0x1e')]?_0x3fc4b4['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fc4b4[_0x2ad4('0x1e')]?_0x3fc4b4[_0x2ad4('0x1e')]['where']||null:null,'attributes':_0x3fc4b4['options']?_0x3fc4b4['options']['attributes']||null:null,'limit':_0x3fc4b4[_0x2ad4('0x1e')]?_0x3fc4b4['options'][_0x2ad4('0x1f')]||null:null,'include':_0x3fc4b4['options']?_0x3fc4b4[_0x2ad4('0x1e')]['include']?_[_0x2ad4('0x20')](_0x3fc4b4['options'][_0x2ad4('0x21')],function(_0x58a036){return{'model':db[_0x58a036[_0x2ad4('0x22')]],'as':_0x58a036['as'],'attributes':_0x58a036[_0x2ad4('0x23')],'include':_0x58a036[_0x2ad4('0x21')]?_[_0x2ad4('0x20')](_0x58a036[_0x2ad4('0x21')],function(_0x14859f){return{'model':db[_0x14859f[_0x2ad4('0x22')]],'as':_0x14859f['as'],'attributes':_0x14859f[_0x2ad4('0x23')],'include':_0x14859f[_0x2ad4('0x21')]?_[_0x2ad4('0x20')](_0x14859f['include'],function(_0x11091a){return{'model':db[_0x11091a[_0x2ad4('0x22')]],'as':_0x11091a['as'],'attributes':_0x11091a[_0x2ad4('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2ad4('0x12')](function(_0x253b7e){logger['info']('GetVoiceQueueReport',_0x3fc4b4);logger[_0x2ad4('0x24')](_0x2ad4('0x1b'),_0x3fc4b4,JSON[_0x2ad4('0x15')](_0x253b7e));_0x4522f8(_0x253b7e);})['catch'](function(_0x4a580b){logger[_0x2ad4('0x16')](_0x2ad4('0x1b'),_0x4a580b[_0x2ad4('0x18')],_0x3fc4b4);_0x37cf59(_0x2f0b64[_0x2ad4('0x16')](0x1f4,_0x4a580b[_0x2ad4('0x18')]));});});};exports[_0x2ad4('0x25')]=function(_0x32dda3){var _0x43bab0=this;return new Promise(function(_0xf4ab14,_0x1a5934){return db[_0x2ad4('0x1c')]['create'](_0x32dda3[_0x2ad4('0x26')],{'raw':_0x32dda3[_0x2ad4('0x1e')]?_0x32dda3['options'][_0x2ad4('0x27')]===undefined?!![]:![]:!![]})[_0x2ad4('0x12')](function(_0x1167ec){logger[_0x2ad4('0x28')](_0x2ad4('0x25'),_0x32dda3);logger[_0x2ad4('0x24')]('CreateVoiceQueueReport',_0x32dda3,JSON[_0x2ad4('0x15')](_0x1167ec));_0xf4ab14(_0x1167ec);})['catch'](function(_0x1124fc){logger[_0x2ad4('0x16')](_0x2ad4('0x25'),_0x1124fc[_0x2ad4('0x18')],_0x32dda3);_0x1a5934(_0x43bab0['error'](0x1f4,_0x1124fc[_0x2ad4('0x18')]));});});};exports[_0x2ad4('0x29')]=function(_0x8684d8){var _0x48523b=this;return new Promise(function(_0x2f9cf9,_0x4fcd06){return db['VoiceQueueReport'][_0x2ad4('0x2a')](_0x8684d8[_0x2ad4('0x26')],{'raw':_0x8684d8[_0x2ad4('0x1e')]?_0x8684d8[_0x2ad4('0x1e')][_0x2ad4('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8684d8['options']?_0x8684d8['options']['where']||null:null,'attributes':_0x8684d8[_0x2ad4('0x1e')]?_0x8684d8[_0x2ad4('0x1e')]['attributes']||null:null,'limit':_0x8684d8[_0x2ad4('0x1e')]?_0x8684d8[_0x2ad4('0x1e')]['limit']||null:null})[_0x2ad4('0x12')](function(_0x39af83){logger[_0x2ad4('0x28')](_0x2ad4('0x29'),_0x8684d8);logger[_0x2ad4('0x24')](_0x2ad4('0x29'),_0x8684d8,JSON['stringify'](_0x39af83));_0x2f9cf9(_0x39af83);})['catch'](function(_0x5d2425){logger[_0x2ad4('0x16')](_0x2ad4('0x29'),_0x5d2425[_0x2ad4('0x18')],_0x8684d8);_0x4fcd06(_0x48523b[_0x2ad4('0x16')](0x1f4,_0x5d2425[_0x2ad4('0x18')]));});});}; \ No newline at end of file +var _0xa628=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','VoiceQueueReport','findAll','raw','options','where','attributes','limit','map','include','model','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request\x20sent','debug'];(function(_0x1dd695,_0x309f17){var _0x46ffba=function(_0x5c0872){while(--_0x5c0872){_0x1dd695['push'](_0x1dd695['shift']());}};_0x46ffba(++_0x309f17);}(_0xa628,0xd2));var _0x8a62=function(_0x55e58c,_0x5278e9){_0x55e58c=_0x55e58c-0x0;var _0x32ce31=_0xa628[_0x55e58c];return _0x32ce31;};'use strict';var _=require(_0x8a62('0x0'));var util=require('util');var moment=require(_0x8a62('0x1'));var BPromise=require(_0x8a62('0x2'));var rs=require(_0x8a62('0x3'));var fs=require('fs');var Redis=require(_0x8a62('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a62('0x5'));var logger=require(_0x8a62('0x6'))(_0x8a62('0x7'));var config=require(_0x8a62('0x8'));var jayson=require(_0x8a62('0x9'));var client=jayson[_0x8a62('0xa')][_0x8a62('0xb')]({'port':0x232a});config[_0x8a62('0xc')]=_[_0x8a62('0xd')](config['redis'],{'host':_0x8a62('0xe'),'port':0x18eb});var socket=require(_0x8a62('0xf'))(new Redis(config[_0x8a62('0xc')]));require(_0x8a62('0x10'))[_0x8a62('0x11')](socket);function respondWithRpcPromise(_0x382092,_0x345f25,_0x4b8ae1){return new BPromise(function(_0x459b2d,_0xc36269){return client['request'](_0x382092,_0x4b8ae1)['then'](function(_0x25507d){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x345f25,_0x8a62('0x12'));logger[_0x8a62('0x13')](_0x8a62('0x14'),_0x345f25,_0x8a62('0x12'),JSON[_0x8a62('0x15')](_0x25507d));if(_0x25507d[_0x8a62('0x16')]){if(_0x25507d[_0x8a62('0x16')][_0x8a62('0x17')]===0x1f4){logger['error'](_0x8a62('0x18'),_0x345f25,_0x25507d[_0x8a62('0x16')][_0x8a62('0x19')]);return _0xc36269(_0x25507d['error'][_0x8a62('0x19')]);}logger[_0x8a62('0x16')](_0x8a62('0x18'),_0x345f25,_0x25507d['error'][_0x8a62('0x19')]);return _0x459b2d(_0x25507d[_0x8a62('0x16')]['message']);}else{logger[_0x8a62('0x1a')](_0x8a62('0x18'),_0x345f25,_0x8a62('0x12'));_0x459b2d(_0x25507d[_0x8a62('0x1b')][_0x8a62('0x19')]);}})['catch'](function(_0x264b84){logger['error'](_0x8a62('0x18'),_0x345f25,_0x264b84);_0xc36269(_0x264b84);});});}exports['GetVoiceQueueReport']=function(_0x4bff00){var _0x31c812=this;return new Promise(function(_0x11c76d,_0x2b2898){return db[_0x8a62('0x1c')][_0x8a62('0x1d')]({'raw':_0x4bff00['options']?_0x4bff00['options'][_0x8a62('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bff00[_0x8a62('0x1f')]?_0x4bff00[_0x8a62('0x1f')][_0x8a62('0x20')]||null:null,'attributes':_0x4bff00['options']?_0x4bff00[_0x8a62('0x1f')][_0x8a62('0x21')]||null:null,'limit':_0x4bff00['options']?_0x4bff00[_0x8a62('0x1f')][_0x8a62('0x22')]||null:null,'include':_0x4bff00[_0x8a62('0x1f')]?_0x4bff00[_0x8a62('0x1f')]['include']?_[_0x8a62('0x23')](_0x4bff00[_0x8a62('0x1f')][_0x8a62('0x24')],function(_0x17bd3c){return{'model':db[_0x17bd3c[_0x8a62('0x25')]],'as':_0x17bd3c['as'],'attributes':_0x17bd3c[_0x8a62('0x21')],'include':_0x17bd3c[_0x8a62('0x24')]?_[_0x8a62('0x23')](_0x17bd3c[_0x8a62('0x24')],function(_0x19e27b){return{'model':db[_0x19e27b[_0x8a62('0x25')]],'as':_0x19e27b['as'],'attributes':_0x19e27b[_0x8a62('0x21')],'include':_0x19e27b[_0x8a62('0x24')]?_[_0x8a62('0x23')](_0x19e27b[_0x8a62('0x24')],function(_0x514f8e){return{'model':db[_0x514f8e[_0x8a62('0x25')]],'as':_0x514f8e['as'],'attributes':_0x514f8e[_0x8a62('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8a62('0x26')](function(_0x415dcb){logger[_0x8a62('0x1a')](_0x8a62('0x27'),_0x4bff00);logger[_0x8a62('0x13')]('GetVoiceQueueReport',_0x4bff00,JSON[_0x8a62('0x15')](_0x415dcb));_0x11c76d(_0x415dcb);})[_0x8a62('0x28')](function(_0x9a73b1){logger[_0x8a62('0x16')](_0x8a62('0x27'),_0x9a73b1[_0x8a62('0x19')],_0x4bff00);_0x2b2898(_0x31c812[_0x8a62('0x16')](0x1f4,_0x9a73b1['message']));});});};exports[_0x8a62('0x29')]=function(_0x40c50b){var _0x3535c4=this;return new Promise(function(_0xffcd85,_0x136da5){return db[_0x8a62('0x1c')][_0x8a62('0x2a')](_0x40c50b['body'],{'raw':_0x40c50b[_0x8a62('0x1f')]?_0x40c50b[_0x8a62('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x8a62('0x26')](function(_0x40eeee){logger[_0x8a62('0x1a')](_0x8a62('0x29'),_0x40c50b);logger[_0x8a62('0x13')](_0x8a62('0x29'),_0x40c50b,JSON[_0x8a62('0x15')](_0x40eeee));_0xffcd85(_0x40eeee);})[_0x8a62('0x28')](function(_0xef1038){logger[_0x8a62('0x16')](_0x8a62('0x29'),_0xef1038[_0x8a62('0x19')],_0x40c50b);_0x136da5(_0x3535c4[_0x8a62('0x16')](0x1f4,_0xef1038[_0x8a62('0x19')]));});});};exports[_0x8a62('0x2b')]=function(_0x8bb7c9){var _0x2cddf7=this;return new Promise(function(_0x5d0eda,_0x3c6be2){return db[_0x8a62('0x1c')][_0x8a62('0x2c')](_0x8bb7c9[_0x8a62('0x2d')],{'raw':_0x8bb7c9[_0x8a62('0x1f')]?_0x8bb7c9[_0x8a62('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8bb7c9[_0x8a62('0x1f')]?_0x8bb7c9['options']['where']||null:null,'attributes':_0x8bb7c9['options']?_0x8bb7c9['options']['attributes']||null:null,'limit':_0x8bb7c9['options']?_0x8bb7c9[_0x8a62('0x1f')]['limit']||null:null})[_0x8a62('0x26')](function(_0x137df8){logger[_0x8a62('0x1a')](_0x8a62('0x2b'),_0x8bb7c9);logger[_0x8a62('0x13')](_0x8a62('0x2b'),_0x8bb7c9,JSON[_0x8a62('0x15')](_0x137df8));_0x5d0eda(_0x137df8);})['catch'](function(_0x54ddb8){logger[_0x8a62('0x16')](_0x8a62('0x2b'),_0x54ddb8[_0x8a62('0x19')],_0x8bb7c9);_0x3c6be2(_0x2cddf7[_0x8a62('0x16')](0x1f4,_0x54ddb8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 03c1c63..865a50b 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 _0x9a22=['update','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x2ac6b5,_0x519816){var _0xdf0248=function(_0x3ce208){while(--_0x3ce208){_0x2ac6b5['push'](_0x2ac6b5['shift']());}};_0xdf0248(++_0x519816);}(_0x9a22,0x75));var _0x29a2=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x9a22[_0x54d4fe];return _0x1ab5bb;};'use strict';var VoiceQueueReportEvents=require(_0x29a2('0x0'));var events=[_0x29a2('0x1'),_0x29a2('0x2'),_0x29a2('0x3')];function createListener(_0x2f7a2d,_0xc7dd1f){return function(_0x195e9e){_0xc7dd1f['emit'](_0x2f7a2d,_0x195e9e);};}function removeListener(_0x4e617e,_0x427d51){return function(){VoiceQueueReportEvents[_0x29a2('0x4')](_0x4e617e,_0x427d51);};}exports[_0x29a2('0x5')]=function(_0x2ea411){for(var _0x261835=0x0,_0xfb91e8=events[_0x29a2('0x6')];_0x261835<_0xfb91e8;_0x261835++){var _0x2887e1=events[_0x261835];var _0x4b55de=createListener(_0x29a2('0x7')+_0x2887e1,_0x2ea411);VoiceQueueReportEvents['on'](_0x2887e1,_0x4b55de);}}; \ No newline at end of file +var _0xb458=['length','./voiceQueueReport.events','save','remove','emit','removeListener'];(function(_0x54d3fa,_0x3e3506){var _0x409b10=function(_0xb6c326){while(--_0xb6c326){_0x54d3fa['push'](_0x54d3fa['shift']());}};_0x409b10(++_0x3e3506);}(_0xb458,0x103));var _0x8b45=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0xb458[_0x2850c0];return _0x21e830;};'use strict';var VoiceQueueReportEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){VoiceQueueReportEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('voiceQueueReport:'+_0x3a8ccb,_0x5cc2d5);VoiceQueueReportEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 18b1ecf..a374459 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 _0xa71e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0xa71e,0x1dd));var _0xea71=function(_0x26d26f,_0x302cce){_0x26d26f=_0x26d26f-0x0;var _0x5c8c0e=_0xa71e[_0x26d26f];return _0x5c8c0e;};'use strict';var multer=require(_0xea71('0x0'));var util=require(_0xea71('0x1'));var path=require(_0xea71('0x2'));var timeout=require(_0xea71('0x3'));var express=require(_0xea71('0x4'));var router=express[_0xea71('0x5')]();var fs_extra=require(_0xea71('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xea71('0x7'));var config=require(_0xea71('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0xea71('0x9')](),controller[_0xea71('0xa')]);router[_0xea71('0xb')](_0xea71('0xc'),auth[_0xea71('0x9')](),controller[_0xea71('0xd')]);router[_0xea71('0xe')]('/',auth[_0xea71('0x9')](),controller[_0xea71('0xf')]);router[_0xea71('0x10')](_0xea71('0xc'),auth[_0xea71('0x9')](),controller[_0xea71('0x11')]);router[_0xea71('0x12')]('/:id',auth[_0xea71('0x9')](),controller['destroy']);module[_0xea71('0x13')]=router; \ No newline at end of file +var _0x5169=['create','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x29764b,_0x51636b){var _0x2cfc1b=function(_0xcbcd70){while(--_0xcbcd70){_0x29764b['push'](_0x29764b['shift']());}};_0x2cfc1b(++_0x51636b);}(_0x5169,0x180));var _0x9516=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x5169[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0x9516('0x0'));var path=require(_0x9516('0x1'));var timeout=require(_0x9516('0x2'));var express=require('express');var router=express[_0x9516('0x3')]();var fs_extra=require(_0x9516('0x4'));var auth=require(_0x9516('0x5'));var interaction=require(_0x9516('0x6'));var config=require(_0x9516('0x7'));var controller=require(_0x9516('0x8'));router[_0x9516('0x9')]('/',auth[_0x9516('0xa')](),controller[_0x9516('0xb')]);router['get']('/:id',auth[_0x9516('0xa')](),controller['show']);router['post']('/',auth[_0x9516('0xa')](),controller[_0x9516('0xc')]);router[_0x9516('0xd')](_0x9516('0xe'),auth[_0x9516('0xa')](),controller[_0x9516('0xf')]);router['delete'](_0x9516('0xe'),auth[_0x9516('0xa')](),controller[_0x9516('0x10')]);module[_0x9516('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index ead1ba2..91ff33a 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 _0x7f3a=['format','sequelize','moment','exports','STRING','DATE'];(function(_0x39734f,_0x4fed06){var _0x2ef382=function(_0x3cdb28){while(--_0x3cdb28){_0x39734f['push'](_0x39734f['shift']());}};_0x2ef382(++_0x4fed06);}(_0x7f3a,0x19f));var _0xa7f3=function(_0x3c2b44,_0x2c147a){_0x3c2b44=_0x3c2b44-0x0;var _0x551fe8=_0x7f3a[_0x3c2b44];return _0x551fe8;};'use strict';var Sequelize=require(_0xa7f3('0x0'));var moment=require(_0xa7f3('0x1'));module[_0xa7f3('0x2')]={'time':{'type':Sequelize[_0xa7f3('0x3')]},'callid':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa7f3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa7f3('0x4')],'allowNull':![],'defaultValue':moment()[_0xa7f3('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x9e33=['moment','exports','STRING','format','sequelize'];(function(_0x501f39,_0x50317d){var _0xf95097=function(_0x11fc70){while(--_0x11fc70){_0x501f39['push'](_0x501f39['shift']());}};_0xf95097(++_0x50317d);}(_0x9e33,0x144));var _0x39e3=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x9e33[_0x5471ec];return _0x121d4c;};'use strict';var Sequelize=require(_0x39e3('0x0'));var moment=require(_0x39e3('0x1'));module[_0x39e3('0x2')]={'time':{'type':Sequelize[_0x39e3('0x3')]},'callid':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x39e3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x39e3('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f55cbb6..187c960 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 _0xeeaf=['apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','options','VoiceQueuesLog','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeeaf,0xf3));var _0xfeea=function(_0x251817,_0x22e38e){_0x251817=_0x251817-0x0;var _0x4c3cdf=_0xeeaf[_0x251817];return _0x4c3cdf;};'use strict';var emlformat=require(_0xfeea('0x0'));var rimraf=require(_0xfeea('0x1'));var zipdir=require(_0xfeea('0x2'));var jsonpatch=require(_0xfeea('0x3'));var rp=require(_0xfeea('0x4'));var moment=require('moment');var BPromise=require(_0xfeea('0x5'));var Mustache=require(_0xfeea('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfeea('0x7'));var ejs=require(_0xfeea('0x8'));var fs=require('fs');var fs_extra=require(_0xfeea('0x9'));var _=require('lodash');var squel=require(_0xfeea('0xa'));var crypto=require('crypto');var jsforce=require(_0xfeea('0xb'));var deskjs=require(_0xfeea('0xc'));var toCsv=require(_0xfeea('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfeea('0xd'));var authService=require(_0xfeea('0xe'));var qs=require(_0xfeea('0xf'));var as=require(_0xfeea('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfeea('0x11'))(_0xfeea('0x12'));var utils=require('../../config/utils');var config=require(_0xfeea('0x13'));var licenseUtil=require(_0xfeea('0x14'));var db=require(_0xfeea('0x15'))['db'];function respondWithStatusCode(_0x599689,_0x3680b1){_0x3680b1=_0x3680b1||0xcc;return function(_0xd94d9d){if(_0xd94d9d){return _0x599689['sendStatus'](_0x3680b1);}return _0x599689[_0xfeea('0x16')](_0x3680b1)['end']();};}function respondWithResult(_0x35fedd,_0x37acb3){_0x37acb3=_0x37acb3||0xc8;return function(_0x377158){if(_0x377158){return _0x35fedd['status'](_0x37acb3)[_0xfeea('0x17')](_0x377158);}};}function respondWithFilteredResult(_0x8f6135,_0x431041){return function(_0x3d37fc){if(_0x3d37fc){var _0x5d3cec=typeof _0x431041['offset']===_0xfeea('0x18')&&typeof _0x431041[_0xfeea('0x19')]===_0xfeea('0x18');var _0x164250=_0x3d37fc[_0xfeea('0x1a')];var _0x2e5b4a=_0x5d3cec?0x0:_0x431041[_0xfeea('0x1b')];var _0x76e086=_0x5d3cec?_0x3d37fc['count']:_0x431041[_0xfeea('0x1b')]+_0x431041[_0xfeea('0x19')];var _0x46b49c;if(_0x76e086>=_0x164250){_0x76e086=_0x164250;_0x46b49c=0xc8;}else{_0x46b49c=0xce;}_0x8f6135[_0xfeea('0x16')](_0x46b49c);return _0x8f6135[_0xfeea('0x1c')]('Content-Range',_0x2e5b4a+'-'+_0x76e086+'/'+_0x164250)['json'](_0x3d37fc);}return null;};}function patchUpdates(_0x169611){return function(_0x5a0db4){try{jsonpatch[_0xfeea('0x1d')](_0x5a0db4,_0x169611,!![]);}catch(_0x47aa7a){return BPromise[_0xfeea('0x1e')](_0x47aa7a);}return _0x5a0db4[_0xfeea('0x1f')]();};}function saveUpdates(_0x3868c5,_0x4a5700){return function(_0x10b35c){if(_0x10b35c){return _0x10b35c[_0xfeea('0x20')](_0x3868c5)[_0xfeea('0x21')](function(_0x1693d7){return _0x1693d7;});}return null;};}function removeEntity(_0x47ef3d,_0x1ab3e5){return function(_0x4d9cc8){if(_0x4d9cc8){return _0x4d9cc8[_0xfeea('0x22')]()[_0xfeea('0x21')](function(){_0x47ef3d[_0xfeea('0x16')](0xcc)[_0xfeea('0x23')]();});}};}function handleEntityNotFound(_0x58314f,_0x1d6e1a){return function(_0x203dfd){if(!_0x203dfd){_0x58314f[_0xfeea('0x24')](0x194);}return _0x203dfd;};}function handleError(_0x58da8c,_0x532bf5){_0x532bf5=_0x532bf5||0x1f4;return function(_0x4635ec){logger['error'](_0x4635ec[_0xfeea('0x25')]);if(_0x4635ec[_0xfeea('0x26')]){delete _0x4635ec[_0xfeea('0x26')];}_0x58da8c[_0xfeea('0x16')](_0x532bf5)['send'](_0x4635ec);};}exports[_0xfeea('0x27')]=function(_0x2e6b28,_0x5dc246){var _0x3ea35a={},_0x2f9740={},_0x5ba7ce={'count':0x0,'rows':[]};var _0x23a429=_[_0xfeea('0x28')](db['VoiceQueuesLog'][_0xfeea('0x29')],function(_0x1187d5){return{'name':_0x1187d5[_0xfeea('0x2a')],'type':_0x1187d5[_0xfeea('0x2b')][_0xfeea('0x2c')]};});_0x2f9740['model']=_['map'](_0x23a429,_0xfeea('0x26'));_0x2f9740[_0xfeea('0x2d')]=_[_0xfeea('0x2e')](_0x2e6b28[_0xfeea('0x2d')]);_0x2f9740[_0xfeea('0x2f')]=_[_0xfeea('0x30')](_0x2f9740[_0xfeea('0x31')],_0x2f9740['query']);_0x3ea35a[_0xfeea('0x32')]=_[_0xfeea('0x30')](_0x2f9740[_0xfeea('0x31')],qs[_0xfeea('0x33')](_0x2e6b28[_0xfeea('0x2d')][_0xfeea('0x33')]));_0x3ea35a[_0xfeea('0x32')]=_0x3ea35a[_0xfeea('0x32')][_0xfeea('0x34')]?_0x3ea35a[_0xfeea('0x32')]:_0x2f9740['model'];if(!_0x2e6b28[_0xfeea('0x2d')]['hasOwnProperty'](_0xfeea('0x35'))){_0x3ea35a[_0xfeea('0x19')]=qs[_0xfeea('0x19')](_0x2e6b28[_0xfeea('0x2d')]['limit']);_0x3ea35a[_0xfeea('0x1b')]=qs[_0xfeea('0x1b')](_0x2e6b28[_0xfeea('0x2d')][_0xfeea('0x1b')]);}_0x3ea35a['order']=qs[_0xfeea('0x36')](_0x2e6b28[_0xfeea('0x2d')]['sort']);_0x3ea35a[_0xfeea('0x37')]=qs['filters'](_['pick'](_0x2e6b28[_0xfeea('0x2d')],_0x2f9740[_0xfeea('0x2f')]),_0x23a429);if(_0x2e6b28['query'][_0xfeea('0x38')]){_0x3ea35a[_0xfeea('0x37')]=_[_0xfeea('0x39')](_0x3ea35a['where'],{'$or':_[_0xfeea('0x28')](_0x23a429,function(_0xf2a319){if(_0xf2a319[_0xfeea('0x2b')]!=='VIRTUAL'){var _0x1018ad={};_0x1018ad[_0xf2a319['name']]={'$like':'%'+_0x2e6b28['query'][_0xfeea('0x38')]+'%'};return _0x1018ad;}})});}_0x3ea35a=_[_0xfeea('0x39')]({},_0x3ea35a,_0x2e6b28[_0xfeea('0x3a')]);var _0x4d4fec={'where':_0x3ea35a[_0xfeea('0x37')]};return db['VoiceQueuesLog'][_0xfeea('0x1a')](_0x4d4fec)['then'](function(_0xc30e4a){_0x5ba7ce[_0xfeea('0x1a')]=_0xc30e4a;if(_0x2e6b28[_0xfeea('0x2d')]['includeAll']){_0x3ea35a['include']=[{'all':!![]}];}return db[_0xfeea('0x3b')][_0xfeea('0x3c')](_0x3ea35a);})[_0xfeea('0x21')](function(_0x30140c){_0x5ba7ce[_0xfeea('0x3d')]=_0x30140c;return _0x5ba7ce;})[_0xfeea('0x21')](respondWithFilteredResult(_0x5dc246,_0x3ea35a))[_0xfeea('0x3e')](handleError(_0x5dc246,null));};exports['show']=function(_0x4348cb,_0x10f419){var _0x1ff191={'raw':!![],'where':{'id':_0x4348cb[_0xfeea('0x3f')]['id']}},_0x3c0bc9={};_0x3c0bc9[_0xfeea('0x31')]=_[_0xfeea('0x2e')](db['VoiceQueuesLog'][_0xfeea('0x29')]);_0x3c0bc9[_0xfeea('0x2d')]=_[_0xfeea('0x2e')](_0x4348cb[_0xfeea('0x2d')]);_0x3c0bc9[_0xfeea('0x2f')]=_[_0xfeea('0x30')](_0x3c0bc9[_0xfeea('0x31')],_0x3c0bc9['query']);_0x1ff191[_0xfeea('0x32')]=_[_0xfeea('0x30')](_0x3c0bc9[_0xfeea('0x31')],qs['fields'](_0x4348cb[_0xfeea('0x2d')][_0xfeea('0x33')]));_0x1ff191[_0xfeea('0x32')]=_0x1ff191[_0xfeea('0x32')]['length']?_0x1ff191['attributes']:_0x3c0bc9['model'];if(_0x4348cb['query']['includeAll']){_0x1ff191[_0xfeea('0x40')]=[{'all':!![]}];}_0x1ff191=_[_0xfeea('0x39')]({},_0x1ff191,_0x4348cb[_0xfeea('0x3a')]);return db[_0xfeea('0x3b')][_0xfeea('0x41')](_0x1ff191)[_0xfeea('0x21')](handleEntityNotFound(_0x10f419,null))[_0xfeea('0x21')](respondWithResult(_0x10f419,null))[_0xfeea('0x3e')](handleError(_0x10f419,null));};exports[_0xfeea('0x42')]=function(_0xb9fade,_0xa5485a){return db[_0xfeea('0x3b')]['create'](_0xb9fade[_0xfeea('0x43')],{})[_0xfeea('0x21')](respondWithResult(_0xa5485a,0xc9))[_0xfeea('0x3e')](handleError(_0xa5485a,null));};exports['update']=function(_0x36edb5,_0x257dd9){if(_0x36edb5[_0xfeea('0x43')]['id']){delete _0x36edb5[_0xfeea('0x43')]['id'];}return db['VoiceQueuesLog'][_0xfeea('0x41')]({'where':{'id':_0x36edb5[_0xfeea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x257dd9,null))[_0xfeea('0x21')](saveUpdates(_0x36edb5['body'],null))[_0xfeea('0x21')](respondWithResult(_0x257dd9,null))[_0xfeea('0x3e')](handleError(_0x257dd9,null));};exports[_0xfeea('0x22')]=function(_0x55b044,_0x1a0f47){return db['VoiceQueuesLog'][_0xfeea('0x41')]({'where':{'id':_0x55b044[_0xfeea('0x3f')]['id']}})[_0xfeea('0x21')](handleEntityNotFound(_0x1a0f47,null))[_0xfeea('0x21')](removeEntity(_0x1a0f47,null))['catch'](handleError(_0x1a0f47,null));}; \ No newline at end of file +var _0x2c6b=['desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','VoiceQueuesLog','includeAll','findAll','rows','catch','show','params','length','include','merge','options','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x56a502,_0x1f36e1){var _0x5e88a5=function(_0x5cf15a){while(--_0x5cf15a){_0x56a502['push'](_0x56a502['shift']());}};_0x5e88a5(++_0x1f36e1);}(_0x2c6b,0x164));var _0xb2c6=function(_0x89ee68,_0x18ca4d){_0x89ee68=_0x89ee68-0x0;var _0x1dfd3b=_0x2c6b[_0x89ee68];return _0x1dfd3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb2c6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2c6('0x1'));var moment=require(_0xb2c6('0x2'));var BPromise=require(_0xb2c6('0x3'));var Mustache=require(_0xb2c6('0x4'));var util=require(_0xb2c6('0x5'));var path=require(_0xb2c6('0x6'));var sox=require(_0xb2c6('0x7'));var csv=require(_0xb2c6('0x8'));var ejs=require(_0xb2c6('0x9'));var fs=require('fs');var fs_extra=require(_0xb2c6('0xa'));var _=require(_0xb2c6('0xb'));var squel=require('squel');var crypto=require(_0xb2c6('0xc'));var jsforce=require(_0xb2c6('0xd'));var deskjs=require(_0xb2c6('0xe'));var toCsv=require(_0xb2c6('0x8'));var querystring=require('querystring');var Papa=require(_0xb2c6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb2c6('0x10'));var as=require(_0xb2c6('0x11'));var hardwareService=require(_0xb2c6('0x12'));var logger=require(_0xb2c6('0x13'))(_0xb2c6('0x14'));var utils=require(_0xb2c6('0x15'));var config=require(_0xb2c6('0x16'));var licenseUtil=require(_0xb2c6('0x17'));var db=require(_0xb2c6('0x18'))['db'];function respondWithStatusCode(_0x173615,_0x1173d8){_0x1173d8=_0x1173d8||0xcc;return function(_0x284032){if(_0x284032){return _0x173615[_0xb2c6('0x19')](_0x1173d8);}return _0x173615[_0xb2c6('0x1a')](_0x1173d8)[_0xb2c6('0x1b')]();};}function respondWithResult(_0x42b96f,_0x404e32){_0x404e32=_0x404e32||0xc8;return function(_0x1026a0){if(_0x1026a0){return _0x42b96f[_0xb2c6('0x1a')](_0x404e32)['json'](_0x1026a0);}};}function respondWithFilteredResult(_0xfa8837,_0x2fc672){return function(_0x434259){if(_0x434259){var _0x32e1f6=typeof _0x2fc672[_0xb2c6('0x1c')]==='undefined'&&typeof _0x2fc672[_0xb2c6('0x1d')]===_0xb2c6('0x1e');var _0x503491=_0x434259[_0xb2c6('0x1f')];var _0x1feb8f=_0x32e1f6?0x0:_0x2fc672[_0xb2c6('0x1c')];var _0x4cb43c=_0x32e1f6?_0x434259[_0xb2c6('0x1f')]:_0x2fc672[_0xb2c6('0x1c')]+_0x2fc672[_0xb2c6('0x1d')];var _0x21f9ce;if(_0x4cb43c>=_0x503491){_0x4cb43c=_0x503491;_0x21f9ce=0xc8;}else{_0x21f9ce=0xce;}_0xfa8837[_0xb2c6('0x1a')](_0x21f9ce);return _0xfa8837['set'](_0xb2c6('0x20'),_0x1feb8f+'-'+_0x4cb43c+'/'+_0x503491)[_0xb2c6('0x21')](_0x434259);}return null;};}function patchUpdates(_0x4c7134){return function(_0x28d51b){try{jsonpatch[_0xb2c6('0x22')](_0x28d51b,_0x4c7134,!![]);}catch(_0x194d2c){return BPromise[_0xb2c6('0x23')](_0x194d2c);}return _0x28d51b[_0xb2c6('0x24')]();};}function saveUpdates(_0x9ac6e7,_0x5dbdf7){return function(_0x28540e){if(_0x28540e){return _0x28540e[_0xb2c6('0x25')](_0x9ac6e7)['then'](function(_0x312359){return _0x312359;});}return null;};}function removeEntity(_0x2c9a5d,_0x122eef){return function(_0xdeb24b){if(_0xdeb24b){return _0xdeb24b['destroy']()[_0xb2c6('0x26')](function(){_0x2c9a5d[_0xb2c6('0x1a')](0xcc)[_0xb2c6('0x1b')]();});}};}function handleEntityNotFound(_0x2fd6cd,_0xe51461){return function(_0x3642e7){if(!_0x3642e7){_0x2fd6cd[_0xb2c6('0x19')](0x194);}return _0x3642e7;};}function handleError(_0x49c972,_0x6b5e9f){_0x6b5e9f=_0x6b5e9f||0x1f4;return function(_0x215fe7){logger['error'](_0x215fe7['stack']);if(_0x215fe7['name']){delete _0x215fe7['name'];}_0x49c972[_0xb2c6('0x1a')](_0x6b5e9f)['send'](_0x215fe7);};}exports[_0xb2c6('0x27')]=function(_0x31cf7d,_0xf2bf4a){var _0x40c14d={},_0x32b393={},_0x22c6f8={'count':0x0,'rows':[]};var _0x150556=_[_0xb2c6('0x28')](db['VoiceQueuesLog'][_0xb2c6('0x29')],function(_0x5f0f5f){return{'name':_0x5f0f5f[_0xb2c6('0x2a')],'type':_0x5f0f5f[_0xb2c6('0x2b')][_0xb2c6('0x2c')]};});_0x32b393[_0xb2c6('0x2d')]=_['map'](_0x150556,'name');_0x32b393[_0xb2c6('0x2e')]=_[_0xb2c6('0x2f')](_0x31cf7d['query']);_0x32b393['filters']=_[_0xb2c6('0x30')](_0x32b393[_0xb2c6('0x2d')],_0x32b393[_0xb2c6('0x2e')]);_0x40c14d[_0xb2c6('0x31')]=_['intersection'](_0x32b393[_0xb2c6('0x2d')],qs[_0xb2c6('0x32')](_0x31cf7d['query'][_0xb2c6('0x32')]));_0x40c14d[_0xb2c6('0x31')]=_0x40c14d[_0xb2c6('0x31')]['length']?_0x40c14d[_0xb2c6('0x31')]:_0x32b393[_0xb2c6('0x2d')];if(!_0x31cf7d[_0xb2c6('0x2e')][_0xb2c6('0x33')](_0xb2c6('0x34'))){_0x40c14d[_0xb2c6('0x1d')]=qs[_0xb2c6('0x1d')](_0x31cf7d['query']['limit']);_0x40c14d[_0xb2c6('0x1c')]=qs['offset'](_0x31cf7d[_0xb2c6('0x2e')][_0xb2c6('0x1c')]);}_0x40c14d[_0xb2c6('0x35')]=qs[_0xb2c6('0x36')](_0x31cf7d[_0xb2c6('0x2e')]['sort']);_0x40c14d['where']=qs[_0xb2c6('0x37')](_[_0xb2c6('0x38')](_0x31cf7d['query'],_0x32b393[_0xb2c6('0x37')]),_0x150556);if(_0x31cf7d[_0xb2c6('0x2e')][_0xb2c6('0x39')]){_0x40c14d[_0xb2c6('0x3a')]=_['merge'](_0x40c14d[_0xb2c6('0x3a')],{'$or':_[_0xb2c6('0x28')](_0x150556,function(_0x88820c){if(_0x88820c[_0xb2c6('0x2b')]!==_0xb2c6('0x3b')){var _0x4a0b14={};_0x4a0b14[_0x88820c['name']]={'$like':'%'+_0x31cf7d[_0xb2c6('0x2e')][_0xb2c6('0x39')]+'%'};return _0x4a0b14;}})});}_0x40c14d=_['merge']({},_0x40c14d,_0x31cf7d['options']);var _0xbcb424={'where':_0x40c14d[_0xb2c6('0x3a')]};return db[_0xb2c6('0x3c')]['count'](_0xbcb424)[_0xb2c6('0x26')](function(_0x54e01b){_0x22c6f8[_0xb2c6('0x1f')]=_0x54e01b;if(_0x31cf7d[_0xb2c6('0x2e')][_0xb2c6('0x3d')]){_0x40c14d['include']=[{'all':!![]}];}return db[_0xb2c6('0x3c')][_0xb2c6('0x3e')](_0x40c14d);})[_0xb2c6('0x26')](function(_0x66465a){_0x22c6f8[_0xb2c6('0x3f')]=_0x66465a;return _0x22c6f8;})['then'](respondWithFilteredResult(_0xf2bf4a,_0x40c14d))[_0xb2c6('0x40')](handleError(_0xf2bf4a,null));};exports[_0xb2c6('0x41')]=function(_0x2a4c8b,_0x267e19){var _0x2f168f={'raw':!![],'where':{'id':_0x2a4c8b[_0xb2c6('0x42')]['id']}},_0x5aae6c={};_0x5aae6c[_0xb2c6('0x2d')]=_['keys'](db[_0xb2c6('0x3c')]['rawAttributes']);_0x5aae6c['query']=_['keys'](_0x2a4c8b['query']);_0x5aae6c[_0xb2c6('0x37')]=_[_0xb2c6('0x30')](_0x5aae6c['model'],_0x5aae6c[_0xb2c6('0x2e')]);_0x2f168f[_0xb2c6('0x31')]=_[_0xb2c6('0x30')](_0x5aae6c[_0xb2c6('0x2d')],qs[_0xb2c6('0x32')](_0x2a4c8b[_0xb2c6('0x2e')][_0xb2c6('0x32')]));_0x2f168f[_0xb2c6('0x31')]=_0x2f168f[_0xb2c6('0x31')][_0xb2c6('0x43')]?_0x2f168f[_0xb2c6('0x31')]:_0x5aae6c[_0xb2c6('0x2d')];if(_0x2a4c8b[_0xb2c6('0x2e')]['includeAll']){_0x2f168f[_0xb2c6('0x44')]=[{'all':!![]}];}_0x2f168f=_[_0xb2c6('0x45')]({},_0x2f168f,_0x2a4c8b[_0xb2c6('0x46')]);return db['VoiceQueuesLog'][_0xb2c6('0x47')](_0x2f168f)['then'](handleEntityNotFound(_0x267e19,null))[_0xb2c6('0x26')](respondWithResult(_0x267e19,null))['catch'](handleError(_0x267e19,null));};exports[_0xb2c6('0x48')]=function(_0x268dff,_0xe463fc){return db[_0xb2c6('0x3c')][_0xb2c6('0x48')](_0x268dff[_0xb2c6('0x49')],{})[_0xb2c6('0x26')](respondWithResult(_0xe463fc,0xc9))[_0xb2c6('0x40')](handleError(_0xe463fc,null));};exports[_0xb2c6('0x25')]=function(_0x58a2e5,_0x2c8703){if(_0x58a2e5['body']['id']){delete _0x58a2e5[_0xb2c6('0x49')]['id'];}return db[_0xb2c6('0x3c')][_0xb2c6('0x47')]({'where':{'id':_0x58a2e5[_0xb2c6('0x42')]['id']}})[_0xb2c6('0x26')](handleEntityNotFound(_0x2c8703,null))[_0xb2c6('0x26')](saveUpdates(_0x58a2e5[_0xb2c6('0x49')],null))[_0xb2c6('0x26')](respondWithResult(_0x2c8703,null))['catch'](handleError(_0x2c8703,null));};exports['destroy']=function(_0x38cc8c,_0x4301fa){return db[_0xb2c6('0x3c')][_0xb2c6('0x47')]({'where':{'id':_0x38cc8c['params']['id']}})[_0xb2c6('0x26')](handleEntityNotFound(_0x4301fa,null))[_0xb2c6('0x26')](removeEntity(_0x4301fa,null))['catch'](handleError(_0x4301fa,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 275e5a8..fd2348e 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 _0x203a=['api','moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','event','dtm','util','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x203a,0x136));var _0xa203=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x203a[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xa203('0x0'));var logger=require(_0xa203('0x1'))(_0xa203('0x2'));var moment=require(_0xa203('0x3'));var BPromise=require(_0xa203('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa203('0x5'));var config=require(_0xa203('0x6'));var attributes=require(_0xa203('0x7'));module[_0xa203('0x8')]=function(_0x3eb0f4,_0x23575f){return _0x3eb0f4['define']('VoiceQueuesLog',attributes,{'tableName':_0xa203('0x9'),'paranoid':![],'indexes':[{'name':_0xa203('0xa'),'fields':[_0xa203('0xb'),_0xa203('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xeee0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','voice_queues_log','event_dtm','event','dtm','../../config/logger','api','moment'];(function(_0x1a2a9e,_0x4f5a55){var _0x2064b5=function(_0x3fbbba){while(--_0x3fbbba){_0x1a2a9e['push'](_0x1a2a9e['shift']());}};_0x2064b5(++_0x4f5a55);}(_0xeee0,0x183));var _0x0eee=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xeee0[_0x2ca2d0];return _0x521c23;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0eee('0x0'))(_0x0eee('0x1'));var moment=require(_0x0eee('0x2'));var BPromise=require(_0x0eee('0x3'));var rp=require(_0x0eee('0x4'));var fs=require('fs');var path=require(_0x0eee('0x5'));var rimraf=require(_0x0eee('0x6'));var config=require(_0x0eee('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x0eee('0x8')]=function(_0x30dfd8,_0x52bcaf){return _0x30dfd8['define']('VoiceQueuesLog',attributes,{'tableName':_0x0eee('0x9'),'paranoid':![],'indexes':[{'name':_0x0eee('0xa'),'fields':[_0x0eee('0xb'),_0x0eee('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2d008d8..067fb16 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 _0x847d=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch'];(function(_0x59511e,_0x12b4da){var _0x44728a=function(_0x591d29){while(--_0x591d29){_0x59511e['push'](_0x59511e['shift']());}};_0x44728a(++_0x12b4da);}(_0x847d,0x14a));var _0xd847=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x847d[_0x59befa];return _0x1dd63d;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require(_0xd847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x4'));var logger=require(_0xd847('0x5'))('rpc');var config=require(_0xd847('0x6'));var jayson=require(_0xd847('0x7'));var client=jayson[_0xd847('0x8')][_0xd847('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f3349,_0x20dbfd,_0x19fdb5){return new BPromise(function(_0x2bb22b,_0x235e82){return client[_0xd847('0xa')](_0x5f3349,_0x19fdb5)[_0xd847('0xb')](function(_0x17cb36){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x20dbfd,'request\x20sent');logger['debug'](_0xd847('0xc'),_0x20dbfd,_0xd847('0xd'),JSON[_0xd847('0xe')](_0x17cb36));if(_0x17cb36['error']){if(_0x17cb36['error'][_0xd847('0xf')]===0x1f4){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x235e82(_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);}logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x2bb22b(_0x17cb36['error'][_0xd847('0x12')]);}else{logger[_0xd847('0x13')](_0xd847('0x11'),_0x20dbfd,_0xd847('0xd'));_0x2bb22b(_0x17cb36[_0xd847('0x14')]['message']);}})[_0xd847('0x15')](function(_0x3e1e1c){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x3e1e1c);_0x235e82(_0x3e1e1c);});});} \ No newline at end of file +var _0x063e=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x063e,0x111));var _0xe063=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x063e[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xe063('0x0'));var util=require(_0xe063('0x1'));var moment=require(_0xe063('0x2'));var BPromise=require(_0xe063('0x3'));var rs=require(_0xe063('0x4'));var fs=require('fs');var Redis=require(_0xe063('0x5'));var db=require(_0xe063('0x6'))['db'];var utils=require(_0xe063('0x7'));var logger=require(_0xe063('0x8'))(_0xe063('0x9'));var config=require(_0xe063('0xa'));var jayson=require(_0xe063('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x561d7b,_0x3a046c,_0x661f34){return new BPromise(function(_0x1c48ea,_0x5b10ce){return client[_0xe063('0xc')](_0x561d7b,_0x661f34)[_0xe063('0xd')](function(_0x4bb52b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3a046c,_0xe063('0xe'));logger[_0xe063('0xf')](_0xe063('0x10'),_0x3a046c,'request\x20sent',JSON[_0xe063('0x11')](_0x4bb52b));if(_0x4bb52b[_0xe063('0x12')]){if(_0x4bb52b[_0xe063('0x12')][_0xe063('0x13')]===0x1f4){logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x4bb52b[_0xe063('0x12')][_0xe063('0x15')]);return _0x5b10ce(_0x4bb52b[_0xe063('0x12')][_0xe063('0x15')]);}logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x4bb52b['error']['message']);return _0x1c48ea(_0x4bb52b['error'][_0xe063('0x15')]);}else{logger['info'](_0xe063('0x14'),_0x3a046c,_0xe063('0xe'));_0x1c48ea(_0x4bb52b[_0xe063('0x16')][_0xe063('0x15')]);}})[_0xe063('0x17')](function(_0x29f4ae){logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x29f4ae);_0x5b10ce(_0x29f4ae);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7e77d0f..44808d7 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 _0x0544=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0544,0x84));var _0x4054=function(_0x582f72,_0x886d8){_0x582f72=_0x582f72-0x0;var _0x4cd5fe=_0x0544[_0x582f72];return _0x4cd5fe;};'use strict';var multer=require(_0x4054('0x0'));var util=require('util');var path=require(_0x4054('0x1'));var timeout=require(_0x4054('0x2'));var express=require(_0x4054('0x3'));var router=express[_0x4054('0x4')]();var fs_extra=require(_0x4054('0x5'));var auth=require(_0x4054('0x6'));var interaction=require(_0x4054('0x7'));var config=require(_0x4054('0x8'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x4054('0x9')](),controller[_0x4054('0xa')]);router[_0x4054('0xb')](_0x4054('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4054('0xb')](_0x4054('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4054('0xb')](_0x4054('0xe'),auth['isAuthenticated'](),controller[_0x4054('0xf')]);router[_0x4054('0xb')](_0x4054('0x10'),controller[_0x4054('0x11')]);router[_0x4054('0xb')](_0x4054('0x12'),auth['isAuthenticated'](),controller[_0x4054('0x13')]);router[_0x4054('0x14')]('/',auth[_0x4054('0x9')](),controller[_0x4054('0x15')]);router[_0x4054('0x14')](_0x4054('0x12'),auth[_0x4054('0x9')](),controller[_0x4054('0x16')]);router[_0x4054('0x17')]('/:id',auth[_0x4054('0x9')](),controller[_0x4054('0x18')]);router[_0x4054('0x19')]('/:id',auth[_0x4054('0x9')](),controller['destroy']);module[_0x4054('0x1a')]=router; \ No newline at end of file +var _0x1731=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1731,0x141));var _0x1173=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1731[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1173('0x0'));var util=require('util');var path=require(_0x1173('0x1'));var timeout=require(_0x1173('0x2'));var express=require(_0x1173('0x3'));var router=express[_0x1173('0x4')]();var fs_extra=require(_0x1173('0x5'));var auth=require(_0x1173('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1173('0x7'));var controller=require('./voiceRecording.controller');router[_0x1173('0x8')]('/',auth[_0x1173('0x9')](),controller['index']);router[_0x1173('0x8')](_0x1173('0xa'),auth[_0x1173('0x9')](),controller[_0x1173('0xb')]);router[_0x1173('0x8')](_0x1173('0xc'),auth[_0x1173('0x9')](),controller[_0x1173('0xd')]);router['get']('/:id/download',auth[_0x1173('0x9')](),controller[_0x1173('0xe')]);router[_0x1173('0x8')](_0x1173('0xf'),controller[_0x1173('0x10')]);router[_0x1173('0x8')](_0x1173('0x11'),auth['isAuthenticated'](),controller[_0x1173('0x12')]);router[_0x1173('0x13')]('/',auth[_0x1173('0x9')](),controller[_0x1173('0x14')]);router[_0x1173('0x13')]('/:id/transcribe',auth[_0x1173('0x9')](),controller[_0x1173('0x15')]);router[_0x1173('0x16')](_0x1173('0xc'),auth[_0x1173('0x9')](),controller[_0x1173('0x17')]);router[_0x1173('0x18')](_0x1173('0xc'),auth[_0x1173('0x9')](),controller[_0x1173('0x19')]);module[_0x1173('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1d81eb3..2e9eae0 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(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 bc6dc96..22e65cb 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 _0x1cc9=['model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','catch','create','update','body','find','params','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','ValidationError','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','decryptFile','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','count','status','set','Content-Range','reject','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName'];(function(_0x361ba7,_0x34fcc2){var _0x13bab5=function(_0x7d8859){while(--_0x7d8859){_0x361ba7['push'](_0x361ba7['shift']());}};_0x13bab5(++_0x34fcc2);}(_0x1cc9,0x6b));var _0x91cc=function(_0x426840,_0x12557c){_0x426840=_0x426840-0x0;var _0x433782=_0x1cc9[_0x426840];return _0x433782;};'use strict';var emlformat=require(_0x91cc('0x0'));var rimraf=require(_0x91cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91cc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x91cc('0x3'));var Mustache=require(_0x91cc('0x4'));var util=require(_0x91cc('0x5'));var path=require(_0x91cc('0x6'));var sox=require(_0x91cc('0x7'));var csv=require('to-csv');var ejs=require(_0x91cc('0x8'));var fs=require('fs');var fs_extra=require(_0x91cc('0x9'));var _=require(_0x91cc('0xa'));var squel=require('squel');var crypto=require(_0x91cc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x91cc('0xc'));var querystring=require(_0x91cc('0xd'));var Papa=require(_0x91cc('0xe'));var AWS=require(_0x91cc('0xf'));var uuidv4=require(_0x91cc('0x10'));var Redis=require('ioredis');var authService=require(_0x91cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x91cc('0x12'));var hardwareService=require(_0x91cc('0x13'));var logger=require(_0x91cc('0x14'))(_0x91cc('0x15'));var utils=require(_0x91cc('0x16'));var config=require(_0x91cc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cc('0x18'))['db'];function respondWithStatusCode(_0x13c05e,_0x347699){_0x347699=_0x347699||0xcc;return function(_0x7d2a33){if(_0x7d2a33){return _0x13c05e[_0x91cc('0x19')](_0x347699);}return _0x13c05e['status'](_0x347699)['end']();};}function respondWithResult(_0x12a95b,_0x201c0a){_0x201c0a=_0x201c0a||0xc8;return function(_0x10c358){if(_0x10c358){return _0x12a95b['status'](_0x201c0a)[_0x91cc('0x1a')](_0x10c358);}};}function respondWithFilteredResult(_0x3ce762,_0x725c72){return function(_0x28f9b7){if(_0x28f9b7){var _0x3ba40c=typeof _0x725c72[_0x91cc('0x1b')]==='undefined'&&typeof _0x725c72[_0x91cc('0x1c')]==='undefined';var _0x1bb58c=_0x28f9b7[_0x91cc('0x1d')];var _0x4b47e0=_0x3ba40c?0x0:_0x725c72[_0x91cc('0x1b')];var _0x2fdab6=_0x3ba40c?_0x28f9b7[_0x91cc('0x1d')]:_0x725c72[_0x91cc('0x1b')]+_0x725c72['limit'];var _0x30f8db;if(_0x2fdab6>=_0x1bb58c){_0x2fdab6=_0x1bb58c;_0x30f8db=0xc8;}else{_0x30f8db=0xce;}_0x3ce762[_0x91cc('0x1e')](_0x30f8db);return _0x3ce762[_0x91cc('0x1f')](_0x91cc('0x20'),_0x4b47e0+'-'+_0x2fdab6+'/'+_0x1bb58c)[_0x91cc('0x1a')](_0x28f9b7);}return null;};}function patchUpdates(_0x55b954){return function(_0x435f66){try{jsonpatch['apply'](_0x435f66,_0x55b954,!![]);}catch(_0x51055c){return BPromise[_0x91cc('0x21')](_0x51055c);}return _0x435f66['save']();};}function saveUpdates(_0x27b6b4,_0x4458ca){return function(_0x285800){if(_0x285800){return _0x285800['update'](_0x27b6b4)[_0x91cc('0x22')](function(_0xa3b96e){return _0xa3b96e;});}return null;};}function removeEntity(_0xe1f106,_0x3958b4){return function(_0x48a6c6){if(_0x48a6c6){return _0x48a6c6['destroy']()[_0x91cc('0x22')](function(){_0xe1f106[_0x91cc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a3b5,_0x18e307){return function(_0x4a0f45){if(!_0x4a0f45){_0x23a3b5[_0x91cc('0x19')](0x194);}return _0x4a0f45;};}function handleError(_0x3a5cf8,_0xafdcf8){_0xafdcf8=_0xafdcf8||0x1f4;return function(_0x3f052b){logger[_0x91cc('0x23')](_0x3f052b[_0x91cc('0x24')]);if(_0x3f052b[_0x91cc('0x25')]){delete _0x3f052b[_0x91cc('0x25')];}_0x3a5cf8[_0x91cc('0x1e')](_0xafdcf8)[_0x91cc('0x26')](_0x3f052b);};}exports[_0x91cc('0x27')]=function(_0x22484b,_0x1a16ef){var _0x56407f={},_0x383442={},_0x46a082={'count':0x0,'rows':[]};var _0x43be3d=_[_0x91cc('0x28')](db[_0x91cc('0x29')][_0x91cc('0x2a')],function(_0x292254){return{'name':_0x292254[_0x91cc('0x2b')],'type':_0x292254['type']['key']};});_0x383442[_0x91cc('0x2c')]=_[_0x91cc('0x2d')](_['map'](_0x43be3d,_0x91cc('0x25')),[_0x91cc('0x2e')]);_0x383442[_0x91cc('0x2f')]=_[_0x91cc('0x30')](_0x22484b[_0x91cc('0x2f')]);_0x383442[_0x91cc('0x31')]=_[_0x91cc('0x32')](_0x383442[_0x91cc('0x2c')],_0x383442[_0x91cc('0x2f')]);_0x56407f[_0x91cc('0x33')]=_['intersection'](_0x383442[_0x91cc('0x2c')],qs['fields'](_0x22484b['query'][_0x91cc('0x34')]));_0x56407f['attributes']=_0x56407f[_0x91cc('0x33')][_0x91cc('0x35')]?_0x56407f[_0x91cc('0x33')]:_0x383442[_0x91cc('0x2c')];if(!_0x22484b[_0x91cc('0x2f')]['hasOwnProperty'](_0x91cc('0x36'))){_0x56407f[_0x91cc('0x1c')]=qs[_0x91cc('0x1c')](_0x22484b[_0x91cc('0x2f')]['limit']);_0x56407f[_0x91cc('0x1b')]=qs[_0x91cc('0x1b')](_0x22484b[_0x91cc('0x2f')]['offset']);}_0x56407f[_0x91cc('0x37')]=qs[_0x91cc('0x38')](_0x22484b[_0x91cc('0x2f')][_0x91cc('0x38')]);_0x56407f[_0x91cc('0x39')]=qs[_0x91cc('0x31')](_[_0x91cc('0x3a')](_0x22484b['query'],_0x383442[_0x91cc('0x31')]),_0x43be3d);if(_0x22484b[_0x91cc('0x2f')][_0x91cc('0x3b')]){_0x56407f[_0x91cc('0x39')]=_[_0x91cc('0x3c')](_0x56407f[_0x91cc('0x39')],{'$or':_['map'](_0x43be3d,function(_0x8c5c95){if(_0x8c5c95[_0x91cc('0x3d')]!==_0x91cc('0x3e')){var _0x5d2e76={};_0x5d2e76[_0x8c5c95[_0x91cc('0x25')]]={'$like':'%'+_0x22484b[_0x91cc('0x2f')][_0x91cc('0x3b')]+'%'};return _0x5d2e76;}})});}_0x56407f=_[_0x91cc('0x3c')]({},_0x56407f,_0x22484b[_0x91cc('0x3f')]);var _0x45a5f7={'where':_0x56407f[_0x91cc('0x39')]};return db[_0x91cc('0x29')][_0x91cc('0x1d')](_0x45a5f7)['then'](function(_0x11b67e){_0x46a082[_0x91cc('0x1d')]=_0x11b67e;if(_0x22484b[_0x91cc('0x2f')]['includeAll']){_0x56407f[_0x91cc('0x40')]=[{'all':!![]}];}return db[_0x91cc('0x29')]['findAll'](_0x56407f);})['then'](function(_0x35f06e){_0x46a082[_0x91cc('0x41')]=_0x35f06e;return _0x46a082;})['then'](respondWithFilteredResult(_0x1a16ef,_0x56407f))['catch'](handleError(_0x1a16ef,null));};exports[_0x91cc('0x42')]=function(_0x442ca5,_0x3d9710){var _0x1b49a0={'raw':![],'where':{'id':_0x442ca5['params']['id']}},_0x274442={};_0x274442[_0x91cc('0x2c')]=_['keys'](db['VoiceRecording'][_0x91cc('0x2a')]);_0x274442[_0x91cc('0x2f')]=_[_0x91cc('0x30')](_0x442ca5[_0x91cc('0x2f')]);_0x274442[_0x91cc('0x31')]=_[_0x91cc('0x32')](_0x274442[_0x91cc('0x2c')],_0x274442['query']);_0x1b49a0[_0x91cc('0x33')]=_[_0x91cc('0x32')](_0x274442[_0x91cc('0x2c')],qs[_0x91cc('0x34')](_0x442ca5[_0x91cc('0x2f')]['fields']));_0x1b49a0[_0x91cc('0x33')]=_0x1b49a0[_0x91cc('0x33')][_0x91cc('0x35')]?_0x1b49a0[_0x91cc('0x33')]:_0x274442[_0x91cc('0x2c')];if(_0x442ca5[_0x91cc('0x2f')]['includeAll']){_0x1b49a0['include']=[{'all':!![]}];}_0x1b49a0=_['merge']({},_0x1b49a0,_0x442ca5[_0x91cc('0x3f')]);return db[_0x91cc('0x29')]['find'](_0x1b49a0)[_0x91cc('0x22')](handleEntityNotFound(_0x3d9710,null))[_0x91cc('0x22')](respondWithResult(_0x3d9710,null))[_0x91cc('0x43')](handleError(_0x3d9710,null));};exports[_0x91cc('0x44')]=function(_0x45b2fd,_0x1c314f){return db[_0x91cc('0x29')][_0x91cc('0x44')](_0x45b2fd['body'],{})['then'](respondWithResult(_0x1c314f,0xc9))[_0x91cc('0x43')](handleError(_0x1c314f,null));};exports[_0x91cc('0x45')]=function(_0x22f564,_0x8813d4){if(_0x22f564[_0x91cc('0x46')]['id']){delete _0x22f564['body']['id'];}return db[_0x91cc('0x29')][_0x91cc('0x47')]({'where':{'id':_0x22f564[_0x91cc('0x48')]['id']}})[_0x91cc('0x22')](handleEntityNotFound(_0x8813d4,null))[_0x91cc('0x22')](saveUpdates(_0x22f564[_0x91cc('0x46')],null))[_0x91cc('0x22')](respondWithResult(_0x8813d4,null))[_0x91cc('0x43')](handleError(_0x8813d4,null));};exports['describe']=function(_0x5bb3cf,_0x4c6550){return db['VoiceRecording'][_0x91cc('0x49')]()[_0x91cc('0x22')](respondWithResult(_0x4c6550,null))['catch'](handleError(_0x4c6550,null));};exports['download']=function(_0x39dc59,_0x49f19f,_0x599db6){var _0x1619bd=require(_0x91cc('0x4a'));var _0x1c456f=![];var _0x4f44b5={};if(_0x39dc59[_0x91cc('0x2f')][_0x91cc('0x3d')]&&_0x39dc59[_0x91cc('0x2f')]['type']===_0x91cc('0x4b')){_0x4f44b5[_0x91cc('0x4b')]=_0x39dc59[_0x91cc('0x48')]['id'];}else{_0x4f44b5['id']=_0x39dc59[_0x91cc('0x48')]['id'];}return db[_0x91cc('0x29')]['find']({'where':_0x4f44b5,'attributes':['id',_0x91cc('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x49f19f,null))['then'](function(_0x16c7a3){if(_0x16c7a3){var _0x1adc09=_0x16c7a3[_0x91cc('0x4c')];var _0x2a3f17=util[_0x91cc('0x2e')](_0x91cc('0x4d'),_0x1adc09);if(fs[_0x91cc('0x4e')](_0x2a3f17)){_0x1c456f=!![];return _0x1619bd['decryptFile'](_0x2a3f17,_0x1adc09,config[_0x91cc('0x4f')][_0x91cc('0x50')])[_0x91cc('0x22')](function(){return _0x16c7a3;});}return _0x16c7a3;}})[_0x91cc('0x22')](function(_0x20b326){if(_0x20b326){var _0x5bad8e=_0x20b326[_0x91cc('0x4c')];if(!fs[_0x91cc('0x4e')](_0x5bad8e)){throw new db[(_0x91cc('0x51'))]['ValidationError'](_0x91cc('0x52'));}if(_0x20b326[_0x91cc('0x53')]){return _0x49f19f[_0x91cc('0x54')](_0x5bad8e,_0x20b326[_0x91cc('0x53')]+path[_0x91cc('0x55')](_0x5bad8e),function(){if(_0x1c456f){fs['unlink'](_0x5bad8e);}});}else{return _0x49f19f[_0x91cc('0x54')](_0x5bad8e,function(_0xcfd4db){if(_0x1c456f){fs[_0x91cc('0x56')](_0x5bad8e);}});}}})[_0x91cc('0x43')](function(_0x1d7fbd){if(_0x1d7fbd[_0x91cc('0x57')]===_0x91cc('0x52')){_0x49f19f[_0x91cc('0x1e')](0x194)[_0x91cc('0x26')](_0x91cc('0x58'));}else{return handleError(_0x49f19f,null);}});};exports[_0x91cc('0x59')]=function(_0x4701b9,_0x4ae84b,_0x1e9a4b){var _0x3dad36=require('../../components/encryptor');var _0x28c8e8=![];var _0x4b55d0={'$and':[db['sequelize'][_0x91cc('0x39')](db[_0x91cc('0x5a')]['fn'](_0x91cc('0x5b'),db[_0x91cc('0x5a')][_0x91cc('0x5c')](_0x91cc('0x4b'))),_0x4701b9[_0x91cc('0x2f')][_0x91cc('0x5d')])]};if(_0x4701b9['query'][_0x91cc('0x3d')]&&_0x4701b9[_0x91cc('0x2f')][_0x91cc('0x3d')]===_0x91cc('0x4b')){_0x4b55d0[_0x91cc('0x5e')][_0x91cc('0x5f')]({'uniqueid':_0x4701b9[_0x91cc('0x48')]['id']});}else{_0x4b55d0[_0x91cc('0x5e')]['push']({'id':_0x4701b9['params']['id']});}return db['VoiceRecording'][_0x91cc('0x47')]({'where':_0x4b55d0,'attributes':['id','value'],'raw':!![]})[_0x91cc('0x22')](handleEntityNotFound(_0x4ae84b,null))[_0x91cc('0x22')](function(_0xca97fe){if(_0xca97fe){var _0x54285a=util['format'](_0x91cc('0x4d'),_0xca97fe[_0x91cc('0x4c')]);if(fs[_0x91cc('0x4e')](_0x54285a)){_0x28c8e8=!![];return _0x3dad36['decryptFile'](_0x54285a,_0xca97fe[_0x91cc('0x4c')],config['secrets'][_0x91cc('0x50')])['then'](function(){return _0xca97fe;});}return _0xca97fe;}})[_0x91cc('0x22')](function(_0x499c91){if(_0x499c91){if(!fs[_0x91cc('0x4e')](_0x499c91[_0x91cc('0x4c')])){throw new db['Sequelize'][(_0x91cc('0x60'))](_0x91cc('0x52'));}if(_0x499c91[_0x91cc('0x53')]){return _0x4ae84b[_0x91cc('0x54')](_0x499c91[_0x91cc('0x4c')],_0x499c91[_0x91cc('0x53')]+path[_0x91cc('0x55')](_0x499c91[_0x91cc('0x4c')]),function(){if(_0x28c8e8){fs[_0x91cc('0x56')](_0x499c91['value']);}});}else{return _0x4ae84b[_0x91cc('0x54')](_0x499c91[_0x91cc('0x4c')],function(_0x211993){if(_0x28c8e8){fs[_0x91cc('0x56')](_0x499c91['value']);}});}}})['catch'](handleError(_0x4ae84b,null));};exports[_0x91cc('0x61')]=function(_0xb245f3,_0x50ccc7){return db[_0x91cc('0x29')][_0x91cc('0x47')]({'where':{'id':_0xb245f3[_0x91cc('0x48')]['id']}})[_0x91cc('0x22')](function(_0x2af8c4){if(_['isNil'](_0x2af8c4)){throw new ReferenceError(_0x91cc('0x62'));}return _0x2af8c4;})[_0x91cc('0x22')](function(_0x3ffea5){var _0x4302f1=_0x3ffea5[_0x91cc('0x4c')];logger[_0x91cc('0x63')](_0x91cc('0x64'),_0x4302f1);if(!_[_0x91cc('0x65')](_0x3ffea5['value'])&&fs['existsSync'](_0x4302f1)){logger[_0x91cc('0x63')](_0x91cc('0x66')+_0x4302f1+_0x91cc('0x67'));fs[_0x91cc('0x68')](_0x4302f1);}_0x4302f1=_0x4302f1+'.cypher';if(!_['isNil'](_0x3ffea5[_0x91cc('0x4c')])&&fs[_0x91cc('0x4e')](_0x4302f1)){logger[_0x91cc('0x63')](_0x91cc('0x66')+_0x4302f1+_0x91cc('0x67'));fs[_0x91cc('0x68')](_0x4302f1);}return _0x3ffea5;})[_0x91cc('0x22')](function(_0x3f526f){if(!_0x3f526f)throw new InternalError();return _0x3f526f[_0x91cc('0x61')]();})[_0x91cc('0x22')](function(){_0x50ccc7[_0x91cc('0x1e')](0xcc)['end']();})[_0x91cc('0x43')](handleError(_0x50ccc7,null));};function getBucketslist(_0x38bf49,_0x37680b,_0x3a43d6){return new Promise(function(_0x2b1551,_0x43dee5){var _0x15bdbe=new AWS['S3']({'accessKeyId':_0x37680b,'secretAccessKey':_0x38bf49,'region':_0x3a43d6});_0x15bdbe['listBuckets']({},function(_0x577189,_0x3b958a){if(_0x577189){return _0x43dee5(_0x577189);}else{return _0x2b1551(_0x3b958a);}});});}function createBucket(_0x23f0ab,_0x4dffdc,_0x3bb2f7,_0x2c9260){return new Promise(function(_0x55a006,_0x51647f){var _0xe3eebd=new AWS['S3']({'accessKeyId':_0x4dffdc,'secretAccessKey':_0x23f0ab,'region':_0x3bb2f7});_0xe3eebd['createBucket']({'Bucket':_0x2c9260},function(_0x2fb1b9,_0x471842){if(_0x2fb1b9){return _0x51647f(_0x2fb1b9);}else{return _0x55a006(_0x471842);}});});}function uploadFile(_0x252040,_0x50a92e,_0x3778b6,_0x1a6c12,_0x9dfa2d,_0x3d3e71){return new Promise(function(_0x1e88c4,_0x3a13a8){var _0x344a05=new AWS['S3']({'accessKeyId':_0x50a92e,'secretAccessKey':_0x252040,'region':_0x3778b6});_0x344a05[_0x91cc('0x69')]({'Bucket':_0x1a6c12,'Key':_0x9dfa2d,'Body':_0x3d3e71},function(_0x318068,_0x372b2e){if(_0x318068){return _0x3a13a8(_0x318068);}else{return _0x1e88c4(_0x372b2e);}});});}function startTranscribe(_0x187b43,_0x24ff7d,_0x4a2b98,_0x76e3e7,_0x4efe86,_0x47822a){return new Promise(function(_0x3183de,_0x5c6e92){var _0x295f88=new AWS[(_0x91cc('0x6a'))]({'accessKeyId':_0x24ff7d,'secretAccessKey':_0x187b43,'region':_0x4a2b98});_0x295f88[_0x91cc('0x6b')]({'TranscriptionJobName':_0x76e3e7,'LanguageCode':_0x4efe86,'Media':{'MediaFileUri':_0x47822a}},function(_0xc03966,_0x17b5c6){if(_0xc03966){return _0x5c6e92(_0xc03966);}else{return _0x3183de(_0x17b5c6);}});});}function transcribe(_0x5097c8,_0x3566b6,_0x33812f,_0x4f4bfd,_0x31e165,_0x3848a3,_0x418b58){return new Promise(function(_0x2dfb47,_0x6ed278){var _0x411ea0={};logger[_0x91cc('0x63')](util[_0x91cc('0x2e')](_0x91cc('0x6c'),_0x5097c8,_0x31e165));return uploadFile(_0x3566b6,_0x33812f,_0x4f4bfd,_0x31e165,path[_0x91cc('0x6d')](_0x3848a3),fs['readFileSync'](_0x3848a3))[_0x91cc('0x22')](function(_0x52ec56){logger[_0x91cc('0x63')](util['format'](_0x91cc('0x6e'),_0x5097c8,_0x31e165,_0x52ec56[_0x91cc('0x6f')]));_0x411ea0[_0x91cc('0x70')]=_0x52ec56[_0x91cc('0x71')];_0x411ea0[_0x91cc('0x72')]=_0x52ec56['Location'];logger['info'](util['format'](_0x91cc('0x73'),_0x5097c8));return startTranscribe(_0x3566b6,_0x33812f,_0x4f4bfd,uuidv4(),_0x418b58,_0x52ec56[_0x91cc('0x6f')]);})[_0x91cc('0x22')](function(_0x182287){logger[_0x91cc('0x63')](util['format'](_0x91cc('0x74'),_0x5097c8,_0x182287[_0x91cc('0x75')][_0x91cc('0x76')]));_0x411ea0['transcribeName']=_0x182287[_0x91cc('0x75')][_0x91cc('0x76')];_0x411ea0['transcribeStatus']=_0x182287[_0x91cc('0x75')][_0x91cc('0x77')];return _0x2dfb47(_0x411ea0);})[_0x91cc('0x43')](function(_0x23065e){return _0x6ed278(_0x23065e);});});}exports[_0x91cc('0x78')]=function(_0x597471,_0x439f62,_0x2b532d){var _0x43f1ed;var _0x4d06fe;var _0x193862;var _0x59c25c=require(_0x91cc('0x4a'));return db[_0x91cc('0x29')][_0x91cc('0x79')]({'where':{'id':_0x597471[_0x91cc('0x48')]['id']}})[_0x91cc('0x22')](function(_0x8d9bca){if(_0x8d9bca){var _0x3968=util['format']('%s.cypher',_0x8d9bca[_0x91cc('0x4c')]);if(fs[_0x91cc('0x4e')](_0x3968)){cypher=!![];return _0x59c25c[_0x91cc('0x7a')](_0x3968,_0x8d9bca['value'],config[_0x91cc('0x4f')][_0x91cc('0x50')])['then'](function(){return _0x8d9bca;});}return _0x8d9bca;}})[_0x91cc('0x22')](function(_0x518ab5){if(!_0x518ab5){throw new db[(_0x91cc('0x51'))]['ValidationError'](_0x91cc('0x7b'));}_0x4d06fe=_0x518ab5;return db['Setting'][_0x91cc('0x79')]({'where':{'id':0x1}});})[_0x91cc('0x22')](handleEntityNotFound(_0x439f62,null))[_0x91cc('0x22')](function(_0x579bf3){if(_0x579bf3){_0x43f1ed=_0x579bf3;if(!_0x43f1ed[_0x91cc('0x7c')]||!_0x43f1ed[_0x91cc('0x7d')]||!_0x43f1ed[_0x91cc('0x7e')]||!_0x43f1ed[_0x91cc('0x7f')]||!_0x43f1ed[_0x91cc('0x70')]){throw new db[(_0x91cc('0x51'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x597471[_0x91cc('0x46')][_0x91cc('0x80')]&&(!_0x43f1ed[_0x91cc('0x81')]||!_0x43f1ed['sentimentAccountId']||!_0x43f1ed[_0x91cc('0x82')]||!_0x43f1ed[_0x91cc('0x7f')]||!_0x43f1ed['bucket'])){throw new db[(_0x91cc('0x51'))][(_0x91cc('0x60'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x91cc('0x83')][_0x91cc('0x79')]({'where':{'id':_0x43f1ed[_0x91cc('0x7d')]}});}})[_0x91cc('0x22')](function(_0x5641c9){if(!_0x5641c9){throw new db[(_0x91cc('0x51'))][(_0x91cc('0x60'))](_0x91cc('0x84'));}if(!_0x5641c9[_0x91cc('0x85')]||!_0x5641c9[_0x91cc('0x86')]){throw new db['Sequelize'][(_0x91cc('0x60'))](_0x91cc('0x87'));}_0x193862=_0x5641c9;return getBucketslist(_0x193862['data1'],_0x193862[_0x91cc('0x86')],_0x43f1ed[_0x91cc('0x7e')]);})[_0x91cc('0x22')](function(_0x17f3e8){if(_0x17f3e8&&_0x17f3e8[_0x91cc('0x88')]){var _0x2a27dc=_[_0x91cc('0x47')](_0x17f3e8[_0x91cc('0x88')],function(_0x990ebc){return _0x990ebc[_0x91cc('0x89')]===_0x43f1ed[_0x91cc('0x70')];});if(!_0x2a27dc){logger[_0x91cc('0x63')](util[_0x91cc('0x2e')](_0x91cc('0x8a'),_0x597471['params']['id'],_0x43f1ed['bucket']));return createBucket(_0x193862[_0x91cc('0x85')],_0x193862['data2'],_0x43f1ed['transcribeRegion'],_0x43f1ed['bucket']);}logger[_0x91cc('0x63')](util[_0x91cc('0x2e')](_0x91cc('0x8b'),_0x597471[_0x91cc('0x48')]['id'],_0x43f1ed[_0x91cc('0x70')]));return;}})[_0x91cc('0x22')](function(_0x9e30d6){if(_0x4d06fe[_0x91cc('0x8c')]===_0x91cc('0x8d')){return transcribe(_0x597471[_0x91cc('0x48')]['id'],_0x193862[_0x91cc('0x85')],_0x193862['data2'],_0x43f1ed['transcribeRegion'],_0x43f1ed[_0x91cc('0x70')],_0x4d06fe[_0x91cc('0x4c')],_0x43f1ed[_0x91cc('0x7f')]);}else{logger[_0x91cc('0x63')](util[_0x91cc('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x597471[_0x91cc('0x48')]['id']));return{'transcribeStatus':_0x91cc('0x8e')};}})[_0x91cc('0x22')](function(_0x400b63){if(_0x400b63){_0x400b63['tempSentiment']=_0x597471[_0x91cc('0x46')][_0x91cc('0x80')];return _0x4d06fe[_0x91cc('0x8f')](_0x400b63);}})['then'](respondWithResult(_0x439f62,null))[_0x91cc('0x43')](handleError(_0x439f62,null));};function writeFile(_0x4240d2,_0x1c71f0){return new Promise(function(_0x1fc701,_0x1a33a7){fs[_0x91cc('0x90')](_0x1c71f0,_0x4240d2,function(_0x4f8d33,_0x2e6aa5){if(_0x4f8d33){return _0x1a33a7(_0x4f8d33);}else{return _0x1fc701(_0x2e6aa5);}});});}exports[_0x91cc('0x91')]=function(_0x5892e3,_0x4cd8b1,_0x3b3fa1){return db['VoiceRecording'][_0x91cc('0x79')]({'where':{'id':_0x5892e3[_0x91cc('0x48')]['id']}})[_0x91cc('0x22')](handleEntityNotFound(_0x4cd8b1))['then'](function(_0x5b4966){if(_0x5b4966&&_0x5b4966[_0x91cc('0x92')]){var _0x100bf6=_0x5b4966[_0x91cc('0x92')];var _0x2048a1=config[_0x91cc('0x93')]+_0x91cc('0x94')+_0x5b4966['id']+_0x91cc('0x95');if(fs[_0x91cc('0x4e')](_0x2048a1)){return _0x2048a1;}return writeFile(_0x100bf6,_0x2048a1)[_0x91cc('0x22')](function(){return _0x2048a1;});}else{throw new db[(_0x91cc('0x51'))][(_0x91cc('0x60'))](_0x91cc('0x96'));}})['then'](function(_0x34b71b){return _0x4cd8b1['download'](_0x34b71b);})['catch'](handleError(_0x4cd8b1));}; \ No newline at end of file +var _0x8082=['body','update','find','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','col','token','$and','push','format','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','crypto','jsforce','querystring','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','save','then','error','stack','name','send','index','map','rawAttributes','key','model','differenceBy','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','count','include','VoiceRecording','findAll','rows','catch','params','length','create'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x8082,0xe2));var _0x2808=function(_0x48e9be,_0x399ab2){_0x48e9be=_0x48e9be-0x0;var _0x43d3a1=_0x8082[_0x48e9be];return _0x43d3a1;};'use strict';var emlformat=require(_0x2808('0x0'));var rimraf=require(_0x2808('0x1'));var zipdir=require(_0x2808('0x2'));var jsonpatch=require(_0x2808('0x3'));var rp=require(_0x2808('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2808('0x5'));var csv=require('to-csv');var ejs=require(_0x2808('0x6'));var fs=require('fs');var fs_extra=require(_0x2808('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2808('0x8'));var jsforce=require(_0x2808('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2808('0xa'));var Papa=require(_0x2808('0xb'));var AWS=require('aws-sdk');var uuidv4=require(_0x2808('0xc'));var Redis=require('ioredis');var authService=require(_0x2808('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2808('0xe'));var hardwareService=require(_0x2808('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x2808('0x10'));var config=require(_0x2808('0x11'));var licenseUtil=require(_0x2808('0x12'));var db=require(_0x2808('0x13'))['db'];function respondWithStatusCode(_0x2f21ed,_0x5524e4){_0x5524e4=_0x5524e4||0xcc;return function(_0x2be27f){if(_0x2be27f){return _0x2f21ed[_0x2808('0x14')](_0x5524e4);}return _0x2f21ed[_0x2808('0x15')](_0x5524e4)[_0x2808('0x16')]();};}function respondWithResult(_0x1aa065,_0x4d1686){_0x4d1686=_0x4d1686||0xc8;return function(_0x44287c){if(_0x44287c){return _0x1aa065[_0x2808('0x15')](_0x4d1686)['json'](_0x44287c);}};}function respondWithFilteredResult(_0x56b0d1,_0x3a28c2){return function(_0xe9c57b){if(_0xe9c57b){var _0x2b3ed1=typeof _0x3a28c2[_0x2808('0x17')]==='undefined'&&typeof _0x3a28c2['limit']===_0x2808('0x18');var _0x303648=_0xe9c57b['count'];var _0x3717db=_0x2b3ed1?0x0:_0x3a28c2['offset'];var _0x3770ec=_0x2b3ed1?_0xe9c57b['count']:_0x3a28c2[_0x2808('0x17')]+_0x3a28c2[_0x2808('0x19')];var _0x3b1551;if(_0x3770ec>=_0x303648){_0x3770ec=_0x303648;_0x3b1551=0xc8;}else{_0x3b1551=0xce;}_0x56b0d1[_0x2808('0x15')](_0x3b1551);return _0x56b0d1[_0x2808('0x1a')]('Content-Range',_0x3717db+'-'+_0x3770ec+'/'+_0x303648)[_0x2808('0x1b')](_0xe9c57b);}return null;};}function patchUpdates(_0x52e1a){return function(_0x592e16){try{jsonpatch[_0x2808('0x1c')](_0x592e16,_0x52e1a,!![]);}catch(_0x87d235){return BPromise['reject'](_0x87d235);}return _0x592e16[_0x2808('0x1d')]();};}function saveUpdates(_0x25260d,_0x3e9b0e){return function(_0x43d4f1){if(_0x43d4f1){return _0x43d4f1['update'](_0x25260d)[_0x2808('0x1e')](function(_0x549bfd){return _0x549bfd;});}return null;};}function removeEntity(_0xac8f47,_0x35670f){return function(_0x585815){if(_0x585815){return _0x585815['destroy']()[_0x2808('0x1e')](function(){_0xac8f47['status'](0xcc)[_0x2808('0x16')]();});}};}function handleEntityNotFound(_0x4264be,_0x512af1){return function(_0x53e987){if(!_0x53e987){_0x4264be[_0x2808('0x14')](0x194);}return _0x53e987;};}function handleError(_0x516321,_0x50775e){_0x50775e=_0x50775e||0x1f4;return function(_0xd27259){logger[_0x2808('0x1f')](_0xd27259[_0x2808('0x20')]);if(_0xd27259['name']){delete _0xd27259[_0x2808('0x21')];}_0x516321[_0x2808('0x15')](_0x50775e)[_0x2808('0x22')](_0xd27259);};}exports[_0x2808('0x23')]=function(_0x240151,_0x2c3060){var _0x172bde={},_0x1a9263={},_0x207066={'count':0x0,'rows':[]};var _0x139876=_[_0x2808('0x24')](db['VoiceRecording'][_0x2808('0x25')],function(_0x465fba){return{'name':_0x465fba['fieldName'],'type':_0x465fba['type'][_0x2808('0x26')]};});_0x1a9263[_0x2808('0x27')]=_[_0x2808('0x28')](_[_0x2808('0x24')](_0x139876,'name'),['format']);_0x1a9263['query']=_[_0x2808('0x29')](_0x240151[_0x2808('0x2a')]);_0x1a9263['filters']=_[_0x2808('0x2b')](_0x1a9263['model'],_0x1a9263[_0x2808('0x2a')]);_0x172bde[_0x2808('0x2c')]=_[_0x2808('0x2b')](_0x1a9263[_0x2808('0x27')],qs['fields'](_0x240151[_0x2808('0x2a')][_0x2808('0x2d')]));_0x172bde[_0x2808('0x2c')]=_0x172bde[_0x2808('0x2c')]['length']?_0x172bde['attributes']:_0x1a9263[_0x2808('0x27')];if(!_0x240151[_0x2808('0x2a')][_0x2808('0x2e')]('nolimit')){_0x172bde[_0x2808('0x19')]=qs[_0x2808('0x19')](_0x240151[_0x2808('0x2a')]['limit']);_0x172bde['offset']=qs[_0x2808('0x17')](_0x240151[_0x2808('0x2a')][_0x2808('0x17')]);}_0x172bde[_0x2808('0x2f')]=qs[_0x2808('0x30')](_0x240151[_0x2808('0x2a')][_0x2808('0x30')]);_0x172bde[_0x2808('0x31')]=qs['filters'](_[_0x2808('0x32')](_0x240151['query'],_0x1a9263[_0x2808('0x33')]),_0x139876);if(_0x240151[_0x2808('0x2a')][_0x2808('0x34')]){_0x172bde[_0x2808('0x31')]=_[_0x2808('0x35')](_0x172bde[_0x2808('0x31')],{'$or':_[_0x2808('0x24')](_0x139876,function(_0x1e06ba){if(_0x1e06ba[_0x2808('0x36')]!==_0x2808('0x37')){var _0x550524={};_0x550524[_0x1e06ba['name']]={'$like':'%'+_0x240151[_0x2808('0x2a')][_0x2808('0x34')]+'%'};return _0x550524;}})});}_0x172bde=_[_0x2808('0x35')]({},_0x172bde,_0x240151[_0x2808('0x38')]);var _0x3a00a9={'where':_0x172bde[_0x2808('0x31')]};return db['VoiceRecording'][_0x2808('0x39')](_0x3a00a9)[_0x2808('0x1e')](function(_0x9199a){_0x207066[_0x2808('0x39')]=_0x9199a;if(_0x240151[_0x2808('0x2a')]['includeAll']){_0x172bde[_0x2808('0x3a')]=[{'all':!![]}];}return db[_0x2808('0x3b')][_0x2808('0x3c')](_0x172bde);})['then'](function(_0x3c2d10){_0x207066[_0x2808('0x3d')]=_0x3c2d10;return _0x207066;})[_0x2808('0x1e')](respondWithFilteredResult(_0x2c3060,_0x172bde))[_0x2808('0x3e')](handleError(_0x2c3060,null));};exports['show']=function(_0x26051a,_0xcaca78){var _0x7fb280={'raw':![],'where':{'id':_0x26051a[_0x2808('0x3f')]['id']}},_0x19e5b4={};_0x19e5b4[_0x2808('0x27')]=_[_0x2808('0x29')](db[_0x2808('0x3b')][_0x2808('0x25')]);_0x19e5b4['query']=_['keys'](_0x26051a[_0x2808('0x2a')]);_0x19e5b4['filters']=_['intersection'](_0x19e5b4['model'],_0x19e5b4['query']);_0x7fb280[_0x2808('0x2c')]=_[_0x2808('0x2b')](_0x19e5b4['model'],qs[_0x2808('0x2d')](_0x26051a[_0x2808('0x2a')][_0x2808('0x2d')]));_0x7fb280[_0x2808('0x2c')]=_0x7fb280[_0x2808('0x2c')][_0x2808('0x40')]?_0x7fb280[_0x2808('0x2c')]:_0x19e5b4[_0x2808('0x27')];if(_0x26051a[_0x2808('0x2a')]['includeAll']){_0x7fb280[_0x2808('0x3a')]=[{'all':!![]}];}_0x7fb280=_[_0x2808('0x35')]({},_0x7fb280,_0x26051a['options']);return db[_0x2808('0x3b')]['find'](_0x7fb280)[_0x2808('0x1e')](handleEntityNotFound(_0xcaca78,null))['then'](respondWithResult(_0xcaca78,null))[_0x2808('0x3e')](handleError(_0xcaca78,null));};exports[_0x2808('0x41')]=function(_0x477b0b,_0x4ee77d){return db[_0x2808('0x3b')][_0x2808('0x41')](_0x477b0b[_0x2808('0x42')],{})[_0x2808('0x1e')](respondWithResult(_0x4ee77d,0xc9))[_0x2808('0x3e')](handleError(_0x4ee77d,null));};exports[_0x2808('0x43')]=function(_0x3aee75,_0x1e7800){if(_0x3aee75['body']['id']){delete _0x3aee75['body']['id'];}return db[_0x2808('0x3b')][_0x2808('0x44')]({'where':{'id':_0x3aee75[_0x2808('0x3f')]['id']}})[_0x2808('0x1e')](handleEntityNotFound(_0x1e7800,null))[_0x2808('0x1e')](saveUpdates(_0x3aee75[_0x2808('0x42')],null))[_0x2808('0x1e')](respondWithResult(_0x1e7800,null))[_0x2808('0x3e')](handleError(_0x1e7800,null));};exports[_0x2808('0x45')]=function(_0x5d8591,_0x59c624){return db[_0x2808('0x3b')][_0x2808('0x45')]()['then'](respondWithResult(_0x59c624,null))[_0x2808('0x3e')](handleError(_0x59c624,null));};exports[_0x2808('0x46')]=function(_0x4e6852,_0x5548c3,_0x38ba36){var _0x28d7f7=require('../../components/encryptor');var _0x35ce46=![];var _0x285e58={};if(_0x4e6852[_0x2808('0x2a')][_0x2808('0x36')]&&_0x4e6852[_0x2808('0x2a')]['type']===_0x2808('0x47')){_0x285e58[_0x2808('0x47')]=_0x4e6852['params']['id'];}else{_0x285e58['id']=_0x4e6852['params']['id'];}return db['VoiceRecording'][_0x2808('0x44')]({'where':_0x285e58,'attributes':['id',_0x2808('0x48')],'raw':!![]})[_0x2808('0x1e')](handleEntityNotFound(_0x5548c3,null))[_0x2808('0x1e')](function(_0x171c7a){if(_0x171c7a){var _0x32e3f6=_0x171c7a[_0x2808('0x48')];var _0x30fa1d=util['format'](_0x2808('0x49'),_0x32e3f6);if(fs[_0x2808('0x4a')](_0x30fa1d)){_0x35ce46=!![];return _0x28d7f7[_0x2808('0x4b')](_0x30fa1d,_0x32e3f6,config[_0x2808('0x4c')][_0x2808('0x4d')])[_0x2808('0x1e')](function(){return _0x171c7a;});}return _0x171c7a;}})[_0x2808('0x1e')](function(_0x8e52b7){if(_0x8e52b7){var _0x12368c=_0x8e52b7[_0x2808('0x48')];if(!fs['existsSync'](_0x12368c)){throw new db[(_0x2808('0x4e'))][(_0x2808('0x4f'))](_0x2808('0x50'));}if(_0x8e52b7[_0x2808('0x51')]){return _0x5548c3['download'](_0x12368c,_0x8e52b7[_0x2808('0x51')]+path[_0x2808('0x52')](_0x12368c),function(){if(_0x35ce46){fs[_0x2808('0x53')](_0x12368c);}});}else{return _0x5548c3[_0x2808('0x46')](_0x12368c,function(_0x488617){if(_0x35ce46){fs[_0x2808('0x53')](_0x12368c);}});}}})[_0x2808('0x3e')](function(_0x420c1d){if(_0x420c1d[_0x2808('0x54')]==='VoiceRecording\x20not\x20found'){_0x5548c3[_0x2808('0x15')](0x194)[_0x2808('0x22')](_0x2808('0x55'));}else{return handleError(_0x5548c3,null);}});};exports[_0x2808('0x56')]=function(_0x115709,_0x27d990,_0x5b3806){var _0x324f14=require(_0x2808('0x57'));var _0x2ad313=![];var _0x4b31c1={'$and':[db[_0x2808('0x58')][_0x2808('0x31')](db[_0x2808('0x58')]['fn']('MD5',db[_0x2808('0x58')][_0x2808('0x59')](_0x2808('0x47'))),_0x115709[_0x2808('0x2a')][_0x2808('0x5a')])]};if(_0x115709[_0x2808('0x2a')]['type']&&_0x115709['query'][_0x2808('0x36')]===_0x2808('0x47')){_0x4b31c1[_0x2808('0x5b')][_0x2808('0x5c')]({'uniqueid':_0x115709[_0x2808('0x3f')]['id']});}else{_0x4b31c1[_0x2808('0x5b')][_0x2808('0x5c')]({'id':_0x115709[_0x2808('0x3f')]['id']});}return db[_0x2808('0x3b')][_0x2808('0x44')]({'where':_0x4b31c1,'attributes':['id',_0x2808('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x27d990,null))[_0x2808('0x1e')](function(_0x3c446f){if(_0x3c446f){var _0x2d489c=util[_0x2808('0x5d')]('%s.cypher',_0x3c446f[_0x2808('0x48')]);if(fs[_0x2808('0x4a')](_0x2d489c)){_0x2ad313=!![];return _0x324f14['decryptFile'](_0x2d489c,_0x3c446f[_0x2808('0x48')],config[_0x2808('0x4c')][_0x2808('0x4d')])[_0x2808('0x1e')](function(){return _0x3c446f;});}return _0x3c446f;}})[_0x2808('0x1e')](function(_0x4077de){if(_0x4077de){if(!fs[_0x2808('0x4a')](_0x4077de['value'])){throw new db[(_0x2808('0x4e'))][(_0x2808('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x4077de[_0x2808('0x51')]){return _0x27d990[_0x2808('0x46')](_0x4077de[_0x2808('0x48')],_0x4077de['filename']+path[_0x2808('0x52')](_0x4077de[_0x2808('0x48')]),function(){if(_0x2ad313){fs[_0x2808('0x53')](_0x4077de[_0x2808('0x48')]);}});}else{return _0x27d990['download'](_0x4077de[_0x2808('0x48')],function(_0xf1b9d5){if(_0x2ad313){fs[_0x2808('0x53')](_0x4077de[_0x2808('0x48')]);}});}}})[_0x2808('0x3e')](handleError(_0x27d990,null));};exports[_0x2808('0x5e')]=function(_0x5ec4a4,_0xffc480){return db[_0x2808('0x3b')][_0x2808('0x44')]({'where':{'id':_0x5ec4a4['params']['id']}})[_0x2808('0x1e')](function(_0x178b9d){if(_[_0x2808('0x5f')](_0x178b9d)){throw new ReferenceError(_0x2808('0x60'));}return _0x178b9d;})[_0x2808('0x1e')](function(_0x22069a){var _0x74dec0=_0x22069a[_0x2808('0x48')];logger[_0x2808('0x61')](_0x2808('0x62'),_0x74dec0);if(!_['isNil'](_0x22069a[_0x2808('0x48')])&&fs['existsSync'](_0x74dec0)){logger[_0x2808('0x61')](_0x2808('0x63')+_0x74dec0+_0x2808('0x64'));fs[_0x2808('0x65')](_0x74dec0);}_0x74dec0=_0x74dec0+'.cypher';if(!_[_0x2808('0x5f')](_0x22069a[_0x2808('0x48')])&&fs[_0x2808('0x4a')](_0x74dec0)){logger['info']('File:\x20\x22'+_0x74dec0+_0x2808('0x64'));fs[_0x2808('0x65')](_0x74dec0);}return _0x22069a;})[_0x2808('0x1e')](function(_0x1a2986){if(!_0x1a2986)throw new InternalError();return _0x1a2986[_0x2808('0x5e')]();})[_0x2808('0x1e')](function(){_0xffc480[_0x2808('0x15')](0xcc)[_0x2808('0x16')]();})[_0x2808('0x3e')](handleError(_0xffc480,null));};function getBucketslist(_0x16061a,_0x38ba74,_0x21792e){return new Promise(function(_0x199f41,_0x7e1184){var _0x2ad619=new AWS['S3']({'accessKeyId':_0x38ba74,'secretAccessKey':_0x16061a,'region':_0x21792e});_0x2ad619[_0x2808('0x66')]({},function(_0x35448b,_0x35f3ae){if(_0x35448b){return _0x7e1184(_0x35448b);}else{return _0x199f41(_0x35f3ae);}});});}function createBucket(_0x30dd1c,_0x1b6341,_0x397839,_0x19fe0b){return new Promise(function(_0x53d94d,_0x3f3d98){var _0x17b895=new AWS['S3']({'accessKeyId':_0x1b6341,'secretAccessKey':_0x30dd1c,'region':_0x397839});_0x17b895[_0x2808('0x67')]({'Bucket':_0x19fe0b},function(_0x4c118f,_0x4a0fe2){if(_0x4c118f){return _0x3f3d98(_0x4c118f);}else{return _0x53d94d(_0x4a0fe2);}});});}function uploadFile(_0x1d84ec,_0x5d3ebd,_0x2b53e7,_0x3628cc,_0x47d10f,_0xae0c7d){return new Promise(function(_0x13e0f0,_0x31ba94){var _0x1cd96c=new AWS['S3']({'accessKeyId':_0x5d3ebd,'secretAccessKey':_0x1d84ec,'region':_0x2b53e7});_0x1cd96c[_0x2808('0x68')]({'Bucket':_0x3628cc,'Key':_0x47d10f,'Body':_0xae0c7d},function(_0x4d7bae,_0x4a0ac7){if(_0x4d7bae){return _0x31ba94(_0x4d7bae);}else{return _0x13e0f0(_0x4a0ac7);}});});}function startTranscribe(_0x24308f,_0xa03201,_0x168626,_0x21d1eb,_0x457e1b,_0x1b37fa){return new Promise(function(_0x32285a,_0x52796c){var _0x9ab80=new AWS['TranscribeService']({'accessKeyId':_0xa03201,'secretAccessKey':_0x24308f,'region':_0x168626});_0x9ab80[_0x2808('0x69')]({'TranscriptionJobName':_0x21d1eb,'LanguageCode':_0x457e1b,'Media':{'MediaFileUri':_0x1b37fa}},function(_0x51297a,_0x4b8180){if(_0x51297a){return _0x52796c(_0x51297a);}else{return _0x32285a(_0x4b8180);}});});}function transcribe(_0x5a6509,_0x5329b4,_0x57cea6,_0xed9bab,_0x94cbcd,_0xcc7061,_0x1534e1){return new Promise(function(_0x33ceb9,_0x28654f){var _0x559e7b={};logger['info'](util[_0x2808('0x5d')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5a6509,_0x94cbcd));return uploadFile(_0x5329b4,_0x57cea6,_0xed9bab,_0x94cbcd,path[_0x2808('0x6a')](_0xcc7061),fs['readFileSync'](_0xcc7061))['then'](function(_0x5b0740){logger['info'](util[_0x2808('0x5d')](_0x2808('0x6b'),_0x5a6509,_0x94cbcd,_0x5b0740[_0x2808('0x6c')]));_0x559e7b['bucket']=_0x5b0740[_0x2808('0x6d')];_0x559e7b[_0x2808('0x6e')]=_0x5b0740[_0x2808('0x6c')];logger[_0x2808('0x61')](util[_0x2808('0x5d')](_0x2808('0x6f'),_0x5a6509));return startTranscribe(_0x5329b4,_0x57cea6,_0xed9bab,uuidv4(),_0x1534e1,_0x5b0740[_0x2808('0x6c')]);})[_0x2808('0x1e')](function(_0x3c190b){logger[_0x2808('0x61')](util['format'](_0x2808('0x70'),_0x5a6509,_0x3c190b[_0x2808('0x71')][_0x2808('0x72')]));_0x559e7b[_0x2808('0x73')]=_0x3c190b[_0x2808('0x71')][_0x2808('0x72')];_0x559e7b[_0x2808('0x74')]=_0x3c190b[_0x2808('0x71')]['TranscriptionJobStatus'];return _0x33ceb9(_0x559e7b);})[_0x2808('0x3e')](function(_0x3bfb7a){return _0x28654f(_0x3bfb7a);});});}exports[_0x2808('0x75')]=function(_0x4c3c64,_0x3051f1,_0x24d012){var _0x19c5d7;var _0x2746d3;var _0x303537;var _0x4790e6=require(_0x2808('0x57'));return db[_0x2808('0x3b')][_0x2808('0x76')]({'where':{'id':_0x4c3c64[_0x2808('0x3f')]['id']}})[_0x2808('0x1e')](function(_0x4bbfec){if(_0x4bbfec){var _0x24d938=util['format']('%s.cypher',_0x4bbfec[_0x2808('0x48')]);if(fs[_0x2808('0x4a')](_0x24d938)){cypher=!![];return _0x4790e6[_0x2808('0x4b')](_0x24d938,_0x4bbfec[_0x2808('0x48')],config[_0x2808('0x4c')]['recording'])[_0x2808('0x1e')](function(){return _0x4bbfec;});}return _0x4bbfec;}})[_0x2808('0x1e')](function(_0x1de935){if(!_0x1de935){throw new db[(_0x2808('0x4e'))][(_0x2808('0x4f'))](_0x2808('0x77'));}_0x2746d3=_0x1de935;return db[_0x2808('0x78')]['findOne']({'where':{'id':0x1}});})[_0x2808('0x1e')](handleEntityNotFound(_0x3051f1,null))['then'](function(_0x2a87b3){if(_0x2a87b3){_0x19c5d7=_0x2a87b3;if(!_0x19c5d7['transcribe']||!_0x19c5d7[_0x2808('0x79')]||!_0x19c5d7[_0x2808('0x7a')]||!_0x19c5d7[_0x2808('0x7b')]||!_0x19c5d7[_0x2808('0x7c')]){throw new db[(_0x2808('0x4e'))]['ValidationError'](_0x2808('0x7d'));}if(_0x4c3c64[_0x2808('0x42')][_0x2808('0x7e')]&&(!_0x19c5d7[_0x2808('0x7f')]||!_0x19c5d7['sentimentAccountId']||!_0x19c5d7['sentimentRegion']||!_0x19c5d7[_0x2808('0x7b')]||!_0x19c5d7[_0x2808('0x7c')])){throw new db[(_0x2808('0x4e'))][(_0x2808('0x4f'))](_0x2808('0x80'));}return db[_0x2808('0x81')][_0x2808('0x76')]({'where':{'id':_0x19c5d7['transcribeAccountId']}});}})['then'](function(_0x26d620){if(!_0x26d620){throw new db['Sequelize'][(_0x2808('0x4f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x26d620[_0x2808('0x82')]||!_0x26d620[_0x2808('0x83')]){throw new db[(_0x2808('0x4e'))][(_0x2808('0x4f'))]('Cloud\x20Provider\x20not\x20configured');}_0x303537=_0x26d620;return getBucketslist(_0x303537[_0x2808('0x82')],_0x303537[_0x2808('0x83')],_0x19c5d7[_0x2808('0x7a')]);})[_0x2808('0x1e')](function(_0x380cc5){if(_0x380cc5&&_0x380cc5[_0x2808('0x84')]){var _0x2d67db=_[_0x2808('0x44')](_0x380cc5[_0x2808('0x84')],function(_0x5c6316){return _0x5c6316[_0x2808('0x85')]===_0x19c5d7['bucket'];});if(!_0x2d67db){logger[_0x2808('0x61')](util['format'](_0x2808('0x86'),_0x4c3c64[_0x2808('0x3f')]['id'],_0x19c5d7['bucket']));return createBucket(_0x303537['data1'],_0x303537[_0x2808('0x83')],_0x19c5d7[_0x2808('0x7a')],_0x19c5d7[_0x2808('0x7c')]);}logger[_0x2808('0x61')](util['format'](_0x2808('0x87'),_0x4c3c64[_0x2808('0x3f')]['id'],_0x19c5d7[_0x2808('0x7c')]));return;}})[_0x2808('0x1e')](function(_0x4d9651){if(_0x2746d3[_0x2808('0x74')]===_0x2808('0x88')){return transcribe(_0x4c3c64[_0x2808('0x3f')]['id'],_0x303537['data1'],_0x303537['data2'],_0x19c5d7[_0x2808('0x7a')],_0x19c5d7[_0x2808('0x7c')],_0x2746d3['value'],_0x19c5d7[_0x2808('0x7b')]);}else{logger['info'](util[_0x2808('0x5d')](_0x2808('0x89'),_0x4c3c64[_0x2808('0x3f')]['id']));return{'transcribeStatus':_0x2808('0x8a')};}})[_0x2808('0x1e')](function(_0x592b69){if(_0x592b69){_0x592b69[_0x2808('0x8b')]=_0x4c3c64[_0x2808('0x42')][_0x2808('0x7e')];return _0x2746d3['updateAttributes'](_0x592b69);}})[_0x2808('0x1e')](respondWithResult(_0x3051f1,null))[_0x2808('0x3e')](handleError(_0x3051f1,null));};function writeFile(_0x1e0c98,_0x42579b){return new Promise(function(_0x3b0baa,_0x4c8f0b){fs[_0x2808('0x8c')](_0x42579b,_0x1e0c98,function(_0x39b599,_0x161a6c){if(_0x39b599){return _0x4c8f0b(_0x39b599);}else{return _0x3b0baa(_0x161a6c);}});});}exports[_0x2808('0x8d')]=function(_0x22ffc5,_0x3ed5b8,_0x3d6ef9){return db['VoiceRecording'][_0x2808('0x76')]({'where':{'id':_0x22ffc5[_0x2808('0x3f')]['id']}})[_0x2808('0x1e')](handleEntityNotFound(_0x3ed5b8))[_0x2808('0x1e')](function(_0x32232d){if(_0x32232d&&_0x32232d['fileText']){var _0x4d00b1=_0x32232d[_0x2808('0x8e')];var _0x41f301=config[_0x2808('0x8f')]+_0x2808('0x90')+_0x32232d['id']+_0x2808('0x91');if(fs[_0x2808('0x4a')](_0x41f301)){return _0x41f301;}return writeFile(_0x4d00b1,_0x41f301)['then'](function(){return _0x41f301;});}else{throw new db[(_0x2808('0x4e'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x9b9625){return _0x3ed5b8[_0x2808('0x46')](_0x9b9625);})[_0x2808('0x3e')](handleError(_0x3ed5b8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 1978c7e..c5a2a7f 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 _0x12a1=['request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x17c4ef,_0x3290e2){var _0x1b5def=function(_0x23e396){while(--_0x23e396){_0x17c4ef['push'](_0x17c4ef['shift']());}};_0x1b5def(++_0x3290e2);}(_0x12a1,0xbf));var _0x112a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12a1[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x112a('0x0'));var logger=require(_0x112a('0x1'))(_0x112a('0x2'));var moment=require(_0x112a('0x3'));var BPromise=require(_0x112a('0x4'));var rp=require(_0x112a('0x5'));var fs=require('fs');var path=require(_0x112a('0x6'));var rimraf=require(_0x112a('0x7'));var config=require(_0x112a('0x8'));var attributes=require(_0x112a('0x9'));module['exports']=function(_0x226aba,_0x2cf648){return _0x226aba[_0x112a('0xa')](_0x112a('0xb'),attributes,{'tableName':_0x112a('0xc'),'paranoid':![],'indexes':[{'name':_0x112a('0xd'),'fields':[_0x112a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e96=['VoiceRecording','voice_recordings','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x59973c,_0x4b0d5e){var _0x5a2b13=function(_0xcbbb79){while(--_0xcbbb79){_0x59973c['push'](_0x59973c['shift']());}};_0x5a2b13(++_0x4b0d5e);}(_0x9e96,0xa7));var _0x69e9=function(_0x12c6bb,_0x1461e1){_0x12c6bb=_0x12c6bb-0x0;var _0x499c96=_0x9e96[_0x12c6bb];return _0x499c96;};'use strict';var _=require(_0x69e9('0x0'));var util=require(_0x69e9('0x1'));var logger=require(_0x69e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x69e9('0x3'));var rp=require(_0x69e9('0x4'));var fs=require('fs');var path=require(_0x69e9('0x5'));var rimraf=require(_0x69e9('0x6'));var config=require(_0x69e9('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x69e9('0x8')]=function(_0x443a08,_0x27dc33){return _0x443a08['define'](_0x69e9('0x9'),attributes,{'tableName':_0x69e9('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 99eed55..b4c8999 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 _0x1893=['http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','then','existsSync','value','format','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2f3375,_0x35146a){var _0x5cf46e=function(_0x1d1245){while(--_0x1d1245){_0x2f3375['push'](_0x2f3375['shift']());}};_0x5cf46e(++_0x35146a);}(_0x1893,0xa2));var _0x3189=function(_0x27830a,_0x4e8504){_0x27830a=_0x27830a-0x0;var _0x32ccc3=_0x1893[_0x27830a];return _0x32ccc3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')](_0xf8aed7[_0x3189('0x18')],{'raw':_0xf8aed7['options']?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8aed7[_0x3189('0x19')]?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1b')]||null:null,'attributes':_0xf8aed7['options']?_0xf8aed7[_0x3189('0x19')][_0x3189('0x1c')]||null:null,'limit':_0xf8aed7[_0x3189('0x19')]?_0xf8aed7['options'][_0x3189('0x1d')]||null:null})['then'](function(_0x4bfc03){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x4bfc03));_0x9905c4(_0x4bfc03);})['catch'](function(_0x4b03ad){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4b03ad[_0x3189('0x13')],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4b03ad[_0x3189('0x13')]));});});};exports[_0x3189('0x1e')]=function(_0xdda38b){var _0x379a48=this;return new Promise(function(_0x17b540,_0x5ec0ac){var _0x5ce5f5=require('../../components/encryptor');var _0x5aa34a;return db[_0x3189('0x1f')][_0x3189('0x20')]({'attributes':['id',_0x3189('0x21')],'where':{'id':0x1},'raw':!![]})[_0x3189('0x22')](function(_0x36b258){_0x5aa34a=_0x36b258;return db[_0x3189('0x16')]['create'](_0xdda38b[_0x3189('0x18')]);})[_0x3189('0x22')](function(_0x4bd677){if(_0x5aa34a[_0x3189('0x21')]&&fs[_0x3189('0x23')](_0x4bd677[_0x3189('0x24')])){var _0x5c7a36=util[_0x3189('0x25')](_0x3189('0x26'),_0x4bd677[_0x3189('0x24')]);return _0x5ce5f5['encryptFile'](_0x4bd677[_0x3189('0x24')],_0x5c7a36,config[_0x3189('0x27')]['recording'])[_0x3189('0x22')](function(){fs[_0x3189('0x28')](_0x4bd677[_0x3189('0x24')]);logger[_0x3189('0x14')](_0x3189('0x29'));return _0x4bd677;});}return _0x4bd677;})['then'](function(_0x544c49){logger[_0x3189('0x14')]('CreateVoiceRecording',_0xdda38b);logger[_0x3189('0xe')](_0x3189('0x1e'),_0xdda38b,JSON[_0x3189('0x10')](_0x544c49));_0x17b540(_0x544c49);})[_0x3189('0x2a')](function(_0x231d72){logger[_0x3189('0x11')](_0x3189('0x1e'),_0x231d72[_0x3189('0x13')],_0xdda38b);_0x5ec0ac(_0x379a48[_0x3189('0x11')](0x1f4,_0x231d72['message']));});});}; \ No newline at end of file +var _0x57ca=['update','body','options','where','limit','then','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0xc43928,_0x3890ac){var _0x529606=function(_0x155403){while(--_0x155403){_0xc43928['push'](_0xc43928['shift']());}};_0x529606(++_0x3890ac);}(_0x57ca,0x108));var _0xa57c=function(_0x2bfbc3,_0x4d7905){_0x2bfbc3=_0x2bfbc3-0x0;var _0x52293d=_0x57ca[_0x2bfbc3];return _0x52293d;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')](_0x3d781d[_0xa57c('0x18')],{'raw':_0x3d781d['options']?_0x3d781d[_0xa57c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d781d['options']?_0x3d781d[_0xa57c('0x19')][_0xa57c('0x1a')]||null:null,'attributes':_0x3d781d[_0xa57c('0x19')]?_0x3d781d[_0xa57c('0x19')]['attributes']||null:null,'limit':_0x3d781d[_0xa57c('0x19')]?_0x3d781d[_0xa57c('0x19')][_0xa57c('0x1b')]||null:null})[_0xa57c('0x1c')](function(_0x3bb969){logger[_0xa57c('0xc')](_0xa57c('0x15'),_0x3d781d);logger[_0xa57c('0x1d')](_0xa57c('0x15'),_0x3d781d,JSON[_0xa57c('0x1e')](_0x3bb969));_0xe3d505(_0x3bb969);})[_0xa57c('0x14')](function(_0x1e7f7a){logger[_0xa57c('0xf')](_0xa57c('0x15'),_0x1e7f7a[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c['error'](0x1f4,_0x1e7f7a[_0xa57c('0x12')]));});});};exports[_0xa57c('0x1f')]=function(_0x27884d){var _0x5228b9=this;return new Promise(function(_0x315ad7,_0x1e8e45){var _0x8ee1c0=require(_0xa57c('0x20'));var _0x337f97;return db[_0xa57c('0x21')]['findOne']({'attributes':['id',_0xa57c('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x54a18b){_0x337f97=_0x54a18b;return db[_0xa57c('0x16')][_0xa57c('0x23')](_0x27884d['body']);})[_0xa57c('0x1c')](function(_0x1ef331){if(_0x337f97[_0xa57c('0x22')]&&fs['existsSync'](_0x1ef331[_0xa57c('0x24')])){var _0x58d46f=util[_0xa57c('0x25')]('%s.cypher',_0x1ef331[_0xa57c('0x24')]);return _0x8ee1c0['encryptFile'](_0x1ef331[_0xa57c('0x24')],_0x58d46f,config['secrets'][_0xa57c('0x26')])[_0xa57c('0x1c')](function(){fs[_0xa57c('0x27')](_0x1ef331[_0xa57c('0x24')]);logger[_0xa57c('0xc')](_0xa57c('0x28'));return _0x1ef331;});}return _0x1ef331;})[_0xa57c('0x1c')](function(_0x5aa91e){logger[_0xa57c('0xc')]('CreateVoiceRecording',_0x27884d);logger[_0xa57c('0x1d')](_0xa57c('0x1f'),_0x27884d,JSON[_0xa57c('0x1e')](_0x5aa91e));_0x315ad7(_0x5aa91e);})['catch'](function(_0x289174){logger['error'](_0xa57c('0x1f'),_0x289174['message'],_0x27884d);_0x1e8e45(_0x5228b9[_0xa57c('0xf')](0x1f4,_0x289174['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a1c10bb..0fae069 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 _0xbcc2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','util'];(function(_0x259c59,_0x56c41d){var _0x360f54=function(_0x4fab82){while(--_0x4fab82){_0x259c59['push'](_0x259c59['shift']());}};_0x360f54(++_0x56c41d);}(_0xbcc2,0x18f));var _0x2bcc=function(_0x559854,_0x2056e1){_0x559854=_0x559854-0x0;var _0x5bf2b9=_0xbcc2[_0x559854];return _0x5bf2b9;};'use strict';var multer=require('multer');var util=require(_0x2bcc('0x0'));var path=require('path');var timeout=require(_0x2bcc('0x1'));var express=require(_0x2bcc('0x2'));var router=express[_0x2bcc('0x3')]();var fs_extra=require(_0x2bcc('0x4'));var auth=require(_0x2bcc('0x5'));var interaction=require(_0x2bcc('0x6'));var config=require(_0x2bcc('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x2bcc('0x8')]('/',auth[_0x2bcc('0x9')](),controller[_0x2bcc('0xa')]);router[_0x2bcc('0x8')]('/describe',auth[_0x2bcc('0x9')](),controller[_0x2bcc('0xb')]);router[_0x2bcc('0x8')](_0x2bcc('0xc'),auth['isAuthenticated'](),controller[_0x2bcc('0xd')]);router['post']('/',auth[_0x2bcc('0x9')](),controller[_0x2bcc('0xe')]);router[_0x2bcc('0xf')](_0x2bcc('0xc'),auth[_0x2bcc('0x9')](),controller[_0x2bcc('0x10')]);router[_0x2bcc('0x11')](_0x2bcc('0xc'),auth[_0x2bcc('0x9')](),controller[_0x2bcc('0x12')]);module[_0x2bcc('0x13')]=router; \ No newline at end of file +var _0x6dd6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x10af60,_0x33c98d){var _0x19728c=function(_0x764b8c){while(--_0x764b8c){_0x10af60['push'](_0x10af60['shift']());}};_0x19728c(++_0x33c98d);}(_0x6dd6,0x1c7));var _0x66dd=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x6dd6[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require(_0x66dd('0x0'));var util=require(_0x66dd('0x1'));var path=require('path');var timeout=require(_0x66dd('0x2'));var express=require(_0x66dd('0x3'));var router=express[_0x66dd('0x4')]();var fs_extra=require(_0x66dd('0x5'));var auth=require(_0x66dd('0x6'));var interaction=require(_0x66dd('0x7'));var config=require(_0x66dd('0x8'));var controller=require(_0x66dd('0x9'));router[_0x66dd('0xa')]('/',auth[_0x66dd('0xb')](),controller[_0x66dd('0xc')]);router[_0x66dd('0xa')](_0x66dd('0xd'),auth[_0x66dd('0xb')](),controller[_0x66dd('0xe')]);router[_0x66dd('0xa')](_0x66dd('0xf'),auth[_0x66dd('0xb')](),controller[_0x66dd('0x10')]);router[_0x66dd('0x11')]('/',auth[_0x66dd('0xb')](),controller[_0x66dd('0x12')]);router[_0x66dd('0x13')](_0x66dd('0xf'),auth['isAuthenticated'](),controller[_0x66dd('0x14')]);router[_0x66dd('0x15')](_0x66dd('0xf'),auth[_0x66dd('0xb')](),controller['destroy']);module[_0x66dd('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 7a57200..14244fe 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 _0x088d=['Yes','moment','exports','ENUM','blind','STRING'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x088d,0x1d5));var _0xd088=function(_0x444674,_0x2c08a9){_0x444674=_0x444674-0x0;var _0x37656b=_0x088d[_0x444674];return _0x37656b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd088('0x0'));module[_0xd088('0x1')]={'type':{'type':Sequelize[_0xd088('0x2')](_0xd088('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd088('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xd088('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xd088('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xd088('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xd088('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xd088('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xd088('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xd088('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd088('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd088('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xd088('0x4')]},'transfereecontext':{'type':Sequelize[_0xd088('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd088('0x2')](_0xd088('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd088('0x4')]}}; \ No newline at end of file +var _0x1da1=['sequelize','moment','exports','blind','STRING','ENUM','Yes'];(function(_0x432f53,_0x6ee3a3){var _0x554e0e=function(_0xe8a254){while(--_0xe8a254){_0x432f53['push'](_0x432f53['shift']());}};_0x554e0e(++_0x6ee3a3);}(_0x1da1,0x1ab));var _0x11da=function(_0x50e441,_0x46f925){_0x50e441=_0x50e441-0x0;var _0x3a123d=_0x1da1[_0x50e441];return _0x3a123d;};'use strict';var Sequelize=require(_0x11da('0x0'));var moment=require(_0x11da('0x1'));module[_0x11da('0x2')]={'type':{'type':Sequelize['ENUM'](_0x11da('0x3'),'attended')},'result':{'type':Sequelize[_0x11da('0x4')]},'transfererchannel':{'type':Sequelize[_0x11da('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x11da('0x4')]},'transferercalleridname':{'type':Sequelize[_0x11da('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x11da('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x11da('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x11da('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x11da('0x4')]},'transfereechannel':{'type':Sequelize[_0x11da('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x11da('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x11da('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x11da('0x4')]},'transfereecontext':{'type':Sequelize[_0x11da('0x4')]},'transfereeexten':{'type':Sequelize[_0x11da('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x11da('0x5')](_0x11da('0x6'),'No')},'context':{'type':Sequelize[_0x11da('0x4')]},'extension':{'type':Sequelize[_0x11da('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b82f1f1..2e005a2 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 _0x793d=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','key','model','query'];(function(_0x422c5c,_0x413ec5){var _0x5d11c6=function(_0x3fd2af){while(--_0x3fd2af){_0x422c5c['push'](_0x422c5c['shift']());}};_0x5d11c6(++_0x413ec5);}(_0x793d,0x106));var _0xd793=function(_0xfa6208,_0x170454){_0xfa6208=_0xfa6208-0x0;var _0x57b18e=_0x793d[_0xfa6208];return _0x57b18e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd793('0x1'));var rp=require(_0xd793('0x2'));var moment=require('moment');var BPromise=require(_0xd793('0x3'));var Mustache=require(_0xd793('0x4'));var util=require(_0xd793('0x5'));var path=require(_0xd793('0x6'));var sox=require(_0xd793('0x7'));var csv=require(_0xd793('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd793('0x9'));var _=require(_0xd793('0xa'));var squel=require(_0xd793('0xb'));var crypto=require(_0xd793('0xc'));var jsforce=require(_0xd793('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd793('0x8'));var querystring=require(_0xd793('0xe'));var Papa=require(_0xd793('0xf'));var Redis=require(_0xd793('0x10'));var authService=require(_0xd793('0x11'));var qs=require(_0xd793('0x12'));var as=require(_0xd793('0x13'));var hardwareService=require(_0xd793('0x14'));var logger=require('../../config/logger')(_0xd793('0x15'));var utils=require(_0xd793('0x16'));var config=require(_0xd793('0x17'));var licenseUtil=require(_0xd793('0x18'));var db=require(_0xd793('0x19'))['db'];function respondWithStatusCode(_0x15eb39,_0x45b39a){_0x45b39a=_0x45b39a||0xcc;return function(_0x1cc7d6){if(_0x1cc7d6){return _0x15eb39[_0xd793('0x1a')](_0x45b39a);}return _0x15eb39[_0xd793('0x1b')](_0x45b39a)[_0xd793('0x1c')]();};}function respondWithResult(_0x3694d1,_0x3496bb){_0x3496bb=_0x3496bb||0xc8;return function(_0x162d1e){if(_0x162d1e){return _0x3694d1[_0xd793('0x1b')](_0x3496bb)['json'](_0x162d1e);}};}function respondWithFilteredResult(_0x19d7a2,_0x3a8e23){return function(_0x1a4a82){if(_0x1a4a82){var _0x3387f1=typeof _0x3a8e23[_0xd793('0x1d')]===_0xd793('0x1e')&&typeof _0x3a8e23[_0xd793('0x1f')]===_0xd793('0x1e');var _0x192909=_0x1a4a82[_0xd793('0x20')];var _0x11d6ec=_0x3387f1?0x0:_0x3a8e23[_0xd793('0x1d')];var _0x5970c0=_0x3387f1?_0x1a4a82[_0xd793('0x20')]:_0x3a8e23[_0xd793('0x1d')]+_0x3a8e23[_0xd793('0x1f')];var _0x2c64c8;if(_0x5970c0>=_0x192909){_0x5970c0=_0x192909;_0x2c64c8=0xc8;}else{_0x2c64c8=0xce;}_0x19d7a2['status'](_0x2c64c8);return _0x19d7a2[_0xd793('0x21')](_0xd793('0x22'),_0x11d6ec+'-'+_0x5970c0+'/'+_0x192909)['json'](_0x1a4a82);}return null;};}function patchUpdates(_0x1d0e16){return function(_0x40d523){try{jsonpatch[_0xd793('0x23')](_0x40d523,_0x1d0e16,!![]);}catch(_0x1762cf){return BPromise['reject'](_0x1762cf);}return _0x40d523[_0xd793('0x24')]();};}function saveUpdates(_0x4b326e,_0xe05a4b){return function(_0xacf942){if(_0xacf942){return _0xacf942[_0xd793('0x25')](_0x4b326e)[_0xd793('0x26')](function(_0x4b4423){return _0x4b4423;});}return null;};}function removeEntity(_0x562b30,_0x15277c){return function(_0x1afd75){if(_0x1afd75){return _0x1afd75[_0xd793('0x27')]()[_0xd793('0x26')](function(){_0x562b30[_0xd793('0x1b')](0xcc)[_0xd793('0x1c')]();});}};}function handleEntityNotFound(_0x2afd4d,_0x974135){return function(_0x3794c7){if(!_0x3794c7){_0x2afd4d[_0xd793('0x1a')](0x194);}return _0x3794c7;};}function handleError(_0x4af623,_0x2682c8){_0x2682c8=_0x2682c8||0x1f4;return function(_0x21fbca){logger[_0xd793('0x28')](_0x21fbca['stack']);if(_0x21fbca[_0xd793('0x29')]){delete _0x21fbca[_0xd793('0x29')];}_0x4af623[_0xd793('0x1b')](_0x2682c8)[_0xd793('0x2a')](_0x21fbca);};}exports[_0xd793('0x2b')]=function(_0x18164f,_0x4774c8){var _0x5cc0da={},_0x2ff9c2={},_0x4f77fb={'count':0x0,'rows':[]};var _0x2bb8ea=_['map'](db[_0xd793('0x2c')][_0xd793('0x2d')],function(_0x5f1af7){return{'name':_0x5f1af7[_0xd793('0x2e')],'type':_0x5f1af7['type'][_0xd793('0x2f')]};});_0x2ff9c2[_0xd793('0x30')]=_['map'](_0x2bb8ea,_0xd793('0x29'));_0x2ff9c2[_0xd793('0x31')]=_[_0xd793('0x32')](_0x18164f[_0xd793('0x31')]);_0x2ff9c2[_0xd793('0x33')]=_[_0xd793('0x34')](_0x2ff9c2[_0xd793('0x30')],_0x2ff9c2['query']);_0x5cc0da['attributes']=_['intersection'](_0x2ff9c2[_0xd793('0x30')],qs[_0xd793('0x35')](_0x18164f['query']['fields']));_0x5cc0da[_0xd793('0x36')]=_0x5cc0da[_0xd793('0x36')][_0xd793('0x37')]?_0x5cc0da[_0xd793('0x36')]:_0x2ff9c2[_0xd793('0x30')];if(!_0x18164f[_0xd793('0x31')][_0xd793('0x38')](_0xd793('0x39'))){_0x5cc0da[_0xd793('0x1f')]=qs[_0xd793('0x1f')](_0x18164f[_0xd793('0x31')][_0xd793('0x1f')]);_0x5cc0da[_0xd793('0x1d')]=qs[_0xd793('0x1d')](_0x18164f[_0xd793('0x31')]['offset']);}_0x5cc0da[_0xd793('0x3a')]=qs[_0xd793('0x3b')](_0x18164f['query'][_0xd793('0x3b')]);_0x5cc0da[_0xd793('0x3c')]=qs[_0xd793('0x33')](_[_0xd793('0x3d')](_0x18164f[_0xd793('0x31')],_0x2ff9c2['filters']),_0x2bb8ea);if(_0x18164f[_0xd793('0x31')][_0xd793('0x3e')]){_0x5cc0da[_0xd793('0x3c')]=_[_0xd793('0x3f')](_0x5cc0da[_0xd793('0x3c')],{'$or':_[_0xd793('0x40')](_0x2bb8ea,function(_0x59d6a8){if(_0x59d6a8[_0xd793('0x41')]!==_0xd793('0x42')){var _0xebcdf1={};_0xebcdf1[_0x59d6a8[_0xd793('0x29')]]={'$like':'%'+_0x18164f['query']['filter']+'%'};return _0xebcdf1;}})});}_0x5cc0da=_[_0xd793('0x3f')]({},_0x5cc0da,_0x18164f[_0xd793('0x43')]);var _0x606f9f={'where':_0x5cc0da[_0xd793('0x3c')]};return db['VoiceTransferReport'][_0xd793('0x20')](_0x606f9f)['then'](function(_0x231281){_0x4f77fb[_0xd793('0x20')]=_0x231281;if(_0x18164f[_0xd793('0x31')][_0xd793('0x44')]){_0x5cc0da[_0xd793('0x45')]=[{'all':!![]}];}return db[_0xd793('0x2c')]['findAll'](_0x5cc0da);})[_0xd793('0x26')](function(_0x447864){_0x4f77fb[_0xd793('0x46')]=_0x447864;return _0x4f77fb;})[_0xd793('0x26')](respondWithFilteredResult(_0x4774c8,_0x5cc0da))[_0xd793('0x47')](handleError(_0x4774c8,null));};exports[_0xd793('0x48')]=function(_0x48051f,_0x1aa05b){var _0x27010b={'raw':!![],'where':{'id':_0x48051f['params']['id']}},_0x2ac576={};_0x2ac576[_0xd793('0x30')]=_[_0xd793('0x32')](db[_0xd793('0x2c')][_0xd793('0x2d')]);_0x2ac576[_0xd793('0x31')]=_['keys'](_0x48051f[_0xd793('0x31')]);_0x2ac576[_0xd793('0x33')]=_['intersection'](_0x2ac576[_0xd793('0x30')],_0x2ac576[_0xd793('0x31')]);_0x27010b[_0xd793('0x36')]=_[_0xd793('0x34')](_0x2ac576[_0xd793('0x30')],qs[_0xd793('0x35')](_0x48051f[_0xd793('0x31')][_0xd793('0x35')]));_0x27010b[_0xd793('0x36')]=_0x27010b['attributes'][_0xd793('0x37')]?_0x27010b[_0xd793('0x36')]:_0x2ac576[_0xd793('0x30')];if(_0x48051f[_0xd793('0x31')][_0xd793('0x44')]){_0x27010b[_0xd793('0x45')]=[{'all':!![]}];}_0x27010b=_[_0xd793('0x3f')]({},_0x27010b,_0x48051f[_0xd793('0x43')]);return db[_0xd793('0x2c')][_0xd793('0x49')](_0x27010b)['then'](handleEntityNotFound(_0x1aa05b,null))[_0xd793('0x26')](respondWithResult(_0x1aa05b,null))[_0xd793('0x47')](handleError(_0x1aa05b,null));};exports[_0xd793('0x4a')]=function(_0x4c7113,_0x3819b6){return db[_0xd793('0x2c')][_0xd793('0x4a')](_0x4c7113['body'],{})[_0xd793('0x26')](respondWithResult(_0x3819b6,0xc9))[_0xd793('0x47')](handleError(_0x3819b6,null));};exports['update']=function(_0x507ba8,_0x285b56){if(_0x507ba8['body']['id']){delete _0x507ba8['body']['id'];}return db[_0xd793('0x2c')][_0xd793('0x49')]({'where':{'id':_0x507ba8['params']['id']}})[_0xd793('0x26')](handleEntityNotFound(_0x285b56,null))[_0xd793('0x26')](saveUpdates(_0x507ba8[_0xd793('0x4b')],null))[_0xd793('0x26')](respondWithResult(_0x285b56,null))['catch'](handleError(_0x285b56,null));};exports[_0xd793('0x27')]=function(_0x387e8a,_0x1e76b8){return db[_0xd793('0x2c')][_0xd793('0x49')]({'where':{'id':_0x387e8a[_0xd793('0x4c')]['id']}})[_0xd793('0x26')](handleEntityNotFound(_0x1e76b8,null))[_0xd793('0x26')](removeEntity(_0x1e76b8,null))[_0xd793('0x47')](handleError(_0x1e76b8,null));};exports[_0xd793('0x4d')]=function(_0x3265b1,_0x598f95){return db[_0xd793('0x2c')][_0xd793('0x4d')]()[_0xd793('0x26')](respondWithResult(_0x598f95,null))[_0xd793('0x47')](handleError(_0x598f95,null));}; \ No newline at end of file +var _0x9998=['attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x9998,0x1de));var _0x8999=function(_0x421760,_0x2af572){_0x421760=_0x421760-0x0;var _0x1a8140=_0x9998[_0x421760];return _0x1a8140;};'use strict';var emlformat=require(_0x8999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8999('0x1'));var jsonpatch=require(_0x8999('0x2'));var rp=require(_0x8999('0x3'));var moment=require(_0x8999('0x4'));var BPromise=require(_0x8999('0x5'));var Mustache=require(_0x8999('0x6'));var util=require(_0x8999('0x7'));var path=require('path');var sox=require(_0x8999('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8999('0x9'));var _=require(_0x8999('0xa'));var squel=require(_0x8999('0xb'));var crypto=require(_0x8999('0xc'));var jsforce=require(_0x8999('0xd'));var deskjs=require(_0x8999('0xe'));var toCsv=require(_0x8999('0xf'));var querystring=require(_0x8999('0x10'));var Papa=require('papaparse');var Redis=require(_0x8999('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8999('0x12'));var hardwareService=require(_0x8999('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8999('0x14'));var config=require(_0x8999('0x15'));var licenseUtil=require(_0x8999('0x16'));var db=require(_0x8999('0x17'))['db'];function respondWithStatusCode(_0x392c04,_0x3d993b){_0x3d993b=_0x3d993b||0xcc;return function(_0x345002){if(_0x345002){return _0x392c04[_0x8999('0x18')](_0x3d993b);}return _0x392c04['status'](_0x3d993b)[_0x8999('0x19')]();};}function respondWithResult(_0x9294c0,_0x474cb5){_0x474cb5=_0x474cb5||0xc8;return function(_0x15b1d9){if(_0x15b1d9){return _0x9294c0[_0x8999('0x1a')](_0x474cb5)[_0x8999('0x1b')](_0x15b1d9);}};}function respondWithFilteredResult(_0x348467,_0x317aaf){return function(_0x2532b1){if(_0x2532b1){var _0x44ca7a=typeof _0x317aaf[_0x8999('0x1c')]===_0x8999('0x1d')&&typeof _0x317aaf[_0x8999('0x1e')]==='undefined';var _0x2991bd=_0x2532b1[_0x8999('0x1f')];var _0x7554ce=_0x44ca7a?0x0:_0x317aaf[_0x8999('0x1c')];var _0x5a8d99=_0x44ca7a?_0x2532b1[_0x8999('0x1f')]:_0x317aaf[_0x8999('0x1c')]+_0x317aaf[_0x8999('0x1e')];var _0x4f68e8;if(_0x5a8d99>=_0x2991bd){_0x5a8d99=_0x2991bd;_0x4f68e8=0xc8;}else{_0x4f68e8=0xce;}_0x348467[_0x8999('0x1a')](_0x4f68e8);return _0x348467[_0x8999('0x20')](_0x8999('0x21'),_0x7554ce+'-'+_0x5a8d99+'/'+_0x2991bd)[_0x8999('0x1b')](_0x2532b1);}return null;};}function patchUpdates(_0x250359){return function(_0x1ead97){try{jsonpatch[_0x8999('0x22')](_0x1ead97,_0x250359,!![]);}catch(_0xa80ff8){return BPromise[_0x8999('0x23')](_0xa80ff8);}return _0x1ead97[_0x8999('0x24')]();};}function saveUpdates(_0x230d1,_0x15cdb6){return function(_0x328c82){if(_0x328c82){return _0x328c82[_0x8999('0x25')](_0x230d1)[_0x8999('0x26')](function(_0x4b816f){return _0x4b816f;});}return null;};}function removeEntity(_0x6bab79,_0x5aeb58){return function(_0x3f442d){if(_0x3f442d){return _0x3f442d['destroy']()[_0x8999('0x26')](function(){_0x6bab79[_0x8999('0x1a')](0xcc)[_0x8999('0x19')]();});}};}function handleEntityNotFound(_0x68a1e6,_0x59c222){return function(_0x3f9982){if(!_0x3f9982){_0x68a1e6[_0x8999('0x18')](0x194);}return _0x3f9982;};}function handleError(_0x124fd2,_0x12d453){_0x12d453=_0x12d453||0x1f4;return function(_0x1ed79a){logger[_0x8999('0x27')](_0x1ed79a[_0x8999('0x28')]);if(_0x1ed79a['name']){delete _0x1ed79a[_0x8999('0x29')];}_0x124fd2['status'](_0x12d453)[_0x8999('0x2a')](_0x1ed79a);};}exports[_0x8999('0x2b')]=function(_0x162651,_0x248354){var _0x1ecd0e={},_0x15deb1={},_0x108268={'count':0x0,'rows':[]};var _0x1bcf73=_[_0x8999('0x2c')](db[_0x8999('0x2d')][_0x8999('0x2e')],function(_0x29df62){return{'name':_0x29df62[_0x8999('0x2f')],'type':_0x29df62[_0x8999('0x30')][_0x8999('0x31')]};});_0x15deb1[_0x8999('0x32')]=_['map'](_0x1bcf73,_0x8999('0x29'));_0x15deb1[_0x8999('0x33')]=_[_0x8999('0x34')](_0x162651[_0x8999('0x33')]);_0x15deb1['filters']=_[_0x8999('0x35')](_0x15deb1[_0x8999('0x32')],_0x15deb1['query']);_0x1ecd0e[_0x8999('0x36')]=_[_0x8999('0x35')](_0x15deb1[_0x8999('0x32')],qs[_0x8999('0x37')](_0x162651[_0x8999('0x33')][_0x8999('0x37')]));_0x1ecd0e[_0x8999('0x36')]=_0x1ecd0e[_0x8999('0x36')][_0x8999('0x38')]?_0x1ecd0e[_0x8999('0x36')]:_0x15deb1['model'];if(!_0x162651[_0x8999('0x33')]['hasOwnProperty']('nolimit')){_0x1ecd0e[_0x8999('0x1e')]=qs[_0x8999('0x1e')](_0x162651[_0x8999('0x33')][_0x8999('0x1e')]);_0x1ecd0e[_0x8999('0x1c')]=qs[_0x8999('0x1c')](_0x162651[_0x8999('0x33')][_0x8999('0x1c')]);}_0x1ecd0e[_0x8999('0x39')]=qs['sort'](_0x162651['query'][_0x8999('0x3a')]);_0x1ecd0e[_0x8999('0x3b')]=qs[_0x8999('0x3c')](_[_0x8999('0x3d')](_0x162651['query'],_0x15deb1[_0x8999('0x3c')]),_0x1bcf73);if(_0x162651['query'][_0x8999('0x3e')]){_0x1ecd0e[_0x8999('0x3b')]=_[_0x8999('0x3f')](_0x1ecd0e[_0x8999('0x3b')],{'$or':_[_0x8999('0x2c')](_0x1bcf73,function(_0x484443){if(_0x484443[_0x8999('0x30')]!==_0x8999('0x40')){var _0x2f31a8={};_0x2f31a8[_0x484443['name']]={'$like':'%'+_0x162651[_0x8999('0x33')][_0x8999('0x3e')]+'%'};return _0x2f31a8;}})});}_0x1ecd0e=_[_0x8999('0x3f')]({},_0x1ecd0e,_0x162651[_0x8999('0x41')]);var _0x4e5bb2={'where':_0x1ecd0e[_0x8999('0x3b')]};return db[_0x8999('0x2d')][_0x8999('0x1f')](_0x4e5bb2)['then'](function(_0x16790a){_0x108268['count']=_0x16790a;if(_0x162651['query'][_0x8999('0x42')]){_0x1ecd0e[_0x8999('0x43')]=[{'all':!![]}];}return db[_0x8999('0x2d')]['findAll'](_0x1ecd0e);})[_0x8999('0x26')](function(_0x3fcaee){_0x108268[_0x8999('0x44')]=_0x3fcaee;return _0x108268;})[_0x8999('0x26')](respondWithFilteredResult(_0x248354,_0x1ecd0e))[_0x8999('0x45')](handleError(_0x248354,null));};exports['show']=function(_0x48a180,_0x1cbbab){var _0x41464e={'raw':!![],'where':{'id':_0x48a180['params']['id']}},_0x419f94={};_0x419f94[_0x8999('0x32')]=_['keys'](db[_0x8999('0x2d')][_0x8999('0x2e')]);_0x419f94[_0x8999('0x33')]=_[_0x8999('0x34')](_0x48a180[_0x8999('0x33')]);_0x419f94[_0x8999('0x3c')]=_[_0x8999('0x35')](_0x419f94[_0x8999('0x32')],_0x419f94[_0x8999('0x33')]);_0x41464e['attributes']=_[_0x8999('0x35')](_0x419f94['model'],qs[_0x8999('0x37')](_0x48a180['query']['fields']));_0x41464e[_0x8999('0x36')]=_0x41464e[_0x8999('0x36')]['length']?_0x41464e[_0x8999('0x36')]:_0x419f94['model'];if(_0x48a180['query'][_0x8999('0x42')]){_0x41464e['include']=[{'all':!![]}];}_0x41464e=_[_0x8999('0x3f')]({},_0x41464e,_0x48a180[_0x8999('0x41')]);return db[_0x8999('0x2d')][_0x8999('0x46')](_0x41464e)[_0x8999('0x26')](handleEntityNotFound(_0x1cbbab,null))[_0x8999('0x26')](respondWithResult(_0x1cbbab,null))[_0x8999('0x45')](handleError(_0x1cbbab,null));};exports[_0x8999('0x47')]=function(_0x32e7ea,_0x241010){return db[_0x8999('0x2d')][_0x8999('0x47')](_0x32e7ea['body'],{})[_0x8999('0x26')](respondWithResult(_0x241010,0xc9))[_0x8999('0x45')](handleError(_0x241010,null));};exports[_0x8999('0x25')]=function(_0x218e07,_0xf948c6){if(_0x218e07[_0x8999('0x48')]['id']){delete _0x218e07['body']['id'];}return db[_0x8999('0x2d')]['find']({'where':{'id':_0x218e07[_0x8999('0x49')]['id']}})['then'](handleEntityNotFound(_0xf948c6,null))[_0x8999('0x26')](saveUpdates(_0x218e07[_0x8999('0x48')],null))['then'](respondWithResult(_0xf948c6,null))[_0x8999('0x45')](handleError(_0xf948c6,null));};exports[_0x8999('0x4a')]=function(_0x3a4cb1,_0x5ebd85){return db['VoiceTransferReport'][_0x8999('0x46')]({'where':{'id':_0x3a4cb1[_0x8999('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ebd85,null))[_0x8999('0x26')](removeEntity(_0x5ebd85,null))['catch'](handleError(_0x5ebd85,null));};exports['describe']=function(_0x4f737b,_0x36f475){return db[_0x8999('0x2d')][_0x8999('0x4b')]()[_0x8999('0x26')](respondWithResult(_0x36f475,null))[_0x8999('0x45')](handleError(_0x36f475,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 55ba2f9..3130492 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 _0xef7e=['VoiceTransferReport','report_call_transfer','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0xef7e,0x1ba));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeef7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeef7('0x1'));var moment=require(_0xeef7('0x2'));var BPromise=require(_0xeef7('0x3'));var rp=require(_0xeef7('0x4'));var fs=require('fs');var path=require(_0xeef7('0x5'));var rimraf=require(_0xeef7('0x6'));var config=require(_0xeef7('0x7'));var attributes=require(_0xeef7('0x8'));module['exports']=function(_0x4f404c,_0x1c5e23){return _0x4f404c['define'](_0xeef7('0x9'),attributes,{'tableName':_0xeef7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa98a=['bluebird','request-promise','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','lodash','../../config/logger','moment'];(function(_0x5289d6,_0x7bd6d2){var _0x52b145=function(_0x11fb06){while(--_0x11fb06){_0x5289d6['push'](_0x5289d6['shift']());}};_0x52b145(++_0x7bd6d2);}(_0xa98a,0x1ec));var _0xaa98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa98a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaa98('0x0'));var util=require('util');var logger=require(_0xaa98('0x1'))('api');var moment=require(_0xaa98('0x2'));var BPromise=require(_0xaa98('0x3'));var rp=require(_0xaa98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa98('0x5'));var attributes=require(_0xaa98('0x6'));module['exports']=function(_0x27be0c,_0x3c314f){return _0x27be0c[_0xaa98('0x7')](_0xaa98('0x8'),attributes,{'tableName':'report_call_transfer','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 486b28e..3b8ef8c 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 _0x2d9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','body','options','CreateVoiceTransferReport','debug','lodash','util','moment','randomstring'];(function(_0x1dc858,_0x5061e6){var _0x56477f=function(_0x349e19){while(--_0x349e19){_0x1dc858['push'](_0x1dc858['shift']());}};_0x56477f(++_0x5061e6);}(_0x2d9e,0x1cc));var _0xe2d9=function(_0x12c27b,_0x39730c){_0x12c27b=_0x12c27b-0x0;var _0x46fd34=_0x2d9e[_0x12c27b];return _0x46fd34;};'use strict';var _=require(_0xe2d9('0x0'));var util=require(_0xe2d9('0x1'));var moment=require(_0xe2d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2d9('0x3'));var fs=require('fs');var Redis=require(_0xe2d9('0x4'));var db=require(_0xe2d9('0x5'))['db'];var utils=require(_0xe2d9('0x6'));var logger=require(_0xe2d9('0x7'))(_0xe2d9('0x8'));var config=require(_0xe2d9('0x9'));var jayson=require(_0xe2d9('0xa'));var client=jayson[_0xe2d9('0xb')][_0xe2d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13ece5,_0x407031,_0x24def4){return new BPromise(function(_0x196976,_0x57eeff){return client['request'](_0x13ece5,_0x24def4)[_0xe2d9('0xd')](function(_0x45c381){logger['info'](_0xe2d9('0xe'),_0x407031,_0xe2d9('0xf'));logger['debug'](_0xe2d9('0x10'),_0x407031,_0xe2d9('0xf'),JSON[_0xe2d9('0x11')](_0x45c381));if(_0x45c381[_0xe2d9('0x12')]){if(_0x45c381[_0xe2d9('0x12')][_0xe2d9('0x13')]===0x1f4){logger[_0xe2d9('0x12')](_0xe2d9('0xe'),_0x407031,_0x45c381['error'][_0xe2d9('0x14')]);return _0x57eeff(_0x45c381[_0xe2d9('0x12')][_0xe2d9('0x14')]);}logger[_0xe2d9('0x12')](_0xe2d9('0xe'),_0x407031,_0x45c381[_0xe2d9('0x12')][_0xe2d9('0x14')]);return _0x196976(_0x45c381[_0xe2d9('0x12')]['message']);}else{logger[_0xe2d9('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x407031,_0xe2d9('0xf'));_0x196976(_0x45c381[_0xe2d9('0x16')][_0xe2d9('0x14')]);}})[_0xe2d9('0x17')](function(_0x5236a5){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x407031,_0x5236a5);_0x57eeff(_0x5236a5);});});}exports['CreateVoiceTransferReport']=function(_0x135c4b){var _0x49e3ef=this;return new Promise(function(_0x2c9349,_0xda9f2c){return db['VoiceTransferReport'][_0xe2d9('0x18')](_0x135c4b[_0xe2d9('0x19')],{'raw':_0x135c4b[_0xe2d9('0x1a')]?_0x135c4b[_0xe2d9('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xe2d9('0xd')](function(_0x36e87f){logger[_0xe2d9('0x15')](_0xe2d9('0x1b'),_0x135c4b);logger[_0xe2d9('0x1c')](_0xe2d9('0x1b'),_0x135c4b,JSON['stringify'](_0x36e87f));_0x2c9349(_0x36e87f);})[_0xe2d9('0x17')](function(_0x766107){logger[_0xe2d9('0x12')](_0xe2d9('0x1b'),_0x766107['message'],_0x135c4b);_0xda9f2c(_0x49e3ef[_0xe2d9('0x12')](0x1f4,_0x766107[_0xe2d9('0x14')]));});});}; \ No newline at end of file +var _0x2558=['create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport'];(function(_0x34736b,_0x5cd82c){var _0x313218=function(_0x50864f){while(--_0x50864f){_0x34736b['push'](_0x34736b['shift']());}};_0x313218(++_0x5cd82c);}(_0x2558,0x162));var _0x8255=function(_0x3ca9d8,_0x13968b){_0x3ca9d8=_0x3ca9d8-0x0;var _0x2785ad=_0x2558[_0x3ca9d8];return _0x2785ad;};'use strict';var _=require('lodash');var util=require(_0x8255('0x0'));var moment=require(_0x8255('0x1'));var BPromise=require('bluebird');var rs=require(_0x8255('0x2'));var fs=require('fs');var Redis=require(_0x8255('0x3'));var db=require(_0x8255('0x4'))['db'];var utils=require(_0x8255('0x5'));var logger=require(_0x8255('0x6'))(_0x8255('0x7'));var config=require(_0x8255('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a0506,_0xd1d5bd,_0x56b447){return new BPromise(function(_0x7952ea,_0x3aa6e5){return client['request'](_0x4a0506,_0x56b447)[_0x8255('0xa')](function(_0x4b5e62){logger[_0x8255('0xb')](_0x8255('0xc'),_0xd1d5bd,_0x8255('0xd'));logger[_0x8255('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xd1d5bd,_0x8255('0xd'),JSON[_0x8255('0xf')](_0x4b5e62));if(_0x4b5e62[_0x8255('0x10')]){if(_0x4b5e62[_0x8255('0x10')][_0x8255('0x11')]===0x1f4){logger['error'](_0x8255('0xc'),_0xd1d5bd,_0x4b5e62[_0x8255('0x10')][_0x8255('0x12')]);return _0x3aa6e5(_0x4b5e62['error'][_0x8255('0x12')]);}logger['error'](_0x8255('0xc'),_0xd1d5bd,_0x4b5e62[_0x8255('0x10')][_0x8255('0x12')]);return _0x7952ea(_0x4b5e62['error'][_0x8255('0x12')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0xd1d5bd,_0x8255('0xd'));_0x7952ea(_0x4b5e62['result'][_0x8255('0x12')]);}})[_0x8255('0x13')](function(_0x396a55){logger[_0x8255('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0xd1d5bd,_0x396a55);_0x3aa6e5(_0x396a55);});});}exports[_0x8255('0x14')]=function(_0x4f7cf5){var _0x427383=this;return new Promise(function(_0x5cfef5,_0x571e62){return db['VoiceTransferReport'][_0x8255('0x15')](_0x4f7cf5[_0x8255('0x16')],{'raw':_0x4f7cf5[_0x8255('0x17')]?_0x4f7cf5[_0x8255('0x17')][_0x8255('0x18')]===undefined?!![]:![]:!![]})[_0x8255('0xa')](function(_0x43157c){logger[_0x8255('0xb')](_0x8255('0x14'),_0x4f7cf5);logger[_0x8255('0xe')](_0x8255('0x14'),_0x4f7cf5,JSON['stringify'](_0x43157c));_0x5cfef5(_0x43157c);})['catch'](function(_0x16046d){logger[_0x8255('0x10')](_0x8255('0x14'),_0x16046d[_0x8255('0x12')],_0x4f7cf5);_0x571e62(_0x427383[_0x8255('0x10')](0x1f4,_0x16046d[_0x8255('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 1c7bc3a..ae3eb5d 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 _0x008c=['/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','/calls','calls'];(function(_0x33e9f3,_0x501c97){var _0x2b0836=function(_0x47d970){while(--_0x47d970){_0x33e9f3['push'](_0x33e9f3['shift']());}};_0x2b0836(++_0x501c97);}(_0x008c,0x188));var _0xc008=function(_0x26793a,_0x49cf51){_0x26793a=_0x26793a-0x0;var _0x575efb=_0x008c[_0x26793a];return _0x575efb;};'use strict';var express=require(_0xc008('0x0'));var router=express[_0xc008('0x1')]();var auth=require(_0xc008('0x2'));var controller=require(_0xc008('0x3'));router[_0xc008('0x4')]('/originate',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x7')]);router[_0xc008('0x4')](_0xc008('0x8'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x9')]);router[_0xc008('0x4')]('/answer',auth[_0xc008('0x5')](),auth['isWebrtcLicence'](),controller[_0xc008('0xa')]);router['post']('/hold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['hold']);router['post']('/unhold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['unhold']);router[_0xc008('0x4')](_0xc008('0xb'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0xc')]);router[_0xc008('0x4')](_0xc008('0xd'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x5428f5,_0x363285){var _0xf745ce=function(_0x16dbe2){while(--_0x16dbe2){_0x5428f5['push'](_0x5428f5['shift']());}};_0xf745ce(++_0x363285);}(_0xe14d,0x1ee));var _0xde14=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe14d[_0x311c35];return _0x5cc50c;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0430fd0..e5bc566 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 _0x4c6d=['webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','webbarapi','ioredis','defaults','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','send','status','request','then','error','code','message','result','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer\x20fired:','webbar:answer','hold','hold\x20fired:'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x541056,_0x45e57d){_0x541056=_0x541056-0x0;var _0x23235b=_0x4c6d[_0x541056];return _0x23235b;};'use strict';var path=require(_0xd4c6('0x0'));var fs=require('fs');var _=require(_0xd4c6('0x1'));var db=require(_0xd4c6('0x2'))['db'];var config=require(_0xd4c6('0x3'));var util=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var jayson=require(_0xd4c6('0x5'));var amiClient=jayson[_0xd4c6('0x6')][_0xd4c6('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xd4c6('0x8'));var Redis=require(_0xd4c6('0x9'));config['redis']=_[_0xd4c6('0xa')](config[_0xd4c6('0xb')],{'host':_0xd4c6('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd4c6('0xb')]));var Schema=require(_0xd4c6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xd4c6('0xf'),'required':[!![],_0xd4c6('0x10')]},'callerId':{'type':_0xd4c6('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xd4c6('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xd4c6('0xf'),'required':[!![],_0xd4c6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd4c6('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]}});function emit(_0x25204d,_0x3cb95c,_0x3da1f4){logger[_0xd4c6('0x13')](_0x25204d,_0x3cb95c,JSON['stringify'](_0x3da1f4));io['to'](_0x25204d)[_0xd4c6('0x14')](_0x3cb95c,_0x3da1f4);}function handleError(_0x44126c){return function(_0x23a16f){console[_0xd4c6('0x15')](_0xd4c6('0x16'),_0x23a16f,_0x23a16f instanceof RangeError);logger['error'](_0x23a16f[_0xd4c6('0x17')]);if(_0x23a16f instanceof RangeError){if(_0x23a16f[_0xd4c6('0x18')]){delete _0x23a16f[_0xd4c6('0x18')];}_0x44126c['status'](0x194)[_0xd4c6('0x19')](_0x23a16f);}else{if(_0x23a16f[_0xd4c6('0x18')]){delete _0x23a16f[_0xd4c6('0x18')];}_0x44126c[_0xd4c6('0x1a')](0x1f4)['send'](_0x23a16f);}};}function checkError(){return function(_0x1c8427){if(!_0x1c8427){throw new RangeError('NotFound');}return _0x1c8427;};}function respondWithRpcPromise(_0x37f552,_0x150e28){return new BPromise(function(_0x2750c9,_0x222813){var _0xf536e0=amiClient;return _0xf536e0[_0xd4c6('0x1b')](_0x37f552,_0x150e28)[_0xd4c6('0x1c')](function(_0x3f99e8){if(_0x3f99e8[_0xd4c6('0x1d')]){if(_0x3f99e8[_0xd4c6('0x1d')][_0xd4c6('0x1e')]===0x1f4){return _0x222813(_0x3f99e8[_0xd4c6('0x1d')]['message']);}return _0x2750c9(_0x3f99e8['error'][_0xd4c6('0x1f')]);}else{_0x2750c9(_0x3f99e8[_0xd4c6('0x20')]);}})['catch'](function(_0x1dee19){_0x222813(_0x1dee19);});});}function getAgent(_0x3a2c50){return db[_0xd4c6('0x21')]['findOne']({'where':{'id':_0x3a2c50,'role':_0xd4c6('0x22')}})[_0xd4c6('0x1c')](checkError());}function getAgentCheckSession(_0x5614f3,_0x406ed0){return new BPromise(function(_0x8ce066,_0x25ea15){var _0x488e7e=respondWithRpcPromise(_0xd4c6('0x23'));var _0x3b656d=getAgent(_0x5614f3);Promise[_0xd4c6('0x24')]([_0x488e7e,_0x3b656d])[_0xd4c6('0x1c')](function(_0x2e8c34){var _0x160330=_0x2e8c34[0x0];var _0x41a8d2=_0x2e8c34[0x1];var _0x1f32d8=_[_0xd4c6('0x25')](_0x160330[_0xd4c6('0x26')],function(_0x441119){return _0x441119[_0xd4c6('0x27')]==_0x41a8d2['id']&&_0x441119[_0xd4c6('0x28')]==_0x406ed0;});if(_0x1f32d8[_0xd4c6('0x29')]==0x1){_0x8ce066(_0x41a8d2);}else{_0x25ea15(new RangeError('sessionId\x20'+_0x406ed0+_0xd4c6('0x2a')));}});});}exports[_0xd4c6('0x2b')]=function(_0x32deb7,_0x38d423){logger['info']('originate\x20fired:',_0x32deb7['body']);var _0x103ac3=originateValidation[_0xd4c6('0xd')](_0x32deb7[_0xd4c6('0x2c')]);if(_0x103ac3[_0xd4c6('0x29')]>0x0){return _0x38d423[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x103ac3);}var _0x1615ff=_0x32deb7['body'][_0xd4c6('0x2e')];var _0x3ae596=_0x32deb7[_0xd4c6('0x2c')]['callNumber'];var _0x24a716=_0x32deb7[_0xd4c6('0x2c')][_0xd4c6('0x2f')];var _0x4c69af=_0x32deb7[_0xd4c6('0x2c')][_0xd4c6('0x30')];return getAgent(_0x1615ff)[_0xd4c6('0x1c')](function(_0xe5aa2d){logger['info'](_0xd4c6('0x31'),_0xe5aa2d[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')](_0xd4c6('0x33'),_0xe5aa2d[_0xd4c6('0x18')]),'webbar:originate',{'callNumber':_0x3ae596,'callerId':_0x24a716,'callbackUrl':_0x4c69af});return _0x38d423[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x34')});})[_0xd4c6('0x35')](handleError(_0x38d423));};exports[_0xd4c6('0x36')]=function(_0x2cdb9d,_0x554666){logger[_0xd4c6('0x13')](_0xd4c6('0x37'),_0x2cdb9d[_0xd4c6('0x2c')]);var _0x5f4060=hangupValidation[_0xd4c6('0xd')](_0x2cdb9d[_0xd4c6('0x2c')]);if(_0x5f4060[_0xd4c6('0x29')]>0x0){return _0x554666[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5f4060);}var _0x20a4e8=_0x2cdb9d[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x2e1768=_0x2cdb9d['body'][_0xd4c6('0x28')];return getAgent(_0x20a4e8)['then'](function(_0x55063c){logger[_0xd4c6('0x13')](_0xd4c6('0x31'),_0x55063c[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')](_0xd4c6('0x33'),_0x55063c['name']),'webbar:hangup',{'sessionId':_0x2e1768});return _0x554666[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x38')});})[_0xd4c6('0x35')](handleError(_0x554666));};exports['answer']=function(_0x211d47,_0x494811){logger[_0xd4c6('0x13')](_0xd4c6('0x39'),_0x211d47[_0xd4c6('0x2c')]);var _0x51585c=answerValidation[_0xd4c6('0xd')](_0x211d47[_0xd4c6('0x2c')]);if(_0x51585c[_0xd4c6('0x29')]>0x0){return _0x494811[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x51585c);}var _0x3ef1b0=_0x211d47[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x343d94=_0x211d47['body'][_0xd4c6('0x28')];return getAgent(_0x3ef1b0)[_0xd4c6('0x1c')](function(_0xefcd5){logger['info'](_0xd4c6('0x31'),_0xefcd5[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')]('user:%s',_0xefcd5['name']),_0xd4c6('0x3a'),{'sessionId':_0x343d94});return _0x494811[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':'answer\x20executed!'});})[_0xd4c6('0x35')](handleError(_0x494811));};exports[_0xd4c6('0x3b')]=function(_0x1a53e9,_0x258a95){logger[_0xd4c6('0x13')](_0xd4c6('0x3c'),_0x1a53e9['body']);var _0x22298a=holdValidation[_0xd4c6('0xd')](_0x1a53e9[_0xd4c6('0x2c')]);if(_0x22298a[_0xd4c6('0x29')]>0x0){return _0x258a95[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x22298a);}var _0x34fb42=_0x1a53e9[_0xd4c6('0x2c')]['userId'];var _0x4f26fc=_0x1a53e9[_0xd4c6('0x2c')][_0xd4c6('0x28')];return getAgent(_0x34fb42)[_0xd4c6('0x1c')](function(_0x5bb875){logger[_0xd4c6('0x13')](_0xd4c6('0x31'),_0x5bb875[_0xd4c6('0x18')]);emit(util['format'](_0xd4c6('0x33'),_0x5bb875[_0xd4c6('0x18')]),_0xd4c6('0x3d'),{'sessionId':_0x4f26fc});return _0x258a95[_0xd4c6('0x1a')](0xc8)['json']({'error':![],'message':_0xd4c6('0x3e')});})[_0xd4c6('0x35')](handleError(_0x258a95));};exports[_0xd4c6('0x3f')]=function(_0x14279d,_0x291837){logger[_0xd4c6('0x13')](_0xd4c6('0x40'),_0x14279d['body']);var _0x304f96=unholdValidation[_0xd4c6('0xd')](_0x14279d[_0xd4c6('0x2c')]);if(_0x304f96['length']>0x0){return _0x291837[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x304f96);}var _0x46bf10=_0x14279d[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x3e6df8=_0x14279d[_0xd4c6('0x2c')]['sessionId'];return getAgent(_0x46bf10)[_0xd4c6('0x1c')](function(_0x4a3092){logger['info'](_0xd4c6('0x31'),_0x4a3092['name']);emit(util[_0xd4c6('0x32')]('user:%s',_0x4a3092[_0xd4c6('0x18')]),'webbar:unhold',{'sessionId':_0x3e6df8});return _0x291837['status'](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x41')});})[_0xd4c6('0x35')](handleError(_0x291837));};exports[_0xd4c6('0x42')]=function(_0x5639b6,_0x241e6c){logger[_0xd4c6('0x13')](_0xd4c6('0x43'),_0x241e6c[_0xd4c6('0x2c')]);var _0x5e52db=callsValidation[_0xd4c6('0xd')](_0x5639b6[_0xd4c6('0x2c')]);if(_0x5e52db[_0xd4c6('0x29')]>0x0){return _0x241e6c[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5e52db);}var _0x1525a4=_0x5639b6[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x106710=respondWithRpcPromise(_0xd4c6('0x23'));var _0xe07a2d=getAgent(_0x1525a4);return Promise['all']([_0x106710,_0xe07a2d])['then'](function(_0x2dab4a){var _0x11c37d=_0x2dab4a[0x0];var _0x558ce2=_0x2dab4a[0x1];var _0x5179af=_['filter'](_0x11c37d[_0xd4c6('0x26')],function(_0x218250){return _0x218250['UserId']==_0x558ce2['id'];});return _0x241e6c['status'](0xc8)[_0xd4c6('0x2d')]({'count':_0x5179af[_0xd4c6('0x29')],'rows':_0x5179af});})[_0xd4c6('0x35')](handleError(_0x241e6c));};exports[_0xd4c6('0x44')]=function(_0x226549,_0x516e12){logger[_0xd4c6('0x13')](_0xd4c6('0x45'),_0x226549[_0xd4c6('0x2c')]);var _0x26cff1=conferenceValidation[_0xd4c6('0xd')](_0x226549[_0xd4c6('0x2c')]);if(_0x26cff1[_0xd4c6('0x29')]>0x0){return _0x516e12[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x26cff1);}var _0x20b5b9=_0x226549[_0xd4c6('0x2c')][_0xd4c6('0x2e')];return getAgent(_0x20b5b9)[_0xd4c6('0x1c')](function(_0x5a0400){logger['info'](_0xd4c6('0x31'),_0x5a0400['name']);emit(util['format']('user:%s',_0x5a0400[_0xd4c6('0x18')]),_0xd4c6('0x46'));return _0x516e12[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0xd4c6('0x35')](handleError(_0x516e12));};exports[_0xd4c6('0x47')]=function(_0x53dcea,_0x705041){logger[_0xd4c6('0x13')](_0xd4c6('0x48'),_0x53dcea[_0xd4c6('0x2c')]);var _0x5cf823=transferValidation[_0xd4c6('0xd')](_0x53dcea[_0xd4c6('0x2c')]);if(_0x5cf823['length']>0x0){return _0x705041[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5cf823);}var _0x5ae295=_0x53dcea[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x4cdf5f=_0x53dcea[_0xd4c6('0x2c')]['sessionId'];var _0x7aef4=_0x53dcea[_0xd4c6('0x2c')][_0xd4c6('0x49')];return getAgent(_0x5ae295)[_0xd4c6('0x1c')](function(_0x2a8448){logger[_0xd4c6('0x13')]('entityFound:',_0x2a8448[_0xd4c6('0x18')]);emit(util['format'](_0xd4c6('0x33'),_0x2a8448[_0xd4c6('0x18')]),'webbar:transfer',{'sessionId':_0x4cdf5f,'transferNumber':_0x7aef4});return _0x705041[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x4a')});})['catch'](handleError(_0x705041));}; \ No newline at end of file +var _0x1306=['name','status','send','code','catch','User','agent','VoiceChannels','all','then','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','log','handleError:','error','stack'];(function(_0xefe2f5,_0x8ebc50){var _0x2fc476=function(_0x41c678){while(--_0x41c678){_0xefe2f5['push'](_0xefe2f5['shift']());}};_0x2fc476(++_0x8ebc50);}(_0x1306,0x17a));var _0x6130=function(_0x41322e,_0x4d50d8){_0x41322e=_0x41322e-0x0;var _0x89ab22=_0x1306[_0x41322e];return _0x89ab22;};'use strict';var path=require(_0x6130('0x0'));var fs=require('fs');var _=require(_0x6130('0x1'));var db=require(_0x6130('0x2'))['db'];var config=require(_0x6130('0x3'));var util=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var jayson=require(_0x6130('0x6'));var amiClient=jayson[_0x6130('0x7')][_0x6130('0x8')]({'port':0x232a});var logger=require(_0x6130('0x9'))(_0x6130('0xa'));var Redis=require(_0x6130('0xb'));config[_0x6130('0xc')]=_[_0x6130('0xd')](config[_0x6130('0xc')],{'host':_0x6130('0xe'),'port':0x18eb});var io=require(_0x6130('0xf'))(new Redis(config[_0x6130('0xc')]));var Schema=require(_0x6130('0x10'));var originateValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'callNumber':{'type':_0x6130('0x13'),'required':[!![],_0x6130('0x14')]},'callerId':{'type':_0x6130('0x13')},'callbackUrl':{'type':_0x6130('0x13')}});var hangupValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x6130('0x13'),'required':[!![],_0x6130('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]},'sessionId':{'type':_0x6130('0x13'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0x6130('0x11'),'required':[!![],_0x6130('0x12')]}});function emit(_0x39b444,_0x274659,_0x3298f0){logger[_0x6130('0x16')](_0x39b444,_0x274659,JSON['stringify'](_0x3298f0));io['to'](_0x39b444)['emit'](_0x274659,_0x3298f0);}function handleError(_0x1f80e0){return function(_0x49803e){console[_0x6130('0x17')](_0x6130('0x18'),_0x49803e,_0x49803e instanceof RangeError);logger[_0x6130('0x19')](_0x49803e[_0x6130('0x1a')]);if(_0x49803e instanceof RangeError){if(_0x49803e[_0x6130('0x1b')]){delete _0x49803e['name'];}_0x1f80e0[_0x6130('0x1c')](0x194)['send'](_0x49803e);}else{if(_0x49803e[_0x6130('0x1b')]){delete _0x49803e[_0x6130('0x1b')];}_0x1f80e0[_0x6130('0x1c')](0x1f4)[_0x6130('0x1d')](_0x49803e);}};}function checkError(){return function(_0x42f498){if(!_0x42f498){throw new RangeError('NotFound');}return _0x42f498;};}function respondWithRpcPromise(_0x5be413,_0x2c01cd){return new BPromise(function(_0x534390,_0x30b4f2){var _0x289c7b=amiClient;return _0x289c7b['request'](_0x5be413,_0x2c01cd)['then'](function(_0x54fc67){if(_0x54fc67[_0x6130('0x19')]){if(_0x54fc67['error'][_0x6130('0x1e')]===0x1f4){return _0x30b4f2(_0x54fc67['error']['message']);}return _0x534390(_0x54fc67['error']['message']);}else{_0x534390(_0x54fc67['result']);}})[_0x6130('0x1f')](function(_0x1ba07d){_0x30b4f2(_0x1ba07d);});});}function getAgent(_0x4d7442){return db[_0x6130('0x20')]['findOne']({'where':{'id':_0x4d7442,'role':_0x6130('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x5787a6,_0x9196d1){return new BPromise(function(_0x456231,_0x401a31){var _0x2997fd=respondWithRpcPromise(_0x6130('0x22'));var _0x392386=getAgent(_0x5787a6);Promise[_0x6130('0x23')]([_0x2997fd,_0x392386])[_0x6130('0x24')](function(_0x14dff0){var _0x5809e4=_0x14dff0[0x0];var _0x5363cc=_0x14dff0[0x1];var _0x383c56=_[_0x6130('0x25')](_0x5809e4[_0x6130('0x26')],function(_0x4345ac){return _0x4345ac[_0x6130('0x27')]==_0x5363cc['id']&&_0x4345ac['sessionId']==_0x9196d1;});if(_0x383c56[_0x6130('0x28')]==0x1){_0x456231(_0x5363cc);}else{_0x401a31(new RangeError(_0x6130('0x29')+_0x9196d1+_0x6130('0x2a')));}});});}exports[_0x6130('0x2b')]=function(_0x76dfa6,_0x4cf1d3){logger[_0x6130('0x16')](_0x6130('0x2c'),_0x76dfa6[_0x6130('0x2d')]);var _0x4b0c9c=originateValidation[_0x6130('0x10')](_0x76dfa6[_0x6130('0x2d')]);if(_0x4b0c9c[_0x6130('0x28')]>0x0){return _0x4cf1d3[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x4b0c9c);}var _0x6389a3=_0x76dfa6[_0x6130('0x2d')][_0x6130('0x2f')];var _0x25fabf=_0x76dfa6['body'][_0x6130('0x30')];var _0x4df5ed=_0x76dfa6['body']['callerId'];var _0x1ffc85=_0x76dfa6[_0x6130('0x2d')][_0x6130('0x31')];return getAgent(_0x6389a3)[_0x6130('0x24')](function(_0x438cde){logger[_0x6130('0x16')](_0x6130('0x32'),_0x438cde[_0x6130('0x1b')]);emit(util['format'](_0x6130('0x33'),_0x438cde[_0x6130('0x1b')]),'webbar:originate',{'callNumber':_0x25fabf,'callerId':_0x4df5ed,'callbackUrl':_0x1ffc85});return _0x4cf1d3[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x34')});})['catch'](handleError(_0x4cf1d3));};exports[_0x6130('0x35')]=function(_0x147663,_0x501630){logger['info'](_0x6130('0x36'),_0x147663[_0x6130('0x2d')]);var _0x3b1f14=hangupValidation['validate'](_0x147663['body']);if(_0x3b1f14[_0x6130('0x28')]>0x0){return _0x501630[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x3b1f14);}var _0x7d3014=_0x147663[_0x6130('0x2d')][_0x6130('0x2f')];var _0x167b31=_0x147663['body'][_0x6130('0x37')];return getAgent(_0x7d3014)[_0x6130('0x24')](function(_0x101aab){logger[_0x6130('0x16')](_0x6130('0x32'),_0x101aab[_0x6130('0x1b')]);emit(util[_0x6130('0x38')]('user:%s',_0x101aab[_0x6130('0x1b')]),_0x6130('0x39'),{'sessionId':_0x167b31});return _0x501630[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x3a')});})[_0x6130('0x1f')](handleError(_0x501630));};exports[_0x6130('0x3b')]=function(_0x7e02ef,_0x566e43){logger[_0x6130('0x16')](_0x6130('0x3c'),_0x7e02ef[_0x6130('0x2d')]);var _0x4c727b=answerValidation[_0x6130('0x10')](_0x7e02ef[_0x6130('0x2d')]);if(_0x4c727b[_0x6130('0x28')]>0x0){return _0x566e43['status'](0x190)['json'](_0x4c727b);}var _0x3ee3f8=_0x7e02ef[_0x6130('0x2d')][_0x6130('0x2f')];var _0xd87943=_0x7e02ef[_0x6130('0x2d')]['sessionId'];return getAgent(_0x3ee3f8)[_0x6130('0x24')](function(_0xef11b5){logger['info'](_0x6130('0x32'),_0xef11b5[_0x6130('0x1b')]);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0xef11b5[_0x6130('0x1b')]),_0x6130('0x3d'),{'sessionId':_0xd87943});return _0x566e43[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x566e43));};exports[_0x6130('0x3e')]=function(_0x534a67,_0x28fb1f){logger[_0x6130('0x16')](_0x6130('0x3f'),_0x534a67[_0x6130('0x2d')]);var _0x15adfd=holdValidation[_0x6130('0x10')](_0x534a67[_0x6130('0x2d')]);if(_0x15adfd[_0x6130('0x28')]>0x0){return _0x28fb1f[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x15adfd);}var _0x3936a8=_0x534a67['body'][_0x6130('0x2f')];var _0x134198=_0x534a67[_0x6130('0x2d')][_0x6130('0x37')];return getAgent(_0x3936a8)[_0x6130('0x24')](function(_0x13f591){logger[_0x6130('0x16')](_0x6130('0x32'),_0x13f591[_0x6130('0x1b')]);emit(util[_0x6130('0x38')]('user:%s',_0x13f591[_0x6130('0x1b')]),_0x6130('0x40'),{'sessionId':_0x134198});return _0x28fb1f[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x41')});})[_0x6130('0x1f')](handleError(_0x28fb1f));};exports[_0x6130('0x42')]=function(_0x37ee0c,_0x3a64ef){logger['info'](_0x6130('0x43'),_0x37ee0c[_0x6130('0x2d')]);var _0x1d0240=unholdValidation[_0x6130('0x10')](_0x37ee0c[_0x6130('0x2d')]);if(_0x1d0240[_0x6130('0x28')]>0x0){return _0x3a64ef['status'](0x190)[_0x6130('0x2e')](_0x1d0240);}var _0x1cbd0e=_0x37ee0c[_0x6130('0x2d')]['userId'];var _0x4f5207=_0x37ee0c['body']['sessionId'];return getAgent(_0x1cbd0e)[_0x6130('0x24')](function(_0xa9b10a){logger[_0x6130('0x16')]('entityFound:',_0xa9b10a['name']);emit(util['format']('user:%s',_0xa9b10a[_0x6130('0x1b')]),_0x6130('0x44'),{'sessionId':_0x4f5207});return _0x3a64ef[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x45')});})['catch'](handleError(_0x3a64ef));};exports[_0x6130('0x46')]=function(_0x305d99,_0x49e3cf){logger[_0x6130('0x16')](_0x6130('0x47'),_0x49e3cf[_0x6130('0x2d')]);var _0x32bf20=callsValidation[_0x6130('0x10')](_0x305d99[_0x6130('0x2d')]);if(_0x32bf20[_0x6130('0x28')]>0x0){return _0x49e3cf[_0x6130('0x1c')](0x190)['json'](_0x32bf20);}var _0x159ff8=_0x305d99[_0x6130('0x2d')][_0x6130('0x2f')];var _0x4934ca=respondWithRpcPromise('VoiceChannels');var _0x1b4f82=getAgent(_0x159ff8);return Promise[_0x6130('0x23')]([_0x4934ca,_0x1b4f82])[_0x6130('0x24')](function(_0xc253f){var _0x37b89b=_0xc253f[0x0];var _0x519a0c=_0xc253f[0x1];var _0x29630a=_[_0x6130('0x25')](_0x37b89b[_0x6130('0x26')],function(_0x372c53){return _0x372c53[_0x6130('0x27')]==_0x519a0c['id'];});return _0x49e3cf[_0x6130('0x1c')](0xc8)['json']({'count':_0x29630a['length'],'rows':_0x29630a});})[_0x6130('0x1f')](handleError(_0x49e3cf));};exports[_0x6130('0x48')]=function(_0x5c55cf,_0x442fee){logger[_0x6130('0x16')](_0x6130('0x49'),_0x5c55cf[_0x6130('0x2d')]);var _0x54c565=conferenceValidation[_0x6130('0x10')](_0x5c55cf[_0x6130('0x2d')]);if(_0x54c565[_0x6130('0x28')]>0x0){return _0x442fee[_0x6130('0x1c')](0x190)[_0x6130('0x2e')](_0x54c565);}var _0x198da8=_0x5c55cf[_0x6130('0x2d')][_0x6130('0x2f')];return getAgent(_0x198da8)['then'](function(_0x46f586){logger[_0x6130('0x16')](_0x6130('0x32'),_0x46f586[_0x6130('0x1b')]);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0x46f586['name']),_0x6130('0x4a'));return _0x442fee[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x4b')});})[_0x6130('0x1f')](handleError(_0x442fee));};exports[_0x6130('0x4c')]=function(_0x2d27e6,_0x31d20d){logger[_0x6130('0x16')](_0x6130('0x4d'),_0x2d27e6[_0x6130('0x2d')]);var _0x3a5876=transferValidation['validate'](_0x2d27e6['body']);if(_0x3a5876['length']>0x0){return _0x31d20d['status'](0x190)['json'](_0x3a5876);}var _0x101894=_0x2d27e6[_0x6130('0x2d')]['userId'];var _0x1d8286=_0x2d27e6['body'][_0x6130('0x37')];var _0xf82ecf=_0x2d27e6[_0x6130('0x2d')][_0x6130('0x4e')];return getAgent(_0x101894)[_0x6130('0x24')](function(_0x35f2df){logger[_0x6130('0x16')](_0x6130('0x32'),_0x35f2df['name']);emit(util[_0x6130('0x38')](_0x6130('0x33'),_0x35f2df['name']),_0x6130('0x4f'),{'sessionId':_0x1d8286,'transferNumber':_0xf82ecf});return _0x31d20d[_0x6130('0x1c')](0xc8)[_0x6130('0x2e')]({'error':![],'message':_0x6130('0x50')});})['catch'](handleError(_0x31d20d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 13f23fe..6ed1f20 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 _0x8f4c=['create','addDisposition','/:id/canned_answers','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/users','getAgents','getApplications','post'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x8f4c,0x113));var _0xc8f4=function(_0x208128,_0x9e2557){_0x208128=_0x208128-0x0;var _0x213a02=_0x8f4c[_0x208128];return _0x213a02;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./whatsappAccount.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0x9')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router['get'](_0xc8f4('0xf'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x9')]('/:id/canned_answers',auth[_0xc8f4('0xd')](),controller['getAnswers']);router[_0xc8f4('0x9')](_0xc8f4('0x11'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x12')]);router[_0xc8f4('0x9')]('/:id/applications',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x13')]);router[_0xc8f4('0x14')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x15')]);router[_0xc8f4('0x14')]('/:id/dispositions',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x16')]);router[_0xc8f4('0x14')](_0xc8f4('0x17'),auth[_0xc8f4('0xd')](),controller['addAnswer']);router[_0xc8f4('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xc8f4('0x18')]);router[_0xc8f4('0x14')](_0xc8f4('0x19'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1a')]);router[_0xc8f4('0x14')](_0xc8f4('0x1b'),controller[_0xc8f4('0x1c')]);router[_0xc8f4('0x14')](_0xc8f4('0x1d'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1e')]);router[_0xc8f4('0x1f')]('/:id',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x20')]);router[_0xc8f4('0x21')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x22')]);router[_0xc8f4('0x21')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller[_0xc8f4('0x23')]);router[_0xc8f4('0x21')](_0xc8f4('0x17'),auth[_0xc8f4('0xd')](),controller['removeAnswers']);router[_0xc8f4('0x21')]('/:id/users',auth[_0xc8f4('0xd')](),controller['removeAgents']);module[_0xc8f4('0x24')]=router; \ No newline at end of file +var _0x4991=['isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','create','addDisposition','post','addAnswer','/:id/users','addAgents','notify','send','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe'];(function(_0x567ee9,_0x3d7fe8){var _0x500fc5=function(_0x50a470){while(--_0x50a470){_0x567ee9['push'](_0x567ee9['shift']());}};_0x500fc5(++_0x3d7fe8);}(_0x4991,0xf7));var _0x1499=function(_0x1fdd84,_0x557c0d){_0x1fdd84=_0x1fdd84-0x0;var _0x581b9c=_0x4991[_0x1fdd84];return _0x581b9c;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['show']);router[_0x1499('0x9')](_0x1499('0xf'),auth['isAuthenticated'](),controller[_0x1499('0x10')]);router[_0x1499('0x9')]('/:id/canned_answers',auth[_0x1499('0xc')](),controller[_0x1499('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x1499('0x12')]);router[_0x1499('0x9')](_0x1499('0x13'),auth[_0x1499('0xc')](),controller[_0x1499('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1499('0x15')]);router['post'](_0x1499('0xf'),auth[_0x1499('0xc')](),controller[_0x1499('0x16')]);router[_0x1499('0x17')]('/:id/canned_answers',auth[_0x1499('0xc')](),controller[_0x1499('0x18')]);router['post'](_0x1499('0x19'),auth[_0x1499('0xc')](),controller[_0x1499('0x1a')]);router[_0x1499('0x17')](_0x1499('0x13'),auth[_0x1499('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x1499('0x1b')]);router[_0x1499('0x17')]('/:id/send',auth[_0x1499('0xc')](),controller[_0x1499('0x1c')]);router[_0x1499('0x1d')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x1e')]);router[_0x1499('0x1f')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x20')]);router[_0x1499('0x1f')](_0x1499('0xf'),auth[_0x1499('0xc')](),controller[_0x1499('0x21')]);router[_0x1499('0x1f')](_0x1499('0x22'),auth[_0x1499('0xc')](),controller['removeAnswers']);router[_0x1499('0x1f')](_0x1499('0x19'),auth[_0x1499('0xc')](),controller[_0x1499('0x23')]);module[_0x1499('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 5a62f3a..7681a9a 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 _0xe302=['name','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe302,0x169));var _0x2e30=function(_0x3d8ef3,_0xc4a6b0){_0x3d8ef3=_0x3d8ef3-0x0;var _0x2b2e53=_0xe302[_0x3d8ef3];return _0x2b2e53;};'use strict';var Sequelize=require(_0x2e30('0x0'));var rs=require('randomstring');module[_0x2e30('0x1')]={'name':{'type':Sequelize[_0x2e30('0x2')],'unique':_0x2e30('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2e30('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x2e30('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x2e30('0x2')]},'type':{'type':Sequelize[_0x2e30('0x4')]('twilio',_0x2e30('0x5'))},'accountSid':{'type':Sequelize[_0x2e30('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x2e30('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2e30('0x6')],'defaultValue':function(){return _0x2e30('0x7');}},'notificationSound':{'type':Sequelize[_0x2e30('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e30('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e30('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e30('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e30('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e30('0x9')],'comment':_0x2e30('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3c0657){if(!_0x3c0657){this[_0x2e30('0xb')](_0x2e30('0xc'),null);}this[_0x2e30('0xb')](_0x2e30('0xd'),_0x3c0657);}},'description':{'type':Sequelize[_0x2e30('0x2')]}}; \ No newline at end of file +var _0x01a5=['sequelize','exports','STRING','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x01a5,0x1ad));var _0x501a=function(_0x17de12,_0x5eef99){_0x17de12=_0x17de12-0x0;var _0x5bc170=_0x01a5[_0x17de12];return _0x5bc170;};'use strict';var Sequelize=require(_0x501a('0x0'));var rs=require('randomstring');module[_0x501a('0x1')]={'name':{'type':Sequelize[_0x501a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x501a('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x501a('0x3')]();}},'phone':{'type':Sequelize[_0x501a('0x2')]},'type':{'type':Sequelize['ENUM'](_0x501a('0x4'),_0x501a('0x5'))},'accountSid':{'type':Sequelize[_0x501a('0x2')]},'baseUrl':{'type':Sequelize[_0x501a('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x501a('0x6')],'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[_0x501a('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x501a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x501a('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x501a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x501a('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x501a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x501a('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x501a('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d312e){if(!_0x2d312e){this[_0x501a('0xa')](_0x501a('0xb'),null);}this[_0x501a('0xa')](_0x501a('0xc'),_0x2d312e);}},'description':{'type':Sequelize[_0x501a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index f90de78..9893bc9 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 _0x6201=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','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','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','state','update','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','twilio','replace','whatsapp:','Body','messageId','notifications','from','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','WhatsappInteraction','interaction','created','autoclose','close','WhatsappMessage','ContactId','AttachmentId','UserId','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','to\x20is\x20mandatory','List','DESC','ListId','out','dataValues','Messages','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x329d15,_0x58845c){var _0x12bbe8=function(_0x1d8748){while(--_0x1d8748){_0x329d15['push'](_0x329d15['shift']());}};_0x12bbe8(++_0x58845c);}(_0x6201,0xad));var _0x1620=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0x6201[_0x2023e1];return _0x1fe133;};'use strict';var emlformat=require(_0x1620('0x0'));var rimraf=require(_0x1620('0x1'));var zipdir=require(_0x1620('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1620('0x3'));var moment=require(_0x1620('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1620('0x5'));var util=require('util');var path=require(_0x1620('0x6'));var sox=require(_0x1620('0x7'));var csv=require(_0x1620('0x8'));var ejs=require(_0x1620('0x9'));var fs=require('fs');var fs_extra=require(_0x1620('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1620('0xb'));var jsforce=require(_0x1620('0xc'));var deskjs=require(_0x1620('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1620('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1620('0xf'));var qs=require(_0x1620('0x10'));var as=require(_0x1620('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1620('0x12'))(_0x1620('0x13'));var utils=require(_0x1620('0x14'));var config=require(_0x1620('0x15'));var licenseUtil=require(_0x1620('0x16'));var db=require('../../mysqldb')['db'];config[_0x1620('0x17')]=_['defaults'](config['redis'],{'host':_0x1620('0x18'),'port':0x18eb});var socket=require(_0x1620('0x19'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x1620('0x1a'));var client=jayson[_0x1620('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x300ac8,_0x249c49,_0x192b23,_0x466111){return new BPromise(function(_0x453439,_0xa57ecd){var _0x47bc61=_0x466111||client;return _0x47bc61[_0x1620('0x1c')](_0x300ac8,_0x192b23)[_0x1620('0x1d')](function(_0x20b96c){logger[_0x1620('0x1e')]('WhatsappAccount,\x20%s,\x20%s',_0x249c49,'request\x20sent');logger[_0x1620('0x1f')](_0x1620('0x20'),_0x249c49,_0x1620('0x21'),JSON[_0x1620('0x22')](_0x20b96c));if(_0x20b96c['error']){if(_0x20b96c[_0x1620('0x23')]['code']===0x1f4){logger[_0x1620('0x23')](_0x1620('0x24'),_0x249c49,_0x20b96c[_0x1620('0x23')][_0x1620('0x25')]);return _0xa57ecd(_0x20b96c[_0x1620('0x23')][_0x1620('0x25')]);}logger[_0x1620('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x249c49,_0x20b96c[_0x1620('0x23')]['message']);return _0x453439(_0x20b96c['error'][_0x1620('0x25')]);}else{logger[_0x1620('0x1e')](_0x1620('0x24'),_0x249c49,'request\x20sent');_0x453439(_0x20b96c[_0x1620('0x26')][_0x1620('0x25')]);}})[_0x1620('0x27')](function(_0x2781e9){logger[_0x1620('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x249c49,_0x2781e9);_0xa57ecd(_0x2781e9);});});}function respondWithStatusCode(_0x27a0e8,_0x5c323f){_0x5c323f=_0x5c323f||0xcc;return function(_0x343502){if(_0x343502){return _0x27a0e8[_0x1620('0x28')](_0x5c323f);}return _0x27a0e8[_0x1620('0x29')](_0x5c323f)['end']();};}function respondWithResult(_0xf57cf7,_0x5762d5){_0x5762d5=_0x5762d5||0xc8;return function(_0x4483d7){if(_0x4483d7){return _0xf57cf7[_0x1620('0x29')](_0x5762d5)[_0x1620('0x2a')](_0x4483d7);}};}function respondWithFilteredResult(_0x5efc17,_0x5450f0){return function(_0x1b95b0){if(_0x1b95b0){var _0x223c27=typeof _0x5450f0[_0x1620('0x2b')]===_0x1620('0x2c')&&typeof _0x5450f0[_0x1620('0x2d')]===_0x1620('0x2c');var _0x477377=_0x1b95b0[_0x1620('0x2e')];var _0x4f03a5=_0x223c27?0x0:_0x5450f0[_0x1620('0x2b')];var _0xe9464d=_0x223c27?_0x1b95b0[_0x1620('0x2e')]:_0x5450f0['offset']+_0x5450f0[_0x1620('0x2d')];var _0x34b93f;if(_0xe9464d>=_0x477377){_0xe9464d=_0x477377;_0x34b93f=0xc8;}else{_0x34b93f=0xce;}_0x5efc17['status'](_0x34b93f);return _0x5efc17['set'](_0x1620('0x2f'),_0x4f03a5+'-'+_0xe9464d+'/'+_0x477377)[_0x1620('0x2a')](_0x1b95b0);}return null;};}function patchUpdates(_0x42d48e){return function(_0x498938){try{jsonpatch[_0x1620('0x30')](_0x498938,_0x42d48e,!![]);}catch(_0x39e885){return BPromise[_0x1620('0x31')](_0x39e885);}return _0x498938[_0x1620('0x32')]();};}function saveUpdates(_0xe0fe6f,_0x49409e){return function(_0x19aed4){if(_0x19aed4){return _0x19aed4['update'](_0xe0fe6f)['then'](function(_0x8fbd54){return _0x8fbd54;});}return null;};}function removeEntity(_0x54cefa,_0x44f376){return function(_0x457cbf){if(_0x457cbf){return _0x457cbf[_0x1620('0x33')]()['then'](function(){var _0x5905ec=_0x457cbf[_0x1620('0x34')]({'plain':!![]});var _0x56d38c='WhatsappAccounts';return db[_0x1620('0x35')]['destroy']({'where':{'type':_0x56d38c,'resourceId':_0x5905ec['id']}})[_0x1620('0x1d')](function(){return _0x457cbf;});})[_0x1620('0x1d')](function(){_0x54cefa[_0x1620('0x29')](0xcc)[_0x1620('0x36')]();});}};}function handleEntityNotFound(_0x264d84,_0x24ccff){return function(_0x3cafcf){if(!_0x3cafcf){_0x264d84[_0x1620('0x28')](0x194);}return _0x3cafcf;};}function handleError(_0x189ca4,_0x49359c){_0x49359c=_0x49359c||0x1f4;return function(_0x57ec5c){logger[_0x1620('0x23')](_0x57ec5c[_0x1620('0x37')]);if(_0x57ec5c[_0x1620('0x38')]){delete _0x57ec5c[_0x1620('0x38')];}_0x189ca4['status'](_0x49359c)[_0x1620('0x39')](_0x57ec5c);};}exports['index']=function(_0x30cb69,_0x8b233){var _0x39eecf={'include':[{'model':db[_0x1620('0x3a')],'as':_0x1620('0x3b')}]},_0x4806f7={},_0x1d23f8={'count':0x0,'rows':[]};var _0x553c55=_[_0x1620('0x3c')](db[_0x1620('0x3d')][_0x1620('0x3e')],function(_0x4472f9){return{'name':_0x4472f9[_0x1620('0x3f')],'type':_0x4472f9[_0x1620('0x40')]['key']};});_0x4806f7[_0x1620('0x41')]=_['map'](_0x553c55,'name');_0x4806f7[_0x1620('0x42')]=_[_0x1620('0x43')](_0x30cb69[_0x1620('0x42')]);_0x4806f7[_0x1620('0x44')]=_[_0x1620('0x45')](_0x4806f7[_0x1620('0x41')],_0x4806f7[_0x1620('0x42')]);_0x39eecf['attributes']=_[_0x1620('0x45')](_0x4806f7[_0x1620('0x41')],qs[_0x1620('0x46')](_0x30cb69[_0x1620('0x42')][_0x1620('0x46')]));_0x39eecf[_0x1620('0x47')]=_0x39eecf['attributes'][_0x1620('0x48')]?_0x39eecf['attributes']:_0x4806f7[_0x1620('0x41')];if(!_0x30cb69[_0x1620('0x42')]['hasOwnProperty'](_0x1620('0x49'))){_0x39eecf[_0x1620('0x2d')]=qs[_0x1620('0x2d')](_0x30cb69['query']['limit']);_0x39eecf[_0x1620('0x2b')]=qs[_0x1620('0x2b')](_0x30cb69[_0x1620('0x42')][_0x1620('0x2b')]);}_0x39eecf[_0x1620('0x4a')]=qs[_0x1620('0x4b')](_0x30cb69[_0x1620('0x42')][_0x1620('0x4b')]);_0x39eecf[_0x1620('0x4c')]=qs['filters'](_[_0x1620('0x4d')](_0x30cb69[_0x1620('0x42')],_0x4806f7[_0x1620('0x44')]),_0x553c55);if(_0x30cb69[_0x1620('0x42')][_0x1620('0x4e')]){_0x39eecf['where']=_[_0x1620('0x4f')](_0x39eecf[_0x1620('0x4c')],{'$or':_[_0x1620('0x3c')](_0x553c55,function(_0x4cf488){if(_0x4cf488[_0x1620('0x40')]!==_0x1620('0x50')){var _0x59ac6={};_0x59ac6[_0x4cf488[_0x1620('0x38')]]={'$like':'%'+_0x30cb69['query']['filter']+'%'};return _0x59ac6;}})});}_0x39eecf=_[_0x1620('0x4f')]({},_0x39eecf,_0x30cb69[_0x1620('0x51')]);var _0x4bdd26={'where':_0x39eecf[_0x1620('0x4c')]};return db[_0x1620('0x3d')][_0x1620('0x2e')](_0x4bdd26)[_0x1620('0x1d')](function(_0x21d8f8){_0x1d23f8[_0x1620('0x2e')]=_0x21d8f8;if(_0x30cb69[_0x1620('0x42')][_0x1620('0x52')]){_0x39eecf[_0x1620('0x53')]=[{'all':!![]}];}return db[_0x1620('0x3d')][_0x1620('0x54')](_0x39eecf);})[_0x1620('0x1d')](function(_0x287d25){_0x1d23f8[_0x1620('0x55')]=_0x287d25;return _0x1d23f8;})[_0x1620('0x1d')](respondWithFilteredResult(_0x8b233,_0x39eecf))[_0x1620('0x27')](handleError(_0x8b233,null));};exports[_0x1620('0x56')]=function(_0x467278,_0x47ac95){var _0x3f498d={'raw':![],'where':{'id':_0x467278[_0x1620('0x57')]['id']},'include':[{'model':db[_0x1620('0x3a')],'as':_0x1620('0x3b')}]},_0x597bd4={};_0x597bd4[_0x1620('0x41')]=_['keys'](db[_0x1620('0x3d')][_0x1620('0x3e')]);_0x597bd4['query']=_[_0x1620('0x43')](_0x467278[_0x1620('0x42')]);_0x597bd4[_0x1620('0x44')]=_[_0x1620('0x45')](_0x597bd4[_0x1620('0x41')],_0x597bd4[_0x1620('0x42')]);_0x3f498d[_0x1620('0x47')]=_[_0x1620('0x45')](_0x597bd4[_0x1620('0x41')],qs['fields'](_0x467278[_0x1620('0x42')][_0x1620('0x46')]));_0x3f498d[_0x1620('0x47')]=_0x3f498d[_0x1620('0x47')][_0x1620('0x48')]?_0x3f498d[_0x1620('0x47')]:_0x597bd4['model'];if(_0x467278[_0x1620('0x42')]['includeAll']){_0x3f498d[_0x1620('0x53')]=[{'all':!![]}];}_0x3f498d=_[_0x1620('0x4f')]({},_0x3f498d,_0x467278['options']);return db['WhatsappAccount'][_0x1620('0x58')](_0x3f498d)[_0x1620('0x1d')](handleEntityNotFound(_0x47ac95,null))['then'](respondWithResult(_0x47ac95,null))[_0x1620('0x27')](handleError(_0x47ac95,null));};exports[_0x1620('0x59')]=function(_0x49632e,_0x5040c9){return db[_0x1620('0x3d')][_0x1620('0x59')](_0x49632e[_0x1620('0x5a')],{})['then'](function(_0x99bf6b){var _0x1170ea=_0x49632e[_0x1620('0x5b')][_0x1620('0x34')]({'plain':!![]});if(!_0x1170ea)throw new Error(_0x1620('0x5c'));if(_0x1170ea[_0x1620('0x5d')]==='user'){var _0x297917=_0x99bf6b[_0x1620('0x34')]({'plain':!![]});var _0x4aa16d='WhatsappAccounts';return db[_0x1620('0x5e')][_0x1620('0x58')]({'where':{'name':_0x4aa16d,'userProfileId':_0x1170ea[_0x1620('0x5f')]},'raw':!![]})[_0x1620('0x1d')](function(_0x22cd82){if(_0x22cd82&&_0x22cd82[_0x1620('0x60')]===0x0){return db[_0x1620('0x35')]['create']({'name':_0x297917[_0x1620('0x38')],'resourceId':_0x297917['id'],'type':_0x22cd82[_0x1620('0x38')],'sectionId':_0x22cd82['id']},{})[_0x1620('0x1d')](function(){return _0x99bf6b;});}else{return _0x99bf6b;}})[_0x1620('0x27')](function(_0x5ba82b){logger['error'](_0x1620('0x61'),_0x5ba82b);throw _0x5ba82b;});}return _0x99bf6b;})[_0x1620('0x1d')](respondWithResult(_0x5040c9,0xc9))[_0x1620('0x27')](handleError(_0x5040c9,null));};exports['update']=function(_0x2ec08f,_0x2811d2){if(_0x2ec08f[_0x1620('0x5a')]['id']){delete _0x2ec08f['body']['id'];}return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x2ec08f[_0x1620('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x1620('0x3b')}]})['then'](handleEntityNotFound(_0x2811d2,null))['then'](saveUpdates(_0x2ec08f[_0x1620('0x5a')],null))['then'](respondWithResult(_0x2811d2,null))[_0x1620('0x27')](handleError(_0x2811d2,null));};exports[_0x1620('0x33')]=function(_0xef9e47,_0x8f53db){return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0xef9e47[_0x1620('0x57')]['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x8f53db,null))[_0x1620('0x1d')](removeEntity(_0x8f53db,null))['catch'](handleError(_0x8f53db,null));};exports['describe']=function(_0x2c3eb9,_0x3c9dc6){return db['WhatsappAccount'][_0x1620('0x62')]()['then'](respondWithResult(_0x3c9dc6,null))[_0x1620('0x27')](handleError(_0x3c9dc6,null));};exports[_0x1620('0x63')]=function(_0x25e445,_0x35a036,_0x307921){if(_0x25e445[_0x1620('0x5a')]['id']){delete _0x25e445['body']['id'];}return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x25e445['params']['id']}})['then'](handleEntityNotFound(_0x35a036,null))[_0x1620('0x1d')](function(_0x100b3f){if(_0x100b3f){_0x25e445[_0x1620('0x5a')][_0x1620('0x64')]=_0x100b3f['id'];return db[_0x1620('0x65')][_0x1620('0x59')](_0x25e445[_0x1620('0x5a')]);}})[_0x1620('0x1d')](respondWithResult(_0x35a036,null))[_0x1620('0x27')](handleError(_0x35a036,null));};exports[_0x1620('0x66')]=function(_0x3b92f7,_0x2c617a,_0x2cb129){var _0xfef6e1={'raw':![],'where':{}};var _0x1c0f7d={};var _0x271292={'count':0x0,'rows':[]};return db[_0x1620('0x3d')]['findOne']({'where':{'id':_0x3b92f7[_0x1620('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c617a,null))[_0x1620('0x1d')](function(_0x41ecc7){if(_0x41ecc7){_0x1c0f7d[_0x1620('0x41')]=_[_0x1620('0x43')](db[_0x1620('0x65')][_0x1620('0x3e')]);_0x1c0f7d[_0x1620('0x42')]=_[_0x1620('0x43')](_0x3b92f7[_0x1620('0x42')]);_0x1c0f7d[_0x1620('0x44')]=_[_0x1620('0x45')](_0x1c0f7d[_0x1620('0x41')],_0x1c0f7d[_0x1620('0x42')]);_0xfef6e1[_0x1620('0x47')]=_[_0x1620('0x45')](_0x1c0f7d['model'],qs[_0x1620('0x46')](_0x3b92f7['query']['fields']));_0xfef6e1[_0x1620('0x47')]=_0xfef6e1[_0x1620('0x47')][_0x1620('0x48')]?_0xfef6e1[_0x1620('0x47')]:_0x1c0f7d[_0x1620('0x41')];if(!_0x3b92f7[_0x1620('0x42')][_0x1620('0x67')]('nolimit')){_0xfef6e1[_0x1620('0x2d')]=qs['limit'](_0x3b92f7[_0x1620('0x42')][_0x1620('0x2d')]);_0xfef6e1[_0x1620('0x2b')]=qs[_0x1620('0x2b')](_0x3b92f7[_0x1620('0x42')]['offset']);}_0xfef6e1[_0x1620('0x4a')]=qs[_0x1620('0x4b')](_0x3b92f7[_0x1620('0x42')][_0x1620('0x4b')]);_0xfef6e1[_0x1620('0x4c')]=qs[_0x1620('0x44')](_[_0x1620('0x4d')](_0x3b92f7[_0x1620('0x42')],_0x1c0f7d[_0x1620('0x44')]));_0xfef6e1['where'][_0x1620('0x64')]=_0x41ecc7['id'];if(_0x3b92f7['query'][_0x1620('0x4e')]){_0xfef6e1[_0x1620('0x4c')]=_['merge'](_0xfef6e1[_0x1620('0x4c')],{'$or':_[_0x1620('0x3c')](_0xfef6e1['attributes'],function(_0x2f4ace){var _0x15ce72={};_0x15ce72[_0x2f4ace]={'$like':'%'+_0x3b92f7['query'][_0x1620('0x4e')]+'%'};return _0x15ce72;})});}_0xfef6e1=_[_0x1620('0x4f')]({},_0xfef6e1,_0x3b92f7[_0x1620('0x51')]);return db[_0x1620('0x65')][_0x1620('0x2e')]({'where':_0xfef6e1[_0x1620('0x4c')]})[_0x1620('0x1d')](function(_0x58069e){_0x271292['count']=_0x58069e;if(_0x3b92f7[_0x1620('0x42')]['includeAll']){_0xfef6e1[_0x1620('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x1620('0x54')](_0xfef6e1);})[_0x1620('0x1d')](function(_0x3cfe4c){_0x271292[_0x1620('0x55')]=_0x3cfe4c;return _0x271292;});}})[_0x1620('0x1d')](respondWithFilteredResult(_0x2c617a,_0xfef6e1))[_0x1620('0x27')](handleError(_0x2c617a,null));};exports[_0x1620('0x68')]=function(_0x210b0f,_0x33a661,_0xd2d5ee){return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x210b0f[_0x1620('0x57')]['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x33a661,null))[_0x1620('0x1d')](function(_0x1c0a5b){if(_0x1c0a5b){return _0x1c0a5b['removeDispositions'](_0x210b0f[_0x1620('0x42')]['ids']);}})[_0x1620('0x1d')](respondWithStatusCode(_0x33a661,null))[_0x1620('0x27')](handleError(_0x33a661,null));};exports[_0x1620('0x69')]=function(_0x3a0ebf,_0x12a1a5,_0x2e8b79){if(_0x3a0ebf[_0x1620('0x5a')]['id']){delete _0x3a0ebf[_0x1620('0x5a')]['id'];}return db['WhatsappAccount'][_0x1620('0x58')]({'where':{'id':_0x3a0ebf['params']['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x12a1a5,null))[_0x1620('0x1d')](function(_0x11bc3d){if(_0x11bc3d){_0x3a0ebf[_0x1620('0x5a')][_0x1620('0x64')]=_0x11bc3d['id'];return db[_0x1620('0x6a')][_0x1620('0x59')](_0x3a0ebf['body']);}})[_0x1620('0x1d')](respondWithResult(_0x12a1a5,null))[_0x1620('0x27')](handleError(_0x12a1a5,null));};exports[_0x1620('0x6b')]=function(_0x1ad3b7,_0x46b957,_0x1e1349){var _0x102ca3={'raw':![],'where':{}};var _0x2add73={};var _0x53c1ee={'count':0x0,'rows':[]};return db[_0x1620('0x3d')][_0x1620('0x6c')]({'where':{'id':_0x1ad3b7[_0x1620('0x57')]['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x46b957,null))[_0x1620('0x1d')](function(_0x55edd7){if(_0x55edd7){_0x2add73[_0x1620('0x41')]=_[_0x1620('0x43')](db['CannedAnswer']['rawAttributes']);_0x2add73[_0x1620('0x42')]=_[_0x1620('0x43')](_0x1ad3b7[_0x1620('0x42')]);_0x2add73[_0x1620('0x44')]=_[_0x1620('0x45')](_0x2add73['model'],_0x2add73['query']);_0x102ca3[_0x1620('0x47')]=_[_0x1620('0x45')](_0x2add73[_0x1620('0x41')],qs['fields'](_0x1ad3b7[_0x1620('0x42')][_0x1620('0x46')]));_0x102ca3[_0x1620('0x47')]=_0x102ca3[_0x1620('0x47')]['length']?_0x102ca3[_0x1620('0x47')]:_0x2add73[_0x1620('0x41')];if(!_0x1ad3b7[_0x1620('0x42')][_0x1620('0x67')](_0x1620('0x49'))){_0x102ca3[_0x1620('0x2d')]=qs[_0x1620('0x2d')](_0x1ad3b7['query'][_0x1620('0x2d')]);_0x102ca3[_0x1620('0x2b')]=qs[_0x1620('0x2b')](_0x1ad3b7[_0x1620('0x42')]['offset']);}_0x102ca3[_0x1620('0x4a')]=qs[_0x1620('0x4b')](_0x1ad3b7[_0x1620('0x42')][_0x1620('0x4b')]);_0x102ca3['where']=qs[_0x1620('0x44')](_[_0x1620('0x4d')](_0x1ad3b7[_0x1620('0x42')],_0x2add73[_0x1620('0x44')]));_0x102ca3[_0x1620('0x4c')]['WhatsappAccountId']=_0x55edd7['id'];if(_0x1ad3b7[_0x1620('0x42')][_0x1620('0x4e')]){_0x102ca3[_0x1620('0x4c')]=_[_0x1620('0x4f')](_0x102ca3[_0x1620('0x4c')],{'$or':_[_0x1620('0x3c')](_0x102ca3[_0x1620('0x47')],function(_0x15709f){var _0x5d89c0={};_0x5d89c0[_0x15709f]={'$like':'%'+_0x1ad3b7[_0x1620('0x42')][_0x1620('0x4e')]+'%'};return _0x5d89c0;})});}_0x102ca3=_[_0x1620('0x4f')]({},_0x102ca3,_0x1ad3b7[_0x1620('0x51')]);return db[_0x1620('0x6a')][_0x1620('0x2e')]({'where':_0x102ca3[_0x1620('0x4c')]})['then'](function(_0x5af100){_0x53c1ee[_0x1620('0x2e')]=_0x5af100;if(_0x1ad3b7[_0x1620('0x42')][_0x1620('0x52')]){_0x102ca3[_0x1620('0x53')]=[{'all':!![]}];}return db[_0x1620('0x6a')]['findAll'](_0x102ca3);})[_0x1620('0x1d')](function(_0x505fe5){_0x53c1ee['rows']=_0x505fe5;return _0x53c1ee;});}})['then'](respondWithFilteredResult(_0x46b957,_0x102ca3))[_0x1620('0x27')](handleError(_0x46b957,null));};exports[_0x1620('0x6d')]=function(_0x405864,_0x1ebdc4,_0x2105ae){return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x405864[_0x1620('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ebdc4,null))[_0x1620('0x1d')](function(_0x318e02){if(_0x318e02){return _0x318e02['removeAnswers'](_0x405864[_0x1620('0x42')][_0x1620('0x6e')]);}})[_0x1620('0x1d')](respondWithStatusCode(_0x1ebdc4,null))[_0x1620('0x27')](handleError(_0x1ebdc4,null));};exports[_0x1620('0x6f')]=function(_0x2c6c71,_0xe5c076,_0x510699){return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x2c6c71[_0x1620('0x57')]['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0xe5c076,null))[_0x1620('0x1d')](function(_0x4439ef){if(_0x4439ef){return _0x4439ef[_0x1620('0x6f')](_0x2c6c71[_0x1620('0x5a')][_0x1620('0x6e')],_[_0x1620('0x70')](_0x2c6c71[_0x1620('0x5a')],['ids','id'])||{})[_0x1620('0x71')](function(_0x286c03){for(var _0x2dd5d7=0x0;_0x2dd5d7<_0x2c6c71[_0x1620('0x5a')][_0x1620('0x6e')][_0x1620('0x48')];_0x2dd5d7+=0x1){socket[_0x1620('0x72')](_0x1620('0x73'),{'UserId':Number(_0x2c6c71[_0x1620('0x5a')]['ids'][_0x2dd5d7]),'WhatsappAccountId':Number(_0x2c6c71[_0x1620('0x57')]['id'])});}return _0x286c03;});}})['then'](respondWithResult(_0xe5c076,null))[_0x1620('0x27')](handleError(_0xe5c076,null));};exports[_0x1620('0x74')]=function(_0x11b643,_0x52c3b7,_0xd332f9){return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x11b643[_0x1620('0x57')]['id']}})['then'](handleEntityNotFound(_0x52c3b7,null))[_0x1620('0x1d')](function(_0x3921f4){if(_0x3921f4){return _0x3921f4[_0x1620('0x74')](_0x11b643[_0x1620('0x42')][_0x1620('0x6e')])['then'](function(){if(_[_0x1620('0x75')](_0x11b643[_0x1620('0x42')][_0x1620('0x6e')])){for(var _0x5aa0e8=0x0;_0x5aa0e8<_0x11b643['query']['ids'][_0x1620('0x48')];_0x5aa0e8+=0x1){socket[_0x1620('0x72')](_0x1620('0x76'),{'UserId':Number(_0x11b643[_0x1620('0x42')][_0x1620('0x6e')][_0x5aa0e8]),'WhatsappAccountId':Number(_0x11b643['params']['id'])});}}else{socket[_0x1620('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x11b643[_0x1620('0x42')][_0x1620('0x6e')]),'WhatsappAccountId':Number(_0x11b643[_0x1620('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x52c3b7,null))[_0x1620('0x27')](handleError(_0x52c3b7,null));};exports[_0x1620('0x77')]=function(_0x1e4f5c,_0x4ff2d7,_0x673705){var _0x322dea={};var _0x576f68={};var _0x8cd522;var _0x3a0f52;return db[_0x1620('0x3d')][_0x1620('0x6c')]({'where':{'id':_0x1e4f5c['params']['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x4ff2d7,null))[_0x1620('0x1d')](function(_0x30a879){if(_0x30a879){_0x8cd522=_0x30a879;_0x576f68[_0x1620('0x41')]=_[_0x1620('0x43')](db[_0x1620('0x78')][_0x1620('0x3e')]);_0x576f68[_0x1620('0x42')]=_[_0x1620('0x43')](_0x1e4f5c[_0x1620('0x42')]);_0x576f68[_0x1620('0x44')]=_[_0x1620('0x45')](_0x576f68[_0x1620('0x41')],_0x576f68[_0x1620('0x42')]);_0x322dea[_0x1620('0x47')]=_[_0x1620('0x45')](_0x576f68[_0x1620('0x41')],qs[_0x1620('0x46')](_0x1e4f5c[_0x1620('0x42')][_0x1620('0x46')]));_0x322dea[_0x1620('0x47')]=_0x322dea[_0x1620('0x47')][_0x1620('0x48')]?_0x322dea['attributes']:_0x576f68[_0x1620('0x41')];_0x322dea[_0x1620('0x4a')]=qs[_0x1620('0x4b')](_0x1e4f5c[_0x1620('0x42')][_0x1620('0x4b')]);_0x322dea[_0x1620('0x4c')]=qs[_0x1620('0x44')](_[_0x1620('0x4d')](_0x1e4f5c[_0x1620('0x42')],_0x576f68[_0x1620('0x44')]));if(_0x1e4f5c[_0x1620('0x42')][_0x1620('0x4e')]){_0x322dea[_0x1620('0x4c')]=_[_0x1620('0x4f')](_0x322dea[_0x1620('0x4c')],{'$or':_['map'](_0x322dea['attributes'],function(_0x5404e6){var _0x574263={};_0x574263[_0x5404e6]={'$like':'%'+_0x1e4f5c[_0x1620('0x42')]['filter']+'%'};return _0x574263;})});}_0x322dea=_[_0x1620('0x4f')]({},_0x322dea,_0x1e4f5c[_0x1620('0x51')]);return _0x8cd522[_0x1620('0x77')](_0x322dea);}})[_0x1620('0x1d')](function(_0x437b7c){if(_0x437b7c){_0x3a0f52=_0x437b7c[_0x1620('0x48')];if(!_0x1e4f5c['query'][_0x1620('0x67')]('nolimit')){_0x322dea[_0x1620('0x2d')]=qs[_0x1620('0x2d')](_0x1e4f5c['query'][_0x1620('0x2d')]);_0x322dea[_0x1620('0x2b')]=qs[_0x1620('0x2b')](_0x1e4f5c['query'][_0x1620('0x2b')]);}return _0x8cd522[_0x1620('0x77')](_0x322dea);}})[_0x1620('0x1d')](function(_0x57ebca){if(_0x57ebca){return _0x57ebca?{'count':_0x3a0f52,'rows':_0x57ebca}:null;}})['then'](respondWithResult(_0x4ff2d7,null))[_0x1620('0x27')](handleError(_0x4ff2d7,null));};exports[_0x1620('0x79')]=function(_0x113766,_0x4fcc73){var _0x184e05=_0x113766['params']['id'];var _0xc30138=_0x113766[_0x1620('0x5a')];var _0x163175=0xc8;var _0x331877=null;return db['sequelize'][_0x1620('0x7a')]({'isolationLevel':db[_0x1620('0x7b')][_0x1620('0x7c')]['ISOLATION_LEVELS'][_0x1620('0x7d')]},function(_0x44f44b){return db[_0x1620('0x3d')][_0x1620('0x6c')]({'where':{'id':_0x184e05},'transaction':_0x44f44b})[_0x1620('0x1d')](function(_0x2d9482){if(_0x2d9482){return db[_0x1620('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x184e05},'transaction':_0x44f44b})['then'](function(){var _0x555a34=_[_0x1620('0x3c')](_0xc30138,function(_0xbc1fb6){_0xbc1fb6[_0x1620('0x64')]=_0x184e05;return _0xbc1fb6;});return db[_0x1620('0x7e')]['bulkCreate'](_0x555a34,{'transaction':_0x44f44b});});}else{_0x163175=0x194;_0x331877=[];}});})[_0x1620('0x1d')](function(){if(_0x163175!==0x194){return db[_0x1620('0x7e')][_0x1620('0x7f')]({'where':{'WhatsappAccountId':_0x184e05},'order':_0x1620('0x80')})[_0x1620('0x1d')](function(_0x28add0){_0x331877=_0x28add0;});}})[_0x1620('0x27')](function(_0xfdf7d3){_0x163175=0x1f4;logger['error'](_0xfdf7d3['stack']);if(_0xfdf7d3['name']){delete _0xfdf7d3[_0x1620('0x38')];}_0x331877=_0xfdf7d3;})[_0x1620('0x81')](function(){if(_0x331877===null){_0x4fcc73[_0x1620('0x28')](_0x163175);}else{if(_0x163175===0x1f4){_0x4fcc73['status'](_0x163175)[_0x1620('0x39')](_0x331877);}else{_0x4fcc73[_0x1620('0x29')](_0x163175)[_0x1620('0x2a')](_0x331877);}}});};exports['getApplications']=function(_0x41b693,_0x585ea3,_0x17ab3a){var _0x5d6946={};var _0x1a7a1d={};var _0x503f86;var _0x2a5385;return db[_0x1620('0x3d')][_0x1620('0x6c')]({'where':{'id':_0x41b693[_0x1620('0x57')]['id']}})[_0x1620('0x1d')](handleEntityNotFound(_0x585ea3,null))[_0x1620('0x1d')](function(_0xad618a){if(_0xad618a){_0x503f86=_0xad618a;_0x1a7a1d[_0x1620('0x41')]=_[_0x1620('0x43')](db[_0x1620('0x7e')][_0x1620('0x3e')]);_0x1a7a1d[_0x1620('0x42')]=_[_0x1620('0x43')](_0x41b693[_0x1620('0x42')]);_0x1a7a1d[_0x1620('0x44')]=_['intersection'](_0x1a7a1d[_0x1620('0x41')],_0x1a7a1d['query']);_0x5d6946['attributes']=_['intersection'](_0x1a7a1d[_0x1620('0x41')],qs[_0x1620('0x46')](_0x41b693[_0x1620('0x42')][_0x1620('0x46')]));_0x5d6946[_0x1620('0x47')]=_0x5d6946['attributes'][_0x1620('0x48')]?_0x5d6946[_0x1620('0x47')]:_0x1a7a1d[_0x1620('0x41')];_0x5d6946[_0x1620('0x4a')]=qs[_0x1620('0x4b')](_0x41b693[_0x1620('0x42')]['sort']);_0x5d6946[_0x1620('0x4c')]=qs[_0x1620('0x44')](_['pick'](_0x41b693['query'],_0x1a7a1d[_0x1620('0x44')]));if(_0x41b693[_0x1620('0x42')][_0x1620('0x4e')]){_0x5d6946['where']=_[_0x1620('0x4f')](_0x5d6946['where'],{'$or':_['map'](_0x5d6946[_0x1620('0x47')],function(_0x3b0341){var _0x50521f={};_0x50521f[_0x3b0341]={'$like':'%'+_0x41b693['query'][_0x1620('0x4e')]+'%'};return _0x50521f;})});}_0x5d6946=_[_0x1620('0x4f')]({},_0x5d6946,_0x41b693[_0x1620('0x51')]);return _0x503f86[_0x1620('0x82')](_0x5d6946);}})[_0x1620('0x1d')](function(_0x4abc07){if(_0x4abc07){_0x2a5385=_0x4abc07[_0x1620('0x48')];if(!_0x41b693[_0x1620('0x42')][_0x1620('0x67')](_0x1620('0x49'))){_0x5d6946[_0x1620('0x2d')]=qs['limit'](_0x41b693['query'][_0x1620('0x2d')]);_0x5d6946[_0x1620('0x2b')]=qs[_0x1620('0x2b')](_0x41b693['query'][_0x1620('0x2b')]);}return _0x503f86[_0x1620('0x82')](_0x5d6946);}})[_0x1620('0x1d')](function(_0x28b9fd){if(_0x28b9fd){return _0x28b9fd?{'count':_0x2a5385,'rows':_0x28b9fd}:null;}})['then'](respondWithResult(_0x585ea3,null))[_0x1620('0x27')](handleError(_0x585ea3,null));};exports[_0x1620('0x83')]=function(_0x2b71c2,_0x482016,_0x5849c0){var _0x81020b={'channel':'whatsapp'};var _0x343873=[];var _0x16cf4f=[];var _0x4ea92b={};return db[_0x1620('0x3d')][_0x1620('0x58')]({'where':{'id':_0x2b71c2[_0x1620('0x57')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x1620('0x84')}]})[_0x1620('0x1d')](handleEntityNotFound(_0x482016,null))[_0x1620('0x1d')](function(_0x580d85){_0x81020b[_0x1620('0x85')]=_0x580d85;if(_0x81020b[_0x1620('0x85')]&&_0x81020b[_0x1620('0x85')][_0x1620('0x40')]===_0x1620('0x86')&&_0x2b71c2[_0x1620('0x5a')][_0x1620('0x87')]){if(_0x2b71c2['body'][_0x1620('0x87')]['length']===0x0)return;if(_0x2b71c2['body'][_0x1620('0x87')][0x0][_0x1620('0x88')]!=='read')return;return db['WhatsappMessage'][_0x1620('0x89')]({'read':!![],'readAt':_0x2b71c2[_0x1620('0x5a')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x2b71c2[_0x1620('0x5a')][_0x1620('0x87')][0x0]['message_id']},'individualHooks':!![]})[_0x1620('0x1d')](function(_0xd1d5f4){return _0x482016[_0x1620('0x29')](0xc8)[_0x1620('0x2a')](_0xd1d5f4);});}_0x81020b[_0x1620('0x8a')]=_[_0x1620('0x8b')](_0x580d85[_0x1620('0x84')],[_0x1620('0x80')],[_0x1620('0x8c')]);if(_0x81020b[_0x1620('0x85')]['Applications']){delete _0x81020b[_0x1620('0x85')][_0x1620('0x84')];}return db[_0x1620('0x8d')][_0x1620('0x62')]()[_0x1620('0x1d')](function(_0x29091a){if(!_0x29091a){throw new db[(_0x1620('0x8e'))]['ValidationError'](_0x1620('0x8f'));}_0x343873=_['difference'](_[_0x1620('0x43')](_0x29091a),['createdAt',_0x1620('0x90')]);_0x16cf4f=_['difference'](_[_0x1620('0x43')](_0x29091a),[_0x1620('0x91'),_0x1620('0x90'),_0x1620('0x92'),'ListId']);_0x81020b[_0x1620('0x5a')]={'mapKey':'mobile'};if(_0x81020b['account']&&_0x81020b[_0x1620('0x85')][_0x1620('0x40')]===_0x1620('0x93')){_0x81020b[_0x1620('0x5a')]['from']=_0x2b71c2['body']['From'][_0x1620('0x94')](_0x1620('0x95'),'');_0x81020b[_0x1620('0x5a')][_0x1620('0x5a')]=_0x2b71c2[_0x1620('0x5a')][_0x1620('0x96')];_0x81020b[_0x1620('0x5a')][_0x1620('0x97')]=_0x2b71c2[_0x1620('0x5a')]['MessageSid'];}if(_0x81020b['account']&&_0x81020b[_0x1620('0x85')]['type']===_0x1620('0x86')){_0x81020b['body']['from']=_0x2b71c2[_0x1620('0x5a')][_0x1620('0x98')][0x0][_0x1620('0x99')];_0x81020b[_0x1620('0x5a')][_0x1620('0x5a')]=_0x2b71c2[_0x1620('0x5a')][_0x1620('0x98')][0x0][_0x1620('0x25')][_0x1620('0x5a')];_0x81020b[_0x1620('0x5a')][_0x1620('0x97')]=_0x2b71c2['body'][_0x1620('0x98')][0x0]['message_id'];}if(_0x81020b['body']['id']){delete _0x81020b[_0x1620('0x5a')]['id'];}if(_[_0x1620('0x9a')](_0x81020b[_0x1620('0x5a')][_0x1620('0x99')])){throw new db['Sequelize'][(_0x1620('0x9b'))]('from\x20is\x20mandatory');}if(_[_0x1620('0x9a')](_0x81020b[_0x1620('0x5a')][_0x1620('0x5a')])||_0x81020b[_0x1620('0x5a')][_0x1620('0x5a')]===''){throw new db[(_0x1620('0x8e'))][(_0x1620('0x9b'))](_0x1620('0x9c'));}if(_[_0x1620('0x9a')](_0x81020b['body'][_0x1620('0x9d')])){throw new db[(_0x1620('0x8e'))][(_0x1620('0x9b'))](_0x1620('0x9e')+_0x16cf4f);}if(!_[_0x1620('0x9f')](_0x16cf4f,_0x81020b['body'][_0x1620('0x9d')])){throw new db[(_0x1620('0x8e'))][(_0x1620('0x9b'))](_0x1620('0xa0')+_0x16cf4f);}_0x4ea92b[_0x81020b[_0x1620('0x5a')]['mapKey']]=_0x81020b[_0x1620('0x5a')][_0x1620('0x99')];return db[_0x1620('0xa1')][_0x1620('0x58')]({'where':{'id':_0x81020b[_0x1620('0x85')]['ListId']},'include':[{'model':db[_0x1620('0x8d')],'as':_0x1620('0xa2'),'where':_0x4ea92b,'limit':0x1,'order':[[_0x1620('0x90'),'DESC']]}]});})['then'](handleEntityNotFound(_0x482016,null))[_0x1620('0x1d')](function(_0xb8fce2){if(_0xb8fce2){_0x81020b[_0x1620('0xa3')]=_['omit'](_0xb8fce2,[_0x1620('0xa2')]);if(_0xb8fce2[_0x1620('0xa2')][_0x1620('0x48')]){return _0xb8fce2[_0x1620('0xa2')][0x0];}var _0x4a5273=_['defaults'](_0x81020b[_0x1620('0x5a')],{'firstName':_0x81020b['body'][_0x1620('0x99')],'ListId':_0xb8fce2['id']});_0x4a5273[_0x81020b[_0x1620('0x5a')][_0x1620('0x9d')]]=_0x81020b[_0x1620('0x5a')]['from'];return db['CmContact'][_0x1620('0x59')](_0x4a5273,{'fields':_0x343873,'raw':!![]});}})[_0x1620('0x1d')](handleEntityNotFound(_0x482016,null))[_0x1620('0x1d')](function(_0x1bb06c){if(_0x1bb06c){_0x81020b['contact']=_0x1bb06c;var _0x2914fe={'ContactId':_0x1bb06c['id'],'phone':_0x81020b[_0x1620('0x5a')][_0x1620('0x99')],'WhatsappAccountId':_0x2b71c2[_0x1620('0x57')]['id']};var _0x4ba0b4={'ContactId':_0x1bb06c['id'],'WhatsappAccountId':_0x2b71c2[_0x1620('0x57')]['id'],'closed':![]};return db[_0x1620('0xa4')][_0x1620('0x58')]({'where':_0x4ba0b4})[_0x1620('0x1d')](function(_0x3b21a8){if(_0x3b21a8){return[_0x3b21a8,![]];}return db[_0x1620('0xa4')]['create'](_0x2914fe)[_0x1620('0x1d')](function(_0xa32960){return[_0xa32960,!![]];});});}})[_0x1620('0x71')](function(_0x1f600b,_0x579e0e){_0x81020b[_0x1620('0xa5')]=_0x1f600b[_0x1620('0x34')]({'plain':!![]});_0x81020b[_0x1620('0xa5')][_0x1620('0xa6')]=![];if(_0x579e0e){if(_0x81020b[_0x1620('0x85')][_0x1620('0xa7')]){_0x81020b['applications']['push']({'id':0x0,'priority':_0x81020b[_0x1620('0x8a')][_0x1620('0x48')]+0x1,'app':_0x1620('0xa8'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x81020b[_0x1620('0xa5')]['created']=!![];}return db[_0x1620('0xa9')][_0x1620('0x59')]({'phone':_0x81020b[_0x1620('0x5a')][_0x1620('0x99')],'messageId':_0x81020b[_0x1620('0x5a')][_0x1620('0x97')],'body':_0x81020b[_0x1620('0x5a')][_0x1620('0x5a')],'WhatsappAccountId':_0x2b71c2['params']['id'],'WhatsappInteractionId':_0x1f600b['id'],'direction':'in','ContactId':_0x1f600b[_0x1620('0xaa')],'AttachmentId':_0x81020b[_0x1620('0x5a')][_0x1620('0xab')]});})[_0x1620('0x1d')](function(_0x279878){_0x81020b[_0x1620('0x25')]=_0x279878;if(_0x81020b[_0x1620('0xa5')][_0x1620('0xac')]){return db[_0x1620('0x78')][_0x1620('0x58')]({'attributes':['id',_0x1620('0x38')],'where':{'id':_0x81020b[_0x1620('0xa5')][_0x1620('0xac')]}})[_0x1620('0x1d')](function(_0x5b5cbc){if(_0x5b5cbc){_0x81020b[_0x1620('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1620('0xad'),'appdata':_0x5b5cbc['name']+','+(_0x81020b[_0x1620('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0x1620('0xae')});}return respondWithRpcPromise(_0x1620('0xaf'),_0x1620('0xb0'),_0x81020b);});}return respondWithRpcPromise(_0x1620('0xaf'),_0x1620('0xb0'),_0x81020b);})[_0x1620('0x1d')](function(_0x1b5a56){if(_0x1b5a56){var _0x3db6f5=0xc8;var _0x1b8419=_0x1620('0xb1');logger[_0x1620('0x1e')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1b8419,_0x3db6f5,_0x1620('0xb2'));logger[_0x1620('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1b8419,_0x3db6f5,_0x1620('0xb2'),JSON[_0x1620('0x22')](_0x1b5a56));if(_0x81020b[_0x1620('0x85')]['type']===_0x1620('0x93')){return _0x482016['status'](_0x3db6f5)['set'](_0x1620('0xb3'),'text/xml')[_0x1620('0x39')](_0x1620('0xb4'));}else{return _0x482016[_0x1620('0x29')](_0x3db6f5)[_0x1620('0x2a')](_0x1b5a56);}}});})[_0x1620('0x27')](handleError(_0x482016,null));};exports['send']=function(_0x341d95,_0x2e30ea,_0x1d56f0){var _0x3c682b,_0x4d6d3e,_0x59fd98;if(_[_0x1620('0x9a')](_0x341d95[_0x1620('0x5a')][_0x1620('0x5a')])||_0x341d95['body']['body']===''){throw new db['Sequelize'][(_0x1620('0x9b'))](_0x1620('0x9c'));}if(_[_0x1620('0x9a')](_0x341d95[_0x1620('0x5a')]['to'])){throw new db[(_0x1620('0x8e'))][(_0x1620('0x9b'))](_0x1620('0xb5'));}_0x3c682b=_0x341d95[_0x1620('0x5a')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x341d95[_0x1620('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x1620('0xb6'),'include':[{'model':db['CmContact'],'as':_0x1620('0xa2'),'where':{'mobile':_0x3c682b},'limit':0x1,'order':[[_0x1620('0x90'),_0x1620('0xb7')]]}]}]})[_0x1620('0x1d')](handleEntityNotFound(_0x2e30ea,null))['then'](function(_0x405f76){if(_0x405f76&&_0x405f76[_0x1620('0xb6')]){_0x4d6d3e=_0x405f76[_0x1620('0x34')]({'plain':!![]});if(_0x4d6d3e[_0x1620('0xb6')]&&_0x4d6d3e[_0x1620('0xb6')][_0x1620('0xa2')][_0x1620('0x48')]){return _0x4d6d3e[_0x1620('0xb6')][_0x1620('0xa2')][0x0];}return db[_0x1620('0x8d')]['create'](_['defaults'](_0x341d95[_0x1620('0x5a')],{'firstName':_0x3c682b,'mobile':_0x3c682b,'phone':_0x3c682b,'ListId':_0x4d6d3e[_0x1620('0xb8')]}));}})[_0x1620('0x1d')](handleEntityNotFound(_0x2e30ea,null))[_0x1620('0x1d')](function(_0x3d7c08){if(_0x3d7c08){_0x59fd98=_0x3d7c08;return db[_0x1620('0xa4')]['find']({'where':{'ContactId':_0x59fd98['id'],'closed':![],'WhatsappAccountId':_0x4d6d3e['id']}})[_0x1620('0x1d')](function(_0x408946){if(_0x408946){return[_0x408946,![]];}return db[_0x1620('0xa4')][_0x1620('0x59')]({'UserId':_0x341d95[_0x1620('0x5b')]['id'],'ContactId':_0x59fd98['id'],'WhatsappAccountId':_0x4d6d3e['id'],'phone':_0x3c682b,'firstMsgDirection':_0x1620('0xb9'),'Messages':[_[_0x1620('0x4f')](_0x341d95[_0x1620('0x5a')],{'read':![],'body':_0x341d95[_0x1620('0x5a')][_0x1620('0x5a')],'phone':_0x3c682b,'WhatsappAccountId':_0x4d6d3e['id'],'UserId':_0x341d95[_0x1620('0x5b')]['id'],'ContactId':_0x59fd98['id']})]},{'include':[{'model':db[_0x1620('0xa9')],'as':'Messages'}]})[_0x1620('0x1d')](function(_0x466da9){return[_0x466da9,!![]];});});}})[_0x1620('0x71')](function(_0x45bba6,_0x378d80){if(_0x378d80){return _0x45bba6;}return db['WhatsappMessage'][_0x1620('0x59')](_[_0x1620('0x4f')](_0x341d95[_0x1620('0x5a')],{'read':![],'body':_0x341d95[_0x1620('0x5a')][_0x1620('0x5a')],'phone':_0x3c682b,'WhatsappAccountId':_0x4d6d3e['id'],'WhatsappInteractionId':_0x45bba6['id'],'UserId':_0x341d95[_0x1620('0x5b')]['id'],'ContactId':_0x59fd98['id']}))[_0x1620('0x1d')](function(_0x58bc88){_0x45bba6[_0x1620('0xba')]['Messages']=[];_0x45bba6[_0x1620('0xba')][_0x1620('0xbb')]['push'](_0x58bc88[_0x1620('0xba')]);return _0x45bba6;});})[_0x1620('0x1d')](respondWithResult(_0x2e30ea,null))[_0x1620('0x27')](handleError(_0x2e30ea,null));}; \ No newline at end of file +var _0x6b21=['WhatsappAccount','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','rows','catch','show','params','mandatoryDispositionPause','keys','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','pick','WhatsappAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','findAll','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','ListId','mobile','twilio','from','From','whatsapp:','Body','MessageSid','sinch','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','created','push','close','unmanaged','*,*,*,*','interaction','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x6b21,0x148));var _0x16b2=function(_0x4c8558,_0x1ba190){_0x4c8558=_0x4c8558-0x0;var _0xb77539=_0x6b21[_0x4c8558];return _0xb77539;};'use strict';var emlformat=require(_0x16b2('0x0'));var rimraf=require(_0x16b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16b2('0x2'));var rp=require(_0x16b2('0x3'));var moment=require(_0x16b2('0x4'));var BPromise=require(_0x16b2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x16b2('0x6'));var sox=require('sox');var csv=require(_0x16b2('0x7'));var ejs=require(_0x16b2('0x8'));var fs=require('fs');var fs_extra=require(_0x16b2('0x9'));var _=require(_0x16b2('0xa'));var squel=require('squel');var crypto=require(_0x16b2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x16b2('0xc'));var toCsv=require(_0x16b2('0x7'));var querystring=require(_0x16b2('0xd'));var Papa=require(_0x16b2('0xe'));var Redis=require('ioredis');var authService=require(_0x16b2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x16b2('0x10'));var hardwareService=require(_0x16b2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x16b2('0x12'));var config=require(_0x16b2('0x13'));var licenseUtil=require(_0x16b2('0x14'));var db=require(_0x16b2('0x15'))['db'];config['redis']=_[_0x16b2('0x16')](config['redis'],{'host':_0x16b2('0x17'),'port':0x18eb});var socket=require(_0x16b2('0x18'))(new Redis(config[_0x16b2('0x19')]));require(_0x16b2('0x1a'))['register'](socket);var jayson=require(_0x16b2('0x1b'));var client=jayson[_0x16b2('0x1c')][_0x16b2('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x516b38,_0x5caf7e,_0x167e83,_0x12da9c){return new BPromise(function(_0x21f6f7,_0x196b2a){var _0x17297b=_0x12da9c||client;return _0x17297b[_0x16b2('0x1e')](_0x516b38,_0x167e83)[_0x16b2('0x1f')](function(_0x2eee8f){logger[_0x16b2('0x20')](_0x16b2('0x21'),_0x5caf7e,_0x16b2('0x22'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5caf7e,_0x16b2('0x22'),JSON[_0x16b2('0x23')](_0x2eee8f));if(_0x2eee8f[_0x16b2('0x24')]){if(_0x2eee8f[_0x16b2('0x24')][_0x16b2('0x25')]===0x1f4){logger[_0x16b2('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x5caf7e,_0x2eee8f[_0x16b2('0x24')]['message']);return _0x196b2a(_0x2eee8f[_0x16b2('0x24')][_0x16b2('0x26')]);}logger['error'](_0x16b2('0x21'),_0x5caf7e,_0x2eee8f['error']['message']);return _0x21f6f7(_0x2eee8f[_0x16b2('0x24')][_0x16b2('0x26')]);}else{logger[_0x16b2('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x5caf7e,'request\x20sent');_0x21f6f7(_0x2eee8f[_0x16b2('0x27')][_0x16b2('0x26')]);}})['catch'](function(_0xe32a4b){logger['error'](_0x16b2('0x21'),_0x5caf7e,_0xe32a4b);_0x196b2a(_0xe32a4b);});});}function respondWithStatusCode(_0x26ed4d,_0x1d503d){_0x1d503d=_0x1d503d||0xcc;return function(_0x210ef){if(_0x210ef){return _0x26ed4d[_0x16b2('0x28')](_0x1d503d);}return _0x26ed4d[_0x16b2('0x29')](_0x1d503d)['end']();};}function respondWithResult(_0x2b3d9b,_0x2c75d4){_0x2c75d4=_0x2c75d4||0xc8;return function(_0x5ac35b){if(_0x5ac35b){return _0x2b3d9b[_0x16b2('0x29')](_0x2c75d4)[_0x16b2('0x2a')](_0x5ac35b);}};}function respondWithFilteredResult(_0x4ecb54,_0x71455f){return function(_0x278a76){if(_0x278a76){var _0xf4500d=typeof _0x71455f[_0x16b2('0x2b')]===_0x16b2('0x2c')&&typeof _0x71455f[_0x16b2('0x2d')]===_0x16b2('0x2c');var _0x8fa4ad=_0x278a76[_0x16b2('0x2e')];var _0x1c0c9e=_0xf4500d?0x0:_0x71455f['offset'];var _0x3d7dcf=_0xf4500d?_0x278a76[_0x16b2('0x2e')]:_0x71455f['offset']+_0x71455f[_0x16b2('0x2d')];var _0x9cd7e5;if(_0x3d7dcf>=_0x8fa4ad){_0x3d7dcf=_0x8fa4ad;_0x9cd7e5=0xc8;}else{_0x9cd7e5=0xce;}_0x4ecb54[_0x16b2('0x29')](_0x9cd7e5);return _0x4ecb54['set'](_0x16b2('0x2f'),_0x1c0c9e+'-'+_0x3d7dcf+'/'+_0x8fa4ad)[_0x16b2('0x2a')](_0x278a76);}return null;};}function patchUpdates(_0x48660e){return function(_0x1311c7){try{jsonpatch[_0x16b2('0x30')](_0x1311c7,_0x48660e,!![]);}catch(_0xa15cb2){return BPromise[_0x16b2('0x31')](_0xa15cb2);}return _0x1311c7[_0x16b2('0x32')]();};}function saveUpdates(_0x2fe82f,_0x404154){return function(_0x5bc365){if(_0x5bc365){return _0x5bc365[_0x16b2('0x33')](_0x2fe82f)['then'](function(_0x3ab100){return _0x3ab100;});}return null;};}function removeEntity(_0x110e58,_0x254953){return function(_0x268ba3){if(_0x268ba3){return _0x268ba3[_0x16b2('0x34')]()[_0x16b2('0x1f')](function(){var _0xfbfb25=_0x268ba3[_0x16b2('0x35')]({'plain':!![]});var _0xe0b1dc=_0x16b2('0x36');return db[_0x16b2('0x37')][_0x16b2('0x34')]({'where':{'type':_0xe0b1dc,'resourceId':_0xfbfb25['id']}})[_0x16b2('0x1f')](function(){return _0x268ba3;});})[_0x16b2('0x1f')](function(){_0x110e58[_0x16b2('0x29')](0xcc)[_0x16b2('0x38')]();});}};}function handleEntityNotFound(_0x592ebc,_0x12482a){return function(_0x59d464){if(!_0x59d464){_0x592ebc['sendStatus'](0x194);}return _0x59d464;};}function handleError(_0x25b79c,_0x10802f){_0x10802f=_0x10802f||0x1f4;return function(_0x17e426){logger['error'](_0x17e426[_0x16b2('0x39')]);if(_0x17e426['name']){delete _0x17e426[_0x16b2('0x3a')];}_0x25b79c[_0x16b2('0x29')](_0x10802f)[_0x16b2('0x3b')](_0x17e426);};}exports[_0x16b2('0x3c')]=function(_0x14105c,_0x3bacc2){var _0x28ca11={'include':[{'model':db[_0x16b2('0x3d')],'as':'mandatoryDispositionPause'}]},_0x4cb805={},_0xa10d94={'count':0x0,'rows':[]};var _0x5173d2=_['map'](db[_0x16b2('0x3e')][_0x16b2('0x3f')],function(_0x7f7dbc){return{'name':_0x7f7dbc[_0x16b2('0x40')],'type':_0x7f7dbc[_0x16b2('0x41')][_0x16b2('0x42')]};});_0x4cb805['model']=_[_0x16b2('0x43')](_0x5173d2,'name');_0x4cb805['query']=_['keys'](_0x14105c[_0x16b2('0x44')]);_0x4cb805[_0x16b2('0x45')]=_[_0x16b2('0x46')](_0x4cb805['model'],_0x4cb805[_0x16b2('0x44')]);_0x28ca11[_0x16b2('0x47')]=_[_0x16b2('0x46')](_0x4cb805['model'],qs[_0x16b2('0x48')](_0x14105c[_0x16b2('0x44')]['fields']));_0x28ca11[_0x16b2('0x47')]=_0x28ca11[_0x16b2('0x47')]['length']?_0x28ca11['attributes']:_0x4cb805[_0x16b2('0x49')];if(!_0x14105c[_0x16b2('0x44')][_0x16b2('0x4a')](_0x16b2('0x4b'))){_0x28ca11[_0x16b2('0x2d')]=qs['limit'](_0x14105c[_0x16b2('0x44')][_0x16b2('0x2d')]);_0x28ca11[_0x16b2('0x2b')]=qs[_0x16b2('0x2b')](_0x14105c[_0x16b2('0x44')]['offset']);}_0x28ca11[_0x16b2('0x4c')]=qs[_0x16b2('0x4d')](_0x14105c[_0x16b2('0x44')][_0x16b2('0x4d')]);_0x28ca11[_0x16b2('0x4e')]=qs[_0x16b2('0x45')](_['pick'](_0x14105c[_0x16b2('0x44')],_0x4cb805['filters']),_0x5173d2);if(_0x14105c[_0x16b2('0x44')]['filter']){_0x28ca11[_0x16b2('0x4e')]=_['merge'](_0x28ca11['where'],{'$or':_[_0x16b2('0x43')](_0x5173d2,function(_0x563410){if(_0x563410['type']!==_0x16b2('0x4f')){var _0x4e18c9={};_0x4e18c9[_0x563410[_0x16b2('0x3a')]]={'$like':'%'+_0x14105c[_0x16b2('0x44')][_0x16b2('0x50')]+'%'};return _0x4e18c9;}})});}_0x28ca11=_[_0x16b2('0x51')]({},_0x28ca11,_0x14105c[_0x16b2('0x52')]);var _0x1581bb={'where':_0x28ca11[_0x16b2('0x4e')]};return db[_0x16b2('0x3e')][_0x16b2('0x2e')](_0x1581bb)[_0x16b2('0x1f')](function(_0xbdbc74){_0xa10d94[_0x16b2('0x2e')]=_0xbdbc74;if(_0x14105c[_0x16b2('0x44')]['includeAll']){_0x28ca11[_0x16b2('0x53')]=[{'all':!![]}];}return db[_0x16b2('0x3e')]['findAll'](_0x28ca11);})[_0x16b2('0x1f')](function(_0x30ffc3){_0xa10d94[_0x16b2('0x54')]=_0x30ffc3;return _0xa10d94;})['then'](respondWithFilteredResult(_0x3bacc2,_0x28ca11))[_0x16b2('0x55')](handleError(_0x3bacc2,null));};exports[_0x16b2('0x56')]=function(_0x526be7,_0x2e5d1a){var _0x9fa8df={'raw':![],'where':{'id':_0x526be7[_0x16b2('0x57')]['id']},'include':[{'model':db[_0x16b2('0x3d')],'as':_0x16b2('0x58')}]},_0x2f4e17={};_0x2f4e17[_0x16b2('0x49')]=_[_0x16b2('0x59')](db[_0x16b2('0x3e')][_0x16b2('0x3f')]);_0x2f4e17[_0x16b2('0x44')]=_[_0x16b2('0x59')](_0x526be7[_0x16b2('0x44')]);_0x2f4e17[_0x16b2('0x45')]=_[_0x16b2('0x46')](_0x2f4e17[_0x16b2('0x49')],_0x2f4e17['query']);_0x9fa8df[_0x16b2('0x47')]=_[_0x16b2('0x46')](_0x2f4e17[_0x16b2('0x49')],qs['fields'](_0x526be7[_0x16b2('0x44')][_0x16b2('0x48')]));_0x9fa8df[_0x16b2('0x47')]=_0x9fa8df[_0x16b2('0x47')][_0x16b2('0x5a')]?_0x9fa8df[_0x16b2('0x47')]:_0x2f4e17[_0x16b2('0x49')];if(_0x526be7['query']['includeAll']){_0x9fa8df[_0x16b2('0x53')]=[{'all':!![]}];}_0x9fa8df=_['merge']({},_0x9fa8df,_0x526be7[_0x16b2('0x52')]);return db['WhatsappAccount']['find'](_0x9fa8df)[_0x16b2('0x1f')](handleEntityNotFound(_0x2e5d1a,null))[_0x16b2('0x1f')](respondWithResult(_0x2e5d1a,null))[_0x16b2('0x55')](handleError(_0x2e5d1a,null));};exports[_0x16b2('0x5b')]=function(_0x24a0cd,_0x5eb394){return db[_0x16b2('0x3e')][_0x16b2('0x5b')](_0x24a0cd[_0x16b2('0x5c')],{})[_0x16b2('0x1f')](function(_0x137c7d){var _0x360258=_0x24a0cd[_0x16b2('0x5d')]['get']({'plain':!![]});if(!_0x360258)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x360258[_0x16b2('0x5e')]===_0x16b2('0x5d')){var _0x83436a=_0x137c7d[_0x16b2('0x35')]({'plain':!![]});var _0x546898='WhatsappAccounts';return db[_0x16b2('0x5f')][_0x16b2('0x60')]({'where':{'name':_0x546898,'userProfileId':_0x360258[_0x16b2('0x61')]},'raw':!![]})[_0x16b2('0x1f')](function(_0x27f725){if(_0x27f725&&_0x27f725[_0x16b2('0x62')]===0x0){return db[_0x16b2('0x37')][_0x16b2('0x5b')]({'name':_0x83436a['name'],'resourceId':_0x83436a['id'],'type':_0x27f725[_0x16b2('0x3a')],'sectionId':_0x27f725['id']},{})[_0x16b2('0x1f')](function(){return _0x137c7d;});}else{return _0x137c7d;}})[_0x16b2('0x55')](function(_0x2d8b29){logger[_0x16b2('0x24')](_0x16b2('0x63'),_0x2d8b29);throw _0x2d8b29;});}return _0x137c7d;})[_0x16b2('0x1f')](respondWithResult(_0x5eb394,0xc9))[_0x16b2('0x55')](handleError(_0x5eb394,null));};exports[_0x16b2('0x33')]=function(_0x357d4c,_0x35698){if(_0x357d4c['body']['id']){delete _0x357d4c['body']['id'];}return db[_0x16b2('0x3e')]['find']({'where':{'id':_0x357d4c[_0x16b2('0x57')]['id']},'include':[{'model':db[_0x16b2('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x16b2('0x1f')](handleEntityNotFound(_0x35698,null))['then'](saveUpdates(_0x357d4c['body'],null))[_0x16b2('0x1f')](respondWithResult(_0x35698,null))['catch'](handleError(_0x35698,null));};exports['destroy']=function(_0x495b16,_0x10609f){return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x495b16[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0x10609f,null))[_0x16b2('0x1f')](removeEntity(_0x10609f,null))[_0x16b2('0x55')](handleError(_0x10609f,null));};exports['describe']=function(_0x146613,_0x1f0b45){return db[_0x16b2('0x3e')][_0x16b2('0x64')]()['then'](respondWithResult(_0x1f0b45,null))[_0x16b2('0x55')](handleError(_0x1f0b45,null));};exports['addDisposition']=function(_0x15feb6,_0xc85355,_0x159b33){if(_0x15feb6[_0x16b2('0x5c')]['id']){delete _0x15feb6['body']['id'];}return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x15feb6[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0xc85355,null))[_0x16b2('0x1f')](function(_0x286567){if(_0x286567){_0x15feb6[_0x16b2('0x5c')]['WhatsappAccountId']=_0x286567['id'];return db[_0x16b2('0x65')][_0x16b2('0x5b')](_0x15feb6[_0x16b2('0x5c')]);}})[_0x16b2('0x1f')](respondWithResult(_0xc85355,null))[_0x16b2('0x55')](handleError(_0xc85355,null));};exports[_0x16b2('0x66')]=function(_0x14dfb0,_0x3fdb82,_0x520f91){var _0x555acd={'raw':![],'where':{}};var _0x273fef={};var _0x3b4311={'count':0x0,'rows':[]};return db[_0x16b2('0x3e')][_0x16b2('0x67')]({'where':{'id':_0x14dfb0[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0x3fdb82,null))['then'](function(_0x37921c){if(_0x37921c){_0x273fef[_0x16b2('0x49')]=_[_0x16b2('0x59')](db[_0x16b2('0x65')][_0x16b2('0x3f')]);_0x273fef[_0x16b2('0x44')]=_['keys'](_0x14dfb0['query']);_0x273fef['filters']=_['intersection'](_0x273fef['model'],_0x273fef['query']);_0x555acd[_0x16b2('0x47')]=_[_0x16b2('0x46')](_0x273fef[_0x16b2('0x49')],qs[_0x16b2('0x48')](_0x14dfb0['query'][_0x16b2('0x48')]));_0x555acd[_0x16b2('0x47')]=_0x555acd[_0x16b2('0x47')][_0x16b2('0x5a')]?_0x555acd['attributes']:_0x273fef[_0x16b2('0x49')];if(!_0x14dfb0[_0x16b2('0x44')][_0x16b2('0x4a')](_0x16b2('0x4b'))){_0x555acd[_0x16b2('0x2d')]=qs[_0x16b2('0x2d')](_0x14dfb0[_0x16b2('0x44')]['limit']);_0x555acd[_0x16b2('0x2b')]=qs[_0x16b2('0x2b')](_0x14dfb0[_0x16b2('0x44')][_0x16b2('0x2b')]);}_0x555acd[_0x16b2('0x4c')]=qs[_0x16b2('0x4d')](_0x14dfb0[_0x16b2('0x44')]['sort']);_0x555acd[_0x16b2('0x4e')]=qs[_0x16b2('0x45')](_[_0x16b2('0x68')](_0x14dfb0[_0x16b2('0x44')],_0x273fef[_0x16b2('0x45')]));_0x555acd[_0x16b2('0x4e')][_0x16b2('0x69')]=_0x37921c['id'];if(_0x14dfb0[_0x16b2('0x44')][_0x16b2('0x50')]){_0x555acd[_0x16b2('0x4e')]=_[_0x16b2('0x51')](_0x555acd['where'],{'$or':_[_0x16b2('0x43')](_0x555acd[_0x16b2('0x47')],function(_0x49af66){var _0x41b021={};_0x41b021[_0x49af66]={'$like':'%'+_0x14dfb0[_0x16b2('0x44')]['filter']+'%'};return _0x41b021;})});}_0x555acd=_[_0x16b2('0x51')]({},_0x555acd,_0x14dfb0[_0x16b2('0x52')]);return db[_0x16b2('0x65')][_0x16b2('0x2e')]({'where':_0x555acd[_0x16b2('0x4e')]})['then'](function(_0x319f75){_0x3b4311[_0x16b2('0x2e')]=_0x319f75;if(_0x14dfb0[_0x16b2('0x44')][_0x16b2('0x6a')]){_0x555acd['include']=[{'all':!![]}];}return db[_0x16b2('0x65')]['findAll'](_0x555acd);})[_0x16b2('0x1f')](function(_0x4bef91){_0x3b4311[_0x16b2('0x54')]=_0x4bef91;return _0x3b4311;});}})['then'](respondWithFilteredResult(_0x3fdb82,_0x555acd))[_0x16b2('0x55')](handleError(_0x3fdb82,null));};exports[_0x16b2('0x6b')]=function(_0x59ca87,_0x4f318a,_0x53308d){return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x59ca87[_0x16b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x4f318a,null))[_0x16b2('0x1f')](function(_0x4938ea){if(_0x4938ea){return _0x4938ea['removeDispositions'](_0x59ca87[_0x16b2('0x44')][_0x16b2('0x6c')]);}})[_0x16b2('0x1f')](respondWithStatusCode(_0x4f318a,null))['catch'](handleError(_0x4f318a,null));};exports[_0x16b2('0x6d')]=function(_0x2ec646,_0xc59a9d,_0x2fdbb8){if(_0x2ec646[_0x16b2('0x5c')]['id']){delete _0x2ec646[_0x16b2('0x5c')]['id'];}return db[_0x16b2('0x3e')]['find']({'where':{'id':_0x2ec646['params']['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0xc59a9d,null))[_0x16b2('0x1f')](function(_0x4d5e85){if(_0x4d5e85){_0x2ec646[_0x16b2('0x5c')][_0x16b2('0x69')]=_0x4d5e85['id'];return db[_0x16b2('0x6e')][_0x16b2('0x5b')](_0x2ec646[_0x16b2('0x5c')]);}})[_0x16b2('0x1f')](respondWithResult(_0xc59a9d,null))['catch'](handleError(_0xc59a9d,null));};exports['getAnswers']=function(_0x1aa21f,_0x4e207e,_0x30afdb){var _0x70196b={'raw':![],'where':{}};var _0x2d316b={};var _0x4ffc9d={'count':0x0,'rows':[]};return db[_0x16b2('0x3e')]['findOne']({'where':{'id':_0x1aa21f[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0x4e207e,null))[_0x16b2('0x1f')](function(_0x1d7d6a){if(_0x1d7d6a){_0x2d316b[_0x16b2('0x49')]=_['keys'](db[_0x16b2('0x6e')][_0x16b2('0x3f')]);_0x2d316b[_0x16b2('0x44')]=_['keys'](_0x1aa21f[_0x16b2('0x44')]);_0x2d316b[_0x16b2('0x45')]=_[_0x16b2('0x46')](_0x2d316b[_0x16b2('0x49')],_0x2d316b[_0x16b2('0x44')]);_0x70196b['attributes']=_['intersection'](_0x2d316b[_0x16b2('0x49')],qs['fields'](_0x1aa21f['query'][_0x16b2('0x48')]));_0x70196b[_0x16b2('0x47')]=_0x70196b['attributes'][_0x16b2('0x5a')]?_0x70196b['attributes']:_0x2d316b[_0x16b2('0x49')];if(!_0x1aa21f['query'][_0x16b2('0x4a')](_0x16b2('0x4b'))){_0x70196b['limit']=qs['limit'](_0x1aa21f['query'][_0x16b2('0x2d')]);_0x70196b['offset']=qs[_0x16b2('0x2b')](_0x1aa21f[_0x16b2('0x44')]['offset']);}_0x70196b['order']=qs['sort'](_0x1aa21f['query'][_0x16b2('0x4d')]);_0x70196b[_0x16b2('0x4e')]=qs['filters'](_['pick'](_0x1aa21f[_0x16b2('0x44')],_0x2d316b[_0x16b2('0x45')]));_0x70196b['where']['WhatsappAccountId']=_0x1d7d6a['id'];if(_0x1aa21f[_0x16b2('0x44')][_0x16b2('0x50')]){_0x70196b['where']=_[_0x16b2('0x51')](_0x70196b[_0x16b2('0x4e')],{'$or':_['map'](_0x70196b['attributes'],function(_0xab1f9d){var _0x2f1dc2={};_0x2f1dc2[_0xab1f9d]={'$like':'%'+_0x1aa21f[_0x16b2('0x44')]['filter']+'%'};return _0x2f1dc2;})});}_0x70196b=_[_0x16b2('0x51')]({},_0x70196b,_0x1aa21f[_0x16b2('0x52')]);return db[_0x16b2('0x6e')][_0x16b2('0x2e')]({'where':_0x70196b[_0x16b2('0x4e')]})[_0x16b2('0x1f')](function(_0x2fe7a5){_0x4ffc9d[_0x16b2('0x2e')]=_0x2fe7a5;if(_0x1aa21f[_0x16b2('0x44')]['includeAll']){_0x70196b['include']=[{'all':!![]}];}return db[_0x16b2('0x6e')][_0x16b2('0x6f')](_0x70196b);})[_0x16b2('0x1f')](function(_0x548904){_0x4ffc9d['rows']=_0x548904;return _0x4ffc9d;});}})[_0x16b2('0x1f')](respondWithFilteredResult(_0x4e207e,_0x70196b))[_0x16b2('0x55')](handleError(_0x4e207e,null));};exports['removeAnswers']=function(_0x48fd69,_0x3a1ad9,_0x465661){return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x48fd69[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0x3a1ad9,null))[_0x16b2('0x1f')](function(_0x244a76){if(_0x244a76){return _0x244a76['removeAnswers'](_0x48fd69[_0x16b2('0x44')][_0x16b2('0x6c')]);}})[_0x16b2('0x1f')](respondWithStatusCode(_0x3a1ad9,null))[_0x16b2('0x55')](handleError(_0x3a1ad9,null));};exports[_0x16b2('0x70')]=function(_0x45dd94,_0x25a76b,_0x3dcb2d){return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x45dd94[_0x16b2('0x57')]['id']}})[_0x16b2('0x1f')](handleEntityNotFound(_0x25a76b,null))[_0x16b2('0x1f')](function(_0x383a65){if(_0x383a65){return _0x383a65[_0x16b2('0x70')](_0x45dd94[_0x16b2('0x5c')][_0x16b2('0x6c')],_[_0x16b2('0x71')](_0x45dd94['body'],[_0x16b2('0x6c'),'id'])||{})[_0x16b2('0x72')](function(_0x1bb149){for(var _0x431eac=0x0;_0x431eac<_0x45dd94[_0x16b2('0x5c')][_0x16b2('0x6c')][_0x16b2('0x5a')];_0x431eac+=0x1){socket[_0x16b2('0x73')](_0x16b2('0x74'),{'UserId':Number(_0x45dd94['body'][_0x16b2('0x6c')][_0x431eac]),'WhatsappAccountId':Number(_0x45dd94[_0x16b2('0x57')]['id'])});}return _0x1bb149;});}})[_0x16b2('0x1f')](respondWithResult(_0x25a76b,null))[_0x16b2('0x55')](handleError(_0x25a76b,null));};exports[_0x16b2('0x75')]=function(_0x3f2dc6,_0x134ba3,_0x511ab8){return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x3f2dc6[_0x16b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x134ba3,null))[_0x16b2('0x1f')](function(_0x304e8a){if(_0x304e8a){return _0x304e8a[_0x16b2('0x75')](_0x3f2dc6[_0x16b2('0x44')][_0x16b2('0x6c')])[_0x16b2('0x1f')](function(){if(_[_0x16b2('0x76')](_0x3f2dc6['query'][_0x16b2('0x6c')])){for(var _0xd8e5c7=0x0;_0xd8e5c7<_0x3f2dc6[_0x16b2('0x44')]['ids'][_0x16b2('0x5a')];_0xd8e5c7+=0x1){socket['emit'](_0x16b2('0x77'),{'UserId':Number(_0x3f2dc6[_0x16b2('0x44')]['ids'][_0xd8e5c7]),'WhatsappAccountId':Number(_0x3f2dc6['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x3f2dc6[_0x16b2('0x44')][_0x16b2('0x6c')]),'WhatsappAccountId':Number(_0x3f2dc6[_0x16b2('0x57')]['id'])});}});}})[_0x16b2('0x1f')](respondWithStatusCode(_0x134ba3,null))[_0x16b2('0x55')](handleError(_0x134ba3,null));};exports[_0x16b2('0x78')]=function(_0x5dbe57,_0x5aa7f7,_0x241932){var _0x552a86={};var _0x5aa086={};var _0x6c7a38;var _0x2ad415;return db[_0x16b2('0x3e')][_0x16b2('0x67')]({'where':{'id':_0x5dbe57[_0x16b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x5aa7f7,null))['then'](function(_0xf92b72){if(_0xf92b72){_0x6c7a38=_0xf92b72;_0x5aa086[_0x16b2('0x49')]=_['keys'](db['User'][_0x16b2('0x3f')]);_0x5aa086[_0x16b2('0x44')]=_[_0x16b2('0x59')](_0x5dbe57['query']);_0x5aa086['filters']=_['intersection'](_0x5aa086[_0x16b2('0x49')],_0x5aa086['query']);_0x552a86['attributes']=_['intersection'](_0x5aa086[_0x16b2('0x49')],qs['fields'](_0x5dbe57[_0x16b2('0x44')][_0x16b2('0x48')]));_0x552a86[_0x16b2('0x47')]=_0x552a86[_0x16b2('0x47')][_0x16b2('0x5a')]?_0x552a86[_0x16b2('0x47')]:_0x5aa086[_0x16b2('0x49')];_0x552a86[_0x16b2('0x4c')]=qs[_0x16b2('0x4d')](_0x5dbe57[_0x16b2('0x44')]['sort']);_0x552a86['where']=qs[_0x16b2('0x45')](_[_0x16b2('0x68')](_0x5dbe57[_0x16b2('0x44')],_0x5aa086[_0x16b2('0x45')]));if(_0x5dbe57[_0x16b2('0x44')][_0x16b2('0x50')]){_0x552a86[_0x16b2('0x4e')]=_[_0x16b2('0x51')](_0x552a86[_0x16b2('0x4e')],{'$or':_[_0x16b2('0x43')](_0x552a86[_0x16b2('0x47')],function(_0x573775){var _0x1569ac={};_0x1569ac[_0x573775]={'$like':'%'+_0x5dbe57[_0x16b2('0x44')][_0x16b2('0x50')]+'%'};return _0x1569ac;})});}_0x552a86=_[_0x16b2('0x51')]({},_0x552a86,_0x5dbe57[_0x16b2('0x52')]);return _0x6c7a38[_0x16b2('0x78')](_0x552a86);}})[_0x16b2('0x1f')](function(_0x12598f){if(_0x12598f){_0x2ad415=_0x12598f[_0x16b2('0x5a')];if(!_0x5dbe57['query'][_0x16b2('0x4a')](_0x16b2('0x4b'))){_0x552a86['limit']=qs[_0x16b2('0x2d')](_0x5dbe57['query']['limit']);_0x552a86[_0x16b2('0x2b')]=qs[_0x16b2('0x2b')](_0x5dbe57['query']['offset']);}return _0x6c7a38[_0x16b2('0x78')](_0x552a86);}})[_0x16b2('0x1f')](function(_0x44c547){if(_0x44c547){return _0x44c547?{'count':_0x2ad415,'rows':_0x44c547}:null;}})[_0x16b2('0x1f')](respondWithResult(_0x5aa7f7,null))[_0x16b2('0x55')](handleError(_0x5aa7f7,null));};exports['addApplications']=function(_0x3be2c6,_0xfff6af){var _0x46e3c9=_0x3be2c6['params']['id'];var _0x53c291=_0x3be2c6[_0x16b2('0x5c')];var _0x448e73=0xc8;var _0x3316fd=null;return db[_0x16b2('0x79')]['transaction']({'isolationLevel':db[_0x16b2('0x79')]['Transaction'][_0x16b2('0x7a')][_0x16b2('0x7b')]},function(_0x52767){return db['WhatsappAccount'][_0x16b2('0x67')]({'where':{'id':_0x46e3c9},'transaction':_0x52767})[_0x16b2('0x1f')](function(_0x49320a){if(_0x49320a){return db[_0x16b2('0x7c')][_0x16b2('0x34')]({'where':{'WhatsappAccountId':_0x46e3c9},'transaction':_0x52767})['then'](function(){var _0x25677c=_[_0x16b2('0x43')](_0x53c291,function(_0x32a59a){_0x32a59a[_0x16b2('0x69')]=_0x46e3c9;return _0x32a59a;});return db[_0x16b2('0x7c')][_0x16b2('0x7d')](_0x25677c,{'transaction':_0x52767});});}else{_0x448e73=0x194;_0x3316fd=[];}});})[_0x16b2('0x1f')](function(){if(_0x448e73!==0x194){return db[_0x16b2('0x7c')][_0x16b2('0x7e')]({'where':{'WhatsappAccountId':_0x46e3c9},'order':_0x16b2('0x7f')})[_0x16b2('0x1f')](function(_0x5d56d2){_0x3316fd=_0x5d56d2;});}})['catch'](function(_0x149132){_0x448e73=0x1f4;logger[_0x16b2('0x24')](_0x149132[_0x16b2('0x39')]);if(_0x149132[_0x16b2('0x3a')]){delete _0x149132[_0x16b2('0x3a')];}_0x3316fd=_0x149132;})[_0x16b2('0x80')](function(){if(_0x3316fd===null){_0xfff6af[_0x16b2('0x28')](_0x448e73);}else{if(_0x448e73===0x1f4){_0xfff6af[_0x16b2('0x29')](_0x448e73)[_0x16b2('0x3b')](_0x3316fd);}else{_0xfff6af[_0x16b2('0x29')](_0x448e73)[_0x16b2('0x2a')](_0x3316fd);}}});};exports[_0x16b2('0x81')]=function(_0x1467c5,_0x254d9c,_0x3d9b19){var _0x4faae5={};var _0x357a6f={};var _0x37809a;var _0x36c440;return db[_0x16b2('0x3e')]['findOne']({'where':{'id':_0x1467c5['params']['id']}})['then'](handleEntityNotFound(_0x254d9c,null))[_0x16b2('0x1f')](function(_0x38ca77){if(_0x38ca77){_0x37809a=_0x38ca77;_0x357a6f[_0x16b2('0x49')]=_[_0x16b2('0x59')](db[_0x16b2('0x7c')][_0x16b2('0x3f')]);_0x357a6f['query']=_[_0x16b2('0x59')](_0x1467c5[_0x16b2('0x44')]);_0x357a6f['filters']=_[_0x16b2('0x46')](_0x357a6f[_0x16b2('0x49')],_0x357a6f[_0x16b2('0x44')]);_0x4faae5[_0x16b2('0x47')]=_[_0x16b2('0x46')](_0x357a6f['model'],qs[_0x16b2('0x48')](_0x1467c5[_0x16b2('0x44')][_0x16b2('0x48')]));_0x4faae5[_0x16b2('0x47')]=_0x4faae5['attributes']['length']?_0x4faae5[_0x16b2('0x47')]:_0x357a6f[_0x16b2('0x49')];_0x4faae5['order']=qs[_0x16b2('0x4d')](_0x1467c5['query'][_0x16b2('0x4d')]);_0x4faae5[_0x16b2('0x4e')]=qs[_0x16b2('0x45')](_[_0x16b2('0x68')](_0x1467c5['query'],_0x357a6f[_0x16b2('0x45')]));if(_0x1467c5['query'][_0x16b2('0x50')]){_0x4faae5[_0x16b2('0x4e')]=_[_0x16b2('0x51')](_0x4faae5[_0x16b2('0x4e')],{'$or':_['map'](_0x4faae5[_0x16b2('0x47')],function(_0x2b24cf){var _0x48ef8d={};_0x48ef8d[_0x2b24cf]={'$like':'%'+_0x1467c5['query']['filter']+'%'};return _0x48ef8d;})});}_0x4faae5=_[_0x16b2('0x51')]({},_0x4faae5,_0x1467c5['options']);return _0x37809a[_0x16b2('0x81')](_0x4faae5);}})[_0x16b2('0x1f')](function(_0xc2c622){if(_0xc2c622){_0x36c440=_0xc2c622[_0x16b2('0x5a')];if(!_0x1467c5[_0x16b2('0x44')][_0x16b2('0x4a')](_0x16b2('0x4b'))){_0x4faae5['limit']=qs[_0x16b2('0x2d')](_0x1467c5['query'][_0x16b2('0x2d')]);_0x4faae5[_0x16b2('0x2b')]=qs[_0x16b2('0x2b')](_0x1467c5[_0x16b2('0x44')][_0x16b2('0x2b')]);}return _0x37809a[_0x16b2('0x81')](_0x4faae5);}})[_0x16b2('0x1f')](function(_0x5590ac){if(_0x5590ac){return _0x5590ac?{'count':_0x36c440,'rows':_0x5590ac}:null;}})['then'](respondWithResult(_0x254d9c,null))[_0x16b2('0x55')](handleError(_0x254d9c,null));};exports['notify']=function(_0x39bde4,_0x5f2f2f,_0x2b126f){var _0x49b307={'channel':_0x16b2('0x82')};var _0x11a8d7=[];var _0x1cb6bd=[];var _0x452c8c={};return db['WhatsappAccount'][_0x16b2('0x60')]({'where':{'id':_0x39bde4['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x16b2('0x83')}]})['then'](handleEntityNotFound(_0x5f2f2f,null))[_0x16b2('0x1f')](function(_0x2f2f98){_0x49b307[_0x16b2('0x84')]=_0x2f2f98;if(_0x49b307[_0x16b2('0x84')]&&_0x49b307[_0x16b2('0x84')]['type']==='sinch'&&_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x85')]){if(_0x39bde4['body'][_0x16b2('0x85')][_0x16b2('0x5a')]===0x0)return;if(_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x85')][0x0][_0x16b2('0x86')]!=='read')return;return db[_0x16b2('0x87')][_0x16b2('0x33')]({'read':!![],'readAt':_0x39bde4[_0x16b2('0x5c')]['statuses'][0x0][_0x16b2('0x88')]},{'where':{'messageId':_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x85')][0x0][_0x16b2('0x89')]},'individualHooks':!![]})[_0x16b2('0x1f')](function(_0x35517d){return _0x5f2f2f[_0x16b2('0x29')](0xc8)[_0x16b2('0x2a')](_0x35517d);});}_0x49b307[_0x16b2('0x8a')]=_[_0x16b2('0x8b')](_0x2f2f98['Applications'],[_0x16b2('0x7f')],[_0x16b2('0x8c')]);if(_0x49b307['account'][_0x16b2('0x83')]){delete _0x49b307['account'][_0x16b2('0x83')];}return db[_0x16b2('0x8d')]['describe']()[_0x16b2('0x1f')](function(_0x3cae85){if(!_0x3cae85){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0x90'));}_0x11a8d7=_[_0x16b2('0x91')](_['keys'](_0x3cae85),['createdAt',_0x16b2('0x92')]);_0x1cb6bd=_[_0x16b2('0x91')](_[_0x16b2('0x59')](_0x3cae85),['createdAt','updatedAt','CompanyId',_0x16b2('0x93')]);_0x49b307[_0x16b2('0x5c')]={'mapKey':_0x16b2('0x94')};if(_0x49b307[_0x16b2('0x84')]&&_0x49b307['account'][_0x16b2('0x41')]===_0x16b2('0x95')){_0x49b307[_0x16b2('0x5c')][_0x16b2('0x96')]=_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x97')]['replace'](_0x16b2('0x98'),'');_0x49b307[_0x16b2('0x5c')][_0x16b2('0x5c')]=_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x99')];_0x49b307['body']['messageId']=_0x39bde4[_0x16b2('0x5c')][_0x16b2('0x9a')];}if(_0x49b307[_0x16b2('0x84')]&&_0x49b307['account'][_0x16b2('0x41')]===_0x16b2('0x9b')){_0x49b307['body'][_0x16b2('0x96')]=_0x39bde4['body'][_0x16b2('0x9c')][0x0][_0x16b2('0x96')];_0x49b307[_0x16b2('0x5c')]['body']=_0x39bde4['body']['notifications'][0x0][_0x16b2('0x26')][_0x16b2('0x5c')];_0x49b307[_0x16b2('0x5c')][_0x16b2('0x9d')]=_0x39bde4['body'][_0x16b2('0x9c')][0x0][_0x16b2('0x89')];}if(_0x49b307[_0x16b2('0x5c')]['id']){delete _0x49b307[_0x16b2('0x5c')]['id'];}if(_[_0x16b2('0x9e')](_0x49b307[_0x16b2('0x5c')][_0x16b2('0x96')])){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0x9f'));}if(_[_0x16b2('0x9e')](_0x49b307['body'][_0x16b2('0x5c')])||_0x49b307[_0x16b2('0x5c')][_0x16b2('0x5c')]===''){throw new db['Sequelize'][(_0x16b2('0x8f'))](_0x16b2('0xa0'));}if(_['isNil'](_0x49b307[_0x16b2('0x5c')]['mapKey'])){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0xa1')+_0x1cb6bd);}if(!_[_0x16b2('0xa2')](_0x1cb6bd,_0x49b307[_0x16b2('0x5c')]['mapKey'])){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0xa3')+_0x1cb6bd);}_0x452c8c[_0x49b307[_0x16b2('0x5c')]['mapKey']]=_0x49b307['body'][_0x16b2('0x96')];return db[_0x16b2('0xa4')][_0x16b2('0x60')]({'where':{'id':_0x49b307[_0x16b2('0x84')]['ListId']},'include':[{'model':db[_0x16b2('0x8d')],'as':_0x16b2('0xa5'),'where':_0x452c8c,'limit':0x1,'order':[[_0x16b2('0x92'),_0x16b2('0xa6')]]}]});})['then'](handleEntityNotFound(_0x5f2f2f,null))[_0x16b2('0x1f')](function(_0x43f2a4){if(_0x43f2a4){_0x49b307[_0x16b2('0xa7')]=_[_0x16b2('0x71')](_0x43f2a4,[_0x16b2('0xa5')]);if(_0x43f2a4[_0x16b2('0xa5')][_0x16b2('0x5a')]){return _0x43f2a4[_0x16b2('0xa5')][0x0];}var _0x1697a6=_[_0x16b2('0x16')](_0x49b307[_0x16b2('0x5c')],{'firstName':_0x49b307[_0x16b2('0x5c')][_0x16b2('0x96')],'ListId':_0x43f2a4['id']});_0x1697a6[_0x49b307[_0x16b2('0x5c')]['mapKey']]=_0x49b307['body'][_0x16b2('0x96')];return db[_0x16b2('0x8d')][_0x16b2('0x5b')](_0x1697a6,{'fields':_0x11a8d7,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f2f2f,null))['then'](function(_0xbc0ebc){if(_0xbc0ebc){_0x49b307[_0x16b2('0xa8')]=_0xbc0ebc;var _0xefa8d4={'ContactId':_0xbc0ebc['id'],'phone':_0x49b307[_0x16b2('0x5c')]['from'],'WhatsappAccountId':_0x39bde4[_0x16b2('0x57')]['id']};var _0x4b7f0e={'ContactId':_0xbc0ebc['id'],'WhatsappAccountId':_0x39bde4['params']['id'],'closed':![]};return db[_0x16b2('0xa9')][_0x16b2('0x60')]({'where':_0x4b7f0e})[_0x16b2('0x1f')](function(_0x40123f){if(_0x40123f){return[_0x40123f,![]];}return db[_0x16b2('0xa9')][_0x16b2('0x5b')](_0xefa8d4)[_0x16b2('0x1f')](function(_0x5cdfbd){return[_0x5cdfbd,!![]];});});}})['spread'](function(_0x179129,_0x3538eb){_0x49b307['interaction']=_0x179129[_0x16b2('0x35')]({'plain':!![]});_0x49b307['interaction'][_0x16b2('0xaa')]=![];if(_0x3538eb){if(_0x49b307[_0x16b2('0x84')]['autoclose']){_0x49b307[_0x16b2('0x8a')][_0x16b2('0xab')]({'id':0x0,'priority':_0x49b307[_0x16b2('0x8a')][_0x16b2('0x5a')]+0x1,'app':_0x16b2('0xac'),'appdata':_0x16b2('0xad'),'interval':_0x16b2('0xae')});}_0x49b307[_0x16b2('0xaf')][_0x16b2('0xaa')]=!![];}return db[_0x16b2('0x87')][_0x16b2('0x5b')]({'phone':_0x49b307[_0x16b2('0x5c')][_0x16b2('0x96')],'messageId':_0x49b307[_0x16b2('0x5c')][_0x16b2('0x9d')],'body':_0x49b307[_0x16b2('0x5c')]['body'],'WhatsappAccountId':_0x39bde4[_0x16b2('0x57')]['id'],'WhatsappInteractionId':_0x179129['id'],'direction':'in','ContactId':_0x179129[_0x16b2('0xb0')],'AttachmentId':_0x49b307[_0x16b2('0x5c')]['AttachmentId']});})[_0x16b2('0x1f')](function(_0x23c9b2){_0x49b307[_0x16b2('0x26')]=_0x23c9b2;if(_0x49b307[_0x16b2('0xaf')][_0x16b2('0xb1')]){return db[_0x16b2('0xb2')][_0x16b2('0x60')]({'attributes':['id',_0x16b2('0x3a')],'where':{'id':_0x49b307['interaction']['UserId']}})['then'](function(_0x2d395b){if(_0x2d395b){_0x49b307[_0x16b2('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x16b2('0xb3'),'appdata':_0x2d395b[_0x16b2('0x3a')]+','+(_0x49b307[_0x16b2('0x84')][_0x16b2('0xb4')]||0xa),'interval':_0x16b2('0xae')});}return respondWithRpcPromise(_0x16b2('0xb5'),_0x16b2('0xb6'),_0x49b307);});}return respondWithRpcPromise(_0x16b2('0xb5'),_0x16b2('0xb6'),_0x49b307);})[_0x16b2('0x1f')](function(_0x37381d){if(_0x37381d){var _0x2a4b34=0xc8;var _0x567e00=_0x16b2('0xb7');logger[_0x16b2('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x567e00,_0x2a4b34,_0x16b2('0xb8'));logger[_0x16b2('0xb9')](_0x16b2('0xba'),_0x567e00,_0x2a4b34,_0x16b2('0xb8'),JSON['stringify'](_0x37381d));if(_0x49b307[_0x16b2('0x84')][_0x16b2('0x41')]===_0x16b2('0x95')){return _0x5f2f2f[_0x16b2('0x29')](_0x2a4b34)['set'](_0x16b2('0xbb'),_0x16b2('0xbc'))[_0x16b2('0x3b')](_0x16b2('0xbd'));}else{return _0x5f2f2f[_0x16b2('0x29')](_0x2a4b34)['json'](_0x37381d);}}});})[_0x16b2('0x55')](handleError(_0x5f2f2f,null));};exports['send']=function(_0x431e55,_0x2dfc09,_0x32fe4c){var _0x122519,_0x1f0f52,_0x3b9d42;if(_['isNil'](_0x431e55[_0x16b2('0x5c')][_0x16b2('0x5c')])||_0x431e55['body']['body']===''){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0xa0'));}if(_['isNil'](_0x431e55[_0x16b2('0x5c')]['to'])){throw new db[(_0x16b2('0x8e'))][(_0x16b2('0x8f'))](_0x16b2('0xbe'));}_0x122519=_0x431e55[_0x16b2('0x5c')]['to'];return db[_0x16b2('0x3e')][_0x16b2('0x60')]({'where':{'id':_0x431e55[_0x16b2('0x57')]['id']},'include':[{'model':db[_0x16b2('0xa4')],'as':'List','include':[{'model':db[_0x16b2('0x8d')],'as':'Contacts','where':{'mobile':_0x122519},'limit':0x1,'order':[[_0x16b2('0x92'),_0x16b2('0xa6')]]}]}]})[_0x16b2('0x1f')](handleEntityNotFound(_0x2dfc09,null))[_0x16b2('0x1f')](function(_0x3415d9){if(_0x3415d9&&_0x3415d9['List']){_0x1f0f52=_0x3415d9[_0x16b2('0x35')]({'plain':!![]});if(_0x1f0f52['List']&&_0x1f0f52[_0x16b2('0xbf')][_0x16b2('0xa5')][_0x16b2('0x5a')]){return _0x1f0f52[_0x16b2('0xbf')][_0x16b2('0xa5')][0x0];}return db[_0x16b2('0x8d')]['create'](_[_0x16b2('0x16')](_0x431e55['body'],{'firstName':_0x122519,'mobile':_0x122519,'phone':_0x122519,'ListId':_0x1f0f52[_0x16b2('0x93')]}));}})[_0x16b2('0x1f')](handleEntityNotFound(_0x2dfc09,null))['then'](function(_0x584c44){if(_0x584c44){_0x3b9d42=_0x584c44;return db[_0x16b2('0xa9')][_0x16b2('0x60')]({'where':{'ContactId':_0x3b9d42['id'],'closed':![],'WhatsappAccountId':_0x1f0f52['id']}})[_0x16b2('0x1f')](function(_0x5e65d9){if(_0x5e65d9){return[_0x5e65d9,![]];}return db[_0x16b2('0xa9')][_0x16b2('0x5b')]({'UserId':_0x431e55['user']['id'],'ContactId':_0x3b9d42['id'],'WhatsappAccountId':_0x1f0f52['id'],'phone':_0x122519,'firstMsgDirection':_0x16b2('0xc0'),'Messages':[_[_0x16b2('0x51')](_0x431e55[_0x16b2('0x5c')],{'read':![],'body':_0x431e55[_0x16b2('0x5c')][_0x16b2('0x5c')],'phone':_0x122519,'WhatsappAccountId':_0x1f0f52['id'],'UserId':_0x431e55[_0x16b2('0x5d')]['id'],'ContactId':_0x3b9d42['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x16b2('0xc1')}]})[_0x16b2('0x1f')](function(_0x3650ca){return[_0x3650ca,!![]];});});}})['spread'](function(_0x4ff92e,_0x8ec391){if(_0x8ec391){return _0x4ff92e;}return db[_0x16b2('0x87')][_0x16b2('0x5b')](_['merge'](_0x431e55['body'],{'read':![],'body':_0x431e55['body']['body'],'phone':_0x122519,'WhatsappAccountId':_0x1f0f52['id'],'WhatsappInteractionId':_0x4ff92e['id'],'UserId':_0x431e55[_0x16b2('0x5d')]['id'],'ContactId':_0x3b9d42['id']}))[_0x16b2('0x1f')](function(_0x355e8f){_0x4ff92e['dataValues']['Messages']=[];_0x4ff92e[_0x16b2('0xc2')]['Messages']['push'](_0x355e8f[_0x16b2('0xc2')]);return _0x4ff92e;});})[_0x16b2('0x1f')](respondWithResult(_0x2dfc09,null))[_0x16b2('0x55')](handleError(_0x2dfc09,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 27072b7..c752ba3 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 _0x3328=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','remove','emit'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x3328,0xd2));var _0x8332=function(_0x5793d5,_0x311565){_0x5793d5=_0x5793d5-0x0;var _0x4f9549=_0x3328[_0x5793d5];return _0x4f9549;};'use strict';var EventEmitter=require(_0x8332('0x0'));var WhatsappAccount=require(_0x8332('0x1'))['db'][_0x8332('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8332('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8332('0x4')};function emitEvent(_0x35eea3){return function(_0x5572f3,_0x23b94b,_0xbf352f){WhatsappAccountEvents['emit'](_0x35eea3+':'+_0x5572f3['id'],_0x5572f3);WhatsappAccountEvents[_0x8332('0x5')](_0x35eea3,_0x5572f3);_0xbf352f(null);};}for(var e in events){if(events[_0x8332('0x6')](e)){var event=events[e];WhatsappAccount[_0x8332('0x7')](e,emitEvent(event));}}module[_0x8332('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1c3b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','WhatsappAccount'];(function(_0x54da53,_0x3f9219){var _0x5bcdab=function(_0x2dd508){while(--_0x2dd508){_0x54da53['push'](_0x54da53['shift']());}};_0x5bcdab(++_0x3f9219);}(_0x1c3b,0x157));var _0xb1c3=function(_0xde2ffe,_0x313060){_0xde2ffe=_0xde2ffe-0x0;var _0x5d6a77=_0x1c3b[_0xde2ffe];return _0x5d6a77;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xb1c3('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb1c3('0x1')](0x0);var events={'afterCreate':_0xb1c3('0x2'),'afterUpdate':_0xb1c3('0x3'),'afterDestroy':_0xb1c3('0x4')};function emitEvent(_0x1437e5){return function(_0x574611,_0x1dbbb6,_0x101a54){WhatsappAccountEvents[_0xb1c3('0x5')](_0x1437e5+':'+_0x574611['id'],_0x574611);WhatsappAccountEvents[_0xb1c3('0x5')](_0x1437e5,_0x574611);_0x101a54(null);};}for(var e in events){if(events[_0xb1c3('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xb1c3('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 598a899..23ec2fc 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 _0x267c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash'];(function(_0x4f614e,_0x5383f4){var _0xcb5766=function(_0x5ef3e8){while(--_0x5ef3e8){_0x4f614e['push'](_0x4f614e['shift']());}};_0xcb5766(++_0x5383f4);}(_0x267c,0x16b));var _0xc267=function(_0x2c6ad6,_0x3090b2){_0x2c6ad6=_0x2c6ad6-0x0;var _0x3994a2=_0x267c[_0x2c6ad6];return _0x3994a2;};'use strict';var _=require(_0xc267('0x0'));var util=require(_0xc267('0x1'));var logger=require('../../config/logger')(_0xc267('0x2'));var moment=require(_0xc267('0x3'));var BPromise=require(_0xc267('0x4'));var rp=require(_0xc267('0x5'));var fs=require('fs');var path=require(_0xc267('0x6'));var rimraf=require(_0xc267('0x7'));var config=require(_0xc267('0x8'));var attributes=require(_0xc267('0x9'));module[_0xc267('0xa')]=function(_0x5145c3,_0x5cb371){return _0x5145c3[_0xc267('0xb')]('WhatsappAccount',attributes,{'tableName':_0xc267('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb291=['../../config/logger','api','path','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','util'];(function(_0x5e49fa,_0x2e6556){var _0x1d0b81=function(_0x4016ed){while(--_0x4016ed){_0x5e49fa['push'](_0x5e49fa['shift']());}};_0x1d0b81(++_0x2e6556);}(_0xb291,0xb3));var _0x1b29=function(_0x23b2f2,_0x575bb0){_0x23b2f2=_0x23b2f2-0x0;var _0x128f25=_0xb291[_0x23b2f2];return _0x128f25;};'use strict';var _=require('lodash');var util=require(_0x1b29('0x0'));var logger=require(_0x1b29('0x1'))(_0x1b29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b29('0x3'));var rimraf=require('rimraf');var config=require(_0x1b29('0x4'));var attributes=require(_0x1b29('0x5'));module['exports']=function(_0x3f7a3b,_0x5a8d43){return _0x3f7a3b[_0x1b29('0x6')](_0x1b29('0x7'),attributes,{'tableName':_0x1b29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 59b6da4..96ff656 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 _0x0b9c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','model','attributes','include','map','lodash','moment'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x0b9c,0x86));var _0xc0b9=function(_0x22b97e,_0x5bb37d){_0x22b97e=_0x22b97e-0x0;var _0x8fe55f=_0x0b9c[_0x22b97e];return _0x8fe55f;};'use strict';var _=require(_0xc0b9('0x0'));var util=require('util');var moment=require(_0xc0b9('0x1'));var BPromise=require(_0xc0b9('0x2'));var rs=require(_0xc0b9('0x3'));var fs=require('fs');var Redis=require(_0xc0b9('0x4'));var db=require(_0xc0b9('0x5'))['db'];var utils=require(_0xc0b9('0x6'));var logger=require(_0xc0b9('0x7'))('rpc');var config=require(_0xc0b9('0x8'));var jayson=require(_0xc0b9('0x9'));var client=jayson['client'][_0xc0b9('0xa')]({'port':0x232a});config[_0xc0b9('0xb')]=_[_0xc0b9('0xc')](config[_0xc0b9('0xb')],{'host':_0xc0b9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x85dae1,_0x5b73f0,_0x2d5272){return new BPromise(function(_0x55f4e4,_0x19fc56){return client[_0xc0b9('0xe')](_0x85dae1,_0x2d5272)[_0xc0b9('0xf')](function(_0x403b53){logger[_0xc0b9('0x10')](_0xc0b9('0x11'),_0x5b73f0,_0xc0b9('0x12'));logger[_0xc0b9('0x13')](_0xc0b9('0x14'),_0x5b73f0,_0xc0b9('0x12'),JSON[_0xc0b9('0x15')](_0x403b53));if(_0x403b53[_0xc0b9('0x16')]){if(_0x403b53[_0xc0b9('0x16')][_0xc0b9('0x17')]===0x1f4){logger[_0xc0b9('0x16')](_0xc0b9('0x11'),_0x5b73f0,_0x403b53['error'][_0xc0b9('0x18')]);return _0x19fc56(_0x403b53[_0xc0b9('0x16')]['message']);}logger[_0xc0b9('0x16')](_0xc0b9('0x11'),_0x5b73f0,_0x403b53['error']['message']);return _0x55f4e4(_0x403b53[_0xc0b9('0x16')][_0xc0b9('0x18')]);}else{logger[_0xc0b9('0x10')](_0xc0b9('0x11'),_0x5b73f0,_0xc0b9('0x12'));_0x55f4e4(_0x403b53[_0xc0b9('0x19')][_0xc0b9('0x18')]);}})[_0xc0b9('0x1a')](function(_0xe31f61){logger[_0xc0b9('0x16')](_0xc0b9('0x11'),_0x5b73f0,_0xe31f61);_0x19fc56(_0xe31f61);});});}exports[_0xc0b9('0x1b')]=function(_0x1ffd7a){var _0x54d9c1=this;return new Promise(function(_0x4c0eba,_0x2f0290){return db['WhatsappAccount'][_0xc0b9('0x1c')]({'raw':_0x1ffd7a[_0xc0b9('0x1d')]?_0x1ffd7a['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ffd7a[_0xc0b9('0x1d')]?_0x1ffd7a[_0xc0b9('0x1d')]['where']||null:null,'attributes':_0x1ffd7a[_0xc0b9('0x1d')]?_0x1ffd7a[_0xc0b9('0x1d')]['attributes']||null:null,'include':_0x1ffd7a[_0xc0b9('0x1d')]?_0x1ffd7a['options']['include']?_['map'](_0x1ffd7a[_0xc0b9('0x1d')]['include'],function(_0x83ba11){return{'model':db[_0x83ba11[_0xc0b9('0x1e')]],'as':_0x83ba11['as'],'attributes':_0x83ba11[_0xc0b9('0x1f')],'include':_0x83ba11[_0xc0b9('0x20')]?_['map'](_0x83ba11[_0xc0b9('0x20')],function(_0x3fe5c6){return{'model':db[_0x3fe5c6[_0xc0b9('0x1e')]],'as':_0x3fe5c6['as'],'attributes':_0x3fe5c6[_0xc0b9('0x1f')],'include':_0x3fe5c6[_0xc0b9('0x20')]?_[_0xc0b9('0x21')](_0x3fe5c6[_0xc0b9('0x20')],function(_0x1259f5){return{'model':db[_0x1259f5[_0xc0b9('0x1e')]],'as':_0x1259f5['as'],'attributes':_0x1259f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xc0b9('0xf')](function(_0x2e4076){logger['info']('ShowWhatsappAccount',_0x1ffd7a);logger['debug'](_0xc0b9('0x1b'),_0x1ffd7a,JSON[_0xc0b9('0x15')](_0x2e4076));_0x4c0eba(_0x2e4076);})[_0xc0b9('0x1a')](function(_0x436c95){logger[_0xc0b9('0x16')]('ShowWhatsappAccount',_0x436c95['message'],_0x1ffd7a);_0x2f0290(_0x54d9c1[_0xc0b9('0x16')](0x1f4,_0x436c95[_0xc0b9('0x18')]));});});}; \ No newline at end of file +var _0x3ba9=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x4e9182,_0x3b49b1){var _0x17aef7=function(_0x516e65){while(--_0x516e65){_0x4e9182['push'](_0x4e9182['shift']());}};_0x17aef7(++_0x3b49b1);}(_0x3ba9,0x69));var _0x93ba=function(_0x3ee9a1,_0xe1ffdd){_0x3ee9a1=_0x3ee9a1-0x0;var _0x6a98e6=_0x3ba9[_0x3ee9a1];return _0x6a98e6;};'use strict';var _=require(_0x93ba('0x0'));var util=require(_0x93ba('0x1'));var moment=require(_0x93ba('0x2'));var BPromise=require(_0x93ba('0x3'));var rs=require(_0x93ba('0x4'));var fs=require('fs');var Redis=require(_0x93ba('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x93ba('0x6'));var logger=require(_0x93ba('0x7'))(_0x93ba('0x8'));var config=require('../../config/environment');var jayson=require(_0x93ba('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x93ba('0xa')]=_['defaults'](config[_0x93ba('0xa')],{'host':_0x93ba('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93ba('0xa')]));require(_0x93ba('0xc'))[_0x93ba('0xd')](socket);function respondWithRpcPromise(_0x4b4c2c,_0x1a0dfc,_0x19c299){return new BPromise(function(_0x3bcf68,_0x419ef4){return client[_0x93ba('0xe')](_0x4b4c2c,_0x19c299)[_0x93ba('0xf')](function(_0x47d00d){logger[_0x93ba('0x10')](_0x93ba('0x11'),_0x1a0dfc,_0x93ba('0x12'));logger[_0x93ba('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1a0dfc,'request\x20sent',JSON[_0x93ba('0x14')](_0x47d00d));if(_0x47d00d['error']){if(_0x47d00d[_0x93ba('0x15')][_0x93ba('0x16')]===0x1f4){logger[_0x93ba('0x15')](_0x93ba('0x11'),_0x1a0dfc,_0x47d00d['error'][_0x93ba('0x17')]);return _0x419ef4(_0x47d00d['error']['message']);}logger[_0x93ba('0x15')](_0x93ba('0x11'),_0x1a0dfc,_0x47d00d[_0x93ba('0x15')][_0x93ba('0x17')]);return _0x3bcf68(_0x47d00d[_0x93ba('0x15')][_0x93ba('0x17')]);}else{logger[_0x93ba('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x1a0dfc,_0x93ba('0x12'));_0x3bcf68(_0x47d00d[_0x93ba('0x18')][_0x93ba('0x17')]);}})[_0x93ba('0x19')](function(_0x2d62f7){logger[_0x93ba('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x1a0dfc,_0x2d62f7);_0x419ef4(_0x2d62f7);});});}exports[_0x93ba('0x1a')]=function(_0x8780fc){var _0x15cc51=this;return new Promise(function(_0x3cfaff,_0x49b559){return db['WhatsappAccount'][_0x93ba('0x1b')]({'raw':_0x8780fc[_0x93ba('0x1c')]?_0x8780fc['options'][_0x93ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x8780fc[_0x93ba('0x1c')]?_0x8780fc[_0x93ba('0x1c')][_0x93ba('0x1e')]||null:null,'attributes':_0x8780fc['options']?_0x8780fc['options'][_0x93ba('0x1f')]||null:null,'include':_0x8780fc[_0x93ba('0x1c')]?_0x8780fc[_0x93ba('0x1c')][_0x93ba('0x20')]?_[_0x93ba('0x21')](_0x8780fc[_0x93ba('0x1c')][_0x93ba('0x20')],function(_0xc51544){return{'model':db[_0xc51544['model']],'as':_0xc51544['as'],'attributes':_0xc51544[_0x93ba('0x1f')],'include':_0xc51544[_0x93ba('0x20')]?_['map'](_0xc51544[_0x93ba('0x20')],function(_0x1b80df){return{'model':db[_0x1b80df[_0x93ba('0x22')]],'as':_0x1b80df['as'],'attributes':_0x1b80df[_0x93ba('0x1f')],'include':_0x1b80df['include']?_['map'](_0x1b80df[_0x93ba('0x20')],function(_0x16c004){return{'model':db[_0x16c004[_0x93ba('0x22')]],'as':_0x16c004['as'],'attributes':_0x16c004[_0x93ba('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x93ba('0xf')](function(_0x46f4ee){logger[_0x93ba('0x10')](_0x93ba('0x1a'),_0x8780fc);logger[_0x93ba('0x13')](_0x93ba('0x1a'),_0x8780fc,JSON[_0x93ba('0x14')](_0x46f4ee));_0x3cfaff(_0x46f4ee);})[_0x93ba('0x19')](function(_0x14e9be){logger[_0x93ba('0x15')](_0x93ba('0x1a'),_0x14e9be['message'],_0x8780fc);_0x49b559(_0x15cc51[_0x93ba('0x15')](0x1f4,_0x14e9be[_0x93ba('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index de23c94..5c44dd0 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 _0xe50e=['./whatsappAccount.events','save','remove','emit','removeListener','register'];(function(_0x3a8973,_0x5b1187){var _0x5f4063=function(_0xf5040b){while(--_0xf5040b){_0x3a8973['push'](_0x3a8973['shift']());}};_0x5f4063(++_0x5b1187);}(_0xe50e,0x1e6));var _0xee50=function(_0x335829,_0x1b89b9){_0x335829=_0x335829-0x0;var _0x21fa12=_0xe50e[_0x335829];return _0x21fa12;};'use strict';var WhatsappAccountEvents=require(_0xee50('0x0'));var events=[_0xee50('0x1'),_0xee50('0x2'),'update'];function createListener(_0x51ac13,_0x3a727){return function(_0x5173db){_0x3a727[_0xee50('0x3')](_0x51ac13,_0x5173db);};}function removeListener(_0x5aa07a,_0x404078){return function(){WhatsappAccountEvents[_0xee50('0x4')](_0x5aa07a,_0x404078);};}exports[_0xee50('0x5')]=function(_0x5b8acc){for(var _0x3e52f3=0x0,_0x55a6c5=events['length'];_0x3e52f3<_0x55a6c5;_0x3e52f3++){var _0x4ee584=events[_0x3e52f3];var _0x47faad=createListener('whatsappAccount:'+_0x4ee584,_0x5b8acc);WhatsappAccountEvents['on'](_0x4ee584,_0x47faad);}}; \ No newline at end of file +var _0xd8d8=['remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x27c832,_0x40c8b0){var _0xb2c5aa=function(_0x34ea86){while(--_0x34ea86){_0x27c832['push'](_0x27c832['shift']());}};_0xb2c5aa(++_0x40c8b0);}(_0xd8d8,0x172));var _0x8d8d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8d8[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappAccountEvents=require(_0x8d8d('0x0'));var events=['save',_0x8d8d('0x1'),_0x8d8d('0x2')];function createListener(_0x5865f8,_0x2fbfa0){return function(_0x476646){_0x2fbfa0[_0x8d8d('0x3')](_0x5865f8,_0x476646);};}function removeListener(_0x470624,_0x562323){return function(){WhatsappAccountEvents[_0x8d8d('0x4')](_0x470624,_0x562323);};}exports['register']=function(_0x10785b){for(var _0x318a61=0x0,_0x184a36=events[_0x8d8d('0x5')];_0x318a61<_0x184a36;_0x318a61++){var _0x45f119=events[_0x318a61];var _0x3184f6=createListener(_0x8d8d('0x6')+_0x45f119,_0x10785b);WhatsappAccountEvents['on'](_0x45f119,_0x3184f6);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e5477e9..a87ec3e 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 _0xdf47=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','path'];(function(_0x4ed42d,_0x1c5148){var _0x2382a0=function(_0x38cd60){while(--_0x38cd60){_0x4ed42d['push'](_0x4ed42d['shift']());}};_0x2382a0(++_0x1c5148);}(_0xdf47,0x18a));var _0x7df4=function(_0x38b6b3,_0x4ab31f){_0x38b6b3=_0x38b6b3-0x0;var _0x3a0c72=_0xdf47[_0x38b6b3];return _0x3a0c72;};'use strict';var multer=require(_0x7df4('0x0'));var util=require('util');var path=require(_0x7df4('0x1'));var timeout=require(_0x7df4('0x2'));var express=require(_0x7df4('0x3'));var router=express['Router']();var fs_extra=require(_0x7df4('0x4'));var auth=require(_0x7df4('0x5'));var interaction=require(_0x7df4('0x6'));var config=require(_0x7df4('0x7'));var controller=require('./whatsappApplication.controller');router[_0x7df4('0x8')]('/',auth[_0x7df4('0x9')](),controller['index']);router[_0x7df4('0x8')](_0x7df4('0xa'),auth['isAuthenticated'](),controller[_0x7df4('0xb')]);router[_0x7df4('0xc')]('/',auth[_0x7df4('0x9')](),controller[_0x7df4('0xd')]);router[_0x7df4('0xe')](_0x7df4('0xa'),auth[_0x7df4('0x9')](),controller[_0x7df4('0xf')]);router[_0x7df4('0x10')](_0x7df4('0xa'),auth[_0x7df4('0x9')](),controller[_0x7df4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7fdc=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5cd0e8,_0x5d7a15){var _0x2192dd=function(_0x483e81){while(--_0x483e81){_0x5cd0e8['push'](_0x5cd0e8['shift']());}};_0x2192dd(++_0x5d7a15);}(_0x7fdc,0xfc));var _0xc7fd=function(_0x38c28d,_0x4aca0d){_0x38c28d=_0x38c28d-0x0;var _0x547e03=_0x7fdc[_0x38c28d];return _0x547e03;};'use strict';var multer=require(_0xc7fd('0x0'));var util=require(_0xc7fd('0x1'));var path=require(_0xc7fd('0x2'));var timeout=require(_0xc7fd('0x3'));var express=require(_0xc7fd('0x4'));var router=express[_0xc7fd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc7fd('0x6'));var config=require(_0xc7fd('0x7'));var controller=require(_0xc7fd('0x8'));router[_0xc7fd('0x9')]('/',auth[_0xc7fd('0xa')](),controller[_0xc7fd('0xb')]);router[_0xc7fd('0x9')](_0xc7fd('0xc'),auth[_0xc7fd('0xa')](),controller[_0xc7fd('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc7fd('0xe')](_0xc7fd('0xc'),auth[_0xc7fd('0xa')](),controller[_0xc7fd('0xf')]);router[_0xc7fd('0x10')](_0xc7fd('0xc'),auth['isAuthenticated'](),controller[_0xc7fd('0x11')]);module[_0xc7fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 14c23c2..5627c50 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 _0xaf2a=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x3ad377,_0x3d1276){var _0x335b65=function(_0x4f1353){while(--_0x4f1353){_0x3ad377['push'](_0x3ad377['shift']());}};_0x335b65(++_0x3d1276);}(_0xaf2a,0xd1));var _0xaaf2=function(_0x152940,_0x51d24f){_0x152940=_0x152940-0x0;var _0x38c2fd=_0xaf2a[_0x152940];return _0x38c2fd;};'use strict';var Sequelize=require(_0xaaf2('0x0'));module[_0xaaf2('0x1')]={'priority':{'type':Sequelize[_0xaaf2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaaf2('0x3')],'allowNull':![],'defaultValue':_0xaaf2('0x4')},'appdata':{'type':Sequelize[_0xaaf2('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xaaf2('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1555=['TEXT','STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x1eca39,_0x3b6a24){var _0x453dba=function(_0x5c2ec0){while(--_0x5c2ec0){_0x1eca39['push'](_0x1eca39['shift']());}};_0x453dba(++_0x3b6a24);}(_0x1555,0x81));var _0x5155=function(_0x4db151,_0x199db8){_0x4db151=_0x4db151-0x0;var _0x20d79b=_0x1555[_0x4db151];return _0x20d79b;};'use strict';var Sequelize=require(_0x5155('0x0'));module[_0x5155('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5155('0x2')},'appdata':{'type':Sequelize[_0x5155('0x3')]()},'description':{'type':Sequelize[_0x5155('0x4')]},'interval':{'type':Sequelize[_0x5155('0x4')],'defaultValue':_0x5155('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 22524a1..bde348a 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 _0xa899=['../../config/environment','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','end','sendStatus','error','name','index','map','WhatsappApplication','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa899,0x155));var _0x9a89=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0xa899[_0x53afa6];return _0x51f86a;};'use strict';var emlformat=require(_0x9a89('0x0'));var rimraf=require(_0x9a89('0x1'));var zipdir=require(_0x9a89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a89('0x3'));var moment=require(_0x9a89('0x4'));var BPromise=require(_0x9a89('0x5'));var Mustache=require(_0x9a89('0x6'));var util=require(_0x9a89('0x7'));var path=require(_0x9a89('0x8'));var sox=require(_0x9a89('0x9'));var csv=require(_0x9a89('0xa'));var ejs=require(_0x9a89('0xb'));var fs=require('fs');var fs_extra=require(_0x9a89('0xc'));var _=require(_0x9a89('0xd'));var squel=require(_0x9a89('0xe'));var crypto=require(_0x9a89('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a89('0xa'));var querystring=require(_0x9a89('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a89('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a89('0x12'));var as=require(_0x9a89('0x13'));var hardwareService=require(_0x9a89('0x14'));var logger=require(_0x9a89('0x15'))(_0x9a89('0x16'));var utils=require(_0x9a89('0x17'));var config=require(_0x9a89('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4342c8,_0x8b7403){_0x8b7403=_0x8b7403||0xcc;return function(_0x2bdb0d){if(_0x2bdb0d){return _0x4342c8['sendStatus'](_0x8b7403);}return _0x4342c8['status'](_0x8b7403)['end']();};}function respondWithResult(_0x1c66a3,_0xf08a5a){_0xf08a5a=_0xf08a5a||0xc8;return function(_0x5720a2){if(_0x5720a2){return _0x1c66a3[_0x9a89('0x19')](_0xf08a5a)[_0x9a89('0x1a')](_0x5720a2);}};}function respondWithFilteredResult(_0x33a08f,_0x203ee9){return function(_0x597e58){if(_0x597e58){var _0x11a933=typeof _0x203ee9[_0x9a89('0x1b')]==='undefined'&&typeof _0x203ee9['limit']===_0x9a89('0x1c');var _0x4a15f1=_0x597e58[_0x9a89('0x1d')];var _0x334725=_0x11a933?0x0:_0x203ee9['offset'];var _0xdbb337=_0x11a933?_0x597e58['count']:_0x203ee9[_0x9a89('0x1b')]+_0x203ee9[_0x9a89('0x1e')];var _0x54c45d;if(_0xdbb337>=_0x4a15f1){_0xdbb337=_0x4a15f1;_0x54c45d=0xc8;}else{_0x54c45d=0xce;}_0x33a08f[_0x9a89('0x19')](_0x54c45d);return _0x33a08f[_0x9a89('0x1f')](_0x9a89('0x20'),_0x334725+'-'+_0xdbb337+'/'+_0x4a15f1)[_0x9a89('0x1a')](_0x597e58);}return null;};}function patchUpdates(_0x66f8c7){return function(_0x146ec0){try{jsonpatch[_0x9a89('0x21')](_0x146ec0,_0x66f8c7,!![]);}catch(_0x1548db){return BPromise['reject'](_0x1548db);}return _0x146ec0['save']();};}function saveUpdates(_0x1ef5ef,_0x330121){return function(_0xea8910){if(_0xea8910){return _0xea8910[_0x9a89('0x22')](_0x1ef5ef)[_0x9a89('0x23')](function(_0x3cc288){return _0x3cc288;});}return null;};}function removeEntity(_0x4ac234,_0x50adcf){return function(_0x42c5ee){if(_0x42c5ee){return _0x42c5ee['destroy']()[_0x9a89('0x23')](function(){_0x4ac234[_0x9a89('0x19')](0xcc)[_0x9a89('0x24')]();});}};}function handleEntityNotFound(_0x3b1807,_0x423a1d){return function(_0x35032a){if(!_0x35032a){_0x3b1807[_0x9a89('0x25')](0x194);}return _0x35032a;};}function handleError(_0x4d7876,_0x1a5005){_0x1a5005=_0x1a5005||0x1f4;return function(_0x5002a2){logger[_0x9a89('0x26')](_0x5002a2['stack']);if(_0x5002a2['name']){delete _0x5002a2[_0x9a89('0x27')];}_0x4d7876[_0x9a89('0x19')](_0x1a5005)['send'](_0x5002a2);};}exports[_0x9a89('0x28')]=function(_0x5abe70,_0x27f442){var _0x365e34={},_0x267512={},_0x2d019e={'count':0x0,'rows':[]};var _0x2324c0=_[_0x9a89('0x29')](db[_0x9a89('0x2a')]['rawAttributes'],function(_0x4df9f2){return{'name':_0x4df9f2['fieldName'],'type':_0x4df9f2[_0x9a89('0x2b')]['key']};});_0x267512[_0x9a89('0x2c')]=_[_0x9a89('0x29')](_0x2324c0,_0x9a89('0x27'));_0x267512['query']=_[_0x9a89('0x2d')](_0x5abe70['query']);_0x267512[_0x9a89('0x2e')]=_[_0x9a89('0x2f')](_0x267512[_0x9a89('0x2c')],_0x267512[_0x9a89('0x30')]);_0x365e34[_0x9a89('0x31')]=_['intersection'](_0x267512[_0x9a89('0x2c')],qs[_0x9a89('0x32')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x32')]));_0x365e34[_0x9a89('0x31')]=_0x365e34[_0x9a89('0x31')][_0x9a89('0x33')]?_0x365e34[_0x9a89('0x31')]:_0x267512[_0x9a89('0x2c')];if(!_0x5abe70['query'][_0x9a89('0x34')](_0x9a89('0x35'))){_0x365e34[_0x9a89('0x1e')]=qs[_0x9a89('0x1e')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x1e')]);_0x365e34[_0x9a89('0x1b')]=qs[_0x9a89('0x1b')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x1b')]);}_0x365e34['order']=qs[_0x9a89('0x36')](_0x5abe70[_0x9a89('0x30')][_0x9a89('0x36')]);_0x365e34[_0x9a89('0x37')]=qs[_0x9a89('0x2e')](_[_0x9a89('0x38')](_0x5abe70[_0x9a89('0x30')],_0x267512[_0x9a89('0x2e')]),_0x2324c0);if(_0x5abe70[_0x9a89('0x30')][_0x9a89('0x39')]){_0x365e34[_0x9a89('0x37')]=_[_0x9a89('0x3a')](_0x365e34['where'],{'$or':_[_0x9a89('0x29')](_0x2324c0,function(_0x4a26e7){if(_0x4a26e7[_0x9a89('0x2b')]!==_0x9a89('0x3b')){var _0x26112d={};_0x26112d[_0x4a26e7[_0x9a89('0x27')]]={'$like':'%'+_0x5abe70[_0x9a89('0x30')][_0x9a89('0x39')]+'%'};return _0x26112d;}})});}_0x365e34=_[_0x9a89('0x3a')]({},_0x365e34,_0x5abe70[_0x9a89('0x3c')]);var _0x192138={'where':_0x365e34['where']};return db[_0x9a89('0x2a')][_0x9a89('0x1d')](_0x192138)[_0x9a89('0x23')](function(_0x20c53b){_0x2d019e['count']=_0x20c53b;if(_0x5abe70['query'][_0x9a89('0x3d')]){_0x365e34['include']=[{'all':!![]}];}return db[_0x9a89('0x2a')][_0x9a89('0x3e')](_0x365e34);})[_0x9a89('0x23')](function(_0x34885f){_0x2d019e[_0x9a89('0x3f')]=_0x34885f;return _0x2d019e;})[_0x9a89('0x23')](respondWithFilteredResult(_0x27f442,_0x365e34))[_0x9a89('0x40')](handleError(_0x27f442,null));};exports[_0x9a89('0x41')]=function(_0x5e592b,_0x4c4f2c){var _0x4fe28a={'raw':!![],'where':{'id':_0x5e592b['params']['id']}},_0x1d3545={};_0x1d3545['model']=_[_0x9a89('0x2d')](db[_0x9a89('0x2a')][_0x9a89('0x42')]);_0x1d3545['query']=_[_0x9a89('0x2d')](_0x5e592b['query']);_0x1d3545[_0x9a89('0x2e')]=_['intersection'](_0x1d3545[_0x9a89('0x2c')],_0x1d3545[_0x9a89('0x30')]);_0x4fe28a[_0x9a89('0x31')]=_['intersection'](_0x1d3545[_0x9a89('0x2c')],qs[_0x9a89('0x32')](_0x5e592b[_0x9a89('0x30')]['fields']));_0x4fe28a['attributes']=_0x4fe28a[_0x9a89('0x31')]['length']?_0x4fe28a[_0x9a89('0x31')]:_0x1d3545[_0x9a89('0x2c')];if(_0x5e592b['query'][_0x9a89('0x3d')]){_0x4fe28a[_0x9a89('0x43')]=[{'all':!![]}];}_0x4fe28a=_['merge']({},_0x4fe28a,_0x5e592b['options']);return db[_0x9a89('0x2a')][_0x9a89('0x44')](_0x4fe28a)['then'](handleEntityNotFound(_0x4c4f2c,null))[_0x9a89('0x23')](respondWithResult(_0x4c4f2c,null))['catch'](handleError(_0x4c4f2c,null));};exports[_0x9a89('0x45')]=function(_0x2d58d4,_0x31f48){return db[_0x9a89('0x2a')][_0x9a89('0x45')](_0x2d58d4['body'],{})[_0x9a89('0x23')](respondWithResult(_0x31f48,0xc9))['catch'](handleError(_0x31f48,null));};exports[_0x9a89('0x22')]=function(_0xc007aa,_0x58196c){if(_0xc007aa[_0x9a89('0x46')]['id']){delete _0xc007aa[_0x9a89('0x46')]['id'];}return db[_0x9a89('0x2a')][_0x9a89('0x44')]({'where':{'id':_0xc007aa[_0x9a89('0x47')]['id']}})[_0x9a89('0x23')](handleEntityNotFound(_0x58196c,null))[_0x9a89('0x23')](saveUpdates(_0xc007aa[_0x9a89('0x46')],null))[_0x9a89('0x23')](respondWithResult(_0x58196c,null))[_0x9a89('0x40')](handleError(_0x58196c,null));};exports[_0x9a89('0x48')]=function(_0x5abc42,_0x3546ba){return db[_0x9a89('0x2a')][_0x9a89('0x44')]({'where':{'id':_0x5abc42['params']['id']}})[_0x9a89('0x23')](handleEntityNotFound(_0x3546ba,null))[_0x9a89('0x23')](removeEntity(_0x3546ba,null))['catch'](handleError(_0x3546ba,null));}; \ No newline at end of file +var _0xa32b=['save','update','then','destroy','error','name','send','index','map','WhatsappApplication','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','includeAll','options','create','body','find','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa32b,0x68));var _0xba32=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0xa32b[_0x22ffbf];return _0x360c17;};'use strict';var emlformat=require(_0xba32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba32('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba32('0x2'));var BPromise=require(_0xba32('0x3'));var Mustache=require(_0xba32('0x4'));var util=require('util');var path=require(_0xba32('0x5'));var sox=require(_0xba32('0x6'));var csv=require(_0xba32('0x7'));var ejs=require(_0xba32('0x8'));var fs=require('fs');var fs_extra=require(_0xba32('0x9'));var _=require('lodash');var squel=require(_0xba32('0xa'));var crypto=require('crypto');var jsforce=require(_0xba32('0xb'));var deskjs=require(_0xba32('0xc'));var toCsv=require(_0xba32('0x7'));var querystring=require(_0xba32('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xba32('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba32('0xf'))('api');var utils=require(_0xba32('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xba32('0x11'))['db'];function respondWithStatusCode(_0x18ae07,_0x46f042){_0x46f042=_0x46f042||0xcc;return function(_0x1fc11d){if(_0x1fc11d){return _0x18ae07[_0xba32('0x12')](_0x46f042);}return _0x18ae07['status'](_0x46f042)[_0xba32('0x13')]();};}function respondWithResult(_0x3f9bef,_0x43652a){_0x43652a=_0x43652a||0xc8;return function(_0xd82932){if(_0xd82932){return _0x3f9bef[_0xba32('0x14')](_0x43652a)[_0xba32('0x15')](_0xd82932);}};}function respondWithFilteredResult(_0x11d280,_0x5c0bd8){return function(_0x176763){if(_0x176763){var _0x22c2be=typeof _0x5c0bd8[_0xba32('0x16')]===_0xba32('0x17')&&typeof _0x5c0bd8[_0xba32('0x18')]==='undefined';var _0x4d0b72=_0x176763['count'];var _0x5c3fe6=_0x22c2be?0x0:_0x5c0bd8[_0xba32('0x16')];var _0x1ae3ea=_0x22c2be?_0x176763[_0xba32('0x19')]:_0x5c0bd8[_0xba32('0x16')]+_0x5c0bd8[_0xba32('0x18')];var _0x1bcce4;if(_0x1ae3ea>=_0x4d0b72){_0x1ae3ea=_0x4d0b72;_0x1bcce4=0xc8;}else{_0x1bcce4=0xce;}_0x11d280['status'](_0x1bcce4);return _0x11d280['set']('Content-Range',_0x5c3fe6+'-'+_0x1ae3ea+'/'+_0x4d0b72)[_0xba32('0x15')](_0x176763);}return null;};}function patchUpdates(_0x51c43a){return function(_0x44e11c){try{jsonpatch[_0xba32('0x1a')](_0x44e11c,_0x51c43a,!![]);}catch(_0x4266dc){return BPromise[_0xba32('0x1b')](_0x4266dc);}return _0x44e11c[_0xba32('0x1c')]();};}function saveUpdates(_0x34124d,_0xdfa807){return function(_0x503698){if(_0x503698){return _0x503698[_0xba32('0x1d')](_0x34124d)[_0xba32('0x1e')](function(_0x34a3cd){return _0x34a3cd;});}return null;};}function removeEntity(_0x171626,_0x5eb640){return function(_0x4b03a5){if(_0x4b03a5){return _0x4b03a5[_0xba32('0x1f')]()[_0xba32('0x1e')](function(){_0x171626['status'](0xcc)[_0xba32('0x13')]();});}};}function handleEntityNotFound(_0x5dcdc4,_0x37ade0){return function(_0x18f0c8){if(!_0x18f0c8){_0x5dcdc4[_0xba32('0x12')](0x194);}return _0x18f0c8;};}function handleError(_0x5e1f71,_0x385ae0){_0x385ae0=_0x385ae0||0x1f4;return function(_0x11fb8c){logger[_0xba32('0x20')](_0x11fb8c['stack']);if(_0x11fb8c[_0xba32('0x21')]){delete _0x11fb8c[_0xba32('0x21')];}_0x5e1f71[_0xba32('0x14')](_0x385ae0)[_0xba32('0x22')](_0x11fb8c);};}exports[_0xba32('0x23')]=function(_0x168206,_0x27bc6f){var _0xd00fcd={},_0x1ef5ed={},_0x5dbba9={'count':0x0,'rows':[]};var _0x454f4b=_[_0xba32('0x24')](db[_0xba32('0x25')][_0xba32('0x26')],function(_0x30c137){return{'name':_0x30c137['fieldName'],'type':_0x30c137[_0xba32('0x27')]['key']};});_0x1ef5ed[_0xba32('0x28')]=_[_0xba32('0x24')](_0x454f4b,'name');_0x1ef5ed[_0xba32('0x29')]=_[_0xba32('0x2a')](_0x168206[_0xba32('0x29')]);_0x1ef5ed[_0xba32('0x2b')]=_['intersection'](_0x1ef5ed[_0xba32('0x28')],_0x1ef5ed[_0xba32('0x29')]);_0xd00fcd['attributes']=_[_0xba32('0x2c')](_0x1ef5ed[_0xba32('0x28')],qs[_0xba32('0x2d')](_0x168206[_0xba32('0x29')]['fields']));_0xd00fcd[_0xba32('0x2e')]=_0xd00fcd['attributes'][_0xba32('0x2f')]?_0xd00fcd[_0xba32('0x2e')]:_0x1ef5ed[_0xba32('0x28')];if(!_0x168206['query'][_0xba32('0x30')](_0xba32('0x31'))){_0xd00fcd['limit']=qs[_0xba32('0x18')](_0x168206[_0xba32('0x29')][_0xba32('0x18')]);_0xd00fcd[_0xba32('0x16')]=qs['offset'](_0x168206['query'][_0xba32('0x16')]);}_0xd00fcd['order']=qs[_0xba32('0x32')](_0x168206[_0xba32('0x29')][_0xba32('0x32')]);_0xd00fcd[_0xba32('0x33')]=qs['filters'](_[_0xba32('0x34')](_0x168206[_0xba32('0x29')],_0x1ef5ed[_0xba32('0x2b')]),_0x454f4b);if(_0x168206[_0xba32('0x29')]['filter']){_0xd00fcd['where']=_[_0xba32('0x35')](_0xd00fcd[_0xba32('0x33')],{'$or':_[_0xba32('0x24')](_0x454f4b,function(_0x385b28){if(_0x385b28[_0xba32('0x27')]!==_0xba32('0x36')){var _0x475893={};_0x475893[_0x385b28[_0xba32('0x21')]]={'$like':'%'+_0x168206[_0xba32('0x29')][_0xba32('0x37')]+'%'};return _0x475893;}})});}_0xd00fcd=_[_0xba32('0x35')]({},_0xd00fcd,_0x168206['options']);var _0x19a677={'where':_0xd00fcd[_0xba32('0x33')]};return db[_0xba32('0x25')][_0xba32('0x19')](_0x19a677)['then'](function(_0x2c179a){_0x5dbba9['count']=_0x2c179a;if(_0x168206[_0xba32('0x29')]['includeAll']){_0xd00fcd[_0xba32('0x38')]=[{'all':!![]}];}return db[_0xba32('0x25')][_0xba32('0x39')](_0xd00fcd);})[_0xba32('0x1e')](function(_0x26284e){_0x5dbba9[_0xba32('0x3a')]=_0x26284e;return _0x5dbba9;})['then'](respondWithFilteredResult(_0x27bc6f,_0xd00fcd))[_0xba32('0x3b')](handleError(_0x27bc6f,null));};exports['show']=function(_0x469041,_0x6f4d9d){var _0x1d00eb={'raw':!![],'where':{'id':_0x469041[_0xba32('0x3c')]['id']}},_0x558d2b={};_0x558d2b[_0xba32('0x28')]=_['keys'](db[_0xba32('0x25')][_0xba32('0x26')]);_0x558d2b[_0xba32('0x29')]=_['keys'](_0x469041[_0xba32('0x29')]);_0x558d2b[_0xba32('0x2b')]=_['intersection'](_0x558d2b[_0xba32('0x28')],_0x558d2b[_0xba32('0x29')]);_0x1d00eb[_0xba32('0x2e')]=_[_0xba32('0x2c')](_0x558d2b['model'],qs[_0xba32('0x2d')](_0x469041[_0xba32('0x29')]['fields']));_0x1d00eb[_0xba32('0x2e')]=_0x1d00eb[_0xba32('0x2e')]['length']?_0x1d00eb[_0xba32('0x2e')]:_0x558d2b['model'];if(_0x469041[_0xba32('0x29')][_0xba32('0x3d')]){_0x1d00eb[_0xba32('0x38')]=[{'all':!![]}];}_0x1d00eb=_[_0xba32('0x35')]({},_0x1d00eb,_0x469041[_0xba32('0x3e')]);return db[_0xba32('0x25')]['find'](_0x1d00eb)[_0xba32('0x1e')](handleEntityNotFound(_0x6f4d9d,null))[_0xba32('0x1e')](respondWithResult(_0x6f4d9d,null))[_0xba32('0x3b')](handleError(_0x6f4d9d,null));};exports[_0xba32('0x3f')]=function(_0x2850fe,_0x4a7d85){return db[_0xba32('0x25')][_0xba32('0x3f')](_0x2850fe[_0xba32('0x40')],{})['then'](respondWithResult(_0x4a7d85,0xc9))['catch'](handleError(_0x4a7d85,null));};exports[_0xba32('0x1d')]=function(_0xc8624,_0x58309d){if(_0xc8624['body']['id']){delete _0xc8624[_0xba32('0x40')]['id'];}return db[_0xba32('0x25')][_0xba32('0x41')]({'where':{'id':_0xc8624['params']['id']}})['then'](handleEntityNotFound(_0x58309d,null))[_0xba32('0x1e')](saveUpdates(_0xc8624[_0xba32('0x40')],null))[_0xba32('0x1e')](respondWithResult(_0x58309d,null))[_0xba32('0x3b')](handleError(_0x58309d,null));};exports['destroy']=function(_0x20508f,_0x165c34){return db[_0xba32('0x25')][_0xba32('0x41')]({'where':{'id':_0x20508f['params']['id']}})[_0xba32('0x1e')](handleEntityNotFound(_0x165c34,null))[_0xba32('0x1e')](removeEntity(_0x165c34,null))[_0xba32('0x3b')](handleError(_0x165c34,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0195d94..eaf5194 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 _0xd6ce=['bluebird','request-promise','path','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd6ce,0x127));var _0xed6c=function(_0x4e8bc4,_0x5e7ee0){_0x4e8bc4=_0x4e8bc4-0x0;var _0x199bd9=_0xd6ce[_0x4e8bc4];return _0x199bd9;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var logger=require(_0xed6c('0x2'))(_0xed6c('0x3'));var moment=require(_0xed6c('0x4'));var BPromise=require(_0xed6c('0x5'));var rp=require(_0xed6c('0x6'));var fs=require('fs');var path=require(_0xed6c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed6c('0x8'));module[_0xed6c('0x9')]=function(_0x1a6d96,_0x1d0912){return _0x1a6d96['define']('WhatsappApplication',attributes,{'tableName':_0xed6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed6c('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x544a=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x544a,0xbd));var _0xa544=function(_0x375676,_0x59d59f){_0x375676=_0x375676-0x0;var _0x31b3b7=_0x544a[_0x375676];return _0x31b3b7;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require(_0xa544('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa544('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa544('0x4'));var rimraf=require(_0xa544('0x5'));var config=require('../../config/environment');var attributes=require(_0xa544('0x6'));module[_0xa544('0x7')]=function(_0x2f5992,_0x15a604){return _0x2f5992[_0xa544('0x8')]('WhatsappApplication',attributes,{'tableName':_0xa544('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa544('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 63d1915..31c71ab 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 _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x20b3d6,_0x2dd78e){var _0x21a8e3=function(_0x61908f){while(--_0x61908f){_0x20b3d6['push'](_0x20b3d6['shift']());}};_0x21a8e3(++_0x2dd78e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3527b7,_0x1fc9b0){_0x3527b7=_0x3527b7-0x0;var _0x3cde02=_0x8d0e[_0x3527b7];return _0x3cde02;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x40edbb,_0x4b8e85){var _0x1c34e1=function(_0x4cb6dc){while(--_0x4cb6dc){_0x40edbb['push'](_0x40edbb['shift']());}};_0x1c34e1(++_0x4b8e85);}(_0xe5b3,0x133));var _0x3e5b=function(_0x14d874,_0x482fef){_0x14d874=_0x14d874-0x0;var _0x3f5289=_0xe5b3[_0x14d874];return _0x3f5289;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index cc638cf..6c42654 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 _0x6050=['tracked','whatsapp','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','describe','get','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0xb7817f,_0x110bc4){var _0x4f278b=function(_0xcbe138){while(--_0xcbe138){_0xb7817f['push'](_0xb7817f['shift']());}};_0x4f278b(++_0x110bc4);}(_0x6050,0x196));var _0x0605=function(_0x5610ae,_0x2e6e33){_0x5610ae=_0x5610ae-0x0;var _0x4ec49a=_0x6050[_0x5610ae];return _0x4ec49a;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['get'](_0x0605('0xf'),auth[_0x0605('0xd')](),controller[_0x0605('0x10')]);router[_0x0605('0xb')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')]('/',auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);router[_0x0605('0x13')](_0x0605('0xf'),auth[_0x0605('0xd')](),controller[_0x0605('0x15')]);router[_0x0605('0x13')](_0x0605('0x16'),auth[_0x0605('0xd')](),interaction[_0x0605('0x17')](_0x0605('0x18'),'whatsappinteraction:addtags'),controller[_0x0605('0x19')]);router[_0x0605('0x1a')](_0x0605('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x0605('0x18'),_0x0605('0x1b')),controller[_0x0605('0x1c')]);router[_0x0605('0x1d')](_0x0605('0xc'),auth[_0x0605('0xd')](),interaction[_0x0605('0x17')](_0x0605('0x18'),_0x0605('0x1e')),controller[_0x0605('0x1f')]);router[_0x0605('0x1d')](_0x0605('0x16'),auth[_0x0605('0xd')](),controller[_0x0605('0x20')]);module['exports']=router; \ No newline at end of file +var _0x885a=['describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_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('0x9')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x9')](_0xa885('0x12'),auth['isAuthenticated'](),controller[_0xa885('0x13')]);router[_0xa885('0x14')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x15')]);router[_0xa885('0x14')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller['addMessage']);router[_0xa885('0x14')](_0xa885('0x16'),auth[_0xa885('0x10')](),interaction[_0xa885('0x17')](_0xa885('0x18'),'whatsappinteraction:addtags'),controller[_0xa885('0x19')]);router[_0xa885('0x1a')]('/:id',auth[_0xa885('0x10')](),interaction[_0xa885('0x17')]('whatsapp',_0xa885('0x1b')),controller[_0xa885('0x1c')]);router['delete'](_0xa885('0xd'),auth['isAuthenticated'](),interaction[_0xa885('0x17')](_0xa885('0x18'),_0xa885('0x1d')),controller['destroy']);router[_0xa885('0x1e')]('/:id/tags',auth[_0xa885('0x10')](),controller[_0xa885('0x1f')]);module[_0xa885('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 7392554..119f619 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 _0x31c2=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x31c2,0x1e1));var _0x231c=function(_0x411a82,_0x4cb7dd){_0x411a82=_0x411a82-0x0;var _0x382b0a=_0x31c2[_0x411a82];return _0x382b0a;};'use strict';var Sequelize=require(_0x231c('0x0'));var moment=require(_0x231c('0x1'));module[_0x231c('0x2')]={'closed':{'type':Sequelize[_0x231c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x231c('0x4')]},'disposition':{'type':Sequelize[_0x231c('0x5')]},'secondDisposition':{'type':Sequelize[_0x231c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x231c('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x231c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x231c('0x6')]('in',_0x231c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x231c('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x231c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5075=['DATE','STRING','ENUM','sequelize','moment','exports','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5075,0x73));var _0x5507=function(_0xd92e0f,_0x4c28de){_0xd92e0f=_0xd92e0f-0x0;var _0x408a33=_0x5075[_0xd92e0f];return _0x408a33;};'use strict';var Sequelize=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));module[_0x5507('0x2')]={'closed':{'type':Sequelize[_0x5507('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5507('0x4')]},'disposition':{'type':Sequelize[_0x5507('0x5')]},'secondDisposition':{'type':Sequelize[_0x5507('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5507('0x5')]},'phone':{'type':Sequelize[_0x5507('0x5')]},'read1stAt':{'type':Sequelize[_0x5507('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5507('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5507('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5507('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 4871a0b..81619a1 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 _0xfc4f=['expr','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','WhatsappInteraction','includeAll','options','create','catch','describe','addMessage','WhatsappMessage','ids','omit','getMessages','format','addTags','setTags','spread','Tag','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Owner','mkdirSync','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','basename','existsSync','createReadStream','createWriteStream','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','update','then','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','waiting','answered','unmanaged','total','closed','UserId','talking','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId'];(function(_0x3af391,_0x499300){var _0x5b4d9b=function(_0x4aa6d9){while(--_0x4aa6d9){_0x3af391['push'](_0x3af391['shift']());}};_0x5b4d9b(++_0x499300);}(_0xfc4f,0x192));var _0xffc4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfc4f[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffc4('0x0'));var zipdir=require(_0xffc4('0x1'));var jsonpatch=require(_0xffc4('0x2'));var rp=require(_0xffc4('0x3'));var moment=require(_0xffc4('0x4'));var BPromise=require(_0xffc4('0x5'));var Mustache=require(_0xffc4('0x6'));var util=require('util');var path=require(_0xffc4('0x7'));var sox=require(_0xffc4('0x8'));var csv=require(_0xffc4('0x9'));var ejs=require(_0xffc4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffc4('0xb'));var squel=require(_0xffc4('0xc'));var crypto=require('crypto');var jsforce=require(_0xffc4('0xd'));var deskjs=require(_0xffc4('0xe'));var toCsv=require(_0xffc4('0x9'));var querystring=require(_0xffc4('0xf'));var Papa=require('papaparse');var Redis=require(_0xffc4('0x10'));var authService=require(_0xffc4('0x11'));var qs=require(_0xffc4('0x12'));var as=require(_0xffc4('0x13'));var pdf=require(_0xffc4('0x14'));var hardwareService=require(_0xffc4('0x15'));var logger=require('../../config/logger')(_0xffc4('0x16'));var utils=require(_0xffc4('0x17'));var config=require(_0xffc4('0x18'));var licenseUtil=require(_0xffc4('0x19'));var db=require(_0xffc4('0x1a'))['db'];config[_0xffc4('0x1b')]=_[_0xffc4('0x1c')](config['redis'],{'host':_0xffc4('0x1d'),'port':0x18eb});var socket=require(_0xffc4('0x1e'))(new Redis(config['redis']));require(_0xffc4('0x1f'))[_0xffc4('0x20')](socket);function respondWithStatusCode(_0x515412,_0x2ed4c8){_0x2ed4c8=_0x2ed4c8||0xcc;return function(_0x46c802){if(_0x46c802){return _0x515412[_0xffc4('0x21')](_0x2ed4c8);}return _0x515412[_0xffc4('0x22')](_0x2ed4c8)['end']();};}function respondWithResult(_0xfd8798,_0x3c6d5f){_0x3c6d5f=_0x3c6d5f||0xc8;return function(_0x3d3baa){if(_0x3d3baa){return _0xfd8798[_0xffc4('0x22')](_0x3c6d5f)[_0xffc4('0x23')](_0x3d3baa);}};}function respondWithFilteredResult(_0x456057,_0x9fa8ba){return function(_0x4460a1){if(_0x4460a1){var _0x12ca28=typeof _0x9fa8ba[_0xffc4('0x24')]==='undefined'&&typeof _0x9fa8ba[_0xffc4('0x25')]==='undefined';var _0x5bee7e=_0x4460a1[_0xffc4('0x26')];var _0xd48851=_0x12ca28?0x0:_0x9fa8ba[_0xffc4('0x24')];var _0x5eb1c1=_0x12ca28?_0x4460a1[_0xffc4('0x26')]:_0x9fa8ba[_0xffc4('0x24')]+_0x9fa8ba[_0xffc4('0x25')];var _0x17e9fb;if(_0x5eb1c1>=_0x5bee7e){_0x5eb1c1=_0x5bee7e;_0x17e9fb=0xc8;}else{_0x17e9fb=0xce;}_0x456057[_0xffc4('0x22')](_0x17e9fb);return _0x456057[_0xffc4('0x27')](_0xffc4('0x28'),_0xd48851+'-'+_0x5eb1c1+'/'+_0x5bee7e)['json'](_0x4460a1);}return null;};}function patchUpdates(_0x593cb3){return function(_0x307ce8){try{jsonpatch[_0xffc4('0x29')](_0x307ce8,_0x593cb3,!![]);}catch(_0x3873dc){return BPromise['reject'](_0x3873dc);}return _0x307ce8['save']();};}function saveUpdates(_0x39d808,_0x2e6265){return function(_0x516c5b){if(_0x516c5b){return _0x516c5b[_0xffc4('0x2a')](_0x39d808)[_0xffc4('0x2b')](function(_0x2021a9){return _0x2021a9;});}return null;};}function removeEntity(_0x4fd7d0,_0x139bac){return function(_0x4a43a3){if(_0x4a43a3){return _0x4a43a3['destroy']()[_0xffc4('0x2b')](function(){_0x4fd7d0[_0xffc4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2faaa9,_0x389c79){return function(_0x1d61ff){if(!_0x1d61ff){_0x2faaa9[_0xffc4('0x21')](0x194);}return _0x1d61ff;};}function handleError(_0x2de4b8,_0x1328fe){_0x1328fe=_0x1328fe||0x1f4;return function(_0x10988a){logger['error'](_0x10988a[_0xffc4('0x2c')]);if(_0x10988a[_0xffc4('0x2d')]){delete _0x10988a[_0xffc4('0x2d')];}_0x2de4b8[_0xffc4('0x22')](_0x1328fe)[_0xffc4('0x2e')](_0x10988a);};}function getInteractionUsers(_0x3e52f9,_0x4458a3){return new BPromise(function(_0xceab82,_0xc9ae76){try{if(_0x4458a3[_0x3e52f9['id']]){_0x3e52f9[_0xffc4('0x2f')]=_[_0xffc4('0x30')](_0x4458a3[_0x3e52f9['id']],function(_0x59d75b){return{'id':_0x59d75b['id'],'fullname':_0x59d75b[_0xffc4('0x31')]};});}}catch(_0x39a25b){_0xc9ae76(_0x39a25b);}_0xceab82(_0x3e52f9);});}function getInteractionTags(_0x24ea67,_0x265936){return new BPromise(function(_0x22d594,_0x2bffe3){try{if(_0x24ea67['TagIds']){_0x24ea67[_0xffc4('0x32')]=[];_0x24ea67[_0xffc4('0x33')][_0xffc4('0x34')](',')[_0xffc4('0x35')](function(_0x15bec3){_0x24ea67[_0xffc4('0x32')]['push'](_0x265936[_0x15bec3]);});}delete _0x24ea67[_0xffc4('0x33')];}catch(_0x568f13){_0x2bffe3(_0x568f13);}_0x22d594(_0x24ea67);});}function updateWhatsappInteraction(_0x512812,_0x908971,_0x127ad4){return new BPromise(function(_0x12293a,_0x299997){return getInteractionUsers(_0x512812,_0x127ad4)['then'](function(_0x42dd35){return getInteractionTags(_0x42dd35,_0x908971);})['then'](function(_0x41986e){return getStateInteraction(_0x41986e);})[_0xffc4('0x2b')](function(_0x4ff58e){_0x12293a(_0x4ff58e);})['catch'](function(_0xe62223){_0x299997(_0xe62223);});});}function getStateInteraction(_0x465e66){return new BPromise(function(_0x21ad59){_0x465e66[_0xffc4('0x36')]=0x0;_0x465e66['talking']=0x0;_0x465e66[_0xffc4('0x37')]=0x0;_0x465e66[_0xffc4('0x38')]=0x0;_0x465e66[_0xffc4('0x39')]=0x0;if(!_0x465e66[_0xffc4('0x3a')]&&!_0x465e66['UserId']){_0x465e66[_0xffc4('0x36')]+=0x1;}if(!_0x465e66[_0xffc4('0x3a')]&&_0x465e66[_0xffc4('0x3b')]){_0x465e66[_0xffc4('0x3c')]+=0x1;if(_0x465e66[_0xffc4('0x36')]){_0x465e66[_0xffc4('0x36')]-=0x1;}}if(_0x465e66[_0xffc4('0x3a')]&&_0x465e66[_0xffc4('0x3b')]){_0x465e66[_0xffc4('0x37')]+=0x1;if(_0x465e66[_0xffc4('0x3c')]){_0x465e66[_0xffc4('0x3c')]-=0x1;}}if(_0x465e66[_0xffc4('0x3a')]&&!_0x465e66[_0xffc4('0x3b')]){_0x465e66[_0xffc4('0x38')]+=0x1;if(_0x465e66[_0xffc4('0x36')]){_0x465e66[_0xffc4('0x36')]-=0x1;}}_0x465e66['total']+=0x1;_0x21ad59(_0x465e66);});}exports[_0xffc4('0x3d')]=function(_0x182cfa,_0x3d4c8e){var _0x4585c2={},_0x45d628={},_0xff3efe={'count':0x0,'rows':[]};var _0x3900fa=_[_0xffc4('0x30')](db['WhatsappInteraction'][_0xffc4('0x3e')],function(_0x58e0e8){return{'name':_0x58e0e8[_0xffc4('0x3f')],'type':_0x58e0e8[_0xffc4('0x40')][_0xffc4('0x41')]};});_0x45d628[_0xffc4('0x42')]=_[_0xffc4('0x30')](_0x3900fa,'name');_0x45d628[_0xffc4('0x43')]=_['keys'](_0x182cfa[_0xffc4('0x43')]);_0x45d628[_0xffc4('0x44')]=_[_0xffc4('0x45')](_0x45d628[_0xffc4('0x42')],_0x45d628[_0xffc4('0x43')]);_0x4585c2[_0xffc4('0x46')]=_[_0xffc4('0x45')](_0x45d628[_0xffc4('0x42')],qs[_0xffc4('0x47')](_0x182cfa[_0xffc4('0x43')]['fields']));_0x4585c2[_0xffc4('0x46')]=_0x4585c2[_0xffc4('0x46')]['length']?_0x4585c2[_0xffc4('0x46')]:_0x45d628[_0xffc4('0x42')];if(!_0x182cfa[_0xffc4('0x43')][_0xffc4('0x48')](_0xffc4('0x49'))){_0x4585c2[_0xffc4('0x25')]=qs[_0xffc4('0x25')](_0x182cfa[_0xffc4('0x43')][_0xffc4('0x25')]);_0x4585c2[_0xffc4('0x24')]=qs[_0xffc4('0x24')](_0x182cfa[_0xffc4('0x43')][_0xffc4('0x24')]);}_0x4585c2[_0xffc4('0x4a')]=qs[_0xffc4('0x4b')](_0x182cfa['query'][_0xffc4('0x4b')]);_0x4585c2['where']=qs['filters'](_[_0xffc4('0x4c')](_0x182cfa['query'],_0x45d628[_0xffc4('0x44')]),_0x3900fa);var _0x1a08d6=[];var _0x4265c9=squel[_0xffc4('0x4d')]()['field']('id')[_0xffc4('0x4e')](_0xffc4('0x2d'))['field'](_0xffc4('0x4f'))[_0xffc4('0x50')](_0xffc4('0x51'));var _0x54cf24=squel[_0xffc4('0x4d')]()[_0xffc4('0x4e')](_0xffc4('0x52'))[_0xffc4('0x4e')](_0xffc4('0x53'))['field'](_0xffc4('0x54'))[_0xffc4('0x50')](_0xffc4('0x55'),'ui')['left_join'](_0xffc4('0x56'),'u',_0xffc4('0x57'));var _0x5df164=squel[_0xffc4('0x4d')]()[_0xffc4('0x50')]('whatsapp_interactions','i')[_0xffc4('0x58')]('cm_contacts','c',_0xffc4('0x59'))[_0xffc4('0x58')](_0xffc4('0x56'),'o',_0xffc4('0x5a'))[_0xffc4('0x58')](_0xffc4('0x5b'),'a','a.id\x20=\x20i.WhatsappAccountId')['left_join'](_0xffc4('0x5c'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xffc4('0x58')](_0xffc4('0x5d'),'it',_0xffc4('0x5e'))[_0xffc4('0x58')](_0xffc4('0x51'),'t',_0xffc4('0x5f'));var _0x260ccd=squel['expr']();var _0x2b0b38=[];var _0x14a063=squel[_0xffc4('0x60')]();var _0x37c7f3;if(_0x182cfa[_0xffc4('0x43')]['search']){_0x37c7f3=as[_0xffc4('0x61')](_0x182cfa['query']['search']);var _0x160bba=_0x37c7f3[_0xffc4('0x62')];for(var _0x3cb479=0x0;_0x3cb479<_0x37c7f3[_0xffc4('0x63')][_0xffc4('0x64')];_0x3cb479++){var _0x225330=_0x37c7f3[_0xffc4('0x63')][_0x3cb479];var _0x197d8d='i';var _0x2c5089=_[_0xffc4('0x65')](_0x3900fa,['name',_0x225330[_0xffc4('0x4e')]]);if(!_0x2c5089){switch(_0x225330[_0xffc4('0x4e')]){case _0xffc4('0x66'):if(_0x225330[_0xffc4('0x67')]==0x1){_0x5df164[_0xffc4('0x68')]('`'+_0x225330[_0xffc4('0x4e')]+_0xffc4('0x69'));}else{_0x5df164[_0xffc4('0x68')]('`'+_0x225330['field']+'`\x20>\x200');}break;case _0xffc4('0x6a'):if(_0x225330[_0xffc4('0x6b')]===_0xffc4('0x6c')){if(_0x225330['value']['split']('\x20')['length']>0x1){_0x260ccd[_0x160bba](_0xffc4('0x6d'),qs[_0xffc4('0x6e')](_0x225330['value']),null);}else{var _0x5cec28='%'+_0x225330[_0xffc4('0x67')]+'%';_0x260ccd[_0x160bba](_0xffc4('0x6f'),_0x5cec28,_0x5cec28,_0x5cec28);}}else{_0x2c5089=_[_0xffc4('0x65')](_0x3900fa,[_0xffc4('0x2d'),_0xffc4('0x70')]);_0x225330[_0xffc4('0x4e')]=_0xffc4('0x70');_0x309d3d=as[_0xffc4('0x71')](_0x197d8d,_0x2c5089[_0xffc4('0x40')],_0x225330);_0x260ccd[_0x160bba](_0x309d3d[_0xffc4('0x72')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x73')],_0x309d3d['value'][_0xffc4('0x74')]);}break;case'Tag':var _0x145638=_0x225330['value']['split'](',')[_0xffc4('0x30')](function(_0x9c6faa){return Number(_0x9c6faa);});_0x145638['forEach'](function(_0x47218b){_0x14a063['or'](_0xffc4('0x75'),'%,'+_0x47218b+',%');});_0x2b0b38=_[_0xffc4('0x76')](_0x2b0b38,_0x145638);break;case _0xffc4('0x77'):if(_0x225330[_0xffc4('0x6b')]===_0xffc4('0x6c')){_0x260ccd[_0x160bba](_0xffc4('0x78'),'%'+_0x225330['value']+'%',null);}else{_0x2c5089=_['find'](_0x3900fa,[_0xffc4('0x2d'),_0xffc4('0x3b')]);_0x225330['field']=_0xffc4('0x3b');_0x309d3d=as[_0xffc4('0x71')](_0x197d8d,_0x2c5089[_0xffc4('0x40')],_0x225330);_0x260ccd[_0x160bba](_0x309d3d[_0xffc4('0x72')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x73')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x74')]);}break;case _0xffc4('0x79'):_0x309d3d=as[_0xffc4('0x71')]('me',null,_0x225330);_0x260ccd[_0x160bba](_0x309d3d[_0xffc4('0x72')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x73')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x74')]);break;}}else{var _0x309d3d=as['buildExpression'](_0x197d8d,_0x2c5089[_0xffc4('0x40')],_0x225330);_0x260ccd[_0x160bba](_0x309d3d[_0xffc4('0x72')],_0x309d3d[_0xffc4('0x67')][_0xffc4('0x73')],_0x309d3d[_0xffc4('0x67')]['end']);}}}else{var _0x1424b6=_(_0x182cfa[_0xffc4('0x43')])[_0xffc4('0x7a')]()[_0xffc4('0x30')](function(_0xba111){return _[_0xffc4('0x7b')](_0x3900fa,[_0xffc4('0x2d'),_0xba111])?_0xba111:undefined;})[_0xffc4('0x7c')]()[_0xffc4('0x67')]();if(!_[_0xffc4('0x7d')](_0x1424b6)){_0x1424b6[_0xffc4('0x35')](function(_0x5c7dc7){if(_0x5c7dc7===_0xffc4('0x7e')){_0x5df164[_0xffc4('0x7f')](_0xffc4('0x80'),[][_0xffc4('0x81')](_0x182cfa['query'][_0x5c7dc7]));}else if(_0x5c7dc7===_0xffc4('0x82')){var _0x330c30=JSON[_0xffc4('0x83')](_0x182cfa['query'][_0x5c7dc7])[_0xffc4('0x84')];var _0x4693e0=JSON[_0xffc4('0x83')](_0x182cfa[_0xffc4('0x43')][_0x5c7dc7])[_0xffc4('0x85')];_0x5df164[_0xffc4('0x7f')](_0xffc4('0x86'),_0x330c30,_0x4693e0);}else{if(_0x182cfa['query'][_0x5c7dc7]==='null'){_0x5df164[_0xffc4('0x7f')]('i.'+_0x5c7dc7+_0xffc4('0x87'));}else{_0x5df164[_0xffc4('0x7f')]('i.'+_0x5c7dc7+_0xffc4('0x88'),_0x182cfa[_0xffc4('0x43')][_0x5c7dc7]);}}});}if(_0x182cfa[_0xffc4('0x43')][_0xffc4('0x89')]){if(_0x182cfa[_0xffc4('0x43')][_0xffc4('0x89')]==0x1){_0x5df164[_0xffc4('0x68')](_0xffc4('0x8a'));}else{_0x5df164[_0xffc4('0x68')](_0xffc4('0x8b'));}}if(_0x182cfa[_0xffc4('0x43')][_0xffc4('0x8c')]){_0x2b0b38=_[_0xffc4('0x8d')](_0x182cfa[_0xffc4('0x43')]['tag'])?_0x182cfa[_0xffc4('0x43')][_0xffc4('0x8c')]:new Array(_0x182cfa[_0xffc4('0x43')]['tag']);_0x2b0b38[_0xffc4('0x35')](function(_0x2e45d0){_0x14a063['or'](_0xffc4('0x75'),'%,'+_0x2e45d0+',%');});}if(_0x182cfa[_0xffc4('0x43')][_0xffc4('0x8e')]){var _0x40efaa=_0x182cfa['query'][_0xffc4('0x8e')][_0xffc4('0x8f')]('\x5c','\x5c\x5c')[_0xffc4('0x8f')](/'/g,'\x27\x27');if(qs[_0xffc4('0x90')](_0x40efaa)){_0x260ccd['or']('i.id\x20LIKE\x20?',_0x40efaa+'%')['or'](_0xffc4('0x91'),_0x40efaa+'%');}else{_0x260ccd['or'](_0xffc4('0x92'),qs[_0xffc4('0x6e')](_0x40efaa))['or'](_0xffc4('0x93'),_0x40efaa+'%');}}}_0x5df164[_0xffc4('0x7f')](_0x260ccd);_0x5df164[_0xffc4('0x94')](_0xffc4('0x95'));var _0x5c5144={'type':db[_0xffc4('0x96')][_0xffc4('0x97')][_0xffc4('0x98')],'raw':!![]};var _0x986a0b=_0x5df164[_0xffc4('0x99')]();_0x986a0b['field'](_0xffc4('0x95'));_0x986a0b[_0xffc4('0x4e')](_0xffc4('0x9a'),_0xffc4('0x66'));if(_0x4585c2[_0xffc4('0x4a')]){_0x4585c2[_0xffc4('0x4a')]['forEach'](function(_0x28b7de){var _0x199e8b=_0x28b7de[0x0]==='contactName'?_0x28b7de[0x0]:'i.'+_0x28b7de[0x0];_0x5df164[_0xffc4('0x4a')](_0x199e8b,_0x28b7de[0x1]===_0xffc4('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x2b0b38)){_0x5df164[_0xffc4('0x68')](_0x14a063);_0x986a0b[_0xffc4('0x7f')]('t.id\x20IN\x20?',_0x2b0b38);}BPromise[_0xffc4('0x9c')]()[_0xffc4('0x2b')](function(){if(!_0x37c7f3){if(_0x182cfa[_0xffc4('0x43')]['WhatsappAccountId'])return;_0x986a0b[_0xffc4('0x7f')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x5df164[_0xffc4('0x7f')](_0xffc4('0x9d'));return;}if(_0x182cfa[_0xffc4('0x9e')][_0xffc4('0x9f')]!==_0xffc4('0xa0'))return;return _0x182cfa[_0xffc4('0x9e')][_0xffc4('0xa1')]({'attributes':['id'],'raw':!![]})[_0xffc4('0x2b')](function(_0x40d126){if(_['isEmpty'](_0x40d126)){_0x986a0b[_0xffc4('0x7f')](_0xffc4('0xa2'));_0x5df164[_0xffc4('0x7f')](_0xffc4('0xa2'));}else{_0x986a0b[_0xffc4('0x7f')](_0xffc4('0x80'),_[_0xffc4('0x30')](_0x40d126,'id'));_0x5df164[_0xffc4('0x7f')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x40d126,'id'));}});})['then'](function(){if(_0x182cfa['user'][_0xffc4('0x9f')]==='agent'&&!_0x37c7f3&&!_0x182cfa[_0xffc4('0x43')][_0xffc4('0x7e')])return[];return db[_0xffc4('0xa3')][_0xffc4('0x43')](_0x986a0b[_0xffc4('0xa4')](),_0x5c5144);})[_0xffc4('0x2b')](function(_0x57910f){_0xff3efe[_0xffc4('0x26')]=_0x57910f[_0xffc4('0x64')];if(_0xff3efe[_0xffc4('0x26')]===0x0)return[];return db[_0xffc4('0xa3')][_0xffc4('0x43')](_0x4265c9['toString'](),_0x5c5144)[_0xffc4('0x2b')](function(_0x1942a3){_0x1a08d6=_[_0xffc4('0xa5')](_0x1942a3,'id');_0x5c5144=_[_0xffc4('0xa6')](_0x5c5144,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x182cfa['query'][_0xffc4('0x47')]){_0x4585c2['attributes'][_0xffc4('0x35')](function(_0xc8031e){_0x5df164[_0xffc4('0x4e')]('i.'+_0xc8031e);});}else{_0x5df164[_0xffc4('0x4e')](_0xffc4('0x9a'),_0xffc4('0x66'));_0x5df164[_0xffc4('0x4e')]('a.key',_0xffc4('0xa7'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xa8'),_0xffc4('0xa9'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xaa'),_0xffc4('0xab'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xac'));_0x5df164['field'](_0xffc4('0xad'),_0xffc4('0xae'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xaf'),'Contact.lastName');_0x5df164['field'](_0xffc4('0xb0'),_0xffc4('0xb1'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xb2'),_0xffc4('0xb3'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xb4'),_0xffc4('0xb5'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xb6'),_0xffc4('0xb7'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xb8'),_0xffc4('0xb9'));_0x5df164[_0xffc4('0x4e')](_0xffc4('0xba'),_0xffc4('0xbb'));_0x5df164[_0xffc4('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4585c2[_0xffc4('0x25')])_0x5df164[_0xffc4('0x25')](_0x4585c2[_0xffc4('0x25')]);if(_0x4585c2[_0xffc4('0x24')])_0x5df164[_0xffc4('0x24')](_0x4585c2[_0xffc4('0x24')]);return db[_0xffc4('0xa3')][_0xffc4('0x43')](_0x5df164['toString'](),_0x5c5144);})['then'](function(_0xfe4a60){if(_0xfe4a60[_0xffc4('0x64')]>0x0)_0x54cf24[_0xffc4('0x7f')](_0xffc4('0xbc'),_[_0xffc4('0x30')](_0xfe4a60,'id'));return db[_0xffc4('0xa3')][_0xffc4('0x43')](_0x54cf24[_0xffc4('0xa4')](),_0x5c5144)['then'](function(_0x468369){var _0x3a7447=_['groupBy'](_0x468369,_0xffc4('0xbd'));var _0x36ecfb=[];_0xfe4a60[_0xffc4('0x35')](function(_0x17609e){_0x36ecfb['push'](updateWhatsappInteraction(_0x17609e,_0x1a08d6,_0x3a7447));});return BPromise[_0xffc4('0xbe')](_0x36ecfb);});});})[_0xffc4('0x2b')](function(_0x5996b8){_0xff3efe[_0xffc4('0xbf')]=_0x5996b8;return _0xff3efe;})[_0xffc4('0x2b')](respondWithFilteredResult(_0x3d4c8e,_0x4585c2))['catch'](handleError(_0x3d4c8e,null));};exports[_0xffc4('0xc0')]=function(_0x20a1ef,_0x40eab5){var _0x5aeaec={'raw':![],'where':{'id':_0x20a1ef[_0xffc4('0xc1')]['id']}},_0x3b15e1={};_0x3b15e1[_0xffc4('0x42')]=_['keys'](db[_0xffc4('0xc2')]['rawAttributes']);_0x3b15e1[_0xffc4('0x43')]=_['keys'](_0x20a1ef[_0xffc4('0x43')]);_0x3b15e1['filters']=_['intersection'](_0x3b15e1['model'],_0x3b15e1[_0xffc4('0x43')]);_0x5aeaec[_0xffc4('0x46')]=_[_0xffc4('0x45')](_0x3b15e1['model'],qs[_0xffc4('0x47')](_0x20a1ef[_0xffc4('0x43')]['fields']));_0x5aeaec['attributes']=_0x5aeaec[_0xffc4('0x46')][_0xffc4('0x64')]?_0x5aeaec[_0xffc4('0x46')]:_0x3b15e1[_0xffc4('0x42')];if(_0x20a1ef[_0xffc4('0x43')][_0xffc4('0xc3')]){_0x5aeaec['include']=[{'all':!![]}];}_0x5aeaec=_[_0xffc4('0xa6')]({},_0x5aeaec,_0x20a1ef[_0xffc4('0xc4')]);return db['WhatsappInteraction'][_0xffc4('0x65')](_0x5aeaec)['then'](handleEntityNotFound(_0x40eab5,null))[_0xffc4('0x2b')](respondWithResult(_0x40eab5,null))['catch'](handleError(_0x40eab5,null));};exports[_0xffc4('0xc5')]=function(_0x17bf1e,_0x3bf551){return db['WhatsappInteraction'][_0xffc4('0xc5')](_0x17bf1e[_0xffc4('0x79')],{})[_0xffc4('0x2b')](respondWithResult(_0x3bf551,0xc9))[_0xffc4('0xc6')](handleError(_0x3bf551,null));};exports[_0xffc4('0x2a')]=function(_0x2e10e7,_0x54a072){if(_0x2e10e7['body']['id']){delete _0x2e10e7[_0xffc4('0x79')]['id'];}return db[_0xffc4('0xc2')][_0xffc4('0x65')]({'where':{'id':_0x2e10e7['params']['id']}})[_0xffc4('0x2b')](handleEntityNotFound(_0x54a072,null))[_0xffc4('0x2b')](saveUpdates(_0x2e10e7[_0xffc4('0x79')],null))['then'](respondWithResult(_0x54a072,null))[_0xffc4('0xc6')](handleError(_0x54a072,null));};exports['destroy']=function(_0x1fbca1,_0x50c9a9){return db['WhatsappInteraction']['find']({'where':{'id':_0x1fbca1[_0xffc4('0xc1')]['id']}})[_0xffc4('0x2b')](handleEntityNotFound(_0x50c9a9,null))[_0xffc4('0x2b')](removeEntity(_0x50c9a9,null))[_0xffc4('0xc6')](handleError(_0x50c9a9,null));};exports[_0xffc4('0xc7')]=function(_0x10b9b2,_0x2c9b13){return db[_0xffc4('0xc2')]['describe']()[_0xffc4('0x2b')](respondWithResult(_0x2c9b13,null))[_0xffc4('0xc6')](handleError(_0x2c9b13,null));};exports[_0xffc4('0xc8')]=function(_0x3aa198,_0x215ad0,_0x4c4230){return db[_0xffc4('0xc9')]['find']({'where':{'id':_0x3aa198[_0xffc4('0xc1')]['id']}})['then'](handleEntityNotFound(_0x215ad0,null))[_0xffc4('0x2b')](function(_0xd10c46){if(_0xd10c46){return _0xd10c46[_0xffc4('0xc8')](_0x3aa198[_0xffc4('0x79')][_0xffc4('0xca')],_[_0xffc4('0xcb')](_0x3aa198[_0xffc4('0x79')],[_0xffc4('0xca'),'id'])||{});}})[_0xffc4('0x2b')](respondWithResult(_0x215ad0,null))[_0xffc4('0xc6')](handleError(_0x215ad0,null));};exports[_0xffc4('0xcc')]=function(_0x4e600c,_0x82a331,_0x18d803){var _0x19132a={'raw':![],'where':{}};var _0x3bf73f={};var _0x75bd3e={'count':0x0,'rows':[]};return db[_0xffc4('0xc2')]['findOne']({'where':{'id':_0x4e600c[_0xffc4('0xc1')]['id']}})[_0xffc4('0x2b')](handleEntityNotFound(_0x82a331,null))['then'](function(_0x15d705){if(_0x15d705){_0x3bf73f[_0xffc4('0x42')]=_[_0xffc4('0x7a')](db['WhatsappMessage']['rawAttributes']);_0x3bf73f['query']=_[_0xffc4('0x7a')](_0x4e600c[_0xffc4('0x43')]);_0x3bf73f[_0xffc4('0x44')]=_[_0xffc4('0x45')](_0x3bf73f['model'],_0x3bf73f[_0xffc4('0x43')]);_0x19132a[_0xffc4('0x46')]=_[_0xffc4('0x45')](_0x3bf73f[_0xffc4('0x42')],qs[_0xffc4('0x47')](_0x4e600c[_0xffc4('0x43')][_0xffc4('0x47')]));_0x19132a[_0xffc4('0x46')]=_0x19132a[_0xffc4('0x46')]['length']?_0x19132a[_0xffc4('0x46')]:_0x3bf73f['model'];if(!_0x4e600c['query'][_0xffc4('0x48')]('nolimit')){_0x19132a['limit']=qs[_0xffc4('0x25')](_0x4e600c[_0xffc4('0x43')]['limit']);_0x19132a['offset']=qs[_0xffc4('0x24')](_0x4e600c['query']['offset']);}_0x19132a[_0xffc4('0x4a')]=qs[_0xffc4('0x4b')](_0x4e600c['query'][_0xffc4('0x4b')]);_0x19132a['where']=qs[_0xffc4('0x44')](_[_0xffc4('0x4c')](_0x4e600c[_0xffc4('0x43')],_0x3bf73f['filters']));_0x19132a[_0xffc4('0x7f')][_0xffc4('0xbd')]=_0x15d705['id'];if(_0x4e600c['query'][_0xffc4('0x8e')]){_0x19132a[_0xffc4('0x7f')]=_[_0xffc4('0xa6')](_0x19132a[_0xffc4('0x7f')],{'$or':_[_0xffc4('0x30')](_0x19132a[_0xffc4('0x46')],function(_0xdd452d){var _0x4daf79={};_0x4daf79[_0xdd452d]={'$like':'%'+_0x4e600c[_0xffc4('0x43')]['filter']+'%'};return _0x4daf79;})});}if(_0x4e600c[_0xffc4('0x43')][_0xffc4('0x84')]){var _0x1fbc8b=_0x4e600c[_0xffc4('0x43')][_0xffc4('0x84')][_0xffc4('0x34')](',');var _0x4c690f={};_0x4c690f[_0x1fbc8b[0x0]]={'$gte':moment(_0x1fbc8b[0x1])[_0xffc4('0xcd')]('YYYY-MM-DD\x20HH:mm:ss')};_0x19132a['where']=_[_0xffc4('0xa6')](_0x19132a['where'],_0x4c690f);}_0x19132a=_[_0xffc4('0xa6')]({},_0x19132a,_0x4e600c[_0xffc4('0xc4')]);return db['WhatsappMessage'][_0xffc4('0x26')]({'where':_0x19132a[_0xffc4('0x7f')]})[_0xffc4('0x2b')](function(_0x337972){_0x75bd3e[_0xffc4('0x26')]=_0x337972;if(_0x4e600c[_0xffc4('0x43')]['includeAll']){_0x19132a['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x19132a);})[_0xffc4('0x2b')](function(_0x1c5270){_0x75bd3e[_0xffc4('0xbf')]=_0x1c5270;return _0x75bd3e;});}})[_0xffc4('0x2b')](respondWithFilteredResult(_0x82a331,_0x19132a))[_0xffc4('0xc6')](handleError(_0x82a331,null));};exports[_0xffc4('0xce')]=function(_0x484ccd,_0x107396,_0x464e6a){return db[_0xffc4('0xc2')]['find']({'where':{'id':_0x484ccd[_0xffc4('0xc1')]['id']}})[_0xffc4('0x2b')](handleEntityNotFound(_0x107396,null))[_0xffc4('0x2b')](function(_0xf2487b){if(_0xf2487b){return _0xf2487b[_0xffc4('0xcf')](_0x484ccd[_0xffc4('0x79')][_0xffc4('0xca')],_[_0xffc4('0xcb')](_0x484ccd[_0xffc4('0x79')],[_0xffc4('0xca'),'id'])||{})[_0xffc4('0xd0')](function(){return db[_0xffc4('0xd1')]['findAll']({'attributes':['id',_0xffc4('0x2d'),_0xffc4('0x4f')],'where':{'id':_0x484ccd[_0xffc4('0x79')][_0xffc4('0xca')]}});})[_0xffc4('0x2b')](function(_0xc2c9c2){socket['emit'](_0xffc4('0xd2'),{'id':Number(_0x484ccd[_0xffc4('0xc1')]['id']),'tags':_0xc2c9c2||[]});return{'id':Number(_0x484ccd[_0xffc4('0xc1')]['id']),'tags':_0xc2c9c2||[]};});}})[_0xffc4('0x2b')](respondWithResult(_0x107396,null))['catch'](handleError(_0x107396,null));};exports[_0xffc4('0xd3')]=function(_0x13b68b,_0x41ed56,_0x468351){return db['WhatsappInteraction'][_0xffc4('0x65')]({'where':{'id':_0x13b68b[_0xffc4('0xc1')]['id']}})['then'](handleEntityNotFound(_0x41ed56,null))['then'](function(_0x31e5ec){if(_0x31e5ec){return _0x31e5ec[_0xffc4('0xd3')](_0x13b68b[_0xffc4('0x43')]['ids']);}})[_0xffc4('0x2b')](respondWithStatusCode(_0x41ed56,null))[_0xffc4('0xc6')](handleError(_0x41ed56,null));};exports['download']=function(_0x35433e,_0x1788af){var _0x24c7af=moment()[_0xffc4('0xd4')]()[_0xffc4('0xa4')]();var _0x5aa2eb=path[_0xffc4('0xd5')](config[_0xffc4('0xd6')],_0xffc4('0xd7'),_0xffc4('0xd8'),_0xffc4('0xd9'));var _0x4e4af0=path['join'](config[_0xffc4('0xd6')],_0xffc4('0xd7'),_0xffc4('0xd8'),'attachments');var _0x5af70b=path[_0xffc4('0xd5')](_0x5aa2eb,_0x24c7af);var _0x55be24=util[_0xffc4('0xcd')](_0xffc4('0xda'),_0x35433e[_0xffc4('0xc1')]['id'],_0x24c7af);var _0x213b00=path[_0xffc4('0xd5')](_0x5aa2eb,_0x55be24);var _0x35096b=[];_0x35096b[_0xffc4('0xdb')]({'model':db[_0xffc4('0x77')],'as':_0xffc4('0x77'),'attributes':['id',_0xffc4('0x31')],'raw':!![]});_0x35096b[_0xffc4('0xdb')]({'model':db[_0xffc4('0xdc')],'as':_0xffc4('0x6a'),'attributes':['id',_0xffc4('0xdd'),_0xffc4('0xde')],'raw':!![]});if(_0x35433e[_0xffc4('0x43')][_0xffc4('0xdf')]){_0x35096b['push']({'model':db[_0xffc4('0xe0')],'as':_0xffc4('0xe0'),'raw':!![]});}var _0x3b1e4d=[{'model':db[_0xffc4('0xc9')],'as':_0xffc4('0xe1'),'attributes':['id',_0xffc4('0x79'),'createdAt',_0xffc4('0xe2'),_0xffc4('0xe3'),_0xffc4('0x89')],'include':_0x35096b}];_0x3b1e4d[_0xffc4('0xdb')]({'model':db[_0xffc4('0xe4')],'as':'Account','attributes':['id',_0xffc4('0x2d')]});_0x3b1e4d['push']({'model':db['User'],'as':_0xffc4('0xe5'),'attributes':['id',_0xffc4('0x31')]});return db['WhatsappInteraction'][_0xffc4('0x65')]({'where':{'id':_0x35433e[_0xffc4('0xc1')]['id']},'include':_0x3b1e4d})['then'](handleEntityNotFound(_0x1788af,null))[_0xffc4('0x2b')](function(_0x209ab2){if(_0x209ab2){var _0x51ba43=_0x209ab2['get']({'plain':!![]});fs[_0xffc4('0xe6')](_0x5af70b);var _0x404861={'channel':'Whatsapp','account':_0x51ba43[_0xffc4('0xe7')][_0xffc4('0x2d')],'agent':_0x51ba43[_0xffc4('0xe5')]?_0x51ba43[_0xffc4('0xe5')][_0xffc4('0x31')]:_0xffc4('0xe8'),'createdAt':moment(_0x51ba43[_0xffc4('0x82')])[_0xffc4('0xcd')](_0xffc4('0xe9'))[_0xffc4('0xa4')](),'closedAt':_0x51ba43[_0xffc4('0x3a')]?moment(_0x51ba43[_0xffc4('0xea')])[_0xffc4('0xcd')](_0xffc4('0xe9'))[_0xffc4('0xa4')]():'','disposition':_0x51ba43[_0xffc4('0xeb')],'messages':_(_0x51ba43[_0xffc4('0xe1')])['filter']({'secret':![]})['map'](function(_0x436358){if(_0x436358['Attachment']){var _0xdc7271=path[_0xffc4('0xd5')](_0x4e4af0,_0x436358[_0xffc4('0xe0')][_0xffc4('0xec')]);if(fs[_0xffc4('0xed')](_0xdc7271)){fs[_0xffc4('0xee')](_0xdc7271)['pipe'](fs[_0xffc4('0xef')](path[_0xffc4('0xd5')](_0x5af70b,_0x436358[_0xffc4('0xe0')][_0xffc4('0xec')])));}}return{'date':moment(_0x436358['createdAt'])[_0xffc4('0xcd')](_0xffc4('0xe9'))[_0xffc4('0xa4')](),'sender':_0x436358[_0xffc4('0xe2')]===_0xffc4('0xf0')?_0x436358[_0xffc4('0x77')]?_0x436358[_0xffc4('0x77')][_0xffc4('0x31')]:'System':_0x436358['Contact'][_0xffc4('0xdd')]+(_0x436358[_0xffc4('0x6a')]['lastName']?'\x20'+_0x436358[_0xffc4('0x6a')]['lastName']:''),'body':_0x436358['Attachment']?_0x436358['Attachment'][_0xffc4('0xec')]:_0x436358[_0xffc4('0x79')],'direction':_0x436358['direction']==='out'?'A':'C','secret':_0x436358[_0xffc4('0xe3')],'read':_0x436358[_0xffc4('0x89')],'attachment':_0x436358[_0xffc4('0xe0')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xffc4('0xd6')],'server',_0xffc4('0xf1'),_0xffc4('0xf2')),{'interaction':_0x404861})[_0xffc4('0x2b')](function(_0x1fdcc0){var _0x1b135e=path[_0xffc4('0xd5')](_0x5af70b,'transcript-'+_0x51ba43['id']+'-'+_0x24c7af+_0xffc4('0xf3'));var _0x577185={'path':_0x1b135e,'channel':'Whatsapp','interactionId':_0x51ba43['id']};return pdf[_0xffc4('0xf4')](_0x1fdcc0,_0x577185);})['then'](function(){return new BPromise(function(_0x57eca5,_0x5279ef){zipdir(_0x5af70b,{'saveTo':_0x213b00},function(_0x5b778e,_0x52c3be){if(_0x5b778e)return _0x5279ef(_0x5b778e);return _0x57eca5(_0x52c3be);});})[_0xffc4('0x2b')](function(){return new BPromise(function(_0x16e3d7,_0x140e7f){rimraf(_0x5af70b,function(_0x1fb34d){if(_0x1fb34d)_0x140e7f(_0x1fb34d);return _0x16e3d7();});});})[_0xffc4('0x2b')](function(){return _0x1788af[_0xffc4('0xf5')](_0x213b00,_0x55be24,function(_0x2baab0){if(_0x2baab0){console[_0xffc4('0xf6')](_0xffc4('0xf7'),_0x2baab0);}else{fs[_0xffc4('0xf8')](_0x213b00);}});});});}else{return _0x1788af[_0xffc4('0x21')](0xc8);}})[_0xffc4('0xc6')](handleError(_0x1788af,null));}; \ No newline at end of file +var _0xc893=['order','sort','where','select','field','color','from','tools_tags','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','keys','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','unreadMessages','contactName','resolve','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','all','rows','show','params','intersection','includeAll','include','options','create','update','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','nolimit','pick','WhatsappInteractionId','split','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','secret','Account','Owner','get','Whatsapp','N.A.','closedAt','existsSync','createReadStream','pipe','createWriteStream','basename','direction','System','renderFile','views','transcript-','.pdf','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xc893,0x194));var _0x3c89=function(_0x8669cc,_0x3d8da4){_0x8669cc=_0x8669cc-0x0;var _0x4e10ce=_0xc893[_0x8669cc];return _0x4e10ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c89('0x0'));var zipdir=require(_0x3c89('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c89('0x2'));var BPromise=require(_0x3c89('0x3'));var Mustache=require(_0x3c89('0x4'));var util=require(_0x3c89('0x5'));var path=require(_0x3c89('0x6'));var sox=require(_0x3c89('0x7'));var csv=require(_0x3c89('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c89('0x9'));var _=require(_0x3c89('0xa'));var squel=require(_0x3c89('0xb'));var crypto=require(_0x3c89('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3c89('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c89('0xe'));var Redis=require('ioredis');var authService=require(_0x3c89('0xf'));var qs=require(_0x3c89('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3c89('0x11'));var hardwareService=require(_0x3c89('0x12'));var logger=require(_0x3c89('0x13'))(_0x3c89('0x14'));var utils=require(_0x3c89('0x15'));var config=require(_0x3c89('0x16'));var licenseUtil=require(_0x3c89('0x17'));var db=require(_0x3c89('0x18'))['db'];config[_0x3c89('0x19')]=_[_0x3c89('0x1a')](config[_0x3c89('0x19')],{'host':_0x3c89('0x1b'),'port':0x18eb});var socket=require(_0x3c89('0x1c'))(new Redis(config[_0x3c89('0x19')]));require('./whatsappInteraction.socket')[_0x3c89('0x1d')](socket);function respondWithStatusCode(_0x29600e,_0x1e8df0){_0x1e8df0=_0x1e8df0||0xcc;return function(_0x15587a){if(_0x15587a){return _0x29600e[_0x3c89('0x1e')](_0x1e8df0);}return _0x29600e[_0x3c89('0x1f')](_0x1e8df0)[_0x3c89('0x20')]();};}function respondWithResult(_0x2a5019,_0x4647fd){_0x4647fd=_0x4647fd||0xc8;return function(_0x478744){if(_0x478744){return _0x2a5019[_0x3c89('0x1f')](_0x4647fd)['json'](_0x478744);}};}function respondWithFilteredResult(_0x4dd1b1,_0x2dcd6d){return function(_0x322ece){if(_0x322ece){var _0x5832e7=typeof _0x2dcd6d['offset']===_0x3c89('0x21')&&typeof _0x2dcd6d[_0x3c89('0x22')]===_0x3c89('0x21');var _0x5c38ac=_0x322ece['count'];var _0x9a689e=_0x5832e7?0x0:_0x2dcd6d[_0x3c89('0x23')];var _0x218509=_0x5832e7?_0x322ece[_0x3c89('0x24')]:_0x2dcd6d[_0x3c89('0x23')]+_0x2dcd6d[_0x3c89('0x22')];var _0x24150a;if(_0x218509>=_0x5c38ac){_0x218509=_0x5c38ac;_0x24150a=0xc8;}else{_0x24150a=0xce;}_0x4dd1b1[_0x3c89('0x1f')](_0x24150a);return _0x4dd1b1[_0x3c89('0x25')](_0x3c89('0x26'),_0x9a689e+'-'+_0x218509+'/'+_0x5c38ac)[_0x3c89('0x27')](_0x322ece);}return null;};}function patchUpdates(_0x444f8){return function(_0x443559){try{jsonpatch[_0x3c89('0x28')](_0x443559,_0x444f8,!![]);}catch(_0xb85056){return BPromise[_0x3c89('0x29')](_0xb85056);}return _0x443559[_0x3c89('0x2a')]();};}function saveUpdates(_0x227eb,_0x11d915){return function(_0x462552){if(_0x462552){return _0x462552['update'](_0x227eb)[_0x3c89('0x2b')](function(_0x4db1ab){return _0x4db1ab;});}return null;};}function removeEntity(_0x4ea71a,_0x501dda){return function(_0x3b5796){if(_0x3b5796){return _0x3b5796[_0x3c89('0x2c')]()[_0x3c89('0x2b')](function(){_0x4ea71a['status'](0xcc)[_0x3c89('0x20')]();});}};}function handleEntityNotFound(_0xc317d6,_0x5877cc){return function(_0x557260){if(!_0x557260){_0xc317d6[_0x3c89('0x1e')](0x194);}return _0x557260;};}function handleError(_0x3f4946,_0x269227){_0x269227=_0x269227||0x1f4;return function(_0x4a38fc){logger['error'](_0x4a38fc[_0x3c89('0x2d')]);if(_0x4a38fc[_0x3c89('0x2e')]){delete _0x4a38fc['name'];}_0x3f4946[_0x3c89('0x1f')](_0x269227)[_0x3c89('0x2f')](_0x4a38fc);};}function getInteractionUsers(_0x144a6a,_0x1c0ba1){return new BPromise(function(_0x6c850e,_0x1fdbf4){try{if(_0x1c0ba1[_0x144a6a['id']]){_0x144a6a[_0x3c89('0x30')]=_['map'](_0x1c0ba1[_0x144a6a['id']],function(_0x42e1de){return{'id':_0x42e1de['id'],'fullname':_0x42e1de[_0x3c89('0x31')]};});}}catch(_0x3fcb76){_0x1fdbf4(_0x3fcb76);}_0x6c850e(_0x144a6a);});}function getInteractionTags(_0xf28390,_0x49b50a){return new BPromise(function(_0x408383,_0x4d2c6c){try{if(_0xf28390[_0x3c89('0x32')]){_0xf28390[_0x3c89('0x33')]=[];_0xf28390[_0x3c89('0x32')]['split'](',')[_0x3c89('0x34')](function(_0x547de5){_0xf28390[_0x3c89('0x33')][_0x3c89('0x35')](_0x49b50a[_0x547de5]);});}delete _0xf28390['TagIds'];}catch(_0x2a0189){_0x4d2c6c(_0x2a0189);}_0x408383(_0xf28390);});}function updateWhatsappInteraction(_0x3e1a02,_0x3fb7cc,_0x282101){return new BPromise(function(_0x151072,_0x37af1c){return getInteractionUsers(_0x3e1a02,_0x282101)['then'](function(_0x29b1e6){return getInteractionTags(_0x29b1e6,_0x3fb7cc);})[_0x3c89('0x2b')](function(_0x248594){return getStateInteraction(_0x248594);})[_0x3c89('0x2b')](function(_0xb9626f){_0x151072(_0xb9626f);})[_0x3c89('0x36')](function(_0x4bc12a){_0x37af1c(_0x4bc12a);});});}function getStateInteraction(_0x7608fc){return new BPromise(function(_0xb0526f){_0x7608fc[_0x3c89('0x37')]=0x0;_0x7608fc['talking']=0x0;_0x7608fc[_0x3c89('0x38')]=0x0;_0x7608fc[_0x3c89('0x39')]=0x0;_0x7608fc[_0x3c89('0x3a')]=0x0;if(!_0x7608fc[_0x3c89('0x3b')]&&!_0x7608fc[_0x3c89('0x3c')]){_0x7608fc[_0x3c89('0x37')]+=0x1;}if(!_0x7608fc[_0x3c89('0x3b')]&&_0x7608fc[_0x3c89('0x3c')]){_0x7608fc['talking']+=0x1;if(_0x7608fc['waiting']){_0x7608fc[_0x3c89('0x37')]-=0x1;}}if(_0x7608fc[_0x3c89('0x3b')]&&_0x7608fc[_0x3c89('0x3c')]){_0x7608fc['answered']+=0x1;if(_0x7608fc[_0x3c89('0x3d')]){_0x7608fc['talking']-=0x1;}}if(_0x7608fc[_0x3c89('0x3b')]&&!_0x7608fc[_0x3c89('0x3c')]){_0x7608fc[_0x3c89('0x39')]+=0x1;if(_0x7608fc[_0x3c89('0x37')]){_0x7608fc['waiting']-=0x1;}}_0x7608fc[_0x3c89('0x3a')]+=0x1;_0xb0526f(_0x7608fc);});}exports[_0x3c89('0x3e')]=function(_0x50b74f,_0x47bdf8){var _0x4f8880={},_0x5c90af={},_0x593d23={'count':0x0,'rows':[]};var _0x417b95=_[_0x3c89('0x3f')](db[_0x3c89('0x40')][_0x3c89('0x41')],function(_0x28f63e){return{'name':_0x28f63e[_0x3c89('0x42')],'type':_0x28f63e[_0x3c89('0x43')][_0x3c89('0x44')]};});_0x5c90af[_0x3c89('0x45')]=_['map'](_0x417b95,_0x3c89('0x2e'));_0x5c90af[_0x3c89('0x46')]=_['keys'](_0x50b74f[_0x3c89('0x46')]);_0x5c90af[_0x3c89('0x47')]=_['intersection'](_0x5c90af[_0x3c89('0x45')],_0x5c90af['query']);_0x4f8880[_0x3c89('0x48')]=_['intersection'](_0x5c90af[_0x3c89('0x45')],qs[_0x3c89('0x49')](_0x50b74f[_0x3c89('0x46')][_0x3c89('0x49')]));_0x4f8880['attributes']=_0x4f8880[_0x3c89('0x48')][_0x3c89('0x4a')]?_0x4f8880[_0x3c89('0x48')]:_0x5c90af['model'];if(!_0x50b74f['query'][_0x3c89('0x4b')]('nolimit')){_0x4f8880['limit']=qs[_0x3c89('0x22')](_0x50b74f['query'][_0x3c89('0x22')]);_0x4f8880[_0x3c89('0x23')]=qs[_0x3c89('0x23')](_0x50b74f[_0x3c89('0x46')]['offset']);}_0x4f8880[_0x3c89('0x4c')]=qs['sort'](_0x50b74f[_0x3c89('0x46')][_0x3c89('0x4d')]);_0x4f8880[_0x3c89('0x4e')]=qs[_0x3c89('0x47')](_['pick'](_0x50b74f[_0x3c89('0x46')],_0x5c90af[_0x3c89('0x47')]),_0x417b95);var _0x3f2558=[];var _0xf12c87=squel[_0x3c89('0x4f')]()[_0x3c89('0x50')]('id')['field'](_0x3c89('0x2e'))['field'](_0x3c89('0x51'))[_0x3c89('0x52')](_0x3c89('0x53'));var _0x49e197=squel['select']()[_0x3c89('0x50')]('u.id')[_0x3c89('0x50')](_0x3c89('0x54'))['field']('ui.WhatsappInteractionId')[_0x3c89('0x52')](_0x3c89('0x55'),'ui')[_0x3c89('0x56')](_0x3c89('0x57'),'u',_0x3c89('0x58'));var _0x22fc5e=squel['select']()['from'](_0x3c89('0x59'),'i')[_0x3c89('0x56')](_0x3c89('0x5a'),'c',_0x3c89('0x5b'))[_0x3c89('0x56')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x3c89('0x5c'),'a',_0x3c89('0x5d'))[_0x3c89('0x56')]('whatsapp_messages','me',_0x3c89('0x5e'))['left_join']('whatsapp_interaction_has_tags','it',_0x3c89('0x5f'))['left_join'](_0x3c89('0x53'),'t',_0x3c89('0x60'));var _0xf2c1a3=squel[_0x3c89('0x61')]();var _0x5d1af6=[];var _0x1c2caa=squel['expr']();var _0x471b22;if(_0x50b74f[_0x3c89('0x46')][_0x3c89('0x62')]){_0x471b22=as[_0x3c89('0x63')](_0x50b74f['query'][_0x3c89('0x62')]);var _0x5f591a=_0x471b22['sqlOperator'];for(var _0x57443d=0x0;_0x57443d<_0x471b22[_0x3c89('0x64')][_0x3c89('0x4a')];_0x57443d++){var _0x133ce7=_0x471b22[_0x3c89('0x64')][_0x57443d];var _0x558fe3='i';var _0x620570=_[_0x3c89('0x65')](_0x417b95,[_0x3c89('0x2e'),_0x133ce7[_0x3c89('0x50')]]);if(!_0x620570){switch(_0x133ce7[_0x3c89('0x50')]){case'unreadMessages':if(_0x133ce7[_0x3c89('0x66')]==0x1){_0x22fc5e[_0x3c89('0x67')]('`'+_0x133ce7[_0x3c89('0x50')]+_0x3c89('0x68'));}else{_0x22fc5e[_0x3c89('0x67')]('`'+_0x133ce7[_0x3c89('0x50')]+_0x3c89('0x69'));}break;case _0x3c89('0x6a'):if(_0x133ce7[_0x3c89('0x6b')]==='$substring'){if(_0x133ce7['value']['split']('\x20')['length']>0x1){_0xf2c1a3[_0x5f591a](_0x3c89('0x6c'),qs[_0x3c89('0x6d')](_0x133ce7[_0x3c89('0x66')]),null);}else{var _0x3dfb8f='%'+_0x133ce7[_0x3c89('0x66')]+'%';_0xf2c1a3[_0x5f591a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3dfb8f,_0x3dfb8f,_0x3dfb8f);}}else{_0x620570=_[_0x3c89('0x65')](_0x417b95,['name',_0x3c89('0x6e')]);_0x133ce7[_0x3c89('0x50')]=_0x3c89('0x6e');_0x372433=as['buildExpression'](_0x558fe3,_0x620570[_0x3c89('0x43')],_0x133ce7);_0xf2c1a3[_0x5f591a](_0x372433[_0x3c89('0x6f')],_0x372433[_0x3c89('0x66')][_0x3c89('0x70')],_0x372433['value'][_0x3c89('0x20')]);}break;case _0x3c89('0x71'):var _0x4d5917=_0x133ce7[_0x3c89('0x66')]['split'](',')[_0x3c89('0x3f')](function(_0x3dbad2){return Number(_0x3dbad2);});_0x4d5917[_0x3c89('0x34')](function(_0x103239){_0x1c2caa['or'](_0x3c89('0x72'),'%,'+_0x103239+',%');});_0x5d1af6=_['union'](_0x5d1af6,_0x4d5917);break;case _0x3c89('0x73'):if(_0x133ce7[_0x3c89('0x6b')]===_0x3c89('0x74')){_0xf2c1a3[_0x5f591a](_0x3c89('0x75'),'%'+_0x133ce7[_0x3c89('0x66')]+'%',null);}else{_0x620570=_[_0x3c89('0x65')](_0x417b95,['name',_0x3c89('0x3c')]);_0x133ce7[_0x3c89('0x50')]=_0x3c89('0x3c');_0x372433=as[_0x3c89('0x76')](_0x558fe3,_0x620570[_0x3c89('0x43')],_0x133ce7);_0xf2c1a3[_0x5f591a](_0x372433[_0x3c89('0x6f')],_0x372433[_0x3c89('0x66')][_0x3c89('0x70')],_0x372433[_0x3c89('0x66')][_0x3c89('0x20')]);}break;case _0x3c89('0x77'):_0x372433=as[_0x3c89('0x76')]('me',null,_0x133ce7);_0xf2c1a3[_0x5f591a](_0x372433[_0x3c89('0x6f')],_0x372433[_0x3c89('0x66')][_0x3c89('0x70')],_0x372433[_0x3c89('0x66')][_0x3c89('0x20')]);break;}}else{var _0x372433=as[_0x3c89('0x76')](_0x558fe3,_0x620570['type'],_0x133ce7);_0xf2c1a3[_0x5f591a](_0x372433[_0x3c89('0x6f')],_0x372433[_0x3c89('0x66')][_0x3c89('0x70')],_0x372433['value']['end']);}}}else{var _0xdb4ab3=_(_0x50b74f['query'])[_0x3c89('0x78')]()[_0x3c89('0x3f')](function(_0x220d94){return _[_0x3c89('0x79')](_0x417b95,['name',_0x220d94])?_0x220d94:undefined;})[_0x3c89('0x7a')]()[_0x3c89('0x66')]();if(!_[_0x3c89('0x7b')](_0xdb4ab3)){_0xdb4ab3[_0x3c89('0x34')](function(_0x299775){if(_0x299775===_0x3c89('0x7c')){_0x22fc5e[_0x3c89('0x4e')](_0x3c89('0x7d'),[]['concat'](_0x50b74f[_0x3c89('0x46')][_0x299775]));}else if(_0x299775===_0x3c89('0x7e')){var _0x32de73=JSON[_0x3c89('0x7f')](_0x50b74f[_0x3c89('0x46')][_0x299775])[_0x3c89('0x80')];var _0x503c5d=JSON[_0x3c89('0x7f')](_0x50b74f[_0x3c89('0x46')][_0x299775])[_0x3c89('0x81')];_0x22fc5e[_0x3c89('0x4e')](_0x3c89('0x82'),_0x32de73,_0x503c5d);}else{if(_0x50b74f['query'][_0x299775]===_0x3c89('0x83')){_0x22fc5e[_0x3c89('0x4e')]('i.'+_0x299775+'\x20IS\x20NULL');}else{_0x22fc5e['where']('i.'+_0x299775+_0x3c89('0x84'),_0x50b74f['query'][_0x299775]);}}});}if(_0x50b74f[_0x3c89('0x46')][_0x3c89('0x85')]){if(_0x50b74f[_0x3c89('0x46')][_0x3c89('0x85')]==0x1){_0x22fc5e['having'](_0x3c89('0x86'));}else{_0x22fc5e[_0x3c89('0x67')](_0x3c89('0x87'));}}if(_0x50b74f[_0x3c89('0x46')]['tag']){_0x5d1af6=_['isArray'](_0x50b74f[_0x3c89('0x46')][_0x3c89('0x88')])?_0x50b74f[_0x3c89('0x46')][_0x3c89('0x88')]:new Array(_0x50b74f[_0x3c89('0x46')][_0x3c89('0x88')]);_0x5d1af6[_0x3c89('0x34')](function(_0x3955b0){_0x1c2caa['or'](_0x3c89('0x72'),'%,'+_0x3955b0+',%');});}if(_0x50b74f[_0x3c89('0x46')]['filter']){var _0x6f539f=_0x50b74f[_0x3c89('0x46')][_0x3c89('0x89')][_0x3c89('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x6f539f)){_0xf2c1a3['or'](_0x3c89('0x8b'),_0x6f539f+'%')['or'](_0x3c89('0x8c'),_0x6f539f+'%');}else{_0xf2c1a3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6f539f))['or'](_0x3c89('0x8d'),_0x6f539f+'%');}}}_0x22fc5e[_0x3c89('0x4e')](_0xf2c1a3);_0x22fc5e[_0x3c89('0x8e')](_0x3c89('0x8f'));var _0x320a92={'type':db[_0x3c89('0x90')][_0x3c89('0x91')]['SELECT'],'raw':!![]};var _0x314f8c=_0x22fc5e[_0x3c89('0x92')]();_0x314f8c[_0x3c89('0x50')]('i.id');_0x314f8c[_0x3c89('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3c89('0x93'));if(_0x4f8880[_0x3c89('0x4c')]){_0x4f8880[_0x3c89('0x4c')][_0x3c89('0x34')](function(_0x35760d){var _0x260868=_0x35760d[0x0]===_0x3c89('0x94')?_0x35760d[0x0]:'i.'+_0x35760d[0x0];_0x22fc5e[_0x3c89('0x4c')](_0x260868,_0x35760d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3c89('0x7b')](_0x5d1af6)){_0x22fc5e[_0x3c89('0x67')](_0x1c2caa);_0x314f8c[_0x3c89('0x4e')]('t.id\x20IN\x20?',_0x5d1af6);}BPromise[_0x3c89('0x95')]()[_0x3c89('0x2b')](function(){if(!_0x471b22){if(_0x50b74f[_0x3c89('0x46')]['WhatsappAccountId'])return;_0x314f8c[_0x3c89('0x4e')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x22fc5e['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x50b74f[_0x3c89('0x96')][_0x3c89('0x97')]!==_0x3c89('0x98'))return;return _0x50b74f['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x3c89('0x2b')](function(_0x2ece39){if(_['isEmpty'](_0x2ece39)){_0x314f8c['where'](_0x3c89('0x99'));_0x22fc5e['where'](_0x3c89('0x99'));}else{_0x314f8c[_0x3c89('0x4e')]('i.WhatsappAccountId\x20IN\x20?',_[_0x3c89('0x3f')](_0x2ece39,'id'));_0x22fc5e[_0x3c89('0x4e')](_0x3c89('0x7d'),_[_0x3c89('0x3f')](_0x2ece39,'id'));}});})[_0x3c89('0x2b')](function(){if(_0x50b74f['user']['role']===_0x3c89('0x98')&&!_0x471b22&&!_0x50b74f['query'][_0x3c89('0x7c')])return[];return db['sequelize']['query'](_0x314f8c[_0x3c89('0x9a')](),_0x320a92);})[_0x3c89('0x2b')](function(_0x29ec84){_0x593d23['count']=_0x29ec84['length'];if(_0x593d23['count']===0x0)return[];return db[_0x3c89('0x9b')][_0x3c89('0x46')](_0xf12c87['toString'](),_0x320a92)[_0x3c89('0x2b')](function(_0x112331){_0x3f2558=_['keyBy'](_0x112331,'id');_0x320a92=_[_0x3c89('0x9c')](_0x320a92,{'model':db[_0x3c89('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50b74f[_0x3c89('0x46')][_0x3c89('0x49')]){_0x4f8880[_0x3c89('0x48')][_0x3c89('0x34')](function(_0x379183){_0x22fc5e[_0x3c89('0x50')]('i.'+_0x379183);});}else{_0x22fc5e['field'](_0x3c89('0x9d'),_0x3c89('0x93'));_0x22fc5e['field'](_0x3c89('0x9e'),_0x3c89('0x9f'));_0x22fc5e[_0x3c89('0x50')]('a.mandatoryDisposition',_0x3c89('0xa0'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xa1'),_0x3c89('0x94'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xa2'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xa3'),'Contact.firstName');_0x22fc5e[_0x3c89('0x50')]('c.lastName',_0x3c89('0xa4'));_0x22fc5e['field'](_0x3c89('0xa5'),_0x3c89('0xa6'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xa7'),_0x3c89('0xa8'));_0x22fc5e['field'](_0x3c89('0xa9'),_0x3c89('0xaa'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xab'),_0x3c89('0xac'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xad'),_0x3c89('0xae'));_0x22fc5e['field'](_0x3c89('0xaf'),_0x3c89('0xb0'));_0x22fc5e[_0x3c89('0x50')](_0x3c89('0xb1'),_0x3c89('0x32'));}if(_0x4f8880['limit'])_0x22fc5e[_0x3c89('0x22')](_0x4f8880[_0x3c89('0x22')]);if(_0x4f8880[_0x3c89('0x23')])_0x22fc5e['offset'](_0x4f8880['offset']);return db['sequelize'][_0x3c89('0x46')](_0x22fc5e[_0x3c89('0x9a')](),_0x320a92);})[_0x3c89('0x2b')](function(_0x25dd90){if(_0x25dd90[_0x3c89('0x4a')]>0x0)_0x49e197[_0x3c89('0x4e')](_0x3c89('0xb2'),_[_0x3c89('0x3f')](_0x25dd90,'id'));return db[_0x3c89('0x9b')][_0x3c89('0x46')](_0x49e197[_0x3c89('0x9a')](),_0x320a92)[_0x3c89('0x2b')](function(_0x570246){var _0x4c0839=_['groupBy'](_0x570246,'WhatsappInteractionId');var _0x31a65f=[];_0x25dd90['forEach'](function(_0x3a22fe){_0x31a65f[_0x3c89('0x35')](updateWhatsappInteraction(_0x3a22fe,_0x3f2558,_0x4c0839));});return BPromise[_0x3c89('0xb3')](_0x31a65f);});});})[_0x3c89('0x2b')](function(_0x250d16){_0x593d23[_0x3c89('0xb4')]=_0x250d16;return _0x593d23;})[_0x3c89('0x2b')](respondWithFilteredResult(_0x47bdf8,_0x4f8880))[_0x3c89('0x36')](handleError(_0x47bdf8,null));};exports[_0x3c89('0xb5')]=function(_0x1e3db6,_0x362b2f){var _0x567733={'raw':![],'where':{'id':_0x1e3db6[_0x3c89('0xb6')]['id']}},_0x3f49e7={};_0x3f49e7['model']=_['keys'](db[_0x3c89('0x40')][_0x3c89('0x41')]);_0x3f49e7[_0x3c89('0x46')]=_[_0x3c89('0x78')](_0x1e3db6[_0x3c89('0x46')]);_0x3f49e7[_0x3c89('0x47')]=_[_0x3c89('0xb7')](_0x3f49e7[_0x3c89('0x45')],_0x3f49e7[_0x3c89('0x46')]);_0x567733[_0x3c89('0x48')]=_[_0x3c89('0xb7')](_0x3f49e7[_0x3c89('0x45')],qs[_0x3c89('0x49')](_0x1e3db6[_0x3c89('0x46')][_0x3c89('0x49')]));_0x567733[_0x3c89('0x48')]=_0x567733[_0x3c89('0x48')][_0x3c89('0x4a')]?_0x567733[_0x3c89('0x48')]:_0x3f49e7[_0x3c89('0x45')];if(_0x1e3db6[_0x3c89('0x46')][_0x3c89('0xb8')]){_0x567733[_0x3c89('0xb9')]=[{'all':!![]}];}_0x567733=_[_0x3c89('0x9c')]({},_0x567733,_0x1e3db6[_0x3c89('0xba')]);return db['WhatsappInteraction'][_0x3c89('0x65')](_0x567733)['then'](handleEntityNotFound(_0x362b2f,null))[_0x3c89('0x2b')](respondWithResult(_0x362b2f,null))[_0x3c89('0x36')](handleError(_0x362b2f,null));};exports[_0x3c89('0xbb')]=function(_0x509d90,_0x485c52){return db[_0x3c89('0x40')][_0x3c89('0xbb')](_0x509d90[_0x3c89('0x77')],{})[_0x3c89('0x2b')](respondWithResult(_0x485c52,0xc9))['catch'](handleError(_0x485c52,null));};exports[_0x3c89('0xbc')]=function(_0x321bce,_0x53f6e7){if(_0x321bce[_0x3c89('0x77')]['id']){delete _0x321bce[_0x3c89('0x77')]['id'];}return db[_0x3c89('0x40')][_0x3c89('0x65')]({'where':{'id':_0x321bce[_0x3c89('0xb6')]['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x53f6e7,null))[_0x3c89('0x2b')](saveUpdates(_0x321bce[_0x3c89('0x77')],null))[_0x3c89('0x2b')](respondWithResult(_0x53f6e7,null))[_0x3c89('0x36')](handleError(_0x53f6e7,null));};exports[_0x3c89('0x2c')]=function(_0x45b212,_0x4a3853){return db[_0x3c89('0x40')][_0x3c89('0x65')]({'where':{'id':_0x45b212[_0x3c89('0xb6')]['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x4a3853,null))[_0x3c89('0x2b')](removeEntity(_0x4a3853,null))[_0x3c89('0x36')](handleError(_0x4a3853,null));};exports[_0x3c89('0xbd')]=function(_0x12ce0d,_0x131766){return db[_0x3c89('0x40')][_0x3c89('0xbd')]()[_0x3c89('0x2b')](respondWithResult(_0x131766,null))[_0x3c89('0x36')](handleError(_0x131766,null));};exports['addMessage']=function(_0x2254d9,_0x4c5f50,_0x1e759f){return db[_0x3c89('0xbe')][_0x3c89('0x65')]({'where':{'id':_0x2254d9[_0x3c89('0xb6')]['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x4c5f50,null))[_0x3c89('0x2b')](function(_0x4e17a8){if(_0x4e17a8){return _0x4e17a8[_0x3c89('0xbf')](_0x2254d9[_0x3c89('0x77')][_0x3c89('0xc0')],_[_0x3c89('0xc1')](_0x2254d9['body'],[_0x3c89('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x4c5f50,null))[_0x3c89('0x36')](handleError(_0x4c5f50,null));};exports[_0x3c89('0xc2')]=function(_0x63208d,_0x41ed7b,_0x25f794){var _0x4bf877={'raw':![],'where':{}};var _0x3dcc1a={};var _0x4f6220={'count':0x0,'rows':[]};return db[_0x3c89('0x40')][_0x3c89('0xc3')]({'where':{'id':_0x63208d[_0x3c89('0xb6')]['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x41ed7b,null))[_0x3c89('0x2b')](function(_0x5684e1){if(_0x5684e1){_0x3dcc1a['model']=_['keys'](db[_0x3c89('0xbe')][_0x3c89('0x41')]);_0x3dcc1a['query']=_[_0x3c89('0x78')](_0x63208d[_0x3c89('0x46')]);_0x3dcc1a['filters']=_['intersection'](_0x3dcc1a[_0x3c89('0x45')],_0x3dcc1a[_0x3c89('0x46')]);_0x4bf877[_0x3c89('0x48')]=_[_0x3c89('0xb7')](_0x3dcc1a[_0x3c89('0x45')],qs['fields'](_0x63208d[_0x3c89('0x46')]['fields']));_0x4bf877['attributes']=_0x4bf877[_0x3c89('0x48')][_0x3c89('0x4a')]?_0x4bf877['attributes']:_0x3dcc1a['model'];if(!_0x63208d[_0x3c89('0x46')][_0x3c89('0x4b')](_0x3c89('0xc4'))){_0x4bf877[_0x3c89('0x22')]=qs[_0x3c89('0x22')](_0x63208d[_0x3c89('0x46')][_0x3c89('0x22')]);_0x4bf877[_0x3c89('0x23')]=qs[_0x3c89('0x23')](_0x63208d['query'][_0x3c89('0x23')]);}_0x4bf877['order']=qs[_0x3c89('0x4d')](_0x63208d['query'][_0x3c89('0x4d')]);_0x4bf877[_0x3c89('0x4e')]=qs['filters'](_[_0x3c89('0xc5')](_0x63208d['query'],_0x3dcc1a[_0x3c89('0x47')]));_0x4bf877['where'][_0x3c89('0xc6')]=_0x5684e1['id'];if(_0x63208d[_0x3c89('0x46')][_0x3c89('0x89')]){_0x4bf877[_0x3c89('0x4e')]=_[_0x3c89('0x9c')](_0x4bf877[_0x3c89('0x4e')],{'$or':_[_0x3c89('0x3f')](_0x4bf877[_0x3c89('0x48')],function(_0x2ac381){var _0x36d56a={};_0x36d56a[_0x2ac381]={'$like':'%'+_0x63208d['query']['filter']+'%'};return _0x36d56a;})});}if(_0x63208d['query'][_0x3c89('0x80')]){var _0x3a1948=_0x63208d[_0x3c89('0x46')][_0x3c89('0x80')][_0x3c89('0xc7')](',');var _0x53dd7d={};_0x53dd7d[_0x3a1948[0x0]]={'$gte':moment(_0x3a1948[0x1])['format'](_0x3c89('0xc8'))};_0x4bf877[_0x3c89('0x4e')]=_[_0x3c89('0x9c')](_0x4bf877['where'],_0x53dd7d);}_0x4bf877=_['merge']({},_0x4bf877,_0x63208d[_0x3c89('0xba')]);return db[_0x3c89('0xbe')][_0x3c89('0x24')]({'where':_0x4bf877[_0x3c89('0x4e')]})[_0x3c89('0x2b')](function(_0x113a38){_0x4f6220[_0x3c89('0x24')]=_0x113a38;if(_0x63208d[_0x3c89('0x46')][_0x3c89('0xb8')]){_0x4bf877[_0x3c89('0xb9')]=[{'all':!![]}];}return db[_0x3c89('0xbe')][_0x3c89('0xc9')](_0x4bf877);})[_0x3c89('0x2b')](function(_0x45d345){_0x4f6220[_0x3c89('0xb4')]=_0x45d345;return _0x4f6220;});}})[_0x3c89('0x2b')](respondWithFilteredResult(_0x41ed7b,_0x4bf877))[_0x3c89('0x36')](handleError(_0x41ed7b,null));};exports[_0x3c89('0xca')]=function(_0xcf813f,_0x5cf1ff,_0x36e1c6){return db[_0x3c89('0x40')][_0x3c89('0x65')]({'where':{'id':_0xcf813f[_0x3c89('0xb6')]['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x5cf1ff,null))[_0x3c89('0x2b')](function(_0x27af08){if(_0x27af08){return _0x27af08['setTags'](_0xcf813f[_0x3c89('0x77')][_0x3c89('0xc0')],_[_0x3c89('0xc1')](_0xcf813f['body'],[_0x3c89('0xc0'),'id'])||{})[_0x3c89('0xcb')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3c89('0x2e'),_0x3c89('0x51')],'where':{'id':_0xcf813f['body']['ids']}});})[_0x3c89('0x2b')](function(_0x2b4adb){socket[_0x3c89('0xcc')]('whatsappInteractionTags:save',{'id':Number(_0xcf813f[_0x3c89('0xb6')]['id']),'tags':_0x2b4adb||[]});return{'id':Number(_0xcf813f['params']['id']),'tags':_0x2b4adb||[]};});}})[_0x3c89('0x2b')](respondWithResult(_0x5cf1ff,null))[_0x3c89('0x36')](handleError(_0x5cf1ff,null));};exports[_0x3c89('0xcd')]=function(_0x39b129,_0x21e705,_0x2c533b){return db[_0x3c89('0x40')]['find']({'where':{'id':_0x39b129['params']['id']}})[_0x3c89('0x2b')](handleEntityNotFound(_0x21e705,null))[_0x3c89('0x2b')](function(_0x30a320){if(_0x30a320){return _0x30a320[_0x3c89('0xcd')](_0x39b129[_0x3c89('0x46')][_0x3c89('0xc0')]);}})[_0x3c89('0x2b')](respondWithStatusCode(_0x21e705,null))[_0x3c89('0x36')](handleError(_0x21e705,null));};exports[_0x3c89('0xce')]=function(_0x56af32,_0x46b769){var _0x3a6769=moment()[_0x3c89('0xcf')]()[_0x3c89('0x9a')]();var _0x14286b=path[_0x3c89('0xd0')](config[_0x3c89('0xd1')],_0x3c89('0xd2'),_0x3c89('0xd3'),_0x3c89('0xd4'));var _0x461b64=path[_0x3c89('0xd0')](config['root'],_0x3c89('0xd2'),_0x3c89('0xd3'),_0x3c89('0xd5'));var _0x2c538d=path[_0x3c89('0xd0')](_0x14286b,_0x3a6769);var _0x42462f=util[_0x3c89('0xd6')](_0x3c89('0xd7'),_0x56af32['params']['id'],_0x3a6769);var _0x170519=path[_0x3c89('0xd0')](_0x14286b,_0x42462f);var _0x5e539b=[];_0x5e539b['push']({'model':db[_0x3c89('0x73')],'as':_0x3c89('0x73'),'attributes':['id',_0x3c89('0x31')],'raw':!![]});_0x5e539b[_0x3c89('0x35')]({'model':db[_0x3c89('0xd8')],'as':_0x3c89('0x6a'),'attributes':['id',_0x3c89('0xd9'),_0x3c89('0xda')],'raw':!![]});if(_0x56af32[_0x3c89('0x46')][_0x3c89('0xd5')]){_0x5e539b['push']({'model':db[_0x3c89('0xdb')],'as':_0x3c89('0xdb'),'raw':!![]});}var _0x28d355=[{'model':db[_0x3c89('0xbe')],'as':_0x3c89('0xdc'),'attributes':['id',_0x3c89('0x77'),_0x3c89('0x7e'),'direction',_0x3c89('0xdd'),'read'],'include':_0x5e539b}];_0x28d355['push']({'model':db['WhatsappAccount'],'as':_0x3c89('0xde'),'attributes':['id',_0x3c89('0x2e')]});_0x28d355[_0x3c89('0x35')]({'model':db['User'],'as':_0x3c89('0xdf'),'attributes':['id','fullname']});return db[_0x3c89('0x40')]['find']({'where':{'id':_0x56af32['params']['id']},'include':_0x28d355})[_0x3c89('0x2b')](handleEntityNotFound(_0x46b769,null))['then'](function(_0x101a0a){if(_0x101a0a){var _0x557204=_0x101a0a[_0x3c89('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x2c538d);var _0x224047={'channel':_0x3c89('0xe1'),'account':_0x557204[_0x3c89('0xde')][_0x3c89('0x2e')],'agent':_0x557204[_0x3c89('0xdf')]?_0x557204[_0x3c89('0xdf')][_0x3c89('0x31')]:_0x3c89('0xe2'),'createdAt':moment(_0x557204['createdAt'])[_0x3c89('0xd6')](_0x3c89('0xc8'))['toString'](),'closedAt':_0x557204[_0x3c89('0x3b')]?moment(_0x557204[_0x3c89('0xe3')])[_0x3c89('0xd6')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x557204['disposition'],'messages':_(_0x557204[_0x3c89('0xdc')])[_0x3c89('0x89')]({'secret':![]})[_0x3c89('0x3f')](function(_0x215bcb){if(_0x215bcb[_0x3c89('0xdb')]){var _0x291963=path[_0x3c89('0xd0')](_0x461b64,_0x215bcb['Attachment']['basename']);if(fs[_0x3c89('0xe4')](_0x291963)){fs[_0x3c89('0xe5')](_0x291963)[_0x3c89('0xe6')](fs[_0x3c89('0xe7')](path['join'](_0x2c538d,_0x215bcb[_0x3c89('0xdb')][_0x3c89('0xe8')])));}}return{'date':moment(_0x215bcb['createdAt'])[_0x3c89('0xd6')](_0x3c89('0xc8'))[_0x3c89('0x9a')](),'sender':_0x215bcb[_0x3c89('0xe9')]==='out'?_0x215bcb[_0x3c89('0x73')]?_0x215bcb[_0x3c89('0x73')]['fullname']:_0x3c89('0xea'):_0x215bcb[_0x3c89('0x6a')][_0x3c89('0xd9')]+(_0x215bcb['Contact'][_0x3c89('0xda')]?'\x20'+_0x215bcb[_0x3c89('0x6a')][_0x3c89('0xda')]:''),'body':_0x215bcb[_0x3c89('0xdb')]?_0x215bcb[_0x3c89('0xdb')][_0x3c89('0xe8')]:_0x215bcb[_0x3c89('0x77')],'direction':_0x215bcb[_0x3c89('0xe9')]==='out'?'A':'C','secret':_0x215bcb[_0x3c89('0xdd')],'read':_0x215bcb[_0x3c89('0x85')],'attachment':_0x215bcb[_0x3c89('0xdb')]};})[_0x3c89('0x66')]()};return ejs[_0x3c89('0xeb')](path[_0x3c89('0xd0')](config[_0x3c89('0xd1')],_0x3c89('0xd2'),_0x3c89('0xec'),'downloadInteraction.ejs'),{'interaction':_0x224047})[_0x3c89('0x2b')](function(_0x2a3d2d){var _0x4e3cb5=path[_0x3c89('0xd0')](_0x2c538d,_0x3c89('0xed')+_0x557204['id']+'-'+_0x3a6769+_0x3c89('0xee'));var _0x2ab7ce={'path':_0x4e3cb5,'channel':_0x3c89('0xe1'),'interactionId':_0x557204['id']};return pdf['createPdfFromHTML'](_0x2a3d2d,_0x2ab7ce);})[_0x3c89('0x2b')](function(){return new BPromise(function(_0x2e079,_0x88aafd){zipdir(_0x2c538d,{'saveTo':_0x170519},function(_0x393ae9,_0x1c90a6){if(_0x393ae9)return _0x88aafd(_0x393ae9);return _0x2e079(_0x1c90a6);});})['then'](function(){return new BPromise(function(_0x34414a,_0x57836b){rimraf(_0x2c538d,function(_0xf5d39){if(_0xf5d39)_0x57836b(_0xf5d39);return _0x34414a();});});})[_0x3c89('0x2b')](function(){return _0x46b769[_0x3c89('0xce')](_0x170519,_0x42462f,function(_0x4f03cc){if(_0x4f03cc){console['log']('err',_0x4f03cc);}else{fs[_0x3c89('0xef')](_0x170519);}});});});}else{return _0x46b769[_0x3c89('0x1e')](0xc8);}})['catch'](handleError(_0x46b769,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 0234c4d..954dd37 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8128=['WhatsappMessage','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xd8284f,_0x156cd4){var _0xc28444=function(_0x26a04c){while(--_0x26a04c){_0xd8284f['push'](_0xd8284f['shift']());}};_0xc28444(++_0x156cd4);}(_0x8128,0x1b1));var _0x8812=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8128[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x8812('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x8812('0x1'))['db'][_0x8812('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8812('0x3'),'afterDestroy':_0x8812('0x4')};function emitEvent(_0x21b1d5){return function(_0x4a8add,_0x33f9f6,_0x2f4af9){_0x4a8add[_0x8812('0x5')]({'attributes':['id'],'raw':!![]})[_0x8812('0x6')](function(_0x480d1f){_0x4a8add[_0x8812('0x7')](_0x8812('0x8'),_0x480d1f['map'](function(_0x51ad6b){return{'id':_0x51ad6b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4a8add['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8812('0x6')](function(_0x25545c){_0x4a8add[_0x8812('0x7')](_0x8812('0x9'),_0x25545c[_0x8812('0xa')]);WhatsappInteractionEvents[_0x8812('0xb')](_0x21b1d5+':'+_0x4a8add['id'],_0x4a8add);WhatsappInteractionEvents[_0x8812('0xb')](_0x21b1d5,_0x4a8add);_0x2f4af9(null);})[_0x8812('0xc')](_0x2f4af9(null));};}for(var e in events){if(events[_0x8812('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8812('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xcea2=['exports','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x3a74a6,_0x1db756){var _0x5e0dcb=function(_0x323735){while(--_0x323735){_0x3a74a6['push'](_0x3a74a6['shift']());}};_0x5e0dcb(++_0x1db756);}(_0xcea2,0x15a));var _0x2cea=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xcea2[_0x173441];return _0x2423a8;};'use strict';var EventEmitter=require(_0x2cea('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x2cea('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x2cea('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2cea('0x3')](0x0);var events={'afterCreate':_0x2cea('0x4'),'afterUpdate':'update','afterDestroy':_0x2cea('0x5')};function emitEvent(_0x46060b){return function(_0x11596e,_0x496c21,_0x34f0f2){_0x11596e['getUsers']({'attributes':['id'],'raw':!![]})[_0x2cea('0x6')](function(_0xc04963){_0x11596e[_0x2cea('0x7')](_0x2cea('0x8'),_0xc04963[_0x2cea('0x9')](function(_0x1519f6){return{'id':_0x1519f6['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x11596e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2cea('0x6')](function(_0x42191a){_0x11596e[_0x2cea('0x7')](_0x2cea('0xa'),_0x42191a[_0x2cea('0xb')]);WhatsappInteractionEvents[_0x2cea('0xc')](_0x46060b+':'+_0x11596e['id'],_0x11596e);WhatsappInteractionEvents[_0x2cea('0xc')](_0x46060b,_0x11596e);_0x34f0f2(null);})[_0x2cea('0xd')](_0x34f0f2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x2cea('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 835cf1f..190cf8b 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 _0xa1f5=['../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','bluebird','request-promise'];(function(_0x16c0bd,_0x9676d2){var _0x48fd60=function(_0x2e3eb3){while(--_0x2e3eb3){_0x16c0bd['push'](_0x16c0bd['shift']());}};_0x48fd60(++_0x9676d2);}(_0xa1f5,0xce));var _0x5a1f=function(_0x31c6de,_0x35339a){_0x31c6de=_0x31c6de-0x0;var _0x191581=_0xa1f5[_0x31c6de];return _0x191581;};'use strict';var _=require(_0x5a1f('0x0'));var util=require('util');var logger=require(_0x5a1f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5a1f('0x2'));var rp=require(_0x5a1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5a1f('0x4'));var attributes=require(_0x5a1f('0x5'));module[_0x5a1f('0x6')]=function(_0x52bf92,_0x15705b){return _0x52bf92[_0x5a1f('0x7')](_0x5a1f('0x8'),attributes,{'tableName':_0x5a1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x288056,_0x14f543,_0x3f0d9e){if(_0x288056[_0x5a1f('0xa')](_0x5a1f('0xb'))){_0x288056['closedAt']=moment()[_0x5a1f('0xc')](_0x5a1f('0xd'));}_0x3f0d9e(null,_0x288056);}}});}; \ No newline at end of file +var _0xebd5=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x17cc6d,_0x1ec9f9){var _0xb56ce5=function(_0x3af934){while(--_0x3af934){_0x17cc6d['push'](_0x17cc6d['shift']());}};_0xb56ce5(++_0x1ec9f9);}(_0xebd5,0xf4));var _0x5ebd=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xebd5[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x5ebd('0x0'));var util=require(_0x5ebd('0x1'));var logger=require('../../config/logger')(_0x5ebd('0x2'));var moment=require(_0x5ebd('0x3'));var BPromise=require(_0x5ebd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ebd('0x5'));var rimraf=require(_0x5ebd('0x6'));var config=require(_0x5ebd('0x7'));var attributes=require(_0x5ebd('0x8'));module[_0x5ebd('0x9')]=function(_0x30e3b5,_0x197d85){return _0x30e3b5[_0x5ebd('0xa')](_0x5ebd('0xb'),attributes,{'tableName':_0x5ebd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15d0f4,_0x25cea8,_0x47c2d1){if(_0x15d0f4[_0x5ebd('0xd')](_0x5ebd('0xe'))){_0x15d0f4[_0x5ebd('0xf')]=moment()[_0x5ebd('0x10')](_0x5ebd('0x11'));}_0x47c2d1(null,_0x15d0f4);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 5aff525..4856179 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 _0xd4da=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info'];(function(_0x235827,_0x14b617){var _0x53374f=function(_0x14b831){while(--_0x14b831){_0x235827['push'](_0x235827['shift']());}};_0x53374f(++_0x14b617);}(_0xd4da,0x6f));var _0xad4d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd4da[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xad4d('0x0'));var util=require(_0xad4d('0x1'));var moment=require(_0xad4d('0x2'));var BPromise=require(_0xad4d('0x3'));var rs=require(_0xad4d('0x4'));var fs=require('fs');var Redis=require(_0xad4d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xad4d('0x6'));var logger=require(_0xad4d('0x7'))('rpc');var config=require(_0xad4d('0x8'));var jayson=require(_0xad4d('0x9'));var client=jayson[_0xad4d('0xa')][_0xad4d('0xb')]({'port':0x232a});config[_0xad4d('0xc')]=_[_0xad4d('0xd')](config[_0xad4d('0xc')],{'host':_0xad4d('0xe'),'port':0x18eb});var socket=require(_0xad4d('0xf'))(new Redis(config[_0xad4d('0xc')]));require(_0xad4d('0x10'))[_0xad4d('0x11')](socket);function respondWithRpcPromise(_0x450c9e,_0x462548,_0x56b4c0){return new BPromise(function(_0xe072a5,_0x4e2382){return client[_0xad4d('0x12')](_0x450c9e,_0x56b4c0)[_0xad4d('0x13')](function(_0x44ad32){logger[_0xad4d('0x14')](_0xad4d('0x15'),_0x462548,_0xad4d('0x16'));logger[_0xad4d('0x17')](_0xad4d('0x18'),_0x462548,_0xad4d('0x16'),JSON[_0xad4d('0x19')](_0x44ad32));if(_0x44ad32['error']){if(_0x44ad32[_0xad4d('0x1a')][_0xad4d('0x1b')]===0x1f4){logger[_0xad4d('0x1a')](_0xad4d('0x15'),_0x462548,_0x44ad32['error'][_0xad4d('0x1c')]);return _0x4e2382(_0x44ad32[_0xad4d('0x1a')][_0xad4d('0x1c')]);}logger[_0xad4d('0x1a')](_0xad4d('0x15'),_0x462548,_0x44ad32[_0xad4d('0x1a')][_0xad4d('0x1c')]);return _0xe072a5(_0x44ad32[_0xad4d('0x1a')][_0xad4d('0x1c')]);}else{logger[_0xad4d('0x14')](_0xad4d('0x15'),_0x462548,_0xad4d('0x16'));_0xe072a5(_0x44ad32[_0xad4d('0x1d')][_0xad4d('0x1c')]);}})[_0xad4d('0x1e')](function(_0x32dfa1){logger['error'](_0xad4d('0x15'),_0x462548,_0x32dfa1);_0x4e2382(_0x32dfa1);});});}exports['UpdateWhatsappInteraction']=function(_0x80a80c){var _0x3d7b35=this;return new Promise(function(_0x30eced,_0x6a1a94){return db['WhatsappInteraction']['update'](_0x80a80c[_0xad4d('0x1f')],{'raw':_0x80a80c['options']?_0x80a80c[_0xad4d('0x20')][_0xad4d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80a80c[_0xad4d('0x20')]?_0x80a80c['options'][_0xad4d('0x22')]||null:null,'attributes':_0x80a80c[_0xad4d('0x20')]?_0x80a80c[_0xad4d('0x20')][_0xad4d('0x23')]||null:null,'limit':_0x80a80c[_0xad4d('0x20')]?_0x80a80c['options'][_0xad4d('0x24')]||null:null})['then'](function(_0x1fa19b){logger[_0xad4d('0x14')](_0xad4d('0x25'),_0x80a80c);logger[_0xad4d('0x17')](_0xad4d('0x25'),_0x80a80c,JSON[_0xad4d('0x19')](_0x1fa19b));_0x30eced(_0x1fa19b);})[_0xad4d('0x1e')](function(_0x5d1685){logger[_0xad4d('0x1a')](_0xad4d('0x25'),_0x5d1685[_0xad4d('0x1c')],_0x80a80c);_0x6a1a94(_0x3d7b35[_0xad4d('0x1a')](0x1f4,_0x5d1685[_0xad4d('0x1c')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0xb6f8be){return new Promise(function(_0x491d43,_0x335925){return db['WhatsappInteraction'][_0xad4d('0x26')]({'where':_0xb6f8be[_0xad4d('0x20')]?_0xb6f8be[_0xad4d('0x20')][_0xad4d('0x22')]||null:null})[_0xad4d('0x13')](function(_0x101373){if(_0x101373){return _0x101373[_0xad4d('0x27')](_0xb6f8be[_0xad4d('0x1f')][_0xad4d('0x28')],_[_0xad4d('0x29')](_0xb6f8be[_0xad4d('0x1f')],['ids','id'])||{});}})[_0xad4d('0x2a')](function(_0x4c4ab8){logger[_0xad4d('0x14')](_0xad4d('0x2b'),_0xb6f8be);logger[_0xad4d('0x17')](_0xad4d('0x2b'),_0xb6f8be,JSON[_0xad4d('0x19')](_0x4c4ab8));_0x491d43(_0x4c4ab8);})[_0xad4d('0x1e')](function(_0x369d3e){logger[_0xad4d('0x1a')](_0xad4d('0x2b'),_0x369d3e[_0xad4d('0x1c')],_0xb6f8be);_0x335925(_this[_0xad4d('0x1a')](0x1f4,_0x369d3e[_0xad4d('0x1c')]));});});}; \ No newline at end of file +var _0x8f08=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','find','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','then'];(function(_0x3d0e7b,_0x356cdc){var _0xf279ae=function(_0x3bbbe3){while(--_0x3bbbe3){_0x3d0e7b['push'](_0x3d0e7b['shift']());}};_0xf279ae(++_0x356cdc);}(_0x8f08,0xe5));var _0x88f0=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x8f08[_0x54c9dd];return _0x855156;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x88f0('0x0'));var BPromise=require(_0x88f0('0x1'));var rs=require(_0x88f0('0x2'));var fs=require('fs');var Redis=require(_0x88f0('0x3'));var db=require(_0x88f0('0x4'))['db'];var utils=require(_0x88f0('0x5'));var logger=require('../../config/logger')(_0x88f0('0x6'));var config=require(_0x88f0('0x7'));var jayson=require(_0x88f0('0x8'));var client=jayson[_0x88f0('0x9')][_0x88f0('0xa')]({'port':0x232a});config[_0x88f0('0xb')]=_[_0x88f0('0xc')](config[_0x88f0('0xb')],{'host':_0x88f0('0xd'),'port':0x18eb});var socket=require(_0x88f0('0xe'))(new Redis(config[_0x88f0('0xb')]));require(_0x88f0('0xf'))['register'](socket);function respondWithRpcPromise(_0x228d36,_0x3a0850,_0x44800f){return new BPromise(function(_0x54960d,_0x20a1bb){return client['request'](_0x228d36,_0x44800f)[_0x88f0('0x10')](function(_0x20f514){logger['info'](_0x88f0('0x11'),_0x3a0850,_0x88f0('0x12'));logger[_0x88f0('0x13')](_0x88f0('0x14'),_0x3a0850,'request\x20sent',JSON[_0x88f0('0x15')](_0x20f514));if(_0x20f514[_0x88f0('0x16')]){if(_0x20f514[_0x88f0('0x16')][_0x88f0('0x17')]===0x1f4){logger['error'](_0x88f0('0x11'),_0x3a0850,_0x20f514[_0x88f0('0x16')]['message']);return _0x20a1bb(_0x20f514[_0x88f0('0x16')][_0x88f0('0x18')]);}logger[_0x88f0('0x16')](_0x88f0('0x11'),_0x3a0850,_0x20f514[_0x88f0('0x16')][_0x88f0('0x18')]);return _0x54960d(_0x20f514[_0x88f0('0x16')][_0x88f0('0x18')]);}else{logger[_0x88f0('0x19')](_0x88f0('0x11'),_0x3a0850,'request\x20sent');_0x54960d(_0x20f514[_0x88f0('0x1a')]['message']);}})[_0x88f0('0x1b')](function(_0x379015){logger[_0x88f0('0x16')](_0x88f0('0x11'),_0x3a0850,_0x379015);_0x20a1bb(_0x379015);});});}exports[_0x88f0('0x1c')]=function(_0x3e5814){var _0xac7456=this;return new Promise(function(_0x525178,_0x46847a){return db[_0x88f0('0x1d')][_0x88f0('0x1e')](_0x3e5814['body'],{'raw':_0x3e5814[_0x88f0('0x1f')]?_0x3e5814[_0x88f0('0x1f')][_0x88f0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5814[_0x88f0('0x1f')]?_0x3e5814[_0x88f0('0x1f')][_0x88f0('0x21')]||null:null,'attributes':_0x3e5814[_0x88f0('0x1f')]?_0x3e5814[_0x88f0('0x1f')][_0x88f0('0x22')]||null:null,'limit':_0x3e5814[_0x88f0('0x1f')]?_0x3e5814[_0x88f0('0x1f')][_0x88f0('0x23')]||null:null})[_0x88f0('0x10')](function(_0x47650d){logger[_0x88f0('0x19')]('UpdateWhatsappInteraction',_0x3e5814);logger[_0x88f0('0x13')]('UpdateWhatsappInteraction',_0x3e5814,JSON[_0x88f0('0x15')](_0x47650d));_0x525178(_0x47650d);})[_0x88f0('0x1b')](function(_0x2df745){logger['error'](_0x88f0('0x1c'),_0x2df745[_0x88f0('0x18')],_0x3e5814);_0x46847a(_0xac7456[_0x88f0('0x16')](0x1f4,_0x2df745[_0x88f0('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x236ead){return new Promise(function(_0x16d61b,_0x593c34){return db[_0x88f0('0x1d')][_0x88f0('0x24')]({'where':_0x236ead[_0x88f0('0x1f')]?_0x236ead['options'][_0x88f0('0x21')]||null:null})['then'](function(_0x513d94){if(_0x513d94){return _0x513d94['addTags'](_0x236ead['body'][_0x88f0('0x25')],_[_0x88f0('0x26')](_0x236ead['body'],['ids','id'])||{});}})[_0x88f0('0x27')](function(_0x29c271){logger['info'](_0x88f0('0x28'),_0x236ead);logger[_0x88f0('0x13')](_0x88f0('0x28'),_0x236ead,JSON[_0x88f0('0x15')](_0x29c271));_0x16d61b(_0x29c271);})['catch'](function(_0x1473bf){logger[_0x88f0('0x16')](_0x88f0('0x28'),_0x1473bf['message'],_0x236ead);_0x593c34(_this['error'](0x1f4,_0x1473bf[_0x88f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index a3e8a80..fb942e8 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 _0x532b=['remove','update','emit','register','length'];(function(_0x211881,_0x51ae8d){var _0x10fc5f=function(_0x50e1ce){while(--_0x50e1ce){_0x211881['push'](_0x211881['shift']());}};_0x10fc5f(++_0x51ae8d);}(_0x532b,0xff));var _0xb532=function(_0x2b216a,_0x5ebea4){_0x2b216a=_0x2b216a-0x0;var _0x39ab62=_0x532b[_0x2b216a];return _0x39ab62;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0xb532('0x0'),_0xb532('0x1')];function createListener(_0x5b1cf1,_0x59b3b0){return function(_0x3757cc){_0x59b3b0[_0xb532('0x2')](_0x5b1cf1,_0x3757cc);};}function removeListener(_0x210eea,_0x6deb15){return function(){WhatsappInteractionEvents['removeListener'](_0x210eea,_0x6deb15);};}exports[_0xb532('0x3')]=function(_0x53d25a){for(var _0x4e3466=0x0,_0x1bc976=events[_0xb532('0x4')];_0x4e3466<_0x1bc976;_0x4e3466++){var _0x4f9e99=events[_0x4e3466];var _0x1e1815=createListener('whatsappInteraction:'+_0x4f9e99,_0x53d25a);WhatsappInteractionEvents['on'](_0x4f9e99,_0x1e1815);}}; \ No newline at end of file +var _0x6f35=['save','remove','emit','register','./whatsappInteraction.events'];(function(_0x224275,_0x32c517){var _0x461d50=function(_0x32eb22){while(--_0x32eb22){_0x224275['push'](_0x224275['shift']());}};_0x461d50(++_0x32c517);}(_0x6f35,0x176));var _0x56f3=function(_0x13ebe4,_0x32f5ee){_0x13ebe4=_0x13ebe4-0x0;var _0x2c41a8=_0x6f35[_0x13ebe4];return _0x2c41a8;};'use strict';var WhatsappInteractionEvents=require(_0x56f3('0x0'));var events=[_0x56f3('0x1'),_0x56f3('0x2'),'update'];function createListener(_0x33c348,_0x411132){return function(_0x3d4d13){_0x411132[_0x56f3('0x3')](_0x33c348,_0x3d4d13);};}function removeListener(_0x1f7919,_0x1970de){return function(){WhatsappInteractionEvents['removeListener'](_0x1f7919,_0x1970de);};}exports[_0x56f3('0x4')]=function(_0x55694e){for(var _0x31733c=0x0,_0x12ffdb=events['length'];_0x31733c<_0x12ffdb;_0x31733c++){var _0x5f9ce6=events[_0x31733c];var _0x338569=createListener('whatsappInteraction:'+_0x5f9ce6,_0x55694e);WhatsappInteractionEvents['on'](_0x5f9ce6,_0x338569);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 106c2f0..6559bd0 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 _0xa632=['accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xa632,0x1b8));var _0x2a63=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xa632[_0x28d18d];return _0x470640;};'use strict';var multer=require(_0x2a63('0x0'));var util=require(_0x2a63('0x1'));var path=require(_0x2a63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a63('0x3')]();var fs_extra=require(_0x2a63('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2a63('0x5'));var config=require(_0x2a63('0x6'));var controller=require(_0x2a63('0x7'));router[_0x2a63('0x8')]('/',auth[_0x2a63('0x9')](),controller[_0x2a63('0xa')]);router[_0x2a63('0x8')](_0x2a63('0xb'),auth[_0x2a63('0x9')](),controller[_0x2a63('0xc')]);router[_0x2a63('0x8')](_0x2a63('0xd'),auth[_0x2a63('0x9')](),controller[_0x2a63('0xe')]);router[_0x2a63('0xf')]('/',auth[_0x2a63('0x9')](),interaction[_0x2a63('0x10')](_0x2a63('0x11'),_0x2a63('0x12')),controller[_0x2a63('0x13')]);router[_0x2a63('0xf')]('/:id/status',controller[_0x2a63('0x14')]);router[_0x2a63('0x15')](_0x2a63('0xd'),auth['isAuthenticated'](),controller[_0x2a63('0x16')]);router[_0x2a63('0x15')](_0x2a63('0x17'),auth[_0x2a63('0x9')](),controller[_0x2a63('0x18')]);router[_0x2a63('0x15')](_0x2a63('0x19'),auth['isAuthenticated'](),controller[_0x2a63('0x1a')]);router[_0x2a63('0x1b')](_0x2a63('0xd'),auth['isAuthenticated'](),controller[_0x2a63('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x01b0=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','destroy','exports'];(function(_0x556f0e,_0x29dfaf){var _0x24d613=function(_0x216565){while(--_0x216565){_0x556f0e['push'](_0x556f0e['shift']());}};_0x24d613(++_0x29dfaf);}(_0x01b0,0x1e6));var _0x001b=function(_0x315a89,_0x360084){_0x315a89=_0x315a89-0x0;var _0x222ba3=_0x01b0[_0x315a89];return _0x222ba3;};'use strict';var multer=require(_0x001b('0x0'));var util=require('util');var path=require(_0x001b('0x1'));var timeout=require('connect-timeout');var express=require(_0x001b('0x2'));var router=express[_0x001b('0x3')]();var fs_extra=require(_0x001b('0x4'));var auth=require(_0x001b('0x5'));var interaction=require(_0x001b('0x6'));var config=require(_0x001b('0x7'));var controller=require(_0x001b('0x8'));router[_0x001b('0x9')]('/',auth[_0x001b('0xa')](),controller[_0x001b('0xb')]);router[_0x001b('0x9')](_0x001b('0xc'),auth[_0x001b('0xa')](),controller[_0x001b('0xd')]);router[_0x001b('0x9')](_0x001b('0xe'),auth[_0x001b('0xa')](),controller[_0x001b('0xf')]);router[_0x001b('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x001b('0x11'),_0x001b('0x12')),controller['create']);router[_0x001b('0x10')](_0x001b('0x13'),controller[_0x001b('0x14')]);router[_0x001b('0x15')](_0x001b('0xe'),auth[_0x001b('0xa')](),controller['update']);router['put'](_0x001b('0x16'),auth[_0x001b('0xa')](),controller[_0x001b('0x17')]);router[_0x001b('0x15')](_0x001b('0x18'),auth[_0x001b('0xa')](),controller['reject']);router['delete'](_0x001b('0xe'),auth[_0x001b('0xa')](),controller[_0x001b('0x19')]);module[_0x001b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 67105aa..e0c9fdd 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 _0x0cfe=['STRING','DATE','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x3744b6,_0x1a5a93){var _0xa55e75=function(_0x3c9256){while(--_0x3c9256){_0x3744b6['push'](_0x3744b6['shift']());}};_0xa55e75(++_0x1a5a93);}(_0x0cfe,0x9c));var _0xe0cf=function(_0x533f34,_0x56411d){_0x533f34=_0x533f34-0x0;var _0x4a0f5f=_0x0cfe[_0x533f34];return _0x4a0f5f;};'use strict';var Sequelize=require(_0xe0cf('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0cf('0x1')](_0xe0cf('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe0cf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe0cf('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe0cf('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe0cf('0x5')]},'readAt':{'type':Sequelize[_0xe0cf('0x6')]},'secret':{'type':Sequelize[_0xe0cf('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe0cf('0x1')]}}; \ No newline at end of file +var _0x50ff=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50ff,0x1c7));var _0xf50f=function(_0x5256b7,_0x21e9f3){_0x5256b7=_0x5256b7-0x0;var _0xccc2dd=_0x50ff[_0x5256b7];return _0xccc2dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xf50f('0x0')](_0xf50f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xf50f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf50f('0x3')]('in','out'),'defaultValue':_0xf50f('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf50f('0x5')](0xbe)},'phone':{'type':Sequelize[_0xf50f('0x5')]},'readAt':{'type':Sequelize[_0xf50f('0x6')]},'secret':{'type':Sequelize[_0xf50f('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf50f('0x5')]},'providerResponse':{'type':Sequelize[_0xf50f('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e20c14b..1918d14 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 _0x3440=['request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','read1stAt','format','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','contact','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','twilio','inspect','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x2f5fea,_0x3ba2c0){var _0x36fe14=function(_0x3bbfc0){while(--_0x3bbfc0){_0x2f5fea['push'](_0x2f5fea['shift']());}};_0x36fe14(++_0x3ba2c0);}(_0x3440,0xff));var _0x0344=function(_0x28057a,_0x447ca2){_0x28057a=_0x28057a-0x0;var _0x1970d3=_0x3440[_0x28057a];return _0x1970d3;};'use strict';var emlformat=require(_0x0344('0x0'));var rimraf=require(_0x0344('0x1'));var zipdir=require(_0x0344('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0344('0x3'));var moment=require(_0x0344('0x4'));var BPromise=require(_0x0344('0x5'));var Mustache=require('mustache');var util=require(_0x0344('0x6'));var path=require(_0x0344('0x7'));var sox=require(_0x0344('0x8'));var csv=require(_0x0344('0x9'));var ejs=require(_0x0344('0xa'));var fs=require('fs');var fs_extra=require(_0x0344('0xb'));var _=require(_0x0344('0xc'));var squel=require(_0x0344('0xd'));var crypto=require(_0x0344('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0344('0xf'));var toCsv=require(_0x0344('0x9'));var querystring=require('querystring');var Papa=require(_0x0344('0x10'));var Redis=require(_0x0344('0x11'));var authService=require(_0x0344('0x12'));var qs=require(_0x0344('0x13'));var as=require(_0x0344('0x14'));var hardwareService=require(_0x0344('0x15'));var logger=require(_0x0344('0x16'))('api');var utils=require(_0x0344('0x17'));var config=require(_0x0344('0x18'));var licenseUtil=require(_0x0344('0x19'));var db=require(_0x0344('0x1a'))['db'];config[_0x0344('0x1b')]=_[_0x0344('0x1c')](config[_0x0344('0x1b')],{'host':_0x0344('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0344('0x1e'))[_0x0344('0x1f')](socket);var jayson=require(_0x0344('0x20'));var client=jayson[_0x0344('0x21')][_0x0344('0x22')]({'port':0x232c});var client9002=jayson[_0x0344('0x21')][_0x0344('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x54d170,_0x4bcd93,_0x1a8614,_0x148e41){return new BPromise(function(_0x20e577,_0x3abc0d){var _0x2a3ae3=_0x148e41||client;return _0x2a3ae3[_0x0344('0x23')](_0x54d170,_0x1a8614)[_0x0344('0x24')](function(_0x3dc487){logger[_0x0344('0x25')](_0x0344('0x26'),_0x4bcd93,_0x0344('0x27'));logger['debug'](_0x0344('0x28'),_0x4bcd93,_0x0344('0x27'),JSON[_0x0344('0x29')](_0x3dc487));if(_0x3dc487['error']){if(_0x3dc487['error'][_0x0344('0x2a')]===0x1f4){logger[_0x0344('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x4bcd93,_0x3dc487[_0x0344('0x2b')][_0x0344('0x2c')]);return _0x3abc0d(_0x3dc487[_0x0344('0x2b')]['message']);}logger[_0x0344('0x2b')](_0x0344('0x26'),_0x4bcd93,_0x3dc487['error'][_0x0344('0x2c')]);return _0x20e577(_0x3dc487[_0x0344('0x2b')]['message']);}else{logger['info'](_0x0344('0x26'),_0x4bcd93,_0x0344('0x27'));_0x20e577(_0x3dc487[_0x0344('0x2d')]['message']);}})[_0x0344('0x2e')](function(_0x514e20){logger[_0x0344('0x2b')](_0x0344('0x26'),_0x4bcd93,_0x514e20);_0x3abc0d(_0x514e20);});});}function respondWithStatusCode(_0x2aa97d,_0x2b2ccc){_0x2b2ccc=_0x2b2ccc||0xcc;return function(_0x28dd01){if(_0x28dd01){return _0x2aa97d[_0x0344('0x2f')](_0x2b2ccc);}return _0x2aa97d[_0x0344('0x30')](_0x2b2ccc)['end']();};}function respondWithResult(_0x57f9bd,_0x2fb3d7){_0x2fb3d7=_0x2fb3d7||0xc8;return function(_0xd02148){if(_0xd02148){return _0x57f9bd[_0x0344('0x30')](_0x2fb3d7)[_0x0344('0x31')](_0xd02148);}};}function respondWithFilteredResult(_0x1ec837,_0x426527){return function(_0x4b5405){if(_0x4b5405){var _0x1135ac=typeof _0x426527[_0x0344('0x32')]===_0x0344('0x33')&&typeof _0x426527[_0x0344('0x34')]==='undefined';var _0x1c595b=_0x4b5405[_0x0344('0x35')];var _0x5197c5=_0x1135ac?0x0:_0x426527['offset'];var _0x421c91=_0x1135ac?_0x4b5405[_0x0344('0x35')]:_0x426527[_0x0344('0x32')]+_0x426527['limit'];var _0x464fea;if(_0x421c91>=_0x1c595b){_0x421c91=_0x1c595b;_0x464fea=0xc8;}else{_0x464fea=0xce;}_0x1ec837[_0x0344('0x30')](_0x464fea);return _0x1ec837[_0x0344('0x36')](_0x0344('0x37'),_0x5197c5+'-'+_0x421c91+'/'+_0x1c595b)[_0x0344('0x31')](_0x4b5405);}return null;};}function patchUpdates(_0x4b8f85){return function(_0x52f630){try{jsonpatch[_0x0344('0x38')](_0x52f630,_0x4b8f85,!![]);}catch(_0x5b1b46){return BPromise[_0x0344('0x39')](_0x5b1b46);}return _0x52f630['save']();};}function saveUpdates(_0x106c92,_0x56a20d){return function(_0x5e2321){if(_0x5e2321){return _0x5e2321[_0x0344('0x3a')](_0x106c92)['then'](function(_0xb93909){return _0xb93909;});}return null;};}function removeEntity(_0x2c7152,_0x5f43d6){return function(_0x4b7d08){if(_0x4b7d08){return _0x4b7d08[_0x0344('0x3b')]()[_0x0344('0x24')](function(){_0x2c7152[_0x0344('0x30')](0xcc)[_0x0344('0x3c')]();});}};}function handleEntityNotFound(_0x29f955,_0xb72f29){return function(_0x5e5f08){if(!_0x5e5f08){_0x29f955[_0x0344('0x2f')](0x194);}return _0x5e5f08;};}function handleError(_0x387675,_0x15bfbc){_0x15bfbc=_0x15bfbc||0x1f4;return function(_0x3ff3d7){logger[_0x0344('0x2b')](_0x3ff3d7[_0x0344('0x3d')]);if(_0x3ff3d7[_0x0344('0x3e')]){delete _0x3ff3d7[_0x0344('0x3e')];}_0x387675[_0x0344('0x30')](_0x15bfbc)[_0x0344('0x3f')](_0x3ff3d7);};}exports[_0x0344('0x40')]=function(_0x229777,_0x4ec0e9){var _0x137d78={},_0x2acf94={},_0x5ed656={'count':0x0,'rows':[]};var _0xe82861=_[_0x0344('0x41')](db[_0x0344('0x42')][_0x0344('0x43')],function(_0x48dbf7){return{'name':_0x48dbf7[_0x0344('0x44')],'type':_0x48dbf7['type'][_0x0344('0x45')]};});_0x2acf94[_0x0344('0x46')]=_[_0x0344('0x41')](_0xe82861,_0x0344('0x3e'));_0x2acf94[_0x0344('0x47')]=_[_0x0344('0x48')](_0x229777['query']);_0x2acf94[_0x0344('0x49')]=_[_0x0344('0x4a')](_0x2acf94['model'],_0x2acf94[_0x0344('0x47')]);_0x137d78[_0x0344('0x4b')]=_[_0x0344('0x4a')](_0x2acf94[_0x0344('0x46')],qs['fields'](_0x229777[_0x0344('0x47')]['fields']));_0x137d78[_0x0344('0x4b')]=_0x137d78[_0x0344('0x4b')][_0x0344('0x4c')]?_0x137d78[_0x0344('0x4b')]:_0x2acf94[_0x0344('0x46')];if(!_0x229777[_0x0344('0x47')]['hasOwnProperty'](_0x0344('0x4d'))){_0x137d78['limit']=qs['limit'](_0x229777[_0x0344('0x47')][_0x0344('0x34')]);_0x137d78['offset']=qs['offset'](_0x229777[_0x0344('0x47')][_0x0344('0x32')]);}_0x137d78[_0x0344('0x4e')]=qs[_0x0344('0x4f')](_0x229777[_0x0344('0x47')][_0x0344('0x4f')]);_0x137d78[_0x0344('0x50')]=qs[_0x0344('0x49')](_[_0x0344('0x51')](_0x229777[_0x0344('0x47')],_0x2acf94[_0x0344('0x49')]),_0xe82861);if(_0x229777['query'][_0x0344('0x52')]){_0x137d78['where']=_[_0x0344('0x53')](_0x137d78[_0x0344('0x50')],{'$or':_['map'](_0xe82861,function(_0x41f27a){if(_0x41f27a[_0x0344('0x54')]!==_0x0344('0x55')){var _0x58655d={};_0x58655d[_0x41f27a[_0x0344('0x3e')]]={'$like':'%'+_0x229777[_0x0344('0x47')][_0x0344('0x52')]+'%'};return _0x58655d;}})});}_0x137d78=_[_0x0344('0x53')]({},_0x137d78,_0x229777[_0x0344('0x56')]);var _0x2bc987={'where':_0x137d78['where']};return db[_0x0344('0x42')][_0x0344('0x35')](_0x2bc987)[_0x0344('0x24')](function(_0x555e73){_0x5ed656[_0x0344('0x35')]=_0x555e73;if(_0x229777[_0x0344('0x47')][_0x0344('0x57')]){_0x137d78[_0x0344('0x58')]=[{'all':!![]}];}return db[_0x0344('0x42')][_0x0344('0x59')](_0x137d78);})[_0x0344('0x24')](function(_0x43b480){_0x5ed656[_0x0344('0x5a')]=_0x43b480;return _0x5ed656;})[_0x0344('0x24')](respondWithFilteredResult(_0x4ec0e9,_0x137d78))[_0x0344('0x2e')](handleError(_0x4ec0e9,null));};exports[_0x0344('0x5b')]=function(_0x2fad35,_0x2fd06e){var _0x8933e8={'raw':!![],'where':{'id':_0x2fad35[_0x0344('0x5c')]['id']}},_0xe7ba0b={};_0xe7ba0b['model']=_['keys'](db['WhatsappMessage'][_0x0344('0x43')]);_0xe7ba0b[_0x0344('0x47')]=_['keys'](_0x2fad35[_0x0344('0x47')]);_0xe7ba0b[_0x0344('0x49')]=_[_0x0344('0x4a')](_0xe7ba0b[_0x0344('0x46')],_0xe7ba0b[_0x0344('0x47')]);_0x8933e8[_0x0344('0x4b')]=_['intersection'](_0xe7ba0b['model'],qs[_0x0344('0x5d')](_0x2fad35[_0x0344('0x47')][_0x0344('0x5d')]));_0x8933e8[_0x0344('0x4b')]=_0x8933e8[_0x0344('0x4b')]['length']?_0x8933e8[_0x0344('0x4b')]:_0xe7ba0b[_0x0344('0x46')];if(_0x2fad35['query'][_0x0344('0x57')]){_0x8933e8[_0x0344('0x58')]=[{'all':!![]}];}_0x8933e8=_[_0x0344('0x53')]({},_0x8933e8,_0x2fad35[_0x0344('0x56')]);return db[_0x0344('0x42')][_0x0344('0x5e')](_0x8933e8)[_0x0344('0x24')](handleEntityNotFound(_0x2fd06e,null))[_0x0344('0x24')](respondWithResult(_0x2fd06e,null))[_0x0344('0x2e')](handleError(_0x2fd06e,null));};exports[_0x0344('0x5f')]=function(_0x3ca1e0,_0x4fb563){return db[_0x0344('0x42')]['create'](_0x3ca1e0['body'],{})[_0x0344('0x24')](respondWithResult(_0x4fb563,0xc9))['catch'](handleError(_0x4fb563,null));};exports['update']=function(_0x23042f,_0x17e282){if(_0x23042f[_0x0344('0x60')]['id']){delete _0x23042f[_0x0344('0x60')]['id'];}return db['WhatsappMessage'][_0x0344('0x5e')]({'where':{'id':_0x23042f[_0x0344('0x5c')]['id']}})[_0x0344('0x24')](handleEntityNotFound(_0x17e282,null))['then'](saveUpdates(_0x23042f['body'],null))['then'](respondWithResult(_0x17e282,null))[_0x0344('0x2e')](handleError(_0x17e282,null));};exports[_0x0344('0x3b')]=function(_0x51c2f2,_0x22dc1d){return db[_0x0344('0x42')]['find']({'where':{'id':_0x51c2f2[_0x0344('0x5c')]['id']}})[_0x0344('0x24')](handleEntityNotFound(_0x22dc1d,null))[_0x0344('0x24')](removeEntity(_0x22dc1d,null))[_0x0344('0x2e')](handleError(_0x22dc1d,null));};exports[_0x0344('0x61')]=function(_0x4ba57d,_0x1dcecd){return db['WhatsappMessage'][_0x0344('0x61')]()[_0x0344('0x24')](respondWithResult(_0x1dcecd,null))['catch'](handleError(_0x1dcecd,null));};var interaction_log=require(_0x0344('0x16'))(_0x0344('0x62'));exports[_0x0344('0x63')]=function(_0x417d86,_0x4597e3,_0x24faa1){var _0x213718={'agent':{},'channel':_0x0344('0x64')};if(_0x417d86[_0x0344('0x60')]['id']){delete _0x417d86[_0x0344('0x60')]['id'];}_0x417d86[_0x0344('0x60')][_0x0344('0x65')]=!![];_0x417d86[_0x0344('0x60')][_0x0344('0x66')]=moment()['format'](_0x0344('0x67'));_0x417d86[_0x0344('0x60')][_0x0344('0x68')]=_0x417d86[_0x0344('0x60')][_0x0344('0x68')]||_0x417d86['user']['id'];_0x213718[_0x0344('0x69')]['id']=_0x417d86[_0x0344('0x60')][_0x0344('0x68')];return db[_0x0344('0x42')][_0x0344('0x5e')]({'where':{'id':_0x417d86[_0x0344('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4597e3,null))[_0x0344('0x24')](saveUpdates(_0x417d86[_0x0344('0x60')],null))[_0x0344('0x24')](function(_0x11c935){if(_0x11c935){_0x213718['message']=_0x11c935[_0x0344('0x6a')]({'plain':!![]});return db[_0x0344('0x6b')]['find']({'where':{'id':_0x11c935['WhatsappInteractionId']}});}return null;})[_0x0344('0x24')](handleEntityNotFound(_0x4597e3,null))[_0x0344('0x24')](function(_0x2790cc){if(_0x2790cc){return _0x2790cc[_0x0344('0x3a')]({'UserId':_0x417d86[_0x0344('0x60')][_0x0344('0x68')],'read1stAt':_['isNil'](_0x2790cc[_0x0344('0x6c')])?moment()[_0x0344('0x6d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x30ac8b){if(_0x30ac8b){_0x213718[_0x0344('0x6e')]=_0x30ac8b['get']({'plain':!![]});interaction_log[_0x0344('0x25')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x417d86[_0x0344('0x6f')]['id'],_0x417d86[_0x0344('0x6f')][_0x0344('0x3e')],_0x417d86['user']['role'],_0x213718[_0x0344('0x6e')]['id'],_0x417d86['body']?JSON[_0x0344('0x29')](_0x417d86[_0x0344('0x60')]):_0x0344('0x70'));return respondWithRpcPromise(_0x0344('0x71'),_0x0344('0x72'),_0x213718);}return null;})[_0x0344('0x24')](function(_0x45a413){var _0x1d12e6=_0x0344('0x73')+_0x45a413[_0x0344('0x2c')]['ContactId'];return db[_0x0344('0x74')][_0x0344('0x47')](_0x1d12e6,{'type':db[_0x0344('0x75')][_0x0344('0x76')][_0x0344('0x77')],'raw':!![]})[_0x0344('0x24')](function(_0x4c9d8f){return _0x4c9d8f;});})[_0x0344('0x24')](function(_0x485cc9){if(_0x485cc9){_0x213718[_0x0344('0x2c')]['contact']=_0x485cc9[0x0];if(!_0x417d86['body']['UserId'])return;return db[_0x0344('0x78')][_0x0344('0x5e')]({'where':{'id':_0x417d86[_0x0344('0x60')][_0x0344('0x68')],'role':_0x0344('0x69')},'attributes':['id',_0x0344('0x3e'),_0x0344('0x79'),_0x0344('0x7a'),_0x0344('0x7b')],'raw':!![]});}return null;})[_0x0344('0x24')](function(_0x2f9611){if(!_0x2f9611)return null;_0x213718[_0x0344('0x2c')][_0x0344('0x69')]=_0x2f9611;return _0x213718;})[_0x0344('0x24')](function(_0x342a32){if(_0x342a32){if(_0x417d86[_0x0344('0x60')][_0x0344('0x7c')]){_0x213718[_0x0344('0x2c')][_0x0344('0x7d')]=util[_0x0344('0x6d')](_0x0344('0x7e'),_0x417d86[_0x0344('0x6f')][_0x0344('0x3e')]);_0x213718[_0x0344('0x2c')][_0x0344('0x7f')]=_0x213718[_0x0344('0x7f')];_0x213718[_0x0344('0x2c')][_0x0344('0x80')]=_0x213718['channel'];_0x213718['message'][_0x0344('0x81')]=_0x0344('0x63');return respondWithRpcPromise(_0x0344('0x82'),_0x0344('0x82'),{'event':_0x0344('0x83'),'message':_0x213718['message']},client9002)['then'](function(){return _0x213718;});}return _0x213718;}return null;})['then'](respondWithResult(_0x4597e3,null))[_0x0344('0x2e')](handleError(_0x4597e3,null));};var interaction_log=require(_0x0344('0x16'))('whatsapp-interactions');exports[_0x0344('0x39')]=function(_0x1d79ce,_0x36f432,_0x1ae4b7){var _0x2e3080={'agent':{},'channel':_0x0344('0x64')};if(_0x1d79ce[_0x0344('0x60')]['id']){delete _0x1d79ce['body']['id'];}_0x1d79ce[_0x0344('0x60')][_0x0344('0x68')]=_0x1d79ce['body'][_0x0344('0x68')]||_0x1d79ce[_0x0344('0x6f')]['id'];_0x2e3080['agent']['id']=_0x1d79ce[_0x0344('0x60')][_0x0344('0x68')];return db[_0x0344('0x42')][_0x0344('0x5e')]({'where':{'id':_0x1d79ce[_0x0344('0x5c')]['id'],'UserId':null}})[_0x0344('0x24')](handleEntityNotFound(_0x36f432,null))[_0x0344('0x24')](function(_0x30ef62){if(_0x30ef62){_0x2e3080[_0x0344('0x2c')]=_0x30ef62[_0x0344('0x6a')]({'plain':!![]});return db['WhatsappInteraction'][_0x0344('0x5e')]({'where':{'id':_0x30ef62[_0x0344('0x84')]}});}return null;})[_0x0344('0x24')](handleEntityNotFound(_0x36f432,null))['then'](function(_0x983899){if(_0x983899){_0x2e3080[_0x0344('0x6e')]=_0x983899[_0x0344('0x6a')]({'plain':!![]});interaction_log['info'](_0x0344('0x85'),_0x1d79ce[_0x0344('0x6f')]['id'],_0x1d79ce[_0x0344('0x6f')][_0x0344('0x3e')],_0x1d79ce['user'][_0x0344('0x86')],_0x2e3080[_0x0344('0x6e')]['id'],_0x1d79ce[_0x0344('0x60')]?JSON['stringify'](_0x1d79ce['body']):_0x0344('0x70'));return respondWithRpcPromise(_0x0344('0x87'),'rejectMessage',_0x2e3080);}return null;})[_0x0344('0x24')](function(_0x43bace){var _0x11fb79=_0x0344('0x73')+_0x43bace[_0x0344('0x2c')][_0x0344('0x88')];return db[_0x0344('0x74')][_0x0344('0x47')](_0x11fb79,{'type':db['Sequelize']['QueryTypes'][_0x0344('0x77')],'raw':!![]})['then'](function(_0x4ace4b){return _0x4ace4b;});})[_0x0344('0x24')](function(_0x2db1b2){if(_0x2db1b2){_0x2e3080[_0x0344('0x2c')][_0x0344('0x89')]=_0x2db1b2[0x0];if(!_0x1d79ce[_0x0344('0x60')][_0x0344('0x68')])return;return db['User']['find']({'where':{'id':_0x1d79ce[_0x0344('0x60')][_0x0344('0x68')],'role':_0x0344('0x69')},'attributes':['id','name',_0x0344('0x79'),_0x0344('0x7a'),_0x0344('0x7b')],'raw':!![]});}return null;})['then'](function(_0x26467d){if(!_0x26467d)return null;_0x2e3080['message'][_0x0344('0x69')]=_0x26467d;return _0x2e3080;})[_0x0344('0x24')](function(_0x23a2fe){if(_0x23a2fe){_0x23a2fe[_0x0344('0x2c')][_0x0344('0x7d')]=util['format']('SIP/%s',_0x1d79ce['user'][_0x0344('0x3e')]);_0x23a2fe[_0x0344('0x2c')]['channel']=_0x2e3080['channel'];_0x23a2fe['message']['motionChannel']=_0x2e3080[_0x0344('0x7f')];_0x23a2fe[_0x0344('0x2c')][_0x0344('0x81')]=_0x0344('0x39');respondWithRpcPromise(_0x0344('0x82'),_0x0344('0x82'),{'event':'rejectmessage','message':_0x23a2fe[_0x0344('0x2c')]},client9002);return _0x2e3080;}return null;})[_0x0344('0x24')](respondWithResult(_0x36f432,null))[_0x0344('0x2e')](handleError(_0x36f432,null));};exports[_0x0344('0x30')]=function(_0x213799,_0x4166ae,_0xc91fd9){if(_0x213799['body']['id']){delete _0x213799['body']['id'];}var _0x477f5f;return db[_0x0344('0x42')]['find']({'where':{'id':_0x213799[_0x0344('0x5c')]['id']}})[_0x0344('0x24')](handleEntityNotFound(_0x4166ae,null))[_0x0344('0x24')](function(_0x5d623e){if(_0x5d623e){_0x477f5f=_0x5d623e;return db[_0x0344('0x8a')][_0x0344('0x5e')]({'where':{'id':_0x5d623e[_0x0344('0x8b')]}});}})[_0x0344('0x24')](handleEntityNotFound(_0x4166ae,null))['then'](function(_0x3758e0){if(_0x3758e0){logger['debug'](_0x0344('0x8c'),_0x0344('0x30'),_0x0344('0x8d'),_0x3758e0[_0x0344('0x54')],util['inspect'](_0x213799[_0x0344('0x60')],{'showHidden':![],'depth':null}));switch(_0x3758e0[_0x0344('0x54')]){case'twilio':if(_0x213799[_0x0344('0x60')][_0x0344('0x8e')]&&_0x213799[_0x0344('0x60')][_0x0344('0x8e')]===_0x477f5f[_0x0344('0x8f')]&&_0x213799['body'][_0x0344('0x90')]&&_0x213799[_0x0344('0x60')][_0x0344('0x90')]==='read'){return _0x477f5f['update']({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x0344('0x30'),_0x0344('0x91'),util[_0x0344('0x92')](_0x213799[_0x0344('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x477f5f;}})[_0x0344('0x24')](respondWithResult(_0x4166ae,null))[_0x0344('0x2e')](handleError(_0x4166ae,null));}; \ No newline at end of file +var _0x7347=['whatsapp','read','readAt','format','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\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','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','params','catch','create','body','find','destroy','describe','whatsapp-interactions','accept'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7347,0x15b));var _0x7734=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7347[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x7734('0x0'));var rimraf=require(_0x7734('0x1'));var zipdir=require(_0x7734('0x2'));var jsonpatch=require(_0x7734('0x3'));var rp=require(_0x7734('0x4'));var moment=require(_0x7734('0x5'));var BPromise=require(_0x7734('0x6'));var Mustache=require(_0x7734('0x7'));var util=require(_0x7734('0x8'));var path=require(_0x7734('0x9'));var sox=require('sox');var csv=require(_0x7734('0xa'));var ejs=require(_0x7734('0xb'));var fs=require('fs');var fs_extra=require(_0x7734('0xc'));var _=require(_0x7734('0xd'));var squel=require(_0x7734('0xe'));var crypto=require(_0x7734('0xf'));var jsforce=require(_0x7734('0x10'));var deskjs=require(_0x7734('0x11'));var toCsv=require(_0x7734('0xa'));var querystring=require('querystring');var Papa=require(_0x7734('0x12'));var Redis=require(_0x7734('0x13'));var authService=require(_0x7734('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7734('0x15'));var hardwareService=require(_0x7734('0x16'));var logger=require(_0x7734('0x17'))(_0x7734('0x18'));var utils=require(_0x7734('0x19'));var config=require(_0x7734('0x1a'));var licenseUtil=require(_0x7734('0x1b'));var db=require('../../mysqldb')['db'];config[_0x7734('0x1c')]=_[_0x7734('0x1d')](config['redis'],{'host':_0x7734('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7734('0x1f'))[_0x7734('0x20')](socket);var jayson=require(_0x7734('0x21'));var client=jayson['client'][_0x7734('0x22')]({'port':0x232c});var client9002=jayson[_0x7734('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41be0f,_0x2e4b2e,_0x26b248,_0x23e304){return new BPromise(function(_0x4900b9,_0xbdf2d0){var _0x53fea2=_0x23e304||client;return _0x53fea2[_0x7734('0x24')](_0x41be0f,_0x26b248)[_0x7734('0x25')](function(_0x4c0dfa){logger[_0x7734('0x26')](_0x7734('0x27'),_0x2e4b2e,_0x7734('0x28'));logger[_0x7734('0x29')](_0x7734('0x2a'),_0x2e4b2e,_0x7734('0x28'),JSON[_0x7734('0x2b')](_0x4c0dfa));if(_0x4c0dfa['error']){if(_0x4c0dfa[_0x7734('0x2c')][_0x7734('0x2d')]===0x1f4){logger['error'](_0x7734('0x27'),_0x2e4b2e,_0x4c0dfa[_0x7734('0x2c')][_0x7734('0x2e')]);return _0xbdf2d0(_0x4c0dfa[_0x7734('0x2c')][_0x7734('0x2e')]);}logger[_0x7734('0x2c')](_0x7734('0x27'),_0x2e4b2e,_0x4c0dfa[_0x7734('0x2c')]['message']);return _0x4900b9(_0x4c0dfa[_0x7734('0x2c')][_0x7734('0x2e')]);}else{logger[_0x7734('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x2e4b2e,_0x7734('0x28'));_0x4900b9(_0x4c0dfa[_0x7734('0x2f')]['message']);}})['catch'](function(_0x2a2c19){logger[_0x7734('0x2c')](_0x7734('0x27'),_0x2e4b2e,_0x2a2c19);_0xbdf2d0(_0x2a2c19);});});}function respondWithStatusCode(_0x512077,_0x2c0716){_0x2c0716=_0x2c0716||0xcc;return function(_0x52ccab){if(_0x52ccab){return _0x512077['sendStatus'](_0x2c0716);}return _0x512077[_0x7734('0x30')](_0x2c0716)[_0x7734('0x31')]();};}function respondWithResult(_0x1a3c0b,_0x1dcbd4){_0x1dcbd4=_0x1dcbd4||0xc8;return function(_0x3c127b){if(_0x3c127b){return _0x1a3c0b[_0x7734('0x30')](_0x1dcbd4)[_0x7734('0x32')](_0x3c127b);}};}function respondWithFilteredResult(_0x2af1b6,_0x245035){return function(_0x171ac0){if(_0x171ac0){var _0x2e777b=typeof _0x245035[_0x7734('0x33')]===_0x7734('0x34')&&typeof _0x245035[_0x7734('0x35')]===_0x7734('0x34');var _0x1acfce=_0x171ac0[_0x7734('0x36')];var _0x25e6eb=_0x2e777b?0x0:_0x245035[_0x7734('0x33')];var _0x341a70=_0x2e777b?_0x171ac0[_0x7734('0x36')]:_0x245035[_0x7734('0x33')]+_0x245035[_0x7734('0x35')];var _0x2f4431;if(_0x341a70>=_0x1acfce){_0x341a70=_0x1acfce;_0x2f4431=0xc8;}else{_0x2f4431=0xce;}_0x2af1b6[_0x7734('0x30')](_0x2f4431);return _0x2af1b6[_0x7734('0x37')](_0x7734('0x38'),_0x25e6eb+'-'+_0x341a70+'/'+_0x1acfce)[_0x7734('0x32')](_0x171ac0);}return null;};}function patchUpdates(_0x360d9d){return function(_0x56e220){try{jsonpatch[_0x7734('0x39')](_0x56e220,_0x360d9d,!![]);}catch(_0x5c8cf4){return BPromise[_0x7734('0x3a')](_0x5c8cf4);}return _0x56e220[_0x7734('0x3b')]();};}function saveUpdates(_0x382b60,_0x1d3bdd){return function(_0x3070b9){if(_0x3070b9){return _0x3070b9[_0x7734('0x3c')](_0x382b60)['then'](function(_0x321832){return _0x321832;});}return null;};}function removeEntity(_0x305372,_0x47f796){return function(_0x409e1c){if(_0x409e1c){return _0x409e1c['destroy']()['then'](function(){_0x305372[_0x7734('0x30')](0xcc)[_0x7734('0x31')]();});}};}function handleEntityNotFound(_0xd136ad,_0x4347ca){return function(_0x3d13c8){if(!_0x3d13c8){_0xd136ad[_0x7734('0x3d')](0x194);}return _0x3d13c8;};}function handleError(_0x12d481,_0x347c8a){_0x347c8a=_0x347c8a||0x1f4;return function(_0x356fe0){logger['error'](_0x356fe0[_0x7734('0x3e')]);if(_0x356fe0[_0x7734('0x3f')]){delete _0x356fe0[_0x7734('0x3f')];}_0x12d481['status'](_0x347c8a)[_0x7734('0x40')](_0x356fe0);};}exports[_0x7734('0x41')]=function(_0x1d7e20,_0x3f43b7){var _0x88e6ff={},_0x17e743={},_0x414765={'count':0x0,'rows':[]};var _0x39f63c=_[_0x7734('0x42')](db[_0x7734('0x43')][_0x7734('0x44')],function(_0x292d78){return{'name':_0x292d78['fieldName'],'type':_0x292d78['type'][_0x7734('0x45')]};});_0x17e743['model']=_[_0x7734('0x42')](_0x39f63c,'name');_0x17e743[_0x7734('0x46')]=_[_0x7734('0x47')](_0x1d7e20[_0x7734('0x46')]);_0x17e743[_0x7734('0x48')]=_[_0x7734('0x49')](_0x17e743[_0x7734('0x4a')],_0x17e743[_0x7734('0x46')]);_0x88e6ff[_0x7734('0x4b')]=_[_0x7734('0x49')](_0x17e743[_0x7734('0x4a')],qs[_0x7734('0x4c')](_0x1d7e20['query'][_0x7734('0x4c')]));_0x88e6ff['attributes']=_0x88e6ff['attributes']['length']?_0x88e6ff['attributes']:_0x17e743[_0x7734('0x4a')];if(!_0x1d7e20[_0x7734('0x46')]['hasOwnProperty'](_0x7734('0x4d'))){_0x88e6ff[_0x7734('0x35')]=qs[_0x7734('0x35')](_0x1d7e20['query'][_0x7734('0x35')]);_0x88e6ff[_0x7734('0x33')]=qs[_0x7734('0x33')](_0x1d7e20[_0x7734('0x46')][_0x7734('0x33')]);}_0x88e6ff[_0x7734('0x4e')]=qs[_0x7734('0x4f')](_0x1d7e20['query'][_0x7734('0x4f')]);_0x88e6ff[_0x7734('0x50')]=qs[_0x7734('0x48')](_[_0x7734('0x51')](_0x1d7e20['query'],_0x17e743[_0x7734('0x48')]),_0x39f63c);if(_0x1d7e20[_0x7734('0x46')][_0x7734('0x52')]){_0x88e6ff[_0x7734('0x50')]=_['merge'](_0x88e6ff[_0x7734('0x50')],{'$or':_['map'](_0x39f63c,function(_0x428e3b){if(_0x428e3b[_0x7734('0x53')]!==_0x7734('0x54')){var _0x1139d2={};_0x1139d2[_0x428e3b[_0x7734('0x3f')]]={'$like':'%'+_0x1d7e20[_0x7734('0x46')]['filter']+'%'};return _0x1139d2;}})});}_0x88e6ff=_[_0x7734('0x55')]({},_0x88e6ff,_0x1d7e20[_0x7734('0x56')]);var _0x3f3759={'where':_0x88e6ff[_0x7734('0x50')]};return db[_0x7734('0x43')][_0x7734('0x36')](_0x3f3759)[_0x7734('0x25')](function(_0x5bd4ef){_0x414765[_0x7734('0x36')]=_0x5bd4ef;if(_0x1d7e20[_0x7734('0x46')]['includeAll']){_0x88e6ff[_0x7734('0x57')]=[{'all':!![]}];}return db[_0x7734('0x43')][_0x7734('0x58')](_0x88e6ff);})[_0x7734('0x25')](function(_0x414b60){_0x414765[_0x7734('0x59')]=_0x414b60;return _0x414765;})[_0x7734('0x25')](respondWithFilteredResult(_0x3f43b7,_0x88e6ff))['catch'](handleError(_0x3f43b7,null));};exports[_0x7734('0x5a')]=function(_0x6a3e79,_0xc62288){var _0x25a944={'raw':!![],'where':{'id':_0x6a3e79[_0x7734('0x5b')]['id']}},_0x476619={};_0x476619[_0x7734('0x4a')]=_[_0x7734('0x47')](db[_0x7734('0x43')][_0x7734('0x44')]);_0x476619['query']=_[_0x7734('0x47')](_0x6a3e79[_0x7734('0x46')]);_0x476619['filters']=_['intersection'](_0x476619[_0x7734('0x4a')],_0x476619[_0x7734('0x46')]);_0x25a944[_0x7734('0x4b')]=_['intersection'](_0x476619[_0x7734('0x4a')],qs[_0x7734('0x4c')](_0x6a3e79['query']['fields']));_0x25a944['attributes']=_0x25a944[_0x7734('0x4b')]['length']?_0x25a944['attributes']:_0x476619[_0x7734('0x4a')];if(_0x6a3e79[_0x7734('0x46')]['includeAll']){_0x25a944[_0x7734('0x57')]=[{'all':!![]}];}_0x25a944=_[_0x7734('0x55')]({},_0x25a944,_0x6a3e79[_0x7734('0x56')]);return db['WhatsappMessage']['find'](_0x25a944)[_0x7734('0x25')](handleEntityNotFound(_0xc62288,null))[_0x7734('0x25')](respondWithResult(_0xc62288,null))[_0x7734('0x5c')](handleError(_0xc62288,null));};exports[_0x7734('0x5d')]=function(_0x4486c6,_0x18076f){return db['WhatsappMessage'][_0x7734('0x5d')](_0x4486c6[_0x7734('0x5e')],{})['then'](respondWithResult(_0x18076f,0xc9))[_0x7734('0x5c')](handleError(_0x18076f,null));};exports[_0x7734('0x3c')]=function(_0x2099c2,_0x506f6a){if(_0x2099c2['body']['id']){delete _0x2099c2[_0x7734('0x5e')]['id'];}return db[_0x7734('0x43')][_0x7734('0x5f')]({'where':{'id':_0x2099c2[_0x7734('0x5b')]['id']}})[_0x7734('0x25')](handleEntityNotFound(_0x506f6a,null))[_0x7734('0x25')](saveUpdates(_0x2099c2['body'],null))[_0x7734('0x25')](respondWithResult(_0x506f6a,null))[_0x7734('0x5c')](handleError(_0x506f6a,null));};exports[_0x7734('0x60')]=function(_0x131526,_0x4c2255){return db[_0x7734('0x43')][_0x7734('0x5f')]({'where':{'id':_0x131526[_0x7734('0x5b')]['id']}})[_0x7734('0x25')](handleEntityNotFound(_0x4c2255,null))['then'](removeEntity(_0x4c2255,null))['catch'](handleError(_0x4c2255,null));};exports[_0x7734('0x61')]=function(_0x138c46,_0x640e0f){return db[_0x7734('0x43')][_0x7734('0x61')]()[_0x7734('0x25')](respondWithResult(_0x640e0f,null))[_0x7734('0x5c')](handleError(_0x640e0f,null));};var interaction_log=require('../../config/logger')(_0x7734('0x62'));exports[_0x7734('0x63')]=function(_0x386c8f,_0x2e74d3,_0x3eb86c){var _0xb75fd4={'agent':{},'channel':_0x7734('0x64')};if(_0x386c8f['body']['id']){delete _0x386c8f[_0x7734('0x5e')]['id'];}_0x386c8f[_0x7734('0x5e')][_0x7734('0x65')]=!![];_0x386c8f['body'][_0x7734('0x66')]=moment()[_0x7734('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x386c8f[_0x7734('0x5e')][_0x7734('0x68')]=_0x386c8f['body'][_0x7734('0x68')]||_0x386c8f[_0x7734('0x69')]['id'];_0xb75fd4['agent']['id']=_0x386c8f[_0x7734('0x5e')][_0x7734('0x68')];return db[_0x7734('0x43')]['find']({'where':{'id':_0x386c8f[_0x7734('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e74d3,null))[_0x7734('0x25')](saveUpdates(_0x386c8f['body'],null))['then'](function(_0x1c2f05){if(_0x1c2f05){_0xb75fd4[_0x7734('0x2e')]=_0x1c2f05['get']({'plain':!![]});return db[_0x7734('0x6a')][_0x7734('0x5f')]({'where':{'id':_0x1c2f05[_0x7734('0x6b')]}});}return null;})[_0x7734('0x25')](handleEntityNotFound(_0x2e74d3,null))['then'](function(_0x15b42f){if(_0x15b42f){return _0x15b42f['update']({'UserId':_0x386c8f[_0x7734('0x5e')][_0x7734('0x68')],'read1stAt':_[_0x7734('0x6c')](_0x15b42f[_0x7734('0x6d')])?moment()['format'](_0x7734('0x6e')):undefined});}return null;})['then'](function(_0x4138c1){if(_0x4138c1){_0xb75fd4[_0x7734('0x6f')]=_0x4138c1[_0x7734('0x70')]({'plain':!![]});interaction_log[_0x7734('0x26')](_0x7734('0x71'),_0x386c8f[_0x7734('0x69')]['id'],_0x386c8f[_0x7734('0x69')][_0x7734('0x3f')],_0x386c8f['user'][_0x7734('0x72')],_0xb75fd4[_0x7734('0x6f')]['id'],_0x386c8f[_0x7734('0x5e')]?JSON[_0x7734('0x2b')](_0x386c8f['body']):_0x7734('0x73'));return respondWithRpcPromise(_0x7734('0x74'),_0x7734('0x75'),_0xb75fd4);}return null;})[_0x7734('0x25')](function(_0x5da314){var _0x275670='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5da314[_0x7734('0x2e')][_0x7734('0x76')];return db[_0x7734('0x77')][_0x7734('0x46')](_0x275670,{'type':db['Sequelize'][_0x7734('0x78')][_0x7734('0x79')],'raw':!![]})[_0x7734('0x25')](function(_0x1a84d8){return _0x1a84d8;});})[_0x7734('0x25')](function(_0x40093d){if(_0x40093d){_0xb75fd4[_0x7734('0x2e')][_0x7734('0x7a')]=_0x40093d[0x0];if(!_0x386c8f['body'][_0x7734('0x68')])return;return db['User'][_0x7734('0x5f')]({'where':{'id':_0x386c8f[_0x7734('0x5e')]['UserId'],'role':_0x7734('0x7b')},'attributes':['id',_0x7734('0x3f'),_0x7734('0x7c'),_0x7734('0x7d'),_0x7734('0x7e')],'raw':!![]});}return null;})[_0x7734('0x25')](function(_0x43660d){if(!_0x43660d)return null;_0xb75fd4['message'][_0x7734('0x7b')]=_0x43660d;return _0xb75fd4;})[_0x7734('0x25')](function(_0x5974e1){if(_0x5974e1){if(_0x386c8f['body'][_0x7734('0x7f')]){_0xb75fd4['message'][_0x7734('0x80')]=util[_0x7734('0x67')](_0x7734('0x81'),_0x386c8f[_0x7734('0x69')]['name']);_0xb75fd4[_0x7734('0x2e')]['channel']=_0xb75fd4['channel'];_0xb75fd4[_0x7734('0x2e')]['motionChannel']=_0xb75fd4[_0x7734('0x82')];_0xb75fd4[_0x7734('0x2e')][_0x7734('0x83')]=_0x7734('0x63');return respondWithRpcPromise(_0x7734('0x84'),'EventManager',{'event':_0x7734('0x85'),'message':_0xb75fd4[_0x7734('0x2e')]},client9002)[_0x7734('0x25')](function(){return _0xb75fd4;});}return _0xb75fd4;}return null;})[_0x7734('0x25')](respondWithResult(_0x2e74d3,null))[_0x7734('0x5c')](handleError(_0x2e74d3,null));};var interaction_log=require(_0x7734('0x17'))(_0x7734('0x62'));exports['reject']=function(_0x41f8d6,_0x202a8e,_0x3d7589){var _0x36a21c={'agent':{},'channel':_0x7734('0x64')};if(_0x41f8d6[_0x7734('0x5e')]['id']){delete _0x41f8d6['body']['id'];}_0x41f8d6[_0x7734('0x5e')][_0x7734('0x68')]=_0x41f8d6['body'][_0x7734('0x68')]||_0x41f8d6[_0x7734('0x69')]['id'];_0x36a21c[_0x7734('0x7b')]['id']=_0x41f8d6['body']['UserId'];return db[_0x7734('0x43')][_0x7734('0x5f')]({'where':{'id':_0x41f8d6[_0x7734('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x202a8e,null))[_0x7734('0x25')](function(_0x201dce){if(_0x201dce){_0x36a21c[_0x7734('0x2e')]=_0x201dce[_0x7734('0x70')]({'plain':!![]});return db[_0x7734('0x6a')][_0x7734('0x5f')]({'where':{'id':_0x201dce['WhatsappInteractionId']}});}return null;})[_0x7734('0x25')](handleEntityNotFound(_0x202a8e,null))[_0x7734('0x25')](function(_0x1f0fe5){if(_0x1f0fe5){_0x36a21c['interaction']=_0x1f0fe5[_0x7734('0x70')]({'plain':!![]});interaction_log[_0x7734('0x26')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41f8d6[_0x7734('0x69')]['id'],_0x41f8d6['user'][_0x7734('0x3f')],_0x41f8d6[_0x7734('0x69')][_0x7734('0x72')],_0x36a21c[_0x7734('0x6f')]['id'],_0x41f8d6[_0x7734('0x5e')]?JSON['stringify'](_0x41f8d6['body']):_0x7734('0x73'));return respondWithRpcPromise('RejectMessage',_0x7734('0x86'),_0x36a21c);}return null;})[_0x7734('0x25')](function(_0xdb31e5){var _0x560783=_0x7734('0x87')+_0xdb31e5['message'][_0x7734('0x76')];return db['sequelize'][_0x7734('0x46')](_0x560783,{'type':db[_0x7734('0x88')][_0x7734('0x78')][_0x7734('0x79')],'raw':!![]})[_0x7734('0x25')](function(_0x3be65d){return _0x3be65d;});})[_0x7734('0x25')](function(_0x54d8a1){if(_0x54d8a1){_0x36a21c[_0x7734('0x2e')][_0x7734('0x7a')]=_0x54d8a1[0x0];if(!_0x41f8d6['body'][_0x7734('0x68')])return;return db[_0x7734('0x89')][_0x7734('0x5f')]({'where':{'id':_0x41f8d6[_0x7734('0x5e')][_0x7734('0x68')],'role':_0x7734('0x7b')},'attributes':['id',_0x7734('0x3f'),_0x7734('0x7c'),_0x7734('0x7d'),'internal'],'raw':!![]});}return null;})[_0x7734('0x25')](function(_0x4e1b4b){if(!_0x4e1b4b)return null;_0x36a21c[_0x7734('0x2e')]['agent']=_0x4e1b4b;return _0x36a21c;})[_0x7734('0x25')](function(_0x5c2c16){if(_0x5c2c16){_0x5c2c16[_0x7734('0x2e')][_0x7734('0x80')]=util[_0x7734('0x67')](_0x7734('0x81'),_0x41f8d6['user']['name']);_0x5c2c16[_0x7734('0x2e')][_0x7734('0x82')]=_0x36a21c[_0x7734('0x82')];_0x5c2c16[_0x7734('0x2e')][_0x7734('0x8a')]=_0x36a21c[_0x7734('0x82')];_0x5c2c16[_0x7734('0x2e')]['event']='reject';respondWithRpcPromise(_0x7734('0x84'),_0x7734('0x84'),{'event':_0x7734('0x8b'),'message':_0x5c2c16['message']},client9002);return _0x36a21c;}return null;})[_0x7734('0x25')](respondWithResult(_0x202a8e,null))[_0x7734('0x5c')](handleError(_0x202a8e,null));};exports['status']=function(_0x262313,_0x46e8d5,_0x4de3ff){if(_0x262313['body']['id']){delete _0x262313[_0x7734('0x5e')]['id'];}var _0x58db5d;return db[_0x7734('0x43')][_0x7734('0x5f')]({'where':{'id':_0x262313[_0x7734('0x5b')]['id']}})[_0x7734('0x25')](handleEntityNotFound(_0x46e8d5,null))[_0x7734('0x25')](function(_0x35254f){if(_0x35254f){_0x58db5d=_0x35254f;return db[_0x7734('0x8c')][_0x7734('0x5f')]({'where':{'id':_0x35254f[_0x7734('0x8d')]}});}})[_0x7734('0x25')](handleEntityNotFound(_0x46e8d5,null))[_0x7734('0x25')](function(_0x206034){if(_0x206034){logger[_0x7734('0x29')](_0x7734('0x8e'),'status',_0x7734('0x8f'),_0x206034['type'],util[_0x7734('0x90')](_0x262313[_0x7734('0x5e')],{'showHidden':![],'depth':null}));switch(_0x206034[_0x7734('0x53')]){case _0x7734('0x91'):if(_0x262313[_0x7734('0x5e')][_0x7734('0x92')]&&_0x262313[_0x7734('0x5e')][_0x7734('0x92')]===_0x58db5d['messageId']&&_0x262313[_0x7734('0x5e')][_0x7734('0x93')]&&_0x262313[_0x7734('0x5e')][_0x7734('0x93')]===_0x7734('0x65')){return _0x58db5d[_0x7734('0x3c')]({'read':!![]});}else{logger[_0x7734('0x2c')](_0x7734('0x94'),_0x7734('0x30'),_0x7734('0x91'),util[_0x7734('0x90')](_0x262313['body'],{'showHidden':![],'depth':null}));}break;}return _0x58db5d;}})[_0x7734('0x25')](respondWithResult(_0x46e8d5,null))[_0x7734('0x5c')](handleError(_0x46e8d5,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index f74d3ae..e21efde 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 _0x9d5b=['save','update','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x16a704,_0x106705){_0x16a704=_0x16a704-0x0;var _0x22abdb=_0x9d5b[_0x16a704];return _0x22abdb;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xb9d5('0x0'))['db'][_0xb9d5('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb9d5('0x2')](0x0);var events={'afterCreate':_0xb9d5('0x3'),'afterUpdate':_0xb9d5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6871c3){return function(_0x54423a,_0x36b546,_0xbf85ca){WhatsappMessageEvents[_0xb9d5('0x5')](_0x6871c3+':'+_0x54423a['id'],_0x54423a);WhatsappMessageEvents[_0xb9d5('0x5')](_0x6871c3,_0x54423a);_0xbf85ca(null);};}for(var e in events){if(events[_0xb9d5('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9d5('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x69d3=['hook','exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x69d3,0xda));var _0x369d=function(_0xd9b36c,_0x411bbd){_0xd9b36c=_0xd9b36c-0x0;var _0x29af4a=_0x69d3[_0xd9b36c];return _0x29af4a;};'use strict';var EventEmitter=require(_0x369d('0x0'));var WhatsappMessage=require(_0x369d('0x1'))['db'][_0x369d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x369d('0x3'),'afterUpdate':_0x369d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x499d0d){return function(_0xe38740,_0x59df58,_0x56c175){WhatsappMessageEvents[_0x369d('0x5')](_0x499d0d+':'+_0xe38740['id'],_0xe38740);WhatsappMessageEvents[_0x369d('0x5')](_0x499d0d,_0xe38740);_0x56c175(null);};}for(var e in events){if(events[_0x369d('0x6')](e)){var event=events[e];WhatsappMessage[_0x369d('0x7')](e,emitEvent(event));}}module[_0x369d('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0489217..3a7a41c 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 _0xa022=['toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','authToken','create','whatsapp:','remote','/api/whatsapp/messages/','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction'];(function(_0xd703d8,_0x549fb1){var _0x5c31f0=function(_0x23fbd4){while(--_0x23fbd4){_0xd703d8['push'](_0xd703d8['shift']());}};_0x5c31f0(++_0x549fb1);}(_0xa022,0x1e7));var _0x2a02=function(_0x25f223,_0x91c718){_0x25f223=_0x25f223-0x0;var _0x4891f2=_0xa022[_0x25f223];return _0x4891f2;};'use strict';var _=require(_0x2a02('0x0'));var util=require(_0x2a02('0x1'));var logger=require(_0x2a02('0x2'))(_0x2a02('0x3'));var moment=require(_0x2a02('0x4'));var BPromise=require(_0x2a02('0x5'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x2a02('0x6'));var rimraf=require(_0x2a02('0x7'));var config=require('../../config/environment');var attributes=require(_0x2a02('0x8'));module['exports']=function(_0x14089f,_0x1853ee){return _0x14089f[_0x2a02('0x9')](_0x2a02('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x2a02('0xb'),'fields':[_0x2a02('0xb')]},{'name':_0x2a02('0xc'),'fields':['body'],'type':_0x2a02('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x471e27,_0x14b475,_0x4e81fc){var _0x542555=_0x14089f[_0x2a02('0xe')];var _0x1e5a7f=_0x471e27[_0x2a02('0xf')]({'plain':!![]});if(_0x1e5a7f[_0x2a02('0x10')][_0x2a02('0x11')]()==='in'||_0x1e5a7f['direction'][_0x2a02('0x11')]()===_0x2a02('0x12')&&!_0x1e5a7f[_0x2a02('0x13')]&&!_[_0x2a02('0x14')](_0x1e5a7f[_0x2a02('0x15')])){_0x542555[_0x2a02('0x16')]['findOne']({'where':{'id':_0x1e5a7f[_0x2a02('0x17')]}})[_0x2a02('0x18')](function(_0x3685ac){if(_0x3685ac){_0x3685ac[_0x2a02('0x19')]({'lastMsgAt':_0x1e5a7f[_0x2a02('0x1a')],'lastMsgDirection':_0x1e5a7f[_0x2a02('0x10')][_0x2a02('0x11')]()});}})[_0x2a02('0x1b')](function(_0x352d37){console['error'](_0x352d37);});}if(_0x1e5a7f['direction']===_0x2a02('0x12')&&!_0x1e5a7f[_0x2a02('0x13')]){var _0x5323b6;_0x542555[_0x2a02('0x1c')]['find']({'where':{'id':_0x1e5a7f[_0x2a02('0x1d')]},'raw':!![]})[_0x2a02('0x18')](function(_0x56ab6e){_0x5323b6=_0x56ab6e;if(_0x5323b6&&_0x5323b6[_0x2a02('0x1e')]){switch(_0x5323b6['type']){case _0x2a02('0x1f'):var _0x2ec82c=require(_0x2a02('0x1f'));if(_0x5323b6[_0x2a02('0x20')]&&_0x5323b6['authToken']&&_0x5323b6[_0x2a02('0x21')]){var _0x4b93e9=new _0x2ec82c(_0x5323b6[_0x2a02('0x20')],_0x5323b6[_0x2a02('0x22')]);_0x4b93e9['messages'][_0x2a02('0x23')]({'body':_0x1e5a7f['body'],'to':_0x2a02('0x24')+_0x1e5a7f[_0x2a02('0x21')],'from':_0x2a02('0x24')+_0x5323b6[_0x2a02('0x21')],'statusCallback':_0x5323b6[_0x2a02('0x25')]+_0x2a02('0x26')+_0x1e5a7f['id']+'/status?token='+_0x5323b6['token']})[_0x2a02('0x18')](function(_0x4b641a){if(_0x4b641a[_0x2a02('0x27')]){return _0x471e27[_0x2a02('0x19')]({'messageId':_0x4b641a['sid']});}})[_0x2a02('0x1b')](function(_0x3025df){logger[_0x2a02('0x28')](_0x2a02('0x29'),'afterCreate',_0x2a02('0x1f'),util[_0x2a02('0x2a')](_0x3025df,{'showHidden':![],'depth':null}));});}else{logger[_0x2a02('0x28')](_0x2a02('0x29'),_0x2a02('0x2b'),_0x2a02('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2a02('0x2c'):var _0x58fa4a=_0x5323b6['accountSid'];var _0x1f4157=_0x5323b6['authToken'];var _0x5d6c1e=_0x5323b6['baseUrl']+_0x2a02('0x2d')+_0x58fa4a+_0x2a02('0x2e');var _0x44fb9a={'to':[_0x1e5a7f[_0x2a02('0x21')]],'message':{'type':_0x2a02('0x2f'),'text':_0x1e5a7f['body']}};var _0x53ed1b={'method':_0x2a02('0x30'),'uri':_0x5d6c1e,'headers':{'Authorization':_0x2a02('0x31')+_0x1f4157,'Content-Type':'application/json'},'body':_0x44fb9a,'json':!![]};rp(_0x53ed1b)['then'](function(_0x460af7){if(_0x460af7[_0x2a02('0x32')][0x0][_0x2a02('0x33')]){return _0x471e27[_0x2a02('0x19')]({'messageId':_0x460af7[_0x2a02('0x32')][0x0]['message_id']});}})[_0x2a02('0x1b')](function(_0x485576){logger[_0x2a02('0x34')](_0x2a02('0x35'),_0x485576);});break;}}})[_0x2a02('0x36')](function(){_0x4e81fc();});}else{_0x4e81fc();}}},'charset':'utf8mb4','collate':_0x2a02('0x37')});}; \ No newline at end of file +var _0xc903=['moment','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','phone','accountSid','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc903,0x1bd));var _0x3c90=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xc903[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x3c90('0x0'));var util=require(_0x3c90('0x1'));var logger=require('../../config/logger')(_0x3c90('0x2'));var moment=require(_0x3c90('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x3c90('0x4'));var fs=require('fs');var path=require(_0x3c90('0x5'));var rimraf=require(_0x3c90('0x6'));var config=require(_0x3c90('0x7'));var attributes=require(_0x3c90('0x8'));module[_0x3c90('0x9')]=function(_0x5d2f3a,_0x1eea9e){return _0x5d2f3a[_0x3c90('0xa')](_0x3c90('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x3c90('0xc'),'fields':[_0x3c90('0xc')]},{'name':_0x3c90('0xd'),'fields':[_0x3c90('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fed93,_0x1fdf0b,_0x3bf3f6){var _0x4134c7=_0x5d2f3a[_0x3c90('0xf')];var _0x185419=_0x1fed93[_0x3c90('0x10')]({'plain':!![]});if(_0x185419[_0x3c90('0x11')][_0x3c90('0x12')]()==='in'||_0x185419[_0x3c90('0x11')][_0x3c90('0x12')]()==='out'&&!_0x185419[_0x3c90('0x13')]&&!_[_0x3c90('0x14')](_0x185419[_0x3c90('0x15')])){_0x4134c7['WhatsappInteraction'][_0x3c90('0x16')]({'where':{'id':_0x185419['WhatsappInteractionId']}})[_0x3c90('0x17')](function(_0x330efd){if(_0x330efd){_0x330efd[_0x3c90('0x18')]({'lastMsgAt':_0x185419['createdAt'],'lastMsgDirection':_0x185419['direction']['toLowerCase']()});}})[_0x3c90('0x19')](function(_0x50a08c){console[_0x3c90('0x1a')](_0x50a08c);});}if(_0x185419[_0x3c90('0x11')]==='out'&&!_0x185419[_0x3c90('0x13')]){var _0x5aba6a;_0x4134c7[_0x3c90('0x1b')]['find']({'where':{'id':_0x185419[_0x3c90('0x1c')]},'raw':!![]})[_0x3c90('0x17')](function(_0x15160c){_0x5aba6a=_0x15160c;if(_0x5aba6a&&_0x5aba6a['type']){switch(_0x5aba6a[_0x3c90('0x1d')]){case _0x3c90('0x1e'):var _0x36bc4e=require(_0x3c90('0x1e'));if(_0x5aba6a['accountSid']&&_0x5aba6a[_0x3c90('0x1f')]&&_0x5aba6a[_0x3c90('0x20')]){var _0x42f7a5=new _0x36bc4e(_0x5aba6a[_0x3c90('0x21')],_0x5aba6a[_0x3c90('0x1f')]);_0x42f7a5['messages']['create']({'body':_0x185419[_0x3c90('0xe')],'to':_0x3c90('0x22')+_0x185419[_0x3c90('0x20')],'from':_0x3c90('0x22')+_0x5aba6a[_0x3c90('0x20')],'statusCallback':_0x5aba6a['remote']+_0x3c90('0x23')+_0x185419['id']+_0x3c90('0x24')+_0x5aba6a[_0x3c90('0x25')]})['then'](function(_0x2b66d4){if(_0x2b66d4[_0x3c90('0x26')]){return _0x1fed93[_0x3c90('0x18')]({'messageId':_0x2b66d4['sid']});}})[_0x3c90('0x19')](function(_0x197846){logger[_0x3c90('0x1a')](_0x3c90('0x27'),_0x3c90('0x28'),_0x3c90('0x1e'),util[_0x3c90('0x29')](_0x197846,{'showHidden':![],'depth':null}));});}else{logger[_0x3c90('0x1a')](_0x3c90('0x27'),'afterCreate',_0x3c90('0x1e'),_0x3c90('0x2a'));}break;case _0x3c90('0x2b'):var _0x9e20d5=_0x5aba6a[_0x3c90('0x21')];var _0x5eb270=_0x5aba6a['authToken'];var _0x2f7606=_0x5aba6a[_0x3c90('0x2c')]+_0x3c90('0x2d')+_0x9e20d5+_0x3c90('0x2e');var _0x121d49={'to':[_0x185419[_0x3c90('0x20')]],'message':{'type':'text','text':_0x185419[_0x3c90('0xe')]}};var _0x5a9fcf={'method':_0x3c90('0x2f'),'uri':_0x2f7606,'headers':{'Authorization':_0x3c90('0x30')+_0x5eb270,'Content-Type':_0x3c90('0x31')},'body':_0x121d49,'json':!![]};rp(_0x5a9fcf)['then'](function(_0x35448c){if(_0x35448c[_0x3c90('0x32')][0x0][_0x3c90('0x33')]){return _0x1fed93[_0x3c90('0x18')]({'messageId':_0x35448c[_0x3c90('0x32')][0x0][_0x3c90('0x33')]});}})[_0x3c90('0x19')](function(_0x1351f4){logger[_0x3c90('0x34')]('WhatsappMessage,\x20%s',_0x1351f4);});break;}}})[_0x3c90('0x35')](function(){_0x3bf3f6();});}else{_0x3bf3f6();}}},'charset':_0x3c90('0x36'),'collate':_0x3c90('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index cec84ad..66151b6 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 _0xfb40=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request\x20sent','debug','stringify','error','code','message','info','WhatsappMessage,\x20%s,\x20%s','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','catch','lodash'];(function(_0x52d666,_0x2648b2){var _0x480b9a=function(_0x57a34d){while(--_0x57a34d){_0x52d666['push'](_0x52d666['shift']());}};_0x480b9a(++_0x2648b2);}(_0xfb40,0x107));var _0x0fb4=function(_0x4f973f,_0x42caf1){_0x4f973f=_0x4f973f-0x0;var _0x533349=_0xfb40[_0x4f973f];return _0x533349;};'use strict';var _=require(_0x0fb4('0x0'));var util=require(_0x0fb4('0x1'));var moment=require(_0x0fb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x0fb4('0x3'));var fs=require('fs');var Redis=require(_0x0fb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fb4('0x5'));var logger=require(_0x0fb4('0x6'))(_0x0fb4('0x7'));var config=require(_0x0fb4('0x8'));var jayson=require(_0x0fb4('0x9'));var client=jayson[_0x0fb4('0xa')][_0x0fb4('0xb')]({'port':0x232a});config[_0x0fb4('0xc')]=_[_0x0fb4('0xd')](config['redis'],{'host':_0x0fb4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0fb4('0xf'))['register'](socket);function respondWithRpcPromise(_0x3b1149,_0x299176,_0x498296){return new BPromise(function(_0x35bc1b,_0x1b90e0){return client['request'](_0x3b1149,_0x498296)['then'](function(_0x3df87f){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x299176,_0x0fb4('0x10'));logger[_0x0fb4('0x11')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x299176,'request\x20sent',JSON[_0x0fb4('0x12')](_0x3df87f));if(_0x3df87f[_0x0fb4('0x13')]){if(_0x3df87f[_0x0fb4('0x13')][_0x0fb4('0x14')]===0x1f4){logger[_0x0fb4('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x299176,_0x3df87f['error'][_0x0fb4('0x15')]);return _0x1b90e0(_0x3df87f[_0x0fb4('0x13')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x299176,_0x3df87f[_0x0fb4('0x13')][_0x0fb4('0x15')]);return _0x35bc1b(_0x3df87f['error'][_0x0fb4('0x15')]);}else{logger[_0x0fb4('0x16')](_0x0fb4('0x17'),_0x299176,_0x0fb4('0x10'));_0x35bc1b(_0x3df87f[_0x0fb4('0x18')][_0x0fb4('0x15')]);}})['catch'](function(_0x2b39c5){logger[_0x0fb4('0x13')](_0x0fb4('0x17'),_0x299176,_0x2b39c5);_0x1b90e0(_0x2b39c5);});});}exports[_0x0fb4('0x19')]=function(_0x269ed3){var _0x16a872=this;return new Promise(function(_0x503350,_0x22013c){return db[_0x0fb4('0x1a')][_0x0fb4('0x1b')](_0x269ed3[_0x0fb4('0x1c')],{'raw':_0x269ed3[_0x0fb4('0x1d')]?_0x269ed3[_0x0fb4('0x1d')][_0x0fb4('0x1e')]===undefined?!![]:![]:!![]})[_0x0fb4('0x1f')](function(_0x3da5d9){logger['info'](_0x0fb4('0x19'),_0x269ed3);logger['debug'](_0x0fb4('0x19'),_0x269ed3,JSON[_0x0fb4('0x12')](_0x3da5d9));_0x503350(_0x3da5d9);})[_0x0fb4('0x20')](function(_0x3f30b9){logger[_0x0fb4('0x13')]('CreateWhatsappMessage',_0x3f30b9[_0x0fb4('0x15')],_0x269ed3);_0x22013c(_0x16a872[_0x0fb4('0x13')](0x1f4,_0x3f30b9[_0x0fb4('0x15')]));});});}; \ No newline at end of file +var _0x15c3=['options','raw','lodash','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body'];(function(_0x5d6890,_0x124770){var _0x360561=function(_0x149dfc){while(--_0x149dfc){_0x5d6890['push'](_0x5d6890['shift']());}};_0x360561(++_0x124770);}(_0x15c3,0x1d2));var _0x315c=function(_0x13a2bf,_0x21acf4){_0x13a2bf=_0x13a2bf-0x0;var _0x4f7617=_0x15c3[_0x13a2bf];return _0x4f7617;};'use strict';var _=require(_0x315c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x315c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x315c('0x2'));var logger=require(_0x315c('0x3'))('rpc');var config=require(_0x315c('0x4'));var jayson=require(_0x315c('0x5'));var client=jayson[_0x315c('0x6')]['http']({'port':0x232a});config[_0x315c('0x7')]=_[_0x315c('0x8')](config[_0x315c('0x7')],{'host':_0x315c('0x9'),'port':0x18eb});var socket=require(_0x315c('0xa'))(new Redis(config[_0x315c('0x7')]));require('./whatsappMessage.socket')[_0x315c('0xb')](socket);function respondWithRpcPromise(_0x5c8dd9,_0x1de02e,_0x43fe49){return new BPromise(function(_0xf67a6,_0x32230d){return client['request'](_0x5c8dd9,_0x43fe49)[_0x315c('0xc')](function(_0x306e5e){logger[_0x315c('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x1de02e,_0x315c('0xe'));logger[_0x315c('0xf')](_0x315c('0x10'),_0x1de02e,'request\x20sent',JSON[_0x315c('0x11')](_0x306e5e));if(_0x306e5e[_0x315c('0x12')]){if(_0x306e5e[_0x315c('0x12')][_0x315c('0x13')]===0x1f4){logger[_0x315c('0x12')](_0x315c('0x14'),_0x1de02e,_0x306e5e['error'][_0x315c('0x15')]);return _0x32230d(_0x306e5e[_0x315c('0x12')][_0x315c('0x15')]);}logger[_0x315c('0x12')](_0x315c('0x14'),_0x1de02e,_0x306e5e[_0x315c('0x12')][_0x315c('0x15')]);return _0xf67a6(_0x306e5e[_0x315c('0x12')][_0x315c('0x15')]);}else{logger[_0x315c('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x1de02e,_0x315c('0xe'));_0xf67a6(_0x306e5e['result'][_0x315c('0x15')]);}})[_0x315c('0x16')](function(_0x13d804){logger[_0x315c('0x12')](_0x315c('0x14'),_0x1de02e,_0x13d804);_0x32230d(_0x13d804);});});}exports[_0x315c('0x17')]=function(_0x505dbc){var _0xeebeb5=this;return new Promise(function(_0x555664,_0x5f55b4){return db[_0x315c('0x18')][_0x315c('0x19')](_0x505dbc[_0x315c('0x1a')],{'raw':_0x505dbc[_0x315c('0x1b')]?_0x505dbc['options'][_0x315c('0x1c')]===undefined?!![]:![]:!![]})[_0x315c('0xc')](function(_0x4ea898){logger[_0x315c('0xd')](_0x315c('0x17'),_0x505dbc);logger['debug']('CreateWhatsappMessage',_0x505dbc,JSON[_0x315c('0x11')](_0x4ea898));_0x555664(_0x4ea898);})[_0x315c('0x16')](function(_0x443880){logger['error'](_0x315c('0x17'),_0x443880['message'],_0x505dbc);_0x5f55b4(_0xeebeb5[_0x315c('0x12')](0x1f4,_0x443880[_0x315c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f04cc85..68dca7d 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 _0x8da3=['emit','removeListener','register','length','save','remove'];(function(_0x23a6cc,_0x2a7796){var _0x1f4dfc=function(_0x338bf9){while(--_0x338bf9){_0x23a6cc['push'](_0x23a6cc['shift']());}};_0x1f4dfc(++_0x2a7796);}(_0x8da3,0x7c));var _0x38da=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x8da3[_0x3ce3c];return _0x55a2c9;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x38da('0x0'),_0x38da('0x1'),'update'];function createListener(_0x59b06b,_0x3aa8be){return function(_0x291b9c){_0x3aa8be[_0x38da('0x2')](_0x59b06b,_0x291b9c);};}function removeListener(_0x5af4ee,_0x30106e){return function(){WhatsappMessageEvents[_0x38da('0x3')](_0x5af4ee,_0x30106e);};}exports[_0x38da('0x4')]=function(_0x3ed570){for(var _0x4e999c=0x0,_0x207b19=events[_0x38da('0x5')];_0x4e999c<_0x207b19;_0x4e999c++){var _0x5ced69=events[_0x4e999c];var _0x3828aa=createListener('whatsappMessage:'+_0x5ced69,_0x3ed570);WhatsappMessageEvents['on'](_0x5ced69,_0x3828aa);}}; \ No newline at end of file +var _0x45ca=['register','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x45ca,0x16b));var _0xa45c=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x45ca[_0x2f1762];return _0x8ab21;};'use strict';var WhatsappMessageEvents=require(_0xa45c('0x0'));var events=[_0xa45c('0x1'),_0xa45c('0x2'),'update'];function createListener(_0xa26842,_0x509bd0){return function(_0x12aa93){_0x509bd0[_0xa45c('0x3')](_0xa26842,_0x12aa93);};}function removeListener(_0x22fc29,_0x19e68e){return function(){WhatsappMessageEvents[_0xa45c('0x4')](_0x22fc29,_0x19e68e);};}exports[_0xa45c('0x5')]=function(_0x5377a7){for(var _0x5edf0b=0x0,_0x4d1f83=events[_0xa45c('0x6')];_0x5edf0b<_0x4d1f83;_0x5edf0b++){var _0x9ab5d5=events[_0x5edf0b];var _0x4b68dc=createListener(_0xa45c('0x7')+_0x9ab5d5,_0x5377a7);WhatsappMessageEvents['on'](_0x9ab5d5,_0x4b68dc);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 073182f..fcf9600 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 _0xe0a4=['addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams'];(function(_0x29a718,_0x10099d){var _0x5ed716=function(_0x832c3){while(--_0x832c3){_0x29a718['push'](_0x29a718['shift']());}};_0x5ed716(++_0x10099d);}(_0xe0a4,0x18d));var _0x4e0a=function(_0x3b4fbd,_0x108047){_0x3b4fbd=_0x3b4fbd-0x0;var _0x3e43dc=_0xe0a4[_0x3b4fbd];return _0x3e43dc;};'use strict';var multer=require(_0x4e0a('0x0'));var util=require('util');var path=require(_0x4e0a('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e0a('0x2'));var router=express[_0x4e0a('0x3')]();var fs_extra=require(_0x4e0a('0x4'));var auth=require(_0x4e0a('0x5'));var interaction=require(_0x4e0a('0x6'));var config=require(_0x4e0a('0x7'));var controller=require(_0x4e0a('0x8'));router[_0x4e0a('0x9')]('/',auth[_0x4e0a('0xa')](),controller[_0x4e0a('0xb')]);router[_0x4e0a('0x9')](_0x4e0a('0xc'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0xd')]);router[_0x4e0a('0x9')](_0x4e0a('0xe'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0xf')]);router[_0x4e0a('0x9')](_0x4e0a('0x10'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x11')]);router['get'](_0x4e0a('0x12'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x13')]);router['get'](_0x4e0a('0x14'),auth[_0x4e0a('0xa')](),controller['getAgents']);router[_0x4e0a('0x15')]('/',auth[_0x4e0a('0xa')](),controller['create']);router['post'](_0x4e0a('0x12'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x16')]);router[_0x4e0a('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x4e0a('0x17')]);router['put'](_0x4e0a('0xe'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x18')]);router[_0x4e0a('0x19')]('/:id',auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x1a')]);router[_0x4e0a('0x19')](_0x4e0a('0x12'),auth[_0x4e0a('0xa')](),controller[_0x4e0a('0x1b')]);router[_0x4e0a('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x4e0a('0x1c')]);module[_0x4e0a('0x1d')]=router; \ No newline at end of file +var _0x00b2=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/members'];(function(_0x6b9266,_0x2afdb1){var _0x1ad2c1=function(_0x50f867){while(--_0x50f867){_0x6b9266['push'](_0x6b9266['shift']());}};_0x1ad2c1(++_0x2afdb1);}(_0x00b2,0xbd));var _0x200b=function(_0x5856ba,_0x55f7a7){_0x5856ba=_0x5856ba-0x0;var _0x1311bf=_0x00b2[_0x5856ba];return _0x1311bf;};'use strict';var multer=require(_0x200b('0x0'));var util=require('util');var path=require(_0x200b('0x1'));var timeout=require(_0x200b('0x2'));var express=require(_0x200b('0x3'));var router=express[_0x200b('0x4')]();var fs_extra=require(_0x200b('0x5'));var auth=require(_0x200b('0x6'));var interaction=require(_0x200b('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x200b('0x8')]('/',auth[_0x200b('0x9')](),controller[_0x200b('0xa')]);router['get']('/describe',auth[_0x200b('0x9')](),controller['describe']);router[_0x200b('0x8')](_0x200b('0xb'),auth[_0x200b('0x9')](),controller[_0x200b('0xc')]);router[_0x200b('0x8')](_0x200b('0xd'),auth[_0x200b('0x9')](),controller[_0x200b('0xe')]);router[_0x200b('0x8')](_0x200b('0xf'),auth[_0x200b('0x9')](),controller[_0x200b('0x10')]);router[_0x200b('0x8')](_0x200b('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x200b('0x12')]('/',auth[_0x200b('0x9')](),controller[_0x200b('0x13')]);router[_0x200b('0x12')](_0x200b('0xf'),auth[_0x200b('0x9')](),controller[_0x200b('0x14')]);router['post'](_0x200b('0x11'),auth[_0x200b('0x9')](),controller[_0x200b('0x15')]);router[_0x200b('0x16')](_0x200b('0xb'),auth[_0x200b('0x9')](),controller[_0x200b('0x17')]);router[_0x200b('0x18')](_0x200b('0xb'),auth['isAuthenticated'](),controller[_0x200b('0x19')]);router[_0x200b('0x18')](_0x200b('0xf'),auth['isAuthenticated'](),controller[_0x200b('0x1a')]);router[_0x200b('0x18')](_0x200b('0x11'),auth[_0x200b('0x9')](),controller[_0x200b('0x1b')]);module[_0x200b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 71f20e9..b89d0e6 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 _0x2cbd=['roundrobin','sequelize','exports','name','INTEGER','ENUM','beepall'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x2cbd[_0x14e9f0];return _0xa63f7e;};'use strict';var Sequelize=require(_0xd2cb('0x0'));module[_0xd2cb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd2cb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd2cb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd2cb('0x4')]('rrmemory',_0xd2cb('0x5'),_0xd2cb('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x38a5=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x38a5,0x69));var _0x538a=function(_0x5d5198,_0xeb3810){_0x5d5198=_0x5d5198-0x0;var _0x43b777=_0x38a5[_0x5d5198];return _0x43b777;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'unique':_0x538a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x538a('0x4')](_0x538a('0x5'),_0x538a('0x6'),_0x538a('0x7'))},'description':{'type':Sequelize[_0x538a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 64150ae..43f8796 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 _0x3c91=['%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','transaction','addTeams','each','findOrCreate','userWhatsappQueue:save','removeTeams','select','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','TeamId','includes','union','value','removeAgents','forEach','emit','userWhatsappQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','WhatsappQueue','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','userProfileId','body','catch','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','pick','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','format'];(function(_0x962de1,_0x361057){var _0x14085a=function(_0x220dae){while(--_0x220dae){_0x962de1['push'](_0x962de1['shift']());}};_0x14085a(++_0x361057);}(_0x3c91,0x1bf));var _0x13c9=function(_0x1356ed,_0x4749a0){_0x1356ed=_0x1356ed-0x0;var _0x5d82d0=_0x3c91[_0x1356ed];return _0x5d82d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13c9('0x0'));var zipdir=require(_0x13c9('0x1'));var jsonpatch=require(_0x13c9('0x2'));var rp=require(_0x13c9('0x3'));var moment=require(_0x13c9('0x4'));var BPromise=require(_0x13c9('0x5'));var Mustache=require(_0x13c9('0x6'));var util=require(_0x13c9('0x7'));var path=require(_0x13c9('0x8'));var sox=require(_0x13c9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13c9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x13c9('0xb'));var toCsv=require(_0x13c9('0xc'));var querystring=require(_0x13c9('0xd'));var Papa=require(_0x13c9('0xe'));var Redis=require(_0x13c9('0xf'));var authService=require(_0x13c9('0x10'));var qs=require(_0x13c9('0x11'));var as=require(_0x13c9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13c9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x13c9('0x14'));var licenseUtil=require(_0x13c9('0x15'));var db=require(_0x13c9('0x16'))['db'];config[_0x13c9('0x17')]=_[_0x13c9('0x18')](config[_0x13c9('0x17')],{'host':_0x13c9('0x19'),'port':0x18eb});var socket=require(_0x13c9('0x1a'))(new Redis(config[_0x13c9('0x17')]));require(_0x13c9('0x1b'))[_0x13c9('0x1c')](socket);function respondWithStatusCode(_0x1198c0,_0x5a6f40){_0x5a6f40=_0x5a6f40||0xcc;return function(_0x1891f8){if(_0x1891f8){return _0x1198c0[_0x13c9('0x1d')](_0x5a6f40);}return _0x1198c0[_0x13c9('0x1e')](_0x5a6f40)['end']();};}function respondWithResult(_0x1767a7,_0x4ca867){_0x4ca867=_0x4ca867||0xc8;return function(_0x2c1491){if(_0x2c1491){return _0x1767a7[_0x13c9('0x1e')](_0x4ca867)[_0x13c9('0x1f')](_0x2c1491);}};}function respondWithFilteredResult(_0x22c5ef,_0x3ccba7){return function(_0x1e97ab){if(_0x1e97ab){var _0x48c1b1=typeof _0x3ccba7[_0x13c9('0x20')]===_0x13c9('0x21')&&typeof _0x3ccba7[_0x13c9('0x22')]==='undefined';var _0xe4e307=_0x1e97ab[_0x13c9('0x23')];var _0x255d79=_0x48c1b1?0x0:_0x3ccba7[_0x13c9('0x20')];var _0x29059f=_0x48c1b1?_0x1e97ab[_0x13c9('0x23')]:_0x3ccba7['offset']+_0x3ccba7[_0x13c9('0x22')];var _0x2ef2aa;if(_0x29059f>=_0xe4e307){_0x29059f=_0xe4e307;_0x2ef2aa=0xc8;}else{_0x2ef2aa=0xce;}_0x22c5ef[_0x13c9('0x1e')](_0x2ef2aa);return _0x22c5ef[_0x13c9('0x24')](_0x13c9('0x25'),_0x255d79+'-'+_0x29059f+'/'+_0xe4e307)['json'](_0x1e97ab);}return null;};}function patchUpdates(_0x4a8254){return function(_0x50d374){try{jsonpatch[_0x13c9('0x26')](_0x50d374,_0x4a8254,!![]);}catch(_0x2c1010){return BPromise[_0x13c9('0x27')](_0x2c1010);}return _0x50d374[_0x13c9('0x28')]();};}function saveUpdates(_0x401f46,_0xcea975){return function(_0xaf5fa8){if(_0xaf5fa8){return _0xaf5fa8[_0x13c9('0x29')](_0x401f46)[_0x13c9('0x2a')](function(_0x3b7bbf){return _0x3b7bbf;});}return null;};}function removeEntity(_0x775734,_0x4df021){return function(_0x350075){if(_0x350075){return _0x350075[_0x13c9('0x2b')]()[_0x13c9('0x2a')](function(){var _0x337a17=_0x350075[_0x13c9('0x2c')]({'plain':!![]});var _0x1924f6='WhatsappQueues';return db[_0x13c9('0x2d')][_0x13c9('0x2b')]({'where':{'type':_0x1924f6,'resourceId':_0x337a17['id']}})[_0x13c9('0x2a')](function(){return _0x350075;});})['then'](function(){_0x775734[_0x13c9('0x1e')](0xcc)[_0x13c9('0x2e')]();});}};}function handleEntityNotFound(_0x4c48f4,_0x2b1aff){return function(_0x3fb459){if(!_0x3fb459){_0x4c48f4[_0x13c9('0x1d')](0x194);}return _0x3fb459;};}function handleError(_0x5c2584,_0x1d67cd){_0x1d67cd=_0x1d67cd||0x1f4;return function(_0x336c5c){logger[_0x13c9('0x2f')](_0x336c5c[_0x13c9('0x30')]);if(_0x336c5c[_0x13c9('0x31')]){delete _0x336c5c[_0x13c9('0x31')];}_0x5c2584[_0x13c9('0x1e')](_0x1d67cd)['send'](_0x336c5c);};}exports[_0x13c9('0x32')]=function(_0x2872ee,_0x31b905){var _0x3db81={},_0xb9a0b2={},_0x5be194={'count':0x0,'rows':[]};var _0x85b242=_['map'](db[_0x13c9('0x33')]['rawAttributes'],function(_0x7e7da){return{'name':_0x7e7da[_0x13c9('0x34')],'type':_0x7e7da[_0x13c9('0x35')][_0x13c9('0x36')]};});_0xb9a0b2[_0x13c9('0x37')]=_[_0x13c9('0x38')](_0x85b242,'name');_0xb9a0b2['query']=_[_0x13c9('0x39')](_0x2872ee[_0x13c9('0x3a')]);_0xb9a0b2[_0x13c9('0x3b')]=_[_0x13c9('0x3c')](_0xb9a0b2['model'],_0xb9a0b2[_0x13c9('0x3a')]);_0x3db81[_0x13c9('0x3d')]=_[_0x13c9('0x3c')](_0xb9a0b2[_0x13c9('0x37')],qs[_0x13c9('0x3e')](_0x2872ee['query']['fields']));_0x3db81[_0x13c9('0x3d')]=_0x3db81['attributes'][_0x13c9('0x3f')]?_0x3db81[_0x13c9('0x3d')]:_0xb9a0b2['model'];if(!_0x2872ee[_0x13c9('0x3a')][_0x13c9('0x40')](_0x13c9('0x41'))){_0x3db81['limit']=qs['limit'](_0x2872ee[_0x13c9('0x3a')][_0x13c9('0x22')]);_0x3db81[_0x13c9('0x20')]=qs['offset'](_0x2872ee['query'][_0x13c9('0x20')]);}_0x3db81[_0x13c9('0x42')]=qs['sort'](_0x2872ee['query'][_0x13c9('0x43')]);_0x3db81[_0x13c9('0x44')]=qs[_0x13c9('0x3b')](_['pick'](_0x2872ee[_0x13c9('0x3a')],_0xb9a0b2['filters']),_0x85b242);if(_0x2872ee[_0x13c9('0x3a')][_0x13c9('0x45')]){_0x3db81[_0x13c9('0x44')]=_[_0x13c9('0x46')](_0x3db81['where'],{'$or':_[_0x13c9('0x38')](_0x85b242,function(_0x3d18ed){if(_0x3d18ed[_0x13c9('0x35')]!==_0x13c9('0x47')){var _0x5a708f={};_0x5a708f[_0x3d18ed['name']]={'$like':'%'+_0x2872ee[_0x13c9('0x3a')]['filter']+'%'};return _0x5a708f;}})});}_0x3db81=_[_0x13c9('0x46')]({},_0x3db81,_0x2872ee[_0x13c9('0x48')]);var _0x59801c={'where':_0x3db81[_0x13c9('0x44')]};return db[_0x13c9('0x33')][_0x13c9('0x23')](_0x59801c)['then'](function(_0x26b0f5){_0x5be194[_0x13c9('0x23')]=_0x26b0f5;if(_0x2872ee[_0x13c9('0x3a')][_0x13c9('0x49')]){_0x3db81[_0x13c9('0x4a')]=[{'all':!![]}];}return db[_0x13c9('0x33')][_0x13c9('0x4b')](_0x3db81);})[_0x13c9('0x2a')](function(_0x4604d6){_0x5be194[_0x13c9('0x4c')]=_0x4604d6;return _0x5be194;})['then'](respondWithFilteredResult(_0x31b905,_0x3db81))['catch'](handleError(_0x31b905,null));};exports[_0x13c9('0x4d')]=function(_0x552336,_0x2be81c){var _0x17d169={'raw':!![],'where':{'id':_0x552336[_0x13c9('0x4e')]['id']}},_0x45fbb6={};_0x45fbb6[_0x13c9('0x37')]=_[_0x13c9('0x39')](db[_0x13c9('0x33')]['rawAttributes']);_0x45fbb6[_0x13c9('0x3a')]=_[_0x13c9('0x39')](_0x552336[_0x13c9('0x3a')]);_0x45fbb6['filters']=_['intersection'](_0x45fbb6['model'],_0x45fbb6['query']);_0x17d169['attributes']=_[_0x13c9('0x3c')](_0x45fbb6[_0x13c9('0x37')],qs[_0x13c9('0x3e')](_0x552336['query'][_0x13c9('0x3e')]));_0x17d169[_0x13c9('0x3d')]=_0x17d169[_0x13c9('0x3d')][_0x13c9('0x3f')]?_0x17d169['attributes']:_0x45fbb6[_0x13c9('0x37')];if(_0x552336[_0x13c9('0x3a')][_0x13c9('0x49')]){_0x17d169['include']=[{'all':!![]}];}_0x17d169=_[_0x13c9('0x46')]({},_0x17d169,_0x552336['options']);return db[_0x13c9('0x33')][_0x13c9('0x4f')](_0x17d169)[_0x13c9('0x2a')](handleEntityNotFound(_0x2be81c,null))[_0x13c9('0x2a')](respondWithResult(_0x2be81c,null))['catch'](handleError(_0x2be81c,null));};exports[_0x13c9('0x50')]=function(_0x24f23a,_0xb8e45){return db['WhatsappQueue'][_0x13c9('0x50')](_0x24f23a['body'],{})[_0x13c9('0x2a')](function(_0x4550c7){var _0x30e2f9=_0x24f23a[_0x13c9('0x51')][_0x13c9('0x2c')]({'plain':!![]});if(!_0x30e2f9)throw new Error(_0x13c9('0x52'));if(_0x30e2f9['role']===_0x13c9('0x51')){var _0x263847=_0x4550c7[_0x13c9('0x2c')]({'plain':!![]});var _0x23776a=_0x13c9('0x53');return db[_0x13c9('0x54')][_0x13c9('0x4f')]({'where':{'name':_0x23776a,'userProfileId':_0x30e2f9[_0x13c9('0x55')]},'raw':!![]})['then'](function(_0x4d15c5){if(_0x4d15c5&&_0x4d15c5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x263847[_0x13c9('0x31')],'resourceId':_0x263847['id'],'type':_0x4d15c5[_0x13c9('0x31')],'sectionId':_0x4d15c5['id']},{})['then'](function(){return _0x4550c7;});}else{return _0x4550c7;}})['catch'](function(_0x255d5e){logger[_0x13c9('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x255d5e);throw _0x255d5e;});}return _0x4550c7;})[_0x13c9('0x2a')](respondWithResult(_0xb8e45,0xc9))['catch'](handleError(_0xb8e45,null));};exports[_0x13c9('0x29')]=function(_0x2072f7,_0x510b7c){if(_0x2072f7[_0x13c9('0x56')]['id']){delete _0x2072f7[_0x13c9('0x56')]['id'];}return db['WhatsappQueue'][_0x13c9('0x4f')]({'where':{'id':_0x2072f7[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x510b7c,null))['then'](saveUpdates(_0x2072f7['body'],null))[_0x13c9('0x2a')](respondWithResult(_0x510b7c,null))[_0x13c9('0x57')](handleError(_0x510b7c,null));};exports[_0x13c9('0x2b')]=function(_0x354a18,_0x433a4f){return db[_0x13c9('0x33')][_0x13c9('0x4f')]({'where':{'id':_0x354a18[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x433a4f,null))[_0x13c9('0x2a')](removeEntity(_0x433a4f,null))[_0x13c9('0x57')](handleError(_0x433a4f,null));};exports['describe']=function(_0x55b9d,_0x1eb313){return db[_0x13c9('0x33')][_0x13c9('0x58')]()[_0x13c9('0x2a')](respondWithResult(_0x1eb313,null))[_0x13c9('0x57')](handleError(_0x1eb313,null));};exports[_0x13c9('0x59')]=function(_0x19e29f,_0x5c22dc,_0x1cd3d9){var _0x55dc07={'raw':!![],'where':{}},_0x26fd46={},_0x182899;return db[_0x13c9('0x33')][_0x13c9('0x5a')]({'where':{'id':_0x19e29f[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x5c22dc,null))[_0x13c9('0x2a')](function(_0x47394c){if(_0x47394c){_0x182899=_0x47394c[_0x13c9('0x2c')]({'plain':!![]});_0x26fd46[_0x13c9('0x37')]=_[_0x13c9('0x39')](db[_0x13c9('0x5b')][_0x13c9('0x5c')]);_0x26fd46[_0x13c9('0x3a')]=_[_0x13c9('0x39')](_0x19e29f['query']);_0x26fd46['filters']=_[_0x13c9('0x3c')](_0x26fd46[_0x13c9('0x37')],_0x26fd46['query']);_0x55dc07[_0x13c9('0x3d')]=_[_0x13c9('0x3c')](_0x26fd46['model'],qs[_0x13c9('0x3e')](_0x19e29f[_0x13c9('0x3a')][_0x13c9('0x3e')]));_0x55dc07[_0x13c9('0x3d')]=_0x55dc07[_0x13c9('0x3d')][_0x13c9('0x3f')]?_0x55dc07[_0x13c9('0x3d')]:_0x26fd46[_0x13c9('0x37')];if(!_0x19e29f[_0x13c9('0x3a')][_0x13c9('0x40')](_0x13c9('0x41'))){_0x55dc07[_0x13c9('0x22')]=qs[_0x13c9('0x22')](_0x19e29f[_0x13c9('0x3a')]['limit']);_0x55dc07[_0x13c9('0x20')]=qs[_0x13c9('0x20')](_0x19e29f[_0x13c9('0x3a')]['offset']);}_0x55dc07['order']=qs['sort'](_0x19e29f[_0x13c9('0x3a')]['sort']);_0x55dc07[_0x13c9('0x44')]=qs['filters'](_[_0x13c9('0x5d')](_0x19e29f[_0x13c9('0x3a')],_0x26fd46['filters']));_0x55dc07[_0x13c9('0x44')][_0x13c9('0x5e')]=_0x47394c['id'];if(_0x19e29f[_0x13c9('0x3a')][_0x13c9('0x45')]){_0x55dc07[_0x13c9('0x44')]=_[_0x13c9('0x46')](_0x55dc07[_0x13c9('0x44')],{'$or':_[_0x13c9('0x38')](_0x55dc07[_0x13c9('0x3d')],function(_0x5de4df){var _0x34fc86={};_0x34fc86[_0x5de4df]={'$like':'%'+_0x19e29f[_0x13c9('0x3a')][_0x13c9('0x45')]+'%'};return _0x34fc86;})});}_0x55dc07=_['merge']({},_0x55dc07,_0x19e29f[_0x13c9('0x48')]);return db[_0x13c9('0x5b')][_0x13c9('0x4b')](_0x55dc07);}})['then'](function(_0x199659){if(_0x199659){return db[_0x13c9('0x5f')][_0x13c9('0x60')]({'where':{'id':_[_0x13c9('0x38')](_0x199659,'UserId'),'role':_0x13c9('0x61')},'attributes':['id',_0x13c9('0x31'),_0x13c9('0x62'),_0x13c9('0x63'),'createdAt']});}})[_0x13c9('0x2a')](function(_0x502f7b){if(_0x502f7b){return{'count':_0x502f7b['count'],'rows':_[_0x13c9('0x38')](_0x502f7b[_0x13c9('0x4c')],function(_0x1416af){return{'membername':_0x1416af[_0x13c9('0x31')],'UserId':_0x1416af['id'],'queue_name':_0x182899[_0x13c9('0x31')],'WhatsappQueueId':_0x182899['id'],'interface':util[_0x13c9('0x64')](_0x13c9('0x65'),_0x13c9('0x66'),_0x1416af[_0x13c9('0x31')]),'penalty':0x0,'paused':_0x1416af[_0x13c9('0x62')],'createdAt':_0x1416af['createdAt'],'updatedAt':_0x1416af[_0x13c9('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x13c9('0x2a')](respondWithFilteredResult(_0x5c22dc,_0x55dc07))[_0x13c9('0x57')](handleError(_0x5c22dc,null));};exports[_0x13c9('0x67')]=function(_0x3adff3,_0x16523a,_0x2ba50d){var _0x498f17={};var _0x104397={};var _0x2a4f54;var _0x37c198;return db[_0x13c9('0x33')][_0x13c9('0x5a')]({'where':{'id':_0x3adff3[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x16523a,null))[_0x13c9('0x2a')](function(_0x418a2d){if(_0x418a2d){_0x2a4f54=_0x418a2d;_0x104397[_0x13c9('0x37')]=_[_0x13c9('0x39')](db[_0x13c9('0x68')][_0x13c9('0x5c')]);_0x104397[_0x13c9('0x3a')]=_[_0x13c9('0x39')](_0x3adff3[_0x13c9('0x3a')]);_0x104397[_0x13c9('0x3b')]=_['intersection'](_0x104397['model'],_0x104397[_0x13c9('0x3a')]);_0x498f17['attributes']=_[_0x13c9('0x3c')](_0x104397[_0x13c9('0x37')],qs[_0x13c9('0x3e')](_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x3e')]));_0x498f17[_0x13c9('0x3d')]=_0x498f17[_0x13c9('0x3d')][_0x13c9('0x3f')]?_0x498f17[_0x13c9('0x3d')]:_0x104397[_0x13c9('0x37')];_0x498f17[_0x13c9('0x42')]=qs['sort'](_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x43')]);_0x498f17[_0x13c9('0x44')]=qs[_0x13c9('0x3b')](_[_0x13c9('0x5d')](_0x3adff3[_0x13c9('0x3a')],_0x104397['filters']));if(_0x3adff3['query'][_0x13c9('0x45')]){_0x498f17[_0x13c9('0x44')]=_[_0x13c9('0x46')](_0x498f17[_0x13c9('0x44')],{'$or':_[_0x13c9('0x38')](_0x498f17['attributes'],function(_0x425954){var _0x2d808c={};_0x2d808c[_0x425954]={'$like':'%'+_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x45')]+'%'};return _0x2d808c;})});}_0x498f17=_[_0x13c9('0x46')]({},_0x498f17,_0x3adff3['options']);return _0x2a4f54[_0x13c9('0x67')](_0x498f17);}})[_0x13c9('0x2a')](function(_0x56ffa6){if(_0x56ffa6){_0x37c198=_0x56ffa6['length'];if(!_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x40')]('nolimit')){_0x498f17[_0x13c9('0x22')]=qs['limit'](_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x22')]);_0x498f17[_0x13c9('0x20')]=qs[_0x13c9('0x20')](_0x3adff3[_0x13c9('0x3a')][_0x13c9('0x20')]);}return _0x2a4f54[_0x13c9('0x67')](_0x498f17);}})[_0x13c9('0x2a')](function(_0x134bc6){if(_0x134bc6){return _0x134bc6?{'count':_0x37c198,'rows':_0x134bc6}:null;}})[_0x13c9('0x2a')](respondWithResult(_0x16523a,null))[_0x13c9('0x57')](handleError(_0x16523a,null));};exports['addTeams']=function(_0x209425,_0x50f5ad,_0x23ab53){var _0x1e953b=_0x209425['body'][_0x13c9('0x69')];return db[_0x13c9('0x68')][_0x13c9('0x4b')]({'where':{'id':_0x1e953b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x13c9('0x6a'),'attributes':['id',_0x13c9('0x31'),_0x13c9('0x6b'),'voicePause',_0x13c9('0x6c')],'raw':!![]}]})[_0x13c9('0x2a')](function(_0x1ef26c){if(_0x1ef26c){var _0x420601=_['flatMap'](_0x1ef26c,function(_0x26a3e8){var _0x282d63=_0x26a3e8['get']({'plain':!![]});return _0x282d63['Agents'];});return db['WhatsappQueue'][_0x13c9('0x4f')]({'where':{'id':_0x209425['params']['id']}})[_0x13c9('0x2a')](function(_0x5e0b9e){return db['sequelize'][_0x13c9('0x6d')](function(_0x43350b){return _0x5e0b9e[_0x13c9('0x6e')](_0x1e953b,{'transaction':_0x43350b})['then'](function(){return BPromise[_0x13c9('0x6f')](_0x420601,function(_0xc3d518){return db[_0x13c9('0x5b')][_0x13c9('0x70')]({'where':{'UserId':_0xc3d518['id'],'WhatsappQueueId':_0x209425['params']['id']},'transaction':_0x43350b});});})['then'](function(){_0x420601['forEach'](function(_0x1214ef){socket['emit'](_0x13c9('0x71'),{'UserId':_0x1214ef['id'],'WhatsappQueueId':_0x5e0b9e['id']});});});});});}})['then'](respondWithStatusCode(_0x50f5ad,null))[_0x13c9('0x57')](handleError(_0x50f5ad,null));};exports[_0x13c9('0x72')]=function(_0x4101be,_0x3a474c,_0x41a834){return db[_0x13c9('0x68')][_0x13c9('0x4b')]({'where':{'id':_0x4101be[_0x13c9('0x3a')][_0x13c9('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x13c9('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x13c9('0x2a')](handleEntityNotFound(_0x3a474c,null))[_0x13c9('0x2a')](function(_0x210d1a){var _0x1e4fa3=_['map'](_0x210d1a,'id');var _0x5913bf=[];var _0x27696d=[];var _0x3bed15=squel[_0x13c9('0x73')]();_0x3bed15['field'](_0x13c9('0x74'))['from'](_0x13c9('0x75'),'tq')[_0x13c9('0x76')]('user_has_teams','ut',_0x13c9('0x77'))[_0x13c9('0x44')]('WhatsappQueueId\x20=\x20?',_0x4101be[_0x13c9('0x4e')]['id']);for(var _0xca142f=0x0;_0xca142f<_0x210d1a[_0x13c9('0x3f')];_0xca142f+=0x1){let _0x2cfc62=_0x210d1a[_0xca142f];for(var _0x5c3145=0x0;_0x5c3145<_0x2cfc62[_0x13c9('0x6a')][_0x13c9('0x3f')];_0x5c3145+=0x1){let _0xfa53d4=_0x2cfc62[_0x13c9('0x6a')][_0x5c3145];var _0x1de4ef=_0x3bed15[_0x13c9('0x78')]();_0x1de4ef['where'](_0x13c9('0x79'),_0xfa53d4['id']);_0x27696d[_0x13c9('0x7a')](db[_0x13c9('0x7b')][_0x13c9('0x3a')](_0x1de4ef[_0x13c9('0x7c')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x13c9('0x2a')](function(_0x101eab){if(_0x101eab['length']===0x1){return _0xfa53d4['id'];}else{var _0x51c1ba=_['every'](_[_0x13c9('0x38')](_0x101eab,_0x13c9('0x7d')),function(_0x11c18c){return _[_0x13c9('0x7e')](_0x1e4fa3,_0x11c18c);});if(_0x51c1ba){return _0xfa53d4['id'];}}}));}}return BPromise['all'](_0x27696d)['then'](function(_0x46af94){_0x5913bf=_(_0x5913bf)[_0x13c9('0x7f')](_0x46af94)['compact']()[_0x13c9('0x80')]();return db[_0x13c9('0x33')][_0x13c9('0x4f')]({'where':{'id':_0x4101be[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](function(_0x5072a5){return db[_0x13c9('0x7b')][_0x13c9('0x6d')](function(_0x4eddf7){return _0x5072a5['removeTeams'](_0x4101be[_0x13c9('0x3a')][_0x13c9('0x69')],{'transaction':_0x4eddf7})[_0x13c9('0x2a')](function(){if(!_['isEmpty'](_0x5913bf)){return _0x5072a5[_0x13c9('0x81')](_0x5913bf,{'transaction':_0x4eddf7});}})[_0x13c9('0x2a')](function(){_0x5913bf[_0x13c9('0x82')](function(_0x9c160b){socket[_0x13c9('0x83')](_0x13c9('0x84'),{'UserId':_0x9c160b,'WhatsappQueueId':_0x5072a5['id']});});});});});});})[_0x13c9('0x2a')](respondWithStatusCode(_0x3a474c,null))[_0x13c9('0x57')](handleError(_0x3a474c,null));};exports['addAgents']=function(_0x5a2f5b,_0x204f9b,_0x14552f){return db[_0x13c9('0x33')][_0x13c9('0x4f')]({'where':{'id':_0x5a2f5b['params']['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x204f9b,null))['then'](function(_0x1777bf){if(_0x1777bf){return _0x1777bf['addAgents'](_0x5a2f5b['body'][_0x13c9('0x69')],_[_0x13c9('0x85')](_0x5a2f5b[_0x13c9('0x56')],[_0x13c9('0x69'),'id'])||{})[_0x13c9('0x86')](function(_0xdcaa8b){for(var _0x31fd5=0x0;_0x31fd5<_0x5a2f5b[_0x13c9('0x56')][_0x13c9('0x69')][_0x13c9('0x3f')];_0x31fd5+=0x1){socket[_0x13c9('0x83')](_0x13c9('0x71'),{'UserId':Number(_0x5a2f5b[_0x13c9('0x56')][_0x13c9('0x69')][_0x31fd5]),'WhatsappQueueId':Number(_0x5a2f5b['params']['id'])});}return _0xdcaa8b;});}})[_0x13c9('0x2a')](respondWithResult(_0x204f9b,null))[_0x13c9('0x57')](handleError(_0x204f9b,null));};exports[_0x13c9('0x81')]=function(_0x29b408,_0x322429,_0x39d063){return db[_0x13c9('0x33')]['find']({'where':{'id':_0x29b408[_0x13c9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x322429,null))[_0x13c9('0x2a')](function(_0x5e9c23){if(_0x5e9c23){return _0x5e9c23[_0x13c9('0x81')](_0x29b408[_0x13c9('0x3a')][_0x13c9('0x69')])[_0x13c9('0x2a')](function(){if(_[_0x13c9('0x87')](_0x29b408['query']['ids'])){for(var _0x5915a2=0x0;_0x5915a2<_0x29b408[_0x13c9('0x3a')][_0x13c9('0x69')][_0x13c9('0x3f')];_0x5915a2+=0x1){socket[_0x13c9('0x83')](_0x13c9('0x84'),{'UserId':Number(_0x29b408[_0x13c9('0x3a')][_0x13c9('0x69')][_0x5915a2]),'WhatsappQueueId':Number(_0x29b408['params']['id'])});}}else{socket[_0x13c9('0x83')](_0x13c9('0x84'),{'UserId':Number(_0x29b408['query'][_0x13c9('0x69')]),'WhatsappQueueId':Number(_0x29b408[_0x13c9('0x4e')]['id'])});}});}})[_0x13c9('0x2a')](respondWithStatusCode(_0x322429,null))[_0x13c9('0x57')](handleError(_0x322429,null));};exports['getAgents']=function(_0x3bc62d,_0x42eef3,_0x125a02){var _0x45643d={};var _0x541a62={};var _0x2f9523;var _0x40682c;return db['WhatsappQueue'][_0x13c9('0x5a')]({'where':{'id':_0x3bc62d[_0x13c9('0x4e')]['id']}})[_0x13c9('0x2a')](handleEntityNotFound(_0x42eef3,null))[_0x13c9('0x2a')](function(_0x43b607){if(_0x43b607){_0x2f9523=_0x43b607;_0x541a62[_0x13c9('0x37')]=_[_0x13c9('0x39')](db['User']['rawAttributes']);_0x541a62[_0x13c9('0x3a')]=_[_0x13c9('0x39')](_0x3bc62d[_0x13c9('0x3a')]);_0x541a62['filters']=_[_0x13c9('0x3c')](_0x541a62[_0x13c9('0x37')],_0x541a62[_0x13c9('0x3a')]);_0x45643d[_0x13c9('0x3d')]=_[_0x13c9('0x3c')](_0x541a62[_0x13c9('0x37')],qs[_0x13c9('0x3e')](_0x3bc62d['query'][_0x13c9('0x3e')]));_0x45643d[_0x13c9('0x3d')]=_0x45643d[_0x13c9('0x3d')][_0x13c9('0x3f')]?_0x45643d[_0x13c9('0x3d')]:_0x541a62['model'];_0x45643d['order']=qs[_0x13c9('0x43')](_0x3bc62d[_0x13c9('0x3a')]['sort']);_0x45643d[_0x13c9('0x44')]=qs['filters'](_[_0x13c9('0x5d')](_0x3bc62d[_0x13c9('0x3a')],_0x541a62[_0x13c9('0x3b')]));if(_0x3bc62d[_0x13c9('0x3a')][_0x13c9('0x45')]){_0x45643d[_0x13c9('0x44')]=_['merge'](_0x45643d[_0x13c9('0x44')],{'$or':_[_0x13c9('0x38')](_0x45643d['attributes'],function(_0x25cb62){var _0x535ad9={};_0x535ad9[_0x25cb62]={'$like':'%'+_0x3bc62d['query'][_0x13c9('0x45')]+'%'};return _0x535ad9;})});}_0x45643d=_[_0x13c9('0x46')]({},_0x45643d,_0x3bc62d['options']);return _0x2f9523[_0x13c9('0x88')](_0x45643d);}})[_0x13c9('0x2a')](function(_0x1cb2d2){if(_0x1cb2d2){_0x40682c=_0x1cb2d2[_0x13c9('0x3f')];if(!_0x3bc62d['query'][_0x13c9('0x40')](_0x13c9('0x41'))){_0x45643d[_0x13c9('0x22')]=qs[_0x13c9('0x22')](_0x3bc62d['query'][_0x13c9('0x22')]);_0x45643d[_0x13c9('0x20')]=qs[_0x13c9('0x20')](_0x3bc62d['query'][_0x13c9('0x20')]);}return _0x2f9523[_0x13c9('0x88')](_0x45643d);}})[_0x13c9('0x2a')](function(_0x5e8301){if(_0x5e8301){return _0x5e8301?{'count':_0x40682c,'rows':_0x5e8301}:null;}})[_0x13c9('0x2a')](respondWithResult(_0x42eef3,null))[_0x13c9('0x57')](handleError(_0x42eef3,null));}; \ No newline at end of file +var _0x5730=['isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappQueues','UserProfileResource','then','error','stack','name','send','map','WhatsappQueue','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserWhatsappQueue','length','hasOwnProperty','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','intersection','addTeams','Agents','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread'];(function(_0x147003,_0x36e2e3){var _0x5167b2=function(_0x5b54da){while(--_0x5b54da){_0x147003['push'](_0x147003['shift']());}};_0x5167b2(++_0x36e2e3);}(_0x5730,0x93));var _0x0573=function(_0x5c6271,_0x5a56af){_0x5c6271=_0x5c6271-0x0;var _0x1cbef1=_0x5730[_0x5c6271];return _0x1cbef1;};'use strict';var emlformat=require(_0x0573('0x0'));var rimraf=require(_0x0573('0x1'));var zipdir=require(_0x0573('0x2'));var jsonpatch=require(_0x0573('0x3'));var rp=require(_0x0573('0x4'));var moment=require('moment');var BPromise=require(_0x0573('0x5'));var Mustache=require(_0x0573('0x6'));var util=require(_0x0573('0x7'));var path=require(_0x0573('0x8'));var sox=require(_0x0573('0x9'));var csv=require(_0x0573('0xa'));var ejs=require(_0x0573('0xb'));var fs=require('fs');var fs_extra=require(_0x0573('0xc'));var _=require(_0x0573('0xd'));var squel=require(_0x0573('0xe'));var crypto=require(_0x0573('0xf'));var jsforce=require(_0x0573('0x10'));var deskjs=require(_0x0573('0x11'));var toCsv=require(_0x0573('0xa'));var querystring=require(_0x0573('0x12'));var Papa=require('papaparse');var Redis=require(_0x0573('0x13'));var authService=require(_0x0573('0x14'));var qs=require(_0x0573('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0573('0x16'));var utils=require(_0x0573('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0573('0x18'))['db'];config['redis']=_[_0x0573('0x19')](config[_0x0573('0x1a')],{'host':_0x0573('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0573('0x1a')]));require(_0x0573('0x1c'))[_0x0573('0x1d')](socket);function respondWithStatusCode(_0x43183a,_0x552262){_0x552262=_0x552262||0xcc;return function(_0x31af4a){if(_0x31af4a){return _0x43183a[_0x0573('0x1e')](_0x552262);}return _0x43183a[_0x0573('0x1f')](_0x552262)[_0x0573('0x20')]();};}function respondWithResult(_0x2626d3,_0x466862){_0x466862=_0x466862||0xc8;return function(_0x4d884d){if(_0x4d884d){return _0x2626d3[_0x0573('0x1f')](_0x466862)[_0x0573('0x21')](_0x4d884d);}};}function respondWithFilteredResult(_0x2d9101,_0x290b70){return function(_0x1ee4fc){if(_0x1ee4fc){var _0x22efeb=typeof _0x290b70[_0x0573('0x22')]===_0x0573('0x23')&&typeof _0x290b70['limit']==='undefined';var _0x43d1ac=_0x1ee4fc[_0x0573('0x24')];var _0x2c6f8f=_0x22efeb?0x0:_0x290b70[_0x0573('0x22')];var _0x303a27=_0x22efeb?_0x1ee4fc[_0x0573('0x24')]:_0x290b70[_0x0573('0x22')]+_0x290b70['limit'];var _0x1d33a0;if(_0x303a27>=_0x43d1ac){_0x303a27=_0x43d1ac;_0x1d33a0=0xc8;}else{_0x1d33a0=0xce;}_0x2d9101[_0x0573('0x1f')](_0x1d33a0);return _0x2d9101[_0x0573('0x25')](_0x0573('0x26'),_0x2c6f8f+'-'+_0x303a27+'/'+_0x43d1ac)['json'](_0x1ee4fc);}return null;};}function patchUpdates(_0x25f4ec){return function(_0xe81983){try{jsonpatch[_0x0573('0x27')](_0xe81983,_0x25f4ec,!![]);}catch(_0x56adf0){return BPromise[_0x0573('0x28')](_0x56adf0);}return _0xe81983[_0x0573('0x29')]();};}function saveUpdates(_0x35f526,_0x1add1c){return function(_0x4ee7a9){if(_0x4ee7a9){return _0x4ee7a9[_0x0573('0x2a')](_0x35f526)['then'](function(_0x5ea17b){return _0x5ea17b;});}return null;};}function removeEntity(_0x5522ee,_0x55bcff){return function(_0xd9605b){if(_0xd9605b){return _0xd9605b[_0x0573('0x2b')]()['then'](function(){var _0x2ed3aa=_0xd9605b[_0x0573('0x2c')]({'plain':!![]});var _0x4c2204=_0x0573('0x2d');return db[_0x0573('0x2e')][_0x0573('0x2b')]({'where':{'type':_0x4c2204,'resourceId':_0x2ed3aa['id']}})['then'](function(){return _0xd9605b;});})[_0x0573('0x2f')](function(){_0x5522ee[_0x0573('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275ef7,_0x1d4059){return function(_0x4be2d6){if(!_0x4be2d6){_0x275ef7[_0x0573('0x1e')](0x194);}return _0x4be2d6;};}function handleError(_0x54970b,_0x28f450){_0x28f450=_0x28f450||0x1f4;return function(_0xacd196){logger[_0x0573('0x30')](_0xacd196[_0x0573('0x31')]);if(_0xacd196[_0x0573('0x32')]){delete _0xacd196['name'];}_0x54970b[_0x0573('0x1f')](_0x28f450)[_0x0573('0x33')](_0xacd196);};}exports['index']=function(_0x3f2a4d,_0x482846){var _0x386e45={},_0x478695={},_0x33231b={'count':0x0,'rows':[]};var _0x33f7a4=_[_0x0573('0x34')](db[_0x0573('0x35')]['rawAttributes'],function(_0x214595){return{'name':_0x214595[_0x0573('0x36')],'type':_0x214595[_0x0573('0x37')]['key']};});_0x478695[_0x0573('0x38')]=_[_0x0573('0x34')](_0x33f7a4,_0x0573('0x32'));_0x478695[_0x0573('0x39')]=_[_0x0573('0x3a')](_0x3f2a4d[_0x0573('0x39')]);_0x478695[_0x0573('0x3b')]=_['intersection'](_0x478695['model'],_0x478695[_0x0573('0x39')]);_0x386e45[_0x0573('0x3c')]=_['intersection'](_0x478695[_0x0573('0x38')],qs[_0x0573('0x3d')](_0x3f2a4d[_0x0573('0x39')][_0x0573('0x3d')]));_0x386e45[_0x0573('0x3c')]=_0x386e45[_0x0573('0x3c')]['length']?_0x386e45[_0x0573('0x3c')]:_0x478695[_0x0573('0x38')];if(!_0x3f2a4d[_0x0573('0x39')]['hasOwnProperty'](_0x0573('0x3e'))){_0x386e45[_0x0573('0x3f')]=qs[_0x0573('0x3f')](_0x3f2a4d[_0x0573('0x39')]['limit']);_0x386e45['offset']=qs[_0x0573('0x22')](_0x3f2a4d[_0x0573('0x39')][_0x0573('0x22')]);}_0x386e45[_0x0573('0x40')]=qs[_0x0573('0x41')](_0x3f2a4d['query'][_0x0573('0x41')]);_0x386e45[_0x0573('0x42')]=qs[_0x0573('0x3b')](_[_0x0573('0x43')](_0x3f2a4d[_0x0573('0x39')],_0x478695['filters']),_0x33f7a4);if(_0x3f2a4d['query'][_0x0573('0x44')]){_0x386e45[_0x0573('0x42')]=_['merge'](_0x386e45['where'],{'$or':_[_0x0573('0x34')](_0x33f7a4,function(_0x217c21){if(_0x217c21[_0x0573('0x37')]!==_0x0573('0x45')){var _0x3b0347={};_0x3b0347[_0x217c21[_0x0573('0x32')]]={'$like':'%'+_0x3f2a4d['query'][_0x0573('0x44')]+'%'};return _0x3b0347;}})});}_0x386e45=_[_0x0573('0x46')]({},_0x386e45,_0x3f2a4d[_0x0573('0x47')]);var _0x7bb512={'where':_0x386e45[_0x0573('0x42')]};return db['WhatsappQueue'][_0x0573('0x24')](_0x7bb512)[_0x0573('0x2f')](function(_0x27465d){_0x33231b[_0x0573('0x24')]=_0x27465d;if(_0x3f2a4d[_0x0573('0x39')][_0x0573('0x48')]){_0x386e45[_0x0573('0x49')]=[{'all':!![]}];}return db[_0x0573('0x35')][_0x0573('0x4a')](_0x386e45);})['then'](function(_0x53542c){_0x33231b[_0x0573('0x4b')]=_0x53542c;return _0x33231b;})[_0x0573('0x2f')](respondWithFilteredResult(_0x482846,_0x386e45))[_0x0573('0x4c')](handleError(_0x482846,null));};exports[_0x0573('0x4d')]=function(_0x30ae14,_0x1d48d4){var _0x573513={'raw':!![],'where':{'id':_0x30ae14[_0x0573('0x4e')]['id']}},_0xe79f77={};_0xe79f77[_0x0573('0x38')]=_[_0x0573('0x3a')](db['WhatsappQueue'][_0x0573('0x4f')]);_0xe79f77[_0x0573('0x39')]=_[_0x0573('0x3a')](_0x30ae14[_0x0573('0x39')]);_0xe79f77[_0x0573('0x3b')]=_['intersection'](_0xe79f77[_0x0573('0x38')],_0xe79f77[_0x0573('0x39')]);_0x573513[_0x0573('0x3c')]=_['intersection'](_0xe79f77['model'],qs[_0x0573('0x3d')](_0x30ae14[_0x0573('0x39')][_0x0573('0x3d')]));_0x573513[_0x0573('0x3c')]=_0x573513[_0x0573('0x3c')]['length']?_0x573513[_0x0573('0x3c')]:_0xe79f77[_0x0573('0x38')];if(_0x30ae14[_0x0573('0x39')]['includeAll']){_0x573513[_0x0573('0x49')]=[{'all':!![]}];}_0x573513=_[_0x0573('0x46')]({},_0x573513,_0x30ae14[_0x0573('0x47')]);return db[_0x0573('0x35')][_0x0573('0x50')](_0x573513)[_0x0573('0x2f')](handleEntityNotFound(_0x1d48d4,null))['then'](respondWithResult(_0x1d48d4,null))['catch'](handleError(_0x1d48d4,null));};exports[_0x0573('0x51')]=function(_0x5edd30,_0x4076fb){return db[_0x0573('0x35')][_0x0573('0x51')](_0x5edd30[_0x0573('0x52')],{})[_0x0573('0x2f')](function(_0x51db5f){var _0x205c2e=_0x5edd30[_0x0573('0x53')][_0x0573('0x2c')]({'plain':!![]});if(!_0x205c2e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x205c2e[_0x0573('0x54')]===_0x0573('0x53')){var _0xc45565=_0x51db5f[_0x0573('0x2c')]({'plain':!![]});var _0x229507='WhatsappQueues';return db['UserProfileSection'][_0x0573('0x50')]({'where':{'name':_0x229507,'userProfileId':_0x205c2e['userProfileId']},'raw':!![]})[_0x0573('0x2f')](function(_0x10d183){if(_0x10d183&&_0x10d183[_0x0573('0x55')]===0x0){return db[_0x0573('0x2e')][_0x0573('0x51')]({'name':_0xc45565[_0x0573('0x32')],'resourceId':_0xc45565['id'],'type':_0x10d183[_0x0573('0x32')],'sectionId':_0x10d183['id']},{})[_0x0573('0x2f')](function(){return _0x51db5f;});}else{return _0x51db5f;}})[_0x0573('0x4c')](function(_0x25fc92){logger[_0x0573('0x30')](_0x0573('0x56'),_0x25fc92);throw _0x25fc92;});}return _0x51db5f;})['then'](respondWithResult(_0x4076fb,0xc9))[_0x0573('0x4c')](handleError(_0x4076fb,null));};exports['update']=function(_0x3a05a6,_0x2cbc96){if(_0x3a05a6['body']['id']){delete _0x3a05a6[_0x0573('0x52')]['id'];}return db[_0x0573('0x35')]['find']({'where':{'id':_0x3a05a6[_0x0573('0x4e')]['id']}})[_0x0573('0x2f')](handleEntityNotFound(_0x2cbc96,null))['then'](saveUpdates(_0x3a05a6[_0x0573('0x52')],null))[_0x0573('0x2f')](respondWithResult(_0x2cbc96,null))[_0x0573('0x4c')](handleError(_0x2cbc96,null));};exports[_0x0573('0x2b')]=function(_0x59c5c2,_0x2321bd){return db['WhatsappQueue']['find']({'where':{'id':_0x59c5c2['params']['id']}})['then'](handleEntityNotFound(_0x2321bd,null))[_0x0573('0x2f')](removeEntity(_0x2321bd,null))[_0x0573('0x4c')](handleError(_0x2321bd,null));};exports['describe']=function(_0x5129a5,_0x4237e3){return db[_0x0573('0x35')][_0x0573('0x57')]()[_0x0573('0x2f')](respondWithResult(_0x4237e3,null))[_0x0573('0x4c')](handleError(_0x4237e3,null));};exports['getMembers']=function(_0x434e3e,_0x558666,_0x3db627){var _0x20a342={'raw':!![],'where':{}},_0x5ce2bf={},_0x233acd;return db[_0x0573('0x35')]['findOne']({'where':{'id':_0x434e3e[_0x0573('0x4e')]['id']}})[_0x0573('0x2f')](handleEntityNotFound(_0x558666,null))[_0x0573('0x2f')](function(_0x44146d){if(_0x44146d){_0x233acd=_0x44146d[_0x0573('0x2c')]({'plain':!![]});_0x5ce2bf['model']=_[_0x0573('0x3a')](db[_0x0573('0x58')][_0x0573('0x4f')]);_0x5ce2bf[_0x0573('0x39')]=_[_0x0573('0x3a')](_0x434e3e[_0x0573('0x39')]);_0x5ce2bf[_0x0573('0x3b')]=_['intersection'](_0x5ce2bf['model'],_0x5ce2bf[_0x0573('0x39')]);_0x20a342[_0x0573('0x3c')]=_['intersection'](_0x5ce2bf[_0x0573('0x38')],qs['fields'](_0x434e3e['query'][_0x0573('0x3d')]));_0x20a342['attributes']=_0x20a342[_0x0573('0x3c')][_0x0573('0x59')]?_0x20a342['attributes']:_0x5ce2bf[_0x0573('0x38')];if(!_0x434e3e['query'][_0x0573('0x5a')](_0x0573('0x3e'))){_0x20a342[_0x0573('0x3f')]=qs[_0x0573('0x3f')](_0x434e3e[_0x0573('0x39')][_0x0573('0x3f')]);_0x20a342[_0x0573('0x22')]=qs[_0x0573('0x22')](_0x434e3e[_0x0573('0x39')][_0x0573('0x22')]);}_0x20a342[_0x0573('0x40')]=qs[_0x0573('0x41')](_0x434e3e[_0x0573('0x39')][_0x0573('0x41')]);_0x20a342[_0x0573('0x42')]=qs[_0x0573('0x3b')](_[_0x0573('0x43')](_0x434e3e[_0x0573('0x39')],_0x5ce2bf[_0x0573('0x3b')]));_0x20a342[_0x0573('0x42')][_0x0573('0x5b')]=_0x44146d['id'];if(_0x434e3e['query'][_0x0573('0x44')]){_0x20a342['where']=_['merge'](_0x20a342[_0x0573('0x42')],{'$or':_[_0x0573('0x34')](_0x20a342[_0x0573('0x3c')],function(_0x228cd6){var _0x540d40={};_0x540d40[_0x228cd6]={'$like':'%'+_0x434e3e[_0x0573('0x39')][_0x0573('0x44')]+'%'};return _0x540d40;})});}_0x20a342=_[_0x0573('0x46')]({},_0x20a342,_0x434e3e[_0x0573('0x47')]);return db[_0x0573('0x58')][_0x0573('0x4a')](_0x20a342);}})[_0x0573('0x2f')](function(_0x59e1e2){if(_0x59e1e2){return db[_0x0573('0x5c')][_0x0573('0x5d')]({'where':{'id':_[_0x0573('0x34')](_0x59e1e2,_0x0573('0x5e')),'role':_0x0573('0x5f')},'attributes':['id','name',_0x0573('0x60'),_0x0573('0x61'),_0x0573('0x62')]});}})['then'](function(_0x1dbcee){if(_0x1dbcee){return{'count':_0x1dbcee[_0x0573('0x24')],'rows':_['map'](_0x1dbcee['rows'],function(_0x38acb5){return{'membername':_0x38acb5[_0x0573('0x32')],'UserId':_0x38acb5['id'],'queue_name':_0x233acd[_0x0573('0x32')],'WhatsappQueueId':_0x233acd['id'],'interface':util[_0x0573('0x63')](_0x0573('0x64'),'SIP',_0x38acb5[_0x0573('0x32')]),'penalty':0x0,'paused':_0x38acb5[_0x0573('0x60')],'createdAt':_0x38acb5[_0x0573('0x62')],'updatedAt':_0x38acb5[_0x0573('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0573('0x2f')](respondWithFilteredResult(_0x558666,_0x20a342))[_0x0573('0x4c')](handleError(_0x558666,null));};exports[_0x0573('0x65')]=function(_0x58612d,_0x18b676,_0x171776){var _0x43add8={};var _0x50ce12={};var _0x1a716a;var _0x3a3d60;return db[_0x0573('0x35')][_0x0573('0x66')]({'where':{'id':_0x58612d[_0x0573('0x4e')]['id']}})[_0x0573('0x2f')](handleEntityNotFound(_0x18b676,null))[_0x0573('0x2f')](function(_0x45c889){if(_0x45c889){_0x1a716a=_0x45c889;_0x50ce12[_0x0573('0x38')]=_[_0x0573('0x3a')](db[_0x0573('0x67')][_0x0573('0x4f')]);_0x50ce12[_0x0573('0x39')]=_['keys'](_0x58612d[_0x0573('0x39')]);_0x50ce12['filters']=_['intersection'](_0x50ce12[_0x0573('0x38')],_0x50ce12[_0x0573('0x39')]);_0x43add8[_0x0573('0x3c')]=_[_0x0573('0x68')](_0x50ce12[_0x0573('0x38')],qs['fields'](_0x58612d['query'][_0x0573('0x3d')]));_0x43add8['attributes']=_0x43add8[_0x0573('0x3c')][_0x0573('0x59')]?_0x43add8['attributes']:_0x50ce12[_0x0573('0x38')];_0x43add8[_0x0573('0x40')]=qs[_0x0573('0x41')](_0x58612d['query']['sort']);_0x43add8['where']=qs[_0x0573('0x3b')](_[_0x0573('0x43')](_0x58612d[_0x0573('0x39')],_0x50ce12[_0x0573('0x3b')]));if(_0x58612d[_0x0573('0x39')]['filter']){_0x43add8['where']=_[_0x0573('0x46')](_0x43add8['where'],{'$or':_['map'](_0x43add8[_0x0573('0x3c')],function(_0x2ef5cd){var _0x7bb61f={};_0x7bb61f[_0x2ef5cd]={'$like':'%'+_0x58612d[_0x0573('0x39')]['filter']+'%'};return _0x7bb61f;})});}_0x43add8=_['merge']({},_0x43add8,_0x58612d['options']);return _0x1a716a['getTeams'](_0x43add8);}})[_0x0573('0x2f')](function(_0x556517){if(_0x556517){_0x3a3d60=_0x556517[_0x0573('0x59')];if(!_0x58612d[_0x0573('0x39')][_0x0573('0x5a')](_0x0573('0x3e'))){_0x43add8[_0x0573('0x3f')]=qs[_0x0573('0x3f')](_0x58612d[_0x0573('0x39')][_0x0573('0x3f')]);_0x43add8[_0x0573('0x22')]=qs['offset'](_0x58612d[_0x0573('0x39')][_0x0573('0x22')]);}return _0x1a716a[_0x0573('0x65')](_0x43add8);}})[_0x0573('0x2f')](function(_0x5672a6){if(_0x5672a6){return _0x5672a6?{'count':_0x3a3d60,'rows':_0x5672a6}:null;}})[_0x0573('0x2f')](respondWithResult(_0x18b676,null))[_0x0573('0x4c')](handleError(_0x18b676,null));};exports[_0x0573('0x69')]=function(_0x55fdd4,_0x117952,_0x576c37){var _0x545609=_0x55fdd4[_0x0573('0x52')]['ids'];return db[_0x0573('0x67')][_0x0573('0x4a')]({'where':{'id':_0x545609},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0573('0x6a'),'attributes':['id',_0x0573('0x32'),'online',_0x0573('0x6b'),_0x0573('0x6c')],'raw':!![]}]})[_0x0573('0x2f')](function(_0xa776fd){if(_0xa776fd){var _0x1a11b1=_['flatMap'](_0xa776fd,function(_0x19745c){var _0x19e87e=_0x19745c[_0x0573('0x2c')]({'plain':!![]});return _0x19e87e[_0x0573('0x6a')];});return db[_0x0573('0x35')]['find']({'where':{'id':_0x55fdd4[_0x0573('0x4e')]['id']}})[_0x0573('0x2f')](function(_0x5cd0ae){return db[_0x0573('0x6d')]['transaction'](function(_0x49bb41){return _0x5cd0ae['addTeams'](_0x545609,{'transaction':_0x49bb41})[_0x0573('0x2f')](function(){return BPromise[_0x0573('0x6e')](_0x1a11b1,function(_0x344002){return db[_0x0573('0x58')][_0x0573('0x6f')]({'where':{'UserId':_0x344002['id'],'WhatsappQueueId':_0x55fdd4[_0x0573('0x4e')]['id']},'transaction':_0x49bb41});});})[_0x0573('0x2f')](function(){_0x1a11b1[_0x0573('0x70')](function(_0xf558cb){socket[_0x0573('0x71')](_0x0573('0x72'),{'UserId':_0xf558cb['id'],'WhatsappQueueId':_0x5cd0ae['id']});});});});});}})[_0x0573('0x2f')](respondWithStatusCode(_0x117952,null))[_0x0573('0x4c')](handleError(_0x117952,null));};exports[_0x0573('0x73')]=function(_0x2636d4,_0x1b76f2,_0x319042){return db['Team']['findAll']({'where':{'id':_0x2636d4[_0x0573('0x39')][_0x0573('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0573('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0573('0x2f')](handleEntityNotFound(_0x1b76f2,null))[_0x0573('0x2f')](function(_0x4bd2cd){var _0x3e5b60=_[_0x0573('0x34')](_0x4bd2cd,'id');var _0x30159f=[];var _0x2fa6de=[];var _0x1442ad=squel[_0x0573('0x75')]();_0x1442ad[_0x0573('0x76')](_0x0573('0x77'))[_0x0573('0x78')](_0x0573('0x79'),'tq')[_0x0573('0x7a')](_0x0573('0x7b'),'ut',_0x0573('0x7c'))['where']('WhatsappQueueId\x20=\x20?',_0x2636d4[_0x0573('0x4e')]['id']);for(var _0xa57524=0x0;_0xa57524<_0x4bd2cd['length'];_0xa57524+=0x1){let _0x29e60e=_0x4bd2cd[_0xa57524];for(var _0x476be5=0x0;_0x476be5<_0x29e60e[_0x0573('0x6a')][_0x0573('0x59')];_0x476be5+=0x1){let _0x3a101c=_0x29e60e[_0x0573('0x6a')][_0x476be5];var _0x5038af=_0x1442ad[_0x0573('0x7d')]();_0x5038af[_0x0573('0x42')](_0x0573('0x7e'),_0x3a101c['id']);_0x2fa6de[_0x0573('0x7f')](db[_0x0573('0x6d')][_0x0573('0x39')](_0x5038af[_0x0573('0x80')](),{'type':db[_0x0573('0x6d')][_0x0573('0x81')][_0x0573('0x82')]})[_0x0573('0x2f')](function(_0x5a63ef){if(_0x5a63ef[_0x0573('0x59')]===0x1){return _0x3a101c['id'];}else{var _0x45c028=_[_0x0573('0x83')](_[_0x0573('0x34')](_0x5a63ef,'TeamId'),function(_0x29b9b1){return _[_0x0573('0x84')](_0x3e5b60,_0x29b9b1);});if(_0x45c028){return _0x3a101c['id'];}}}));}}return BPromise[_0x0573('0x85')](_0x2fa6de)[_0x0573('0x2f')](function(_0x51ed25){_0x30159f=_(_0x30159f)['union'](_0x51ed25)[_0x0573('0x86')]()[_0x0573('0x87')]();return db[_0x0573('0x35')][_0x0573('0x50')]({'where':{'id':_0x2636d4['params']['id']}})[_0x0573('0x2f')](function(_0x2cd855){return db[_0x0573('0x6d')][_0x0573('0x88')](function(_0x3ecde4){return _0x2cd855[_0x0573('0x73')](_0x2636d4[_0x0573('0x39')][_0x0573('0x74')],{'transaction':_0x3ecde4})[_0x0573('0x2f')](function(){if(!_[_0x0573('0x89')](_0x30159f)){return _0x2cd855[_0x0573('0x8a')](_0x30159f,{'transaction':_0x3ecde4});}})[_0x0573('0x2f')](function(){_0x30159f[_0x0573('0x70')](function(_0x4c3da7){socket[_0x0573('0x71')](_0x0573('0x8b'),{'UserId':_0x4c3da7,'WhatsappQueueId':_0x2cd855['id']});});});});});});})[_0x0573('0x2f')](respondWithStatusCode(_0x1b76f2,null))[_0x0573('0x4c')](handleError(_0x1b76f2,null));};exports[_0x0573('0x8c')]=function(_0x23b5d4,_0x1929ee,_0x10992d){return db[_0x0573('0x35')][_0x0573('0x50')]({'where':{'id':_0x23b5d4[_0x0573('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1929ee,null))['then'](function(_0x148543){if(_0x148543){return _0x148543['addAgents'](_0x23b5d4[_0x0573('0x52')][_0x0573('0x74')],_[_0x0573('0x8d')](_0x23b5d4['body'],[_0x0573('0x74'),'id'])||{})[_0x0573('0x8e')](function(_0x4e0976){for(var _0x4de64e=0x0;_0x4de64e<_0x23b5d4[_0x0573('0x52')][_0x0573('0x74')][_0x0573('0x59')];_0x4de64e+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x23b5d4['body']['ids'][_0x4de64e]),'WhatsappQueueId':Number(_0x23b5d4[_0x0573('0x4e')]['id'])});}return _0x4e0976;});}})['then'](respondWithResult(_0x1929ee,null))[_0x0573('0x4c')](handleError(_0x1929ee,null));};exports[_0x0573('0x8a')]=function(_0x5c54d2,_0xc6c8bf,_0x2bffab){return db[_0x0573('0x35')][_0x0573('0x50')]({'where':{'id':_0x5c54d2['params']['id']}})[_0x0573('0x2f')](handleEntityNotFound(_0xc6c8bf,null))[_0x0573('0x2f')](function(_0x1850d4){if(_0x1850d4){return _0x1850d4[_0x0573('0x8a')](_0x5c54d2[_0x0573('0x39')][_0x0573('0x74')])[_0x0573('0x2f')](function(){if(_[_0x0573('0x8f')](_0x5c54d2[_0x0573('0x39')][_0x0573('0x74')])){for(var _0x35fa42=0x0;_0x35fa42<_0x5c54d2[_0x0573('0x39')][_0x0573('0x74')][_0x0573('0x59')];_0x35fa42+=0x1){socket[_0x0573('0x71')](_0x0573('0x8b'),{'UserId':Number(_0x5c54d2['query']['ids'][_0x35fa42]),'WhatsappQueueId':Number(_0x5c54d2[_0x0573('0x4e')]['id'])});}}else{socket[_0x0573('0x71')](_0x0573('0x8b'),{'UserId':Number(_0x5c54d2[_0x0573('0x39')][_0x0573('0x74')]),'WhatsappQueueId':Number(_0x5c54d2[_0x0573('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0xc6c8bf,null))[_0x0573('0x4c')](handleError(_0xc6c8bf,null));};exports[_0x0573('0x90')]=function(_0x12c859,_0x1d97bb,_0x3b5c78){var _0x3735dd={};var _0x5905ff={};var _0x1e9278;var _0x6ddad9;return db[_0x0573('0x35')][_0x0573('0x66')]({'where':{'id':_0x12c859['params']['id']}})[_0x0573('0x2f')](handleEntityNotFound(_0x1d97bb,null))[_0x0573('0x2f')](function(_0x2f536b){if(_0x2f536b){_0x1e9278=_0x2f536b;_0x5905ff[_0x0573('0x38')]=_[_0x0573('0x3a')](db['User'][_0x0573('0x4f')]);_0x5905ff[_0x0573('0x39')]=_[_0x0573('0x3a')](_0x12c859['query']);_0x5905ff[_0x0573('0x3b')]=_['intersection'](_0x5905ff[_0x0573('0x38')],_0x5905ff[_0x0573('0x39')]);_0x3735dd[_0x0573('0x3c')]=_[_0x0573('0x68')](_0x5905ff[_0x0573('0x38')],qs[_0x0573('0x3d')](_0x12c859[_0x0573('0x39')][_0x0573('0x3d')]));_0x3735dd[_0x0573('0x3c')]=_0x3735dd[_0x0573('0x3c')][_0x0573('0x59')]?_0x3735dd['attributes']:_0x5905ff[_0x0573('0x38')];_0x3735dd[_0x0573('0x40')]=qs[_0x0573('0x41')](_0x12c859[_0x0573('0x39')][_0x0573('0x41')]);_0x3735dd[_0x0573('0x42')]=qs[_0x0573('0x3b')](_[_0x0573('0x43')](_0x12c859[_0x0573('0x39')],_0x5905ff['filters']));if(_0x12c859[_0x0573('0x39')][_0x0573('0x44')]){_0x3735dd['where']=_[_0x0573('0x46')](_0x3735dd[_0x0573('0x42')],{'$or':_[_0x0573('0x34')](_0x3735dd['attributes'],function(_0x3ecb35){var _0x38d9f2={};_0x38d9f2[_0x3ecb35]={'$like':'%'+_0x12c859[_0x0573('0x39')][_0x0573('0x44')]+'%'};return _0x38d9f2;})});}_0x3735dd=_['merge']({},_0x3735dd,_0x12c859[_0x0573('0x47')]);return _0x1e9278['getAgents'](_0x3735dd);}})[_0x0573('0x2f')](function(_0x2fae32){if(_0x2fae32){_0x6ddad9=_0x2fae32[_0x0573('0x59')];if(!_0x12c859[_0x0573('0x39')][_0x0573('0x5a')]('nolimit')){_0x3735dd['limit']=qs['limit'](_0x12c859['query'][_0x0573('0x3f')]);_0x3735dd[_0x0573('0x22')]=qs[_0x0573('0x22')](_0x12c859[_0x0573('0x39')][_0x0573('0x22')]);}return _0x1e9278['getAgents'](_0x3735dd);}})[_0x0573('0x2f')](function(_0x1bdea4){if(_0x1bdea4){return _0x1bdea4?{'count':_0x6ddad9,'rows':_0x1bdea4}:null;}})[_0x0573('0x2f')](respondWithResult(_0x1d97bb,null))[_0x0573('0x4c')](handleError(_0x1d97bb,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b2b885d..8db6020 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 _0x4874=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x27b14f,_0x1971d3){var _0x4888e2=function(_0xc2c6f8){while(--_0xc2c6f8){_0x27b14f['push'](_0x27b14f['shift']());}};_0x4888e2(++_0x1971d3);}(_0x4874,0x1d7));var _0x4487=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x4874[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x4487('0x0'));var WhatsappQueue=require(_0x4487('0x1'))['db'][_0x4487('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4487('0x3')](0x0);var events={'afterCreate':_0x4487('0x4'),'afterUpdate':_0x4487('0x5'),'afterDestroy':_0x4487('0x6')};function emitEvent(_0x124d1e){return function(_0x2104f9,_0x6ff71d,_0x2e2257){WhatsappQueueEvents[_0x4487('0x7')](_0x124d1e+':'+_0x2104f9['id'],_0x2104f9);WhatsappQueueEvents[_0x4487('0x7')](_0x124d1e,_0x2104f9);_0x2e2257(null);};}for(var e in events){if(events[_0x4487('0x8')](e)){var event=events[e];WhatsappQueue[_0x4487('0x9')](e,emitEvent(event));}}module[_0x4487('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa44a=['remove','emit','hook','events','setMaxListeners','save','update'];(function(_0x399338,_0x11496b){var _0x3c4485=function(_0x17e385){while(--_0x17e385){_0x399338['push'](_0x399338['shift']());}};_0x3c4485(++_0x11496b);}(_0xa44a,0xb2));var _0xaa44=function(_0x3909f7,_0x441208){_0x3909f7=_0x3909f7-0x0;var _0x4df416=_0xa44a[_0x3909f7];return _0x4df416;};'use strict';var EventEmitter=require(_0xaa44('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaa44('0x1')](0x0);var events={'afterCreate':_0xaa44('0x2'),'afterUpdate':_0xaa44('0x3'),'afterDestroy':_0xaa44('0x4')};function emitEvent(_0x54abca){return function(_0x503e2a,_0x1ae04f,_0x143d5e){WhatsappQueueEvents[_0xaa44('0x5')](_0x54abca+':'+_0x503e2a['id'],_0x503e2a);WhatsappQueueEvents[_0xaa44('0x5')](_0x54abca,_0x503e2a);_0x143d5e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xaa44('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index c27a856..d37466a 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 _0xc157=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','bluebird'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xc157,0x19e));var _0x7c15=function(_0x12bb9f,_0x25048f){_0x12bb9f=_0x12bb9f-0x0;var _0x5c553f=_0xc157[_0x12bb9f];return _0x5c553f;};'use strict';var _=require(_0x7c15('0x0'));var util=require('util');var logger=require(_0x7c15('0x1'))(_0x7c15('0x2'));var moment=require('moment');var BPromise=require(_0x7c15('0x3'));var rp=require(_0x7c15('0x4'));var fs=require('fs');var path=require(_0x7c15('0x5'));var rimraf=require('rimraf');var config=require(_0x7c15('0x6'));var attributes=require(_0x7c15('0x7'));module[_0x7c15('0x8')]=function(_0x2a24f9,_0x1adb0b){return _0x2a24f9['define'](_0x7c15('0x9'),attributes,{'tableName':_0x7c15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf828=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','moment'];(function(_0x4974a9,_0x489221){var _0x17d819=function(_0x44ab79){while(--_0x44ab79){_0x4974a9['push'](_0x4974a9['shift']());}};_0x17d819(++_0x489221);}(_0xf828,0xb8));var _0x8f82=function(_0x503a7e,_0x564749){_0x503a7e=_0x503a7e-0x0;var _0x30c68c=_0xf828[_0x503a7e];return _0x30c68c;};'use strict';var _=require('lodash');var util=require(_0x8f82('0x0'));var logger=require(_0x8f82('0x1'))('api');var moment=require(_0x8f82('0x2'));var BPromise=require(_0x8f82('0x3'));var rp=require(_0x8f82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f82('0x5'));var config=require(_0x8f82('0x6'));var attributes=require(_0x8f82('0x7'));module['exports']=function(_0x59c0aa,_0x373ae1){return _0x59c0aa[_0x8f82('0x8')](_0x8f82('0x9'),attributes,{'tableName':_0x8f82('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 445b968..12fa16e 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 _0xa334=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','WhatsappQueue','options','where','attributes','limit','include','model','map','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','raw','lodash','util','moment','randomstring'];(function(_0x5b6882,_0x590ddc){var _0x4e07ad=function(_0x1016e9){while(--_0x1016e9){_0x5b6882['push'](_0x5b6882['shift']());}};_0x4e07ad(++_0x590ddc);}(_0xa334,0xe6));var _0x4a33=function(_0x427982,_0x5d897a){_0x427982=_0x427982-0x0;var _0x2c8a71=_0xa334[_0x427982];return _0x2c8a71;};'use strict';var _=require(_0x4a33('0x0'));var util=require(_0x4a33('0x1'));var moment=require(_0x4a33('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a33('0x3'));var fs=require('fs');var Redis=require(_0x4a33('0x4'));var db=require(_0x4a33('0x5'))['db'];var utils=require(_0x4a33('0x6'));var logger=require(_0x4a33('0x7'))(_0x4a33('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a33('0x9')][_0x4a33('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4a33('0xb')],{'host':_0x4a33('0xc'),'port':0x18eb});var socket=require(_0x4a33('0xd'))(new Redis(config['redis']));require(_0x4a33('0xe'))['register'](socket);function respondWithRpcPromise(_0x2f7390,_0x584607,_0x5e2a34){return new BPromise(function(_0x17f23e,_0x2304b0){return client[_0x4a33('0xf')](_0x2f7390,_0x5e2a34)[_0x4a33('0x10')](function(_0x3a21a4){logger[_0x4a33('0x11')](_0x4a33('0x12'),_0x584607,_0x4a33('0x13'));logger[_0x4a33('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x584607,_0x4a33('0x13'),JSON['stringify'](_0x3a21a4));if(_0x3a21a4[_0x4a33('0x15')]){if(_0x3a21a4[_0x4a33('0x15')][_0x4a33('0x16')]===0x1f4){logger[_0x4a33('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x584607,_0x3a21a4[_0x4a33('0x15')][_0x4a33('0x17')]);return _0x2304b0(_0x3a21a4['error'][_0x4a33('0x17')]);}logger['error'](_0x4a33('0x12'),_0x584607,_0x3a21a4[_0x4a33('0x15')][_0x4a33('0x17')]);return _0x17f23e(_0x3a21a4['error'][_0x4a33('0x17')]);}else{logger[_0x4a33('0x11')](_0x4a33('0x12'),_0x584607,_0x4a33('0x13'));_0x17f23e(_0x3a21a4[_0x4a33('0x18')][_0x4a33('0x17')]);}})[_0x4a33('0x19')](function(_0x3476ea){logger[_0x4a33('0x15')](_0x4a33('0x12'),_0x584607,_0x3476ea);_0x2304b0(_0x3476ea);});});}exports['GetWhatsappQueue']=function(_0x184195){var _0x352177=this;return new Promise(function(_0x314778,_0x55fc5c){return db[_0x4a33('0x1a')]['findAll']({'raw':_0x184195[_0x4a33('0x1b')]?_0x184195[_0x4a33('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x184195[_0x4a33('0x1b')]?_0x184195[_0x4a33('0x1b')][_0x4a33('0x1c')]||null:null,'attributes':_0x184195[_0x4a33('0x1b')]?_0x184195[_0x4a33('0x1b')][_0x4a33('0x1d')]||null:null,'limit':_0x184195[_0x4a33('0x1b')]?_0x184195['options'][_0x4a33('0x1e')]||null:null,'include':_0x184195['options']?_0x184195['options'][_0x4a33('0x1f')]?_['map'](_0x184195[_0x4a33('0x1b')][_0x4a33('0x1f')],function(_0x5aa09e){return{'model':db[_0x5aa09e[_0x4a33('0x20')]],'as':_0x5aa09e['as'],'attributes':_0x5aa09e[_0x4a33('0x1d')],'include':_0x5aa09e[_0x4a33('0x1f')]?_[_0x4a33('0x21')](_0x5aa09e['include'],function(_0x2ee5b1){return{'model':db[_0x2ee5b1[_0x4a33('0x20')]],'as':_0x2ee5b1['as'],'attributes':_0x2ee5b1['attributes'],'include':_0x2ee5b1[_0x4a33('0x1f')]?_[_0x4a33('0x21')](_0x2ee5b1[_0x4a33('0x1f')],function(_0x168458){return{'model':db[_0x168458[_0x4a33('0x20')]],'as':_0x168458['as'],'attributes':_0x168458[_0x4a33('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4feffd){logger[_0x4a33('0x11')](_0x4a33('0x22'),_0x184195);logger['debug']('GetWhatsappQueue',_0x184195,JSON[_0x4a33('0x23')](_0x4feffd));_0x314778(_0x4feffd);})[_0x4a33('0x19')](function(_0x14fd0b){logger['error'](_0x4a33('0x22'),_0x14fd0b[_0x4a33('0x17')],_0x184195);_0x55fc5c(_0x352177[_0x4a33('0x15')](0x1f4,_0x14fd0b[_0x4a33('0x17')]));});});};exports[_0x4a33('0x24')]=function(_0x149b74){var _0x38f81d=this;return new Promise(function(_0x2372a5,_0x333eb5){return db[_0x4a33('0x1a')][_0x4a33('0x25')]({'raw':_0x149b74[_0x4a33('0x1b')]?_0x149b74[_0x4a33('0x1b')][_0x4a33('0x26')]===undefined?!![]:![]:!![],'where':_0x149b74[_0x4a33('0x1b')]?_0x149b74[_0x4a33('0x1b')]['where']||null:null,'attributes':_0x149b74[_0x4a33('0x1b')]?_0x149b74[_0x4a33('0x1b')][_0x4a33('0x1d')]||null:null,'include':_0x149b74[_0x4a33('0x1b')]?_0x149b74['options']['include']?_['map'](_0x149b74['options']['include'],function(_0x1ba770){return{'model':db[_0x1ba770[_0x4a33('0x20')]],'as':_0x1ba770['as'],'attributes':_0x1ba770[_0x4a33('0x1d')],'include':_0x1ba770[_0x4a33('0x1f')]?_[_0x4a33('0x21')](_0x1ba770['include'],function(_0x55cfa6){return{'model':db[_0x55cfa6[_0x4a33('0x20')]],'as':_0x55cfa6['as'],'attributes':_0x55cfa6['attributes'],'include':_0x55cfa6[_0x4a33('0x1f')]?_[_0x4a33('0x21')](_0x55cfa6[_0x4a33('0x1f')],function(_0x3c0c78){return{'model':db[_0x3c0c78[_0x4a33('0x20')]],'as':_0x3c0c78['as'],'attributes':_0x3c0c78[_0x4a33('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f0df7){logger[_0x4a33('0x11')](_0x4a33('0x24'),_0x149b74);logger[_0x4a33('0x14')](_0x4a33('0x24'),_0x149b74,JSON[_0x4a33('0x23')](_0x1f0df7));_0x2372a5(_0x1f0df7);})[_0x4a33('0x19')](function(_0x348f21){logger[_0x4a33('0x15')](_0x4a33('0x24'),_0x348f21['message'],_0x149b74);_0x333eb5(_0x38f81d[_0x4a33('0x15')](0x1f4,_0x348f21['message']));});});}; \ No newline at end of file +var _0x953e=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetWhatsappQueue','options','raw','where','attributes','map','model','include','ShowWhatsappQueue','WhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','socket.io-emitter','redis','register'];(function(_0x28d4e5,_0x4138e4){var _0x5c7743=function(_0x3a9206){while(--_0x3a9206){_0x28d4e5['push'](_0x28d4e5['shift']());}};_0x5c7743(++_0x4138e4);}(_0x953e,0x101));var _0xe953=function(_0x2ceb2d,_0x2648fa){_0x2ceb2d=_0x2ceb2d-0x0;var _0x26a8e0=_0x953e[_0x2ceb2d];return _0x26a8e0;};'use strict';var _=require(_0xe953('0x0'));var util=require('util');var moment=require(_0xe953('0x1'));var BPromise=require(_0xe953('0x2'));var rs=require(_0xe953('0x3'));var fs=require('fs');var Redis=require(_0xe953('0x4'));var db=require(_0xe953('0x5'))['db'];var utils=require(_0xe953('0x6'));var logger=require(_0xe953('0x7'))(_0xe953('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe953('0x9')][_0xe953('0xa')]({'port':0x232a});config['redis']=_[_0xe953('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe953('0xc'))(new Redis(config[_0xe953('0xd')]));require('./whatsappQueue.socket')[_0xe953('0xe')](socket);function respondWithRpcPromise(_0x228e16,_0x300788,_0x29d7ae){return new BPromise(function(_0x4874d8,_0x122873){return client['request'](_0x228e16,_0x29d7ae)['then'](function(_0x2b5093){logger[_0xe953('0xf')](_0xe953('0x10'),_0x300788,_0xe953('0x11'));logger[_0xe953('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x300788,_0xe953('0x11'),JSON[_0xe953('0x13')](_0x2b5093));if(_0x2b5093[_0xe953('0x14')]){if(_0x2b5093[_0xe953('0x14')]['code']===0x1f4){logger[_0xe953('0x14')](_0xe953('0x10'),_0x300788,_0x2b5093[_0xe953('0x14')][_0xe953('0x15')]);return _0x122873(_0x2b5093[_0xe953('0x14')][_0xe953('0x15')]);}logger[_0xe953('0x14')](_0xe953('0x10'),_0x300788,_0x2b5093[_0xe953('0x14')][_0xe953('0x15')]);return _0x4874d8(_0x2b5093[_0xe953('0x14')]['message']);}else{logger[_0xe953('0xf')](_0xe953('0x10'),_0x300788,'request\x20sent');_0x4874d8(_0x2b5093[_0xe953('0x16')][_0xe953('0x15')]);}})[_0xe953('0x17')](function(_0x10065e){logger[_0xe953('0x14')](_0xe953('0x10'),_0x300788,_0x10065e);_0x122873(_0x10065e);});});}exports[_0xe953('0x18')]=function(_0x41ab5f){var _0x103f2c=this;return new Promise(function(_0x4a6ff1,_0x342773){return db['WhatsappQueue']['findAll']({'raw':_0x41ab5f[_0xe953('0x19')]?_0x41ab5f[_0xe953('0x19')][_0xe953('0x1a')]===undefined?!![]:![]:!![],'where':_0x41ab5f[_0xe953('0x19')]?_0x41ab5f[_0xe953('0x19')][_0xe953('0x1b')]||null:null,'attributes':_0x41ab5f[_0xe953('0x19')]?_0x41ab5f[_0xe953('0x19')][_0xe953('0x1c')]||null:null,'limit':_0x41ab5f['options']?_0x41ab5f[_0xe953('0x19')]['limit']||null:null,'include':_0x41ab5f[_0xe953('0x19')]?_0x41ab5f[_0xe953('0x19')]['include']?_[_0xe953('0x1d')](_0x41ab5f['options']['include'],function(_0x4f80a0){return{'model':db[_0x4f80a0[_0xe953('0x1e')]],'as':_0x4f80a0['as'],'attributes':_0x4f80a0[_0xe953('0x1c')],'include':_0x4f80a0[_0xe953('0x1f')]?_[_0xe953('0x1d')](_0x4f80a0[_0xe953('0x1f')],function(_0x30a1dc){return{'model':db[_0x30a1dc['model']],'as':_0x30a1dc['as'],'attributes':_0x30a1dc[_0xe953('0x1c')],'include':_0x30a1dc['include']?_[_0xe953('0x1d')](_0x30a1dc[_0xe953('0x1f')],function(_0x393e89){return{'model':db[_0x393e89[_0xe953('0x1e')]],'as':_0x393e89['as'],'attributes':_0x393e89[_0xe953('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x448835){logger[_0xe953('0xf')](_0xe953('0x18'),_0x41ab5f);logger[_0xe953('0x12')](_0xe953('0x18'),_0x41ab5f,JSON[_0xe953('0x13')](_0x448835));_0x4a6ff1(_0x448835);})[_0xe953('0x17')](function(_0x5be1f3){logger[_0xe953('0x14')]('GetWhatsappQueue',_0x5be1f3[_0xe953('0x15')],_0x41ab5f);_0x342773(_0x103f2c['error'](0x1f4,_0x5be1f3[_0xe953('0x15')]));});});};exports[_0xe953('0x20')]=function(_0x1f42eb){var _0x3cc562=this;return new Promise(function(_0x206aaa,_0x50dc5d){return db[_0xe953('0x21')]['find']({'raw':_0x1f42eb['options']?_0x1f42eb[_0xe953('0x19')][_0xe953('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f42eb['options']?_0x1f42eb['options'][_0xe953('0x1b')]||null:null,'attributes':_0x1f42eb[_0xe953('0x19')]?_0x1f42eb[_0xe953('0x19')][_0xe953('0x1c')]||null:null,'include':_0x1f42eb['options']?_0x1f42eb[_0xe953('0x19')][_0xe953('0x1f')]?_[_0xe953('0x1d')](_0x1f42eb['options'][_0xe953('0x1f')],function(_0x523d3d){return{'model':db[_0x523d3d[_0xe953('0x1e')]],'as':_0x523d3d['as'],'attributes':_0x523d3d[_0xe953('0x1c')],'include':_0x523d3d[_0xe953('0x1f')]?_[_0xe953('0x1d')](_0x523d3d[_0xe953('0x1f')],function(_0x10a11c){return{'model':db[_0x10a11c[_0xe953('0x1e')]],'as':_0x10a11c['as'],'attributes':_0x10a11c[_0xe953('0x1c')],'include':_0x10a11c[_0xe953('0x1f')]?_[_0xe953('0x1d')](_0x10a11c[_0xe953('0x1f')],function(_0x36b83a){return{'model':db[_0x36b83a['model']],'as':_0x36b83a['as'],'attributes':_0x36b83a[_0xe953('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x267a14){logger[_0xe953('0xf')](_0xe953('0x20'),_0x1f42eb);logger['debug'](_0xe953('0x20'),_0x1f42eb,JSON[_0xe953('0x13')](_0x267a14));_0x206aaa(_0x267a14);})[_0xe953('0x17')](function(_0x3ad488){logger['error'](_0xe953('0x20'),_0x3ad488[_0xe953('0x15')],_0x1f42eb);_0x50dc5d(_0x3cc562[_0xe953('0x14')](0x1f4,_0x3ad488['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6c5f3eb..07e6874 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 _0x6d76=['length','whatsappQueue:','./whatsappQueue.events','remove','emit','removeListener','register'];(function(_0x41c638,_0x3a5f97){var _0x52edad=function(_0x549bfe){while(--_0x549bfe){_0x41c638['push'](_0x41c638['shift']());}};_0x52edad(++_0x3a5f97);}(_0x6d76,0x152));var _0x66d7=function(_0x4f4a30,_0x708fc3){_0x4f4a30=_0x4f4a30-0x0;var _0x176203=_0x6d76[_0x4f4a30];return _0x176203;};'use strict';var WhatsappQueueEvents=require(_0x66d7('0x0'));var events=['save',_0x66d7('0x1'),'update'];function createListener(_0x20f667,_0x2f327e){return function(_0x406892){_0x2f327e[_0x66d7('0x2')](_0x20f667,_0x406892);};}function removeListener(_0x18f6f5,_0x4d432e){return function(){WhatsappQueueEvents[_0x66d7('0x3')](_0x18f6f5,_0x4d432e);};}exports[_0x66d7('0x4')]=function(_0x428d18){for(var _0x1f4dc7=0x0,_0x27d760=events[_0x66d7('0x5')];_0x1f4dc7<_0x27d760;_0x1f4dc7++){var _0x384f8d=events[_0x1f4dc7];var _0x40dfe6=createListener(_0x66d7('0x6')+_0x384f8d,_0x428d18);WhatsappQueueEvents['on'](_0x384f8d,_0x40dfe6);}}; \ No newline at end of file +var _0x6a3b=['length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x6a3b,0xd2));var _0xb6a3=function(_0x4af254,_0x38ce23){_0x4af254=_0x4af254-0x0;var _0x585473=_0x6a3b[_0x4af254];return _0x585473;};'use strict';var WhatsappQueueEvents=require(_0xb6a3('0x0'));var events=['save',_0xb6a3('0x1'),_0xb6a3('0x2')];function createListener(_0x2d3e0e,_0x5df334){return function(_0x5337a4){_0x5df334[_0xb6a3('0x3')](_0x2d3e0e,_0x5337a4);};}function removeListener(_0x265efa,_0x1f16e3){return function(){WhatsappQueueEvents[_0xb6a3('0x4')](_0x265efa,_0x1f16e3);};}exports[_0xb6a3('0x5')]=function(_0x162d51){for(var _0x2eab77=0x0,_0x94e967=events[_0xb6a3('0x6')];_0x2eab77<_0x94e967;_0x2eab77++){var _0x36b472=events[_0x2eab77];var _0x3eaf3d=createListener(_0xb6a3('0x7')+_0x36b472,_0x162d51);WhatsappQueueEvents['on'](_0x36b472,_0x3eaf3d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 556c6a0..040736a 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 _0xf8bc=['/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe'];(function(_0x54daaa,_0x10a3c0){var _0x1c7b12=function(_0x50bbb6){while(--_0x50bbb6){_0x54daaa['push'](_0x54daaa['shift']());}};_0x1c7b12(++_0x10a3c0);}(_0xf8bc,0x190));var _0xcf8b=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0xf8bc[_0x1b92a6];return _0x24be5b;};'use strict';var multer=require('multer');var util=require(_0xcf8b('0x0'));var path=require('path');var timeout=require(_0xcf8b('0x1'));var express=require('express');var router=express[_0xcf8b('0x2')]();var fs_extra=require(_0xcf8b('0x3'));var auth=require(_0xcf8b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xcf8b('0x5')](),controller['index']);router[_0xcf8b('0x6')](_0xcf8b('0x7'),auth[_0xcf8b('0x5')](),controller['describe']);router[_0xcf8b('0x6')](_0xcf8b('0x8'),auth[_0xcf8b('0x5')](),controller[_0xcf8b('0x9')]);router[_0xcf8b('0xa')]('/',auth[_0xcf8b('0x5')](),controller[_0xcf8b('0xb')]);router[_0xcf8b('0xc')]('/:id',auth[_0xcf8b('0x5')](),controller[_0xcf8b('0xd')]);router[_0xcf8b('0xe')](_0xcf8b('0x8'),auth[_0xcf8b('0x5')](),controller[_0xcf8b('0xf')]);module[_0xcf8b('0x10')]=router; \ No newline at end of file +var _0xb09c=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xb09c,0xd0));var _0xcb09=function(_0x32a6c6,_0x39d226){_0x32a6c6=_0x32a6c6-0x0;var _0x23535e=_0xb09c[_0x32a6c6];return _0x23535e;};'use strict';var multer=require(_0xcb09('0x0'));var util=require(_0xcb09('0x1'));var path=require('path');var timeout=require(_0xcb09('0x2'));var express=require('express');var router=express[_0xcb09('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcb09('0x4'));var interaction=require(_0xcb09('0x5'));var config=require(_0xcb09('0x6'));var controller=require(_0xcb09('0x7'));router[_0xcb09('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb09('0x9')]);router['get'](_0xcb09('0xa'),auth[_0xcb09('0xb')](),controller['describe']);router[_0xcb09('0x8')](_0xcb09('0xc'),auth[_0xcb09('0xb')](),controller[_0xcb09('0xd')]);router[_0xcb09('0xe')]('/',auth[_0xcb09('0xb')](),controller[_0xcb09('0xf')]);router[_0xcb09('0x10')](_0xcb09('0xc'),auth[_0xcb09('0xb')](),controller[_0xcb09('0x11')]);router[_0xcb09('0x12')](_0xcb09('0xc'),auth[_0xcb09('0xb')](),controller[_0xcb09('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 32e951c..6f59ccf 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(_0x111a8f,_0x34ed4e){var _0x326550=function(_0x4d5ff3){while(--_0x4d5ff3){_0x111a8f['push'](_0x111a8f['shift']());}};_0x326550(++_0x34ed4e);}(_0x7a54,0x106));var _0x47a5=function(_0x113cca,_0x3ec808){_0x113cca=_0x113cca-0x0;var _0x11daa0=_0x7a54[_0x113cca];return _0x11daa0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5d0b84,_0x383f77){var _0x2f6b57=function(_0x3e2fab){while(--_0x3e2fab){_0x5d0b84['push'](_0x5d0b84['shift']());}};_0x2f6b57(++_0x383f77);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 5c850ce..7d677d6 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 _0x3423=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x40f585,_0x453cbb){var _0x5384e6=function(_0x3d11d9){while(--_0x3d11d9){_0x40f585['push'](_0x40f585['shift']());}};_0x5384e6(++_0x453cbb);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3342('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716d80,_0x36e1f4){_0x36e1f4=_0x36e1f4||0xcc;return function(_0x592ba8){if(_0x592ba8){return _0x716d80[_0x3342('0x16')](_0x36e1f4);}return _0x716d80[_0x3342('0x17')](_0x36e1f4)[_0x3342('0x18')]();};}function respondWithResult(_0xe4689e,_0x61fcc0){_0x61fcc0=_0x61fcc0||0xc8;return function(_0x104077){if(_0x104077){return _0xe4689e[_0x3342('0x17')](_0x61fcc0)['json'](_0x104077);}};}function respondWithFilteredResult(_0x3e44f3,_0x19bd71){return function(_0x49afe3){if(_0x49afe3){var _0x40d609=typeof _0x19bd71[_0x3342('0x19')]==='undefined'&&typeof _0x19bd71['limit']===_0x3342('0x1a');var _0x143cf1=_0x49afe3[_0x3342('0x1b')];var _0x2075cb=_0x40d609?0x0:_0x19bd71[_0x3342('0x19')];var _0x156c24=_0x40d609?_0x49afe3[_0x3342('0x1b')]:_0x19bd71[_0x3342('0x19')]+_0x19bd71[_0x3342('0x1c')];var _0x4f4c2a;if(_0x156c24>=_0x143cf1){_0x156c24=_0x143cf1;_0x4f4c2a=0xc8;}else{_0x4f4c2a=0xce;}_0x3e44f3[_0x3342('0x17')](_0x4f4c2a);return _0x3e44f3[_0x3342('0x1d')](_0x3342('0x1e'),_0x2075cb+'-'+_0x156c24+'/'+_0x143cf1)['json'](_0x49afe3);}return null;};}function patchUpdates(_0x3cb86f){return function(_0x463324){try{jsonpatch['apply'](_0x463324,_0x3cb86f,!![]);}catch(_0xe774b7){return BPromise[_0x3342('0x1f')](_0xe774b7);}return _0x463324['save']();};}function saveUpdates(_0x4e1b19,_0x5a0658){return function(_0x3f271c){if(_0x3f271c){return _0x3f271c[_0x3342('0x20')](_0x4e1b19)[_0x3342('0x21')](function(_0x2dbad1){return _0x2dbad1;});}return null;};}function removeEntity(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(_0x26eb87){return _0x26eb87[_0x3342('0x22')]()['then'](function(){_0xd2b87d[_0x3342('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51cf45,_0x986ab0){return function(_0x52ba65){if(!_0x52ba65){_0x51cf45['sendStatus'](0x194);}return _0x52ba65;};}function handleError(_0x247ee4,_0x58f0f5){_0x58f0f5=_0x58f0f5||0x1f4;return function(_0x37df78){logger['error'](_0x37df78['stack']);if(_0x37df78['name']){delete _0x37df78[_0x3342('0x23')];}_0x247ee4[_0x3342('0x17')](_0x58f0f5)[_0x3342('0x24')](_0x37df78);};}exports['index']=function(_0xc275a1,_0x1275e2){var _0x1cc542={},_0x272a52={},_0x4fbfb7={'count':0x0,'rows':[]};var _0x27e25b=_[_0x3342('0x25')](db[_0x3342('0x26')][_0x3342('0x27')],function(_0xf82530){return{'name':_0xf82530[_0x3342('0x28')],'type':_0xf82530[_0x3342('0x29')]['key']};});_0x272a52[_0x3342('0x2a')]=_['map'](_0x27e25b,_0x3342('0x23'));_0x272a52[_0x3342('0x2b')]=_['keys'](_0xc275a1[_0x3342('0x2b')]);_0x272a52[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],_0x272a52['query']);_0x1cc542[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x2f')]));_0x1cc542[_0x3342('0x2e')]=_0x1cc542[_0x3342('0x2e')][_0x3342('0x30')]?_0x1cc542[_0x3342('0x2e')]:_0x272a52[_0x3342('0x2a')];if(!_0xc275a1[_0x3342('0x2b')]['hasOwnProperty']('nolimit')){_0x1cc542[_0x3342('0x1c')]=qs['limit'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x1c')]);_0x1cc542[_0x3342('0x19')]=qs[_0x3342('0x19')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x19')]);}_0x1cc542[_0x3342('0x31')]=qs['sort'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x32')]);_0x1cc542[_0x3342('0x33')]=qs[_0x3342('0x2c')](_[_0x3342('0x34')](_0xc275a1['query'],_0x272a52[_0x3342('0x2c')]),_0x27e25b);if(_0xc275a1['query'][_0x3342('0x35')]){_0x1cc542[_0x3342('0x33')]=_[_0x3342('0x36')](_0x1cc542[_0x3342('0x33')],{'$or':_['map'](_0x27e25b,function(_0x370cfa){if(_0x370cfa['type']!==_0x3342('0x37')){var _0x128657={};_0x128657[_0x370cfa[_0x3342('0x23')]]={'$like':'%'+_0xc275a1[_0x3342('0x2b')][_0x3342('0x35')]+'%'};return _0x128657;}})});}_0x1cc542=_[_0x3342('0x36')]({},_0x1cc542,_0xc275a1[_0x3342('0x38')]);var _0x52cdc0={'where':_0x1cc542[_0x3342('0x33')]};return db[_0x3342('0x26')]['count'](_0x52cdc0)[_0x3342('0x21')](function(_0x1f336c){_0x4fbfb7['count']=_0x1f336c;if(_0xc275a1[_0x3342('0x2b')][_0x3342('0x39')]){_0x1cc542['include']=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x1cc542);})[_0x3342('0x21')](function(_0x41e727){_0x4fbfb7['rows']=_0x41e727;return _0x4fbfb7;})[_0x3342('0x21')](respondWithFilteredResult(_0x1275e2,_0x1cc542))[_0x3342('0x3a')](handleError(_0x1275e2,null));};exports[_0x3342('0x3b')]=function(_0x17fd01,_0x126ee4){var _0x308363={'raw':!![],'where':{'id':_0x17fd01[_0x3342('0x3c')]['id']}},_0x34de7b={};_0x34de7b['model']=_['keys'](db[_0x3342('0x26')][_0x3342('0x27')]);_0x34de7b[_0x3342('0x2b')]=_[_0x3342('0x3d')](_0x17fd01[_0x3342('0x2b')]);_0x34de7b[_0x3342('0x2c')]=_['intersection'](_0x34de7b[_0x3342('0x2a')],_0x34de7b[_0x3342('0x2b')]);_0x308363[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x34de7b[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0x17fd01['query'][_0x3342('0x2f')]));_0x308363['attributes']=_0x308363[_0x3342('0x2e')][_0x3342('0x30')]?_0x308363[_0x3342('0x2e')]:_0x34de7b[_0x3342('0x2a')];if(_0x17fd01['query'][_0x3342('0x39')]){_0x308363[_0x3342('0x3e')]=[{'all':!![]}];}_0x308363=_['merge']({},_0x308363,_0x17fd01[_0x3342('0x38')]);return db[_0x3342('0x26')][_0x3342('0x3f')](_0x308363)[_0x3342('0x21')](handleEntityNotFound(_0x126ee4,null))['then'](respondWithResult(_0x126ee4,null))[_0x3342('0x3a')](handleError(_0x126ee4,null));};exports[_0x3342('0x40')]=function(_0x56b465,_0x1fc491){return db['WhatsappQueueReport']['create'](_0x56b465[_0x3342('0x41')],{})[_0x3342('0x21')](respondWithResult(_0x1fc491,0xc9))[_0x3342('0x3a')](handleError(_0x1fc491,null));};exports[_0x3342('0x20')]=function(_0x23925e,_0x171387){if(_0x23925e[_0x3342('0x41')]['id']){delete _0x23925e['body']['id'];}return db['WhatsappQueueReport'][_0x3342('0x3f')]({'where':{'id':_0x23925e['params']['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x171387,null))['then'](saveUpdates(_0x23925e['body'],null))['then'](respondWithResult(_0x171387,null))[_0x3342('0x3a')](handleError(_0x171387,null));};exports[_0x3342('0x22')]=function(_0x29ccb6,_0x186a2a){return db['WhatsappQueueReport'][_0x3342('0x3f')]({'where':{'id':_0x29ccb6[_0x3342('0x3c')]['id']}})['then'](handleEntityNotFound(_0x186a2a,null))[_0x3342('0x21')](removeEntity(_0x186a2a,null))[_0x3342('0x3a')](handleError(_0x186a2a,null));};exports[_0x3342('0x42')]=function(_0x4c0dc0,_0x189b68){return db[_0x3342('0x26')][_0x3342('0x42')]()[_0x3342('0x21')](respondWithResult(_0x189b68,null))[_0x3342('0x3a')](handleError(_0x189b68,null));}; \ No newline at end of file +var _0x34b7=['WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','show','params','includeAll','include','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x34b7,0x196));var _0x734b=function(_0x2c7341,_0x293a18){_0x2c7341=_0x2c7341-0x0;var _0x23f3fc=_0x34b7[_0x2c7341];return _0x23f3fc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x26')]();});}};}function handleEntityNotFound(_0x3abbe6,_0x44ffa9){return function(_0x148abe){if(!_0x148abe){_0x3abbe6[_0x734b('0x18')](0x194);}return _0x148abe;};}function handleError(_0x566d55,_0x49732b){_0x49732b=_0x49732b||0x1f4;return function(_0x13cc5a){logger[_0x734b('0x27')](_0x13cc5a['stack']);if(_0x13cc5a[_0x734b('0x28')]){delete _0x13cc5a[_0x734b('0x28')];}_0x566d55[_0x734b('0x19')](_0x49732b)[_0x734b('0x29')](_0x13cc5a);};}exports[_0x734b('0x2a')]=function(_0x1b8295,_0x3ba39c){var _0x5c6c5d={},_0x1f3652={},_0x436efe={'count':0x0,'rows':[]};var _0x42e9ae=_[_0x734b('0x2b')](db[_0x734b('0x2c')][_0x734b('0x2d')],function(_0x1fed72){return{'name':_0x1fed72[_0x734b('0x2e')],'type':_0x1fed72[_0x734b('0x2f')][_0x734b('0x30')]};});_0x1f3652['model']=_[_0x734b('0x2b')](_0x42e9ae,_0x734b('0x28'));_0x1f3652['query']=_[_0x734b('0x31')](_0x1b8295[_0x734b('0x32')]);_0x1f3652[_0x734b('0x33')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],_0x1f3652[_0x734b('0x32')]);_0x5c6c5d[_0x734b('0x36')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],qs[_0x734b('0x37')](_0x1b8295[_0x734b('0x32')][_0x734b('0x37')]));_0x5c6c5d[_0x734b('0x36')]=_0x5c6c5d[_0x734b('0x36')][_0x734b('0x38')]?_0x5c6c5d['attributes']:_0x1f3652[_0x734b('0x35')];if(!_0x1b8295['query'][_0x734b('0x39')](_0x734b('0x3a'))){_0x5c6c5d[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x1b8295[_0x734b('0x32')][_0x734b('0x1e')]);_0x5c6c5d['offset']=qs['offset'](_0x1b8295[_0x734b('0x32')]['offset']);}_0x5c6c5d[_0x734b('0x3b')]=qs['sort'](_0x1b8295[_0x734b('0x32')]['sort']);_0x5c6c5d[_0x734b('0x3c')]=qs['filters'](_[_0x734b('0x3d')](_0x1b8295[_0x734b('0x32')],_0x1f3652[_0x734b('0x33')]),_0x42e9ae);if(_0x1b8295[_0x734b('0x32')][_0x734b('0x3e')]){_0x5c6c5d[_0x734b('0x3c')]=_[_0x734b('0x3f')](_0x5c6c5d['where'],{'$or':_[_0x734b('0x2b')](_0x42e9ae,function(_0x317d32){if(_0x317d32['type']!==_0x734b('0x40')){var _0x309b31={};_0x309b31[_0x317d32[_0x734b('0x28')]]={'$like':'%'+_0x1b8295[_0x734b('0x32')]['filter']+'%'};return _0x309b31;}})});}_0x5c6c5d=_[_0x734b('0x3f')]({},_0x5c6c5d,_0x1b8295[_0x734b('0x41')]);var _0x4efb1f={'where':_0x5c6c5d[_0x734b('0x3c')]};return db[_0x734b('0x2c')]['count'](_0x4efb1f)[_0x734b('0x24')](function(_0x2d8f31){_0x436efe[_0x734b('0x1d')]=_0x2d8f31;if(_0x1b8295[_0x734b('0x32')]['includeAll']){_0x5c6c5d['include']=[{'all':!![]}];}return db[_0x734b('0x2c')]['findAll'](_0x5c6c5d);})['then'](function(_0x121a00){_0x436efe['rows']=_0x121a00;return _0x436efe;})[_0x734b('0x24')](respondWithFilteredResult(_0x3ba39c,_0x5c6c5d))['catch'](handleError(_0x3ba39c,null));};exports[_0x734b('0x42')]=function(_0x337106,_0xe4fe38){var _0x4c3fdc={'raw':!![],'where':{'id':_0x337106[_0x734b('0x43')]['id']}},_0x5cf3a0={};_0x5cf3a0['model']=_['keys'](db[_0x734b('0x2c')][_0x734b('0x2d')]);_0x5cf3a0['query']=_[_0x734b('0x31')](_0x337106['query']);_0x5cf3a0[_0x734b('0x33')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],_0x5cf3a0['query']);_0x4c3fdc[_0x734b('0x36')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],qs[_0x734b('0x37')](_0x337106['query']['fields']));_0x4c3fdc['attributes']=_0x4c3fdc[_0x734b('0x36')]['length']?_0x4c3fdc['attributes']:_0x5cf3a0[_0x734b('0x35')];if(_0x337106['query'][_0x734b('0x44')]){_0x4c3fdc[_0x734b('0x45')]=[{'all':!![]}];}_0x4c3fdc=_[_0x734b('0x3f')]({},_0x4c3fdc,_0x337106[_0x734b('0x41')]);return db['WhatsappQueueReport'][_0x734b('0x46')](_0x4c3fdc)['then'](handleEntityNotFound(_0xe4fe38,null))[_0x734b('0x24')](respondWithResult(_0xe4fe38,null))[_0x734b('0x47')](handleError(_0xe4fe38,null));};exports[_0x734b('0x48')]=function(_0x5cdacb,_0x370326){return db['WhatsappQueueReport'][_0x734b('0x48')](_0x5cdacb[_0x734b('0x49')],{})['then'](respondWithResult(_0x370326,0xc9))[_0x734b('0x47')](handleError(_0x370326,null));};exports[_0x734b('0x4a')]=function(_0x145ced,_0x38125a){if(_0x145ced[_0x734b('0x49')]['id']){delete _0x145ced['body']['id'];}return db[_0x734b('0x2c')]['find']({'where':{'id':_0x145ced[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x38125a,null))[_0x734b('0x24')](saveUpdates(_0x145ced[_0x734b('0x49')],null))[_0x734b('0x24')](respondWithResult(_0x38125a,null))[_0x734b('0x47')](handleError(_0x38125a,null));};exports[_0x734b('0x25')]=function(_0x4b70f2,_0x4c0378){return db['WhatsappQueueReport'][_0x734b('0x46')]({'where':{'id':_0x4b70f2[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c0378,null))[_0x734b('0x24')](removeEntity(_0x4c0378,null))[_0x734b('0x47')](handleError(_0x4c0378,null));};exports['describe']=function(_0x167173,_0x3a9749){return db[_0x734b('0x2c')]['describe']()[_0x734b('0x24')](respondWithResult(_0x3a9749,null))[_0x734b('0x47')](handleError(_0x3a9749,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a3116e8..d4260e0 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 _0x498a=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x498a,0x145));var _0xa498=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x498a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xa498('0x0'));var util=require(_0xa498('0x1'));var logger=require(_0xa498('0x2'))('api');var moment=require(_0xa498('0x3'));var BPromise=require(_0xa498('0x4'));var rp=require(_0xa498('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa498('0x6'));var config=require(_0xa498('0x7'));var attributes=require(_0xa498('0x8'));module[_0xa498('0x9')]=function(_0x1148b9,_0x5f2689){return _0x1148b9[_0xa498('0xa')](_0xa498('0xb'),attributes,{'tableName':_0xa498('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa498('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e78=['define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x427a73,_0xb4fc9d){var _0x29f4cc=function(_0x1db86e){while(--_0x1db86e){_0x427a73['push'](_0x427a73['shift']());}};_0x29f4cc(++_0xb4fc9d);}(_0x7e78,0x1bd));var _0x87e7=function(_0x544838,_0x225d92){_0x544838=_0x544838-0x0;var _0x2ab971=_0x7e78[_0x544838];return _0x2ab971;};'use strict';var _=require(_0x87e7('0x0'));var util=require(_0x87e7('0x1'));var logger=require(_0x87e7('0x2'))('api');var moment=require(_0x87e7('0x3'));var BPromise=require(_0x87e7('0x4'));var rp=require(_0x87e7('0x5'));var fs=require('fs');var path=require(_0x87e7('0x6'));var rimraf=require(_0x87e7('0x7'));var config=require(_0x87e7('0x8'));var attributes=require(_0x87e7('0x9'));module['exports']=function(_0x22f28b,_0x296b51){return _0x22f28b[_0x87e7('0xa')](_0x87e7('0xb'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x87e7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 7753ae3..3d2416e 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 _0x99cc=['bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','then','UpdateWhatsappQueueReport','body','where','attributes','lodash','util'];(function(_0x4e7639,_0x5e4fb7){var _0x463aa4=function(_0x3bcfdd){while(--_0x3bcfdd){_0x4e7639['push'](_0x4e7639['shift']());}};_0x463aa4(++_0x5e4fb7);}(_0x99cc,0x1a2));var _0xc99c=function(_0x5ede2f,_0x128864){_0x5ede2f=_0x5ede2f-0x0;var _0x31048f=_0x99cc[_0x5ede2f];return _0x31048f;};'use strict';var _=require(_0xc99c('0x0'));var util=require(_0xc99c('0x1'));var moment=require('moment');var BPromise=require(_0xc99c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc99c('0x3'));var logger=require('../../config/logger')(_0xc99c('0x4'));var config=require(_0xc99c('0x5'));var jayson=require(_0xc99c('0x6'));var client=jayson[_0xc99c('0x7')][_0xc99c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcf1b8b,_0x225920,_0x4200c3){return new BPromise(function(_0x5f41bc,_0x4f7975){return client[_0xc99c('0x9')](_0xcf1b8b,_0x4200c3)['then'](function(_0x208d96){logger[_0xc99c('0xa')](_0xc99c('0xb'),_0x225920,_0xc99c('0xc'));logger[_0xc99c('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x225920,'request\x20sent',JSON[_0xc99c('0xe')](_0x208d96));if(_0x208d96[_0xc99c('0xf')]){if(_0x208d96[_0xc99c('0xf')][_0xc99c('0x10')]===0x1f4){logger[_0xc99c('0xf')](_0xc99c('0xb'),_0x225920,_0x208d96[_0xc99c('0xf')][_0xc99c('0x11')]);return _0x4f7975(_0x208d96['error'][_0xc99c('0x11')]);}logger[_0xc99c('0xf')](_0xc99c('0xb'),_0x225920,_0x208d96[_0xc99c('0xf')][_0xc99c('0x11')]);return _0x5f41bc(_0x208d96[_0xc99c('0xf')][_0xc99c('0x11')]);}else{logger[_0xc99c('0xa')](_0xc99c('0xb'),_0x225920,_0xc99c('0xc'));_0x5f41bc(_0x208d96[_0xc99c('0x12')][_0xc99c('0x11')]);}})[_0xc99c('0x13')](function(_0x3608fa){logger['error'](_0xc99c('0xb'),_0x225920,_0x3608fa);_0x4f7975(_0x3608fa);});});}exports[_0xc99c('0x14')]=function(_0x338db4){var _0x1dae99=this;return new Promise(function(_0x2b19a2,_0x41e89d){return db[_0xc99c('0x15')][_0xc99c('0x16')](_0x338db4['body'],{'raw':_0x338db4[_0xc99c('0x17')]?_0x338db4[_0xc99c('0x17')][_0xc99c('0x18')]===undefined?!![]:![]:!![]})[_0xc99c('0x19')](function(_0x30b469){logger[_0xc99c('0xa')](_0xc99c('0x14'),_0x338db4);logger[_0xc99c('0xd')](_0xc99c('0x14'),_0x338db4,JSON[_0xc99c('0xe')](_0x30b469));_0x2b19a2(_0x30b469);})[_0xc99c('0x13')](function(_0xc85dd3){logger[_0xc99c('0xf')](_0xc99c('0x14'),_0xc85dd3[_0xc99c('0x11')],_0x338db4);_0x41e89d(_0x1dae99[_0xc99c('0xf')](0x1f4,_0xc85dd3['message']));});});};exports[_0xc99c('0x1a')]=function(_0x5139cb){var _0x1fff06=this;return new Promise(function(_0x2a5ea9,_0x317dc7){return db[_0xc99c('0x15')]['update'](_0x5139cb[_0xc99c('0x1b')],{'raw':_0x5139cb[_0xc99c('0x17')]?_0x5139cb[_0xc99c('0x17')][_0xc99c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5139cb['options']?_0x5139cb[_0xc99c('0x17')][_0xc99c('0x1c')]||null:null,'attributes':_0x5139cb['options']?_0x5139cb['options'][_0xc99c('0x1d')]||null:null,'limit':_0x5139cb['options']?_0x5139cb['options']['limit']||null:null})[_0xc99c('0x19')](function(_0x542e2f){logger[_0xc99c('0xa')](_0xc99c('0x1a'),_0x5139cb);logger[_0xc99c('0xd')](_0xc99c('0x1a'),_0x5139cb,JSON['stringify'](_0x542e2f));_0x2a5ea9(_0x542e2f);})['catch'](function(_0x6eb1de){logger['error']('UpdateWhatsappQueueReport',_0x6eb1de[_0xc99c('0x11')],_0x5139cb);_0x317dc7(_0x1fff06[_0xc99c('0xf')](0x1f4,_0x6eb1de[_0xc99c('0x11')]));});});}; \ No newline at end of file +var _0x9e67=['catch','UpdateWhatsappQueueReport','update','where','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','stringify'];(function(_0x341d9c,_0x4d6604){var _0x2f63f2=function(_0x46039d){while(--_0x46039d){_0x341d9c['push'](_0x341d9c['shift']());}};_0x2f63f2(++_0x4d6604);}(_0x9e67,0x150));var _0x79e6=function(_0x4a0a79,_0x3c3b76){_0x4a0a79=_0x4a0a79-0x0;var _0x32b02a=_0x9e67[_0x4a0a79];return _0x32b02a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x79e6('0x0'));var rs=require(_0x79e6('0x1'));var fs=require('fs');var Redis=require(_0x79e6('0x2'));var db=require(_0x79e6('0x3'))['db'];var utils=require(_0x79e6('0x4'));var logger=require('../../config/logger')(_0x79e6('0x5'));var config=require(_0x79e6('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26b008,_0x5e4e56,_0x52a4c3){return new BPromise(function(_0x3fd4cc,_0x22cedb){return client[_0x79e6('0x7')](_0x26b008,_0x52a4c3)['then'](function(_0x36cab1){logger[_0x79e6('0x8')](_0x79e6('0x9'),_0x5e4e56,_0x79e6('0xa'));logger[_0x79e6('0xb')](_0x79e6('0xc'),_0x5e4e56,_0x79e6('0xa'),JSON['stringify'](_0x36cab1));if(_0x36cab1['error']){if(_0x36cab1['error']['code']===0x1f4){logger[_0x79e6('0xd')](_0x79e6('0x9'),_0x5e4e56,_0x36cab1['error'][_0x79e6('0xe')]);return _0x22cedb(_0x36cab1[_0x79e6('0xd')][_0x79e6('0xe')]);}logger[_0x79e6('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5e4e56,_0x36cab1[_0x79e6('0xd')][_0x79e6('0xe')]);return _0x3fd4cc(_0x36cab1[_0x79e6('0xd')][_0x79e6('0xe')]);}else{logger[_0x79e6('0x8')](_0x79e6('0x9'),_0x5e4e56,_0x79e6('0xa'));_0x3fd4cc(_0x36cab1[_0x79e6('0xf')]['message']);}})['catch'](function(_0x5765f8){logger['error'](_0x79e6('0x9'),_0x5e4e56,_0x5765f8);_0x22cedb(_0x5765f8);});});}exports['CreateWhatsappQueueReport']=function(_0x876c6a){var _0x225010=this;return new Promise(function(_0x398d85,_0x25f6ea){return db[_0x79e6('0x10')][_0x79e6('0x11')](_0x876c6a[_0x79e6('0x12')],{'raw':_0x876c6a[_0x79e6('0x13')]?_0x876c6a[_0x79e6('0x13')][_0x79e6('0x14')]===undefined?!![]:![]:!![]})[_0x79e6('0x15')](function(_0x10208a){logger[_0x79e6('0x8')](_0x79e6('0x16'),_0x876c6a);logger[_0x79e6('0xb')](_0x79e6('0x16'),_0x876c6a,JSON[_0x79e6('0x17')](_0x10208a));_0x398d85(_0x10208a);})[_0x79e6('0x18')](function(_0x4d3eea){logger[_0x79e6('0xd')](_0x79e6('0x16'),_0x4d3eea[_0x79e6('0xe')],_0x876c6a);_0x25f6ea(_0x225010['error'](0x1f4,_0x4d3eea[_0x79e6('0xe')]));});});};exports[_0x79e6('0x19')]=function(_0x3ffc2b){var _0x3ee961=this;return new Promise(function(_0x274caa,_0x1d435c){return db[_0x79e6('0x10')][_0x79e6('0x1a')](_0x3ffc2b[_0x79e6('0x12')],{'raw':_0x3ffc2b[_0x79e6('0x13')]?_0x3ffc2b[_0x79e6('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ffc2b[_0x79e6('0x13')]?_0x3ffc2b[_0x79e6('0x13')][_0x79e6('0x1b')]||null:null,'attributes':_0x3ffc2b[_0x79e6('0x13')]?_0x3ffc2b[_0x79e6('0x13')][_0x79e6('0x1c')]||null:null,'limit':_0x3ffc2b[_0x79e6('0x13')]?_0x3ffc2b[_0x79e6('0x13')][_0x79e6('0x1d')]||null:null})['then'](function(_0x3520e8){logger[_0x79e6('0x8')](_0x79e6('0x19'),_0x3ffc2b);logger[_0x79e6('0xb')](_0x79e6('0x19'),_0x3ffc2b,JSON['stringify'](_0x3520e8));_0x274caa(_0x3520e8);})['catch'](function(_0xe194a6){logger[_0x79e6('0xd')](_0x79e6('0x19'),_0xe194a6[_0x79e6('0xe')],_0x3ffc2b);_0x1d435c(_0x3ee961['error'](0x1f4,_0xe194a6[_0x79e6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index fa6eaa1..b2a537a 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 _0xc104=['put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x1b1ce5,_0x508743){var _0x432ff6=function(_0x28fd31){while(--_0x28fd31){_0x1b1ce5['push'](_0x1b1ce5['shift']());}};_0x432ff6(++_0x508743);}(_0xc104,0x82));var _0x4c10=function(_0x3b08de,_0x63ddd0){_0x3b08de=_0x3b08de-0x0;var _0x53fbe4=_0xc104[_0x3b08de];return _0x53fbe4;};'use strict';var multer=require(_0x4c10('0x0'));var util=require(_0x4c10('0x1'));var path=require(_0x4c10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c10('0x3')]();var fs_extra=require(_0x4c10('0x4'));var auth=require(_0x4c10('0x5'));var interaction=require(_0x4c10('0x6'));var config=require(_0x4c10('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x4c10('0x8')]('/',auth[_0x4c10('0x9')](),controller[_0x4c10('0xa')]);router['get'](_0x4c10('0xb'),auth[_0x4c10('0x9')](),controller[_0x4c10('0xc')]);router['get'](_0x4c10('0xd'),auth[_0x4c10('0x9')](),controller[_0x4c10('0xe')]);router[_0x4c10('0xf')]('/',auth['isAuthenticated'](),controller[_0x4c10('0x10')]);router[_0x4c10('0x11')]('/:id',auth[_0x4c10('0x9')](),controller[_0x4c10('0x12')]);router[_0x4c10('0x13')](_0x4c10('0xd'),auth['isAuthenticated'](),controller[_0x4c10('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6893=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path'];(function(_0x250f59,_0x56acbe){var _0x2cf205=function(_0x3c0cc2){while(--_0x3c0cc2){_0x250f59['push'](_0x250f59['shift']());}};_0x2cf205(++_0x56acbe);}(_0x6893,0xda));var _0x3689=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0x6893[_0x497d8c];return _0xeafed7;};'use strict';var multer=require('multer');var util=require(_0x3689('0x0'));var path=require(_0x3689('0x1'));var timeout=require(_0x3689('0x2'));var express=require(_0x3689('0x3'));var router=express['Router']();var fs_extra=require(_0x3689('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3689('0x5'));var config=require(_0x3689('0x6'));var controller=require(_0x3689('0x7'));router[_0x3689('0x8')]('/',auth[_0x3689('0x9')](),controller['index']);router[_0x3689('0x8')](_0x3689('0xa'),auth[_0x3689('0x9')](),controller[_0x3689('0xb')]);router['get'](_0x3689('0xc'),auth[_0x3689('0x9')](),controller[_0x3689('0xd')]);router[_0x3689('0xe')]('/',auth[_0x3689('0x9')](),controller[_0x3689('0xf')]);router[_0x3689('0x10')](_0x3689('0xc'),auth[_0x3689('0x9')](),controller[_0x3689('0x11')]);router['delete'](_0x3689('0xc'),auth[_0x3689('0x9')](),controller[_0x3689('0x12')]);module[_0x3689('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5f50788..90b8284 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 _0x94d4=['account','agent','DATE','sequelize','exports','ENUM'];(function(_0x18507e,_0x9cd0a){var _0x20fdf2=function(_0x28cb01){while(--_0x28cb01){_0x18507e['push'](_0x18507e['shift']());}};_0x20fdf2(++_0x9cd0a);}(_0x94d4,0xa5));var _0x494d=function(_0x52a907,_0x13c1f2){_0x52a907=_0x52a907-0x0;var _0x4990ba=_0x94d4[_0x52a907];return _0x4990ba;};'use strict';var Sequelize=require(_0x494d('0x0'));module[_0x494d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x494d('0x2')](_0x494d('0x3'),_0x494d('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x494d('0x5')]}}; \ No newline at end of file +var _0x6f2f=['agent','sequelize','exports'];(function(_0x3ab24a,_0x134a9b){var _0x2805b2=function(_0x2aec58){while(--_0x2aec58){_0x3ab24a['push'](_0x3ab24a['shift']());}};_0x2805b2(++_0x134a9b);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6f2f[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xf6f2('0x0'));module[_0xf6f2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xf6f2('0x2'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 978f889..0d0b692 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 _0xdc7b=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','stack','name','send','index','map','WhatsappTransferReport','rawAttributes'];(function(_0x2a66dd,_0x500e0e){var _0x128ff4=function(_0x562f6b){while(--_0x562f6b){_0x2a66dd['push'](_0x2a66dd['shift']());}};_0x128ff4(++_0x500e0e);}(_0xdc7b,0x153));var _0xbdc7=function(_0x402dee,_0x419c99){_0x402dee=_0x402dee-0x0;var _0x39bc7f=_0xdc7b[_0x402dee];return _0x39bc7f;};'use strict';var emlformat=require(_0xbdc7('0x0'));var rimraf=require(_0xbdc7('0x1'));var zipdir=require(_0xbdc7('0x2'));var jsonpatch=require(_0xbdc7('0x3'));var rp=require(_0xbdc7('0x4'));var moment=require(_0xbdc7('0x5'));var BPromise=require(_0xbdc7('0x6'));var Mustache=require('mustache');var util=require(_0xbdc7('0x7'));var path=require(_0xbdc7('0x8'));var sox=require(_0xbdc7('0x9'));var csv=require('to-csv');var ejs=require(_0xbdc7('0xa'));var fs=require('fs');var fs_extra=require(_0xbdc7('0xb'));var _=require(_0xbdc7('0xc'));var squel=require(_0xbdc7('0xd'));var crypto=require(_0xbdc7('0xe'));var jsforce=require(_0xbdc7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbdc7('0x10'));var querystring=require(_0xbdc7('0x11'));var Papa=require(_0xbdc7('0x12'));var Redis=require(_0xbdc7('0x13'));var authService=require(_0xbdc7('0x14'));var qs=require(_0xbdc7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdc7('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xbdc7('0x17'));var config=require(_0xbdc7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbdc7('0x19'))['db'];function respondWithStatusCode(_0x564745,_0x35c48b){_0x35c48b=_0x35c48b||0xcc;return function(_0x375900){if(_0x375900){return _0x564745[_0xbdc7('0x1a')](_0x35c48b);}return _0x564745[_0xbdc7('0x1b')](_0x35c48b)[_0xbdc7('0x1c')]();};}function respondWithResult(_0x18daec,_0x589967){_0x589967=_0x589967||0xc8;return function(_0x3045f3){if(_0x3045f3){return _0x18daec[_0xbdc7('0x1b')](_0x589967)[_0xbdc7('0x1d')](_0x3045f3);}};}function respondWithFilteredResult(_0x267145,_0x440282){return function(_0x35630a){if(_0x35630a){var _0x286a38=typeof _0x440282['offset']===_0xbdc7('0x1e')&&typeof _0x440282[_0xbdc7('0x1f')]===_0xbdc7('0x1e');var _0x4a1e1c=_0x35630a[_0xbdc7('0x20')];var _0x5677f9=_0x286a38?0x0:_0x440282[_0xbdc7('0x21')];var _0x5aa1bd=_0x286a38?_0x35630a['count']:_0x440282[_0xbdc7('0x21')]+_0x440282[_0xbdc7('0x1f')];var _0x55cfcc;if(_0x5aa1bd>=_0x4a1e1c){_0x5aa1bd=_0x4a1e1c;_0x55cfcc=0xc8;}else{_0x55cfcc=0xce;}_0x267145[_0xbdc7('0x1b')](_0x55cfcc);return _0x267145[_0xbdc7('0x22')]('Content-Range',_0x5677f9+'-'+_0x5aa1bd+'/'+_0x4a1e1c)['json'](_0x35630a);}return null;};}function patchUpdates(_0x56b9cc){return function(_0x554d54){try{jsonpatch['apply'](_0x554d54,_0x56b9cc,!![]);}catch(_0x322d28){return BPromise[_0xbdc7('0x23')](_0x322d28);}return _0x554d54[_0xbdc7('0x24')]();};}function saveUpdates(_0x4af89e,_0x5d6d2e){return function(_0x46640f){if(_0x46640f){return _0x46640f['update'](_0x4af89e)[_0xbdc7('0x25')](function(_0xa8d731){return _0xa8d731;});}return null;};}function removeEntity(_0x49d8e8,_0x224c4e){return function(_0x38d068){if(_0x38d068){return _0x38d068[_0xbdc7('0x26')]()[_0xbdc7('0x25')](function(){_0x49d8e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f825,_0x23f7af){return function(_0x13edaa){if(!_0x13edaa){_0x44f825[_0xbdc7('0x1a')](0x194);}return _0x13edaa;};}function handleError(_0x3105a1,_0x19d3cf){_0x19d3cf=_0x19d3cf||0x1f4;return function(_0x31046b){logger['error'](_0x31046b[_0xbdc7('0x27')]);if(_0x31046b[_0xbdc7('0x28')]){delete _0x31046b['name'];}_0x3105a1[_0xbdc7('0x1b')](_0x19d3cf)[_0xbdc7('0x29')](_0x31046b);};}exports[_0xbdc7('0x2a')]=function(_0x2435fc,_0xad09d8){var _0x313b3d={},_0x4704ed={},_0x33e745={'count':0x0,'rows':[]};var _0x279bda=_[_0xbdc7('0x2b')](db[_0xbdc7('0x2c')][_0xbdc7('0x2d')],function(_0x52e8b2){return{'name':_0x52e8b2['fieldName'],'type':_0x52e8b2['type'][_0xbdc7('0x2e')]};});_0x4704ed[_0xbdc7('0x2f')]=_[_0xbdc7('0x2b')](_0x279bda,'name');_0x4704ed[_0xbdc7('0x30')]=_['keys'](_0x2435fc[_0xbdc7('0x30')]);_0x4704ed[_0xbdc7('0x31')]=_[_0xbdc7('0x32')](_0x4704ed['model'],_0x4704ed[_0xbdc7('0x30')]);_0x313b3d[_0xbdc7('0x33')]=_[_0xbdc7('0x32')](_0x4704ed[_0xbdc7('0x2f')],qs['fields'](_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x34')]));_0x313b3d[_0xbdc7('0x33')]=_0x313b3d[_0xbdc7('0x33')][_0xbdc7('0x35')]?_0x313b3d[_0xbdc7('0x33')]:_0x4704ed[_0xbdc7('0x2f')];if(!_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x36')](_0xbdc7('0x37'))){_0x313b3d[_0xbdc7('0x1f')]=qs[_0xbdc7('0x1f')](_0x2435fc[_0xbdc7('0x30')]['limit']);_0x313b3d['offset']=qs[_0xbdc7('0x21')](_0x2435fc[_0xbdc7('0x30')]['offset']);}_0x313b3d[_0xbdc7('0x38')]=qs[_0xbdc7('0x39')](_0x2435fc['query'][_0xbdc7('0x39')]);_0x313b3d[_0xbdc7('0x3a')]=qs[_0xbdc7('0x31')](_[_0xbdc7('0x3b')](_0x2435fc[_0xbdc7('0x30')],_0x4704ed['filters']),_0x279bda);if(_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x3c')]){_0x313b3d[_0xbdc7('0x3a')]=_[_0xbdc7('0x3d')](_0x313b3d[_0xbdc7('0x3a')],{'$or':_[_0xbdc7('0x2b')](_0x279bda,function(_0x5346ed){if(_0x5346ed[_0xbdc7('0x3e')]!==_0xbdc7('0x3f')){var _0x4a8d82={};_0x4a8d82[_0x5346ed[_0xbdc7('0x28')]]={'$like':'%'+_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x3c')]+'%'};return _0x4a8d82;}})});}_0x313b3d=_[_0xbdc7('0x3d')]({},_0x313b3d,_0x2435fc[_0xbdc7('0x40')]);var _0x5f1e39={'where':_0x313b3d[_0xbdc7('0x3a')]};return db[_0xbdc7('0x2c')][_0xbdc7('0x20')](_0x5f1e39)[_0xbdc7('0x25')](function(_0x5a427b){_0x33e745[_0xbdc7('0x20')]=_0x5a427b;if(_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x41')]){_0x313b3d[_0xbdc7('0x42')]=[{'all':!![]}];}return db[_0xbdc7('0x2c')][_0xbdc7('0x43')](_0x313b3d);})[_0xbdc7('0x25')](function(_0x3b401a){_0x33e745[_0xbdc7('0x44')]=_0x3b401a;return _0x33e745;})[_0xbdc7('0x25')](respondWithFilteredResult(_0xad09d8,_0x313b3d))[_0xbdc7('0x45')](handleError(_0xad09d8,null));};exports[_0xbdc7('0x46')]=function(_0x10616e,_0x4d424e){var _0xc0c8b9={'raw':!![],'where':{'id':_0x10616e[_0xbdc7('0x47')]['id']}},_0xfc6a6f={};_0xfc6a6f['model']=_[_0xbdc7('0x48')](db[_0xbdc7('0x2c')][_0xbdc7('0x2d')]);_0xfc6a6f['query']=_[_0xbdc7('0x48')](_0x10616e[_0xbdc7('0x30')]);_0xfc6a6f['filters']=_['intersection'](_0xfc6a6f[_0xbdc7('0x2f')],_0xfc6a6f['query']);_0xc0c8b9[_0xbdc7('0x33')]=_[_0xbdc7('0x32')](_0xfc6a6f[_0xbdc7('0x2f')],qs[_0xbdc7('0x34')](_0x10616e[_0xbdc7('0x30')]['fields']));_0xc0c8b9[_0xbdc7('0x33')]=_0xc0c8b9[_0xbdc7('0x33')][_0xbdc7('0x35')]?_0xc0c8b9[_0xbdc7('0x33')]:_0xfc6a6f[_0xbdc7('0x2f')];if(_0x10616e['query']['includeAll']){_0xc0c8b9[_0xbdc7('0x42')]=[{'all':!![]}];}_0xc0c8b9=_[_0xbdc7('0x3d')]({},_0xc0c8b9,_0x10616e['options']);return db['WhatsappTransferReport'][_0xbdc7('0x49')](_0xc0c8b9)[_0xbdc7('0x25')](handleEntityNotFound(_0x4d424e,null))[_0xbdc7('0x25')](respondWithResult(_0x4d424e,null))[_0xbdc7('0x45')](handleError(_0x4d424e,null));};exports[_0xbdc7('0x4a')]=function(_0x53234d,_0x169ae7){return db[_0xbdc7('0x2c')][_0xbdc7('0x4a')](_0x53234d[_0xbdc7('0x4b')],{})['then'](respondWithResult(_0x169ae7,0xc9))['catch'](handleError(_0x169ae7,null));};exports['update']=function(_0x32e8ce,_0x1966ca){if(_0x32e8ce[_0xbdc7('0x4b')]['id']){delete _0x32e8ce[_0xbdc7('0x4b')]['id'];}return db[_0xbdc7('0x2c')][_0xbdc7('0x49')]({'where':{'id':_0x32e8ce[_0xbdc7('0x47')]['id']}})[_0xbdc7('0x25')](handleEntityNotFound(_0x1966ca,null))[_0xbdc7('0x25')](saveUpdates(_0x32e8ce[_0xbdc7('0x4b')],null))[_0xbdc7('0x25')](respondWithResult(_0x1966ca,null))[_0xbdc7('0x45')](handleError(_0x1966ca,null));};exports[_0xbdc7('0x26')]=function(_0x37fe46,_0xa4c9f8){return db[_0xbdc7('0x2c')][_0xbdc7('0x49')]({'where':{'id':_0x37fe46['params']['id']}})[_0xbdc7('0x25')](handleEntityNotFound(_0xa4c9f8,null))['then'](removeEntity(_0xa4c9f8,null))['catch'](handleError(_0xa4c9f8,null));};exports[_0xbdc7('0x4c')]=function(_0x4cf157,_0x44902c){return db['WhatsappTransferReport'][_0xbdc7('0x4c')]()[_0xbdc7('0x25')](respondWithResult(_0x44902c,null))[_0xbdc7('0x45')](handleError(_0x44902c,null));}; \ No newline at end of file +var _0xf971=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x342940,_0x48fa36){var _0x53313d=function(_0x5d80bc){while(--_0x5d80bc){_0x342940['push'](_0x342940['shift']());}};_0x53313d(++_0x48fa36);}(_0xf971,0x114));var _0x1f97=function(_0x16b527,_0x2a0610){_0x16b527=_0x16b527-0x0;var _0x53b4ae=_0xf971[_0x16b527];return _0x53b4ae;};'use strict';var emlformat=require(_0x1f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f97('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1f97('0x2'));var BPromise=require(_0x1f97('0x3'));var Mustache=require(_0x1f97('0x4'));var util=require('util');var path=require(_0x1f97('0x5'));var sox=require(_0x1f97('0x6'));var csv=require(_0x1f97('0x7'));var ejs=require(_0x1f97('0x8'));var fs=require('fs');var fs_extra=require(_0x1f97('0x9'));var _=require(_0x1f97('0xa'));var squel=require(_0x1f97('0xb'));var crypto=require(_0x1f97('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1f97('0x7'));var querystring=require(_0x1f97('0xd'));var Papa=require(_0x1f97('0xe'));var Redis=require(_0x1f97('0xf'));var authService=require(_0x1f97('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1f97('0x11'));var hardwareService=require(_0x1f97('0x12'));var logger=require(_0x1f97('0x13'))(_0x1f97('0x14'));var utils=require(_0x1f97('0x15'));var config=require(_0x1f97('0x16'));var licenseUtil=require(_0x1f97('0x17'));var db=require(_0x1f97('0x18'))['db'];function respondWithStatusCode(_0x584483,_0x2e2b9a){_0x2e2b9a=_0x2e2b9a||0xcc;return function(_0x5b6242){if(_0x5b6242){return _0x584483[_0x1f97('0x19')](_0x2e2b9a);}return _0x584483[_0x1f97('0x1a')](_0x2e2b9a)[_0x1f97('0x1b')]();};}function respondWithResult(_0x3eb3e5,_0x55894f){_0x55894f=_0x55894f||0xc8;return function(_0x5667c7){if(_0x5667c7){return _0x3eb3e5[_0x1f97('0x1a')](_0x55894f)[_0x1f97('0x1c')](_0x5667c7);}};}function respondWithFilteredResult(_0x4d6ec3,_0x1b0ea9){return function(_0x1a26b8){if(_0x1a26b8){var _0x7bf0b3=typeof _0x1b0ea9[_0x1f97('0x1d')]===_0x1f97('0x1e')&&typeof _0x1b0ea9['limit']===_0x1f97('0x1e');var _0x3b533e=_0x1a26b8[_0x1f97('0x1f')];var _0x285ecf=_0x7bf0b3?0x0:_0x1b0ea9[_0x1f97('0x1d')];var _0x43b0d3=_0x7bf0b3?_0x1a26b8[_0x1f97('0x1f')]:_0x1b0ea9['offset']+_0x1b0ea9[_0x1f97('0x20')];var _0x4fbdc0;if(_0x43b0d3>=_0x3b533e){_0x43b0d3=_0x3b533e;_0x4fbdc0=0xc8;}else{_0x4fbdc0=0xce;}_0x4d6ec3[_0x1f97('0x1a')](_0x4fbdc0);return _0x4d6ec3[_0x1f97('0x21')](_0x1f97('0x22'),_0x285ecf+'-'+_0x43b0d3+'/'+_0x3b533e)[_0x1f97('0x1c')](_0x1a26b8);}return null;};}function patchUpdates(_0x25e872){return function(_0x5b7756){try{jsonpatch['apply'](_0x5b7756,_0x25e872,!![]);}catch(_0x7b13fe){return BPromise[_0x1f97('0x23')](_0x7b13fe);}return _0x5b7756[_0x1f97('0x24')]();};}function saveUpdates(_0x5c4282,_0x1ba911){return function(_0x41d853){if(_0x41d853){return _0x41d853[_0x1f97('0x25')](_0x5c4282)[_0x1f97('0x26')](function(_0x3dc1df){return _0x3dc1df;});}return null;};}function removeEntity(_0x227df2,_0x54f4fb){return function(_0x299a43){if(_0x299a43){return _0x299a43[_0x1f97('0x27')]()[_0x1f97('0x26')](function(){_0x227df2[_0x1f97('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57fd13,_0x42f88d){return function(_0x3a83e1){if(!_0x3a83e1){_0x57fd13['sendStatus'](0x194);}return _0x3a83e1;};}function handleError(_0x1be733,_0x59386){_0x59386=_0x59386||0x1f4;return function(_0x4532fa){logger['error'](_0x4532fa[_0x1f97('0x28')]);if(_0x4532fa[_0x1f97('0x29')]){delete _0x4532fa[_0x1f97('0x29')];}_0x1be733['status'](_0x59386)[_0x1f97('0x2a')](_0x4532fa);};}exports[_0x1f97('0x2b')]=function(_0x5b5c50,_0x51ab6b){var _0x3153df={},_0x473ddb={},_0x3eb723={'count':0x0,'rows':[]};var _0xb47294=_[_0x1f97('0x2c')](db[_0x1f97('0x2d')][_0x1f97('0x2e')],function(_0x36fe5e){return{'name':_0x36fe5e['fieldName'],'type':_0x36fe5e['type'][_0x1f97('0x2f')]};});_0x473ddb['model']=_['map'](_0xb47294,_0x1f97('0x29'));_0x473ddb[_0x1f97('0x30')]=_[_0x1f97('0x31')](_0x5b5c50[_0x1f97('0x30')]);_0x473ddb[_0x1f97('0x32')]=_['intersection'](_0x473ddb['model'],_0x473ddb[_0x1f97('0x30')]);_0x3153df[_0x1f97('0x33')]=_[_0x1f97('0x34')](_0x473ddb[_0x1f97('0x35')],qs[_0x1f97('0x36')](_0x5b5c50[_0x1f97('0x30')][_0x1f97('0x36')]));_0x3153df['attributes']=_0x3153df[_0x1f97('0x33')][_0x1f97('0x37')]?_0x3153df[_0x1f97('0x33')]:_0x473ddb['model'];if(!_0x5b5c50[_0x1f97('0x30')][_0x1f97('0x38')]('nolimit')){_0x3153df[_0x1f97('0x20')]=qs[_0x1f97('0x20')](_0x5b5c50[_0x1f97('0x30')]['limit']);_0x3153df[_0x1f97('0x1d')]=qs['offset'](_0x5b5c50[_0x1f97('0x30')]['offset']);}_0x3153df['order']=qs[_0x1f97('0x39')](_0x5b5c50[_0x1f97('0x30')]['sort']);_0x3153df[_0x1f97('0x3a')]=qs['filters'](_[_0x1f97('0x3b')](_0x5b5c50[_0x1f97('0x30')],_0x473ddb['filters']),_0xb47294);if(_0x5b5c50['query'][_0x1f97('0x3c')]){_0x3153df[_0x1f97('0x3a')]=_[_0x1f97('0x3d')](_0x3153df[_0x1f97('0x3a')],{'$or':_[_0x1f97('0x2c')](_0xb47294,function(_0x23a166){if(_0x23a166[_0x1f97('0x3e')]!==_0x1f97('0x3f')){var _0x33a240={};_0x33a240[_0x23a166[_0x1f97('0x29')]]={'$like':'%'+_0x5b5c50[_0x1f97('0x30')][_0x1f97('0x3c')]+'%'};return _0x33a240;}})});}_0x3153df=_[_0x1f97('0x3d')]({},_0x3153df,_0x5b5c50['options']);var _0x4f495a={'where':_0x3153df['where']};return db[_0x1f97('0x2d')]['count'](_0x4f495a)[_0x1f97('0x26')](function(_0x2863aa){_0x3eb723[_0x1f97('0x1f')]=_0x2863aa;if(_0x5b5c50['query'][_0x1f97('0x40')]){_0x3153df['include']=[{'all':!![]}];}return db[_0x1f97('0x2d')][_0x1f97('0x41')](_0x3153df);})[_0x1f97('0x26')](function(_0x560f81){_0x3eb723[_0x1f97('0x42')]=_0x560f81;return _0x3eb723;})[_0x1f97('0x26')](respondWithFilteredResult(_0x51ab6b,_0x3153df))[_0x1f97('0x43')](handleError(_0x51ab6b,null));};exports['show']=function(_0x4c4d54,_0x1648df){var _0x4e55d1={'raw':!![],'where':{'id':_0x4c4d54[_0x1f97('0x44')]['id']}},_0x7b2dd7={};_0x7b2dd7[_0x1f97('0x35')]=_['keys'](db['WhatsappTransferReport'][_0x1f97('0x2e')]);_0x7b2dd7[_0x1f97('0x30')]=_[_0x1f97('0x31')](_0x4c4d54[_0x1f97('0x30')]);_0x7b2dd7[_0x1f97('0x32')]=_[_0x1f97('0x34')](_0x7b2dd7[_0x1f97('0x35')],_0x7b2dd7[_0x1f97('0x30')]);_0x4e55d1[_0x1f97('0x33')]=_[_0x1f97('0x34')](_0x7b2dd7[_0x1f97('0x35')],qs[_0x1f97('0x36')](_0x4c4d54[_0x1f97('0x30')][_0x1f97('0x36')]));_0x4e55d1[_0x1f97('0x33')]=_0x4e55d1['attributes'][_0x1f97('0x37')]?_0x4e55d1[_0x1f97('0x33')]:_0x7b2dd7[_0x1f97('0x35')];if(_0x4c4d54['query'][_0x1f97('0x40')]){_0x4e55d1[_0x1f97('0x45')]=[{'all':!![]}];}_0x4e55d1=_[_0x1f97('0x3d')]({},_0x4e55d1,_0x4c4d54[_0x1f97('0x46')]);return db[_0x1f97('0x2d')][_0x1f97('0x47')](_0x4e55d1)[_0x1f97('0x26')](handleEntityNotFound(_0x1648df,null))[_0x1f97('0x26')](respondWithResult(_0x1648df,null))[_0x1f97('0x43')](handleError(_0x1648df,null));};exports[_0x1f97('0x48')]=function(_0x464e1b,_0x59f4fa){return db[_0x1f97('0x2d')]['create'](_0x464e1b[_0x1f97('0x49')],{})['then'](respondWithResult(_0x59f4fa,0xc9))[_0x1f97('0x43')](handleError(_0x59f4fa,null));};exports[_0x1f97('0x25')]=function(_0x3943d7,_0x507a4c){if(_0x3943d7['body']['id']){delete _0x3943d7['body']['id'];}return db[_0x1f97('0x2d')][_0x1f97('0x47')]({'where':{'id':_0x3943d7['params']['id']}})[_0x1f97('0x26')](handleEntityNotFound(_0x507a4c,null))[_0x1f97('0x26')](saveUpdates(_0x3943d7['body'],null))['then'](respondWithResult(_0x507a4c,null))[_0x1f97('0x43')](handleError(_0x507a4c,null));};exports['destroy']=function(_0x1a5dde,_0x5af6e9){return db[_0x1f97('0x2d')][_0x1f97('0x47')]({'where':{'id':_0x1a5dde[_0x1f97('0x44')]['id']}})[_0x1f97('0x26')](handleEntityNotFound(_0x5af6e9,null))['then'](removeEntity(_0x5af6e9,null))[_0x1f97('0x43')](handleError(_0x5af6e9,null));};exports['describe']=function(_0x594ae3,_0x1bfdb2){return db['WhatsappTransferReport'][_0x1f97('0x4a')]()[_0x1f97('0x26')](respondWithResult(_0x1bfdb2,null))[_0x1f97('0x43')](handleError(_0x1bfdb2,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b57dd6c..ac92c00 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 _0xbf32=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0x8b62d7,_0x309f66){var _0x400780=function(_0x1cef6c){while(--_0x1cef6c){_0x8b62d7['push'](_0x8b62d7['shift']());}};_0x400780(++_0x309f66);}(_0xbf32,0xa6));var _0x2bf3=function(_0x2564d3,_0x30d18c){_0x2564d3=_0x2564d3-0x0;var _0x4eaba8=_0xbf32[_0x2564d3];return _0x4eaba8;};'use strict';var _=require(_0x2bf3('0x0'));var util=require('util');var logger=require(_0x2bf3('0x1'))('api');var moment=require(_0x2bf3('0x2'));var BPromise=require(_0x2bf3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bf3('0x4'));var rimraf=require(_0x2bf3('0x5'));var config=require(_0x2bf3('0x6'));var attributes=require(_0x2bf3('0x7'));module[_0x2bf3('0x8')]=function(_0x5136f4,_0x30b909){return _0x5136f4[_0x2bf3('0x9')](_0x2bf3('0xa'),attributes,{'tableName':_0x2bf3('0xb'),'paranoid':![],'indexes':[{'name':_0x2bf3('0xc'),'fields':[_0x2bf3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05b5=['../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','util','../../config/logger','request-promise','path','rimraf'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x05b5,0x8a));var _0x505b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x05b5[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x505b('0x0'));var logger=require(_0x505b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x505b('0x2'));var fs=require('fs');var path=require(_0x505b('0x3'));var rimraf=require(_0x505b('0x4'));var config=require(_0x505b('0x5'));var attributes=require(_0x505b('0x6'));module[_0x505b('0x7')]=function(_0x3926ab,_0x832ef8){return _0x3926ab[_0x505b('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x505b('0x9'),'paranoid':![],'indexes':[{'name':_0x505b('0xa'),'fields':[_0x505b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index cdd407b..0b3d95c 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 _0x91cf=['jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a5e74,_0x495150){var _0x56aedc=function(_0x3c580c){while(--_0x3c580c){_0x1a5e74['push'](_0x1a5e74['shift']());}};_0x56aedc(++_0x495150);}(_0x91cf,0x17d));var _0xf91c=function(_0x236c13,_0x50cc9f){_0x236c13=_0x236c13-0x0;var _0x35aa66=_0x91cf[_0x236c13];return _0x35aa66;};'use strict';var _=require(_0xf91c('0x0'));var util=require(_0xf91c('0x1'));var moment=require(_0xf91c('0x2'));var BPromise=require(_0xf91c('0x3'));var rs=require(_0xf91c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf91c('0x5'))['db'];var utils=require(_0xf91c('0x6'));var logger=require(_0xf91c('0x7'))(_0xf91c('0x8'));var config=require(_0xf91c('0x9'));var jayson=require(_0xf91c('0xa'));var client=jayson[_0xf91c('0xb')][_0xf91c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x261eb5,_0x299af3,_0x23c572){return new BPromise(function(_0x4e8fdd,_0x3738d4){return client[_0xf91c('0xd')](_0x261eb5,_0x23c572)['then'](function(_0xd473da){logger[_0xf91c('0xe')](_0xf91c('0xf'),_0x299af3,_0xf91c('0x10'));logger[_0xf91c('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x299af3,_0xf91c('0x10'),JSON[_0xf91c('0x12')](_0xd473da));if(_0xd473da['error']){if(_0xd473da[_0xf91c('0x13')]['code']===0x1f4){logger[_0xf91c('0x13')](_0xf91c('0xf'),_0x299af3,_0xd473da[_0xf91c('0x13')][_0xf91c('0x14')]);return _0x3738d4(_0xd473da['error'][_0xf91c('0x14')]);}logger[_0xf91c('0x13')](_0xf91c('0xf'),_0x299af3,_0xd473da[_0xf91c('0x13')][_0xf91c('0x14')]);return _0x4e8fdd(_0xd473da[_0xf91c('0x13')][_0xf91c('0x14')]);}else{logger['info'](_0xf91c('0xf'),_0x299af3,'request\x20sent');_0x4e8fdd(_0xd473da[_0xf91c('0x15')][_0xf91c('0x14')]);}})[_0xf91c('0x16')](function(_0x590221){logger[_0xf91c('0x13')](_0xf91c('0xf'),_0x299af3,_0x590221);_0x3738d4(_0x590221);});});} \ No newline at end of file +var _0x6012=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment'];(function(_0x25cb87,_0x82a1a2){var _0x4fbaa1=function(_0x47f826){while(--_0x47f826){_0x25cb87['push'](_0x25cb87['shift']());}};_0x4fbaa1(++_0x82a1a2);}(_0x6012,0x111));var _0x2601=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x6012[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0x2601('0x0'));var util=require(_0x2601('0x1'));var moment=require(_0x2601('0x2'));var BPromise=require(_0x2601('0x3'));var rs=require(_0x2601('0x4'));var fs=require('fs');var Redis=require(_0x2601('0x5'));var db=require(_0x2601('0x6'))['db'];var utils=require(_0x2601('0x7'));var logger=require(_0x2601('0x8'))(_0x2601('0x9'));var config=require(_0x2601('0xa'));var jayson=require(_0x2601('0xb'));var client=jayson[_0x2601('0xc')][_0x2601('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42058c,_0x292d9d,_0x3b08c5){return new BPromise(function(_0x451a57,_0xa3c1ae){return client[_0x2601('0xe')](_0x42058c,_0x3b08c5)['then'](function(_0xe0d547){logger[_0x2601('0xf')](_0x2601('0x10'),_0x292d9d,_0x2601('0x11'));logger['debug'](_0x2601('0x12'),_0x292d9d,_0x2601('0x11'),JSON['stringify'](_0xe0d547));if(_0xe0d547[_0x2601('0x13')]){if(_0xe0d547[_0x2601('0x13')][_0x2601('0x14')]===0x1f4){logger[_0x2601('0x13')](_0x2601('0x10'),_0x292d9d,_0xe0d547[_0x2601('0x13')][_0x2601('0x15')]);return _0xa3c1ae(_0xe0d547[_0x2601('0x13')][_0x2601('0x15')]);}logger[_0x2601('0x13')](_0x2601('0x10'),_0x292d9d,_0xe0d547[_0x2601('0x13')]['message']);return _0x451a57(_0xe0d547[_0x2601('0x13')][_0x2601('0x15')]);}else{logger[_0x2601('0xf')](_0x2601('0x10'),_0x292d9d,_0x2601('0x11'));_0x451a57(_0xe0d547['result']['message']);}})[_0x2601('0x16')](function(_0x5b9c58){logger[_0x2601('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x292d9d,_0x5b9c58);_0xa3c1ae(_0x5b9c58);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e953ce4..27f7513 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5292=['join','Offline\x20apps:','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/cloud-provider','sequelize','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','map','online'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x5292,0xf7));var _0x2529=function(_0x11ff55,_0x313baf){_0x11ff55=_0x11ff55-0x0;var _0x25afdd=_0x5292[_0x11ff55];return _0x25afdd;};'use strict';var _=require(_0x2529('0x0'));var db=require(_0x2529('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x2529('0x2'));var rpc=require('./rpc');var config=require(_0x2529('0x3'));var logger=require(_0x2529('0x4'))(_0x2529('0x5'));var pm2=require(_0x2529('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x2529('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x2529('0x8'));function main(){return db[_0x2529('0x9')]['sync']()['then'](function(){if(config[_0x2529('0xa')]){return seedDb[_0x2529('0xb')]();}})['then'](function(){return checkLicense[_0x2529('0xb')]();})[_0x2529('0xc')](function(){return rpc[_0x2529('0xd')]();})[_0x2529('0xc')](function(_0x3d802d){logger[_0x2529('0xe')](_0x3d802d);return chat[_0x2529('0xf')]();})[_0x2529('0xc')](function(){return whatsapp['start']();})[_0x2529('0xc')](function(){return schedule[_0x2529('0xf')]();})['then'](function(){return transcribe[_0x2529('0xf')]();})[_0x2529('0xc')](function(){return provider[_0x2529('0xf')]();})[_0x2529('0xc')](function(_0x2c6a91){logger[_0x2529('0xe')](_0x2c6a91);return pm2[_0x2529('0xf')](pm2Config);})['then'](function(_0x101668){var _0x164dd7=_0x101668[_0x2529('0x10')](function(_0x19e4bf){return typeof _0x19e4bf[_0x2529('0x11')]===_0x2529('0x12')&&_0x19e4bf[_0x2529('0x11')]>=0x0;});if(_0x164dd7[_0x2529('0x13')]>0x0){throw new Error(_0x164dd7['length']+_0x2529('0x14')+_['map'](_0x164dd7,function(_0x337720){return'\x22'+_0x337720[_0x2529('0x15')][_0x2529('0x16')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x2529('0x17')](_[_0x2529('0x10')](_0x101668,{'status':_0x2529('0x18')}),_0x2529('0x16'))[_0x2529('0x19')]());logger['info'](_0x2529('0x1a'),_[_0x2529('0x17')](_[_0x2529('0x10')](_0x101668,function(_0xeff5a6){return _0xeff5a6['status']!==_0x2529('0x18');}),_0x2529('0x16'))[_0x2529('0x19')]()||'None');console[_0x2529('0x1b')](_0x2529('0x1c'));})[_0x2529('0x1d')](function(_0x25d3c1){console['log'](_0x2529('0x1e'),_0x25d3c1);logger[_0x2529('0x1f')](_0x2529('0x20'),_0x25d3c1);process[_0x2529('0x21')](0x1);});}main(); \ No newline at end of file +var _0x94ba=['join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online'];(function(_0x40b0b9,_0x59cd60){var _0x28e0e2=function(_0x2b75c6){while(--_0x2b75c6){_0x40b0b9['push'](_0x40b0b9['shift']());}};_0x28e0e2(++_0x59cd60);}(_0x94ba,0xbe));var _0xa94b=function(_0x3b3f90,_0x388364){_0x3b3f90=_0x3b3f90-0x0;var _0x52522e=_0x94ba[_0x3b3f90];return _0x52522e;};'use strict';var _=require(_0xa94b('0x0'));var db=require(_0xa94b('0x1'))['db'];var seedDb=require(_0xa94b('0x2'));var checkLicense=require(_0xa94b('0x3'));var rpc=require(_0xa94b('0x4'));var config=require('./config/environment');var logger=require(_0xa94b('0x5'))('app');var pm2=require(_0xa94b('0x6'));var pm2Config=require(_0xa94b('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xa94b('0x8'));var transcribe=require(_0xa94b('0x9'));var provider=require(_0xa94b('0xa'));function main(){return db[_0xa94b('0xb')]['sync']()[_0xa94b('0xc')](function(){if(config[_0xa94b('0xd')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xa94b('0xe')]();})[_0xa94b('0xc')](function(){return rpc[_0xa94b('0xf')]();})['then'](function(_0x30bdd2){logger[_0xa94b('0x10')](_0x30bdd2);return chat[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return whatsapp[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return schedule['start']();})[_0xa94b('0xc')](function(){return transcribe[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return provider[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(_0xfc303c){logger[_0xa94b('0x10')](_0xfc303c);return pm2[_0xa94b('0x11')](pm2Config);})['then'](function(_0x38d344){var _0x1e5f23=_0x38d344['filter'](function(_0xea3a9f){return typeof _0xea3a9f['exitCode']==='number'&&_0xea3a9f['exitCode']>=0x0;});if(_0x1e5f23[_0xa94b('0x12')]>0x0){throw new Error(_0x1e5f23[_0xa94b('0x12')]+_0xa94b('0x13')+_[_0xa94b('0x14')](_0x1e5f23,function(_0x15d9d8){return'\x22'+_0x15d9d8[_0xa94b('0x15')][_0xa94b('0x16')]+'\x22';}));}logger[_0xa94b('0x10')](_0xa94b('0x17'),_[_0xa94b('0x14')](_[_0xa94b('0x18')](_0x38d344,{'status':_0xa94b('0x19')}),_0xa94b('0x16'))[_0xa94b('0x1a')]());logger[_0xa94b('0x10')](_0xa94b('0x1b'),_[_0xa94b('0x14')](_[_0xa94b('0x18')](_0x38d344,function(_0x44f20f){return _0x44f20f[_0xa94b('0x1c')]!==_0xa94b('0x19');}),'name')[_0xa94b('0x1a')]()||_0xa94b('0x1d'));console[_0xa94b('0x1e')](_0xa94b('0x1f'));})[_0xa94b('0x20')](function(_0x2524f9){console[_0xa94b('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2524f9);logger[_0xa94b('0x21')](_0xa94b('0x22'),_0x2524f9);process[_0xa94b('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index ee7f7e8..ec4a7c8 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 _0x930f=['lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','openchannelPause','pauseType','crudPermissions','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','use','ChatInteraction','findOne','params','disposition','closed','status','unmanaged','json','Unmanaged.','catch','headers','startsWith','authorization','Basic','User','find','then','authenticate','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','session','payload','options','secrets','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x930f,0x17b));var _0xf930=function(_0x1239d2,_0x35bdf8){_0x1239d2=_0x1239d2-0x0;var _0x1fdf64=_0x930f[_0x1239d2];return _0x1fdf64;};'use strict';var db=require(_0xf930('0x0'))['db'];var config=require(_0xf930('0x1'));var hardwareConf=require(_0xf930('0x2'));var licenseUtil=require(_0xf930('0x3'));var encryptor=require(_0xf930('0x4'));var _=require(_0xf930('0x5'));var jwt=require(_0xf930('0x6'));var expressJwt=require('express-jwt');var compose=require(_0xf930('0x7'));var basicAuth=require(_0xf930('0x8'));var crypto=require(_0xf930('0x9'));var BPromise=require(_0xf930('0xa'));var util=require(_0xf930('0xb'));var moment=require(_0xf930('0xc'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id','role',_0xf930('0xd'),_0xf930('0xe'),_0xf930('0xf'),_0xf930('0x10'),_0xf930('0x11'),_0xf930('0x12'),_0xf930('0x13'),_0xf930('0x14'),'chatPause',_0xf930('0x15'),_0xf930('0x16'),'smsPause',_0xf930('0x17'),_0xf930('0x18'),'showWebBar','lastLoginAt','lastPauseAt',_0xf930('0x19'),'allowmessenger','passwordResetAt',_0xf930('0x1a'),'phoneBarAutoAnswer',_0xf930('0x1b'),_0xf930('0x1c'),'phoneBarEnableRecording',_0xf930('0x1d'),_0xf930('0x1e'),_0xf930('0x1f'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0xf930('0x20'),_0xf930('0x21'),_0xf930('0x22'),_0xf930('0x23'),_0xf930('0x24'),_0xf930('0x25'),_0xf930('0x26'),_0xf930('0x27'),_0xf930('0x28'),_0xf930('0x29'),_0xf930('0x2a'),_0xf930('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0xf930('0x2c')](!![])[_0xf930('0x2d')](function(_0x2e337e,_0x4b8b2b,_0x4a4a29){if(_0x2e337e['user']){_0x4a4a29();}else{return db[_0xf930('0x2e')][_0xf930('0x2f')]({'where':{'id':_0x2e337e[_0xf930('0x30')]['id']},'attributes':['id','closed',_0xf930('0x31')],'raw':!![]})['then'](function(_0x421f24){if(_0x421f24&&_0x421f24[_0xf930('0x32')]){return _0x4b8b2b[_0xf930('0x33')](_0x421f24[_0xf930('0x31')]===_0xf930('0x34')?0x195:0x193)[_0xf930('0x35')]({'message':_0x421f24['disposition']===_0xf930('0x34')?_0xf930('0x36'):'Forbidden.'});}else{_0x4a4a29();}})[_0xf930('0x37')](function(_0x300f3f){_0x4a4a29(_0x300f3f);});}});};exports[_0xf930('0x2c')]=function isAuthenticated(_0x52cf57){return compose()[_0xf930('0x2d')](function(_0x3b1f45,_0x10f571,_0x3561c7){var _0xcb11c7;if(_0x3b1f45[_0xf930('0x38')]['authorization']){if(_[_0xf930('0x39')](_0x3b1f45[_0xf930('0x38')][_0xf930('0x3a')],_0xf930('0x3b'))){var _0x26784f=basicAuth(_0x3b1f45);db[_0xf930('0x3c')][_0xf930('0x3d')]({'where':{'name':_0x26784f[_0xf930('0xe')]}})[_0xf930('0x3e')](function(_0x17d2a6){if(!_0x17d2a6||!_0x17d2a6[_0xf930('0x3f')](_0x26784f['pass'])){return _0x10f571[_0xf930('0x33')](0x191)[_0xf930('0x35')]({'message':_0xf930('0x40')});}_0x3b1f45[_0xf930('0x41')]={'id':_0x17d2a6['id']};_0x3561c7();})[_0xf930('0x37')](function(_0x10ba97){_0x3561c7(_0x10ba97);});}else if(_[_0xf930('0x39')](_0x3b1f45[_0xf930('0x38')][_0xf930('0x3a')],_0xf930('0x42'))){validateJwt(_0x3b1f45,_0x10f571,_0x3561c7);}else{if(_0x52cf57){_0x3561c7();}else{return _0x10f571['status'](0x193)[_0xf930('0x35')]({'message':_0xf930('0x43')});}}}else if(_0x3b1f45[_0xf930('0x44')][_0xf930('0x45')]){try{var _0x3b5c89={'audience':hardwareConf[_0xf930('0x46')](),'issuer':hardwareConf[_0xf930('0x46')]()};verifyJwt(_0x3b1f45[_0xf930('0x44')][_0xf930('0x45')],_0x3b5c89)['then'](function(_0x470f61){return db['User'][_0xf930('0x3d')]({'where':{'id':_0x470f61[_0xf930('0x47')]}})[_0xf930('0x3e')](function(_0x4e2845){_0xcb11c7=_0x4e2845;return db[_0xf930('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0xf930('0x49'),_0xf930('0x4a')],'raw':!![]});})[_0xf930('0x3e')](function(_0x374c1b){if(!_0xcb11c7||!_['isEqual'](_0xcb11c7[_0xf930('0x4b')],_0x470f61[_0xf930('0x4c')])){return _0x10f571[_0xf930('0x33')](0x191)[_0xf930('0x35')]({'message':_0xf930('0x4d')});}if(_0xcb11c7[_0xf930('0x4e')]){return _0x10f571[_0xf930('0x33')](0x191)['json']({'message':_0xf930('0x4f')});}if(_0xcb11c7[_0xf930('0x50')]){if(_0x374c1b[_0xf930('0x4a')]>0x0){if(moment(_0xcb11c7[_0xf930('0x51')])['add'](_0x374c1b[_0xf930('0x4a')],_0xf930('0x52'))>moment()){return _0x10f571[_0xf930('0x33')](0x191)[_0xf930('0x35')]({'message':_0xf930('0x4f')});}}else{return _0x10f571['status'](0x191)[_0xf930('0x35')]({'message':_0xf930('0x4f')});}}_0x3b1f45[_0xf930('0x41')]={'id':_0xcb11c7['id']};_0x3561c7();});})[_0xf930('0x37')](function(){return _0x10f571[_0xf930('0x33')](0x191)[_0xf930('0x35')]({'message':_0xf930('0x4f')});});}catch(_0x44aed6){_0x3561c7(_0x44aed6);}}else if(_0x52cf57){_0x3561c7();}else{return _0x10f571[_0xf930('0x33')](0x193)[_0xf930('0x35')]({'message':_0xf930('0x43')});}})[_0xf930('0x2d')](function(_0x53c2c4,_0x4354f6,_0x3c935d){if(_0x53c2c4[_0xf930('0x41')]){db[_0xf930('0x3c')][_0xf930('0x3d')]({'where':{'id':_0x53c2c4['user']['id']},'attributes':userAttributes})[_0xf930('0x3e')](function(_0x12555e){if(!_0x12555e){return _0x4354f6[_0xf930('0x33')](0x194)['json']({'message':_0xf930('0x53')});}_0x53c2c4[_0xf930('0x41')]=_0x12555e;_0x3c935d();})[_0xf930('0x37')](function(_0x233ba7){_0x3c935d(_0x233ba7);});}else if(_0x52cf57){_0x3c935d();}else{return _0x4354f6[_0xf930('0x33')](0x194)['json']({'message':_0xf930('0x54')});}});};exports[_0xf930('0x55')]=function canUpdate(){return compose()[_0xf930('0x2d')](function(_0xa6b9b4,_0x1a3ed5,_0x73d1df){return licenseUtil['getLicense']()['then'](function(_0x45e5c9){if(_0x45e5c9['update']){_0x73d1df();}else{return _0x1a3ed5[_0xf930('0x33')](0x193)[_0xf930('0x35')]({'message':_0xf930('0x56')});}})[_0xf930('0x37')](function(_0x20efd8){_0x73d1df(_0x20efd8);});});};exports[_0xf930('0x57')]=function isWebrtcLicence(){return compose()[_0xf930('0x2d')](function(_0x47ff83,_0x20005c,_0x42f5bc){return licenseUtil['getLicense']()['then'](function(_0x405595){if(_0x405595['webrtc']){_0x42f5bc();}else{return _0x20005c[_0xf930('0x33')](0x193)[_0xf930('0x35')]({'message':_0xf930('0x56')});}})[_0xf930('0x37')](function(_0x3ea2b1){_0x42f5bc(_0x3ea2b1);});});};exports['isMiddleware']=function(_0x34f1ce,_0x5d9639,_0x46416f){_0x34f1ce['isMiddleware']=!![];return _0x46416f();};exports[_0xf930('0x58')]=function signToken(_0x5770b5){return signJwt(_0x5770b5);};exports['setTokenCookie']=function(_0x13bfbd,_0x32f7d1){if(!_0x13bfbd['user']){return _0x32f7d1[_0xf930('0x33')](0x194)[_0xf930('0x35')]({'message':_0xf930('0x59')});}var _0x5badaf={'payload':{'id':_0x13bfbd['user']['id'],'role':_0x13bfbd[_0xf930('0x41')][_0xf930('0x5a')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5badaf)['then'](function(_0x2839a3){_0x32f7d1[_0xf930('0x5b')](_0xf930('0x5c'),_0x2839a3);_0x32f7d1[_0xf930('0x5d')](_0xf930('0x5e'));})['catch'](function(_0x105aec){return _0x32f7d1[_0xf930('0x33')](0x1f4)[_0xf930('0x5f')](_0x105aec);});};exports[_0xf930('0x60')]=function(_0x327b3a){if(_[_0xf930('0x61')](_0x327b3a[_0xf930('0x4b')])||_[_0xf930('0x61')](_0x327b3a[_0xf930('0x62')])){return null;}else{return createJwt(_0x327b3a);}};exports[_0xf930('0x63')]=function(_0x365329){_0x365329['apiKeyNonce']=generateNonce();_0x365329[_0xf930('0x62')]=generateIssuedAt();return createJwt(_0x365329);};exports[_0xf930('0x64')]=function(_0x1279dc,_0x2fe28f){var _0x12e151=_0x1279dc[_0xf930('0x44')][_0xf930('0x45')];if(_0x12e151){var _0x1699f4={'nonce':_0x2fe28f[_0xf930('0x4b')],'iat':_0x2fe28f[_0xf930('0x62')],'audience':hardwareConf[_0xf930('0x46')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x12e151,_0x1699f4)[_0xf930('0x3e')](function(){return generateApiKey(_0x2fe28f);});}else{throw{'message':_0xf930('0x65')};}};exports[_0xf930('0x66')]=function(_0x559300){var _0x30e135=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x30e135['test'](_0x559300))throw new db[(_0xf930('0x67'))][(_0xf930('0x68'))](_0xf930('0x69'));return;};exports['validatePasswordHistory']=function(_0x27f30e,_0x234f1c,_0x1c0b0a){var _0x192743=encryptor[_0xf930('0x6a')](_0x234f1c)['split'](',');for(var _0x21cdaf=0x0;_0x21cdaf<_0x1c0b0a;_0x21cdaf++){if(!_0x192743[_0x21cdaf])break;if(_0x27f30e['toLowerCase']()===_0x192743[_0x21cdaf][_0xf930('0x6b')]()){var _0x1d26ea=util[_0xf930('0x6c')](_0xf930('0x6d'),_0x1c0b0a);if(_0x1c0b0a===0x1){_0x1d26ea=_0xf930('0x6e');}throw new db[(_0xf930('0x67'))][(_0xf930('0x68'))](_0x1d26ea);}}return;};exports[_0xf930('0x6f')]=function(_0x5b84e7,_0x30d35c){var _0x2c3c8c=_0x30d35c?encryptor[_0xf930('0x6a')](_0x30d35c)['split'](','):[];if(_0x2c3c8c[_0xf930('0x70')]===0x5){_0x2c3c8c['splice'](-0x1,0x1);}_0x2c3c8c[_0xf930('0x71')](_0x5b84e7);return encryptor[_0xf930('0x72')](_0x2c3c8c[_0xf930('0x73')](','));};function signJwt(_0x2a55a6){var _0x4b7223=BPromise[_0xf930('0x74')](jwt[_0xf930('0x75')],{'context':jwt});var _0x52fc7e=_0x2a55a6['secret']||config['secrets'][_0xf930('0x76')];return new BPromise(function(_0xdb379b,_0x542676){_0x4b7223(_0x2a55a6[_0xf930('0x77')],_0x52fc7e,_0x2a55a6[_0xf930('0x78')])[_0xf930('0x3e')](function(_0xfdadea){_0xdb379b(_0xfdadea);})['catch'](function(_0x37987c){_0x542676(_0x37987c);});});}function verifyJwt(_0x10f269,_0x3d2fc1,_0x195015){var _0x5cd32e=BPromise[_0xf930('0x74')](jwt['verify'],{'context':jwt});var _0x33eb4f=_0x195015||config[_0xf930('0x79')][_0xf930('0x76')];return new BPromise(function(_0x5f6e8a,_0x5af718){_0x5cd32e(_0x10f269,_0x33eb4f,_0x3d2fc1)[_0xf930('0x3e')](function(_0x3e1140){_0x5f6e8a(_0x3e1140);})[_0xf930('0x37')](function(_0x404ca0){_0x5af718(_0x404ca0);});});}function generateNonce(){return crypto[_0xf930('0x7a')](0x10)[_0xf930('0x7b')](_0xf930('0x7c'));}function generateIssuedAt(){return Math[_0xf930('0x7d')](Date[_0xf930('0x7e')]()/0x3e8)[_0xf930('0x7b')]();}function createJwt(_0xd559c9){var _0x8e3e9={'payload':{'iat':_0xd559c9['apiKeyIat'],'nonce':_0xd559c9['apiKeyNonce']},'options':{'algorithm':_0xf930('0x7f'),'subject':_0xd559c9['id'][_0xf930('0x7b')](),'issuer':hardwareConf[_0xf930('0x46')](),'audience':hardwareConf[_0xf930('0x46')]()}};return signJwt(_0x8e3e9)[_0xf930('0x3e')](function(_0x404237){return{'iat':_0xd559c9['apiKeyIat'],'nonce':_0xd559c9[_0xf930('0x4b')],'token':_0x404237};});} \ No newline at end of file +var _0x1600=['express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','privacyEnabled','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','find','then','authenticate','Wrong\x20credentials.','Bearer','query','getUuid','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','promisify','sign','secret','payload','options','randomBytes','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken'];(function(_0x5c852f,_0x499c69){var _0x510f8a=function(_0x3af7ba){while(--_0x3af7ba){_0x5c852f['push'](_0x5c852f['shift']());}};_0x510f8a(++_0x499c69);}(_0x1600,0x16d));var _0x0160=function(_0x3d09b3,_0x31edba){_0x3d09b3=_0x3d09b3-0x0;var _0x5b0110=_0x1600[_0x3d09b3];return _0x5b0110;};'use strict';var db=require(_0x0160('0x0'))['db'];var config=require(_0x0160('0x1'));var hardwareConf=require(_0x0160('0x2'));var licenseUtil=require(_0x0160('0x3'));var encryptor=require(_0x0160('0x4'));var _=require(_0x0160('0x5'));var jwt=require(_0x0160('0x6'));var expressJwt=require(_0x0160('0x7'));var compose=require(_0x0160('0x8'));var basicAuth=require(_0x0160('0x9'));var crypto=require(_0x0160('0xa'));var BPromise=require('bluebird');var util=require(_0x0160('0xb'));var moment=require(_0x0160('0xc'));var validateJwt=expressJwt({'secret':config[_0x0160('0xd')][_0x0160('0xe')]});var userAttributes=['id',_0x0160('0xf'),'fullname',_0x0160('0x10'),_0x0160('0x11'),_0x0160('0x12'),'userpic',_0x0160('0x13'),_0x0160('0x14'),_0x0160('0x15'),_0x0160('0x16'),_0x0160('0x17'),_0x0160('0x18'),_0x0160('0x19'),_0x0160('0x1a'),'pauseType',_0x0160('0x1b'),_0x0160('0x1c'),_0x0160('0x1d'),_0x0160('0x1e'),_0x0160('0x1f'),_0x0160('0x20'),'alias',_0x0160('0x21'),'phoneBarAutoAnswerDelay',_0x0160('0x22'),_0x0160('0x23'),_0x0160('0x24'),_0x0160('0x25'),_0x0160('0x26'),_0x0160('0x27'),_0x0160('0x28'),'phoneBarRemoteControlPort','hotdesk',_0x0160('0x29'),'userProfileId',_0x0160('0x2a'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments',_0x0160('0x2b'),_0x0160('0x2c')];exports[_0x0160('0x2d')]=function(){return this[_0x0160('0x2e')](!![])[_0x0160('0x2f')](function(_0x1d41cf,_0x3baa20,_0x1192c2){if(_0x1d41cf[_0x0160('0x30')]){_0x1192c2();}else{return db[_0x0160('0x31')][_0x0160('0x32')]({'where':{'id':_0x1d41cf['params']['id']},'attributes':['id',_0x0160('0x33'),_0x0160('0x34')],'raw':!![]})['then'](function(_0xe3f8f){if(_0xe3f8f&&_0xe3f8f[_0x0160('0x33')]){return _0x3baa20[_0x0160('0x35')](_0xe3f8f[_0x0160('0x34')]===_0x0160('0x36')?0x195:0x193)[_0x0160('0x37')]({'message':_0xe3f8f[_0x0160('0x34')]==='unmanaged'?_0x0160('0x38'):_0x0160('0x39')});}else{_0x1192c2();}})[_0x0160('0x3a')](function(_0x35c6bb){_0x1192c2(_0x35c6bb);});}});};exports[_0x0160('0x2e')]=function isAuthenticated(_0x2e4f4e){return compose()[_0x0160('0x2f')](function(_0x361cce,_0xa859e7,_0x333735){var _0xcaf7ca;if(_0x361cce['headers'][_0x0160('0x3b')]){if(_[_0x0160('0x3c')](_0x361cce[_0x0160('0x3d')][_0x0160('0x3b')],_0x0160('0x3e'))){var _0x884f14=basicAuth(_0x361cce);db['User'][_0x0160('0x3f')]({'where':{'name':_0x884f14[_0x0160('0x10')]}})[_0x0160('0x40')](function(_0x5bb0cf){if(!_0x5bb0cf||!_0x5bb0cf[_0x0160('0x41')](_0x884f14['pass'])){return _0xa859e7[_0x0160('0x35')](0x191)['json']({'message':_0x0160('0x42')});}_0x361cce[_0x0160('0x30')]={'id':_0x5bb0cf['id']};_0x333735();})['catch'](function(_0x1beca7){_0x333735(_0x1beca7);});}else if(_[_0x0160('0x3c')](_0x361cce[_0x0160('0x3d')][_0x0160('0x3b')],_0x0160('0x43'))){validateJwt(_0x361cce,_0xa859e7,_0x333735);}else{if(_0x2e4f4e){_0x333735();}else{return _0xa859e7[_0x0160('0x35')](0x193)[_0x0160('0x37')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x361cce[_0x0160('0x44')]['apikey']){try{var _0x48d4e4={'audience':hardwareConf[_0x0160('0x45')](),'issuer':hardwareConf[_0x0160('0x45')]()};verifyJwt(_0x361cce['query'][_0x0160('0x46')],_0x48d4e4)['then'](function(_0x2c8d96){return db[_0x0160('0x47')][_0x0160('0x3f')]({'where':{'id':_0x2c8d96[_0x0160('0x48')]}})[_0x0160('0x40')](function(_0x6d5717){_0xcaf7ca=_0x6d5717;return db[_0x0160('0x49')][_0x0160('0x32')]({'where':{'id':0x1},'attributes':[_0x0160('0x4a'),_0x0160('0x4b')],'raw':!![]});})[_0x0160('0x40')](function(_0x5cfe54){if(!_0xcaf7ca||!_['isEqual'](_0xcaf7ca[_0x0160('0x4c')],_0x2c8d96['nonce'])){return _0xa859e7[_0x0160('0x35')](0x191)[_0x0160('0x37')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0xcaf7ca[_0x0160('0x4d')]){return _0xa859e7[_0x0160('0x35')](0x191)[_0x0160('0x37')]({'message':_0x0160('0x4e')});}if(_0xcaf7ca[_0x0160('0x4f')]){if(_0x5cfe54['blockDuration']>0x0){if(moment(_0xcaf7ca[_0x0160('0x50')])[_0x0160('0x51')](_0x5cfe54['blockDuration'],_0x0160('0x52'))>moment()){return _0xa859e7[_0x0160('0x35')](0x191)[_0x0160('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0xa859e7[_0x0160('0x35')](0x191)[_0x0160('0x37')]({'message':_0x0160('0x4e')});}}_0x361cce[_0x0160('0x30')]={'id':_0xcaf7ca['id']};_0x333735();});})[_0x0160('0x3a')](function(){return _0xa859e7[_0x0160('0x35')](0x191)[_0x0160('0x37')]({'message':_0x0160('0x4e')});});}catch(_0x1753fc){_0x333735(_0x1753fc);}}else if(_0x2e4f4e){_0x333735();}else{return _0xa859e7[_0x0160('0x35')](0x193)[_0x0160('0x37')]({'message':'Unknown\x20authorization\x20format'});}})[_0x0160('0x2f')](function(_0x708693,_0x2c9ad2,_0x45552f){if(_0x708693[_0x0160('0x30')]){db[_0x0160('0x47')][_0x0160('0x3f')]({'where':{'id':_0x708693['user']['id']},'attributes':userAttributes})[_0x0160('0x40')](function(_0x383f84){if(!_0x383f84){return _0x2c9ad2['status'](0x194)[_0x0160('0x37')]({'message':_0x0160('0x53')});}_0x708693[_0x0160('0x30')]=_0x383f84;_0x45552f();})[_0x0160('0x3a')](function(_0x4e21fb){_0x45552f(_0x4e21fb);});}else if(_0x2e4f4e){_0x45552f();}else{return _0x2c9ad2[_0x0160('0x35')](0x194)['json']({'message':_0x0160('0x54')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x52571e,_0x22815f,_0x18e2bc){return licenseUtil[_0x0160('0x55')]()['then'](function(_0x8f7a44){if(_0x8f7a44[_0x0160('0x56')]){_0x18e2bc();}else{return _0x22815f[_0x0160('0x35')](0x193)[_0x0160('0x37')]({'message':_0x0160('0x57')});}})[_0x0160('0x3a')](function(_0x3c4337){_0x18e2bc(_0x3c4337);});});};exports[_0x0160('0x58')]=function isWebrtcLicence(){return compose()['use'](function(_0x431ff6,_0x28dae9,_0x4e2f43){return licenseUtil['getLicense']()[_0x0160('0x40')](function(_0x5ca9ca){if(_0x5ca9ca[_0x0160('0x59')]){_0x4e2f43();}else{return _0x28dae9[_0x0160('0x35')](0x193)[_0x0160('0x37')]({'message':_0x0160('0x57')});}})['catch'](function(_0x8c2750){_0x4e2f43(_0x8c2750);});});};exports['isMiddleware']=function(_0x346bd9,_0x1f58ba,_0x4c77a1){_0x346bd9[_0x0160('0x5a')]=!![];return _0x4c77a1();};exports[_0x0160('0x5b')]=function signToken(_0x4a94d7){return signJwt(_0x4a94d7);};exports['setTokenCookie']=function(_0x1eb1b5,_0x366ca1){if(!_0x1eb1b5[_0x0160('0x30')]){return _0x366ca1[_0x0160('0x35')](0x194)[_0x0160('0x37')]({'message':_0x0160('0x5c')});}var _0x5cfe22={'payload':{'id':_0x1eb1b5[_0x0160('0x30')]['id'],'role':_0x1eb1b5['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x5cfe22)[_0x0160('0x40')](function(_0x2022d6){_0x366ca1['cookie']('motion.token',_0x2022d6);_0x366ca1[_0x0160('0x5d')]('/dashboards/general');})[_0x0160('0x3a')](function(_0x4541c5){return _0x366ca1[_0x0160('0x35')](0x1f4)['send'](_0x4541c5);});};exports[_0x0160('0x5e')]=function(_0x54fa80){if(_['isNil'](_0x54fa80[_0x0160('0x4c')])||_[_0x0160('0x5f')](_0x54fa80[_0x0160('0x60')])){return null;}else{return createJwt(_0x54fa80);}};exports[_0x0160('0x61')]=function(_0x4fd18c){_0x4fd18c[_0x0160('0x4c')]=generateNonce();_0x4fd18c[_0x0160('0x60')]=generateIssuedAt();return createJwt(_0x4fd18c);};exports[_0x0160('0x62')]=function(_0x2c913e,_0x3d6f88){var _0xa48ff8=_0x2c913e[_0x0160('0x44')][_0x0160('0x46')];if(_0xa48ff8){var _0x3724ea={'nonce':_0x3d6f88[_0x0160('0x4c')],'iat':_0x3d6f88[_0x0160('0x60')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x0160('0x45')]()};return verifyJwt(_0xa48ff8,_0x3724ea)['then'](function(){return generateApiKey(_0x3d6f88);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x0160('0x63')]=function(_0x3fc4be){var _0x18f5c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x18f5c9[_0x0160('0x64')](_0x3fc4be))throw new db[(_0x0160('0x65'))][(_0x0160('0x66'))](_0x0160('0x67'));return;};exports[_0x0160('0x68')]=function(_0x235966,_0x1dd21e,_0x2a90c9){var _0x2dddd0=encryptor[_0x0160('0x69')](_0x1dd21e)[_0x0160('0x6a')](',');for(var _0x32bf2b=0x0;_0x32bf2b<_0x2a90c9;_0x32bf2b++){if(!_0x2dddd0[_0x32bf2b])break;if(_0x235966[_0x0160('0x6b')]()===_0x2dddd0[_0x32bf2b]['toLowerCase']()){var _0x2b5b08=util[_0x0160('0x6c')](_0x0160('0x6d'),_0x2a90c9);if(_0x2a90c9===0x1){_0x2b5b08=_0x0160('0x6e');}throw new db[(_0x0160('0x65'))][(_0x0160('0x66'))](_0x2b5b08);}}return;};exports[_0x0160('0x6f')]=function(_0x102db1,_0x36e120){var _0x5a0a24=_0x36e120?encryptor[_0x0160('0x69')](_0x36e120)['split'](','):[];if(_0x5a0a24['length']===0x5){_0x5a0a24[_0x0160('0x70')](-0x1,0x1);}_0x5a0a24[_0x0160('0x71')](_0x102db1);return encryptor[_0x0160('0x72')](_0x5a0a24['join'](','));};function signJwt(_0xe566ee){var _0xb5b41c=BPromise[_0x0160('0x73')](jwt[_0x0160('0x74')],{'context':jwt});var _0x1c8199=_0xe566ee[_0x0160('0x75')]||config['secrets']['session'];return new BPromise(function(_0x487ba5,_0x506f6a){_0xb5b41c(_0xe566ee[_0x0160('0x76')],_0x1c8199,_0xe566ee[_0x0160('0x77')])[_0x0160('0x40')](function(_0x53f68f){_0x487ba5(_0x53f68f);})['catch'](function(_0x404956){_0x506f6a(_0x404956);});});}function verifyJwt(_0x177a63,_0x5236df,_0xa3da9a){var _0x523a66=BPromise[_0x0160('0x73')](jwt['verify'],{'context':jwt});var _0x4cce88=_0xa3da9a||config[_0x0160('0xd')][_0x0160('0xe')];return new BPromise(function(_0x1f3b8e,_0x332a28){_0x523a66(_0x177a63,_0x4cce88,_0x5236df)[_0x0160('0x40')](function(_0x5dc368){_0x1f3b8e(_0x5dc368);})[_0x0160('0x3a')](function(_0x56f171){_0x332a28(_0x56f171);});});}function generateNonce(){return crypto[_0x0160('0x78')](0x10)[_0x0160('0x79')](_0x0160('0x7a'));}function generateIssuedAt(){return Math[_0x0160('0x7b')](Date['now']()/0x3e8)[_0x0160('0x79')]();}function createJwt(_0x3929d0){var _0x4d8358={'payload':{'iat':_0x3929d0[_0x0160('0x60')],'nonce':_0x3929d0[_0x0160('0x4c')]},'options':{'algorithm':'HS512','subject':_0x3929d0['id'][_0x0160('0x79')](),'issuer':hardwareConf[_0x0160('0x45')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4d8358)['then'](function(_0x59f9a6){return{'iat':_0x3929d0['apiKeyIat'],'nonce':_0x3929d0[_0x0160('0x4c')],'token':_0x59f9a6};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 8b5af42..cfe08cb 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 _0x5677=['createCipher','data','update','write','end','final','binary','unlink','decryptFile','createDecipher','close','secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream'];(function(_0x2acaf1,_0x5a64a0){var _0xd0251e=function(_0x4a19c7){while(--_0x4a19c7){_0x2acaf1['push'](_0x2acaf1['shift']());}};_0xd0251e(++_0x5a64a0);}(_0x5677,0x75));var _0x7567=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x5677[_0x107f10];return _0x811cab;};'use strict';var crypto=require(_0x7567('0x0'));var fs=require('fs');var BPromise=require(_0x7567('0x1'));var _=require('lodash');var config=require(_0x7567('0x2'));var logger=require(_0x7567('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7567('0x4')][_0x7567('0x5')],'algorithm':_0x7567('0x6')};const fileOptions={'algorithm':_0x7567('0x7')};if(config[_0x7567('0x8')]&&config[_0x7567('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x7567('0x8')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x7567('0x8')][_0x7567('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7567('0xa')](',\x20');logger['error'](config[_0x7567('0x8')][_0x7567('0x9')],_0x7567('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x573972){return AES_SUPPORTED_RX[_0x7567('0xc')](_0x573972);}function getSupportedCiphers(){return crypto[_0x7567('0xd')]()[_0x7567('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x67bef1){return getSupportedCiphers()['indexOf'](_0x67bef1)>-0x1;}function combineOptions(_0x38c843){var _0x8835bb={};for(var _0x41301f in fileOptions){if(fileOptions[_0x7567('0xf')](_0x41301f)){_0x8835bb[_0x41301f]=fileOptions[_0x41301f];}}if(_0x38c843){for(var _0xe45e14 in _0x38c843){if(_0x38c843['hasOwnProperty'](_0xe45e14)){_0x8835bb[_0xe45e14]=_0x38c843[_0xe45e14];}}}return _0x8835bb;}exports[_0x7567('0x10')]=function(_0x1270a5,_0x2a253b,_0x5ddda9,_0x306898){return new BPromise(function(_0x130368,_0x7d2c10){_0x306898=combineOptions(_0x306898);var _0x3749ae=new Buffer(_0x5ddda9);var _0xd17b81=fs[_0x7567('0x11')](_0x1270a5);var _0x18c449=fs[_0x7567('0x12')](_0x2a253b);var _0x354949=crypto[_0x7567('0x13')](_0x306898[_0x7567('0x9')],_0x3749ae);_0xd17b81['on'](_0x7567('0x14'),function(_0x2f7682){var _0x473d83=new Buffer(_0x354949[_0x7567('0x15')](_0x2f7682),'binary');_0x18c449[_0x7567('0x16')](_0x473d83);});_0xd17b81['on'](_0x7567('0x17'),function(){try{var _0x41f227=new Buffer(_0x354949[_0x7567('0x18')]('binary'),_0x7567('0x19'));_0x18c449['write'](_0x41f227);_0x18c449['end']();_0x18c449['on']('close',function(){return _0x130368(_0x2a253b);});}catch(_0x57e24d){fs[_0x7567('0x1a')](_0x2a253b);return _0x7d2c10(_0x57e24d);}});});};exports[_0x7567('0x1b')]=function(_0x51f16c,_0x4ff259,_0x1bf5e4,_0x41274c){return new BPromise(function(_0x1c71f9,_0x543f03){_0x41274c=combineOptions(_0x41274c);var _0x3bd4f0=new Buffer(_0x1bf5e4);var _0x16198a=fs[_0x7567('0x11')](_0x51f16c);var _0x2fd5b0=fs['createWriteStream'](_0x4ff259);var _0xad3f9e=crypto[_0x7567('0x1c')](_0x41274c[_0x7567('0x9')],_0x3bd4f0);_0x16198a['on'](_0x7567('0x14'),function(_0x23e68a){var _0xb2e3c6=new Buffer(_0xad3f9e[_0x7567('0x15')](_0x23e68a),_0x7567('0x19'));_0x2fd5b0[_0x7567('0x16')](_0xb2e3c6);});_0x16198a['on'](_0x7567('0x17'),function(){try{var _0x2e99af=new Buffer(_0xad3f9e[_0x7567('0x18')](_0x7567('0x19')),_0x7567('0x19'));_0x2fd5b0[_0x7567('0x16')](_0x2e99af);_0x2fd5b0['end']();_0x2fd5b0['on'](_0x7567('0x1d'),function(){return _0x1c71f9(_0x4ff259);});}catch(_0x243f62){fs[_0x7567('0x1a')](_0x4ff259);return _0x543f03(_0x243f62);}});});};exports['encryptString']=function(_0x1977d4,_0x1760a8,_0x3bb668){var _0x4c93a8=_0x3bb668||stringOptions['algorithm'];var _0x342cdd=_0x1760a8||stringOptions[_0x7567('0x1e')];var _0x1b07bb=crypto[_0x7567('0x13')](_0x4c93a8,_0x342cdd);var _0x5b0efc=_0x1b07bb['update'](_0x1977d4,_0x7567('0x1f'),_0x7567('0x20'));_0x5b0efc+=_0x1b07bb[_0x7567('0x18')](_0x7567('0x20'));return _0x5b0efc;};exports[_0x7567('0x21')]=function(_0x17b0f9,_0x480402,_0x5ce698){var _0x3293e8=_0x5ce698||stringOptions[_0x7567('0x9')];var _0x12c6f4=_0x480402||stringOptions[_0x7567('0x1e')];var _0x28a693=crypto[_0x7567('0x1c')](_0x3293e8,_0x12c6f4);var _0x40b4b7=_0x28a693['update'](_0x17b0f9,'base64',_0x7567('0x1f'));_0x40b4b7+=_0x28a693[_0x7567('0x18')](_0x7567('0x1f'));return _0x40b4b7;}; \ No newline at end of file +var _0xddc5=['getCiphers','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','unlink','createDecipher','end','close','encryptString','secret','base64','utf8','lodash','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test'];(function(_0x308a0a,_0x1228d9){var _0xf997ec=function(_0x3f3c4c){while(--_0x3f3c4c){_0x308a0a['push'](_0x308a0a['shift']());}};_0xf997ec(++_0x1228d9);}(_0xddc5,0x1b7));var _0x5ddc=function(_0x799ea,_0x123315){_0x799ea=_0x799ea-0x0;var _0x1ad8c0=_0xddc5[_0x799ea];return _0x1ad8c0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x5ddc('0x0'));var config=require('../../config/environment');var logger=require(_0x5ddc('0x1'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5ddc('0x2')][_0x5ddc('0x3')],'algorithm':_0x5ddc('0x4')};const fileOptions={'algorithm':_0x5ddc('0x5')};if(config[_0x5ddc('0x6')]&&config[_0x5ddc('0x6')][_0x5ddc('0x7')]){var isSupported=isAlgorithmSupported(config[_0x5ddc('0x6')][_0x5ddc('0x7')]);if(isSupported){fileOptions[_0x5ddc('0x7')]=config[_0x5ddc('0x6')][_0x5ddc('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5ddc('0x8')](',\x20');logger['error'](config[_0x5ddc('0x6')][_0x5ddc('0x7')],_0x5ddc('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x2f7ef9){return AES_SUPPORTED_RX[_0x5ddc('0xa')](_0x2f7ef9);}function getSupportedCiphers(){return crypto[_0x5ddc('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x463e1){return getSupportedCiphers()[_0x5ddc('0xc')](_0x463e1)>-0x1;}function combineOptions(_0x1fad1c){var _0x1154c2={};for(var _0x19c88c in fileOptions){if(fileOptions['hasOwnProperty'](_0x19c88c)){_0x1154c2[_0x19c88c]=fileOptions[_0x19c88c];}}if(_0x1fad1c){for(var _0x54f8ab in _0x1fad1c){if(_0x1fad1c[_0x5ddc('0xd')](_0x54f8ab)){_0x1154c2[_0x54f8ab]=_0x1fad1c[_0x54f8ab];}}}return _0x1154c2;}exports['encryptFile']=function(_0x550332,_0x4aa4c1,_0x24e59b,_0x3b72ae){return new BPromise(function(_0x402a12,_0x43786f){_0x3b72ae=combineOptions(_0x3b72ae);var _0x5e2a06=new Buffer(_0x24e59b);var _0x38df64=fs[_0x5ddc('0xe')](_0x550332);var _0x219dc5=fs[_0x5ddc('0xf')](_0x4aa4c1);var _0x1bec8f=crypto[_0x5ddc('0x10')](_0x3b72ae[_0x5ddc('0x7')],_0x5e2a06);_0x38df64['on'](_0x5ddc('0x11'),function(_0x594828){var _0x6027bc=new Buffer(_0x1bec8f[_0x5ddc('0x12')](_0x594828),_0x5ddc('0x13'));_0x219dc5[_0x5ddc('0x14')](_0x6027bc);});_0x38df64['on']('end',function(){try{var _0x4cb0bb=new Buffer(_0x1bec8f[_0x5ddc('0x15')](_0x5ddc('0x13')),_0x5ddc('0x13'));_0x219dc5['write'](_0x4cb0bb);_0x219dc5['end']();_0x219dc5['on']('close',function(){return _0x402a12(_0x4aa4c1);});}catch(_0xd5e65f){fs[_0x5ddc('0x16')](_0x4aa4c1);return _0x43786f(_0xd5e65f);}});});};exports['decryptFile']=function(_0x53559d,_0x2cb669,_0xa8020a,_0x45d1c0){return new BPromise(function(_0x453b83,_0x6b2885){_0x45d1c0=combineOptions(_0x45d1c0);var _0x16cc5a=new Buffer(_0xa8020a);var _0x1e832a=fs['createReadStream'](_0x53559d);var _0x3aafd6=fs[_0x5ddc('0xf')](_0x2cb669);var _0x11fc8d=crypto[_0x5ddc('0x17')](_0x45d1c0[_0x5ddc('0x7')],_0x16cc5a);_0x1e832a['on'](_0x5ddc('0x11'),function(_0x17874e){var _0x2a3044=new Buffer(_0x11fc8d[_0x5ddc('0x12')](_0x17874e),_0x5ddc('0x13'));_0x3aafd6[_0x5ddc('0x14')](_0x2a3044);});_0x1e832a['on'](_0x5ddc('0x18'),function(){try{var _0x41f99c=new Buffer(_0x11fc8d[_0x5ddc('0x15')]('binary'),_0x5ddc('0x13'));_0x3aafd6[_0x5ddc('0x14')](_0x41f99c);_0x3aafd6[_0x5ddc('0x18')]();_0x3aafd6['on'](_0x5ddc('0x19'),function(){return _0x453b83(_0x2cb669);});}catch(_0x3db4a5){fs[_0x5ddc('0x16')](_0x2cb669);return _0x6b2885(_0x3db4a5);}});});};exports[_0x5ddc('0x1a')]=function(_0x114a82,_0x2e8173,_0x21d9e1){var _0x2fb895=_0x21d9e1||stringOptions[_0x5ddc('0x7')];var _0x27b242=_0x2e8173||stringOptions[_0x5ddc('0x1b')];var _0x8ae190=crypto[_0x5ddc('0x10')](_0x2fb895,_0x27b242);var _0x4780c4=_0x8ae190[_0x5ddc('0x12')](_0x114a82,'utf8',_0x5ddc('0x1c'));_0x4780c4+=_0x8ae190[_0x5ddc('0x15')](_0x5ddc('0x1c'));return _0x4780c4;};exports['decryptString']=function(_0x5b390f,_0x4672d8,_0x2bb33c){var _0x272577=_0x2bb33c||stringOptions[_0x5ddc('0x7')];var _0x3673ff=_0x4672d8||stringOptions[_0x5ddc('0x1b')];var _0x8adc7b=crypto['createDecipher'](_0x272577,_0x3673ff);var _0x3cf723=_0x8adc7b['update'](_0x5b390f,_0x5ddc('0x1c'),_0x5ddc('0x1d'));_0x3cf723+=_0x8adc7b[_0x5ddc('0x15')]('utf8');return _0x3cf723;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 87d9672..57faeb2 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 _0xc7be=['../../mysqldb','dbH','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','sequelize','SELECT','num','Empty','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','basename','.csv','length','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf'];(function(_0x204a0a,_0x445f81){var _0x4d51b2=function(_0x1e743d){while(--_0x1e743d){_0x204a0a['push'](_0x204a0a['shift']());}};_0x4d51b2(++_0x445f81);}(_0xc7be,0x95));var _0xec7b=function(_0x21d8a0,_0x30e663){_0x21d8a0=_0x21d8a0-0x0;var _0xd17598=_0xc7be[_0x21d8a0];return _0xd17598;};'use strict';var util=require(_0xec7b('0x0'));var path=require(_0xec7b('0x1'));var _=require(_0xec7b('0x2'));var csv=require(_0xec7b('0x3'));var fs=require('fs');var BPromise=require(_0xec7b('0x4'));var zipdir=require(_0xec7b('0x5'));var rimraf=require(_0xec7b('0x6'));var db=require(_0xec7b('0x7'))['db'];var dbH=require(_0xec7b('0x7'))[_0xec7b('0x8')];var logger=require(_0xec7b('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xec7b('0xa')][0x3];var PATH=process[_0xec7b('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x91881,_0x32ac5e){var _0x5e140d={'status':_0x91881};var _0x39059b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32ac5e){_0x5e140d['savename']=_0x32ac5e;}return db['AnalyticExtractedReport'][_0xec7b('0xb')](_0x5e140d,_0x39059b);}function main(){var _0x437de1=0x1388;var _0x110cd3;logger[_0xec7b('0xc')](util[_0xec7b('0xd')](_0xec7b('0xe'),EXTRACTED_REPORT_ID,_0xec7b('0xf')));return db[_0xec7b('0x10')][_0xec7b('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec7b('0x12'),_0xec7b('0x13')]})[_0xec7b('0x14')](function(_0x32213f){if(_0x32213f){_0x110cd3=_0x32213f;_0x437de1=_0x110cd3[_0xec7b('0x13')]||0x1388;}})[_0xec7b('0x14')](function(){return dbH['sequelize'][_0xec7b('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xec7b('0x16')]['QueryTypes'][_0xec7b('0x17')]});})[_0xec7b('0x14')](function(_0x211119){if(!_0x211119[0x0][_0xec7b('0x18')]){return analyticExtractedReport(_0xec7b('0x19'));}var _0xda8a86=[];var _0x4c8de6=0x0;if(_0x110cd3[_0xec7b('0x12')]){if(_0x211119&&_0x211119['length']){var _0x17edf8=_[_0xec7b('0x1a')](_0x211119[0x0][_0xec7b('0x18')]/_0x437de1);var _0x1682e4=Number[_0xec7b('0x1b')](_0x211119[0x0][_0xec7b('0x18')]/_0x437de1)?_0x211119[0x0][_0xec7b('0x18')]%_0x437de1:0x0;_0x17edf8[_0xec7b('0x1c')](function(_0x2d1675){if(_0x2d1675>0x0){_0x4c8de6+=_0x437de1;}_0xda8a86['push'](dbH[_0xec7b('0x16')][_0xec7b('0x15')](util['format'](_0xec7b('0x1d'),QUERY,_0x437de1,_0x4c8de6),{'type':dbH[_0xec7b('0x16')][_0xec7b('0x1e')][_0xec7b('0x17')]}));});if(_0x1682e4>0x0){_0x4c8de6+=_0x437de1;_0xda8a86[_0xec7b('0x1f')](dbH['sequelize']['query'](util[_0xec7b('0xd')](_0xec7b('0x1d'),QUERY,_0x1682e4,_0x4c8de6),{'type':dbH[_0xec7b('0x16')][_0xec7b('0x1e')][_0xec7b('0x17')]}));}}}else{_0xda8a86[_0xec7b('0x1f')](dbH['sequelize'][_0xec7b('0x15')](QUERY,{'type':dbH[_0xec7b('0x16')][_0xec7b('0x1e')][_0xec7b('0x17')]}));}var _0x527c6a=path['dirname'](PATH);var _0x5b7147=path[_0xec7b('0x20')](PATH,_0xec7b('0x21'));var _0x27a14c=_0x110cd3['split']&&_0xda8a86[_0xec7b('0x22')]>0x1;var _0x11c071=[];if(!fs[_0xec7b('0x23')](path[_0xec7b('0x24')](_0x527c6a,_0x5b7147))&&_0x27a14c){fs[_0xec7b('0x25')](path[_0xec7b('0x24')](_0x527c6a,_0x5b7147));}return BPromise[_0xec7b('0x26')](_0xda8a86,function(_0x5474d9){_0x11c071[_0xec7b('0x1f')](_0x5474d9);})['then'](function(){for(var _0x5939d0=0x0;_0x5939d0<_0x11c071[_0xec7b('0x22')];_0x5939d0+=0x1){var _0x4efe6f;var _0xfcf907=_0x11c071[_0x5939d0];if(_0x27a14c){_0x4efe6f=path['join'](_0x527c6a,_0x5b7147,util['format']('%s%d.%s',_0x5b7147,_0x5939d0,_0xec7b('0x27')));}else{_0x4efe6f=path[_0xec7b('0x24')](_0x527c6a,util['format'](_0xec7b('0x28'),_0x5b7147,_0xec7b('0x27')));}fs[_0xec7b('0x29')](_0x4efe6f,csv(_0xfcf907));}})[_0xec7b('0x14')](function(){if(_0x27a14c){return new Promise(function(_0x1d6f0c){zipdir(path[_0xec7b('0x24')](_0x527c6a,_0x5b7147),{'saveTo':path['join'](_0x527c6a,util[_0xec7b('0xd')](_0xec7b('0x28'),_0x5b7147,_0xec7b('0x2a')))},function(_0x41a469,_0x2dea2a){rimraf(path[_0xec7b('0x24')](_0x527c6a,_0x5b7147),function(){});_0x1d6f0c(_0xec7b('0x2b'));});});}})['then'](function(){logger[_0xec7b('0xc')](util[_0xec7b('0xd')](_0xec7b('0x2c'),EXTRACTED_REPORT_ID,_0xec7b('0xf')));return analyticExtractedReport(_0xec7b('0x2d'),_0x27a14c?util[_0xec7b('0xd')](_0xec7b('0x28'),_0x5b7147,_0x27a14c?_0xec7b('0x2a'):_0xec7b('0x27')):null);});})[_0xec7b('0x2e')](function(_0x21317c){logger[_0xec7b('0xc')](util['format'](_0xec7b('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util[_0xec7b('0x30')](_0x21317c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xec7b('0x31'));})[_0xec7b('0x32')](function(){process[_0xec7b('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe9d0=['argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','../../mysqldb','dbH','analytics'];(function(_0x703b3f,_0x58180e){var _0x39511c=function(_0x3a6927){while(--_0x3a6927){_0x703b3f['push'](_0x703b3f['shift']());}};_0x39511c(++_0x58180e);}(_0xe9d0,0x1a9));var _0x0e9d=function(_0x4313b7,_0xebce82){_0x4313b7=_0x4313b7-0x0;var _0x4f15db=_0xe9d0[_0x4313b7];return _0x4f15db;};'use strict';var util=require(_0x0e9d('0x0'));var path=require(_0x0e9d('0x1'));var _=require(_0x0e9d('0x2'));var csv=require(_0x0e9d('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x0e9d('0x4'))['db'];var dbH=require(_0x0e9d('0x4'))[_0x0e9d('0x5')];var logger=require('../../config/logger')(_0x0e9d('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0e9d('0x7')][0x2]);var QUERY=process[_0x0e9d('0x7')][0x3];var PATH=process[_0x0e9d('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x440a87,_0x184975){var _0x4e2239={'status':_0x440a87};var _0x2fbbe2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x184975){_0x4e2239['savename']=_0x184975;}return db[_0x0e9d('0x8')]['update'](_0x4e2239,_0x2fbbe2);}function main(){var _0xaa8606=0x1388;var _0x417bb9;logger[_0x0e9d('0x9')](util[_0x0e9d('0xa')](_0x0e9d('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x0e9d('0xc')][_0x0e9d('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x5848f8){if(_0x5848f8){_0x417bb9=_0x5848f8;_0xaa8606=_0x417bb9[_0x0e9d('0xe')]||0x1388;}})[_0x0e9d('0xf')](function(){return dbH[_0x0e9d('0x10')][_0x0e9d('0x11')](util[_0x0e9d('0xa')](_0x0e9d('0x12'),QUERY),{'type':dbH[_0x0e9d('0x10')][_0x0e9d('0x13')][_0x0e9d('0x14')]});})[_0x0e9d('0xf')](function(_0x401efe){if(!_0x401efe[0x0][_0x0e9d('0x15')]){return analyticExtractedReport(_0x0e9d('0x16'));}var _0x3ff361=[];var _0x1fe5c0=0x0;if(_0x417bb9[_0x0e9d('0x17')]){if(_0x401efe&&_0x401efe[_0x0e9d('0x18')]){var _0x2419c6=_['range'](_0x401efe[0x0][_0x0e9d('0x15')]/_0xaa8606);var _0xf47306=Number[_0x0e9d('0x19')](_0x401efe[0x0][_0x0e9d('0x15')]/_0xaa8606)?_0x401efe[0x0]['num']%_0xaa8606:0x0;_0x2419c6['forEach'](function(_0x336fbe){if(_0x336fbe>0x0){_0x1fe5c0+=_0xaa8606;}_0x3ff361[_0x0e9d('0x1a')](dbH['sequelize']['query'](util[_0x0e9d('0xa')](_0x0e9d('0x1b'),QUERY,_0xaa8606,_0x1fe5c0),{'type':dbH[_0x0e9d('0x10')][_0x0e9d('0x13')]['SELECT']}));});if(_0xf47306>0x0){_0x1fe5c0+=_0xaa8606;_0x3ff361[_0x0e9d('0x1a')](dbH[_0x0e9d('0x10')][_0x0e9d('0x11')](util[_0x0e9d('0xa')](_0x0e9d('0x1b'),QUERY,_0xf47306,_0x1fe5c0),{'type':dbH[_0x0e9d('0x10')]['QueryTypes'][_0x0e9d('0x14')]}));}}}else{_0x3ff361[_0x0e9d('0x1a')](dbH[_0x0e9d('0x10')][_0x0e9d('0x11')](QUERY,{'type':dbH[_0x0e9d('0x10')][_0x0e9d('0x13')][_0x0e9d('0x14')]}));}var _0x7e0e6d=path[_0x0e9d('0x1c')](PATH);var _0x575d39=path[_0x0e9d('0x1d')](PATH,_0x0e9d('0x1e'));var _0x473465=_0x417bb9[_0x0e9d('0x17')]&&_0x3ff361['length']>0x1;var _0x230dae=[];if(!fs[_0x0e9d('0x1f')](path['join'](_0x7e0e6d,_0x575d39))&&_0x473465){fs[_0x0e9d('0x20')](path[_0x0e9d('0x21')](_0x7e0e6d,_0x575d39));}return BPromise[_0x0e9d('0x22')](_0x3ff361,function(_0x5244ab){_0x230dae['push'](_0x5244ab);})[_0x0e9d('0xf')](function(){for(var _0x310550=0x0;_0x310550<_0x230dae[_0x0e9d('0x18')];_0x310550+=0x1){var _0x28ad4c;var _0x3e2d5a=_0x230dae[_0x310550];if(_0x473465){_0x28ad4c=path[_0x0e9d('0x21')](_0x7e0e6d,_0x575d39,util[_0x0e9d('0xa')](_0x0e9d('0x23'),_0x575d39,_0x310550,_0x0e9d('0x24')));}else{_0x28ad4c=path[_0x0e9d('0x21')](_0x7e0e6d,util[_0x0e9d('0xa')](_0x0e9d('0x25'),_0x575d39,_0x0e9d('0x24')));}fs['writeFileSync'](_0x28ad4c,csv(_0x3e2d5a));}})[_0x0e9d('0xf')](function(){if(_0x473465){return new Promise(function(_0xf307c8){zipdir(path[_0x0e9d('0x21')](_0x7e0e6d,_0x575d39),{'saveTo':path[_0x0e9d('0x21')](_0x7e0e6d,util[_0x0e9d('0xa')](_0x0e9d('0x25'),_0x575d39,_0x0e9d('0x26')))},function(_0x408598,_0x4729e0){rimraf(path[_0x0e9d('0x21')](_0x7e0e6d,_0x575d39),function(){});_0xf307c8(_0x0e9d('0x27'));});});}})[_0x0e9d('0xf')](function(){logger[_0x0e9d('0x9')](util[_0x0e9d('0xa')](_0x0e9d('0x28'),EXTRACTED_REPORT_ID,_0x0e9d('0x29')));return analyticExtractedReport('Completed',_0x473465?util[_0x0e9d('0xa')](_0x0e9d('0x25'),_0x575d39,_0x473465?_0x0e9d('0x26'):'csv'):null);});})[_0x0e9d('0x2a')](function(_0x51bb17){logger[_0x0e9d('0x9')](util[_0x0e9d('0xa')](_0x0e9d('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util[_0x0e9d('0x2c')](_0x51bb17,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0e9d('0x2d'));})[_0x0e9d('0x2e')](function(){process[_0x0e9d('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ffd49f0..bb2b60a 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 _0xd863=['Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','util','path','html-to-pdfmake','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','length','body','concat','chunk','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','footer','Arial','black','right','num','Setting','find','splitSizePdf','then','split','isInteger','sequelize','QueryTypes','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.pdf','mkdirSync','each','flatten','join','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF'];(function(_0x49b9b5,_0x4849d0){var _0x2c4651=function(_0x1db1ed){while(--_0x1db1ed){_0x49b9b5['push'](_0x49b9b5['shift']());}};_0x2c4651(++_0x4849d0);}(_0xd863,0xb5));var _0x3d86=function(_0x1797c1,_0x43a18a){_0x1797c1=_0x1797c1-0x0;var _0x5e7c9a=_0xd863[_0x1797c1];return _0x5e7c9a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x3d86('0x0'));var path=require(_0x3d86('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x3d86('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x3d86('0x3'))[_0x3d86('0x4')];var window=new JSDOM('')[_0x3d86('0x5')];var BPromise=require('bluebird');var db=require(_0x3d86('0x6'))['db'];var dbH=require(_0x3d86('0x6'))[_0x3d86('0x7')];var logger=require(_0x3d86('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3d86('0x9')][0x2]);var QUERY=process[_0x3d86('0x9')][0x3];var PATH=process[_0x3d86('0x9')][0x4];var NAME=process[_0x3d86('0x9')][0x5];var FORMAT=_0x3d86('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2da9bf,_0xa33bcf){var _0x55c36f={'status':_0x2da9bf};var _0x49fdc8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa33bcf){_0x55c36f[_0x3d86('0xb')]=_0xa33bcf;}return db[_0x3d86('0xc')][_0x3d86('0xd')](_0x55c36f,_0x49fdc8);}function getHeaders(_0x51198b){return _[_0x3d86('0xe')](_0x51198b,function(_0x123186){return{'text':_0x123186,'style':_0x3d86('0xf')};});}function getRows(_0x15a48b,_0x4ff322){return _['map'](_0x4ff322,function(_0x4a28a6){return _(_0x4a28a6)['pick'](_0x15a48b)['map'](function(_0xa8db61){return _0xa8db61?_[_0x3d86('0x10')](_0xa8db61):'';})['value']();});}function createTable(_0x408ac6,_0x162731){var _0x43b58f={'widths':_[_0x3d86('0x11')](Array(_0x408ac6[_0x3d86('0x12')]),0x91),'heights':function(_0x2363c3){return _0x2363c3===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x12562b=getHeaders(_0x408ac6);_0x43b58f['body']['push'](_0x12562b);var _0x3fd3ab=getRows(_0x408ac6,_0x162731);_0x43b58f['body']=_0x43b58f[_0x3d86('0x13')][_0x3d86('0x14')](_0x3fd3ab);return _0x43b58f;}function createTables(_0x43b513){var _0x4a8a07=[];var _0x11d643=_[_0x3d86('0x15')](Object['keys'](_0x43b513[0x0]),0x5);_0x11d643[_0x3d86('0x16')](function(_0x38db1b){_0x4a8a07[_0x3d86('0x17')](createTable(_0x38db1b,_0x43b513));});return _0x4a8a07;}function getPDFDocDefinition(_0x327da5){var _0x4557eb=util[_0x3d86('0x18')](_0x3d86('0x19'),NAME,EXTRACTED_REPORT[_0x3d86('0x1a')],moment(EXTRACTED_REPORT[_0x3d86('0x1b')])[_0x3d86('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x3d86('0x1c')])[_0x3d86('0x18')](FORMAT));var _0xcae154=[];for(var _0x337219=0x0;_0x337219<_0x327da5[_0x3d86('0x12')];_0x337219++){var _0x30ba07=[];if(_0x337219===0x0){_0x30ba07[_0x3d86('0x17')]({'text':_0x4557eb,'style':_0x3d86('0x1d')});}var _0x820aec={'table':_0x327da5[_0x337219]};if(_0x337219>0x0){_0x820aec[_0x3d86('0x1e')]=_0x3d86('0x1f');_0x820aec[_0x3d86('0x20')]=[0x0,0x46,0x0,0x0];}_0x30ba07['push'](_0x820aec);_0xcae154[_0x3d86('0x17')](_0x30ba07);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0xcae154,'footer':function(_0x5421c2,_0x78d0ad){return{'text':_0x5421c2[_0x3d86('0x10')]()+'\x20/\x20'+_0x78d0ad,'style':_0x3d86('0x21')};},'defaultStyle':{'font':_0x3d86('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3d86('0x23')},'footer':{'alignment':_0x3d86('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x102d8e){var _0x229112=0x1388;var _0x22c3c2;if(!_0x102d8e[0x0][_0x3d86('0x25')]){return analyticExtractedReport('Empty');}return db[_0x3d86('0x26')][_0x3d86('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3d86('0x28')]})[_0x3d86('0x29')](function(_0x285c7c){if(_0x285c7c){_0x22c3c2=_0x285c7c;_0x229112=_0x22c3c2[_0x3d86('0x28')]||0x3e8;}})[_0x3d86('0x29')](function(){var _0x4cf685=[];var _0x2bbd1d=0x0;if(_0x22c3c2[_0x3d86('0x2a')]){if(_0x102d8e&&_0x102d8e['length']){var _0x2d7c2c=_['range'](_0x102d8e[0x0][_0x3d86('0x25')]/_0x229112);var _0x47c938=Number[_0x3d86('0x2b')](_0x102d8e[0x0]['num']/_0x229112)?_0x102d8e[0x0][_0x3d86('0x25')]%_0x229112:0x0;_0x2d7c2c[_0x3d86('0x16')](function(_0x228e82){if(_0x228e82>0x0){_0x2bbd1d+=_0x229112;}_0x4cf685['push'](dbH['sequelize']['query'](util[_0x3d86('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x229112,_0x2bbd1d),{'type':dbH[_0x3d86('0x2c')][_0x3d86('0x2d')]['SELECT']}));});if(_0x47c938>0x0){_0x2bbd1d+=_0x229112;_0x4cf685['push'](dbH[_0x3d86('0x2c')][_0x3d86('0x2e')](util[_0x3d86('0x18')](_0x3d86('0x2f'),QUERY,_0x47c938,_0x2bbd1d),{'type':dbH[_0x3d86('0x2c')]['QueryTypes'][_0x3d86('0x30')]}));}}}else{_0x4cf685[_0x3d86('0x17')](dbH[_0x3d86('0x2c')][_0x3d86('0x2e')](QUERY,{'type':dbH[_0x3d86('0x2c')][_0x3d86('0x2d')][_0x3d86('0x30')]}));}var _0x2ff7d8=path['dirname'](PATH);var _0x16ce30=path[_0x3d86('0x31')](PATH,_0x3d86('0x32'));var _0x4706f0=_0x22c3c2[_0x3d86('0x2a')]&&_0x4cf685[_0x3d86('0x12')]>0x1;var _0x5c4e1f=[];if(!fs['existsSync'](path['join'](_0x2ff7d8,_0x16ce30))&&_0x4706f0){fs[_0x3d86('0x33')](path['join'](_0x2ff7d8,_0x16ce30));}return BPromise[_0x3d86('0x34')](_0x4cf685,function(_0xe1588f){_0x5c4e1f['push'](_0xe1588f);})['then'](function(){var _0x5cfdad=[];for(var _0x588dbe=0x0;_0x588dbe<_0x5c4e1f[_0x3d86('0x12')];_0x588dbe+=0x1){var _0x1d1045=_0x5c4e1f[_0x588dbe];var _0x4c2953=createTables(_[_0x3d86('0x35')](_0x1d1045));var _0x17bf37;var _0x3a6569=getPDFDocDefinition(_0x4c2953);var _0x15c095=getPDFPrinter();var _0x3a752e=_0x15c095['createPdfKitDocument'](_0x3a6569);if(_0x4706f0){_0x17bf37=path[_0x3d86('0x36')](_0x2ff7d8,_0x16ce30,util[_0x3d86('0x18')]('%s%d.%s',_0x16ce30,_0x588dbe,_0x3d86('0x37')));}else{_0x17bf37=path[_0x3d86('0x36')](_0x2ff7d8,util[_0x3d86('0x18')](_0x3d86('0x38'),_0x16ce30,'pdf'));}_0x5cfdad['push'](writePDFDocument(_0x3a752e,_0x17bf37));}return Promise[_0x3d86('0x39')](_0x5cfdad);})[_0x3d86('0x29')](function(){if(_0x4706f0){return new Promise(function(_0x47d290){zipdir(path[_0x3d86('0x36')](_0x2ff7d8,_0x16ce30),{'saveTo':path[_0x3d86('0x36')](_0x2ff7d8,util['format'](_0x3d86('0x38'),_0x16ce30,_0x3d86('0x3a')))},function(){rimraf(path[_0x3d86('0x36')](_0x2ff7d8,_0x16ce30),function(){});_0x47d290('zip\x20finished');});});}})[_0x3d86('0x29')](function(){if(!_0x4706f0)return;rimraf(path[_0x3d86('0x36')](_0x2ff7d8,_0x16ce30),function(){});})['then'](function(){logger[_0x3d86('0x3b')](util[_0x3d86('0x18')](_0x3d86('0x3c'),EXTRACTED_REPORT_ID,_0x3d86('0x3d')));return analyticExtractedReport(_0x3d86('0x3e'),_0x4706f0?util[_0x3d86('0x18')](_0x3d86('0x38'),_0x16ce30,_0x4706f0?'zip':_0x3d86('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x3d86('0x18')](_0x3d86('0x3f'),EXTRACTED_REPORT_ID,_0x3d86('0x3d')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3d86('0x29')](function(_0x4aa618){EXTRACTED_REPORT=_0x4aa618;return dbH['sequelize']['query'](util[_0x3d86('0x18')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3d86('0x2c')][_0x3d86('0x2d')][_0x3d86('0x30')]});})[_0x3d86('0x29')](extractReport)['catch'](function(_0x22a1e5){logger[_0x3d86('0x3b')](util[_0x3d86('0x18')](_0x3d86('0x40'),EXTRACTED_REPORT_ID,_0x3d86('0x3d')),util[_0x3d86('0x41')](_0x22a1e5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3d86('0x42')](function(){process[_0x3d86('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4dc803=new PdfPrinter({'Arial':{'normal':__dirname+_0x3d86('0x44'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3d86('0x45'),'bolditalics':__dirname+_0x3d86('0x46')}});return _0x4dc803;}function getPDFDocDefinitionFromHTML(_0x1c6cc0,_0x339f7c){var _0x8386e1=util[_0x3d86('0x18')]('%s\x20#%d',_0x339f7c[_0x3d86('0x47')],_0x339f7c['interactionId']);var _0x46e622=moment()[_0x3d86('0x18')](_0x3d86('0x48'))['toString']();var _0x46a906=htmlToPdfmake(_0x1c6cc0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x46a906],'defaultStyle':{'font':_0x3d86('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3d86('0x49'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3d86('0x49'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3d86('0x49')}},'header':function(){return[{'text':_0x3d86('0x4a'),'style':_0x3d86('0x1d')}];},'footer':function(_0x315cf5,_0x51e445){return[{'text':util[_0x3d86('0x18')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x8386e1,_0x315cf5,_0x51e445,_0x46e622),'style':_0x3d86('0x21')}];}};}function writePDFDocument(_0x1611e7,_0x11d295){return new Promise(function(_0x3a78a2,_0x31d22b){var _0x5b1fb6=_0x1611e7['pipe'](fs[_0x3d86('0x4b')](_0x11d295));_0x5b1fb6['on'](_0x3d86('0x4c'),function(){_0x3a78a2('finish');});_0x5b1fb6['on'](_0x3d86('0x4d'),function(_0x23fb73){_0x31d22b(_0x23fb73);});_0x1611e7[_0x3d86('0x4e')]();});}exports[_0x3d86('0x4f')]=function(_0x283214,_0x4ab884){var _0x15a785=getPDFPrinter();var _0x2c06cb=getPDFDocDefinitionFromHTML(_0x283214,_0x4ab884);var _0x56ab05=_0x15a785[_0x3d86('0x50')](_0x2c06cb);return writePDFDocument(_0x56ab05,_0x4ab884[_0x3d86('0x1')])['catch'](function(_0x419720){throw _0x419720;});}; \ No newline at end of file +var _0xe29b=['analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','length','auto','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','join','mkdirSync','each','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.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','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../config/logger'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0xe29b,0x1c6));var _0xbe29=function(_0x5314bd,_0x101647){_0x5314bd=_0x5314bd-0x0;var _0x47b452=_0xe29b[_0x5314bd];return _0x47b452;};'use strict';var _=require(_0xbe29('0x0'));var fs=require('fs');var util=require(_0xbe29('0x1'));var path=require(_0xbe29('0x2'));var moment=require(_0xbe29('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbe29('0x4'));var rimraf=require(_0xbe29('0x5'));var JSDOM=require(_0xbe29('0x6'))[_0xbe29('0x7')];var window=new JSDOM('')[_0xbe29('0x8')];var BPromise=require(_0xbe29('0x9'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xbe29('0xa'))(_0xbe29('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xbe29('0xc')][0x2]);var QUERY=process[_0xbe29('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbe29('0xc')][0x5];var FORMAT=_0xbe29('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x35000e,_0x3e4902){var _0x428efc={'status':_0x35000e};var _0x55b781={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e4902){_0x428efc[_0xbe29('0xe')]=_0x3e4902;}return db[_0xbe29('0xf')][_0xbe29('0x10')](_0x428efc,_0x55b781);}function getHeaders(_0x14fcb5){return _['map'](_0x14fcb5,function(_0x1f100f){return{'text':_0x1f100f,'style':_0xbe29('0x11')};});}function getRows(_0x4b9fa2,_0x1812a){return _[_0xbe29('0x12')](_0x1812a,function(_0x514c6f){return _(_0x514c6f)[_0xbe29('0x13')](_0x4b9fa2)[_0xbe29('0x12')](function(_0x31f266){return _0x31f266?_[_0xbe29('0x14')](_0x31f266):'';})['value']();});}function createTable(_0x269fa6,_0x1e76ae){var _0x543390={'widths':_['fill'](Array(_0x269fa6[_0xbe29('0x15')]),0x91),'heights':function(_0x4203da){return _0x4203da===0x0?_0xbe29('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x130de2=getHeaders(_0x269fa6);_0x543390[_0xbe29('0x17')]['push'](_0x130de2);var _0x3a13dc=getRows(_0x269fa6,_0x1e76ae);_0x543390[_0xbe29('0x17')]=_0x543390[_0xbe29('0x17')]['concat'](_0x3a13dc);return _0x543390;}function createTables(_0x1c965d){var _0x22e3d4=[];var _0x354a06=_[_0xbe29('0x18')](Object[_0xbe29('0x19')](_0x1c965d[0x0]),0x5);_0x354a06[_0xbe29('0x1a')](function(_0x499495){_0x22e3d4['push'](createTable(_0x499495,_0x1c965d));});return _0x22e3d4;}function getPDFDocDefinition(_0x4d4cd9){var _0x333af9=util[_0xbe29('0x1b')](_0xbe29('0x1c'),NAME,EXTRACTED_REPORT[_0xbe29('0x1d')],moment(EXTRACTED_REPORT[_0xbe29('0x1e')])[_0xbe29('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xbe29('0x1f')])['format'](FORMAT));var _0x8144ce=[];for(var _0xbc6ceb=0x0;_0xbc6ceb<_0x4d4cd9['length'];_0xbc6ceb++){var _0x1ecb7c=[];if(_0xbc6ceb===0x0){_0x1ecb7c[_0xbe29('0x20')]({'text':_0x333af9,'style':_0xbe29('0x21')});}var _0xb27b17={'table':_0x4d4cd9[_0xbc6ceb]};if(_0xbc6ceb>0x0){_0xb27b17['pageBreak']=_0xbe29('0x22');_0xb27b17[_0xbe29('0x23')]=[0x0,0x46,0x0,0x0];}_0x1ecb7c[_0xbe29('0x20')](_0xb27b17);_0x8144ce[_0xbe29('0x20')](_0x1ecb7c);}return{'pageSize':'A4','pageOrientation':_0xbe29('0x24'),'content':_0x8144ce,'footer':function(_0x188146,_0x4f9bc0){return{'text':_0x188146[_0xbe29('0x14')]()+_0xbe29('0x25')+_0x4f9bc0,'style':_0xbe29('0x26')};},'defaultStyle':{'font':_0xbe29('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbe29('0x28')},'footer':{'alignment':_0xbe29('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x53ba3d){var _0xe33d2c=0x1388;var _0x3167b1;if(!_0x53ba3d[0x0][_0xbe29('0x2a')]){return analyticExtractedReport('Empty');}return db[_0xbe29('0x2b')][_0xbe29('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbe29('0x2d'),_0xbe29('0x2e')]})[_0xbe29('0x2f')](function(_0x1d478b){if(_0x1d478b){_0x3167b1=_0x1d478b;_0xe33d2c=_0x3167b1['splitSizePdf']||0x3e8;}})['then'](function(){var _0x1ffaac=[];var _0x49f193=0x0;if(_0x3167b1['split']){if(_0x53ba3d&&_0x53ba3d['length']){var _0x1c0d0a=_[_0xbe29('0x30')](_0x53ba3d[0x0][_0xbe29('0x2a')]/_0xe33d2c);var _0x169d07=Number[_0xbe29('0x31')](_0x53ba3d[0x0]['num']/_0xe33d2c)?_0x53ba3d[0x0][_0xbe29('0x2a')]%_0xe33d2c:0x0;_0x1c0d0a[_0xbe29('0x1a')](function(_0x2f1a21){if(_0x2f1a21>0x0){_0x49f193+=_0xe33d2c;}_0x1ffaac[_0xbe29('0x20')](dbH[_0xbe29('0x32')][_0xbe29('0x33')](util['format'](_0xbe29('0x34'),QUERY,_0xe33d2c,_0x49f193),{'type':dbH[_0xbe29('0x32')][_0xbe29('0x35')][_0xbe29('0x36')]}));});if(_0x169d07>0x0){_0x49f193+=_0xe33d2c;_0x1ffaac[_0xbe29('0x20')](dbH[_0xbe29('0x32')][_0xbe29('0x33')](util[_0xbe29('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x169d07,_0x49f193),{'type':dbH[_0xbe29('0x32')][_0xbe29('0x35')]['SELECT']}));}}}else{_0x1ffaac[_0xbe29('0x20')](dbH[_0xbe29('0x32')]['query'](QUERY,{'type':dbH[_0xbe29('0x32')][_0xbe29('0x35')]['SELECT']}));}var _0x35662a=path[_0xbe29('0x37')](PATH);var _0x133b0c=path[_0xbe29('0x38')](PATH,_0xbe29('0x39'));var _0x380c60=_0x3167b1['split']&&_0x1ffaac['length']>0x1;var _0x33c4d6=[];if(!fs['existsSync'](path[_0xbe29('0x3a')](_0x35662a,_0x133b0c))&&_0x380c60){fs[_0xbe29('0x3b')](path['join'](_0x35662a,_0x133b0c));}return BPromise[_0xbe29('0x3c')](_0x1ffaac,function(_0x170c34){_0x33c4d6['push'](_0x170c34);})['then'](function(){var _0x583b9b=[];for(var _0x3764db=0x0;_0x3764db<_0x33c4d6[_0xbe29('0x15')];_0x3764db+=0x1){var _0x499c85=_0x33c4d6[_0x3764db];var _0x162481=createTables(_['flatten'](_0x499c85));var _0x12aa03;var _0x1e5d8e=getPDFDocDefinition(_0x162481);var _0x20da10=getPDFPrinter();var _0x4093b9=_0x20da10['createPdfKitDocument'](_0x1e5d8e);if(_0x380c60){_0x12aa03=path[_0xbe29('0x3a')](_0x35662a,_0x133b0c,util[_0xbe29('0x1b')](_0xbe29('0x3d'),_0x133b0c,_0x3764db,'pdf'));}else{_0x12aa03=path['join'](_0x35662a,util[_0xbe29('0x1b')]('%s.%s',_0x133b0c,_0xbe29('0x3e')));}_0x583b9b[_0xbe29('0x20')](writePDFDocument(_0x4093b9,_0x12aa03));}return Promise['all'](_0x583b9b);})[_0xbe29('0x2f')](function(){if(_0x380c60){return new Promise(function(_0x5c6f00){zipdir(path['join'](_0x35662a,_0x133b0c),{'saveTo':path['join'](_0x35662a,util[_0xbe29('0x1b')](_0xbe29('0x3f'),_0x133b0c,_0xbe29('0x40')))},function(){rimraf(path[_0xbe29('0x3a')](_0x35662a,_0x133b0c),function(){});_0x5c6f00(_0xbe29('0x41'));});});}})[_0xbe29('0x2f')](function(){if(!_0x380c60)return;rimraf(path[_0xbe29('0x3a')](_0x35662a,_0x133b0c),function(){});})[_0xbe29('0x2f')](function(){logger[_0xbe29('0x42')](util[_0xbe29('0x1b')](_0xbe29('0x43'),EXTRACTED_REPORT_ID,_0xbe29('0x44')));return analyticExtractedReport(_0xbe29('0x45'),_0x380c60?util[_0xbe29('0x1b')]('%s.%s',_0x133b0c,_0x380c60?_0xbe29('0x40'):_0xbe29('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbe29('0x42')](util['format'](_0xbe29('0x46'),EXTRACTED_REPORT_ID,_0xbe29('0x44')));return db[_0xbe29('0xf')][_0xbe29('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbe29('0x2f')](function(_0x39d197){EXTRACTED_REPORT=_0x39d197;return dbH[_0xbe29('0x32')]['query'](util[_0xbe29('0x1b')](_0xbe29('0x48'),QUERY),{'type':dbH[_0xbe29('0x32')][_0xbe29('0x35')][_0xbe29('0x36')]});})[_0xbe29('0x2f')](extractReport)['catch'](function(_0x1ad40a){logger[_0xbe29('0x42')](util['format'](_0xbe29('0x49'),EXTRACTED_REPORT_ID,_0xbe29('0x44')),util[_0xbe29('0x4a')](_0x1ad40a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbe29('0x4b'));})['finally'](function(){process[_0xbe29('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4bbac3=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xbe29('0x4d'),'italics':__dirname+_0xbe29('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x4bbac3;}function getPDFDocDefinitionFromHTML(_0xd63b7c,_0x3966c9){var _0xb297b2=util[_0xbe29('0x1b')](_0xbe29('0x4f'),_0x3966c9[_0xbe29('0x50')],_0x3966c9[_0xbe29('0x51')]);var _0x54e60f=moment()[_0xbe29('0x1b')](_0xbe29('0x52'))[_0xbe29('0x14')]();var _0x130bea=htmlToPdfmake(_0xd63b7c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x130bea],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbe29('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbe29('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbe29('0x53')}},'header':function(){return[{'text':_0xbe29('0x54'),'style':_0xbe29('0x21')}];},'footer':function(_0x1a0063,_0xda0964){return[{'text':util[_0xbe29('0x1b')](_0xbe29('0x55'),_0xb297b2,_0x1a0063,_0xda0964,_0x54e60f),'style':'footer'}];}};}function writePDFDocument(_0x1f9a54,_0x5d1c1c){return new Promise(function(_0x6391b6,_0xa2f57a){var _0x2e658b=_0x1f9a54[_0xbe29('0x56')](fs[_0xbe29('0x57')](_0x5d1c1c));_0x2e658b['on'](_0xbe29('0x58'),function(){_0x6391b6(_0xbe29('0x58'));});_0x2e658b['on'](_0xbe29('0x59'),function(_0x4a8929){_0xa2f57a(_0x4a8929);});_0x1f9a54[_0xbe29('0x5a')]();});}exports[_0xbe29('0x5b')]=function(_0x30b2bf,_0x48930c){var _0x5c43bb=getPDFPrinter();var _0x4c4e70=getPDFDocDefinitionFromHTML(_0x30b2bf,_0x48930c);var _0x5defb2=_0x5c43bb['createPdfKitDocument'](_0x4c4e70);return writePDFDocument(_0x5defb2,_0x48930c['path'])[_0xbe29('0x5c')](function(_0x438437){throw _0x438437;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 32d5164..8dd438e 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 _0x07c3=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','length','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x07c3,0xe0));var _0x307c=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0x07c3[_0x2b0690];return _0x82be1;};'use strict';var util=require(_0x307c('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x307c('0x1'));var BPromise=require(_0x307c('0x2'));var zipdir=require(_0x307c('0x3'));var rimraf=require('rimraf');var db=require(_0x307c('0x4'))['db'];var dbH=require(_0x307c('0x4'))[_0x307c('0x5')];var logger=require('../../config/logger')(_0x307c('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x307c('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x307c('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x597ee8,_0x5f1d3d){var _0x481bd7={'status':_0x597ee8};var _0x509b60={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f1d3d){_0x481bd7[_0x307c('0x8')]=_0x5f1d3d;}return db[_0x307c('0x9')]['update'](_0x481bd7,_0x509b60);}function main(){var _0x2614e2=0x1388;var _0x222803;logger[_0x307c('0xa')](util['format'](_0x307c('0xb'),EXTRACTED_REPORT_ID,_0x307c('0xc')));return db[_0x307c('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x307c('0xe')](function(_0x31d086){if(_0x31d086){_0x222803=_0x31d086;_0x2614e2=_0x222803['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x307c('0xf')][_0x307c('0x10')](util[_0x307c('0x11')](_0x307c('0x12'),QUERY),{'type':dbH[_0x307c('0xf')][_0x307c('0x13')]['SELECT']});})[_0x307c('0xe')](function(_0x20d12b){if(!_0x20d12b[0x0][_0x307c('0x14')]){return analyticExtractedReport(_0x307c('0x15'));}var _0x1f4fb4=[];var _0x354ffd=0x0;if(_0x222803[_0x307c('0x16')]){if(_0x20d12b&&_0x20d12b[_0x307c('0x17')]){var _0x2fb0d6=_[_0x307c('0x18')](_0x20d12b[0x0][_0x307c('0x14')]/_0x2614e2);var _0x1aabac=Number['isInteger'](_0x20d12b[0x0][_0x307c('0x14')]/_0x2614e2)?_0x20d12b[0x0][_0x307c('0x14')]%_0x2614e2:0x0;_0x2fb0d6[_0x307c('0x19')](function(_0x634640){if(_0x634640>0x0){_0x354ffd+=_0x2614e2;}_0x1f4fb4['push'](dbH['sequelize'][_0x307c('0x10')](util[_0x307c('0x11')](_0x307c('0x1a'),QUERY,_0x2614e2,_0x354ffd),{'type':dbH['sequelize'][_0x307c('0x13')][_0x307c('0x1b')]}));});if(_0x1aabac>0x0){_0x354ffd+=_0x2614e2;_0x1f4fb4['push'](dbH[_0x307c('0xf')][_0x307c('0x10')](util[_0x307c('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1aabac,_0x354ffd),{'type':dbH[_0x307c('0xf')]['QueryTypes'][_0x307c('0x1b')]}));}}}else{_0x1f4fb4['push'](dbH[_0x307c('0xf')]['query'](QUERY,{'type':dbH[_0x307c('0xf')][_0x307c('0x13')][_0x307c('0x1b')]}));}var _0x35b5de=path[_0x307c('0x1c')](PATH);var _0x283a40=path[_0x307c('0x1d')](PATH,_0x307c('0x1e'));var _0xe2c003=_0x222803[_0x307c('0x16')]&&_0x1f4fb4[_0x307c('0x17')]>0x1;var _0x2a298e=[];if(!fs[_0x307c('0x1f')](path[_0x307c('0x20')](_0x35b5de,_0x283a40))&&_0xe2c003){fs[_0x307c('0x21')](path[_0x307c('0x20')](_0x35b5de,_0x283a40));}return BPromise[_0x307c('0x22')](_0x1f4fb4,function(_0x5d551b){_0x2a298e['push'](_0x5d551b);})[_0x307c('0xe')](function(){for(var _0x44711b=0x0;_0x44711b<_0x2a298e[_0x307c('0x17')];_0x44711b+=0x1){var _0x5c34ad;var _0x24db75=_0x2a298e[_0x44711b];if(_0xe2c003){_0x5c34ad=path['join'](_0x35b5de,_0x283a40,util['format'](_0x307c('0x23'),_0x283a40,_0x44711b,_0x307c('0x24')));}else{_0x5c34ad=path[_0x307c('0x20')](_0x35b5de,util[_0x307c('0x11')](_0x307c('0x25'),_0x283a40,'xlsx'));}fs[_0x307c('0x26')](_0x5c34ad,json2xls(_0x24db75),'binary');}})[_0x307c('0xe')](function(){if(_0xe2c003){return new Promise(function(_0x1ea1ca){zipdir(path[_0x307c('0x20')](_0x35b5de,_0x283a40),{'saveTo':path[_0x307c('0x20')](_0x35b5de,util['format'](_0x307c('0x25'),_0x283a40,_0x307c('0x27')))},function(_0xccc3f3,_0x1ae1d7){rimraf(path[_0x307c('0x20')](_0x35b5de,_0x283a40),function(){});_0x1ea1ca(_0x307c('0x28'));});});}})['then'](function(){logger[_0x307c('0xa')](util[_0x307c('0x11')](_0x307c('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x307c('0x2a'),_0xe2c003?util['format'](_0x307c('0x25'),_0x283a40,_0xe2c003?_0x307c('0x27'):'xlsx'):null);});})[_0x307c('0x2b')](function(_0x27ac74){logger[_0x307c('0xa')](util[_0x307c('0x11')](_0x307c('0x2c'),EXTRACTED_REPORT_ID,_0x307c('0xc')),util['inspect'](_0x27ac74,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x307c('0x2d'));})['finally'](function(){process[_0x307c('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3a3a=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','dirname','.xlsx','join','mkdirSync','each','then','%s.%s','xlsx','binary','zip','zip\x20finished','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx'];(function(_0x5b1bff,_0xa6b103){var _0x209dd3=function(_0x313848){while(--_0x313848){_0x5b1bff['push'](_0x5b1bff['shift']());}};_0x209dd3(++_0xa6b103);}(_0x3a3a,0xef));var _0xa3a3=function(_0x50c34d,_0x879a7a){_0x50c34d=_0x50c34d-0x0;var _0x9bb41=_0x3a3a[_0x50c34d];return _0x9bb41;};'use strict';var util=require(_0xa3a3('0x0'));var path=require(_0xa3a3('0x1'));var _=require(_0xa3a3('0x2'));var fs=require('fs');var json2xls=require(_0xa3a3('0x3'));var BPromise=require(_0xa3a3('0x4'));var zipdir=require(_0xa3a3('0x5'));var rimraf=require(_0xa3a3('0x6'));var db=require(_0xa3a3('0x7'))['db'];var dbH=require('../../mysqldb')[_0xa3a3('0x8')];var logger=require(_0xa3a3('0x9'))(_0xa3a3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa3a3('0xb')][0x2]);var QUERY=process[_0xa3a3('0xb')][0x3];var PATH=process[_0xa3a3('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4838c7,_0x1156b3){var _0x436949={'status':_0x4838c7};var _0x5505d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1156b3){_0x436949[_0xa3a3('0xc')]=_0x1156b3;}return db['AnalyticExtractedReport'][_0xa3a3('0xd')](_0x436949,_0x5505d2);}function main(){var _0x10dd28=0x1388;var _0x244384;logger[_0xa3a3('0xe')](util[_0xa3a3('0xf')](_0xa3a3('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xa3a3('0x11')][_0xa3a3('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa3a3('0x13'),_0xa3a3('0x14')]})['then'](function(_0xc39a13){if(_0xc39a13){_0x244384=_0xc39a13;_0x10dd28=_0x244384[_0xa3a3('0x14')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0xa3a3('0x15')](util[_0xa3a3('0xf')](_0xa3a3('0x16'),QUERY),{'type':dbH['sequelize'][_0xa3a3('0x17')]['SELECT']});})['then'](function(_0x3ba919){if(!_0x3ba919[0x0][_0xa3a3('0x18')]){return analyticExtractedReport(_0xa3a3('0x19'));}var _0x59992a=[];var _0x1c8cbc=0x0;if(_0x244384[_0xa3a3('0x13')]){if(_0x3ba919&&_0x3ba919[_0xa3a3('0x1a')]){var _0x269367=_[_0xa3a3('0x1b')](_0x3ba919[0x0][_0xa3a3('0x18')]/_0x10dd28);var _0x528afb=Number['isInteger'](_0x3ba919[0x0]['num']/_0x10dd28)?_0x3ba919[0x0][_0xa3a3('0x18')]%_0x10dd28:0x0;_0x269367[_0xa3a3('0x1c')](function(_0x3f4cea){if(_0x3f4cea>0x0){_0x1c8cbc+=_0x10dd28;}_0x59992a[_0xa3a3('0x1d')](dbH['sequelize'][_0xa3a3('0x15')](util[_0xa3a3('0xf')](_0xa3a3('0x1e'),QUERY,_0x10dd28,_0x1c8cbc),{'type':dbH[_0xa3a3('0x1f')][_0xa3a3('0x17')][_0xa3a3('0x20')]}));});if(_0x528afb>0x0){_0x1c8cbc+=_0x10dd28;_0x59992a[_0xa3a3('0x1d')](dbH['sequelize'][_0xa3a3('0x15')](util[_0xa3a3('0xf')](_0xa3a3('0x1e'),QUERY,_0x528afb,_0x1c8cbc),{'type':dbH[_0xa3a3('0x1f')]['QueryTypes'][_0xa3a3('0x20')]}));}}}else{_0x59992a[_0xa3a3('0x1d')](dbH[_0xa3a3('0x1f')][_0xa3a3('0x15')](QUERY,{'type':dbH[_0xa3a3('0x1f')][_0xa3a3('0x17')][_0xa3a3('0x20')]}));}var _0x39ce2b=path[_0xa3a3('0x21')](PATH);var _0x35c8ee=path['basename'](PATH,_0xa3a3('0x22'));var _0x356e07=_0x244384['split']&&_0x59992a[_0xa3a3('0x1a')]>0x1;var _0x13fef5=[];if(!fs['existsSync'](path[_0xa3a3('0x23')](_0x39ce2b,_0x35c8ee))&&_0x356e07){fs[_0xa3a3('0x24')](path[_0xa3a3('0x23')](_0x39ce2b,_0x35c8ee));}return BPromise[_0xa3a3('0x25')](_0x59992a,function(_0x17dcd9){_0x13fef5[_0xa3a3('0x1d')](_0x17dcd9);})[_0xa3a3('0x26')](function(){for(var _0x179522=0x0;_0x179522<_0x13fef5[_0xa3a3('0x1a')];_0x179522+=0x1){var _0x32bfc5;var _0x1de240=_0x13fef5[_0x179522];if(_0x356e07){_0x32bfc5=path['join'](_0x39ce2b,_0x35c8ee,util[_0xa3a3('0xf')]('%s%d.%s',_0x35c8ee,_0x179522,'xlsx'));}else{_0x32bfc5=path[_0xa3a3('0x23')](_0x39ce2b,util['format'](_0xa3a3('0x27'),_0x35c8ee,_0xa3a3('0x28')));}fs['writeFileSync'](_0x32bfc5,json2xls(_0x1de240),_0xa3a3('0x29'));}})[_0xa3a3('0x26')](function(){if(_0x356e07){return new Promise(function(_0x43b929){zipdir(path['join'](_0x39ce2b,_0x35c8ee),{'saveTo':path[_0xa3a3('0x23')](_0x39ce2b,util['format'](_0xa3a3('0x27'),_0x35c8ee,_0xa3a3('0x2a')))},function(_0x2bd030,_0x4767d2){rimraf(path['join'](_0x39ce2b,_0x35c8ee),function(){});_0x43b929(_0xa3a3('0x2b'));});});}})['then'](function(){logger[_0xa3a3('0xe')](util[_0xa3a3('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa3a3('0x2c')));return analyticExtractedReport(_0xa3a3('0x2d'),_0x356e07?util['format'](_0xa3a3('0x27'),_0x35c8ee,_0x356e07?_0xa3a3('0x2a'):'xlsx'):null);});})[_0xa3a3('0x2e')](function(_0x1443cb){logger[_0xa3a3('0xe')](util[_0xa3a3('0xf')](_0xa3a3('0x2f'),EXTRACTED_REPORT_ID,_0xa3a3('0x2c')),util[_0xa3a3('0x30')](_0x1443cb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa3a3('0x31'));})[_0xa3a3('0x32')](function(){process[_0xa3a3('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4dd20f5..16bee5f 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 _0x68a6=['Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','Set','format','context','VoiceExtensionId','type','outbound','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','error','lodash','util','models'];(function(_0x1ac7da,_0x3a2aa1){var _0x5a94c7=function(_0x3580ed){while(--_0x3580ed){_0x1ac7da['push'](_0x1ac7da['shift']());}};_0x5a94c7(++_0x3a2aa1);}(_0x68a6,0x105));var _0x668a=function(_0x21f563,_0x59581){_0x21f563=_0x21f563-0x0;var _0x584ba0=_0x68a6[_0x21f563];return _0x584ba0;};'use strict';var _=require(_0x668a('0x0'));var util=require(_0x668a('0x1'));function rewrite(_0xa503a7,_0x190b24){var _0x2f18e9=this;return _0xa503a7[_0x668a('0x2')][_0x668a('0x3')][_0x668a('0x4')]({'raw':!![]})[_0x668a('0x5')](function(_0x39889e){_0x2f18e9[_0x668a('0x6')]=_0x39889e;return _0xa503a7[_0x668a('0x2')][_0x668a('0x7')]['findAll']({'where':{'IntervalId':_0x190b24[_0x668a('0x8')]},'raw':!![]});})[_0x668a('0x5')](function(_0x591767){return _0xa503a7[_0x668a('0x2')][_0x668a('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x668a('0x9')](_[_0x668a('0xa')](_0x591767,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x668a('0x5')](function(_0x26a52e){var _0x5027c8=_[_0x668a('0xb')](_0x26a52e,{'priority':'1'});var _0x33e6a4=_[_0x668a('0xb')](_0x26a52e,{'isApp':0x1});var _0x1bde29=_[_0x668a('0xc')](_0x33e6a4,_0x668a('0xd'));var _0x475b62=[_0x668a('0xe'),_0x668a('0xf')];var _0x172796=[];var _0x342fe1=[];for(var _0xc7c95d in _0x1bde29){if(_0x1bde29[_0x668a('0x10')](_0xc7c95d)){_0x2f18e9[_0x668a('0x11')]=0x2;_0x2f18e9['extensions']=[];_0x2f18e9[_0x668a('0x12')]=_[_0x668a('0x13')](_0x5027c8,{'exten':_0x1bde29[_0xc7c95d][0x0]['exten']});_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0]['type'],'app':_0x668a('0x16'),'appdata':util[_0x668a('0x17')]('CDR(type)=%s',_0x1bde29[_0xc7c95d][0x0]['type']),'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});if(_0x1bde29[_0xc7c95d][0x0]['type']==='inbound'){_0x2f18e9[_0x668a('0x14')]['push']({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':'CDR(routeid)='+_0x1bde29[_0xc7c95d][0x0]['VoiceExtensionId'],'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});}else if(_0x1bde29[_0xc7c95d][0x0]['type']===_0x668a('0x1b')){if(_0x2f18e9[_0x668a('0x12')]){_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':_0x668a('0x1c')+(_0x2f18e9[_0x668a('0x12')][_0x668a('0x1d')]?_0x668a('0x1e')+_0x2f18e9['extension']['cutdigits']+'}':'${EXTEN}'),'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0]['exten'],'priority':_0x2f18e9['priority']++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});}_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'Set','appdata':'CDR(routeid)='+_0x1bde29[_0xc7c95d][0x0]['VoiceExtensionId'],'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0]['VoiceExtensionId']});var _0x17f6e9=_0x2f18e9['priority']++;_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'ExecIf','appdata':_0x668a('0x1f')+(_0x17f6e9+0x2)+_0x668a('0x20')+(_0x17f6e9+0x1)+')','context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0]['exten'],'priority':_0x17f6e9,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});if(_0x2f18e9[_0x668a('0x12')]){_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':_0x2f18e9[_0x668a('0x12')][_0x668a('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x2f18e9['extension'][_0x668a('0x1d')]+'}':_0x668a('0x21'),'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9['priority']++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0]['VoiceExtensionId']});}_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'Set','appdata':_0x668a('0x22')+_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')],'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9['priority']++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});if(_0x2f18e9[_0x668a('0x12')]&&_0x2f18e9[_0x668a('0x12')][_0x668a('0x10')](_0x668a('0x23'))&&_0x2f18e9['extension'][_0x668a('0x23')]!==_0x668a('0x24')){_0x2f18e9['extensions'][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'Set','appdata':_0x668a('0x25')+_0x2f18e9[_0x668a('0x12')]['recordingFormat']||'wav','context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0]['exten'],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0]['VoiceExtensionId']});}}_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':_0x668a('0x26'),'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0]['exten'],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});_0x2f18e9[_0x668a('0x14')][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});_0x2f18e9['extensions']['push']({'type':_0x1bde29[_0xc7c95d][0x0]['type'],'app':_0x668a('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'priority':_0x2f18e9[_0x668a('0x11')]++,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});for(var _0x4f2932=0x0,_0x4a5727=0x0;_0x4f2932<_0x1bde29[_0xc7c95d][_0x668a('0x27')];_0x4f2932+=0x1,_0x4a5727=0x0){var _0x2207f7=_0x1bde29[_0xc7c95d][_0x4f2932];if(_0x2207f7[_0x668a('0x1a')]){_0x2207f7['type']=_0x2207f7['type'][_0x668a('0x28')]();}var _0x130369=[];var _0x4ecd48=[];delete _0x2207f7['id'];delete _0x2207f7[_0x668a('0x29')];delete _0x2207f7[_0x668a('0x2a')];var _0x5a16b1=_0x2207f7[_0x668a('0x2b')]!==_0x668a('0x2c')?[_0x2207f7[_0x668a('0x2b')]]:_0x2207f7[_0x668a('0x8')]?_[_0x668a('0xa')](_[_0x668a('0xb')](_0x2f18e9[_0x668a('0x6')],{'IntervalId':_0x2207f7[_0x668a('0x8')]}),_0x668a('0x2b')):[];if(_0x2207f7[_0x668a('0x10')]('tag')){if(_0x2207f7[_0x668a('0x2d')]&&_0x2207f7[_0x668a('0x2d')]!=='--'){_0x130369[_0x668a('0x15')]({'type':_0x2207f7[_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':_0x668a('0x2e')+_0x2207f7['tag'],'context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1['length']+_0x2f18e9[_0x668a('0x11')]+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});}}if(_0x2207f7[_0x668a('0x1a')]==='outbound'&&_0x2207f7[_0x668a('0x10')](_0x668a('0x2f'))){if(_0x2207f7[_0x668a('0x2f')]){_0x130369[_0x668a('0x15')]({'type':_0x2207f7['type'],'app':_0x668a('0x30'),'appdata':_0x668a('0x31')+_0x2207f7[_0x668a('0x2f')]+')','context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1[_0x668a('0x27')]+_0x2f18e9['priority']+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});}else{_0x130369[_0x668a('0x15')]({'type':_0x2207f7[_0x668a('0x1a')],'app':_0x668a('0x30'),'appdata':_0x668a('0x32'),'context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1[_0x668a('0x27')]+_0x2f18e9['priority']+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});}}if(_0x2207f7[_0x668a('0x10')](_0x668a('0x33'))){if(_0x475b62['indexOf'](_0x2207f7[_0x668a('0x34')][_0x668a('0x28')]())>=0x0&&_0x2207f7[_0x668a('0x35')]!==_0x668a('0x36')){if(_0x2207f7[_0x668a('0x33')]){_0x130369[_0x668a('0x15')]({'type':_0x2207f7[_0x668a('0x1a')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1[_0x668a('0x27')]+_0x2f18e9[_0x668a('0x11')]+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});_0x130369['push']({'type':_0x2207f7[_0x668a('0x1a')],'app':_0x668a('0x16'),'appdata':_0x668a('0x37'),'context':_0x2207f7['context'],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1[_0x668a('0x27')]+_0x2f18e9[_0x668a('0x11')]+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});}else{_0x130369[_0x668a('0x15')]({'type':_0x2207f7['type'],'app':_0x668a('0x30'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7['exten'],'priority':_0x5a16b1['length']+_0x2f18e9[_0x668a('0x11')]+_0x4a5727++,'VoiceExtensionId':_0x2207f7['VoiceExtensionId']});_0x130369['push']({'type':_0x2207f7[_0x668a('0x1a')],'app':'Set','appdata':_0x668a('0x38'),'context':_0x2207f7[_0x668a('0x18')],'exten':_0x2207f7[_0x668a('0xd')],'priority':_0x5a16b1['length']+_0x2f18e9[_0x668a('0x11')]+_0x4a5727++,'VoiceExtensionId':_0x2207f7[_0x668a('0x19')]});}}}for(var _0x36bc42=0x0;_0x36bc42<_0x5a16b1[_0x668a('0x27')];_0x36bc42+=0x1){var _0x57d2d2=_0x2f18e9[_0x668a('0x11')]+_0x5a16b1[_0x668a('0x27')];var _0xce3316=_0x36bc42===_0x5a16b1[_0x668a('0x27')]-0x1?_0x2f18e9[_0x668a('0x11')]+_0x130369[_0x668a('0x27')]+_0x4ecd48[_0x668a('0x27')]+0x2:_0x2f18e9[_0x668a('0x11')]+_0x36bc42+0x1;_0x130369[_0x668a('0x39')](_0x36bc42,0x0,{'type':_0x2207f7[_0x668a('0x1a')],'app':'GotoIfTime','appdata':_0x5a16b1[_0x36bc42]+'?'+_0x2207f7[_0x668a('0x18')]+_0x668a('0x3a')+_0x57d2d2+':'+_0x2207f7[_0x668a('0x18')]+_0x668a('0x3a')+_0xce3316,'exten':_0x2207f7[_0x668a('0xd')],'context':_0x2207f7[_0x668a('0x18')],'priority':_0x2f18e9[_0x668a('0x11')]+_0x36bc42,'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});}_0x2207f7[_0x668a('0x11')]=_0x130369['length']?_[_0x668a('0x3b')](_0x130369)[_0x668a('0x11')]+0x1:_0x2f18e9['priority'];_0x2f18e9[_0x668a('0x11')]=(_0x4ecd48[_0x668a('0x27')]?_[_0x668a('0x3b')](_0x4ecd48)[_0x668a('0x11')]:_0x2207f7[_0x668a('0x11')])+0x1;_0x2f18e9['extensions']=_[_0x668a('0x3c')](_0x2f18e9[_0x668a('0x14')],_0x130369,[_0x2207f7],_0x4ecd48);}_0x2f18e9['extensions'][_0x668a('0x15')]({'type':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x1a')],'app':'Hangup','exten':_0x1bde29[_0xc7c95d][0x0][_0x668a('0xd')],'context':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x18')],'priority':_0x2f18e9[_0x668a('0x11')],'VoiceExtensionId':_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]});_0x172796[_0x668a('0x15')](_0x1bde29[_0xc7c95d][0x0][_0x668a('0x19')]);_0x342fe1=_['concat'](_0x342fe1,_0x2f18e9[_0x668a('0x14')]);}}return _0xa503a7[_0x668a('0x3d')](function(_0x3a90ea){return _0xa503a7[_0x668a('0x2')]['VoiceExtension'][_0x668a('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x172796}},'transaction':_0x3a90ea})[_0x668a('0x5')](function(_0x51481e){return _0xa503a7[_0x668a('0x2')]['VoiceExtension'][_0x668a('0x3f')](_[_0x668a('0x40')](_0x342fe1,_0x668a('0x11')),{'transaction':_0x3a90ea});});});})['catch'](function(_0xab0488){console[_0x668a('0x41')](_0xab0488);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xde98=['extension','find','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','push','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${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=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','filter','queue','playback','hasOwnProperty','priority','extensions'];(function(_0x303e7f,_0x2d4b00){var _0x405aab=function(_0x5f5d0f){while(--_0x5f5d0f){_0x303e7f['push'](_0x303e7f['shift']());}};_0x405aab(++_0x2d4b00);}(_0xde98,0x7f));var _0x8de9=function(_0x5b47bc,_0x5d91ec){_0x5b47bc=_0x5b47bc-0x0;var _0x2c69f5=_0xde98[_0x5b47bc];return _0x2c69f5;};'use strict';var _=require(_0x8de9('0x0'));var util=require(_0x8de9('0x1'));function rewrite(_0x3ede91,_0x5b8116){var _0x278477=this;return _0x3ede91[_0x8de9('0x2')][_0x8de9('0x3')][_0x8de9('0x4')]({'raw':!![]})[_0x8de9('0x5')](function(_0x250949){_0x278477[_0x8de9('0x6')]=_0x250949;return _0x3ede91[_0x8de9('0x2')][_0x8de9('0x7')][_0x8de9('0x4')]({'where':{'IntervalId':_0x5b8116[_0x8de9('0x8')]},'raw':!![]});})['then'](function(_0x1dee2e){return _0x3ede91['models'][_0x8de9('0x7')][_0x8de9('0x4')]({'where':{'exten':{'$in':_[_0x8de9('0x9')](_['map'](_0x1dee2e,_0x8de9('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x393cd6){var _0x194908=_[_0x8de9('0xb')](_0x393cd6,{'priority':'1'});var _0x3d2805=_[_0x8de9('0xb')](_0x393cd6,{'isApp':0x1});var _0x1fffe0=_['groupBy'](_0x3d2805,_0x8de9('0xa'));var _0x52218c=[_0x8de9('0xc'),_0x8de9('0xd')];var _0x535268=[];var _0x1cae1a=[];for(var _0x2bebb1 in _0x1fffe0){if(_0x1fffe0[_0x8de9('0xe')](_0x2bebb1)){_0x278477[_0x8de9('0xf')]=0x2;_0x278477[_0x8de9('0x10')]=[];_0x278477[_0x8de9('0x11')]=_[_0x8de9('0x12')](_0x194908,{'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')]});_0x278477['extensions']['push']({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':util[_0x8de9('0x15')](_0x8de9('0x16'),_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')]),'context':_0x1fffe0[_0x2bebb1][0x0]['context'],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477['priority']++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});if(_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')]===_0x8de9('0x18')){_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0]['type'],'app':'Set','appdata':_0x8de9('0x1a')+_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')],'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0]['exten'],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0]['VoiceExtensionId']});}else if(_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')]===_0x8de9('0x1c')){if(_0x278477[_0x8de9('0x11')]){_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0]['type'],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x1d')+(_0x278477[_0x8de9('0x11')][_0x8de9('0x1e')]?'${EXTEN:'+_0x278477[_0x8de9('0x11')][_0x8de9('0x1e')]+'}':_0x8de9('0x1f')),'context':_0x1fffe0[_0x2bebb1][0x0]['context'],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477['priority']++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});}_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x1a')+_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')],'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477['priority']++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});var _0x5dcda7=_0x278477['priority']++;_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x20'),'appdata':_0x8de9('0x21')+(_0x5dcda7+0x2)+_0x8de9('0x22')+(_0x5dcda7+0x1)+')','context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x5dcda7,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0]['VoiceExtensionId']});if(_0x278477[_0x8de9('0x11')]){_0x278477[_0x8de9('0x10')]['push']({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':'Set','appdata':_0x278477[_0x8de9('0x11')]['cutdigits']?_0x8de9('0x23')+_0x278477[_0x8de9('0x11')][_0x8de9('0x1e')]+'}':_0x8de9('0x24'),'context':_0x1fffe0[_0x2bebb1][0x0]['context'],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477['priority']++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});}_0x278477[_0x8de9('0x10')]['push']({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x25')+_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')],'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0]['exten'],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});if(_0x278477[_0x8de9('0x11')]&&_0x278477['extension']['hasOwnProperty'](_0x8de9('0x26'))&&_0x278477[_0x8de9('0x11')][_0x8de9('0x26')]!==_0x8de9('0x27')){_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x28'),'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});_0x278477['extensions'][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x29')+_0x278477['extension']['recordingFormat']||'wav','context':_0x1fffe0[_0x2bebb1][0x0]['context'],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});}}_0x278477['extensions'][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477['priority']++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0]['type'],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x2a'),'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x2b'),'context':_0x1fffe0[_0x2bebb1][0x0]['context'],'exten':_0x1fffe0[_0x2bebb1][0x0]['exten'],'priority':_0x278477[_0x8de9('0xf')]++,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});for(var _0x59e912=0x0,_0x35bb3c=0x0;_0x59e912<_0x1fffe0[_0x2bebb1][_0x8de9('0x2c')];_0x59e912+=0x1,_0x35bb3c=0x0){var _0x3bccf3=_0x1fffe0[_0x2bebb1][_0x59e912];if(_0x3bccf3[_0x8de9('0x13')]){_0x3bccf3[_0x8de9('0x13')]=_0x3bccf3[_0x8de9('0x13')][_0x8de9('0x2d')]();}var _0x112903=[];var _0x6d6e7b=[];delete _0x3bccf3['id'];delete _0x3bccf3[_0x8de9('0x2e')];delete _0x3bccf3[_0x8de9('0x2f')];var _0x105908=_0x3bccf3[_0x8de9('0x30')]!==_0x8de9('0x31')?[_0x3bccf3[_0x8de9('0x30')]]:_0x3bccf3[_0x8de9('0x8')]?_[_0x8de9('0x32')](_[_0x8de9('0xb')](_0x278477[_0x8de9('0x6')],{'IntervalId':_0x3bccf3[_0x8de9('0x8')]}),_0x8de9('0x30')):[];if(_0x3bccf3[_0x8de9('0xe')](_0x8de9('0x33'))){if(_0x3bccf3[_0x8de9('0x33')]&&_0x3bccf3[_0x8de9('0x33')]!=='--'){_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3[_0x8de9('0x13')],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x34')+_0x3bccf3[_0x8de9('0x33')],'context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3['exten'],'priority':_0x105908['length']+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3['VoiceExtensionId']});}}if(_0x3bccf3[_0x8de9('0x13')]===_0x8de9('0x1c')&&_0x3bccf3['hasOwnProperty']('callerID')){if(_0x3bccf3[_0x8de9('0x35')]){_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3['type'],'app':'ExecIf','appdata':_0x8de9('0x36')+_0x3bccf3[_0x8de9('0x35')]+')','context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3[_0x8de9('0xa')],'priority':_0x105908[_0x8de9('0x2c')]+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});}else{_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3[_0x8de9('0x13')],'app':_0x8de9('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3[_0x8de9('0xa')],'priority':_0x105908[_0x8de9('0x2c')]+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});}}if(_0x3bccf3[_0x8de9('0xe')]('answer')){if(_0x52218c[_0x8de9('0x37')](_0x3bccf3[_0x8de9('0x38')][_0x8de9('0x2d')]())>=0x0&&_0x3bccf3['appType']!==_0x8de9('0x39')){if(_0x3bccf3[_0x8de9('0x3a')]){_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3[_0x8de9('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3[_0x8de9('0xa')],'priority':_0x105908[_0x8de9('0x2c')]+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3['type'],'app':_0x8de9('0x14'),'appdata':_0x8de9('0x3b'),'context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3['exten'],'priority':_0x105908[_0x8de9('0x2c')]+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});}else{_0x112903['push']({'type':_0x3bccf3[_0x8de9('0x13')],'app':_0x8de9('0x20'),'appdata':_0x8de9('0x3c'),'context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3['exten'],'priority':_0x105908['length']+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});_0x112903[_0x8de9('0x19')]({'type':_0x3bccf3[_0x8de9('0x13')],'app':'Set','appdata':_0x8de9('0x3d'),'context':_0x3bccf3[_0x8de9('0x1b')],'exten':_0x3bccf3['exten'],'priority':_0x105908[_0x8de9('0x2c')]+_0x278477[_0x8de9('0xf')]+_0x35bb3c++,'VoiceExtensionId':_0x3bccf3[_0x8de9('0x17')]});}}}for(var _0xa6278d=0x0;_0xa6278d<_0x105908['length'];_0xa6278d+=0x1){var _0x147dba=_0x278477[_0x8de9('0xf')]+_0x105908[_0x8de9('0x2c')];var _0x5bbdb2=_0xa6278d===_0x105908['length']-0x1?_0x278477['priority']+_0x112903[_0x8de9('0x2c')]+_0x6d6e7b[_0x8de9('0x2c')]+0x2:_0x278477[_0x8de9('0xf')]+_0xa6278d+0x1;_0x112903['splice'](_0xa6278d,0x0,{'type':_0x3bccf3[_0x8de9('0x13')],'app':_0x8de9('0x3e'),'appdata':_0x105908[_0xa6278d]+'?'+_0x3bccf3[_0x8de9('0x1b')]+_0x8de9('0x3f')+_0x147dba+':'+_0x3bccf3[_0x8de9('0x1b')]+_0x8de9('0x3f')+_0x5bbdb2,'exten':_0x3bccf3[_0x8de9('0xa')],'context':_0x3bccf3[_0x8de9('0x1b')],'priority':_0x278477['priority']+_0xa6278d,'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});}_0x3bccf3[_0x8de9('0xf')]=_0x112903[_0x8de9('0x2c')]?_[_0x8de9('0x40')](_0x112903)['priority']+0x1:_0x278477[_0x8de9('0xf')];_0x278477[_0x8de9('0xf')]=(_0x6d6e7b[_0x8de9('0x2c')]?_[_0x8de9('0x40')](_0x6d6e7b)[_0x8de9('0xf')]:_0x3bccf3[_0x8de9('0xf')])+0x1;_0x278477['extensions']=_['concat'](_0x278477[_0x8de9('0x10')],_0x112903,[_0x3bccf3],_0x6d6e7b);}_0x278477[_0x8de9('0x10')][_0x8de9('0x19')]({'type':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x13')],'app':_0x8de9('0x41'),'exten':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0xa')],'context':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x1b')],'priority':_0x278477[_0x8de9('0xf')],'VoiceExtensionId':_0x1fffe0[_0x2bebb1][0x0][_0x8de9('0x17')]});_0x535268['push'](_0x1fffe0[_0x2bebb1][0x0]['VoiceExtensionId']);_0x1cae1a=_[_0x8de9('0x42')](_0x1cae1a,_0x278477[_0x8de9('0x10')]);}}return _0x3ede91['transaction'](function(_0x2a5ed4){return _0x3ede91[_0x8de9('0x2')][_0x8de9('0x7')][_0x8de9('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x535268}},'transaction':_0x2a5ed4})[_0x8de9('0x5')](function(_0x46b5c3){return _0x3ede91[_0x8de9('0x2')][_0x8de9('0x7')][_0x8de9('0x44')](_[_0x8de9('0x45')](_0x1cae1a,_0x8de9('0xf')),{'transaction':_0x2a5ed4});});});})['catch'](function(_0x4674f9){console[_0x8de9('0x46')](_0x4674f9);});}exports[_0x8de9('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 163fba7..9e0257b 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 _0xdd83=['birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','duplicate','CmContact','create','keys','then','push','catch','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','field','NOW()','scheduledAt','toString','from','ListId\x20=\x20?','where','phone\x20NOT\x20IN\x20(?)','select','into','cm_contacts','deletedAt\x20IS\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','VoiceQueue','BlackLists','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','resolve','parse','pause','info','CSV\x20parse\x20error','util','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','test','isNil','errors','map','message','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid'];(function(_0x1dd8f6,_0x3ea487){var _0xf083b7=function(_0x237d1d){while(--_0x237d1d){_0x1dd8f6['push'](_0x1dd8f6['shift']());}};_0xf083b7(++_0x3ea487);}(_0xdd83,0x10c));var _0x3dd8=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xdd83[_0x4ff09b];return _0x3f5c2e;};'use strict';var BPromise=require('bluebird');var util=require(_0x3dd8('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x3dd8('0x1'));var Redis=require(_0x3dd8('0x2'));var db=require(_0x3dd8('0x3'))['db'];var config=require(_0x3dd8('0x4'));var logger=require(_0x3dd8('0x5'))(_0x3dd8('0x6'));config[_0x3dd8('0x7')]=_['defaults'](config[_0x3dd8('0x7')],{'host':_0x3dd8('0x8'),'port':0x18eb});var socket=require(_0x3dd8('0x9'))(new Redis(config[_0x3dd8('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x3dd8('0xa')](socket);try{if(!process[_0x3dd8('0xb')][0x2]||process[_0x3dd8('0xb')][0x2]==='undefined'||process[_0x3dd8('0xb')][0x2]===_0x3dd8('0xc')){throw new Error(_0x3dd8('0xd'));}var FILEPATH=process[_0x3dd8('0xb')][0x2];if(!process['argv'][0x3]||process[_0x3dd8('0xb')][0x3]==='undefined'||process['argv'][0x3]===_0x3dd8('0xc')||!process[_0x3dd8('0xb')][0x4]||process[_0x3dd8('0xb')][0x4]===_0x3dd8('0xe')||process[_0x3dd8('0xb')][0x4]===_0x3dd8('0xc')){throw new Error(_0x3dd8('0xf'));}var FIELDS=_[_0x3dd8('0x10')](process[_0x3dd8('0xb')][0x3][_0x3dd8('0x11')](','),process[_0x3dd8('0xb')][0x4][_0x3dd8('0x11')](','));if(!process[_0x3dd8('0xb')][0x5]||process[_0x3dd8('0xb')][0x5]==='undefined'||process['argv'][0x5]===_0x3dd8('0xc')){throw new Error(_0x3dd8('0x12'));}var LISTID=process[_0x3dd8('0xb')][0x5];var COMPANYID=process[_0x3dd8('0xb')][0x6]&&process[_0x3dd8('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x3dd8('0xb')][0x7]&&process[_0x3dd8('0xb')][0x7]!==_0x3dd8('0xe')&&process['argv'][0x7]!==_0x3dd8('0xc')?process[_0x3dd8('0xb')][0x7]:null;if(!process[_0x3dd8('0xb')][0x8]||process[_0x3dd8('0xb')][0x8]===_0x3dd8('0xe')||process[_0x3dd8('0xb')][0x8]==='null'){throw new Error(_0x3dd8('0x13'));}var SOCKET_TIMESTAMP=process[_0x3dd8('0xb')][0x8];}catch(_0x13ea88){logger['error'](_0x13ea88);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(_0x8d3e81,_0x12c495,_0x3d45e1,_0x2dc8c1){var _0x2f7c33={'message':_0x12c495};_0x2f7c33[_0x8d3e81]=!![];if(_0x3d45e1){_0x2f7c33['contact']=_0x3d45e1;}if(_0x2dc8c1){_0x2f7c33['index']=_0x2dc8c1;}return _0x2f7c33;}function isEmail(_0x484014){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))*$/[_0x3dd8('0x14')](_0x484014);}function checkRow(_0x380a3d,_0x3de778,_0x39e166){return new BPromise(function(_0xfa3137,_0x34a0bd){if(_[_0x3dd8('0x15')](_0x380a3d)){return _0x34a0bd(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x39e166));}if(_0x380a3d['errors']&&_0x380a3d[_0x3dd8('0x16')]['length']){var _0x2fd22c=_[_0x3dd8('0x17')](_0x380a3d[_0x3dd8('0x16')],_0x3dd8('0x18'))[_0x3dd8('0x19')](';');return _0x34a0bd(handleCheckRowError(_0x3dd8('0x1a'),_0x2fd22c,null,_0x39e166));}var _0x569191={};for(var _0x245a2b in FIELDS){if(FIELDS[_0x3dd8('0x1b')](_0x245a2b)&&FIELDS[_0x245a2b]){_0x569191[_0x245a2b]=_0x380a3d[_0x3dd8('0x1c')][0x0][FIELDS[_0x245a2b]]||_0x380a3d[_0x3dd8('0x1c')][0x0]['\ufeff'+FIELDS[_0x245a2b]];}}if(!_0x569191[_0x3dd8('0x1d')]){return _0x34a0bd(handleCheckRowError(_0x3dd8('0x1a'),_0x3dd8('0x1e'),null,_0x39e166));}if(!_0x569191[_0x3dd8('0x1f')]){return _0x34a0bd(handleCheckRowError(_0x3dd8('0x1a'),'phone\x20not\x20specified!',null,_0x39e166));}if(_0x569191[_0x3dd8('0x20')]){var _0x17a83e=moment(_0x569191[_0x3dd8('0x20')],_0x3dd8('0x21'));if(!_0x17a83e[_0x3dd8('0x22')]()){return _0x34a0bd(handleCheckRowError(_0x3dd8('0x1a'),_0x3dd8('0x23'),null,_0x39e166));}}if(_0x569191[_0x3dd8('0x24')]){if(!isEmail(_0x569191[_0x3dd8('0x24')])){return _0x34a0bd(handleCheckRowError(_0x3dd8('0x1a'),'email\x20format\x20is\x20not\x20valid!',null,_0x39e166));}}_0x569191[_0x3dd8('0x25')]=LISTID;_0x569191[_0x3dd8('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3dd8('0x27')]&&_0x3de778){var _0x23ada3={};for(var _0x2ab619=0x0,_0x9b132a=DUPLICATES['length'];_0x2ab619<_0x9b132a;_0x2ab619+=0x1){_0x23ada3[DUPLICATES[_0x2ab619]]=_0x569191[DUPLICATES[_0x2ab619]];}var _0xf8fce6=_['find'](_0x3de778,_0x23ada3);if(_0xf8fce6){return _0x34a0bd(handleCheckRowError(_0x3dd8('0x28'),'Duplicate\x20Contact',_0xf8fce6,_0x39e166));}}return db[_0x3dd8('0x29')][_0x3dd8('0x2a')](_0x569191,{'raw':!![],'hooks':![],'fields':_[_0x3dd8('0x2b')](_0x569191)})[_0x3dd8('0x2c')](function(_0x3dbc1a){if(DUPLICATES&&DUPLICATES['length']&&_0x3de778){_0x3de778[_0x3dd8('0x2d')](_['pick'](_0x569191,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3dbc1a['id'];return _0xfa3137();})[_0x3dd8('0x2e')](function(_0x55fca3){return _0x34a0bd(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x55fca3['message']||JSON[_0x3dd8('0x2f')](_0x55fca3)),null,_0x39e166));});});}function checkHopper(){function _0x241275(){return function(_0x472e70){logger[_0x3dd8('0x1a')]('cmContact',_0x3dd8('0x30'),util[_0x3dd8('0x31')](_0x472e70,{'showHidden':![],'depth':null}));};}var _0x5cd88a=function(_0x1e15a6,_0x259563){var _0x317ab0=squel[_0x3dd8('0x32')]()['into'](_0x3dd8('0x33'))[_0x3dd8('0x34')]([_0x3dd8('0x1f'),'scheduledAt',_0x3dd8('0x35'),_0x3dd8('0x25'),_0x259563,_0x3dd8('0x36'),_0x3dd8('0x37')],squel['select']()[_0x3dd8('0x38')]('phone',_0x3dd8('0x1f'))[_0x3dd8('0x38')](_0x3dd8('0x39'),_0x3dd8('0x3a'))[_0x3dd8('0x38')]('id',_0x3dd8('0x35'))[_0x3dd8('0x38')](LISTID[_0x3dd8('0x3b')](),_0x3dd8('0x25'))['field'](_0x1e15a6['id'][_0x3dd8('0x3b')](),_0x259563)[_0x3dd8('0x38')](_0x3dd8('0x39'),'createdAt')['field'](_0x3dd8('0x39'),'updatedAt')[_0x3dd8('0x3c')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3dd8('0x3d'),LISTID[_0x3dd8('0x3b')]())[_0x3dd8('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x3dd8('0x3e')](_0x3dd8('0x3f'),squel[_0x3dd8('0x40')]()['field'](_0x3dd8('0x1f'))[_0x3dd8('0x3c')]('cm_hopper')[_0x3dd8('0x3e')](_0x259563+'\x20=\x20?',_0x1e15a6['id'][_0x3dd8('0x3b')]())))['toString']();return _0x317ab0;};var _0x54bf25=function(_0x46ea8a,_0x2446eb){var _0x30ffdf=squel['insert']()[_0x3dd8('0x41')](_0x3dd8('0x33'))[_0x3dd8('0x34')]([_0x3dd8('0x1f'),_0x3dd8('0x3a'),_0x3dd8('0x35'),_0x3dd8('0x25'),_0x2446eb,'createdAt',_0x3dd8('0x37')],squel[_0x3dd8('0x40')]()['field'](_0x3dd8('0x1f'),'phone')[_0x3dd8('0x38')]('NOW()',_0x3dd8('0x3a'))[_0x3dd8('0x38')]('id',_0x3dd8('0x35'))[_0x3dd8('0x38')](LISTID['toString'](),_0x3dd8('0x25'))[_0x3dd8('0x38')](_0x46ea8a['id']['toString'](),_0x2446eb)[_0x3dd8('0x38')]('NOW()',_0x3dd8('0x36'))[_0x3dd8('0x38')]('NOW()',_0x3dd8('0x37'))['from'](_0x3dd8('0x42'))['where'](_0x3dd8('0x43'))[_0x3dd8('0x3e')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x3dd8('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x3dd8('0x3f'),squel['select']()[_0x3dd8('0x38')](_0x3dd8('0x44'))['from'](_0x3dd8('0x45'))[_0x3dd8('0x3e')](_0x2446eb+_0x3dd8('0x46'),_0x46ea8a['id'][_0x3dd8('0x3b')]()))[_0x3dd8('0x3e')](_0x3dd8('0x3f'),squel[_0x3dd8('0x40')]()[_0x3dd8('0x38')]('phone')['from'](_0x3dd8('0x33'))['where'](_0x2446eb+_0x3dd8('0x46'),_0x46ea8a['id']['toString']())))[_0x3dd8('0x3b')]();return _0x30ffdf;};function _0x57d15b(_0x24d081,_0x28dc3d){var _0x51bf2d=squel[_0x3dd8('0x32')]()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x3dd8('0x35'),_0x3dd8('0x25'),_0x28dc3d,_0x3dd8('0x36'),_0x3dd8('0x37')],squel[_0x3dd8('0x40')]()[_0x3dd8('0x38')](_0x3dd8('0x1f'),_0x3dd8('0x1f'))[_0x3dd8('0x38')](_0x3dd8('0x39'),_0x3dd8('0x3a'))[_0x3dd8('0x38')]('id',_0x3dd8('0x35'))['field'](LISTID[_0x3dd8('0x3b')](),_0x3dd8('0x25'))[_0x3dd8('0x38')](_0x24d081['id'][_0x3dd8('0x3b')](),_0x28dc3d)[_0x3dd8('0x38')]('NOW()','createdAt')[_0x3dd8('0x38')](_0x3dd8('0x39'),_0x3dd8('0x37'))[_0x3dd8('0x3c')](_0x3dd8('0x42'))['where'](_0x3dd8('0x43'))['where'](_0x3dd8('0x3d'),LISTID[_0x3dd8('0x3b')]())[_0x3dd8('0x3e')](_0x3dd8('0x47'),squel[_0x3dd8('0x48')](hopperContacts))[_0x3dd8('0x3e')](_0x3dd8('0x49')))[_0x3dd8('0x3b')]();return _0x51bf2d;}function _0x44546a(_0x23641b,_0x3adf80){var _0x3c9862=squel['insert']()[_0x3dd8('0x41')]('cm_hopper_black')['fromQuery']([_0x3dd8('0x1f'),_0x3dd8('0x35'),_0x3dd8('0x25'),_0x3adf80,'createdAt',_0x3dd8('0x37')],squel['select']()['field'](_0x3dd8('0x1f'),'phone')['field']('id',_0x3dd8('0x35'))[_0x3dd8('0x38')](LISTID[_0x3dd8('0x3b')](),_0x3dd8('0x25'))['field'](_0x23641b['id']['toString'](),_0x3adf80)[_0x3dd8('0x38')](_0x3dd8('0x39'),_0x3dd8('0x36'))['field']('NOW()','updatedAt')[_0x3dd8('0x3c')](_0x3dd8('0x42'))[_0x3dd8('0x3e')](_0x3dd8('0x43'))[_0x3dd8('0x3e')]('ListId\x20=\x20?',LISTID[_0x3dd8('0x3b')]())[_0x3dd8('0x3e')](_0x3dd8('0x47'),squel[_0x3dd8('0x48')](hopperContacts))[_0x3dd8('0x3e')](_0x3dd8('0x49')))[_0x3dd8('0x3b')]();return _0x3c9862;}return db['VoiceQueue']['findAll']({'where':{'type':_0x3dd8('0x4a')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3dd8('0x4b')],'as':_0x3dd8('0x4c'),'where':{'id':LISTID}}]})[_0x3dd8('0x2c')](function(_0x48c9ad){var _0x59f7a5=[];if(_0x48c9ad){var _0xca0e63;for(var _0x1114bd=0x0,_0x472762;_0x1114bd<_0x48c9ad[_0x3dd8('0x27')];_0x1114bd+=0x1){_0x472762=_0x48c9ad[_0x1114bd][_0x3dd8('0x4d')]({'plain':!![]});switch(_0x472762[_0x3dd8('0x4e')]){case _0x3dd8('0x4f'):_0x59f7a5['push'](db[_0x3dd8('0x50')][_0x3dd8('0x51')](_0x54bf25(_0x472762,'VoiceQueueId'))[_0x3dd8('0x2c')](function(){})['catch'](_0x241275()));break;case _0x3dd8('0x52'):_0x59f7a5[_0x3dd8('0x2d')](db['sequelize'][_0x3dd8('0x51')](_0x5cd88a(_0x472762,_0x3dd8('0x53')))['then'](function(){})[_0x3dd8('0x2e')](_0x241275()));break;default:_0x59f7a5[_0x3dd8('0x2d')](db['sequelize'][_0x3dd8('0x51')](_0x57d15b(_0x472762,_0x3dd8('0x53')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));}}}return _0x59f7a5;})[_0x3dd8('0x54')]()['then'](function(){return db[_0x3dd8('0x55')]['findAll']({'where':{'type':_0x3dd8('0x4a')},'attributes':['id'],'include':[{'model':db[_0x3dd8('0x4b')],'as':_0x3dd8('0x56'),'where':{'id':LISTID}}]})[_0x3dd8('0x2c')](function(_0x1bc142){var _0x53274b=[];if(_0x1bc142){var _0x295878;for(var _0x122c22=0x0,_0x3a9443;_0x122c22<_0x1bc142[_0x3dd8('0x27')];_0x122c22+=0x1){_0x3a9443=_0x1bc142[_0x122c22][_0x3dd8('0x4d')]({'plain':!![]});_0x53274b['push'](db['sequelize'][_0x3dd8('0x51')](_0x44546a(_0x3a9443,_0x3dd8('0x53')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));}}return _0x53274b;})[_0x3dd8('0x54')]();})[_0x3dd8('0x2c')](function(){return db[_0x3dd8('0x57')][_0x3dd8('0x58')]({'attributes':['id',_0x3dd8('0x4e')],'include':[{'model':db[_0x3dd8('0x4b')],'as':_0x3dd8('0x4c'),'where':{'id':LISTID}}]})[_0x3dd8('0x2c')](function(_0x41f282){var _0x29b02f=[];if(_0x41f282){for(var _0x362e32=0x0,_0x4fbab7;_0x362e32<_0x41f282['length'];_0x362e32+=0x1){_0x4fbab7=_0x41f282[_0x362e32]['get']({'plain':!![]});switch(_0x4fbab7['dialCheckDuplicateType']){case'always':_0x29b02f[_0x3dd8('0x2d')](db['sequelize'][_0x3dd8('0x51')](_0x54bf25(_0x4fbab7,_0x3dd8('0x59')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));break;case _0x3dd8('0x52'):_0x29b02f['push'](db['sequelize'][_0x3dd8('0x51')](_0x5cd88a(_0x4fbab7,_0x3dd8('0x59')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));break;default:_0x29b02f[_0x3dd8('0x2d')](db[_0x3dd8('0x50')][_0x3dd8('0x51')](_0x57d15b(_0x4fbab7,_0x3dd8('0x59')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));}}}return _0x29b02f;})[_0x3dd8('0x54')]();})[_0x3dd8('0x2c')](function(){return db[_0x3dd8('0x57')][_0x3dd8('0x58')]({'attributes':['id'],'include':[{'model':db[_0x3dd8('0x4b')],'as':_0x3dd8('0x56'),'where':{'id':LISTID}}]})[_0x3dd8('0x2c')](function(_0x1e6014){var _0x2854dd=[];if(_0x1e6014){for(var _0x29dbbd=0x0,_0x5471a6;_0x29dbbd<_0x1e6014[_0x3dd8('0x27')];_0x29dbbd+=0x1){_0x5471a6=_0x1e6014[_0x29dbbd]['get']({'plain':!![]});_0x2854dd[_0x3dd8('0x2d')](db[_0x3dd8('0x50')][_0x3dd8('0x51')](_0x44546a(_0x5471a6,_0x3dd8('0x59')))[_0x3dd8('0x2c')](function(){})[_0x3dd8('0x2e')](_0x241275()));}}return _0x2854dd;})[_0x3dd8('0x54')]();})[_0x3dd8('0x2e')](function(_0x32784f){logger[_0x3dd8('0x1a')](_0x3dd8('0x5a'),'generalCheckHopper',_0x32784f[_0x3dd8('0x18')]);});}var processPromises=function(_0x3b927e){return BPromise[_0x3dd8('0x54')](promises)['then'](function(_0x364c67){})['catch'](function(_0x545a9c){logger[_0x3dd8('0x1a')](_0x3dd8('0x5b'),JSON[_0x3dd8('0x2f')](_0x545a9c));})[_0x3dd8('0x5c')](function(){socket[_0x3dd8('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3b927e){return _0x3b927e['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x3dd8('0x2c')](function(){socket['emit'](_0x3dd8('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x326bd9){logger[_0x3dd8('0x1a')](_0x3dd8('0x5f'),JSON[_0x3dd8('0x2f')](_0x326bd9));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x3dd8('0x60')]()[_0x3dd8('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3dd8('0x11')](',');return db['CmContact'][_0x3dd8('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3dd8('0x2c')](function(_0x3324c6){var _0x2918cb=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3dd8('0x61')](_0x2918cb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x19ad6a,_0x146056){total+=0x1;var _0x4a2ba2=total;promises[_0x3dd8('0x2d')](checkRow(_0x19ad6a,_0x3324c6,_0x4a2ba2)[_0x3dd8('0x2c')](function(){success+=0x1;})['catch'](function(_0x2398f8){if(_0x2398f8[_0x3dd8('0x1a')]){errors+=0x1;delete _0x2398f8[_0x3dd8('0x1a')];}else if(_0x2398f8[_0x3dd8('0x28')]){duplicates+=0x1;delete _0x2398f8['duplicate'];}rows[_0x3dd8('0x2d')](_0x2398f8);}));if(total%0xc8===0x0){_0x146056[_0x3dd8('0x62')]();return processPromises(_0x146056);}},'complete':function(){return processPromises()[_0x3dd8('0x2c')](function(){logger[_0x3dd8('0x63')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x494c70,_0xebe5a6){logger[_0x3dd8('0x63')](_0x3dd8('0x64'),JSON[_0x3dd8('0x2f')](_0x494c70));endCsv();}});})[_0x3dd8('0x2e')](function(_0x32e921){logger[_0x3dd8('0x1a')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x3dd8('0x2f')](_0x32e921));});}main(); \ No newline at end of file +var _0xbf5e=['cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','ContactId','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','get','Campaign','findAll','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','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!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','into'];(function(_0x53ee11,_0x49b838){var _0x11f85b=function(_0x536646){while(--_0x536646){_0x53ee11['push'](_0x53ee11['shift']());}};_0x11f85b(++_0x49b838);}(_0xbf5e,0xaa));var _0xebf5=function(_0x375712,_0x5c3a5c){_0x375712=_0x375712-0x0;var _0x186bb2=_0xbf5e[_0x375712];return _0x186bb2;};'use strict';var BPromise=require(_0xebf5('0x0'));var util=require('util');var _=require(_0xebf5('0x1'));var fs=require('fs');var squel=require(_0xebf5('0x2'));var Papa=require(_0xebf5('0x3'));var Redis=require(_0xebf5('0x4'));var db=require(_0xebf5('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xebf5('0x6'))(_0xebf5('0x7'));config[_0xebf5('0x8')]=_[_0xebf5('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xebf5('0xa'))[_0xebf5('0xb')](socket);try{if(!process[_0xebf5('0xc')][0x2]||process['argv'][0x2]===_0xebf5('0xd')||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xebf5('0xc')][0x2];if(!process[_0xebf5('0xc')][0x3]||process['argv'][0x3]===_0xebf5('0xd')||process[_0xebf5('0xc')][0x3]===_0xebf5('0xe')||!process[_0xebf5('0xc')][0x4]||process[_0xebf5('0xc')][0x4]===_0xebf5('0xd')||process['argv'][0x4]===_0xebf5('0xe')){throw new Error(_0xebf5('0xf'));}var FIELDS=_[_0xebf5('0x10')](process[_0xebf5('0xc')][0x3][_0xebf5('0x11')](','),process['argv'][0x4][_0xebf5('0x11')](','));if(!process[_0xebf5('0xc')][0x5]||process[_0xebf5('0xc')][0x5]===_0xebf5('0xd')||process['argv'][0x5]===_0xebf5('0xe')){throw new Error(_0xebf5('0x12'));}var LISTID=process[_0xebf5('0xc')][0x5];var COMPANYID=process[_0xebf5('0xc')][0x6]&&process[_0xebf5('0xc')][0x6]!==_0xebf5('0xd')&&process['argv'][0x6]!==_0xebf5('0xe')?process[_0xebf5('0xc')][0x6]:null;var DUPLICATES=process[_0xebf5('0xc')][0x7]&&process['argv'][0x7]!==_0xebf5('0xd')&&process[_0xebf5('0xc')][0x7]!==_0xebf5('0xe')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0xebf5('0xc')][0x8]===_0xebf5('0xd')||process[_0xebf5('0xc')][0x8]===_0xebf5('0xe')){throw new Error(_0xebf5('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x10463f){logger[_0xebf5('0x14')](_0x10463f);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(_0x316a19,_0x5eb202,_0x443251,_0x570c8f){var _0x4e959d={'message':_0x5eb202};_0x4e959d[_0x316a19]=!![];if(_0x443251){_0x4e959d[_0xebf5('0x15')]=_0x443251;}if(_0x570c8f){_0x4e959d['index']=_0x570c8f;}return _0x4e959d;}function isEmail(_0x3a58f4){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))*$/[_0xebf5('0x16')](_0x3a58f4);}function checkRow(_0x2d3e30,_0x5b5823,_0x34174c){return new BPromise(function(_0x103ae8,_0x5d95b7){if(_[_0xebf5('0x17')](_0x2d3e30)){return _0x5d95b7(handleCheckRowError('error',_0xebf5('0x18'),null,_0x34174c));}if(_0x2d3e30['errors']&&_0x2d3e30[_0xebf5('0x19')][_0xebf5('0x1a')]){var _0x1bd2e1=_[_0xebf5('0x1b')](_0x2d3e30[_0xebf5('0x19')],_0xebf5('0x1c'))[_0xebf5('0x1d')](';');return _0x5d95b7(handleCheckRowError('error',_0x1bd2e1,null,_0x34174c));}var _0x4ce813={};for(var _0x1752b2 in FIELDS){if(FIELDS['hasOwnProperty'](_0x1752b2)&&FIELDS[_0x1752b2]){_0x4ce813[_0x1752b2]=_0x2d3e30[_0xebf5('0x1e')][0x0][FIELDS[_0x1752b2]]||_0x2d3e30['data'][0x0]['\ufeff'+FIELDS[_0x1752b2]];}}if(!_0x4ce813[_0xebf5('0x1f')]){return _0x5d95b7(handleCheckRowError(_0xebf5('0x14'),_0xebf5('0x20'),null,_0x34174c));}if(!_0x4ce813[_0xebf5('0x21')]){return _0x5d95b7(handleCheckRowError('error',_0xebf5('0x22'),null,_0x34174c));}if(_0x4ce813['birthDate']){var _0x261c9f=moment(_0x4ce813[_0xebf5('0x23')],_0xebf5('0x24'));if(!_0x261c9f[_0xebf5('0x25')]()){return _0x5d95b7(handleCheckRowError(_0xebf5('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x34174c));}}if(_0x4ce813[_0xebf5('0x26')]){if(!isEmail(_0x4ce813[_0xebf5('0x26')])){return _0x5d95b7(handleCheckRowError(_0xebf5('0x14'),_0xebf5('0x27'),null,_0x34174c));}}_0x4ce813[_0xebf5('0x28')]=LISTID;_0x4ce813[_0xebf5('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xebf5('0x1a')]&&_0x5b5823){var _0x1a4a06={};for(var _0xb96dd3=0x0,_0x248d7f=DUPLICATES['length'];_0xb96dd3<_0x248d7f;_0xb96dd3+=0x1){_0x1a4a06[DUPLICATES[_0xb96dd3]]=_0x4ce813[DUPLICATES[_0xb96dd3]];}var _0x1a6a0f=_[_0xebf5('0x2a')](_0x5b5823,_0x1a4a06);if(_0x1a6a0f){return _0x5d95b7(handleCheckRowError(_0xebf5('0x2b'),_0xebf5('0x2c'),_0x1a6a0f,_0x34174c));}}return db[_0xebf5('0x2d')][_0xebf5('0x2e')](_0x4ce813,{'raw':!![],'hooks':![],'fields':_[_0xebf5('0x2f')](_0x4ce813)})[_0xebf5('0x30')](function(_0x2453ae){if(DUPLICATES&&DUPLICATES[_0xebf5('0x1a')]&&_0x5b5823){_0x5b5823['push'](_[_0xebf5('0x31')](_0x4ce813,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2453ae['id'];return _0x103ae8();})[_0xebf5('0x32')](function(_0x5559f1){return _0x5d95b7(handleCheckRowError('error',_0xebf5('0x33')+(_0x5559f1[_0xebf5('0x1c')]||JSON['stringify'](_0x5559f1)),null,_0x34174c));});});}function checkHopper(){function _0x2b9324(){return function(_0x179d7d){logger[_0xebf5('0x14')](_0xebf5('0x34'),_0xebf5('0x35'),util[_0xebf5('0x36')](_0x179d7d,{'showHidden':![],'depth':null}));};}var _0x31ef8e=function(_0x88986f,_0x948948){var _0x1ce382=squel['insert']()[_0xebf5('0x37')](_0xebf5('0x38'))[_0xebf5('0x39')]([_0xebf5('0x21'),_0xebf5('0x3a'),'ContactId',_0xebf5('0x28'),_0x948948,_0xebf5('0x3b'),_0xebf5('0x3c')],squel[_0xebf5('0x3d')]()[_0xebf5('0x3e')]('phone',_0xebf5('0x21'))[_0xebf5('0x3e')](_0xebf5('0x3f'),_0xebf5('0x3a'))[_0xebf5('0x3e')]('id','ContactId')[_0xebf5('0x3e')](LISTID['toString'](),_0xebf5('0x28'))['field'](_0x88986f['id'][_0xebf5('0x40')](),_0x948948)[_0xebf5('0x3e')](_0xebf5('0x3f'),_0xebf5('0x3b'))['field']('NOW()','updatedAt')[_0xebf5('0x41')](_0xebf5('0x42'))['where'](_0xebf5('0x43'))[_0xebf5('0x44')]('ListId\x20=\x20?',LISTID[_0xebf5('0x40')]())[_0xebf5('0x44')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xebf5('0x45'),squel['select']()[_0xebf5('0x3e')]('phone')[_0xebf5('0x41')]('cm_hopper')['where'](_0x948948+_0xebf5('0x46'),_0x88986f['id'][_0xebf5('0x40')]())))[_0xebf5('0x40')]();return _0x1ce382;};var _0x5ccb4f=function(_0x12fd15,_0x5a4bbc){var _0x5e8bcd=squel[_0xebf5('0x47')]()['into'](_0xebf5('0x38'))[_0xebf5('0x39')](['phone','scheduledAt',_0xebf5('0x48'),_0xebf5('0x28'),_0x5a4bbc,_0xebf5('0x3b'),'updatedAt'],squel[_0xebf5('0x3d')]()[_0xebf5('0x3e')]('phone','phone')['field'](_0xebf5('0x3f'),_0xebf5('0x3a'))['field']('id',_0xebf5('0x48'))['field'](LISTID['toString'](),_0xebf5('0x28'))[_0xebf5('0x3e')](_0x12fd15['id'][_0xebf5('0x40')](),_0x5a4bbc)[_0xebf5('0x3e')]('NOW()','createdAt')['field'](_0xebf5('0x3f'),_0xebf5('0x3c'))[_0xebf5('0x41')](_0xebf5('0x42'))[_0xebf5('0x44')]('deletedAt\x20IS\x20NULL')[_0xebf5('0x44')]('ListId\x20=\x20?',LISTID[_0xebf5('0x40')]())[_0xebf5('0x44')]('id\x20IN\x20?',squel[_0xebf5('0x49')](hopperContacts))[_0xebf5('0x44')](_0xebf5('0x4a'))[_0xebf5('0x44')](_0xebf5('0x45'),squel[_0xebf5('0x3d')]()[_0xebf5('0x3e')](_0xebf5('0x4b'))[_0xebf5('0x41')](_0xebf5('0x4c'))[_0xebf5('0x44')](_0x5a4bbc+_0xebf5('0x46'),_0x12fd15['id'][_0xebf5('0x40')]()))[_0xebf5('0x44')](_0xebf5('0x45'),squel[_0xebf5('0x3d')]()[_0xebf5('0x3e')](_0xebf5('0x21'))[_0xebf5('0x41')]('cm_hopper')[_0xebf5('0x44')](_0x5a4bbc+_0xebf5('0x46'),_0x12fd15['id'][_0xebf5('0x40')]())))[_0xebf5('0x40')]();return _0x5e8bcd;};function _0x306fc4(_0x167411,_0x473269){var _0xbfbe86=squel['insert']()[_0xebf5('0x37')](_0xebf5('0x38'))[_0xebf5('0x39')]([_0xebf5('0x21'),_0xebf5('0x3a'),_0xebf5('0x48'),_0xebf5('0x28'),_0x473269,_0xebf5('0x3b'),_0xebf5('0x3c')],squel['select']()['field'](_0xebf5('0x21'),'phone')[_0xebf5('0x3e')](_0xebf5('0x3f'),_0xebf5('0x3a'))[_0xebf5('0x3e')]('id',_0xebf5('0x48'))[_0xebf5('0x3e')](LISTID[_0xebf5('0x40')](),_0xebf5('0x28'))[_0xebf5('0x3e')](_0x167411['id'][_0xebf5('0x40')](),_0x473269)[_0xebf5('0x3e')](_0xebf5('0x3f'),_0xebf5('0x3b'))['field'](_0xebf5('0x3f'),_0xebf5('0x3c'))[_0xebf5('0x41')](_0xebf5('0x42'))[_0xebf5('0x44')](_0xebf5('0x43'))[_0xebf5('0x44')]('ListId\x20=\x20?',LISTID[_0xebf5('0x40')]())[_0xebf5('0x44')](_0xebf5('0x4d'),squel[_0xebf5('0x49')](hopperContacts))[_0xebf5('0x44')](_0xebf5('0x4a')))['toString']();return _0xbfbe86;}function _0x2d481d(_0x387f4c,_0x95e69e){var _0x20508a=squel[_0xebf5('0x47')]()[_0xebf5('0x37')](_0xebf5('0x4e'))[_0xebf5('0x39')]([_0xebf5('0x21'),_0xebf5('0x48'),_0xebf5('0x28'),_0x95e69e,_0xebf5('0x3b'),_0xebf5('0x3c')],squel[_0xebf5('0x3d')]()[_0xebf5('0x3e')](_0xebf5('0x21'),_0xebf5('0x21'))[_0xebf5('0x3e')]('id','ContactId')['field'](LISTID[_0xebf5('0x40')](),'ListId')[_0xebf5('0x3e')](_0x387f4c['id']['toString'](),_0x95e69e)['field'](_0xebf5('0x3f'),'createdAt')[_0xebf5('0x3e')]('NOW()',_0xebf5('0x3c'))[_0xebf5('0x41')](_0xebf5('0x42'))[_0xebf5('0x44')](_0xebf5('0x43'))[_0xebf5('0x44')]('ListId\x20=\x20?',LISTID[_0xebf5('0x40')]())[_0xebf5('0x44')](_0xebf5('0x4d'),squel[_0xebf5('0x49')](hopperContacts))[_0xebf5('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xebf5('0x40')]();return _0x20508a;}return db[_0xebf5('0x4f')]['findAll']({'where':{'type':_0xebf5('0x50')},'attributes':['id',_0xebf5('0x51')],'include':[{'model':db[_0xebf5('0x52')],'as':_0xebf5('0x53'),'where':{'id':LISTID}}]})[_0xebf5('0x30')](function(_0xcf378a){var _0x41e11b=[];if(_0xcf378a){var _0xda0404;for(var _0x4bde70=0x0,_0x5d754a;_0x4bde70<_0xcf378a[_0xebf5('0x1a')];_0x4bde70+=0x1){_0x5d754a=_0xcf378a[_0x4bde70]['get']({'plain':!![]});switch(_0x5d754a[_0xebf5('0x51')]){case _0xebf5('0x54'):_0x41e11b['push'](db[_0xebf5('0x55')][_0xebf5('0x56')](_0x5ccb4f(_0x5d754a,_0xebf5('0x57')))['then'](function(){})['catch'](_0x2b9324()));break;case _0xebf5('0x58'):_0x41e11b[_0xebf5('0x59')](db['sequelize'][_0xebf5('0x56')](_0x31ef8e(_0x5d754a,_0xebf5('0x57')))[_0xebf5('0x30')](function(){})[_0xebf5('0x32')](_0x2b9324()));break;default:_0x41e11b[_0xebf5('0x59')](db[_0xebf5('0x55')][_0xebf5('0x56')](_0x306fc4(_0x5d754a,'VoiceQueueId'))['then'](function(){})['catch'](_0x2b9324()));}}}return _0x41e11b;})[_0xebf5('0x5a')]()[_0xebf5('0x30')](function(){return db[_0xebf5('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xebf5('0x30')](function(_0x3874bc){var _0x3bfe25=[];if(_0x3874bc){var _0x3ff4e7;for(var _0x115db4=0x0,_0x47e3f7;_0x115db4<_0x3874bc['length'];_0x115db4+=0x1){_0x47e3f7=_0x3874bc[_0x115db4][_0xebf5('0x5b')]({'plain':!![]});_0x3bfe25[_0xebf5('0x59')](db[_0xebf5('0x55')][_0xebf5('0x56')](_0x2d481d(_0x47e3f7,_0xebf5('0x57')))[_0xebf5('0x30')](function(){})[_0xebf5('0x32')](_0x2b9324()));}}return _0x3bfe25;})[_0xebf5('0x5a')]();})['then'](function(){return db[_0xebf5('0x5c')][_0xebf5('0x5d')]({'attributes':['id',_0xebf5('0x51')],'include':[{'model':db[_0xebf5('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0xebf5('0x30')](function(_0x2cf584){var _0x1e8c6e=[];if(_0x2cf584){for(var _0x1de539=0x0,_0x1f30b8;_0x1de539<_0x2cf584[_0xebf5('0x1a')];_0x1de539+=0x1){_0x1f30b8=_0x2cf584[_0x1de539][_0xebf5('0x5b')]({'plain':!![]});switch(_0x1f30b8[_0xebf5('0x51')]){case _0xebf5('0x54'):_0x1e8c6e['push'](db['sequelize']['query'](_0x5ccb4f(_0x1f30b8,_0xebf5('0x5e')))[_0xebf5('0x30')](function(){})['catch'](_0x2b9324()));break;case _0xebf5('0x58'):_0x1e8c6e[_0xebf5('0x59')](db[_0xebf5('0x55')][_0xebf5('0x56')](_0x31ef8e(_0x1f30b8,'CampaignId'))[_0xebf5('0x30')](function(){})[_0xebf5('0x32')](_0x2b9324()));break;default:_0x1e8c6e[_0xebf5('0x59')](db[_0xebf5('0x55')]['query'](_0x306fc4(_0x1f30b8,_0xebf5('0x5e')))[_0xebf5('0x30')](function(){})[_0xebf5('0x32')](_0x2b9324()));}}}return _0x1e8c6e;})[_0xebf5('0x5a')]();})[_0xebf5('0x30')](function(){return db[_0xebf5('0x5c')][_0xebf5('0x5d')]({'attributes':['id'],'include':[{'model':db[_0xebf5('0x52')],'as':_0xebf5('0x5f'),'where':{'id':LISTID}}]})[_0xebf5('0x30')](function(_0x5ca8ba){var _0x16d5b1=[];if(_0x5ca8ba){for(var _0x47f36c=0x0,_0x39c58b;_0x47f36c<_0x5ca8ba[_0xebf5('0x1a')];_0x47f36c+=0x1){_0x39c58b=_0x5ca8ba[_0x47f36c][_0xebf5('0x5b')]({'plain':!![]});_0x16d5b1[_0xebf5('0x59')](db[_0xebf5('0x55')][_0xebf5('0x56')](_0x2d481d(_0x39c58b,_0xebf5('0x5e')))['then'](function(){})['catch'](_0x2b9324()));}}return _0x16d5b1;})['all']();})[_0xebf5('0x32')](function(_0x2869f1){logger[_0xebf5('0x14')](_0xebf5('0x60'),_0xebf5('0x61'),_0x2869f1[_0xebf5('0x1c')]);});}var processPromises=function(_0x5f417a){return BPromise[_0xebf5('0x5a')](promises)[_0xebf5('0x30')](function(_0x59799d){})[_0xebf5('0x32')](function(_0x5bcdc1){logger['error'](_0xebf5('0x62'),JSON[_0xebf5('0x63')](_0x5bcdc1));})[_0xebf5('0x64')](function(){socket[_0xebf5('0x65')](_0xebf5('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5f417a){return _0x5f417a[_0xebf5('0x67')]();}});};var endCsv=function(){return BPromise[_0xebf5('0x68')]()[_0xebf5('0x30')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xebf5('0x65')](_0xebf5('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xebf5('0x69')](FILEPATH);}catch(_0x2b8749){logger[_0xebf5('0x14')](_0xebf5('0x6a'),JSON[_0xebf5('0x63')](_0x2b8749));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xebf5('0x6b')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xebf5('0x11')](',');return db[_0xebf5('0x2d')][_0xebf5('0x5d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4a52a1){var _0x5a0e2e=fs[_0xebf5('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xebf5('0x6d')](_0x5a0e2e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4fd857,_0x51b5bd){total+=0x1;var _0x13e29c=total;promises[_0xebf5('0x59')](checkRow(_0x4fd857,_0x4a52a1,_0x13e29c)[_0xebf5('0x30')](function(){success+=0x1;})[_0xebf5('0x32')](function(_0x3a9df3){if(_0x3a9df3[_0xebf5('0x14')]){errors+=0x1;delete _0x3a9df3[_0xebf5('0x14')];}else if(_0x3a9df3[_0xebf5('0x2b')]){duplicates+=0x1;delete _0x3a9df3['duplicate'];}rows[_0xebf5('0x59')](_0x3a9df3);}));if(total%0xc8===0x0){_0x51b5bd[_0xebf5('0x6e')]();return processPromises(_0x51b5bd);}},'complete':function(){return processPromises()[_0xebf5('0x30')](function(){logger[_0xebf5('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2f5491,_0x53d29a){logger[_0xebf5('0x6b')](_0xebf5('0x6f'),JSON[_0xebf5('0x63')](_0x2f5491));endCsv();}});})[_0xebf5('0x32')](function(_0x3649ba){logger[_0xebf5('0x14')](_0xebf5('0x70'),JSON[_0xebf5('0x63')](_0x3649ba));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b9d6b2f..1305420 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 _0x50d5=[',utcOffset','parse','createReadStream','data','rows','errors','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','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','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','socket.io-emitter','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','into','cm_hopper_black','cm_contacts','.CmListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','cm_contacts.priority','recallme','\x22onlyIfOpen\x22','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','sequelize','spread','push','catch','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','then','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=','length','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','root','server/files/tmp','.csv','includes','header'];(function(_0x2f9cbc,_0x42cf1b){var _0xd91e8=function(_0x183a29){while(--_0x183a29){_0x2f9cbc['push'](_0x2f9cbc['shift']());}};_0xd91e8(++_0x42cf1b);}(_0x50d5,0x173));var _0x550d=function(_0x323945,_0x3420e2){_0x323945=_0x323945-0x0;var _0x1f9266=_0x50d5[_0x323945];return _0x1f9266;};'use strict';var fs=require('fs');var path=require(_0x550d('0x0'));var _=require(_0x550d('0x1'));var Papa=require(_0x550d('0x2'));var util=require(_0x550d('0x3'));var BPromise=require(_0x550d('0x4'));var moment=require(_0x550d('0x5'));var squel=require(_0x550d('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x550d('0x7'));var shared=require(_0x550d('0x8'));var logger=require(_0x550d('0x9'))(_0x550d('0xa'));config[_0x550d('0xb')]=_[_0x550d('0xc')](config[_0x550d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x550d('0xd'))(new Redis(config[_0x550d('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x7dd326){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'](_0x7dd326);}function selectNotIn(_0xe1445f,_0x45c771,_0x3de6c8,_0x5bcc6f,_0x38e746){return squel[_0x550d('0xe')]()[_0x550d('0xf')](_0x550d('0x10'))['from'](_0x5bcc6f)[_0x550d('0x11')](_0x45c771,null,_0x45c771+_0x550d('0x12')+_0x5bcc6f+'.'+_0x3de6c8)[_0x550d('0x13')](_0x5bcc6f+'.'+_0x3de6c8+_0x550d('0x14')+_0xe1445f+'.'+_0x3de6c8)[_0x550d('0x13')](_0x45c771+'.dialCheckDuplicateType\x20IN\x20('+_0x38e746[_0x550d('0x11')]()+')');}function insertCmHopper(_0x550f69,_0x45e46b,_0x12dd59,_0x3c1fea,_0x4ae623){var _0x4c3472=['cm_contacts.phone',_0x550d('0x15'),_0x550d('0x16'),_0x550d('0x17'),_0x45e46b+'.'+_0x3c1fea,_0x550d('0x18'),'cm_contacts.updatedAt','cm_contacts.priority',_0x550d('0x19'),'\x22'+_0x4ae623+'\x22'];return squel[_0x550d('0x1a')]()['into'](_0x550d('0x1b'))[_0x550d('0x1c')]([_0x550d('0x10'),_0x550d('0x1d'),_0x550d('0x1e'),_0x550d('0x1f'),_0x3c1fea,_0x550d('0x20'),_0x550d('0x21'),_0x550d('0x22'),_0x550d('0x23'),'recallme'],squel[_0x550d('0xe')]()[_0x550d('0x24')](_0x4c3472)[_0x550d('0x25')](_0x45e46b)[_0x550d('0x11')]('cm_contacts',null,_0x550d('0x26')+_0x45e46b+'.CmListId')[_0x550d('0x11')](_0x12dd59,null,_0x12dd59+_0x550d('0x12')+_0x45e46b+'.'+_0x3c1fea)[_0x550d('0x13')](_0x45e46b+_0x550d('0x27'),_0x550f69)[_0x550d('0x13')](_0x550d('0x28'),NOW)[_0x550d('0x13')](_0x550d('0x29'),selectNotIn(_0x45e46b,_0x12dd59,_0x3c1fea,'cm_hopper',[_0x550d('0x2a'),'\x22onlyIfOpen\x22']))[_0x550d('0x13')](_0x550d('0x29'),selectNotIn(_0x45e46b,_0x12dd59,_0x3c1fea,_0x550d('0x1b'),['\x22always\x22'])))[_0x550d('0x2b')]();}function insertCmHopperBlack(_0x1291c4,_0x4f72e3,_0x266ffa,_0x4f5a1b){var _0x110c09=[_0x550d('0x2c'),_0x550d('0x16'),'cm_contacts.ListId',_0x4f72e3+'.'+_0x4f5a1b,_0x550d('0x18'),'cm_contacts.updatedAt'];return squel['insert']()[_0x550d('0x2d')](_0x550d('0x2e'))[_0x550d('0x1c')]([_0x550d('0x10'),_0x550d('0x1e'),_0x550d('0x1f'),_0x4f5a1b,_0x550d('0x20'),_0x550d('0x21')],squel[_0x550d('0xe')]()[_0x550d('0x24')](_0x110c09)[_0x550d('0x25')](_0x4f72e3)['join'](_0x550d('0x2f'),null,_0x550d('0x26')+_0x4f72e3+_0x550d('0x30'))[_0x550d('0x11')](_0x266ffa,null,_0x266ffa+_0x550d('0x12')+_0x4f72e3+'.'+_0x4f5a1b)['where'](_0x4f72e3+_0x550d('0x27'),_0x1291c4)[_0x550d('0x13')](_0x550d('0x28'),NOW)[_0x550d('0x13')](_0x550d('0x29'),squel[_0x550d('0xe')]()['field'](_0x550d('0x10'))['from'](_0x550d('0x2e'))['where'](_0x550d('0x31'),_0x1291c4)[_0x550d('0x13')](_0x4f5a1b+'\x20=\x20?',_0x4f72e3+'.'+_0x4f5a1b)))[_0x550d('0x2b')]();}function insertTzCmHopper(_0x7fd8bd,_0x2ed9c3,_0x18ce6c,_0x349263,_0x2633d4,_0x8b2798){var _0x3a7584=[_0x550d('0x2c'),_0x550d('0x32')+_0x8b2798+_0x550d('0x33'),'cm_contacts.id',_0x550d('0x17'),_0x2ed9c3+'.'+_0x349263,_0x550d('0x18'),_0x550d('0x34'),_0x550d('0x35'),_0x550d('0x19'),'\x22'+_0x2633d4+'\x22'];var _0x4156c5=squel[_0x550d('0x1a')]()[_0x550d('0x2d')](_0x550d('0x1b'))['fromQuery'](['phone',_0x550d('0x1d'),'ContactId','ListId',_0x349263,'createdAt',_0x550d('0x21'),_0x550d('0x22'),_0x550d('0x23'),_0x550d('0x36')],squel[_0x550d('0xe')]()['fields'](_0x3a7584)[_0x550d('0x25')](_0x2ed9c3)['join'](_0x550d('0x2f'),null,'cm_contacts.ListId\x20=\x20'+_0x2ed9c3+'.CmListId')[_0x550d('0x11')](_0x18ce6c,null,_0x18ce6c+_0x550d('0x12')+_0x2ed9c3+'.'+_0x349263)['join'](_0x8b2798,null,_0x8b2798+_0x550d('0x12')+_0x2ed9c3+'.'+_0x349263)[_0x550d('0x13')](_0x2ed9c3+_0x550d('0x27'),_0x7fd8bd)[_0x550d('0x13')](_0x550d('0x28'),NOW)[_0x550d('0x13')](_0x550d('0x29'),selectNotIn(_0x2ed9c3,_0x18ce6c,_0x349263,'cm_hopper',[_0x550d('0x2a'),_0x550d('0x37')]))[_0x550d('0x13')](_0x550d('0x29'),selectNotIn(_0x2ed9c3,_0x18ce6c,_0x349263,'cm_hopper',[_0x550d('0x2a')])))[_0x550d('0x2b')]();return _0x4156c5;}function insertTzCmHopperBlack(_0x59eebd,_0x1e7d88,_0x1e5cb9,_0x2b6323){var _0x4f1ddf=['cm_contacts.phone',_0x550d('0x16'),_0x550d('0x17'),_0x1e7d88+'.'+_0x2b6323,_0x550d('0x18'),_0x550d('0x34')];return squel['insert']()[_0x550d('0x2d')](_0x550d('0x2e'))[_0x550d('0x1c')](['phone','ContactId',_0x550d('0x1f'),_0x2b6323,_0x550d('0x20'),_0x550d('0x21')],squel[_0x550d('0xe')]()[_0x550d('0x24')](_0x4f1ddf)[_0x550d('0x25')](_0x1e7d88)['join'](_0x550d('0x2f'),null,_0x550d('0x26')+_0x1e7d88+_0x550d('0x30'))[_0x550d('0x11')](_0x1e5cb9,null,_0x1e5cb9+_0x550d('0x12')+_0x1e7d88+'.'+_0x2b6323)[_0x550d('0x13')](_0x1e7d88+_0x550d('0x27'),_0x59eebd)[_0x550d('0x13')](_0x550d('0x28'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x550d('0xf')](_0x550d('0x10'))['from'](_0x550d('0x2e'))[_0x550d('0x13')](_0x550d('0x31'),_0x59eebd)['where'](_0x2b6323+_0x550d('0x38'),_0x1e7d88+'.'+_0x2b6323)))['toString']();}function insertCmContact(_0x45555f,_0x1dd7f4,_0x4afec5,_0x6d8dcf){var _0x2d57e4=_[_0x550d('0x39')](_[_0x550d('0x3a')](_0x6d8dcf),[_0x550d('0x1f'),_0x550d('0x3b'),_0x550d('0x20'),_0x550d('0x21')]);return squel['insert']()[_0x550d('0x2d')](_0x550d('0x2f'))[_0x550d('0x1c')](_0x2d57e4,squel[_0x550d('0xe')]()[_0x550d('0x24')](_0x2d57e4)['from'](_0x1dd7f4)[_0x550d('0x13')]('('+_0x4afec5[_0x550d('0x11')](',')+_0x550d('0x3c'),squel['select']()[_0x550d('0x24')](_0x4afec5)[_0x550d('0x25')](_0x550d('0x2f'))[_0x550d('0x13')](_0x550d('0x31'),_0x45555f)[_0x550d('0x13')](_0x550d('0x3d')))[_0x550d('0x13')](_0x550d('0x3e'),squel[_0x550d('0xe')]()[_0x550d('0xf')](_0x550d('0x3f'),_0x550d('0x40'))[_0x550d('0x25')](_0x1dd7f4)[_0x550d('0x41')](_0x4afec5[_0x550d('0x11')](','))))[_0x550d('0x2b')]();}function handleStop(){logger[_0x550d('0x42')](_0x550d('0x43'));stopped=!![];}function handleUncaughtException(_0x210db5){logger[_0x550d('0x44')](_0x210db5[_0x550d('0x45')]);process[_0x550d('0x46')](0x1);}function handleError(_0x1f69eb,_0x3ede9d){stats['errors']['push']({'name':_0x3ede9d[_0x550d('0x47')],'message':_0x3ede9d[_0x550d('0x45')],'row':_0x1f69eb});}function handleQuery(_0x5ab15c){logger[_0x550d('0x42')](_0x5ab15c);return db[_0x550d('0x48')]['query'](_0x5ab15c)[_0x550d('0x49')](function(_0xe3b119){results[_0x550d('0x4a')](_0xe3b119);})[_0x550d('0x4b')](function(_0x30af7e){logger[_0x550d('0x44')](_0x30af7e[_0x550d('0x45')]);});}function updateTzCampaigns(_0x54b929){return new Promise(function(_0x1eb1f8,_0x549dab){var _0x2f893e=squel['select']()['fields']([_0x550d('0x4c'),'campaigns.dialTimezone'])[_0x550d('0x25')](_0x550d('0x4d'))[_0x550d('0x11')](_0x550d('0x4e'),null,_0x550d('0x4f'))['where']('campaigns_has_cm_lists.CmListId='+_0x54b929);db[_0x550d('0x48')][_0x550d('0x50')](_0x2f893e[_0x550d('0x2b')]())[_0x550d('0x49')](function(_0x11395b){var _0x5bad92=[];for(var _0x229b8f=0x0;_0x229b8f<_0x11395b['length'];_0x229b8f++){_0x5bad92[_0x550d('0x4a')](getTimezoneData(_0x11395b[_0x229b8f],tmp_campaigns));}BPromise['all'](_0x5bad92)[_0x550d('0x51')](function(){_0x1eb1f8({'val':0x1});});})['catch'](function(_0x2e71dc){logger[_0x550d('0x44')](_0x2e71dc[_0x550d('0x45')]);_0x1eb1f8({'val':0x0});});});}function updateTzVoiceQueues(_0x3dd992){return new Promise(function(_0x156ef5,_0x35372d){var _0x78dcf9=squel[_0x550d('0xe')]()['fields'](['voice_queues.id',_0x550d('0x52')])[_0x550d('0x25')](_0x550d('0x53'))['join'](_0x550d('0x54'),null,_0x550d('0x55'))['where'](_0x550d('0x56')+_0x3dd992);db[_0x550d('0x48')][_0x550d('0x50')](_0x78dcf9[_0x550d('0x2b')]())[_0x550d('0x49')](function(_0x2f2639){var _0x282ec0=[];for(var _0x2bbefc=0x0;_0x2bbefc<_0x2f2639[_0x550d('0x57')];_0x2bbefc++){_0x282ec0[_0x550d('0x4a')](getTimezoneData(_0x2f2639[_0x2bbefc],tmp_voice_queues));}BPromise['all'](_0x282ec0)[_0x550d('0x51')](function(){_0x156ef5({'val':0x1});});})[_0x550d('0x4b')](function(_0x306a0e){logger[_0x550d('0x44')](_0x306a0e[_0x550d('0x45')]);_0x156ef5({'val':0x0});});});}function getTimezoneData(_0x5a2c94,_0x4b3b1d){return new Promise(function(_0x535861,_0x296958){var _0x1ce853=shared[_0x550d('0x58')];var _0x3dd67b=_0x1ce853[_0x5a2c94[_0x550d('0x59')]];if(_[_0x550d('0x5a')](_0x3dd67b)){_0x535861({'ret':0x1});}else{var _0x38f368=_0x3dd67b[_0x550d('0x5b')];var _0x2e99af=squel[_0x550d('0x1a')]()[_0x550d('0x2d')](_0x4b3b1d)[_0x550d('0x5c')]('id',_0x5a2c94['id'])['set'](_0x550d('0x5d'),_0x38f368)['set'](_0x550d('0x59'),_0x5a2c94[_0x550d('0x59')])['toString']();return db[_0x550d('0x48')]['query'](_0x2e99af)['spread'](function(_0x9e9448){_0x535861({'ret':0x1});})[_0x550d('0x4b')](function(_0x55e4fd){logger[_0x550d('0x44')](_0x55e4fd[_0x550d('0x45')]);_0x296958({'ret':0x1});});}});}function handleTZQuery(_0x5e1412){logger[_0x550d('0x42')](_0x5e1412);return db['sequelize']['query'](_0x5e1412)[_0x550d('0x49')](function(_0x3c32ea){})['catch'](function(_0xd878d6){logger[_0x550d('0x44')](_0xd878d6['message']);});}function main(_0x43df80,_0x115efc,_0x1615a6,_0x3ae093){logger[_0x550d('0x42')](_0x550d('0x5e'),_0x43df80,JSON[_0x550d('0x5f')](_0x115efc));process[_0x550d('0x60')]('start');var _0x189e3d=_0x115efc[_0x550d('0x61')];var _0x2f7e87=_0x115efc['socket_timestamp'];var _0x4cdf22=path[_0x550d('0x11')](config[_0x550d('0x62')],_0x550d('0x63'),_0x2f7e87+_0x550d('0x64'));hasTZ=_['keys'](_0x189e3d)[_0x550d('0x65')](_0x550d('0x59'));var _0x100f9e=_[_0x550d('0x3a')](_0x189e3d)[_0x550d('0x11')]();logger[_0x550d('0x42')](_0x550d('0x66'),_0x100f9e);if(hasTZ)_0x100f9e+=_0x550d('0x67');fs['writeFileSync'](_0x4cdf22,_0x100f9e+'\x0a');Papa[_0x550d('0x68')](fs[_0x550d('0x69')](_0x43df80),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d4cfa,_0x260db8){try{for(var _0x5e7f1d=0x0,_0x3eab4c=[];_0x5e7f1d<_0x3d4cfa[_0x550d('0x6a')][_0x550d('0x57')];_0x5e7f1d++){stats[_0x550d('0x6b')]+=0x1;if(_0x3d4cfa['errors'][_0x5e7f1d]){handleError(_0x3d4cfa[_0x550d('0x6a')][_0x5e7f1d],_0x3d4cfa[_0x550d('0x6c')][_0x5e7f1d]);}else{var _0xae7e9a=[];for(var _0x1754c0 in _0x189e3d){if(_0x189e3d[_0x550d('0x6d')](_0x1754c0)){if(_0x3d4cfa['data'][_0x5e7f1d][_0x189e3d[_0x1754c0]]){var _0x2a409a=_['trim'](_0x3d4cfa[_0x550d('0x6a')][_0x5e7f1d][_0x189e3d[_0x1754c0]][_0x550d('0x6e')](/"/g,'\x27'));switch(_0x1754c0){case _0x550d('0x1d'):var _0x5b780f=moment(_0x2a409a,_0x550d('0x6f'),!![]);if(_0x5b780f[_0x550d('0x70')]()){_0x3eab4c['push']('\x22'+_0x2a409a+'\x22');}else{_0xae7e9a[_0x550d('0x4a')](_0x550d('0x71'));}break;case _0x550d('0x22'):var _0x13f107=parseInt(_0x2a409a);_0x2a409a=_['isNaN'](_0x13f107)||_0x13f107<0x0||_0x13f107>0x4?_0x3ae093?0x3:0x2:_0x13f107;_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x2a409a+'\x22');break;case _0x550d('0x23'):var _0x213341=parseInt(_0x2a409a);if(_[_0x550d('0x72')](_0x213341)&&_[_0x550d('0x65')](_0x1615a6,_0x213341)){_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x213341+'\x22');}else{_0xae7e9a[_0x550d('0x4a')](_0x550d('0x73'));}break;case _0x550d('0x74'):if(isEmail(_0x2a409a)){_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x2a409a+'\x22');}else{_0xae7e9a[_0x550d('0x4a')]('email\x20wrong\x20format');}break;case _0x550d('0x75'):var _0x3a80c6=moment(_0x2a409a,_0x550d('0x76'),!![]);if(_0x3a80c6[_0x550d('0x70')]()){_0x3eab4c['push']('\x22'+_0x2a409a+'\x22');}else{_0xae7e9a[_0x550d('0x4a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x550d('0x59'):var _0x5ee640=shared[_0x550d('0x58')];var _0x3af5f3=_0x5ee640[_0x2a409a];if(!_[_0x550d('0x5a')](_0x3af5f3)){var _0x3e53af=_0x3af5f3[_0x550d('0x5b')];_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x2a409a+'\x22');_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x3e53af+'\x22');}break;default:_0x3eab4c[_0x550d('0x4a')]('\x22'+_0x2a409a+'\x22');}}else{switch(_0x1754c0){case'firstName':case _0x550d('0x10'):_0xae7e9a[_0x550d('0x4a')](_0x1754c0+_0x550d('0x77'));break;default:_0x3eab4c[_0x550d('0x4a')]('\x22\x22');}}}}if(_0xae7e9a['length']){handleError(_0x3d4cfa[_0x550d('0x6a')][_0x5e7f1d],{'code':_0x550d('0x78'),'message':_0xae7e9a[_0x550d('0x11')]()});}else{fs[_0x550d('0x79')](_0x4cdf22,_0x3eab4c[_0x550d('0x11')]()+'\x0a');}_0x3eab4c=[];}if(!(stats['rows']%0xc8)){socket[_0x550d('0x7a')](_0x550d('0x7b')+_0x2f7e87,stats);stats[_0x550d('0x6c')]=[];}}if(stopped){logger[_0x550d('0x42')](_0x550d('0x7c'));_0x260db8[_0x550d('0x7d')]();}}catch(_0x5ae6a4){handleError(_0x3d4cfa[_0x550d('0x6a')][_0x5e7f1d],{'code':_0x550d('0x7e'),'message':_0x5ae6a4[_0x550d('0x45')]});logger['error'](_0x550d('0x7f'),_0x5ae6a4['message']);}},'complete':function(){try{var _0x4477a2=[];var _0x3e3b7a=[];var _0x1b5525=_0x550d('0x2f');if(_0x115efc['duplicates']&&_0x115efc[_0x550d('0x80')][_0x550d('0x57')]){_0x1b5525=_0x550d('0x81')+_0x2f7e87;_0x4477a2[_0x550d('0x4a')](_0x550d('0x82')+_0x1b5525+_0x550d('0x83'));}tmp_campaigns=_0x550d('0x84')+_0x2f7e87;tmp_voice_queues=_0x550d('0x85')+_0x2f7e87;_0x3e3b7a[_0x550d('0x4a')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3e3b7a[_0x550d('0x4a')](_0x550d('0x82')+tmp_voice_queues+_0x550d('0x86'));BPromise[_0x550d('0x87')](_0x3e3b7a,handleTZQuery)[_0x550d('0x51')](function(_0x3b28c7){updateTzCampaigns(_0x115efc['ListId'])[_0x550d('0x51')](function(_0x25f949){updateTzVoiceQueues(_0x115efc[_0x550d('0x1f')])[_0x550d('0x51')](function(_0x2274e1){var _0x182178=util[_0x550d('0x88')](_0x550d('0x89'),_0x4cdf22,_0x1b5525,_0x100f9e,_0x115efc[_0x550d('0x1f')],_0x115efc[_0x550d('0x3b')]||null,NOW,NOW);if(_['isNil'](_0x189e3d['scheduledat'])){_0x182178+=_0x550d('0x8a');}_0x4477a2[_0x550d('0x4a')](_0x182178);if(_0x115efc[_0x550d('0x80')]&&_0x115efc[_0x550d('0x80')][_0x550d('0x57')]){_0x4477a2[_0x550d('0x4a')](insertCmContact(_0x115efc[_0x550d('0x1f')],_0x1b5525,_0x115efc[_0x550d('0x80')],_0x189e3d));_0x4477a2[_0x550d('0x4a')](_0x550d('0x8b')+_0x1b5525+';');}if(hasTZ){_0x4477a2[_0x550d('0x4a')](insertTzCmHopper(_0x115efc[_0x550d('0x1f')],'voice_queues_has_cm_lists',_0x550d('0x53'),_0x550d('0x8c'),_0x3ae093,tmp_voice_queues));_0x4477a2['push'](insertTzCmHopperBlack(_0x115efc[_0x550d('0x1f')],_0x550d('0x8d'),_0x550d('0x53'),_0x550d('0x8c')));_0x4477a2[_0x550d('0x4a')](insertTzCmHopper(_0x115efc['ListId'],_0x550d('0x4e'),_0x550d('0x4d'),_0x550d('0x8e'),_0x3ae093,tmp_campaigns));_0x4477a2[_0x550d('0x4a')](insertTzCmHopperBlack(_0x115efc['ListId'],_0x550d('0x8f'),_0x550d('0x4d'),_0x550d('0x8e')));}else{_0x4477a2[_0x550d('0x4a')](insertCmHopper(_0x115efc[_0x550d('0x1f')],'voice_queues_has_cm_lists',_0x550d('0x53'),'VoiceQueueId',_0x3ae093));_0x4477a2[_0x550d('0x4a')](insertCmHopperBlack(_0x115efc[_0x550d('0x1f')],_0x550d('0x8d'),'voice_queues','VoiceQueueId'));_0x4477a2['push'](insertCmHopper(_0x115efc[_0x550d('0x1f')],_0x550d('0x4e'),'campaigns',_0x550d('0x8e'),_0x3ae093));_0x4477a2[_0x550d('0x4a')](insertCmHopperBlack(_0x115efc[_0x550d('0x1f')],_0x550d('0x8f'),_0x550d('0x4d'),_0x550d('0x8e')));}_0x4477a2[_0x550d('0x4a')](_0x550d('0x8b')+tmp_campaigns+';');_0x4477a2[_0x550d('0x4a')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x550d('0x87')](_0x4477a2,handleQuery)[_0x550d('0x51')](function(_0x2732cf){stats[_0x550d('0x90')]=!![];stats[_0x550d('0x91')]=_0x115efc['duplicates']&&_0x115efc[_0x550d('0x80')][_0x550d('0x57')]?results[0x2][_0x550d('0x91')]:results[0x0]['affectedRows'];socket[_0x550d('0x7a')]('contact:import:'+_0x2f7e87,stats);fs[_0x550d('0x92')](_0x43df80);fs[_0x550d('0x92')](_0x4cdf22);process[_0x550d('0x46')](0x0);})['catch'](function(_0x7922c2){logger[_0x550d('0x44')](_0x7922c2['message']);process[_0x550d('0x46')](0x1);});});});});}catch(_0x508754){logger[_0x550d('0x44')](_0x550d('0x93'),_0x508754[_0x550d('0x45')]);process[_0x550d('0x46')](0x1);}},'error':function(_0x8e22c1,_0x413600,_0x11b8b5,_0x4b1618){throw new Error(_0x4b1618);}});}function validate(){if(process[_0x550d('0x94')]&&process[_0x550d('0x94')][_0x550d('0x57')]<0x4){throw new Error(_0x550d('0x95'));}var _0x28f541=path[_0x550d('0x11')](config['root'],_0x550d('0x63'),process[_0x550d('0x94')][0x2]);if(!fs['existsSync'](_0x28f541)){throw new Error(_0x550d('0x96'));}var _0x49fb84={};try{_0x49fb84=JSON[_0x550d('0x68')](process[_0x550d('0x94')][0x3]);if(!_0x49fb84[_0x550d('0x61')]){throw new Error(_0x550d('0x97'));}if(!_0x49fb84[_0x550d('0x61')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x49fb84[_0x550d('0x61')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x4cce67=0x0;if(_0x49fb84[_0x550d('0x61')][_0x550d('0x23')]){_0x4cce67=0x1;}if(!_0x49fb84['ListId']){throw new Error(_0x550d('0x98'));}}catch(_0x4f1590){throw new Error(_0x550d('0x99'));}var _0x1f92d2=[];try{_0x1f92d2=_[_0x550d('0x9a')](JSON['parse'](process[_0x550d('0x94')][0x4]),'id');}catch(_0x9ea183){logger['info'](_0x550d('0x9b'));}main(_0x28f541,_0x49fb84,_0x1f92d2,_0x4cce67);}validate();process['on'](_0x550d('0x9c'),handleStop);process['on'](_0x550d('0x9d'),handleUncaughtException); \ No newline at end of file +var _0x664c=['arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','insert','cm_hopper_black','cm_contacts','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','recallme','\x22onlyIfOpen\x22','toString','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','catch','dialTimezone','isNil','utcOffset','set','main','stringify','send','start','binding','root','server/files/tmp','.csv','header',',utcOffset','writeFileSync','parse','data','rows','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','CompanyId','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x664c,0x13f));var _0xc664=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x664c[_0xa464c9];return _0x3d73c4;};'use strict';var fs=require('fs');var path=require(_0xc664('0x0'));var _=require(_0xc664('0x1'));var Papa=require(_0xc664('0x2'));var util=require('util');var BPromise=require(_0xc664('0x3'));var moment=require('moment');var squel=require(_0xc664('0x4'));var Redis=require(_0xc664('0x5'));var db=require(_0xc664('0x6'))['db'];var config=require(_0xc664('0x7'));var shared=require(_0xc664('0x8'));var logger=require(_0xc664('0x9'))('import');config[_0xc664('0xa')]=_['defaults'](config['redis'],{'host':_0xc664('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xc664('0xc')](_0xc664('0xd'));function isEmail(_0x290c2f){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))*$/[_0xc664('0xe')](_0x290c2f);}function selectNotIn(_0x3cd764,_0x493ad5,_0x42f0a9,_0x4ccd9c,_0x7a7f88){return squel[_0xc664('0xf')]()[_0xc664('0x10')](_0xc664('0x11'))[_0xc664('0x12')](_0x4ccd9c)[_0xc664('0x13')](_0x493ad5,null,_0x493ad5+'.id\x20=\x20'+_0x4ccd9c+'.'+_0x42f0a9)[_0xc664('0x14')](_0x4ccd9c+'.'+_0x42f0a9+_0xc664('0x15')+_0x3cd764+'.'+_0x42f0a9)['where'](_0x493ad5+_0xc664('0x16')+_0x7a7f88[_0xc664('0x13')]()+')');}function insertCmHopper(_0x3a096f,_0x60a06f,_0x2d2198,_0x74d302,_0xa5bdb8){var _0x138e78=[_0xc664('0x17'),_0xc664('0x18'),_0xc664('0x19'),_0xc664('0x1a'),_0x60a06f+'.'+_0x74d302,_0xc664('0x1b'),_0xc664('0x1c'),'cm_contacts.priority',_0xc664('0x1d'),'\x22'+_0xa5bdb8+'\x22'];return squel['insert']()[_0xc664('0x1e')](_0xc664('0x1f'))[_0xc664('0x20')](['phone',_0xc664('0x21'),_0xc664('0x22'),_0xc664('0x23'),_0x74d302,_0xc664('0x24'),_0xc664('0x25'),_0xc664('0x26'),_0xc664('0x27'),'recallme'],squel[_0xc664('0xf')]()[_0xc664('0x28')](_0x138e78)[_0xc664('0x12')](_0x60a06f)['join']('cm_contacts',null,_0xc664('0x29')+_0x60a06f+'.CmListId')[_0xc664('0x13')](_0x2d2198,null,_0x2d2198+_0xc664('0x2a')+_0x60a06f+'.'+_0x74d302)[_0xc664('0x14')](_0x60a06f+'.CmListId\x20=\x20?',_0x3a096f)['where'](_0xc664('0x2b'),NOW)[_0xc664('0x14')](_0xc664('0x2c'),selectNotIn(_0x60a06f,_0x2d2198,_0x74d302,_0xc664('0x1f'),[_0xc664('0x2d'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x60a06f,_0x2d2198,_0x74d302,'cm_hopper',[_0xc664('0x2d')])))['toString']();}function insertCmHopperBlack(_0x5554f2,_0x1a7f3e,_0x2d98f8,_0x3ad6fb){var _0x411435=[_0xc664('0x17'),_0xc664('0x19'),_0xc664('0x1a'),_0x1a7f3e+'.'+_0x3ad6fb,_0xc664('0x1b'),'cm_contacts.updatedAt'];return squel[_0xc664('0x2e')]()['into'](_0xc664('0x2f'))[_0xc664('0x20')]([_0xc664('0x11'),_0xc664('0x22'),_0xc664('0x23'),_0x3ad6fb,'createdAt',_0xc664('0x25')],squel[_0xc664('0xf')]()[_0xc664('0x28')](_0x411435)['from'](_0x1a7f3e)['join'](_0xc664('0x30'),null,_0xc664('0x29')+_0x1a7f3e+_0xc664('0x31'))[_0xc664('0x13')](_0x2d98f8,null,_0x2d98f8+_0xc664('0x2a')+_0x1a7f3e+'.'+_0x3ad6fb)['where'](_0x1a7f3e+_0xc664('0x32'),_0x5554f2)['where'](_0xc664('0x2b'),NOW)[_0xc664('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xc664('0xf')]()[_0xc664('0x10')]('phone')[_0xc664('0x12')]('cm_hopper_black')[_0xc664('0x14')](_0xc664('0x33'),_0x5554f2)[_0xc664('0x14')](_0x3ad6fb+_0xc664('0x34'),_0x1a7f3e+'.'+_0x3ad6fb)))['toString']();}function insertTzCmHopper(_0x21741c,_0x53aefe,_0x1827f6,_0x4e64a6,_0x19e8cc,_0x1b0d97){var _0x7b91d8=[_0xc664('0x17'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x1b0d97+'.offset-cm_contacts.utcOffset\x20minute)',_0xc664('0x19'),'cm_contacts.ListId',_0x53aefe+'.'+_0x4e64a6,_0xc664('0x1b'),_0xc664('0x1c'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x19e8cc+'\x22'];var _0xda683f=squel[_0xc664('0x2e')]()['into'](_0xc664('0x1f'))[_0xc664('0x20')]([_0xc664('0x11'),_0xc664('0x21'),_0xc664('0x22'),'ListId',_0x4e64a6,'createdAt',_0xc664('0x25'),_0xc664('0x26'),'UserId',_0xc664('0x35')],squel['select']()['fields'](_0x7b91d8)['from'](_0x53aefe)[_0xc664('0x13')](_0xc664('0x30'),null,'cm_contacts.ListId\x20=\x20'+_0x53aefe+'.CmListId')['join'](_0x1827f6,null,_0x1827f6+'.id\x20=\x20'+_0x53aefe+'.'+_0x4e64a6)[_0xc664('0x13')](_0x1b0d97,null,_0x1b0d97+'.id\x20=\x20'+_0x53aefe+'.'+_0x4e64a6)[_0xc664('0x14')](_0x53aefe+_0xc664('0x32'),_0x21741c)[_0xc664('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc664('0x14')](_0xc664('0x2c'),selectNotIn(_0x53aefe,_0x1827f6,_0x4e64a6,'cm_hopper',[_0xc664('0x2d'),_0xc664('0x36')]))[_0xc664('0x14')](_0xc664('0x2c'),selectNotIn(_0x53aefe,_0x1827f6,_0x4e64a6,_0xc664('0x1f'),[_0xc664('0x2d')])))[_0xc664('0x37')]();return _0xda683f;}function insertTzCmHopperBlack(_0x28ac66,_0x4cd1a4,_0x38e829,_0x30220d){var _0x20982e=['cm_contacts.phone',_0xc664('0x19'),_0xc664('0x1a'),_0x4cd1a4+'.'+_0x30220d,_0xc664('0x1b'),_0xc664('0x1c')];return squel[_0xc664('0x2e')]()[_0xc664('0x1e')](_0xc664('0x2f'))[_0xc664('0x20')]([_0xc664('0x11'),_0xc664('0x22'),_0xc664('0x23'),_0x30220d,_0xc664('0x24'),'updatedAt'],squel[_0xc664('0xf')]()['fields'](_0x20982e)[_0xc664('0x12')](_0x4cd1a4)[_0xc664('0x13')](_0xc664('0x30'),null,_0xc664('0x29')+_0x4cd1a4+'.CmListId')[_0xc664('0x13')](_0x38e829,null,_0x38e829+_0xc664('0x2a')+_0x4cd1a4+'.'+_0x30220d)[_0xc664('0x14')](_0x4cd1a4+_0xc664('0x32'),_0x28ac66)[_0xc664('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xc664('0x2c'),squel[_0xc664('0xf')]()[_0xc664('0x10')](_0xc664('0x11'))['from']('cm_hopper_black')[_0xc664('0x14')](_0xc664('0x33'),_0x28ac66)['where'](_0x30220d+_0xc664('0x34'),_0x4cd1a4+'.'+_0x30220d)))[_0xc664('0x37')]();}function insertCmContact(_0x41b63f,_0x240c21,_0x5e5d1b,_0x38080a){var _0x2f4bde=_['concat'](_[_0xc664('0x38')](_0x38080a),[_0xc664('0x23'),'CompanyId','createdAt','updatedAt']);return squel[_0xc664('0x2e')]()[_0xc664('0x1e')](_0xc664('0x30'))[_0xc664('0x20')](_0x2f4bde,squel[_0xc664('0xf')]()[_0xc664('0x28')](_0x2f4bde)[_0xc664('0x12')](_0x240c21)['where']('('+_0x5e5d1b[_0xc664('0x13')](',')+_0xc664('0x39'),squel[_0xc664('0xf')]()['fields'](_0x5e5d1b)[_0xc664('0x12')](_0xc664('0x30'))['where'](_0xc664('0x33'),_0x41b63f)[_0xc664('0x14')](_0xc664('0x3a')))[_0xc664('0x14')](_0xc664('0x3b'),squel[_0xc664('0xf')]()[_0xc664('0x10')]('MIN(id)','min_id')[_0xc664('0x12')](_0x240c21)[_0xc664('0x3c')](_0x5e5d1b[_0xc664('0x13')](','))))[_0xc664('0x37')]();}function handleStop(){logger[_0xc664('0x3d')](_0xc664('0x3e'));stopped=!![];}function handleUncaughtException(_0x28c208){logger[_0xc664('0x3f')](_0x28c208[_0xc664('0x40')]);process[_0xc664('0x41')](0x1);}function handleError(_0x138454,_0x1c665d){stats['errors'][_0xc664('0x42')]({'name':_0x1c665d[_0xc664('0x43')],'message':_0x1c665d['message'],'row':_0x138454});}function handleQuery(_0x3640b7){logger[_0xc664('0x3d')](_0x3640b7);return db[_0xc664('0x44')][_0xc664('0x45')](_0x3640b7)[_0xc664('0x46')](function(_0xf76ce4){results[_0xc664('0x42')](_0xf76ce4);})['catch'](function(_0x8acae){logger['error'](_0x8acae[_0xc664('0x40')]);});}function updateTzCampaigns(_0x855ea0){return new Promise(function(_0x89d5ce,_0x2b4108){var _0x400d0f=squel['select']()[_0xc664('0x28')](['campaigns.id','campaigns.dialTimezone'])['from'](_0xc664('0x47'))[_0xc664('0x13')](_0xc664('0x48'),null,_0xc664('0x49'))[_0xc664('0x14')](_0xc664('0x4a')+_0x855ea0);db[_0xc664('0x44')]['query'](_0x400d0f[_0xc664('0x37')]())[_0xc664('0x46')](function(_0xae0eb7){var _0x29a9bb=[];for(var _0x46540b=0x0;_0x46540b<_0xae0eb7[_0xc664('0x4b')];_0x46540b++){_0x29a9bb[_0xc664('0x42')](getTimezoneData(_0xae0eb7[_0x46540b],tmp_campaigns));}BPromise[_0xc664('0x4c')](_0x29a9bb)[_0xc664('0x4d')](function(){_0x89d5ce({'val':0x1});});})['catch'](function(_0x3cc0b1){logger['error'](_0x3cc0b1[_0xc664('0x40')]);_0x89d5ce({'val':0x0});});});}function updateTzVoiceQueues(_0x1e5778){return new Promise(function(_0x303147,_0x423b76){var _0x460be7=squel[_0xc664('0xf')]()[_0xc664('0x28')]([_0xc664('0x4e'),_0xc664('0x4f')])[_0xc664('0x12')](_0xc664('0x50'))[_0xc664('0x13')](_0xc664('0x51'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xc664('0x14')](_0xc664('0x52')+_0x1e5778);db['sequelize'][_0xc664('0x45')](_0x460be7[_0xc664('0x37')]())[_0xc664('0x46')](function(_0x21cc87){var _0x20693e=[];for(var _0xcf9a0b=0x0;_0xcf9a0b<_0x21cc87['length'];_0xcf9a0b++){_0x20693e[_0xc664('0x42')](getTimezoneData(_0x21cc87[_0xcf9a0b],tmp_voice_queues));}BPromise[_0xc664('0x4c')](_0x20693e)[_0xc664('0x4d')](function(){_0x303147({'val':0x1});});})[_0xc664('0x53')](function(_0x597a06){logger['error'](_0x597a06['message']);_0x303147({'val':0x0});});});}function getTimezoneData(_0x3b9f89,_0x3540be){return new Promise(function(_0xa98a40,_0x507176){var _0x25f7a9=shared['timezones'];var _0x501db5=_0x25f7a9[_0x3b9f89[_0xc664('0x54')]];if(_[_0xc664('0x55')](_0x501db5)){_0xa98a40({'ret':0x1});}else{var _0x2ce865=_0x501db5[_0xc664('0x56')];var _0x4e9573=squel[_0xc664('0x2e')]()[_0xc664('0x1e')](_0x3540be)[_0xc664('0x57')]('id',_0x3b9f89['id'])[_0xc664('0x57')]('offset',_0x2ce865)['set'](_0xc664('0x54'),_0x3b9f89[_0xc664('0x54')])[_0xc664('0x37')]();return db[_0xc664('0x44')][_0xc664('0x45')](_0x4e9573)['spread'](function(_0x11ccd5){_0xa98a40({'ret':0x1});})[_0xc664('0x53')](function(_0x46d662){logger[_0xc664('0x3f')](_0x46d662[_0xc664('0x40')]);_0x507176({'ret':0x1});});}});}function handleTZQuery(_0x1f26cc){logger[_0xc664('0x3d')](_0x1f26cc);return db[_0xc664('0x44')][_0xc664('0x45')](_0x1f26cc)[_0xc664('0x46')](function(_0x1c8d86){})[_0xc664('0x53')](function(_0x5293c5){logger[_0xc664('0x3f')](_0x5293c5['message']);});}function main(_0x1e5a45,_0x1e5368,_0x3c4dd0,_0x13efc7){logger[_0xc664('0x3d')](_0xc664('0x58'),_0x1e5a45,JSON[_0xc664('0x59')](_0x1e5368));process[_0xc664('0x5a')](_0xc664('0x5b'));var _0x1f9d73=_0x1e5368[_0xc664('0x5c')];var _0x3890cb=_0x1e5368['socket_timestamp'];var _0x4ec422=path['join'](config[_0xc664('0x5d')],_0xc664('0x5e'),_0x3890cb+_0xc664('0x5f'));hasTZ=_['keys'](_0x1f9d73)['includes'](_0xc664('0x54'));var _0x2d63dc=_[_0xc664('0x38')](_0x1f9d73)[_0xc664('0x13')]();logger[_0xc664('0x3d')](_0xc664('0x60'),_0x2d63dc);if(hasTZ)_0x2d63dc+=_0xc664('0x61');fs[_0xc664('0x62')](_0x4ec422,_0x2d63dc+'\x0a');Papa[_0xc664('0x63')](fs['createReadStream'](_0x1e5a45),{'header':!![],'skipEmptyLines':!![],'step':function(_0x237b50,_0x5d6c16){try{for(var _0x45559d=0x0,_0x159e71=[];_0x45559d<_0x237b50[_0xc664('0x64')][_0xc664('0x4b')];_0x45559d++){stats[_0xc664('0x65')]+=0x1;if(_0x237b50[_0xc664('0x66')][_0x45559d]){handleError(_0x237b50[_0xc664('0x64')][_0x45559d],_0x237b50[_0xc664('0x66')][_0x45559d]);}else{var _0x130d47=[];for(var _0x3044c9 in _0x1f9d73){if(_0x1f9d73[_0xc664('0x67')](_0x3044c9)){if(_0x237b50[_0xc664('0x64')][_0x45559d][_0x1f9d73[_0x3044c9]]){var _0x389cf4=_[_0xc664('0x68')](_0x237b50[_0xc664('0x64')][_0x45559d][_0x1f9d73[_0x3044c9]][_0xc664('0x69')](/"/g,'\x27'));switch(_0x3044c9){case _0xc664('0x21'):var _0x4b7583=moment(_0x389cf4,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4b7583[_0xc664('0x6a')]()){_0x159e71[_0xc664('0x42')]('\x22'+_0x389cf4+'\x22');}else{_0x130d47[_0xc664('0x42')](_0xc664('0x6b'));}break;case _0xc664('0x26'):var _0x3013bc=parseInt(_0x389cf4);_0x389cf4=_[_0xc664('0x6c')](_0x3013bc)||_0x3013bc<0x0||_0x3013bc>0x4?_0x13efc7?0x3:0x2:_0x3013bc;_0x159e71[_0xc664('0x42')]('\x22'+_0x389cf4+'\x22');break;case _0xc664('0x27'):var _0x32a80e=parseInt(_0x389cf4);if(_[_0xc664('0x6d')](_0x32a80e)&&_[_0xc664('0x6e')](_0x3c4dd0,_0x32a80e)){_0x159e71[_0xc664('0x42')]('\x22'+_0x32a80e+'\x22');}else{_0x130d47['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x389cf4)){_0x159e71[_0xc664('0x42')]('\x22'+_0x389cf4+'\x22');}else{_0x130d47['push'](_0xc664('0x6f'));}break;case _0xc664('0x70'):var _0x5a5ce9=moment(_0x389cf4,_0xc664('0x71'),!![]);if(_0x5a5ce9[_0xc664('0x6a')]()){_0x159e71['push']('\x22'+_0x389cf4+'\x22');}else{_0x130d47[_0xc664('0x42')](_0xc664('0x72'));}break;case _0xc664('0x54'):var _0x56557c=shared[_0xc664('0x73')];var _0x3c7b90=_0x56557c[_0x389cf4];if(!_[_0xc664('0x55')](_0x3c7b90)){var _0xa554f8=_0x3c7b90['utcOffset'];_0x159e71[_0xc664('0x42')]('\x22'+_0x389cf4+'\x22');_0x159e71[_0xc664('0x42')]('\x22'+_0xa554f8+'\x22');}break;default:_0x159e71['push']('\x22'+_0x389cf4+'\x22');}}else{switch(_0x3044c9){case _0xc664('0x74'):case _0xc664('0x11'):_0x130d47[_0xc664('0x42')](_0x3044c9+'\x20not\x20specified');break;default:_0x159e71['push']('\x22\x22');}}}}if(_0x130d47[_0xc664('0x4b')]){handleError(_0x237b50[_0xc664('0x64')][_0x45559d],{'code':_0xc664('0x75'),'message':_0x130d47[_0xc664('0x13')]()});}else{fs[_0xc664('0x76')](_0x4ec422,_0x159e71[_0xc664('0x13')]()+'\x0a');}_0x159e71=[];}if(!(stats[_0xc664('0x65')]%0xc8)){socket[_0xc664('0x77')](_0xc664('0x78')+_0x3890cb,stats);stats[_0xc664('0x66')]=[];}}if(stopped){logger[_0xc664('0x3d')](_0xc664('0x79'));_0x5d6c16[_0xc664('0x7a')]();}}catch(_0x293d3a){handleError(_0x237b50[_0xc664('0x64')][_0x45559d],{'code':_0xc664('0x7b'),'message':_0x293d3a[_0xc664('0x40')]});logger[_0xc664('0x3f')](_0xc664('0x7c'),_0x293d3a[_0xc664('0x40')]);}},'complete':function(){try{var _0x3b00ae=[];var _0x5cfd73=[];var _0x36a3cc=_0xc664('0x30');if(_0x1e5368[_0xc664('0x7d')]&&_0x1e5368[_0xc664('0x7d')][_0xc664('0x4b')]){_0x36a3cc=_0xc664('0x7e')+_0x3890cb;_0x3b00ae[_0xc664('0x42')](_0xc664('0x7f')+_0x36a3cc+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xc664('0x80')+_0x3890cb;tmp_voice_queues=_0xc664('0x81')+_0x3890cb;_0x5cfd73[_0xc664('0x42')](_0xc664('0x7f')+tmp_campaigns+_0xc664('0x82'));_0x5cfd73['push'](_0xc664('0x7f')+tmp_voice_queues+_0xc664('0x82'));BPromise[_0xc664('0x83')](_0x5cfd73,handleTZQuery)['then'](function(_0x359e77){updateTzCampaigns(_0x1e5368[_0xc664('0x23')])['then'](function(_0x3f1ed5){updateTzVoiceQueues(_0x1e5368[_0xc664('0x23')])[_0xc664('0x4d')](function(_0x297ac4){var _0x338e84=util[_0xc664('0xc')]('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',_0x4ec422,_0x36a3cc,_0x2d63dc,_0x1e5368['ListId'],_0x1e5368[_0xc664('0x84')]||null,NOW,NOW);if(_[_0xc664('0x55')](_0x1f9d73[_0xc664('0x21')])){_0x338e84+=',\x20scheduledAt\x20=\x20NOW()';}_0x3b00ae[_0xc664('0x42')](_0x338e84);if(_0x1e5368[_0xc664('0x7d')]&&_0x1e5368[_0xc664('0x7d')][_0xc664('0x4b')]){_0x3b00ae[_0xc664('0x42')](insertCmContact(_0x1e5368[_0xc664('0x23')],_0x36a3cc,_0x1e5368[_0xc664('0x7d')],_0x1f9d73));_0x3b00ae[_0xc664('0x42')](_0xc664('0x85')+_0x36a3cc+';');}if(hasTZ){_0x3b00ae[_0xc664('0x42')](insertTzCmHopper(_0x1e5368[_0xc664('0x23')],_0xc664('0x51'),_0xc664('0x50'),_0xc664('0x86'),_0x13efc7,tmp_voice_queues));_0x3b00ae[_0xc664('0x42')](insertTzCmHopperBlack(_0x1e5368[_0xc664('0x23')],_0xc664('0x87'),_0xc664('0x50'),_0xc664('0x86')));_0x3b00ae[_0xc664('0x42')](insertTzCmHopper(_0x1e5368[_0xc664('0x23')],_0xc664('0x48'),'campaigns',_0xc664('0x88'),_0x13efc7,tmp_campaigns));_0x3b00ae[_0xc664('0x42')](insertTzCmHopperBlack(_0x1e5368[_0xc664('0x23')],_0xc664('0x89'),'campaigns',_0xc664('0x88')));}else{_0x3b00ae[_0xc664('0x42')](insertCmHopper(_0x1e5368[_0xc664('0x23')],_0xc664('0x51'),_0xc664('0x50'),_0xc664('0x86'),_0x13efc7));_0x3b00ae[_0xc664('0x42')](insertCmHopperBlack(_0x1e5368[_0xc664('0x23')],_0xc664('0x87'),'voice_queues',_0xc664('0x86')));_0x3b00ae[_0xc664('0x42')](insertCmHopper(_0x1e5368[_0xc664('0x23')],'campaigns_has_cm_lists',_0xc664('0x47'),_0xc664('0x88'),_0x13efc7));_0x3b00ae['push'](insertCmHopperBlack(_0x1e5368[_0xc664('0x23')],_0xc664('0x89'),_0xc664('0x47'),_0xc664('0x88')));}_0x3b00ae[_0xc664('0x42')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x3b00ae[_0xc664('0x42')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xc664('0x83')](_0x3b00ae,handleQuery)['then'](function(_0x2f4416){stats[_0xc664('0x8a')]=!![];stats['affectedRows']=_0x1e5368['duplicates']&&_0x1e5368[_0xc664('0x7d')][_0xc664('0x4b')]?results[0x2]['affectedRows']:results[0x0][_0xc664('0x8b')];socket[_0xc664('0x77')](_0xc664('0x78')+_0x3890cb,stats);fs[_0xc664('0x8c')](_0x1e5a45);fs[_0xc664('0x8c')](_0x4ec422);process[_0xc664('0x41')](0x0);})[_0xc664('0x53')](function(_0x5ed975){logger[_0xc664('0x3f')](_0x5ed975[_0xc664('0x40')]);process[_0xc664('0x41')](0x1);});});});});}catch(_0x2e02ee){logger[_0xc664('0x3f')](_0xc664('0x8d'),_0x2e02ee[_0xc664('0x40')]);process[_0xc664('0x41')](0x1);}},'error':function(_0x360e27,_0x17ed79,_0x316acb,_0xa5d35f){throw new Error(_0xa5d35f);}});}function validate(){if(process[_0xc664('0x8e')]&&process[_0xc664('0x8e')][_0xc664('0x4b')]<0x4){throw new Error(_0xc664('0x8f'));}var _0x280f43=path[_0xc664('0x13')](config[_0xc664('0x5d')],'server/files/tmp',process['argv'][0x2]);if(!fs['existsSync'](_0x280f43)){throw new Error(_0xc664('0x90'));}var _0x36064a={};try{_0x36064a=JSON[_0xc664('0x63')](process[_0xc664('0x8e')][0x3]);if(!_0x36064a[_0xc664('0x5c')]){throw new Error(_0xc664('0x91'));}if(!_0x36064a[_0xc664('0x5c')][_0xc664('0x11')]){throw new Error(_0xc664('0x92'));}if(!_0x36064a['binding'][_0xc664('0x74')]){throw new Error(_0xc664('0x93'));}var _0xc4ea09=0x0;if(_0x36064a[_0xc664('0x5c')][_0xc664('0x27')]){_0xc4ea09=0x1;}if(!_0x36064a[_0xc664('0x23')]){throw new Error(_0xc664('0x94'));}}catch(_0x2b764a){throw new Error(_0xc664('0x95'));}var _0x3577b0=[];try{_0x3577b0=_[_0xc664('0x96')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x102485){logger['info'](_0xc664('0x97'));}main(_0x280f43,_0x36064a,_0x3577b0,_0xc4ea09);}validate();process['on'](_0xc664('0x98'),handleStop);process['on'](_0xc664('0x99'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index ae79684..1ea5bfe 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe274=['Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','queue','push','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0xe274,0x93));var _0x4e27=function(_0x4a459b,_0x38ca66){_0x4a459b=_0x4a459b-0x0;var _0x805b6e=_0xe274[_0x4a459b];return _0x805b6e;};'use strict';exports['getSubjects']=function(_0x4cde06,_0x44ae59){var _0x2ec431=[{'type':_0x4e27('0x0'),'content':_0x4e27('0x1'),'variableName':null}];switch(_0x4cde06[_0x4e27('0x2')]()){case _0x4e27('0x3'):switch(_0x44ae59['toLowerCase']()){case _0x4e27('0x4'):_0x2ec431['push']({'type':'variable','content':'','variableName':_0x4e27('0x5')});_0x2ec431[_0x4e27('0x6')]({'type':_0x4e27('0x7'),'content':'','variableName':_0x4e27('0x8')});break;case _0x4e27('0x9'):_0x2ec431[_0x4e27('0x6')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x2ec431[_0x4e27('0x6')]({'type':_0x4e27('0x7'),'content':'','variableName':_0x4e27('0xa')});break;}}return _0x2ec431;};exports[_0x4e27('0xb')]=function(_0x5d2b28,_0x1bf32f){var _0x25752e=[];switch(_0x5d2b28[_0x4e27('0x2')]()){case _0x4e27('0x3'):switch(_0x1bf32f[_0x4e27('0x2')]()){case _0x4e27('0x4'):_0x25752e=[{'type':_0x4e27('0x0'),'content':_0x4e27('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4e27('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0xf'),'keyType':'variable','variableName':_0x4e27('0x10')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x11'),'keyType':_0x4e27('0x7'),'variableName':'destexten'},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x12'),'keyType':_0x4e27('0x7'),'variableName':'queue'},{'type':_0x4e27('0xe'),'content':'','key':'UniqueId','keyType':_0x4e27('0x7'),'variableName':_0x4e27('0x13')},{'type':'keyValue','content':'','key':_0x4e27('0x14'),'keyType':_0x4e27('0x7'),'variableName':_0x4e27('0x15')},{'type':'string','content':_0x4e27('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x17'),'keyType':_0x4e27('0x7'),'variableName':_0x4e27('0xa')},{'type':_0x4e27('0x0'),'content':_0x4e27('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x4e27('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x4e27('0x7'),'variableName':'agentcalledAt'},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x19'),'keyType':_0x4e27('0x7'),'variableName':_0x4e27('0x1a')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x1b'),'keyType':_0x4e27('0x7'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x4e27('0x1c'),'keyType':_0x4e27('0x7'),'variableName':_0x4e27('0x1d')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x1e'),'keyType':_0x4e27('0x7'),'variableName':_0x4e27('0x1f')}];break;case'outbound':_0x25752e=[{'type':_0x4e27('0x0'),'content':_0x4e27('0xc'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0x4e27('0xa')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x20'),'keyType':'variable','keyContent':'','variableName':_0x4e27('0x21')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x22'),'keyType':_0x4e27('0x7'),'keyContent':'','variableName':_0x4e27('0x13')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x14'),'keyType':'variable','keyContent':'','variableName':_0x4e27('0x23')},{'type':_0x4e27('0x0'),'content':_0x4e27('0x18')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x24'),'keyType':_0x4e27('0x7'),'keyContent':'','variableName':_0x4e27('0x25')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x26'),'keyType':_0x4e27('0x7'),'keyContent':'','variableName':_0x4e27('0x27')},{'type':_0x4e27('0xe'),'content':'','key':_0x4e27('0x28'),'keyType':_0x4e27('0x7'),'keyContent':'','variableName':_0x4e27('0x29')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x4e27('0x7'),'keyContent':'','variableName':_0x4e27('0x2a')}];break;}}return _0x25752e;}; \ No newline at end of file +var _0x4e6f=['uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','holdtime','talktime','Called\x20Number','membername','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','toLowerCase','voice','inbound','queue','push','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','Caller\x20Number','variable','Call\x20To','destexten','keyValue','UniqueId'];(function(_0x219c51,_0x533bf7){var _0xe11cbf=function(_0x4ce0e4){while(--_0x4ce0e4){_0x219c51['push'](_0x219c51['shift']());}};_0xe11cbf(++_0x533bf7);}(_0x4e6f,0x161));var _0xf4e6=function(_0x22bc61,_0x4ac145){_0x22bc61=_0x22bc61-0x0;var _0x26a3a2=_0x4e6f[_0x22bc61];return _0x26a3a2;};'use strict';exports['getSubjects']=function(_0x728df0,_0x2c17b2){var _0x20f276=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x728df0[_0xf4e6('0x0')]()){case _0xf4e6('0x1'):switch(_0x2c17b2['toLowerCase']()){case _0xf4e6('0x2'):_0x20f276['push']({'type':'variable','content':'','variableName':_0xf4e6('0x3')});_0x20f276[_0xf4e6('0x4')]({'type':'variable','content':'','variableName':_0xf4e6('0x5')});break;case _0xf4e6('0x6'):_0x20f276[_0xf4e6('0x4')]({'type':_0xf4e6('0x7'),'content':_0xf4e6('0x8'),'variableName':null});_0x20f276['push']({'type':'variable','content':'','variableName':_0xf4e6('0x9')});break;}}return _0x20f276;};exports['getDescriptions']=function(_0x53c4c3,_0x5279cf){var _0x3725e3=[];switch(_0x53c4c3[_0xf4e6('0x0')]()){case _0xf4e6('0x1'):switch(_0x5279cf[_0xf4e6('0x0')]()){case _0xf4e6('0x2'):_0x3725e3=[{'type':'string','content':_0xf4e6('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf4e6('0xb'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x5')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0xf4e6('0xc'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xf4e6('0xd'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0xe')},{'type':_0xf4e6('0xf'),'content':'','key':'Queue','keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x3')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x10'),'keyType':'variable','variableName':_0xf4e6('0x11')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x12'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x13')},{'type':'string','content':_0xf4e6('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x15'),'keyType':_0xf4e6('0xc'),'variableName':'destcalleridname'},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x16'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x9')},{'type':_0xf4e6('0x7'),'content':_0xf4e6('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x18'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x13')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x19'),'keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x1a')},{'type':_0xf4e6('0xf'),'content':'','key':'Agent\x20Complete','keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x1b')},{'type':_0xf4e6('0xf'),'content':'','key':'Hold\x20Time','keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x1c')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xf4e6('0xc'),'variableName':_0xf4e6('0x1d')}];break;case _0xf4e6('0x6'):_0x3725e3=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x1e'),'keyType':_0xf4e6('0xc'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xf4e6('0xf'),'content':'','key':'Member\x20Name','keyType':_0xf4e6('0xc'),'keyContent':'','variableName':_0xf4e6('0x1f')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x10'),'keyType':_0xf4e6('0xc'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf4e6('0x12'),'keyType':_0xf4e6('0xc'),'keyContent':'','variableName':'starttime'},{'type':_0xf4e6('0x7'),'content':_0xf4e6('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xf4e6('0xc'),'keyContent':'','variableName':_0xf4e6('0x20')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x21'),'keyType':'variable','keyContent':'','variableName':_0xf4e6('0x22')},{'type':_0xf4e6('0xf'),'content':'','key':'Duration','keyType':_0xf4e6('0xc'),'keyContent':'','variableName':_0xf4e6('0x23')},{'type':_0xf4e6('0xf'),'content':'','key':_0xf4e6('0x24'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x3725e3;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 5d00bbc..d687a09 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x985c=['catch','error','user','query','body','html','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info'];(function(_0x2c7ace,_0x441ab2){var _0x2d7c7a=function(_0x52f534){while(--_0x52f534){_0x2c7ace['push'](_0x2c7ace['shift']());}};_0x2d7c7a(++_0x441ab2);}(_0x985c,0xe6));var _0xc985=function(_0x162636,_0x243aed){_0x162636=_0x162636-0x0;var _0x525c34=_0x985c[_0x162636];return _0x525c34;};'use strict';var _=require(_0xc985('0x0'));var db=require(_0xc985('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc985('0x2')),'mail':require(_0xc985('0x3'))(_0xc985('0x4')),'fax':require(_0xc985('0x3'))('fax-interactions'),'sms':require(_0xc985('0x3'))(_0xc985('0x5')),'chat':require(_0xc985('0x3'))(_0xc985('0x6')),'whatsapp':require('../../config/logger')(_0xc985('0x7'))};function getInteractionId(_0x498854,_0x30153a,_0x33259f){if(_0x498854&&_0x498854[_[_0xc985('0x8')](_0x33259f)+_0xc985('0x9')]){return _0x498854[_[_0xc985('0x8')](_0x33259f)+_0xc985('0x9')];}else if(_0x498854&&_0x498854['id']){return _0x498854['id'];}else if(_0x30153a&&_0x30153a['id']){return _0x30153a['id'];}else{return _0xc985('0xa');}}function log(_0x5e8204,_0x2fe5e6,_0x199d07,_0x2dfb3b,_0x41b1a3,_0x4777b8){loggers[_0x41b1a3[_0xc985('0xb')]()][_0x5e8204](_0xc985('0xc'),_0x4777b8['toUpperCase'](),_0x2fe5e6?_0x2fe5e6['id']:null,_0x2fe5e6?_0x2fe5e6[_0xc985('0xd')]:null,_0x2fe5e6?_0x2fe5e6[_0xc985('0xe')]:null,getInteractionId(_0x199d07,_0x2dfb3b,_0x41b1a3),_0x199d07?JSON[_0xc985('0xf')](_0x199d07):_0xc985('0x10'));}function updateUser(_0xd347b7,_0x519f77,_0x20801d,_0x4d8f85,_0x1fe66d){db[_[_0xc985('0x8')](_0x4d8f85)+_0xc985('0x11')][_0xc985('0x12')]({'where':{'id':getInteractionId(_0x519f77,_0x20801d,_0x4d8f85)}})[_0xc985('0x13')](function(_0x5751ad){if(_0x5751ad){return _0x5751ad[_0xc985('0x14')]({'UserId':_0xd347b7?_0xd347b7['id']:null});}})[_0xc985('0x13')](function(_0x26c7d6){if(_0x26c7d6){log(_0xc985('0x15'),_0xd347b7,_0x519f77,_0x20801d,_0x4d8f85,_0x1fe66d);}})[_0xc985('0x16')](function(){log(_0xc985('0x17'),_0xd347b7,_0x519f77,_0x20801d,_0x4d8f85,_0x1fe66d);});}exports['tracked']=function(_0x212c91,_0x59a97f){return function(_0x6b991f,_0x4d941b,_0x265def){var _0x2877c1=_0x6b991f[_0xc985('0x18')];var _0x67348a={};var _0x4526be=_0x6b991f[_0xc985('0x19')];if(_0x67348a){_0x67348a=_['clone'](_0x6b991f['body']);_0x67348a=_['omit'](_0x67348a,[_0xc985('0x1a'),_0xc985('0x1b'),'phone','fax','mobile']);}updateUser(_0x2877c1,_0x67348a,_0x4526be,_0x212c91,_0x59a97f);_0x265def(null);};}; \ No newline at end of file +var _0xf405=['name','stringify','null','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','omit','phone','fax','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase'];(function(_0x1fe0ee,_0x4026ab){var _0x5df8fc=function(_0x4b7493){while(--_0x4b7493){_0x1fe0ee['push'](_0x1fe0ee['shift']());}};_0x5df8fc(++_0x4026ab);}(_0xf405,0xbf));var _0x5f40=function(_0x3702c6,_0x5f510d){_0x3702c6=_0x3702c6-0x0;var _0x50250b=_0xf405[_0x3702c6];return _0x50250b;};'use strict';var _=require(_0x5f40('0x0'));var db=require(_0x5f40('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x5f40('0x2')),'mail':require(_0x5f40('0x3'))(_0x5f40('0x4')),'fax':require('../../config/logger')(_0x5f40('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')(_0x5f40('0x6')),'whatsapp':require(_0x5f40('0x3'))(_0x5f40('0x7'))};function getInteractionId(_0x523635,_0x2e1110,_0xa401eb){if(_0x523635&&_0x523635[_[_0x5f40('0x8')](_0xa401eb)+'InteractionId']){return _0x523635[_['upperFirst'](_0xa401eb)+'InteractionId'];}else if(_0x523635&&_0x523635['id']){return _0x523635['id'];}else if(_0x2e1110&&_0x2e1110['id']){return _0x2e1110['id'];}else{return _0x5f40('0x9');}}function log(_0x4ba8fd,_0x2d7b00,_0x1d6a64,_0x11bb11,_0x2eb6b8,_0x397995){loggers[_0x2eb6b8['toLowerCase']()][_0x4ba8fd](_0x5f40('0xa'),_0x397995[_0x5f40('0xb')](),_0x2d7b00?_0x2d7b00['id']:null,_0x2d7b00?_0x2d7b00[_0x5f40('0xc')]:null,_0x2d7b00?_0x2d7b00['role']:null,getInteractionId(_0x1d6a64,_0x11bb11,_0x2eb6b8),_0x1d6a64?JSON[_0x5f40('0xd')](_0x1d6a64):_0x5f40('0xe'));}function updateUser(_0x82c989,_0x8d86a3,_0x2a985b,_0x3de02e,_0x2c44af){db[_[_0x5f40('0x8')](_0x3de02e)+_0x5f40('0xf')][_0x5f40('0x10')]({'where':{'id':getInteractionId(_0x8d86a3,_0x2a985b,_0x3de02e)}})[_0x5f40('0x11')](function(_0x62db6){if(_0x62db6){return _0x62db6[_0x5f40('0x12')]({'UserId':_0x82c989?_0x82c989['id']:null});}})['then'](function(_0x509a3a){if(_0x509a3a){log(_0x5f40('0x13'),_0x82c989,_0x8d86a3,_0x2a985b,_0x3de02e,_0x2c44af);}})[_0x5f40('0x14')](function(){log(_0x5f40('0x15'),_0x82c989,_0x8d86a3,_0x2a985b,_0x3de02e,_0x2c44af);});}exports['tracked']=function(_0xb27539,_0x561cc2){return function(_0x55ba42,_0xe887b,_0x3f22c9){var _0x33ec2a=_0x55ba42[_0x5f40('0x16')];var _0x1ca3ad={};var _0x182de1=_0x55ba42[_0x5f40('0x17')];if(_0x1ca3ad){_0x1ca3ad=_[_0x5f40('0x18')](_0x55ba42[_0x5f40('0x19')]);_0x1ca3ad=_[_0x5f40('0x1a')](_0x1ca3ad,['body','html',_0x5f40('0x1b'),_0x5f40('0x1c'),'mobile']);}updateUser(_0x33ec2a,_0x1ca3ad,_0x182de1,_0xb27539,_0x561cc2);_0x3f22c9(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 920d3aa..4ffc02d 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 _0x9370=['utf8','final','use','License','then','count','status','json','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','update','base64'];(function(_0xc3f3bd,_0x20b7f5){var _0x27d0bd=function(_0x2d0977){while(--_0x2d0977){_0xc3f3bd['push'](_0xc3f3bd['shift']());}};_0x27d0bd(++_0x20b7f5);}(_0x9370,0x144));var _0x0937=function(_0x4f363e,_0x4c3120){_0x4f363e=_0x4f363e-0x0;var _0x2b6c5b=_0x9370[_0x4f363e];return _0x2b6c5b;};'use strict';var crypto=require(_0x0937('0x0'));var util=require(_0x0937('0x1'));var compose=require(_0x0937('0x2'));var db=require(_0x0937('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x427669,_0x213c1b){if(_0x427669&&_0x213c1b){if(_0x213c1b[_0x0937('0x4')]&&_0x213c1b[_0x0937('0x5')]){var _0x1d6c5f=_0x213c1b[_0x0937('0x4')];var _0x571b2a=_0x213c1b[_0x0937('0x5')];var _0x248886=_0x1d6c5f[_0x0937('0x6')]('-')[0x4];var _0x57aba5=_0x1d6c5f[_0x0937('0x6')]('-')[0x0];var _0x347d87=crypto[_0x0937('0x7')](_0x0937('0x8'),util[_0x0937('0x9')]('%s:%s:%s',_0x248886,_0x1d6c5f,_0x57aba5));var _0x361dea=_0x347d87[_0x0937('0xa')](_0x571b2a,_0x0937('0xb'),_0x0937('0xc'));_0x361dea+=_0x347d87[_0x0937('0xd')](_0x0937('0xc'));var _0x565f1d=JSON['parse'](_0x361dea);return _0x565f1d['hasOwnProperty'](_0x427669)?_0x565f1d[_0x427669]:null;}}return null;}function isLimit(_0x2db9e3,_0x392b90,_0x7f4c2e,_0x1d67ff){var _0x169bd8=_0x392b90;return compose()[_0x0937('0xe')](function(_0x95675b,_0x468773,_0x1b8fd5){return db[_0x0937('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x0937('0x10')](function(_0x5231ed){var _0x1c558e=getValueFromLicense(_0x2db9e3,_0x5231ed);return _0x1c558e?_0x1c558e:_0x169bd8;})['then'](function(_0x363ffa){_0x169bd8=_0x363ffa;return _0x7f4c2e[_0x0937('0x11')](_0x1d67ff);})[_0x0937('0x10')](function(_0x471787){if(_0x471787>=_0x169bd8){return _0x468773[_0x0937('0x12')](0x193)[_0x0937('0x13')]({'message':util[_0x0937('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2db9e3)});}_0x1b8fd5();})['catch'](function(_0x511984){_0x1b8fd5(_0x511984);});});}function isUserLimit(){return isLimit(_0x0937('0x14'),0x1,db[_0x0937('0x15')],{'where':{'$or':[{'role':_0x0937('0x16')},{'role':'user'}]}});}exports[_0x0937('0x17')]=isUserLimit; \ No newline at end of file +var _0x4b72=['../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware'];(function(_0x1f77d1,_0x701cb2){var _0x2e65f5=function(_0x32cf34){while(--_0x32cf34){_0x1f77d1['push'](_0x1f77d1['shift']());}};_0x2e65f5(++_0x701cb2);}(_0x4b72,0xac));var _0x24b7=function(_0x21d18d,_0x425532){_0x21d18d=_0x21d18d-0x0;var _0x2c971d=_0x4b72[_0x21d18d];return _0x2c971d;};'use strict';var crypto=require(_0x24b7('0x0'));var util=require('util');var compose=require(_0x24b7('0x1'));var db=require(_0x24b7('0x2'))['db'];var config=require(_0x24b7('0x3'));function getValueFromLicense(_0x50b68f,_0x9ae6fe){if(_0x50b68f&&_0x9ae6fe){if(_0x9ae6fe[_0x24b7('0x4')]&&_0x9ae6fe['license']){var _0x5187a4=_0x9ae6fe['data1'];var _0x573767=_0x9ae6fe[_0x24b7('0x5')];var _0x21af33=_0x5187a4['split']('-')[0x4];var _0x56d25d=_0x5187a4[_0x24b7('0x6')]('-')[0x0];var _0x265029=crypto['createDecipher'](_0x24b7('0x7'),util[_0x24b7('0x8')](_0x24b7('0x9'),_0x21af33,_0x5187a4,_0x56d25d));var _0x7ef06c=_0x265029[_0x24b7('0xa')](_0x573767,_0x24b7('0xb'),_0x24b7('0xc'));_0x7ef06c+=_0x265029[_0x24b7('0xd')](_0x24b7('0xc'));var _0x481082=JSON[_0x24b7('0xe')](_0x7ef06c);return _0x481082[_0x24b7('0xf')](_0x50b68f)?_0x481082[_0x50b68f]:null;}}return null;}function isLimit(_0x23ce9e,_0x2de993,_0x2a0691,_0x4d0f4b){var _0x4592b2=_0x2de993;return compose()[_0x24b7('0x10')](function(_0x52a3c9,_0x1e407b,_0x16d7b1){return db['License'][_0x24b7('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x47b05d){var _0x267a8b=getValueFromLicense(_0x23ce9e,_0x47b05d);return _0x267a8b?_0x267a8b:_0x4592b2;})['then'](function(_0x24ffff){_0x4592b2=_0x24ffff;return _0x2a0691[_0x24b7('0x12')](_0x4d0f4b);})[_0x24b7('0x13')](function(_0x4cd1ad){if(_0x4cd1ad>=_0x4592b2){return _0x1e407b[_0x24b7('0x14')](0x193)[_0x24b7('0x15')]({'message':util[_0x24b7('0x8')](_0x24b7('0x16'),_0x23ce9e)});}_0x16d7b1();})[_0x24b7('0x17')](function(_0x43484a){_0x16d7b1(_0x43484a);});});}function isUserLimit(){return isLimit(_0x24b7('0x18'),0x1,db[_0x24b7('0x19')],{'where':{'$or':[{'role':_0x24b7('0x1a')},{'role':_0x24b7('0x1b')}]}});}exports[_0x24b7('0x1c')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 94d39bf..9e2a6c9 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 _0x86c7=['replace','split','forEach','shift','match','filter','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','lodash','moment','[$or]','and'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x86c7,0xfb));var _0x786c=function(_0x1b11d8,_0x52565f){_0x1b11d8=_0x1b11d8-0x0;var _0x57ec5b=_0x86c7[_0x1b11d8];return _0x57ec5b;};'use strict';var _=require(_0x786c('0x0'));var moment=require(_0x786c('0x1'));exports['parseSearch']=function(_0x547f04){var _0x445463={'conditions':[]};_0x445463['sqlOperator']=_['startsWith'](_0x547f04,_0x786c('0x2'))?'or':_0x786c('0x3');var _0x451c29=_0x547f04[_0x786c('0x4')]('[$and]','')[_0x786c('0x4')]('[$or]','')[_0x786c('0x5')]('||');for(var _0x496af8=0x0;_0x496af8<_0x451c29['length'];_0x496af8++){var _0x357cd1=_0x451c29[_0x496af8][_0x786c('0x5')](':=');var _0x15aae2=_0x357cd1[0x0];var _0x2a04a1=_0x357cd1['slice'](0x1);_0x2a04a1[_0x786c('0x6')](function(_0x257246){var _0x3cda10=_0x257246['split']('[')[_0x786c('0x7')]();var _0x2126bf=_0x257246[_0x786c('0x8')](/\[(.*?)\]/g);_0x2126bf[_0x786c('0x6')](function(_0x11d997){var _0x3ecf10=_0x11d997[_0x786c('0x5')]('[')[_0x786c('0x9')](function(_0x2ae658){return _0x2ae658['indexOf'](']')>-0x1;})[_0x786c('0xa')](function(_0x4976ce){return _0x4976ce[_0x786c('0x5')](']')[0x0];})[0x0];_0x445463[_0x786c('0xb')]['push']({'field':_0x15aae2,'operator':_0x3cda10,'value':_0x3ecf10});});});}return _0x445463;};exports[_0x786c('0xc')]=function(_0x1b87fc,_0x336f85,_0x411a01){var _0x2737e7={};if(_0x336f85===_0x786c('0xd')){if(_0x411a01[_0x786c('0xe')]===_0x786c('0xf')){_0x411a01[_0x786c('0xe')]=_0x786c('0x10');_0x411a01[_0x786c('0x11')]+=','+_0x411a01[_0x786c('0x11')];}else if(_[_0x786c('0x12')]([_0x786c('0x13'),'$lte'],_0x411a01['operator'])){_0x411a01[_0x786c('0x11')]=moment(_0x411a01[_0x786c('0x11')])[_0x786c('0x14')](0x1,_0x786c('0x15'))[_0x786c('0x16')](_0x786c('0x17'));}}if(_0x411a01[_0x786c('0x18')]){_0x336f85=_0x411a01[_0x786c('0x18')];_0x2737e7[_0x786c('0x19')]=_0x786c('0x1a')+_0x1b87fc+'.'+_0x411a01[_0x786c('0x1b')]+_0x786c('0x1c')+_0x411a01[_0x786c('0x18')]+')\x20'+parseOperator(_0x411a01['operator']);}else{_0x2737e7[_0x786c('0x19')]=_0x1b87fc+'.'+_0x411a01[_0x786c('0x1b')]+'\x20'+parseOperator(_0x411a01[_0x786c('0xe')]);}if(_[_0x786c('0x12')]([_0x786c('0x1d'),'$notIn'],_0x411a01[_0x786c('0xe')]))_0x2737e7['text']='('+_0x2737e7[_0x786c('0x19')]+_0x786c('0x1e')+_0x1b87fc+'.'+_0x411a01['field']+_0x786c('0x1f');_0x2737e7[_0x786c('0x11')]=parseValue(_0x336f85,_0x411a01[_0x786c('0xe')],_0x411a01[_0x786c('0x11')]);return _0x2737e7;};function parseOperator(_0x2b1df3){var _0x128d33;switch(_0x2b1df3){case'$in':_0x128d33=_0x786c('0x20');break;case _0x786c('0x21'):_0x128d33=_0x786c('0x22');break;case'$eq':_0x128d33=_0x786c('0x23');break;case _0x786c('0x1d'):_0x128d33=_0x786c('0x24');break;case _0x786c('0x25'):case _0x786c('0x26'):case _0x786c('0x27'):_0x128d33=_0x786c('0x28');break;case'$lt':_0x128d33=_0x786c('0x29');break;case _0x786c('0x13'):_0x128d33=_0x786c('0x2a');break;case _0x786c('0x2b'):_0x128d33='<=\x20?';break;case _0x786c('0x2c'):_0x128d33='>=\x20?';break;case _0x786c('0x10'):_0x128d33=_0x786c('0x2d');break;}return _0x128d33;}function parseValue(_0x426f63,_0x24cdb9,_0x1a60ff){var _0xb2686d={'start':undefined,'end':undefined};switch(_0x24cdb9){case'$in':case _0x786c('0x21'):_0xb2686d[_0x786c('0x2e')]=_0x1a60ff[_0x786c('0x5')](',');break;case'$substring':_0xb2686d['start']='%'+_0x1a60ff+'%';break;case _0x786c('0x26'):_0xb2686d['start']=_0x1a60ff+'%';break;case _0x786c('0x27'):_0xb2686d[_0x786c('0x2e')]='%'+_0x1a60ff;break;case'$between':var _0x37daba=_0x1a60ff[_0x786c('0x5')](',');var _0x1a60ff=_0x37daba[_0x786c('0x7')]();var _0x4aaa40=_0x37daba[_0x786c('0x2f')]();if(_0x426f63===_0x786c('0xd')){_0x1a60ff=moment(_0x1a60ff)[_0x786c('0x30')](0x0,!![])[_0x786c('0x16')]();_0x4aaa40=moment(_0x4aaa40)[_0x786c('0x30')](0x0,!![])['add'](0x17,_0x786c('0x31'))[_0x786c('0x14')](0x3b,_0x786c('0x32'))[_0x786c('0x14')](0x3b,'seconds')[_0x786c('0x16')]();}_0xb2686d={'start':_0x1a60ff,'end':_0x4aaa40};break;default:_0xb2686d[_0x786c('0x2e')]=_0x1a60ff;break;}return _0xb2686d;} \ No newline at end of file +var _0x6e25=['\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','minutes','lodash','parseSearch','startsWith','[$or]','and','[$and]','split','length','shift','forEach','filter','indexOf','push','buildExpression','DATE','operator','$eq','value','includes','$gt','add','days','format','YYYY-MM-DD','text','field','\x20AS\x20','castTo','$notIn'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x6e25,0x17b));var _0x56e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6e25[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x56e2('0x0'));var moment=require('moment');exports[_0x56e2('0x1')]=function(_0x1de2db){var _0x426234={'conditions':[]};_0x426234['sqlOperator']=_[_0x56e2('0x2')](_0x1de2db,_0x56e2('0x3'))?'or':_0x56e2('0x4');var _0x4b4604=_0x1de2db['replace'](_0x56e2('0x5'),'')['replace'](_0x56e2('0x3'),'')[_0x56e2('0x6')]('||');for(var _0x5c09dc=0x0;_0x5c09dc<_0x4b4604[_0x56e2('0x7')];_0x5c09dc++){var _0x5a44f1=_0x4b4604[_0x5c09dc][_0x56e2('0x6')](':=');var _0x54a6c7=_0x5a44f1[0x0];var _0x3e538f=_0x5a44f1['slice'](0x1);_0x3e538f['forEach'](function(_0x4c5c41){var _0x58d7df=_0x4c5c41[_0x56e2('0x6')]('[')[_0x56e2('0x8')]();var _0x23b05d=_0x4c5c41['match'](/\[(.*?)\]/g);_0x23b05d[_0x56e2('0x9')](function(_0x165680){var _0x2c7b8a=_0x165680[_0x56e2('0x6')]('[')[_0x56e2('0xa')](function(_0x23aa6c){return _0x23aa6c[_0x56e2('0xb')](']')>-0x1;})['map'](function(_0x4483df){return _0x4483df[_0x56e2('0x6')](']')[0x0];})[0x0];_0x426234['conditions'][_0x56e2('0xc')]({'field':_0x54a6c7,'operator':_0x58d7df,'value':_0x2c7b8a});});});}return _0x426234;};exports[_0x56e2('0xd')]=function(_0x26a7a4,_0x35c773,_0x7291fe){var _0x357938={};if(_0x35c773===_0x56e2('0xe')){if(_0x7291fe[_0x56e2('0xf')]===_0x56e2('0x10')){_0x7291fe[_0x56e2('0xf')]='$between';_0x7291fe[_0x56e2('0x11')]+=','+_0x7291fe[_0x56e2('0x11')];}else if(_[_0x56e2('0x12')]([_0x56e2('0x13'),'$lte'],_0x7291fe[_0x56e2('0xf')])){_0x7291fe[_0x56e2('0x11')]=moment(_0x7291fe[_0x56e2('0x11')])[_0x56e2('0x14')](0x1,_0x56e2('0x15'))[_0x56e2('0x16')](_0x56e2('0x17'));}}if(_0x7291fe['castTo']){_0x35c773=_0x7291fe['castTo'];_0x357938[_0x56e2('0x18')]='CAST('+_0x26a7a4+'.'+_0x7291fe[_0x56e2('0x19')]+_0x56e2('0x1a')+_0x7291fe[_0x56e2('0x1b')]+')\x20'+parseOperator(_0x7291fe[_0x56e2('0xf')]);}else{_0x357938[_0x56e2('0x18')]=_0x26a7a4+'.'+_0x7291fe[_0x56e2('0x19')]+'\x20'+parseOperator(_0x7291fe[_0x56e2('0xf')]);}if(_[_0x56e2('0x12')](['$ne',_0x56e2('0x1c')],_0x7291fe[_0x56e2('0xf')]))_0x357938[_0x56e2('0x18')]='('+_0x357938[_0x56e2('0x18')]+'\x20OR\x20'+_0x26a7a4+'.'+_0x7291fe['field']+_0x56e2('0x1d');_0x357938[_0x56e2('0x11')]=parseValue(_0x35c773,_0x7291fe[_0x56e2('0xf')],_0x7291fe[_0x56e2('0x11')]);return _0x357938;};function parseOperator(_0x4b58fb){var _0x5e4a37;switch(_0x4b58fb){case'$in':_0x5e4a37=_0x56e2('0x1e');break;case _0x56e2('0x1c'):_0x5e4a37=_0x56e2('0x1f');break;case _0x56e2('0x10'):_0x5e4a37=_0x56e2('0x20');break;case'$ne':_0x5e4a37=_0x56e2('0x21');break;case _0x56e2('0x22'):case _0x56e2('0x23'):case _0x56e2('0x24'):_0x5e4a37=_0x56e2('0x25');break;case _0x56e2('0x26'):_0x5e4a37=_0x56e2('0x27');break;case'$gt':_0x5e4a37=_0x56e2('0x28');break;case _0x56e2('0x29'):_0x5e4a37=_0x56e2('0x2a');break;case'$gte':_0x5e4a37='>=\x20?';break;case _0x56e2('0x2b'):_0x5e4a37=_0x56e2('0x2c');break;}return _0x5e4a37;}function parseValue(_0x56f7a6,_0x17c71a,_0x16266a){var _0x5bcba7={'start':undefined,'end':undefined};switch(_0x17c71a){case _0x56e2('0x2d'):case _0x56e2('0x1c'):_0x5bcba7[_0x56e2('0x2e')]=_0x16266a[_0x56e2('0x6')](',');break;case _0x56e2('0x22'):_0x5bcba7[_0x56e2('0x2e')]='%'+_0x16266a+'%';break;case _0x56e2('0x23'):_0x5bcba7[_0x56e2('0x2e')]=_0x16266a+'%';break;case _0x56e2('0x24'):_0x5bcba7['start']='%'+_0x16266a;break;case _0x56e2('0x2b'):var _0x140394=_0x16266a['split'](',');var _0x16266a=_0x140394[_0x56e2('0x8')]();var _0xfce2ff=_0x140394[_0x56e2('0x2f')]();if(_0x56f7a6===_0x56e2('0xe')){_0x16266a=moment(_0x16266a)[_0x56e2('0x30')](0x0,!![])[_0x56e2('0x16')]();_0xfce2ff=moment(_0xfce2ff)[_0x56e2('0x30')](0x0,!![])[_0x56e2('0x14')](0x17,_0x56e2('0x31'))[_0x56e2('0x14')](0x3b,_0x56e2('0x32'))['add'](0x3b,'seconds')['format']();}_0x5bcba7={'start':_0x16266a,'end':_0xfce2ff};break;default:_0x5bcba7['start']=_0x16266a;break;}return _0x5bcba7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index f52c7e3..541f100 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 _0xc3b5=['split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','map','indexOf','col','priority','substr','cast','ASC','omit','isObject','isString','length','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','where','pick','filter','object','columns','value','merge','lower','options','moment','parse','keys','includes','fields'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x32585e,_0x3604ce){_0x32585e=_0x32585e-0x0;var _0x3b17aa=_0xc3b5[_0x32585e];return _0x3b17aa;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x5c3b('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3c588d){var _0xbe95d4=['ne'];try{var _0x3acf12=JSON[_0x5c3b('0x1')](_0x3c588d);var _0x34be81=Object[_0x5c3b('0x2')](_0x3acf12)[0x0];return _0xbe95d4[_0x5c3b('0x3')](_0x34be81);}catch(_0x587055){return![];}}function getOperatorValue(_0x181e5b){var _0x6b8a1e=JSON['parse'](_0x181e5b);var _0x568a28=Object[_0x5c3b('0x2')](_0x6b8a1e)[0x0];var _0x420839=_0x6b8a1e[_0x568a28];return{['$'+_0x568a28]:_0x420839};}exports[_0x5c3b('0x4')]=function(_0x5be9ee){var _0x1c68a5=null;if(_0x5be9ee){_0x1c68a5=_0x5be9ee[_0x5c3b('0x5')](',');}return _0x1c68a5;};exports[_0x5c3b('0x6')]=function(_0x20e71,_0x4ddddd){var _0x20dd86={};if(!_[_0x5c3b('0x7')](_0x20e71)){_[_0x5c3b('0x8')](_0x20e71,function(_0x2e894a,_0x363c3d){try{if(_0x4ddddd){var _0x5b9f7e=_[_0x5c3b('0x9')](_0x4ddddd,{'name':_0x363c3d})||{};if(hasSequelizeOperator(_0x2e894a)){_0x20dd86[_0x363c3d]=getOperatorValue(_0x2e894a);}else if(_0x5b9f7e[_0x5c3b('0xa')]==='DATE'&&_[_0x5c3b('0xb')](_0x2e894a)){var _0x3b953d=JSON['parse'](_0x2e894a);var _0x24b9d0={'$gte':moment(moment(_0x3b953d[_0x5c3b('0xc')])[_0x5c3b('0xd')](_0x5c3b('0xe')))[_0x5c3b('0xf')]()[_0x5c3b('0xd')](),'$lte':moment(moment(_0x3b953d[_0x5c3b('0x10')])['format'](_0x5c3b('0xe')))['utc']()['subtract'](0x1,'s')[_0x5c3b('0xd')]()};_0x20dd86[_0x363c3d]=_0x24b9d0;}else if(_0x5b9f7e[_0x5c3b('0x11')]===_0x5c3b('0x12')){_0x20dd86[_0x363c3d]=_0x2e894a;}else{_0x20dd86[_0x363c3d]=_['isArray'](_0x2e894a)?_0x2e894a:JSON[_0x5c3b('0x1')](_0x2e894a);}}else{_0x20dd86[_0x363c3d]=_[_0x5c3b('0x13')](_0x2e894a)?_0x2e894a:JSON[_0x5c3b('0x1')](_0x2e894a);}}catch(_0x59f71b){_0x20dd86[_0x363c3d]=_0x2e894a[_0x5c3b('0x5')](',');}});}return _0x20dd86;};exports[_0x5c3b('0x14')]=function(_0x48d662){_0x48d662=parseInt(_0x48d662,0xa);if(!_0x48d662||_0x48d662<0x0){_0x48d662=LIMIT_VALUE;}return _0x48d662;};exports[_0x5c3b('0x15')]=function(_0x4658ce){_0x4658ce=parseInt(_0x4658ce,0xa);if(!_0x4658ce||_0x4658ce<0x0){_0x4658ce=0x0;}return _0x4658ce;};exports[_0x5c3b('0x16')]=function(_0x681ac1){var _0x103943,_0x3e6d67=null;if(_0x681ac1){_0x103943=_0x681ac1[_0x5c3b('0x5')](',');_0x3e6d67=_[_0x5c3b('0x17')](_0x103943,function(_0xc63307){if(_0xc63307[_0x5c3b('0x18')]('-')===0x0){return[_0xc63307==='priority'?sequelize['cast'](sequelize[_0x5c3b('0x19')](_0x5c3b('0x1a')),'unsigned'):_0xc63307[_0x5c3b('0x1b')](0x1),'DESC'];}else{return[_0xc63307===_0x5c3b('0x1a')?sequelize[_0x5c3b('0x1c')](sequelize[_0x5c3b('0x19')](_0x5c3b('0x1a')),'unsigned'):_0xc63307,_0x5c3b('0x1d')];}});}return _0x3e6d67;};exports[_0x5c3b('0x1e')]=function(_0x54ab06,_0x17f86d){if(_[_0x5c3b('0x7')](_0x54ab06)){return _0x54ab06;}if(_[_0x5c3b('0x13')](_0x54ab06)){for(var _0x3c3991=0x0;_0x3c3991<_0x54ab06['length'];_0x3c3991+=0x1){_0x54ab06[_0x3c3991]=this[_0x5c3b('0x1e')](_0x54ab06[_0x3c3991],_0x17f86d);}return _0x54ab06;}if(!_[_0x5c3b('0x1f')](_0x54ab06)){return _0x54ab06;}if(_[_0x5c3b('0x20')](_0x17f86d)){_0x17f86d=[_0x17f86d];}if(!_[_0x5c3b('0x13')](_0x17f86d)){return _0x54ab06;}for(var _0x28dfbc=0x0;_0x28dfbc<_0x17f86d[_0x5c3b('0x21')];_0x28dfbc+=0x1){_['unset'](_0x54ab06,_0x17f86d[_0x28dfbc]);}for(var _0x51fa32 in _0x54ab06){if(_0x54ab06['hasOwnProperty'](_0x51fa32)){_0x54ab06[_0x51fa32]=this[_0x5c3b('0x1e')](_0x54ab06[_0x51fa32],_0x17f86d);}}return _0x54ab06;};exports[_0x5c3b('0x22')]=function(_0x59b640){return _0x59b640[_0x5c3b('0x23')](RegExp(_0x5c3b('0x24')))?!![]:![];};exports[_0x5c3b('0x25')]=function(_0x2a26df){return _0x2a26df[_0x5c3b('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x5c3b('0x26')]=function(_0x356f46){var _0x292266=[];_0x356f46[_0x5c3b('0x5')](/[ ,]+/)[_0x5c3b('0x27')](function(_0x4765b3){_0x4765b3=_0x4765b3[_0x5c3b('0x28')](/([^:]")"+/g,'$1');_0x4765b3='+'+_0x4765b3+'*';var _0x5a5d9e=/[ `!@#$%^&*()_\-?~]/;if(_0x4765b3[_0x5c3b('0x23')](_0x5a5d9e))_0x4765b3='\x22'+_0x4765b3+'\x22';_0x292266[_0x5c3b('0x29')](_0x4765b3);});return _0x292266[_0x5c3b('0x2a')]('\x20');};exports[_0x5c3b('0x2b')]=function(_0x23e55f,_0x11230d,_0x3e58e4){var _0x2e2b9c={},_0x33d104={};if(_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x2d')]){_0x11230d[_0x5c3b('0x2c')]['id']=_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x2d')];delete _0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x2d')];}_0x2e2b9c[_0x5c3b('0x2e')]=_['map'](_0x23e55f,_0x5c3b('0x11'));_0x2e2b9c[_0x5c3b('0x2c')]=_[_0x5c3b('0x2')](_0x11230d[_0x5c3b('0x2c')]);_0x2e2b9c['filters']=_[_0x5c3b('0x2f')](_0x2e2b9c[_0x5c3b('0x2e')],_0x2e2b9c['query']);_0x33d104[_0x5c3b('0x30')]=_[_0x5c3b('0x2f')](_0x2e2b9c[_0x5c3b('0x2e')],this[_0x5c3b('0x4')](_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x4')]));_0x33d104[_0x5c3b('0x30')]=_0x33d104[_0x5c3b('0x30')][_0x5c3b('0x21')]?_0x33d104['attributes']:_0x2e2b9c[_0x5c3b('0x2e')];if(!_0x11230d[_0x5c3b('0x2c')]['hasOwnProperty']('nolimit')){_0x33d104[_0x5c3b('0x14')]=this[_0x5c3b('0x14')](_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x14')]);_0x33d104[_0x5c3b('0x15')]=this[_0x5c3b('0x15')](_0x11230d[_0x5c3b('0x2c')]['offset']);}_0x33d104['order']=this[_0x5c3b('0x16')](_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x16')]);_0x33d104[_0x5c3b('0x31')]=this['filters'](_[_0x5c3b('0x32')](_0x11230d['query'],_0x2e2b9c[_0x5c3b('0x6')]),_0x23e55f);if(_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x33')]){var _0xea3ae1=_0x23e55f;var _0x2caa63=_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x33')];if(typeof _0x2caa63===_0x5c3b('0x34')){_0xea3ae1=_[_0x5c3b('0x33')](_0x23e55f,function(_0x546827){return _['includes'](_0x2caa63[_0x5c3b('0x35')],_0x546827[_0x5c3b('0x11')]);});_0x2caa63=_0x2caa63[_0x5c3b('0x36')];}_0x33d104[_0x5c3b('0x31')]=_[_0x5c3b('0x37')](_0x33d104[_0x5c3b('0x31')],{'$or':_[_0x5c3b('0x17')](_0xea3ae1,function(_0x1d9427){if(_0x1d9427[_0x5c3b('0xa')]!=='VIRTUAL'){if(_0x3e58e4){return sequelize[_0x5c3b('0x31')](sequelize['fn'](_0x5c3b('0x38'),sequelize[_0x5c3b('0x19')](_0x1d9427['name'])),{'$like':sequelize['fn'](_0x5c3b('0x38'),'%'+_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x33')]+'%')});}else{var _0x5addf6={};_0x5addf6[_0x1d9427[_0x5c3b('0x11')]]={'$like':'%'+_0x11230d[_0x5c3b('0x2c')][_0x5c3b('0x33')]+'%'};return _0x5addf6;}}})});}_0x33d104=_[_0x5c3b('0x37')]({},_0x33d104,_0x11230d[_0x5c3b('0x39')]);return _0x33d104;}; \ No newline at end of file +var _0x81bd=['lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','isPlainObject','format','utc','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','unsigned','DESC','col','ASC','omit','length','isObject','isString','unset','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','join','getOptions','query','$id','map','name','intersection','model','attributes','nolimit','where','pick','filter','object','columns','value','merge','VIRTUAL'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x81bd,0x7c));var _0xd81b=function(_0x26b5af,_0x38291e){_0x26b5af=_0x26b5af-0x0;var _0x13dad4=_0x81bd[_0x26b5af];return _0x13dad4;};'use strict';var _=require(_0xd81b('0x0'));var sequelize=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2337b1){var _0x2d27cb=['ne'];try{var _0x2ec03a=JSON[_0xd81b('0x3')](_0x2337b1);var _0x54e096=Object[_0xd81b('0x4')](_0x2ec03a)[0x0];return _0x2d27cb[_0xd81b('0x5')](_0x54e096);}catch(_0x1b6cfe){return![];}}function getOperatorValue(_0x4d8e7e){var _0x42a0aa=JSON[_0xd81b('0x3')](_0x4d8e7e);var _0x1f3f2c=Object['keys'](_0x42a0aa)[0x0];var _0x5e14e8=_0x42a0aa[_0x1f3f2c];return{['$'+_0x1f3f2c]:_0x5e14e8};}exports[_0xd81b('0x6')]=function(_0x5468d5){var _0x223515=null;if(_0x5468d5){_0x223515=_0x5468d5[_0xd81b('0x7')](',');}return _0x223515;};exports[_0xd81b('0x8')]=function(_0x86dab6,_0x17fba4){var _0x1ff60f={};if(!_[_0xd81b('0x9')](_0x86dab6)){_[_0xd81b('0xa')](_0x86dab6,function(_0x2090e1,_0x23c789){try{if(_0x17fba4){var _0x215b92=_[_0xd81b('0xb')](_0x17fba4,{'name':_0x23c789})||{};if(hasSequelizeOperator(_0x2090e1)){_0x1ff60f[_0x23c789]=getOperatorValue(_0x2090e1);}else if(_0x215b92[_0xd81b('0xc')]==='DATE'&&_[_0xd81b('0xd')](_0x2090e1)){var _0x57f71d=JSON[_0xd81b('0x3')](_0x2090e1);var _0xe75568={'$gte':moment(moment(_0x57f71d['$gte'])[_0xd81b('0xe')]('YYYY-MM-DD'))[_0xd81b('0xf')]()[_0xd81b('0xe')](),'$lte':moment(moment(_0x57f71d[_0xd81b('0x10')])[_0xd81b('0xe')](_0xd81b('0x11')))['utc']()[_0xd81b('0x12')](0x1,'s')[_0xd81b('0xe')]()};_0x1ff60f[_0x23c789]=_0xe75568;}else if(_0x215b92['name']===_0xd81b('0x13')){_0x1ff60f[_0x23c789]=_0x2090e1;}else{_0x1ff60f[_0x23c789]=_[_0xd81b('0x14')](_0x2090e1)?_0x2090e1:JSON[_0xd81b('0x3')](_0x2090e1);}}else{_0x1ff60f[_0x23c789]=_[_0xd81b('0x14')](_0x2090e1)?_0x2090e1:JSON[_0xd81b('0x3')](_0x2090e1);}}catch(_0xc49b8d){_0x1ff60f[_0x23c789]=_0x2090e1[_0xd81b('0x7')](',');}});}return _0x1ff60f;};exports[_0xd81b('0x15')]=function(_0x1c34c5){_0x1c34c5=parseInt(_0x1c34c5,0xa);if(!_0x1c34c5||_0x1c34c5<0x0){_0x1c34c5=LIMIT_VALUE;}return _0x1c34c5;};exports[_0xd81b('0x16')]=function(_0x1ff3c6){_0x1ff3c6=parseInt(_0x1ff3c6,0xa);if(!_0x1ff3c6||_0x1ff3c6<0x0){_0x1ff3c6=0x0;}return _0x1ff3c6;};exports[_0xd81b('0x17')]=function(_0xfa27e0){var _0x3518f0,_0x156894=null;if(_0xfa27e0){_0x3518f0=_0xfa27e0[_0xd81b('0x7')](',');_0x156894=_['map'](_0x3518f0,function(_0x4d566e){if(_0x4d566e[_0xd81b('0x18')]('-')===0x0){return[_0x4d566e===_0xd81b('0x19')?sequelize[_0xd81b('0x1a')](sequelize['col'](_0xd81b('0x19')),_0xd81b('0x1b')):_0x4d566e['substr'](0x1),_0xd81b('0x1c')];}else{return[_0x4d566e===_0xd81b('0x19')?sequelize[_0xd81b('0x1a')](sequelize[_0xd81b('0x1d')](_0xd81b('0x19')),_0xd81b('0x1b')):_0x4d566e,_0xd81b('0x1e')];}});}return _0x156894;};exports[_0xd81b('0x1f')]=function(_0x341aec,_0x212c4e){if(_[_0xd81b('0x9')](_0x341aec)){return _0x341aec;}if(_[_0xd81b('0x14')](_0x341aec)){for(var _0x596389=0x0;_0x596389<_0x341aec[_0xd81b('0x20')];_0x596389+=0x1){_0x341aec[_0x596389]=this[_0xd81b('0x1f')](_0x341aec[_0x596389],_0x212c4e);}return _0x341aec;}if(!_[_0xd81b('0x21')](_0x341aec)){return _0x341aec;}if(_[_0xd81b('0x22')](_0x212c4e)){_0x212c4e=[_0x212c4e];}if(!_[_0xd81b('0x14')](_0x212c4e)){return _0x341aec;}for(var _0x2d0d02=0x0;_0x2d0d02<_0x212c4e[_0xd81b('0x20')];_0x2d0d02+=0x1){_[_0xd81b('0x23')](_0x341aec,_0x212c4e[_0x2d0d02]);}for(var _0x10a561 in _0x341aec){if(_0x341aec['hasOwnProperty'](_0x10a561)){_0x341aec[_0x10a561]=this[_0xd81b('0x1f')](_0x341aec[_0x10a561],_0x212c4e);}}return _0x341aec;};exports['isNumeric']=function(_0x5c8aee){return _0x5c8aee[_0xd81b('0x24')](RegExp(_0xd81b('0x25')))?!![]:![];};exports['isEmail']=function(_0x481454){return _0x481454[_0xd81b('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xd81b('0x26')]=function(_0x1b1434){var _0x289f54=[];_0x1b1434[_0xd81b('0x7')](/[ ,]+/)[_0xd81b('0x27')](function(_0x5527ed){_0x5527ed=_0x5527ed[_0xd81b('0x28')](/([^:]")"+/g,'$1');_0x5527ed='+'+_0x5527ed+'*';var _0x26f629=/[ `!@#$%^&*()_\-?~]/;if(_0x5527ed['match'](_0x26f629))_0x5527ed='\x22'+_0x5527ed+'\x22';_0x289f54['push'](_0x5527ed);});return _0x289f54[_0xd81b('0x29')]('\x20');};exports[_0xd81b('0x2a')]=function(_0x50472a,_0x50ce25,_0x5317b2){var _0x322991={},_0x3ead68={};if(_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x2c')]){_0x50ce25[_0xd81b('0x2b')]['id']=_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x2c')];delete _0x50ce25['query'][_0xd81b('0x2c')];}_0x322991['model']=_[_0xd81b('0x2d')](_0x50472a,_0xd81b('0x2e'));_0x322991[_0xd81b('0x2b')]=_[_0xd81b('0x4')](_0x50ce25[_0xd81b('0x2b')]);_0x322991[_0xd81b('0x8')]=_[_0xd81b('0x2f')](_0x322991[_0xd81b('0x30')],_0x322991[_0xd81b('0x2b')]);_0x3ead68[_0xd81b('0x31')]=_[_0xd81b('0x2f')](_0x322991[_0xd81b('0x30')],this[_0xd81b('0x6')](_0x50ce25['query']['fields']));_0x3ead68[_0xd81b('0x31')]=_0x3ead68[_0xd81b('0x31')][_0xd81b('0x20')]?_0x3ead68['attributes']:_0x322991[_0xd81b('0x30')];if(!_0x50ce25[_0xd81b('0x2b')]['hasOwnProperty'](_0xd81b('0x32'))){_0x3ead68[_0xd81b('0x15')]=this['limit'](_0x50ce25[_0xd81b('0x2b')]['limit']);_0x3ead68[_0xd81b('0x16')]=this[_0xd81b('0x16')](_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x16')]);}_0x3ead68['order']=this[_0xd81b('0x17')](_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x17')]);_0x3ead68[_0xd81b('0x33')]=this[_0xd81b('0x8')](_[_0xd81b('0x34')](_0x50ce25[_0xd81b('0x2b')],_0x322991['filters']),_0x50472a);if(_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x35')]){var _0x5185fe=_0x50472a;var _0x5065a0=_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x35')];if(typeof _0x5065a0===_0xd81b('0x36')){_0x5185fe=_[_0xd81b('0x35')](_0x50472a,function(_0x29bddd){return _['includes'](_0x5065a0[_0xd81b('0x37')],_0x29bddd[_0xd81b('0x2e')]);});_0x5065a0=_0x5065a0[_0xd81b('0x38')];}_0x3ead68[_0xd81b('0x33')]=_[_0xd81b('0x39')](_0x3ead68[_0xd81b('0x33')],{'$or':_[_0xd81b('0x2d')](_0x5185fe,function(_0x486f0d){if(_0x486f0d[_0xd81b('0xc')]!==_0xd81b('0x3a')){if(_0x5317b2){return sequelize[_0xd81b('0x33')](sequelize['fn']('lower',sequelize[_0xd81b('0x1d')](_0x486f0d[_0xd81b('0x2e')])),{'$like':sequelize['fn'](_0xd81b('0x3b'),'%'+_0x50ce25[_0xd81b('0x2b')][_0xd81b('0x35')]+'%')});}else{var _0x194d2a={};_0x194d2a[_0x486f0d[_0xd81b('0x2e')]]={'$like':'%'+_0x50ce25[_0xd81b('0x2b')]['filter']+'%'};return _0x194d2a;}}})});}_0x3ead68=_['merge']({},_0x3ead68,_0x50ce25[_0xd81b('0x3c')]);return _0x3ead68;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6c7de52..4895834 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(_0x8f15dd,_0x1b132c){var _0x6a2868=function(_0x51da5f){while(--_0x51da5f){_0x8f15dd['push'](_0x8f15dd['shift']());}};_0x6a2868(++_0x1b132c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5b5ffe,_0xa8bf6e){var _0x4c2fb0=function(_0x48ca31){while(--_0x48ca31){_0x5b5ffe['push'](_0x5b5ffe['shift']());}};_0x4c2fb0(++_0xa8bf6e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9527fcf..e2d188b 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 _0x7191=['crypto','bimedia-machine-uuid','child_process','execSync','orderBy','length','filter','family','IPv4','internal','concat','head','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','createHash','md5','substring','lodash'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7191,0x1db));var _0x1719=function(_0x1eab07,_0x2676f5){_0x1eab07=_0x1eab07-0x0;var _0x588016=_0x7191[_0x1eab07];return _0x588016;};'use strict';var _=require(_0x1719('0x0'));var os=require('os');var crypto=require(_0x1719('0x1'));var machine=require(_0x1719('0x2'));var exec=require(_0x1719('0x3'))[_0x1719('0x4')];var config=require('../environment');function getInterfaces(){var _0x78af75=[];var _0x287833=os['networkInterfaces']();var _0x53d084=_[_0x1719('0x5')](_['keys'](_0x287833));for(var _0x2b604c=0x0;_0x2b604c<_0x53d084[_0x1719('0x6')];_0x2b604c++){var _0x1d94c8=_0x287833[_0x53d084[_0x2b604c]][_0x1719('0x7')](function(_0x232f7f){return _0x232f7f[_0x1719('0x8')]===_0x1719('0x9')&&_0x232f7f[_0x1719('0xa')]===![];});_0x78af75=_0x78af75[_0x1719('0xb')](_0x1d94c8);}return _0x78af75;}function getFirstInterface(){var _0x46b5ce=_[_0x1719('0xc')](getInterfaces());return{'macAddress':_0x46b5ce&&_0x46b5ce['mac']?_0x46b5ce['mac']:_0x1719('0xd'),'ipAddress':_0x46b5ce&&_0x46b5ce[_0x1719('0xe')]?_0x46b5ce[_0x1719('0xe')]:_0x1719('0xf')};}exports[_0x1719('0x10')]=getFirstInterface;function getCPUhash(){var _0x41eec8=_[_0x1719('0x5')](os[_0x1719('0x11')]()[_0x1719('0x12')](function(_0x253508){return _0x253508['model'];}))[_0x1719('0x13')](':');return crypto['createHash']('md5')[_0x1719('0x14')](_0x41eec8)[_0x1719('0x15')](_0x1719('0x16'));}exports[_0x1719('0x17')]=function(){var _0x1fd84d=os[_0x1719('0x18')]();var _0xc355d1=/[0-9a-f-]{36}/;if(config[_0x1719('0x19')]&&_0xc355d1['test'](config[_0x1719('0x19')])){return config[_0x1719('0x19')];}else if(_0x1fd84d===_0x1719('0x1a')){return exec(_0x1719('0x1b'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x24e2aa=getFirstInterface();var _0x2e574c=getCPUhash();var _0x28776e=_0x2e574c+'|'+os[_0x1719('0x1c')]()+'|'+_0x24e2aa[_0x1719('0x1d')]+'|'+_0x24e2aa[_0x1719('0x1e')];var _0x20b69a=crypto[_0x1719('0x1f')](_0x1719('0x20'))[_0x1719('0x14')](_0x28776e)[_0x1719('0x15')](_0x1719('0x16'));return _0x20b69a[_0x1719('0x21')](0x0,0x8)+'-'+_0x20b69a['substring'](0x8,0xc)+'-'+_0x20b69a[_0x1719('0x21')](0xc,0x10)+'-'+_0x20b69a[_0x1719('0x21')](0x10,0x14)+'-'+_0x20b69a[_0x1719('0x21')](0x14);}}; \ No newline at end of file +var _0x64f3=['hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','map','model','join','createHash','md5','update','digest'];(function(_0x26086f,_0x280866){var _0x2a5344=function(_0x39b6bc){while(--_0x39b6bc){_0x26086f['push'](_0x26086f['shift']());}};_0x2a5344(++_0x280866);}(_0x64f3,0xb5));var _0x364f=function(_0x53df8c,_0x43a253){_0x53df8c=_0x53df8c-0x0;var _0x2defaf=_0x64f3[_0x53df8c];return _0x2defaf;};'use strict';var _=require(_0x364f('0x0'));var os=require('os');var crypto=require(_0x364f('0x1'));var machine=require(_0x364f('0x2'));var exec=require(_0x364f('0x3'))['execSync'];var config=require(_0x364f('0x4'));function getInterfaces(){var _0xf9d5c=[];var _0xbb16d3=os[_0x364f('0x5')]();var _0x3f1332=_['orderBy'](_['keys'](_0xbb16d3));for(var _0x44282d=0x0;_0x44282d<_0x3f1332['length'];_0x44282d++){var _0x5aca04=_0xbb16d3[_0x3f1332[_0x44282d]][_0x364f('0x6')](function(_0x3acd59){return _0x3acd59[_0x364f('0x7')]===_0x364f('0x8')&&_0x3acd59[_0x364f('0x9')]===![];});_0xf9d5c=_0xf9d5c[_0x364f('0xa')](_0x5aca04);}return _0xf9d5c;}function getFirstInterface(){var _0x2e0777=_['head'](getInterfaces());return{'macAddress':_0x2e0777&&_0x2e0777[_0x364f('0xb')]?_0x2e0777[_0x364f('0xb')]:_0x364f('0xc'),'ipAddress':_0x2e0777&&_0x2e0777[_0x364f('0xd')]?_0x2e0777[_0x364f('0xd')]:_0x364f('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x48d817=_[_0x364f('0xf')](os['cpus']()[_0x364f('0x10')](function(_0x38548e){return _0x38548e[_0x364f('0x11')];}))[_0x364f('0x12')](':');return crypto[_0x364f('0x13')](_0x364f('0x14'))[_0x364f('0x15')](_0x48d817)[_0x364f('0x16')](_0x364f('0x17'));}exports[_0x364f('0x18')]=function(){var _0x572f4b=os[_0x364f('0x19')]();var _0x1ae887=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x1ae887['test'](config[_0x364f('0x1a')])){return config['licenseToken'];}else if(_0x572f4b===_0x364f('0x1b')){return exec(_0x364f('0x1c'),{'encoding':_0x364f('0x1d')})[_0x364f('0x1e')]('\x0d\x0a','');}else{var _0x27553a=getFirstInterface();var _0x33262d=getCPUhash();var _0x3899d3=_0x33262d+'|'+os[_0x364f('0x1f')]()+'|'+_0x27553a['macAddress']+'|'+_0x27553a[_0x364f('0x20')];var _0x4fde05=crypto[_0x364f('0x13')](_0x364f('0x14'))[_0x364f('0x15')](_0x3899d3)[_0x364f('0x16')](_0x364f('0x17'));return _0x4fde05[_0x364f('0x21')](0x0,0x8)+'-'+_0x4fde05[_0x364f('0x21')](0x8,0xc)+'-'+_0x4fde05[_0x364f('0x21')](0xc,0x10)+'-'+_0x4fde05['substring'](0x10,0x14)+'-'+_0x4fde05['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 37d5a48..e015657 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 _0xad68=['../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','catch','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','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','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','findOrCreate','spread','moment','pkginfo'];(function(_0x5cdba8,_0x2034c7){var _0x2a660c=function(_0x350ecd){while(--_0x350ecd){_0x5cdba8['push'](_0x5cdba8['shift']());}};_0x2a660c(++_0x2034c7);}(_0xad68,0x136));var _0x8ad6=function(_0xac15c3,_0x2451ea){_0xac15c3=_0xac15c3-0x0;var _0x3ef3db=_0xad68[_0xac15c3];return _0x3ef3db;};'use strict';var util=require('util');var moment=require(_0x8ad6('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x8ad6('0x1'))(module,'version');var db=require(_0x8ad6('0x2'))['db'];var encryptor=require(_0x8ad6('0x3'));var hardware=require(_0x8ad6('0x4'));var logger=require(_0x8ad6('0x5'))(_0x8ad6('0x6'));var HOST=_0x8ad6('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xe7830f){return new BPromise(function(_0x7d45b1,_0x22be1f){var _0xdb2e11=util[_0x8ad6('0x8')](_0x8ad6('0x9'),HOST,_0xe7830f,module[_0x8ad6('0xa')]['version']);if(oldToken){_0xdb2e11=util[_0x8ad6('0x8')](_0x8ad6('0xb'),HOST,_0xe7830f,module[_0x8ad6('0xa')][_0x8ad6('0xc')],oldToken);}var _0x26b19e={'uri':_0xdb2e11,'method':_0x8ad6('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x26b19e)['then'](function(_0xfebbfa){_0x7d45b1(_0xfebbfa);})[_0x8ad6('0xe')](function(_0x3c0ee7){_0x22be1f(_0x3c0ee7);});});}function manageLicense(_0x5b6d7d,_0x13b69e){var _0x423ddc=_0x13b69e['get']({'plain':!![]});if(!isOldTokenSent&&_0x423ddc[_0x8ad6('0xf')]!==_0x5b6d7d&&!_0x423ddc[_0x8ad6('0x10')]){oldToken=_0x423ddc[_0x8ad6('0xf')];}httpRequest(_0x5b6d7d)[_0x8ad6('0x11')](function(_0x2b90fd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b90fd[_0x8ad6('0x12')]){isOldTokenSent=![];if(!_0x423ddc['license']&&_0x423ddc['license']!=_0x2b90fd[_0x8ad6('0x6')]||_0x423ddc[_0x8ad6('0x6')]&&_0x423ddc[_0x8ad6('0x10')]){logger[_0x8ad6('0x13')](_0x8ad6('0x14'));}if(_0x423ddc['license']&&!_0x423ddc[_0x8ad6('0x10')]&&_0x423ddc[_0x8ad6('0x6')]!=_0x2b90fd[_0x8ad6('0x6')]){logger[_0x8ad6('0x13')](_0x8ad6('0x15'));}if(_0x423ddc[_0x8ad6('0x6')]&&!_0x423ddc[_0x8ad6('0x10')]&&_0x423ddc[_0x8ad6('0x6')]==_0x2b90fd[_0x8ad6('0x6')]){return _0x13b69e;}return _0x13b69e[_0x8ad6('0x16')]({'data1':_0x5b6d7d,'data2':null,'license':_0x2b90fd['license']});}else{if(_0x2b90fd[_0x8ad6('0x6')]||_0x423ddc['license']){if(!_0x423ddc[_0x8ad6('0x10')]){if(_0x423ddc['data1']==_0x5b6d7d){GRAY_PERIOD_REASON=_0x8ad6('0x17');logger[_0x8ad6('0x13')](_0x8ad6('0x18'));}else{GRAY_PERIOD_REASON=_0x8ad6('0x19');logger[_0x8ad6('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x423ddc['data1'],_0x5b6d7d);}logger[_0x8ad6('0x13')](_0x8ad6('0x1a'),GRAY_PERIOD_REASON[_0x8ad6('0x1b')](),moment()['format'](_0x8ad6('0x1c')));return _0x13b69e[_0x8ad6('0x16')]({'data2':encryptor[_0x8ad6('0x1d')](moment()[_0x8ad6('0x8')](_0x8ad6('0x1c')))});}else{if(moment()[_0x8ad6('0x1e')](encryptor[_0x8ad6('0x1f')](_0x423ddc['data2']),_0x8ad6('0x20'))>DAYS){logger[_0x8ad6('0x13')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x8ad6('0x1c')));isOldTokenSent=![];return _0x13b69e[_0x8ad6('0x16')]({'data1':_0x5b6d7d,'data2':null,'license':null});}}}else{if(_0x423ddc[_0x8ad6('0xf')]!=_0x5b6d7d){logger[_0x8ad6('0x13')](_0x8ad6('0x21'),_0x423ddc[_0x8ad6('0xf')],_0x5b6d7d);return _0x13b69e[_0x8ad6('0x16')]({'data1':_0x5b6d7d,'data2':null,'license':null});}}}return _0x13b69e;})['then'](function(_0x259913){_0x13b69e=_0x259913;})[_0x8ad6('0xe')](function(_0x158ba5){logger[_0x8ad6('0x22')](_0x158ba5[_0x8ad6('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x8ad6('0x24')](),_0x13b69e);},TIME);});}function defaultLicense(){var _0x197a51=hardware['getUuid']();if(_0x197a51){return db['License'][_0x8ad6('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x197a51}})[_0x8ad6('0x26')](function(_0x4363fc,_0x47456f){logger[_0x8ad6('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x197a51);manageLicense(_0x197a51,_0x4363fc);})[_0x8ad6('0xe')](function(_0x44d7b2){logger[_0x8ad6('0x22')](_0x44d7b2[_0x8ad6('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x7d70=['toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','catch','message','finally','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0x7d70,0xf9));var _0x07d7=function(_0xb6f6a1,_0x5b0920){_0xb6f6a1=_0xb6f6a1-0x0;var _0x5b91c5=_0x7d70[_0xb6f6a1];return _0x5b91c5;};'use strict';var util=require(_0x07d7('0x0'));var moment=require('moment');var rp=require(_0x07d7('0x1'));var BPromise=require(_0x07d7('0x2'));var pkginfo=require('pkginfo')(module,_0x07d7('0x3'));var db=require(_0x07d7('0x4'))['db'];var encryptor=require(_0x07d7('0x5'));var hardware=require(_0x07d7('0x6'));var logger=require('../logger')(_0x07d7('0x7'));var HOST=_0x07d7('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5169dd){return new BPromise(function(_0x2d9218,_0x26b3bd){var _0x149cea=util[_0x07d7('0x9')](_0x07d7('0xa'),HOST,_0x5169dd,module['exports'][_0x07d7('0x3')]);if(oldToken){_0x149cea=util[_0x07d7('0x9')](_0x07d7('0xb'),HOST,_0x5169dd,module[_0x07d7('0xc')][_0x07d7('0x3')],oldToken);}var _0x319dac={'uri':_0x149cea,'method':_0x07d7('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x319dac)[_0x07d7('0xe')](function(_0x28b1df){_0x2d9218(_0x28b1df);})['catch'](function(_0x45abf6){_0x26b3bd(_0x45abf6);});});}function manageLicense(_0x2d807c,_0x1c875c){var _0x270650=_0x1c875c[_0x07d7('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x270650['data1']!==_0x2d807c&&!_0x270650[_0x07d7('0x10')]){oldToken=_0x270650[_0x07d7('0x11')];}httpRequest(_0x2d807c)[_0x07d7('0xe')](function(_0x51139e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x51139e[_0x07d7('0x12')]){isOldTokenSent=![];if(!_0x270650[_0x07d7('0x7')]&&_0x270650[_0x07d7('0x7')]!=_0x51139e[_0x07d7('0x7')]||_0x270650['license']&&_0x270650[_0x07d7('0x10')]){logger[_0x07d7('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x270650[_0x07d7('0x7')]&&!_0x270650[_0x07d7('0x10')]&&_0x270650['license']!=_0x51139e[_0x07d7('0x7')]){logger[_0x07d7('0x13')](_0x07d7('0x14'));}if(_0x270650['license']&&!_0x270650[_0x07d7('0x10')]&&_0x270650[_0x07d7('0x7')]==_0x51139e[_0x07d7('0x7')]){return _0x1c875c;}return _0x1c875c['update']({'data1':_0x2d807c,'data2':null,'license':_0x51139e[_0x07d7('0x7')]});}else{if(_0x51139e[_0x07d7('0x7')]||_0x270650[_0x07d7('0x7')]){if(!_0x270650[_0x07d7('0x10')]){if(_0x270650['data1']==_0x2d807c){GRAY_PERIOD_REASON=_0x07d7('0x15');logger[_0x07d7('0x13')](_0x07d7('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x07d7('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x270650[_0x07d7('0x11')],_0x2d807c);}logger[_0x07d7('0x13')](_0x07d7('0x17'),GRAY_PERIOD_REASON[_0x07d7('0x18')](),moment()[_0x07d7('0x9')](_0x07d7('0x19')));return _0x1c875c[_0x07d7('0x1a')]({'data2':encryptor[_0x07d7('0x1b')](moment()[_0x07d7('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x07d7('0x1c')](encryptor[_0x07d7('0x1d')](_0x270650[_0x07d7('0x10')]),_0x07d7('0x1e'))>DAYS){logger[_0x07d7('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x07d7('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1c875c[_0x07d7('0x1a')]({'data1':_0x2d807c,'data2':null,'license':null});}}}else{if(_0x270650['data1']!=_0x2d807c){logger[_0x07d7('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x270650[_0x07d7('0x11')],_0x2d807c);return _0x1c875c[_0x07d7('0x1a')]({'data1':_0x2d807c,'data2':null,'license':null});}}}return _0x1c875c;})[_0x07d7('0xe')](function(_0x2b3e7c){_0x1c875c=_0x2b3e7c;})[_0x07d7('0x1f')](function(_0x2684d2){logger['error'](_0x2684d2[_0x07d7('0x20')]);})[_0x07d7('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1c875c);},TIME);});}function defaultLicense(){var _0x5291b3=hardware['getUuid']();if(_0x5291b3){return db[_0x07d7('0x22')][_0x07d7('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x5291b3}})['spread'](function(_0x35a009,_0x373ebb){logger[_0x07d7('0x13')](_0x07d7('0x24'),_0x5291b3);manageLicense(_0x5291b3,_0x35a009);})[_0x07d7('0x1f')](function(_0x360eff){logger[_0x07d7('0x25')](_0x360eff[_0x07d7('0x20')]);});}}exports[_0x07d7('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index dcb8910..e22f79b 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 _0x4278=['util','lodash','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','find','defaults','then','catch','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','getUuid','gray','deadline','days','grayReason','disabled','data1','message','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','count','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports'];(function(_0x4903cb,_0x4c6856){var _0x52638f=function(_0x202523){while(--_0x202523){_0x4903cb['push'](_0x4903cb['shift']());}};_0x52638f(++_0x4c6856);}(_0x4278,0x108));var _0x8427=function(_0x6d4ac2,_0x292555){_0x6d4ac2=_0x6d4ac2-0x0;var _0x59850c=_0x4278[_0x6d4ac2];return _0x59850c;};'use strict';var util=require(_0x8427('0x0'));var _=require(_0x8427('0x1'));var moment=require('moment');var BPromise=require(_0x8427('0x2'));var hardware=require(_0x8427('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x8427('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8427('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8427('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8427('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8427('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x50ed03){return new BPromise(function(_0x23f4c6,_0x5be81e){return db['License'][_0x8427('0x8')](_[_0x8427('0x9')](_0x50ed03,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1d690a){return checkLicense(_0x1d690a,null);})[_0x8427('0xa')](function(_0x28c0da){_0x23f4c6(_0x28c0da);return;})[_0x8427('0xb')](function(_0x471561){_0x5be81e(_0x471561);});});}function checkLicense(_0x3d35a9,_0xc8d1e){if(!_0x3d35a9){demoLicense['uuid']=_0x3d35a9['data1'];return demoLicense;}try{var _0xb89171=_0xc8d1e||_0x3d35a9[_0x8427('0xc')];if(_[_0x8427('0xd')](_0xb89171)){throw new Error(_0x8427('0xe'));}var _0x41a789=_0x3d35a9['data1'];var _0x3ab767=_0x3d35a9['data2'];var _0x352230=_0x41a789[_0x8427('0xf')]('-')[0x4];var _0x385f95=_0x41a789[_0x8427('0xf')]('-')[0x0];var _0x4ffd88=encryptor[_0x8427('0x10')](_0xb89171,util[_0x8427('0x11')](_0x8427('0x12'),_0x352230,_0x41a789,_0x385f95));var _0x5f4d43=JSON[_0x8427('0x13')](_0x4ffd88);_0x5f4d43['demo']=![];_0x5f4d43[_0x8427('0x14')]=_0x41a789;_0x5f4d43[_0x8427('0x15')]=hardware[_0x8427('0x16')]();if(_0x3ab767){var _0x2257f2=encryptor[_0x8427('0x10')](_0x3ab767);_0x5f4d43[_0x8427('0x17')]=_0x2257f2;_0x5f4d43[_0x8427('0x18')]=moment(_0x2257f2)['add'](0x7,_0x8427('0x19'))['format']();_0x5f4d43[_0x8427('0x1a')]=_0x5f4d43['uuid']!=_0x5f4d43['machineUuid']?'changed':_0x8427('0x1b');}return _0x5f4d43;}catch(_0x583c5e){breakingLicense[_0x8427('0x14')]=_0x3d35a9[_0x8427('0x1c')];breakingLicense[_0x8427('0x1d')]=_0x583c5e[_0x8427('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1777ef,_0x4680ef){getLicense()[_0x8427('0xa')](function(_0x22edb2){return db['User'][_0x8427('0x1e')]({'attributes':[_0x8427('0x1f'),[db[_0x8427('0x20')]['fn'](_0x8427('0x21'),db[_0x8427('0x20')][_0x8427('0x22')](_0x8427('0x1f'))),'count']],'group':_0x8427('0x1f'),'where':{'role':{'$or':[_0x8427('0x23'),_0x8427('0x24'),_0x8427('0x25')]}},'raw':!![]})[_0x8427('0xa')](function(_0x475a48){var _0x1f3625={'user':_0x22edb2[_0x8427('0x26')]||0x0,'telephone':_0x22edb2['telephones']||0x0};_0x475a48['forEach'](function(_0x25a488){var _0xadf305=_0x25a488[_0x8427('0x1f')]===_0x8427('0x23')?'user':_0x25a488[_0x8427('0x1f')];_0x1f3625[_0xadf305]-=_0x25a488[_0x8427('0x27')];if(_0x1f3625[_0xadf305]<0x0)_0x1f3625[_0xadf305]=0x0;});_0x1777ef(_0x1f3625);return;});})[_0x8427('0xb')](function(_0x2ec26f){_0x4680ef(_0x2ec26f);});});}function checkUserLimits(_0x196b95){return new BPromise(function(_0xcdd2b6,_0x38db93){getLimits()[_0x8427('0xa')](function(_0x3e48e2){var _0x503923=_[_0x8427('0x28')](_['countBy'](_0x196b95,_0x8427('0x1f')),[_0x8427('0x23'),_0x8427('0x24'),_0x8427('0x25')]);var _0x1ce4f4=(_0x503923[_0x8427('0x23')]||0x0)+(_0x503923[_0x8427('0x24')]||0x0);var _0x57acb1=_0x503923[_0x8427('0x25')]||0x0;if(_0x1ce4f4>_0x3e48e2[_0x8427('0x24')])return _0x38db93(_0x8427('0x29'));if(_0x57acb1>_0x3e48e2['telephone'])return _0x38db93(_0x8427('0x2a'));return _0xcdd2b6();})['catch'](function(_0x8c55bd){_0x38db93(_0x8c55bd);});});}module[_0x8427('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x7d5d=['format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x7d5d,0xb2));var _0xd7d5=function(_0x570beb,_0x2009db){_0x570beb=_0x570beb-0x0;var _0x2c7eb9=_0x7d5d[_0x570beb];return _0x2c7eb9;};'use strict';var util=require('util');var _=require(_0xd7d5('0x0'));var moment=require(_0xd7d5('0x1'));var BPromise=require(_0xd7d5('0x2'));var hardware=require(_0xd7d5('0x3'));var encryptor=require(_0xd7d5('0x4'));var db=require(_0xd7d5('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd7d5('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd7d5('0x7'),'machineUuid':hardware[_0xd7d5('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd7d5('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd7d5('0x9'),'machineUuid':hardware[_0xd7d5('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x259c42){return new BPromise(function(_0x5a9d6f,_0x3ca19b){return db[_0xd7d5('0xa')][_0xd7d5('0xb')](_[_0xd7d5('0xc')](_0x259c42,{'raw':!![],'where':{'id':0x1}}))[_0xd7d5('0xd')](function(_0x46c84f){return checkLicense(_0x46c84f,null);})[_0xd7d5('0xd')](function(_0xbd08f6){_0x5a9d6f(_0xbd08f6);return;})[_0xd7d5('0xe')](function(_0x199a58){_0x3ca19b(_0x199a58);});});}function checkLicense(_0x1463b3,_0x5edc1d){if(!_0x1463b3){demoLicense[_0xd7d5('0xf')]=_0x1463b3[_0xd7d5('0x10')];return demoLicense;}try{var _0x129469=_0x5edc1d||_0x1463b3[_0xd7d5('0x11')];if(_[_0xd7d5('0x12')](_0x129469)){throw new Error(_0xd7d5('0x13'));}var _0x4742b9=_0x1463b3['data1'];var _0x108d42=_0x1463b3['data2'];var _0x1a1a06=_0x4742b9['split']('-')[0x4];var _0x26279f=_0x4742b9[_0xd7d5('0x14')]('-')[0x0];var _0x325695=encryptor[_0xd7d5('0x15')](_0x129469,util[_0xd7d5('0x16')](_0xd7d5('0x17'),_0x1a1a06,_0x4742b9,_0x26279f));var _0x49cac1=JSON[_0xd7d5('0x18')](_0x325695);_0x49cac1[_0xd7d5('0x19')]=![];_0x49cac1[_0xd7d5('0xf')]=_0x4742b9;_0x49cac1[_0xd7d5('0x1a')]=hardware['getUuid']();if(_0x108d42){var _0x463c1f=encryptor[_0xd7d5('0x15')](_0x108d42);_0x49cac1[_0xd7d5('0x1b')]=_0x463c1f;_0x49cac1[_0xd7d5('0x1c')]=moment(_0x463c1f)[_0xd7d5('0x1d')](0x7,'days')['format']();_0x49cac1[_0xd7d5('0x1e')]=_0x49cac1[_0xd7d5('0xf')]!=_0x49cac1[_0xd7d5('0x1a')]?_0xd7d5('0x1f'):_0xd7d5('0x20');}return _0x49cac1;}catch(_0x54569a){breakingLicense[_0xd7d5('0xf')]=_0x1463b3['data1'];breakingLicense['message']=_0x54569a[_0xd7d5('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d8db7,_0x484df5){getLicense()[_0xd7d5('0xd')](function(_0x3d969b){return db[_0xd7d5('0x22')][_0xd7d5('0x23')]({'attributes':[_0xd7d5('0x24'),[db['sequelize']['fn'](_0xd7d5('0x25'),db['sequelize'][_0xd7d5('0x26')](_0xd7d5('0x24'))),_0xd7d5('0x27')]],'group':_0xd7d5('0x24'),'where':{'role':{'$or':[_0xd7d5('0x28'),_0xd7d5('0x29'),_0xd7d5('0x2a')]}},'raw':!![]})[_0xd7d5('0xd')](function(_0x42e8be){var _0x41985b={'user':_0x3d969b[_0xd7d5('0x2b')]||0x0,'telephone':_0x3d969b[_0xd7d5('0x2c')]||0x0};_0x42e8be[_0xd7d5('0x2d')](function(_0x54db96){var _0x32ab05=_0x54db96[_0xd7d5('0x24')]===_0xd7d5('0x28')?_0xd7d5('0x29'):_0x54db96[_0xd7d5('0x24')];_0x41985b[_0x32ab05]-=_0x54db96[_0xd7d5('0x27')];if(_0x41985b[_0x32ab05]<0x0)_0x41985b[_0x32ab05]=0x0;});_0x4d8db7(_0x41985b);return;});})['catch'](function(_0x3337a7){_0x484df5(_0x3337a7);});});}function checkUserLimits(_0x203254){return new BPromise(function(_0x45668e,_0x4cfe4a){getLimits()[_0xd7d5('0xd')](function(_0x405b70){var _0x25b8bf=_[_0xd7d5('0x2e')](_[_0xd7d5('0x2f')](_0x203254,_0xd7d5('0x24')),['admin',_0xd7d5('0x29'),_0xd7d5('0x2a')]);var _0x3422c1=(_0x25b8bf[_0xd7d5('0x28')]||0x0)+(_0x25b8bf[_0xd7d5('0x29')]||0x0);var _0x29b82e=_0x25b8bf[_0xd7d5('0x2a')]||0x0;if(_0x3422c1>_0x405b70['user'])return _0x4cfe4a(_0xd7d5('0x30'));if(_0x29b82e>_0x405b70[_0xd7d5('0x2a')])return _0x4cfe4a(_0xd7d5('0x31'));return _0x45668e();})[_0xd7d5('0xe')](function(_0x176cfc){_0x4cfe4a(_0x176cfc);});});}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 ed4e714..bb7c2ed 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 _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x333951,_0x1c6ccb){var _0x2bd345=function(_0x1883f2){while(--_0x1883f2){_0x333951['push'](_0x333951['shift']());}};_0x2bd345(++_0x1c6ccb);}(_0x1c9a,0x98));var _0xa1c9=function(_0x1b1e72,_0xce2085){_0x1b1e72=_0x1b1e72-0x0;var _0x3d1837=_0x1c9a[_0x1b1e72];return _0x3d1837;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x6cb4=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x51a7d9,_0x491943){var _0x348796=function(_0x5bf85d){while(--_0x5bf85d){_0x51a7d9['push'](_0x51a7d9['shift']());}};_0x348796(++_0x491943);}(_0x6cb4,0xff));var _0x46cb=function(_0x40e2db,_0x4f1f8a){_0x40e2db=_0x40e2db-0x0;var _0xe4f321=_0x6cb4[_0x40e2db];return _0xe4f321;};'use strict';module[_0x46cb('0x0')]={'DOMAIN':_0x46cb('0x1'),'SESSION_SECRET':_0x46cb('0x2'),'GOOGLE_ID':_0x46cb('0x3'),'GOOGLE_SECRET':_0x46cb('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d18e8e6..3d967d2 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60e9=['exports','fileLogger'];(function(_0xe98705,_0x1f2883){var _0x1c0b0a=function(_0x3406bc){while(--_0x3406bc){_0xe98705['push'](_0xe98705['shift']());}};_0x1c0b0a(++_0x1f2883);}(_0x60e9,0x1a3));var _0x960e=function(_0x203168,_0xa8d6be){_0x203168=_0x203168-0x0;var _0xde9a61=_0x60e9[_0x203168];return _0xde9a61;};'use strict';var fileLogger=require('../utils/loggers')[_0x960e('0x0')];module[_0x960e('0x1')]=fileLogger; \ No newline at end of file +var _0x95e4=['fileLogger','exports'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x95e4,0xb4));var _0x495e=function(_0x23d7f7,_0x70793e){_0x23d7f7=_0x23d7f7-0x0;var _0x330f2e=_0x95e4[_0x23d7f7];return _0x330f2e;};'use strict';var fileLogger=require('../utils/loggers')[_0x495e('0x0')];module[_0x495e('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d5c6d2d..130aeee 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 _0x02e0=['../../services/xdr/index.js','exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x02e0,0xe6));var _0x002e=function(_0x5b536f,_0x252962){_0x5b536f=_0x5b536f-0x0;var _0x19ea5c=_0x02e0[_0x5b536f];return _0x19ea5c;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x002e('0x0'),'script':path[_0x002e('0x1')](__dirname,_0x002e('0x2'))},{'name':_0x002e('0x3'),'script':path[_0x002e('0x1')](__dirname,_0x002e('0x4'))},{'name':'agi','script':path['join'](__dirname,_0x002e('0x5'))},{'name':_0x002e('0x6'),'script':path[_0x002e('0x1')](__dirname,_0x002e('0x7'))},{'name':_0x002e('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x002e('0x9'),'script':path[_0x002e('0x1')](__dirname,_0x002e('0xa'))}]};module[_0x002e('0xb')]=config; \ No newline at end of file +var _0xa066=['../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','../../services/express/index.js','ami','join','../../services/ami/index.js'];(function(_0x2f762d,_0x120ba6){var _0x591c02=function(_0x151ce4){while(--_0x151ce4){_0x2f762d['push'](_0x2f762d['shift']());}};_0x591c02(++_0x120ba6);}(_0xa066,0x182));var _0x6a06=function(_0x510de5,_0x1ac5d6){_0x510de5=_0x510de5-0x0;var _0x48df9e=_0xa066[_0x510de5];return _0x48df9e;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x6a06('0x0'))},{'name':_0x6a06('0x1'),'script':path[_0x6a06('0x2')](__dirname,_0x6a06('0x3'))},{'name':'agi','script':path['join'](__dirname,_0x6a06('0x4'))},{'name':'email','script':path[_0x6a06('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x6a06('0x5'),'script':path[_0x6a06('0x2')](__dirname,_0x6a06('0x6'))},{'name':_0x6a06('0x7'),'script':path['join'](__dirname,_0x6a06('0x8'))}]};module[_0x6a06('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8855886..84e1145 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 _0x58fc=['start','stop','then','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','connect','connected'];(function(_0x4478b3,_0x3fb886){var _0x58d699=function(_0x48769f){while(--_0x48769f){_0x4478b3['push'](_0x4478b3['shift']());}};_0x58d699(++_0x3fb886);}(_0x58fc,0x1a0));var _0xc58f=function(_0x516bce,_0x3769f2){_0x516bce=_0x516bce-0x0;var _0x3a1f40=_0x58fc[_0x516bce];return _0x3a1f40;};'use strict';var pm2=require(_0xc58f('0x0'));var BPromise=require(_0xc58f('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x17a913,_0x380d90){return pm2[_0xc58f('0x2')](function(_0x6c86f7){if(_0x6c86f7){return _0x380d90(_0x6c86f7);}return _0x17a913(_0xc58f('0x3'));});});};exports[_0xc58f('0x4')]=function(_0x686262){return connect()['then'](function(){return new BPromise(function(_0x5c7598,_0x13798c){return pm2['start'](_0x686262,function(_0x56a15c,_0x3bea9c){if(_0x56a15c){return _0x13798c(_0x56a15c);}pm2['disconnect']();return _0x5c7598(_0x3bea9c);});});});};exports[_0xc58f('0x5')]=function(_0x4e7ab6){return connect()[_0xc58f('0x6')](function(){return new BPromise(function(_0x21372d,_0x1c7e18){return pm2['stop'](_0x4e7ab6,function(_0x233ea3,_0x24b7cb){if(_0x233ea3){return _0x1c7e18(_0x233ea3);}pm2['disconnect']();return _0x21372d(_0x24b7cb);});});});};exports[_0xc58f('0x7')]=function(_0x511448){return connect()['then'](function(){return new BPromise(function(_0x3e04c6,_0x2fe2eb){return pm2[_0xc58f('0x7')](_0x511448,function(_0x47a69c,_0x9c8dbb){if(_0x47a69c){return _0x2fe2eb(_0x47a69c);}pm2[_0xc58f('0x8')]();return _0x3e04c6(_0x9c8dbb);});});});};exports['list']=function(){return connect()[_0xc58f('0x6')](function(){return new BPromise(function(_0x4b580c,_0x1dcd0d){return pm2[_0xc58f('0x9')](function(_0x1a3c0c,_0x28ee64){if(_0x1a3c0c){return _0x1dcd0d(_0x1a3c0c);}pm2[_0xc58f('0x8')]();return _0x4b580c(_0x28ee64);});});});};exports[_0xc58f('0xa')]=function(_0x93fe6e){return connect()[_0xc58f('0x6')](function(){return new BPromise(function(_0x1484da,_0x458a8e){return pm2[_0xc58f('0xa')](_0x93fe6e,function(_0x2bab92,_0x41a38e){if(_0x2bab92){return _0x458a8e(_0x2bab92);}pm2[_0xc58f('0x8')]();return _0x1484da(_0x41a38e);});});});};exports['delete']=function(_0x105429){return connect()[_0xc58f('0x6')](function(){return new BPromise(function(_0x30e11b,_0x5157d1){return pm2[_0xc58f('0xb')](_0x105429,function(_0x1923e4,_0x5e33c1){if(_0x1923e4){return _0x5157d1(_0x1923e4);}pm2['disconnect']();return _0x30e11b(_0x5e33c1);});});});};exports[_0xc58f('0xc')]=function(){return connect()[_0xc58f('0x6')](function(){return new BPromise(function(_0xe96d36,_0x306c46){return pm2['dump'](function(_0x1a45df){if(_0x1a45df){return _0x306c46(_0x1a45df);}return _0xe96d36(_0xc58f('0xd'));});});});}; \ No newline at end of file +var _0xca31=['list','describe','delete','dump','saved','./config','connected','start','then','disconnect','stop','restart'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xca31,0x89));var _0x1ca3=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xca31[_0x2440fe];return _0x5cf734;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1ca3('0x0'));function connect(){return new BPromise(function(_0x51306f,_0x13ebc1){return pm2['connect'](function(_0x5a6fcd){if(_0x5a6fcd){return _0x13ebc1(_0x5a6fcd);}return _0x51306f(_0x1ca3('0x1'));});});};exports[_0x1ca3('0x2')]=function(_0x3fc7b9){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x2c6c7d,_0x204e8f){return pm2[_0x1ca3('0x2')](_0x3fc7b9,function(_0x5de21d,_0x1243b4){if(_0x5de21d){return _0x204e8f(_0x5de21d);}pm2[_0x1ca3('0x4')]();return _0x2c6c7d(_0x1243b4);});});});};exports[_0x1ca3('0x5')]=function(_0xaf1ae5){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x21ca61,_0x526f0){return pm2['stop'](_0xaf1ae5,function(_0x4aa5a7,_0x22f8e5){if(_0x4aa5a7){return _0x526f0(_0x4aa5a7);}pm2[_0x1ca3('0x4')]();return _0x21ca61(_0x22f8e5);});});});};exports[_0x1ca3('0x6')]=function(_0x3a9985){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x183a75,_0x3ff446){return pm2['restart'](_0x3a9985,function(_0x4778e8,_0x500213){if(_0x4778e8){return _0x3ff446(_0x4778e8);}pm2[_0x1ca3('0x4')]();return _0x183a75(_0x500213);});});});};exports['list']=function(){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x127ff3,_0x4c8b60){return pm2[_0x1ca3('0x7')](function(_0x138f34,_0x6eb821){if(_0x138f34){return _0x4c8b60(_0x138f34);}pm2[_0x1ca3('0x4')]();return _0x127ff3(_0x6eb821);});});});};exports[_0x1ca3('0x8')]=function(_0x566395){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x20e9ce,_0x4592b3){return pm2[_0x1ca3('0x8')](_0x566395,function(_0x254683,_0x214c37){if(_0x254683){return _0x4592b3(_0x254683);}pm2[_0x1ca3('0x4')]();return _0x20e9ce(_0x214c37);});});});};exports[_0x1ca3('0x9')]=function(_0x5d4472){return connect()['then'](function(){return new BPromise(function(_0x2e90c9,_0x1d8a79){return pm2[_0x1ca3('0x9')](_0x5d4472,function(_0x569816,_0x2f3255){if(_0x569816){return _0x1d8a79(_0x569816);}pm2[_0x1ca3('0x4')]();return _0x2e90c9(_0x2f3255);});});});};exports['dump']=function(){return connect()[_0x1ca3('0x3')](function(){return new BPromise(function(_0x40fd62,_0x4e8cc3){return pm2[_0x1ca3('0xa')](function(_0x3ab6eb){if(_0x3ab6eb){return _0x4e8cc3(_0x3ab6eb);}return _0x40fd62(_0x1ca3('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 83cb659..5f5c779 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 _0xb8b7=['findAll','subtract','minutes','map','info','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then'];(function(_0x4abf7e,_0x3656a2){var _0x10185e=function(_0x25cb28){while(--_0x25cb28){_0x4abf7e['push'](_0x4abf7e['shift']());}};_0x10185e(++_0x3656a2);}(_0xb8b7,0x96));var _0x7b8b=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb8b7[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x7b8b('0x0'));var moment=require(_0x7b8b('0x1'));var Redis=require(_0x7b8b('0x2'));var util=require(_0x7b8b('0x3'));var config=require(_0x7b8b('0x4'));var db=require(_0x7b8b('0x5'))['db'];var logger=require('../logger')(_0x7b8b('0x6'));config[_0x7b8b('0x7')]=_[_0x7b8b('0x8')](config[_0x7b8b('0x7')],{'host':_0x7b8b('0x9'),'port':0x18eb});var io=require(_0x7b8b('0xa'))(new Redis(config[_0x7b8b('0x7')]));function closeInteractions(){var _0x511ac4=0x0;var _0x1f87b5=[];return db[_0x7b8b('0xb')][_0x7b8b('0xc')]({'raw':!![],'attributes':['id',_0x7b8b('0xd')],'where':{'id':0x1}})[_0x7b8b('0xe')](function(_0x50a8a5){_0x511ac4=_0x50a8a5[_0x7b8b('0xd')];if(_0x511ac4){return db['ChatInteraction'][_0x7b8b('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7b8b('0x10')](_0x50a8a5[_0x7b8b('0xd')],_0x7b8b('0x11'))}}});}else{return[];}})[_0x7b8b('0xe')](function(_0x593174){if(_0x593174&&_0x593174['length']){_0x1f87b5=_[_0x7b8b('0x12')](_0x593174||[],'id');logger[_0x7b8b('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1f87b5[_0x7b8b('0x14')]());return db[_0x7b8b('0x15')][_0x7b8b('0x16')]({'closeReason':_0x7b8b('0x17'),'disposition':_0x7b8b('0x18'),'closed':!![],'closedAt':moment()[_0x7b8b('0x19')](_0x7b8b('0x1a'))},{'where':{'id':_0x1f87b5}});}})[_0x7b8b('0xe')](function(){if(_0x1f87b5&&_0x1f87b5[_0x7b8b('0x1b')]){logger[_0x7b8b('0x13')](_0x7b8b('0x1c'),_0x1f87b5['join']());for(var _0x76e76=0x0;_0x76e76<_0x1f87b5['length'];_0x76e76++){io[_0x7b8b('0x1d')](_0x7b8b('0x1e'),{'id':_0x1f87b5[_0x76e76],'closed':!![]});}}})[_0x7b8b('0x1f')](function(_0x465c17){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x465c17?util[_0x7b8b('0x20')](_0x465c17,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xecd1=['redis','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','minutes','length','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0xecd1,0x67));var _0x1ecd=function(_0x3db2cd,_0x1e4569){_0x3db2cd=_0x3db2cd-0x0;var _0x25ab6b=_0xecd1[_0x3db2cd];return _0x25ab6b;};'use strict';var _=require(_0x1ecd('0x0'));var moment=require(_0x1ecd('0x1'));var Redis=require(_0x1ecd('0x2'));var util=require(_0x1ecd('0x3'));var config=require(_0x1ecd('0x4'));var db=require(_0x1ecd('0x5'))['db'];var logger=require(_0x1ecd('0x6'))(_0x1ecd('0x7'));config['redis']=_[_0x1ecd('0x8')](config[_0x1ecd('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1ecd('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x339e43=0x0;var _0x3f6282=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x1ecd('0xb')],'where':{'id':0x1}})[_0x1ecd('0xc')](function(_0x3135cf){_0x339e43=_0x3135cf[_0x1ecd('0xb')];if(_0x339e43){return db[_0x1ecd('0xd')][_0x1ecd('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3135cf[_0x1ecd('0xb')],_0x1ecd('0xf'))}}});}else{return[];}})['then'](function(_0x109590){if(_0x109590&&_0x109590[_0x1ecd('0x10')]){_0x3f6282=_['map'](_0x109590||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x3f6282[_0x1ecd('0x11')]());return db[_0x1ecd('0xd')]['update']({'closeReason':_0x1ecd('0x12'),'disposition':_0x1ecd('0x13'),'closed':!![],'closedAt':moment()[_0x1ecd('0x14')](_0x1ecd('0x15'))},{'where':{'id':_0x3f6282}});}})[_0x1ecd('0xc')](function(){if(_0x3f6282&&_0x3f6282[_0x1ecd('0x10')]){logger[_0x1ecd('0x16')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3f6282[_0x1ecd('0x11')]());for(var _0x3e20b6=0x0;_0x3e20b6<_0x3f6282['length'];_0x3e20b6++){io['emit'](_0x1ecd('0x17'),{'id':_0x3f6282[_0x3e20b6],'closed':!![]});}}})[_0x1ecd('0x18')](function(_0x429134){logger[_0x1ecd('0x19')](_0x1ecd('0x1a'),_0x429134?util['inspect'](_0x429134,{'showHidden':![],'depth':null}):'');});}exports[_0x1ecd('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 f85ac00..88e5fa3 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 _0xd63d=['startAllRefreshIntervals','exports'];(function(_0x492664,_0xdba57c){var _0x13158b=function(_0x344a96){while(--_0x344a96){_0x492664['push'](_0x492664['shift']());}};_0x13158b(++_0xdba57c);}(_0xd63d,0x144));var _0xdd63=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0xd63d[_0x1fa381];return _0x47eefe;};'use strict';function start(){var _0x393b3e=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x393b3e[_0xdd63('0x0')]();}module[_0xdd63('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xbbd0=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x491468,_0x42f169){var _0x5b8c22=function(_0x407a9b){while(--_0x407a9b){_0x491468['push'](_0x491468['shift']());}};_0x5b8c22(++_0x42f169);}(_0xbbd0,0x9b));var _0x0bbd=function(_0x4294c9,_0x3f3876){_0x4294c9=_0x4294c9-0x0;var _0x56d72e=_0xbbd0[_0x4294c9];return _0x56d72e;};'use strict';function start(){var _0x4cd51c=require(_0x0bbd('0x0'));return _0x4cd51c[_0x0bbd('0x1')]();}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 5729732..97369d9 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 _0xcebb=['isBetween','startAt','endAt','start','add\x20cron','deleteJob','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','pass','format','name','bcc','subtractNumber','subtractUnit','../../files/reports','savename','basename','extname','zip','join','existsSync','status','Sent','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','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','keyBy','difference','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0xcebb,0x118));var _0xbceb=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xcebb[_0x565ed7];return _0x183ad7;};'use strict';var fs=require('fs');var util=require(_0xbceb('0x0'));var path=require(_0xbceb('0x1'));var _=require(_0xbceb('0x2'));var moment=require(_0xbceb('0x3'));var CronJobManager=require(_0xbceb('0x4'));var jayson=require(_0xbceb('0x5'));var BPromise=require(_0xbceb('0x6'));var logger=require(_0xbceb('0x7'))('schedule');var db=require(_0xbceb('0x8'))['db'];var analyticCustomReportController=require(_0xbceb('0x9'));var analyticDefaultReportController=require(_0xbceb('0xa'));var client=jayson[_0xbceb('0xb')][_0xbceb('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3f2c0e,_0x2880b4){return function(){logger[_0xbceb('0xd')](_0xbceb('0xe'),_0x3f2c0e[_0xbceb('0xf')]);var _0x3c486d=!![];var _0x41ff2f={'tls':{'rejectUnauthorized':![]}};if(_0x3f2c0e[_0xbceb('0x10')]['Smtp'][_0xbceb('0x11')]){_0x41ff2f[_0xbceb('0x11')]=_0x3f2c0e[_0xbceb('0x10')]['Smtp'][_0xbceb('0x11')];}else{_0x41ff2f[_0xbceb('0x12')]=_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')][_0xbceb('0x12')];_0x41ff2f[_0xbceb('0x14')]=_0x3f2c0e['MailAccount'][_0xbceb('0x13')][_0xbceb('0x14')];_0x41ff2f[_0xbceb('0x15')]=_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')][_0xbceb('0x15')];}if(_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')][_0xbceb('0x16')]){_0x41ff2f[_0xbceb('0x17')]={'user':_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')][_0xbceb('0x18')],'pass':_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')][_0xbceb('0x19')]};}var _0x1d9b50={'account':_0x41ff2f,'message':{'from':util[_0xbceb('0x1a')]('\x22%s\x22\x20<%s>',_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x1b')],_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0xf')]||_0x3f2c0e[_0xbceb('0x10')][_0xbceb('0x13')]['user']),'to':_0x3f2c0e[_0xbceb('0xf')],'cc':_0x3f2c0e['cc'],'bcc':_0x3f2c0e[_0xbceb('0x1c')],'subject':util[_0xbceb('0x1a')]('Report\x20%s\x20last\x20%s\x20%s',_0x2880b4[_0xbceb('0x1b')],_0x3f2c0e[_0xbceb('0x1d')],_0x3f2c0e[_0xbceb('0x1e')])}};var _0x53a4d5=path['join'](__dirname,_0xbceb('0x1f'));var _0x25d016=_0x2880b4[_0xbceb('0x20')];var _0x45c634=util[_0xbceb('0x1a')]('%s.%s',path[_0xbceb('0x21')](_0x2880b4[_0xbceb('0x20')],path[_0xbceb('0x22')](_0x2880b4[_0xbceb('0x20')])),_0xbceb('0x23'));var _0x5e374b=path[_0xbceb('0x24')](_0x53a4d5,_0x25d016);var _0x127c47=path[_0xbceb('0x24')](_0x53a4d5,_0x45c634);if(fs[_0xbceb('0x25')](_0x5e374b)){_0x2880b4[_0xbceb('0x26')]=_0xbceb('0x27');_0x1d9b50[_0xbceb('0x28')]['attachments']=[{'filename':_0x25d016,'path':_0x5e374b}];_0x1d9b50[_0xbceb('0x28')][_0xbceb('0x29')]=util['format'](_0xbceb('0x2a'),JSON[_0xbceb('0x2b')](_0x2880b4,null,0x2));}else if(fs[_0xbceb('0x25')](_0x127c47)){_0x2880b4[_0xbceb('0x26')]=_0xbceb('0x27');_0x1d9b50['message'][_0xbceb('0x2c')]=[{'filename':_0x45c634,'path':_0x127c47}];}else{_0x1d9b50[_0xbceb('0x28')][_0xbceb('0x29')]=_0xbceb('0x2d');if(!_0x3f2c0e[_0xbceb('0x2e')]){_0x3c486d=![];logger['info'](_0xbceb('0x2f'));}}if(_0x3c486d){return client['request']('SendMail',_0x1d9b50)[_0xbceb('0x30')](function(_0x5ee7c2){if(_0x5ee7c2[_0xbceb('0x31')]){return logger['error'](_0xbceb('0x32'),JSON[_0xbceb('0x2b')](_0x5ee7c2));}return logger[_0xbceb('0xd')](_0xbceb('0x33'));})[_0xbceb('0x34')](function(_0xc24c26){return logger['error'](_0xbceb('0x32'),JSON[_0xbceb('0x2b')](_0xc24c26));});}};}function handleError(){return function(_0x1c32f6){return logger[_0xbceb('0x31')](JSON[_0xbceb('0x2b')](_0x1c32f6));};}function handleResult(_0x102bce){return function(_0x4599dd){logger['info'](_0xbceb('0x35'),JSON[_0xbceb('0x2b')](_0x4599dd));if(_0x102bce[_0xbceb('0x10')]&&_0x102bce['MailAccount'][_0xbceb('0x13')]&&!_[_0xbceb('0x36')](_0x102bce[_0xbceb('0xf')])){setTimeout(handleSendEmail(_0x102bce,_0x4599dd),0x3c*0x3e8);}};}function handleJob(_0x63bb5f){return function(){try{if(_[_0xbceb('0x36')](_0x63bb5f[_0xbceb('0x1d')])){return logger[_0xbceb('0xd')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xbceb('0x36')](_0x63bb5f[_0xbceb('0x1e')])){return logger[_0xbceb('0xd')]('subtractUnit\x20null\x20or\x20undefined');}var _0x46e71b={'startDate':moment()['subtract'](_0x63bb5f[_0xbceb('0x1d')],_0x63bb5f[_0xbceb('0x1e')])['format'](_0xbceb('0x37')),'endDate':moment()[_0xbceb('0x1a')](_0xbceb('0x37')),'type':'scheduled','output':_0x63bb5f[_0xbceb('0x38')],'name':_0x63bb5f[_0xbceb('0x1b')]};if(!_[_0xbceb('0x36')](_0x63bb5f[_0xbceb('0x39')])){logger['info'](_0xbceb('0x3a'),_0x63bb5f[_0xbceb('0x39')]);return analyticDefaultReportController[_0xbceb('0x3b')]({'id':_0x63bb5f[_0xbceb('0x39')]},_0x46e71b)['then'](handleResult(_0x63bb5f))[_0xbceb('0x34')](handleError());}if(!_[_0xbceb('0x36')](_0x63bb5f[_0xbceb('0x3c')])){logger[_0xbceb('0xd')]('exec\x20custom\x20report\x20id:%s',_0x63bb5f['CustomReportId']);return analyticCustomReportController[_0xbceb('0x3b')]({'id':_0x63bb5f[_0xbceb('0x3c')]},_0x46e71b)['then'](handleResult(_0x63bb5f))[_0xbceb('0x34')](handleError());}}catch(_0x1043f3){logger['error'](JSON['stringify'](_0x1043f3));}return logger[_0xbceb('0xd')](_0xbceb('0x3d'));};}function getJobs(_0x279294){var _0x153325={};if(_0x279294){_0x153325['id']=_0x279294;}return db[_0xbceb('0x3e')][_0xbceb('0x3f')]({'where':_0x153325,'include':[{'model':db['MailAccount'],'attributes':['id',_0xbceb('0x1b'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xbceb('0x13')}]}]})['then'](function(_0x26f496){var _0x31077d=_[_0xbceb('0x40')](manager[_0xbceb('0x41')]);var _0x2a9550=_['map'](_0x26f496,function(_0x132852){return _0x132852['id'][_0xbceb('0x42')]();});var _0x2b4e4e=_[_0xbceb('0x43')](_0x26f496,function(_0x37528d){return _0x37528d['id'][_0xbceb('0x42')]();});var _0x50e769=_0x279294?_0x2a9550:_[_0xbceb('0x44')](_0x2a9550,_0x31077d);var _0x46838f=_['intersection'](_0x2a9550,_0x31077d);var _0x113196=_[_0xbceb('0x44')](_0x31077d,_0x2a9550);var _0x44b619;var _0x5e2100;for(_0x44b619=0x0;_0x44b619<_0x113196[_0xbceb('0x45')]&&!_0x279294;_0x44b619+=0x1){_0x5e2100=_0x113196[_0x44b619][_0xbceb('0x42')]();if(manager[_0xbceb('0x46')](_0x5e2100)){manager[_0xbceb('0x47')](_0x5e2100);manager['deleteJob'](_0x5e2100);logger[_0xbceb('0xd')](_0xbceb('0x48'),_0x5e2100);}}logger['info'](_0xbceb('0x49'),JSON[_0xbceb('0x2b')](_0x50e769));for(_0x44b619=0x0;_0x44b619<_0x50e769[_0xbceb('0x45')];_0x44b619+=0x1){_0x5e2100=_0x50e769[_0x44b619]['toString']();logger[_0xbceb('0xd')](_0xbceb('0x4a'),_0x5e2100);if(_0x279294){logger[_0xbceb('0xd')](_0xbceb('0x4b'),_0x279294);logger[_0xbceb('0xd')](JSON[_0xbceb('0x2b')](_0x2b4e4e[_0x5e2100]));BPromise[_0xbceb('0x4c')]()['then'](handleJob(_0x2b4e4e[_0x5e2100]));logger[_0xbceb('0xd')](_0xbceb('0x4d'),_0x2b4e4e[_0x5e2100]['name'],_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')]);}else if(_0x2b4e4e[_0x5e2100]['cron']&&_0x2b4e4e[_0x5e2100][_0xbceb('0x4f')]&&moment()[_0xbceb('0x50')](_0x2b4e4e[_0x5e2100][_0xbceb('0x51')],_0x2b4e4e[_0x5e2100][_0xbceb('0x52')])){manager['add'](_0x5e2100,_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')],handleJob(_0x2b4e4e[_0x5e2100]));manager[_0xbceb('0x53')](_0x5e2100);logger['info'](_0xbceb('0x54'),_0x2b4e4e[_0x5e2100][_0xbceb('0x1b')],_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')]);}else if(manager['exists'](_0x5e2100)){manager['stop'](_0x5e2100);manager[_0xbceb('0x55')](_0x5e2100);logger[_0xbceb('0xd')]('stop\x20cron',_0x2b4e4e[_0x5e2100][_0xbceb('0x1b')],_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')]);}}for(_0x44b619=0x0,_0x5e2100;_0x44b619<_0x46838f[_0xbceb('0x45')]&&!_0x279294;_0x44b619+=0x1){_0x5e2100=_0x46838f[_0x44b619][_0xbceb('0x42')]();if(manager['exists'](_0x5e2100)){if(_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')]&&_0x2b4e4e[_0x5e2100][_0xbceb('0x4f')]&&moment()['isBetween'](_0x2b4e4e[_0x5e2100][_0xbceb('0x51')],_0x2b4e4e[_0x5e2100][_0xbceb('0x52')])){manager[_0xbceb('0x56')](_0x5e2100,_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')],handleJob(_0x2b4e4e[_0x5e2100]));logger['info'](_0xbceb('0x57'),_0x2b4e4e[_0x5e2100]['name'],_0x2b4e4e[_0x5e2100][_0xbceb('0x4e')]);}else{manager[_0xbceb('0x47')](_0x5e2100);manager[_0xbceb('0x55')](_0x5e2100);logger[_0xbceb('0xd')](_0xbceb('0x58'),_0x2b4e4e[_0x5e2100]['name'],_0x2b4e4e[_0x5e2100]['cron']);}}}})[_0xbceb('0x34')](function(_0x548b1e){logger[_0xbceb('0x31')](JSON[_0xbceb('0x2b')](_0x548b1e));});}exports[_0xbceb('0x59')]=function(_0x444733){return getJobs(_0x444733);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xecd1=['my\x20id','resolve','run\x20job','cron','active','isBetween','start','add\x20cron','stop\x20cron','startAt','endAt','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','name','user','email','bcc','format','subtractNumber','subtractUnit','savename','%s.%s','basename','zip','join','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','catch','Schedule','findAll','jobs','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun'];(function(_0x126f08,_0x1451af){var _0x4675eb=function(_0x50dcd0){while(--_0x50dcd0){_0x126f08['push'](_0x126f08['shift']());}};_0x4675eb(++_0x1451af);}(_0xecd1,0xb6));var _0x1ecd=function(_0x2699cc,_0xaa48f7){_0x2699cc=_0x2699cc-0x0;var _0x332180=_0xecd1[_0x2699cc];return _0x332180;};'use strict';var fs=require('fs');var util=require(_0x1ecd('0x0'));var path=require(_0x1ecd('0x1'));var _=require(_0x1ecd('0x2'));var moment=require('moment');var CronJobManager=require(_0x1ecd('0x3'));var jayson=require(_0x1ecd('0x4'));var BPromise=require(_0x1ecd('0x5'));var logger=require('../logger')(_0x1ecd('0x6'));var db=require(_0x1ecd('0x7'))['db'];var analyticCustomReportController=require(_0x1ecd('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x1ecd('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x387fc3,_0x1c603b){return function(){logger[_0x1ecd('0xa')](_0x1ecd('0xb'),_0x387fc3['email']);var _0x510194=!![];var _0x48d38f={'tls':{'rejectUnauthorized':![]}};if(_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')][_0x1ecd('0xe')]){_0x48d38f[_0x1ecd('0xe')]=_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')][_0x1ecd('0xe')];}else{_0x48d38f[_0x1ecd('0xf')]=_0x387fc3['MailAccount']['Smtp'][_0x1ecd('0xf')];_0x48d38f[_0x1ecd('0x10')]=_0x387fc3['MailAccount']['Smtp'][_0x1ecd('0x10')];_0x48d38f[_0x1ecd('0x11')]=_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')][_0x1ecd('0x11')];}if(_0x387fc3['MailAccount']['Smtp']['authentication']){_0x48d38f['auth']={'user':_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')]['user'],'pass':_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')]['pass']};}var _0x264aad={'account':_0x48d38f,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x387fc3['MailAccount'][_0x1ecd('0x12')],_0x387fc3[_0x1ecd('0xc')]['email']||_0x387fc3[_0x1ecd('0xc')][_0x1ecd('0xd')][_0x1ecd('0x13')]),'to':_0x387fc3[_0x1ecd('0x14')],'cc':_0x387fc3['cc'],'bcc':_0x387fc3[_0x1ecd('0x15')],'subject':util[_0x1ecd('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x1c603b['name'],_0x387fc3[_0x1ecd('0x17')],_0x387fc3[_0x1ecd('0x18')])}};var _0xe062b3=path['join'](__dirname,'../../files/reports');var _0x45b0df=_0x1c603b[_0x1ecd('0x19')];var _0x4ef6ff=util[_0x1ecd('0x16')](_0x1ecd('0x1a'),path[_0x1ecd('0x1b')](_0x1c603b[_0x1ecd('0x19')],path['extname'](_0x1c603b[_0x1ecd('0x19')])),_0x1ecd('0x1c'));var _0x4134c2=path[_0x1ecd('0x1d')](_0xe062b3,_0x45b0df);var _0x2aa1ce=path[_0x1ecd('0x1d')](_0xe062b3,_0x4ef6ff);if(fs[_0x1ecd('0x1e')](_0x4134c2)){_0x1c603b[_0x1ecd('0x1f')]=_0x1ecd('0x20');_0x264aad[_0x1ecd('0x21')][_0x1ecd('0x22')]=[{'filename':_0x45b0df,'path':_0x4134c2}];_0x264aad[_0x1ecd('0x21')]['text']=util[_0x1ecd('0x16')](_0x1ecd('0x23'),JSON[_0x1ecd('0x24')](_0x1c603b,null,0x2));}else if(fs[_0x1ecd('0x1e')](_0x2aa1ce)){_0x1c603b[_0x1ecd('0x1f')]=_0x1ecd('0x20');_0x264aad['message'][_0x1ecd('0x22')]=[{'filename':_0x4ef6ff,'path':_0x2aa1ce}];}else{_0x264aad[_0x1ecd('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x387fc3[_0x1ecd('0x25')]){_0x510194=![];logger[_0x1ecd('0xa')](_0x1ecd('0x26'));}}if(_0x510194){return client['request'](_0x1ecd('0x27'),_0x264aad)[_0x1ecd('0x28')](function(_0x4a6706){if(_0x4a6706[_0x1ecd('0x29')]){return logger[_0x1ecd('0x29')](_0x1ecd('0x2a'),JSON[_0x1ecd('0x24')](_0x4a6706));}return logger[_0x1ecd('0xa')](_0x1ecd('0x2b'));})['catch'](function(_0x42a95c){return logger[_0x1ecd('0x29')](_0x1ecd('0x2a'),JSON[_0x1ecd('0x24')](_0x42a95c));});}};}function handleError(){return function(_0x2ee496){return logger[_0x1ecd('0x29')](JSON[_0x1ecd('0x24')](_0x2ee496));};}function handleResult(_0x412c0b){return function(_0x3705aa){logger[_0x1ecd('0xa')](_0x1ecd('0x2c'),JSON[_0x1ecd('0x24')](_0x3705aa));if(_0x412c0b[_0x1ecd('0xc')]&&_0x412c0b[_0x1ecd('0xc')][_0x1ecd('0xd')]&&!_[_0x1ecd('0x2d')](_0x412c0b['email'])){setTimeout(handleSendEmail(_0x412c0b,_0x3705aa),0x3c*0x3e8);}};}function handleJob(_0x4a73ba){return function(){try{if(_[_0x1ecd('0x2d')](_0x4a73ba[_0x1ecd('0x17')])){return logger[_0x1ecd('0xa')](_0x1ecd('0x2e'));}if(_[_0x1ecd('0x2d')](_0x4a73ba[_0x1ecd('0x18')])){return logger['info'](_0x1ecd('0x2f'));}var _0x432079={'startDate':moment()[_0x1ecd('0x30')](_0x4a73ba[_0x1ecd('0x17')],_0x4a73ba[_0x1ecd('0x18')])['format'](_0x1ecd('0x31')),'endDate':moment()[_0x1ecd('0x16')](_0x1ecd('0x31')),'type':_0x1ecd('0x32'),'output':_0x4a73ba[_0x1ecd('0x33')],'name':_0x4a73ba[_0x1ecd('0x12')]};if(!_[_0x1ecd('0x2d')](_0x4a73ba['DefaultReportId'])){logger['info'](_0x1ecd('0x34'),_0x4a73ba[_0x1ecd('0x35')]);return analyticDefaultReportController[_0x1ecd('0x36')]({'id':_0x4a73ba['DefaultReportId']},_0x432079)[_0x1ecd('0x28')](handleResult(_0x4a73ba))['catch'](handleError());}if(!_[_0x1ecd('0x2d')](_0x4a73ba[_0x1ecd('0x37')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4a73ba[_0x1ecd('0x37')]);return analyticCustomReportController[_0x1ecd('0x36')]({'id':_0x4a73ba[_0x1ecd('0x37')]},_0x432079)[_0x1ecd('0x28')](handleResult(_0x4a73ba))[_0x1ecd('0x38')](handleError());}}catch(_0x56059a){logger[_0x1ecd('0x29')](JSON[_0x1ecd('0x24')](_0x56059a));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x4879de){var _0x23949e={};if(_0x4879de){_0x23949e['id']=_0x4879de;}return db[_0x1ecd('0x39')][_0x1ecd('0x3a')]({'where':_0x23949e,'include':[{'model':db[_0x1ecd('0xc')],'attributes':['id',_0x1ecd('0x12'),_0x1ecd('0x14')],'include':[{'model':db['MailServerOut'],'as':_0x1ecd('0xd')}]}]})[_0x1ecd('0x28')](function(_0x2f374f){var _0x375e8d=_['keys'](manager[_0x1ecd('0x3b')]);var _0x4d3417=_['map'](_0x2f374f,function(_0x34abb7){return _0x34abb7['id'][_0x1ecd('0x3c')]();});var _0x2959e=_[_0x1ecd('0x3d')](_0x2f374f,function(_0x15fa08){return _0x15fa08['id'][_0x1ecd('0x3c')]();});var _0x114669=_0x4879de?_0x4d3417:_['difference'](_0x4d3417,_0x375e8d);var _0x1b0e03=_[_0x1ecd('0x3e')](_0x4d3417,_0x375e8d);var _0x51ec08=_[_0x1ecd('0x3f')](_0x375e8d,_0x4d3417);var _0x4b023d;var _0x145a9f;for(_0x4b023d=0x0;_0x4b023d<_0x51ec08[_0x1ecd('0x40')]&&!_0x4879de;_0x4b023d+=0x1){_0x145a9f=_0x51ec08[_0x4b023d][_0x1ecd('0x3c')]();if(manager[_0x1ecd('0x41')](_0x145a9f)){manager[_0x1ecd('0x42')](_0x145a9f);manager[_0x1ecd('0x43')](_0x145a9f);logger[_0x1ecd('0xa')](_0x1ecd('0x44'),_0x145a9f);}}logger['info'](_0x1ecd('0x45'),JSON[_0x1ecd('0x24')](_0x114669));for(_0x4b023d=0x0;_0x4b023d<_0x114669[_0x1ecd('0x40')];_0x4b023d+=0x1){_0x145a9f=_0x114669[_0x4b023d][_0x1ecd('0x3c')]();logger[_0x1ecd('0xa')]('index',_0x145a9f);if(_0x4879de){logger['info'](_0x1ecd('0x46'),_0x4879de);logger['info'](JSON[_0x1ecd('0x24')](_0x2959e[_0x145a9f]));BPromise[_0x1ecd('0x47')]()[_0x1ecd('0x28')](handleJob(_0x2959e[_0x145a9f]));logger[_0x1ecd('0xa')](_0x1ecd('0x48'),_0x2959e[_0x145a9f][_0x1ecd('0x12')],_0x2959e[_0x145a9f][_0x1ecd('0x49')]);}else if(_0x2959e[_0x145a9f][_0x1ecd('0x49')]&&_0x2959e[_0x145a9f][_0x1ecd('0x4a')]&&moment()[_0x1ecd('0x4b')](_0x2959e[_0x145a9f]['startAt'],_0x2959e[_0x145a9f]['endAt'])){manager['add'](_0x145a9f,_0x2959e[_0x145a9f][_0x1ecd('0x49')],handleJob(_0x2959e[_0x145a9f]));manager[_0x1ecd('0x4c')](_0x145a9f);logger[_0x1ecd('0xa')](_0x1ecd('0x4d'),_0x2959e[_0x145a9f][_0x1ecd('0x12')],_0x2959e[_0x145a9f]['cron']);}else if(manager[_0x1ecd('0x41')](_0x145a9f)){manager[_0x1ecd('0x42')](_0x145a9f);manager['deleteJob'](_0x145a9f);logger[_0x1ecd('0xa')](_0x1ecd('0x4e'),_0x2959e[_0x145a9f][_0x1ecd('0x12')],_0x2959e[_0x145a9f][_0x1ecd('0x49')]);}}for(_0x4b023d=0x0,_0x145a9f;_0x4b023d<_0x1b0e03[_0x1ecd('0x40')]&&!_0x4879de;_0x4b023d+=0x1){_0x145a9f=_0x1b0e03[_0x4b023d][_0x1ecd('0x3c')]();if(manager['exists'](_0x145a9f)){if(_0x2959e[_0x145a9f][_0x1ecd('0x49')]&&_0x2959e[_0x145a9f][_0x1ecd('0x4a')]&&moment()[_0x1ecd('0x4b')](_0x2959e[_0x145a9f][_0x1ecd('0x4f')],_0x2959e[_0x145a9f][_0x1ecd('0x50')])){manager[_0x1ecd('0x51')](_0x145a9f,_0x2959e[_0x145a9f]['cron'],handleJob(_0x2959e[_0x145a9f]));logger[_0x1ecd('0xa')](_0x1ecd('0x52'),_0x2959e[_0x145a9f][_0x1ecd('0x12')],_0x2959e[_0x145a9f][_0x1ecd('0x49')]);}else{manager[_0x1ecd('0x42')](_0x145a9f);manager[_0x1ecd('0x43')](_0x145a9f);logger[_0x1ecd('0xa')]('stop\x20cron',_0x2959e[_0x145a9f]['name'],_0x2959e[_0x145a9f][_0x1ecd('0x49')]);}}}})[_0x1ecd('0x38')](function(_0x2d6816){logger[_0x1ecd('0x29')](JSON[_0x1ecd('0x24')](_0x2d6816));});}exports[_0x1ecd('0x53')]=function(_0xe51fbd){return getJobs(_0xe51fbd);};exports[_0x1ecd('0x4c')]=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 d10c498..d7a7580 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 _0xe34f=['format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','forEach','all','inspect','start','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xe34f,0xbc));var _0xfe34=function(_0x1e9abc,_0x4c07af){_0x1e9abc=_0x1e9abc-0x0;var _0x4013a0=_0xe34f[_0x1e9abc];return _0x4013a0;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require('util');var BPromise=require(_0xfe34('0x0'));var db=require(_0xfe34('0x1'))['db'];var logger=require(_0xfe34('0x2'))(_0xfe34('0x3'));function getTranscriptionJob(_0x344149,_0x123f0e,_0xfdfaee,_0x57c220){return new Promise(function(_0x1a3c2b,_0x24e8cb){var _0x195bcd=new AWS[(_0xfe34('0x4'))]({'accessKeyId':_0x123f0e,'secretAccessKey':_0x344149,'region':_0xfdfaee});_0x195bcd[_0xfe34('0x5')]({'TranscriptionJobName':_0x57c220},function(_0x4fa1cd,_0x5cdc7e){if(_0x4fa1cd){return _0x24e8cb(_0x4fa1cd);}else{return _0x1a3c2b(_0x5cdc7e);}});});}function sentiment(_0x109918,_0x297089,_0x252ec7,_0x3eac84,_0x173fe8){return new Promise(function(_0x2f97b8,_0x58128d){var _0x58ee11=new AWS['Comprehend']({'accessKeyId':_0x297089,'secretAccessKey':_0x109918,'region':_0x252ec7});_0x58ee11['detectSentiment']({'Text':_0x3eac84,'LanguageCode':_0x173fe8[_0xfe34('0x6')](0x0,0x2)},function(_0x1502a1,_0x53faa7){if(_0x1502a1){return _0x58128d(_0x1502a1);}else{return _0x2f97b8(_0x53faa7);}});});}function checkTranscribeJob(_0x431e54,_0x2fbadd,_0x17906a){var _0x30ea37;return new BPromise(function(_0x23fb18,_0x3b00b9){logger['info'](util[_0xfe34('0x7')](_0xfe34('0x8'),_0x431e54['id'],_0x431e54[_0xfe34('0x9')]));return getTranscriptionJob(_0x17906a[_0xfe34('0xa')],_0x17906a[_0xfe34('0xb')],_0x2fbadd['transcribeRegion'],_0x431e54[_0xfe34('0x9')])[_0xfe34('0xc')](function(_0x2cdaa5){logger[_0xfe34('0xd')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x431e54['id'],_0x431e54['transcribeName'],_0x2cdaa5[_0xfe34('0xe')]['TranscriptionJobStatus']));if(!_0x431e54['fileText']){switch(_0x2cdaa5['TranscriptionJob'][_0xfe34('0xf')]){case _0xfe34('0x10'):var _0x46353a={'transcribeStatus':_0x2cdaa5[_0xfe34('0xe')]['TranscriptionJobStatus'],'fileUri':_0x2cdaa5[_0xfe34('0xe')][_0xfe34('0x11')][_0xfe34('0x12')]};logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x13'),_0x431e54['id']));return rp({'uri':_0x2cdaa5['TranscriptionJob'][_0xfe34('0x11')][_0xfe34('0x12')],'json':!![]})[_0xfe34('0xc')](function(_0x58751a){logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x14'),_0x431e54['id']));if(_0x58751a&&_0x58751a[_0xfe34('0x15')]&&_0x58751a[_0xfe34('0x15')][_0xfe34('0x16')]&&_0x58751a[_0xfe34('0x15')][_0xfe34('0x16')][_0xfe34('0x17')]){_0x46353a[_0xfe34('0x18')]='';for(var _0x4c0777=0x0;_0x4c0777<_0x58751a[_0xfe34('0x15')][_0xfe34('0x16')]['length'];_0x4c0777++){_0x46353a[_0xfe34('0x18')]+=_0x58751a['results']['transcripts'][_0x4c0777][_0xfe34('0x19')]+'';}}return _0x431e54['update'](_0x46353a);})['then'](function(){logger[_0xfe34('0xd')](util[_0xfe34('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x431e54['id']));if(!_0x431e54[_0xfe34('0x1a')]){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x1d'));}if(!_0x2fbadd['sentiment']||!_0x2fbadd[_0xfe34('0x1e')]||!_0x2fbadd['sentimentRegion']||!_0x2fbadd[_0xfe34('0x1f')]||!_0x2fbadd[_0xfe34('0x20')]){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x21'));}if(!_0x46353a[_0xfe34('0x18')]){throw new Error(_0xfe34('0x22'));}if(_0x2fbadd['sentimentAccountId']===_0x17906a['id']){return _0x17906a;}else{return db[_0xfe34('0x23')][_0xfe34('0x24')]({'where':{'id':_settings[_0xfe34('0x1e')]}});}})['then'](function(_0x435670){if(!_0x435670){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x25'));}if(!_0x435670['data1']||!_0x435670[_0xfe34('0xb')]){throw new db[(_0xfe34('0x1b'))]['ValidationError'](_0xfe34('0x26'));}_0x30ea37=_0x435670;logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x27'),_0x431e54['id']));return sentiment(_0x30ea37[_0xfe34('0xa')],_0x30ea37['data2'],_0x2fbadd['sentimentRegion'],_0x46353a[_0xfe34('0x18')],_0x2fbadd['language']);})[_0xfe34('0xc')](function(_0x3ae5aa){logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x28'),_0x431e54['id']));return _0x431e54[_0xfe34('0x29')]({'sentiment':_0x3ae5aa['Sentiment'],'sPositive':_0x3ae5aa[_0xfe34('0x2a')][_0xfe34('0x2b')],'sNegative':_0x3ae5aa[_0xfe34('0x2a')][_0xfe34('0x2c')],'sMixed':_0x3ae5aa[_0xfe34('0x2a')][_0xfe34('0x2d')],'sNeutral':_0x3ae5aa[_0xfe34('0x2a')][_0xfe34('0x2e')]});})[_0xfe34('0xc')](function(){logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x2f'),_0x431e54['id']));_0x23fb18();});case _0xfe34('0x30'):return _0x431e54[_0xfe34('0x29')]({'transcribeStatus':_0xfe34('0x30'),'failureReason':_0x2cdaa5[_0xfe34('0xe')][_0xfe34('0x31')]})[_0xfe34('0xc')](function(){logger[_0xfe34('0xd')](util['format'](_0xfe34('0x2f'),_0x431e54['id']));_0x23fb18();});default:logger['info'](util[_0xfe34('0x7')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x431e54['id']));break;}}else{return BPromise[_0xfe34('0x32')]()[_0xfe34('0xc')](function(){if(!_0x431e54[_0xfe34('0x1a')]){throw new db[(_0xfe34('0x1b'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2fbadd['sentiment']||!_0x2fbadd[_0xfe34('0x1e')]||!_0x2fbadd['sentimentRegion']||!_0x2fbadd[_0xfe34('0x1f')]||!_0x2fbadd[_0xfe34('0x20')]){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x21'));}if(!_0x431e54[_0xfe34('0x18')]){throw new Error(_0xfe34('0x22'));}if(_0x2fbadd[_0xfe34('0x1e')]===_0x17906a['id']){return _0x17906a;}else{return db[_0xfe34('0x23')][_0xfe34('0x24')]({'where':{'id':_settings[_0xfe34('0x1e')]}});}})[_0xfe34('0xc')](function(_0x54d71f){if(!_0x54d71f){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x25'));}if(!_0x54d71f[_0xfe34('0xa')]||!_0x54d71f['data2']){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0x30ea37=_0x54d71f;logger[_0xfe34('0xd')](util['format'](_0xfe34('0x27'),_0x431e54['id']));return sentiment(_0x30ea37['data1'],_0x30ea37[_0xfe34('0xb')],_0x2fbadd['sentimentRegion'],_0x431e54[_0xfe34('0x18')],_0x2fbadd[_0xfe34('0x1f')]);})[_0xfe34('0xc')](function(_0x4c6ce0){logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x28'),_0x431e54['id']));return _0x431e54['update']({'sentiment':_0x4c6ce0[_0xfe34('0x33')],'sPositive':_0x4c6ce0[_0xfe34('0x2a')]['Positive'],'sNegative':_0x4c6ce0[_0xfe34('0x2a')]['Negative'],'sMixed':_0x4c6ce0[_0xfe34('0x2a')][_0xfe34('0x2d')],'sNeutral':_0x4c6ce0[_0xfe34('0x2a')][_0xfe34('0x2e')],'transcribeStatus':_0xfe34('0x10')});})[_0xfe34('0xc')](function(){logger[_0xfe34('0xd')](util[_0xfe34('0x7')](_0xfe34('0x2f'),_0x431e54['id']));_0x23fb18();});}})[_0xfe34('0x34')](function(_0x345985){if(_0x345985){if(!_0x345985[_0xfe34('0x35')]||_0x345985[_0xfe34('0x35')]!==_0xfe34('0x36')){logger[_0xfe34('0x37')](util['format'](_0xfe34('0x38'),_0x431e54['id']),util['inspect'](_0x345985,{'showHidden':![],'depth':null}));}}_0x23fb18();});});}function checkTranscribe(){var _0x1914ae;var _0x36c9cd;var _0x2d8fcd;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0xfe34('0x39')}})['then'](function(_0x555a3f){if(!_0x555a3f||!_0x555a3f[_0xfe34('0x17')]){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x3a'));}_0x1914ae=_0x555a3f;return db['Setting'][_0xfe34('0x24')]({'where':{'id':0x1}});})[_0xfe34('0xc')](function(_0x61a21f){if(!_0x61a21f){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))](_0xfe34('0x3b'));}_0x36c9cd=_0x61a21f;if(!_0x36c9cd[_0xfe34('0x3')]||!_0x36c9cd[_0xfe34('0x3c')]||!_0x36c9cd['transcribeRegion']||!_0x36c9cd[_0xfe34('0x1f')]||!_0x36c9cd[_0xfe34('0x20')]){throw new db[(_0xfe34('0x1b'))][(_0xfe34('0x1c'))]('Transcribe\x20not\x20configured');}return db[_0xfe34('0x23')][_0xfe34('0x24')]({'where':{'id':_0x36c9cd[_0xfe34('0x3c')]}});})['then'](function(_0x563b43){if(!_0x563b43){throw new db['Sequelize'][(_0xfe34('0x1c'))](_0xfe34('0x25'));}if(!_0x563b43['data1']||!_0x563b43[_0xfe34('0xb')]){throw new db['Sequelize'][(_0xfe34('0x1c'))](_0xfe34('0x26'));}_0x2d8fcd=_0x563b43;var _0x11b64c=[];_0x1914ae[_0xfe34('0x3d')](function(_0x3ab1cc){_0x11b64c['push'](checkTranscribeJob(_0x3ab1cc,_0x36c9cd,_0x2d8fcd));});return BPromise[_0xfe34('0x3e')](_0x11b64c);})[_0xfe34('0x34')](function(_0x8cbfa9){if(_0x8cbfa9){if(!_0x8cbfa9[_0xfe34('0x35')]||_0x8cbfa9['name']!=='SequelizeValidationError'){logger[_0xfe34('0x37')](util[_0xfe34('0x3f')](_0x8cbfa9,{'showHidden':![],'depth':null}));}}});}exports[_0xfe34('0x40')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x854f=['sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','all','catch','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','Sequelize','sentiment'];(function(_0x283e4b,_0x5f51ef){var _0x111bcb=function(_0x13e446){while(--_0x13e446){_0x283e4b['push'](_0x283e4b['shift']());}};_0x111bcb(++_0x5f51ef);}(_0x854f,0xc1));var _0xf854=function(_0x317135,_0x3af514){_0x317135=_0x317135-0x0;var _0x5b736c=_0x854f[_0x317135];return _0x5b736c;};var _=require(_0xf854('0x0'));var AWS=require(_0xf854('0x1'));var rp=require(_0xf854('0x2'));var util=require(_0xf854('0x3'));var BPromise=require(_0xf854('0x4'));var db=require(_0xf854('0x5'))['db'];var logger=require('../../config/logger')(_0xf854('0x6'));function getTranscriptionJob(_0x5924e6,_0x2de78d,_0x1d96f3,_0x1b350f){return new Promise(function(_0x1f5ec4,_0x4b1ca8){var _0x93d685=new AWS[(_0xf854('0x7'))]({'accessKeyId':_0x2de78d,'secretAccessKey':_0x5924e6,'region':_0x1d96f3});_0x93d685[_0xf854('0x8')]({'TranscriptionJobName':_0x1b350f},function(_0x6d2799,_0x44be6b){if(_0x6d2799){return _0x4b1ca8(_0x6d2799);}else{return _0x1f5ec4(_0x44be6b);}});});}function sentiment(_0x5df1ce,_0x9998ce,_0x321775,_0x56f3b9,_0x2f9d1b){return new Promise(function(_0x331489,_0x223385){var _0x5e58e2=new AWS[(_0xf854('0x9'))]({'accessKeyId':_0x9998ce,'secretAccessKey':_0x5df1ce,'region':_0x321775});_0x5e58e2[_0xf854('0xa')]({'Text':_0x56f3b9,'LanguageCode':_0x2f9d1b[_0xf854('0xb')](0x0,0x2)},function(_0x3eca71,_0x574fd7){if(_0x3eca71){return _0x223385(_0x3eca71);}else{return _0x331489(_0x574fd7);}});});}function checkTranscribeJob(_0x38d609,_0x19d849,_0xdaa0a5){var _0x3239b4;return new BPromise(function(_0x2a8094,_0x1de773){logger[_0xf854('0xc')](util['format'](_0xf854('0xd'),_0x38d609['id'],_0x38d609[_0xf854('0xe')]));return getTranscriptionJob(_0xdaa0a5['data1'],_0xdaa0a5[_0xf854('0xf')],_0x19d849[_0xf854('0x10')],_0x38d609[_0xf854('0xe')])['then'](function(_0x196ed8){logger[_0xf854('0xc')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x38d609['id'],_0x38d609[_0xf854('0xe')],_0x196ed8[_0xf854('0x11')][_0xf854('0x12')]));if(!_0x38d609[_0xf854('0x13')]){switch(_0x196ed8[_0xf854('0x11')][_0xf854('0x12')]){case'COMPLETED':var _0x17c3f4={'transcribeStatus':_0x196ed8[_0xf854('0x11')]['TranscriptionJobStatus'],'fileUri':_0x196ed8[_0xf854('0x11')]['Transcript'][_0xf854('0x14')]};logger[_0xf854('0xc')](util[_0xf854('0x15')](_0xf854('0x16'),_0x38d609['id']));return rp({'uri':_0x196ed8['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})['then'](function(_0xf3ab01){logger['info'](util[_0xf854('0x15')](_0xf854('0x17'),_0x38d609['id']));if(_0xf3ab01&&_0xf3ab01['results']&&_0xf3ab01[_0xf854('0x18')]['transcripts']&&_0xf3ab01[_0xf854('0x18')][_0xf854('0x19')][_0xf854('0x1a')]){_0x17c3f4['fileText']='';for(var _0x4bf3b2=0x0;_0x4bf3b2<_0xf3ab01['results'][_0xf854('0x19')][_0xf854('0x1a')];_0x4bf3b2++){_0x17c3f4[_0xf854('0x13')]+=_0xf3ab01[_0xf854('0x18')][_0xf854('0x19')][_0x4bf3b2][_0xf854('0x1b')]+'';}}return _0x38d609[_0xf854('0x1c')](_0x17c3f4);})[_0xf854('0x1d')](function(){logger[_0xf854('0xc')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x38d609['id']));if(!_0x38d609['tempSentiment']){throw new db[(_0xf854('0x1e'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x19d849[_0xf854('0x1f')]||!_0x19d849[_0xf854('0x20')]||!_0x19d849[_0xf854('0x21')]||!_0x19d849[_0xf854('0x22')]||!_0x19d849[_0xf854('0x23')]){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))](_0xf854('0x25'));}if(!_0x17c3f4[_0xf854('0x13')]){throw new Error(_0xf854('0x26'));}if(_0x19d849['sentimentAccountId']===_0xdaa0a5['id']){return _0xdaa0a5;}else{return db[_0xf854('0x27')][_0xf854('0x28')]({'where':{'id':_settings[_0xf854('0x20')]}});}})[_0xf854('0x1d')](function(_0x503b06){if(!_0x503b06){throw new db[(_0xf854('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x503b06['data1']||!_0x503b06[_0xf854('0xf')]){throw new db[(_0xf854('0x1e'))]['ValidationError'](_0xf854('0x29'));}_0x3239b4=_0x503b06;logger[_0xf854('0xc')](util[_0xf854('0x15')](_0xf854('0x2a'),_0x38d609['id']));return sentiment(_0x3239b4['data1'],_0x3239b4[_0xf854('0xf')],_0x19d849[_0xf854('0x21')],_0x17c3f4['fileText'],_0x19d849[_0xf854('0x22')]);})[_0xf854('0x1d')](function(_0x336535){logger[_0xf854('0xc')](util[_0xf854('0x15')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x38d609['id']));return _0x38d609['update']({'sentiment':_0x336535[_0xf854('0x2b')],'sPositive':_0x336535[_0xf854('0x2c')]['Positive'],'sNegative':_0x336535[_0xf854('0x2c')][_0xf854('0x2d')],'sMixed':_0x336535['SentimentScore'][_0xf854('0x2e')],'sNeutral':_0x336535[_0xf854('0x2c')][_0xf854('0x2f')]});})[_0xf854('0x1d')](function(){logger[_0xf854('0xc')](util[_0xf854('0x15')](_0xf854('0x30'),_0x38d609['id']));_0x2a8094();});case _0xf854('0x31'):return _0x38d609['update']({'transcribeStatus':_0xf854('0x31'),'failureReason':_0x196ed8[_0xf854('0x11')][_0xf854('0x32')]})['then'](function(){logger[_0xf854('0xc')](util[_0xf854('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x38d609['id']));_0x2a8094();});default:logger[_0xf854('0xc')](util[_0xf854('0x15')](_0xf854('0x33'),_0x38d609['id']));break;}}else{return BPromise[_0xf854('0x34')]()[_0xf854('0x1d')](function(){if(!_0x38d609[_0xf854('0x35')]){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))](_0xf854('0x36'));}if(!_0x19d849[_0xf854('0x1f')]||!_0x19d849[_0xf854('0x20')]||!_0x19d849[_0xf854('0x21')]||!_0x19d849['language']||!_0x19d849[_0xf854('0x23')]){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x38d609[_0xf854('0x13')]){throw new Error(_0xf854('0x26'));}if(_0x19d849[_0xf854('0x20')]===_0xdaa0a5['id']){return _0xdaa0a5;}else{return db[_0xf854('0x27')][_0xf854('0x28')]({'where':{'id':_settings[_0xf854('0x20')]}});}})[_0xf854('0x1d')](function(_0x39d776){if(!_0x39d776){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))](_0xf854('0x37'));}if(!_0x39d776[_0xf854('0x38')]||!_0x39d776[_0xf854('0xf')]){throw new db['Sequelize'][(_0xf854('0x24'))](_0xf854('0x29'));}_0x3239b4=_0x39d776;logger[_0xf854('0xc')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x38d609['id']));return sentiment(_0x3239b4[_0xf854('0x38')],_0x3239b4[_0xf854('0xf')],_0x19d849[_0xf854('0x21')],_0x38d609[_0xf854('0x13')],_0x19d849[_0xf854('0x22')]);})[_0xf854('0x1d')](function(_0x5de718){logger['info'](util[_0xf854('0x15')](_0xf854('0x39'),_0x38d609['id']));return _0x38d609[_0xf854('0x1c')]({'sentiment':_0x5de718[_0xf854('0x2b')],'sPositive':_0x5de718['SentimentScore'][_0xf854('0x3a')],'sNegative':_0x5de718[_0xf854('0x2c')][_0xf854('0x2d')],'sMixed':_0x5de718[_0xf854('0x2c')]['Mixed'],'sNeutral':_0x5de718[_0xf854('0x2c')][_0xf854('0x2f')],'transcribeStatus':_0xf854('0x3b')});})[_0xf854('0x1d')](function(){logger['info'](util[_0xf854('0x15')](_0xf854('0x30'),_0x38d609['id']));_0x2a8094();});}})['catch'](function(_0x2c667e){if(_0x2c667e){if(!_0x2c667e[_0xf854('0x3c')]||_0x2c667e[_0xf854('0x3c')]!==_0xf854('0x3d')){logger[_0xf854('0x3e')](util['format'](_0xf854('0x3f'),_0x38d609['id']),util[_0xf854('0x40')](_0x2c667e,{'showHidden':![],'depth':null}));}}_0x2a8094();});});}function checkTranscribe(){var _0x531889;var _0x38be68;var _0x5286fb;return db[_0xf854('0x41')][_0xf854('0x42')]({'where':{'transcribeStatus':_0xf854('0x43')}})['then'](function(_0x54d9cc){if(!_0x54d9cc||!_0x54d9cc[_0xf854('0x1a')]){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))](_0xf854('0x44'));}_0x531889=_0x54d9cc;return db[_0xf854('0x45')][_0xf854('0x28')]({'where':{'id':0x1}});})[_0xf854('0x1d')](function(_0x59831e){if(!_0x59831e){throw new db[(_0xf854('0x1e'))]['ValidationError'](_0xf854('0x46'));}_0x38be68=_0x59831e;if(!_0x38be68[_0xf854('0x6')]||!_0x38be68['transcribeAccountId']||!_0x38be68[_0xf854('0x10')]||!_0x38be68['language']||!_0x38be68['bucket']){throw new db[(_0xf854('0x1e'))][(_0xf854('0x24'))]('Transcribe\x20not\x20configured');}return db[_0xf854('0x27')][_0xf854('0x28')]({'where':{'id':_0x38be68[_0xf854('0x47')]}});})[_0xf854('0x1d')](function(_0x44c94b){if(!_0x44c94b){throw new db['Sequelize'][(_0xf854('0x24'))](_0xf854('0x37'));}if(!_0x44c94b[_0xf854('0x38')]||!_0x44c94b[_0xf854('0xf')]){throw new db['Sequelize'][(_0xf854('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0x5286fb=_0x44c94b;var _0x6e3d3b=[];_0x531889[_0xf854('0x48')](function(_0x3f69ca){_0x6e3d3b['push'](checkTranscribeJob(_0x3f69ca,_0x38be68,_0x5286fb));});return BPromise[_0xf854('0x49')](_0x6e3d3b);})[_0xf854('0x4a')](function(_0x59a8d8){if(_0x59a8d8){if(!_0x59a8d8[_0xf854('0x3c')]||_0x59a8d8[_0xf854('0x3c')]!==_0xf854('0x3d')){logger[_0xf854('0x3e')](util[_0xf854('0x40')](_0x59a8d8,{'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 5f196da..32b8aa7 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 _0x7b77=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../../mysqldb','redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','update','system'];(function(_0x411c8c,_0x4183c5){var _0x39b294=function(_0x1fc199){while(--_0x1fc199){_0x411c8c['push'](_0x411c8c['shift']());}};_0x39b294(++_0x4183c5);}(_0x7b77,0x8c));var _0x77b7=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7b77[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x77b7('0x0'));var moment=require(_0x77b7('0x1'));var Redis=require(_0x77b7('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x77b7('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x77b7('0x4')]=_['defaults'](config[_0x77b7('0x4')],{'host':_0x77b7('0x5'),'port':0x18eb});var io=require(_0x77b7('0x6'))(new Redis(config[_0x77b7('0x4')]));function closeInteractions(){var _0x748456=[];return db[_0x77b7('0x7')]['findAll']({'raw':!![],'attributes':['id',_0x77b7('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x77b7('0x9')](0x18,_0x77b7('0xa'))}}})[_0x77b7('0xb')](function(_0x4caba5){if(_0x4caba5&&_0x4caba5[_0x77b7('0xc')]){_0x748456=_[_0x77b7('0xd')](_0x4caba5||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x748456['join']());return db[_0x77b7('0x7')][_0x77b7('0xe')]({'closeReason':_0x77b7('0xf'),'disposition':_0x77b7('0x10'),'closed':!![],'closedAt':moment()[_0x77b7('0x11')](_0x77b7('0x12'))},{'where':{'id':_0x748456}});}})['then'](function(){if(_0x748456&&_0x748456['length']){logger['info'](_0x77b7('0x13'),_0x748456['join']());for(var _0x2079e5=0x0;_0x2079e5<_0x748456[_0x77b7('0xc')];_0x2079e5++){io[_0x77b7('0x14')](_0x77b7('0x15'),{'id':_0x748456[_0x2079e5],'closed':!![]});}}})[_0x77b7('0x16')](function(_0x18d486){logger[_0x77b7('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x18d486?util[_0x77b7('0x18')](_0x18d486,{'showHidden':![],'depth':null}):'');});}exports[_0x77b7('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf4da=['format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','update','system','timeout'];(function(_0x76a7ae,_0x490d47){var _0x12eeb4=function(_0x237f15){while(--_0x237f15){_0x76a7ae['push'](_0x76a7ae['shift']());}};_0x12eeb4(++_0x490d47);}(_0xf4da,0x190));var _0xaf4d=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xf4da[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0xaf4d('0x0'));var moment=require(_0xaf4d('0x1'));var Redis=require(_0xaf4d('0x2'));var util=require(_0xaf4d('0x3'));var config=require(_0xaf4d('0x4'));var db=require(_0xaf4d('0x5'))['db'];var logger=require(_0xaf4d('0x6'))(_0xaf4d('0x7'));config[_0xaf4d('0x8')]=_[_0xaf4d('0x9')](config[_0xaf4d('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xaf4d('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0xdffcf1=[];return db[_0xaf4d('0xb')][_0xaf4d('0xc')]({'raw':!![],'attributes':['id',_0xaf4d('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xaf4d('0xe'))}}})[_0xaf4d('0xf')](function(_0x1462c8){if(_0x1462c8&&_0x1462c8[_0xaf4d('0x10')]){_0xdffcf1=_['map'](_0x1462c8||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0xdffcf1['join']());return db[_0xaf4d('0xb')][_0xaf4d('0x11')]({'closeReason':_0xaf4d('0x12'),'disposition':_0xaf4d('0x13'),'closed':!![],'closedAt':moment()[_0xaf4d('0x14')](_0xaf4d('0x15'))},{'where':{'id':_0xdffcf1}});}})[_0xaf4d('0xf')](function(){if(_0xdffcf1&&_0xdffcf1[_0xaf4d('0x10')]){logger[_0xaf4d('0x16')](_0xaf4d('0x17'),_0xdffcf1['join']());for(var _0x51a8f6=0x0;_0x51a8f6<_0xdffcf1[_0xaf4d('0x10')];_0x51a8f6++){io[_0xaf4d('0x18')](_0xaf4d('0x19'),{'id':_0xdffcf1[_0x51a8f6],'closed':!![]});}}})[_0xaf4d('0x1a')](function(_0x15d598){logger[_0xaf4d('0x1b')](_0xaf4d('0x1c'),_0x15d598?util[_0xaf4d('0x1d')](_0x15d598,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 90a6305..013f1bd 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','CmContact','contacts2','hopper2','catch','util'];(function(_0x5ba802,_0x34a96a){var _0x30866e=function(_0x2c3dd5){while(--_0x2c3dd5){_0x5ba802['push'](_0x5ba802['shift']());}};_0x30866e(++_0x34a96a);}(_0x0713,0x117));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3071('0x0'));var db=require(_0x3071('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3071('0x2')]({'id':i,'firstName':_0x3071('0x3')+i,'lastName':_0x3071('0x4')+i,'phone':0xf879fb460+i,'email':_0x3071('0x5')+i+_0x3071('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3071('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3071('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3071('0x7')](),'updatedAt':Date[_0x3071('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3071('0x2')]({'id':i,'firstName':_0x3071('0x3')+i,'lastName':_0x3071('0x4')+i,'phone':0xf879fb460+i,'email':_0x3071('0x5')+i+_0x3071('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3071('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3071('0x7')](),'updatedAt':Date['now']()});}db['CmContact'][_0x3071('0x8')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x3071('0x9')](function(){console[_0x3071('0xa')](_0x3071('0xb'),_0x3071('0xc'));return db[_0x3071('0xd')][_0x3071('0x8')]({'where':{}});})['then'](function(){return db[_0x3071('0xd')][_0x3071('0xe')](hopper);})[_0x3071('0x9')](function(){console['log']('finished\x20populating',_0x3071('0xf'));return db[_0x3071('0x10')][_0x3071('0xe')](contacts2);})[_0x3071('0x9')](function(){console[_0x3071('0xa')](_0x3071('0xb'),_0x3071('0x11'));return db[_0x3071('0xd')]['bulkCreate'](hopper2);})[_0x3071('0x9')](function(){console[_0x3071('0xa')](_0x3071('0xb'),_0x3071('0x12'));})[_0x3071('0x13')](function(_0xf54daa){console[_0x3071('0xa')](_0xf54daa);}); \ No newline at end of file +var _0xb443=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','catch','util','push'];(function(_0x442f4a,_0x4e6b34){var _0x5dfffe=function(_0x4ffa30){while(--_0x4ffa30){_0x442f4a['push'](_0x442f4a['shift']());}};_0x5dfffe(++_0x4e6b34);}(_0xb443,0x18a));var _0x3b44=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb443[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x3b44('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3b44('0x1')]({'id':i,'firstName':_0x3b44('0x2')+i,'lastName':_0x3b44('0x3')+i,'phone':0xf879fb460+i,'email':_0x3b44('0x4')+i+_0x3b44('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3b44('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x3b44('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3b44('0x6')](),'updatedAt':Date[_0x3b44('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3b44('0x1')]({'id':i,'firstName':_0x3b44('0x2')+i,'lastName':_0x3b44('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x3b44('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3b44('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x3b44('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3b44('0x6')](),'updatedAt':Date[_0x3b44('0x6')]()});}db[_0x3b44('0x7')][_0x3b44('0x8')]({'where':{}})[_0x3b44('0x9')](function(){return db[_0x3b44('0x7')][_0x3b44('0xa')](contacts);})[_0x3b44('0x9')](function(){console[_0x3b44('0xb')](_0x3b44('0xc'),_0x3b44('0xd'));return db[_0x3b44('0xe')][_0x3b44('0x8')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x3b44('0x9')](function(){console['log'](_0x3b44('0xc'),_0x3b44('0xf'));return db[_0x3b44('0x7')][_0x3b44('0xa')](contacts2);})[_0x3b44('0x9')](function(){console['log'](_0x3b44('0xc'),_0x3b44('0x10'));return db[_0x3b44('0xe')][_0x3b44('0xa')](hopper2);})[_0x3b44('0x9')](function(){console[_0x3b44('0xb')](_0x3b44('0xc'),'hopper2');})[_0x3b44('0x11')](function(_0x5dc3b1){console[_0x3b44('0xb')](_0x5dc3b1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 61546fa..ff7b336 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4768=['push','format','%s%s','agent','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','then','log','add\x20user','catch','util'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4768,0x1e5));var _0x8476=function(_0x14602d,_0x1f1d6a){_0x14602d=_0x14602d-0x0;var _0x3ae043=_0x4768[_0x14602d];return _0x3ae043;};'use strict';var util=require(_0x8476('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8476('0x1')]({'name':util[_0x8476('0x2')](_0x8476('0x3'),_0x8476('0x4'),i),'fullname':util[_0x8476('0x2')](_0x8476('0x3'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x8476('0x4'),i),'role':'agent','password':_0x8476('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x8476('0x6'),'ws',_0x8476('0x7')],'disallow':[_0x8476('0x8')],'allow':['ulaw'],'defaultuser':util[_0x8476('0x2')](_0x8476('0x3'),_0x8476('0x4'),i),'encryption':_0x8476('0x9'),'avpf':'yes','force_avp':_0x8476('0x9'),'icesupport':_0x8476('0x9'),'dtlsenable':_0x8476('0x9'),'dtlsverify':'no','dtlscertfile':_0x8476('0xa'),'dtlsprivatekey':_0x8476('0xb'),'dtlssetup':_0x8476('0xc'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x8476('0x2')](_0x8476('0x3'),_0x8476('0x4'),i),0xfa0+i)});}db[_0x8476('0xd')]['bulkCreate'](users)[_0x8476('0xe')](function(){console[_0x8476('0xf')](_0x8476('0x10'));})[_0x8476('0x11')](function(_0x3577f6){console[_0x8476('0xf')](_0x3577f6);}); \ No newline at end of file +var _0x6194=['../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util'];(function(_0x4af1fd,_0x166611){var _0x2acc3a=function(_0x32aa97){while(--_0x32aa97){_0x4af1fd['push'](_0x4af1fd['shift']());}};_0x2acc3a(++_0x166611);}(_0x6194,0xf6));var _0x4619=function(_0x3fd25b,_0x159e24){_0x3fd25b=_0x3fd25b-0x0;var _0x47d207=_0x6194[_0x3fd25b];return _0x47d207;};'use strict';var util=require(_0x4619('0x0'));var db=require(_0x4619('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4619('0x2')]({'name':util[_0x4619('0x3')](_0x4619('0x4'),_0x4619('0x5'),i),'fullname':util[_0x4619('0x3')](_0x4619('0x4'),_0x4619('0x5'),i),'email':util[_0x4619('0x3')](_0x4619('0x6'),_0x4619('0x5'),i),'role':_0x4619('0x5'),'password':_0x4619('0x7'),'internal':0xfa0+i,'type':_0x4619('0x8'),'transport':[_0x4619('0x9'),'ws',_0x4619('0xa')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x4619('0x3')]('%s%s',_0x4619('0x5'),i),'encryption':_0x4619('0xb'),'avpf':_0x4619('0xb'),'force_avp':_0x4619('0xb'),'icesupport':_0x4619('0xb'),'dtlsenable':_0x4619('0xb'),'dtlsverify':'no','dtlscertfile':_0x4619('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x4619('0xd'),'callerid':util[_0x4619('0x3')](_0x4619('0xe'),util[_0x4619('0x3')](_0x4619('0x4'),_0x4619('0x5'),i),0xfa0+i)});}db[_0x4619('0xf')][_0x4619('0x10')](users)[_0x4619('0x11')](function(){console[_0x4619('0x12')]('add\x20user');})['catch'](function(_0x427d65){console[_0x4619('0x12')](_0x427d65);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index a9fece9..5654da5 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1691=['user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','autoAssociation','ChatQueues','SmsQueues','MailQueues','Telephones','Trunks','findAll','UserProfileResource','resourceId','map','where','Campaign','%s:queue:%s','length','format','user:%s','query','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','then','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','VoiceQueues','VoiceQueue','FaxQueues','userProfileId','OpenchannelQueues','WhatsappQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions'];(function(_0xcc028c,_0x534fd4){var _0x46dd0f=function(_0x21bbe3){while(--_0x21bbe3){_0xcc028c['push'](_0xcc028c['shift']());}};_0x46dd0f(++_0x534fd4);}(_0x1691,0x1ed));var _0x1169=function(_0x49111a,_0x2539ab){_0x49111a=_0x49111a-0x0;var _0x2a6831=_0x1691[_0x49111a];return _0x2a6831;};'use strict';var _=require(_0x1169('0x0'));var util=require(_0x1169('0x1'));var BPromise=require('bluebird');var db=require(_0x1169('0x2'))['db'];var config=require(_0x1169('0x3'));var queryQueues={'attributes':['id',_0x1169('0x4')],'include':[{'as':_0x1169('0x5'),'model':db[_0x1169('0x6')],'attributes':['id',_0x1169('0x4'),_0x1169('0x7')],'raw':!![],'where':{'role':_0x1169('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1169('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1169('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1169('0x4'),_0x1169('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x216548,_0x20440a,_0xe3a0bc){return db[_0x1169('0xb')][_0x1169('0xc')]({'where':{'name':_0x216548,'userProfileId':_0x20440a},'raw':!![]})['then'](function(_0x1a4400){if(_0x1a4400){if(_0x1a4400[_0x1169('0xd')]){switch(_0x216548){case'VoiceQueues':case _0x1169('0xe'):case'FaxQueues':case _0x1169('0xf'):case _0x1169('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0xe3a0bc]['findAll'](queryQueues);case _0x1169('0x11'):return db[_0xe3a0bc]['findAll'](queryTelephones);case _0x1169('0x12'):return db[_0xe3a0bc][_0x1169('0x13')](queryTrunks);case'IvrCampaigns':return db[_0xe3a0bc][_0x1169('0x13')](queryCampaigns);}}else{return db[_0x1169('0x14')][_0x1169('0x13')]({'attributes':[_0x1169('0x15')],'where':{'sectionId':_0x1a4400['id']},'raw':!![]})['then'](function(_0x4c4b90){if(_0x4c4b90){var _0x34462b={'where':{'id':_[_0x1169('0x16')](_0x4c4b90,_0x1169('0x15'))},'raw':!![]};switch(_0xe3a0bc){case _0x1169('0x6'):_0x34462b[_0x1169('0x17')][_0x1169('0x7')]=_0x1169('0x9');break;case _0x1169('0x18'):_0x34462b['where'][_0x1169('0xa')]='ivr';break;}return db[_0xe3a0bc][_0x1169('0x13')](_0x34462b);}else{return[];}});}}else{return[];}})['then'](function(_0x4d608a){return _0x4d608a;});}function joinOrLeaveQueues(_0x9c68cb,_0x54f260,_0x539535,_0x35f0be){_0x9c68cb[_0x54f260](util['format'](_0x1169('0x19'),_0x539535,_0x35f0be[_0x1169('0x4')]));if(_0x35f0be[_0x1169('0x5')]){for(var _0x1b6af6=0x0;_0x1b6af6<_0x35f0be[_0x1169('0x5')][_0x1169('0x1a')];_0x1b6af6+=0x1){_0x9c68cb[_0x54f260](util[_0x1169('0x1b')](_0x1169('0x1c'),_0x35f0be['Agents'][_0x1b6af6][_0x1169('0x4')]));}}}function joinOrLeave(_0x157691,_0x301646,_0x277f69){var _0x21e826;if(_0x157691['handshake']['query']['id']){db[_0x1169('0x6')]['find']({'attributes':['id',_0x1169('0x4'),_0x1169('0x7'),'userProfileId'],'where':{'id':_0x157691['handshake'][_0x1169('0x1d')]['id']},'include':[{'model':db[_0x1169('0x1e')],'as':_0x1169('0x1f'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1169('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x1169('0x21')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1169('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1169('0x23')],'as':_0x1169('0x24'),'attributes':['id'],'raw':!![]}]})[_0x1169('0x25')](function(_0x40ad8b){if(_0x40ad8b){_0x21e826=_0x40ad8b;_0x157691[_0x301646](util[_0x1169('0x1b')](_0x1169('0x1c'),_0x40ad8b['name']));var _0x4dc1b2=[];switch(_0x40ad8b[_0x1169('0x7')]){case _0x1169('0x26'):_0x157691[_0x301646](_0x1169('0x27'));_0x157691[_0x301646](_0x1169('0x28'));if(queryQueues[_0x1169('0x29')](_0x1169('0x2a'))){delete queryQueues[_0x1169('0x2a')];}_0x4dc1b2['push'](db['VoiceQueue']['findAll'](queryQueues));_0x4dc1b2['push'](db['ChatQueue'][_0x1169('0x13')](queryQueues));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x2c')]['findAll'](queryQueues));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x2d')][_0x1169('0x13')](queryQueues));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x2e')][_0x1169('0x13')](queryQueues));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x2f')][_0x1169('0x13')](queryQueues));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x30')]['findAll'](queryQueues));_0x4dc1b2['push'](db[_0x1169('0x6')]['findAll'](queryTelephones));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x31')][_0x1169('0x13')](queryTrunks));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x18')]['findAll'](queryCampaigns));_0x4dc1b2[_0x1169('0x2b')](db['User'][_0x1169('0x13')](queryAgents));break;case'user':_0x157691[_0x301646](_0x1169('0x27'));_0x157691[_0x301646](_0x1169('0x28'));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0x32'),_0x40ad8b['userProfileId'],_0x1169('0x33')));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0xe'),_0x40ad8b['userProfileId'],'ChatQueue'));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0x34'),_0x40ad8b[_0x1169('0x35')],_0x1169('0x2c')));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0xf'),_0x40ad8b['userProfileId'],_0x1169('0x2d')));_0x4dc1b2['push'](getAssociatedResources(_0x1169('0x10'),_0x40ad8b[_0x1169('0x35')],'MailQueue'));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0x36'),_0x40ad8b[_0x1169('0x35')],_0x1169('0x2f')));_0x4dc1b2['push'](getAssociatedResources(_0x1169('0x37'),_0x40ad8b[_0x1169('0x35')],'WhatsappQueue'));_0x4dc1b2['push'](getAssociatedResources(_0x1169('0x11'),_0x40ad8b[_0x1169('0x35')],'User'));_0x4dc1b2['push'](getAssociatedResources('Trunks',_0x40ad8b['userProfileId'],_0x1169('0x31')));_0x4dc1b2[_0x1169('0x2b')](getAssociatedResources(_0x1169('0x38'),_0x40ad8b[_0x1169('0x35')],_0x1169('0x18')));_0x4dc1b2[_0x1169('0x2b')](db[_0x1169('0x6')][_0x1169('0x13')](queryAgents));break;case _0x1169('0x8'):_0x157691[_0x301646](_0x1169('0x27'));_0x157691[_0x301646](_0x1169('0x28'));_0x4dc1b2[_0x1169('0x2b')](_0x40ad8b[_0x1169('0x39')]({'attributes':['id','name']}));_0x4dc1b2[_0x1169('0x2b')](_0x40ad8b[_0x1169('0x3a')]({'attributes':['id',_0x1169('0x4')]}));_0x4dc1b2[_0x1169('0x2b')](_0x40ad8b[_0x1169('0x3b')]({'attributes':['id','name']}));_0x4dc1b2['push'](_0x40ad8b[_0x1169('0x3c')]({'attributes':['id',_0x1169('0x4')]}));_0x4dc1b2[_0x1169('0x2b')](_0x40ad8b[_0x1169('0x3d')]({'attributes':['id',_0x1169('0x4')]}));_0x4dc1b2['push'](_0x40ad8b['getOpenchannelQueues']({'attributes':['id',_0x1169('0x4')]}));_0x4dc1b2['push'](_0x40ad8b['getWhatsappQueues']({'attributes':['id',_0x1169('0x4')]}));break;}return BPromise[_0x1169('0x3e')](_0x4dc1b2);}})['then'](function(_0x35fa61){if(_0x35fa61&&_0x35fa61['length']){for(var _0x154993=0x0;_0x154993<_0x35fa61[_0x1169('0x1a')];_0x154993+=0x1){for(var _0x572430=0x0;_0x572430<_0x35fa61[_0x154993][_0x1169('0x1a')];_0x572430+=0x1){switch(_0x154993){case 0x0:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x3f'),_0x35fa61[_0x154993][_0x572430]);break;case 0x1:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x40'),_0x35fa61[_0x154993][_0x572430]);break;case 0x2:joinOrLeaveQueues(_0x157691,_0x301646,'fax',_0x35fa61[_0x154993][_0x572430]);break;case 0x3:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x41'),_0x35fa61[_0x154993][_0x572430]);break;case 0x4:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x42'),_0x35fa61[_0x154993][_0x572430]);break;case 0x5:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x43'),_0x35fa61[_0x154993][_0x572430]);break;case 0x6:joinOrLeaveQueues(_0x157691,_0x301646,_0x1169('0x44'),_0x35fa61[_0x154993][_0x572430]);break;case 0x7:if(_0x21e826['role']!==_0x1169('0x8'))_0x157691[_0x301646](util[_0x1169('0x1b')](_0x1169('0x45'),_0x35fa61[_0x154993][_0x572430][_0x1169('0x4')]));break;case 0x8:if(_0x21e826[_0x1169('0x7')]!==_0x1169('0x8'))_0x157691[_0x301646](util[_0x1169('0x1b')](_0x1169('0x46'),_0x35fa61[_0x154993][_0x572430][_0x1169('0x4')]));break;case 0x9:if(_0x21e826[_0x1169('0x7')]!==_0x1169('0x8'))_0x157691[_0x301646](util['format'](_0x1169('0x47'),_0x35fa61[_0x154993][_0x572430][_0x1169('0xa')],_0x35fa61[_0x154993][_0x572430]['name']));break;case 0xa:_0x157691[_0x301646](util[_0x1169('0x1b')](_0x1169('0x1c'),_0x35fa61[_0x154993][_0x572430][_0x1169('0x4')]));break;}}}}})[_0x1169('0x25')](function(){if(_0x301646===_0x1169('0x48')){var _0x54164d=_[_0x1169('0x16')](_0x21e826[_0x1169('0x1f')],'id');return _0x21e826[_0x1169('0x49')](_0x54164d)[_0x1169('0x25')](function(){for(var _0x32ab01=0x0;_0x32ab01<_0x54164d['length'];_0x32ab01+=0x1){_0x277f69[_0x1169('0x4a')](_0x1169('0x4b'),{'ChatInteractionId':Number(_0x54164d[_0x32ab01]),'UserId':Number(_0x21e826['id'])});}});}})[_0x1169('0x25')](function(){if(_0x301646===_0x1169('0x48')){var _0x20ff11=_[_0x1169('0x16')](_0x21e826[_0x1169('0x20')],'id');return _0x21e826[_0x1169('0x4c')](_0x20ff11)[_0x1169('0x25')](function(){for(var _0xe6897a=0x0;_0xe6897a<_0x20ff11['length'];_0xe6897a+=0x1){_0x277f69['emit'](_0x1169('0x4d'),{'MailInteractionId':Number(_0x20ff11[_0xe6897a]),'UserId':Number(_0x21e826['id'])});}});}})[_0x1169('0x25')](function(){if(_0x301646===_0x1169('0x48')){var _0x2ddc26=_[_0x1169('0x16')](_0x21e826['FaxInteractions'],'id');return _0x21e826[_0x1169('0x4e')](_0x2ddc26)[_0x1169('0x25')](function(){for(var _0xa2b703=0x0;_0xa2b703<_0x2ddc26[_0x1169('0x1a')];_0xa2b703+=0x1){_0x277f69[_0x1169('0x4a')](_0x1169('0x4f'),{'FaxInteractionId':Number(_0x2ddc26[_0xa2b703]),'UserId':Number(_0x21e826['id'])});}});}})[_0x1169('0x25')](function(){if(_0x301646===_0x1169('0x48')){var _0x5d9da2=_[_0x1169('0x16')](_0x21e826[_0x1169('0x50')],'id');return _0x21e826['removeSmsInteractions'](_0x5d9da2)['then'](function(){for(var _0x881854=0x0;_0x881854<_0x5d9da2[_0x1169('0x1a')];_0x881854+=0x1){_0x277f69[_0x1169('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5d9da2[_0x881854]),'UserId':Number(_0x21e826['id'])});}});}})[_0x1169('0x25')](function(){if(_0x301646===_0x1169('0x48')){var _0x4f6932=_[_0x1169('0x16')](_0x21e826[_0x1169('0x22')],'id');return _0x21e826[_0x1169('0x51')](_0x4f6932)[_0x1169('0x25')](function(){for(var _0x220ab9=0x0;_0x220ab9<_0x4f6932[_0x1169('0x1a')];_0x220ab9+=0x1){_0x277f69[_0x1169('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4f6932[_0x220ab9]),'UserId':Number(_0x21e826['id'])});}});}})['then'](function(){if(_0x301646===_0x1169('0x48')){var _0x2ebe38=_[_0x1169('0x16')](_0x21e826[_0x1169('0x24')],'id');return _0x21e826[_0x1169('0x52')](_0x2ebe38)[_0x1169('0x25')](function(){for(var _0x2e2c14=0x0;_0x2e2c14<_0x2ebe38[_0x1169('0x1a')];_0x2e2c14+=0x1){_0x277f69['emit'](_0x1169('0x53'),{'WhatsappInteractionId':Number(_0x2ebe38[_0x2e2c14]),'UserId':Number(_0x21e826['id'])});}});}})['catch'](function(_0x224cac){_0x157691[_0x1169('0x54')](_0x224cac);});}}function onDisconnect(_0x429b80,_0x5da8ef){joinOrLeave(_0x429b80,'leave',_0x5da8ef);}function onConnect(_0x2cf9b7){joinOrLeave(_0x2cf9b7,_0x1169('0x55'));}exports[_0x1169('0x56')]=function(_0x44b33f){_0x44b33f['on'](_0x1169('0x57'),function(_0x9912e6){_0x9912e6[_0x1169('0x58')](0x0);_0x9912e6[_0x1169('0x59')]=_0x9912e6[_0x1169('0x5a')][_0x1169('0x57')]['remoteAddress']+':'+_0x9912e6[_0x1169('0x5a')][_0x1169('0x57')][_0x1169('0x5b')];_0x9912e6[_0x1169('0x5c')]=new Date();_0x9912e6['log']=function(_0x5726da){console[_0x1169('0x54')](_0x1169('0x5d')+_0x9912e6['nsp'][_0x1169('0x4')]+'['+_0x9912e6[_0x1169('0x59')]+']',_0x5726da);};_0x9912e6['on'](_0x1169('0x5e'),function(){onDisconnect(_0x9912e6,_0x44b33f);_0x9912e6['log']('DISCONNECTED');});onConnect(_0x9912e6);_0x9912e6[_0x1169('0x54')](_0x1169('0x5f'));});}; \ No newline at end of file +var _0xa2c6=['ChatQueue','push','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:inbound','FaxQueue','SmsQueues','WhatsappQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','User','name','role','agent','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','telephone','Campaign','format','Agents','length','user:%s','handshake','query','find','userProfileId','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:outbound','hasOwnProperty','include'];(function(_0x3c4596,_0x2d1ea6){var _0x58dcf8=function(_0x5a6031){while(--_0x5a6031){_0x3c4596['push'](_0x3c4596['shift']());}};_0x58dcf8(++_0x2d1ea6);}(_0xa2c6,0x1bb));var _0x6a2c=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xa2c6[_0x48e1ec];return _0x3b33eb;};'use strict';var _=require(_0x6a2c('0x0'));var util=require('util');var BPromise=require(_0x6a2c('0x1'));var db=require(_0x6a2c('0x2'))['db'];var config=require(_0x6a2c('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x6a2c('0x4')],'attributes':['id',_0x6a2c('0x5'),_0x6a2c('0x6')],'raw':!![],'where':{'role':_0x6a2c('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x6a2c('0x5')],'where':{'role':_0x6a2c('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6a2c('0x5'),_0x6a2c('0x8')],'where':{'type':_0x6a2c('0x9')}};function getAssociatedResources(_0x55c25e,_0x27254e,_0x4c943a){return db[_0x6a2c('0xa')][_0x6a2c('0xb')]({'where':{'name':_0x55c25e,'userProfileId':_0x27254e},'raw':!![]})['then'](function(_0x5c3413){if(_0x5c3413){if(_0x5c3413[_0x6a2c('0xc')]){switch(_0x55c25e){case _0x6a2c('0xd'):case _0x6a2c('0xe'):case _0x6a2c('0xf'):case'SmsQueues':case _0x6a2c('0x10'):case'OpenchannelQueues':case _0x6a2c('0x11'):return db[_0x4c943a][_0x6a2c('0x12')](queryQueues);case _0x6a2c('0x13'):return db[_0x4c943a][_0x6a2c('0x12')](queryTelephones);case _0x6a2c('0x14'):return db[_0x4c943a][_0x6a2c('0x12')](queryTrunks);case _0x6a2c('0x15'):return db[_0x4c943a]['findAll'](queryCampaigns);}}else{return db[_0x6a2c('0x16')][_0x6a2c('0x12')]({'attributes':[_0x6a2c('0x17')],'where':{'sectionId':_0x5c3413['id']},'raw':!![]})[_0x6a2c('0x18')](function(_0x18b33e){if(_0x18b33e){var _0x1a419d={'where':{'id':_[_0x6a2c('0x19')](_0x18b33e,'resourceId')},'raw':!![]};switch(_0x4c943a){case _0x6a2c('0x4'):_0x1a419d[_0x6a2c('0x1a')][_0x6a2c('0x6')]=_0x6a2c('0x1b');break;case _0x6a2c('0x1c'):_0x1a419d['where'][_0x6a2c('0x8')]=_0x6a2c('0x9');break;}return db[_0x4c943a][_0x6a2c('0x12')](_0x1a419d);}else{return[];}});}}else{return[];}})[_0x6a2c('0x18')](function(_0x1902ff){return _0x1902ff;});}function joinOrLeaveQueues(_0x17c89f,_0x36c68c,_0x31d238,_0x452f90){_0x17c89f[_0x36c68c](util[_0x6a2c('0x1d')]('%s:queue:%s',_0x31d238,_0x452f90[_0x6a2c('0x5')]));if(_0x452f90[_0x6a2c('0x1e')]){for(var _0x1f12db=0x0;_0x1f12db<_0x452f90[_0x6a2c('0x1e')][_0x6a2c('0x1f')];_0x1f12db+=0x1){_0x17c89f[_0x36c68c](util[_0x6a2c('0x1d')](_0x6a2c('0x20'),_0x452f90[_0x6a2c('0x1e')][_0x1f12db][_0x6a2c('0x5')]));}}}function joinOrLeave(_0x38d167,_0x5e1583,_0x2ee0f6){var _0x12dc7f;if(_0x38d167[_0x6a2c('0x21')][_0x6a2c('0x22')]['id']){db[_0x6a2c('0x4')][_0x6a2c('0x23')]({'attributes':['id',_0x6a2c('0x5'),_0x6a2c('0x6'),_0x6a2c('0x24')],'where':{'id':_0x38d167['handshake'][_0x6a2c('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6a2c('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6a2c('0x26')],'as':_0x6a2c('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x6a2c('0x28')],'as':_0x6a2c('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x6a2c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x6a2c('0x18')](function(_0x4391fc){if(_0x4391fc){_0x12dc7f=_0x4391fc;_0x38d167[_0x5e1583](util['format']('user:%s',_0x4391fc[_0x6a2c('0x5')]));var _0x291c39=[];switch(_0x4391fc[_0x6a2c('0x6')]){case _0x6a2c('0x2b'):_0x38d167[_0x5e1583]('voice:inbound');_0x38d167[_0x5e1583](_0x6a2c('0x2c'));if(queryQueues[_0x6a2c('0x2d')](_0x6a2c('0x2e'))){delete queryQueues[_0x6a2c('0x2e')];}_0x291c39['push'](db['VoiceQueue'][_0x6a2c('0x12')](queryQueues));_0x291c39['push'](db[_0x6a2c('0x2f')]['findAll'](queryQueues));_0x291c39['push'](db['FaxQueue'][_0x6a2c('0x12')](queryQueues));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x31')][_0x6a2c('0x12')](queryQueues));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x32')][_0x6a2c('0x12')](queryQueues));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x33')][_0x6a2c('0x12')](queryQueues));_0x291c39[_0x6a2c('0x30')](db['WhatsappQueue'][_0x6a2c('0x12')](queryQueues));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x4')]['findAll'](queryTelephones));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x34')][_0x6a2c('0x12')](queryTrunks));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x1c')][_0x6a2c('0x12')](queryCampaigns));_0x291c39[_0x6a2c('0x30')](db[_0x6a2c('0x4')][_0x6a2c('0x12')](queryAgents));break;case _0x6a2c('0x35'):_0x38d167[_0x5e1583](_0x6a2c('0x36'));_0x38d167[_0x5e1583](_0x6a2c('0x2c'));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0xd'),_0x4391fc[_0x6a2c('0x24')],'VoiceQueue'));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0xe'),_0x4391fc['userProfileId'],_0x6a2c('0x2f')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0xf'),_0x4391fc['userProfileId'],_0x6a2c('0x37')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0x38'),_0x4391fc[_0x6a2c('0x24')],_0x6a2c('0x31')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0x10'),_0x4391fc[_0x6a2c('0x24')],_0x6a2c('0x32')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources('OpenchannelQueues',_0x4391fc[_0x6a2c('0x24')],'OpenchannelQueue'));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0x11'),_0x4391fc[_0x6a2c('0x24')],_0x6a2c('0x39')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources(_0x6a2c('0x13'),_0x4391fc[_0x6a2c('0x24')],_0x6a2c('0x4')));_0x291c39['push'](getAssociatedResources(_0x6a2c('0x14'),_0x4391fc[_0x6a2c('0x24')],_0x6a2c('0x34')));_0x291c39[_0x6a2c('0x30')](getAssociatedResources('IvrCampaigns',_0x4391fc['userProfileId'],_0x6a2c('0x1c')));_0x291c39['push'](db[_0x6a2c('0x4')][_0x6a2c('0x12')](queryAgents));break;case _0x6a2c('0x7'):_0x38d167[_0x5e1583]('voice:inbound');_0x38d167[_0x5e1583](_0x6a2c('0x2c'));_0x291c39[_0x6a2c('0x30')](_0x4391fc['getVoiceQueues']({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39[_0x6a2c('0x30')](_0x4391fc[_0x6a2c('0x3a')]({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39['push'](_0x4391fc[_0x6a2c('0x3b')]({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39[_0x6a2c('0x30')](_0x4391fc[_0x6a2c('0x3c')]({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39[_0x6a2c('0x30')](_0x4391fc[_0x6a2c('0x3d')]({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39[_0x6a2c('0x30')](_0x4391fc[_0x6a2c('0x3e')]({'attributes':['id',_0x6a2c('0x5')]}));_0x291c39[_0x6a2c('0x30')](_0x4391fc[_0x6a2c('0x3f')]({'attributes':['id',_0x6a2c('0x5')]}));break;}return BPromise[_0x6a2c('0x40')](_0x291c39);}})['then'](function(_0xad9eb0){if(_0xad9eb0&&_0xad9eb0[_0x6a2c('0x1f')]){for(var _0x212451=0x0;_0x212451<_0xad9eb0[_0x6a2c('0x1f')];_0x212451+=0x1){for(var _0x46b02d=0x0;_0x46b02d<_0xad9eb0[_0x212451][_0x6a2c('0x1f')];_0x46b02d+=0x1){switch(_0x212451){case 0x0:joinOrLeaveQueues(_0x38d167,_0x5e1583,'voice',_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x1:joinOrLeaveQueues(_0x38d167,_0x5e1583,'chat',_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x2:joinOrLeaveQueues(_0x38d167,_0x5e1583,'fax',_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x3:joinOrLeaveQueues(_0x38d167,_0x5e1583,_0x6a2c('0x41'),_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x4:joinOrLeaveQueues(_0x38d167,_0x5e1583,_0x6a2c('0x42'),_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x5:joinOrLeaveQueues(_0x38d167,_0x5e1583,'openchannel',_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x6:joinOrLeaveQueues(_0x38d167,_0x5e1583,_0x6a2c('0x43'),_0xad9eb0[_0x212451][_0x46b02d]);break;case 0x7:if(_0x12dc7f[_0x6a2c('0x6')]!=='agent')_0x38d167[_0x5e1583](util['format'](_0x6a2c('0x44'),_0xad9eb0[_0x212451][_0x46b02d][_0x6a2c('0x5')]));break;case 0x8:if(_0x12dc7f[_0x6a2c('0x6')]!==_0x6a2c('0x7'))_0x38d167[_0x5e1583](util[_0x6a2c('0x1d')](_0x6a2c('0x45'),_0xad9eb0[_0x212451][_0x46b02d][_0x6a2c('0x5')]));break;case 0x9:if(_0x12dc7f[_0x6a2c('0x6')]!=='agent')_0x38d167[_0x5e1583](util[_0x6a2c('0x1d')](_0x6a2c('0x46'),_0xad9eb0[_0x212451][_0x46b02d][_0x6a2c('0x8')],_0xad9eb0[_0x212451][_0x46b02d][_0x6a2c('0x5')]));break;case 0xa:_0x38d167[_0x5e1583](util['format'](_0x6a2c('0x20'),_0xad9eb0[_0x212451][_0x46b02d][_0x6a2c('0x5')]));break;}}}}})[_0x6a2c('0x18')](function(){if(_0x5e1583===_0x6a2c('0x47')){var _0x10bc01=_[_0x6a2c('0x19')](_0x12dc7f[_0x6a2c('0x48')],'id');return _0x12dc7f[_0x6a2c('0x49')](_0x10bc01)[_0x6a2c('0x18')](function(){for(var _0x200108=0x0;_0x200108<_0x10bc01['length'];_0x200108+=0x1){_0x2ee0f6[_0x6a2c('0x4a')](_0x6a2c('0x4b'),{'ChatInteractionId':Number(_0x10bc01[_0x200108]),'UserId':Number(_0x12dc7f['id'])});}});}})['then'](function(){if(_0x5e1583===_0x6a2c('0x47')){var _0xca7b7=_[_0x6a2c('0x19')](_0x12dc7f[_0x6a2c('0x4c')],'id');return _0x12dc7f[_0x6a2c('0x4d')](_0xca7b7)[_0x6a2c('0x18')](function(){for(var _0x39a5d8=0x0;_0x39a5d8<_0xca7b7[_0x6a2c('0x1f')];_0x39a5d8+=0x1){_0x2ee0f6[_0x6a2c('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xca7b7[_0x39a5d8]),'UserId':Number(_0x12dc7f['id'])});}});}})['then'](function(){if(_0x5e1583===_0x6a2c('0x47')){var _0x5ae462=_[_0x6a2c('0x19')](_0x12dc7f[_0x6a2c('0x27')],'id');return _0x12dc7f[_0x6a2c('0x4e')](_0x5ae462)[_0x6a2c('0x18')](function(){for(var _0x59507b=0x0;_0x59507b<_0x5ae462[_0x6a2c('0x1f')];_0x59507b+=0x1){_0x2ee0f6[_0x6a2c('0x4a')](_0x6a2c('0x4f'),{'FaxInteractionId':Number(_0x5ae462[_0x59507b]),'UserId':Number(_0x12dc7f['id'])});}});}})[_0x6a2c('0x18')](function(){if(_0x5e1583==='leave'){var _0x434c0c=_[_0x6a2c('0x19')](_0x12dc7f[_0x6a2c('0x29')],'id');return _0x12dc7f[_0x6a2c('0x50')](_0x434c0c)[_0x6a2c('0x18')](function(){for(var _0x4004f9=0x0;_0x4004f9<_0x434c0c['length'];_0x4004f9+=0x1){_0x2ee0f6[_0x6a2c('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x434c0c[_0x4004f9]),'UserId':Number(_0x12dc7f['id'])});}});}})[_0x6a2c('0x18')](function(){if(_0x5e1583==='leave'){var _0x2dc0be=_[_0x6a2c('0x19')](_0x12dc7f['OpenchannelInteractions'],'id');return _0x12dc7f[_0x6a2c('0x51')](_0x2dc0be)[_0x6a2c('0x18')](function(){for(var _0x1070d2=0x0;_0x1070d2<_0x2dc0be['length'];_0x1070d2+=0x1){_0x2ee0f6[_0x6a2c('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2dc0be[_0x1070d2]),'UserId':Number(_0x12dc7f['id'])});}});}})[_0x6a2c('0x18')](function(){if(_0x5e1583==='leave'){var _0x25c87a=_[_0x6a2c('0x19')](_0x12dc7f[_0x6a2c('0x52')],'id');return _0x12dc7f[_0x6a2c('0x53')](_0x25c87a)[_0x6a2c('0x18')](function(){for(var _0x17406e=0x0;_0x17406e<_0x25c87a['length'];_0x17406e+=0x1){_0x2ee0f6['emit'](_0x6a2c('0x54'),{'WhatsappInteractionId':Number(_0x25c87a[_0x17406e]),'UserId':Number(_0x12dc7f['id'])});}});}})[_0x6a2c('0x55')](function(_0x1db34a){_0x38d167[_0x6a2c('0x56')](_0x1db34a);});}}function onDisconnect(_0x44b1c6,_0x4b7db8){joinOrLeave(_0x44b1c6,_0x6a2c('0x47'),_0x4b7db8);}function onConnect(_0x47977e){joinOrLeave(_0x47977e,_0x6a2c('0x57'));}exports[_0x6a2c('0x58')]=function(_0x494c4d){_0x494c4d['on'](_0x6a2c('0x59'),function(_0x38577b){_0x38577b[_0x6a2c('0x5a')](0x0);_0x38577b[_0x6a2c('0x5b')]=_0x38577b['request'][_0x6a2c('0x59')][_0x6a2c('0x5c')]+':'+_0x38577b[_0x6a2c('0x5d')][_0x6a2c('0x59')][_0x6a2c('0x5e')];_0x38577b[_0x6a2c('0x5f')]=new Date();_0x38577b['log']=function(_0x29344b){console[_0x6a2c('0x56')]('SocketIO\x20'+_0x38577b['nsp'][_0x6a2c('0x5')]+'['+_0x38577b[_0x6a2c('0x5b')]+']',_0x29344b);};_0x38577b['on'](_0x6a2c('0x60'),function(){onDisconnect(_0x38577b,_0x494c4d);_0x38577b[_0x6a2c('0x56')](_0x6a2c('0x61'));});onConnect(_0x38577b);_0x38577b[_0x6a2c('0x56')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e6a0797..2e2d5c1 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 _0x789a=['Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','motionChannel','event','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','SELECT','contact','UserId','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','opened','QueryTypes','name','changed','closed','substatus','AfterUpdate','find','fullname','email','internal','default','length','hasOwnProperty','hook','callback','condition','util','../../mysqldb','triggers','client','newinteraction','ChatInteraction','closedinteraction','Chat','ChatMessage','ChatOfflineMessage','afterCreate','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage'];(function(_0x493940,_0x50a1c1){var _0x5cc458=function(_0x16a842){while(--_0x16a842){_0x493940['push'](_0x493940['shift']());}};_0x5cc458(++_0x50a1c1);}(_0x789a,0x119));var _0xa789=function(_0x2b336c,_0x1a2820){_0x2b336c=_0x2b336c-0x0;var _0x23c654=_0x789a[_0x2b336c];return _0x23c654;};'use strict';var util=require(_0xa789('0x0'));var db=require(_0xa789('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0xa789('0x2'));var client=jayson[_0xa789('0x3')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':'afterCreate','condition':_0xa789('0x4'),'callback':afterCreate},{'channel':'Chat','model':_0xa789('0x5'),'event':'afterUpdate','condition':_0xa789('0x6'),'callback':afterUpdate},{'channel':_0xa789('0x7'),'model':_0xa789('0x8'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa789('0x7'),'model':_0xa789('0x9'),'event':_0xa789('0xa'),'condition':_0xa789('0xb'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xa789('0xa'),'condition':_0xa789('0x4'),'callback':afterCreate},{'channel':_0xa789('0xc'),'model':_0xa789('0xd'),'event':_0xa789('0xe'),'condition':_0xa789('0x6'),'callback':afterUpdate},{'channel':'Sms','model':_0xa789('0xf'),'event':_0xa789('0xa'),'condition':_0xa789('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xa789('0x10'),'event':'afterCreate','condition':_0xa789('0x4'),'callback':afterCreate},{'channel':_0xa789('0x11'),'model':'WhatsappInteraction','event':_0xa789('0xe'),'condition':_0xa789('0x6'),'callback':afterUpdate},{'channel':_0xa789('0x11'),'model':_0xa789('0x12'),'event':_0xa789('0xa'),'condition':_0xa789('0xb'),'callback':afterCreateMessage},{'channel':_0xa789('0x13'),'model':_0xa789('0x14'),'event':_0xa789('0xa'),'condition':_0xa789('0x4'),'callback':afterCreate},{'channel':'Fax','model':_0xa789('0x14'),'event':_0xa789('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0xa789('0x15'),'event':_0xa789('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa789('0x16'),'model':'MailInteraction','event':_0xa789('0xa'),'condition':_0xa789('0x4'),'callback':afterCreate},{'channel':_0xa789('0x16'),'model':_0xa789('0x17'),'event':_0xa789('0xe'),'condition':_0xa789('0x6'),'callback':afterUpdate},{'channel':'Mail','model':_0xa789('0x18'),'event':_0xa789('0xa'),'condition':_0xa789('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xa789('0xa'),'condition':_0xa789('0x4'),'callback':afterCreate},{'channel':_0xa789('0x19'),'model':_0xa789('0x1a'),'event':_0xa789('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa789('0x19'),'model':_0xa789('0x1b'),'event':_0xa789('0xa'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3f5289){return client[_0xa789('0x1c')](_0xa789('0x1d'),_0x3f5289)[_0xa789('0x1e')](function(_0x396bcd){logger[_0xa789('0x1f')](_0xa789('0x20'),_0xa789('0x1d'),_0x396bcd);if(_0x396bcd[_0xa789('0x21')]){if(_0x396bcd['error'][_0xa789('0x22')]===0x1f4){logger['error'](_0xa789('0x20'),_0xa789('0x1d'),_0x396bcd['error']);}}})[_0xa789('0x23')](function(_0x4e613f){logger[_0xa789('0x21')]('Trigger,\x20%s','EventManager',_0x4e613f);});}function afterCreateMessage(_0x26afe4){return function(_0x1522f9){_0x1522f9=_0x1522f9['get']({'plain':!![]});_0x1522f9[_0xa789('0x24')]=_0x26afe4;_0x1522f9[_0xa789('0x25')]=_0x26afe4;_0x1522f9[_0xa789('0x26')]=_0x1522f9['direction'];Promise[_0xa789('0x27')]()[_0xa789('0x1e')](function(){if(typeof _0x1522f9['ContactId']===_0xa789('0x28'))return null;var _0x5c5c1d=_0xa789('0x29')+_0x1522f9[_0xa789('0x2a')];return db[_0xa789('0x2b')][_0xa789('0x2c')](_0x5c5c1d,{'type':db[_0xa789('0x2d')]['QueryTypes'][_0xa789('0x2e')],'raw':!![]});})[_0xa789('0x1e')](function(_0x68f0cf){if(_0x68f0cf){_0x1522f9[_0xa789('0x2f')]=_0x68f0cf[0x0];}if(typeof _0x1522f9[_0xa789('0x30')]===_0xa789('0x28'))return;return getAgent(_0x1522f9[_0xa789('0x30')]);})[_0xa789('0x1e')](function(_0x546e2b){if(_0x546e2b){_0x1522f9[_0xa789('0x31')]=util[_0xa789('0x32')](_0xa789('0x33'),_0x546e2b['name']);_0x1522f9[_0xa789('0x34')]=_0x546e2b;_0x1522f9['channel']=_0x26afe4;return request({'event':_0xa789('0x35'),'message':_0x1522f9});}else{return request({'event':_0xa789('0x36'),'message':_0x1522f9});}})[_0xa789('0x23')](function(_0x230bb3){logger[_0xa789('0x21')](_0xa789('0x20'),_0xa789('0x37'),_0x230bb3);});};}function afterCreateOfflineMessage(_0x5de454){return function(_0x2236aa){_0x2236aa=_0x2236aa[_0xa789('0x38')]({'plain':!![]});_0x2236aa[_0xa789('0x24')]=_0x5de454;_0x2236aa['motionChannel']=_0x5de454;_0x2236aa['event']=_0xa789('0x39');return request({'event':_0x2236aa['event'],'message':_0x2236aa});};}function afterCreate(_0x2767c3,_0x3e533b){return function(_0x38c0b6){_0x38c0b6=_0x38c0b6[_0xa789('0x38')]({'plain':!![]});_0x38c0b6['channel']=_0x2767c3;_0x38c0b6['motionChannel']=_0x2767c3;_0x38c0b6[_0xa789('0x26')]=_0xa789('0x3a');Promise[_0xa789('0x27')]()[_0xa789('0x1e')](function(){var _0x109462='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38c0b6[_0xa789('0x2a')];return db[_0xa789('0x2b')]['query'](_0x109462,{'type':db['Sequelize'][_0xa789('0x3b')][_0xa789('0x2e')],'raw':!![]});})[_0xa789('0x1e')](function(_0x531b90){if(_0x531b90){_0x38c0b6[_0xa789('0x2f')]=_0x531b90[0x0];}if(typeof _0x38c0b6['UserId']==='undefined')return;return getAgent(_0x38c0b6[_0xa789('0x30')]);})['then'](function(_0x5e58b3){if(_0x5e58b3){_0x38c0b6['interface']=util[_0xa789('0x32')](_0xa789('0x33'),_0x5e58b3[_0xa789('0x3c')]);_0x38c0b6[_0xa789('0x34')]=_0x5e58b3;}return request({'event':_0x3e533b,'message':_0x38c0b6});})['catch'](function(_0x31cfd1){logger['error'](_0xa789('0x20'),'AfterCreate',_0x31cfd1);});};}function afterUpdate(_0x5362b3){return function(_0x1ebc2c){var _0x47b633=_0x1ebc2c[_0xa789('0x3d')](_0xa789('0x3e'))&&_0x1ebc2c[_0xa789('0x3e')];var _0x3eec36=_0x1ebc2c[_0xa789('0x3d')]('substatus');if(_0x47b633||_0x3eec36){var _0x37def2=_0x47b633?_0xa789('0x6'):_0xa789('0x3f');var _0x190ccd=_0x1ebc2c[_0xa789('0x38')]({'plain':!![]});_0x190ccd[_0xa789('0x24')]=_0x5362b3;_0x190ccd[_0xa789('0x25')]=_0x5362b3;_0x190ccd[_0xa789('0x26')]=_0x47b633?_0xa789('0x3e'):_0xa789('0x3f');var _0x19e2e5=_0xa789('0x29')+_0x190ccd['ContactId'];return db[_0xa789('0x2b')][_0xa789('0x2c')](_0x19e2e5,{'type':db['Sequelize']['QueryTypes'][_0xa789('0x2e')],'raw':!![]})['then'](function(_0x528b93){if(_0x528b93){_0x190ccd['contact']=_0x528b93[0x0];}if(typeof _0x190ccd[_0xa789('0x30')]==='undefined')return;return getAgent(_0x190ccd[_0xa789('0x30')]);})[_0xa789('0x1e')](function(_0x5bcaee){if(_0x5bcaee){_0x190ccd['interface']=util['format'](_0xa789('0x33'),_0x5bcaee[_0xa789('0x3c')]);_0x190ccd[_0xa789('0x34')]=_0x5bcaee;}return request({'event':_0x37def2,'message':_0x190ccd});})[_0xa789('0x23')](function(_0x995c0c){logger[_0xa789('0x21')](_0xa789('0x20'),_0xa789('0x40'),_0x995c0c);});}};}function getAgent(_0x126a75){return db['User'][_0xa789('0x41')]({'where':{'id':_0x126a75},'attributes':['id',_0xa789('0x3c'),_0xa789('0x42'),_0xa789('0x43'),_0xa789('0x44')],'raw':!![]})[_0xa789('0x1e')](function(_0x3fcc8b){return _0x3fcc8b;});}exports[_0xa789('0x45')]=function(){for(var _0x457fe4=0x0;_0x457fe4=_0x599579[_0xf543('0x14')]){throw Error(_0xf543('0x15'));}_0x4a4e14(_0x5d22a1);})[_0xf543('0x16')](function(_0x52f081){_0x1c4bcd(_0x52f081);});});}; \ No newline at end of file +var _0x628e=['../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x628e,0xf8));var _0xe628=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x628e[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe628('0x0'));var BPromise=require(_0xe628('0x1'));var db=require(_0xe628('0x2'))['db'];var util=require(_0xe628('0x3'));var channels=['voice',_0xe628('0x4'),_0xe628('0x5'),_0xe628('0x6'),_0xe628('0x7'),_0xe628('0x8'),'openchannel'];exports[_0xe628('0x9')]=function(){return channels;};exports[_0xe628('0xa')]=function(_0x3bbbee){_0x3bbbee=_0x3bbbee[_0xe628('0xb')]();return _[_0xe628('0xc')](channels,_0x3bbbee);};exports[_0xe628('0xd')]=function(_0x599ba7,_0x2dabd9,_0x35fd7c,_0x1d8273){var _0x31af04={'loginAttempts':_0x2dabd9,'blocked':_0x35fd7c};if(!_[_0xe628('0xe')](_0x1d8273)){_0x31af04[_0xe628('0xf')]=_0x1d8273;}return _0x599ba7[_0xe628('0x10')](_0x31af04);};exports[_0xe628('0x11')]=function(_0x1f0d53){return new BPromise(function(_0x53f802,_0x442c37){var _0x29d809=0x0;if(_0x1f0d53[_0xe628('0x12')]!==_0xe628('0x13')){_0x53f802(_0x1f0d53);}db[_0xe628('0x14')]['count']({'where':{'role':_0xe628('0x13'),'online':!![],'id':{'$ne':_0x1f0d53['id']}}})['then'](function(_0x1279ba){_0x29d809=_0x1279ba;return util[_0xe628('0x11')]();})[_0xe628('0x15')](function(_0x13fd3f){if(_0x13fd3f&&_0x13fd3f['agents']&&_0x29d809>=_0x13fd3f[_0xe628('0x16')]){throw Error(_0xe628('0x17'));}_0x53f802(_0x1f0d53);})[_0xe628('0x18')](function(_0x1f83cd){_0x442c37(_0x1f83cd);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 2255468..1618fe8 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b13=['status','json','send','404'];(function(_0xed26e9,_0x4a727b){var _0xf6e833=function(_0x46ecdc){while(--_0x46ecdc){_0xed26e9['push'](_0xed26e9['shift']());}};_0xf6e833(++_0x4a727b);}(_0x8b13,0x1ef));var _0x38b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b13[_0x3dd15e];return _0x231fd0;};'use strict';module['exports'][0x194]=function pageNotFound(_0x33dcb0,_0x1ec755){var _0x48397f=_0x38b1('0x0');var _0x563a4e=0x194;var _0x54a4ce={'status':_0x563a4e};_0x1ec755['status'](_0x54a4ce[_0x38b1('0x1')]);_0x1ec755['render'](_0x48397f,{},function(_0x450041,_0x12d3d6){if(_0x450041){return _0x1ec755[_0x38b1('0x1')](_0x54a4ce['status'])[_0x38b1('0x2')](_0x54a4ce);}_0x1ec755[_0x38b1('0x3')](_0x12d3d6);});}; \ No newline at end of file +var _0xed73=['json','send','exports','status'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0xed73,0x132));var _0x3ed7=function(_0x4c572d,_0x31b0f7){_0x4c572d=_0x4c572d-0x0;var _0x2cb6b3=_0xed73[_0x4c572d];return _0x2cb6b3;};'use strict';module[_0x3ed7('0x0')][0x194]=function pageNotFound(_0x59cf67,_0x565cea){var _0x4013d8='404';var _0x35dda7=0x194;var _0x2b0f63={'status':_0x35dda7};_0x565cea['status'](_0x2b0f63['status']);_0x565cea['render'](_0x4013d8,{},function(_0xbfde60,_0x240655){if(_0xbfde60){return _0x565cea[_0x3ed7('0x1')](_0x2b0f63[_0x3ed7('0x1')])[_0x3ed7('0x2')](_0x2b0f63);}_0x565cea[_0x3ed7('0x3')](_0x240655);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 0f6aaf2..31e9134 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42e2=['List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Attachments','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','FaxApplication','Exntensions','Agents','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Queue','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','CompanyId','Hoppers','HopperHistories','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','OneAll','AutomationAllId','Condition','Any','OneAny','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnalyticFieldReport','Fields','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Description','DescriptionId','VariableId','int_desk_configuration_has_tags','Subject','Field','ZendeskAccount','ZendeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','JscriptyProject','ProjectId','user_has_square_projects','VoiceQueues','ChatQueues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','UserProfileSection','UserProfileSections','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','defaultsDeep','mysql','utf8','database','username','options','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../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','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','VoiceMail','userSetting','Recordings','UserId','hasMany','VoiceQueuesRt','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteraction','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefixes','MailQueue','MailQueues','ChatQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_fax_accounts','MailAccounts','SmsAccount','SmsAccounts','WhatsappAccounts','SquareProjects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Members','VoiceQueueId','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Lists','voice_queues_has_cm_lists','Teams','BlackLists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','MailApplication'];(function(_0x365fa4,_0x4622ca){var _0x7c304a=function(_0x444c75){while(--_0x444c75){_0x365fa4['push'](_0x365fa4['shift']());}};_0x7c304a(++_0x4622ca);}(_0x42e2,0x8e));var _0x242e=function(_0x4e5ada,_0x27c568){_0x4e5ada=_0x4e5ada-0x0;var _0x3dc6b9=_0x42e2[_0x4e5ada];return _0x3dc6b9;};'use strict';var config=require(_0x242e('0x0'));var Sequelize=require(_0x242e('0x1'));var _=require(_0x242e('0x2'));var jstz=require(_0x242e('0x3'));var timezone=jstz[_0x242e('0x4')]();config[_0x242e('0x1')]=_['defaultsDeep'](config[_0x242e('0x1')],{'database':_0x242e('0x5'),'username':_0x242e('0x6'),'password':'xC@LL1234','options':{'host':_0x242e('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x242e('0x8')},'logging':![],'timezone':timezone[_0x242e('0x9')](),'define':{'charset':'utf8','collate':_0x242e('0xa')}}});config[_0x242e('0xb')]=_[_0x242e('0xc')](config[_0x242e('0xb')],{'database':_0x242e('0x5'),'username':_0x242e('0x6'),'password':'xC@LL1234','options':{'host':_0x242e('0x7'),'port':0xcea,'dialect':_0x242e('0xd'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x242e('0xe'),'collate':_0x242e('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x242e('0xf')],config[_0x242e('0x1')][_0x242e('0x10')],config[_0x242e('0x1')]['password'],config['sequelize'][_0x242e('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x242e('0xf')],config['sequelizeHistory'][_0x242e('0x10')],config[_0x242e('0xb')][_0x242e('0x12')],config['sequelizeHistory']['options'])};db[_0x242e('0x13')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x15'));db['VoiceChanSpy']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x16'));db[_0x242e('0x17')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x18'));db[_0x242e('0x19')]=db[_0x242e('0x1')]['import'](_0x242e('0x1a'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0x242e('0x1b'));db['VoiceQueue']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x1c'));db[_0x242e('0x1d')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x242e('0x1e')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x1f'));db['VoiceMail']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x20'));db[_0x242e('0x21')]=db['sequelize'][_0x242e('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x242e('0x22')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x23'));db[_0x242e('0x24')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x25'));db[_0x242e('0x26')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x242e('0x27')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x28'));db[_0x242e('0x29')]=db['sequelize'][_0x242e('0x14')](_0x242e('0x2a'));db['Trunk']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x2b'));db[_0x242e('0x2c')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x2d'));db[_0x242e('0x2e')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x2f'));db[_0x242e('0x30')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x31'));db['UserChatQueue']=db['sequelize']['import'](_0x242e('0x32'));db[_0x242e('0x33')]=db['sequelize'][_0x242e('0x14')](_0x242e('0x34'));db[_0x242e('0x35')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x36'));db[_0x242e('0x37')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x38'));db['UserOpenchannelQueue']=db[_0x242e('0x1')]['import'](_0x242e('0x39'));db[_0x242e('0x3a')]=db[_0x242e('0x1')]['import'](_0x242e('0x3b'));db[_0x242e('0x3c')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x242e('0x3d')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x3e'));db[_0x242e('0x3f')]=db[_0x242e('0x1')]['import'](_0x242e('0x40'));db['MailQueue']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x41'));db[_0x242e('0x42')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x242e('0x43')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x44'));db[_0x242e('0x45')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x46'));db['MailApplication']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x47'));db['MailQueueReport']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x48'));db['Dashboard']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x49'));db[_0x242e('0x4a')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x4b'));db[_0x242e('0x4c')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/faxApplication/faxApplication.model');db[_0x242e('0x4d')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x4e'));db[_0x242e('0x4f')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x50'));db[_0x242e('0x51')]=db[_0x242e('0x1')]['import'](_0x242e('0x52'));db[_0x242e('0x53')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x54'));db['SmsAccount']=db['sequelize'][_0x242e('0x14')](_0x242e('0x55'));db[_0x242e('0x56')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x57'));db[_0x242e('0x58')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x59'));db[_0x242e('0x5a')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x5b'));db['SmsQueue']=db['sequelize'][_0x242e('0x14')](_0x242e('0x5c'));db['OpenchannelAccount']=db['sequelize'][_0x242e('0x14')](_0x242e('0x5d'));db[_0x242e('0x5e')]=db['sequelize'][_0x242e('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x242e('0x5f')]=db[_0x242e('0x1')]['import'](_0x242e('0x60'));db[_0x242e('0x61')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x242e('0x62')]=db[_0x242e('0x1')]['import'](_0x242e('0x63'));db['ChatWebsite']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x242e('0x64')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x65'));db[_0x242e('0x66')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x67'));db[_0x242e('0x68')]=db['sequelize'][_0x242e('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x242e('0x69')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x6a'));db[_0x242e('0x6b')]=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x242e('0x1')]['import'](_0x242e('0x6c'));db[_0x242e('0x6d')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x6e'));db[_0x242e('0x6f')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x70'));db[_0x242e('0x71')]=db[_0x242e('0x1')]['import'](_0x242e('0x72'));db[_0x242e('0x73')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x74'));db[_0x242e('0x75')]=db['sequelize'][_0x242e('0x14')]('../api/cmHopper/cmHopper.model');db[_0x242e('0x76')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x242e('0x77')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x242e('0x78')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x242e('0x79')]=db[_0x242e('0x1')]['import'](_0x242e('0x7a'));db[_0x242e('0x7b')]=db['sequelize'][_0x242e('0x14')](_0x242e('0x7c'));db[_0x242e('0x7d')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/action/action.model');db[_0x242e('0x7e')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x7f'));db['CannedAnswer']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x242e('0x80')]=db[_0x242e('0x1')]['import'](_0x242e('0x81'));db['Condition']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x82'));db[_0x242e('0x83')]=db['sequelize'][_0x242e('0x14')]('../api/interval/interval.model');db[_0x242e('0x84')]=db[_0x242e('0x1')]['import'](_0x242e('0x85'));db[_0x242e('0x86')]=db[_0x242e('0x1')]['import']('../api/cdr/cdr.model');db[_0x242e('0x87')]=db[_0x242e('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x242e('0x88')]=db['sequelize'][_0x242e('0x14')]('../api/schedule/schedule.model');db[_0x242e('0x89')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x8a'));db['Tag']=db[_0x242e('0x1')]['import'](_0x242e('0x8b'));db[_0x242e('0x8c')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x8d'));db[_0x242e('0x8e')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x242e('0x8f')]=db['sequelize'][_0x242e('0x14')](_0x242e('0x90'));db[_0x242e('0x91')]=db['sequelize']['import'](_0x242e('0x92'));db[_0x242e('0x93')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x94'));db['AnalyticCustomReport']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x242e('0x95')]=db[_0x242e('0x1')]['import'](_0x242e('0x96'));db[_0x242e('0x97')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x98'));db[_0x242e('0x99')]=db['sequelize']['import'](_0x242e('0x9a'));db['AnalyticFieldReport']=db['sequelize'][_0x242e('0x14')](_0x242e('0x9b'));db[_0x242e('0x9c')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x9d'));db['SalesforceAccount']=db[_0x242e('0x1')]['import'](_0x242e('0x9e'));db[_0x242e('0x9f')]=db['sequelize']['import'](_0x242e('0xa0'));db[_0x242e('0xa1')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xa2'));db[_0x242e('0xa3')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xa4'));db[_0x242e('0xa5')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xa6'));db[_0x242e('0xa7')]=db[_0x242e('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x242e('0xa8')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xa9'));db[_0x242e('0xaa')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x242e('0xab')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xac'));db[_0x242e('0xad')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xae'));db[_0x242e('0xaf')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xb0'));db[_0x242e('0xb1')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xb2'));db['ZendeskAccount']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xb3'));db[_0x242e('0xb4')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xb5'));db['ZendeskField']=db[_0x242e('0x1')]['import'](_0x242e('0xb6'));db[_0x242e('0xb7')]=db['sequelize']['import'](_0x242e('0xb8'));db['FreshdeskConfiguration']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xb9'));db[_0x242e('0xba')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xbb'));db[_0x242e('0xbc')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xbd'));db[_0x242e('0xbe')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xbf'));db['VtigerField']=db['sequelize'][_0x242e('0x14')](_0x242e('0xc0'));db[_0x242e('0xc1')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x242e('0xc2')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xc3'));db[_0x242e('0xc4')]=db['sequelize']['import'](_0x242e('0xc5'));db['Dynamics365Account']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xc6'));db[_0x242e('0xc7')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xc8'));db['Dynamics365Field']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0x242e('0x1')]['import'](_0x242e('0xc9'));db['FreshsalesConfiguration']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xca'));db[_0x242e('0x91')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x92'));db[_0x242e('0xcb')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xcc'));db[_0x242e('0xcd')]=db['sequelize']['import'](_0x242e('0xce'));db[_0x242e('0xcf')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xd0'));db[_0x242e('0xd1')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xd2'));db[_0x242e('0xd3')]=db[_0x242e('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x242e('0xd4')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xd5'));db[_0x242e('0xd6')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xd7'));db['SquareReport']=db['sequelize'][_0x242e('0x14')](_0x242e('0xd8'));db[_0x242e('0xd9')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xda'));db['JscriptyProject']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xdb'));db[_0x242e('0xdc')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xdd'));db[_0x242e('0xde')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xdf'));db[_0x242e('0xe0')]=db[_0x242e('0x1')]['import'](_0x242e('0xe1'));db['SquareRecording']=db[_0x242e('0x1')][_0x242e('0x14')]('../api/squareRecording/squareRecording.model');db[_0x242e('0xe2')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xe3'));db[_0x242e('0xe4')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xe5'));db[_0x242e('0xe6')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/license/license.model');db[_0x242e('0xe7')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xe8'));db[_0x242e('0xe9')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xea'));db[_0x242e('0xeb')]=db[_0x242e('0x1')]['import'](_0x242e('0xec'));db['Plugin']=db[_0x242e('0x1')]['import'](_0x242e('0xed'));db[_0x242e('0xee')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xef'));db[_0x242e('0xf0')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x242e('0xf1')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xf2'));db[_0x242e('0xf3')]=db[_0x242e('0x1')]['import'](_0x242e('0xf4'));db[_0x242e('0xf5')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xf6'));db[_0x242e('0xf7')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/cmList/cmList.model');db[_0x242e('0xf8')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0x242e('0xf9')]=db['sequelize'][_0x242e('0x14')](_0x242e('0xfa'));db['UserProfileSection']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xfb'));db[_0x242e('0xfc')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0xfd'));db[_0x242e('0xfe')]=db[_0x242e('0x1')]['import'](_0x242e('0xff'));db[_0x242e('0x100')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x101'));db[_0x242e('0x102')]=db[_0x242e('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x103'));db[_0x242e('0x104')]=db['sequelize'][_0x242e('0x14')](_0x242e('0x105'));db[_0x242e('0x106')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x107'));db[_0x242e('0x108')]=db[_0x242e('0x1')]['import'](_0x242e('0x109'));db[_0x242e('0x10a')]=db[_0x242e('0x1')][_0x242e('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0x242e('0x10b')]=db['sequelize']['import'](_0x242e('0x10c'));db[_0x242e('0x10d')]=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x10e'));db['TeamVoicePrefix']=db[_0x242e('0x1')][_0x242e('0x14')](_0x242e('0x10f'));db[_0x242e('0x110')]=db['sequelize']['import'](_0x242e('0x111'));db[_0x242e('0x112')]=db['sequelize'][_0x242e('0x14')]('../api/user-setting/user-setting.model');db[_0x242e('0x13')][_0x242e('0x113')](db[_0x242e('0x114')],{'as':_0x242e('0x114'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0x242e('0x113')](db[_0x242e('0x112')],{'as':_0x242e('0x115'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x242e('0x13')]['hasMany'](db['VoiceRecording'],{'as':_0x242e('0x116'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x2e')],{'as':_0x242e('0x119'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x242e('0x11a'),'hooks':!![]});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x77')],{'as':_0x242e('0x11b'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x78')],{'as':_0x242e('0x11c'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x79')],{'as':_0x242e('0x79'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x5f')],{'as':_0x242e('0x11d'),'foreignKey':'UserId'});db['User'][_0x242e('0x118')](db[_0x242e('0x68')],{'as':_0x242e('0x11e'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db['SmsInteraction'],{'as':_0x242e('0x11f'),'foreignKey':'UserId'});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x4d')],{'as':_0x242e('0x120'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x43')],{'as':'MailInteractions','foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0x121')],{'as':'WhatsappInteractions','foreignKey':_0x242e('0x117')});db[_0x242e('0x13')][_0x242e('0x118')](db[_0x242e('0xfe')],{'as':_0x242e('0x122'),'foreignKey':_0x242e('0x123')});db['User']['belongsTo'](db[_0x242e('0xf9')],{'as':_0x242e('0xf9'),'foreignKey':_0x242e('0x124')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x6d')],{'as':_0x242e('0x126'),'through':_0x242e('0x127')});db[_0x242e('0x13')][_0x242e('0x125')](db['CmContact'],{'as':_0x242e('0x128'),'through':_0x242e('0x129')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0xf7')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x12a')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x43')],{'as':_0x242e('0x12b'),'through':_0x242e('0x12c')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x68')],{'as':_0x242e('0x11e'),'through':_0x242e('0x12d')});db[_0x242e('0x13')][_0x242e('0x125')](db['FaxInteraction'],{'as':_0x242e('0x120'),'through':'user_has_fax_interactions'});db['User'][_0x242e('0x125')](db['SmsInteraction'],{'as':_0x242e('0x11f'),'through':_0x242e('0x12e')});db['User']['belongsToMany'](db[_0x242e('0x5f')],{'as':_0x242e('0x11d'),'through':_0x242e('0x12f')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x121')],{'as':_0x242e('0x130'),'through':_0x242e('0x131')});db[_0x242e('0x13')]['belongsToMany'](db[_0x242e('0x132')],{'as':'VoiceQueues','through':_0x242e('0x30'),'required':![]});db[_0x242e('0x13')]['belongsToMany'](db[_0x242e('0xf8')],{'as':_0x242e('0x133'),'through':'UserVoicePrefix','required':![]});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x134')],{'as':_0x242e('0x135'),'through':_0x242e('0x33'),'required':![]});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x136')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x51')],{'as':_0x242e('0x137'),'through':'UserFaxQueue','required':![]});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x138')],{'as':_0x242e('0x139'),'through':_0x242e('0x37'),'required':![]});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x62')],{'as':_0x242e('0x13a'),'through':'UserOpenchannelQueue','required':![]});db[_0x242e('0x13')]['belongsToMany'](db[_0x242e('0x10a')],{'as':_0x242e('0x13b'),'through':'UserWhatsappQueue','required':![]});db['User']['belongsToMany'](db[_0x242e('0xf7')],{'through':_0x242e('0x13c')});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x13d')],{'as':_0x242e('0x13e'),'through':'user_has_chat_websites'});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x4c')],{'as':'FaxAccounts','through':_0x242e('0x13f')});db['User'][_0x242e('0x125')](db[_0x242e('0x3f')],{'as':_0x242e('0x140'),'through':'user_has_mail_accounts'});db['User'][_0x242e('0x125')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x141')],{'as':_0x242e('0x142'),'through':'user_has_sms_accounts'});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0x100')],{'as':_0x242e('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x242e('0x13')][_0x242e('0x125')](db[_0x242e('0xe0')],{'as':_0x242e('0x144'),'through':'user_has_square_projects'});db[_0x242e('0x145')][_0x242e('0x118')](db['VoiceExtension'],{'as':_0x242e('0x146'),'onDelete':'cascade','foreignKey':_0x242e('0x147')});db[_0x242e('0x17')][_0x242e('0x118')](db[_0x242e('0x19')],{'onDelete':_0x242e('0x11a')});db[_0x242e('0x19')][_0x242e('0x118')](db[_0x242e('0x19')],{'as':_0x242e('0x148'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x149')][_0x242e('0x125')](db[_0x242e('0x89')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x242e('0x132')][_0x242e('0x118')](db[_0x242e('0x2e')],{'as':_0x242e('0x14a'),'foreignKey':_0x242e('0x14b')});db[_0x242e('0x132')][_0x242e('0x118')](db[_0x242e('0x75')],{'as':'Hoppers','foreignKey':_0x242e('0x14b')});db[_0x242e('0x132')][_0x242e('0x118')](db['CmHopperFinal'],{'as':_0x242e('0x11b'),'foreignKey':_0x242e('0x14b')});db['VoiceQueue'][_0x242e('0x118')](db[_0x242e('0x78')],{'as':'HopperHistories','foreignKey':_0x242e('0x14b')});db[_0x242e('0x132')]['hasMany'](db[_0x242e('0x79')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x242e('0x118')](db[_0x242e('0x76')],{'as':'HopperBlacks','foreignKey':_0x242e('0x14b')});db[_0x242e('0x132')][_0x242e('0x118')](db['JscriptySessionReport'],{'as':_0x242e('0x14c'),'foreignKey':_0x242e('0x14b')});db[_0x242e('0x132')][_0x242e('0x14d')](db[_0x242e('0x14e')],{'as':_0x242e('0x14e'),'foreignKey':_0x242e('0x14f')});db[_0x242e('0x132')][_0x242e('0x14d')](db[_0x242e('0x14e')],{'as':_0x242e('0x150'),'foreignKey':_0x242e('0x151')});db['VoiceQueue'][_0x242e('0x14d')](db['Interval'],{'as':_0x242e('0x83'),'foreignKey':'IntervalId'});db[_0x242e('0x132')]['belongsTo'](db[_0x242e('0x84')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue']['belongsToMany'](db[_0x242e('0xf7')],{'as':_0x242e('0x152'),'through':_0x242e('0x153')});db[_0x242e('0x132')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x242e('0x132')][_0x242e('0x125')](db[_0x242e('0xe4')],{'as':_0x242e('0x154'),'through':_0x242e('0x10d')});db[_0x242e('0x132')][_0x242e('0x125')](db[_0x242e('0xf7')],{'as':_0x242e('0x155'),'through':'voice_queues_has_cm_blacklists'});db[_0x242e('0x1d')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x13'),'foreignKey':'UserId'});db[_0x242e('0x1e')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':'User','foreignKey':_0x242e('0x117')});db[_0x242e('0x114')][_0x242e('0x118')](db[_0x242e('0x21')],{'as':_0x242e('0x156'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x157'),'sourceKey':_0x242e('0x158')});db[_0x242e('0x21')]['belongsTo'](db[_0x242e('0x114')],{'foreignKey':_0x242e('0x157'),'targetKey':_0x242e('0x158')});db[_0x242e('0x22')][_0x242e('0x118')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x242e('0x159'),'constraints':![]});db[_0x242e('0x22')][_0x242e('0x118')](db[_0x242e('0x26')],{'as':_0x242e('0x15a'),'foreignKey':_0x242e('0x159'),'constraints':![]});db[_0x242e('0x22')][_0x242e('0x14d')](db['User'],{'as':_0x242e('0x13'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x22')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x3c')][_0x242e('0x14d')](db[_0x242e('0x3f')],{'as':_0x242e('0x3f'),'foreignKey':_0x242e('0x15d')});db[_0x242e('0x3c')][_0x242e('0x14d')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x242e('0x15e'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x3d')]['belongsTo'](db['MailAccount'],{'as':_0x242e('0x3f'),'foreignKey':_0x242e('0x15d')});db[_0x242e('0x3d')][_0x242e('0x14d')](db[_0x242e('0x10b')],{'as':_0x242e('0x10b'),'foreignKey':_0x242e('0x15e'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x3f')][_0x242e('0x113')](db[_0x242e('0x3c')],{'as':_0x242e('0x160'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x3f')][_0x242e('0x113')](db[_0x242e('0x3d')],{'as':_0x242e('0x161'),'onDelete':_0x242e('0x11a')});db['MailAccount'][_0x242e('0x118')](db[_0x242e('0x80')],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x15d'),'onDelete':'cascade'});db['MailAccount'][_0x242e('0x118')](db[_0x242e('0x163')],{'as':_0x242e('0x164'),'foreignKey':_0x242e('0x15d')});db[_0x242e('0x3f')][_0x242e('0x118')](db[_0x242e('0x45')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0x242e('0x118')](db[_0x242e('0x43')],{'as':_0x242e('0x165')});db[_0x242e('0x3f')][_0x242e('0x118')](db[_0x242e('0x166')],{'as':_0x242e('0x148')});db[_0x242e('0x3f')][_0x242e('0x14d')](db['CmList'],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db[_0x242e('0x3f')]['belongsTo'](db[_0x242e('0x8c')],{'as':_0x242e('0x8c'),'foreignKey':_0x242e('0x169')});db[_0x242e('0x3f')][_0x242e('0x14d')](db[_0x242e('0x84')],{'as':_0x242e('0x16a'),'foreignKey':_0x242e('0x16b')});db[_0x242e('0x3f')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Agents','through':_0x242e('0x16c')});db['MailQueue'][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x16d'),'as':_0x242e('0x154')});db[_0x242e('0x43')][_0x242e('0x118')](db[_0x242e('0x45')],{'as':_0x242e('0x156'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x16e')});db[_0x242e('0x43')]['belongsTo'](db[_0x242e('0x3f')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x15d')});db[_0x242e('0x43')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x43')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x43')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x172'),'as':_0x242e('0x173')});db[_0x242e('0x43')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x242e('0x43')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Users','through':_0x242e('0x12c'),'foreignKey':_0x242e('0x16e')});db[_0x242e('0x45')][_0x242e('0x118')](db[_0x242e('0xeb')],{'as':_0x242e('0x174'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x45')][_0x242e('0x14d')](db['User'],{'as':_0x242e('0x13')});db['MailMessage'][_0x242e('0x14d')](db[_0x242e('0x73')],{'onDelete':'cascade','as':_0x242e('0x15b')});db[_0x242e('0x45')][_0x242e('0x14d')](db[_0x242e('0x43')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0x242e('0x45')]['belongsTo'](db['MailAccount'],{'as':_0x242e('0x16f'),'foreignKey':'MailAccountId'});db[_0x242e('0x45')][_0x242e('0x14d')](db[_0x242e('0x13d')],{'as':_0x242e('0x13d'),'foreignKey':'ChatWebsiteId'});db[_0x242e('0x45')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x242e('0x6b'),'foreignKey':_0x242e('0x175')});db[_0x242e('0x166')]['belongsTo'](db[_0x242e('0x13')],{'onDelete':_0x242e('0x15f')});db['MailApplication'][_0x242e('0x14d')](db['MailQueue'],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x166')][_0x242e('0x14d')](db['MailAccount'],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x166')][_0x242e('0x14d')](db[_0x242e('0x83')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x166')][_0x242e('0x14d')](db['Tag'],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x177')});db[_0x242e('0x178')][_0x242e('0x14d')](db['MailAccount'],{});db[_0x242e('0x178')][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':'List','foreignKey':_0x242e('0x168')});db[_0x242e('0x178')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':'ContactId'});db[_0x242e('0x178')][_0x242e('0x14d')](db[_0x242e('0x43')],{});db[_0x242e('0x178')][_0x242e('0x14d')](db[_0x242e('0x45')],{});db[_0x242e('0x178')]['belongsTo'](db[_0x242e('0x13')],{});db['MailQueueReport'][_0x242e('0x14d')](db[_0x242e('0x134')],{});db['Dashboard'][_0x242e('0x118')](db['DashboardItem'],{'as':_0x242e('0x179'),'onDelete':_0x242e('0x11a')});db['FaxAccount'][_0x242e('0x118')](db[_0x242e('0x80')],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x17a'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x4c')]['hasMany'](db[_0x242e('0x163')],{'as':'Answers','foreignKey':_0x242e('0x17a')});db['FaxAccount'][_0x242e('0x118')](db[_0x242e('0x4d')],{'as':_0x242e('0x165')});db[_0x242e('0x4c')][_0x242e('0x118')](db[_0x242e('0x17b')],{'as':'Applications'});db[_0x242e('0x4c')][_0x242e('0x118')](db[_0x242e('0x19')],{'as':_0x242e('0x17c'),'onDelete':_0x242e('0x11a')});db['FaxAccount'][_0x242e('0x118')](db[_0x242e('0x4f')],{'as':'Messages'});db['FaxAccount'][_0x242e('0x14d')](db['Trunk'],{'as':'Trunk'});db['FaxAccount']['belongsTo'](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':'ListId'});db[_0x242e('0x4c')][_0x242e('0x14d')](db[_0x242e('0x84')],{'as':_0x242e('0x16a'),'foreignKey':_0x242e('0x16b')});db[_0x242e('0x4c')]['belongsToMany'](db['User'],{'as':_0x242e('0x17d'),'through':'user_has_fax_accounts'});db[_0x242e('0x17b')][_0x242e('0x14d')](db['User'],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x17b')][_0x242e('0x14d')](db[_0x242e('0x51')],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x17b')][_0x242e('0x14d')](db[_0x242e('0x4c')],{'onDelete':_0x242e('0x15f')});db['FaxApplication'][_0x242e('0x14d')](db[_0x242e('0x171')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x177')});db[_0x242e('0x4d')]['hasMany'](db['FaxMessage'],{'as':_0x242e('0x156'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x17e')});db[_0x242e('0x4d')]['belongsTo'](db[_0x242e('0x4c')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x17a')});db[_0x242e('0x4d')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x4d')]['belongsTo'](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x4d')]['belongsToMany'](db[_0x242e('0x171')],{'through':_0x242e('0x17f'),'as':'Tags'});db['FaxInteraction'][_0x242e('0x125')](db[_0x242e('0x171')],{'through':'fax_interaction_has_tags','as':_0x242e('0x180')});db[_0x242e('0x4d')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x181'),'through':_0x242e('0x182'),'foreignKey':_0x242e('0x17e')});db['FaxMessage'][_0x242e('0x14d')](db[_0x242e('0x13')],{'onDelete':'cascade','as':_0x242e('0x13')});db[_0x242e('0x4f')][_0x242e('0x14d')](db[_0x242e('0x4d')],{'as':_0x242e('0x183'),'foreignKey':_0x242e('0x17e')});db[_0x242e('0x4f')]['belongsTo'](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x15b')});db[_0x242e('0x4f')]['belongsTo'](db[_0x242e('0xeb')],{'as':_0x242e('0xeb'),'foreignKey':_0x242e('0x184')});db['FaxMessage'][_0x242e('0x14d')](db['FaxAccount'],{'as':'Account','foreignKey':_0x242e('0x17a')});db['FaxQueue']['belongsToMany'](db['User'],{'as':_0x242e('0x17d'),'through':'UserFaxQueue'});db[_0x242e('0x51')][_0x242e('0x125')](db['Team'],{'through':_0x242e('0x185'),'as':_0x242e('0x154')});db[_0x242e('0x53')][_0x242e('0x14d')](db[_0x242e('0x4c')],{});db[_0x242e('0x53')][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db[_0x242e('0x53')][_0x242e('0x14d')](db['CmContact'],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db['FaxQueueReport'][_0x242e('0x14d')](db[_0x242e('0x4d')],{});db[_0x242e('0x53')][_0x242e('0x14d')](db['FaxMessage'],{});db[_0x242e('0x53')][_0x242e('0x14d')](db[_0x242e('0x13')],{});db['FaxQueueReport']['belongsTo'](db[_0x242e('0x51')],{});db[_0x242e('0x141')][_0x242e('0x118')](db[_0x242e('0x80')],{'as':'Dispositions','foreignKey':_0x242e('0x186'),'onDelete':_0x242e('0x11a')});db['SmsAccount'][_0x242e('0x118')](db['CannedAnswer'],{'as':_0x242e('0x164'),'foreignKey':'SmsAccountId'});db[_0x242e('0x141')][_0x242e('0x118')](db['SmsMessage'],{'as':_0x242e('0x156'),'foreignKey':'SmsAccountId'});db[_0x242e('0x141')][_0x242e('0x118')](db['SmsInteraction'],{'as':_0x242e('0x165')});db['SmsAccount']['hasMany'](db[_0x242e('0x56')],{'as':_0x242e('0x148')});db[_0x242e('0x141')][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':'List','foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db[_0x242e('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x242e('0x16b')});db[_0x242e('0x141')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x17d'),'through':'user_has_sms_accounts'});db[_0x242e('0x56')][_0x242e('0x14d')](db[_0x242e('0x13')],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x56')][_0x242e('0x14d')](db['SmsQueue'],{'onDelete':_0x242e('0x15f')});db['SmsApplication'][_0x242e('0x14d')](db[_0x242e('0x141')],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x56')][_0x242e('0x14d')](db['Interval'],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x56')][_0x242e('0x14d')](db[_0x242e('0x171')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x177')});db[_0x242e('0x58')][_0x242e('0x118')](db[_0x242e('0x5a')],{'as':'Messages','onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x187')});db['SmsInteraction'][_0x242e('0x14d')](db['SmsAccount'],{'as':'Account','foreignKey':_0x242e('0x186')});db[_0x242e('0x58')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db['SmsInteraction'][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':'Owner','foreignKey':_0x242e('0x117')});db['SmsInteraction']['belongsToMany'](db[_0x242e('0x171')],{'through':_0x242e('0x188'),'as':_0x242e('0x173')});db[_0x242e('0x58')][_0x242e('0x125')](db['Tag'],{'through':_0x242e('0x188'),'as':'ThroughTags'});db[_0x242e('0x58')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x181'),'through':_0x242e('0x12e'),'foreignKey':_0x242e('0x187')});db['SmsMessage'][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x13')});db[_0x242e('0x5a')]['belongsTo'](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x15b')});db['SmsMessage']['belongsTo'](db[_0x242e('0x58')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x183'),'foreignKey':_0x242e('0x187')});db[_0x242e('0x5a')][_0x242e('0x14d')](db['SmsAccount'],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x186')});db[_0x242e('0x138')]['belongsToMany'](db['User'],{'as':_0x242e('0x17d'),'through':_0x242e('0x37'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x189'),'as':'Teams'});db[_0x242e('0x18a')][_0x242e('0x118')](db['Disposition'],{'as':_0x242e('0x162'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x242e('0x18a')][_0x242e('0x118')](db['CannedAnswer'],{'as':_0x242e('0x164'),'foreignKey':_0x242e('0x18b')});db[_0x242e('0x18a')][_0x242e('0x118')](db[_0x242e('0x5f')],{'as':_0x242e('0x165'),'foreignKey':_0x242e('0x18b')});db[_0x242e('0x18a')][_0x242e('0x118')](db[_0x242e('0x61')],{'as':_0x242e('0x156'),'foreignKey':'OpenchannelAccountId'});db[_0x242e('0x18a')][_0x242e('0x118')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db[_0x242e('0x18a')][_0x242e('0x14d')](db[_0x242e('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x242e('0x16b')});db[_0x242e('0x18a')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x17d'),'through':'user_has_openchannel_accounts'});db[_0x242e('0x5e')][_0x242e('0x14d')](db[_0x242e('0x13')],{'onDelete':_0x242e('0x15f')});db['OpenchannelApplication'][_0x242e('0x14d')](db[_0x242e('0x62')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x18c')});db[_0x242e('0x5e')][_0x242e('0x14d')](db[_0x242e('0x18a')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x18b')});db[_0x242e('0x5e')][_0x242e('0x14d')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x242e('0x176')});db[_0x242e('0x5e')][_0x242e('0x14d')](db[_0x242e('0x171')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x177')});db[_0x242e('0x5f')][_0x242e('0x118')](db['OpenchannelMessage'],{'as':_0x242e('0x156'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x18d')});db['OpenchannelInteraction'][_0x242e('0x14d')](db[_0x242e('0x18a')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x18b')});db[_0x242e('0x5f')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':'Contact','foreignKey':_0x242e('0x15c')});db[_0x242e('0x5f')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':'UserId'});db[_0x242e('0x5f')][_0x242e('0x125')](db['Tag'],{'through':_0x242e('0x18e'),'as':_0x242e('0x173')});db[_0x242e('0x5f')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x18e'),'as':_0x242e('0x180')});db[_0x242e('0x5f')]['belongsToMany'](db['User'],{'as':'Users','through':_0x242e('0x12f'),'foreignKey':_0x242e('0x18d')});db[_0x242e('0x61')][_0x242e('0x14d')](db['User'],{'onDelete':_0x242e('0x11a'),'as':'User'});db[_0x242e('0x61')]['belongsTo'](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':'Contact'});db[_0x242e('0x61')][_0x242e('0x14d')](db['OpenchannelInteraction'],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x183'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x242e('0x14d')](db[_0x242e('0xeb')],{'as':_0x242e('0xeb'),'foreignKey':_0x242e('0x184')});db[_0x242e('0x61')][_0x242e('0x14d')](db[_0x242e('0x18a')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x18b')});db[_0x242e('0x62')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x17d'),'through':'UserOpenchannelQueue','foreignKey':_0x242e('0x18c')});db[_0x242e('0x62')][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x18f'),'as':_0x242e('0x154')});db[_0x242e('0x13d')][_0x242e('0x118')](db[_0x242e('0x80')],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x190'),'onDelete':'cascade'});db['ChatWebsite'][_0x242e('0x118')](db[_0x242e('0x163')],{'as':_0x242e('0x164'),'foreignKey':_0x242e('0x190')});db[_0x242e('0x13d')][_0x242e('0x118')](db[_0x242e('0x6f')],{'as':_0x242e('0x191')});db[_0x242e('0x13d')][_0x242e('0x118')](db[_0x242e('0x68')],{'as':_0x242e('0x165')});db['ChatWebsite'][_0x242e('0x118')](db['ChatApplication'],{'as':_0x242e('0x148')});db['ChatWebsite'][_0x242e('0x118')](db[_0x242e('0x69')],{'as':_0x242e('0x156')});db[_0x242e('0x13d')][_0x242e('0x14d')](db['CmList'],{'as':'List','foreignKey':_0x242e('0x168')});db['ChatWebsite'][_0x242e('0x14d')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0x242e('0x13d')]['belongsTo'](db[_0x242e('0x3f')],{'as':_0x242e('0x3f'),'foreignKey':_0x242e('0x15d')});db[_0x242e('0x13d')][_0x242e('0x14d')](db[_0x242e('0x84')],{'as':_0x242e('0x16a'),'foreignKey':_0x242e('0x16b')});db[_0x242e('0x13d')][_0x242e('0x125')](db['User'],{'as':_0x242e('0x17d'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x242e('0x14d')](db[_0x242e('0x18a')],{});db[_0x242e('0x64')]['belongsTo'](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db['OpenchannelQueueReport'][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':'Contact','foreignKey':_0x242e('0x15c')});db['OpenchannelQueueReport'][_0x242e('0x14d')](db[_0x242e('0x5f')],{});db[_0x242e('0x64')][_0x242e('0x14d')](db[_0x242e('0x61')],{});db[_0x242e('0x64')][_0x242e('0x14d')](db[_0x242e('0x13')],{});db[_0x242e('0x64')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x242e('0x66')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':'Agent','foreignKey':_0x242e('0x117'),'onDelete':_0x242e('0x15f')});db['ChatApplication'][_0x242e('0x14d')](db[_0x242e('0x136')],{'as':_0x242e('0x192'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x242e('0x66')]['belongsTo'](db[_0x242e('0x13d')],{'as':_0x242e('0x193'),'foreignKey':_0x242e('0x190'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x242e('0x171')],{'onDelete':_0x242e('0x15f'),'foreignKey':'TagId'});db[_0x242e('0x68')][_0x242e('0x118')](db[_0x242e('0x69')],{'as':'Messages','onDelete':'cascade','foreignKey':'ChatInteractionId'});db['ChatInteraction']['belongsTo'](db[_0x242e('0x13d')],{'as':_0x242e('0x16f'),'foreignKey':'ChatWebsiteId'});db[_0x242e('0x68')]['belongsTo'](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x68')]['belongsTo'](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':_0x242e('0x117')});db['ChatInteraction'][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x194'),'as':_0x242e('0x173')});db[_0x242e('0x68')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x194'),'as':_0x242e('0x180')});db[_0x242e('0x68')][_0x242e('0x125')](db['User'],{'as':'Users','through':_0x242e('0x12d'),'foreignKey':_0x242e('0x195')});db[_0x242e('0x69')][_0x242e('0x14d')](db['User'],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x13')});db[_0x242e('0x69')][_0x242e('0x14d')](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x15b'),'foreignKey':'ContactId'});db['ChatMessage'][_0x242e('0x14d')](db[_0x242e('0x68')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x183'),'foreignKey':_0x242e('0x195')});db[_0x242e('0x69')][_0x242e('0x14d')](db[_0x242e('0xeb')],{'as':_0x242e('0xeb'),'foreignKey':_0x242e('0x184')});db['ChatMessage'][_0x242e('0x14d')](db[_0x242e('0x13d')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x190')});db[_0x242e('0x6b')][_0x242e('0x118')](db[_0x242e('0xeb')],{'as':_0x242e('0x174'),'foreignKey':_0x242e('0x175'),'onDelete':'cascade','hooks':!![]});db[_0x242e('0x6b')]['belongsTo'](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x6b')][_0x242e('0x14d')](db[_0x242e('0x13d')],{'as':_0x242e('0x16f'),'foreignKey':'ChatWebsiteId'});db[_0x242e('0x136')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x242e('0xe4')],{'through':_0x242e('0x196'),'as':'Teams'});db[_0x242e('0x6d')][_0x242e('0x118')](db['ChatInternalMessage'],{'as':_0x242e('0x156'),'foreignKey':'ChatGroupId','onDelete':_0x242e('0x11a')});db['ChatGroup'][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x14a'),'through':_0x242e('0x127')});db[_0x242e('0x6f')][_0x242e('0x14d')](db[_0x242e('0x13d')],{'as':_0x242e('0x193'),'foreignKey':'ChatWebsiteId'});db[_0x242e('0x71')][_0x242e('0x118')](db[_0x242e('0x73')],{'as':_0x242e('0x128'),'foreignKey':_0x242e('0x197')});db[_0x242e('0x73')][_0x242e('0x118')](db[_0x242e('0x75')],{'as':_0x242e('0x198'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x73')][_0x242e('0x118')](db[_0x242e('0x77')],{'as':_0x242e('0x11b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x73')]['hasMany'](db[_0x242e('0x78')],{'as':_0x242e('0x199'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x73')][_0x242e('0x118')](db[_0x242e('0x79')],{'as':_0x242e('0x79'),'foreignKey':'ContactId'});db[_0x242e('0x73')][_0x242e('0x118')](db['JscriptySessionReport'],{'as':_0x242e('0x14c'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0x73')][_0x242e('0x118')](db[_0x242e('0x5f')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x242e('0x73')]['hasMany'](db[_0x242e('0x68')],{'as':'ChatInteractions','foreignKey':_0x242e('0x15c'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x73')][_0x242e('0x118')](db['SmsInteraction'],{'as':_0x242e('0x11f'),'foreignKey':_0x242e('0x15c'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x73')]['hasMany'](db[_0x242e('0x4d')],{'as':'FaxInteractions','foreignKey':_0x242e('0x15c'),'onDelete':_0x242e('0x15f')});db['CmContact'][_0x242e('0x118')](db['MailInteraction'],{'as':_0x242e('0x12b'),'foreignKey':_0x242e('0x15c'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x73')][_0x242e('0x14d')](db[_0x242e('0x71')],{'as':_0x242e('0x19a'),'foreignKey':_0x242e('0x197')});db[_0x242e('0x73')]['belongsTo'](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x73')]['belongsToMany'](db['User'],{'as':_0x242e('0x181'),'through':_0x242e('0x129')});db[_0x242e('0x73')][_0x242e('0x125')](db[_0x242e('0x171')],{'as':_0x242e('0x173'),'through':_0x242e('0x19b')});db[_0x242e('0x73')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':'cm_contact_has_tags','as':_0x242e('0x180')});db[_0x242e('0x75')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':'Contact','foreignKey':_0x242e('0x15c'),'onDelete':'cascade'});db['CmHopper'][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x75')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x19c'),'foreignKey':'UserId'});db[_0x242e('0x75')][_0x242e('0x14d')](db[_0x242e('0x132')],{'as':_0x242e('0x192'),'foreignKey':_0x242e('0x14b'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x75')][_0x242e('0x14d')](db[_0x242e('0xe7')],{'as':_0x242e('0xe7'),'foreignKey':_0x242e('0x19d'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x75')][_0x242e('0x14d')](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':_0x242e('0x19e')});db[_0x242e('0x76')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':'ContactId','onDelete':_0x242e('0x11a')});db[_0x242e('0x76')][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x76')]['belongsTo'](db[_0x242e('0x132')],{'as':_0x242e('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x242e('0x11a')});db['CmHopperBlack'][_0x242e('0x14d')](db[_0x242e('0xe7')],{'as':_0x242e('0xe7'),'foreignKey':'CampaignId','onDelete':_0x242e('0x11a')});db[_0x242e('0x7e')][_0x242e('0x118')](db['Condition'],{'as':{'plural':'All','singular':_0x242e('0x19f')},'foreignKey':_0x242e('0x1a0'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x242e('0x118')](db[_0x242e('0x1a1')],{'as':{'plural':_0x242e('0x1a2'),'singular':_0x242e('0x1a3')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x242e('0x7e')][_0x242e('0x118')](db[_0x242e('0x7d')],{'as':_0x242e('0x1a4'),'foreignKey':'AutomationId','onDelete':_0x242e('0x11a'),'hooks':!![]});db['Disposition'][_0x242e('0x118')](db['Disposition'],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x1a5'),'onDelete':_0x242e('0x11a')});db[_0x242e('0x83')][_0x242e('0x118')](db[_0x242e('0x83')],{'as':_0x242e('0x1a6'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x242e('0x83')][_0x242e('0x118')](db[_0x242e('0x19')],{'as':_0x242e('0x1a7'),'foreignKey':'IntervalId','onDelete':_0x242e('0x15f')});db[_0x242e('0x83')][_0x242e('0x118')](db['MailApplication'],{'as':_0x242e('0x1a8'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x83')][_0x242e('0x118')](db[_0x242e('0x66')],{'as':_0x242e('0x1a9'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x83')][_0x242e('0x118')](db[_0x242e('0x17b')],{'as':_0x242e('0x1aa'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x83')]['hasMany'](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x242e('0x176')});db[_0x242e('0x88')][_0x242e('0x14d')](db[_0x242e('0x3f')],{});db[_0x242e('0x88')][_0x242e('0x14d')](db[_0x242e('0x95')],{'foreignKey':_0x242e('0x1ab')});db[_0x242e('0x88')][_0x242e('0x14d')](db[_0x242e('0x1ac')],{'foreignKey':_0x242e('0x1ad')});db['Sound'][_0x242e('0x125')](db[_0x242e('0x149')],{'as':_0x242e('0x1ae'),'through':_0x242e('0x1af'),'onDelete':_0x242e('0x15f')});db[_0x242e('0x171')][_0x242e('0x125')](db['CmContact'],{'through':_0x242e('0x19b')});db[_0x242e('0x171')][_0x242e('0x125')](db[_0x242e('0x68')],{'through':_0x242e('0x194')});db['Tag'][_0x242e('0x125')](db[_0x242e('0x43')],{'through':_0x242e('0x172')});db[_0x242e('0x171')][_0x242e('0x125')](db[_0x242e('0x58')],{'through':_0x242e('0x188')});db[_0x242e('0x171')]['belongsToMany'](db[_0x242e('0x4d')],{'through':_0x242e('0x17f')});db[_0x242e('0x171')]['belongsToMany'](db[_0x242e('0x5f')],{'through':_0x242e('0x18e')});db['Tag']['belongsToMany'](db[_0x242e('0x121')],{'through':_0x242e('0x1b0')});db[_0x242e('0x8e')][_0x242e('0x118')](db['Condition'],{'as':{'plural':_0x242e('0x1b1'),'singular':_0x242e('0x1b2')},'foreignKey':_0x242e('0x1b3'),'onDelete':'cascade','hooks':!![]});db[_0x242e('0x8e')][_0x242e('0x118')](db['Condition'],{'as':{'plural':_0x242e('0x1b4'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x242e('0x11a'),'hooks':!![]});db[_0x242e('0x8e')][_0x242e('0x118')](db[_0x242e('0x7d')],{'as':_0x242e('0x1a4'),'foreignKey':'TriggerId','onDelete':_0x242e('0x11a'),'hooks':!![]});db['AnalyticCustomReport'][_0x242e('0x118')](db[_0x242e('0x1b5')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ad'),'hooks':!![]});db[_0x242e('0x95')][_0x242e('0x118')](db[_0x242e('0x1b5')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ab')});db[_0x242e('0x99')][_0x242e('0x118')](db[_0x242e('0x1b5')],{'as':_0x242e('0x1b6'),'onDelete':'cascade','foreignKey':_0x242e('0x1b7')});db[_0x242e('0x1b5')][_0x242e('0x14d')](db[_0x242e('0x99')],{'foreignKey':_0x242e('0x1b7')});db[_0x242e('0x1b8')][_0x242e('0x118')](db[_0x242e('0x9f')],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db['SalesforceConfiguration']['hasMany'](db[_0x242e('0xa1')],{'as':_0x242e('0x1bb'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1bc')});db['SalesforceConfiguration'][_0x242e('0x118')](db[_0x242e('0xa1')],{'as':_0x242e('0x1bd'),'onDelete':_0x242e('0x11a'),'foreignKey':'DescriptionId'});db[_0x242e('0x9f')][_0x242e('0x118')](db['SalesforceField'],{'as':_0x242e('0x1b6'),'onDelete':'cascade','foreignKey':_0x242e('0x1be')});db[_0x242e('0x9f')][_0x242e('0x14d')](db[_0x242e('0x1b8')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0xa1')][_0x242e('0x118')](db[_0x242e('0xa1')],{'as':'Subject','foreignKey':_0x242e('0x1bc')});db[_0x242e('0xa1')]['hasMany'](db['SalesforceField'],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db['SalesforceField'][_0x242e('0x118')](db[_0x242e('0xa1')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0xa1')][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0xa3')][_0x242e('0x118')](db[_0x242e('0xa5')],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':'AccountId'});db[_0x242e('0xa5')]['hasMany'](db[_0x242e('0xa7')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x242e('0x1bc')});db[_0x242e('0xa5')][_0x242e('0x118')](db[_0x242e('0xa7')],{'as':_0x242e('0x1bd'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xa5')]['hasMany'](db[_0x242e('0xa7')],{'as':_0x242e('0x1b6'),'onDelete':'cascade','foreignKey':_0x242e('0x1be')});db[_0x242e('0xa5')][_0x242e('0x14d')](db[_0x242e('0xa3')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0x242e('0x118')](db[_0x242e('0xa7')],{'as':'Subject','foreignKey':_0x242e('0x1bc')});db[_0x242e('0xa7')]['hasMany'](db[_0x242e('0xa7')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xa7')][_0x242e('0x118')](db[_0x242e('0xa7')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0xa7')][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0xa8')][_0x242e('0x118')](db[_0x242e('0xaa')],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0xaa')][_0x242e('0x118')](db['DeskField'],{'as':_0x242e('0x1bb'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xaa')][_0x242e('0x118')](db[_0x242e('0xab')],{'as':_0x242e('0x1bd'),'onDelete':'cascade','foreignKey':_0x242e('0x1c0')});db[_0x242e('0xaa')][_0x242e('0x118')](db[_0x242e('0xab')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xaa')][_0x242e('0x14d')](db[_0x242e('0xa8')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0xaa')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x1c2')});db[_0x242e('0xab')][_0x242e('0x118')](db[_0x242e('0xab')],{'as':_0x242e('0x1c3'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xab')][_0x242e('0x118')](db['DeskField'],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xab')][_0x242e('0x118')](db['DeskField'],{'as':_0x242e('0x1c4'),'foreignKey':'FieldId'});db[_0x242e('0xab')][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':'Variable','foreignKey':_0x242e('0x1c1')});db[_0x242e('0xad')][_0x242e('0x118')](db[_0x242e('0xaf')],{'as':_0x242e('0x1b9'),'onDelete':'cascade','foreignKey':_0x242e('0x1ba')});db['ZohoConfiguration'][_0x242e('0x118')](db['ZohoField'],{'as':_0x242e('0x1bb'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xaf')][_0x242e('0x118')](db[_0x242e('0xb1')],{'as':_0x242e('0x1bd'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xaf')]['hasMany'](db[_0x242e('0xb1')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xaf')][_0x242e('0x14d')](db['ZohoAccount'],{'as':_0x242e('0x16f'),'foreignKey':'AccountId'});db[_0x242e('0xb1')][_0x242e('0x118')](db[_0x242e('0xb1')],{'as':_0x242e('0x1c3'),'foreignKey':'SubjectId'});db[_0x242e('0xb1')][_0x242e('0x118')](db[_0x242e('0xb1')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xb1')]['hasMany'](db[_0x242e('0xb1')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0xb1')]['belongsTo'](db['Variable'],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0x1c5')][_0x242e('0x118')](db[_0x242e('0xb4')],{'as':_0x242e('0x1b9'),'onDelete':'cascade','foreignKey':_0x242e('0x1ba')});db[_0x242e('0xb4')][_0x242e('0x118')](db[_0x242e('0x1c6')],{'as':_0x242e('0x1bb'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xb4')]['hasMany'](db[_0x242e('0x1c6')],{'as':_0x242e('0x1bd'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xb4')]['hasMany'](db[_0x242e('0x1c6')],{'as':_0x242e('0x1b6'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xb4')][_0x242e('0x14d')](db['ZendeskAccount'],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x1ba')});db['ZendeskConfiguration'][_0x242e('0x125')](db[_0x242e('0x171')],{'through':'int_zendesk_configuration_has_tags'});db[_0x242e('0x1c6')][_0x242e('0x118')](db[_0x242e('0x1c6')],{'as':'Subject','foreignKey':_0x242e('0x1bc')});db[_0x242e('0x1c6')][_0x242e('0x118')](db[_0x242e('0x1c6')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0x1c6')][_0x242e('0x118')](db[_0x242e('0x1c6')],{'as':_0x242e('0x1c4'),'foreignKey':_0x242e('0x1be')});db['ZendeskField'][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0xb7')]['hasMany'](db[_0x242e('0x1c7')],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0x1c7')]['hasMany'](db[_0x242e('0xba')],{'as':_0x242e('0x1bb'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1bc')});db['FreshdeskConfiguration'][_0x242e('0x118')](db[_0x242e('0xba')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x242e('0x1c0')});db[_0x242e('0x1c7')]['hasMany'](db[_0x242e('0xba')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':'FieldId'});db[_0x242e('0x1c7')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x242e('0x1ba')});db[_0x242e('0x1c7')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x1c8')});db[_0x242e('0xba')]['hasMany'](db[_0x242e('0xba')],{'as':'Subject','foreignKey':_0x242e('0x1bc')});db[_0x242e('0xba')][_0x242e('0x118')](db[_0x242e('0xba')],{'as':'Description','foreignKey':_0x242e('0x1c0')});db[_0x242e('0xba')][_0x242e('0x118')](db[_0x242e('0xba')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0xba')][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':'Variable','foreignKey':_0x242e('0x1c1')});db[_0x242e('0xbc')][_0x242e('0x118')](db['VtigerConfiguration'],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':'AccountId'});db[_0x242e('0xbe')][_0x242e('0x118')](db[_0x242e('0x1c9')],{'as':_0x242e('0x1bb'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xbe')][_0x242e('0x118')](db[_0x242e('0x1c9')],{'as':_0x242e('0x1bd'),'foreignKey':_0x242e('0x1c0')});db['VtigerConfiguration'][_0x242e('0x118')](db[_0x242e('0x1c9')],{'as':_0x242e('0x1b6'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xbe')][_0x242e('0x14d')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x242e('0x1ba')});db[_0x242e('0x1c9')][_0x242e('0x118')](db[_0x242e('0x1c9')],{'as':'Subject','foreignKey':_0x242e('0x1bc')});db['VtigerField'][_0x242e('0x118')](db['VtigerField'],{'as':_0x242e('0x1bf'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x242e('0x118')](db[_0x242e('0x1c9')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0x1c9')][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':'Variable','foreignKey':_0x242e('0x1c1')});db['ServicenowAccount'][_0x242e('0x118')](db[_0x242e('0xc2')],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0xc2')][_0x242e('0x118')](db['ServicenowField'],{'as':_0x242e('0x1bb'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0x242e('0xc4')],{'as':_0x242e('0x1bd'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xc2')][_0x242e('0x118')](db[_0x242e('0xc4')],{'as':_0x242e('0x1b6'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xc2')][_0x242e('0x14d')](db[_0x242e('0xc1')],{'as':'Account','foreignKey':'AccountId'});db[_0x242e('0xc4')][_0x242e('0x118')](db[_0x242e('0xc4')],{'as':_0x242e('0x1c3'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xc4')][_0x242e('0x118')](db[_0x242e('0xc4')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0xc4')][_0x242e('0x118')](db[_0x242e('0xc4')],{'as':'Field','foreignKey':_0x242e('0x1be')});db[_0x242e('0xc4')]['belongsTo'](db['Variable'],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0x1ca')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x242e('0x1b9'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db['Dynamics365Configuration']['hasMany'](db[_0x242e('0x1cb')],{'as':'Subjects','onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0xc7')][_0x242e('0x118')](db[_0x242e('0x1cb')],{'as':_0x242e('0x1bd'),'onDelete':'cascade','foreignKey':_0x242e('0x1c0')});db[_0x242e('0xc7')][_0x242e('0x118')](db[_0x242e('0x1cb')],{'as':_0x242e('0x1b6'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0xc7')][_0x242e('0x14d')](db[_0x242e('0x1ca')],{'as':_0x242e('0x16f'),'foreignKey':'AccountId'});db[_0x242e('0x1cb')]['hasMany'](db[_0x242e('0x1cb')],{'as':_0x242e('0x1c3'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0x1cb')]['hasMany'](db[_0x242e('0x1cb')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0x1cb')][_0x242e('0x118')](db['Dynamics365Field'],{'as':_0x242e('0x1c4'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x242e('0x14d')](db[_0x242e('0x8f')],{'as':_0x242e('0x8f'),'foreignKey':_0x242e('0x1c1')});db[_0x242e('0x1cc')]['hasMany'](db[_0x242e('0x1cd')],{'as':'Configurations','onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0x1cd')][_0x242e('0x118')](db[_0x242e('0x1ce')],{'as':'Subjects','foreignKey':_0x242e('0x1bc')});db[_0x242e('0x1cd')]['hasMany'](db[_0x242e('0x1ce')],{'as':'Descriptions','foreignKey':_0x242e('0x1c0')});db[_0x242e('0x1cd')][_0x242e('0x118')](db[_0x242e('0x1ce')],{'as':_0x242e('0x1b6'),'foreignKey':_0x242e('0x1be')});db['FreshsalesConfiguration'][_0x242e('0x14d')](db[_0x242e('0x1cc')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x1ba')});db[_0x242e('0x1ce')][_0x242e('0x118')](db[_0x242e('0x1ce')],{'as':_0x242e('0x1c3'),'foreignKey':_0x242e('0x1bc')});db[_0x242e('0x1ce')][_0x242e('0x118')](db[_0x242e('0x1ce')],{'as':_0x242e('0x1bf'),'foreignKey':_0x242e('0x1c0')});db[_0x242e('0x1ce')]['hasMany'](db['FreshsalesField'],{'as':_0x242e('0x1c4'),'foreignKey':_0x242e('0x1be')});db[_0x242e('0x1ce')][_0x242e('0x14d')](db['Variable'],{'as':_0x242e('0x8f'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x242e('0x14d')](db[_0x242e('0x13d')],{});db[_0x242e('0xcd')]['belongsTo'](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db[_0x242e('0xcd')]['belongsTo'](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':_0x242e('0x15c')});db[_0x242e('0xcd')][_0x242e('0x14d')](db[_0x242e('0x68')],{});db['ChatQueueReport']['belongsTo'](db[_0x242e('0x69')],{});db[_0x242e('0xcd')][_0x242e('0x14d')](db[_0x242e('0x13')],{});db[_0x242e('0xcd')][_0x242e('0x14d')](db[_0x242e('0x136')],{});db[_0x242e('0xcf')][_0x242e('0x14d')](db['User'],{'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1cf')});db[_0x242e('0xcf')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x242e('0x1d0')});db[_0x242e('0xd4')]['hasMany'](db[_0x242e('0xd3')],{'foreignKey':_0x242e('0x1d1'),'onDelete':'cascade'});db[_0x242e('0xd4')][_0x242e('0x118')](db['JscriptyAnswerReport'],{'foreignKey':_0x242e('0x1d1'),'onDelete':_0x242e('0x11a')});db[_0x242e('0xd6')][_0x242e('0x14d')](db['SmsAccount'],{});db['SmsQueueReport'][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':'List','foreignKey':_0x242e('0x168')});db['SmsQueueReport'][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':'Contact','foreignKey':'ContactId'});db['SmsQueueReport']['belongsTo'](db[_0x242e('0x58')],{});db['SmsQueueReport']['belongsTo'](db[_0x242e('0x5a')],{});db['SmsQueueReport'][_0x242e('0x14d')](db['User'],{});db[_0x242e('0xd6')]['belongsTo'](db[_0x242e('0x138')],{});db[_0x242e('0x1d2')][_0x242e('0x118')](db[_0x242e('0xd4')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x242e('0x118')](db[_0x242e('0xd3')],{'foreignKey':_0x242e('0x1d3')});db[_0x242e('0x1d2')][_0x242e('0x118')](db[_0x242e('0xd1')],{'foreignKey':_0x242e('0x1d3')});db[_0x242e('0xe0')][_0x242e('0x125')](db['User'],{'as':_0x242e('0x181'),'through':_0x242e('0x1d4')});db['Team']['belongsToMany'](db['User'],{'as':_0x242e('0x17d'),'through':_0x242e('0x12a')});db[_0x242e('0xe4')][_0x242e('0x125')](db[_0x242e('0x132')],{'through':'TeamVoiceQueue','as':_0x242e('0x1d5')});db[_0x242e('0xe4')][_0x242e('0x125')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x242e('0x135')});db[_0x242e('0xe4')]['belongsToMany'](db[_0x242e('0x136')],{'through':_0x242e('0x196'),'as':_0x242e('0x1d6')});db[_0x242e('0xe4')][_0x242e('0x125')](db[_0x242e('0x51')],{'through':'team_has_fax_queues','as':_0x242e('0x137')});db[_0x242e('0xe4')]['belongsToMany'](db[_0x242e('0x138')],{'through':_0x242e('0x189'),'as':'SmsQueues'});db[_0x242e('0xe4')][_0x242e('0x125')](db[_0x242e('0x62')],{'through':_0x242e('0x18f'),'as':_0x242e('0x13a')});db[_0x242e('0xe4')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x242e('0x1d7'),'as':_0x242e('0x13b')});db[_0x242e('0xe4')][_0x242e('0x125')](db[_0x242e('0xf8')],{'through':_0x242e('0x1d8'),'as':'VoicePrefixes'});db[_0x242e('0xe7')][_0x242e('0x118')](db[_0x242e('0x75')],{'as':'Hoppers','foreignKey':_0x242e('0x19d')});db['Campaign'][_0x242e('0x118')](db[_0x242e('0x77')],{'as':_0x242e('0x11b'),'foreignKey':_0x242e('0x19d')});db[_0x242e('0xe7')]['hasMany'](db['CmHopperHistory'],{'as':_0x242e('0x199'),'foreignKey':_0x242e('0x19d')});db[_0x242e('0xe7')]['hasMany'](db[_0x242e('0x76')],{'as':_0x242e('0x1d9'),'foreignKey':_0x242e('0x19d')});db[_0x242e('0xe7')][_0x242e('0x14d')](db[_0x242e('0x14e')],{'as':'Trunk','foreignKey':_0x242e('0x14f')});db['Campaign'][_0x242e('0x14d')](db[_0x242e('0x14e')],{'as':_0x242e('0x150'),'foreignKey':_0x242e('0x151')});db['Campaign']['belongsTo'](db[_0x242e('0x83')],{'as':_0x242e('0x83'),'foreignKey':_0x242e('0x176')});db[_0x242e('0xe7')]['belongsTo'](db[_0x242e('0xe0')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x242e('0xe7')][_0x242e('0x125')](db[_0x242e('0xf7')],{'as':'Lists','through':_0x242e('0x1da')});db[_0x242e('0xe7')][_0x242e('0x125')](db[_0x242e('0xf7')],{'as':'BlackLists','through':_0x242e('0x1db')});db[_0x242e('0xeb')][_0x242e('0x14d')](db[_0x242e('0x6b')],{'as':_0x242e('0x6b'),'foreignKey':_0x242e('0x175')});db[_0x242e('0xee')][_0x242e('0x14d')](db[_0x242e('0x45')],{});db[_0x242e('0xee')][_0x242e('0x14d')](db[_0x242e('0x43')],{});db['MailTransferReport'][_0x242e('0x14d')](db[_0x242e('0x3f')],{'foreignKey':_0x242e('0x1dc'),'as':_0x242e('0x1dd')});db[_0x242e('0xee')][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1de'),'as':_0x242e('0x1df')});db['MailTransferReport'][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1e0'),'as':'ToAgent'});db[_0x242e('0xee')][_0x242e('0x14d')](db[_0x242e('0x134')],{'foreignKey':_0x242e('0x1e1'),'as':_0x242e('0x1e2')});db[_0x242e('0xee')][_0x242e('0x14d')](db['MailAccount'],{'foreignKey':_0x242e('0x1e3'),'as':_0x242e('0x1e4')});db['ChatTransferReport'][_0x242e('0x14d')](db[_0x242e('0x69')],{});db[_0x242e('0xf0')][_0x242e('0x14d')](db[_0x242e('0x68')],{});db[_0x242e('0xf0')][_0x242e('0x14d')](db[_0x242e('0x13d')],{'foreignKey':_0x242e('0x1e5'),'as':'FromAccount'});db[_0x242e('0xf0')][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x242e('0xf0')]['belongsTo'](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1e0'),'as':_0x242e('0x1e6')});db[_0x242e('0xf0')][_0x242e('0x14d')](db[_0x242e('0x136')],{'foreignKey':_0x242e('0x1e7'),'as':_0x242e('0x1e2')});db[_0x242e('0xf0')][_0x242e('0x14d')](db[_0x242e('0x13d')],{'foreignKey':_0x242e('0x1e8'),'as':_0x242e('0x1e4')});db[_0x242e('0xf1')][_0x242e('0x14d')](db[_0x242e('0x4f')],{});db[_0x242e('0xf1')][_0x242e('0x14d')](db['FaxInteraction'],{});db[_0x242e('0xf1')]['belongsTo'](db[_0x242e('0x4c')],{'foreignKey':'FromFaxAccountId','as':_0x242e('0x1dd')});db[_0x242e('0xf1')][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':'FromUserId','as':_0x242e('0x1df')});db['FaxTransferReport'][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1e0'),'as':'ToAgent'});db[_0x242e('0xf1')][_0x242e('0x14d')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x242e('0xf1')][_0x242e('0x14d')](db[_0x242e('0x4c')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x242e('0xf3')][_0x242e('0x14d')](db['OpenchannelMessage'],{});db[_0x242e('0xf3')][_0x242e('0x14d')](db['OpenchannelInteraction'],{});db[_0x242e('0xf3')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x242e('0x1dd')});db[_0x242e('0xf3')][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1de'),'as':'FromAgent'});db[_0x242e('0xf3')][_0x242e('0x14d')](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1e0'),'as':_0x242e('0x1e6')});db[_0x242e('0xf3')][_0x242e('0x14d')](db[_0x242e('0x62')],{'foreignKey':_0x242e('0x1e9'),'as':_0x242e('0x1e2')});db[_0x242e('0xf3')][_0x242e('0x14d')](db[_0x242e('0x18a')],{'foreignKey':_0x242e('0x1ea'),'as':_0x242e('0x1e4')});db[_0x242e('0xf5')][_0x242e('0x14d')](db['SmsMessage'],{});db[_0x242e('0xf5')][_0x242e('0x14d')](db[_0x242e('0x58')],{});db[_0x242e('0xf5')]['belongsTo'](db[_0x242e('0x141')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1de'),'as':_0x242e('0x1df')});db[_0x242e('0xf5')][_0x242e('0x14d')](db['User'],{'foreignKey':_0x242e('0x1e0'),'as':_0x242e('0x1e6')});db[_0x242e('0xf5')][_0x242e('0x14d')](db['SmsQueue'],{'foreignKey':_0x242e('0x1eb'),'as':'ToQueue'});db[_0x242e('0xf5')][_0x242e('0x14d')](db[_0x242e('0x141')],{'foreignKey':_0x242e('0x1ec'),'as':'ToAccount'});db['CmList']['hasMany'](db['Disposition'],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x168'),'onDelete':_0x242e('0x11a')});db['CmList']['hasMany'](db[_0x242e('0x7b')],{'as':'CustomFields','foreignKey':'ListId'});db['CmList'][_0x242e('0x118')](db['CmContact'],{'as':_0x242e('0x128'),'onDelete':'cascade','foreignKey':_0x242e('0x168')});db[_0x242e('0xf7')][_0x242e('0x118')](db['CmHopperFinal'],{'as':_0x242e('0x11b'),'foreignKey':'ListId'});db[_0x242e('0xf7')][_0x242e('0x118')](db[_0x242e('0x78')],{'as':_0x242e('0x11c'),'foreignKey':'ListId'});db[_0x242e('0xf7')]['hasMany'](db[_0x242e('0x79')],{'as':_0x242e('0x79'),'foreignKey':_0x242e('0x168')});db['CmList'][_0x242e('0x125')](db[_0x242e('0x132')],{'as':'Queues','through':_0x242e('0x153')});db['CmList'][_0x242e('0x125')](db[_0x242e('0x13')],{'as':_0x242e('0x17d'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x242e('0x118')](db[_0x242e('0x19')],{'as':_0x242e('0x1a7'),'onDelete':_0x242e('0x11a')});db[_0x242e('0xf8')][_0x242e('0x125')](db['User'],{'as':_0x242e('0x17d'),'through':_0x242e('0x110')});db[_0x242e('0xf8')][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x1d8'),'as':_0x242e('0x154')});db['UserProfile']['hasMany'](db[_0x242e('0x13')],{'as':'Users','foreignKey':_0x242e('0x124')});db[_0x242e('0xf9')][_0x242e('0x118')](db[_0x242e('0x1ed')],{'as':_0x242e('0x1ee'),'foreignKey':_0x242e('0x124'),'onDelete':'cascade'});db[_0x242e('0x1ed')][_0x242e('0x118')](db[_0x242e('0xfc')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x242e('0x11a')});db[_0x242e('0x100')]['hasMany'](db[_0x242e('0x80')],{'as':_0x242e('0x162'),'foreignKey':_0x242e('0x1ef'),'onDelete':_0x242e('0x11a')});db['WhatsappAccount'][_0x242e('0x118')](db[_0x242e('0x163')],{'as':_0x242e('0x164'),'foreignKey':_0x242e('0x1ef')});db[_0x242e('0x100')]['hasMany'](db[_0x242e('0x104')],{'as':_0x242e('0x156'),'foreignKey':_0x242e('0x1ef')});db['WhatsappAccount']['hasMany'](db[_0x242e('0x121')],{'as':_0x242e('0x165')});db['WhatsappAccount'][_0x242e('0x118')](db[_0x242e('0x102')],{'as':_0x242e('0x148')});db[_0x242e('0x100')][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':'List','foreignKey':'ListId'});db[_0x242e('0x100')]['belongsTo'](db[_0x242e('0x84')],{'as':_0x242e('0x16a'),'foreignKey':_0x242e('0x16b')});db[_0x242e('0x100')][_0x242e('0x125')](db['User'],{'as':_0x242e('0x17d'),'through':_0x242e('0x1f0')});db[_0x242e('0x102')][_0x242e('0x14d')](db['User'],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x102')][_0x242e('0x14d')](db[_0x242e('0x10a')],{'onDelete':_0x242e('0x15f')});db['WhatsappApplication'][_0x242e('0x14d')](db[_0x242e('0x100')],{'onDelete':_0x242e('0x15f')});db[_0x242e('0x102')][_0x242e('0x14d')](db[_0x242e('0x83')],{'onDelete':_0x242e('0x15f'),'foreignKey':_0x242e('0x176')});db[_0x242e('0x102')]['belongsTo'](db['Tag'],{'onDelete':_0x242e('0x15f'),'foreignKey':'TagId'});db[_0x242e('0x121')]['hasMany'](db[_0x242e('0x104')],{'as':_0x242e('0x156'),'onDelete':_0x242e('0x11a'),'foreignKey':_0x242e('0x1f1')});db[_0x242e('0x121')][_0x242e('0x14d')](db[_0x242e('0x100')],{'as':_0x242e('0x16f'),'foreignKey':_0x242e('0x1ef')});db['WhatsappInteraction'][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction']['belongsTo'](db[_0x242e('0x13')],{'as':_0x242e('0x170'),'foreignKey':_0x242e('0x117')});db[_0x242e('0x121')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x1b0'),'as':_0x242e('0x173')});db[_0x242e('0x121')][_0x242e('0x125')](db[_0x242e('0x171')],{'through':_0x242e('0x1b0'),'as':_0x242e('0x180')});db[_0x242e('0x121')][_0x242e('0x125')](db[_0x242e('0x13')],{'as':'Users','through':_0x242e('0x131'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db['User'],{'as':_0x242e('0x13')});db[_0x242e('0x104')][_0x242e('0x14d')](db[_0x242e('0x73')],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x15b')});db[_0x242e('0x104')][_0x242e('0x14d')](db['WhatsappInteraction'],{'onDelete':_0x242e('0x11a'),'as':_0x242e('0x183'),'foreignKey':_0x242e('0x1f1')});db['WhatsappMessage']['belongsTo'](db[_0x242e('0x100')],{'as':_0x242e('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0x242e('0x106')][_0x242e('0x14d')](db[_0x242e('0x100')],{});db['WhatsappQueueReport'][_0x242e('0x14d')](db[_0x242e('0xf7')],{'as':_0x242e('0x167'),'foreignKey':_0x242e('0x168')});db[_0x242e('0x106')][_0x242e('0x14d')](db[_0x242e('0x73')],{'as':_0x242e('0x15b'),'foreignKey':'ContactId'});db['WhatsappQueueReport']['belongsTo'](db[_0x242e('0x121')],{});db[_0x242e('0x106')][_0x242e('0x14d')](db[_0x242e('0x10a')],{});db[_0x242e('0x106')][_0x242e('0x14d')](db[_0x242e('0x104')],{});db['WhatsappQueueReport'][_0x242e('0x14d')](db[_0x242e('0x13')],{});db[_0x242e('0x108')][_0x242e('0x14d')](db['WhatsappMessage'],{});db[_0x242e('0x108')][_0x242e('0x14d')](db[_0x242e('0x121')],{});db['WhatsappTransferReport'][_0x242e('0x14d')](db[_0x242e('0x100')],{'foreignKey':_0x242e('0x1f2'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x242e('0x14d')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x242e('0x1e4')});db['WhatsappTransferReport'][_0x242e('0x14d')](db['WhatsappQueue'],{'foreignKey':_0x242e('0x1f3'),'as':_0x242e('0x1e2')});db[_0x242e('0x108')]['belongsTo'](db[_0x242e('0x13')],{'foreignKey':_0x242e('0x1de'),'as':_0x242e('0x1df')});db[_0x242e('0x108')][_0x242e('0x14d')](db['User'],{'foreignKey':_0x242e('0x1e0'),'as':_0x242e('0x1e6')});db[_0x242e('0x10a')]['belongsToMany'](db[_0x242e('0x13')],{'as':_0x242e('0x17d'),'through':_0x242e('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x242e('0x10a')][_0x242e('0x125')](db[_0x242e('0xe4')],{'through':_0x242e('0x1d7'),'as':_0x242e('0x154')});db[_0x242e('0x112')][_0x242e('0x14d')](db['User'],{'as':'user','foreignKey':_0x242e('0x117'),'onDelete':_0x242e('0x11a'),'hooks':!![]});db[_0x242e('0x10b')][_0x242e('0x113')](db[_0x242e('0x3c')],{'as':'Imap','onDelete':_0x242e('0x15f')});db['CloudProvider'][_0x242e('0x113')](db['MailServerOut'],{'as':_0x242e('0x161'),'onDelete':'restrict'});module[_0x242e('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xe1e4=['VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','SquareProjects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceQueueReport','QueueCalls','VoiceCallReport','AgentReports','uniqueid','Contact','CloudProvider','restrict','Imap','Smtp','Dispositions','MailAccountId','Answers','Interactions','Applications','List','ListId','TemplateId','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','MailQueueReport','ContactId','DashboardItem','Items','FaxAccountId','user_has_fax_accounts','TagId','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','Contacts','CmHopper','Hoppers','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','CustomReportId','Fields','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','Descriptions','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FromId','ToId','SessionId','SmsQueueReport','ProjectId','user_has_square_projects','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileResource','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','user_has_whatsapp_accounts','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8','utf8_general_ci','sequelizeHistory','mysql','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','hasOne','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions'];(function(_0xbadf15,_0x3135ec){var _0x3797c4=function(_0x4a5142){while(--_0x4a5142){_0xbadf15['push'](_0xbadf15['shift']());}};_0x3797c4(++_0x3135ec);}(_0xe1e4,0xd6));var _0x4e1e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe1e4[_0x2dadb9];return _0x2f0097;};'use strict';var config=require(_0x4e1e('0x0'));var Sequelize=require(_0x4e1e('0x1'));var _=require(_0x4e1e('0x2'));var jstz=require(_0x4e1e('0x3'));var timezone=jstz[_0x4e1e('0x4')]();config['sequelize']=_[_0x4e1e('0x5')](config[_0x4e1e('0x1')],{'database':_0x4e1e('0x6'),'username':_0x4e1e('0x7'),'password':_0x4e1e('0x8'),'options':{'host':_0x4e1e('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4e1e('0xa'),'collate':_0x4e1e('0xb')}}});config[_0x4e1e('0xc')]=_['defaultsDeep'](config[_0x4e1e('0xc')],{'database':_0x4e1e('0x6'),'username':_0x4e1e('0x7'),'password':_0x4e1e('0x8'),'options':{'host':_0x4e1e('0x9'),'port':0xcea,'dialect':_0x4e1e('0xd'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4e1e('0xa'),'collate':_0x4e1e('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4e1e('0xe')],config[_0x4e1e('0x1')][_0x4e1e('0xf')],config[_0x4e1e('0x1')][_0x4e1e('0x10')],config[_0x4e1e('0x1')][_0x4e1e('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4e1e('0xc')][_0x4e1e('0xe')],config[_0x4e1e('0xc')]['username'],config[_0x4e1e('0xc')][_0x4e1e('0x10')],config[_0x4e1e('0xc')][_0x4e1e('0x11')])};db[_0x4e1e('0x12')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x14'));db[_0x4e1e('0x15')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x16'));db['VoiceContext']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x17'));db[_0x4e1e('0x18')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x19'));db[_0x4e1e('0x1a')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x4e1e('0x1b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x1c'));db[_0x4e1e('0x1d')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x4e1e('0x1e')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x1f'));db[_0x4e1e('0x20')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voiceMail/voiceMail.model');db[_0x4e1e('0x21')]=db['sequelize'][_0x4e1e('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x4e1e('0x1')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x4e1e('0x22')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x23'));db[_0x4e1e('0x24')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x4e1e('0x25')]=db['sequelize'][_0x4e1e('0x13')]('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize']['import'](_0x4e1e('0x26'));db[_0x4e1e('0x27')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x28'));db[_0x4e1e('0x29')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4e1e('0x2a')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x2b'));db[_0x4e1e('0x2c')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x2d'));db[_0x4e1e('0x2e')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x4e1e('0x2f')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x30'));db[_0x4e1e('0x31')]=db[_0x4e1e('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x4e1e('0x32')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4e1e('0x33')]=db['sequelize']['import'](_0x4e1e('0x34'));db[_0x4e1e('0x35')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x36'));db[_0x4e1e('0x37')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x38'));db[_0x4e1e('0x39')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x3a'));db[_0x4e1e('0x3b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x3c'));db[_0x4e1e('0x3d')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x3e'));db[_0x4e1e('0x3f')]=db['sequelize']['import'](_0x4e1e('0x40'));db[_0x4e1e('0x41')]=db[_0x4e1e('0x1')]['import']('../api/mailMessage/mailMessage.model');db[_0x4e1e('0x42')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x43'));db['MailQueueReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4e1e('0x44')]=db[_0x4e1e('0x1')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x45'));db[_0x4e1e('0x46')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x47'));db[_0x4e1e('0x48')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x49'));db[_0x4e1e('0x4a')]=db[_0x4e1e('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x4e1e('0x4b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x4c'));db['FaxQueue']=db[_0x4e1e('0x1')]['import']('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x4d'));db['SmsAccount']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/smsAccount/smsAccount.model');db[_0x4e1e('0x4e')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x4f'));db[_0x4e1e('0x50')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x51'));db[_0x4e1e('0x52')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x53'));db['SmsQueue']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x54'));db[_0x4e1e('0x55')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x56'));db[_0x4e1e('0x57')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x4e1e('0x58')]=db[_0x4e1e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x4e1e('0x59')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x5a'));db['ChatWebsite']=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x5b'));db[_0x4e1e('0x5c')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x5d'));db[_0x4e1e('0x5e')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x4e1e('0x5f')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x60'));db['ChatOfflineMessage']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x61'));db['ChatQueue']=db['sequelize'][_0x4e1e('0x13')]('../api/chatQueue/chatQueue.model');db[_0x4e1e('0x62')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x63'));db[_0x4e1e('0x64')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x65'));db[_0x4e1e('0x66')]=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0x4e1e('0x67')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize'][_0x4e1e('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x68'));db[_0x4e1e('0x69')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x6a'));db[_0x4e1e('0x6b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x6c'));db['ReportAgentPreview']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x6d'));db[_0x4e1e('0x6e')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x6f'));db[_0x4e1e('0x70')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x71'));db['Automation']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x72'));db[_0x4e1e('0x73')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x4e1e('0x74')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x75'));db[_0x4e1e('0x76')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x77'));db[_0x4e1e('0x78')]=db['sequelize'][_0x4e1e('0x13')]('../api/interval/interval.model');db[_0x4e1e('0x79')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x7a'));db[_0x4e1e('0x7b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x7c'));db[_0x4e1e('0x7d')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x7e'));db[_0x4e1e('0x7f')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x80'));db[_0x4e1e('0x81')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x82'));db[_0x4e1e('0x83')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x84'));db[_0x4e1e('0x85')]=db[_0x4e1e('0x1')]['import']('../api/template/template.model');db[_0x4e1e('0x86')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/trigger/trigger.model');db['Variable']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x87'));db[_0x4e1e('0x88')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x89'));db[_0x4e1e('0x8a')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x8b'));db[_0x4e1e('0x8c')]=db[_0x4e1e('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4e1e('0x8d')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x8e'));db['AnalyticExtractedReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x8f'));db[_0x4e1e('0x90')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x91'));db[_0x4e1e('0x92')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0x93'));db[_0x4e1e('0x94')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x95'));db['SalesforceConfiguration']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x96'));db[_0x4e1e('0x97')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x4e1e('0x98')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x4e1e('0x99')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x9a'));db[_0x4e1e('0x9b')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x4e1e('0x9c')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0x9d'));db['DeskConfiguration']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x9e'));db['DeskField']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x9f'));db['ZohoAccount']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xa0'));db[_0x4e1e('0xa1')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x4e1e('0xa2')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xa3'));db[_0x4e1e('0xa4')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4e1e('0xa5')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xa6'));db[_0x4e1e('0xa7')]=db['sequelize']['import'](_0x4e1e('0xa8'));db[_0x4e1e('0xa9')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xaa'));db['FreshdeskConfiguration']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xab'));db[_0x4e1e('0xac')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xad'));db[_0x4e1e('0xae')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xaf'));db[_0x4e1e('0xb0')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x4e1e('0xb1')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xb2'));db[_0x4e1e('0xb3')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x4e1e('0xb4')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xb5'));db[_0x4e1e('0xb6')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xb7'));db[_0x4e1e('0xb8')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x4e1e('0xb9')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xba'));db[_0x4e1e('0xbb')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xbc'));db[_0x4e1e('0xbd')]=db[_0x4e1e('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x4e1e('0xbe')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xbf'));db[_0x4e1e('0xc0')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xc1'));db[_0x4e1e('0x88')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0x89'));db[_0x4e1e('0xc2')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xc3'));db[_0x4e1e('0xc4')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xc5'));db[_0x4e1e('0xc6')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xc7'));db[_0x4e1e('0xc8')]=db['sequelize'][_0x4e1e('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4e1e('0xc9')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xca'));db[_0x4e1e('0xcb')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xcc'));db['SmsQueueReport']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xcd'));db[_0x4e1e('0xce')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xcf'));db['SquareDetailsReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xd0'));db[_0x4e1e('0xd1')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xd2'));db[_0x4e1e('0xd3')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xd4'));db[_0x4e1e('0xd5')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xd6'));db[_0x4e1e('0xd7')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/squareProject/squareProject.model');db[_0x4e1e('0xd8')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/squareRecording/squareRecording.model');db[_0x4e1e('0xd9')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xda'));db[_0x4e1e('0xdb')]=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xdc'));db[_0x4e1e('0xdd')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xde'));db[_0x4e1e('0xdf')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xe0'));db[_0x4e1e('0xe1')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xe2'));db[_0x4e1e('0xe3')]=db[_0x4e1e('0x1')]['import']('../api/attachment/attachment.model');db['Plugin']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xe4'));db[_0x4e1e('0xe5')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xe6'));db['ChatTransferReport']=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xe7'));db[_0x4e1e('0xe8')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xe9'));db[_0x4e1e('0xea')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xeb'));db[_0x4e1e('0xec')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xed'));db[_0x4e1e('0xee')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xef'));db[_0x4e1e('0xf0')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x4e1e('0xf1')]=db['sequelize'][_0x4e1e('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize'][_0x4e1e('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x4e1e('0x1')]['import'](_0x4e1e('0xf2'));db['UserNotification']=db[_0x4e1e('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x4e1e('0xf3')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xf4'));db['WhatsappApplication']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xf5'));db['WhatsappInteraction']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xf6'));db['WhatsappQueueReport']=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xf7'));db['WhatsappTransferReport']=db['sequelize'][_0x4e1e('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x4e1e('0xf8')]=db['sequelize'][_0x4e1e('0x13')](_0x4e1e('0xf9'));db['CloudProvider']=db[_0x4e1e('0x1')][_0x4e1e('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x4e1e('0xfa')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xfb'));db[_0x4e1e('0xfc')]=db[_0x4e1e('0x1')][_0x4e1e('0x13')](_0x4e1e('0xfd'));db[_0x4e1e('0xfe')]=db[_0x4e1e('0x1')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x4e1e('0xff')]=db['sequelize']['import']('../api/user-setting/user-setting.model');db[_0x4e1e('0x12')][_0x4e1e('0x100')](db[_0x4e1e('0x20')],{'as':_0x4e1e('0x20'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')][_0x4e1e('0x100')](db[_0x4e1e('0xff')],{'as':'userSetting','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x1d')],{'as':_0x4e1e('0x104'),'foreignKey':'UserId'});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x29')],{'as':'VoiceQueuesRt','foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x18')],{'as':_0x4e1e('0x105'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db['User'][_0x4e1e('0x103')](db[_0x4e1e('0x69')],{'as':_0x4e1e('0x106'),'foreignKey':'UserId'});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x6b')],{'as':'HopperHistory','foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')]['hasMany'](db[_0x4e1e('0x107')],{'as':_0x4e1e('0x107'),'foreignKey':'UserId'});db[_0x4e1e('0x12')]['hasMany'](db[_0x4e1e('0x108')],{'as':_0x4e1e('0x109'),'foreignKey':'UserId'});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x5e')],{'as':_0x4e1e('0x10a'),'foreignKey':_0x4e1e('0x102')});db['User']['hasMany'](db['SmsInteraction'],{'as':_0x4e1e('0x10b'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x4a')],{'as':_0x4e1e('0x10c'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x3f')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db[_0x4e1e('0x10d')],{'as':_0x4e1e('0x10e'),'foreignKey':'UserId'});db[_0x4e1e('0x12')][_0x4e1e('0x103')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0x4e1e('0x10f')});db[_0x4e1e('0x12')]['belongsTo'](db['UserProfile'],{'as':_0x4e1e('0xf1'),'foreignKey':_0x4e1e('0x110')});db['User'][_0x4e1e('0x111')](db[_0x4e1e('0x62')],{'as':_0x4e1e('0x112'),'through':_0x4e1e('0x113')});db['User'][_0x4e1e('0x111')](db[_0x4e1e('0x67')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x4e1e('0x12')]['belongsToMany'](db['CmList'],{'as':_0x4e1e('0x114'),'through':_0x4e1e('0x115')});db['User']['belongsToMany'](db[_0x4e1e('0xdb')],{'through':_0x4e1e('0x116')});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x3f')],{'as':_0x4e1e('0x117'),'through':'user_has_mail_interactions'});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x5e')],{'as':_0x4e1e('0x10a'),'through':_0x4e1e('0x118')});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x4a')],{'as':_0x4e1e('0x10c'),'through':_0x4e1e('0x119')});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x50')],{'as':_0x4e1e('0x10b'),'through':'user_has_sms_interactions'});db['User']['belongsToMany'](db[_0x4e1e('0x108')],{'as':'OpenchannelInteractions','through':_0x4e1e('0x11a')});db['User'][_0x4e1e('0x111')](db['WhatsappInteraction'],{'as':_0x4e1e('0x10e'),'through':'user_has_whatsapp_interactions'});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db['VoiceQueue'],{'as':_0x4e1e('0x11b'),'through':_0x4e1e('0x2a'),'required':![]});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0xf0')],{'as':_0x4e1e('0x11c'),'through':_0x4e1e('0xfe'),'required':![]});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db['MailQueue'],{'as':_0x4e1e('0x11d'),'through':_0x4e1e('0x2e'),'required':![]});db['User']['belongsToMany'](db[_0x4e1e('0x11e')],{'as':_0x4e1e('0x11f'),'through':_0x4e1e('0x2c'),'required':![],'hooks':!![]});db[_0x4e1e('0x12')]['belongsToMany'](db[_0x4e1e('0x120')],{'as':_0x4e1e('0x121'),'through':_0x4e1e('0x2f'),'required':![]});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x122')],{'as':_0x4e1e('0x123'),'through':_0x4e1e('0x31'),'required':![]});db[_0x4e1e('0x12')]['belongsToMany'](db[_0x4e1e('0x59')],{'as':_0x4e1e('0x124'),'through':_0x4e1e('0x32'),'required':![]});db[_0x4e1e('0x12')]['belongsToMany'](db[_0x4e1e('0xf8')],{'as':'WhatsappQueues','through':_0x4e1e('0x33'),'required':![]});db['User'][_0x4e1e('0x111')](db[_0x4e1e('0xee')],{'through':'cm_user_has_lists'});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x125')],{'as':_0x4e1e('0x126'),'through':_0x4e1e('0x127')});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x46')],{'as':_0x4e1e('0x128'),'through':'user_has_fax_accounts'});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db['MailAccount'],{'as':_0x4e1e('0x129'),'through':_0x4e1e('0x12a')});db['User']['belongsToMany'](db[_0x4e1e('0x55')],{'as':_0x4e1e('0x12b'),'through':_0x4e1e('0x12c')});db[_0x4e1e('0x12')][_0x4e1e('0x111')](db[_0x4e1e('0x12d')],{'as':_0x4e1e('0x12e'),'through':_0x4e1e('0x12f')});db[_0x4e1e('0x12')]['belongsToMany'](db[_0x4e1e('0xf3')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x4e1e('0x12')]['belongsToMany'](db[_0x4e1e('0xd7')],{'as':_0x4e1e('0x130'),'through':'user_has_square_projects'});db[_0x4e1e('0x15')][_0x4e1e('0x103')](db[_0x4e1e('0x18')],{'as':_0x4e1e('0x131'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x132')});db[_0x4e1e('0x133')][_0x4e1e('0x103')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x4e1e('0x18')][_0x4e1e('0x103')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x4e1e('0x1a')]['belongsToMany'](db[_0x4e1e('0x81')],{'as':_0x4e1e('0x134'),'through':_0x4e1e('0x135')});db[_0x4e1e('0x1b')][_0x4e1e('0x103')](db[_0x4e1e('0x29')],{'as':_0x4e1e('0x136'),'foreignKey':_0x4e1e('0x137')});db[_0x4e1e('0x1b')][_0x4e1e('0x103')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4e1e('0x137')});db[_0x4e1e('0x1b')][_0x4e1e('0x103')](db[_0x4e1e('0x69')],{'as':'HopperFinals','foreignKey':_0x4e1e('0x137')});db['VoiceQueue']['hasMany'](db[_0x4e1e('0x6b')],{'as':_0x4e1e('0x138'),'foreignKey':_0x4e1e('0x137')});db['VoiceQueue']['hasMany'](db[_0x4e1e('0x107')],{'as':_0x4e1e('0x107'),'foreignKey':_0x4e1e('0x137')});db[_0x4e1e('0x1b')][_0x4e1e('0x103')](db[_0x4e1e('0x139')],{'as':_0x4e1e('0x13a'),'foreignKey':_0x4e1e('0x137')});db['VoiceQueue'][_0x4e1e('0x103')](db['JscriptySessionReport'],{'as':_0x4e1e('0x13b'),'foreignKey':_0x4e1e('0x137')});db[_0x4e1e('0x1b')][_0x4e1e('0x13c')](db['Trunk'],{'as':_0x4e1e('0x13d'),'foreignKey':_0x4e1e('0x13e')});db['VoiceQueue'][_0x4e1e('0x13c')](db['Trunk'],{'as':_0x4e1e('0x13f'),'foreignKey':_0x4e1e('0x140')});db[_0x4e1e('0x1b')]['belongsTo'](db[_0x4e1e('0x78')],{'as':_0x4e1e('0x78'),'foreignKey':_0x4e1e('0x141')});db['VoiceQueue'][_0x4e1e('0x13c')](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':_0x4e1e('0x143')});db[_0x4e1e('0x1b')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x4e1e('0x144')});db[_0x4e1e('0x1b')]['belongsToMany'](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x2a')});db[_0x4e1e('0x1b')][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'as':_0x4e1e('0x146'),'through':'TeamVoiceQueue'});db[_0x4e1e('0x1b')]['belongsToMany'](db[_0x4e1e('0xee')],{'as':'BlackLists','through':_0x4e1e('0x147')});db['VoiceRecording'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x12'),'foreignKey':_0x4e1e('0x102')});db['ScreenRecording'][_0x4e1e('0x13c')](db['User'],{'as':_0x4e1e('0x12'),'foreignKey':_0x4e1e('0x102')});db['VoiceMail'][_0x4e1e('0x103')](db[_0x4e1e('0x21')],{'as':_0x4e1e('0x148'),'onDelete':'cascade','foreignKey':_0x4e1e('0x149'),'sourceKey':'mailbox'});db[_0x4e1e('0x21')][_0x4e1e('0x13c')](db['VoiceMail'],{'foreignKey':_0x4e1e('0x149'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0x4e1e('0x14a')],{'as':_0x4e1e('0x14b'),'foreignKey':'uniqueid','constraints':![]});db[_0x4e1e('0x14c')][_0x4e1e('0x103')](db['VoiceAgentReport'],{'as':_0x4e1e('0x14d'),'foreignKey':_0x4e1e('0x14e'),'constraints':![]});db[_0x4e1e('0x14c')][_0x4e1e('0x13c')](db['User'],{'as':_0x4e1e('0x12'),'foreignKey':_0x4e1e('0x102')});db['VoiceCallReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':'ContactId'});db[_0x4e1e('0x35')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['MailServerIn']['belongsTo'](db[_0x4e1e('0x150')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x37')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'as':_0x4e1e('0x39'),'foreignKey':'MailAccountId'});db[_0x4e1e('0x37')]['belongsTo'](db[_0x4e1e('0x150')],{'as':_0x4e1e('0x150'),'foreignKey':'CloudProviderId','onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x39')][_0x4e1e('0x100')](db[_0x4e1e('0x35')],{'as':_0x4e1e('0x152'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x39')][_0x4e1e('0x100')](db['MailServerOut'],{'as':_0x4e1e('0x153'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x39')][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':_0x4e1e('0x154'),'foreignKey':_0x4e1e('0x155'),'onDelete':_0x4e1e('0x101')});db['MailAccount'][_0x4e1e('0x103')](db[_0x4e1e('0x73')],{'as':_0x4e1e('0x156'),'foreignKey':_0x4e1e('0x155')});db[_0x4e1e('0x39')]['hasMany'](db['MailMessage'],{'as':_0x4e1e('0x148'),'foreignKey':_0x4e1e('0x155')});db[_0x4e1e('0x39')]['hasMany'](db[_0x4e1e('0x3f')],{'as':_0x4e1e('0x157')});db[_0x4e1e('0x39')]['hasMany'](db[_0x4e1e('0x42')],{'as':_0x4e1e('0x158')});db[_0x4e1e('0x39')][_0x4e1e('0x13c')](db['CmList'],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0x39')]['belongsTo'](db[_0x4e1e('0x85')],{'as':_0x4e1e('0x85'),'foreignKey':_0x4e1e('0x15b')});db['MailAccount'][_0x4e1e('0x13c')](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4e1e('0x39')][_0x4e1e('0x111')](db['User'],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x12a')});db[_0x4e1e('0x3b')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x2e')});db['MailQueue'][_0x4e1e('0x111')](db['Team'],{'through':'team_has_mail_queues','as':_0x4e1e('0x146')});db['MailInteraction'][_0x4e1e('0x103')](db[_0x4e1e('0x41')],{'as':_0x4e1e('0x148'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x15c')});db[_0x4e1e('0x3f')]['belongsTo'](db[_0x4e1e('0x39')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x155')});db[_0x4e1e('0x3f')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':'ContactId'});db[_0x4e1e('0x3f')]['belongsTo'](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x15e'),'foreignKey':_0x4e1e('0x102')});db['MailInteraction'][_0x4e1e('0x111')](db['Tag'],{'through':_0x4e1e('0x15f'),'as':_0x4e1e('0x160')});db[_0x4e1e('0x3f')][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x15f'),'as':_0x4e1e('0x161')});db[_0x4e1e('0x3f')][_0x4e1e('0x111')](db['User'],{'as':_0x4e1e('0x162'),'through':'user_has_mail_interactions','foreignKey':_0x4e1e('0x15c')});db[_0x4e1e('0x41')][_0x4e1e('0x103')](db[_0x4e1e('0xe3')],{'as':_0x4e1e('0x163'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x41')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x12')});db[_0x4e1e('0x41')]['belongsTo'](db[_0x4e1e('0x67')],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x14f')});db[_0x4e1e('0x41')][_0x4e1e('0x13c')](db[_0x4e1e('0x3f')],{'as':_0x4e1e('0x164'),'foreignKey':_0x4e1e('0x15c')});db[_0x4e1e('0x41')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x155')});db[_0x4e1e('0x41')]['belongsTo'](db[_0x4e1e('0x125')],{'as':'ChatWebsite','foreignKey':_0x4e1e('0x165')});db[_0x4e1e('0x41')]['belongsTo'](db[_0x4e1e('0x166')],{'as':_0x4e1e('0x166'),'foreignKey':_0x4e1e('0x167')});db[_0x4e1e('0x42')][_0x4e1e('0x13c')](db['User'],{'onDelete':'restrict'});db['MailApplication'][_0x4e1e('0x13c')](db[_0x4e1e('0x3b')],{'onDelete':'restrict'});db[_0x4e1e('0x42')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'onDelete':_0x4e1e('0x151')});db['MailApplication'][_0x4e1e('0x13c')](db[_0x4e1e('0x78')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x141')});db['MailApplication'][_0x4e1e('0x13c')](db['Tag'],{'onDelete':_0x4e1e('0x151'),'foreignKey':'TagId'});db[_0x4e1e('0x168')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{});db[_0x4e1e('0x168')]['belongsTo'](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':'ListId'});db[_0x4e1e('0x168')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db['MailQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x3f')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db[_0x4e1e('0x168')][_0x4e1e('0x13c')](db['User'],{});db[_0x4e1e('0x168')]['belongsTo'](db[_0x4e1e('0x3b')],{});db[_0x4e1e('0x44')]['hasMany'](db[_0x4e1e('0x16a')],{'as':_0x4e1e('0x16b'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x46')][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':_0x4e1e('0x154'),'foreignKey':_0x4e1e('0x16c'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x46')]['hasMany'](db['CannedAnswer'],{'as':_0x4e1e('0x156'),'foreignKey':'FaxAccountId'});db[_0x4e1e('0x46')][_0x4e1e('0x103')](db[_0x4e1e('0x4a')],{'as':_0x4e1e('0x157')});db[_0x4e1e('0x46')][_0x4e1e('0x103')](db['FaxApplication'],{'as':_0x4e1e('0x158')});db['FaxAccount'][_0x4e1e('0x103')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0x4e1e('0x46')][_0x4e1e('0x103')](db['FaxMessage'],{'as':_0x4e1e('0x148')});db[_0x4e1e('0x46')][_0x4e1e('0x13c')](db['Trunk'],{'as':'Trunk'});db[_0x4e1e('0x46')][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0x46')][_0x4e1e('0x13c')](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':_0x4e1e('0x143')});db[_0x4e1e('0x46')]['belongsToMany'](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x16d')});db['FaxApplication'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x48')][_0x4e1e('0x13c')](db[_0x4e1e('0x120')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x48')][_0x4e1e('0x13c')](db[_0x4e1e('0x46')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x48')][_0x4e1e('0x13c')](db[_0x4e1e('0x83')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x16e')});db[_0x4e1e('0x4a')]['hasMany'](db[_0x4e1e('0x4b')],{'as':'Messages','onDelete':_0x4e1e('0x101'),'foreignKey':'FaxInteractionId'});db[_0x4e1e('0x4a')][_0x4e1e('0x13c')](db[_0x4e1e('0x46')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x16c')});db[_0x4e1e('0x4a')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x4a')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x15e'),'foreignKey':_0x4e1e('0x102')});db['FaxInteraction']['belongsToMany'](db[_0x4e1e('0x83')],{'through':'fax_interaction_has_tags','as':_0x4e1e('0x160')});db[_0x4e1e('0x4a')][_0x4e1e('0x111')](db['Tag'],{'through':_0x4e1e('0x16f'),'as':_0x4e1e('0x161')});db[_0x4e1e('0x4a')][_0x4e1e('0x111')](db['User'],{'as':_0x4e1e('0x162'),'through':_0x4e1e('0x119'),'foreignKey':_0x4e1e('0x170')});db[_0x4e1e('0x4b')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x101'),'as':'User'});db[_0x4e1e('0x4b')][_0x4e1e('0x13c')](db[_0x4e1e('0x4a')],{'as':_0x4e1e('0x164'),'foreignKey':_0x4e1e('0x170')});db[_0x4e1e('0x4b')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'onDelete':'cascade','as':_0x4e1e('0x14f')});db['FaxMessage']['belongsTo'](db[_0x4e1e('0xe3')],{'as':_0x4e1e('0xe3'),'foreignKey':_0x4e1e('0x171')});db[_0x4e1e('0x4b')][_0x4e1e('0x13c')](db[_0x4e1e('0x46')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x16c')});db[_0x4e1e('0x120')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x2f')});db[_0x4e1e('0x120')][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'through':_0x4e1e('0x172'),'as':_0x4e1e('0x146')});db['FaxQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x46')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0x173')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':'ContactId'});db[_0x4e1e('0x173')][_0x4e1e('0x13c')](db[_0x4e1e('0x4a')],{});db[_0x4e1e('0x173')][_0x4e1e('0x13c')](db[_0x4e1e('0x4b')],{});db[_0x4e1e('0x173')]['belongsTo'](db[_0x4e1e('0x12')],{});db[_0x4e1e('0x173')]['belongsTo'](db['FaxQueue'],{});db[_0x4e1e('0x12d')][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x4e1e('0x101')});db['SmsAccount'][_0x4e1e('0x103')](db[_0x4e1e('0x73')],{'as':'Answers','foreignKey':_0x4e1e('0x174')});db[_0x4e1e('0x12d')][_0x4e1e('0x103')](db[_0x4e1e('0x52')],{'as':_0x4e1e('0x148'),'foreignKey':_0x4e1e('0x174')});db[_0x4e1e('0x12d')][_0x4e1e('0x103')](db[_0x4e1e('0x50')],{'as':'Interactions'});db['SmsAccount'][_0x4e1e('0x103')](db['SmsApplication'],{'as':_0x4e1e('0x158')});db['SmsAccount'][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0x12d')][_0x4e1e('0x13c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x4e1e('0x143')});db[_0x4e1e('0x12d')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x4e1e('0x13c')](db['User'],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x4e')][_0x4e1e('0x13c')](db['SmsQueue'],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x4e')][_0x4e1e('0x13c')](db[_0x4e1e('0x12d')],{'onDelete':_0x4e1e('0x151')});db['SmsApplication']['belongsTo'](db['Interval'],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x141')});db['SmsApplication']['belongsTo'](db[_0x4e1e('0x83')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x16e')});db[_0x4e1e('0x50')]['hasMany'](db[_0x4e1e('0x52')],{'as':_0x4e1e('0x148'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x175')});db[_0x4e1e('0x50')][_0x4e1e('0x13c')](db[_0x4e1e('0x12d')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x4e1e('0x50')][_0x4e1e('0x13c')](db['CmContact'],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x50')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':'Owner','foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x50')][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x4e1e('0x50')][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x176'),'as':'ThroughTags'});db[_0x4e1e('0x50')]['belongsToMany'](db['User'],{'as':_0x4e1e('0x162'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':'User'});db[_0x4e1e('0x52')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x14f')});db[_0x4e1e('0x52')][_0x4e1e('0x13c')](db[_0x4e1e('0x50')],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x164'),'foreignKey':'SmsInteractionId'});db[_0x4e1e('0x52')][_0x4e1e('0x13c')](db[_0x4e1e('0x12d')],{'as':'Account','foreignKey':_0x4e1e('0x174')});db[_0x4e1e('0x122')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x4e1e('0x177')});db[_0x4e1e('0x122')][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x4e1e('0x55')][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':_0x4e1e('0x154'),'foreignKey':_0x4e1e('0x178'),'onDelete':_0x4e1e('0x101')});db['OpenchannelAccount']['hasMany'](db[_0x4e1e('0x73')],{'as':_0x4e1e('0x156'),'foreignKey':_0x4e1e('0x178')});db[_0x4e1e('0x55')][_0x4e1e('0x103')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x4e1e('0x178')});db[_0x4e1e('0x55')]['hasMany'](db[_0x4e1e('0x58')],{'as':_0x4e1e('0x148'),'foreignKey':_0x4e1e('0x178')});db[_0x4e1e('0x55')][_0x4e1e('0x103')](db[_0x4e1e('0x57')],{'as':_0x4e1e('0x158'),'foreignKey':_0x4e1e('0x178')});db['OpenchannelAccount'][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':'List','foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0x55')][_0x4e1e('0x13c')](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x12c')});db['OpenchannelApplication']['belongsTo'](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x57')][_0x4e1e('0x13c')](db[_0x4e1e('0x59')],{'onDelete':'restrict','foreignKey':_0x4e1e('0x179')});db[_0x4e1e('0x57')][_0x4e1e('0x13c')](db[_0x4e1e('0x55')],{'onDelete':'restrict','foreignKey':_0x4e1e('0x178')});db[_0x4e1e('0x57')]['belongsTo'](db[_0x4e1e('0x78')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x141')});db[_0x4e1e('0x57')]['belongsTo'](db[_0x4e1e('0x83')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x16e')});db['OpenchannelInteraction']['hasMany'](db[_0x4e1e('0x58')],{'as':_0x4e1e('0x148'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x17a')});db[_0x4e1e('0x108')][_0x4e1e('0x13c')](db[_0x4e1e('0x55')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x178')});db[_0x4e1e('0x108')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':'ContactId'});db[_0x4e1e('0x108')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x108')][_0x4e1e('0x111')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x4e1e('0x160')});db[_0x4e1e('0x108')]['belongsToMany'](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x17b'),'as':_0x4e1e('0x161')});db[_0x4e1e('0x108')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x162'),'through':_0x4e1e('0x11a'),'foreignKey':_0x4e1e('0x17a')});db[_0x4e1e('0x58')]['belongsTo'](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x12')});db[_0x4e1e('0x58')][_0x4e1e('0x13c')](db['CmContact'],{'onDelete':_0x4e1e('0x101'),'as':'Contact'});db[_0x4e1e('0x58')][_0x4e1e('0x13c')](db[_0x4e1e('0x108')],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x164'),'foreignKey':_0x4e1e('0x17a')});db[_0x4e1e('0x58')][_0x4e1e('0x13c')](db[_0x4e1e('0xe3')],{'as':_0x4e1e('0xe3'),'foreignKey':'AttachmentId'});db[_0x4e1e('0x58')][_0x4e1e('0x13c')](db[_0x4e1e('0x55')],{'as':'Account','foreignKey':_0x4e1e('0x178')});db['OpenchannelQueue'][_0x4e1e('0x111')](db['User'],{'as':_0x4e1e('0x145'),'through':'UserOpenchannelQueue','foreignKey':_0x4e1e('0x179')});db[_0x4e1e('0x59')][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'through':_0x4e1e('0x17c'),'as':_0x4e1e('0x146')});db[_0x4e1e('0x125')][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':'Dispositions','foreignKey':_0x4e1e('0x165'),'onDelete':'cascade'});db['ChatWebsite'][_0x4e1e('0x103')](db['CannedAnswer'],{'as':_0x4e1e('0x156'),'foreignKey':_0x4e1e('0x165')});db[_0x4e1e('0x125')]['hasMany'](db[_0x4e1e('0x64')],{'as':_0x4e1e('0x17d')});db['ChatWebsite'][_0x4e1e('0x103')](db[_0x4e1e('0x5e')],{'as':'Interactions'});db[_0x4e1e('0x125')][_0x4e1e('0x103')](db['ChatApplication'],{'as':'Applications'});db[_0x4e1e('0x125')][_0x4e1e('0x103')](db[_0x4e1e('0x5f')],{'as':'Messages'});db[_0x4e1e('0x125')][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':'ListId'});db[_0x4e1e('0x125')]['belongsTo'](db[_0x4e1e('0x78')],{'as':'Interval','foreignKey':_0x4e1e('0x141')});db['ChatWebsite'][_0x4e1e('0x13c')](db['MailAccount'],{'as':_0x4e1e('0x39'),'foreignKey':_0x4e1e('0x155')});db[_0x4e1e('0x125')][_0x4e1e('0x13c')](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':_0x4e1e('0x143')});db['ChatWebsite'][_0x4e1e('0x111')](db['User'],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x127')});db[_0x4e1e('0x17e')][_0x4e1e('0x13c')](db[_0x4e1e('0x55')],{});db[_0x4e1e('0x17e')]['belongsTo'](db[_0x4e1e('0xee')],{'as':'List','foreignKey':'ListId'});db[_0x4e1e('0x17e')][_0x4e1e('0x13c')](db['CmContact'],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x17e')][_0x4e1e('0x13c')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x58')],{});db[_0x4e1e('0x17e')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{});db[_0x4e1e('0x17e')]['belongsTo'](db[_0x4e1e('0x59')],{});db[_0x4e1e('0x5c')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x17f'),'foreignKey':_0x4e1e('0x102'),'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x5c')][_0x4e1e('0x13c')](db[_0x4e1e('0x11e')],{'as':_0x4e1e('0x180'),'foreignKey':_0x4e1e('0x181'),'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x5c')][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'as':'Website','foreignKey':_0x4e1e('0x165'),'onDelete':_0x4e1e('0x151')});db['ChatApplication'][_0x4e1e('0x13c')](db[_0x4e1e('0x83')],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x16e')});db[_0x4e1e('0x5e')][_0x4e1e('0x103')](db['ChatMessage'],{'as':'Messages','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x182')});db[_0x4e1e('0x5e')][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x165')});db[_0x4e1e('0x5e')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':'Contact','foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x5e')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x15e'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x5e')]['belongsToMany'](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x183'),'as':_0x4e1e('0x160')});db[_0x4e1e('0x5e')]['belongsToMany'](db[_0x4e1e('0x83')],{'through':'chat_interaction_has_tags','as':_0x4e1e('0x161')});db['ChatInteraction'][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x162'),'through':_0x4e1e('0x118'),'foreignKey':'ChatInteractionId'});db[_0x4e1e('0x5f')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'onDelete':'cascade','as':_0x4e1e('0x12')});db[_0x4e1e('0x5f')][_0x4e1e('0x13c')](db['CmContact'],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x5f')][_0x4e1e('0x13c')](db[_0x4e1e('0x5e')],{'onDelete':'cascade','as':_0x4e1e('0x164'),'foreignKey':_0x4e1e('0x182')});db[_0x4e1e('0x5f')][_0x4e1e('0x13c')](db[_0x4e1e('0xe3')],{'as':'Attachment','foreignKey':_0x4e1e('0x171')});db[_0x4e1e('0x5f')]['belongsTo'](db[_0x4e1e('0x125')],{'as':_0x4e1e('0x15d'),'foreignKey':'ChatWebsiteId'});db[_0x4e1e('0x166')][_0x4e1e('0x103')](db[_0x4e1e('0xe3')],{'as':_0x4e1e('0x163'),'foreignKey':_0x4e1e('0x167'),'onDelete':'cascade','hooks':!![]});db[_0x4e1e('0x166')]['belongsTo'](db[_0x4e1e('0x67')],{'onDelete':_0x4e1e('0x101'),'as':'Contact','foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x166')][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x165')});db[_0x4e1e('0x11e')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'through':_0x4e1e('0x184'),'as':_0x4e1e('0x146')});db[_0x4e1e('0x62')][_0x4e1e('0x103')](db[_0x4e1e('0xc6')],{'as':_0x4e1e('0x148'),'foreignKey':_0x4e1e('0x185'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x62')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x136'),'through':_0x4e1e('0x113')});db['ChatProactiveAction'][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'as':_0x4e1e('0x186'),'foreignKey':_0x4e1e('0x165')});db[_0x4e1e('0x66')][_0x4e1e('0x103')](db['CmContact'],{'as':_0x4e1e('0x187'),'foreignKey':'CompanyId'});db[_0x4e1e('0x67')][_0x4e1e('0x103')](db[_0x4e1e('0x188')],{'as':_0x4e1e('0x189'),'foreignKey':'ContactId'});db[_0x4e1e('0x67')]['hasMany'](db[_0x4e1e('0x69')],{'as':_0x4e1e('0x106'),'foreignKey':_0x4e1e('0x169')});db['CmContact'][_0x4e1e('0x103')](db[_0x4e1e('0x6b')],{'as':_0x4e1e('0x138'),'foreignKey':'ContactId'});db[_0x4e1e('0x67')]['hasMany'](db[_0x4e1e('0x107')],{'as':_0x4e1e('0x107'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x67')][_0x4e1e('0x103')](db[_0x4e1e('0xcb')],{'as':_0x4e1e('0x13b'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x67')][_0x4e1e('0x103')](db[_0x4e1e('0x108')],{'as':_0x4e1e('0x109'),'foreignKey':_0x4e1e('0x169'),'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x67')][_0x4e1e('0x103')](db[_0x4e1e('0x5e')],{'as':_0x4e1e('0x10a'),'foreignKey':'ContactId','onDelete':_0x4e1e('0x151')});db['CmContact'][_0x4e1e('0x103')](db[_0x4e1e('0x50')],{'as':_0x4e1e('0x10b'),'foreignKey':_0x4e1e('0x169'),'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x67')][_0x4e1e('0x103')](db[_0x4e1e('0x4a')],{'as':_0x4e1e('0x10c'),'foreignKey':_0x4e1e('0x169'),'onDelete':_0x4e1e('0x151')});db['CmContact'][_0x4e1e('0x103')](db['MailInteraction'],{'as':_0x4e1e('0x117'),'foreignKey':_0x4e1e('0x169'),'onDelete':'restrict'});db[_0x4e1e('0x67')][_0x4e1e('0x13c')](db[_0x4e1e('0x66')],{'as':_0x4e1e('0x18a'),'foreignKey':_0x4e1e('0x18b')});db[_0x4e1e('0x67')][_0x4e1e('0x13c')](db['CmList'],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a'),'onDelete':_0x4e1e('0x101')});db['CmContact'][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':'Users','through':_0x4e1e('0x18c')});db['CmContact'][_0x4e1e('0x111')](db['Tag'],{'as':_0x4e1e('0x160'),'through':_0x4e1e('0x18d')});db[_0x4e1e('0x67')]['belongsToMany'](db['Tag'],{'through':_0x4e1e('0x18d'),'as':_0x4e1e('0x161')});db['CmHopper'][_0x4e1e('0x13c')](db['CmContact'],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x188')][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x188')]['belongsTo'](db['User'],{'as':_0x4e1e('0x17f'),'foreignKey':_0x4e1e('0x102')});db[_0x4e1e('0x188')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b')],{'as':_0x4e1e('0x180'),'foreignKey':_0x4e1e('0x137'),'onDelete':'cascade'});db[_0x4e1e('0x188')][_0x4e1e('0x13c')](db[_0x4e1e('0xdf')],{'as':'Campaign','foreignKey':_0x4e1e('0x18e'),'onDelete':'cascade'});db[_0x4e1e('0x188')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x15e'),'foreignKey':_0x4e1e('0x18f')});db[_0x4e1e('0x139')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0x4e1e('0x139')][_0x4e1e('0x13c')](db['CmList'],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x139')]['belongsTo'](db[_0x4e1e('0x1b')],{'as':'Queue','foreignKey':_0x4e1e('0x137'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x139')][_0x4e1e('0x13c')](db['Campaign'],{'as':'Campaign','foreignKey':_0x4e1e('0x18e'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x190')][_0x4e1e('0x103')](db[_0x4e1e('0x76')],{'as':{'plural':_0x4e1e('0x191'),'singular':_0x4e1e('0x192')},'foreignKey':_0x4e1e('0x193'),'onDelete':'cascade','hooks':!![]});db[_0x4e1e('0x190')][_0x4e1e('0x103')](db[_0x4e1e('0x76')],{'as':{'plural':_0x4e1e('0x194'),'singular':_0x4e1e('0x195')},'foreignKey':_0x4e1e('0x196'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db['Automation'][_0x4e1e('0x103')](db[_0x4e1e('0x70')],{'as':'Actions','foreignKey':_0x4e1e('0x197'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db['Disposition']['hasMany'](db[_0x4e1e('0x74')],{'as':_0x4e1e('0x154'),'foreignKey':_0x4e1e('0x198'),'onDelete':'cascade'});db[_0x4e1e('0x78')]['hasMany'](db[_0x4e1e('0x78')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x4e1e('0x101'),'hooks':!![],'required':![]});db[_0x4e1e('0x78')][_0x4e1e('0x103')](db[_0x4e1e('0x18')],{'as':_0x4e1e('0x105'),'foreignKey':'IntervalId','onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x78')][_0x4e1e('0x103')](db['MailApplication'],{'as':_0x4e1e('0x199'),'foreignKey':_0x4e1e('0x141')});db[_0x4e1e('0x78')][_0x4e1e('0x103')](db[_0x4e1e('0x5c')],{'as':_0x4e1e('0x19a'),'foreignKey':'IntervalId'});db['Interval'][_0x4e1e('0x103')](db['FaxApplication'],{'as':_0x4e1e('0x19b'),'foreignKey':'IntervalId'});db[_0x4e1e('0x78')][_0x4e1e('0x103')](db[_0x4e1e('0x4e')],{'as':_0x4e1e('0x19c'),'foreignKey':_0x4e1e('0x141')});db[_0x4e1e('0x7f')][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{});db[_0x4e1e('0x7f')][_0x4e1e('0x13c')](db[_0x4e1e('0x8d')],{'foreignKey':_0x4e1e('0x19d')});db[_0x4e1e('0x7f')]['belongsTo'](db[_0x4e1e('0x8c')],{'foreignKey':'CustomReportId'});db[_0x4e1e('0x81')][_0x4e1e('0x111')](db[_0x4e1e('0x1a')],{'as':_0x4e1e('0x19e'),'through':_0x4e1e('0x135'),'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x83')][_0x4e1e('0x111')](db[_0x4e1e('0x67')],{'through':_0x4e1e('0x18d')});db[_0x4e1e('0x83')][_0x4e1e('0x111')](db[_0x4e1e('0x5e')],{'through':_0x4e1e('0x183')});db[_0x4e1e('0x83')][_0x4e1e('0x111')](db[_0x4e1e('0x3f')],{'through':_0x4e1e('0x15f')});db['Tag']['belongsToMany'](db[_0x4e1e('0x50')],{'through':_0x4e1e('0x176')});db[_0x4e1e('0x83')][_0x4e1e('0x111')](db['FaxInteraction'],{'through':_0x4e1e('0x16f')});db[_0x4e1e('0x83')]['belongsToMany'](db[_0x4e1e('0x108')],{'through':_0x4e1e('0x17b')});db['Tag'][_0x4e1e('0x111')](db[_0x4e1e('0x10d')],{'through':_0x4e1e('0x19f')});db['Trigger']['hasMany'](db[_0x4e1e('0x76')],{'as':{'plural':_0x4e1e('0x1a0'),'singular':_0x4e1e('0x1a1')},'foreignKey':_0x4e1e('0x1a2'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db[_0x4e1e('0x86')][_0x4e1e('0x103')](db[_0x4e1e('0x76')],{'as':{'plural':_0x4e1e('0x1a3'),'singular':_0x4e1e('0x1a4')},'foreignKey':_0x4e1e('0x1a5'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db['Trigger'][_0x4e1e('0x103')](db[_0x4e1e('0x70')],{'as':'Actions','foreignKey':_0x4e1e('0x1a6'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db['AnalyticCustomReport'][_0x4e1e('0x103')](db[_0x4e1e('0x92')],{'as':'Fields','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1a7'),'hooks':!![]});db[_0x4e1e('0x8d')][_0x4e1e('0x103')](db[_0x4e1e('0x92')],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':'DefaultReportId'});db[_0x4e1e('0x90')][_0x4e1e('0x103')](db['AnalyticFieldReport'],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':'MetricId'});db[_0x4e1e('0x92')][_0x4e1e('0x13c')](db[_0x4e1e('0x90')],{'foreignKey':_0x4e1e('0x1a9')});db['SalesforceAccount'][_0x4e1e('0x103')](db['SalesforceConfiguration'],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':'AccountId'});db[_0x4e1e('0x1ab')][_0x4e1e('0x103')](db[_0x4e1e('0x97')],{'as':_0x4e1e('0x1ac'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0x1ab')][_0x4e1e('0x103')](db[_0x4e1e('0x97')],{'as':'Descriptions','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0x1ab')]['hasMany'](db[_0x4e1e('0x97')],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x1ab')]['belongsTo'](db['SalesforceAccount'],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0x97')][_0x4e1e('0x103')](db['SalesforceField'],{'as':_0x4e1e('0x1b1'),'foreignKey':'SubjectId'});db[_0x4e1e('0x97')][_0x4e1e('0x103')](db[_0x4e1e('0x97')],{'as':_0x4e1e('0x1b2'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0x97')][_0x4e1e('0x103')](db[_0x4e1e('0x97')],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x97')][_0x4e1e('0x13c')](db['Variable'],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db[_0x4e1e('0x98')][_0x4e1e('0x103')](db[_0x4e1e('0x99')],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db['SugarcrmConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0x9b')],{'as':_0x4e1e('0x1ac'),'onDelete':_0x4e1e('0x101'),'foreignKey':'SubjectId'});db[_0x4e1e('0x99')][_0x4e1e('0x103')](db['SugarcrmField'],{'as':_0x4e1e('0x1b6'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db['SugarcrmConfiguration'][_0x4e1e('0x103')](db['SugarcrmField'],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x99')][_0x4e1e('0x13c')](db[_0x4e1e('0x98')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db['SugarcrmField'][_0x4e1e('0x103')](db[_0x4e1e('0x9b')],{'as':'Subject','foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0x9b')]['hasMany'](db[_0x4e1e('0x9b')],{'as':_0x4e1e('0x1b2'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0x9b')][_0x4e1e('0x103')](db[_0x4e1e('0x9b')],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x9b')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db['DeskAccount']['hasMany'](db[_0x4e1e('0x1b7')],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db['DeskConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0x1b8')],{'as':_0x4e1e('0x1ac'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ad')});db['DeskConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0x1b8')],{'as':_0x4e1e('0x1b6'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0x1b7')][_0x4e1e('0x103')](db[_0x4e1e('0x1b8')],{'as':'Fields','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x1b7')][_0x4e1e('0x13c')](db['DeskAccount'],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0x1b7')][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x1b9')});db[_0x4e1e('0x1b8')]['hasMany'](db[_0x4e1e('0x1b8')],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0x1b8')][_0x4e1e('0x103')](db[_0x4e1e('0x1b8')],{'as':'Description','foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0x1b8')][_0x4e1e('0x103')](db[_0x4e1e('0x1b8')],{'as':'Field','foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x1b8')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db['ZohoAccount'][_0x4e1e('0x103')](db['ZohoConfiguration'],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xa1')][_0x4e1e('0x103')](db[_0x4e1e('0xa2')],{'as':_0x4e1e('0x1ac'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xa1')]['hasMany'](db[_0x4e1e('0xa2')],{'as':_0x4e1e('0x1b6'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xa1')]['hasMany'](db['ZohoField'],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xa1')][_0x4e1e('0x13c')](db[_0x4e1e('0x1ba')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xa2')]['hasMany'](db[_0x4e1e('0xa2')],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xa2')][_0x4e1e('0x103')](db[_0x4e1e('0xa2')],{'as':_0x4e1e('0x1b2'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xa2')][_0x4e1e('0x103')](db[_0x4e1e('0xa2')],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db['ZohoField'][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db[_0x4e1e('0xa4')][_0x4e1e('0x103')](db[_0x4e1e('0xa5')],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db['ZendeskConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0xa7')],{'as':_0x4e1e('0x1ac'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xa5')]['hasMany'](db['ZendeskField'],{'as':_0x4e1e('0x1b6'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xa5')][_0x4e1e('0x103')](db[_0x4e1e('0xa7')],{'as':_0x4e1e('0x1a8'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xa5')]['belongsTo'](db[_0x4e1e('0xa4')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xa5')][_0x4e1e('0x111')](db['Tag'],{'through':_0x4e1e('0x1bb')});db[_0x4e1e('0xa7')]['hasMany'](db[_0x4e1e('0xa7')],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db['ZendeskField'][_0x4e1e('0x103')](db['ZendeskField'],{'as':'Description','foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xa7')][_0x4e1e('0x103')](db['ZendeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x4e1e('0xa7')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':'VariableId'});db[_0x4e1e('0xa9')][_0x4e1e('0x103')](db[_0x4e1e('0x1bc')],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':'AccountId'});db[_0x4e1e('0x1bc')]['hasMany'](db['FreshdeskField'],{'as':_0x4e1e('0x1ac'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ad')});db['FreshdeskConfiguration']['hasMany'](db[_0x4e1e('0xac')],{'as':_0x4e1e('0x1b6'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db['FreshdeskConfiguration']['hasMany'](db[_0x4e1e('0xac')],{'as':_0x4e1e('0x1a8'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0x1bc')]['belongsTo'](db[_0x4e1e('0xa9')],{'as':_0x4e1e('0x15d'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x1bd')});db[_0x4e1e('0xac')][_0x4e1e('0x103')](db['FreshdeskField'],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xac')][_0x4e1e('0x103')](db['FreshdeskField'],{'as':_0x4e1e('0x1b2'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xac')][_0x4e1e('0x103')](db[_0x4e1e('0xac')],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xac')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':'Variable','foreignKey':_0x4e1e('0x1b5')});db[_0x4e1e('0xae')][_0x4e1e('0x103')](db[_0x4e1e('0xb0')],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xb0')][_0x4e1e('0x103')](db[_0x4e1e('0xb1')],{'as':_0x4e1e('0x1ac'),'foreignKey':'SubjectId'});db['VtigerConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0xb1')],{'as':_0x4e1e('0x1b6'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xb0')][_0x4e1e('0x103')](db[_0x4e1e('0xb1')],{'as':_0x4e1e('0x1a8'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xb0')]['belongsTo'](db['VtigerAccount'],{'as':'Account','foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xb1')][_0x4e1e('0x103')](db['VtigerField'],{'as':'Subject','foreignKey':_0x4e1e('0x1ad')});db['VtigerField'][_0x4e1e('0x103')](db[_0x4e1e('0xb1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4e1e('0xb1')][_0x4e1e('0x103')](db['VtigerField'],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xb1')][_0x4e1e('0x13c')](db['Variable'],{'as':'Variable','foreignKey':_0x4e1e('0x1b5')});db[_0x4e1e('0xb3')][_0x4e1e('0x103')](db['ServicenowConfiguration'],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xb4')][_0x4e1e('0x103')](db['ServicenowField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x4e1e('0xb4')][_0x4e1e('0x103')](db[_0x4e1e('0xb6')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0xb6')],{'as':_0x4e1e('0x1a8'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xb4')][_0x4e1e('0x13c')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xb6')][_0x4e1e('0x103')](db[_0x4e1e('0xb6')],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xb6')][_0x4e1e('0x103')](db[_0x4e1e('0xb6')],{'as':_0x4e1e('0x1b2'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xb6')][_0x4e1e('0x103')](db[_0x4e1e('0xb6')],{'as':'Field','foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xb6')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db['Dynamics365Account'][_0x4e1e('0x103')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xb9')][_0x4e1e('0x103')](db[_0x4e1e('0xbb')],{'as':'Subjects','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xb9')][_0x4e1e('0x103')](db[_0x4e1e('0xbb')],{'as':'Descriptions','onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xb9')][_0x4e1e('0x103')](db[_0x4e1e('0xbb')],{'as':_0x4e1e('0x1a8'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x4e1e('0xb9')][_0x4e1e('0x13c')](db[_0x4e1e('0xb8')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1b0')});db['Dynamics365Field'][_0x4e1e('0x103')](db[_0x4e1e('0xbb')],{'as':'Subject','foreignKey':_0x4e1e('0x1ad')});db['Dynamics365Field'][_0x4e1e('0x103')](db[_0x4e1e('0xbb')],{'as':'Description','foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xbb')]['hasMany'](db[_0x4e1e('0xbb')],{'as':_0x4e1e('0x1b3'),'foreignKey':'FieldId'});db[_0x4e1e('0xbb')][_0x4e1e('0x13c')](db[_0x4e1e('0x1b4')],{'as':_0x4e1e('0x1b4'),'foreignKey':_0x4e1e('0x1b5')});db[_0x4e1e('0xbd')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x4e1e('0x1aa'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1b0')});db[_0x4e1e('0xbe')]['hasMany'](db[_0x4e1e('0xc0')],{'as':_0x4e1e('0x1ac'),'foreignKey':_0x4e1e('0x1ad')});db['FreshsalesConfiguration'][_0x4e1e('0x103')](db[_0x4e1e('0xc0')],{'as':'Descriptions','foreignKey':_0x4e1e('0x1ae')});db[_0x4e1e('0xbe')]['hasMany'](db[_0x4e1e('0xc0')],{'as':_0x4e1e('0x1a8'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xbe')][_0x4e1e('0x13c')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x4e1e('0x1b0')});db['FreshsalesField']['hasMany'](db[_0x4e1e('0xc0')],{'as':_0x4e1e('0x1b1'),'foreignKey':_0x4e1e('0x1ad')});db[_0x4e1e('0xc0')][_0x4e1e('0x103')](db[_0x4e1e('0xc0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4e1e('0xc0')][_0x4e1e('0x103')](db[_0x4e1e('0xc0')],{'as':_0x4e1e('0x1b3'),'foreignKey':_0x4e1e('0x1af')});db[_0x4e1e('0xc0')][_0x4e1e('0x13c')](db['Variable'],{'as':_0x4e1e('0x1b4'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{});db[_0x4e1e('0xc4')][_0x4e1e('0x13c')](db['CmList'],{'as':_0x4e1e('0x159'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0xc4')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db['ChatQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x5e')],{});db[_0x4e1e('0xc4')][_0x4e1e('0x13c')](db['ChatMessage'],{});db[_0x4e1e('0xc4')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{});db[_0x4e1e('0xc4')][_0x4e1e('0x13c')](db[_0x4e1e('0x11e')],{});db[_0x4e1e('0xc6')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'onDelete':'cascade','foreignKey':_0x4e1e('0x1be')});db[_0x4e1e('0xc6')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1bf')});db[_0x4e1e('0xcb')][_0x4e1e('0x103')](db[_0x4e1e('0xc9')],{'foreignKey':_0x4e1e('0x1c0'),'onDelete':_0x4e1e('0x101')});db['JscriptySessionReport']['hasMany'](db[_0x4e1e('0xc8')],{'foreignKey':_0x4e1e('0x1c0'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0x1c1')]['belongsTo'](db['SmsAccount'],{});db['SmsQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':'List','foreignKey':'ListId'});db[_0x4e1e('0x1c1')]['belongsTo'](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x1c1')][_0x4e1e('0x13c')](db[_0x4e1e('0x50')],{});db[_0x4e1e('0x1c1')][_0x4e1e('0x13c')](db[_0x4e1e('0x52')],{});db[_0x4e1e('0x1c1')]['belongsTo'](db[_0x4e1e('0x12')],{});db[_0x4e1e('0x1c1')][_0x4e1e('0x13c')](db[_0x4e1e('0x122')],{});db['JscriptyProject']['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x4e1e('0xc9')],{'foreignKey':_0x4e1e('0x1c2')});db['JscriptyProject'][_0x4e1e('0x103')](db[_0x4e1e('0xc8')],{'foreignKey':_0x4e1e('0x1c2')});db[_0x4e1e('0xd7')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x162'),'through':_0x4e1e('0x1c3')});db['Team'][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x116')});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db[_0x4e1e('0x3b')],{'through':_0x4e1e('0x1c4'),'as':_0x4e1e('0x11d')});db['Team'][_0x4e1e('0x111')](db[_0x4e1e('0x11e')],{'through':'team_has_chat_queues','as':_0x4e1e('0x11f')});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x4e1e('0x121')});db[_0x4e1e('0xdb')]['belongsToMany'](db['SmsQueue'],{'through':_0x4e1e('0x1c5'),'as':_0x4e1e('0x123')});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db[_0x4e1e('0x59')],{'through':_0x4e1e('0x17c'),'as':_0x4e1e('0x124')});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db[_0x4e1e('0xf8')],{'through':_0x4e1e('0x1c6'),'as':'WhatsappQueues'});db[_0x4e1e('0xdb')][_0x4e1e('0x111')](db[_0x4e1e('0xf0')],{'through':_0x4e1e('0xfc'),'as':_0x4e1e('0x11c')});db[_0x4e1e('0xdf')][_0x4e1e('0x103')](db['CmHopper'],{'as':_0x4e1e('0x189'),'foreignKey':_0x4e1e('0x18e')});db['Campaign'][_0x4e1e('0x103')](db['CmHopperFinal'],{'as':_0x4e1e('0x106'),'foreignKey':_0x4e1e('0x18e')});db['Campaign'][_0x4e1e('0x103')](db[_0x4e1e('0x6b')],{'as':'HopperHistories','foreignKey':_0x4e1e('0x18e')});db[_0x4e1e('0xdf')]['hasMany'](db[_0x4e1e('0x139')],{'as':'HopperBlacks','foreignKey':_0x4e1e('0x18e')});db[_0x4e1e('0xdf')][_0x4e1e('0x13c')](db[_0x4e1e('0x13d')],{'as':_0x4e1e('0x13d'),'foreignKey':_0x4e1e('0x13e')});db['Campaign'][_0x4e1e('0x13c')](db[_0x4e1e('0x13d')],{'as':_0x4e1e('0x13f'),'foreignKey':_0x4e1e('0x140')});db[_0x4e1e('0xdf')][_0x4e1e('0x13c')](db[_0x4e1e('0x78')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign'][_0x4e1e('0x13c')](db[_0x4e1e('0xd7')],{'as':_0x4e1e('0xd7'),'foreignKey':_0x4e1e('0x1c7')});db[_0x4e1e('0xdf')][_0x4e1e('0x111')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x114'),'through':_0x4e1e('0x1c8')});db[_0x4e1e('0xdf')][_0x4e1e('0x111')](db['CmList'],{'as':_0x4e1e('0x1c9'),'through':_0x4e1e('0x1ca')});db[_0x4e1e('0xe3')][_0x4e1e('0x13c')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x4e1e('0x167')});db[_0x4e1e('0xe5')]['belongsTo'](db[_0x4e1e('0x41')],{});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x3f')],{});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'foreignKey':_0x4e1e('0x1cb'),'as':_0x4e1e('0x1cc')});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':_0x4e1e('0x1ce')});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':'ToUserId','as':_0x4e1e('0x1cf')});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x3b')],{'foreignKey':_0x4e1e('0x1d0'),'as':_0x4e1e('0x1d1')});db['MailTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x39')],{'foreignKey':_0x4e1e('0x1d2'),'as':_0x4e1e('0x1d3')});db['ChatTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x5f')],{});db[_0x4e1e('0x1d4')][_0x4e1e('0x13c')](db['ChatInteraction'],{});db[_0x4e1e('0x1d4')][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'foreignKey':_0x4e1e('0x1d5'),'as':_0x4e1e('0x1cc')});db[_0x4e1e('0x1d4')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':_0x4e1e('0x1ce')});db['ChatTransferReport'][_0x4e1e('0x13c')](db['User'],{'foreignKey':_0x4e1e('0x1d6'),'as':'ToAgent'});db['ChatTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x11e')],{'foreignKey':_0x4e1e('0x1d7'),'as':_0x4e1e('0x1d1')});db[_0x4e1e('0x1d4')][_0x4e1e('0x13c')](db[_0x4e1e('0x125')],{'foreignKey':_0x4e1e('0x1d8'),'as':_0x4e1e('0x1d3')});db[_0x4e1e('0xe8')][_0x4e1e('0x13c')](db[_0x4e1e('0x4b')],{});db['FaxTransferReport'][_0x4e1e('0x13c')](db['FaxInteraction'],{});db[_0x4e1e('0xe8')][_0x4e1e('0x13c')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x4e1e('0x1cc')});db[_0x4e1e('0xe8')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':'FromAgent'});db[_0x4e1e('0xe8')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':'ToUserId','as':_0x4e1e('0x1cf')});db['FaxTransferReport']['belongsTo'](db['FaxQueue'],{'foreignKey':_0x4e1e('0x1d9'),'as':_0x4e1e('0x1d1')});db[_0x4e1e('0xe8')][_0x4e1e('0x13c')](db[_0x4e1e('0x46')],{'foreignKey':'ToFaxAccountId','as':_0x4e1e('0x1d3')});db['OpenchannelTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x58')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x4e1e('0x108')],{});db[_0x4e1e('0xea')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x4e1e('0x1da'),'as':_0x4e1e('0x1cc')});db[_0x4e1e('0xea')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':_0x4e1e('0x1ce')});db[_0x4e1e('0xea')]['belongsTo'](db[_0x4e1e('0x12')],{'foreignKey':'ToUserId','as':_0x4e1e('0x1cf')});db['OpenchannelTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x59')],{'foreignKey':'ToOpenchannelQueueId','as':_0x4e1e('0x1d1')});db[_0x4e1e('0xea')][_0x4e1e('0x13c')](db[_0x4e1e('0x55')],{'foreignKey':_0x4e1e('0x1db'),'as':_0x4e1e('0x1d3')});db[_0x4e1e('0xec')]['belongsTo'](db[_0x4e1e('0x52')],{});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x50')],{});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x12d')],{'foreignKey':_0x4e1e('0x1dc'),'as':_0x4e1e('0x1cc')});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':_0x4e1e('0x1ce')});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':'ToUserId','as':_0x4e1e('0x1cf')});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x122')],{'foreignKey':_0x4e1e('0x1dd'),'as':_0x4e1e('0x1d1')});db[_0x4e1e('0xec')][_0x4e1e('0x13c')](db[_0x4e1e('0x12d')],{'foreignKey':_0x4e1e('0x1de'),'as':'ToAccount'});db[_0x4e1e('0xee')][_0x4e1e('0x103')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4e1e('0x15a'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0xee')][_0x4e1e('0x103')](db[_0x4e1e('0x6e')],{'as':_0x4e1e('0x1df'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0xee')][_0x4e1e('0x103')](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x187'),'onDelete':_0x4e1e('0x101'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x4e1e('0x69')],{'as':_0x4e1e('0x106'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0xee')]['hasMany'](db[_0x4e1e('0x6b')],{'as':'HopperHistory','foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0xee')][_0x4e1e('0x103')](db['ReportAgentPreview'],{'as':_0x4e1e('0x107'),'foreignKey':_0x4e1e('0x15a')});db[_0x4e1e('0xee')][_0x4e1e('0x111')](db['VoiceQueue'],{'as':_0x4e1e('0x1e0'),'through':_0x4e1e('0x144')});db[_0x4e1e('0xee')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':'cm_user_has_lists'});db[_0x4e1e('0xf0')][_0x4e1e('0x103')](db[_0x4e1e('0x18')],{'as':_0x4e1e('0x105'),'onDelete':_0x4e1e('0x101')});db[_0x4e1e('0xf0')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':'Agents','through':_0x4e1e('0xfe')});db[_0x4e1e('0xf0')]['belongsToMany'](db['Team'],{'through':_0x4e1e('0xfc'),'as':_0x4e1e('0x146')});db[_0x4e1e('0xf1')][_0x4e1e('0x103')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x162'),'foreignKey':_0x4e1e('0x110')});db[_0x4e1e('0xf1')][_0x4e1e('0x103')](db[_0x4e1e('0x1e1')],{'as':'UserProfileSections','foreignKey':_0x4e1e('0x110'),'onDelete':'cascade'});db[_0x4e1e('0x1e1')]['hasMany'](db[_0x4e1e('0x1e2')],{'as':_0x4e1e('0x1e3'),'foreignKey':'sectionId','onDelete':_0x4e1e('0x101')});db['WhatsappAccount'][_0x4e1e('0x103')](db[_0x4e1e('0x74')],{'as':_0x4e1e('0x154'),'foreignKey':_0x4e1e('0x1e4'),'onDelete':_0x4e1e('0x101')});db['WhatsappAccount'][_0x4e1e('0x103')](db[_0x4e1e('0x73')],{'as':_0x4e1e('0x156'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x4e1e('0x103')](db[_0x4e1e('0x1e5')],{'as':_0x4e1e('0x148'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x4e1e('0x103')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x4e1e('0xf3')][_0x4e1e('0x103')](db[_0x4e1e('0x1e6')],{'as':'Applications'});db[_0x4e1e('0xf3')][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':'ListId'});db[_0x4e1e('0xf3')]['belongsTo'](db[_0x4e1e('0x79')],{'as':_0x4e1e('0x142'),'foreignKey':_0x4e1e('0x143')});db['WhatsappAccount'][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x1e7')});db[_0x4e1e('0x1e6')]['belongsTo'](db[_0x4e1e('0x12')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x1e6')][_0x4e1e('0x13c')](db[_0x4e1e('0xf8')],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x1e6')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x4e1e('0x151')});db[_0x4e1e('0x1e6')][_0x4e1e('0x13c')](db['Interval'],{'onDelete':_0x4e1e('0x151'),'foreignKey':_0x4e1e('0x141')});db['WhatsappApplication'][_0x4e1e('0x13c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4e1e('0x16e')});db['WhatsappInteraction'][_0x4e1e('0x103')](db[_0x4e1e('0x1e5')],{'as':_0x4e1e('0x148'),'onDelete':_0x4e1e('0x101'),'foreignKey':_0x4e1e('0x1e8')});db[_0x4e1e('0x10d')][_0x4e1e('0x13c')](db['WhatsappAccount'],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1e4')});db[_0x4e1e('0x10d')]['belongsTo'](db[_0x4e1e('0x67')],{'as':_0x4e1e('0x14f'),'foreignKey':_0x4e1e('0x169')});db[_0x4e1e('0x10d')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x15e'),'foreignKey':_0x4e1e('0x102')});db['WhatsappInteraction'][_0x4e1e('0x111')](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x19f'),'as':_0x4e1e('0x160')});db[_0x4e1e('0x10d')]['belongsToMany'](db[_0x4e1e('0x83')],{'through':_0x4e1e('0x19f'),'as':_0x4e1e('0x161')});db[_0x4e1e('0x10d')]['belongsToMany'](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x162'),'through':_0x4e1e('0x1e9'),'foreignKey':_0x4e1e('0x1e8')});db['WhatsappMessage'][_0x4e1e('0x13c')](db['User'],{'as':_0x4e1e('0x12')});db['WhatsappMessage'][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'onDelete':'cascade','as':_0x4e1e('0x14f')});db[_0x4e1e('0x1e5')][_0x4e1e('0x13c')](db['WhatsappInteraction'],{'onDelete':_0x4e1e('0x101'),'as':_0x4e1e('0x164'),'foreignKey':_0x4e1e('0x1e8')});db[_0x4e1e('0x1e5')][_0x4e1e('0x13c')](db[_0x4e1e('0xf3')],{'as':_0x4e1e('0x15d'),'foreignKey':_0x4e1e('0x1e4')});db['WhatsappQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0xf3')],{});db[_0x4e1e('0x1ea')][_0x4e1e('0x13c')](db[_0x4e1e('0xee')],{'as':_0x4e1e('0x159'),'foreignKey':'ListId'});db[_0x4e1e('0x1ea')][_0x4e1e('0x13c')](db[_0x4e1e('0x67')],{'as':'Contact','foreignKey':_0x4e1e('0x169')});db['WhatsappQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x10d')],{});db['WhatsappQueueReport'][_0x4e1e('0x13c')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x1e5')],{});db[_0x4e1e('0x1ea')]['belongsTo'](db[_0x4e1e('0x12')],{});db[_0x4e1e('0x1eb')][_0x4e1e('0x13c')](db[_0x4e1e('0x1e5')],{});db[_0x4e1e('0x1eb')][_0x4e1e('0x13c')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0xf3')],{'foreignKey':_0x4e1e('0x1ec'),'as':_0x4e1e('0x1cc')});db[_0x4e1e('0x1eb')][_0x4e1e('0x13c')](db[_0x4e1e('0xf3')],{'foreignKey':_0x4e1e('0x1ed'),'as':'ToAccount'});db[_0x4e1e('0x1eb')][_0x4e1e('0x13c')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x4e1e('0x1d1')});db['WhatsappTransferReport'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':_0x4e1e('0x1cd'),'as':'FromAgent'});db[_0x4e1e('0x1eb')][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'foreignKey':'ToUserId','as':_0x4e1e('0x1cf')});db[_0x4e1e('0xf8')][_0x4e1e('0x111')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x145'),'through':_0x4e1e('0x33'),'foreignKey':_0x4e1e('0x1ee')});db[_0x4e1e('0xf8')][_0x4e1e('0x111')](db[_0x4e1e('0xdb')],{'through':_0x4e1e('0x1c6'),'as':'Teams'});db['UserSetting'][_0x4e1e('0x13c')](db[_0x4e1e('0x12')],{'as':_0x4e1e('0x1ef'),'foreignKey':_0x4e1e('0x102'),'onDelete':_0x4e1e('0x101'),'hooks':!![]});db[_0x4e1e('0x150')][_0x4e1e('0x100')](db['MailServerIn'],{'as':'Imap','onDelete':_0x4e1e('0x151')});db['CloudProvider'][_0x4e1e('0x100')](db[_0x4e1e('0x37')],{'as':_0x4e1e('0x153'),'onDelete':'restrict'});module[_0x4e1e('0x1f0')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 12cd99f..bbae45c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','/apidoc','join','/www','static','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs'];(function(_0x306368,_0x2fc5e4){var _0x294718=function(_0x4445ba){while(--_0x4445ba){_0x306368['push'](_0x306368['shift']());}};_0x294718(++_0x2fc5e4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x29436e,_0x3f3ec5){_0x29436e=_0x29436e-0x0;var _0x1b85b6=_0x8ef6[_0x29436e];return _0x1b85b6;};'use strict';var path=require(_0x68ef('0x0'));var express=require(_0x68ef('0x1'));var errors=require(_0x68ef('0x2'));var config=require(_0x68ef('0x3'));var setupLoggers=require(_0x68ef('0x4'))[_0x68ef('0x5')];var clientSideLogs=require(_0x68ef('0x6'));exports['default']=function(_0x27d0af){return setupLoggers(_0x27d0af)[_0x68ef('0x7')](function(){_0x27d0af[_0x68ef('0x8')](_0x68ef('0x9'),require('./api/user'));_0x27d0af['use'](_0x68ef('0xa'),require(_0x68ef('0xb')));_0x27d0af[_0x68ef('0x8')]('/api/voice/contexts',require(_0x68ef('0xc')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd'),require(_0x68ef('0xe')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf'),require(_0x68ef('0x10')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x11'),require(_0x68ef('0x12')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x13'),require('./api/voiceRecording'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x14'),require(_0x68ef('0x15')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x16'),require(_0x68ef('0x17')));_0x27d0af['use'](_0x68ef('0x18'),require(_0x68ef('0x19')));_0x27d0af[_0x68ef('0x8')]('/api/voice/calls/reports',require(_0x68ef('0x1a')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x1b'),require('./api/voiceDialReport'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x1c'),require(_0x68ef('0x1d')));_0x27d0af[_0x68ef('0x8')]('/api/voice/queues/reports',require(_0x68ef('0x1e')));_0x27d0af['use']('/api/members/reports',require(_0x68ef('0x1f')));_0x27d0af[_0x68ef('0x8')]('/api/trunks',require('./api/trunk'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x20'),require(_0x68ef('0x21')));_0x27d0af['use'](_0x68ef('0x22'),require(_0x68ef('0x23')));_0x27d0af[_0x68ef('0x8')]('/api/mail/accounts',require(_0x68ef('0x24')));_0x27d0af[_0x68ef('0x8')]('/api/mail/queues',require(_0x68ef('0x25')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x26'),require('./api/mailSubstatus'));_0x27d0af['use']('/api/mail/interactions',require(_0x68ef('0x27')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x28'),require(_0x68ef('0x29')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x2a'),require(_0x68ef('0x2b')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x2c'),require(_0x68ef('0x2d')));_0x27d0af['use'](_0x68ef('0x2e'),require('./api/dashboard'));_0x27d0af['use']('/api/dashboards/items',require(_0x68ef('0x2f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x30'),require(_0x68ef('0x31')));_0x27d0af['use']('/api/fax/applications',require(_0x68ef('0x32')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x33'),require(_0x68ef('0x34')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x35'),require(_0x68ef('0x36')));_0x27d0af[_0x68ef('0x8')]('/api/fax/queues',require(_0x68ef('0x37')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x38'),require('./api/faxQueueReport'));_0x27d0af[_0x68ef('0x8')]('/api/sms/accounts',require(_0x68ef('0x39')));_0x27d0af[_0x68ef('0x8')]('/api/sms/applications',require('./api/smsApplication'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x3a'),require('./api/smsInteraction'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x3b'),require(_0x68ef('0x3c')));_0x27d0af[_0x68ef('0x8')]('/api/sms/queues',require(_0x68ef('0x3d')));_0x27d0af[_0x68ef('0x8')]('/api/openchannel/accounts',require(_0x68ef('0x3e')));_0x27d0af['use'](_0x68ef('0x3f'),require(_0x68ef('0x40')));_0x27d0af['use'](_0x68ef('0x41'),require('./api/openchannelInteraction'));_0x27d0af[_0x68ef('0x8')]('/api/openchannel/messages',require(_0x68ef('0x42')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x43'),require('./api/openchannelQueue'));_0x27d0af[_0x68ef('0x8')]('/api/chat/websites',require(_0x68ef('0x44')));_0x27d0af['use'](_0x68ef('0x45'),require(_0x68ef('0x46')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x47'),require(_0x68ef('0x48')));_0x27d0af[_0x68ef('0x8')]('/api/chat/interactions',require(_0x68ef('0x49')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4a'),require('./api/chatMessage'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4b'),require(_0x68ef('0x4c')));_0x27d0af['use']('/api/chat/queues',require(_0x68ef('0x4d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4e'),require(_0x68ef('0x4f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x50'),require(_0x68ef('0x51')));_0x27d0af['use'](_0x68ef('0x52'),require(_0x68ef('0x53')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x54'),require('./api/cmContact'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x55'),require(_0x68ef('0x56')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x57'),require(_0x68ef('0x58')));_0x27d0af['use'](_0x68ef('0x59'),require(_0x68ef('0x5a')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x5b'),require(_0x68ef('0x5c')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x5d'),require(_0x68ef('0x5e')));_0x27d0af[_0x68ef('0x8')]('/api/actions',require(_0x68ef('0x5f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x60'),require(_0x68ef('0x61')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x62'),require(_0x68ef('0x63')));_0x27d0af['use'](_0x68ef('0x64'),require('./api/disposition'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x65'),require(_0x68ef('0x66')));_0x27d0af[_0x68ef('0x8')]('/api/intervals',require(_0x68ef('0x67')));_0x27d0af['use'](_0x68ef('0x68'),require('./api/pause'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x69'),require(_0x68ef('0x6a')));_0x27d0af['use']('/api/voiceQueuesLog',require(_0x68ef('0x6b')));_0x27d0af[_0x68ef('0x8')]('/api/schedules',require('./api/schedule'));_0x27d0af['use'](_0x68ef('0x6c'),require(_0x68ef('0x6d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x6e'),require(_0x68ef('0x6f')));_0x27d0af['use']('/api/templates',require(_0x68ef('0x70')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x71'),require(_0x68ef('0x72')));_0x27d0af['use'](_0x68ef('0x73'),require(_0x68ef('0x74')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x75'),require('./api/integration'));_0x27d0af['use'](_0x68ef('0x76'),require(_0x68ef('0x77')));_0x27d0af['use'](_0x68ef('0x78'),require(_0x68ef('0x79')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x7a'),require(_0x68ef('0x7b')));_0x27d0af['use'](_0x68ef('0x7c'),require(_0x68ef('0x7d')));_0x27d0af[_0x68ef('0x8')]('/api/analytics/metrics',require(_0x68ef('0x7e')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x7f'),require('./api/analyticFieldReport'));_0x27d0af[_0x68ef('0x8')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/salesforce/accounts',require(_0x68ef('0x80')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x81'),require(_0x68ef('0x82')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x83'),require(_0x68ef('0x84')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x85'),require(_0x68ef('0x86')));_0x27d0af['use']('/api/integrations/sugarcrm/configurations',require(_0x68ef('0x87')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x88'),require(_0x68ef('0x89')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x8a'),require(_0x68ef('0x8b')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x8c'),require('./api/intDeskConfiguration'));_0x27d0af['use'](_0x68ef('0x8d'),require('./api/intDeskField'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zoho/accounts',require(_0x68ef('0x8e')));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zoho/configurations',require(_0x68ef('0x8f')));_0x27d0af['use'](_0x68ef('0x90'),require(_0x68ef('0x91')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x92'),require(_0x68ef('0x93')));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zendesk/configurations',require(_0x68ef('0x94')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x95'),require(_0x68ef('0x96')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x97'),require('./api/intFreshdeskAccount'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x98'),require('./api/intFreshdeskConfiguration'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x99'),require(_0x68ef('0x9a')));_0x27d0af['use'](_0x68ef('0x9b'),require('./api/intVtigerAccount'));_0x27d0af['use'](_0x68ef('0x9c'),require('./api/intVtigerConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/vtiger/fields',require(_0x68ef('0x9d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x9e'),require(_0x68ef('0x9f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa0'),require('./api/intServicenowConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/servicenow/fields',require(_0x68ef('0xa1')));_0x27d0af['use'](_0x68ef('0xa2'),require(_0x68ef('0xa3')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa4'),require(_0x68ef('0xa5')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa6'),require('./api/intDynamics365Field'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa7'),require(_0x68ef('0xa8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa9'),require('./api/intFreshsalesConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/freshsales/fields',require(_0x68ef('0xaa')));_0x27d0af['use']('/api/networks',require(_0x68ef('0xab')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xac'),require(_0x68ef('0xad')));_0x27d0af['use'](_0x68ef('0xae'),require('./api/chatInternalMessage'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xaf'),require(_0x68ef('0xb0')));_0x27d0af['use']('/api/jscripty/questions/reports',require(_0x68ef('0xb1')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb2'),require(_0x68ef('0xb3')));_0x27d0af['use'](_0x68ef('0xb4'),require(_0x68ef('0xb5')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb6'),require('./api/squareReport'));_0x27d0af[_0x68ef('0x8')]('/api/square/details/reports',require(_0x68ef('0xb7')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb8'),require(_0x68ef('0xb9')));_0x27d0af[_0x68ef('0x8')]('/api/settings',require(_0x68ef('0xba')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xbb'),require('./api/squareOdbc'));_0x27d0af[_0x68ef('0x8')]('/api/square/projects',require(_0x68ef('0xbc')));_0x27d0af['use']('/api/square/recordings',require(_0x68ef('0xbd')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xbe'),require(_0x68ef('0xbf')));_0x27d0af['use'](_0x68ef('0xc0'),require(_0x68ef('0xc1')));_0x27d0af[_0x68ef('0x8')]('/api/license',require(_0x68ef('0xc2')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc3'),require(_0x68ef('0xc4')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc5'),require(_0x68ef('0xc6')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc7'),require(_0x68ef('0xc8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc9'),require('./api/plugin'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xca'),require('./api/mailTransferReport'));_0x27d0af['use'](_0x68ef('0xcb'),require('./api/chatTransferReport'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xcc'),require('./api/faxTransferReport'));_0x27d0af['use'](_0x68ef('0xcd'),require('./api/openchannelTransferReport'));_0x27d0af[_0x68ef('0x8')]('/api/sms/reports/transfer',require(_0x68ef('0xce')));_0x27d0af['use'](_0x68ef('0xcf'),require(_0x68ef('0xd0')));_0x27d0af['use'](_0x68ef('0xd1'),require(_0x68ef('0xd2')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd3'),require('./api/userProfile'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd4'),require('./api/userProfileSection'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd5'),require(_0x68ef('0xd6')));_0x27d0af['use'](_0x68ef('0xd7'),require('./api/userNotification'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd8'),require('./api/whatsappAccount'));_0x27d0af['use']('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd9'),require(_0x68ef('0xda')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdb'),require(_0x68ef('0xdc')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdd'),require(_0x68ef('0xde')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdf'),require(_0x68ef('0xe0')));_0x27d0af[_0x68ef('0x8')]('/api/whatsapp/queues',require(_0x68ef('0xe1')));_0x27d0af['use'](_0x68ef('0xe2'),require('./api/cloudProvider'));_0x27d0af['use'](_0x68ef('0xe3'),require(_0x68ef('0xe4')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xe5'),require('./api/user-setting'));_0x27d0af['use'](_0x68ef('0xe6'),require(_0x68ef('0xe7')));_0x27d0af[_0x68ef('0x8')]('/api/auth/google',require(_0x68ef('0xe8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xe9'),require(_0x68ef('0xea')));_0x27d0af['use'](_0x68ef('0xeb'),require(_0x68ef('0xec')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xed'),require(_0x68ef('0xee')));_0x27d0af[_0x68ef('0x8')]('/api/version',require(_0x68ef('0xef')));_0x27d0af['use'](_0x68ef('0xf0'),require(_0x68ef('0xf1')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf2'),require('./api/pm2'));_0x27d0af[_0x68ef('0x8')]('/api/webbar',require(_0x68ef('0xf3')));_0x27d0af[_0x68ef('0x8')]('/api/logs',clientSideLogs);_0x27d0af['use'](_0x68ef('0xf4'),express['static'](path[_0x68ef('0xf5')](config['root'],_0x68ef('0xf4'))));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf6'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],'/www')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf9'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],_0x68ef('0xf9'))));_0x27d0af[_0x68ef('0x8')]('/snippet',express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],_0x68ef('0xfa'),_0x68ef('0xfb'))));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xfc'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config['root'],_0x68ef('0xfd'))));_0x27d0af['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x27d0af[_0x68ef('0xfe')]('/*')[_0x68ef('0xff')](function(_0x36d242,_0x55fc26){_0x55fc26['sendFile'](path['resolve'](_0x27d0af[_0x68ef('0xff')](_0x68ef('0x100'))+_0x68ef('0x101')));});return _0x27d0af;});}; \ No newline at end of file +var _0x9c5a=['/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/trigger','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','./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/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','/api/users','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/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/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal'];(function(_0x1fbc6f,_0x2d5466){var _0x1516ad=function(_0x510469){while(--_0x510469){_0x1fbc6f['push'](_0x1fbc6f['shift']());}};_0x1516ad(++_0x2d5466);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1c64d2,_0x2a0ee5){_0x1c64d2=_0x1c64d2-0x0;var _0x37bdf2=_0x9c5a[_0x1c64d2];return _0x37bdf2;};'use strict';var path=require(_0xa9c5('0x0'));var express=require(_0xa9c5('0x1'));var errors=require('./errors');var config=require(_0xa9c5('0x2'));var setupLoggers=require(_0xa9c5('0x3'))[_0xa9c5('0x4')];var clientSideLogs=require(_0xa9c5('0x5'));exports['default']=function(_0x2acfaf){return setupLoggers(_0x2acfaf)[_0xa9c5('0x6')](function(){_0x2acfaf['use'](_0xa9c5('0x7'),require('./api/user'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x9'),require('./api/voiceChanSpy'));_0x2acfaf['use'](_0xa9c5('0xa'),require(_0xa9c5('0xb')));_0x2acfaf['use'](_0xa9c5('0xc'),require(_0xa9c5('0xd')));_0x2acfaf['use'](_0xa9c5('0xe'),require(_0xa9c5('0xf')));_0x2acfaf['use']('/api/voice/queues',require(_0xa9c5('0x10')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x11'),require(_0xa9c5('0x12')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x13'),require(_0xa9c5('0x14')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x15'),require(_0xa9c5('0x16')));_0x2acfaf['use'](_0xa9c5('0x17'),require(_0xa9c5('0x18')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x19'),require(_0xa9c5('0x1a')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x1b'),require(_0xa9c5('0x1c')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x1d'),require('./api/voiceAgentReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x1e'),require(_0xa9c5('0x1f')));_0x2acfaf['use'](_0xa9c5('0x20'),require(_0xa9c5('0x21')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x22'),require(_0xa9c5('0x23')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x24'),require(_0xa9c5('0x25')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x26'),require(_0xa9c5('0x27')));_0x2acfaf[_0xa9c5('0x8')]('/api/mail/accounts',require(_0xa9c5('0x28')));_0x2acfaf[_0xa9c5('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x29'),require(_0xa9c5('0x2a')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x2b'),require(_0xa9c5('0x2c')));_0x2acfaf['use']('/api/mail/messages',require(_0xa9c5('0x2d')));_0x2acfaf[_0xa9c5('0x8')]('/api/mail/applications',require(_0xa9c5('0x2e')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x2f'),require(_0xa9c5('0x30')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x31'),require(_0xa9c5('0x32')));_0x2acfaf['use']('/api/dashboards/items',require(_0xa9c5('0x33')));_0x2acfaf['use'](_0xa9c5('0x34'),require(_0xa9c5('0x35')));_0x2acfaf['use'](_0xa9c5('0x36'),require(_0xa9c5('0x37')));_0x2acfaf['use'](_0xa9c5('0x38'),require(_0xa9c5('0x39')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x3a'),require(_0xa9c5('0x3b')));_0x2acfaf['use'](_0xa9c5('0x3c'),require('./api/faxQueue'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x3d'),require(_0xa9c5('0x3e')));_0x2acfaf['use'](_0xa9c5('0x3f'),require(_0xa9c5('0x40')));_0x2acfaf['use'](_0xa9c5('0x41'),require(_0xa9c5('0x42')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x43'),require(_0xa9c5('0x44')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x45'),require('./api/smsMessage'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x46'),require(_0xa9c5('0x47')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x48'),require(_0xa9c5('0x49')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x4a'),require('./api/openchannelApplication'));_0x2acfaf['use'](_0xa9c5('0x4b'),require(_0xa9c5('0x4c')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x4d'),require(_0xa9c5('0x4e')));_0x2acfaf[_0xa9c5('0x8')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x2acfaf['use'](_0xa9c5('0x4f'),require(_0xa9c5('0x50')));_0x2acfaf['use'](_0xa9c5('0x51'),require('./api/openchannelQueueReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x52'),require(_0xa9c5('0x53')));_0x2acfaf[_0xa9c5('0x8')]('/api/chat/interactions',require(_0xa9c5('0x54')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x55'),require(_0xa9c5('0x56')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x57'),require(_0xa9c5('0x58')));_0x2acfaf[_0xa9c5('0x8')]('/api/chat/queues',require(_0xa9c5('0x59')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x5a'),require(_0xa9c5('0x5b')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x5c'),require('./api/chatProactiveAction'));_0x2acfaf[_0xa9c5('0x8')]('/api/cm/companies',require(_0xa9c5('0x5d')));_0x2acfaf['use'](_0xa9c5('0x5e'),require(_0xa9c5('0x5f')));_0x2acfaf[_0xa9c5('0x8')]('/api/cm/hopper',require(_0xa9c5('0x60')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x61'),require(_0xa9c5('0x62')));_0x2acfaf['use'](_0xa9c5('0x63'),require(_0xa9c5('0x64')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x65'),require(_0xa9c5('0x66')));_0x2acfaf['use'](_0xa9c5('0x67'),require('./api/cmCustomField'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x68'),require(_0xa9c5('0x69')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x6a'),require(_0xa9c5('0x6b')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x6c'),require(_0xa9c5('0x6d')));_0x2acfaf[_0xa9c5('0x8')]('/api/dispositions',require(_0xa9c5('0x6e')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x6f'),require(_0xa9c5('0x70')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x71'),require('./api/interval'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x72'),require('./api/pause'));_0x2acfaf['use']('/api/cdr',require('./api/cdr'));_0x2acfaf['use'](_0xa9c5('0x73'),require(_0xa9c5('0x74')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x75'),require(_0xa9c5('0x76')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x77'),require(_0xa9c5('0x78')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x79'),require(_0xa9c5('0x7a')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x7b'),require('./api/template'));_0x2acfaf[_0xa9c5('0x8')]('/api/triggers',require(_0xa9c5('0x7c')));_0x2acfaf[_0xa9c5('0x8')]('/api/variables',require('./api/variable'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x7d'),require(_0xa9c5('0x7e')));_0x2acfaf['use']('/api/integrations/reports',require(_0xa9c5('0x7f')));_0x2acfaf[_0xa9c5('0x8')]('/api/analytics/custom_reports',require(_0xa9c5('0x80')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x81'),require(_0xa9c5('0x82')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x83'),require('./api/analyticExtractedReport'));_0x2acfaf['use']('/api/analytics/metrics',require(_0xa9c5('0x84')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x85'),require(_0xa9c5('0x86')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x87'),require('./api/analyticTreeReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x88'),require(_0xa9c5('0x89')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x8a'),require(_0xa9c5('0x8b')));_0x2acfaf['use']('/api/integrations/salesforce/fields',require(_0xa9c5('0x8c')));_0x2acfaf['use'](_0xa9c5('0x8d'),require('./api/intSugarcrmAccount'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x8e'),require(_0xa9c5('0x8f')));_0x2acfaf['use'](_0xa9c5('0x90'),require(_0xa9c5('0x91')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x92'),require('./api/intDeskAccount'));_0x2acfaf['use'](_0xa9c5('0x93'),require(_0xa9c5('0x94')));_0x2acfaf[_0xa9c5('0x8')]('/api/integrations/desk/fields',require(_0xa9c5('0x95')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x96'),require(_0xa9c5('0x97')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x98'),require(_0xa9c5('0x99')));_0x2acfaf[_0xa9c5('0x8')]('/api/integrations/zoho/fields',require(_0xa9c5('0x9a')));_0x2acfaf['use'](_0xa9c5('0x9b'),require(_0xa9c5('0x9c')));_0x2acfaf[_0xa9c5('0x8')]('/api/integrations/zendesk/configurations',require(_0xa9c5('0x9d')));_0x2acfaf[_0xa9c5('0x8')]('/api/integrations/zendesk/fields',require(_0xa9c5('0x9e')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x9f'),require(_0xa9c5('0xa0')));_0x2acfaf['use'](_0xa9c5('0xa1'),require(_0xa9c5('0xa2')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xa3'),require('./api/intFreshdeskField'));_0x2acfaf['use'](_0xa9c5('0xa4'),require(_0xa9c5('0xa5')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xa6'),require(_0xa9c5('0xa7')));_0x2acfaf[_0xa9c5('0x8')]('/api/integrations/vtiger/fields',require(_0xa9c5('0xa8')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xa9'),require(_0xa9c5('0xaa')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xab'),require(_0xa9c5('0xac')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xad'),require(_0xa9c5('0xae')));_0x2acfaf['use']('/api/integrations/dynamics365/accounts',require(_0xa9c5('0xaf')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xb0'),require(_0xa9c5('0xb1')));_0x2acfaf['use'](_0xa9c5('0xb2'),require('./api/intDynamics365Field'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xb3'),require(_0xa9c5('0xb4')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xb5'),require(_0xa9c5('0xb6')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xb7'),require(_0xa9c5('0xb8')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xb9'),require(_0xa9c5('0xba')));_0x2acfaf['use'](_0xa9c5('0xbb'),require(_0xa9c5('0xbc')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xbd'),require(_0xa9c5('0xbe')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xbf'),require('./api/jscriptyAnswerReport'));_0x2acfaf['use'](_0xa9c5('0xc0'),require('./api/jscriptyQuestionReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xc1'),require('./api/jscriptySessionReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xc2'),require('./api/smsQueueReport'));_0x2acfaf['use'](_0xa9c5('0xc3'),require(_0xa9c5('0xc4')));_0x2acfaf[_0xa9c5('0x8')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xc5'),require('./api/jscriptyProject'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xc6'),require(_0xa9c5('0xc7')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xc8'),require(_0xa9c5('0xc9')));_0x2acfaf['use'](_0xa9c5('0xca'),require(_0xa9c5('0xcb')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xcc'),require('./api/squareRecording'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xcd'),require('./api/squareMessage'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xce'),require(_0xa9c5('0xcf')));_0x2acfaf['use'](_0xa9c5('0xd0'),require(_0xa9c5('0xd1')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xd2'),require(_0xa9c5('0xd3')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xd4'),require('./api/migration'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xd5'),require(_0xa9c5('0xd6')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xd7'),require(_0xa9c5('0xd8')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xd9'),require(_0xa9c5('0xda')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xdb'),require('./api/chatTransferReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xdc'),require('./api/faxTransferReport'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xdd'),require(_0xa9c5('0xde')));_0x2acfaf['use'](_0xa9c5('0xdf'),require(_0xa9c5('0xe0')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xe1'),require('./api/cmList'));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xe2'),require('./api/voicePrefix'));_0x2acfaf['use']('/api/userProfiles',require('./api/userProfile'));_0x2acfaf['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x2acfaf['use'](_0xa9c5('0xe3'),require(_0xa9c5('0xe4')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xe5'),require(_0xa9c5('0xe6')));_0x2acfaf['use']('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x2acfaf['use'](_0xa9c5('0xe7'),require(_0xa9c5('0xe8')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xe9'),require('./api/whatsappInteraction'));_0x2acfaf['use'](_0xa9c5('0xea'),require(_0xa9c5('0xeb')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xec'),require(_0xa9c5('0xed')));_0x2acfaf['use'](_0xa9c5('0xee'),require(_0xa9c5('0xef')));_0x2acfaf[_0xa9c5('0x8')]('/api/whatsapp/queues',require(_0xa9c5('0xf0')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xf1'),require(_0xa9c5('0xf2')));_0x2acfaf['use'](_0xa9c5('0xf3'),require(_0xa9c5('0xf4')));_0x2acfaf['use']('/api/user-settings',require(_0xa9c5('0xf5')));_0x2acfaf['use']('/api/auth/local',require(_0xa9c5('0xf6')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xf7'),require(_0xa9c5('0xf8')));_0x2acfaf[_0xa9c5('0x8')]('/api/auth/activedirectory',require(_0xa9c5('0xf9')));_0x2acfaf['use'](_0xa9c5('0xfa'),require(_0xa9c5('0xfb')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0xfc'),require('./api/rpc'));_0x2acfaf['use'](_0xa9c5('0xfd'),require('./api/version'));_0x2acfaf['use'](_0xa9c5('0xfe'),require(_0xa9c5('0xff')));_0x2acfaf['use']('/api/pm2',require(_0xa9c5('0x100')));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x101'),require(_0xa9c5('0x102')));_0x2acfaf['use']('/api/logs',clientSideLogs);_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x103'),express[_0xa9c5('0x104')](path[_0xa9c5('0x105')](config[_0xa9c5('0x106')],_0xa9c5('0x103'))));_0x2acfaf[_0xa9c5('0x8')]('/www',express[_0xa9c5('0x104')](path[_0xa9c5('0x105')](config['root'],_0xa9c5('0x107'))));_0x2acfaf[_0xa9c5('0x8')]('/demo',express[_0xa9c5('0x104')](path[_0xa9c5('0x105')](config[_0xa9c5('0x106')],_0xa9c5('0x108'))));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x109'),express[_0xa9c5('0x104')](path[_0xa9c5('0x105')](config[_0xa9c5('0x106')],_0xa9c5('0x10a'),_0xa9c5('0x10b'))));_0x2acfaf[_0xa9c5('0x8')](_0xa9c5('0x10c'),express[_0xa9c5('0x104')](path[_0xa9c5('0x105')](config[_0xa9c5('0x106')],_0xa9c5('0x10d'))));_0x2acfaf['route'](_0xa9c5('0x10e'))[_0xa9c5('0x10f')](errors[0x194]);_0x2acfaf[_0xa9c5('0x110')]('/*')['get'](function(_0x3c6092,_0x240561){_0x240561['sendFile'](path[_0xa9c5('0x111')](_0x2acfaf[_0xa9c5('0x10f')](_0xa9c5('0x112'))+_0xa9c5('0x113')));});return _0x2acfaf;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1ad8f84..ab6ed60 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeee=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x334aab,_0x341a80){var _0x2502da=function(_0x3cb4b9){while(--_0x3cb4b9){_0x334aab['push'](_0x334aab['shift']());}};_0x2502da(++_0x341a80);}(_0xeeee,0xc3));var _0xeeee=function(_0x387bc2,_0xdec389){_0x387bc2=_0x387bc2-0x0;var _0x32ea31=_0xeeee[_0x387bc2];return _0x32ea31;};'use strict';var jayson=require(_0xeeee('0x0'));var _=require(_0xeeee('0x1'));var config=require(_0xeeee('0x2'));exports[_0xeeee('0x3')]=function(){return new Promise(function(_0x574056,_0xe8e455){var _0x491dc2={};_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x4')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x6')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x7')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x8')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x9')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0xa')));_0x491dc2=_['merge'](_0x491dc2,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0xb')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0xc')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0xd')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0xe')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/mailServerIn/mailServerIn.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/mailAccount/mailAccount.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/mailQueue/mailQueue.rpc'));_0x491dc2=_['merge'](_0x491dc2,require('../api/mailInteraction/mailInteraction.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0xf')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x10')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x11')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x12')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/faxApplication/faxApplication.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x13')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x14')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x15')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x16')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x17')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x18')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x19')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x1a')));_0x491dc2=_['merge'](_0x491dc2,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x1b')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x1c')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x1d')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x1e')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x1f')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/chatQueue/chatQueue.rpc'));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x20')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x21')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x22')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x23')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x24')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x25')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/pause/pause.rpc'));_0x491dc2=_['merge'](_0x491dc2,require('../api/sound/sound.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x26')));_0x491dc2=_['merge'](_0x491dc2,require('../api/trigger/trigger.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x27')));_0x491dc2=_['merge'](_0x491dc2,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x28')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x29')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x2a')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x2b')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x2c')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x2d')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x2e')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x2f')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x30')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x31')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x32')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x33')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/setting/setting.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/squareOdbc/squareOdbc.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/squareProject/squareProject.rpc'));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x34')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x35')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x36')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x37')));_0x491dc2=_['merge'](_0x491dc2,require(_0xeeee('0x38')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x39')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x3a')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x3b')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require(_0xeeee('0x3c')));_0x491dc2=_[_0xeeee('0x5')](_0x491dc2,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x551bfb=jayson[_0xeeee('0x3d')](_0x491dc2)[_0xeeee('0x3e')]();var _0x226691=config[_0xeeee('0x3f')][_0xeeee('0x40')]||config[_0xeeee('0x40')]+0x1;var _0x37f755=config[_0xeeee('0x3f')]['ip']||_0xeeee('0x41');_0x551bfb['on']('error',function(_0x2071cd){return _0xe8e455(_0x2071cd);});_0x551bfb['listen'](_0x226691,_0x37f755,function(){console['log'](_0xeeee('0x42'),_0x37f755,_0x226691);require(_0xeeee('0x43'))['default']();return _0x574056(_0xeeee('0x44')+_0x37f755+':'+_0x226691);});});}; \ No newline at end of file +var _0x5d40=['../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc'];(function(_0x2dd0a2,_0x34fdd8){var _0x2eef4d=function(_0x443b0d){while(--_0x443b0d){_0x2dd0a2['push'](_0x2dd0a2['shift']());}};_0x2eef4d(++_0x34fdd8);}(_0x5d40,0x1e1));var _0x05d4=function(_0x54c1e7,_0x2e3bd2){_0x54c1e7=_0x54c1e7-0x0;var _0x4647ed=_0x5d40[_0x54c1e7];return _0x4647ed;};'use strict';var jayson=require(_0x05d4('0x0'));var _=require('lodash');var config=require(_0x05d4('0x1'));exports[_0x05d4('0x2')]=function(){return new Promise(function(_0x7da11d,_0x5ba8aa){var _0xd568c1={};_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x4')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x5')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/voiceQueue/voiceQueue.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x6')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x7')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/voiceDialReport/voiceDialReport.rpc'));_0xd568c1=_['merge'](_0xd568c1,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x8')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x9')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0xa')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0xb')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0xc')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0xd')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/mailAccount/mailAccount.rpc'));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0xe')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0xf')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x10')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x11')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x12')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x13')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x14')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x15')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x16')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x17')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x18')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x19')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x1a')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/smsMessage/smsMessage.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/smsQueue/smsQueue.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x1b')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x1c')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x1d')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x1e')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x1f')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x20')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x21')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x22')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x23')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x24')));_0xd568c1=_['merge'](_0xd568c1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x25')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x26')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x27')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x28')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x29')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/trigger/trigger.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x2a')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x2b')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x2c')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x2d')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x2e')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x2f')));_0xd568c1=_['merge'](_0xd568c1,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x30')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x31')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x32')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x33')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x34')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x35')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/squareReportDetail/squareReportDetail.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x36')));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x37')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x38')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x39')));_0xd568c1=_['merge'](_0xd568c1,require('../api/squareMessage/squareMessage.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x3a')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/attachment/attachment.rpc'));_0xd568c1=_['merge'](_0xd568c1,require(_0x05d4('0x3b')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x3c')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x3d')));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0xd568c1=_[_0x05d4('0x3')](_0xd568c1,require(_0x05d4('0x3e')));var _0x2667f5=jayson[_0x05d4('0x3f')](_0xd568c1)[_0x05d4('0x40')]();var _0x4e3904=config[_0x05d4('0x41')][_0x05d4('0x42')]||config[_0x05d4('0x42')]+0x1;var _0x1235a0=config[_0x05d4('0x41')]['ip']||'localhost';_0x2667f5['on'](_0x05d4('0x43'),function(_0x35e327){return _0x5ba8aa(_0x35e327);});_0x2667f5['listen'](_0x4e3904,_0x1235a0,function(){console[_0x05d4('0x44')](_0x05d4('0x45'),_0x1235a0,_0x4e3904);require(_0x05d4('0x46'))[_0x05d4('0x47')]();return _0x7da11d(_0x05d4('0x48')+_0x1235a0+':'+_0x4e3904);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4fa5789..4b7bef1 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 _0xc74c=['startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype','sync','ANSWER','getData','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','noop','util','lodash','./reply','./error','call','setEncoding','utf8','headers','line','toLowerCase','emit','hangup','substring','search','function','no\x20code','replace','result=','substr','indexOf'];(function(_0x33c01a,_0x59b6cd){var _0x37b82d=function(_0x94f8b4){while(--_0x94f8b4){_0x33c01a['push'](_0x33c01a['shift']());}};_0x37b82d(++_0x59b6cd);}(_0xc74c,0x163));var _0xcc74=function(_0x38e266,_0x1d748f){_0x38e266=_0x38e266-0x0;var _0xbcfeb7=_0xc74c[_0x38e266];return _0xbcfeb7;};'use strict';var util=require(_0xcc74('0x0'));var _=require(_0xcc74('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xcc74('0x2'));var AGIError=require(_0xcc74('0x3'));function AGIChannel(_0x5625ab){var _0xe64b17=this,_0x3284bd=new AGIReply(),_0x2c284b=![],_0x105019={};EventEmitter[_0xcc74('0x4')](_0xe64b17);_0x5625ab[_0xcc74('0x5')](_0xcc74('0x6'));_0x5625ab['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3284bd[_0xcc74('0x5')](_0xcc74('0x6'));_0x3284bd['on'](_0xcc74('0x7'),function(_0x473308){for(var _0xa311c4 in _0x473308){_0xe64b17[_0xa311c4]=_0x473308[_0xa311c4];}_0xe64b17['emit']('ready');});_0x3284bd['on'](_0xcc74('0x8'),function(_0x1aeb8f){if(_0x1aeb8f[_0xcc74('0x9')]()=='hangup'){_0xe64b17[_0xcc74('0xa')](_0xcc74('0xb'));return;}if(_0x1aeb8f[_0xcc74('0xc')](0x0,0xb)=='520-Invalid'){_0x2c284b=!![];}if(_0x2c284b){_0x105019['rx']+=_0x1aeb8f+'\x0a';if(_0x1aeb8f[_0xcc74('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x2c284b=![];}}else{_0x105019['rx']=_0x1aeb8f;}if(_0x2c284b){return;}if(typeof _0x105019['cb']==_0xcc74('0xe')){var _0x4b3988=_0x105019['rx'][_0xcc74('0xc')](0x0,0x3),_0x4e4003=null,_0x4e5600=null;_0x4b3988=parseInt(_0x4b3988);if(isNaN(_0x4b3988)){_0x105019['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xcc74('0xf')});return;}if(_0x4b3988!=0xc8){_0x105019['cb'](null,{'code':_0x4b3988,'result':-0x1,'extra':'KO'});return;}_0x4e4003=_0x105019['rx'][_0xcc74('0xc')](0x4)[_0xcc74('0x10')](_0xcc74('0x11'),'');if(_0x4e4003['indexOf']('\x20')!=-0x1){_0x4e4003=_0x4e4003[_0xcc74('0x12')](0x0,_0x4e4003[_0xcc74('0x13')]('\x20'));}if(_[_0xcc74('0x14')](_0x4e4003,'-1')){_0x4e4003=parseInt(_0x4e4003);}_0x4e5600=_0x105019['rx'][_0xcc74('0x15')]('\x20');if(_0x4e5600[_0xcc74('0x16')]==0x3){_0x4e5600=_0x4e5600[0x2]['substring'](0x1,_0x4e5600[0x2][_0xcc74('0x16')]-0x1);}else if(_0x4e5600[_0xcc74('0x16')]>0x3){var _0xe44014=/\((.+)\)/;var _0x42dd79=_0x105019['rx'][_0xcc74('0x17')](_0xe44014);if(_0x42dd79){_0x4e5600=_0x42dd79[0x1];}else{_0x4e5600=null;}}else{_0x4e5600=null;}_0x105019['cb'](null,{'code':_0x4b3988,'result':_0x4e4003,'extra':_0x4e5600});}});_0x5625ab['on'](_0xcc74('0x18'),function(_0x170583){_0xe64b17[_0xcc74('0xa')](_0xcc74('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x170583[_0xcc74('0x19')]));});_0x5625ab['on'](_0xcc74('0x1a'),function(){_0xe64b17[_0xcc74('0xa')](_0xcc74('0x1a'),new AGIError(_0xcc74('0x1b')));});_0x5625ab['on'](_0xcc74('0x1c'),function(){_0xe64b17['emit'](_0xcc74('0x1c'),new AGIError(_0xcc74('0x1d')));_0x5625ab['destroy']();});_0x5625ab[_0xcc74('0x1e')](_0x3284bd);this[_0xcc74('0x1f')]=function(_0x13de0e,_0x545749){var _0x13de0e=_0x13de0e||'',_0x545749=typeof _0x545749==_0xcc74('0xe')?_0x545749:new Function();_0x105019={'tx':_0x13de0e,'rx':'','cb':_0x545749};_0x5625ab[_0xcc74('0x20')](_0x13de0e+'\x0a');},this['close']=function(){_0x5625ab[_0xcc74('0x21')]();};}util[_0xcc74('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xcc74('0x23')]['sendRequest']=function(_0xdd96b1){return this[_0xcc74('0x1f')][_0xcc74('0x24')](this,_0xdd96b1);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0xcc74('0x25'));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x26')]=function(_0x311cc2,_0x1fdd6b,_0x39de38){_0x311cc2=_0x311cc2===undefined?'beep':_0x311cc2;_0x1fdd6b=_0x1fdd6b===undefined?'5':_0x1fdd6b;_0x39de38=_0x39de38===undefined?'1':_0x39de38;return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x29'),_0x311cc2,_0x1fdd6b*0x3e8,_0x39de38));};AGIChannel[_0xcc74('0x23')]['noop']=function(_0x153b17){_0x153b17=_0x153b17||_0xcc74('0x2a');return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x2b'),_0x153b17));};AGIChannel[_0xcc74('0x23')]['exec']=function(_0x390bc0,_0x5cb390){if(_[_0xcc74('0x2c')](_0x5cb390)){return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x2d'),_0x390bc0,_0x5cb390[_0xcc74('0x2e')](',')));}return this[_0xcc74('0x27')](util['format']('EXEC\x20%s\x20%s',_0x390bc0,_0x5cb390));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x2f')]=function(_0x3d0f8b){return this['sendRequest'](util[_0xcc74('0x28')](_0xcc74('0x30'),_0x3d0f8b));};AGIChannel['prototype']['setExtension']=function(_0x6e42b0){return this[_0xcc74('0x27')](util['format'](_0xcc74('0x31'),_0x6e42b0));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x32')]=function(_0x2928a4){return this[_0xcc74('0x27')](util[_0xcc74('0x28')]('SET\x20PRIORITY\x20%s',_0x2928a4));};AGIChannel[_0xcc74('0x23')][_0xcc74('0xb')]=function(){return this[_0xcc74('0x27')](_0xcc74('0x33'));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x34')]=function(_0x64b31b,_0x5a361f){var _0x3d6cd7=_['isBoolean'](_0x5a361f)||_[_0xcc74('0x35')](_0x5a361f)?_0x5a361f[_0xcc74('0x36')]():_0x5a361f;return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x37'),_0x64b31b,_0x3d6cd7?_0x3d6cd7[_0xcc74('0x36')]()[_0xcc74('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x38')]=function(_0xe2a612,_0x1d4142){return this[_0xcc74('0x27')](util['format'](_0xcc74('0x39'),_0xe2a612,_0x1d4142));};AGIChannel[_0xcc74('0x23')]['sayDigits']=function(_0x1d1675,_0x1563d1){return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x3a'),_0x1d1675,_0x1563d1));};AGIChannel['prototype'][_0xcc74('0x3b')]=function(_0x545433,_0x23a1e9){return this[_0xcc74('0x27')](util[_0xcc74('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x545433,_0x23a1e9));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x3c')]=function(_0x4333eb,_0x2c5cb1,_0x5557b6){_0x2c5cb1=_0x2c5cb1||this[_0xcc74('0x3d')];_0x5557b6=_0x5557b6||0x1;this[_0xcc74('0x2f')](_0x4333eb);this[_0xcc74('0x3e')](_0x2c5cb1);this[_0xcc74('0x32')](_0x5557b6);return this['noop'](util[_0xcc74('0x28')](_0xcc74('0x3f'),_0x4333eb,_0x2c5cb1,_0x5557b6));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x40')]=function(_0xed8acf){return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x41'),_0xed8acf));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x42')]=function(_0x51be0e,_0x342324,_0x32e6f7,_0x2aed47,_0x1534fb,_0x3549a8){_0x342324=_0x342324||_0xcc74('0x43');_0x32e6f7=_0x32e6f7||'';_0x2aed47=_0x2aed47===undefined?-0x1:_0x2aed47==='-1'?-0x1:_0x2aed47*0x3e8;_0x1534fb=_0x1534fb===undefined?'':'s='+_0x1534fb;_0x3549a8=_0x3549a8?'BEEP':'';return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x44'),_0x51be0e,_0x342324,_0x32e6f7,_0x2aed47,_0x3549a8,_0x1534fb));};AGIChannel[_0xcc74('0x23')]['streamFile']=function(_0x5a6461,_0x2a5a14){_0x2a5a14=_0x2a5a14||'';return this[_0xcc74('0x27')](util[_0xcc74('0x28')](_0xcc74('0x45'),_0x5a6461,_0x2a5a14));};AGIChannel[_0xcc74('0x23')][_0xcc74('0x46')]=function(_0x5cdfc5){return this[_0xcc74('0x47')](_0xcc74('0x48'),_0x5cdfc5);};AGIChannel[_0xcc74('0x23')][_0xcc74('0x49')]=function(_0x172d58){return this['exec']('WAIT',_0x172d58);};AGIChannel[_0xcc74('0x23')][_0xcc74('0x18')]=function(_0xada9b3,_0x32bfde){this[_0xcc74('0x4a')](util[_0xcc74('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0xada9b3['id'],_0xada9b3['label'],_0x32bfde));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xdcd5=['setExtension','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','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','sendRequest','prototype','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext'];(function(_0x5c362e,_0x485c11){var _0x5493ae=function(_0x254ee6){while(--_0x254ee6){_0x5c362e['push'](_0x5c362e['shift']());}};_0x5493ae(++_0x485c11);}(_0xdcd5,0x110));var _0x5dcd=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xdcd5[_0x10b48a];return _0x2c4533;};'use strict';var util=require(_0x5dcd('0x0'));var _=require(_0x5dcd('0x1'));var EventEmitter=require(_0x5dcd('0x2'))[_0x5dcd('0x3')];var AGIReply=require(_0x5dcd('0x4'));var AGIError=require(_0x5dcd('0x5'));function AGIChannel(_0x1f4089){var _0x5447ba=this,_0x1c13f5=new AGIReply(),_0x245dc8=![],_0x3e2af0={};EventEmitter[_0x5dcd('0x6')](_0x5447ba);_0x1f4089[_0x5dcd('0x7')](_0x5dcd('0x8'));_0x1f4089[_0x5dcd('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1c13f5[_0x5dcd('0x7')]('utf8');_0x1c13f5['on']('headers',function(_0x1680f9){for(var _0x235c57 in _0x1680f9){_0x5447ba[_0x235c57]=_0x1680f9[_0x235c57];}_0x5447ba[_0x5dcd('0xa')]('ready');});_0x1c13f5['on'](_0x5dcd('0xb'),function(_0x29c3e1){if(_0x29c3e1[_0x5dcd('0xc')]()==_0x5dcd('0xd')){_0x5447ba[_0x5dcd('0xa')](_0x5dcd('0xd'));return;}if(_0x29c3e1[_0x5dcd('0xe')](0x0,0xb)=='520-Invalid'){_0x245dc8=!![];}if(_0x245dc8){_0x3e2af0['rx']+=_0x29c3e1+'\x0a';if(_0x29c3e1['search'](_0x5dcd('0xf'))!=-0x1){_0x245dc8=![];}}else{_0x3e2af0['rx']=_0x29c3e1;}if(_0x245dc8){return;}if(typeof _0x3e2af0['cb']==_0x5dcd('0x10')){var _0x4e213f=_0x3e2af0['rx'][_0x5dcd('0xe')](0x0,0x3),_0x250f9a=null,_0x7cf873=null;_0x4e213f=parseInt(_0x4e213f);if(isNaN(_0x4e213f)){_0x3e2af0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5dcd('0x11')});return;}if(_0x4e213f!=0xc8){_0x3e2af0['cb'](null,{'code':_0x4e213f,'result':-0x1,'extra':'KO'});return;}_0x250f9a=_0x3e2af0['rx'][_0x5dcd('0xe')](0x4)[_0x5dcd('0x12')](_0x5dcd('0x13'),'');if(_0x250f9a[_0x5dcd('0x14')]('\x20')!=-0x1){_0x250f9a=_0x250f9a['substr'](0x0,_0x250f9a[_0x5dcd('0x14')]('\x20'));}if(_[_0x5dcd('0x15')](_0x250f9a,'-1')){_0x250f9a=parseInt(_0x250f9a);}_0x7cf873=_0x3e2af0['rx']['split']('\x20');if(_0x7cf873[_0x5dcd('0x16')]==0x3){_0x7cf873=_0x7cf873[0x2]['substring'](0x1,_0x7cf873[0x2][_0x5dcd('0x16')]-0x1);}else if(_0x7cf873[_0x5dcd('0x16')]>0x3){var _0x1fd337=/\((.+)\)/;var _0x4849de=_0x3e2af0['rx'][_0x5dcd('0x17')](_0x1fd337);if(_0x4849de){_0x7cf873=_0x4849de[0x1];}else{_0x7cf873=null;}}else{_0x7cf873=null;}_0x3e2af0['cb'](null,{'code':_0x4e213f,'result':_0x250f9a,'extra':_0x7cf873});}});_0x1f4089['on'](_0x5dcd('0x18'),function(_0xc7d7d7){_0x5447ba['emit'](_0x5dcd('0x18'),new AGIError(_0x5dcd('0x19'),_0xc7d7d7[_0x5dcd('0x1a')]));});_0x1f4089['on']('close',function(){_0x5447ba[_0x5dcd('0xa')](_0x5dcd('0x1b'),new AGIError(_0x5dcd('0x1c')));});_0x1f4089['on'](_0x5dcd('0x1d'),function(){_0x5447ba['emit'](_0x5dcd('0x1d'),new AGIError(_0x5dcd('0x1e')));_0x1f4089['destroy']();});_0x1f4089['pipe'](_0x1c13f5);this[_0x5dcd('0x1f')]=function(_0x380954,_0x23a21d){var _0x380954=_0x380954||'',_0x23a21d=typeof _0x23a21d==_0x5dcd('0x10')?_0x23a21d:new Function();_0x3e2af0={'tx':_0x380954,'rx':'','cb':_0x23a21d};_0x1f4089[_0x5dcd('0x20')](_0x380954+'\x0a');},this[_0x5dcd('0x1b')]=function(){_0x1f4089[_0x5dcd('0x21')]();};}util[_0x5dcd('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x5dcd('0x23')]=function(_0x3c7054){return this[_0x5dcd('0x1f')]['sync'](this,_0x3c7054);};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x25')]=function(){return this[_0x5dcd('0x23')](_0x5dcd('0x26'));};AGIChannel[_0x5dcd('0x24')]['getData']=function(_0xf30ac6,_0x17d9ec,_0x1f7536){_0xf30ac6=_0xf30ac6===undefined?_0x5dcd('0x27'):_0xf30ac6;_0x17d9ec=_0x17d9ec===undefined?'5':_0x17d9ec;_0x1f7536=_0x1f7536===undefined?'1':_0x1f7536;return this[_0x5dcd('0x23')](util['format'](_0x5dcd('0x28'),_0xf30ac6,_0x17d9ec*0x3e8,_0x1f7536));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x29')]=function(_0x28e53f){_0x28e53f=_0x28e53f||_0x5dcd('0x2a');return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x2c'),_0x28e53f));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x2d')]=function(_0x4df421,_0x3bed3f){if(_['isArray'](_0x3bed3f)){return this['sendRequest'](util[_0x5dcd('0x2b')](_0x5dcd('0x2e'),_0x4df421,_0x3bed3f['join'](',')));}return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')]('EXEC\x20%s\x20%s',_0x4df421,_0x3bed3f));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x2f')]=function(_0xdb9851){return this[_0x5dcd('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0xdb9851));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x30')]=function(_0x513f1a){return this['sendRequest'](util[_0x5dcd('0x2b')]('SET\x20EXTENSION\x20%s',_0x513f1a));};AGIChannel[_0x5dcd('0x24')]['setPriority']=function(_0x593594){return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x31'),_0x593594));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0xd')]=function(){return this[_0x5dcd('0x23')](_0x5dcd('0x32'));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x33')]=function(_0x46c543,_0xd71429){var _0x167274=_[_0x5dcd('0x34')](_0xd71429)||_[_0x5dcd('0x35')](_0xd71429)?_0xd71429[_0x5dcd('0x36')]():_0xd71429;return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x37'),_0x46c543,_0x167274?_0x167274[_0x5dcd('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x38')]=function(_0x483aeb,_0x99d57f){return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x39'),_0x483aeb,_0x99d57f));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x3a')]=function(_0x293025,_0x53df30){return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x3b'),_0x293025,_0x53df30));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x3c')]=function(_0xc745a3,_0x51ecb5){return this['sendRequest'](util['format'](_0x5dcd('0x3d'),_0xc745a3,_0x51ecb5));};AGIChannel['prototype']['continueAt']=function(_0x5b3de0,_0x591265,_0x14d1db){_0x591265=_0x591265||this[_0x5dcd('0x3e')];_0x14d1db=_0x14d1db||0x1;this[_0x5dcd('0x2f')](_0x5b3de0);this['setExtension'](_0x591265);this[_0x5dcd('0x3f')](_0x14d1db);return this[_0x5dcd('0x29')](util[_0x5dcd('0x2b')](_0x5dcd('0x40'),_0x5b3de0,_0x591265,_0x14d1db));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x41')]=function(_0x28a5d3){return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x42'),_0x28a5d3));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x43')]=function(_0x28f560,_0x3d9c37,_0x56ed37,_0x526e25,_0x247ff4,_0x3adf36){_0x3d9c37=_0x3d9c37||_0x5dcd('0x44');_0x56ed37=_0x56ed37||'';_0x526e25=_0x526e25===undefined?-0x1:_0x526e25==='-1'?-0x1:_0x526e25*0x3e8;_0x247ff4=_0x247ff4===undefined?'':'s='+_0x247ff4;_0x3adf36=_0x3adf36?_0x5dcd('0x45'):'';return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x46'),_0x28f560,_0x3d9c37,_0x56ed37,_0x526e25,_0x3adf36,_0x247ff4));};AGIChannel['prototype'][_0x5dcd('0x47')]=function(_0x16c8f2,_0x1e1b15){_0x1e1b15=_0x1e1b15||'';return this[_0x5dcd('0x23')](util[_0x5dcd('0x2b')](_0x5dcd('0x48'),_0x16c8f2,_0x1e1b15));};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x49')]=function(_0xafe56a){return this[_0x5dcd('0x2d')](_0x5dcd('0x4a'),_0xafe56a);};AGIChannel[_0x5dcd('0x24')][_0x5dcd('0x4b')]=function(_0x1ab507){return this['exec'](_0x5dcd('0x4c'),_0x1ab507);};AGIChannel[_0x5dcd('0x24')]['error']=function(_0x37a7cd,_0x3caeab){this['noop'](util['format'](_0x5dcd('0x4d'),_0x37a7cd['id'],_0x37a7cd[_0x5dcd('0x4e')],_0x3caeab));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5dcd('0x4f')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 1f2566d..92b34c0 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 _0x5419=['name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5419,0xf1));var _0x9541=function(_0x544e5f,_0x11bfde){_0x544e5f=_0x544e5f-0x0;var _0x5e3fec=_0x5419[_0x544e5f];return _0x5e3fec;};'use strict';var util=require(_0x9541('0x0'));var error={'E_AGI_UNDEFINED':_0x9541('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x9541('0x2'),'E_AGI_SERVER_CLOSE':_0x9541('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x9541('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9541('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x9541('0x6'),'E_AGI_COMMAND_EMPTY':_0x9541('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9541('0x8'),'E_AGI_IVR_ENTRY':_0x9541('0x9')};function AGIError(_0x1d4507){var _0x1d4507=_0x1d4507||null,_0x198e2b=_0x198e2b||[],_0x3bc57e=0x1,_0x18f78a='';if(!error[_0x1d4507]){_0x1d4507=_0x9541('0xa');}_0x198e2b[_0x9541('0xb')](error[_0x1d4507]);while(arguments[_0x3bc57e]){_0x198e2b[_0x9541('0xb')](arguments[_0x3bc57e]);_0x3bc57e++;}_0x18f78a=util['format'][_0x9541('0xc')](util,_0x198e2b);this[_0x9541('0xd')]=_0x18f78a;this[_0x9541('0xe')]=_0x1d4507;}module['exports']=AGIError; \ No newline at end of file +var _0x27e1=['exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x27e1,0x69));var _0x127e=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x27e1[_0x54defc];return _0x1955d3;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x127e('0x0'),'E_AGI_ARGUMENT_PORT':_0x127e('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x127e('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x127e('0x3'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x127e('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x127e('0x5'),'E_AGI_IVR_ENTRY':_0x127e('0x6')};function AGIError(_0x46bc4d){var _0x46bc4d=_0x46bc4d||null,_0x5992b5=_0x5992b5||[],_0x6003c4=0x1,_0x593e41='';if(!error[_0x46bc4d]){_0x46bc4d='E_AGI_UNDEFINED';}_0x5992b5[_0x127e('0x7')](error[_0x46bc4d]);while(arguments[_0x6003c4]){_0x5992b5[_0x127e('0x7')](arguments[_0x6003c4]);_0x6003c4++;}_0x593e41=util[_0x127e('0x8')][_0x127e('0x9')](util,_0x5992b5);this[_0x127e('0xa')]=_0x593e41;this[_0x127e('0xb')]=_0x46bc4d;}module[_0x127e('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 1af9e60..bca8d6e 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 _0xbae7=['info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations'];(function(_0x2eabb6,_0x5879d6){var _0x15f5e0=function(_0x14e7ed){while(--_0x14e7ed){_0x2eabb6['push'](_0x2eabb6['shift']());}};_0x15f5e0(++_0x5879d6);}(_0xbae7,0x146));var _0x7bae=function(_0x44d42a,_0xe76ad8){_0x44d42a=_0x44d42a-0x0;var _0x172b8f=_0xbae7[_0x44d42a];return _0x172b8f;};'use strict';var _=require(_0x7bae('0x0'));var logger=require(_0x7bae('0x1'))(_0x7bae('0x2'));var verticesWithRetry=[_0x7bae('0x3'),_0x7bae('0x4'),_0x7bae('0x5')];var Graph=function(){this[_0x7bae('0x6')]={};this[_0x7bae('0x7')]={};this[_0x7bae('0x8')]=0x0;};Graph[_0x7bae('0x9')][_0x7bae('0xa')]=function(_0x3dbb16){this[_0x7bae('0x6')][_0x3dbb16['id']]=_0x3dbb16;this[_0x7bae('0x7')][_0x3dbb16['id']]=[];};Graph[_0x7bae('0x9')][_0x7bae('0xb')]=function(_0x4c69f3,_0x4c1ed5,_0xf7a7b3){this[_0x7bae('0x7')][_0x4c69f3][_0x7bae('0xc')]({'target':_0x4c1ed5,'condition':_0xf7a7b3});this[_0x7bae('0x8')]+=0x1;};Graph[_0x7bae('0x9')][_0x7bae('0xd')]=function(){return _[_0x7bae('0xd')](this[_0x7bae('0x6')]);};Graph[_0x7bae('0x9')][_0x7bae('0xe')]=function(){return this[_0x7bae('0x8')];};Graph[_0x7bae('0x9')]['getVertex']=function(_0x1fe836){return this[_0x7bae('0x6')][_0x1fe836];};Graph[_0x7bae('0x9')]['traverseBFS']=function(_0x1c4874,_0x3cc8e4){if(!this[_0x7bae('0x6')][_0x1c4874]){return logger[_0x7bae('0xf')](_0x7bae('0x10'));}var _0x576a33=_0x3cc8e4(this[_0x7bae('0x6')][_0x1c4874]);if(!_0x576a33){return logger['info'](_0x7bae('0x11'));}if(this[_0x7bae('0x7')][_0x1c4874][_0x7bae('0x12')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x94761d=0x0,_0x3d2232=[],_0x375c5b=![];_0x94761d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','stack','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','traverseBFS','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','syncho','util','moment','../../config/environment','../../config/logger','./rpc','./mailRpc','./graph','agi','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x231797,_0x3b2a28){var _0x129ff6=function(_0x384c3c){while(--_0x384c3c){_0x231797['push'](_0x231797['shift']());}};_0x129ff6(++_0x3b2a28);}(_0x4dd0,0x9f));var _0x04dd=function(_0x4a24c8,_0x12f048){_0x4a24c8=_0x4a24c8-0x0;var _0xb44662=_0x4dd0[_0x4a24c8];return _0xb44662;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x04dd('0x0'));var util=require(_0x04dd('0x1'));var moment=require(_0x04dd('0x2'));var config=require(_0x04dd('0x3'));var logger=require(_0x04dd('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x04dd('0x5'));var mailRpc=require(_0x04dd('0x6'));var Graph=require(_0x04dd('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x04dd('0x8')]=_['defaults'](config[_0x04dd('0x8')],{'ip':_0x04dd('0x9'),'port':0x11dd});function connectionHandler(_0x2e257f){process[_0x04dd('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2e257f);agiHandler(_0x2e257f);}catch(_0x57abe6){logger[_0x04dd('0xb')](_0x57abe6['stack']);}});});}function listeningHandler(){console[_0x04dd('0xc')](_0x04dd('0xd'),config[_0x04dd('0x8')][_0x04dd('0xe')]);logger['info'](util[_0x04dd('0xf')](_0x04dd('0x10'),config[_0x04dd('0x8')]['ip'],config[_0x04dd('0x8')][_0x04dd('0xe')]));}function errorHandler(_0x49b5d2){if(_0x49b5d2&&_0x49b5d2['name']&&_0x49b5d2[_0x04dd('0x11')]){logger[_0x04dd('0xb')](util[_0x04dd('0xf')](_0x04dd('0x12'),_0x49b5d2['name'],_0x49b5d2[_0x04dd('0x11')]));}else{logger[_0x04dd('0xb')](util['format'](_0x04dd('0x13'),_0x49b5d2['stack']));}}function closeHandler(){logger[_0x04dd('0x14')](util['format'](_0x04dd('0x15'),this[_0x04dd('0x16')],this['calleridname'],this[_0x04dd('0x17')],this[_0x04dd('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3262fa){logger['error'](_0x3262fa[_0x04dd('0x19')]);}}function timeoutHandler(){logger[_0x04dd('0x14')](util[_0x04dd('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x04dd('0x16')],this[_0x04dd('0x1a')],this[_0x04dd('0x17')],this['dnid'],this[_0x04dd('0x1b')]));}function hangupHandler(){logger[_0x04dd('0x14')](util['format'](_0x04dd('0x1c'),this[_0x04dd('0x16')],this[_0x04dd('0x1a')],this[_0x04dd('0x17')],this[_0x04dd('0x18')],this[_0x04dd('0x1b')]));this[_0x04dd('0x1d')]=!![];}function getRoot(_0x153d55){return parser[_0x04dd('0x1e')](_0x153d55,{'object':!![]})[_0x04dd('0x1f')][_0x04dd('0x20')];}function addVertex(_0x30b9f7,_0x4c6eb6,_0x4a1cf5){_0x4c6eb6['agicommand']=_0x4a1cf5;if(_0x4c6eb6[_0x04dd('0x21')](_0x04dd('0x22'))){_0x4c6eb6['maxRetry']=parseInt(_0x4c6eb6['retry'],0xa);}_0x30b9f7[_0x04dd('0x23')](_[_0x04dd('0x24')](_0x4c6eb6,_0x04dd('0x25')));}function initGraph(_0x7c55e0,_0x152eb8){var _0x58c1f0=new Graph();for(var _0x5d5761 in _0x7c55e0){if(_0x7c55e0['hasOwnProperty'](_0x5d5761)){if(_[_0x04dd('0x26')](_0x7c55e0[_0x5d5761])){for(var _0x3b3c28=0x0;_0x3b3c28<_0x7c55e0[_0x5d5761][_0x04dd('0x27')];_0x3b3c28+=0x1){addVertex(_0x58c1f0,_0x7c55e0[_0x5d5761][_0x3b3c28],_0x5d5761);}}else{addVertex(_0x58c1f0,_0x7c55e0[_0x5d5761],_0x5d5761);}}}for(var _0x214a47=0x0;_0x214a47<_0x152eb8[_0x04dd('0x27')];_0x214a47+=0x1){if(_0x152eb8[_0x214a47][_0x04dd('0x28')]&&_0x152eb8[_0x214a47][_0x04dd('0x29')]){_0x58c1f0[_0x04dd('0x2a')](_0x152eb8[_0x214a47][_0x04dd('0x28')],_0x152eb8[_0x214a47][_0x04dd('0x29')],_0x152eb8[_0x214a47][_0x04dd('0x2b')]);}}return _0x58c1f0;}function getSquareProject(_0x5bf521,_0x214c45){rpc['getSquareProject'](_0x5bf521)[_0x04dd('0x2c')](function(_0x45172d){_0x214c45(null,_0x45172d);})[_0x04dd('0x2d')](function(_0x2d7b52){_0x214c45(null,_0x2d7b52);});}function createSquareReport(_0x1d7930,_0x4dbe21){rpc[_0x04dd('0x2e')](_0x1d7930)['then'](function(_0x15de14){if(_0x4dbe21){_0x4dbe21(null,_0x15de14);}})['catch'](function(_0x538153){if(_0x4dbe21){_0x4dbe21(null,_0x538153);}});}function setChannelVariables(_0x2d56da){for(var _0x5bfe57 in _0x2d56da){if(_0x2d56da[_0x04dd('0x21')](_0x5bfe57)){if(_0x5bfe57['indexOf'](_0x04dd('0x2f'))===0x0){_0x2d56da[_0x5bfe57[_0x04dd('0x30')](0x4)]=_0x2d56da[_0x5bfe57];delete _0x2d56da[_0x5bfe57];}}}}function getLogFromObject(_0x3440e5){return util[_0x04dd('0x31')](_0x3440e5,{'showHidden':![],'depth':null});}function agiHandler(_0x351e29){var _0x19e04b,_0x2ed64b,_0x4b0a35,_0x3f80c4,_0x910dae;logger[_0x04dd('0x32')](_0x04dd('0x33'),JSON[_0x04dd('0x34')](_0x351e29,null,0x2));logger[_0x04dd('0x14')](util[_0x04dd('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x351e29[_0x04dd('0x16')],_0x351e29[_0x04dd('0x1a')],_0x351e29[_0x04dd('0x17')],_0x351e29[_0x04dd('0x18')],_0x351e29[_0x04dd('0x1b')]));_0x351e29['on'](_0x04dd('0xb'),errorHandler);_0x351e29['on'](_0x04dd('0x35'),closeHandler);_0x351e29['on'](_0x04dd('0x36'),timeoutHandler);_0x351e29['evtHangup']=![];_0x351e29['on'](_0x04dd('0x37'),hangupHandler);var _0x51d1a3=getSquareProject[_0x04dd('0x38')](null,_0x351e29[_0x04dd('0x16')]);if(_0x51d1a3){if(_0x51d1a3['production']){_0x19e04b=getRoot(_0x51d1a3[_0x04dd('0x39')]);if(_0x19e04b&&_0x19e04b[_0x04dd('0x3a')]){logger['debug'](_0x04dd('0x20'),JSON[_0x04dd('0x34')](_0x19e04b,null,0x2));_0x351e29[_0x04dd('0x3b')]=moment()[_0x04dd('0xf')](_0x04dd('0x3c'));_0x2ed64b=initGraph(_['omit'](_0x19e04b,_0x04dd('0x25')),_0x19e04b[_0x04dd('0x25')]);_0x4b0a35=new Vertices(_0x351e29,rpc,mailRpc);logger[_0x04dd('0x14')](util[_0x04dd('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x351e29[_0x04dd('0x16')],_0x351e29['calleridname'],_0x351e29[_0x04dd('0x17')],_0x351e29[_0x04dd('0x18')],_0x351e29['uniqueid']));_0x2ed64b['traverseBFS'](_0x19e04b[_0x04dd('0x3a')]['id'],function(_0x1dc00a){try{_0x1dc00a=_0x4b0a35[_0x04dd('0x3d')](_0x1dc00a);logger['debug']('vertex',JSON[_0x04dd('0x34')](_0x1dc00a,null,0x2));if(_0x1dc00a[_0x04dd('0x3e')]===_0x04dd('0x3f')){logger[_0x04dd('0x14')](_0x04dd('0x40'));_0x351e29[_0x04dd('0x41')]=_0x1dc00a[_0x04dd('0x41')]||_0x351e29[_0x04dd('0x41')];_0x351e29['extension']=_0x1dc00a['extension'];_0x351e29[_0x04dd('0x42')]=_0x1dc00a['priority']?_0x1dc00a[_0x04dd('0x42')]-0x1:0x1;return null;}else if(_0x1dc00a&&_0x4b0a35[_0x1dc00a[_0x04dd('0x3e')]]){_0x910dae=_0x4b0a35[_0x1dc00a[_0x04dd('0x3e')]](_0x1dc00a);logger[_0x04dd('0x14')](_0x04dd('0x43'),JSON[_0x04dd('0x34')](_0x910dae,null,0x2));if(_0x910dae&&_0x910dae[_0x04dd('0x44')]===AGI_CODE_SUCCESS&&_0x910dae[_0x04dd('0x45')]!==AGI_RESULT_ERROR&&!_0x351e29[_0x04dd('0x1d')]){logger['debug'](_0x04dd('0x43'),getLogFromObject(_0x910dae));return _[_0x04dd('0x46')](_0x910dae[_0x04dd('0x45')])?null:_0x910dae[_0x04dd('0x45')][_0x04dd('0x47')]();}else{logger['error']('response',getLogFromObject(_0x910dae));return null;}}else{logger[_0x04dd('0xb')](_0x04dd('0x48'));return null;}}catch(_0x1b44c0){logger[_0x04dd('0xb')](_0x1b44c0[_0x04dd('0x19')]);return null;}});if(_0x19e04b[_0x04dd('0x49')]){logger['info'](util[_0x04dd('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x351e29[_0x04dd('0x16')],_0x351e29[_0x04dd('0x1a')],_0x351e29[_0x04dd('0x17')],_0x351e29[_0x04dd('0x18')],_0x351e29[_0x04dd('0x1b')]));_0x2ed64b[_0x04dd('0x4a')](_0x19e04b[_0x04dd('0x49')]['id'],function(_0x4bf593){try{_0x4bf593=_0x4b0a35[_0x04dd('0x3d')](_0x4bf593);logger[_0x04dd('0x32')](_0x04dd('0x4b'),JSON[_0x04dd('0x34')](_0x4bf593,null,0x2));if(_0x4bf593&&_0x4b0a35[_0x4bf593['agicommand']]){_0x910dae=_0x4b0a35[_0x4bf593[_0x04dd('0x3e')]](_0x4bf593);if(_0x910dae){logger[_0x04dd('0x32')](_0x04dd('0x43'),getLogFromObject(_0x910dae));return _[_0x04dd('0x46')](_0x910dae[_0x04dd('0x45')])?null:_0x910dae[_0x04dd('0x45')][_0x04dd('0x47')]();}else{logger['error']('response',getLogFromObject(_0x910dae));return null;}}else{logger['error'](_0x04dd('0x48'));return null;}}catch(_0x2c7e86){logger[_0x04dd('0xb')](_0x2c7e86['stack']);return null;}});}logger['info'](util[_0x04dd('0xf')](_0x04dd('0x4c'),_0x351e29['arg_1'],_0x351e29[_0x04dd('0x1a')],_0x351e29['callerid'],_0x351e29[_0x04dd('0x18')],_0x351e29[_0x04dd('0x1b')]));logger[_0x04dd('0x14')](util[_0x04dd('0xf')](_0x04dd('0x4d'),_0x351e29['context'],_0x351e29[_0x04dd('0x4e')],parseInt(_0x351e29['priority'],0xa)+0x1));_0x351e29[_0x04dd('0x4f')](_0x351e29[_0x04dd('0x41')],_0x351e29['extension'],parseInt(_0x351e29[_0x04dd('0x42')],0xa)+0x1);_0x351e29[_0x04dd('0x35')]();}}else{logger[_0x04dd('0xb')](util['format'](_0x04dd('0x50'),_0x351e29['arg_1']));_0x351e29['continueAt'](_0x351e29[_0x04dd('0x41')],_0x351e29[_0x04dd('0x4e')],parseInt(_0x351e29[_0x04dd('0x42')],0xa)+0x1);_0x351e29[_0x04dd('0x35')]();}}else{logger['error'](util[_0x04dd('0xf')]('Project\x20%s\x20not\x20found',_0x351e29[_0x04dd('0x16')]));_0x351e29['continueAt'](_0x351e29[_0x04dd('0x41')],_0x351e29[_0x04dd('0x4e')],parseInt(_0x351e29['priority'],0xa)+0x1);_0x351e29['close']();}}function main(){var _0x116f30;return utilLicense[_0x04dd('0x51')]()[_0x04dd('0x2c')](function(_0xf5d678){if(_0xf5d678){if(_0xf5d678[_0x04dd('0x52')]){if(_0xf5d678[_0x04dd('0x53')]&&_0xf5d678[_0x04dd('0x53')]>0x0){logger[_0x04dd('0x14')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0xf5d678[_0x04dd('0x53')]));_0x116f30=_0xf5d678[_0x04dd('0x53')];}else{logger[_0x04dd('0x14')](_0x04dd('0x54'));}}else{logger[_0x04dd('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x116f30=-0x1;}}})[_0x04dd('0x2d')](function(_0x40e759){logger[_0x04dd('0xb')](_0x04dd('0x55'),_0x40e759[_0x04dd('0x19')]);})[_0x04dd('0x49')](function(){var _0x109211=require(_0x04dd('0x56'))(config[_0x04dd('0x8')]['port'],config[_0x04dd('0x8')]['ip'],_0x116f30);_0x109211['on'](_0x04dd('0xb'),errorHandler);_0x109211['on'](_0x04dd('0x57'),listeningHandler);_0x109211['on']('connection',connectionHandler);_0x109211['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x4bcd=['catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','mxGraphModel','root','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4bcd,0x15a));var _0xd4bc=function(_0x4d2c85,_0x173103){_0x4d2c85=_0x4d2c85-0x0;var _0x10d709=_0x4bcd[_0x4d2c85];return _0x10d709;};'use strict';var parser=require(_0xd4bc('0x0'));var _=require(_0xd4bc('0x1'));var syncho=require(_0xd4bc('0x2'));var util=require(_0xd4bc('0x3'));var moment=require(_0xd4bc('0x4'));var config=require(_0xd4bc('0x5'));var logger=require(_0xd4bc('0x6'))(_0xd4bc('0x7'));var utilLicense=require(_0xd4bc('0x8'));var rpc=require(_0xd4bc('0x9'));var mailRpc=require(_0xd4bc('0xa'));var Graph=require(_0xd4bc('0xb'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd4bc('0x7')]=_[_0xd4bc('0xc')](config[_0xd4bc('0x7')],{'ip':_0xd4bc('0xd'),'port':0x11dd});function connectionHandler(_0xdde2f5){process[_0xd4bc('0xe')](function(){syncho(function(){try{setChannelVariables(_0xdde2f5);agiHandler(_0xdde2f5);}catch(_0x441429){logger[_0xd4bc('0xf')](_0x441429['stack']);}});});}function listeningHandler(){console[_0xd4bc('0x10')](_0xd4bc('0x11'),config['agi']['port']);logger[_0xd4bc('0x12')](util[_0xd4bc('0x13')](_0xd4bc('0x14'),config['agi']['ip'],config[_0xd4bc('0x7')][_0xd4bc('0x15')]));}function errorHandler(_0x5a433c){if(_0x5a433c&&_0x5a433c[_0xd4bc('0x16')]&&_0x5a433c[_0xd4bc('0x17')]){logger['error'](util[_0xd4bc('0x13')](_0xd4bc('0x18'),_0x5a433c[_0xd4bc('0x16')],_0x5a433c[_0xd4bc('0x17')]));}else{logger[_0xd4bc('0xf')](util[_0xd4bc('0x13')]('[ERROR]\x20%s',_0x5a433c[_0xd4bc('0x19')]));}}function closeHandler(){logger[_0xd4bc('0x12')](util[_0xd4bc('0x13')](_0xd4bc('0x1a'),this[_0xd4bc('0x1b')],this[_0xd4bc('0x1c')],this[_0xd4bc('0x1d')],this[_0xd4bc('0x1e')],this[_0xd4bc('0x1f')]));try{createSquareReport(this);}catch(_0x320a9c){logger[_0xd4bc('0xf')](_0x320a9c[_0xd4bc('0x19')]);}}function timeoutHandler(){logger[_0xd4bc('0x12')](util[_0xd4bc('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xd4bc('0x1c')],this[_0xd4bc('0x1d')],this['dnid'],this[_0xd4bc('0x1f')]));}function hangupHandler(){logger['info'](util[_0xd4bc('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd4bc('0x1b')],this[_0xd4bc('0x1c')],this['callerid'],this[_0xd4bc('0x1e')],this['uniqueid']));this[_0xd4bc('0x20')]=!![];}function getRoot(_0x3b9b6e){return parser['toJson'](_0x3b9b6e,{'object':!![]})[_0xd4bc('0x21')][_0xd4bc('0x22')];}function addVertex(_0x1e4cc3,_0x474055,_0x5ecbdd){_0x474055['agicommand']=_0x5ecbdd;if(_0x474055[_0xd4bc('0x23')](_0xd4bc('0x24'))){_0x474055[_0xd4bc('0x25')]=parseInt(_0x474055['retry'],0xa);}_0x1e4cc3[_0xd4bc('0x26')](_[_0xd4bc('0x27')](_0x474055,_0xd4bc('0x28')));}function initGraph(_0x5a5849,_0x1ed72a){var _0x347328=new Graph();for(var _0x4cad12 in _0x5a5849){if(_0x5a5849[_0xd4bc('0x23')](_0x4cad12)){if(_[_0xd4bc('0x29')](_0x5a5849[_0x4cad12])){for(var _0x41eb9f=0x0;_0x41eb9f<_0x5a5849[_0x4cad12][_0xd4bc('0x2a')];_0x41eb9f+=0x1){addVertex(_0x347328,_0x5a5849[_0x4cad12][_0x41eb9f],_0x4cad12);}}else{addVertex(_0x347328,_0x5a5849[_0x4cad12],_0x4cad12);}}}for(var _0x1cb637=0x0;_0x1cb637<_0x1ed72a[_0xd4bc('0x2a')];_0x1cb637+=0x1){if(_0x1ed72a[_0x1cb637][_0xd4bc('0x2b')]&&_0x1ed72a[_0x1cb637]['target']){_0x347328[_0xd4bc('0x2c')](_0x1ed72a[_0x1cb637][_0xd4bc('0x2b')],_0x1ed72a[_0x1cb637][_0xd4bc('0x2d')],_0x1ed72a[_0x1cb637][_0xd4bc('0x2e')]);}}return _0x347328;}function getSquareProject(_0x41bc92,_0x51ad5c){rpc[_0xd4bc('0x2f')](_0x41bc92)[_0xd4bc('0x30')](function(_0x1da07a){_0x51ad5c(null,_0x1da07a);})['catch'](function(_0x30aa68){_0x51ad5c(null,_0x30aa68);});}function createSquareReport(_0x563599,_0x147510){rpc[_0xd4bc('0x31')](_0x563599)[_0xd4bc('0x30')](function(_0x3a6981){if(_0x147510){_0x147510(null,_0x3a6981);}})[_0xd4bc('0x32')](function(_0x101dbf){if(_0x147510){_0x147510(null,_0x101dbf);}});}function setChannelVariables(_0x1642f9){for(var _0x1a8c73 in _0x1642f9){if(_0x1642f9[_0xd4bc('0x23')](_0x1a8c73)){if(_0x1a8c73[_0xd4bc('0x33')](_0xd4bc('0x34'))===0x0){_0x1642f9[_0x1a8c73[_0xd4bc('0x35')](0x4)]=_0x1642f9[_0x1a8c73];delete _0x1642f9[_0x1a8c73];}}}}function getLogFromObject(_0x1a0655){return util[_0xd4bc('0x36')](_0x1a0655,{'showHidden':![],'depth':null});}function agiHandler(_0x72368e){var _0x4ddac3,_0x199b5f,_0x300772,_0x46b886,_0x1f59ff;logger[_0xd4bc('0x37')](_0xd4bc('0x38'),JSON[_0xd4bc('0x39')](_0x72368e,null,0x2));logger[_0xd4bc('0x12')](util[_0xd4bc('0x13')](_0xd4bc('0x3a'),_0x72368e[_0xd4bc('0x1b')],_0x72368e[_0xd4bc('0x1c')],_0x72368e['callerid'],_0x72368e[_0xd4bc('0x1e')],_0x72368e[_0xd4bc('0x1f')]));_0x72368e['on'](_0xd4bc('0xf'),errorHandler);_0x72368e['on'](_0xd4bc('0x3b'),closeHandler);_0x72368e['on'](_0xd4bc('0x3c'),timeoutHandler);_0x72368e[_0xd4bc('0x20')]=![];_0x72368e['on'](_0xd4bc('0x3d'),hangupHandler);var _0x1bd883=getSquareProject[_0xd4bc('0x3e')](null,_0x72368e[_0xd4bc('0x1b')]);if(_0x1bd883){if(_0x1bd883[_0xd4bc('0x3f')]){_0x4ddac3=getRoot(_0x1bd883[_0xd4bc('0x3f')]);if(_0x4ddac3&&_0x4ddac3[_0xd4bc('0x40')]){logger['debug'](_0xd4bc('0x22'),JSON[_0xd4bc('0x39')](_0x4ddac3,null,0x2));_0x72368e[_0xd4bc('0x41')]=moment()[_0xd4bc('0x13')](_0xd4bc('0x42'));_0x199b5f=initGraph(_[_0xd4bc('0x27')](_0x4ddac3,_0xd4bc('0x28')),_0x4ddac3[_0xd4bc('0x28')]);_0x300772=new Vertices(_0x72368e,rpc,mailRpc);logger[_0xd4bc('0x12')](util['format'](_0xd4bc('0x43'),_0x72368e['arg_1'],_0x72368e['calleridname'],_0x72368e['callerid'],_0x72368e[_0xd4bc('0x1e')],_0x72368e[_0xd4bc('0x1f')]));_0x199b5f[_0xd4bc('0x44')](_0x4ddac3[_0xd4bc('0x40')]['id'],function(_0x2289e5){try{_0x2289e5=_0x300772[_0xd4bc('0x45')](_0x2289e5);logger[_0xd4bc('0x37')](_0xd4bc('0x46'),JSON[_0xd4bc('0x39')](_0x2289e5,null,0x2));if(_0x2289e5[_0xd4bc('0x47')]===_0xd4bc('0x48')){logger['info'](_0xd4bc('0x49'));_0x72368e[_0xd4bc('0x4a')]=_0x2289e5[_0xd4bc('0x4a')]||_0x72368e[_0xd4bc('0x4a')];_0x72368e[_0xd4bc('0x4b')]=_0x2289e5['extension'];_0x72368e[_0xd4bc('0x4c')]=_0x2289e5['priority']?_0x2289e5['priority']-0x1:0x1;return null;}else if(_0x2289e5&&_0x300772[_0x2289e5[_0xd4bc('0x47')]]){_0x1f59ff=_0x300772[_0x2289e5[_0xd4bc('0x47')]](_0x2289e5);logger[_0xd4bc('0x12')]('response',JSON['stringify'](_0x1f59ff,null,0x2));if(_0x1f59ff&&_0x1f59ff[_0xd4bc('0x4d')]===AGI_CODE_SUCCESS&&_0x1f59ff[_0xd4bc('0x4e')]!==AGI_RESULT_ERROR&&!_0x72368e[_0xd4bc('0x20')]){logger[_0xd4bc('0x37')](_0xd4bc('0x4f'),getLogFromObject(_0x1f59ff));return _[_0xd4bc('0x50')](_0x1f59ff[_0xd4bc('0x4e')])?null:_0x1f59ff['result'][_0xd4bc('0x51')]();}else{logger[_0xd4bc('0xf')](_0xd4bc('0x4f'),getLogFromObject(_0x1f59ff));return null;}}else{logger[_0xd4bc('0xf')](_0xd4bc('0x52'));return null;}}catch(_0x520421){logger[_0xd4bc('0xf')](_0x520421[_0xd4bc('0x19')]);return null;}});if(_0x4ddac3[_0xd4bc('0x53')]){logger['info'](util['format'](_0xd4bc('0x54'),_0x72368e[_0xd4bc('0x1b')],_0x72368e[_0xd4bc('0x1c')],_0x72368e[_0xd4bc('0x1d')],_0x72368e[_0xd4bc('0x1e')],_0x72368e['uniqueid']));_0x199b5f[_0xd4bc('0x44')](_0x4ddac3[_0xd4bc('0x53')]['id'],function(_0x1c09fe){try{_0x1c09fe=_0x300772[_0xd4bc('0x45')](_0x1c09fe);logger['debug'](_0xd4bc('0x46'),JSON[_0xd4bc('0x39')](_0x1c09fe,null,0x2));if(_0x1c09fe&&_0x300772[_0x1c09fe[_0xd4bc('0x47')]]){_0x1f59ff=_0x300772[_0x1c09fe[_0xd4bc('0x47')]](_0x1c09fe);if(_0x1f59ff){logger[_0xd4bc('0x37')](_0xd4bc('0x4f'),getLogFromObject(_0x1f59ff));return _['isUndefined'](_0x1f59ff[_0xd4bc('0x4e')])?null:_0x1f59ff[_0xd4bc('0x4e')][_0xd4bc('0x51')]();}else{logger[_0xd4bc('0xf')](_0xd4bc('0x4f'),getLogFromObject(_0x1f59ff));return null;}}else{logger['error'](_0xd4bc('0x52'));return null;}}catch(_0x3f81a5){logger['error'](_0x3f81a5[_0xd4bc('0x19')]);return null;}});}logger[_0xd4bc('0x12')](util[_0xd4bc('0x13')](_0xd4bc('0x55'),_0x72368e[_0xd4bc('0x1b')],_0x72368e[_0xd4bc('0x1c')],_0x72368e[_0xd4bc('0x1d')],_0x72368e[_0xd4bc('0x1e')],_0x72368e[_0xd4bc('0x1f')]));logger['info'](util[_0xd4bc('0x13')](_0xd4bc('0x56'),_0x72368e[_0xd4bc('0x4a')],_0x72368e[_0xd4bc('0x4b')],parseInt(_0x72368e[_0xd4bc('0x4c')],0xa)+0x1));_0x72368e[_0xd4bc('0x57')](_0x72368e[_0xd4bc('0x4a')],_0x72368e[_0xd4bc('0x4b')],parseInt(_0x72368e[_0xd4bc('0x4c')],0xa)+0x1);_0x72368e[_0xd4bc('0x3b')]();}}else{logger[_0xd4bc('0xf')](util[_0xd4bc('0x13')]('Project\x20%s\x20not\x20published',_0x72368e[_0xd4bc('0x1b')]));_0x72368e[_0xd4bc('0x57')](_0x72368e[_0xd4bc('0x4a')],_0x72368e['extension'],parseInt(_0x72368e['priority'],0xa)+0x1);_0x72368e[_0xd4bc('0x3b')]();}}else{logger[_0xd4bc('0xf')](util[_0xd4bc('0x13')](_0xd4bc('0x58'),_0x72368e[_0xd4bc('0x1b')]));_0x72368e['continueAt'](_0x72368e[_0xd4bc('0x4a')],_0x72368e['extension'],parseInt(_0x72368e['priority'],0xa)+0x1);_0x72368e['close']();}}function main(){var _0x39ab3c;return utilLicense[_0xd4bc('0x59')]()[_0xd4bc('0x30')](function(_0x306550){if(_0x306550){if(_0x306550[_0xd4bc('0x5a')]){if(_0x306550[_0xd4bc('0x5b')]&&_0x306550[_0xd4bc('0x5b')]>0x0){logger['info'](util[_0xd4bc('0x13')](_0xd4bc('0x5c'),_0x306550[_0xd4bc('0x5b')]));_0x39ab3c=_0x306550[_0xd4bc('0x5b')];}else{logger['info'](_0xd4bc('0x5d'));}}else{logger[_0xd4bc('0x12')](_0xd4bc('0x5e'));_0x39ab3c=-0x1;}}})[_0xd4bc('0x32')](function(_0x13273f){logger[_0xd4bc('0xf')](_0xd4bc('0x5f'),_0x13273f[_0xd4bc('0x19')]);})[_0xd4bc('0x53')](function(){var _0x1d381a=require(_0xd4bc('0x60'))(config[_0xd4bc('0x7')]['port'],config[_0xd4bc('0x7')]['ip'],_0x39ab3c);_0x1d381a['on'](_0xd4bc('0xf'),errorHandler);_0x1d381a['on'](_0xd4bc('0x61'),listeningHandler);_0x1d381a['on'](_0xd4bc('0x62'),connectionHandler);_0x1d381a['on'](_0xd4bc('0x3b'),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 2fe11d7..b6bb855 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 _0x26ae=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error','catch'];(function(_0x22c5ef,_0x5d3656){var _0x246aca=function(_0x4ad739){while(--_0x4ad739){_0x22c5ef['push'](_0x22c5ef['shift']());}};_0x246aca(++_0x5d3656);}(_0x26ae,0xb6));var _0xe26a=function(_0x1ec4e0,_0x36a767){_0x1ec4e0=_0x1ec4e0-0x0;var _0x10e3fa=_0x26ae[_0x1ec4e0];return _0x10e3fa;};'use strict';var BPromise=require(_0xe26a('0x0'));var jayson=require(_0xe26a('0x1'));var client=jayson[_0xe26a('0x2')][_0xe26a('0x3')]({'port':0x232b});function request(_0x1731d8,_0x1161bd){return new BPromise(function(_0x10a67b,_0x10e18c){return client['request'](_0x1731d8,_0x1161bd)[_0xe26a('0x4')](function(_0x43f400){if(_0x43f400[_0xe26a('0x5')]){return _0x10e18c(_0x43f400[_0xe26a('0x5')]['message']);}else{return _0x10a67b(_0x43f400['result']);}})[_0xe26a('0x6')](function(_0x50be16){return _0x10e18c(_0x50be16);});});}exports[_0xe26a('0x7')]=function(_0x17b929,_0x1c0b79){return request(_0xe26a('0x8'),{'account':_0x17b929,'message':_0x1c0b79});}; \ No newline at end of file +var _0x3117=['client','http','request','then','error','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3117,0x6c));var _0x7311=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x3117[_0x68c979];return _0x4f0001;};'use strict';var BPromise=require(_0x7311('0x0'));var jayson=require(_0x7311('0x1'));var client=jayson[_0x7311('0x2')][_0x7311('0x3')]({'port':0x232b});function request(_0x3182eb,_0x58bfdf){return new BPromise(function(_0x42cbb7,_0x2f7aaf){return client[_0x7311('0x4')](_0x3182eb,_0x58bfdf)[_0x7311('0x5')](function(_0x325331){if(_0x325331[_0x7311('0x6')]){return _0x2f7aaf(_0x325331['error']['message']);}else{return _0x42cbb7(_0x325331[_0x7311('0x7')]);}})[_0x7311('0x8')](function(_0x3253a6){return _0x2f7aaf(_0x3253a6);});});}exports[_0x7311('0x9')]=function(_0x575159,_0x4858ac){return request('SendMail',{'account':_0x575159,'message':_0x4858ac});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 2ff0a66..f127658 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 _0xe0da=['util','stream','_localBuffer','inherits','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','slice','trim','length','emit','headers','line','exports'];(function(_0x6dd3c1,_0x53cf52){var _0xdef05a=function(_0x26a262){while(--_0x26a262){_0x6dd3c1['push'](_0x6dd3c1['shift']());}};_0xdef05a(++_0x53cf52);}(_0xe0da,0xd0));var _0xae0d=function(_0x45c93c,_0x56b171){_0x45c93c=_0x45c93c-0x0;var _0x49c542=_0xe0da[_0x45c93c];return _0x49c542;};'use strict';var util=require(_0xae0d('0x0'));var Transform=require(_0xae0d('0x1'))['Transform'];function AGIReply(_0x44f469){Transform['call'](this,_0x44f469);this[_0xae0d('0x2')]='';this['_inBody']=![];}util[_0xae0d('0x3')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x214c47,_0x3fad61,_0x4c4467){var _0x17959d='\x0a',_0x1cf55f=['\x0a\x0a',_0xae0d('0x4')],_0x370ca4=-0x1,_0x1acafa=-0x1,_0x21651c='',_0xd3aeae=0x0,_0x246541='',_0x20cc2e='';this['_localBuffer']+=_0x214c47[_0xae0d('0x5')]();_0x246541=this['_localBuffer'];if(!this[_0xae0d('0x6')]){_0xd3aeae=0x0;while(_0x1cf55f[_0xd3aeae]){while((_0x1acafa=_0x246541[_0xae0d('0x7')](_0x1cf55f[_0xd3aeae]))!=-0x1){_0x21651c=_0x1cf55f[_0xd3aeae];_0x20cc2e=_0x246541[_0xae0d('0x8')](0x0,_0x1acafa);_0x246541=_0x246541[_0xae0d('0x8')](_0x1acafa+_0x21651c['length']);var _0x54a80f=_0x20cc2e['split'](_0x17959d),_0x113be3=0x0,_0x360b83={},_0x98b23b='',_0x43ac32='',_0x5d2e0b=-0x1;while(_0x54a80f[_0x113be3]){_0x5d2e0b=_0x54a80f[_0x113be3][_0xae0d('0x7')](':');if(_0x5d2e0b!=-0x1){_0x98b23b=_0x54a80f[_0x113be3][_0xae0d('0x9')](0x0,_0x5d2e0b)[_0xae0d('0xa')]();_0x43ac32=_0x54a80f[_0x113be3]['slice'](_0x5d2e0b+0x1)['trim']();if(_0x98b23b[_0xae0d('0xb')]>0x0){_0x360b83[_0x98b23b]=_0x43ac32;}}else{}_0x113be3++;}this[_0xae0d('0xc')](_0xae0d('0xd'),_0x360b83);this[_0xae0d('0x6')]=!![];}_0xd3aeae++;}this[_0xae0d('0x2')]=_0x246541;}else{while((_0x370ca4=_0x246541[_0xae0d('0x7')](_0x17959d))!=-0x1){_0x20cc2e=_0x246541[_0xae0d('0x8')](0x0,_0x370ca4);this[_0xae0d('0xc')](_0xae0d('0xe'),_0x20cc2e);_0x246541=_0x246541['substring'](_0x370ca4+_0x17959d[_0xae0d('0xb')]);}this[_0xae0d('0x2')]=_0x246541;}_0x4c4467();};module[_0xae0d('0xf')]=AGIReply; \ No newline at end of file +var _0xa769=['Transform','call','_inBody','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0xa769,0xfb));var _0x9a76=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa769[_0x13d07a];return _0x5ee0ee;};'use strict';var util=require(_0x9a76('0x0'));var Transform=require('stream')[_0x9a76('0x1')];function AGIReply(_0x11c233){Transform[_0x9a76('0x2')](this,_0x11c233);this['_localBuffer']='';this[_0x9a76('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x9a76('0x4')]=function(_0x3c277c,_0x5d32a5,_0x24761d){var _0x29af51='\x0a',_0x39b607=['\x0a\x0a',_0x9a76('0x5')],_0x4306d9=-0x1,_0x1556d6=-0x1,_0xe396ab='',_0x3c2b2e=0x0,_0x54ebea='',_0x1df87b='';this[_0x9a76('0x6')]+=_0x3c277c[_0x9a76('0x7')]();_0x54ebea=this['_localBuffer'];if(!this['_inBody']){_0x3c2b2e=0x0;while(_0x39b607[_0x3c2b2e]){while((_0x1556d6=_0x54ebea[_0x9a76('0x8')](_0x39b607[_0x3c2b2e]))!=-0x1){_0xe396ab=_0x39b607[_0x3c2b2e];_0x1df87b=_0x54ebea['substring'](0x0,_0x1556d6);_0x54ebea=_0x54ebea[_0x9a76('0x9')](_0x1556d6+_0xe396ab[_0x9a76('0xa')]);var _0x5417a3=_0x1df87b[_0x9a76('0xb')](_0x29af51),_0x3c2e0d=0x0,_0x323a02={},_0x5852f9='',_0x34b7c9='',_0x30d1be=-0x1;while(_0x5417a3[_0x3c2e0d]){_0x30d1be=_0x5417a3[_0x3c2e0d][_0x9a76('0x8')](':');if(_0x30d1be!=-0x1){_0x5852f9=_0x5417a3[_0x3c2e0d][_0x9a76('0xc')](0x0,_0x30d1be)[_0x9a76('0xd')]();_0x34b7c9=_0x5417a3[_0x3c2e0d][_0x9a76('0xc')](_0x30d1be+0x1)[_0x9a76('0xd')]();if(_0x5852f9[_0x9a76('0xa')]>0x0){_0x323a02[_0x5852f9]=_0x34b7c9;}}else{}_0x3c2e0d++;}this[_0x9a76('0xe')](_0x9a76('0xf'),_0x323a02);this[_0x9a76('0x3')]=!![];}_0x3c2b2e++;}this[_0x9a76('0x6')]=_0x54ebea;}else{while((_0x4306d9=_0x54ebea['indexOf'](_0x29af51))!=-0x1){_0x1df87b=_0x54ebea[_0x9a76('0x9')](0x0,_0x4306d9);this['emit'](_0x9a76('0x10'),_0x1df87b);_0x54ebea=_0x54ebea[_0x9a76('0x9')](_0x4306d9+_0x29af51[_0x9a76('0xa')]);}this[_0x9a76('0x6')]=_0x54ebea;}_0x24761d();};module[_0x9a76('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 1c17b8f..79c0528 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 _0x0d6a=['createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage'];(function(_0x1d2bb9,_0x90d7d8){var _0x4ff1c4=function(_0x46187c){while(--_0x46187c){_0x1d2bb9['push'](_0x1d2bb9['shift']());}};_0x4ff1c4(++_0x90d7d8);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x0d6a[_0x174ef5];return _0x1cc379;};'use strict';var BPromise=require(_0xa0d6('0x0'));var moment=require(_0xa0d6('0x1'));var _=require('lodash');var util=require(_0xa0d6('0x2'));var jayson=require(_0xa0d6('0x3'));var client=jayson[_0xa0d6('0x4')][_0xa0d6('0x5')]({'port':0x2329});function request(_0x71d654,_0x236047){return new BPromise(function(_0x344b8d,_0x3454b6){return client[_0xa0d6('0x6')](_0x71d654,_0x236047)[_0xa0d6('0x7')](function(_0x4857ce){if(_0x4857ce[_0xa0d6('0x8')]){return _0x3454b6(_0x4857ce[_0xa0d6('0x8')][_0xa0d6('0x9')]);}else{return _0x344b8d(_0x4857ce[_0xa0d6('0xa')]);}})[_0xa0d6('0xb')](function(_0x5d0e69){return _0x3454b6(_0x5d0e69);});});}exports[_0xa0d6('0xc')]=function(_0x54c2bc){return request(_0xa0d6('0xd'),{'options':{'raw':![],'where':{'name':_0x54c2bc},'attributes':['production']}});};exports[_0xa0d6('0xe')]=function(_0x489f97){return request(_0xa0d6('0xf'),{'options':{'raw':![],'where':{'id':_0x489f97},'include':[{'model':_0xa0d6('0x10'),'as':_0xa0d6('0x11')}],'attributes':['id',_0xa0d6('0x12'),_0xa0d6('0x13')]}});};exports[_0xa0d6('0x14')]=function(_0x48aba2){return request(_0xa0d6('0xd'),{'options':{'where':{'id':_0x48aba2},'attributes':[_0xa0d6('0x12')]}});};exports[_0xa0d6('0x15')]=function(_0x5db766){return request(_0xa0d6('0x16'),{'options':{'where':{'id':_0x5db766},'attributes':[_0xa0d6('0x12')]}});};exports[_0xa0d6('0x17')]=function(_0x31b97b){return request(_0xa0d6('0x18'),{'options':{'where':{'id':_0x31b97b},'attributes':[_0xa0d6('0x12')]}});};exports[_0xa0d6('0x19')]=function(_0x4a0f3a){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4a0f3a},'attributes':[_0xa0d6('0x1a')]}});};exports[_0xa0d6('0x1b')]=function(_0xb21e34){return request(_0xa0d6('0x1c'),{'options':{'where':{'id':_0xb21e34},'attributes':[_0xa0d6('0x12')]}});};exports[_0xa0d6('0x1d')]=function(_0x82e7b6){return request('GetContactByPhone',{'options':{'where':{'phone':_0x82e7b6[_0xa0d6('0x1e')]},'attributes':['id']}});};exports[_0xa0d6('0x1f')]=function(_0x20c387){return request('ShowTrunk',{'options':{'where':{'id':_0x20c387},'attributes':[_0xa0d6('0x12')]}});};exports['getSoundById']=function(_0x1dc618){return request('ShowSound',{'options':{'where':{'id':_0x1dc618},'attributes':[_0xa0d6('0x20')]}});};exports[_0xa0d6('0x21')]=function(_0x205cff){return request(_0xa0d6('0x22'),{'options':{'raw':![],'where':{'id':_0x205cff},'include':[{'model':_0xa0d6('0x23'),'as':_0xa0d6('0x24')}]}});};exports['getSmsAccountById']=function(_0x1cff6f){return request(_0xa0d6('0x25'),{'options':{'where':{'id':_0x1cff6f},'attributes':['id','name']}});};exports[_0xa0d6('0x26')]=function(_0x51c67e){return request('CreateSmsMessage',{'body':_0x51c67e});};exports[_0xa0d6('0x27')]=function(_0x222152){return request(_0xa0d6('0x28'),{'body':_0x222152});};exports[_0xa0d6('0x29')]=function(_0x469c42){return request(_0xa0d6('0x2a'),{'body':_[_0xa0d6('0x2b')](_0x469c42,{'project_name':_0x469c42[_0xa0d6('0x2c')],'prev_project_name':_0x469c42[_0xa0d6('0x2d')]||'','is_subproject':_0x469c42[_0xa0d6('0x2d')]?!![]:![],'leaveAt':moment()['format'](_0xa0d6('0x2e'))})});};exports[_0xa0d6('0x2f')]=function(_0x621e42){return request(_0xa0d6('0x30'),{'body':_0x621e42});};exports[_0xa0d6('0x31')]=function(_0x502eef){return request(_0xa0d6('0x32'),{'body':_0x502eef});};exports[_0xa0d6('0x33')]=function(_0xcb7cf2){return request(_0xa0d6('0x34'),{'options':{'raw':![],'where':{'phone':_0xcb7cf2[_0xa0d6('0x1e')],'ListId':_0xcb7cf2[_0xa0d6('0x35')]}}})[_0xa0d6('0x7')](function(_0x382a37){if(_0x382a37){return _0x382a37;}return request(_0xa0d6('0x36'),{'body':_0xcb7cf2});});};exports[_0xa0d6('0x37')]=function(_0x1fee4c){return request(_0xa0d6('0x38'),{'options':{'where':{'id':_0x1fee4c},'attributes':[_0xa0d6('0x12')]}});};exports[_0xa0d6('0x39')]=function(_0x184a5a,_0x2f5c71){return request(_0xa0d6('0x3a'),{'body':{'interface':_0x2f5c71},'options':{'where':_0x184a5a}});};exports[_0xa0d6('0x3b')]=function(_0x4a30e1,_0x1a811f,_0x47eb24){return request(_0xa0d6('0x3c'),{'body':{'type':_0x1a811f,'uniqueid':_0x47eb24},'options':{'where':_0x4a30e1}});};exports[_0xa0d6('0x3d')]=function(_0x369196){return request('UnpauseUser',{'body':{},'options':{'where':_0x369196}});};exports[_0xa0d6('0x3e')]=function(_0xfb9108){return request('LogoutUser',{'body':{},'options':{'where':_0xfb9108}});}; \ No newline at end of file +var _0x446c=['arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','then','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1'];(function(_0x96e871,_0x2ad25b){var _0x41e0ca=function(_0x48924e){while(--_0x48924e){_0x96e871['push'](_0x96e871['shift']());}};_0x41e0ca(++_0x2ad25b);}(_0x446c,0x156));var _0xc446=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x446c[_0x1526e1];return _0x249a1e;};'use strict';var BPromise=require(_0xc446('0x0'));var moment=require(_0xc446('0x1'));var _=require(_0xc446('0x2'));var util=require(_0xc446('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xc446('0x4')][_0xc446('0x5')]({'port':0x2329});function request(_0xd67fc7,_0x570a67){return new BPromise(function(_0x10047a,_0x5904ff){return client['request'](_0xd67fc7,_0x570a67)[_0xc446('0x6')](function(_0x235050){if(_0x235050['error']){return _0x5904ff(_0x235050['error'][_0xc446('0x7')]);}else{return _0x10047a(_0x235050[_0xc446('0x8')]);}})[_0xc446('0x9')](function(_0x43a9b3){return _0x5904ff(_0x43a9b3);});});}exports[_0xc446('0xa')]=function(_0x4a2a80){return request(_0xc446('0xb'),{'options':{'raw':![],'where':{'name':_0x4a2a80},'attributes':[_0xc446('0xc')]}});};exports[_0xc446('0xd')]=function(_0x3783d9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3783d9},'include':[{'model':_0xc446('0xe'),'as':_0xc446('0xf')}],'attributes':['id',_0xc446('0x10'),_0xc446('0x11')]}});};exports[_0xc446('0x12')]=function(_0x6a5c0f){return request(_0xc446('0xb'),{'options':{'where':{'id':_0x6a5c0f},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x13')]=function(_0x2bc17f){return request(_0xc446('0x14'),{'options':{'where':{'id':_0x2bc17f},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x15')]=function(_0x72faac){return request(_0xc446('0x16'),{'options':{'where':{'id':_0x72faac},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x17')]=function(_0x20e51b){return request(_0xc446('0x18'),{'options':{'where':{'id':_0x20e51b},'attributes':['dsn']}});};exports[_0xc446('0x19')]=function(_0x2f90bc){return request(_0xc446('0x1a'),{'options':{'where':{'id':_0x2f90bc},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x1b')]=function(_0x274040){return request(_0xc446('0x1c'),{'options':{'where':{'phone':_0x274040[_0xc446('0x1d')]},'attributes':['id']}});};exports[_0xc446('0x1e')]=function(_0x606af1){return request('ShowTrunk',{'options':{'where':{'id':_0x606af1},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x1f')]=function(_0x5cd0c1){return request(_0xc446('0x20'),{'options':{'where':{'id':_0x5cd0c1},'attributes':[_0xc446('0x21')]}});};exports[_0xc446('0x22')]=function(_0x434c94){return request(_0xc446('0x23'),{'options':{'raw':![],'where':{'id':_0x434c94},'include':[{'model':_0xc446('0x24'),'as':_0xc446('0x25')}]}});};exports[_0xc446('0x26')]=function(_0x218b2b){return request(_0xc446('0x27'),{'options':{'where':{'id':_0x218b2b},'attributes':['id','name']}});};exports[_0xc446('0x28')]=function(_0x1ea08b){return request(_0xc446('0x29'),{'body':_0x1ea08b});};exports[_0xc446('0x2a')]=function(_0x3596f4){return request(_0xc446('0x2b'),{'body':_0x3596f4});};exports[_0xc446('0x2c')]=function(_0x1b785a){return request(_0xc446('0x2d'),{'body':_[_0xc446('0x2e')](_0x1b785a,{'project_name':_0x1b785a[_0xc446('0x2f')],'prev_project_name':_0x1b785a[_0xc446('0x30')]||'','is_subproject':_0x1b785a[_0xc446('0x30')]?!![]:![],'leaveAt':moment()[_0xc446('0x31')](_0xc446('0x32'))})});};exports[_0xc446('0x33')]=function(_0x465e18){return request('CreateSquareRecording',{'body':_0x465e18});};exports[_0xc446('0x34')]=function(_0x24943b){return request(_0xc446('0x35'),{'body':_0x24943b});};exports[_0xc446('0x36')]=function(_0x215cd6){return request(_0xc446('0x37'),{'options':{'raw':![],'where':{'phone':_0x215cd6['phone'],'ListId':_0x215cd6['ListId']}}})[_0xc446('0x6')](function(_0x1b2dc8){if(_0x1b2dc8){return _0x1b2dc8;}return request(_0xc446('0x38'),{'body':_0x215cd6});});};exports[_0xc446('0x39')]=function(_0x4ea05e){return request(_0xc446('0x3a'),{'options':{'where':{'id':_0x4ea05e},'attributes':[_0xc446('0x10')]}});};exports[_0xc446('0x3b')]=function(_0x16be29,_0x1bd4e6){return request(_0xc446('0x3c'),{'body':{'interface':_0x1bd4e6},'options':{'where':_0x16be29}});};exports[_0xc446('0x3d')]=function(_0x45b7c4,_0x300110,_0xfdec0b){return request('PauseUser',{'body':{'type':_0x300110,'uniqueid':_0xfdec0b},'options':{'where':_0x45b7c4}});};exports['agentUnpause']=function(_0x4c1b7c){return request(_0xc446('0x3e'),{'body':{},'options':{'where':_0x4c1b7c}});};exports[_0xc446('0x3f')]=function(_0x340914){return request(_0xc446('0x40'),{'body':{},'options':{'where':_0x340914}});}; \ 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 28cfe96..53cb257 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 polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x31f0=['exports','./polly'];(function(_0x3977ff,_0x43165f){var _0x9ea7a5=function(_0x5569e7){while(--_0x5569e7){_0x3977ff['push'](_0x3977ff['shift']());}};_0x9ea7a5(++_0x43165f);}(_0x31f0,0xb7));var _0x031f=function(_0x414e9c,_0x4d14c7){_0x414e9c=_0x414e9c-0x0;var _0x46edfe=_0x31f0[_0x414e9c];return _0x46edfe;};var polly=require(_0x031f('0x0'));var lex=require('./lex');module[_0x031f('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c3e5a43..742b308 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 _0x55e0=['./lib/api','exports'];(function(_0x530433,_0x29e335){var _0x1363be=function(_0x1f09c4){while(--_0x1f09c4){_0x530433['push'](_0x530433['shift']());}};_0x1363be(++_0x29e335);}(_0x55e0,0xdc));var _0x055e=function(_0x4fe681,_0x394488){_0x4fe681=_0x4fe681-0x0;var _0x17d65e=_0x55e0[_0x4fe681];return _0x17d65e;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ No newline at end of file +var _0x4483=['exports','./lib/api'];(function(_0x325153,_0x92ab37){var _0xf70a8f=function(_0x5790cc){while(--_0x5790cc){_0x325153['push'](_0x325153['shift']());}};_0xf70a8f(++_0x92ab37);}(_0x4483,0x1a3));var _0x3448=function(_0x420b9f,_0x528597){_0x420b9f=_0x420b9f-0x0;var _0x26a136=_0x4483[_0x420b9f];return _0x26a136;};'use strict';var lex=require(_0x3448('0x0'));module[_0x3448('0x1')]=function(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178){return lex(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178);}; \ 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 9c56b2b..083d382 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(_0x2bae01,_0x59ac23){var _0x4de0c7=function(_0x68344d){while(--_0x68344d){_0x2bae01['push'](_0x2bae01['shift']());}};_0x4de0c7(++_0x59ac23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x106818,_0x3dca2f){var _0x329fc1=function(_0x23c896){while(--_0x23c896){_0x106818['push'](_0x106818['shift']());}};_0x329fc1(++_0x3dca2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 55c855a..3e5c797 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 _0xee3a=['./lib/api'];(function(_0x52ab89,_0x58a774){var _0x5e689d=function(_0x348888){while(--_0x348888){_0x52ab89['push'](_0x52ab89['shift']());}};_0x5e689d(++_0x58a774);}(_0xee3a,0x144));var _0xaee3=function(_0x3f022f,_0x39d7cb){_0x3f022f=_0x3f022f-0x0;var _0x279def=_0xee3a[_0x3f022f];return _0x279def;};'use strict';var polly=require(_0xaee3('0x0'));module['exports']=function(_0xecf6af,_0x37d22c,_0x3dd2bf,_0x3d1bb5,_0x3f5e22,_0x148965,_0x586bd2){return polly(_0xecf6af,_0x37d22c,_0x3dd2bf,_0x3d1bb5,_0x3f5e22,_0x148965,_0x586bd2);}; \ No newline at end of file +var _0x87b1=['./lib/api','exports'];(function(_0x20f060,_0xe160c9){var _0x46077c=function(_0x3c615a){while(--_0x3c615a){_0x20f060['push'](_0x20f060['shift']());}};_0x46077c(++_0xe160c9);}(_0x87b1,0x186));var _0x187b=function(_0x1274bc,_0xb5bc3a){_0x1274bc=_0x1274bc-0x0;var _0x1db8ef=_0x87b1[_0x1274bc];return _0x1db8ef;};'use strict';var polly=require(_0x187b('0x0'));module[_0x187b('0x1')]=function(_0x1098e3,_0x425aeb,_0x4c5311,_0x155ef4,_0x2ec600,_0x2e68ba,_0x142a4d){return polly(_0x1098e3,_0x425aeb,_0x4c5311,_0x155ef4,_0x2ec600,_0x2e68ba,_0x142a4d);}; \ 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 bc8be3e..7692cc5 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 _0xd2fc=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2fc,0x1da));var _0xcd2f=function(_0xd57da2,_0x209fdf){_0xd57da2=_0xd57da2-0x0;var _0x76938c=_0xd2fc[_0xd57da2];return _0x76938c;};'use strict';var fs=require('fs');var path=require(_0xcd2f('0x0'));var BPromise=require('bluebird');var rs=require(_0xcd2f('0x1'));var AWS=require(_0xcd2f('0x2'));function pollyResult(_0x1b3c80,_0xf448b4,_0x1b6f7f){return new BPromise(function(_0x4b7792,_0x27800f){_0x1b3c80[_0xcd2f('0x3')](_0xf448b4,function(_0x5ec147,_0x4a2c55){if(_0x5ec147){_0x27800f(_0x5ec147);}else if(_0x4a2c55){if(_0x4a2c55[_0xcd2f('0x4')]instanceof Buffer){fs[_0xcd2f('0x5')](_0x1b6f7f,_0x4a2c55[_0xcd2f('0x4')],function(_0x371c18){if(_0x371c18){_0x27800f(_0x371c18);}else{_0x4b7792();}});}else{_0x27800f(new Error(_0xcd2f('0x6')));}}else{_0x27800f(new Error(_0xcd2f('0x7')));}});});}module[_0xcd2f('0x8')]=function(_0x353c74,_0xab4573,_0x5e080c,_0x4ed0b3,_0x3fdff3,_0x571caa,_0x53e36f){var _0xfbd09f=new AWS[(_0xcd2f('0x9'))]({'accessKeyId':_0x353c74,'secretAccessKey':_0xab4573,'region':_0x5e080c});var _0x322395={'Text':_0x3fdff3,'TextType':_0x571caa||_0xcd2f('0xa'),'OutputFormat':_0xcd2f('0xb'),'VoiceId':_0x4ed0b3};return pollyResult(_0xfbd09f,_0x322395,_0x53e36f);}; \ No newline at end of file +var _0xf5df=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x5c17f3,_0x13b530){var _0x2eaab8=function(_0x301abc){while(--_0x301abc){_0x5c17f3['push'](_0x5c17f3['shift']());}};_0x2eaab8(++_0x13b530);}(_0xf5df,0x65));var _0xff5d=function(_0x4b6835,_0x2b9054){_0x4b6835=_0x4b6835-0x0;var _0x362ae8=_0xf5df[_0x4b6835];return _0x362ae8;};'use strict';var fs=require('fs');var path=require(_0xff5d('0x0'));var BPromise=require(_0xff5d('0x1'));var rs=require('randomstring');var AWS=require(_0xff5d('0x2'));function pollyResult(_0xf28809,_0x478932,_0x3689a7){return new BPromise(function(_0x11b002,_0x59b568){_0xf28809[_0xff5d('0x3')](_0x478932,function(_0x21a3f8,_0x26c67c){if(_0x21a3f8){_0x59b568(_0x21a3f8);}else if(_0x26c67c){if(_0x26c67c['AudioStream']instanceof Buffer){fs[_0xff5d('0x4')](_0x3689a7,_0x26c67c[_0xff5d('0x5')],function(_0xeee4dd){if(_0xeee4dd){_0x59b568(_0xeee4dd);}else{_0x11b002();}});}else{_0x59b568(new Error(_0xff5d('0x6')));}}else{_0x59b568(new Error(_0xff5d('0x7')));}});});}module[_0xff5d('0x8')]=function(_0x5db102,_0x481d7,_0x476781,_0x1644f9,_0x2355e1,_0x32566c,_0x23741a){var _0x1eccae=new AWS[(_0xff5d('0x9'))]({'accessKeyId':_0x5db102,'secretAccessKey':_0x481d7,'region':_0x476781});var _0x11f68f={'Text':_0x2355e1,'TextType':_0x32566c||_0xff5d('0xa'),'OutputFormat':_0xff5d('0xb'),'VoiceId':_0x1644f9};return pollyResult(_0x1eccae,_0x11f68f,_0x23741a);}; \ 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 4ce427e..3a71137 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 _0xc370=['exports','./lib/api'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xc370,0x131));var _0x0c37=function(_0x495f27,_0x57ef36){_0x495f27=_0x495f27-0x0;var _0x22b8e9=_0xc370[_0x495f27];return _0x22b8e9;};'use strict';var asr=require(_0x0c37('0x0'));module[_0x0c37('0x1')]=function(_0x47b256,_0x4ac2d4,_0x155925,_0xd90b47){return asr(_0x47b256,_0x4ac2d4,_0x155925);}; \ No newline at end of file +var _0xeb58=['exports','./lib/api'];(function(_0xabc0c8,_0xb3ca38){var _0x4781b0=function(_0xa790a7){while(--_0xa790a7){_0xabc0c8['push'](_0xabc0c8['shift']());}};_0x4781b0(++_0xb3ca38);}(_0xeb58,0x1e3));var _0x8eb5=function(_0x4c8fa3,_0x12a507){_0x4c8fa3=_0x4c8fa3-0x0;var _0x3e0b0f=_0xeb58[_0x4c8fa3];return _0x3e0b0f;};'use strict';var asr=require(_0x8eb5('0x0'));module[_0x8eb5('0x1')]=function(_0x33123c,_0x3d56de,_0x42f4e6,_0xf35728){return asr(_0x33123c,_0x3d56de,_0x42f4e6);}; \ 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 c981f8a..5a83d12 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 _0xde2c=['LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x27bf0d,_0x3b9234){var _0xf6c46d=function(_0x2371ca){while(--_0x2371ca){_0x27bf0d['push'](_0x27bf0d['shift']());}};_0xf6c46d(++_0x3b9234);}(_0xde2c,0x7f));var _0xcde2=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xde2c[_0x492535];return _0x256620;};'use strict';var url=require(_0xcde2('0x0'));var BPromise=require(_0xcde2('0x1'));var fs=require('fs');var host=_0xcde2('0x2');module[_0xcde2('0x3')]=function(_0x7595ed,_0x40fa0a,_0x33bb0c){return new BPromise(function(_0x3a309f,_0x55c175){var _0x4353c8;if(typeof _0x7595ed!==_0xcde2('0x4')||_0x7595ed[_0xcde2('0x5')]===0x0){return _0x55c175(_0xcde2('0x6'));}if(typeof _0x40fa0a!==_0xcde2('0x4')||_0x40fa0a['length']===0x0){return _0x55c175(_0xcde2('0x7'));}if(typeof _0x33bb0c!==_0xcde2('0x8')&&(typeof _0x33bb0c!==_0xcde2('0x4')||_0x33bb0c['length']===0x0)){return _0x55c175('lang\x20should\x20be\x20a\x20string');}try{_0x4353c8=fs[_0xcde2('0x9')](_0x7595ed)[_0xcde2('0xa')]('base64');}catch(_0x181a73){return _0x55c175(_0x181a73);}return _0x3a309f({'method':_0xcde2('0xb'),'uri':host+_0xcde2('0xc')+_0x40fa0a,'body':{'config':{'encoding':_0xcde2('0xd'),'sampleRateHertz':'8000','languageCode':_0x33bb0c},'audio':{'content':_0x4353c8}},'json':!![]});});}; \ No newline at end of file +var _0x6921=['/v1/speech:recognize?key=','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST'];(function(_0x72e22f,_0x4f4842){var _0x273ef7=function(_0x86e18e){while(--_0x86e18e){_0x72e22f['push'](_0x72e22f['shift']());}};_0x273ef7(++_0x4f4842);}(_0x6921,0x1d1));var _0x1692=function(_0x18b64c,_0x44d2aa){_0x18b64c=_0x18b64c-0x0;var _0x28a753=_0x6921[_0x18b64c];return _0x28a753;};'use strict';var url=require('url');var BPromise=require(_0x1692('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x1692('0x1')]=function(_0x557c3c,_0x434ea2,_0x13a03b){return new BPromise(function(_0x4ac00c,_0x3995b3){var _0x577497;if(typeof _0x557c3c!==_0x1692('0x2')||_0x557c3c[_0x1692('0x3')]===0x0){return _0x3995b3(_0x1692('0x4'));}if(typeof _0x434ea2!==_0x1692('0x2')||_0x434ea2[_0x1692('0x3')]===0x0){return _0x3995b3(_0x1692('0x5'));}if(typeof _0x13a03b!==_0x1692('0x6')&&(typeof _0x13a03b!==_0x1692('0x2')||_0x13a03b[_0x1692('0x3')]===0x0)){return _0x3995b3(_0x1692('0x7'));}try{_0x577497=fs[_0x1692('0x8')](_0x557c3c)['toString'](_0x1692('0x9'));}catch(_0x4ef77e){return _0x3995b3(_0x4ef77e);}return _0x4ac00c({'method':_0x1692('0xa'),'uri':host+_0x1692('0xb')+_0x434ea2,'body':{'config':{'encoding':_0x1692('0xc'),'sampleRateHertz':_0x1692('0xd'),'languageCode':_0x13a03b},'audio':{'content':_0x577497}},'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 5ae9c63..7e814c4 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 _0xdf8d=['exports','./asr'];(function(_0x423836,_0x2d438d){var _0x1d9500=function(_0x805dd0){while(--_0x805dd0){_0x423836['push'](_0x423836['shift']());}};_0x1d9500(++_0x2d438d);}(_0xdf8d,0x109));var _0xddf8=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xdf8d[_0x2fee96];return _0x2e6ad1;};var asr=require(_0xddf8('0x0'));module[_0xddf8('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd34d=['./asr'];(function(_0x54496d,_0x5b8572){var _0x40e626=function(_0xb6475c){while(--_0xb6475c){_0x54496d['push'](_0x54496d['shift']());}};_0x40e626(++_0x5b8572);}(_0xd34d,0x6b));var _0xdd34=function(_0x202692,_0xe9c688){_0x202692=_0x202692-0x0;var _0x1e7eda=_0xd34d[_0x202692];return _0x1e7eda;};var asr=require(_0xdd34('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 2405ee2..f2d4115 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 _0x55f8=['input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','asr','results','map','transcript','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','https:','data','transcode','wav','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml'];(function(_0x152405,_0x5e8952){var _0x46647a=function(_0x4608b5){while(--_0x4608b5){_0x152405['push'](_0x152405['shift']());}};_0x46647a(++_0x5e8952);}(_0x55f8,0x166));var _0x855f=function(_0x5af45e,_0x1a09be){_0x5af45e=_0x5af45e-0x0;var _0x30dbca=_0x55f8[_0x5af45e];return _0x30dbca;};'use strict';var apiai=require(_0x855f('0x0'));var BPromise=require(_0x855f('0x1'));var dialogflow=require(_0x855f('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x855f('0x3'));var md5=require(_0x855f('0x4'));var path=require(_0x855f('0x5'));var querystring=require('querystring');var rp=require(_0x855f('0x6'));var rs=require(_0x855f('0x7'));var sox=require(_0x855f('0x8'));var tts=require(_0x855f('0x9'));var urlParse=require(_0x855f('0xa'))[_0x855f('0xb')];var util=require(_0x855f('0xc'));var aws=require(_0x855f('0xd'));var google=require(_0x855f('0xe'));var sestek=require(_0x855f('0xf'));var tilde=require('./tilde');var logger=require(_0x855f('0x10'))('agi');var ISPEECH_API=_0x855f('0x11');function downloadFile(_0xc0dadd,_0x5a87ad){return new BPromise(function(_0x15ed19,_0x503b4a){var _0x1e28d5=urlParse(_0xc0dadd);var _0x3aa08d=_0x1e28d5[_0x855f('0x12')]==='https:'?https:http;var _0x31e615={'host':_0x1e28d5[_0x855f('0x13')],'path':_0x1e28d5['path'],'headers':{'user-agent':_0x855f('0x14')}};_0x3aa08d[_0x855f('0x15')](_0x31e615,function(_0x3f1869){if(_0x3f1869[_0x855f('0x16')]!==0xc8){logger[_0x855f('0x17')](_0x855f('0x18')+_0xc0dadd+_0x855f('0x19')+_0x3f1869[_0x855f('0x16')]+'\x20('+_0x3f1869[_0x855f('0x1a')]+')');_0x503b4a(new Error(_0x855f('0x18')+_0xc0dadd+_0x855f('0x19')+_0x3f1869[_0x855f('0x16')]+'\x20('+_0x3f1869[_0x855f('0x1a')]+')'));return;}var _0x59d68d=fs[_0x855f('0x1b')](_0x5a87ad);_0x59d68d['on'](_0x855f('0x1c'),function(){logger[_0x855f('0x1d')](_0x855f('0x1e'));_0x59d68d[_0x855f('0x1f')](_0x15ed19);});_0x59d68d['on'](_0x855f('0x17'),function(_0xb0643c){fs[_0x855f('0x20')](_0x5a87ad);logger[_0x855f('0x17')]('download\x20error',_0xb0643c);_0x503b4a(_0xb0643c);});_0x3f1869[_0x855f('0x21')](_0x59d68d);})['on'](_0x855f('0x17'),function(_0x4ecf3d){logger[_0x855f('0x17')](_0x4ecf3d);_0x503b4a(_0x4ecf3d);})[_0x855f('0x22')]();});}function uploadFile(_0x4b1666){return new BPromise(function(_0x348f93,_0x4c1946){var _0x39982d=urlParse(_0x4b1666);var _0xf06e57=_0x39982d['protocol']===_0x855f('0x23')?https:http;var _0x1891ac={'host':_0x39982d[_0x855f('0x13')],'path':_0x39982d[_0x855f('0x5')],'headers':{'user-agent':_0x855f('0x14')}};_0xf06e57[_0x855f('0x15')](_0x1891ac,function(_0x1c6af9){if(_0x1c6af9[_0x855f('0x16')]!==0xc8){_0x4c1946(new Error(_0x855f('0x18')+_0x4b1666+_0x855f('0x19')+_0x1c6af9[_0x855f('0x16')]+'\x20('+_0x1c6af9[_0x855f('0x1a')]+')'));return;}var _0x1c3045='';_0x1c6af9['on'](_0x855f('0x24'),function(_0x3df27b){_0x1c3045+=_0x3df27b;});_0x1c6af9['on'](_0x855f('0x22'),function(){_0x348f93(_0x1c3045);});})['on'](_0x855f('0x17'),function(_0x1d3e9f){_0x4c1946(_0x1d3e9f);})[_0x855f('0x22')]();});}function convertFile(_0x45015a,_0x3a5ad7){return new BPromise(function(_0x30e630,_0x121913){var _0x3771ad=sox[_0x855f('0x25')](_0x45015a,_0x3a5ad7,{'sampleRate':0x1f40,'format':_0x855f('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3771ad['on']('error',function(_0x25615b){logger[_0x855f('0x17')]('error\x20convert',_0x25615b);_0x121913(_0x25615b);});_0x3771ad['on'](_0x855f('0x22'),function(){logger['info'](_0x855f('0x27'));_0x30e630();});_0x3771ad['start']();});}function base64Decode(_0x4608dd,_0x2b84ae){var _0x17b200=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+_0x855f('0x2b'));fs[_0x855f('0x2c')](_0x17b200,_0x4608dd,_0x855f('0x2d'));return convertFile(_0x17b200,_0x2b84ae)[_0x855f('0x2e')](function(){try{fs[_0x855f('0x20')](_0x17b200);fs[_0x855f('0x2f')](_0x2b84ae,_0x855f('0x30'));}catch(_0x49f704){logger[_0x855f('0x17')](_0x49f704);}return _0x2b84ae[_0x855f('0x31')]('.')[0x0];});}function base64Encode(_0x164e64){var _0x374474=fs[_0x855f('0x32')](_0x164e64);return new Buffer(_0x374474)[_0x855f('0x33')](_0x855f('0x2d'));}exports[_0x855f('0x34')]=function(_0x52178c,_0x5e8ec4,_0x272289,_0x27cc7e,_0x5aed2e,_0x1ec5b6){var _0x3421f6,_0x360214;var _0x4ed28d=_0x855f('0x35');var _0x1e7355=_0x855f('0x36')+_0x52178c;var _0x5e33a1={};if(_0x5e8ec4===_0x855f('0x37')){_0x5e33a1['input']={'ssml':_0x272289};}else{_0x5e33a1[_0x855f('0x38')]={'text':_0x272289};};_0x5e33a1['voice']={'languageCode':_0x27cc7e,'ssmlGender':_0x5aed2e};_0x5e33a1[_0x855f('0x39')]={'audioEncoding':_0x855f('0x3a'),'sampleRateHertz':0x1f40};var _0x44319c={'url':_0x4ed28d+_0x855f('0x3b')+_0x1e7355,'method':_0x855f('0x3c'),'json':!![],'body':_0x5e33a1};return rp(_0x44319c)[_0x855f('0x2e')](function(_0x270bc8){return new BPromise(function(_0x1cdc9a,_0x19555e){_0x3421f6=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+_0x855f('0x3d'));var _0x50f162=Buffer[_0x855f('0x3e')](_0x270bc8[_0x855f('0x3f')],_0x855f('0x2d'));return fs[_0x855f('0x40')](_0x3421f6,_0x50f162,function(_0x3bfc72){_0x19555e(_0x3bfc72);},function(_0xabd2d3){fs[_0x855f('0x2f')](_0x3421f6,_0x855f('0x30'));_0x1cdc9a(_0xabd2d3);});});})[_0x855f('0x2e')](function(_0x3881c2){_0x360214=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs['generate'](0x4)+'.wav');return convertFile(_0x3421f6,_0x360214);})['then'](function(){try{fs[_0x855f('0x20')](_0x3421f6);fs['chmodSync'](_0x360214,_0x855f('0x30'));}catch(_0x3c978b){logger['error'](_0x3c978b);}logger[_0x855f('0x1d')](_0x855f('0x41'),_0x360214[_0x855f('0x31')]('.')[0x0]);return _0x360214[_0x855f('0x31')]('.')[0x0];});};exports[_0x855f('0x42')]=function(_0x1387b7,_0x1e4e46){var _0x516755=_0x855f('0x43');var _0x2a7d1e,_0x775205;var _0xe68139;var _0x1e43dc={'encoding':_0x855f('0x44'),'method':_0x855f('0x3c'),'timeout':0x2710,'url':_0x516755,'headers':{'Content-Type':_0x855f('0x45')},'body':_0x855f('0x46')+encodeURIComponent(JSON[_0x855f('0x47')]([[[_0x855f('0x48'),JSON[_0x855f('0x47')]([_0x1387b7,_0x1e4e46||'en',![],_0x855f('0x49')]),null,_0x855f('0x4a')]]]))};return rp(_0x1e43dc)['then'](function(_0x131c28){try{_0xe68139=eval(_0x131c28['slice'](0x5))[0x0][0x2];}catch(_0x5ef2d5){throw new Error('parse\x20response\x20failed:\x0a'+_0x131c28[_0x855f('0x24')]);}if(!_0xe68139){if(_0x1387b7[_0x855f('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x855f('0x4c')+_0x1e4e46+_0x855f('0x4d'));}}try{_0xe68139=eval(_0xe68139)[0x0];}catch(_0x42a615){throw new Error(_0x855f('0x4e')+res['data']);}const _0x289952=_0xe68139;_0x2a7d1e=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+_0x855f('0x3d'));fs[_0x855f('0x2c')](_0x2a7d1e,_0xe68139,{'encoding':_0x855f('0x2d')});_0x775205=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+_0x855f('0x2b'));return convertFile(_0x2a7d1e,_0x775205);})['then'](function(){try{fs[_0x855f('0x20')](_0x2a7d1e);fs[_0x855f('0x2f')](_0x775205,'777');}catch(_0x1a8c0b){logger[_0x855f('0x17')](_0x1a8c0b);}logger[_0x855f('0x1d')]('goggleTTS\x20path',_0x775205[_0x855f('0x31')]('.')[0x0]);return _0x775205[_0x855f('0x31')]('.')[0x0];});};exports['googleASR']=function(_0x262711,_0x44cd8d,_0x51db19){return google[_0x855f('0x4f')](_0x262711,_0x44cd8d,_0x51db19)['then'](function(_0x5de552){logger[_0x855f('0x1d')](_0x5de552['uri']);return rp(_0x5de552);})[_0x855f('0x2e')](function(_0x1d80f3){var _0x11a824='';var _0x1b6260=0x0;try{fs[_0x855f('0x20')](_0x262711);}catch(_0x4cdff6){logger['error'](_0x4cdff6);}if(_0x1d80f3&&_0x1d80f3[_0x855f('0x50')]){_0x11a824=_0x1d80f3[_0x855f('0x50')][_0x855f('0x51')](function(_0x1344e7){return _0x1344e7&&_0x1344e7['alternatives'][0x0]&&_0x1344e7['alternatives'][0x0][_0x855f('0x52')]?_0x1344e7[_0x855f('0x53')][0x0][_0x855f('0x52')]:'';})[_0x855f('0x54')]('\x0a');_0x1b6260=_0x1d80f3[_0x855f('0x50')][_0x855f('0x51')](function(_0x41bc4f){return _0x41bc4f&&_0x41bc4f[_0x855f('0x53')][0x0]&&_0x41bc4f[_0x855f('0x53')][0x0][_0x855f('0x55')]?_0x41bc4f['alternatives'][0x0][_0x855f('0x55')]:0x0;})[_0x855f('0x54')]('\x0a');}logger[_0x855f('0x1d')](_0x855f('0x56'),_0x11a824);logger[_0x855f('0x1d')](_0x855f('0x57'),_0x1b6260);return{'transcript':_0x11a824,'confidence':_0x1b6260};})[_0x855f('0x58')](function(_0x28f3a0){logger['error'](_0x855f('0x59'),_0x28f3a0[_0x855f('0x16')],_0x28f3a0[_0x855f('0x5a')],_0x28f3a0[_0x855f('0x5b')]);});};exports[_0x855f('0x5c')]=function(_0x1f0681,_0x820e31,_0x3f06ea,_0x39afca){var _0x46d33e=apiai(_0x820e31,{'language':_0x39afca||'en'});return _0x46d33e[_0x855f('0x5d')](_0x3f06ea,{'sessionId':md5(_0x1f0681)})[_0x855f('0x2e')](function(_0x5f18df){logger[_0x855f('0x1d')](JSON[_0x855f('0x47')](_0x5f18df));return{'source':_0x5f18df[_0x855f('0x5e')][_0x855f('0x5f')],'resolvedQuery':_0x5f18df['result'][_0x855f('0x60')],'action':_0x5f18df[_0x855f('0x5e')][_0x855f('0x61')],'actionIncomplete':_0x5f18df[_0x855f('0x5e')][_0x855f('0x62')],'speech':_0x5f18df['result'][_0x855f('0x63')][_0x855f('0x64')],'score':_0x5f18df[_0x855f('0x5e')][_0x855f('0x65')],'statusCode':_0x5f18df[_0x855f('0x66')]['code'],'endConversation':_0x5f18df[_0x855f('0x5e')][_0x855f('0x67')][_0x855f('0x68')]||![],'isFallbackIntent':_0x5f18df[_0x855f('0x5e')][_0x855f('0x67')][_0x855f('0x69')]};});};exports['googleDialogflowV2']=function(_0x373e88,_0x16e603,_0x4cdd82,_0x5cf541,_0x8f35ef,_0xf18bad){var _0x206946=_0x5cf541[_0x855f('0x6a')](/\\n/g,'\x0a');var _0x4e7ae3={'credentials':{'private_key':_0x206946,'client_email':_0x4cdd82}};var _0x1b4ce6=new dialogflow['SessionsClient'](_0x4e7ae3);var _0x47b698=_0x1b4ce6['sessionPath'](_0x16e603,md5(_0x373e88));var _0x467050={'session':_0x47b698,'queryInput':{'text':{'text':_0x8f35ef,'languageCode':_0xf18bad}}};return _0x1b4ce6[_0x855f('0x6b')](_0x467050)[_0x855f('0x2e')](function(_0x404176){if(_0x404176&&_0x404176[_0x855f('0x4b')]){logger['info'](_0x855f('0x6c'),JSON[_0x855f('0x47')](_0x404176));var _0x56e4a0=_0x404176[0x0];if(_0x56e4a0){var _0x252d8d={'action':_0x56e4a0[_0x855f('0x6d')][_0x855f('0x61')],'allRequiredParamsPresent':_0x56e4a0[_0x855f('0x6d')]['allRequiredParamsPresent'],'endConversation':_0x56e4a0['queryResult'][_0x855f('0x6e')]&&_0x56e4a0['queryResult'][_0x855f('0x6e')][_0x855f('0x6f')]?_0x56e4a0[_0x855f('0x6d')][_0x855f('0x6e')]['fields'][_0x855f('0x70')][_0x855f('0x71')]:![],'fulfillmentText':_0x56e4a0[_0x855f('0x6d')][_0x855f('0x72')],'intentName':_0x56e4a0[_0x855f('0x6d')][_0x855f('0x73')][_0x855f('0x5a')],'intentDisplayName':_0x56e4a0[_0x855f('0x6d')]['intent'][_0x855f('0x74')],'isFallbackIntent':_0x56e4a0['queryResult'][_0x855f('0x73')]['isFallback'],'languageCode':_0x56e4a0[_0x855f('0x6d')]['languageCode'],'queryText':_0x56e4a0['queryResult'][_0x855f('0x75')],'responseId':_0x56e4a0['responseId'],'score':_0x56e4a0['queryResult'][_0x855f('0x76')],'speech':_0x56e4a0[_0x855f('0x6d')][_0x855f('0x72')],'providerResponse':JSON[_0x855f('0x47')](_0x404176)};return _0x252d8d;}}});};exports[_0x855f('0x77')]=function(_0x3ba865,_0xafea90,_0x512a79,_0x8e6391){return tilde[_0x855f('0x4f')](_0x3ba865,_0xafea90,_0x512a79,_0x8e6391)['then'](function(_0x50df5f){try{fs['unlink'](_0x3ba865);}catch(_0x4b998c){logger[_0x855f('0x17')](_0x4b998c);}logger[_0x855f('0x1d')](_0x855f('0x78'),_0x50df5f[_0x855f('0x52')]);logger[_0x855f('0x1d')](_0x855f('0x79'),_0x50df5f[_0x855f('0x55')]);return _0x50df5f;});};exports[_0x855f('0x7a')]=function(_0x2d9756,_0x182050,_0x2ab479,_0x4c7752,_0x1d23b1,_0xae0e1){var _0x125f50=path[_0x855f('0x28')](__dirname,'tmp',rs[_0x855f('0x2a')](0x4)+_0x855f('0x3d'));var _0x85ad92;return aws[_0x855f('0x7b')](_0x2d9756,_0x182050,_0x2ab479,_0x4c7752,_0x1d23b1,_0xae0e1,_0x125f50)[_0x855f('0x2e')](function(){_0x85ad92=path[_0x855f('0x28')](__dirname,'tmp',rs[_0x855f('0x2a')](0x4)+'.wav');return convertFile(_0x125f50,_0x85ad92);})[_0x855f('0x2e')](function(){try{fs['unlink'](_0x125f50);fs['chmodSync'](_0x85ad92,_0x855f('0x30'));}catch(_0x1540b3){logger[_0x855f('0x17')](_0x1540b3);}return _0x85ad92[_0x855f('0x31')]('.')[0x0];});};exports['awsLex']=function(_0x209a59,_0x4863e2,_0x55cbe7,_0x3e5bf0,_0x5933c4,_0x3e8112){return aws[_0x855f('0x7c')](_0x209a59,_0x4863e2,_0x55cbe7,_0x3e5bf0,_0x5933c4,_0x3e8112)['then'](function(_0x53b78e){logger[_0x855f('0x1d')](JSON[_0x855f('0x47')](_0x53b78e));return _0x53b78e;});};exports[_0x855f('0x7d')]=function(_0x1c7331,_0x4c3812,_0x1dcf23,_0x753027){var _0x12808d=util[_0x855f('0x7e')](_0x855f('0x7f'),ISPEECH_API,_0x1c7331,encodeURIComponent(_0x4c3812),_0x1dcf23,_0x753027);var _0x30c6f8=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+'.mp3');var _0x4207de;return downloadFile(_0x12808d,_0x30c6f8)[_0x855f('0x2e')](function(){_0x4207de=path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+_0x855f('0x2b'));return convertFile(_0x30c6f8,_0x4207de);})[_0x855f('0x2e')](function(){try{fs[_0x855f('0x20')](_0x30c6f8);fs['chmodSync'](_0x4207de,_0x855f('0x30'));}catch(_0x97081d){logger['error'](_0x97081d);}return _0x4207de[_0x855f('0x31')]('.')[0x0];});};exports['ispeechASR']=function(_0x139e79,_0x5e53ee,_0x45fb9b,_0x8275b8){var _0x4915f4=util[_0x855f('0x7e')](_0x855f('0x80'),ISPEECH_API,_0x5e53ee,_0x45fb9b,base64Encode(_0x139e79),_0x8275b8?util[_0x855f('0x7e')](_0x855f('0x81'),encodeURIComponent(_0x8275b8)):_0x855f('0x82'));return uploadFile(_0x4915f4)[_0x855f('0x2e')](function(_0x4eb6d3){return querystring[_0x855f('0xb')](_0x4eb6d3);});};exports[_0x855f('0x83')]=function(_0x1f866d,_0x3508ce){return sestek[_0x855f('0x84')](_0x1f866d,_0x3508ce)['then'](function(_0x385e31){logger[_0x855f('0x1d')](JSON[_0x855f('0x47')](_0x385e31));var _0x1a4377={'speech':_0x385e31[_0x855f('0x85')],'action':_0x385e31[_0x855f('0x86')]?_0x385e31[_0x855f('0x86')]['CustomAction']:undefined,'actiondata':_0x385e31['channelData']?_0x385e31[_0x855f('0x86')]['CustomActionData']:undefined};if(_0x385e31[_0x855f('0x86')]&&_0x385e31[_0x855f('0x86')][_0x855f('0x87')]){return base64Decode(_0x385e31['channelData'][_0x855f('0x87')][_0x855f('0x88')],path[_0x855f('0x28')](__dirname,_0x855f('0x29'),rs[_0x855f('0x2a')](0x4)+'.wav'))[_0x855f('0x2e')](function(_0x501228){_0x1a4377['audiofile']=_0x501228;return _0x1a4377;});}return _0x1a4377;});};exports[_0x855f('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x3de7=['utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','goggleTTS\x20path','asr','uri','results','map','alternatives','confidence','join','googleASR\x20confidence','catch','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','transcript','awsPolly','polly','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','dialogflow','https','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','error','request\x20to\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','download\x20error','pipe','end','\x20failed,\x20status\x20code\x20=\x20','data','wav','error\x20convert','finish\x20to\x20convert','start','generate','.wav','writeFileSync','then','unlink','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','voice','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','audioContent','tmp','googleCloudTTS\x20path','googleTTS'];(function(_0x537073,_0x578dda){var _0x83a63e=function(_0x1f0107){while(--_0x1f0107){_0x537073['push'](_0x537073['shift']());}};_0x83a63e(++_0x578dda);}(_0x3de7,0xc1));var _0x73de=function(_0x57111f,_0x2a7bde){_0x57111f=_0x57111f-0x0;var _0xe10f6f=_0x3de7[_0x57111f];return _0xe10f6f;};'use strict';var apiai=require(_0x73de('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x73de('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x73de('0x2'));var md5=require('md5');var path=require('path');var querystring=require('querystring');var rp=require(_0x73de('0x3'));var rs=require(_0x73de('0x4'));var sox=require(_0x73de('0x5'));var tts=require(_0x73de('0x6'));var urlParse=require(_0x73de('0x7'))[_0x73de('0x8')];var util=require('util');var aws=require(_0x73de('0x9'));var google=require(_0x73de('0xa'));var sestek=require(_0x73de('0xb'));var tilde=require(_0x73de('0xc'));var logger=require(_0x73de('0xd'))(_0x73de('0xe'));var ISPEECH_API=_0x73de('0xf');function downloadFile(_0x457e26,_0xe418e7){return new BPromise(function(_0x5101f0,_0x3354a5){var _0x121284=urlParse(_0x457e26);var _0x33bb71=_0x121284[_0x73de('0x10')]===_0x73de('0x11')?https:http;var _0x2d55d0={'host':_0x121284[_0x73de('0x12')],'path':_0x121284[_0x73de('0x13')],'headers':{'user-agent':_0x73de('0x14')}};_0x33bb71[_0x73de('0x15')](_0x2d55d0,function(_0x4b8ebe){if(_0x4b8ebe['statusCode']!==0xc8){logger[_0x73de('0x16')](_0x73de('0x17')+_0x457e26+'\x20failed,\x20status\x20code\x20=\x20'+_0x4b8ebe[_0x73de('0x18')]+'\x20('+_0x4b8ebe['statusMessage']+')');_0x3354a5(new Error(_0x73de('0x17')+_0x457e26+'\x20failed,\x20status\x20code\x20=\x20'+_0x4b8ebe[_0x73de('0x18')]+'\x20('+_0x4b8ebe[_0x73de('0x19')]+')'));return;}var _0x5b11eb=fs[_0x73de('0x1a')](_0xe418e7);_0x5b11eb['on']('finish',function(){logger[_0x73de('0x1b')](_0x73de('0x1c'));_0x5b11eb['close'](_0x5101f0);});_0x5b11eb['on']('error',function(_0x563a78){fs['unlink'](_0xe418e7);logger[_0x73de('0x16')](_0x73de('0x1d'),_0x563a78);_0x3354a5(_0x563a78);});_0x4b8ebe[_0x73de('0x1e')](_0x5b11eb);})['on'](_0x73de('0x16'),function(_0x35bd1c){logger['error'](_0x35bd1c);_0x3354a5(_0x35bd1c);})[_0x73de('0x1f')]();});}function uploadFile(_0x36759b){return new BPromise(function(_0x1fd03a,_0x186849){var _0x5bd3db=urlParse(_0x36759b);var _0x74ad5b=_0x5bd3db[_0x73de('0x10')]===_0x73de('0x11')?https:http;var _0x233190={'host':_0x5bd3db[_0x73de('0x12')],'path':_0x5bd3db[_0x73de('0x13')],'headers':{'user-agent':_0x73de('0x14')}};_0x74ad5b[_0x73de('0x15')](_0x233190,function(_0x34cbaa){if(_0x34cbaa[_0x73de('0x18')]!==0xc8){_0x186849(new Error(_0x73de('0x17')+_0x36759b+_0x73de('0x20')+_0x34cbaa['statusCode']+'\x20('+_0x34cbaa[_0x73de('0x19')]+')'));return;}var _0x357dd8='';_0x34cbaa['on'](_0x73de('0x21'),function(_0x2d091e){_0x357dd8+=_0x2d091e;});_0x34cbaa['on'](_0x73de('0x1f'),function(){_0x1fd03a(_0x357dd8);});})['on']('error',function(_0x3eead7){_0x186849(_0x3eead7);})[_0x73de('0x1f')]();});}function convertFile(_0x54e5f8,_0x91f897){return new BPromise(function(_0x1de7cb,_0x37ef3e){var _0x4d5411=sox['transcode'](_0x54e5f8,_0x91f897,{'sampleRate':0x1f40,'format':_0x73de('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d5411['on'](_0x73de('0x16'),function(_0x55035e){logger[_0x73de('0x16')](_0x73de('0x23'),_0x55035e);_0x37ef3e(_0x55035e);});_0x4d5411['on'](_0x73de('0x1f'),function(){logger[_0x73de('0x1b')](_0x73de('0x24'));_0x1de7cb();});_0x4d5411[_0x73de('0x25')]();});}function base64Decode(_0x5382a9,_0x454d26){var _0x99e8e8=path['resolve'](__dirname,'tmp',rs[_0x73de('0x26')](0x4)+_0x73de('0x27'));fs[_0x73de('0x28')](_0x99e8e8,_0x5382a9,'base64');return convertFile(_0x99e8e8,_0x454d26)[_0x73de('0x29')](function(){try{fs[_0x73de('0x2a')](_0x99e8e8);fs[_0x73de('0x2b')](_0x454d26,_0x73de('0x2c'));}catch(_0x27b5c3){logger['error'](_0x27b5c3);}return _0x454d26[_0x73de('0x2d')]('.')[0x0];});}function base64Encode(_0x47a668){var _0x4af55b=fs[_0x73de('0x2e')](_0x47a668);return new Buffer(_0x4af55b)['toString'](_0x73de('0x2f'));}exports[_0x73de('0x30')]=function(_0x11d8f9,_0x46da44,_0x45862d,_0x4d4898,_0x549ecc,_0x45005b){var _0x406926,_0x59dc9f;var _0x1cf70e=_0x73de('0x31');var _0x27aa70=_0x73de('0x32')+_0x11d8f9;var _0x588f65={};if(_0x46da44===_0x73de('0x33')){_0x588f65['input']={'ssml':_0x45862d};}else{_0x588f65['input']={'text':_0x45862d};};_0x588f65[_0x73de('0x34')]={'languageCode':_0x4d4898,'ssmlGender':_0x549ecc};_0x588f65[_0x73de('0x35')]={'audioEncoding':_0x73de('0x36'),'sampleRateHertz':0x1f40};var _0xf9a103={'url':_0x1cf70e+_0x73de('0x37')+_0x27aa70,'method':_0x73de('0x38'),'json':!![],'body':_0x588f65};return rp(_0xf9a103)['then'](function(_0x5b23f5){return new BPromise(function(_0x4bd870,_0x2bcdfa){_0x406926=path[_0x73de('0x39')](__dirname,'tmp',rs['generate'](0x4)+_0x73de('0x3a'));var _0x3e4043=Buffer['from'](_0x5b23f5[_0x73de('0x3b')],'base64');return fs['writeFile'](_0x406926,_0x3e4043,function(_0x3d8acb){_0x2bcdfa(_0x3d8acb);},function(_0x221d14){fs[_0x73de('0x2b')](_0x406926,'777');_0x4bd870(_0x221d14);});});})[_0x73de('0x29')](function(_0x2e4c90){_0x59dc9f=path[_0x73de('0x39')](__dirname,_0x73de('0x3c'),rs[_0x73de('0x26')](0x4)+_0x73de('0x27'));return convertFile(_0x406926,_0x59dc9f);})[_0x73de('0x29')](function(){try{fs[_0x73de('0x2a')](_0x406926);fs[_0x73de('0x2b')](_0x59dc9f,_0x73de('0x2c'));}catch(_0x107691){logger['error'](_0x107691);}logger[_0x73de('0x1b')](_0x73de('0x3d'),_0x59dc9f[_0x73de('0x2d')]('.')[0x0]);return _0x59dc9f[_0x73de('0x2d')]('.')[0x0];});};exports[_0x73de('0x3e')]=function(_0x48fb8e,_0x1fec91){var _0x2342f4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1ffc0c,_0x584b44;var _0xe636c7;var _0x2bba03={'encoding':_0x73de('0x3f'),'method':_0x73de('0x38'),'timeout':0x2710,'url':_0x2342f4,'headers':{'Content-Type':_0x73de('0x40')},'body':'f.req='+encodeURIComponent(JSON[_0x73de('0x41')]([[[_0x73de('0x42'),JSON[_0x73de('0x41')]([_0x48fb8e,_0x1fec91||'en',![],_0x73de('0x43')]),null,_0x73de('0x44')]]]))};return rp(_0x2bba03)[_0x73de('0x29')](function(_0x3a918e){try{_0xe636c7=eval(_0x3a918e['slice'](0x5))[0x0][0x2];}catch(_0x41268b){throw new Error(_0x73de('0x45')+_0x3a918e[_0x73de('0x21')]);}if(!_0xe636c7){if(_0x48fb8e[_0x73de('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x1fec91+'\x22\x20might\x20not\x20exist');}}try{_0xe636c7=eval(_0xe636c7)[0x0];}catch(_0x5b645e){throw new Error(_0x73de('0x45')+res[_0x73de('0x21')]);}const _0x511132=_0xe636c7;_0x1ffc0c=path[_0x73de('0x39')](__dirname,_0x73de('0x3c'),rs[_0x73de('0x26')](0x4)+_0x73de('0x3a'));fs[_0x73de('0x28')](_0x1ffc0c,_0xe636c7,{'encoding':_0x73de('0x2f')});_0x584b44=path[_0x73de('0x39')](__dirname,'tmp',rs[_0x73de('0x26')](0x4)+_0x73de('0x27'));return convertFile(_0x1ffc0c,_0x584b44);})[_0x73de('0x29')](function(){try{fs['unlink'](_0x1ffc0c);fs['chmodSync'](_0x584b44,_0x73de('0x2c'));}catch(_0x364e8a){logger[_0x73de('0x16')](_0x364e8a);}logger[_0x73de('0x1b')](_0x73de('0x47'),_0x584b44['split']('.')[0x0]);return _0x584b44['split']('.')[0x0];});};exports['googleASR']=function(_0x34683e,_0x55aa56,_0x42aecd){return google[_0x73de('0x48')](_0x34683e,_0x55aa56,_0x42aecd)[_0x73de('0x29')](function(_0x391277){logger['info'](_0x391277[_0x73de('0x49')]);return rp(_0x391277);})[_0x73de('0x29')](function(_0x1342b7){var _0x4acbdb='';var _0x5a4b8b=0x0;try{fs[_0x73de('0x2a')](_0x34683e);}catch(_0x15c60e){logger['error'](_0x15c60e);}if(_0x1342b7&&_0x1342b7['results']){_0x4acbdb=_0x1342b7[_0x73de('0x4a')][_0x73de('0x4b')](function(_0x3859f3){return _0x3859f3&&_0x3859f3['alternatives'][0x0]&&_0x3859f3[_0x73de('0x4c')][0x0]['transcript']?_0x3859f3[_0x73de('0x4c')][0x0]['transcript']:'';})['join']('\x0a');_0x5a4b8b=_0x1342b7[_0x73de('0x4a')][_0x73de('0x4b')](function(_0x54794b){return _0x54794b&&_0x54794b[_0x73de('0x4c')][0x0]&&_0x54794b[_0x73de('0x4c')][0x0][_0x73de('0x4d')]?_0x54794b[_0x73de('0x4c')][0x0][_0x73de('0x4d')]:0x0;})[_0x73de('0x4e')]('\x0a');}logger[_0x73de('0x1b')]('googleASR\x20transcription',_0x4acbdb);logger[_0x73de('0x1b')](_0x73de('0x4f'),_0x5a4b8b);return{'transcript':_0x4acbdb,'confidence':_0x5a4b8b};})[_0x73de('0x50')](function(_0x2a465a){logger[_0x73de('0x16')]('[%s]\x20%s:%s',_0x2a465a[_0x73de('0x18')],_0x2a465a['name'],_0x2a465a[_0x73de('0x51')]);});};exports['googleDialogflow']=function(_0x88276,_0x166455,_0x2bb446,_0x197b72){var _0xffc544=apiai(_0x166455,{'language':_0x197b72||'en'});return _0xffc544[_0x73de('0x52')](_0x2bb446,{'sessionId':md5(_0x88276)})[_0x73de('0x29')](function(_0x37378a){logger[_0x73de('0x1b')](JSON[_0x73de('0x41')](_0x37378a));return{'source':_0x37378a[_0x73de('0x53')][_0x73de('0x54')],'resolvedQuery':_0x37378a[_0x73de('0x53')][_0x73de('0x55')],'action':_0x37378a['result']['action'],'actionIncomplete':_0x37378a[_0x73de('0x53')][_0x73de('0x56')],'speech':_0x37378a[_0x73de('0x53')][_0x73de('0x57')][_0x73de('0x58')],'score':_0x37378a[_0x73de('0x53')][_0x73de('0x59')],'statusCode':_0x37378a['status'][_0x73de('0x5a')],'endConversation':_0x37378a[_0x73de('0x53')]['metadata'][_0x73de('0x5b')]||![],'isFallbackIntent':_0x37378a[_0x73de('0x53')][_0x73de('0x5c')][_0x73de('0x5d')]};});};exports[_0x73de('0x5e')]=function(_0x5e2df4,_0x4c624d,_0x5b0991,_0x515d44,_0x49e1b9,_0xd23e4f){var _0x382244=_0x515d44[_0x73de('0x5f')](/\\n/g,'\x0a');var _0x478389={'credentials':{'private_key':_0x382244,'client_email':_0x5b0991}};var _0x2d3982=new dialogflow[(_0x73de('0x60'))](_0x478389);var _0x199fa5=_0x2d3982[_0x73de('0x61')](_0x4c624d,md5(_0x5e2df4));var _0x544198={'session':_0x199fa5,'queryInput':{'text':{'text':_0x49e1b9,'languageCode':_0xd23e4f}}};return _0x2d3982[_0x73de('0x62')](_0x544198)[_0x73de('0x29')](function(_0x53458b){if(_0x53458b&&_0x53458b['length']){logger[_0x73de('0x1b')](_0x73de('0x63'),JSON[_0x73de('0x41')](_0x53458b));var _0x2e8f0f=_0x53458b[0x0];if(_0x2e8f0f){var _0x3d12a8={'action':_0x2e8f0f['queryResult']['action'],'allRequiredParamsPresent':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x65')],'endConversation':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x66')]&&_0x2e8f0f[_0x73de('0x64')]['diagnosticInfo'][_0x73de('0x67')]?_0x2e8f0f[_0x73de('0x64')]['diagnosticInfo']['fields'][_0x73de('0x68')][_0x73de('0x69')]:![],'fulfillmentText':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6a')],'intentName':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6b')][_0x73de('0x6c')],'intentDisplayName':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6b')]['displayName'],'isFallbackIntent':_0x2e8f0f['queryResult'][_0x73de('0x6b')][_0x73de('0x6d')],'languageCode':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6e')],'queryText':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6f')],'responseId':_0x2e8f0f[_0x73de('0x70')],'score':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x71')],'speech':_0x2e8f0f[_0x73de('0x64')][_0x73de('0x6a')],'providerResponse':JSON['stringify'](_0x53458b)};return _0x3d12a8;}}});};exports['tildeASR']=function(_0x2ee35a,_0x24285d,_0x4bba64,_0xbbef21){return tilde[_0x73de('0x48')](_0x2ee35a,_0x24285d,_0x4bba64,_0xbbef21)[_0x73de('0x29')](function(_0x430069){try{fs[_0x73de('0x2a')](_0x2ee35a);}catch(_0xe547c8){logger[_0x73de('0x16')](_0xe547c8);}logger['info']('Tilde\x20ASR\x20transcription',_0x430069[_0x73de('0x72')]);logger['info']('Tilde\x20ASR\x20confidence',_0x430069[_0x73de('0x4d')]);return _0x430069;});};exports[_0x73de('0x73')]=function(_0xc60b7a,_0x2e3aab,_0x2cd3dc,_0x4854cb,_0x44c5b4,_0x42effc){var _0x59f693=path[_0x73de('0x39')](__dirname,_0x73de('0x3c'),rs[_0x73de('0x26')](0x4)+_0x73de('0x3a'));var _0x4476ca;return aws[_0x73de('0x74')](_0xc60b7a,_0x2e3aab,_0x2cd3dc,_0x4854cb,_0x44c5b4,_0x42effc,_0x59f693)[_0x73de('0x29')](function(){_0x4476ca=path[_0x73de('0x39')](__dirname,_0x73de('0x3c'),rs[_0x73de('0x26')](0x4)+_0x73de('0x27'));return convertFile(_0x59f693,_0x4476ca);})[_0x73de('0x29')](function(){try{fs[_0x73de('0x2a')](_0x59f693);fs[_0x73de('0x2b')](_0x4476ca,_0x73de('0x2c'));}catch(_0x4762b5){logger[_0x73de('0x16')](_0x4762b5);}return _0x4476ca['split']('.')[0x0];});};exports['awsLex']=function(_0x4ea1e8,_0x55d7b,_0x5b4e42,_0xe7604b,_0x30f521,_0x41f61c){return aws['lex'](_0x4ea1e8,_0x55d7b,_0x5b4e42,_0xe7604b,_0x30f521,_0x41f61c)[_0x73de('0x29')](function(_0x5e8020){logger[_0x73de('0x1b')](JSON['stringify'](_0x5e8020));return _0x5e8020;});};exports['ispeechTTS']=function(_0x2e818b,_0x50fc39,_0x1cdfee,_0x2d60b0){var _0x1a2d51=util['format'](_0x73de('0x75'),ISPEECH_API,_0x2e818b,encodeURIComponent(_0x50fc39),_0x1cdfee,_0x2d60b0);var _0x3bb4d6=path[_0x73de('0x39')](__dirname,_0x73de('0x3c'),rs['generate'](0x4)+_0x73de('0x3a'));var _0x49118d;return downloadFile(_0x1a2d51,_0x3bb4d6)[_0x73de('0x29')](function(){_0x49118d=path[_0x73de('0x39')](__dirname,'tmp',rs[_0x73de('0x26')](0x4)+_0x73de('0x27'));return convertFile(_0x3bb4d6,_0x49118d);})['then'](function(){try{fs[_0x73de('0x2a')](_0x3bb4d6);fs['chmodSync'](_0x49118d,_0x73de('0x2c'));}catch(_0x4adfed){logger[_0x73de('0x16')](_0x4adfed);}return _0x49118d[_0x73de('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x4b03b8,_0x2d91e1,_0x24b726,_0x5ca2d6){var _0x52600e=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2d91e1,_0x24b726,base64Encode(_0x4b03b8),_0x5ca2d6?util['format'](_0x73de('0x76'),encodeURIComponent(_0x5ca2d6)):_0x73de('0x77'));return uploadFile(_0x52600e)['then'](function(_0xedec83){return querystring[_0x73de('0x8')](_0xedec83);});};exports['sestekNDA']=function(_0x1f4ae6,_0x12e9aa){return sestek[_0x73de('0x78')](_0x1f4ae6,_0x12e9aa)[_0x73de('0x29')](function(_0x17b19a){logger[_0x73de('0x1b')](JSON['stringify'](_0x17b19a));var _0x4c744f={'speech':_0x17b19a[_0x73de('0x79')],'action':_0x17b19a['channelData']?_0x17b19a[_0x73de('0x7a')][_0x73de('0x7b')]:undefined,'actiondata':_0x17b19a[_0x73de('0x7a')]?_0x17b19a[_0x73de('0x7a')][_0x73de('0x7c')]:undefined};if(_0x17b19a[_0x73de('0x7a')]&&_0x17b19a[_0x73de('0x7a')][_0x73de('0x7d')]){return base64Decode(_0x17b19a['channelData'][_0x73de('0x7d')][_0x73de('0x7e')],path['resolve'](__dirname,_0x73de('0x3c'),rs[_0x73de('0x26')](0x4)+_0x73de('0x27')))['then'](function(_0x2f00f1){_0x4c744f[_0x73de('0x7f')]=_0x2f00f1;return _0x4c744f;});}return _0x4c744f;});};exports['dirName']=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 bb4e283..fe47c6c 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 _0xddec=['./nda','exports'];(function(_0x294957,_0x574362){var _0x1161b9=function(_0x335ad3){while(--_0x335ad3){_0x294957['push'](_0x294957['shift']());}};_0x1161b9(++_0x574362);}(_0xddec,0x19a));var _0xcdde=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xddec[_0x14add3];return _0x4a174f;};var nda=require(_0xcdde('0x0'));module[_0xcdde('0x1')]={'nda':nda}; \ No newline at end of file +var _0x96f3=['./nda'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x96f3,0x140));var _0x396f=function(_0x5e0113,_0x442b39){_0x5e0113=_0x5e0113-0x0;var _0x42e5a8=_0x96f3[_0x5e0113];return _0x42e5a8;};var nda=require(_0x396f('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 3d743e5..59429cf 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 _0xceb0=['ProjectName','ndagenerate_audio','custom_action','custom_action_data','CustomActionData','info','stringify','exports','POST','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData'];(function(_0x16ca13,_0x194f26){var _0x3b0620=function(_0xfacd61){while(--_0xfacd61){_0x16ca13['push'](_0x16ca13['shift']());}};_0x3b0620(++_0x194f26);}(_0xceb0,0x173));var _0x0ceb=function(_0x35af02,_0x477fdf){_0x35af02=_0x35af02-0x0;var _0x291a8f=_0xceb0[_0x35af02];return _0x291a8f;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require('../../../../../config/logger')('agi');module[_0x0ceb('0x0')]=function(_0x48c8b1,_0x1659e3){var _0x1925ab={'method':_0x0ceb('0x1'),'uri':url['resolve'](_0x1659e3['ndauth_url'],_0x0ceb('0x2')),'form':{'grant_type':_0x0ceb('0x3'),'username':_0x1659e3[_0x0ceb('0x4')],'password':_0x1659e3['password']},'json':!![]};return rp(_0x1925ab)[_0x0ceb('0x5')](function(_0x19e438){var _0x4ec03a={'method':_0x0ceb('0x1'),'uri':url['resolve'](_0x1659e3[_0x0ceb('0x6')],_0x0ceb('0x7')),'body':{'type':_0x1659e3[_0x0ceb('0x8')]||'message','channelId':'Nda','conversation':{'id':_0x48c8b1[_0x0ceb('0x9')]},'from':{'id':_0x48c8b1[_0x0ceb('0xa')],'name':_0x48c8b1[_0x0ceb('0xb')]},'recipient':{'id':_0x48c8b1[_0x0ceb('0xc')],'name':_0x48c8b1[_0x0ceb('0xd')]},'text':_0x1659e3[_0x0ceb('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x19e438[_0x0ceb('0xf')]},'json':!![]};if(_0x1659e3[_0x0ceb('0x10')]){_0x4ec03a[_0x0ceb('0x11')][_0x0ceb('0x12')][_0x0ceb('0x13')]=_0x1659e3[_0x0ceb('0x10')];}if(_0x1659e3[_0x0ceb('0x14')]=='1'){_0x4ec03a['body'][_0x0ceb('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1659e3[_0x0ceb('0x15')]){_0x4ec03a[_0x0ceb('0x11')][_0x0ceb('0x12')]['CustomAction']=_0x1659e3[_0x0ceb('0x15')];if(_0x1659e3[_0x0ceb('0x16')]){_0x4ec03a['body'][_0x0ceb('0x12')][_0x0ceb('0x17')]=_0x1659e3[_0x0ceb('0x16')];}}logger[_0x0ceb('0x18')](JSON[_0x0ceb('0x19')](_0x4ec03a));return rp(_0x4ec03a);});}; \ No newline at end of file +var _0xaa1b=['access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','/token','password','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0xbaa1('0x0'));var url=require(_0xbaa1('0x1'));var logger=require(_0xbaa1('0x2'))('agi');module[_0xbaa1('0x3')]=function(_0x51926c,_0x2593cc){var _0x2b8de1={'method':'POST','uri':url['resolve'](_0x2593cc['ndauth_url'],_0xbaa1('0x4')),'form':{'grant_type':_0xbaa1('0x5'),'username':_0x2593cc['username'],'password':_0x2593cc[_0xbaa1('0x5')]},'json':!![]};return rp(_0x2b8de1)['then'](function(_0x364ce9){var _0x15b968={'method':_0xbaa1('0x6'),'uri':url[_0xbaa1('0x7')](_0x2593cc[_0xbaa1('0x8')],_0xbaa1('0x9')),'body':{'type':_0x2593cc['ndaactivity_type']||_0xbaa1('0xa'),'channelId':_0xbaa1('0xb'),'conversation':{'id':_0x51926c[_0xbaa1('0xc')]},'from':{'id':_0x51926c[_0xbaa1('0xd')],'name':_0x51926c[_0xbaa1('0xe')]},'recipient':{'id':_0x51926c[_0xbaa1('0xf')],'name':_0x51926c[_0xbaa1('0x10')]},'text':_0x2593cc[_0xbaa1('0x11')],'channelData':{}},'headers':{'Authorization':_0xbaa1('0x12')+_0x364ce9[_0xbaa1('0x13')]},'json':!![]};if(_0x2593cc[_0xbaa1('0x14')]){_0x15b968[_0xbaa1('0x15')]['channelData']['ProjectName']=_0x2593cc['project'];}if(_0x2593cc['ndagenerate_audio']=='1'){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xbaa1('0x18')};}if(_0x2593cc[_0xbaa1('0x19')]){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x1a')]=_0x2593cc[_0xbaa1('0x19')];if(_0x2593cc[_0xbaa1('0x1b')]){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x1c')]=_0x2593cc[_0xbaa1('0x1b')];}}logger[_0xbaa1('0x1d')](JSON[_0xbaa1('0x1e')](_0x15b968));return rp(_0x15b968);});}; \ 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 4e085cc..d8eda43 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 _0x664f=['./lib/api'];(function(_0x1837cb,_0x1cce80){var _0x499cbd=function(_0x4dbea3){while(--_0x4dbea3){_0x1837cb['push'](_0x1837cb['shift']());}};_0x499cbd(++_0x1cce80);}(_0x664f,0x1bb));var _0xf664=function(_0xdd598a,_0x2f4169){_0xdd598a=_0xdd598a-0x0;var _0x18c8d7=_0x664f[_0xdd598a];return _0x18c8d7;};'use strict';var asr=require(_0xf664('0x0'));module['exports']=function(_0x2d8880,_0x1047a1,_0x3f5c82,_0x42d1cc){return asr(_0x2d8880,_0x1047a1,_0x3f5c82,_0x42d1cc);}; \ No newline at end of file +var _0x4bf5=['./lib/api'];(function(_0x4245f2,_0x25f5a6){var _0x5745df=function(_0x25ccf4){while(--_0x25ccf4){_0x4245f2['push'](_0x4245f2['shift']());}};_0x5745df(++_0x25f5a6);}(_0x4bf5,0xe6));var _0x54bf=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x4bf5[_0x4a96ca];return _0x2aed48;};'use strict';var asr=require(_0x54bf('0x0'));module['exports']=function(_0x48def8,_0x1e5808,_0x413306,_0x3b49ce){return asr(_0x48def8,_0x1e5808,_0x413306,_0x3b49ce);}; \ 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 6d27a25..e071209 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 _0x6358=['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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','terminate','parse','status','result','final','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.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0x6358,0xf5));var _0x8635=function(_0x4f5431,_0x2730b3){_0x4f5431=_0x4f5431-0x0;var _0x53d165=_0x6358[_0x4f5431];return _0x53d165;};'use strict';var BPromise=require(_0x8635('0x0'));var _=require(_0x8635('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x8635('0x2'));var logger=require(_0x8635('0x3'))(_0x8635('0x4'));module[_0x8635('0x5')]=function(_0x24553f,_0x3cddbc,_0x5aa029,_0xcf98db){return new BPromise(function(_0x3fba47,_0x4d49e8){logger['info'](_0x8635('0x6'),_0xcf98db||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x213843=new WebSocket(_0xcf98db||_0x8635('0x7'),{'perMessageDeflate':![]});var _0x5561fb='';var _0x3eb151='0';var _0x5b0c5e='1';var _0x18803e=_0x8635('0x8');function _0x4b05da(_0x53ebdf){var _0xab99d6=crypto[_0x8635('0x9')](_0x8635('0xa'));_0xab99d6[_0x8635('0xb')](_0x53ebdf);return _0xab99d6[_0x8635('0xc')](_0x8635('0xd'));}function _0x2557ea(){try{logger[_0x8635('0xe')](_0x8635('0xf'));var _0x491415=moment()[_0x8635('0x10')]();var _0x4054bb=_0x4b05da(_0x491415+_0x3cddbc+_0x5aa029);_0x213843[_0x8635('0x11')](JSON[_0x8635('0x12')]({'appID':_0x3cddbc,'timestamp':_0x491415,'appKey':_0x4054bb}));var _0x23254a=fs[_0x8635('0x13')](_0x24553f);_0x23254a['on'](_0x8635('0x14'),function(_0x55c03c){_0x213843[_0x8635('0x11')](_0x55c03c);});_0x23254a['on']('close',function(){_0x213843['send'](_0x8635('0x15'));});}catch(_0x56c555){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x8635('0x12')](_0x56c555));_0x213843[_0x8635('0x16')]();}}function _0x35b2dd(_0x2532c6){try{if(_0x2532c6){var _0x307cfc=JSON[_0x8635('0x17')](_0x2532c6);switch(_0x307cfc[_0x8635('0x18')]){case 0x0:if(_0x307cfc[_0x8635('0x19')]){if(_0x307cfc['result'][_0x8635('0x1a')]){logger[_0x8635('0xe')]('Tilde\x20ASR\x20hypoteses',JSON[_0x8635('0x12')](_0x307cfc[_0x8635('0x19')]['hypotheses']));_0x5561fb=_0x307cfc[_0x8635('0x19')][_0x8635('0x1b')][0x0]['transcript'];_0x3eb151=_0x307cfc[_0x8635('0x19')][_0x8635('0x1b')][0x0]['likelihood'];_0x5b0c5e='0';_0x18803e=_0x8635('0x1c');_0x213843[_0x8635('0x16')]();}}break;case 0x1:logger[_0x8635('0xe')](_0x8635('0x8'));_0x5b0c5e='1';_0x18803e=_0x8635('0x8');break;case 0x2:logger[_0x8635('0xe')](_0x8635('0x1d'));_0x5b0c5e='2';_0x18803e='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x8635('0xe')](_0x8635('0x1e'));_0x5b0c5e='9';_0x18803e=_0x8635('0x1e');break;case 0xa:logger['info'](_0x8635('0x1f'));_0x5b0c5e='10';_0x18803e=_0x8635('0x1f');break;case 0xb:logger[_0x8635('0xe')](_0x8635('0x20'));_0x5b0c5e='11';_0x18803e=_0x8635('0x20');}}}catch(_0xc88315){logger['error'](_0x8635('0x21'),JSON['stringify'](_0xc88315));_0x213843[_0x8635('0x16')]();}}function _0x57f044(){logger[_0x8635('0xe')](_0x8635('0x22'));_0x3fba47({'transcript':_0x5561fb,'confidence':_0x3eb151,'status':_0x5b0c5e,'status_message':_0x18803e});}function _0x430509(_0xf65f7a){logger[_0x8635('0x23')](_0x8635('0x24'));if(!_[_0x8635('0x25')](_0xf65f7a)){logger[_0x8635('0x23')](_[_0x8635('0x26')](_0xf65f7a)?JSON[_0x8635('0x12')](_0xf65f7a):_0xf65f7a);}}_0x213843['on'](_0x8635('0x27'),_0x2557ea);_0x213843['on'](_0x8635('0x28'),_0x35b2dd);_0x213843['on'](_0x8635('0x29'),_0x57f044);_0x213843['on'](_0x8635('0x23'),_0x430509);});}; \ No newline at end of file +var _0xc512=['transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','error','isObject','open','message','lodash','moment','../../../../../../config/logger','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses'];(function(_0x1e08fa,_0x2177b8){var _0x48a80f=function(_0x38c6d3){while(--_0x38c6d3){_0x1e08fa['push'](_0x1e08fa['shift']());}};_0x48a80f(++_0x2177b8);}(_0xc512,0x1bb));var _0x2c51=function(_0x9471a3,_0x1b51c8){_0x9471a3=_0x9471a3-0x0;var _0x2afef5=_0xc512[_0x9471a3];return _0x2afef5;};'use strict';var BPromise=require('bluebird');var _=require(_0x2c51('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2c51('0x1'));var crypto=require('crypto');var logger=require(_0x2c51('0x2'))(_0x2c51('0x3'));module[_0x2c51('0x4')]=function(_0x1bd842,_0x32c00b,_0x507e15,_0x3d6f29){return new BPromise(function(_0x4c18ff,_0x4a8983){logger['info']('Tilde\x20URI',_0x3d6f29||_0x2c51('0x5'));var _0x4786a6=new WebSocket(_0x3d6f29||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0xb3b96d='';var _0x35fb7e='0';var _0x219e08='1';var _0x14b98d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x470b08(_0x13e33d){var _0x497b51=crypto[_0x2c51('0x6')](_0x2c51('0x7'));_0x497b51[_0x2c51('0x8')](_0x13e33d);return _0x497b51[_0x2c51('0x9')]('hex');}function _0x12f9de(){try{logger[_0x2c51('0xa')](_0x2c51('0xb'));var _0x2ea72b=moment()[_0x2c51('0xc')]();var _0x54fadc=_0x470b08(_0x2ea72b+_0x32c00b+_0x507e15);_0x4786a6[_0x2c51('0xd')](JSON[_0x2c51('0xe')]({'appID':_0x32c00b,'timestamp':_0x2ea72b,'appKey':_0x54fadc}));var _0x140267=fs[_0x2c51('0xf')](_0x1bd842);_0x140267['on'](_0x2c51('0x10'),function(_0x528ab1){_0x4786a6[_0x2c51('0xd')](_0x528ab1);});_0x140267['on'](_0x2c51('0x11'),function(){_0x4786a6[_0x2c51('0xd')](_0x2c51('0x12'));});}catch(_0x574c52){logger['error'](_0x2c51('0x13'),JSON[_0x2c51('0xe')](_0x574c52));_0x4786a6[_0x2c51('0x14')]();}}function _0x5888ab(_0x310b94){try{if(_0x310b94){var _0xe13cb3=JSON[_0x2c51('0x15')](_0x310b94);switch(_0xe13cb3['status']){case 0x0:if(_0xe13cb3[_0x2c51('0x16')]){if(_0xe13cb3[_0x2c51('0x16')][_0x2c51('0x17')]){logger[_0x2c51('0xa')]('Tilde\x20ASR\x20hypoteses',JSON[_0x2c51('0xe')](_0xe13cb3[_0x2c51('0x16')]['hypotheses']));_0xb3b96d=_0xe13cb3[_0x2c51('0x16')][_0x2c51('0x18')][0x0][_0x2c51('0x19')];_0x35fb7e=_0xe13cb3['result']['hypotheses'][0x0][_0x2c51('0x1a')];_0x219e08='0';_0x14b98d=_0x2c51('0x1b');_0x4786a6[_0x2c51('0x14')]();}}break;case 0x1:logger[_0x2c51('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x219e08='1';_0x14b98d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x2c51('0x1c'));_0x219e08='2';_0x14b98d='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2c51('0xa')](_0x2c51('0x1d'));_0x219e08='9';_0x14b98d=_0x2c51('0x1d');break;case 0xa:logger[_0x2c51('0xa')](_0x2c51('0x1e'));_0x219e08='10';_0x14b98d=_0x2c51('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x219e08='11';_0x14b98d='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3b7dd8){logger['error'](_0x2c51('0x1f'),JSON[_0x2c51('0xe')](_0x3b7dd8));_0x4786a6[_0x2c51('0x14')]();}}function _0x13ce17(){logger[_0x2c51('0xa')](_0x2c51('0x20'));_0x4c18ff({'transcript':_0xb3b96d,'confidence':_0x35fb7e,'status':_0x219e08,'status_message':_0x14b98d});}function _0x537f04(_0x258f19){logger['error'](_0x2c51('0x21'));if(!_[_0x2c51('0x22')](_0x258f19)){logger[_0x2c51('0x23')](_[_0x2c51('0x24')](_0x258f19)?JSON[_0x2c51('0xe')](_0x258f19):_0x258f19);}}_0x4786a6['on'](_0x2c51('0x25'),_0x12f9de);_0x4786a6['on'](_0x2c51('0x26'),_0x5888ab);_0x4786a6['on'](_0x2c51('0x11'),_0x13ce17);_0x4786a6['on'](_0x2c51('0x23'),_0x537f04);});}; \ 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 1fd7067..00f3e5f 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 _0x94ea=['./asr','exports'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x94ea,0x1a4));var _0xa94e=function(_0x5bef3c,_0x3d5755){_0x5bef3c=_0x5bef3c-0x0;var _0x58a781=_0x94ea[_0x5bef3c];return _0x58a781;};var asr=require(_0xa94e('0x0'));module[_0xa94e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x10ac=['exports'];(function(_0xb29dcb,_0x5be8d5){var _0x21d4fc=function(_0x5352dd){while(--_0x5352dd){_0xb29dcb['push'](_0xb29dcb['shift']());}};_0x21d4fc(++_0x5be8d5);}(_0x10ac,0x8a));var _0xc10a=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x10ac[_0x1dd82f];return _0x353ca4;};var asr=require('./asr');module[_0xc10a('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 342a88f..d77c440 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 _0xb309=['./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error'];(function(_0x301755,_0xd69dc3){var _0x2dac9a=function(_0x29e089){while(--_0x29e089){_0x301755['push'](_0x301755['shift']());}};_0x2dac9a(++_0xd69dc3);}(_0xb309,0xf8));var _0x9b30=function(_0x1c292d,_0x386576){_0x1c292d=_0x1c292d-0x0;var _0x4f9047=_0xb309[_0x1c292d];return _0x4f9047;};'use strict';var util=require(_0x9b30('0x0'));var net=require('net');var EventEmitter=require(_0x9b30('0x1'))[_0x9b30('0x2')];var AGIError=require(_0x9b30('0x3'));var AGIChannel=require(_0x9b30('0x4'));var AGIServer=function(_0x47c1c5,_0x1d4c47,_0x26f279){var _0x4381ca=this,_0x47c1c5=_0x47c1c5||0x11dd,_0x1d4c47=_0x1d4c47||'127.0.0.1',_0xe4fa24=null,_0x5dc566=0x0;EventEmitter[_0x9b30('0x5')](_0x4381ca);function _0x132291(){if(!_0x47c1c5){_0x4381ca[_0x9b30('0x6')](_0x9b30('0x7'),new AGIError(_0x9b30('0x8')));return![];}_0xe4fa24=net[_0x9b30('0x9')]();_0xe4fa24['listen'](_0x47c1c5,_0x1d4c47);_0xe4fa24['on'](_0x9b30('0xa'),function(){_0x4381ca[_0x9b30('0x6')]('listening');});_0xe4fa24['on'](_0x9b30('0xb'),function(_0x4a6773){_0xe4fa24[_0x9b30('0xc')](function(_0x1cba64,_0x1ad5dc){if(_0x1cba64){_0x4381ca[_0x9b30('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1cba64));}else if(_0x26f279&&_0x26f279<0x0){_0x4381ca['emit'](_0x9b30('0x7'),new AGIError(_0x9b30('0xd')));_0x4a6773[_0x9b30('0xe')]();}else if(_0x26f279&&_0x26f279>0x0&&_0x26f279<_0x1ad5dc){_0x5dc566+=0x1;_0x4381ca[_0x9b30('0x6')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x5dc566));_0x4a6773[_0x9b30('0xe')]();}else{var _0xb0d668=new AGIChannel(_0x4a6773);_0xb0d668['on']('ready',function(){_0x4381ca[_0x9b30('0x6')]('connection',_0xb0d668);});}});});_0xe4fa24['on'](_0x9b30('0x7'),function(_0x1bc07f){_0x4381ca['emit'](_0x9b30('0x7'),new AGIError(_0x9b30('0xf'),_0x1bc07f['code']));});_0xe4fa24['on'](_0x9b30('0x10'),function(){_0x4381ca[_0x9b30('0x6')](_0x9b30('0x10'),new AGIError(_0x9b30('0x11')));});}process[_0x9b30('0x12')](function(){_0x132291();});};util[_0x9b30('0x13')](AGIServer,EventEmitter);module[_0x9b30('0x14')]=function(_0x4ee200,_0x340790,_0x12d686){return new AGIServer(_0x4ee200,_0x340790,_0x12d686);}; \ No newline at end of file +var _0x9539=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','inherits','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x41361e,_0x33c688){var _0x5a0a33=function(_0x285c17){while(--_0x285c17){_0x41361e['push'](_0x41361e['shift']());}};_0x5a0a33(++_0x33c688);}(_0x9539,0x108));var _0x9953=function(_0x3fef9a,_0x54cd20){_0x3fef9a=_0x3fef9a-0x0;var _0x1e46c3=_0x9539[_0x3fef9a];return _0x1e46c3;};'use strict';var util=require(_0x9953('0x0'));var net=require(_0x9953('0x1'));var EventEmitter=require('events')[_0x9953('0x2')];var AGIError=require(_0x9953('0x3'));var AGIChannel=require(_0x9953('0x4'));var AGIServer=function(_0x3ebdc3,_0x385fb7,_0x31b277){var _0x340dd4=this,_0x3ebdc3=_0x3ebdc3||0x11dd,_0x385fb7=_0x385fb7||_0x9953('0x5'),_0x42aba0=null,_0x2e426f=0x0;EventEmitter['call'](_0x340dd4);function _0x545287(){if(!_0x3ebdc3){_0x340dd4[_0x9953('0x6')](_0x9953('0x7'),new AGIError(_0x9953('0x8')));return![];}_0x42aba0=net[_0x9953('0x9')]();_0x42aba0[_0x9953('0xa')](_0x3ebdc3,_0x385fb7);_0x42aba0['on']('listening',function(){_0x340dd4[_0x9953('0x6')](_0x9953('0xb'));});_0x42aba0['on'](_0x9953('0xc'),function(_0x4c9b39){_0x42aba0[_0x9953('0xd')](function(_0x4fa82f,_0x50b1eb){if(_0x4fa82f){_0x340dd4[_0x9953('0x6')](_0x9953('0x7'),new AGIError(_0x9953('0xe'),_0x4fa82f));}else if(_0x31b277&&_0x31b277<0x0){_0x340dd4[_0x9953('0x6')]('error',new AGIError(_0x9953('0xf')));_0x4c9b39[_0x9953('0x10')]();}else if(_0x31b277&&_0x31b277>0x0&&_0x31b277<_0x50b1eb){_0x2e426f+=0x1;_0x340dd4[_0x9953('0x6')](_0x9953('0x7'),new AGIError(_0x9953('0x11'),_0x2e426f));_0x4c9b39['destroy']();}else{var _0x1e73b3=new AGIChannel(_0x4c9b39);_0x1e73b3['on']('ready',function(){_0x340dd4['emit'](_0x9953('0xc'),_0x1e73b3);});}});});_0x42aba0['on'](_0x9953('0x7'),function(_0x1fd28c){_0x340dd4['emit'](_0x9953('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x1fd28c[_0x9953('0x12')]));});_0x42aba0['on']('close',function(){_0x340dd4[_0x9953('0x6')](_0x9953('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x9953('0x14')](function(){_0x545287();});};util[_0x9953('0x15')](AGIServer,EventEmitter);module[_0x9953('0x16')]=function(_0x1ddc06,_0x18c03c,_0x3131e9){return new AGIServer(_0x1ddc06,_0x18c03c,_0x3131e9);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 04e4f1d..9399918 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 _0xa8a8=['variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','speech','out','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','Enter\x20in\x20FINALLY\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20found','response','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','beep','NOBEEP','recordFile','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20operation\x20configured','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','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','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','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','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','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','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','path','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','prototype','getSquareProject','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','channel','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','accountcode','dnid','createSquareMessage','callback_','random','isEmpty','lastName','isNil','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','dialTimezone','CALLERID(dialTimezone)','timezones','utcOffset','scheduledat','add','insertContact','agent','agentPause','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','url','headers','parse','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','model','awsPolly','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','mrcpsynth','noop','isConfigured','MRCPSynth','result','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT'];(function(_0xb19941,_0x589a72){var _0x20b096=function(_0x1f6949){while(--_0x1f6949){_0xb19941['push'](_0xb19941['shift']());}};_0x20b096(++_0x589a72);}(_0xa8a8,0xec));var _0x8a8a=function(_0x286dae,_0x397812){_0x286dae=_0x286dae-0x0;var _0x3506bc=_0xa8a8[_0x286dae];return _0x3506bc;};'use strict';var fs=require('fs');var path=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var _=require(_0x8a8a('0x2'));var sh=require(_0x8a8a('0x3'));var odbc=require('odbc')();var rs=require(_0x8a8a('0x4'));var moment=require(_0x8a8a('0x5'));var Mustache=require(_0x8a8a('0x6'));var rp=require(_0x8a8a('0x7'));var logger=require(_0x8a8a('0x8'))(_0x8a8a('0x9'));var config=require(_0x8a8a('0xa'));var shared=require(_0x8a8a('0xb'));var scripts=require(_0x8a8a('0xc'));var FILES_PATH=_0x8a8a('0xd');var recursiveMapAttributes=[_0x8a8a('0xe'),_0x8a8a('0xf')];var verticesWithRetry=[_0x8a8a('0x10'),_0x8a8a('0x11'),_0x8a8a('0x12')];var AGIVertices=function(_0x58a2f8,_0x576ef9,_0x3c01cd){this['channel']=_0x58a2f8;this[_0x8a8a('0x13')]=_0x576ef9;this[_0x8a8a('0x14')]=_0x3c01cd;};AGIVertices['prototype'][_0x8a8a('0x15')]=function(_0x76b586,_0xb13fca){this['rpc'][_0x8a8a('0x16')](_0x76b586)[_0x8a8a('0x17')](function(_0x330796){_0xb13fca(null,_0x330796?_0x330796[_0x8a8a('0x18')]:![]);})['catch'](function(_0x23febf){_0xb13fca(_0x23febf);});};AGIVertices['prototype'][_0x8a8a('0x19')]=function(_0xb2a3bc,_0x787eec){this[_0x8a8a('0x13')][_0x8a8a('0x1a')](_0xb2a3bc)[_0x8a8a('0x17')](function(_0x16d38d){_0x787eec(null,_0x16d38d?_0x16d38d['name']:![]);})[_0x8a8a('0x1b')](function(_0x568b83){_0x787eec(_0x568b83);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x1d')]=function(_0x46a4f4,_0x4291e9){this[_0x8a8a('0x13')]['getSquareProjectById'](_0x46a4f4)[_0x8a8a('0x17')](function(_0x3d165c){_0x4291e9(null,_0x3d165c?_0x3d165c[_0x8a8a('0x18')]:![]);})[_0x8a8a('0x1b')](function(_0x299827){_0x4291e9(_0x299827);});};AGIVertices[_0x8a8a('0x1c')]['getSquareOdbc']=function(_0x5dc5ae,_0x5181b2){this['rpc']['getSquareOdbcById'](_0x5dc5ae)[_0x8a8a('0x17')](function(_0x45095b){_0x5181b2(null,_0x45095b?_0x45095b[_0x8a8a('0x1e')]:![]);})[_0x8a8a('0x1b')](function(_0x22ebd4){_0x5181b2(_0x22ebd4);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x1f')]=function(_0xe0321c,_0x25d5d4){this[_0x8a8a('0x13')][_0x8a8a('0x20')](_0xe0321c)[_0x8a8a('0x17')](function(_0x3b4ece){_0x25d5d4(null,_0x3b4ece?_0x3b4ece[_0x8a8a('0x18')]:![]);})[_0x8a8a('0x1b')](function(_0x545a38){_0x25d5d4(_0x545a38);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x21')]=function(_0x268b2f,_0x7662e){this[_0x8a8a('0x13')][_0x8a8a('0x22')](_0x268b2f)[_0x8a8a('0x17')](function(_0x5f4dcc){_0x7662e(null,_0x5f4dcc?_0x5f4dcc[_0x8a8a('0x18')]:![]);})[_0x8a8a('0x1b')](function(_0x2e217a){_0x7662e(_0x2e217a);});};AGIVertices['prototype']['getSound']=function(_0x2dafcd,_0x129d11){var _0x5c70bd=this;this['rpc']['getSoundById'](_0x2dafcd)[_0x8a8a('0x17')](function(_0x5c7e58){_0x129d11(null,_0x5c7e58?_0x5c70bd[_0x8a8a('0x23')](_0x5c7e58[_0x8a8a('0x24')]):![]);})['catch'](function(_0x36c7f8){_0x129d11(_0x36c7f8);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x25')]=function(_0x8df0cb,_0x41802e){this[_0x8a8a('0x13')][_0x8a8a('0x26')](_0x8df0cb)[_0x8a8a('0x17')](function(_0x5768a6){_0x41802e(null,_0x5768a6?_0x5768a6:![]);})['catch'](function(_0x56e79e){_0x41802e(_0x56e79e);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x27')]=function(_0x5f301e,_0x2b5dc9,_0x304e83){this['mailRpc'][_0x8a8a('0x27')](_0x5f301e,_0x2b5dc9)[_0x8a8a('0x17')](function(){_0x304e83(null);})[_0x8a8a('0x1b')](function(_0x49e287){_0x304e83(_0x49e287);});};AGIVertices['prototype'][_0x8a8a('0x28')]=function(_0x503b40,_0x2a3198){this[_0x8a8a('0x13')][_0x8a8a('0x29')](_0x503b40)[_0x8a8a('0x17')](function(_0x3c69b4){if(_0x3c69b4){if(_0x3c69b4[_0x8a8a('0x2a')]){_0x2a3198(null,[_0x3c69b4[_0x8a8a('0x2b')]]);}else{_0x2a3198(null,_[_0x8a8a('0x2c')](_0x3c69b4[_0x8a8a('0x2d')],_0x8a8a('0x2b')));}}else{_0x2a3198(null,![]);}})[_0x8a8a('0x1b')](function(_0x45ddb4){_0x2a3198(_0x45ddb4);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x23')]=function(_0x19c21c){return util[_0x8a8a('0x2e')](_0x8a8a('0x2f'),FILES_PATH,_0x19c21c);};AGIVertices[_0x8a8a('0x1c')]['getQueryOdbc']=function(_0x4cc605,_0x53da01,_0x34db33){odbc[_0x8a8a('0x30')](_0x4cc605,function(_0x376de3){if(_0x376de3){logger[_0x8a8a('0x31')](_0x8a8a('0x32'),_0x376de3);_0x34db33(_0x376de3);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x8a8a('0x33')](_0x53da01,function(_0x4fe0bd,_0x41a4c4){if(_0x4fe0bd){logger['info']('Error\x20executing\x20query\x20%s',_0x53da01);_0x34db33(_0x4fe0bd);}else{logger[_0x8a8a('0x34')](_0x8a8a('0x35'),_0x53da01);odbc[_0x8a8a('0x36')](function(_0x19d41d){if(_0x19d41d){logger[_0x8a8a('0x31')](_0x8a8a('0x37'),_0x19d41d);}_0x34db33(null,_0x41a4c4);});}});}});};AGIVertices[_0x8a8a('0x1c')]['getSmsAccount']=function(_0x40d509,_0x48578d){this[_0x8a8a('0x13')]['getSmsAccountById'](_0x40d509)[_0x8a8a('0x17')](function(_0x323f89){_0x48578d(null,_0x323f89?_0x323f89:![]);})[_0x8a8a('0x1b')](function(_0x572e5e){_0x48578d(_0x572e5e);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x38')]=function(_0x14c138,_0x19fd7a){this[_0x8a8a('0x13')][_0x8a8a('0x38')](_0x14c138)['then'](function(_0x4fe325){_0x19fd7a(null,_0x4fe325);})[_0x8a8a('0x1b')](function(_0x568027){_0x19fd7a(_0x568027);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x39')]=function(_0x5151f8,_0x4ed14e,_0x15865f){this[_0x8a8a('0x13')][_0x8a8a('0x39')]({'uniqueid':this[_0x8a8a('0x3a')]['uniqueid'],'node':_0x5151f8[_0x8a8a('0x3b')],'application':_0x5151f8['agicommand'],'data':_0x4ed14e||null,'project_name':this[_0x8a8a('0x3a')][_0x8a8a('0x3c')],'callerid':this['channel'][_0x8a8a('0x3d')]})[_0x8a8a('0x17')](function(_0x2836de){if(_0x15865f){_0x15865f(null,_0x2836de);}})['catch'](function(_0x177f89){if(_0x15865f){_0x15865f(_0x177f89);}});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x3e')]=function(_0x4ad0ad,_0x5466d4,_0x44aed3,_0x1eb8bf){this[_0x8a8a('0x13')]['createSquareRecording']({'uniqueid':this[_0x8a8a('0x3a')][_0x8a8a('0x3f')],'callerid':this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],'calleridname':this[_0x8a8a('0x3a')][_0x8a8a('0x40')],'context':this[_0x8a8a('0x3a')][_0x8a8a('0x41')],'extension':this[_0x8a8a('0x3a')][_0x8a8a('0x42')],'priority':this[_0x8a8a('0x3a')]['priority'],'accountcode':this[_0x8a8a('0x3a')][_0x8a8a('0x43')],'dnid':this[_0x8a8a('0x3a')][_0x8a8a('0x44')],'projectName':this[_0x8a8a('0x3a')][_0x8a8a('0x3c')],'saveName':_0x5466d4,'filename':_0x4ad0ad['file']||_0x5466d4,'savePath':_0x44aed3})[_0x8a8a('0x17')](function(_0x396ffd){_0x1eb8bf(null,_0x396ffd);})[_0x8a8a('0x1b')](function(_0x2c71f3){_0x1eb8bf(_0x2c71f3);});};AGIVertices['prototype'][_0x8a8a('0x45')]=function(_0x3333ff,_0x44e00c,_0x5220c0,_0x4fa5a9,_0x467656){this[_0x8a8a('0x13')][_0x8a8a('0x45')]({'uniqueid':this[_0x8a8a('0x3a')][_0x8a8a('0x3f')],'body':_0x3333ff,'direction':_0x44e00c,'providerName':_0x5220c0,'providerResponse':_0x4fa5a9})[_0x8a8a('0x17')](function(_0x1d1b5c){if(_0x467656){_0x467656(null,_0x1d1b5c);}})[_0x8a8a('0x1b')](function(_0x3379a9){if(_0x467656){_0x467656(_0x3379a9);}});};AGIVertices['prototype']['createCmContact']=function(_0x17ffeb,_0x10f689){var _0x56e170=this;var _0x50b5c5=0x0;var _0x171463={'firstName':_['isEmpty'](_0x17ffeb[_0x8a8a('0x18')])||_['isNil'](_0x17ffeb[_0x8a8a('0x18')])?_0x8a8a('0x46')+Math[_0x8a8a('0x47')]():_0x17ffeb[_0x8a8a('0x18')],'lastName':_[_0x8a8a('0x48')](_0x17ffeb[_0x8a8a('0x49')])||_[_0x8a8a('0x4a')](_0x17ffeb[_0x8a8a('0x49')])?null:_0x17ffeb[_0x8a8a('0x49')],'phone':_0x17ffeb[_0x8a8a('0x4b')],'ListId':_0x17ffeb['list_id'],'scheduledat':_0x17ffeb[_0x8a8a('0x4c')],'callbackUniqueid':this[_0x8a8a('0x3a')][_0x8a8a('0x3f')],'tags':_0x8a8a('0x4d'),'description':_0x8a8a('0x4e')+_0x17ffeb['scheduledAt'][_0x8a8a('0x4f')](),'priority':_0x17ffeb[_0x8a8a('0x50')]};if(_['has'](_0x17ffeb,'dialTimezone')){if(!_[_0x8a8a('0x4a')](_0x17ffeb[_0x8a8a('0x51')])){var _0x322b4c=_0x17ffeb[_0x8a8a('0x51')];if(_0x17ffeb[_0x8a8a('0x51')]==_0x8a8a('0x52')){this['rpc']['getContactByPhone']({'phone':_0x17ffeb['phone']})[_0x8a8a('0x17')](function(_0x54d848){if(!_[_0x8a8a('0x4a')](_0x54d848)){var _0xb84ee7=_0x54d848['dialTimezone'];if(!_[_0x8a8a('0x4a')](_0xb84ee7)){var _0x38ba9f=shared[_0x8a8a('0x53')][_0xb84ee7];if(!_[_0x8a8a('0x4a')](_0x38ba9f)){var _0x4cf6ae=-0x1*_0x38ba9f[_0x8a8a('0x54')];_0x171463['scheduledat']=moment(_0x17ffeb[_0x8a8a('0x55')])[_0x8a8a('0x56')](_0x4cf6ae,'minutes');_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}else{_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}}else{_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}}else{_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}});}else{var _0x50b5c5=shared[_0x8a8a('0x53')][_0x322b4c];if(!_[_0x8a8a('0x4a')](_0x50b5c5)){var _0x46c03d=-0x1*_0x50b5c5['utcOffset'];_0x171463['scheduledat']=moment(_0x17ffeb[_0x8a8a('0x55')])['add'](_0x46c03d,'minutes');_0x56e170['insertContact'](_0x171463,_0x17ffeb,_0x10f689);}else{_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}}}else{_0x56e170[_0x8a8a('0x57')](_0x171463,_0x17ffeb,_0x10f689);}}else{_0x56e170['insertContact'](_0x171463,_0x17ffeb,_0x10f689);}};AGIVertices[_0x8a8a('0x1c')]['getPause']=function(_0x4aa202,_0x142ba6){this[_0x8a8a('0x13')]['getPauseById'](_0x4aa202)[_0x8a8a('0x17')](function(_0x184e96){_0x142ba6(null,_0x184e96?_0x184e96[_0x8a8a('0x18')]:![]);})[_0x8a8a('0x1b')](function(_0x1ceb0c){_0x142ba6(_0x1ceb0c);});};AGIVertices[_0x8a8a('0x1c')]['agentPause']=function(_0x3ca3d6,_0x402b5f,_0x587ea8){var _0x2ce579={'role':_0x8a8a('0x58')};_0x2ce579[_0x3ca3d6]=this[_0x8a8a('0x3a')][_0x8a8a('0x3d')];this[_0x8a8a('0x13')][_0x8a8a('0x59')](_0x2ce579,_0x402b5f,this[_0x8a8a('0x3a')][_0x8a8a('0x3f')])[_0x8a8a('0x17')](function(_0x176ad3){_0x587ea8(null,_['isNil'](_0x176ad3)?![]:!![]);})[_0x8a8a('0x1b')](function(_0x2f7537){logger['error'](_0x2f7537);_0x587ea8(null,![]);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x5a')]=function(_0x2640e3,_0xecece5){var _0x3e0af2={'role':'agent'};_0x3e0af2[_0x2640e3]=this[_0x8a8a('0x3a')][_0x8a8a('0x3d')];this[_0x8a8a('0x13')][_0x8a8a('0x5a')](_0x3e0af2)[_0x8a8a('0x17')](function(_0x224ec2){_0xecece5(null,_[_0x8a8a('0x4a')](_0x224ec2)?![]:!![]);})['catch'](function(_0x2a221b){logger[_0x8a8a('0x31')](_0x2a221b);_0xecece5(null,![]);});};AGIVertices[_0x8a8a('0x1c')]['agentLogout']=function(_0x2f5ef0,_0x54c7c1){var _0x15b2e7={'role':_0x8a8a('0x58')};_0x15b2e7[_0x2f5ef0]=this['channel'][_0x8a8a('0x3d')];this[_0x8a8a('0x13')][_0x8a8a('0x5b')](_0x15b2e7)[_0x8a8a('0x17')](function(_0x2f094e){_0x54c7c1(null,_[_0x8a8a('0x4a')](_0x2f094e)?![]:!![]);})[_0x8a8a('0x1b')](function(_0x25b684){logger[_0x8a8a('0x31')](_0x25b684);_0x54c7c1(null,![]);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x5c')]=function(_0xda5fc1,_0x2f790f){var _0x452062={'role':_0x8a8a('0x58')};_0x452062[_0xda5fc1]=this[_0x8a8a('0x3a')][_0x8a8a('0x3d')];var _0x3ed179=_0xda5fc1!='internal'?util[_0x8a8a('0x2e')]('%s/%s@from-sip/n',_0x8a8a('0x5d'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')]):undefined;this['rpc']['agentLogin'](_0x452062,_0x3ed179)[_0x8a8a('0x17')](function(_0x428b99){_0x2f790f(null,_[_0x8a8a('0x4a')](_0x428b99)?![]:!![]);})['catch'](function(_0x4ab5ef){logger[_0x8a8a('0x31')](_0x4ab5ef);_0x2f790f(null,![]);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x5e')]=function(_0x155cc4,_0x93c3da){sh[_0x8a8a('0x5f')](_[_0x8a8a('0x60')](_0x155cc4),function(_0x403ca1,_0x492682){var _0x38d6ab=_0x492682[_0x8a8a('0x61')](/(\r\n|\n|\r)/gm,'');_0x93c3da(null,_0x38d6ab);});};AGIVertices['prototype'][_0x8a8a('0x62')]=function(_0x316d7b,_0x32490b){scripts[_0x8a8a('0x62')](_0x316d7b[_0x8a8a('0x63')],_0x316d7b[_0x8a8a('0x64')]||'text',_0x316d7b[_0x8a8a('0x65')],_0x316d7b[_0x8a8a('0x66')]||_0x8a8a('0x67'),_0x316d7b[_0x8a8a('0x68')]||_0x8a8a('0x69'),_0x316d7b['audioEncoding']||_0x8a8a('0x6a'))[_0x8a8a('0x17')](function(_0x34d140){_0x32490b(null,_0x34d140);})[_0x8a8a('0x1b')](function(_0x4bb34e){_0x32490b(_0x4bb34e);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x6b')]=function(_0x106df7,_0x351f25){scripts[_0x8a8a('0x6b')](_0x106df7['text'],_0x106df7[_0x8a8a('0x6c')]||'en',0x1)[_0x8a8a('0x17')](function(_0x3bb8d7){_0x351f25(null,_0x3bb8d7);})[_0x8a8a('0x1b')](function(_0xb74976){_0x351f25(_0xb74976);});};AGIVertices['prototype']['restAPI']=function(_0xa11598,_0x46c4f6){var _0x3d63be={'uri':_0xa11598['url'],'method':_0xa11598[_0x8a8a('0x6d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xa11598[_0x8a8a('0x6e')])===_0x8a8a('0x6f')&&parseInt(_0xa11598[_0x8a8a('0x6e')])>=0x1?parseInt(_0xa11598['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8a8a('0x70')]([_0x8a8a('0x71'),_0x8a8a('0x72')],_0x3d63be['method']['toUpperCase']())){try{_0x3d63be['body']=_0xa11598[_0x8a8a('0xf')]?JSON['parse'](_0xa11598[_0x8a8a('0xf')]):{};}catch(_0x5a3682){logger['error'](_0x8a8a('0x73'),_0x5a3682);}}try{_0x3d63be['headers']=_0xa11598['rawHeaders']?JSON['parse'](_0xa11598[_0x8a8a('0xe')]):{};}catch(_0x49aa1b){logger['error'](_0x8a8a('0x74'),_0x49aa1b);}if(_0xa11598['computedVariables']){try{var _0x376c22=require(_0xa11598['computedVariables'])[_0x8a8a('0x75')](this,_0x3d63be);_0x3d63be[_0x8a8a('0x76')]=Mustache[_0x8a8a('0x77')](_0xa11598[_0x8a8a('0x78')],_0x376c22,{},['$$','$$']);if(_0x3d63be['headers']){_0x3d63be[_0x8a8a('0x79')]=JSON[_0x8a8a('0x7a')](Mustache['render'](JSON[_0x8a8a('0x7b')](_0x3d63be[_0x8a8a('0x79')]),_0x376c22,{},['$$','$$']));}if(_0x3d63be[_0x8a8a('0x7c')]){_0x3d63be[_0x8a8a('0x7c')]=JSON['parse'](Mustache['render'](JSON[_0x8a8a('0x7b')](_0x3d63be[_0x8a8a('0x7c')]),_0x376c22,{},['$$','$$']));}}catch(_0x9ee234){logger['error'](_0x8a8a('0x7d'),_0x9ee234);}}rp(_0x3d63be)[_0x8a8a('0x17')](function(_0x928e93){var _0x4acabe={'statusCode':_0x928e93[_0x8a8a('0x7e')]||0xc8,'statusMessage':_0x928e93[_0x8a8a('0x7f')]||'OK','headers':_0x928e93[_0x8a8a('0x79')]||{},'body':_0x928e93[_0x8a8a('0x7c')]||{}};_0x46c4f6(null,_0x4acabe);})[_0x8a8a('0x1b')](function(_0x5e3b50){var _0xc9fbd2={'statusCode':_0x5e3b50[_0x8a8a('0x7e')]||0x1f4,'statusMessage':_0x5e3b50[_0x8a8a('0x80')]||_0x8a8a('0x81'),'headers':_0x5e3b50[_0x8a8a('0x82')][_0x8a8a('0x79')]||{},'body':_0x5e3b50[_0x8a8a('0x82')]['body']||{}};_0x46c4f6(null,_0xc9fbd2);});};AGIVertices['prototype'][_0x8a8a('0x83')]=function(_0x3038fe,_0x14f808){scripts['googleDialogflow'](this[_0x8a8a('0x3a')][_0x8a8a('0x3f')],_0x3038fe[_0x8a8a('0x84')],_0x3038fe[_0x8a8a('0x65')],_0x3038fe[_0x8a8a('0x85')]||'en')[_0x8a8a('0x17')](function(_0x3a0e27){_0x14f808(null,_0x3a0e27);})[_0x8a8a('0x1b')](function(_0xc3cb36){_0x14f808(_0xc3cb36);});};AGIVertices[_0x8a8a('0x1c')]['googleDialogflowV2']=function(_0x217e95,_0x2b21c0){scripts[_0x8a8a('0x86')](this['channel'][_0x8a8a('0x3f')],_0x217e95[_0x8a8a('0x87')],_0x217e95[_0x8a8a('0x88')],_0x217e95['private_key'],_0x217e95['text'],_0x217e95[_0x8a8a('0x89')]||'en')[_0x8a8a('0x17')](function(_0x2319a4){_0x2b21c0(null,_0x2319a4);})[_0x8a8a('0x1b')](function(_0x51c5ce){_0x2b21c0(_0x51c5ce);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x8a')]=function(_0x12f863,_0xa23098){scripts['sestekNDA'](this['channel'],_0x12f863)[_0x8a8a('0x17')](function(_0x300948){_0xa23098(null,_0x300948);})[_0x8a8a('0x1b')](function(_0x4ac1da){_0xa23098(_0x4ac1da);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x8b')]=function(_0x2affff,_0x198083){scripts[_0x8a8a('0x8b')](_0x2affff['key'],_0x2affff[_0x8a8a('0x65')],_0x2affff['ispeech_tts_language']||_0x8a8a('0x67'),_0x2affff[_0x8a8a('0x8c')])[_0x8a8a('0x17')](function(_0x60fbf2){_0x198083(null,_0x60fbf2);})[_0x8a8a('0x1b')](function(_0x34502e){_0x198083(_0x34502e);});};AGIVertices['prototype'][_0x8a8a('0x8d')]=function(_0x257c5d,_0x4c2010,_0x5b4fa9){scripts[_0x8a8a('0x8d')](_0x4c2010,_0x257c5d[_0x8a8a('0x84')],_0x257c5d['ispeech_asr_language']||_0x8a8a('0x67'),this['isConfigured'](_0x257c5d['model'])?_0x257c5d[_0x8a8a('0x8e')]:undefined)[_0x8a8a('0x17')](function(_0xdf0d3b){_0x5b4fa9(null,_0xdf0d3b);})['catch'](function(_0x3e555e){_0x5b4fa9(_0x3e555e);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x8f')]=function(_0x311010,_0x232ab9){scripts[_0x8a8a('0x8f')](_0x311010['aws_access_key_id'],_0x311010['aws_secret_access_key'],_0x311010['aws_polly_region'],_0x311010[_0x8a8a('0x90')]||_0x8a8a('0x91'),_0x311010[_0x8a8a('0x65')],_0x311010[_0x8a8a('0x92')]||_0x8a8a('0x65'))[_0x8a8a('0x17')](function(_0x29627c){_0x232ab9(null,_0x29627c);})[_0x8a8a('0x1b')](function(_0x3afd87){_0x232ab9(_0x3afd87);});};AGIVertices['prototype'][_0x8a8a('0x93')]=function(_0x41180e,_0x2f3fb5){scripts[_0x8a8a('0x93')](this[_0x8a8a('0x3a')][_0x8a8a('0x3f')],_0x41180e['aws_access_key_id'],_0x41180e['aws_secret_access_key'],_0x41180e['aws_lex_region'],_0x41180e[_0x8a8a('0x65')],_0x41180e['aws_bot_name'])[_0x8a8a('0x17')](function(_0x5383c3){_0x2f3fb5(null,_0x5383c3);})[_0x8a8a('0x1b')](function(_0x48922c){_0x2f3fb5(_0x48922c);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x94')]=function(_0x5e8094,_0x12110e,_0x4a53d4){scripts['googleASR'](_0x12110e,_0x5e8094[_0x8a8a('0x84')],_0x5e8094['google_asr_language']||_0x8a8a('0x67'))['then'](function(_0x17f681){_0x4a53d4(null,_0x17f681);})['catch'](function(_0x34aa82){_0x4a53d4(_0x34aa82);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x95')]=function(_0x34ae3d,_0x545317,_0x39c9ad){scripts[_0x8a8a('0x95')](_0x545317,_0x34ae3d[_0x8a8a('0x96')],_0x34ae3d[_0x8a8a('0x97')],_0x34ae3d['uri'])[_0x8a8a('0x17')](function(_0x38263b){_0x39c9ad(null,_0x38263b);})[_0x8a8a('0x1b')](function(_0x4e4983){_0x39c9ad(_0x4e4983);});};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x98')]=function(_0x1e3cb3){var _0x3b10f1=_[_0x8a8a('0x70')](verticesWithRetry,_0x1e3cb3['agicommand'])?_0x1e3cb3:_['clone'](_0x1e3cb3);for(var _0x260a4a in _0x3b10f1){if(_0x3b10f1[_0x8a8a('0x99')](_0x260a4a)){if(_0x3b10f1[_0x260a4a]&&_[_0x8a8a('0x9a')](_0x3b10f1[_0x260a4a])){if(_['includes'](recursiveMapAttributes,_0x260a4a)){_0x3b10f1[_0x260a4a]=this[_0x8a8a('0x9b')](_0x3b10f1[_0x260a4a]);}else{_0x3b10f1[_0x260a4a]=this[_0x8a8a('0x9c')](_0x3b10f1[_0x260a4a]);}}}}return _0x3b10f1;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x4636ec){for(var _0x31d11f in _0x4636ec){if(_0x4636ec[_0x8a8a('0x99')](_0x31d11f)){if(_['isPlainObject'](_0x4636ec[_0x31d11f])){this[_0x8a8a('0x9d')](_0x4636ec[_0x31d11f]);}else if(_[_0x8a8a('0x9e')](_0x4636ec[_0x31d11f])){for(var _0x5d2e43=0x0;_0x5d2e43<_0x4636ec[_0x31d11f][_0x8a8a('0x9f')];_0x5d2e43++){this[_0x8a8a('0x9d')](_0x4636ec[_0x31d11f][_0x5d2e43]);}}else if(_['isString'](_0x4636ec[_0x31d11f])){_0x4636ec[_0x31d11f]=this[_0x8a8a('0x9c')](_0x4636ec[_0x31d11f]);}}}};AGIVertices['prototype'][_0x8a8a('0xa0')]=function(_0x16a4a8,_0x575f64){for(var _0x2a0d12 in _0x16a4a8){if(_0x16a4a8[_0x8a8a('0x99')](_0x2a0d12)){if(_['isPlainObject'](_0x16a4a8[_0x2a0d12])){if(!_[_0x8a8a('0x48')](_0x16a4a8[_0x2a0d12])){this['saveRestApiResult'](_0x16a4a8[_0x2a0d12],util[_0x8a8a('0x2e')](_0x8a8a('0xa1'),_0x575f64,_0x2a0d12));}}else if(_['isArray'](_0x16a4a8[_0x2a0d12])){for(var _0x157102=0x0;_0x157102<_0x16a4a8[_0x2a0d12][_0x8a8a('0x9f')];_0x157102++){this[_0x8a8a('0xa0')](_0x16a4a8[_0x2a0d12][_0x157102],util['format'](_0x8a8a('0xa1'),_0x575f64,_0x2a0d12+'['+_0x157102+']'));}}else{if(!_['isNil'](_0x16a4a8[_0x2a0d12])){this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0xa1'),_0x575f64,_0x2a0d12),_0x16a4a8[_0x2a0d12]);}}}}};AGIVertices[_0x8a8a('0x1c')]['replaceObjectAllVariables']=function(_0x19d4f6){try{var _0x478190=JSON['parse'](_0x19d4f6);this[_0x8a8a('0x9d')](_0x478190);return JSON[_0x8a8a('0x7b')](_0x478190);}catch(_0x4477b2){return this['replaceAllVariables'](_0x19d4f6);}};AGIVertices['prototype'][_0x8a8a('0x9c')]=function(_0x1cb3aa){var _0x279002=_0x1cb3aa[_0x8a8a('0xa3')]('{');for(var _0x461430=0x1;_0x461430<_0x279002[_0x8a8a('0x9f')];_0x461430+=0x1){var _0x36e2e3=_0x279002[_0x461430]['split']('}');if(_0x36e2e3['length']>0x1){_0x1cb3aa=_0x1cb3aa['replaceAll']('{'+_0x36e2e3[0x0]+'}',this[_0x8a8a('0x3a')][_0x8a8a('0x15')](_0x36e2e3[0x0])[_0x8a8a('0xa4')]||_0x36e2e3[0x0]);}}if(_0x279002['length']===0x1){return _0x1cb3aa[_0x8a8a('0x4f')]();}return this[_0x8a8a('0x9c')](_0x1cb3aa);};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xa5')]=function(_0x3154ee,_0x545699){var _0x14bcab=this[_0x8a8a('0x3a')][_0x8a8a('0x15')](_0x3154ee);if(_0x14bcab['result']===-0x1){return _0x14bcab;}logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xa6'),_0x545699,_0x14bcab['extra']));return this['channel'][_0x8a8a('0xa2')](_0x545699,_0x14bcab[_0x8a8a('0xa4')]);};AGIVertices[_0x8a8a('0x1c')]['isConfigured']=function(_0x2fed73){return _0x2fed73&&_0x2fed73!=='0'&&_0x2fed73!=='-1'&&_0x2fed73!=='';};AGIVertices[_0x8a8a('0x1c')]['maxRetry']=function(_0x7701b8){this[_0x8a8a('0x39')]['sync'](this,_0x7701b8,'-');_0x7701b8[_0x8a8a('0xa7')]=_0x7701b8['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x8a8a('0xa8')]=function(_0x16c1b7){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x16c1b7[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x16c1b7['text'])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('no\x20text\x20configured');}var _0x27edb7='\x22'+_0x16c1b7[_0x8a8a('0x65')]+'\x22';if(this[_0x8a8a('0xaa')](_0x16c1b7[_0x8a8a('0x82')])){_0x27edb7+=','+_0x16c1b7[_0x8a8a('0x82')];}var _0x597f68=this[_0x8a8a('0x3a')]['exec'](_0x8a8a('0xab'),_0x27edb7);if(_0x597f68[_0x8a8a('0xac')]===-0x1){return _0x597f68;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x27edb7));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xad')]=function(_0x5c5c7e){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x5c5c7e[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x5c5c7e[_0x8a8a('0xae')])){return this['channel']['noop'](_0x8a8a('0xaf'));}var _0x4d9d70=_0x5c5c7e[_0x8a8a('0xae')];if(this['isConfigured'](_0x5c5c7e[_0x8a8a('0x82')])){_0x4d9d70+=','+_0x5c5c7e['options'];}var _0x4caec3=this['channel']['exec'](_0x8a8a('0xb0'),_0x4d9d70);if(_0x4caec3[_0x8a8a('0xac')]===-0x1){return _0x4caec3;}var _0x18b14b=this['getAndSetVariable'](_0x8a8a('0xb1'),_0x8a8a('0xb2'));if(_0x18b14b[_0x8a8a('0xac')]===-0x1){return _0x18b14b;}var _0x2a8177=this[_0x8a8a('0xa5')](_0x8a8a('0xb3'),_0x8a8a('0xb4'));if(_0x2a8177['result']===-0x1){return _0x2a8177;}var _0x4df369=this[_0x8a8a('0xa5')](_0x8a8a('0xb5'),_0x8a8a('0xb6'));if(_0x4df369['result']===-0x1){return _0x4df369;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xb7'),_0x4d9d70));};AGIVertices['prototype']['agi']=function(_0x45647){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xb8'),_0x45647[_0x8a8a('0x3b')]));return this[_0x8a8a('0x3a')][_0x8a8a('0x9')]([_0x45647[_0x8a8a('0xb9')],_0x45647[_0x8a8a('0xba')]]);};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xbb')]=function(_0x5376b6){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xbc'),_0x5376b6[_0x8a8a('0x3b')]));if(this[_0x8a8a('0xaa')](_0x5376b6[_0x8a8a('0x6e')])){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xbd'),_0x5376b6[_0x8a8a('0x6e')]));var _0x34e9ae=this['channel'][_0x8a8a('0xbe')](_0x5376b6[_0x8a8a('0x6e')]);if(_0x34e9ae[_0x8a8a('0xac')]===-0x1){return _0x34e9ae;}}return this[_0x8a8a('0x3a')]['answer']();};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x4d')]=function(_0x39f42e){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xbf'),_0x39f42e['label']));if(!this[_0x8a8a('0xaa')](_0x39f42e[_0x8a8a('0xc0')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x39f42e,_0x8a8a('0xc1'));}_0x39f42e[_0x8a8a('0x4c')]=moment();if(this[_0x8a8a('0xaa')](_0x39f42e[_0x8a8a('0xc2')])){_0x39f42e['scheduledAt']=moment()[_0x8a8a('0x56')](_0x39f42e[_0x8a8a('0xc2')],_0x8a8a('0xc3'));}if(!this[_0x8a8a('0xaa')](_0x39f42e[_0x8a8a('0x50')])){_0x39f42e[_0x8a8a('0x50')]=0x2;}this[_0x8a8a('0xc4')][_0x8a8a('0x75')](this,_0x39f42e);return this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0xc5'),_0x39f42e[_0x8a8a('0x4b')],_0x39f42e[_0x8a8a('0xc0')],_0x39f42e[_0x8a8a('0x4c')]));};AGIVertices['prototype'][_0x8a8a('0xc6')]=function(_0x28217e){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xc7'),_0x28217e['label']));var _0x4dbb00=this['channel'][_0x8a8a('0x5f')](_0x28217e[_0x8a8a('0xc8')],_0x28217e[_0x8a8a('0x82')]);if(_0x4dbb00[_0x8a8a('0xac')]===-0x1){return _0x4dbb00;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format'](_0x8a8a('0xc9'),_0x28217e[_0x8a8a('0xc8')],_0x28217e[_0x8a8a('0x82')]));};AGIVertices['prototype'][_0x8a8a('0xca')]=function(_0x1f205e){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0xcb'),_0x1f205e[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x1f205e['text'])){return this[_0x8a8a('0x3a')]['noop']('no\x20text\x20configured');}var _0x54ce27='\x22'+_0x1f205e[_0x8a8a('0x65')]+'\x22';if(this[_0x8a8a('0xaa')](_0x1f205e[_0x8a8a('0x82')])){_0x54ce27+=','+_0x1f205e[_0x8a8a('0x82')];}var _0x59a80b=this[_0x8a8a('0x3a')]['exec'](_0x8a8a('0xab'),_0x54ce27);if(_0x59a80b[_0x8a8a('0xac')]===-0x1){return _0x59a80b;}return this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('Executed\x20command\x20MRCPSynth\x20%s',_0x54ce27));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xcc')]=function(_0x5e9e59){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xcd'),_0x5e9e59[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x5e9e59['text'])){return this['channel'][_0x8a8a('0xa9')](_0x8a8a('0xce'));}var _0x489f57='\x22'+_0x5e9e59[_0x8a8a('0x65')]+'\x22';if(this[_0x8a8a('0xaa')](_0x5e9e59[_0x8a8a('0x82')])){_0x489f57+=','+_0x5e9e59[_0x8a8a('0x82')];}var _0x459ff4=this[_0x8a8a('0x3a')][_0x8a8a('0x5f')](_0x8a8a('0xab'),_0x489f57);if(_0x459ff4[_0x8a8a('0xac')]===-0x1){return _0x459ff4;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xcf'),_0x489f57));};AGIVertices['prototype'][_0x8a8a('0xd0')]=function(_0x3999e1){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0xd1'),_0x3999e1[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x3999e1[_0x8a8a('0xae')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xaf'));}var _0x20c8b6=_0x3999e1[_0x8a8a('0xae')];if(this[_0x8a8a('0xaa')](_0x3999e1[_0x8a8a('0x82')])){_0x20c8b6+=','+_0x3999e1['options'];}var _0x3c4868=this[_0x8a8a('0x3a')][_0x8a8a('0x5f')](_0x8a8a('0xb0'),_0x20c8b6);if(_0x3c4868[_0x8a8a('0xac')]===-0x1){return _0x3c4868;}var _0x3f0724=this[_0x8a8a('0xa5')]('RECOG_CONFIDENCE()',_0x8a8a('0xd2'));if(_0x3f0724[_0x8a8a('0xac')]===-0x1){return _0x3f0724;}var _0x4acc01=this[_0x8a8a('0xa5')]('RECOG_INPUT()',_0x8a8a('0xd3'));if(_0x4acc01[_0x8a8a('0xac')]===-0x1){return _0x4acc01;}var _0x5bf816=this[_0x8a8a('0xa5')](_0x8a8a('0xb5'),'LUMENVOX_ASR_INSTANCE');if(_0x5bf816[_0x8a8a('0xac')]===-0x1){return _0x5bf816;}return this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')]('Executed\x20command\x20MRCPRecog\x20%s',_0x20c8b6));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xd4')]=function(_0x3d4a3e){logger['info'](util['format'](_0x8a8a('0xd5'),_0x3d4a3e['label']));if(!this[_0x8a8a('0xaa')](_0x3d4a3e['grammar'])){return this['channel'][_0x8a8a('0xa9')]('no\x20grammar\x20configured');}var _0x4a837b=_0x3d4a3e[_0x8a8a('0xae')];if(this[_0x8a8a('0xaa')](_0x3d4a3e[_0x8a8a('0x82')])){_0x4a837b+=','+_0x3d4a3e[_0x8a8a('0x82')];}var _0x13213b=this['channel'][_0x8a8a('0x5f')](_0x8a8a('0xb0'),_0x4a837b);if(_0x13213b[_0x8a8a('0xac')]===-0x1){return _0x13213b;}var _0x526be2=this[_0x8a8a('0xa5')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x526be2['result']===-0x1){return _0x526be2;}var _0x1a1b8a=this['getAndSetVariable']('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x1a1b8a[_0x8a8a('0xac')]===-0x1){return _0x1a1b8a;}var _0x159c37=this[_0x8a8a('0xa5')](_0x8a8a('0xb5'),'SESTEK_ASR_INSTANCE');if(_0x159c37[_0x8a8a('0xac')]===-0x1){return _0x159c37;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format'](_0x8a8a('0xb7'),_0x4a837b));};AGIVertices['prototype']['database']=function(_0x40c9cb){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xd6'),_0x40c9cb[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x40c9cb[_0x8a8a('0xd7')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x40c9cb,_0x8a8a('0xd8'));}var _0x18b99c=this[_0x8a8a('0xd9')][_0x8a8a('0x75')](this,_0x40c9cb[_0x8a8a('0xd7')]);if(!_0x18b99c){return this[_0x8a8a('0x3a')]['error'](_0x40c9cb,_0x8a8a('0xda'));}if(!this['isConfigured'](_0x40c9cb[_0x8a8a('0x33')])){return this[_0x8a8a('0x3a')]['error'](_0x40c9cb,'no\x20query\x20configured');}var _0x41391d=_0x40c9cb[_0x8a8a('0x33')][_0x8a8a('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xdb'),_0x41391d));var _0x258c76=this[_0x8a8a('0xdc')][_0x8a8a('0x75')](this,_0x18b99c,_0x41391d);this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x40c9cb,_0x41391d);if(!this[_0x8a8a('0xaa')](_0x40c9cb['variable_id'])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xdd'));}var _0x4219c6=this[_0x8a8a('0x15')][_0x8a8a('0x75')](this,_0x40c9cb[_0x8a8a('0xde')]);if(!_0x4219c6){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x40c9cb,_0x8a8a('0xdf'));}var _0x188b7c=this;_0x258c76[_0x8a8a('0xe0')](function(_0xf2322c,_0x1530bb){Object[_0x8a8a('0xe1')](_0xf2322c)[_0x8a8a('0xe0')](function(_0x3a97c8){_0x188b7c[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0xe2'),_0x4219c6,_0x1530bb,_0x3a97c8),_0xf2322c[_0x3a97c8]);});});this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0xe3'),_0x4219c6),_0x258c76[_0x8a8a('0x9f')]);return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xe4'),_0x4219c6));};AGIVertices[_0x8a8a('0x1c')]['dial']=function(_0x4cbb2c){logger[_0x8a8a('0xe5')](util['format'](_0x8a8a('0xe6'),_0x4cbb2c[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x4cbb2c[_0x8a8a('0xe7')])){return this['channel'][_0x8a8a('0x31')](_0x4cbb2c,_0x8a8a('0xe8'));}var _0x2ae822=this[_0x8a8a('0x1f')][_0x8a8a('0x75')](this,_0x4cbb2c[_0x8a8a('0xe7')]);if(!_0x2ae822){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x4cbb2c,_0x8a8a('0xe9'));}var _0x9415d6=this[_0x8a8a('0x3a')]['exec'](_0x8a8a('0xea'),[util[_0x8a8a('0x2e')](_0x8a8a('0xeb'),_0x2ae822),_0x4cbb2c[_0x8a8a('0x6e')],_0x4cbb2c[_0x8a8a('0xec')],_0x4cbb2c[_0x8a8a('0x78')]]);if(_0x9415d6[_0x8a8a('0xac')]===-0x1){return _0x9415d6;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xed'),'DIAL'));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0xee')]=function(_0x2f4e37){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2f4e37['label']));if(!this[_0x8a8a('0xaa')](_0x2f4e37[_0x8a8a('0x84')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xef'));}if(!this['isConfigured'](_0x2f4e37[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xce'));}this[_0x8a8a('0x3a')][_0x8a8a('0xf0')]=!![];this[_0x8a8a('0x39')](_0x2f4e37);this['createSquareMessage'](_0x2f4e37[_0x8a8a('0x65')],'in','','');this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xf1'),_0x2f4e37[_0x8a8a('0x65')]));var _0x49a387=this[_0x8a8a('0x83')][_0x8a8a('0x75')](this,_0x2f4e37);if(_0x49a387){for(var _0x2946c5 in _0x49a387){if(_0x49a387[_0x8a8a('0x99')](_0x2946c5)){this['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0xf2'),_0x2946c5[_0x8a8a('0xf3')]()),_0x49a387[_0x2946c5]);}}this[_0x8a8a('0x45')](_0x49a387['speech'],'out',_0x8a8a('0xee'),'');return this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0xf4'),_0x49a387['speech']));}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x2f4e37,_0x8a8a('0xf5'));};AGIVertices[_0x8a8a('0x1c')]['dialogflowV2']=function(_0x2f68b3){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0xf6'),_0x2f68b3['label']));if(!this[_0x8a8a('0xaa')](_0x2f68b3[_0x8a8a('0x87')])){return this['channel'][_0x8a8a('0xa9')](_0x8a8a('0xf7'));}if(!this[_0x8a8a('0xaa')](_0x2f68b3[_0x8a8a('0x88')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xf8'));}if(!this[_0x8a8a('0xaa')](_0x2f68b3[_0x8a8a('0xf9')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xfa'));}if(!this['isConfigured'](_0x2f68b3[_0x8a8a('0x89')])){return this['channel'][_0x8a8a('0xa9')]('no\x20anguage\x20configured');}if(!this[_0x8a8a('0xaa')](_0x2f68b3[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('no\x20text\x20configured');}this[_0x8a8a('0x3a')]['bot']=!![];this[_0x8a8a('0x39')](_0x2f68b3);this[_0x8a8a('0x45')](_0x2f68b3[_0x8a8a('0x65')],'in','','');this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xfb'),_0x2f68b3[_0x8a8a('0x65')]));var _0x48afa7=this['googleDialogflowV2'][_0x8a8a('0x75')](this,_0x2f68b3);if(_0x48afa7){for(var _0x268a78 in _0x48afa7){if(_0x48afa7[_0x8a8a('0x99')](_0x268a78)){if(_0x268a78!==_0x8a8a('0xfc')){this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0xf2'),_0x268a78[_0x8a8a('0xf3')]()),_0x48afa7[_0x268a78]);}}}this[_0x8a8a('0x45')](_0x48afa7['speech'],'out',_0x8a8a('0xfd'),_0x48afa7[_0x8a8a('0xfc')]);return this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xfe'),_0x48afa7['speech']));}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x2f68b3,_0x8a8a('0xff'));};AGIVertices['prototype']['sesteknda']=function(_0xb425fc){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x100'),_0xb425fc[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0xb425fc[_0x8a8a('0x101')])){return this['channel']['noop'](_0x8a8a('0x102'));}if(!this[_0x8a8a('0xaa')](_0xb425fc['username'])){return this[_0x8a8a('0x3a')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0xb425fc[_0x8a8a('0x103')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0x104'));}if(!this[_0x8a8a('0xaa')](_0xb425fc[_0x8a8a('0x105')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x8a8a('0x3a')][_0x8a8a('0xf0')]=!![];this[_0x8a8a('0x39')](_0xb425fc);this['createSquareMessage'](_0xb425fc['text'],'in','','');this['channel'][_0x8a8a('0xa9')](util['format'](_0x8a8a('0x106'),_0xb425fc[_0x8a8a('0x65')]));var _0x51c6f8=this[_0x8a8a('0x8a')]['sync'](this,_0xb425fc);if(_0x51c6f8){for(var _0x51744a in _0x51c6f8){if(_0x51c6f8[_0x8a8a('0x99')](_0x51744a)){this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util['format'](_0x8a8a('0x107'),_0x51744a[_0x8a8a('0xf3')]()),_0x51c6f8[_0x51744a]);}}this['createSquareMessage'](_0x51c6f8[_0x8a8a('0x108')],_0x8a8a('0x109'),_0x8a8a('0x10a'),'');if(_0x51c6f8[_0x8a8a('0x10b')]){this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format'](_0x8a8a('0x10c'),_0x51c6f8[_0x8a8a('0x10b')]));var _0x33354c=this[_0x8a8a('0x3a')][_0x8a8a('0x10d')](_0x51c6f8['audiofile']);try{fs[_0x8a8a('0x10e')](_0x51c6f8['audiofile']+_0x8a8a('0x10f'));}catch(_0xa4df63){logger[_0x8a8a('0x31')](_0xa4df63);}return _0x33354c;}else{return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('SestekNDA\x20Result\x20%s',_0x51c6f8['speech']));}}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0xb425fc,_0x8a8a('0x110'));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x111')]=function(_0x259d14){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x112'),_0x259d14[_0x8a8a('0x3b')]));return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('end');};AGIVertices[_0x8a8a('0x1c')]['ext_dial']=function(_0x109388){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x113'),_0x109388[_0x8a8a('0x3b')]));var _0x1d36eb='';if(_0x109388[_0x8a8a('0x114')]){if(!this['isConfigured'](_0x109388[_0x8a8a('0x114')])){return this['channel'][_0x8a8a('0x31')](_0x109388,'no\x20trunk\x20selected');}else{var _0x117aac=parseInt(_0x109388[_0x8a8a('0x114')],0xa);if(isNaN(_0x117aac)){_0x1d36eb=_0x109388[_0x8a8a('0x114')];}else{_0x1d36eb=this[_0x8a8a('0x21')]['sync'](this,_0x109388['trunk_id']);if(!_0x1d36eb){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x109388,'no\x20trunk\x20found');}}}}else if(_0x109388[_0x8a8a('0x115')]){_0x1d36eb=_0x109388['trunk_name'];}else{return this['channel'][_0x8a8a('0x31')](_0x109388,_0x8a8a('0x116'));}var _0x293bf4=this['channel'][_0x8a8a('0x5f')](_0x8a8a('0xea'),[util[_0x8a8a('0x2e')]('SIP/%s/%s',_0x1d36eb,_0x109388[_0x8a8a('0x4b')]),_0x109388[_0x8a8a('0x6e')],_0x109388['opts'],_0x109388['url']]);if(_0x293bf4[_0x8a8a('0xac')]===-0x1){return _0x293bf4;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xed'),'DIAL'));};AGIVertices[_0x8a8a('0x1c')]['finally']=function(_0x482544){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x117'),_0x482544[_0x8a8a('0x3b')]));return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('finally');};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x11')]=function(_0x3fd2a0){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3fd2a0[_0x8a8a('0x3b')]));if(_0x3fd2a0['retry']===0x0){return this[_0x8a8a('0x118')](_0x3fd2a0);}_0x3fd2a0['retry']-=0x1;if(!this['isConfigured'](_0x3fd2a0[_0x8a8a('0x119')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x3fd2a0,'no\x20file\x20audio\x20selected');}var _0x25e8fc=this['getSound'][_0x8a8a('0x75')](this,_0x3fd2a0[_0x8a8a('0x119')]);if(!_0x25e8fc){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x3fd2a0,_0x8a8a('0x11a'));}if(!this[_0x8a8a('0xaa')](_0x3fd2a0[_0x8a8a('0xde')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x8a8a('0xdd'));}var _0x16cc6c=this['channel']['getData'](_0x25e8fc,_0x3fd2a0[_0x8a8a('0x11b')],_0x3fd2a0[_0x8a8a('0x11c')]);var _0x2e6741=_0x16cc6c['result']?_0x16cc6c['result'][_0x8a8a('0x4f')]():'';logger[_0x8a8a('0x34')]('test',JSON['stringify'](_0x16cc6c));if(_0x16cc6c[_0x8a8a('0xac')]===-0x1){this[_0x8a8a('0x39')]['sync'](this,_0x3fd2a0,_0x2e6741);return _0x16cc6c;}else if(_0x16cc6c['extra']===_0x8a8a('0x6e')){_0x16cc6c['result']=_0x2e6741[_0x8a8a('0x9f')]>=parseInt(_0x3fd2a0['mindigit'])?'x':'i';}else{_0x16cc6c[_0x8a8a('0xac')]=_0x2e6741['length']>=parseInt(_0x3fd2a0['mindigit'])&&_0x2e6741['length']<=parseInt(_0x3fd2a0[_0x8a8a('0x11c')])?'x':'i';}var _0x5cc50f=this[_0x8a8a('0x15')][_0x8a8a('0x75')](this,_0x3fd2a0[_0x8a8a('0xde')]);if(!_0x5cc50f){return this['channel']['error'](_0x3fd2a0,_0x8a8a('0xdf'));}this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](_0x5cc50f,_0x2e6741);if(this['isConfigured'](_0x3fd2a0[_0x8a8a('0x11d')])){var _0xa18686=parseInt(_0x3fd2a0[_0x8a8a('0x11d')],0xa);var _0x5e4abc=rs['generate']({'charset':'*','length':_0xa18686});var _0x4a68f4=_0x2e6741['length'];if(_0x4a68f4>0x0){if(_0x4a68f4>_0xa18686){this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x3fd2a0,_0x3fd2a0[_0x8a8a('0x11e')]===_0x8a8a('0x11f')?_0x5e4abc+_0x2e6741[_0x8a8a('0x120')](_0xa18686):_0x2e6741[_0x8a8a('0x120')](0x0,_0x4a68f4-_0xa18686)+_0x5e4abc);}else{this[_0x8a8a('0x39')]['sync'](this,_0x3fd2a0,rs[_0x8a8a('0x121')]({'charset':'*','length':_0x4a68f4}));}}else{this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x3fd2a0,'');}}else{this['createSquareDetailsReport'][_0x8a8a('0x75')](this,_0x3fd2a0,_0x2e6741);}return _0x16cc6c;};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x12')]=function(_0x5174f0){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x122'),_0x5174f0[_0x8a8a('0x3b')]));return this[_0x8a8a('0x11')](_0x5174f0);};AGIVertices[_0x8a8a('0x1c')]['goal']=function(_0x137def){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x123'),_0x137def[_0x8a8a('0x3b')]));this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x137def,_0x137def[_0x8a8a('0x124')]);return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x125'),_0x137def[_0x8a8a('0x124')]));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x126')]=function(_0x289424){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x127'),_0x289424[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x289424[_0x8a8a('0x128')])||!this[_0x8a8a('0xaa')](_0x289424[_0x8a8a('0x129')])){return this['channel']['noop'](_0x8a8a('0x12a'));}if(!this[_0x8a8a('0xaa')](_0x289424[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0xce'));}this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x12b'),_0x289424[_0x8a8a('0x65')]));var _0x3885d2=this['awsPolly'][_0x8a8a('0x75')](this,_0x289424);if(_0x3885d2){this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x12c'),_0x3885d2));var _0x4234a9=this[_0x8a8a('0x3a')][_0x8a8a('0x10d')](_0x3885d2);try{fs[_0x8a8a('0x10e')](_0x3885d2+_0x8a8a('0x10f'));}catch(_0x268030){logger['error'](_0x268030);}return _0x4234a9;}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x289424,_0x8a8a('0x12d'));};AGIVertices['prototype'][_0x8a8a('0x12e')]=function(_0x43eaa5){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x12f'),_0x43eaa5['label']));if(!this[_0x8a8a('0xaa')](_0x43eaa5['aws_access_key_id'])||!this[_0x8a8a('0xaa')](_0x43eaa5[_0x8a8a('0x129')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0x12a'));}if(!this[_0x8a8a('0xaa')](_0x43eaa5[_0x8a8a('0x130')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0x131'));}if(!this[_0x8a8a('0xaa')](_0x43eaa5[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0xce'));}this[_0x8a8a('0x3a')][_0x8a8a('0xf0')]=!![];this['createSquareDetailsReport'](_0x43eaa5);this[_0x8a8a('0x45')](_0x43eaa5[_0x8a8a('0x65')],'in','','');this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x43eaa5[_0x8a8a('0x65')]));var _0xda7872=this['awsLex'][_0x8a8a('0x75')](this,_0x43eaa5);if(_0xda7872){for(var _0x32a64c in _0xda7872){if(_0xda7872[_0x8a8a('0x99')](_0x32a64c)&&_[_0x8a8a('0x9a')](_0xda7872[_0x32a64c])){this['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0x132'),_0x32a64c['toUpperCase']()),_0xda7872[_0x32a64c]);}}if(_[_0x8a8a('0x4a')](_0xda7872['message'])){return this[_0x8a8a('0x3a')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x8a8a('0x45')](_0xda7872['message'],_0x8a8a('0x109'),_0x8a8a('0x133'),'');return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('Amazon\x20Lex\x20Result\x20%s',_0xda7872[_0x8a8a('0x80')]));}}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x43eaa5,_0x8a8a('0x134'));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x135')]=function(_0x5bcf5e){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x136'),_0x5bcf5e[_0x8a8a('0x3b')],_0x5bcf5e[_0x8a8a('0x6e')]));if(!this[_0x8a8a('0xaa')](_0x5bcf5e[_0x8a8a('0x84')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xef'));}var _0x3a5fc3='wav';var _0x49f317=util['format'](_0x8a8a('0x137'),FILES_PATH,rs[_0x8a8a('0x121')](0x4));var _0x1c0953=util['format']('%s.%s',_0x49f317,_0x3a5fc3);var _0x2211a0=!![];if(_0x5bcf5e['beep']==='NOBEEP'){_0x2211a0=![];}var _0x4f6f49=this[_0x8a8a('0x3a')]['recordFile'](_0x49f317,_0x3a5fc3,_0x5bcf5e[_0x8a8a('0x138')],_0x5bcf5e[_0x8a8a('0x6e')],undefined,_0x2211a0);if(_0x4f6f49[_0x8a8a('0xac')]!==-0x1){this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x139'),_0x1c0953));var _0x5dffaa=this['googleASR'][_0x8a8a('0x75')](this,_0x5bcf5e,_0x1c0953);if(_0x5dffaa){for(var _0x1c3e50 in _0x5dffaa){if(_0x5dffaa[_0x8a8a('0x99')](_0x1c3e50)){this['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0x13a'),_0x1c3e50[_0x8a8a('0xf3')]()),_0x5dffaa[_0x1c3e50]);}}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x13b'),JSON[_0x8a8a('0x7b')](_0x5dffaa)));}}return _0x4f6f49;};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x13c')]=function(_0x567f23){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x13d'),_0x567f23['label']));if(!this['isConfigured'](_0x567f23[_0x8a8a('0x96')])){return this['channel']['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x567f23[_0x8a8a('0x97')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0x13e'));}var _0xd18606=_0x8a8a('0x13f');var _0x263250=util[_0x8a8a('0x2e')](_0x8a8a('0x137'),FILES_PATH,rs[_0x8a8a('0x121')](0x4));var _0x366e2f=util['format'](_0x8a8a('0xa1'),_0x263250,_0xd18606);var _0x596653=!![];if(_0x567f23[_0x8a8a('0x140')]===_0x8a8a('0x141')){_0x596653=![];}var _0x165e64=this[_0x8a8a('0x3a')][_0x8a8a('0x142')](_0x263250,_0xd18606,_0x567f23[_0x8a8a('0x138')],_0x567f23[_0x8a8a('0x6e')],undefined,_0x596653);if(_0x165e64[_0x8a8a('0xac')]!==-0x1){this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('tilde\x20%s\x20file\x20created',_0x366e2f));var _0x5e951d=this['tildeASR'][_0x8a8a('0x75')](this,_0x567f23,_0x366e2f);if(_0x5e951d){for(var _0x55931b in _0x5e951d){if(_0x5e951d[_0x8a8a('0x99')](_0x55931b)){this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0x143'),_0x55931b['toUpperCase']()),_0x5e951d[_0x55931b]);}}return this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')]('TildeASR\x20Result\x20%s',JSON[_0x8a8a('0x7b')](_0x5e951d)));}}return _0x165e64;};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x144')]=function(_0x383f0d){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x145'),_0x383f0d['label']));return this[_0x8a8a('0x3a')]['continueAt'](_0x383f0d['context'],_0x383f0d['extension'],_0x383f0d['priority']);};AGIVertices['prototype'][_0x8a8a('0x146')]=function(_0x3cff27){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x147'),_0x3cff27[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x3cff27['condition'])){return this['channel']['error'](_0x3cff27,_0x8a8a('0x148'));}try{var _0x1eb684=eval(_0x3cff27[_0x8a8a('0x149')])?_0x8a8a('0x14a'):_0x8a8a('0x14b');this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x14c'),_0x3cff27[_0x8a8a('0x149')],_0x1eb684));return{'code':0xc8,'result':_0x1eb684};}catch(_0x509c75){return{'code':0xc8,'result':_0x8a8a('0x14b')};}};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x14d')]=function(_0x590fa9){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x14e'),_0x590fa9[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x590fa9[_0x8a8a('0x14f')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x590fa9,'no\x20interval\x20configured');}var _0x5827d3=this[_0x8a8a('0x28')]['sync'](this,_0x590fa9['interval_id']);if(!_0x5827d3){return this['channel']['error'](_0x590fa9,'no\x20intervals\x20found');}for(var _0x5d28bb=0x0;_0x5d28bb<_0x5827d3['length'];_0x5d28bb+=0x1){var _0x45e631=this['channel'][_0x8a8a('0x15')](util[_0x8a8a('0x2e')](_0x8a8a('0x150'),_0x5827d3[_0x5d28bb]));if(_0x45e631['result']===-0x1){return _0x45e631;}logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x151'),_0x5827d3[_0x5d28bb],_0x45e631[_0x8a8a('0xa4')]));if(_0x45e631['extra']==='true'){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('IFTIME\x20%s\x20%s',_0x5827d3[_0x5d28bb],_0x8a8a('0x14a')));this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('IFTIME\x20%s\x20%s',_0x5827d3[_0x5d28bb],_0x8a8a('0x14a')));return{'code':0xc8,'result':'true'};}else{logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x151'),_0x5827d3[_0x5d28bb],_0x8a8a('0x14b')));this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x151'),_0x5827d3[_0x5d28bb],_0x8a8a('0x14b')));}}return{'code':0xc8,'result':_0x8a8a('0x14b')};};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x152')]=function(_0x30ccc5){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x30ccc5[_0x8a8a('0x3b')]));return this[_0x8a8a('0x3a')][_0x8a8a('0x152')]();};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x153')]=function(_0x167230){logger['info'](util[_0x8a8a('0x2e')](_0x8a8a('0x154'),_0x167230['label']));if(!this[_0x8a8a('0xaa')](_0x167230[_0x8a8a('0x84')])){return this[_0x8a8a('0x3a')]['noop']('no\x20key\x20configured');}var _0x586205=_0x8a8a('0x13f');var _0x2d6ad4=util[_0x8a8a('0x2e')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x15dead=util[_0x8a8a('0x2e')]('%s.%s',_0x2d6ad4,_0x586205);var _0xdf8449=!![];if(_0x167230[_0x8a8a('0x140')]===_0x8a8a('0x141')){_0xdf8449=![];}var _0x25f94c=this[_0x8a8a('0x3a')]['recordFile'](_0x2d6ad4,_0x586205,_0x167230['intKey'],_0x167230['timeout'],undefined,_0xdf8449);if(_0x25f94c[_0x8a8a('0xac')]!==-0x1){this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x155'),_0x15dead));var _0x15ed75=this[_0x8a8a('0x8d')]['sync'](this,_0x167230,_0x15dead);if(_0x15ed75){for(var _0x28ff9a in _0x15ed75){if(_0x15ed75[_0x8a8a('0x99')](_0x28ff9a)){this['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0x156'),_0x28ff9a[_0x8a8a('0xf3')]()),_0x15ed75[_0x28ff9a]);}}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x8a8a('0x7b')](_0x15ed75)));}}return _0x25f94c;};AGIVertices[_0x8a8a('0x1c')]['ispeechtts']=function(_0x2d0deb){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x157'),_0x2d0deb[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x2d0deb[_0x8a8a('0x84')])){return this[_0x8a8a('0x3a')]['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x2d0deb[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0xce'));}this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x158'),_0x2d0deb['text']));var _0x43af89=this[_0x8a8a('0x8b')][_0x8a8a('0x75')](this,_0x2d0deb);if(_0x43af89){this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format'](_0x8a8a('0x155'),_0x43af89));var _0x213be0=this[_0x8a8a('0x3a')][_0x8a8a('0x10d')](_0x43af89,_0x2d0deb['intKey']);try{fs[_0x8a8a('0x10e')](_0x43af89+'.wav');}catch(_0x3807c8){logger[_0x8a8a('0x31')](_0x3807c8);}return _0x213be0;}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x2d0deb,_0x8a8a('0x159'));};AGIVertices['prototype'][_0x8a8a('0x15a')]=function(_0x5b74a2){logger[_0x8a8a('0x34')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5b74a2[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x5b74a2[_0x8a8a('0x15b')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x5b74a2,_0x8a8a('0x15c'));}logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15d'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x5b74a2[_0x8a8a('0x15b')]));var _0x11cf94=this[_0x8a8a('0x5c')][_0x8a8a('0x75')](this,_0x5b74a2[_0x8a8a('0x15b')]);if(_0x11cf94){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x5b74a2[_0x8a8a('0x15b')]));this['channel']['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x5b74a2['findBy']));return{'code':0xc8,'result':_0x8a8a('0x15f')};}else{logger['info'](util[_0x8a8a('0x2e')](_0x8a8a('0x160'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x5b74a2[_0x8a8a('0x15b')]));this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x160'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x5b74a2['findBy']));return{'code':0xc8,'result':_0x8a8a('0x161')};}};AGIVertices[_0x8a8a('0x1c')]['logout']=function(_0x469830){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x162'),_0x469830[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x469830[_0x8a8a('0x15b')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x469830,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x469830[_0x8a8a('0x15b')]));var _0x2a1e52=this['agentLogout'][_0x8a8a('0x75')](this,_0x469830[_0x8a8a('0x15b')]);if(_0x2a1e52){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x469830[_0x8a8a('0x15b')]));this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x469830['findBy']));return{'code':0xc8,'result':_0x8a8a('0x15f')};}else{logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x160'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x469830[_0x8a8a('0x15b')]));this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x160'),this['channel']['callerid'],_0x469830['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8a8a('0x1c')]['math']=function(_0x1575a2){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1575a2[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x1575a2['operation'])){return this[_0x8a8a('0x3a')]['error'](_0x1575a2,_0x8a8a('0x163'));}this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format']('math\x20%s',_0x1575a2[_0x8a8a('0x164')]));var _0x4396ad=eval(_0x1575a2['operation']);if(!this[_0x8a8a('0xaa')](_0x1575a2['variable_id'])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4fca22=this[_0x8a8a('0x15')][_0x8a8a('0x75')](this,_0x1575a2[_0x8a8a('0xde')]);if(!_0x4fca22){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x1575a2,_0x8a8a('0xdf'));}if(_[_0x8a8a('0x9e')](_0x4396ad)){var _0x52befc=this;_0x4396ad[_0x8a8a('0xe0')](function(_0x3758b1,_0x519700){_0x52befc['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')]('%s[%s]',_0x4fca22,_0x519700),_0x3758b1);});return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util['format'](_0x8a8a('0x165'),_0x4fca22));}else{return this['channel'][_0x8a8a('0xa2')](_0x4fca22,_0x4396ad);}};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x10')]=function(_0x5cc363){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x166'),_0x5cc363[_0x8a8a('0x3b')]));if(_0x5cc363[_0x8a8a('0xa7')]===0x0){return this['maxRetry'](_0x5cc363);}_0x5cc363['retry']-=0x1;if(!this[_0x8a8a('0xaa')](_0x5cc363['file_id'])){return this['channel']['error'](_0x5cc363,_0x8a8a('0x167'));}var _0x6b6f88=this[_0x8a8a('0x168')][_0x8a8a('0x75')](this,_0x5cc363[_0x8a8a('0x119')]);if(!_0x6b6f88){return this[_0x8a8a('0x3a')]['error'](_0x5cc363,'no\x20file\x20audio\x20found');}var _0x48336e=this[_0x8a8a('0x3a')][_0x8a8a('0x169')](_0x6b6f88,_0x5cc363['response'],_0x5cc363[_0x8a8a('0x16a')]);var _0x39d445=_0x48336e[_0x8a8a('0xac')];if(_0x48336e['result']===-0x1){this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x5cc363,'-1');return _0x48336e;}else if(_0x48336e[_0x8a8a('0xa4')]===_0x8a8a('0x6e')){_0x48336e[_0x8a8a('0xac')]=_0x48336e[_0x8a8a('0xac')]['length']>0x0?_0x48336e[_0x8a8a('0xac')]:'t';}else if(_[_0x8a8a('0x48')](_0x48336e[_0x8a8a('0xac')])){_0x48336e['result']='#';_0x39d445='#';}if(!this[_0x8a8a('0xaa')](_0x5cc363[_0x8a8a('0xde')])){this[_0x8a8a('0x3a')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1210b4=this[_0x8a8a('0x15')][_0x8a8a('0x75')](this,_0x5cc363[_0x8a8a('0xde')]);if(!_0x1210b4){return this['channel'][_0x8a8a('0x31')](_0x5cc363,_0x8a8a('0xdf'));}this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](_0x1210b4,_0x39d445);}this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x5cc363,_0x39d445);return _0x48336e;};AGIVertices[_0x8a8a('0x1c')]['noop']=function(_0x40902b){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x16b'),_0x40902b['label']));return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x40902b[_0x8a8a('0x16c')]||_0x40902b['label']);};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x16d')]=function(_0x2cb9b6){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x16e'),_0x2cb9b6[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x2cb9b6['findBy'])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x2cb9b6,'no\x20find\x20by\x20configured');}logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15d'),this['channel'][_0x8a8a('0x3d')],_0x2cb9b6[_0x8a8a('0x15b')]));var _0x526af9=this[_0x8a8a('0x16f')][_0x8a8a('0x75')](this,_0x2cb9b6[_0x8a8a('0x170')]);var _0x11b076=this[_0x8a8a('0x59')][_0x8a8a('0x75')](this,_0x2cb9b6[_0x8a8a('0x15b')],_0x526af9);if(_0x11b076){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')]['callerid'],_0x2cb9b6[_0x8a8a('0x15b')]));this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x2cb9b6[_0x8a8a('0x15b')]));return{'code':0xc8,'result':_0x8a8a('0x15f')};}else{logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x160'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x2cb9b6[_0x8a8a('0x15b')]));this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x2cb9b6['findBy']));return{'code':0xc8,'result':_0x8a8a('0x161')};}};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x171')]=function(_0x44f90c){logger['info'](util['format'](_0x8a8a('0x172'),_0x44f90c['label']));if(!this['isConfigured'](_0x44f90c[_0x8a8a('0x119')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x44f90c,_0x8a8a('0x167'));}var _0x184ea9=this[_0x8a8a('0x168')]['sync'](this,_0x44f90c['file_id']);if(!_0x184ea9){return this[_0x8a8a('0x3a')]['error'](_0x44f90c,_0x8a8a('0x11a'));}var _0x4f5cc9=this['channel'][_0x8a8a('0x5f')](_0x8a8a('0x173'),[_0x184ea9,_0x44f90c['opts']]);if(_0x4f5cc9[_0x8a8a('0xac')]===-0x1){return _0x4f5cc9;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xc9'),_0x8a8a('0x173'),_0x184ea9));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x174')]=function(_0xe6f8d1){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x175'),_0xe6f8d1[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0xe6f8d1[_0x8a8a('0x176')])){return this[_0x8a8a('0x3a')]['error'](_0xe6f8d1,_0x8a8a('0x177'));}var _0x57b7c1='';var _0x2978cd=parseInt(_0xe6f8d1[_0x8a8a('0x176')],0xa);if(isNaN(_0x2978cd)){_0x57b7c1=_0xe6f8d1[_0x8a8a('0x176')];}else{_0x57b7c1=this[_0x8a8a('0x19')][_0x8a8a('0x75')](this,_0xe6f8d1[_0x8a8a('0x176')]);if(!_0x57b7c1){return this['channel'][_0x8a8a('0x31')](_0xe6f8d1,_0x8a8a('0x178'));}}var _0x1ebbbc='';if(this['isConfigured'](_0xe6f8d1[_0x8a8a('0x119')])){var _0x109290=this[_0x8a8a('0x168')][_0x8a8a('0x75')](this,_0xe6f8d1[_0x8a8a('0x119')]);if(_0x109290){_0x1ebbbc=_0x109290;}}this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0xe6f8d1,_0x57b7c1);if(_0xe6f8d1[_0x8a8a('0xec')][_0x8a8a('0x179')]('x')<0x0){_0xe6f8d1[_0x8a8a('0xec')]+='x';}if(_0xe6f8d1['opts'][_0x8a8a('0x179')]('X')<0x0){_0xe6f8d1[_0x8a8a('0xec')]+='X';}this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](_0x8a8a('0x17a'),_0x57b7c1?_0x57b7c1['toLowerCase']():'');var _0x19975d=this[_0x8a8a('0x3a')][_0x8a8a('0x5f')]('QUEUE',[_0x57b7c1,_0xe6f8d1[_0x8a8a('0xec')],_0xe6f8d1['url'],_0x1ebbbc,_0xe6f8d1[_0x8a8a('0x6e')],_0xe6f8d1[_0x8a8a('0x9')],_0xe6f8d1['macro'],_0xe6f8d1[_0x8a8a('0x17b')],'',_0xe6f8d1[_0x8a8a('0x17c')]]);if(_0x19975d['result']===-0x1){return _0x19975d;}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xc9'),'QUEUE',_0x57b7c1));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x17d')]=function(_0x148f99){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x17e'),_0x148f99[_0x8a8a('0x3b')]));var _0x2df1ec=_0x148f99['recordingFormat']||_0x8a8a('0x13f');var _0x3c6731=util[_0x8a8a('0x2e')]('%s_%s',this['channel']['uniqueid'],rs[_0x8a8a('0x121')](0x5));var _0x4842fb=util[_0x8a8a('0x2e')](_0x8a8a('0x17f'),FILES_PATH,_0x3c6731,_0x2df1ec);var _0x47075d=util[_0x8a8a('0x2e')](_0x8a8a('0x137'),FILES_PATH,_0x3c6731);this[_0x8a8a('0x3e')]['sync'](this,_0x148f99,_0x3c6731,_0x4842fb);this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](_0x8a8a('0x180'),_0x3c6731);logger[_0x8a8a('0x34')](_0x8a8a('0x181'),_0x47075d,_0x2df1ec,_0x148f99[_0x8a8a('0x182')],_0x148f99[_0x8a8a('0x6e')]);return this['channel']['recordFile'](_0x47075d,_0x2df1ec,_0x148f99['escape_digits'],_0x148f99[_0x8a8a('0x6e')],undefined,!![]);};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x183')]=function(_0x1d1133){logger['info'](util[_0x8a8a('0x2e')](_0x8a8a('0x184'),_0x1d1133[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x1d1133[_0x8a8a('0x78')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('no\x20url\x20configured');}var _0x1af470=this[_0x8a8a('0x185')][_0x8a8a('0x75')](this,_0x1d1133);logger['info'](util[_0x8a8a('0x2e')](_0x8a8a('0x186'),util['inspect'](_0x1af470,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1d1133[_0x8a8a('0xde')])){return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x499ff5=this[_0x8a8a('0x15')][_0x8a8a('0x75')](this,_0x1d1133[_0x8a8a('0xde')]);if(!_0x499ff5){return this['channel'][_0x8a8a('0x31')](_0x1d1133,_0x8a8a('0xdf'));}this['channel'][_0x8a8a('0xa2')](util[_0x8a8a('0x2e')](_0x8a8a('0x187'),_0x499ff5),_0x1af470['statusCode']?_0x1af470['statusCode']:_0x8a8a('0x188'));this['channel']['setVariable'](util['format'](_0x8a8a('0x189'),_0x499ff5),_0x1af470['statusMessage']?_0x1af470[_0x8a8a('0x7f')]:'OK');if(_0x1af470[_0x8a8a('0x7c')]){try{this[_0x8a8a('0xa0')](_0x1af470[_0x8a8a('0x7c')],_0x499ff5);}catch(_0x448ce1){logger[_0x8a8a('0x31')](util[_0x8a8a('0x2e')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x499ff5));}}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xe4'),_0x499ff5));};AGIVertices[_0x8a8a('0x1c')]['saydigits']=function(_0x53ebb6){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x53ebb6['label']));return this[_0x8a8a('0x3a')][_0x8a8a('0x18a')](_0x53ebb6[_0x8a8a('0x18b')][_0x8a8a('0x61')](/\s+/g,''),_0x53ebb6[_0x8a8a('0x182')]);};AGIVertices['prototype']['saynumber']=function(_0x2ceaaa){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x18c'),_0x2ceaaa[_0x8a8a('0x3b')]));return this[_0x8a8a('0x3a')][_0x8a8a('0x18d')](_0x2ceaaa[_0x8a8a('0x6f')]['replace'](/\s+/g,''),_0x2ceaaa[_0x8a8a('0x182')]);};AGIVertices[_0x8a8a('0x1c')]['sayphonetic']=function(_0x54a141){logger['info'](util[_0x8a8a('0x2e')](_0x8a8a('0x18e'),_0x54a141['label']));return this['channel']['sayPhonetic'](_0x54a141[_0x8a8a('0x65')],_0x54a141[_0x8a8a('0x182')]);};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x18f')]=function(_0xffd5ea){logger['info'](util[_0x8a8a('0x2e')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xffd5ea[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0xffd5ea[_0x8a8a('0x190')])){return this['channel'][_0x8a8a('0xa9')]('no\x20mail\x20account\x20configured');}var _0x211791=this[_0x8a8a('0x25')]['sync'](this,_0xffd5ea[_0x8a8a('0x190')]);if(!_0x211791||!_0x211791[_0x8a8a('0x191')]){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0xffd5ea,_0x8a8a('0x192'));}var _0x556f8e={'from':util['format'](_0x8a8a('0x193'),_0x211791[_0x8a8a('0x18')],_0x211791[_0x8a8a('0x194')]||_0x211791[_0x8a8a('0x191')][_0x8a8a('0x195')]),'to':_0xffd5ea['to']||'','cc':_0xffd5ea['cc']||'','bcc':_0xffd5ea['bcc']||'','subject':_0xffd5ea[_0x8a8a('0x196')],'html':_0xffd5ea[_0x8a8a('0x65')],'text':_0xffd5ea['text']};var _0xde48f6={'tls':{'rejectUnauthorized':![]}};if(_0x211791[_0x8a8a('0x191')][_0x8a8a('0x197')]){_0xde48f6['service']=_0x211791[_0x8a8a('0x191')][_0x8a8a('0x197')];}else{_0xde48f6['host']=_0x211791['Smtp'][_0x8a8a('0x198')];_0xde48f6[_0x8a8a('0x199')]=_0x211791[_0x8a8a('0x191')]['port'];_0xde48f6[_0x8a8a('0x19a')]=_0x211791[_0x8a8a('0x191')][_0x8a8a('0x19a')];}if(_0x211791[_0x8a8a('0x191')][_0x8a8a('0x19b')]){_0xde48f6[_0x8a8a('0x19c')]={'user':_0x211791['Smtp']['user'],'pass':_0x211791[_0x8a8a('0x191')]['pass']};}if(this['isConfigured'](_0xffd5ea[_0x8a8a('0x19d')])){}logger['debug'](_0x8a8a('0x19e'),JSON[_0x8a8a('0x7b')](_0x556f8e));this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0xffd5ea,_0xffd5ea['account_id']);this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x211791[_0x8a8a('0x18')]));this[_0x8a8a('0x27')][_0x8a8a('0x75')](this,_0xde48f6,_0x556f8e);return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0x19f'));};AGIVertices['prototype'][_0x8a8a('0x1a0')]=function(_0x3e0b20){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1a1'),_0x3e0b20[_0x8a8a('0x3b')]));return this['channel'][_0x8a8a('0xa9')](_0x8a8a('0x1a2'));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x1a3')]=function(_0x424359){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1a4'),_0x424359[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x424359[_0x8a8a('0x1a5')])){return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0x1a6'));}var _0x1973ab=this[_0x8a8a('0x1a7')][_0x8a8a('0x75')](this,_0x424359[_0x8a8a('0x1a5')]);if(!_0x1973ab){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x424359,_0x8a8a('0x1a8'));}var _0x2520dc={'body':_0x424359[_0x8a8a('0x1a9')],'phone':_0x424359['to']||'','SmsAccountId':_0x1973ab['id']};logger[_0x8a8a('0xe5')](_0x8a8a('0x1aa'),JSON[_0x8a8a('0x7b')](_0x2520dc));this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x424359,_0x424359['sms_account_id']);this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x1ab'),_0x1973ab[_0x8a8a('0x18')]));this[_0x8a8a('0x38')][_0x8a8a('0x75')](this,_0x2520dc);return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0x1ac'));};AGIVertices['prototype'][_0x8a8a('0x1ad')]=function(_0xb41548){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1ae'),_0xb41548[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0xb41548[_0x8a8a('0xde')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0xb41548,'no\x20variable\x20selected');}var _0x3f043c=this[_0x8a8a('0x15')]['sync'](this,_0xb41548[_0x8a8a('0xde')]);if(!_0x3f043c){return this[_0x8a8a('0x3a')]['error'](_0xb41548,'no\x20variable\x20found');}return this[_0x8a8a('0x3a')][_0x8a8a('0xa2')](_0x3f043c,_0xb41548['variable_value']);};AGIVertices['prototype']['start']=function(_0xbf2436){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1af'),_0xbf2436[_0x8a8a('0x3b')]));this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](_0x8a8a('0x1b0'));if(_0xbf2436[_0x8a8a('0xbb')]===_0x8a8a('0x1b1')){this['channel'][_0x8a8a('0xa9')](_0x8a8a('0x1b2'));return this[_0x8a8a('0x3a')][_0x8a8a('0xbb')]();}return this[_0x8a8a('0x3a')]['noop'](_0x8a8a('0x1b3'));};AGIVertices['prototype']['subproject']=function(_0x1c3d15){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1b4'),_0x1c3d15[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x1c3d15[_0x8a8a('0x1b5')])){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x1c3d15,_0x8a8a('0x1b6'));}var _0x126167=this[_0x8a8a('0x1d')]['sync'](this,_0x1c3d15[_0x8a8a('0x1b5')]);if(!this[_0x8a8a('0xaa')](_0x126167)){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x1c3d15,util[_0x8a8a('0x2e')](_0x8a8a('0x1b7'),_0x1c3d15[_0x8a8a('0x1b5')]));}if(_0x126167===this[_0x8a8a('0x3a')][_0x8a8a('0x3c')]){return this[_0x8a8a('0x3a')]['error'](_0x1c3d15,_0x8a8a('0x1b8'));}this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x1c3d15,_0x126167);var _0x16e289=this[_0x8a8a('0x3a')][_0x8a8a('0x5f')]('AGI',util[_0x8a8a('0x2e')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0x8a8a('0x1b9'),_0x126167,this[_0x8a8a('0x3a')][_0x8a8a('0x3c')]));if(_0x16e289[_0x8a8a('0xac')]===-0x1){return _0x16e289;}return this[_0x8a8a('0x3a')]['noop'](util['format'](_0x8a8a('0xc9'),_0x8a8a('0x1ba'),_0x126167));};AGIVertices[_0x8a8a('0x1c')]['system']=function(_0x4b65d1){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1bb'),_0x4b65d1['label']));var _0x5ce075=this[_0x8a8a('0x5e')][_0x8a8a('0x75')](this,_0x4b65d1[_0x8a8a('0xb9')]);this[_0x8a8a('0x39')][_0x8a8a('0x75')](this,_0x4b65d1,_0x4b65d1[_0x8a8a('0xb9')]);if(this[_0x8a8a('0xaa')](_0x4b65d1[_0x8a8a('0xde')])){var _0x14c02b=this[_0x8a8a('0x15')]['sync'](this,_0x4b65d1[_0x8a8a('0xde')]);if(_0x14c02b){this[_0x8a8a('0x3a')]['setVariable'](_0x14c02b,_0x5ce075);return this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x4b65d1['command'],_0x14c02b));}}return this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4b65d1[_0x8a8a('0xb9')]));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x1bc')]=function(_0x52316e){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1bd'),_0x52316e[_0x8a8a('0x3b')]));_0x52316e[_0x8a8a('0x65')]=_0x52316e['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x52316e[_0x8a8a('0x63')])){return this[_0x8a8a('0x3a')]['noop']('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x52316e[_0x8a8a('0x65')])){return this[_0x8a8a('0x3a')]['noop']('no\x20text\x20configured');}this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0x1be'),_0x52316e[_0x8a8a('0x65')]));var _0x6c9075=this[_0x8a8a('0x62')][_0x8a8a('0x75')](this,_0x52316e);if(_0x6c9075){this[_0x8a8a('0x3a')]['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x1bf'),_0x6c9075));var _0xb76e5=this[_0x8a8a('0x3a')][_0x8a8a('0x10d')](_0x6c9075);try{fs[_0x8a8a('0x10e')](_0x6c9075+_0x8a8a('0x10f'));}catch(_0x1a2663){logger[_0x8a8a('0x31')](_0x1a2663);}return _0xb76e5;}return this['channel'][_0x8a8a('0x31')](_0x52316e,_0x8a8a('0x1c0'));};AGIVertices['prototype'][_0x8a8a('0x1c1')]=function(_0x49e8a8){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x1c2'),_0x49e8a8[_0x8a8a('0x3b')]));_0x49e8a8[_0x8a8a('0x65')]=_0x49e8a8[_0x8a8a('0x65')][_0x8a8a('0x61')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x49e8a8[_0x8a8a('0x65')])){return this['channel'][_0x8a8a('0xa9')](_0x8a8a('0xce'));}this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('Trying\x20Google\x20TTS\x20%s',_0x49e8a8[_0x8a8a('0x65')]));var _0x30efb0=this[_0x8a8a('0x6b')][_0x8a8a('0x75')](this,_0x49e8a8);if(_0x30efb0){this['channel']['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x1c3'),_0x30efb0));var _0x20a64e=this[_0x8a8a('0x3a')][_0x8a8a('0x10d')](_0x30efb0);try{fs['unlink'](_0x30efb0+_0x8a8a('0x10f'));}catch(_0x31a8c3){logger[_0x8a8a('0x31')](_0x31a8c3);}return _0x20a64e;}return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x49e8a8,_0x8a8a('0x1c4'));};AGIVertices[_0x8a8a('0x1c')][_0x8a8a('0x1c5')]=function(_0x3e01c1){logger['info'](util[_0x8a8a('0x2e')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3e01c1[_0x8a8a('0x3b')]));if(!this[_0x8a8a('0xaa')](_0x3e01c1[_0x8a8a('0x15b')])){return this[_0x8a8a('0x3a')]['error'](_0x3e01c1,_0x8a8a('0x15c'));}logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15d'),this[_0x8a8a('0x3a')]['callerid'],_0x3e01c1[_0x8a8a('0x15b')]));var _0x37ef41=this[_0x8a8a('0x5a')]['sync'](this,_0x3e01c1['findBy']);if(_0x37ef41){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x3e01c1[_0x8a8a('0x15b')]));this['channel']['noop'](util[_0x8a8a('0x2e')](_0x8a8a('0x15e'),this[_0x8a8a('0x3a')][_0x8a8a('0x3d')],_0x3e01c1[_0x8a8a('0x15b')]));return{'code':0xc8,'result':_0x8a8a('0x15f')};}else{logger['info'](util['format'](_0x8a8a('0x160'),this[_0x8a8a('0x3a')]['callerid'],_0x3e01c1[_0x8a8a('0x15b')]));this[_0x8a8a('0x3a')][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8a8a('0x3d')],_0x3e01c1[_0x8a8a('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x8a8a('0x1c6')]=function(_0x2787e1){logger[_0x8a8a('0x34')](util[_0x8a8a('0x2e')](_0x8a8a('0x1c7'),_0x2787e1[_0x8a8a('0x3b')]));var _0x29909e=this[_0x8a8a('0x3a')][_0x8a8a('0x5f')](_0x8a8a('0x1c8'),[_0x2787e1[_0x8a8a('0x1c9')],_0x2787e1[_0x8a8a('0x82')]]);if(_0x29909e['result']===-0x1){return _0x29909e;}return this['channel'][_0x8a8a('0xa9')](util[_0x8a8a('0x2e')](_0x8a8a('0xc9'),'VOICEMAIL',_0x2787e1[_0x8a8a('0x1c9')]));};AGIVertices['prototype'][_0x8a8a('0x1ca')]=function(_0x56de23){logger[_0x8a8a('0x34')](util['format'](_0x8a8a('0x1cb'),_0x56de23[_0x8a8a('0x3b')]));if(!this['isConfigured'](_0x56de23[_0x8a8a('0xde')])){return this[_0x8a8a('0x3a')]['error'](_0x56de23,_0x8a8a('0x1cc'));}var _0x3a1708=this['getVariable']['sync'](this,_0x56de23['variable_id']);if(!_0x3a1708){return this[_0x8a8a('0x3a')][_0x8a8a('0x31')](_0x56de23,_0x8a8a('0xdf'));}var _0x1e7350=this[_0x8a8a('0x3a')]['getVariable'](_0x3a1708);return{'code':0xc8,'result':_0x1e7350[_0x8a8a('0xa4')]?_0x1e7350[_0x8a8a('0xa4')]:'-'};};String[_0x8a8a('0x1c')][_0x8a8a('0x1cd')]=function(_0x18a0a7,_0xa2abe5){return this['split'](_0x18a0a7)[_0x8a8a('0x1ce')](_0xa2abe5);};module[_0x8a8a('0x1cf')]=AGIVertices; \ No newline at end of file +var _0x4d61=['dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','length','recursiveNodeIndex','saveRestApiResult','%s.%s','isArray','split','replaceAll','extra','result','setVariable','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','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','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','gotoc','continueAt','gotoif','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','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','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','sendMail\x20message','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','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','lastName','isNil','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','timezones','utcOffset','scheduledat','add','minutes','insertContact','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','MALE','audioEncoding','googleTTS','google_tts_language','number','timeout','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2'];(function(_0x501195,_0x5ae563){var _0x26926a=function(_0x58cb8b){while(--_0x58cb8b){_0x501195['push'](_0x501195['shift']());}};_0x26926a(++_0x5ae563);}(_0x4d61,0x147));var _0x14d6=function(_0x57b35d,_0x229c1d){_0x57b35d=_0x57b35d-0x0;var _0x3fb76e=_0x4d61[_0x57b35d];return _0x3fb76e;};'use strict';var fs=require('fs');var path=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var _=require(_0x14d6('0x2'));var sh=require(_0x14d6('0x3'));var odbc=require(_0x14d6('0x4'))();var rs=require(_0x14d6('0x5'));var moment=require(_0x14d6('0x6'));var Mustache=require(_0x14d6('0x7'));var rp=require(_0x14d6('0x8'));var logger=require('../../config/logger')(_0x14d6('0x9'));var config=require(_0x14d6('0xa'));var shared=require(_0x14d6('0xb'));var scripts=require(_0x14d6('0xc'));var FILES_PATH=_0x14d6('0xd');var recursiveMapAttributes=[_0x14d6('0xe'),_0x14d6('0xf')];var verticesWithRetry=['menu',_0x14d6('0x10'),'getsecretdigits'];var AGIVertices=function(_0x403417,_0x590979,_0x25b8eb){this[_0x14d6('0x11')]=_0x403417;this['rpc']=_0x590979;this[_0x14d6('0x12')]=_0x25b8eb;};AGIVertices[_0x14d6('0x13')][_0x14d6('0x14')]=function(_0x1c2baf,_0x1d2408){this[_0x14d6('0x15')][_0x14d6('0x16')](_0x1c2baf)[_0x14d6('0x17')](function(_0x336faa){_0x1d2408(null,_0x336faa?_0x336faa[_0x14d6('0x18')]:![]);})[_0x14d6('0x19')](function(_0x51db48){_0x1d2408(_0x51db48);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1a')]=function(_0x2ed01f,_0x3bbce0){this[_0x14d6('0x15')]['getVoiceQueueById'](_0x2ed01f)[_0x14d6('0x17')](function(_0x3b42d5){_0x3bbce0(null,_0x3b42d5?_0x3b42d5[_0x14d6('0x18')]:![]);})[_0x14d6('0x19')](function(_0x56182a){_0x3bbce0(_0x56182a);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1b')]=function(_0x19464f,_0x5cfc1d){this[_0x14d6('0x15')][_0x14d6('0x1c')](_0x19464f)[_0x14d6('0x17')](function(_0x4654db){_0x5cfc1d(null,_0x4654db?_0x4654db[_0x14d6('0x18')]:![]);})[_0x14d6('0x19')](function(_0x1e0e07){_0x5cfc1d(_0x1e0e07);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1d')]=function(_0x2b9f62,_0x3b5205){this['rpc'][_0x14d6('0x1e')](_0x2b9f62)[_0x14d6('0x17')](function(_0x10c210){_0x3b5205(null,_0x10c210?_0x10c210['dsn']:![]);})[_0x14d6('0x19')](function(_0x430a09){_0x3b5205(_0x430a09);});};AGIVertices['prototype']['getUser']=function(_0x39cd94,_0x4f5249){this['rpc'][_0x14d6('0x1f')](_0x39cd94)[_0x14d6('0x17')](function(_0xb59ec9){_0x4f5249(null,_0xb59ec9?_0xb59ec9[_0x14d6('0x18')]:![]);})[_0x14d6('0x19')](function(_0x3bde69){_0x4f5249(_0x3bde69);});};AGIVertices[_0x14d6('0x13')]['getTrunk']=function(_0xcf9678,_0x43179c){this[_0x14d6('0x15')]['getTrunkById'](_0xcf9678)[_0x14d6('0x17')](function(_0x3d0879){_0x43179c(null,_0x3d0879?_0x3d0879[_0x14d6('0x18')]:![]);})[_0x14d6('0x19')](function(_0x2b92e9){_0x43179c(_0x2b92e9);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x20')]=function(_0x4dc546,_0x1f5c49){var _0x1d4c68=this;this[_0x14d6('0x15')][_0x14d6('0x21')](_0x4dc546)[_0x14d6('0x17')](function(_0x2b1e2c){_0x1f5c49(null,_0x2b1e2c?_0x1d4c68[_0x14d6('0x22')](_0x2b1e2c['save_name']):![]);})['catch'](function(_0x15d098){_0x1f5c49(_0x15d098);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x23')]=function(_0x1f9dec,_0x4ac649){this[_0x14d6('0x15')][_0x14d6('0x24')](_0x1f9dec)[_0x14d6('0x17')](function(_0x741066){_0x4ac649(null,_0x741066?_0x741066:![]);})[_0x14d6('0x19')](function(_0x59ce21){_0x4ac649(_0x59ce21);});};AGIVertices[_0x14d6('0x13')]['sendMailMessage']=function(_0x12b8cd,_0x3bd8a9,_0x31238d){this[_0x14d6('0x12')][_0x14d6('0x25')](_0x12b8cd,_0x3bd8a9)[_0x14d6('0x17')](function(){_0x31238d(null);})['catch'](function(_0x2b1c77){_0x31238d(_0x2b1c77);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x26')]=function(_0x3c307e,_0x3ac21f){this['rpc'][_0x14d6('0x27')](_0x3c307e)[_0x14d6('0x17')](function(_0x434ae9){if(_0x434ae9){if(_0x434ae9[_0x14d6('0x28')]){_0x3ac21f(null,[_0x434ae9[_0x14d6('0x29')]]);}else{_0x3ac21f(null,_[_0x14d6('0x2a')](_0x434ae9[_0x14d6('0x2b')],_0x14d6('0x29')));}}else{_0x3ac21f(null,![]);}})[_0x14d6('0x19')](function(_0x5c9860){_0x3ac21f(_0x5c9860);});};AGIVertices['prototype'][_0x14d6('0x22')]=function(_0x54f3ea){return util[_0x14d6('0x2c')](_0x14d6('0x2d'),FILES_PATH,_0x54f3ea);};AGIVertices['prototype']['getQueryOdbc']=function(_0x21d6b6,_0x5efef4,_0x12c875){odbc[_0x14d6('0x2e')](_0x21d6b6,function(_0x3c34a6){if(_0x3c34a6){logger[_0x14d6('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3c34a6);_0x12c875(_0x3c34a6);}else{logger[_0x14d6('0x30')](_0x14d6('0x31'));odbc[_0x14d6('0x32')](_0x5efef4,function(_0x3f450a,_0x48c749){if(_0x3f450a){logger[_0x14d6('0x30')]('Error\x20executing\x20query\x20%s',_0x5efef4);_0x12c875(_0x3f450a);}else{logger['info'](_0x14d6('0x33'),_0x5efef4);odbc[_0x14d6('0x34')](function(_0x295c5b){if(_0x295c5b){logger[_0x14d6('0x2f')](_0x14d6('0x35'),_0x295c5b);}_0x12c875(null,_0x48c749);});}});}});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x36')]=function(_0x406a92,_0x1cdcc7){this[_0x14d6('0x15')][_0x14d6('0x37')](_0x406a92)[_0x14d6('0x17')](function(_0x125c0c){_0x1cdcc7(null,_0x125c0c?_0x125c0c:![]);})[_0x14d6('0x19')](function(_0x2c3b68){_0x1cdcc7(_0x2c3b68);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x38')]=function(_0x3bf02f,_0x371f52){this[_0x14d6('0x15')][_0x14d6('0x38')](_0x3bf02f)[_0x14d6('0x17')](function(_0x5034b8){_0x371f52(null,_0x5034b8);})[_0x14d6('0x19')](function(_0x3d2eb1){_0x371f52(_0x3d2eb1);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x39')]=function(_0x77b510,_0xcc11a4,_0x39b796){this[_0x14d6('0x15')]['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x77b510[_0x14d6('0x3a')],'application':_0x77b510[_0x14d6('0x3b')],'data':_0xcc11a4||null,'project_name':this[_0x14d6('0x11')]['arg_1'],'callerid':this['channel'][_0x14d6('0x3c')]})['then'](function(_0x20b1e5){if(_0x39b796){_0x39b796(null,_0x20b1e5);}})[_0x14d6('0x19')](function(_0x3b4263){if(_0x39b796){_0x39b796(_0x3b4263);}});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x3d')]=function(_0x23dd77,_0x5012af,_0x181f83,_0x34e675){this[_0x14d6('0x15')][_0x14d6('0x3d')]({'uniqueid':this[_0x14d6('0x11')][_0x14d6('0x3e')],'callerid':this[_0x14d6('0x11')]['callerid'],'calleridname':this[_0x14d6('0x11')][_0x14d6('0x3f')],'context':this[_0x14d6('0x11')][_0x14d6('0x40')],'extension':this['channel'][_0x14d6('0x41')],'priority':this[_0x14d6('0x11')][_0x14d6('0x42')],'accountcode':this[_0x14d6('0x11')][_0x14d6('0x43')],'dnid':this[_0x14d6('0x11')][_0x14d6('0x44')],'projectName':this['channel'][_0x14d6('0x45')],'saveName':_0x5012af,'filename':_0x23dd77[_0x14d6('0x46')]||_0x5012af,'savePath':_0x181f83})[_0x14d6('0x17')](function(_0x18f186){_0x34e675(null,_0x18f186);})[_0x14d6('0x19')](function(_0x52f256){_0x34e675(_0x52f256);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x47')]=function(_0x1a4019,_0x57decd,_0x14cfdf,_0x2bbcf7,_0x2517ae){this['rpc']['createSquareMessage']({'uniqueid':this['channel'][_0x14d6('0x3e')],'body':_0x1a4019,'direction':_0x57decd,'providerName':_0x14cfdf,'providerResponse':_0x2bbcf7})[_0x14d6('0x17')](function(_0xf41d16){if(_0x2517ae){_0x2517ae(null,_0xf41d16);}})['catch'](function(_0x580193){if(_0x2517ae){_0x2517ae(_0x580193);}});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x48')]=function(_0x3e9f0f,_0x1dc58c){var _0x1869c8=this;var _0x4fe903=0x0;var _0x412985={'firstName':_['isEmpty'](_0x3e9f0f[_0x14d6('0x18')])||_['isNil'](_0x3e9f0f[_0x14d6('0x18')])?'callback_'+Math['random']():_0x3e9f0f['name'],'lastName':_[_0x14d6('0x49')](_0x3e9f0f[_0x14d6('0x4a')])||_[_0x14d6('0x4b')](_0x3e9f0f[_0x14d6('0x4a')])?null:_0x3e9f0f['lastName'],'phone':_0x3e9f0f[_0x14d6('0x4c')],'ListId':_0x3e9f0f[_0x14d6('0x4d')],'scheduledat':_0x3e9f0f[_0x14d6('0x4e')],'callbackUniqueid':this[_0x14d6('0x11')][_0x14d6('0x3e')],'tags':'callback','description':_0x14d6('0x4f')+_0x3e9f0f['scheduledAt'][_0x14d6('0x50')](),'priority':_0x3e9f0f[_0x14d6('0x51')]};if(_[_0x14d6('0x52')](_0x3e9f0f,'dialTimezone')){if(!_[_0x14d6('0x4b')](_0x3e9f0f[_0x14d6('0x53')])){var _0x2c43c3=_0x3e9f0f[_0x14d6('0x53')];if(_0x3e9f0f[_0x14d6('0x53')]==_0x14d6('0x54')){this[_0x14d6('0x15')][_0x14d6('0x55')]({'phone':_0x3e9f0f['phone']})[_0x14d6('0x17')](function(_0x28a016){if(!_['isNil'](_0x28a016)){var _0x40904e=_0x28a016[_0x14d6('0x53')];if(!_[_0x14d6('0x4b')](_0x40904e)){var _0x333d7b=shared[_0x14d6('0x56')][_0x40904e];if(!_['isNil'](_0x333d7b)){var _0x582d71=-0x1*_0x333d7b[_0x14d6('0x57')];_0x412985[_0x14d6('0x58')]=moment(_0x3e9f0f[_0x14d6('0x58')])[_0x14d6('0x59')](_0x582d71,_0x14d6('0x5a'));_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}});}else{var _0x4fe903=shared[_0x14d6('0x56')][_0x2c43c3];if(!_['isNil'](_0x4fe903)){var _0x9076ee=-0x1*_0x4fe903['utcOffset'];_0x412985[_0x14d6('0x58')]=moment(_0x3e9f0f[_0x14d6('0x58')])['add'](_0x9076ee,_0x14d6('0x5a'));_0x1869c8['insertContact'](_0x412985,_0x3e9f0f,_0x1dc58c);}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}}}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}}else{_0x1869c8[_0x14d6('0x5b')](_0x412985,_0x3e9f0f,_0x1dc58c);}};AGIVertices[_0x14d6('0x13')][_0x14d6('0x5c')]=function(_0x519553,_0x31f0dd){this[_0x14d6('0x15')]['getPauseById'](_0x519553)[_0x14d6('0x17')](function(_0xfdafdf){_0x31f0dd(null,_0xfdafdf?_0xfdafdf[_0x14d6('0x18')]:![]);})['catch'](function(_0x2d4276){_0x31f0dd(_0x2d4276);});};AGIVertices['prototype'][_0x14d6('0x5d')]=function(_0x1cedb9,_0xdbd61d,_0x21889f){var _0x223ff8={'role':_0x14d6('0x5e')};_0x223ff8[_0x1cedb9]=this['channel'][_0x14d6('0x3c')];this[_0x14d6('0x15')][_0x14d6('0x5d')](_0x223ff8,_0xdbd61d,this[_0x14d6('0x11')][_0x14d6('0x3e')])[_0x14d6('0x17')](function(_0x1e3bf3){_0x21889f(null,_[_0x14d6('0x4b')](_0x1e3bf3)?![]:!![]);})['catch'](function(_0x2b0e5b){logger[_0x14d6('0x2f')](_0x2b0e5b);_0x21889f(null,![]);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x5f')]=function(_0x4c492f,_0x43c474){var _0x5045a6={'role':_0x14d6('0x5e')};_0x5045a6[_0x4c492f]=this['channel']['callerid'];this['rpc'][_0x14d6('0x5f')](_0x5045a6)[_0x14d6('0x17')](function(_0x5bce9d){_0x43c474(null,_['isNil'](_0x5bce9d)?![]:!![]);})[_0x14d6('0x19')](function(_0x48acfe){logger['error'](_0x48acfe);_0x43c474(null,![]);});};AGIVertices['prototype'][_0x14d6('0x60')]=function(_0xd183ef,_0x5577e7){var _0x588e18={'role':_0x14d6('0x5e')};_0x588e18[_0xd183ef]=this[_0x14d6('0x11')][_0x14d6('0x3c')];this[_0x14d6('0x15')][_0x14d6('0x60')](_0x588e18)[_0x14d6('0x17')](function(_0x3054b3){_0x5577e7(null,_[_0x14d6('0x4b')](_0x3054b3)?![]:!![]);})[_0x14d6('0x19')](function(_0x52bcf1){logger[_0x14d6('0x2f')](_0x52bcf1);_0x5577e7(null,![]);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x61')]=function(_0x482768,_0x161932){var _0x43ac4a={'role':_0x14d6('0x5e')};_0x43ac4a[_0x482768]=this[_0x14d6('0x11')][_0x14d6('0x3c')];var _0x58845a=_0x482768!=_0x14d6('0x62')?util[_0x14d6('0x2c')](_0x14d6('0x63'),_0x14d6('0x64'),this['channel'][_0x14d6('0x3c')]):undefined;this[_0x14d6('0x15')]['agentLogin'](_0x43ac4a,_0x58845a)[_0x14d6('0x17')](function(_0x2b3110){_0x161932(null,_[_0x14d6('0x4b')](_0x2b3110)?![]:!![]);})[_0x14d6('0x19')](function(_0x4ec549){logger['error'](_0x4ec549);_0x161932(null,![]);});};AGIVertices['prototype'][_0x14d6('0x65')]=function(_0x1a1068,_0x303559){sh[_0x14d6('0x66')](_[_0x14d6('0x67')](_0x1a1068),function(_0x124f9b,_0x3e5f2d){var _0x373f7b=_0x3e5f2d[_0x14d6('0x68')](/(\r\n|\n|\r)/gm,'');_0x303559(null,_0x373f7b);});};AGIVertices['prototype'][_0x14d6('0x69')]=function(_0xc26fa9,_0x5228f6){scripts[_0x14d6('0x69')](_0xc26fa9[_0x14d6('0x6a')],_0xc26fa9['google_cloud_tts_text_type']||_0x14d6('0x6b'),_0xc26fa9[_0x14d6('0x6b')],_0xc26fa9[_0x14d6('0x6c')]||_0x14d6('0x6d'),_0xc26fa9['ssmlGender']||_0x14d6('0x6e'),_0xc26fa9[_0x14d6('0x6f')]||'MP3')[_0x14d6('0x17')](function(_0x335d0e){_0x5228f6(null,_0x335d0e);})[_0x14d6('0x19')](function(_0x1e4225){_0x5228f6(_0x1e4225);});};AGIVertices['prototype'][_0x14d6('0x70')]=function(_0x40a1ac,_0xd4f5f){scripts[_0x14d6('0x70')](_0x40a1ac[_0x14d6('0x6b')],_0x40a1ac[_0x14d6('0x71')]||'en',0x1)[_0x14d6('0x17')](function(_0x2e03e2){_0xd4f5f(null,_0x2e03e2);})[_0x14d6('0x19')](function(_0x1cc358){_0xd4f5f(_0x1cc358);});};AGIVertices[_0x14d6('0x13')]['restAPI']=function(_0x559b0d,_0x4fece9){var _0x444925={'uri':_0x559b0d['url'],'method':_0x559b0d['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x559b0d['timeout'])===_0x14d6('0x72')&&parseInt(_0x559b0d['timeout'])>=0x1?parseInt(_0x559b0d[_0x14d6('0x73')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x14d6('0x74')],_0x444925[_0x14d6('0x75')][_0x14d6('0x76')]())){try{_0x444925[_0x14d6('0x77')]=_0x559b0d[_0x14d6('0xf')]?JSON[_0x14d6('0x78')](_0x559b0d[_0x14d6('0xf')]):{};}catch(_0x2e7363){logger[_0x14d6('0x2f')](_0x14d6('0x79'),_0x2e7363);}}try{_0x444925[_0x14d6('0x7a')]=_0x559b0d[_0x14d6('0xe')]?JSON[_0x14d6('0x78')](_0x559b0d[_0x14d6('0xe')]):{};}catch(_0x26cb22){logger[_0x14d6('0x2f')](_0x14d6('0x7b'),_0x26cb22);}if(_0x559b0d[_0x14d6('0x7c')]){try{var _0x4839bf=require(_0x559b0d[_0x14d6('0x7c')])[_0x14d6('0x7d')](this,_0x444925);_0x444925[_0x14d6('0x7e')]=Mustache[_0x14d6('0x7f')](_0x559b0d[_0x14d6('0x80')],_0x4839bf,{},['$$','$$']);if(_0x444925[_0x14d6('0x7a')]){_0x444925[_0x14d6('0x7a')]=JSON[_0x14d6('0x78')](Mustache[_0x14d6('0x7f')](JSON['stringify'](_0x444925[_0x14d6('0x7a')]),_0x4839bf,{},['$$','$$']));}if(_0x444925[_0x14d6('0x77')]){_0x444925[_0x14d6('0x77')]=JSON[_0x14d6('0x78')](Mustache['render'](JSON[_0x14d6('0x81')](_0x444925[_0x14d6('0x77')]),_0x4839bf,{},['$$','$$']));}}catch(_0x27f79a){logger['error'](_0x14d6('0x82'),_0x27f79a);}}rp(_0x444925)[_0x14d6('0x17')](function(_0x56aba1){var _0x40d07f={'statusCode':_0x56aba1[_0x14d6('0x83')]||0xc8,'statusMessage':_0x56aba1[_0x14d6('0x84')]||'OK','headers':_0x56aba1[_0x14d6('0x7a')]||{},'body':_0x56aba1['body']||{}};_0x4fece9(null,_0x40d07f);})['catch'](function(_0x4d8da3){var _0x174740={'statusCode':_0x4d8da3[_0x14d6('0x83')]||0x1f4,'statusMessage':_0x4d8da3[_0x14d6('0x85')]||_0x14d6('0x86'),'headers':_0x4d8da3['options']['headers']||{},'body':_0x4d8da3[_0x14d6('0x87')][_0x14d6('0x77')]||{}};_0x4fece9(null,_0x174740);});};AGIVertices['prototype'][_0x14d6('0x88')]=function(_0x3ec9c0,_0x5b8070){scripts[_0x14d6('0x88')](this[_0x14d6('0x11')][_0x14d6('0x3e')],_0x3ec9c0['key'],_0x3ec9c0[_0x14d6('0x6b')],_0x3ec9c0[_0x14d6('0x89')]||'en')[_0x14d6('0x17')](function(_0x1028f1){_0x5b8070(null,_0x1028f1);})[_0x14d6('0x19')](function(_0x4cb52d){_0x5b8070(_0x4cb52d);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x8a')]=function(_0x926e83,_0x43fac0){scripts[_0x14d6('0x8a')](this[_0x14d6('0x11')][_0x14d6('0x3e')],_0x926e83[_0x14d6('0x8b')],_0x926e83[_0x14d6('0x8c')],_0x926e83['private_key'],_0x926e83[_0x14d6('0x6b')],_0x926e83['dialogflowV2_language']||'en')[_0x14d6('0x17')](function(_0x16eaa4){_0x43fac0(null,_0x16eaa4);})[_0x14d6('0x19')](function(_0x3e36f8){_0x43fac0(_0x3e36f8);});};AGIVertices['prototype']['sestekNDA']=function(_0x4033dc,_0x5343c7){scripts[_0x14d6('0x8d')](this[_0x14d6('0x11')],_0x4033dc)[_0x14d6('0x17')](function(_0x318264){_0x5343c7(null,_0x318264);})[_0x14d6('0x19')](function(_0x2a6596){_0x5343c7(_0x2a6596);});};AGIVertices[_0x14d6('0x13')]['ispeechTTS']=function(_0x27e5d3,_0x1208da){scripts[_0x14d6('0x8e')](_0x27e5d3[_0x14d6('0x8f')],_0x27e5d3[_0x14d6('0x6b')],_0x27e5d3[_0x14d6('0x90')]||_0x14d6('0x6d'),_0x27e5d3['speed'])['then'](function(_0x37091a){_0x1208da(null,_0x37091a);})[_0x14d6('0x19')](function(_0x17ccf0){_0x1208da(_0x17ccf0);});};AGIVertices['prototype'][_0x14d6('0x91')]=function(_0xef0d84,_0x25d52a,_0x3737ae){scripts[_0x14d6('0x91')](_0x25d52a,_0xef0d84[_0x14d6('0x8f')],_0xef0d84[_0x14d6('0x92')]||_0x14d6('0x6d'),this[_0x14d6('0x93')](_0xef0d84[_0x14d6('0x94')])?_0xef0d84[_0x14d6('0x94')]:undefined)[_0x14d6('0x17')](function(_0x3d1018){_0x3737ae(null,_0x3d1018);})[_0x14d6('0x19')](function(_0x1006ad){_0x3737ae(_0x1006ad);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x95')]=function(_0x239a1b,_0x337359){scripts[_0x14d6('0x95')](_0x239a1b['aws_access_key_id'],_0x239a1b[_0x14d6('0x96')],_0x239a1b[_0x14d6('0x97')],_0x239a1b['aws_polly_voice']||'Amy',_0x239a1b['text'],_0x239a1b[_0x14d6('0x98')]||_0x14d6('0x6b'))[_0x14d6('0x17')](function(_0x431e6c){_0x337359(null,_0x431e6c);})[_0x14d6('0x19')](function(_0x4d12f6){_0x337359(_0x4d12f6);});};AGIVertices['prototype'][_0x14d6('0x99')]=function(_0x268e5b,_0x74135){scripts[_0x14d6('0x99')](this[_0x14d6('0x11')]['uniqueid'],_0x268e5b[_0x14d6('0x9a')],_0x268e5b['aws_secret_access_key'],_0x268e5b['aws_lex_region'],_0x268e5b[_0x14d6('0x6b')],_0x268e5b[_0x14d6('0x9b')])[_0x14d6('0x17')](function(_0xad729b){_0x74135(null,_0xad729b);})['catch'](function(_0x411af2){_0x74135(_0x411af2);});};AGIVertices[_0x14d6('0x13')][_0x14d6('0x9c')]=function(_0x171820,_0x4bc72f,_0x5ccd7b){scripts['googleASR'](_0x4bc72f,_0x171820['key'],_0x171820[_0x14d6('0x9d')]||_0x14d6('0x6d'))[_0x14d6('0x17')](function(_0x536a0d){_0x5ccd7b(null,_0x536a0d);})[_0x14d6('0x19')](function(_0x4f9fc3){_0x5ccd7b(_0x4f9fc3);});};AGIVertices[_0x14d6('0x13')]['tildeASR']=function(_0x3cfe8f,_0x942647,_0x13a8aa){scripts[_0x14d6('0x9e')](_0x942647,_0x3cfe8f[_0x14d6('0x9f')],_0x3cfe8f[_0x14d6('0xa0')],_0x3cfe8f['uri'])[_0x14d6('0x17')](function(_0x1937ba){_0x13a8aa(null,_0x1937ba);})['catch'](function(_0x465606){_0x13a8aa(_0x465606);});};AGIVertices['prototype'][_0x14d6('0xa1')]=function(_0x3d0905){var _0x403619=_[_0x14d6('0xa2')](verticesWithRetry,_0x3d0905[_0x14d6('0x3b')])?_0x3d0905:_[_0x14d6('0xa3')](_0x3d0905);for(var _0xff0568 in _0x403619){if(_0x403619[_0x14d6('0xa4')](_0xff0568)){if(_0x403619[_0xff0568]&&_[_0x14d6('0xa5')](_0x403619[_0xff0568])){if(_[_0x14d6('0xa2')](recursiveMapAttributes,_0xff0568)){_0x403619[_0xff0568]=this[_0x14d6('0xa6')](_0x403619[_0xff0568]);}else{_0x403619[_0xff0568]=this[_0x14d6('0xa7')](_0x403619[_0xff0568]);}}}}return _0x403619;};AGIVertices[_0x14d6('0x13')]['recursiveNodeIndex']=function(_0x6f98c9){for(var _0xa0765a in _0x6f98c9){if(_0x6f98c9['hasOwnProperty'](_0xa0765a)){if(_[_0x14d6('0xa8')](_0x6f98c9[_0xa0765a])){this['recursiveNodeIndex'](_0x6f98c9[_0xa0765a]);}else if(_['isArray'](_0x6f98c9[_0xa0765a])){for(var _0x54f4c8=0x0;_0x54f4c8<_0x6f98c9[_0xa0765a][_0x14d6('0xa9')];_0x54f4c8++){this[_0x14d6('0xaa')](_0x6f98c9[_0xa0765a][_0x54f4c8]);}}else if(_[_0x14d6('0xa5')](_0x6f98c9[_0xa0765a])){_0x6f98c9[_0xa0765a]=this[_0x14d6('0xa7')](_0x6f98c9[_0xa0765a]);}}}};AGIVertices[_0x14d6('0x13')]['saveRestApiResult']=function(_0x18bccd,_0x5bff17){for(var _0x531a3e in _0x18bccd){if(_0x18bccd[_0x14d6('0xa4')](_0x531a3e)){if(_[_0x14d6('0xa8')](_0x18bccd[_0x531a3e])){if(!_['isEmpty'](_0x18bccd[_0x531a3e])){this[_0x14d6('0xab')](_0x18bccd[_0x531a3e],util['format'](_0x14d6('0xac'),_0x5bff17,_0x531a3e));}}else if(_[_0x14d6('0xad')](_0x18bccd[_0x531a3e])){for(var _0x574c1d=0x0;_0x574c1d<_0x18bccd[_0x531a3e][_0x14d6('0xa9')];_0x574c1d++){this[_0x14d6('0xab')](_0x18bccd[_0x531a3e][_0x574c1d],util[_0x14d6('0x2c')](_0x14d6('0xac'),_0x5bff17,_0x531a3e+'['+_0x574c1d+']'));}}else{if(!_[_0x14d6('0x4b')](_0x18bccd[_0x531a3e])){this['channel']['setVariable'](util[_0x14d6('0x2c')](_0x14d6('0xac'),_0x5bff17,_0x531a3e),_0x18bccd[_0x531a3e]);}}}}};AGIVertices[_0x14d6('0x13')][_0x14d6('0xa6')]=function(_0x375a90){try{var _0x1a8712=JSON['parse'](_0x375a90);this[_0x14d6('0xaa')](_0x1a8712);return JSON[_0x14d6('0x81')](_0x1a8712);}catch(_0x2ddb1c){return this[_0x14d6('0xa7')](_0x375a90);}};AGIVertices['prototype'][_0x14d6('0xa7')]=function(_0x203045){var _0x28daaf=_0x203045[_0x14d6('0xae')]('{');for(var _0xba92ed=0x1;_0xba92ed<_0x28daaf[_0x14d6('0xa9')];_0xba92ed+=0x1){var _0x32f242=_0x28daaf[_0xba92ed][_0x14d6('0xae')]('}');if(_0x32f242[_0x14d6('0xa9')]>0x1){_0x203045=_0x203045[_0x14d6('0xaf')]('{'+_0x32f242[0x0]+'}',this[_0x14d6('0x11')][_0x14d6('0x14')](_0x32f242[0x0])[_0x14d6('0xb0')]||_0x32f242[0x0]);}}if(_0x28daaf[_0x14d6('0xa9')]===0x1){return _0x203045[_0x14d6('0x50')]();}return this[_0x14d6('0xa7')](_0x203045);};AGIVertices[_0x14d6('0x13')]['getAndSetVariable']=function(_0x1ed31a,_0x481baf){var _0x2f79b3=this['channel']['getVariable'](_0x1ed31a);if(_0x2f79b3[_0x14d6('0xb1')]===-0x1){return _0x2f79b3;}logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x481baf,_0x2f79b3[_0x14d6('0xb0')]));return this['channel'][_0x14d6('0xb2')](_0x481baf,_0x2f79b3[_0x14d6('0xb0')]);};AGIVertices[_0x14d6('0x13')]['isConfigured']=function(_0x4aba5f){return _0x4aba5f&&_0x4aba5f!=='0'&&_0x4aba5f!=='-1'&&_0x4aba5f!=='';};AGIVertices[_0x14d6('0x13')][_0x14d6('0xb3')]=function(_0x3fa922){this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x3fa922,'-');_0x3fa922[_0x14d6('0xb4')]=_0x3fa922[_0x14d6('0xb3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x4dc3b5){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xb5'),_0x4dc3b5['label']));if(!this['isConfigured'](_0x4dc3b5[_0x14d6('0x6b')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0xb7'));}var _0x2c87ba='\x22'+_0x4dc3b5[_0x14d6('0x6b')]+'\x22';if(this['isConfigured'](_0x4dc3b5['options'])){_0x2c87ba+=','+_0x4dc3b5[_0x14d6('0x87')];}var _0x47d3df=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0xb8'),_0x2c87ba);if(_0x47d3df[_0x14d6('0xb1')]===-0x1){return _0x47d3df;}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0xb9'),_0x2c87ba));};AGIVertices[_0x14d6('0x13')]['mrcprecog']=function(_0x216612){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xba'),_0x216612['label']));if(!this[_0x14d6('0x93')](_0x216612[_0x14d6('0xbb')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xbc'));}var _0x3e85d1=_0x216612[_0x14d6('0xbb')];if(this[_0x14d6('0x93')](_0x216612['options'])){_0x3e85d1+=','+_0x216612[_0x14d6('0x87')];}var _0x23ffdb=this[_0x14d6('0x11')][_0x14d6('0x66')]('MRCPRecog',_0x3e85d1);if(_0x23ffdb['result']===-0x1){return _0x23ffdb;}var _0x46b590=this[_0x14d6('0xbd')](_0x14d6('0xbe'),_0x14d6('0xbf'));if(_0x46b590[_0x14d6('0xb1')]===-0x1){return _0x46b590;}var _0x43d9b5=this[_0x14d6('0xbd')](_0x14d6('0xc0'),_0x14d6('0xc1'));if(_0x43d9b5[_0x14d6('0xb1')]===-0x1){return _0x43d9b5;}var _0x2121f9=this['getAndSetVariable'](_0x14d6('0xc2'),_0x14d6('0xc3'));if(_0x2121f9[_0x14d6('0xb1')]===-0x1){return _0x2121f9;}return this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0xc4'),_0x3e85d1));};AGIVertices[_0x14d6('0x13')]['agi']=function(_0x557ca0){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x557ca0[_0x14d6('0x3a')]));return this[_0x14d6('0x11')][_0x14d6('0x9')]([_0x557ca0[_0x14d6('0xc5')],_0x557ca0[_0x14d6('0xc6')]]);};AGIVertices[_0x14d6('0x13')][_0x14d6('0xc7')]=function(_0x46ad6d){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x46ad6d[_0x14d6('0x3a')]));if(this[_0x14d6('0x93')](_0x46ad6d[_0x14d6('0x73')])){logger[_0x14d6('0x30')](util['format'](_0x14d6('0xc8'),_0x46ad6d['timeout']));var _0x495f48=this['channel'][_0x14d6('0xc9')](_0x46ad6d[_0x14d6('0x73')]);if(_0x495f48['result']===-0x1){return _0x495f48;}}return this[_0x14d6('0x11')][_0x14d6('0xc7')]();};AGIVertices[_0x14d6('0x13')][_0x14d6('0xca')]=function(_0x19b1ad){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xcb'),_0x19b1ad[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x19b1ad[_0x14d6('0x4d')])){return this['channel'][_0x14d6('0x2f')](_0x19b1ad,'no\x20list\x20selected');}_0x19b1ad[_0x14d6('0x4e')]=moment();if(this['isConfigured'](_0x19b1ad['delay'])){_0x19b1ad['scheduledAt']=moment()[_0x14d6('0x59')](_0x19b1ad[_0x14d6('0xcc')],'minutes');}if(!this[_0x14d6('0x93')](_0x19b1ad[_0x14d6('0x51')])){_0x19b1ad['callback_priority']=0x2;}this[_0x14d6('0x48')][_0x14d6('0x7d')](this,_0x19b1ad);return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0xcd'),_0x19b1ad[_0x14d6('0x4c')],_0x19b1ad[_0x14d6('0x4d')],_0x19b1ad['scheduledAt']));};AGIVertices[_0x14d6('0x13')]['custom_app']=function(_0x2b8023){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2b8023[_0x14d6('0x3a')]));var _0x4487d5=this[_0x14d6('0x11')]['exec'](_0x2b8023[_0x14d6('0xce')],_0x2b8023['options']);if(_0x4487d5[_0x14d6('0xb1')]===-0x1){return _0x4487d5;}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('Executed\x20command\x20%s\x20%s',_0x2b8023[_0x14d6('0xce')],_0x2b8023[_0x14d6('0x87')]));};AGIVertices[_0x14d6('0x13')]['lumenvoxtts']=function(_0x41c6f4){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xcf'),_0x41c6f4[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x41c6f4[_0x14d6('0x6b')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xb7'));}var _0x1de90f='\x22'+_0x41c6f4['text']+'\x22';if(this[_0x14d6('0x93')](_0x41c6f4[_0x14d6('0x87')])){_0x1de90f+=','+_0x41c6f4[_0x14d6('0x87')];}var _0x56ac26=this['channel'][_0x14d6('0x66')](_0x14d6('0xb8'),_0x1de90f);if(_0x56ac26[_0x14d6('0xb1')]===-0x1){return _0x56ac26;}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0xb9'),_0x1de90f));};AGIVertices[_0x14d6('0x13')][_0x14d6('0xd0')]=function(_0x1a7841){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xd1'),_0x1a7841[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x1a7841[_0x14d6('0x6b')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xb7'));}var _0x34b2b2='\x22'+_0x1a7841[_0x14d6('0x6b')]+'\x22';if(this[_0x14d6('0x93')](_0x1a7841[_0x14d6('0x87')])){_0x34b2b2+=','+_0x1a7841[_0x14d6('0x87')];}var _0x156746=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0xb8'),_0x34b2b2);if(_0x156746[_0x14d6('0xb1')]===-0x1){return _0x156746;}return this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0xb9'),_0x34b2b2));};AGIVertices[_0x14d6('0x13')][_0x14d6('0xd2')]=function(_0x3e7e58){logger['info'](util[_0x14d6('0x2c')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3e7e58[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x3e7e58[_0x14d6('0xbb')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0xbc'));}var _0x123351=_0x3e7e58[_0x14d6('0xbb')];if(this[_0x14d6('0x93')](_0x3e7e58[_0x14d6('0x87')])){_0x123351+=','+_0x3e7e58[_0x14d6('0x87')];}var _0x4bb6dd=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0xd3'),_0x123351);if(_0x4bb6dd[_0x14d6('0xb1')]===-0x1){return _0x4bb6dd;}var _0x1404d6=this[_0x14d6('0xbd')]('RECOG_CONFIDENCE()',_0x14d6('0xd4'));if(_0x1404d6[_0x14d6('0xb1')]===-0x1){return _0x1404d6;}var _0x1e3897=this[_0x14d6('0xbd')](_0x14d6('0xc0'),_0x14d6('0xd5'));if(_0x1e3897[_0x14d6('0xb1')]===-0x1){return _0x1e3897;}var _0x9bbef5=this[_0x14d6('0xbd')](_0x14d6('0xc2'),_0x14d6('0xd6'));if(_0x9bbef5[_0x14d6('0xb1')]===-0x1){return _0x9bbef5;}return this[_0x14d6('0x11')]['noop'](util['format'](_0x14d6('0xc4'),_0x123351));};AGIVertices[_0x14d6('0x13')][_0x14d6('0xd7')]=function(_0x226e0f){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xd8'),_0x226e0f[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x226e0f[_0x14d6('0xbb')])){return this[_0x14d6('0x11')]['noop'](_0x14d6('0xbc'));}var _0x2ff870=_0x226e0f[_0x14d6('0xbb')];if(this[_0x14d6('0x93')](_0x226e0f[_0x14d6('0x87')])){_0x2ff870+=','+_0x226e0f['options'];}var _0x3380c5=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0xd3'),_0x2ff870);if(_0x3380c5[_0x14d6('0xb1')]===-0x1){return _0x3380c5;}var _0x3e11ba=this[_0x14d6('0xbd')](_0x14d6('0xbe'),_0x14d6('0xd9'));if(_0x3e11ba[_0x14d6('0xb1')]===-0x1){return _0x3e11ba;}var _0x440d5c=this[_0x14d6('0xbd')](_0x14d6('0xc0'),_0x14d6('0xda'));if(_0x440d5c[_0x14d6('0xb1')]===-0x1){return _0x440d5c;}var _0x34f6c2=this['getAndSetVariable'](_0x14d6('0xc2'),_0x14d6('0xdb'));if(_0x34f6c2[_0x14d6('0xb1')]===-0x1){return _0x34f6c2;}return this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0xc4'),_0x2ff870));};AGIVertices['prototype'][_0x14d6('0xdc')]=function(_0x23c167){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xdd'),_0x23c167[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x23c167[_0x14d6('0xde')])){return this['channel'][_0x14d6('0x2f')](_0x23c167,_0x14d6('0xdf'));}var _0x89fe1a=this[_0x14d6('0x1d')][_0x14d6('0x7d')](this,_0x23c167[_0x14d6('0xde')]);if(!_0x89fe1a){return this[_0x14d6('0x11')]['error'](_0x23c167,'no\x20odbc\x20database\x20found');}if(!this[_0x14d6('0x93')](_0x23c167[_0x14d6('0x32')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x23c167,'no\x20query\x20configured');}var _0x1036ee=_0x23c167[_0x14d6('0x32')][_0x14d6('0x68')](/(\r\n|\n|\r)/gm,'\x20');this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('query:\x20%s',_0x1036ee));var _0x5dc3b3=this['getQueryOdbc'][_0x14d6('0x7d')](this,_0x89fe1a,_0x1036ee);this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x23c167,_0x1036ee);if(!this[_0x14d6('0x93')](_0x23c167[_0x14d6('0xe0')])){return this['channel']['noop'](_0x14d6('0xe1'));}var _0x3b26ec=this[_0x14d6('0x14')][_0x14d6('0x7d')](this,_0x23c167[_0x14d6('0xe0')]);if(!_0x3b26ec){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x23c167,_0x14d6('0xe2'));}var _0x400e30=this;_0x5dc3b3[_0x14d6('0xe3')](function(_0x309e73,_0x3f4638){Object[_0x14d6('0xe4')](_0x309e73)[_0x14d6('0xe3')](function(_0x2df138){_0x400e30[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')](_0x14d6('0xe5'),_0x3b26ec,_0x3f4638,_0x2df138),_0x309e73[_0x2df138]);});});this[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')](_0x14d6('0xe6'),_0x3b26ec),_0x5dc3b3['length']);return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0xe7'),_0x3b26ec));};AGIVertices[_0x14d6('0x13')][_0x14d6('0xe8')]=function(_0x15f816){logger['debug'](util['format'](_0x14d6('0xe9'),_0x15f816[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x15f816[_0x14d6('0xea')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x15f816,'no\x20user\x20selected');}var _0x5458aa=this[_0x14d6('0xeb')][_0x14d6('0x7d')](this,_0x15f816[_0x14d6('0xea')]);if(!_0x5458aa){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x15f816,_0x14d6('0xec'));}var _0x10125f=this[_0x14d6('0x11')]['exec'](_0x14d6('0xed'),[util[_0x14d6('0x2c')]('SIP/%s',_0x5458aa),_0x15f816[_0x14d6('0x73')],_0x15f816[_0x14d6('0xee')],_0x15f816['url']]);if(_0x10125f['result']===-0x1){return _0x10125f;}return this['channel'][_0x14d6('0xb6')](util['format'](_0x14d6('0xef'),'DIAL'));};AGIVertices['prototype'][_0x14d6('0xf0')]=function(_0x501271){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xf1'),_0x501271[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x501271['key'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xf2'));}if(!this[_0x14d6('0x93')](_0x501271[_0x14d6('0x6b')])){return this[_0x14d6('0x11')]['noop']('no\x20text\x20configured');}this[_0x14d6('0x11')][_0x14d6('0xf3')]=!![];this['createSquareDetailsReport'](_0x501271);this[_0x14d6('0x47')](_0x501271[_0x14d6('0x6b')],'in','','');this['channel'][_0x14d6('0xb6')](util['format'](_0x14d6('0xf4'),_0x501271['text']));var _0x20d63a=this[_0x14d6('0x88')][_0x14d6('0x7d')](this,_0x501271);if(_0x20d63a){for(var _0x4e4383 in _0x20d63a){if(_0x20d63a[_0x14d6('0xa4')](_0x4e4383)){this[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')](_0x14d6('0xf5'),_0x4e4383[_0x14d6('0x76')]()),_0x20d63a[_0x4e4383]);}}this[_0x14d6('0x47')](_0x20d63a[_0x14d6('0xf6')],_0x14d6('0xf7'),_0x14d6('0xf0'),'');return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0xf8'),_0x20d63a[_0x14d6('0xf6')]));}return this[_0x14d6('0x11')]['error'](_0x501271,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x14d6('0xf9')]=function(_0x1116ca){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0xfa'),_0x1116ca['label']));if(!this['isConfigured'](_0x1116ca[_0x14d6('0x8b')])){return this['channel']['noop'](_0x14d6('0xfb'));}if(!this[_0x14d6('0x93')](_0x1116ca['client_email'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xfc'));}if(!this[_0x14d6('0x93')](_0x1116ca[_0x14d6('0xfd')])){return this[_0x14d6('0x11')]['noop'](_0x14d6('0xfe'));}if(!this[_0x14d6('0x93')](_0x1116ca[_0x14d6('0xff')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0x100'));}if(!this[_0x14d6('0x93')](_0x1116ca['text'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')]('no\x20text\x20configured');}this[_0x14d6('0x11')][_0x14d6('0xf3')]=!![];this[_0x14d6('0x39')](_0x1116ca);this[_0x14d6('0x47')](_0x1116ca[_0x14d6('0x6b')],'in','','');this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x101'),_0x1116ca[_0x14d6('0x6b')]));var _0x4dd177=this['googleDialogflowV2']['sync'](this,_0x1116ca);if(_0x4dd177){for(var _0x54ed9f in _0x4dd177){if(_0x4dd177[_0x14d6('0xa4')](_0x54ed9f)){if(_0x54ed9f!==_0x14d6('0x102')){this[_0x14d6('0x11')][_0x14d6('0xb2')](util['format'](_0x14d6('0xf5'),_0x54ed9f[_0x14d6('0x76')]()),_0x4dd177[_0x54ed9f]);}}}this[_0x14d6('0x47')](_0x4dd177[_0x14d6('0xf6')],'out',_0x14d6('0xf9'),_0x4dd177['providerResponse']);return this[_0x14d6('0x11')]['noop'](util['format'](_0x14d6('0x103'),_0x4dd177[_0x14d6('0xf6')]));}return this[_0x14d6('0x11')]['error'](_0x1116ca,_0x14d6('0x104'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x105')]=function(_0x86826c){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x86826c[_0x14d6('0x3a')]));if(!this['isConfigured'](_0x86826c[_0x14d6('0x106')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x107'));}if(!this[_0x14d6('0x93')](_0x86826c[_0x14d6('0x108')])){return this['channel'][_0x14d6('0xb6')]('no\x20username\x20configured');}if(!this[_0x14d6('0x93')](_0x86826c[_0x14d6('0x109')])){return this['channel']['noop'](_0x14d6('0x10a'));}if(!this[_0x14d6('0x93')](_0x86826c['ndassistant_url'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x14d6('0x39')](_0x86826c);this[_0x14d6('0x47')](_0x86826c['text'],'in','','');this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('Trying\x20SestekNDA:\x20%s',_0x86826c[_0x14d6('0x6b')]));var _0x4cf9ec=this[_0x14d6('0x8d')][_0x14d6('0x7d')](this,_0x86826c);if(_0x4cf9ec){for(var _0x1114c4 in _0x4cf9ec){if(_0x4cf9ec[_0x14d6('0xa4')](_0x1114c4)){this['channel'][_0x14d6('0xb2')](util[_0x14d6('0x2c')](_0x14d6('0x10b'),_0x1114c4[_0x14d6('0x76')]()),_0x4cf9ec[_0x1114c4]);}}this['createSquareMessage'](_0x4cf9ec['speech'],'out',_0x14d6('0x105'),'');if(_0x4cf9ec[_0x14d6('0x10c')]){this[_0x14d6('0x11')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x4cf9ec[_0x14d6('0x10c')]));var _0x5e77e7=this[_0x14d6('0x11')][_0x14d6('0x10d')](_0x4cf9ec[_0x14d6('0x10c')]);try{fs['unlink'](_0x4cf9ec[_0x14d6('0x10c')]+_0x14d6('0x10e'));}catch(_0x5730a7){logger[_0x14d6('0x2f')](_0x5730a7);}return _0x5e77e7;}else{return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x10f'),_0x4cf9ec[_0x14d6('0xf6')]));}}return this[_0x14d6('0x11')]['error'](_0x86826c,_0x14d6('0x110'));};AGIVertices['prototype'][_0x14d6('0x111')]=function(_0x55949e){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x112'),_0x55949e[_0x14d6('0x3a')]));return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x111'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x113')]=function(_0x54fbbc){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x114'),_0x54fbbc['label']));var _0x2d7d53='';if(_0x54fbbc[_0x14d6('0x115')]){if(!this['isConfigured'](_0x54fbbc[_0x14d6('0x115')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x54fbbc,_0x14d6('0x116'));}else{var _0x228ff1=parseInt(_0x54fbbc[_0x14d6('0x115')],0xa);if(isNaN(_0x228ff1)){_0x2d7d53=_0x54fbbc[_0x14d6('0x115')];}else{_0x2d7d53=this[_0x14d6('0x117')][_0x14d6('0x7d')](this,_0x54fbbc['trunk_id']);if(!_0x2d7d53){return this['channel'][_0x14d6('0x2f')](_0x54fbbc,_0x14d6('0x118'));}}}}else if(_0x54fbbc['trunk_name']){_0x2d7d53=_0x54fbbc['trunk_name'];}else{return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x54fbbc,_0x14d6('0x116'));}var _0x3a018e=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0xed'),[util[_0x14d6('0x2c')](_0x14d6('0x119'),_0x2d7d53,_0x54fbbc['phone']),_0x54fbbc[_0x14d6('0x73')],_0x54fbbc['opts'],_0x54fbbc[_0x14d6('0x80')]]);if(_0x3a018e[_0x14d6('0xb1')]===-0x1){return _0x3a018e;}return this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0xef'),'DIAL'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x11a')]=function(_0x2a9d5e){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x11b'),_0x2a9d5e[_0x14d6('0x3a')]));return this[_0x14d6('0x11')][_0x14d6('0xb6')]('finally');};AGIVertices[_0x14d6('0x13')][_0x14d6('0x10')]=function(_0x743d55){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x11c'),_0x743d55[_0x14d6('0x3a')]));if(_0x743d55['retry']===0x0){return this[_0x14d6('0xb3')](_0x743d55);}_0x743d55[_0x14d6('0xb4')]-=0x1;if(!this[_0x14d6('0x93')](_0x743d55[_0x14d6('0x11d')])){return this['channel'][_0x14d6('0x2f')](_0x743d55,'no\x20file\x20audio\x20selected');}var _0x1f0211=this[_0x14d6('0x20')]['sync'](this,_0x743d55[_0x14d6('0x11d')]);if(!_0x1f0211){return this[_0x14d6('0x11')]['error'](_0x743d55,_0x14d6('0x11e'));}if(!this[_0x14d6('0x93')](_0x743d55[_0x14d6('0xe0')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x755415=this[_0x14d6('0x11')][_0x14d6('0x11f')](_0x1f0211,_0x743d55[_0x14d6('0x120')],_0x743d55['maxdigit']);var _0x1921a8=_0x755415['result']?_0x755415[_0x14d6('0xb1')][_0x14d6('0x50')]():'';logger[_0x14d6('0x30')](_0x14d6('0x121'),JSON[_0x14d6('0x81')](_0x755415));if(_0x755415[_0x14d6('0xb1')]===-0x1){this[_0x14d6('0x39')]['sync'](this,_0x743d55,_0x1921a8);return _0x755415;}else if(_0x755415[_0x14d6('0xb0')]===_0x14d6('0x73')){_0x755415[_0x14d6('0xb1')]=_0x1921a8['length']>=parseInt(_0x743d55[_0x14d6('0x122')])?'x':'i';}else{_0x755415[_0x14d6('0xb1')]=_0x1921a8[_0x14d6('0xa9')]>=parseInt(_0x743d55[_0x14d6('0x122')])&&_0x1921a8['length']<=parseInt(_0x743d55[_0x14d6('0x123')])?'x':'i';}var _0xb057f8=this[_0x14d6('0x14')]['sync'](this,_0x743d55[_0x14d6('0xe0')]);if(!_0xb057f8){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x743d55,_0x14d6('0xe2'));}this[_0x14d6('0x11')]['setVariable'](_0xb057f8,_0x1921a8);if(this[_0x14d6('0x93')](_0x743d55['hiddendigitsnum'])){var _0x23cc6f=parseInt(_0x743d55[_0x14d6('0x124')],0xa);var _0x497d52=rs[_0x14d6('0x125')]({'charset':'*','length':_0x23cc6f});var _0x1a97e6=_0x1921a8[_0x14d6('0xa9')];if(_0x1a97e6>0x0){if(_0x1a97e6>_0x23cc6f){this['createSquareDetailsReport'][_0x14d6('0x7d')](this,_0x743d55,_0x743d55[_0x14d6('0x126')]==='first'?_0x497d52+_0x1921a8[_0x14d6('0x127')](_0x23cc6f):_0x1921a8['substr'](0x0,_0x1a97e6-_0x23cc6f)+_0x497d52);}else{this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x743d55,rs[_0x14d6('0x125')]({'charset':'*','length':_0x1a97e6}));}}else{this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x743d55,'');}}else{this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x743d55,_0x1921a8);}return _0x755415;};AGIVertices['prototype'][_0x14d6('0x128')]=function(_0x39a514){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x129'),_0x39a514[_0x14d6('0x3a')]));return this['getdigits'](_0x39a514);};AGIVertices['prototype'][_0x14d6('0x12a')]=function(_0x3ed938){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x12b'),_0x3ed938[_0x14d6('0x3a')]));this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x3ed938,_0x3ed938[_0x14d6('0x12c')]);return this['channel']['noop'](util[_0x14d6('0x2c')](_0x14d6('0x12d'),_0x3ed938[_0x14d6('0x12c')]));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x12e')]=function(_0x29dc2d){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x12f'),_0x29dc2d[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x29dc2d['aws_access_key_id'])||!this[_0x14d6('0x93')](_0x29dc2d[_0x14d6('0x96')])){return this[_0x14d6('0x11')]['noop'](_0x14d6('0x130'));}if(!this['isConfigured'](_0x29dc2d[_0x14d6('0x6b')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xb7'));}this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x131'),_0x29dc2d[_0x14d6('0x6b')]));var _0x23633e=this[_0x14d6('0x95')]['sync'](this,_0x29dc2d);if(_0x23633e){this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x132'),_0x23633e));var _0x7d51d6=this[_0x14d6('0x11')][_0x14d6('0x10d')](_0x23633e);try{fs[_0x14d6('0x133')](_0x23633e+'.wav');}catch(_0x2d4ca1){logger[_0x14d6('0x2f')](_0x2d4ca1);}return _0x7d51d6;}return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x29dc2d,_0x14d6('0x134'));};AGIVertices['prototype'][_0x14d6('0x135')]=function(_0x412976){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x136'),_0x412976['label']));if(!this['isConfigured'](_0x412976[_0x14d6('0x9a')])||!this[_0x14d6('0x93')](_0x412976['aws_secret_access_key'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x130'));}if(!this[_0x14d6('0x93')](_0x412976[_0x14d6('0x9b')])){return this['channel'][_0x14d6('0xb6')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x412976[_0x14d6('0x6b')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0xb7'));}this[_0x14d6('0x11')][_0x14d6('0xf3')]=!![];this[_0x14d6('0x39')](_0x412976);this[_0x14d6('0x47')](_0x412976['text'],'in','','');this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('Trying\x20Amazon\x20Lex:\x20%s',_0x412976['text']));var _0x51b971=this[_0x14d6('0x99')][_0x14d6('0x7d')](this,_0x412976);if(_0x51b971){for(var _0x3f1c9d in _0x51b971){if(_0x51b971[_0x14d6('0xa4')](_0x3f1c9d)&&_[_0x14d6('0xa5')](_0x51b971[_0x3f1c9d])){this[_0x14d6('0x11')][_0x14d6('0xb2')](util['format']('AWS_LEX_%s',_0x3f1c9d['toUpperCase']()),_0x51b971[_0x3f1c9d]);}}if(_[_0x14d6('0x4b')](_0x51b971[_0x14d6('0x85')])){return this['channel']['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x14d6('0x47')](_0x51b971[_0x14d6('0x85')],_0x14d6('0xf7'),_0x14d6('0x137'),'');return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x138'),_0x51b971['message']));}}return this['channel'][_0x14d6('0x2f')](_0x412976,_0x14d6('0x139'));};AGIVertices['prototype'][_0x14d6('0x13a')]=function(_0x54bca2){logger['info'](util['format'](_0x14d6('0x13b'),_0x54bca2['label'],_0x54bca2[_0x14d6('0x73')]));if(!this[_0x14d6('0x93')](_0x54bca2[_0x14d6('0x8f')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0xf2'));}var _0x6065ad=_0x14d6('0x13c');var _0x526548=util[_0x14d6('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x14d6('0x125')](0x4));var _0x583f21=util[_0x14d6('0x2c')](_0x14d6('0xac'),_0x526548,_0x6065ad);var _0x5a2aa2=!![];if(_0x54bca2[_0x14d6('0x13d')]==='NOBEEP'){_0x5a2aa2=![];}var _0x417872=this[_0x14d6('0x11')][_0x14d6('0x13e')](_0x526548,_0x6065ad,_0x54bca2[_0x14d6('0x13f')],_0x54bca2[_0x14d6('0x73')],undefined,_0x5a2aa2);if(_0x417872['result']!==-0x1){this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('google\x20%s\x20file\x20created',_0x583f21));var _0x43e5bb=this[_0x14d6('0x9c')][_0x14d6('0x7d')](this,_0x54bca2,_0x583f21);if(_0x43e5bb){for(var _0x3c0856 in _0x43e5bb){if(_0x43e5bb[_0x14d6('0xa4')](_0x3c0856)){this['channel']['setVariable'](util[_0x14d6('0x2c')](_0x14d6('0x140'),_0x3c0856[_0x14d6('0x76')]()),_0x43e5bb[_0x3c0856]);}}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('GoogleASR\x20Result\x20%s',JSON[_0x14d6('0x81')](_0x43e5bb)));}}return _0x417872;};AGIVertices['prototype'][_0x14d6('0x141')]=function(_0x1794cc){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x1794cc[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x1794cc[_0x14d6('0x9f')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x142'));}if(!this['isConfigured'](_0x1794cc['appsecret'])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0x143'));}var _0x35c0b6='wav';var _0x5aba0c=util[_0x14d6('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x14d6('0x125')](0x4));var _0x3e8d7d=util[_0x14d6('0x2c')](_0x14d6('0xac'),_0x5aba0c,_0x35c0b6);var _0x47632c=!![];if(_0x1794cc[_0x14d6('0x13d')]===_0x14d6('0x144')){_0x47632c=![];}var _0x510630=this[_0x14d6('0x11')][_0x14d6('0x13e')](_0x5aba0c,_0x35c0b6,_0x1794cc[_0x14d6('0x13f')],_0x1794cc[_0x14d6('0x73')],undefined,_0x47632c);if(_0x510630['result']!==-0x1){this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('tilde\x20%s\x20file\x20created',_0x3e8d7d));var _0x3e6746=this[_0x14d6('0x9e')][_0x14d6('0x7d')](this,_0x1794cc,_0x3e8d7d);if(_0x3e6746){for(var _0x395b49 in _0x3e6746){if(_0x3e6746[_0x14d6('0xa4')](_0x395b49)){this[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')]('TILDE_ASR_%s',_0x395b49[_0x14d6('0x76')]()),_0x3e6746[_0x395b49]);}}return this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x14d6('0x81')](_0x3e6746)));}}return _0x510630;};AGIVertices[_0x14d6('0x13')][_0x14d6('0x145')]=function(_0x1a9e54){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1a9e54['label']));return this['channel'][_0x14d6('0x146')](_0x1a9e54['context'],_0x1a9e54[_0x14d6('0x41')],_0x1a9e54[_0x14d6('0x42')]);};AGIVertices[_0x14d6('0x13')][_0x14d6('0x147')]=function(_0x285988){logger[_0x14d6('0x30')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x285988['label']));if(!this[_0x14d6('0x93')](_0x285988['condition'])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x285988,_0x14d6('0x148'));}try{var _0x3adc90=eval(_0x285988[_0x14d6('0x149')])?_0x14d6('0x14a'):_0x14d6('0x14b');this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')]('EVAL\x20CONDITION\x20%s\x20%s',_0x285988[_0x14d6('0x149')],_0x3adc90));return{'code':0xc8,'result':_0x3adc90};}catch(_0x434328){return{'code':0xc8,'result':_0x14d6('0x14b')};}};AGIVertices[_0x14d6('0x13')][_0x14d6('0x14c')]=function(_0x495333){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x14d'),_0x495333[_0x14d6('0x3a')]));if(!this['isConfigured'](_0x495333[_0x14d6('0x14e')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x495333,_0x14d6('0x14f'));}var _0x49ad3d=this['getIntervals'][_0x14d6('0x7d')](this,_0x495333[_0x14d6('0x14e')]);if(!_0x49ad3d){return this['channel'][_0x14d6('0x2f')](_0x495333,_0x14d6('0x150'));}for(var _0x309760=0x0;_0x309760<_0x49ad3d['length'];_0x309760+=0x1){var _0x4ac1af=this[_0x14d6('0x11')]['getVariable'](util[_0x14d6('0x2c')](_0x14d6('0x151'),_0x49ad3d[_0x309760]));if(_0x4ac1af['result']===-0x1){return _0x4ac1af;}logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('IFTIME\x20%s\x20%s',_0x49ad3d[_0x309760],_0x4ac1af['extra']));if(_0x4ac1af[_0x14d6('0xb0')]==='true'){logger[_0x14d6('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x49ad3d[_0x309760],'true'));this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0x152'),_0x49ad3d[_0x309760],_0x14d6('0x14a')));return{'code':0xc8,'result':_0x14d6('0x14a')};}else{logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x152'),_0x49ad3d[_0x309760],_0x14d6('0x14b')));this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x152'),_0x49ad3d[_0x309760],_0x14d6('0x14b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x14d6('0x13')]['hangup']=function(_0x1d1fc0){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x153'),_0x1d1fc0[_0x14d6('0x3a')]));return this[_0x14d6('0x11')]['hangup']();};AGIVertices[_0x14d6('0x13')]['ispeechasr']=function(_0x51a67c){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x154'),_0x51a67c[_0x14d6('0x3a')]));if(!this['isConfigured'](_0x51a67c[_0x14d6('0x8f')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xf2'));}var _0x199ffb=_0x14d6('0x13c');var _0x1f17f7=util[_0x14d6('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x14d6('0x125')](0x4));var _0x461d8c=util[_0x14d6('0x2c')]('%s.%s',_0x1f17f7,_0x199ffb);var _0x107a9f=!![];if(_0x51a67c[_0x14d6('0x13d')]==='NOBEEP'){_0x107a9f=![];}var _0x41b4eb=this['channel'][_0x14d6('0x13e')](_0x1f17f7,_0x199ffb,_0x51a67c[_0x14d6('0x13f')],_0x51a67c[_0x14d6('0x73')],undefined,_0x107a9f);if(_0x41b4eb['result']!==-0x1){this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('ispeech\x20%s\x20file\x20created',_0x461d8c));var _0x1b17c5=this[_0x14d6('0x91')][_0x14d6('0x7d')](this,_0x51a67c,_0x461d8c);if(_0x1b17c5){for(var _0x52c0e3 in _0x1b17c5){if(_0x1b17c5[_0x14d6('0xa4')](_0x52c0e3)){this[_0x14d6('0x11')][_0x14d6('0xb2')](util['format'](_0x14d6('0x155'),_0x52c0e3['toUpperCase']()),_0x1b17c5[_0x52c0e3]);}}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x156'),JSON[_0x14d6('0x81')](_0x1b17c5)));}}return _0x41b4eb;};AGIVertices[_0x14d6('0x13')][_0x14d6('0x157')]=function(_0x41f7b1){logger[_0x14d6('0x30')](util['format'](_0x14d6('0x158'),_0x41f7b1[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x41f7b1['key'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xf2'));}if(!this['isConfigured'](_0x41f7b1[_0x14d6('0x6b')])){return this['channel'][_0x14d6('0xb6')](_0x14d6('0xb7'));}this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x159'),_0x41f7b1[_0x14d6('0x6b')]));var _0x16e484=this['ispeechTTS'][_0x14d6('0x7d')](this,_0x41f7b1);if(_0x16e484){this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x15a'),_0x16e484));var _0x37f4f7=this[_0x14d6('0x11')]['streamFile'](_0x16e484,_0x41f7b1[_0x14d6('0x13f')]);try{fs[_0x14d6('0x133')](_0x16e484+_0x14d6('0x10e'));}catch(_0x429cc4){logger['error'](_0x429cc4);}return _0x37f4f7;}return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x41f7b1,_0x14d6('0x15b'));};AGIVertices[_0x14d6('0x13')]['login']=function(_0x57f83c){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x15c'),_0x57f83c['label']));if(!this['isConfigured'](_0x57f83c[_0x14d6('0x15d')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x57f83c,_0x14d6('0x15e'));}logger[_0x14d6('0x30')](util['format'](_0x14d6('0x15f'),this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x57f83c[_0x14d6('0x15d')]));var _0x48cc5f=this['agentLogin'][_0x14d6('0x7d')](this,_0x57f83c['findBy']);if(_0x48cc5f){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x160'),this['channel']['callerid'],_0x57f83c[_0x14d6('0x15d')]));this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x57f83c[_0x14d6('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x57f83c[_0x14d6('0x15d')]));this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x161'),this[_0x14d6('0x11')]['callerid'],_0x57f83c[_0x14d6('0x15d')]));return{'code':0xc8,'result':_0x14d6('0x162')};}};AGIVertices['prototype'][_0x14d6('0x163')]=function(_0xe44025){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x164'),_0xe44025[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0xe44025[_0x14d6('0x15d')])){return this['channel'][_0x14d6('0x2f')](_0xe44025,_0x14d6('0x15e'));}logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x15f'),this['channel'][_0x14d6('0x3c')],_0xe44025['findBy']));var _0x3b5594=this[_0x14d6('0x60')][_0x14d6('0x7d')](this,_0xe44025['findBy']);if(_0x3b5594){logger[_0x14d6('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x14d6('0x11')][_0x14d6('0x3c')],_0xe44025['findBy']));this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x14d6('0x3c')],_0xe44025[_0x14d6('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x161'),this['channel'][_0x14d6('0x3c')],_0xe44025[_0x14d6('0x15d')]));this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x161'),this[_0x14d6('0x11')]['callerid'],_0xe44025['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x14d6('0x13')]['math']=function(_0x4ffc32){logger['info'](util[_0x14d6('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4ffc32[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x4ffc32[_0x14d6('0x165')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x4ffc32,_0x14d6('0x166'));}this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x167'),_0x4ffc32[_0x14d6('0x165')]));var _0xdb0ca5=eval(_0x4ffc32['operation']);if(!this['isConfigured'](_0x4ffc32['variable_id'])){return this[_0x14d6('0x11')]['noop'](_0x14d6('0xe1'));}var _0x15317d=this[_0x14d6('0x14')]['sync'](this,_0x4ffc32['variable_id']);if(!_0x15317d){return this['channel'][_0x14d6('0x2f')](_0x4ffc32,'no\x20variable\x20found');}if(_['isArray'](_0xdb0ca5)){var _0x43ce5f=this;_0xdb0ca5['forEach'](function(_0x328298,_0x5ef2a2){_0x43ce5f[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')](_0x14d6('0x168'),_0x15317d,_0x5ef2a2),_0x328298);});return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x169'),_0x15317d));}else{return this[_0x14d6('0x11')]['setVariable'](_0x15317d,_0xdb0ca5);}};AGIVertices[_0x14d6('0x13')]['menu']=function(_0x9ee40f){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x9ee40f[_0x14d6('0x3a')]));if(_0x9ee40f['retry']===0x0){return this[_0x14d6('0xb3')](_0x9ee40f);}_0x9ee40f[_0x14d6('0xb4')]-=0x1;if(!this['isConfigured'](_0x9ee40f[_0x14d6('0x11d')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x9ee40f,'no\x20file\x20audio\x20selected');}var _0x1dc636=this['getSound'][_0x14d6('0x7d')](this,_0x9ee40f['file_id']);if(!_0x1dc636){return this[_0x14d6('0x11')]['error'](_0x9ee40f,'no\x20file\x20audio\x20found');}var _0x4bae95=this[_0x14d6('0x11')]['getData'](_0x1dc636,_0x9ee40f[_0x14d6('0x120')],_0x9ee40f[_0x14d6('0x16a')]);var _0x2f159a=_0x4bae95[_0x14d6('0xb1')];if(_0x4bae95[_0x14d6('0xb1')]===-0x1){this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x9ee40f,'-1');return _0x4bae95;}else if(_0x4bae95[_0x14d6('0xb0')]===_0x14d6('0x73')){_0x4bae95[_0x14d6('0xb1')]=_0x4bae95[_0x14d6('0xb1')]['length']>0x0?_0x4bae95[_0x14d6('0xb1')]:'t';}else if(_[_0x14d6('0x49')](_0x4bae95[_0x14d6('0xb1')])){_0x4bae95['result']='#';_0x2f159a='#';}if(!this[_0x14d6('0x93')](_0x9ee40f[_0x14d6('0xe0')])){this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xe1'));}else{var _0x21432c=this[_0x14d6('0x14')][_0x14d6('0x7d')](this,_0x9ee40f[_0x14d6('0xe0')]);if(!_0x21432c){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x9ee40f,'no\x20variable\x20found');}this[_0x14d6('0x11')]['setVariable'](_0x21432c,_0x2f159a);}this[_0x14d6('0x39')]['sync'](this,_0x9ee40f,_0x2f159a);return _0x4bae95;};AGIVertices[_0x14d6('0x13')][_0x14d6('0xb6')]=function(_0x32a03b){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x16b'),_0x32a03b['label']));return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x32a03b['output']||_0x32a03b[_0x14d6('0x3a')]);};AGIVertices[_0x14d6('0x13')]['pause']=function(_0x26fb54){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x26fb54[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x26fb54[_0x14d6('0x15d')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x26fb54,_0x14d6('0x15e'));}logger[_0x14d6('0x30')](util['format'](_0x14d6('0x15f'),this['channel']['callerid'],_0x26fb54['findBy']));var _0x3662d8=this['getPause']['sync'](this,_0x26fb54['pause_id']);var _0x504e70=this['agentPause']['sync'](this,_0x26fb54['findBy'],_0x3662d8);if(_0x504e70){logger['info'](util['format'](_0x14d6('0x160'),this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x26fb54['findBy']));this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x160'),this['channel']['callerid'],_0x26fb54['findBy']));return{'code':0xc8,'result':_0x14d6('0x16c')};}else{logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x14d6('0x11')]['callerid'],_0x26fb54[_0x14d6('0x15d')]));this['channel']['noop'](util['format'](_0x14d6('0x160'),this['channel'][_0x14d6('0x3c')],_0x26fb54['findBy']));return{'code':0xc8,'result':_0x14d6('0x162')};}};AGIVertices['prototype'][_0x14d6('0x16d')]=function(_0xe94878){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x16e'),_0xe94878['label']));if(!this[_0x14d6('0x93')](_0xe94878[_0x14d6('0x11d')])){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0xe94878,_0x14d6('0x16f'));}var _0x3938ba=this[_0x14d6('0x20')][_0x14d6('0x7d')](this,_0xe94878[_0x14d6('0x11d')]);if(!_0x3938ba){return this['channel'][_0x14d6('0x2f')](_0xe94878,_0x14d6('0x11e'));}var _0x142d63=this[_0x14d6('0x11')]['exec'](_0x14d6('0x170'),[_0x3938ba,_0xe94878[_0x14d6('0xee')]]);if(_0x142d63[_0x14d6('0xb1')]===-0x1){return _0x142d63;}return this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0x171'),_0x14d6('0x170'),_0x3938ba));};AGIVertices[_0x14d6('0x13')]['queue']=function(_0xb0ab59){logger[_0x14d6('0x30')](util['format'](_0x14d6('0x172'),_0xb0ab59[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0xb0ab59[_0x14d6('0x173')])){return this[_0x14d6('0x11')]['error'](_0xb0ab59,_0x14d6('0x174'));}var _0x2c56fd='';var _0x3b4258=parseInt(_0xb0ab59[_0x14d6('0x173')],0xa);if(isNaN(_0x3b4258)){_0x2c56fd=_0xb0ab59[_0x14d6('0x173')];}else{_0x2c56fd=this[_0x14d6('0x1a')][_0x14d6('0x7d')](this,_0xb0ab59[_0x14d6('0x173')]);if(!_0x2c56fd){return this['channel'][_0x14d6('0x2f')](_0xb0ab59,_0x14d6('0x175'));}}var _0x2a4e71='';if(this['isConfigured'](_0xb0ab59[_0x14d6('0x11d')])){var _0x441e98=this[_0x14d6('0x20')][_0x14d6('0x7d')](this,_0xb0ab59[_0x14d6('0x11d')]);if(_0x441e98){_0x2a4e71=_0x441e98;}}this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0xb0ab59,_0x2c56fd);if(_0xb0ab59[_0x14d6('0xee')][_0x14d6('0x176')]('x')<0x0){_0xb0ab59['opts']+='x';}if(_0xb0ab59['opts']['indexOf']('X')<0x0){_0xb0ab59[_0x14d6('0xee')]+='X';}this['channel'][_0x14d6('0xb2')](_0x14d6('0x177'),_0x2c56fd?_0x2c56fd[_0x14d6('0x178')]():'');var _0x56cf30=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0x179'),[_0x2c56fd,_0xb0ab59[_0x14d6('0xee')],_0xb0ab59['url'],_0x2a4e71,_0xb0ab59['timeout'],_0xb0ab59[_0x14d6('0x9')],_0xb0ab59[_0x14d6('0x17a')],_0xb0ab59[_0x14d6('0x17b')],'',_0xb0ab59[_0x14d6('0x17c')]]);if(_0x56cf30['result']===-0x1){return _0x56cf30;}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x171'),_0x14d6('0x179'),_0x2c56fd));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x17d')]=function(_0x2aaa11){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x17e'),_0x2aaa11[_0x14d6('0x3a')]));var _0xc22f38=_0x2aaa11['recordingFormat']||_0x14d6('0x13c');var _0x38d6b0=util[_0x14d6('0x2c')](_0x14d6('0x17f'),this['channel'][_0x14d6('0x3e')],rs[_0x14d6('0x125')](0x5));var _0x58bc21=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x38d6b0,_0xc22f38);var _0x4b96a7=util[_0x14d6('0x2c')](_0x14d6('0x180'),FILES_PATH,_0x38d6b0);this[_0x14d6('0x3d')][_0x14d6('0x7d')](this,_0x2aaa11,_0x38d6b0,_0x58bc21);this['channel'][_0x14d6('0xb2')](_0x14d6('0x181'),_0x38d6b0);logger[_0x14d6('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x4b96a7,_0xc22f38,_0x2aaa11[_0x14d6('0x182')],_0x2aaa11[_0x14d6('0x73')]);return this[_0x14d6('0x11')][_0x14d6('0x13e')](_0x4b96a7,_0xc22f38,_0x2aaa11[_0x14d6('0x182')],_0x2aaa11[_0x14d6('0x73')],undefined,!![]);};AGIVertices['prototype'][_0x14d6('0x183')]=function(_0x4a3c9f){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x184'),_0x4a3c9f[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x4a3c9f[_0x14d6('0x80')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x185'));}var _0xf7766f=this[_0x14d6('0x186')][_0x14d6('0x7d')](this,_0x4a3c9f);logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x187'),util['inspect'](_0xf7766f,{'showHidden':![],'depth':null})));if(!this[_0x14d6('0x93')](_0x4a3c9f[_0x14d6('0xe0')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x188'));}var _0x11afeb=this[_0x14d6('0x14')][_0x14d6('0x7d')](this,_0x4a3c9f[_0x14d6('0xe0')]);if(!_0x11afeb){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x4a3c9f,_0x14d6('0xe2'));}this[_0x14d6('0x11')][_0x14d6('0xb2')](util[_0x14d6('0x2c')]('%s_STATUS_CODE',_0x11afeb),_0xf7766f[_0x14d6('0x83')]?_0xf7766f[_0x14d6('0x83')]:_0x14d6('0x189'));this[_0x14d6('0x11')]['setVariable'](util[_0x14d6('0x2c')](_0x14d6('0x18a'),_0x11afeb),_0xf7766f['statusMessage']?_0xf7766f[_0x14d6('0x84')]:'OK');if(_0xf7766f['body']){try{this[_0x14d6('0xab')](_0xf7766f[_0x14d6('0x77')],_0x11afeb);}catch(_0x1d7f4f){logger[_0x14d6('0x2f')](util[_0x14d6('0x2c')](_0x14d6('0x18b'),_0x11afeb));}}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format']('variable\x20%s\x20set',_0x11afeb));};AGIVertices['prototype'][_0x14d6('0x18c')]=function(_0x5676cd){logger[_0x14d6('0x30')](util['format'](_0x14d6('0x18d'),_0x5676cd[_0x14d6('0x3a')]));return this[_0x14d6('0x11')]['sayDigits'](_0x5676cd['digits'][_0x14d6('0x68')](/\s+/g,''),_0x5676cd['escape_digits']);};AGIVertices[_0x14d6('0x13')][_0x14d6('0x18e')]=function(_0x281796){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x18f'),_0x281796[_0x14d6('0x3a')]));return this['channel']['sayNumber'](_0x281796[_0x14d6('0x72')][_0x14d6('0x68')](/\s+/g,''),_0x281796[_0x14d6('0x182')]);};AGIVertices[_0x14d6('0x13')][_0x14d6('0x190')]=function(_0xc3d516){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0xc3d516[_0x14d6('0x3a')]));return this[_0x14d6('0x11')][_0x14d6('0x191')](_0xc3d516[_0x14d6('0x6b')],_0xc3d516['escape_digits']);};AGIVertices['prototype'][_0x14d6('0x192')]=function(_0x304ecc){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x304ecc[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x304ecc['account_id'])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x193'));}var _0x26b6c7=this['getMailAccount'][_0x14d6('0x7d')](this,_0x304ecc[_0x14d6('0x194')]);if(!_0x26b6c7||!_0x26b6c7[_0x14d6('0x195')]){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x304ecc,_0x14d6('0x196'));}var _0x37b8db={'from':util[_0x14d6('0x2c')]('\x22%s\x22\x20<%s>',_0x26b6c7[_0x14d6('0x18')],_0x26b6c7[_0x14d6('0x197')]||_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x198')]),'to':_0x304ecc['to']||'','cc':_0x304ecc['cc']||'','bcc':_0x304ecc[_0x14d6('0x199')]||'','subject':_0x304ecc[_0x14d6('0x19a')],'html':_0x304ecc[_0x14d6('0x6b')],'text':_0x304ecc[_0x14d6('0x6b')]};var _0x2a9f84={'tls':{'rejectUnauthorized':![]}};if(_0x26b6c7[_0x14d6('0x195')]['service']){_0x2a9f84[_0x14d6('0x19b')]=_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x19b')];}else{_0x2a9f84[_0x14d6('0x19c')]=_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x19c')];_0x2a9f84[_0x14d6('0x19d')]=_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x19d')];_0x2a9f84[_0x14d6('0x19e')]=_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x19e')];}if(_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x19f')]){_0x2a9f84[_0x14d6('0x1a0')]={'user':_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x198')],'pass':_0x26b6c7[_0x14d6('0x195')][_0x14d6('0x1a1')]};}if(this[_0x14d6('0x93')](_0x304ecc[_0x14d6('0x1a2')])){}logger[_0x14d6('0x1a3')](_0x14d6('0x1a4'),JSON[_0x14d6('0x81')](_0x37b8db));this['createSquareDetailsReport'][_0x14d6('0x7d')](this,_0x304ecc,_0x304ecc[_0x14d6('0x194')]);this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x26b6c7[_0x14d6('0x18')]));this[_0x14d6('0x25')]['sync'](this,_0x2a9f84,_0x37b8db);return this['channel']['noop'](_0x14d6('0x1a5'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1a6')]=function(_0x2bee85){logger['info'](util[_0x14d6('0x2c')](_0x14d6('0x1a7'),_0x2bee85[_0x14d6('0x3a')]));return this['channel']['noop'](_0x14d6('0x1a8'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1a9')]=function(_0x34a600){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1aa'),_0x34a600[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x34a600[_0x14d6('0x1ab')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x1ac'));}var _0x31af5c=this[_0x14d6('0x36')][_0x14d6('0x7d')](this,_0x34a600[_0x14d6('0x1ab')]);if(!_0x31af5c){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x34a600,_0x14d6('0x1ad'));}var _0x384e25={'body':_0x34a600['sms_text'],'phone':_0x34a600['to']||'','SmsAccountId':_0x31af5c['id']};logger['debug'](_0x14d6('0x1ae'),JSON['stringify'](_0x384e25));this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x34a600,_0x34a600[_0x14d6('0x1ab')]);this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x1af'),_0x31af5c[_0x14d6('0x18')]));this[_0x14d6('0x38')][_0x14d6('0x7d')](this,_0x384e25);return this[_0x14d6('0x11')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x14d6('0x13')]['set']=function(_0x4b720e){logger[_0x14d6('0x30')](util['format'](_0x14d6('0x1b0'),_0x4b720e[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x4b720e[_0x14d6('0xe0')])){return this[_0x14d6('0x11')]['error'](_0x4b720e,_0x14d6('0x1b1'));}var _0x3a7bf5=this[_0x14d6('0x14')]['sync'](this,_0x4b720e[_0x14d6('0xe0')]);if(!_0x3a7bf5){return this['channel']['error'](_0x4b720e,'no\x20variable\x20found');}return this[_0x14d6('0x11')][_0x14d6('0xb2')](_0x3a7bf5,_0x4b720e['variable_value']);};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1b2')]=function(_0x416a0a){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1b3'),_0x416a0a[_0x14d6('0x3a')]));this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x1b4'));if(_0x416a0a[_0x14d6('0xc7')]==='yes'){this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x1b5'));return this[_0x14d6('0x11')][_0x14d6('0xc7')]();}return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0x1b6'));};AGIVertices['prototype'][_0x14d6('0x1b7')]=function(_0x3e2c99){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3e2c99['label']));if(!this['isConfigured'](_0x3e2c99['project_id'])){return this[_0x14d6('0x11')]['error'](_0x3e2c99,_0x14d6('0x1b8'));}var _0x59657c=this['getSquareProject'][_0x14d6('0x7d')](this,_0x3e2c99[_0x14d6('0x1b9')]);if(!this[_0x14d6('0x93')](_0x59657c)){return this['channel']['error'](_0x3e2c99,util[_0x14d6('0x2c')](_0x14d6('0x1ba'),_0x3e2c99['project_id']));}if(_0x59657c===this[_0x14d6('0x11')][_0x14d6('0x45')]){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x3e2c99,_0x14d6('0x1bb'));}this['createSquareDetailsReport'][_0x14d6('0x7d')](this,_0x3e2c99,_0x59657c);var _0xaaff39=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0x1bc'),util[_0x14d6('0x2c')](_0x14d6('0x1bd'),config[_0x14d6('0x9')][_0x14d6('0x19c')]||_0x14d6('0x1be'),_0x59657c,this[_0x14d6('0x11')]['arg_1']));if(_0xaaff39['result']===-0x1){return _0xaaff39;}return this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format']('Executed\x20command\x20%s\x20%s',_0x14d6('0x1bc'),_0x59657c));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1bf')]=function(_0x14087c){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x14087c[_0x14d6('0x3a')]));var _0x486d75=this['shellCommand'][_0x14d6('0x7d')](this,_0x14087c[_0x14d6('0xc5')]);this[_0x14d6('0x39')][_0x14d6('0x7d')](this,_0x14087c,_0x14087c[_0x14d6('0xc5')]);if(this[_0x14d6('0x93')](_0x14087c[_0x14d6('0xe0')])){var _0x259da9=this[_0x14d6('0x14')]['sync'](this,_0x14087c[_0x14d6('0xe0')]);if(_0x259da9){this[_0x14d6('0x11')][_0x14d6('0xb2')](_0x259da9,_0x486d75);return this['channel'][_0x14d6('0xb6')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x14087c[_0x14d6('0xc5')],_0x259da9));}}return this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x14087c[_0x14d6('0xc5')]));};AGIVertices['prototype'][_0x14d6('0x1c0')]=function(_0x1473a2){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1c1'),_0x1473a2['label']));_0x1473a2[_0x14d6('0x6b')]=_0x1473a2['text'][_0x14d6('0x68')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x14d6('0x93')](_0x1473a2[_0x14d6('0x6a')])){return this['channel']['noop'](_0x14d6('0x1c2'));}if(!this[_0x14d6('0x93')](_0x1473a2[_0x14d6('0x6b')])){return this[_0x14d6('0x11')][_0x14d6('0xb6')](_0x14d6('0xb7'));}this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x1c3'),_0x1473a2[_0x14d6('0x6b')]));var _0x340c1a=this[_0x14d6('0x69')]['sync'](this,_0x1473a2);if(_0x340c1a){this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x1c4'),_0x340c1a));var _0x55faf5=this[_0x14d6('0x11')][_0x14d6('0x10d')](_0x340c1a);try{fs[_0x14d6('0x133')](_0x340c1a+'.wav');}catch(_0x2bb1a5){logger[_0x14d6('0x2f')](_0x2bb1a5);}return _0x55faf5;}return this['channel'][_0x14d6('0x2f')](_0x1473a2,_0x14d6('0x1c5'));};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1c6')]=function(_0x565ff6){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1c7'),_0x565ff6[_0x14d6('0x3a')]));_0x565ff6[_0x14d6('0x6b')]=_0x565ff6['text'][_0x14d6('0x68')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x14d6('0x93')](_0x565ff6['text'])){return this[_0x14d6('0x11')]['noop']('no\x20text\x20configured');}this[_0x14d6('0x11')]['noop'](util[_0x14d6('0x2c')](_0x14d6('0x1c8'),_0x565ff6[_0x14d6('0x6b')]));var _0xc95c27=this[_0x14d6('0x70')][_0x14d6('0x7d')](this,_0x565ff6);if(_0xc95c27){this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x1c9'),_0xc95c27));var _0xd7f6d8=this[_0x14d6('0x11')][_0x14d6('0x10d')](_0xc95c27);try{fs[_0x14d6('0x133')](_0xc95c27+_0x14d6('0x10e'));}catch(_0x50148d){logger[_0x14d6('0x2f')](_0x50148d);}return _0xd7f6d8;}return this['channel'][_0x14d6('0x2f')](_0x565ff6,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1ca')]=function(_0x52b8a6){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1cb'),_0x52b8a6[_0x14d6('0x3a')]));if(!this[_0x14d6('0x93')](_0x52b8a6[_0x14d6('0x15d')])){return this['channel'][_0x14d6('0x2f')](_0x52b8a6,_0x14d6('0x15e'));}logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x15f'),this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x52b8a6[_0x14d6('0x15d')]));var _0x788702=this[_0x14d6('0x5f')][_0x14d6('0x7d')](this,_0x52b8a6[_0x14d6('0x15d')]);if(_0x788702){logger[_0x14d6('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x52b8a6[_0x14d6('0x15d')]));this[_0x14d6('0x11')][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x160'),this[_0x14d6('0x11')]['callerid'],_0x52b8a6[_0x14d6('0x15d')]));return{'code':0xc8,'result':_0x14d6('0x16c')};}else{logger[_0x14d6('0x30')](util['format'](_0x14d6('0x161'),this['channel']['callerid'],_0x52b8a6[_0x14d6('0x15d')]));this[_0x14d6('0x11')][_0x14d6('0xb6')](util['format'](_0x14d6('0x161'),this[_0x14d6('0x11')][_0x14d6('0x3c')],_0x52b8a6[_0x14d6('0x15d')]));return{'code':0xc8,'result':_0x14d6('0x162')};}};AGIVertices[_0x14d6('0x13')][_0x14d6('0x1cc')]=function(_0x494b30){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')](_0x14d6('0x1cd'),_0x494b30[_0x14d6('0x3a')]));var _0x10df6a=this[_0x14d6('0x11')][_0x14d6('0x66')](_0x14d6('0x1ce'),[_0x494b30[_0x14d6('0x1cf')],_0x494b30[_0x14d6('0x87')]]);if(_0x10df6a[_0x14d6('0xb1')]===-0x1){return _0x10df6a;}return this['channel'][_0x14d6('0xb6')](util[_0x14d6('0x2c')](_0x14d6('0x171'),_0x14d6('0x1ce'),_0x494b30[_0x14d6('0x1cf')]));};AGIVertices['prototype'][_0x14d6('0x1d0')]=function(_0x3f2ee3){logger[_0x14d6('0x30')](util[_0x14d6('0x2c')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x3f2ee3[_0x14d6('0x3a')]));if(!this['isConfigured'](_0x3f2ee3[_0x14d6('0xe0')])){return this['channel'][_0x14d6('0x2f')](_0x3f2ee3,_0x14d6('0x1b1'));}var _0x4b9c82=this['getVariable']['sync'](this,_0x3f2ee3['variable_id']);if(!_0x4b9c82){return this[_0x14d6('0x11')][_0x14d6('0x2f')](_0x3f2ee3,'no\x20variable\x20found');}var _0x2d6d26=this['channel'][_0x14d6('0x14')](_0x4b9c82);return{'code':0xc8,'result':_0x2d6d26['extra']?_0x2d6d26['extra']:'-'};};String['prototype'][_0x14d6('0xaf')]=function(_0x5c81d1,_0x1b6348){return this['split'](_0x5c81d1)['join'](_0x1b6348);};module[_0x14d6('0x1d1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index cc536ea..b7fef80 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 _0xea09=['timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents'];(function(_0x393d56,_0x16c9dd){var _0x4b3aaf=function(_0x41c3d5){while(--_0x41c3d5){_0x393d56['push'](_0x393d56['shift']());}};_0x4b3aaf(++_0x16c9dd);}(_0xea09,0x1eb));var _0x9ea0=function(_0x16b9c9,_0x4a22d1){_0x16b9c9=_0x16b9c9-0x0;var _0x46be8c=_0xea09[_0x16b9c9];return _0x46be8c;};'use strict';var util=require(_0x9ea0('0x0'));var _=require('lodash');var moment=require('moment');var ami=require(_0x9ea0('0x1'));var logger=require(_0x9ea0('0x2'))(_0x9ea0('0x3'));var RpcUser=require(_0x9ea0('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3c9cbe){this[_0x9ea0('0x5')]=_0x3c9cbe['voiceQueues'];this[_0x9ea0('0x6')]=_0x3c9cbe['agents'];this[_0x9ea0('0x7')]=_0x3c9cbe[_0x9ea0('0x7')];this[_0x9ea0('0x8')]={};ami['on']('agentconnect',this[_0x9ea0('0x9')][_0x9ea0('0xa')](this));ami['on'](_0x9ea0('0xb'),this[_0x9ea0('0xc')][_0x9ea0('0xa')](this));ami['on']('hangup',this[_0x9ea0('0xd')]['bind'](this));ami['on'](_0x9ea0('0xe'),this[_0x9ea0('0xf')][_0x9ea0('0xa')](this));ami['on'](_0x9ea0('0x10'),this[_0x9ea0('0x11')][_0x9ea0('0xa')](this));ami['on'](_0x9ea0('0x12'),this[_0x9ea0('0x13')]['bind'](this));ami['on'](_0x9ea0('0x14'),this[_0x9ea0('0x15')][_0x9ea0('0xa')](this));}function getDiff(_0x1709d8){var _0x4b9205=moment()[_0x9ea0('0x16')](0x0);var _0x761826=moment(_0x1709d8)[_0x9ea0('0x16')](0x0);return _0x4b9205[_0x9ea0('0x17')](_0x761826,_0x9ea0('0x18'));}Acw[_0x9ea0('0x19')]['startAcw']=function(_0x2395eb){try{var _0xce476a=this;var _0x4d1c6c=this[_0x9ea0('0x8')][_0x2395eb][_0x9ea0('0x1a')];var _0x4f9088=this[_0x9ea0('0x8')][_0x2395eb][_0x9ea0('0x1b')];var _0x27460a=this[_0x9ea0('0x5')][_0x4f9088];var _0x24671d=![];var _0x1494f2=_0x9ea0('0x1c');if(_0x27460a['mandatoryDisposition']){if(_0x27460a['mandatoryDispositionPause']['name']){_0x24671d=!![];_0x1494f2=_0x27460a['mandatoryDispositionPause'][_0x9ea0('0x1d')];}}ami[_0x9ea0('0x1e')]({'action':_0x9ea0('0x1f'),'interface':_0x4d1c6c,'paused':!![],'reason':_0x1494f2})[_0x9ea0('0x20')](function(_0x4886d0){if(_0xce476a['agents'][_0x4d1c6c]){return RpcUser['getAgent'](_0xce476a[_0x9ea0('0x6')][_0x4d1c6c]['id'])[_0x9ea0('0x20')](function(_0x36d6a5){if(_0x36d6a5&&!_0x36d6a5[_0x9ea0('0x21')]){logger[_0x9ea0('0x22')](_0x9ea0('0x23'),_0x2395eb,_0x4d1c6c,_0x4f9088);var _0x1563dc=_0xce476a[_0x9ea0('0x8')][_0x2395eb][_0x9ea0('0x24')]&&_0xce476a[_0x9ea0('0x8')][_0x2395eb]['destlinkedid']?_0xce476a[_0x9ea0('0x8')][_0x2395eb][_0x9ea0('0x25')]:_0x2395eb;return RpcUser['savePause'](_0xce476a[_0x9ea0('0x6')][_0x4d1c6c],_0x1494f2,_0x1563dc)['then'](function(_0x44b9ff){if(!_0x24671d){_0xce476a[_0x9ea0('0x7')][_0x4d1c6c]={};logger[_0x9ea0('0x22')](_0x9ea0('0x26'),_0x2395eb,_0xce476a['voiceQueues'][_0x4f9088][_0x9ea0('0x27')],_0x4d1c6c,_0x4f9088);_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x28')]=setTimeout(_0xce476a[_0x9ea0('0x29')]['bind'](_0xce476a,_0x4d1c6c),_0xce476a[_0x9ea0('0x5')][_0x4f9088][_0x9ea0('0x27')]*0x3e8);_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x2a')]=moment()[_0x9ea0('0x2b')](_0x9ea0('0x2c'));_0xce476a['timers'][_0x4d1c6c][_0x9ea0('0x2d')]=_0x2395eb;_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x1b')]=_0x4f9088;_0xce476a[_0x9ea0('0x7')][_0x4d1c6c]['updateAcw']=function(){var _0x34cdab=getDiff(_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x2a')]);clearTimeout(_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x28')]);_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x34cdab},_0xce476a[_0x9ea0('0x7')][_0x4d1c6c][_0x9ea0('0x2d')],_0x4d1c6c)[_0x9ea0('0x20')](function(_0x5207de){logger[_0x9ea0('0x22')](_0x9ea0('0x2e'),_0x2395eb,_0x34cdab,_0x5207de);})['catch'](function(_0x56951d){logger[_0x9ea0('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x2395eb,_0x56951d);});delete _0xce476a[_0x9ea0('0x7')][_0x4d1c6c];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2395eb,_0x4d1c6c,_0x4f9088);}});}})['catch'](function(_0x531ae8){logger[_0x9ea0('0x2f')](_0x9ea0('0x26'),_0x2395eb,_0xce476a[_0x9ea0('0x5')][_0x4f9088][_0x9ea0('0x27')],_0x4d1c6c,_0x4f9088);})[_0x9ea0('0x30')](function(){delete _0xce476a[_0x9ea0('0x8')][_0x2395eb];});}catch(_0x326c07){logger[_0x9ea0('0x2f')](_0x9ea0('0x31'),_0x326c07[_0x9ea0('0x32')]);}};Acw[_0x9ea0('0x19')][_0x9ea0('0x29')]=function(_0x232c99){try{var _0x1c5180=this;if(_0x1c5180[_0x9ea0('0x7')][_0x232c99]){_0x1c5180[_0x9ea0('0x7')][_0x232c99][_0x9ea0('0x28')]=![];var _0x1bf031=_0x1c5180[_0x9ea0('0x7')][_0x232c99][_0x9ea0('0x2d')];var _0x427240=_0x1c5180[_0x9ea0('0x7')][_0x232c99][_0x9ea0('0x1b')];var _0x253bf3=_0x1c5180[_0x9ea0('0x5')][_0x427240][_0x9ea0('0x27')];logger[_0x9ea0('0x22')](_0x9ea0('0x33'),_0x1bf031,_0x232c99);RpcUser[_0x9ea0('0x34')](this[_0x9ea0('0x6')][_0x232c99]);RpcVoiceAgentReport['update']({'acwtime':_0x253bf3,'agentacw':!![]},_0x1bf031,_0x232c99)[_0x9ea0('0x20')](function(_0x5b1b8e){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x1bf031,_0x253bf3,_0x5b1b8e);})[_0x9ea0('0x35')](function(_0x27a1f8){logger[_0x9ea0('0x2f')](_0x9ea0('0x36'),_0x1bf031,_0x27a1f8);});}else{logger[_0x9ea0('0x2f')](_0x9ea0('0x37'),_0x232c99);if(_0x1c5180[_0x9ea0('0x7')]){logger[_0x9ea0('0x22')](_0x9ea0('0x38'),JSON['stringify'](_0x1c5180[_0x9ea0('0x7')]));}}}catch(_0x3ec6d9){logger['error']('[ACW][STOP]\x20%s',_0x3ec6d9['message']);}};Acw[_0x9ea0('0x19')][_0x9ea0('0x9')]=function(_0x3e5c89){try{if(this[_0x9ea0('0x5')][_0x3e5c89['queue']]&&(this[_0x9ea0('0x5')][_0x3e5c89[_0x9ea0('0x1b')]][_0x9ea0('0x3')]||this['voiceQueues'][_0x3e5c89[_0x9ea0('0x1b')]][_0x9ea0('0x39')])){if(this[_0x9ea0('0x6')][_0x3e5c89['interface']]){this[_0x9ea0('0x8')][_0x3e5c89['uniqueid']]={'queue':_0x3e5c89[_0x9ea0('0x1b')],'interface':_0x3e5c89['interface'],'destlinkedid':_0x3e5c89[_0x9ea0('0x25')]};}}}catch(_0xa8c883){logger[_0x9ea0('0x2f')](_0x9ea0('0x3a'),_0xa8c883['message']);}};Acw[_0x9ea0('0x19')][_0x9ea0('0x15')]=function(_0x52c176){try{if(this['voiceQueues'][_0x52c176[_0x9ea0('0x1b')]]&&(this[_0x9ea0('0x5')][_0x52c176['queue']][_0x9ea0('0x3')]||this[_0x9ea0('0x5')][_0x52c176[_0x9ea0('0x1b')]][_0x9ea0('0x39')])){if(this[_0x9ea0('0x6')][_0x52c176[_0x9ea0('0x1a')]]){this[_0x9ea0('0x8')][_0x52c176[_0x9ea0('0x2d')]]={'queue':_0x52c176[_0x9ea0('0x1b')],'interface':_0x52c176[_0x9ea0('0x1a')]};}}}catch(_0x46ae6c){logger[_0x9ea0('0x2f')](_0x9ea0('0x3b'),_0x46ae6c[_0x9ea0('0x32')]);}};Acw['prototype']['syncHangupRequest']=function(_0x3c85ff){try{if(this[_0x9ea0('0x8')][_0x3c85ff[_0x9ea0('0x2d')]]&&_[_0x9ea0('0x3c')](this[_0x9ea0('0x8')][_0x3c85ff[_0x9ea0('0x2d')]][_0x9ea0('0x24')])){logger['info'](_0x9ea0('0x3d'),_0x3c85ff[_0x9ea0('0x2d')]);this[_0x9ea0('0x3e')](_0x3c85ff[_0x9ea0('0x2d')]);}else if(this[_0x9ea0('0x8')][_0x3c85ff[_0x9ea0('0x3f')]]&&_['isUndefined'](this[_0x9ea0('0x8')][_0x3c85ff[_0x9ea0('0x3f')]][_0x9ea0('0x24')])){logger[_0x9ea0('0x22')](_0x9ea0('0x40'),_0x3c85ff[_0x9ea0('0x3f')]);this[_0x9ea0('0x3e')](_0x3c85ff[_0x9ea0('0x3f')]);}}catch(_0x6c692a){logger[_0x9ea0('0x2f')](_0x9ea0('0x41'),_0x6c692a[_0x9ea0('0x32')]);}};Acw[_0x9ea0('0x19')]['syncHangup']=function(_0x3bac6d){try{if(this[_0x9ea0('0x8')][_0x3bac6d[_0x9ea0('0x2d')]]&&this[_0x9ea0('0x8')][_0x3bac6d[_0x9ea0('0x2d')]]['attended']){logger[_0x9ea0('0x22')](_0x9ea0('0x42'),_0x3bac6d['uniqueid']);this['startAcw'](_0x3bac6d['uniqueid']);}else if(this[_0x9ea0('0x8')][_0x3bac6d['linkedid']]&&this[_0x9ea0('0x8')][_0x3bac6d['linkedid']][_0x9ea0('0x24')]){logger['info'](_0x9ea0('0x43'),_0x3bac6d[_0x9ea0('0x3f')]);this[_0x9ea0('0x3e')](_0x3bac6d[_0x9ea0('0x3f')]);}}catch(_0x3a4f66){logger[_0x9ea0('0x2f')](_0x9ea0('0x44'),_0x3a4f66[_0x9ea0('0x32')]);}};Acw[_0x9ea0('0x19')][_0x9ea0('0x11')]=function(_0x2fb2ba){try{if(!_[_0x9ea0('0x45')](this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x46')]])){this['startAcw'](_0x2fb2ba[_0x9ea0('0x46')]);if(this['channels'][_0x2fb2ba['secondtransfereruniqueid']]){this[_0x9ea0('0x8')][_0x2fb2ba['secondtransfereruniqueid']][_0x9ea0('0x24')]=!![];this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x47')]]=this[_0x9ea0('0x8')][_0x2fb2ba['secondtransfereruniqueid']];delete this[_0x9ea0('0x8')][_0x2fb2ba['secondtransfereruniqueid']];}}else if(!_[_0x9ea0('0x45')](this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x47')]])){this[_0x9ea0('0x3e')](_0x2fb2ba[_0x9ea0('0x47')]);if(this[_0x9ea0('0x8')][_0x2fb2ba['origtransfereruniqueid']]){this['channels'][_0x2fb2ba['origtransfereruniqueid']][_0x9ea0('0x24')]=!![];this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x46')]]=this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x48')]];delete this[_0x9ea0('0x8')][_0x2fb2ba[_0x9ea0('0x48')]];}}}catch(_0x211c75){logger[_0x9ea0('0x2f')](_0x9ea0('0x49'),_0x211c75[_0x9ea0('0x32')]);}};Acw[_0x9ea0('0x19')][_0x9ea0('0x13')]=function(_0x229808){try{if(this[_0x9ea0('0x8')][_0x229808[_0x9ea0('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x9ea0('0x4b')](_0x229808[_0x9ea0('0x4a')]));this[_0x9ea0('0x3e')](_0x229808[_0x9ea0('0x4a')]);}else if(this[_0x9ea0('0x8')][_0x229808['transfererlinkedid']]){logger[_0x9ea0('0x22')](_0x9ea0('0x4c'),JSON['stringify'](_0x229808['transfererlinkedid']));this['startAcw'](_0x229808[_0x9ea0('0x4d')]);}}catch(_0x205028){logger[_0x9ea0('0x2f')]('[ACW][syncBlindTransfer]\x20%s',_0x205028[_0x9ea0('0x32')]);}};Acw[_0x9ea0('0x19')][_0x9ea0('0xf')]=function(_0x253455){try{if(this['voiceQueues'][_0x253455[_0x9ea0('0x1b')]]&&this[_0x9ea0('0x5')][_0x253455[_0x9ea0('0x1b')]][_0x9ea0('0x4e')]==='all'){if(this['agents'][_0x253455[_0x9ea0('0x1a')]]){logger[_0x9ea0('0x22')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x253455[_0x9ea0('0x2d')],_0x253455[_0x9ea0('0x1a')],_0x253455[_0x9ea0('0x1b')]);return RpcUser[_0x9ea0('0x4f')](this['agents'][_0x253455['interface']],_0x9ea0('0x50'),_0x253455[_0x9ea0('0x2d')]);}}}catch(_0x4becb6){logger['error'](_0x9ea0('0x51'),_0x4becb6[_0x9ea0('0x32')]);}};module[_0x9ea0('0x52')]=Acw; \ No newline at end of file +var _0xeb7d=['linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','agents','info','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw'];(function(_0x4b57c4,_0xa451f5){var _0x27e3fd=function(_0x50a2a7){while(--_0x50a2a7){_0x4b57c4['push'](_0x4b57c4['shift']());}};_0x27e3fd(++_0xa451f5);}(_0xeb7d,0x1b3));var _0xdeb7=function(_0x4afd2c,_0x5d6800){_0x4afd2c=_0x4afd2c-0x0;var _0x33074e=_0xeb7d[_0x4afd2c];return _0x33074e;};'use strict';var util=require(_0xdeb7('0x0'));var _=require(_0xdeb7('0x1'));var moment=require(_0xdeb7('0x2'));var ami=require(_0xdeb7('0x3'));var logger=require(_0xdeb7('0x4'))(_0xdeb7('0x5'));var RpcUser=require(_0xdeb7('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0xecac07){this['voiceQueues']=_0xecac07[_0xdeb7('0x7')];this['agents']=_0xecac07['agents'];this[_0xdeb7('0x8')]=_0xecac07['timers'];this[_0xdeb7('0x9')]={};ami['on'](_0xdeb7('0xa'),this[_0xdeb7('0xb')][_0xdeb7('0xc')](this));ami['on'](_0xdeb7('0xd'),this[_0xdeb7('0xe')]['bind'](this));ami['on'](_0xdeb7('0xf'),this[_0xdeb7('0x10')][_0xdeb7('0xc')](this));ami['on'](_0xdeb7('0x11'),this[_0xdeb7('0x12')][_0xdeb7('0xc')](this));ami['on'](_0xdeb7('0x13'),this[_0xdeb7('0x14')][_0xdeb7('0xc')](this));ami['on'](_0xdeb7('0x15'),this['syncBlindTransfer'][_0xdeb7('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0xdeb7('0x16')][_0xdeb7('0xc')](this));}function getDiff(_0x3ec6b5){var _0x442e06=moment()[_0xdeb7('0x17')](0x0);var _0x1a1e46=moment(_0x3ec6b5)[_0xdeb7('0x17')](0x0);return _0x442e06[_0xdeb7('0x18')](_0x1a1e46,_0xdeb7('0x19'));}Acw['prototype']['startAcw']=function(_0x1defae){try{var _0x576e4b=this;var _0x2af785=this[_0xdeb7('0x9')][_0x1defae][_0xdeb7('0x1a')];var _0x25e3f5=this['channels'][_0x1defae][_0xdeb7('0x1b')];var _0x44caf1=this[_0xdeb7('0x7')][_0x25e3f5];var _0x1e5dbd=![];var _0x191b92=_0xdeb7('0x1c');if(_0x44caf1[_0xdeb7('0x1d')]){if(_0x44caf1[_0xdeb7('0x1e')][_0xdeb7('0x1f')]){_0x1e5dbd=!![];_0x191b92=_0x44caf1[_0xdeb7('0x1e')][_0xdeb7('0x1f')];}}ami[_0xdeb7('0x20')]({'action':_0xdeb7('0x21'),'interface':_0x2af785,'paused':!![],'reason':_0x191b92})[_0xdeb7('0x22')](function(_0x15ad4b){if(_0x576e4b['agents'][_0x2af785]){return RpcUser[_0xdeb7('0x23')](_0x576e4b['agents'][_0x2af785]['id'])['then'](function(_0x1c78ee){if(_0x1c78ee&&!_0x1c78ee['voicePause']){logger['info'](_0xdeb7('0x24'),_0x1defae,_0x2af785,_0x25e3f5);var _0x5998a7=_0x576e4b[_0xdeb7('0x9')][_0x1defae][_0xdeb7('0x25')]&&_0x576e4b['channels'][_0x1defae][_0xdeb7('0x26')]?_0x576e4b['channels'][_0x1defae][_0xdeb7('0x26')]:_0x1defae;return RpcUser[_0xdeb7('0x27')](_0x576e4b[_0xdeb7('0x28')][_0x2af785],_0x191b92,_0x5998a7)['then'](function(_0x480038){if(!_0x1e5dbd){_0x576e4b[_0xdeb7('0x8')][_0x2af785]={};logger[_0xdeb7('0x29')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1defae,_0x576e4b[_0xdeb7('0x7')][_0x25e3f5][_0xdeb7('0x2a')],_0x2af785,_0x25e3f5);_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x2b')]=setTimeout(_0x576e4b[_0xdeb7('0x2c')]['bind'](_0x576e4b,_0x2af785),_0x576e4b[_0xdeb7('0x7')][_0x25e3f5][_0xdeb7('0x2a')]*0x3e8);_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x2d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x2e')]=_0x1defae;_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x1b')]=_0x25e3f5;_0x576e4b['timers'][_0x2af785]['updateAcw']=function(){var _0x5b6e57=getDiff(_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x2d')]);clearTimeout(_0x576e4b[_0xdeb7('0x8')][_0x2af785]['timer']);_0x576e4b[_0xdeb7('0x8')][_0x2af785][_0xdeb7('0x2b')]=![];RpcVoiceAgentReport[_0xdeb7('0x2f')]({'acwtime':_0x5b6e57},_0x576e4b['timers'][_0x2af785][_0xdeb7('0x2e')],_0x2af785)[_0xdeb7('0x22')](function(_0x42b814){logger[_0xdeb7('0x29')](_0xdeb7('0x30'),_0x1defae,_0x5b6e57,_0x42b814);})[_0xdeb7('0x31')](function(_0x127238){logger[_0xdeb7('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x1defae,_0x127238);});delete _0x576e4b[_0xdeb7('0x8')][_0x2af785];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1defae,_0x2af785,_0x25e3f5);}});}})[_0xdeb7('0x31')](function(_0x79fa4c){logger[_0xdeb7('0x32')](_0xdeb7('0x33'),_0x1defae,_0x576e4b['voiceQueues'][_0x25e3f5][_0xdeb7('0x2a')],_0x2af785,_0x25e3f5);})['finally'](function(){delete _0x576e4b[_0xdeb7('0x9')][_0x1defae];});}catch(_0x336d64){logger[_0xdeb7('0x32')]('[ACW][START]\x20%s',_0x336d64[_0xdeb7('0x34')]);}};Acw[_0xdeb7('0x35')][_0xdeb7('0x2c')]=function(_0x550a10){try{var _0x3972bd=this;if(_0x3972bd[_0xdeb7('0x8')][_0x550a10]){_0x3972bd[_0xdeb7('0x8')][_0x550a10][_0xdeb7('0x2b')]=![];var _0x56fc10=_0x3972bd['timers'][_0x550a10][_0xdeb7('0x2e')];var _0x6d2078=_0x3972bd['timers'][_0x550a10]['queue'];var _0x243bcb=_0x3972bd['voiceQueues'][_0x6d2078][_0xdeb7('0x2a')];logger[_0xdeb7('0x29')]('[%s][TIMER][STOP][AGENT:%s]',_0x56fc10,_0x550a10);RpcUser[_0xdeb7('0x36')](this[_0xdeb7('0x28')][_0x550a10]);RpcVoiceAgentReport[_0xdeb7('0x2f')]({'acwtime':_0x243bcb,'agentacw':!![]},_0x56fc10,_0x550a10)['then'](function(_0x2abb1d){logger['info'](_0xdeb7('0x30'),_0x56fc10,_0x243bcb,_0x2abb1d);})[_0xdeb7('0x31')](function(_0x401f1b){logger[_0xdeb7('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x56fc10,_0x401f1b);});}else{logger[_0xdeb7('0x32')](_0xdeb7('0x37'),_0x550a10);if(_0x3972bd[_0xdeb7('0x8')]){logger['info'](_0xdeb7('0x38'),JSON['stringify'](_0x3972bd[_0xdeb7('0x8')]));}}}catch(_0x16ff1f){logger['error'](_0xdeb7('0x39'),_0x16ff1f['message']);}};Acw[_0xdeb7('0x35')][_0xdeb7('0xb')]=function(_0x2fbb3f){try{if(this[_0xdeb7('0x7')][_0x2fbb3f['queue']]&&(this[_0xdeb7('0x7')][_0x2fbb3f[_0xdeb7('0x1b')]]['acw']||this[_0xdeb7('0x7')][_0x2fbb3f[_0xdeb7('0x1b')]][_0xdeb7('0x1d')])){if(this['agents'][_0x2fbb3f[_0xdeb7('0x1a')]]){this['channels'][_0x2fbb3f[_0xdeb7('0x2e')]]={'queue':_0x2fbb3f[_0xdeb7('0x1b')],'interface':_0x2fbb3f[_0xdeb7('0x1a')],'destlinkedid':_0x2fbb3f[_0xdeb7('0x26')]};}}}catch(_0xd4304c){logger[_0xdeb7('0x32')](_0xdeb7('0x3a'),_0xd4304c[_0xdeb7('0x34')]);}};Acw[_0xdeb7('0x35')]['syncAgentConnectPreview']=function(_0x3d6ef5){try{if(this[_0xdeb7('0x7')][_0x3d6ef5['queue']]&&(this[_0xdeb7('0x7')][_0x3d6ef5[_0xdeb7('0x1b')]][_0xdeb7('0x5')]||this['voiceQueues'][_0x3d6ef5[_0xdeb7('0x1b')]][_0xdeb7('0x1d')])){if(this[_0xdeb7('0x28')][_0x3d6ef5[_0xdeb7('0x1a')]]){this[_0xdeb7('0x9')][_0x3d6ef5[_0xdeb7('0x2e')]]={'queue':_0x3d6ef5[_0xdeb7('0x1b')],'interface':_0x3d6ef5['interface']};}}}catch(_0x41f310){logger[_0xdeb7('0x32')](_0xdeb7('0x3b'),_0x41f310[_0xdeb7('0x34')]);}};Acw['prototype'][_0xdeb7('0xe')]=function(_0x1653de){try{if(this[_0xdeb7('0x9')][_0x1653de[_0xdeb7('0x2e')]]&&_[_0xdeb7('0x3c')](this[_0xdeb7('0x9')][_0x1653de[_0xdeb7('0x2e')]][_0xdeb7('0x25')])){logger[_0xdeb7('0x29')](_0xdeb7('0x3d'),_0x1653de[_0xdeb7('0x2e')]);this[_0xdeb7('0x3e')](_0x1653de[_0xdeb7('0x2e')]);}else if(this[_0xdeb7('0x9')][_0x1653de[_0xdeb7('0x3f')]]&&_[_0xdeb7('0x3c')](this[_0xdeb7('0x9')][_0x1653de[_0xdeb7('0x3f')]][_0xdeb7('0x25')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x1653de[_0xdeb7('0x3f')]);this['startAcw'](_0x1653de[_0xdeb7('0x3f')]);}}catch(_0x4a94bb){logger[_0xdeb7('0x32')](_0xdeb7('0x40'),_0x4a94bb[_0xdeb7('0x34')]);}};Acw[_0xdeb7('0x35')]['syncHangup']=function(_0x5b299d){try{if(this['channels'][_0x5b299d[_0xdeb7('0x2e')]]&&this[_0xdeb7('0x9')][_0x5b299d['uniqueid']][_0xdeb7('0x25')]){logger['info'](_0xdeb7('0x41'),_0x5b299d['uniqueid']);this['startAcw'](_0x5b299d[_0xdeb7('0x2e')]);}else if(this[_0xdeb7('0x9')][_0x5b299d[_0xdeb7('0x3f')]]&&this[_0xdeb7('0x9')][_0x5b299d[_0xdeb7('0x3f')]][_0xdeb7('0x25')]){logger[_0xdeb7('0x29')](_0xdeb7('0x42'),_0x5b299d[_0xdeb7('0x3f')]);this[_0xdeb7('0x3e')](_0x5b299d[_0xdeb7('0x3f')]);}}catch(_0x44a4bd){logger[_0xdeb7('0x32')](_0xdeb7('0x43'),_0x44a4bd[_0xdeb7('0x34')]);}};Acw[_0xdeb7('0x35')][_0xdeb7('0x14')]=function(_0x5eeee9){try{if(!_[_0xdeb7('0x44')](this['channels'][_0x5eeee9['transfereeuniqueid']])){this['startAcw'](_0x5eeee9[_0xdeb7('0x45')]);if(this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x46')]]){this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x46')]][_0xdeb7('0x25')]=!![];this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x47')]]=this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x46')]];delete this['channels'][_0x5eeee9['secondtransfereruniqueid']];}}else if(!_[_0xdeb7('0x44')](this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x47')]])){this[_0xdeb7('0x3e')](_0x5eeee9[_0xdeb7('0x47')]);if(this['channels'][_0x5eeee9[_0xdeb7('0x48')]]){this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x48')]][_0xdeb7('0x25')]=!![];this[_0xdeb7('0x9')][_0x5eeee9['transfereeuniqueid']]=this[_0xdeb7('0x9')][_0x5eeee9[_0xdeb7('0x48')]];delete this[_0xdeb7('0x9')][_0x5eeee9['origtransfereruniqueid']];}}}catch(_0x212be5){logger['error'](_0xdeb7('0x49'),_0x212be5[_0xdeb7('0x34')]);}};Acw[_0xdeb7('0x35')][_0xdeb7('0x4a')]=function(_0x4d5a15){try{if(this['channels'][_0x4d5a15[_0xdeb7('0x4b')]]){logger[_0xdeb7('0x29')](_0xdeb7('0x4c'),JSON['stringify'](_0x4d5a15[_0xdeb7('0x4b')]));this[_0xdeb7('0x3e')](_0x4d5a15['transfereruniqueid']);}else if(this[_0xdeb7('0x9')][_0x4d5a15['transfererlinkedid']]){logger[_0xdeb7('0x29')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xdeb7('0x4d')](_0x4d5a15[_0xdeb7('0x4e')]));this['startAcw'](_0x4d5a15[_0xdeb7('0x4e')]);}}catch(_0x4c2181){logger[_0xdeb7('0x32')](_0xdeb7('0x4f'),_0x4c2181['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x21eded){try{if(this['voiceQueues'][_0x21eded[_0xdeb7('0x1b')]]&&this[_0xdeb7('0x7')][_0x21eded[_0xdeb7('0x1b')]]['autopause']===_0xdeb7('0x50')){if(this[_0xdeb7('0x28')][_0x21eded[_0xdeb7('0x1a')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x21eded['uniqueid'],_0x21eded[_0xdeb7('0x1a')],_0x21eded[_0xdeb7('0x1b')]);return RpcUser[_0xdeb7('0x27')](this[_0xdeb7('0x28')][_0x21eded[_0xdeb7('0x1a')]],_0xdeb7('0x51'),_0x21eded[_0xdeb7('0x2e')]);}}}catch(_0x15fca9){logger[_0xdeb7('0x32')](_0xdeb7('0x52'),_0x15fca9['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7beada3..5a2e858 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x1dc866,_0x3efd43){_0x1dc866=_0x1dc866-0x0;var _0x5ca2e2=_0x2032[_0x1dc866];return _0x5ca2e2;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x339ebd,_0x370c9b){_0x339ebd=_0x339ebd-0x0;var _0x6b2751=_0x2032[_0x339ebd];return _0x6b2751;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8b55476..4f57a6c 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xcb91[_0x51cc1d];return _0x2eb9f2;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xda3f,0xec));var _0xfda3=function(_0x38608a,_0x3e7f35){_0x38608a=_0x38608a-0x0;var _0x677ff1=_0xda3f[_0x38608a];return _0x677ff1;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 38d8129..dd04f60 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3035=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','callback','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','prototype','exports','util','moment','isNil','string','uniqueid','name','Contact','firstName','lastName','number','phone','active','type'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3035,0x164));var _0x5303=function(_0x5852cb,_0x49c8c4){_0x5852cb=_0x5852cb-0x0;var _0x562c3d=_0x3035[_0x5852cb];return _0x562c3d;};'use strict';var util=require(_0x5303('0x0'));var _=require('lodash');var moment=require(_0x5303('0x1'));function checkNameSurname(_0x24df1d,_0x2051cd,_0x1429e6){var _0x4ebce1='';if(!_[_0x5303('0x2')](_0x2051cd)&&'string'===typeof _0x2051cd){_0x4ebce1+=_0x2051cd;}if(!_['isNil'](_0x1429e6)&&_0x5303('0x3')===typeof _0x1429e6){_0x4ebce1+='\x20'+_0x1429e6;}if(_0x4ebce1!==''){return _0x4ebce1;}return _0x24df1d;}function Action(_0x3bd9a5,_0x3bf229,_0x330a8c){this['voiceQueue']=_0x3bd9a5;this[_0x5303('0x4')]=_0x330a8c||undefined;this[_0x5303('0x5')]=checkNameSurname(_0x3bf229[_0x5303('0x6')]['phone'],_0x3bf229['Contact'][_0x5303('0x7')],_0x3bf229[_0x5303('0x6')][_0x5303('0x8')]);this[_0x5303('0x9')]=_0x3bf229[_0x5303('0x6')][_0x5303('0xa')];this['queue']=_0x3bd9a5[_0x5303('0x5')];this[_0x5303('0xb')]=_0x3bf229[_0x5303('0xb')]||![];this[_0x5303('0xc')]=_0x3bd9a5[_0x5303('0xc')];this[_0x5303('0xd')]=_0x3bd9a5[_0x5303('0xd')]||0x3;this[_0x5303('0xe')]=_0x3bf229[_0x5303('0xe')];this[_0x5303('0xf')]=_0x3bf229[_0x5303('0xf')];this[_0x5303('0x10')]=_0x3bf229[_0x5303('0x10')];this[_0x5303('0x11')]=_0x3bf229['countnoanswerretry'];this[_0x5303('0x12')]=_0x3bf229[_0x5303('0x12')];this['countdropretry']=_0x3bf229[_0x5303('0x13')];this[_0x5303('0x14')]=_0x3bf229[_0x5303('0x14')];this[_0x5303('0x15')]=_0x3bf229[_0x5303('0x15')];this[_0x5303('0x16')]=_0x3bf229[_0x5303('0x16')];this[_0x5303('0x17')]=_0x3bf229[_0x5303('0x17')];this[_0x5303('0x18')]=_0x3bf229[_0x5303('0x18')];this[_0x5303('0x19')]=_0x3bf229['UserId'];this[_0x5303('0x1a')]=_0x3bf229[_0x5303('0x1a')];this[_0x5303('0x1b')]=_0x3bf229[_0x5303('0x1b')];this[_0x5303('0x1c')]=_0x3bf229['id'];this[_0x5303('0x1d')]=_0x3bf229[_0x5303('0x6')][_0x5303('0x7')]||'';this['starttime']=moment()[_0x5303('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5303('0x1f')]=_0x3bf229[_0x5303('0x1f')];this['callbackuniqueid']=_0x3bf229['callbackuniqueid'];this['callbackat']=_0x3bf229['callbackat'];this[_0x5303('0x20')]=_0x3bf229[_0x5303('0x20')];this['originatecalleridnum']='';this[_0x5303('0x21')]='';}Action['prototype'][_0x5303('0x22')]=function(){return util['format'](_0x5303('0x23'),this['name'],this[_0x5303('0x24')]['dialCutDigit']>0x0?this[_0x5303('0x9')][_0x5303('0x25')](this['voiceQueue'][_0x5303('0x26')]):this[_0x5303('0x9')]);};Action[_0x5303('0x27')]['getQueue']=function(){return this['queue'];};module[_0x5303('0x28')]=Action; \ No newline at end of file +var _0xe600=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','phone','Contact','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x3340ff,_0x299013){var _0x4f3346=function(_0x166096){while(--_0x166096){_0x3340ff['push'](_0x3340ff['shift']());}};_0x4f3346(++_0x299013);}(_0xe600,0x129));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x0e60('0x0'));var _=require(_0x0e60('0x1'));var moment=require(_0x0e60('0x2'));function checkNameSurname(_0xcd15d8,_0x3ad07d,_0x2d743c){var _0x1c6960='';if(!_[_0x0e60('0x3')](_0x3ad07d)&&_0x0e60('0x4')===typeof _0x3ad07d){_0x1c6960+=_0x3ad07d;}if(!_['isNil'](_0x2d743c)&&'string'===typeof _0x2d743c){_0x1c6960+='\x20'+_0x2d743c;}if(_0x1c6960!==''){return _0x1c6960;}return _0xcd15d8;}function Action(_0x2df2bc,_0xcf7765,_0x3fb834){this[_0x0e60('0x5')]=_0x2df2bc;this['uniqueid']=_0x3fb834||undefined;this[_0x0e60('0x6')]=checkNameSurname(_0xcf7765['Contact'][_0x0e60('0x7')],_0xcf7765[_0x0e60('0x8')][_0x0e60('0x9')],_0xcf7765[_0x0e60('0x8')]['lastName']);this['number']=_0xcf7765[_0x0e60('0x8')][_0x0e60('0x7')];this[_0x0e60('0xa')]=_0x2df2bc['name'];this['active']=_0xcf7765[_0x0e60('0xb')]||![];this[_0x0e60('0xc')]=_0x2df2bc['type'];this[_0x0e60('0xd')]=_0x2df2bc[_0x0e60('0xd')]||0x3;this[_0x0e60('0xe')]=_0xcf7765[_0x0e60('0xe')];this[_0x0e60('0xf')]=_0xcf7765[_0x0e60('0xf')];this[_0x0e60('0x10')]=_0xcf7765[_0x0e60('0x10')];this[_0x0e60('0x11')]=_0xcf7765[_0x0e60('0x11')];this[_0x0e60('0x12')]=_0xcf7765[_0x0e60('0x12')];this[_0x0e60('0x13')]=_0xcf7765[_0x0e60('0x13')];this[_0x0e60('0x14')]=_0xcf7765[_0x0e60('0x14')];this[_0x0e60('0x15')]=_0xcf7765[_0x0e60('0x15')];this[_0x0e60('0x16')]=_0xcf7765[_0x0e60('0x16')];this[_0x0e60('0x17')]=_0xcf7765['ContactId'];this[_0x0e60('0x18')]=_0xcf7765[_0x0e60('0x18')];this[_0x0e60('0x19')]=_0xcf7765['UserId'];this['VoiceQueueId']=_0xcf7765[_0x0e60('0x1a')];this[_0x0e60('0x1b')]=_0xcf7765[_0x0e60('0x1b')];this[_0x0e60('0x1c')]=_0xcf7765['id'];this[_0x0e60('0x1d')]=_0xcf7765['Contact'][_0x0e60('0x9')]||'';this[_0x0e60('0x1e')]=moment()[_0x0e60('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0e60('0x20')]=_0xcf7765[_0x0e60('0x20')];this[_0x0e60('0x21')]=_0xcf7765[_0x0e60('0x21')];this[_0x0e60('0x22')]=_0xcf7765['callbackat'];this['recallme']=_0xcf7765[_0x0e60('0x23')];this[_0x0e60('0x24')]='';this[_0x0e60('0x25')]='';}Action[_0x0e60('0x26')][_0x0e60('0x27')]=function(){return util['format'](_0x0e60('0x28'),this[_0x0e60('0x6')],this[_0x0e60('0x5')][_0x0e60('0x29')]>0x0?this[_0x0e60('0x2a')][_0x0e60('0x2b')](this[_0x0e60('0x5')][_0x0e60('0x29')]):this[_0x0e60('0x2a')]);};Action[_0x0e60('0x26')][_0x0e60('0x2c')]=function(){return this[_0x0e60('0xa')];};module[_0x0e60('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 51b3ef7..0d50969 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa804=['CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x20a582,_0x52d025){var _0x5cef41=function(_0x40fd09){while(--_0x40fd09){_0x20a582['push'](_0x20a582['shift']());}};_0x5cef41(++_0x52d025);}(_0xa804,0x13f));var _0x4a80=function(_0x3178d3,_0x3afbeb){_0x3178d3=_0x3178d3-0x0;var _0x1c4aa8=_0xa804[_0x3178d3];return _0x1c4aa8;};'use strict';var util=require('util');var _=require(_0x4a80('0x0'));var moment=require(_0x4a80('0x1'));function getSeconds(_0x3c03ff,_0x35ac8a){var _0x4b6b38=moment(_0x3c03ff)['milliseconds'](0x0);var _0x439e17=moment(_0x35ac8a)[_0x4a80('0x2')](0x0);return _0x4b6b38['diff'](_0x439e17,_0x4a80('0x3'));}function AgentComplete(_0x21477b,_0x447da4){this[_0x4a80('0x4')]=0x4;this['statedesc']=_0x4a80('0x5');this[_0x4a80('0x6')]=_0x21477b[_0x4a80('0x6')];this['type']=_0x21477b[_0x4a80('0x7')];this[_0x4a80('0x8')]=_0x21477b['type']===_0x4a80('0x9')?_0x4a80('0xa'):_0x21477b['type'];this[_0x4a80('0xb')]=_0x21477b['countbusyretry'];this['countcongestionretry']=_0x21477b['countcongestionretry'];this[_0x4a80('0xc')]=_0x21477b['countnoanswerretry'];this['countglobal']=_0x21477b['countbusyretry']+_0x21477b[_0x4a80('0xd')]+_0x21477b['countnoanswerretry']+_0x21477b[_0x4a80('0xe')]+_0x21477b['countdropretry']+_0x21477b['countabandonedretry']+_0x21477b[_0x4a80('0xf')]+_0x21477b[_0x4a80('0x10')];this[_0x4a80('0xe')]=_0x21477b[_0x4a80('0xe')];this[_0x4a80('0x11')]=_0x21477b['countdropretry'];this[_0x4a80('0x12')]=_0x21477b[_0x4a80('0x12')];this['countmachineretry']=_0x21477b['countmachineretry'];this['countagentrejectretry']=_0x21477b[_0x4a80('0x10')];this[_0x4a80('0x13')]=_0x447da4['uniqueid'];this[_0x4a80('0x14')]=_0x21477b[_0x4a80('0x15')];this[_0x4a80('0x16')]=_0x21477b[_0x4a80('0x17')];this[_0x4a80('0x18')]=_0x21477b[_0x4a80('0x18')];this[_0x4a80('0x19')]=_0x21477b[_0x4a80('0x19')];this['answertime']=_0x21477b[_0x4a80('0x1a')];this[_0x4a80('0x1b')]=moment()['format'](_0x4a80('0x1c'));this[_0x4a80('0x1d')]=getSeconds(_0x21477b[_0x4a80('0x19')],_0x21477b[_0x4a80('0x18')]);this[_0x4a80('0x1e')]=getSeconds(_0x21477b[_0x4a80('0x1a')],_0x21477b[_0x4a80('0x19')]);this[_0x4a80('0x1f')]=getSeconds(this[_0x4a80('0x1b')],_0x21477b['answertime']);this['queue']=_0x447da4[_0x4a80('0xa')];this[_0x4a80('0x20')]=_0x447da4[_0x4a80('0x20')];this[_0x4a80('0x21')]=_0x447da4[_0x4a80('0x21')];this[_0x4a80('0x22')]=_0x21477b['callback'];this[_0x4a80('0x23')]=_0x21477b['callbackuniqueid'];this[_0x4a80('0x24')]=_0x21477b['callbackat'];this['recallme']=_0x21477b[_0x4a80('0x25')];this['ContactId']=_0x21477b[_0x4a80('0x26')];this[_0x4a80('0x27')]=_0x21477b['ListId'];this[_0x4a80('0x28')]=_0x21477b[_0x4a80('0x28')];this['VoiceQueueId']=_0x21477b['VoiceQueueId'];this[_0x4a80('0x29')]=_0x21477b[_0x4a80('0x29')];this[_0x4a80('0x2a')]=_0x21477b[_0x4a80('0x2a')]||'';this[_0x4a80('0x2b')]=_0x21477b['originatecalleridname']||'';}module[_0x4a80('0x2c')]=AgentComplete; \ No newline at end of file +var _0xd889=['originatecalleridname','exports','util','lodash','moment','milliseconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x521864,_0xb899b2){var _0x1b72d1=function(_0x36e812){while(--_0x36e812){_0x521864['push'](_0x521864['shift']());}};_0x1b72d1(++_0xb899b2);}(_0xd889,0x92));var _0x9d88=function(_0x54f59b,_0x12836f){_0x54f59b=_0x54f59b-0x0;var _0x50941e=_0xd889[_0x54f59b];return _0x50941e;};'use strict';var util=require(_0x9d88('0x0'));var _=require(_0x9d88('0x1'));var moment=require(_0x9d88('0x2'));function getSeconds(_0x20e464,_0x210182){var _0xd72c8f=moment(_0x20e464)['milliseconds'](0x0);var _0x4d62b8=moment(_0x210182)[_0x9d88('0x3')](0x0);return _0xd72c8f['diff'](_0x4d62b8,'seconds');}function AgentComplete(_0x729708,_0x2699ca){this[_0x9d88('0x4')]=0x4;this[_0x9d88('0x5')]=_0x9d88('0x6');this[_0x9d88('0x7')]=_0x729708['scheduledat'];this['type']=_0x729708[_0x9d88('0x8')];this[_0x9d88('0x9')]=_0x729708[_0x9d88('0x8')]===_0x9d88('0xa')?'queue':_0x729708[_0x9d88('0x8')];this[_0x9d88('0xb')]=_0x729708[_0x9d88('0xb')];this[_0x9d88('0xc')]=_0x729708['countcongestionretry'];this[_0x9d88('0xd')]=_0x729708[_0x9d88('0xd')];this[_0x9d88('0xe')]=_0x729708[_0x9d88('0xb')]+_0x729708[_0x9d88('0xc')]+_0x729708[_0x9d88('0xd')]+_0x729708['countnosuchnumberretry']+_0x729708['countdropretry']+_0x729708[_0x9d88('0xf')]+_0x729708['countmachineretry']+_0x729708['countagentrejectretry'];this[_0x9d88('0x10')]=_0x729708[_0x9d88('0x10')];this[_0x9d88('0x11')]=_0x729708[_0x9d88('0x11')];this[_0x9d88('0xf')]=_0x729708[_0x9d88('0xf')];this[_0x9d88('0x12')]=_0x729708['countmachineretry'];this['countagentrejectretry']=_0x729708[_0x9d88('0x13')];this[_0x9d88('0x14')]=_0x2699ca['uniqueid'];this[_0x9d88('0x15')]=_0x729708[_0x9d88('0x16')];this[_0x9d88('0x17')]=_0x729708[_0x9d88('0x18')];this[_0x9d88('0x19')]=_0x729708['starttime'];this[_0x9d88('0x1a')]=_0x729708['responsetime'];this[_0x9d88('0x1b')]=_0x729708['answertime'];this[_0x9d88('0x1c')]=moment()[_0x9d88('0x1d')](_0x9d88('0x1e'));this[_0x9d88('0x1f')]=getSeconds(_0x729708[_0x9d88('0x1a')],_0x729708[_0x9d88('0x19')]);this[_0x9d88('0x20')]=getSeconds(_0x729708[_0x9d88('0x1b')],_0x729708[_0x9d88('0x1a')]);this[_0x9d88('0x21')]=getSeconds(this[_0x9d88('0x1c')],_0x729708[_0x9d88('0x1b')]);this['queue']=_0x2699ca[_0x9d88('0x22')];this[_0x9d88('0x23')]=_0x2699ca[_0x9d88('0x23')];this[_0x9d88('0x24')]=_0x2699ca[_0x9d88('0x24')];this[_0x9d88('0x25')]=_0x729708['callback'];this['callbackuniqueid']=_0x729708[_0x9d88('0x26')];this[_0x9d88('0x27')]=_0x729708[_0x9d88('0x27')];this[_0x9d88('0x28')]=_0x729708[_0x9d88('0x28')];this[_0x9d88('0x29')]=_0x729708['ContactId'];this[_0x9d88('0x2a')]=_0x729708[_0x9d88('0x2a')];this[_0x9d88('0x2b')]=_0x729708[_0x9d88('0x2b')];this[_0x9d88('0x2c')]=_0x729708['VoiceQueueId'];this['CampaignId']=_0x729708[_0x9d88('0x2d')];this['originatecalleridnum']=_0x729708['originatecalleridnum']||'';this[_0x9d88('0x2e')]=_0x729708[_0x9d88('0x2e')]||'';}module[_0x9d88('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 9049622..e0d46c7 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x3d1981,_0x2a9e7a){var _0x526c5d=function(_0xa58d0f){while(--_0xa58d0f){_0x3d1981['push'](_0x3d1981['shift']());}};_0x526c5d(++_0x2a9e7a);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x7721('0x0'));var _=require('lodash');var moment=require(_0x7721('0x1'));function getSeconds(_0x4170dd,_0x1de988){var _0x2a78d8=moment(_0x4170dd)[_0x7721('0x2')](0x0);var _0x4d6446=moment(_0x1de988)['milliseconds'](0x0);return _0x2a78d8[_0x7721('0x3')](_0x4d6446,_0x7721('0x4'));}function Final(_0x46415c){this[_0x7721('0x5')]=_0x46415c[_0x7721('0x5')];this[_0x7721('0x6')]=_0x46415c[_0x7721('0x6')];this[_0x7721('0x7')]=_0x46415c[_0x7721('0x7')];this[_0x7721('0x8')]=_0x46415c[_0x7721('0x7')]===_0x7721('0x9')?_0x7721('0xa'):_0x46415c[_0x7721('0x7')];this[_0x7721('0xb')]=_0x46415c['countbusyretry'];this[_0x7721('0xc')]=_0x46415c[_0x7721('0xc')];this[_0x7721('0xd')]=_0x46415c[_0x7721('0xd')];this[_0x7721('0xe')]=_0x46415c[_0x7721('0xb')]+_0x46415c[_0x7721('0xc')]+_0x46415c[_0x7721('0xd')]+_0x46415c['countnosuchnumberretry']+_0x46415c[_0x7721('0xf')]+_0x46415c[_0x7721('0x10')]+_0x46415c['countmachineretry']+_0x46415c[_0x7721('0x11')];this[_0x7721('0x12')]=_0x46415c[_0x7721('0x12')];this[_0x7721('0xf')]=_0x46415c['countdropretry'];this[_0x7721('0x10')]=_0x46415c[_0x7721('0x10')];this['countmachineretry']=_0x46415c['countmachineretry'];this['countagentrejectretry']=_0x46415c[_0x7721('0x11')];this[_0x7721('0xa')]=_0x46415c[_0x7721('0xa')];this[_0x7721('0x13')]=_0x46415c['calleridname'];this[_0x7721('0x14')]=_0x46415c['calleridnum'];this[_0x7721('0x15')]=_0x46415c['starttime'];this[_0x7721('0x16')]=_0x46415c[_0x7721('0x16')];this[_0x7721('0x17')]=_0x46415c[_0x7721('0x16')];this[_0x7721('0x18')]=_0x46415c[_0x7721('0x18')]||0x0;this[_0x7721('0x19')]=_0x46415c[_0x7721('0x19')]||0x0;this[_0x7721('0x1a')]=_0x46415c[_0x7721('0x1a')]||0x0;this['callback']=_0x46415c[_0x7721('0x1b')];this[_0x7721('0x1c')]=_0x46415c[_0x7721('0x1c')];this[_0x7721('0x1d')]=_0x46415c['callbackat'];this[_0x7721('0x1e')]=_0x46415c['recallme'];this[_0x7721('0x1f')]=_0x46415c[_0x7721('0x1f')];this[_0x7721('0x20')]=_0x46415c[_0x7721('0x20')];this[_0x7721('0x21')]=_0x46415c[_0x7721('0x21')];this[_0x7721('0x22')]=_0x46415c['VoiceQueueId'];this[_0x7721('0x23')]=_0x46415c[_0x7721('0x23')];this[_0x7721('0x24')]=_0x46415c[_0x7721('0x24')]||'';this[_0x7721('0x25')]=_0x46415c[_0x7721('0x25')]||'';}module[_0x7721('0x26')]=Final; \ No newline at end of file +var _0x7118=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime'];(function(_0xff1d1d,_0x2a3617){var _0x25bfd5=function(_0x122039){while(--_0x122039){_0xff1d1d['push'](_0xff1d1d['shift']());}};_0x25bfd5(++_0x2a3617);}(_0x7118,0x159));var _0x8711=function(_0x295819,_0xebdf22){_0x295819=_0x295819-0x0;var _0x1e5fea=_0x7118[_0x295819];return _0x1e5fea;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8711('0x0'));function getSeconds(_0xf50b2e,_0x5c64d4){var _0x1758c5=moment(_0xf50b2e)[_0x8711('0x1')](0x0);var _0x348e88=moment(_0x5c64d4)[_0x8711('0x1')](0x0);return _0x1758c5[_0x8711('0x2')](_0x348e88,_0x8711('0x3'));}function Final(_0x206b82){this['uniqueid']=_0x206b82[_0x8711('0x4')];this[_0x8711('0x5')]=_0x206b82[_0x8711('0x5')];this[_0x8711('0x6')]=_0x206b82[_0x8711('0x6')];this[_0x8711('0x7')]=_0x206b82[_0x8711('0x6')]===_0x8711('0x8')?_0x8711('0x9'):_0x206b82[_0x8711('0x6')];this[_0x8711('0xa')]=_0x206b82['countbusyretry'];this['countcongestionretry']=_0x206b82[_0x8711('0xb')];this[_0x8711('0xc')]=_0x206b82[_0x8711('0xc')];this['countglobal']=_0x206b82['countbusyretry']+_0x206b82[_0x8711('0xb')]+_0x206b82[_0x8711('0xc')]+_0x206b82['countnosuchnumberretry']+_0x206b82['countdropretry']+_0x206b82[_0x8711('0xd')]+_0x206b82[_0x8711('0xe')]+_0x206b82[_0x8711('0xf')];this[_0x8711('0x10')]=_0x206b82[_0x8711('0x10')];this[_0x8711('0x11')]=_0x206b82[_0x8711('0x11')];this['countabandonedretry']=_0x206b82[_0x8711('0xd')];this[_0x8711('0xe')]=_0x206b82[_0x8711('0xe')];this[_0x8711('0xf')]=_0x206b82[_0x8711('0xf')];this[_0x8711('0x9')]=_0x206b82['queue'];this[_0x8711('0x12')]=_0x206b82[_0x8711('0x12')];this[_0x8711('0x13')]=_0x206b82[_0x8711('0x13')];this[_0x8711('0x14')]=_0x206b82['starttime'];this['responsetime']=_0x206b82['responsetime'];this[_0x8711('0x15')]=_0x206b82[_0x8711('0x16')];this[_0x8711('0x17')]=_0x206b82['ringtime']||0x0;this['holdtime']=_0x206b82[_0x8711('0x18')]||0x0;this[_0x8711('0x19')]=_0x206b82[_0x8711('0x19')]||0x0;this[_0x8711('0x1a')]=_0x206b82[_0x8711('0x1a')];this[_0x8711('0x1b')]=_0x206b82[_0x8711('0x1b')];this[_0x8711('0x1c')]=_0x206b82[_0x8711('0x1c')];this[_0x8711('0x1d')]=_0x206b82['recallme'];this[_0x8711('0x1e')]=_0x206b82[_0x8711('0x1e')];this[_0x8711('0x1f')]=_0x206b82[_0x8711('0x1f')];this['UserId']=_0x206b82[_0x8711('0x20')];this[_0x8711('0x21')]=_0x206b82[_0x8711('0x21')];this['CampaignId']=_0x206b82[_0x8711('0x22')];this[_0x8711('0x23')]=_0x206b82[_0x8711('0x23')]||'';this[_0x8711('0x24')]=_0x206b82[_0x8711('0x24')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 27578b2..7001ca8 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68c1=['countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x68c1,0x7f));var _0x168c=function(_0x4965d1,_0xb546d4){_0x4965d1=_0x4965d1-0x0;var _0x59e849=_0x68c1[_0x4965d1];return _0x59e849;};'use strict';var util=require(_0x168c('0x0'));var _=require(_0x168c('0x1'));var moment=require(_0x168c('0x2'));function getSeconds(_0x466cf2,_0x16d27c){var _0x3aa1f8=moment(_0x466cf2)['milliseconds'](0x0);var _0x4f200b=moment(_0x16d27c)[_0x168c('0x3')](0x0);return _0x3aa1f8[_0x168c('0x4')](_0x4f200b,_0x168c('0x5'));}function Hangup(_0x4688d8,_0x3c3cb2){this[_0x168c('0x6')]=0x4;this[_0x168c('0x7')]=_0x168c('0x8');this[_0x168c('0x9')]=_0x4688d8['scheduledat'];this[_0x168c('0xa')]=_0x4688d8[_0x168c('0xa')];this[_0x168c('0xb')]=_0x4688d8['type']===_0x168c('0xc')?_0x168c('0xd'):_0x4688d8[_0x168c('0xa')];this[_0x168c('0xe')]=_0x4688d8[_0x168c('0xe')];this[_0x168c('0xf')]=_0x4688d8[_0x168c('0xf')];this['countnoanswerretry']=_0x4688d8[_0x168c('0x10')];this['countglobal']=_0x4688d8[_0x168c('0xe')]+_0x4688d8['countcongestionretry']+_0x4688d8[_0x168c('0x10')]+_0x4688d8[_0x168c('0x11')]+_0x4688d8['countdropretry']+_0x4688d8[_0x168c('0x12')]+_0x4688d8[_0x168c('0x13')]+_0x4688d8[_0x168c('0x14')];this['countnosuchnumberretry']=_0x4688d8[_0x168c('0x11')];this[_0x168c('0x15')]=_0x4688d8['countdropretry'];this['countabandonedretry']=_0x4688d8[_0x168c('0x12')];this[_0x168c('0x13')]=_0x4688d8[_0x168c('0x13')];this['countagentrejectretry']=_0x4688d8[_0x168c('0x14')];this[_0x168c('0x16')]=_0x3c3cb2['uniqueid'];this['calleridname']=_0x4688d8[_0x168c('0x17')];this[_0x168c('0x18')]=_0x4688d8[_0x168c('0x19')];this['starttime']=_0x4688d8[_0x168c('0x1a')];this[_0x168c('0x1b')]=_0x4688d8[_0x168c('0x1b')];this[_0x168c('0x1c')]=moment()[_0x168c('0x1d')](_0x168c('0x1e'));this[_0x168c('0x1f')]=getSeconds(_0x4688d8[_0x168c('0x1b')],_0x4688d8['starttime']);this[_0x168c('0x20')]=0x0;this[_0x168c('0x21')]=getSeconds(this[_0x168c('0x1c')],_0x4688d8['responsetime']);this[_0x168c('0xd')]=_0x4688d8[_0x168c('0xd')];this[_0x168c('0x22')]=_0x168c('0x23');this[_0x168c('0x24')]=_0x3c3cb2[_0x168c('0x25')];this['callback']=_0x4688d8[_0x168c('0x26')];this[_0x168c('0x27')]=_0x4688d8[_0x168c('0x27')];this[_0x168c('0x28')]=_0x4688d8[_0x168c('0x28')];this[_0x168c('0x29')]=_0x4688d8[_0x168c('0x29')];this['ContactId']=_0x4688d8[_0x168c('0x2a')];this['ListId']=_0x4688d8[_0x168c('0x2b')];this[_0x168c('0x2c')]=_0x4688d8[_0x168c('0x2c')];this[_0x168c('0x2d')]=_0x4688d8['VoiceQueueId'];this[_0x168c('0x2e')]=_0x4688d8[_0x168c('0x2e')];}module[_0x168c('0x2f')]=Hangup; \ No newline at end of file +var _0xefbf=['starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number'];(function(_0xe743cc,_0x4b183a){var _0x1b7df1=function(_0x28c2ca){while(--_0x28c2ca){_0xe743cc['push'](_0xe743cc['shift']());}};_0x1b7df1(++_0x4b183a);}(_0xefbf,0x174));var _0xfefb=function(_0x2165f0,_0x211476){_0x2165f0=_0x2165f0-0x0;var _0x56502c=_0xefbf[_0x2165f0];return _0x56502c;};'use strict';var util=require('util');var _=require(_0xfefb('0x0'));var moment=require(_0xfefb('0x1'));function getSeconds(_0x230cbb,_0x3a115f){var _0x4be0e9=moment(_0x230cbb)['milliseconds'](0x0);var _0x476fff=moment(_0x3a115f)[_0xfefb('0x2')](0x0);return _0x4be0e9['diff'](_0x476fff,_0xfefb('0x3'));}function Hangup(_0x26f9ea,_0x315029){this[_0xfefb('0x4')]=0x4;this[_0xfefb('0x5')]='Answer';this[_0xfefb('0x6')]=_0x26f9ea[_0xfefb('0x6')];this['type']=_0x26f9ea[_0xfefb('0x7')];this[_0xfefb('0x8')]=_0x26f9ea['type']===_0xfefb('0x9')?_0xfefb('0xa'):_0x26f9ea[_0xfefb('0x7')];this[_0xfefb('0xb')]=_0x26f9ea['countbusyretry'];this[_0xfefb('0xc')]=_0x26f9ea['countcongestionretry'];this['countnoanswerretry']=_0x26f9ea['countnoanswerretry'];this[_0xfefb('0xd')]=_0x26f9ea[_0xfefb('0xb')]+_0x26f9ea[_0xfefb('0xc')]+_0x26f9ea[_0xfefb('0xe')]+_0x26f9ea[_0xfefb('0xf')]+_0x26f9ea[_0xfefb('0x10')]+_0x26f9ea[_0xfefb('0x11')]+_0x26f9ea[_0xfefb('0x12')]+_0x26f9ea[_0xfefb('0x13')];this[_0xfefb('0xf')]=_0x26f9ea['countnosuchnumberretry'];this[_0xfefb('0x10')]=_0x26f9ea[_0xfefb('0x10')];this[_0xfefb('0x11')]=_0x26f9ea[_0xfefb('0x11')];this[_0xfefb('0x12')]=_0x26f9ea[_0xfefb('0x12')];this['countagentrejectretry']=_0x26f9ea['countagentrejectretry'];this[_0xfefb('0x14')]=_0x315029['uniqueid'];this[_0xfefb('0x15')]=_0x26f9ea['name'];this[_0xfefb('0x16')]=_0x26f9ea[_0xfefb('0x17')];this['starttime']=_0x26f9ea[_0xfefb('0x18')];this[_0xfefb('0x19')]=_0x26f9ea[_0xfefb('0x19')];this[_0xfefb('0x1a')]=moment()['format'](_0xfefb('0x1b'));this[_0xfefb('0x1c')]=getSeconds(_0x26f9ea[_0xfefb('0x19')],_0x26f9ea[_0xfefb('0x18')]);this[_0xfefb('0x1d')]=0x0;this[_0xfefb('0x1e')]=getSeconds(this[_0xfefb('0x1a')],_0x26f9ea[_0xfefb('0x19')]);this['queue']=_0x26f9ea[_0xfefb('0xa')];this[_0xfefb('0x1f')]=_0xfefb('0x20');this['reason']=_0x315029[_0xfefb('0x21')];this['callback']=_0x26f9ea[_0xfefb('0x22')];this[_0xfefb('0x23')]=_0x26f9ea['callbackuniqueid'];this[_0xfefb('0x24')]=_0x26f9ea['callbackat'];this[_0xfefb('0x25')]=_0x26f9ea['recallme'];this[_0xfefb('0x26')]=_0x26f9ea['ContactId'];this[_0xfefb('0x27')]=_0x26f9ea[_0xfefb('0x27')];this[_0xfefb('0x28')]=_0x26f9ea[_0xfefb('0x28')];this[_0xfefb('0x29')]=_0x26f9ea[_0xfefb('0x29')];this[_0xfefb('0x2a')]=_0x26f9ea['CampaignId'];}module[_0xfefb('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index cefe002..9bcb0ae 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb2a=['countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5d1278,_0x2227da){var _0x2ffc06=function(_0x4e8a9e){while(--_0x4e8a9e){_0x5d1278['push'](_0x5d1278['shift']());}};_0x2ffc06(++_0x2227da);}(_0xbb2a,0xb9));var _0xabb2=function(_0x1ec811,_0x250275){_0x1ec811=_0x1ec811-0x0;var _0x1f5d86=_0xbb2a[_0x1ec811];return _0x1f5d86;};'use strict';var util=require(_0xabb2('0x0'));var _=require(_0xabb2('0x1'));var moment=require(_0xabb2('0x2'));function getSeconds(_0xd96fa,_0x21531f){var _0x5cb0a6=moment(_0xd96fa)[_0xabb2('0x3')](0x0);var _0x4ce026=moment(_0x21531f)[_0xabb2('0x3')](0x0);return _0x5cb0a6[_0xabb2('0x4')](_0x4ce026,_0xabb2('0x5'));}function History(_0x146e27){this['uniqueid']=_0x146e27[_0xabb2('0x6')];this['scheduledat']=_0x146e27[_0xabb2('0x7')]||undefined;this[_0xabb2('0x8')]=_0x146e27[_0xabb2('0x8')];this[_0xabb2('0x9')]=_0x146e27[_0xabb2('0x8')]===_0xabb2('0xa')?_0xabb2('0xb'):_0x146e27[_0xabb2('0x8')];this[_0xabb2('0xc')]=_0x146e27['countbusyretry'];this[_0xabb2('0xd')]=_0x146e27[_0xabb2('0xd')];this[_0xabb2('0xe')]=_0x146e27[_0xabb2('0xe')];this['countglobal']=_0x146e27[_0xabb2('0xc')]+_0x146e27[_0xabb2('0xd')]+_0x146e27['countnoanswerretry']+_0x146e27[_0xabb2('0xf')]+_0x146e27['countdropretry']+_0x146e27[_0xabb2('0x10')]+_0x146e27[_0xabb2('0x11')]+_0x146e27['countagentrejectretry'];this['countnosuchnumberretry']=_0x146e27[_0xabb2('0xf')];this[_0xabb2('0x12')]=_0x146e27[_0xabb2('0x12')];this[_0xabb2('0x10')]=_0x146e27[_0xabb2('0x10')];this[_0xabb2('0x11')]=_0x146e27['countmachineretry'];this[_0xabb2('0x13')]=_0x146e27[_0xabb2('0x13')];this['queue']=_0x146e27['queue'];this[_0xabb2('0x14')]=_0x146e27['name'];this[_0xabb2('0x15')]=_0x146e27[_0xabb2('0x16')];this['starttime']=_0x146e27[_0xabb2('0x17')];this[_0xabb2('0x18')]=_0x146e27[_0xabb2('0x18')];this['endtime']=_0x146e27[_0xabb2('0x18')];this[_0xabb2('0x19')]=getSeconds(_0x146e27['responsetime'],_0x146e27[_0xabb2('0x17')]);this[_0xabb2('0x1a')]=0x0;this[_0xabb2('0x1b')]=0x0;this[_0xabb2('0x1c')]=_0x146e27[_0xabb2('0x1c')];this[_0xabb2('0x1d')]=_0x146e27[_0xabb2('0x1d')];this['callbackat']=_0x146e27[_0xabb2('0x1e')];this[_0xabb2('0x1f')]=_0x146e27['recallme'];this['ContactId']=_0x146e27[_0xabb2('0x20')];this[_0xabb2('0x21')]=_0x146e27[_0xabb2('0x21')];this[_0xabb2('0x22')]=_0x146e27['UserId'];this[_0xabb2('0x23')]=_0x146e27[_0xabb2('0x23')];this[_0xabb2('0x24')]=_0x146e27[_0xabb2('0x24')];this[_0xabb2('0x25')]=_0x146e27[_0xabb2('0x25')]||'';this[_0xabb2('0x26')]=_0x146e27[_0xabb2('0x26')]||'';}module[_0xabb2('0x27')]=History; \ No newline at end of file +var _0x12dd=['countdropretry','countabandonedretry','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry'];(function(_0x2ac84e,_0x3d8931){var _0x481a04=function(_0x367b52){while(--_0x367b52){_0x2ac84e['push'](_0x2ac84e['shift']());}};_0x481a04(++_0x3d8931);}(_0x12dd,0xd8));var _0xd12d=function(_0x23402b,_0x421ac9){_0x23402b=_0x23402b-0x0;var _0x3a21c7=_0x12dd[_0x23402b];return _0x3a21c7;};'use strict';var util=require(_0xd12d('0x0'));var _=require(_0xd12d('0x1'));var moment=require(_0xd12d('0x2'));function getSeconds(_0x5cd826,_0x326ac6){var _0x4d9353=moment(_0x5cd826)['milliseconds'](0x0);var _0x561e86=moment(_0x326ac6)[_0xd12d('0x3')](0x0);return _0x4d9353[_0xd12d('0x4')](_0x561e86,'seconds');}function History(_0x29d029){this[_0xd12d('0x5')]=_0x29d029[_0xd12d('0x5')];this[_0xd12d('0x6')]=_0x29d029['scheduledat']||undefined;this[_0xd12d('0x7')]=_0x29d029[_0xd12d('0x7')];this[_0xd12d('0x8')]=_0x29d029[_0xd12d('0x7')]===_0xd12d('0x9')?_0xd12d('0xa'):_0x29d029[_0xd12d('0x7')];this['countbusyretry']=_0x29d029[_0xd12d('0xb')];this['countcongestionretry']=_0x29d029[_0xd12d('0xc')];this['countnoanswerretry']=_0x29d029[_0xd12d('0xd')];this[_0xd12d('0xe')]=_0x29d029[_0xd12d('0xb')]+_0x29d029['countcongestionretry']+_0x29d029[_0xd12d('0xd')]+_0x29d029[_0xd12d('0xf')]+_0x29d029['countdropretry']+_0x29d029['countabandonedretry']+_0x29d029[_0xd12d('0x10')]+_0x29d029[_0xd12d('0x11')];this[_0xd12d('0xf')]=_0x29d029[_0xd12d('0xf')];this['countdropretry']=_0x29d029[_0xd12d('0x12')];this[_0xd12d('0x13')]=_0x29d029[_0xd12d('0x13')];this['countmachineretry']=_0x29d029['countmachineretry'];this['countagentrejectretry']=_0x29d029[_0xd12d('0x11')];this['queue']=_0x29d029[_0xd12d('0xa')];this['calleridname']=_0x29d029[_0xd12d('0x14')];this[_0xd12d('0x15')]=_0x29d029[_0xd12d('0x16')];this[_0xd12d('0x17')]=_0x29d029['starttime'];this[_0xd12d('0x18')]=_0x29d029['responsetime'];this['endtime']=_0x29d029[_0xd12d('0x18')];this[_0xd12d('0x19')]=getSeconds(_0x29d029[_0xd12d('0x18')],_0x29d029[_0xd12d('0x17')]);this[_0xd12d('0x1a')]=0x0;this[_0xd12d('0x1b')]=0x0;this[_0xd12d('0x1c')]=_0x29d029[_0xd12d('0x1c')];this[_0xd12d('0x1d')]=_0x29d029[_0xd12d('0x1d')];this[_0xd12d('0x1e')]=_0x29d029['callbackat'];this['recallme']=_0x29d029['recallme'];this[_0xd12d('0x1f')]=_0x29d029[_0xd12d('0x1f')];this[_0xd12d('0x20')]=_0x29d029[_0xd12d('0x20')];this[_0xd12d('0x21')]=_0x29d029[_0xd12d('0x21')];this[_0xd12d('0x22')]=_0x29d029[_0xd12d('0x22')];this[_0xd12d('0x23')]=_0x29d029[_0xd12d('0x23')];this[_0xd12d('0x24')]=_0x29d029[_0xd12d('0x24')]||'';this[_0xd12d('0x25')]=_0x29d029[_0xd12d('0x25')]||'';}module[_0xd12d('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 16e75c8..1e8743d 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 _0xbe64=['erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','pick','UserId','VoiceQueueId','CampaignId','isSuccess','Success','trunks','SIP/%s','reachable','syncVarSet','isNil','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countnoanswerretry','stateGlobal','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','stateinterface','push','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','interval','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','pow','replace','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','scheduledat','dialRecallMeTimeout','outboundReCallsDay','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','ACTIVE','RUNNING','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[countReScheduled]\x20','emptyContact','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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','util','lodash','bluebird','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xbe64,0x1a3));var _0x4be6=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0xbe64[_0x2786ea];return _0x5c38e5;};'use strict';var util=require(_0x4be6('0x0'));var _=require(_0x4be6('0x1'));var BPromise=require(_0x4be6('0x2'));var uuid=require('uuid');var moment=require(_0x4be6('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x4be6('0x4'));var config=require(_0x4be6('0x5'));var logger=require(_0x4be6('0x6'))(_0x4be6('0x7'));var loggerBooked=require(_0x4be6('0x6'))(_0x4be6('0x8'));var loggerPredictive=require('../../../config/logger')(_0x4be6('0x9'));var loggerPredictiveCalls=require(_0x4be6('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x4be6('0xa'));var ami=require(_0x4be6('0xb'));config[_0x4be6('0xc')]=_[_0x4be6('0xd')](config[_0x4be6('0xc')],{'host':_0x4be6('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4be6('0xc')]));var cmHopper=require(_0x4be6('0xf'));var cmHopperHistory=require(_0x4be6('0x10'));var cmHopperBlack=require(_0x4be6('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x4be6('0x12'));var Action=require('./action');var History=require('./history');var Final=require(_0x4be6('0x13'));var AgentComplete=require(_0x4be6('0x14'));var QueueCallerAbandon=require(_0x4be6('0x15'));var Hangup=require(_0x4be6('0x16'));var ipAgi=process[_0x4be6('0x17')][_0x4be6('0x18')]||_0x4be6('0x19');var strategy={'rrmemory':_0x4be6('0x1a'),'roundrobin':_0x4be6('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4be6('0x1c')][_0x4be6('0x1d')]=function(_0x5632c7){this[_0x4be6('0x1e')]=this['tail']?this[_0x4be6('0x1e')][_0x4be6('0x1f')](_0x5632c7):_0x5632c7();};function Dialer(_0x1aefa,_0x11e0c5){this['sequence']=new Sequence();this[_0x4be6('0x20')]=_0x11e0c5;this[_0x4be6('0x21')]=_0x1aefa[_0x4be6('0x21')];this[_0x4be6('0x22')]=_0x1aefa[_0x4be6('0x22')];this[_0x4be6('0x23')]=_0x1aefa[_0x4be6('0x23')];this['trunks']=_0x1aefa['trunks'];this[_0x4be6('0x24')]=config[_0x4be6('0x24')]||0x2;this['channels']={};this[_0x4be6('0x25')]={};this[_0x4be6('0x26')]={};this['uniqueId']={};this[_0x4be6('0x27')]={};this[_0x4be6('0x28')]={};this[_0x4be6('0x29')]={};this[_0x4be6('0x2a')]={};this[_0x4be6('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x4be6('0x2c'),this[_0x4be6('0x2d')][_0x4be6('0x2e')](this));ami['on']('queuecallerabandon',this[_0x4be6('0x2f')][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x30'),this[_0x4be6('0x31')][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x32'),this[_0x4be6('0x33')][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x34'),this['syncQueueSummary'][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x35'),this[_0x4be6('0x36')]['bind'](this));ami['on'](_0x4be6('0x37'),this[_0x4be6('0x38')][_0x4be6('0x2e')](this));ami['on']('varset',this['syncVarSet'][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x39'),this['syncQueueMember'][_0x4be6('0x2e')](this));ami['on'](_0x4be6('0x3a'),this[_0x4be6('0x3b')]['bind'](this));this[_0x4be6('0x3c')]();this['loopClearZombieChannels']();RpcSetting[_0x4be6('0x3d')]()[_0x4be6('0x3e')](function(_0x2fde7a){previewRecallmeReminderInterval=_0x2fde7a[_0x4be6('0x3f')];});}function isNotNull(_0x188afe){return _0x188afe!==null&&!_[_0x4be6('0x40')](_0x188afe);}function checkIsLoggedIn(_0x6e1823,_0x14e5b9){return function(){if(_0x14e5b9<=0x0){_0x6e1823[_0x4be6('0x41')]=_0x4be6('0x42');throw _0x6e1823[_0x4be6('0x43')]+_0x4be6('0x44');}};}function isActive(_0x2b17f5){return _0x2b17f5;}function checkIsActive(_0x4bc2a9,_0x2847c5){return function(){if(!isActive(_0x2847c5)){_0x4bc2a9[_0x4be6('0x41')]=_0x4be6('0x45');throw _0x4bc2a9[_0x4be6('0x43')]+_0x4be6('0x46');}};}function checkInterval(_0x3add45){return function(){if(!isNotNull(_0x3add45['Interval'])){_0x3add45[_0x4be6('0x41')]=_0x4be6('0x47');throw _0x3add45[_0x4be6('0x43')]+_0x4be6('0x48');}if(!isNotNull(_0x3add45[_0x4be6('0x49')][_0x4be6('0x4a')])){_0x3add45[_0x4be6('0x41')]=_0x4be6('0x47');throw _0x3add45[_0x4be6('0x43')]+_0x4be6('0x48');}if(!isNotNull(_[_0x4be6('0x4b')](_0x3add45[_0x4be6('0x49')][_0x4be6('0x4a')]))){_0x3add45[_0x4be6('0x41')]=_0x4be6('0x47');throw _0x3add45['name']+_0x4be6('0x48');}};}function msgResponse(_0x3cfff1,_0x4392d8,_0x15e280){return{'action':_0x3cfff1,'response':_0x4392d8,'message':_0x15e280,'stack':_0x15e280};}function myreject(_0x26ce34){return function(_0x1bfdb3){return _0x26ce34(msgResponse(_0x4be6('0x4c'),_0x4be6('0x4d'),JSON[_0x4be6('0x4e')](_0x1bfdb3)));};}function getSeconds(_0x27b235,_0x4da451){var _0x5641c5=moment(_0x27b235)['milliseconds'](0x0);var _0x568048=moment(_0x4da451)[_0x4be6('0x4f')](0x0);return _0x5641c5[_0x4be6('0x50')](_0x568048,_0x4be6('0x51'));}function emit(_0x4c1455,_0x566f9b,_0x321b69){io['to'](_0x4c1455)[_0x4be6('0x52')](_0x566f9b,_0x321b69);}function emitVoiceQueueSummary(_0x488c2c){if(_0x488c2c[_0x4be6('0x53')]===_0x4be6('0x54')){var _0x5b4d7a={'id':_0x488c2c['id'],'name':_0x488c2c[_0x4be6('0x43')],'strategy':_0x488c2c[_0x4be6('0x55')],'answered':_0x488c2c['answered'],'available':_0x488c2c[_0x4be6('0x56')],'loggedIn':_0x488c2c[_0x4be6('0x57')],'pTalking':_0x488c2c[_0x4be6('0x58')],'sumBillable':_0x488c2c[_0x4be6('0x59')],'sumDuration':_0x488c2c[_0x4be6('0x5a')],'sumHoldTime':_0x488c2c[_0x4be6('0x5b')]||0x0,'talking':_0x488c2c[_0x4be6('0x5c')],'total':_0x488c2c[_0x4be6('0x5d')],'type':_0x488c2c['type'],'unmanaged':_0x488c2c[_0x4be6('0x5e')],'abandoned':_0x488c2c['abandoned'],'waiting':_0x488c2c[_0x4be6('0x5f')],'loggedInDb':_0x488c2c[_0x4be6('0x60')],'dialActive':_0x488c2c[_0x4be6('0x61')],'dialMethod':_0x488c2c[_0x4be6('0x62')],'dialOriginateCallerIdName':_0x488c2c[_0x4be6('0x63')],'dialOriginateCallerIdNumber':_0x488c2c[_0x4be6('0x64')],'dialOriginateTimeout':_0x488c2c[_0x4be6('0x65')],'dialPrefix':_0x488c2c[_0x4be6('0x66')],'outboundAnswerAgiCallsDay':_0x488c2c['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x488c2c[_0x4be6('0x67')],'outboundBlacklistCallsDay':_0x488c2c[_0x4be6('0x68')],'outboundBusyCallsDay':_0x488c2c['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x488c2c[_0x4be6('0x69')],'outboundDropCallsDayACS':_0x488c2c['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x488c2c[_0x4be6('0x6a')],'outboundDropCallsDayTimeout':_0x488c2c[_0x4be6('0x6b')],'outboundNoAnswerCallsDay':_0x488c2c[_0x4be6('0x6c')],'outboundNoSuchCallsDay':_0x488c2c[_0x4be6('0x6d')],'outboundOriginateFailureCallsDay':_0x488c2c['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x488c2c['outboundReCallsDay'],'outboundRejectCallsDay':_0x488c2c['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x488c2c['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x488c2c[_0x4be6('0x6e')],'predictiveIntervalAvgHoldtime':_0x488c2c[_0x4be6('0x6f')],'predictiveIntervalAvgTalktime':_0x488c2c[_0x4be6('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x488c2c[_0x4be6('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x488c2c[_0x4be6('0x72')],'predictiveIntervalErlangCalls':_0x488c2c[_0x4be6('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x488c2c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x488c2c[_0x4be6('0x74')],'predictiveIntervalMultiplicativeFactor':_0x488c2c[_0x4be6('0x75')],'predictiveIntervalPauses':_0x488c2c[_0x4be6('0x76')],'predictiveIntervalAvailable':_0x488c2c[_0x4be6('0x77')],'predictiveIntervalTotalCalls':_0x488c2c['predictiveIntervalTotalCalls'],'message':_0x488c2c[_0x4be6('0x41')],'originated':_0x488c2c[_0x4be6('0x78')],'erlangCalls':_0x488c2c['erlangCalls'],'erlangCallToSecond':_0x488c2c[_0x4be6('0x79')],'erlangAbandonmentRate':_0x488c2c[_0x4be6('0x7a')],'erlangBusyFactor':_0x488c2c[_0x4be6('0x7b')],'startPredictive':_0x488c2c[_0x4be6('0x28')],'startProgressive':_0x488c2c[_0x4be6('0x29')]};if(_0x488c2c[_0x4be6('0x7c')]){_0x5b4d7a['Trunk']={'id':_0x488c2c[_0x4be6('0x7c')]['id'],'name':_0x488c2c['Trunk'][_0x4be6('0x43')],'active':_0x488c2c[_0x4be6('0x7c')][_0x4be6('0x7d')],'callerid':_0x488c2c[_0x4be6('0x7c')][_0x4be6('0x7e')]};}if(_0x488c2c[_0x4be6('0x49')]){_0x5b4d7a[_0x4be6('0x49')]={'id':_0x488c2c[_0x4be6('0x49')]['id'],'name':_0x488c2c[_0x4be6('0x49')][_0x4be6('0x43')]};}var _0x3aac19=md5(JSON[_0x4be6('0x4e')](_0x5b4d7a));if(_0x488c2c['md5']!==_0x3aac19){_0x488c2c[_0x4be6('0x7f')]=_0x3aac19;emit(util[_0x4be6('0x80')]('voice:queue:%s',_0x5b4d7a[_0x4be6('0x43')]),_0x4be6('0x81'),_0x5b4d7a);}}}function emitCampaignSummary(_0x46ec21){if(_0x46ec21[_0x4be6('0x53')]===_0x4be6('0x82')){emit(util[_0x4be6('0x80')](_0x4be6('0x83'),_0x46ec21['name']),_0x4be6('0x84'),_0x46ec21);}}function checkGetDataPredictive(_0x25f531){if(isNotNull(_0x25f531)&&!_[_0x4be6('0x4b')](_0x25f531)){loggerPredictive[_0x4be6('0x85')](_0x4be6('0x86'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25f531[_0x4be6('0x87')]);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x88'),_0x25f531[_0x4be6('0x6e')]);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x89'),_0x25f531[_0x4be6('0x72')]);loggerPredictive[_0x4be6('0x85')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25f531['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x8a'),_0x25f531['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x8b'),_0x25f531[_0x4be6('0x70')]);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x8c'));if(_0x25f531[_0x4be6('0x87')]>0x0){if(!_[_0x4be6('0x40')](_0x25f531['predictiveIntervalAvgTalktime'])&&_0x25f531[_0x4be6('0x70')]>0x0){return!![];}loggerPredictive['info'](_0x4be6('0x8d'));if(!_[_0x4be6('0x40')](_0x25f531['predictiveIntervalAvgHoldtime'])&&_0x25f531[_0x4be6('0x6f')]>0x0){return!![];}loggerPredictive['info'](_0x4be6('0x8e'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x4be6('0x85')](_0x4be6('0x8f'));}return![];}function mergeDataErlangB(_0x10f7f4){return function(_0x392515){loggerPredictive[_0x4be6('0x85')](_0x4be6('0x90'));loggerPredictive['info'](_0x4be6('0x91'),_0x392515[_0x4be6('0x92')]);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x93'),_0x392515[_0x4be6('0x79')]);loggerPredictive[_0x4be6('0x85')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x392515[_0x4be6('0x7a')]);loggerPredictive['info'](_0x4be6('0x94'),_0x392515[_0x4be6('0x7b')]);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x95'),_0x392515[_0x4be6('0x7a')]);loggerPredictive['info'](_0x4be6('0x8c'));_[_0x4be6('0x96')](_0x10f7f4,_0x392515);};}function getDiff(_0xb8a1e3){var _0x122209=moment()[_0x4be6('0x4f')](0x0);var _0x296565=moment(_0xb8a1e3)['milliseconds'](0x0);return _0x122209[_0x4be6('0x50')](_0x296565,_0x4be6('0x51'));}function ifInterval(_0x20a8f3,_0x19df1a){if(_[_0x4be6('0x40')](_0x19df1a)){return![];}return getDiff(_0x19df1a)<_0x20a8f3*0x3c;}function freeVariablesPredictive(_0x10eade){if(isNotNull(_0x10eade)){if(!_[_0x4be6('0x40')](_0x10eade[_0x4be6('0x29')])){_0x10eade['startProgressive']=undefined;loggerPredictive[_0x4be6('0x85')](_0x10eade[_0x4be6('0x43')],_0x4be6('0x97'));}if(!_[_0x4be6('0x40')](_0x10eade[_0x4be6('0x28')])){_0x10eade[_0x4be6('0x28')]=undefined;loggerPredictive[_0x4be6('0x85')](_0x10eade['name'],_0x4be6('0x98'));}if(!_[_0x4be6('0x40')](_0x10eade[_0x4be6('0x99')])){clearInterval(_0x10eade[_0x4be6('0x99')]);_0x10eade['handlePredictive']=undefined;loggerPredictive['info'](_0x10eade[_0x4be6('0x43')],_0x4be6('0x9a'));}}}function erlangb(_0xb54d8e,_0x7f78e){if(_0x7f78e===0x0){return 0x0;}var _0x419b24=0x1;for(var _0x5b1bf5=0x1;_0x5b1bf5<=_0x7f78e;_0x5b1bf5+=0x1){_0x419b24=0x1+_0x419b24*_0x5b1bf5/_0xb54d8e;}return 0x1/_0x419b24;}function isVoiceQueueOutbound(_0x262525){return _0x262525==='outbound';}function isNotPreview(_0x5102da){return _0x5102da!==_0x4be6('0x20');}function isCampaignIvr(_0x5de69c){return _0x5de69c===_0x4be6('0x82');}function getCallerId(_0x3b948f,_0x279a09,_0x3f7f6c){if(!_[_0x4be6('0x40')](_0x3f7f6c)&&typeof _0x3f7f6c==='string'&&!_['isEmpty'](_0x3f7f6c)){if(!_['isUndefined'](_0x279a09)&&typeof _0x279a09===_0x4be6('0x9b')&&!_['isEmpty'](_0x279a09)){return util[_0x4be6('0x80')](_0x4be6('0x9c'),_0x279a09,_0x3f7f6c);}return util[_0x4be6('0x80')](_0x4be6('0x9c'),_0x3f7f6c,_0x3f7f6c);}if(!_[_0x4be6('0x40')](_0x3b948f)&&typeof _0x3b948f==='string'&&!_[_0x4be6('0x4b')](_0x3b948f)){return _0x3b948f;}return _0x4be6('0x9d');}function loggerCatchQueueSummary(_0x1ae991,_0x4f914f){return function(_0x4425e2){freeVariablesPredictive(_0x4f914f);emitVoiceQueueSummary(_0x4f914f);emitCampaignSummary(_0x4f914f);loggerSyncQueueSummary[_0x4be6('0x9e')](_0x1ae991,util[_0x4be6('0x9f')](_0x4425e2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5e10c2,_0x569f5d){return function(_0x21ef7f){loggerPredictive[_0x4be6('0x9e')](_0x569f5d[_0x4be6('0x43')],_0x5e10c2);loggerPredictive[_0x4be6('0x9e')](_0x21ef7f[_0x4be6('0xa0')]);freeVariablesPredictive(_0x569f5d);};}function loggerCatch(_0x52562c){return function(_0x69e8c6){logger['error'](_0x52562c,util[_0x4be6('0x9f')](_0x69e8c6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3e3f6a){return _0x3e3f6a&&!_['isUndefined'](_0x3e3f6a)&&_0x3e3f6a[_0x4be6('0xa1')]>0x0;}function decremetOriginate(_0x481cd5){if(!_[_0x4be6('0x40')](_0x481cd5)&&_0x481cd5!==null){if(typeof _0x481cd5[_0x4be6('0x78')]!==_0x4be6('0xa2')){if(_0x481cd5[_0x4be6('0x78')]>0x0){_0x481cd5[_0x4be6('0x78')]-=0x1;}else{logger[_0x4be6('0x9e')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4be6('0x9e')](_0x4be6('0xa3'));}}function checkContactLowerLimitOriginate(_0x510b62,_0x3e5924,_0x2f3ca6){if(_0x3e5924>_0x2f3ca6){for(var _0x31b742=0x0;_0x31b742<_0x3e5924-_0x2f3ca6;_0x31b742+=0x1){decremetOriginate(_0x510b62);}}}function loggerGetContactDialer(_0x451205,_0x7e6afc,_0x1d0b5e){return function(_0x368e65){checkContactLowerLimitOriginate(_0x7e6afc,_0x1d0b5e,0x0);logger[_0x4be6('0x9e')](_0x451205,util[_0x4be6('0x9f')](_0x368e65,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x46b92f){return function(_0x27f35b){if(isNotNull(_0x27f35b)&&isNotNull(_0x27f35b[0x0])){if(_0x27f35b[0x0][_0x4be6('0xa4')]>0x0){_0x46b92f[_0x4be6('0x41')]=_0x4be6('0xa5');logger['info'](_0x4be6('0xa6')+_0x46b92f[_0x4be6('0x43')],_0x27f35b[0x0][_0x4be6('0xa4')],'contacts');}else{_0x46b92f[_0x4be6('0x41')]=_0x4be6('0xa7');logger[_0x4be6('0x85')]('[getContactDialer2][Empty]'+_0x46b92f['name']);}}};}function notSendMessagesQueue(_0x34e9d8){if(_0x34e9d8[_0x4be6('0xa8')]){freeVariablesPredictive(_0x34e9d8);if(_0x34e9d8[_0x4be6('0x78')]===0x0&&_0x34e9d8['talking']===0x0&&_0x34e9d8[_0x4be6('0x5f')]===0x0&&(_0x34e9d8['pTalking']||0x0)===0x0){_0x34e9d8[_0x4be6('0xa8')]=![];_0x34e9d8[_0x4be6('0x56')]=0x0;_0x34e9d8[_0x4be6('0x41')]=_0x4be6('0x45');loggerSyncQueueSummary[_0x4be6('0x9e')](_0x4be6('0xa9'),_0x34e9d8[_0x4be6('0x43')],_0x4be6('0xaa'));}else{_0x34e9d8[_0x4be6('0x41')]=_0x4be6('0xab');loggerSyncQueueSummary[_0x4be6('0x9e')](_0x4be6('0xa9'),_0x34e9d8['name'],_0x4be6('0xac'));}emitVoiceQueueSummary(_0x34e9d8);}}function notSendMessagesCampaign(_0x2a0d3e){if(_0x2a0d3e[_0x4be6('0xa8')]){if(_0x2a0d3e[_0x4be6('0x78')]===0x0){_0x2a0d3e['sendMessageOneNotActive']=![];_0x2a0d3e[_0x4be6('0x41')]=_0x4be6('0x45');loggerSyncQueueSummary[_0x4be6('0x9e')](_0x4be6('0xad'),_0x2a0d3e['name'],_0x4be6('0xaa'));}else{_0x2a0d3e['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x4be6('0x9e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2a0d3e[_0x4be6('0x43')],_0x4be6('0xac'));}emitCampaignSummary(_0x2a0d3e);}}function createObjHistory(_0x1375e3,_0x7cac08,_0x41f14a,_0x268451,_0x377e7d){_0x1375e3[_0x4be6('0x41')]=_0x41f14a;var _0x4b977f=new Action(_0x1375e3,_0x7cac08);var _0x5e76fa=new History(_0x4b977f);_0x5e76fa[_0x4be6('0xae')]=_0x268451;_0x5e76fa[_0x4be6('0xaf')]=_0x377e7d;_0x5e76fa['endtime']=_0x4b977f['starttime'];return _0x5e76fa;}Dialer[_0x4be6('0x1c')]['loopClearZombieChannels']=function(){var _0x53a41a=this;setInterval(function(){_0x53a41a[_0x4be6('0xb0')](_0x53a41a[_0x4be6('0xb1')],_0x4be6('0xb2'));_0x53a41a[_0x4be6('0xb0')](_0x53a41a[_0x4be6('0x25')],_0x4be6('0xb3'));},0x32c8);};Dialer[_0x4be6('0x1c')]['clearZombieChannels']=function(_0x3d8144,_0x1107c9){var _0x18a831=this;for(var _0x5bddd5 in _0x3d8144){if(typeof _0x3d8144[_0x5bddd5]!==_0x4be6('0xa2')){this[_0x4be6('0xb4')][_0x4be6('0x1d')](function(){if(!_['isNil'](_0x3d8144[_0x5bddd5])){return ami[_0x4be6('0xb5')]({'action':_0x4be6('0xb6'),'channel':_0x3d8144[_0x5bddd5][_0x4be6('0xb7')]})[_0x4be6('0xb8')](function(_0x308e2f){if(_0x308e2f[_0x4be6('0x41')]===_0x4be6('0xb9')){setTimeout(function(){if(_0x3d8144[_0x5bddd5]&&_0x3d8144[_0x5bddd5]['type']!==_0x4be6('0x82')){_0x18a831[_0x4be6('0xba')](_0x18a831[_0x4be6('0x21')][_0x3d8144[_0x5bddd5][_0x4be6('0xbb')]]);logger[_0x4be6('0x9e')](_0x4be6('0xbc'),_0x1107c9,_0x5bddd5,_0x3d8144[_0x5bddd5][_0x4be6('0xbb')]);delete _0x3d8144[_0x5bddd5];}if(_0x3d8144[_0x5bddd5]&&_0x3d8144[_0x5bddd5][_0x4be6('0x53')]===_0x4be6('0x82')){_0x18a831[_0x4be6('0xba')](_0x18a831['campaigns'][_0x3d8144[_0x5bddd5][_0x4be6('0xbb')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x1107c9,_0x5bddd5,_0x3d8144[_0x5bddd5][_0x4be6('0xbb')]);delete _0x3d8144[_0x5bddd5];}},0x2328);}});}});}}};Dialer[_0x4be6('0x1c')][_0x4be6('0xbd')]=function(_0x51de2e){return BPromise[_0x4be6('0xbe')]()['then'](cmHopper[_0x4be6('0xbd')](_0x51de2e))[_0x4be6('0xb8')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x4be6('0x1c')][_0x4be6('0xbf')]=function(_0x2c5a44){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopperBlack[_0x4be6('0xbf')](_0x2c5a44))['catch'](loggerCatch(_0x4be6('0xc0')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x31e9de){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopperBlack[_0x4be6('0xc1')](_0x31e9de))[_0x4be6('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x4be6('0x1c')][_0x4be6('0xc2')]=function(_0x48b357){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopperHistory[_0x4be6('0xc3')](_0x48b357))['catch'](loggerCatch(_0x4be6('0xc4')));};Dialer[_0x4be6('0x1c')][_0x4be6('0xc5')]=function(_0x505b24){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopper[_0x4be6('0xc5')](_0x505b24))[_0x4be6('0xb8')](loggerCatch(_0x4be6('0xc6')));};Dialer[_0x4be6('0x1c')]['unlockContact']=function(_0x1620cf,_0x2fe51f,_0x27202d){return BPromise['resolve']()[_0x4be6('0x3e')](cmHopper[_0x4be6('0xc7')](_0x1620cf,_0x2fe51f,_0x27202d))['catch'](loggerCatch(_0x4be6('0xc8')));};Dialer[_0x4be6('0x1c')][_0x4be6('0xc9')]=function(_0x423b7c,_0xb6b514,_0x3f3bf0,_0x13585f,_0x25827d){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopper[_0x4be6('0xc9')](_0x423b7c,_0xb6b514,_0x3f3bf0,_0x13585f))[_0x4be6('0xb8')](function(_0x4c3c34){_0x25827d[_0x4be6('0xca')]-=_0x3f3bf0;_0x25827d[_0x4be6('0xca')]=_0x25827d[_0x4be6('0xca')]>0x0?_0x25827d['temp']:0x0;loggerCatch(_0x4be6('0xcb'))(_0x4c3c34);});};Dialer['prototype']['getContactDialerIvr']=function(_0x57e3e3,_0xaf85d7,_0x4c17cb,_0x20b430){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopper[_0x4be6('0xcc')](_0x57e3e3,_0xaf85d7,_0x4c17cb))[_0x4be6('0xb8')](function(_0x1889dd){_0x20b430[_0x4be6('0xca')]-=_0xaf85d7;_0x20b430['temp']=_0x20b430[_0x4be6('0xca')]>0x0?_0x20b430['temp']:0x0;loggerCatch(_0x4be6('0xcd'))(_0x1889dd);});};Dialer[_0x4be6('0x1c')]['getVoiceQueueRtPauses']=function(_0xbc3cfe){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](voiceQueueRt[_0x4be6('0xce')](_0xbc3cfe))[_0x4be6('0xb8')](loggerCatch(_0x4be6('0xcf')));};Dialer[_0x4be6('0x1c')][_0x4be6('0xd0')]=function(_0x53f274){return BPromise[_0x4be6('0xbe')]()['then'](cmHopper[_0x4be6('0xd0')](_0x53f274))[_0x4be6('0xb8')](loggerCatch(_0x4be6('0xd1')));};Dialer[_0x4be6('0x1c')][_0x4be6('0xd2')]=function(_0x35712a){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x35712a))[_0x4be6('0xb8')](loggerCatch('[createHistory]\x20'));};Dialer[_0x4be6('0x1c')][_0x4be6('0xba')]=function(_0x4e7bbc){if(!_[_0x4be6('0x40')](_0x4e7bbc)&&_0x4e7bbc!==null){if(typeof _0x4e7bbc[_0x4be6('0x78')]!=='undefined'){if(_0x4e7bbc[_0x4be6('0x78')]>0x0){_0x4e7bbc[_0x4be6('0x78')]-=0x1;}else{logger[_0x4be6('0x9e')](_0x4be6('0xd3'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x4be6('0xd4')]=function(_0x1fdabf,_0x561104){var _0x1b21c2=this;return function(_0x267d45){_0x1b21c2[_0x4be6('0xba')](_0x561104);logger[_0x4be6('0x9e')](_0x1fdabf,util['inspect'](_0x267d45,{'showHidden':![],'depth':null}));};};Dialer[_0x4be6('0x1c')]['emptyContact']=function(_0x5b7f57,_0x1576e7,_0xe1cff6){var _0x7ff213={'state':0x19,'statedesc':_0x4be6('0xd5')};this['updateOriginated'](_0x1576e7);this[_0x4be6('0xd6')](_[_0x4be6('0x96')](_0x7ff213,_[_0x4be6('0xd7')](_0xe1cff6,['ContactId','ListId',_0x4be6('0xd8'),_0x4be6('0xd9'),_0x4be6('0xda')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x4be6('0x9e')](_0x5b7f57);};Dialer[_0x4be6('0x1c')][_0x4be6('0xdb')]=function(_0x4b4ab2){return _0x4b4ab2===_0x4be6('0xdc');};Dialer[_0x4be6('0x1c')]['isTrunkReachable']=function(_0x1cac85){return!_[_0x4be6('0x40')](_0x1cac85)&&_0x1cac85&&!_[_0x4be6('0x40')](_0x1cac85[_0x4be6('0x43')])&&!_[_0x4be6('0x40')](_0x1cac85[_0x4be6('0x7d')])&&_0x1cac85[_0x4be6('0x7d')]&&(this[_0x4be6('0xdd')][util[_0x4be6('0x80')](_0x4be6('0xde'),_0x1cac85[_0x4be6('0x43')])][_0x4be6('0xb6')]===_0x4be6('0xdf')||this[_0x4be6('0xdd')][util[_0x4be6('0x80')](_0x4be6('0xde'),_0x1cac85[_0x4be6('0x43')])][_0x4be6('0xb6')]==='unmonitored');};Dialer[_0x4be6('0x1c')]['saveInDb']=function(_0x5a5a18,_0x5be2a3,_0x5881ff){this[_0x4be6('0xd2')](_0x5a5a18)[_0x4be6('0xb8')](loggerCatch(_0x5be2a3));this[_0x4be6('0xd0')](_0x5a5a18)[_0x4be6('0xb8')](loggerCatch(_0x5881ff));};Dialer['prototype'][_0x4be6('0xe0')]=function(_0x40385c){var _0x2784ad=this[_0x4be6('0xb1')][_0x40385c['uniqueid']];var _0x5a1229;if(!_[_0x4be6('0xe1')](_0x40385c)&&!_[_0x4be6('0xe1')](_0x40385c['variable'])&&!_['isNil'](_0x40385c['variable'][_0x4be6('0xe2')])&&_0x40385c[_0x4be6('0xe3')]===_0x4be6('0xe4')&&_0x2784ad){if(_0x2784ad[_0x4be6('0x53')]!=='ivr'&&this['voiceQueues'][_0x2784ad[_0x4be6('0xbb')]][_0x4be6('0xe5')]&&_0x40385c[_0x4be6('0xe6')]===_0x4be6('0xe7')){delete this[_0x4be6('0xb1')][_0x40385c[_0x4be6('0xe8')]];this[_0x4be6('0xba')](this['voiceQueues'][_0x2784ad[_0x4be6('0xbb')]]);this[_0x4be6('0x21')][_0x2784ad[_0x4be6('0xbb')]][_0x4be6('0x67')]+=0x1;this['voiceQueues'][_0x2784ad[_0x4be6('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5a1229=new Hangup(_0x2784ad,_0x40385c);_0x5a1229[_0x4be6('0xae')]=0x12;_0x5a1229[_0x4be6('0xaf')]=_0x4be6('0xe9');_0x5a1229[_0x4be6('0xea')]=_0x4be6('0xeb');ami['emit']('custom:amd',ut[_0x4be6('0xec')](_0x5a1229,_0x4be6('0xed')));this[_0x4be6('0xd6')](_0x5a1229,_0x4be6('0xee'),_0x4be6('0xef'));}if(_0x2784ad[_0x4be6('0x53')]!==_0x4be6('0x82')&&this[_0x4be6('0x21')][_0x2784ad[_0x4be6('0xbb')]][_0x4be6('0xe5')]&&_0x40385c[_0x4be6('0xe6')]===_0x4be6('0xf0')){var _0x11bf53=this;return new BPromise(function(_0x1359aa,_0x13420c){delete _0x11bf53[_0x4be6('0xb1')][_0x40385c[_0x4be6('0xe8')]];_0x11bf53['updateOriginated'](_0x11bf53[_0x4be6('0x21')][_0x2784ad[_0x4be6('0xbb')]]);_0x11bf53[_0x4be6('0x21')][_0x2784ad[_0x4be6('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x11bf53['voiceQueues'][_0x2784ad['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x45579b=_0x11bf53[_0x4be6('0x21')][_0x2784ad['queue']];var _0xc214e9=new Hangup(_0x2784ad,_0x40385c);_0xc214e9[_0x4be6('0xae')]=0x13;_0xc214e9[_0x4be6('0xaf')]=_0x4be6('0xf1');_0xc214e9[_0x4be6('0xea')]=_0x4be6('0xeb');_0xc214e9[_0x4be6('0xf2')]+=0x1;_0xc214e9[_0x4be6('0xf3')]+=0x1;_0xc214e9[_0x4be6('0xed')]=!![];ami[_0x4be6('0x52')](_0x4be6('0xf4'),ut['buildObj'](_0xc214e9,_0x4be6('0xed')));_0x11bf53[_0x4be6('0xd2')](_0xc214e9)['catch'](loggerCatch(_0x4be6('0xf5')));if(_0xc214e9[_0x4be6('0xf6')]+_0xc214e9[_0x4be6('0xf7')]+_0xc214e9['countnoanswerretry']+_0xc214e9[_0x4be6('0xf8')]+_0xc214e9[_0x4be6('0xf9')]+_0xc214e9[_0x4be6('0xfa')]+_0xc214e9[_0x4be6('0xf2')]+_0xc214e9[_0x4be6('0xfb')]>=_0x45579b[_0x4be6('0xfc')]){_0x11bf53['stateGlobal'](_0xc214e9,_0x1359aa,_0x13420c,_0x4be6('0xfd'));}else{if(_0xc214e9[_0x4be6('0xf2')]>=_0x45579b['dialMachineMaxRetry']){_0x11bf53[_0x4be6('0xfe')](_0xc214e9,_0x1359aa,_0x13420c,'reason\x2019\x20machine....');}else{_0x11bf53[_0x4be6('0xc5')]({'active':![],'countmachineretry':_0xc214e9[_0x4be6('0xf2')],'scheduledat':moment()[_0x4be6('0xff')](_0x45579b[_0x4be6('0x100')],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0xc214e9[_0x4be6('0x103')],'ListId':_0xc214e9[_0x4be6('0x104')],'VoiceQueueId':_0xc214e9[_0x4be6('0xd9')]||undefined,'CampaignId':_0xc214e9[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x1359aa({'reschedule':0x1});}}});}if(_0x2784ad[_0x4be6('0x53')]===_0x4be6('0x82')&&this[_0x4be6('0x22')][_0x2784ad['queue']]['dialAMDActive']&&_0x40385c['value']===_0x4be6('0xe7')){delete this['uniqueId'][_0x40385c[_0x4be6('0xe8')]];this['updateOriginated'](this['campaigns'][_0x2784ad['queue']]);_0x5a1229=new Hangup(_0x2784ad,_0x40385c);_0x5a1229[_0x4be6('0xae')]=0x12;_0x5a1229[_0x4be6('0xaf')]=_0x4be6('0xe9');_0x5a1229['membername']='AMD';ami[_0x4be6('0x52')]('custom:amd',ut[_0x4be6('0xec')](_0x5a1229,'amd'));this[_0x4be6('0xd6')](_0x5a1229,_0x4be6('0x105'),_0x4be6('0x106'));}if(_0x2784ad[_0x4be6('0x53')]==='ivr'&&this[_0x4be6('0x22')][_0x2784ad['queue']][_0x4be6('0xe5')]&&_0x40385c[_0x4be6('0xe6')]===_0x4be6('0xf0')){var _0x11bf53=this;return new BPromise(function(_0x4febaf,_0x5c1963){delete _0x11bf53[_0x4be6('0xb1')][_0x40385c[_0x4be6('0xe8')]];_0x11bf53['updateOriginated'](_0x11bf53[_0x4be6('0x22')][_0x2784ad[_0x4be6('0xbb')]]);_0x11bf53['campaigns'][_0x2784ad[_0x4be6('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x11bf53[_0x4be6('0x22')][_0x2784ad[_0x4be6('0xbb')]][_0x4be6('0x107')]+=0x1;var _0x38311b=_0x11bf53[_0x4be6('0x22')][_0x2784ad['queue']];var _0x491e80=new Hangup(_0x2784ad,_0x40385c);_0x491e80[_0x4be6('0xae')]=0x13;_0x491e80['statedesc']=_0x4be6('0xf1');_0x491e80[_0x4be6('0xea')]=_0x4be6('0xeb');_0x491e80[_0x4be6('0xf2')]+=0x1;_0x491e80[_0x4be6('0xf3')]+=0x1;_0x491e80[_0x4be6('0xed')]=!![];ami[_0x4be6('0x52')](_0x4be6('0xf4'),ut[_0x4be6('0xec')](_0x491e80,_0x4be6('0xed')));_0x11bf53['createHistory'](_0x491e80)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0xf5')));if(_0x491e80['countbusyretry']+_0x491e80['countcongestionretry']+_0x491e80[_0x4be6('0x108')]+_0x491e80['countnosuchnumberretry']+_0x491e80[_0x4be6('0xf9')]+_0x491e80[_0x4be6('0xfa')]+_0x491e80[_0x4be6('0xf2')]+_0x491e80[_0x4be6('0xfb')]>=_0x38311b[_0x4be6('0xfc')]){_0x11bf53[_0x4be6('0x109')](_0x491e80,_0x4febaf,_0x5c1963,_0x4be6('0xfd'));}else{if(_0x491e80['countmachineretry']>=_0x38311b[_0x4be6('0x10a')]){_0x11bf53[_0x4be6('0xfe')](_0x491e80,_0x4febaf,_0x5c1963,'reason\x2019\x20machine....');}else{_0x11bf53[_0x4be6('0xc5')]({'active':![],'countmachineretry':_0x491e80[_0x4be6('0xf2')],'scheduledat':moment()[_0x4be6('0xff')](_0x38311b[_0x4be6('0x100')],_0x4be6('0x101'))['format'](_0x4be6('0x102')),'ContactId':_0x491e80[_0x4be6('0x103')],'ListId':_0x491e80['ListId'],'VoiceQueueId':_0x491e80[_0x4be6('0xd9')]||undefined,'CampaignId':_0x491e80[_0x4be6('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x4febaf({'reschedule':0x1});}}});}}};Dialer[_0x4be6('0x1c')][_0x4be6('0x36')]=function(_0x1acb0e){var _0x8b37ae=this[_0x4be6('0xb1')][_0x1acb0e['uniqueid']];var _0x4d782e=this;var _0x4b63e8;if(_0x8b37ae&&_0x8b37ae[_0x4be6('0x53')]===_0x4be6('0x82')){delete this[_0x4be6('0xb1')][_0x1acb0e['uniqueid']];this[_0x4be6('0xba')](this[_0x4be6('0x22')][_0x8b37ae[_0x4be6('0xbb')]]);this[_0x4be6('0x22')][_0x8b37ae[_0x4be6('0xbb')]][_0x4be6('0x10b')]+=0x1;_0x4b63e8=new Hangup(_0x8b37ae,_0x1acb0e);this[_0x4be6('0xd2')](_0x4b63e8)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x10c')));this['moveContactManagedDialer'](_0x4b63e8)['catch'](loggerCatch(_0x4be6('0x10d')));}if(_0x8b37ae&&_0x8b37ae['type']!==_0x4be6('0x82')&&isNotNull(this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]]['dialQueueProject'])){delete this[_0x4be6('0xb1')][_0x1acb0e[_0x4be6('0xe8')]];this[_0x4be6('0xba')](this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]]);this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]]['outboundAnswerCallsDay']+=0x1;this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]][_0x4be6('0x107')]+=0x1;_0x4b63e8=new Hangup(_0x8b37ae,_0x1acb0e);_0x4b63e8[_0x4be6('0xae')]=0x10;_0x4b63e8[_0x4be6('0xaf')]=_0x4be6('0x10e');_0x4b63e8[_0x4be6('0xea')]='AGI';this[_0x4be6('0xd2')](_0x4b63e8)['catch'](loggerCatch(_0x4be6('0x10c')));this[_0x4be6('0xd0')](_0x4b63e8)['catch'](loggerCatch(_0x4be6('0x10d')));}if(_0x8b37ae&&_0x8b37ae['type']!=='ivr'&&!isNotNull(this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]][_0x4be6('0x10f')])){delete this[_0x4be6('0xb1')][_0x1acb0e[_0x4be6('0xe8')]];this[_0x4be6('0xba')](this[_0x4be6('0x21')][_0x8b37ae[_0x4be6('0xbb')]]);this['voiceQueues'][_0x8b37ae[_0x4be6('0xbb')]]['outboundUnknownCallsDay']+=0x1;_0x4b63e8=new Hangup(_0x8b37ae,_0x1acb0e);_0x4b63e8[_0x4be6('0xae')]=0xc;_0x4b63e8['statedesc']=_0x1acb0e['cause-txt'];_0x4b63e8[_0x4be6('0xea')]=_0x4be6('0x110');this['createHistory'](_0x4b63e8)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x10c')));this[_0x4be6('0xd0')](_0x4b63e8)[_0x4be6('0xb8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x4be6('0x1c')][_0x4be6('0x33')]=function(_0x97c13f){var _0x87135c=this[_0x4be6('0xb1')][_0x97c13f[_0x4be6('0xe8')]];var _0x49a6b4=this;if(this[_0x4be6('0x21')][_0x97c13f['queue']]){if(_0x87135c&&_0x87135c[_0x4be6('0x53')]!==_0x4be6('0x82')){delete this[_0x4be6('0xb1')][_0x97c13f[_0x4be6('0xe8')]];this[_0x4be6('0x21')][_0x97c13f['queue']][_0x4be6('0x67')]+=0x1;var _0x5e5a76=new AgentComplete(_0x87135c,_0x97c13f);if(_0x97c13f[_0x4be6('0x111')]==='agent'){_0x5e5a76[_0x4be6('0x112')]=this[_0x4be6('0x21')][_0x97c13f[_0x4be6('0xbb')]][_0x4be6('0x113')]&&this['voiceQueues'][_0x97c13f[_0x4be6('0xbb')]][_0x4be6('0x114')]?moment()[_0x4be6('0x80')](_0x4be6('0x102')):undefined;}this[_0x4be6('0xd2')](_0x5e5a76)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x115')));this['moveContactManagedDialer'](_0x5e5a76)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x116')));}}};Dialer[_0x4be6('0x1c')][_0x4be6('0x2d')]=function(_0x25c56a){if(this[_0x4be6('0x21')][_0x25c56a[_0x4be6('0xbb')]]){if(this['uniqueId'][_0x25c56a[_0x4be6('0xe8')]]&&this[_0x4be6('0xb1')][_0x25c56a['uniqueid']]['type']!==_0x4be6('0x82')){this[_0x4be6('0xba')](this[_0x4be6('0x21')][_0x25c56a[_0x4be6('0xbb')]]);this['uniqueId'][_0x25c56a[_0x4be6('0xe8')]][_0x4be6('0x117')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));}}};Dialer[_0x4be6('0x1c')][_0x4be6('0x118')]=function(_0x1ef16a){this['createHistory'](_0x1ef16a)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x115')));this[_0x4be6('0xd0')](_0x1ef16a)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x119')));};Dialer[_0x4be6('0x1c')][_0x4be6('0x2f')]=function(_0x182cfb){var _0x3c5218=this[_0x4be6('0xb1')][_0x182cfb[_0x4be6('0xe8')]];var _0x878104=this;if(this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]]){if(_0x3c5218&&_0x3c5218[_0x4be6('0x53')]!==_0x4be6('0x82')){delete this[_0x4be6('0xb1')][_0x182cfb[_0x4be6('0xe8')]];this[_0x4be6('0xba')](this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]]);_0x3c5218[_0x4be6('0x11a')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));var _0x4570b6=new QueueCallerAbandon(_0x3c5218,_0x182cfb);if(getSeconds(_0x3c5218[_0x4be6('0x11a')],_0x3c5218[_0x4be6('0x11b')])>=_0x3c5218[_0x4be6('0x11c')]){this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4be6('0x21')][_0x182cfb['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]][_0x4be6('0x11d')]+=0x1;_0x4570b6[_0x4be6('0xae')]=0xa;_0x4570b6[_0x4be6('0xaf')]=_0x4be6('0x11e');_0x4570b6[_0x4be6('0x11f')]='TIMEOUT';_0x4570b6[_0x4be6('0x112')]=this[_0x4be6('0x21')][_0x182cfb['queue']][_0x4be6('0x113')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4570b6[_0x4be6('0xf9')]+=0x1;_0x4570b6['countglobal']+=0x1;if(_0x4570b6[_0x4be6('0xf9')]>=this[_0x4be6('0x21')][_0x182cfb['queue']][_0x4be6('0x120')]){this[_0x4be6('0x118')](_0x4570b6);}else{this[_0x4be6('0xc5')]({'active':![],'countdropretry':_0x4570b6[_0x4be6('0xf9')],'scheduledat':moment()[_0x4be6('0xff')](this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]][_0x4be6('0x121')],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x3c5218[_0x4be6('0x103')],'ListId':_0x3c5218[_0x4be6('0x104')],'VoiceQueueId':_0x3c5218[_0x4be6('0xd9')]||undefined,'CampaignId':_0x3c5218[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x122')));var _0x532ea=new History(_0x4570b6);_0x532ea['state']=0xa;_0x532ea[_0x4be6('0xaf')]=_0x4be6('0x11e');_0x532ea[_0x4be6('0x123')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));_0x532ea[_0x4be6('0x124')]=_0x532ea['starttime'];_0x532ea['calleridname']=_0x4570b6[_0x4be6('0x125')];_0x532ea[_0x4be6('0x126')]=_0x4570b6[_0x4be6('0x126')];this[_0x4be6('0xd2')](_0x532ea)['catch'](loggerCatch(_0x4be6('0x127')));}}else{this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]][_0x4be6('0x71')]+=0x1;this[_0x4be6('0x21')][_0x182cfb['queue']][_0x4be6('0x6a')]+=0x1;_0x4570b6[_0x4be6('0xae')]=0xb;_0x4570b6[_0x4be6('0xaf')]=_0x4be6('0x128');_0x4570b6['dropreason']=_0x4be6('0x129');_0x4570b6[_0x4be6('0xfa')]+=0x1;_0x4570b6[_0x4be6('0xf3')]+=0x1;if(_0x4570b6[_0x4be6('0xfa')]>=this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]]['dialAbandonedMaxRetry']){this[_0x4be6('0x118')](_0x4570b6);}else{this[_0x4be6('0xc5')]({'active':![],'countabandonedretry':_0x4570b6[_0x4be6('0xfa')],'scheduledat':moment()[_0x4be6('0xff')](this[_0x4be6('0x21')][_0x182cfb[_0x4be6('0xbb')]][_0x4be6('0x12a')],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x3c5218[_0x4be6('0x103')],'ListId':_0x3c5218[_0x4be6('0x104')],'VoiceQueueId':_0x3c5218[_0x4be6('0xd9')]||undefined,'CampaignId':_0x3c5218['CampaignId']||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x12b')));var _0x532ea=new History(_0x4570b6);_0x532ea[_0x4be6('0xae')]=0xb;_0x532ea[_0x4be6('0xaf')]=_0x4be6('0x128');_0x532ea[_0x4be6('0x123')]=moment()[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x532ea[_0x4be6('0x124')]=_0x532ea['starttime'];_0x532ea['calleridname']=_0x4570b6[_0x4be6('0x125')];_0x532ea[_0x4be6('0x126')]=_0x4570b6[_0x4be6('0x126')];this['createHistory'](_0x532ea)['catch'](loggerCatch(_0x4be6('0x12c')));}}}}};Dialer[_0x4be6('0x1c')][_0x4be6('0x38')]=function(_0x444ae7){if(this['actions'][_0x444ae7[_0x4be6('0xe8')]]){this[_0x4be6('0x25')][_0x444ae7[_0x4be6('0xe8')]][_0x4be6('0xb7')]=_0x444ae7[_0x4be6('0xb7')];}if(this['uniqueId'][_0x444ae7['uniqueid']]){this[_0x4be6('0xb1')][_0x444ae7[_0x4be6('0xe8')]]['channel']=_0x444ae7[_0x4be6('0xb7')];}};Dialer[_0x4be6('0x1c')][_0x4be6('0x12d')]=function(_0x2aa6a1){if(strategy[this[_0x4be6('0x21')][this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0xbb')]][_0x4be6('0x55')]]===_0x4be6('0x1b')){if(this[_0x4be6('0x25')][_0x2aa6a1['actionid']]&&_[_0x4be6('0xe1')](this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0x12f')])&&_0x2aa6a1[_0x4be6('0xb6')]==='1'&&_0x2aa6a1['paused']==='0'){if(this[_0x4be6('0x23')][_0x2aa6a1[_0x4be6('0x130')]]){if(!this[_0x4be6('0x23')][_0x2aa6a1[_0x4be6('0x130')]][_0x4be6('0x12f')]){this['agents'][_0x2aa6a1[_0x4be6('0x130')]][_0x4be6('0x12f')]=!![];this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0x12f')]=!![];this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0x130')]=_0x2aa6a1[_0x4be6('0x130')];}}}}else if((strategy[this[_0x4be6('0x21')][this[_0x4be6('0x25')][_0x2aa6a1['actionid']][_0x4be6('0xbb')]][_0x4be6('0x55')]]||_0x4be6('0x1a'))===_0x4be6('0x1a')){if(this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]]){if(this[_0x4be6('0x23')][_0x2aa6a1['stateinterface']]){this[_0x4be6('0x25')][_0x2aa6a1['actionid']][_0x4be6('0x130')]=_0x2aa6a1[_0x4be6('0x130')];if(_[_0x4be6('0xe1')](this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0xbb')]])){this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]][_0x4be6('0xbb')]]=[];}this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x2aa6a1['actionid']][_0x4be6('0xbb')]][_0x4be6('0x131')](_[_0x4be6('0x96')](_[_0x4be6('0xd7')](this[_0x4be6('0x25')][_0x2aa6a1[_0x4be6('0x12e')]],[_0x4be6('0x132'),_0x4be6('0x130')]),{'status':_0x2aa6a1[_0x4be6('0xb6')],'paused':_0x2aa6a1[_0x4be6('0x133')]}));}}}};function unlockQueueStatus(_0x10d3fa,_0x2f0b8a){setTimeout(function(){if(_[_0x4be6('0x40')](_0x10d3fa['queueStatusComplete'])){loggerBooked['error'](_0x4be6('0x134'),_0x2f0b8a);}_0x10d3fa[_0x4be6('0x135')]=!![];loggerBooked[_0x4be6('0x85')](_0x4be6('0x136'),_0x2f0b8a,JSON[_0x4be6('0x4e')](_[_0x4be6('0xd7')](_0x10d3fa,[_0x4be6('0x43'),_0x4be6('0x135')])));},0x1f3);}Dialer[_0x4be6('0x1c')][_0x4be6('0x3b')]=function(_0x5f0976){var _0x4147f6=this;var _0x16f4d6=_0x4147f6[_0x4be6('0x21')][_0x4147f6[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0xbb')]];if(strategy[this[_0x4be6('0x21')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0xbb')]][_0x4be6('0x55')]]==='roundrobin'){if(this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]&&this['actions'][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0x130')]){this[_0x4be6('0x20')][_0x4be6('0x137')](this['actions'][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0x132')],this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0x130')])[_0x4be6('0xb8')](function(_0x2b568a){logger[_0x4be6('0x9e')](_0x4be6('0x138'),util['inspect'](_0x2b568a,{'showHidden':![],'depth':null}));})[_0x4be6('0x1f')](function(){_0x4147f6['updateOriginated'](_0x4147f6[_0x4be6('0x21')][_0x4147f6[_0x4be6('0x25')][_0x5f0976['actionid']][_0x4be6('0xbb')]]);_0x4147f6[_0x4be6('0x23')][_0x4147f6[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['stateinterface']][_0x4be6('0x12f')]=![];delete _0x4147f6[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]];unlockQueueStatus(_0x16f4d6);});}else{this[_0x4be6('0xba')](this[_0x4be6('0x21')][this['actions'][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0xbb')]]);this[_0x4be6('0xc5')]({'active':![],'ContactId':this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['ContactId'],'ListId':this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['ListId'],'VoiceQueueId':this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x5f0976['actionid']][_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x139')));delete this[_0x4be6('0x25')][_0x5f0976['actionid']];unlockQueueStatus(_0x16f4d6);}}else if((strategy[this[_0x4be6('0x21')][this[_0x4be6('0x25')][_0x5f0976['actionid']][_0x4be6('0xbb')]][_0x4be6('0x55')]]||_0x4be6('0x1a'))===_0x4be6('0x1a')){var _0xcbb43e;if(this['actions'][_0x5f0976[_0x4be6('0x12e')]]&&!_[_0x4be6('0x4b')](this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['queue']])){if(this[_0x4be6('0x13a')][_0x4147f6[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0xbb')]]){this[_0x4be6('0x13a')][_0x4147f6[_0x4be6('0x25')][_0x5f0976['actionid']]['queue']]=this[_0x4be6('0x13a')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['queue']]?this['queueBookedRR'][this['actions'][_0x5f0976['actionid']][_0x4be6('0xbb')]]:this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['queue']]?this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['queue']][_0x4be6('0x13b')]||0x0:0x0;}this[_0x4be6('0x2b')][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]]['queue']]['_rr']=this['queueBookedRR'][this[_0x4be6('0x25')][_0x5f0976[_0x4be6('0x12e')]][_0x4be6('0xbb')]];for(var _0x3a576e=0x0;_0x3a576e=0x0;})['catch'](myreject(_0x339d68)));}}else{_0x5f47b0[_0x4be6('0x131')](ami['Action']({'action':_0x4be6('0x158'),'command':util[_0x4be6('0x80')]('iftime\x20%s,%s',_0x1ee6a2,!_['isUndefined'](config[_0x4be6('0x153')][_0x270166])?_0x270166:'')})[_0x4be6('0x3e')](function(_0x4c9318){return _0x4c9318[_0x4be6('0x156')][_0x4be6('0x159')](_0x4be6('0x157'))>=0x0;})['catch'](myreject(_0x339d68)));}BPromise[_0x4be6('0x15a')](_0x5f47b0)[_0x4be6('0x3e')](function(_0x411d37){var _0x42576f=_[_0x4be6('0x15b')](_0x411d37);if(_0x42576f){return _0x1b3699(_0x42576f);}else{_0x414e53[_0x4be6('0x41')]=_0x440881?_0x4be6('0x15c'):_0x4be6('0x15d');return _0x339d68(msgResponse('[ifTime][promiseAll]',_0x4be6('0x14f'),_0x4be6('0x15e')+_0x440881+'\x20'+_0x2dc4e9+'\x20Interval\x20is\x20overtime:\x20'+util[_0x4be6('0x9f')](_0x1ee6a2,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x270166));}})[_0x4be6('0xb8')](function(_0x589300){return _0x339d68(msgResponse('ifTime',_0x4be6('0x14f'),JSON['stringify'](_0x589300)));});});};Dialer['prototype'][_0x4be6('0x15f')]=function(_0x2ee426){var _0x4e2b5d=this;return function(){switch(_0x2ee426[_0x4be6('0x62')]){case _0x4be6('0x160'):freeVariablesPredictive(_0x2ee426);_0x4e2b5d[_0x4be6('0x161')](_0x2ee426,0x1);break;case _0x4be6('0x162'):freeVariablesPredictive(_0x2ee426);_0x4e2b5d[_0x4be6('0x161')](_0x2ee426,_0x2ee426['dialPowerLevel']);break;case _0x4be6('0x9'):_0x4e2b5d[_0x4be6('0x9')](_0x2ee426);break;case'booked':freeVariablesPredictive(_0x2ee426);_0x4e2b5d[_0x4be6('0x161')](_0x2ee426,0x1);break;default:freeVariablesPredictive(_0x2ee426);logger[_0x4be6('0x9e')](_0x4be6('0x163'),_0x2ee426['name'],_0x4be6('0x164'));}};};Dialer[_0x4be6('0x1c')][_0x4be6('0x165')]=_['throttle'](function(_0x6d889b){return BPromise[_0x4be6('0xbe')]()[_0x4be6('0x3e')](cmHopper[_0x4be6('0x166')](_0x6d889b['id'],previewRecallmeReminderInterval))[_0x4be6('0x3e')](function(_0x5bbc7b){for(var _0x458138=0x0;_0x458138<_0x5bbc7b[_0x4be6('0xa1')];_0x458138++){var _0x19ce52=_0x5bbc7b[_0x458138][_0x4be6('0x167')][_0x4be6('0x43')];if(_0x19ce52)io['to'](util[_0x4be6('0x80')](_0x4be6('0x168'),_0x19ce52))[_0x4be6('0x52')](_0x4be6('0x169'),{'hopper':_0x5bbc7b[_0x458138]});}})[_0x4be6('0xb8')](function(_0x19c74d){logger[_0x4be6('0x9e')](_0x4be6('0x165'),_0x19c74d);});},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4be6('0x1c')][_0x4be6('0x16a')]=function(_0x5ba676){var _0xcb29e3=this;return function(){_0xcb29e3['handleIvr'](_0x5ba676);};};Dialer['prototype'][_0x4be6('0xa')]=function(_0x2b92c5){var _0x5e8a74=this;if(isNotPreview(_0x2b92c5[_0x4be6('0x62')])){if(isVoiceQueueOutbound(_0x2b92c5[_0x4be6('0x53')])&&isActive(_0x2b92c5[_0x4be6('0x61')])){_0x2b92c5[_0x4be6('0xa8')]=!![];BPromise[_0x4be6('0xbe')]()['then'](checkIsLoggedIn(_0x2b92c5,_0x2b92c5['loggedIn']))[_0x4be6('0x3e')](checkIsActive(_0x2b92c5,_0x2b92c5['dialActive']))['then'](checkInterval(_0x2b92c5))['then'](_0x5e8a74[_0x4be6('0x147')](_0x2b92c5))[_0x4be6('0x3e')](_0x5e8a74[_0x4be6('0x14c')](_0x2b92c5[_0x4be6('0x16b')],_0x2b92c5['dialTimezone'],_0x2b92c5[_0x4be6('0x43')],_0x2b92c5))['then'](_0x5e8a74[_0x4be6('0x14e')](_0x2b92c5['Interval'],_0x2b92c5[_0x4be6('0x16c')],_0x2b92c5[_0x4be6('0x43')],_0x2b92c5))[_0x4be6('0x3e')](_0x5e8a74[_0x4be6('0x15f')](_0x2b92c5))[_0x4be6('0xb8')](loggerCatchQueueSummary(_0x4be6('0x16d'),_0x2b92c5));}else{notSendMessagesQueue(_0x2b92c5);}}else{freeVariablesPredictive(_0x2b92c5);if(_0x2b92c5['dialPreviewRecallmeReminder']){_0x5e8a74[_0x4be6('0x165')](_0x2b92c5);}}};Dialer['prototype'][_0x4be6('0x16e')]=function(){var _0x36f075=this;var _0x2ca17a;for(var _0x2ac9bd in this[_0x4be6('0x22')]){if(typeof this['campaigns'][_0x2ac9bd]!==_0x4be6('0xa2')){_0x2ca17a=this['campaigns'][_0x2ac9bd];if(isCampaignIvr(_0x2ca17a[_0x4be6('0x53')])&&isActive(_0x2ca17a[_0x4be6('0x7d')])){_0x2ca17a[_0x4be6('0xa8')]=!![];BPromise['resolve']()[_0x4be6('0x3e')](checkIsActive(_0x2ca17a,_0x2ca17a['active']))['then'](checkInterval(_0x2ca17a))[_0x4be6('0x3e')](_0x36f075['checkIsTrunkReachable'](_0x2ca17a))[_0x4be6('0x3e')](_0x36f075['checkIfTime'](_0x2ca17a['dialGlobalInterval'],_0x2ca17a[_0x4be6('0x16c')],_0x2ca17a[_0x4be6('0x43')],_0x2ca17a))[_0x4be6('0x3e')](_0x36f075[_0x4be6('0x14e')](_0x2ca17a[_0x4be6('0x49')],_0x2ca17a[_0x4be6('0x16c')],_0x2ca17a[_0x4be6('0x43')],_0x2ca17a))[_0x4be6('0x3e')](_0x36f075[_0x4be6('0x16a')](_0x2ca17a))[_0x4be6('0xb8')](loggerCatchQueueSummary('[syncCampaigns]',_0x2ca17a));}else{notSendMessagesCampaign(_0x2ca17a);}}}};function getCallerIdRandom(_0xeb088a,_0x4689f8){var _0x115126;var _0x3aa34a;var _0x362f53;if(_0x4689f8<=0x0){_0x4689f8=0x1;}_0x115126=new RegExp('\x5cw{0,'+_0x4689f8+'}$');_0x3aa34a=Math[_0x4be6('0x16f')](0xa,_0x4689f8-0x1);_0x362f53=Math[_0x4be6('0x16f')](0xa,_0x4689f8)-0x1;return util[_0x4be6('0x80')]('%s',_[_0x4be6('0x170')](_0xeb088a,_0x115126,_['random'](_0x3aa34a,_0x362f53)));}function extractCalleridName(_0x558eda){var _0x2a0a88=_0x558eda[_0x4be6('0x171')](/"(.*?)"/);return _0x2a0a88?_0x2a0a88[0x1]:_0x558eda;}function extractCalleridNumber(_0x42f91e){var _0x559b85=_0x42f91e[_0x4be6('0x171')](/<(.*?)>/);return _0x559b85?_0x559b85[0x1]:_0x42f91e;}Dialer[_0x4be6('0x1c')][_0x4be6('0x172')]=function(_0x5c6905,_0x4e1869){var _0x4a7600=this;var _0x173bb1=uuid['v4']();this[_0x4be6('0x25')][_0x173bb1]=new Action(_0x5c6905,_0x4e1869,_0x173bb1);return new BPromise(function(_0x4458ba,_0x16f0a9){if(_[_0x4be6('0x40')](_0x5c6905)&&typeof _0x5c6905!==_0x4be6('0x173')){return _0x16f0a9(msgResponse('originate',_0x4be6('0x14f'),_0x4be6('0x174')));}if(_['isUndefined'](_0x4e1869['Contact']['phone'])||_0x4e1869[_0x4be6('0x175')][_0x4be6('0x176')]===null){return _0x16f0a9(msgResponse(_0x4be6('0x177'),_0x4be6('0x14f'),_0x4be6('0x178')));}var _0xe9f5e1={'XMD-CALLERID':_0x4a7600[_0x4be6('0x25')][_0x173bb1][_0x4be6('0x179')](),'XMD-AGI':_0x5c6905['dialQueueProject']?util['format'](_0x4be6('0x17a'),ipAgi,_0x5c6905[_0x4be6('0x10f')]):'NONE','XMD-AGIAFTER':_0x5c6905[_0x4be6('0x113')]?util[_0x4be6('0x80')](_0x4be6('0x17a'),ipAgi,_0x5c6905[_0x4be6('0x113')]):_0x4be6('0x17b'),'XMD-QUEUE':_0x5c6905['type']==='outbound'?util['format'](_0x4be6('0x17c'),_0x5c6905[_0x4be6('0x43')],_0x5c6905[_0x4be6('0x17d')]||'',_0x5c6905[_0x4be6('0x114')]?'c':'',_0x5c6905[_0x4be6('0x11c')]||0x3):_0x4be6('0x17b'),'XMD-CONTACTID':_0x4e1869[_0x4be6('0x103')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4a7600[_0x4be6('0x25')][_0x173bb1]['getCaller'](),'XMD-AMD':_0x5c6905[_0x4be6('0xe5')]?'ACTIVE':_0x4be6('0x17b'),'XMD-DESTINATION':_0x4be6('0xe4')};if(_0x5c6905[_0x4be6('0xe5')]){_0xe9f5e1[_0x4be6('0x17e')]=_0x5c6905[_0x4be6('0x17f')]||0x9c4;_0xe9f5e1['XMD-AMDGREETING']=_0x5c6905['dialAMDGreeting']||0x5dc;_0xe9f5e1[_0x4be6('0x180')]=_0x5c6905[_0x4be6('0x181')]||0x320;_0xe9f5e1['XMD-AMDTOTALANALYSISTIME']=_0x5c6905[_0x4be6('0x182')]||0x1388;_0xe9f5e1[_0x4be6('0x183')]=_0x5c6905[_0x4be6('0x184')]||0x64;_0xe9f5e1['XMD-AMDBETWEENWORDSSILENCE']=_0x5c6905['dialAMDBetweenWordsSilence']||0x32;_0xe9f5e1[_0x4be6('0x185')]=_0x5c6905[_0x4be6('0x186')]||0x3;_0xe9f5e1['XMD-AMDSILENCETHRESHOLD']=_0x5c6905[_0x4be6('0x187')]||0x100;_0xe9f5e1['XMD-AMDMAXIMUMWORDLENGTH']=_0x5c6905['dialAMDMaximumWordLength']||0x1388;}if(_0x5c6905['type']===_0x4be6('0x54')){_0xe9f5e1['XMD-VOICEQUEUEID']=_0x4e1869[_0x4be6('0xd9')];}else{_0xe9f5e1[_0x4be6('0x188')]=_0x4e1869['CampaignId'];}for(var _0xf13f1c in _0x4e1869[_0x4be6('0x175')]){if(typeof _0x4e1869[_0x4be6('0x175')][_0xf13f1c]!==_0x4be6('0xa2')){if(isNotNull(_0x4e1869[_0x4be6('0x175')][_0xf13f1c])&&_0xf13f1c!=='id'&&_0xf13f1c!==_0x4be6('0x189')&&_0xf13f1c!=='createdAt'&&_0xf13f1c!=='updatedAt'){_0xe9f5e1[util[_0x4be6('0x80')](_0x4be6('0x18a'),_0x4be6('0x18b'),_[_0x4be6('0x18c')](_0xf13f1c))]=_0x4e1869['Contact'][_0xf13f1c];}}}var _0x47651e=_0x4a7600[_0x4be6('0x148')](_0x5c6905[_0x4be6('0x7c')])?getCallerId(_0x5c6905['Trunk'][_0x4be6('0x7e')],_0x5c6905[_0x4be6('0x63')],_0x5c6905[_0x4be6('0x18d')]>0x0?getCallerIdRandom(_0x5c6905['dialOriginateCallerIdNumber'],_0x5c6905['dialRandomLastDigitCallerIdNumber']):_0x5c6905['dialOriginateCallerIdNumber']):getCallerId(_[_0x4be6('0xe1')](_0x5c6905[_0x4be6('0x149')])?_0x5c6905[_0x4be6('0x7c')][_0x4be6('0x7e')]:_0x5c6905[_0x4be6('0x149')]['callerid'],_0x5c6905[_0x4be6('0x63')],_0x5c6905[_0x4be6('0x18d')]>0x0?getCallerIdRandom(_0x5c6905[_0x4be6('0x64')],_0x5c6905['dialRandomLastDigitCallerIdNumber']):_0x5c6905[_0x4be6('0x64')]);if(_0x47651e){_0xe9f5e1[_0x4be6('0x18e')]=_0x4a7600[_0x4be6('0x25')][_0x173bb1]['originatecalleridname']=extractCalleridName(_0x47651e);_0xe9f5e1[_0x4be6('0x18f')]=_0x4a7600[_0x4be6('0x25')][_0x173bb1][_0x4be6('0x190')]=extractCalleridNumber(_0x47651e);}return ami[_0x4be6('0xb5')]({'actionid':_0x173bb1,'action':_0x4be6('0x177'),'channel':_0x4a7600[_0x4be6('0x148')](_0x5c6905['Trunk'])?util[_0x4be6('0x80')](_0x4be6('0x191'),_0x5c6905[_0x4be6('0x7c')][_0x4be6('0x43')],isNotNull(_0x5c6905[_0x4be6('0x66')])?_0x5c6905[_0x4be6('0x66')][_0x4be6('0x192')]()||'':'',_0x5c6905[_0x4be6('0x193')]>0x0?_0x4e1869['Contact'][_0x4be6('0x176')][_0x4be6('0x194')](_0x5c6905[_0x4be6('0x193')]):_0x4e1869[_0x4be6('0x175')]['phone']):util[_0x4be6('0x80')](_0x4be6('0x191'),_[_0x4be6('0xe1')](_0x5c6905['TrunkBackup'])?_0x5c6905[_0x4be6('0x7c')]['name']:_0x5c6905[_0x4be6('0x149')][_0x4be6('0x43')],isNotNull(_0x5c6905['dialPrefix'])?_0x5c6905['dialPrefix'][_0x4be6('0x192')]()||'':'',_0x5c6905['dialCutDigit']>0x0?_0x4e1869[_0x4be6('0x175')][_0x4be6('0x176')]['substring'](_0x5c6905['dialCutDigit']):_0x4e1869[_0x4be6('0x175')][_0x4be6('0x176')]),'callerid':_0x47651e,'Exten':'xcally-motion-dialer','Context':_0x4be6('0x195'),'Priority':'1','variable':_0xe9f5e1,'timeout':(_0x5c6905[_0x4be6('0x65')]||0x1e)*0x3e8,'async':!![],'channelid':_0x173bb1})['then'](function(_0x5a8594){return _0x4458ba(_0x5a8594);})[_0x4be6('0xb8')](function(_0x17c17f){_0x5c6905['outboundOriginateFailureCallsDay']+=0x1;var _0x7d4977=new History(_0x4a7600[_0x4be6('0x25')][_0x173bb1]);logger[_0x4be6('0x9e')](util['format'](_0x4be6('0x196'),JSON[_0x4be6('0x4e')](_0x17c17f)));_0x7d4977[_0x4be6('0xae')]=0xe;_0x7d4977[_0x4be6('0xaf')]=_0x4be6('0x197');_0x7d4977[_0x4be6('0x123')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));_0x7d4977['endtime']=_0x7d4977[_0x4be6('0x123')];_0x4a7600['createHistory'](_0x7d4977)['catch'](loggerCatch(_0x4be6('0x198')));_0x4a7600[_0x4be6('0xd0')](_0x7d4977)['catch'](loggerCatch(_0x4be6('0x198')))[_0x4be6('0x1f')](function(){delete _0x4a7600['actions'][_0x173bb1];return _0x16f0a9(msgResponse(_0x4be6('0x177'),_0x4be6('0x4d'),_0x4be6('0x199')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x386f27){var _0x2a57e3=this[_0x4be6('0x25')][_0x386f27[_0x4be6('0x12e')]];if(_0x2a57e3){delete this[_0x4be6('0x25')][_0x386f27['actionid']];_0x2a57e3[_0x4be6('0x11b')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));var _0x3e1cf7=_0x2a57e3[_0x4be6('0x53')]===_0x4be6('0x82')?this['campaigns'][_0x2a57e3[_0x4be6('0xbb')]]:this[_0x4be6('0x21')][_0x2a57e3[_0x4be6('0x19a')]()];if(!this[_0x4be6('0xdb')](_0x386f27[_0x4be6('0x19b')])){this['updateOriginated'](_0x3e1cf7);return this[_0x4be6('0x19c')](_0x2a57e3,_0x3e1cf7,_0x386f27)[_0x4be6('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x4be6('0xb1')][_0x386f27[_0x4be6('0xe8')]]=_0x2a57e3;}};Dialer['prototype'][_0x4be6('0x19d')]=function(_0x28f4cc,_0x3bf8cb,_0x43ea92){var _0x4bdbc4=new History(_0x3bf8cb);if(_0x4bdbc4[_0x4be6('0xf6')]+_0x4bdbc4[_0x4be6('0xf7')]+_0x4bdbc4['countnoanswerretry']+_0x4bdbc4[_0x4be6('0xf8')]+_0x4bdbc4[_0x4be6('0xf9')]+_0x4bdbc4[_0x4be6('0xfa')]+_0x4bdbc4[_0x4be6('0xf2')]+_0x4bdbc4[_0x4be6('0xfb')]>=_0x43ea92['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x28f4cc){case 0x3:if(_0x4bdbc4[_0x4be6('0x108')]>=_0x43ea92[_0x4be6('0x19e')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countnoanswerretry':_0x4bdbc4[_0x4be6('0x108')]+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92['dialNoAnswerRetryFrequency'],_0x4be6('0x101'))[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4bdbc4[_0x4be6('0x103')],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4['CampaignId']||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x19f')));break;case 0x5:if(_0x4bdbc4['countbusyretry']>=_0x43ea92[_0x4be6('0x1a0')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countbusyretry':_0x4bdbc4[_0x4be6('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x43ea92[_0x4be6('0x1a1')],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x4bdbc4[_0x4be6('0x103')],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1a2')));break;case 0x8:if(_0x4bdbc4[_0x4be6('0xf7')]>=_0x43ea92[_0x4be6('0x1a3')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countcongestionretry':_0x4bdbc4['countcongestionretry']+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92[_0x4be6('0x1a4')],'minutes')[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x4bdbc4[_0x4be6('0x103')],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4[_0x4be6('0xda')]||undefined})['catch'](loggerCatch(_0x4be6('0x1a5')));break;case 0x0:if(_0x4bdbc4[_0x4be6('0xf8')]>=_0x43ea92['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4bdbc4['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92['dialNoSuchNumberRetryFrequency'],_0x4be6('0x101'))[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4bdbc4[_0x4be6('0x103')],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1a6')));}break;case 0xa:if(_0x4bdbc4[_0x4be6('0xf9')]>=_0x43ea92[_0x4be6('0x120')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countdropretry':_0x4bdbc4['countdropretry']+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92[_0x4be6('0x121')],'minutes')[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4bdbc4[_0x4be6('0x103')],'ListId':_0x4bdbc4['ListId'],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x4bdbc4[_0x4be6('0xfa')]>=_0x43ea92[_0x4be6('0x1a7')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countabandonedretry':_0x4bdbc4[_0x4be6('0xfa')]+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92['dialAbandonedRetryFrequency'],'minutes')[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4bdbc4['ContactId'],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4['CampaignId']||undefined})[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x12b')));break;case 0x13:if(_0x4bdbc4[_0x4be6('0xf2')]>=_0x43ea92[_0x4be6('0x10a')]-0x1){return!![];}this[_0x4be6('0xc5')]({'active':![],'countmachineretry':_0x4bdbc4['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x43ea92[_0x4be6('0x100')],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x4bdbc4['ContactId'],'ListId':_0x4bdbc4['ListId'],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4['CampaignId']||undefined})[_0x4be6('0xb8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4bdbc4[_0x4be6('0xfb')]>=_0x43ea92[_0x4be6('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4bdbc4[_0x4be6('0xfb')]+=0x1,'scheduledat':moment()[_0x4be6('0xff')](_0x43ea92['dialAgentRejectRetryFrequency'],_0x4be6('0x101'))[_0x4be6('0x80')](_0x4be6('0x102')),'ContactId':_0x4bdbc4['ContactId'],'ListId':_0x4bdbc4[_0x4be6('0x104')],'VoiceQueueId':_0x4bdbc4[_0x4be6('0xd9')]||undefined,'CampaignId':_0x4bdbc4[_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x4be6('0x1c')][_0x4be6('0x19c')]=function(_0xb7fe04,_0x10a94e,_0x48c7fa){var _0x554af1=this;var _0x59f76e=new History(_0xb7fe04);return new BPromise(function(_0x57c368,_0x597546){if(_[_0x4be6('0x40')](_0x10a94e)&&typeof _0x10a94e!==_0x4be6('0x173')){return _0x597546(msgResponse('[callProgressDetecting]',_0x4be6('0x14f'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x48c7fa)&&typeof _0x48c7fa!=='object'){return _0x597546(msgResponse(_0x4be6('0x1a9'),_0x4be6('0x14f'),_0x4be6('0x1aa')));}switch(_0x48c7fa[_0x4be6('0x111')]){case'0':_0x10a94e[_0x4be6('0x6d')]+=0x1;_0x59f76e[_0x4be6('0xae')]=0x0;_0x59f76e[_0x4be6('0xaf')]=_0x4be6('0x1ab');_0x59f76e['countnosuchnumberretry']+=0x1;_0x59f76e[_0x4be6('0xf3')]+=0x1;ami[_0x4be6('0x52')]('custom:agentnosuchnumber',ut['buildObj'](_0xb7fe04,_0x4be6('0x1ac')));_0x554af1[_0x4be6('0xd2')](_0x59f76e)['catch'](loggerCatch(_0x4be6('0xf5')));if(_0x554af1[_0x4be6('0x19d')](0x0,_0xb7fe04,_0x10a94e)){if(_0x59f76e[_0x4be6('0xf8')]>=_0x10a94e['dialNoSuchNumberMaxRetry']){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1ad'));}else{_0x554af1[_0x4be6('0x109')](_0x59f76e,_0x57c368,_0x597546,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x10a94e['outboundNoAnswerCallsDay']+=0x1;_0x59f76e[_0x4be6('0xae')]=0x3;_0x59f76e['statedesc']=_0x4be6('0x1ae');_0x59f76e[_0x4be6('0x108')]+=0x1;_0x59f76e[_0x4be6('0xf3')]+=0x1;ami[_0x4be6('0x52')](_0x4be6('0x1af'),ut['buildObj'](_0xb7fe04,_0x4be6('0x1b0')));_0x554af1[_0x4be6('0xd2')](_0x59f76e)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1b1')));if(_0x554af1[_0x4be6('0x19d')](0x3,_0xb7fe04,_0x10a94e)){if(_0x59f76e['countnoanswerretry']>=_0x10a94e[_0x4be6('0x19e')]){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,'reason\x203\x20ringing\x20no\x20answer');}else{_0x554af1['stateGlobal'](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1b2'));}}break;case'5':_0x10a94e[_0x4be6('0x1b3')]+=0x1;_0x59f76e[_0x4be6('0xae')]=0x5;_0x59f76e[_0x4be6('0xaf')]=_0x4be6('0x1b4');_0x59f76e[_0x4be6('0xf6')]+=0x1;_0x59f76e['countglobal']+=0x1;ami[_0x4be6('0x52')]('custom:agentbusy',ut['buildObj'](_0xb7fe04,'busy'));_0x554af1['createHistory'](_0x59f76e)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1b5')));if(_0x554af1[_0x4be6('0x19d')](0x5,_0xb7fe04,_0x10a94e)){if(_0x59f76e['countbusyretry']>=_0x10a94e[_0x4be6('0x1a0')]){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1b6'));}else{_0x554af1['stateGlobal'](_0x59f76e,_0x57c368,_0x597546,'reason\x205\x20busy');}}break;case'8':_0x10a94e['outboundCongestionCallsDay']+=0x1;_0x59f76e['state']=0x8;_0x59f76e[_0x4be6('0xaf')]=_0x4be6('0x1b7');_0x59f76e[_0x4be6('0xf7')]+=0x1;_0x59f76e[_0x4be6('0xf3')]+=0x1;ami['emit'](_0x4be6('0x1b8'),ut['buildObj'](_0xb7fe04,_0x4be6('0x1b9')));_0x554af1[_0x4be6('0xd2')](_0x59f76e)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1ba')));if(_0x554af1['checkRetriveMax'](0x8,_0xb7fe04,_0x10a94e)){if(_0x59f76e[_0x4be6('0xf7')]>=_0x10a94e[_0x4be6('0x1a3')]){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,'reason\x208\x20congestion');}else{_0x554af1[_0x4be6('0x109')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1bb'));}}break;case'11':_0x10a94e['outboundAbandonedCallsDay']+=0x1;_0x59f76e[_0x4be6('0xae')]=0xb;_0x59f76e[_0x4be6('0xaf')]=_0x4be6('0x128');_0x59f76e[_0x4be6('0xfa')]+=0x1;_0x59f76e[_0x4be6('0xf3')]+=0x1;_0x554af1[_0x4be6('0xd2')](_0x59f76e)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x12c')));if(_0x554af1[_0x4be6('0x19d')](0xb,_0xb7fe04,_0x10a94e)){if(_0x59f76e[_0x4be6('0xfa')]>=_0x10a94e['dialAbandonedMaxRetry']){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1bc'));}else{_0x554af1[_0x4be6('0x109')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1bc'));}}break;case'20':_0x10a94e[_0x4be6('0x1bd')]+=0x1;_0x59f76e[_0x4be6('0xae')]=0x14;_0x59f76e[_0x4be6('0xaf')]=_0x4be6('0x1be');_0x59f76e[_0x4be6('0xfb')]+=0x1;_0x59f76e['countglobal']+=0x1;ami['emit'](_0x4be6('0x1bf'),ut[_0x4be6('0xec')](_0xb7fe04,_0x4be6('0x1c0')));_0x554af1['createHistory'](_0x59f76e)[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1c1')));if(_0x554af1[_0x4be6('0x19d')](0x14,_0xb7fe04,_0x10a94e)){if(_0x59f76e[_0x4be6('0xfb')]>=_0x10a94e[_0x4be6('0x1a8')]){_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1c2'));}else{_0x554af1[_0x4be6('0x109')](_0x59f76e,_0x57c368,_0x597546,_0x4be6('0x1c2'));}}break;default:_0x10a94e[_0x4be6('0x1c3')]+=0x1;_0x59f76e[_0x4be6('0xae')]=0xc;_0x59f76e[_0x4be6('0xaf')]=_0x48c7fa['reason'];_0x554af1[_0x4be6('0xd2')](_0x59f76e)['catch'](loggerCatch(_0x4be6('0x1c4')));if(_0x554af1['checkRetriveMax'](_0x48c7fa[_0x4be6('0x111')],_0xb7fe04,_0x10a94e)){if(_0x59f76e[_0x4be6('0xf6')]+_0x59f76e['countcongestionretry']+_0x59f76e['countnoanswerretry']+_0x59f76e[_0x4be6('0xf8')]+_0x59f76e[_0x4be6('0xf9')]+_0x59f76e[_0x4be6('0xfa')]+_0x59f76e[_0x4be6('0xf2')]+_0x59f76e['countagentrejectretry']>=_0x10a94e[_0x4be6('0xfc')]){_0x554af1[_0x4be6('0x109')](_0x59f76e,_0x57c368,_0x597546,_0x48c7fa['reason']);}else{_0x554af1[_0x4be6('0xfe')](_0x59f76e,_0x57c368,_0x597546,_0x48c7fa[_0x4be6('0x111')]);}}}});};Dialer[_0x4be6('0x1c')][_0x4be6('0x109')]=function(_0x3f6896,_0x10c09f,_0x18c1b1,_0x5e2326){var _0x2895c0=new Final(_0x3f6896);_0x2895c0[_0x4be6('0xae')]=0xf;_0x2895c0[_0x4be6('0xaf')]='Global';this[_0x4be6('0xfe')](_0x2895c0,_0x10c09f,_0x18c1b1,_0x5e2326);};Dialer['prototype']['createStateFinal']=function(_0x26ebaf,_0x1d620d,_0x2972d1,_0x9e5f31){this[_0x4be6('0xd0')](_0x26ebaf)[_0x4be6('0x3e')](function(){return _0x1d620d(msgResponse('[callProgressDetecting]',_0x4be6('0xdc'),_0x9e5f31));})['catch'](function(){return _0x2972d1(msgResponse(_0x4be6('0x1c5'),_0x4be6('0x14f'),_0x4be6('0x1c6')));});};Dialer[_0x4be6('0x1c')][_0x4be6('0x9')]=function(_0x54d5ff){var _0x4fc74d=_0x54d5ff[_0x4be6('0x1c7')]/0x64;var _0x1d1c81=_0x54d5ff[_0x4be6('0x6b')]/(_0x54d5ff[_0x4be6('0x6b')]+_0x54d5ff[_0x4be6('0x67')]);var _0x1d8bed=Math['round'](_0x54d5ff[_0x4be6('0x77')]*(_0x54d5ff[_0x4be6('0x1c8')]/0x64));var _0x2cb12d=Math[_0x4be6('0x1c9')](_0x54d5ff[_0x4be6('0x77')]*(_0x54d5ff[_0x4be6('0x1ca')]/0x64));var _0x100c55=_0x54d5ff['available']+_0x54d5ff[_0x4be6('0x5c')];var _0x3b0c1f=Math[_0x4be6('0x1cb')](_0x54d5ff[_0x4be6('0x92')]*_0x54d5ff[_0x4be6('0x7a')]*_0x54d5ff[_0x4be6('0x74')]*_0x54d5ff['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x54d5ff[_0x4be6('0x29')])){if(!_['isUndefined'](_0x54d5ff[_0x4be6('0x28')])){_0x54d5ff[_0x4be6('0x28')]=undefined;loggerPredictive['error'](_0x4be6('0x1cc'),_0x4be6('0x1cd'));}if(!_[_0x4be6('0x40')](_0x54d5ff[_0x4be6('0x99')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x54d5ff[_0x4be6('0x99')]);_0x54d5ff[_0x4be6('0x99')]=undefined;}_0x54d5ff[_0x4be6('0x29')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));loggerPredictive[_0x4be6('0x85')](_0x54d5ff[_0x4be6('0x43')],_0x4be6('0x1ce'),_0x54d5ff[_0x4be6('0x29')]);this[_0x4be6('0x161')](_0x54d5ff,0x1);}else if(ifInterval(_0x54d5ff[_0x4be6('0x1cf')],_0x54d5ff[_0x4be6('0x29')])){this[_0x4be6('0x161')](_0x54d5ff,0x1);loggerPredictiveCalls[_0x4be6('0x85')](_0x4be6('0x1d0'),_0x54d5ff[_0x4be6('0x29')],_0x54d5ff[_0x4be6('0x43')]);_0x54d5ff[_0x4be6('0x92')]=0x0;_0x54d5ff[_0x4be6('0x11d')]=0x0;}else if(_0x4fc74d<_0x1d1c81&&_0x54d5ff[_0x4be6('0x1d1')]===_0x4be6('0x1d2')){freeVariablesPredictive(_0x54d5ff);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x1d3'),_0x4be6('0x1d4'),_0x1d1c81,_0x4be6('0x29'),_0x54d5ff[_0x4be6('0x43')]);}else if(_0x3b0c1f<_0x54d5ff['predictiveIntervalErlangCallsDroppedCalls']&&_0x54d5ff[_0x4be6('0x1d1')]==='dropRate'){freeVariablesPredictive(_0x54d5ff);loggerPredictive['info'](_0x4be6('0x1d5'),_0x4be6('0x1d6'),_0x3b0c1f,_0x4be6('0x1d7'),_0x54d5ff[_0x4be6('0x11d')],_0x4be6('0x29'),_0x54d5ff['name']);}else if(!ifInterval(_0x54d5ff[_0x4be6('0x1cf')],_0x54d5ff[_0x4be6('0x29')])&&_['isUndefined'](_0x54d5ff[_0x4be6('0x28')])&&!_['isUndefined'](_0x54d5ff[_0x4be6('0x29')])){_0x54d5ff[_0x4be6('0x28')]=moment()[_0x4be6('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x54d5ff[_0x4be6('0x43')],_0x4be6('0x1d8'),_0x54d5ff['startPredictive']);this[_0x4be6('0xc2')](_0x54d5ff['dialPredictiveInterval'])[_0x4be6('0x3e')](this['getDataPredictive'](_0x54d5ff))[_0x4be6('0x3e')](mergeDataErlangB(_0x54d5ff))['then'](this[_0x4be6('0x1d9')](_0x54d5ff))[_0x4be6('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x54d5ff));}else if(!ifInterval(_0x54d5ff[_0x4be6('0x1cf')],_0x54d5ff[_0x4be6('0x28')])){_0x54d5ff[_0x4be6('0x11d')]=0x0;_0x54d5ff[_0x4be6('0x28')]=moment()[_0x4be6('0x80')](_0x4be6('0x102'));loggerPredictive[_0x4be6('0x85')](_0x54d5ff['name'],_0x4be6('0x1da'),_0x54d5ff[_0x4be6('0x28')]);clearInterval(_0x54d5ff['handlePredictive']);_0x54d5ff[_0x4be6('0x99')]=undefined;this[_0x4be6('0xc2')](_0x54d5ff['dialPredictiveInterval'])[_0x4be6('0x3e')](this[_0x4be6('0x1db')](_0x54d5ff))[_0x4be6('0x3e')](mergeDataErlangB(_0x54d5ff))[_0x4be6('0x3e')](this[_0x4be6('0x1d9')](_0x54d5ff))[_0x4be6('0xb8')](loggerCatchPredictive(_0x4be6('0x1dc'),_0x54d5ff));}else if(_0x54d5ff[_0x4be6('0x77')]&&_0x100c55<_0x54d5ff[_0x4be6('0x77')]-_0x2cb12d){freeVariablesPredictive(_0x54d5ff);loggerPredictive[_0x4be6('0x85')](_0x54d5ff['name'],_0x4be6('0x1dd'),_0x100c55,_0x4be6('0x1de'),_0x54d5ff[_0x4be6('0x77')],'-',_0x2cb12d,'=',_0x54d5ff[_0x4be6('0x77')]-_0x2cb12d,')');}else if(_0x54d5ff['predictiveIntervalAvailable']&&_0x100c55>_0x54d5ff[_0x4be6('0x77')]+_0x1d8bed){freeVariablesPredictive(_0x54d5ff);loggerPredictive[_0x4be6('0x85')](_0x54d5ff[_0x4be6('0x43')],_0x4be6('0x1dd'),_0x100c55,_0x4be6('0x1df'),_0x54d5ff[_0x4be6('0x77')],'+',_0x1d8bed,'=',_0x54d5ff[_0x4be6('0x77')]+_0x1d8bed,')');}};Dialer[_0x4be6('0x1c')][_0x4be6('0x1db')]=function(_0x12efc7){var _0x2bd362=this;return function(_0x15191a){return new BPromise(function(_0x233b90,_0x280ec7){_[_0x4be6('0x96')](_0x12efc7,_0x15191a[0x0]);if(checkGetDataPredictive(_0x15191a[0x0])){var _0x1d73ef=_0x12efc7[_0x4be6('0x77')]=_0x12efc7['talking']+_0x12efc7[_0x4be6('0x56')];var _0x236a2e=_0x12efc7[_0x4be6('0x1cf')]*0x3c;var _0x3404f7=_0x15191a[0x0][_0x4be6('0x70')]+_0x15191a[0x0]['predictiveIntervalAvgHoldtime'];var _0x208833=(_0x15191a[0x0][_0x4be6('0x6e')]+_0x15191a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x15191a[0x0][_0x4be6('0x71')])/_0x15191a[0x0]['predictiveIntervalTotalCalls'];_0x12efc7[_0x4be6('0x74')]=_0x208833>0x0?_0x208833:0x1;switch(_0x12efc7[_0x4be6('0x1d1')]){case _0x4be6('0x1d2'):var _0x50b37f=_0x12efc7[_0x4be6('0x1c7')]/0x64;return _0x2bd362[_0x4be6('0x1e0')](_0x1d73ef,_0x236a2e,_0x3404f7,_0x208833,_0x50b37f)['then'](function(_0x32db77){return _0x233b90(_0x32db77);});case _0x4be6('0x1e1'):var _0x1fc704=_0x12efc7['dialPredictiveOptimizationPercentage']/0x64;return _0x2bd362[_0x4be6('0x1e2')](_0x1d73ef,_0x236a2e,_0x3404f7,_0x208833,_0x1fc704)[_0x4be6('0x3e')](function(_0x1582b3){return _0x233b90(_0x1582b3);});default:return _0x280ec7(msgResponse('[getDataPredictive]',_0x4be6('0x14f'),_0x4be6('0x1e3')));}}else{return _0x280ec7(msgResponse(_0x4be6('0x1e4'),_0x4be6('0x14f'),'check\x20failure'));}});};};Dialer['prototype'][_0x4be6('0x1e5')]=function(_0x545035){var _0x480988=this;return function(_0x4e6640){return new BPromise(function(_0x20c9dc,_0x32521f){_[_0x4be6('0x96')](_0x545035,_0x4e6640[0x0]);if(checkGetDataPredictive(_0x4e6640[0x0])){loggerPredictive[_0x4be6('0x85')](JSON[_0x4be6('0x4e')](_0x4e6640[0x0]));if(_0x545035['dialPredictiveOptimization']===_0x4be6('0x1d2')){return _0x480988[_0x4be6('0xce')](_0x545035['id'])[_0x4be6('0x3e')](function(_0xbbf457){var _0x1f0a39=_0x545035[_0x4be6('0x57')]-_0xbbf457[0x0][_0x4be6('0x1e6')];var _0x51c1b2=_0x545035[_0x4be6('0x1cf')]*0x3c;var _0x56f56a=_0x4e6640[0x0][_0x4be6('0x70')]+_0x4e6640[0x0][_0x4be6('0x6f')];var _0x4074ee=(_0x4e6640[0x0][_0x4be6('0x6e')]+_0x4e6640[0x0][_0x4be6('0x72')]+_0x4e6640[0x0][_0x4be6('0x71')])/_0x4e6640[0x0][_0x4be6('0x87')];var _0x2e8db8=_0x545035[_0x4be6('0x1c7')]/0x64;_0x545035[_0x4be6('0x76')]=_0xbbf457[0x0][_0x4be6('0x1e6')]||0x0;_0x545035[_0x4be6('0x74')]=_0x4074ee>0x0?_0x4074ee:0x1;return _0x480988[_0x4be6('0x1e0')](_0x1f0a39,_0x51c1b2,_0x56f56a,_0x4074ee,_0x2e8db8);})['then'](function(_0x50b711){return _0x20c9dc(_0x50b711);})['catch'](function(_0x28ac40){return _0x32521f(msgResponse(_0x4be6('0x1e7'),'Failure',JSON[_0x4be6('0x4e')](_0x28ac40)));});}if(_0x545035[_0x4be6('0x1d1')]==='agentBusyFactor'){return _0x480988[_0x4be6('0xce')](_0x545035['id'])[_0x4be6('0x3e')](function(_0x51594b){var _0x152444=_0x545035['loggedIn']-_0x51594b[0x0]['outboundQueuePauses'];var _0x17df6e=_0x545035[_0x4be6('0x1cf')]*0x3c;var _0x3e8eea=_0x4e6640[0x0][_0x4be6('0x70')]+_0x4e6640[0x0][_0x4be6('0x6f')];var _0x27c0ad=(_0x4e6640[0x0]['predictiveIntervalAnsweredCalls']+_0x4e6640[0x0][_0x4be6('0x72')]+_0x4e6640[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4e6640[0x0][_0x4be6('0x87')];var _0x404880=_0x545035[_0x4be6('0x1c7')]/0x64;_0x545035[_0x4be6('0x76')]=_0x51594b[0x0]['outboundQueuePauses']||0x0;_0x545035['predictiveIntervalHitRate']=_0x27c0ad>0x0?_0x27c0ad:0x1;return _0x480988[_0x4be6('0x1e2')](_0x152444,_0x17df6e,_0x3e8eea,_0x27c0ad,_0x404880);})[_0x4be6('0x3e')](function(_0x367734){return _0x20c9dc(_0x367734);})[_0x4be6('0xb8')](function(_0x48bb1f){return _0x32521f(msgResponse(_0x4be6('0x1e7'),'Failure',JSON[_0x4be6('0x4e')](_0x48bb1f)));});}}else{return _0x32521f(msgResponse(_0x4be6('0x1e4'),_0x4be6('0x14f'),_0x4be6('0x1e8')));}});};};Dialer[_0x4be6('0x1c')][_0x4be6('0x1d9')]=function(_0x15fdd6){var _0x451968=this;return function(){var _0x4343c4=0x0;var _0x362048=Math[_0x4be6('0x1cb')](_0x15fdd6[_0x4be6('0x79')]*0x3e8);if(_0x362048>0x0){_0x362048=_0x362048<0x64?0x64:_0x362048;loggerPredictive['info'](_0x15fdd6[_0x4be6('0x43')],_0x4be6('0x1e9'),_0x362048,'milliseconds');_0x15fdd6['handlePredictive']=setInterval(function(){_0x451968[_0x4be6('0x99')](_0x15fdd6);loggerPredictiveCalls[_0x4be6('0x85')](_0x4be6('0x1ea'),_0x4343c4+=0x1);},_0x362048);}else{loggerPredictive[_0x4be6('0x85')](_0x15fdd6[_0x4be6('0x43')],_0x4be6('0x1eb'));}};};Dialer[_0x4be6('0x1c')][_0x4be6('0x1ec')]=function(_0x45a4ad,_0x1faf17){var _0x423c9c=this;return function(_0x470d5a){if(_['isEmpty'](_0x470d5a)){if(_[_0x4be6('0xe1')](_0x1faf17['UserId'])||!_0x1faf17[_0x4be6('0x1ed')]){if(_0x45a4ad[_0x4be6('0x62')]===_0x4be6('0x8')){_0x45a4ad[_0x4be6('0x135')]=_[_0x4be6('0x40')](_0x45a4ad[_0x4be6('0x135')])?!![]:_0x45a4ad['queueStatusComplete'];var _0x56a0bf=uuid['v4']();_0x423c9c[_0x4be6('0x25')][_0x56a0bf]=new Action(_0x45a4ad,_0x1faf17,_0x56a0bf);loggerBooked[_0x4be6('0x85')](_0x4be6('0x1ee'),_0x56a0bf,'queueStatusComplete:\x20',JSON[_0x4be6('0x4e')](_0x45a4ad[_0x4be6('0x135')]),_0x4be6('0x1ef'),_0x45a4ad[_0x4be6('0x43')]);if(_0x45a4ad[_0x4be6('0x135')]){_0x45a4ad[_0x4be6('0x135')]=![];_0x423c9c['queueBooked'][_0x423c9c[_0x4be6('0x25')][_0x56a0bf][_0x4be6('0xbb')]]=[];ami[_0x4be6('0xb5')]({'actionid':_0x56a0bf,'action':_0x4be6('0x1f0'),'queue':_0x45a4ad[_0x4be6('0x43')]})[_0x4be6('0xb8')](function(){_0x423c9c[_0x4be6('0xba')](_0x45a4ad);_0x423c9c[_0x4be6('0xc5')]({'active':![],'ContactId':_0x423c9c['actions'][_0x56a0bf][_0x4be6('0x103')],'ListId':_0x423c9c['actions'][_0x56a0bf][_0x4be6('0x104')],'VoiceQueueId':_0x423c9c['actions'][_0x56a0bf]['VoiceQueueId']||undefined,'CampaignId':_0x423c9c[_0x4be6('0x25')][_0x56a0bf][_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x423c9c[_0x4be6('0x25')][_0x56a0bf];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x4be6('0x4e')](_0x45a4ad[_0x4be6('0x135')]),_0x4be6('0x1ef'),_0x45a4ad[_0x4be6('0x43')]);_0x423c9c['updateOriginated'](_0x45a4ad);_0x423c9c[_0x4be6('0xc5')]({'active':![],'ContactId':_0x423c9c[_0x4be6('0x25')][_0x56a0bf][_0x4be6('0x103')],'ListId':_0x423c9c[_0x4be6('0x25')][_0x56a0bf][_0x4be6('0x104')],'VoiceQueueId':_0x423c9c[_0x4be6('0x25')][_0x56a0bf]['VoiceQueueId']||undefined,'CampaignId':_0x423c9c[_0x4be6('0x25')][_0x56a0bf][_0x4be6('0xda')]||undefined})[_0x4be6('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x423c9c[_0x4be6('0x25')][_0x56a0bf];}}else{return _0x423c9c[_0x4be6('0x172')](_0x45a4ad,_0x1faf17);}}else{if(getDiff(_0x1faf17[_0x4be6('0x1f1')])<_0x45a4ad[_0x4be6('0x1f2')]*0x3c){if(_0x1faf17['Agent']&&!_0x1faf17[_0x4be6('0x167')]['voicePause']){_0x423c9c['preview']['run'](_0x1faf17['id'])[_0x4be6('0x1f')](function(){_0x423c9c[_0x4be6('0xba')](_0x45a4ad);});}else{_0x423c9c[_0x4be6('0xc7')]({'active':![]},_0x1faf17['id'],0x1)[_0x4be6('0x1f')](function(){_0x423c9c['updateOriginated'](_0x45a4ad);});}}else{_0x45a4ad[_0x4be6('0x1f3')]+=0x1;_0x423c9c[_0x4be6('0xba')](_0x45a4ad);if(_0x45a4ad['dialRecallInQueue']){_0x423c9c[_0x4be6('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1faf17[_0x4be6('0x103')],'ListId':_0x1faf17[_0x4be6('0x104')],'VoiceQueueId':_0x1faf17['VoiceQueueId']||undefined,'CampaignId':_0x1faf17['CampaignId']||undefined})[_0x4be6('0xb8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x423c9c['createHistory'](createObjHistory(_0x45a4ad,_0x1faf17,_0x4be6('0x1f4'),0x17,_0x4be6('0x1f5')))[_0x4be6('0xb8')](loggerCatch(_0x4be6('0x1f6')));}else{_0x423c9c[_0x4be6('0xd6')](createObjHistory(_0x45a4ad,_0x1faf17,'RECALLFAILEDTIMEOUT',0x16,_0x4be6('0x1f7')),_0x4be6('0x1f8'),_0x4be6('0x1f9'));}}}}else{_0x45a4ad[_0x4be6('0x68')]+=0x1;_0x423c9c[_0x4be6('0xd6')](createObjHistory(_0x45a4ad,_0x1faf17,_0x4be6('0x1fa'),0xd,_0x4be6('0x1fb')),'[Originate][historyBlacklist]',_0x4be6('0x1fc'));throw _0x4be6('0x1fd');}};};Dialer[_0x4be6('0x1c')][_0x4be6('0x1fe')]=function(_0x23cc37){var _0x55a86c=this;var _0x450af2=_0x23cc37[_0x4be6('0x1ff')]-_0x23cc37[_0x4be6('0x78')]-_0x23cc37[_0x4be6('0xca')];emitCampaignSummary(_0x23cc37);if(_0x450af2>0x0){if(_0x450af2>this[_0x4be6('0x24')]){_0x450af2=this[_0x4be6('0x24')];}_0x23cc37['temp']+=_0x450af2;this[_0x4be6('0xcc')](_0x23cc37['id'],_0x450af2,_0x23cc37[_0x4be6('0x200')],_0x23cc37)['then'](function(_0x290f68){_0x23cc37[_0x4be6('0xca')]-=_0x450af2;_0x23cc37[_0x4be6('0xca')]=_0x23cc37['temp']>0x0?_0x23cc37[_0x4be6('0xca')]:0x0;if(!checkContactEmpty(_0x290f68)){_0x23cc37[_0x4be6('0x41')]=_0x4be6('0xa7');logger[_0x4be6('0x85')]('[getContactCampaign2][Empty]'+_0x23cc37[_0x4be6('0x43')]);}else{_0x23cc37[_0x4be6('0x78')]+=_0x290f68[_0x4be6('0xa1')];_0x23cc37[_0x4be6('0x41')]='RUNNING';for(var _0x2eda07=0x0;_0x2eda07<_0x290f68['length'];_0x2eda07+=0x1){_0x23cc37['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x290f68[_0x2eda07])||_[_0x4be6('0xe1')](_0x290f68[_0x2eda07][_0x4be6('0x175')])||_[_0x4be6('0xe1')](_0x290f68[_0x2eda07][_0x4be6('0x175')]['phone'])){_0x55a86c['emptyContact'](_0x4be6('0x201'),_0x23cc37,_0x290f68[_0x2eda07]);}else{_0x55a86c[_0x4be6('0xc1')](_['pick'](_0x290f68[_0x2eda07],[_0x4be6('0xda'),_0x4be6('0x202')]))['then'](_0x55a86c['checkContactBlack'](_0x23cc37,_0x290f68[_0x2eda07]))[_0x4be6('0xb8')](_0x55a86c['loggerHandler'](_0x4be6('0x203'),_0x23cc37));}}}})[_0x4be6('0xb8')](loggerGetContactDialer(_0x4be6('0x204'),_0x23cc37,_0x450af2));}};Dialer[_0x4be6('0x1c')][_0x4be6('0x161')]=function(_0x2406be,_0x4b72b7){var _0x1e152a=this;var _0x50e52d=[];var _0x4e266c=_0x4b72b7>=0x1?_0x4b72b7:0x1;if(_0x2406be[_0x4be6('0x62')]===_0x4be6('0x8')){_0x4e266c=0x1;}var _0x7de668=Math[_0x4be6('0x1cb')](_0x2406be['available']*_0x4e266c)-_0x2406be['originated']-_0x2406be[_0x4be6('0xca')];emitVoiceQueueSummary(_0x2406be);if(_0x2406be['dialLimitQueue']>0x0){var _0xf27ab3=_0x2406be[_0x4be6('0x205')]-_0x2406be['originated']-_0x2406be[_0x4be6('0x5c')]-_0x2406be[_0x4be6('0xca')]-_0x2406be[_0x4be6('0x58')];if(_0x7de668>_0xf27ab3){_0x7de668=_0xf27ab3;}}if(_0x7de668>0x0){if(_0x2406be[_0x4be6('0x62')]===_0x4be6('0x8')){_0x7de668=0x1;}if(_0x7de668>this[_0x4be6('0x24')]){_0x7de668=this[_0x4be6('0x24')];}_0x2406be[_0x4be6('0xca')]+=_0x7de668;for(var _0x367f23 in this[_0x4be6('0x23')]){if(typeof this[_0x4be6('0x23')][_0x367f23]!==_0x4be6('0xa2')){if(this[_0x4be6('0x23')][_0x367f23][_0x4be6('0xae')]==='not_inuse'&&this[_0x4be6('0x23')][_0x367f23]['status']===_0x4be6('0xdf')){_0x50e52d[_0x4be6('0x131')](this['agents'][_0x367f23]['id']);}}}this['getContactDialer'](_0x2406be['id'],_0x50e52d,_0x7de668,_0x2406be[_0x4be6('0x200')],_0x2406be)['then'](function(_0x4b1f22){_0x2406be[_0x4be6('0xca')]-=_0x7de668;_0x2406be[_0x4be6('0xca')]=_0x2406be[_0x4be6('0xca')]>0x0?_0x2406be[_0x4be6('0xca')]:0x0;if(!checkContactEmpty(_0x4b1f22)){_0x1e152a[_0x4be6('0xbd')](_0x2406be)[_0x4be6('0x3e')](sendMessageReschedule(_0x2406be))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2406be['originated']+=_0x4b1f22[_0x4be6('0xa1')];_0x2406be['message']=_0x2406be[_0x4be6('0x62')]===_0x4be6('0x8')?_0x4be6('0x206'):_0x4be6('0x207');for(var _0x1dcce3=0x0;_0x1dcce3<_0x4b1f22[_0x4be6('0xa1')];_0x1dcce3+=0x1){if(_[_0x4be6('0xe1')](_0x4b1f22[_0x1dcce3])||_[_0x4be6('0xe1')](_0x4b1f22[_0x1dcce3]['Contact'])||_[_0x4be6('0xe1')](_0x4b1f22[_0x1dcce3][_0x4be6('0x175')]['phone'])){_0x1e152a['emptyContact']('[actionOriginate]\x20',_0x2406be,_0x4b1f22[_0x1dcce3]);}else{_0x1e152a[_0x4be6('0xbf')](_[_0x4be6('0xd7')](_0x4b1f22[_0x1dcce3],[_0x4be6('0xd9'),_0x4be6('0x202')]))[_0x4be6('0x3e')](_0x1e152a[_0x4be6('0x1ec')](_0x2406be,_0x4b1f22[_0x1dcce3]))[_0x4be6('0xb8')](_0x1e152a[_0x4be6('0xd4')]('[actionOriginate]\x20',_0x2406be));}}}})[_0x4be6('0xb8')](loggerGetContactDialer(_0x4be6('0x208'),_0x2406be,_0x7de668));}};Dialer['prototype'][_0x4be6('0x99')]=function(_0x590ced){if(_0x590ced[_0x4be6('0x205')]>0x0){var _0x18f105=_0x590ced[_0x4be6('0x205')]-_0x590ced['originated']-_0x590ced[_0x4be6('0x5c')];if(_0x18f105>0x0){this[_0x4be6('0x209')](_0x590ced);}else{loggerPredictiveCalls['info'](_0x4be6('0x20a'));}}else{this[_0x4be6('0x209')](_0x590ced);}};Dialer['prototype'][_0x4be6('0x209')]=function(_0x1fb7fb){var _0x5c2811=this;var _0x1707f6=[];_0x1fb7fb[_0x4be6('0x78')]+=0x1;for(var _0x115de6 in this['agents']){if(typeof this[_0x4be6('0x23')][_0x115de6]!==_0x4be6('0xa2')){if(this[_0x4be6('0x23')][_0x115de6]['state']===_0x4be6('0x20b')&&this['agents'][_0x115de6][_0x4be6('0xb6')]===_0x4be6('0xdf')){_0x1707f6[_0x4be6('0x131')](this[_0x4be6('0x23')][_0x115de6]['id']);}}}this['getContactDialer'](_0x1fb7fb['id'],_0x1707f6,0x1,_0x1fb7fb[_0x4be6('0x200')],_0x1fb7fb)[_0x4be6('0x3e')](function(_0x3c0fae){if(!checkContactEmpty(_0x3c0fae)){checkContactLowerLimitOriginate(_0x1fb7fb,0x1,0x0);_0x5c2811['countReScheduled'](_0x1fb7fb)[_0x4be6('0x3e')](sendMessageReschedule(_0x1fb7fb))['catch'](loggerCatch(_0x4be6('0x20c')));}else{_0x1fb7fb[_0x4be6('0x41')]=_0x4be6('0x207');if(_['isNil'](_0x3c0fae[0x0])||_[_0x4be6('0xe1')](_0x3c0fae[0x0]['Contact'])||_[_0x4be6('0xe1')](_0x3c0fae[0x0][_0x4be6('0x175')][_0x4be6('0x176')])){_0x5c2811[_0x4be6('0x20d')]('[actionOriginate]\x20',_0x1fb7fb,_0x3c0fae[0x0]);}else{_0x5c2811[_0x4be6('0xbf')](_[_0x4be6('0xd7')](_0x3c0fae[0x0],[_0x4be6('0xd9'),_0x4be6('0x202')]))[_0x4be6('0x3e')](_0x5c2811['checkContactBlack'](_0x1fb7fb,_0x3c0fae[0x0]))[_0x4be6('0xb8')](_0x5c2811[_0x4be6('0xd4')](_0x4be6('0x20e'),_0x1fb7fb));}}})['catch'](loggerGetContactDialer(_0x4be6('0x20f'),_0x1fb7fb,0x1));emitVoiceQueueSummary(_0x1fb7fb);};Dialer[_0x4be6('0x1c')]['abandonmentRate']=function(_0x11bef0,_0x2fef1c,_0x3a722c,_0x3e414e,_0x546c1f,_0x3efaad){loggerPredictive[_0x4be6('0x85')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4be6('0x85')](_0x4be6('0x210'),_0x11bef0);loggerPredictive['info'](_0x4be6('0x211'),_0x2fef1c);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x212'),_0x3a722c);loggerPredictive['info'](_0x4be6('0x213'),_0x3e414e);loggerPredictive[_0x4be6('0x85')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x546c1f);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x8c'));return new BPromise(function(_0x5c1dba,_0x294702){if(_0x11bef0<=0x0||isNaN(_0x11bef0)){return _0x294702(msgResponse(_0x4be6('0x214'),'Error',_0x4be6('0x215')+_0x11bef0));}if(_0x3a722c<=0x0||isNaN(_0x3a722c)){return _0x294702(msgResponse(_0x4be6('0x214'),_0x4be6('0x4d'),_0x4be6('0x216')+_0x3a722c));}if(_0x3e414e<=0x0||isNaN(_0x3e414e)){return _0x294702(msgResponse(_0x4be6('0x214'),'Error',_0x4be6('0x217')+_0x3e414e));}if(_0x2fef1c<=0x0||isNaN(_0x2fef1c)){return _0x294702(msgResponse(_0x4be6('0x214'),_0x4be6('0x4d'),_0x4be6('0x218')+_0x2fef1c));}if(_0x546c1f<=0x0||isNaN(_0x546c1f)){return _0x294702(msgResponse(_0x4be6('0x214'),_0x4be6('0x4d'),_0x4be6('0x219')+_0x546c1f));}_0x3efaad=_0x3efaad||0x0;var _0x3a4b5e=0x1/_0x3a722c;var _0x504e34=0x0;var _0x1ad0ee=0x0;var _0x5938b3=0x0;var _0x37ff41=0x0;for(var _0x25be6c=0x0;_0x5938b3<_0x546c1f;_0x25be6c+=0x1){_0x1ad0ee=_0x25be6c/_0x2fef1c;_0x504e34=(_0x3e414e*_0x1ad0ee+_0x3efaad)/_0x3a4b5e;_0x5938b3=erlangb(_0x504e34,_0x11bef0);_0x37ff41=_0x504e34/_0x11bef0*(0x1-erlangb(_0x504e34,_0x11bef0));}return _0x5c1dba({'erlangCalls':_0x25be6c,'erlangCallToSecond':_0x2fef1c/_0x25be6c,'erlangAbandonmentRate':_0x5938b3,'erlangBusyFactor':_0x37ff41});});};Dialer['prototype'][_0x4be6('0x1e2')]=function(_0x41823c,_0x57fd50,_0x4a073c,_0x238276,_0x3b4ec0,_0x37a6ea){loggerPredictive['info'](_0x4be6('0x21a'));loggerPredictive[_0x4be6('0x85')](_0x4be6('0x210'),_0x41823c);loggerPredictive['info'](_0x4be6('0x211'),_0x57fd50);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x212'),_0x4a073c);loggerPredictive[_0x4be6('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x238276);loggerPredictive[_0x4be6('0x85')](_0x4be6('0x21b'),_0x3b4ec0);loggerPredictive[_0x4be6('0x85')]('---------------------------');return new BPromise(function(_0x499371,_0x2eb10f){if(_0x41823c<=0x0||isNaN(_0x41823c)){return _0x2eb10f(msgResponse(_0x4be6('0x21c'),'Error',_0x4be6('0x215')+_0x41823c));}if(_0x4a073c<=0x0||isNaN(_0x4a073c)){return _0x2eb10f(msgResponse(_0x4be6('0x21c'),_0x4be6('0x4d'),_0x4be6('0x216')+_0x4a073c));}if(_0x238276<=0x0||isNaN(_0x238276)){return _0x2eb10f(msgResponse(_0x4be6('0x21c'),_0x4be6('0x4d'),'p\x20=\x20'+_0x238276));}if(_0x57fd50<=0x0||isNaN(_0x57fd50)){return _0x2eb10f(msgResponse(_0x4be6('0x21c'),'Error',_0x4be6('0x218')+_0x57fd50));}if(_0x3b4ec0<=0x0||isNaN(_0x3b4ec0)){return _0x2eb10f(msgResponse(_0x4be6('0x21c'),_0x4be6('0x4d'),_0x4be6('0x21d')+_0x3b4ec0));}_0x37a6ea=_0x37a6ea||0x0;var _0x56325b=0x1/_0x4a073c;var _0x948041=0x0;var _0x1be1bb=0x0;var _0x9004d7=0x0;var _0x48469d=0x0;for(var _0x2aae95=0x0;_0x48469d<_0x3b4ec0;_0x2aae95+=0x1){_0x1be1bb=_0x2aae95/_0x57fd50;_0x948041=(_0x238276*_0x1be1bb+_0x37a6ea)/_0x56325b;_0x9004d7=erlangb(_0x948041,_0x41823c);_0x48469d=_0x948041/_0x41823c*(0x1-erlangb(_0x948041,_0x41823c));}return _0x499371({'erlangCalls':_0x2aae95,'erlangCallToSecond':_0x57fd50/_0x2aae95,'erlangAbandonmentRate':_0x9004d7,'erlangBusyFactor':_0x48469d});});};module['exports']=Dialer; \ No newline at end of file +var _0xaf76=['Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','Trunk','active','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','ivr','string','\x22%s\x22\x20<%s>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','clearZombieChannels','[actions]','sequence','enqueue','Action','catch','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','voiceQueues','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','countdropretry','stateGlobal','add','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','cause-txt','[syncHangupIvr]','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridname','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','channel','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','iftime\x20%s,%s','true','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','throttle','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','dropRate','outboundQueuePauses','predictiveIntervalPauses','agentBusyFactor','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','emptyContact','Contact.phone','checkContactBlack','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','../rpc/cmHopper','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]'];(function(_0xfd380c,_0x1202db){var _0x24edc7=function(_0x35c5a9){while(--_0x35c5a9){_0xfd380c['push'](_0xfd380c['shift']());}};_0x24edc7(++_0x1202db);}(_0xaf76,0x1df));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x6af7('0x0'));var BPromise=require(_0x6af7('0x1'));var uuid=require(_0x6af7('0x2'));var moment=require(_0x6af7('0x3'));var rr=require('rr');var md5=require(_0x6af7('0x4'));var Redis=require(_0x6af7('0x5'));var ut=require(_0x6af7('0x6'));var config=require(_0x6af7('0x7'));var logger=require('../../../config/logger')(_0x6af7('0x8'));var loggerBooked=require(_0x6af7('0x9'))(_0x6af7('0xa'));var loggerPredictive=require(_0x6af7('0x9'))(_0x6af7('0xb'));var loggerPredictiveCalls=require(_0x6af7('0x9'))(_0x6af7('0xc'));var loggerSyncQueueSummary=require(_0x6af7('0x9'))(_0x6af7('0xd'));var ami=require('../ami');config['redis']=_[_0x6af7('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6af7('0xf')]));var cmHopper=require(_0x6af7('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require('./action');var History=require(_0x6af7('0x11'));var Final=require(_0x6af7('0x12'));var AgentComplete=require(_0x6af7('0x13'));var QueueCallerAbandon=require(_0x6af7('0x14'));var Hangup=require(_0x6af7('0x15'));var ipAgi=process[_0x6af7('0x16')]['XCALLY_IP_AGI']||_0x6af7('0x17');var strategy={'rrmemory':_0x6af7('0x18'),'roundrobin':_0x6af7('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6af7('0x1a')]['enqueue']=function(_0x4f8c36){this[_0x6af7('0x1b')]=this['tail']?this[_0x6af7('0x1b')][_0x6af7('0x1c')](_0x4f8c36):_0x4f8c36();};function Dialer(_0x419917,_0x34fdc1){this['sequence']=new Sequence();this[_0x6af7('0x1d')]=_0x34fdc1;this['voiceQueues']=_0x419917['voiceQueues'];this[_0x6af7('0x1e')]=_0x419917[_0x6af7('0x1e')];this[_0x6af7('0x1f')]=_0x419917[_0x6af7('0x1f')];this['trunks']=_0x419917[_0x6af7('0x20')];this[_0x6af7('0x21')]=config[_0x6af7('0x21')]||0x2;this['channels']={};this[_0x6af7('0x22')]={};this[_0x6af7('0x23')]={};this[_0x6af7('0x24')]={};this[_0x6af7('0x25')]={};this[_0x6af7('0x26')]={};this[_0x6af7('0x27')]={};this[_0x6af7('0x28')]={};this[_0x6af7('0x29')]={};this[_0x6af7('0x2a')]={};ami['on'](_0x6af7('0x2b'),this['syncAgentConnect'][_0x6af7('0x2c')](this));ami['on'](_0x6af7('0x2d'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x6af7('0x2e'),this['syncOriginateResponse']['bind'](this));ami['on']('agentcomplete',this[_0x6af7('0x2f')][_0x6af7('0x2c')](this));ami['on']('custom:queuesummary',this[_0x6af7('0xd')]['bind'](this));ami['on']('hangup',this[_0x6af7('0x30')][_0x6af7('0x2c')](this));ami['on'](_0x6af7('0x31'),this[_0x6af7('0x32')]['bind'](this));ami['on'](_0x6af7('0x33'),this[_0x6af7('0x34')][_0x6af7('0x2c')](this));ami['on'](_0x6af7('0x35'),this['syncQueueMember']['bind'](this));ami['on'](_0x6af7('0x36'),this['syncQueueStatusComplete'][_0x6af7('0x2c')](this));this['loopCampaigns']();this[_0x6af7('0x37')]();RpcSetting[_0x6af7('0x38')]()[_0x6af7('0x39')](function(_0x38b3af){previewRecallmeReminderInterval=_0x38b3af[_0x6af7('0x3a')];});}function isNotNull(_0x428701){return _0x428701!==null&&!_[_0x6af7('0x3b')](_0x428701);}function checkIsLoggedIn(_0x8c7212,_0x3696de){return function(){if(_0x3696de<=0x0){_0x8c7212[_0x6af7('0x3c')]=_0x6af7('0x3d');throw _0x8c7212['name']+_0x6af7('0x3e');}};}function isActive(_0x4b5ee6){return _0x4b5ee6;}function checkIsActive(_0x359e0b,_0x3cf720){return function(){if(!isActive(_0x3cf720)){_0x359e0b['message']=_0x6af7('0x3f');throw _0x359e0b[_0x6af7('0x40')]+_0x6af7('0x41');}};}function checkInterval(_0x5a26d8){return function(){if(!isNotNull(_0x5a26d8[_0x6af7('0x42')])){_0x5a26d8[_0x6af7('0x3c')]=_0x6af7('0x43');throw _0x5a26d8[_0x6af7('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5a26d8['Interval'][_0x6af7('0x44')])){_0x5a26d8[_0x6af7('0x3c')]=_0x6af7('0x43');throw _0x5a26d8['name']+_0x6af7('0x45');}if(!isNotNull(_[_0x6af7('0x46')](_0x5a26d8[_0x6af7('0x42')][_0x6af7('0x44')]))){_0x5a26d8[_0x6af7('0x3c')]=_0x6af7('0x43');throw _0x5a26d8['name']+_0x6af7('0x45');}};}function msgResponse(_0x5df056,_0xe7103d,_0x254d14){return{'action':_0x5df056,'response':_0xe7103d,'message':_0x254d14,'stack':_0x254d14};}function myreject(_0x5a2393){return function(_0x172b6e){return _0x5a2393(msgResponse(_0x6af7('0x47'),_0x6af7('0x48'),JSON[_0x6af7('0x49')](_0x172b6e)));};}function getSeconds(_0x11a1a7,_0x4fc284){var _0x3dd242=moment(_0x11a1a7)[_0x6af7('0x4a')](0x0);var _0x4f30da=moment(_0x4fc284)[_0x6af7('0x4a')](0x0);return _0x3dd242[_0x6af7('0x4b')](_0x4f30da,_0x6af7('0x4c'));}function emit(_0x5721bb,_0x4f8e2b,_0x2325d3){io['to'](_0x5721bb)['emit'](_0x4f8e2b,_0x2325d3);}function emitVoiceQueueSummary(_0x36cfbf){if(_0x36cfbf[_0x6af7('0x4d')]===_0x6af7('0x4e')){var _0x134924={'id':_0x36cfbf['id'],'name':_0x36cfbf[_0x6af7('0x40')],'strategy':_0x36cfbf[_0x6af7('0x4f')],'answered':_0x36cfbf[_0x6af7('0x50')],'available':_0x36cfbf[_0x6af7('0x51')],'loggedIn':_0x36cfbf[_0x6af7('0x52')],'pTalking':_0x36cfbf[_0x6af7('0x53')],'sumBillable':_0x36cfbf[_0x6af7('0x54')],'sumDuration':_0x36cfbf[_0x6af7('0x55')],'sumHoldTime':_0x36cfbf[_0x6af7('0x56')]||0x0,'talking':_0x36cfbf[_0x6af7('0x57')],'total':_0x36cfbf[_0x6af7('0x58')],'type':_0x36cfbf[_0x6af7('0x4d')],'unmanaged':_0x36cfbf['unmanaged'],'abandoned':_0x36cfbf[_0x6af7('0x59')],'waiting':_0x36cfbf[_0x6af7('0x5a')],'loggedInDb':_0x36cfbf['loggedInDb'],'dialActive':_0x36cfbf['dialActive'],'dialMethod':_0x36cfbf['dialMethod'],'dialOriginateCallerIdName':_0x36cfbf['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x36cfbf[_0x6af7('0x5b')],'dialOriginateTimeout':_0x36cfbf[_0x6af7('0x5c')],'dialPrefix':_0x36cfbf[_0x6af7('0x5d')],'outboundAnswerAgiCallsDay':_0x36cfbf['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x36cfbf[_0x6af7('0x5e')],'outboundBlacklistCallsDay':_0x36cfbf[_0x6af7('0x5f')],'outboundBusyCallsDay':_0x36cfbf[_0x6af7('0x60')],'outboundCongestionCallsDay':_0x36cfbf[_0x6af7('0x61')],'outboundDropCallsDayACS':_0x36cfbf[_0x6af7('0x62')],'outboundDropCallsDayCallersExit':_0x36cfbf['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x36cfbf[_0x6af7('0x63')],'outboundNoAnswerCallsDay':_0x36cfbf['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x36cfbf[_0x6af7('0x64')],'outboundOriginateFailureCallsDay':_0x36cfbf[_0x6af7('0x65')],'outboundReCallsDay':_0x36cfbf[_0x6af7('0x66')],'outboundRejectCallsDay':_0x36cfbf[_0x6af7('0x67')],'outboundUnknownCallsDay':_0x36cfbf[_0x6af7('0x68')],'predictiveIntervalAnsweredCalls':_0x36cfbf[_0x6af7('0x69')],'predictiveIntervalAvgHoldtime':_0x36cfbf[_0x6af7('0x6a')],'predictiveIntervalAvgTalktime':_0x36cfbf[_0x6af7('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x36cfbf[_0x6af7('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x36cfbf[_0x6af7('0x6d')],'predictiveIntervalErlangCalls':_0x36cfbf[_0x6af7('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x36cfbf[_0x6af7('0x6f')],'predictiveIntervalHitRate':_0x36cfbf['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x36cfbf[_0x6af7('0x70')],'predictiveIntervalPauses':_0x36cfbf['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x36cfbf[_0x6af7('0x71')],'predictiveIntervalTotalCalls':_0x36cfbf[_0x6af7('0x72')],'message':_0x36cfbf['message'],'originated':_0x36cfbf[_0x6af7('0x73')],'erlangCalls':_0x36cfbf[_0x6af7('0x74')],'erlangCallToSecond':_0x36cfbf[_0x6af7('0x75')],'erlangAbandonmentRate':_0x36cfbf['erlangAbandonmentRate'],'erlangBusyFactor':_0x36cfbf['erlangBusyFactor'],'startPredictive':_0x36cfbf['startPredictive'],'startProgressive':_0x36cfbf[_0x6af7('0x27')]};if(_0x36cfbf[_0x6af7('0x76')]){_0x134924[_0x6af7('0x76')]={'id':_0x36cfbf[_0x6af7('0x76')]['id'],'name':_0x36cfbf[_0x6af7('0x76')]['name'],'active':_0x36cfbf[_0x6af7('0x76')][_0x6af7('0x77')],'callerid':_0x36cfbf[_0x6af7('0x76')]['callerid']};}if(_0x36cfbf[_0x6af7('0x42')]){_0x134924['Interval']={'id':_0x36cfbf['Interval']['id'],'name':_0x36cfbf[_0x6af7('0x42')]['name']};}var _0x4df804=md5(JSON[_0x6af7('0x49')](_0x134924));if(_0x36cfbf[_0x6af7('0x4')]!==_0x4df804){_0x36cfbf[_0x6af7('0x4')]=_0x4df804;emit(util[_0x6af7('0x78')](_0x6af7('0x79'),_0x134924[_0x6af7('0x40')]),_0x6af7('0x7a'),_0x134924);}}}function emitCampaignSummary(_0x473d5b){if(_0x473d5b['type']==='ivr'){emit(util[_0x6af7('0x78')](_0x6af7('0x7b'),_0x473d5b[_0x6af7('0x40')]),_0x6af7('0x7c'),_0x473d5b);}}function checkGetDataPredictive(_0x1d2b2d){if(isNotNull(_0x1d2b2d)&&!_[_0x6af7('0x46')](_0x1d2b2d)){loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x7e'));loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x7f'),_0x1d2b2d['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x6af7('0x80'),_0x1d2b2d[_0x6af7('0x69')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d2b2d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x6af7('0x81'),_0x1d2b2d[_0x6af7('0x6c')]);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x82'),_0x1d2b2d['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x83'),_0x1d2b2d[_0x6af7('0x6b')]);loggerPredictive[_0x6af7('0x7d')]('---------------------------');if(_0x1d2b2d['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6af7('0x3b')](_0x1d2b2d['predictiveIntervalAvgTalktime'])&&_0x1d2b2d[_0x6af7('0x6b')]>0x0){return!![];}loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x84'));if(!_[_0x6af7('0x3b')](_0x1d2b2d[_0x6af7('0x6a')])&&_0x1d2b2d[_0x6af7('0x6a')]>0x0){return!![];}loggerPredictive['info'](_0x6af7('0x85'));}else{loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x86'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x507e63){return function(_0x2c547d){loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x87'));loggerPredictive[_0x6af7('0x7d')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c547d[_0x6af7('0x74')]);loggerPredictive[_0x6af7('0x7d')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c547d[_0x6af7('0x75')]);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x88'),_0x2c547d['erlangAbandonmentRate']);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x89'),_0x2c547d['erlangBusyFactor']);loggerPredictive['info'](_0x6af7('0x88'),_0x2c547d[_0x6af7('0x8a')]);loggerPredictive[_0x6af7('0x7d')]('---------------------------');_[_0x6af7('0x8b')](_0x507e63,_0x2c547d);};}function getDiff(_0x2c5e5a){var _0x48b2a8=moment()[_0x6af7('0x4a')](0x0);var _0x5a92a8=moment(_0x2c5e5a)[_0x6af7('0x4a')](0x0);return _0x48b2a8[_0x6af7('0x4b')](_0x5a92a8,'seconds');}function ifInterval(_0x22da4d,_0x440ae7){if(_[_0x6af7('0x3b')](_0x440ae7)){return![];}return getDiff(_0x440ae7)<_0x22da4d*0x3c;}function freeVariablesPredictive(_0x496828){if(isNotNull(_0x496828)){if(!_[_0x6af7('0x3b')](_0x496828[_0x6af7('0x27')])){_0x496828['startProgressive']=undefined;loggerPredictive[_0x6af7('0x7d')](_0x496828['name'],_0x6af7('0x8c'));}if(!_[_0x6af7('0x3b')](_0x496828[_0x6af7('0x26')])){_0x496828[_0x6af7('0x26')]=undefined;loggerPredictive[_0x6af7('0x7d')](_0x496828['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x6af7('0x3b')](_0x496828[_0x6af7('0x8d')])){clearInterval(_0x496828[_0x6af7('0x8d')]);_0x496828['handlePredictive']=undefined;loggerPredictive['info'](_0x496828[_0x6af7('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x53ef00,_0x42badb){if(_0x42badb===0x0){return 0x0;}var _0xd39338=0x1;for(var _0x269bad=0x1;_0x269bad<=_0x42badb;_0x269bad+=0x1){_0xd39338=0x1+_0xd39338*_0x269bad/_0x53ef00;}return 0x1/_0xd39338;}function isVoiceQueueOutbound(_0x556aca){return _0x556aca===_0x6af7('0x4e');}function isNotPreview(_0x4edfd8){return _0x4edfd8!==_0x6af7('0x1d');}function isCampaignIvr(_0x5a0e05){return _0x5a0e05===_0x6af7('0x8e');}function getCallerId(_0x38dda8,_0x1ee6f5,_0x202cca){if(!_[_0x6af7('0x3b')](_0x202cca)&&typeof _0x202cca===_0x6af7('0x8f')&&!_[_0x6af7('0x46')](_0x202cca)){if(!_['isUndefined'](_0x1ee6f5)&&typeof _0x1ee6f5===_0x6af7('0x8f')&&!_[_0x6af7('0x46')](_0x1ee6f5)){return util[_0x6af7('0x78')]('\x22%s\x22\x20<%s>',_0x1ee6f5,_0x202cca);}return util['format'](_0x6af7('0x90'),_0x202cca,_0x202cca);}if(!_[_0x6af7('0x3b')](_0x38dda8)&&typeof _0x38dda8===_0x6af7('0x8f')&&!_[_0x6af7('0x46')](_0x38dda8)){return _0x38dda8;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x48645d,_0x4d516a){return function(_0x4a3a04){freeVariablesPredictive(_0x4d516a);emitVoiceQueueSummary(_0x4d516a);emitCampaignSummary(_0x4d516a);loggerSyncQueueSummary[_0x6af7('0x91')](_0x48645d,util['inspect'](_0x4a3a04,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x511db7,_0x14a9f1){return function(_0x5eb2c8){loggerPredictive['error'](_0x14a9f1[_0x6af7('0x40')],_0x511db7);loggerPredictive[_0x6af7('0x91')](_0x5eb2c8[_0x6af7('0x92')]);freeVariablesPredictive(_0x14a9f1);};}function loggerCatch(_0xeb7b97){return function(_0x3703a0){logger[_0x6af7('0x91')](_0xeb7b97,util[_0x6af7('0x93')](_0x3703a0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x56f5f9){return _0x56f5f9&&!_['isUndefined'](_0x56f5f9)&&_0x56f5f9[_0x6af7('0x94')]>0x0;}function decremetOriginate(_0x475f8d){if(!_[_0x6af7('0x3b')](_0x475f8d)&&_0x475f8d!==null){if(typeof _0x475f8d[_0x6af7('0x73')]!==_0x6af7('0x95')){if(_0x475f8d[_0x6af7('0x73')]>0x0){_0x475f8d[_0x6af7('0x73')]-=0x1;}else{logger[_0x6af7('0x91')](_0x6af7('0x96'));}}}else{logger[_0x6af7('0x91')](_0x6af7('0x97'));}}function checkContactLowerLimitOriginate(_0x2d7b94,_0x363383,_0x95966){if(_0x363383>_0x95966){for(var _0x747cbe=0x0;_0x747cbe<_0x363383-_0x95966;_0x747cbe+=0x1){decremetOriginate(_0x2d7b94);}}}function loggerGetContactDialer(_0x5b9d14,_0x22814f,_0x4ad7e4){return function(_0x289936){checkContactLowerLimitOriginate(_0x22814f,_0x4ad7e4,0x0);logger[_0x6af7('0x91')](_0x5b9d14,util['inspect'](_0x289936,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1325ce){return function(_0x269a28){if(isNotNull(_0x269a28)&&isNotNull(_0x269a28[0x0])){if(_0x269a28[0x0][_0x6af7('0x98')]>0x0){_0x1325ce['message']=_0x6af7('0x99');logger[_0x6af7('0x7d')](_0x6af7('0x9a')+_0x1325ce[_0x6af7('0x40')],_0x269a28[0x0][_0x6af7('0x98')],_0x6af7('0x9b'));}else{_0x1325ce[_0x6af7('0x3c')]=_0x6af7('0x9c');logger[_0x6af7('0x7d')](_0x6af7('0x9d')+_0x1325ce[_0x6af7('0x40')]);}}};}function notSendMessagesQueue(_0xe1c28b){if(_0xe1c28b[_0x6af7('0x9e')]){freeVariablesPredictive(_0xe1c28b);if(_0xe1c28b[_0x6af7('0x73')]===0x0&&_0xe1c28b[_0x6af7('0x57')]===0x0&&_0xe1c28b['waiting']===0x0&&(_0xe1c28b[_0x6af7('0x53')]||0x0)===0x0){_0xe1c28b[_0x6af7('0x9e')]=![];_0xe1c28b[_0x6af7('0x51')]=0x0;_0xe1c28b[_0x6af7('0x3c')]=_0x6af7('0x3f');loggerSyncQueueSummary[_0x6af7('0x91')](_0x6af7('0x9f'),_0xe1c28b['name'],_0x6af7('0xa0'));}else{_0xe1c28b[_0x6af7('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x6af7('0x91')](_0x6af7('0x9f'),_0xe1c28b[_0x6af7('0x40')],_0x6af7('0xa1'));}emitVoiceQueueSummary(_0xe1c28b);}}function notSendMessagesCampaign(_0x2c350a){if(_0x2c350a[_0x6af7('0x9e')]){if(_0x2c350a[_0x6af7('0x73')]===0x0){_0x2c350a['sendMessageOneNotActive']=![];_0x2c350a[_0x6af7('0x3c')]=_0x6af7('0x3f');loggerSyncQueueSummary[_0x6af7('0x91')](_0x6af7('0xa2'),_0x2c350a[_0x6af7('0x40')],_0x6af7('0xa0'));}else{_0x2c350a[_0x6af7('0x3c')]=_0x6af7('0xa3');loggerSyncQueueSummary[_0x6af7('0x91')](_0x6af7('0xa2'),_0x2c350a[_0x6af7('0x40')],_0x6af7('0xa1'));}emitCampaignSummary(_0x2c350a);}}function createObjHistory(_0x11515a,_0x2711fc,_0x31fd21,_0x27198f,_0x4a2283){_0x11515a[_0x6af7('0x3c')]=_0x31fd21;var _0x57a2e8=new Action(_0x11515a,_0x2711fc);var _0x17c480=new History(_0x57a2e8);_0x17c480[_0x6af7('0xa4')]=_0x27198f;_0x17c480[_0x6af7('0xa5')]=_0x4a2283;_0x17c480['endtime']=_0x57a2e8['starttime'];return _0x17c480;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x34295a=this;setInterval(function(){_0x34295a['clearZombieChannels'](_0x34295a['uniqueId'],'[uniqueid]');_0x34295a[_0x6af7('0xa6')](_0x34295a[_0x6af7('0x22')],_0x6af7('0xa7'));},0x32c8);};Dialer[_0x6af7('0x1a')][_0x6af7('0xa6')]=function(_0x16d502,_0x265ea4){var _0x1b1240=this;for(var _0x396ec5 in _0x16d502){if(typeof _0x16d502[_0x396ec5]!==_0x6af7('0x95')){this[_0x6af7('0xa8')][_0x6af7('0xa9')](function(){if(!_['isNil'](_0x16d502[_0x396ec5])){return ami[_0x6af7('0xaa')]({'action':'status','channel':_0x16d502[_0x396ec5]['channel']})[_0x6af7('0xab')](function(_0x3f0f18){if(_0x3f0f18[_0x6af7('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x16d502[_0x396ec5]&&_0x16d502[_0x396ec5]['type']!==_0x6af7('0x8e')){_0x1b1240['updateOriginated'](_0x1b1240['voiceQueues'][_0x16d502[_0x396ec5]['queue']]);logger['error'](_0x6af7('0xac'),_0x265ea4,_0x396ec5,_0x16d502[_0x396ec5][_0x6af7('0xad')]);delete _0x16d502[_0x396ec5];}if(_0x16d502[_0x396ec5]&&_0x16d502[_0x396ec5][_0x6af7('0x4d')]==='ivr'){_0x1b1240['updateOriginated'](_0x1b1240[_0x6af7('0x1e')][_0x16d502[_0x396ec5][_0x6af7('0xad')]]);logger['error'](_0x6af7('0xae'),_0x265ea4,_0x396ec5,_0x16d502[_0x396ec5][_0x6af7('0xad')]);delete _0x16d502[_0x396ec5];}},0x2328);}});}});}}};Dialer[_0x6af7('0x1a')][_0x6af7('0xaf')]=function(_0x506213){return BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](cmHopper[_0x6af7('0xaf')](_0x506213))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xb1')));};Dialer[_0x6af7('0x1a')][_0x6af7('0xb2')]=function(_0x3db3f5){return BPromise['resolve']()[_0x6af7('0x39')](cmHopperBlack[_0x6af7('0xb2')](_0x3db3f5))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xb3')));};Dialer['prototype'][_0x6af7('0xb4')]=function(_0x10dc49){return BPromise['resolve']()[_0x6af7('0x39')](cmHopperBlack['checkIsBlackListIvr'](_0x10dc49))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xb5')));};Dialer['prototype']['averageHandleTime']=function(_0x3818b7){return BPromise['resolve']()[_0x6af7('0x39')](cmHopperHistory[_0x6af7('0xb6')](_0x3818b7))[_0x6af7('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x6af7('0x1a')]['rescheduleContact']=function(_0x3338af){return BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](cmHopper[_0x6af7('0xb7')](_0x3338af))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xb8')));};Dialer[_0x6af7('0x1a')][_0x6af7('0xb9')]=function(_0x34ad5d,_0x126ce3,_0xf8b7e9){return BPromise['resolve']()[_0x6af7('0x39')](cmHopper[_0x6af7('0xb9')](_0x34ad5d,_0x126ce3,_0xf8b7e9))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xba')));};Dialer['prototype']['getContactDialer']=function(_0x5d88e3,_0x2d0bc1,_0x22c082,_0x700e32,_0x11648d){return BPromise['resolve']()[_0x6af7('0x39')](cmHopper[_0x6af7('0xbb')](_0x5d88e3,_0x2d0bc1,_0x22c082,_0x700e32))[_0x6af7('0xab')](function(_0x323846){_0x11648d['temp']-=_0x22c082;_0x11648d[_0x6af7('0xbc')]=_0x11648d['temp']>0x0?_0x11648d['temp']:0x0;loggerCatch(_0x6af7('0xbd'))(_0x323846);});};Dialer[_0x6af7('0x1a')][_0x6af7('0xbe')]=function(_0x233019,_0x539dd9,_0x25d1a9,_0x156bf8){return BPromise['resolve']()[_0x6af7('0x39')](cmHopper[_0x6af7('0xbe')](_0x233019,_0x539dd9,_0x25d1a9))[_0x6af7('0xab')](function(_0x41028c){_0x156bf8['temp']-=_0x539dd9;_0x156bf8[_0x6af7('0xbc')]=_0x156bf8['temp']>0x0?_0x156bf8[_0x6af7('0xbc')]:0x0;loggerCatch(_0x6af7('0xbf'))(_0x41028c);});};Dialer[_0x6af7('0x1a')][_0x6af7('0xc0')]=function(_0x33338a){return BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](voiceQueueRt[_0x6af7('0xc0')](_0x33338a))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xc1')));};Dialer[_0x6af7('0x1a')]['moveContactManagedDialer']=function(_0x3a8aa2){return BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](cmHopper[_0x6af7('0xc2')](_0x3a8aa2))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xc3')));};Dialer[_0x6af7('0x1a')][_0x6af7('0xc4')]=function(_0x213e63){return BPromise['resolve']()[_0x6af7('0x39')](cmHopperHistory[_0x6af7('0xc4')](_0x213e63))[_0x6af7('0xab')](loggerCatch(_0x6af7('0xc5')));};Dialer['prototype'][_0x6af7('0xc6')]=function(_0x244620){if(!_[_0x6af7('0x3b')](_0x244620)&&_0x244620!==null){if(typeof _0x244620[_0x6af7('0x73')]!==_0x6af7('0x95')){if(_0x244620['originated']>0x0){_0x244620[_0x6af7('0x73')]-=0x1;}else{logger[_0x6af7('0x91')](_0x6af7('0xc7'));}}}else{logger[_0x6af7('0x91')](_0x6af7('0xc8'));}};Dialer[_0x6af7('0x1a')][_0x6af7('0xc9')]=function(_0x2ac192,_0x57cb13){var _0x552623=this;return function(_0x25cdb8){_0x552623['updateOriginated'](_0x57cb13);logger[_0x6af7('0x91')](_0x2ac192,util[_0x6af7('0x93')](_0x25cdb8,{'showHidden':![],'depth':null}));};};Dialer[_0x6af7('0x1a')]['emptyContact']=function(_0x45cf52,_0x3d04e1,_0x517b23){var _0x5a26e8={'state':0x19,'statedesc':_0x6af7('0xca')};this['updateOriginated'](_0x3d04e1);this[_0x6af7('0xcb')](_[_0x6af7('0x8b')](_0x5a26e8,_[_0x6af7('0xcc')](_0x517b23,[_0x6af7('0xcd'),_0x6af7('0xce'),_0x6af7('0xcf'),_0x6af7('0xd0'),_0x6af7('0xd1')])),_0x6af7('0xd2'),_0x6af7('0xd3'));logger[_0x6af7('0x91')](_0x45cf52);};Dialer['prototype'][_0x6af7('0xd4')]=function(_0x2a13fb){return _0x2a13fb==='Success';};Dialer[_0x6af7('0x1a')][_0x6af7('0xd5')]=function(_0x3d2aac){return!_[_0x6af7('0x3b')](_0x3d2aac)&&_0x3d2aac&&!_['isUndefined'](_0x3d2aac[_0x6af7('0x40')])&&!_[_0x6af7('0x3b')](_0x3d2aac['active'])&&_0x3d2aac[_0x6af7('0x77')]&&(this[_0x6af7('0x20')][util['format'](_0x6af7('0xd6'),_0x3d2aac[_0x6af7('0x40')])][_0x6af7('0xd7')]===_0x6af7('0xd8')||this[_0x6af7('0x20')][util['format'](_0x6af7('0xd6'),_0x3d2aac['name'])]['status']===_0x6af7('0xd9'));};Dialer[_0x6af7('0x1a')][_0x6af7('0xcb')]=function(_0xf32a13,_0x6758b8,_0x2a6bd2){this[_0x6af7('0xc4')](_0xf32a13)[_0x6af7('0xab')](loggerCatch(_0x6758b8));this[_0x6af7('0xc2')](_0xf32a13)[_0x6af7('0xab')](loggerCatch(_0x2a6bd2));};Dialer[_0x6af7('0x1a')][_0x6af7('0x34')]=function(_0x207ecf){var _0x264136=this[_0x6af7('0x24')][_0x207ecf[_0x6af7('0xda')]];var _0x2e12b8;if(!_[_0x6af7('0xdb')](_0x207ecf)&&!_[_0x6af7('0xdb')](_0x207ecf[_0x6af7('0xdc')])&&!_[_0x6af7('0xdb')](_0x207ecf['variable'][_0x6af7('0xdd')])&&_0x207ecf[_0x6af7('0xde')]===_0x6af7('0xdf')&&_0x264136){if(_0x264136[_0x6af7('0x4d')]!==_0x6af7('0x8e')&&this['voiceQueues'][_0x264136[_0x6af7('0xad')]][_0x6af7('0xe0')]&&_0x207ecf[_0x6af7('0xe1')]==='HANGUP'){delete this[_0x6af7('0x24')][_0x207ecf['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x264136[_0x6af7('0xad')]]);this[_0x6af7('0xe2')][_0x264136[_0x6af7('0xad')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x264136[_0x6af7('0xad')]][_0x6af7('0xe3')]+=0x1;_0x2e12b8=new Hangup(_0x264136,_0x207ecf);_0x2e12b8[_0x6af7('0xa4')]=0x12;_0x2e12b8[_0x6af7('0xa5')]='HangupInAMD';_0x2e12b8[_0x6af7('0xe4')]=_0x6af7('0xe5');ami[_0x6af7('0xe6')](_0x6af7('0xe7'),ut['buildObj'](_0x2e12b8,_0x6af7('0xe8')));this[_0x6af7('0xcb')](_0x2e12b8,_0x6af7('0xe9'),_0x6af7('0xea'));}if(_0x264136[_0x6af7('0x4d')]!=='ivr'&&this['voiceQueues'][_0x264136[_0x6af7('0xad')]][_0x6af7('0xe0')]&&_0x207ecf['value']===_0x6af7('0xeb')){var _0x18173c=this;return new BPromise(function(_0x74858c,_0x4b1acb){delete _0x18173c[_0x6af7('0x24')][_0x207ecf[_0x6af7('0xda')]];_0x18173c[_0x6af7('0xc6')](_0x18173c[_0x6af7('0xe2')][_0x264136[_0x6af7('0xad')]]);_0x18173c[_0x6af7('0xe2')][_0x264136[_0x6af7('0xad')]][_0x6af7('0x5e')]+=0x1;_0x18173c['voiceQueues'][_0x264136['queue']][_0x6af7('0xe3')]+=0x1;var _0x29d57a=_0x18173c[_0x6af7('0xe2')][_0x264136[_0x6af7('0xad')]];var _0x25ba63=new Hangup(_0x264136,_0x207ecf);_0x25ba63[_0x6af7('0xa4')]=0x13;_0x25ba63[_0x6af7('0xa5')]=_0x6af7('0xec');_0x25ba63[_0x6af7('0xe4')]=_0x6af7('0xe5');_0x25ba63[_0x6af7('0xed')]+=0x1;_0x25ba63[_0x6af7('0xee')]+=0x1;_0x25ba63[_0x6af7('0xe8')]=!![];ami[_0x6af7('0xe6')]('custom:amd',ut[_0x6af7('0xef')](_0x25ba63,_0x6af7('0xe8')));_0x18173c[_0x6af7('0xc4')](_0x25ba63)[_0x6af7('0xab')](loggerCatch(_0x6af7('0xf0')));if(_0x25ba63[_0x6af7('0xf1')]+_0x25ba63[_0x6af7('0xf2')]+_0x25ba63['countnoanswerretry']+_0x25ba63[_0x6af7('0xf3')]+_0x25ba63['countdropretry']+_0x25ba63[_0x6af7('0xf4')]+_0x25ba63[_0x6af7('0xed')]+_0x25ba63[_0x6af7('0xf5')]>=_0x29d57a[_0x6af7('0xf6')]){_0x18173c['stateGlobal'](_0x25ba63,_0x74858c,_0x4b1acb,_0x6af7('0xf7'));}else{if(_0x25ba63['countmachineretry']>=_0x29d57a[_0x6af7('0xf8')]){_0x18173c[_0x6af7('0xf9')](_0x25ba63,_0x74858c,_0x4b1acb,_0x6af7('0xfa'));}else{_0x18173c[_0x6af7('0xb7')]({'active':![],'countmachineretry':_0x25ba63[_0x6af7('0xed')],'scheduledat':moment()['add'](_0x29d57a[_0x6af7('0xfb')],_0x6af7('0xfc'))[_0x6af7('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x25ba63[_0x6af7('0xcd')],'ListId':_0x25ba63[_0x6af7('0xce')],'VoiceQueueId':_0x25ba63[_0x6af7('0xd0')]||undefined,'CampaignId':_0x25ba63['CampaignId']||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0xfd')));_0x74858c({'reschedule':0x1});}}});}if(_0x264136['type']===_0x6af7('0x8e')&&this[_0x6af7('0x1e')][_0x264136[_0x6af7('0xad')]][_0x6af7('0xe0')]&&_0x207ecf[_0x6af7('0xe1')]===_0x6af7('0xfe')){delete this[_0x6af7('0x24')][_0x207ecf[_0x6af7('0xda')]];this[_0x6af7('0xc6')](this[_0x6af7('0x1e')][_0x264136[_0x6af7('0xad')]]);_0x2e12b8=new Hangup(_0x264136,_0x207ecf);_0x2e12b8[_0x6af7('0xa4')]=0x12;_0x2e12b8[_0x6af7('0xa5')]=_0x6af7('0xff');_0x2e12b8[_0x6af7('0xe4')]='AMD';ami[_0x6af7('0xe6')]('custom:amd',ut[_0x6af7('0xef')](_0x2e12b8,_0x6af7('0xe8')));this[_0x6af7('0xcb')](_0x2e12b8,_0x6af7('0x100'),_0x6af7('0x101'));}if(_0x264136[_0x6af7('0x4d')]===_0x6af7('0x8e')&&this['campaigns'][_0x264136[_0x6af7('0xad')]][_0x6af7('0xe0')]&&_0x207ecf['value']===_0x6af7('0xeb')){var _0x18173c=this;return new BPromise(function(_0x2367ec,_0x443f97){delete _0x18173c['uniqueId'][_0x207ecf[_0x6af7('0xda')]];_0x18173c[_0x6af7('0xc6')](_0x18173c[_0x6af7('0x1e')][_0x264136[_0x6af7('0xad')]]);_0x18173c[_0x6af7('0x1e')][_0x264136['queue']][_0x6af7('0x5e')]+=0x1;_0x18173c[_0x6af7('0x1e')][_0x264136[_0x6af7('0xad')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x7b59d9=_0x18173c[_0x6af7('0x1e')][_0x264136[_0x6af7('0xad')]];var _0x58502c=new Hangup(_0x264136,_0x207ecf);_0x58502c['state']=0x13;_0x58502c[_0x6af7('0xa5')]=_0x6af7('0xec');_0x58502c['membername']=_0x6af7('0xe5');_0x58502c[_0x6af7('0xed')]+=0x1;_0x58502c[_0x6af7('0xee')]+=0x1;_0x58502c[_0x6af7('0xe8')]=!![];ami[_0x6af7('0xe6')]('custom:amd',ut[_0x6af7('0xef')](_0x58502c,_0x6af7('0xe8')));_0x18173c[_0x6af7('0xc4')](_0x58502c)[_0x6af7('0xab')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x58502c[_0x6af7('0xf1')]+_0x58502c[_0x6af7('0xf2')]+_0x58502c[_0x6af7('0x102')]+_0x58502c[_0x6af7('0xf3')]+_0x58502c[_0x6af7('0x103')]+_0x58502c['countabandonedretry']+_0x58502c[_0x6af7('0xed')]+_0x58502c[_0x6af7('0xf5')]>=_0x7b59d9['dialGlobalMaxRetry']){_0x18173c[_0x6af7('0x104')](_0x58502c,_0x2367ec,_0x443f97,_0x6af7('0xf7'));}else{if(_0x58502c[_0x6af7('0xed')]>=_0x7b59d9[_0x6af7('0xf8')]){_0x18173c[_0x6af7('0xf9')](_0x58502c,_0x2367ec,_0x443f97,_0x6af7('0xfa'));}else{_0x18173c[_0x6af7('0xb7')]({'active':![],'countmachineretry':_0x58502c[_0x6af7('0xed')],'scheduledat':moment()[_0x6af7('0x105')](_0x7b59d9[_0x6af7('0xfb')],_0x6af7('0xfc'))[_0x6af7('0x78')](_0x6af7('0x106')),'ContactId':_0x58502c[_0x6af7('0xcd')],'ListId':_0x58502c[_0x6af7('0xce')],'VoiceQueueId':_0x58502c['VoiceQueueId']||undefined,'CampaignId':_0x58502c[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch('[rescheduleContact][Machine]'));_0x2367ec({'reschedule':0x1});}}});}}};Dialer[_0x6af7('0x1a')][_0x6af7('0x30')]=function(_0x17f717){var _0x5d6319=this[_0x6af7('0x24')][_0x17f717['uniqueid']];var _0x4d0971=this;var _0x4bc265;if(_0x5d6319&&_0x5d6319['type']===_0x6af7('0x8e')){delete this[_0x6af7('0x24')][_0x17f717[_0x6af7('0xda')]];this[_0x6af7('0xc6')](this[_0x6af7('0x1e')][_0x5d6319[_0x6af7('0xad')]]);this[_0x6af7('0x1e')][_0x5d6319[_0x6af7('0xad')]]['ivrAnswerCallsDay']+=0x1;_0x4bc265=new Hangup(_0x5d6319,_0x17f717);this['createHistory'](_0x4bc265)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x107')));this[_0x6af7('0xc2')](_0x4bc265)[_0x6af7('0xab')](loggerCatch('[syncHangupIvr]'));}if(_0x5d6319&&_0x5d6319[_0x6af7('0x4d')]!==_0x6af7('0x8e')&&isNotNull(this[_0x6af7('0xe2')][_0x5d6319['queue']][_0x6af7('0x108')])){delete this[_0x6af7('0x24')][_0x17f717[_0x6af7('0xda')]];this[_0x6af7('0xc6')](this[_0x6af7('0xe2')][_0x5d6319[_0x6af7('0xad')]]);this[_0x6af7('0xe2')][_0x5d6319[_0x6af7('0xad')]][_0x6af7('0x5e')]+=0x1;this[_0x6af7('0xe2')][_0x5d6319[_0x6af7('0xad')]][_0x6af7('0xe3')]+=0x1;_0x4bc265=new Hangup(_0x5d6319,_0x17f717);_0x4bc265['state']=0x10;_0x4bc265[_0x6af7('0xa5')]=_0x6af7('0x109');_0x4bc265[_0x6af7('0xe4')]=_0x6af7('0x10a');this[_0x6af7('0xc4')](_0x4bc265)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x107')));this[_0x6af7('0xc2')](_0x4bc265)[_0x6af7('0xab')](loggerCatch('[syncHangupIvr]'));}if(_0x5d6319&&_0x5d6319[_0x6af7('0x4d')]!==_0x6af7('0x8e')&&!isNotNull(this[_0x6af7('0xe2')][_0x5d6319[_0x6af7('0xad')]][_0x6af7('0x108')])){delete this['uniqueId'][_0x17f717[_0x6af7('0xda')]];this[_0x6af7('0xc6')](this['voiceQueues'][_0x5d6319[_0x6af7('0xad')]]);this[_0x6af7('0xe2')][_0x5d6319[_0x6af7('0xad')]][_0x6af7('0x68')]+=0x1;_0x4bc265=new Hangup(_0x5d6319,_0x17f717);_0x4bc265['state']=0xc;_0x4bc265[_0x6af7('0xa5')]=_0x17f717[_0x6af7('0x10b')];_0x4bc265[_0x6af7('0xe4')]='Unknow';this[_0x6af7('0xc4')](_0x4bc265)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x6af7('0xc2')](_0x4bc265)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x10c')));}};Dialer[_0x6af7('0x1a')]['syncAgentComplete']=function(_0x4eba65){var _0x4a94f7=this[_0x6af7('0x24')][_0x4eba65[_0x6af7('0xda')]];var _0xd729fc=this;if(this['voiceQueues'][_0x4eba65['queue']]){if(_0x4a94f7&&_0x4a94f7[_0x6af7('0x4d')]!=='ivr'){delete this[_0x6af7('0x24')][_0x4eba65[_0x6af7('0xda')]];this[_0x6af7('0xe2')][_0x4eba65['queue']][_0x6af7('0x5e')]+=0x1;var _0x2928e8=new AgentComplete(_0x4a94f7,_0x4eba65);if(_0x4eba65[_0x6af7('0x10d')]==='agent'){_0x2928e8[_0x6af7('0x10e')]=this['voiceQueues'][_0x4eba65[_0x6af7('0xad')]]['dialQueueProject2']&&this[_0x6af7('0xe2')][_0x4eba65['queue']][_0x6af7('0x10f')]?moment()['format'](_0x6af7('0x106')):undefined;}this[_0x6af7('0xc4')](_0x2928e8)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x110')));this[_0x6af7('0xc2')](_0x2928e8)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x111')));}}};Dialer[_0x6af7('0x1a')][_0x6af7('0x112')]=function(_0x3bf9c5){if(this[_0x6af7('0xe2')][_0x3bf9c5[_0x6af7('0xad')]]){if(this[_0x6af7('0x24')][_0x3bf9c5[_0x6af7('0xda')]]&&this[_0x6af7('0x24')][_0x3bf9c5[_0x6af7('0xda')]]['type']!=='ivr'){this[_0x6af7('0xc6')](this[_0x6af7('0xe2')][_0x3bf9c5['queue']]);this[_0x6af7('0x24')][_0x3bf9c5[_0x6af7('0xda')]][_0x6af7('0x113')]=moment()[_0x6af7('0x78')](_0x6af7('0x106'));}}};Dialer[_0x6af7('0x1a')][_0x6af7('0x114')]=function(_0x15b319){this[_0x6af7('0xc4')](_0x15b319)['catch'](loggerCatch(_0x6af7('0x110')));this[_0x6af7('0xc2')](_0x15b319)['catch'](loggerCatch(_0x6af7('0x115')));};Dialer[_0x6af7('0x1a')][_0x6af7('0x116')]=function(_0x348d48){var _0x21525a=this[_0x6af7('0x24')][_0x348d48[_0x6af7('0xda')]];var _0x46649d=this;if(this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]]){if(_0x21525a&&_0x21525a[_0x6af7('0x4d')]!=='ivr'){delete this[_0x6af7('0x24')][_0x348d48[_0x6af7('0xda')]];this[_0x6af7('0xc6')](this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]]);_0x21525a[_0x6af7('0x117')]=moment()[_0x6af7('0x78')](_0x6af7('0x106'));var _0x30ecbe=new QueueCallerAbandon(_0x21525a,_0x348d48);if(getSeconds(_0x21525a[_0x6af7('0x117')],_0x21525a[_0x6af7('0x118')])>=_0x21525a[_0x6af7('0x119')]){this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x6d')]+=0x1;this['voiceQueues'][_0x348d48['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x6af7('0xe2')][_0x348d48['queue']][_0x6af7('0x6f')]+=0x1;_0x30ecbe[_0x6af7('0xa4')]=0xa;_0x30ecbe['statedesc']=_0x6af7('0x11a');_0x30ecbe[_0x6af7('0x11b')]=_0x6af7('0x11c');_0x30ecbe['agiafterat']=this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x11d')]?moment()['format'](_0x6af7('0x106')):undefined;_0x30ecbe['countdropretry']+=0x1;_0x30ecbe[_0x6af7('0xee')]+=0x1;if(_0x30ecbe[_0x6af7('0x103')]>=this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x11e')]){this[_0x6af7('0x114')](_0x30ecbe);}else{this[_0x6af7('0xb7')]({'active':![],'countdropretry':_0x30ecbe['countdropretry'],'scheduledat':moment()[_0x6af7('0x105')](this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]]['dialDropRetryFrequency'],'minutes')['format'](_0x6af7('0x106')),'ContactId':_0x21525a[_0x6af7('0xcd')],'ListId':_0x21525a[_0x6af7('0xce')],'VoiceQueueId':_0x21525a[_0x6af7('0xd0')]||undefined,'CampaignId':_0x21525a['CampaignId']||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x11f')));var _0x79d9c9=new History(_0x30ecbe);_0x79d9c9['state']=0xa;_0x79d9c9[_0x6af7('0xa5')]='Drop';_0x79d9c9[_0x6af7('0x120')]=moment()[_0x6af7('0x78')](_0x6af7('0x106'));_0x79d9c9['endtime']=_0x79d9c9[_0x6af7('0x120')];_0x79d9c9[_0x6af7('0x121')]=_0x30ecbe['calleridname'];_0x79d9c9['calleridnum']=_0x30ecbe['calleridnum'];this['createHistory'](_0x79d9c9)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x122')));}}else{this['voiceQueues'][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x6c')]+=0x1;this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x123')]+=0x1;_0x30ecbe[_0x6af7('0xa4')]=0xb;_0x30ecbe[_0x6af7('0xa5')]=_0x6af7('0x124');_0x30ecbe['dropreason']=_0x6af7('0x125');_0x30ecbe[_0x6af7('0xf4')]+=0x1;_0x30ecbe['countglobal']+=0x1;if(_0x30ecbe[_0x6af7('0xf4')]>=this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x126')]){this[_0x6af7('0x114')](_0x30ecbe);}else{this[_0x6af7('0xb7')]({'active':![],'countabandonedretry':_0x30ecbe['countabandonedretry'],'scheduledat':moment()[_0x6af7('0x105')](this[_0x6af7('0xe2')][_0x348d48[_0x6af7('0xad')]][_0x6af7('0x127')],_0x6af7('0xfc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21525a[_0x6af7('0xcd')],'ListId':_0x21525a['ListId'],'VoiceQueueId':_0x21525a[_0x6af7('0xd0')]||undefined,'CampaignId':_0x21525a[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x128')));var _0x79d9c9=new History(_0x30ecbe);_0x79d9c9['state']=0xb;_0x79d9c9[_0x6af7('0xa5')]='Abandoned';_0x79d9c9['starttime']=moment()[_0x6af7('0x78')](_0x6af7('0x106'));_0x79d9c9['endtime']=_0x79d9c9['starttime'];_0x79d9c9[_0x6af7('0x121')]=_0x30ecbe['calleridname'];_0x79d9c9[_0x6af7('0x129')]=_0x30ecbe['calleridnum'];this['createHistory'](_0x79d9c9)['catch'](loggerCatch(_0x6af7('0x12a')));}}}}};Dialer[_0x6af7('0x1a')][_0x6af7('0x32')]=function(_0x52db64){if(this[_0x6af7('0x22')][_0x52db64[_0x6af7('0xda')]]){this[_0x6af7('0x22')][_0x52db64[_0x6af7('0xda')]][_0x6af7('0x12b')]=_0x52db64[_0x6af7('0x12b')];}if(this['uniqueId'][_0x52db64[_0x6af7('0xda')]]){this['uniqueId'][_0x52db64[_0x6af7('0xda')]][_0x6af7('0x12b')]=_0x52db64[_0x6af7('0x12b')];}};Dialer[_0x6af7('0x1a')]['syncQueueMember']=function(_0xf4145){if(strategy[this[_0x6af7('0xe2')][this['actions'][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0xad')]]['strategy']]==='roundrobin'){if(this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]]&&_[_0x6af7('0xdb')](this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0x12d')])&&_0xf4145[_0x6af7('0xd7')]==='1'&&_0xf4145['paused']==='0'){if(this[_0x6af7('0x1f')][_0xf4145[_0x6af7('0x12e')]]){if(!this[_0x6af7('0x1f')][_0xf4145[_0x6af7('0x12e')]][_0x6af7('0x12d')]){this[_0x6af7('0x1f')][_0xf4145[_0x6af7('0x12e')]][_0x6af7('0x12d')]=!![];this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0x12d')]=!![];this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0x12e')]=_0xf4145[_0x6af7('0x12e')];}}}}else if((strategy[this[_0x6af7('0xe2')][this['actions'][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0xad')]][_0x6af7('0x4f')]]||_0x6af7('0x18'))===_0x6af7('0x18')){if(this['actions'][_0xf4145[_0x6af7('0x12c')]]){if(this[_0x6af7('0x1f')][_0xf4145[_0x6af7('0x12e')]]){this[_0x6af7('0x22')][_0xf4145['actionid']]['stateinterface']=_0xf4145[_0x6af7('0x12e')];if(_[_0x6af7('0xdb')](this['queueBooked'][this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0xad')]])){this[_0x6af7('0x29')][this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0xad')]]=[];}this[_0x6af7('0x29')][this[_0x6af7('0x22')][_0xf4145[_0x6af7('0x12c')]][_0x6af7('0xad')]][_0x6af7('0x12f')](_[_0x6af7('0x8b')](_[_0x6af7('0xcc')](this['actions'][_0xf4145[_0x6af7('0x12c')]],[_0x6af7('0x130'),_0x6af7('0x12e')]),{'status':_0xf4145[_0x6af7('0xd7')],'paused':_0xf4145[_0x6af7('0x131')]}));}}}};function unlockQueueStatus(_0x53d120,_0x11f65f){setTimeout(function(){if(_[_0x6af7('0x3b')](_0x53d120[_0x6af7('0x132')])){loggerBooked[_0x6af7('0x91')](_0x6af7('0x133'),_0x11f65f);}_0x53d120[_0x6af7('0x132')]=!![];loggerBooked[_0x6af7('0x7d')]('[booked][unlockQueueStatus]',_0x11f65f,JSON[_0x6af7('0x49')](_[_0x6af7('0xcc')](_0x53d120,[_0x6af7('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0x6af7('0x134')]=function(_0x3e227b){var _0x4b1950=this;var _0x47c666=_0x4b1950[_0x6af7('0xe2')][_0x4b1950[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]['queue']];if(strategy[this['voiceQueues'][this[_0x6af7('0x22')][_0x3e227b['actionid']][_0x6af7('0xad')]][_0x6af7('0x4f')]]==='roundrobin'){if(this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]&&this['actions'][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0x12e')]){this[_0x6af7('0x1d')][_0x6af7('0x135')](this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0x130')],this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]['stateinterface'])[_0x6af7('0xab')](function(_0x36523c){logger[_0x6af7('0x91')](_0x6af7('0x136'),util['inspect'](_0x36523c,{'showHidden':![],'depth':null}));})[_0x6af7('0x1c')](function(){_0x4b1950[_0x6af7('0xc6')](_0x4b1950[_0x6af7('0xe2')][_0x4b1950[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]]);_0x4b1950[_0x6af7('0x1f')][_0x4b1950[_0x6af7('0x22')][_0x3e227b['actionid']]['stateinterface']][_0x6af7('0x12d')]=![];delete _0x4b1950['actions'][_0x3e227b[_0x6af7('0x12c')]];unlockQueueStatus(_0x47c666);});}else{this[_0x6af7('0xc6')](this['voiceQueues'][this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]]);this[_0x6af7('0xb7')]({'active':![],'ContactId':this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xcd')],'ListId':this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]['ListId'],'VoiceQueueId':this[_0x6af7('0x22')][_0x3e227b['actionid']][_0x6af7('0xd0')]||undefined,'CampaignId':this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x137')));delete this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]];unlockQueueStatus(_0x47c666);}}else if((strategy[this[_0x6af7('0xe2')][this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]['queue']][_0x6af7('0x4f')]]||'rrmemory')===_0x6af7('0x18')){var _0x5f4d2d;if(this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]]&&!_[_0x6af7('0x46')](this[_0x6af7('0x29')][this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]])){if(this['queueBookedRR'][_0x4b1950[_0x6af7('0x22')][_0x3e227b['actionid']][_0x6af7('0xad')]]){this[_0x6af7('0x2a')][_0x4b1950[_0x6af7('0x22')][_0x3e227b['actionid']]['queue']]=this['queueBookedRR'][this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]]?this[_0x6af7('0x2a')][this[_0x6af7('0x22')][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]]:this[_0x6af7('0x29')][this['actions'][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]]?this[_0x6af7('0x29')][this[_0x6af7('0x22')][_0x3e227b['actionid']][_0x6af7('0xad')]]['_rr']||0x0:0x0;}this[_0x6af7('0x29')][this[_0x6af7('0x22')][_0x3e227b['actionid']][_0x6af7('0xad')]][_0x6af7('0x138')]=this['queueBookedRR'][this['actions'][_0x3e227b[_0x6af7('0x12c')]][_0x6af7('0xad')]];for(var _0x1809d4=0x0;_0x1809d4=0x0;})[_0x6af7('0xab')](myreject(_0x1a41eb)));}}else{_0x74cf37[_0x6af7('0x12f')](ami['Action']({'action':_0x6af7('0x152'),'command':util[_0x6af7('0x78')](_0x6af7('0x156'),_0x3ee29d,!_[_0x6af7('0x3b')](config[_0x6af7('0x14f')][_0x5ea939])?_0x5ea939:'')})[_0x6af7('0x39')](function(_0x2c1b20){return _0x2c1b20[_0x6af7('0x154')][_0x6af7('0x155')](_0x6af7('0x157'))>=0x0;})[_0x6af7('0xab')](myreject(_0x1a41eb)));}BPromise['all'](_0x74cf37)[_0x6af7('0x39')](function(_0x409061){var _0x3b61b9=_[_0x6af7('0x158')](_0x409061);if(_0x3b61b9){return _0x57fa26(_0x3b61b9);}else{_0x5e6f66[_0x6af7('0x3c')]=_0x33f91e?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x1a41eb(msgResponse(_0x6af7('0x159'),'Failure',_0x6af7('0x15a')+_0x33f91e+'\x20'+_0x21b8c2+_0x6af7('0x15b')+util[_0x6af7('0x93')](_0x3ee29d,{'showHidden':![],'depth':null})+_0x6af7('0x15c')+_0x5ea939));}})['catch'](function(_0x1aaca1){return _0x1a41eb(msgResponse(_0x6af7('0x149'),_0x6af7('0x14b'),JSON['stringify'](_0x1aaca1)));});});};Dialer[_0x6af7('0x1a')][_0x6af7('0x15d')]=function(_0x495859){var _0x15e171=this;return function(){switch(_0x495859[_0x6af7('0x15e')]){case _0x6af7('0x15f'):freeVariablesPredictive(_0x495859);_0x15e171['handlePower'](_0x495859,0x1);break;case _0x6af7('0x160'):freeVariablesPredictive(_0x495859);_0x15e171[_0x6af7('0x161')](_0x495859,_0x495859[_0x6af7('0x162')]);break;case _0x6af7('0xb'):_0x15e171[_0x6af7('0xb')](_0x495859);break;case'booked':freeVariablesPredictive(_0x495859);_0x15e171['handlePower'](_0x495859,0x1);break;default:freeVariablesPredictive(_0x495859);logger[_0x6af7('0x91')](_0x6af7('0x163'),_0x495859[_0x6af7('0x40')],_0x6af7('0x164'));}};};Dialer[_0x6af7('0x1a')]['checkPreviewRecallReminder']=_[_0x6af7('0x165')](function(_0x507a1d){return BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](cmHopper['handlePreviewRecallNotifications'](_0x507a1d['id'],previewRecallmeReminderInterval))[_0x6af7('0x39')](function(_0x13a9c2){for(var _0xc8c17a=0x0;_0xc8c17a<_0x13a9c2['length'];_0xc8c17a++){var _0x34cf1e=_0x13a9c2[_0xc8c17a][_0x6af7('0x166')][_0x6af7('0x40')];if(_0x34cf1e)io['to'](util[_0x6af7('0x78')](_0x6af7('0x167'),_0x34cf1e))['emit'](_0x6af7('0x168'),{'hopper':_0x13a9c2[_0xc8c17a]});}})['catch'](function(_0x143685){logger[_0x6af7('0x91')](_0x6af7('0x169'),_0x143685);});},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6af7('0x1a')]['launchHandleIvr']=function(_0x2820f0){var _0x47d2dc=this;return function(){_0x47d2dc[_0x6af7('0x16a')](_0x2820f0);};};Dialer['prototype']['syncQueueSummary']=function(_0x51cf0b){var _0x2ef885=this;if(isNotPreview(_0x51cf0b[_0x6af7('0x15e')])){if(isVoiceQueueOutbound(_0x51cf0b[_0x6af7('0x4d')])&&isActive(_0x51cf0b[_0x6af7('0x16b')])){_0x51cf0b[_0x6af7('0x9e')]=!![];BPromise['resolve']()[_0x6af7('0x39')](checkIsLoggedIn(_0x51cf0b,_0x51cf0b[_0x6af7('0x52')]))[_0x6af7('0x39')](checkIsActive(_0x51cf0b,_0x51cf0b[_0x6af7('0x16b')]))[_0x6af7('0x39')](checkInterval(_0x51cf0b))[_0x6af7('0x39')](_0x2ef885['checkIsTrunkReachable'](_0x51cf0b))['then'](_0x2ef885[_0x6af7('0x148')](_0x51cf0b[_0x6af7('0x16c')],_0x51cf0b[_0x6af7('0x16d')],_0x51cf0b['name'],_0x51cf0b))[_0x6af7('0x39')](_0x2ef885[_0x6af7('0x14a')](_0x51cf0b[_0x6af7('0x42')],_0x51cf0b[_0x6af7('0x16d')],_0x51cf0b[_0x6af7('0x40')],_0x51cf0b))[_0x6af7('0x39')](_0x2ef885[_0x6af7('0x15d')](_0x51cf0b))[_0x6af7('0xab')](loggerCatchQueueSummary(_0x6af7('0x16e'),_0x51cf0b));}else{notSendMessagesQueue(_0x51cf0b);}}else{freeVariablesPredictive(_0x51cf0b);if(_0x51cf0b[_0x6af7('0x16f')]){_0x2ef885[_0x6af7('0x169')](_0x51cf0b);}}};Dialer[_0x6af7('0x1a')][_0x6af7('0x143')]=function(){var _0x1b023c=this;var _0x1b3df1;for(var _0x233d46 in this['campaigns']){if(typeof this['campaigns'][_0x233d46]!==_0x6af7('0x95')){_0x1b3df1=this[_0x6af7('0x1e')][_0x233d46];if(isCampaignIvr(_0x1b3df1[_0x6af7('0x4d')])&&isActive(_0x1b3df1[_0x6af7('0x77')])){_0x1b3df1[_0x6af7('0x9e')]=!![];BPromise[_0x6af7('0xb0')]()[_0x6af7('0x39')](checkIsActive(_0x1b3df1,_0x1b3df1[_0x6af7('0x77')]))[_0x6af7('0x39')](checkInterval(_0x1b3df1))['then'](_0x1b023c[_0x6af7('0x144')](_0x1b3df1))[_0x6af7('0x39')](_0x1b023c[_0x6af7('0x148')](_0x1b3df1[_0x6af7('0x16c')],_0x1b3df1[_0x6af7('0x16d')],_0x1b3df1[_0x6af7('0x40')],_0x1b3df1))[_0x6af7('0x39')](_0x1b023c['checkIfTimeIntervals'](_0x1b3df1[_0x6af7('0x42')],_0x1b3df1[_0x6af7('0x16d')],_0x1b3df1[_0x6af7('0x40')],_0x1b3df1))['then'](_0x1b023c['launchHandleIvr'](_0x1b3df1))['catch'](loggerCatchQueueSummary(_0x6af7('0x170'),_0x1b3df1));}else{notSendMessagesCampaign(_0x1b3df1);}}}};function getCallerIdRandom(_0x3e6007,_0xb9f0a1){var _0x3dd3f7;var _0x4369e7;var _0x340877;if(_0xb9f0a1<=0x0){_0xb9f0a1=0x1;}_0x3dd3f7=new RegExp(_0x6af7('0x171')+_0xb9f0a1+'}$');_0x4369e7=Math[_0x6af7('0x172')](0xa,_0xb9f0a1-0x1);_0x340877=Math['pow'](0xa,_0xb9f0a1)-0x1;return util[_0x6af7('0x78')]('%s',_[_0x6af7('0x173')](_0x3e6007,_0x3dd3f7,_['random'](_0x4369e7,_0x340877)));}function extractCalleridName(_0x71aad3){var _0x3091af=_0x71aad3['match'](/"(.*?)"/);return _0x3091af?_0x3091af[0x1]:_0x71aad3;}function extractCalleridNumber(_0x143a3a){var _0x4b971a=_0x143a3a[_0x6af7('0x174')](/<(.*?)>/);return _0x4b971a?_0x4b971a[0x1]:_0x143a3a;}Dialer['prototype']['actionOriginate']=function(_0x505fc2,_0x588d0c){var _0x4e60c7=this;var _0x41d9ab=uuid['v4']();this[_0x6af7('0x22')][_0x41d9ab]=new Action(_0x505fc2,_0x588d0c,_0x41d9ab);return new BPromise(function(_0x47cef5,_0x2c2086){if(_[_0x6af7('0x3b')](_0x505fc2)&&typeof _0x505fc2!==_0x6af7('0x175')){return _0x2c2086(msgResponse(_0x6af7('0x176'),_0x6af7('0x14b'),_0x6af7('0x177')));}if(_['isUndefined'](_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')])||_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')]===null){return _0x2c2086(msgResponse(_0x6af7('0x176'),'Failure','contact\x20is\x20undefine'));}var _0x13db59={'XMD-CALLERID':_0x4e60c7['actions'][_0x41d9ab][_0x6af7('0x17a')](),'XMD-AGI':_0x505fc2[_0x6af7('0x108')]?util['format'](_0x6af7('0x17b'),ipAgi,_0x505fc2[_0x6af7('0x108')]):'NONE','XMD-AGIAFTER':_0x505fc2[_0x6af7('0x11d')]?util[_0x6af7('0x78')](_0x6af7('0x17b'),ipAgi,_0x505fc2[_0x6af7('0x11d')]):_0x6af7('0x17c'),'XMD-QUEUE':_0x505fc2[_0x6af7('0x4d')]===_0x6af7('0x4e')?util[_0x6af7('0x78')](_0x6af7('0x17d'),_0x505fc2[_0x6af7('0x40')],_0x505fc2[_0x6af7('0x17e')]||'',_0x505fc2['dialAgiAfterHangupAgent']?'c':'',_0x505fc2[_0x6af7('0x119')]||0x3):_0x6af7('0x17c'),'XMD-CONTACTID':_0x588d0c[_0x6af7('0xcd')],'XMD-CDRTYPE':_0x6af7('0x8'),'CALLERID(all)':_0x4e60c7['actions'][_0x41d9ab]['getCaller'](),'XMD-AMD':_0x505fc2[_0x6af7('0xe0')]?'ACTIVE':_0x6af7('0x17c'),'XMD-DESTINATION':_0x6af7('0xdf')};if(_0x505fc2[_0x6af7('0xe0')]){_0x13db59[_0x6af7('0x17f')]=_0x505fc2[_0x6af7('0x180')]||0x9c4;_0x13db59[_0x6af7('0x181')]=_0x505fc2[_0x6af7('0x182')]||0x5dc;_0x13db59[_0x6af7('0x183')]=_0x505fc2[_0x6af7('0x184')]||0x320;_0x13db59[_0x6af7('0x185')]=_0x505fc2[_0x6af7('0x186')]||0x1388;_0x13db59[_0x6af7('0x187')]=_0x505fc2['dialAMDMinWordLength']||0x64;_0x13db59[_0x6af7('0x188')]=_0x505fc2[_0x6af7('0x189')]||0x32;_0x13db59[_0x6af7('0x18a')]=_0x505fc2[_0x6af7('0x18b')]||0x3;_0x13db59['XMD-AMDSILENCETHRESHOLD']=_0x505fc2[_0x6af7('0x18c')]||0x100;_0x13db59['XMD-AMDMAXIMUMWORDLENGTH']=_0x505fc2[_0x6af7('0x18d')]||0x1388;}if(_0x505fc2[_0x6af7('0x4d')]==='outbound'){_0x13db59['XMD-VOICEQUEUEID']=_0x588d0c[_0x6af7('0xd0')];}else{_0x13db59[_0x6af7('0x18e')]=_0x588d0c[_0x6af7('0xd1')];}for(var _0x59402e in _0x588d0c[_0x6af7('0x178')]){if(typeof _0x588d0c[_0x6af7('0x178')][_0x59402e]!==_0x6af7('0x95')){if(isNotNull(_0x588d0c[_0x6af7('0x178')][_0x59402e])&&_0x59402e!=='id'&&_0x59402e!=='tags'&&_0x59402e!==_0x6af7('0x18f')&&_0x59402e!==_0x6af7('0x190')){_0x13db59[util[_0x6af7('0x78')](_0x6af7('0x191'),'XMD-',_[_0x6af7('0x192')](_0x59402e))]=_0x588d0c['Contact'][_0x59402e];}}}var _0x21c7fc=_0x4e60c7['isTrunkReachable'](_0x505fc2[_0x6af7('0x76')])?getCallerId(_0x505fc2[_0x6af7('0x76')][_0x6af7('0x193')],_0x505fc2[_0x6af7('0x194')],_0x505fc2['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x505fc2['dialOriginateCallerIdNumber'],_0x505fc2['dialRandomLastDigitCallerIdNumber']):_0x505fc2['dialOriginateCallerIdNumber']):getCallerId(_[_0x6af7('0xdb')](_0x505fc2[_0x6af7('0x145')])?_0x505fc2[_0x6af7('0x76')][_0x6af7('0x193')]:_0x505fc2[_0x6af7('0x145')][_0x6af7('0x193')],_0x505fc2[_0x6af7('0x194')],_0x505fc2[_0x6af7('0x195')]>0x0?getCallerIdRandom(_0x505fc2[_0x6af7('0x5b')],_0x505fc2[_0x6af7('0x195')]):_0x505fc2[_0x6af7('0x5b')]);if(_0x21c7fc){_0x13db59[_0x6af7('0x196')]=_0x4e60c7[_0x6af7('0x22')][_0x41d9ab][_0x6af7('0x197')]=extractCalleridName(_0x21c7fc);_0x13db59[_0x6af7('0x198')]=_0x4e60c7['actions'][_0x41d9ab][_0x6af7('0x199')]=extractCalleridNumber(_0x21c7fc);}return ami[_0x6af7('0xaa')]({'actionid':_0x41d9ab,'action':'originate','channel':_0x4e60c7[_0x6af7('0xd5')](_0x505fc2[_0x6af7('0x76')])?util['format'](_0x6af7('0x19a'),_0x505fc2['Trunk'][_0x6af7('0x40')],isNotNull(_0x505fc2[_0x6af7('0x5d')])?_0x505fc2[_0x6af7('0x5d')][_0x6af7('0x19b')]()||'':'',_0x505fc2['dialCutDigit']>0x0?_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')][_0x6af7('0x19c')](_0x505fc2[_0x6af7('0x19d')]):_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')]):util[_0x6af7('0x78')]('SIP/%s/%s%s',_[_0x6af7('0xdb')](_0x505fc2['TrunkBackup'])?_0x505fc2[_0x6af7('0x76')]['name']:_0x505fc2[_0x6af7('0x145')]['name'],isNotNull(_0x505fc2[_0x6af7('0x5d')])?_0x505fc2['dialPrefix'][_0x6af7('0x19b')]()||'':'',_0x505fc2[_0x6af7('0x19d')]>0x0?_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')][_0x6af7('0x19c')](_0x505fc2[_0x6af7('0x19d')]):_0x588d0c[_0x6af7('0x178')][_0x6af7('0x179')]),'callerid':_0x21c7fc,'Exten':_0x6af7('0xdf'),'Context':'from-sip','Priority':'1','variable':_0x13db59,'timeout':(_0x505fc2[_0x6af7('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x41d9ab})[_0x6af7('0x39')](function(_0x515d55){return _0x47cef5(_0x515d55);})[_0x6af7('0xab')](function(_0x113633){_0x505fc2[_0x6af7('0x65')]+=0x1;var _0x46ed53=new History(_0x4e60c7['actions'][_0x41d9ab]);logger['error'](util[_0x6af7('0x78')](_0x6af7('0x19e'),JSON[_0x6af7('0x49')](_0x113633)));_0x46ed53[_0x6af7('0xa4')]=0xe;_0x46ed53[_0x6af7('0xa5')]=_0x6af7('0x19f');_0x46ed53[_0x6af7('0x120')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46ed53['endtime']=_0x46ed53['starttime'];_0x4e60c7[_0x6af7('0xc4')](_0x46ed53)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1a0')));_0x4e60c7[_0x6af7('0xc2')](_0x46ed53)['catch'](loggerCatch(_0x6af7('0x1a0')))[_0x6af7('0x1c')](function(){delete _0x4e60c7[_0x6af7('0x22')][_0x41d9ab];return _0x2c2086(msgResponse(_0x6af7('0x176'),_0x6af7('0x48'),_0x6af7('0x1a1')));});});});};Dialer[_0x6af7('0x1a')][_0x6af7('0x1a2')]=function(_0x57b45e){var _0x2bd74d=this[_0x6af7('0x22')][_0x57b45e[_0x6af7('0x12c')]];if(_0x2bd74d){delete this[_0x6af7('0x22')][_0x57b45e[_0x6af7('0x12c')]];_0x2bd74d[_0x6af7('0x118')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2061f2=_0x2bd74d[_0x6af7('0x4d')]===_0x6af7('0x8e')?this['campaigns'][_0x2bd74d['queue']]:this[_0x6af7('0xe2')][_0x2bd74d[_0x6af7('0x1a3')]()];if(!this[_0x6af7('0xd4')](_0x57b45e[_0x6af7('0x1a4')])){this[_0x6af7('0xc6')](_0x2061f2);return this['callProgressDetecting'](_0x2bd74d,_0x2061f2,_0x57b45e)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1a5')));}this[_0x6af7('0x24')][_0x57b45e[_0x6af7('0xda')]]=_0x2bd74d;}};Dialer[_0x6af7('0x1a')][_0x6af7('0x1a6')]=function(_0xad0901,_0x11fe74,_0x3d2e6b){var _0x5af070=new History(_0x11fe74);if(_0x5af070['countbusyretry']+_0x5af070[_0x6af7('0xf2')]+_0x5af070[_0x6af7('0x102')]+_0x5af070[_0x6af7('0xf3')]+_0x5af070[_0x6af7('0x103')]+_0x5af070['countabandonedretry']+_0x5af070[_0x6af7('0xed')]+_0x5af070[_0x6af7('0xf5')]>=_0x3d2e6b['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xad0901){case 0x3:if(_0x5af070[_0x6af7('0x102')]>=_0x3d2e6b['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countnoanswerretry':_0x5af070[_0x6af7('0x102')]+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b['dialNoAnswerRetryFrequency'],'minutes')['format'](_0x6af7('0x106')),'ContactId':_0x5af070['ContactId'],'ListId':_0x5af070['ListId'],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1a7')));break;case 0x5:if(_0x5af070[_0x6af7('0xf1')]>=_0x3d2e6b[_0x6af7('0x1a8')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countbusyretry':_0x5af070[_0x6af7('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x3d2e6b['dialBusyRetryFrequency'],_0x6af7('0xfc'))[_0x6af7('0x78')](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1a9')));break;case 0x8:if(_0x5af070[_0x6af7('0xf2')]>=_0x3d2e6b[_0x6af7('0x1aa')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countcongestionretry':_0x5af070['countcongestionretry']+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b[_0x6af7('0x1ab')],_0x6af7('0xfc'))[_0x6af7('0x78')](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x5af070[_0x6af7('0xf3')]>=_0x3d2e6b[_0x6af7('0x1ac')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5af070[_0x6af7('0xf3')]+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b[_0x6af7('0x1ad')],_0x6af7('0xfc'))[_0x6af7('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070['CampaignId']||undefined})[_0x6af7('0xab')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5af070[_0x6af7('0x103')]>=_0x3d2e6b[_0x6af7('0x11e')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countdropretry':_0x5af070[_0x6af7('0x103')]+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b[_0x6af7('0x1ae')],'minutes')[_0x6af7('0x78')](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x11f')));break;case 0xb:if(_0x5af070['countabandonedretry']>=_0x3d2e6b[_0x6af7('0x126')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countabandonedretry':_0x5af070[_0x6af7('0xf4')]+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b[_0x6af7('0x127')],_0x6af7('0xfc'))[_0x6af7('0x78')](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070['VoiceQueueId']||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x128')));break;case 0x13:if(_0x5af070[_0x6af7('0xed')]>=_0x3d2e6b[_0x6af7('0xf8')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countmachineretry':_0x5af070[_0x6af7('0xed')]+=0x1,'scheduledat':moment()['add'](_0x3d2e6b['dialMachineRetryFrequency'],_0x6af7('0xfc'))['format'](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0xfd')));break;case 0x14:if(_0x5af070[_0x6af7('0xf5')]>=_0x3d2e6b[_0x6af7('0x1af')]-0x1){return!![];}this[_0x6af7('0xb7')]({'active':![],'countagentrejectretry':_0x5af070['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x6af7('0x105')](_0x3d2e6b[_0x6af7('0x1b0')],_0x6af7('0xfc'))['format'](_0x6af7('0x106')),'ContactId':_0x5af070[_0x6af7('0xcd')],'ListId':_0x5af070[_0x6af7('0xce')],'VoiceQueueId':_0x5af070[_0x6af7('0xd0')]||undefined,'CampaignId':_0x5af070['CampaignId']||undefined})['catch'](loggerCatch(_0x6af7('0x1b1')));break;default:return!![];}};Dialer[_0x6af7('0x1a')]['callProgressDetecting']=function(_0xcab842,_0x5c0364,_0x425fd4){var _0x532025=this;var _0x582f83=new History(_0xcab842);return new BPromise(function(_0xd9caee,_0x5ca3bb){if(_['isUndefined'](_0x5c0364)&&typeof _0x5c0364!=='object'){return _0x5ca3bb(msgResponse('[callProgressDetecting]',_0x6af7('0x14b'),'entity\x20is\x20undefine'));}if(_[_0x6af7('0x3b')](_0x425fd4)&&typeof _0x425fd4!==_0x6af7('0x175')){return _0x5ca3bb(msgResponse(_0x6af7('0x1b2'),_0x6af7('0x14b'),_0x6af7('0x1b3')));}switch(_0x425fd4[_0x6af7('0x10d')]){case'0':_0x5c0364[_0x6af7('0x64')]+=0x1;_0x582f83['state']=0x0;_0x582f83['statedesc']='NoSuchNumber';_0x582f83[_0x6af7('0xf3')]+=0x1;_0x582f83[_0x6af7('0xee')]+=0x1;ami[_0x6af7('0xe6')](_0x6af7('0x1b4'),ut[_0x6af7('0xef')](_0xcab842,_0x6af7('0x1b5')));_0x532025[_0x6af7('0xc4')](_0x582f83)['catch'](loggerCatch(_0x6af7('0xf0')));if(_0x532025[_0x6af7('0x1a6')](0x0,_0xcab842,_0x5c0364)){if(_0x582f83[_0x6af7('0xf3')]>=_0x5c0364[_0x6af7('0x1ac')]){_0x532025['createStateFinal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1b6'));}else{_0x532025[_0x6af7('0x104')](_0x582f83,_0xd9caee,_0x5ca3bb,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5c0364[_0x6af7('0x1b7')]+=0x1;_0x582f83[_0x6af7('0xa4')]=0x3;_0x582f83[_0x6af7('0xa5')]='NoAnswer';_0x582f83[_0x6af7('0x102')]+=0x1;_0x582f83['countglobal']+=0x1;ami['emit'](_0x6af7('0x1b8'),ut[_0x6af7('0xef')](_0xcab842,_0x6af7('0x1b9')));_0x532025['createHistory'](_0x582f83)['catch'](loggerCatch(_0x6af7('0x1ba')));if(_0x532025[_0x6af7('0x1a6')](0x3,_0xcab842,_0x5c0364)){if(_0x582f83['countnoanswerretry']>=_0x5c0364[_0x6af7('0x1bb')]){_0x532025[_0x6af7('0xf9')](_0x582f83,_0xd9caee,_0x5ca3bb,'reason\x203\x20ringing\x20no\x20answer');}else{_0x532025[_0x6af7('0x104')](_0x582f83,_0xd9caee,_0x5ca3bb,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5c0364[_0x6af7('0x60')]+=0x1;_0x582f83[_0x6af7('0xa4')]=0x5;_0x582f83[_0x6af7('0xa5')]=_0x6af7('0x1bc');_0x582f83[_0x6af7('0xf1')]+=0x1;_0x582f83[_0x6af7('0xee')]+=0x1;ami['emit'](_0x6af7('0x1bd'),ut['buildObj'](_0xcab842,_0x6af7('0x1be')));_0x532025[_0x6af7('0xc4')](_0x582f83)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1bf')));if(_0x532025['checkRetriveMax'](0x5,_0xcab842,_0x5c0364)){if(_0x582f83[_0x6af7('0xf1')]>=_0x5c0364[_0x6af7('0x1a8')]){_0x532025['createStateFinal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c0'));}else{_0x532025[_0x6af7('0x104')](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c0'));}}break;case'8':_0x5c0364[_0x6af7('0x61')]+=0x1;_0x582f83[_0x6af7('0xa4')]=0x8;_0x582f83['statedesc']='Congestion';_0x582f83[_0x6af7('0xf2')]+=0x1;_0x582f83['countglobal']+=0x1;ami[_0x6af7('0xe6')](_0x6af7('0x1c1'),ut['buildObj'](_0xcab842,_0x6af7('0x1c2')));_0x532025[_0x6af7('0xc4')](_0x582f83)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1c3')));if(_0x532025[_0x6af7('0x1a6')](0x8,_0xcab842,_0x5c0364)){if(_0x582f83[_0x6af7('0xf2')]>=_0x5c0364[_0x6af7('0x1aa')]){_0x532025['createStateFinal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c4'));}else{_0x532025['stateGlobal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c4'));}}break;case'11':_0x5c0364['outboundAbandonedCallsDay']+=0x1;_0x582f83[_0x6af7('0xa4')]=0xb;_0x582f83[_0x6af7('0xa5')]=_0x6af7('0x124');_0x582f83[_0x6af7('0xf4')]+=0x1;_0x582f83[_0x6af7('0xee')]+=0x1;_0x532025['createHistory'](_0x582f83)[_0x6af7('0xab')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x532025[_0x6af7('0x1a6')](0xb,_0xcab842,_0x5c0364)){if(_0x582f83[_0x6af7('0xf4')]>=_0x5c0364[_0x6af7('0x126')]){_0x532025[_0x6af7('0xf9')](_0x582f83,_0xd9caee,_0x5ca3bb,'reason\x2011\x20abandoned');}else{_0x532025[_0x6af7('0x104')](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c5'));}}break;case'20':_0x5c0364[_0x6af7('0x67')]+=0x1;_0x582f83[_0x6af7('0xa4')]=0x14;_0x582f83['statedesc']=_0x6af7('0x1c6');_0x582f83[_0x6af7('0xf5')]+=0x1;_0x582f83[_0x6af7('0xee')]+=0x1;ami[_0x6af7('0xe6')]('custom:agentreject',ut['buildObj'](_0xcab842,_0x6af7('0x1c7')));_0x532025['createHistory'](_0x582f83)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1c8')));if(_0x532025[_0x6af7('0x1a6')](0x14,_0xcab842,_0x5c0364)){if(_0x582f83['countagentrejectretry']>=_0x5c0364[_0x6af7('0x1af')]){_0x532025[_0x6af7('0xf9')](_0x582f83,_0xd9caee,_0x5ca3bb,'reason\x2020\x20agentreject');}else{_0x532025['stateGlobal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x6af7('0x1c9'));}}break;default:_0x5c0364['outboundUnknownCallsDay']+=0x1;_0x582f83['state']=0xc;_0x582f83[_0x6af7('0xa5')]=_0x425fd4[_0x6af7('0x10d')];_0x532025[_0x6af7('0xc4')](_0x582f83)[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1ca')));if(_0x532025['checkRetriveMax'](_0x425fd4[_0x6af7('0x10d')],_0xcab842,_0x5c0364)){if(_0x582f83['countbusyretry']+_0x582f83[_0x6af7('0xf2')]+_0x582f83['countnoanswerretry']+_0x582f83['countnosuchnumberretry']+_0x582f83['countdropretry']+_0x582f83[_0x6af7('0xf4')]+_0x582f83[_0x6af7('0xed')]+_0x582f83[_0x6af7('0xf5')]>=_0x5c0364['dialGlobalMaxRetry']){_0x532025['stateGlobal'](_0x582f83,_0xd9caee,_0x5ca3bb,_0x425fd4[_0x6af7('0x10d')]);}else{_0x532025[_0x6af7('0xf9')](_0x582f83,_0xd9caee,_0x5ca3bb,_0x425fd4['reason']);}}}});};Dialer['prototype'][_0x6af7('0x104')]=function(_0xf5dcbc,_0x36e6f0,_0x11c51b,_0x298dae){var _0x18cc17=new Final(_0xf5dcbc);_0x18cc17[_0x6af7('0xa4')]=0xf;_0x18cc17[_0x6af7('0xa5')]='Global';this[_0x6af7('0xf9')](_0x18cc17,_0x36e6f0,_0x11c51b,_0x298dae);};Dialer[_0x6af7('0x1a')][_0x6af7('0xf9')]=function(_0x124489,_0x2d5c8c,_0x5da1bc,_0x2c6f6f){this['moveContactManagedDialer'](_0x124489)[_0x6af7('0x39')](function(){return _0x2d5c8c(msgResponse(_0x6af7('0x1b2'),'Success',_0x2c6f6f));})['catch'](function(){return _0x5da1bc(msgResponse(_0x6af7('0x1cb'),'Failure',_0x6af7('0x1cc')));});};Dialer[_0x6af7('0x1a')][_0x6af7('0xb')]=function(_0x14c441){var _0x1588bc=_0x14c441['dialPredictiveOptimizationPercentage']/0x64;var _0x82946d=_0x14c441['outboundDropCallsDayTimeout']/(_0x14c441['outboundDropCallsDayTimeout']+_0x14c441[_0x6af7('0x5e')]);var _0x26941e=Math[_0x6af7('0x1cd')](_0x14c441['predictiveIntervalAvailable']*(_0x14c441[_0x6af7('0x1ce')]/0x64));var _0x326b59=Math[_0x6af7('0x1cd')](_0x14c441['predictiveIntervalAvailable']*(_0x14c441['predictiveIntervalMinThreshold']/0x64));var _0x5227f3=_0x14c441[_0x6af7('0x51')]+_0x14c441['talking'];var _0x185f19=Math['floor'](_0x14c441[_0x6af7('0x74')]*_0x14c441['erlangAbandonmentRate']*_0x14c441[_0x6af7('0x1cf')]*_0x14c441[_0x6af7('0x70')]);if(_[_0x6af7('0x3b')](_0x14c441[_0x6af7('0x27')])){if(!_['isUndefined'](_0x14c441['startPredictive'])){_0x14c441[_0x6af7('0x26')]=undefined;loggerPredictive[_0x6af7('0x91')]('[startMethodPredictive][StartProgressive]',_0x6af7('0x1d0'));}if(!_[_0x6af7('0x3b')](_0x14c441[_0x6af7('0x8d')])){loggerPredictive[_0x6af7('0x91')]('[startMethodPredictive][StartProgressive]',_0x6af7('0x1d1'));clearInterval(_0x14c441[_0x6af7('0x8d')]);_0x14c441['handlePredictive']=undefined;}_0x14c441['startProgressive']=moment()[_0x6af7('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6af7('0x7d')](_0x14c441[_0x6af7('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x14c441[_0x6af7('0x27')]);this[_0x6af7('0x161')](_0x14c441,0x1);}else if(ifInterval(_0x14c441[_0x6af7('0x1d2')],_0x14c441[_0x6af7('0x27')])){this['handlePower'](_0x14c441,0x1);loggerPredictiveCalls[_0x6af7('0x7d')](_0x6af7('0x1d3'),_0x14c441[_0x6af7('0x27')],_0x14c441['name']);_0x14c441[_0x6af7('0x74')]=0x0;_0x14c441['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1588bc<_0x82946d&&_0x14c441[_0x6af7('0x1d4')]==='dropRate'){freeVariablesPredictive(_0x14c441);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x1d5'),_0x6af7('0x1d6'),_0x82946d,_0x6af7('0x27'),_0x14c441['name']);}else if(_0x185f19<_0x14c441[_0x6af7('0x6f')]&&_0x14c441[_0x6af7('0x1d4')]==='dropRate'){freeVariablesPredictive(_0x14c441);loggerPredictive['info'](_0x6af7('0x1d7'),_0x6af7('0x1d8'),_0x185f19,_0x6af7('0x1d9'),_0x14c441[_0x6af7('0x6f')],_0x6af7('0x27'),_0x14c441[_0x6af7('0x40')]);}else if(!ifInterval(_0x14c441[_0x6af7('0x1d2')],_0x14c441[_0x6af7('0x27')])&&_[_0x6af7('0x3b')](_0x14c441[_0x6af7('0x26')])&&!_['isUndefined'](_0x14c441[_0x6af7('0x27')])){_0x14c441['startPredictive']=moment()[_0x6af7('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6af7('0x7d')](_0x14c441['name'],_0x6af7('0x1da'),_0x14c441[_0x6af7('0x26')]);this[_0x6af7('0x1db')](_0x14c441[_0x6af7('0x1d2')])[_0x6af7('0x39')](this[_0x6af7('0x1dc')](_0x14c441))['then'](mergeDataErlangB(_0x14c441))[_0x6af7('0x39')](this[_0x6af7('0x1dd')](_0x14c441))[_0x6af7('0xab')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x14c441));}else if(!ifInterval(_0x14c441['dialPredictiveInterval'],_0x14c441[_0x6af7('0x26')])){_0x14c441[_0x6af7('0x6f')]=0x0;_0x14c441['startPredictive']=moment()[_0x6af7('0x78')](_0x6af7('0x106'));loggerPredictive[_0x6af7('0x7d')](_0x14c441[_0x6af7('0x40')],'recalculate\x20predictive\x20at',_0x14c441[_0x6af7('0x26')]);clearInterval(_0x14c441['handlePredictive']);_0x14c441[_0x6af7('0x8d')]=undefined;this[_0x6af7('0x1db')](_0x14c441[_0x6af7('0x1d2')])[_0x6af7('0x39')](this[_0x6af7('0x1dc')](_0x14c441))['then'](mergeDataErlangB(_0x14c441))[_0x6af7('0x39')](this[_0x6af7('0x1dd')](_0x14c441))[_0x6af7('0xab')](loggerCatchPredictive(_0x6af7('0x1de'),_0x14c441));}else if(_0x14c441[_0x6af7('0x71')]&&_0x5227f3<_0x14c441['predictiveIntervalAvailable']-_0x326b59){freeVariablesPredictive(_0x14c441);loggerPredictive[_0x6af7('0x7d')](_0x14c441['name'],_0x6af7('0x1df'),_0x5227f3,_0x6af7('0x1e0'),_0x14c441['predictiveIntervalAvailable'],'-',_0x326b59,'=',_0x14c441['predictiveIntervalAvailable']-_0x326b59,')');}else if(_0x14c441[_0x6af7('0x71')]&&_0x5227f3>_0x14c441['predictiveIntervalAvailable']+_0x26941e){freeVariablesPredictive(_0x14c441);loggerPredictive[_0x6af7('0x7d')](_0x14c441['name'],_0x6af7('0x1df'),_0x5227f3,_0x6af7('0x1e1'),_0x14c441[_0x6af7('0x71')],'+',_0x26941e,'=',_0x14c441[_0x6af7('0x71')]+_0x26941e,')');}};Dialer[_0x6af7('0x1a')][_0x6af7('0x1dc')]=function(_0x486787){var _0x182d90=this;return function(_0x23b63c){return new BPromise(function(_0xfc78da,_0x5594e7){_[_0x6af7('0x8b')](_0x486787,_0x23b63c[0x0]);if(checkGetDataPredictive(_0x23b63c[0x0])){var _0xe96ec9=_0x486787[_0x6af7('0x71')]=_0x486787['talking']+_0x486787[_0x6af7('0x51')];var _0x31ba98=_0x486787[_0x6af7('0x1d2')]*0x3c;var _0x465bf2=_0x23b63c[0x0][_0x6af7('0x6b')]+_0x23b63c[0x0]['predictiveIntervalAvgHoldtime'];var _0x40e765=(_0x23b63c[0x0]['predictiveIntervalAnsweredCalls']+_0x23b63c[0x0][_0x6af7('0x6d')]+_0x23b63c[0x0][_0x6af7('0x6c')])/_0x23b63c[0x0][_0x6af7('0x72')];_0x486787[_0x6af7('0x1cf')]=_0x40e765>0x0?_0x40e765:0x1;switch(_0x486787[_0x6af7('0x1d4')]){case'dropRate':var _0x312c6c=_0x486787[_0x6af7('0x1e2')]/0x64;return _0x182d90[_0x6af7('0x1e3')](_0xe96ec9,_0x31ba98,_0x465bf2,_0x40e765,_0x312c6c)[_0x6af7('0x39')](function(_0x2b4902){return _0xfc78da(_0x2b4902);});case'agentBusyFactor':var _0x538ee5=_0x486787[_0x6af7('0x1e2')]/0x64;return _0x182d90[_0x6af7('0x1e4')](_0xe96ec9,_0x31ba98,_0x465bf2,_0x40e765,_0x538ee5)['then'](function(_0x2dc262){return _0xfc78da(_0x2dc262);});default:return _0x5594e7(msgResponse(_0x6af7('0x1e5'),_0x6af7('0x14b'),_0x6af7('0x1e6')));}}else{return _0x5594e7(msgResponse('[getDataPredictive]',_0x6af7('0x14b'),_0x6af7('0x1e7')));}});};};Dialer[_0x6af7('0x1a')][_0x6af7('0x1e8')]=function(_0x4eb7b4){var _0x5290d5=this;return function(_0x6cf3b2){return new BPromise(function(_0x4aed44,_0x3965e5){_[_0x6af7('0x8b')](_0x4eb7b4,_0x6cf3b2[0x0]);if(checkGetDataPredictive(_0x6cf3b2[0x0])){loggerPredictive[_0x6af7('0x7d')](JSON[_0x6af7('0x49')](_0x6cf3b2[0x0]));if(_0x4eb7b4[_0x6af7('0x1d4')]===_0x6af7('0x1e9')){return _0x5290d5['getVoiceQueueRtPauses'](_0x4eb7b4['id'])[_0x6af7('0x39')](function(_0x16ac5f){var _0x4a05e5=_0x4eb7b4[_0x6af7('0x52')]-_0x16ac5f[0x0][_0x6af7('0x1ea')];var _0x558b80=_0x4eb7b4['dialPredictiveInterval']*0x3c;var _0x8a8bde=_0x6cf3b2[0x0][_0x6af7('0x6b')]+_0x6cf3b2[0x0][_0x6af7('0x6a')];var _0x2b3eca=(_0x6cf3b2[0x0][_0x6af7('0x69')]+_0x6cf3b2[0x0][_0x6af7('0x6d')]+_0x6cf3b2[0x0][_0x6af7('0x6c')])/_0x6cf3b2[0x0][_0x6af7('0x72')];var _0x55cad3=_0x4eb7b4[_0x6af7('0x1e2')]/0x64;_0x4eb7b4[_0x6af7('0x1eb')]=_0x16ac5f[0x0][_0x6af7('0x1ea')]||0x0;_0x4eb7b4[_0x6af7('0x1cf')]=_0x2b3eca>0x0?_0x2b3eca:0x1;return _0x5290d5[_0x6af7('0x1e3')](_0x4a05e5,_0x558b80,_0x8a8bde,_0x2b3eca,_0x55cad3);})['then'](function(_0x22e663){return _0x4aed44(_0x22e663);})[_0x6af7('0xab')](function(_0x507ee9){return _0x3965e5(msgResponse('[CatchErlangB]',_0x6af7('0x14b'),JSON[_0x6af7('0x49')](_0x507ee9)));});}if(_0x4eb7b4[_0x6af7('0x1d4')]===_0x6af7('0x1ec')){return _0x5290d5[_0x6af7('0xc0')](_0x4eb7b4['id'])[_0x6af7('0x39')](function(_0x2a643d){var _0x45c16b=_0x4eb7b4[_0x6af7('0x52')]-_0x2a643d[0x0][_0x6af7('0x1ea')];var _0x43be61=_0x4eb7b4[_0x6af7('0x1d2')]*0x3c;var _0xdb801e=_0x6cf3b2[0x0][_0x6af7('0x6b')]+_0x6cf3b2[0x0][_0x6af7('0x6a')];var _0x286559=(_0x6cf3b2[0x0][_0x6af7('0x69')]+_0x6cf3b2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x6cf3b2[0x0][_0x6af7('0x6c')])/_0x6cf3b2[0x0]['predictiveIntervalTotalCalls'];var _0x36d11d=_0x4eb7b4[_0x6af7('0x1e2')]/0x64;_0x4eb7b4['predictiveIntervalPauses']=_0x2a643d[0x0]['outboundQueuePauses']||0x0;_0x4eb7b4['predictiveIntervalHitRate']=_0x286559>0x0?_0x286559:0x1;return _0x5290d5[_0x6af7('0x1e4')](_0x45c16b,_0x43be61,_0xdb801e,_0x286559,_0x36d11d);})[_0x6af7('0x39')](function(_0x54086e){return _0x4aed44(_0x54086e);})[_0x6af7('0xab')](function(_0x3ea3bd){return _0x3965e5(msgResponse(_0x6af7('0x1ed'),'Failure',JSON[_0x6af7('0x49')](_0x3ea3bd)));});}}else{return _0x3965e5(msgResponse(_0x6af7('0x1e5'),_0x6af7('0x14b'),_0x6af7('0x1e7')));}});};};Dialer[_0x6af7('0x1a')][_0x6af7('0x1dd')]=function(_0x18f863){var _0x226194=this;return function(){var _0x151174=0x0;var _0x3f2499=Math['floor'](_0x18f863[_0x6af7('0x75')]*0x3e8);if(_0x3f2499>0x0){_0x3f2499=_0x3f2499<0x64?0x64:_0x3f2499;loggerPredictive[_0x6af7('0x7d')](_0x18f863[_0x6af7('0x40')],_0x6af7('0x1ee'),_0x3f2499,_0x6af7('0x4a'));_0x18f863['handlePredictive']=setInterval(function(){_0x226194[_0x6af7('0x8d')](_0x18f863);loggerPredictiveCalls[_0x6af7('0x7d')](_0x6af7('0x1ef'),_0x151174+=0x1);},_0x3f2499);}else{loggerPredictive['info'](_0x18f863['name'],_0x6af7('0x1f0'));}};};Dialer['prototype']['checkContactBlack']=function(_0xb881c1,_0x59e90f){var _0x1f1889=this;return function(_0xeea086){if(_['isEmpty'](_0xeea086)){if(_[_0x6af7('0xdb')](_0x59e90f[_0x6af7('0xcf')])||!_0x59e90f['recallme']){if(_0xb881c1[_0x6af7('0x15e')]===_0x6af7('0xa')){_0xb881c1['queueStatusComplete']=_['isUndefined'](_0xb881c1[_0x6af7('0x132')])?!![]:_0xb881c1['queueStatusComplete'];var _0x139bac=uuid['v4']();_0x1f1889['actions'][_0x139bac]=new Action(_0xb881c1,_0x59e90f,_0x139bac);loggerBooked[_0x6af7('0x7d')](_0x6af7('0x1f1'),_0x139bac,_0x6af7('0x1f2'),JSON[_0x6af7('0x49')](_0xb881c1[_0x6af7('0x132')]),'Queue:\x20',_0xb881c1[_0x6af7('0x40')]);if(_0xb881c1[_0x6af7('0x132')]){_0xb881c1[_0x6af7('0x132')]=![];_0x1f1889[_0x6af7('0x29')][_0x1f1889[_0x6af7('0x22')][_0x139bac]['queue']]=[];ami[_0x6af7('0xaa')]({'actionid':_0x139bac,'action':_0x6af7('0x1f3'),'queue':_0xb881c1[_0x6af7('0x40')]})['catch'](function(){_0x1f1889[_0x6af7('0xc6')](_0xb881c1);_0x1f1889[_0x6af7('0xb7')]({'active':![],'ContactId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xcd')],'ListId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xce')],'VoiceQueueId':_0x1f1889['actions'][_0x139bac][_0x6af7('0xd0')]||undefined,'CampaignId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1f1889[_0x6af7('0x22')][_0x139bac];});}else{loggerBooked['info'](_0x6af7('0x1f4'),JSON[_0x6af7('0x49')](_0xb881c1[_0x6af7('0x132')]),_0x6af7('0x1f5'),_0xb881c1[_0x6af7('0x40')]);_0x1f1889['updateOriginated'](_0xb881c1);_0x1f1889[_0x6af7('0xb7')]({'active':![],'ContactId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xcd')],'ListId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xce')],'VoiceQueueId':_0x1f1889[_0x6af7('0x22')][_0x139bac][_0x6af7('0xd0')]||undefined,'CampaignId':_0x1f1889['actions'][_0x139bac][_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1f6')));delete _0x1f1889['actions'][_0x139bac];}}else{return _0x1f1889[_0x6af7('0x1f7')](_0xb881c1,_0x59e90f);}}else{if(getDiff(_0x59e90f[_0x6af7('0x1f8')])<_0xb881c1[_0x6af7('0x1f9')]*0x3c){if(_0x59e90f[_0x6af7('0x166')]&&!_0x59e90f[_0x6af7('0x166')][_0x6af7('0x1fa')]){_0x1f1889['preview']['run'](_0x59e90f['id'])[_0x6af7('0x1c')](function(){_0x1f1889[_0x6af7('0xc6')](_0xb881c1);});}else{_0x1f1889[_0x6af7('0xb9')]({'active':![]},_0x59e90f['id'],0x1)[_0x6af7('0x1c')](function(){_0x1f1889[_0x6af7('0xc6')](_0xb881c1);});}}else{_0xb881c1[_0x6af7('0x66')]+=0x1;_0x1f1889[_0x6af7('0xc6')](_0xb881c1);if(_0xb881c1[_0x6af7('0x1fb')]){_0x1f1889[_0x6af7('0xb7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59e90f[_0x6af7('0xcd')],'ListId':_0x59e90f[_0x6af7('0xce')],'VoiceQueueId':_0x59e90f['VoiceQueueId']||undefined,'CampaignId':_0x59e90f[_0x6af7('0xd1')]||undefined})[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1fc')));_0x1f1889[_0x6af7('0xc4')](createObjHistory(_0xb881c1,_0x59e90f,_0x6af7('0x1fd'),0x17,_0x6af7('0x1fe')))[_0x6af7('0xab')](loggerCatch(_0x6af7('0x1ff')));}else{_0x1f1889[_0x6af7('0xcb')](createObjHistory(_0xb881c1,_0x59e90f,'RECALLFAILEDTIMEOUT',0x16,_0x6af7('0x200')),'[Originate][HistoryRecallClose][historyCatch]',_0x6af7('0x201'));}}}}else{_0xb881c1[_0x6af7('0x5f')]+=0x1;_0x1f1889[_0x6af7('0xcb')](createObjHistory(_0xb881c1,_0x59e90f,_0x6af7('0x202'),0xd,_0x6af7('0x203')),'[Originate][historyBlacklist]',_0x6af7('0x204'));throw'inBlackList';}};};Dialer[_0x6af7('0x1a')][_0x6af7('0x16a')]=function(_0x41b02c){var _0x424dda=this;var _0xca8c3e=_0x41b02c[_0x6af7('0x205')]-_0x41b02c[_0x6af7('0x73')]-_0x41b02c['temp'];emitCampaignSummary(_0x41b02c);if(_0xca8c3e>0x0){if(_0xca8c3e>this[_0x6af7('0x21')]){_0xca8c3e=this[_0x6af7('0x21')];}_0x41b02c[_0x6af7('0xbc')]+=_0xca8c3e;this[_0x6af7('0xbe')](_0x41b02c['id'],_0xca8c3e,_0x41b02c[_0x6af7('0x206')],_0x41b02c)[_0x6af7('0x39')](function(_0x55e40b){_0x41b02c['temp']-=_0xca8c3e;_0x41b02c[_0x6af7('0xbc')]=_0x41b02c[_0x6af7('0xbc')]>0x0?_0x41b02c[_0x6af7('0xbc')]:0x0;if(!checkContactEmpty(_0x55e40b)){_0x41b02c[_0x6af7('0x3c')]=_0x6af7('0x9c');logger['info'](_0x6af7('0x207')+_0x41b02c[_0x6af7('0x40')]);}else{_0x41b02c[_0x6af7('0x73')]+=_0x55e40b[_0x6af7('0x94')];_0x41b02c[_0x6af7('0x3c')]=_0x6af7('0x208');for(var _0x5e58eb=0x0;_0x5e58eb<_0x55e40b[_0x6af7('0x94')];_0x5e58eb+=0x1){_0x41b02c['ivrTotalCallsDays']+=0x1;if(_[_0x6af7('0xdb')](_0x55e40b[_0x5e58eb])||_['isNil'](_0x55e40b[_0x5e58eb][_0x6af7('0x178')])||_[_0x6af7('0xdb')](_0x55e40b[_0x5e58eb][_0x6af7('0x178')][_0x6af7('0x179')])){_0x424dda[_0x6af7('0x209')]('[actionOriginate]\x20',_0x41b02c,_0x55e40b[_0x5e58eb]);}else{_0x424dda['checkIsBlackListIvr'](_[_0x6af7('0xcc')](_0x55e40b[_0x5e58eb],[_0x6af7('0xd1'),_0x6af7('0x20a')]))['then'](_0x424dda[_0x6af7('0x20b')](_0x41b02c,_0x55e40b[_0x5e58eb]))[_0x6af7('0xab')](_0x424dda[_0x6af7('0xc9')]('[actionOriginateIvr]\x20',_0x41b02c));}}}})[_0x6af7('0xab')](loggerGetContactDialer(_0x6af7('0x20c'),_0x41b02c,_0xca8c3e));}};Dialer[_0x6af7('0x1a')]['handlePower']=function(_0xbbc7a8,_0xe35203){var _0x4446bf=this;var _0x33d7c7=[];var _0x48a82d=_0xe35203>=0x1?_0xe35203:0x1;if(_0xbbc7a8[_0x6af7('0x15e')]===_0x6af7('0xa')){_0x48a82d=0x1;}var _0x7b314d=Math[_0x6af7('0x20d')](_0xbbc7a8[_0x6af7('0x51')]*_0x48a82d)-_0xbbc7a8[_0x6af7('0x73')]-_0xbbc7a8[_0x6af7('0xbc')];emitVoiceQueueSummary(_0xbbc7a8);if(_0xbbc7a8[_0x6af7('0x20e')]>0x0){var _0x549cc0=_0xbbc7a8['dialLimitQueue']-_0xbbc7a8[_0x6af7('0x73')]-_0xbbc7a8[_0x6af7('0x57')]-_0xbbc7a8[_0x6af7('0xbc')]-_0xbbc7a8[_0x6af7('0x53')];if(_0x7b314d>_0x549cc0){_0x7b314d=_0x549cc0;}}if(_0x7b314d>0x0){if(_0xbbc7a8[_0x6af7('0x15e')]==='booked'){_0x7b314d=0x1;}if(_0x7b314d>this[_0x6af7('0x21')]){_0x7b314d=this[_0x6af7('0x21')];}_0xbbc7a8[_0x6af7('0xbc')]+=_0x7b314d;for(var _0x3438ce in this['agents']){if(typeof this[_0x6af7('0x1f')][_0x3438ce]!=='undefined'){if(this[_0x6af7('0x1f')][_0x3438ce][_0x6af7('0xa4')]===_0x6af7('0x20f')&&this['agents'][_0x3438ce][_0x6af7('0xd7')]==='reachable'){_0x33d7c7[_0x6af7('0x12f')](this[_0x6af7('0x1f')][_0x3438ce]['id']);}}}this[_0x6af7('0xbb')](_0xbbc7a8['id'],_0x33d7c7,_0x7b314d,_0xbbc7a8[_0x6af7('0x206')],_0xbbc7a8)[_0x6af7('0x39')](function(_0x5662cb){_0xbbc7a8[_0x6af7('0xbc')]-=_0x7b314d;_0xbbc7a8['temp']=_0xbbc7a8['temp']>0x0?_0xbbc7a8[_0x6af7('0xbc')]:0x0;if(!checkContactEmpty(_0x5662cb)){_0x4446bf[_0x6af7('0xaf')](_0xbbc7a8)[_0x6af7('0x39')](sendMessageReschedule(_0xbbc7a8))['catch'](loggerCatch(_0x6af7('0xb1')));}else{_0xbbc7a8[_0x6af7('0x73')]+=_0x5662cb[_0x6af7('0x94')];_0xbbc7a8[_0x6af7('0x3c')]=_0xbbc7a8[_0x6af7('0x15e')]===_0x6af7('0xa')?_0x6af7('0x210'):_0x6af7('0x208');for(var _0x56c043=0x0;_0x56c043<_0x5662cb[_0x6af7('0x94')];_0x56c043+=0x1){if(_['isNil'](_0x5662cb[_0x56c043])||_['isNil'](_0x5662cb[_0x56c043][_0x6af7('0x178')])||_[_0x6af7('0xdb')](_0x5662cb[_0x56c043]['Contact']['phone'])){_0x4446bf[_0x6af7('0x209')](_0x6af7('0x211'),_0xbbc7a8,_0x5662cb[_0x56c043]);}else{_0x4446bf[_0x6af7('0xb2')](_['pick'](_0x5662cb[_0x56c043],[_0x6af7('0xd0'),_0x6af7('0x20a')]))[_0x6af7('0x39')](_0x4446bf[_0x6af7('0x20b')](_0xbbc7a8,_0x5662cb[_0x56c043]))[_0x6af7('0xab')](_0x4446bf[_0x6af7('0xc9')]('[actionOriginate]\x20',_0xbbc7a8));}}}})['catch'](loggerGetContactDialer(_0x6af7('0x212'),_0xbbc7a8,_0x7b314d));}};Dialer[_0x6af7('0x1a')][_0x6af7('0x8d')]=function(_0x65f3b8){if(_0x65f3b8[_0x6af7('0x20e')]>0x0){var _0x36b714=_0x65f3b8[_0x6af7('0x20e')]-_0x65f3b8[_0x6af7('0x73')]-_0x65f3b8[_0x6af7('0x57')];if(_0x36b714>0x0){this[_0x6af7('0x213')](_0x65f3b8);}else{loggerPredictiveCalls[_0x6af7('0x7d')](_0x6af7('0x214'));}}else{this[_0x6af7('0x213')](_0x65f3b8);}};Dialer['prototype'][_0x6af7('0x213')]=function(_0x435d4d){var _0x481f58=this;var _0x21a499=[];_0x435d4d[_0x6af7('0x73')]+=0x1;for(var _0x4dbba9 in this[_0x6af7('0x1f')]){if(typeof this[_0x6af7('0x1f')][_0x4dbba9]!==_0x6af7('0x95')){if(this[_0x6af7('0x1f')][_0x4dbba9]['state']===_0x6af7('0x20f')&&this[_0x6af7('0x1f')][_0x4dbba9][_0x6af7('0xd7')]==='reachable'){_0x21a499[_0x6af7('0x12f')](this['agents'][_0x4dbba9]['id']);}}}this['getContactDialer'](_0x435d4d['id'],_0x21a499,0x1,_0x435d4d[_0x6af7('0x206')],_0x435d4d)['then'](function(_0x33001b){if(!checkContactEmpty(_0x33001b)){checkContactLowerLimitOriginate(_0x435d4d,0x1,0x0);_0x481f58[_0x6af7('0xaf')](_0x435d4d)[_0x6af7('0x39')](sendMessageReschedule(_0x435d4d))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x435d4d['message']=_0x6af7('0x208');if(_[_0x6af7('0xdb')](_0x33001b[0x0])||_[_0x6af7('0xdb')](_0x33001b[0x0]['Contact'])||_[_0x6af7('0xdb')](_0x33001b[0x0][_0x6af7('0x178')]['phone'])){_0x481f58[_0x6af7('0x209')]('[actionOriginate]\x20',_0x435d4d,_0x33001b[0x0]);}else{_0x481f58['checkIsBlackList'](_[_0x6af7('0xcc')](_0x33001b[0x0],[_0x6af7('0xd0'),_0x6af7('0x20a')]))[_0x6af7('0x39')](_0x481f58[_0x6af7('0x20b')](_0x435d4d,_0x33001b[0x0]))[_0x6af7('0xab')](_0x481f58[_0x6af7('0xc9')](_0x6af7('0x215'),_0x435d4d));}}})['catch'](loggerGetContactDialer(_0x6af7('0x216'),_0x435d4d,0x1));emitVoiceQueueSummary(_0x435d4d);};Dialer['prototype'][_0x6af7('0x1e3')]=function(_0x4dc5ba,_0x1c7a7f,_0x21cead,_0x2c38c3,_0x59d13b,_0xbc6229){loggerPredictive[_0x6af7('0x7d')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x217'),_0x4dc5ba);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x218'),_0x1c7a7f);loggerPredictive['info'](_0x6af7('0x219'),_0x21cead);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x21a'),_0x2c38c3);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x21b'),_0x59d13b);loggerPredictive['info'](_0x6af7('0x21c'));return new BPromise(function(_0x45de9d,_0x435328){if(_0x4dc5ba<=0x0||isNaN(_0x4dc5ba)){return _0x435328(msgResponse(_0x6af7('0x21d'),_0x6af7('0x48'),_0x6af7('0x21e')+_0x4dc5ba));}if(_0x21cead<=0x0||isNaN(_0x21cead)){return _0x435328(msgResponse(_0x6af7('0x21d'),'Error',_0x6af7('0x21f')+_0x21cead));}if(_0x2c38c3<=0x0||isNaN(_0x2c38c3)){return _0x435328(msgResponse(_0x6af7('0x21d'),_0x6af7('0x48'),'p\x20=\x20'+_0x2c38c3));}if(_0x1c7a7f<=0x0||isNaN(_0x1c7a7f)){return _0x435328(msgResponse(_0x6af7('0x21d'),_0x6af7('0x48'),_0x6af7('0x220')+_0x1c7a7f));}if(_0x59d13b<=0x0||isNaN(_0x59d13b)){return _0x435328(msgResponse(_0x6af7('0x21d'),_0x6af7('0x48'),_0x6af7('0x221')+_0x59d13b));}_0xbc6229=_0xbc6229||0x0;var _0x834423=0x1/_0x21cead;var _0x4e8f1c=0x0;var _0x5c1ab8=0x0;var _0x4eb037=0x0;var _0xdc5581=0x0;for(var _0x145b0e=0x0;_0x4eb037<_0x59d13b;_0x145b0e+=0x1){_0x5c1ab8=_0x145b0e/_0x1c7a7f;_0x4e8f1c=(_0x2c38c3*_0x5c1ab8+_0xbc6229)/_0x834423;_0x4eb037=erlangb(_0x4e8f1c,_0x4dc5ba);_0xdc5581=_0x4e8f1c/_0x4dc5ba*(0x1-erlangb(_0x4e8f1c,_0x4dc5ba));}return _0x45de9d({'erlangCalls':_0x145b0e,'erlangCallToSecond':_0x1c7a7f/_0x145b0e,'erlangAbandonmentRate':_0x4eb037,'erlangBusyFactor':_0xdc5581});});};Dialer[_0x6af7('0x1a')][_0x6af7('0x1e4')]=function(_0x163c80,_0x41b64a,_0x4f735c,_0x35eb2a,_0xf424e8,_0x4aa4a9){loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x222'));loggerPredictive[_0x6af7('0x7d')]('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',_0x163c80);loggerPredictive['info'](_0x6af7('0x218'),_0x41b64a);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f735c);loggerPredictive[_0x6af7('0x7d')](_0x6af7('0x21a'),_0x35eb2a);loggerPredictive[_0x6af7('0x7d')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf424e8);loggerPredictive[_0x6af7('0x7d')]('---------------------------');return new BPromise(function(_0x1556ba,_0x3207fc){if(_0x163c80<=0x0||isNaN(_0x163c80)){return _0x3207fc(msgResponse('[busyFactor]','Error',_0x6af7('0x21e')+_0x163c80));}if(_0x4f735c<=0x0||isNaN(_0x4f735c)){return _0x3207fc(msgResponse(_0x6af7('0x223'),_0x6af7('0x48'),_0x6af7('0x21f')+_0x4f735c));}if(_0x35eb2a<=0x0||isNaN(_0x35eb2a)){return _0x3207fc(msgResponse(_0x6af7('0x223'),_0x6af7('0x48'),_0x6af7('0x224')+_0x35eb2a));}if(_0x41b64a<=0x0||isNaN(_0x41b64a)){return _0x3207fc(msgResponse(_0x6af7('0x223'),_0x6af7('0x48'),'interval\x20=\x20'+_0x41b64a));}if(_0xf424e8<=0x0||isNaN(_0xf424e8)){return _0x3207fc(msgResponse(_0x6af7('0x223'),_0x6af7('0x48'),_0x6af7('0x225')+_0xf424e8));}_0x4aa4a9=_0x4aa4a9||0x0;var _0x533722=0x1/_0x4f735c;var _0x54e570=0x0;var _0x3992d8=0x0;var _0x2f3540=0x0;var _0x1798f8=0x0;for(var _0x4cbfb7=0x0;_0x1798f8<_0xf424e8;_0x4cbfb7+=0x1){_0x3992d8=_0x4cbfb7/_0x41b64a;_0x54e570=(_0x35eb2a*_0x3992d8+_0x4aa4a9)/_0x533722;_0x2f3540=erlangb(_0x54e570,_0x163c80);_0x1798f8=_0x54e570/_0x163c80*(0x1-erlangb(_0x54e570,_0x163c80));}return _0x1556ba({'erlangCalls':_0x4cbfb7,'erlangCallToSecond':_0x41b64a/_0x4cbfb7,'erlangAbandonmentRate':_0x2f3540,'erlangBusyFactor':_0x1798f8});});};module[_0x6af7('0x226')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index f1e91cd..a3a9b75 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09d7=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','droptime','endtime','ringtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds'];(function(_0x58b7a4,_0x3cf180){var _0x5aef32=function(_0x3d0e3){while(--_0x3d0e3){_0x58b7a4['push'](_0x58b7a4['shift']());}};_0x5aef32(++_0x3cf180);}(_0x09d7,0x195));var _0x709d=function(_0xb1efcd,_0xc13d1d){_0xb1efcd=_0xb1efcd-0x0;var _0xa1ccc7=_0x09d7[_0xb1efcd];return _0xa1ccc7;};'use strict';var util=require(_0x709d('0x0'));var _=require('lodash');var moment=require(_0x709d('0x1'));function getSeconds(_0x2fbe18,_0x426217){var _0x42ca7f=moment(_0x2fbe18)[_0x709d('0x2')](0x0);var _0x4e97d3=moment(_0x426217)[_0x709d('0x2')](0x0);return _0x42ca7f[_0x709d('0x3')](_0x4e97d3,_0x709d('0x4'));}function QueueCallerAbandon(_0x291acc,_0x253f2d){this[_0x709d('0x5')]=_0x291acc[_0x709d('0x5')];this[_0x709d('0x6')]=_0x291acc[_0x709d('0x6')];this[_0x709d('0x7')]=_0x291acc['type']===_0x709d('0x8')?_0x709d('0x9'):_0x291acc[_0x709d('0x6')];this['countbusyretry']=_0x291acc[_0x709d('0xa')];this['countcongestionretry']=_0x291acc[_0x709d('0xb')];this['countnoanswerretry']=_0x291acc[_0x709d('0xc')];this[_0x709d('0xd')]=_0x291acc[_0x709d('0xa')]+_0x291acc[_0x709d('0xb')]+_0x291acc['countnoanswerretry']+_0x291acc[_0x709d('0xe')]+_0x291acc[_0x709d('0xf')]+_0x291acc[_0x709d('0x10')]+_0x291acc[_0x709d('0x11')]+_0x291acc['countagentrejectretry'];this['countnosuchnumberretry']=_0x291acc['countnosuchnumberretry'];this['countdropretry']=_0x291acc[_0x709d('0xf')];this[_0x709d('0x10')]=_0x291acc[_0x709d('0x10')];this['countmachineretry']=_0x291acc[_0x709d('0x11')];this[_0x709d('0x12')]=_0x291acc[_0x709d('0x12')];this[_0x709d('0x13')]=_0x253f2d[_0x709d('0x13')];this['calleridname']=_0x291acc[_0x709d('0x14')];this['calleridnum']=_0x291acc[_0x709d('0x15')];this[_0x709d('0x16')]=_0x291acc['starttime'];this[_0x709d('0x17')]=_0x291acc['responsetime'];this[_0x709d('0x18')]=_0x291acc['droptime'];this[_0x709d('0x19')]=this[_0x709d('0x18')];this[_0x709d('0x1a')]=getSeconds(_0x291acc['responsetime'],_0x291acc[_0x709d('0x16')]);this['holdtime']=getSeconds(this['droptime'],_0x291acc['responsetime']);this[_0x709d('0x1b')]=0x0;this[_0x709d('0x9')]=_0x253f2d['queue'];this['membername']=_0x253f2d[_0x709d('0x1c')];this['reason']=_0x253f2d[_0x709d('0x1d')];this[_0x709d('0x1e')]=_0x291acc['callback'];this[_0x709d('0x1f')]=_0x291acc[_0x709d('0x1f')];this[_0x709d('0x20')]=_0x291acc[_0x709d('0x20')];this[_0x709d('0x21')]=_0x291acc[_0x709d('0x21')];this[_0x709d('0x22')]=_0x291acc['ContactId'];this[_0x709d('0x23')]=_0x291acc[_0x709d('0x23')];this[_0x709d('0x24')]=_0x291acc[_0x709d('0x24')];this['VoiceQueueId']=_0x291acc[_0x709d('0x25')];this['CampaignId']=_0x291acc['CampaignId'];this[_0x709d('0x26')]=_0x291acc['originatecalleridnum']||'';this[_0x709d('0x27')]=_0x291acc[_0x709d('0x27')]||'';}module[_0x709d('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x4816=['membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x4816,0x1bc));var _0x6481=function(_0x10265e,_0xf3d38c){_0x10265e=_0x10265e-0x0;var _0x491c0e=_0x4816[_0x10265e];return _0x491c0e;};'use strict';var util=require('util');var _=require(_0x6481('0x0'));var moment=require(_0x6481('0x1'));function getSeconds(_0x4863eb,_0x46be17){var _0x345475=moment(_0x4863eb)[_0x6481('0x2')](0x0);var _0x2c4406=moment(_0x46be17)['milliseconds'](0x0);return _0x345475[_0x6481('0x3')](_0x2c4406,_0x6481('0x4'));}function QueueCallerAbandon(_0x51314f,_0x1aa825){this[_0x6481('0x5')]=_0x51314f[_0x6481('0x5')];this['type']=_0x51314f[_0x6481('0x6')];this['campaigntype']=_0x51314f[_0x6481('0x6')]===_0x6481('0x7')?_0x6481('0x8'):_0x51314f[_0x6481('0x6')];this['countbusyretry']=_0x51314f[_0x6481('0x9')];this[_0x6481('0xa')]=_0x51314f[_0x6481('0xa')];this['countnoanswerretry']=_0x51314f[_0x6481('0xb')];this[_0x6481('0xc')]=_0x51314f[_0x6481('0x9')]+_0x51314f[_0x6481('0xa')]+_0x51314f['countnoanswerretry']+_0x51314f[_0x6481('0xd')]+_0x51314f[_0x6481('0xe')]+_0x51314f[_0x6481('0xf')]+_0x51314f[_0x6481('0x10')]+_0x51314f[_0x6481('0x11')];this[_0x6481('0xd')]=_0x51314f[_0x6481('0xd')];this[_0x6481('0xe')]=_0x51314f[_0x6481('0xe')];this[_0x6481('0xf')]=_0x51314f[_0x6481('0xf')];this[_0x6481('0x10')]=_0x51314f['countmachineretry'];this[_0x6481('0x11')]=_0x51314f[_0x6481('0x11')];this[_0x6481('0x12')]=_0x1aa825[_0x6481('0x12')];this[_0x6481('0x13')]=_0x51314f[_0x6481('0x14')];this[_0x6481('0x15')]=_0x51314f['number'];this[_0x6481('0x16')]=_0x51314f[_0x6481('0x16')];this[_0x6481('0x17')]=_0x51314f[_0x6481('0x17')];this[_0x6481('0x18')]=_0x51314f['droptime'];this[_0x6481('0x19')]=this[_0x6481('0x18')];this[_0x6481('0x1a')]=getSeconds(_0x51314f[_0x6481('0x17')],_0x51314f[_0x6481('0x16')]);this[_0x6481('0x1b')]=getSeconds(this[_0x6481('0x18')],_0x51314f[_0x6481('0x17')]);this[_0x6481('0x1c')]=0x0;this['queue']=_0x1aa825[_0x6481('0x8')];this[_0x6481('0x1d')]=_0x1aa825['connectedlinename'];this[_0x6481('0x1e')]=_0x1aa825[_0x6481('0x1e')];this[_0x6481('0x1f')]=_0x51314f[_0x6481('0x1f')];this[_0x6481('0x20')]=_0x51314f[_0x6481('0x20')];this[_0x6481('0x21')]=_0x51314f[_0x6481('0x21')];this[_0x6481('0x22')]=_0x51314f[_0x6481('0x22')];this['ContactId']=_0x51314f[_0x6481('0x23')];this[_0x6481('0x24')]=_0x51314f[_0x6481('0x24')];this['UserId']=_0x51314f[_0x6481('0x25')];this['VoiceQueueId']=_0x51314f[_0x6481('0x26')];this[_0x6481('0x27')]=_0x51314f[_0x6481('0x27')];this['originatecalleridnum']=_0x51314f[_0x6481('0x28')]||'';this[_0x6481('0x29')]=_0x51314f[_0x6481('0x29')]||'';}module[_0x6481('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 9b43f39..d74e810 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(_0xd86c7,_0x42ee8b){var _0xf1771b=function(_0x5b5a84){while(--_0x5b5a84){_0xd86c7['push'](_0xd86c7['shift']());}};_0xf1771b(++_0x42ee8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x1c6ed2,_0x2e8930){var _0x2ff441=function(_0x595616){while(--_0x595616){_0x1c6ed2['push'](_0x1c6ed2['shift']());}};_0x2ff441(++_0x2e8930);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 210d183..8435a70 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 _0x4024=['Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','tiff2pdf','../../../config/logger','fax','./channel','./util/util','./action','../rpc/attachment','channels','trunks','actions','syncNewchannel','varset','syncVarSet','newstate','syncNewState','bind','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channel','uniqueid','faxAccounts','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0x4024,0x89));var _0x4402=function(_0x46c451,_0x490bed){_0x46c451=_0x46c451-0x0;var _0x441b9f=_0x4024[_0x46c451];return _0x441b9f;};'use strict';var util=require(_0x4402('0x0'));var _=require(_0x4402('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var path=require('path');var tiff2pdf=require(_0x4402('0x4'));var gs=require('./util/gs');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x4402('0x7'));var ut=require(_0x4402('0x8'));var Action=require(_0x4402('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4402('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5c0b70){this[_0x4402('0xb')]={};this['faxAccounts']=_0x5c0b70['faxAccounts'];this[_0x4402('0xc')]=_0x5c0b70['trunks'];this[_0x4402('0xd')]={};ami['on']('newchannel',this[_0x4402('0xe')]['bind'](this));ami['on'](_0x4402('0xf'),this[_0x4402('0x10')]['bind'](this));ami['on'](_0x4402('0x11'),this[_0x4402('0x12')][_0x4402('0x13')](this));ami['on']('newexten',this[_0x4402('0x14')][_0x4402('0x13')](this));ami['on'](_0x4402('0x15'),this[_0x4402('0x16')][_0x4402('0x13')](this));ami['on'](_0x4402('0x17'),this[_0x4402('0x18')][_0x4402('0x13')](this));ami['on'](_0x4402('0x19'),this[_0x4402('0x1a')][_0x4402('0x13')](this));ami['on'](_0x4402('0x1b'),this[_0x4402('0x1c')][_0x4402('0x13')](this));}Fax[_0x4402('0x1d')][_0x4402('0xe')]=function(_0x399c24){if(_0x399c24[_0x4402('0x1e')]===_0x4402('0x1f')){for(var _0x231382 in this['faxAccounts']){if(this['faxAccounts'][_0x4402('0x20')](_0x231382)){if(_0x399c24[_0x4402('0x21')]===this['faxAccounts'][_0x231382][_0x4402('0x22')]){this[_0x4402('0xb')][_0x399c24['uniqueid']]={};this[_0x4402('0xb')][_0x399c24['uniqueid']]['channel']=_0x399c24[_0x4402('0x23')];this[_0x4402('0xb')][_0x399c24[_0x4402('0x24')]]['id']=this['faxAccounts'][_0x231382]['id'];this[_0x4402('0xb')][_0x399c24['uniqueid']]['name']=this[_0x4402('0x25')][_0x231382][_0x4402('0x26')];logger[_0x4402('0x27')](_0x399c24[_0x4402('0x24')],_0x4402('0x28'));}}}}if(this[_0x4402('0xd')][_0x399c24[_0x4402('0x24')]]){this[_0x4402('0xb')][_0x399c24[_0x4402('0x24')]]={};this['channels'][_0x399c24[_0x4402('0x24')]]['channel']=_0x399c24[_0x4402('0x23')];logger[_0x4402('0x27')](_0x399c24[_0x4402('0x24')],_0x4402('0x28'));}};Fax['prototype'][_0x4402('0x10')]=function(_0x4e9cb5){if(this['channels'][_0x4e9cb5[_0x4402('0x24')]]){for(var _0x395e49 in _0x4e9cb5[_0x4402('0x29')]){if(_0x4e9cb5[_0x4402('0x29')][_0x4402('0x20')](_0x395e49)){this['channels'][_0x4e9cb5[_0x4402('0x24')]][_0x395e49]=_0x4e9cb5['value'];}}}};Fax[_0x4402('0x1d')][_0x4402('0x12')]=function(_0x42dd32){if(this['channels'][_0x42dd32[_0x4402('0x24')]]){this[_0x4402('0xb')][_0x42dd32[_0x4402('0x24')]][_0x4402('0x2a')]=_0x42dd32[_0x4402('0x2a')];this[_0x4402('0xb')][_0x42dd32[_0x4402('0x24')]][_0x4402('0x2b')]=_0x42dd32[_0x4402('0x2b')];}};Fax[_0x4402('0x1d')][_0x4402('0x14')]=function(_0x50748c){if(this[_0x4402('0xb')][_0x50748c['uniqueid']]){for(var _0x336168 in _0x50748c['variable']){if(_0x50748c[_0x4402('0x29')][_0x4402('0x20')](_0x336168)){this[_0x4402('0xb')][_0x50748c[_0x4402('0x24')]][_0x336168]=_0x50748c[_0x4402('0x2c')];}}}};Fax['prototype'][_0x4402('0x16')]=function(_0x3fa7ae){if(this[_0x4402('0xb')][_0x3fa7ae['uniqueid']]){this[_0x4402('0xb')][_0x3fa7ae[_0x4402('0x24')]]['operation']=_0x3fa7ae[_0x4402('0x2d')];this[_0x4402('0xb')][_0x3fa7ae[_0x4402('0x24')]][_0x4402('0x2e')]=_0x3fa7ae[_0x4402('0x2e')];this[_0x4402('0xb')][_0x3fa7ae[_0x4402('0x24')]][_0x4402('0x22')]=_0x3fa7ae[_0x4402('0x22')];this['channels'][_0x3fa7ae[_0x4402('0x24')]][_0x4402('0x2f')]=_0x3fa7ae[_0x4402('0x2f')];logger['info'](_0x3fa7ae[_0x4402('0x24')],_0x4402('0x30'));}};Fax['prototype']['syncReceiveFax']=function(_0x2b9d51){var _0x5b7c2e=this;if(this[_0x4402('0xb')][_0x2b9d51[_0x4402('0x24')]]){var _0x5569a2=this['channels'][_0x2b9d51['uniqueid']]['id'];this[_0x4402('0xb')][_0x2b9d51[_0x4402('0x24')]][_0x4402('0x31')]=_0x2b9d51[_0x4402('0x31')];this['channels'][_0x2b9d51[_0x4402('0x24')]][_0x4402('0x32')]=_0x2b9d51[_0x4402('0x32')];this['channels'][_0x2b9d51[_0x4402('0x24')]]['localstationid']=_0x2b9d51[_0x4402('0x22')];this[_0x4402('0xb')][_0x2b9d51['uniqueid']][_0x4402('0x33')]=_0x2b9d51['resolution'];this[_0x4402('0xb')][_0x2b9d51[_0x4402('0x24')]]['transferrate']=_0x2b9d51[_0x4402('0x34')];this[_0x4402('0xb')][_0x2b9d51[_0x4402('0x24')]][_0x4402('0x2f')]=_0x2b9d51['filename'];this['channels'][_0x2b9d51[_0x4402('0x24')]]['calleridnum']=_0x2b9d51[_0x4402('0x35')];if(this[_0x4402('0xb')][_0x2b9d51[_0x4402('0x24')]][_0x4402('0x32')]>0x0){tiff2pdf(_0x2b9d51[_0x4402('0x2f')],_0x4402('0x36'),function(_0x173040){logger[_0x4402('0x27')](_0x2b9d51[_0x4402('0x24')],_0x4402('0x37'),_0x173040['message']);attachment[_0x4402('0x38')]({'name':path[_0x4402('0x39')](_0x2b9d51['filename'])[_0x4402('0x26')],'basename':path[_0x4402('0x39')](_0x2b9d51['filename'])[_0x4402('0x26')]+_0x4402('0x3a'),'type':_0x4402('0x3b')})[_0x4402('0x3c')](function(_0x13a3a4){faxAccount['notify'](_0x5569a2,{'from':_0x2b9d51[_0x4402('0x35')],'mapKey':_0x4402('0x6'),'body':path[_0x4402('0x39')](_0x2b9d51[_0x4402('0x2f')])[_0x4402('0x26')]+_0x4402('0x3a'),'AttachmentId':_0x13a3a4['id']})[_0x4402('0x3d')](function(_0x136c9c){logger[_0x4402('0x3e')](_0x2b9d51[_0x4402('0x24')],_0x4402('0x3f'),JSON['stringify'](_0x136c9c));});})[_0x4402('0x3d')](function(_0x4ff240){logger[_0x4402('0x3e')](_0x2b9d51[_0x4402('0x24')],'\x20receiveFax\x20',JSON[_0x4402('0x40')](_0x4ff240));});});}logger[_0x4402('0x27')](_0x2b9d51[_0x4402('0x24')],_0x4402('0x41'));}};Fax[_0x4402('0x1d')][_0x4402('0x1c')]=function(_0x5b094b){if(this[_0x4402('0xd')][_0x5b094b[_0x4402('0x24')]]){_[_0x4402('0x42')](this[_0x4402('0xb')][_0x5b094b[_0x4402('0x24')]],_[_0x4402('0x43')](_0x5b094b,[_0x4402('0x44'),_0x4402('0x45')]));}};function updateStatus(_0x216488){if(_0x216488['AttachmentId']){faxMessage['update'](_0x216488['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x4402('0x3c')](function(_0x29e67b){ut[_0x4402('0x46')](_0x4402('0x47'),_0x29e67b);})['catch'](function(_0x169bb2){ut[_0x4402('0x46')](_0x4402('0x48'),_0x169bb2);});}else{ut[_0x4402('0x46')](_0x4402('0x49'));}}Fax[_0x4402('0x1d')][_0x4402('0x4a')]=function(_0x53d306,_0x325b20,_0x2a8085){var _0x38e6d1=this;var _0x11c162={};if(_0x325b20){_0x11c162={'read':_0x325b20};}else{_0x11c162={'failMessage':_0x2a8085};}if(this[_0x4402('0xd')][_0x53d306][_0x4402('0x4b')]){faxMessage['update'](this[_0x4402('0xd')][_0x53d306][_0x4402('0x4b')],_0x11c162)[_0x4402('0x3c')](function(_0x295c9b){ut[_0x4402('0x46')](_0x4402('0x4c'),_0x295c9b);})[_0x4402('0x3d')](function(_0x5dbf62){ut['logger'](_0x4402('0x4d'),_0x5dbf62);})[_0x4402('0x4e')](function(){delete _0x38e6d1[_0x4402('0xb')][_0x53d306];delete _0x38e6d1['actions'][_0x53d306];});}else{ut['logger'](_0x4402('0x4f'));delete this[_0x4402('0xb')][_0x53d306];delete this[_0x4402('0xd')][_0x53d306];}};Fax[_0x4402('0x1d')][_0x4402('0x1a')]=function(_0x37ba14){var _0x248104=this;if(this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]]){if(this[_0x4402('0xd')][_0x37ba14[_0x4402('0x24')]]){this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]]['id']=this['actions'][_0x37ba14[_0x4402('0x24')]]['id'];this['channels'][_0x37ba14[_0x4402('0x24')]]['name']=this[_0x4402('0xd')][_0x37ba14[_0x4402('0x24')]][_0x4402('0x26')];}logger[_0x4402('0x27')](_0x37ba14[_0x4402('0x24')],this[_0x4402('0xd')][_0x37ba14['uniqueid']]?_0x4402('0x50'):_0x4402('0x51'),JSON[_0x4402('0x40')](this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]]));if(this['actions'][_0x37ba14[_0x4402('0x24')]]){if(this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]][_0x4402('0x52')]>0x0&&this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]][_0x4402('0x15')]===_0x4402('0x53')){this['updateStatus'](_0x37ba14[_0x4402('0x24')],!![]);}else{this[_0x4402('0x4a')](_0x37ba14['uniqueid'],![],this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x4402('0xb')][_0x37ba14[_0x4402('0x24')]][_0x4402('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x4402('0x1d')][_0x4402('0x55')]=function(_0x30e49b){var _0x55f261=this;return new BPromise(function(_0x2fe275,_0x41a2c6){_0x55f261[_0x4402('0x56')](_0x30e49b,_0x55f261['faxAccounts'][_0x30e49b[_0x4402('0x57')]])[_0x4402('0x3c')](function(_0x4f9865){ut['logger'](_0x4402('0x58'),_0x4f9865);_0x2fe275(ut['message'](_0x4402('0x59')));})[_0x4402('0x3d')](function(_0x4a83ac){ut['logger'](_0x4402('0x5a'),_0x4a83ac);updateStatus(_0x30e49b);_0x41a2c6(ut[_0x4402('0x5b')](_0x4402('0x5c')));});});};Fax[_0x4402('0x1d')]['checkAfterSend']=function(_0x1ee8a9){var _0x30e5d5=this;return new BPromise(function(_0x22ed41,_0x168095){var _0x2b2b40=_0x30e5d5[_0x4402('0x5d')](_0x30e5d5[_0x4402('0x25')][_0x1ee8a9['FaxAccountId']][_0x4402('0x5e')],_0x1ee8a9);if(_0x2b2b40[_0x4402('0x5f')]){_0x22ed41(ut['message']('Trunk\x20Reachable'));}else{_0x168095(ut[_0x4402('0x5b')](_0x2b2b40['message']));}});};function originate(_0x30569e,_0x586689,_0xc2ac06){return new BPromise(function(_0x10b89a,_0x22260b){if(_0xc2ac06){var _0x3f196a=util[_0x4402('0x60')](_0x4402('0x61'),path[_0x4402('0x39')](_0x30569e[_0x4402('0x62')])[_0x4402('0x26')],_0x30569e[_0x4402('0x62')]);gs[_0x4402('0x63')](_0x3f196a)[_0x4402('0x3c')](function(){_0x30569e[_0x4402('0x62')]=util[_0x4402('0x60')](_0x4402('0x64'),path[_0x4402('0x39')](_0x30569e['path'])[_0x4402('0x65')],path[_0x4402('0x39')](_0x30569e[_0x4402('0x62')])['name']);_0x586689[_0x4402('0x66')]=_0x30569e['path'];ut[_0x4402('0x46')](_0x4402('0x67'),'');ami[_0x4402('0x68')](ut[_0x4402('0x69')](_0x30569e,_0x586689))['then'](function(_0xac8513){_0x10b89a(_0xac8513);})['catch'](function(_0x127d47){_0x22260b(_0x127d47);});})[_0x4402('0x3d')](function(_0x24ee20){_0x22260b(_0x24ee20);});}else{ami['Action'](ut[_0x4402('0x69')](_0x30569e,_0x586689))['then'](function(_0x349ad1){_0x10b89a(_0x349ad1);})[_0x4402('0x3d')](function(_0x1be905){_0x22260b(_0x1be905);});}});}Fax[_0x4402('0x1d')][_0x4402('0x56')]=function(_0x1d0bf4,_0x19b427){var _0x2bed7c=this;return new BPromise(function(_0x438048,_0x5054f9){var _0x44d806=uuid['v4']();var _0x55a767=ut[_0x4402('0x6a')](_0x1d0bf4,_0x19b427);_0x2bed7c[_0x4402('0xd')][_0x44d806]=new Action(_0x44d806,_0x19b427,_0x1d0bf4);var _0x4734ef=_0x2bed7c[_0x4402('0xd')][_0x44d806];if(path[_0x4402('0x39')](_0x1d0bf4[_0x4402('0x62')])[_0x4402('0x6b')]==='.pdf'){originate(_0x4734ef,_0x55a767,!![])[_0x4402('0x3c')](function(_0x2a6dc1){_0x438048(_0x2a6dc1);})[_0x4402('0x3d')](function(_0x4c4845){_0x5054f9(_0x4c4845);});}else{originate(_0x4734ef,_0x55a767,![])[_0x4402('0x3c')](function(_0x59fc06){_0x438048(_0x59fc06);})[_0x4402('0x3d')](function(_0x4f3d70){_0x5054f9(_0x4f3d70);});}});};Fax[_0x4402('0x1d')][_0x4402('0x6c')]=function(_0x552962){return!_[_0x4402('0x6d')](_0x552962)&&!_['isNil'](_0x552962[_0x4402('0x26')])&&!_[_0x4402('0x6d')](_0x552962['active'])&&_0x552962[_0x4402('0x6e')]&&!_[_0x4402('0x6d')](this['trunks'][util[_0x4402('0x60')](_0x4402('0x6f'),_0x552962['name'])])&&!_[_0x4402('0x6d')](this[_0x4402('0xc')][util[_0x4402('0x60')](_0x4402('0x6f'),_0x552962[_0x4402('0x26')])][_0x4402('0x2e')])&&(this[_0x4402('0xc')][util[_0x4402('0x60')](_0x4402('0x6f'),_0x552962[_0x4402('0x26')])][_0x4402('0x2e')]===_0x4402('0x70')||this[_0x4402('0xc')][util[_0x4402('0x60')]('SIP/%s',_0x552962[_0x4402('0x26')])][_0x4402('0x2e')]==='unmonitored');};Fax[_0x4402('0x1d')]['checkTrunk']=function(_0x2c7ff5,_0x778945){if(!this[_0x4402('0x6c')](_0x2c7ff5)){ut['logger'](_0x4402('0x71'),_[_0x4402('0x6d')](_0x2c7ff5)?'':_0x2c7ff5[_0x4402('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4402('0x72')};}if(_[_0x4402('0x6d')](_0x778945[_0x4402('0x6')])){ut[_0x4402('0x46')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4402('0x40')](_0x778945));return{'isValid':![],'message':_0x4402('0x73')};}if(_[_0x4402('0x6d')](_0x778945[_0x4402('0x62')])){ut[_0x4402('0x46')](_0x4402('0x74'),JSON[_0x4402('0x40')](_0x778945));return{'isValid':![],'message':_0x4402('0x75')};}return{'isValid':!![],'message':_0x4402('0x76')};};module[_0x4402('0x77')]=Fax; \ No newline at end of file +var _0x0713=['syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','calleridnum','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','Fax\x20received','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState'];(function(_0x26e7c1,_0x27ad70){var _0x4ea8dd=function(_0x49c185){while(--_0x49c185){_0x26e7c1['push'](_0x26e7c1['shift']());}};_0x4ea8dd(++_0x27ad70);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x3071('0x0'));var uuid=require(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var path=require(_0x3071('0x3'));var tiff2pdf=require(_0x3071('0x4'));var gs=require('./util/gs');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var ami=require(_0x3071('0x7'));var rpcDb=require(_0x3071('0x8'));var Channel=require(_0x3071('0x9'));var ut=require(_0x3071('0xa'));var Action=require(_0x3071('0xb'));var faxAccount=require(_0x3071('0xc'));var attachment=require(_0x3071('0xd'));var faxMessage=require(_0x3071('0xe'));function Fax(_0x3e9a5e){this[_0x3071('0xf')]={};this[_0x3071('0x10')]=_0x3e9a5e['faxAccounts'];this[_0x3071('0x11')]=_0x3e9a5e[_0x3071('0x11')];this[_0x3071('0x12')]={};ami['on'](_0x3071('0x13'),this[_0x3071('0x14')]['bind'](this));ami['on'](_0x3071('0x15'),this[_0x3071('0x16')][_0x3071('0x17')](this));ami['on'](_0x3071('0x18'),this[_0x3071('0x19')]['bind'](this));ami['on']('newexten',this[_0x3071('0x1a')]['bind'](this));ami['on'](_0x3071('0x1b'),this[_0x3071('0x1c')]['bind'](this));ami['on'](_0x3071('0x1d'),this['syncReceiveFax'][_0x3071('0x17')](this));ami['on'](_0x3071('0x1e'),this[_0x3071('0x1f')][_0x3071('0x17')](this));ami['on'](_0x3071('0x20'),this[_0x3071('0x21')][_0x3071('0x17')](this));}Fax[_0x3071('0x22')][_0x3071('0x14')]=function(_0x344ea6){if(_0x344ea6['context']===_0x3071('0x23')){for(var _0x17dbda in this[_0x3071('0x10')]){if(this[_0x3071('0x10')][_0x3071('0x24')](_0x17dbda)){if(_0x344ea6[_0x3071('0x25')]===this[_0x3071('0x10')][_0x17dbda][_0x3071('0x26')]){this['channels'][_0x344ea6[_0x3071('0x27')]]={};this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]]['channel']=_0x344ea6[_0x3071('0x28')];this['channels'][_0x344ea6[_0x3071('0x27')]]['id']=this[_0x3071('0x10')][_0x17dbda]['id'];this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]][_0x3071('0x29')]=this[_0x3071('0x10')][_0x17dbda][_0x3071('0x29')];logger[_0x3071('0x2a')](_0x344ea6['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x3071('0x12')][_0x344ea6[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]]={};this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]][_0x3071('0x28')]=_0x344ea6[_0x3071('0x28')];logger[_0x3071('0x2a')](_0x344ea6['uniqueid'],_0x3071('0x2b'));}};Fax[_0x3071('0x22')][_0x3071('0x16')]=function(_0x4d5c4b){if(this[_0x3071('0xf')][_0x4d5c4b[_0x3071('0x27')]]){for(var _0x163604 in _0x4d5c4b[_0x3071('0x2c')]){if(_0x4d5c4b[_0x3071('0x2c')][_0x3071('0x24')](_0x163604)){this[_0x3071('0xf')][_0x4d5c4b[_0x3071('0x27')]][_0x163604]=_0x4d5c4b[_0x3071('0x2d')];}}}};Fax[_0x3071('0x22')][_0x3071('0x19')]=function(_0x5aba96){if(this['channels'][_0x5aba96[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x5aba96[_0x3071('0x27')]][_0x3071('0x2e')]=_0x5aba96[_0x3071('0x2e')];this[_0x3071('0xf')][_0x5aba96[_0x3071('0x27')]][_0x3071('0x2f')]=_0x5aba96['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0x1b0aaf){if(this[_0x3071('0xf')][_0x1b0aaf['uniqueid']]){for(var _0x17407a in _0x1b0aaf[_0x3071('0x2c')]){if(_0x1b0aaf[_0x3071('0x2c')][_0x3071('0x24')](_0x17407a)){this['channels'][_0x1b0aaf[_0x3071('0x27')]][_0x17407a]=_0x1b0aaf[_0x3071('0x2d')];}}}};Fax[_0x3071('0x22')][_0x3071('0x1c')]=function(_0x148096){if(this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x148096['uniqueid']][_0x3071('0x30')]=_0x148096['operation'];this['channels'][_0x148096[_0x3071('0x27')]][_0x3071('0x31')]=_0x148096['status'];this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]][_0x3071('0x26')]=_0x148096[_0x3071('0x26')];this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]]['filename']=_0x148096[_0x3071('0x32')];logger[_0x3071('0x2a')](_0x148096['uniqueid'],_0x3071('0x33'));}};Fax['prototype'][_0x3071('0x34')]=function(_0x43133a){var _0x5733e9=this;if(this['channels'][_0x43133a[_0x3071('0x27')]]){var _0x185f63=this[_0x3071('0xf')][_0x43133a['uniqueid']]['id'];this[_0x3071('0xf')][_0x43133a['uniqueid']][_0x3071('0x35')]=_0x43133a['remotestationid'];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x36')]=_0x43133a[_0x3071('0x36')];this[_0x3071('0xf')][_0x43133a['uniqueid']]['localstationid']=_0x43133a[_0x3071('0x26')];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x37')]=_0x43133a['resolution'];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x38')]=_0x43133a[_0x3071('0x38')];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]]['filename']=_0x43133a[_0x3071('0x32')];this['channels'][_0x43133a['uniqueid']]['calleridnum']=_0x43133a['calleridnum'];if(this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x36')]>0x0){tiff2pdf(_0x43133a[_0x3071('0x32')],_0x3071('0x39'),function(_0x3a81e9){logger[_0x3071('0x2a')](_0x43133a[_0x3071('0x27')],'\x20result\x20conversion\x20file\x20',_0x3a81e9[_0x3071('0x3a')]);attachment[_0x3071('0x3b')]({'name':path[_0x3071('0x3c')](_0x43133a[_0x3071('0x32')])[_0x3071('0x29')],'basename':path['parse'](_0x43133a['filename'])[_0x3071('0x29')]+_0x3071('0x3d'),'type':_0x3071('0x3e')})[_0x3071('0x3f')](function(_0x606ef8){faxAccount['notify'](_0x185f63,{'from':_0x43133a[_0x3071('0x40')],'mapKey':'fax','body':path[_0x3071('0x3c')](_0x43133a['filename'])['name']+_0x3071('0x3d'),'AttachmentId':_0x606ef8['id']})['catch'](function(_0x1862ea){logger['error'](_0x43133a[_0x3071('0x27')],_0x3071('0x41'),JSON[_0x3071('0x42')](_0x1862ea));});})[_0x3071('0x43')](function(_0x554047){logger[_0x3071('0x44')](_0x43133a['uniqueid'],_0x3071('0x45'),JSON['stringify'](_0x554047));});});}logger[_0x3071('0x2a')](_0x43133a[_0x3071('0x27')],'\x20receiveFax\x20');}};Fax[_0x3071('0x22')][_0x3071('0x21')]=function(_0x224a70){if(this[_0x3071('0x12')][_0x224a70[_0x3071('0x27')]]){_[_0x3071('0x46')](this[_0x3071('0xf')][_0x224a70['uniqueid']],_[_0x3071('0x47')](_0x224a70,[_0x3071('0x48'),_0x3071('0x49')]));}};function updateStatus(_0xda07a4){if(_0xda07a4['AttachmentId']){faxMessage[_0x3071('0x4a')](_0xda07a4[_0x3071('0x4b')],{'failMessage':_0x3071('0x4c')})[_0x3071('0x3f')](function(_0x22aade){ut[_0x3071('0x4d')](_0x3071('0x4e'),_0x22aade);})[_0x3071('0x43')](function(_0xbf014e){ut[_0x3071('0x4d')](_0x3071('0x4f'),_0xbf014e);});}else{ut[_0x3071('0x4d')](_0x3071('0x50'));}}Fax[_0x3071('0x22')][_0x3071('0x51')]=function(_0x12be97,_0x596cdd,_0x47a438){var _0x12536d=this;var _0x580c04={};if(_0x596cdd){_0x580c04={'read':_0x596cdd};}else{_0x580c04={'failMessage':_0x47a438};}if(this[_0x3071('0x12')][_0x12be97][_0x3071('0x4b')]){faxMessage[_0x3071('0x4a')](this['actions'][_0x12be97][_0x3071('0x4b')],_0x580c04)[_0x3071('0x3f')](function(_0x5bc69e){ut['logger'](_0x3071('0x52'),_0x5bc69e);})[_0x3071('0x43')](function(_0x30e9d5){ut[_0x3071('0x4d')]('[Fax][Message][NoUpdate1]',_0x30e9d5);})[_0x3071('0x53')](function(){delete _0x12536d[_0x3071('0xf')][_0x12be97];delete _0x12536d[_0x3071('0x12')][_0x12be97];});}else{ut[_0x3071('0x4d')](_0x3071('0x54'));delete this['channels'][_0x12be97];delete this[_0x3071('0x12')][_0x12be97];}};Fax[_0x3071('0x22')][_0x3071('0x1f')]=function(_0x27bad1){var _0x12d6be=this;if(this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]]){if(this['actions'][_0x27bad1['uniqueid']]){this[_0x3071('0xf')][_0x27bad1['uniqueid']]['id']=this[_0x3071('0x12')][_0x27bad1[_0x3071('0x27')]]['id'];this['channels'][_0x27bad1[_0x3071('0x27')]][_0x3071('0x29')]=this['actions'][_0x27bad1[_0x3071('0x27')]][_0x3071('0x29')];}logger[_0x3071('0x2a')](_0x27bad1[_0x3071('0x27')],this[_0x3071('0x12')][_0x27bad1['uniqueid']]?_0x3071('0x55'):_0x3071('0x56'),JSON[_0x3071('0x42')](this['channels'][_0x27bad1[_0x3071('0x27')]]));if(this[_0x3071('0x12')][_0x27bad1[_0x3071('0x27')]]){if(this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x57')]>0x0&&this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x1b')]==='SUCCESS'){this[_0x3071('0x51')](_0x27bad1[_0x3071('0x27')],!![]);}else{this[_0x3071('0x51')](_0x27bad1[_0x3071('0x27')],![],this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x58')]?_0x3071('0x59')+this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x58')]:'SENDING\x20FAILED');}}}};Fax[_0x3071('0x22')][_0x3071('0x5a')]=function(_0x279594){var _0x3ed86c=this;return new BPromise(function(_0x429a03,_0x158dda){_0x3ed86c[_0x3071('0x5b')](_0x279594,_0x3ed86c[_0x3071('0x10')][_0x279594['FaxAccountId']])[_0x3071('0x3f')](function(_0x1ebd77){ut['logger']('[Fax][execOriginate][success]',_0x1ebd77);_0x429a03(ut[_0x3071('0x3a')](_0x3071('0x5c')));})[_0x3071('0x43')](function(_0x38bc1f){ut['logger']('[Fax][execOriginate][failure]',_0x38bc1f);updateStatus(_0x279594);_0x158dda(ut[_0x3071('0x3a')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x58da43){var _0xec6f46=this;return new BPromise(function(_0x1da52c,_0xd928e8){var _0x567d19=_0xec6f46[_0x3071('0x5d')](_0xec6f46[_0x3071('0x10')][_0x58da43[_0x3071('0x5e')]][_0x3071('0x5f')],_0x58da43);if(_0x567d19['isValid']){_0x1da52c(ut[_0x3071('0x3a')](_0x3071('0x60')));}else{_0xd928e8(ut['message'](_0x567d19[_0x3071('0x3a')]));}});};function originate(_0x29ee70,_0x388cd1,_0x40c258){return new BPromise(function(_0x4edd23,_0x11ffdd){if(_0x40c258){var _0x2deac2=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x3071('0x3c')](_0x29ee70[_0x3071('0x3')])[_0x3071('0x29')],_0x29ee70['path']);gs['execute'](_0x2deac2)[_0x3071('0x3f')](function(){_0x29ee70[_0x3071('0x3')]=util[_0x3071('0x61')](_0x3071('0x62'),path[_0x3071('0x3c')](_0x29ee70[_0x3071('0x3')])[_0x3071('0x63')],path[_0x3071('0x3c')](_0x29ee70['path'])[_0x3071('0x29')]);_0x388cd1['XMF-PATH']=_0x29ee70[_0x3071('0x3')];ut[_0x3071('0x4d')](_0x3071('0x64'),'');ami[_0x3071('0x65')](ut[_0x3071('0x66')](_0x29ee70,_0x388cd1))[_0x3071('0x3f')](function(_0x155542){_0x4edd23(_0x155542);})[_0x3071('0x43')](function(_0x4fa372){_0x11ffdd(_0x4fa372);});})[_0x3071('0x43')](function(_0x138a94){_0x11ffdd(_0x138a94);});}else{ami[_0x3071('0x65')](ut['variablesAction'](_0x29ee70,_0x388cd1))[_0x3071('0x3f')](function(_0x22ec7b){_0x4edd23(_0x22ec7b);})[_0x3071('0x43')](function(_0x567e33){_0x11ffdd(_0x567e33);});}});}Fax['prototype'][_0x3071('0x5b')]=function(_0x5cff7f,_0x288bfc){var _0x10a207=this;return new BPromise(function(_0x40d987,_0x23bc22){var _0x311939=uuid['v4']();var _0x437098=ut[_0x3071('0x67')](_0x5cff7f,_0x288bfc);_0x10a207['actions'][_0x311939]=new Action(_0x311939,_0x288bfc,_0x5cff7f);var _0x1f2be3=_0x10a207[_0x3071('0x12')][_0x311939];if(path[_0x3071('0x3c')](_0x5cff7f[_0x3071('0x3')])[_0x3071('0x68')]===_0x3071('0x3d')){originate(_0x1f2be3,_0x437098,!![])[_0x3071('0x3f')](function(_0x277377){_0x40d987(_0x277377);})['catch'](function(_0x254adf){_0x23bc22(_0x254adf);});}else{originate(_0x1f2be3,_0x437098,![])['then'](function(_0x2aef6e){_0x40d987(_0x2aef6e);})[_0x3071('0x43')](function(_0x3ef605){_0x23bc22(_0x3ef605);});}});};Fax[_0x3071('0x22')][_0x3071('0x69')]=function(_0xa8e233){return!_[_0x3071('0x6a')](_0xa8e233)&&!_[_0x3071('0x6a')](_0xa8e233[_0x3071('0x29')])&&!_[_0x3071('0x6a')](_0xa8e233['active'])&&_0xa8e233[_0x3071('0x6b')]&&!_[_0x3071('0x6a')](this['trunks'][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])])&&!_[_0x3071('0x6a')](this[_0x3071('0x11')][util['format']('SIP/%s',_0xa8e233[_0x3071('0x29')])]['status'])&&(this[_0x3071('0x11')][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])][_0x3071('0x31')]===_0x3071('0x6d')||this['trunks'][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])][_0x3071('0x31')]==='unmonitored');};Fax[_0x3071('0x22')][_0x3071('0x5d')]=function(_0x4db74f,_0x3adaa2){if(!this[_0x3071('0x69')](_0x4db74f)){ut[_0x3071('0x4d')](_0x3071('0x6e'),_[_0x3071('0x6a')](_0x4db74f)?'':_0x4db74f['name']+_0x3071('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x3071('0x6a')](_0x3adaa2[_0x3071('0x6')])){ut[_0x3071('0x4d')](_0x3071('0x70'),JSON[_0x3071('0x42')](_0x3adaa2));return{'isValid':![],'message':_0x3071('0x71')};}if(_[_0x3071('0x6a')](_0x3adaa2[_0x3071('0x3')])){ut['logger'](_0x3071('0x72'),JSON[_0x3071('0x42')](_0x3adaa2));return{'isValid':![],'message':_0x3071('0x73')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x3071('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e2cf2e6..a91466f 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 _0x32c6=['inspect','notify','then','catch','util','../../../config/logger','lodash','../rpc/faxAccount','error'];(function(_0x2d05af,_0xa08dcc){var _0x40543f=function(_0x317453){while(--_0x317453){_0x2d05af['push'](_0x2d05af['shift']());}};_0x40543f(++_0xa08dcc);}(_0x32c6,0x151));var _0x632c=function(_0x1ac9ba,_0x4e2dd9){_0x1ac9ba=_0x1ac9ba-0x0;var _0x185c47=_0x32c6[_0x1ac9ba];return _0x185c47;};'use strict';var util=require(_0x632c('0x0'));var BPromise=require('bluebird');var logger=require(_0x632c('0x1'))('preview');var _=require(_0x632c('0x2'));var faxAccount=require(_0x632c('0x3'));function loggerCatch(_0x5cded9){return function(_0x27f9c1){logger[_0x632c('0x4')](_0x5cded9,util[_0x632c('0x5')](_0x27f9c1,{'showHidden':![],'depth':null}));};}exports[_0x632c('0x6')]=function(_0x31676c,_0x117c67){return BPromise['resolve']()[_0x632c('0x7')](faxAccount[_0x632c('0x6')](_0x31676c,_0x117c67))[_0x632c('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x6493=['[Notify]\x20','util','preview','../rpc/faxAccount','error','inspect','notify','catch'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x6493,0x129));var _0x3649=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x6493[_0x339129];return _0x1570df;};'use strict';var util=require(_0x3649('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x3649('0x1'));var _=require('lodash');var faxAccount=require(_0x3649('0x2'));function loggerCatch(_0x3e8179){return function(_0x3bb7ff){logger[_0x3649('0x3')](_0x3e8179,util[_0x3649('0x4')](_0x3bb7ff,{'showHidden':![],'depth':null}));};}exports[_0x3649('0x5')]=function(_0x269512,_0x4cc65e){return BPromise['resolve']()['then'](faxAccount[_0x3649('0x5')](_0x269512,_0x4cc65e))[_0x3649('0x6')](loggerCatch(_0x3649('0x7')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 6e3cee5..9119a2d 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 _0x26d2=['bluebird','exec','execute','info','Exec\x20gs','inspect','fax'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0x26d2,0x179));var _0x226d=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x26d2[_0x556927];return _0x5f1235;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x226d('0x0'));var BPromise=require(_0x226d('0x1'));var exec=require('child_process')[_0x226d('0x2')];exports[_0x226d('0x3')]=function(_0x4ca09f){return new BPromise(function(_0x2e63a5,_0x5b06d8){exec(_0x4ca09f,function(_0x1394bf,_0x6c7d47,_0x8fe6b9){logger[_0x226d('0x4')](_0x226d('0x5'),_0x6c7d47);if(_0x1394bf){logger[_0x226d('0x4')](_0x226d('0x5'),'\x20Error\x20:',util[_0x226d('0x6')](_0x1394bf,{'showHidden':![],'depth':null}),_0x6c7d47,_0x8fe6b9);_0x5b06d8(_0x1394bf);}_0x2e63a5(_0x6c7d47);});});}; \ No newline at end of file +var _0x4e3a=['exec','execute','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x110dc5,_0x5e0442){var _0x5103dd=function(_0x1ed328){while(--_0x1ed328){_0x110dc5['push'](_0x110dc5['shift']());}};_0x5103dd(++_0x5e0442);}(_0x4e3a,0x113));var _0xa4e3=function(_0x879b3f,_0x213e3d){_0x879b3f=_0x879b3f-0x0;var _0x4e64fa=_0x4e3a[_0x879b3f];return _0x4e64fa;};'use strict';var util=require(_0xa4e3('0x0'));var logger=require(_0xa4e3('0x1'))(_0xa4e3('0x2'));var BPromise=require(_0xa4e3('0x3'));var exec=require(_0xa4e3('0x4'))[_0xa4e3('0x5')];exports[_0xa4e3('0x6')]=function(_0x5b1c9b){return new BPromise(function(_0x5779db,_0x59b21a){exec(_0x5b1c9b,function(_0x22a84e,_0x4e7470,_0x2b3dca){logger[_0xa4e3('0x7')]('Exec\x20gs',_0x4e7470);if(_0x22a84e){logger[_0xa4e3('0x7')]('Exec\x20gs',_0xa4e3('0x8'),util[_0xa4e3('0x9')](_0x22a84e,{'showHidden':![],'depth':null}),_0x4e7470,_0x2b3dca);_0x59b21a(_0x22a84e);}_0x5779db(_0x4e7470);});});}; \ 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 4f6716a..7d0bafa 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 _0x228e=['moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','\x22%s\x22\x20<%s>','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x228e,0x158));var _0xe228=function(_0x1fae03,_0x3ac007){_0x1fae03=_0x1fae03-0x0;var _0x313b3f=_0x228e[_0x1fae03];return _0x313b3f;};'use strict';var util=require('util');var _=require(_0xe228('0x0'));var moment=require(_0xe228('0x1'));var logger=require(_0xe228('0x2'))(_0xe228('0x3'));exports[_0xe228('0x4')]=function(_0x1f8d85){return{'message':_0x1f8d85};};exports[_0xe228('0x5')]=function(_0x11288f,_0x419bf2){logger[_0xe228('0x6')](_0x11288f,util[_0xe228('0x7')](_0x419bf2,{'showHidden':![],'depth':null}));};exports[_0xe228('0x8')]=function(_0x127de4,_0x5b1b6f){var _0x2570ac={'XMF-ECM':_0x5b1b6f['ecm'],'XMF-HEADERINFO':_0x5b1b6f[_0xe228('0x9')],'XMF-MINRATE':_0x5b1b6f[_0xe228('0xa')],'XMF-MAXRATE':_0x5b1b6f[_0xe228('0xb')],'XMF-MODEM':util[_0xe228('0xc')](_0xe228('0xd'),_0x5b1b6f[_0xe228('0xe')]),'XMF-GATEWAY':_0x5b1b6f[_0xe228('0xf')],'XMF-FAXDETECT':_0x5b1b6f[_0xe228('0x10')],'XMF-T38TIMEOUT':_0x5b1b6f['t38timeout'],'XMF-LOCALSTATIONID':_0x5b1b6f[_0xe228('0x11')],'XMF-PATH':_0x127de4[_0xe228('0x12')]};return _0x2570ac;};exports[_0xe228('0x13')]=function(_0x3b8b4f,_0x2d02b2){return{'actionid':_0x3b8b4f[_0xe228('0x14')],'action':'originate','channel':_0x3b8b4f['channel'],'Exten':_0xe228('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0xe228('0xc')](_0xe228('0x16'),_0x3b8b4f[_0xe228('0x9')]?_0x3b8b4f[_0xe228('0x9')]:'',_0x3b8b4f['localstationid']),'variable':_0x2d02b2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3b8b4f[_0xe228('0x14')]};}; \ No newline at end of file +var _0x2014=['variablesAction','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','maxrate','\x22%s\x22','modem','gateway','t38timeout','localstationid','path'];(function(_0x5dd94c,_0x54579e){var _0x507e4e=function(_0x56e1e7){while(--_0x56e1e7){_0x5dd94c['push'](_0x5dd94c['shift']());}};_0x507e4e(++_0x54579e);}(_0x2014,0x125));var _0x4201=function(_0x13d9a7,_0x4ba8c7){_0x13d9a7=_0x13d9a7-0x0;var _0x11b69c=_0x2014[_0x13d9a7];return _0x11b69c;};'use strict';var util=require(_0x4201('0x0'));var _=require('lodash');var moment=require(_0x4201('0x1'));var logger=require(_0x4201('0x2'))(_0x4201('0x3'));exports[_0x4201('0x4')]=function(_0x18fbf6){return{'message':_0x18fbf6};};exports[_0x4201('0x5')]=function(_0x466d24,_0x5d0ad1){logger['info'](_0x466d24,util[_0x4201('0x6')](_0x5d0ad1,{'showHidden':![],'depth':null}));};exports[_0x4201('0x7')]=function(_0x471ba1,_0x2bcedb){var _0x420efa={'XMF-ECM':_0x2bcedb['ecm'],'XMF-HEADERINFO':_0x2bcedb['headerinfo'],'XMF-MINRATE':_0x2bcedb['minrate'],'XMF-MAXRATE':_0x2bcedb[_0x4201('0x8')],'XMF-MODEM':util['format'](_0x4201('0x9'),_0x2bcedb[_0x4201('0xa')]),'XMF-GATEWAY':_0x2bcedb[_0x4201('0xb')],'XMF-FAXDETECT':_0x2bcedb['faxdetect'],'XMF-T38TIMEOUT':_0x2bcedb[_0x4201('0xc')],'XMF-LOCALSTATIONID':_0x2bcedb[_0x4201('0xd')],'XMF-PATH':_0x471ba1[_0x4201('0xe')]};return _0x420efa;};exports[_0x4201('0xf')]=function(_0x4da66b,_0x2c5ae5){return{'actionid':_0x4da66b['uniqueid'],'action':_0x4201('0x10'),'channel':_0x4da66b['channel'],'Exten':_0x4201('0x11'),'Context':_0x4201('0x12'),'Priority':'1','callerid':util[_0x4201('0x13')](_0x4201('0x14'),_0x4da66b[_0x4201('0x15')]?_0x4da66b[_0x4201('0x15')]:'',_0x4da66b[_0x4201('0xd')]),'variable':_0x2c5ae5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4da66b['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 05e9cb0..1ad1f43 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 _0x1533=['hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','bluebird','util','moment','./server','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get'];(function(_0x1be17d,_0x5cf90d){var _0x1193ac=function(_0x418f31){while(--_0x418f31){_0x1be17d['push'](_0x1be17d['shift']());}};_0x1193ac(++_0x5cf90d);}(_0x1533,0x78));var _0x3153=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0x1533[_0x19e08e];return _0x14c229;};'use strict';var BPromise=require(_0x3153('0x0'));var util=require(_0x3153('0x1'));var moment=require(_0x3153('0x2'));var server=require(_0x3153('0x3'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x3153('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x3153('0x5'));var Fax=require(_0x3153('0x6'));var user=require(_0x3153('0x7'));var voiceQueue=require(_0x3153('0x8'));var voiceQueueReport=require(_0x3153('0x9'));var voiceCallReport=require(_0x3153('0xa'));var trunk=require(_0x3153('0xb'));var trigger=require(_0x3153('0xc'));var template=require(_0x3153('0xd'));var cmHopperHistory=require(_0x3153('0xe'));var campaign=require(_0x3153('0xf'));var voiceExtension=require(_0x3153('0x10'));var faxAccount=require(_0x3153('0x11'));var zendesk=require(_0x3153('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x3153('0x13'));var desk=require(_0x3153('0x14'));var zoho=require(_0x3153('0x15'));var vtiger=require(_0x3153('0x16'));var freshsales=require(_0x3153('0x17'));var servicenow=require(_0x3153('0x18'));var dynamics365=require(_0x3153('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x3153('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3153('0x1b')](_0x3153('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x3153('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3153('0x1d')]()[_0x3153('0x1e')](user[_0x3153('0x1f')]())[_0x3153('0x1e')](realtime[_0x3153('0x20')]())['then'](user[_0x3153('0x21')]())['then'](realtime[_0x3153('0x22')]())[_0x3153('0x1e')](trunk[_0x3153('0x23')]())[_0x3153('0x1e')](realtime['initTrunks']())['then'](voiceQueue[_0x3153('0x24')]())[_0x3153('0x1e')](realtime[_0x3153('0x25')]())['then'](trigger[_0x3153('0x26')]())[_0x3153('0x1e')](realtime[_0x3153('0x27')]())[_0x3153('0x1e')](template[_0x3153('0x28')]())[_0x3153('0x1e')](realtime[_0x3153('0x29')]())['then'](zendesk[_0x3153('0x2a')]())[_0x3153('0x1e')](realtime[_0x3153('0x2b')]())[_0x3153('0x1e')](salesforce[_0x3153('0x2c')]())[_0x3153('0x1e')](realtime[_0x3153('0x2d')]())['then'](sugarcrm[_0x3153('0x2e')]())['then'](realtime[_0x3153('0x2f')]())[_0x3153('0x1e')](freshdesk[_0x3153('0x30')]())[_0x3153('0x1e')](realtime['initFreshdeskAccounts']())[_0x3153('0x1e')](desk[_0x3153('0x31')]())[_0x3153('0x1e')](realtime['initDeskAccounts']())[_0x3153('0x1e')](zoho['getZohoAccounts']())[_0x3153('0x1e')](realtime['initZohoAccounts']())[_0x3153('0x1e')](vtiger[_0x3153('0x32')]())['then'](realtime[_0x3153('0x33')]())[_0x3153('0x1e')](freshsales[_0x3153('0x34')]())[_0x3153('0x1e')](realtime[_0x3153('0x35')]())['then'](servicenow[_0x3153('0x36')]())[_0x3153('0x1e')](realtime[_0x3153('0x37')]())[_0x3153('0x1e')](dynamics365[_0x3153('0x38')]())[_0x3153('0x1e')](realtime[_0x3153('0x39')]())[_0x3153('0x1e')](campaign[_0x3153('0x3a')]())['then'](realtime[_0x3153('0x3b')]())[_0x3153('0x1e')](voiceExtension[_0x3153('0x3c')]())[_0x3153('0x1e')](realtime[_0x3153('0x3d')]())[_0x3153('0x1e')](faxAccount[_0x3153('0x3e')]())[_0x3153('0x1e')](realtime['initFaxAccounts']())[_0x3153('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x3153('0x1e')](voiceQueueReport[_0x3153('0x3f')]())[_0x3153('0x1e')](realtime[_0x3153('0x40')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x3153('0x1e')](cmHopperHistory[_0x3153('0x41')]())['then'](realtime[_0x3153('0x42')]())[_0x3153('0x1e')](voiceCallReport[_0x3153('0x43')]())[_0x3153('0x1e')](realtime[_0x3153('0x44')]())[_0x3153('0x45')](function(_0x6404b1){logger['error'](_0x3153('0x46'),util[_0x3153('0x47')](_0x6404b1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3153('0x48')](realtime,preview,fax)[_0x3153('0x1e')](function(_0x43694d){return initRealtime();})[_0x3153('0x1e')](function(){return initParams();})['then'](function(){report[_0x3153('0x49')]();setInterval(initRealtime,0x1388);})[_0x3153('0x45')](function(_0x588fbe){logger['error']('[index.js][main]',util[_0x3153('0x47')](_0x588fbe,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x03fc=['resolve','then','getAgents','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./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','../../config/logger','ami','hour','get'];(function(_0x1345d8,_0x4c5ec9){var _0xdd678d=function(_0x2f3fce){while(--_0x2f3fce){_0x1345d8['push'](_0x1345d8['shift']());}};_0xdd678d(++_0x4c5ec9);}(_0x03fc,0x6f));var _0xc03f=function(_0x3f558f,_0x338b4c){_0x3f558f=_0x3f558f-0x0;var _0x4c8cf2=_0x03fc[_0x3f558f];return _0x4c8cf2;};'use strict';var BPromise=require(_0xc03f('0x0'));var util=require(_0xc03f('0x1'));var moment=require(_0xc03f('0x2'));var server=require(_0xc03f('0x3'));var Realtime=require(_0xc03f('0x4'));var Report=require(_0xc03f('0x5'));var Acw=require(_0xc03f('0x6'));var Trigger=require(_0xc03f('0x7'));var Dialer=require(_0xc03f('0x8'));var Preview=require(_0xc03f('0x9'));var Fax=require(_0xc03f('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0xc03f('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xc03f('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0xc03f('0xd'));var template=require(_0xc03f('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xc03f('0xf'));var voiceExtension=require(_0xc03f('0x10'));var faxAccount=require(_0xc03f('0x11'));var zendesk=require(_0xc03f('0x12'));var salesforce=require(_0xc03f('0x13'));var sugarcrm=require(_0xc03f('0x14'));var freshdesk=require(_0xc03f('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xc03f('0x16'));var vtiger=require(_0xc03f('0x17'));var freshsales=require(_0xc03f('0x18'));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(_0xc03f('0x19'))(_0xc03f('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xc03f('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc03f('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xc03f('0x1d')]()[_0xc03f('0x1e')](user[_0xc03f('0x1f')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x20')]())[_0xc03f('0x1e')](user['getTelephones']())[_0xc03f('0x1e')](realtime['initTelephones']())[_0xc03f('0x1e')](trunk[_0xc03f('0x21')]())['then'](realtime[_0xc03f('0x22')]())[_0xc03f('0x1e')](voiceQueue['getVoiceQueues']())[_0xc03f('0x1e')](realtime[_0xc03f('0x23')]())['then'](trigger[_0xc03f('0x24')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x25')]())[_0xc03f('0x1e')](template['getTemplates']())[_0xc03f('0x1e')](realtime['initTemplates']())[_0xc03f('0x1e')](zendesk[_0xc03f('0x26')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x27')]())[_0xc03f('0x1e')](salesforce[_0xc03f('0x28')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x29')]())[_0xc03f('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0xc03f('0x1e')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xc03f('0x2a')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x2b')]())[_0xc03f('0x1e')](desk[_0xc03f('0x2c')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x2d')]())[_0xc03f('0x1e')](zoho[_0xc03f('0x2e')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x2f')]())[_0xc03f('0x1e')](vtiger['getVtigerAccounts']())['then'](realtime[_0xc03f('0x30')]())[_0xc03f('0x1e')](freshsales[_0xc03f('0x31')]())['then'](realtime[_0xc03f('0x32')]())[_0xc03f('0x1e')](servicenow[_0xc03f('0x33')]())[_0xc03f('0x1e')](realtime['initServicenowAccounts']())[_0xc03f('0x1e')](dynamics365[_0xc03f('0x34')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x35')]())[_0xc03f('0x1e')](campaign['getCampaigns']())[_0xc03f('0x1e')](realtime['initCampaigns']())[_0xc03f('0x1e')](voiceExtension[_0xc03f('0x36')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x37')]())[_0xc03f('0x1e')](faxAccount[_0xc03f('0x38')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x39')]())[_0xc03f('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0xc03f('0x3a')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x3b')]())['then'](cmHopperHistory[_0xc03f('0x3c')]())[_0xc03f('0x1e')](realtime[_0xc03f('0x3d')]())[_0xc03f('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0xc03f('0x1e')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xc03f('0x3e')]())[_0xc03f('0x3f')](function(_0x29b7c2){logger[_0xc03f('0x40')](_0xc03f('0x41'),util['inspect'](_0x29b7c2,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc03f('0x42')](realtime,preview,fax)[_0xc03f('0x1e')](function(_0x330c08){return initRealtime();})['then'](function(){return initParams();})[_0xc03f('0x1e')](function(){report[_0xc03f('0x43')]();setInterval(initRealtime,0x1388);})[_0xc03f('0x3f')](function(_0x5dc141){logger[_0xc03f('0x40')](_0xc03f('0x44'),util[_0xc03f('0x45')](_0x5dc141,{'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 d626a80..fc064b6 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x3440e1,_0x4ba68d){var _0x12bbe4=function(_0x5addf8){while(--_0x5addf8){_0x3440e1['push'](_0x3440e1['shift']());}};_0x12bbe4(++_0x4ba68d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xcb91[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x1ef2e3,_0x380ec2){var _0x173e11=function(_0x574cb9){while(--_0x574cb9){_0x1ef2e3['push'](_0x1ef2e3['shift']());}};_0x173e11(++_0x380ec2);}(_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 moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 422c156..b6ca77b 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 _0x1992=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x1992,0x12e));var _0x2199=function(_0x5f675,_0x45047d){_0x5f675=_0x5f675-0x0;var _0x14c593=_0x1992[_0x5f675];return _0x14c593;};'use strict';function Campaign(_0x34a85e){this['id']=_0x34a85e['id']||0x0;this[_0x2199('0x0')]=_0x34a85e['name']||'';this['type']=_0x34a85e[_0x2199('0x1')]||_0x2199('0x2');this[_0x2199('0x3')]=0x0;this['temp']=0x0;this[_0x2199('0x4')]=0x0;this[_0x2199('0x5')]=0x0;this[_0x2199('0x6')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x34a85e[_0x2199('0x7')];this[_0x2199('0x8')]=_0x34a85e[_0x2199('0x8')];this[_0x2199('0x9')]=_0x34a85e[_0x2199('0x9')]||null;this[_0x2199('0xa')]=_0x34a85e['dialGlobalInterval']?_0x34a85e[_0x2199('0xa')]:null;this[_0x2199('0xb')]=_0x34a85e[_0x2199('0xb')];this[_0x2199('0xc')]=_0x34a85e[_0x2199('0xc')];this['dialOriginateTimeout']=_0x34a85e[_0x2199('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x34a85e[_0x2199('0xe')];this[_0x2199('0xf')]=_0x34a85e[_0x2199('0xf')];this['dialBusyMaxRetry']=_0x34a85e[_0x2199('0x10')];this['dialBusyRetryFrequency']=_0x34a85e[_0x2199('0x11')];this[_0x2199('0x12')]=_0x34a85e[_0x2199('0x12')];this['dialNoAnswerRetryFrequency']=_0x34a85e[_0x2199('0x13')];this['dialGlobalMaxRetry']=_0x34a85e[_0x2199('0x14')];this['dialNoSuchNumberMaxRetry']=_0x34a85e[_0x2199('0x15')]||0x3;this[_0x2199('0x16')]=_0x34a85e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2199('0x17')]=_0x34a85e[_0x2199('0x17')]||0x3;this[_0x2199('0x18')]=_0x34a85e['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x34a85e[_0x2199('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x34a85e[_0x2199('0x1a')]||0x96;this[_0x2199('0x1b')]=_0x34a85e[_0x2199('0x1b')]||0x3;this[_0x2199('0x1c')]=_0x34a85e[_0x2199('0x1c')]||0x96;this[_0x2199('0x1d')]=_0x34a85e[_0x2199('0x1d')]||0x3;this[_0x2199('0x1e')]=_0x34a85e['dialAgentRejectRetryFrequency']||0x96;this[_0x2199('0x1f')]=_0x34a85e[_0x2199('0x1f')]||_0x2199('0x20');this[_0x2199('0x21')]=_0x34a85e[_0x2199('0x21')]||undefined;this[_0x2199('0x22')]=_0x34a85e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2199('0x23')]=_0x34a85e['dialCutDigit']||undefined;this[_0x2199('0x24')]=_0x34a85e[_0x2199('0x24')]?_0x34a85e[_0x2199('0x24')]:undefined;this[_0x2199('0x25')]=_0x34a85e[_0x2199('0x25')]?_0x34a85e[_0x2199('0x25')]:undefined;this[_0x2199('0x26')]=_0x34a85e['Interval']?_0x34a85e[_0x2199('0x26')]:undefined;this['SquareProject']=_0x34a85e[_0x2199('0x27')]?_0x34a85e[_0x2199('0x27')]:undefined;this[_0x2199('0x28')]=_0x34a85e[_0x2199('0x27')]?_0x34a85e[_0x2199('0x27')][_0x2199('0x0')]:undefined;this[_0x2199('0x29')]=_0x34a85e[_0x2199('0x29')]||![];this[_0x2199('0x2a')]=_0x34a85e[_0x2199('0x2a')];this[_0x2199('0x2b')]=_0x34a85e[_0x2199('0x2b')];this[_0x2199('0x2c')]=_0x34a85e[_0x2199('0x2c')];this[_0x2199('0x2d')]=_0x34a85e[_0x2199('0x2d')];this[_0x2199('0x2e')]=_0x34a85e[_0x2199('0x2e')];this[_0x2199('0x2f')]=_0x34a85e[_0x2199('0x2f')];this[_0x2199('0x30')]=_0x34a85e[_0x2199('0x30')];this[_0x2199('0x31')]=_0x34a85e[_0x2199('0x31')];this['dialAMDMaximumWordLength']=_0x34a85e['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0xb8c8=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x19fbdc,_0x2e1d6a){var _0x176533=function(_0x9003da){while(--_0x9003da){_0x19fbdc['push'](_0x19fbdc['shift']());}};_0x176533(++_0x2e1d6a);}(_0xb8c8,0x1d7));var _0x8b8c=function(_0x17e8bb,_0x47dbd6){_0x17e8bb=_0x17e8bb-0x0;var _0x4d10e5=_0xb8c8[_0x17e8bb];return _0x4d10e5;};'use strict';function Campaign(_0x393a3a){this['id']=_0x393a3a['id']||0x0;this[_0x8b8c('0x0')]=_0x393a3a[_0x8b8c('0x0')]||'';this['type']=_0x393a3a['type']||_0x8b8c('0x1');this[_0x8b8c('0x2')]=0x0;this[_0x8b8c('0x3')]=0x0;this[_0x8b8c('0x4')]=0x0;this[_0x8b8c('0x5')]=0x0;this[_0x8b8c('0x6')]='';this[_0x8b8c('0x7')]=!![];this['active']=_0x393a3a[_0x8b8c('0x8')];this[_0x8b8c('0x9')]=_0x393a3a[_0x8b8c('0x9')];this['dialTimezone']=_0x393a3a['dialTimezone']||null;this['dialGlobalInterval']=_0x393a3a[_0x8b8c('0xa')]?_0x393a3a[_0x8b8c('0xa')]:null;this[_0x8b8c('0xb')]=_0x393a3a['dialOriginateCallerIdName'];this[_0x8b8c('0xc')]=_0x393a3a[_0x8b8c('0xc')];this[_0x8b8c('0xd')]=_0x393a3a['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x393a3a[_0x8b8c('0xe')];this[_0x8b8c('0xf')]=_0x393a3a[_0x8b8c('0xf')];this['dialBusyMaxRetry']=_0x393a3a[_0x8b8c('0x10')];this[_0x8b8c('0x11')]=_0x393a3a[_0x8b8c('0x11')];this[_0x8b8c('0x12')]=_0x393a3a['dialNoAnswerMaxRetry'];this[_0x8b8c('0x13')]=_0x393a3a[_0x8b8c('0x13')];this[_0x8b8c('0x14')]=_0x393a3a[_0x8b8c('0x14')];this[_0x8b8c('0x15')]=_0x393a3a[_0x8b8c('0x15')]||0x3;this[_0x8b8c('0x16')]=_0x393a3a[_0x8b8c('0x16')]||0x96;this[_0x8b8c('0x17')]=_0x393a3a[_0x8b8c('0x17')]||0x3;this[_0x8b8c('0x18')]=_0x393a3a[_0x8b8c('0x18')]||0x96;this[_0x8b8c('0x19')]=_0x393a3a[_0x8b8c('0x19')]||0x3;this[_0x8b8c('0x1a')]=_0x393a3a[_0x8b8c('0x1a')]||0x96;this[_0x8b8c('0x1b')]=_0x393a3a['dialMachineMaxRetry']||0x3;this[_0x8b8c('0x1c')]=_0x393a3a[_0x8b8c('0x1c')]||0x96;this[_0x8b8c('0x1d')]=_0x393a3a[_0x8b8c('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x393a3a[_0x8b8c('0x1e')]||0x96;this[_0x8b8c('0x1f')]=_0x393a3a['dialOrderByScheduledAt']||'DESC';this[_0x8b8c('0x20')]=_0x393a3a[_0x8b8c('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x393a3a[_0x8b8c('0x21')]||undefined;this[_0x8b8c('0x22')]=_0x393a3a['dialCutDigit']||undefined;this[_0x8b8c('0x23')]=_0x393a3a[_0x8b8c('0x23')]?_0x393a3a[_0x8b8c('0x23')]:undefined;this[_0x8b8c('0x24')]=_0x393a3a[_0x8b8c('0x24')]?_0x393a3a['Trunk']:undefined;this[_0x8b8c('0x25')]=_0x393a3a[_0x8b8c('0x25')]?_0x393a3a[_0x8b8c('0x25')]:undefined;this[_0x8b8c('0x26')]=_0x393a3a['SquareProject']?_0x393a3a[_0x8b8c('0x26')]:undefined;this[_0x8b8c('0x27')]=_0x393a3a[_0x8b8c('0x26')]?_0x393a3a[_0x8b8c('0x26')][_0x8b8c('0x0')]:undefined;this[_0x8b8c('0x28')]=_0x393a3a[_0x8b8c('0x28')]||![];this[_0x8b8c('0x29')]=_0x393a3a[_0x8b8c('0x29')];this[_0x8b8c('0x2a')]=_0x393a3a[_0x8b8c('0x2a')];this[_0x8b8c('0x2b')]=_0x393a3a[_0x8b8c('0x2b')];this[_0x8b8c('0x2c')]=_0x393a3a['dialAMDTotalAnalysisTime'];this[_0x8b8c('0x2d')]=_0x393a3a[_0x8b8c('0x2d')];this[_0x8b8c('0x2e')]=_0x393a3a[_0x8b8c('0x2e')];this[_0x8b8c('0x2f')]=_0x393a3a['dialAMDMaximumNumberOfWords'];this[_0x8b8c('0x30')]=_0x393a3a['dialAMDSilenceThreshold'];this[_0x8b8c('0x31')]=_0x393a3a[_0x8b8c('0x31')];}module[_0x8b8c('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1a473b6..06a079a 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 _0x0abf=['monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag'];(function(_0x569f5f,_0x1c6c5c){var _0x3e8e2e=function(_0x46344f){while(--_0x46344f){_0x569f5f['push'](_0x569f5f['shift']());}};_0x3e8e2e(++_0x1c6c5c);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';function Channel(){this[_0xf0ab('0x0')]=null;this['channel']='';this[_0xf0ab('0x1')]='';this[_0xf0ab('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xf0ab('0x3')]=undefined;this['accountcode']=0x0;this[_0xf0ab('0x4')]='';this[_0xf0ab('0x5')]=0x0;this[_0xf0ab('0x6')]=0x0;this[_0xf0ab('0x7')]=0x0;this[_0xf0ab('0x8')]=![];this[_0xf0ab('0x9')]=null;this[_0xf0ab('0xa')]=null;this['unmanaged']=![];this[_0xf0ab('0xb')]=![];this[_0xf0ab('0xc')]='';this[_0xf0ab('0xd')]='';this[_0xf0ab('0xe')]=0x0;this['billableseconds']=0x0;this[_0xf0ab('0xf')]=0x0;this[_0xf0ab('0x10')]=null;this[_0xf0ab('0x11')]=null;this['disposition']=null;this['monitor']=![];this[_0xf0ab('0x12')]=null;this['queue']=null;this[_0xf0ab('0x13')]=[];this[_0xf0ab('0x14')]=undefined;this[_0xf0ab('0x15')]=undefined;this[_0xf0ab('0x16')]=undefined;this[_0xf0ab('0x17')]=0x0;}module[_0xf0ab('0x18')]=Channel; \ No newline at end of file +var _0xa3fe=['monitor','monitorFilename','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','abandoned','lastapplication','lastdata','holdtime','disposition'];(function(_0x89973e,_0x16f568){var _0x54b99f=function(_0x4f0b95){while(--_0x4f0b95){_0x89973e['push'](_0x89973e['shift']());}};_0x54b99f(++_0x16f568);}(_0xa3fe,0xd8));var _0xea3f=function(_0x4921b0,_0x1d876c){_0x4921b0=_0x4921b0-0x0;var _0x140afe=_0xa3fe[_0x4921b0];return _0x140afe;};'use strict';function Channel(){this[_0xea3f('0x0')]=null;this['channel']='';this[_0xea3f('0x1')]='';this[_0xea3f('0x2')]=0x0;this['calleridname']='';this[_0xea3f('0x3')]=undefined;this[_0xea3f('0x4')]=undefined;this[_0xea3f('0x5')]=0x0;this['context']='';this[_0xea3f('0x6')]=0x0;this['linkedid']=0x0;this[_0xea3f('0x7')]=0x0;this[_0xea3f('0x8')]=![];this[_0xea3f('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this[_0xea3f('0xa')]=![];this[_0xea3f('0xb')]='';this[_0xea3f('0xc')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xea3f('0xd')]=0x0;this['type']=null;this['tag']=null;this[_0xea3f('0xe')]=null;this[_0xea3f('0xf')]=![];this[_0xea3f('0x10')]=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xea3f('0x11')]=undefined;this[_0xea3f('0x12')]=undefined;this[_0xea3f('0x13')]=0x0;}module[_0xea3f('0x14')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7fa0939..618a243 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 _0xb516=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x3ffb04,_0x33f49a){var _0x897dc3=function(_0x461f44){while(--_0x461f44){_0x3ffb04['push'](_0x3ffb04['shift']());}};_0x897dc3(++_0x33f49a);}(_0xb516,0xd2));var _0x6b51=function(_0x3a426b,_0x22301f){_0x3a426b=_0x3a426b-0x0;var _0x3549e2=_0xb516[_0x3a426b];return _0x3549e2;};'use strict';function DeskAccount(_0x3db16b){this['id']=_0x3db16b['id']||0x0;this['name']=_0x3db16b[_0x6b51('0x0')]||'';this[_0x6b51('0x1')]=_0x3db16b[_0x6b51('0x1')]||'';this[_0x6b51('0x2')]=_0x3db16b[_0x6b51('0x2')]||'';this['authType']=_0x3db16b[_0x6b51('0x3')]||'';this[_0x6b51('0x4')]=_0x3db16b[_0x6b51('0x4')]||'';this['consumerKey']=_0x3db16b[_0x6b51('0x5')]||'';this[_0x6b51('0x6')]=_0x3db16b['consumerSecret']||'';this[_0x6b51('0x7')]=_0x3db16b[_0x6b51('0x7')]||'';this[_0x6b51('0x8')]=_0x3db16b[_0x6b51('0x8')]||'';this['type']=_0x3db16b[_0x6b51('0x9')]||'';this[_0x6b51('0xa')]=_0x3db16b[_0x6b51('0xa')]||'';this['Configurations']=_0x3db16b[_0x6b51('0xb')]||{};}module[_0x6b51('0xc')]=DeskAccount; \ No newline at end of file +var _0xa4c0=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','username','remoteUri','authType'];(function(_0x36da2a,_0x139b77){var _0x457b21=function(_0x36eba8){while(--_0x36eba8){_0x36da2a['push'](_0x36da2a['shift']());}};_0x457b21(++_0x139b77);}(_0xa4c0,0x1e1));var _0x0a4c=function(_0x43c821,_0x3ac595){_0x43c821=_0x43c821-0x0;var _0x2b32d2=_0xa4c0[_0x43c821];return _0x2b32d2;};'use strict';function DeskAccount(_0xd27589){this['id']=_0xd27589['id']||0x0;this['name']=_0xd27589['name']||'';this[_0x0a4c('0x0')]=_0xd27589['username']||'';this[_0x0a4c('0x1')]=_0xd27589[_0x0a4c('0x1')]||'';this[_0x0a4c('0x2')]=_0xd27589[_0x0a4c('0x2')]||'';this[_0x0a4c('0x3')]=_0xd27589[_0x0a4c('0x3')]||'';this[_0x0a4c('0x4')]=_0xd27589[_0x0a4c('0x4')]||'';this['consumerSecret']=_0xd27589[_0x0a4c('0x5')]||'';this[_0x0a4c('0x6')]=_0xd27589[_0x0a4c('0x6')]||'';this[_0x0a4c('0x7')]=_0xd27589['tokenSecret']||'';this[_0x0a4c('0x8')]=_0xd27589[_0x0a4c('0x8')]||'';this[_0x0a4c('0x9')]=_0xd27589[_0x0a4c('0x9')]||'';this[_0x0a4c('0xa')]=_0xd27589[_0x0a4c('0xa')]||{};}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 8b226ec..26dea71 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 _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0xee5b,0x1f4));var _0xbee5=function(_0x504c4d,_0x10639e){_0x504c4d=_0x504c4d-0x0;var _0xc60939=_0xee5b[_0x504c4d];return _0xc60939;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x2750=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x2ed017,_0x1e0b8c){var _0x633736=function(_0x1671e1){while(--_0x1671e1){_0x2ed017['push'](_0x2ed017['shift']());}};_0x633736(++_0x1e0b8c);}(_0x2750,0x13b));var _0x0275=function(_0x422228,_0x1b54a8){_0x422228=_0x422228-0x0;var _0x315adc=_0x2750[_0x422228];return _0x315adc;};'use strict';function Dynamics365Account(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')]||'';this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')]||'';this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')]||'';this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')]||'';this[_0x0275('0x5')]=_0x1c9f4d['clientId']||'';this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||{};this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'';this['Configurations']=_0x1c9f4d[_0x0275('0x8')]||{};}module[_0x0275('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index ded0567..a187513 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 _0x2e2a=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','key','exports','name','description'];(function(_0x35a011,_0x149521){var _0x5dd832=function(_0xe719ef){while(--_0xe719ef){_0x35a011['push'](_0x35a011['shift']());}};_0x5dd832(++_0x149521);}(_0x2e2a,0x1de));var _0xa2e2=function(_0x646b70,_0x53d1e8){_0x646b70=_0x646b70-0x0;var _0x3c921a=_0x2e2a[_0x646b70];return _0x3c921a;};'use strict';function FaxAccount(_0x9e17f4){this['id']=_0x9e17f4['id']||0x0;this[_0xa2e2('0x0')]=_0x9e17f4[_0xa2e2('0x0')]||'';this[_0xa2e2('0x1')]=_0x9e17f4[_0xa2e2('0x1')];this[_0xa2e2('0x2')]=_0x9e17f4['ecm'];this[_0xa2e2('0x3')]=_0x9e17f4['headerinfo'];this['localstationid']=_0x9e17f4[_0xa2e2('0x4')];this[_0xa2e2('0x5')]=_0x9e17f4[_0xa2e2('0x5')]||0x960;this[_0xa2e2('0x6')]=_0x9e17f4[_0xa2e2('0x6')]||0x3840;this[_0xa2e2('0x7')]=_0x9e17f4[_0xa2e2('0x7')]||_0xa2e2('0x8');this[_0xa2e2('0x9')]=_0x9e17f4[_0xa2e2('0x9')]||'no';this[_0xa2e2('0xa')]=_0x9e17f4[_0xa2e2('0xa')]||'no';this[_0xa2e2('0xb')]=_0x9e17f4['t38timeout']||0x1388;this[_0xa2e2('0xc')]=_0x9e17f4['tech']||'SIP';this[_0xa2e2('0xd')]=_0x9e17f4['Trunk']?_0x9e17f4['Trunk']:undefined;this['ListId']=_0x9e17f4['ListId'];this['key']=_0x9e17f4[_0xa2e2('0xe')];}module[_0xa2e2('0xf')]=FaxAccount; \ No newline at end of file +var _0x9db1=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','description','ecm','headerinfo'];(function(_0x9b6a52,_0x3cb0ab){var _0x5c5c6f=function(_0x439987){while(--_0x439987){_0x9b6a52['push'](_0x9b6a52['shift']());}};_0x5c5c6f(++_0x3cb0ab);}(_0x9db1,0x1a1));var _0x19db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9db1[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0xe6ef5b){this['id']=_0xe6ef5b['id']||0x0;this['name']=_0xe6ef5b['name']||'';this[_0x19db('0x0')]=_0xe6ef5b['description'];this[_0x19db('0x1')]=_0xe6ef5b[_0x19db('0x1')];this[_0x19db('0x2')]=_0xe6ef5b[_0x19db('0x2')];this[_0x19db('0x3')]=_0xe6ef5b['localstationid'];this['minrate']=_0xe6ef5b[_0x19db('0x4')]||0x960;this[_0x19db('0x5')]=_0xe6ef5b[_0x19db('0x5')]||0x3840;this[_0x19db('0x6')]=_0xe6ef5b[_0x19db('0x6')]||'v17,v27,v29';this[_0x19db('0x7')]=_0xe6ef5b[_0x19db('0x7')]||'no';this[_0x19db('0x8')]=_0xe6ef5b[_0x19db('0x8')]||'no';this[_0x19db('0x9')]=_0xe6ef5b[_0x19db('0x9')]||0x1388;this[_0x19db('0xa')]=_0xe6ef5b[_0x19db('0xa')]||_0x19db('0xb');this[_0x19db('0xc')]=_0xe6ef5b[_0x19db('0xc')]?_0xe6ef5b[_0x19db('0xc')]:undefined;this[_0x19db('0xd')]=_0xe6ef5b[_0x19db('0xd')];this[_0x19db('0xe')]=_0xe6ef5b[_0x19db('0xe')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 574bdff..5a5c65e 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 _0x6399=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1d0e5e,_0x596f00){var _0x3ba445=function(_0x2c153f){while(--_0x2c153f){_0x1d0e5e['push'](_0x1d0e5e['shift']());}};_0x3ba445(++_0x596f00);}(_0x6399,0x1d6));var _0x9639=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6399[_0x580576];return _0x3f55a0;};'use strict';function FreshdeskAccount(_0x572185){this['id']=_0x572185['id']||0x0;this['name']=_0x572185[_0x9639('0x0')]||'';this[_0x9639('0x1')]=_0x572185[_0x9639('0x1')]||'';this[_0x9639('0x2')]=_0x572185[_0x9639('0x3')]||'';this[_0x9639('0x4')]=_0x572185['remoteUri']||'';this[_0x9639('0x5')]=_0x572185[_0x9639('0x5')]||'';this['Configurations']=_0x572185[_0x9639('0x6')]||{};}module[_0x9639('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xc936=['username','apiKey','remoteUri','serverUrl','Configurations','name'];(function(_0x24eb86,_0x36b26a){var _0x147ea8=function(_0x2fa9bf){while(--_0x2fa9bf){_0x24eb86['push'](_0x24eb86['shift']());}};_0x147ea8(++_0x36b26a);}(_0xc936,0xa1));var _0x6c93=function(_0x3ba6da,_0x15e94c){_0x3ba6da=_0x3ba6da-0x0;var _0x2f2460=_0xc936[_0x3ba6da];return _0x2f2460;};'use strict';function FreshdeskAccount(_0x1d29e1){this['id']=_0x1d29e1['id']||0x0;this['name']=_0x1d29e1[_0x6c93('0x0')]||'';this[_0x6c93('0x1')]=_0x1d29e1[_0x6c93('0x1')]||'';this[_0x6c93('0x2')]=_0x1d29e1['token']||'';this[_0x6c93('0x3')]=_0x1d29e1[_0x6c93('0x3')]||'';this[_0x6c93('0x4')]=_0x1d29e1[_0x6c93('0x4')]||'';this[_0x6c93('0x5')]=_0x1d29e1['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index b49389f..f869769 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 _0x64f5=['remoteUri','serverUrl','Configurations','exports','username','token'];(function(_0x86ba8c,_0x5dc2da){var _0x4c1ecf=function(_0x37b66c){while(--_0x37b66c){_0x86ba8c['push'](_0x86ba8c['shift']());}};_0x4c1ecf(++_0x5dc2da);}(_0x64f5,0x17e));var _0x564f=function(_0x3bd3f9,_0x5d5190){_0x3bd3f9=_0x3bd3f9-0x0;var _0x395e1d=_0x64f5[_0x3bd3f9];return _0x395e1d;};'use strict';function FreshsalesAccount(_0x3a60ff){this['id']=_0x3a60ff['id']||0x0;this['name']=_0x3a60ff['name']||'';this['username']=_0x3a60ff[_0x564f('0x0')]||'';this['apiKey']=_0x3a60ff[_0x564f('0x1')]||'';this[_0x564f('0x2')]=_0x3a60ff['remoteUri']||'';this[_0x564f('0x3')]=_0x3a60ff[_0x564f('0x3')]||'';this[_0x564f('0x4')]=_0x3a60ff[_0x564f('0x4')]||{};}module[_0x564f('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x00b3=['exports','username','remoteUri','serverUrl','Configurations'];(function(_0x246bb0,_0x7574e2){var _0x46ee7d=function(_0x563625){while(--_0x563625){_0x246bb0['push'](_0x246bb0['shift']());}};_0x46ee7d(++_0x7574e2);}(_0x00b3,0x97));var _0x300b=function(_0x5d6640,_0xe566c1){_0x5d6640=_0x5d6640-0x0;var _0x34ec8a=_0x00b3[_0x5d6640];return _0x34ec8a;};'use strict';function FreshsalesAccount(_0x3e1620){this['id']=_0x3e1620['id']||0x0;this['name']=_0x3e1620['name']||'';this[_0x300b('0x0')]=_0x3e1620[_0x300b('0x0')]||'';this['apiKey']=_0x3e1620['token']||'';this[_0x300b('0x1')]=_0x3e1620[_0x300b('0x1')]||'';this[_0x300b('0x2')]=_0x3e1620['serverUrl']||'';this[_0x300b('0x3')]=_0x3e1620[_0x300b('0x3')]||{};}module[_0x300b('0x4')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index d14195a..1a9de74 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 _0xef10=['exports','type','uniqueid','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinename','context','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables'];(function(_0x90617a,_0x28975f){var _0x5472a2=function(_0x4db80e){while(--_0x4db80e){_0x90617a['push'](_0x90617a['shift']());}};_0x5472a2(++_0x28975f);}(_0xef10,0x11f));var _0x0ef1=function(_0x12156e,_0x550b21){_0x12156e=_0x12156e-0x0;var _0x55ada7=_0xef10[_0x12156e];return _0x55ada7;};'use strict';function QueueReport(){this[_0x0ef1('0x0')]='inbound';this[_0x0ef1('0x1')]='';this['calleridnum']='';this[_0x0ef1('0x2')]='';this[_0x0ef1('0x3')]='';this[_0x0ef1('0x4')]=null;this['queuecallerleaveAt']=null;this[_0x0ef1('0x5')]=0x1;this[_0x0ef1('0x6')]=0x1;this[_0x0ef1('0x7')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x0ef1('0x8')]=null;this[_0x0ef1('0x9')]=![];this['queuecallerexitAt']=null;this[_0x0ef1('0xa')]=0x1;this[_0x0ef1('0xb')]='';this['connectedlinenum']='';this[_0x0ef1('0xc')]='';this['accountcode']='';this[_0x0ef1('0xd')]='';this['exten']='';this[_0x0ef1('0xe')]='';this[_0x0ef1('0xf')]=0x0;this['assigned']=![];this[_0x0ef1('0x10')]='';this[_0x0ef1('0x11')]=_0x0ef1('0x12');this[_0x0ef1('0x13')]=0x0;this[_0x0ef1('0x14')]={};}module[_0x0ef1('0x15')]=QueueReport; \ No newline at end of file +var _0x5664=['exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','variables'];(function(_0xad661e,_0x181e73){var _0x52b42c=function(_0x2b8eb6){while(--_0x2b8eb6){_0xad661e['push'](_0xad661e['shift']());}};_0x52b42c(++_0x181e73);}(_0x5664,0xe7));var _0x4566=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x5664[_0x43a1b8];return _0x324ecc;};'use strict';function QueueReport(){this[_0x4566('0x0')]='inbound';this[_0x4566('0x1')]='';this[_0x4566('0x2')]='';this[_0x4566('0x3')]='';this[_0x4566('0x4')]='';this[_0x4566('0x5')]=null;this[_0x4566('0x6')]=null;this[_0x4566('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x4566('0x8')]=![];this[_0x4566('0x9')]=null;this[_0x4566('0xa')]=0x1;this[_0x4566('0xb')]='';this[_0x4566('0xc')]='';this[_0x4566('0xd')]='';this[_0x4566('0xe')]='';this['context']='';this[_0x4566('0xf')]='';this[_0x4566('0x10')]='';this[_0x4566('0x11')]=0x0;this[_0x4566('0x12')]=![];this[_0x4566('0x13')]='';this[_0x4566('0x14')]='voice';this['mohtime']=0x0;this[_0x4566('0x15')]={};}module[_0x4566('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index b801e61..5b00140 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 _0xf34b=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x24a211,_0x55ca1f){var _0x12aeea=function(_0x2ff7b1){while(--_0x2ff7b1){_0x24a211['push'](_0x24a211['shift']());}};_0x12aeea(++_0x55ca1f);}(_0xf34b,0xb1));var _0xbf34=function(_0x3cd575,_0x29e715){_0x3cd575=_0x3cd575-0x0;var _0x2f83d1=_0xf34b[_0x3cd575];return _0x2f83d1;};'use strict';function SalesforceAccount(_0x1fa51c){this['id']=_0x1fa51c['id']||0x0;this[_0xbf34('0x0')]=_0x1fa51c[_0xbf34('0x0')]||'';this[_0xbf34('0x1')]=_0x1fa51c['username']||'';this[_0xbf34('0x2')]=_0x1fa51c[_0xbf34('0x2')]||'';this[_0xbf34('0x3')]=_0x1fa51c[_0xbf34('0x3')]||'';this[_0xbf34('0x4')]=_0x1fa51c[_0xbf34('0x4')]||'';this[_0xbf34('0x5')]=_0x1fa51c[_0xbf34('0x5')]||'';this[_0xbf34('0x6')]=_0x1fa51c['securityToken']||'';this['type']=_0x1fa51c[_0xbf34('0x7')]||_0xbf34('0x8');this[_0xbf34('0x9')]=_0x1fa51c[_0xbf34('0x9')]||'';this[_0xbf34('0xa')]=_0x1fa51c['Configurations']||{};}module[_0xbf34('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x3da3=['password','clientId','clientSecret','securityToken','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x3da3,0xad));var _0x33da=function(_0x45eea3,_0x43b0d0){_0x45eea3=_0x45eea3-0x0;var _0x433c31=_0x3da3[_0x45eea3];return _0x433c31;};'use strict';function SalesforceAccount(_0x15bc93){this['id']=_0x15bc93['id']||0x0;this['name']=_0x15bc93[_0x33da('0x0')]||'';this[_0x33da('0x1')]=_0x15bc93[_0x33da('0x1')]||'';this[_0x33da('0x2')]=_0x15bc93[_0x33da('0x2')]||'';this['password']=_0x15bc93[_0x33da('0x3')]||'';this[_0x33da('0x4')]=_0x15bc93[_0x33da('0x4')]||'';this[_0x33da('0x5')]=_0x15bc93['clientSecret']||'';this[_0x33da('0x6')]=_0x15bc93['securityToken']||'';this['type']=_0x15bc93['type']||_0x33da('0x7');this[_0x33da('0x8')]=_0x15bc93[_0x33da('0x8')]||'';this[_0x33da('0x9')]=_0x15bc93[_0x33da('0x9')]||{};}module[_0x33da('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 671c8d3..8d3b65d 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 _0xbfea=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x124e81,_0x5127c3){var _0x1cf7eb=function(_0x25c2df){while(--_0x25c2df){_0x124e81['push'](_0x124e81['shift']());}};_0x1cf7eb(++_0x5127c3);}(_0xbfea,0x145));var _0xabfe=function(_0xa42edf,_0x25eb7f){_0xa42edf=_0xa42edf-0x0;var _0x1e5b8f=_0xbfea[_0xa42edf];return _0x1e5b8f;};'use strict';function ServicenowAccount(_0x531b24){this['id']=_0x531b24['id']||0x0;this[_0xabfe('0x0')]=_0x531b24[_0xabfe('0x0')]||'';this[_0xabfe('0x1')]=_0x531b24[_0xabfe('0x1')]||'';this[_0xabfe('0x2')]=_0x531b24[_0xabfe('0x2')]||'';this[_0xabfe('0x3')]=_0x531b24[_0xabfe('0x3')]||'';this[_0xabfe('0x4')]=_0x531b24[_0xabfe('0x4')]||'';this[_0xabfe('0x5')]=_0x531b24[_0xabfe('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xdb7e=['Configurations','exports','name','username','password','remoteUri'];(function(_0x39ec8f,_0x1e00dd){var _0x495f83=function(_0x55a4f9){while(--_0x55a4f9){_0x39ec8f['push'](_0x39ec8f['shift']());}};_0x495f83(++_0x1e00dd);}(_0xdb7e,0x116));var _0xedb7=function(_0x4201bc,_0x83fda1){_0x4201bc=_0x4201bc-0x0;var _0x2bb64a=_0xdb7e[_0x4201bc];return _0x2bb64a;};'use strict';function ServicenowAccount(_0x332322){this['id']=_0x332322['id']||0x0;this[_0xedb7('0x0')]=_0x332322['name']||'';this['username']=_0x332322[_0xedb7('0x1')]||'';this[_0xedb7('0x2')]=_0x332322['password']||'';this[_0xedb7('0x3')]=_0x332322[_0xedb7('0x3')]||'';this['serverUrl']=_0x332322['serverUrl']||'';this[_0xedb7('0x4')]=_0x332322[_0xedb7('0x4')]||{};}module[_0xedb7('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index c261a41..ad39013 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 _0xd845=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0xd845,0x1e1));var _0x5d84=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd845[_0x31e29a];return _0x32d892;};'use strict';function SugarcrmAccount(_0x15ee62){this['id']=_0x15ee62['id']||0x0;this[_0x5d84('0x0')]=_0x15ee62[_0x5d84('0x0')]||'';this['username']=_0x15ee62[_0x5d84('0x1')]||'';this[_0x5d84('0x2')]=_0x15ee62[_0x5d84('0x2')]||'';this[_0x5d84('0x3')]=_0x15ee62['remoteUri']||'';this[_0x5d84('0x4')]=_0x15ee62[_0x5d84('0x4')]||'';this[_0x5d84('0x5')]=_0x15ee62[_0x5d84('0x5')]||{};}module[_0x5d84('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x7f84=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x58efa4,_0x50fde2){var _0x2d86b6=function(_0x1714eb){while(--_0x1714eb){_0x58efa4['push'](_0x58efa4['shift']());}};_0x2d86b6(++_0x50fde2);}(_0x7f84,0xcd));var _0x47f8=function(_0x4b6339,_0x49c545){_0x4b6339=_0x4b6339-0x0;var _0x353978=_0x7f84[_0x4b6339];return _0x353978;};'use strict';function SugarcrmAccount(_0x397801){this['id']=_0x397801['id']||0x0;this['name']=_0x397801[_0x47f8('0x0')]||'';this[_0x47f8('0x1')]=_0x397801[_0x47f8('0x1')]||'';this[_0x47f8('0x2')]=_0x397801[_0x47f8('0x2')]||'';this[_0x47f8('0x3')]=_0x397801['remoteUri']||'';this[_0x47f8('0x4')]=_0x397801[_0x47f8('0x4')]||'';this[_0x47f8('0x5')]=_0x397801[_0x47f8('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9417944..7e1191a 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 _0xc474=['exports','name','accountcode','state','unknown','stateTime','address'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xc474,0xe8));var _0x4c47=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xc474[_0x5f309e];return _0x487b5e;};'use strict';function Telephone(_0x31f415){this['id']=_0x31f415['id']||0x0;this[_0x4c47('0x0')]=_0x31f415['name']||'';this[_0x4c47('0x1')]=_0x31f415[_0x4c47('0x1')]||'';this[_0x4c47('0x2')]=_0x4c47('0x3');this[_0x4c47('0x4')]=0x0;this['status']=_0x4c47('0x3');this[_0x4c47('0x5')]='';}module[_0x4c47('0x6')]=Telephone; \ No newline at end of file +var _0x7e1a=['state','unknown','stateTime','address','exports','name','accountcode'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0xf006e0,_0x397eaa){_0xf006e0=_0xf006e0-0x0;var _0x161d45=_0x7e1a[_0xf006e0];return _0x161d45;};'use strict';function Telephone(_0x2e6803){this['id']=_0x2e6803['id']||0x0;this[_0xa7e1('0x0')]=_0x2e6803[_0xa7e1('0x0')]||'';this[_0xa7e1('0x1')]=_0x2e6803[_0xa7e1('0x1')]||'';this[_0xa7e1('0x2')]=_0xa7e1('0x3');this[_0xa7e1('0x4')]=0x0;this['status']=_0xa7e1('0x3');this[_0xa7e1('0x5')]='';}module[_0xa7e1('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index bed350f..8bd7d86 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x57b836,_0x56b5cf){var _0x26789=function(_0x41689a){while(--_0x41689a){_0x57b836['push'](_0x57b836['shift']());}};_0x26789(++_0x56b5cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x76ac32,_0x3a1afa){var _0x388ca6=function(_0x2a34b9){while(--_0x2a34b9){_0x76ac32['push'](_0x76ac32['shift']());}};_0x388ca6(++_0x3a1afa);}(_0xb10b,0x12a));var _0xbb10=function(_0x1496c1,_0x23cf40){_0x1496c1=_0x1496c1-0x0;var _0x48abc0=_0xb10b[_0x1496c1];return _0x48abc0;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 51209f5..a454886 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x346771,_0x1a56c1){var _0x5d63b9=function(_0xc344bd){while(--_0xc344bd){_0x346771['push'](_0x346771['shift']());}};_0x5d63b9(++_0x1a56c1);}(_0x14a0,0x8e));var _0x014a=function(_0x47f7fd,_0x4d350f){_0x47f7fd=_0x47f7fd-0x0;var _0x45ecc6=_0x14a0[_0x47f7fd];return _0x45ecc6;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x50528e,_0x5ae7de){var _0xb53771=function(_0x171db7){while(--_0x171db7){_0x50528e['push'](_0x50528e['shift']());}};_0xb53771(++_0x5ae7de);}(_0x8603,0x190));var _0x3860=function(_0x362d10,_0x5a1b75){_0x362d10=_0x362d10-0x0;var _0x2a1cd1=_0x8603[_0x362d10];return _0x2a1cd1;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 0528722..cce4449 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 _0x8b55=['stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown'];(function(_0x308c00,_0x3cbd67){var _0x2b21b2=function(_0x4ce3fc){while(--_0x4ce3fc){_0x308c00['push'](_0x308c00['shift']());}};_0x2b21b2(++_0x3cbd67);}(_0x8b55,0x13f));var _0x58b5=function(_0xe993c7,_0x512a93){_0xe993c7=_0xe993c7-0x0;var _0x410239=_0x8b55[_0xe993c7];return _0x410239;};'use strict';function Trunk(_0x2ae99c){this['id']=_0x2ae99c['id']||0x0;this[_0x58b5('0x0')]=_0x2ae99c['active']||![];this[_0x58b5('0x1')]=_0x2ae99c[_0x58b5('0x1')]||'';this[_0x58b5('0x2')]=_0x58b5('0x3');this[_0x58b5('0x4')]=0x0;this[_0x58b5('0x5')]=_0x58b5('0x3');this[_0x58b5('0x6')]=_0x2ae99c[_0x58b5('0x6')]&&_0x2ae99c['registry'][_0x58b5('0x7')](':')?_0x2ae99c[_0x58b5('0x6')][_0x58b5('0x8')](':')[0x0]:'';this[_0x58b5('0x9')]='';this[_0x58b5('0xa')]='';this[_0x58b5('0xb')]='';this[_0x58b5('0xc')]='';this[_0x58b5('0xd')]='';this[_0x58b5('0xe')]=_0x58b5('0x3');this[_0x58b5('0xf')]='';this[_0x58b5('0x10')]='';this['defaultuser']=_0x2ae99c[_0x58b5('0x11')]||'';}module[_0x58b5('0x12')]=Trunk; \ No newline at end of file +var _0x6b8d=['status','registry','indexOf','split','host','domain','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x6b8d,0x18b));var _0xd6b8=function(_0x3cc178,_0x5b9e42){_0x3cc178=_0x3cc178-0x0;var _0x4dc09a=_0x6b8d[_0x3cc178];return _0x4dc09a;};'use strict';function Trunk(_0x2379f2){this['id']=_0x2379f2['id']||0x0;this[_0xd6b8('0x0')]=_0x2379f2[_0xd6b8('0x0')]||![];this[_0xd6b8('0x1')]=_0x2379f2[_0xd6b8('0x1')]||'';this[_0xd6b8('0x2')]=_0xd6b8('0x3');this[_0xd6b8('0x4')]=0x0;this[_0xd6b8('0x5')]=_0xd6b8('0x3');this[_0xd6b8('0x6')]=_0x2379f2[_0xd6b8('0x6')]&&_0x2379f2[_0xd6b8('0x6')][_0xd6b8('0x7')](':')?_0x2379f2['registry'][_0xd6b8('0x8')](':')[0x0]:'';this[_0xd6b8('0x9')]='';this['port']='';this[_0xd6b8('0xa')]='';this['domainport']='';this[_0xd6b8('0xb')]='';this[_0xd6b8('0xc')]=_0xd6b8('0x3');this['registrationtime']='';this[_0xd6b8('0xd')]='';this[_0xd6b8('0xe')]=_0x2379f2[_0xd6b8('0xe')]||'';}module[_0xd6b8('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 4e5483b..7652773 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 _0xfb17=['exten','mandatoryDisposition'];(function(_0x42c3fa,_0x5b704c){var _0x29f89b=function(_0x12f7a7){while(--_0x12f7a7){_0x42c3fa['push'](_0x42c3fa['shift']());}};_0x29f89b(++_0x5b704c);}(_0xfb17,0x16a));var _0x7fb1=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xfb17[_0x122096];return _0x3d1966;};'use strict';function voiceExtension(_0x48438a){this['id']=_0x48438a['id']||0x0;this['exten']=_0x48438a[_0x7fb1('0x0')]||'';this['recordingFormat']=_0x48438a['recordingFormat']||'none';this[_0x7fb1('0x1')]=_0x48438a[_0x7fb1('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xf701=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0xeb4b01,_0x1b10b1){var _0x4f9b5e=function(_0x2be9f7){while(--_0x2be9f7){_0xeb4b01['push'](_0xeb4b01['shift']());}};_0x4f9b5e(++_0x1b10b1);}(_0xf701,0x16f));var _0x1f70=function(_0x32d3a0,_0x5d5a06){_0x32d3a0=_0x32d3a0-0x0;var _0x50d00e=_0xf701[_0x32d3a0];return _0x50d00e;};'use strict';function voiceExtension(_0x5918a5){this['id']=_0x5918a5['id']||0x0;this[_0x1f70('0x0')]=_0x5918a5[_0x1f70('0x0')]||'';this['recordingFormat']=_0x5918a5[_0x1f70('0x1')]||'none';this[_0x1f70('0x2')]=_0x5918a5['mandatoryDisposition']||![];}module[_0x1f70('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b906f12..f53c960 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 _0xeb38=['dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','onhold','wav','wav49','gsm','roundrobin','name','type','inbound','waiting','talking','total','sumDuration','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe'];(function(_0x3e8357,_0x19997f){var _0x5ebb87=function(_0x2f9c82){while(--_0x2f9c82){_0x3e8357['push'](_0x3e8357['shift']());}};_0x5ebb87(++_0x19997f);}(_0xeb38,0xf6));var _0x8eb3=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xeb38[_0x2235bf];return _0x4c3a64;};'use strict';var statusDesc=[_0x8eb3('0x0'),_0x8eb3('0x1'),_0x8eb3('0x2'),_0x8eb3('0x3'),_0x8eb3('0x4'),_0x8eb3('0x5'),'ringing','ringinuse',_0x8eb3('0x6')];var monitorFormat={'wav':_0x8eb3('0x7'),'wav49':_0x8eb3('0x8'),'gsm':_0x8eb3('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x8eb3('0xa')};function VoiceQueue(_0x11e200){this['id']=_0x11e200['id']||0x0;this[_0x8eb3('0xb')]=_0x11e200[_0x8eb3('0xb')]||'';this['monitor_format']=_0x11e200['monitor_format']||'';this[_0x8eb3('0xc')]=_0x11e200[_0x8eb3('0xc')]||_0x8eb3('0xd');this[_0x8eb3('0xe')]=0x0;this[_0x8eb3('0xf')]=0x0;this[_0x8eb3('0x10')]=0x0;this['answered']=0x0;this[_0x8eb3('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x8eb3('0x12')]=0x0;this[_0x8eb3('0x13')]=0x0;this['abandoned']=0x0;this[_0x8eb3('0x14')]=0x0;this['available']=0x0;this[_0x8eb3('0x15')]=_0x11e200['acw']||![];this[_0x8eb3('0x16')]=_0x11e200[_0x8eb3('0x16')]||0xa;this[_0x8eb3('0x17')]=_0x11e200[_0x8eb3('0x17')]||'no';this[_0x8eb3('0x18')]=!![];this[_0x8eb3('0x19')]='';this[_0x8eb3('0x1a')]=0x0;this[_0x8eb3('0x1b')]=0x0;this['dialTimezone']=_0x11e200[_0x8eb3('0x1c')]||null;this[_0x8eb3('0x1d')]=_0x11e200[_0x8eb3('0x1d')]?_0x11e200[_0x8eb3('0x1d')]:null;this[_0x8eb3('0x1e')]=_0x11e200['dialActive'];this[_0x8eb3('0x1f')]=_0x11e200[_0x8eb3('0x1f')]||_0x8eb3('0x20');this['dialLimitChannel']=_0x11e200[_0x8eb3('0x21')]||0x0;this[_0x8eb3('0x22')]=_0x11e200[_0x8eb3('0x22')]||0x0;this['dialPowerLevel']=_0x11e200[_0x8eb3('0x23')]||0x1;this[_0x8eb3('0x24')]=_0x11e200[_0x8eb3('0x24')]||_0x8eb3('0x25');this[_0x8eb3('0x26')]=_0x11e200[_0x8eb3('0x26')]||0.03;this[_0x8eb3('0x27')]=_0x11e200['dialPredictiveInterval']||0x258;this[_0x8eb3('0x28')]=_0x11e200['dialOriginateCallerIdName']||'anonymous';this[_0x8eb3('0x29')]=_0x11e200[_0x8eb3('0x29')]||'anonymous';this['dialOriginateTimeout']=_0x11e200[_0x8eb3('0x2a')]||0x1e;this[_0x8eb3('0x2b')]=_0x11e200['dialQueueOptions']||_0x8eb3('0x2c');this[_0x8eb3('0x2d')]=_0x11e200[_0x8eb3('0x2d')]||0x3;this[_0x8eb3('0x2e')]=_0x11e200[_0x8eb3('0x2e')]||undefined;this[_0x8eb3('0x2f')]=_0x11e200[_0x8eb3('0x2f')]||0x3;this[_0x8eb3('0x30')]=_0x11e200[_0x8eb3('0x30')]||0x96;this[_0x8eb3('0x31')]=_0x11e200['dialBusyMaxRetry']||0x3;this[_0x8eb3('0x32')]=_0x11e200[_0x8eb3('0x32')]||0x96;this[_0x8eb3('0x33')]=_0x11e200[_0x8eb3('0x33')]||0x3;this[_0x8eb3('0x34')]=_0x11e200[_0x8eb3('0x34')]||0x96;this[_0x8eb3('0x35')]=_0x11e200[_0x8eb3('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x11e200['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8eb3('0x36')]=_0x11e200[_0x8eb3('0x36')]||0x3;this[_0x8eb3('0x37')]=_0x11e200[_0x8eb3('0x37')]||0x96;this[_0x8eb3('0x38')]=_0x11e200['dialAbandonedMaxRetry']||0x3;this[_0x8eb3('0x39')]=_0x11e200[_0x8eb3('0x39')]||0x96;this['dialMachineMaxRetry']=_0x11e200[_0x8eb3('0x3a')]||0x3;this[_0x8eb3('0x3b')]=_0x11e200[_0x8eb3('0x3b')]||0x96;this[_0x8eb3('0x3c')]=_0x11e200['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x11e200['dialAgentRejectRetryFrequency']||0x96;this[_0x8eb3('0x3d')]=_0x11e200[_0x8eb3('0x3d')]||0x4;this[_0x8eb3('0x3e')]=_0x11e200[_0x8eb3('0x3e')]?_0x11e200[_0x8eb3('0x3e')]:undefined;this[_0x8eb3('0x3f')]=_0x11e200[_0x8eb3('0x3f')]?_0x11e200[_0x8eb3('0x3f')]:undefined;this[_0x8eb3('0x40')]=_0x11e200[_0x8eb3('0x40')]||undefined;this['Interval']=_0x11e200[_0x8eb3('0x41')]?_0x11e200[_0x8eb3('0x41')]:undefined;this[_0x8eb3('0x42')]=_0x11e200[_0x8eb3('0x42')]||_0x8eb3('0x43');this[_0x8eb3('0x44')]=_0x11e200['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8eb3('0x45')]=_0x11e200[_0x8eb3('0x45')]||undefined;this['strategy']=strategy[_0x11e200['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this[_0x8eb3('0x46')]=_0x11e200[_0x8eb3('0x46')]||![];this[_0x8eb3('0x47')]=_0x11e200[_0x8eb3('0x47')];this['dialAMDGreeting']=_0x11e200[_0x8eb3('0x48')];this[_0x8eb3('0x49')]=_0x11e200[_0x8eb3('0x49')];this['dialAMDTotalAnalysisTime']=_0x11e200['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x11e200['dialAMDMinWordLength'];this[_0x8eb3('0x4a')]=_0x11e200[_0x8eb3('0x4a')];this[_0x8eb3('0x4b')]=_0x11e200[_0x8eb3('0x4b')];this[_0x8eb3('0x4c')]=_0x11e200[_0x8eb3('0x4c')];this[_0x8eb3('0x4d')]=_0x11e200[_0x8eb3('0x4d')];this[_0x8eb3('0x4e')]=0x0;this[_0x8eb3('0x4f')]=0x0;this[_0x8eb3('0x50')]=_0x11e200[_0x8eb3('0x50')];this[_0x8eb3('0x51')]=0x0;this[_0x8eb3('0x52')]=0x0;this[_0x8eb3('0x53')]=0x0;this[_0x8eb3('0x54')]=0x0;this[_0x8eb3('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x8eb3('0x56')]=0x0;this[_0x8eb3('0x57')]=0x0;this[_0x8eb3('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x8eb3('0x59')]=0x0;this[_0x8eb3('0x5a')]=0x0;this['outboundReCallsDay']=0x0;this[_0x8eb3('0x5b')]=0x0;this[_0x8eb3('0x5c')]=undefined;this[_0x8eb3('0x5d')]=undefined;this[_0x8eb3('0x5e')]=undefined;this[_0x8eb3('0x5f')]=1.05;this[_0x8eb3('0x60')]=0x0;this[_0x8eb3('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x8eb3('0x62')]=0x0;this[_0x8eb3('0x63')]=0x0;this[_0x8eb3('0x64')]=0x0;this[_0x8eb3('0x65')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x8eb3('0x66')]=_0x11e200[_0x8eb3('0x67')]||0x14;this[_0x8eb3('0x68')]=_0x11e200['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x8eb3('0x69')]=0x0;this[_0x8eb3('0x6a')]=0x0;this[_0x8eb3('0x6b')]=0x0;this['erlangBusyFactor']=0x0;this[_0x8eb3('0x6c')]=_0x11e200[_0x8eb3('0x6c')]||0x1e;this[_0x8eb3('0x6d')]=_0x11e200[_0x8eb3('0x6d')]||![];this[_0x8eb3('0x6e')]=!!_0x11e200[_0x8eb3('0x6e')]||![];this[_0x8eb3('0x6f')]=!!_0x11e200[_0x8eb3('0x6f')]||![];this[_0x8eb3('0x70')]=_0x11e200[_0x8eb3('0x70')]||undefined;this[_0x8eb3('0x71')]=_0x11e200[_0x8eb3('0x71')]||![];this['dialAgiAfterHangupAgent']=_0x11e200[_0x8eb3('0x72')]||![];this[_0x8eb3('0x73')]=monitorFormat[_0x11e200[_0x8eb3('0x73')]]?monitorFormat[_0x11e200['monitor_format']]:undefined;this[_0x8eb3('0x74')]=_0x11e200[_0x8eb3('0x74')]||![];this[_0x8eb3('0x75')]=_0x11e200['mandatoryDispositionPause']?_0x11e200[_0x8eb3('0x75')]:undefined;}module[_0x8eb3('0x76')]=VoiceQueue; \ No newline at end of file +var _0x4aaa=['dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumDuration','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable'];(function(_0x417086,_0x1ab77e){var _0xc5a1ac=function(_0x32f49b){while(--_0x32f49b){_0x417086['push'](_0x417086['shift']());}};_0xc5a1ac(++_0x1ab77e);}(_0x4aaa,0x81));var _0xa4aa=function(_0x5c25af,_0x45f5c6){_0x5c25af=_0x5c25af-0x0;var _0x4bc33c=_0x4aaa[_0x5c25af];return _0x4bc33c;};'use strict';var statusDesc=[_0xa4aa('0x0'),_0xa4aa('0x1'),_0xa4aa('0x2'),_0xa4aa('0x3'),_0xa4aa('0x4'),_0xa4aa('0x5'),_0xa4aa('0x6'),'ringinuse',_0xa4aa('0x7')];var monitorFormat={'wav':_0xa4aa('0x8'),'wav49':_0xa4aa('0x9'),'gsm':_0xa4aa('0xa')};var strategy={'rrmemory':_0xa4aa('0xb'),'roundrobin':_0xa4aa('0xc')};function VoiceQueue(_0x22c3dd){this['id']=_0x22c3dd['id']||0x0;this['name']=_0x22c3dd[_0xa4aa('0xd')]||'';this[_0xa4aa('0xe')]=_0x22c3dd[_0xa4aa('0xe')]||'';this[_0xa4aa('0xf')]=_0x22c3dd['type']||_0xa4aa('0x10');this['waiting']=0x0;this[_0xa4aa('0x11')]=0x0;this[_0xa4aa('0x12')]=0x0;this['answered']=0x0;this[_0xa4aa('0x13')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xa4aa('0x14')]=0x0;this[_0xa4aa('0x15')]=0x0;this['available']=0x0;this[_0xa4aa('0x16')]=_0x22c3dd['acw']||![];this[_0xa4aa('0x17')]=_0x22c3dd[_0xa4aa('0x17')]||0xa;this[_0xa4aa('0x18')]=_0x22c3dd[_0xa4aa('0x18')]||'no';this[_0xa4aa('0x19')]=!![];this['message']='';this['originated']=0x0;this[_0xa4aa('0x1a')]=0x0;this[_0xa4aa('0x1b')]=_0x22c3dd['dialTimezone']||null;this[_0xa4aa('0x1c')]=_0x22c3dd[_0xa4aa('0x1c')]?_0x22c3dd[_0xa4aa('0x1c')]:null;this[_0xa4aa('0x1d')]=_0x22c3dd[_0xa4aa('0x1d')];this[_0xa4aa('0x1e')]=_0x22c3dd['dialMethod']||'progressive';this['dialLimitChannel']=_0x22c3dd[_0xa4aa('0x1f')]||0x0;this['dialLimitQueue']=_0x22c3dd[_0xa4aa('0x20')]||0x0;this[_0xa4aa('0x21')]=_0x22c3dd['dialPowerLevel']||0x1;this[_0xa4aa('0x22')]=_0x22c3dd[_0xa4aa('0x22')]||'dropRate';this[_0xa4aa('0x23')]=_0x22c3dd[_0xa4aa('0x23')]||0.03;this['dialPredictiveInterval']=_0x22c3dd[_0xa4aa('0x24')]||0x258;this[_0xa4aa('0x25')]=_0x22c3dd[_0xa4aa('0x25')]||_0xa4aa('0x26');this[_0xa4aa('0x27')]=_0x22c3dd[_0xa4aa('0x27')]||_0xa4aa('0x26');this[_0xa4aa('0x28')]=_0x22c3dd['dialOriginateTimeout']||0x1e;this[_0xa4aa('0x29')]=_0x22c3dd[_0xa4aa('0x29')]||_0xa4aa('0x2a');this[_0xa4aa('0x2b')]=_0x22c3dd[_0xa4aa('0x2b')]||0x3;this[_0xa4aa('0x2c')]=_0x22c3dd['dialQueueProject']||undefined;this[_0xa4aa('0x2d')]=_0x22c3dd[_0xa4aa('0x2d')]||0x3;this[_0xa4aa('0x2e')]=_0x22c3dd[_0xa4aa('0x2e')]||0x96;this[_0xa4aa('0x2f')]=_0x22c3dd['dialBusyMaxRetry']||0x3;this[_0xa4aa('0x30')]=_0x22c3dd['dialBusyRetryFrequency']||0x96;this[_0xa4aa('0x31')]=_0x22c3dd['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x22c3dd[_0xa4aa('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x22c3dd[_0xa4aa('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x22c3dd['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x22c3dd[_0xa4aa('0x34')]||0x3;this[_0xa4aa('0x35')]=_0x22c3dd[_0xa4aa('0x35')]||0x96;this[_0xa4aa('0x36')]=_0x22c3dd['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x22c3dd['dialAbandonedRetryFrequency']||0x96;this[_0xa4aa('0x37')]=_0x22c3dd[_0xa4aa('0x37')]||0x3;this['dialMachineRetryFrequency']=_0x22c3dd['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x22c3dd[_0xa4aa('0x38')]||0x3;this[_0xa4aa('0x39')]=_0x22c3dd[_0xa4aa('0x39')]||0x96;this['dialGlobalMaxRetry']=_0x22c3dd['dialGlobalMaxRetry']||0x4;this[_0xa4aa('0x3a')]=_0x22c3dd['Trunk']?_0x22c3dd[_0xa4aa('0x3a')]:undefined;this[_0xa4aa('0x3b')]=_0x22c3dd[_0xa4aa('0x3b')]?_0x22c3dd[_0xa4aa('0x3b')]:undefined;this[_0xa4aa('0x3c')]=_0x22c3dd[_0xa4aa('0x3c')]||undefined;this[_0xa4aa('0x3d')]=_0x22c3dd[_0xa4aa('0x3d')]?_0x22c3dd['Interval']:undefined;this[_0xa4aa('0x3e')]=_0x22c3dd[_0xa4aa('0x3e')]||_0xa4aa('0x3f');this[_0xa4aa('0x40')]=_0x22c3dd[_0xa4aa('0x40')]||undefined;this[_0xa4aa('0x41')]=_0x22c3dd[_0xa4aa('0x41')]||undefined;this['strategy']=strategy[_0x22c3dd['strategy']]||_0xa4aa('0xb');this['queueStatusComplete']=!![];this[_0xa4aa('0x42')]=_0x22c3dd[_0xa4aa('0x42')]||![];this[_0xa4aa('0x43')]=_0x22c3dd['dialAMDInitialSilence'];this[_0xa4aa('0x44')]=_0x22c3dd['dialAMDGreeting'];this[_0xa4aa('0x45')]=_0x22c3dd[_0xa4aa('0x45')];this[_0xa4aa('0x46')]=_0x22c3dd['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x22c3dd[_0xa4aa('0x47')];this[_0xa4aa('0x48')]=_0x22c3dd['dialAMDBetweenWordsSilence'];this[_0xa4aa('0x49')]=_0x22c3dd[_0xa4aa('0x49')];this['dialAMDSilenceThreshold']=_0x22c3dd['dialAMDSilenceThreshold'];this[_0xa4aa('0x4a')]=_0x22c3dd['dialAMDMaximumWordLength'];this[_0xa4aa('0x4b')]=0x0;this[_0xa4aa('0x4c')]=0x0;this['timeout']=_0x22c3dd[_0xa4aa('0x4d')];this[_0xa4aa('0x4e')]=0x0;this[_0xa4aa('0x4f')]=0x0;this[_0xa4aa('0x50')]=0x0;this[_0xa4aa('0x51')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xa4aa('0x52')]=0x0;this[_0xa4aa('0x53')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xa4aa('0x54')]=0x0;this[_0xa4aa('0x55')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa4aa('0x56')]=0x0;this[_0xa4aa('0x57')]=0x0;this[_0xa4aa('0x58')]=undefined;this[_0xa4aa('0x59')]=undefined;this[_0xa4aa('0x5a')]=undefined;this[_0xa4aa('0x5b')]=1.05;this[_0xa4aa('0x5c')]=0x0;this[_0xa4aa('0x5d')]=0x0;this[_0xa4aa('0x5e')]=0x0;this[_0xa4aa('0x5f')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xa4aa('0x60')]=0x0;this[_0xa4aa('0x61')]=0x0;this[_0xa4aa('0x62')]=0x0;this['predictiveIntervalMaxThreshold']=_0x22c3dd[_0xa4aa('0x63')]||0x14;this['predictiveIntervalMinThreshold']=_0x22c3dd[_0xa4aa('0x63')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa4aa('0x64')]=0x0;this[_0xa4aa('0x65')]=0x1;this[_0xa4aa('0x66')]=0x0;this[_0xa4aa('0x67')]=0x0;this[_0xa4aa('0x68')]=0x0;this['erlangBusyFactor']=0x0;this[_0xa4aa('0x69')]=_0x22c3dd[_0xa4aa('0x69')]||0x1e;this[_0xa4aa('0x6a')]=_0x22c3dd[_0xa4aa('0x6a')]||![];this[_0xa4aa('0x6b')]=!!_0x22c3dd[_0xa4aa('0x6b')]||![];this[_0xa4aa('0x6c')]=!!_0x22c3dd['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x22c3dd[_0xa4aa('0x6d')]||undefined;this[_0xa4aa('0x6e')]=_0x22c3dd[_0xa4aa('0x6e')]||![];this[_0xa4aa('0x6f')]=_0x22c3dd[_0xa4aa('0x6f')]||![];this['monitor_format']=monitorFormat[_0x22c3dd['monitor_format']]?monitorFormat[_0x22c3dd[_0xa4aa('0xe')]]:undefined;this[_0xa4aa('0x70')]=_0x22c3dd[_0xa4aa('0x70')]||![];this[_0xa4aa('0x71')]=_0x22c3dd[_0xa4aa('0x71')]?_0x22c3dd['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 176c784..4f96587 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 _0xce35=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3a89dc,_0x54bb1e){var _0x11c5c9=function(_0x21bd68){while(--_0x21bd68){_0x3a89dc['push'](_0x3a89dc['shift']());}};_0x11c5c9(++_0x54bb1e);}(_0xce35,0xb0));var _0x5ce3=function(_0x536025,_0x36a7cb){_0x536025=_0x536025-0x0;var _0x1c5ac4=_0xce35[_0x536025];return _0x1c5ac4;};'use strict';function VtigerAccount(_0x21054e){this['id']=_0x21054e['id']||0x0;this[_0x5ce3('0x0')]=_0x21054e[_0x5ce3('0x0')]||'';this[_0x5ce3('0x1')]=_0x21054e[_0x5ce3('0x1')]||'';this[_0x5ce3('0x2')]=_0x21054e[_0x5ce3('0x2')]||'';this[_0x5ce3('0x3')]=_0x21054e[_0x5ce3('0x3')]||'';this[_0x5ce3('0x4')]=_0x21054e[_0x5ce3('0x4')]||'';this['Configurations']=_0x21054e[_0x5ce3('0x5')]||{};}module[_0x5ce3('0x6')]=VtigerAccount; \ No newline at end of file +var _0xa9c0=['name','accessKey','remoteUri','Configurations','exports'];(function(_0x3d22f1,_0x44f83d){var _0x5231a0=function(_0x34922e){while(--_0x34922e){_0x3d22f1['push'](_0x3d22f1['shift']());}};_0x5231a0(++_0x44f83d);}(_0xa9c0,0x19f));var _0x0a9c=function(_0x970c65,_0x427593){_0x970c65=_0x970c65-0x0;var _0x2273db=_0xa9c0[_0x970c65];return _0x2273db;};'use strict';function VtigerAccount(_0x42293e){this['id']=_0x42293e['id']||0x0;this[_0x0a9c('0x0')]=_0x42293e[_0x0a9c('0x0')]||'';this['username']=_0x42293e['username']||'';this[_0x0a9c('0x1')]=_0x42293e['accessKey']||'';this[_0x0a9c('0x2')]=_0x42293e[_0x0a9c('0x2')]||'';this['serverUrl']=_0x42293e['serverUrl']||'';this['Configurations']=_0x42293e[_0x0a9c('0x3')]||{};}module[_0x0a9c('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 66934d7..7706522 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 _0xed8e=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x3dc73e,_0x3ac808){var _0xce8197=function(_0x549bd9){while(--_0x549bd9){_0x3dc73e['push'](_0x3dc73e['shift']());}};_0xce8197(++_0x3ac808);}(_0xed8e,0x1e7));var _0xeed8=function(_0x6602ae,_0x3992f6){_0x6602ae=_0x6602ae-0x0;var _0x48b5b7=_0xed8e[_0x6602ae];return _0x48b5b7;};'use strict';function ZendeskAccount(_0x3ec67f){this['id']=_0x3ec67f['id']||0x0;this[_0xeed8('0x0')]=_0x3ec67f[_0xeed8('0x0')]||'';this[_0xeed8('0x1')]=_0x3ec67f[_0xeed8('0x1')]||'';this[_0xeed8('0x2')]=_0x3ec67f['password']||'';this[_0xeed8('0x3')]=_0x3ec67f[_0xeed8('0x3')]||'';this['remoteUri']=_0x3ec67f[_0xeed8('0x4')]||'';this[_0xeed8('0x5')]=_0x3ec67f['authType']||'';this[_0xeed8('0x6')]=_0x3ec67f[_0xeed8('0x6')]||_0xeed8('0x7');this[_0xeed8('0x8')]=_0x3ec67f['serverUrl']||'';this['Configurations']=_0x3ec67f[_0xeed8('0x9')]||{};}module[_0xeed8('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x1f6c=['type','serverUrl','Configurations','exports','name','username','password','token','authType'];(function(_0x589a47,_0x28210e){var _0x3d361a=function(_0x2e83f2){while(--_0x2e83f2){_0x589a47['push'](_0x589a47['shift']());}};_0x3d361a(++_0x28210e);}(_0x1f6c,0x1b4));var _0xc1f6=function(_0x4c7377,_0x2a68d0){_0x4c7377=_0x4c7377-0x0;var _0x28fdf6=_0x1f6c[_0x4c7377];return _0x28fdf6;};'use strict';function ZendeskAccount(_0x160d5a){this['id']=_0x160d5a['id']||0x0;this[_0xc1f6('0x0')]=_0x160d5a[_0xc1f6('0x0')]||'';this[_0xc1f6('0x1')]=_0x160d5a[_0xc1f6('0x1')]||'';this[_0xc1f6('0x2')]=_0x160d5a[_0xc1f6('0x2')]||'';this[_0xc1f6('0x3')]=_0x160d5a[_0xc1f6('0x3')]||'';this['remoteUri']=_0x160d5a['remoteUri']||'';this[_0xc1f6('0x4')]=_0x160d5a[_0xc1f6('0x4')]||'';this[_0xc1f6('0x5')]=_0x160d5a[_0xc1f6('0x5')]||'integrationTab';this['serverUrl']=_0x160d5a[_0xc1f6('0x6')]||'';this[_0xc1f6('0x7')]=_0x160d5a[_0xc1f6('0x7')]||{};}module[_0xc1f6('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4c2334f..53ad0cd 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 _0xc6b3=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x1622fd,_0xf8101b){var _0xc3b5c2=function(_0x1ab584){while(--_0x1ab584){_0x1622fd['push'](_0x1622fd['shift']());}};_0xc3b5c2(++_0xf8101b);}(_0xc6b3,0xf1));var _0x3c6b=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xc6b3[_0xbec8e6];return _0x4aa6f2;};'use strict';function ZohoAccount(_0x4a8af4){this['id']=_0x4a8af4['id']||0x0;this[_0x3c6b('0x0')]=_0x4a8af4['name']||'';this['description']=_0x4a8af4[_0x3c6b('0x1')]||'';this['host']=_0x4a8af4[_0x3c6b('0x2')]||'';this['zone']=_0x4a8af4[_0x3c6b('0x3')]||'';this[_0x3c6b('0x4')]=_0x4a8af4[_0x3c6b('0x4')]||'';this[_0x3c6b('0x5')]=_0x4a8af4[_0x3c6b('0x5')]||'';this['serverUrl']=_0x4a8af4[_0x3c6b('0x6')]||'';this[_0x3c6b('0x7')]=_0x4a8af4['code']||'';this[_0x3c6b('0x8')]=_0x4a8af4['refreshToken']||'';this[_0x3c6b('0x9')]=_0x4a8af4[_0x3c6b('0x9')]||{};}module[_0x3c6b('0xa')]=ZohoAccount; \ No newline at end of file +var _0x52c2=['name','description','host','zone','clientId','clientSecret','code','refreshToken','Configurations'];(function(_0x18c79b,_0x2208ad){var _0x27ce51=function(_0x5763d6){while(--_0x5763d6){_0x18c79b['push'](_0x18c79b['shift']());}};_0x27ce51(++_0x2208ad);}(_0x52c2,0x90));var _0x252c=function(_0x54c892,_0x2df2e7){_0x54c892=_0x54c892-0x0;var _0x51238b=_0x52c2[_0x54c892];return _0x51238b;};'use strict';function ZohoAccount(_0x136a72){this['id']=_0x136a72['id']||0x0;this[_0x252c('0x0')]=_0x136a72[_0x252c('0x0')]||'';this[_0x252c('0x1')]=_0x136a72[_0x252c('0x1')]||'';this[_0x252c('0x2')]=_0x136a72[_0x252c('0x2')]||'';this[_0x252c('0x3')]=_0x136a72[_0x252c('0x3')]||'';this[_0x252c('0x4')]=_0x136a72[_0x252c('0x4')]||'';this[_0x252c('0x5')]=_0x136a72['clientSecret']||'';this['serverUrl']=_0x136a72['serverUrl']||'';this[_0x252c('0x6')]=_0x136a72[_0x252c('0x6')]||'';this['refreshToken']=_0x136a72[_0x252c('0x7')]||'';this[_0x252c('0x8')]=_0x136a72[_0x252c('0x8')]||{};}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 8c4f282..4f00eec 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 _0x645d=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','lodash','isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x10728d,_0xad4b46){var _0xf8e950=function(_0x3de859){while(--_0x3de859){_0x10728d['push'](_0x10728d['shift']());}};_0xf8e950(++_0xad4b46);}(_0x645d,0xde));var _0xd645=function(_0xed9dd,_0x184eb5){_0xed9dd=_0xed9dd-0x0;var _0x2b0faf=_0x645d[_0xed9dd];return _0x2b0faf;};'use strict';var util=require('util');var _=require(_0xd645('0x0'));var moment=require('moment');function checkNameSurname(_0x14897b,_0x2e11a0,_0x5e5fa8){var _0x53aea3='';if(!_[_0xd645('0x1')](_0x2e11a0)&&_0xd645('0x2')===typeof _0x2e11a0){_0x53aea3+=_0x2e11a0;}if(!_[_0xd645('0x1')](_0x5e5fa8)&&_0xd645('0x2')===typeof _0x5e5fa8){_0x53aea3+='\x20'+_0x5e5fa8;}if(_0x53aea3!==''){return _0x53aea3;}return _0x14897b;}function Action(_0x290559,_0x565035,_0x21cbf6,_0x9add59,_0x3bfb55){this[_0xd645('0x3')]=_0x21cbf6||undefined;this[_0xd645('0x4')]=_0x290559['id'];this[_0xd645('0x5')]=_0x565035[_0xd645('0x6')];this[_0xd645('0x7')]=_0x565035[_0xd645('0x7')];this['campaigntype']=_0xd645('0x5');this[_0xd645('0x8')]=![];this[_0xd645('0x9')]=_['isNil'](_0x290559[_0xd645('0xa')])?undefined:_0x290559[_0xd645('0xa')][_0xd645('0x6')];this[_0xd645('0xb')]=this[_0xd645('0x9')]?util['format'](_0xd645('0xc'),this['membername']):_0x9add59||undefined;this[_0xd645('0xd')]=checkNameSurname(_0x290559['Contact'][_0xd645('0xe')],_0x290559[_0xd645('0xf')][_0xd645('0x10')],_0x290559[_0xd645('0xf')][_0xd645('0x11')]);this[_0xd645('0x12')]=_0x290559['active']||![];this[_0xd645('0x13')]=_0x290559['Contact'][_0xd645('0xe')];this[_0xd645('0x14')]=_0x290559['scheduledat'];this['countbusyretry']=_0x290559[_0xd645('0x15')]||0x0;this[_0xd645('0x16')]=_0x290559[_0xd645('0x16')]||0x0;this['countnoanswerretry']=_0x290559[_0xd645('0x17')]||0x0;this[_0xd645('0x18')]=(_0x290559[_0xd645('0x15')]||0x0)+(_0x290559[_0xd645('0x16')]||0x0)+(_0x290559[_0xd645('0x17')]||0x0)+(_0x290559[_0xd645('0x19')]||0x0)+(_0x290559['countdropretry']||0x0)+(_0x290559['countabandonedretry']||0x0)+(_0x290559[_0xd645('0x1a')]||0x0)+(_0x290559[_0xd645('0x1b')]||0x0);this['countnosuchnumberretry']=_0x290559[_0xd645('0x19')]||0x0;this[_0xd645('0x1c')]=_0x290559['countdropretry']||0x0;this[_0xd645('0x1d')]=_0x290559['countabandonedretry']||0x0;this[_0xd645('0x1a')]=_0x290559[_0xd645('0x1a')]||0x0;this['countagentrejectretry']=_0x290559[_0xd645('0x1b')]||0x0;this[_0xd645('0x1e')]=_0x290559[_0xd645('0x1e')];this[_0xd645('0x1f')]=_0x290559[_0xd645('0x1f')];this[_0xd645('0x20')]=_0x290559[_0xd645('0x20')];this[_0xd645('0x21')]=_0x290559[_0xd645('0x21')];this[_0xd645('0x22')]=_0x290559[_0xd645('0x22')];this[_0xd645('0x23')]=_0x290559[_0xd645('0x23')];this[_0xd645('0x24')]=_[_0xd645('0x1')](_0x290559[_0xd645('0xa')])?_0x290559[_0xd645('0x24')]:_0x290559[_0xd645('0xa')]['id'];this[_0xd645('0x25')]=_0x290559[_0xd645('0x25')];this[_0xd645('0x26')]='';this[_0xd645('0x27')]='';}Action['prototype'][_0xd645('0x28')]=function(){return util[_0xd645('0x29')](_0xd645('0x2a'),this[_0xd645('0xd')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x4480=['callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','number','exports','util','lodash','moment','string','isNil','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid'];(function(_0x43d887,_0x56462c){var _0x5bbfb7=function(_0x2ed6f5){while(--_0x2ed6f5){_0x43d887['push'](_0x43d887['shift']());}};_0x5bbfb7(++_0x56462c);}(_0x4480,0x1b9));var _0x0448=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4480[_0x334841];return _0x5beb4b;};'use strict';var util=require(_0x0448('0x0'));var _=require(_0x0448('0x1'));var moment=require(_0x0448('0x2'));function checkNameSurname(_0x4882e1,_0xf400e9,_0x1ab8cd){var _0x4ec260='';if(!_['isNil'](_0xf400e9)&&_0x0448('0x3')===typeof _0xf400e9){_0x4ec260+=_0xf400e9;}if(!_[_0x0448('0x4')](_0x1ab8cd)&&_0x0448('0x3')===typeof _0x1ab8cd){_0x4ec260+='\x20'+_0x1ab8cd;}if(_0x4ec260!==''){return _0x4ec260;}return _0x4882e1;}function Action(_0x2ded8b,_0x514358,_0x5bea69,_0x2569a3,_0x1a4056){this['uniqueid']=_0x5bea69||undefined;this[_0x0448('0x5')]=_0x2ded8b['id'];this[_0x0448('0x6')]=_0x514358[_0x0448('0x7')];this[_0x0448('0x8')]=_0x514358['type'];this[_0x0448('0x9')]='queue';this['dialAnswer']=![];this[_0x0448('0xa')]=_[_0x0448('0x4')](_0x2ded8b[_0x0448('0xb')])?undefined:_0x2ded8b[_0x0448('0xb')][_0x0448('0x7')];this[_0x0448('0xc')]=this[_0x0448('0xa')]?util['format'](_0x0448('0xd'),this[_0x0448('0xa')]):_0x2569a3||undefined;this[_0x0448('0xe')]=checkNameSurname(_0x2ded8b[_0x0448('0xf')][_0x0448('0x10')],_0x2ded8b[_0x0448('0xf')][_0x0448('0x11')],_0x2ded8b[_0x0448('0xf')][_0x0448('0x12')]);this[_0x0448('0x13')]=_0x2ded8b[_0x0448('0x13')]||![];this['calleridnum']=_0x2ded8b[_0x0448('0xf')][_0x0448('0x10')];this[_0x0448('0x14')]=_0x2ded8b[_0x0448('0x14')];this[_0x0448('0x15')]=_0x2ded8b[_0x0448('0x15')]||0x0;this['countcongestionretry']=_0x2ded8b['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2ded8b[_0x0448('0x16')]||0x0;this[_0x0448('0x17')]=(_0x2ded8b[_0x0448('0x15')]||0x0)+(_0x2ded8b[_0x0448('0x18')]||0x0)+(_0x2ded8b[_0x0448('0x16')]||0x0)+(_0x2ded8b[_0x0448('0x19')]||0x0)+(_0x2ded8b[_0x0448('0x1a')]||0x0)+(_0x2ded8b[_0x0448('0x1b')]||0x0)+(_0x2ded8b[_0x0448('0x1c')]||0x0)+(_0x2ded8b[_0x0448('0x1d')]||0x0);this[_0x0448('0x19')]=_0x2ded8b[_0x0448('0x19')]||0x0;this['countdropretry']=_0x2ded8b[_0x0448('0x1a')]||0x0;this[_0x0448('0x1b')]=_0x2ded8b[_0x0448('0x1b')]||0x0;this[_0x0448('0x1c')]=_0x2ded8b[_0x0448('0x1c')]||0x0;this[_0x0448('0x1d')]=_0x2ded8b[_0x0448('0x1d')]||0x0;this[_0x0448('0x1e')]=_0x2ded8b['callback'];this[_0x0448('0x1f')]=_0x2ded8b[_0x0448('0x1f')];this[_0x0448('0x20')]=_0x2ded8b[_0x0448('0x20')];this[_0x0448('0x21')]=_0x2ded8b['recallme'];this[_0x0448('0x22')]=_0x2ded8b[_0x0448('0x22')];this['ListId']=_0x2ded8b['ListId'];this[_0x0448('0x23')]=_['isNil'](_0x2ded8b[_0x0448('0xb')])?_0x2ded8b[_0x0448('0x23')]:_0x2ded8b[_0x0448('0xb')]['id'];this[_0x0448('0x24')]=_0x2ded8b[_0x0448('0x24')];this[_0x0448('0x25')]='';this[_0x0448('0x26')]='';}Action[_0x0448('0x27')]['getCaller']=function(){return util[_0x0448('0x28')]('\x22%s\x22\x20<%s>',this[_0x0448('0xe')],this[_0x0448('0x29')]);};module[_0x0448('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 765980f..d7d3999 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 _0x8958=['Busy','custom:agentbusy','busy','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countglobal','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','phone','trim','getCallerId','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','responsetime','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','addVariable','keys','value','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','lodash','ioredis','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','dialMethod','booked','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','actions','queue','pick','UserId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','ANSWER','answertime','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','complete','buildObj','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry'];(function(_0x19ed17,_0x43e9e1){var _0xd9a732=function(_0x55bf2b){while(--_0x55bf2b){_0x19ed17['push'](_0x19ed17['shift']());}};_0xd9a732(++_0x43e9e1);}(_0x8958,0x93));var _0x8895=function(_0x244d0d,_0x248c65){_0x244d0d=_0x244d0d-0x0;var _0x32f5c6=_0x8958[_0x244d0d];return _0x32f5c6;};'use strict';var util=require('util');var _=require(_0x8895('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require(_0x8895('0x1'));var config=require('../../../config/environment');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var loggerAction=require(_0x8895('0x2'))('actionPreview');var ami=require(_0x8895('0x4'));var rpcDb=require(_0x8895('0x5'));var Action=require(_0x8895('0x6'));var ut=require(_0x8895('0x7'));config[_0x8895('0x8')]=_['defaults'](config[_0x8895('0x8')],{'host':_0x8895('0x9'),'port':0x18eb});var io=require(_0x8895('0xa'))(new Redis(config[_0x8895('0x8')]));var Sequence=function(){};Sequence[_0x8895('0xb')][_0x8895('0xc')]=function(_0x22a12b){this[_0x8895('0xd')]=this[_0x8895('0xd')]?this[_0x8895('0xd')]['finally'](_0x22a12b):_0x22a12b();};function Preview(_0x1cf600){this[_0x8895('0xe')]=new Sequence();this[_0x8895('0xf')]=_0x1cf600[_0x8895('0x10')];this[_0x8895('0x11')]=_0x1cf600[_0x8895('0x11')];this['actions']={};this[_0x8895('0x12')]=_0x1cf600[_0x8895('0x12')];this[_0x8895('0x13')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x8895('0x14')](this));ami['on']('hangup',this[_0x8895('0x15')][_0x8895('0x14')](this));ami['on'](_0x8895('0x16'),this[_0x8895('0x17')][_0x8895('0x14')](this));ami['on']('dialend',this[_0x8895('0x18')][_0x8895('0x14')](this));ami['on'](_0x8895('0x19'),this[_0x8895('0x1a')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1b'),this[_0x8895('0x1c')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1d'),this[_0x8895('0x1e')][_0x8895('0x14')](this));ami['on'](_0x8895('0x1f'),this[_0x8895('0x20')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x3daf43,_0x456282,_0x2d189c){io['to'](_0x3daf43)[_0x8895('0x21')](_0x456282,_0x2d189c);}function emitCampaignPreview(_0x3f7d5a){if(_0x3f7d5a[_0x8895('0x22')]===_0x8895('0x23')){var _0xc1ce17={'id':_0x3f7d5a['id'],'name':_0x3f7d5a['name'],'strategy':_0x3f7d5a[_0x8895('0x24')],'answered':_0x3f7d5a[_0x8895('0x25')],'available':_0x3f7d5a[_0x8895('0x26')],'loggedIn':_0x3f7d5a[_0x8895('0x27')],'pTalking':_0x3f7d5a[_0x8895('0x28')],'sumBillable':_0x3f7d5a['sumBillable'],'sumDuration':_0x3f7d5a['sumDuration'],'sumHoldTime':_0x3f7d5a[_0x8895('0x29')]||0x0,'talking':_0x3f7d5a[_0x8895('0x2a')],'total':_0x3f7d5a[_0x8895('0x2b')],'type':_0x3f7d5a[_0x8895('0x22')],'unmanaged':_0x3f7d5a['unmanaged'],'abandoned':_0x3f7d5a[_0x8895('0x2c')],'waiting':_0x3f7d5a[_0x8895('0x2d')],'loggedInDb':_0x3f7d5a[_0x8895('0x2e')],'dialActive':_0x3f7d5a['dialActive'],'dialMethod':_0x3f7d5a['dialMethod'],'dialOriginateCallerIdName':_0x3f7d5a[_0x8895('0x2f')],'dialOriginateCallerIdNumber':_0x3f7d5a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3f7d5a[_0x8895('0x30')],'dialPrefix':_0x3f7d5a[_0x8895('0x31')],'outboundAnswerAgiCallsDay':_0x3f7d5a[_0x8895('0x32')],'outboundAnswerCallsDay':_0x3f7d5a[_0x8895('0x33')],'outboundBlacklistCallsDay':_0x3f7d5a[_0x8895('0x34')],'outboundBusyCallsDay':_0x3f7d5a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3f7d5a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3f7d5a[_0x8895('0x35')],'outboundDropCallsDayCallersExit':_0x3f7d5a[_0x8895('0x36')],'outboundDropCallsDayTimeout':_0x3f7d5a[_0x8895('0x37')],'outboundNoAnswerCallsDay':_0x3f7d5a[_0x8895('0x38')],'outboundNoSuchCallsDay':_0x3f7d5a[_0x8895('0x39')],'outboundOriginateFailureCallsDay':_0x3f7d5a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3f7d5a['outboundReCallsDay'],'outboundRejectCallsDay':_0x3f7d5a[_0x8895('0x3a')],'outboundUnknownCallsDay':_0x3f7d5a[_0x8895('0x3b')],'outboundAbandonedCallsDay':_0x3f7d5a[_0x8895('0x3c')],'predictiveIntervalAnsweredCalls':_0x3f7d5a[_0x8895('0x3d')],'predictiveIntervalAvgHoldtime':_0x3f7d5a[_0x8895('0x3e')],'predictiveIntervalAvgTalktime':_0x3f7d5a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3f7d5a[_0x8895('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x3f7d5a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3f7d5a[_0x8895('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x3f7d5a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3f7d5a[_0x8895('0x41')],'predictiveIntervalMultiplicativeFactor':_0x3f7d5a[_0x8895('0x42')],'predictiveIntervalPauses':_0x3f7d5a[_0x8895('0x43')],'predictiveIntervalAvailable':_0x3f7d5a[_0x8895('0x44')],'predictiveIntervalTotalCalls':_0x3f7d5a[_0x8895('0x45')],'message':_0x3f7d5a['message'],'originated':_0x3f7d5a[_0x8895('0x46')],'erlangCalls':_0x3f7d5a[_0x8895('0x47')],'erlangCallToSecond':_0x3f7d5a[_0x8895('0x48')],'erlangAbandonmentRate':_0x3f7d5a[_0x8895('0x49')],'erlangBusyFactor':_0x3f7d5a[_0x8895('0x4a')],'startPredictive':_0x3f7d5a['startPredictive'],'startProgressive':_0x3f7d5a[_0x8895('0x4b')]};if(_0x3f7d5a['Trunk']){_0xc1ce17[_0x8895('0x4c')]={'id':_0x3f7d5a['Trunk']['id'],'name':_0x3f7d5a[_0x8895('0x4c')][_0x8895('0x4d')],'active':_0x3f7d5a[_0x8895('0x4c')][_0x8895('0x4e')],'callerid':_0x3f7d5a[_0x8895('0x4c')]['callerid']};}if(_0x3f7d5a[_0x8895('0x4f')]){_0xc1ce17['Interval']={'id':_0x3f7d5a[_0x8895('0x4f')]['id'],'name':_0x3f7d5a[_0x8895('0x4f')][_0x8895('0x4d')]};}var _0x9297ea=md5(JSON[_0x8895('0x50')](_0xc1ce17));if(_0x3f7d5a[_0x8895('0x51')]!==_0x9297ea){_0x3f7d5a['md5']=_0x9297ea;emit(util[_0x8895('0x52')](_0x8895('0x53'),_0xc1ce17['name']),_0x8895('0x54'),_0xc1ce17);}}}function emitVoiceQueueChannelRemove(_0x54ca09){logger[_0x8895('0x55')](_0x8895('0x56'),JSON['stringify'](_0x54ca09));emit(util[_0x8895('0x52')](_0x8895('0x53'),_0x54ca09['name']),'voice_queue_channel:remove',_0x54ca09);io[_0x8895('0x21')](_0x8895('0x57'),_0x54ca09);}function notSendMessagesQueue(_0x55aacc){if(_0x55aacc[_0x8895('0x58')]){if(_0x55aacc[_0x8895('0x46')]===0x0&&_0x55aacc['pTalking']===0x0){_0x55aacc[_0x8895('0x58')]=![];_0x55aacc[_0x8895('0x26')]=0x0;_0x55aacc[_0x8895('0x59')]=0x0;_0x55aacc[_0x8895('0x5a')]=_0x8895('0x5b');ut[_0x8895('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x55aacc[_0x8895('0x4d')]+'\x20is\x20not\x20active');}else{_0x55aacc[_0x8895('0x5a')]=_0x8895('0x5d');ut['logger'](_0x8895('0x5e'),_0x55aacc['name']+_0x8895('0x5f'));}emitCampaignPreview(_0x55aacc);}}Preview['prototype']['loopCampaigns']=function(){var _0x51277b=this;setInterval(function(){_0x51277b['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x447ed6=this[_0x8895('0xf')];this['clockClearZombieChannels']+=0x1;for(var _0x4835d7 in _0x447ed6){if(_0x447ed6[_0x8895('0x60')](_0x4835d7)&&(_0x447ed6[_0x4835d7][_0x8895('0x61')]==='preview'||_0x447ed6[_0x4835d7][_0x8895('0x61')]===_0x8895('0x62'))&&_0x447ed6[_0x4835d7][_0x8895('0x22')]===_0x8895('0x23')){if(this[_0x8895('0x13')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x447ed6['hasOwnProperty'](_0x4835d7)&&_0x447ed6[_0x4835d7][_0x8895('0x61')]==='preview'&&_0x447ed6[_0x4835d7][_0x8895('0x22')]===_0x8895('0x23')){if(_0x447ed6[_0x4835d7][_0x8895('0x63')]){this[_0x8895('0x64')](_0x447ed6[_0x4835d7]);if(_0x447ed6[_0x4835d7]['dialPreviewAutoRecallMe'])this[_0x8895('0x65')](_0x447ed6[_0x4835d7]);}else{notSendMessagesQueue(_0x447ed6[_0x4835d7]);}}}};Preview[_0x8895('0xb')][_0x8895('0x66')]=function(_0x167302){var _0x2d585c=this;this[_0x8895('0xe')][_0x8895('0xc')](function(){if(!_[_0x8895('0x67')](_0x2d585c['actions'][_0x167302])){loggerAction[_0x8895('0x55')](_0x8895('0x68'),_0x167302,'Queue',_0x2d585c[_0x8895('0x69')][_0x167302]['queue'],'originated:\x20',JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302]['queue']][_0x8895('0x46')]),'pTalking:\x20',JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]][_0x8895('0x28')]),JSON[_0x8895('0x50')](_0x2d585c[_0x8895('0x69')][_0x167302]['dialAnswer']),JSON['stringify'](_[_0x8895('0x6b')](_0x2d585c[_0x8895('0x69')][_0x167302],['contactId',_0x8895('0x6c'),'VoiceQueueId','ListId'])));return ami[_0x8895('0x6d')]({'action':'status','channel':_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6e')]})[_0x8895('0x6f')](function(_0x459e1a){if(_0x459e1a[_0x8895('0x5a')]===_0x8895('0x70')){setTimeout(function(){if(_0x2d585c[_0x8895('0x69')][_0x167302]){ut[_0x8895('0x71')](_0x2d585c['campaignsPreview'][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]],_0x8895('0x72'));if(_0x2d585c['actions'][_0x167302][_0x8895('0x73')]===!![]){ut[_0x8895('0x74')](_0x2d585c[_0x8895('0xf')][_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]],_0x8895('0x72'));ut[_0x8895('0x75')](_0x8895('0x76')+_0x167302,_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]);}ut['loggerError'](_0x8895('0x77')+_0x167302,_0x2d585c[_0x8895('0x69')][_0x167302][_0x8895('0x6a')]);delete _0x2d585c[_0x8895('0x69')][_0x167302];}},0x2328);}});}});};Preview[_0x8895('0xb')]['clearZombieChannels']=function(){var _0x1b3c99=this;loggerAction[_0x8895('0x55')](_0x8895('0x78'),_[_0x8895('0x79')](this[_0x8895('0x69')]));for(var _0x58dd6c in this[_0x8895('0x69')]){if(_0x1b3c99[_0x8895('0x69')][_0x8895('0x60')](_0x58dd6c)){_0x1b3c99['clearZombieChannel'](_0x58dd6c);}}};Preview[_0x8895('0xb')][_0x8895('0x65')]=function(_0x2c777b){var _0x4ec8eb=this;rpcDb[_0x8895('0x7a')](_0x2c777b['id'],ut[_0x8895('0x7b')](this['agents']))[_0x8895('0x7c')](function(_0x26f68c){if(!_['isNil'](_0x26f68c)){for(var _0x2f990a=0x0;_0x2f990a<_0x26f68c[_0x8895('0x7d')];_0x2f990a+=0x1){if(ut[_0x8895('0x7e')](_0x26f68c[_0x2f990a][_0x8895('0x7f')])<_0x2c777b['dialRecallMeTimeout']*0x3c){if(_0x26f68c[_0x2f990a]['Agent']&&!_0x26f68c[_0x2f990a][_0x8895('0x80')][_0x8895('0x81')]){_0x4ec8eb[_0x8895('0x82')](_0x26f68c[_0x2f990a]['id'])['then'](ut[_0x8895('0x83')](_0x8895('0x84')))['catch'](ut[_0x8895('0x83')]('[RecallMe]'));}else{rpcDb[_0x8895('0x85')](_0x26f68c[_0x2f990a]['id']);}}else{var _0x2bd955=new Action(_0x26f68c[_0x2f990a],_0x2c777b);_0x2bd955[_0x8895('0x86')]=moment()[_0x8895('0x52')](_0x8895('0x87'));_0x2c777b['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x2bd955,0x17,_0x8895('0x88'));if(_0x2c777b[_0x8895('0x89')]){rpcDb['rescheduleContactInQueue'](ut[_0x8895('0x8a')](_0x26f68c[_0x2f990a]));rpcDb[_0x8895('0x8b')](_0x2bd955,_0x8895('0x8c'));}else{ut[_0x8895('0x8d')](_0x2bd955,0x16,'RecallFailedTimeout');rpcDb[_0x8895('0x8b')](_0x2bd955,_0x8895('0x8e'));rpcDb[_0x8895('0x8f')](_0x2bd955,_0x8895('0x8e'));}}}}})[_0x8895('0x6f')](ut[_0x8895('0x83')](_0x8895('0x90')));};Preview[_0x8895('0xb')][_0x8895('0x64')]=function(_0x21c7bb){_0x21c7bb[_0x8895('0x58')]=!![];if(ut[_0x8895('0x91')](_0x21c7bb[_0x8895('0x27')])){_0x21c7bb[_0x8895('0x5a')]=_0x8895('0x92');}else if(!ut['isActive'](_0x21c7bb['dialActive'])){_0x21c7bb['message']=_0x8895('0x5b');}else if(!this[_0x8895('0x93')](_0x21c7bb[_0x8895('0x4c')])){if(!this[_0x8895('0x93')](_0x21c7bb[_0x8895('0x94')])){_0x21c7bb['message']=_0x8895('0x95');}else{_0x21c7bb[_0x8895('0x5a')]='ACTIVE';}}else{_0x21c7bb[_0x8895('0x5a')]=_0x8895('0x96');}emitCampaignPreview(_0x21c7bb);};Preview[_0x8895('0xb')][_0x8895('0x97')]=function(_0x3ee89e,_0x526ac9,_0x6440ea){var _0x3c318c=this;var _0x119624=this[_0x8895('0x69')][_0x526ac9];var _0x113ac4=this[_0x8895('0xf')][_0x119624[_0x8895('0x6a')]];var _0x5e7048;if(_0x113ac4){switch(_0x6440ea){case'1':_0x113ac4[_0x8895('0x39')]+=0x1;_0x119624[_0x8895('0x98')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x0,_0x8895('0x9a'));ami[_0x8895('0x21')](_0x8895('0x9b'),ut['buildObj'](_0x119624,_0x8895('0x9c')));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0x9d'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xa0'));}else{if(_0x119624['countnosuchnumberretry']>=_0x113ac4[_0x8895('0xa1')]){rpcDb['createCustomerFinal'](_0x119624,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0x98'),_0x113ac4['dialNoSuchNumberRetryFrequency']),_0x119624[_0x8895('0xa4')],_0x119624['activeContact']);}}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;case _0x8895('0xa6'):var _0x42d342=moment()[_0x8895('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x119624['responsetime']=_0x42d342;_0x119624[_0x8895('0xa7')]=_0x42d342;_0x119624['dialAnswer']=!![];_0x113ac4[_0x8895('0x28')]+=0x1;logger[_0x8895('0x55')]('[syncHangup][talking][increment]',_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],_0x8895('0xaa'),_0x113ac4[_0x8895('0x28')]);ami['emit'](_0x8895('0xab'),ut['buildObj'](_0x119624,'connect',this[_0x8895('0xf')][_0x119624['queue']]));if(_0x113ac4[_0x8895('0xac')]){ami[_0x8895('0x21')](_0x8895('0xad'),ut[_0x8895('0xae')](_0x119624));}break;case'16':ami['emit']('custom:agentcomplete',ut['buildObj'](_0x119624,_0x8895('0xaf'),this[_0x8895('0xf')][_0x119624[_0x8895('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0x8895('0xb0')](_0x119624,_0x8895('0xaf')));_0x113ac4[_0x8895('0x33')]+=0x1;_0x113ac4['total']+=0x1;_0x113ac4[_0x8895('0x25')]+=0x1;ut[_0x8895('0x74')](_0x113ac4,_0x8895('0xb1'));_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut['logCustomer'](_0x119624,0x4,_0x8895('0xb2'));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0xb3'));rpcDb[_0x8895('0x8f')](_0x119624,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8895('0xb4')](_0x119624);_0x113ac4[_0x8895('0xb5')]+=_0x119624['talktime'];_0x113ac4[_0x8895('0xb6')]+=_0x119624[_0x8895('0xb7')];logger[_0x8895('0x55')](_0x8895('0xb8'),_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],'pTalking:\x20',_0x113ac4[_0x8895('0x28')]);delete this['actions'][_0x3ee89e[_0x8895('0xa5')]];break;case _0x8895('0xb9'):_0x113ac4[_0x8895('0xba')]+=0x1;_0x119624[_0x8895('0xbb')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x5,_0x8895('0xbc'));ami[_0x8895('0x21')](_0x8895('0xbd'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xbe')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0xf,'Global');rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xc0'));}else{if(_0x119624[_0x8895('0xbb')]>=_0x113ac4[_0x8895('0xc1')]){rpcDb['createCustomerFinal'](_0x119624,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xbb'),_0x113ac4[_0x8895('0xc2')]),_0x119624[_0x8895('0xa4')],_0x119624['activeContact']);}}break;case _0x8895('0xc3'):_0x113ac4[_0x8895('0x38')]+=0x1;_0x119624['countnoanswerretry']+=0x1;_0x119624[_0x8895('0xc4')]=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x3,_0x8895('0xc5'));ami[_0x8895('0x21')](_0x8895('0xc6'),ut['buildObj'](_0x119624,_0x8895('0xc7')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xc8'));}else{if(_0x119624['countnoanswerretry']>=_0x113ac4['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xc9'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xca'),_0x113ac4[_0x8895('0xcb')]),_0x119624['unlockAgent'],_0x119624[_0x8895('0xcc')]);}}break;case _0x8895('0xcd'):_0x113ac4[_0x8895('0xce')]+=0x1;_0x119624['countcongestionretry']+=0x1;_0x119624['countglobal']=ut['totalGlobal'](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x8,_0x8895('0xcf'));ami[_0x8895('0x21')](_0x8895('0xd0'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xd1')));rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,'Global');rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xd2'));}else{if(_0x119624[_0x8895('0xd3')]>=_0x113ac4[_0x8895('0xd4')]){rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xd5'));}else{rpcDb[_0x8895('0xa2')](ut['scheduledAt'](_0x119624,_0x8895('0xd3'),_0x113ac4[_0x8895('0xc2')]),_0x119624[_0x8895('0xa4')],_0x119624[_0x8895('0xcc')]);}}break;case _0x8895('0xd6'):_0x113ac4['outboundRejectCallsDay']+=0x1;_0x119624[_0x8895('0xd7')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x14,_0x8895('0xd8'));ami[_0x8895('0x21')](_0x8895('0xd9'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xda')));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xdb'));if(ut['totalGlobal'](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0x14,_0x8895('0xd8'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xdc'));}else{if(_0x119624['countagentrejectretry']>=_0x113ac4[_0x8895('0xdd')]){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xdc'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,_0x8895('0xd7'),_0x113ac4['dialAgentRejectRetryFrequency']),_0x119624['unlockAgent'],_0x119624[_0x8895('0xcc')]);}}break;case'ABANDONED':_0x113ac4['outboundAbandonedCallsDay']+=0x1;_0x119624[_0x8895('0xde')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0xb,_0x8895('0xdf'));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xe0'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,_0x8895('0x9f'));rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xe0'));}else{if(_0x119624[_0x8895('0xe1')]>=_0x113ac4[_0x8895('0xe2')]){rpcDb['createCustomerFinal'](_0x119624,_0x8895('0xe0'));}else{rpcDb[_0x8895('0xa2')](ut[_0x8895('0xa3')](_0x119624,'countabandonedretry',_0x113ac4[_0x8895('0xe3')]),_0x119624[_0x8895('0xa4')],_0x119624[_0x8895('0xcc')]);}}break;case'18':_0x113ac4[_0x8895('0x3b')]+=0x1;_0x119624[_0x8895('0xe4')]+=0x1;_0x119624[_0x8895('0xc4')]=ut[_0x8895('0x99')](_0x119624);ut['logCustomer'](_0x119624,0x12,_0x3ee89e[_0x8895('0xe5')]||_0x3ee89e[_0x8895('0xe6')]);ami[_0x8895('0x21')](_0x8895('0xe7'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xe8')));rpcDb['createCustomerHistory'](_0x119624,_0x8895('0xe9'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4['dialGlobalMaxRetry']){_0x5e7048=ut['cloneAction'](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xe9'));}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;case'19':_0x113ac4[_0x8895('0x3b')]+=0x1;_0x119624['countglobal']=ut[_0x8895('0x99')](_0x119624);ut[_0x8895('0x8d')](_0x119624,0x13,_0x3ee89e[_0x8895('0xe5')]||_0x3ee89e[_0x8895('0xe6')]);ami[_0x8895('0x21')](_0x8895('0xe7'),ut[_0x8895('0xb0')](_0x119624,_0x8895('0xe8')));rpcDb[_0x8895('0x8b')](_0x119624,_0x8895('0xea'));if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut['cloneAction'](_0x119624,0xf,_0x8895('0x9f'));rpcDb[_0x8895('0x8f')](_0x5e7048,_0x8895('0xea'));}else{rpcDb[_0x8895('0x8f')](_0x119624,'[callProgressDetectingCustomer][machine]');}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];break;default:if(_0x119624['dialAnswer']){ut['decrementTalkink'](_0x113ac4,_0x8895('0xeb'));ut['loggerError'](_0x8895('0xec')+_0x113ac4['name'],_0x3ee89e);}_0x113ac4['outboundUnknownCallsDay']+=0x1;_0x119624[_0x8895('0xc4')]=ut['totalGlobal'](_0x119624);ut[_0x8895('0x8d')](_0x119624,0xc,_0x3ee89e['cause-txt']||_0x3ee89e[_0x8895('0xe6')]);rpcDb[_0x8895('0x8b')](_0x119624,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x8895('0x99')](_0x119624)>=_0x113ac4[_0x8895('0xbf')]){_0x5e7048=ut[_0x8895('0x9e')](_0x119624,0xf,'Global');rpcDb['createCustomerFinal'](_0x5e7048,_0x8895('0xed'));}else{rpcDb[_0x8895('0x8f')](_0x119624,_0x8895('0xed'));}delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];}if(!(_0x119624[_0x8895('0x73')]&&_0x6440ea==='16')){ut[_0x8895('0x71')](_0x113ac4,_0x8895('0xee'));logger[_0x8895('0x55')](_0x8895('0xef'),_0x119624[_0x8895('0xa8')],_0x8895('0xa9'),_0x113ac4[_0x8895('0x4d')],_0x8895('0xf0'),_0x113ac4['originated']);}if(_0x6440ea!==_0x8895('0xa6')){delete this[_0x8895('0x69')][_0x3ee89e[_0x8895('0xa5')]];delete this[_0x8895('0x69')][_0x3ee89e['destlinkedid']];}}};Preview[_0x8895('0xb')][_0x8895('0xf1')]=function(_0xf3b3e5,_0x20752d,_0x124e1b){if(_[_0x8895('0xf2')](_0x20752d)&&_0x8895('0xf3')!==typeof _0x20752d){return;}if(_[_0x8895('0xf2')](_0x124e1b)&&_0x8895('0xf3')!==typeof _0x124e1b){return;}switch(_0x124e1b[_0x8895('0xf4')]){case'0':ut[_0x8895('0xf5')](_0xf3b3e5,0x0,_0x8895('0x9a'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xf7'));break;case'3':ut[_0x8895('0xf5')](_0xf3b3e5,0x3,_0x8895('0xc5'));rpcDb['createAgentHistory'](_0xf3b3e5,_0x8895('0xf8'));break;case'5':ut['logAgent'](_0xf3b3e5,0x5,_0x8895('0xbc'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xf9'));break;case'8':ut['logAgent'](_0xf3b3e5,0x8,_0x8895('0xcf'));rpcDb[_0x8895('0xf6')](_0xf3b3e5,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8895('0xf5')](_0xf3b3e5,0x16,'AnswerAGI');rpcDb[_0x8895('0xf6')](_0xf3b3e5,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xf3b3e5,0xc,_0x124e1b[_0x8895('0xf4')]);rpcDb[_0x8895('0xf6')](_0xf3b3e5,_0x8895('0xfa'));}ut[_0x8895('0x71')](_0x20752d,_0x8895('0xfb'));logger['info'](_0x8895('0xfc'),_0xf3b3e5['uniqueid'],'\x20Queue',_0x20752d[_0x8895('0x4d')],_0x8895('0xf0'),_0x20752d['originated']);delete this[_0x8895('0x69')][_0xf3b3e5[_0x8895('0xa8')]];};Preview[_0x8895('0xb')]['checkInBlack']=function(_0x3816b4,_0x431b18,_0x114200,_0x54e1b5,_0x465c2b){var _0x34a3c9=this;return new BPromise(function(_0x87bfe4,_0x3a1882){if(_[_0x8895('0x67')](_0x431b18)||_[_0x8895('0x67')](_0x431b18[_0x8895('0xfd')])||_[_0x8895('0x67')](_0x431b18['Contact']['phone'])||_[_0x8895('0x67')](_0x431b18['VoiceQueueId'])){_0x3a1882(ut[_0x8895('0x5a')](_0x8895('0xfe'),_0x54e1b5,_0x465c2b));return;}var _0x270a6e=uuid['v4']();var _0x21d14b=_0x34a3c9[_0x8895('0xf')][_0x431b18[_0x8895('0xff')][_0x8895('0x4d')]];var _0x44951a=_0x114200?_0x34a3c9[_0x8895('0x12')][_0x114200]['id']:undefined;_0x34a3c9[_0x8895('0x69')][_0x270a6e]=new Action(_0x431b18,_0x21d14b,_0x270a6e,_0x114200,_0x44951a);var _0x119bf3=_0x34a3c9[_0x8895('0x69')][_0x270a6e];_0x119bf3['unlockAgent']=_0x54e1b5;_0x119bf3[_0x8895('0xcc')]=_0x465c2b;_0x119bf3[_0x8895('0x100')]=_0x114200;if(_[_0x8895('0x101')](_0x3816b4)){_0x34a3c9[_0x8895('0x102')](_0x119bf3,_0x21d14b,_0x431b18,_0x114200)[_0x8895('0x7c')](function(_0x3c68a9){logger[_0x8895('0x55')](_0x8895('0x103'),_0x8895('0x104')+_0x119bf3[_0x8895('0x6a')]+_0x8895('0x105')+_0x119bf3[_0x8895('0x106')],JSON[_0x8895('0x50')](_0x3c68a9));ami[_0x8895('0x21')]('custom:agentcalled',ut[_0x8895('0xb0')](_0x119bf3,'called',_0x34a3c9['campaignsPreview'][_0x119bf3['queue']]));_0x87bfe4(ut[_0x8895('0x5a')](_0x8895('0x107')));})[_0x8895('0x6f')](function(_0x560732){ut[_0x8895('0x5c')](_0x8895('0x108'),_0x560732);_0x3a1882(ut[_0x8895('0x5a')]('Call\x20failed',_0x54e1b5,_0x465c2b));});}else{_0x21d14b[_0x8895('0x34')]+=0x1;ut[_0x8895('0x109')](_0x119bf3);rpcDb[_0x8895('0x10a')](_0x119bf3,'[Blacklist][error]');delete _0x34a3c9[_0x8895('0x69')][_0x270a6e];_0x3a1882(ut[_0x8895('0x5a')](_0x8895('0x10b'),_0x54e1b5,_0x465c2b));}});};Preview[_0x8895('0xb')][_0x8895('0x93')]=function(_0x3273c1){return!_['isNil'](_0x3273c1)&&!_[_0x8895('0x67')](_0x3273c1[_0x8895('0x4d')])&&!_['isNil'](_0x3273c1[_0x8895('0x4e')])&&_0x3273c1[_0x8895('0x4e')]&&!_[_0x8895('0x67')](this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1[_0x8895('0x4d')])])&&!_[_0x8895('0x67')](this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1['name'])]['status'])&&(this[_0x8895('0x11')][util[_0x8895('0x52')](_0x8895('0x10c'),_0x3273c1[_0x8895('0x4d')])][_0x8895('0x10d')]===_0x8895('0x10e')||this[_0x8895('0x11')][util['format']('SIP/%s',_0x3273c1[_0x8895('0x4d')])][_0x8895('0x10d')]===_0x8895('0x10f'));};Preview[_0x8895('0xb')][_0x8895('0x82')]=function(_0x3b465c,_0x28aeb9){var _0x2ff7e6=this;return new BPromise(function(_0x1be275,_0x8f1f00){_0x2ff7e6['execRun'](_0x3b465c,_0x28aeb9)[_0x8895('0x7c')](function(_0x5033d6){_0x1be275(_[_0x8895('0x6b')](_0x5033d6,[_0x8895('0x5a')]));})[_0x8895('0x6f')](function(_0x5e109c){if(_0x5e109c['unlock']){rpcDb['unlockContact'](_0x3b465c);}if(_0x5e109c[_0x8895('0x4e')]){rpcDb['disableContact'](_0x3b465c);}_0x8f1f00(_[_0x8895('0x6b')](_0x5e109c,[_0x8895('0x5a')]));});});};Preview[_0x8895('0xb')]['execRun']=function(_0x3ccf2a,_0x3a348d){var _0x50136b=this;return new BPromise(function(_0x2bd804,_0x564234){var _0x9ce4f5,_0xa87a01;rpcDb[_0x8895('0x110')](_0x3ccf2a)[_0x8895('0x7c')](function(_0x1d5fd7){if(!_['isNil'](_0x1d5fd7[0x0])){_0xa87a01=_0x1d5fd7[0x0]['recallme']?![]:!![];_0x9ce4f5=_0x1d5fd7[0x0][_0x8895('0x111')]?!![]:![];_0x9ce4f5=_0x3a348d?!![]:_0x9ce4f5;}var _0x41d7f9=_0x50136b[_0x8895('0x112')](_0x1d5fd7);if(_0x41d7f9[_0x8895('0x113')]){rpcDb[_0x8895('0x114')](_[_0x8895('0x6b')](_0x1d5fd7[0x0],['VoiceQueueId','Contact.phone']))[_0x8895('0x7c')](function(_0x3a6226){_0x50136b[_0x8895('0x115')](_0x3a6226,_0x1d5fd7[0x0],_0x3a348d,_0xa87a01,_0x9ce4f5)[_0x8895('0x7c')](function(_0x448496){_0x2bd804(_0x448496);})['catch'](function(_0x50baed){_0x564234(_0x50baed);});})[_0x8895('0x6f')](function(_0x4f0a55){ut['logger'](_0x8895('0x116'),_0x4f0a55);_0x564234(ut[_0x8895('0x5a')]('Call\x20unsuccessful',_0xa87a01,_0x9ce4f5));});}else{_0x564234(ut[_0x8895('0x5a')](_0x41d7f9['message'],_0xa87a01,_0x9ce4f5));}})[_0x8895('0x6f')](function(_0x242a19){ut[_0x8895('0x5c')](_0x8895('0x117'),_0x242a19);_0x564234(ut[_0x8895('0x5a')](_0x8895('0x118'),![],!![]));});});};Preview['prototype'][_0x8895('0x112')]=function(_0x3ecc83){if(_[_0x8895('0x67')](_0x3ecc83)||_[_0x8895('0x101')](_0x3ecc83)||!_[_0x8895('0x67')](_0x3ecc83[0x0][_0x8895('0x80')])&&_['isNil'](_0x3ecc83[0x0][_0x8895('0x80')][_0x8895('0x4d')])){ut[_0x8895('0x5c')](_0x8895('0x119'),_0x3ecc83);return{'isValid':![],'message':_0x8895('0x11a')};}var _0x57230f=this['campaignsPreview'][_0x3ecc83[0x0]['Queue'][_0x8895('0x4d')]];_0x57230f[_0x8895('0x5a')]=_0x8895('0x96');if(_['isNil'](_0x57230f)){ut['logger'](_0x8895('0x11b'),_0x57230f);return{'isValid':![],'message':_0x8895('0x11c')};}if(!this[_0x8895('0x93')](_0x57230f[_0x8895('0x4c')])){ut[_0x8895('0x5c')](_0x8895('0x11d'),'campaign\x20Name:\x20'+_0x57230f['name']+_0x8895('0x11e'));if(!this[_0x8895('0x93')](_0x57230f['TrunkBackup'])){ut[_0x8895('0x5c')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x57230f['name']+_0x8895('0x11f'));return{'isValid':![],'message':_0x8895('0x120')};}}if(!ut[_0x8895('0x121')](_0x57230f['dialActive'])){ut[_0x8895('0x5c')]('[Preview][validateContact][Campaign\x20Active]',_0x57230f[_0x8895('0x4d')]+_0x8895('0x122'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x57230f[_0x8895('0x4d')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8895('0x123')};};Preview[_0x8895('0xb')][_0x8895('0x102')]=function(_0x20f05c,_0x5eca7f,_0x4036ab,_0x4bf06a){var _0x2f2490=this;return new BPromise(function(_0x28506a,_0x30baea){var _0x2ecc8b=_0x20f05c[_0x8895('0xa8')];var _0x1f5eb7=_0x2f2490[_0x8895('0x93')](_0x5eca7f[_0x8895('0x4c')])?util[_0x8895('0x52')](_0x8895('0x124'),_0x5eca7f[_0x8895('0x4c')]['name'],_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x31')])?'':_0x5eca7f[_0x8895('0x31')]['trim']()||'',_0x5eca7f[_0x8895('0x125')]>0x0?_0x4036ab[_0x8895('0xfd')]['phone'][_0x8895('0x126')](_0x5eca7f[_0x8895('0x125')]):_0x4036ab[_0x8895('0xfd')][_0x8895('0x127')]):util[_0x8895('0x52')](_0x8895('0x124'),_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x94')])?_0x5eca7f[_0x8895('0x4c')]['name']:_0x5eca7f['TrunkBackup'][_0x8895('0x4d')],_['isNil'](_0x5eca7f[_0x8895('0x31')])?'':_0x5eca7f[_0x8895('0x31')][_0x8895('0x128')]()||'',_0x5eca7f['dialCutDigit']>0x0?_0x4036ab[_0x8895('0xfd')]['phone'][_0x8895('0x126')](_0x5eca7f[_0x8895('0x125')]):_0x4036ab['Contact'][_0x8895('0x127')]);var _0x30e5a2=_0x2f2490[_0x8895('0x93')](_0x5eca7f[_0x8895('0x4c')])?ut[_0x8895('0x129')](_0x5eca7f['Trunk'][_0x8895('0x12a')],_0x5eca7f[_0x8895('0x2f')],_0x5eca7f['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x5eca7f[_0x8895('0x12b')],_0x5eca7f['dialRandomLastDigitCallerIdNumber']):_0x5eca7f[_0x8895('0x12b')]):ut[_0x8895('0x129')](_[_0x8895('0x67')](_0x5eca7f[_0x8895('0x94')])?_0x5eca7f[_0x8895('0x4c')][_0x8895('0x12a')]:_0x5eca7f['TrunkBackup'][_0x8895('0x12a')],_0x5eca7f[_0x8895('0x2f')],_0x5eca7f[_0x8895('0x12c')]>0x0?ut[_0x8895('0x12d')](_0x5eca7f[_0x8895('0x12b')],_0x5eca7f[_0x8895('0x12c')]):_0x5eca7f[_0x8895('0x12b')]);if(_0x30e5a2){_0x20f05c['originatecalleridname']=ut['extractCalleridName'](_0x30e5a2);_0x20f05c[_0x8895('0x12e')]=ut[_0x8895('0x12f')](_0x30e5a2);}var _0x43523c=ut[_0x8895('0x130')](_0x5eca7f,_0x4036ab,_0x1f5eb7,_0x30e5a2,_0x2ecc8b,_0x20f05c);_['merge'](_0x20f05c,ut['toLowerVariables'](_0x43523c));_0x20f05c[_0x8895('0x86')]=moment()[_0x8895('0x52')](_0x8895('0x87'));ami[_0x8895('0x6d')](ut[_0x8895('0x131')](_0x20f05c,_0x5eca7f,_0x43523c,_0x20f05c[_0x8895('0xcc')],_0x4bf06a))['then'](function(_0x4c4148){_0x5eca7f[_0x8895('0x46')]+=0x1;logger[_0x8895('0x55')](_0x8895('0x132'),_0x2ecc8b,_0x8895('0xa9'),_0x5eca7f[_0x8895('0x4d')],_0x8895('0xf0'),_0x5eca7f[_0x8895('0x46')]);_0x28506a(_0x4c4148);})[_0x8895('0x6f')](function(_0x18a523){ut['logAgent'](_0x20f05c,0xe,_0x8895('0x133'));rpcDb[_0x8895('0xf6')](_0x20f05c,'[originateFailure][logOriginateFailure]');_0x30baea(_0x18a523);});});};Preview[_0x8895('0xb')][_0x8895('0x1a')]=function(_0x3ff7fa){if(this[_0x8895('0x69')][_0x3ff7fa[_0x8895('0xa5')]]){this[_0x8895('0x69')][_0x3ff7fa[_0x8895('0xa5')]][_0x8895('0x6e')]=_0x3ff7fa['channel'];}};Preview['prototype'][_0x8895('0x134')]=function(_0xc93e09){var _0x398041=this;var _0xc35be9=this[_0x8895('0x69')][_0xc93e09[_0x8895('0x135')]];if(_0xc35be9){if(_0xc35be9['lookAgent']&&this[_0x8895('0x12')][_0xc35be9[_0x8895('0x100')]]){ut[_0x8895('0x136')](_0xc35be9,this['agents'][_0xc35be9[_0x8895('0x100')]][_0x8895('0x4d')],this[_0x8895('0x12')][_0xc35be9['lookAgent']]['id']);}var _0x1a62b4=_['clone'](_0xc35be9);_0x1a62b4[_0x8895('0x137')]=moment()[_0x8895('0x52')](_0x8895('0x87'));var _0x447dc0=_0x398041[_0x8895('0xf')][_0xc35be9['queue']];if(ut['isFailure'](_0xc93e09[_0x8895('0x138')])){if(_0xc35be9['unlockAgent']){rpcDb[_0x8895('0x139')](_0xc35be9[_0x8895('0x106')]);}if(_0xc35be9[_0x8895('0xcc')]){rpcDb[_0x8895('0x85')](_0xc35be9[_0x8895('0x106')]);}ami[_0x8895('0x21')](_0x8895('0x13a'),ut[_0x8895('0xb0')](_0xc35be9,'rejected',this[_0x8895('0xf')][_0xc35be9[_0x8895('0x6a')]]));this[_0x8895('0xf1')](_0x1a62b4,_0x447dc0,_0xc93e09);}else{_0xc35be9['starttime']=moment()[_0x8895('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8895('0xf5')](_0x1a62b4,0x4,_0x8895('0xb2'));rpcDb[_0x8895('0xf6')](_0x1a62b4,_0x8895('0x13b'));}}};Preview[_0x8895('0xb')][_0x8895('0x15')]=function(_0x55d290){var _0x1186fa=this;var _0x466d3a=this[_0x8895('0x69')][_0x55d290['linkedid']];var _0x268d3c;if(_0x466d3a){_0x268d3c=this['campaignsPreview'][_0x466d3a[_0x8895('0x6a')]];logger[_0x8895('0x55')](_0x8895('0x13c'),_0x55d290[_0x8895('0xa5')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],_0x8895('0xaa'),_0x268d3c[_0x8895('0x28')]);}if(this[_0x8895('0x69')][_0x55d290[_0x8895('0xa5')]]&&_0x55d290[_0x8895('0xa5')]!==_0x55d290['uniqueid']){if(_0x55d290['cause']==='16'&&this[_0x8895('0x69')][_0x55d290[_0x8895('0xa5')]][_0x8895('0x73')]){this['callProgressDetectingCustomer'](_0x55d290,_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')]);}else if(this['actions'][_0x55d290[_0x8895('0xa5')]]['dialAnswer']){logger[_0x8895('0x55')](_0x8895('0x13e'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],'pTalking:\x20',_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')]);}}else if(_0x466d3a&&_[_0x8895('0x67')](_0x466d3a[_0x8895('0x13f')])&&_0x268d3c[_0x8895('0x140')]&&_0x55d290[_0x8895('0xa5')]===_0x55d290['uniqueid']&&_[_0x8895('0x67')](_0x55d290[_0x8895('0xf4')])&&_0x55d290[_0x8895('0x13d')]==='16'&&_0x55d290[_0x8895('0x141')]==='6'&&_[_0x8895('0xf2')](_0x466d3a[_0x8895('0x142')])){if(_0x466d3a['unlockAgent']){rpcDb['unlockContact'](_0x466d3a[_0x8895('0x106')]);}if(_0x466d3a[_0x8895('0xcc')]){rpcDb[_0x8895('0x85')](_0x466d3a[_0x8895('0x106')]);}_0x55d290[_0x8895('0xf4')]='22';this[_0x8895('0xf1')](_0x466d3a,_0x268d3c,_0x55d290);}else if(_0x466d3a&&_0x466d3a[_0x8895('0x142')]){if(_0x55d290['cause']==='16'&&this['actions'][_0x55d290[_0x8895('0xa5')]]['dialAnswer']){logger[_0x8895('0x55')](_0x8895('0x143'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],'\x20Queue',_0x268d3c[_0x8895('0x4d')],_0x8895('0xaa'),_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290['linkedid'],_0x55d290[_0x8895('0x13d')]);}else if(this[_0x8895('0x69')][_0x55d290['linkedid']][_0x8895('0x73')]){logger[_0x8895('0x55')](_0x8895('0x13e'),_0x55d290[_0x8895('0xa5')],_0x55d290[_0x8895('0x13d')],_0x8895('0xa9'),_0x268d3c[_0x8895('0x4d')],'pTalking:\x20',_0x268d3c[_0x8895('0x28')]);this[_0x8895('0x97')](_0x55d290,_0x55d290['linkedid'],_0x55d290[_0x8895('0x13d')]);}}};Preview[_0x8895('0xb')]['syncDialEnd']=function(_0x4c4240){if(this[_0x8895('0x69')][_0x4c4240[_0x8895('0x144')]]&&_0x4c4240[_0x8895('0x144')]!==_0x4c4240[_0x8895('0x145')]){this[_0x8895('0x97')](_0x4c4240,_0x4c4240[_0x8895('0x144')],_0x4c4240[_0x8895('0xe6')]);}};Preview[_0x8895('0xb')]['syncHangupRequest']=function(_0x28ec87){if(this['actions'][_0x28ec87[_0x8895('0xa5')]]&&_0x28ec87[_0x8895('0xa5')]!==_0x28ec87[_0x8895('0xa8')]&&!this[_0x8895('0x69')][_0x28ec87[_0x8895('0xa5')]]['dialAnswer']){if(_0x28ec87[_0x8895('0x13d')]==='1'){this[_0x8895('0x97')](_0x28ec87,_0x28ec87[_0x8895('0xa5')],_0x28ec87[_0x8895('0x13d')]);}}};Preview[_0x8895('0xb')]['addVariable']=function(_0x419702,_0x3a7d70,_0x4b937f){if(this['actions'][_0x419702]){if(_[_0x8895('0x67')](this[_0x8895('0x69')][_0x419702][_0x8895('0x146')])){this[_0x8895('0x69')][_0x419702][_0x8895('0x146')]={};}this[_0x8895('0x69')][_0x419702][_0x8895('0x146')][_0x3a7d70]=_0x4b937f;}};Preview['prototype'][_0x8895('0x1c')]=function(_0x49928b){try{if(!_[_0x8895('0x67')](_0x49928b)){if(ut[_0x8895('0x147')](_['keys'](_0x49928b['variable'])[0x0])){this[_0x8895('0x148')](_0x49928b[_0x8895('0xa8')],_[_0x8895('0x149')](_0x49928b['variable'])[0x0],_0x49928b[_0x8895('0x14a')]);}}}catch(_0x47837c){logger['error'](_0x8895('0x14b'),util[_0x8895('0x14c')](_0x47837c,{'showHidden':![],'depth':null}));}};Preview[_0x8895('0xb')][_0x8895('0x1e')]=function(_0x592e3b){if(_0x592e3b){if(this[_0x8895('0x69')][_0x592e3b['transfertargetlinkedid']]){this[_0x8895('0x69')][_0x592e3b['transfertargetlinkedid']][_0x8895('0x142')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0xe5a83a){if(_0xe5a83a){if(this[_0x8895('0x69')][_0xe5a83a[_0x8895('0x14d')]]){this[_0x8895('0x69')][_0xe5a83a[_0x8895('0x14d')]][_0x8895('0x142')]=!![];}}};module[_0x8895('0x14e')]=Preview; \ No newline at end of file +var _0x8d0e=['rescheduleContact','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','logger','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','merge','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','clone','isFailure','unlockContact','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','reason','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','type','outbound','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','syncCampaigns','clockClearZombieChannels','dialMethod','preview','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','scheduledat','Agent','[RecallMe]','logger2','disableContact','starttime','outboundReCallsDay','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry'];(function(_0x2f75f1,_0x269219){var _0x55c84a=function(_0x5c1c11){while(--_0x5c1c11){_0x2f75f1['push'](_0x2f75f1['shift']());}};_0x55c84a(++_0x269219);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2ace0d,_0x502868){_0x2ace0d=_0x2ace0d-0x0;var _0x35d6fa=_0x8d0e[_0x2ace0d];return _0x35d6fa;};'use strict';var util=require(_0xe8d0('0x0'));var _=require(_0xe8d0('0x1'));var BPromise=require(_0xe8d0('0x2'));var uuid=require(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var md5=require(_0xe8d0('0x5'));var Redis=require(_0xe8d0('0x6'));var config=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('preview');var loggerAction=require(_0xe8d0('0x8'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xe8d0('0x9'));var Action=require(_0xe8d0('0xa'));var ut=require(_0xe8d0('0xb'));config[_0xe8d0('0xc')]=_[_0xe8d0('0xd')](config[_0xe8d0('0xc')],{'host':_0xe8d0('0xe'),'port':0x18eb});var io=require(_0xe8d0('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe8d0('0x10')][_0xe8d0('0x11')]=function(_0x463159){this['tail']=this['tail']?this[_0xe8d0('0x12')][_0xe8d0('0x13')](_0x463159):_0x463159();};function Preview(_0x3da047){this[_0xe8d0('0x14')]=new Sequence();this[_0xe8d0('0x15')]=_0x3da047[_0xe8d0('0x16')];this['trunks']=_0x3da047[_0xe8d0('0x17')];this[_0xe8d0('0x18')]={};this['agents']=_0x3da047[_0xe8d0('0x19')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xe8d0('0x1a')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x1c'),this[_0xe8d0('0x1d')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x1e'),this['syncHangupRequest'][_0xe8d0('0x1b')](this));ami['on']('dialend',this[_0xe8d0('0x1f')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x20'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xe8d0('0x21')][_0xe8d0('0x1b')](this));ami['on'](_0xe8d0('0x22'),this[_0xe8d0('0x23')][_0xe8d0('0x1b')](this));ami['on']('blindtransfer',this[_0xe8d0('0x24')][_0xe8d0('0x1b')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x554402,_0x384a60,_0x35d131){io['to'](_0x554402)[_0xe8d0('0x25')](_0x384a60,_0x35d131);}function emitCampaignPreview(_0x1fbfe8){if(_0x1fbfe8[_0xe8d0('0x26')]===_0xe8d0('0x27')){var _0x1bd25c={'id':_0x1fbfe8['id'],'name':_0x1fbfe8[_0xe8d0('0x28')],'strategy':_0x1fbfe8[_0xe8d0('0x29')],'answered':_0x1fbfe8['answered'],'available':_0x1fbfe8[_0xe8d0('0x2a')],'loggedIn':_0x1fbfe8[_0xe8d0('0x2b')],'pTalking':_0x1fbfe8['pTalking'],'sumBillable':_0x1fbfe8[_0xe8d0('0x2c')],'sumDuration':_0x1fbfe8[_0xe8d0('0x2d')],'sumHoldTime':_0x1fbfe8[_0xe8d0('0x2e')]||0x0,'talking':_0x1fbfe8[_0xe8d0('0x2f')],'total':_0x1fbfe8[_0xe8d0('0x30')],'type':_0x1fbfe8[_0xe8d0('0x26')],'unmanaged':_0x1fbfe8[_0xe8d0('0x31')],'abandoned':_0x1fbfe8[_0xe8d0('0x32')],'waiting':_0x1fbfe8[_0xe8d0('0x33')],'loggedInDb':_0x1fbfe8[_0xe8d0('0x34')],'dialActive':_0x1fbfe8[_0xe8d0('0x35')],'dialMethod':_0x1fbfe8['dialMethod'],'dialOriginateCallerIdName':_0x1fbfe8[_0xe8d0('0x36')],'dialOriginateCallerIdNumber':_0x1fbfe8[_0xe8d0('0x37')],'dialOriginateTimeout':_0x1fbfe8[_0xe8d0('0x38')],'dialPrefix':_0x1fbfe8['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1fbfe8[_0xe8d0('0x39')],'outboundAnswerCallsDay':_0x1fbfe8[_0xe8d0('0x3a')],'outboundBlacklistCallsDay':_0x1fbfe8['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1fbfe8[_0xe8d0('0x3b')],'outboundCongestionCallsDay':_0x1fbfe8[_0xe8d0('0x3c')],'outboundDropCallsDayACS':_0x1fbfe8[_0xe8d0('0x3d')],'outboundDropCallsDayCallersExit':_0x1fbfe8[_0xe8d0('0x3e')],'outboundDropCallsDayTimeout':_0x1fbfe8[_0xe8d0('0x3f')],'outboundNoAnswerCallsDay':_0x1fbfe8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1fbfe8[_0xe8d0('0x40')],'outboundOriginateFailureCallsDay':_0x1fbfe8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1fbfe8['outboundReCallsDay'],'outboundRejectCallsDay':_0x1fbfe8['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1fbfe8[_0xe8d0('0x41')],'outboundAbandonedCallsDay':_0x1fbfe8[_0xe8d0('0x42')],'predictiveIntervalAnsweredCalls':_0x1fbfe8[_0xe8d0('0x43')],'predictiveIntervalAvgHoldtime':_0x1fbfe8['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1fbfe8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1fbfe8[_0xe8d0('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x1fbfe8['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1fbfe8[_0xe8d0('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x1fbfe8[_0xe8d0('0x46')],'predictiveIntervalHitRate':_0x1fbfe8[_0xe8d0('0x47')],'predictiveIntervalMultiplicativeFactor':_0x1fbfe8[_0xe8d0('0x48')],'predictiveIntervalPauses':_0x1fbfe8[_0xe8d0('0x49')],'predictiveIntervalAvailable':_0x1fbfe8['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1fbfe8[_0xe8d0('0x4a')],'message':_0x1fbfe8[_0xe8d0('0x4b')],'originated':_0x1fbfe8[_0xe8d0('0x4c')],'erlangCalls':_0x1fbfe8[_0xe8d0('0x4d')],'erlangCallToSecond':_0x1fbfe8['erlangCallToSecond'],'erlangAbandonmentRate':_0x1fbfe8[_0xe8d0('0x4e')],'erlangBusyFactor':_0x1fbfe8[_0xe8d0('0x4f')],'startPredictive':_0x1fbfe8['startPredictive'],'startProgressive':_0x1fbfe8[_0xe8d0('0x50')]};if(_0x1fbfe8['Trunk']){_0x1bd25c[_0xe8d0('0x51')]={'id':_0x1fbfe8['Trunk']['id'],'name':_0x1fbfe8[_0xe8d0('0x51')]['name'],'active':_0x1fbfe8[_0xe8d0('0x51')][_0xe8d0('0x52')],'callerid':_0x1fbfe8[_0xe8d0('0x51')][_0xe8d0('0x53')]};}if(_0x1fbfe8['Interval']){_0x1bd25c[_0xe8d0('0x54')]={'id':_0x1fbfe8[_0xe8d0('0x54')]['id'],'name':_0x1fbfe8[_0xe8d0('0x54')]['name']};}var _0x2a66f8=md5(JSON[_0xe8d0('0x55')](_0x1bd25c));if(_0x1fbfe8[_0xe8d0('0x5')]!==_0x2a66f8){_0x1fbfe8[_0xe8d0('0x5')]=_0x2a66f8;emit(util[_0xe8d0('0x56')]('voice:queue:%s',_0x1bd25c[_0xe8d0('0x28')]),_0xe8d0('0x57'),_0x1bd25c);}}}function emitVoiceQueueChannelRemove(_0x10970d){logger[_0xe8d0('0x58')](_0xe8d0('0x59'),JSON[_0xe8d0('0x55')](_0x10970d));emit(util[_0xe8d0('0x56')](_0xe8d0('0x5a'),_0x10970d['name']),'voice_queue_channel:remove',_0x10970d);io[_0xe8d0('0x25')](_0xe8d0('0x5b'),_0x10970d);}function notSendMessagesQueue(_0x45e2dc){if(_0x45e2dc[_0xe8d0('0x5c')]){if(_0x45e2dc[_0xe8d0('0x4c')]===0x0&&_0x45e2dc['pTalking']===0x0){_0x45e2dc[_0xe8d0('0x5c')]=![];_0x45e2dc['available']=0x0;_0x45e2dc[_0xe8d0('0x5d')]=0x0;_0x45e2dc[_0xe8d0('0x4b')]=_0xe8d0('0x5e');ut['logger'](_0xe8d0('0x5f'),_0x45e2dc[_0xe8d0('0x28')]+_0xe8d0('0x60'));}else{_0x45e2dc[_0xe8d0('0x4b')]=_0xe8d0('0x61');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x45e2dc['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x45e2dc);}}Preview[_0xe8d0('0x10')]['loopCampaigns']=function(){var _0x1e6e8f=this;setInterval(function(){_0x1e6e8f[_0xe8d0('0x62')]();},0x7cf);};Preview[_0xe8d0('0x10')][_0xe8d0('0x62')]=function(){var _0x2fd21e=this[_0xe8d0('0x15')];this[_0xe8d0('0x63')]+=0x1;for(var _0x3cbca5 in _0x2fd21e){if(_0x2fd21e['hasOwnProperty'](_0x3cbca5)&&(_0x2fd21e[_0x3cbca5][_0xe8d0('0x64')]===_0xe8d0('0x65')||_0x2fd21e[_0x3cbca5]['dialMethod']==='booked')&&_0x2fd21e[_0x3cbca5][_0xe8d0('0x26')]===_0xe8d0('0x27')){if(this[_0xe8d0('0x63')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xe8d0('0x66')]();}}if(_0x2fd21e[_0xe8d0('0x67')](_0x3cbca5)&&_0x2fd21e[_0x3cbca5]['dialMethod']===_0xe8d0('0x65')&&_0x2fd21e[_0x3cbca5][_0xe8d0('0x26')]==='outbound'){if(_0x2fd21e[_0x3cbca5][_0xe8d0('0x35')]){this[_0xe8d0('0x68')](_0x2fd21e[_0x3cbca5]);if(_0x2fd21e[_0x3cbca5][_0xe8d0('0x69')])this[_0xe8d0('0x6a')](_0x2fd21e[_0x3cbca5]);}else{notSendMessagesQueue(_0x2fd21e[_0x3cbca5]);}}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x6b')]=function(_0x11339d){var _0x1ce97d=this;this['sequence'][_0xe8d0('0x11')](function(){if(!_[_0xe8d0('0x6c')](_0x1ce97d[_0xe8d0('0x18')][_0x11339d])){loggerAction[_0xe8d0('0x58')](_0xe8d0('0x6d'),_0x11339d,_0xe8d0('0x6e'),_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')],_0xe8d0('0x70'),JSON[_0xe8d0('0x55')](_0x1ce97d[_0xe8d0('0x15')][_0x1ce97d[_0xe8d0('0x18')][_0x11339d]['queue']][_0xe8d0('0x4c')]),_0xe8d0('0x71'),JSON[_0xe8d0('0x55')](_0x1ce97d[_0xe8d0('0x15')][_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')]][_0xe8d0('0x72')]),JSON['stringify'](_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x73')]),JSON[_0xe8d0('0x55')](_[_0xe8d0('0x74')](_0x1ce97d['actions'][_0x11339d],[_0xe8d0('0x75'),'UserId',_0xe8d0('0x76'),_0xe8d0('0x77')])));return ami[_0xe8d0('0x78')]({'action':_0xe8d0('0x79'),'channel':_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x7a')]})[_0xe8d0('0x7b')](function(_0x52b8b2){if(_0x52b8b2[_0xe8d0('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1ce97d['actions'][_0x11339d]){ut[_0xe8d0('0x7c')](_0x1ce97d['campaignsPreview'][_0x1ce97d[_0xe8d0('0x18')][_0x11339d]['queue']],_0xe8d0('0x7d'));if(_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x73')]===!![]){ut[_0xe8d0('0x7e')](_0x1ce97d['campaignsPreview'][_0x1ce97d[_0xe8d0('0x18')][_0x11339d][_0xe8d0('0x6f')]],_0xe8d0('0x7d'));ut[_0xe8d0('0x7f')](_0xe8d0('0x80')+_0x11339d,_0x1ce97d['actions'][_0x11339d][_0xe8d0('0x6f')]);}ut[_0xe8d0('0x7f')](_0xe8d0('0x81')+_0x11339d,_0x1ce97d['actions'][_0x11339d][_0xe8d0('0x6f')]);delete _0x1ce97d['actions'][_0x11339d];}},0x2328);}});}});};Preview['prototype'][_0xe8d0('0x66')]=function(){var _0x37040a=this;loggerAction['info'](_0xe8d0('0x82'),_[_0xe8d0('0x83')](this['actions']));for(var _0x2a54c1 in this[_0xe8d0('0x18')]){if(_0x37040a[_0xe8d0('0x18')][_0xe8d0('0x67')](_0x2a54c1)){_0x37040a['clearZombieChannel'](_0x2a54c1);}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x6a')]=function(_0x25e5ab){var _0x76316a=this;rpcDb['getContactRecallMe'](_0x25e5ab['id'],ut[_0xe8d0('0x84')](this[_0xe8d0('0x19')]))[_0xe8d0('0x85')](function(_0x35e0d5){if(!_[_0xe8d0('0x6c')](_0x35e0d5)){for(var _0x29667c=0x0;_0x29667c<_0x35e0d5['length'];_0x29667c+=0x1){if(ut['getDiff'](_0x35e0d5[_0x29667c][_0xe8d0('0x86')])<_0x25e5ab['dialRecallMeTimeout']*0x3c){if(_0x35e0d5[_0x29667c][_0xe8d0('0x87')]&&!_0x35e0d5[_0x29667c][_0xe8d0('0x87')]['voicePause']){_0x76316a['run'](_0x35e0d5[_0x29667c]['id'])[_0xe8d0('0x85')](ut['logger2'](_0xe8d0('0x88')))['catch'](ut[_0xe8d0('0x89')](_0xe8d0('0x88')));}else{rpcDb[_0xe8d0('0x8a')](_0x35e0d5[_0x29667c]['id']);}}else{var _0x4e2abc=new Action(_0x35e0d5[_0x29667c],_0x25e5ab);_0x4e2abc[_0xe8d0('0x8b')]=moment()[_0xe8d0('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x25e5ab[_0xe8d0('0x8c')]+=0x1;ut['logCustomer'](_0x4e2abc,0x17,_0xe8d0('0x8d'));if(_0x25e5ab['dialRecallInQueue']){rpcDb[_0xe8d0('0x8e')](ut[_0xe8d0('0x8f')](_0x35e0d5[_0x29667c]));rpcDb[_0xe8d0('0x90')](_0x4e2abc,_0xe8d0('0x91'));}else{ut[_0xe8d0('0x92')](_0x4e2abc,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x4e2abc,_0xe8d0('0x93'));rpcDb['createCustomerFinal'](_0x4e2abc,_0xe8d0('0x93'));}}}}})[_0xe8d0('0x7b')](ut[_0xe8d0('0x89')](_0xe8d0('0x94')));};Preview[_0xe8d0('0x10')][_0xe8d0('0x68')]=function(_0x177485){_0x177485[_0xe8d0('0x5c')]=!![];if(ut[_0xe8d0('0x95')](_0x177485[_0xe8d0('0x2b')])){_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x96');}else if(!ut[_0xe8d0('0x97')](_0x177485[_0xe8d0('0x35')])){_0x177485[_0xe8d0('0x4b')]='NOT_ACTIVE';}else if(!this[_0xe8d0('0x98')](_0x177485[_0xe8d0('0x51')])){if(!this[_0xe8d0('0x98')](_0x177485[_0xe8d0('0x99')])){_0x177485[_0xe8d0('0x4b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x9a');}}else{_0x177485[_0xe8d0('0x4b')]=_0xe8d0('0x9a');}emitCampaignPreview(_0x177485);};Preview[_0xe8d0('0x10')][_0xe8d0('0x9b')]=function(_0x51eb0b,_0x13ceb4,_0x40cb5c){var _0x24be86=this;var _0x23955c=this[_0xe8d0('0x18')][_0x13ceb4];var _0x556d7e=this['campaignsPreview'][_0x23955c[_0xe8d0('0x6f')]];var _0x54c04f;if(_0x556d7e){switch(_0x40cb5c){case'1':_0x556d7e[_0xe8d0('0x40')]+=0x1;_0x23955c[_0xe8d0('0x9c')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x0,_0xe8d0('0x9e'));ami[_0xe8d0('0x25')](_0xe8d0('0x9f'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xa1')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xa2'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xa7'));}else{if(_0x23955c[_0xe8d0('0x9c')]>=_0x556d7e[_0xe8d0('0xa8')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0x9c'),_0x556d7e[_0xe8d0('0xaa')]),_0x23955c['unlockAgent'],_0x23955c[_0xe8d0('0xab')]);}}delete this['actions'][_0x51eb0b[_0xe8d0('0xac')]];break;case _0xe8d0('0xad'):var _0x22791b=moment()['format'](_0xe8d0('0xae'));_0x23955c[_0xe8d0('0xaf')]=_0x22791b;_0x23955c[_0xe8d0('0xb0')]=_0x22791b;_0x23955c[_0xe8d0('0x73')]=!![];_0x556d7e[_0xe8d0('0x72')]+=0x1;logger['info'](_0xe8d0('0xb1'),_0x23955c[_0xe8d0('0xb2')],_0xe8d0('0xb3'),_0x556d7e[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x556d7e[_0xe8d0('0x72')]);ami[_0xe8d0('0x25')](_0xe8d0('0xb4'),ut['buildObj'](_0x23955c,_0xe8d0('0xb5'),this[_0xe8d0('0x15')][_0x23955c[_0xe8d0('0x6f')]]));if(_0x556d7e[_0xe8d0('0xb6')]){ami['emit'](_0xe8d0('0xb7'),ut[_0xe8d0('0xb8')](_0x23955c));}break;case'16':ami[_0xe8d0('0x25')]('custom:agentcomplete',ut[_0xe8d0('0xa0')](_0x23955c,'complete',this[_0xe8d0('0x15')][_0x23955c['queue']]));emitVoiceQueueChannelRemove(ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xb9')));_0x556d7e[_0xe8d0('0x3a')]+=0x1;_0x556d7e[_0xe8d0('0x30')]+=0x1;_0x556d7e[_0xe8d0('0xba')]+=0x1;ut[_0xe8d0('0x7e')](_0x556d7e,_0xe8d0('0xbb'));_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x4,_0xe8d0('0xbd'));rpcDb[_0xe8d0('0x90')](_0x23955c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xbe'));rpcDb[_0xe8d0('0xbf')](_0x23955c);_0x556d7e[_0xe8d0('0x2d')]+=_0x23955c[_0xe8d0('0xc0')];_0x556d7e[_0xe8d0('0x2c')]+=_0x23955c[_0xe8d0('0xc0')];logger[_0xe8d0('0x58')](_0xe8d0('0xc1'),_0x23955c[_0xe8d0('0xb2')],'\x20Queue',_0x556d7e[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x556d7e[_0xe8d0('0x72')]);delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];break;case'BUSY':_0x556d7e['outboundBusyCallsDay']+=0x1;_0x23955c[_0xe8d0('0xc2')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x5,_0xe8d0('0xc3'));ami['emit'](_0xe8d0('0xc4'),ut['buildObj'](_0x23955c,_0xe8d0('0xc5')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xc6'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut['cloneAction'](_0x23955c,0xf,'Global');rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xc7'));}else{if(_0x23955c[_0xe8d0('0xc2')]>=_0x556d7e[_0xe8d0('0xc8')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xc6'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xc2'),_0x556d7e['dialBusyRetryFrequency']),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case _0xe8d0('0xcb'):_0x556d7e[_0xe8d0('0xcc')]+=0x1;_0x23955c['countnoanswerretry']+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x3,_0xe8d0('0xcd'));ami[_0xe8d0('0x25')](_0xe8d0('0xce'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xcf')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xd0'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xd1'));}else{if(_0x23955c[_0xe8d0('0xd2')]>=_0x556d7e[_0xe8d0('0xd3')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xd0'));}else{rpcDb[_0xe8d0('0xc9')](ut['scheduledAt'](_0x23955c,'countnoanswerretry',_0x556d7e[_0xe8d0('0xd4')]),_0x23955c[_0xe8d0('0xca')],_0x23955c['activeContact']);}}break;case _0xe8d0('0xd5'):_0x556d7e[_0xe8d0('0x3c')]+=0x1;_0x23955c[_0xe8d0('0xd6')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0x8,_0xe8d0('0xd7'));ami[_0xe8d0('0x25')]('custom:agentcongestion',ut['buildObj'](_0x23955c,_0xe8d0('0xd8')));rpcDb[_0xe8d0('0x90')](_0x23955c,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb['createCustomerFinal'](_0x54c04f,_0xe8d0('0xd9'));}else{if(_0x23955c['countcongestionretry']>=_0x556d7e['dialCongestionMaxRetry']){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xda'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xd6'),_0x556d7e['dialBusyRetryFrequency']),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case'CANCEL':_0x556d7e[_0xe8d0('0xdb')]+=0x1;_0x23955c[_0xe8d0('0xdc')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x14,_0xe8d0('0xdd'));ami[_0xe8d0('0x25')](_0xe8d0('0xde'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xdf')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xe0'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0x14,_0xe8d0('0xdd'));rpcDb['createCustomerFinal'](_0x54c04f,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x23955c['countagentrejectretry']>=_0x556d7e['dialAgentRejectMaxRetry']){rpcDb[_0xe8d0('0xa6')](_0x23955c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xe8d0('0xa9')](_0x23955c,'countagentrejectretry',_0x556d7e[_0xe8d0('0xe1')]),_0x23955c[_0xe8d0('0xca')],_0x23955c[_0xe8d0('0xab')]);}}break;case _0xe8d0('0xe2'):_0x556d7e[_0xe8d0('0x42')]+=0x1;_0x23955c[_0xe8d0('0xe3')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0xb,_0xe8d0('0xe4'));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xe5'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,'Global');rpcDb[_0xe8d0('0xa6')](_0x54c04f,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x23955c[_0xe8d0('0xe6')]>=_0x556d7e[_0xe8d0('0xe7')]){rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xe5'));}else{rpcDb[_0xe8d0('0xc9')](ut[_0xe8d0('0xa9')](_0x23955c,_0xe8d0('0xe3'),_0x556d7e[_0xe8d0('0xe8')]),_0x23955c['unlockAgent'],_0x23955c[_0xe8d0('0xab')]);}}break;case'18':_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c[_0xe8d0('0xe9')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x12,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);ami[_0xe8d0('0x25')](_0xe8d0('0xeb'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xec')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xed'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xed'));}else{rpcDb['createCustomerFinal'](_0x23955c,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];break;case'19':_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c[_0xe8d0('0xbc')]=ut[_0xe8d0('0x9d')](_0x23955c);ut['logCustomer'](_0x23955c,0x13,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);ami['emit'](_0xe8d0('0xeb'),ut[_0xe8d0('0xa0')](_0x23955c,_0xe8d0('0xec')));rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xee'));if(ut[_0xe8d0('0x9d')](_0x23955c)>=_0x556d7e[_0xe8d0('0xa3')]){_0x54c04f=ut['cloneAction'](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,_0xe8d0('0xee'));}else{rpcDb[_0xe8d0('0xa6')](_0x23955c,_0xe8d0('0xee'));}delete this['actions'][_0x51eb0b['linkedid']];break;default:if(_0x23955c[_0xe8d0('0x73')]){ut['decrementTalkink'](_0x556d7e,_0xe8d0('0xef'));ut['loggerError'](_0xe8d0('0xf0')+_0x556d7e[_0xe8d0('0x28')],_0x51eb0b);}_0x556d7e[_0xe8d0('0x41')]+=0x1;_0x23955c['countglobal']=ut[_0xe8d0('0x9d')](_0x23955c);ut[_0xe8d0('0x92')](_0x23955c,0xc,_0x51eb0b['cause-txt']||_0x51eb0b[_0xe8d0('0xea')]);rpcDb[_0xe8d0('0x90')](_0x23955c,_0xe8d0('0xf1'));if(ut['totalGlobal'](_0x23955c)>=_0x556d7e['dialGlobalMaxRetry']){_0x54c04f=ut[_0xe8d0('0xa4')](_0x23955c,0xf,_0xe8d0('0xa5'));rpcDb[_0xe8d0('0xa6')](_0x54c04f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xe8d0('0xa6')](_0x23955c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe8d0('0x18')][_0x51eb0b['linkedid']];}if(!(_0x23955c['dialAnswer']&&_0x40cb5c==='16')){ut['updateOriginated'](_0x556d7e,_0xe8d0('0xf2'));logger['info'](_0xe8d0('0xf3'),_0x23955c['uniqueid'],_0xe8d0('0xb3'),_0x556d7e['name'],'originated:\x20',_0x556d7e[_0xe8d0('0x4c')]);}if(_0x40cb5c!=='ANSWER'){delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xac')]];delete this[_0xe8d0('0x18')][_0x51eb0b[_0xe8d0('0xf4')]];}}};Preview[_0xe8d0('0x10')][_0xe8d0('0xf5')]=function(_0x57c5ae,_0x43062c,_0x5c7a76){if(_[_0xe8d0('0xf6')](_0x43062c)&&_0xe8d0('0xf7')!==typeof _0x43062c){return;}if(_[_0xe8d0('0xf6')](_0x5c7a76)&&_0xe8d0('0xf7')!==typeof _0x5c7a76){return;}switch(_0x5c7a76['reason']){case'0':ut[_0xe8d0('0xf8')](_0x57c5ae,0x0,_0xe8d0('0x9e'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfa'));break;case'3':ut[_0xe8d0('0xf8')](_0x57c5ae,0x3,_0xe8d0('0xcd'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xe8d0('0xf8')](_0x57c5ae,0x5,_0xe8d0('0xc3'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfb'));break;case'8':ut[_0xe8d0('0xf8')](_0x57c5ae,0x8,_0xe8d0('0xd7'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfc'));break;case'22':ut['logAgent'](_0x57c5ae,0x16,_0xe8d0('0xfd'));rpcDb[_0xe8d0('0xf9')](_0x57c5ae,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x57c5ae,0xc,_0x5c7a76['reason']);rpcDb[_0xe8d0('0xf9')](_0x57c5ae,_0xe8d0('0xfc'));}ut[_0xe8d0('0x7c')](_0x43062c,_0xe8d0('0xfe'));logger['info'](_0xe8d0('0xff'),_0x57c5ae['uniqueid'],'\x20Queue',_0x43062c[_0xe8d0('0x28')],'originated:\x20',_0x43062c['originated']);delete this[_0xe8d0('0x18')][_0x57c5ae['uniqueid']];};Preview[_0xe8d0('0x10')][_0xe8d0('0x100')]=function(_0x57d57f,_0xc9a56d,_0xc6fd9a,_0x5dbf91,_0x436574){var _0x729c89=this;return new BPromise(function(_0x33f42e,_0x30fee6){if(_[_0xe8d0('0x6c')](_0xc9a56d)||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x101')])||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x101')][_0xe8d0('0x102')])||_[_0xe8d0('0x6c')](_0xc9a56d[_0xe8d0('0x76')])){_0x30fee6(ut[_0xe8d0('0x4b')]('Contact\x20is\x20undefined',_0x5dbf91,_0x436574));return;}var _0x2dd9b5=uuid['v4']();var _0x3ccf5d=_0x729c89[_0xe8d0('0x15')][_0xc9a56d[_0xe8d0('0x6e')][_0xe8d0('0x28')]];var _0x2f7371=_0xc6fd9a?_0x729c89[_0xe8d0('0x19')][_0xc6fd9a]['id']:undefined;_0x729c89[_0xe8d0('0x18')][_0x2dd9b5]=new Action(_0xc9a56d,_0x3ccf5d,_0x2dd9b5,_0xc6fd9a,_0x2f7371);var _0x4c073=_0x729c89[_0xe8d0('0x18')][_0x2dd9b5];_0x4c073[_0xe8d0('0xca')]=_0x5dbf91;_0x4c073[_0xe8d0('0xab')]=_0x436574;_0x4c073[_0xe8d0('0x103')]=_0xc6fd9a;if(_[_0xe8d0('0x104')](_0x57d57f)){_0x729c89[_0xe8d0('0x105')](_0x4c073,_0x3ccf5d,_0xc9a56d,_0xc6fd9a)[_0xe8d0('0x85')](function(_0x35b681){logger[_0xe8d0('0x58')](_0xe8d0('0x106'),'Queue:\x20'+_0x4c073[_0xe8d0('0x6f')]+_0xe8d0('0x107')+_0x4c073['idContact'],JSON['stringify'](_0x35b681));ami[_0xe8d0('0x25')]('custom:agentcalled',ut['buildObj'](_0x4c073,_0xe8d0('0x108'),_0x729c89[_0xe8d0('0x15')][_0x4c073['queue']]));_0x33f42e(ut['message'](_0xe8d0('0x109')));})[_0xe8d0('0x7b')](function(_0x57db94){ut[_0xe8d0('0x10a')](_0xe8d0('0x10b'),_0x57db94);_0x30fee6(ut['message']('Call\x20failed',_0x5dbf91,_0x436574));});}else{_0x3ccf5d[_0xe8d0('0x10c')]+=0x1;ut[_0xe8d0('0x10d')](_0x4c073);rpcDb[_0xe8d0('0x10e')](_0x4c073,_0xe8d0('0x10f'));delete _0x729c89[_0xe8d0('0x18')][_0x2dd9b5];_0x30fee6(ut['message'](_0xe8d0('0x110'),_0x5dbf91,_0x436574));}});};Preview[_0xe8d0('0x10')]['isTrunkReachable']=function(_0x5a5253){return!_[_0xe8d0('0x6c')](_0x5a5253)&&!_[_0xe8d0('0x6c')](_0x5a5253['name'])&&!_[_0xe8d0('0x6c')](_0x5a5253[_0xe8d0('0x52')])&&_0x5a5253['active']&&!_['isNil'](this[_0xe8d0('0x17')][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])])&&!_[_0xe8d0('0x6c')](this[_0xe8d0('0x17')][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')])&&(this['trunks'][util['format'](_0xe8d0('0x111'),_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')]===_0xe8d0('0x112')||this[_0xe8d0('0x17')][util[_0xe8d0('0x56')]('SIP/%s',_0x5a5253[_0xe8d0('0x28')])][_0xe8d0('0x79')]===_0xe8d0('0x113'));};Preview[_0xe8d0('0x10')]['run']=function(_0x29a256,_0x31d174){var _0x5f0a2f=this;return new BPromise(function(_0x183c1f,_0x4a520d){_0x5f0a2f[_0xe8d0('0x114')](_0x29a256,_0x31d174)[_0xe8d0('0x85')](function(_0x44816a){_0x183c1f(_['pick'](_0x44816a,[_0xe8d0('0x4b')]));})[_0xe8d0('0x7b')](function(_0x24b26f){if(_0x24b26f[_0xe8d0('0x115')]){rpcDb['unlockContact'](_0x29a256);}if(_0x24b26f[_0xe8d0('0x52')]){rpcDb[_0xe8d0('0x8a')](_0x29a256);}_0x4a520d(_[_0xe8d0('0x74')](_0x24b26f,['message']));});});};Preview[_0xe8d0('0x10')]['execRun']=function(_0xa57cb9,_0x48cae3){var _0x1e3993=this;return new BPromise(function(_0x52c05c,_0x4a667f){var _0x596011,_0x3e1c17;rpcDb[_0xe8d0('0x116')](_0xa57cb9)[_0xe8d0('0x85')](function(_0xd82505){if(!_[_0xe8d0('0x6c')](_0xd82505[0x0])){_0x3e1c17=_0xd82505[0x0]['recallme']?![]:!![];_0x596011=_0xd82505[0x0][_0xe8d0('0x117')]?!![]:![];_0x596011=_0x48cae3?!![]:_0x596011;}var _0x1ac76c=_0x1e3993[_0xe8d0('0x118')](_0xd82505);if(_0x1ac76c[_0xe8d0('0x119')]){rpcDb[_0xe8d0('0x11a')](_[_0xe8d0('0x74')](_0xd82505[0x0],[_0xe8d0('0x76'),_0xe8d0('0x11b')]))[_0xe8d0('0x85')](function(_0x598287){_0x1e3993[_0xe8d0('0x100')](_0x598287,_0xd82505[0x0],_0x48cae3,_0x3e1c17,_0x596011)['then'](function(_0xa3b334){_0x52c05c(_0xa3b334);})['catch'](function(_0x36efb3){_0x4a667f(_0x36efb3);});})[_0xe8d0('0x7b')](function(_0xa51da){ut[_0xe8d0('0x10a')](_0xe8d0('0x11c'),_0xa51da);_0x4a667f(ut['message'](_0xe8d0('0x11d'),_0x3e1c17,_0x596011));});}else{_0x4a667f(ut[_0xe8d0('0x4b')](_0x1ac76c[_0xe8d0('0x4b')],_0x3e1c17,_0x596011));}})['catch'](function(_0x21d2f7){ut[_0xe8d0('0x10a')](_0xe8d0('0x11e'),_0x21d2f7);_0x4a667f(ut[_0xe8d0('0x4b')](_0xe8d0('0x11d'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x1b3a0d){if(_['isNil'](_0x1b3a0d)||_[_0xe8d0('0x104')](_0x1b3a0d)||!_[_0xe8d0('0x6c')](_0x1b3a0d[0x0][_0xe8d0('0x87')])&&_[_0xe8d0('0x6c')](_0x1b3a0d[0x0]['Agent'][_0xe8d0('0x28')])){ut[_0xe8d0('0x10a')](_0xe8d0('0x11f'),_0x1b3a0d);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2e35ef=this['campaignsPreview'][_0x1b3a0d[0x0][_0xe8d0('0x6e')][_0xe8d0('0x28')]];_0x2e35ef[_0xe8d0('0x4b')]=_0xe8d0('0x9a');if(_[_0xe8d0('0x6c')](_0x2e35ef)){ut[_0xe8d0('0x10a')](_0xe8d0('0x120'),_0x2e35ef);return{'isValid':![],'message':_0xe8d0('0x121')};}if(!this[_0xe8d0('0x98')](_0x2e35ef[_0xe8d0('0x51')])){ut['logger'](_0xe8d0('0x122'),_0xe8d0('0x123')+_0x2e35ef[_0xe8d0('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x2e35ef[_0xe8d0('0x99')])){ut[_0xe8d0('0x10a')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2e35ef[_0xe8d0('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe8d0('0x124')};}}if(!ut[_0xe8d0('0x97')](_0x2e35ef[_0xe8d0('0x35')])){ut[_0xe8d0('0x10a')](_0xe8d0('0x125'),_0x2e35ef['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xe8d0('0x123')+_0x2e35ef[_0xe8d0('0x28')]+_0xe8d0('0x126')};}return{'isValid':!![],'message':_0xe8d0('0x127')};};Preview[_0xe8d0('0x10')]['execCall']=function(_0x110b6a,_0x951308,_0x235ccf,_0x5bda3a){var _0x31bfe=this;return new BPromise(function(_0x5cc742,_0x3e6b07){var _0x5a40c2=_0x110b6a[_0xe8d0('0xb2')];var _0x48bad4=_0x31bfe[_0xe8d0('0x98')](_0x951308[_0xe8d0('0x51')])?util[_0xe8d0('0x56')]('SIP/%s/%s%s',_0x951308['Trunk'][_0xe8d0('0x28')],_[_0xe8d0('0x6c')](_0x951308[_0xe8d0('0x128')])?'':_0x951308[_0xe8d0('0x128')][_0xe8d0('0x129')]()||'',_0x951308[_0xe8d0('0x12a')]>0x0?_0x235ccf[_0xe8d0('0x101')]['phone']['substring'](_0x951308[_0xe8d0('0x12a')]):_0x235ccf[_0xe8d0('0x101')]['phone']):util[_0xe8d0('0x56')]('SIP/%s/%s%s',_[_0xe8d0('0x6c')](_0x951308['TrunkBackup'])?_0x951308['Trunk'][_0xe8d0('0x28')]:_0x951308[_0xe8d0('0x99')]['name'],_['isNil'](_0x951308[_0xe8d0('0x128')])?'':_0x951308['dialPrefix'][_0xe8d0('0x129')]()||'',_0x951308['dialCutDigit']>0x0?_0x235ccf[_0xe8d0('0x101')][_0xe8d0('0x102')][_0xe8d0('0x12b')](_0x951308['dialCutDigit']):_0x235ccf[_0xe8d0('0x101')][_0xe8d0('0x102')]);var _0x5e7090=_0x31bfe[_0xe8d0('0x98')](_0x951308[_0xe8d0('0x51')])?ut[_0xe8d0('0x12c')](_0x951308[_0xe8d0('0x51')][_0xe8d0('0x53')],_0x951308[_0xe8d0('0x36')],_0x951308[_0xe8d0('0x12d')]>0x0?ut[_0xe8d0('0x12e')](_0x951308[_0xe8d0('0x37')],_0x951308['dialRandomLastDigitCallerIdNumber']):_0x951308[_0xe8d0('0x37')]):ut[_0xe8d0('0x12c')](_[_0xe8d0('0x6c')](_0x951308['TrunkBackup'])?_0x951308[_0xe8d0('0x51')][_0xe8d0('0x53')]:_0x951308['TrunkBackup'][_0xe8d0('0x53')],_0x951308[_0xe8d0('0x36')],_0x951308[_0xe8d0('0x12d')]>0x0?ut['getCallerIdRandom'](_0x951308['dialOriginateCallerIdNumber'],_0x951308['dialRandomLastDigitCallerIdNumber']):_0x951308['dialOriginateCallerIdNumber']);if(_0x5e7090){_0x110b6a[_0xe8d0('0x12f')]=ut['extractCalleridName'](_0x5e7090);_0x110b6a[_0xe8d0('0x130')]=ut['extractCalleridNumber'](_0x5e7090);}var _0x226957=ut['addVariables'](_0x951308,_0x235ccf,_0x48bad4,_0x5e7090,_0x5a40c2,_0x110b6a);_[_0xe8d0('0x131')](_0x110b6a,ut['toLowerVariables'](_0x226957));_0x110b6a[_0xe8d0('0x8b')]=moment()[_0xe8d0('0x56')](_0xe8d0('0xae'));ami[_0xe8d0('0x78')](ut[_0xe8d0('0x132')](_0x110b6a,_0x951308,_0x226957,_0x110b6a['activeContact'],_0x5bda3a))['then'](function(_0x21e895){_0x951308[_0xe8d0('0x4c')]+=0x1;logger['info']('[originated][increment]',_0x5a40c2,'\x20Queue',_0x951308[_0xe8d0('0x28')],_0xe8d0('0x70'),_0x951308['originated']);_0x5cc742(_0x21e895);})[_0xe8d0('0x7b')](function(_0x657240){ut[_0xe8d0('0xf8')](_0x110b6a,0xe,_0xe8d0('0x133'));rpcDb[_0xe8d0('0xf9')](_0x110b6a,_0xe8d0('0x134'));_0x3e6b07(_0x657240);});});};Preview[_0xe8d0('0x10')][_0xe8d0('0x135')]=function(_0x342d25){if(this['actions'][_0x342d25[_0xe8d0('0xac')]]){this['actions'][_0x342d25[_0xe8d0('0xac')]][_0xe8d0('0x7a')]=_0x342d25['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x11533f){var _0x50ff29=this;var _0x2ed64c=this[_0xe8d0('0x18')][_0x11533f['actionid']];if(_0x2ed64c){if(_0x2ed64c['lookAgent']&&this[_0xe8d0('0x19')][_0x2ed64c['lookAgent']]){ut[_0xe8d0('0x136')](_0x2ed64c,this[_0xe8d0('0x19')][_0x2ed64c['lookAgent']][_0xe8d0('0x28')],this['agents'][_0x2ed64c[_0xe8d0('0x103')]]['id']);}var _0x262bdc=_[_0xe8d0('0x137')](_0x2ed64c);_0x262bdc['responsetime']=moment()[_0xe8d0('0x56')](_0xe8d0('0xae'));var _0x1abe4d=_0x50ff29['campaignsPreview'][_0x2ed64c['queue']];if(ut[_0xe8d0('0x138')](_0x11533f['response'])){if(_0x2ed64c[_0xe8d0('0xca')]){rpcDb[_0xe8d0('0x139')](_0x2ed64c[_0xe8d0('0x13a')]);}if(_0x2ed64c[_0xe8d0('0xab')]){rpcDb['disableContact'](_0x2ed64c[_0xe8d0('0x13a')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x2ed64c,_0xe8d0('0x13b'),this[_0xe8d0('0x15')][_0x2ed64c[_0xe8d0('0x6f')]]));this[_0xe8d0('0xf5')](_0x262bdc,_0x1abe4d,_0x11533f);}else{_0x2ed64c[_0xe8d0('0x8b')]=moment()['format'](_0xe8d0('0xae'));ut['logAgent'](_0x262bdc,0x4,'Answer');rpcDb[_0xe8d0('0xf9')](_0x262bdc,_0xe8d0('0x13c'));}}};Preview[_0xe8d0('0x10')]['syncHangup']=function(_0x18d5d8){var _0x2f5242=this;var _0x391eb7=this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]];var _0x527668;if(_0x391eb7){_0x527668=this[_0xe8d0('0x15')][_0x391eb7[_0xe8d0('0x6f')]];logger[_0xe8d0('0x58')](_0xe8d0('0x13d'),_0x18d5d8[_0xe8d0('0xac')],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);}if(this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]]&&_0x18d5d8['linkedid']!==_0x18d5d8[_0xe8d0('0xb2')]){if(_0x18d5d8['cause']==='16'&&this['actions'][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8['linkedid'],_0x18d5d8[_0xe8d0('0x13e')]);}else if(this[_0xe8d0('0x18')][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){logger[_0xe8d0('0x58')](_0xe8d0('0x13f'),_0x18d5d8['linkedid'],_0x18d5d8[_0xe8d0('0x13e')],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8['linkedid'],_0x18d5d8['cause']);}}else if(_0x391eb7&&_[_0xe8d0('0x6c')](_0x391eb7[_0xe8d0('0x140')])&&_0x527668[_0xe8d0('0x141')]&&_0x18d5d8[_0xe8d0('0xac')]===_0x18d5d8[_0xe8d0('0xb2')]&&_[_0xe8d0('0x6c')](_0x18d5d8['reason'])&&_0x18d5d8[_0xe8d0('0x13e')]==='16'&&_0x18d5d8[_0xe8d0('0x142')]==='6'&&_[_0xe8d0('0xf6')](_0x391eb7[_0xe8d0('0x143')])){if(_0x391eb7[_0xe8d0('0xca')]){rpcDb['unlockContact'](_0x391eb7[_0xe8d0('0x13a')]);}if(_0x391eb7[_0xe8d0('0xab')]){rpcDb[_0xe8d0('0x8a')](_0x391eb7['idContact']);}_0x18d5d8[_0xe8d0('0x144')]='22';this[_0xe8d0('0xf5')](_0x391eb7,_0x527668,_0x18d5d8);}else if(_0x391eb7&&_0x391eb7[_0xe8d0('0x143')]){if(_0x18d5d8[_0xe8d0('0x13e')]==='16'&&this['actions'][_0x18d5d8[_0xe8d0('0xac')]][_0xe8d0('0x73')]){logger[_0xe8d0('0x58')](_0xe8d0('0x145'),_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8['cause'],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],_0xe8d0('0x71'),_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8[_0xe8d0('0x13e')]);}else if(this['actions'][_0x18d5d8[_0xe8d0('0xac')]]['dialAnswer']){logger[_0xe8d0('0x58')](_0xe8d0('0x13f'),_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8['cause'],_0xe8d0('0xb3'),_0x527668[_0xe8d0('0x28')],'pTalking:\x20',_0x527668[_0xe8d0('0x72')]);this[_0xe8d0('0x9b')](_0x18d5d8,_0x18d5d8[_0xe8d0('0xac')],_0x18d5d8[_0xe8d0('0x13e')]);}}};Preview[_0xe8d0('0x10')]['syncDialEnd']=function(_0x37ab7c){if(this[_0xe8d0('0x18')][_0x37ab7c['destlinkedid']]&&_0x37ab7c[_0xe8d0('0xf4')]!==_0x37ab7c['destuniqueid']){this['callProgressDetectingCustomer'](_0x37ab7c,_0x37ab7c[_0xe8d0('0xf4')],_0x37ab7c[_0xe8d0('0xea')]);}};Preview[_0xe8d0('0x10')]['syncHangupRequest']=function(_0x3eaa1f){if(this[_0xe8d0('0x18')][_0x3eaa1f['linkedid']]&&_0x3eaa1f[_0xe8d0('0xac')]!==_0x3eaa1f['uniqueid']&&!this[_0xe8d0('0x18')][_0x3eaa1f[_0xe8d0('0xac')]][_0xe8d0('0x73')]){if(_0x3eaa1f['cause']==='1'){this[_0xe8d0('0x9b')](_0x3eaa1f,_0x3eaa1f[_0xe8d0('0xac')],_0x3eaa1f[_0xe8d0('0x13e')]);}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x146')]=function(_0x28d34f,_0xf323b4,_0x783fa){if(this['actions'][_0x28d34f]){if(_[_0xe8d0('0x6c')](this[_0xe8d0('0x18')][_0x28d34f][_0xe8d0('0x147')])){this[_0xe8d0('0x18')][_0x28d34f][_0xe8d0('0x147')]={};}this[_0xe8d0('0x18')][_0x28d34f]['variables'][_0xf323b4]=_0x783fa;}};Preview[_0xe8d0('0x10')][_0xe8d0('0x21')]=function(_0x1fa83e){try{if(!_[_0xe8d0('0x6c')](_0x1fa83e)){if(ut[_0xe8d0('0x148')](_[_0xe8d0('0x149')](_0x1fa83e[_0xe8d0('0x14a')])[0x0])){this[_0xe8d0('0x146')](_0x1fa83e[_0xe8d0('0xb2')],_[_0xe8d0('0x149')](_0x1fa83e[_0xe8d0('0x14a')])[0x0],_0x1fa83e['value']);}}}catch(_0x475248){logger[_0xe8d0('0x14b')](_0xe8d0('0x14c'),util[_0xe8d0('0x14d')](_0x475248,{'showHidden':![],'depth':null}));}};Preview[_0xe8d0('0x10')]['syncAttendedTransfer']=function(_0x564361){if(_0x564361){if(this[_0xe8d0('0x18')][_0x564361[_0xe8d0('0x14e')]]){this[_0xe8d0('0x18')][_0x564361['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xe8d0('0x10')][_0xe8d0('0x24')]=function(_0xb5f1b3){if(_0xb5f1b3){if(this[_0xe8d0('0x18')][_0xb5f1b3[_0xe8d0('0x14f')]]){this[_0xe8d0('0x18')][_0xb5f1b3['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 6a8f26a..c362139 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 _0xd2a9=['queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xd2a9,0x101));var _0x9d2a=function(_0xc4ae7b,_0xb35a2e){_0xc4ae7b=_0xc4ae7b-0x0;var _0x58077a=_0xd2a9[_0xc4ae7b];return _0x58077a;};'use strict';var util=require(_0x9d2a('0x0'));var BPromise=require(_0x9d2a('0x1'));var logger=require(_0x9d2a('0x2'))(_0x9d2a('0x3'));var _=require('lodash');var cmHopper=require(_0x9d2a('0x4'));var cmHopperFinal=require(_0x9d2a('0x5'));var cmHopperHistory=require(_0x9d2a('0x6'));var cmHopperBlack=require(_0x9d2a('0x7'));var voiceQueueRt=require(_0x9d2a('0x8'));var agentReportPreview=require(_0x9d2a('0x9'));var voiceQueueReport=require(_0x9d2a('0xa'));function loggerCatch(_0x1a8b2d){return function(_0x384006){logger[_0x9d2a('0xb')](_0x1a8b2d,util['inspect'](_0x384006,{'showHidden':![],'depth':null}));};}function create(_0x29fc73){return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](cmHopperHistory[_0x9d2a('0xe')](_0x29fc73))['catch'](loggerCatch(_0x9d2a('0xf')));}function createAgent(_0x13949b){return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](agentReportPreview[_0x9d2a('0xe')](_0x13949b))['catch'](loggerCatch(_0x9d2a('0xf')));}function moveContact(_0x2f9060){return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](cmHopper[_0x9d2a('0x10')](_0x2f9060,!![]))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x12')));}exports['checkIsBlackList']=function(_0x3481ba){return BPromise['resolve']()['then'](cmHopperBlack[_0x9d2a('0x13')](_0x3481ba))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x14')));};exports['getContactPreview']=function(_0x34be65){return BPromise[_0x9d2a('0xc')]()['then'](cmHopper[_0x9d2a('0x15')](_0x34be65))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x16')));};exports[_0x9d2a('0xe')]=function(_0x44c5b4,_0x23756c){create(_0x44c5b4)[_0x9d2a('0x11')](loggerCatch(_0x23756c));moveContact(_0x44c5b4)[_0x9d2a('0x11')](loggerCatch(_0x23756c));};exports[_0x9d2a('0x17')]=function(_0x2c7780,_0x39d17a){createAgent(_0x2c7780)[_0x9d2a('0x11')](loggerCatch(_0x39d17a));};exports[_0x9d2a('0x18')]=function(_0xaa3a4c,_0x34d7ed){create(_0xaa3a4c)['catch'](loggerCatch(_0x34d7ed));};exports['createCustomerFinal']=function(_0x239577,_0x9e94a0){moveContact(_0x239577)[_0x9d2a('0x11')](loggerCatch(_0x9e94a0));};exports['rescheduleContact']=function(_0x5771b5,_0x3ac852,_0x17ae13){if(_0x3ac852){_0x5771b5[_0x9d2a('0x19')]=null;}if(_0x17ae13){_0x5771b5[_0x9d2a('0x1a')]=![];}return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](cmHopper[_0x9d2a('0x1b')](_0x5771b5))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x1c')));};exports[_0x9d2a('0x1d')]=function(_0x13a309){return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](cmHopper['countReScheduled'](_0x13a309))['catch'](loggerCatch(_0x9d2a('0x1e')));};exports[_0x9d2a('0x1f')]=function(_0x1ea733){return BPromise[_0x9d2a('0xc')]()['then'](cmHopper[_0x9d2a('0x1f')]({'UserId':null},_0x1ea733,0x1))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x20')));};exports[_0x9d2a('0x21')]=function(_0x115203){return BPromise['resolve']()[_0x9d2a('0xd')](cmHopper[_0x9d2a('0x1f')]({'active':![]},_0x115203,0x1))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x22')));};exports[_0x9d2a('0x23')]=function(_0x30df0e){var _0x218859={};_0x218859[_0x9d2a('0x24')]=_0x30df0e['type'];_0x218859[_0x9d2a('0x25')]=_0x30df0e['uniqueid'];_0x218859[_0x9d2a('0x26')]=_0x30df0e[_0x9d2a('0x26')];_0x218859[_0x9d2a('0x27')]=_0x30df0e['calleridname'];_0x218859[_0x9d2a('0x28')]=_0x30df0e[_0x9d2a('0x28')];_0x218859[_0x9d2a('0x29')]=_0x30df0e[_0x9d2a('0x2a')];_0x218859[_0x9d2a('0x2b')]=_0x30df0e[_0x9d2a('0x2a')];_0x218859[_0x9d2a('0x2c')]=0x1;_0x218859[_0x9d2a('0x2d')]=_0x30df0e[_0x9d2a('0x2e')];_0x218859[_0x9d2a('0x2f')]=_0x30df0e[_0x9d2a('0x30')];_0x218859[_0x9d2a('0x31')]=_0x9d2a('0x32');_0x218859[_0x9d2a('0x33')]=_0x9d2a('0x34');_0x218859['holdtime']=0x0;_0x218859[_0x9d2a('0x35')]=0x1;_0x218859['lastAssignedTo']=_0x30df0e[_0x9d2a('0x30')];_0x218859['queuecallerexitreason']=_0x9d2a('0x36');return BPromise['resolve']()[_0x9d2a('0xd')](voiceQueueReport[_0x9d2a('0x37')](_0x218859))[_0x9d2a('0x11')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x9d2a('0x38')]=function(_0x1c1753,_0x9dda56){return BPromise[_0x9d2a('0xc')]()[_0x9d2a('0xd')](cmHopper[_0x9d2a('0x38')](_0x1c1753,_0x9dda56))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x39')));};exports[_0x9d2a('0x3a')]=function(_0x5e401d){return BPromise[_0x9d2a('0xc')]()['then'](cmHopper['rescheduleContact'](_0x5e401d,!![],!![]))[_0x9d2a('0x11')](loggerCatch(_0x9d2a('0x3b')));}; \ No newline at end of file +var _0xe57b=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue'];(function(_0x306bfc,_0x56ad21){var _0x37f1d5=function(_0x547724){while(--_0x547724){_0x306bfc['push'](_0x306bfc['shift']());}};_0x37f1d5(++_0x56ad21);}(_0xe57b,0x114));var _0xbe57=function(_0x4fcbe4,_0x3d32ab){_0x4fcbe4=_0x4fcbe4-0x0;var _0x416777=_0xe57b[_0x4fcbe4];return _0x416777;};'use strict';var util=require(_0xbe57('0x0'));var BPromise=require(_0xbe57('0x1'));var logger=require(_0xbe57('0x2'))(_0xbe57('0x3'));var _=require(_0xbe57('0x4'));var cmHopper=require(_0xbe57('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xbe57('0x6'));var cmHopperBlack=require(_0xbe57('0x7'));var voiceQueueRt=require(_0xbe57('0x8'));var agentReportPreview=require(_0xbe57('0x9'));var voiceQueueReport=require(_0xbe57('0xa'));function loggerCatch(_0x5cb9c9){return function(_0x6831c6){logger[_0xbe57('0xb')](_0x5cb9c9,util[_0xbe57('0xc')](_0x6831c6,{'showHidden':![],'depth':null}));};}function create(_0x587d5f){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopperHistory[_0xbe57('0xf')](_0x587d5f))[_0xbe57('0x10')](loggerCatch(_0xbe57('0x11')));}function createAgent(_0x3fd743){return BPromise['resolve']()[_0xbe57('0xe')](agentReportPreview[_0xbe57('0xf')](_0x3fd743))['catch'](loggerCatch(_0xbe57('0x11')));}function moveContact(_0x245c8c){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopper[_0xbe57('0x12')](_0x245c8c,!![]))[_0xbe57('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xbe57('0x13')]=function(_0x5a36fc){return BPromise['resolve']()[_0xbe57('0xe')](cmHopperBlack[_0xbe57('0x13')](_0x5a36fc))[_0xbe57('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xbe57('0x14')]=function(_0xed0563){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopper[_0xbe57('0x14')](_0xed0563))['catch'](loggerCatch(_0xbe57('0x15')));};exports['createHistory']=function(_0x49758f,_0x5263f9){create(_0x49758f)['catch'](loggerCatch(_0x5263f9));moveContact(_0x49758f)[_0xbe57('0x10')](loggerCatch(_0x5263f9));};exports['createAgentHistory']=function(_0x43ad67,_0x13fc4b){createAgent(_0x43ad67)[_0xbe57('0x10')](loggerCatch(_0x13fc4b));};exports['createCustomerHistory']=function(_0x266694,_0x476852){create(_0x266694)['catch'](loggerCatch(_0x476852));};exports['createCustomerFinal']=function(_0x17c679,_0x17b122){moveContact(_0x17c679)[_0xbe57('0x10')](loggerCatch(_0x17b122));};exports[_0xbe57('0x16')]=function(_0x5e00b7,_0x58cc2d,_0x580c57){if(_0x58cc2d){_0x5e00b7[_0xbe57('0x17')]=null;}if(_0x580c57){_0x5e00b7[_0xbe57('0x18')]=![];}return BPromise[_0xbe57('0xd')]()['then'](cmHopper[_0xbe57('0x16')](_0x5e00b7))[_0xbe57('0x10')](loggerCatch(_0xbe57('0x19')));};exports[_0xbe57('0x1a')]=function(_0x5c710d){return BPromise['resolve']()[_0xbe57('0xe')](cmHopper[_0xbe57('0x1a')](_0x5c710d))[_0xbe57('0x10')](loggerCatch(_0xbe57('0x1b')));};exports[_0xbe57('0x1c')]=function(_0x53514e){return BPromise['resolve']()['then'](cmHopper[_0xbe57('0x1c')]({'UserId':null},_0x53514e,0x1))[_0xbe57('0x10')](loggerCatch(_0xbe57('0x1d')));};exports['disableContact']=function(_0x2eca4b){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopper[_0xbe57('0x1c')]({'active':![]},_0x2eca4b,0x1))['catch'](loggerCatch(_0xbe57('0x1e')));};exports[_0xbe57('0x1f')]=function(_0x177b07){var _0x1de49e={};_0x1de49e[_0xbe57('0x20')]=_0x177b07[_0xbe57('0x20')];_0x1de49e['uniqueid']=_0x177b07[_0xbe57('0x21')];_0x1de49e[_0xbe57('0x22')]=_0x177b07[_0xbe57('0x22')];_0x1de49e[_0xbe57('0x23')]=_0x177b07[_0xbe57('0x23')];_0x1de49e['queue']=_0x177b07[_0xbe57('0x24')];_0x1de49e['queuecallerjoinAt']=_0x177b07['answertime'];_0x1de49e[_0xbe57('0x25')]=_0x177b07[_0xbe57('0x26')];_0x1de49e['queuecallercomplete']=0x1;_0x1de49e['queuecallercompleteAt']=_0x177b07[_0xbe57('0x27')];_0x1de49e[_0xbe57('0x28')]=_0x177b07[_0xbe57('0x29')];_0x1de49e[_0xbe57('0x2a')]='from-sip';_0x1de49e[_0xbe57('0x2b')]=_0xbe57('0x2c');_0x1de49e[_0xbe57('0x2d')]=0x0;_0x1de49e[_0xbe57('0x2e')]=0x1;_0x1de49e[_0xbe57('0x2f')]=_0x177b07['membername'];_0x1de49e[_0xbe57('0x30')]=_0xbe57('0x31');return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](voiceQueueReport[_0xbe57('0x32')](_0x1de49e))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x5be17f,_0x4b415f){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopper[_0xbe57('0x33')](_0x5be17f,_0x4b415f))['catch'](loggerCatch(_0xbe57('0x34')));};exports[_0xbe57('0x35')]=function(_0x470b90){return BPromise[_0xbe57('0xd')]()[_0xbe57('0xe')](cmHopper['rescheduleContact'](_0x470b90,!![],!![]))[_0xbe57('0x10')](loggerCatch(_0xbe57('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 340ccf6..122d9bb 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 _0xc068=['talktime','answertime','isFailure','Failure','calleridname','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','getDiff','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','active','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','name','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','logCustomer','statedesc','starttime'];(function(_0x2b4a95,_0x37ce70){var _0x1a6a18=function(_0x31eb43){while(--_0x31eb43){_0x2b4a95['push'](_0x2b4a95['shift']());}};_0x1a6a18(++_0x37ce70);}(_0xc068,0xd3));var _0x8c06=function(_0x56e35f,_0x31f717){_0x56e35f=_0x56e35f-0x0;var _0x3ad21e=_0xc068[_0x56e35f];return _0x3ad21e;};'use strict';var util=require(_0x8c06('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x8c06('0x1'))(_0x8c06('0x2'));var ipAgi=process[_0x8c06('0x3')][_0x8c06('0x4')]||_0x8c06('0x5');function getSeconds(_0x16c555,_0x4829be){var _0x2cdb0f=moment(_0x16c555)['milliseconds'](0x0);var _0x404a95=moment(_0x4829be)[_0x8c06('0x6')](0x0);return _0x2cdb0f[_0x8c06('0x7')](_0x404a95,_0x8c06('0x8'));}exports[_0x8c06('0x9')]=function(_0x4d9fc2){return function(_0x23530d){logger[_0x8c06('0xa')](_0x4d9fc2,util[_0x8c06('0xb')](_0x23530d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x301f76,_0x2d3c07){logger[_0x8c06('0xc')](_0x301f76,util[_0x8c06('0xb')](_0x2d3c07,{'showHidden':![],'depth':null}));};exports[_0x8c06('0xd')]=function(_0x93e26a,_0x513149){logger[_0x8c06('0xa')](_0x93e26a,util[_0x8c06('0xb')](_0x513149,{'showHidden':![],'depth':null}));};exports[_0x8c06('0xe')]=function(_0x369f1c){return function(_0x11b599){logger[_0x8c06('0xc')](_0x369f1c,util[_0x8c06('0xb')](_0x11b599,{'showHidden':![],'depth':null}));};};exports[_0x8c06('0xf')]=function(_0xa1ba9f,_0x2b7a2e,_0x1d3fb1){return{'message':_0xa1ba9f,'unlock':_0x2b7a2e,'active':_0x1d3fb1};};exports[_0x8c06('0x10')]=function(_0x2005e8,_0x1c8ed3,_0x38be46){if(!_[_0x8c06('0x11')](_0x38be46)&&_0x8c06('0x12')===typeof _0x38be46&&!_[_0x8c06('0x13')](_0x38be46)){if(!_[_0x8c06('0x11')](_0x1c8ed3)&&_0x8c06('0x12')===typeof _0x1c8ed3&&!_[_0x8c06('0x13')](_0x1c8ed3)){return util[_0x8c06('0x14')](_0x8c06('0x15'),_0x1c8ed3,_0x38be46);}return util[_0x8c06('0x14')](_0x8c06('0x15'),_0x38be46,_0x38be46);}if(!_[_0x8c06('0x11')](_0x2005e8)&&_0x8c06('0x12')===typeof _0x2005e8&&!_[_0x8c06('0x13')](_0x2005e8)){return _0x2005e8;}return _0x8c06('0x16');};exports['isActive']=function(_0x20f93c){if(_[_0x8c06('0x17')](_0x20f93c)){return![];}return _0x20f93c;};exports[_0x8c06('0x18')]=function(_0x3b3130,_0x55d867,_0xe2a880,_0x4bf649,_0x2f757b,_0x4ab9d9){var _0x1bb994={'XMD-QUEUE':_0x55d867['Queue']?_0x55d867['Queue'][_0x8c06('0x19')]:'','XMD-CALLERID':_0x4bf649,'XMD-CALLERID-PREVIEW':_0x4ab9d9?util[_0x8c06('0x14')](_0x8c06('0x15'),_0x4ab9d9['calleridname'],_0x4ab9d9[_0x8c06('0x1a')]):_0x4bf649,'XMD-DIALID':_0x2f757b,'XMD-CONTACTID':_0x55d867[_0x8c06('0x1b')],'XMD-CDRTYPE':_0x8c06('0x1c'),'CALLERID(all)':_0x4bf649,'XMD-VOICEQUEUEID':_0x55d867[_0x8c06('0x1d')],'XMD-DIALCHANNEL':_0xe2a880,'XMD-DIALTIMEOUT':_0x3b3130['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x8c06('0x14')](_0x8c06('0x1e'),_0x3b3130[_0x8c06('0x1f')]?'g':'',_[_0x8c06('0x13')](_0x3b3130[_0x8c06('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3b3130[_0x8c06('0x21')]||'','XMD-AGI':_0x3b3130[_0x8c06('0x22')]?util[_0x8c06('0x14')](_0x8c06('0x23'),ipAgi,_0x3b3130[_0x8c06('0x22')]):'NONE','XMD-AGIAFTER':_0x3b3130[_0x8c06('0x1f')]?util[_0x8c06('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3b3130[_0x8c06('0x1f')]):_0x8c06('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x4ab9d9?_0x4ab9d9[_0x8c06('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x4ab9d9?_0x4ab9d9[_0x8c06('0x26')]:'','XMD-DESTINATION':_0x8c06('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x8c06('0x13')](_0x3b3130[_0x8c06('0x20')])){_0x1bb994[util[_0x8c06('0x14')]('%s',_0x8c06('0x28'))]=_0x3b3130[_0x8c06('0x20')];_0x1bb994[util[_0x8c06('0x14')]('%s',_0x8c06('0x29'))]=_0x2f757b;}if(_0x55d867&&_0x55d867['Contact']){for(var _0xaf280e in _0x55d867[_0x8c06('0x2a')]){if(_0x55d867['Contact'][_0x8c06('0x2b')](_0xaf280e)){if(!_['isNil'](_0x55d867['Contact'][_0xaf280e])&&_0xaf280e!=='id'&&_0xaf280e!=='tags'&&_0xaf280e!=='createdAt'&&_0xaf280e!==_0x8c06('0x2c')){_0x1bb994[util[_0x8c06('0x14')](_0x8c06('0x2d'),_0x8c06('0x2e'),_[_0x8c06('0x2f')](_0xaf280e))]=_0x55d867[_0x8c06('0x2a')][_0xaf280e];}}}}return _0x1bb994;};exports[_0x8c06('0x30')]=function(_0x26e562){var _0x4e4c12={};for(var _0x2cafa1 in _0x26e562){if(_0x26e562[_0x8c06('0x2b')](_0x2cafa1)){_0x4e4c12[util[_0x8c06('0x14')]('%s',_[_0x8c06('0x31')](_0x2cafa1))]=_0x26e562[_0x2cafa1];}}return{'variables':_0x4e4c12};};exports['updateOriginated']=function(_0x36eba7,_0x1881ca){if(!_['isNil'](_0x36eba7)){if(_0x36eba7[_0x8c06('0x2b')]('originated')){if(_0x36eba7['originated']>0x0){_0x36eba7[_0x8c06('0x32')]-=0x1;}else{logger['error'](_0x8c06('0x33'),_0x1881ca);}}}else{logger[_0x8c06('0xa')](_0x8c06('0x34'),_0x1881ca);}};exports[_0x8c06('0x35')]=function(_0x470a61){var _0x5382a8=moment()[_0x8c06('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x470a61[_0x8c06('0x36')]=0xd;_0x470a61['statedesc']=_0x8c06('0x37');_0x470a61['starttime']=_0x5382a8;_0x470a61[_0x8c06('0x38')]=_0x5382a8;_0x470a61[_0x8c06('0x39')]=_0x5382a8;};exports[_0x8c06('0x3a')]=function(_0x118021,_0x58bf6b,_0x519ea4){var _0x5d39b3=moment()[_0x8c06('0x14')](_0x8c06('0x3b'));_0x118021['state']=_0x58bf6b;_0x118021['statedesc']=_0x519ea4;_0x118021[_0x8c06('0x38')]=_0x5d39b3;_0x118021[_0x8c06('0x3c')]=getSeconds(_0x118021['responsetime'],_0x118021['starttime']);};exports[_0x8c06('0x3d')]=function(_0x344c87,_0xb65487,_0xbb1e7f){_0x344c87['membername']=_0xb65487;_0x344c87['UserId']=_0xbb1e7f;};exports[_0x8c06('0x3e')]=function(_0x1e74f5,_0x119090,_0x1812c0){var _0x235f66=moment()[_0x8c06('0x14')](_0x8c06('0x3b'));_0x1e74f5['state']=_0x119090;_0x1e74f5[_0x8c06('0x3f')]=_0x1812c0;_0x1e74f5['responsetime']=_0x1e74f5['responsetime']?_0x1e74f5[_0x8c06('0x38')]:_0x235f66;_0x1e74f5['endtime']=_0x1e74f5[_0x8c06('0x39')]?_0x1e74f5[_0x8c06('0x39')]:_0x235f66;_0x1e74f5['ringtime']=getSeconds(_0x1e74f5[_0x8c06('0x38')]||0x0,_0x1e74f5[_0x8c06('0x40')]||0x0);_0x1e74f5[_0x8c06('0x41')]=_0x1e74f5[_0x8c06('0x42')]?getSeconds(_0x1e74f5[_0x8c06('0x39')],_0x1e74f5['answertime']):0x0;};exports[_0x8c06('0x43')]=function(_0x4d0207){return _0x4d0207===_0x8c06('0x44');};exports['variablesAction']=function(_0x49f040,_0x51de9d,_0x59a1de,_0x2ed53b,_0x5b8e3b){var _0x55f7bf=_0x2ed53b?'RECALL':_0x49f040[_0x8c06('0x45')];_0x55f7bf=_0x5b8e3b?'BOOKED':_0x55f7bf;return{'actionid':_0x49f040['uniqueid'],'action':'originate','channel':_0x49f040[_0x8c06('0x46')],'callerid':util[_0x8c06('0x14')](_0x8c06('0x15'),_0x55f7bf,_0x49f040[_0x8c06('0x1a')]),'Exten':_0x8c06('0x27'),'Context':_0x8c06('0x47'),'Priority':'1','variable':_0x59a1de,'timeout':(_0x51de9d[_0x8c06('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x49f040[_0x8c06('0x49')]};};exports[_0x8c06('0x4a')]=function(_0x6871c3){return _0x6871c3[_0x8c06('0x4b')]+_0x6871c3['countcongestionretry']+_0x6871c3[_0x8c06('0x4c')]+_0x6871c3[_0x8c06('0x4d')]+_0x6871c3[_0x8c06('0x4e')];};exports[_0x8c06('0x4f')]=function(_0x2c61f0){var _0x43b387=_[_0x8c06('0x50')](_0x2c61f0);_0x43b387[_0x8c06('0x36')]=0xf;_0x43b387[_0x8c06('0x3f')]=_0x8c06('0x51');return _0x43b387;};exports[_0x8c06('0x52')]=function(_0x39fdce,_0x4b257b,_0x5e1469){var _0x4838f5={};_0x4838f5[_0x4b257b]=_0x39fdce[_0x4b257b];_0x4838f5['active']=![];_0x4838f5['scheduledat']=moment()[_0x8c06('0x53')](_0x5e1469,_0x8c06('0x54'))[_0x8c06('0x14')](_0x8c06('0x3b'));_0x4838f5[_0x8c06('0x1b')]=_0x39fdce[_0x8c06('0x1b')];_0x4838f5[_0x8c06('0x55')]=_0x39fdce['ListId'];_0x4838f5[_0x8c06('0x1d')]=_0x39fdce[_0x8c06('0x1d')]||undefined;return _0x4838f5;};exports[_0x8c06('0x56')]=function(_0x19f1c1,_0x56b6cf){if(!_[_0x8c06('0x17')](_0x19f1c1)){if(_0x19f1c1[_0x8c06('0x57')]>0x0){_0x19f1c1[_0x8c06('0x57')]-=0x1;}else{logger['error'](_0x56b6cf,_0x8c06('0x58'));}}else{logger[_0x8c06('0xa')](_0x56b6cf,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x8c06('0x59')]=function(_0x38ab83){if(_0x38ab83<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3bb68e,_0x5dc3a6,_0x18830d){_0x3bb68e[_0x8c06('0x5a')]=_0x5dc3a6;_0x3bb68e[_0x8c06('0x19')]=_0x3bb68e['queue'];_0x3bb68e[_0x8c06('0x5b')]=_0x3bb68e['channelAgent'];_0x3bb68e[_0x8c06('0x5c')]=_0x8c06('0x5d');if(_0x18830d){_0x3bb68e[_0x8c06('0x5e')]=_0x18830d[_0x8c06('0x5e')];}return _0x3bb68e;};exports[_0x8c06('0x5f')]=function(_0x4ef8ee){var _0x88cb0f={};_0x88cb0f[_0x8c06('0x60')]=_0x4ef8ee['queue'];_0x88cb0f[_0x8c06('0x5b')]=_0x4ef8ee[_0x8c06('0x46')];_0x88cb0f[_0x8c06('0x49')]=_0x4ef8ee[_0x8c06('0x49')];return _0x88cb0f;};exports[_0x8c06('0x61')]=function(_0x48e18a){var _0x41cc5f=[];for(var _0x5243a in _0x48e18a){if(_0x48e18a[_0x8c06('0x2b')](_0x5243a)){if(!_[_0x8c06('0x17')](_0x48e18a[_0x5243a])&&_0x48e18a[_0x5243a][_0x8c06('0x36')]===_0x8c06('0x62')&&_0x48e18a[_0x5243a][_0x8c06('0x63')]===_0x8c06('0x64')){_0x41cc5f['push'](_0x48e18a[_0x5243a]['id']);}}}return _0x41cc5f;};exports[_0x8c06('0x65')]=function(_0x279b7b){var _0x21117b=moment()[_0x8c06('0x6')](0x0);var _0x394c4c=moment(_0x279b7b)[_0x8c06('0x6')](0x0);return _0x21117b[_0x8c06('0x7')](_0x394c4c,_0x8c06('0x8'));};exports['createBody']=function(_0x2d516a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2d516a[_0x8c06('0x1b')],'ListId':_0x2d516a['ListId'],'VoiceQueueId':_0x2d516a['VoiceQueueId']||undefined,'CampaignId':_0x2d516a[_0x8c06('0x66')]||undefined};};exports[_0x8c06('0x67')]=function(_0x473e2f){if(_0x473e2f==='uniqueid'||_0x473e2f===_0x8c06('0x68')||_0x473e2f===_0x8c06('0x60')||_0x473e2f==='type'||_0x473e2f===_0x8c06('0x69')||_0x473e2f===_0x8c06('0x6a')||_0x473e2f===_0x8c06('0x6b')||_0x473e2f===_0x8c06('0x46')||_0x473e2f==='calleridname'||_0x473e2f===_0x8c06('0x6c')||_0x473e2f===_0x8c06('0x1a')||_0x473e2f===_0x8c06('0x6d')||_0x473e2f===_0x8c06('0x4b')||_0x473e2f==='countcongestionretry'||_0x473e2f===_0x8c06('0x4c')||_0x473e2f===_0x8c06('0x6e')||_0x473e2f==='callback'||_0x473e2f===_0x8c06('0x6f')||_0x473e2f===_0x8c06('0x70')||_0x473e2f===_0x8c06('0x71')||_0x473e2f===_0x8c06('0x1b')||_0x473e2f===_0x8c06('0x55')||_0x473e2f==='UserId'||_0x473e2f===_0x8c06('0x1d')||_0x473e2f===_0x8c06('0x72')||_0x473e2f==='xmd-voicequeueid'||_0x473e2f===_0x8c06('0x73')||_0x473e2f===_0x8c06('0x74')||_0x473e2f===_0x8c06('0x75')||_0x473e2f==='xmd-dialurl'||_0x473e2f===_0x8c06('0x76')||_0x473e2f===_0x8c06('0x77')||_0x473e2f===_0x8c06('0x78')||_0x473e2f===_0x8c06('0x79')||_0x473e2f==='xmd-contactid'||_0x473e2f==='xmd-cdrtype'||_0x473e2f==='xmd-callerid'||_0x473e2f==='xmd-agiafter'||_0x473e2f===_0x8c06('0x7a')||_0x473e2f==='rtpaudioqos'||_0x473e2f===_0x8c06('0x7b')||_0x473e2f===_0x8c06('0x7c')||_0x473e2f===_0x8c06('0x7d')||_0x473e2f===_0x8c06('0x7e')||_0x473e2f===_0x8c06('0x7f')||_0x473e2f==='rtpaudioqosrtt'||_0x473e2f===_0x8c06('0x80')||_0x473e2f===_0x8c06('0x81')||_0x473e2f===_0x8c06('0x7b')||_0x473e2f==='rtpaudioqosjitter'||_0x473e2f===_0x8c06('0x7d')||_0x473e2f==='rtpaudioqosloss'||_0x473e2f===_0x8c06('0x7f')||_0x473e2f===_0x8c06('0x82')||_0x473e2f===_0x8c06('0x80')||_0x473e2f===_0x8c06('0x83')||_0x473e2f===_0x8c06('0x84')||_0x473e2f===_0x8c06('0x36')||_0x473e2f===_0x8c06('0x3f')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x414f74,_0x42664f){var _0x5b1484,_0x1d993a,_0x40a00d;if(_0x42664f<=0x0){_0x42664f=0x1;}_0x5b1484=new RegExp(_0x8c06('0x85')+_0x42664f+'}$');_0x1d993a=Math[_0x8c06('0x86')](0xa,_0x42664f-0x1);_0x40a00d=Math[_0x8c06('0x86')](0xa,_0x42664f)-0x1;return util[_0x8c06('0x14')]('%s',_[_0x8c06('0x87')](_0x414f74,_0x5b1484,_['random'](_0x1d993a,_0x40a00d)));};exports[_0x8c06('0x88')]=function(_0x502af1){var _0x4c6b2f=_0x502af1[_0x8c06('0x89')](/"(.*?)"/);return _0x4c6b2f?_0x4c6b2f[0x1]:_0x502af1;};exports['extractCalleridNumber']=function(_0x543e95){var _0x2bbf04=_0x543e95['match'](/<(.*?)>/);return _0x2bbf04?_0x2bbf04[0x1]:_0x543e95;}; \ No newline at end of file +var _0xa199=['preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','calleridnum','dialer','VoiceQueueId','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','state','endtime','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','active','scheduledat','add','ContactId','ListId','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment'];(function(_0x237587,_0x3922b7){var _0x485bd9=function(_0x26d5c3){while(--_0x26d5c3){_0x237587['push'](_0x237587['shift']());}};_0x485bd9(++_0x3922b7);}(_0xa199,0x86));var _0x9a19=function(_0x4c9eb2,_0x2122f7){_0x4c9eb2=_0x4c9eb2-0x0;var _0xc3285a=_0xa199[_0x4c9eb2];return _0xc3285a;};'use strict';var util=require(_0x9a19('0x0'));var _=require('lodash');var moment=require(_0x9a19('0x1'));var logger=require('../../../../config/logger')(_0x9a19('0x2'));var ipAgi=process[_0x9a19('0x3')][_0x9a19('0x4')]||_0x9a19('0x5');function getSeconds(_0x5bdf12,_0x8a50cc){var _0x4fe337=moment(_0x5bdf12)[_0x9a19('0x6')](0x0);var _0x237ea7=moment(_0x8a50cc)[_0x9a19('0x6')](0x0);return _0x4fe337[_0x9a19('0x7')](_0x237ea7,_0x9a19('0x8'));}exports[_0x9a19('0x9')]=function(_0x586242){return function(_0x4c952c){logger[_0x9a19('0xa')](_0x586242,util[_0x9a19('0xb')](_0x4c952c,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x17880e,_0x3c4a5b){logger[_0x9a19('0xc')](_0x17880e,util[_0x9a19('0xb')](_0x3c4a5b,{'showHidden':![],'depth':null}));};exports[_0x9a19('0xd')]=function(_0x3da17b,_0x335ee1){logger['error'](_0x3da17b,util[_0x9a19('0xb')](_0x335ee1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x44103f){return function(_0x43b356){logger['info'](_0x44103f,util[_0x9a19('0xb')](_0x43b356,{'showHidden':![],'depth':null}));};};exports[_0x9a19('0xe')]=function(_0x501cb8,_0x2ae5e6,_0x3f3e32){return{'message':_0x501cb8,'unlock':_0x2ae5e6,'active':_0x3f3e32};};exports[_0x9a19('0xf')]=function(_0x486ce3,_0x312a2a,_0x34a3f9){if(!_['isUndefined'](_0x34a3f9)&&_0x9a19('0x10')===typeof _0x34a3f9&&!_['isEmpty'](_0x34a3f9)){if(!_[_0x9a19('0x11')](_0x312a2a)&&'string'===typeof _0x312a2a&&!_[_0x9a19('0x12')](_0x312a2a)){return util[_0x9a19('0x13')](_0x9a19('0x14'),_0x312a2a,_0x34a3f9);}return util[_0x9a19('0x13')]('\x22%s\x22\x20<%s>',_0x34a3f9,_0x34a3f9);}if(!_[_0x9a19('0x11')](_0x486ce3)&&'string'===typeof _0x486ce3&&!_['isEmpty'](_0x486ce3)){return _0x486ce3;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x236973){if(_[_0x9a19('0x15')](_0x236973)){return![];}return _0x236973;};exports[_0x9a19('0x16')]=function(_0x51497c,_0x469f13,_0x4b60fd,_0x242342,_0x2b0f4e,_0x1b96f4){var _0xd751a3={'XMD-QUEUE':_0x469f13[_0x9a19('0x17')]?_0x469f13[_0x9a19('0x17')]['name']:'','XMD-CALLERID':_0x242342,'XMD-CALLERID-PREVIEW':_0x1b96f4?util[_0x9a19('0x13')]('\x22%s\x22\x20<%s>',_0x1b96f4['calleridname'],_0x1b96f4[_0x9a19('0x18')]):_0x242342,'XMD-DIALID':_0x2b0f4e,'XMD-CONTACTID':_0x469f13['ContactId'],'XMD-CDRTYPE':_0x9a19('0x19'),'CALLERID(all)':_0x242342,'XMD-VOICEQUEUEID':_0x469f13[_0x9a19('0x1a')],'XMD-DIALCHANNEL':_0x4b60fd,'XMD-DIALTIMEOUT':_0x51497c['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x9a19('0x13')]('\x22rtTxX%s%s\x22',_0x51497c['dialQueueProject2']?'g':'',_[_0x9a19('0x12')](_0x51497c[_0x9a19('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x51497c[_0x9a19('0x1c')]||'','XMD-AGI':_0x51497c['dialQueueProject']?util[_0x9a19('0x13')](_0x9a19('0x1d'),ipAgi,_0x51497c[_0x9a19('0x1e')]):_0x9a19('0x1f'),'XMD-AGIAFTER':_0x51497c[_0x9a19('0x20')]?util[_0x9a19('0x13')](_0x9a19('0x1d'),ipAgi,_0x51497c[_0x9a19('0x20')]):_0x9a19('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x1b96f4?_0x1b96f4[_0x9a19('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x1b96f4?_0x1b96f4[_0x9a19('0x22')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x9a19('0x12')](_0x51497c[_0x9a19('0x1b')])){_0xd751a3[util[_0x9a19('0x13')]('%s',_0x9a19('0x23'))]=_0x51497c[_0x9a19('0x1b')];_0xd751a3[util['format']('%s',_0x9a19('0x24'))]=_0x2b0f4e;}if(_0x469f13&&_0x469f13['Contact']){for(var _0x464756 in _0x469f13['Contact']){if(_0x469f13[_0x9a19('0x25')][_0x9a19('0x26')](_0x464756)){if(!_[_0x9a19('0x15')](_0x469f13[_0x9a19('0x25')][_0x464756])&&_0x464756!=='id'&&_0x464756!=='tags'&&_0x464756!==_0x9a19('0x27')&&_0x464756!==_0x9a19('0x28')){_0xd751a3[util[_0x9a19('0x13')](_0x9a19('0x29'),'XMD-',_[_0x9a19('0x2a')](_0x464756))]=_0x469f13['Contact'][_0x464756];}}}}return _0xd751a3;};exports[_0x9a19('0x2b')]=function(_0x3c6c1e){var _0x3c1dba={};for(var _0xeb0d6a in _0x3c6c1e){if(_0x3c6c1e[_0x9a19('0x26')](_0xeb0d6a)){_0x3c1dba[util[_0x9a19('0x13')]('%s',_[_0x9a19('0x2c')](_0xeb0d6a))]=_0x3c6c1e[_0xeb0d6a];}}return{'variables':_0x3c1dba};};exports['updateOriginated']=function(_0x3b9ea0,_0x5679d6){if(!_['isNil'](_0x3b9ea0)){if(_0x3b9ea0[_0x9a19('0x26')]('originated')){if(_0x3b9ea0['originated']>0x0){_0x3b9ea0[_0x9a19('0x2d')]-=0x1;}else{logger['error'](_0x9a19('0x2e'),_0x5679d6);}}}else{logger[_0x9a19('0xa')](_0x9a19('0x2f'),_0x5679d6);}};exports[_0x9a19('0x30')]=function(_0x3beae1){var _0x56acc9=moment()[_0x9a19('0x13')](_0x9a19('0x31'));_0x3beae1['state']=0xd;_0x3beae1[_0x9a19('0x32')]=_0x9a19('0x33');_0x3beae1[_0x9a19('0x34')]=_0x56acc9;_0x3beae1['responsetime']=_0x56acc9;_0x3beae1['endtime']=_0x56acc9;};exports[_0x9a19('0x35')]=function(_0x2af10b,_0x54e5d5,_0x3987ad){var _0x106597=moment()['format'](_0x9a19('0x31'));_0x2af10b['state']=_0x54e5d5;_0x2af10b['statedesc']=_0x3987ad;_0x2af10b[_0x9a19('0x36')]=_0x106597;_0x2af10b[_0x9a19('0x37')]=getSeconds(_0x2af10b['responsetime'],_0x2af10b['starttime']);};exports[_0x9a19('0x38')]=function(_0x2d3872,_0x3fe2fe,_0x17101d){_0x2d3872[_0x9a19('0x39')]=_0x3fe2fe;_0x2d3872[_0x9a19('0x3a')]=_0x17101d;};exports[_0x9a19('0x3b')]=function(_0x3f032b,_0x32683c,_0x39bb19){var _0x59e8c7=moment()[_0x9a19('0x13')](_0x9a19('0x31'));_0x3f032b[_0x9a19('0x3c')]=_0x32683c;_0x3f032b[_0x9a19('0x32')]=_0x39bb19;_0x3f032b[_0x9a19('0x36')]=_0x3f032b[_0x9a19('0x36')]?_0x3f032b[_0x9a19('0x36')]:_0x59e8c7;_0x3f032b[_0x9a19('0x3d')]=_0x3f032b[_0x9a19('0x3d')]?_0x3f032b[_0x9a19('0x3d')]:_0x59e8c7;_0x3f032b[_0x9a19('0x37')]=getSeconds(_0x3f032b[_0x9a19('0x36')]||0x0,_0x3f032b[_0x9a19('0x34')]||0x0);_0x3f032b[_0x9a19('0x3e')]=_0x3f032b[_0x9a19('0x3f')]?getSeconds(_0x3f032b[_0x9a19('0x3d')],_0x3f032b['answertime']):0x0;};exports[_0x9a19('0x40')]=function(_0x9f537e){return _0x9f537e===_0x9a19('0x41');};exports[_0x9a19('0x42')]=function(_0x25e25a,_0x42152b,_0x244c13,_0x20a32e,_0x2c0773){var _0x104021=_0x20a32e?'RECALL':_0x25e25a[_0x9a19('0x43')];_0x104021=_0x2c0773?_0x9a19('0x44'):_0x104021;return{'actionid':_0x25e25a[_0x9a19('0x45')],'action':_0x9a19('0x46'),'channel':_0x25e25a[_0x9a19('0x47')],'callerid':util[_0x9a19('0x13')](_0x9a19('0x14'),_0x104021,_0x25e25a[_0x9a19('0x18')]),'Exten':_0x9a19('0x48'),'Context':_0x9a19('0x49'),'Priority':'1','variable':_0x244c13,'timeout':(_0x42152b['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x25e25a[_0x9a19('0x45')]};};exports['totalGlobal']=function(_0x19e935){return _0x19e935[_0x9a19('0x4a')]+_0x19e935[_0x9a19('0x4b')]+_0x19e935[_0x9a19('0x4c')]+_0x19e935[_0x9a19('0x4d')]+_0x19e935[_0x9a19('0x4e')];};exports[_0x9a19('0x4f')]=function(_0x5b6a82){var _0x460223=_['clone'](_0x5b6a82);_0x460223[_0x9a19('0x3c')]=0xf;_0x460223[_0x9a19('0x32')]='Global';return _0x460223;};exports['scheduledAt']=function(_0x13961a,_0x15d067,_0x697b2c){var _0x139587={};_0x139587[_0x15d067]=_0x13961a[_0x15d067];_0x139587[_0x9a19('0x50')]=![];_0x139587[_0x9a19('0x51')]=moment()[_0x9a19('0x52')](_0x697b2c,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x139587[_0x9a19('0x53')]=_0x13961a[_0x9a19('0x53')];_0x139587[_0x9a19('0x54')]=_0x13961a[_0x9a19('0x54')];_0x139587['VoiceQueueId']=_0x13961a['VoiceQueueId']||undefined;return _0x139587;};exports['decrementTalkink']=function(_0x27fdc6,_0x578267){if(!_[_0x9a19('0x15')](_0x27fdc6)){if(_0x27fdc6['pTalking']>0x0){_0x27fdc6['pTalking']-=0x1;}else{logger['error'](_0x578267,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x9a19('0xa')](_0x578267,_0x9a19('0x55'));}};exports['IsNotLoggedIn']=function(_0x45efef){if(_0x45efef<=0x0){return!![];}return![];};exports[_0x9a19('0x56')]=function(_0x2a2d5d,_0x23850e,_0x15884d){_0x2a2d5d['lastevent']=_0x23850e;_0x2a2d5d[_0x9a19('0x57')]=_0x2a2d5d[_0x9a19('0x58')];_0x2a2d5d[_0x9a19('0x59')]=_0x2a2d5d[_0x9a19('0x47')];_0x2a2d5d[_0x9a19('0x5a')]=_0x9a19('0x5b');if(_0x15884d){_0x2a2d5d[_0x9a19('0x5c')]=_0x15884d[_0x9a19('0x5c')];}return _0x2a2d5d;};exports[_0x9a19('0x5d')]=function(_0x248b77){var _0x57db45={};_0x57db45['queue']=_0x248b77[_0x9a19('0x58')];_0x57db45[_0x9a19('0x59')]=_0x248b77[_0x9a19('0x47')];_0x57db45[_0x9a19('0x45')]=_0x248b77['uniqueid'];return _0x57db45;};exports[_0x9a19('0x5e')]=function(_0x1e2349){var _0x20535e=[];for(var _0x55f32c in _0x1e2349){if(_0x1e2349[_0x9a19('0x26')](_0x55f32c)){if(!_[_0x9a19('0x15')](_0x1e2349[_0x55f32c])&&_0x1e2349[_0x55f32c][_0x9a19('0x3c')]===_0x9a19('0x5f')&&_0x1e2349[_0x55f32c][_0x9a19('0x60')]===_0x9a19('0x61')){_0x20535e[_0x9a19('0x62')](_0x1e2349[_0x55f32c]['id']);}}}return _0x20535e;};exports[_0x9a19('0x63')]=function(_0x2a1353){var _0x1d2537=moment()[_0x9a19('0x6')](0x0);var _0x268651=moment(_0x2a1353)[_0x9a19('0x6')](0x0);return _0x1d2537['diff'](_0x268651,_0x9a19('0x8'));};exports[_0x9a19('0x64')]=function(_0xfdd2eb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xfdd2eb[_0x9a19('0x53')],'ListId':_0xfdd2eb['ListId'],'VoiceQueueId':_0xfdd2eb[_0x9a19('0x1a')]||undefined,'CampaignId':_0xfdd2eb['CampaignId']||undefined};};exports['filterKey']=function(_0x19ae59){if(_0x19ae59==='uniqueid'||_0x19ae59===_0x9a19('0x65')||_0x19ae59==='queue'||_0x19ae59===_0x9a19('0x66')||_0x19ae59===_0x9a19('0x67')||_0x19ae59===_0x9a19('0x68')||_0x19ae59===_0x9a19('0x39')||_0x19ae59===_0x9a19('0x47')||_0x19ae59===_0x9a19('0x43')||_0x19ae59==='active'||_0x19ae59==='calleridnum'||_0x19ae59==='scheduledat'||_0x19ae59===_0x9a19('0x4a')||_0x19ae59===_0x9a19('0x4b')||_0x19ae59===_0x9a19('0x4c')||_0x19ae59===_0x9a19('0x69')||_0x19ae59===_0x9a19('0x6a')||_0x19ae59===_0x9a19('0x6b')||_0x19ae59===_0x9a19('0x6c')||_0x19ae59==='recallme'||_0x19ae59===_0x9a19('0x53')||_0x19ae59===_0x9a19('0x54')||_0x19ae59===_0x9a19('0x3a')||_0x19ae59===_0x9a19('0x1a')||_0x19ae59===_0x9a19('0x6d')||_0x19ae59==='xmd-voicequeueid'||_0x19ae59===_0x9a19('0x6e')||_0x19ae59===_0x9a19('0x6f')||_0x19ae59==='xmd-listid'||_0x19ae59===_0x9a19('0x70')||_0x19ae59==='xmd-dialtimeout'||_0x19ae59===_0x9a19('0x71')||_0x19ae59==='xmd-dialid'||_0x19ae59===_0x9a19('0x72')||_0x19ae59===_0x9a19('0x73')||_0x19ae59===_0x9a19('0x74')||_0x19ae59===_0x9a19('0x75')||_0x19ae59==='xmd-agiafter'||_0x19ae59===_0x9a19('0x76')||_0x19ae59===_0x9a19('0x77')||_0x19ae59===_0x9a19('0x78')||_0x19ae59===_0x9a19('0x79')||_0x19ae59===_0x9a19('0x7a')||_0x19ae59===_0x9a19('0x7b')||_0x19ae59===_0x9a19('0x7c')||_0x19ae59===_0x9a19('0x7d')||_0x19ae59===_0x9a19('0x7e')||_0x19ae59===_0x9a19('0x77')||_0x19ae59===_0x9a19('0x78')||_0x19ae59==='rtpaudioqosjitter'||_0x19ae59===_0x9a19('0x7a')||_0x19ae59===_0x9a19('0x7b')||_0x19ae59===_0x9a19('0x7c')||_0x19ae59==='rtpaudioqosrtt'||_0x19ae59===_0x9a19('0x7e')||_0x19ae59===_0x9a19('0x7f')||_0x19ae59===_0x9a19('0x80')||_0x19ae59===_0x9a19('0x3c')||_0x19ae59===_0x9a19('0x32')){return![];}return!![];};exports[_0x9a19('0x81')]=function(_0x5e2b51,_0x4b282f){var _0x59f3a0,_0x49023b,_0x451ff9;if(_0x4b282f<=0x0){_0x4b282f=0x1;}_0x59f3a0=new RegExp('\x5cw{0,'+_0x4b282f+'}$');_0x49023b=Math[_0x9a19('0x82')](0xa,_0x4b282f-0x1);_0x451ff9=Math[_0x9a19('0x82')](0xa,_0x4b282f)-0x1;return util[_0x9a19('0x13')]('%s',_[_0x9a19('0x83')](_0x5e2b51,_0x59f3a0,_[_0x9a19('0x84')](_0x49023b,_0x451ff9)));};exports[_0x9a19('0x85')]=function(_0x1f6ca0){var _0x240738=_0x1f6ca0[_0x9a19('0x86')](/"(.*?)"/);return _0x240738?_0x240738[0x1]:_0x1f6ca0;};exports[_0x9a19('0x87')]=function(_0x4f1cb4){var _0x5d79f0=_0x4f1cb4['match'](/<(.*?)>/);return _0x5d79f0?_0x5d79f0[0x1]:_0x4f1cb4;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 4d56bb6..2478efe 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 _0xc6ac=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x38ad54,_0x36eb56){var _0x2f1705=function(_0x21b4f1){while(--_0x21b4f1){_0x38ad54['push'](_0x38ad54['shift']());}};_0x2f1705(++_0x36eb56);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3e3550,_0x521063){_0x3e3550=_0x3e3550-0x0;var _0x18d42a=_0xc6ac[_0x3e3550];return _0x18d42a;};'use strict';exports[_0xcc6a('0x0')]={'queue':{'type':_0xcc6a('0x1'),'required':!![]},'interface':{'type':_0xcc6a('0x1'),'required':!![]},'membername':{'type':_0xcc6a('0x1'),'required':!![]},'penalty':{'type':_0xcc6a('0x2'),'required':![]},'paused':{'type':_0xcc6a('0x3'),'required':![]}};exports[_0xcc6a('0x4')]={'queue':{'type':_0xcc6a('0x1'),'required':!![]},'interface':{'type':_0xcc6a('0x1'),'required':!![]}};exports[_0xcc6a('0x5')]={'interface':{'type':_0xcc6a('0x1'),'required':!![]},'paused':{'type':_0xcc6a('0x3')},'reason':{'type':_0xcc6a('0x1'),'required':![]}};exports[_0xcc6a('0x6')]={'module':{'type':'string','required':![]}};exports[_0xcc6a('0x7')]={'uniqueid':{'type':_0xcc6a('0x1'),'required':!![]}};exports[_0xcc6a('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xcc6a('0x1')},'format':{'type':_0xcc6a('0x1')},'mixmonitorid':{'type':_0xcc6a('0x1')}};exports[_0xcc6a('0x9')]={'uniqueid':{'type':_0xcc6a('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xcc6a('0x1'),'required':!![]},'exten':{'type':_0xcc6a('0x1'),'required':!![]},'context':{'type':_0xcc6a('0x1')}}; \ No newline at end of file +var _0x36fa=['voicechannel','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','voicequeuechannel'];(function(_0x6c6d75,_0xef7deb){var _0x48a161=function(_0xf0fba0){while(--_0xf0fba0){_0x6c6d75['push'](_0x6c6d75['shift']());}};_0x48a161(++_0xef7deb);}(_0x36fa,0x158));var _0xa36f=function(_0x4446d4,_0x39572e){_0x4446d4=_0x4446d4-0x0;var _0x287a6e=_0x36fa[_0x4446d4];return _0x287a6e;};'use strict';exports[_0xa36f('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xa36f('0x1'),'required':!![]},'membername':{'type':_0xa36f('0x1'),'required':!![]},'penalty':{'type':_0xa36f('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xa36f('0x3')]={'queue':{'type':_0xa36f('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xa36f('0x4')]={'interface':{'type':_0xa36f('0x1'),'required':!![]},'paused':{'type':_0xa36f('0x5')},'reason':{'type':_0xa36f('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xa36f('0x1'),'required':![]}};exports[_0xa36f('0x6')]={'uniqueid':{'type':_0xa36f('0x1'),'required':!![]}};exports[_0xa36f('0x7')]={'uniqueid':{'type':_0xa36f('0x1'),'required':!![]},'filename':{'type':_0xa36f('0x1')},'format':{'type':_0xa36f('0x1')},'mixmonitorid':{'type':_0xa36f('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xa36f('0x1'),'required':!![]}};exports[_0xa36f('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xa36f('0x1'),'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 b9d916e..9a7e2cc 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 _0x50d3=['lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','mapKeys','hasOwnProperty','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','format','name','isUndefined','mergeFromDatabase','initTelephones','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','diff','initVoiceCallReports','duration','ANSWERED','billableseconds','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird'];(function(_0x1753d0,_0x74a495){var _0x158a6d=function(_0x3d1d31){while(--_0x3d1d31){_0x1753d0['push'](_0x1753d0['shift']());}};_0x158a6d(++_0x74a495);}(_0x50d3,0x6c));var _0x350d=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x50d3[_0x602ca8];return _0x26e8ab;};'use strict';var BPromise=require(_0x350d('0x0'));var util=require('util');var _=require(_0x350d('0x1'));var moment=require(_0x350d('0x2'));var Agent=require(_0x350d('0x3'));var Telephone=require(_0x350d('0x4'));var Trunk=require(_0x350d('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x350d('0x6'));var Campaign=require(_0x350d('0x7'));var VoiceExtension=require(_0x350d('0x8'));var ZendeskAccount=require(_0x350d('0x9'));var SalesforceAccount=require(_0x350d('0xa'));var FreshdeskAccount=require(_0x350d('0xb'));var SugarcrmAccount=require(_0x350d('0xc'));var ZohoAccount=require(_0x350d('0xd'));var DeskAccount=require(_0x350d('0xe'));var VtigerAccount=require(_0x350d('0xf'));var ServicenowAccount=require(_0x350d('0x10'));var Dynamics365Account=require(_0x350d('0x11'));var FreshsalesAccount=require(_0x350d('0x12'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x350d('0x13')]={};this[_0x350d('0x14')]={};this[_0x350d('0x15')]={};this[_0x350d('0x16')]={};this[_0x350d('0x17')]={};this['campaigns']={};this[_0x350d('0x18')]={};this[_0x350d('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x350d('0x1a')]={};this[_0x350d('0x1b')]={};this[_0x350d('0x1c')]={};this[_0x350d('0x1d')]={};this[_0x350d('0x1e')]={};this[_0x350d('0x1f')]={};this[_0x350d('0x20')]={};this[_0x350d('0x21')]={};this[_0x350d('0x22')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x350d('0x23')]={};this[_0x350d('0x24')]={};this[_0x350d('0x25')]={};this['dynamics365Accounts']={};this[_0x350d('0x26')]={};this['faxAccounts']={};};function freeIsNotKey(_0x1e88b3,_0x51f899,_0x37050b){var _0x11c619=_[_0x350d('0x27')](_0x1e88b3,function(_0x3a0517,_0x3cc9b8){return _0x3a0517[_0x37050b];});for(var _0x3aeff3 in _0x51f899){if(_0x51f899['hasOwnProperty'](_0x3aeff3)){if(!_0x11c619[_0x3aeff3]){delete _0x51f899[_0x3aeff3];}}}}function freeIsNotKeySip(_0x509f7f,_0x32ec6b){var _0x26ae62=_[_0x350d('0x27')](_0x509f7f,function(_0x27c8c8,_0x2c8d51){return util['format']('SIP/%s',_0x27c8c8['name']);});for(var _0x2af3ca in _0x32ec6b){if(_0x32ec6b[_0x350d('0x28')](_0x2af3ca)){if(!_0x26ae62[_0x2af3ca]){delete _0x32ec6b[_0x2af3ca];}}}}function freeIsNotKeyAgent(_0xf89c0d,_0x40d0be){var _0x20bc4c=_[_0x350d('0x27')](_0xf89c0d,function(_0x1f0910,_0xabdcb3){var _0x5aa044=_['isNil'](_0x1f0910[_0x350d('0x29')])?util['format'](_0x350d('0x2a'),_0x1f0910['name']):_0x1f0910[_0x350d('0x29')];return _0x5aa044;});for(var _0x4fa070 in _0x40d0be){if(_0x40d0be[_0x350d('0x28')](_0x4fa070)){if(!_0x20bc4c[_0x4fa070]){delete _0x40d0be[_0x4fa070];}}}}function clearVoiceCallReports(_0x2857a1){_0x2857a1[_0x350d('0x2b')]=0x0;_0x2857a1[_0x350d('0x2c')]=0x0;_0x2857a1[_0x350d('0x2d')]=0x0;_0x2857a1[_0x350d('0x2e')]=0x0;_0x2857a1[_0x350d('0x2f')]=0x0;}function clearCampaigns(_0x272f6b){if(!_[_0x350d('0x30')](_0x272f6b)){for(var _0x5404ac in _0x272f6b){if(_0x272f6b[_0x350d('0x28')](_0x5404ac)){_0x272f6b[_0x5404ac][_0x350d('0x31')]=0x0;_0x272f6b[_0x5404ac][_0x350d('0x32')]=0x0;}}}}function clearVoiceQueues(_0x18c2a9){if(!_[_0x350d('0x30')](_0x18c2a9)){for(var _0x392a52 in _0x18c2a9){if(_0x18c2a9[_0x350d('0x28')](_0x392a52)){_0x18c2a9[_0x392a52][_0x350d('0x2b')]=0x0;_0x18c2a9[_0x392a52]['answered']=0x0;_0x18c2a9[_0x392a52][_0x350d('0x33')]=0x0;_0x18c2a9[_0x392a52]['abandoned']=0x0;_0x18c2a9[_0x392a52][_0x350d('0x2d')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x2e')]=0x0;_0x18c2a9[_0x392a52]['sumBillable']=0x0;_0x18c2a9[_0x392a52]['outboundAnswerAgiCallsDay']=0x0;_0x18c2a9[_0x392a52][_0x350d('0x34')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x35')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x36')]=0x0;_0x18c2a9[_0x392a52]['outboundNoSuchCallsDay']=0x0;_0x18c2a9[_0x392a52][_0x350d('0x37')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x38')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x39')]=0x0;_0x18c2a9[_0x392a52]['outboundBlacklistCallsDay']=0x0;_0x18c2a9[_0x392a52]['outboundOriginateFailureCallsDay']=0x0;_0x18c2a9[_0x392a52][_0x350d('0x3a')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x3b')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x3c')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x3d')]=0x0;_0x18c2a9[_0x392a52][_0x350d('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x237e7d,_0x7fc39a){for(var _0x5162b5 in _0x7fc39a){if(_0x237e7d['hasOwnProperty'](_0x5162b5)){_0x237e7d[_0x5162b5]=_0x7fc39a[_0x5162b5];}}};Realtime[_0x350d('0x3f')][_0x350d('0x40')]=function(){var _0x11336a=this;return function(_0xbc3626){if(_0xbc3626){freeIsNotKeyAgent(_0xbc3626,_0x11336a['agents']);for(var _0xa7663c=0x0,_0x391921={},_0x560caa={};_0xa7663c<_0xbc3626[_0x350d('0x41')];_0xa7663c+=0x1){_0x391921=_0xbc3626[_0xa7663c];var _0x5221be=_[_0x350d('0x42')](_0x391921[_0x350d('0x29')])?util[_0x350d('0x43')](_0x350d('0x2a'),_0x391921[_0x350d('0x44')]):_0x391921['interface'];if(_[_0x350d('0x45')](_0x11336a[_0x350d('0x13')][_0x5221be])){_0x11336a[_0x350d('0x13')][_0x5221be]=new Agent(_0x391921);}else{_0x11336a[_0x350d('0x46')](_0x11336a[_0x350d('0x13')][_0x5221be],_0x391921);}}}return _0x11336a[_0x350d('0x13')];};};Realtime[_0x350d('0x3f')][_0x350d('0x47')]=function(){var _0x399c4e=this;return function(_0x259cac){if(_0x259cac){freeIsNotKeySip(_0x259cac,_0x399c4e[_0x350d('0x14')]);for(var _0xe326f4=0x0,_0x18acb2={},_0x3da965={};_0xe326f4<_0x259cac[_0x350d('0x41')];_0xe326f4+=0x1){_0x18acb2=_0x259cac[_0xe326f4];if(_['isUndefined'](_0x399c4e[_0x350d('0x14')][util[_0x350d('0x43')]('SIP/%s',_0x18acb2['name'])])){_0x399c4e[_0x350d('0x14')][util[_0x350d('0x43')](_0x350d('0x2a'),_0x18acb2['name'])]=new Telephone(_0x18acb2);}else{_0x399c4e['mergeFromDatabase'](_0x399c4e[_0x350d('0x14')][util[_0x350d('0x43')](_0x350d('0x2a'),_0x18acb2[_0x350d('0x44')])],_0x18acb2);}}}return _0x399c4e[_0x350d('0x14')];};};Realtime['prototype']['initTrunks']=function(){var _0x5d02ea=this;return function(_0x2e4717){if(_0x2e4717){freeIsNotKeySip(_0x2e4717,_0x5d02ea['trunks']);for(var _0x315629=0x0,_0x15d769={},_0x45dba6={};_0x315629<_0x2e4717[_0x350d('0x41')];_0x315629+=0x1){_0x15d769=_0x2e4717[_0x315629];if(_['isUndefined'](_0x5d02ea[_0x350d('0x15')][util[_0x350d('0x43')](_0x350d('0x2a'),_0x15d769[_0x350d('0x44')])])){_0x5d02ea[_0x350d('0x15')][util['format'](_0x350d('0x2a'),_0x15d769[_0x350d('0x44')])]=new Trunk(_0x15d769);}else{_0x5d02ea['mergeFromDatabase'](_0x5d02ea[_0x350d('0x15')][util[_0x350d('0x43')](_0x350d('0x2a'),_0x15d769['name'])],_0x15d769);}}}return _0x5d02ea[_0x350d('0x15')];};};Realtime[_0x350d('0x3f')][_0x350d('0x48')]=function(){var _0xe540e4=this;return function(_0x501bda){if(_0x501bda){freeIsNotKey(_0x501bda,_0xe540e4['voiceQueues'],_0x350d('0x44'));for(var _0x355625=0x0,_0x33557f={},_0x560b5f={};_0x355625<_0x501bda['length'];_0x355625+=0x1){_0x33557f=_0x501bda[_0x355625];if(_['isUndefined'](_0xe540e4[_0x350d('0x16')][_0x33557f[_0x350d('0x44')]])){_0xe540e4['voiceQueues'][_0x33557f[_0x350d('0x44')]]=new VoiceQueue(_0x33557f);}else{_0xe540e4[_0x350d('0x46')](_0xe540e4[_0x350d('0x16')][_0x33557f[_0x350d('0x44')]],_0x33557f);}}}return _0xe540e4[_0x350d('0x16')];};};Realtime['prototype']['initTriggers']=function(){var _0x497e7b=this;return function(_0x1941e1){if(_0x1941e1){freeIsNotKey(_0x1941e1,_0x497e7b[_0x350d('0x17')],'id');for(var _0x41f570=0x0,_0x345c13={},_0x2653e4={};_0x41f570<_0x1941e1[_0x350d('0x41')];_0x41f570+=0x1){_0x345c13=_0x1941e1[_0x41f570];if(_['isUndefined'](_0x497e7b[_0x350d('0x17')][_0x345c13['id']])){_0x497e7b[_0x350d('0x17')][_0x345c13['id']]=new Trigger(_0x345c13);}else{_0x497e7b[_0x350d('0x46')](_0x497e7b['triggers'][_0x345c13['id']],_0x345c13);}}}return _0x497e7b[_0x350d('0x17')];};};Realtime['prototype'][_0x350d('0x49')]=function(){var _0x183261=this;return function(_0x5603c3){if(_0x5603c3){freeIsNotKey(_0x5603c3,_0x183261[_0x350d('0x18')],'id');for(var _0x3b83e1=0x0,_0x4f9945={},_0x2d5396={};_0x3b83e1<_0x5603c3[_0x350d('0x41')];_0x3b83e1+=0x1){_0x4f9945=_0x5603c3[_0x3b83e1];if(_['isUndefined'](_0x183261['templates'][_0x4f9945['id']])){_0x183261[_0x350d('0x18')][_0x4f9945['id']]=new Template(_0x4f9945);}else{_0x183261[_0x350d('0x46')](_0x183261['templates'][_0x4f9945['id']],_0x4f9945);}}}return _0x183261['templates'];};};Realtime['prototype'][_0x350d('0x4a')]=function(){var _0x42c84e=this;return function(_0x40c5a8){if(_0x40c5a8){freeIsNotKey(_0x40c5a8,_0x42c84e[_0x350d('0x20')],'id');for(var _0x2607d4=0x0,_0x441ed2={},_0x452b43={};_0x2607d4<_0x40c5a8[_0x350d('0x41')];_0x2607d4+=0x1){_0x441ed2=_0x40c5a8[_0x2607d4];if(_[_0x350d('0x45')](_0x42c84e[_0x350d('0x20')][_0x441ed2['id']])){_0x42c84e['zendeskAccounts'][_0x441ed2['id']]=new ZendeskAccount(_0x441ed2);}else{_0x42c84e[_0x350d('0x46')](_0x42c84e['zendeskAccounts'][_0x441ed2['id']],_0x441ed2);}}}return _0x42c84e[_0x350d('0x20')];};};Realtime[_0x350d('0x3f')][_0x350d('0x4b')]=function(){var _0x115d75=this;return function(_0x23afa6){if(_0x23afa6){freeIsNotKey(_0x23afa6,_0x115d75[_0x350d('0x21')],'id');for(var _0x513a63=0x0,_0x91913b={},_0xa79021={};_0x513a63<_0x23afa6[_0x350d('0x41')];_0x513a63+=0x1){_0x91913b=_0x23afa6[_0x513a63];if(_[_0x350d('0x45')](_0x115d75[_0x350d('0x21')][_0x91913b['id']])){_0x115d75['salesforceAccounts'][_0x91913b['id']]=new SalesforceAccount(_0x91913b);}else{_0x115d75['mergeFromDatabase'](_0x115d75[_0x350d('0x21')][_0x91913b['id']],_0x91913b);}}}return _0x115d75[_0x350d('0x21')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x197547=this;return function(_0x5d2dc6){if(_0x5d2dc6){freeIsNotKey(_0x5d2dc6,_0x197547['freshdeskAccounts'],'id');for(var _0x3fdf30=0x0,_0x3fbd38={},_0x219b2b={};_0x3fdf30<_0x5d2dc6[_0x350d('0x41')];_0x3fdf30+=0x1){_0x3fbd38=_0x5d2dc6[_0x3fdf30];if(_[_0x350d('0x45')](_0x197547[_0x350d('0x4c')][_0x3fbd38['id']])){_0x197547['freshdeskAccounts'][_0x3fbd38['id']]=new FreshdeskAccount(_0x3fbd38);}else{_0x197547[_0x350d('0x46')](_0x197547[_0x350d('0x4c')][_0x3fbd38['id']],_0x3fbd38);}}}return _0x197547[_0x350d('0x4c')];};};Realtime[_0x350d('0x3f')][_0x350d('0x4d')]=function(){var _0x198dad=this;return function(_0x509648){if(_0x509648){freeIsNotKey(_0x509648,_0x198dad[_0x350d('0x4e')],'id');for(var _0x4b940b=0x0,_0xc0e2b5={},_0x400336={};_0x4b940b<_0x509648[_0x350d('0x41')];_0x4b940b+=0x1){_0xc0e2b5=_0x509648[_0x4b940b];if(_[_0x350d('0x45')](_0x198dad[_0x350d('0x4e')][_0xc0e2b5['id']])){_0x198dad['zohoAccounts'][_0xc0e2b5['id']]=new ZohoAccount(_0xc0e2b5);}else{_0x198dad[_0x350d('0x46')](_0x198dad[_0x350d('0x4e')][_0xc0e2b5['id']],_0xc0e2b5);}}}return _0x198dad['zohoAccounts'];};};Realtime[_0x350d('0x3f')][_0x350d('0x4f')]=function(){var _0x32e087=this;return function(_0x5b89c0){if(_0x5b89c0){freeIsNotKey(_0x5b89c0,_0x32e087[_0x350d('0x23')],'id');for(var _0x234385=0x0,_0x371532={},_0x4f1289={};_0x234385<_0x5b89c0['length'];_0x234385+=0x1){_0x371532=_0x5b89c0[_0x234385];if(_[_0x350d('0x45')](_0x32e087[_0x350d('0x23')][_0x371532['id']])){_0x32e087[_0x350d('0x23')][_0x371532['id']]=new DeskAccount(_0x371532);}else{_0x32e087[_0x350d('0x46')](_0x32e087[_0x350d('0x23')][_0x371532['id']],_0x371532);}}}return _0x32e087[_0x350d('0x23')];};};Realtime[_0x350d('0x3f')][_0x350d('0x50')]=function(){var _0xfb34f=this;return function(_0x286cd2){if(_0x286cd2){freeIsNotKey(_0x286cd2,_0xfb34f['sugarcrmAccounts'],'id');for(var _0x2a2a78=0x0,_0x1adc27={},_0x5627de={};_0x2a2a78<_0x286cd2['length'];_0x2a2a78+=0x1){_0x1adc27=_0x286cd2[_0x2a2a78];if(_[_0x350d('0x45')](_0xfb34f[_0x350d('0x22')][_0x1adc27['id']])){_0xfb34f[_0x350d('0x22')][_0x1adc27['id']]=new SugarcrmAccount(_0x1adc27);}else{_0xfb34f[_0x350d('0x46')](_0xfb34f[_0x350d('0x22')][_0x1adc27['id']],_0x1adc27);}}}return _0xfb34f[_0x350d('0x22')];};};Realtime[_0x350d('0x3f')][_0x350d('0x51')]=function(){var _0x4754ab=this;return function(_0x4d40f5){if(_0x4d40f5){freeIsNotKey(_0x4d40f5,_0x4754ab[_0x350d('0x24')],'id');for(var _0x2c7f10=0x0,_0x37e131={},_0x58280e={};_0x2c7f10<_0x4d40f5['length'];_0x2c7f10+=0x1){_0x37e131=_0x4d40f5[_0x2c7f10];if(_[_0x350d('0x45')](_0x4754ab[_0x350d('0x24')][_0x37e131['id']])){_0x4754ab['vtigerAccounts'][_0x37e131['id']]=new VtigerAccount(_0x37e131);}else{_0x4754ab[_0x350d('0x46')](_0x4754ab['vtigerAccounts'][_0x37e131['id']],_0x37e131);}}}return _0x4754ab['vtigerAccounts'];};};Realtime[_0x350d('0x3f')][_0x350d('0x52')]=function(){var _0x188587=this;return function(_0x4b627f){if(_0x4b627f){freeIsNotKey(_0x4b627f,_0x188587[_0x350d('0x25')],'id');for(var _0x7fb8d0=0x0,_0x3935e3={},_0x2a33c6={};_0x7fb8d0<_0x4b627f[_0x350d('0x41')];_0x7fb8d0+=0x1){_0x3935e3=_0x4b627f[_0x7fb8d0];if(_['isUndefined'](_0x188587[_0x350d('0x25')][_0x3935e3['id']])){_0x188587[_0x350d('0x25')][_0x3935e3['id']]=new ServicenowAccount(_0x3935e3);}else{_0x188587[_0x350d('0x46')](_0x188587[_0x350d('0x25')][_0x3935e3['id']],_0x3935e3);}}}return _0x188587[_0x350d('0x25')];};};Realtime['prototype'][_0x350d('0x53')]=function(){var _0x170509=this;return function(_0x5e3df7){if(_0x5e3df7){freeIsNotKey(_0x5e3df7,_0x170509[_0x350d('0x54')],'id');for(var _0x5906fc=0x0,_0x59b4bf={},_0x1f0589={};_0x5906fc<_0x5e3df7[_0x350d('0x41')];_0x5906fc+=0x1){_0x59b4bf=_0x5e3df7[_0x5906fc];if(_[_0x350d('0x45')](_0x170509[_0x350d('0x54')][_0x59b4bf['id']])){_0x170509[_0x350d('0x54')][_0x59b4bf['id']]=new Dynamics365Account(_0x59b4bf);}else{_0x170509[_0x350d('0x46')](_0x170509[_0x350d('0x54')][_0x59b4bf['id']],_0x59b4bf);}}}return _0x170509[_0x350d('0x54')];};};Realtime[_0x350d('0x3f')][_0x350d('0x55')]=function(){var _0x4f7f9c=this;return function(_0x4889ce){if(_0x4889ce){freeIsNotKey(_0x4889ce,_0x4f7f9c['freshsalesAccounts'],'id');for(var _0x1aa5b5=0x0,_0x32e9c7={},_0x9c271={};_0x1aa5b5<_0x4889ce[_0x350d('0x41')];_0x1aa5b5+=0x1){_0x32e9c7=_0x4889ce[_0x1aa5b5];if(_['isUndefined'](_0x4f7f9c[_0x350d('0x26')][_0x32e9c7['id']])){_0x4f7f9c['freshsalesAccounts'][_0x32e9c7['id']]=new FreshsalesAccount(_0x32e9c7);}else{_0x4f7f9c[_0x350d('0x46')](_0x4f7f9c[_0x350d('0x26')][_0x32e9c7['id']],_0x32e9c7);}}}return _0x4f7f9c[_0x350d('0x26')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x288a95=this;return function(_0x1c03f6){for(var _0x1d191f=0x0;_0x1d191f<_0x1c03f6[_0x350d('0x41')];_0x1d191f+=0x1){_[_0x350d('0x56')](_0x288a95[_0x350d('0x16')][_0x1c03f6[_0x1d191f][_0x350d('0x44')]],_0x1c03f6[_0x1d191f]);}return _0x288a95[_0x350d('0x16')];};};Realtime[_0x350d('0x3f')][_0x350d('0x57')]=function(){var _0x9fa8ec=this;return function(_0x1f58a4){clearVoiceQueues(_0x9fa8ec[_0x350d('0x16')]);if(_0x1f58a4){_0x1f58a4=_['groupBy'](_0x1f58a4,_0x350d('0x58'));for(var _0x1f0263 in _0x1f58a4){if(_0x1f58a4[_0x350d('0x28')](_0x1f0263)){var _0xca3d62={};for(var _0x22cf30=0x0;_0x22cf30<_0x1f58a4[_0x1f0263]['length'];_0x22cf30+=0x1){var _0x6de8de=_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x59')];if(_0x9fa8ec[_0x350d('0x16')][_0x6de8de]){if(_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x5a')]){_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x33')]+=0x1;}if(_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x5b')]){_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x5c')]+=0x1;}_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x2d')]+=moment(_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x5d')])['diff'](moment(_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x5e')]),_0x350d('0x5f'))||0x0;if(_0x22cf30===_0x1f58a4[_0x1f0263][_0x350d('0x41')]-0x1){_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x2e')]+=moment(_0x1f58a4[_0x1f0263][_0x22cf30]['queuecallercompleteAt']||_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x60')]||_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x61')])['diff'](moment(_0x1f58a4[_0x1f0263][_0x22cf30]['queuecallerjoinAt']),'seconds')||0x0;_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x2b')]+=0x1;if(_0x1f58a4[_0x1f0263][_0x22cf30]['queuecallercomplete']){_0x9fa8ec[_0x350d('0x16')][_0x6de8de][_0x350d('0x2c')]+=0x1;_0x9fa8ec['voiceQueues'][_0x6de8de][_0x350d('0x2f')]+=moment(_0x1f58a4[_0x1f0263][_0x22cf30]['queuecallercompleteAt'])[_0x350d('0x62')](moment(_0x1f58a4[_0x1f0263][_0x22cf30][_0x350d('0x5d')]),_0x350d('0x5f'))||0x0;}}else{_0x9fa8ec[_0x350d('0x16')][_0x6de8de]['sumDuration']+=_0x9fa8ec['voiceQueues'][_0x6de8de][_0x350d('0x2d')]||0x0;}}}}}}return _0x9fa8ec['voiceQueues'];};};Realtime[_0x350d('0x3f')][_0x350d('0x63')]=function(){var _0x244641=this;return function(_0x1adcbc){clearVoiceCallReports(_0x244641[_0x350d('0x19')]);if(_0x1adcbc){for(var _0x426b4e=0x0;_0x426b4e<_0x1adcbc['length'];_0x426b4e+=0x1){_0x244641[_0x350d('0x19')][_0x350d('0x2b')]+=0x1;_0x244641[_0x350d('0x19')][_0x350d('0x2e')]+=_0x1adcbc[_0x426b4e][_0x350d('0x64')];if(_0x1adcbc[_0x426b4e]['disposition']===_0x350d('0x65')){_0x244641[_0x350d('0x19')]['answered']+=0x1;_0x244641[_0x350d('0x19')][_0x350d('0x2d')]+=_0x1adcbc[_0x426b4e]['duration']-_0x1adcbc[_0x426b4e][_0x350d('0x66')]||0x0;_0x244641[_0x350d('0x19')][_0x350d('0x2f')]+=_0x1adcbc[_0x426b4e][_0x350d('0x66')];}}}return _0x244641['outbound'];};};Realtime[_0x350d('0x3f')]['initCampaigns']=function(){var _0x1261bf=this;return function(_0x51a4d7){if(_0x51a4d7){freeIsNotKey(_0x51a4d7,_0x1261bf[_0x350d('0x67')],_0x350d('0x44'));for(var _0x2b8743=0x0,_0xd51eff={};_0x2b8743<_0x51a4d7[_0x350d('0x41')];_0x2b8743+=0x1){_0xd51eff=_0x51a4d7[_0x2b8743];if(_[_0x350d('0x45')](_0x1261bf['campaigns'][_0xd51eff[_0x350d('0x44')]])){_0x1261bf['campaigns'][_0xd51eff[_0x350d('0x44')]]=new Campaign(_0xd51eff);}else{_0x1261bf[_0x350d('0x46')](_0x1261bf[_0x350d('0x67')][_0xd51eff[_0x350d('0x44')]],_0xd51eff);_0x1261bf[_0x350d('0x67')][_0xd51eff[_0x350d('0x44')]]['dialQueueProject']=_0xd51eff[_0x350d('0x68')]?_0xd51eff['SquareProject'][_0x350d('0x44')]:undefined;}}}return _0x1261bf[_0x350d('0x67')];};};Realtime[_0x350d('0x3f')][_0x350d('0x69')]=function(){var _0x2286a9=this;return function(_0x4d4081){if(_0x4d4081){freeIsNotKey(_0x4d4081,_0x2286a9[_0x350d('0x1a')],'id');for(var _0x37275f=0x0,_0x3f3a1e={};_0x37275f<_0x4d4081[_0x350d('0x41')];_0x37275f+=0x1){_0x3f3a1e=_0x4d4081[_0x37275f];if(_[_0x350d('0x45')](_0x2286a9['voiceExtensions'][_0x3f3a1e['id']])){_0x2286a9[_0x350d('0x1a')][_0x3f3a1e['id']]=new VoiceExtension(_0x3f3a1e);}else{_0x2286a9[_0x350d('0x46')](_0x2286a9[_0x350d('0x1a')][_0x3f3a1e['id']],_0x3f3a1e);}}}return _0x2286a9[_0x350d('0x1a')];};};Realtime[_0x350d('0x3f')][_0x350d('0x6a')]=function(){var _0x2d9b2c=this;return function(_0x1a30eb){clearCampaigns(_0x2d9b2c['campaigns']);for(var _0x529882=0x0;_0x529882<_0x1a30eb[_0x350d('0x41')];_0x529882+=0x1){_['merge'](_0x2d9b2c[_0x350d('0x67')][_0x1a30eb[_0x529882][_0x350d('0x44')]],_0x1a30eb[_0x529882]);}return _0x2d9b2c[_0x350d('0x67')];};};Realtime[_0x350d('0x3f')]['initFaxAccounts']=function(){var _0x506de6=this;return function(_0x1514d7){if(_0x1514d7){freeIsNotKey(_0x1514d7,_0x506de6[_0x350d('0x6b')],'id');for(var _0x226140=0x0,_0x5ac5d5={},_0x432549={};_0x226140<_0x1514d7['length'];_0x226140+=0x1){_0x5ac5d5=_0x1514d7[_0x226140];if(_[_0x350d('0x45')](_0x506de6[_0x350d('0x6b')][_0x5ac5d5['id']])){_0x506de6['faxAccounts'][_0x5ac5d5['id']]=new FaxAccount(_0x5ac5d5);}else{_0x506de6[_0x350d('0x46')](_0x506de6[_0x350d('0x6b')][_0x5ac5d5['id']],_0x5ac5d5);}}}return _0x506de6[_0x350d('0x6b')];};};module[_0x350d('0x6c')]=Realtime; \ No newline at end of file +var _0x9bcd=['outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','sumDuration','ivrTotalCallsDays','isEmpty','answered','unmanaged','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','mergeFromDatabase','initTelephones','telephones','isUndefined','initVoiceQueues','initTriggers','zendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9bcd,0x11a));var _0xd9bc=function(_0x783897,_0xd0fcf1){_0x783897=_0x783897-0x0;var _0x55cff4=_0x9bcd[_0x783897];return _0x55cff4;};'use strict';var BPromise=require('bluebird');var util=require(_0xd9bc('0x0'));var _=require('lodash');var moment=require(_0xd9bc('0x1'));var Agent=require(_0xd9bc('0x2'));var Telephone=require(_0xd9bc('0x3'));var Trunk=require(_0xd9bc('0x4'));var VoiceQueue=require(_0xd9bc('0x5'));var Trigger=require(_0xd9bc('0x6'));var Template=require(_0xd9bc('0x7'));var Campaign=require(_0xd9bc('0x8'));var VoiceExtension=require(_0xd9bc('0x9'));var ZendeskAccount=require(_0xd9bc('0xa'));var SalesforceAccount=require(_0xd9bc('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xd9bc('0xc'));var ZohoAccount=require(_0xd9bc('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xd9bc('0xe'));var Dynamics365Account=require(_0xd9bc('0xf'));var FreshsalesAccount=require(_0xd9bc('0x10'));var FaxAccount=require(_0xd9bc('0x11'));var Realtime=function(){this[_0xd9bc('0x12')]={};this['telephones']={};this[_0xd9bc('0x13')]={};this[_0xd9bc('0x14')]={};this[_0xd9bc('0x15')]={};this[_0xd9bc('0x16')]={};this[_0xd9bc('0x17')]={};this[_0xd9bc('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd9bc('0x19')]={};this[_0xd9bc('0x1a')]={};this[_0xd9bc('0x1b')]={};this[_0xd9bc('0x1c')]={};this[_0xd9bc('0x1d')]={};this[_0xd9bc('0x1e')]={};this['zendeskAccounts']={};this[_0xd9bc('0x1f')]={};this[_0xd9bc('0x20')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xd9bc('0x21')]={};this[_0xd9bc('0x22')]={};this[_0xd9bc('0x23')]={};};function freeIsNotKey(_0x818126,_0x3797cd,_0x301d66){var _0x5d320c=_[_0xd9bc('0x24')](_0x818126,function(_0x42963e,_0x4e696b){return _0x42963e[_0x301d66];});for(var _0x466958 in _0x3797cd){if(_0x3797cd[_0xd9bc('0x25')](_0x466958)){if(!_0x5d320c[_0x466958]){delete _0x3797cd[_0x466958];}}}}function freeIsNotKeySip(_0x3f0f31,_0x46f466){var _0x2b072a=_[_0xd9bc('0x24')](_0x3f0f31,function(_0x40e458,_0x222cfc){return util['format'](_0xd9bc('0x26'),_0x40e458[_0xd9bc('0x27')]);});for(var _0x3a39c5 in _0x46f466){if(_0x46f466[_0xd9bc('0x25')](_0x3a39c5)){if(!_0x2b072a[_0x3a39c5]){delete _0x46f466[_0x3a39c5];}}}}function freeIsNotKeyAgent(_0x5366f1,_0x10507a){var _0x4fe2a4=_[_0xd9bc('0x24')](_0x5366f1,function(_0x38a793,_0xddb94b){var _0x8f67e5=_[_0xd9bc('0x28')](_0x38a793[_0xd9bc('0x29')])?util[_0xd9bc('0x2a')]('SIP/%s',_0x38a793[_0xd9bc('0x27')]):_0x38a793['interface'];return _0x8f67e5;});for(var _0x11e771 in _0x10507a){if(_0x10507a[_0xd9bc('0x25')](_0x11e771)){if(!_0x4fe2a4[_0x11e771]){delete _0x10507a[_0x11e771];}}}}function clearVoiceCallReports(_0x38ab0c){_0x38ab0c[_0xd9bc('0x2b')]=0x0;_0x38ab0c['answered']=0x0;_0x38ab0c['sumHoldTime']=0x0;_0x38ab0c[_0xd9bc('0x2c')]=0x0;_0x38ab0c['sumBillable']=0x0;}function clearCampaigns(_0x547f39){if(!_['isEmpty'](_0x547f39)){for(var _0x1badd0 in _0x547f39){if(_0x547f39[_0xd9bc('0x25')](_0x1badd0)){_0x547f39[_0x1badd0][_0xd9bc('0x2d')]=0x0;_0x547f39[_0x1badd0]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x583dea){if(!_[_0xd9bc('0x2e')](_0x583dea)){for(var _0x8dd953 in _0x583dea){if(_0x583dea[_0xd9bc('0x25')](_0x8dd953)){_0x583dea[_0x8dd953][_0xd9bc('0x2b')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x2f')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x30')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x31')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x32')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x2c')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x33')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x34')]=0x0;_0x583dea[_0x8dd953]['outboundNoAnswerCallsDay']=0x0;_0x583dea[_0x8dd953]['outboundBusyCallsDay']=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x35')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x36')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x37')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x38')]=0x0;_0x583dea[_0x8dd953]['outboundDropCallsDayCallersExit']=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x39')]=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x3a')]=0x0;_0x583dea[_0x8dd953]['outboundRejectCallsDay']=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x3b')]=0x0;_0x583dea[_0x8dd953]['outboundAnswerAgiCallsDay']=0x0;_0x583dea[_0x8dd953][_0xd9bc('0x3c')]=0x0;_0x583dea[_0x8dd953]['queueStatusComplete']=!![];}}}}Realtime[_0xd9bc('0x3d')]['mergeFromDatabase']=function(_0x48242e,_0x51d3e5){for(var _0x185ad1 in _0x51d3e5){if(_0x48242e[_0xd9bc('0x25')](_0x185ad1)){_0x48242e[_0x185ad1]=_0x51d3e5[_0x185ad1];}}};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x3e')]=function(){var _0x539035=this;return function(_0x515ba9){if(_0x515ba9){freeIsNotKeyAgent(_0x515ba9,_0x539035[_0xd9bc('0x12')]);for(var _0x4c0e1e=0x0,_0x3e9274={},_0x3a90aa={};_0x4c0e1e<_0x515ba9[_0xd9bc('0x3f')];_0x4c0e1e+=0x1){_0x3e9274=_0x515ba9[_0x4c0e1e];var _0x584d82=_[_0xd9bc('0x28')](_0x3e9274[_0xd9bc('0x29')])?util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x3e9274[_0xd9bc('0x27')]):_0x3e9274['interface'];if(_['isUndefined'](_0x539035[_0xd9bc('0x12')][_0x584d82])){_0x539035[_0xd9bc('0x12')][_0x584d82]=new Agent(_0x3e9274);}else{_0x539035[_0xd9bc('0x40')](_0x539035[_0xd9bc('0x12')][_0x584d82],_0x3e9274);}}}return _0x539035[_0xd9bc('0x12')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x41')]=function(){var _0x4aa2eb=this;return function(_0x535fff){if(_0x535fff){freeIsNotKeySip(_0x535fff,_0x4aa2eb[_0xd9bc('0x42')]);for(var _0x361ae4=0x0,_0x2f4124={},_0xd4f847={};_0x361ae4<_0x535fff[_0xd9bc('0x3f')];_0x361ae4+=0x1){_0x2f4124=_0x535fff[_0x361ae4];if(_[_0xd9bc('0x43')](_0x4aa2eb[_0xd9bc('0x42')][util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x2f4124[_0xd9bc('0x27')])])){_0x4aa2eb['telephones'][util[_0xd9bc('0x2a')]('SIP/%s',_0x2f4124[_0xd9bc('0x27')])]=new Telephone(_0x2f4124);}else{_0x4aa2eb['mergeFromDatabase'](_0x4aa2eb[_0xd9bc('0x42')][util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x2f4124[_0xd9bc('0x27')])],_0x2f4124);}}}return _0x4aa2eb[_0xd9bc('0x42')];};};Realtime[_0xd9bc('0x3d')]['initTrunks']=function(){var _0x3b7ccd=this;return function(_0x51c48d){if(_0x51c48d){freeIsNotKeySip(_0x51c48d,_0x3b7ccd[_0xd9bc('0x13')]);for(var _0xa72e0e=0x0,_0x2627f6={},_0x42f94e={};_0xa72e0e<_0x51c48d[_0xd9bc('0x3f')];_0xa72e0e+=0x1){_0x2627f6=_0x51c48d[_0xa72e0e];if(_['isUndefined'](_0x3b7ccd[_0xd9bc('0x13')][util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x2627f6['name'])])){_0x3b7ccd[_0xd9bc('0x13')][util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x2627f6[_0xd9bc('0x27')])]=new Trunk(_0x2627f6);}else{_0x3b7ccd[_0xd9bc('0x40')](_0x3b7ccd[_0xd9bc('0x13')][util[_0xd9bc('0x2a')](_0xd9bc('0x26'),_0x2627f6[_0xd9bc('0x27')])],_0x2627f6);}}}return _0x3b7ccd[_0xd9bc('0x13')];};};Realtime['prototype'][_0xd9bc('0x44')]=function(){var _0x50a66a=this;return function(_0x20532c){if(_0x20532c){freeIsNotKey(_0x20532c,_0x50a66a['voiceQueues'],_0xd9bc('0x27'));for(var _0x16e6cc=0x0,_0x4601fb={},_0x408497={};_0x16e6cc<_0x20532c['length'];_0x16e6cc+=0x1){_0x4601fb=_0x20532c[_0x16e6cc];if(_['isUndefined'](_0x50a66a[_0xd9bc('0x14')][_0x4601fb[_0xd9bc('0x27')]])){_0x50a66a[_0xd9bc('0x14')][_0x4601fb[_0xd9bc('0x27')]]=new VoiceQueue(_0x4601fb);}else{_0x50a66a[_0xd9bc('0x40')](_0x50a66a[_0xd9bc('0x14')][_0x4601fb[_0xd9bc('0x27')]],_0x4601fb);}}}return _0x50a66a[_0xd9bc('0x14')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x45')]=function(){var _0x5de190=this;return function(_0x4f6b3c){if(_0x4f6b3c){freeIsNotKey(_0x4f6b3c,_0x5de190['triggers'],'id');for(var _0x21e78c=0x0,_0x4e249f={},_0xa8b422={};_0x21e78c<_0x4f6b3c[_0xd9bc('0x3f')];_0x21e78c+=0x1){_0x4e249f=_0x4f6b3c[_0x21e78c];if(_[_0xd9bc('0x43')](_0x5de190['triggers'][_0x4e249f['id']])){_0x5de190['triggers'][_0x4e249f['id']]=new Trigger(_0x4e249f);}else{_0x5de190['mergeFromDatabase'](_0x5de190[_0xd9bc('0x15')][_0x4e249f['id']],_0x4e249f);}}}return _0x5de190[_0xd9bc('0x15')];};};Realtime[_0xd9bc('0x3d')]['initTemplates']=function(){var _0x872f4d=this;return function(_0x150f48){if(_0x150f48){freeIsNotKey(_0x150f48,_0x872f4d[_0xd9bc('0x17')],'id');for(var _0x11ea86=0x0,_0x1f3c43={},_0x5d235f={};_0x11ea86<_0x150f48[_0xd9bc('0x3f')];_0x11ea86+=0x1){_0x1f3c43=_0x150f48[_0x11ea86];if(_[_0xd9bc('0x43')](_0x872f4d[_0xd9bc('0x17')][_0x1f3c43['id']])){_0x872f4d[_0xd9bc('0x17')][_0x1f3c43['id']]=new Template(_0x1f3c43);}else{_0x872f4d[_0xd9bc('0x40')](_0x872f4d[_0xd9bc('0x17')][_0x1f3c43['id']],_0x1f3c43);}}}return _0x872f4d[_0xd9bc('0x17')];};};Realtime[_0xd9bc('0x3d')]['initZendeskAccounts']=function(){var _0x26c9d8=this;return function(_0x3cdb1f){if(_0x3cdb1f){freeIsNotKey(_0x3cdb1f,_0x26c9d8['zendeskAccounts'],'id');for(var _0x9a068f=0x0,_0x10413d={},_0x90e504={};_0x9a068f<_0x3cdb1f[_0xd9bc('0x3f')];_0x9a068f+=0x1){_0x10413d=_0x3cdb1f[_0x9a068f];if(_[_0xd9bc('0x43')](_0x26c9d8[_0xd9bc('0x46')][_0x10413d['id']])){_0x26c9d8[_0xd9bc('0x46')][_0x10413d['id']]=new ZendeskAccount(_0x10413d);}else{_0x26c9d8[_0xd9bc('0x40')](_0x26c9d8['zendeskAccounts'][_0x10413d['id']],_0x10413d);}}}return _0x26c9d8['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x27b917=this;return function(_0x241c73){if(_0x241c73){freeIsNotKey(_0x241c73,_0x27b917[_0xd9bc('0x1f')],'id');for(var _0x1d9617=0x0,_0x1ae9fa={},_0xb3a3eb={};_0x1d9617<_0x241c73[_0xd9bc('0x3f')];_0x1d9617+=0x1){_0x1ae9fa=_0x241c73[_0x1d9617];if(_['isUndefined'](_0x27b917[_0xd9bc('0x1f')][_0x1ae9fa['id']])){_0x27b917['salesforceAccounts'][_0x1ae9fa['id']]=new SalesforceAccount(_0x1ae9fa);}else{_0x27b917[_0xd9bc('0x40')](_0x27b917['salesforceAccounts'][_0x1ae9fa['id']],_0x1ae9fa);}}}return _0x27b917[_0xd9bc('0x1f')];};};Realtime['prototype'][_0xd9bc('0x47')]=function(){var _0x2f5d2c=this;return function(_0x55fbc3){if(_0x55fbc3){freeIsNotKey(_0x55fbc3,_0x2f5d2c[_0xd9bc('0x48')],'id');for(var _0x20bd41=0x0,_0x1afaad={},_0x3ccd75={};_0x20bd41<_0x55fbc3[_0xd9bc('0x3f')];_0x20bd41+=0x1){_0x1afaad=_0x55fbc3[_0x20bd41];if(_[_0xd9bc('0x43')](_0x2f5d2c[_0xd9bc('0x48')][_0x1afaad['id']])){_0x2f5d2c['freshdeskAccounts'][_0x1afaad['id']]=new FreshdeskAccount(_0x1afaad);}else{_0x2f5d2c[_0xd9bc('0x40')](_0x2f5d2c[_0xd9bc('0x48')][_0x1afaad['id']],_0x1afaad);}}}return _0x2f5d2c[_0xd9bc('0x48')];};};Realtime[_0xd9bc('0x3d')]['initZohoAccounts']=function(){var _0x1a6b7a=this;return function(_0x5b6ae2){if(_0x5b6ae2){freeIsNotKey(_0x5b6ae2,_0x1a6b7a['zohoAccounts'],'id');for(var _0x15e42f=0x0,_0x18994e={},_0x24a72d={};_0x15e42f<_0x5b6ae2[_0xd9bc('0x3f')];_0x15e42f+=0x1){_0x18994e=_0x5b6ae2[_0x15e42f];if(_['isUndefined'](_0x1a6b7a[_0xd9bc('0x49')][_0x18994e['id']])){_0x1a6b7a['zohoAccounts'][_0x18994e['id']]=new ZohoAccount(_0x18994e);}else{_0x1a6b7a[_0xd9bc('0x40')](_0x1a6b7a[_0xd9bc('0x49')][_0x18994e['id']],_0x18994e);}}}return _0x1a6b7a[_0xd9bc('0x49')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x4a')]=function(){var _0x373a0c=this;return function(_0xb69595){if(_0xb69595){freeIsNotKey(_0xb69595,_0x373a0c[_0xd9bc('0x4b')],'id');for(var _0x2c1528=0x0,_0x1e418e={},_0x3c5c30={};_0x2c1528<_0xb69595['length'];_0x2c1528+=0x1){_0x1e418e=_0xb69595[_0x2c1528];if(_[_0xd9bc('0x43')](_0x373a0c[_0xd9bc('0x4b')][_0x1e418e['id']])){_0x373a0c['deskAccounts'][_0x1e418e['id']]=new DeskAccount(_0x1e418e);}else{_0x373a0c[_0xd9bc('0x40')](_0x373a0c['deskAccounts'][_0x1e418e['id']],_0x1e418e);}}}return _0x373a0c[_0xd9bc('0x4b')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x4c')]=function(){var _0x191680=this;return function(_0x4005d4){if(_0x4005d4){freeIsNotKey(_0x4005d4,_0x191680[_0xd9bc('0x20')],'id');for(var _0x461e0c=0x0,_0x15976b={},_0x57ca10={};_0x461e0c<_0x4005d4[_0xd9bc('0x3f')];_0x461e0c+=0x1){_0x15976b=_0x4005d4[_0x461e0c];if(_['isUndefined'](_0x191680[_0xd9bc('0x20')][_0x15976b['id']])){_0x191680[_0xd9bc('0x20')][_0x15976b['id']]=new SugarcrmAccount(_0x15976b);}else{_0x191680['mergeFromDatabase'](_0x191680[_0xd9bc('0x20')][_0x15976b['id']],_0x15976b);}}}return _0x191680[_0xd9bc('0x20')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x218d28=this;return function(_0x2f363c){if(_0x2f363c){freeIsNotKey(_0x2f363c,_0x218d28[_0xd9bc('0x4d')],'id');for(var _0xccfc5=0x0,_0x47ee53={},_0x36341d={};_0xccfc5<_0x2f363c['length'];_0xccfc5+=0x1){_0x47ee53=_0x2f363c[_0xccfc5];if(_[_0xd9bc('0x43')](_0x218d28[_0xd9bc('0x4d')][_0x47ee53['id']])){_0x218d28[_0xd9bc('0x4d')][_0x47ee53['id']]=new VtigerAccount(_0x47ee53);}else{_0x218d28[_0xd9bc('0x40')](_0x218d28[_0xd9bc('0x4d')][_0x47ee53['id']],_0x47ee53);}}}return _0x218d28[_0xd9bc('0x4d')];};};Realtime[_0xd9bc('0x3d')]['initServicenowAccounts']=function(){var _0x547bef=this;return function(_0x5ce3a6){if(_0x5ce3a6){freeIsNotKey(_0x5ce3a6,_0x547bef['servicenowAccounts'],'id');for(var _0x14e269=0x0,_0x3838bf={},_0x3660ab={};_0x14e269<_0x5ce3a6[_0xd9bc('0x3f')];_0x14e269+=0x1){_0x3838bf=_0x5ce3a6[_0x14e269];if(_[_0xd9bc('0x43')](_0x547bef[_0xd9bc('0x4e')][_0x3838bf['id']])){_0x547bef[_0xd9bc('0x4e')][_0x3838bf['id']]=new ServicenowAccount(_0x3838bf);}else{_0x547bef[_0xd9bc('0x40')](_0x547bef[_0xd9bc('0x4e')][_0x3838bf['id']],_0x3838bf);}}}return _0x547bef['servicenowAccounts'];};};Realtime['prototype'][_0xd9bc('0x4f')]=function(){var _0x319762=this;return function(_0x47f79c){if(_0x47f79c){freeIsNotKey(_0x47f79c,_0x319762[_0xd9bc('0x21')],'id');for(var _0x8cf73c=0x0,_0x3cd8b0={},_0x73a2e4={};_0x8cf73c<_0x47f79c[_0xd9bc('0x3f')];_0x8cf73c+=0x1){_0x3cd8b0=_0x47f79c[_0x8cf73c];if(_[_0xd9bc('0x43')](_0x319762[_0xd9bc('0x21')][_0x3cd8b0['id']])){_0x319762[_0xd9bc('0x21')][_0x3cd8b0['id']]=new Dynamics365Account(_0x3cd8b0);}else{_0x319762['mergeFromDatabase'](_0x319762[_0xd9bc('0x21')][_0x3cd8b0['id']],_0x3cd8b0);}}}return _0x319762[_0xd9bc('0x21')];};};Realtime[_0xd9bc('0x3d')]['initFreshsalesAccounts']=function(){var _0x103d7d=this;return function(_0x3330d7){if(_0x3330d7){freeIsNotKey(_0x3330d7,_0x103d7d[_0xd9bc('0x22')],'id');for(var _0x4a6067=0x0,_0x5379f9={},_0x25cf5b={};_0x4a6067<_0x3330d7[_0xd9bc('0x3f')];_0x4a6067+=0x1){_0x5379f9=_0x3330d7[_0x4a6067];if(_[_0xd9bc('0x43')](_0x103d7d[_0xd9bc('0x22')][_0x5379f9['id']])){_0x103d7d[_0xd9bc('0x22')][_0x5379f9['id']]=new FreshsalesAccount(_0x5379f9);}else{_0x103d7d['mergeFromDatabase'](_0x103d7d[_0xd9bc('0x22')][_0x5379f9['id']],_0x5379f9);}}}return _0x103d7d['freshsalesAccounts'];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x50')]=function(){var _0x1a7dc3=this;return function(_0x25b45e){for(var _0x5cb629=0x0;_0x5cb629<_0x25b45e[_0xd9bc('0x3f')];_0x5cb629+=0x1){_[_0xd9bc('0x51')](_0x1a7dc3[_0xd9bc('0x14')][_0x25b45e[_0x5cb629][_0xd9bc('0x27')]],_0x25b45e[_0x5cb629]);}return _0x1a7dc3[_0xd9bc('0x14')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x52')]=function(){var _0x1ba851=this;return function(_0x3aa56a){clearVoiceQueues(_0x1ba851[_0xd9bc('0x14')]);if(_0x3aa56a){_0x3aa56a=_[_0xd9bc('0x53')](_0x3aa56a,'uniqueid');for(var _0xbe793 in _0x3aa56a){if(_0x3aa56a[_0xd9bc('0x25')](_0xbe793)){var _0x76e915={};for(var _0x1d4958=0x0;_0x1d4958<_0x3aa56a[_0xbe793][_0xd9bc('0x3f')];_0x1d4958+=0x1){var _0x1ed46e=_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x54')];if(_0x1ba851[_0xd9bc('0x14')][_0x1ed46e]){if(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x55')]){_0x1ba851[_0xd9bc('0x14')][_0x1ed46e][_0xd9bc('0x30')]+=0x1;}if(_0x3aa56a[_0xbe793][_0x1d4958]['queuecallerabandon']){_0x1ba851[_0xd9bc('0x14')][_0x1ed46e][_0xd9bc('0x31')]+=0x1;}_0x1ba851['voiceQueues'][_0x1ed46e][_0xd9bc('0x32')]+=moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x56')])[_0xd9bc('0x57')](moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x58')]),_0xd9bc('0x59'))||0x0;if(_0x1d4958===_0x3aa56a[_0xbe793][_0xd9bc('0x3f')]-0x1){_0x1ba851[_0xd9bc('0x14')][_0x1ed46e][_0xd9bc('0x2c')]+=moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x5a')]||_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x5b')]||_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x5c')])[_0xd9bc('0x57')](moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x58')]),_0xd9bc('0x59'))||0x0;_0x1ba851['voiceQueues'][_0x1ed46e]['total']+=0x1;if(_0x3aa56a[_0xbe793][_0x1d4958]['queuecallercomplete']){_0x1ba851[_0xd9bc('0x14')][_0x1ed46e][_0xd9bc('0x2f')]+=0x1;_0x1ba851[_0xd9bc('0x14')][_0x1ed46e]['sumBillable']+=moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x5a')])['diff'](moment(_0x3aa56a[_0xbe793][_0x1d4958][_0xd9bc('0x56')]),'seconds')||0x0;}}else{_0x1ba851['voiceQueues'][_0x1ed46e]['sumDuration']+=_0x1ba851[_0xd9bc('0x14')][_0x1ed46e][_0xd9bc('0x32')]||0x0;}}}}}}return _0x1ba851[_0xd9bc('0x14')];};};Realtime[_0xd9bc('0x3d')]['initVoiceCallReports']=function(){var _0x23ac4e=this;return function(_0x5f08e4){clearVoiceCallReports(_0x23ac4e[_0xd9bc('0x18')]);if(_0x5f08e4){for(var _0x33bb66=0x0;_0x33bb66<_0x5f08e4['length'];_0x33bb66+=0x1){_0x23ac4e[_0xd9bc('0x18')]['total']+=0x1;_0x23ac4e[_0xd9bc('0x18')][_0xd9bc('0x2c')]+=_0x5f08e4[_0x33bb66][_0xd9bc('0x5d')];if(_0x5f08e4[_0x33bb66][_0xd9bc('0x5e')]===_0xd9bc('0x5f')){_0x23ac4e[_0xd9bc('0x18')]['answered']+=0x1;_0x23ac4e['outbound'][_0xd9bc('0x32')]+=_0x5f08e4[_0x33bb66][_0xd9bc('0x5d')]-_0x5f08e4[_0x33bb66]['billableseconds']||0x0;_0x23ac4e[_0xd9bc('0x18')]['sumBillable']+=_0x5f08e4[_0x33bb66][_0xd9bc('0x60')];}}}return _0x23ac4e['outbound'];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x61')]=function(){var _0x56f7bb=this;return function(_0x1cb7e2){if(_0x1cb7e2){freeIsNotKey(_0x1cb7e2,_0x56f7bb[_0xd9bc('0x16')],_0xd9bc('0x27'));for(var _0x3d83bb=0x0,_0x359098={};_0x3d83bb<_0x1cb7e2[_0xd9bc('0x3f')];_0x3d83bb+=0x1){_0x359098=_0x1cb7e2[_0x3d83bb];if(_[_0xd9bc('0x43')](_0x56f7bb['campaigns'][_0x359098[_0xd9bc('0x27')]])){_0x56f7bb[_0xd9bc('0x16')][_0x359098['name']]=new Campaign(_0x359098);}else{_0x56f7bb[_0xd9bc('0x40')](_0x56f7bb[_0xd9bc('0x16')][_0x359098[_0xd9bc('0x27')]],_0x359098);_0x56f7bb[_0xd9bc('0x16')][_0x359098[_0xd9bc('0x27')]]['dialQueueProject']=_0x359098[_0xd9bc('0x62')]?_0x359098[_0xd9bc('0x62')][_0xd9bc('0x27')]:undefined;}}}return _0x56f7bb[_0xd9bc('0x16')];};};Realtime['prototype'][_0xd9bc('0x63')]=function(){var _0x51c9a9=this;return function(_0x458a19){if(_0x458a19){freeIsNotKey(_0x458a19,_0x51c9a9[_0xd9bc('0x19')],'id');for(var _0xedc0bf=0x0,_0x1e82e5={};_0xedc0bf<_0x458a19[_0xd9bc('0x3f')];_0xedc0bf+=0x1){_0x1e82e5=_0x458a19[_0xedc0bf];if(_[_0xd9bc('0x43')](_0x51c9a9[_0xd9bc('0x19')][_0x1e82e5['id']])){_0x51c9a9[_0xd9bc('0x19')][_0x1e82e5['id']]=new VoiceExtension(_0x1e82e5);}else{_0x51c9a9[_0xd9bc('0x40')](_0x51c9a9[_0xd9bc('0x19')][_0x1e82e5['id']],_0x1e82e5);}}}return _0x51c9a9[_0xd9bc('0x19')];};};Realtime[_0xd9bc('0x3d')][_0xd9bc('0x64')]=function(){var _0x3bc432=this;return function(_0x5d32e9){clearCampaigns(_0x3bc432['campaigns']);for(var _0x14f224=0x0;_0x14f224<_0x5d32e9['length'];_0x14f224+=0x1){_['merge'](_0x3bc432[_0xd9bc('0x16')][_0x5d32e9[_0x14f224][_0xd9bc('0x27')]],_0x5d32e9[_0x14f224]);}return _0x3bc432[_0xd9bc('0x16')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x543deb=this;return function(_0xe89ac0){if(_0xe89ac0){freeIsNotKey(_0xe89ac0,_0x543deb[_0xd9bc('0x23')],'id');for(var _0x4d3e23=0x0,_0x4a0f9e={},_0x1d8e35={};_0x4d3e23<_0xe89ac0[_0xd9bc('0x3f')];_0x4d3e23+=0x1){_0x4a0f9e=_0xe89ac0[_0x4d3e23];if(_[_0xd9bc('0x43')](_0x543deb['faxAccounts'][_0x4a0f9e['id']])){_0x543deb[_0xd9bc('0x23')][_0x4a0f9e['id']]=new FaxAccount(_0x4a0f9e);}else{_0x543deb[_0xd9bc('0x40')](_0x543deb['faxAccounts'][_0x4a0f9e['id']],_0x4a0f9e);}}}return _0x543deb[_0xd9bc('0x23')];};};module[_0xd9bc('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 9a795ac..5661751 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 _0xc925=['monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','forEach','Local','substring','indexOf','mobile','transfererlinkedid','attendedTransfer','exports','moment','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','isNil','name','interface','length','connectedlinenum','assigned','SIP/%s','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','split','calleridnum','internal','exten','type','lastapplication','queue','context','destination','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','UserId','getAgentByInternal','membername','monitor'];(function(_0xea27dd,_0x582a07){var _0x38aa2b=function(_0x237602){while(--_0x237602){_0xea27dd['push'](_0xea27dd['shift']());}};_0x38aa2b(++_0x582a07);}(_0xc925,0xc2));var _0x5c92=function(_0x4d9818,_0x5126b1){_0x4d9818=_0x4d9818-0x0;var _0x1b3e8c=_0xc925[_0x4d9818];return _0x1b3e8c;};'use strict';var _=require('lodash');var moment=require(_0x5c92('0x0'));var util=require('util');var config=require(_0x5c92('0x1'));var ami=require(_0x5c92('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x5c92('0x3'));var RpcMemberReport=require(_0x5c92('0x4'));var RpcVoiceQueueReport=require(_0x5c92('0x5'));var RpcVoiceRecording=require(_0x5c92('0x6'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5c92('0x7'));var VoiceCallReport=require(_0x5c92('0x8'));var VoiceAgentReport=require(_0x5c92('0x9'));var VoiceDialReport=require(_0x5c92('0xa'));var UserReport=require('./userReport');function Report(_0x3289af){this[_0x5c92('0xb')]=_0x3289af;this[_0x5c92('0xc')]=_0x3289af[_0x5c92('0xc')];this[_0x5c92('0xd')]=_0x3289af[_0x5c92('0xd')];}Report[_0x5c92('0xe')][_0x5c92('0xf')]=function(_0x3b5cec){var _0x518d99=new VoiceQueueReport(this['realtime']);var _0xdc1166=new VoiceAgentReport(this[_0x5c92('0xb')]);var _0x1770e5=new VoiceDialReport(this[_0x5c92('0xb')]);var _0x39d3e2=new VoiceCallReport(this[_0x5c92('0xb')]);var _0x493822=new UserReport(this[_0x5c92('0xb')]);if(config['xdr']&&config[_0x5c92('0x10')][_0x5c92('0x11')]){ami['on'](_0x5c92('0x12'),this[_0x5c92('0x13')]['bind'](this));ami['on'](_0x5c92('0x14'),this[_0x5c92('0x15')][_0x5c92('0x16')](this));ami['on'](_0x5c92('0x17'),this[_0x5c92('0x18')][_0x5c92('0x16')](this));ami['on'](_0x5c92('0x19'),this[_0x5c92('0x1a')][_0x5c92('0x16')](this));ami['on'](_0x5c92('0x1b'),this[_0x5c92('0x1c')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x5c92('0x16')](this));}};Report['prototype'][_0x5c92('0x1d')]=function(_0x46136a){var _0x382e74;_0x382e74=_[_0x5c92('0x1e')](this[_0x5c92('0xc')],function(_0x36fdc8){return _0x36fdc8[_0x5c92('0x1f')]==_0x46136a||_0x36fdc8['name']==_0x46136a;});if(_[_0x5c92('0x20')](_0x382e74)){var _0x2e08a8=_[_0x5c92('0x1e')](this['telephones'],function(_0x323bcb){return _0x323bcb['accountcode']==_0x46136a||_0x323bcb[_0x5c92('0x21')]==_0x46136a;});if(_0x2e08a8){_0x382e74=_[_0x5c92('0x1e')](this[_0x5c92('0xc')],function(_0x4a2b16){return _0x4a2b16[_0x5c92('0x22')]==util['format']('SIP/%s',_0x2e08a8[_0x5c92('0x21')]);});}}return _0x382e74;};Report[_0x5c92('0xe')][_0x5c92('0x13')]=function(_0x23bcba){for(var _0x5ddf04=0x0;_0x5ddf04<_0x23bcba[_0x5c92('0x23')];_0x5ddf04+=0x1){var _0x37de08=this['findAgent'](_0x23bcba[_0x5ddf04][_0x5c92('0x24')]);if(_0x37de08){_0x23bcba[_0x5ddf04][_0x5c92('0x1f')]=_0x37de08['accountcode'];_0x23bcba[_0x5ddf04][_0x5c92('0x25')]=!![];_0x23bcba[_0x5ddf04]['lastAssignedTo']=_0x37de08['name'];_0x23bcba[_0x5ddf04]['interface']=_[_0x5c92('0x20')](_0x37de08[_0x5c92('0x22')])?util['format'](_0x5c92('0x26'),_0x37de08[_0x5c92('0x21')]):_0x37de08[_0x5c92('0x22')];if(_0x23bcba[_0x5ddf04][_0x5c92('0x27')]){_0x23bcba[_0x5ddf04][_0x5c92('0x28')]=moment()[_0x5c92('0x29')](_0x5c92('0x2a'));}if(_0x23bcba[_0x5ddf04][_0x5c92('0x2b')]){_0x23bcba[_0x5ddf04][_0x5c92('0x2c')]=moment()[_0x5c92('0x29')](_0x5c92('0x2a'));}RpcMemberReport[_0x5c92('0x13')](_0x23bcba[_0x5ddf04]);}RpcVoiceQueueReport[_0x5c92('0x2d')](_0x23bcba[_0x5ddf04]);}};function extractCalleridNumber(_0x2f3ffa){var _0x1bb028=_0x2f3ffa[_0x5c92('0x2e')](/<(.*?)>/);return _0x1bb028?_0x1bb028[0x1]:_0x2f3ffa;}Report[_0x5c92('0xe')]['getAgentByInternal']=function(_0x2bbe9a){for(var _0x28b603=0x0;_0x28b603','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','getCallType','UserId','monitor','monitors','monitorFilename','createdAt'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x78b7,0x177));var _0x778b=function(_0x491b4d,_0x23ea82){_0x491b4d=_0x491b4d-0x0;var _0x369ae7=_0x78b7[_0x491b4d];return _0x369ae7;};'use strict';var _=require(_0x778b('0x0'));var moment=require(_0x778b('0x1'));var util=require(_0x778b('0x2'));var config=require('../../../config/environment');var ami=require(_0x778b('0x3'));var RpcVoiceAgentReport=require(_0x778b('0x4'));var RpcVoiceCallReport=require(_0x778b('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x778b('0x6'));var RpcVoiceRecording=require(_0x778b('0x7'));var RpcVoiceTransferReport=require(_0x778b('0x8'));var VoiceQueueReport=require(_0x778b('0x9'));var VoiceCallReport=require(_0x778b('0xa'));var VoiceAgentReport=require(_0x778b('0xb'));var VoiceDialReport=require(_0x778b('0xc'));var UserReport=require(_0x778b('0xd'));function Report(_0x492888){this[_0x778b('0xe')]=_0x492888;this[_0x778b('0xf')]=_0x492888[_0x778b('0xf')];this[_0x778b('0x10')]=_0x492888['telephones'];}Report[_0x778b('0x11')][_0x778b('0x12')]=function(_0x2df285){var _0x2597e=new VoiceQueueReport(this[_0x778b('0xe')]);var _0x227eb4=new VoiceAgentReport(this['realtime']);var _0x34f306=new VoiceDialReport(this['realtime']);var _0xb46857=new VoiceCallReport(this['realtime']);var _0x39ea8c=new UserReport(this[_0x778b('0xe')]);if(config[_0x778b('0x13')]&&config[_0x778b('0x13')][_0x778b('0x14')]){ami['on'](_0x778b('0x15'),this[_0x778b('0x16')][_0x778b('0x17')](this));ami['on'](_0x778b('0x18'),this[_0x778b('0x19')]['bind'](this));ami['on'](_0x778b('0x1a'),this[_0x778b('0x1b')][_0x778b('0x17')](this));ami['on'](_0x778b('0x1c'),this['voiceDialReport'][_0x778b('0x17')](this));ami['on']('blindtransfer',this[_0x778b('0x1d')][_0x778b('0x17')](this));ami['on']('attendedtransfer',this[_0x778b('0x1e')][_0x778b('0x17')](this));}};Report[_0x778b('0x11')][_0x778b('0x1f')]=function(_0x19c25f){var _0x1e0b0f;_0x1e0b0f=_[_0x778b('0x20')](this[_0x778b('0xf')],function(_0x148cd5){return _0x148cd5[_0x778b('0x21')]==_0x19c25f||_0x148cd5[_0x778b('0x22')]==_0x19c25f;});if(_[_0x778b('0x23')](_0x1e0b0f)){var _0x52919a=_[_0x778b('0x20')](this['telephones'],function(_0x5a6261){return _0x5a6261[_0x778b('0x21')]==_0x19c25f||_0x5a6261['name']==_0x19c25f;});if(_0x52919a){_0x1e0b0f=_[_0x778b('0x20')](this['agents'],function(_0x1e55a2){return _0x1e55a2[_0x778b('0x24')]==util['format']('SIP/%s',_0x52919a['name']);});}}return _0x1e0b0f;};Report['prototype'][_0x778b('0x16')]=function(_0x26f333){for(var _0x33a7cd=0x0;_0x33a7cd<_0x26f333[_0x778b('0x25')];_0x33a7cd+=0x1){var _0x329db5=this[_0x778b('0x1f')](_0x26f333[_0x33a7cd][_0x778b('0x26')]);if(_0x329db5){_0x26f333[_0x33a7cd][_0x778b('0x21')]=_0x329db5['accountcode'];_0x26f333[_0x33a7cd]['assigned']=!![];_0x26f333[_0x33a7cd]['lastAssignedTo']=_0x329db5['name'];_0x26f333[_0x33a7cd][_0x778b('0x24')]=_[_0x778b('0x23')](_0x329db5[_0x778b('0x24')])?util[_0x778b('0x27')](_0x778b('0x28'),_0x329db5[_0x778b('0x22')]):_0x329db5[_0x778b('0x24')];if(_0x26f333[_0x33a7cd][_0x778b('0x29')]){_0x26f333[_0x33a7cd][_0x778b('0x2a')]=moment()[_0x778b('0x27')](_0x778b('0x2b'));}if(_0x26f333[_0x33a7cd][_0x778b('0x2c')]){_0x26f333[_0x33a7cd]['queuecallerexitAt']=moment()[_0x778b('0x27')](_0x778b('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x26f333[_0x33a7cd]);}RpcVoiceQueueReport[_0x778b('0x2d')](_0x26f333[_0x33a7cd]);}};function extractCalleridNumber(_0x25b9a7){var _0x4a4609=_0x25b9a7[_0x778b('0x2e')](/<(.*?)>/);return _0x4a4609?_0x4a4609[0x1]:_0x25b9a7;}Report[_0x778b('0x11')][_0x778b('0x2f')]=function(_0x4f5df6){for(var _0x2a43c7=0x0;_0x2a43c70x0?_0x59076e:0x0;this[_0xce6b('0x13')][_0x5244ce[_0xce6b('0x5f')]][_0xce6b('0x4e')]=this[_0xce6b('0x13')][_0x5244ce['queue']][_0xce6b('0x4e')]>_['toNumber'](_0x5244ce[_0xce6b('0x65')])?_[_0xce6b('0x64')](_0x5244ce[_0xce6b('0x65')]):this[_0xce6b('0x13')][_0x5244ce[_0xce6b('0x5f')]]['talking'];this[_0xce6b('0x4a')](this[_0xce6b('0x13')][_0x5244ce[_0xce6b('0x5f')]],'queuesummary');}logger[_0xce6b('0x41')](_0xce6b('0x67'),util[_0xce6b('0x37')](this[_0xce6b('0x13')][_0x5244ce[_0xce6b('0x5f')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0xce6b('0x13')][_0x5244ce[_0xce6b('0x5f')]]);}}}catch(_0x179b1e){logger[_0xce6b('0x38')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x179b1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xce6b('0xb')][_0xce6b('0x68')]=function(_0x280e45){logger[_0xce6b('0x41')](_0xce6b('0x69'),util[_0xce6b('0x37')](_0x280e45,{'showHidden':![],'depth':null}));this[_0xce6b('0x5e')]=!![];};VoiceQueueReport['prototype'][_0xce6b('0x17')]=function(_0xdfd44d){try{if(this[_0xce6b('0x5a')](_0xdfd44d)){logger[_0xce6b('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0xdfd44d[_0xce6b('0x44')],util[_0xce6b('0x37')](_0xdfd44d,{'showHidden':![],'depth':null}));if(_[_0xce6b('0x6a')](this['queueReports'][_0xdfd44d['uniqueid']]))this[_0xce6b('0x10')][_0xdfd44d[_0xce6b('0x44')]]=[];if(_[_0xce6b('0x6a')](this['channels'][_0xdfd44d[_0xce6b('0x44')]]))this[_0xce6b('0x11')][_0xdfd44d['uniqueid']]={};var _0x1e8ab0=new QueueReport();_0x1e8ab0['name']=_0xdfd44d['queue'];_0x1e8ab0[_0xce6b('0x4f')]=this[_0xce6b('0x13')][_0x1e8ab0['name']]&&this[_0xce6b('0x13')][_0x1e8ab0[_0xce6b('0x47')]][_0xce6b('0x4f')]?this[_0xce6b('0x13')][_0x1e8ab0[_0xce6b('0x47')]][_0xce6b('0x4f')]||_0xce6b('0x6b'):_0xce6b('0x6b');_0x1e8ab0[_0xce6b('0x5f')]=_0xdfd44d[_0xce6b('0x5f')];_0x1e8ab0['queuecallerjoinAt']=moment()[_0xce6b('0x45')](_0xce6b('0x6c'));_0x1e8ab0[_0xce6b('0x6d')]=_0xdfd44d['position'];_0x1e8ab0[_0xce6b('0x6e')]=_0xdfd44d[_0xce6b('0x6e')];_0x1e8ab0[_0xce6b('0x44')]=_0xdfd44d[_0xce6b('0x44')];_0x1e8ab0[_0xce6b('0x6f')]=this[_0xce6b('0x11')][_0xdfd44d[_0xce6b('0x44')]][_0xce6b('0x6f')];logger[_0xce6b('0x60')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1e8ab0[_0xce6b('0x47')],_0x1e8ab0['type']);_['merge'](_0x1e8ab0,_['pick'](_0xdfd44d,_[_0xce6b('0x70')](_0x1e8ab0)));this[_0xce6b('0x10')][_0xdfd44d[_0xce6b('0x44')]][_0xce6b('0x71')](_0x1e8ab0);this[_0xce6b('0x11')][_0xdfd44d[_0xce6b('0x44')]]=_0x1e8ab0;this[_0xce6b('0x40')](_0x1e8ab0,'queuecallerjoin');}}catch(_0x321cf7){logger[_0xce6b('0x38')]('[%s][voiceQueueReport][queuecallerjoin]',_0xdfd44d[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x321cf7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xce6b('0x19')]=function(_0x542dbc){try{if(this[_0xce6b('0x5a')](_0x542dbc)){logger[_0xce6b('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x542dbc[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x542dbc,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x542dbc[_0xce6b('0x44')]]){var _0x27f273=_['last'](this[_0xce6b('0x10')][_0x542dbc[_0xce6b('0x44')]]);_0x27f273[_0xce6b('0x72')]=![];_0x27f273[_0xce6b('0x73')]=null;_0x27f273['holdtime']=_0x542dbc['holdtime'];_0x27f273[_0xce6b('0x74')]=_0x542dbc['originalposition'];_0x27f273[_0xce6b('0x18')]=!![];_0x27f273[_0xce6b('0x75')]=moment()['format'](_0xce6b('0x6c'));_0x27f273['queuecallerexitreason']='ABANDONED';_0x27f273[_0xce6b('0x76')]=null;logger[_0xce6b('0x60')](_0xce6b('0x77'),_0x27f273[_0xce6b('0x47')],_0x27f273[_0xce6b('0x4f')]);this[_0xce6b('0x11')][_0x542dbc['uniqueid']]=_0x27f273;this['emitVoiceQueueChannelRemove'](_0x27f273,_0xce6b('0x18'));}}}catch(_0x41c89c){logger[_0xce6b('0x38')](_0xce6b('0x78'),_0x542dbc['uniqueid'],util[_0xce6b('0x37')](_0x41c89c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xce6b('0xb')]['syncQueueCallerLeave']=function(_0x132ef2){try{if(this[_0xce6b('0x5a')](_0x132ef2)){logger[_0xce6b('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x132ef2[_0xce6b('0x44')],util['inspect'](_0x132ef2,{'showHidden':![],'depth':null}));if(this[_0xce6b('0x10')][_0x132ef2['uniqueid']]){var _0x3604b8=_[_0xce6b('0x79')](this[_0xce6b('0x10')][_0x132ef2[_0xce6b('0x44')]]);_0x3604b8['queuecallerleaveAt']=moment()['format'](_0xce6b('0x6c'));_0x3604b8['connectedlinenum']=_0x132ef2[_0xce6b('0x7a')];_0x3604b8[_0xce6b('0x7b')]=_0x132ef2[_0xce6b('0x7b')];logger[_0xce6b('0x60')](_0xce6b('0x7c'),_0x3604b8[_0xce6b('0x47')],_0x3604b8[_0xce6b('0x4f')],_0x132ef2[_0xce6b('0x7a')],_0x132ef2[_0xce6b('0x7b')]);this[_0xce6b('0x11')][_0x132ef2['uniqueid']]=_0x3604b8;this['emitVoiceQueueChannelSave'](_0x3604b8,'queuecallerleave');}}}catch(_0x16ce77){logger['error'](_0xce6b('0x7d'),_0x132ef2[_0xce6b('0x44')],util['inspect'](_0x16ce77,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xce6b('0xb')][_0xce6b('0x7e')]=function(_0x11104e){try{if(this['isNotNull'](_0x11104e)){logger[_0xce6b('0x41')](_0xce6b('0x7f'),_0x11104e['uniqueid'],util[_0xce6b('0x37')](_0x11104e,{'showHidden':![],'depth':null}));if(this[_0xce6b('0x10')][_0x11104e[_0xce6b('0x44')]]){var _0x41b717=_[_0xce6b('0x79')](this[_0xce6b('0x10')][_0x11104e[_0xce6b('0x44')]]);_0x41b717[_0xce6b('0x72')]=!![];_0x41b717[_0xce6b('0x80')]=_0xce6b('0x81');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x41b717[_0xce6b('0x47')],_0x41b717['type']);}}}catch(_0x3cba95){logger[_0xce6b('0x38')](_0xce6b('0x7f'),_0x11104e['uniqueid'],util['inspect'](_0x3cba95,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xce6b('0xb')][_0xce6b('0x1d')]=function(_0x27b103){try{if(this[_0xce6b('0x5a')](_0x27b103)){logger[_0xce6b('0x41')](_0xce6b('0x82'),_0x27b103[_0xce6b('0x44')],util['inspect'](_0x27b103,{'showHidden':![],'depth':null}));if(this[_0xce6b('0x10')][_0x27b103['uniqueid']]){var _0x3277f7=_['last'](this[_0xce6b('0x10')][_0x27b103[_0xce6b('0x44')]]);_0x3277f7[_0xce6b('0x18')]=![];_0x3277f7[_0xce6b('0x75')]=null;_0x3277f7[_0xce6b('0x83')]=!![];_0x3277f7[_0xce6b('0x76')]=_0x27b103[_0xce6b('0x84')];_0x3277f7['holdtime']=_0x27b103[_0xce6b('0x85')];_0x3277f7['queuecallercomplete']=!![];_0x3277f7[_0xce6b('0x86')]=![];_0x3277f7[_0xce6b('0x87')]=null;if(!_0x3277f7[_0xce6b('0x88')]){if(_0x27b103[_0xce6b('0x89')]==_0xce6b('0x88')){_0x3277f7['queuecallerexitreason']=_0xce6b('0x8a');logger['info'](_0xce6b('0x8b'),_0x3277f7[_0xce6b('0x47')],_0x3277f7[_0xce6b('0x4f')]);}else{if(_[_0xce6b('0x8c')](_0x27b103[_0xce6b('0x33')][_0xce6b('0x8d')](),_0xce6b('0x8e'))){if(this[_0xce6b('0x10')][_0x27b103[_0xce6b('0x8f')]]){var _0xadb2d3=_[_0xce6b('0x79')](this['queueReports'][_0x27b103[_0xce6b('0x8f')]]);_0xadb2d3[_0xce6b('0x72')]=![];_0xadb2d3['queuecallerexit']=!![];_0xadb2d3[_0xce6b('0x87')]=moment(_0x3277f7[_0xce6b('0x90')])[_0xce6b('0x91')](_0x27b103['holdtime'],_0xce6b('0x92'))[_0xce6b('0x45')](_0xce6b('0x6c'));_0xadb2d3[_0xce6b('0x80')]=_0xce6b('0x93');_0xadb2d3[_0xce6b('0x88')]=!![];_0xadb2d3[_0xce6b('0x94')]=_0xce6b('0x95');_0xadb2d3[_0xce6b('0x96')]=_0x27b103[_0xce6b('0x97')];_0xadb2d3[_0xce6b('0x98')]=_0x27b103['uniqueid'];logger['info'](_0xce6b('0x99'),_0xadb2d3['name'],_0xadb2d3['type']);var _0x1eb2db=this[_0xce6b('0x10')][_0x27b103[_0xce6b('0x8f')]];this[_0xce6b('0x10')][_0x27b103['linkedid']]=this[_0xce6b('0x10')][_0x27b103['uniqueid']];this['queueReports'][_0x27b103[_0xce6b('0x44')]]=_0x1eb2db;}}else{_0x3277f7[_0xce6b('0x80')]=_0xce6b('0x9a')+_0x27b103[_0xce6b('0x89')]['toUpperCase']();logger[_0xce6b('0x60')](_0xce6b('0x9b'),_0x3277f7[_0xce6b('0x47')],_0x3277f7[_0xce6b('0x4f')],_0x3277f7[_0xce6b('0x80')]);}}}this['channels'][_0x27b103[_0xce6b('0x44')]]=_0x3277f7;this['emitVoiceQueueChannelRemove'](_0x3277f7,'agentcomplete');}}}catch(_0x22fb9a){logger[_0xce6b('0x38')]('[%s][voiceQueueReport][agentcomplete]',_0x27b103[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x22fb9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xce6b('0x1f')]=function(_0x1c4f7d){try{if(this[_0xce6b('0x5a')](_0x1c4f7d)){logger[_0xce6b('0x41')](_0xce6b('0x9c'),_0x1c4f7d[_0xce6b('0x44')],util['inspect'](_0x1c4f7d,{'showHidden':![],'depth':null}));this[_0xce6b('0x9d')](_0x1c4f7d[_0xce6b('0x44')],_[_0xce6b('0x70')](_0x1c4f7d[_0xce6b('0x9e')])[0x0],_0x1c4f7d['value']);if(this[_0xce6b('0x10')][_0x1c4f7d['uniqueid']]){var _0x84d4ec=_[_0xce6b('0x79')](this['queueReports'][_0x1c4f7d[_0xce6b('0x44')]]);if(_0x84d4ec){if(this['isNotNull'](_0x1c4f7d[_0xce6b('0x9e')])&&this[_0xce6b('0x5a')](_0x1c4f7d[_0xce6b('0x9e')][_0xce6b('0x9f')])){switch(_0x1c4f7d[_0xce6b('0xa0')]){case _0xce6b('0xa1'):_0x84d4ec[_0xce6b('0x86')]=![];_0x84d4ec['queuecallerexitAt']=null;break;case _0xce6b('0xa2'):_0x84d4ec[_0xce6b('0xa3')]=_0xce6b('0xa4');_0x84d4ec['queuecallerexit']=!![];_0x84d4ec['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x84d4ec[_0xce6b('0xa5')]=moment()[_0xce6b('0x45')](_0xce6b('0x6c'));logger[_0xce6b('0x41')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1c4f7d[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x84d4ec,{'showHidden':![],'depth':null}));ami[_0xce6b('0x3f')](_0xce6b('0xa6'),_0x84d4ec);break;default:_0x84d4ec[_0xce6b('0x86')]=!![];_0x84d4ec[_0xce6b('0x87')]=moment()[_0xce6b('0x45')](_0xce6b('0x6c'));_0x84d4ec['queuecallerleaveAt']=moment()[_0xce6b('0x45')](_0xce6b('0x6c'));}_0x84d4ec[_0xce6b('0x18')]=![];_0x84d4ec['queuecallerabandonAt']=null;_0x84d4ec[_0xce6b('0x80')]=_0x1c4f7d[_0xce6b('0xa0')];this['channels'][_0x1c4f7d['uniqueid']]=_0x84d4ec;this['emitVoiceQueueChannelRemove'](_0x84d4ec,_0xce6b('0xa7'));}else if(this[_0xce6b('0x5a')](_0x1c4f7d[_0xce6b('0x9e')])&&this[_0xce6b('0x5a')](_0x1c4f7d['variable'][_0xce6b('0xa8')])){if(!_0x84d4ec[_0xce6b('0x18')]){_0x84d4ec[_0xce6b('0x86')]=!![];_0x84d4ec[_0xce6b('0x87')]=moment()[_0xce6b('0x45')](_0xce6b('0x6c'));_0x84d4ec[_0xce6b('0x80')]=_0xce6b('0xa9');_0x84d4ec['queuecallerleaveAt']=moment()['format'](_0xce6b('0x6c'));this[_0xce6b('0x11')][_0x1c4f7d[_0xce6b('0x44')]]=_0x84d4ec;}}logger[_0xce6b('0x60')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1c4f7d[_0xce6b('0x44')],_0x84d4ec['name'],_0x84d4ec[_0xce6b('0x4f')],_['keys'](_0x1c4f7d['variable'])[0x0],_0x1c4f7d[_0xce6b('0xa0')]);_0x84d4ec[_0xce6b('0x3a')]=this[_0xce6b('0x3a')][_0x1c4f7d[_0xce6b('0x44')]];}}}}catch(_0x498871){logger['error'](_0xce6b('0x9c'),_0x1c4f7d[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x498871,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xce6b('0x9d')]=function(_0x3db66f,_0x5acf1f,_0x21b2b5){var _0x119cdb=[_0xce6b('0xaa'),_0xce6b('0xab'),_0xce6b('0xac'),_0xce6b('0xad'),_0xce6b('0xae'),_0xce6b('0xaf'),_0xce6b('0xb0'),'rtpaudioqosrttbridged',_0xce6b('0xb1'),_0xce6b('0xb2'),_0xce6b('0xb3'),_0xce6b('0xb4'),_0xce6b('0xb5'),_0xce6b('0xb6'),_0xce6b('0xb7'),_0xce6b('0xb8'),_0xce6b('0x84'),_0xce6b('0xb9'),_0xce6b('0xba')];if(!_[_0xce6b('0xbb')](_0x5acf1f)&&!_[_0xce6b('0xbc')](_0x119cdb,_0x5acf1f)){if(_[_0xce6b('0x6a')](this[_0xce6b('0x3a')][_0x3db66f])){this['variables'][_0x3db66f]={};}this[_0xce6b('0x3a')][_0x3db66f][_0x5acf1f]=_0x21b2b5;}};VoiceQueueReport[_0xce6b('0xb')][_0xce6b('0x21')]=function(_0x48f341){try{if(this[_0xce6b('0x5a')](_0x48f341)){logger[_0xce6b('0x41')]('[%s][voiceQueueReport][hangup]',_0x48f341[_0xce6b('0x44')],util[_0xce6b('0x37')](_0x48f341,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x48f341[_0xce6b('0x44')]]){for(var _0x442c4f=0x0,_0x5664f9={};_0x442c4f0x0?_0x3ec87a:0x0;this['voiceQueues'][_0x1a047b['queue']]['talking']=this['voiceQueues'][_0x1a047b[_0x7005('0x6b')]][_0x7005('0x2e')]>_['toNumber'](_0x1a047b[_0x7005('0x6f')])?_['toNumber'](_0x1a047b[_0x7005('0x6f')]):this[_0x7005('0x11')][_0x1a047b['queue']][_0x7005('0x2e')];this[_0x7005('0x4c')](this['voiceQueues'][_0x1a047b[_0x7005('0x6b')]],_0x7005('0x15'));}logger['debug'](_0x7005('0x70'),util['inspect'](this['voiceQueues'][_0x1a047b[_0x7005('0x6b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0x7005('0x11')][_0x1a047b[_0x7005('0x6b')]]);}}}catch(_0xe30989){logger[_0x7005('0x3a')](_0x7005('0x6a'),util['inspect'](_0xe30989,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x2417e7){logger[_0x7005('0x46')](_0x7005('0x71'),util[_0x7005('0x3c')](_0x2417e7,{'showHidden':![],'depth':null}));this[_0x7005('0x12')]=!![];};VoiceQueueReport[_0x7005('0xb')]['syncQueueCallerJoin']=function(_0x3e4221){try{if(this[_0x7005('0x63')](_0x3e4221)){logger['debug'](_0x7005('0x72'),_0x3e4221[_0x7005('0x43')],util['inspect'](_0x3e4221,{'showHidden':![],'depth':null}));if(_[_0x7005('0x64')](this[_0x7005('0x39')][_0x3e4221['uniqueid']]))this['queueReports'][_0x3e4221['uniqueid']]=[];if(_[_0x7005('0x64')](this[_0x7005('0x10')][_0x3e4221[_0x7005('0x43')]]))this[_0x7005('0x10')][_0x3e4221['uniqueid']]={};var _0x1e9ccf=new QueueReport();_0x1e9ccf['name']=_0x3e4221['queue'];_0x1e9ccf['type']=this[_0x7005('0x11')][_0x1e9ccf[_0x7005('0x44')]]&&this['voiceQueues'][_0x1e9ccf['name']][_0x7005('0x4d')]?this[_0x7005('0x11')][_0x1e9ccf[_0x7005('0x44')]]['type']||'inbound':_0x7005('0x4e');_0x1e9ccf[_0x7005('0x6b')]=_0x3e4221[_0x7005('0x6b')];_0x1e9ccf[_0x7005('0x73')]=moment()[_0x7005('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e9ccf[_0x7005('0x75')]=_0x3e4221[_0x7005('0x75')];_0x1e9ccf['count']=_0x3e4221[_0x7005('0x76')];_0x1e9ccf[_0x7005('0x43')]=_0x3e4221[_0x7005('0x43')];_0x1e9ccf[_0x7005('0x77')]=this['channels'][_0x3e4221[_0x7005('0x43')]][_0x7005('0x77')];logger[_0x7005('0x78')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1e9ccf[_0x7005('0x44')],_0x1e9ccf[_0x7005('0x4d')]);_[_0x7005('0x79')](_0x1e9ccf,_[_0x7005('0x7a')](_0x3e4221,_['keys'](_0x1e9ccf)));this['queueReports'][_0x3e4221[_0x7005('0x43')]]['push'](_0x1e9ccf);this[_0x7005('0x10')][_0x3e4221[_0x7005('0x43')]]=_0x1e9ccf;this[_0x7005('0x42')](_0x1e9ccf,_0x7005('0x19'));}}catch(_0x5882a1){logger[_0x7005('0x3a')](_0x7005('0x72'),_0x3e4221['uniqueid'],util[_0x7005('0x3c')](_0x5882a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')][_0x7005('0x1c')]=function(_0xa0f17d){try{if(this[_0x7005('0x63')](_0xa0f17d)){logger[_0x7005('0x46')](_0x7005('0x7b'),_0xa0f17d[_0x7005('0x43')],util[_0x7005('0x3c')](_0xa0f17d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xa0f17d[_0x7005('0x43')]]){var _0x5bfdeb=_[_0x7005('0x7c')](this[_0x7005('0x39')][_0xa0f17d[_0x7005('0x43')]]);_0x5bfdeb['queuecallercomplete']=![];_0x5bfdeb[_0x7005('0x7d')]=null;_0x5bfdeb[_0x7005('0x7e')]=_0xa0f17d[_0x7005('0x7e')];_0x5bfdeb['originalposition']=_0xa0f17d[_0x7005('0x7f')];_0x5bfdeb['queuecallerabandon']=!![];_0x5bfdeb[_0x7005('0x80')]=moment()[_0x7005('0x74')](_0x7005('0x81'));_0x5bfdeb['queuecallerexitreason']='ABANDONED';_0x5bfdeb[_0x7005('0x82')]=null;logger[_0x7005('0x78')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5bfdeb[_0x7005('0x44')],_0x5bfdeb[_0x7005('0x4d')]);this[_0x7005('0x10')][_0xa0f17d[_0x7005('0x43')]]=_0x5bfdeb;this['emitVoiceQueueChannelRemove'](_0x5bfdeb,_0x7005('0x1b'));}}}catch(_0x1728e1){logger[_0x7005('0x3a')]('[%s][voiceQueueReport][queuecallerabandon]',_0xa0f17d['uniqueid'],util[_0x7005('0x3c')](_0x1728e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')][_0x7005('0x83')]=function(_0x345684){try{if(this['isNotNull'](_0x345684)){logger[_0x7005('0x46')](_0x7005('0x84'),_0x345684['uniqueid'],util[_0x7005('0x3c')](_0x345684,{'showHidden':![],'depth':null}));if(this[_0x7005('0x39')][_0x345684['uniqueid']]){var _0x278057=_['last'](this[_0x7005('0x39')][_0x345684['uniqueid']]);_0x278057[_0x7005('0x85')]=moment()['format'](_0x7005('0x81'));_0x278057[_0x7005('0x86')]=_0x345684['connectedlinenum'];_0x278057['connectedlinename']=_0x345684['connectedlinename'];logger['info'](_0x7005('0x87'),_0x278057['name'],_0x278057[_0x7005('0x4d')],_0x345684[_0x7005('0x86')],_0x345684[_0x7005('0x88')]);this[_0x7005('0x10')][_0x345684[_0x7005('0x43')]]=_0x278057;this[_0x7005('0x42')](_0x278057,_0x7005('0x1d'));}}}catch(_0x3350ae){logger[_0x7005('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x345684[_0x7005('0x43')],util[_0x7005('0x3c')](_0x3350ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')]['syncAgentConnect']=function(_0x2853c7){try{if(this['isNotNull'](_0x2853c7)){logger[_0x7005('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x2853c7[_0x7005('0x43')],util[_0x7005('0x3c')](_0x2853c7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2853c7['uniqueid']]){var _0x184318=_['last'](this[_0x7005('0x39')][_0x2853c7[_0x7005('0x43')]]);_0x184318[_0x7005('0x89')]=!![];_0x184318[_0x7005('0x8a')]=_0x7005('0x8b');logger[_0x7005('0x78')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x184318[_0x7005('0x44')],_0x184318[_0x7005('0x4d')]);}}}catch(_0x11a1a6){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x2853c7[_0x7005('0x43')],util[_0x7005('0x3c')](_0x11a1a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')][_0x7005('0x1e')]=function(_0x3b9cfd){try{if(this[_0x7005('0x63')](_0x3b9cfd)){logger[_0x7005('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x3b9cfd['uniqueid'],util[_0x7005('0x3c')](_0x3b9cfd,{'showHidden':![],'depth':null}));if(this[_0x7005('0x39')][_0x3b9cfd[_0x7005('0x43')]]){var _0x68b92e=_[_0x7005('0x7c')](this['queueReports'][_0x3b9cfd[_0x7005('0x43')]]);_0x68b92e[_0x7005('0x1b')]=![];_0x68b92e[_0x7005('0x80')]=null;_0x68b92e[_0x7005('0x8c')]=!![];_0x68b92e[_0x7005('0x82')]=_0x3b9cfd['membername'];_0x68b92e['holdtime']=_0x3b9cfd[_0x7005('0x7e')];_0x68b92e['queuecallercomplete']=!![];_0x68b92e['queuecallerexit']=![];_0x68b92e['queuecallerexitAt']=null;if(!_0x68b92e['transfer']){if(_0x3b9cfd[_0x7005('0x8d')]==_0x7005('0x8e')){_0x68b92e[_0x7005('0x8a')]=_0x7005('0x8f');logger[_0x7005('0x78')](_0x7005('0x90'),_0x68b92e[_0x7005('0x44')],_0x68b92e['type']);}else{if(_['startsWith'](_0x3b9cfd['channel'][_0x7005('0x91')](),_0x7005('0x92'))){if(this[_0x7005('0x39')][_0x3b9cfd['linkedid']]){var _0xf9be53=_[_0x7005('0x7c')](this['queueReports'][_0x3b9cfd[_0x7005('0x93')]]);_0xf9be53[_0x7005('0x89')]=![];_0xf9be53['queuecallerexit']=!![];_0xf9be53[_0x7005('0x94')]=moment(_0x68b92e['queuecallerjoinAt'])[_0x7005('0x95')](_0x3b9cfd['holdtime'],_0x7005('0x96'))[_0x7005('0x74')](_0x7005('0x81'));_0xf9be53[_0x7005('0x8a')]=_0x7005('0x97');_0xf9be53[_0x7005('0x8e')]=!![];_0xf9be53[_0x7005('0x98')]='FORWARD';_0xf9be53['transferexten']=_0x3b9cfd[_0x7005('0x99')];_0xf9be53[_0x7005('0x9a')]=_0x3b9cfd[_0x7005('0x43')];logger[_0x7005('0x78')](_0x7005('0x9b'),_0xf9be53[_0x7005('0x44')],_0xf9be53[_0x7005('0x4d')]);var _0x3461d9=this[_0x7005('0x39')][_0x3b9cfd[_0x7005('0x93')]];this['queueReports'][_0x3b9cfd[_0x7005('0x93')]]=this[_0x7005('0x39')][_0x3b9cfd['uniqueid']];this[_0x7005('0x39')][_0x3b9cfd[_0x7005('0x43')]]=_0x3461d9;}}else{_0x68b92e['queuecallerexitreason']=_0x7005('0x9c')+_0x3b9cfd[_0x7005('0x8d')][_0x7005('0x9d')]();logger[_0x7005('0x78')](_0x7005('0x9e'),_0x68b92e[_0x7005('0x44')],_0x68b92e[_0x7005('0x4d')],_0x68b92e[_0x7005('0x8a')]);}}}this[_0x7005('0x10')][_0x3b9cfd[_0x7005('0x43')]]=_0x68b92e;this[_0x7005('0x40')](_0x68b92e,_0x7005('0x9f'));}}}catch(_0x2a96dd){logger[_0x7005('0x3a')](_0x7005('0xa0'),_0x3b9cfd[_0x7005('0x43')],util['inspect'](_0x2a96dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')][_0x7005('0x22')]=function(_0x19b89c){try{if(this[_0x7005('0x63')](_0x19b89c)){logger[_0x7005('0x46')](_0x7005('0xa1'),_0x19b89c[_0x7005('0x43')],util['inspect'](_0x19b89c,{'showHidden':![],'depth':null}));this[_0x7005('0xa2')](_0x19b89c[_0x7005('0x43')],_[_0x7005('0xa3')](_0x19b89c[_0x7005('0xa4')])[0x0],_0x19b89c[_0x7005('0xa5')]);if(this[_0x7005('0x39')][_0x19b89c[_0x7005('0x43')]]){var _0x336ed8=_[_0x7005('0x7c')](this[_0x7005('0x39')][_0x19b89c[_0x7005('0x43')]]);if(_0x336ed8){if(this[_0x7005('0x63')](_0x19b89c[_0x7005('0xa4')])&&this[_0x7005('0x63')](_0x19b89c['variable'][_0x7005('0xa6')])){switch(_0x19b89c[_0x7005('0xa5')]){case _0x7005('0xa7'):_0x336ed8[_0x7005('0xa8')]=![];_0x336ed8['queuecallerexitAt']=null;break;case'TIMEOUT':_0x336ed8[_0x7005('0xa9')]=_0x7005('0xaa');_0x336ed8[_0x7005('0xa8')]=!![];_0x336ed8['queuecallerexitAt']=moment()[_0x7005('0x74')](_0x7005('0x81'));_0x336ed8[_0x7005('0x85')]=moment()[_0x7005('0x74')](_0x7005('0x81'));logger[_0x7005('0x46')](_0x7005('0xab'),_0x19b89c['uniqueid'],util['inspect'](_0x336ed8,{'showHidden':![],'depth':null}));ami['emit'](_0x7005('0xac'),_0x336ed8);break;default:_0x336ed8[_0x7005('0xa8')]=!![];_0x336ed8[_0x7005('0x94')]=moment()[_0x7005('0x74')](_0x7005('0x81'));_0x336ed8[_0x7005('0x85')]=moment()[_0x7005('0x74')](_0x7005('0x81'));}_0x336ed8[_0x7005('0x1b')]=![];_0x336ed8['queuecallerabandonAt']=null;_0x336ed8[_0x7005('0x8a')]=_0x19b89c['value'];this[_0x7005('0x10')][_0x19b89c[_0x7005('0x43')]]=_0x336ed8;this['emitVoiceQueueChannelRemove'](_0x336ed8,_0x7005('0x21'));}else if(this[_0x7005('0x63')](_0x19b89c[_0x7005('0xa4')])&&this[_0x7005('0x63')](_0x19b89c[_0x7005('0xa4')][_0x7005('0xad')])){if(!_0x336ed8[_0x7005('0x1b')]){_0x336ed8['queuecallerexit']=!![];_0x336ed8[_0x7005('0x94')]=moment()[_0x7005('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x336ed8[_0x7005('0x8a')]=_0x7005('0xae');_0x336ed8[_0x7005('0x85')]=moment()[_0x7005('0x74')](_0x7005('0x81'));this['channels'][_0x19b89c[_0x7005('0x43')]]=_0x336ed8;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x19b89c[_0x7005('0x43')],_0x336ed8['name'],_0x336ed8[_0x7005('0x4d')],_[_0x7005('0xa3')](_0x19b89c[_0x7005('0xa4')])[0x0],_0x19b89c[_0x7005('0xa5')]);_0x336ed8[_0x7005('0x14')]=this[_0x7005('0x14')][_0x19b89c[_0x7005('0x43')]];}}}}catch(_0x3ad4ef){logger[_0x7005('0x3a')]('[%s][voiceQueueReport][varset]',_0x19b89c[_0x7005('0x43')],util[_0x7005('0x3c')](_0x3ad4ef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7005('0xb')]['addVariable']=function(_0x4eca03,_0x4b4df7,_0xfc3860){var _0x276973=['rtpaudioqos',_0x7005('0xaf'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x7005('0xb0'),_0x7005('0xb1'),_0x7005('0xb2'),_0x7005('0xb3'),_0x7005('0xb4'),'bridgepeer',_0x7005('0xb5'),_0x7005('0xb6'),_0x7005('0xb7'),_0x7005('0xb8'),'memberlastcall',_0x7005('0xb9'),_0x7005('0xba'),_0x7005('0xbb')];if(!_['isNil'](_0x4b4df7)&&!_[_0x7005('0xbc')](_0x276973,_0x4b4df7)){if(_[_0x7005('0x64')](this['variables'][_0x4eca03])){this[_0x7005('0x14')][_0x4eca03]={};}this[_0x7005('0x14')][_0x4eca03][_0x4b4df7]=_0xfc3860;}};VoiceQueueReport['prototype'][_0x7005('0xbd')]=function(_0x144ac2){try{if(this[_0x7005('0x63')](_0x144ac2)){logger[_0x7005('0x46')](_0x7005('0xbe'),_0x144ac2[_0x7005('0x43')],util['inspect'](_0x144ac2,{'showHidden':![],'depth':null}));if(this[_0x7005('0x39')][_0x144ac2['uniqueid']]){for(var _0x55933e=0x0,_0x9d6a3c={};_0x55933e=0x0?moment(_0x4af940[_0x8f5d('0x19')])[_0x8f5d('0xe')](_0x4af940[_0x8f5d('0x18')],_0x8f5d('0xf')):null,'data1':_0x8f5d('0x1a'),'data2':_0x4af940['accountcode'],'data3':_0x4af940[_0x8f5d('0x1b')],'data4':_0x4af940[_0x8f5d('0x1c')]||null,'role':_0x8f5d('0x13'),'internal':_0x4af940['accountcode']?_[_0x8f5d('0x14')](_0x4af940[_0x8f5d('0x15')]):undefined,'uniqueid':_0x4af940['uniqueid']},'log':_0x8f5d('0x6')});}; \ No newline at end of file +var _0xe828=['Request','CreateMemberReport','voice','isNil','interface','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','toNumber','accountcode','uniqueid','membername','starttime','endtime','diff','outbound','dialstring','moment','lodash','../client','queuecallercompleteAt','queuecallerexitAt'];(function(_0x184ed1,_0x57db13){var _0x3aecc2=function(_0x1f2c81){while(--_0x1f2c81){_0x184ed1['push'](_0x184ed1['shift']());}};_0x3aecc2(++_0x57db13);}(_0xe828,0x78));var _0x8e82=function(_0x42c560,_0x51587f){_0x42c560=_0x42c560-0x0;var _0x4c0730=_0xe828[_0x42c560];return _0x4c0730;};'use strict';var moment=require(_0x8e82('0x0'));var _=require(_0x8e82('0x1'));var util=require('util');var client=require(_0x8e82('0x2'));exports['voiceQueueReport']=function(_0x1959fa){var _0x182ddb=_0x1959fa[_0x8e82('0x3')]||_0x1959fa[_0x8e82('0x4')];return client[_0x8e82('0x5')](_0x8e82('0x6'),{'body':{'channel':_0x8e82('0x7'),'membername':_0x1959fa['lastAssignedTo'],'interface':_[_0x8e82('0x8')](_0x1959fa[_0x8e82('0x9')])?util['format']('SIP/%s',_0x1959fa['lastAssignedTo']):_0x1959fa['interface'],'type':_0x8e82('0xa'),'enterAt':_0x1959fa[_0x8e82('0xb')],'exitAt':_0x182ddb,'duration':moment(_0x182ddb)['diff'](_0x1959fa[_0x8e82('0xb')],_0x8e82('0xc')),'data1':_0x8e82('0xd'),'data2':_0x1959fa[_0x8e82('0xe')],'data3':_0x1959fa[_0x8e82('0xf')],'data4':null,'data5':_0x1959fa['queue'],'role':'agent','internal':_0x1959fa['accountcode']?_[_0x8e82('0x10')](_0x1959fa[_0x8e82('0x11')]):undefined,'uniqueid':_0x1959fa[_0x8e82('0x12')]},'log':_0x8e82('0x6')});};exports['voiceDialReport']=function(_0x3bbc76){return client[_0x8e82('0x5')](_0x8e82('0x6'),{'body':{'channel':'voice','membername':_0x3bbc76[_0x8e82('0x13')],'interface':_0x3bbc76[_0x8e82('0x9')],'type':_0x8e82('0xa'),'enterAt':_0x3bbc76[_0x8e82('0x14')],'exitAt':_0x3bbc76['endtime'],'duration':moment(_0x3bbc76[_0x8e82('0x15')])['diff'](_0x3bbc76[_0x8e82('0x14')],'seconds')>=0x0?moment(_0x3bbc76[_0x8e82('0x15')])[_0x8e82('0x16')](_0x3bbc76['starttime'],_0x8e82('0xc')):null,'data1':_0x8e82('0x17'),'data2':_0x3bbc76[_0x8e82('0x11')],'data3':_0x3bbc76['exten'],'data4':_0x3bbc76[_0x8e82('0x18')]||null,'role':'agent','internal':_0x3bbc76[_0x8e82('0x11')]?_[_0x8e82('0x10')](_0x3bbc76[_0x8e82('0x11')]):undefined,'uniqueid':_0x3bbc76[_0x8e82('0x12')]},'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 108b747..cb80379 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 _0x53e6=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x3b2c8e,_0x53910b){var _0x3ebe3d=function(_0x57220b){while(--_0x57220b){_0x3b2c8e['push'](_0x3b2c8e['shift']());}};_0x3ebe3d(++_0x53910b);}(_0x53e6,0x178));var _0x653e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x53e6[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x653e('0x0'));exports[_0x653e('0x1')]=function(){return client[_0x653e('0x2')](_0x653e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x653e('0x4'),'previewRecallmeReminderInterval']},'log':_0x653e('0x5')});}; \ No newline at end of file +var _0xbbce=['GetSettings','../client','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x2e2928,_0x341b5e){var _0xfbd810=function(_0x5eeb35){while(--_0x5eeb35){_0x2e2928['push'](_0x2e2928['shift']());}};_0xfbd810(++_0x341b5e);}(_0xbbce,0xb0));var _0xebbc=function(_0xcdbde7,_0x427580){_0xcdbde7=_0xcdbde7-0x0;var _0x288747=_0xbbce[_0xcdbde7];return _0x288747;};'use strict';var client=require(_0xebbc('0x0'));exports['getSettings']=function(){return client['Request'](_0xebbc('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xebbc('0x2'),_0xebbc('0x3')]},'log':_0xebbc('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 06012db..abf8b71 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 _0xdc35=['GetTemplate','html','../client','Request'];(function(_0x3c213e,_0x408607){var _0x30fddf=function(_0x3c7c4d){while(--_0x3c7c4d){_0x3c213e['push'](_0x3c213e['shift']());}};_0x30fddf(++_0x408607);}(_0xdc35,0xd6));var _0x5dc3=function(_0x434597,_0x2ec353){_0x434597=_0x434597-0x0;var _0x59a00c=_0xdc35[_0x434597];return _0x59a00c;};'use strict';var client=require(_0x5dc3('0x0'));exports['getTemplates']=function(_0x3be9c5){return function(_0x146eb8){return client[_0x5dc3('0x1')](_0x5dc3('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x5dc3('0x3')]},'log':_0x5dc3('0x2')});};}; \ No newline at end of file +var _0xe6f1=['getTemplates','GetTemplate','name','html'];(function(_0x30266b,_0x10b076){var _0x1de8bb=function(_0x4beae2){while(--_0x4beae2){_0x30266b['push'](_0x30266b['shift']());}};_0x1de8bb(++_0x10b076);}(_0xe6f1,0x1d4));var _0x1e6f=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0xe6f1[_0x47643e];return _0x2aa5db;};'use strict';var client=require('../client');exports[_0x1e6f('0x0')]=function(_0xe57391){return function(_0x1a3aae){return client['Request'](_0x1e6f('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1e6f('0x2'),_0x1e6f('0x3')]},'log':_0x1e6f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 98f35d7..5b14bf5 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 _0xafb0=['data6','data7','../client','getTriggers','Request','name','channel','Condition','operator','AnyConditions','field','value','Action','data1','data2','data4','data5'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0xafb0,0xdf));var _0x0afb=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xafb0[_0x256b72];return _0x2183e3;};'use strict';var client=require(_0x0afb('0x0'));exports[_0x0afb('0x1')]=function(_0x51dc8f){return function(_0x46a380){return client[_0x0afb('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x0afb('0x3'),_0x0afb('0x4'),'status'],'include':[{'model':_0x0afb('0x5'),'as':'AllConditions','attributes':['id','field',_0x0afb('0x6'),'value']},{'model':_0x0afb('0x5'),'as':_0x0afb('0x7'),'attributes':['id',_0x0afb('0x8'),_0x0afb('0x6'),_0x0afb('0x9')]},{'model':_0x0afb('0xa'),'as':'Actions','attributes':['id','action',_0x0afb('0xb'),_0x0afb('0xc'),'data3',_0x0afb('0xd'),_0x0afb('0xe'),_0x0afb('0xf'),_0x0afb('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xac7e=['operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','getTriggers','Request','name','channel','status','Condition','field'];(function(_0x4628d9,_0x38afc3){var _0x35b4c1=function(_0x4da87d){while(--_0x4da87d){_0x4628d9['push'](_0x4628d9['shift']());}};_0x35b4c1(++_0x38afc3);}(_0xac7e,0xe0));var _0xeac7=function(_0x26dd44,_0x2ca86e){_0x26dd44=_0x26dd44-0x0;var _0x14ae7f=_0xac7e[_0x26dd44];return _0x14ae7f;};'use strict';var client=require('../client');exports[_0xeac7('0x0')]=function(_0x441753){return function(_0x5914b3){return client[_0xeac7('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xeac7('0x2'),_0xeac7('0x3'),_0xeac7('0x4')],'include':[{'model':_0xeac7('0x5'),'as':'AllConditions','attributes':['id',_0xeac7('0x6'),_0xeac7('0x7'),'value']},{'model':_0xeac7('0x5'),'as':_0xeac7('0x8'),'attributes':['id','field',_0xeac7('0x7'),_0xeac7('0x9')]},{'model':_0xeac7('0xa'),'as':_0xeac7('0xb'),'attributes':['id',_0xeac7('0xc'),_0xeac7('0xd'),_0xeac7('0xe'),_0xeac7('0xf'),_0xeac7('0x10'),_0xeac7('0x11'),_0xeac7('0x12'),_0xeac7('0x13')]}]},'log':_0xeac7('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 294dbe8..1a686b2 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 _0xcd56=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0xdfd788,_0x2c4cbb){var _0x1e0c32=function(_0x2b60a8){while(--_0x2b60a8){_0xdfd788['push'](_0xdfd788['shift']());}};_0x1e0c32(++_0x2c4cbb);}(_0xcd56,0x1c9));var _0x6cd5=function(_0x54b8d0,_0x5c61ad){_0x54b8d0=_0x54b8d0-0x0;var _0x6a6642=_0xcd56[_0x54b8d0];return _0x6a6642;};'use strict';var client=require(_0x6cd5('0x0'));exports[_0x6cd5('0x1')]=function(_0x18a407){return function(_0x536401){return client[_0x6cd5('0x2')](_0x6cd5('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6cd5('0x4'),_0x6cd5('0x5'),_0x6cd5('0x6')]},'log':_0x6cd5('0x3')});};}; \ No newline at end of file +var _0xb268=['defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x357ed8,_0x54fbad){var _0x290d09=function(_0x1487bd){while(--_0x1487bd){_0x357ed8['push'](_0x357ed8['shift']());}};_0x290d09(++_0x54fbad);}(_0xb268,0x114));var _0x8b26=function(_0x1f3c71,_0x4a7589){_0x1f3c71=_0x1f3c71-0x0;var _0x582b9f=_0xb268[_0x1f3c71];return _0x582b9f;};'use strict';var client=require(_0x8b26('0x0'));exports[_0x8b26('0x1')]=function(_0x77e2ac){return function(_0x1074ef){return client[_0x8b26('0x2')](_0x8b26('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x8b26('0x4')]},'log':_0x8b26('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index baefe2b..16d63c1 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x18a9d3,_0x1c7243){var _0x5a3861=function(_0x103be7){while(--_0x103be7){_0x18a9d3['push'](_0x18a9d3['shift']());}};_0x5a3861(++_0x1c7243);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x330f86,_0x576a8b){var _0x45b5af=function(_0x59d72c){while(--_0x59d72c){_0x330f86['push'](_0x330f86['shift']());}};_0x45b5af(++_0x576a8b);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 8939f5e..aeb44d3 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 _0xf776=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x43e489,_0x309c03){var _0x4a5078=function(_0x30828a){while(--_0x30828a){_0x43e489['push'](_0x43e489['shift']());}};_0x4a5078(++_0x309c03);}(_0xf776,0x16d));var _0x6f77=function(_0x3cb9a6,_0x5186ce){_0x3cb9a6=_0x3cb9a6-0x0;var _0x1e359c=_0xf776[_0x3cb9a6];return _0x1e359c;};'use strict';var client=require(_0x6f77('0x0'));exports[_0x6f77('0x1')]=function(_0x196a15){return client[_0x6f77('0x2')]('CreateVoiceAgentReport',{'body':_0x196a15,'log':_0x6f77('0x3')});};exports[_0x6f77('0x4')]=function(_0x37b2db,_0x330e87,_0x463b85){return client['Request'](_0x6f77('0x5'),{'body':_0x37b2db,'options':{'where':{'uniqueid':_0x330e87,'interface':_0x463b85,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xba5c=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x22c50e,_0x4ea131){var _0x500f85=function(_0x412f7b){while(--_0x412f7b){_0x22c50e['push'](_0x22c50e['shift']());}};_0x500f85(++_0x4ea131);}(_0xba5c,0x92));var _0xcba5=function(_0x4c144a,_0x32b9ef){_0x4c144a=_0x4c144a-0x0;var _0x48075e=_0xba5c[_0x4c144a];return _0x48075e;};'use strict';var client=require(_0xcba5('0x0'));exports[_0xcba5('0x1')]=function(_0x4fc3fd){return client['Request']('CreateVoiceAgentReport',{'body':_0x4fc3fd,'log':_0xcba5('0x2')});};exports[_0xcba5('0x3')]=function(_0x2ba642,_0xc99714,_0x320360){return client[_0xcba5('0x4')](_0xcba5('0x5'),{'body':_0x2ba642,'options':{'where':{'uniqueid':_0xc99714,'interface':_0x320360,'agentcomplete':!![]}},'log':_0xcba5('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2418f12..72a94cc 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 _0x3c43=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf'];(function(_0x57737a,_0x37ca56){var _0x3e1f3a=function(_0x29caec){while(--_0x29caec){_0x57737a['push'](_0x57737a['shift']());}};_0x3e1f3a(++_0x37ca56);}(_0x3c43,0x1bf));var _0x33c4=function(_0x2e7f52,_0x587b0f){_0x2e7f52=_0x2e7f52-0x0;var _0x28079e=_0x3c43[_0x2e7f52];return _0x28079e;};'use strict';var moment=require(_0x33c4('0x0'));var util=require('util');var _=require(_0x33c4('0x1'));var client=require(_0x33c4('0x2'));exports[_0x33c4('0x3')]=function(_0x6bc837){return client[_0x33c4('0x4')](_0x33c4('0x5'),{'body':_[_0x33c4('0x6')](_0x6bc837,{'source':_0x6bc837[_0x33c4('0x7')],'destinationcontext':_0x6bc837[_0x33c4('0x8')],'callerid':_0x6bc837[_0x33c4('0x9')],'amaflags':_0x33c4('0xa')}),'log':_0x33c4('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x33c4('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x33c4('0xc')]('day')[_0x33c4('0xd')](_0x33c4('0xe')),moment()[_0x33c4('0xf')](_0x33c4('0x10'))[_0x33c4('0xd')](_0x33c4('0xe'))]}},'attributes':[_0x33c4('0x11'),_0x33c4('0x12'),'duration','billableseconds']},'log':_0x33c4('0x13')});};}; \ No newline at end of file +var _0xed03=['GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed03,0x1d8));var _0x3ed0=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xed03[_0x40bffc];return _0x3007e9;};'use strict';var moment=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var _=require(_0x3ed0('0x2'));var client=require(_0x3ed0('0x3'));exports['create']=function(_0xadedb9){return client[_0x3ed0('0x4')](_0x3ed0('0x5'),{'body':_[_0x3ed0('0x6')](_0xadedb9,{'source':_0xadedb9[_0x3ed0('0x7')],'destinationcontext':_0xadedb9[_0x3ed0('0x8')],'callerid':_0xadedb9[_0x3ed0('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x3ed0('0x5')});};exports[_0x3ed0('0xa')]=function(){return function(){return client[_0x3ed0('0x4')](_0x3ed0('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3ed0('0xc')]('day')[_0x3ed0('0xd')](_0x3ed0('0xe')),moment()[_0x3ed0('0xf')](_0x3ed0('0x10'))[_0x3ed0('0xd')](_0x3ed0('0xe'))]}},'attributes':[_0x3ed0('0x11'),_0x3ed0('0x12'),_0x3ed0('0x13'),'billableseconds']},'log':_0x3ed0('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 41e5766..bbc41a8 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 _0x0e0d=['create','Request','CreateVoiceDialReport','../client'];(function(_0x11e11c,_0x4e088e){var _0x8ffaa4=function(_0x3cf37a){while(--_0x3cf37a){_0x11e11c['push'](_0x11e11c['shift']());}};_0x8ffaa4(++_0x4e088e);}(_0x0e0d,0xd7));var _0xd0e0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0e0d[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xd0e0('0x0'));exports[_0xd0e0('0x1')]=function(_0x3ec8cb){return client[_0xd0e0('0x2')](_0xd0e0('0x3'),{'body':_0x3ec8cb,'log':_0xd0e0('0x3')});}; \ No newline at end of file +var _0xe425=['create','Request','../client'];(function(_0x2844b8,_0x14c8fe){var _0x531858=function(_0x1396e2){while(--_0x1396e2){_0x2844b8['push'](_0x2844b8['shift']());}};_0x531858(++_0x14c8fe);}(_0xe425,0xe9));var _0x5e42=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0xe425[_0x5ebe34];return _0x36a3ee;};'use strict';var client=require(_0x5e42('0x0'));exports[_0x5e42('0x1')]=function(_0x1d0197){return client[_0x5e42('0x2')]('CreateVoiceDialReport',{'body':_0x1d0197,'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 d479189..6ec3dd4 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 _0x750a=['exten','recordingFormat','getVoiceExtensions'];(function(_0x1b8265,_0x189645){var _0x325383=function(_0x52e5ee){while(--_0x52e5ee){_0x1b8265['push'](_0x1b8265['shift']());}};_0x325383(++_0x189645);}(_0x750a,0x140));var _0xa750=function(_0x5e4cd5,_0x168b84){_0x5e4cd5=_0x5e4cd5-0x0;var _0x3806ee=_0x750a[_0x5e4cd5];return _0x3806ee;};'use strict';var client=require('../client');exports[_0xa750('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa750('0x1'),_0xa750('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xa750('0x0')});};}; \ No newline at end of file +var _0x1491=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x1491,0x1b1));var _0x1149=function(_0x31dff6,_0x3b2578){_0x31dff6=_0x31dff6-0x0;var _0x3a3998=_0x1491[_0x31dff6];return _0x3a3998;};'use strict';var client=require(_0x1149('0x0'));exports[_0x1149('0x1')]=function(){return function(){return client[_0x1149('0x2')](_0x1149('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x1149('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x1149('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1236a32..0350555 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 _0x055a=['dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x055a,0xae));var _0xa055=function(_0x19fbdc,_0x2e1d6a){_0x19fbdc=_0x19fbdc-0x0;var _0x176533=_0x055a[_0x19fbdc];return _0x176533;};'use strict';var client=require(_0xa055('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xa055('0x1')](_0xa055('0x2'),{'options':{'raw':![],'attributes':['id',_0xa055('0x3'),_0xa055('0x4'),_0xa055('0x5'),_0xa055('0x6'),'monitor_format','type',_0xa055('0x7'),_0xa055('0x8'),_0xa055('0x9'),'dialLimitQueue',_0xa055('0xa'),'dialPredictiveOptimization',_0xa055('0xb'),_0xa055('0xc'),_0xa055('0xd'),_0xa055('0xe'),_0xa055('0xf'),_0xa055('0x10'),_0xa055('0x11'),'dialQueueProject',_0xa055('0x12'),_0xa055('0x13'),_0xa055('0x14'),_0xa055('0x15'),_0xa055('0x16'),_0xa055('0x17'),_0xa055('0x18'),_0xa055('0x19'),_0xa055('0x1a'),_0xa055('0x1b'),_0xa055('0x1c'),'dialAMDActive',_0xa055('0x1d'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xa055('0x1e'),_0xa055('0x1f'),_0xa055('0x20'),_0xa055('0x21'),_0xa055('0x22'),_0xa055('0x23'),_0xa055('0x24'),_0xa055('0x25'),_0xa055('0x26'),_0xa055('0x27'),_0xa055('0x28'),_0xa055('0x29'),_0xa055('0x2a'),_0xa055('0x2b'),_0xa055('0x2c'),_0xa055('0x2d'),'dialCutDigit',_0xa055('0x2e'),_0xa055('0x2f'),_0xa055('0x30'),'dialDropRetryFrequency',_0xa055('0x31'),_0xa055('0x32'),_0xa055('0x33'),_0xa055('0x34'),_0xa055('0x35'),_0xa055('0x36'),_0xa055('0x37'),_0xa055('0x38'),'dialPredictiveIntervalMinThreshold',_0xa055('0x39'),_0xa055('0x3a')],'include':[{'model':'Trunk','as':_0xa055('0x3b'),'attributes':['id',_0xa055('0x3'),_0xa055('0x3c'),_0xa055('0x3d')]},{'model':'Pause','as':_0xa055('0x3e'),'attributes':['id',_0xa055('0x3')]},{'model':_0xa055('0x3b'),'as':'TrunkBackup','attributes':['id','name','callerid',_0xa055('0x3d')]},{'model':'Interval','as':_0xa055('0x3f'),'attributes':['id',_0xa055('0x3')],'include':[{'model':_0xa055('0x3f'),'as':'Intervals','attributes':['id','name',_0xa055('0x40')]}]}]},'log':_0xa055('0x41')});};}; \ No newline at end of file +var _0x0dda=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x0dda,0x126));var _0xa0dd=function(_0x483e77,_0x433e9b){_0x483e77=_0x483e77-0x0;var _0x359df0=_0x0dda[_0x483e77];return _0x359df0;};'use strict';var client=require('../client');exports[_0xa0dd('0x0')]=function(){return function(){return client[_0xa0dd('0x1')](_0xa0dd('0x2'),{'options':{'raw':![],'attributes':['id',_0xa0dd('0x3'),_0xa0dd('0x4'),'acwTimeout',_0xa0dd('0x5'),'monitor_format','type','dialActive',_0xa0dd('0x6'),_0xa0dd('0x7'),_0xa0dd('0x8'),'dialPowerLevel',_0xa0dd('0x9'),_0xa0dd('0xa'),_0xa0dd('0xb'),_0xa0dd('0xc'),_0xa0dd('0xd'),_0xa0dd('0xe'),_0xa0dd('0xf'),'dialQueueTimeout',_0xa0dd('0x10'),'dialCongestionMaxRetry',_0xa0dd('0x11'),_0xa0dd('0x12'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xa0dd('0x13'),'dialGlobalMaxRetry',_0xa0dd('0x14'),'dialGlobalInterval',_0xa0dd('0x15'),'dialCheckDuplicateType','dialAMDActive',_0xa0dd('0x16'),_0xa0dd('0x17'),_0xa0dd('0x18'),_0xa0dd('0x19'),_0xa0dd('0x1a'),'dialAMDBetweenWordsSilence',_0xa0dd('0x1b'),_0xa0dd('0x1c'),_0xa0dd('0x1d'),'timeout',_0xa0dd('0x1e'),_0xa0dd('0x1f'),'dialOrderByScheduledAt',_0xa0dd('0x20'),_0xa0dd('0x21'),_0xa0dd('0x22'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0xa0dd('0x23'),'dialNoSuchNumberMaxRetry',_0xa0dd('0x24'),'dialDropMaxRetry',_0xa0dd('0x25'),_0xa0dd('0x26'),_0xa0dd('0x27'),_0xa0dd('0x28'),_0xa0dd('0x29'),_0xa0dd('0x2a'),_0xa0dd('0x2b'),'mandatoryDisposition',_0xa0dd('0x2c'),_0xa0dd('0x2d'),_0xa0dd('0x2e'),_0xa0dd('0x2f')],'include':[{'model':_0xa0dd('0x30'),'as':_0xa0dd('0x30'),'attributes':['id',_0xa0dd('0x3'),_0xa0dd('0x31'),'active']},{'model':'Pause','as':_0xa0dd('0x32'),'attributes':['id',_0xa0dd('0x3')]},{'model':_0xa0dd('0x30'),'as':_0xa0dd('0x33'),'attributes':['id',_0xa0dd('0x3'),_0xa0dd('0x31'),_0xa0dd('0x34')]},{'model':'Interval','as':'Interval','attributes':['id',_0xa0dd('0x3')],'include':[{'model':_0xa0dd('0x35'),'as':_0xa0dd('0x36'),'attributes':['id',_0xa0dd('0x3'),_0xa0dd('0x37')]}]}]},'log':_0xa0dd('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index c5facce..d3f16f5 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(_0x1625b1,_0x403ba1){var _0x2e6fb1=function(_0x130a3e){while(--_0x130a3e){_0x1625b1['push'](_0x1625b1['shift']());}};_0x2e6fb1(++_0x403ba1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x5029c1,_0x3f5768){var _0xa41b9=function(_0x5569cd){while(--_0x5569cd){_0x5029c1['push'](_0x5029c1['shift']());}};_0xa41b9(++_0x3f5768);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 f219d31..22c721a 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 _0x609c=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x3daee4,_0x529a65){var _0x2d5901=function(_0x47aa40){while(--_0x47aa40){_0x3daee4['push'](_0x3daee4['shift']());}};_0x2d5901(++_0x529a65);}(_0x609c,0x71));var _0xc609=function(_0x3e5dae,_0x2f8088){_0x3e5dae=_0x3e5dae-0x0;var _0x1287ee=_0x609c[_0x3e5dae];return _0x1287ee;};'use strict';var client=require(_0xc609('0x0'));exports[_0xc609('0x1')]=function(_0x324862){return function(){return client[_0xc609('0x2')](_0xc609('0x3'),{'options':{'where':{'VoiceQueueId':_0x324862,'paused':!![]},'raw':!![]},'log':_0xc609('0x1')});};}; \ No newline at end of file +var _0x5d04=['GetVoiceQueueRtPauses','../client','Request'];(function(_0x325c3a,_0x265296){var _0x1dce0f=function(_0x581413){while(--_0x581413){_0x325c3a['push'](_0x325c3a['shift']());}};_0x1dce0f(++_0x265296);}(_0x5d04,0x6d));var _0x45d0=function(_0x5e2eac,_0x3d057a){_0x5e2eac=_0x5e2eac-0x0;var _0x3ab57f=_0x5d04[_0x5e2eac];return _0x3ab57f;};'use strict';var client=require(_0x45d0('0x0'));exports['getVoiceQueueRtPauses']=function(_0xf229bb){return function(){return client[_0x45d0('0x1')](_0x45d0('0x2'),{'options':{'where':{'VoiceQueueId':_0xf229bb,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8385d7f..b6d75e5 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(_0x1377fd,_0x46b556){var _0x2951ed=function(_0x25b143){while(--_0x25b143){_0x1377fd['push'](_0x1377fd['shift']());}};_0x2951ed(++_0x46b556);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x1b14ab,_0x3e6107){var _0xf93a5e=function(_0x2be192){while(--_0x2be192){_0x1b14ab['push'](_0x1b14ab['shift']());}};_0xf93a5e(++_0x3e6107);}(_0x7a54,0x106));var _0x47a5=function(_0xa15d98,_0x2a0158){_0xa15d98=_0xa15d98-0x0;var _0x119adc=_0x7a54[_0xa15d98];return _0x119adc;};'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 8a51d8e..8c3cd1a 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 _0x7d76=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7d76,0x8b));var _0x67d7=function(_0x5b76c1,_0x453a02){_0x5b76c1=_0x5b76c1-0x0;var _0x356c65=_0x7d76[_0x5b76c1];return _0x356c65;};'use strict';var client=require(_0x67d7('0x0'));exports[_0x67d7('0x1')]={};exports['blindTransfer']=function(_0x1a67f5){return client['Request'](_0x67d7('0x2'),{'body':{'result':_0x1a67f5[_0x67d7('0x3')],'transfererchannel':_0x1a67f5['transfererchannel'],'transferercalleridnum':_0x1a67f5[_0x67d7('0x4')],'transferercalleridname':_0x1a67f5[_0x67d7('0x5')],'transfererconnectedlinenum':_0x1a67f5[_0x67d7('0x6')],'transfererconnectedlinename':_0x1a67f5[_0x67d7('0x7')],'transfereraccountcode':_0x1a67f5['transfereraccountcode'],'transferercontext':_0x1a67f5[_0x67d7('0x8')],'transfererexten':_0x1a67f5[_0x67d7('0x9')],'transfererlinkedid':_0x1a67f5['transfererlinkedid'],'transfereechannel':_0x1a67f5[_0x67d7('0xa')],'transfereecalleridnum':_0x1a67f5[_0x67d7('0xb')],'transfereecalleridname':_0x1a67f5[_0x67d7('0xc')],'transfereeconnectedlinenum':_0x1a67f5[_0x67d7('0xd')],'transfereeconnectedlinename':_0x1a67f5['transfereeconnectedlinename'],'transfereeaccountcode':_0x1a67f5[_0x67d7('0xe')],'transfereecontext':_0x1a67f5[_0x67d7('0xf')],'transfereeexten':_0x1a67f5[_0x67d7('0x10')],'transfereelinkedid':_0x1a67f5[_0x67d7('0x11')],'isexternal':_0x1a67f5['isexternal'],'context':_0x1a67f5[_0x67d7('0x12')],'extension':_0x1a67f5[_0x67d7('0x13')],'type':'blind'},'log':_0x67d7('0x2')});};exports[_0x67d7('0x14')]=function(_0x7d3388){return client[_0x67d7('0x15')](_0x67d7('0x2'),{'body':{'result':_0x7d3388[_0x67d7('0x3')],'transfererchannel':_0x7d3388['origtransfererchannel'],'transferercalleridnum':_0x7d3388[_0x67d7('0x16')],'transferercalleridname':_0x7d3388[_0x67d7('0x17')],'transfererconnectedlinenum':_0x7d3388[_0x67d7('0x18')],'transfererconnectedlinename':_0x7d3388[_0x67d7('0x19')],'transfereraccountcode':_0x7d3388[_0x67d7('0x1a')],'transferercontext':_0x7d3388[_0x67d7('0x1b')],'transfererexten':_0x7d3388[_0x67d7('0x1c')],'transfererlinkedid':_0x7d3388['origtransfererlinkedid'],'transfereechannel':_0x7d3388[_0x67d7('0x1d')],'transfereecalleridnum':_0x7d3388[_0x67d7('0x1e')],'transfereecalleridname':_0x7d3388[_0x67d7('0x1f')],'transfereeconnectedlinenum':_0x7d3388[_0x67d7('0x20')],'transfereeconnectedlinename':_0x7d3388[_0x67d7('0x21')],'transfereeaccountcode':_0x7d3388[_0x67d7('0x22')],'transfereecontext':_0x7d3388[_0x67d7('0x23')],'transfereeexten':_0x7d3388[_0x67d7('0x24')],'transfereelinkedid':_0x7d3388[_0x67d7('0x25')],'isexternal':_0x7d3388[_0x67d7('0x26')],'context':_0x7d3388[_0x67d7('0x27')],'extension':_0x7d3388[_0x67d7('0x28')],'type':_0x67d7('0x29')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x0727=['transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0727,0x6b));var _0x7072=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x0727[_0x2f32c4];return _0x95b5dc;};'use strict';var client=require('../client');exports[_0x7072('0x0')]={};exports[_0x7072('0x1')]=function(_0x50134f){return client[_0x7072('0x2')](_0x7072('0x3'),{'body':{'result':_0x50134f[_0x7072('0x4')],'transfererchannel':_0x50134f[_0x7072('0x5')],'transferercalleridnum':_0x50134f[_0x7072('0x6')],'transferercalleridname':_0x50134f[_0x7072('0x7')],'transfererconnectedlinenum':_0x50134f[_0x7072('0x8')],'transfererconnectedlinename':_0x50134f[_0x7072('0x9')],'transfereraccountcode':_0x50134f['transfereraccountcode'],'transferercontext':_0x50134f['transferercontext'],'transfererexten':_0x50134f[_0x7072('0xa')],'transfererlinkedid':_0x50134f[_0x7072('0xb')],'transfereechannel':_0x50134f[_0x7072('0xc')],'transfereecalleridnum':_0x50134f[_0x7072('0xd')],'transfereecalleridname':_0x50134f['transfereecalleridname'],'transfereeconnectedlinenum':_0x50134f[_0x7072('0xe')],'transfereeconnectedlinename':_0x50134f[_0x7072('0xf')],'transfereeaccountcode':_0x50134f['transfereeaccountcode'],'transfereecontext':_0x50134f[_0x7072('0x10')],'transfereeexten':_0x50134f[_0x7072('0x11')],'transfereelinkedid':_0x50134f[_0x7072('0x12')],'isexternal':_0x50134f[_0x7072('0x13')],'context':_0x50134f['context'],'extension':_0x50134f[_0x7072('0x14')],'type':_0x7072('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x7072('0x16')]=function(_0x568a2a){return client[_0x7072('0x2')](_0x7072('0x3'),{'body':{'result':_0x568a2a[_0x7072('0x4')],'transfererchannel':_0x568a2a[_0x7072('0x17')],'transferercalleridnum':_0x568a2a[_0x7072('0x18')],'transferercalleridname':_0x568a2a['origtransferercalleridname'],'transfererconnectedlinenum':_0x568a2a[_0x7072('0x19')],'transfererconnectedlinename':_0x568a2a[_0x7072('0x1a')],'transfereraccountcode':_0x568a2a[_0x7072('0x1b')],'transferercontext':_0x568a2a['secondtransferercontext'],'transfererexten':_0x568a2a['secondtransfererexten'],'transfererlinkedid':_0x568a2a[_0x7072('0x1c')],'transfereechannel':_0x568a2a[_0x7072('0x1d')],'transfereecalleridnum':_0x568a2a[_0x7072('0x1e')],'transfereecalleridname':_0x568a2a[_0x7072('0x1f')],'transfereeconnectedlinenum':_0x568a2a[_0x7072('0x20')],'transfereeconnectedlinename':_0x568a2a[_0x7072('0x21')],'transfereeaccountcode':_0x568a2a[_0x7072('0x22')],'transfereecontext':_0x568a2a[_0x7072('0x23')],'transfereeexten':_0x568a2a[_0x7072('0x24')],'transfereelinkedid':_0x568a2a[_0x7072('0x25')],'isexternal':_0x568a2a[_0x7072('0x13')],'context':_0x568a2a[_0x7072('0x26')],'extension':_0x568a2a['origtransfererexten'],'type':_0x7072('0x27')},'log':_0x7072('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 3d78fb1..f4b1e22 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 _0x0a6b=['asterisk','ami\x20disconnected','pick','keys','module','Action','then','message','catch','isConnected','username','join','command','action','content','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','voicechannel','validate','map','uniqueid','channel','format','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','channels','resolve','StopMixMonitor','destinationchannel','stop','toLowerCase','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','../../../config/environment','../properties','../ami','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error'];(function(_0x1d60d0,_0x2cfa88){var _0x1a0917=function(_0x24dc91){while(--_0x24dc91){_0x1d60d0['push'](_0x1d60d0['shift']());}};_0x1a0917(++_0x2cfa88);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x2a8c6b,_0x3cfa71){_0x2a8c6b=_0x2a8c6b-0x0;var _0x2fb943=_0x0a6b[_0x2a8c6b];return _0x2fb943;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0xb0a6('0x1'));var moment=require('moment');var config=require(_0xb0a6('0x2'));var properties=require(_0xb0a6('0x3'));var ami=require(_0xb0a6('0x4'));exports['listen']=function(_0x102ecd,_0x4cc3ae,_0xbbdf89){return new BPromise(function(_0x415e9e,_0x5e2d2d){var _0x11cd5b={'QueuePause':function(_0x24515c){return new Promise(function(_0x2a8516,_0x530c05){var _0x47c553=util['format'](_0xb0a6('0x5'),_0xb0a6('0x6'),_0x24515c[_0xb0a6('0x7')]);if(_0x102ecd[_0xb0a6('0x8')]&&_0x102ecd['timers'][_0x47c553]&&_0x102ecd[_0xb0a6('0x8')][_0x47c553][_0xb0a6('0x9')]){_0x102ecd['timers'][_0x47c553][_0xb0a6('0xa')]();}if(_0x102ecd[_0xb0a6('0xb')][_0x47c553]){_0x102ecd[_0xb0a6('0xb')][_0x47c553][_0xb0a6('0xc')]({'statePause':_0x24515c[_0xb0a6('0xd')]?!![]:![]});}_0x2a8516({'code':0xc8,'message':_0xb0a6('0xe')});});},'Reload':function(_0x3d607f){var _0x425b97=this;return new Promise(function(_0x392f48,_0x151387){if(ami['isConnected']()==![]){return _0x151387(_0x425b97[_0xb0a6('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xb0a6('0x10')]['username'],_0xb0a6('0x11')]['join']('\x20')));}_0x3d607f=_[_0xb0a6('0x12')](_0x3d607f,_[_0xb0a6('0x13')](properties[_0xb0a6('0x14')]));_0x3d607f['action']='Reload';return ami[_0xb0a6('0x15')](_0x3d607f)[_0xb0a6('0x16')](function(_0x59bc9c){_0x392f48({'code':0xc8,'message':_0x59bc9c[_0xb0a6('0x17')]});})[_0xb0a6('0x18')](function(_0x13a1c8){_0x151387(_0x425b97['error'](0x1f5,_0x13a1c8[_0xb0a6('0x17')]));});});},'Command':function(_0x883503){var _0x372457=this;return new Promise(function(_0xdc5de1,_0x4406d0){if(ami[_0xb0a6('0x19')]()==![]){return _0x4406d0(_0x372457['error'](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}_0x883503=_[_0xb0a6('0x12')](_0x883503,_0xb0a6('0x1c'));_0x883503[_0xb0a6('0x1d')]='Command';return ami[_0xb0a6('0x15')](_0x883503)['then'](function(_0x1322ec){_0xdc5de1({'code':0xc8,'message':_0x1322ec[_0xb0a6('0x1e')]});})['catch'](function(_0x4aa68d){_0x4406d0(_0x372457[_0xb0a6('0xf')](0x1f5,_0x4aa68d[_0xb0a6('0x17')]));});});},'VoiceQueues':function(_0x5eb0ed){return new Promise(function(_0x3ea787,_0x24574a){var _0x259f47=[];for(var _0x5b19c1 in _0x102ecd['voiceQueues']){if(_0x102ecd['voiceQueues'][_0xb0a6('0x1f')](_0x5b19c1)){var _0x1e9947=_0x102ecd[_0xb0a6('0x20')][_0x5b19c1];var _0x58d923={'id':_0x1e9947['id'],'name':_0x1e9947[_0xb0a6('0x7')],'strategy':_0x1e9947[_0xb0a6('0x21')],'answered':_0x1e9947[_0xb0a6('0x22')],'available':_0x1e9947[_0xb0a6('0x23')],'loggedIn':_0x1e9947[_0xb0a6('0x24')],'pTalking':_0x1e9947[_0xb0a6('0x25')],'sumBillable':_0x1e9947[_0xb0a6('0x26')],'sumDuration':_0x1e9947[_0xb0a6('0x27')],'sumHoldTime':_0x1e9947[_0xb0a6('0x28')]||0x0,'talking':_0x1e9947['talking'],'total':_0x1e9947[_0xb0a6('0x29')],'type':_0x1e9947[_0xb0a6('0x2a')],'unmanaged':_0x1e9947[_0xb0a6('0x2b')],'abandoned':_0x1e9947['abandoned'],'waiting':_0x1e9947[_0xb0a6('0x2c')],'loggedInDb':_0x1e9947['loggedInDb']};if(_0x1e9947[_0xb0a6('0x2a')]===_0xb0a6('0x2d')){_0x58d923[_0xb0a6('0x2e')]=_0x1e9947[_0xb0a6('0x2e')];_0x58d923[_0xb0a6('0x2f')]=_0x1e9947[_0xb0a6('0x2f')];_0x58d923[_0xb0a6('0x30')]=_0x1e9947[_0xb0a6('0x30')];_0x58d923[_0xb0a6('0x31')]=_0x1e9947[_0xb0a6('0x31')];_0x58d923['dialOriginateTimeout']=_0x1e9947['dialOriginateTimeout'];_0x58d923[_0xb0a6('0x32')]=_0x1e9947[_0xb0a6('0x32')];_0x58d923[_0xb0a6('0x33')]=_0x1e9947[_0xb0a6('0x33')];_0x58d923[_0xb0a6('0x34')]=_0x1e9947[_0xb0a6('0x34')];_0x58d923[_0xb0a6('0x35')]=_0x1e9947[_0xb0a6('0x35')];_0x58d923['outboundBlacklistCallsDay']=_0x1e9947[_0xb0a6('0x36')];_0x58d923[_0xb0a6('0x37')]=_0x1e9947['outboundBusyCallsDay'];_0x58d923[_0xb0a6('0x38')]=_0x1e9947[_0xb0a6('0x38')];_0x58d923['outboundDropCallsDayACS']=_0x1e9947['outboundDropCallsDayACS'];_0x58d923[_0xb0a6('0x39')]=_0x1e9947[_0xb0a6('0x39')];_0x58d923[_0xb0a6('0x3a')]=_0x1e9947[_0xb0a6('0x3a')];_0x58d923[_0xb0a6('0x3b')]=_0x1e9947[_0xb0a6('0x3b')];_0x58d923['outboundNoSuchCallsDay']=_0x1e9947[_0xb0a6('0x3c')];_0x58d923['outboundOriginateFailureCallsDay']=_0x1e9947[_0xb0a6('0x3d')];_0x58d923[_0xb0a6('0x3e')]=_0x1e9947['outboundReCallsDay'];_0x58d923['outboundRejectCallsDay']=_0x1e9947['outboundRejectCallsDay'];_0x58d923[_0xb0a6('0x3f')]=_0x1e9947[_0xb0a6('0x3f')];_0x58d923[_0xb0a6('0x40')]=_0x1e9947[_0xb0a6('0x40')];_0x58d923[_0xb0a6('0x41')]=_0x1e9947['predictiveIntervalAvgHoldtime'];_0x58d923[_0xb0a6('0x42')]=_0x1e9947[_0xb0a6('0x42')];_0x58d923[_0xb0a6('0x43')]=_0x1e9947[_0xb0a6('0x43')];_0x58d923['predictiveIntervalDroppedCallsTimeout']=_0x1e9947[_0xb0a6('0x44')];_0x58d923[_0xb0a6('0x45')]=_0x1e9947[_0xb0a6('0x45')];_0x58d923[_0xb0a6('0x46')]=_0x1e9947[_0xb0a6('0x46')];_0x58d923['predictiveIntervalHitRate']=_0x1e9947['predictiveIntervalHitRate'];_0x58d923[_0xb0a6('0x47')]=_0x1e9947[_0xb0a6('0x47')];_0x58d923[_0xb0a6('0x48')]=_0x1e9947[_0xb0a6('0x48')];_0x58d923[_0xb0a6('0x49')]=_0x1e9947[_0xb0a6('0x49')];_0x58d923[_0xb0a6('0x4a')]=_0x1e9947[_0xb0a6('0x4a')];_0x58d923['message']=_0x1e9947[_0xb0a6('0x17')];_0x58d923[_0xb0a6('0x4b')]=_0x1e9947[_0xb0a6('0x4b')];_0x58d923[_0xb0a6('0x4c')]=_0x1e9947[_0xb0a6('0x4c')];_0x58d923['erlangCallToSecond']=_0x1e9947[_0xb0a6('0x4d')];_0x58d923['erlangAbandonmentRate']=_0x1e9947[_0xb0a6('0x4e')];_0x58d923['erlangBusyFactor']=_0x1e9947[_0xb0a6('0x4f')];_0x58d923['startPredictive']=_0x1e9947[_0xb0a6('0x50')];_0x58d923[_0xb0a6('0x51')]=_0x1e9947[_0xb0a6('0x51')];}if(_0x1e9947[_0xb0a6('0x52')]){_0x58d923[_0xb0a6('0x52')]={'id':_0x1e9947[_0xb0a6('0x52')]['id'],'name':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x7')],'active':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x53')],'callerid':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x54')]};}if(_0x1e9947['Interval']){_0x58d923[_0xb0a6('0x55')]={'id':_0x1e9947[_0xb0a6('0x55')]['id'],'name':_0x1e9947['Interval'][_0xb0a6('0x7')]};}_0x259f47['push'](_0x58d923);}}_0x3ea787({'count':_0x259f47[_0xb0a6('0x56')],'rows':_0x259f47});});},'UpdateVoiceQueue':function(_0x34df60){return new Promise(function(_0x2ef974,_0x4e29ad){var _0x74a665=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x20')],{'id':parseInt(_0x34df60['id'])});var _0x29b7ec=_[_0xb0a6('0x58')](_0x34df60,['id']);if(_0x74a665){for(var _0x2cb5f6 in _0x29b7ec){if(typeof _0x29b7ec[_0x2cb5f6]!==_0xb0a6('0x59')&&typeof _0x74a665[_0x2cb5f6]!==_0xb0a6('0x59')){_0x74a665[_0x2cb5f6]=_0x29b7ec[_0x2cb5f6];}}_0x2ef974(_0x74a665);}else{_0x4e29ad();}});},'VoiceChannels':function(_0x5a87a2){return new Promise(function(_0x256be3,_0x38644a){var _0x47645a=_[_0xb0a6('0x5a')](_0x102ecd['channels']);_0x256be3({'count':_0x47645a['length'],'rows':_0x47645a});});},'VoiceChannelMixMonitor':function(_0x51bd2e){var _0x5b8dd3=this;return new Promise(function(_0x4fb43a,_0x5dd778){if(ami['isConnected']()==![]){return _0x5dd778(_0x5b8dd3[_0xb0a6('0xf')](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}var _0x13e34c=schema(properties[_0xb0a6('0x5b')])[_0xb0a6('0x5c')](_0x51bd2e);if(_0x13e34c[_0xb0a6('0x56')]>0x0){return _0x5dd778(_0x5b8dd3[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x13e34c,_0xb0a6('0x17'))[_0xb0a6('0x1b')](',\x20')));}var _0x3871ed=_[_0xb0a6('0x57')](_0x102ecd['channels'],{'uniqueid':_0x51bd2e[_0xb0a6('0x5e')]});if(_0x3871ed&&_0x3871ed[_0xb0a6('0x5f')]){var _0x1a628a=util[_0xb0a6('0x60')](_0xb0a6('0x61'),_0x51bd2e[_0xb0a6('0x62')]||_0x51bd2e[_0xb0a6('0x5e')],_0x51bd2e[_0xb0a6('0x60')]||_0xb0a6('0x63'));return ami['Action']({'action':'MixMonitor','channel':_0x3871ed[_0xb0a6('0x5f')],'file':_0x1a628a,'options':_0xb0a6('0x64')})[_0xb0a6('0x16')](function(_0x549c69){var _0x3504e8=_['find'](_0x3871ed[_0xb0a6('0x65')],{'filename':_0xb0a6('0x66')+_0x1a628a['toLowerCase']()});if(_[_0xb0a6('0x67')](_0x3504e8)){_0x3871ed[_0xb0a6('0x65')]['push']({'filename':_0xb0a6('0x66')+_0x1a628a['toLowerCase'](),'createdAt':moment()[_0xb0a6('0x60')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x549c69[_0xb0a6('0x68')],'status':_0xb0a6('0x69')});}else{_0x3504e8['mixmonitorid']=_0x549c69[_0xb0a6('0x68')];_0x3504e8[_0xb0a6('0x6a')]=_0xb0a6('0x69');}_0x4fb43a({'code':0xc8,'message':[_0x51bd2e[_0xb0a6('0x5e')],_0xb0a6('0x6b'),_0x549c69['mixmonitorid']][_0xb0a6('0x1b')]('\x20'),'mixmonitorid':_0x549c69['mixmonitorid']});})[_0xb0a6('0x18')](function(_0x569ce3){_0x5dd778(_0x5b8dd3['error'](0x1f5,[_0x51bd2e[_0xb0a6('0x5e')],_0x569ce3[_0xb0a6('0x17')]['toLowerCase']()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x5dd778(_0x5b8dd3['error'](0x1f5,_0xb0a6('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x3a8d71){var _0xd9eec6=this;return new Promise(function(_0x229666,_0x59fb5a){if(ami[_0xb0a6('0x19')]()==![]){return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')]['join']('\x20')));}var _0x4e6072=schema(properties[_0xb0a6('0x5b')])['validate'](_0x3a8d71);if(_0x4e6072[_0xb0a6('0x56')]>0x0){return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x4e6072,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x2eae42=_['find'](_0x102ecd[_0xb0a6('0x6d')],{'uniqueid':_0x3a8d71[_0xb0a6('0x5e')]});if(_0x2eae42){return BPromise[_0xb0a6('0x6e')]()[_0xb0a6('0x16')](function(){if(_0x2eae42[_0xb0a6('0x5f')]){return ami['Action']({'action':_0xb0a6('0x6f'),'channel':_0x2eae42[_0xb0a6('0x5f')],'mixmonitorid':_0x3a8d71['mixmonitorid']})[_0xb0a6('0x18')](function(_0x3f197a){});}})[_0xb0a6('0x16')](function(){if(_0x2eae42[_0xb0a6('0x70')]){return ami[_0xb0a6('0x15')]({'action':_0xb0a6('0x6f'),'channel':_0x2eae42[_0xb0a6('0x70')],'mixmonitorid':_0x3a8d71[_0xb0a6('0x68')]})[_0xb0a6('0x18')](function(_0x112ba1){});}})[_0xb0a6('0x16')](function(_0x1046e){var _0x53c9e9=_[_0xb0a6('0x57')](_0x2eae42['monitors'],{'mixmonitorid':_0x3a8d71[_0xb0a6('0x68')]});if(_0x53c9e9){_0x53c9e9[_0xb0a6('0x6a')]=_0xb0a6('0x71');}})[_0xb0a6('0x16')](function(){var _0x49ea98=util[_0xb0a6('0x60')](_0xb0a6('0x61'),_0x3a8d71[_0xb0a6('0x62')]||_0x3a8d71[_0xb0a6('0x5e')],_0x3a8d71[_0xb0a6('0x60')]||_0xb0a6('0x63'));var _0x35dd17=_[_0xb0a6('0x57')](_0x2eae42[_0xb0a6('0x65')],{'filename':_0xb0a6('0x66')+_0x49ea98[_0xb0a6('0x72')]()});if(_0x35dd17){_0x35dd17[_0xb0a6('0x6a')]=_0xb0a6('0x71');}})[_0xb0a6('0x16')](function(){_0x229666({'code':0xc8,'message':[_0x3a8d71[_0xb0a6('0x5e')],_0xb0a6('0x73')][_0xb0a6('0x1b')]('\x20')});})[_0xb0a6('0x18')](function(_0x4bafe5){_0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f5,[_0x3a8d71[_0xb0a6('0x5e')],_0x4bafe5[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x49a7fa){return new Promise(function(_0x1b343f,_0x229442){var _0xf7f5f1=_[_0xb0a6('0x5a')](_0x102ecd['queueChannels']);_0x1b343f({'count':_0xf7f5f1[_0xb0a6('0x56')],'rows':_0xf7f5f1});});},'VoiceQueuesChannel':function(_0x17ed27){var _0x38fd56=this;return new Promise(function(_0x1069fe,_0x3143de){var _0x265a02=schema(properties[_0xb0a6('0x74')])['validate'](_0x17ed27);if(_0x265a02[_0xb0a6('0x56')]>0x0){return _0x3143de(_0x38fd56[_0xb0a6('0xf')](0x1f4,_['map'](_0x265a02,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x4aa3a3=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x17ed27[_0xb0a6('0x5e')]});if(_0x4aa3a3){_0x1069fe(_0x4aa3a3);}else{return _0x3143de(_0x38fd56[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x173e2b){var _0x5c77b6=this;return new Promise(function(_0x3b3272,_0x35ef32){if(ami['isConnected']()==![]){return _0x35ef32(_0x5c77b6['error'](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],'ami\x20disconnected']['join']('\x20')));}var _0x567fd9=schema(properties[_0xb0a6('0x76')])['validate'](_0x173e2b);if(_0x567fd9[_0xb0a6('0x56')]>0x0){return _0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x567fd9,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x165787=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x173e2b[_0xb0a6('0x5e')]});if(_0x165787&&_0x165787[_0xb0a6('0x5f')]){return ami[_0xb0a6('0x15')]({'action':'Hangup','channel':_0x165787['channel']})[_0xb0a6('0x16')](function(_0x310aca){_0x3b3272({'code':0xc8,'message':[_0x173e2b[_0xb0a6('0x5e')],_0x310aca[_0xb0a6('0x17')]['toLowerCase']()]['join']('\x20')});})[_0xb0a6('0x18')](function(_0x336d67){_0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f5,[_0x173e2b[_0xb0a6('0x5e')],_0x336d67[_0xb0a6('0x17')]['toLowerCase']()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x177101){var _0x1e8395=this;return new Promise(function(_0x1dc58c,_0x42634d){if(ami[_0xb0a6('0x19')]()==![]){return _0x42634d(_0x1e8395[_0xb0a6('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}var _0x34b2f3=schema(properties['voicequeuechannelredirect'])['validate'](_0x177101);if(_0x34b2f3[_0xb0a6('0x56')]>0x0){return _0x42634d(_0x1e8395['error'](0x1f4,_[_0xb0a6('0x5d')](_0x34b2f3,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x5717b4=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x177101[_0xb0a6('0x5e')]});if(_0x5717b4&&_0x5717b4[_0xb0a6('0x5f')]){return ami[_0xb0a6('0x15')]({'action':_0xb0a6('0x77'),'channel':_0x5717b4[_0xb0a6('0x5f')],'exten':_0x177101[_0xb0a6('0x78')],'context':_0x177101[_0xb0a6('0x79')]||_0x5717b4[_0xb0a6('0x79')],'priority':0x1})['then'](function(_0x48ae58){_0x1dc58c({'code':0xc8,'message':[_0x177101['uniqueid'],_0x48ae58[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')});})[_0xb0a6('0x18')](function(_0x51b473){_0x42634d(_0x1e8395[_0xb0a6('0xf')](0x1f5,[_0x177101[_0xb0a6('0x5e')],_0x51b473[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x42634d(_0x1e8395['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3d0933){return new Promise(function(_0x33fd7e,_0x16987b){var _0x1f0679=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0xb')]);_0x33fd7e({'count':_0x1f0679['length'],'rows':_0x1f0679});});},'Telephones':function(_0x5817ac){return new Promise(function(_0x482c07,_0x292189){var _0x40cd4d=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7a')]);_0x482c07({'count':_0x40cd4d[_0xb0a6('0x56')],'rows':_0x40cd4d});});},'Trunks':function(_0x167303){return new Promise(function(_0xb2e56,_0x554df7){var _0x1bd0ec=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7b')]);_0xb2e56({'count':_0x1bd0ec[_0xb0a6('0x56')],'rows':_0x1bd0ec});});},'OutboundChannels':function(_0x420373){return new Promise(function(_0x449b28,_0x5c20de){var _0x25ccb3=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7c')]);_0x449b28({'count':_0x25ccb3[_0xb0a6('0x56')],'rows':_0x25ccb3});});},'Outbound':function(_0x46e4cd){return new Promise(function(_0x1dbf28,_0x1afa65){_0x1dbf28(_0x102ecd['outbound']);});},'Campaigns':function(_0x45d2e){return new Promise(function(_0x51eec3,_0xe43851){var _0x5e5c45=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7d')]);_0x51eec3({'count':_0x5e5c45[_0xb0a6('0x56')],'rows':_0x5e5c45});});},'VoiceQueuesPreview':function(_0x463773){var _0x40dbac=this;return new Promise(function(_0x99fbff,_0x20c9d9){_0x4cc3ae[_0xb0a6('0x7e')](_0x463773['id'])['then'](function(_0x24620e){_0x99fbff({'code':0xc8,'message':_0x24620e[_0xb0a6('0x17')]});})['catch'](function(_0x18bca8){_0x20c9d9(_0x40dbac[_0xb0a6('0xf')](0x1f4,_0x18bca8['message']));});});},'EventManager':function(_0x490f61){var _0x13cdd9=this;return new Promise(function(_0x5cc789,_0x3b4130){if(!_0x490f61[_0xb0a6('0x7f')]){return _0x3b4130(_0x13cdd9[_0xb0a6('0xf')](0x1f4,_0xb0a6('0x80')));}ami[_0xb0a6('0x81')](_0xb0a6('0x82')+_0x490f61['event'],_0x490f61[_0xb0a6('0x17')]);_0x5cc789({'code':0xc8,'message':_0x490f61});});},'FaxAccounts':function(_0x412888){return new Promise(function(_0x5f29a2,_0x4fbdba){var _0xc729cd=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x83')]);_0x5f29a2({'count':_0xc729cd[_0xb0a6('0x56')],'rows':_0xc729cd});});},'SendFax':function(_0x281665){var _0x3322d9=this;return new Promise(function(_0x47d4f7,_0x1ae3d8){_0xbbdf89['send'](_0x281665)[_0xb0a6('0x16')](function(_0x22b44f){_0x47d4f7({'code':0xc8,'message':_0x22b44f[_0xb0a6('0x17')]});})['catch'](function(_0x579f57){_0x1ae3d8(_0x3322d9['error'](0x1f4,_0x579f57[_0xb0a6('0x17')]));});});},'CheckAfterSend':function(_0xf07039){var _0x34a64c=this;return new Promise(function(_0x361c0c,_0x2c639e){_0xbbdf89[_0xb0a6('0x84')](_0xf07039)[_0xb0a6('0x16')](function(_0x102f30){_0x361c0c({'code':0xc8,'message':_0x102f30[_0xb0a6('0x17')]});})[_0xb0a6('0x18')](function(_0x7e0357){_0x2c639e(_0x34a64c[_0xb0a6('0xf')](0x1f4,_0x7e0357[_0xb0a6('0x17')]));});});}};var _0x2c5d71=jayson['server'](_0x11cd5b)[_0xb0a6('0x85')]();_0x2c5d71['on']('error',function(_0x29bebb){return _0x5e2d2d(_0x29bebb);});_0x2c5d71[_0xb0a6('0x86')](0x232a,'127.0.0.1',function(){console[_0xb0a6('0x87')](_0xb0a6('0x88'),0x232a);return _0x415e9e(_0xb0a6('0x89')+0x232a);});});}; \ No newline at end of file +var _0xf970=['erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','length','omit','values','channels','voicechannel','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','find','monitors','toLowerCase','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','Reload','Action','then','message','catch','username','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x327610,_0x326884){var _0x1ceeae=function(_0x5e7897){while(--_0x5e7897){_0x327610['push'](_0x327610['shift']());}};_0x1ceeae(++_0x326884);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var jayson=require(_0x0f97('0x1'));var schema=require(_0x0f97('0x2'));var BPromise=require(_0x0f97('0x3'));var moment=require(_0x0f97('0x4'));var config=require(_0x0f97('0x5'));var properties=require(_0x0f97('0x6'));var ami=require(_0x0f97('0x7'));exports['listen']=function(_0xc822e8,_0x1698c4,_0x290200){return new BPromise(function(_0xac501,_0x2e3515){var _0x3244a6={'QueuePause':function(_0x12fbb3){return new Promise(function(_0x374083,_0x2891f7){var _0x5598eb=util['format'](_0x0f97('0x8'),'SIP',_0x12fbb3[_0x0f97('0x9')]);if(_0xc822e8[_0x0f97('0xa')]&&_0xc822e8[_0x0f97('0xa')][_0x5598eb]&&_0xc822e8['timers'][_0x5598eb][_0x0f97('0xb')]){_0xc822e8['timers'][_0x5598eb][_0x0f97('0xc')]();}if(_0xc822e8[_0x0f97('0xd')][_0x5598eb]){_0xc822e8[_0x0f97('0xd')][_0x5598eb][_0x0f97('0xe')]({'statePause':_0x12fbb3[_0x0f97('0xf')]?!![]:![]});}_0x374083({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x56d310){var _0x2b586a=this;return new Promise(function(_0x4544b4,_0xa35fd){if(ami[_0x0f97('0x10')]()==![]){return _0xa35fd(_0x2b586a[_0x0f97('0x11')](0x1f4,[config[_0x0f97('0x12')]['ip'],config['asterisk']['username'],_0x0f97('0x13')][_0x0f97('0x14')]('\x20')));}_0x56d310=_[_0x0f97('0x15')](_0x56d310,_[_0x0f97('0x16')](properties['module']));_0x56d310['action']=_0x0f97('0x17');return ami[_0x0f97('0x18')](_0x56d310)[_0x0f97('0x19')](function(_0x185ba3){_0x4544b4({'code':0xc8,'message':_0x185ba3[_0x0f97('0x1a')]});})[_0x0f97('0x1b')](function(_0x5059ad){_0xa35fd(_0x2b586a['error'](0x1f5,_0x5059ad[_0x0f97('0x1a')]));});});},'Command':function(_0x132d2f){var _0x3b547f=this;return new Promise(function(_0x425d97,_0x398216){if(ami[_0x0f97('0x10')]()==![]){return _0x398216(_0x3b547f['error'](0x1f4,[config[_0x0f97('0x12')]['ip'],config[_0x0f97('0x12')][_0x0f97('0x1c')],_0x0f97('0x13')][_0x0f97('0x14')]('\x20')));}_0x132d2f=_[_0x0f97('0x15')](_0x132d2f,_0x0f97('0x1d'));_0x132d2f['action']=_0x0f97('0x1e');return ami[_0x0f97('0x18')](_0x132d2f)[_0x0f97('0x19')](function(_0x5c2af0){_0x425d97({'code':0xc8,'message':_0x5c2af0[_0x0f97('0x1f')]});})[_0x0f97('0x1b')](function(_0x4ec6d0){_0x398216(_0x3b547f[_0x0f97('0x11')](0x1f5,_0x4ec6d0[_0x0f97('0x1a')]));});});},'VoiceQueues':function(_0x4ef5bc){return new Promise(function(_0x489e1e,_0x51aa82){var _0x406e24=[];for(var _0x22eb53 in _0xc822e8['voiceQueues']){if(_0xc822e8[_0x0f97('0x20')][_0x0f97('0x21')](_0x22eb53)){var _0x30a715=_0xc822e8[_0x0f97('0x20')][_0x22eb53];var _0x10f71c={'id':_0x30a715['id'],'name':_0x30a715[_0x0f97('0x9')],'strategy':_0x30a715[_0x0f97('0x22')],'answered':_0x30a715[_0x0f97('0x23')],'available':_0x30a715[_0x0f97('0x24')],'loggedIn':_0x30a715[_0x0f97('0x25')],'pTalking':_0x30a715[_0x0f97('0x26')],'sumBillable':_0x30a715['sumBillable'],'sumDuration':_0x30a715[_0x0f97('0x27')],'sumHoldTime':_0x30a715[_0x0f97('0x28')]||0x0,'talking':_0x30a715[_0x0f97('0x29')],'total':_0x30a715[_0x0f97('0x2a')],'type':_0x30a715[_0x0f97('0x2b')],'unmanaged':_0x30a715[_0x0f97('0x2c')],'abandoned':_0x30a715[_0x0f97('0x2d')],'waiting':_0x30a715[_0x0f97('0x2e')],'loggedInDb':_0x30a715['loggedInDb']};if(_0x30a715['type']===_0x0f97('0x2f')){_0x10f71c[_0x0f97('0x30')]=_0x30a715[_0x0f97('0x30')];_0x10f71c[_0x0f97('0x31')]=_0x30a715[_0x0f97('0x31')];_0x10f71c[_0x0f97('0x32')]=_0x30a715[_0x0f97('0x32')];_0x10f71c[_0x0f97('0x33')]=_0x30a715[_0x0f97('0x33')];_0x10f71c[_0x0f97('0x34')]=_0x30a715[_0x0f97('0x34')];_0x10f71c['dialPrefix']=_0x30a715[_0x0f97('0x35')];_0x10f71c[_0x0f97('0x36')]=_0x30a715[_0x0f97('0x36')];_0x10f71c[_0x0f97('0x37')]=_0x30a715[_0x0f97('0x37')];_0x10f71c['outboundAnswerCallsDay']=_0x30a715[_0x0f97('0x38')];_0x10f71c['outboundBlacklistCallsDay']=_0x30a715[_0x0f97('0x39')];_0x10f71c['outboundBusyCallsDay']=_0x30a715[_0x0f97('0x3a')];_0x10f71c[_0x0f97('0x3b')]=_0x30a715[_0x0f97('0x3b')];_0x10f71c[_0x0f97('0x3c')]=_0x30a715[_0x0f97('0x3c')];_0x10f71c['outboundDropCallsDayCallersExit']=_0x30a715['outboundDropCallsDayCallersExit'];_0x10f71c[_0x0f97('0x3d')]=_0x30a715[_0x0f97('0x3d')];_0x10f71c['outboundNoAnswerCallsDay']=_0x30a715[_0x0f97('0x3e')];_0x10f71c[_0x0f97('0x3f')]=_0x30a715[_0x0f97('0x3f')];_0x10f71c[_0x0f97('0x40')]=_0x30a715['outboundOriginateFailureCallsDay'];_0x10f71c[_0x0f97('0x41')]=_0x30a715[_0x0f97('0x41')];_0x10f71c[_0x0f97('0x42')]=_0x30a715[_0x0f97('0x42')];_0x10f71c[_0x0f97('0x43')]=_0x30a715['outboundUnknownCallsDay'];_0x10f71c[_0x0f97('0x44')]=_0x30a715[_0x0f97('0x44')];_0x10f71c[_0x0f97('0x45')]=_0x30a715[_0x0f97('0x45')];_0x10f71c[_0x0f97('0x46')]=_0x30a715[_0x0f97('0x46')];_0x10f71c['predictiveIntervalDroppedCallsCallersExit']=_0x30a715['predictiveIntervalDroppedCallsCallersExit'];_0x10f71c[_0x0f97('0x47')]=_0x30a715[_0x0f97('0x47')];_0x10f71c[_0x0f97('0x48')]=_0x30a715['predictiveIntervalErlangCalls'];_0x10f71c[_0x0f97('0x49')]=_0x30a715[_0x0f97('0x49')];_0x10f71c[_0x0f97('0x4a')]=_0x30a715['predictiveIntervalHitRate'];_0x10f71c[_0x0f97('0x4b')]=_0x30a715[_0x0f97('0x4b')];_0x10f71c[_0x0f97('0x4c')]=_0x30a715[_0x0f97('0x4c')];_0x10f71c[_0x0f97('0x4d')]=_0x30a715[_0x0f97('0x4d')];_0x10f71c[_0x0f97('0x4e')]=_0x30a715[_0x0f97('0x4e')];_0x10f71c[_0x0f97('0x1a')]=_0x30a715[_0x0f97('0x1a')];_0x10f71c[_0x0f97('0x4f')]=_0x30a715['originated'];_0x10f71c[_0x0f97('0x50')]=_0x30a715[_0x0f97('0x50')];_0x10f71c['erlangCallToSecond']=_0x30a715[_0x0f97('0x51')];_0x10f71c['erlangAbandonmentRate']=_0x30a715[_0x0f97('0x52')];_0x10f71c[_0x0f97('0x53')]=_0x30a715[_0x0f97('0x53')];_0x10f71c['startPredictive']=_0x30a715['startPredictive'];_0x10f71c[_0x0f97('0x54')]=_0x30a715[_0x0f97('0x54')];}if(_0x30a715[_0x0f97('0x55')]){_0x10f71c[_0x0f97('0x55')]={'id':_0x30a715[_0x0f97('0x55')]['id'],'name':_0x30a715['Trunk']['name'],'active':_0x30a715[_0x0f97('0x55')][_0x0f97('0x56')],'callerid':_0x30a715[_0x0f97('0x55')][_0x0f97('0x57')]};}if(_0x30a715[_0x0f97('0x58')]){_0x10f71c[_0x0f97('0x58')]={'id':_0x30a715[_0x0f97('0x58')]['id'],'name':_0x30a715[_0x0f97('0x58')][_0x0f97('0x9')]};}_0x406e24['push'](_0x10f71c);}}_0x489e1e({'count':_0x406e24[_0x0f97('0x59')],'rows':_0x406e24});});},'UpdateVoiceQueue':function(_0x5eef4a){return new Promise(function(_0x16ef4d,_0x16be67){var _0xd246c1=_['find'](_0xc822e8['voiceQueues'],{'id':parseInt(_0x5eef4a['id'])});var _0x3bbdbc=_[_0x0f97('0x5a')](_0x5eef4a,['id']);if(_0xd246c1){for(var _0x40ea51 in _0x3bbdbc){if(typeof _0x3bbdbc[_0x40ea51]!=='undefined'&&typeof _0xd246c1[_0x40ea51]!=='undefined'){_0xd246c1[_0x40ea51]=_0x3bbdbc[_0x40ea51];}}_0x16ef4d(_0xd246c1);}else{_0x16be67();}});},'VoiceChannels':function(_0x546aac){return new Promise(function(_0xa32a1d,_0x3cdbee){var _0x1871b6=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x5c')]);_0xa32a1d({'count':_0x1871b6[_0x0f97('0x59')],'rows':_0x1871b6});});},'VoiceChannelMixMonitor':function(_0xe87bfc){var _0x248189=this;return new Promise(function(_0x1c342d,_0x21c8b4){if(ami[_0x0f97('0x10')]()==![]){return _0x21c8b4(_0x248189['error'](0x1f4,[config[_0x0f97('0x12')]['ip'],config['asterisk']['username'],_0x0f97('0x13')]['join']('\x20')));}var _0x1a2f25=schema(properties[_0x0f97('0x5d')])[_0x0f97('0x2')](_0xe87bfc);if(_0x1a2f25[_0x0f97('0x59')]>0x0){return _0x21c8b4(_0x248189[_0x0f97('0x11')](0x1f4,_['map'](_0x1a2f25,'message')[_0x0f97('0x14')](',\x20')));}var _0xf5fedc=_['find'](_0xc822e8[_0x0f97('0x5c')],{'uniqueid':_0xe87bfc[_0x0f97('0x5e')]});if(_0xf5fedc&&_0xf5fedc[_0x0f97('0x5f')]){var _0x31e96a=util['format'](_0x0f97('0x60'),_0xe87bfc[_0x0f97('0x61')]||_0xe87bfc[_0x0f97('0x5e')],_0xe87bfc[_0x0f97('0x62')]||_0x0f97('0x63'));return ami[_0x0f97('0x18')]({'action':_0x0f97('0x64'),'channel':_0xf5fedc[_0x0f97('0x5f')],'file':_0x31e96a,'options':_0x0f97('0x65')})[_0x0f97('0x19')](function(_0x29d47b){var _0x736610=_[_0x0f97('0x66')](_0xf5fedc[_0x0f97('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x31e96a[_0x0f97('0x68')]()});if(_['isNil'](_0x736610)){_0xf5fedc[_0x0f97('0x67')][_0x0f97('0x69')]({'filename':_0x0f97('0x6a')+_0x31e96a['toLowerCase'](),'createdAt':moment()[_0x0f97('0x62')](_0x0f97('0x6b')),'mixmonitorid':_0x29d47b[_0x0f97('0x6c')],'status':'rec'});}else{_0x736610['mixmonitorid']=_0x29d47b['mixmonitorid'];_0x736610['status']=_0x0f97('0x6d');}_0x1c342d({'code':0xc8,'message':[_0xe87bfc[_0x0f97('0x5e')],_0x0f97('0x6e'),_0x29d47b['mixmonitorid']][_0x0f97('0x14')]('\x20'),'mixmonitorid':_0x29d47b['mixmonitorid']});})[_0x0f97('0x1b')](function(_0xc1f29e){_0x21c8b4(_0x248189[_0x0f97('0x11')](0x1f5,[_0xe87bfc[_0x0f97('0x5e')],_0xc1f29e[_0x0f97('0x1a')][_0x0f97('0x68')]()][_0x0f97('0x14')]('\x20')));});}else{return _0x21c8b4(_0x248189[_0x0f97('0x11')](0x1f5,_0x0f97('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x59a646){var _0x2e2103=this;return new Promise(function(_0xbd80c1,_0x406210){if(ami[_0x0f97('0x10')]()==![]){return _0x406210(_0x2e2103[_0x0f97('0x11')](0x1f4,[config[_0x0f97('0x12')]['ip'],config[_0x0f97('0x12')][_0x0f97('0x1c')],'ami\x20disconnected'][_0x0f97('0x14')]('\x20')));}var _0xddbd8d=schema(properties['voicechannel'])[_0x0f97('0x2')](_0x59a646);if(_0xddbd8d[_0x0f97('0x59')]>0x0){return _0x406210(_0x2e2103[_0x0f97('0x11')](0x1f4,_[_0x0f97('0x70')](_0xddbd8d,'message')[_0x0f97('0x14')](',\x20')));}var _0x34a1df=_[_0x0f97('0x66')](_0xc822e8[_0x0f97('0x5c')],{'uniqueid':_0x59a646[_0x0f97('0x5e')]});if(_0x34a1df){return BPromise[_0x0f97('0x71')]()[_0x0f97('0x19')](function(){if(_0x34a1df[_0x0f97('0x5f')]){return ami[_0x0f97('0x18')]({'action':_0x0f97('0x72'),'channel':_0x34a1df[_0x0f97('0x5f')],'mixmonitorid':_0x59a646[_0x0f97('0x6c')]})[_0x0f97('0x1b')](function(_0x2fa000){});}})['then'](function(){if(_0x34a1df[_0x0f97('0x73')]){return ami[_0x0f97('0x18')]({'action':_0x0f97('0x72'),'channel':_0x34a1df['destinationchannel'],'mixmonitorid':_0x59a646['mixmonitorid']})[_0x0f97('0x1b')](function(_0x4d9097){});}})[_0x0f97('0x19')](function(_0x5e0d82){var _0x23bcd8=_['find'](_0x34a1df[_0x0f97('0x67')],{'mixmonitorid':_0x59a646['mixmonitorid']});if(_0x23bcd8){_0x23bcd8[_0x0f97('0x74')]=_0x0f97('0x75');}})[_0x0f97('0x19')](function(){var _0x45c47f=util[_0x0f97('0x62')](_0x0f97('0x60'),_0x59a646['filename']||_0x59a646['uniqueid'],_0x59a646[_0x0f97('0x62')]||'wav');var _0x1310e9=_[_0x0f97('0x66')](_0x34a1df[_0x0f97('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x45c47f['toLowerCase']()});if(_0x1310e9){_0x1310e9[_0x0f97('0x74')]=_0x0f97('0x75');}})['then'](function(){_0xbd80c1({'code':0xc8,'message':[_0x59a646[_0x0f97('0x5e')],_0x0f97('0x76')][_0x0f97('0x14')]('\x20')});})[_0x0f97('0x1b')](function(_0x2d0c2d){_0x406210(_0x2e2103[_0x0f97('0x11')](0x1f5,[_0x59a646[_0x0f97('0x5e')],_0x2d0c2d[_0x0f97('0x1a')][_0x0f97('0x68')]()]['join']('\x20')));});}else{return _0x406210(_0x2e2103['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x2b8c8f){return new Promise(function(_0x47e12f,_0x478212){var _0x3c103d=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x77')]);_0x47e12f({'count':_0x3c103d[_0x0f97('0x59')],'rows':_0x3c103d});});},'VoiceQueuesChannel':function(_0x48d38a){var _0x21ce2a=this;return new Promise(function(_0x4a278c,_0x447c50){var _0x4d1d8a=schema(properties['voicequeuechannel'])[_0x0f97('0x2')](_0x48d38a);if(_0x4d1d8a[_0x0f97('0x59')]>0x0){return _0x447c50(_0x21ce2a[_0x0f97('0x11')](0x1f4,_['map'](_0x4d1d8a,_0x0f97('0x1a'))[_0x0f97('0x14')](',\x20')));}var _0x6c9898=_[_0x0f97('0x66')](_0xc822e8['queueChannels'],{'uniqueid':_0x48d38a[_0x0f97('0x5e')]});if(_0x6c9898){_0x4a278c(_0x6c9898);}else{return _0x447c50(_0x21ce2a['error'](0x1f5,_0x0f97('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x27cff8){var _0x597dd5=this;return new Promise(function(_0x567bda,_0x40cc45){if(ami[_0x0f97('0x10')]()==![]){return _0x40cc45(_0x597dd5[_0x0f97('0x11')](0x1f4,[config[_0x0f97('0x12')]['ip'],config['asterisk']['username'],_0x0f97('0x13')][_0x0f97('0x14')]('\x20')));}var _0x2af25f=schema(properties[_0x0f97('0x78')])[_0x0f97('0x2')](_0x27cff8);if(_0x2af25f[_0x0f97('0x59')]>0x0){return _0x40cc45(_0x597dd5['error'](0x1f4,_[_0x0f97('0x70')](_0x2af25f,_0x0f97('0x1a'))[_0x0f97('0x14')](',\x20')));}var _0x3cf338=_[_0x0f97('0x66')](_0xc822e8[_0x0f97('0x77')],{'uniqueid':_0x27cff8['uniqueid']});if(_0x3cf338&&_0x3cf338[_0x0f97('0x5f')]){return ami[_0x0f97('0x18')]({'action':_0x0f97('0x79'),'channel':_0x3cf338[_0x0f97('0x5f')]})[_0x0f97('0x19')](function(_0x6616d){_0x567bda({'code':0xc8,'message':[_0x27cff8[_0x0f97('0x5e')],_0x6616d[_0x0f97('0x1a')]['toLowerCase']()][_0x0f97('0x14')]('\x20')});})[_0x0f97('0x1b')](function(_0x52c361){_0x40cc45(_0x597dd5['error'](0x1f5,[_0x27cff8[_0x0f97('0x5e')],_0x52c361['message'][_0x0f97('0x68')]()][_0x0f97('0x14')]('\x20')));});}else{return _0x40cc45(_0x597dd5[_0x0f97('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x923c5e){var _0x330820=this;return new Promise(function(_0x16071d,_0x186a97){if(ami[_0x0f97('0x10')]()==![]){return _0x186a97(_0x330820[_0x0f97('0x11')](0x1f4,[config[_0x0f97('0x12')]['ip'],config[_0x0f97('0x12')][_0x0f97('0x1c')],'ami\x20disconnected'][_0x0f97('0x14')]('\x20')));}var _0x195ea7=schema(properties[_0x0f97('0x7a')])[_0x0f97('0x2')](_0x923c5e);if(_0x195ea7[_0x0f97('0x59')]>0x0){return _0x186a97(_0x330820['error'](0x1f4,_[_0x0f97('0x70')](_0x195ea7,_0x0f97('0x1a'))['join'](',\x20')));}var _0x7c33fd=_['find'](_0xc822e8[_0x0f97('0x77')],{'uniqueid':_0x923c5e['uniqueid']});if(_0x7c33fd&&_0x7c33fd[_0x0f97('0x5f')]){return ami[_0x0f97('0x18')]({'action':'Redirect','channel':_0x7c33fd[_0x0f97('0x5f')],'exten':_0x923c5e['exten'],'context':_0x923c5e['context']||_0x7c33fd['context'],'priority':0x1})[_0x0f97('0x19')](function(_0x41dda5){_0x16071d({'code':0xc8,'message':[_0x923c5e[_0x0f97('0x5e')],_0x41dda5[_0x0f97('0x1a')][_0x0f97('0x68')]()][_0x0f97('0x14')]('\x20')});})[_0x0f97('0x1b')](function(_0x1acab1){_0x186a97(_0x330820[_0x0f97('0x11')](0x1f5,[_0x923c5e[_0x0f97('0x5e')],_0x1acab1['message'][_0x0f97('0x68')]()][_0x0f97('0x14')]('\x20')));});}else{return _0x186a97(_0x330820[_0x0f97('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x357f07){return new Promise(function(_0x1d65f7,_0x5a930d){var _0x5e9139=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0xd')]);_0x1d65f7({'count':_0x5e9139[_0x0f97('0x59')],'rows':_0x5e9139});});},'Telephones':function(_0x2d5a7a){return new Promise(function(_0x26dd22,_0x15d7c5){var _0x30bb6b=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x7b')]);_0x26dd22({'count':_0x30bb6b[_0x0f97('0x59')],'rows':_0x30bb6b});});},'Trunks':function(_0x10fb5c){return new Promise(function(_0x66eedd,_0x22321b){var _0x105deb=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x7c')]);_0x66eedd({'count':_0x105deb[_0x0f97('0x59')],'rows':_0x105deb});});},'OutboundChannels':function(_0x5337f1){return new Promise(function(_0x4f1196,_0x3e0bc4){var _0x5d4bae=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x7d')]);_0x4f1196({'count':_0x5d4bae[_0x0f97('0x59')],'rows':_0x5d4bae});});},'Outbound':function(_0xc2f752){return new Promise(function(_0x15bed7,_0x5b84a3){_0x15bed7(_0xc822e8[_0x0f97('0x2f')]);});},'Campaigns':function(_0x2f8298){return new Promise(function(_0x409689,_0x2043e3){var _0x523f80=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x7e')]);_0x409689({'count':_0x523f80['length'],'rows':_0x523f80});});},'VoiceQueuesPreview':function(_0x352bcc){var _0x336d92=this;return new Promise(function(_0x5c208c,_0x47a1d1){_0x1698c4[_0x0f97('0x7f')](_0x352bcc['id'])['then'](function(_0x398752){_0x5c208c({'code':0xc8,'message':_0x398752['message']});})[_0x0f97('0x1b')](function(_0x26df33){_0x47a1d1(_0x336d92['error'](0x1f4,_0x26df33[_0x0f97('0x1a')]));});});},'EventManager':function(_0x515b80){var _0xe91b0e=this;return new Promise(function(_0x601fd7,_0x2e5135){if(!_0x515b80[_0x0f97('0x80')]){return _0x2e5135(_0xe91b0e[_0x0f97('0x11')](0x1f4,_0x0f97('0x81')));}ami[_0x0f97('0x82')](_0x0f97('0x83')+_0x515b80['event'],_0x515b80[_0x0f97('0x1a')]);_0x601fd7({'code':0xc8,'message':_0x515b80});});},'FaxAccounts':function(_0x347ef8){return new Promise(function(_0x566296,_0x2ad161){var _0x12b578=_[_0x0f97('0x5b')](_0xc822e8[_0x0f97('0x84')]);_0x566296({'count':_0x12b578[_0x0f97('0x59')],'rows':_0x12b578});});},'SendFax':function(_0x3170c4){var _0x234437=this;return new Promise(function(_0x1b49c2,_0x58a30d){_0x290200[_0x0f97('0x85')](_0x3170c4)[_0x0f97('0x19')](function(_0x3876bb){_0x1b49c2({'code':0xc8,'message':_0x3876bb[_0x0f97('0x1a')]});})['catch'](function(_0x57cc3a){_0x58a30d(_0x234437[_0x0f97('0x11')](0x1f4,_0x57cc3a[_0x0f97('0x1a')]));});});},'CheckAfterSend':function(_0x34d326){var _0x9c46e2=this;return new Promise(function(_0x3fa275,_0x4b6c9c){_0x290200[_0x0f97('0x86')](_0x34d326)[_0x0f97('0x19')](function(_0x4f1d24){_0x3fa275({'code':0xc8,'message':_0x4f1d24['message']});})[_0x0f97('0x1b')](function(_0x1c3338){_0x4b6c9c(_0x9c46e2[_0x0f97('0x11')](0x1f4,_0x1c3338[_0x0f97('0x1a')]));});});}};var _0x255d17=jayson[_0x0f97('0x87')](_0x3244a6)[_0x0f97('0x88')]();_0x255d17['on'](_0x0f97('0x11'),function(_0xa0ec4d){return _0x2e3515(_0xa0ec4d);});_0x255d17['listen'](0x232a,_0x0f97('0x89'),function(){console['log'](_0x0f97('0x8a'),0x232a);return _0xac501('RPC\x20listening\x20on\x20port:'+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 bbc1d8f..451d9a9 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 _0x5636=['data3','split','phone','$or','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','routeId','firstName','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','data5','xmd-contactid','ListId'];(function(_0x2c1ebb,_0x42c58a){var _0x4d176d=function(_0x138d77){while(--_0x138d77){_0x2c1ebb['push'](_0x2c1ebb['shift']());}};_0x4d176d(++_0x42c58a);}(_0x5636,0x102));var _0x6563=function(_0x5658a2,_0xa34dde){_0x5658a2=_0x5658a2-0x0;var _0x47e0c5=_0x5636[_0x5658a2];return _0x47e0c5;};'use strict';var _=require(_0x6563('0x0'));var BPromise=require(_0x6563('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x6563('0x2'))(_0x6563('0x3'));var cmContactRpc=require(_0x6563('0x4'));config['redis']=_[_0x6563('0x5')](config[_0x6563('0x6')],{'host':_0x6563('0x7'),'port':0x18eb});var io=require(_0x6563('0x8'))(new Redis(config[_0x6563('0x6')]));function emit(_0x193942,_0x9884a9,_0x2d57d5,_0x2d0d5b,_0x98fcd4){logger[_0x6563('0x9')](_0x6563('0xa'),_0x193942,_0x9884a9['id'],_0x2d57d5,_0x2d0d5b,JSON[_0x6563('0xb')](_0x98fcd4));io['to'](_0x2d57d5)['emit'](_0x2d0d5b,_0x98fcd4);}exports['exec']=function(_0x2946f3,_0x129fa3,_0x490a56,_0x506ee9){var _0x5da960,_0x1ef002;var _0x111d38={};var _0x35936d=Number(_0x490a56[_0x6563('0xc')]);var _0x33816e=_0x490a56[_0x6563('0xd')]?Boolean(Number(_0x490a56[_0x6563('0xd')])):![];var _0xbbae72;var _0x447f9a=![];if(!_['isNil'](_0x490a56[_0x6563('0xe')])){if(_0x490a56['data5']=='1')_0x447f9a=!![];}if(!_0x447f9a){if(_0x506ee9[_0x6563('0xf')]){_0x111d38['id']=_0x506ee9[_0x6563('0xf')];}}if(!_0x111d38['id']){_0x111d38[_0x6563('0x10')]=_0x35936d;_0xbbae72=_0x490a56[_0x6563('0x11')]&&_0x490a56['data3']!=='0'?_0x490a56[_0x6563('0x11')][_0x6563('0x12')](','):[_0x6563('0x13')];_0x111d38[_0x6563('0x14')]=_['map'](_0xbbae72,function(_0x3563fd){var _0x589632={};_0x589632[_0x3563fd]=_0x506ee9['routeId']?_0x506ee9['destcalleridnum']:_0x506ee9[_0x6563('0x15')];return _0x589632;});}var _0x4f5609=['id','firstName',_0x6563('0x16'),_0x6563('0x13'),_0x6563('0x17'),_0x6563('0x18'),_0x6563('0x10'),_0x6563('0x19'),_0x6563('0x1a'),_0x6563('0x1b')];var _0x2a70f0=_['union'](_0x4f5609,_0xbbae72);BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x1e')]({'attributes':_0x2a70f0,'where':_0x111d38}))['then'](function(_0x293db2){_0x1ef002=_0x293db2;if(!_['isEmpty'](_0x1ef002)){if(_0x1ef002[_0x6563('0x1f')]===0x1){_0x5da960=_0x1ef002[0x0];logger[_0x6563('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x506ee9['uniqueid'],_0x129fa3['id'],_0x5da960['id']);}else{logger[_0x6563('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_[_0x6563('0x21')](_0x1ef002,'id')[_0x6563('0x22')](','));}return;}else{logger['info'](_0x6563('0x23'),_0x506ee9['uniqueid'],_0x129fa3['id']);var _0x7ea857={'ListId':_0x35936d};var _0x1590e6=_0x490a56['data4']&&_0x490a56[_0x6563('0x24')]!=='0'?_0x490a56[_0x6563('0x24')]:'phone';if(_0x33816e){logger[_0x6563('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x506ee9[_0x6563('0x20')],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_['isNil'](_0x506ee9['routeId'])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857[_0x6563('0x28')]=_0x506ee9['calleridname']&&_0x506ee9[_0x6563('0x29')]!==''?_0x506ee9['calleridname']:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9[_0x6563('0x2b')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:_0x6563('0x2a');}return BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x2d')](_0x7ea857))['then'](function(_0x9b3d86){_0x5da960=_0x9b3d86;_0x1ef002[_0x6563('0x2e')](_0x9b3d86);if(_0x5da960){logger[_0x6563('0x9')](_0x6563('0x2f'),_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_0x5da960['id']);}return;});}else{logger[_0x6563('0x9')](_0x6563('0x30'),_0x506ee9['uniqueid'],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857['firstName']=_0x506ee9[_0x6563('0x29')]&&_0x506ee9[_0x6563('0x29')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x29')]:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9['destcalleridname']!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:'Unknown';}_0x5da960=_0x7ea857;_0x1ef002[_0x6563('0x2e')](_0x7ea857);return;}}})[_0x6563('0x1d')](function(){if(_0x2946f3){emit(_0x506ee9['uniqueid'],_0x129fa3,util['format'](_0x6563('0x31'),_0x2946f3[_0x6563('0x32')]),util[_0x6563('0x33')](_0x6563('0x34'),_0x490a56['action'][_0x6563('0x35')]()),{'evt':_[_0x6563('0x36')](_0x506ee9,{'autoCreate':_0x33816e}),'contact':_0x5da960===undefined?{}:_0x5da960,'contacts':_0x1ef002['length']===0x0?undefined:_0x1ef002});}});}; \ No newline at end of file +var _0xac31=['mobile','fax','ListId','createdAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','info','[CM][%s][%s]\x20Contact\x20not\x20found','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName'];(function(_0xd0c4d9,_0x3d556c){var _0x589970=function(_0x1839f8){while(--_0x1839f8){_0xd0c4d9['push'](_0xd0c4d9['shift']());}};_0x589970(++_0x3d556c);}(_0xac31,0xca));var _0x1ac3=function(_0x538fd3,_0x398702){_0x538fd3=_0x538fd3-0x0;var _0x40613c=_0xac31[_0x538fd3];return _0x40613c;};'use strict';var _=require(_0x1ac3('0x0'));var BPromise=require(_0x1ac3('0x1'));var Redis=require(_0x1ac3('0x2'));var util=require(_0x1ac3('0x3'));var config=require(_0x1ac3('0x4'));var logger=require(_0x1ac3('0x5'))(_0x1ac3('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1ac3('0x7')]=_[_0x1ac3('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1ac3('0x9'))(new Redis(config[_0x1ac3('0x7')]));function emit(_0x2bf9b1,_0x1be223,_0x157604,_0x57893c,_0x2d17de){logger['info'](_0x1ac3('0xa'),_0x2bf9b1,_0x1be223['id'],_0x157604,_0x57893c,JSON[_0x1ac3('0xb')](_0x2d17de));io['to'](_0x157604)[_0x1ac3('0xc')](_0x57893c,_0x2d17de);}exports['exec']=function(_0xa26c88,_0x1e2642,_0x3e835b,_0x24f0d2){var _0x2a8dc7,_0x422d19;var _0x4b5c92={};var _0x3b38fc=Number(_0x3e835b[_0x1ac3('0xd')]);var _0x2eeabf=_0x3e835b[_0x1ac3('0xe')]?Boolean(Number(_0x3e835b['data2'])):![];var _0x88ed7c;var _0x37d426=![];if(!_[_0x1ac3('0xf')](_0x3e835b[_0x1ac3('0x10')])){if(_0x3e835b['data5']=='1')_0x37d426=!![];}if(!_0x37d426){if(_0x24f0d2[_0x1ac3('0x11')]){_0x4b5c92['id']=_0x24f0d2[_0x1ac3('0x11')];}}if(!_0x4b5c92['id']){_0x4b5c92['ListId']=_0x3b38fc;_0x88ed7c=_0x3e835b[_0x1ac3('0x12')]&&_0x3e835b[_0x1ac3('0x12')]!=='0'?_0x3e835b[_0x1ac3('0x12')]['split'](','):[_0x1ac3('0x13')];_0x4b5c92[_0x1ac3('0x14')]=_[_0x1ac3('0x15')](_0x88ed7c,function(_0x541744){var _0x195683={};_0x195683[_0x541744]=_0x24f0d2['routeId']?_0x24f0d2[_0x1ac3('0x16')]:_0x24f0d2[_0x1ac3('0x17')];return _0x195683;});}var _0x20091d=['id',_0x1ac3('0x18'),_0x1ac3('0x19'),'phone',_0x1ac3('0x1a'),_0x1ac3('0x1b'),_0x1ac3('0x1c'),_0x1ac3('0x1d'),'scheduledAt','updatedAt'];var _0x2879d8=_[_0x1ac3('0x1e')](_0x20091d,_0x88ed7c);BPromise[_0x1ac3('0x1f')]()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x21')]({'attributes':_0x2879d8,'where':_0x4b5c92}))[_0x1ac3('0x20')](function(_0x23b767){_0x422d19=_0x23b767;if(!_[_0x1ac3('0x22')](_0x422d19)){if(_0x422d19[_0x1ac3('0x23')]===0x1){_0x2a8dc7=_0x422d19[0x0];logger['info'](_0x1ac3('0x24'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}else{logger['info'](_0x1ac3('0x26'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_['map'](_0x422d19,'id')[_0x1ac3('0x27')](','));}return;}else{logger[_0x1ac3('0x28')](_0x1ac3('0x29'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);var _0x10db3d={'ListId':_0x3b38fc};var _0x565a0f=_0x3e835b['data4']&&_0x3e835b['data4']!=='0'?_0x3e835b['data4']:'phone';if(_0x2eeabf){logger[_0x1ac3('0x28')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2['destcalleridnum'];if(_[_0x1ac3('0xf')](_0x24f0d2['routeId'])){_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2['destcalleridname']&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2e')]:_0x1ac3('0x2d');}return BPromise['resolve']()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x2f')](_0x10db3d))[_0x1ac3('0x20')](function(_0x294513){_0x2a8dc7=_0x294513;_0x422d19[_0x1ac3('0x30')](_0x294513);if(_0x2a8dc7){logger['info'](_0x1ac3('0x31'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}return;});}else{logger[_0x1ac3('0x28')](_0x1ac3('0x32'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2['routeId'])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2[_0x1ac3('0x16')];if(_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])){_0x10db3d['firstName']=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2e')]&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2['destcalleridname']:_0x1ac3('0x2d');}_0x2a8dc7=_0x10db3d;_0x422d19[_0x1ac3('0x30')](_0x10db3d);return;}}})['then'](function(){if(_0xa26c88){emit(_0x24f0d2[_0x1ac3('0x25')],_0x1e2642,util[_0x1ac3('0x33')](_0x1ac3('0x34'),_0xa26c88[_0x1ac3('0x35')]),util[_0x1ac3('0x33')](_0x1ac3('0x36'),_0x3e835b[_0x1ac3('0x37')][_0x1ac3('0x38')]()),{'evt':_['merge'](_0x24f0d2,{'autoCreate':_0x2eeabf}),'contact':_0x2a8dc7===undefined?{}:_0x2a8dc7,'contacts':_0x422d19[_0x1ac3('0x23')]===0x0?undefined:_0x422d19});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a5c9b24..3c04097 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 _0x176c=['browser','data1','TemplateId','html','data2','render','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','winApplication','format','user:%s','name','trigger:%s:%s','toLowerCase','trigger:%s','exec','accounts','queue','script','query','search','checkTrigger','channel','AllConditions','length','every','checkConditions','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','undefined','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','merge','variables','Actions','action','contactmanager','motionbar'];(function(_0x59d275,_0x4bea3c){var _0x59ac38=function(_0x2c5b7b){while(--_0x2c5b7b){_0x59d275['push'](_0x59d275['shift']());}};_0x59ac38(++_0x4bea3c);}(_0x176c,0x134));var _0xc176=function(_0x50ea9a,_0x5262be){_0x50ea9a=_0x50ea9a-0x0;var _0x339db7=_0x176c[_0x50ea9a];return _0x339db7;};'use strict';var util=require(_0xc176('0x0'));var _=require(_0xc176('0x1'));var url=require(_0xc176('0x2'));var Mustache=require(_0xc176('0x3'));var Redis=require(_0xc176('0x4'));var urlforward=require(_0xc176('0x5'));var integration=require(_0xc176('0x6'));var cmContact=require('./cmContact');var script=require(_0xc176('0x7'));var config=require(_0xc176('0x8'));var logger=require('../../../config/logger')(_0xc176('0x9'));var ami=require(_0xc176('0xa'));config[_0xc176('0xb')]=_['defaults'](config[_0xc176('0xb')],{'host':_0xc176('0xc'),'port':0x18eb});var io=require(_0xc176('0xd'))(new Redis(config[_0xc176('0xb')]));var operators={'equals':function(_0x3963dc,_0x48f510){return _0x3963dc==_0x48f510;},'not_equals':function(_0x376b20,_0x1486c9){return _0x376b20!=_0x1486c9;}};var barAndWebActions=[_0xc176('0xe'),'url',_0xc176('0xf')];function Trigger(_0x208607){this[_0xc176('0x10')]=_0x208607[_0xc176('0x10')];this[_0xc176('0x11')]=_0x208607[_0xc176('0x11')];this[_0xc176('0x12')]=_0x208607[_0xc176('0x12')];this['templates']=_0x208607[_0xc176('0x13')];this[_0xc176('0x14')]=_0x208607[_0xc176('0x14')];this[_0xc176('0x15')]=_0x208607[_0xc176('0x15')];this['freshdeskAccounts']=_0x208607[_0xc176('0x16')];this[_0xc176('0x17')]=_0x208607[_0xc176('0x17')];this['sugarcrmAccounts']=_0x208607[_0xc176('0x18')];this['zohoAccounts']=_0x208607[_0xc176('0x19')];this[_0xc176('0x1a')]=_0x208607['deskAccounts'];this[_0xc176('0x1b')]=_0x208607[_0xc176('0x1b')];this[_0xc176('0x1c')]=_0x208607[_0xc176('0x1c')];this[_0xc176('0x1d')]=_0x208607[_0xc176('0x1d')];this['freshsalesAccounts']=_0x208607[_0xc176('0x1e')];this['accounts']={'zendesk':this[_0xc176('0x15')],'salesforce':this[_0xc176('0x17')],'freshdesk':this[_0xc176('0x16')],'sugarcrm':this[_0xc176('0x18')],'zoho':this[_0xc176('0x19')],'desk':this[_0xc176('0x1a')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xc176('0x1e')],'servicenow':this['servicenowAccounts']};ami['on'](_0xc176('0x1f'),this['syncCustomEvent'][_0xc176('0x20')](this));ami['on'](_0xc176('0x21'),this[_0xc176('0x22')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x23'),this[_0xc176('0x22')]['bind'](this));ami['on'](_0xc176('0x24'),this['syncCustomEvent'][_0xc176('0x20')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0xc176('0x20')](this));ami['on'](_0xc176('0x25'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x26'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x27'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x28'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x29'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0xc176('0x2b'),this[_0xc176('0x2c')][_0xc176('0x20')](this));ami['on'](_0xc176('0x2d'),this[_0xc176('0x2c')][_0xc176('0x20')](this));ami['on'](_0xc176('0x2e'),this['syncAgentDial']['bind'](this));ami['on'](_0xc176('0x2f'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on']('custom:closedinteraction',this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x30'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x31'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0xc176('0x20')](this));ami['on'](_0xc176('0x32'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on'](_0xc176('0x33'),this[_0xc176('0x22')][_0xc176('0x20')](this));ami['on']('custom:offlineMessage',this[_0xc176('0x22')][_0xc176('0x20')](this));}Trigger[_0xc176('0x34')]['emit']=function(_0x3a2a2c,_0x1bebf,_0x44840f){logger[_0xc176('0x35')](_0x3a2a2c,_0x1bebf,JSON[_0xc176('0x36')](_0x44840f));io['to'](_0x3a2a2c)[_0xc176('0x37')](_0x1bebf,_0x44840f);};Trigger[_0xc176('0x34')][_0xc176('0x22')]=function(_0x4943ad){var _0x1c59f8=_[_0xc176('0x38')](_0x4943ad);if(typeof _0x1c59f8['motionChannel']===_0xc176('0x39')){_0x1c59f8[_0xc176('0x3a')]=_0xc176('0x3b');}this[_0xc176('0x3c')](_0x1c59f8);};Trigger[_0xc176('0x34')][_0xc176('0x2c')]=function(_0x479a04){if(this['agents'][_0x479a04[_0xc176('0x3d')]]){this['syncCustomEvent'](_0x479a04);}};Trigger[_0xc176('0x34')][_0xc176('0x3c')]=function(_0x35d357){var _0x1b5747;for(var _0x2d29af in this[_0xc176('0x10')]){if(this[_0xc176('0x10')][_0xc176('0x3e')](_0x2d29af)){if(this[_0xc176('0x10')][_0x2d29af][_0xc176('0x3f')]){_0x1b5747=this['checkTrigger'](this['triggers'][_0x2d29af],_0x35d357);if(_0x1b5747){_[_0xc176('0x40')](_0x35d357,_0x35d357[_0xc176('0x41')]);for(var _0x56167c=0x0,_0x56edc6,_0x39f573,_0x1713fe;_0x56167c0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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(_0x1cb1b4,_0x175a21){var _0x2f76d0=function(_0x5c0f69){while(--_0x5c0f69){_0x1cb1b4['push'](_0x1cb1b4['shift']());}};_0x2f76d0(++_0x175a21);}(_0x7217,0x19e));var _0x7721=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7217[_0x4709c0];return _0x13348b;};'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 682de93..b091689 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 _0x41c2=[']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','POST','remoteUri','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','headers','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','replace','%2b','telephone1','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','getString','Subjects','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','monitor_format','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0x41c2,0x136));var _0x241c=function(_0x29c241,_0x4a7e13){_0x29c241=_0x29c241-0x0;var _0x572348=_0x41c2[_0x29c241];return _0x572348;};'use strict';var _=require(_0x241c('0x0'));var BPromise=require(_0x241c('0x1'));var rp=require(_0x241c('0x2'));var util=require(_0x241c('0x3'));var intUtil=require(_0x241c('0x4'));var md5=require(_0x241c('0x5'));var Redis=require(_0x241c('0x6'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x241c('0x7'));config[_0x241c('0x8')]=_[_0x241c('0x9')](config['redis'],{'host':_0x241c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x241c('0x8')]));function getAuthToken(_0x18973b,_0xa3aeb6,_0x1d7a1c){var _0x13c6b2={'method':_0x241c('0xb'),'uri':_0xa3aeb6,'form':{'client_id':_0x18973b['clientId'],'resource':_0x18973b[_0x241c('0xc')],'username':_0x18973b[_0x241c('0xd')],'password':_0x18973b[_0x241c('0xe')],'grant_type':'password','client_secret':_0x18973b[_0x241c('0xf')]},'json':!![]};return rp(_0x13c6b2)[_0x241c('0x10')](function(_0x1b1fdf){return _0x1b1fdf['access_token'];})[_0x241c('0x11')](function(_0x262f45){logger[_0x241c('0x12')]('['+[_0x1d7a1c['toUpperCase']()]+_0x241c('0x13'));return _0x262f45[_0x241c('0x14')];});}function getUser(_0xc72e26,_0x575a48,_0x1b486d,_0x5158ed,_0x44a090,_0x32cf45){return new BPromise(function(_0x1f9d43,_0x14e7ec){return getAuthToken(_0x575a48,_0x5158ed,_0x32cf45)[_0x241c('0x10')](function(_0x28c627){var _0xadf2ba={'method':_0x241c('0x15'),'uri':_0x44a090+_0x241c('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x28c627,'OData-Version':_0x241c('0x17')},'json':!![]};return rp(_0xadf2ba);})[_0x241c('0x10')](function(_0x403150){var _0x378de1=_0x403150[_0x241c('0x18')];var _0x5ed902=![];var _0x42203d=null;if(!_[_0x241c('0x19')](_0x1b486d)){if(intUtil[_0x241c('0x1a')](_0x1b486d[_0x241c('0x1b')])){_0xc72e26[_0x241c('0x1c')]=_0x1b486d[_0x241c('0x1b')];for(_0x42203d=0x0;_0x42203d<_0x378de1[_0x241c('0x1d')];_0x42203d++){if(_0x378de1[_0x42203d][_0x241c('0x1e')]===_0x1b486d[_0x241c('0x1b')]&&!_0x378de1[_0x42203d]['isdisabled']){_0x5ed902=!![];logger[_0x241c('0x1f')]('['+[_0x32cf45['toUpperCase']()]+_0x241c('0x20')+_0x378de1[_0x42203d][_0x241c('0x21')]+'!');_0xc72e26[_0x241c('0x22')]=_0x378de1[_0x42203d][_0x241c('0x21')];}}}}if(!_0x5ed902){logger[_0x241c('0x1f')]('['+[_0x32cf45[_0x241c('0x23')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xc72e26[_0x241c('0x1c')]=_0x575a48['username'];for(_0x42203d=0x0;_0x42203d<_0x378de1['length'];_0x42203d++){if(_0x378de1[_0x42203d][_0x241c('0x1e')]===_0x575a48[_0x241c('0xd')]){_0xc72e26[_0x241c('0x22')]=_0x378de1[_0x42203d][_0x241c('0x21')];}}}_0x1f9d43(_0xc72e26);})[_0x241c('0x11')](function(_0x25575e){_0x14e7ec(_0x25575e[_0x241c('0x14')]);});});}function createEndUser(_0x593fdf,_0x13a9ba,_0x243526,_0x1cdea1,_0x17e0b3,_0x3aebde){return new BPromise(function(_0x3bc921,_0xe8bdf){return getAuthToken(_0x13a9ba,_0x243526,_0x3aebde)[_0x241c('0x10')](function(_0x111fc2){var _0x7ea126=_0x3aebde['toLowerCase']()===_0x241c('0x24')?_0x17e0b3['destcalleridnum']:_0x17e0b3[_0x241c('0x25')];var _0x4ce591={'method':_0x241c('0xb'),'uri':_0x1cdea1+_0x241c('0x26'),'body':{'telephone1':_0x7ea126,'fullname':_0x7ea126,'firstname':_0x7ea126,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x241c('0x27')+_0x593fdf[_0x241c('0x22')]+')'},'headers':{'Authorization':_0x241c('0x28')+_0x111fc2,'OData-Version':_0x241c('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4ce591);})['then'](function(_0x61812d){var _0x31f31e=_0x61812d[_0x241c('0x29')]['odata-entityid'];var _0x2d3004=_0x31f31e[_0x241c('0x2a')](_0x31f31e[_0x241c('0x2b')]('(')+0x1,_0x31f31e[_0x241c('0x2b')](')'));_0x593fdf[_0x241c('0x2c')]=_0x2d3004;_0x3bc921(_0x593fdf);})['catch'](function(_0x586c15){_0xe8bdf(_0x586c15[_0x241c('0x14')]);});});}function getEndUser(_0x53cc0d,_0x51cf33,_0x506459,_0x101f18,_0x215056,_0x562168,_0x41af60){var _0x1f336c=_0x562168[_0x241c('0x2d')]()===_0x241c('0x24')?_0x215056[_0x241c('0x2e')]:_0x215056[_0x241c('0x25')];return getAuthToken(_0x51cf33,_0x506459,_0x562168)[_0x241c('0x10')](function(_0x4a0041){var _0x222b76={'method':_0x241c('0x15'),'uri':_0x101f18+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x1f336c[_0x241c('0x2f')]('+',_0x241c('0x30'))+'\x27','headers':{'Authorization':_0x241c('0x28')+_0x4a0041,'If-None-Match':null,'OData-Version':_0x241c('0x17')},'json':!![]};return rp(_0x222b76);})[_0x241c('0x10')](function(_0x12a284){var _0x3b5ee7=![];if(!_0x12a284)return _0x3b5ee7;var _0x4cc56b=_0x12a284[_0x241c('0x18')];for(var _0x4c50d6=0x0;_0x4c50d6<_0x4cc56b[_0x241c('0x1d')];_0x4c50d6++){if(_0x4cc56b[_0x4c50d6][_0x241c('0x31')]===_0x1f336c){_0x3b5ee7=!![];_0x53cc0d[_0x241c('0x2c')]=_0x4cc56b[_0x4c50d6]['contactid'];}}return _0x3b5ee7;})[_0x241c('0x10')](function(_0x4bc121){if(_0x4bc121)return _0x53cc0d;if(_0x41af60===_0x241c('0x32')){logger[_0x241c('0x1f')]('['+[_0x562168[_0x241c('0x23')]()]+_0x241c('0x33'));return _0x53cc0d;}return createEndUser(_0x53cc0d,_0x51cf33,_0x506459,_0x101f18,_0x215056,_0x562168)['then'](function(_0x1622bf){logger[_0x241c('0x1f')]('['+[_0x562168[_0x241c('0x23')]()]+']\x20Enduser\x20created!',_0x1622bf[_0x241c('0x2c')]);return _0x1622bf;});});}function getCustomFields(_0x81a9f5,_0x10de0e,_0x2a1583){var _0x1829b0={};if(_0x81a9f5[_0x241c('0x1d')]>0x0){_[_0x241c('0x34')](_0x81a9f5,function(_0x15bff9){if(_[_0x241c('0x35')](['string',_0x241c('0x36')],_0x15bff9[_0x241c('0x37')])&&_0x15bff9[_0x241c('0x38')]&&!_0x15bff9[_0x241c('0x39')]){var _0x5d6d29=_0x15bff9[_0x241c('0x3a')][_0x241c('0x2d')]();var _0x274c22=_0x5d6d29[_0x241c('0x2a')](0x0,_0x5d6d29[_0x241c('0x3b')]('_'));var _0x703d01=_0x5d6d29[_0x241c('0x2a')](_0x5d6d29[_0x241c('0x3b')]('_')+0x1);if(_0x274c22===_0x2a1583){_0x1829b0[_0x703d01]=_0x15bff9[_0x241c('0x3c')];}}});}return _0x1829b0;}function getTicket(_0x1c6607,_0x9ddb46,_0xf07c1e,_0x387633,_0xbb78a8,_0x292ded,_0x4098f6){return new BPromise(function(_0x2eeff0,_0x7976a7){var _0x4de63b;return getAuthToken(_0x9ddb46,_0xf07c1e,_0x4098f6)['then'](function(_0x47766d){if(_0x292ded[_0x241c('0x3d')]==='incident'){_0x4de63b={'method':_0x241c('0xb'),'uri':_0x387633+_0x241c('0x3e'),'body':Object['assign']({},{'title':intUtil[_0x241c('0x3f')](_0x292ded[_0x241c('0x40')],_0xbb78a8,'\x20'),'description':intUtil[_0x241c('0x3f')](_0x292ded['Descriptions'],_0xbb78a8,'\x0a'),'customerid_contact@odata.bind':_0x1c6607['enduserId']?_0x241c('0x41')+_0x1c6607[_0x241c('0x2c')]+')':undefined,'ownerid@odata.bind':_0x241c('0x27')+_0x1c6607[_0x241c('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x292ded[_0x241c('0x42')],_0xbb78a8,_0x292ded[_0x241c('0x3d')])),'headers':{'Authorization':_0x241c('0x28')+_0x47766d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x292ded[_0x241c('0x3d')]===_0x241c('0x43')){var _0x1cecbe=_0x1c6607[_0x241c('0x2c')]?[{'partyid_systemuser@odata.bind':_0x241c('0x27')+_0x1c6607[_0x241c('0x22')]+')','participationtypemask':_0x1c6607[_0x241c('0x44')]===_0x241c('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x241c('0x41')+_0x1c6607[_0x241c('0x2c')]+')','participationtypemask':_0x1c6607[_0x241c('0x44')]===_0x241c('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x241c('0x27')+_0x1c6607['userId']+')','participationtypemask':_0x1c6607[_0x241c('0x44')]===_0x241c('0x45')?0x2:0x1}];_0x4de63b={'method':_0x241c('0xb'),'uri':_0x387633+_0x241c('0x46'),'body':Object[_0x241c('0x47')]({},{'subject':intUtil[_0x241c('0x3f')](_0x292ded['Subjects'],_0xbb78a8,'\x20'),'phonenumber':String(_0xbb78a8[_0x241c('0x25')]),'description':intUtil['getString'](_0x292ded['Descriptions'],_0xbb78a8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1c6607[_0x241c('0x2c')]?_0x241c('0x41')+_0x1c6607[_0x241c('0x2c')]+')':undefined,'ownerid@odata.bind':_0x241c('0x27')+_0x1c6607[_0x241c('0x22')]+')','directioncode':_0x1c6607['callDirection']===_0x241c('0x45')?![]:!![],'phonecall_activity_parties':_0x1cecbe},getCustomFields(_0x292ded[_0x241c('0x42')],_0xbb78a8,_0x292ded[_0x241c('0x3d')])),'headers':{'Authorization':_0x241c('0x28')+_0x47766d,'OData-Version':_0x241c('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4de63b);})[_0x241c('0x10')](function(_0x530984){var _0x25e6cf=_0x530984['headers'][_0x241c('0x48')];var _0x8fa393=_0x25e6cf[_0x241c('0x2a')](_0x25e6cf[_0x241c('0x2b')]('(')+0x1,_0x25e6cf['lastIndexOf'](')'));_0x1c6607['ticketId']=_0x8fa393;_0x2eeff0(_0x1c6607);})[_0x241c('0x11')](function(_0x8d3641){_0x7976a7(_0x8d3641[_0x241c('0x14')]);});});}function emit(_0x2b6fdc,_0x1fa81d,_0x3d951a,_0x1ba8b6){var _0x25042e={'uri':util[_0x241c('0x49')](_0x241c('0x4a'),_0x2b6fdc,_0x3d951a,_0x1ba8b6)};io['to'](util[_0x241c('0x49')](_0x241c('0x4b'),_0x1fa81d))[_0x241c('0x4c')]('trigger:browser:url',_0x25042e);}exports['cs']=function(_0x1f5c53,_0x414876,_0x544664,_0x21da5c,_0x497c3a,_0x8dd10f,_0x55cf06,_0xc218d3){var _0x1ac1bb={};_0x8dd10f[_0x241c('0xc')]=intUtil[_0x241c('0x4d')](_0x8dd10f[_0x241c('0xc')]);_0x8dd10f['serverUrl']=intUtil[_0x241c('0x4d')](_0x8dd10f[_0x241c('0x4e')]);_0x1ac1bb[_0x241c('0x44')]=_0xc218d3==='queue'||_0xc218d3===_0x241c('0x4f')?_0x241c('0x45'):'outbound';var _0x47d5aa=util['format'](_0x241c('0x50'),_0x8dd10f[_0x241c('0xc')]);var _0x5edfcb=util[_0x241c('0x49')](_0x241c('0x51'),_0x8dd10f[_0x241c('0x52')]);var _0x577c07=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8dd10f['serverUrl'],_0x414876['uniqueid'],md5(_0x414876['uniqueid']));if(_0x497c3a&&_0x497c3a[_0x241c('0x53')]){logger['info'](_0x241c('0x54'),'Recording\x20is\x20enabled!');_0x414876['recordingURL']=_0x577c07;}else if(_0x55cf06&&_0x55cf06[_0x241c('0x55')]&&_0x55cf06[_0x241c('0x55')]!==_0x241c('0x56')){logger[_0x241c('0x1f')]('[OUTBOUND]',_0x241c('0x57'));_0x414876[_0x241c('0x58')]=_0x577c07;}else{_0x414876[_0x241c('0x58')]='';}return getUser(_0x1ac1bb,_0x8dd10f,_0x21da5c,_0x5edfcb,_0x47d5aa,_0xc218d3)[_0x241c('0x10')](function(_0x3065e0){logger[_0x241c('0x1f')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x59'),_0x3065e0['userId']);logger[_0x241c('0x1f')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x5a'),_0x3065e0[_0x241c('0x1c')]);return getEndUser(_0x3065e0,_0x8dd10f,_0x5edfcb,_0x47d5aa,_0x414876,_0xc218d3,_0x544664[_0x241c('0x5b')]);})[_0x241c('0x10')](function(_0x4f9ad6){logger[_0x241c('0x1f')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x5c'),_0x4f9ad6[_0x241c('0x2c')]);logger[_0x241c('0x1f')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x5d'),_0x414876[_0x241c('0x25')]);return getTicket(_0x4f9ad6,_0x8dd10f,_0x5edfcb,_0x47d5aa,_0x414876,_0x544664,_0xc218d3);})[_0x241c('0x10')](function(_0x34a18a){logger['info'](util[_0x241c('0x49')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x5e'),_0x544664['ticketType'],_0x34a18a[_0x241c('0x5f')]));logger[_0x241c('0x1f')](util[_0x241c('0x49')]('['+_0xc218d3[_0x241c('0x23')]()+_0x241c('0x60'),_0xc218d3));if(_0xc218d3!==_0x241c('0x4f')){logger['info']('['+_0xc218d3[_0x241c('0x23')]()+']',_0x241c('0x61'));emit(_0x8dd10f[_0x241c('0xc')],_0x21da5c['name'],_0x544664[_0x241c('0x3d')],_0x34a18a[_0x241c('0x5f')]);}})[_0x241c('0x11')](function(_0x42795d){logger[_0x241c('0x12')]('['+_0xc218d3['toUpperCase']()+_0x241c('0x62'),util[_0x241c('0x63')](_0x42795d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xaf44=['phonecalls','Fields','ticketId','format','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','clientId','username','password','then','access_token','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','headers','odata-entityid','substring','lastIndexOf','enduserId','catch','%2b','length','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','type','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/systemusers(','Bearer\x20','phonecall','callDirection','/contacts(','queue'];(function(_0x14f29b,_0x1278bb){var _0x4f50b8=function(_0x2ffe4a){while(--_0x2ffe4a){_0x14f29b['push'](_0x14f29b['shift']());}};_0x4f50b8(++_0x1278bb);}(_0xaf44,0x139));var _0x4af4=function(_0x6c0e2f,_0x10ffc2){_0x6c0e2f=_0x6c0e2f-0x0;var _0x43cfdd=_0xaf44[_0x6c0e2f];return _0x43cfdd;};'use strict';var _=require('lodash');var BPromise=require(_0x4af4('0x0'));var rp=require(_0x4af4('0x1'));var util=require(_0x4af4('0x2'));var intUtil=require(_0x4af4('0x3'));var md5=require(_0x4af4('0x4'));var Redis=require(_0x4af4('0x5'));var logger=require(_0x4af4('0x6'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_[_0x4af4('0x7')](config[_0x4af4('0x8')],{'host':_0x4af4('0x9'),'port':0x18eb});var io=require(_0x4af4('0xa'))(new Redis(config[_0x4af4('0x8')]));function getAuthToken(_0x3b8c4e,_0x521ab3,_0x5bdbe1){var _0x43b759={'method':_0x4af4('0xb'),'uri':_0x521ab3,'form':{'client_id':_0x3b8c4e[_0x4af4('0xc')],'resource':_0x3b8c4e['remoteUri'],'username':_0x3b8c4e[_0x4af4('0xd')],'password':_0x3b8c4e[_0x4af4('0xe')],'grant_type':_0x4af4('0xe'),'client_secret':_0x3b8c4e['clientSecret']},'json':!![]};return rp(_0x43b759)[_0x4af4('0xf')](function(_0x2eee47){return _0x2eee47[_0x4af4('0x10')];})['catch'](function(_0x231955){logger[_0x4af4('0x11')]('['+[_0x5bdbe1[_0x4af4('0x12')]()]+']\x20Wrong\x20credentials!');return _0x231955[_0x4af4('0x13')];});}function getUser(_0x2b784f,_0x3f7f59,_0x293d81,_0x4266fe,_0x72176f,_0x1b7f84){return new BPromise(function(_0x41558c,_0x4b7430){return getAuthToken(_0x3f7f59,_0x4266fe,_0x1b7f84)[_0x4af4('0xf')](function(_0x5ab7fe){var _0x1c6c08={'method':_0x4af4('0x14'),'uri':_0x72176f+_0x4af4('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x5ab7fe,'OData-Version':_0x4af4('0x16')},'json':!![]};return rp(_0x1c6c08);})[_0x4af4('0xf')](function(_0xca2088){var _0x286fc5=_0xca2088[_0x4af4('0x17')];var _0x10b4da=![];var _0x805c3e=null;if(!_[_0x4af4('0x18')](_0x293d81)){if(intUtil[_0x4af4('0x19')](_0x293d81[_0x4af4('0x1a')])){_0x2b784f[_0x4af4('0x1b')]=_0x293d81[_0x4af4('0x1a')];for(_0x805c3e=0x0;_0x805c3e<_0x286fc5['length'];_0x805c3e++){if(_0x286fc5[_0x805c3e][_0x4af4('0x1c')]===_0x293d81[_0x4af4('0x1a')]&&!_0x286fc5[_0x805c3e][_0x4af4('0x1d')]){_0x10b4da=!![];logger['info']('['+[_0x1b7f84[_0x4af4('0x12')]()]+_0x4af4('0x1e')+_0x286fc5[_0x805c3e][_0x4af4('0x1f')]+'!');_0x2b784f[_0x4af4('0x20')]=_0x286fc5[_0x805c3e][_0x4af4('0x1f')];}}}}if(!_0x10b4da){logger[_0x4af4('0x21')]('['+[_0x1b7f84[_0x4af4('0x12')]()]+_0x4af4('0x22'));_0x2b784f[_0x4af4('0x1b')]=_0x3f7f59['username'];for(_0x805c3e=0x0;_0x805c3e<_0x286fc5['length'];_0x805c3e++){if(_0x286fc5[_0x805c3e][_0x4af4('0x1c')]===_0x3f7f59['username']){_0x2b784f['userId']=_0x286fc5[_0x805c3e][_0x4af4('0x1f')];}}}_0x41558c(_0x2b784f);})['catch'](function(_0x3782e1){_0x4b7430(_0x3782e1[_0x4af4('0x13')]);});});}function createEndUser(_0x3154e1,_0x3318ef,_0xfb4686,_0x1903ff,_0x5a595e,_0x757201){return new BPromise(function(_0x3011fa,_0x144e39){return getAuthToken(_0x3318ef,_0xfb4686,_0x757201)[_0x4af4('0xf')](function(_0x10d5bb){var _0xea2407=_0x757201[_0x4af4('0x23')]()===_0x4af4('0x24')?_0x5a595e[_0x4af4('0x25')]:_0x5a595e[_0x4af4('0x26')];var _0x3e8636={'method':_0x4af4('0xb'),'uri':_0x1903ff+'contacts','body':{'telephone1':_0xea2407,'fullname':_0xea2407,'firstname':_0xea2407,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3154e1['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x10d5bb,'OData-Version':_0x4af4('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3e8636);})['then'](function(_0x46897a){var _0x3bbf3f=_0x46897a[_0x4af4('0x27')][_0x4af4('0x28')];var _0x2bd361=_0x3bbf3f[_0x4af4('0x29')](_0x3bbf3f[_0x4af4('0x2a')]('(')+0x1,_0x3bbf3f[_0x4af4('0x2a')](')'));_0x3154e1[_0x4af4('0x2b')]=_0x2bd361;_0x3011fa(_0x3154e1);})[_0x4af4('0x2c')](function(_0x4b3b7d){_0x144e39(_0x4b3b7d[_0x4af4('0x13')]);});});}function getEndUser(_0x520159,_0xb73791,_0x16760b,_0x527734,_0x20852d,_0x357edd,_0x462858){var _0x506e85=_0x357edd[_0x4af4('0x23')]()==='outbound'?_0x20852d['destcalleridnum']:_0x20852d['calleridnum'];return getAuthToken(_0xb73791,_0x16760b,_0x357edd)['then'](function(_0x88fd3a){var _0x24efca={'method':_0x4af4('0x14'),'uri':_0x527734+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x506e85['replace']('+',_0x4af4('0x2d'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x88fd3a,'If-None-Match':null,'OData-Version':_0x4af4('0x16')},'json':!![]};return rp(_0x24efca);})[_0x4af4('0xf')](function(_0x44ab75){var _0x249180=![];if(!_0x44ab75)return _0x249180;var _0xcbee7e=_0x44ab75[_0x4af4('0x17')];for(var _0x457118=0x0;_0x457118<_0xcbee7e[_0x4af4('0x2e')];_0x457118++){if(_0xcbee7e[_0x457118][_0x4af4('0x2f')]===_0x506e85){_0x249180=!![];_0x520159['enduserId']=_0xcbee7e[_0x457118][_0x4af4('0x30')];}}return _0x249180;})[_0x4af4('0xf')](function(_0x29c44d){if(_0x29c44d)return _0x520159;if(_0x462858===_0x4af4('0x31')){logger['info']('['+[_0x357edd[_0x4af4('0x12')]()]+_0x4af4('0x32'));return _0x520159;}return createEndUser(_0x520159,_0xb73791,_0x16760b,_0x527734,_0x20852d,_0x357edd)[_0x4af4('0xf')](function(_0x49196d){logger[_0x4af4('0x21')]('['+[_0x357edd[_0x4af4('0x12')]()]+_0x4af4('0x33'),_0x49196d[_0x4af4('0x2b')]);return _0x49196d;});});}function getCustomFields(_0x7174d6,_0x7b2fb,_0x510170){var _0x2cef6c={};if(_0x7174d6['length']>0x0){_[_0x4af4('0x34')](_0x7174d6,function(_0x1aa40e){if(_[_0x4af4('0x35')](['string','picklist'],_0x1aa40e[_0x4af4('0x36')])&&_0x1aa40e['nameField']&&!_0x1aa40e[_0x4af4('0x37')]){var _0x1e9712=_0x1aa40e[_0x4af4('0x38')][_0x4af4('0x23')]();var _0x46f5f4=_0x1e9712[_0x4af4('0x29')](0x0,_0x1e9712[_0x4af4('0x39')]('_'));var _0x271c65=_0x1e9712[_0x4af4('0x29')](_0x1e9712[_0x4af4('0x39')]('_')+0x1);if(_0x46f5f4===_0x510170){_0x2cef6c[_0x271c65]=_0x1aa40e['content'];}}});}return _0x2cef6c;}function getTicket(_0x350d0e,_0x170a56,_0x32ba3a,_0x4a7fc2,_0x328536,_0x214b80,_0x4678fa){return new BPromise(function(_0x40fe8e,_0x1c3545){var _0x3febc4;return getAuthToken(_0x170a56,_0x32ba3a,_0x4678fa)[_0x4af4('0xf')](function(_0x192707){if(_0x214b80[_0x4af4('0x3a')]===_0x4af4('0x3b')){_0x3febc4={'method':_0x4af4('0xb'),'uri':_0x4a7fc2+_0x4af4('0x3c'),'body':Object[_0x4af4('0x3d')]({},{'title':intUtil[_0x4af4('0x3e')](_0x214b80[_0x4af4('0x3f')],_0x328536,'\x20'),'description':intUtil[_0x4af4('0x3e')](_0x214b80[_0x4af4('0x40')],_0x328536,'\x0a'),'customerid_contact@odata.bind':_0x350d0e['enduserId']?'/contacts('+_0x350d0e['enduserId']+')':undefined,'ownerid@odata.bind':_0x4af4('0x41')+_0x350d0e[_0x4af4('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x214b80['Fields'],_0x328536,_0x214b80[_0x4af4('0x3a')])),'headers':{'Authorization':_0x4af4('0x42')+_0x192707,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x214b80[_0x4af4('0x3a')]===_0x4af4('0x43')){var _0x527ac4=_0x350d0e[_0x4af4('0x2b')]?[{'partyid_systemuser@odata.bind':_0x4af4('0x41')+_0x350d0e[_0x4af4('0x20')]+')','participationtypemask':_0x350d0e[_0x4af4('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x4af4('0x45')+_0x350d0e['enduserId']+')','participationtypemask':_0x350d0e['callDirection']===_0x4af4('0x46')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x4af4('0x41')+_0x350d0e[_0x4af4('0x20')]+')','participationtypemask':_0x350d0e['callDirection']===_0x4af4('0x46')?0x2:0x1}];_0x3febc4={'method':_0x4af4('0xb'),'uri':_0x4a7fc2+_0x4af4('0x47'),'body':Object[_0x4af4('0x3d')]({},{'subject':intUtil[_0x4af4('0x3e')](_0x214b80['Subjects'],_0x328536,'\x20'),'phonenumber':String(_0x328536['calleridnum']),'description':intUtil[_0x4af4('0x3e')](_0x214b80[_0x4af4('0x40')],_0x328536,'\x0a'),'regardingobjectid_contact@odata.bind':_0x350d0e[_0x4af4('0x2b')]?_0x4af4('0x45')+_0x350d0e[_0x4af4('0x2b')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x350d0e[_0x4af4('0x20')]+')','directioncode':_0x350d0e['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x527ac4},getCustomFields(_0x214b80[_0x4af4('0x48')],_0x328536,_0x214b80[_0x4af4('0x3a')])),'headers':{'Authorization':_0x4af4('0x42')+_0x192707,'OData-Version':_0x4af4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3febc4);})[_0x4af4('0xf')](function(_0x1a36ca){var _0x2745be=_0x1a36ca[_0x4af4('0x27')][_0x4af4('0x28')];var _0x133bd7=_0x2745be[_0x4af4('0x29')](_0x2745be[_0x4af4('0x2a')]('(')+0x1,_0x2745be[_0x4af4('0x2a')](')'));_0x350d0e[_0x4af4('0x49')]=_0x133bd7;_0x40fe8e(_0x350d0e);})[_0x4af4('0x2c')](function(_0x161e3f){_0x1c3545(_0x161e3f['message']);});});}function emit(_0x19588a,_0x3dae95,_0x2f2056,_0x55dd49){var _0x25ecb9={'uri':util[_0x4af4('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x19588a,_0x2f2056,_0x55dd49)};io['to'](util['format'](_0x4af4('0x4b'),_0x3dae95))[_0x4af4('0x4c')](_0x4af4('0x4d'),_0x25ecb9);}exports['cs']=function(_0x252965,_0xef2a4d,_0x3bb865,_0x283138,_0x42a16d,_0x26c37c,_0x1d63f,_0x17e249){var _0x15d9c5={};_0x26c37c[_0x4af4('0x4e')]=intUtil[_0x4af4('0x4f')](_0x26c37c[_0x4af4('0x4e')]);_0x26c37c['serverUrl']=intUtil[_0x4af4('0x4f')](_0x26c37c[_0x4af4('0x50')]);_0x15d9c5[_0x4af4('0x44')]=_0x17e249===_0x4af4('0x46')||_0x17e249===_0x4af4('0x51')?'queue':'outbound';var _0x21b130=util[_0x4af4('0x4a')](_0x4af4('0x52'),_0x26c37c[_0x4af4('0x4e')]);var _0x221620=util[_0x4af4('0x4a')]('https://login.microsoftonline.com/%s/oauth2/token',_0x26c37c[_0x4af4('0x53')]);var _0x2d3a1c=util['format'](_0x4af4('0x54'),_0x26c37c[_0x4af4('0x50')],_0xef2a4d['uniqueid'],md5(_0xef2a4d[_0x4af4('0x55')]));if(_0x42a16d&&_0x42a16d['monitor_format']){logger[_0x4af4('0x21')](_0x4af4('0x56'),_0x4af4('0x57'));_0xef2a4d[_0x4af4('0x58')]=_0x2d3a1c;}else if(_0x1d63f&&_0x1d63f[_0x4af4('0x59')]&&_0x1d63f['recordingFormat']!==_0x4af4('0x5a')){logger[_0x4af4('0x21')]('[OUTBOUND]',_0x4af4('0x57'));_0xef2a4d[_0x4af4('0x58')]=_0x2d3a1c;}else{_0xef2a4d[_0x4af4('0x58')]='';}return getUser(_0x15d9c5,_0x26c37c,_0x283138,_0x221620,_0x21b130,_0x17e249)[_0x4af4('0xf')](function(_0x58e8d8){logger[_0x4af4('0x21')]('['+_0x17e249[_0x4af4('0x12')]()+_0x4af4('0x5b'),_0x58e8d8[_0x4af4('0x20')]);logger[_0x4af4('0x21')]('['+_0x17e249[_0x4af4('0x12')]()+']\x20The\x20User\x20email\x20is:',_0x58e8d8[_0x4af4('0x1b')]);return getEndUser(_0x58e8d8,_0x26c37c,_0x221620,_0x21b130,_0xef2a4d,_0x17e249,_0x3bb865[_0x4af4('0x5c')]);})[_0x4af4('0xf')](function(_0x421512){logger[_0x4af4('0x21')]('['+_0x17e249[_0x4af4('0x12')]()+_0x4af4('0x5d'),_0x421512['enduserId']);logger[_0x4af4('0x21')]('['+_0x17e249['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0xef2a4d['calleridnum']);return getTicket(_0x421512,_0x26c37c,_0x221620,_0x21b130,_0xef2a4d,_0x3bb865,_0x17e249);})[_0x4af4('0xf')](function(_0x40df7b){logger[_0x4af4('0x21')](util[_0x4af4('0x4a')]('['+_0x17e249[_0x4af4('0x12')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x3bb865['ticketType'],_0x40df7b[_0x4af4('0x49')]));logger[_0x4af4('0x21')](util['format']('['+_0x17e249[_0x4af4('0x12')]()+_0x4af4('0x5e'),_0x17e249));if(_0x17e249!=='unmanaged'){logger[_0x4af4('0x21')]('['+_0x17e249['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x26c37c['remoteUri'],_0x283138['name'],_0x3bb865[_0x4af4('0x3a')],_0x40df7b[_0x4af4('0x49')]);}})[_0x4af4('0x2c')](function(_0x34bc31){logger[_0x4af4('0x11')]('['+_0x17e249['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x4af4('0x5f')](_0x34bc31,{'showHidden':!![],'depth':null}));});}; \ 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 5e9359e..4ae1879 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 _0x1513=['recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','error','unmanaged','lastevent','toUpperCase','Authorization','calleridnum','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','Fields','custom_fields','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','map','picklist','nameField','customField','toLowerCase','content','toString','includes','string','idField','push','type','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','outbound'];(function(_0x5241ba,_0x41a1d4){var _0x26e7c5=function(_0x2b85ec){while(--_0x2b85ec){_0x5241ba['push'](_0x5241ba['shift']());}};_0x26e7c5(++_0x41a1d4);}(_0x1513,0x187));var _0x3151=function(_0x183de5,_0x270387){_0x183de5=_0x183de5-0x0;var _0x5711da=_0x1513[_0x183de5];return _0x5711da;};'use strict';var _=require(_0x3151('0x0'));var rp=require(_0x3151('0x1'));var md5=require(_0x3151('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x3151('0x3'));var config=require(_0x3151('0x4'));var logger=require(_0x3151('0x5'))(_0x3151('0x6'));config[_0x3151('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3151('0x8'))(new Redis(config[_0x3151('0x7')]));var headers={'Content-Type':_0x3151('0x9'),'Accept':_0x3151('0x9')};function emit(_0x78c30c,_0x84d485,_0x3631de){io['to'](_0x78c30c)[_0x3151('0xa')](_0x84d485,_0x3631de);}function getTicket(_0x44a43c,_0x132b5d,_0x4691cd,_0x3d6387,_0x2be93f){logger[_0x3151('0xb')](_0x3151('0xc'));var _0x149795=_[_0x3151('0xd')]({'responder_id':_0x132b5d['id'],'requester_id':_0x4691cd['id'],'name':util[_0x3151('0xe')](_0x3151('0xf'),_0x2be93f[_0x3151('0x10')]),'phone':_0x2be93f['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3151('0x11')](_0x3d6387[_0x3151('0x12')],_0x2be93f,'\x20'),'description':intUtil[_0x3151('0x11')](_0x3d6387[_0x3151('0x13')],_0x2be93f,'
'),'tags':getTags(_0x3d6387[_0x3151('0x14')],'name')},getCustomFields(_0x3d6387[_0x3151('0x15')],_0x2be93f));_0x149795[_0x3151('0x16')]=_['mapValues'](_['keyBy'](_0x149795['custom_fields'],'id'),'value');return request({'uri':util[_0x3151('0xe')]('%s/api/v2/tickets',_0x44a43c['remoteUri']),'method':'POST','body':_0x149795})[_0x3151('0x17')](function(_0x546c70){logger[_0x3151('0xb')]('Ticket\x20created!');return _0x546c70;});}function getUser(_0x5ecfbe,_0x24a36){if(intUtil[_0x3151('0x18')](_0x24a36)){return request({'uri':util[_0x3151('0xe')](_0x3151('0x19'),_0x5ecfbe[_0x3151('0x1a')]),'qs':{'email':_0x24a36}})[_0x3151('0x17')](function(_0x31f095){if(_0x31f095[_0x3151('0x1b')]){logger['info'](_0x3151('0x1c'));return _['find'](_0x31f095,function(_0x31cdb2){return _0x31cdb2[_0x3151('0x1d')][_0x3151('0x1e')]===_0x24a36;});}else{logger['info'](_0x3151('0x1f'));return request({'uri':util[_0x3151('0xe')](_0x3151('0x20'),_0x5ecfbe[_0x3151('0x1a')])})['then'](function(_0x31e6e3){logger[_0x3151('0xb')](_0x3151('0x21'));return _0x31e6e3;});}});}else{logger[_0x3151('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3151('0xe')](_0x3151('0x20'),_0x5ecfbe[_0x3151('0x1a')])})[_0x3151('0x17')](function(_0xcc53fc){logger[_0x3151('0xb')](_0x3151('0x21'));return _0xcc53fc;});}}function getEndUser(_0x4cc8ef,_0x344c0a,_0x1306a3){logger[_0x3151('0xb')](_0x3151('0x22'),_0x1306a3);return request({'uri':util['format'](_0x3151('0x23'),_0x4cc8ef[_0x3151('0x1a')]),'qs':{'phone':_0x1306a3}})[_0x3151('0x17')](function(_0xa84a3f){if(_0xa84a3f['length']){logger[_0x3151('0xb')](_0x3151('0x24'));return _[_0x3151('0x25')](_0xa84a3f,{'phone':_0x1306a3});}else{logger['info'](_0x3151('0x26'));return request({'uri':util[_0x3151('0xe')]('%s/api/v2/contacts',_0x4cc8ef['remoteUri']),'method':_0x3151('0x27'),'body':{'name':_0x344c0a,'phone':_0x1306a3}})['then'](function(_0x2a7e39){logger['info']('Enduser\x20created.');return _0x2a7e39;});}});}function getAuth(_0xf10658){return util[_0x3151('0xe')](_0x3151('0x28'),new Buffer(_0xf10658[_0x3151('0x29')]+':X')['toString'](_0x3151('0x2a')));}function request(_0x274d64){logger[_0x3151('0x2b')](_0x3151('0x2c'),JSON[_0x3151('0x2d')](_0x274d64));return rp(_[_0x3151('0x2e')](_0x274d64,{'method':_0x3151('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x191fca,_0x4a961e){var _0x51025f=[];if(_0x191fca&&_0x191fca['length']>0x0){_0x51025f=_[_0x3151('0x30')](_0x191fca,_0x4a961e);}return _0x51025f;}function getCustomFields(_0x5e81e1,_0x2c9acc){var _0x1cff9d=[];var _0x1871ba={'custom_fields':[]};if(_0x5e81e1[_0x3151('0x1b')]>0x0){_['forEach'](_0x5e81e1,function(_0x1e07f3){if(_['includes'](['string',_0x3151('0x31')],_0x1e07f3['type'])&&_0x1e07f3[_0x3151('0x32')]&&!_0x1e07f3[_0x3151('0x33')]){_0x1871ba[_0x1e07f3[_0x3151('0x32')][_0x3151('0x34')]()]=_0x1e07f3[_0x3151('0x35')][_0x3151('0x36')]();}else if(_[_0x3151('0x37')]([_0x3151('0x38'),_0x3151('0x31')],_0x1e07f3['type'])&&_0x1e07f3[_0x3151('0x39')]&&_0x1e07f3['customField']){_0x1871ba[_0x3151('0x16')][_0x3151('0x3a')]({'id':_0x1e07f3[_0x3151('0x39')],'value':_0x1e07f3[_0x3151('0x35')][_0x3151('0x36')]()});}else if(_0x1e07f3[_0x3151('0x3b')]===_0x3151('0x3c')&&_0x1e07f3[_0x3151('0x3d')]&&_0x1e07f3[_0x3151('0x39')]&&_0x1e07f3[_0x3151('0x33')]){_0x2c9acc[_0x1e07f3[_0x3151('0x3d')]]&&_0x1871ba[_0x3151('0x16')]['push']({'id':_0x1e07f3['idField'],'value':_0x2c9acc[_0x1e07f3[_0x3151('0x3d')]][_0x3151('0x36')]()});}else if(_0x1e07f3[_0x3151('0x3b')]==='customVariable'&&_0x1e07f3[_0x3151('0x3e')]&&_0x1e07f3[_0x3151('0x3e')][_0x3151('0x3f')]&&_0x1e07f3[_0x3151('0x39')]&&_0x1e07f3[_0x3151('0x33')]){_0x2c9acc[_0x1e07f3[_0x3151('0x3e')][_0x3151('0x3f')][_0x3151('0x34')]()]&&_0x1871ba[_0x3151('0x16')][_0x3151('0x3a')]({'id':_0x1e07f3[_0x3151('0x39')],'value':_0x2c9acc[_0x1e07f3[_0x3151('0x3e')][_0x3151('0x3f')][_0x3151('0x34')]()][_0x3151('0x36')]()});}});}return _0x1871ba;}exports[_0x3151('0x40')]=function(_0x4463f9,_0x4e251b,_0x3760dc,_0x1dce06,_0x2251be,_0x889119){var _0x1b7df7,_0x49af4e;_0x889119[_0x3151('0x1a')]=intUtil[_0x3151('0x41')](_0x889119['remoteUri']);_0x889119[_0x3151('0x42')]=intUtil[_0x3151('0x41')](_0x889119[_0x3151('0x42')]);if(_0x2251be&&_0x2251be[_0x3151('0x43')]){logger[_0x3151('0xb')](_0x3151('0x44'),_0x3151('0x45'));_0x4e251b[_0x3151('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x889119[_0x3151('0x42')],_0x4e251b[_0x3151('0x47')],md5(_0x4e251b[_0x3151('0x47')]));}else{_0x4e251b[_0x3151('0x46')]='';}headers['Authorization']=getAuth(_0x889119);return getUser(_0x889119,_0x1dce06['email'])['then'](function(_0x3c2c11){_0x1b7df7=_0x3c2c11;logger[_0x3151('0xb')]('The\x20User\x20ID\x20is:',_0x1b7df7['id']);return getEndUser(_0x889119,_0x4e251b[_0x3151('0x10')],_0x4e251b['calleridnum']);})[_0x3151('0x17')](function(_0x279285){_0x49af4e=_0x279285;logger[_0x3151('0xb')](_0x3151('0x48'),_0x49af4e['id']);return getTicket(_0x889119,_0x1b7df7,_0x49af4e,_0x3760dc,_0x4e251b);})[_0x3151('0x17')](function(_0x5b73f7){if(_0x5b73f7&&_0x5b73f7['id']){logger[_0x3151('0xb')](_0x3151('0x49'));logger[_0x3151('0xb')]('The\x20Ticket\x20ID\x20is:',_0x5b73f7['id']);logger[_0x3151('0xb')](_0x3151('0x44'),_0x3151('0x4a'));emit(util['format'](_0x3151('0x4b'),_0x1dce06['name']),'trigger:browser:url',{'uri':util[_0x3151('0xe')](_0x3151('0x4c'),_0x889119[_0x3151('0x1a')],_0x5b73f7['id'])});}})[_0x3151('0x4d')](function(_0x5bdd07){logger['error']('[QUEUE]',JSON[_0x3151('0x2d')](_0x5bdd07));});};exports[_0x3151('0x4e')]=function(_0x53c3a3,_0x5c1b9b,_0x2b137e,_0x5592e3,_0x3123ef,_0x323676,_0xc2f27e){var _0x3968b9,_0x573c4e;_0x323676[_0x3151('0x1a')]=intUtil[_0x3151('0x41')](_0x323676[_0x3151('0x1a')]);_0x323676['serverUrl']=intUtil[_0x3151('0x41')](_0x323676['serverUrl']);if(_0xc2f27e&&_0xc2f27e[_0x3151('0x4f')]&&_0xc2f27e[_0x3151('0x4f')]!==_0x3151('0x50')){logger[_0x3151('0xb')](_0x3151('0x51'),_0x3151('0x45'));_0x5c1b9b[_0x3151('0x46')]=util['format'](_0x3151('0x52'),_0x323676[_0x3151('0x42')],_0x5c1b9b[_0x3151('0x47')],md5(_0x5c1b9b[_0x3151('0x47')]));}headers['Authorization']=getAuth(_0x323676);return getUser(_0x323676,_0x5592e3['email'])[_0x3151('0x17')](function(_0x2aeee3){_0x3968b9=_0x2aeee3;logger['info'](_0x3151('0x53'),_0x3968b9['id']);return getEndUser(_0x323676,_0x5c1b9b[_0x3151('0x54')],_0x5c1b9b[_0x3151('0x55')]);})[_0x3151('0x17')](function(_0x3c0d87){_0x573c4e=_0x3c0d87;logger[_0x3151('0xb')](_0x3151('0x48'),_0x573c4e['id']);return getTicket(_0x323676,_0x3968b9,_0x573c4e,_0x2b137e,_0x5c1b9b);})[_0x3151('0x17')](function(_0x4fb205){if(_0x4fb205&&_0x4fb205['id']){logger[_0x3151('0xb')](_0x3151('0x49'));logger[_0x3151('0xb')](_0x3151('0x56'),_0x4fb205['id']);logger[_0x3151('0xb')](_0x3151('0x51'),_0x3151('0x4a'));emit(util[_0x3151('0xe')](_0x3151('0x4b'),_0x5592e3[_0x3151('0x3f')]),_0x3151('0x57'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x323676['remoteUri'],_0x4fb205['id'])});}})[_0x3151('0x4d')](function(_0x5ee834){logger[_0x3151('0x58')]('[OUTBOUND]',JSON['stringify'](_0x5ee834));});};exports[_0x3151('0x59')]=function(_0x3e3d98,_0x4ac1dd,_0x41d74c,_0x242463,_0x5c0736,_0xcd1d0f){var _0x2611f9,_0x2052d9;_0xcd1d0f[_0x3151('0x1a')]=intUtil['stripTrailingSlash'](_0xcd1d0f[_0x3151('0x1a')]);_0xcd1d0f[_0x3151('0x42')]=intUtil[_0x3151('0x41')](_0xcd1d0f[_0x3151('0x42')]);if(_0x5c0736&&_0x5c0736[_0x3151('0x43')]){logger[_0x3151('0xb')]('['+_0x4ac1dd[_0x3151('0x5a')][_0x3151('0x5b')]()+']',_0x3151('0x45'));_0x4ac1dd[_0x3151('0x46')]=util[_0x3151('0xe')](_0x3151('0x52'),_0xcd1d0f['serverUrl'],_0x4ac1dd[_0x3151('0x47')],md5(_0x4ac1dd[_0x3151('0x47')]));}else{_0x4ac1dd[_0x3151('0x46')]='';}headers[_0x3151('0x5c')]=getAuth(_0xcd1d0f);return getUser(_0xcd1d0f,'')[_0x3151('0x17')](function(_0x419ef7){_0x2611f9=_0x419ef7;logger[_0x3151('0xb')](_0x3151('0x53'),_0x2611f9['id']);return getEndUser(_0xcd1d0f,_0x4ac1dd[_0x3151('0x10')],_0x4ac1dd[_0x3151('0x5d')]);})['then'](function(_0x285557){_0x2052d9=_0x285557;logger[_0x3151('0xb')](_0x3151('0x48'),_0x2052d9['id']);return getTicket(_0xcd1d0f,_0x2611f9,_0x2052d9,_0x41d74c,_0x4ac1dd);})['then'](function(_0x3a74ad){if(_0x3a74ad){logger[_0x3151('0xb')]('Ticket\x20created!');logger['info'](_0x3151('0x56'),_0x3a74ad['id']);}})['catch'](function(_0x48555a){logger[_0x3151('0x58')]('['+_0x4ac1dd[_0x3151('0x5a')][_0x3151('0x5b')]()+']',JSON[_0x3151('0x2d')](_0x48555a));});}; \ No newline at end of file +var _0x5c9e=['mapValues','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','error','monitor_format','lastevent','calleridname','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields'];(function(_0x19714d,_0x2e8884){var _0x1675d2=function(_0x49e39d){while(--_0x49e39d){_0x19714d['push'](_0x19714d['shift']());}};_0x1675d2(++_0x2e8884);}(_0x5c9e,0x9d));var _0xe5c9=function(_0x42e66f,_0x113144){_0x42e66f=_0x42e66f-0x0;var _0xf640c5=_0x5c9e[_0x42e66f];return _0xf640c5;};'use strict';var _=require(_0xe5c9('0x0'));var rp=require(_0xe5c9('0x1'));var md5=require('md5');var util=require(_0xe5c9('0x2'));var Redis=require(_0xe5c9('0x3'));var intUtil=require(_0xe5c9('0x4'));var config=require(_0xe5c9('0x5'));var logger=require('../../../../config/logger')(_0xe5c9('0x6'));config[_0xe5c9('0x7')]=_[_0xe5c9('0x8')](config[_0xe5c9('0x7')],{'host':_0xe5c9('0x9'),'port':0x18eb});var io=require(_0xe5c9('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xe5c9('0xb'),'Accept':'application/json'};function emit(_0x6791d5,_0x3d0549,_0x5edc2b){io['to'](_0x6791d5)['emit'](_0x3d0549,_0x5edc2b);}function getTicket(_0x45ac08,_0x517d33,_0x257c21,_0x56d459,_0x393acf){logger[_0xe5c9('0xc')](_0xe5c9('0xd'));var _0x705658=_[_0xe5c9('0xe')]({'responder_id':_0x517d33['id'],'requester_id':_0x257c21['id'],'name':util[_0xe5c9('0xf')](_0xe5c9('0x10'),_0x393acf['calleridname']),'phone':_0x393acf[_0xe5c9('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe5c9('0x12')](_0x56d459[_0xe5c9('0x13')],_0x393acf,'\x20'),'description':intUtil[_0xe5c9('0x12')](_0x56d459[_0xe5c9('0x14')],_0x393acf,_0xe5c9('0x15')),'tags':getTags(_0x56d459[_0xe5c9('0x16')],'name')},getCustomFields(_0x56d459[_0xe5c9('0x17')],_0x393acf));_0x705658[_0xe5c9('0x18')]=_[_0xe5c9('0x19')](_['keyBy'](_0x705658['custom_fields'],'id'),'value');return request({'uri':util[_0xe5c9('0xf')]('%s/api/v2/tickets',_0x45ac08[_0xe5c9('0x1a')]),'method':'POST','body':_0x705658})[_0xe5c9('0x1b')](function(_0x46aab1){logger[_0xe5c9('0xc')](_0xe5c9('0x1c'));return _0x46aab1;});}function getUser(_0x4f207b,_0x217382){if(intUtil[_0xe5c9('0x1d')](_0x217382)){return request({'uri':util['format'](_0xe5c9('0x1e'),_0x4f207b[_0xe5c9('0x1a')]),'qs':{'email':_0x217382}})[_0xe5c9('0x1b')](function(_0x584185){if(_0x584185['length']){logger['info'](_0xe5c9('0x1f'));return _[_0xe5c9('0x20')](_0x584185,function(_0x2a3757){return _0x2a3757['contact']['email']===_0x217382;});}else{logger['info'](_0xe5c9('0x21'));return request({'uri':util[_0xe5c9('0xf')]('%s/api/v2/agents/me',_0x4f207b[_0xe5c9('0x1a')])})[_0xe5c9('0x1b')](function(_0x5f272a){logger[_0xe5c9('0xc')](_0xe5c9('0x22'));return _0x5f272a;});}});}else{logger[_0xe5c9('0xc')](_0xe5c9('0x23'));return request({'uri':util[_0xe5c9('0xf')]('%s/api/v2/agents/me',_0x4f207b['remoteUri'])})[_0xe5c9('0x1b')](function(_0x1620ae){logger['info']('Admin\x20account\x20selected.');return _0x1620ae;});}}function getEndUser(_0x1a950a,_0x2a3db2,_0x54d71a){logger[_0xe5c9('0xc')](_0xe5c9('0x24'),_0x54d71a);return request({'uri':util[_0xe5c9('0xf')](_0xe5c9('0x25'),_0x1a950a[_0xe5c9('0x1a')]),'qs':{'phone':_0x54d71a}})['then'](function(_0x2b6c31){if(_0x2b6c31[_0xe5c9('0x26')]){logger['info'](_0xe5c9('0x27'));return _[_0xe5c9('0x20')](_0x2b6c31,{'phone':_0x54d71a});}else{logger[_0xe5c9('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe5c9('0xf')](_0xe5c9('0x25'),_0x1a950a[_0xe5c9('0x1a')]),'method':_0xe5c9('0x28'),'body':{'name':_0x2a3db2,'phone':_0x54d71a}})[_0xe5c9('0x1b')](function(_0xc8b9f6){logger['info'](_0xe5c9('0x29'));return _0xc8b9f6;});}});}function getAuth(_0x4c7d60){return util['format'](_0xe5c9('0x2a'),new Buffer(_0x4c7d60[_0xe5c9('0x2b')]+':X')[_0xe5c9('0x2c')]('base64'));}function request(_0x1f4168){logger[_0xe5c9('0x2d')](_0xe5c9('0x2e'),JSON[_0xe5c9('0x2f')](_0x1f4168));return rp(_[_0xe5c9('0x8')](_0x1f4168,{'method':_0xe5c9('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x276cc0,_0x46cd16){var _0x29958b=[];if(_0x276cc0&&_0x276cc0[_0xe5c9('0x26')]>0x0){_0x29958b=_[_0xe5c9('0x31')](_0x276cc0,_0x46cd16);}return _0x29958b;}function getCustomFields(_0x4336bd,_0x3abc8d){var _0xcb6f3a=[];var _0x16d8ab={'custom_fields':[]};if(_0x4336bd[_0xe5c9('0x26')]>0x0){_[_0xe5c9('0x32')](_0x4336bd,function(_0x11220a){if(_['includes']([_0xe5c9('0x33'),_0xe5c9('0x34')],_0x11220a[_0xe5c9('0x35')])&&_0x11220a[_0xe5c9('0x36')]&&!_0x11220a[_0xe5c9('0x37')]){_0x16d8ab[_0x11220a[_0xe5c9('0x36')][_0xe5c9('0x38')]()]=_0x11220a[_0xe5c9('0x39')][_0xe5c9('0x2c')]();}else if(_['includes']([_0xe5c9('0x33'),_0xe5c9('0x34')],_0x11220a[_0xe5c9('0x35')])&&_0x11220a[_0xe5c9('0x3a')]&&_0x11220a[_0xe5c9('0x37')]){_0x16d8ab[_0xe5c9('0x18')][_0xe5c9('0x3b')]({'id':_0x11220a['idField'],'value':_0x11220a['content'][_0xe5c9('0x2c')]()});}else if(_0x11220a['type']==='variable'&&_0x11220a[_0xe5c9('0x3c')]&&_0x11220a['idField']&&_0x11220a[_0xe5c9('0x37')]){_0x3abc8d[_0x11220a[_0xe5c9('0x3c')]]&&_0x16d8ab['custom_fields'][_0xe5c9('0x3b')]({'id':_0x11220a[_0xe5c9('0x3a')],'value':_0x3abc8d[_0x11220a[_0xe5c9('0x3c')]][_0xe5c9('0x2c')]()});}else if(_0x11220a[_0xe5c9('0x35')]===_0xe5c9('0x3d')&&_0x11220a[_0xe5c9('0x3e')]&&_0x11220a['Variable'][_0xe5c9('0x3f')]&&_0x11220a['idField']&&_0x11220a[_0xe5c9('0x37')]){_0x3abc8d[_0x11220a['Variable'][_0xe5c9('0x3f')][_0xe5c9('0x38')]()]&&_0x16d8ab[_0xe5c9('0x18')][_0xe5c9('0x3b')]({'id':_0x11220a[_0xe5c9('0x3a')],'value':_0x3abc8d[_0x11220a[_0xe5c9('0x3e')][_0xe5c9('0x3f')][_0xe5c9('0x38')]()][_0xe5c9('0x2c')]()});}});}return _0x16d8ab;}exports[_0xe5c9('0x40')]=function(_0x131507,_0x39774b,_0x137839,_0x35f9f3,_0x3495ee,_0x2e3ce2){var _0x2d47d6,_0x189356;_0x2e3ce2[_0xe5c9('0x1a')]=intUtil[_0xe5c9('0x41')](_0x2e3ce2[_0xe5c9('0x1a')]);_0x2e3ce2[_0xe5c9('0x42')]=intUtil[_0xe5c9('0x41')](_0x2e3ce2['serverUrl']);if(_0x3495ee&&_0x3495ee['monitor_format']){logger[_0xe5c9('0xc')](_0xe5c9('0x43'),_0xe5c9('0x44'));_0x39774b[_0xe5c9('0x45')]=util[_0xe5c9('0xf')](_0xe5c9('0x46'),_0x2e3ce2[_0xe5c9('0x42')],_0x39774b[_0xe5c9('0x47')],md5(_0x39774b[_0xe5c9('0x47')]));}else{_0x39774b[_0xe5c9('0x45')]='';}headers[_0xe5c9('0x48')]=getAuth(_0x2e3ce2);return getUser(_0x2e3ce2,_0x35f9f3['email'])[_0xe5c9('0x1b')](function(_0x55c130){_0x2d47d6=_0x55c130;logger[_0xe5c9('0xc')]('The\x20User\x20ID\x20is:',_0x2d47d6['id']);return getEndUser(_0x2e3ce2,_0x39774b['calleridname'],_0x39774b[_0xe5c9('0x11')]);})[_0xe5c9('0x1b')](function(_0x31e56e){_0x189356=_0x31e56e;logger[_0xe5c9('0xc')](_0xe5c9('0x49'),_0x189356['id']);return getTicket(_0x2e3ce2,_0x2d47d6,_0x189356,_0x137839,_0x39774b);})['then'](function(_0x56d5db){if(_0x56d5db&&_0x56d5db['id']){logger[_0xe5c9('0xc')](_0xe5c9('0x1c'));logger[_0xe5c9('0xc')]('The\x20Ticket\x20ID\x20is:',_0x56d5db['id']);logger[_0xe5c9('0xc')](_0xe5c9('0x43'),_0xe5c9('0x4a'));emit(util[_0xe5c9('0xf')]('user:%s',_0x35f9f3[_0xe5c9('0x3f')]),'trigger:browser:url',{'uri':util[_0xe5c9('0xf')](_0xe5c9('0x4b'),_0x2e3ce2[_0xe5c9('0x1a')],_0x56d5db['id'])});}})[_0xe5c9('0x4c')](function(_0x2549ee){logger['error'](_0xe5c9('0x43'),JSON[_0xe5c9('0x2f')](_0x2549ee));});};exports[_0xe5c9('0x4d')]=function(_0x577562,_0x2e8e74,_0x476231,_0x16eca2,_0x497fac,_0x3ee458,_0x338511){var _0x239a0e,_0x469c62;_0x3ee458[_0xe5c9('0x1a')]=intUtil[_0xe5c9('0x41')](_0x3ee458[_0xe5c9('0x1a')]);_0x3ee458[_0xe5c9('0x42')]=intUtil[_0xe5c9('0x41')](_0x3ee458['serverUrl']);if(_0x338511&&_0x338511[_0xe5c9('0x4e')]&&_0x338511['recordingFormat']!==_0xe5c9('0x4f')){logger[_0xe5c9('0xc')](_0xe5c9('0x50'),'Recording\x20is\x20enabled!');_0x2e8e74['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ee458[_0xe5c9('0x42')],_0x2e8e74[_0xe5c9('0x47')],md5(_0x2e8e74['uniqueid']));}headers['Authorization']=getAuth(_0x3ee458);return getUser(_0x3ee458,_0x16eca2[_0xe5c9('0x51')])[_0xe5c9('0x1b')](function(_0x4f3c45){_0x239a0e=_0x4f3c45;logger[_0xe5c9('0xc')](_0xe5c9('0x52'),_0x239a0e['id']);return getEndUser(_0x3ee458,_0x2e8e74['destcalleridname'],_0x2e8e74[_0xe5c9('0x53')]);})[_0xe5c9('0x1b')](function(_0x4b81bc){_0x469c62=_0x4b81bc;logger[_0xe5c9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x469c62['id']);return getTicket(_0x3ee458,_0x239a0e,_0x469c62,_0x476231,_0x2e8e74);})[_0xe5c9('0x1b')](function(_0x27bda4){if(_0x27bda4&&_0x27bda4['id']){logger[_0xe5c9('0xc')]('Ticket\x20created!');logger['info'](_0xe5c9('0x54'),_0x27bda4['id']);logger[_0xe5c9('0xc')](_0xe5c9('0x50'),_0xe5c9('0x4a'));emit(util[_0xe5c9('0xf')](_0xe5c9('0x55'),_0x16eca2['name']),'trigger:browser:url',{'uri':util['format'](_0xe5c9('0x4b'),_0x3ee458[_0xe5c9('0x1a')],_0x27bda4['id'])});}})[_0xe5c9('0x4c')](function(_0x2cc47a){logger[_0xe5c9('0x56')](_0xe5c9('0x50'),JSON['stringify'](_0x2cc47a));});};exports['unmanaged']=function(_0x49d6b1,_0x32a772,_0x34d3ca,_0x1dc2df,_0x10da05,_0x54559c){var _0x986091,_0x1c2be4;_0x54559c['remoteUri']=intUtil[_0xe5c9('0x41')](_0x54559c[_0xe5c9('0x1a')]);_0x54559c[_0xe5c9('0x42')]=intUtil[_0xe5c9('0x41')](_0x54559c[_0xe5c9('0x42')]);if(_0x10da05&&_0x10da05[_0xe5c9('0x57')]){logger[_0xe5c9('0xc')]('['+_0x32a772[_0xe5c9('0x58')]['toUpperCase']()+']',_0xe5c9('0x44'));_0x32a772[_0xe5c9('0x45')]=util[_0xe5c9('0xf')](_0xe5c9('0x46'),_0x54559c[_0xe5c9('0x42')],_0x32a772[_0xe5c9('0x47')],md5(_0x32a772[_0xe5c9('0x47')]));}else{_0x32a772['recordingURL']='';}headers[_0xe5c9('0x48')]=getAuth(_0x54559c);return getUser(_0x54559c,'')[_0xe5c9('0x1b')](function(_0x217a27){_0x986091=_0x217a27;logger[_0xe5c9('0xc')]('The\x20User\x20ID\x20is:',_0x986091['id']);return getEndUser(_0x54559c,_0x32a772[_0xe5c9('0x59')],_0x32a772[_0xe5c9('0x11')]);})['then'](function(_0x3c7ce8){_0x1c2be4=_0x3c7ce8;logger[_0xe5c9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1c2be4['id']);return getTicket(_0x54559c,_0x986091,_0x1c2be4,_0x34d3ca,_0x32a772);})[_0xe5c9('0x1b')](function(_0x2ad1af){if(_0x2ad1af){logger[_0xe5c9('0xc')](_0xe5c9('0x1c'));logger[_0xe5c9('0xc')](_0xe5c9('0x54'),_0x2ad1af['id']);}})[_0xe5c9('0x4c')](function(_0x13e6d0){logger[_0xe5c9('0x56')]('['+_0x32a772[_0xe5c9('0x58')][_0xe5c9('0x5a')]()+']',JSON[_0xe5c9('0x2f')](_0x13e6d0));});}; \ 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 9098f87..4870280 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 _0xbbbc=['Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','add','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','adminEmail','adminId'];(function(_0x16d578,_0x3cbca3){var _0x3c0177=function(_0x57032a){while(--_0x57032a){_0x16d578['push'](_0x16d578['shift']());}};_0x3c0177(++_0x3cbca3);}(_0xbbbc,0xdf));var _0xcbbb=function(_0x45b374,_0x20dccb){_0x45b374=_0x45b374-0x0;var _0x24fc74=_0xbbbc[_0x45b374];return _0x24fc74;};'use strict';var _=require(_0xcbbb('0x0'));var rp=require(_0xcbbb('0x1'));var md5=require(_0xcbbb('0x2'));var util=require(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var Promise=require(_0xcbbb('0x5'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xcbbb('0x6'));config[_0xcbbb('0x7')]=_[_0xcbbb('0x8')](config[_0xcbbb('0x7')],{'host':_0xcbbb('0x9'),'port':0x18eb});var io=require(_0xcbbb('0xa'))(new Redis(config[_0xcbbb('0x7')]));function getAdminId(_0x5cdf68,_0x24ecf7,_0x3008a4,_0x30b719){return new Promise(function(_0x3a19e2,_0x4cb261){var _0x1f65fb=![];var _0x1bb66c={'method':_0xcbbb('0xb'),'uri':_0x30b719+_0xcbbb('0xc'),'json':!![]};_0x1bb66c[_0xcbbb('0xd')]=_0x3008a4;logger[_0xcbbb('0xe')](_0xcbbb('0xf'));return rp(_0x1bb66c)[_0xcbbb('0x10')](function(_0x2517b0){if(_0x2517b0){var _0x385ae2=_0x2517b0['users'];var _0xce4d3c=null;for(_0xce4d3c=0x0;_0xce4d3c<_0x385ae2[_0xcbbb('0x11')];_0xce4d3c++){if(_0x385ae2[_0xce4d3c]['email']===_0x5cdf68[_0xcbbb('0x12')]){_0x5cdf68[_0xcbbb('0x13')]=_0x385ae2[_0xce4d3c]['id'];_0x1f65fb=!![];}}if(_0x1f65fb){logger[_0xcbbb('0xe')]('Admin\x20found:',_0x5cdf68[_0xcbbb('0x13')]);_0x3a19e2(_0x5cdf68);}else{_0x4cb261({'statusCode':0x194,'message':_0xcbbb('0x14')});}}else{_0x4cb261({'statusCode':0x194,'message':_0xcbbb('0x14')});}})[_0xcbbb('0x15')](function(_0x27b4e5){logger[_0xcbbb('0x16')]('['+[_0x24ecf7[_0xcbbb('0x17')]()]+']',_0x27b4e5[_0xcbbb('0x18')]);_0x4cb261(_0x27b4e5);});});}function getUser(_0x5cace3,_0x231b3a,_0x578db8){return function(_0x908b5d){return new Promise(function(_0x15c2a7,_0xb12070){var _0xa2c442={'method':'GET','uri':_0x578db8+_0xcbbb('0xc'),'json':!![]};_0xa2c442[_0xcbbb('0xd')]=_0x231b3a;logger['info'](_0xcbbb('0x19'));return rp(_0xa2c442)['then'](function(_0xe891c7){if(_0xe891c7){var _0x591cea=_0xe891c7['users'];var _0x3a7157=![];var _0x29ca04=null;if(_0x908b5d[_0xcbbb('0x1a')]!==null){logger[_0xcbbb('0xe')]('Getting\x20user\x20with\x20email',_0x908b5d[_0xcbbb('0x1a')]);_0x908b5d[_0xcbbb('0x1b')]=_0x908b5d[_0xcbbb('0x1a')];for(_0x29ca04=0x0;_0x29ca04<_0x591cea[_0xcbbb('0x11')];_0x29ca04++){if(_0x591cea[_0x29ca04]['email']===_0x908b5d[_0xcbbb('0x1a')]){_0x3a7157=!![];_0x908b5d[_0xcbbb('0x1c')]=_0x591cea[_0x29ca04]['id'];logger[_0xcbbb('0xe')](_0xcbbb('0x1d'),_0x908b5d[_0xcbbb('0x1c')]);}}}if(!_0x3a7157){logger[_0xcbbb('0xe')](_0xcbbb('0x1e'));_0x908b5d[_0xcbbb('0x1b')]=_0x908b5d['adminEmail'];_0x908b5d[_0xcbbb('0x1c')]=_0x908b5d['adminId'];_0x3a7157=!![];}if(_0x3a7157){_0x15c2a7(_0x908b5d);}else{_0xb12070({'statusCode':0x194,'message':_0xcbbb('0x14')});}}else{_0xb12070({'statusCode':0x194,'message':_0xcbbb('0x14')});}})[_0xcbbb('0x15')](function(_0x40f888){logger[_0xcbbb('0x16')]('['+[_0x5cace3['toUpperCase']()]+']',_0x40f888[_0xcbbb('0x18')]);_0xb12070(_0x40f888);});});};}function searchContact(_0x3a946f,_0x2451d9,_0xe9a6e6,_0x1326db){return new Promise(function(_0x6bff8c,_0x2fb397){var _0x5c7d32={'method':_0xcbbb('0xb'),'headers':_0x2451d9,'uri':_0x3a946f+_0xcbbb('0x1f')+_0x1326db+'&f='+_0xe9a6e6+'&entities=contact','json':!![]};rp(_0x5c7d32)[_0xcbbb('0x10')](function(_0x1df5cd){var _0x350472=_['find'](_0x1df5cd[_0xcbbb('0x20')][_0xcbbb('0x20')],[_0xe9a6e6,_0x1326db]);_0x6bff8c(_0x350472);})['catch'](function(_0x318eee){_0x2fb397(_0x318eee);});});}function getEndUser(_0x513cd6,_0x5245f1,_0x33cd8c){return function(_0x179b7a){return new Promise(function(_0xb06af8,_0x4b04a9){logger[_0xcbbb('0xe')](util[_0xcbbb('0x21')](_0xcbbb('0x22'),_0x179b7a[_0xcbbb('0x23')]));searchContact(_0x33cd8c,_0x5245f1,_0xcbbb('0x24'),_0x179b7a[_0xcbbb('0x23')])[_0xcbbb('0x10')](function(_0x414019){if(_0x414019){_0x179b7a[_0xcbbb('0x25')]=_0x414019['id'];logger['info'](_0xcbbb('0x26'),_0x179b7a[_0xcbbb('0x25')]);return _0xb06af8(_0x179b7a);}searchContact(_0x33cd8c,_0x5245f1,_0xcbbb('0x27'),_0x179b7a[_0xcbbb('0x23')])[_0xcbbb('0x10')](function(_0x1ab1f9){if(_0x1ab1f9){_0x179b7a[_0xcbbb('0x25')]=_0x1ab1f9['id'];logger['info'](_0xcbbb('0x28'),_0x179b7a[_0xcbbb('0x25')]);return _0xb06af8(_0x179b7a);}createEndUser(_0x179b7a,_0x513cd6,_0x5245f1,_0x33cd8c)[_0xcbbb('0x10')](function(_0xf73248){logger[_0xcbbb('0xe')]('Contact\x20created:',_0xf73248[_0xcbbb('0x25')]);return _0xb06af8(_0xf73248);});});})['catch'](function(_0x13ea44){_0x4b04a9(_0x13ea44);});});};}function createEndUser(_0xbce593,_0x1624e2,_0x344bb9,_0x12a5cb){return new Promise(function(_0x286ba9,_0x5c0b74){var _0x2a705b=moment();var _0x3af96b={'method':_0xcbbb('0x29'),'uri':_0x12a5cb+_0xcbbb('0x2a'),'body':{'contact':{'last_name':_0xbce593['contactNumber'],'work_number':_0xbce593[_0xcbbb('0x23')],'mobile_number':_0xbce593['contactNumber'],'owner_id':_0xbce593[_0xcbbb('0x1c')],'created_at':_0x2a705b[_0xcbbb('0x21')](_0xcbbb('0x2b'))}},'json':!![]};_0x3af96b[_0xcbbb('0xd')]=_0x344bb9;logger[_0xcbbb('0xe')](_0xcbbb('0x2c'));return rp(_0x3af96b)[_0xcbbb('0x10')](function(_0xed9536){_0xbce593[_0xcbbb('0x25')]=_0xed9536[_0xcbbb('0x2d')]['id'];_0x286ba9(_0xbce593);})[_0xcbbb('0x15')](function(_0x3de330){logger[_0xcbbb('0x16')]('['+[_0x1624e2[_0xcbbb('0x17')]()]+']',_0x3de330[_0xcbbb('0x18')]);_0x5c0b74(_0x3de330['message']);});});}function getTicket(_0x266223,_0x7ab6ac,_0x2ff296,_0x8e34ab,_0x4f277a){return function(_0x4774bd){logger['info'](_0xcbbb('0x2e'));return new Promise(function(_0x59fe47,_0x1e48c9){var _0x40a6b9=moment();var _0x47c9b9={'method':'POST','uri':_0x2ff296+'/api/tasks','body':{'title':intUtil[_0xcbbb('0x2f')](_0x8e34ab[_0xcbbb('0x30')],_0x4f277a,'\x20'),'description':intUtil[_0xcbbb('0x2f')](_0x8e34ab[_0xcbbb('0x31')],_0x4f277a,'\x0a'),'owner_id':_0x4774bd[_0xcbbb('0x1c')],'creater_id':_0x4774bd['adminId'],'targetable_id':_0x4774bd[_0xcbbb('0x25')],'targetable_type':'Contact','created_at':_0x40a6b9[_0xcbbb('0x21')](_0xcbbb('0x2b')),'due_date':_0x40a6b9[_0xcbbb('0x32')](0x1e,'m')['format'](_0xcbbb('0x2b'))},'json':!![]};_0x47c9b9[_0xcbbb('0xd')]=_0x7ab6ac;return rp(_0x47c9b9)[_0xcbbb('0x10')](function(_0xc7f0da){_0x4774bd['ticketId']=_0xc7f0da['task']['id'];logger['info'](_0xcbbb('0x33'),_0x4774bd[_0xcbbb('0x34')]);_0x59fe47(_0x4774bd);})['catch'](function(_0x5b8a1d){logger['error']('['+[_0x266223[_0xcbbb('0x17')]()]+']',_0x5b8a1d[_0xcbbb('0x18')]);_0x1e48c9(_0x5b8a1d['message']);});});};}function emit(_0x113de2,_0xec3de8,_0x230b2f){var _0x5d2afa={'uri':_0x113de2+'/contacts/'+_0x230b2f};io['to'](util[_0xcbbb('0x21')](_0xcbbb('0x35'),_0xec3de8))[_0xcbbb('0x36')](_0xcbbb('0x37'),_0x5d2afa);}exports['cs']=function(_0x1f44ff,_0x8805ed,_0x35fc2a,_0x33f4ec,_0x142700,_0x27b2e7,_0x3aa410,_0x545536){var _0xf30892={};var _0x3f7e72={'Authorization':_0xcbbb('0x38')+_0x27b2e7[_0xcbbb('0x39')]};_0x27b2e7[_0xcbbb('0x3a')]=intUtil[_0xcbbb('0x3b')](_0x27b2e7[_0xcbbb('0x3a')]);_0x27b2e7['serverUrl']=intUtil[_0xcbbb('0x3b')](_0x27b2e7['serverUrl']);var _0x1ba6e5=_0x27b2e7['remoteUri'];_0xf30892[_0xcbbb('0x12')]=_0x27b2e7[_0xcbbb('0x3c')];_0xf30892['contactNumber']=_0x545536['toLowerCase']()===_0xcbbb('0x3d')?_0x8805ed[_0xcbbb('0x3e')]:_0x8805ed[_0xcbbb('0x3f')];_0xf30892[_0xcbbb('0x40')]=_0x545536==='queue'||_0x545536===_0xcbbb('0x41')?_0xcbbb('0x42'):'outbound';if(_0x33f4ec){_0xf30892[_0xcbbb('0x1a')]=_0x33f4ec[_0xcbbb('0x43')];}var _0x20924a=util[_0xcbbb('0x21')](_0xcbbb('0x44'),_0x27b2e7['serverUrl'],_0x8805ed[_0xcbbb('0x45')],md5(_0x8805ed[_0xcbbb('0x45')]));if(_0x142700&&_0x142700[_0xcbbb('0x46')]){logger['info'](_0xcbbb('0x47'),'Recording\x20is\x20enabled!');_0x8805ed['recordingURL']=_0x20924a;}else if(_0x3aa410&&_0x3aa410[_0xcbbb('0x48')]&&_0x3aa410[_0xcbbb('0x48')]!=='none'){logger[_0xcbbb('0xe')](_0xcbbb('0x49'),_0xcbbb('0x4a'));_0x8805ed[_0xcbbb('0x4b')]=_0x20924a;}else{_0x8805ed[_0xcbbb('0x4b')]='';}return getAdminId(_0xf30892,_0x545536,_0x3f7e72,_0x1ba6e5)['then'](getUser(_0x545536,_0x3f7e72,_0x1ba6e5))[_0xcbbb('0x10')](getEndUser(_0x545536,_0x3f7e72,_0x1ba6e5))[_0xcbbb('0x10')](getTicket(_0x545536,_0x3f7e72,_0x1ba6e5,_0x35fc2a,_0x8805ed))[_0xcbbb('0x10')](function(_0x28a72a){logger[_0xcbbb('0xe')](util[_0xcbbb('0x21')](_0xcbbb('0x4c'),_0x28a72a['ticketId']));if(_0x545536!==_0xcbbb('0x41')){logger[_0xcbbb('0xe')]('['+[_0x545536['toUpperCase']()]+']',_0xcbbb('0x4d'));emit(_0x1ba6e5,_0x33f4ec[_0xcbbb('0x4e')],_0x28a72a[_0xcbbb('0x25')]);}})[_0xcbbb('0x15')](function(_0x4c28c0){logger[_0xcbbb('0x16')]('['+[_0x545536[_0xcbbb('0x17')]()]+_0xcbbb('0x4f'),util[_0xcbbb('0x50')](_0x4c28c0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x543c=['emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','info','Getting\x20admin\x20information','then','length','email','adminId','Requested\x20Resource\x20not\x20Found','message','GET','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','catch','toUpperCase','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','headers','error','POST','Subjects','getString','add','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','/contacts/','user:%s'];(function(_0x4579d3,_0x16e475){var _0x2c87fa=function(_0x1607a5){while(--_0x1607a5){_0x4579d3['push'](_0x4579d3['shift']());}};_0x2c87fa(++_0x16e475);}(_0x543c,0x1bf));var _0xc543=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x543c[_0x25cd2c];return _0x1e364c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xc543('0x0'));var moment=require(_0xc543('0x1'));var Promise=require(_0xc543('0x2'));var Redis=require(_0xc543('0x3'));var intUtil=require(_0xc543('0x4'));var config=require(_0xc543('0x5'));var logger=require('../../../../config/logger')(_0xc543('0x6'));config['redis']=_[_0xc543('0x7')](config[_0xc543('0x8')],{'host':_0xc543('0x9'),'port':0x18eb});var io=require(_0xc543('0xa'))(new Redis(config[_0xc543('0x8')]));function getAdminId(_0x1038fa,_0x409859,_0xf1c1f0,_0x3804b2){return new Promise(function(_0x41d2f0,_0x1add78){var _0x58ac0c=![];var _0x1122d7={'method':'GET','uri':_0x3804b2+_0xc543('0xb'),'json':!![]};_0x1122d7['headers']=_0xf1c1f0;logger[_0xc543('0xc')](_0xc543('0xd'));return rp(_0x1122d7)[_0xc543('0xe')](function(_0x574e83){if(_0x574e83){var _0x544e70=_0x574e83['users'];var _0x50df0c=null;for(_0x50df0c=0x0;_0x50df0c<_0x544e70[_0xc543('0xf')];_0x50df0c++){if(_0x544e70[_0x50df0c][_0xc543('0x10')]===_0x1038fa['adminEmail']){_0x1038fa[_0xc543('0x11')]=_0x544e70[_0x50df0c]['id'];_0x58ac0c=!![];}}if(_0x58ac0c){logger[_0xc543('0xc')]('Admin\x20found:',_0x1038fa[_0xc543('0x11')]);_0x41d2f0(_0x1038fa);}else{_0x1add78({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1add78({'statusCode':0x194,'message':_0xc543('0x12')});}})['catch'](function(_0x4d8aa4){logger['error']('['+[_0x409859['toUpperCase']()]+']',_0x4d8aa4[_0xc543('0x13')]);_0x1add78(_0x4d8aa4);});});}function getUser(_0x2c4cfb,_0x2f84c1,_0x55e00f){return function(_0x562f72){return new Promise(function(_0x605c2b,_0x3266ce){var _0x5b28f1={'method':_0xc543('0x14'),'uri':_0x55e00f+_0xc543('0xb'),'json':!![]};_0x5b28f1['headers']=_0x2f84c1;logger[_0xc543('0xc')](_0xc543('0x15'));return rp(_0x5b28f1)[_0xc543('0xe')](function(_0x1b3447){if(_0x1b3447){var _0x3ffadb=_0x1b3447[_0xc543('0x16')];var _0x4e4a80=![];var _0x3b8a50=null;if(_0x562f72[_0xc543('0x17')]!==null){logger['info'](_0xc543('0x18'),_0x562f72[_0xc543('0x17')]);_0x562f72[_0xc543('0x19')]=_0x562f72[_0xc543('0x17')];for(_0x3b8a50=0x0;_0x3b8a50<_0x3ffadb['length'];_0x3b8a50++){if(_0x3ffadb[_0x3b8a50]['email']===_0x562f72[_0xc543('0x17')]){_0x4e4a80=!![];_0x562f72[_0xc543('0x1a')]=_0x3ffadb[_0x3b8a50]['id'];logger[_0xc543('0xc')](_0xc543('0x1b'),_0x562f72[_0xc543('0x1a')]);}}}if(!_0x4e4a80){logger['info'](_0xc543('0x1c'));_0x562f72['userEmail']=_0x562f72[_0xc543('0x1d')];_0x562f72[_0xc543('0x1a')]=_0x562f72[_0xc543('0x11')];_0x4e4a80=!![];}if(_0x4e4a80){_0x605c2b(_0x562f72);}else{_0x3266ce({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3266ce({'statusCode':0x194,'message':_0xc543('0x12')});}})[_0xc543('0x1e')](function(_0x1f3270){logger['error']('['+[_0x2c4cfb[_0xc543('0x1f')]()]+']',_0x1f3270[_0xc543('0x13')]);_0x3266ce(_0x1f3270);});});};}function searchContact(_0x430c42,_0x43df53,_0x3b67d8,_0x1ab136){return new Promise(function(_0x2e21d2,_0x94804d){var _0x407cc1={'method':'GET','headers':_0x43df53,'uri':_0x430c42+_0xc543('0x20')+_0x1ab136+_0xc543('0x21')+_0x3b67d8+'&entities=contact','json':!![]};rp(_0x407cc1)['then'](function(_0x3090a5){var _0x117ac0=_['find'](_0x3090a5['contacts'][_0xc543('0x22')],[_0x3b67d8,_0x1ab136]);_0x2e21d2(_0x117ac0);})[_0xc543('0x1e')](function(_0x992bf){_0x94804d(_0x992bf);});});}function getEndUser(_0x1b2577,_0x2b0f37,_0x1f053e){return function(_0x246982){return new Promise(function(_0x10e568,_0x4569e2){logger[_0xc543('0xc')](util[_0xc543('0x23')](_0xc543('0x24'),_0x246982['contactNumber']));searchContact(_0x1f053e,_0x2b0f37,_0xc543('0x25'),_0x246982[_0xc543('0x26')])['then'](function(_0x3420dc){if(_0x3420dc){_0x246982[_0xc543('0x27')]=_0x3420dc['id'];logger[_0xc543('0xc')](_0xc543('0x28'),_0x246982[_0xc543('0x27')]);return _0x10e568(_0x246982);}searchContact(_0x1f053e,_0x2b0f37,_0xc543('0x29'),_0x246982[_0xc543('0x26')])[_0xc543('0xe')](function(_0x3a6699){if(_0x3a6699){_0x246982[_0xc543('0x27')]=_0x3a6699['id'];logger[_0xc543('0xc')](_0xc543('0x2a'),_0x246982[_0xc543('0x27')]);return _0x10e568(_0x246982);}createEndUser(_0x246982,_0x1b2577,_0x2b0f37,_0x1f053e)[_0xc543('0xe')](function(_0x1b16ab){logger[_0xc543('0xc')](_0xc543('0x2b'),_0x1b16ab[_0xc543('0x27')]);return _0x10e568(_0x1b16ab);});});})[_0xc543('0x1e')](function(_0x15ce6a){_0x4569e2(_0x15ce6a);});});};}function createEndUser(_0x321673,_0x568edf,_0x44a3b5,_0x52fed9){return new Promise(function(_0x69170f,_0x1beb55){var _0xc3f380=moment();var _0x183908={'method':'POST','uri':_0x52fed9+_0xc543('0x2c'),'body':{'contact':{'last_name':_0x321673['contactNumber'],'work_number':_0x321673[_0xc543('0x26')],'mobile_number':_0x321673[_0xc543('0x26')],'owner_id':_0x321673[_0xc543('0x1a')],'created_at':_0xc3f380[_0xc543('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x183908[_0xc543('0x2d')]=_0x44a3b5;logger[_0xc543('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x183908)[_0xc543('0xe')](function(_0xf577e2){_0x321673[_0xc543('0x27')]=_0xf577e2['contact']['id'];_0x69170f(_0x321673);})[_0xc543('0x1e')](function(_0x3f3fe6){logger[_0xc543('0x2e')]('['+[_0x568edf[_0xc543('0x1f')]()]+']',_0x3f3fe6[_0xc543('0x13')]);_0x1beb55(_0x3f3fe6[_0xc543('0x13')]);});});}function getTicket(_0x40c15b,_0x3261c5,_0x17734b,_0x450429,_0x51a41c){return function(_0x3048c8){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x5ead5d,_0x23f394){var _0x466dce=moment();var _0x1b6479={'method':_0xc543('0x2f'),'uri':_0x17734b+'/api/tasks','body':{'title':intUtil['getString'](_0x450429[_0xc543('0x30')],_0x51a41c,'\x20'),'description':intUtil[_0xc543('0x31')](_0x450429['Descriptions'],_0x51a41c,'\x0a'),'owner_id':_0x3048c8[_0xc543('0x1a')],'creater_id':_0x3048c8['adminId'],'targetable_id':_0x3048c8['endUserId'],'targetable_type':'Contact','created_at':_0x466dce[_0xc543('0x23')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x466dce[_0xc543('0x32')](0x1e,'m')['format'](_0xc543('0x33'))},'json':!![]};_0x1b6479['headers']=_0x3261c5;return rp(_0x1b6479)[_0xc543('0xe')](function(_0xddd991){_0x3048c8[_0xc543('0x34')]=_0xddd991[_0xc543('0x35')]['id'];logger[_0xc543('0xc')](_0xc543('0x36'),_0x3048c8[_0xc543('0x34')]);_0x5ead5d(_0x3048c8);})[_0xc543('0x1e')](function(_0x1342c3){logger[_0xc543('0x2e')]('['+[_0x40c15b[_0xc543('0x1f')]()]+']',_0x1342c3[_0xc543('0x13')]);_0x23f394(_0x1342c3['message']);});});};}function emit(_0x39de43,_0x2b5726,_0x15d80c){var _0x490e9d={'uri':_0x39de43+_0xc543('0x37')+_0x15d80c};io['to'](util[_0xc543('0x23')](_0xc543('0x38'),_0x2b5726))[_0xc543('0x39')](_0xc543('0x3a'),_0x490e9d);}exports['cs']=function(_0x2c3105,_0x1c4b0f,_0x20016a,_0x407d80,_0x4e6c58,_0x2ae8a2,_0x3dc07e,_0x3e318a){var _0x1983d9={};var _0xb1bc7f={'Authorization':_0xc543('0x3b')+_0x2ae8a2[_0xc543('0x3c')]};_0x2ae8a2['remoteUri']=intUtil[_0xc543('0x3d')](_0x2ae8a2[_0xc543('0x3e')]);_0x2ae8a2[_0xc543('0x3f')]=intUtil['stripTrailingSlash'](_0x2ae8a2[_0xc543('0x3f')]);var _0x42dd53=_0x2ae8a2[_0xc543('0x3e')];_0x1983d9['adminEmail']=_0x2ae8a2[_0xc543('0x40')];_0x1983d9[_0xc543('0x26')]=_0x3e318a[_0xc543('0x41')]()===_0xc543('0x42')?_0x1c4b0f[_0xc543('0x43')]:_0x1c4b0f[_0xc543('0x44')];_0x1983d9[_0xc543('0x45')]=_0x3e318a===_0xc543('0x46')||_0x3e318a===_0xc543('0x47')?_0xc543('0x46'):_0xc543('0x42');if(_0x407d80){_0x1983d9[_0xc543('0x17')]=_0x407d80[_0xc543('0x10')];}var _0x33161c=util[_0xc543('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ae8a2[_0xc543('0x3f')],_0x1c4b0f[_0xc543('0x48')],md5(_0x1c4b0f['uniqueid']));if(_0x4e6c58&&_0x4e6c58[_0xc543('0x49')]){logger[_0xc543('0xc')](_0xc543('0x4a'),'Recording\x20is\x20enabled!');_0x1c4b0f[_0xc543('0x4b')]=_0x33161c;}else if(_0x3dc07e&&_0x3dc07e[_0xc543('0x4c')]&&_0x3dc07e[_0xc543('0x4c')]!==_0xc543('0x4d')){logger[_0xc543('0xc')](_0xc543('0x4e'),_0xc543('0x4f'));_0x1c4b0f[_0xc543('0x4b')]=_0x33161c;}else{_0x1c4b0f[_0xc543('0x4b')]='';}return getAdminId(_0x1983d9,_0x3e318a,_0xb1bc7f,_0x42dd53)[_0xc543('0xe')](getUser(_0x3e318a,_0xb1bc7f,_0x42dd53))['then'](getEndUser(_0x3e318a,_0xb1bc7f,_0x42dd53))[_0xc543('0xe')](getTicket(_0x3e318a,_0xb1bc7f,_0x42dd53,_0x20016a,_0x1c4b0f))[_0xc543('0xe')](function(_0x22e55f){logger['info'](util[_0xc543('0x23')](_0xc543('0x50'),_0x22e55f[_0xc543('0x34')]));if(_0x3e318a!==_0xc543('0x47')){logger['info']('['+[_0x3e318a[_0xc543('0x1f')]()]+']',_0xc543('0x51'));emit(_0x42dd53,_0x407d80['name'],_0x22e55f[_0xc543('0x27')]);}})[_0xc543('0x1e')](function(_0x313c86){logger['error']('['+[_0x3e318a[_0xc543('0x1f')]()]+_0xc543('0x52'),util[_0xc543('0x53')](_0x313c86,{'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 ee7c7d4..5d8f2b0 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 _0xce31=['sugarcrm','freshdesk','zoho','vtiger','dynamics365','exec','includes','data1','toLowerCase','find','Configurations','queue','routeId','outbound','unmanaged','desk','freshsales','servicenow','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./freshdesk','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce'];(function(_0x24cdf5,_0x295e50){var _0x38db18=function(_0x32c0ca){while(--_0x32c0ca){_0x24cdf5['push'](_0x24cdf5['shift']());}};_0x38db18(++_0x295e50);}(_0xce31,0x65));var _0x1ce3=function(_0x28d4bb,_0x5a5251){_0x28d4bb=_0x28d4bb-0x0;var _0x80fba3=_0xce31[_0x28d4bb];return _0x80fba3;};'use strict';var _=require(_0x1ce3('0x0'));var util=require(_0x1ce3('0x1'));var zendesk=require(_0x1ce3('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1ce3('0x3'));var zoho=require('./zoho');var desk=require(_0x1ce3('0x4'));var vtiger=require(_0x1ce3('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x1ce3('0x6'));var freshsales=require(_0x1ce3('0x7'));var integrations=[_0x1ce3('0x8'),_0x1ce3('0x9'),_0x1ce3('0xa'),_0x1ce3('0xb'),_0x1ce3('0xc'),'desk',_0x1ce3('0xd'),_0x1ce3('0xe'),'freshsales','servicenow'];exports[_0x1ce3('0xf')]=function(_0x55f167,_0x43c8f3,_0x895b9c,_0x1532bb,_0x4463b0,_0x397d57){if(_0x895b9c){if(_[_0x1ce3('0x10')](integrations,_0x55f167[_0x1ce3('0x11')][_0x1ce3('0x12')]())){try{var _0x13093d=null;var _0x262819='';var _0x50cb02=_0x895b9c[_0x55f167[_0x1ce3('0x11')][_0x1ce3('0x12')]()];if(_0x50cb02){var _0x151de3=_0x50cb02[_0x55f167['data2']];if(_0x151de3){var _0x14130f=_[_0x1ce3('0x13')](_0x151de3[_0x1ce3('0x14')],{'id':parseInt(_0x55f167['data3'],0xa)});if(_0x14130f){if(_0x1532bb){if(_0x4463b0&&_0x43c8f3[_0x1ce3('0x15')]){_0x262819=_0x1ce3('0x15');}else if(_0x43c8f3[_0x1ce3('0x16')]){_0x262819=_0x1ce3('0x17');}else{console['log']('EVENT\x20UNKNOWN',_0x43c8f3);}}else{_0x262819=_0x1ce3('0x18');}switch(_0x55f167[_0x1ce3('0x11')][_0x1ce3('0x12')]()){case _0x1ce3('0x8'):zendesk[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0x9'):salesforce[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0xa'):sugarcrm[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0xb'):freshdesk[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0xc'):zoho[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0x19'):desk[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0xd'):vtiger[_0x262819](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57);break;case _0x1ce3('0x1a'):freshsales['cs'](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57,_0x262819);break;case _0x1ce3('0x1b'):servicenow['cs'](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57,_0x262819);break;case'dynamics365':dynamics365['cs'](_0x55f167,_0x43c8f3,_0x14130f,_0x1532bb,_0x4463b0,_0x151de3,_0x397d57,_0x262819);break;default:console[_0x1ce3('0x1c')](_0x1ce3('0x1d'));}}else{_0x13093d=require(_0x1ce3('0x1e'))(_0x55f167[_0x1ce3('0x11')][_0x1ce3('0x12')]());_0x13093d[_0x1ce3('0x1f')]('[EXEC]',util[_0x1ce3('0x20')](_0x1ce3('0x21'),_0x55f167['data1']['toLowerCase'](),_0x55f167['data3']));}}else{_0x13093d=require('../../../../config/logger')(_0x55f167['data1'][_0x1ce3('0x12')]());_0x13093d[_0x1ce3('0x1f')](_0x1ce3('0x22'),util[_0x1ce3('0x20')](_0x1ce3('0x23'),_0x55f167[_0x1ce3('0x11')][_0x1ce3('0x12')](),_0x55f167[_0x1ce3('0x24')]));}}else{}}catch(_0x1bedaf){console[_0x1ce3('0x1f')](_0x1bedaf);}}}}; \ No newline at end of file +var _0xab6a=['unmanaged','salesforce','vtiger','unknown\x20integration','../../../../config/logger','data1','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./freshsales','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN'];(function(_0x3b1bba,_0x220536){var _0x4ca374=function(_0xaec05b){while(--_0xaec05b){_0x3b1bba['push'](_0x3b1bba['shift']());}};_0x4ca374(++_0x220536);}(_0xab6a,0x14f));var _0xaab6=function(_0x6d712,_0x49f866){_0x6d712=_0x6d712-0x0;var _0x78b726=_0xab6a[_0x6d712];return _0x78b726;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xaab6('0x0'));var salesforce=require(_0xaab6('0x1'));var sugarcrm=require(_0xaab6('0x2'));var freshdesk=require(_0xaab6('0x3'));var zoho=require(_0xaab6('0x4'));var desk=require(_0xaab6('0x5'));var vtiger=require(_0xaab6('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xaab6('0x7'));var integrations=['zendesk','salesforce',_0xaab6('0x8'),_0xaab6('0x9'),_0xaab6('0xa'),_0xaab6('0xb'),'vtiger',_0xaab6('0xc'),_0xaab6('0xd'),_0xaab6('0xe')];exports[_0xaab6('0xf')]=function(_0x33105c,_0x12734f,_0x4216e6,_0x328cf3,_0x34798e,_0x524cb3){if(_0x4216e6){if(_['includes'](integrations,_0x33105c['data1'][_0xaab6('0x10')]())){try{var _0x1bbc45=null;var _0x4738fb='';var _0x33b87d=_0x4216e6[_0x33105c['data1'][_0xaab6('0x10')]()];if(_0x33b87d){var _0x2a72bd=_0x33b87d[_0x33105c[_0xaab6('0x11')]];if(_0x2a72bd){var _0x231c98=_[_0xaab6('0x12')](_0x2a72bd[_0xaab6('0x13')],{'id':parseInt(_0x33105c[_0xaab6('0x14')],0xa)});if(_0x231c98){if(_0x328cf3){if(_0x34798e&&_0x12734f[_0xaab6('0x15')]){_0x4738fb=_0xaab6('0x15');}else if(_0x12734f[_0xaab6('0x16')]){_0x4738fb=_0xaab6('0x17');}else{console['log'](_0xaab6('0x18'),_0x12734f);}}else{_0x4738fb=_0xaab6('0x19');}switch(_0x33105c['data1'][_0xaab6('0x10')]()){case'zendesk':zendesk[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0x1a'):salesforce[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0x8'):sugarcrm[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0x9'):freshdesk[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0xa'):zoho[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0xb'):desk[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0x1b'):vtiger[_0x4738fb](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3);break;case _0xaab6('0xd'):freshsales['cs'](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3,_0x4738fb);break;case'servicenow':servicenow['cs'](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3,_0x4738fb);break;case _0xaab6('0xc'):dynamics365['cs'](_0x33105c,_0x12734f,_0x231c98,_0x328cf3,_0x34798e,_0x2a72bd,_0x524cb3,_0x4738fb);break;default:console['log'](_0xaab6('0x1c'));}}else{_0x1bbc45=require(_0xaab6('0x1d'))(_0x33105c[_0xaab6('0x1e')]['toLowerCase']());_0x1bbc45[_0xaab6('0x1f')](_0xaab6('0x20'),util[_0xaab6('0x21')](_0xaab6('0x22'),_0x33105c['data1'][_0xaab6('0x10')](),_0x33105c['data3']));}}else{_0x1bbc45=require('../../../../config/logger')(_0x33105c[_0xaab6('0x1e')]['toLowerCase']());_0x1bbc45['error']('[EXEC]',util[_0xaab6('0x21')](_0xaab6('0x23'),_0x33105c[_0xaab6('0x1e')]['toLowerCase'](),_0x33105c[_0xaab6('0x11')]));}}else{}}catch(_0x5124bf){console[_0xaab6('0x1f')](_0x5124bf);}}}}; \ 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 8103d7c..47e5b6c 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 _0xb34d=['account_contact_lead','additionalSearchAccount','Account','additionalSearchLead','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','md5','jsforce','util','./util','../../../../config/environment','salesforce','redis','defaults','localhost','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','AccountId','leadId','info','sobject','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','Lead'];(function(_0x5bc412,_0x11dbe9){var _0x43abae=function(_0x231b11){while(--_0x231b11){_0x5bc412['push'](_0x5bc412['shift']());}};_0x43abae(++_0x11dbe9);}(_0xb34d,0x150));var _0xdb34=function(_0x48381b,_0x54c2ae){_0x48381b=_0x48381b-0x0;var _0x4ceffd=_0xb34d[_0x48381b];return _0x4ceffd;};'use strict';var _=require(_0xdb34('0x0'));var rp=require(_0xdb34('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xdb34('0x2'));var jsforce=require(_0xdb34('0x3'));var util=require(_0xdb34('0x4'));var Redis=require('ioredis');var intUtil=require(_0xdb34('0x5'));var config=require(_0xdb34('0x6'));var logger=require('../../../../config/logger')(_0xdb34('0x7'));config[_0xdb34('0x8')]=_[_0xdb34('0x9')](config[_0xdb34('0x8')],{'host':_0xdb34('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb34('0x8')]));function emit(_0x21a9a9,_0x23776e,_0x1f1883){io['to'](_0x21a9a9)[_0xdb34('0xb')](_0x23776e,_0x1f1883);}function getTicket(_0x23538e,_0x1cc4e2,_0xbc4fcf,_0x23569a,_0x5154d2,_0xbea5d7,_0x1e352b,_0x31d721){var _0x4bc0cd=Object[_0xdb34('0xc')]({},{'OwnerId':_0x1cc4e2['id'],'Subject':intUtil['getString'](_0x23569a['Subjects'],_0x5154d2,'\x20'),'Description':intUtil[_0xdb34('0xd')](_0x23569a[_0xdb34('0xe')],_0x5154d2,'\x0a')},getCustomFields(_0xbea5d7,_0x5154d2));if(_0xbc4fcf){if(_0x23569a[_0xdb34('0xf')]===_0xdb34('0x10')){_0x4bc0cd[_0xdb34('0x11')]=moment[_0xdb34('0x12')]();_0x4bc0cd[_0xdb34('0x13')]=![];_0x4bc0cd[_0xdb34('0x14')]=![];if(_0xbc4fcf[_0xdb34('0x15')]===_0xdb34('0x16')||_0xbc4fcf[_0xdb34('0x15')]===_0xdb34('0x17')){_0x4bc0cd[_0xdb34('0x18')]=_0xbc4fcf['id'];}else if(_0xbc4fcf['endUserType']===_0xdb34('0x19')){_0x4bc0cd[_0xdb34('0x1a')]=_0xbc4fcf['id'];}}else if(_0x23569a[_0xdb34('0xf')]==='Case'){if(_0xbc4fcf[_0xdb34('0x15')]===_0xdb34('0x16')){_0x4bc0cd['ContactId']=_0xbc4fcf['id'];}else if(_0xbc4fcf[_0xdb34('0x15')]===_0xdb34('0x19')){_0x4bc0cd[_0xdb34('0x1b')]=_0xbc4fcf['id'];}else if(_0xbc4fcf[_0xdb34('0x15')]===_0xdb34('0x17')&&_0x23569a[_0xdb34('0x1c')]){_0x4bc0cd[_0x23569a[_0xdb34('0x1c')]]=_0xbc4fcf['id'];}else{logger[_0xdb34('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1e352b[_0xdb34('0x1e')](_0x23569a[_0xdb34('0xf')])[_0xdb34('0x1f')](_0x4bc0cd);}function getUser(_0x37ab69,_0x4874bf,_0x35464f){if(!_['isNil'](_0x4874bf)&&intUtil[_0xdb34('0x20')](_0x4874bf)){var _0x108a2f={'Email':_0x4874bf};var _0x3a8056={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x35464f[_0xdb34('0x1e')](_0xdb34('0x21'))[_0xdb34('0x22')](_0x108a2f,_0x3a8056)[_0xdb34('0x23')]()[_0xdb34('0x24')](function(_0x959c01){if(_0x959c01[_0xdb34('0x25')]){var _0x29552d=_['find'](_0x959c01,function(_0x120f44){return _0x120f44[_0xdb34('0x26')]===_0x4874bf;});if(_0x29552d){logger[_0xdb34('0x1d')](_0xdb34('0x27'),_0x4874bf);return BPromise[_0xdb34('0x28')]({'id':_0x29552d['Id'],'name':_0x29552d[_0xdb34('0x29')]});}}else{logger[_0xdb34('0x1d')](_0xdb34('0x2a'),_0x4874bf);return _0x35464f['identity']()[_0xdb34('0x24')](function(_0x3ab1e6){return BPromise[_0xdb34('0x28')]({'id':_0x3ab1e6[_0xdb34('0x2b')],'name':_0x3ab1e6[_0xdb34('0x2c')]});});}});}else{logger[_0xdb34('0x1d')](_0xdb34('0x2a'),_0x4874bf);return _0x35464f['identity']()['then'](function(_0x4daed8){return BPromise[_0xdb34('0x28')]({'id':_0x4daed8[_0xdb34('0x2b')],'name':_0x4daed8[_0xdb34('0x2c')]});});}}function getEndUser(_0x8bf753,_0x1c46a1,_0x153104,_0x93652d,_0x379d3e){var _0x36b3b7={'$or':{'Phone':_0x93652d}};var _0x27bda7={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xdb34('0x28')]()[_0xdb34('0x24')](function(){logger['info'](_0xdb34('0x2d'),_0x93652d,_0x1c46a1[_0xdb34('0x2e')]);switch(_0x1c46a1[_0xdb34('0x2e')]){case _0xdb34('0x2f'):var _0x3d8de3=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1[_0xdb34('0x31')]){var _0x1a3fa6={};_0x1a3fa6[_0x1c46a1[_0xdb34('0x31')]]=_0x93652d;_[_0xdb34('0x32')](_0x3d8de3[_0xdb34('0x33')],_0x1a3fa6);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x34'))['find'](_0x3d8de3,_0x27bda7)['execute']()[_0xdb34('0x24')](function(_0x52d5b7){if(_0x52d5b7&&_0x52d5b7[_0xdb34('0x25')]){return _0x52d5b7;}else{var _0x100fc5=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1['additionalSearchLead']){var _0x2a4532={};_0x2a4532[_0x1c46a1['additionalSearchLead']]=_0x93652d;_['merge'](_0x100fc5[_0xdb34('0x33')],_0x2a4532);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x35'))['find'](_0x100fc5,_0x27bda7);}});case _0xdb34('0x36'):var _0x271823=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1[_0xdb34('0x37')]){var _0x1a3fa6={};_0x1a3fa6[_0x1c46a1[_0xdb34('0x37')]]=_0x93652d;_[_0xdb34('0x32')](_0x271823[_0xdb34('0x33')],_0x1a3fa6);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x38'))[_0xdb34('0x22')](_0x271823,_0x27bda7)[_0xdb34('0x23')]()[_0xdb34('0x24')](function(_0x5deaa3){if(_0x5deaa3&&_0x5deaa3['length']){return _0x5deaa3;}else{var _0x5eebbd=_['cloneDeep'](_0x36b3b7);if(_0x1c46a1['additionalSearchContact']){var _0x483ea8={};_0x483ea8[_0x1c46a1[_0xdb34('0x31')]]=_0x93652d;_[_0xdb34('0x32')](_0x5eebbd[_0xdb34('0x33')],_0x483ea8);}return _0x379d3e[_0xdb34('0x1e')]('Contact')[_0xdb34('0x22')](_0x5eebbd,_0x27bda7)[_0xdb34('0x24')](function(_0x19e394){if(_0x19e394&&_0x19e394[_0xdb34('0x25')]){return _0x19e394;}else{var _0x2de4d9=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1[_0xdb34('0x39')]){var _0x4b2223={};_0x4b2223[_0x1c46a1['additionalSearchLead']]=_0x93652d;_['merge'](_0x2de4d9[_0xdb34('0x33')],_0x4b2223);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x35'))[_0xdb34('0x22')](_0x2de4d9,_0x27bda7);}});}});case _0xdb34('0x16'):var _0x3d8de3=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1['additionalSearchContact']){var _0x1a3fa6={};_0x1a3fa6[_0x1c46a1[_0xdb34('0x31')]]=_0x93652d;_[_0xdb34('0x32')](_0x3d8de3[_0xdb34('0x33')],_0x1a3fa6);}return _0x379d3e[_0xdb34('0x1e')]('Contact')[_0xdb34('0x22')](_0x3d8de3,_0x27bda7)[_0xdb34('0x23')]();case _0xdb34('0x17'):var _0x45cfbe=_['cloneDeep'](_0x36b3b7);if(_0x1c46a1[_0xdb34('0x39')]){var _0x1a3fa6={};_0x1a3fa6[_0x1c46a1[_0xdb34('0x39')]]=_0x93652d;_[_0xdb34('0x32')](_0x45cfbe[_0xdb34('0x33')],_0x1a3fa6);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x35'))['find'](_0x45cfbe,_0x27bda7);case'account':var _0x271823=_[_0xdb34('0x30')](_0x36b3b7);if(_0x1c46a1['additionalSearchAccount']){var _0x1a3fa6={};_0x1a3fa6[_0x1c46a1['additionalSearchAccount']]=_0x93652d;_[_0xdb34('0x32')](_0x271823[_0xdb34('0x33')],_0x1a3fa6);}return _0x379d3e[_0xdb34('0x1e')](_0xdb34('0x38'))[_0xdb34('0x22')](_0x271823,_0x27bda7);default:return null;}})[_0xdb34('0x24')](function(_0x19e35b){if(_0x19e35b&&_0x19e35b[_0xdb34('0x25')]){var _0xf5744c=_[_0xdb34('0x3a')](_0x19e35b);if(_0xf5744c){return BPromise[_0xdb34('0x28')]({'id':_0xf5744c['Id'],'name':_0xf5744c[_0xdb34('0x29')],'phone':_0xf5744c[_0xdb34('0x3b')],'endUserType':_0xf5744c[_0xdb34('0x3c')][_0xdb34('0x3d')][_0xdb34('0x3e')]()});}}})['then'](function(_0x423d0b){if(_0x423d0b){logger[_0xdb34('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x423d0b['endUserType'],_0x93652d);return BPromise[_0xdb34('0x28')](_0x423d0b);}else{logger[_0xdb34('0x1d')](_0xdb34('0x3f'),_0x93652d);var _0x124861={'Phone':_0x93652d};if(_0x1c46a1[_0xdb34('0x40')]){if(_0x1c46a1[_0xdb34('0x40')]===_0xdb34('0x16')){logger[_0xdb34('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x93652d,_0x1c46a1['moduleCreate']);_0x124861[_0xdb34('0x41')]=_0x153104!==_0xdb34('0x42')?_0x153104:util[_0xdb34('0x43')](_0xdb34('0x44'),_0x93652d);}else if(_0x1c46a1['moduleCreate']===_0xdb34('0x17')){logger[_0xdb34('0x1d')](_0xdb34('0x45'),_0x93652d,_0x1c46a1['moduleCreate']);_0x124861[_0xdb34('0x41')]=_0x153104!==_0xdb34('0x42')?_0x153104:util[_0xdb34('0x43')](_0xdb34('0x44'),_0x93652d);_0x124861[_0xdb34('0x46')]=_0xdb34('0x47');}else if(_0x1c46a1['moduleCreate']===_0xdb34('0x19')){logger[_0xdb34('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x93652d,_0x1c46a1[_0xdb34('0x40')]);_0x124861['Name']=_0x153104!==_0xdb34('0x42')?_0x153104:util['format']('Caller\x20-\x20%s',_0x93652d);}else{return null;}}return _0x379d3e[_0xdb34('0x1e')](_[_0xdb34('0x48')](_0x1c46a1['moduleCreate']))[_0xdb34('0x1f')](_0x124861)[_0xdb34('0x24')](function(_0x5d09cc){return BPromise[_0xdb34('0x28')]({'id':_0x5d09cc['id'],'endUserType':_0x1c46a1['moduleCreate']});});}});}function getCustomFields(_0x43ac41,_0x215d45){var _0x5d4158={};if(_0x43ac41[_0xdb34('0x25')]>0x0){_[_0xdb34('0x49')](_0x43ac41,function(_0x2cac8a){if(_[_0xdb34('0x4a')](['string',_0xdb34('0x4b')],_0x2cac8a[_0xdb34('0x3d')])&&_0x2cac8a[_0xdb34('0x4c')]){_0x5d4158[_0x2cac8a[_0xdb34('0x4c')]]=_0x2cac8a['content'][_0xdb34('0x4d')]();}else if(_0x2cac8a['type']===_0xdb34('0x4e')&&_0x2cac8a[_0xdb34('0x4f')]&&_0x2cac8a['idField']){_0x215d45[_0x2cac8a[_0xdb34('0x4f')]]&&(_0x5d4158[_0x2cac8a[_0xdb34('0x4c')]]=_0x215d45[_0x2cac8a[_0xdb34('0x4f')]][_0xdb34('0x4d')]());}else if(_0x2cac8a['type']===_0xdb34('0x50')&&_0x2cac8a[_0xdb34('0x51')]&&_0x2cac8a[_0xdb34('0x51')]['name']&&_0x2cac8a[_0xdb34('0x4c')]){_0x215d45[_0x2cac8a['Variable'][_0xdb34('0x52')][_0xdb34('0x3e')]()]&&(_0x5d4158[_0x2cac8a[_0xdb34('0x4c')]]=_0x215d45[_0x2cac8a[_0xdb34('0x51')][_0xdb34('0x52')][_0xdb34('0x3e')]()][_0xdb34('0x4d')]());}});}return _0x5d4158;}function getConnection(_0x325cf3){var _0x2c0e15=_0x325cf3[_0xdb34('0x53')][_0xdb34('0x54')](_0x325cf3[_0xdb34('0x55')]);var _0x196d07=new jsforce[(_0xdb34('0x56'))]({'oauth2':{'loginUrl':_0x325cf3[_0xdb34('0x57')]||_0xdb34('0x58'),'clientId':_0x325cf3[_0xdb34('0x59')],'clientSecret':_0x325cf3['clientSecret']}});return _0x196d07[_0xdb34('0x5a')](_0x325cf3[_0xdb34('0x5b')],_0x2c0e15)[_0xdb34('0x24')](function(){logger[_0xdb34('0x1d')](_0xdb34('0x5c'));return _0x196d07;});}exports[_0xdb34('0x5d')]=function(_0x283efc,_0x5157dd,_0x47c55b,_0x776e7c,_0x58a3d6,_0x3083e8){var _0x3aa591,_0x41b18d,_0xd7a800,_0x343168;_0x3083e8[_0xdb34('0x5e')]=intUtil['stripTrailingSlash'](_0x3083e8[_0xdb34('0x5e')]);_0x3083e8[_0xdb34('0x57')]=intUtil[_0xdb34('0x5f')](_0x3083e8['remoteUri']);if(_0x58a3d6&&_0x58a3d6[_0xdb34('0x60')]){logger['info'](_0xdb34('0x61'),_0xdb34('0x62'));_0x5157dd[_0xdb34('0x63')]=util['format'](_0xdb34('0x64'),_0x3083e8[_0xdb34('0x5e')],_0x5157dd[_0xdb34('0x65')],md5(_0x5157dd[_0xdb34('0x65')]));}else{_0x5157dd[_0xdb34('0x63')]='';}return getConnection(_0x3083e8)[_0xdb34('0x24')](function(_0x182fb3){_0x343168=_0x182fb3;return getUser(_0x3083e8,_0x776e7c[_0xdb34('0x66')],_0x343168);})[_0xdb34('0x24')](function(_0x379a51){_0x3aa591=_0x379a51;return getEndUser(_0x3083e8,_0x47c55b,_0x5157dd['calleridname'],_0x5157dd['calleridnum'],_0x343168);})[_0xdb34('0x24')](function(_0x54c6d0){_0x41b18d=_0x54c6d0;return getTicket(_0x3083e8,_0x3aa591,_0x41b18d,_0x47c55b,_0x5157dd,_0x47c55b['Fields'],_0x343168,_0xdb34('0x5d'));})[_0xdb34('0x24')](function(_0x58b1d8){_0xd7a800=_0x58b1d8;logger[_0xdb34('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0xd7a800['id']);logger[_0xdb34('0x1d')](_0xdb34('0x67'),_0xd7a800['id'],_0x776e7c[_0xdb34('0x52')],_0x3083e8[_0xdb34('0x3d')]);switch(_0x3083e8['type']){case _0xdb34('0x68'):emit(util[_0xdb34('0x43')]('user:%s',_0x776e7c[_0xdb34('0x52')]),_0xdb34('0x69'),{'recordId':_0xd7a800['id']});break;case _0xdb34('0x6a'):emit(util[_0xdb34('0x43')](_0xdb34('0x6b'),_0x776e7c[_0xdb34('0x52')]),_0xdb34('0x6c'),{'uri':util['format'](_0xdb34('0x6d'),_0x343168[_0xdb34('0x6e')],_0xd7a800['id'])});break;default:logger[_0xdb34('0x6f')](_0xdb34('0x70'));}})['catch'](function(_0x5345c1){logger['error'](_0xdb34('0x61'),_0x5345c1);});};exports[_0xdb34('0x71')]=function(_0x51aa8e,_0x28324a,_0x49bbe0,_0x29c2d1,_0x3b5f73,_0x2b065d,_0x186c96){var _0x47dc01,_0x58eba0,_0x331620,_0x172379;_0x2b065d[_0xdb34('0x5e')]=intUtil['stripTrailingSlash'](_0x2b065d['serverUrl']);_0x2b065d['remoteUri']=intUtil['stripTrailingSlash'](_0x2b065d[_0xdb34('0x57')]);if(_0x186c96&&_0x186c96[_0xdb34('0x72')]&&_0x186c96[_0xdb34('0x72')]!==_0xdb34('0x73')){logger[_0xdb34('0x1d')](_0xdb34('0x74'),'Recording\x20is\x20enabled!');_0x28324a[_0xdb34('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b065d[_0xdb34('0x5e')],_0x28324a['uniqueid'],md5(_0x28324a[_0xdb34('0x65')]));}return getConnection(_0x2b065d)[_0xdb34('0x24')](function(_0x57d8ca){_0x172379=_0x57d8ca;return getUser(_0x2b065d,_0x29c2d1['email'],_0x172379);})[_0xdb34('0x24')](function(_0x1c469f){_0x47dc01=_0x1c469f;return getEndUser(_0x2b065d,_0x49bbe0,_0x28324a['destcalleridname'],_0x28324a[_0xdb34('0x75')],_0x172379);})['then'](function(_0x4ea260){_0x58eba0=_0x4ea260;return getTicket(_0x2b065d,_0x47dc01,_0x58eba0,_0x49bbe0,_0x28324a,_0x49bbe0[_0xdb34('0x76')],_0x172379,_0xdb34('0x71'));})[_0xdb34('0x24')](function(_0x1d4593){_0x331620=_0x1d4593;logger[_0xdb34('0x1d')](_0xdb34('0x77'),_0x331620['id']);logger['info'](_0xdb34('0x78'),_0x331620['id'],_0x29c2d1[_0xdb34('0x52')],_0x2b065d[_0xdb34('0x3d')]);switch(_0x2b065d['type']){case'integrationTab':emit(util['format'](_0xdb34('0x6b'),_0x29c2d1[_0xdb34('0x52')]),'trigger:salesforce:display',{'recordId':_0x331620['id']});break;case _0xdb34('0x6a'):emit(util[_0xdb34('0x43')]('user:%s',_0x29c2d1[_0xdb34('0x52')]),_0xdb34('0x6c'),{'uri':util['format']('%s/%s/e',_0x172379[_0xdb34('0x6e')],_0x331620['id'])});break;default:logger[_0xdb34('0x6f')](_0xdb34('0x74'),_0xdb34('0x79'));}})['catch'](function(_0x5b2d5b){logger[_0xdb34('0x6f')](_0xdb34('0x74'),_0x5b2d5b);});};exports[_0xdb34('0x7a')]=function(_0x5d215d,_0x3bbc03,_0x403519,_0x112942,_0x590137,_0x379b12){var _0x1abb8d,_0x5a3b27,_0x5c5805,_0x2e662a;_0x379b12['serverUrl']=intUtil[_0xdb34('0x5f')](_0x379b12[_0xdb34('0x5e')]);_0x379b12[_0xdb34('0x57')]=intUtil[_0xdb34('0x5f')](_0x379b12[_0xdb34('0x57')]);if(_0x590137&&_0x590137[_0xdb34('0x60')]){logger['info']('['+_0x3bbc03[_0xdb34('0x7b')][_0xdb34('0x7c')]()+']',_0xdb34('0x62'));_0x3bbc03['recordingURL']=util[_0xdb34('0x43')](_0xdb34('0x64'),_0x379b12['serverUrl'],_0x3bbc03[_0xdb34('0x65')],md5(_0x3bbc03[_0xdb34('0x65')]));}else{_0x3bbc03[_0xdb34('0x63')]='';}return getConnection(_0x379b12)[_0xdb34('0x24')](function(_0x15d64c){_0x2e662a=_0x15d64c;if(!_[_0xdb34('0x7d')](_0x112942)){return getUser(_0x379b12,_0x112942[_0xdb34('0x52')],_0x2e662a);}else{return getUser(_0x379b12,null,_0x2e662a);}})[_0xdb34('0x24')](function(_0x2f7b2c){_0x1abb8d=_0x2f7b2c;return getEndUser(_0x379b12,_0x403519,_0x3bbc03['calleridname'],_0x3bbc03[_0xdb34('0x7e')],_0x2e662a);})[_0xdb34('0x24')](function(_0x19695f){_0x5a3b27=_0x19695f;return getTicket(_0x379b12,_0x1abb8d,_0x5a3b27,_0x403519,_0x3bbc03,_0x403519[_0xdb34('0x76')],_0x2e662a);})[_0xdb34('0x24')](function(_0x39d28d){_0x5c5805=_0x39d28d;logger[_0xdb34('0x1d')]('['+_0x3bbc03[_0xdb34('0x7b')][_0xdb34('0x7c')]()+_0xdb34('0x7f'),_0x5c5805['id']);logger['info']('['+_0x3bbc03[_0xdb34('0x7b')][_0xdb34('0x7c')]()+_0xdb34('0x80'),_0x379b12['type']);})[_0xdb34('0x81')](function(_0x4d3224){logger[_0xdb34('0x6f')]('['+_0x3bbc03[_0xdb34('0x7b')]['toUpperCase']()+']',_0x4d3224);});}; \ No newline at end of file +var _0xc04d=['length','additionalSearchLead','account_contact_lead','additionalSearchAccount','merge','Account','Lead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','','create','string','picklist','content','toString','idField','variableName','customVariable','Variable','name','password','securityToken','Connection','https://login.salesforce.com','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','endUserType','contact','lead','WhoId','account','WhatId','AccountId','leadId','info','sobject','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact'];(function(_0xc4b7d4,_0x333e4d){var _0x42e67f=function(_0x42c425){while(--_0x42c425){_0xc4b7d4['push'](_0xc4b7d4['shift']());}};_0x42e67f(++_0x333e4d);}(_0xc04d,0x1c1));var _0xdc04=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0xc04d[_0x4c98b9];return _0x3a257a;};'use strict';var _=require(_0xdc04('0x0'));var rp=require(_0xdc04('0x1'));var moment=require('moment');var BPromise=require(_0xdc04('0x2'));var md5=require(_0xdc04('0x3'));var jsforce=require(_0xdc04('0x4'));var util=require(_0xdc04('0x5'));var Redis=require(_0xdc04('0x6'));var intUtil=require(_0xdc04('0x7'));var config=require(_0xdc04('0x8'));var logger=require('../../../../config/logger')(_0xdc04('0x9'));config[_0xdc04('0xa')]=_[_0xdc04('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc04('0xa')]));function emit(_0x180b00,_0x128399,_0x164f54){io['to'](_0x180b00)[_0xdc04('0xc')](_0x128399,_0x164f54);}function getTicket(_0x2195cd,_0x456db4,_0xbe1bfd,_0x3a0324,_0x195921,_0x2430ae,_0x4cf8ed,_0x48cf94){var _0x4b8a03=Object[_0xdc04('0xd')]({},{'OwnerId':_0x456db4['id'],'Subject':intUtil[_0xdc04('0xe')](_0x3a0324[_0xdc04('0xf')],_0x195921,'\x20'),'Description':intUtil['getString'](_0x3a0324[_0xdc04('0x10')],_0x195921,'\x0a')},getCustomFields(_0x2430ae,_0x195921));if(_0xbe1bfd){if(_0x3a0324[_0xdc04('0x11')]===_0xdc04('0x12')){_0x4b8a03[_0xdc04('0x13')]=moment['utc']();_0x4b8a03['IsReminderSet']=![];_0x4b8a03['IsRecurrence']=![];if(_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x15')||_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x16')){_0x4b8a03[_0xdc04('0x17')]=_0xbe1bfd['id'];}else if(_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x18')){_0x4b8a03[_0xdc04('0x19')]=_0xbe1bfd['id'];}}else if(_0x3a0324['ticketType']==='Case'){if(_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x15')){_0x4b8a03['ContactId']=_0xbe1bfd['id'];}else if(_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x18')){_0x4b8a03[_0xdc04('0x1a')]=_0xbe1bfd['id'];}else if(_0xbe1bfd[_0xdc04('0x14')]===_0xdc04('0x16')&&_0x3a0324[_0xdc04('0x1b')]){_0x4b8a03[_0x3a0324[_0xdc04('0x1b')]]=_0xbe1bfd['id'];}else{logger[_0xdc04('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4cf8ed[_0xdc04('0x1d')](_0x3a0324[_0xdc04('0x11')])['create'](_0x4b8a03);}function getUser(_0x2a0809,_0x389a99,_0x4716c2){if(!_[_0xdc04('0x1e')](_0x389a99)&&intUtil[_0xdc04('0x1f')](_0x389a99)){var _0x51c421={'Email':_0x389a99};var _0x3bdf82={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4716c2['sobject'](_0xdc04('0x20'))[_0xdc04('0x21')](_0x51c421,_0x3bdf82)[_0xdc04('0x22')]()[_0xdc04('0x23')](function(_0x40e404){if(_0x40e404['length']){var _0x466033=_[_0xdc04('0x21')](_0x40e404,function(_0x133b96){return _0x133b96[_0xdc04('0x24')]===_0x389a99;});if(_0x466033){logger[_0xdc04('0x1c')](_0xdc04('0x25'),_0x389a99);return BPromise[_0xdc04('0x26')]({'id':_0x466033['Id'],'name':_0x466033[_0xdc04('0x27')]});}}else{logger[_0xdc04('0x1c')](_0xdc04('0x28'),_0x389a99);return _0x4716c2[_0xdc04('0x29')]()[_0xdc04('0x23')](function(_0x55be57){return BPromise[_0xdc04('0x26')]({'id':_0x55be57[_0xdc04('0x2a')],'name':_0x55be57[_0xdc04('0x2b')]});});}});}else{logger[_0xdc04('0x1c')](_0xdc04('0x28'),_0x389a99);return _0x4716c2[_0xdc04('0x29')]()['then'](function(_0x4868f){return BPromise[_0xdc04('0x26')]({'id':_0x4868f['user_id'],'name':_0x4868f[_0xdc04('0x2b')]});});}}function getEndUser(_0x5548a2,_0x1802e0,_0x309f0f,_0x390796,_0x2c0598){var _0x1969f0={'$or':{'Phone':_0x390796}};var _0x178367={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xdc04('0x26')]()[_0xdc04('0x23')](function(){logger[_0xdc04('0x1c')](_0xdc04('0x2c'),_0x390796,_0x1802e0[_0xdc04('0x2d')]);switch(_0x1802e0[_0xdc04('0x2d')]){case _0xdc04('0x2e'):var _0x16fb47=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x30')]){var _0x1a427d={};_0x1a427d[_0x1802e0[_0xdc04('0x30')]]=_0x390796;_['merge'](_0x16fb47[_0xdc04('0x31')],_0x1a427d);}return _0x2c0598['sobject'](_0xdc04('0x32'))['find'](_0x16fb47,_0x178367)[_0xdc04('0x22')]()[_0xdc04('0x23')](function(_0x11a681){if(_0x11a681&&_0x11a681[_0xdc04('0x33')]){return _0x11a681;}else{var _0x200fef=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x34')]){var _0x43602e={};_0x43602e[_0x1802e0[_0xdc04('0x34')]]=_0x390796;_['merge'](_0x200fef[_0xdc04('0x31')],_0x43602e);}return _0x2c0598[_0xdc04('0x1d')]('Lead')[_0xdc04('0x21')](_0x200fef,_0x178367);}});case _0xdc04('0x35'):var _0x2ad482=_['cloneDeep'](_0x1969f0);if(_0x1802e0[_0xdc04('0x36')]){var _0x1a427d={};_0x1a427d[_0x1802e0['additionalSearchAccount']]=_0x390796;_[_0xdc04('0x37')](_0x2ad482[_0xdc04('0x31')],_0x1a427d);}return _0x2c0598[_0xdc04('0x1d')](_0xdc04('0x38'))['find'](_0x2ad482,_0x178367)[_0xdc04('0x22')]()['then'](function(_0x1f90fa){if(_0x1f90fa&&_0x1f90fa[_0xdc04('0x33')]){return _0x1f90fa;}else{var _0x3e6f38=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x30')]){var _0x11311f={};_0x11311f[_0x1802e0[_0xdc04('0x30')]]=_0x390796;_[_0xdc04('0x37')](_0x3e6f38[_0xdc04('0x31')],_0x11311f);}return _0x2c0598['sobject'](_0xdc04('0x32'))[_0xdc04('0x21')](_0x3e6f38,_0x178367)[_0xdc04('0x23')](function(_0x1938cd){if(_0x1938cd&&_0x1938cd[_0xdc04('0x33')]){return _0x1938cd;}else{var _0x18096b=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x34')]){var _0x3f7a2c={};_0x3f7a2c[_0x1802e0[_0xdc04('0x34')]]=_0x390796;_[_0xdc04('0x37')](_0x18096b[_0xdc04('0x31')],_0x3f7a2c);}return _0x2c0598[_0xdc04('0x1d')](_0xdc04('0x39'))['find'](_0x18096b,_0x178367);}});}});case _0xdc04('0x15'):var _0x16fb47=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x30')]){var _0x1a427d={};_0x1a427d[_0x1802e0[_0xdc04('0x30')]]=_0x390796;_[_0xdc04('0x37')](_0x16fb47['$or'],_0x1a427d);}return _0x2c0598['sobject'](_0xdc04('0x32'))['find'](_0x16fb47,_0x178367)['execute']();case _0xdc04('0x16'):var _0x217b64=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0[_0xdc04('0x34')]){var _0x1a427d={};_0x1a427d[_0x1802e0['additionalSearchLead']]=_0x390796;_[_0xdc04('0x37')](_0x217b64[_0xdc04('0x31')],_0x1a427d);}return _0x2c0598['sobject']('Lead')['find'](_0x217b64,_0x178367);case _0xdc04('0x18'):var _0x2ad482=_[_0xdc04('0x2f')](_0x1969f0);if(_0x1802e0['additionalSearchAccount']){var _0x1a427d={};_0x1a427d[_0x1802e0['additionalSearchAccount']]=_0x390796;_[_0xdc04('0x37')](_0x2ad482[_0xdc04('0x31')],_0x1a427d);}return _0x2c0598[_0xdc04('0x1d')](_0xdc04('0x38'))[_0xdc04('0x21')](_0x2ad482,_0x178367);default:return null;}})[_0xdc04('0x23')](function(_0x4cffb1){if(_0x4cffb1&&_0x4cffb1[_0xdc04('0x33')]){var _0x267ff0=_[_0xdc04('0x3a')](_0x4cffb1);if(_0x267ff0){return BPromise[_0xdc04('0x26')]({'id':_0x267ff0['Id'],'name':_0x267ff0[_0xdc04('0x27')],'phone':_0x267ff0[_0xdc04('0x3b')],'endUserType':_0x267ff0[_0xdc04('0x3c')][_0xdc04('0x3d')][_0xdc04('0x3e')]()});}}})['then'](function(_0x244f9c){if(_0x244f9c){logger[_0xdc04('0x1c')](_0xdc04('0x3f'),_0x244f9c[_0xdc04('0x14')],_0x390796);return BPromise[_0xdc04('0x26')](_0x244f9c);}else{logger[_0xdc04('0x1c')](_0xdc04('0x40'),_0x390796);var _0x34335f={'Phone':_0x390796};if(_0x1802e0['moduleCreate']){if(_0x1802e0[_0xdc04('0x41')]===_0xdc04('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x390796,_0x1802e0[_0xdc04('0x41')]);_0x34335f[_0xdc04('0x42')]=_0x309f0f!==''?_0x309f0f:util[_0xdc04('0x43')]('Caller\x20-\x20%s',_0x390796);}else if(_0x1802e0[_0xdc04('0x41')]==='lead'){logger[_0xdc04('0x1c')](_0xdc04('0x44'),_0x390796,_0x1802e0[_0xdc04('0x41')]);_0x34335f['LastName']=_0x309f0f!==''?_0x309f0f:util[_0xdc04('0x43')](_0xdc04('0x45'),_0x390796);_0x34335f[_0xdc04('0x46')]=_0xdc04('0x47');}else if(_0x1802e0[_0xdc04('0x41')]===_0xdc04('0x18')){logger['info'](_0xdc04('0x44'),_0x390796,_0x1802e0[_0xdc04('0x41')]);_0x34335f['Name']=_0x309f0f!==_0xdc04('0x48')?_0x309f0f:util[_0xdc04('0x43')](_0xdc04('0x45'),_0x390796);}else{return null;}}return _0x2c0598[_0xdc04('0x1d')](_['upperFirst'](_0x1802e0[_0xdc04('0x41')]))[_0xdc04('0x49')](_0x34335f)[_0xdc04('0x23')](function(_0x3e6af1){return BPromise[_0xdc04('0x26')]({'id':_0x3e6af1['id'],'endUserType':_0x1802e0[_0xdc04('0x41')]});});}});}function getCustomFields(_0x2754c,_0x4a2f42){var _0x3b6bf5={};if(_0x2754c[_0xdc04('0x33')]>0x0){_['forEach'](_0x2754c,function(_0x578dc0){if(_['includes']([_0xdc04('0x4a'),_0xdc04('0x4b')],_0x578dc0[_0xdc04('0x3d')])&&_0x578dc0['idField']){_0x3b6bf5[_0x578dc0['idField']]=_0x578dc0[_0xdc04('0x4c')][_0xdc04('0x4d')]();}else if(_0x578dc0[_0xdc04('0x3d')]==='variable'&&_0x578dc0['variableName']&&_0x578dc0[_0xdc04('0x4e')]){_0x4a2f42[_0x578dc0[_0xdc04('0x4f')]]&&(_0x3b6bf5[_0x578dc0[_0xdc04('0x4e')]]=_0x4a2f42[_0x578dc0['variableName']][_0xdc04('0x4d')]());}else if(_0x578dc0[_0xdc04('0x3d')]===_0xdc04('0x50')&&_0x578dc0[_0xdc04('0x51')]&&_0x578dc0[_0xdc04('0x51')][_0xdc04('0x52')]&&_0x578dc0[_0xdc04('0x4e')]){_0x4a2f42[_0x578dc0[_0xdc04('0x51')][_0xdc04('0x52')][_0xdc04('0x3e')]()]&&(_0x3b6bf5[_0x578dc0[_0xdc04('0x4e')]]=_0x4a2f42[_0x578dc0[_0xdc04('0x51')][_0xdc04('0x52')][_0xdc04('0x3e')]()][_0xdc04('0x4d')]());}});}return _0x3b6bf5;}function getConnection(_0x2c20f1){var _0x2cbac6=_0x2c20f1[_0xdc04('0x53')]['concat'](_0x2c20f1[_0xdc04('0x54')]);var _0x576ea0=new jsforce[(_0xdc04('0x55'))]({'oauth2':{'loginUrl':_0x2c20f1['remoteUri']||_0xdc04('0x56'),'clientId':_0x2c20f1['clientId'],'clientSecret':_0x2c20f1['clientSecret']}});return _0x576ea0[_0xdc04('0x57')](_0x2c20f1[_0xdc04('0x58')],_0x2cbac6)[_0xdc04('0x23')](function(){logger['info'](_0xdc04('0x59'));return _0x576ea0;});}exports['queue']=function(_0x441708,_0x324a1d,_0x295d72,_0x2a93cc,_0x1594a4,_0x10c340){var _0x185ccc,_0x2ddc8a,_0x22303f,_0x52c9e3;_0x10c340[_0xdc04('0x5a')]=intUtil['stripTrailingSlash'](_0x10c340[_0xdc04('0x5a')]);_0x10c340['remoteUri']=intUtil[_0xdc04('0x5b')](_0x10c340[_0xdc04('0x5c')]);if(_0x1594a4&&_0x1594a4[_0xdc04('0x5d')]){logger[_0xdc04('0x1c')](_0xdc04('0x5e'),_0xdc04('0x5f'));_0x324a1d[_0xdc04('0x60')]=util[_0xdc04('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10c340[_0xdc04('0x5a')],_0x324a1d[_0xdc04('0x61')],md5(_0x324a1d[_0xdc04('0x61')]));}else{_0x324a1d['recordingURL']='';}return getConnection(_0x10c340)[_0xdc04('0x23')](function(_0x537af4){_0x52c9e3=_0x537af4;return getUser(_0x10c340,_0x2a93cc[_0xdc04('0x62')],_0x52c9e3);})[_0xdc04('0x23')](function(_0x396f1f){_0x185ccc=_0x396f1f;return getEndUser(_0x10c340,_0x295d72,_0x324a1d[_0xdc04('0x63')],_0x324a1d[_0xdc04('0x64')],_0x52c9e3);})[_0xdc04('0x23')](function(_0xf9e3b1){_0x2ddc8a=_0xf9e3b1;return getTicket(_0x10c340,_0x185ccc,_0x2ddc8a,_0x295d72,_0x324a1d,_0x295d72[_0xdc04('0x65')],_0x52c9e3,_0xdc04('0x66'));})[_0xdc04('0x23')](function(_0x1cf489){_0x22303f=_0x1cf489;logger[_0xdc04('0x1c')](_0xdc04('0x67'),_0x22303f['id']);logger[_0xdc04('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x22303f['id'],_0x2a93cc['name'],_0x10c340[_0xdc04('0x3d')]);switch(_0x10c340[_0xdc04('0x3d')]){case _0xdc04('0x68'):emit(util[_0xdc04('0x43')]('user:%s',_0x2a93cc[_0xdc04('0x52')]),_0xdc04('0x69'),{'recordId':_0x22303f['id']});break;case'newTab':emit(util[_0xdc04('0x43')](_0xdc04('0x6a'),_0x2a93cc[_0xdc04('0x52')]),'trigger:browser:url',{'uri':util['format'](_0xdc04('0x6b'),_0x52c9e3[_0xdc04('0x6c')],_0x22303f['id'])});break;default:logger[_0xdc04('0x6d')](_0xdc04('0x6e'));}})[_0xdc04('0x6f')](function(_0x25f01c){logger['error'](_0xdc04('0x5e'),_0x25f01c);});};exports['outbound']=function(_0x227982,_0x5e37e5,_0x2cd191,_0x4d3890,_0xb51dfe,_0xe3f804,_0x57b121){var _0xc2179c,_0x46199c,_0x101b99,_0xc4f8a3;_0xe3f804[_0xdc04('0x5a')]=intUtil[_0xdc04('0x5b')](_0xe3f804[_0xdc04('0x5a')]);_0xe3f804[_0xdc04('0x5c')]=intUtil[_0xdc04('0x5b')](_0xe3f804[_0xdc04('0x5c')]);if(_0x57b121&&_0x57b121[_0xdc04('0x70')]&&_0x57b121[_0xdc04('0x70')]!==_0xdc04('0x71')){logger[_0xdc04('0x1c')](_0xdc04('0x72'),'Recording\x20is\x20enabled!');_0x5e37e5[_0xdc04('0x60')]=util[_0xdc04('0x43')](_0xdc04('0x73'),_0xe3f804[_0xdc04('0x5a')],_0x5e37e5[_0xdc04('0x61')],md5(_0x5e37e5[_0xdc04('0x61')]));}return getConnection(_0xe3f804)['then'](function(_0x3e7683){_0xc4f8a3=_0x3e7683;return getUser(_0xe3f804,_0x4d3890[_0xdc04('0x62')],_0xc4f8a3);})[_0xdc04('0x23')](function(_0x20866b){_0xc2179c=_0x20866b;return getEndUser(_0xe3f804,_0x2cd191,_0x5e37e5[_0xdc04('0x74')],_0x5e37e5[_0xdc04('0x75')],_0xc4f8a3);})[_0xdc04('0x23')](function(_0x40ac7b){_0x46199c=_0x40ac7b;return getTicket(_0xe3f804,_0xc2179c,_0x46199c,_0x2cd191,_0x5e37e5,_0x2cd191['Fields'],_0xc4f8a3,'outbound');})[_0xdc04('0x23')](function(_0x595be9){_0x101b99=_0x595be9;logger[_0xdc04('0x1c')](_0xdc04('0x76'),_0x101b99['id']);logger[_0xdc04('0x1c')](_0xdc04('0x77'),_0x101b99['id'],_0x4d3890[_0xdc04('0x52')],_0xe3f804[_0xdc04('0x3d')]);switch(_0xe3f804['type']){case _0xdc04('0x68'):emit(util[_0xdc04('0x43')](_0xdc04('0x6a'),_0x4d3890[_0xdc04('0x52')]),_0xdc04('0x69'),{'recordId':_0x101b99['id']});break;case'newTab':emit(util[_0xdc04('0x43')](_0xdc04('0x6a'),_0x4d3890['name']),_0xdc04('0x78'),{'uri':util['format'](_0xdc04('0x6b'),_0xc4f8a3['instanceUrl'],_0x101b99['id'])});break;default:logger[_0xdc04('0x6d')](_0xdc04('0x72'),_0xdc04('0x79'));}})[_0xdc04('0x6f')](function(_0x57b61b){logger['error'](_0xdc04('0x72'),_0x57b61b);});};exports[_0xdc04('0x7a')]=function(_0x1894b3,_0x3a3d0f,_0x4c35e6,_0x2b618e,_0x318fb4,_0x1b10f5){var _0x307c3c,_0x2ef206,_0x2639bb,_0x5d10da;_0x1b10f5[_0xdc04('0x5a')]=intUtil[_0xdc04('0x5b')](_0x1b10f5[_0xdc04('0x5a')]);_0x1b10f5[_0xdc04('0x5c')]=intUtil[_0xdc04('0x5b')](_0x1b10f5['remoteUri']);if(_0x318fb4&&_0x318fb4[_0xdc04('0x5d')]){logger[_0xdc04('0x1c')]('['+_0x3a3d0f[_0xdc04('0x7b')]['toUpperCase']()+']',_0xdc04('0x5f'));_0x3a3d0f['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b10f5[_0xdc04('0x5a')],_0x3a3d0f[_0xdc04('0x61')],md5(_0x3a3d0f[_0xdc04('0x61')]));}else{_0x3a3d0f[_0xdc04('0x60')]='';}return getConnection(_0x1b10f5)[_0xdc04('0x23')](function(_0x5f1665){_0x5d10da=_0x5f1665;if(!_[_0xdc04('0x1e')](_0x2b618e)){return getUser(_0x1b10f5,_0x2b618e['name'],_0x5d10da);}else{return getUser(_0x1b10f5,null,_0x5d10da);}})[_0xdc04('0x23')](function(_0x17471a){_0x307c3c=_0x17471a;return getEndUser(_0x1b10f5,_0x4c35e6,_0x3a3d0f[_0xdc04('0x63')],_0x3a3d0f[_0xdc04('0x64')],_0x5d10da);})[_0xdc04('0x23')](function(_0x541e09){_0x2ef206=_0x541e09;return getTicket(_0x1b10f5,_0x307c3c,_0x2ef206,_0x4c35e6,_0x3a3d0f,_0x4c35e6['Fields'],_0x5d10da);})[_0xdc04('0x23')](function(_0x4598a0){_0x2639bb=_0x4598a0;logger[_0xdc04('0x1c')]('['+_0x3a3d0f[_0xdc04('0x7b')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x2639bb['id']);logger[_0xdc04('0x1c')]('['+_0x3a3d0f[_0xdc04('0x7b')]['toUpperCase']()+_0xdc04('0x7c'),_0x1b10f5[_0xdc04('0x3d')]);})[_0xdc04('0x6f')](function(_0x9c80d8){logger['error']('['+_0x3a3d0f[_0xdc04('0x7b')]['toUpperCase']()+']',_0x9c80d8);});}; \ 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 3b88c68..4d5900e 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 _0x4263=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','nameField','content','toString','type','idField','customField','toLowerCase','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x23e77c,_0x11b8a5){var _0x43e3cc=function(_0x4e7930){while(--_0x4e7930){_0x23e77c['push'](_0x23e77c['shift']());}};_0x43e3cc(++_0x11b8a5);}(_0x4263,0x1d3));var _0x3426=function(_0x86c69b,_0x47c978){_0x86c69b=_0x86c69b-0x0;var _0xffc8a=_0x4263[_0x86c69b];return _0xffc8a;};'use strict';var _=require(_0x3426('0x0'));var Promise=require(_0x3426('0x1'));var rp=require(_0x3426('0x2'));var util=require(_0x3426('0x3'));var md5=require(_0x3426('0x4'));var Redis=require(_0x3426('0x5'));var intUtil=require(_0x3426('0x6'));var config=require(_0x3426('0x7'));var logger=require(_0x3426('0x8'))(_0x3426('0x9'));config['redis']=_[_0x3426('0xa')](config[_0x3426('0xb')],{'host':_0x3426('0xc'),'port':0x18eb});var io=require(_0x3426('0xd'))(new Redis(config['redis']));function getAdminUser(_0x355ad9,_0x50c360,_0x3de2ae,_0x3d32e2,_0x28ce35,_0x16f680){return new Promise(function(_0x231ad9,_0x559a32){var _0x1cb7a5={'method':'GET','uri':_0x3d32e2+_0x3426('0xe')+'&'+_0x28ce35+'&'+_0x16f680,'auth':_0x50c360,'json':!![]};return rp(_0x1cb7a5)['then'](function(_0x1101fb){if(_0x1101fb[_0x3426('0xf')][_0x3426('0x10')]>0x0){_0x3de2ae[_0x3426('0x11')]=_0x1101fb['result'][0x0][_0x3426('0x12')];}logger[_0x3426('0x13')]('['+[_0x355ad9[_0x3426('0x14')]()]+_0x3426('0x15'),_0x3de2ae);_0x231ad9(_0x3de2ae);})[_0x3426('0x16')](function(_0x1dd890){logger[_0x3426('0x17')]('['+[_0x355ad9[_0x3426('0x14')]()]+']',_0x1dd890['message']);_0x559a32(_0x1dd890[_0x3426('0x18')]);});});}function getUser(_0x51332f,_0x5123da,_0x30e9ab,_0x20d0b2,_0x299a52){return function(_0x1a0590){logger[_0x3426('0x13')]('['+[_0x51332f[_0x3426('0x14')]()]+_0x3426('0x19'),_0x1a0590);return new Promise(function(_0x9a7909,_0x55b0d8){if(intUtil['validateEmail'](_0x1a0590[_0x3426('0x1a')])){var _0x375251={'method':_0x3426('0x1b'),'uri':_0x30e9ab+_0x3426('0x1c')+_0x1a0590[_0x3426('0x1a')]+'&'+_0x20d0b2+'&'+_0x299a52,'auth':_0x5123da,'json':!![]};logger[_0x3426('0x13')]('['+[_0x51332f[_0x3426('0x14')]()]+_0x3426('0x1d'),_0x375251);return rp(_0x375251)[_0x3426('0x1e')](function(_0x21733a){logger[_0x3426('0x13')]('['+[_0x51332f[_0x3426('0x14')]()]+_0x3426('0x1f'),_0x21733a);if(_0x21733a[_0x3426('0xf')][_0x3426('0x10')]>0x0&&String(_0x21733a[_0x3426('0xf')][0x0][_0x3426('0x20')])==='true'){_0x1a0590[_0x3426('0x21')]=_0x21733a[_0x3426('0xf')][0x0][_0x3426('0x12')];}else{_0x1a0590[_0x3426('0x21')]=_0x1a0590['adminId'];_0x1a0590[_0x3426('0x1a')]=_0x1a0590[_0x3426('0x22')];}logger['info']('['+[_0x51332f[_0x3426('0x14')]()]+_0x3426('0x23'),_0x1a0590);_0x9a7909(_0x1a0590);})[_0x3426('0x16')](function(_0x10c04a){logger[_0x3426('0x17')]('['+[_0x51332f[_0x3426('0x14')]()]+']',_0x10c04a[_0x3426('0x18')]);_0x55b0d8(_0x10c04a[_0x3426('0x18')]);});}else{logger[_0x3426('0x13')]('['+[_0x51332f[_0x3426('0x14')]()]+_0x3426('0x24'));_0x1a0590['userId']=_0x1a0590[_0x3426('0x11')];_0x1a0590[_0x3426('0x1a')]=_0x1a0590[_0x3426('0x22')];_0x9a7909(_0x1a0590);}});};}function createEndUser(_0x3be397,_0x1c857c,_0x2aba6e,_0x315b2f,_0x2c1014){logger[_0x3426('0x13')]('['+[_0x3be397[_0x3426('0x14')]()]+_0x3426('0x25'),_0x2aba6e);return new Promise(function(_0x278c8,_0x1b1e10){var _0x3ca65c={'method':_0x3426('0x26'),'uri':_0x315b2f+_0x3426('0x27')+_0x2c1014,'body':{'user_name':_0x2aba6e[_0x3426('0x28')],'roles':_0x3426('0x29'),'first_name':_0x2aba6e[_0x3426('0x28')],'active':_0x3426('0x2a'),'date_format':_0x3426('0x2b'),'phone':_0x2aba6e[_0x3426('0x28')]},'auth':_0x1c857c,'json':!![]};return rp(_0x3ca65c)[_0x3426('0x1e')](function(_0x59ba96){logger['info']('['+[_0x3be397[_0x3426('0x14')]()]+_0x3426('0x2c'),_0x59ba96[_0x3426('0xf')]);_0x2aba6e[_0x3426('0x2d')]=_0x59ba96['result']['sys_id'];_0x278c8(_0x2aba6e);})['catch'](function(_0x56b662){logger[_0x3426('0x17')]('['+[_0x3be397[_0x3426('0x14')]()]+']',_0x56b662[_0x3426('0x18')]);_0x1b1e10(_0x56b662['message']);});});}function getEndUser(_0x7ee24b,_0x3ed8ae,_0x5cf340,_0x2baa07,_0x2f631e){return function(_0x3397cf){logger[_0x3426('0x13')]('['+[_0x7ee24b[_0x3426('0x14')]()]+_0x3426('0x2e'),_0x3397cf);return new Promise(function(_0x390f4e,_0x755956){var _0x473bcb={'method':_0x3426('0x1b'),'uri':_0x5cf340+_0x3426('0x2f')+_0x3397cf[_0x3426('0x28')]+'&'+_0x2baa07+'&'+_0x2f631e,'auth':_0x3ed8ae,'json':!![]};return rp(_0x473bcb)[_0x3426('0x1e')](function(_0x147fec){if(_0x147fec['result'][_0x3426('0x10')]>0x0){_0x3397cf[_0x3426('0x2d')]=_0x147fec['result'][0x0][_0x3426('0x12')];logger[_0x3426('0x13')]('['+[_0x7ee24b[_0x3426('0x14')]()]+_0x3426('0x30'),_0x3397cf);_0x390f4e(_0x3397cf);}else{return createEndUser(_0x7ee24b,_0x3ed8ae,_0x3397cf,_0x5cf340,_0x2baa07)['then'](function(_0xade686){logger['info']('['+[_0x7ee24b[_0x3426('0x14')]()]+_0x3426('0x31'),_0xade686);_0x390f4e(_0xade686);});}})[_0x3426('0x16')](function(_0x41627e){logger[_0x3426('0x17')]('['+[_0x7ee24b[_0x3426('0x14')]()]+']',_0x41627e['message']);_0x755956(_0x41627e['message']);});});};}function getCustomFields(_0x4dc3df,_0x572adb){var _0xec6ac1={};if(_0x4dc3df[_0x3426('0x10')]>0x0){_[_0x3426('0x32')](_0x4dc3df,function(_0x3af53b){if(_['includes']([_0x3426('0x33'),_0x3426('0x34')],_0x3af53b['type'])&&_0x3af53b[_0x3426('0x35')]&&!_0x3af53b['customField']){_0xec6ac1[_0x3af53b[_0x3426('0x35')]['toLowerCase']()]=_0x3af53b[_0x3426('0x36')][_0x3426('0x37')]();}else if(_['includes'](['string',_0x3426('0x34')],_0x3af53b[_0x3426('0x38')])&&_0x3af53b[_0x3426('0x39')]&&_0x3af53b[_0x3426('0x3a')]){_0xec6ac1[_0x3af53b[_0x3426('0x39')][_0x3426('0x3b')]()]=_0x3af53b[_0x3426('0x36')][_0x3426('0x37')]();}else if(_0x3af53b[_0x3426('0x38')]==='variable'&&_0x3af53b[_0x3426('0x3c')]&&_0x3af53b['idField']&&_0x3af53b[_0x3426('0x3a')]){_0xec6ac1[_0x3af53b[_0x3426('0x39')][_0x3426('0x3b')]()]=_0x572adb[_0x3af53b[_0x3426('0x3c')]][_0x3426('0x37')]();}else if(_0x3af53b[_0x3426('0x38')]===_0x3426('0x3d')&&_0x3af53b[_0x3426('0x3e')]&&_0x3af53b['Variable'][_0x3426('0x3f')]&&_0x3af53b[_0x3426('0x39')]&&_0x3af53b[_0x3426('0x3a')]){_0xec6ac1[_0x3af53b[_0x3426('0x39')][_0x3426('0x3b')]()]=_0x572adb[_0x3af53b['Variable']['name'][_0x3426('0x3b')]()][_0x3426('0x37')]();}});}return _0xec6ac1;}function getTicket(_0x5dcaea,_0x357c4f,_0x469f61,_0x32f902,_0x7f45a3,_0xac3b4f){return function(_0x448461){logger[_0x3426('0x13')]('['+[_0x5dcaea[_0x3426('0x14')]()]+']\x20getTicket\x20input\x20crm',_0x448461);return new Promise(function(_0x35e816,_0x3daa54){var _0x31e9c0=_0x5dcaea[_0x3426('0x3b')]()===_0x3426('0x40')?_0x448461['userId']:_0x448461[_0x3426('0x2d')];var _0x760a01={'method':_0x3426('0x26'),'uri':_0x469f61+_0x3426('0x41')+'?'+_0xac3b4f,'body':Object[_0x3426('0x42')]({},{'active':'true','caller_id':_0x31e9c0,'assigned_to':_0x448461[_0x3426('0x21')],'short_description':intUtil[_0x3426('0x43')](_0x32f902[_0x3426('0x44')],_0x7f45a3,'\x20'),'description':intUtil[_0x3426('0x43')](_0x32f902[_0x3426('0x45')],_0x7f45a3,'\x0a')},getCustomFields(_0x32f902[_0x3426('0x46')],_0x7f45a3)),'auth':_0x357c4f,'json':!![]};return rp(_0x760a01)[_0x3426('0x1e')](function(_0x4baf4b){logger[_0x3426('0x13')]('['+[_0x5dcaea[_0x3426('0x14')]()]+_0x3426('0x47'),_0x4baf4b[_0x3426('0xf')]);_0x448461[_0x3426('0x48')]=_0x4baf4b[_0x3426('0xf')]['sys_id'];_0x448461[_0x3426('0x49')]=_0x4baf4b[_0x3426('0xf')][_0x3426('0x4a')];logger[_0x3426('0x13')]('['+[_0x5dcaea[_0x3426('0x14')]()]+_0x3426('0x4b'),_0x448461);_0x35e816(_0x448461);})[_0x3426('0x16')](function(_0x52b1c9){logger['error']('['+[_0x5dcaea['toUpperCase']()]+']',_0x52b1c9[_0x3426('0x18')]);_0x3daa54(_0x52b1c9[_0x3426('0x18')]);});});};}function createRemoteTag(_0x26d9a7,_0xce3efd,_0x33dae0,_0x30d9fd){return new Promise(function(_0xe3de44,_0x50656a){var _0x14c473={'method':_0x3426('0x26'),'uri':_0x33dae0+_0x3426('0x4c')+'?'+_0x30d9fd,'body':{'short_description':_0x26d9a7,'global':!![],'active':!![],'name':_0x26d9a7},'auth':_0xce3efd,'json':!![]};return rp(_0x14c473)[_0x3426('0x1e')](function(_0x14b4fe){var _0x41ef8f=_0x14b4fe[_0x3426('0xf')][_0x3426('0x12')];_0xe3de44(_0x41ef8f);});});}function getRemoteTag(_0x139f5e,_0x3f251f,_0xd9e1af,_0x359a01,_0x2f3730){return new Promise(function(_0x4dce68,_0x5c18b0){var _0x4b079d={'method':_0x3426('0x1b'),'uri':_0xd9e1af+_0x3426('0x4c')+_0x3426('0x4d')+_0x139f5e+'&'+_0x359a01,'auth':_0x3f251f,'json':!![]};return rp(_0x4b079d)['then'](function(_0x1cd145){if(_0x1cd145[_0x3426('0xf')][_0x3426('0x10')]>0x0){var _0x4c2534=_0x1cd145[_0x3426('0xf')][0x0][_0x3426('0x12')];_0x4dce68(_0x4c2534);}else{return createRemoteTag(_0x139f5e,_0x3f251f,_0xd9e1af,_0x359a01)['then'](function(_0x4740d6){_0x4dce68(_0x4740d6);});}});});}function assignTagToIncident(_0x1c1892,_0x462d56,_0x28a712,_0x207521,_0x465d6a){return new Promise(function(_0x24e84d,_0x2fc1c4){var _0x52f9ce={'method':'POST','uri':_0x28a712+'label_entry'+'?'+_0x465d6a,'body':{'label':_0x1c1892,'table':'incident','id_type':_0x3426('0x4e'),'table_key':_0x207521['ticketId'],'title':'Incident\x20-\x20'+_0x207521[_0x3426('0x49')],'id_display':_0x207521[_0x3426('0x49')]},'auth':_0x462d56,'json':!![]};return rp(_0x52f9ce)[_0x3426('0x1e')](function(_0xb77629){_0x24e84d();})[_0x3426('0x16')](function(){_0x24e84d();});});}function manageTags(_0x152663,_0x11f8f8,_0x3aab4e,_0x170502,_0x4af859,_0x5a3d59,_0xe38a0e){return new Promise(function(_0x1d9058,_0x2b941){var _0x3a4c32=[];_0x11f8f8[_0x3426('0x32')](function(_0xad3fde){_0x3a4c32[_0x3426('0x4f')](getRemoteTag(_0xad3fde,_0x3aab4e,_0x170502,_0x5a3d59,_0xe38a0e));});return Promise[_0x3426('0x50')](_0x3a4c32)[_0x3426('0x1e')](function(_0x501857){if(_0x501857[_0x3426('0x10')]){logger[_0x3426('0x13')]('['+[_0x152663['toUpperCase']()]+_0x3426('0x51'),_0x501857);var _0x149655=[];_0x501857[_0x3426('0x32')](function(_0x24effc){_0x149655[_0x3426('0x4f')](assignTagToIncident(_0x24effc,_0x3aab4e,_0x170502,_0x4af859,_0x5a3d59));});return Promise[_0x3426('0x50')](_0x149655)[_0x3426('0x1e')](function(){_0x1d9058();})[_0x3426('0x16')](function(){_0x1d9058();});}else{_0x1d9058();}});});}function getTags(_0x53a3b7,_0x19853d,_0x1eed8e,_0xb34b03,_0x30c43c,_0x42e920){return function(_0x597271){return new Promise(function(_0xe55ed3,_0x5a5d80){var _0x10a443=[];var _0x16f568=_0xb34b03['Tags'];if(_0x16f568&&_0x16f568['length']>0x0){_0x10a443=_[_0x3426('0x52')](_0x16f568,_0x3426('0x3f'));}if(_0x10a443[_0x3426('0x10')]>0x0){return manageTags(_0x53a3b7,_0x10a443,_0x19853d,_0x1eed8e,_0x597271,_0x30c43c,_0x42e920)[_0x3426('0x1e')](function(){_0xe55ed3(_0x597271);});}else{_0xe55ed3(_0x597271);}});};}function emit(_0x44bd38,_0x41996e,_0x4621e0){var _0x422af6='%26sysparm_record_target%3Dincident'+_0x3426('0x53')+_0x3426('0x54')+_0x3426('0x55');var _0x1de1f5={'uri':_0x44bd38+_0x3426('0x56')+_0x4621e0+_0x422af6};io['to'](util[_0x3426('0x57')](_0x3426('0x58'),_0x41996e))[_0x3426('0x59')](_0x3426('0x5a'),_0x1de1f5);}exports['cs']=function(_0x3c75cb,_0x2559c5,_0x2e2631,_0x216753,_0x5508e8,_0x3b3c9b,_0x51c68a,_0x3b0ded){var _0x370249={};var _0x47f8e9={'user':_0x3b3c9b[_0x3426('0x5b')],'pass':_0x3b3c9b[_0x3426('0x5c')]};var _0x71b64a=_0x3426('0x5d');var _0x454971=_0x3426('0x5e');_0x3b3c9b[_0x3426('0x5f')]=intUtil[_0x3426('0x60')](_0x3b3c9b[_0x3426('0x5f')]);_0x3b3c9b[_0x3426('0x61')]=intUtil[_0x3426('0x60')](_0x3b3c9b['serverUrl']);var _0x264cdb=util[_0x3426('0x57')](_0x3426('0x62'),_0x3b3c9b[_0x3426('0x5f')]);_0x370249['userEmail']=!_[_0x3426('0x63')](_0x216753)?_0x216753['email']:null;_0x370249[_0x3426('0x22')]=_0x3b3c9b[_0x3426('0x64')];_0x370249[_0x3426('0x28')]=_0x3b0ded[_0x3426('0x3b')]()===_0x3426('0x40')?_0x2559c5[_0x3426('0x65')]:_0x2559c5[_0x3426('0x66')];_0x370249[_0x3426('0x67')]=_0x3b0ded===_0x3426('0x68')||_0x3b0ded===_0x3426('0x69')?_0x3426('0x68'):_0x3426('0x40');var _0x4366fb=util[_0x3426('0x57')](_0x3426('0x6a'),_0x3b3c9b[_0x3426('0x61')],_0x2559c5[_0x3426('0x6b')],md5(_0x2559c5[_0x3426('0x6b')]));if(_0x5508e8&&_0x5508e8[_0x3426('0x6c')]){logger[_0x3426('0x13')](_0x3426('0x6d'),_0x3426('0x6e'));_0x2559c5[_0x3426('0x6f')]=_0x4366fb;}else if(_0x51c68a&&_0x51c68a[_0x3426('0x70')]&&_0x51c68a[_0x3426('0x70')]!=='none'){logger[_0x3426('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2559c5['recordingURL']=_0x4366fb;}else{_0x2559c5[_0x3426('0x6f')]='';}return getAdminUser(_0x3b0ded,_0x47f8e9,_0x370249,_0x264cdb,_0x454971,_0x71b64a)[_0x3426('0x1e')](getUser(_0x3b0ded,_0x47f8e9,_0x264cdb,_0x454971,_0x71b64a))[_0x3426('0x1e')](getEndUser(_0x3b0ded,_0x47f8e9,_0x264cdb,_0x454971,_0x71b64a))[_0x3426('0x1e')](getTicket(_0x3b0ded,_0x47f8e9,_0x264cdb,_0x2e2631,_0x2559c5,_0x454971))[_0x3426('0x1e')](function(_0x4ead2a){logger[_0x3426('0x13')](util[_0x3426('0x57')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4ead2a[_0x3426('0x48')]));logger[_0x3426('0x13')](util[_0x3426('0x57')]('call\x20direction:\x20%s',_0x3b0ded));if(_0x3b0ded!==_0x3426('0x69')){logger[_0x3426('0x13')]('['+[_0x3b0ded['toUpperCase']()]+']',_0x3426('0x71'));emit(_0x3b3c9b[_0x3426('0x5f')],_0x216753[_0x3426('0x3f')],_0x4ead2a[_0x3426('0x48')]);}})[_0x3426('0x16')](function(_0x4916e4){logger[_0x3426('0x17')]('['+[_0x3b0ded['toUpperCase']()]+_0x3426('0x72'),util['inspect'](_0x4916e4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8f11=['request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','],\x20getUser\x20crm','catch','POST','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x8f11,0x69));var _0x18f1=function(_0x22f8e2,_0x4b065b){_0x22f8e2=_0x22f8e2-0x0;var _0x4be54d=_0x8f11[_0x22f8e2];return _0x4be54d;};'use strict';var _=require(_0x18f1('0x0'));var Promise=require(_0x18f1('0x1'));var rp=require(_0x18f1('0x2'));var util=require(_0x18f1('0x3'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x18f1('0x4'));var config=require(_0x18f1('0x5'));var logger=require(_0x18f1('0x6'))('servicenow');config[_0x18f1('0x7')]=_[_0x18f1('0x8')](config[_0x18f1('0x7')],{'host':_0x18f1('0x9'),'port':0x18eb});var io=require(_0x18f1('0xa'))(new Redis(config['redis']));function getAdminUser(_0x509f3a,_0x53ef11,_0x2500b4,_0x5e33a0,_0x317035,_0x40dd0f){return new Promise(function(_0x4d5448,_0x2fa052){var _0x3ab9c9={'method':_0x18f1('0xb'),'uri':_0x5e33a0+_0x18f1('0xc')+'&'+_0x317035+'&'+_0x40dd0f,'auth':_0x53ef11,'json':!![]};return rp(_0x3ab9c9)[_0x18f1('0xd')](function(_0x527836){if(_0x527836[_0x18f1('0xe')][_0x18f1('0xf')]>0x0){_0x2500b4[_0x18f1('0x10')]=_0x527836['result'][0x0][_0x18f1('0x11')];}logger[_0x18f1('0x12')]('['+[_0x509f3a[_0x18f1('0x13')]()]+'],\x20getAdminUser\x20crm',_0x2500b4);_0x4d5448(_0x2500b4);})['catch'](function(_0x482ea9){logger[_0x18f1('0x14')]('['+[_0x509f3a[_0x18f1('0x13')]()]+']',_0x482ea9[_0x18f1('0x15')]);_0x2fa052(_0x482ea9[_0x18f1('0x15')]);});});}function getUser(_0x11641e,_0x330e5e,_0x38e676,_0x46e5b0,_0x27c73d){return function(_0x1dfb53){logger[_0x18f1('0x12')]('['+[_0x11641e[_0x18f1('0x13')]()]+_0x18f1('0x16'),_0x1dfb53);return new Promise(function(_0x5f5ac9,_0x2604c3){if(intUtil[_0x18f1('0x17')](_0x1dfb53[_0x18f1('0x18')])){var _0x1b5f71={'method':_0x18f1('0xb'),'uri':_0x38e676+_0x18f1('0x19')+_0x1dfb53[_0x18f1('0x18')]+'&'+_0x46e5b0+'&'+_0x27c73d,'auth':_0x330e5e,'json':!![]};logger['info']('['+[_0x11641e[_0x18f1('0x13')]()]+_0x18f1('0x1a'),_0x1b5f71);return rp(_0x1b5f71)['then'](function(_0x92cb66){logger[_0x18f1('0x12')]('['+[_0x11641e['toUpperCase']()]+_0x18f1('0x1b'),_0x92cb66);if(_0x92cb66['result']['length']>0x0&&String(_0x92cb66[_0x18f1('0xe')][0x0][_0x18f1('0x1c')])==='true'){_0x1dfb53[_0x18f1('0x1d')]=_0x92cb66[_0x18f1('0xe')][0x0][_0x18f1('0x11')];}else{_0x1dfb53[_0x18f1('0x1d')]=_0x1dfb53[_0x18f1('0x10')];_0x1dfb53[_0x18f1('0x18')]=_0x1dfb53['adminEmail'];}logger[_0x18f1('0x12')]('['+[_0x11641e[_0x18f1('0x13')]()]+_0x18f1('0x1e'),_0x1dfb53);_0x5f5ac9(_0x1dfb53);})[_0x18f1('0x1f')](function(_0x2461c2){logger['error']('['+[_0x11641e['toUpperCase']()]+']',_0x2461c2['message']);_0x2604c3(_0x2461c2[_0x18f1('0x15')]);});}else{logger[_0x18f1('0x12')]('['+[_0x11641e[_0x18f1('0x13')]()]+']\x20using\x20admin\x20profile');_0x1dfb53[_0x18f1('0x1d')]=_0x1dfb53[_0x18f1('0x10')];_0x1dfb53[_0x18f1('0x18')]=_0x1dfb53['adminEmail'];_0x5f5ac9(_0x1dfb53);}});};}function createEndUser(_0x40cb25,_0x1cd04a,_0x5ee83d,_0x42f697,_0x24d01a){logger[_0x18f1('0x12')]('['+[_0x40cb25[_0x18f1('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x5ee83d);return new Promise(function(_0x1752dd,_0x2e43ff){var _0x37e73c={'method':_0x18f1('0x20'),'uri':_0x42f697+'sys_user?'+_0x24d01a,'body':{'user_name':_0x5ee83d[_0x18f1('0x21')],'roles':_0x18f1('0x22'),'first_name':_0x5ee83d[_0x18f1('0x21')],'active':_0x18f1('0x23'),'date_format':'System','phone':_0x5ee83d[_0x18f1('0x21')]},'auth':_0x1cd04a,'json':!![]};return rp(_0x37e73c)[_0x18f1('0xd')](function(_0x187fa1){logger[_0x18f1('0x12')]('['+[_0x40cb25[_0x18f1('0x13')]()]+_0x18f1('0x24'),_0x187fa1[_0x18f1('0xe')]);_0x5ee83d[_0x18f1('0x25')]=_0x187fa1[_0x18f1('0xe')]['sys_id'];_0x1752dd(_0x5ee83d);})[_0x18f1('0x1f')](function(_0x5a7af7){logger[_0x18f1('0x14')]('['+[_0x40cb25[_0x18f1('0x13')]()]+']',_0x5a7af7[_0x18f1('0x15')]);_0x2e43ff(_0x5a7af7[_0x18f1('0x15')]);});});}function getEndUser(_0x506ab0,_0x363be6,_0x774a38,_0x149d9a,_0x34bc7d){return function(_0x2412a2){logger[_0x18f1('0x12')]('['+[_0x506ab0[_0x18f1('0x13')]()]+_0x18f1('0x26'),_0x2412a2);return new Promise(function(_0x4031f0,_0x153008){var _0x46f578={'method':'GET','uri':_0x774a38+_0x18f1('0x27')+_0x2412a2[_0x18f1('0x21')]+'&'+_0x149d9a+'&'+_0x34bc7d,'auth':_0x363be6,'json':!![]};return rp(_0x46f578)[_0x18f1('0xd')](function(_0x5dd7ee){if(_0x5dd7ee[_0x18f1('0xe')]['length']>0x0){_0x2412a2[_0x18f1('0x25')]=_0x5dd7ee[_0x18f1('0xe')][0x0][_0x18f1('0x11')];logger[_0x18f1('0x12')]('['+[_0x506ab0[_0x18f1('0x13')]()]+_0x18f1('0x28'),_0x2412a2);_0x4031f0(_0x2412a2);}else{return createEndUser(_0x506ab0,_0x363be6,_0x2412a2,_0x774a38,_0x149d9a)[_0x18f1('0xd')](function(_0x54d637){logger['info']('['+[_0x506ab0['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x54d637);_0x4031f0(_0x54d637);});}})[_0x18f1('0x1f')](function(_0x346cef){logger['error']('['+[_0x506ab0[_0x18f1('0x13')]()]+']',_0x346cef[_0x18f1('0x15')]);_0x153008(_0x346cef['message']);});});};}function getCustomFields(_0x3ef326,_0x3e4824){var _0x29bc9f={};if(_0x3ef326[_0x18f1('0xf')]>0x0){_[_0x18f1('0x29')](_0x3ef326,function(_0x319bf7){if(_[_0x18f1('0x2a')](['string',_0x18f1('0x2b')],_0x319bf7[_0x18f1('0x2c')])&&_0x319bf7[_0x18f1('0x2d')]&&!_0x319bf7[_0x18f1('0x2e')]){_0x29bc9f[_0x319bf7[_0x18f1('0x2d')][_0x18f1('0x2f')]()]=_0x319bf7[_0x18f1('0x30')][_0x18f1('0x31')]();}else if(_[_0x18f1('0x2a')](['string',_0x18f1('0x2b')],_0x319bf7['type'])&&_0x319bf7['idField']&&_0x319bf7['customField']){_0x29bc9f[_0x319bf7[_0x18f1('0x32')][_0x18f1('0x2f')]()]=_0x319bf7[_0x18f1('0x30')]['toString']();}else if(_0x319bf7[_0x18f1('0x2c')]===_0x18f1('0x33')&&_0x319bf7['variableName']&&_0x319bf7[_0x18f1('0x32')]&&_0x319bf7[_0x18f1('0x2e')]){_0x29bc9f[_0x319bf7['idField'][_0x18f1('0x2f')]()]=_0x3e4824[_0x319bf7[_0x18f1('0x34')]][_0x18f1('0x31')]();}else if(_0x319bf7[_0x18f1('0x2c')]===_0x18f1('0x35')&&_0x319bf7[_0x18f1('0x36')]&&_0x319bf7[_0x18f1('0x36')][_0x18f1('0x37')]&&_0x319bf7['idField']&&_0x319bf7[_0x18f1('0x2e')]){_0x29bc9f[_0x319bf7[_0x18f1('0x32')][_0x18f1('0x2f')]()]=_0x3e4824[_0x319bf7[_0x18f1('0x36')][_0x18f1('0x37')][_0x18f1('0x2f')]()][_0x18f1('0x31')]();}});}return _0x29bc9f;}function getTicket(_0x49cf86,_0x446a19,_0x4a737b,_0x29d292,_0x3d3b65,_0x15ab9b){return function(_0x1d1537){logger[_0x18f1('0x12')]('['+[_0x49cf86['toUpperCase']()]+_0x18f1('0x38'),_0x1d1537);return new Promise(function(_0x5e2b8e,_0x36aed3){var _0x594707=_0x49cf86[_0x18f1('0x2f')]()===_0x18f1('0x39')?_0x1d1537[_0x18f1('0x1d')]:_0x1d1537[_0x18f1('0x25')];var _0x2716ab={'method':_0x18f1('0x20'),'uri':_0x4a737b+_0x18f1('0x3a')+'?'+_0x15ab9b,'body':Object[_0x18f1('0x3b')]({},{'active':_0x18f1('0x23'),'caller_id':_0x594707,'assigned_to':_0x1d1537[_0x18f1('0x1d')],'short_description':intUtil[_0x18f1('0x3c')](_0x29d292['Subjects'],_0x3d3b65,'\x20'),'description':intUtil['getString'](_0x29d292['Descriptions'],_0x3d3b65,'\x0a')},getCustomFields(_0x29d292[_0x18f1('0x3d')],_0x3d3b65)),'auth':_0x446a19,'json':!![]};return rp(_0x2716ab)[_0x18f1('0xd')](function(_0x408e7a){logger[_0x18f1('0x12')]('['+[_0x49cf86[_0x18f1('0x13')]()]+_0x18f1('0x3e'),_0x408e7a[_0x18f1('0xe')]);_0x1d1537[_0x18f1('0x3f')]=_0x408e7a[_0x18f1('0xe')][_0x18f1('0x11')];_0x1d1537[_0x18f1('0x40')]=_0x408e7a[_0x18f1('0xe')][_0x18f1('0x41')];logger[_0x18f1('0x12')]('['+[_0x49cf86[_0x18f1('0x13')]()]+']\x20getTicket\x20crm',_0x1d1537);_0x5e2b8e(_0x1d1537);})[_0x18f1('0x1f')](function(_0x4659d9){logger[_0x18f1('0x14')]('['+[_0x49cf86[_0x18f1('0x13')]()]+']',_0x4659d9['message']);_0x36aed3(_0x4659d9[_0x18f1('0x15')]);});});};}function createRemoteTag(_0x2ae11f,_0x3eca36,_0x7140eb,_0xcd93fa){return new Promise(function(_0x2a3bc1,_0x64ec52){var _0xdf6fc9={'method':'POST','uri':_0x7140eb+_0x18f1('0x42')+'?'+_0xcd93fa,'body':{'short_description':_0x2ae11f,'global':!![],'active':!![],'name':_0x2ae11f},'auth':_0x3eca36,'json':!![]};return rp(_0xdf6fc9)[_0x18f1('0xd')](function(_0x44f289){var _0x40a528=_0x44f289[_0x18f1('0xe')][_0x18f1('0x11')];_0x2a3bc1(_0x40a528);});});}function getRemoteTag(_0x4b7655,_0x137827,_0x136b2d,_0x2ecd9d,_0x4bdc39){return new Promise(function(_0x19cf75,_0x4a0958){var _0x45e8b9={'method':_0x18f1('0xb'),'uri':_0x136b2d+_0x18f1('0x42')+_0x18f1('0x43')+_0x4b7655+'&'+_0x2ecd9d,'auth':_0x137827,'json':!![]};return rp(_0x45e8b9)[_0x18f1('0xd')](function(_0x2aa34f){if(_0x2aa34f['result'][_0x18f1('0xf')]>0x0){var _0x32a6f0=_0x2aa34f[_0x18f1('0xe')][0x0][_0x18f1('0x11')];_0x19cf75(_0x32a6f0);}else{return createRemoteTag(_0x4b7655,_0x137827,_0x136b2d,_0x2ecd9d)[_0x18f1('0xd')](function(_0x551709){_0x19cf75(_0x551709);});}});});}function assignTagToIncident(_0x3977f4,_0x5e26e5,_0x3551c9,_0x58ab4e,_0x355b5f){return new Promise(function(_0x542663,_0x164eb4){var _0x5cd911={'method':_0x18f1('0x20'),'uri':_0x3551c9+_0x18f1('0x44')+'?'+_0x355b5f,'body':{'label':_0x3977f4,'table':_0x18f1('0x3a'),'id_type':_0x18f1('0x45'),'table_key':_0x58ab4e[_0x18f1('0x3f')],'title':_0x18f1('0x46')+_0x58ab4e[_0x18f1('0x40')],'id_display':_0x58ab4e['ticketNumber']},'auth':_0x5e26e5,'json':!![]};return rp(_0x5cd911)[_0x18f1('0xd')](function(_0x4817b4){_0x542663();})[_0x18f1('0x1f')](function(){_0x542663();});});}function manageTags(_0x2f0fab,_0x87d305,_0x3317d0,_0x561c74,_0x499e4a,_0x57ecc9,_0x2b5329){return new Promise(function(_0x129931,_0x31dc3a){var _0x2f69aa=[];_0x87d305[_0x18f1('0x29')](function(_0x331ad4){_0x2f69aa['push'](getRemoteTag(_0x331ad4,_0x3317d0,_0x561c74,_0x57ecc9,_0x2b5329));});return Promise[_0x18f1('0x47')](_0x2f69aa)[_0x18f1('0xd')](function(_0x594248){if(_0x594248[_0x18f1('0xf')]){logger['info']('['+[_0x2f0fab[_0x18f1('0x13')]()]+_0x18f1('0x48'),_0x594248);var _0x442008=[];_0x594248[_0x18f1('0x29')](function(_0x56c7c4){_0x442008[_0x18f1('0x49')](assignTagToIncident(_0x56c7c4,_0x3317d0,_0x561c74,_0x499e4a,_0x57ecc9));});return Promise[_0x18f1('0x47')](_0x442008)[_0x18f1('0xd')](function(){_0x129931();})['catch'](function(){_0x129931();});}else{_0x129931();}});});}function getTags(_0x167b94,_0x360df3,_0xfe0bc9,_0x3bf2f1,_0x2e7a2f,_0x1adfe8){return function(_0x311272){return new Promise(function(_0x333475,_0x4401f6){var _0x483a2e=[];var _0x1c5764=_0x3bf2f1[_0x18f1('0x4a')];if(_0x1c5764&&_0x1c5764[_0x18f1('0xf')]>0x0){_0x483a2e=_['map'](_0x1c5764,_0x18f1('0x37'));}if(_0x483a2e[_0x18f1('0xf')]>0x0){return manageTags(_0x167b94,_0x483a2e,_0x360df3,_0xfe0bc9,_0x311272,_0x2e7a2f,_0x1adfe8)[_0x18f1('0xd')](function(){_0x333475(_0x311272);});}else{_0x333475(_0x311272);}});};}function emit(_0x27a2bd,_0x226a17,_0x1db821){var _0x50c167='%26sysparm_record_target%3Dincident'+_0x18f1('0x4b')+_0x18f1('0x4c')+'%255EORDERBYDESCnumber';var _0x175eaf={'uri':_0x27a2bd+_0x18f1('0x4d')+_0x1db821+_0x50c167};io['to'](util[_0x18f1('0x4e')]('user:%s',_0x226a17))[_0x18f1('0x4f')](_0x18f1('0x50'),_0x175eaf);}exports['cs']=function(_0x2960fd,_0x303e0c,_0x2dd9bd,_0x36ed45,_0x2055f5,_0x3c0836,_0x440dcf,_0x308816){var _0x53a37d={};var _0x2f154a={'user':_0x3c0836[_0x18f1('0x51')],'pass':_0x3c0836[_0x18f1('0x52')]};var _0x52b601=_0x18f1('0x53');var _0x3c58ea='sysparm_display_value=true';_0x3c0836['remoteUri']=intUtil[_0x18f1('0x54')](_0x3c0836[_0x18f1('0x55')]);_0x3c0836[_0x18f1('0x56')]=intUtil['stripTrailingSlash'](_0x3c0836[_0x18f1('0x56')]);var _0x30fea2=util[_0x18f1('0x4e')](_0x18f1('0x57'),_0x3c0836[_0x18f1('0x55')]);_0x53a37d['userEmail']=!_[_0x18f1('0x58')](_0x36ed45)?_0x36ed45[_0x18f1('0x59')]:null;_0x53a37d[_0x18f1('0x5a')]=_0x3c0836['email'];_0x53a37d[_0x18f1('0x21')]=_0x308816[_0x18f1('0x2f')]()===_0x18f1('0x39')?_0x303e0c[_0x18f1('0x5b')]:_0x303e0c[_0x18f1('0x5c')];_0x53a37d[_0x18f1('0x5d')]=_0x308816==='queue'||_0x308816===_0x18f1('0x5e')?_0x18f1('0x5f'):_0x18f1('0x39');var _0x21f9d5=util['format'](_0x18f1('0x60'),_0x3c0836['serverUrl'],_0x303e0c[_0x18f1('0x61')],md5(_0x303e0c[_0x18f1('0x61')]));if(_0x2055f5&&_0x2055f5[_0x18f1('0x62')]){logger[_0x18f1('0x12')](_0x18f1('0x63'),_0x18f1('0x64'));_0x303e0c[_0x18f1('0x65')]=_0x21f9d5;}else if(_0x440dcf&&_0x440dcf[_0x18f1('0x66')]&&_0x440dcf[_0x18f1('0x66')]!==_0x18f1('0x67')){logger[_0x18f1('0x12')](_0x18f1('0x68'),_0x18f1('0x64'));_0x303e0c[_0x18f1('0x65')]=_0x21f9d5;}else{_0x303e0c[_0x18f1('0x65')]='';}return getAdminUser(_0x308816,_0x2f154a,_0x53a37d,_0x30fea2,_0x3c58ea,_0x52b601)['then'](getUser(_0x308816,_0x2f154a,_0x30fea2,_0x3c58ea,_0x52b601))[_0x18f1('0xd')](getEndUser(_0x308816,_0x2f154a,_0x30fea2,_0x3c58ea,_0x52b601))['then'](getTicket(_0x308816,_0x2f154a,_0x30fea2,_0x2dd9bd,_0x303e0c,_0x3c58ea))[_0x18f1('0xd')](function(_0x405473){logger[_0x18f1('0x12')](util[_0x18f1('0x4e')](_0x18f1('0x69'),_0x405473['ticketId']));logger[_0x18f1('0x12')](util[_0x18f1('0x4e')]('call\x20direction:\x20%s',_0x308816));if(_0x308816!==_0x18f1('0x5e')){logger['info']('['+[_0x308816['toUpperCase']()]+']',_0x18f1('0x6a'));emit(_0x3c0836['remoteUri'],_0x36ed45[_0x18f1('0x37')],_0x405473['ticketId']);}})[_0x18f1('0x1f')](function(_0xc94515){logger[_0x18f1('0x14')]('['+[_0x308816[_0x18f1('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0xc94515,{'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 6b51eaa..1249ab6 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 _0x1010=['%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','trigger:browser:url','error','unmanaged','toUpperCase','lastevent','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','parent_id','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','entry_list','name_value_list','user_name','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','nameField','customField','toLowerCase','content','string','custom_fields','type','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:'];(function(_0x491270,_0x3e7a39){var _0x2a0033=function(_0x35d62f){while(--_0x35d62f){_0x491270['push'](_0x491270['shift']());}};_0x2a0033(++_0x3e7a39);}(_0x1010,0x1e3));var _0x0101=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x1010[_0x3df9dd];return _0x4f11e4;};'use strict';var _=require(_0x0101('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x0101('0x1'));var util=require('util');var Redis=require(_0x0101('0x2'));var intUtil=require(_0x0101('0x3'));var config=require(_0x0101('0x4'));var logger=require(_0x0101('0x5'))(_0x0101('0x6'));config['redis']=_[_0x0101('0x7')](config[_0x0101('0x8')],{'host':_0x0101('0x9'),'port':0x18eb});var io=require(_0x0101('0xa'))(new Redis(config[_0x0101('0x8')]));var def={'method':_0x0101('0xb'),'json':!![]};function emit(_0x2ed47d,_0x3cee2e,_0x8ba14e){io['to'](_0x2ed47d)['emit'](_0x3cee2e,_0x8ba14e);}function getTicket(_0x4a93dc,_0x2298db,_0x46e7f3,_0x497e22,_0x3f1bd8,_0x37468e,_0xc1c4d9,_0x489cd8){logger[_0x0101('0xc')](_0x0101('0xd'));var _0xf0fd8a=new Date();var _0x309504=[{'name':_0x0101('0xe'),'value':intUtil[_0x0101('0xf')](_0x497e22[_0x0101('0x10')],_0x3f1bd8,'\x20')},{'name':'assigned_user_id','value':_0x2298db['id']},{'name':_0x0101('0x11'),'value':_0x2298db['id']},{'name':_0x0101('0x12'),'value':intUtil[_0x0101('0xf')](_0x497e22[_0x0101('0x13')],_0x3f1bd8,'\x0a')},{'name':_0x0101('0x14'),'value':_0xf0fd8a[_0x0101('0x15')]()[_0x0101('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x0101('0x17'),'value':_0x46e7f3['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x0101('0x18'),'value':_0x46e7f3[_0x0101('0xe')]},{'name':_0x0101('0x19'),'value':_0x489cd8}];if(_0x37468e[_0x0101('0x1a')]){_[_0x0101('0x1b')](_0x37468e,function(_0x5c0456){if(_0x3f1bd8[_0x5c0456[_0x0101('0x1c')]]){_0x309504[_0x0101('0x1d')]({'name':_0x5c0456[_0x0101('0x1e')],'value':_0x3f1bd8[_0x5c0456[_0x0101('0x1c')]]});}});}return request({'form':{'method':_0x0101('0x1f'),'input_type':_0x0101('0x20'),'response_type':'JSON','rest_data':JSON[_0x0101('0x21')]({'session':_0xc1c4d9['id'],'module_name':'Calls','name_value_list':_0x309504})}});}function getAuth(_0x5303c3){return util[_0x0101('0x22')]('Basic\x20%s',new Buffer(_0x5303c3['apiKey']+':X')[_0x0101('0x23')](_0x0101('0x24')));}function getServerInfo(_0x55ab8f){return request({'form':{'method':_0x0101('0x25'),'input_type':'JSON','response_type':_0x0101('0x20'),'rest_data':JSON[_0x0101('0x21')]({'session':_0x55ab8f['id']})}});}function getUser(_0x785d33,_0x58017e,_0x3abd9f){if(!_[_0x0101('0x26')](_0x58017e)){logger['info'](_0x0101('0x27'),_0x58017e);return request({'form':{'method':_0x0101('0x28'),'input_type':_0x0101('0x20'),'response_type':_0x0101('0x20'),'rest_data':JSON[_0x0101('0x21')]({'session':_0x3abd9f['id'],'module_name':_0x0101('0x29'),'query':util[_0x0101('0x22')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x58017e),'order_by':'','offset':'0','select_fields':['id',_0x0101('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3dcbda){if(_0x3dcbda['entry_list']['length']){var _0x467081=_['find'](_0x3dcbda[_0x0101('0x2a')],function(_0x2b010b){return _0x2b010b[_0x0101('0x2b')][_0x0101('0x2c')]['value']===_0x58017e;});if(_0x467081){logger[_0x0101('0xc')](_0x0101('0x2d'));return BPromise[_0x0101('0x2e')]({'id':_0x467081['name_value_list']['id'][_0x0101('0x2f')],'name':_0x467081[_0x0101('0x2b')][_0x0101('0xe')][_0x0101('0x2f')]});}}logger[_0x0101('0xc')](_0x0101('0x30'));return BPromise[_0x0101('0x2e')]({'id':_0x3abd9f[_0x0101('0x2b')][_0x0101('0x31')][_0x0101('0x2f')],'name':_0x3abd9f[_0x0101('0x2b')][_0x0101('0x2c')][_0x0101('0x2f')]});});}else{logger[_0x0101('0xc')](_0x0101('0x32'));return BPromise[_0x0101('0x2e')]({'id':_0x3abd9f[_0x0101('0x2b')][_0x0101('0x31')][_0x0101('0x2f')],'name':_0x3abd9f['name_value_list'][_0x0101('0x2c')][_0x0101('0x2f')]});}}function getEndUser(_0x2c42ea,_0x3fd961,_0x5457f7,_0x53789c){logger[_0x0101('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5457f7);return request({'form':{'method':'get_entry_list','input_type':_0x0101('0x20'),'response_type':_0x0101('0x20'),'rest_data':JSON['stringify']({'session':_0x53789c['id'],'module_name':_0x0101('0x33'),'query':util['format'](_0x0101('0x34'),_0x5457f7),'order_by':'','offset':'0','select_fields':['id',_0x0101('0xe'),_0x0101('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0101('0x36')](function(_0x195d33){if(_0x195d33[_0x0101('0x2a')][_0x0101('0x1a')]){var _0x5952fb=_['find'](_0x195d33[_0x0101('0x2a')],function(_0x16dad1){return _0x16dad1[_0x0101('0x2b')]['phone_home'][_0x0101('0x2f')]===_0x5457f7;});if(_0x5952fb){logger[_0x0101('0xc')](_0x0101('0x37'));return BPromise[_0x0101('0x2e')]({'id':_0x5952fb[_0x0101('0x2b')]['id']['value'],'name':_0x5952fb['name_value_list'][_0x0101('0xe')]['value'],'phone':_0x5952fb[_0x0101('0x2b')]['phone_home'][_0x0101('0x2f')]});}}else{logger[_0x0101('0xc')](_0x0101('0x38'));return request({'form':{'method':_0x0101('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0101('0x21')]({'session':_0x53789c['id'],'module_name':_0x0101('0x33'),'name_value_list':[{'name':_0x0101('0x39'),'value':_0x3fd961!==_0x0101('0x3a')?_0x3fd961:util['format'](_0x0101('0x3b'),_0x5457f7)},{'name':_0x0101('0x35'),'value':_0x5457f7}]})}})[_0x0101('0x36')](function(_0xe082be){logger['info'](_0x0101('0x3c'));return BPromise['resolve']({'id':_0xe082be['id'],'name':_0xe082be[_0x0101('0x2a')]['first_name'][_0x0101('0x2f')],'phone':_0xe082be[_0x0101('0x2a')][_0x0101('0x35')][_0x0101('0x2f')]});});}});}function request(_0x3010af){logger[_0x0101('0x3d')]('[HTTP]',JSON[_0x0101('0x21')](_0x3010af));return rp(_[_0x0101('0x3e')](def,_0x3010af));}function getTags(_0x2cd6cd,_0x1012bd){var _0x5216e6=[];if(_0x2cd6cd&&_0x2cd6cd[_0x0101('0x1a')]>0x0){_0x5216e6=_[_0x0101('0x3f')](_0x2cd6cd,_0x1012bd);}return _0x5216e6;}function getCustomFields(_0x5d1077,_0x3c21d7){var _0x5793d9=[];var _0x4b85bb={'custom_fields':[]};if(_0x5d1077[_0x0101('0x1a')]>0x0){_[_0x0101('0x1b')](_0x5d1077,function(_0x5c7ec0){if(_0x5c7ec0['type']==='string'&&_0x5c7ec0[_0x0101('0x40')]&&!_0x5c7ec0[_0x0101('0x41')]){_0x4b85bb[_0x5c7ec0[_0x0101('0x40')][_0x0101('0x42')]()]=_0x5c7ec0[_0x0101('0x43')][_0x0101('0x23')]();}else if(_0x5c7ec0['type']===_0x0101('0x44')&&_0x5c7ec0['idField']&&_0x5c7ec0[_0x0101('0x41')]){_0x4b85bb[_0x0101('0x45')]['push']({'id':_0x5c7ec0['idField'],'value':_0x5c7ec0[_0x0101('0x43')]['toString']()});}else if(_0x5c7ec0[_0x0101('0x46')]==='variable'&&_0x5c7ec0[_0x0101('0x1c')]&&_0x5c7ec0[_0x0101('0x1e')]&&_0x5c7ec0['customField']){_0x3c21d7[_0x5c7ec0[_0x0101('0x1c')]]&&_0x4b85bb[_0x0101('0x45')][_0x0101('0x1d')]({'id':_0x5c7ec0[_0x0101('0x1e')],'value':_0x3c21d7[_0x5c7ec0['variableName']][_0x0101('0x23')]()});}else if(_0x5c7ec0[_0x0101('0x46')]===_0x0101('0x47')&&_0x5c7ec0[_0x0101('0x48')]&&_0x5c7ec0[_0x0101('0x48')]['name']&&_0x5c7ec0[_0x0101('0x1e')]&&_0x5c7ec0[_0x0101('0x41')]){_0x3c21d7[_0x5c7ec0[_0x0101('0x48')][_0x0101('0xe')][_0x0101('0x42')]()]&&_0x4b85bb['custom_fields'][_0x0101('0x1d')]({'id':_0x5c7ec0[_0x0101('0x1e')],'value':_0x3c21d7[_0x5c7ec0[_0x0101('0x48')][_0x0101('0xe')]['toLowerCase']()][_0x0101('0x23')]()});}});}return _0x4b85bb;}function getConnection(_0xa53b34){return request({'method':'POST','form':{'method':_0x0101('0x49'),'input_type':_0x0101('0x20'),'response_type':_0x0101('0x20'),'rest_data':JSON[_0x0101('0x21')]({'user_auth':{'user_name':_0xa53b34[_0x0101('0x4a')],'password':_0xa53b34[_0x0101('0x4b')],'encryption':_0x0101('0x4c')},'application':_0x0101('0x4d')})}})['then'](function(_0x3733dd){var _0x5011d3=_0x3733dd;if(_0x5011d3['id']){def['sessionID']=_0x5011d3['id'];return BPromise[_0x0101('0x2e')](_0x5011d3);}else{throw new Error(util[_0x0101('0x22')](_0x0101('0x4e'),_0xa53b34['id']));}});}function setRelationship(_0x54d5ff,_0x4a2d38,_0x334c8f,_0x206fe7){return request({'form':{'method':_0x0101('0x4f'),'input_type':_0x0101('0x20'),'response_type':_0x0101('0x20'),'rest_data':JSON[_0x0101('0x21')]({'session':_0x54d5ff['id'],'module_name':_0x0101('0x50'),'module_id':_0x334c8f['id'],'link_field_name':_0x206fe7,'related_ids':[_0x4a2d38['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0101('0x51')]=function(_0x3c361d,_0x333e0b,_0x279835,_0x55691f,_0x29949c,_0x348837){var _0x3dbc57,_0x5ae1a0,_0x2dcd36,_0x4219a9;_0x348837[_0x0101('0x52')]=intUtil[_0x0101('0x53')](_0x348837[_0x0101('0x52')]);_0x348837[_0x0101('0x54')]=intUtil[_0x0101('0x53')](_0x348837[_0x0101('0x54')]);def[_0x0101('0x55')]=util[_0x0101('0x22')]('%s/service/v4_1/rest.php',_0x348837[_0x0101('0x52')]);if(_0x29949c&&_0x29949c['monitor_format']){logger[_0x0101('0xc')](_0x0101('0x56'),'Recording\x20is\x20enabled!');_0x333e0b[_0x0101('0x57')]=util[_0x0101('0x22')](_0x0101('0x58'),_0x348837[_0x0101('0x54')],_0x333e0b['uniqueid'],md5(_0x333e0b[_0x0101('0x59')]));}else{_0x333e0b['recordingURL']='';}return getConnection(_0x348837)['then'](function(_0x1f9c1f){_0x4219a9=_0x1f9c1f;return getUser(_0x348837,_0x55691f[_0x0101('0xe')],_0x4219a9);})['then'](function(_0x3ce144){_0x3dbc57=_0x3ce144;logger[_0x0101('0xc')](_0x0101('0x5a'),_0x3dbc57['id']);return getEndUser(_0x348837,_0x333e0b[_0x0101('0x5b')],_0x333e0b[_0x0101('0x5c')],_0x4219a9);})[_0x0101('0x36')](function(_0x360ab0){_0x5ae1a0=_0x360ab0;logger[_0x0101('0xc')](_0x0101('0x5d'),_0x5ae1a0['id']);return getTicket(_0x348837,_0x3dbc57,_0x5ae1a0,_0x279835,_0x333e0b,_0x279835[_0x0101('0x5e')],_0x4219a9,_0x0101('0x5f'));})[_0x0101('0x36')](function(_0x1fb79c){_0x2dcd36=_0x1fb79c;logger[_0x0101('0xc')](_0x0101('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2dcd36['id']);return setRelationship(_0x4219a9,_0x3dbc57,_0x2dcd36,_0x0101('0x61'));})[_0x0101('0x36')](function(){return setRelationship(_0x4219a9,_0x5ae1a0,_0x2dcd36,_0x0101('0x62'));})[_0x0101('0x36')](function(){return getServerInfo(_0x4219a9);})[_0x0101('0x36')](function(_0xb045b1){var _0x53b1dd=parseInt(_0xb045b1[_0x0101('0x63')][_0x0101('0x64')](0x0));var _0x221098=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x348837['remoteUri'],_0x2dcd36['id']);if(_0x53b1dd>0x6){_0x221098=util[_0x0101('0x22')](_0x0101('0x65'),_0x348837[_0x0101('0x52')],_0x2dcd36['id']);}logger[_0x0101('0xc')](_0x0101('0x56'),_0x0101('0x66'));emit(util[_0x0101('0x22')]('user:%s',_0x55691f[_0x0101('0xe')]),'trigger:browser:url',{'uri':_0x221098});})[_0x0101('0x67')](function(_0x2c8be0){logger['error'](_0x0101('0x56'),JSON[_0x0101('0x21')](_0x2c8be0));});};exports[_0x0101('0x68')]=function(_0x3cf6c3,_0x1f6859,_0x42ca09,_0x4ab538,_0x2579bd,_0x5e86ee,_0x2b7b41){var _0x323a54,_0x46ed3a,_0x2f6447,_0x42cacc;_0x5e86ee[_0x0101('0x52')]=intUtil['stripTrailingSlash'](_0x5e86ee['remoteUri']);_0x5e86ee[_0x0101('0x54')]=intUtil[_0x0101('0x53')](_0x5e86ee[_0x0101('0x54')]);def['uri']=util[_0x0101('0x22')](_0x0101('0x69'),_0x5e86ee[_0x0101('0x52')]);if(_0x2b7b41&&_0x2b7b41['recordingFormat']&&_0x2b7b41[_0x0101('0x6a')]!==_0x0101('0x6b')){logger[_0x0101('0xc')]('[OUTBOUND]',_0x0101('0x6c'));_0x1f6859['recordingURL']=util[_0x0101('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e86ee[_0x0101('0x54')],_0x1f6859[_0x0101('0x59')],md5(_0x1f6859['uniqueid']));}return getConnection(_0x5e86ee)[_0x0101('0x36')](function(_0x23c9a9){_0x42cacc=_0x23c9a9;return getUser(_0x5e86ee,_0x4ab538[_0x0101('0xe')],_0x42cacc);})[_0x0101('0x36')](function(_0x4e7ec0){_0x323a54=_0x4e7ec0;logger[_0x0101('0xc')](_0x0101('0x5a'),_0x323a54['id']);return getEndUser(_0x5e86ee,_0x1f6859[_0x0101('0x6d')],_0x1f6859[_0x0101('0x6e')],_0x42cacc);})[_0x0101('0x36')](function(_0x230768){_0x46ed3a=_0x230768;logger[_0x0101('0xc')](_0x0101('0x5d'),_0x46ed3a['id']);return getTicket(_0x5e86ee,_0x323a54,_0x46ed3a,_0x42ca09,_0x1f6859,_0x42ca09[_0x0101('0x5e')],_0x42cacc,'Outbound');})['then'](function(_0x140182){_0x2f6447=_0x140182;logger[_0x0101('0xc')]('Ticket\x20created!');logger['info'](_0x0101('0x6f'),_0x2f6447['id']);return setRelationship(_0x42cacc,_0x323a54,_0x2f6447,_0x0101('0x61'));})[_0x0101('0x36')](function(){return setRelationship(_0x42cacc,_0x46ed3a,_0x2f6447,_0x0101('0x62'));})['then'](function(){return getServerInfo(_0x42cacc);})[_0x0101('0x36')](function(_0x483b39){var _0x3e2bb6=parseInt(_0x483b39[_0x0101('0x63')][_0x0101('0x64')](0x0));var _0xb86853=util['format'](_0x0101('0x70'),_0x5e86ee[_0x0101('0x52')],_0x2f6447['id']);if(_0x3e2bb6>0x6){_0xb86853=util[_0x0101('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5e86ee[_0x0101('0x52')],_0x2f6447['id']);}logger[_0x0101('0xc')](_0x0101('0x71'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0101('0x22')]('user:%s',_0x4ab538[_0x0101('0xe')]),_0x0101('0x72'),{'uri':_0xb86853});})[_0x0101('0x67')](function(_0x15e278){logger[_0x0101('0x73')](_0x0101('0x71'),JSON[_0x0101('0x21')](_0x15e278));});};exports[_0x0101('0x74')]=function(_0x244e86,_0x55d740,_0xa65337,_0x1b38f2,_0x6afdf8,_0x416db4){var _0x56f78c,_0x145df8,_0x3eb100,_0x174651;_0x416db4[_0x0101('0x52')]=intUtil[_0x0101('0x53')](_0x416db4[_0x0101('0x52')]);_0x416db4[_0x0101('0x54')]=intUtil[_0x0101('0x53')](_0x416db4['serverUrl']);def['uri']=util[_0x0101('0x22')](_0x0101('0x69'),_0x416db4[_0x0101('0x52')]);if(_0x6afdf8&&_0x6afdf8['monitor_format']){logger['info']('['+_0x55d740['lastevent'][_0x0101('0x75')]()+']',_0x0101('0x6c'));_0x55d740[_0x0101('0x57')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x416db4[_0x0101('0x54')],_0x55d740[_0x0101('0x59')],md5(_0x55d740[_0x0101('0x59')]));}else{_0x55d740['recordingURL']='';}return getConnection(_0x416db4)['then'](function(_0x4a4ea8){_0x174651=_0x4a4ea8;if(!_[_0x0101('0x26')](_0x1b38f2)){return getUser(_0x416db4,_0x1b38f2[_0x0101('0xe')],_0x174651);}else{return getUser(_0x416db4,null,_0x174651);}})[_0x0101('0x36')](function(_0xc9b9fb){_0x56f78c=_0xc9b9fb;logger[_0x0101('0xc')](_0x0101('0x5a'),_0x56f78c['id']);return getEndUser(_0x416db4,_0x55d740[_0x0101('0x5b')],_0x55d740['calleridnum'],_0x174651);})[_0x0101('0x36')](function(_0x24b318){_0x145df8=_0x24b318;logger['info'](_0x0101('0x5d'),_0x145df8['id']);return getTicket(_0x416db4,_0x56f78c,_0x145df8,_0xa65337,_0x55d740,_0xa65337[_0x0101('0x5e')],_0x174651,_0x0101('0x5f'));})[_0x0101('0x36')](function(_0x30c06e){_0x3eb100=_0x30c06e;logger[_0x0101('0xc')]('Ticket\x20created!');logger[_0x0101('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3eb100['id']);return setRelationship(_0x174651,_0x56f78c,_0x3eb100,_0x0101('0x61'));})[_0x0101('0x36')](function(){return setRelationship(_0x174651,_0x145df8,_0x3eb100,'contacts');})[_0x0101('0x36')](function(){return getServerInfo(_0x174651);})[_0x0101('0x67')](function(_0x47e3a9){logger[_0x0101('0x73')]('['+_0x55d740[_0x0101('0x76')]['toUpperCase']()+']',JSON['stringify'](_0x47e3a9));});}; \ No newline at end of file +var _0xd877=['password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','users','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','destcalleridname','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','unmanaged','Recording\x20is\x20enabled!','Inbound','catch','error','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','date_start','toISOString','slice','duration_hours','Contacts','parent_name','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','login','username'];(function(_0x4f70af,_0x5b6e2c){var _0x2a81df=function(_0x49878f){while(--_0x49878f){_0x4f70af['push'](_0x4f70af['shift']());}};_0x2a81df(++_0x5b6e2c);}(_0xd877,0xa5));var _0x7d87=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd877[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x7d87('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x7d87('0x1'));var Redis=require(_0x7d87('0x2'));var intUtil=require(_0x7d87('0x3'));var config=require(_0x7d87('0x4'));var logger=require(_0x7d87('0x5'))('sugarcrm');config[_0x7d87('0x6')]=_[_0x7d87('0x7')](config[_0x7d87('0x6')],{'host':_0x7d87('0x8'),'port':0x18eb});var io=require(_0x7d87('0x9'))(new Redis(config[_0x7d87('0x6')]));var def={'method':_0x7d87('0xa'),'json':!![]};function emit(_0x1ee6a0,_0x23769d,_0x39fc85){io['to'](_0x1ee6a0)['emit'](_0x23769d,_0x39fc85);}function getTicket(_0x38dc65,_0x39dff0,_0x177f47,_0x242948,_0x59e729,_0x62e545,_0x34725c,_0xc61130){logger[_0x7d87('0xb')](_0x7d87('0xc'));var _0x253002=new Date();var _0xd3a852=[{'name':_0x7d87('0xd'),'value':intUtil[_0x7d87('0xe')](_0x242948['Subjects'],_0x59e729,'\x20')},{'name':_0x7d87('0xf'),'value':_0x39dff0['id']},{'name':_0x7d87('0x10'),'value':_0x39dff0['id']},{'name':_0x7d87('0x11'),'value':intUtil[_0x7d87('0xe')](_0x242948['Descriptions'],_0x59e729,'\x0a')},{'name':_0x7d87('0x12'),'value':_0x253002[_0x7d87('0x13')]()[_0x7d87('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x7d87('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x177f47['id']},{'name':'parent_type','value':_0x7d87('0x16')},{'name':_0x7d87('0x17'),'value':_0x177f47[_0x7d87('0xd')]},{'name':'direction','value':_0xc61130}];if(_0x62e545[_0x7d87('0x18')]){_[_0x7d87('0x19')](_0x62e545,function(_0x39eb1f){if(_0x59e729[_0x39eb1f[_0x7d87('0x1a')]]){_0xd3a852['push']({'name':_0x39eb1f[_0x7d87('0x1b')],'value':_0x59e729[_0x39eb1f[_0x7d87('0x1a')]]});}});}return request({'form':{'method':_0x7d87('0x1c'),'input_type':'JSON','response_type':_0x7d87('0x1d'),'rest_data':JSON[_0x7d87('0x1e')]({'session':_0x34725c['id'],'module_name':_0x7d87('0x1f'),'name_value_list':_0xd3a852})}});}function getAuth(_0x3cfcd5){return util[_0x7d87('0x20')]('Basic\x20%s',new Buffer(_0x3cfcd5[_0x7d87('0x21')]+':X')[_0x7d87('0x22')](_0x7d87('0x23')));}function getServerInfo(_0x4327ff){return request({'form':{'method':_0x7d87('0x24'),'input_type':_0x7d87('0x1d'),'response_type':_0x7d87('0x1d'),'rest_data':JSON[_0x7d87('0x1e')]({'session':_0x4327ff['id']})}});}function getUser(_0xa7bc7b,_0x282548,_0x2c3007){if(!_[_0x7d87('0x25')](_0x282548)){logger[_0x7d87('0xb')](_0x7d87('0x26'),_0x282548);return request({'form':{'method':_0x7d87('0x27'),'input_type':_0x7d87('0x1d'),'response_type':_0x7d87('0x1d'),'rest_data':JSON[_0x7d87('0x1e')]({'session':_0x2c3007['id'],'module_name':'Employees','query':util[_0x7d87('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x282548),'order_by':'','offset':'0','select_fields':['id',_0x7d87('0xd'),_0x7d87('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d87('0x29')](function(_0x1fc627){if(_0x1fc627[_0x7d87('0x2a')][_0x7d87('0x18')]){var _0x13d1ff=_[_0x7d87('0x2b')](_0x1fc627[_0x7d87('0x2a')],function(_0x4c0df6){return _0x4c0df6[_0x7d87('0x2c')]['user_name'][_0x7d87('0x2d')]===_0x282548;});if(_0x13d1ff){logger[_0x7d87('0xb')](_0x7d87('0x2e'));return BPromise[_0x7d87('0x2f')]({'id':_0x13d1ff[_0x7d87('0x2c')]['id']['value'],'name':_0x13d1ff[_0x7d87('0x2c')][_0x7d87('0xd')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7d87('0x2f')]({'id':_0x2c3007[_0x7d87('0x2c')][_0x7d87('0x30')]['value'],'name':_0x2c3007[_0x7d87('0x2c')]['user_name']['value']});});}else{logger[_0x7d87('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7d87('0x2f')]({'id':_0x2c3007['name_value_list']['user_id'][_0x7d87('0x2d')],'name':_0x2c3007['name_value_list'][_0x7d87('0x28')][_0x7d87('0x2d')]});}}function getEndUser(_0x4d3dea,_0x4ea908,_0x50c61b,_0x3d6063){logger[_0x7d87('0xb')](_0x7d87('0x31'),_0x50c61b);return request({'form':{'method':_0x7d87('0x27'),'input_type':_0x7d87('0x1d'),'response_type':'JSON','rest_data':JSON[_0x7d87('0x1e')]({'session':_0x3d6063['id'],'module_name':_0x7d87('0x16'),'query':util[_0x7d87('0x20')](_0x7d87('0x32'),_0x50c61b),'order_by':'','offset':'0','select_fields':['id',_0x7d87('0xd'),_0x7d87('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d87('0x29')](function(_0x5f0bfa){if(_0x5f0bfa[_0x7d87('0x2a')][_0x7d87('0x18')]){var _0x48767c=_['find'](_0x5f0bfa['entry_list'],function(_0x1526f5){return _0x1526f5['name_value_list'][_0x7d87('0x33')]['value']===_0x50c61b;});if(_0x48767c){logger[_0x7d87('0xb')](_0x7d87('0x34'));return BPromise[_0x7d87('0x2f')]({'id':_0x48767c['name_value_list']['id'][_0x7d87('0x2d')],'name':_0x48767c[_0x7d87('0x2c')]['name'][_0x7d87('0x2d')],'phone':_0x48767c[_0x7d87('0x2c')][_0x7d87('0x33')][_0x7d87('0x2d')]});}}else{logger['info'](_0x7d87('0x35'));return request({'form':{'method':_0x7d87('0x1c'),'input_type':_0x7d87('0x1d'),'response_type':'JSON','rest_data':JSON[_0x7d87('0x1e')]({'session':_0x3d6063['id'],'module_name':_0x7d87('0x16'),'name_value_list':[{'name':_0x7d87('0x36'),'value':_0x4ea908!==_0x7d87('0x37')?_0x4ea908:util[_0x7d87('0x20')](_0x7d87('0x38'),_0x50c61b)},{'name':_0x7d87('0x33'),'value':_0x50c61b}]})}})['then'](function(_0x1ab4ff){logger[_0x7d87('0xb')](_0x7d87('0x39'));return BPromise[_0x7d87('0x2f')]({'id':_0x1ab4ff['id'],'name':_0x1ab4ff['entry_list'][_0x7d87('0x36')][_0x7d87('0x2d')],'phone':_0x1ab4ff[_0x7d87('0x2a')]['phone_home'][_0x7d87('0x2d')]});});}});}function request(_0x3b7c5b){logger[_0x7d87('0x3a')](_0x7d87('0x3b'),JSON[_0x7d87('0x1e')](_0x3b7c5b));return rp(_[_0x7d87('0x3c')](def,_0x3b7c5b));}function getTags(_0x5de8f6,_0x153d9f){var _0x14468d=[];if(_0x5de8f6&&_0x5de8f6['length']>0x0){_0x14468d=_[_0x7d87('0x3d')](_0x5de8f6,_0x153d9f);}return _0x14468d;}function getCustomFields(_0x36b123,_0x2dbeba){var _0x1f7b97=[];var _0xa2dceb={'custom_fields':[]};if(_0x36b123['length']>0x0){_['forEach'](_0x36b123,function(_0x1c24d2){if(_0x1c24d2[_0x7d87('0x3e')]===_0x7d87('0x3f')&&_0x1c24d2[_0x7d87('0x40')]&&!_0x1c24d2[_0x7d87('0x41')]){_0xa2dceb[_0x1c24d2['nameField'][_0x7d87('0x42')]()]=_0x1c24d2[_0x7d87('0x43')][_0x7d87('0x22')]();}else if(_0x1c24d2[_0x7d87('0x3e')]==='string'&&_0x1c24d2['idField']&&_0x1c24d2['customField']){_0xa2dceb[_0x7d87('0x44')][_0x7d87('0x45')]({'id':_0x1c24d2[_0x7d87('0x1b')],'value':_0x1c24d2[_0x7d87('0x43')][_0x7d87('0x22')]()});}else if(_0x1c24d2[_0x7d87('0x3e')]===_0x7d87('0x46')&&_0x1c24d2[_0x7d87('0x1a')]&&_0x1c24d2[_0x7d87('0x1b')]&&_0x1c24d2[_0x7d87('0x41')]){_0x2dbeba[_0x1c24d2['variableName']]&&_0xa2dceb[_0x7d87('0x44')][_0x7d87('0x45')]({'id':_0x1c24d2['idField'],'value':_0x2dbeba[_0x1c24d2[_0x7d87('0x1a')]][_0x7d87('0x22')]()});}else if(_0x1c24d2[_0x7d87('0x3e')]===_0x7d87('0x47')&&_0x1c24d2[_0x7d87('0x48')]&&_0x1c24d2[_0x7d87('0x48')]['name']&&_0x1c24d2[_0x7d87('0x1b')]&&_0x1c24d2[_0x7d87('0x41')]){_0x2dbeba[_0x1c24d2[_0x7d87('0x48')][_0x7d87('0xd')][_0x7d87('0x42')]()]&&_0xa2dceb['custom_fields'][_0x7d87('0x45')]({'id':_0x1c24d2[_0x7d87('0x1b')],'value':_0x2dbeba[_0x1c24d2[_0x7d87('0x48')][_0x7d87('0xd')][_0x7d87('0x42')]()][_0x7d87('0x22')]()});}});}return _0xa2dceb;}function getConnection(_0x5eba6f){return request({'method':_0x7d87('0xa'),'form':{'method':_0x7d87('0x49'),'input_type':_0x7d87('0x1d'),'response_type':_0x7d87('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5eba6f[_0x7d87('0x4a')],'password':_0x5eba6f[_0x7d87('0x4b')],'encryption':_0x7d87('0x4c')},'application':_0x7d87('0x4d')})}})[_0x7d87('0x29')](function(_0x2560aa){var _0x36df77=_0x2560aa;if(_0x36df77['id']){def[_0x7d87('0x4e')]=_0x36df77['id'];return BPromise[_0x7d87('0x2f')](_0x36df77);}else{throw new Error(util[_0x7d87('0x20')](_0x7d87('0x4f'),_0x5eba6f['id']));}});}function setRelationship(_0x40eba9,_0x20b095,_0x10621a,_0x263cd3){return request({'form':{'method':_0x7d87('0x50'),'input_type':_0x7d87('0x1d'),'response_type':'JSON','rest_data':JSON[_0x7d87('0x1e')]({'session':_0x40eba9['id'],'module_name':_0x7d87('0x1f'),'module_id':_0x10621a['id'],'link_field_name':_0x263cd3,'related_ids':[_0x20b095['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7d87('0x51')]=function(_0x3cbf46,_0xd21db6,_0x21cda3,_0x2d159e,_0x569d5a,_0x3a7d56){var _0x249e49,_0x365d9f,_0xd5649c,_0x1561f1;_0x3a7d56['remoteUri']=intUtil[_0x7d87('0x52')](_0x3a7d56[_0x7d87('0x53')]);_0x3a7d56[_0x7d87('0x54')]=intUtil[_0x7d87('0x52')](_0x3a7d56[_0x7d87('0x54')]);def[_0x7d87('0x55')]=util[_0x7d87('0x20')](_0x7d87('0x56'),_0x3a7d56[_0x7d87('0x53')]);if(_0x569d5a&&_0x569d5a[_0x7d87('0x57')]){logger['info'](_0x7d87('0x58'),'Recording\x20is\x20enabled!');_0xd21db6[_0x7d87('0x59')]=util['format'](_0x7d87('0x5a'),_0x3a7d56[_0x7d87('0x54')],_0xd21db6[_0x7d87('0x5b')],md5(_0xd21db6[_0x7d87('0x5b')]));}else{_0xd21db6[_0x7d87('0x59')]='';}return getConnection(_0x3a7d56)[_0x7d87('0x29')](function(_0x5c9b19){_0x1561f1=_0x5c9b19;return getUser(_0x3a7d56,_0x2d159e[_0x7d87('0xd')],_0x1561f1);})['then'](function(_0x5b2bd3){_0x249e49=_0x5b2bd3;logger[_0x7d87('0xb')](_0x7d87('0x5c'),_0x249e49['id']);return getEndUser(_0x3a7d56,_0xd21db6[_0x7d87('0x5d')],_0xd21db6[_0x7d87('0x5e')],_0x1561f1);})['then'](function(_0x990a){_0x365d9f=_0x990a;logger[_0x7d87('0xb')](_0x7d87('0x5f'),_0x365d9f['id']);return getTicket(_0x3a7d56,_0x249e49,_0x365d9f,_0x21cda3,_0xd21db6,_0x21cda3[_0x7d87('0x60')],_0x1561f1,'Inbound');})[_0x7d87('0x29')](function(_0x477c0e){_0xd5649c=_0x477c0e;logger[_0x7d87('0xb')]('Ticket\x20created!');logger[_0x7d87('0xb')]('The\x20Ticket\x20ID\x20is:',_0xd5649c['id']);return setRelationship(_0x1561f1,_0x249e49,_0xd5649c,_0x7d87('0x61'));})[_0x7d87('0x29')](function(){return setRelationship(_0x1561f1,_0x365d9f,_0xd5649c,'contacts');})[_0x7d87('0x29')](function(){return getServerInfo(_0x1561f1);})[_0x7d87('0x29')](function(_0x2e6307){var _0x4ddc1a=parseInt(_0x2e6307[_0x7d87('0x62')][_0x7d87('0x63')](0x0));var _0x1d231c=util[_0x7d87('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3a7d56['remoteUri'],_0xd5649c['id']);if(_0x4ddc1a>0x6){_0x1d231c=util['format'](_0x7d87('0x64'),_0x3a7d56[_0x7d87('0x53')],_0xd5649c['id']);}logger['info']('[QUEUE]',_0x7d87('0x65'));emit(util[_0x7d87('0x20')](_0x7d87('0x66'),_0x2d159e['name']),_0x7d87('0x67'),{'uri':_0x1d231c});})['catch'](function(_0x108d13){logger['error']('[QUEUE]',JSON['stringify'](_0x108d13));});};exports['outbound']=function(_0x2a2e24,_0x263c31,_0x2fa155,_0x9e2e69,_0x323a2d,_0x44daaa,_0x4b99a7){var _0x2e0811,_0x2c88ba,_0x3be079,_0x49c019;_0x44daaa[_0x7d87('0x53')]=intUtil[_0x7d87('0x52')](_0x44daaa[_0x7d87('0x53')]);_0x44daaa[_0x7d87('0x54')]=intUtil['stripTrailingSlash'](_0x44daaa['serverUrl']);def[_0x7d87('0x55')]=util[_0x7d87('0x20')](_0x7d87('0x56'),_0x44daaa[_0x7d87('0x53')]);if(_0x4b99a7&&_0x4b99a7[_0x7d87('0x68')]&&_0x4b99a7[_0x7d87('0x68')]!==_0x7d87('0x69')){logger[_0x7d87('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x263c31[_0x7d87('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44daaa[_0x7d87('0x54')],_0x263c31[_0x7d87('0x5b')],md5(_0x263c31[_0x7d87('0x5b')]));}return getConnection(_0x44daaa)['then'](function(_0x3c56a4){_0x49c019=_0x3c56a4;return getUser(_0x44daaa,_0x9e2e69[_0x7d87('0xd')],_0x49c019);})[_0x7d87('0x29')](function(_0x36aeb3){_0x2e0811=_0x36aeb3;logger[_0x7d87('0xb')]('The\x20User\x20ID\x20is:',_0x2e0811['id']);return getEndUser(_0x44daaa,_0x263c31[_0x7d87('0x6a')],_0x263c31['destcalleridnum'],_0x49c019);})[_0x7d87('0x29')](function(_0x4ed5af){_0x2c88ba=_0x4ed5af;logger[_0x7d87('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2c88ba['id']);return getTicket(_0x44daaa,_0x2e0811,_0x2c88ba,_0x2fa155,_0x263c31,_0x2fa155[_0x7d87('0x60')],_0x49c019,_0x7d87('0x6b'));})[_0x7d87('0x29')](function(_0x5d88e2){_0x3be079=_0x5d88e2;logger['info'](_0x7d87('0x6c'));logger[_0x7d87('0xb')](_0x7d87('0x6d'),_0x3be079['id']);return setRelationship(_0x49c019,_0x2e0811,_0x3be079,_0x7d87('0x61'));})[_0x7d87('0x29')](function(){return setRelationship(_0x49c019,_0x2c88ba,_0x3be079,_0x7d87('0x6e'));})[_0x7d87('0x29')](function(){return getServerInfo(_0x49c019);})['then'](function(_0x34dcb5){var _0x25d488=parseInt(_0x34dcb5[_0x7d87('0x62')]['charAt'](0x0));var _0x596c5f=util[_0x7d87('0x20')](_0x7d87('0x6f'),_0x44daaa['remoteUri'],_0x3be079['id']);if(_0x25d488>0x6){_0x596c5f=util[_0x7d87('0x20')](_0x7d87('0x64'),_0x44daaa['remoteUri'],_0x3be079['id']);}logger['info'](_0x7d87('0x70'),_0x7d87('0x65'));emit(util[_0x7d87('0x20')]('user:%s',_0x9e2e69[_0x7d87('0xd')]),_0x7d87('0x67'),{'uri':_0x596c5f});})['catch'](function(_0x10f4b2){logger['error'](_0x7d87('0x70'),JSON[_0x7d87('0x1e')](_0x10f4b2));});};exports[_0x7d87('0x71')]=function(_0x30f913,_0x5e6825,_0x3a3815,_0x57613a,_0x1b7a71,_0x58a231){var _0x453a69,_0x5016a8,_0x48c885,_0x484fa3;_0x58a231['remoteUri']=intUtil['stripTrailingSlash'](_0x58a231[_0x7d87('0x53')]);_0x58a231[_0x7d87('0x54')]=intUtil[_0x7d87('0x52')](_0x58a231[_0x7d87('0x54')]);def[_0x7d87('0x55')]=util[_0x7d87('0x20')]('%s/service/v4_1/rest.php',_0x58a231[_0x7d87('0x53')]);if(_0x1b7a71&&_0x1b7a71['monitor_format']){logger['info']('['+_0x5e6825['lastevent']['toUpperCase']()+']',_0x7d87('0x72'));_0x5e6825[_0x7d87('0x59')]=util[_0x7d87('0x20')](_0x7d87('0x5a'),_0x58a231[_0x7d87('0x54')],_0x5e6825[_0x7d87('0x5b')],md5(_0x5e6825[_0x7d87('0x5b')]));}else{_0x5e6825[_0x7d87('0x59')]='';}return getConnection(_0x58a231)[_0x7d87('0x29')](function(_0x1413de){_0x484fa3=_0x1413de;if(!_[_0x7d87('0x25')](_0x57613a)){return getUser(_0x58a231,_0x57613a[_0x7d87('0xd')],_0x484fa3);}else{return getUser(_0x58a231,null,_0x484fa3);}})[_0x7d87('0x29')](function(_0x91135d){_0x453a69=_0x91135d;logger[_0x7d87('0xb')](_0x7d87('0x5c'),_0x453a69['id']);return getEndUser(_0x58a231,_0x5e6825[_0x7d87('0x5d')],_0x5e6825['calleridnum'],_0x484fa3);})[_0x7d87('0x29')](function(_0x29805d){_0x5016a8=_0x29805d;logger['info'](_0x7d87('0x5f'),_0x5016a8['id']);return getTicket(_0x58a231,_0x453a69,_0x5016a8,_0x3a3815,_0x5e6825,_0x3a3815[_0x7d87('0x60')],_0x484fa3,_0x7d87('0x73'));})[_0x7d87('0x29')](function(_0x4c99df){_0x48c885=_0x4c99df;logger[_0x7d87('0xb')](_0x7d87('0x6c'));logger[_0x7d87('0xb')](_0x7d87('0x6d'),_0x48c885['id']);return setRelationship(_0x484fa3,_0x453a69,_0x48c885,_0x7d87('0x61'));})[_0x7d87('0x29')](function(){return setRelationship(_0x484fa3,_0x5016a8,_0x48c885,_0x7d87('0x6e'));})['then'](function(){return getServerInfo(_0x484fa3);})[_0x7d87('0x74')](function(_0x2293a9){logger[_0x7d87('0x75')]('['+_0x5e6825[_0x7d87('0x76')][_0x7d87('0x77')]()+']',JSON[_0x7d87('0x1e')](_0x2293a9));});}; \ 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 0415941..6d0a4f9 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 _0xa99a=['validateEmail','isNil','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','%s:\x20%s','format','keyType','join','stripTrailingSlash','slice','substring'];(function(_0x40c098,_0x361fc6){var _0x4fe0b4=function(_0x5ac8ad){while(--_0x5ac8ad){_0x40c098['push'](_0x40c098['shift']());}};_0x4fe0b4(++_0x361fc6);}(_0xa99a,0x1b3));var _0xaa99=function(_0x18847a,_0xd6898e){_0x18847a=_0x18847a-0x0;var _0x5b68ca=_0xa99a[_0x18847a];return _0x5b68ca;};'use strict';var _=require(_0xaa99('0x0'));var util=require(_0xaa99('0x1'));exports['getString']=function(_0x2dac63,_0x317a3a,_0x5ce7a1){var _0x3c9493=[];if(_0x2dac63[_0xaa99('0x2')]>0x0){var _0x10383f=_[_0xaa99('0x3')](_0x2dac63,['id']);for(var _0x418cbe=0x0;_0x418cbe<_0x10383f['length'];_0x418cbe++){var _0x460078=_0x10383f[_0x418cbe];if(_0x460078[_0xaa99('0x4')]===_0xaa99('0x5')){_0x3c9493[_0xaa99('0x6')](_0x460078[_0xaa99('0x7')]);}else if(_0x460078[_0xaa99('0x4')]===_0xaa99('0x8')&&_0x460078[_0xaa99('0x9')]){_0x317a3a[_0x460078[_0xaa99('0x9')]]&&_0x3c9493[_0xaa99('0x6')](_0x317a3a[_0x460078[_0xaa99('0x9')]][_0xaa99('0xa')]());}else if(_0x460078[_0xaa99('0x4')]===_0xaa99('0xb')&&_0x460078['Variable']&&_0x460078[_0xaa99('0xc')][_0xaa99('0xd')]){_0x317a3a[_0x460078[_0xaa99('0xc')][_0xaa99('0xd')][_0xaa99('0xe')]()]&&_0x3c9493[_0xaa99('0x6')](_0x317a3a[_0x460078['Variable']['name']['toLowerCase']()][_0xaa99('0xa')]());}else if(_0x460078[_0xaa99('0x4')]===_0xaa99('0xf')){if(_0x460078['keyType']===_0xaa99('0x5')&&_0x460078[_0xaa99('0x10')]){_0x3c9493[_0xaa99('0x6')](util['format'](_0xaa99('0x11'),_0x460078[_0xaa99('0x10')],_0x460078['keyContent']));}else if(_0x460078['keyType']===_0xaa99('0x8')&&_0x460078[_0xaa99('0x9')]&&_0x460078['key']){_0x317a3a[_0x460078[_0xaa99('0x9')]]&&_0x3c9493[_0xaa99('0x6')](util[_0xaa99('0x12')](_0xaa99('0x11'),_0x460078[_0xaa99('0x10')],_0x317a3a[_0x460078[_0xaa99('0x9')]]));}else if(_0x460078[_0xaa99('0x13')]==='customVariable'&&_0x460078[_0xaa99('0xc')]&&_0x460078[_0xaa99('0xc')][_0xaa99('0xd')]&&_0x460078[_0xaa99('0x10')]){_0x317a3a[_0x460078[_0xaa99('0xc')][_0xaa99('0xd')][_0xaa99('0xe')]()]&&_0x3c9493['push'](util[_0xaa99('0x12')](_0xaa99('0x11'),_0x460078[_0xaa99('0x10')],_0x317a3a[_0x460078[_0xaa99('0xc')][_0xaa99('0xd')][_0xaa99('0xe')]()]));}}}}return _0x3c9493[_0xaa99('0x14')](_0x5ce7a1);};exports[_0xaa99('0x15')]=function(_0x221a34){var _0x57defb=_0x221a34[_0xaa99('0x16')](-0x1);if(_0x57defb==='/'){_0x221a34=_0x221a34[_0xaa99('0x17')](0x0,_0x221a34['lastIndexOf'](_0x57defb));}return _0x221a34;};exports[_0xaa99('0x18')]=function(_0x321272){if(!_[_0xaa99('0x19')](_0x321272)&&_0x321272!==''){var _0x53da9c=/^(([^<>()\[\]\\.,;:\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 _0x53da9c[_0xaa99('0x1a')](String(_0x321272)[_0xaa99('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xa96b=['keyContent','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','Variable','name','toLowerCase','keyType','key','format'];(function(_0x26d842,_0x338c65){var _0x5d50cd=function(_0x52499f){while(--_0x52499f){_0x26d842['push'](_0x26d842['shift']());}};_0x5d50cd(++_0x338c65);}(_0xa96b,0xe2));var _0xba96=function(_0x260bfb,_0x10fe00){_0x260bfb=_0x260bfb-0x0;var _0x52d83d=_0xa96b[_0x260bfb];return _0x52d83d;};'use strict';var _=require(_0xba96('0x0'));var util=require(_0xba96('0x1'));exports[_0xba96('0x2')]=function(_0x2e01a1,_0x3736f0,_0x5d9d97){var _0x5bf054=[];if(_0x2e01a1[_0xba96('0x3')]>0x0){var _0x350e53=_[_0xba96('0x4')](_0x2e01a1,['id']);for(var _0x1e2312=0x0;_0x1e2312<_0x350e53[_0xba96('0x3')];_0x1e2312++){var _0x446e87=_0x350e53[_0x1e2312];if(_0x446e87[_0xba96('0x5')]===_0xba96('0x6')){_0x5bf054[_0xba96('0x7')](_0x446e87[_0xba96('0x8')]);}else if(_0x446e87[_0xba96('0x5')]===_0xba96('0x9')&&_0x446e87[_0xba96('0xa')]){_0x3736f0[_0x446e87[_0xba96('0xa')]]&&_0x5bf054[_0xba96('0x7')](_0x3736f0[_0x446e87[_0xba96('0xa')]]['toString']());}else if(_0x446e87[_0xba96('0x5')]==='customVariable'&&_0x446e87[_0xba96('0xb')]&&_0x446e87[_0xba96('0xb')][_0xba96('0xc')]){_0x3736f0[_0x446e87['Variable'][_0xba96('0xc')]['toLowerCase']()]&&_0x5bf054['push'](_0x3736f0[_0x446e87[_0xba96('0xb')]['name'][_0xba96('0xd')]()]['toString']());}else if(_0x446e87['type']==='keyValue'){if(_0x446e87[_0xba96('0xe')]===_0xba96('0x6')&&_0x446e87[_0xba96('0xf')]){_0x5bf054[_0xba96('0x7')](util[_0xba96('0x10')]('%s:\x20%s',_0x446e87['key'],_0x446e87[_0xba96('0x11')]));}else if(_0x446e87[_0xba96('0xe')]==='variable'&&_0x446e87[_0xba96('0xa')]&&_0x446e87[_0xba96('0xf')]){_0x3736f0[_0x446e87['variableName']]&&_0x5bf054[_0xba96('0x7')](util[_0xba96('0x10')](_0xba96('0x12'),_0x446e87[_0xba96('0xf')],_0x3736f0[_0x446e87[_0xba96('0xa')]]));}else if(_0x446e87[_0xba96('0xe')]===_0xba96('0x13')&&_0x446e87[_0xba96('0xb')]&&_0x446e87[_0xba96('0xb')][_0xba96('0xc')]&&_0x446e87[_0xba96('0xf')]){_0x3736f0[_0x446e87['Variable'][_0xba96('0xc')]['toLowerCase']()]&&_0x5bf054['push'](util[_0xba96('0x10')]('%s:\x20%s',_0x446e87['key'],_0x3736f0[_0x446e87[_0xba96('0xb')]['name'][_0xba96('0xd')]()]));}}}}return _0x5bf054[_0xba96('0x14')](_0x5d9d97);};exports[_0xba96('0x15')]=function(_0x4a08f2){var _0x354353=_0x4a08f2[_0xba96('0x16')](-0x1);if(_0x354353==='/'){_0x4a08f2=_0x4a08f2[_0xba96('0x17')](0x0,_0x4a08f2[_0xba96('0x18')](_0x354353));}return _0x4a08f2;};exports['validateEmail']=function(_0x37f93f){if(!_[_0xba96('0x19')](_0x37f93f)&&_0x37f93f!==''){var _0xda9741=/^(([^<>()\[\]\\.,;:\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 _0xda9741[_0xba96('0x1a')](String(_0x37f93f)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 290ad5f..9f1c7b7 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x4975ba,_0x2e3de6){var _0x2808a6=function(_0x4d1b4e){while(--_0x4d1b4e){_0x4975ba['push'](_0x4975ba['shift']());}};_0x2808a6(++_0x2e3de6);}(_0x34e8,0x12c));var _0x834e=function(_0x1fdb3b,_0x1d77ae){_0x1fdb3b=_0x1fdb3b-0x0;var _0x144a4e=_0x34e8[_0x1fdb3b];return _0x144a4e;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 330e771..12c795a 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 _0x0806=['inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','ioredis','./util','../../../../config/environment','zendesk','redis','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','base64','debug','[HTTP]','stringify','defaults','GET','forEach','includes','string','picklist','type','nameField','content','toString','idField','custom_fields','push','variableName','customField','customVariable','Variable','toLowerCase','name','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x3e2722,_0x34acad){var _0x43da94=function(_0x1af493){while(--_0x1af493){_0x3e2722['push'](_0x3e2722['shift']());}};_0x43da94(++_0x34acad);}(_0x0806,0xe4));var _0x6080=function(_0x2a6944,_0x2000ec){_0x2a6944=_0x2a6944-0x0;var _0x1069c5=_0x0806[_0x2a6944];return _0x1069c5;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x6080('0x0'));var util=require('util');var Redis=require(_0x6080('0x1'));var intUtil=require(_0x6080('0x2'));var config=require(_0x6080('0x3'));var logger=require('../../../../config/logger')(_0x6080('0x4'));config[_0x6080('0x5')]=_['defaults'](config[_0x6080('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x6080('0x6'))(new Redis(config[_0x6080('0x5')]));function emit(_0x1b5bef,_0x9ffdef,_0x19c9db){io['to'](_0x1b5bef)[_0x6080('0x7')](_0x9ffdef,_0x19c9db);}var headers={'Content-Type':_0x6080('0x8'),'Accept':_0x6080('0x8')};function getTicket(_0x3ff594,_0xc3663d,_0xd3be94,_0x357e77,_0x22ae65){logger['info'](_0x6080('0x9'));return request({'uri':util[_0x6080('0xa')]('%s/tickets.json',_0x3ff594['remoteUri']),'method':_0x6080('0xb'),'body':{'ticket':_[_0x6080('0xc')]({'requester_id':_0xd3be94['id'],'submitter_id':_0xc3663d?_0xc3663d['id']:undefined,'assignee_id':_0xc3663d?_0xc3663d['id']:undefined,'tags':getTags(_0x357e77[_0x6080('0xd')],'name'),'subject':intUtil[_0x6080('0xe')](_0x357e77[_0x6080('0xf')],_0x22ae65,'\x20'),'description':intUtil[_0x6080('0xe')](_0x357e77['Descriptions'],_0x22ae65,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6080('0xe')](_0x357e77[_0x6080('0x10')],_0x22ae65,'\x0a')}},getCustomFields(_0x357e77[_0x6080('0x11')],_0x22ae65))}})[_0x6080('0x12')](function(_0x3a36f8){logger[_0x6080('0x13')](_0x6080('0x14'));return _0x3a36f8['ticket'];});}function getUser(_0x7e3c5d,_0x2bcfb6){if(intUtil[_0x6080('0x15')](_0x2bcfb6)){logger[_0x6080('0x13')]('Getting\x20agent\x20with\x20email',_0x2bcfb6);return request({'uri':util[_0x6080('0xa')](_0x6080('0x16'),_0x7e3c5d[_0x6080('0x17')]),'qs':{'query':util['format'](_0x6080('0x18'),_0x2bcfb6)}})[_0x6080('0x12')](function(_0x449f78){if(_0x449f78[_0x6080('0x19')]){logger['info'](_0x6080('0x1a'));return _['find'](_0x449f78[_0x6080('0x1b')],{'email':_0x2bcfb6,'role':_0x6080('0x1c')});}else{logger[_0x6080('0x13')](_0x6080('0x1d'));return request({'uri':util['format'](_0x6080('0x1e'),_0x7e3c5d['remoteUri'])})[_0x6080('0x12')](function(_0x4d18c7){logger[_0x6080('0x13')](_0x6080('0x1f'));return _0x4d18c7[_0x6080('0x20')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x7e3c5d[_0x6080('0x17')])})[_0x6080('0x12')](function(_0x14b302){logger['info'](_0x6080('0x1f'));return _0x14b302[_0x6080('0x20')];});}}function getEndUser(_0x3bdf2f,_0x33239a,_0x792440){logger[_0x6080('0x13')](_0x6080('0x21'),_0x792440);return request({'uri':util[_0x6080('0xa')]('%s/search.json',_0x3bdf2f['remoteUri']),'qs':{'query':util[_0x6080('0xa')](_0x6080('0x22'),_0x792440)}})[_0x6080('0x12')](function(_0x416664){var _0x4b627e;if(_0x416664[_0x6080('0x1b')][_0x6080('0x23')]){_0x416664[_0x6080('0x1b')]=_['filter'](_0x416664[_0x6080('0x1b')],{'suspended':![],'role':_0x6080('0x24')});if(_0x416664[_0x6080('0x1b')][_0x6080('0x23')]){_0x4b627e=_['first'](_0x416664[_0x6080('0x1b')]);}}if(_0x4b627e){logger[_0x6080('0x13')](_0x6080('0x25'));return _0x4b627e;}else{logger[_0x6080('0x13')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6080('0xa')]('%s/users.json',_0x3bdf2f[_0x6080('0x17')]),'method':_0x6080('0xb'),'body':{'user':{'role':_0x6080('0x24'),'name':util[_0x6080('0xa')](_0x6080('0x26'),_0x33239a||_0x792440),'phone':_0x792440}}})[_0x6080('0x12')](function(_0x5c28f3){logger[_0x6080('0x13')]('Enduser\x20created.');return _0x5c28f3[_0x6080('0x20')];});}});}function getAuth(_0x11bef0){var _0x37794e;if(_0x11bef0[_0x6080('0x27')]===_0x6080('0x28')){_0x37794e=util['format'](_0x6080('0x29'),_0x11bef0[_0x6080('0x2a')],_0x11bef0[_0x6080('0x28')]);}else if(_0x11bef0[_0x6080('0x27')]===_0x6080('0x2b')){_0x37794e=util[_0x6080('0xa')](_0x6080('0x2c'),_0x11bef0[_0x6080('0x2a')],_0x11bef0[_0x6080('0x2b')]);}return util['format']('Basic\x20%s',new Buffer(_0x37794e)['toString'](_0x6080('0x2d')));}function request(_0x35191d){logger[_0x6080('0x2e')](_0x6080('0x2f'),JSON[_0x6080('0x30')](_0x35191d));return rp(_[_0x6080('0x31')](_0x35191d,{'method':_0x6080('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2fbd3e,_0x1160e3){var _0x248eca=[];if(_0x2fbd3e&&_0x2fbd3e[_0x6080('0x23')]>0x0){_0x248eca=_['map'](_0x2fbd3e,_0x1160e3);}return _0x248eca;}function getCustomFields(_0x4fa8a2,_0x106627){var _0x5b2001=[];var _0x24b5ec={'custom_fields':[]};if(_0x4fa8a2[_0x6080('0x23')]>0x0){_[_0x6080('0x33')](_0x4fa8a2,function(_0x36cdaf){if(_[_0x6080('0x34')]([_0x6080('0x35'),_0x6080('0x36')],_0x36cdaf[_0x6080('0x37')])&&_0x36cdaf['nameField']&&!_0x36cdaf['customField']){_0x24b5ec[_0x36cdaf[_0x6080('0x38')]['toLowerCase']()]=_0x36cdaf[_0x6080('0x39')][_0x6080('0x3a')]();}else if(_[_0x6080('0x34')]([_0x6080('0x35'),_0x6080('0x36')],_0x36cdaf['type'])&&_0x36cdaf[_0x6080('0x3b')]&&_0x36cdaf['customField']){_0x24b5ec[_0x6080('0x3c')][_0x6080('0x3d')]({'id':_0x36cdaf[_0x6080('0x3b')],'value':_0x36cdaf[_0x6080('0x39')][_0x6080('0x3a')]()});}else if(_0x36cdaf[_0x6080('0x37')]==='variable'&&_0x36cdaf[_0x6080('0x3e')]&&_0x36cdaf[_0x6080('0x3b')]&&_0x36cdaf[_0x6080('0x3f')]){_0x106627[_0x36cdaf[_0x6080('0x3e')]]&&_0x24b5ec[_0x6080('0x3c')][_0x6080('0x3d')]({'id':_0x36cdaf['idField'],'value':_0x106627[_0x36cdaf[_0x6080('0x3e')]][_0x6080('0x3a')]()});}else if(_0x36cdaf[_0x6080('0x37')]===_0x6080('0x40')&&_0x36cdaf[_0x6080('0x41')]&&_0x36cdaf[_0x6080('0x41')]['name']&&_0x36cdaf[_0x6080('0x3b')]&&_0x36cdaf[_0x6080('0x3f')]){_0x106627[_0x36cdaf[_0x6080('0x41')]['name'][_0x6080('0x42')]()]&&_0x24b5ec['custom_fields'][_0x6080('0x3d')]({'id':_0x36cdaf[_0x6080('0x3b')],'value':_0x106627[_0x36cdaf[_0x6080('0x41')][_0x6080('0x43')][_0x6080('0x42')]()][_0x6080('0x3a')]()});}});}return _0x24b5ec;}exports['queue']=function(_0x3525f1,_0x476f62,_0x5b3ac5,_0x5df7d1,_0x5ec67a,_0x3cd3cf){var _0x1a699c,_0x23b184;_0x3cd3cf[_0x6080('0x17')]=intUtil['stripTrailingSlash'](_0x3cd3cf[_0x6080('0x17')]);_0x3cd3cf[_0x6080('0x44')]=intUtil[_0x6080('0x45')](_0x3cd3cf[_0x6080('0x44')]);if(_0x5ec67a&&_0x5ec67a[_0x6080('0x46')]){logger[_0x6080('0x13')](_0x6080('0x47'),'Recording\x20is\x20enabled!');_0x476f62[_0x6080('0x48')]=util[_0x6080('0xa')](_0x6080('0x49'),_0x3cd3cf[_0x6080('0x44')],_0x476f62[_0x6080('0x4a')],md5(_0x476f62[_0x6080('0x4a')]));}else{_0x476f62[_0x6080('0x48')]='';}headers[_0x6080('0x4b')]=getAuth(_0x3cd3cf);return getUser(_0x3cd3cf,_0x5df7d1['email'])['then'](function(_0x2d5f24){_0x1a699c=_0x2d5f24;logger[_0x6080('0x13')](_0x6080('0x4c'),_0x1a699c['id']);return getEndUser(_0x3cd3cf,_0x476f62['calleridname'],_0x476f62[_0x6080('0x4d')]);})[_0x6080('0x12')](function(_0x4faa97){_0x23b184=_0x4faa97;logger[_0x6080('0x13')](_0x6080('0x4e'),_0x23b184['id']);return getTicket(_0x3cd3cf,_0x1a699c,_0x23b184,_0x5b3ac5,_0x476f62);})[_0x6080('0x12')](function(_0x2b99fd){if(_0x2b99fd){logger[_0x6080('0x13')](_0x6080('0x4f'),_0x2b99fd['id']);switch(_0x3cd3cf[_0x6080('0x37')]){case _0x6080('0x50'):logger[_0x6080('0x13')](_0x6080('0x47'),_0x6080('0x51'));return request({'uri':util['format'](_0x6080('0x52'),_0x3cd3cf[_0x6080('0x17')],_0x1a699c['id'],_0x2b99fd['id']),'method':_0x6080('0xb')});case _0x6080('0x53'):logger['info'](_0x6080('0x47'),_0x6080('0x54'));emit(util[_0x6080('0xa')](_0x6080('0x55'),_0x5df7d1[_0x6080('0x43')]),_0x6080('0x56'),{'uri':util['format'](_0x6080('0x57'),_0x3cd3cf[_0x6080('0x17')][_0x6080('0x58')](_0x6080('0x59'),''),_0x2b99fd['id'])});break;default:logger[_0x6080('0x5a')]('[QUEUE]',_0x6080('0x5b'));}}})['catch'](function(_0x57f828){logger[_0x6080('0x5a')](_0x6080('0x5c'),util[_0x6080('0x5d')](_0x57f828,{'showHidden':!![],'depth':null}));});};exports[_0x6080('0x5e')]=function(_0x12679a,_0x20f178,_0xe3fe1b,_0x1c205e,_0x3c644f,_0x575ea2,_0x3b4b29){var _0x3d14a1,_0x9067f;_0x575ea2['remoteUri']=intUtil[_0x6080('0x45')](_0x575ea2[_0x6080('0x17')]);_0x575ea2[_0x6080('0x44')]=intUtil['stripTrailingSlash'](_0x575ea2[_0x6080('0x44')]);if(_0x3b4b29&&_0x3b4b29[_0x6080('0x5f')]&&_0x3b4b29['recordingFormat']!==_0x6080('0x60')){logger[_0x6080('0x13')](_0x6080('0x61'),_0x6080('0x62'));_0x20f178[_0x6080('0x48')]=util[_0x6080('0xa')](_0x6080('0x49'),_0x575ea2['serverUrl'],_0x20f178[_0x6080('0x4a')],md5(_0x20f178[_0x6080('0x4a')]));}headers[_0x6080('0x4b')]=getAuth(_0x575ea2);return getUser(_0x575ea2,_0x1c205e[_0x6080('0x63')])['then'](function(_0x21bba9){_0x3d14a1=_0x21bba9;logger[_0x6080('0x13')](_0x6080('0x4c'),_0x3d14a1['id']);return getEndUser(_0x575ea2,_0x20f178[_0x6080('0x64')],_0x20f178[_0x6080('0x65')]);})['then'](function(_0x230f34){_0x9067f=_0x230f34;logger[_0x6080('0x13')](_0x6080('0x4e'),_0x9067f['id']);return getTicket(_0x575ea2,_0x3d14a1,_0x9067f,_0xe3fe1b,_0x20f178);})[_0x6080('0x12')](function(_0x482c08){if(_0x482c08){logger[_0x6080('0x13')]('The\x20Ticket\x20ID\x20is:',_0x482c08['id']);switch(_0x575ea2[_0x6080('0x37')]){case _0x6080('0x50'):logger[_0x6080('0x13')](_0x6080('0x61'),_0x6080('0x51'));return request({'uri':util[_0x6080('0xa')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x575ea2['remoteUri'],_0x3d14a1['id'],_0x482c08['id']),'method':_0x6080('0xb')});case'newTab':logger['info']('[OUTBOUND]',_0x6080('0x54'));emit(util['format'](_0x6080('0x55'),_0x1c205e['name']),_0x6080('0x56'),{'uri':util[_0x6080('0xa')](_0x6080('0x57'),_0x575ea2['remoteUri'][_0x6080('0x58')](_0x6080('0x59'),''),_0x482c08['id'])});break;default:logger[_0x6080('0x5a')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6080('0x66')](function(_0xaad343){logger[_0x6080('0x5a')](_0x6080('0x67'),util['inspect'](_0xaad343,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x222254,_0x254452,_0x4df238,_0x5701ea,_0x3f512e,_0x58e6c4){var _0x3d1953,_0x56bc51;_0x58e6c4[_0x6080('0x17')]=intUtil[_0x6080('0x45')](_0x58e6c4[_0x6080('0x17')]);_0x58e6c4[_0x6080('0x44')]=intUtil[_0x6080('0x45')](_0x58e6c4['serverUrl']);if(_0x3f512e&&_0x3f512e['monitor_format']){logger['info']('['+_0x254452[_0x6080('0x68')][_0x6080('0x69')]()+']',_0x6080('0x62'));_0x254452['recordingURL']=util[_0x6080('0xa')](_0x6080('0x49'),_0x58e6c4[_0x6080('0x44')],_0x254452[_0x6080('0x4a')],md5(_0x254452['uniqueid']));}else{_0x254452[_0x6080('0x48')]='';}headers[_0x6080('0x4b')]=getAuth(_0x58e6c4);return getUser(_0x58e6c4)['then'](function(_0x28b0aa){_0x3d1953=_0x28b0aa;logger['info']('The\x20User\x20ID\x20is:',_0x3d1953['id']);return getEndUser(_0x58e6c4,_0x254452['calleridname'],_0x254452['calleridnum']);})[_0x6080('0x12')](function(_0x3c3726){_0x56bc51=_0x3c3726;logger[_0x6080('0x13')](_0x6080('0x4e'),_0x56bc51['id']);return getTicket(_0x58e6c4,_0x3d1953,_0x56bc51,_0x4df238,_0x254452);})[_0x6080('0x12')](function(_0x489331){if(_0x489331){logger[_0x6080('0x13')](_0x6080('0x4f'),_0x489331['id']);}})[_0x6080('0x66')](function(_0x33d105){logger[_0x6080('0x5a')]('['+_0x254452['lastevent'][_0x6080('0x69')]()+']'+_0x6080('0x6a'),util[_0x6080('0x5d')](_0x33d105,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdc3d=['emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','content','idField','custom_fields','push','toString','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0xdc3d,0xd9));var _0xddc3=function(_0x4f1721,_0x3d5b8d){_0x4f1721=_0x4f1721-0x0;var _0x145319=_0xdc3d[_0x4f1721];return _0x145319;};'use strict';var _=require(_0xddc3('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xddc3('0x1'));var Redis=require(_0xddc3('0x2'));var intUtil=require(_0xddc3('0x3'));var config=require(_0xddc3('0x4'));var logger=require(_0xddc3('0x5'))(_0xddc3('0x6'));config['redis']=_['defaults'](config[_0xddc3('0x7')],{'host':_0xddc3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xddc3('0x7')]));function emit(_0x5726b2,_0x5c67ca,_0x4eb86f){io['to'](_0x5726b2)[_0xddc3('0x9')](_0x5c67ca,_0x4eb86f);}var headers={'Content-Type':_0xddc3('0xa'),'Accept':_0xddc3('0xa')};function getTicket(_0x2fdca6,_0x177efc,_0x233a9c,_0x814f5d,_0xb019bd){logger[_0xddc3('0xb')](_0xddc3('0xc'));return request({'uri':util['format'](_0xddc3('0xd'),_0x2fdca6[_0xddc3('0xe')]),'method':'POST','body':{'ticket':_[_0xddc3('0xf')]({'requester_id':_0x233a9c['id'],'submitter_id':_0x177efc?_0x177efc['id']:undefined,'assignee_id':_0x177efc?_0x177efc['id']:undefined,'tags':getTags(_0x814f5d[_0xddc3('0x10')],_0xddc3('0x11')),'subject':intUtil[_0xddc3('0x12')](_0x814f5d[_0xddc3('0x13')],_0xb019bd,'\x20'),'description':intUtil['getString'](_0x814f5d[_0xddc3('0x14')],_0xb019bd,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x814f5d[_0xddc3('0x14')],_0xb019bd,'\x0a')}},getCustomFields(_0x814f5d[_0xddc3('0x15')],_0xb019bd))}})[_0xddc3('0x16')](function(_0x222b85){logger[_0xddc3('0xb')](_0xddc3('0x17'));return _0x222b85[_0xddc3('0x18')];});}function getUser(_0x2f3e4a,_0x45a9c8){if(intUtil[_0xddc3('0x19')](_0x45a9c8)){logger[_0xddc3('0xb')](_0xddc3('0x1a'),_0x45a9c8);return request({'uri':util[_0xddc3('0x1b')](_0xddc3('0x1c'),_0x2f3e4a[_0xddc3('0xe')]),'qs':{'query':util[_0xddc3('0x1b')](_0xddc3('0x1d'),_0x45a9c8)}})[_0xddc3('0x16')](function(_0x2e2751){if(_0x2e2751['count']){logger[_0xddc3('0xb')](_0xddc3('0x1e'));return _[_0xddc3('0x1f')](_0x2e2751[_0xddc3('0x20')],{'email':_0x45a9c8,'role':_0xddc3('0x21')});}else{logger['info'](_0xddc3('0x22'));return request({'uri':util[_0xddc3('0x1b')](_0xddc3('0x23'),_0x2f3e4a[_0xddc3('0xe')])})[_0xddc3('0x16')](function(_0x5b15b9){logger['info'](_0xddc3('0x24'));return _0x5b15b9['user'];});}});}else{logger[_0xddc3('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x2f3e4a[_0xddc3('0xe')])})['then'](function(_0x7b49dd){logger[_0xddc3('0xb')](_0xddc3('0x24'));return _0x7b49dd[_0xddc3('0x25')];});}}function getEndUser(_0x274969,_0x4774df,_0xbd5ab2){logger['info']('Searching\x20enduser\x20with\x20phone',_0xbd5ab2);return request({'uri':util[_0xddc3('0x1b')](_0xddc3('0x1c'),_0x274969[_0xddc3('0xe')]),'qs':{'query':util[_0xddc3('0x1b')](_0xddc3('0x26'),_0xbd5ab2)}})[_0xddc3('0x16')](function(_0x316ab6){var _0x4d5c04;if(_0x316ab6[_0xddc3('0x20')]['length']){_0x316ab6['results']=_[_0xddc3('0x27')](_0x316ab6[_0xddc3('0x20')],{'suspended':![],'role':_0xddc3('0x28')});if(_0x316ab6[_0xddc3('0x20')][_0xddc3('0x29')]){_0x4d5c04=_['first'](_0x316ab6['results']);}}if(_0x4d5c04){logger[_0xddc3('0xb')](_0xddc3('0x2a'));return _0x4d5c04;}else{logger[_0xddc3('0xb')](_0xddc3('0x2b'));return request({'uri':util[_0xddc3('0x1b')](_0xddc3('0x2c'),_0x274969[_0xddc3('0xe')]),'method':_0xddc3('0x2d'),'body':{'user':{'role':'end-user','name':util[_0xddc3('0x1b')]('Caller\x20-\x20%s',_0x4774df||_0xbd5ab2),'phone':_0xbd5ab2}}})[_0xddc3('0x16')](function(_0x2a341f){logger['info']('Enduser\x20created.');return _0x2a341f[_0xddc3('0x25')];});}});}function getAuth(_0x5d9426){var _0x580dea;if(_0x5d9426[_0xddc3('0x2e')]===_0xddc3('0x2f')){_0x580dea=util['format']('%s:%s',_0x5d9426[_0xddc3('0x30')],_0x5d9426['password']);}else if(_0x5d9426[_0xddc3('0x2e')]===_0xddc3('0x31')){_0x580dea=util[_0xddc3('0x1b')](_0xddc3('0x32'),_0x5d9426[_0xddc3('0x30')],_0x5d9426['token']);}return util['format'](_0xddc3('0x33'),new Buffer(_0x580dea)['toString'](_0xddc3('0x34')));}function request(_0x3f8b5e){logger[_0xddc3('0x35')](_0xddc3('0x36'),JSON[_0xddc3('0x37')](_0x3f8b5e));return rp(_[_0xddc3('0x38')](_0x3f8b5e,{'method':_0xddc3('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x42a1e2,_0xdd11b4){var _0x32fdb4=[];if(_0x42a1e2&&_0x42a1e2[_0xddc3('0x29')]>0x0){_0x32fdb4=_[_0xddc3('0x3a')](_0x42a1e2,_0xdd11b4);}return _0x32fdb4;}function getCustomFields(_0x4818aa,_0x3a5091){var _0x10785f=[];var _0x4afb7d={'custom_fields':[]};if(_0x4818aa[_0xddc3('0x29')]>0x0){_[_0xddc3('0x3b')](_0x4818aa,function(_0x53ca69){if(_[_0xddc3('0x3c')]([_0xddc3('0x3d'),_0xddc3('0x3e')],_0x53ca69[_0xddc3('0x3f')])&&_0x53ca69['nameField']&&!_0x53ca69[_0xddc3('0x40')]){_0x4afb7d[_0x53ca69[_0xddc3('0x41')]['toLowerCase']()]=_0x53ca69[_0xddc3('0x42')]['toString']();}else if(_[_0xddc3('0x3c')]([_0xddc3('0x3d'),_0xddc3('0x3e')],_0x53ca69[_0xddc3('0x3f')])&&_0x53ca69[_0xddc3('0x43')]&&_0x53ca69[_0xddc3('0x40')]){_0x4afb7d[_0xddc3('0x44')][_0xddc3('0x45')]({'id':_0x53ca69[_0xddc3('0x43')],'value':_0x53ca69[_0xddc3('0x42')][_0xddc3('0x46')]()});}else if(_0x53ca69[_0xddc3('0x3f')]===_0xddc3('0x47')&&_0x53ca69['variableName']&&_0x53ca69[_0xddc3('0x43')]&&_0x53ca69[_0xddc3('0x40')]){_0x3a5091[_0x53ca69[_0xddc3('0x48')]]&&_0x4afb7d[_0xddc3('0x44')][_0xddc3('0x45')]({'id':_0x53ca69[_0xddc3('0x43')],'value':_0x3a5091[_0x53ca69[_0xddc3('0x48')]][_0xddc3('0x46')]()});}else if(_0x53ca69[_0xddc3('0x3f')]===_0xddc3('0x49')&&_0x53ca69['Variable']&&_0x53ca69[_0xddc3('0x4a')]['name']&&_0x53ca69[_0xddc3('0x43')]&&_0x53ca69[_0xddc3('0x40')]){_0x3a5091[_0x53ca69[_0xddc3('0x4a')][_0xddc3('0x11')]['toLowerCase']()]&&_0x4afb7d[_0xddc3('0x44')][_0xddc3('0x45')]({'id':_0x53ca69['idField'],'value':_0x3a5091[_0x53ca69[_0xddc3('0x4a')][_0xddc3('0x11')][_0xddc3('0x4b')]()][_0xddc3('0x46')]()});}});}return _0x4afb7d;}exports[_0xddc3('0x4c')]=function(_0x50df08,_0x1d4d5e,_0x6790ad,_0x437b2c,_0x4a630f,_0x138032){var _0x8cdf1e,_0x16d05e;_0x138032[_0xddc3('0xe')]=intUtil[_0xddc3('0x4d')](_0x138032[_0xddc3('0xe')]);_0x138032[_0xddc3('0x4e')]=intUtil[_0xddc3('0x4d')](_0x138032[_0xddc3('0x4e')]);if(_0x4a630f&&_0x4a630f[_0xddc3('0x4f')]){logger[_0xddc3('0xb')](_0xddc3('0x50'),_0xddc3('0x51'));_0x1d4d5e[_0xddc3('0x52')]=util[_0xddc3('0x1b')](_0xddc3('0x53'),_0x138032[_0xddc3('0x4e')],_0x1d4d5e[_0xddc3('0x54')],md5(_0x1d4d5e[_0xddc3('0x54')]));}else{_0x1d4d5e[_0xddc3('0x52')]='';}headers[_0xddc3('0x55')]=getAuth(_0x138032);return getUser(_0x138032,_0x437b2c[_0xddc3('0x56')])[_0xddc3('0x16')](function(_0x5dc0c8){_0x8cdf1e=_0x5dc0c8;logger[_0xddc3('0xb')]('The\x20User\x20ID\x20is:',_0x8cdf1e['id']);return getEndUser(_0x138032,_0x1d4d5e[_0xddc3('0x57')],_0x1d4d5e[_0xddc3('0x58')]);})[_0xddc3('0x16')](function(_0x5bcf5a){_0x16d05e=_0x5bcf5a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x16d05e['id']);return getTicket(_0x138032,_0x8cdf1e,_0x16d05e,_0x6790ad,_0x1d4d5e);})[_0xddc3('0x16')](function(_0x483e70){if(_0x483e70){logger['info'](_0xddc3('0x59'),_0x483e70['id']);switch(_0x138032[_0xddc3('0x3f')]){case _0xddc3('0x5a'):logger[_0xddc3('0xb')](_0xddc3('0x50'),_0xddc3('0x5b'));return request({'uri':util[_0xddc3('0x1b')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x138032[_0xddc3('0xe')],_0x8cdf1e['id'],_0x483e70['id']),'method':_0xddc3('0x2d')});case _0xddc3('0x5c'):logger[_0xddc3('0xb')](_0xddc3('0x50'),_0xddc3('0x5d'));emit(util['format'](_0xddc3('0x5e'),_0x437b2c[_0xddc3('0x11')]),_0xddc3('0x5f'),{'uri':util[_0xddc3('0x1b')]('%s/agent/tickets/%s',_0x138032[_0xddc3('0xe')][_0xddc3('0x60')](_0xddc3('0x61'),''),_0x483e70['id'])});break;default:logger[_0xddc3('0x62')](_0xddc3('0x50'),_0xddc3('0x63'));}}})[_0xddc3('0x64')](function(_0x5610b8){logger['error'](_0xddc3('0x65'),util[_0xddc3('0x66')](_0x5610b8,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xaa49b5,_0x35fd07,_0x17016a,_0x5ac81a,_0x3eb712,_0x121736,_0x39bb7f){var _0x275e02,_0xabc9f1;_0x121736[_0xddc3('0xe')]=intUtil[_0xddc3('0x4d')](_0x121736[_0xddc3('0xe')]);_0x121736[_0xddc3('0x4e')]=intUtil[_0xddc3('0x4d')](_0x121736['serverUrl']);if(_0x39bb7f&&_0x39bb7f[_0xddc3('0x67')]&&_0x39bb7f[_0xddc3('0x67')]!=='none'){logger[_0xddc3('0xb')](_0xddc3('0x68'),_0xddc3('0x51'));_0x35fd07[_0xddc3('0x52')]=util['format'](_0xddc3('0x53'),_0x121736[_0xddc3('0x4e')],_0x35fd07[_0xddc3('0x54')],md5(_0x35fd07[_0xddc3('0x54')]));}headers[_0xddc3('0x55')]=getAuth(_0x121736);return getUser(_0x121736,_0x5ac81a['email'])[_0xddc3('0x16')](function(_0x19123f){_0x275e02=_0x19123f;logger[_0xddc3('0xb')](_0xddc3('0x69'),_0x275e02['id']);return getEndUser(_0x121736,_0x35fd07[_0xddc3('0x6a')],_0x35fd07['destcalleridnum']);})[_0xddc3('0x16')](function(_0x59e5f4){_0xabc9f1=_0x59e5f4;logger[_0xddc3('0xb')]('The\x20Enduser\x20ID\x20is:',_0xabc9f1['id']);return getTicket(_0x121736,_0x275e02,_0xabc9f1,_0x17016a,_0x35fd07);})['then'](function(_0x3ec609){if(_0x3ec609){logger[_0xddc3('0xb')](_0xddc3('0x59'),_0x3ec609['id']);switch(_0x121736[_0xddc3('0x3f')]){case _0xddc3('0x5a'):logger[_0xddc3('0xb')](_0xddc3('0x68'),_0xddc3('0x5b'));return request({'uri':util[_0xddc3('0x1b')](_0xddc3('0x6b'),_0x121736[_0xddc3('0xe')],_0x275e02['id'],_0x3ec609['id']),'method':_0xddc3('0x2d')});case'newTab':logger[_0xddc3('0xb')](_0xddc3('0x68'),_0xddc3('0x5d'));emit(util['format'](_0xddc3('0x5e'),_0x5ac81a[_0xddc3('0x11')]),_0xddc3('0x5f'),{'uri':util[_0xddc3('0x1b')](_0xddc3('0x6c'),_0x121736[_0xddc3('0xe')][_0xddc3('0x60')]('/api/v2',''),_0x3ec609['id'])});break;default:logger[_0xddc3('0x62')](_0xddc3('0x68'),_0xddc3('0x63'));}}})[_0xddc3('0x64')](function(_0x37a574){logger[_0xddc3('0x62')](_0xddc3('0x6d'),util[_0xddc3('0x66')](_0x37a574,{'showHidden':!![],'depth':null}));});};exports[_0xddc3('0x6e')]=function(_0x3b60fb,_0x447c36,_0x4a7f39,_0x19e73b,_0x2799ca,_0x47cb77){var _0x1b1dbc,_0x1a2400;_0x47cb77[_0xddc3('0xe')]=intUtil['stripTrailingSlash'](_0x47cb77['remoteUri']);_0x47cb77['serverUrl']=intUtil['stripTrailingSlash'](_0x47cb77['serverUrl']);if(_0x2799ca&&_0x2799ca['monitor_format']){logger['info']('['+_0x447c36['lastevent']['toUpperCase']()+']',_0xddc3('0x51'));_0x447c36[_0xddc3('0x52')]=util[_0xddc3('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47cb77['serverUrl'],_0x447c36[_0xddc3('0x54')],md5(_0x447c36[_0xddc3('0x54')]));}else{_0x447c36[_0xddc3('0x52')]='';}headers[_0xddc3('0x55')]=getAuth(_0x47cb77);return getUser(_0x47cb77)[_0xddc3('0x16')](function(_0x1a2c4c){_0x1b1dbc=_0x1a2c4c;logger[_0xddc3('0xb')](_0xddc3('0x69'),_0x1b1dbc['id']);return getEndUser(_0x47cb77,_0x447c36[_0xddc3('0x57')],_0x447c36[_0xddc3('0x58')]);})[_0xddc3('0x16')](function(_0x1aaec6){_0x1a2400=_0x1aaec6;logger[_0xddc3('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1a2400['id']);return getTicket(_0x47cb77,_0x1b1dbc,_0x1a2400,_0x4a7f39,_0x447c36);})['then'](function(_0x574f63){if(_0x574f63){logger[_0xddc3('0xb')](_0xddc3('0x59'),_0x574f63['id']);}})[_0xddc3('0x64')](function(_0x3bf7ce){logger['error']('['+_0x447c36['lastevent'][_0xddc3('0x6f')]()+']'+_0xddc3('0x70'),util[_0xddc3('0x66')](_0x3bf7ce,{'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 364042a..d69bfd2 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 _0x0048=['lastevent','called','Call_Result','complete','connect','Rejected','abandoned','Call_Start_Time','outbound','format','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','code','SUCCESS','err','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','toUpperCase','calleridnum','The\x20Call\x20ID\x20is:','lodash','md5','./util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','stringify','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','stack','Search\x20user','ActiveUsers','then','users','isArrayLikeObject','isNil','findIndex','email','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','administrator','getString','Subjects','Full_Name','First_Name','Last_Name','What_Id','$se_module','startCase','talktime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss'];(function(_0x3e1b1a,_0x116130){var _0x3353b6=function(_0x10ff79){while(--_0x10ff79){_0x3e1b1a['push'](_0x3e1b1a['shift']());}};_0x3353b6(++_0x116130);}(_0x0048,0xba));var _0x8004=function(_0x1b96c6,_0x45e55a){_0x1b96c6=_0x1b96c6-0x0;var _0x4a20fa=_0x0048[_0x1b96c6];return _0x4a20fa;};'use strict';var _=require(_0x8004('0x0'));var rp=require('request-promise');var md5=require(_0x8004('0x1'));var util=require('util');var intUtil=require(_0x8004('0x2'));var moment=require('moment');var Redis=require(_0x8004('0x3'));var BPromise=require(_0x8004('0x4'));var config=require(_0x8004('0x5'));var logger=require('../../../../config/logger')(_0x8004('0x6'));config[_0x8004('0x7')]=_[_0x8004('0x8')](config[_0x8004('0x7')],{'host':_0x8004('0x9'),'port':0x18eb});var io=require(_0x8004('0xa'))(new Redis(config['redis']));function emit(_0x41518b,_0x4b1068,_0x28ab18){io['to'](_0x41518b)['emit'](_0x4b1068,_0x28ab18);}function request(_0x4ac81e){logger['debug'](_0x8004('0xb'),JSON[_0x8004('0xc')](_0x4ac81e));return rp(_0x4ac81e);}function getCustomFields(_0x1f612c,_0x3d7ef5){var _0x408ba9={};if(_0x1f612c['length']>0x0){_['forEach'](_0x1f612c,function(_0x2b5df8){if(_[_0x8004('0xd')]([_0x8004('0xe'),_0x8004('0xf')],_0x2b5df8[_0x8004('0x10')])&&_0x2b5df8[_0x8004('0x11')]){_0x408ba9[_0x2b5df8[_0x8004('0x11')]]=_0x2b5df8[_0x8004('0x12')][_0x8004('0x13')]();}else if(_0x2b5df8[_0x8004('0x10')]===_0x8004('0x14')&&_0x2b5df8[_0x8004('0x15')]&&_0x2b5df8[_0x8004('0x11')]&&_0x3d7ef5[_0x2b5df8['variableName']]){_0x408ba9[_0x2b5df8[_0x8004('0x11')]]=_0x3d7ef5[_0x2b5df8[_0x8004('0x15')]]['toString']();}else if(_0x2b5df8[_0x8004('0x10')]===_0x8004('0x16')&&_0x2b5df8[_0x8004('0x17')]&&_0x2b5df8['Variable'][_0x8004('0x18')]&&_0x2b5df8[_0x8004('0x11')]&&_0x3d7ef5[_0x2b5df8[_0x8004('0x17')][_0x8004('0x18')][_0x8004('0x19')]()]){_0x408ba9[_0x2b5df8[_0x8004('0x11')]]=_0x3d7ef5[_0x2b5df8[_0x8004('0x17')][_0x8004('0x18')]['toLowerCase']()][_0x8004('0x13')]();}});}return _0x408ba9;}function getName(_0x4cb847){if(_0x4cb847['indexOf']('\x20')>0x0){var _0x17bda3=_0x4cb847['split'](/ (.+)/);if(_0x17bda3[0x1]){return _0x17bda3;}}return[_0x4cb847,_0x4cb847];}var accountsTokens={};function getAccessToken(_0xf3dc9c){return new Promise(function(_0x294ec8,_0x663eef){if(!_['isNil'](accountsTokens[_0xf3dc9c['id']])&&!_['isNil'](accountsTokens[_0xf3dc9c['id']]['access_token'])){if(moment()[_0x8004('0x1a')](accountsTokens[_0xf3dc9c['id']][_0x8004('0x1b')])){_0x294ec8(accountsTokens[_0xf3dc9c['id']][_0x8004('0x1c')]);}}var _0x1ee578;switch(_0xf3dc9c[_0x8004('0x1d')]){case'US':_0x1ee578='https://accounts.zoho.com';break;case'AU':_0x1ee578=_0x8004('0x1e');break;case'EU':_0x1ee578=_0x8004('0x1f');break;case'IN':_0x1ee578=_0x8004('0x20');break;case'CN':_0x1ee578='https://accounts.zoho.com.cn';break;default:_0x1ee578=_0x8004('0x1f');break;}var _0xf903e8={'method':'POST','uri':_0x1ee578+_0x8004('0x21'),'qs':{'refresh_token':_0xf3dc9c[_0x8004('0x22')],'client_id':_0xf3dc9c[_0x8004('0x23')],'client_secret':_0xf3dc9c[_0x8004('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xf903e8)['then'](function(_0x2648d3){accountsTokens[_0xf3dc9c['id']]={'access_token':_0x2648d3[_0x8004('0x1c')],'expires_in':moment()[_0x8004('0x25')](_0x2648d3[_0x8004('0x1b')],_0x8004('0x26'))};_0x294ec8(_0x2648d3[_0x8004('0x1c')]);})[_0x8004('0x27')](function(_0x467184){logger[_0x8004('0x28')]('Failing\x20creating\x20the\x20access_token',_0x467184[_0x8004('0x29')]);_0x663eef(_0x467184);});});}function getUser(_0x1144db,_0x39a183,_0x1f2124,_0x28e16d){logger['info'](_0x8004('0x2a'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x39a183),'qs':{'type':_0x8004('0x2b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1144db},'json':!![]})[_0x8004('0x2c')](function(_0x1cb5cf){if(_0x1cb5cf[_0x8004('0x2d')]){var _0x58d71f=-0x1;if(_[_0x8004('0x2e')](_0x1cb5cf['users'])){if(!_[_0x8004('0x2f')](_0x28e16d)){_0x58d71f=_[_0x8004('0x30')](_0x1cb5cf[_0x8004('0x2d')],function(_0x501cdf){return _0x501cdf[_0x8004('0x31')]===_0x28e16d;});}if(_0x58d71f>=0x0){logger['info'](_0x8004('0x32'));}else{logger[_0x8004('0x33')](_0x8004('0x34'));_0x58d71f=_['findIndex'](_0x1cb5cf[_0x8004('0x2d')],function(_0x5d885b){return _0x5d885b[_0x8004('0x35')][_0x8004('0x18')]===_0x8004('0x36');});}return _0x1cb5cf['users'][_0x58d71f];}else{if(_0x1cb5cf[_0x8004('0x37')][_0x8004('0x35')][_0x8004('0x18')]===_0x8004('0x36')){logger[_0x8004('0x33')]('Using\x20the\x20admin\x20account!');user=_0x1cb5cf['user'];return user;}else{logger['error'](_0x8004('0x38'),JSON[_0x8004('0xc')](_0x1cb5cf));throw new Error(_0x8004('0x39')+JSON['stringify'](_0x1cb5cf));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x1cb5cf));throw new Error(_0x8004('0x39')+JSON[_0x8004('0xc')](_0x1cb5cf));}})[_0x8004('0x27')](function(_0x1ed6ad){console[_0x8004('0x28')](_0x1ed6ad);});}function getZohoUser(_0xa1fe14,_0x5497f9){return new BPromise(function(_0x28548b,_0x5af7f6){request(_0xa1fe14)[_0x8004('0x2c')](function(_0x400259){var _0x96303c=null;if(_0x400259){_0x96303c=_0x400259[_0x8004('0x3a')][0x0];_0x96303c[_0x8004('0x3b')]=_0x5497f9;}_0x28548b(_0x96303c);})[_0x8004('0x27')](function(_0x31f199){_0x5af7f6(_0x31f199);});});}function createEndUser(_0x421f6d,_0x153383,_0x52c06b,_0x30f086,_0x53ae0d,_0x3f54e0){var _0x52c06b=getName(_0x52c06b);return request({'method':'POST','uri':_0x8004('0x3c')+_0x153383+_0x8004('0x3d')+_['startCase'](_0x3f54e0[_0x8004('0x3e')])+'s','body':{'data':[{'Last_Name':_0x52c06b[0x1],'First_Name':_0x52c06b[0x0],'Phone':_0x30f086,'Owner':{'name':!_[_0x8004('0x2f')](_0x53ae0d[_0x8004('0x3f')][_0x8004('0x18')])?_0x53ae0d[_0x8004('0x3f')]['name']:!_['isNil'](_0x53ae0d[_0x8004('0x40')])?_0x53ae0d['first_name']+'\x20'+_0x53ae0d[_0x8004('0x41')]:_0x53ae0d[_0x8004('0x41')],'id':_0x53ae0d['id']}}]},'headers':{'Authorization':_0x8004('0x42')+_0x421f6d},'json':!![]})['then'](function(_0x156a9d){if(_0x156a9d&&_0x156a9d[_0x8004('0x3a')][0x0]['code']==='SUCCESS'){var _0x835e4e=_0x156a9d[_0x8004('0x3a')][0x0][_0x8004('0x43')];_0x835e4e[_0x8004('0x3b')]=_['startCase'](_0x3f54e0[_0x8004('0x3e')])+'s';return _0x835e4e;}logger[_0x8004('0x28')](_0x8004('0x38'),JSON[_0x8004('0xc')](data));throw new Error(_0x8004('0x44')+JSON['stringify'](data));})[_0x8004('0x27')](function(_0x385af8){console[_0x8004('0x45')](_0x8004('0x46'),_0x385af8);});}function getEndUser(_0x4f3379,_0x5af28b,_0x40fe04,_0x333508,_0x51c163,_0x11fbae,_0x565cc7){var _0x5ab21f={'method':_0x8004('0x47'),'uri':'','headers':{'Authorization':_0x8004('0x42')+_0x4f3379},'json':!![]};switch(_0x565cc7[_0x8004('0x48')]){case _0x8004('0x49'):_0x5ab21f[_0x8004('0x4a')]=_0x8004('0x3c')+_0x5af28b+_0x8004('0x4b')+_0x51c163+'))';return getZohoUser(_0x5ab21f,_0x8004('0x4c'))[_0x8004('0x2c')](function(_0x1aa345){if(_0x1aa345)return _0x1aa345;_0x5ab21f[_0x8004('0x4a')]='https://www.zohoapis.'+_0x5af28b+_0x8004('0x4d')+_0x51c163+'))';return getZohoUser(_0x5ab21f,_0x8004('0x4e'))[_0x8004('0x2c')](function(_0x5bf86b){if(_0x5bf86b)return _0x5bf86b;if(_0x565cc7[_0x8004('0x3e')]!=_0x8004('0x4f')){return createEndUser(_0x4f3379,_0x5af28b,_0x333508,_0x51c163,_0x11fbae,_0x565cc7);}else{return{};}});});break;case _0x8004('0x50'):_0x5ab21f['uri']='https://www.zohoapis.'+_0x5af28b+_0x8004('0x4b')+_0x51c163+'))';return getZohoUser(_0x5ab21f,_0x8004('0x4c'))['then'](function(_0x347411){if(_0x347411)return _0x347411;if(_0x565cc7[_0x8004('0x3e')]!='nothing'){return createEndUser(_0x4f3379,_0x5af28b,_0x333508,_0x51c163,_0x11fbae,_0x565cc7);}else{return{};}});break;case _0x8004('0x51'):_0x5ab21f[_0x8004('0x4a')]=_0x8004('0x3c')+_0x5af28b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x51c163+'))';return getZohoUser(_0x5ab21f,_0x8004('0x4e'))['then'](function(_0x2d2974){if(_0x2d2974)return _0x2d2974;if(_0x565cc7[_0x8004('0x3e')]!=_0x8004('0x4f')){return createEndUser(_0x4f3379,_0x5af28b,_0x333508,_0x51c163,_0x11fbae,_0x565cc7);}else{return{};}});break;}}function getCall(_0x35864c,_0x3b101f,_0x4a0bee,_0x39ad5d,_0x43e0a4,_0x527082,_0x457e0e,_0x3216f2){logger['info']('Creating\x20new\x20call...');var _0x57af02={};_0x57af02[_0x8004('0x52')]={'name':!_['isNil'](_0x39ad5d[_0x8004('0x3f')][_0x8004('0x18')])&&!_[_0x8004('0x2f')](_0x39ad5d[_0x8004('0x35')][_0x8004('0x18')])&&_0x39ad5d['profile'][_0x8004('0x18')]===_0x8004('0x53')?_0x39ad5d['role'][_0x8004('0x18')]:!_['isNil'](_0x39ad5d['first_name'])?_0x39ad5d[_0x8004('0x40')]+'\x20'+_0x39ad5d[_0x8004('0x41')]:_0x39ad5d[_0x8004('0x41')],'id':_0x39ad5d['id']};_0x57af02['Subject']=intUtil[_0x8004('0x54')](_0x527082[_0x8004('0x55')],_0x457e0e,'\x20');_0x57af02['Description']=intUtil[_0x8004('0x54')](_0x527082['Descriptions'],_0x457e0e,'\x0a');if(_0x43e0a4[_0x8004('0x3b')]===_0x8004('0x4c')){_0x57af02['Who_Id']={'name':!_[_0x8004('0x2f')](_0x43e0a4[_0x8004('0x56')])?_0x43e0a4[_0x8004('0x56')]:!_[_0x8004('0x2f')](_0x43e0a4[_0x8004('0x57')])?_0x43e0a4[_0x8004('0x57')]+'\x20'+_0x43e0a4[_0x8004('0x58')]:_0x43e0a4[_0x8004('0x58')],'id':_0x43e0a4['id']};}if(_0x43e0a4[_0x8004('0x3b')]===_0x8004('0x4e')){_0x57af02[_0x8004('0x59')]={'name':!_[_0x8004('0x2f')](_0x43e0a4['Full_Name'])?_0x43e0a4['Full_Name']:!_[_0x8004('0x2f')](_0x43e0a4[_0x8004('0x57')])?_0x43e0a4[_0x8004('0x57')]+'\x20'+_0x43e0a4[_0x8004('0x58')]:_0x43e0a4['Last_Name'],'id':_0x43e0a4['id']};_0x57af02[_0x8004('0x5a')]=_[_0x8004('0x5b')](_0x43e0a4[_0x8004('0x3b')]);}if(_0x457e0e[_0x8004('0x5c')]){_0x57af02['Call_Duration']=moment['utc'](parseInt(_0x457e0e[_0x8004('0x5c')])*0x3e8)['format']('mm:ss');}else if(_0x457e0e['answertime']&&_0x457e0e[_0x8004('0x5d')]){_0x57af02[_0x8004('0x5e')]=moment[_0x8004('0x5f')](moment(_0x457e0e[_0x8004('0x5d')],_0x8004('0x60'))[_0x8004('0x61')](moment(_0x457e0e[_0x8004('0x62')],_0x8004('0x60'))))['format'](_0x8004('0x63'));}switch(_0x457e0e[_0x8004('0x64')]){case _0x8004('0x65'):_0x57af02[_0x8004('0x66')]='Called';break;case _0x8004('0x67'):case _0x8004('0x68'):_0x57af02[_0x8004('0x66')]='Answered';break;case'rejected':_0x57af02[_0x8004('0x66')]=_0x8004('0x69');break;case _0x8004('0x6a'):_0x57af02[_0x8004('0x66')]='Abandoned';break;case'timeout':_0x57af02[_0x8004('0x66')]='Timeout';default:}_0x57af02[_0x8004('0x6b')]=(_0x3216f2===_0x8004('0x6c')?moment(_0x457e0e[_0x8004('0x62')])[_0x8004('0x6d')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x457e0e[_0x8004('0x6e')])[_0x8004('0x6d')](_0x8004('0x60')))||moment()['format'](_0x8004('0x60'));_0x57af02[_0x8004('0x6f')]=_0x3216f2||_0x8004('0x70');_0x57af02=_[_0x8004('0x71')](_0x57af02,getCustomFields(_0x527082['Fields'],_0x457e0e));return request({'method':'POST','uri':_0x8004('0x3c')+_0x3b101f+_0x8004('0x72'),'headers':{'Authorization':_0x8004('0x42')+_0x35864c},'body':{'data':[_0x57af02]},'json':!![]})[_0x8004('0x2c')](function(_0x35d893){if(_0x35d893&&_0x35d893['data'][0x0][_0x8004('0x73')]===_0x8004('0x74')){logger[_0x8004('0x33')]('Call\x20created!');return{'id':_0x35d893[_0x8004('0x3a')][0x0][_0x8004('0x43')]['id']};}})[_0x8004('0x27')](function(_0x968cc1){logger[_0x8004('0x33')](_0x8004('0x75'),_0x968cc1[_0x8004('0x29')]);console['log'](_0x8004('0x75'),_0x968cc1);});}exports[_0x8004('0x76')]=function(_0x5560af,_0x4c41af,_0x59fbbb,_0x1e4161,_0x215843,_0x3ce525){var _0x36482f,_0x588e56,_0x49bcb1;_0x3ce525[_0x8004('0x77')]=intUtil['stripTrailingSlash'](_0x3ce525[_0x8004('0x77')]);_0x3ce525['serverUrl']=intUtil[_0x8004('0x78')](_0x3ce525['serverUrl']);if(_0x215843&&_0x215843[_0x8004('0x79')]){logger[_0x8004('0x33')](_0x8004('0x7a'),'Recording\x20is\x20enabled!');_0x4c41af[_0x8004('0x7b')]=_0x3ce525[_0x8004('0x7c')]+_0x8004('0x7d')+_0x4c41af[_0x8004('0x7e')]+_0x8004('0x7f')+md5(_0x4c41af['uniqueid']);}else{_0x4c41af[_0x8004('0x7b')]='';}var _0x2e2f5b=_0x3ce525[_0x8004('0x77')]===_0x8004('0x80')?'eu':_0x8004('0x81');return getAccessToken(_0x3ce525)[_0x8004('0x2c')](function(_0x3dcf23){_0x49bcb1=_0x3dcf23;return getUser(_0x49bcb1,_0x2e2f5b,_0x3ce525,_0x1e4161['email']);})[_0x8004('0x2c')](function(_0x3a99fe){_0x36482f=_0x3a99fe;logger[_0x8004('0x33')]('The\x20User\x20ID\x20is:',_0x36482f['id']);return getEndUser(_0x49bcb1,_0x2e2f5b,_0x3ce525,_0x4c41af[_0x8004('0x82')],_0x4c41af['calleridnum'],_0x36482f,_0x59fbbb);})['then'](function(_0x55cb29){_0x588e56=_0x55cb29;return getCall(_0x49bcb1,_0x2e2f5b,_0x3ce525,_0x36482f,_0x588e56,_0x59fbbb,_0x4c41af,_0x8004('0x70'));})['then'](function(_0x3d0e4c){if(_0x3d0e4c){logger['info']('The\x20Call\x20ID\x20is:',_0x3d0e4c['id']);logger[_0x8004('0x33')](_0x8004('0x7a'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8004('0x6d')](_0x8004('0x83'),_0x1e4161[_0x8004('0x18')]),_0x8004('0x84'),{'uri':'https://crm.'+_0x3ce525[_0x8004('0x77')]+_0x8004('0x85')+_0x3d0e4c['id']});}})[_0x8004('0x27')](function(_0x2fc382){logger[_0x8004('0x28')](_0x8004('0x7a'),JSON['stringify'](_0x2fc382));});};exports[_0x8004('0x6c')]=function(_0x263b73,_0x1c31bf,_0x21f573,_0x2a5557,_0x56b8a1,_0x5e8e57,_0x3f1005){var _0x527dd3,_0x48feaa,_0x164c52;_0x5e8e57[_0x8004('0x77')]=intUtil[_0x8004('0x78')](_0x5e8e57[_0x8004('0x77')]);_0x5e8e57['serverUrl']=intUtil[_0x8004('0x78')](_0x5e8e57[_0x8004('0x7c')]);if(_0x3f1005&&_0x3f1005['recordingFormat']&&_0x3f1005[_0x8004('0x86')]!==_0x8004('0x87')){logger[_0x8004('0x33')](_0x8004('0x88'),_0x8004('0x89'));_0x1c31bf[_0x8004('0x7b')]=_0x5e8e57['serverUrl']+_0x8004('0x7d')+_0x1c31bf[_0x8004('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x1c31bf[_0x8004('0x7e')]);}var _0x32adad=_0x5e8e57[_0x8004('0x77')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x5e8e57)[_0x8004('0x2c')](function(_0x55e3fb){_0x164c52=_0x55e3fb;return getUser(_0x164c52,_0x32adad,_0x5e8e57,_0x2a5557['email']);})['then'](function(_0x34b821){_0x527dd3=_0x34b821;logger['info']('The\x20User\x20ID\x20is:',_0x527dd3['id']);return getEndUser(_0x164c52,_0x32adad,_0x5e8e57,_0x1c31bf['destcalleridname'],_0x1c31bf['destcalleridnum'],_0x527dd3,_0x21f573);})[_0x8004('0x2c')](function(_0x44a72c){_0x48feaa=_0x44a72c;return getCall(_0x164c52,_0x32adad,_0x5e8e57,_0x527dd3,_0x48feaa,_0x21f573,_0x1c31bf,'Outbound');})['then'](function(_0xe5ecc3){if(_0xe5ecc3){logger[_0x8004('0x33')]('The\x20Call\x20ID\x20is:',_0xe5ecc3['id']);logger['info'](_0x8004('0x88'),_0x8004('0x8a'));emit(util[_0x8004('0x6d')](_0x8004('0x83'),_0x2a5557[_0x8004('0x18')]),_0x8004('0x84'),{'uri':_0x8004('0x8b')+_0x5e8e57[_0x8004('0x77')]+_0x8004('0x85')+_0xe5ecc3['id']});}})[_0x8004('0x27')](function(_0xceed0c){logger[_0x8004('0x28')](_0x8004('0x88'),JSON['stringify'](_0xceed0c));});};exports['unmanaged']=function(_0xcff97e,_0x45668e,_0x550d4a,_0x3cc69b,_0x11d1a8,_0x47c4c1){var _0x59c1ac,_0x4e5a65,_0x2f49d2;_0x47c4c1[_0x8004('0x77')]=intUtil[_0x8004('0x78')](_0x47c4c1[_0x8004('0x77')]);_0x47c4c1[_0x8004('0x7c')]=intUtil[_0x8004('0x78')](_0x47c4c1['serverUrl']);if(_0x11d1a8&&_0x11d1a8['monitor_format']){logger[_0x8004('0x33')]('['+_0x45668e[_0x8004('0x64')][_0x8004('0x8c')]()+']','Recording\x20is\x20enabled!');_0x45668e['recordingURL']=_0x47c4c1[_0x8004('0x7c')]+_0x8004('0x7d')+_0x45668e[_0x8004('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x45668e[_0x8004('0x7e')]);}else{_0x45668e[_0x8004('0x7b')]='';}var _0x112ea4=_0x47c4c1[_0x8004('0x77')]===_0x8004('0x80')?'eu':_0x8004('0x81');return getAccessToken(_0x47c4c1)[_0x8004('0x2c')](function(_0x553c89){_0x2f49d2=_0x553c89;return getUser(_0x2f49d2,_0x112ea4,_0x47c4c1);})[_0x8004('0x2c')](function(_0x470ff5){_0x59c1ac=_0x470ff5;logger[_0x8004('0x33')]('The\x20User\x20ID\x20is:',_0x59c1ac['id']);return getEndUser(_0x2f49d2,_0x112ea4,_0x47c4c1,_0x45668e[_0x8004('0x82')],_0x45668e[_0x8004('0x8d')],_0x59c1ac,_0x550d4a);})[_0x8004('0x2c')](function(_0x203c6a){_0x4e5a65=_0x203c6a;return getCall(_0x2f49d2,_0x112ea4,_0x47c4c1,_0x59c1ac,_0x4e5a65,_0x550d4a,_0x45668e,'Inbound');})[_0x8004('0x2c')](function(_0x28eaf1){if(_0x28eaf1){logger[_0x8004('0x33')](_0x8004('0x8e'),_0x28eaf1['id']);}})[_0x8004('0x27')](function(_0x3769aa){logger[_0x8004('0x28')]('['+_0x45668e[_0x8004('0x64')]['toUpperCase']()+']',JSON[_0x8004('0xc')](_0x3769aa));});}; \ No newline at end of file +var _0xb688=['content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','catch','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','profile','Using\x20the\x20admin\x20account!','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','https://crm.','monitor_format','toUpperCase','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField'];(function(_0x2b0c94,_0xfb821e){var _0x5be56f=function(_0x1cfb0f){while(--_0x1cfb0f){_0x2b0c94['push'](_0x2b0c94['shift']());}};_0x5be56f(++_0xfb821e);}(_0xb688,0x1b2));var _0x8b68=function(_0x183e49,_0x13a6af){_0x183e49=_0x183e49-0x0;var _0x1d551f=_0xb688[_0x183e49];return _0x1d551f;};'use strict';var _=require('lodash');var rp=require(_0x8b68('0x0'));var md5=require(_0x8b68('0x1'));var util=require('util');var intUtil=require(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var Redis=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var config=require(_0x8b68('0x6'));var logger=require(_0x8b68('0x7'))(_0x8b68('0x8'));config[_0x8b68('0x9')]=_['defaults'](config[_0x8b68('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b68('0x9')]));function emit(_0x8ffaf8,_0x277aad,_0x10c228){io['to'](_0x8ffaf8)['emit'](_0x277aad,_0x10c228);}function request(_0x4b4e7a){logger[_0x8b68('0xa')](_0x8b68('0xb'),JSON[_0x8b68('0xc')](_0x4b4e7a));return rp(_0x4b4e7a);}function getCustomFields(_0x402e14,_0x114914){var _0x4911f8={};if(_0x402e14[_0x8b68('0xd')]>0x0){_[_0x8b68('0xe')](_0x402e14,function(_0x2f05ff){if(_[_0x8b68('0xf')]([_0x8b68('0x10'),'picklist'],_0x2f05ff[_0x8b68('0x11')])&&_0x2f05ff['idField']){_0x4911f8[_0x2f05ff[_0x8b68('0x12')]]=_0x2f05ff[_0x8b68('0x13')][_0x8b68('0x14')]();}else if(_0x2f05ff[_0x8b68('0x11')]===_0x8b68('0x15')&&_0x2f05ff[_0x8b68('0x16')]&&_0x2f05ff['idField']&&_0x114914[_0x2f05ff[_0x8b68('0x16')]]){_0x4911f8[_0x2f05ff[_0x8b68('0x12')]]=_0x114914[_0x2f05ff[_0x8b68('0x16')]][_0x8b68('0x14')]();}else if(_0x2f05ff['type']===_0x8b68('0x17')&&_0x2f05ff[_0x8b68('0x18')]&&_0x2f05ff[_0x8b68('0x18')][_0x8b68('0x19')]&&_0x2f05ff[_0x8b68('0x12')]&&_0x114914[_0x2f05ff[_0x8b68('0x18')][_0x8b68('0x19')][_0x8b68('0x1a')]()]){_0x4911f8[_0x2f05ff[_0x8b68('0x12')]]=_0x114914[_0x2f05ff['Variable']['name'][_0x8b68('0x1a')]()][_0x8b68('0x14')]();}});}return _0x4911f8;}function getName(_0x257ccb){if(_0x257ccb[_0x8b68('0x1b')]('\x20')>0x0){var _0x5b5b44=_0x257ccb[_0x8b68('0x1c')](/ (.+)/);if(_0x5b5b44[0x1]){return _0x5b5b44;}}return[_0x257ccb,_0x257ccb];}var accountsTokens={};function getAccessToken(_0x7cab30){return new Promise(function(_0x2c02d2,_0xa013bf){if(!_[_0x8b68('0x1d')](accountsTokens[_0x7cab30['id']])&&!_[_0x8b68('0x1d')](accountsTokens[_0x7cab30['id']][_0x8b68('0x1e')])){if(moment()[_0x8b68('0x1f')](accountsTokens[_0x7cab30['id']][_0x8b68('0x20')])){_0x2c02d2(accountsTokens[_0x7cab30['id']][_0x8b68('0x1e')]);}}var _0x4917a6;switch(_0x7cab30[_0x8b68('0x21')]){case'US':_0x4917a6=_0x8b68('0x22');break;case'AU':_0x4917a6=_0x8b68('0x23');break;case'EU':_0x4917a6='https://accounts.zoho.eu';break;case'IN':_0x4917a6='https://accounts.zoho.in';break;case'CN':_0x4917a6=_0x8b68('0x24');break;default:_0x4917a6=_0x8b68('0x25');break;}var _0x3105e4={'method':_0x8b68('0x26'),'uri':_0x4917a6+_0x8b68('0x27'),'qs':{'refresh_token':_0x7cab30[_0x8b68('0x28')],'client_id':_0x7cab30['clientId'],'client_secret':_0x7cab30['clientSecret'],'grant_type':_0x8b68('0x29')},'json':!![]};return rp(_0x3105e4)[_0x8b68('0x2a')](function(_0x2a46c9){accountsTokens[_0x7cab30['id']]={'access_token':_0x2a46c9[_0x8b68('0x1e')],'expires_in':moment()[_0x8b68('0x2b')](_0x2a46c9['expires_in'],'seconds')};_0x2c02d2(_0x2a46c9[_0x8b68('0x1e')]);})[_0x8b68('0x2c')](function(_0x315d4a){logger['error']('Failing\x20creating\x20the\x20access_token',_0x315d4a['stack']);_0xa013bf(_0x315d4a);});});}function getUser(_0x2e4546,_0x1755e3,_0x52bca4,_0x30f3ff){logger[_0x8b68('0x2d')]('Search\x20user');return request({'method':_0x8b68('0x2e'),'uri':util[_0x8b68('0x2f')](_0x8b68('0x30'),_0x1755e3),'qs':{'type':_0x8b68('0x31')},'headers':{'Authorization':_0x8b68('0x32')+_0x2e4546},'json':!![]})[_0x8b68('0x2a')](function(_0x2c4793){if(_0x2c4793[_0x8b68('0x33')]){var _0x29884d=-0x1;if(_[_0x8b68('0x34')](_0x2c4793[_0x8b68('0x33')])){if(!_[_0x8b68('0x1d')](_0x30f3ff)){_0x29884d=_[_0x8b68('0x35')](_0x2c4793[_0x8b68('0x33')],function(_0x17f32f){return _0x17f32f[_0x8b68('0x36')]===_0x30f3ff;});}if(_0x29884d>=0x0){logger[_0x8b68('0x2d')](_0x8b68('0x37'));}else{logger[_0x8b68('0x2d')]('Using\x20the\x20admin\x20account!');_0x29884d=_[_0x8b68('0x35')](_0x2c4793[_0x8b68('0x33')],function(_0x295b19){return _0x295b19['profile'][_0x8b68('0x19')]===_0x8b68('0x38');});}return _0x2c4793['users'][_0x29884d];}else{if(_0x2c4793['user'][_0x8b68('0x39')][_0x8b68('0x19')]===_0x8b68('0x38')){logger[_0x8b68('0x2d')](_0x8b68('0x3a'));user=_0x2c4793[_0x8b68('0x3b')];return user;}else{logger[_0x8b68('0x3c')](_0x8b68('0x3d'),JSON['stringify'](_0x2c4793));throw new Error(_0x8b68('0x3e')+JSON[_0x8b68('0xc')](_0x2c4793));}}}else{logger[_0x8b68('0x3c')](_0x8b68('0x3d'),JSON[_0x8b68('0xc')](_0x2c4793));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8b68('0xc')](_0x2c4793));}})[_0x8b68('0x2c')](function(_0x5549ce){console['error'](_0x5549ce);});}function getZohoUser(_0x47bf52,_0x21c850){return new BPromise(function(_0x538777,_0x52db26){request(_0x47bf52)['then'](function(_0xb1ee2b){var _0x4e198d=null;if(_0xb1ee2b){_0x4e198d=_0xb1ee2b[_0x8b68('0x3f')][0x0];_0x4e198d[_0x8b68('0x40')]=_0x21c850;}_0x538777(_0x4e198d);})['catch'](function(_0x222f3f){_0x52db26(_0x222f3f);});});}function createEndUser(_0x811c9e,_0x196649,_0x2d2636,_0x256541,_0x242f92,_0x5ae541){var _0x2d2636=getName(_0x2d2636);return request({'method':_0x8b68('0x26'),'uri':_0x8b68('0x41')+_0x196649+_0x8b68('0x42')+_[_0x8b68('0x43')](_0x5ae541[_0x8b68('0x44')])+'s','body':{'data':[{'Last_Name':_0x2d2636[0x1],'First_Name':_0x2d2636[0x0],'Phone':_0x256541,'Owner':{'name':!_[_0x8b68('0x1d')](_0x242f92[_0x8b68('0x45')][_0x8b68('0x19')])?_0x242f92['role'][_0x8b68('0x19')]:!_[_0x8b68('0x1d')](_0x242f92['first_name'])?_0x242f92[_0x8b68('0x46')]+'\x20'+_0x242f92[_0x8b68('0x47')]:_0x242f92['last_name'],'id':_0x242f92['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x811c9e},'json':!![]})[_0x8b68('0x2a')](function(_0x518cfa){if(_0x518cfa&&_0x518cfa[_0x8b68('0x3f')][0x0]['code']===_0x8b68('0x48')){var _0x11561c=_0x518cfa[_0x8b68('0x3f')][0x0]['details'];_0x11561c[_0x8b68('0x40')]=_[_0x8b68('0x43')](_0x5ae541[_0x8b68('0x44')])+'s';return _0x11561c;}logger['error'](_0x8b68('0x3d'),JSON[_0x8b68('0xc')](data));throw new Error(_0x8b68('0x49')+JSON[_0x8b68('0xc')](data));})[_0x8b68('0x2c')](function(_0x4fd88f){console[_0x8b68('0x4a')](_0x8b68('0x4b'),_0x4fd88f);});}function getEndUser(_0xcd6707,_0x469e12,_0x5c9215,_0x500cc0,_0x5c8a1d,_0x12d6e4,_0x58cfd4){var _0x28fc3a={'method':_0x8b68('0x2e'),'uri':'','headers':{'Authorization':_0x8b68('0x32')+_0xcd6707},'json':!![]};switch(_0x58cfd4[_0x8b68('0x4c')]){case _0x8b68('0x4d'):_0x28fc3a['uri']=_0x8b68('0x41')+_0x469e12+_0x8b68('0x4e')+_0x5c8a1d+'))';return getZohoUser(_0x28fc3a,'Contacts')[_0x8b68('0x2a')](function(_0x2c5a45){if(_0x2c5a45)return _0x2c5a45;_0x28fc3a[_0x8b68('0x4f')]=_0x8b68('0x41')+_0x469e12+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5c8a1d+'))';return getZohoUser(_0x28fc3a,_0x8b68('0x50'))[_0x8b68('0x2a')](function(_0x1ef20a){if(_0x1ef20a)return _0x1ef20a;if(_0x58cfd4[_0x8b68('0x44')]!=_0x8b68('0x51')){return createEndUser(_0xcd6707,_0x469e12,_0x500cc0,_0x5c8a1d,_0x12d6e4,_0x58cfd4);}else{return{};}});});break;case _0x8b68('0x52'):_0x28fc3a['uri']='https://www.zohoapis.'+_0x469e12+_0x8b68('0x4e')+_0x5c8a1d+'))';return getZohoUser(_0x28fc3a,_0x8b68('0x53'))[_0x8b68('0x2a')](function(_0x24aee1){if(_0x24aee1)return _0x24aee1;if(_0x58cfd4[_0x8b68('0x44')]!=_0x8b68('0x51')){return createEndUser(_0xcd6707,_0x469e12,_0x500cc0,_0x5c8a1d,_0x12d6e4,_0x58cfd4);}else{return{};}});break;case _0x8b68('0x54'):_0x28fc3a[_0x8b68('0x4f')]='https://www.zohoapis.'+_0x469e12+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5c8a1d+'))';return getZohoUser(_0x28fc3a,'Leads')[_0x8b68('0x2a')](function(_0x1f1804){if(_0x1f1804)return _0x1f1804;if(_0x58cfd4[_0x8b68('0x44')]!=_0x8b68('0x51')){return createEndUser(_0xcd6707,_0x469e12,_0x500cc0,_0x5c8a1d,_0x12d6e4,_0x58cfd4);}else{return{};}});break;}}function getCall(_0x367f41,_0x9df508,_0x54b0e7,_0x4ef383,_0x46bb5,_0x1087c1,_0x5b775d,_0x2846ea){logger[_0x8b68('0x2d')](_0x8b68('0x55'));var _0x8e5cdd={};_0x8e5cdd[_0x8b68('0x56')]={'name':!_['isNil'](_0x4ef383[_0x8b68('0x45')]['name'])&&!_[_0x8b68('0x1d')](_0x4ef383[_0x8b68('0x39')]['name'])&&_0x4ef383[_0x8b68('0x39')][_0x8b68('0x19')]===_0x8b68('0x57')?_0x4ef383[_0x8b68('0x45')][_0x8b68('0x19')]:!_[_0x8b68('0x1d')](_0x4ef383['first_name'])?_0x4ef383[_0x8b68('0x46')]+'\x20'+_0x4ef383[_0x8b68('0x47')]:_0x4ef383[_0x8b68('0x47')],'id':_0x4ef383['id']};_0x8e5cdd[_0x8b68('0x58')]=intUtil[_0x8b68('0x59')](_0x1087c1['Subjects'],_0x5b775d,'\x20');_0x8e5cdd[_0x8b68('0x5a')]=intUtil[_0x8b68('0x59')](_0x1087c1['Descriptions'],_0x5b775d,'\x0a');if(_0x46bb5[_0x8b68('0x40')]===_0x8b68('0x53')){_0x8e5cdd[_0x8b68('0x5b')]={'name':!_[_0x8b68('0x1d')](_0x46bb5[_0x8b68('0x5c')])?_0x46bb5['Full_Name']:!_[_0x8b68('0x1d')](_0x46bb5[_0x8b68('0x5d')])?_0x46bb5[_0x8b68('0x5d')]+'\x20'+_0x46bb5[_0x8b68('0x5e')]:_0x46bb5['Last_Name'],'id':_0x46bb5['id']};}if(_0x46bb5['enduserType']===_0x8b68('0x50')){_0x8e5cdd[_0x8b68('0x5f')]={'name':!_[_0x8b68('0x1d')](_0x46bb5['Full_Name'])?_0x46bb5['Full_Name']:!_[_0x8b68('0x1d')](_0x46bb5[_0x8b68('0x5d')])?_0x46bb5[_0x8b68('0x5d')]+'\x20'+_0x46bb5['Last_Name']:_0x46bb5['Last_Name'],'id':_0x46bb5['id']};_0x8e5cdd[_0x8b68('0x60')]=_['startCase'](_0x46bb5[_0x8b68('0x40')]);}if(_0x5b775d[_0x8b68('0x61')]){_0x8e5cdd[_0x8b68('0x62')]=moment[_0x8b68('0x63')](parseInt(_0x5b775d[_0x8b68('0x61')])*0x3e8)[_0x8b68('0x2f')](_0x8b68('0x64'));}else if(_0x5b775d[_0x8b68('0x65')]&&_0x5b775d[_0x8b68('0x66')]){_0x8e5cdd[_0x8b68('0x62')]=moment[_0x8b68('0x63')](moment(_0x5b775d[_0x8b68('0x66')],_0x8b68('0x67'))['diff'](moment(_0x5b775d[_0x8b68('0x68')],_0x8b68('0x67'))))[_0x8b68('0x2f')]('mm:ss');}switch(_0x5b775d[_0x8b68('0x69')]){case'called':_0x8e5cdd[_0x8b68('0x6a')]=_0x8b68('0x6b');break;case _0x8b68('0x6c'):case _0x8b68('0x6d'):_0x8e5cdd[_0x8b68('0x6a')]=_0x8b68('0x6e');break;case'rejected':_0x8e5cdd[_0x8b68('0x6a')]=_0x8b68('0x6f');break;case _0x8b68('0x70'):_0x8e5cdd['Call_Result']='Abandoned';break;case _0x8b68('0x71'):_0x8e5cdd[_0x8b68('0x6a')]=_0x8b68('0x72');default:}_0x8e5cdd[_0x8b68('0x73')]=(_0x2846ea==='outbound'?moment(_0x5b775d['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x5b775d[_0x8b68('0x74')])['format'](_0x8b68('0x67')))||moment()[_0x8b68('0x2f')](_0x8b68('0x67'));_0x8e5cdd['Call_Type']=_0x2846ea||_0x8b68('0x75');_0x8e5cdd=_['merge'](_0x8e5cdd,getCustomFields(_0x1087c1[_0x8b68('0x76')],_0x5b775d));return request({'method':_0x8b68('0x26'),'uri':_0x8b68('0x41')+_0x9df508+_0x8b68('0x77'),'headers':{'Authorization':_0x8b68('0x32')+_0x367f41},'body':{'data':[_0x8e5cdd]},'json':!![]})['then'](function(_0x5d44cb){if(_0x5d44cb&&_0x5d44cb[_0x8b68('0x3f')][0x0][_0x8b68('0x78')]===_0x8b68('0x48')){logger['info'](_0x8b68('0x79'));return{'id':_0x5d44cb[_0x8b68('0x3f')][0x0][_0x8b68('0x7a')]['id']};}})['catch'](function(_0xc4cf9a){logger['info']('err',_0xc4cf9a['stack']);console[_0x8b68('0x4a')](_0x8b68('0x7b'),_0xc4cf9a);});}exports['queue']=function(_0x42943e,_0x55dea8,_0x286258,_0x4b788f,_0x39d6ee,_0x3d057a){var _0x4e038a,_0x491447,_0x174fd7;_0x3d057a[_0x8b68('0x7c')]=intUtil['stripTrailingSlash'](_0x3d057a[_0x8b68('0x7c')]);_0x3d057a['serverUrl']=intUtil[_0x8b68('0x7d')](_0x3d057a[_0x8b68('0x7e')]);if(_0x39d6ee&&_0x39d6ee['monitor_format']){logger[_0x8b68('0x2d')]('[QUEUE]',_0x8b68('0x7f'));_0x55dea8[_0x8b68('0x80')]=_0x3d057a[_0x8b68('0x7e')]+_0x8b68('0x81')+_0x55dea8[_0x8b68('0x82')]+_0x8b68('0x83')+md5(_0x55dea8['uniqueid']);}else{_0x55dea8[_0x8b68('0x80')]='';}var _0x13848e=_0x3d057a[_0x8b68('0x7c')]===_0x8b68('0x84')?'eu':_0x8b68('0x85');return getAccessToken(_0x3d057a)[_0x8b68('0x2a')](function(_0x257f2d){_0x174fd7=_0x257f2d;return getUser(_0x174fd7,_0x13848e,_0x3d057a,_0x4b788f[_0x8b68('0x36')]);})[_0x8b68('0x2a')](function(_0xdee052){_0x4e038a=_0xdee052;logger[_0x8b68('0x2d')](_0x8b68('0x86'),_0x4e038a['id']);return getEndUser(_0x174fd7,_0x13848e,_0x3d057a,_0x55dea8[_0x8b68('0x87')],_0x55dea8['calleridnum'],_0x4e038a,_0x286258);})['then'](function(_0x2cb9b6){_0x491447=_0x2cb9b6;return getCall(_0x174fd7,_0x13848e,_0x3d057a,_0x4e038a,_0x491447,_0x286258,_0x55dea8,_0x8b68('0x75'));})['then'](function(_0x5884e3){if(_0x5884e3){logger['info'](_0x8b68('0x88'),_0x5884e3['id']);logger['info']('[QUEUE]',_0x8b68('0x89'));emit(util['format'](_0x8b68('0x8a'),_0x4b788f['name']),_0x8b68('0x8b'),{'uri':'https://crm.'+_0x3d057a['host']+_0x8b68('0x8c')+_0x5884e3['id']});}})[_0x8b68('0x2c')](function(_0x19cd5b){logger[_0x8b68('0x3c')](_0x8b68('0x8d'),JSON[_0x8b68('0xc')](_0x19cd5b));});};exports[_0x8b68('0x8e')]=function(_0x1f0b21,_0xdb890e,_0x64f271,_0x391523,_0x4714ad,_0x212df2,_0xbdbe08){var _0x3c0aeb,_0x4dc705,_0x3a0b7b;_0x212df2[_0x8b68('0x7c')]=intUtil[_0x8b68('0x7d')](_0x212df2[_0x8b68('0x7c')]);_0x212df2['serverUrl']=intUtil['stripTrailingSlash'](_0x212df2[_0x8b68('0x7e')]);if(_0xbdbe08&&_0xbdbe08[_0x8b68('0x8f')]&&_0xbdbe08[_0x8b68('0x8f')]!==_0x8b68('0x90')){logger['info'](_0x8b68('0x91'),_0x8b68('0x7f'));_0xdb890e[_0x8b68('0x80')]=_0x212df2[_0x8b68('0x7e')]+_0x8b68('0x81')+_0xdb890e[_0x8b68('0x82')]+_0x8b68('0x83')+md5(_0xdb890e[_0x8b68('0x82')]);}var _0xef6dc5=_0x212df2['host']===_0x8b68('0x84')?'eu':'com';return getAccessToken(_0x212df2)[_0x8b68('0x2a')](function(_0x1a1e9d){_0x3a0b7b=_0x1a1e9d;return getUser(_0x3a0b7b,_0xef6dc5,_0x212df2,_0x391523[_0x8b68('0x36')]);})[_0x8b68('0x2a')](function(_0x1e6053){_0x3c0aeb=_0x1e6053;logger[_0x8b68('0x2d')](_0x8b68('0x86'),_0x3c0aeb['id']);return getEndUser(_0x3a0b7b,_0xef6dc5,_0x212df2,_0xdb890e[_0x8b68('0x92')],_0xdb890e[_0x8b68('0x93')],_0x3c0aeb,_0x64f271);})[_0x8b68('0x2a')](function(_0x4acb1c){_0x4dc705=_0x4acb1c;return getCall(_0x3a0b7b,_0xef6dc5,_0x212df2,_0x3c0aeb,_0x4dc705,_0x64f271,_0xdb890e,'Outbound');})[_0x8b68('0x2a')](function(_0xc4f95e){if(_0xc4f95e){logger['info']('The\x20Call\x20ID\x20is:',_0xc4f95e['id']);logger[_0x8b68('0x2d')](_0x8b68('0x91'),_0x8b68('0x89'));emit(util[_0x8b68('0x2f')](_0x8b68('0x8a'),_0x391523[_0x8b68('0x19')]),_0x8b68('0x8b'),{'uri':_0x8b68('0x94')+_0x212df2['host']+_0x8b68('0x8c')+_0xc4f95e['id']});}})[_0x8b68('0x2c')](function(_0x4b2c72){logger[_0x8b68('0x3c')](_0x8b68('0x91'),JSON[_0x8b68('0xc')](_0x4b2c72));});};exports['unmanaged']=function(_0x1b968e,_0x3b04d3,_0x3a6af3,_0x151e51,_0x318acf,_0x398c1f){var _0x47c52f,_0x1c0629,_0x4fddd0;_0x398c1f[_0x8b68('0x7c')]=intUtil[_0x8b68('0x7d')](_0x398c1f[_0x8b68('0x7c')]);_0x398c1f[_0x8b68('0x7e')]=intUtil['stripTrailingSlash'](_0x398c1f[_0x8b68('0x7e')]);if(_0x318acf&&_0x318acf[_0x8b68('0x95')]){logger[_0x8b68('0x2d')]('['+_0x3b04d3['lastevent'][_0x8b68('0x96')]()+']',_0x8b68('0x7f'));_0x3b04d3[_0x8b68('0x80')]=_0x398c1f[_0x8b68('0x7e')]+_0x8b68('0x81')+_0x3b04d3[_0x8b68('0x82')]+_0x8b68('0x83')+md5(_0x3b04d3[_0x8b68('0x82')]);}else{_0x3b04d3['recordingURL']='';}var _0x5161f0=_0x398c1f['host']==='zoho.eu'?'eu':_0x8b68('0x85');return getAccessToken(_0x398c1f)[_0x8b68('0x2a')](function(_0xeed1f9){_0x4fddd0=_0xeed1f9;return getUser(_0x4fddd0,_0x5161f0,_0x398c1f);})[_0x8b68('0x2a')](function(_0x135864){_0x47c52f=_0x135864;logger[_0x8b68('0x2d')](_0x8b68('0x86'),_0x47c52f['id']);return getEndUser(_0x4fddd0,_0x5161f0,_0x398c1f,_0x3b04d3[_0x8b68('0x87')],_0x3b04d3['calleridnum'],_0x47c52f,_0x3a6af3);})[_0x8b68('0x2a')](function(_0x2d7976){_0x1c0629=_0x2d7976;return getCall(_0x4fddd0,_0x5161f0,_0x398c1f,_0x47c52f,_0x1c0629,_0x3a6af3,_0x3b04d3,_0x8b68('0x75'));})[_0x8b68('0x2a')](function(_0x5db54f){if(_0x5db54f){logger['info']('The\x20Call\x20ID\x20is:',_0x5db54f['id']);}})[_0x8b68('0x2c')](function(_0x5f1b15){logger['error']('['+_0x3b04d3[_0x8b68('0x69')][_0x8b68('0x96')]()+']',JSON[_0x8b68('0xc')](_0x5f1b15));});}; \ 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 55ecf9a..cb1a223 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 _0xc6ef=['util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x22071a,_0x4c6aa7){var _0x39ac50=function(_0x32740a){while(--_0x32740a){_0x22071a['push'](_0x22071a['shift']());}};_0x39ac50(++_0x4c6aa7);}(_0xc6ef,0x1ba));var _0xfc6e=function(_0x55bbf6,_0x451bfd){_0x55bbf6=_0x55bbf6-0x0;var _0x34bc28=_0xc6ef[_0x55bbf6];return _0x34bc28;};'use strict';var util=require(_0xfc6e('0x0'));var sh=require('shelljs');var Mustache=require(_0xfc6e('0x1'));var logger=require(_0xfc6e('0x2'))(_0xfc6e('0x3'));exports[_0xfc6e('0x4')]=function(_0xf53c35,_0x189f02){var _0xd7d272=_0xf53c35[_0xfc6e('0x5')]?_0xf53c35[_0xfc6e('0x5')]:_0xfc6e('0x6');var _0x12cb7c=_0xf53c35[_0xfc6e('0x7')]?Mustache[_0xfc6e('0x8')](_0xf53c35[_0xfc6e('0x7')],_0x189f02):_0x189f02;sh[_0xfc6e('0x4')](_0x12cb7c,function(_0xa20a1d,_0x467942,_0x42c66b){if(_0xa20a1d!==0x0){logger['error'](util[_0xfc6e('0x9')](_0xfc6e('0xa'),_0xd7d272,_0x12cb7c,_0xa20a1d,_0x42c66b));}else{logger[_0xfc6e('0xb')](util[_0xfc6e('0x9')](_0xfc6e('0xc'),_0xd7d272,_0x12cb7c,_0x467942));}});}; \ No newline at end of file +var _0xcbf8=['trigger','exec','data2','Script','data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcbf8,0x7a));var _0x8cbf=function(_0x4de031,_0x3c7e95){_0x4de031=_0x4de031-0x0;var _0x23754f=_0xcbf8[_0x4de031];return _0x23754f;};'use strict';var util=require(_0x8cbf('0x0'));var sh=require(_0x8cbf('0x1'));var Mustache=require(_0x8cbf('0x2'));var logger=require(_0x8cbf('0x3'))(_0x8cbf('0x4'));exports[_0x8cbf('0x5')]=function(_0x2bf8e9,_0x3b6901){var _0x55ff74=_0x2bf8e9[_0x8cbf('0x6')]?_0x2bf8e9[_0x8cbf('0x6')]:_0x8cbf('0x7');var _0x33fb93=_0x2bf8e9[_0x8cbf('0x8')]?Mustache[_0x8cbf('0x9')](_0x2bf8e9[_0x8cbf('0x8')],_0x3b6901):_0x3b6901;sh[_0x8cbf('0x5')](_0x33fb93,function(_0x351c77,_0x32d071,_0x14e171){if(_0x351c77!==0x0){logger[_0x8cbf('0xa')](util[_0x8cbf('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x55ff74,_0x33fb93,_0x351c77,_0x14e171));}else{logger[_0x8cbf('0xc')](util[_0x8cbf('0xb')](_0x8cbf('0xd'),_0x55ff74,_0x33fb93,_0x32d071));}});}; \ 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 7412fe7..0852599 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 _0x9016=['then','object','stringify','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','number','data6','parse','stack','DELETE','POST','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9016,0xe8));var _0x6901=function(_0x252cc1,_0x5ebe28){_0x252cc1=_0x252cc1-0x0;var _0x3a8465=_0x9016[_0x252cc1];return _0x3a8465;};'use strict';var rp=require(_0x6901('0x0'));var util=require(_0x6901('0x1'));var _=require(_0x6901('0x2'));var Mustache=require(_0x6901('0x3'));var logger=require(_0x6901('0x4'))('trigger');exports[_0x6901('0x5')]=function(_0x47610c,_0x5b915e){var _0x2a08cf,_0x3cfcfd;var _0xd7a7f8={'method':_0x47610c[_0x6901('0x6')][_0x6901('0x7')](),'uri':Mustache[_0x6901('0x8')](_0x47610c[_0x6901('0x9')],_0x5b915e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x47610c[_0x6901('0xa')])===_0x6901('0xb')&&parseInt(_0x47610c[_0x6901('0xa')])>=0x1&&parseInt(_0x47610c[_0x6901('0xa')])<=0xa?parseInt(_0x47610c[_0x6901('0xa')])*0x3e8:0x5*0x3e8};try{_0xd7a7f8['headers']=_0x47610c[_0x6901('0xc')]?JSON[_0x6901('0xd')](Mustache[_0x6901('0x8')](_0x47610c[_0x6901('0xc')],_0x5b915e)):{};}catch(_0x35c4e3){logger['error'](_0x35c4e3[_0x6901('0xe')]);}switch(_0x47610c[_0x6901('0x6')][_0x6901('0x7')]()){case'GET':case _0x6901('0xf'):_0x2a08cf=null;_0xd7a7f8['qs']=_0x5b915e;break;case _0x6901('0x10'):case'PUT':if(_0x47610c[_0x6901('0x11')]){try{_0x2a08cf=JSON['parse'](Mustache['render'](_0x47610c[_0x6901('0x11')],_0x5b915e));_0xd7a7f8['body']=_0x2a08cf;}catch(_0x60a981){logger[_0x6901('0x12')](_0x60a981[_0x6901('0xe')]);logger['error'](_0x6901('0x13'));}}else{_0x2a08cf=_0x5b915e;_0xd7a7f8[_0x6901('0x14')]=_0x2a08cf;}break;}logger[_0x6901('0x15')](util[_0x6901('0x16')](_0x6901('0x17'),_0x47610c[_0x6901('0x6')],_0x47610c['data2'],JSON['stringify'](_0xd7a7f8)));rp(_0xd7a7f8)[_0x6901('0x18')](function(_0x2dea94){_0x2a08cf=!_['isNil'](_0x2a08cf)?',\x20request\x20body:\x20'+_0x2a08cf:'';_0x3cfcfd=typeof _0x2dea94['body']===_0x6901('0x19')?JSON[_0x6901('0x1a')](_0x2dea94[_0x6901('0x14')]):_0x2dea94[_0x6901('0x14')];logger[_0x6901('0x15')](util[_0x6901('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x47610c[_0x6901('0x6')],_0x47610c[_0x6901('0x9')],_0x2dea94['statusCode'],_0x3cfcfd));})[_0x6901('0x1b')](function(_0x21863d){logger['error'](util['format'](_0x6901('0x1c'),_0x47610c[_0x6901('0x6')],_0x47610c[_0x6901('0x9')],_0x21863d[_0x6901('0x1d')],_0x21863d[_0x6901('0x1e')],_0x21863d[_0x6901('0x1f')]));});}; \ No newline at end of file +var _0x374a=['lodash','mustache','data1','toUpperCase','data2','data5','number','parse','render','data6','error','stack','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util'];(function(_0x3fe80a,_0x319d37){var _0x64945=function(_0x37c457){while(--_0x37c457){_0x3fe80a['push'](_0x3fe80a['shift']());}};_0x64945(++_0x319d37);}(_0x374a,0x1b0));var _0xa374=function(_0x5e7720,_0x538d25){_0x5e7720=_0x5e7720-0x0;var _0x5acaff=_0x374a[_0x5e7720];return _0x5acaff;};'use strict';var rp=require(_0xa374('0x0'));var util=require(_0xa374('0x1'));var _=require(_0xa374('0x2'));var Mustache=require(_0xa374('0x3'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x2a41ee,_0x8a9df4){var _0x57dac6,_0x12f720;var _0x269710={'method':_0x2a41ee[_0xa374('0x4')][_0xa374('0x5')](),'uri':Mustache['render'](_0x2a41ee[_0xa374('0x6')],_0x8a9df4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2a41ee[_0xa374('0x7')])===_0xa374('0x8')&&parseInt(_0x2a41ee[_0xa374('0x7')])>=0x1&&parseInt(_0x2a41ee['data5'])<=0xa?parseInt(_0x2a41ee[_0xa374('0x7')])*0x3e8:0x5*0x3e8};try{_0x269710['headers']=_0x2a41ee['data6']?JSON[_0xa374('0x9')](Mustache[_0xa374('0xa')](_0x2a41ee[_0xa374('0xb')],_0x8a9df4)):{};}catch(_0x465a6e){logger[_0xa374('0xc')](_0x465a6e[_0xa374('0xd')]);}switch(_0x2a41ee[_0xa374('0x4')]['toUpperCase']()){case _0xa374('0xe'):case _0xa374('0xf'):_0x57dac6=null;_0x269710['qs']=_0x8a9df4;break;case _0xa374('0x10'):case'PUT':if(_0x2a41ee[_0xa374('0x11')]){try{_0x57dac6=JSON[_0xa374('0x9')](Mustache[_0xa374('0xa')](_0x2a41ee[_0xa374('0x11')],_0x8a9df4));_0x269710['body']=_0x57dac6;}catch(_0x295e73){logger[_0xa374('0xc')](_0x295e73[_0xa374('0xd')]);logger[_0xa374('0xc')](_0xa374('0x12'));}}else{_0x57dac6=_0x8a9df4;_0x269710[_0xa374('0x13')]=_0x57dac6;}break;}logger['info'](util[_0xa374('0x14')](_0xa374('0x15'),_0x2a41ee[_0xa374('0x4')],_0x2a41ee[_0xa374('0x6')],JSON[_0xa374('0x16')](_0x269710)));rp(_0x269710)[_0xa374('0x17')](function(_0x335e4f){_0x57dac6=!_[_0xa374('0x18')](_0x57dac6)?_0xa374('0x19')+_0x57dac6:'';_0x12f720=typeof _0x335e4f['body']==='object'?JSON['stringify'](_0x335e4f[_0xa374('0x13')]):_0x335e4f[_0xa374('0x13')];logger[_0xa374('0x1a')](util[_0xa374('0x14')](_0xa374('0x1b'),_0x2a41ee[_0xa374('0x4')],_0x2a41ee[_0xa374('0x6')],_0x335e4f[_0xa374('0x1c')],_0x12f720));})['catch'](function(_0x176bf9){logger[_0xa374('0xc')](util[_0xa374('0x14')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2a41ee['data1'],_0x2a41ee['data2'],_0x176bf9['statusCode'],_0x176bf9[_0xa374('0x1d')],_0x176bf9[_0xa374('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 61745b1..b5cdcff 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 _0x26b9=['error','message','catch','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26b9,0x17c));var _0x926b=function(_0x9733df,_0x450c75){_0x9733df=_0x9733df-0x0;var _0x1abfad=_0x26b9[_0x9733df];return _0x1abfad;};'use strict';var jayson=require(_0x926b('0x0'));var BPromise=require(_0x926b('0x1'));var logger=require('../../config/logger')(_0x926b('0x2'));var client=jayson[_0x926b('0x3')][_0x926b('0x4')]({'port':0x2329});client[_0x926b('0x5')]=function(_0x51b896,_0x559816){return new BPromise(function(_0x22f16d,_0x53b51d){return client[_0x926b('0x6')](_0x51b896,_0x559816)[_0x926b('0x7')](function(_0x1dbeed){logger[_0x926b('0x8')](_0x926b('0x9'),_0x926b('0x2'),_0x51b896,_0x559816,_0x1dbeed);if(_0x1dbeed[_0x926b('0xa')]){logger[_0x926b('0xa')](_0x926b('0x9'),_0x926b('0x2'),_0x51b896,_0x1dbeed[_0x926b('0xa')][_0x926b('0xb')],_0x559816);return _0x53b51d(_0x1dbeed[_0x926b('0xa')][_0x926b('0xb')]);}else{return _0x22f16d(_0x1dbeed['result']);}})[_0x926b('0xc')](function(_0x567783){logger[_0x926b('0xa')]('rpc',_0x926b('0x2'),_0x51b896,_0x567783,_0x559816);return _0x53b51d(_0x567783);});});};module['exports']=client; \ No newline at end of file +var _0xce54=['error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc'];(function(_0x2922dd,_0x82aa5a){var _0x27ece6=function(_0x386b6c){while(--_0x386b6c){_0x2922dd['push'](_0x2922dd['shift']());}};_0x27ece6(++_0x82aa5a);}(_0xce54,0x162));var _0x4ce5=function(_0x5ad30c,_0x2bb0cc){_0x5ad30c=_0x5ad30c-0x0;var _0x62b30=_0xce54[_0x5ad30c];return _0x62b30;};'use strict';var jayson=require(_0x4ce5('0x0'));var BPromise=require(_0x4ce5('0x1'));var logger=require(_0x4ce5('0x2'))(_0x4ce5('0x3'));var client=jayson[_0x4ce5('0x4')][_0x4ce5('0x5')]({'port':0x2329});client[_0x4ce5('0x6')]=function(_0x15d6cd,_0x3ca512){return new BPromise(function(_0x590d91,_0x5526dc){return client['request'](_0x15d6cd,_0x3ca512)[_0x4ce5('0x7')](function(_0x901ca){logger[_0x4ce5('0x8')](_0x4ce5('0x9'),'routing',_0x15d6cd,_0x3ca512,_0x901ca);if(_0x901ca['error']){logger[_0x4ce5('0xa')](_0x4ce5('0x9'),_0x4ce5('0x3'),_0x15d6cd,_0x901ca[_0x4ce5('0xa')][_0x4ce5('0xb')],_0x3ca512);return _0x5526dc(_0x901ca[_0x4ce5('0xa')]['message']);}else{return _0x590d91(_0x901ca[_0x4ce5('0xc')]);}})['catch'](function(_0x237b18){logger[_0x4ce5('0xa')](_0x4ce5('0x9'),'routing',_0x15d6cd,_0x237b18,_0x3ca512);return _0x5526dc(_0x237b18);});});};module[_0x4ce5('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 56992c9..fb8c100 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 _0x859d=['./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','mailAccounts','listen','getSettings','catch','error','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x28fbaf,_0x5b632d){var _0x7ca0a8=function(_0x517186){while(--_0x517186){_0x28fbaf['push'](_0x28fbaf['shift']());}};_0x7ca0a8(++_0x5b632d);}(_0x859d,0x1be));var _0xd859=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0x859d[_0x1f5143];return _0x383a38;};'use strict';var server=require(_0xd859('0x0'));var Realtime=require(_0xd859('0x1'));var EmailChannel=require(_0xd859('0x2'));var mailAccount=require(_0xd859('0x3'));var setting=require(_0xd859('0x4'));var logger=require(_0xd859('0x5'))(_0xd859('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd859('0x7')]()[_0xd859('0x8')](mailAccount['getMailAccounts']())[_0xd859('0x8')](realtime[_0xd859('0x9')]())[_0xd859('0x8')](function(){email['refresh'](realtime[_0xd859('0xa')]);return realtime;});}function main(){return server[_0xd859('0xb')](realtime,email)[_0xd859('0x8')](function(){return initRealtime();})[_0xd859('0x8')](function(){return setting[_0xd859('0xc')]();})[_0xd859('0x8')](function(_0x261caa){return setInterval(initRealtime,_0x261caa['loginMailFrequency']*0x3e8);})[_0xd859('0xd')](function(_0x585359){logger[_0xd859('0xe')]('Email\x20service\x20initialization',_0x585359);});}main(); \ No newline at end of file +var _0x8d79=['then','getMailAccounts','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email'];(function(_0x200217,_0x15709e){var _0x517229=function(_0x1fd293){while(--_0x1fd293){_0x200217['push'](_0x200217['shift']());}};_0x517229(++_0x15709e);}(_0x8d79,0x70));var _0x98d7=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x8d79[_0x21549c];return _0x426cbd;};'use strict';var server=require('./server');var Realtime=require(_0x98d7('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x98d7('0x1'));var setting=require(_0x98d7('0x2'));var logger=require(_0x98d7('0x3'))(_0x98d7('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x98d7('0x5')](mailAccount[_0x98d7('0x6')]())[_0x98d7('0x5')](realtime[_0x98d7('0x7')]())[_0x98d7('0x5')](function(){email['refresh'](realtime[_0x98d7('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x98d7('0x9')]();})['then'](function(_0x26a151){return setInterval(initRealtime,_0x26a151[_0x98d7('0xa')]*0x3e8);})['catch'](function(_0x3dfc8b){logger[_0x98d7('0xb')](_0x98d7('0xc'),_0x3dfc8b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 06e884a..b83cb33 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 _0xc410=['connected','messages','lastName','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','email','defaults','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','active','provider','service','imapAccounts','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','handleImapBox'];(function(_0x5e608c,_0x453591){var _0x44d7fc=function(_0xc9de57){while(--_0xc9de57){_0x5e608c['push'](_0x5e608c['shift']());}};_0x44d7fc(++_0x453591);}(_0xc410,0xf3));var _0x0c41=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0xc410[_0x7ad6cb];return _0x22a0ba;};'use strict';var _=require(_0x0c41('0x0'));var moment=require(_0x0c41('0x1'));var BPromise=require(_0x0c41('0x2'));var md5=require('md5');var Redis=require(_0x0c41('0x3'));var config=require(_0x0c41('0x4'));var logger=require('../../../config/logger')(_0x0c41('0x5'));config['redis']=_[_0x0c41('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0c41('0x7'))(new Redis(config[_0x0c41('0x8')]));var EmailImap=require(_0x0c41('0x9'));var EmailSmtp=require(_0x0c41('0xa'));var mailAccount=require(_0x0c41('0xb'));var md5Accounts={};function EmailChannel(_0xb76245){logger[_0x0c41('0xc')](_0x0c41('0xd'));this[_0x0c41('0xe')]=_0xb76245['mailAccounts'];this['imapAccounts']={};this[_0x0c41('0xf')]=new EmailSmtp();}EmailChannel[_0x0c41('0x10')][_0x0c41('0x11')]=function(_0x54b87){var _0x7d367a=this[_0x0c41('0xe')][_0x54b87];var _0x125a22={'id':_0x7d367a['id'],'name':_0x7d367a[_0x0c41('0x12')],'key':_0x7d367a[_0x0c41('0x13')],'active':_0x7d367a['active'],'Imap':{'status':_0x7d367a[_0x0c41('0x14')][_0x0c41('0x15')],'messageStatus':_0x7d367a[_0x0c41('0x14')][_0x0c41('0x16')],'total':_0x7d367a[_0x0c41('0x14')][_0x0c41('0x17')]}};if(_['isNil'](md5Accounts[_0x54b87])){md5Accounts[_0x54b87]={};}var _0x43213d=md5(JSON[_0x0c41('0x18')](_0x125a22));if(md5Accounts[_0x54b87]['md5']!==_0x43213d){md5Accounts[_0x54b87][_0x0c41('0x19')]=_0x43213d;io[_0x0c41('0x11')](_0x0c41('0x1a'),_0x125a22);}};EmailChannel[_0x0c41('0x10')][_0x0c41('0x1b')]=function(_0x3d56cc){for(var _0x1e6578 in _0x3d56cc){if(_0x3d56cc[_0x0c41('0x1c')](_0x1e6578)){if(_0x3d56cc[_0x1e6578][_0x0c41('0x14')]&&_0x3d56cc[_0x1e6578][_0x0c41('0x1d')]){var _0x1e44f3=_0x3d56cc[_0x1e6578][_0x0c41('0x14')];if(!_0x1e44f3['service']&&_0x3d56cc[_0x1e6578][_0x0c41('0x1e')]!=='custom')_0x1e44f3[_0x0c41('0x1f')]=_0x3d56cc[_0x1e6578][_0x0c41('0x1e')];if(!this[_0x0c41('0x20')][_0x0c41('0x1c')](_0x1e44f3['id'])){this[_0x0c41('0x20')][_0x1e44f3['id']]=new EmailImap(_0x1e44f3,_0x3d56cc[_0x1e6578][_0x0c41('0x5')]);this[_0x0c41('0x20')][_0x1e44f3['id']]['on'](_0x0c41('0x21'),this['handleImapBox'][_0x0c41('0x22')](this,_0x1e6578));this[_0x0c41('0x20')][_0x1e44f3['id']]['on'](_0x0c41('0x5'),this[_0x0c41('0x23')][_0x0c41('0x22')](this,_0x1e6578));this[_0x0c41('0x20')][_0x1e44f3['id']]['on'](_0x0c41('0x24'),this[_0x0c41('0x25')][_0x0c41('0x22')](this,_0x1e6578));this['imapAccounts'][_0x1e44f3['id']]['on'](_0x0c41('0x26'),this[_0x0c41('0x27')][_0x0c41('0x22')](this,_0x1e6578));}}else{if(_[_0x0c41('0x28')](this[_0x0c41('0xe')][_0x1e6578]['Imap'])){this[_0x0c41('0xe')][_0x1e6578][_0x0c41('0x14')]={};}this['mailAccounts'][_0x1e6578][_0x0c41('0x14')][_0x0c41('0x15')]='disabled';this[_0x0c41('0xe')][_0x1e6578][_0x0c41('0x14')][_0x0c41('0x16')]='';this[_0x0c41('0x11')](_0x1e6578);}}}};EmailChannel[_0x0c41('0x10')][_0x0c41('0x29')]=function(_0x2583e6,_0x5e2e51){if(this[_0x0c41('0xe')][_0x2583e6]){this[_0x0c41('0xe')][_0x2583e6][_0x0c41('0x14')][_0x0c41('0x15')]=_0x0c41('0x2a');this[_0x0c41('0xe')][_0x2583e6]['Imap'][_0x0c41('0x16')]=_0x5e2e51[_0x0c41('0x12')];if(_0x5e2e51[_0x0c41('0x2b')]){this[_0x0c41('0xe')][_0x2583e6]['Imap'][_0x0c41('0x17')]=_0x5e2e51[_0x0c41('0x2b')][_0x0c41('0x17')];}return this[_0x0c41('0x11')](_0x2583e6);}};EmailChannel[_0x0c41('0x10')]['handleImapEmail']=function(_0x53722d,_0x40865f){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x40865f['firstName'],_0x40865f[_0x0c41('0x2c')],_0x40865f['from'],_0x53722d);if(this[_0x0c41('0xe')][_0x53722d]){return mailAccount['notify'](_0x53722d,_0x40865f)['then'](function(_0x35ee3d){if(_0x35ee3d){logger[_0x0c41('0xc')](_0x0c41('0x2d'));}})[_0x0c41('0x2e')](function(_0x5080f7){logger[_0x0c41('0x26')](_0x0c41('0x2f'),JSON[_0x0c41('0x18')](_0x5080f7));});}};EmailChannel['prototype'][_0x0c41('0x25')]=function(_0x45353a){if(this[_0x0c41('0xe')][_0x45353a]&&this[_0x0c41('0xe')][_0x45353a]['Imap']){if(this[_0x0c41('0x20')][this[_0x0c41('0xe')][_0x45353a][_0x0c41('0x14')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x45353a][_0x0c41('0x14')]['id']];}this['mailAccounts'][_0x45353a][_0x0c41('0x14')][_0x0c41('0x30')]=moment();this[_0x0c41('0x11')](_0x45353a);}};EmailChannel['prototype'][_0x0c41('0x27')]=function(_0x13f77e,_0x58cdd4){if(this[_0x0c41('0xe')][_0x13f77e]){this[_0x0c41('0xe')][_0x13f77e]['Imap'][_0x0c41('0x15')]=_0x0c41('0x26');this[_0x0c41('0xe')][_0x13f77e][_0x0c41('0x14')][_0x0c41('0x16')]=_0x58cdd4;return this[_0x0c41('0x11')](_0x13f77e);}};EmailChannel[_0x0c41('0x10')][_0x0c41('0x31')]=function(_0x6caa2,_0x2e9f10){return this['smtp'][_0x0c41('0x32')](_0x6caa2,_0x2e9f10);};EmailChannel[_0x0c41('0x10')][_0x0c41('0x33')]=function(_0x3df565){var _0x544a46=this;if(this[_0x0c41('0xe')][_0x3df565['id']]){if(_[_0x0c41('0x28')](this['mailAccounts'][_0x3df565['id']]['Smtp'])){this[_0x0c41('0xe')][_0x3df565['id']][_0x0c41('0x34')]={};}this[_0x0c41('0xe')][_0x3df565['id']][_0x0c41('0x34')][_0x0c41('0x30')]=moment();return new BPromise(function(_0x1d02b7,_0x5bf979){return _0x544a46[_0x0c41('0xf')][_0x0c41('0x35')](_0x3df565)[_0x0c41('0x36')](function(_0x18e519){_0x544a46[_0x0c41('0xe')][_0x3df565['id']]['Smtp'][_0x0c41('0x15')]=_0x0c41('0x37');_0x544a46['mailAccounts'][_0x3df565['id']][_0x0c41('0x34')][_0x0c41('0x16')]='';_0x544a46['emit'](_0x3df565['id']);_0x1d02b7(_0x18e519);})[_0x0c41('0x2e')](function(_0x581efd){_0x544a46['mailAccounts'][_0x3df565['id']]['Smtp'][_0x0c41('0x15')]=_0x0c41('0x26');_0x544a46['mailAccounts'][_0x3df565['id']]['Smtp'][_0x0c41('0x16')]=_0x581efd;_0x544a46[_0x0c41('0x11')](_0x3df565['id']);_0x5bf979(_0x581efd);});});}return this['smtp'][_0x0c41('0x35')](_0x3df565);};module[_0x0c41('0x38')]=EmailChannel; \ No newline at end of file +var _0x7049=['disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x7049,0x102));var _0x9704=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7049[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x9704('0x0'));var moment=require(_0x9704('0x1'));var BPromise=require(_0x9704('0x2'));var md5=require(_0x9704('0x3'));var Redis=require(_0x9704('0x4'));var config=require('../../../config/environment');var logger=require(_0x9704('0x5'))(_0x9704('0x6'));config[_0x9704('0x7')]=_[_0x9704('0x8')](config[_0x9704('0x7')],{'host':_0x9704('0x9'),'port':0x18eb});var io=require(_0x9704('0xa'))(new Redis(config['redis']));var EmailImap=require(_0x9704('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x9704('0xc'));var md5Accounts={};function EmailChannel(_0x129919){logger[_0x9704('0xd')](_0x9704('0xe'));this[_0x9704('0xf')]=_0x129919[_0x9704('0xf')];this[_0x9704('0x10')]={};this[_0x9704('0x11')]=new EmailSmtp();}EmailChannel[_0x9704('0x12')][_0x9704('0x13')]=function(_0x39787b){var _0x2f6a30=this[_0x9704('0xf')][_0x39787b];var _0x276d04={'id':_0x2f6a30['id'],'name':_0x2f6a30[_0x9704('0x14')],'key':_0x2f6a30['key'],'active':_0x2f6a30[_0x9704('0x15')],'Imap':{'status':_0x2f6a30['Imap'][_0x9704('0x16')],'messageStatus':_0x2f6a30[_0x9704('0x17')][_0x9704('0x18')],'total':_0x2f6a30['Imap'][_0x9704('0x19')]}};if(_[_0x9704('0x1a')](md5Accounts[_0x39787b])){md5Accounts[_0x39787b]={};}var _0x570c05=md5(JSON[_0x9704('0x1b')](_0x276d04));if(md5Accounts[_0x39787b]['md5']!==_0x570c05){md5Accounts[_0x39787b][_0x9704('0x3')]=_0x570c05;io['emit'](_0x9704('0x1c'),_0x276d04);}};EmailChannel[_0x9704('0x12')][_0x9704('0x1d')]=function(_0x417925){for(var _0x41733a in _0x417925){if(_0x417925[_0x9704('0x1e')](_0x41733a)){if(_0x417925[_0x41733a][_0x9704('0x17')]&&_0x417925[_0x41733a]['active']){var _0x20c765=_0x417925[_0x41733a][_0x9704('0x17')];if(!_0x20c765[_0x9704('0x1f')]&&_0x417925[_0x41733a][_0x9704('0x20')]!==_0x9704('0x21'))_0x20c765['service']=_0x417925[_0x41733a]['provider'];if(!this[_0x9704('0x10')][_0x9704('0x1e')](_0x20c765['id'])){this[_0x9704('0x10')][_0x20c765['id']]=new EmailImap(_0x20c765,_0x417925[_0x41733a][_0x9704('0x6')]);this[_0x9704('0x10')][_0x20c765['id']]['on'](_0x9704('0x22'),this[_0x9704('0x23')][_0x9704('0x24')](this,_0x41733a));this[_0x9704('0x10')][_0x20c765['id']]['on'](_0x9704('0x6'),this[_0x9704('0x25')][_0x9704('0x24')](this,_0x41733a));this[_0x9704('0x10')][_0x20c765['id']]['on'](_0x9704('0x26'),this[_0x9704('0x27')]['bind'](this,_0x41733a));this[_0x9704('0x10')][_0x20c765['id']]['on'](_0x9704('0x28'),this[_0x9704('0x29')][_0x9704('0x24')](this,_0x41733a));}}else{if(_[_0x9704('0x1a')](this['mailAccounts'][_0x41733a][_0x9704('0x17')])){this[_0x9704('0xf')][_0x41733a][_0x9704('0x17')]={};}this[_0x9704('0xf')][_0x41733a]['Imap'][_0x9704('0x16')]=_0x9704('0x2a');this[_0x9704('0xf')][_0x41733a][_0x9704('0x17')][_0x9704('0x18')]='';this['emit'](_0x41733a);}}}};EmailChannel[_0x9704('0x12')]['handleImapBox']=function(_0x58f0fb,_0x51e12d){if(this[_0x9704('0xf')][_0x58f0fb]){this[_0x9704('0xf')][_0x58f0fb][_0x9704('0x17')][_0x9704('0x16')]='connected';this[_0x9704('0xf')][_0x58f0fb][_0x9704('0x17')]['messageStatus']=_0x51e12d['name'];if(_0x51e12d[_0x9704('0x2b')]){this['mailAccounts'][_0x58f0fb][_0x9704('0x17')]['total']=_0x51e12d[_0x9704('0x2b')][_0x9704('0x19')];}return this[_0x9704('0x13')](_0x58f0fb);}};EmailChannel[_0x9704('0x12')]['handleImapEmail']=function(_0x7404e3,_0x16fb14){logger[_0x9704('0xd')](_0x9704('0x2c'),_0x16fb14[_0x9704('0x2d')],_0x16fb14[_0x9704('0x2e')],_0x16fb14[_0x9704('0x2f')],_0x7404e3);if(this[_0x9704('0xf')][_0x7404e3]){return mailAccount[_0x9704('0x30')](_0x7404e3,_0x16fb14)[_0x9704('0x31')](function(_0x464e05){if(_0x464e05){logger[_0x9704('0xd')](_0x9704('0x32'));}})['catch'](function(_0x3beeab){logger[_0x9704('0x28')](_0x9704('0x33'),JSON[_0x9704('0x1b')](_0x3beeab));});}};EmailChannel[_0x9704('0x12')]['handleImapEnd']=function(_0x601955){if(this[_0x9704('0xf')][_0x601955]&&this[_0x9704('0xf')][_0x601955]['Imap']){if(this[_0x9704('0x10')][this['mailAccounts'][_0x601955][_0x9704('0x17')]['id']]){delete this[_0x9704('0x10')][this[_0x9704('0xf')][_0x601955][_0x9704('0x17')]['id']];}this[_0x9704('0xf')][_0x601955]['Imap'][_0x9704('0x34')]=moment();this['emit'](_0x601955);}};EmailChannel[_0x9704('0x12')][_0x9704('0x29')]=function(_0x428481,_0x3c1a30){if(this['mailAccounts'][_0x428481]){this[_0x9704('0xf')][_0x428481][_0x9704('0x17')][_0x9704('0x16')]=_0x9704('0x28');this[_0x9704('0xf')][_0x428481][_0x9704('0x17')][_0x9704('0x18')]=_0x3c1a30;return this['emit'](_0x428481);}};EmailChannel['prototype'][_0x9704('0x35')]=function(_0x1087cb,_0x4d1aa1){return this['smtp'][_0x9704('0x36')](_0x1087cb,_0x4d1aa1);};EmailChannel[_0x9704('0x12')][_0x9704('0x37')]=function(_0x524e76){var _0x275265=this;if(this[_0x9704('0xf')][_0x524e76['id']]){if(_['isNil'](this[_0x9704('0xf')][_0x524e76['id']][_0x9704('0x38')])){this[_0x9704('0xf')][_0x524e76['id']][_0x9704('0x38')]={};}this[_0x9704('0xf')][_0x524e76['id']][_0x9704('0x38')][_0x9704('0x34')]=moment();return new BPromise(function(_0x4532a6,_0x272941){return _0x275265[_0x9704('0x11')][_0x9704('0x39')](_0x524e76)[_0x9704('0x31')](function(_0x158fe9){_0x275265['mailAccounts'][_0x524e76['id']][_0x9704('0x38')][_0x9704('0x16')]='verified';_0x275265[_0x9704('0xf')][_0x524e76['id']][_0x9704('0x38')][_0x9704('0x18')]='';_0x275265[_0x9704('0x13')](_0x524e76['id']);_0x4532a6(_0x158fe9);})[_0x9704('0x3a')](function(_0x19e9ef){_0x275265[_0x9704('0xf')][_0x524e76['id']][_0x9704('0x38')][_0x9704('0x16')]=_0x9704('0x28');_0x275265['mailAccounts'][_0x524e76['id']][_0x9704('0x38')][_0x9704('0x18')]=_0x19e9ef;_0x275265[_0x9704('0x13')](_0x524e76['id']);_0x272941(_0x19e9ef);});});}return this['smtp'][_0x9704('0x39')](_0x524e76);};module[_0x9704('0x3b')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 2d7419a..8970e57 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 _0xda19=['password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','data5','getHost','anonymous@xcally.com','handleOpenBox','emit','readUnseen','search','handleReadUnseen','length','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleCloseBox','textCode','upperFirst','exports','util','imap','simpleParser','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user'];(function(_0x292a8e,_0x2247ab){var _0x1b1c91=function(_0x51351c){while(--_0x51351c){_0x292a8e['push'](_0x292a8e['shift']());}};_0x1b1c91(++_0x2247ab);}(_0xda19,0xd5));var _0x9da1=function(_0x31bfab,_0x5226ad){_0x31bfab=_0x31bfab-0x0;var _0x422e1d=_0xda19[_0x31bfab];return _0x422e1d;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var Imap=require(_0x9da1('0x1'));var simpleParser=require('mailparser')[_0x9da1('0x2')];var Iconv=require('iconv')[_0x9da1('0x3')];var EventEmitter=require('events')[_0x9da1('0x4')];var utils=require(_0x9da1('0x5'));var logger=require(_0x9da1('0x6'))(_0x9da1('0x7'));function EmailImap(_0x156faf,_0x2dcbc6){this[_0x9da1('0x8')]=_0x9da1('0x9');this[_0x9da1('0xa')]=this[_0x9da1('0xb')](_0x156faf,_0x2dcbc6);this['imap']=new Imap(this['account']);this['imap'][_0x9da1('0xc')]('ready',this[_0x9da1('0xd')][_0x9da1('0xe')](this));this[_0x9da1('0x1')][_0x9da1('0xc')](_0x9da1('0xf'),this[_0x9da1('0x10')][_0x9da1('0xe')](this));this['imap']['on']('error',this[_0x9da1('0x11')]['bind'](this));this[_0x9da1('0x1')][_0x9da1('0x12')]();}util[_0x9da1('0x13')](EmailImap,EventEmitter);EmailImap[_0x9da1('0x14')]['getAccount']=function(_0x2837e3,_0x535a13){var _0x4d17e1={'connTimeout':_0x2837e3[_0x9da1('0x15')]?_0x2837e3['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2837e3[_0x9da1('0x16')]?_0x2837e3[_0x9da1('0x16')]*0x3e8:0x1388};if(_[_0x9da1('0x17')](_0x2837e3[_0x9da1('0x18')])){if(_0x2837e3[_0x9da1('0x19')]){_0x4d17e1['user']=_0x2837e3[_0x9da1('0x1a')];_0x4d17e1[_0x9da1('0x1b')]=_0x2837e3[_0x9da1('0x1b')];}_0x4d17e1[_0x9da1('0x1c')]=_0x2837e3[_0x9da1('0x1c')];_0x4d17e1[_0x9da1('0x1d')]=_0x2837e3['port']||0x3e1;if(_0x2837e3['tls']){_0x4d17e1[_0x9da1('0x1e')]=!![];}else{_0x4d17e1[_0x9da1('0x1e')]=![];_0x4d17e1[_0x9da1('0x1f')]=_0x9da1('0x20');}}else{if(_0x2837e3[_0x9da1('0x21')]){_0x4d17e1[_0x9da1('0x22')]=utils[_0x9da1('0x23')](_0x2837e3['CloudProvider'][_0x9da1('0x24')],_0x2837e3[_0x9da1('0x1a')]);_0x4d17e1[_0x9da1('0x1a')]=_0x2837e3[_0x9da1('0x1a')];}else{_0x4d17e1[_0x9da1('0x1a')]=_0x2837e3['user'];_0x4d17e1['password']=_0x2837e3[_0x9da1('0x1b')];}_0x4d17e1[_0x9da1('0x1c')]=utils[_0x9da1('0x25')](_0x2837e3[_0x9da1('0x18')]);_0x4d17e1[_0x9da1('0x1d')]=0x3e1;_0x4d17e1[_0x9da1('0x1e')]=!![];}_0x4d17e1['email']=_0x535a13||_0x2837e3[_0x9da1('0x1a')]||_0x9da1('0x26');return _0x4d17e1;};EmailImap['prototype'][_0x9da1('0xd')]=function(){this[_0x9da1('0x1')]['openBox'](this[_0x9da1('0x8')],![],this[_0x9da1('0x27')]['bind'](this));};EmailImap[_0x9da1('0x14')][_0x9da1('0x27')]=function(_0x55cd3d,_0x5c09ed){if(_0x55cd3d){this[_0x9da1('0x11')](_0x55cd3d,!![]);}else{this[_0x9da1('0x28')]('box',_0x5c09ed);this[_0x9da1('0x29')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x5a59c2){if(_0x5a59c2){this[_0x9da1('0x11')](_0x5a59c2,!![]);}else{this[_0x9da1('0x1')][_0x9da1('0xf')]();}};EmailImap[_0x9da1('0x14')][_0x9da1('0x29')]=function(){this['imap'][_0x9da1('0x2a')](['UNSEEN'],this[_0x9da1('0x2b')][_0x9da1('0xe')](this));};EmailImap['prototype'][_0x9da1('0x2b')]=function(_0x2eb48f,_0x4f318b){if(_0x2eb48f){this[_0x9da1('0x11')](_0x2eb48f,!![]);}else{if(_0x4f318b[_0x9da1('0x2c')]){try{var _0x1802e0=this[_0x9da1('0x1')]['fetch'](_0x4f318b,{'bodies':'','markSeen':!![]});_0x1802e0['on']('message',this[_0x9da1('0x2d')][_0x9da1('0xe')](this));_0x1802e0[_0x9da1('0xc')](_0x9da1('0x2e'),this[_0x9da1('0x2f')]['bind'](this));_0x1802e0[_0x9da1('0xc')](_0x9da1('0xf'),this[_0x9da1('0x30')][_0x9da1('0xe')](this));}catch(_0x45a068){logger[_0x9da1('0x2e')](_0x45a068);}}else{this['imap'][_0x9da1('0x31')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x9da1('0x14')]['handleFetchMessage']=function(_0x35879f){_0x35879f['on'](_0x9da1('0x32'),this[_0x9da1('0x33')][_0x9da1('0xe')](this));_0x35879f[_0x9da1('0xc')](_0x9da1('0x34'),this[_0x9da1('0x35')][_0x9da1('0xe')](this));_0x35879f['once'](_0x9da1('0xf'),this['handleMessageEnd'][_0x9da1('0xe')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x1ce0f8){simpleParser(_0x1ce0f8,{'Iconv':Iconv},this['handleSimpleParser'][_0x9da1('0xe')](this));};EmailImap[_0x9da1('0x14')]['handleMessageAttributes']=function(){};EmailImap[_0x9da1('0x14')][_0x9da1('0x36')]=function(){};EmailImap[_0x9da1('0x14')][_0x9da1('0x37')]=function(_0x56bd49,_0x257c2e){if(_0x56bd49){logger['error'](_0x56bd49);}else{var _0x2bb9e4=this;utils['parser'](this[_0x9da1('0xa')],_0x257c2e,function(_0x46c176){_0x2bb9e4['emit'](_0x9da1('0x7'),_0x46c176);});}};EmailImap[_0x9da1('0x14')][_0x9da1('0x30')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox'][_0x9da1('0xe')](this));};EmailImap['prototype'][_0x9da1('0x2f')]=function(_0x287afe){this[_0x9da1('0x11')](_0x287afe);this[_0x9da1('0x1')]['closeBox'](!![],this[_0x9da1('0x38')][_0x9da1('0xe')](this));};EmailImap[_0x9da1('0x14')][_0x9da1('0x10')]=function(){this[_0x9da1('0x28')](_0x9da1('0xf'));};EmailImap[_0x9da1('0x14')]['handleError']=function(_0x467350,_0x515f3f){logger[_0x9da1('0x2e')]('handleError',this[_0x9da1('0xa')][_0x9da1('0x7')],JSON['stringify'](_0x467350));var _0x265366='';if(_0x467350){if(_0x467350[_0x9da1('0x39')]){_0x265366=_0x467350['textCode'];}else{for(var _0x1a193b in _0x467350){if(_0x467350['hasOwnProperty'](_0x1a193b)){_0x265366+=_[_0x9da1('0x3a')](_0x1a193b)+':\x20'+_0x467350[_0x1a193b]+'\x0a';}}}}if(_0x515f3f){this[_0x9da1('0x1')]['end']();}else{this['emit'](_0x9da1('0x2e'),_0x265366);this[_0x9da1('0x28')](_0x9da1('0xf'));}};module[_0x9da1('0x3b')]=EmailImap; \ No newline at end of file +var _0xabce=['UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleCloseBox','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','events','EventEmitter','./utils','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','required','xoauth2','generateXOAuth2Token','data5','email','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','search'];(function(_0x276dd4,_0x23f26f){var _0x548a01=function(_0x2e99d8){while(--_0x2e99d8){_0x276dd4['push'](_0x276dd4['shift']());}};_0x548a01(++_0x23f26f);}(_0xabce,0x103));var _0xeabc=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xabce[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var Imap=require(_0xeabc('0x2'));var simpleParser=require(_0xeabc('0x3'))[_0xeabc('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0xeabc('0x5'))[_0xeabc('0x6')];var utils=require(_0xeabc('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x1b07a8,_0x52a4d7){this[_0xeabc('0x8')]='INBOX';this[_0xeabc('0x9')]=this[_0xeabc('0xa')](_0x1b07a8,_0x52a4d7);this[_0xeabc('0x2')]=new Imap(this['account']);this[_0xeabc('0x2')][_0xeabc('0xb')](_0xeabc('0xc'),this[_0xeabc('0xd')][_0xeabc('0xe')](this));this[_0xeabc('0x2')][_0xeabc('0xb')](_0xeabc('0xf'),this[_0xeabc('0x10')][_0xeabc('0xe')](this));this[_0xeabc('0x2')]['on'](_0xeabc('0x11'),this[_0xeabc('0x12')][_0xeabc('0xe')](this));this[_0xeabc('0x2')][_0xeabc('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xeabc('0x14')][_0xeabc('0xa')]=function(_0x3251c6,_0x55f0de){var _0x5f4ee8={'connTimeout':_0x3251c6[_0xeabc('0x15')]?_0x3251c6[_0xeabc('0x15')]*0x3e8:0x2710,'authTimeout':_0x3251c6[_0xeabc('0x16')]?_0x3251c6['authTimeout']*0x3e8:0x1388};if(_[_0xeabc('0x17')](_0x3251c6[_0xeabc('0x18')])){if(_0x3251c6['authentication']){_0x5f4ee8['user']=_0x3251c6[_0xeabc('0x19')];_0x5f4ee8['password']=_0x3251c6[_0xeabc('0x1a')];}_0x5f4ee8[_0xeabc('0x1b')]=_0x3251c6[_0xeabc('0x1b')];_0x5f4ee8[_0xeabc('0x1c')]=_0x3251c6[_0xeabc('0x1c')]||0x3e1;if(_0x3251c6[_0xeabc('0x1d')]){_0x5f4ee8[_0xeabc('0x1d')]=!![];}else{_0x5f4ee8[_0xeabc('0x1d')]=![];_0x5f4ee8['autotls']=_0xeabc('0x1e');}}else{if(_0x3251c6['modernAuthentication']){_0x5f4ee8[_0xeabc('0x1f')]=utils[_0xeabc('0x20')](_0x3251c6['CloudProvider'][_0xeabc('0x21')],_0x3251c6[_0xeabc('0x19')]);_0x5f4ee8[_0xeabc('0x19')]=_0x3251c6[_0xeabc('0x19')];}else{_0x5f4ee8[_0xeabc('0x19')]=_0x3251c6['user'];_0x5f4ee8[_0xeabc('0x1a')]=_0x3251c6[_0xeabc('0x1a')];}_0x5f4ee8[_0xeabc('0x1b')]=utils['getHost'](_0x3251c6[_0xeabc('0x18')]);_0x5f4ee8[_0xeabc('0x1c')]=0x3e1;_0x5f4ee8[_0xeabc('0x1d')]=!![];}_0x5f4ee8[_0xeabc('0x22')]=_0x55f0de||_0x3251c6['user']||_0xeabc('0x23');return _0x5f4ee8;};EmailImap['prototype'][_0xeabc('0xd')]=function(){this['imap'][_0xeabc('0x24')](this[_0xeabc('0x8')],![],this[_0xeabc('0x25')][_0xeabc('0xe')](this));};EmailImap[_0xeabc('0x14')][_0xeabc('0x25')]=function(_0x131722,_0x4c2693){if(_0x131722){this['handleError'](_0x131722,!![]);}else{this[_0xeabc('0x26')]('box',_0x4c2693);this[_0xeabc('0x27')]();}};EmailImap[_0xeabc('0x14')]['handleCloseBox']=function(_0x2163e6){if(_0x2163e6){this[_0xeabc('0x12')](_0x2163e6,!![]);}else{this[_0xeabc('0x2')][_0xeabc('0xf')]();}};EmailImap[_0xeabc('0x14')][_0xeabc('0x27')]=function(){this[_0xeabc('0x2')][_0xeabc('0x28')]([_0xeabc('0x29')],this['handleReadUnseen'][_0xeabc('0xe')](this));};EmailImap['prototype'][_0xeabc('0x2a')]=function(_0x2d027e,_0x98b445){if(_0x2d027e){this[_0xeabc('0x12')](_0x2d027e,!![]);}else{if(_0x98b445[_0xeabc('0x2b')]){try{var _0x368b8a=this[_0xeabc('0x2')]['fetch'](_0x98b445,{'bodies':'','markSeen':!![]});_0x368b8a['on'](_0xeabc('0x2c'),this[_0xeabc('0x2d')][_0xeabc('0xe')](this));_0x368b8a['once'](_0xeabc('0x11'),this[_0xeabc('0x2e')][_0xeabc('0xe')](this));_0x368b8a['once'](_0xeabc('0xf'),this[_0xeabc('0x2f')][_0xeabc('0xe')](this));}catch(_0x521091){logger[_0xeabc('0x11')](_0x521091);}}else{this[_0xeabc('0x2')]['closeBox'](!![],this['handleCloseBox'][_0xeabc('0xe')](this));}}};EmailImap[_0xeabc('0x14')]['handleFetchMessage']=function(_0x43df50){_0x43df50['on'](_0xeabc('0x30'),this[_0xeabc('0x31')][_0xeabc('0xe')](this));_0x43df50[_0xeabc('0xb')]('attributes',this[_0xeabc('0x32')]['bind'](this));_0x43df50[_0xeabc('0xb')](_0xeabc('0xf'),this[_0xeabc('0x33')]['bind'](this));};EmailImap['prototype'][_0xeabc('0x31')]=function(_0x560d4a){simpleParser(_0x560d4a,{'Iconv':Iconv},this[_0xeabc('0x34')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0xeabc('0x33')]=function(){};EmailImap['prototype'][_0xeabc('0x34')]=function(_0x1ebfb6,_0x5c7302){if(_0x1ebfb6){logger[_0xeabc('0x11')](_0x1ebfb6);}else{var _0x4a8415=this;utils[_0xeabc('0x35')](this['account'],_0x5c7302,function(_0xbd7f03){_0x4a8415[_0xeabc('0x26')](_0xeabc('0x22'),_0xbd7f03);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0xeabc('0x36')](!![],this[_0xeabc('0x37')][_0xeabc('0xe')](this));};EmailImap['prototype']['handleFetchError']=function(_0x5cd62e){this[_0xeabc('0x12')](_0x5cd62e);this['imap'][_0xeabc('0x36')](!![],this['handleCloseBox'][_0xeabc('0xe')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0xeabc('0xf'));};EmailImap[_0xeabc('0x14')][_0xeabc('0x12')]=function(_0x3eeeb5,_0x4ca6a3){logger[_0xeabc('0x11')]('handleError',this[_0xeabc('0x9')][_0xeabc('0x22')],JSON[_0xeabc('0x38')](_0x3eeeb5));var _0x17a0df='';if(_0x3eeeb5){if(_0x3eeeb5[_0xeabc('0x39')]){_0x17a0df=_0x3eeeb5['textCode'];}else{for(var _0x482971 in _0x3eeeb5){if(_0x3eeeb5[_0xeabc('0x3a')](_0x482971)){_0x17a0df+=_['upperFirst'](_0x482971)+':\x20'+_0x3eeeb5[_0x482971]+'\x0a';}}}}if(_0x4ca6a3){this[_0xeabc('0x2')][_0xeabc('0xf')]();}else{this['emit'](_0xeabc('0x11'),_0x17a0df);this[_0xeabc('0x26')](_0xeabc('0xf'));}};module[_0xeabc('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 64b340a..414372d 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 _0x98d1=['Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x98d1,0xde));var _0x198d=function(_0x41b8ad,_0xd8caaa){_0x41b8ad=_0x41b8ad-0x0;var _0x58b116=_0x98d1[_0x41b8ad];return _0x58b116;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x198d('0x0'));function EmailSmtp(){}EmailSmtp[_0x198d('0x1')][_0x198d('0x2')]=function(_0x23faf2,_0xe68a98){return new Promise(function(_0x6ac44f,_0x123583){var _0x538ca6=nodemailer[_0x198d('0x3')](_0x23faf2);_0x538ca6['use'](_0x198d('0x4'),inlineBase64());_0x538ca6[_0x198d('0x5')](_0xe68a98,function(_0x79dea6,_0x658f8f){if(_0x79dea6){_0x123583(_0x79dea6[_0x198d('0x6')]());}else{_0x6ac44f(_0x658f8f);}});});};EmailSmtp[_0x198d('0x1')][_0x198d('0x7')]=function(_0x5c7d7b){return new Promise(function(_0x402b0e,_0x4b1a21){var _0x5b6915=nodemailer['createTransport'](_0x5c7d7b);_0x5b6915[_0x198d('0x7')](function(_0x2c70b6,_0x3343ac){if(_0x2c70b6){_0x4b1a21(_0x2c70b6['toString']());}else{if(_0x3343ac){_0x402b0e(_0x3343ac);}else{_0x4b1a21(_0x198d('0x8'));}}});});};module[_0x198d('0x9')]=EmailSmtp; \ No newline at end of file +var _0x52c6=['toString','prototype','Not\x20verifired','exports','send','createTransport','sendMail'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x52c6,0x1a8));var _0x652c=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x52c6[_0x55f8b4];return _0x2475f9;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x652c('0x0')]=function(_0x594549,_0x24d006){return new Promise(function(_0x93a899,_0x51e758){var _0x186df3=nodemailer[_0x652c('0x1')](_0x594549);_0x186df3['use']('compile',inlineBase64());_0x186df3[_0x652c('0x2')](_0x24d006,function(_0xb2d966,_0xc9f2a4){if(_0xb2d966){_0x51e758(_0xb2d966[_0x652c('0x3')]());}else{_0x93a899(_0xc9f2a4);}});});};EmailSmtp[_0x652c('0x4')]['verify']=function(_0x148741){return new Promise(function(_0x1269c9,_0x3d77ac){var _0x379c17=nodemailer[_0x652c('0x1')](_0x148741);_0x379c17['verify'](function(_0x2206d4,_0x4bce4f){if(_0x2206d4){_0x3d77ac(_0x2206d4[_0x652c('0x3')]());}else{if(_0x4bce4f){_0x1269c9(_0x4bce4f);}else{_0x3d77ac(_0x652c('0x5'));}}});});};module[_0x652c('0x6')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 9961b9a..baba3f6 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 _0x17cf=['from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','toString','base64','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','generate','html','test','replace','includes','forEach','push','filename','_SRC','\x20]','body','textAsHtml','0x1?_0x11143a[_0xf17c('0xe')](0x0,-0x1)[_0xf17c('0xf')]('\x20'):_0x860ac3[_0xf17c('0xa')];}return _0xf17c('0x10');}function getLastName(_0xab9454){var _0xef949b=_['head'](_0xab9454[_0xf17c('0x7')]);if(_0xef949b&&_0xef949b[_0xf17c('0xa')]){var _0x5139d4=_0xef949b[_0xf17c('0xa')][_0xf17c('0xc')](/\s+/);return _0x5139d4['length']>0x1?_0x5139d4[_0xf17c('0x11')]():'';}return'';}function getMails(_0x2b4c41,_0x9ad184){var _0x19fd5d='';for(var _0x46ded8=0x0;_0x46ded8<_0x9ad184[_0xf17c('0x7')][_0xf17c('0xd')];_0x46ded8+=0x1){if(_0x9ad184[_0xf17c('0x7')][_0x46ded8][_0xf17c('0x8')]!==_0x2b4c41){if(!_[_0xf17c('0x12')](_0x19fd5d)){_0x19fd5d+=',';}_0x19fd5d+=_0x9ad184[_0xf17c('0x7')][_0x46ded8][_0xf17c('0xa')]||_0x9ad184[_0xf17c('0x7')][_0x46ded8][_0xf17c('0x8')]||'';_0x19fd5d+='\x20<';_0x19fd5d+=_0x9ad184['value'][_0x46ded8][_0xf17c('0x8')]?_0x9ad184['value'][_0x46ded8][_0xf17c('0x8')]:_0xf17c('0x13')+random[_0xf17c('0x14')](0x6)+_0xf17c('0x9');_0x19fd5d+='>';}}return _0x19fd5d;}function parseEmail(_0xefdb9b,_0x40c7ec,_0x39934a){if(_0x40c7ec[_0xf17c('0x15')]){var _0x5b271e=/)<[^<]*)*<\/script>/gi;while(_0x5b271e[_0xf17c('0x16')](_0x40c7ec['html'])){_0x40c7ec['html']=_0x40c7ec['html'][_0xf17c('0x17')](_0x5b271e,'');}if(_0x40c7ec[_0xf17c('0x15')][_0xf17c('0x18')]('{_0x8e246c[_0xf17c('0x1a')](_0x2266c0[_0xf17c('0x1b')]);});var _0x360f1e=/]+>/g;var _0x364d63=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3e93b7=_0x40c7ec[_0xf17c('0x15')]['replace'](_0x364d63,_0xf17c('0x1c'));var _0x111a08=_0x3e93b7[_0xf17c('0x17')](_0x360f1e,'_IMG');for(let _0x3e2466=0x0;_0x3e2466<_0x8e246c[_0xf17c('0xd')];_0x3e2466++){var _0x2cdf98=_0x111a08[_0xf17c('0x17')]('_IMG','\x20[Attachment:\x20'+_0x8e246c[_0x3e2466]+_0xf17c('0x1d'));_0x111a08=_0x2cdf98;}_0x40c7ec[_0xf17c('0x15')]=_0x111a08;}_0x39934a[_0xf17c('0x1e')]=_0x40c7ec['html'];}else{_0x39934a[_0xf17c('0x1e')]=_0x40c7ec[_0xf17c('0x1f')];}if(_0x39934a[_0xf17c('0x1e')]){_0x39934a[_0xf17c('0x1e')]=_0x39934a['body'][_0xf17c('0x17')](/0x0){var _0x463cbc=[_0xf17c('0x2d'),'X-Auto-Response-Suppress:\x20All',_0xf17c('0x2e')];for(var _0x6c4b7b=0x0;_0x6c4b7b<_0x40c7ec['headerLines']['length'];_0x6c4b7b++){var _0x153371=_[_0xf17c('0x2f')](_0x463cbc,_0x40c7ec['headerLines'][_0x6c4b7b]['line']);if(_0x153371>=0x0){_0x39934a[_0xf17c('0x30')]=!![];}}}return _0x39934a;}exports[_0xf17c('0x31')]=function(_0x52426f,_0x3567e2,_0x35bc57){var _0x352e21={'from':getAddress(_0x3567e2[_0xf17c('0x32')]),'firstName':getFirstName(_0x3567e2[_0xf17c('0x32')]),'lastName':getLastName(_0x3567e2[_0xf17c('0x32')]),'mapKey':_0xf17c('0x4'),'message':{'from':getMails(_0x52426f[_0xf17c('0x4')],_0x3567e2[_0xf17c('0x32')]),'to':_0x52426f['email'],'cc':'','subject':_0x3567e2[_0xf17c('0x33')]||'','messageId':_0x3567e2[_0xf17c('0x34')],'inReplyTo':_0x3567e2[_0xf17c('0x35')],'sentAt':moment(_0x3567e2[_0xf17c('0x36')])[_0xf17c('0x37')](_0xf17c('0x38')),'attach':![],'attachments':[]}};if(!_0x3567e2[_0xf17c('0x15')]&&!_0x3567e2[_0xf17c('0x1f')]){var _0x2ddcc3=_[_0xf17c('0x39')](_0x3567e2['attachments'],{'contentType':_0xf17c('0x3a')});if(_0x2ddcc3[_0xf17c('0xd')]){logger[_0xf17c('0x3b')](util[_0xf17c('0x37')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3567e2[_0xf17c('0x34')]));tnef[_0xf17c('0x3c')](_[_0xf17c('0x3d')](_0x2ddcc3)[_0xf17c('0x2b')],function(_0x34430e,_0x25cad7){if(_0x25cad7){_0x3567e2['html']=_0x25cad7[_0xf17c('0x3e')]||_0xf17c('0x3f');if(_0x25cad7[_0xf17c('0x40')]){for(var _0x4ed031=0x0;_0x4ed031<_0x25cad7[_0xf17c('0x40')]['length'];_0x4ed031++){var _0x272168=_0x25cad7[_0xf17c('0x40')][_0x4ed031];_0x352e21[_0xf17c('0x21')][_0xf17c('0x25')][_0xf17c('0x1a')]({'filename':_0x272168['Title'],'content':Buffer[_0xf17c('0x32')](_0x272168[_0xf17c('0x41')])});}}}_0x35bc57(parseEmail(_0x52426f,_0x3567e2,_0x352e21));});}else{_0x3567e2['html']=_0xf17c('0x3f');_0x35bc57(parseEmail(_0x52426f,_0x3567e2,_0x352e21));}}else{_0x35bc57(parseEmail(_0x52426f,_0x3567e2,_0x352e21));}};exports[_0xf17c('0x42')]=function(_0x496407){switch(_0x496407){case _0xf17c('0x43'):return _0xf17c('0x44');case _0xf17c('0x45'):return _0xf17c('0x46');case _0xf17c('0x47'):return _0xf17c('0x48');case'outlook365':return _0xf17c('0x49');}return _0xf17c('0x4a');};exports[_0xf17c('0x4b')]=function(_0x411eb8,_0x4f27f5){var _0x4b159e=[_0xf17c('0x4c')+(_0x4f27f5||''),'auth=Bearer\x20'+_0x411eb8,'',''];return Buffer[_0xf17c('0x32')](_0x4b159e['join'](''),'utf-8')[_0xf17c('0x4d')](_0xf17c('0x4e'));}; \ No newline at end of file +var _0xf143=['outlook.office365.com','127.0.0.1','generateXOAuth2Token','join','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length','slice','Anonymous','split','isEmpty','html','test','includes','','body','textAsHtml','message','originTo','email','originCc','attachments','attach','type','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','

Empty\x20message

','Attachments','Title','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0xf143,0x18d));var _0x3f14=function(_0x17a1e3,_0x31c5ac){_0x17a1e3=_0x17a1e3-0x0;var _0x4b5e0c=_0xf143[_0x17a1e3];return _0x4b5e0c;};'use strict';var _=require(_0x3f14('0x0'));var moment=require(_0x3f14('0x1'));var random=require(_0x3f14('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x3f14('0x3'));var tnef=require(_0x3f14('0x4'));var logger=require('../../../config/logger')('email');var config=require(_0x3f14('0x5'));function getAddress(_0x452e4d){var _0x3cb80c=_[_0x3f14('0x6')](_0x452e4d[_0x3f14('0x7')]);return _0x3cb80c&&_0x3cb80c[_0x3f14('0x8')]?_0x3cb80c['address']:_0x3f14('0x9')+random[_0x3f14('0xa')](0x6)+_0x3f14('0xb');}function getFirstName(_0x505c56){var _0x5e3013=_[_0x3f14('0x6')](_0x505c56[_0x3f14('0x7')]);if(_0x5e3013&&_0x5e3013['name']){if(_0x5e3013['name']==_0x5e3013[_0x3f14('0x8')]){return _0x5e3013[_0x3f14('0xc')][_0x3f14('0xd')](0x0,_0x5e3013[_0x3f14('0xc')][_0x3f14('0xe')]('@'));}var _0xd3eae1=_0x5e3013['name']['split'](/\s+/);return _0xd3eae1[_0x3f14('0xf')]>0x1?_0xd3eae1[_0x3f14('0x10')](0x0,-0x1)['join']('\x20'):_0x5e3013[_0x3f14('0xc')];}return _0x3f14('0x11');}function getLastName(_0x54c5b2){var _0x139b23=_['head'](_0x54c5b2['value']);if(_0x139b23&&_0x139b23[_0x3f14('0xc')]){var _0x17fc44=_0x139b23[_0x3f14('0xc')][_0x3f14('0x12')](/\s+/);return _0x17fc44[_0x3f14('0xf')]>0x1?_0x17fc44['pop']():'';}return'';}function getMails(_0x2c4cb0,_0x4a4537){var _0x244de9='';for(var _0x24b45a=0x0;_0x24b45a<_0x4a4537[_0x3f14('0x7')]['length'];_0x24b45a+=0x1){if(_0x4a4537[_0x3f14('0x7')][_0x24b45a][_0x3f14('0x8')]!==_0x2c4cb0){if(!_[_0x3f14('0x13')](_0x244de9)){_0x244de9+=',';}_0x244de9+=_0x4a4537['value'][_0x24b45a][_0x3f14('0xc')]||_0x4a4537[_0x3f14('0x7')][_0x24b45a][_0x3f14('0x8')]||'';_0x244de9+='\x20<';_0x244de9+=_0x4a4537[_0x3f14('0x7')][_0x24b45a]['address']?_0x4a4537[_0x3f14('0x7')][_0x24b45a][_0x3f14('0x8')]:_0x3f14('0x9')+random[_0x3f14('0xa')](0x6)+_0x3f14('0xb');_0x244de9+='>';}}return _0x244de9;}function parseEmail(_0x32cd35,_0x16fafa,_0x350dbd){if(_0x16fafa[_0x3f14('0x14')]){var _0x44c5e9=/)<[^<]*)*<\/script>/gi;while(_0x44c5e9[_0x3f14('0x15')](_0x16fafa['html'])){_0x16fafa[_0x3f14('0x14')]=_0x16fafa[_0x3f14('0x14')]['replace'](_0x44c5e9,'');}if(_0x16fafa[_0x3f14('0x14')][_0x3f14('0x16')](_0x3f14('0x17'))){var _0x15791e=[];_0x16fafa['attachments'][_0x3f14('0x18')](_0x4da014=>{_0x15791e[_0x3f14('0x19')](_0x4da014['filename']);});var _0x40b96e=/]+>/g;var _0x5630e3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2c5958=_0x16fafa[_0x3f14('0x14')][_0x3f14('0x1a')](_0x5630e3,'_SRC');var _0x146450=_0x2c5958[_0x3f14('0x1a')](_0x40b96e,'_IMG');for(let _0x1c4577=0x0;_0x1c4577<_0x15791e[_0x3f14('0xf')];_0x1c4577++){var _0x33d47d=_0x146450[_0x3f14('0x1a')](_0x3f14('0x1b'),'\x20[Attachment:\x20'+_0x15791e[_0x1c4577]+_0x3f14('0x1c'));_0x146450=_0x33d47d;}_0x16fafa[_0x3f14('0x14')]=_0x146450;}_0x350dbd[_0x3f14('0x1d')]=_0x16fafa['html'];}else{_0x350dbd[_0x3f14('0x1d')]=_0x16fafa[_0x3f14('0x1e')];}if(_0x350dbd[_0x3f14('0x1d')]){_0x350dbd[_0x3f14('0x1d')]=_0x350dbd[_0x3f14('0x1d')]['replace'](/0x0){var _0x52efaf=['Auto-Submitted:\x20auto-replied',_0x3f14('0x30'),_0x3f14('0x31')];for(var _0x4434b6=0x0;_0x4434b6<_0x16fafa[_0x3f14('0x2f')]['length'];_0x4434b6++){var _0x9e8bbd=_['indexOf'](_0x52efaf,_0x16fafa['headerLines'][_0x4434b6][_0x3f14('0x32')]);if(_0x9e8bbd>=0x0){_0x350dbd[_0x3f14('0x33')]=!![];}}}return _0x350dbd;}exports[_0x3f14('0x34')]=function(_0x484fe1,_0x5c8de5,_0x56d36b){var _0x3356de={'from':getAddress(_0x5c8de5[_0x3f14('0x35')]),'firstName':getFirstName(_0x5c8de5['from']),'lastName':getLastName(_0x5c8de5['from']),'mapKey':'email','message':{'from':getMails(_0x484fe1[_0x3f14('0x21')],_0x5c8de5[_0x3f14('0x35')]),'to':_0x484fe1['email'],'cc':'','subject':_0x5c8de5[_0x3f14('0x36')]||'','messageId':_0x5c8de5[_0x3f14('0x37')],'inReplyTo':_0x5c8de5['inReplyTo'],'sentAt':moment(_0x5c8de5[_0x3f14('0x38')])[_0x3f14('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x5c8de5['html']&&!_0x5c8de5[_0x3f14('0x1e')]){var _0x4941e7=_[_0x3f14('0x39')](_0x5c8de5[_0x3f14('0x23')],{'contentType':_0x3f14('0x3a')});if(_0x4941e7[_0x3f14('0xf')]){logger['info'](util[_0x3f14('0x28')](_0x3f14('0x3b'),_0x5c8de5['messageId']));tnef['parseBuffer'](_[_0x3f14('0x3c')](_0x4941e7)[_0x3f14('0x2d')],function(_0x15a492,_0x1d4f23){if(_0x1d4f23){_0x5c8de5[_0x3f14('0x14')]=_0x1d4f23['BodyHTML']||_0x3f14('0x3d');if(_0x1d4f23[_0x3f14('0x3e')]){for(var _0x1c3031=0x0;_0x1c3031<_0x1d4f23['Attachments'][_0x3f14('0xf')];_0x1c3031++){var _0x1a1dbc=_0x1d4f23[_0x3f14('0x3e')][_0x1c3031];_0x3356de['message']['attachments'][_0x3f14('0x19')]({'filename':_0x1a1dbc[_0x3f14('0x3f')],'content':Buffer['from'](_0x1a1dbc['Data'])});}}}_0x56d36b(parseEmail(_0x484fe1,_0x5c8de5,_0x3356de));});}else{_0x5c8de5['html']=_0x3f14('0x3d');_0x56d36b(parseEmail(_0x484fe1,_0x5c8de5,_0x3356de));}}else{_0x56d36b(parseEmail(_0x484fe1,_0x5c8de5,_0x3356de));}};exports[_0x3f14('0x40')]=function(_0x567798){switch(_0x567798){case _0x3f14('0x41'):return'imap.gmail.com';case _0x3f14('0x42'):return _0x3f14('0x43');case _0x3f14('0x44'):return _0x3f14('0x45');case _0x3f14('0x46'):return _0x3f14('0x47');}return _0x3f14('0x48');};exports[_0x3f14('0x49')]=function(_0x523816,_0x352b17){var _0x1b7ad3=['user='+(_0x352b17||''),'auth=Bearer\x20'+_0x523816,'',''];return Buffer[_0x3f14('0x35')](_0x1b7ad3[_0x3f14('0x4a')](''),_0x3f14('0x4b'))[_0x3f14('0x4c')](_0x3f14('0x4d'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 15a1e4f..a8cf408 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 _0x3259=['active','Imap','Smtp','lodash','Service','key'];(function(_0x525245,_0x72bcfb){var _0x2ea70a=function(_0x1078dc){while(--_0x1078dc){_0x525245['push'](_0x525245['shift']());}};_0x2ea70a(++_0x72bcfb);}(_0x3259,0x6f));var _0x9325=function(_0x3dc36e,_0x59e265){_0x3dc36e=_0x3dc36e-0x0;var _0x483aa2=_0x3259[_0x3dc36e];return _0x483aa2;};'use strict';var _=require(_0x9325('0x0'));function MailAccount(_0x1c3f90){this['id']=_0x1c3f90['id']||0x0;this['name']=_0x1c3f90['name']||_0x9325('0x1');this[_0x9325('0x2')]=_0x1c3f90['key']||'SERV';this['active']=_0x1c3f90[_0x9325('0x3')]||![];this[_0x9325('0x4')]=_0x1c3f90[_0x9325('0x4')]||[];this[_0x9325('0x5')]=_0x1c3f90['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xdb93=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0xdb93,0xf6));var _0x3db9=function(_0x508cd2,_0x2db8fc){_0x508cd2=_0x508cd2-0x0;var _0x182a04=_0xdb93[_0x508cd2];return _0x182a04;};'use strict';var _=require('lodash');function MailAccount(_0x419cad){this['id']=_0x419cad['id']||0x0;this[_0x3db9('0x0')]=_0x419cad[_0x3db9('0x0')]||_0x3db9('0x1');this[_0x3db9('0x2')]=_0x419cad['key']||_0x3db9('0x3');this[_0x3db9('0x4')]=_0x419cad[_0x3db9('0x4')]||![];this[_0x3db9('0x5')]=_0x419cad['Imap']||[];this['Smtp']=_0x419cad[_0x3db9('0x6')]||[];}module[_0x3db9('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 4f8eda7..8164ba6 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 _0x3c05=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','isUndefined','merge','lodash'];(function(_0x5094d2,_0x519b4f){var _0x49610d=function(_0xf2643f){while(--_0xf2643f){_0x5094d2['push'](_0x5094d2['shift']());}};_0x49610d(++_0x519b4f);}(_0x3c05,0x199));var _0x53c0=function(_0x129b41,_0x3f472d){_0x129b41=_0x129b41-0x0;var _0x3ad4f9=_0x3c05[_0x129b41];return _0x3ad4f9;};'use strict';var _=require(_0x53c0('0x0'));var MailAccount=require(_0x53c0('0x1'));var Realtime=function(){this[_0x53c0('0x2')]={};};function freeIsNotKey(_0x9907b6,_0x127f6b,_0x2cf29a){var _0x158054=_[_0x53c0('0x3')](_0x9907b6,function(_0x5548f1,_0x248863){return _0x5548f1[_0x2cf29a];});for(var _0x46c602 in _0x127f6b){if(_0x127f6b[_0x53c0('0x4')](_0x46c602)){if(!_0x158054[_0x46c602]){delete _0x127f6b[_0x46c602];}}}}Realtime['prototype'][_0x53c0('0x5')]=function(_0x18a811,_0x545937){for(var _0x25e50e in _0x545937){if(_0x18a811[_0x53c0('0x4')](_0x25e50e)){_0x18a811[_0x25e50e]=_0x545937[_0x25e50e];}}};Realtime[_0x53c0('0x6')]['initMailAccounts']=function(){var _0x2829b9=this;return function(_0x4313b5){if(_0x4313b5){freeIsNotKey(_0x4313b5,_0x2829b9[_0x53c0('0x2')],'id');for(var _0x58fc2b=0x0,_0x41b5a1={},_0x3fefed={};_0x58fc2b<_0x4313b5[_0x53c0('0x7')];_0x58fc2b+=0x1){_0x41b5a1=_0x4313b5[_0x58fc2b];if(_[_0x53c0('0x8')](_0x2829b9['mailAccounts'][_0x41b5a1['id']])){_0x2829b9['mailAccounts'][_0x41b5a1['id']]=new MailAccount(_0x41b5a1);}else{_[_0x53c0('0x9')](_0x2829b9['mailAccounts'][_0x41b5a1['id']],_0x41b5a1);}}}return _0x2829b9['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xe6b2=['mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','exports','lodash'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xe6b2,0x1a7));var _0x2e6b=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0xe6b2[_0x12b83d];return _0x1fd39d;};'use strict';var _=require(_0x2e6b('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x2e6b('0x1')]={};};function freeIsNotKey(_0x2cf701,_0x26cfc0,_0x16398b){var _0x210396=_['mapKeys'](_0x2cf701,function(_0x286bf8,_0x4e5d9b){return _0x286bf8[_0x16398b];});for(var _0x51b73d in _0x26cfc0){if(_0x26cfc0[_0x2e6b('0x2')](_0x51b73d)){if(!_0x210396[_0x51b73d]){delete _0x26cfc0[_0x51b73d];}}}}Realtime[_0x2e6b('0x3')][_0x2e6b('0x4')]=function(_0x2660f7,_0x5b91f5){for(var _0x1d4f56 in _0x5b91f5){if(_0x2660f7[_0x2e6b('0x2')](_0x1d4f56)){_0x2660f7[_0x1d4f56]=_0x5b91f5[_0x1d4f56];}}};Realtime[_0x2e6b('0x3')][_0x2e6b('0x5')]=function(){var _0x3c0452=this;return function(_0x10b430){if(_0x10b430){freeIsNotKey(_0x10b430,_0x3c0452[_0x2e6b('0x1')],'id');for(var _0x5ee44d=0x0,_0x1f6a0f={},_0xe11f4e={};_0x5ee44d<_0x10b430['length'];_0x5ee44d+=0x1){_0x1f6a0f=_0x10b430[_0x5ee44d];if(_[_0x2e6b('0x6')](_0x3c0452[_0x2e6b('0x1')][_0x1f6a0f['id']])){_0x3c0452[_0x2e6b('0x1')][_0x1f6a0f['id']]=new MailAccount(_0x1f6a0f);}else{_['merge'](_0x3c0452[_0x2e6b('0x1')][_0x1f6a0f['id']],_0x1f6a0f);}}}return _0x3c0452[_0x2e6b('0x1')];};};module[_0x2e6b('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index fdf28bd..771ce83 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 _0xcc58=['NotifyMailAccount','../client','GetMailAccount','name','provider','service','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify'];(function(_0x509d7a,_0x14c6fa){var _0x1bbdb0=function(_0x226c6a){while(--_0x226c6a){_0x509d7a['push'](_0x509d7a['shift']());}};_0x1bbdb0(++_0x14c6fa);}(_0xcc58,0xab));var _0x8cc5=function(_0x291452,_0x154f8a){_0x291452=_0x291452-0x0;var _0x368271=_0xcc58[_0x291452];return _0x368271;};'use strict';var client=require(_0x8cc5('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x8cc5('0x1'),{'options':{'attributes':['id',_0x8cc5('0x2'),_0x8cc5('0x3'),_0x8cc5('0x4'),'email','active',_0x8cc5('0x5'),_0x8cc5('0x6'),_0x8cc5('0x7')],'raw':![],'include':[{'model':_0x8cc5('0x8'),'as':_0x8cc5('0x9'),'include':[{'model':_0x8cc5('0xa'),'attributes':['id','name',_0x8cc5('0x4'),_0x8cc5('0xb'),_0x8cc5('0xc')],'as':_0x8cc5('0xa')}]},{'model':_0x8cc5('0xd'),'as':_0x8cc5('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x8cc5('0x2'),_0x8cc5('0x4'),_0x8cc5('0xb'),'data5'],'as':_0x8cc5('0xa')}]}]},'log':'getMailAccount'});};};exports[_0x8cc5('0xf')]=function(_0x500b20,_0x1cd3b5){return client['Request']('NotifyMailAccount',{'account':{'id':_0x500b20},'body':_0x1cd3b5,'log':_0x8cc5('0x10')});}; \ No newline at end of file +var _0xc838=['key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','active'];(function(_0x208916,_0x48439f){var _0x57ec36=function(_0x3a6d9e){while(--_0x3a6d9e){_0x208916['push'](_0x208916['shift']());}};_0x57ec36(++_0x48439f);}(_0xc838,0xbd));var _0x8c83=function(_0x4840da,_0x8e0074){_0x4840da=_0x4840da-0x0;var _0x2e667c=_0xc838[_0x4840da];return _0x2e667c;};'use strict';var client=require(_0x8c83('0x0'));exports[_0x8c83('0x1')]=function(){return function(){return client[_0x8c83('0x2')](_0x8c83('0x3'),{'options':{'attributes':['id',_0x8c83('0x4'),_0x8c83('0x5'),_0x8c83('0x6'),_0x8c83('0x7'),_0x8c83('0x8'),_0x8c83('0x9'),_0x8c83('0xa'),_0x8c83('0xb')],'raw':![],'include':[{'model':_0x8c83('0xc'),'as':_0x8c83('0xd'),'include':[{'model':_0x8c83('0xe'),'attributes':['id','name','service',_0x8c83('0xf'),'data5'],'as':_0x8c83('0xe')}]},{'model':_0x8c83('0x10'),'as':_0x8c83('0x11'),'include':[{'model':_0x8c83('0xe'),'attributes':['id',_0x8c83('0x4'),_0x8c83('0x6'),_0x8c83('0xf'),_0x8c83('0x12')],'as':_0x8c83('0xe')}]}]},'log':_0x8c83('0x13')});};};exports[_0x8c83('0x14')]=function(_0x599205,_0x1fc0b1){return client['Request']('NotifyMailAccount',{'account':{'id':_0x599205},'body':_0x1fc0b1,'log':_0x8c83('0x15')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8017881..ef88f8f 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 _0x2f80=['ShowSetting','GetSettings','../client','getSettings','Request'];(function(_0x454cbd,_0x436d19){var _0x45b4bf=function(_0x52241d){while(--_0x52241d){_0x454cbd['push'](_0x454cbd['shift']());}};_0x45b4bf(++_0x436d19);}(_0x2f80,0xb6));var _0x02f8=function(_0x5a8be1,_0x3d09f0){_0x5a8be1=_0x5a8be1-0x0;var _0x16138f=_0x2f80[_0x5a8be1];return _0x16138f;};'use strict';var client=require(_0x02f8('0x0'));exports[_0x02f8('0x1')]=function(){return client[_0x02f8('0x2')](_0x02f8('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x02f8('0x4')});}; \ No newline at end of file +var _0xa0d4=['Request','ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x5bfbf9,_0x5eb70e){var _0x42034e=function(_0x1b56a8){while(--_0x1b56a8){_0x5bfbf9['push'](_0x5bfbf9['shift']());}};_0x42034e(++_0x5eb70e);}(_0xa0d4,0x15d));var _0x4a0d=function(_0x4c6a57,_0x44ab33){_0x4c6a57=_0x4c6a57-0x0;var _0x1a8abd=_0xa0d4[_0x4c6a57];return _0x1a8abd;};'use strict';var client=require('../client');exports[_0x4a0d('0x0')]=function(){return client[_0x4a0d('0x1')](_0x4a0d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4a0d('0x3')]},'log':_0x4a0d('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 09a94b8..729c9ce 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 bfe6df8..c175186 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 _0xd6e1=['sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0x1dde3b,_0x45002e){var _0x50ff8a=function(_0x1366c2){while(--_0x1366c2){_0x1dde3b['push'](_0x1dde3b['shift']());}};_0x50ff8a(++_0x45002e);}(_0xd6e1,0x1c9));var _0x1d6e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd6e1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1d6e('0x0'));var http=require(_0x1d6e('0x1'));var express=require(_0x1d6e('0x2'));var sticky=require(_0x1d6e('0x3'));var Redis=require('ioredis');var config=require(_0x1d6e('0x4'));var app=express();var server=http[_0x1d6e('0x5')](app);server[_0x1d6e('0x6')]=0xdbba0;if(sticky[_0x1d6e('0x7')](server,config[_0x1d6e('0x8')])){var socketio=require(_0x1d6e('0x9'))(server,{'transports':['websocket',_0x1d6e('0xa')]});config[_0x1d6e('0xb')]=_[_0x1d6e('0xc')](config['redis'],{'host':_0x1d6e('0xd'),'port':0x18eb});socketio[_0x1d6e('0xe')](require(_0x1d6e('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x1d6e('0xb')])}));require('../../config/triggers')[_0x1d6e('0x10')]();require(_0x1d6e('0x11'))['default'](socketio);require('../../config/express')[_0x1d6e('0x10')](app);require('../../routes')[_0x1d6e('0x10')](app);}else{server[_0x1d6e('0x12')](_0x1d6e('0x13'),function(){console[_0x1d6e('0x14')](_0x1d6e('0x15'),config[_0x1d6e('0x8')]);});}exports=module[_0x1d6e('0x16')]=app; \ No newline at end of file +var _0xbec1=['timeout','listen','socket.io','websocket','polling','defaults','redis','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','createServer'];(function(_0x4af750,_0x2cf5ef){var _0x288ef1=function(_0x2e7db5){while(--_0x2e7db5){_0x4af750['push'](_0x4af750['shift']());}};_0x288ef1(++_0x2cf5ef);}(_0xbec1,0x1f4));var _0x1bec=function(_0x5232ea,_0xb20da2){_0x5232ea=_0x5232ea-0x0;var _0x18147a=_0xbec1[_0x5232ea];return _0x18147a;};'use strict';var _=require(_0x1bec('0x0'));var http=require(_0x1bec('0x1'));var express=require(_0x1bec('0x2'));var sticky=require('sticky-session');var Redis=require(_0x1bec('0x3'));var config=require(_0x1bec('0x4'));var app=express();var server=http[_0x1bec('0x5')](app);server[_0x1bec('0x6')]=0xdbba0;if(sticky[_0x1bec('0x7')](server,config['port'])){var socketio=require(_0x1bec('0x8'))(server,{'transports':[_0x1bec('0x9'),_0x1bec('0xa')]});config['redis']=_[_0x1bec('0xb')](config[_0x1bec('0xc')],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x1bec('0xd'))({'pubClient':new Redis(config[_0x1bec('0xc')]),'subClient':new Redis(config[_0x1bec('0xc')])}));require(_0x1bec('0xe'))['default']();require(_0x1bec('0xf'))[_0x1bec('0x10')](socketio);require('../../config/express')[_0x1bec('0x10')](app);require(_0x1bec('0x11'))['default'](app);}else{server[_0x1bec('0x12')](_0x1bec('0x13'),function(){console[_0x1bec('0x14')](_0x1bec('0x15'),config['port']);});}exports=module[_0x1bec('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index a219093..6693e4b 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 _0xfba4=['debug','rpc','error','message','catch','exports','bluebird','routing','Request','request','then'];(function(_0x29b569,_0x516391){var _0x32f59f=function(_0x4c144f){while(--_0x4c144f){_0x29b569['push'](_0x29b569['shift']());}};_0x32f59f(++_0x516391);}(_0xfba4,0x187));var _0x4fba=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xfba4[_0x2ed7d1];return _0x38ae3c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4fba('0x0'));var logger=require('../../config/logger')(_0x4fba('0x1'));var client=jayson['client']['http']({'port':0x2329});client[_0x4fba('0x2')]=function(_0x3b10ec,_0x54694d){return new BPromise(function(_0x5d8ae2,_0x161356){return client[_0x4fba('0x3')](_0x3b10ec,_0x54694d)[_0x4fba('0x4')](function(_0x5f2e07){logger[_0x4fba('0x5')](_0x4fba('0x6'),_0x4fba('0x1'),_0x3b10ec,_0x54694d,_0x5f2e07);if(_0x5f2e07[_0x4fba('0x7')]){logger[_0x4fba('0x7')](_0x4fba('0x6'),_0x4fba('0x1'),_0x3b10ec,_0x5f2e07[_0x4fba('0x7')][_0x4fba('0x8')],_0x54694d);return _0x161356(_0x5f2e07[_0x4fba('0x7')][_0x4fba('0x8')]);}else{return _0x5d8ae2(_0x5f2e07['result']);}})[_0x4fba('0x9')](function(_0x307cd3){logger['error'](_0x4fba('0x6'),_0x4fba('0x1'),_0x3b10ec,_0x307cd3,_0x54694d);return _0x161356(_0x307cd3);});});};module[_0x4fba('0xa')]=client; \ No newline at end of file +var _0xf283=['bluebird','routing','http','Request','request','debug','rpc','error','message','result','exports','jayson/promise'];(function(_0x211634,_0x26039f){var _0x580d6f=function(_0x5d46e3){while(--_0x5d46e3){_0x211634['push'](_0x211634['shift']());}};_0x580d6f(++_0x26039f);}(_0xf283,0x143));var _0x3f28=function(_0x48053f,_0x5080d7){_0x48053f=_0x48053f-0x0;var _0x5a0ef3=_0xf283[_0x48053f];return _0x5a0ef3;};'use strict';var jayson=require(_0x3f28('0x0'));var BPromise=require(_0x3f28('0x1'));var logger=require('../../config/logger')(_0x3f28('0x2'));var client=jayson['client'][_0x3f28('0x3')]({'port':0x2329});client[_0x3f28('0x4')]=function(_0x48b8c4,_0x2b5afe){return new BPromise(function(_0x5d4f99,_0x59e9d3){return client[_0x3f28('0x5')](_0x48b8c4,_0x2b5afe)['then'](function(_0x29055c){logger[_0x3f28('0x6')](_0x3f28('0x7'),'routing',_0x48b8c4,_0x2b5afe,_0x29055c);if(_0x29055c['error']){logger[_0x3f28('0x8')]('rpc','routing',_0x48b8c4,_0x29055c[_0x3f28('0x8')][_0x3f28('0x9')],_0x2b5afe);return _0x59e9d3(_0x29055c['error'][_0x3f28('0x9')]);}else{return _0x5d4f99(_0x29055c[_0x3f28('0xa')]);}})['catch'](function(_0x5e0685){logger['error'](_0x3f28('0x7'),_0x3f28('0x2'),_0x48b8c4,_0x5e0685,_0x2b5afe);return _0x59e9d3(_0x5e0685);});});};module[_0x3f28('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 20d8e43..4566e33 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 _0xb313=['./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./realtime'];(function(_0x5618b0,_0x39cd2a){var _0x3ebac5=function(_0x406bf5){while(--_0x406bf5){_0x5618b0['push'](_0x5618b0['shift']());}};_0x3ebac5(++_0x39cd2a);}(_0xb313,0x116));var _0x3b31=function(_0x162f62,_0x1a0ab1){_0x162f62=_0x162f62-0x0;var _0x26c56e=_0xb313[_0x162f62];return _0x26c56e;};'use strict';var BPromise=require(_0x3b31('0x0'));var server=require('./server');var Realtime=require(_0x3b31('0x1'));var user=require(_0x3b31('0x2'));var interval=require(_0x3b31('0x3'));var openchannelQueue=require(_0x3b31('0x4'));var chatQueue=require(_0x3b31('0x5'));var smsQueue=require(_0x3b31('0x6'));var mailQueue=require(_0x3b31('0x7'));var faxQueue=require(_0x3b31('0x8'));var whatsappQueue=require(_0x3b31('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3b31('0xa')]()[_0x3b31('0xb')](user['getAgents']())[_0x3b31('0xb')](realtime[_0x3b31('0xc')]())[_0x3b31('0xb')](interval[_0x3b31('0xd')]())['then'](realtime[_0x3b31('0xe')]())[_0x3b31('0xb')](openchannelQueue[_0x3b31('0xf')]())[_0x3b31('0xb')](realtime[_0x3b31('0x10')]())[_0x3b31('0xb')](chatQueue[_0x3b31('0x11')]())[_0x3b31('0xb')](realtime[_0x3b31('0x12')]())['then'](smsQueue[_0x3b31('0x13')]())[_0x3b31('0xb')](realtime[_0x3b31('0x14')]())[_0x3b31('0xb')](mailQueue[_0x3b31('0x15')]())[_0x3b31('0xb')](realtime['initMailQueues']())['then'](faxQueue[_0x3b31('0x16')]())[_0x3b31('0xb')](realtime[_0x3b31('0x17')]())[_0x3b31('0xb')](whatsappQueue[_0x3b31('0x18')]())[_0x3b31('0xb')](realtime[_0x3b31('0x19')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x3b31('0xb')](function(_0x31e221){return initRealtime();})[_0x3b31('0xb')](function(_0x49c688){return setInterval(initRealtime,0x1388);})[_0x3b31('0x1a')](function(_0x394fea){console[_0x3b31('0x1b')](_0x394fea);});}main(); \ No newline at end of file +var _0x3aca=['getOpenchannelQueues','initChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals'];(function(_0x3c9400,_0x39ea75){var _0x1153dd=function(_0x36ded2){while(--_0x36ded2){_0x3c9400['push'](_0x3c9400['shift']());}};_0x1153dd(++_0x39ea75);}(_0x3aca,0x1d7));var _0xa3ac=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x3aca[_0x5b27da];return _0x3254f4;};'use strict';var BPromise=require(_0xa3ac('0x0'));var server=require(_0xa3ac('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xa3ac('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xa3ac('0x3'));var mailQueue=require(_0xa3ac('0x4'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xa3ac('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa3ac('0x6')]()['then'](user[_0xa3ac('0x7')]())[_0xa3ac('0x8')](realtime[_0xa3ac('0x9')]())[_0xa3ac('0x8')](interval[_0xa3ac('0xa')]())[_0xa3ac('0x8')](realtime[_0xa3ac('0xb')]())[_0xa3ac('0x8')](openchannelQueue[_0xa3ac('0xc')]())[_0xa3ac('0x8')](realtime['initOpenchannelQueues']())[_0xa3ac('0x8')](chatQueue['getChatQueues']())['then'](realtime[_0xa3ac('0xd')]())['then'](smsQueue['getSmsQueues']())[_0xa3ac('0x8')](realtime['initSmsQueues']())[_0xa3ac('0x8')](mailQueue[_0xa3ac('0xe')]())['then'](realtime[_0xa3ac('0xf')]())[_0xa3ac('0x8')](faxQueue[_0xa3ac('0x10')]())[_0xa3ac('0x8')](realtime[_0xa3ac('0x11')]())['then'](whatsappQueue[_0xa3ac('0x12')]())[_0xa3ac('0x8')](realtime[_0xa3ac('0x13')]())[_0xa3ac('0x8')](function(){return realtime;});}function main(){return server[_0xa3ac('0x14')](realtime)[_0xa3ac('0x8')](function(_0x308e18){return initRealtime();})[_0xa3ac('0x8')](function(_0x4201fe){return setInterval(initRealtime,0x1388);})[_0xa3ac('0x15')](function(_0x3db5fe){console[_0xa3ac('0x16')](_0x3db5fe);});}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 3ad4612..7f9712a 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(_0x190647,_0x14fbb9){var _0x322118=function(_0x227b82){while(--_0x227b82){_0x190647['push'](_0x190647['shift']());}};_0x322118(++_0x14fbb9);}(_0x7a54,0x106));var _0x47a5=function(_0x45631d,_0x23c0f8){_0x45631d=_0x45631d-0x0;var _0x4d6849=_0x7a54[_0x45631d];return _0x4d6849;};'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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x199589,_0x1653a9){var _0x2156a4=function(_0x3d514e){while(--_0x3d514e){_0x199589['push'](_0x199589['shift']());}};_0x2156a4(++_0x1653a9);}(_0xe14b,0x93));var _0xbe14=function(_0x2bb77b,_0xc4b850){_0x2bb77b=_0x2bb77b-0x0;var _0x343192=_0xe14b[_0x2bb77b];return _0x343192;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index a639769..25b16ee 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 _0x79b6=['error','message','catch','sendMailMessage','jayson/promise','client','http','then'];(function(_0x4387d0,_0x513c88){var _0x10e266=function(_0x58ac65){while(--_0x58ac65){_0x4387d0['push'](_0x4387d0['shift']());}};_0x10e266(++_0x513c88);}(_0x79b6,0xf4));var _0x679b=function(_0x4f9baf,_0x17a0a1){_0x4f9baf=_0x4f9baf-0x0;var _0x5dd2dd=_0x79b6[_0x4f9baf];return _0x5dd2dd;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x679b('0x0'));var client=jayson[_0x679b('0x1')][_0x679b('0x2')]({'port':0x232b});function request(_0x30beba,_0x2df416){return new BPromise(function(_0x539e66,_0xabd5d2){return client['request'](_0x30beba,_0x2df416)[_0x679b('0x3')](function(_0x26b7cd){if(_0x26b7cd[_0x679b('0x4')]){return _0xabd5d2(_0x26b7cd[_0x679b('0x4')][_0x679b('0x5')]);}else{return _0x539e66(_0x26b7cd['result']);}})[_0x679b('0x6')](function(_0x5283a3){return _0xabd5d2(_0x5283a3);});});}exports[_0x679b('0x7')]=function(_0x50f8e2,_0x4cbb63){return request('SendMail',{'account':_0x50f8e2,'message':_0x4cbb63});}; \ No newline at end of file +var _0x8b96=['http','request','then','error','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x1320b5,_0x5678bc){var _0x6cce9b=function(_0xfb5b5){while(--_0xfb5b5){_0x1320b5['push'](_0x1320b5['shift']());}};_0x6cce9b(++_0x5678bc);}(_0x8b96,0x1a5));var _0x68b9=function(_0xd69bbc,_0xd0c9bf){_0xd69bbc=_0xd69bbc-0x0;var _0xef01e9=_0x8b96[_0xd69bbc];return _0xef01e9;};'use strict';var BPromise=require(_0x68b9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x68b9('0x1')][_0x68b9('0x2')]({'port':0x232b});function request(_0xf25c78,_0xa3c8c7){return new BPromise(function(_0x5e3217,_0x390d67){return client[_0x68b9('0x3')](_0xf25c78,_0xa3c8c7)[_0x68b9('0x4')](function(_0x1a27e3){if(_0x1a27e3[_0x68b9('0x5')]){return _0x390d67(_0x1a27e3[_0x68b9('0x5')]['message']);}else{return _0x5e3217(_0x1a27e3['result']);}})[_0x68b9('0x6')](function(_0x415144){return _0x390d67(_0x415144);});});}exports[_0x68b9('0x7')]=function(_0x7841cc,_0xd51756){return request(_0x68b9('0x8'),{'account':_0x7841cc,'message':_0xd51756});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index aef9565..47494b5 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 _0xdcac=['emit','user:save','exports','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','md5','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','mail','chat','fax','sms','getChannelStatus','Status','StatusTime','toNumber','format','faxCurrentCapacity','smsStatus','whatsappStatusTime','openchannelStatusTime','openchannelCurrentCapacity','stringify'];(function(_0x49bf1d,_0x1190ea){var _0x55734f=function(_0xd5a69e){while(--_0xd5a69e){_0x49bf1d['push'](_0x49bf1d['shift']());}};_0x55734f(++_0x1190ea);}(_0xdcac,0x139));var _0xcdca=function(_0xc35493,_0x2ea57c){_0xc35493=_0xc35493-0x0;var _0x3d65e7=_0xdcac[_0xc35493];return _0x3d65e7;};'use strict';var _=require('lodash');var moment=require(_0xcdca('0x0'));var md5=require('md5');var Redis=require(_0xcdca('0x1'));var config=require(_0xcdca('0x2'));config[_0xcdca('0x3')]=_[_0xcdca('0x4')](config[_0xcdca('0x3')],{'host':_0xcdca('0x5'),'port':0x18eb});var io=require(_0xcdca('0x6'))(new Redis(config[_0xcdca('0x3')]));function Agent(_0x1a592c){this['id']=_0x1a592c['id']||0x0;this[_0xcdca('0x7')]=_0x1a592c[_0xcdca('0x7')]||'';this['online']=_0x1a592c[_0xcdca('0x8')]||!![];this[_0xcdca('0x9')]=_0x1a592c['voicePause']||![];this['chatPause']=_0x1a592c[_0xcdca('0xa')]||![];this[_0xcdca('0xb')]=_0x1a592c[_0xcdca('0xb')]||![];this[_0xcdca('0xc')]=_0x1a592c[_0xcdca('0xc')]||![];this[_0xcdca('0xd')]=_0x1a592c['smsPause']||![];this[_0xcdca('0xe')]=_0x1a592c[_0xcdca('0xe')]||![];this[_0xcdca('0xf')]=_0xcdca('0x10');this[_0xcdca('0x11')]=0x0;this[_0xcdca('0x12')]=_0x1a592c['chatCapacity']||0x0;this[_0xcdca('0x13')]=0x0;this[_0xcdca('0x14')]=_0xcdca('0x10');this[_0xcdca('0x15')]=0x0;this[_0xcdca('0x16')]=_0x1a592c['mailCapacity']||0x0;this[_0xcdca('0x17')]=0x0;this[_0xcdca('0x18')]=_0xcdca('0x10');this[_0xcdca('0x19')]=0x0;this[_0xcdca('0x1a')]=_0x1a592c['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0xcdca('0x10');this[_0xcdca('0x1b')]=0x0;this['smsCapacity']=_0x1a592c[_0xcdca('0x1c')]||0x0;this[_0xcdca('0x1d')]=0x0;this['whatsappStatus']=_0xcdca('0x10');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x1a592c[_0xcdca('0x1e')]||0x0;this[_0xcdca('0x1f')]=0x0;this[_0xcdca('0x20')]=_0xcdca('0x10');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1a592c[_0xcdca('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xcdca('0x22')]=![];this[_0xcdca('0x23')]=undefined;this[_0xcdca('0x24')]='';this['updateRealtime']();}Agent[_0xcdca('0x25')]['getChannelStatus']=function(_0x1be2e2){if(this[_0x1be2e2+'CurrentCapacity']>0x0){if(this[_0x1be2e2+_0xcdca('0x26')]>0x0&&this[_0x1be2e2+_0xcdca('0x27')]>=this[_0x1be2e2+_0xcdca('0x26')]){return _0xcdca('0x28');}else{return _0xcdca('0x29');}}else{return _0xcdca('0x2a');}};Agent['prototype'][_0xcdca('0x2b')]=function(){var _0x39fbe3=[_0xcdca('0x2c'),_0xcdca('0x2d'),'openchannel',_0xcdca('0x2e'),_0xcdca('0x2f'),'whatsapp'];for(var _0x7ac81c=0x0;_0x7ac81c<_0x39fbe3['length'];_0x7ac81c+=0x1){var _0x1e5fd6=this[_0xcdca('0x30')](_0x39fbe3[_0x7ac81c]);if(this[_0x39fbe3[_0x7ac81c]+_0xcdca('0x31')]!==_0x1e5fd6){this[_0x39fbe3[_0x7ac81c]+_0xcdca('0x32')]=_[_0xcdca('0x33')](moment()[_0xcdca('0x34')]('x'));}this[_0x39fbe3[_0x7ac81c]+'Status']=_0x1e5fd6;}var _0x6bf65={'id':this['id'],'name':this['name'],'online':this[_0xcdca('0x8')],'voicePause':this[_0xcdca('0x9')],'chatPause':this[_0xcdca('0xa')],'mailPause':this[_0xcdca('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0xcdca('0xc')],'openchannelPause':this[_0xcdca('0xe')],'chatStatus':this[_0xcdca('0xf')],'chatStatusTime':this[_0xcdca('0x11')],'chatCapacity':this[_0xcdca('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xcdca('0x16')],'mailCurrentCapacity':this[_0xcdca('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xcdca('0x19')],'faxCapacity':this[_0xcdca('0x1a')],'faxCurrentCapacity':this[_0xcdca('0x35')],'smsStatus':this[_0xcdca('0x36')],'smsStatusTime':this[_0xcdca('0x1b')],'smsCapacity':this[_0xcdca('0x1c')],'smsCurrentCapacity':this[_0xcdca('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xcdca('0x37')],'whatsappCapacity':this[_0xcdca('0x1e')],'whatsappCurrentCapacity':this[_0xcdca('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xcdca('0x38')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xcdca('0x39')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x1ef8de=md5(JSON[_0xcdca('0x3a')](_0x6bf65));if(this[_0xcdca('0x24')]!==_0x1ef8de){this[_0xcdca('0x24')]=_0x1ef8de;io[_0xcdca('0x3b')](_0xcdca('0x3c'),_0x6bf65);}};module[_0xcdca('0x3d')]=Agent; \ No newline at end of file +var _0xb477=['Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','StatusTime','toNumber','format','Status','mailStatus','faxCurrentCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','emit','user:save','exports','moment','md5','ioredis','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity'];(function(_0x5c92fa,_0x172a72){var _0x1469ba=function(_0x189458){while(--_0x189458){_0x5c92fa['push'](_0x5c92fa['shift']());}};_0x1469ba(++_0x172a72);}(_0xb477,0x8f));var _0x7b47=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb477[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var moment=require(_0x7b47('0x0'));var md5=require(_0x7b47('0x1'));var Redis=require(_0x7b47('0x2'));var config=require('../../../config/environment');config[_0x7b47('0x3')]=_[_0x7b47('0x4')](config[_0x7b47('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7b47('0x5'))(new Redis(config[_0x7b47('0x3')]));function Agent(_0x125ce6){this['id']=_0x125ce6['id']||0x0;this[_0x7b47('0x6')]=_0x125ce6[_0x7b47('0x6')]||'';this['online']=_0x125ce6[_0x7b47('0x7')]||!![];this[_0x7b47('0x8')]=_0x125ce6['voicePause']||![];this[_0x7b47('0x9')]=_0x125ce6[_0x7b47('0x9')]||![];this[_0x7b47('0xa')]=_0x125ce6[_0x7b47('0xa')]||![];this[_0x7b47('0xb')]=_0x125ce6[_0x7b47('0xb')]||![];this[_0x7b47('0xc')]=_0x125ce6[_0x7b47('0xc')]||![];this[_0x7b47('0xd')]=_0x125ce6[_0x7b47('0xd')]||![];this[_0x7b47('0xe')]=_0x7b47('0xf');this['chatStatusTime']=0x0;this[_0x7b47('0x10')]=_0x125ce6['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x7b47('0xf');this[_0x7b47('0x11')]=0x0;this[_0x7b47('0x12')]=_0x125ce6[_0x7b47('0x12')]||0x0;this[_0x7b47('0x13')]=0x0;this[_0x7b47('0x14')]='unknown';this[_0x7b47('0x15')]=0x0;this[_0x7b47('0x16')]=_0x125ce6[_0x7b47('0x16')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x7b47('0x17')]=_0x7b47('0xf');this[_0x7b47('0x18')]=0x0;this[_0x7b47('0x19')]=_0x125ce6['smsCapacity']||0x0;this[_0x7b47('0x1a')]=0x0;this[_0x7b47('0x1b')]=_0x7b47('0xf');this[_0x7b47('0x1c')]=0x0;this['whatsappCapacity']=_0x125ce6[_0x7b47('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x7b47('0x1e')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x125ce6[_0x7b47('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x7b47('0x20')]=![];this['busyQueue']=undefined;this[_0x7b47('0x1')]='';this[_0x7b47('0x21')]();}Agent[_0x7b47('0x22')][_0x7b47('0x23')]=function(_0x13f121){if(this[_0x13f121+_0x7b47('0x24')]>0x0){if(this[_0x13f121+_0x7b47('0x25')]>0x0&&this[_0x13f121+_0x7b47('0x24')]>=this[_0x13f121+_0x7b47('0x25')]){return _0x7b47('0x26');}else{return _0x7b47('0x27');}}else{return _0x7b47('0x28');}};Agent['prototype'][_0x7b47('0x21')]=function(){var _0x13b56f=[_0x7b47('0x29'),_0x7b47('0x2a'),_0x7b47('0x2b'),_0x7b47('0x2c'),_0x7b47('0x2d'),_0x7b47('0x2e')];for(var _0x3c237a=0x0;_0x3c237a<_0x13b56f['length'];_0x3c237a+=0x1){var _0x5d3829=this['getChannelStatus'](_0x13b56f[_0x3c237a]);if(this[_0x13b56f[_0x3c237a]+'Status']!==_0x5d3829){this[_0x13b56f[_0x3c237a]+_0x7b47('0x2f')]=_[_0x7b47('0x30')](moment()[_0x7b47('0x31')]('x'));}this[_0x13b56f[_0x3c237a]+_0x7b47('0x32')]=_0x5d3829;}var _0x5705e2={'id':this['id'],'name':this[_0x7b47('0x6')],'online':this[_0x7b47('0x7')],'voicePause':this[_0x7b47('0x8')],'chatPause':this[_0x7b47('0x9')],'mailPause':this[_0x7b47('0xa')],'smsPause':this[_0x7b47('0xc')],'faxPause':this[_0x7b47('0xb')],'openchannelPause':this[_0x7b47('0xd')],'chatStatus':this[_0x7b47('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x7b47('0x33')],'mailStatusTime':this[_0x7b47('0x11')],'mailCapacity':this[_0x7b47('0x12')],'mailCurrentCapacity':this[_0x7b47('0x13')],'faxStatus':this[_0x7b47('0x14')],'faxStatusTime':this[_0x7b47('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x7b47('0x34')],'smsStatus':this[_0x7b47('0x17')],'smsStatusTime':this[_0x7b47('0x18')],'smsCapacity':this[_0x7b47('0x19')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x7b47('0x1b')],'whatsappStatusTime':this[_0x7b47('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x7b47('0x35')],'openchannelStatus':this[_0x7b47('0x1e')],'openchannelStatusTime':this[_0x7b47('0x36')],'openchannelCapacity':this[_0x7b47('0x1f')],'openchannelCurrentCapacity':this[_0x7b47('0x37')],'busy':this[_0x7b47('0x20')],'busyQueue':this[_0x7b47('0x38')]};var _0x52d2a2=md5(JSON['stringify'](_0x5705e2));if(this[_0x7b47('0x1')]!==_0x52d2a2){this['md5']=_0x52d2a2;io[_0x7b47('0x39')](_0x7b47('0x3a'),_0x5705e2);}};module[_0x7b47('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index b439df5..7241027 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 _0xa085=['emit','chat_queue:save','exports','lodash','md5','util','redis','defaults','localhost','name','timeout','beepall','Agents','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','waiting','stringify','chat:queue:%s'];(function(_0x2122f1,_0x4cb1bc){var _0x5baa3b=function(_0x581aaa){while(--_0x581aaa){_0x2122f1['push'](_0x2122f1['shift']());}};_0x5baa3b(++_0x4cb1bc);}(_0xa085,0x16f));var _0x5a08=function(_0x43e091,_0x2455a4){_0x43e091=_0x43e091-0x0;var _0x3cf742=_0xa085[_0x43e091];return _0x3cf742;};'use strict';var _=require(_0x5a08('0x0'));var md5=require(_0x5a08('0x1'));var util=require(_0x5a08('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x5a08('0x3')]=_[_0x5a08('0x4')](config[_0x5a08('0x3')],{'host':_0x5a08('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x290fe3){this['id']=_0x290fe3['id']||0x0;this[_0x5a08('0x6')]=_0x290fe3['name']||'';this['timeout']=_0x290fe3[_0x5a08('0x7')]||0xa;this['strategy']=_0x290fe3['strategy']||_0x5a08('0x8');this[_0x5a08('0x9')]=_0x290fe3[_0x5a08('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x5a08('0x1')]='';this[_0x5a08('0xa')]();this['updateRealtime']();}ChatQueue[_0x5a08('0xb')][_0x5a08('0xa')]=function(){var _0x2d4526=this[_0x5a08('0xc')][_0x5a08('0xd')];this[_0x5a08('0xc')]=_[_0x5a08('0xe')](this['Agents'],'id');this[_0x5a08('0xc')][_0x5a08('0xd')]=_0x2d4526;};ChatQueue[_0x5a08('0xb')][_0x5a08('0xf')]=function(){this[_0x5a08('0x10')]=0x0;this[_0x5a08('0x11')]=0x0;for(var _0xed782a=0x0;_0xed782a=0x0?this[_0x5a08('0x15')]:0x0;var _0x5a341d={'id':this['id'],'available':this[_0x5a08('0x15')],'loggedIn':this[_0x5a08('0x10')],'name':this[_0x5a08('0x6')],'paused':this[_0x5a08('0x11')],'waiting':this[_0x5a08('0x16')]};var _0x2c1fa8=md5(JSON[_0x5a08('0x17')](_0x5a341d));if(this[_0x5a08('0x1')]!==_0x2c1fa8){this[_0x5a08('0x1')]=_0x2c1fa8;io['to'](util['format'](_0x5a08('0x18'),_0x5a341d[_0x5a08('0x6')]))[_0x5a08('0x19')](_0x5a08('0x1a'),_0x5a341d);}};module[_0x5a08('0x1b')]=ChatQueue; \ No newline at end of file +var _0x992a=['loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map'];(function(_0x37fb73,_0x5200e5){var _0x25abcf=function(_0x1781f2){while(--_0x1781f2){_0x37fb73['push'](_0x37fb73['shift']());}};_0x25abcf(++_0x5200e5);}(_0x992a,0xec));var _0xa992=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x992a[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0xa992('0x0'));var md5=require(_0xa992('0x1'));var util=require(_0xa992('0x2'));var Redis=require(_0xa992('0x3'));var config=require(_0xa992('0x4'));config['redis']=_[_0xa992('0x5')](config[_0xa992('0x6')],{'host':_0xa992('0x7'),'port':0x18eb});var io=require(_0xa992('0x8'))(new Redis(config['redis']));function ChatQueue(_0xe70e64){this['id']=_0xe70e64['id']||0x0;this['name']=_0xe70e64[_0xa992('0x9')]||'';this[_0xa992('0xa')]=_0xe70e64[_0xa992('0xa')]||0xa;this['strategy']=_0xe70e64[_0xa992('0xb')]||_0xa992('0xc');this[_0xa992('0xd')]=_0xe70e64[_0xa992('0xd')];this[_0xa992('0xe')]={};this[_0xa992('0xf')]=0x0;this['md5']='';this[_0xa992('0x10')]();this[_0xa992('0x11')]();}ChatQueue['prototype'][_0xa992('0x10')]=function(){var _0x473ee8=this[_0xa992('0xe')][_0xa992('0x12')];this[_0xa992('0xe')]=_[_0xa992('0x13')](this[_0xa992('0xd')],'id');this['mapAgentsId'][_0xa992('0x12')]=_0x473ee8;};ChatQueue['prototype'][_0xa992('0x11')]=function(){this[_0xa992('0x14')]=0x0;this[_0xa992('0x15')]=0x0;for(var _0x3e60dd=0x0;_0x3e60dd=0x0?this[_0xa992('0x19')]:0x0;var _0x4d2049={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa992('0x14')],'name':this[_0xa992('0x9')],'paused':this[_0xa992('0x15')],'waiting':this[_0xa992('0xf')]};var _0x473629=md5(JSON[_0xa992('0x1a')](_0x4d2049));if(this['md5']!==_0x473629){this[_0xa992('0x1')]=_0x473629;io['to'](util[_0xa992('0x1b')](_0xa992('0x1c'),_0x4d2049[_0xa992('0x9')]))[_0xa992('0x1d')](_0xa992('0x1e'),_0x4d2049);}};module[_0xa992('0x1f')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 58cc23a..dbf3288 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 _0xcc66=['exports','lodash','md5','util','localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','online','faxPause','paused','available','format','fax:queue:%s','emit','fax_queue:save'];(function(_0x4c06a3,_0x12cc49){var _0x53cfaa=function(_0x1a0656){while(--_0x1a0656){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x53cfaa(++_0x12cc49);}(_0xcc66,0xc5));var _0x6cc6=function(_0x3f75fb,_0x47375a){_0x3f75fb=_0x3f75fb-0x0;var _0x156d0f=_0xcc66[_0x3f75fb];return _0x156d0f;};'use strict';var _=require(_0x6cc6('0x0'));var md5=require(_0x6cc6('0x1'));var util=require(_0x6cc6('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x6cc6('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6cc6('0x4')]));function FaxQueue(_0x41d045){this['id']=_0x41d045['id']||0x0;this['name']=_0x41d045[_0x6cc6('0x5')]||'';this[_0x6cc6('0x6')]=_0x41d045[_0x6cc6('0x6')]||0xa;this[_0x6cc6('0x7')]=_0x41d045[_0x6cc6('0x7')]||_0x6cc6('0x8');this[_0x6cc6('0x9')]=_0x41d045[_0x6cc6('0x9')];this[_0x6cc6('0xa')]={};this[_0x6cc6('0xb')]=0x0;this['md5']='';this[_0x6cc6('0xc')]();this[_0x6cc6('0xd')]();}FaxQueue[_0x6cc6('0xe')][_0x6cc6('0xc')]=function(){var _0x304c43=this[_0x6cc6('0xa')]['_rr'];this[_0x6cc6('0xa')]=_[_0x6cc6('0xf')](this[_0x6cc6('0x9')],'id');this[_0x6cc6('0xa')][_0x6cc6('0x10')]=_0x304c43;};FaxQueue[_0x6cc6('0xe')]['updateRealtime']=function(){this[_0x6cc6('0x11')]=0x0;this['paused']=0x0;for(var _0x194d7a=0x0;_0x194d7a=0x0?this['available']:0x0;var _0x513190={'id':this['id'],'available':this[_0x6cc6('0x16')],'loggedIn':this[_0x6cc6('0x11')],'name':this[_0x6cc6('0x5')],'paused':this[_0x6cc6('0x15')],'waiting':this[_0x6cc6('0xb')]};var _0x28b42e=md5(JSON['stringify'](_0x513190));if(this[_0x6cc6('0x1')]!==_0x28b42e){this[_0x6cc6('0x1')]=_0x28b42e;io['to'](util[_0x6cc6('0x17')](_0x6cc6('0x18'),_0x513190[_0x6cc6('0x5')]))[_0x6cc6('0x19')](_0x6cc6('0x1a'),_0x513190);}};module[_0x6cc6('0x1b')]=FaxQueue; \ No newline at end of file +var _0xc407=['beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','fax:queue:%s','fax_queue:save','lodash','util','ioredis','redis','defaults','localhost','name','timeout','strategy'];(function(_0x465598,_0x1fdfcc){var _0x3b5ef2=function(_0x26942d){while(--_0x26942d){_0x465598['push'](_0x465598['shift']());}};_0x3b5ef2(++_0x1fdfcc);}(_0xc407,0x6f));var _0x7c40=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xc407[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0x7c40('0x0'));var md5=require('md5');var util=require(_0x7c40('0x1'));var Redis=require(_0x7c40('0x2'));var config=require('../../../config/environment');config[_0x7c40('0x3')]=_[_0x7c40('0x4')](config[_0x7c40('0x3')],{'host':_0x7c40('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x4ae764){this['id']=_0x4ae764['id']||0x0;this[_0x7c40('0x6')]=_0x4ae764[_0x7c40('0x6')]||'';this[_0x7c40('0x7')]=_0x4ae764[_0x7c40('0x7')]||0xa;this['strategy']=_0x4ae764[_0x7c40('0x8')]||_0x7c40('0x9');this[_0x7c40('0xa')]=_0x4ae764[_0x7c40('0xa')];this[_0x7c40('0xb')]={};this[_0x7c40('0xc')]=0x0;this[_0x7c40('0xd')]='';this['updateRouting']();this[_0x7c40('0xe')]();}FaxQueue[_0x7c40('0xf')]['updateRouting']=function(){var _0x25bc22=this[_0x7c40('0xb')][_0x7c40('0x10')];this[_0x7c40('0xb')]=_['map'](this[_0x7c40('0xa')],'id');this[_0x7c40('0xb')][_0x7c40('0x10')]=_0x25bc22;};FaxQueue[_0x7c40('0xf')]['updateRealtime']=function(){this[_0x7c40('0x11')]=0x0;this[_0x7c40('0x12')]=0x0;for(var _0x1e790b=0x0;_0x1e790b=0x0?this['available']:0x0;var _0x3fcd37={'id':this['id'],'available':this[_0x7c40('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x7c40('0x6')],'paused':this[_0x7c40('0x12')],'waiting':this[_0x7c40('0xc')]};var _0x30bc3f=md5(JSON['stringify'](_0x3fcd37));if(this[_0x7c40('0xd')]!==_0x30bc3f){this[_0x7c40('0xd')]=_0x30bc3f;io['to'](util['format'](_0x7c40('0x16'),_0x3fcd37[_0x7c40('0x6')]))['emit'](_0x7c40('0x17'),_0x3fcd37);}};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 a797e0e..6c1d721 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 _0x7995=['Intervals','exports','name'];(function(_0x2d06ec,_0x4517f4){var _0x565d38=function(_0x307800){while(--_0x307800){_0x2d06ec['push'](_0x2d06ec['shift']());}};_0x565d38(++_0x4517f4);}(_0x7995,0x83));var _0x5799=function(_0x2706f5,_0x408c42){_0x2706f5=_0x2706f5-0x0;var _0x24d6c6=_0x7995[_0x2706f5];return _0x24d6c6;};'use strict';function Interval(_0x153d9e){this['id']=_0x153d9e['id']||0x0;this[_0x5799('0x0')]=_0x153d9e[_0x5799('0x0')]||'';this[_0x5799('0x1')]=_0x153d9e['Intervals']||{};}module[_0x5799('0x2')]=Interval; \ No newline at end of file +var _0xd92d=['Intervals','exports','name'];(function(_0x35f5a7,_0x3f5fea){var _0xe4ec5=function(_0x54d8a6){while(--_0x54d8a6){_0x35f5a7['push'](_0x35f5a7['shift']());}};_0xe4ec5(++_0x3f5fea);}(_0xd92d,0x1d0));var _0xdd92=function(_0x11503f,_0x30de86){_0x11503f=_0x11503f-0x0;var _0x34caab=_0xd92d[_0x11503f];return _0x34caab;};'use strict';function Interval(_0x148b05){this['id']=_0x148b05['id']||0x0;this[_0xdd92('0x0')]=_0x148b05[_0xdd92('0x0')]||'';this[_0xdd92('0x1')]=_0x148b05['Intervals']||{};}module[_0xdd92('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 1831bd8..d180ef1 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 _0x7602=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x7602,0x74));var _0x2760=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7602[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2760('0x0'));var md5=require(_0x2760('0x1'));var util=require(_0x2760('0x2'));var Redis=require(_0x2760('0x3'));var config=require('../../../config/environment');config[_0x2760('0x4')]=_[_0x2760('0x5')](config['redis'],{'host':_0x2760('0x6'),'port':0x18eb});var io=require(_0x2760('0x7'))(new Redis(config[_0x2760('0x4')]));function MailQueue(_0x46e74b){this['id']=_0x46e74b['id']||0x0;this[_0x2760('0x8')]=_0x46e74b[_0x2760('0x8')]||'';this[_0x2760('0x9')]=_0x46e74b[_0x2760('0x9')]||0xa;this[_0x2760('0xa')]=_0x46e74b[_0x2760('0xa')]||_0x2760('0xb');this[_0x2760('0xc')]=_0x46e74b[_0x2760('0xc')];this[_0x2760('0xd')]={};this[_0x2760('0xe')]=0x0;this[_0x2760('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x2760('0xf')][_0x2760('0x10')]=function(){var _0x2d60a8=this['mapAgentsId'][_0x2760('0x11')];this[_0x2760('0xd')]=_[_0x2760('0x12')](this['Agents'],'id');this[_0x2760('0xd')][_0x2760('0x11')]=_0x2d60a8;};MailQueue[_0x2760('0xf')][_0x2760('0x13')]=function(){this[_0x2760('0x14')]=0x0;this[_0x2760('0x15')]=0x0;for(var _0x438285=0x0;_0x438285=0x0?this['available']:0x0;var _0x39c7f1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2760('0x14')],'name':this['name'],'paused':this[_0x2760('0x15')],'waiting':this['waiting']};var _0x3ceea8=md5(JSON[_0x2760('0x1a')](_0x39c7f1));if(this[_0x2760('0x1')]!==_0x3ceea8){this['md5']=_0x3ceea8;io['to'](util[_0x2760('0x1b')](_0x2760('0x1c'),_0x39c7f1[_0x2760('0x8')]))[_0x2760('0x1d')](_0x2760('0x1e'),_0x39c7f1);}};module['exports']=MailQueue; \ No newline at end of file +var _0xeca8=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','loggedIn','length','online','mailPause','paused','available','format','mail:queue:%s','mail_queue:save','exports'];(function(_0x151ec1,_0x5b66fb){var _0x266b45=function(_0xd5551f){while(--_0xd5551f){_0x151ec1['push'](_0x151ec1['shift']());}};_0x266b45(++_0x5b66fb);}(_0xeca8,0x1a4));var _0x8eca=function(_0x2916a9,_0x286f68){_0x2916a9=_0x2916a9-0x0;var _0x3fe995=_0xeca8[_0x2916a9];return _0x3fe995;};'use strict';var _=require(_0x8eca('0x0'));var md5=require(_0x8eca('0x1'));var util=require(_0x8eca('0x2'));var Redis=require(_0x8eca('0x3'));var config=require(_0x8eca('0x4'));config['redis']=_[_0x8eca('0x5')](config[_0x8eca('0x6')],{'host':_0x8eca('0x7'),'port':0x18eb});var io=require(_0x8eca('0x8'))(new Redis(config[_0x8eca('0x6')]));function MailQueue(_0x3bd99b){this['id']=_0x3bd99b['id']||0x0;this['name']=_0x3bd99b['name']||'';this[_0x8eca('0x9')]=_0x3bd99b[_0x8eca('0x9')]||0xa;this[_0x8eca('0xa')]=_0x3bd99b[_0x8eca('0xa')]||_0x8eca('0xb');this[_0x8eca('0xc')]=_0x3bd99b[_0x8eca('0xc')];this[_0x8eca('0xd')]={};this[_0x8eca('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue['prototype'][_0x8eca('0xf')]=function(){var _0x8c41c6=this[_0x8eca('0xd')][_0x8eca('0x10')];this[_0x8eca('0xd')]=_['map'](this[_0x8eca('0xc')],'id');this[_0x8eca('0xd')][_0x8eca('0x10')]=_0x8c41c6;};MailQueue[_0x8eca('0x11')]['updateRealtime']=function(){this[_0x8eca('0x12')]=0x0;this['paused']=0x0;for(var _0x373721=0x0;_0x373721=0x0?this[_0x8eca('0x17')]:0x0;var _0x53da17={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8eca('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x8eca('0xe')]};var _0x5bff8d=md5(JSON['stringify'](_0x53da17));if(this['md5']!==_0x5bff8d){this[_0x8eca('0x1')]=_0x5bff8d;io['to'](util[_0x8eca('0x18')](_0x8eca('0x19'),_0x53da17['name']))['emit'](_0x8eca('0x1a'),_0x53da17);}};module[_0x8eca('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 7568ad7..35d3ae9 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x2ecad4,_0x8dca5a){var _0x5b4a47=function(_0x5e21cc){while(--_0x5e21cc){_0x2ecad4['push'](_0x2ecad4['shift']());}};_0x5b4a47(++_0x8dca5a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x5fc3[_0x3d00db];return _0x41f115;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x2b2d5e,_0x6b7bee){_0x2b2d5e=_0x2b2d5e-0x0;var _0x12ec9a=_0x7a54[_0x2b2d5e];return _0x12ec9a;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 847ff7f..2ec7766 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 _0x34e8=['loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x34e8,0x12c));var _0x834e=function(_0x2a9d64,_0x4cab7e){_0x2a9d64=_0x2a9d64-0x0;var _0x53824d=_0x34e8[_0x2a9d64];return _0x53824d;};'use strict';var _=require(_0x834e('0x0'));var md5=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var Redis=require(_0x834e('0x3'));var config=require('../../../config/environment');config[_0x834e('0x4')]=_[_0x834e('0x5')](config[_0x834e('0x4')],{'host':_0x834e('0x6'),'port':0x18eb});var io=require(_0x834e('0x7'))(new Redis(config[_0x834e('0x4')]));function SmsQueue(_0x398bee){this['id']=_0x398bee['id']||0x0;this['name']=_0x398bee[_0x834e('0x8')]||'';this['timeout']=_0x398bee[_0x834e('0x9')]||0xa;this[_0x834e('0xa')]=_0x398bee[_0x834e('0xa')]||_0x834e('0xb');this[_0x834e('0xc')]=_0x398bee[_0x834e('0xc')];this[_0x834e('0xd')]={};this[_0x834e('0xe')]=0x0;this[_0x834e('0x1')]='';this[_0x834e('0xf')]();this[_0x834e('0x10')]();}SmsQueue[_0x834e('0x11')][_0x834e('0xf')]=function(){var _0x2e1a37=this[_0x834e('0xd')][_0x834e('0x12')];this[_0x834e('0xd')]=_['map'](this[_0x834e('0xc')],'id');this[_0x834e('0xd')]['_rr']=_0x2e1a37;};SmsQueue[_0x834e('0x11')][_0x834e('0x10')]=function(){this[_0x834e('0x13')]=0x0;this[_0x834e('0x14')]=0x0;for(var _0x50e860=0x0;_0x50e860=0x0?this[_0x834e('0x18')]:0x0;var _0x34e41a={'id':this['id'],'available':this[_0x834e('0x18')],'loggedIn':this[_0x834e('0x13')],'name':this[_0x834e('0x8')],'paused':this[_0x834e('0x14')],'waiting':this['waiting']};var _0x2545b4=md5(JSON[_0x834e('0x19')](_0x34e41a));if(this[_0x834e('0x1')]!==_0x2545b4){this[_0x834e('0x1')]=_0x2545b4;io['to'](util['format'](_0x834e('0x1a'),_0x34e41a[_0x834e('0x8')]))['emit'](_0x834e('0x1b'),_0x34e41a);}};module[_0x834e('0x1c')]=SmsQueue; \ No newline at end of file +var _0x50a6=['length','smsPause','available','stringify','format','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused'];(function(_0x8895e2,_0x2f151f){var _0x1ea4ab=function(_0x1521ad){while(--_0x1521ad){_0x8895e2['push'](_0x8895e2['shift']());}};_0x1ea4ab(++_0x2f151f);}(_0x50a6,0xa4));var _0x650a=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0x50a6[_0x558e45];return _0x3e9075;};'use strict';var _=require(_0x650a('0x0'));var md5=require(_0x650a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x650a('0x2'));config['redis']=_[_0x650a('0x3')](config[_0x650a('0x4')],{'host':_0x650a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x650a('0x4')]));function SmsQueue(_0x4c71f3){this['id']=_0x4c71f3['id']||0x0;this['name']=_0x4c71f3[_0x650a('0x6')]||'';this[_0x650a('0x7')]=_0x4c71f3[_0x650a('0x7')]||0xa;this[_0x650a('0x8')]=_0x4c71f3['strategy']||_0x650a('0x9');this['Agents']=_0x4c71f3[_0x650a('0xa')];this[_0x650a('0xb')]={};this['waiting']=0x0;this[_0x650a('0x1')]='';this[_0x650a('0xc')]();this['updateRealtime']();}SmsQueue[_0x650a('0xd')]['updateRouting']=function(){var _0x142cdb=this['mapAgentsId'][_0x650a('0xe')];this['mapAgentsId']=_[_0x650a('0xf')](this['Agents'],'id');this[_0x650a('0xb')][_0x650a('0xe')]=_0x142cdb;};SmsQueue[_0x650a('0xd')]['updateRealtime']=function(){this[_0x650a('0x10')]=0x0;this[_0x650a('0x11')]=0x0;for(var _0x2f727d=0x0;_0x2f727d=0x0?this[_0x650a('0x14')]:0x0;var _0x359314={'id':this['id'],'available':this[_0x650a('0x14')],'loggedIn':this[_0x650a('0x10')],'name':this[_0x650a('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0xf46674=md5(JSON[_0x650a('0x15')](_0x359314));if(this['md5']!==_0xf46674){this[_0x650a('0x1')]=_0xf46674;io['to'](util[_0x650a('0x16')]('sms:queue:%s',_0x359314[_0x650a('0x6')]))[_0x650a('0x17')](_0x650a('0x18'),_0x359314);}};module[_0x650a('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index fd008f9..77c491b 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 _0xf022=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','redis'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xf022,0xc1));var _0x2f02=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0xf022[_0x79cd47];return _0x3b9484;};'use strict';var _=require('lodash');var md5=require(_0x2f02('0x0'));var util=require('util');var Redis=require(_0x2f02('0x1'));var config=require('../../../config/environment');config[_0x2f02('0x2')]=_[_0x2f02('0x3')](config[_0x2f02('0x2')],{'host':_0x2f02('0x4'),'port':0x18eb});var io=require(_0x2f02('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x119f4a){this['id']=_0x119f4a['id']||0x0;this[_0x2f02('0x6')]=_0x119f4a[_0x2f02('0x6')]||'';this[_0x2f02('0x7')]=_0x119f4a['timeout']||0xa;this[_0x2f02('0x8')]=_0x119f4a['strategy']||_0x2f02('0x9');this['Agents']=_0x119f4a[_0x2f02('0xa')];this[_0x2f02('0xb')]={};this[_0x2f02('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x2f02('0xd')]();}WhatsappQueue[_0x2f02('0xe')]['updateRouting']=function(){var _0x23d727=this[_0x2f02('0xb')][_0x2f02('0xf')];this[_0x2f02('0xb')]=_[_0x2f02('0x10')](this[_0x2f02('0xa')],'id');this['mapAgentsId'][_0x2f02('0xf')]=_0x23d727;};WhatsappQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x2f02('0x11')]=0x0;for(var _0x36d9eb=0x0;_0x36d9eb=0x0?this[_0x2f02('0x15')]:0x0;var _0x41ae6e={'id':this['id'],'available':this[_0x2f02('0x15')],'loggedIn':this[_0x2f02('0x13')],'name':this[_0x2f02('0x6')],'paused':this[_0x2f02('0x11')],'waiting':this[_0x2f02('0xc')]};var _0x5d024e=md5(JSON[_0x2f02('0x16')](_0x41ae6e));if(this['md5']!==_0x5d024e){this['md5']=_0x5d024e;io['to'](util[_0x2f02('0x17')](_0x2f02('0x18'),_0x41ae6e[_0x2f02('0x6')]))[_0x2f02('0x19')](_0x2f02('0x1a'),_0x41ae6e);}};module[_0x2f02('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x9177=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x1f6691,_0x3a3d46){var _0xf786b6=function(_0x2afbdb){while(--_0x2afbdb){_0x1f6691['push'](_0x1f6691['shift']());}};_0xf786b6(++_0x3a3d46);}(_0x9177,0x9c));var _0x7917=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9177[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7917('0x0'));var md5=require(_0x7917('0x1'));var util=require('util');var Redis=require(_0x7917('0x2'));var config=require('../../../config/environment');config[_0x7917('0x3')]=_[_0x7917('0x4')](config[_0x7917('0x3')],{'host':_0x7917('0x5'),'port':0x18eb});var io=require(_0x7917('0x6'))(new Redis(config[_0x7917('0x3')]));function WhatsappQueue(_0x3cca1a){this['id']=_0x3cca1a['id']||0x0;this[_0x7917('0x7')]=_0x3cca1a[_0x7917('0x7')]||'';this[_0x7917('0x8')]=_0x3cca1a['timeout']||0xa;this[_0x7917('0x9')]=_0x3cca1a[_0x7917('0x9')]||_0x7917('0xa');this[_0x7917('0xb')]=_0x3cca1a[_0x7917('0xb')];this[_0x7917('0xc')]={};this[_0x7917('0xd')]=0x0;this[_0x7917('0x1')]='';this[_0x7917('0xe')]();this[_0x7917('0xf')]();}WhatsappQueue[_0x7917('0x10')][_0x7917('0xe')]=function(){var _0x15dff4=this[_0x7917('0xc')][_0x7917('0x11')];this[_0x7917('0xc')]=_['map'](this['Agents'],'id');this[_0x7917('0xc')]['_rr']=_0x15dff4;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x7917('0x12')]=0x0;this[_0x7917('0x13')]=0x0;for(var _0x2cbdb1=0x0;_0x2cbdb1=0x0?this[_0x7917('0x17')]:0x0;var _0x152f13={'id':this['id'],'available':this[_0x7917('0x17')],'loggedIn':this[_0x7917('0x12')],'name':this[_0x7917('0x7')],'paused':this[_0x7917('0x13')],'waiting':this['waiting']};var _0x55128a=md5(JSON[_0x7917('0x18')](_0x152f13));if(this[_0x7917('0x1')]!==_0x55128a){this[_0x7917('0x1')]=_0x55128a;io['to'](util[_0x7917('0x19')]('whatsapp:queue:%s',_0x152f13['name']))['emit'](_0x7917('0x1a'),_0x152f13);}};module[_0x7917('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d0b1652..d3935ee 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(_0x45996c,_0x1894ba){var _0x5c7e7f=function(_0x5a3c92){while(--_0x5a3c92){_0x45996c['push'](_0x45996c['shift']());}};_0x5c7e7f(++_0x1894ba);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f109c,_0xd9952e){_0x1f109c=_0x1f109c-0x0;var _0x3984e8=_0xb10b[_0x1f109c];return _0x3984e8;};'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 _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(_0x1d591e,_0x3067e4){var _0x773cee=function(_0x174f50){while(--_0x174f50){_0x1d591e['push'](_0x1d591e['shift']());}};_0x773cee(++_0x3067e4);}(_0xb10b,0x12a));var _0xbb10=function(_0x295a5c,_0xfd0b5){_0x295a5c=_0x295a5c-0x0;var _0x53339e=_0xb10b[_0x295a5c];return _0x53339e;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 874a13e..987b93e 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 _0xebd5=['updateChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x521c69,_0x5505e0){var _0x22a54b=function(_0x376f6a){while(--_0x376f6a){_0x521c69['push'](_0x521c69['shift']());}};_0x22a54b(++_0x5505e0);}(_0xebd5,0xbb));var _0x5ebd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xebd5[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x5ebd('0x0'));exports[_0x5ebd('0x1')]=function(_0x48e159,_0x6a969d){return client[_0x5ebd('0x2')]('UpdateChatInteraction',{'body':_0x6a969d,'options':{'where':{'id':_0x48e159}},'log':_0x5ebd('0x3')});};exports['addTags']=function(_0x441101,_0xbd174d){return client[_0x5ebd('0x2')]('AddTagsToChatInteraction',{'body':_0xbd174d,'options':{'where':{'id':_0x441101}},'log':_0x5ebd('0x4')});}; \ No newline at end of file +var _0x6274=['update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3763da,_0x58158b){var _0x5d192f=function(_0x329668){while(--_0x329668){_0x3763da['push'](_0x3763da['shift']());}};_0x5d192f(++_0x58158b);}(_0x6274,0x1ae));var _0x4627=function(_0x193de4,_0x18ec1d){_0x193de4=_0x193de4-0x0;var _0x1ecc13=_0x6274[_0x193de4];return _0x1ecc13;};'use strict';var client=require('../client');exports[_0x4627('0x0')]=function(_0xf45d75,_0x4b44fe){return client[_0x4627('0x1')]('UpdateChatInteraction',{'body':_0x4b44fe,'options':{'where':{'id':_0xf45d75}},'log':'updateChatInteraction'});};exports[_0x4627('0x2')]=function(_0x4ac5cc,_0x3e11ad){return client['Request'](_0x4627('0x3'),{'body':_0x3e11ad,'options':{'where':{'id':_0x4ac5cc}},'log':_0x4627('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 60ef4e0..ec83e15 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 _0x23f3=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x13d5ca,_0x3ccd00){var _0x53bc8e=function(_0x505738){while(--_0x505738){_0x13d5ca['push'](_0x13d5ca['shift']());}};_0x53bc8e(++_0x3ccd00);}(_0x23f3,0xbf));var _0x323f=function(_0x3be514,_0x21013b){_0x3be514=_0x3be514-0x0;var _0x2e3940=_0x23f3[_0x3be514];return _0x2e3940;};'use strict';var client=require(_0x323f('0x0'));exports[_0x323f('0x1')]=function(_0x1ce5fa){return client[_0x323f('0x2')](_0x323f('0x3'),{'body':_0x1ce5fa,'log':_0x323f('0x4')});}; \ No newline at end of file +var _0x790c=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x3c7372,_0x508ec8){var _0x3ae223=function(_0x87b22f){while(--_0x87b22f){_0x3c7372['push'](_0x3c7372['shift']());}};_0x3ae223(++_0x508ec8);}(_0x790c,0xf6));var _0xc790=function(_0xcb4cb2,_0x1fa1a3){_0xcb4cb2=_0xcb4cb2-0x0;var _0x24c2f0=_0x790c[_0xcb4cb2];return _0x24c2f0;};'use strict';var client=require(_0xc790('0x0'));exports[_0xc790('0x1')]=function(_0x59882b){return client['Request'](_0xc790('0x2'),{'body':_0x59882b,'log':_0xc790('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 001e235..4c91e23 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 _0x98a8=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online','chatPause'];(function(_0xc2c13a,_0x1070d3){var _0x2b8e2f=function(_0x3ebc15){while(--_0x3ebc15){_0xc2c13a['push'](_0xc2c13a['shift']());}};_0x2b8e2f(++_0x1070d3);}(_0x98a8,0x12c));var _0x898a=function(_0x22a4c1,_0x20ab45){_0x22a4c1=_0x22a4c1-0x0;var _0x4aef82=_0x98a8[_0x22a4c1];return _0x4aef82;};'use strict';var client=require(_0x898a('0x0'));exports[_0x898a('0x1')]=function(){return function(){return client[_0x898a('0x2')](_0x898a('0x3'),{'options':{'raw':![],'attributes':['id',_0x898a('0x4'),_0x898a('0x5'),_0x898a('0x6')],'include':[{'model':'User','as':_0x898a('0x7'),'attributes':['id',_0x898a('0x4'),_0x898a('0x8'),_0x898a('0x9')]}]},'log':_0x898a('0x1')});};}; \ No newline at end of file +var _0x39c7=['name','timeout','strategy','Agents','online','getChatQueues','Request','GetChatQueue'];(function(_0x37dabc,_0x535df6){var _0x1641aa=function(_0x3e7854){while(--_0x3e7854){_0x37dabc['push'](_0x37dabc['shift']());}};_0x1641aa(++_0x535df6);}(_0x39c7,0x85));var _0x739c=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x39c7[_0x40f9a0];return _0x3e3144;};'use strict';var client=require('../client');exports[_0x739c('0x0')]=function(){return function(){return client[_0x739c('0x1')](_0x739c('0x2'),{'options':{'raw':![],'attributes':['id',_0x739c('0x3'),_0x739c('0x4'),_0x739c('0x5')],'include':[{'model':'User','as':_0x739c('0x6'),'attributes':['id',_0x739c('0x3'),_0x739c('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6abf314..698a030 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 _0x5bbd=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd5bb('0x0'));exports[_0xd5bb('0x1')]=function(_0x427a12){return client[_0xd5bb('0x2')](_0xd5bb('0x3'),{'body':_0x427a12,'log':_0xd5bb('0x3')});};exports[_0xd5bb('0x4')]=function(_0x480517,_0x5db64a){return client['Request'](_0xd5bb('0x5'),{'body':_0x5db64a,'options':{'where':{'uniqueid':_0x480517},'order':[['id',_0xd5bb('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x851e=['CreateChatQueueReport','update','Request','DESC','UpdateChatQueueReport','../client','create'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x851e,0x1e8));var _0xe851=function(_0x55ebbc,_0x1cdbe3){_0x55ebbc=_0x55ebbc-0x0;var _0x1d93d4=_0x851e[_0x55ebbc];return _0x1d93d4;};'use strict';var client=require(_0xe851('0x0'));exports[_0xe851('0x1')]=function(_0x2bc74b){return client['Request']('CreateChatQueueReport',{'body':_0x2bc74b,'log':_0xe851('0x2')});};exports[_0xe851('0x3')]=function(_0x16b38a,_0x326b34){return client[_0xe851('0x4')]('UpdateChatQueueReport',{'body':_0x326b34,'options':{'where':{'uniqueid':_0x16b38a},'order':[['id',_0xe851('0x5')]],'limit':0x1},'log':_0xe851('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 022f289..ee12d9d 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(_0x5dfd5d,_0x2ea31c){var _0xff48de=function(_0x291ac0){while(--_0x291ac0){_0x5dfd5d['push'](_0x5dfd5d['shift']());}};_0xff48de(++_0x2ea31c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xbe422a,_0x19d055){var _0x42069d=function(_0x3f435f){while(--_0x3f435f){_0xbe422a['push'](_0xbe422a['shift']());}};_0x42069d(++_0x19d055);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index dbacffe..a1ed095 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 _0xc00c=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc00c,0x1af));var _0xcc00=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xc00c[_0x87b0ff];return _0x3bc0b2;};'use strict';var client=require(_0xcc00('0x0'));exports['create']=function(_0x5c6490){return client[_0xcc00('0x1')](_0xcc00('0x2'),{'body':_0x5c6490,'log':_0xcc00('0x3')});}; \ No newline at end of file +var _0x10d8=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x10d8,0x110));var _0x810d=function(_0x5ab934,_0x2de2be){_0x5ab934=_0x5ab934-0x0;var _0x546dc=_0x10d8[_0x5ab934];return _0x546dc;};'use strict';var client=require(_0x810d('0x0'));exports[_0x810d('0x1')]=function(_0x2c1291){return client['Request'](_0x810d('0x2'),{'body':_0x2c1291,'log':_0x810d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 06bc0e8..45f757d 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 _0xde39=['name','online','../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User','Agents'];(function(_0x475746,_0x531ca4){var _0x48e889=function(_0x10a037){while(--_0x10a037){_0x475746['push'](_0x475746['shift']());}};_0x48e889(++_0x531ca4);}(_0xde39,0x1e2));var _0x9de3=function(_0x424ebf,_0x4c64d3){_0x424ebf=_0x424ebf-0x0;var _0x4c6aef=_0xde39[_0x424ebf];return _0x4c6aef;};'use strict';var client=require(_0x9de3('0x0'));exports[_0x9de3('0x1')]=function(){return function(){return client[_0x9de3('0x2')](_0x9de3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9de3('0x4'),_0x9de3('0x5')],'include':[{'model':_0x9de3('0x6'),'as':_0x9de3('0x7'),'attributes':['id',_0x9de3('0x8'),_0x9de3('0x9'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x29f3=['name','timeout','User','Agents','online','faxPause','../client','GetFaxQueue'];(function(_0x4f9673,_0x4313bd){var _0x337e5e=function(_0x5677cf){while(--_0x5677cf){_0x4f9673['push'](_0x4f9673['shift']());}};_0x337e5e(++_0x4313bd);}(_0x29f3,0x1de));var _0x329f=function(_0x19ca91,_0x15391e){_0x19ca91=_0x19ca91-0x0;var _0x469aa3=_0x29f3[_0x19ca91];return _0x469aa3;};'use strict';var client=require(_0x329f('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x329f('0x1'),{'options':{'raw':![],'attributes':['id',_0x329f('0x2'),_0x329f('0x3'),'strategy'],'include':[{'model':_0x329f('0x4'),'as':_0x329f('0x5'),'attributes':['id',_0x329f('0x2'),_0x329f('0x6'),_0x329f('0x7')]}]},'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 2dbcae7..a3a52f5 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 _0xb050=['update','Request','DESC','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport'];(function(_0x22246f,_0x3b6493){var _0x5a1439=function(_0x5c672e){while(--_0x5c672e){_0x22246f['push'](_0x22246f['shift']());}};_0x5a1439(++_0x3b6493);}(_0xb050,0xac));var _0x0b05=function(_0x9bf74,_0xae6604){_0x9bf74=_0x9bf74-0x0;var _0x135f42=_0xb050[_0x9bf74];return _0x135f42;};'use strict';var client=require(_0x0b05('0x0'));exports[_0x0b05('0x1')]=function(_0xce3675){return client['Request'](_0x0b05('0x2'),{'body':_0xce3675,'log':_0x0b05('0x2')});};exports[_0x0b05('0x3')]=function(_0x3d3f2d,_0x5c56cf){return client[_0x0b05('0x4')]('UpdateFaxQueueReport',{'body':_0x5c56cf,'options':{'where':{'uniqueid':_0x3d3f2d},'order':[['id',_0x0b05('0x5')]],'limit':0x1},'log':_0x0b05('0x6')});}; \ No newline at end of file +var _0x38f1=['Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x38f1,0xd5));var _0x138f=function(_0x587dc0,_0x2a409f){_0x587dc0=_0x587dc0-0x0;var _0x4abb3e=_0x38f1[_0x587dc0];return _0x4abb3e;};'use strict';var client=require(_0x138f('0x0'));exports[_0x138f('0x1')]=function(_0x4f7e2f){return client['Request']('CreateFaxQueueReport',{'body':_0x4f7e2f,'log':_0x138f('0x2')});};exports['update']=function(_0x4b07a7,_0x4223fe){return client[_0x138f('0x3')](_0x138f('0x4'),{'body':_0x4223fe,'options':{'where':{'uniqueid':_0x4b07a7},'order':[['id',_0x138f('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f8e69d8..b1b6dab 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 _0xc0b8=['../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0xd62042,_0x38fb3a){var _0x56cf31=function(_0x396939){while(--_0x396939){_0xd62042['push'](_0xd62042['shift']());}};_0x56cf31(++_0x38fb3a);}(_0xc0b8,0x78));var _0x8c0b=function(_0x1add46,_0x3e50b3){_0x1add46=_0x1add46-0x0;var _0x115b57=_0xc0b8[_0x1add46];return _0x115b57;};'use strict';var client=require(_0x8c0b('0x0'));exports[_0x8c0b('0x1')]=function(){return function(){return client[_0x8c0b('0x2')](_0x8c0b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8c0b('0x4')],'include':[{'model':_0x8c0b('0x5'),'as':'Intervals','attributes':['id','name','interval']}]},'log':_0x8c0b('0x1')});};}; \ No newline at end of file +var _0x14ce=['Request','GetInterval','name','interval','../client','getIntervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14ce,0xe8));var _0xe14c=function(_0x1fac50,_0x27270e){_0x1fac50=_0x1fac50-0x0;var _0xf7e03e=_0x14ce[_0x1fac50];return _0xf7e03e;};'use strict';var client=require(_0xe14c('0x0'));exports[_0xe14c('0x1')]=function(){return function(){return client[_0xe14c('0x2')](_0xe14c('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe14c('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xe14c('0x4'),_0xe14c('0x5')]}]},'log':_0xe14c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1ce366e..83972c2 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 _0x1eba=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x1eba[_0x11e30d];return _0x2d4e29;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(_0x406a58,_0x2158d5){return client[_0xa1eb('0x2')]('UpdateMailInteraction',{'body':_0x2158d5,'options':{'where':{'id':_0x406a58}},'log':'updateMailInteraction'});};exports[_0xa1eb('0x3')]=function(_0x34be5a,_0x16a13a){return client[_0xa1eb('0x2')](_0xa1eb('0x4'),{'body':_0x16a13a,'options':{'where':{'id':_0x34be5a}},'log':_0xa1eb('0x5')});}; \ No newline at end of file +var _0xd824=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xd824,0xc2));var _0x4d82=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd824[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x4d82('0x0'));exports[_0x4d82('0x1')]=function(_0x572eea,_0x53fe9a){return client[_0x4d82('0x2')](_0x4d82('0x3'),{'body':_0x53fe9a,'options':{'where':{'id':_0x572eea}},'log':_0x4d82('0x4')});};exports[_0x4d82('0x5')]=function(_0x287fbf,_0x1c8ad9){return client['Request']('AddTagsToMailInteraction',{'body':_0x1c8ad9,'options':{'where':{'id':_0x287fbf}},'log':_0x4d82('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1ded591..4ea9616 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 _0xf1db=['../client','create','CreateMailMessage'];(function(_0x899a7b,_0x47f3fe){var _0x501574=function(_0x721be2){while(--_0x721be2){_0x899a7b['push'](_0x899a7b['shift']());}};_0x501574(++_0x47f3fe);}(_0xf1db,0x15f));var _0xbf1d=function(_0x471912,_0x195ace){_0x471912=_0x471912-0x0;var _0x173049=_0xf1db[_0x471912];return _0x173049;};'use strict';var client=require(_0xbf1d('0x0'));exports[_0xbf1d('0x1')]=function(_0x3acd30){return client['Request'](_0xbf1d('0x2'),{'body':_0x3acd30,'log':'createMailMessage'});}; \ No newline at end of file +var _0x485a=['createMailMessage','../client','create','Request'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x485a,0x13d));var _0xa485=function(_0xb61065,_0x159992){_0xb61065=_0xb61065-0x0;var _0x3f3fcb=_0x485a[_0xb61065];return _0x3f3fcb;};'use strict';var client=require(_0xa485('0x0'));exports[_0xa485('0x1')]=function(_0x246771){return client[_0xa485('0x2')]('CreateMailMessage',{'body':_0x246771,'log':_0xa485('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9750ea5..4255957 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 _0xa938=['User','Agents','name','online','mailPause','../client','getMailQueues','Request','timeout','strategy'];(function(_0x3605ba,_0x239ece){var _0x143e38=function(_0x64be55){while(--_0x64be55){_0x3605ba['push'](_0x3605ba['shift']());}};_0x143e38(++_0x239ece);}(_0xa938,0x127));var _0x8a93=function(_0x1e3d06,_0x4b17d6){_0x1e3d06=_0x1e3d06-0x0;var _0x1f4eb7=_0xa938[_0x1e3d06];return _0x1f4eb7;};'use strict';var client=require(_0x8a93('0x0'));exports[_0x8a93('0x1')]=function(){return function(){return client[_0x8a93('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x8a93('0x3'),_0x8a93('0x4')],'include':[{'model':_0x8a93('0x5'),'as':_0x8a93('0x6'),'attributes':['id',_0x8a93('0x7'),_0x8a93('0x8'),_0x8a93('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x4ccc=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents','mailPause'];(function(_0x17c94d,_0x2f67d5){var _0x3567f8=function(_0x1843dd){while(--_0x1843dd){_0x17c94d['push'](_0x17c94d['shift']());}};_0x3567f8(++_0x2f67d5);}(_0x4ccc,0x70));var _0xc4cc=function(_0x447e7c,_0x413259){_0x447e7c=_0x447e7c-0x0;var _0x2d7330=_0x4ccc[_0x447e7c];return _0x2d7330;};'use strict';var client=require('../client');exports[_0xc4cc('0x0')]=function(){return function(){return client[_0xc4cc('0x1')](_0xc4cc('0x2'),{'options':{'raw':![],'attributes':['id',_0xc4cc('0x3'),_0xc4cc('0x4'),_0xc4cc('0x5')],'include':[{'model':'User','as':_0xc4cc('0x6'),'attributes':['id',_0xc4cc('0x3'),'online',_0xc4cc('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index ba8513b..00e616c 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 _0x2efa=['Request','CreateMailQueueReport','DESC','../client','create'];(function(_0xab0649,_0x30623a){var _0x4f3b3f=function(_0x41ff12){while(--_0x41ff12){_0xab0649['push'](_0xab0649['shift']());}};_0x4f3b3f(++_0x30623a);}(_0x2efa,0x189));var _0xa2ef=function(_0x51e64a,_0xcf37c5){_0x51e64a=_0x51e64a-0x0;var _0x44b648=_0x2efa[_0x51e64a];return _0x44b648;};'use strict';var client=require(_0xa2ef('0x0'));exports[_0xa2ef('0x1')]=function(_0x228bf0){return client[_0xa2ef('0x2')](_0xa2ef('0x3'),{'body':_0x228bf0,'log':_0xa2ef('0x3')});};exports['update']=function(_0x2b5d95,_0x36f77a){return client[_0xa2ef('0x2')]('UpdateMailQueueReport',{'body':_0x36f77a,'options':{'where':{'uniqueid':_0x2b5d95},'order':[['id',_0xa2ef('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xb9fd=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb9fd,0x125));var _0xdb9f=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0xb9fd[_0x56ba92];return _0x8fe94d;};'use strict';var client=require(_0xdb9f('0x0'));exports[_0xdb9f('0x1')]=function(_0x4bdb87){return client[_0xdb9f('0x2')](_0xdb9f('0x3'),{'body':_0x4bdb87,'log':_0xdb9f('0x3')});};exports[_0xdb9f('0x4')]=function(_0x44c3c0,_0x504415){return client[_0xdb9f('0x2')](_0xdb9f('0x5'),{'body':_0x504415,'options':{'where':{'uniqueid':_0x44c3c0},'order':[['id',_0xdb9f('0x6')]],'limit':0x1},'log':_0xdb9f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8f98cc7..7ab8827 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 _0xad99=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x299238,_0x1e3d97){var _0x4e131=function(_0x500ec7){while(--_0x500ec7){_0x299238['push'](_0x299238['shift']());}};_0x4e131(++_0x1e3d97);}(_0xad99,0x6c));var _0x9ad9=function(_0x5d3e8e,_0x87f38a){_0x5d3e8e=_0x5d3e8e-0x0;var _0x3b9c6c=_0xad99[_0x5d3e8e];return _0x3b9c6c;};'use strict';var client=require(_0x9ad9('0x0'));exports[_0x9ad9('0x1')]=function(_0x3b4911,_0x122006){return client[_0x9ad9('0x2')](_0x9ad9('0x3'),{'body':_0x122006,'options':{'where':{'id':_0x3b4911}},'log':_0x9ad9('0x4')});};exports['addTags']=function(_0x2a147c,_0x2f9455){return client[_0x9ad9('0x2')](_0x9ad9('0x5'),{'body':_0x2f9455,'options':{'where':{'id':_0x2a147c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xfcf7=['update','Request','updateOpenchannelInteraction','addTags','../client'];(function(_0x36a4c5,_0xeccf59){var _0x4abf8b=function(_0x104eb9){while(--_0x104eb9){_0x36a4c5['push'](_0x36a4c5['shift']());}};_0x4abf8b(++_0xeccf59);}(_0xfcf7,0x7c));var _0x7fcf=function(_0x44c0ed,_0x22bf6d){_0x44c0ed=_0x44c0ed-0x0;var _0x2cb361=_0xfcf7[_0x44c0ed];return _0x2cb361;};'use strict';var client=require(_0x7fcf('0x0'));exports[_0x7fcf('0x1')]=function(_0x4a5d93,_0xef9629){return client[_0x7fcf('0x2')]('UpdateOpenchannelInteraction',{'body':_0xef9629,'options':{'where':{'id':_0x4a5d93}},'log':_0x7fcf('0x3')});};exports[_0x7fcf('0x4')]=function(_0xa64263,_0x3bd895){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x3bd895,'options':{'where':{'id':_0xa64263}},'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 2aa8c9c..1e30d59 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 _0x713f=['createOpenchannelMessage'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x713f,0x1a0));var _0xf713=function(_0x232181,_0x3aee98){_0x232181=_0x232181-0x0;var _0x19af37=_0x713f[_0x232181];return _0x19af37;};'use strict';var client=require('../client');exports['create']=function(_0x46daf1){return client['Request']('CreateOpenchannelMessage',{'body':_0x46daf1,'log':_0xf713('0x0')});}; \ No newline at end of file +var _0x9af3=['../client','create','Request'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x9af3,0xde));var _0x39af=function(_0x32bbee,_0x140905){_0x32bbee=_0x32bbee-0x0;var _0x178ee1=_0x9af3[_0x32bbee];return _0x178ee1;};'use strict';var client=require(_0x39af('0x0'));exports[_0x39af('0x1')]=function(_0x3b359a){return client[_0x39af('0x2')]('CreateOpenchannelMessage',{'body':_0x3b359a,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f896802..2bf5d75 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 _0xc92f=['getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x24c3a4,_0x569598){var _0x1b0925=function(_0x545f48){while(--_0x545f48){_0x24c3a4['push'](_0x24c3a4['shift']());}};_0x1b0925(++_0x569598);}(_0xc92f,0x140));var _0xfc92=function(_0x5a2b40,_0x1864b3){_0x5a2b40=_0x5a2b40-0x0;var _0x2cf8dd=_0xc92f[_0x5a2b40];return _0x2cf8dd;};'use strict';var client=require('../client');exports[_0xfc92('0x0')]=function(){return function(){return client['Request'](_0xfc92('0x1'),{'options':{'raw':![],'attributes':['id',_0xfc92('0x2'),_0xfc92('0x3'),_0xfc92('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xfc92('0x2'),'online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x7129=['openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','Agents','online'];(function(_0xa9626e,_0x2cdc47){var _0x101b63=function(_0x4ae9c5){while(--_0x4ae9c5){_0xa9626e['push'](_0xa9626e['shift']());}};_0x101b63(++_0x2cdc47);}(_0x7129,0x99));var _0x9712=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7129[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0x9712('0x0')]=function(){return function(){return client[_0x9712('0x1')](_0x9712('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9712('0x3'),_0x9712('0x4')],'include':[{'model':'User','as':_0x9712('0x5'),'attributes':['id','name',_0x9712('0x6'),_0x9712('0x7')]}]},'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 88467fb..af4c66c 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 _0x2948=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client'];(function(_0x2377b3,_0x45931e){var _0x336f9c=function(_0xaf8292){while(--_0xaf8292){_0x2377b3['push'](_0x2377b3['shift']());}};_0x336f9c(++_0x45931e);}(_0x2948,0xcb));var _0x8294=function(_0x2f8e1a,_0x194a87){_0x2f8e1a=_0x2f8e1a-0x0;var _0x447c76=_0x2948[_0x2f8e1a];return _0x447c76;};'use strict';var client=require(_0x8294('0x0'));exports[_0x8294('0x1')]=function(_0x23954c){return client[_0x8294('0x2')](_0x8294('0x3'),{'body':_0x23954c,'log':_0x8294('0x3')});};exports[_0x8294('0x4')]=function(_0x2209e9,_0x3ac253){return client['Request'](_0x8294('0x5'),{'body':_0x3ac253,'options':{'where':{'uniqueid':_0x2209e9},'order':[['id','DESC']],'limit':0x1},'log':_0x8294('0x5')});}; \ No newline at end of file +var _0x476e=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0xdeb8db,_0x3eead0){var _0x172e77=function(_0x15c037){while(--_0x15c037){_0xdeb8db['push'](_0xdeb8db['shift']());}};_0x172e77(++_0x3eead0);}(_0x476e,0x73));var _0xe476=function(_0x273684,_0x3fed43){_0x273684=_0x273684-0x0;var _0x1b7c49=_0x476e[_0x273684];return _0x1b7c49;};'use strict';var client=require(_0xe476('0x0'));exports[_0xe476('0x1')]=function(_0x189e94){return client[_0xe476('0x2')](_0xe476('0x3'),{'body':_0x189e94,'log':_0xe476('0x3')});};exports['update']=function(_0x15522f,_0xfd32c8){return client[_0xe476('0x2')](_0xe476('0x4'),{'body':_0xfd32c8,'options':{'where':{'uniqueid':_0x15522f},'order':[['id','DESC']],'limit':0x1},'log':_0xe476('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ac97bab..a89520c 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 _0x8819=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','Request','UpdateSmsInteraction'];(function(_0x3bf1d9,_0x45314a){var _0x36ea8d=function(_0x1942cb){while(--_0x1942cb){_0x3bf1d9['push'](_0x3bf1d9['shift']());}};_0x36ea8d(++_0x45314a);}(_0x8819,0x94));var _0x9881=function(_0x29fdf2,_0x4960f7){_0x29fdf2=_0x29fdf2-0x0;var _0x446c75=_0x8819[_0x29fdf2];return _0x446c75;};'use strict';var client=require('../client');exports['update']=function(_0xcb0cf3,_0x27a509){return client[_0x9881('0x0')](_0x9881('0x1'),{'body':_0x27a509,'options':{'where':{'id':_0xcb0cf3}},'log':_0x9881('0x2')});};exports['addTags']=function(_0x333d6f,_0x446deb){return client[_0x9881('0x0')](_0x9881('0x3'),{'body':_0x446deb,'options':{'where':{'id':_0x333d6f}},'log':_0x9881('0x4')});}; \ No newline at end of file +var _0x7c49=['update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0xd5a4a0,_0x2cd5e7){var _0x36fdc8=function(_0x1ae622){while(--_0x1ae622){_0xd5a4a0['push'](_0xd5a4a0['shift']());}};_0x36fdc8(++_0x2cd5e7);}(_0x7c49,0x141));var _0x97c4=function(_0x19a3bf,_0x1acf91){_0x19a3bf=_0x19a3bf-0x0;var _0x38f7a1=_0x7c49[_0x19a3bf];return _0x38f7a1;};'use strict';var client=require(_0x97c4('0x0'));exports[_0x97c4('0x1')]=function(_0x51e582,_0x4e27ed){return client[_0x97c4('0x2')]('UpdateSmsInteraction',{'body':_0x4e27ed,'options':{'where':{'id':_0x51e582}},'log':_0x97c4('0x3')});};exports[_0x97c4('0x4')]=function(_0x5e3808,_0x596686){return client[_0x97c4('0x2')](_0x97c4('0x5'),{'body':_0x596686,'options':{'where':{'id':_0x5e3808}},'log':_0x97c4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 28d6bbe..53c62d8 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 _0x4f09=['create','CreateSmsMessage','../client'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x4f09,0x1a9));var _0x94f0=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0x4f09[_0x51f4fc];return _0x4d96fc;};'use strict';var client=require(_0x94f0('0x0'));exports[_0x94f0('0x1')]=function(_0x4b95e4){return client['Request'](_0x94f0('0x2'),{'body':_0x4b95e4,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x52ca=['createSmsMessage','create','CreateSmsMessage'];(function(_0x3e29c4,_0x304e09){var _0x4d7c15=function(_0x1bd430){while(--_0x1bd430){_0x3e29c4['push'](_0x3e29c4['shift']());}};_0x4d7c15(++_0x304e09);}(_0x52ca,0x6d));var _0xa52c=function(_0x1ee779,_0x15d390){_0x1ee779=_0x1ee779-0x0;var _0x1b6486=_0x52ca[_0x1ee779];return _0x1b6486;};'use strict';var client=require('../client');exports[_0xa52c('0x0')]=function(_0x45c747){return client['Request'](_0xa52c('0x1'),{'body':_0x45c747,'log':_0xa52c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index faec8dd..5db2656 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x549b29,_0x2e2b00){var _0x2b813f=function(_0x43234f){while(--_0x43234f){_0x549b29['push'](_0x549b29['shift']());}};_0x2b813f(++_0x2e2b00);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_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 80455af..69a4516 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xedd9,0xfc));var _0x9edd=function(_0x25516d,_0x9fcf7f){_0x25516d=_0x25516d-0x0;var _0x59441a=_0xedd9[_0x25516d];return _0x59441a;};'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 +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2e8ee9,_0x5ed256){var _0x3c15f6=function(_0x5d499d){while(--_0x5d499d){_0x2e8ee9['push'](_0x2e8ee9['shift']());}};_0x3c15f6(++_0x5ed256);}(_0x008c,0x188));var _0xc008=function(_0x2cb122,_0x5684a0){_0x2cb122=_0x2cb122-0x0;var _0x21af56=_0x008c[_0x2cb122];return _0x21af56;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e33c36e..04fe04c 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(_0xc8c07f,_0x2e9dfe){var _0x555e15=function(_0x477dd1){while(--_0x477dd1){_0xc8c07f['push'](_0xc8c07f['shift']());}};_0x555e15(++_0x2e9dfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x532fd8,_0x8ba95f){var _0x5702b1=function(_0x56c8bc){while(--_0x56c8bc){_0x532fd8['push'](_0x532fd8['shift']());}};_0x5702b1(++_0x8ba95f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'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 f7f58bf..329a302 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 _0xabce=['update','Request','addTags','addTagsToWhatsappInteraction','../client'];(function(_0x188c88,_0x210793){var _0x4e4c38=function(_0x3d9e41){while(--_0x3d9e41){_0x188c88['push'](_0x188c88['shift']());}};_0x4e4c38(++_0x210793);}(_0xabce,0x103));var _0xeabc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xabce[_0x5b78e8];return _0xf2c321;};'use strict';var client=require(_0xeabc('0x0'));exports[_0xeabc('0x1')]=function(_0x357cda,_0x572221){return client[_0xeabc('0x2')]('UpdateWhatsappInteraction',{'body':_0x572221,'options':{'where':{'id':_0x357cda}},'log':'updateWhatsappInteraction'});};exports[_0xeabc('0x3')]=function(_0x1d9f37,_0x1a88a7){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x1a88a7,'options':{'where':{'id':_0x1d9f37}},'log':_0xeabc('0x4')});}; \ No newline at end of file +var _0x5e0e=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0x5e0e,0x89));var _0xe5e0=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x5e0e[_0x817d9b];return _0x2752e1;};'use strict';var client=require(_0xe5e0('0x0'));exports[_0xe5e0('0x1')]=function(_0x54701a,_0x11c42f){return client[_0xe5e0('0x2')](_0xe5e0('0x3'),{'body':_0x11c42f,'options':{'where':{'id':_0x54701a}},'log':_0xe5e0('0x4')});};exports[_0xe5e0('0x5')]=function(_0x5d2107,_0x22cd07){return client['Request'](_0xe5e0('0x6'),{'body':_0x22cd07,'options':{'where':{'id':_0x5d2107}},'log':_0xe5e0('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index e6691fc..a148c8c 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 _0x320a=['createWhatsappMessage','create','Request'];(function(_0x431dfa,_0x1e95d2){var _0x5055a3=function(_0x507e4b){while(--_0x507e4b){_0x431dfa['push'](_0x431dfa['shift']());}};_0x5055a3(++_0x1e95d2);}(_0x320a,0x1b7));var _0xa320=function(_0x593766,_0x4ba3a8){_0x593766=_0x593766-0x0;var _0x435a13=_0x320a[_0x593766];return _0x435a13;};'use strict';var client=require('../client');exports[_0xa320('0x0')]=function(_0x5940dd){return client[_0xa320('0x1')]('CreateWhatsappMessage',{'body':_0x5940dd,'log':_0xa320('0x2')});}; \ No newline at end of file +var _0xc7b1=['Request','CreateWhatsappMessage','createWhatsappMessage','create'];(function(_0x3a8ce2,_0x552ad5){var _0x2e5a45=function(_0x5de5ed){while(--_0x5de5ed){_0x3a8ce2['push'](_0x3a8ce2['shift']());}};_0x2e5a45(++_0x552ad5);}(_0xc7b1,0x17f));var _0x1c7b=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0xc7b1[_0x10791d];return _0x1b4f9c;};'use strict';var client=require('../client');exports[_0x1c7b('0x0')]=function(_0x596711){return client[_0x1c7b('0x1')](_0x1c7b('0x2'),{'body':_0x596711,'log':_0x1c7b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3744439..2a7f970 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 _0x9444=['getWhatsappQueues','Request','User','Agents','online','whatsappPause','../client'];(function(_0x598644,_0x4a8d79){var _0x128fbf=function(_0x4f54d3){while(--_0x4f54d3){_0x598644['push'](_0x598644['shift']());}};_0x128fbf(++_0x4a8d79);}(_0x9444,0x99));var _0x4944=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x9444[_0x644560];return _0x41b76b;};'use strict';var client=require(_0x4944('0x0'));exports[_0x4944('0x1')]=function(){return function(){return client[_0x4944('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x4944('0x3'),'as':_0x4944('0x4'),'attributes':['id','name',_0x4944('0x5'),_0x4944('0x6')]}]},'log':_0x4944('0x1')});};}; \ No newline at end of file +var _0xfda6=['Request','name','timeout','strategy','Agents','whatsappPause','../client','getWhatsappQueues'];(function(_0x44f122,_0x5cf131){var _0x60aa8b=function(_0x2c3eb8){while(--_0x2c3eb8){_0x44f122['push'](_0x44f122['shift']());}};_0x60aa8b(++_0x5cf131);}(_0xfda6,0xee));var _0x6fda=function(_0x1d0ced,_0x15dacd){_0x1d0ced=_0x1d0ced-0x0;var _0x1b47dd=_0xfda6[_0x1d0ced];return _0x1b47dd;};'use strict';var client=require(_0x6fda('0x0'));exports[_0x6fda('0x1')]=function(){return function(){return client[_0x6fda('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x6fda('0x3'),_0x6fda('0x4'),_0x6fda('0x5')],'include':[{'model':'User','as':_0x6fda('0x6'),'attributes':['id','name','online',_0x6fda('0x7')]}]},'log':_0x6fda('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 1e4ba6a..c40f0b5 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 _0xf2ee=['DESC','UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport'];(function(_0x3fb256,_0xa066af){var _0x1ca90f=function(_0x3d717a){while(--_0x3d717a){_0x3fb256['push'](_0x3fb256['shift']());}};_0x1ca90f(++_0xa066af);}(_0xf2ee,0x12a));var _0xef2e=function(_0x3ac415,_0x4da3e6){_0x3ac415=_0x3ac415-0x0;var _0x349813=_0xf2ee[_0x3ac415];return _0x349813;};'use strict';var client=require(_0xef2e('0x0'));exports['create']=function(_0x435e86){return client['Request'](_0xef2e('0x1'),{'body':_0x435e86,'log':_0xef2e('0x1')});};exports['update']=function(_0x3fc99a,_0x3341d5){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x3341d5,'options':{'where':{'uniqueid':_0x3fc99a},'order':[['id',_0xef2e('0x2')]],'limit':0x1},'log':_0xef2e('0x3')});}; \ No newline at end of file +var _0xd0b0=['Request','UpdateWhatsappQueueReport','../client','create'];(function(_0x3483cc,_0xe7a93a){var _0x474e21=function(_0x1f5185){while(--_0x1f5185){_0x3483cc['push'](_0x3483cc['shift']());}};_0x474e21(++_0xe7a93a);}(_0xd0b0,0x1e2));var _0x0d0b=function(_0x35aefa,_0x51c448){_0x35aefa=_0x35aefa-0x0;var _0x567caf=_0xd0b0[_0x35aefa];return _0x567caf;};'use strict';var client=require(_0x0d0b('0x0'));exports[_0x0d0b('0x1')]=function(_0x3c6919){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3c6919,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x376b45,_0x3d27c9){return client[_0x0d0b('0x2')](_0x0d0b('0x3'),{'body':_0x3d27c9,'options':{'where':{'uniqueid':_0x376b45},'order':[['id','DESC']],'limit':0x1},'log':_0x0d0b('0x3')});}; \ 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 a0892de..d4d2ebc 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 _0x61c6=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format'];(function(_0x4023d7,_0x450180){var _0x193aa5=function(_0x56fb93){while(--_0x56fb93){_0x4023d7['push'](_0x4023d7['shift']());}};_0x193aa5(++_0x450180);}(_0x61c6,0x199));var _0x661c=function(_0x54169f,_0x20fd82){_0x54169f=_0x54169f-0x0;var _0xae6e91=_0x61c6[_0x54169f];return _0xae6e91;};'use strict';var schema=require(_0x661c('0x0'));var _=require(_0x661c('0x1'));var util=require(_0x661c('0x2'));var seqqueue=require(_0x661c('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x661c('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x661c('0x5')},'timeout':{'type':'number','message':_0x661c('0x6')}});function writeLog(_0x1495f4,_0x531865,_0x4936a9){return logger[_0x661c('0x7')](util[_0x661c('0x8')](_0x661c('0x9'),_0x1495f4,_0x531865[_0x661c('0xa')],_0x4936a9));}function handleFindAgent(_0x46546f){return function(_0x33db2e){return _0x33db2e[_0x661c('0xa')][_0x661c('0xb')]()===_0x46546f[_0x661c('0xb')]();};}exports[_0x661c('0xc')]=function(_0x244cca,_0xd03b12,_0x3771f3,_0x4c60ef){return function(_0x50395e){try{var _0xc99fe8={'name':_0xd03b12[0x0],'timeout':_0xd03b12[0x1]};var _0x203918=queue[_0x661c('0x0')](_0xc99fe8,{'typecast':!![]});if(_0x203918[_0x661c('0xd')]){logger[_0x661c('0xe')]('[%s][AGENT]\x20%s',_0x244cca,_[_0x661c('0xf')](_0x203918,_0x661c('0x10'))[_0x661c('0x11')](',\x20'));_0x50395e[_0x661c('0x12')]();}else{var _0x555107=_[_0x661c('0x13')](_0x3771f3[_0x661c('0x14')],handleFindAgent(_0xc99fe8[_0x661c('0xa')]));if(_0x555107){var _0x360143=(_0xc99fe8[_0x661c('0x15')]||0xa)*0x3e8;var _0x3d7d8c,_0x187335;var _0x1a8353=seqqueue[_0x661c('0x16')](_0x360143);_0x1a8353['id']=_0x244cca;_0x1a8353[_0x661c('0x17')]=_0x360143;_0x1a8353[_0x661c('0x18')]=_0x4c60ef['channel'];writeLog(_0x244cca,_0x555107,util['format'](_0x661c('0x19'),_0x360143));_0x3771f3[_0x661c('0x1a')][_0x244cca]['on'](_0x661c('0x1b'),function(){logger['info'](_0x661c('0x1c'),_0x244cca);clearTimeout(_0x187335);_0x187335=undefined;_0x1a8353['close']();if(_0x3771f3[_0x661c('0x1a')][_0x244cca]){delete _0x3771f3[_0x661c('0x1a')][_0x244cca];}_0x50395e[_0x661c('0x12')]();});_0x3771f3[_0x661c('0x1a')][_0x244cca]['on'](_0x661c('0x1d'),function(){if(_0x3771f3[_0x661c('0x1a')][_0x244cca]){delete _0x3771f3['rules'][_0x244cca];}});_0x187335=setTimeout(function(){logger[_0x661c('0x7')](_0x661c('0x1e'),_0x244cca);clearTimeout(_0x187335);_0x1a8353[_0x661c('0x1f')]();_0x50395e[_0x661c('0x20')]();},_0x360143);strategy[_0x661c('0x21')](_0x1a8353,_0x555107,_0x3771f3,_0x4c60ef);}else{logger[_0x661c('0xe')](_0x661c('0x22'),_0x244cca,_0xc99fe8[_0x661c('0xa')]);_0x50395e[_0x661c('0x12')]();}}}catch(_0x3fe2e2){console[_0x661c('0x23')](_0x3fe2e2);logger['error'](_0x661c('0x24'),_0x244cca,_0x3fe2e2[_0x661c('0x25')]);_0x50395e[_0x661c('0x12')]();}};}; \ No newline at end of file +var _0xa8de=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','name','log','validate','lodash','seq-queue','../../../../config/logger','routing'];(function(_0x3587f9,_0x1daefb){var _0x588a26=function(_0x412813){while(--_0x412813){_0x3587f9['push'](_0x3587f9['shift']());}};_0x588a26(++_0x1daefb);}(_0xa8de,0x1c9));var _0xea8d=function(_0x614f9a,_0x4c381c){_0x614f9a=_0x614f9a-0x0;var _0x17873b=_0xa8de[_0x614f9a];return _0x17873b;};'use strict';var schema=require(_0xea8d('0x0'));var _=require(_0xea8d('0x1'));var util=require('util');var seqqueue=require(_0xea8d('0x2'));var logger=require(_0xea8d('0x3'))(_0xea8d('0x4'));var strategy=require(_0xea8d('0x5'));var queue=schema({'name':{'type':_0xea8d('0x6'),'required':!![],'message':_0xea8d('0x7')},'timeout':{'type':_0xea8d('0x8'),'message':_0xea8d('0x9')}});function writeLog(_0x89b417,_0x21f1d9,_0x5f0897){return logger[_0xea8d('0xa')](util[_0xea8d('0xb')](_0xea8d('0xc'),_0x89b417,_0x21f1d9['name'],_0x5f0897));}function handleFindAgent(_0x18bb0a){return function(_0xf3d83){return _0xf3d83['name'][_0xea8d('0xd')]()===_0x18bb0a[_0xea8d('0xd')]();};}exports[_0xea8d('0xe')]=function(_0x1c3076,_0x280991,_0x15263a,_0x328f3c){return function(_0x3fa5fb){try{var _0x2ccf9c={'name':_0x280991[0x0],'timeout':_0x280991[0x1]};var _0xab3c6f=queue[_0xea8d('0x0')](_0x2ccf9c,{'typecast':!![]});if(_0xab3c6f[_0xea8d('0xf')]){logger[_0xea8d('0x10')]('[%s][AGENT]\x20%s',_0x1c3076,_['map'](_0xab3c6f,'message')['join'](',\x20'));_0x3fa5fb[_0xea8d('0x11')]();}else{var _0x36cb03=_['find'](_0x15263a[_0xea8d('0x12')],handleFindAgent(_0x2ccf9c['name']));if(_0x36cb03){var _0x256cb7=(_0x2ccf9c[_0xea8d('0x13')]||0xa)*0x3e8;var _0x31501c,_0x4b3dcc;var _0x3afb83=seqqueue[_0xea8d('0x14')](_0x256cb7);_0x3afb83['id']=_0x1c3076;_0x3afb83[_0xea8d('0x15')]=_0x256cb7;_0x3afb83['channel']=_0x328f3c[_0xea8d('0x16')];writeLog(_0x1c3076,_0x36cb03,util[_0xea8d('0xb')](_0xea8d('0x17'),_0x256cb7));_0x15263a[_0xea8d('0x18')][_0x1c3076]['on'](_0xea8d('0x19'),function(){logger[_0xea8d('0xa')](_0xea8d('0x1a'),_0x1c3076);clearTimeout(_0x4b3dcc);_0x4b3dcc=undefined;_0x3afb83[_0xea8d('0x1b')]();if(_0x15263a[_0xea8d('0x18')][_0x1c3076]){delete _0x15263a[_0xea8d('0x18')][_0x1c3076];}_0x3fa5fb[_0xea8d('0x11')]();});_0x15263a[_0xea8d('0x18')][_0x1c3076]['on']('complete',function(){if(_0x15263a[_0xea8d('0x18')][_0x1c3076]){delete _0x15263a['rules'][_0x1c3076];}});_0x4b3dcc=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1c3076);clearTimeout(_0x4b3dcc);_0x3afb83[_0xea8d('0x1b')]();_0x3fa5fb[_0xea8d('0x1c')]();},_0x256cb7);strategy[_0xea8d('0x1d')](_0x3afb83,_0x36cb03,_0x15263a,_0x328f3c);}else{logger[_0xea8d('0x10')](_0xea8d('0x1e'),_0x1c3076,_0x2ccf9c[_0xea8d('0x1f')]);_0x3fa5fb['stop']();}}}catch(_0x3735d2){console[_0xea8d('0x20')](_0x3735d2);logger[_0xea8d('0x10')]('[%s][QUEUE]\x20%s',_0x1c3076,_0x3735d2['stack']);_0x3fa5fb[_0xea8d('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 89e0f11..c573ed5 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 _0x9dac=['lodash','moment','./utils','../../rpc/chatMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','Message','Failed'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x9dac,0x1e4));var _0xc9da=function(_0x36bd6d,_0x3fe6fd){_0x36bd6d=_0x36bd6d-0x0;var _0x4465ec=_0x9dac[_0x36bd6d];return _0x4465ec;};'use strict';var _=require(_0xc9da('0x0'));var moment=require(_0xc9da('0x1'));var AWS=require('aws-sdk');var utils=require(_0xc9da('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xc9da('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc9da('0x4'))};exports[_0xc9da('0x5')]=function(_0x5c9c8d,_0x391e00){return function(_0x2bc5d9){try{if(!_[_0xc9da('0x6')](this[_0xc9da('0x7')][_0xc9da('0x8')])){logger[_0xc9da('0x9')](_0xc9da('0xa'),_0x5c9c8d,_0xc9da('0xb'));return _0x2bc5d9[_0xc9da('0xc')]();}var _0x46b5c9={'ContactId':this['contact']['id'],'sentAt':moment()[_0xc9da('0xd')](_0xc9da('0xe')),'direction':_0xc9da('0xf')};if(this[_0xc9da('0x10')]===_0xc9da('0x11')||this['channel']===_0xc9da('0x12')){_0x46b5c9[_0xc9da('0x13')]=this['interaction']['phone'];}var _0x3775f6=this[_0xc9da('0x10')];if(_0x3775f6===_0xc9da('0x14')){_0x46b5c9[_0xc9da('0x15')]=this[_0xc9da('0x16')]['id'];}else{_0x46b5c9[_[_0xc9da('0x17')](_0x3775f6)+_0xc9da('0x18')]=this[_0xc9da('0x16')]['id'];}_0x46b5c9[_[_0xc9da('0x17')](_0x3775f6)+'InteractionId']=this[_0xc9da('0x7')]['id'];if(this[_0xc9da('0x7')]['created']){var _0x1efe21=_0x391e00[0x4];if(!_[_0xc9da('0x19')](_0x1efe21)){_0x46b5c9['body']=utils['getMustacheRender'](_0x1efe21,this);return rpc[_0x3775f6+'Message'][_0xc9da('0x1a')](_0x46b5c9)[_0xc9da('0x1b')](function(_0x2cdf67){logger[_0xc9da('0x9')](_0xc9da('0xa'),_0x5c9c8d,_0x46b5c9[_0xc9da('0x1c')]);})[_0xc9da('0x1d')](function(_0x59c8f6){logger[_0xc9da('0x1e')](_0xc9da('0xa'),_0x5c9c8d,JSON[_0xc9da('0x1f')](_0x59c8f6));})[_0xc9da('0x20')](function(){logger[_0xc9da('0x9')](_0xc9da('0x21'),_0x5c9c8d);_0x2bc5d9[_0xc9da('0x22')]();});}else{logger[_0xc9da('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5c9c8d);_0x2bc5d9[_0xc9da('0x22')]();}}else{var _0x25802b=this;var _0x359c07=new AWS[(_0xc9da('0x23'))]({'accessKeyId':_0x391e00[0x0],'secretAccessKey':_0x391e00[0x1],'region':_0x391e00[0x2]});var _0x17e9f4={'botAlias':_0xc9da('0x24'),'botName':_0x391e00[0x3],'inputText':this[_0xc9da('0x25')][_0xc9da('0x1c')],'userId':this[_0xc9da('0x10')]+':'+this[_0xc9da('0x7')]['id'][_0xc9da('0x26')]()};_0x359c07[_0xc9da('0x27')](_0x17e9f4,function(_0x52741c,_0x417329){if(_0x52741c){logger[_0xc9da('0x1e')](_0xc9da('0xa'),_0x5c9c8d,_0x52741c[_0xc9da('0x25')]);_0x2bc5d9[_0xc9da('0xc')]();}else if(_0x417329&&_0x417329[_0xc9da('0x25')]){_0x25802b[_0xc9da('0x1c')][_0xc9da('0x28')]=_0x417329;_0x46b5c9[_0xc9da('0x1c')]=_0x417329[_0xc9da('0x25')];_0x46b5c9[_0xc9da('0x29')]='amazonlex';_0x46b5c9['providerResponse']=JSON[_0xc9da('0x1f')](_0x417329);return rpc[_0x3775f6+_0xc9da('0x2a')][_0xc9da('0x1a')](_0x46b5c9)[_0xc9da('0x1b')](function(_0x51c3c7){logger['info'](_0xc9da('0xa'),_0x5c9c8d,_0x46b5c9[_0xc9da('0x1c')]);if(_0x417329['dialogState']==_0xc9da('0x2b')){_0x2bc5d9[_0xc9da('0xc')]();}else{_0x2bc5d9[_0xc9da('0x22')]();}})[_0xc9da('0x1d')](function(_0x151f3a){logger[_0xc9da('0x1e')](_0xc9da('0xa'),_0x5c9c8d,JSON['stringify'](_0x151f3a));_0x2bc5d9[_0xc9da('0xc')]();});}else{_0x2bc5d9['next']();}});}}catch(_0x402093){logger[_0xc9da('0x1e')](_0xc9da('0xa'),_0x5c9c8d,JSON[_0xc9da('0x1f')](_0x402093));_0x2bc5d9[_0xc9da('0x22')]();}};}; \ No newline at end of file +var _0xc939=['Failed','next','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','then','info','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState'];(function(_0x2cfa34,_0x19d8cb){var _0x5074c3=function(_0x1521ec){while(--_0x1521ec){_0x2cfa34['push'](_0x2cfa34['shift']());}};_0x5074c3(++_0x19d8cb);}(_0xc939,0x6a));var _0x9c93=function(_0x4e8e83,_0x168552){_0x4e8e83=_0x4e8e83-0x0;var _0x26010a=_0xc939[_0x4e8e83];return _0x26010a;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x9c93('0x0'));var utils=require(_0x9c93('0x1'));var logger=require(_0x9c93('0x2'))(_0x9c93('0x3'));var rpc={'chatMessage':require(_0x9c93('0x4')),'openchannelMessage':require(_0x9c93('0x5')),'mailMessage':require(_0x9c93('0x6')),'smsMessage':require(_0x9c93('0x7')),'faxMessage':require(_0x9c93('0x8')),'whatsappMessage':require(_0x9c93('0x9'))};exports[_0x9c93('0xa')]=function(_0x58252c,_0x4a84c3){return function(_0x3323f8){try{if(!_[_0x9c93('0xb')](this[_0x9c93('0xc')][_0x9c93('0xd')])){logger['info'](_0x9c93('0xe'),_0x58252c,_0x9c93('0xf'));return _0x3323f8['next']();}var _0x4592f1={'ContactId':this[_0x9c93('0x10')]['id'],'sentAt':moment()['format'](_0x9c93('0x11')),'direction':_0x9c93('0x12')};if(this[_0x9c93('0x13')]===_0x9c93('0x14')||this[_0x9c93('0x13')]===_0x9c93('0x15')){_0x4592f1[_0x9c93('0x16')]=this[_0x9c93('0xc')]['phone'];}var _0x4c5fa9=this[_0x9c93('0x13')];if(_0x4c5fa9===_0x9c93('0x17')){_0x4592f1[_0x9c93('0x18')]=this[_0x9c93('0x19')]['id'];}else{_0x4592f1[_[_0x9c93('0x1a')](_0x4c5fa9)+_0x9c93('0x1b')]=this[_0x9c93('0x19')]['id'];}_0x4592f1[_['upperFirst'](_0x4c5fa9)+_0x9c93('0x1c')]=this[_0x9c93('0xc')]['id'];if(this[_0x9c93('0xc')][_0x9c93('0x1d')]){var _0xef9363=_0x4a84c3[0x4];if(!_[_0x9c93('0x1e')](_0xef9363)){_0x4592f1[_0x9c93('0x1f')]=utils['getMustacheRender'](_0xef9363,this);return rpc[_0x4c5fa9+_0x9c93('0x20')]['create'](_0x4592f1)[_0x9c93('0x21')](function(_0x1dbd70){logger[_0x9c93('0x22')](_0x9c93('0xe'),_0x58252c,_0x4592f1[_0x9c93('0x1f')]);})[_0x9c93('0x23')](function(_0x2a49bf){logger[_0x9c93('0x24')]('[%s][AMAZONLEX]\x20%s',_0x58252c,JSON[_0x9c93('0x25')](_0x2a49bf));})['finally'](function(){logger['info'](_0x9c93('0x26'),_0x58252c);_0x3323f8[_0x9c93('0x27')]();});}else{logger[_0x9c93('0x22')](_0x9c93('0x28'),_0x58252c);_0x3323f8[_0x9c93('0x27')]();}}else{var _0x5975d3=this;var _0x5236fd=new AWS[(_0x9c93('0x29'))]({'accessKeyId':_0x4a84c3[0x0],'secretAccessKey':_0x4a84c3[0x1],'region':_0x4a84c3[0x2]});var _0x288c51={'botAlias':'$LATEST','botName':_0x4a84c3[0x3],'inputText':this[_0x9c93('0x2a')][_0x9c93('0x1f')],'userId':this[_0x9c93('0x13')]+':'+this['interaction']['id'][_0x9c93('0x2b')]()};_0x5236fd[_0x9c93('0x2c')](_0x288c51,function(_0x41a1a8,_0x58104a){if(_0x41a1a8){logger[_0x9c93('0x24')]('[%s][AMAZONLEX]\x20%s',_0x58252c,_0x41a1a8[_0x9c93('0x2a')]);_0x3323f8['next']();}else if(_0x58104a&&_0x58104a[_0x9c93('0x2a')]){_0x5975d3[_0x9c93('0x1f')][_0x9c93('0x2d')]=_0x58104a;_0x4592f1['body']=_0x58104a[_0x9c93('0x2a')];_0x4592f1[_0x9c93('0x2e')]=_0x9c93('0x2d');_0x4592f1[_0x9c93('0x2f')]=JSON['stringify'](_0x58104a);return rpc[_0x4c5fa9+_0x9c93('0x20')][_0x9c93('0x30')](_0x4592f1)[_0x9c93('0x21')](function(_0x2d5136){logger[_0x9c93('0x22')]('[%s][AMAZONLEX]\x20%s',_0x58252c,_0x4592f1[_0x9c93('0x1f')]);if(_0x58104a[_0x9c93('0x31')]==_0x9c93('0x32')){_0x3323f8[_0x9c93('0x33')]();}else{_0x3323f8['stop']();}})['catch'](function(_0x4db630){logger[_0x9c93('0x24')](_0x9c93('0xe'),_0x58252c,JSON['stringify'](_0x4db630));_0x3323f8['next']();});}else{_0x3323f8[_0x9c93('0x33')]();}});}}catch(_0x889d0f){logger[_0x9c93('0x24')](_0x9c93('0xe'),_0x58252c,JSON['stringify'](_0x889d0f));_0x3323f8[_0x9c93('0x27')]();}};}; \ 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 e6ee04c..59fde50 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 _0x13d3=['[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','./utils','../../../../config/logger','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Smtp','service','host','port','secure','auth','user','pass','messageId','html','','replace','body','';_0xd10799[_0x313d('0x37')]={'Auto-Submitted':_0x313d('0x38'),'X-Auto-Response-Suppress':_0x313d('0x39'),'Precedence':_0x313d('0x3a')};return mailRpc[_0x313d('0x3b')](_0x32dd78,_0xd10799)[_0x313d('0x3c')](function(_0x5307c9){logger['info'](_0x313d('0x3d'),_0x836665);_0xd10799[_0x313d('0x30')]=_0x5307c9[_0x313d('0x1c')][_0x313d('0x30')];return rpc[_0x2c181b+_0x313d('0x3e')][_0x313d('0x3f')](_0xd10799);})[_0x313d('0x3c')](function(_0x11b47b){logger['info'](_0x313d('0xe'),_0x836665,JSON[_0x313d('0x40')](_0x11b47b));})['catch'](function(_0x10be87){logger[_0x313d('0x41')](_0x313d('0x42'),_0x836665,JSON[_0x313d('0x40')](_0x10be87));})[_0x313d('0x43')](function(){Promise[_0x313d('0x44')]()[_0x313d('0x3c')](function(){if(_0x25be5f[0x0]!=='2'||_0x3b45aa['autoreplyExecuted'])return;return rpc[_0x2c181b+_0x313d('0x45')][_0x313d('0x46')](_0x3b45aa['id'],{'autoreplyExecuted':!![]})[_0x313d('0x3c')](function(_0x40a41c){logger[_0x313d('0x15')](_0x313d('0x16'),_0x836665,JSON[_0x313d('0x40')](_0x40a41c));})[_0x313d('0x47')](function(_0x2636ec){logger[_0x313d('0x41')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x836665,JSON[_0x313d('0x40')](_0x2636ec));});})['then'](function(){_0x492afe['next']();});});}else{return rpc[this[_0x313d('0xb')]+'Message'][_0x313d('0x3f')](_0xd10799)[_0x313d('0x3c')](function(_0xc49e4f){logger[_0x313d('0x15')](_0x313d('0xe'),_0x836665,_0xd10799[_0x313d('0x34')]);})[_0x313d('0x47')](function(_0x2a9ee3){logger[_0x313d('0x41')](_0x313d('0xe'),_0x836665,JSON[_0x313d('0x40')](_0x2a9ee3));})[_0x313d('0x43')](function(){Promise[_0x313d('0x44')]()[_0x313d('0x3c')](function(){if(_0x25be5f[0x0]!=='2'||_0x3b45aa[_0x313d('0x14')])return;return rpc[_0x2c181b+_0x313d('0x45')]['update'](_0x3b45aa['id'],{'autoreplyExecuted':!![]})[_0x313d('0x3c')](function(_0x42f00c){logger['info'](_0x313d('0x16'),_0x836665,JSON['stringify'](_0x42f00c));})[_0x313d('0x47')](function(_0x26f2c2){logger[_0x313d('0x41')](_0x313d('0x48'),_0x836665,JSON['stringify'](_0x26f2c2));});})[_0x313d('0x3c')](function(){_0x492afe['next']();});});}}}catch(_0x3d6ada){logger[_0x313d('0x41')](_0x313d('0xe'),_0x836665,JSON['stringify'](_0x3d6ada));_0x492afe['stop']();}};}; \ No newline at end of file +var _0x6bcb=['InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','','replace','';_0x12033e['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xb6bc('0x36'),'Precedence':_0xb6bc('0x37')};return mailRpc[_0xb6bc('0x38')](_0xa944ad,_0x12033e)[_0xb6bc('0x39')](function(_0x5138d6){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x1842bf);_0x12033e[_0xb6bc('0x3a')]=_0x5138d6['message']['messageId'];return rpc[_0x478ac1+'Message'][_0xb6bc('0x3b')](_0x12033e);})['then'](function(_0x3facc6){logger[_0xb6bc('0xe')](_0xb6bc('0xf'),_0x1842bf,JSON[_0xb6bc('0x3c')](_0x3facc6));})[_0xb6bc('0x3d')](function(_0x1e0447){logger[_0xb6bc('0x3e')](_0xb6bc('0x3f'),_0x1842bf,JSON[_0xb6bc('0x3c')](_0x1e0447));})[_0xb6bc('0x40')](function(){Promise[_0xb6bc('0x41')]()['then'](function(){if(_0x37ff39[0x0]!=='2'||_0x4cd4c7[_0xb6bc('0x15')])return;return rpc[_0x478ac1+_0xb6bc('0x42')][_0xb6bc('0x43')](_0x4cd4c7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x17fb73){logger['info'](_0xb6bc('0x16'),_0x1842bf,JSON['stringify'](_0x17fb73));})[_0xb6bc('0x3d')](function(_0x3d8f5d){logger[_0xb6bc('0x3e')](_0xb6bc('0x44'),_0x1842bf,JSON[_0xb6bc('0x3c')](_0x3d8f5d));});})['then'](function(){_0x4ec33b[_0xb6bc('0x11')]();});});}else{return rpc[this[_0xb6bc('0xc')]+_0xb6bc('0x29')]['create'](_0x12033e)['then'](function(_0x2e751c){logger[_0xb6bc('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1842bf,_0x12033e[_0xb6bc('0x1c')]);})[_0xb6bc('0x3d')](function(_0x3cac25){logger[_0xb6bc('0x3e')]('[%s][AUTOREPLY]\x20%s',_0x1842bf,JSON[_0xb6bc('0x3c')](_0x3cac25));})[_0xb6bc('0x40')](function(){Promise[_0xb6bc('0x41')]()[_0xb6bc('0x39')](function(){if(_0x37ff39[0x0]!=='2'||_0x4cd4c7[_0xb6bc('0x15')])return;return rpc[_0x478ac1+_0xb6bc('0x42')]['update'](_0x4cd4c7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x643fb1){logger[_0xb6bc('0xe')](_0xb6bc('0x16'),_0x1842bf,JSON[_0xb6bc('0x3c')](_0x643fb1));})[_0xb6bc('0x3d')](function(_0x554c49){logger[_0xb6bc('0x3e')](_0xb6bc('0x44'),_0x1842bf,JSON['stringify'](_0x554c49));});})['then'](function(){_0x4ec33b['next']();});});}}}catch(_0x55c0c1){logger[_0xb6bc('0x3e')]('[%s][AUTOREPLY]\x20%s',_0x1842bf,JSON[_0xb6bc('0x3c')](_0x55c0c1));_0x4ec33b[_0xb6bc('0x45')]();}};}; \ 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 28d5519..3f85af1 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 _0xb7a2=['interaction','then','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update'];(function(_0x4a24a6,_0x500c05){var _0x31cacb=function(_0x570ad0){while(--_0x570ad0){_0x4a24a6['push'](_0x4a24a6['shift']());}};_0x31cacb(++_0x500c05);}(_0xb7a2,0x123));var _0x2b7a=function(_0x164fb1,_0x4b78a0){_0x164fb1=_0x164fb1-0x0;var _0x45b937=_0xb7a2[_0x164fb1];return _0x45b937;};'use strict';var moment=require(_0x2b7a('0x0'));var logger=require(_0x2b7a('0x1'))(_0x2b7a('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2b7a('0x3')),'faxInteraction':require(_0x2b7a('0x4')),'whatsappInteraction':require(_0x2b7a('0x5'))};exports[_0x2b7a('0x6')]=function(_0x5209c6,_0x552a5a,_0x489b0a,_0x30db86){return function(_0x1f7de6){try{logger[_0x2b7a('0x7')](_0x2b7a('0x8'),_0x5209c6,_0x552a5a[0x0]);var _0xf7c42f={'closed':0x1,'closedAt':moment()['format'](_0x2b7a('0x9')),'closeReason':'system','disposition':_0x552a5a[0x0]};if(rpc[_0x30db86[_0x2b7a('0xa')]+'Interaction']){rpc[_0x30db86[_0x2b7a('0xa')]+_0x2b7a('0xb')][_0x2b7a('0xc')](_0x30db86[_0x2b7a('0xd')]['id'],_0xf7c42f)[_0x2b7a('0xe')](function(_0x52fc3a){logger[_0x2b7a('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5209c6,_0x30db86[_0x2b7a('0xd')]['id']);})['catch'](function(_0xa06386){logger[_0x2b7a('0xf')](_0x2b7a('0x10'),_0x5209c6,JSON[_0x2b7a('0x11')](_0xa06386));})['finally'](function(){_0x1f7de6['stop']();});}}catch(_0x50bba4){logger['error'](_0x2b7a('0x10'),_0x5209c6,JSON[_0x2b7a('0x11')](_0x50bba4));_0x1f7de6[_0x2b7a('0x12')]();}};}; \ No newline at end of file +var _0x9608=['catch','error','[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info'];(function(_0x224dda,_0x16d0f9){var _0x2987ac=function(_0x3b1033){while(--_0x3b1033){_0x224dda['push'](_0x224dda['shift']());}};_0x2987ac(++_0x16d0f9);}(_0x9608,0x8a));var _0x8960=function(_0x3c49ec,_0x32137d){_0x3c49ec=_0x3c49ec-0x0;var _0x11049e=_0x9608[_0x3c49ec];return _0x11049e;};'use strict';var moment=require(_0x8960('0x0'));var logger=require(_0x8960('0x1'))(_0x8960('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8960('0x3')),'smsInteraction':require(_0x8960('0x4')),'mailInteraction':require(_0x8960('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x8960('0x6'))};exports['consequence']=function(_0x4e70ed,_0x3b19b3,_0x387600,_0x3b4437){return function(_0x514f3e){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4e70ed,_0x3b19b3[0x0]);var _0x8c9573={'closed':0x1,'closedAt':moment()['format'](_0x8960('0x7')),'closeReason':_0x8960('0x8'),'disposition':_0x3b19b3[0x0]};if(rpc[_0x3b4437[_0x8960('0x9')]+'Interaction']){rpc[_0x3b4437[_0x8960('0x9')]+_0x8960('0xa')][_0x8960('0xb')](_0x3b4437[_0x8960('0xc')]['id'],_0x8c9573)['then'](function(_0x453e96){logger[_0x8960('0xd')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4e70ed,_0x3b4437['interaction']['id']);})[_0x8960('0xe')](function(_0x5cff46){logger[_0x8960('0xf')](_0x8960('0x10'),_0x4e70ed,JSON['stringify'](_0x5cff46));})[_0x8960('0x11')](function(){_0x514f3e[_0x8960('0x12')]();});}}catch(_0x28ac42){logger['error'](_0x8960('0x10'),_0x4e70ed,JSON['stringify'](_0x28ac42));_0x514f3e[_0x8960('0x12')]();}};}; \ 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 6405043..904dd89 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 _0xa613=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','create','[%s][DIALOGFLOW]\x20%s','body','catch','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','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','then','metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone'];(function(_0x5ea548,_0x405786){var _0x342056=function(_0x230866){while(--_0x230866){_0x5ea548['push'](_0x5ea548['shift']());}};_0x342056(++_0x405786);}(_0xa613,0x8a));var _0x3a61=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xa613[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require(_0x3a61('0x0'));var moment=require('moment');var apiai=require(_0x3a61('0x1'));var md5=require(_0x3a61('0x2'));var utils=require(_0x3a61('0x3'));var logger=require(_0x3a61('0x4'))(_0x3a61('0x5'));var rpc={'chatMessage':require(_0x3a61('0x6')),'openchannelMessage':require(_0x3a61('0x7')),'mailMessage':require(_0x3a61('0x8')),'smsMessage':require(_0x3a61('0x9')),'faxMessage':require(_0x3a61('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3a61('0xb')]=function(_0x25bb94,_0x5ba604){return function(_0xcb9ceb){try{if(!_[_0x3a61('0xc')](this[_0x3a61('0xd')][_0x3a61('0xe')])){logger[_0x3a61('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x25bb94,_0x3a61('0x10'));return _0xcb9ceb[_0x3a61('0x11')]();}var _0x5b0db1={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x3a61('0x12')),'direction':_0x3a61('0x13')};if(this['channel']===_0x3a61('0x14')||this[_0x3a61('0x15')]===_0x3a61('0x16')){_0x5b0db1[_0x3a61('0x17')]=this[_0x3a61('0xd')][_0x3a61('0x17')];}var _0x53a37a=this['channel'];if(_0x53a37a===_0x3a61('0x18')){_0x5b0db1[_0x3a61('0x19')]=this[_0x3a61('0x1a')]['id'];}else{_0x5b0db1[_[_0x3a61('0x1b')](_0x53a37a)+_0x3a61('0x1c')]=this['account']['id'];}_0x5b0db1[_['upperFirst'](_0x53a37a)+_0x3a61('0x1d')]=this['interaction']['id'];if(this[_0x3a61('0xd')]['created']){var _0x476efa=_0x5ba604[0x2];if(!_[_0x3a61('0x1e')](_0x476efa)){_0x5b0db1['body']=utils[_0x3a61('0x1f')](_0x476efa,this);return rpc[_0x53a37a+'Message'][_0x3a61('0x20')](_0x5b0db1)['then'](function(_0x94bdcb){logger['info'](_0x3a61('0x21'),_0x25bb94,_0x5b0db1[_0x3a61('0x22')]);})[_0x3a61('0x23')](function(_0x1c1b25){logger[_0x3a61('0x24')](_0x3a61('0x21'),_0x25bb94,JSON[_0x3a61('0x25')](_0x1c1b25));})[_0x3a61('0x26')](function(){logger[_0x3a61('0xf')](_0x3a61('0x27'),_0x25bb94);_0xcb9ceb[_0x3a61('0x28')]();});}else{logger[_0x3a61('0xf')](_0x3a61('0x29'),_0x25bb94);_0xcb9ceb[_0x3a61('0x28')]();}}else{var _0x4485ed=this;var _0x55c0a7=apiai(_0x5ba604[0x0],{'language':_0x5ba604[0x1]||'en'});return _0x55c0a7[_0x3a61('0x2a')](this[_0x3a61('0x2b')][_0x3a61('0x22')],{'sessionId':md5(this[_0x3a61('0xd')]['id'])})['then'](function(_0x57df5b){_0x4485ed['body'][_0x3a61('0x2c')]=_0x57df5b;_0x5b0db1[_0x3a61('0x22')]=_0x57df5b[_0x3a61('0x2d')][_0x3a61('0x2e')][_0x3a61('0x2f')];_0x5b0db1[_0x3a61('0x30')]=_0x3a61('0x2c');_0x5b0db1[_0x3a61('0x31')]=JSON[_0x3a61('0x25')](_0x57df5b);return rpc[_0x53a37a+_0x3a61('0x32')][_0x3a61('0x20')](_0x5b0db1)[_0x3a61('0x33')](function(_0x81be25){logger[_0x3a61('0xf')](_0x3a61('0x21'),_0x25bb94,_0x5b0db1[_0x3a61('0x22')]);if(_0x57df5b[_0x3a61('0x2d')][_0x3a61('0x34')][_0x3a61('0x35')]){_0xcb9ceb[_0x3a61('0x11')]();}else{_0xcb9ceb['stop']();}})[_0x3a61('0x23')](function(_0x46cffa){logger[_0x3a61('0x24')](_0x3a61('0x21'),_0x25bb94,JSON[_0x3a61('0x25')](_0x46cffa));_0xcb9ceb[_0x3a61('0x11')]();});})[_0x3a61('0x23')](function(_0x10b23c){logger[_0x3a61('0x24')](_0x3a61('0x21'),_0x25bb94,_0x10b23c[_0x3a61('0x2b')]);_0xcb9ceb[_0x3a61('0x11')]();});}}catch(_0x4d6ad3){logger[_0x3a61('0x24')](_0x3a61('0x21'),_0x25bb94,JSON[_0x3a61('0x25')](_0x4d6ad3));_0xcb9ceb[_0x3a61('0x28')]();}};}; \ No newline at end of file +var _0xe225=['out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','then','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','Message','create','metadata','moment','apiai-promise','routing','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe225,0x1bd));var _0x5e22=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0xe225[_0x5f4902];return _0x743933;};'use strict';var _=require('lodash');var moment=require(_0x5e22('0x0'));var apiai=require(_0x5e22('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x5e22('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5e22('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5e22('0x4'))};exports[_0x5e22('0x5')]=function(_0x35736b,_0x11661f){return function(_0x465536){try{if(!_[_0x5e22('0x6')](this[_0x5e22('0x7')][_0x5e22('0x8')])){logger[_0x5e22('0x9')](_0x5e22('0xa'),_0x35736b,_0x5e22('0xb'));return _0x465536[_0x5e22('0xc')]();}var _0x4da7b3={'ContactId':this[_0x5e22('0xd')]['id'],'sentAt':moment()['format'](_0x5e22('0xe')),'direction':_0x5e22('0xf')};if(this[_0x5e22('0x10')]===_0x5e22('0x11')||this['channel']===_0x5e22('0x12')){_0x4da7b3['phone']=this[_0x5e22('0x7')][_0x5e22('0x13')];}var _0x40b338=this[_0x5e22('0x10')];if(_0x40b338===_0x5e22('0x14')){_0x4da7b3['ChatWebsiteId']=this[_0x5e22('0x15')]['id'];}else{_0x4da7b3[_[_0x5e22('0x16')](_0x40b338)+_0x5e22('0x17')]=this[_0x5e22('0x15')]['id'];}_0x4da7b3[_[_0x5e22('0x16')](_0x40b338)+_0x5e22('0x18')]=this[_0x5e22('0x7')]['id'];if(this[_0x5e22('0x7')][_0x5e22('0x19')]){var _0x3fa607=_0x11661f[0x2];if(!_[_0x5e22('0x1a')](_0x3fa607)){_0x4da7b3[_0x5e22('0x1b')]=utils[_0x5e22('0x1c')](_0x3fa607,this);return rpc[_0x40b338+'Message']['create'](_0x4da7b3)[_0x5e22('0x1d')](function(_0x48c441){logger[_0x5e22('0x9')](_0x5e22('0xa'),_0x35736b,_0x4da7b3[_0x5e22('0x1b')]);})[_0x5e22('0x1e')](function(_0x7b5fea){logger[_0x5e22('0x1f')](_0x5e22('0xa'),_0x35736b,JSON[_0x5e22('0x20')](_0x7b5fea));})[_0x5e22('0x21')](function(){logger[_0x5e22('0x9')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x35736b);_0x465536[_0x5e22('0x22')]();});}else{logger[_0x5e22('0x9')](_0x5e22('0x23'),_0x35736b);_0x465536[_0x5e22('0x22')]();}}else{var _0x1b5d41=this;var _0x310978=apiai(_0x11661f[0x0],{'language':_0x11661f[0x1]||'en'});return _0x310978[_0x5e22('0x24')](this[_0x5e22('0x25')][_0x5e22('0x1b')],{'sessionId':md5(this['interaction']['id'])})[_0x5e22('0x1d')](function(_0x5d0a07){_0x1b5d41[_0x5e22('0x1b')][_0x5e22('0x26')]=_0x5d0a07;_0x4da7b3[_0x5e22('0x1b')]=_0x5d0a07[_0x5e22('0x27')][_0x5e22('0x28')][_0x5e22('0x29')];_0x4da7b3['providerName']=_0x5e22('0x26');_0x4da7b3[_0x5e22('0x2a')]=JSON[_0x5e22('0x20')](_0x5d0a07);return rpc[_0x40b338+_0x5e22('0x2b')][_0x5e22('0x2c')](_0x4da7b3)[_0x5e22('0x1d')](function(_0x218692){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x35736b,_0x4da7b3[_0x5e22('0x1b')]);if(_0x5d0a07[_0x5e22('0x27')][_0x5e22('0x2d')]['endConversation']){_0x465536[_0x5e22('0xc')]();}else{_0x465536['stop']();}})[_0x5e22('0x1e')](function(_0x3bd85d){logger[_0x5e22('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x35736b,JSON[_0x5e22('0x20')](_0x3bd85d));_0x465536['next']();});})['catch'](function(_0x490597){logger[_0x5e22('0x1f')](_0x5e22('0xa'),_0x35736b,_0x490597[_0x5e22('0x25')]);_0x465536['next']();});}}catch(_0x2bb223){logger[_0x5e22('0x1f')](_0x5e22('0xa'),_0x35736b,JSON[_0x5e22('0x20')](_0x2bb223));_0x465536[_0x5e22('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 8958c85..dd79014 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 _0x35a6=['account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x35a6,0x1dd));var _0x635a=function(_0x529870,_0x975245){_0x529870=_0x529870-0x0;var _0x39435f=_0x35a6[_0x529870];return _0x39435f;};'use strict';var _=require(_0x635a('0x0'));var dialogflow=require(_0x635a('0x1'));var md5=require('md5');var moment=require(_0x635a('0x2'));var Promise=require(_0x635a('0x3'));var logger=require(_0x635a('0x4'))(_0x635a('0x5'));var utils=require(_0x635a('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x635a('0x7')),'mailMessage':require(_0x635a('0x8')),'smsMessage':require(_0x635a('0x9')),'faxMessage':require(_0x635a('0xa')),'whatsappMessage':require(_0x635a('0xb'))};function createMessage(_0x3cc347,_0x4ab305,_0x27e1f1,_0x2e2b9b){return new Promise(function(_0x1bae03,_0x4f988c){var _0x12ea7c=_[_0x635a('0xc')](_0x27e1f1);_0x12ea7c[_0x635a('0xd')]=_0x2e2b9b;return rpc[_0x4ab305+_0x635a('0xe')][_0x635a('0xf')](_0x12ea7c)[_0x635a('0x10')](function(){logger[_0x635a('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3cc347,_0x12ea7c[_0x635a('0xd')]);_0x1bae03();})[_0x635a('0x12')](function(_0x51badb){logger['error'](_0x635a('0x13'),_0x3cc347,JSON[_0x635a('0x14')](_0x51badb));_0x4f988c(_0x51badb);});});}exports[_0x635a('0x15')]=function(_0x38103e,_0x5d4cdd){return function(_0x12e13a){try{if(!_['isNil'](this[_0x635a('0x16')][_0x635a('0x17')])){logger[_0x635a('0x11')](_0x635a('0x13'),_0x38103e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x12e13a[_0x635a('0x18')]();}var _0x7e787a={'ContactId':this[_0x635a('0x19')]['id'],'sentAt':moment()[_0x635a('0x1a')](_0x635a('0x1b')),'direction':_0x635a('0x1c')};if(this[_0x635a('0x1d')]===_0x635a('0x1e')||this[_0x635a('0x1d')]===_0x635a('0x1f')){_0x7e787a[_0x635a('0x20')]=this['interaction'][_0x635a('0x20')];}var _0x5f2bdf=this[_0x635a('0x1d')];if(_0x5f2bdf===_0x635a('0x21')){_0x7e787a['ChatWebsiteId']=this[_0x635a('0x22')]['id'];}else{_0x7e787a[_['upperFirst'](_0x5f2bdf)+_0x635a('0x23')]=this[_0x635a('0x22')]['id'];}_0x7e787a[_[_0x635a('0x24')](_0x5f2bdf)+_0x635a('0x25')]=this['interaction']['id'];if(this['interaction'][_0x635a('0x26')]){var _0x51c333=_0x5d4cdd[0x4];if(!_[_0x635a('0x27')](_0x51c333)){_0x7e787a['body']=utils[_0x635a('0x28')](_0x51c333,this);return rpc[_0x5f2bdf+_0x635a('0xe')][_0x635a('0xf')](_0x7e787a)[_0x635a('0x10')](function(_0x5aef18){logger[_0x635a('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x38103e,_0x7e787a[_0x635a('0xd')]);})[_0x635a('0x12')](function(_0x220c95){logger[_0x635a('0x29')]('[%s][DIALOGFLOWV2]\x20%s',_0x38103e,JSON['stringify'](_0x220c95));})[_0x635a('0x2a')](function(){logger[_0x635a('0x11')](_0x635a('0x2b'),_0x38103e);_0x12e13a[_0x635a('0x2c')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x38103e);_0x12e13a['stop']();}}else{var _0x4b8e86=this;var _0x580eeb=_0x5d4cdd[0x2][_0x635a('0x2d')](/\\n/g,'\x0a');var _0xca1eca={'credentials':{'private_key':_0x580eeb,'client_email':_0x5d4cdd[0x1]}};var _0x38e943=new dialogflow['SessionsClient'](_0xca1eca);var _0x536d0c=_0x38e943['sessionPath'](_0x5d4cdd[0x0],md5(_0x4b8e86[_0x635a('0x16')]['id']));var _0x17dd26={'session':_0x536d0c,'queryInput':{'text':{'text':_0x4b8e86[_0x635a('0x2e')][_0x635a('0xd')],'languageCode':_0x5d4cdd[0x3]||'en'}}};return _0x38e943[_0x635a('0x2f')](_0x17dd26)[_0x635a('0x10')](function(_0x11f0b3){if(_0x11f0b3&&_0x11f0b3['length']){_0x4b8e86['body'][_0x635a('0x30')]=_0x11f0b3;var _0x3ad11f=_0x11f0b3[0x0];var _0x2c6b07=_0x3ad11f[_0x635a('0x31')][_0x635a('0x32')]&&_0x3ad11f[_0x635a('0x31')][_0x635a('0x32')][_0x635a('0x33')]?_0x3ad11f['queryResult'][_0x635a('0x32')][_0x635a('0x33')][_0x635a('0x34')][_0x635a('0x35')]:![];_0x4b8e86[_0x635a('0xd')][_0x635a('0x36')]=_0x3ad11f['queryResult']['action'];_0x4b8e86[_0x635a('0xd')][_0x635a('0x37')]=_0x3ad11f[_0x635a('0x31')][_0x635a('0x38')];_0x4b8e86[_0x635a('0xd')][_0x635a('0x39')]=_0x3ad11f['queryResult'][_0x635a('0x32')]&&_0x3ad11f[_0x635a('0x31')][_0x635a('0x32')][_0x635a('0x33')]?_0x3ad11f[_0x635a('0x31')][_0x635a('0x32')][_0x635a('0x33')][_0x635a('0x34')][_0x635a('0x35')]:![];_0x4b8e86['body']['DIALOGFLOWV2_INTENTNAME']=_0x3ad11f['queryResult'][_0x635a('0x3a')]['name'];_0x4b8e86[_0x635a('0xd')][_0x635a('0x3b')]=_0x3ad11f[_0x635a('0x31')][_0x635a('0x3a')]['displayName'];_0x4b8e86[_0x635a('0xd')][_0x635a('0x3c')]=_0x3ad11f[_0x635a('0x31')][_0x635a('0x3a')][_0x635a('0x3d')];_0x4b8e86['body'][_0x635a('0x3e')]=_0x3ad11f[_0x635a('0x31')][_0x635a('0x3f')];_0x4b8e86['body'][_0x635a('0x40')]=_0x3ad11f[_0x635a('0x31')][_0x635a('0x41')];_0x4b8e86[_0x635a('0xd')]['DIALOGFLOWV2_SCORE']=_0x3ad11f[_0x635a('0x31')][_0x635a('0x42')];_0x7e787a[_0x635a('0x43')]=_0x635a('0x30');_0x7e787a[_0x635a('0x44')]=JSON[_0x635a('0x14')](_0x11f0b3);var _0x456be8=[];for(var _0x3a3f93=0x0;_0x3a3f93<_0x11f0b3[_0x635a('0x45')];_0x3a3f93++){var _0x570d00=_0x11f0b3[_0x3a3f93];if(_0x570d00&&_0x570d00[_0x635a('0x31')]&&_0x570d00[_0x635a('0x31')][_0x635a('0x46')]){_0x456be8[_0x635a('0x47')](createMessage(_0x38103e,_0x5f2bdf,_0x7e787a,_0x570d00[_0x635a('0x31')]['fulfillmentText']));}}return Promise[_0x635a('0x48')](_0x456be8)['then'](function(){if(_0x2c6b07){_0x12e13a[_0x635a('0x18')]();}else{_0x12e13a[_0x635a('0x2c')]();}})[_0x635a('0x12')](function(_0x77b179){logger[_0x635a('0x29')](_0x635a('0x13'),_0x38103e,JSON['stringify'](_0x77b179));_0x12e13a['next']();});}})[_0x635a('0x12')](function(_0x4ba419){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x38103e,_0x4ba419[_0x635a('0x2e')]);_0x12e13a['next']();});}}catch(_0x528061){logger[_0x635a('0x29')](_0x635a('0x13'),_0x38103e,JSON[_0x635a('0x14')](_0x528061));_0x12e13a[_0x635a('0x2c')]();}};}; \ No newline at end of file +var _0xce1a=['contact','format','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','then','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','fields','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','error','lodash','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x7ed855,_0x32cfa5){var _0x30d0f5=function(_0xc24d7c){while(--_0xc24d7c){_0x7ed855['push'](_0x7ed855['shift']());}};_0x30d0f5(++_0x32cfa5);}(_0xce1a,0xbf));var _0xace1=function(_0x539c77,_0x157bf9){_0x539c77=_0x539c77-0x0;var _0x2e131a=_0xce1a[_0x539c77];return _0x2e131a;};'use strict';var _=require(_0xace1('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require(_0xace1('0x1'));var logger=require(_0xace1('0x2'))(_0xace1('0x3'));var utils=require(_0xace1('0x4'));var rpc={'chatMessage':require(_0xace1('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xace1('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xace1('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x7c8f64,_0x2203ef,_0x7f3613,_0x576b34){return new Promise(function(_0x495cff,_0x26d569){var _0x4a5b7c=_[_0xace1('0x8')](_0x7f3613);_0x4a5b7c[_0xace1('0x9')]=_0x576b34;return rpc[_0x2203ef+_0xace1('0xa')][_0xace1('0xb')](_0x4a5b7c)['then'](function(){logger[_0xace1('0xc')](_0xace1('0xd'),_0x7c8f64,_0x4a5b7c['body']);_0x495cff();})[_0xace1('0xe')](function(_0x1f4ba0){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x7c8f64,JSON['stringify'](_0x1f4ba0));_0x26d569(_0x1f4ba0);});});}exports[_0xace1('0xf')]=function(_0x2f59f3,_0x757cdc){return function(_0x4f3995){try{if(!_['isNil'](this['interaction'][_0xace1('0x10')])){logger[_0xace1('0xc')](_0xace1('0xd'),_0x2f59f3,_0xace1('0x11'));return _0x4f3995[_0xace1('0x12')]();}var _0x303080={'ContactId':this[_0xace1('0x13')]['id'],'sentAt':moment()[_0xace1('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xace1('0x15')]===_0xace1('0x16')||this['channel']===_0xace1('0x17')){_0x303080[_0xace1('0x18')]=this[_0xace1('0x19')][_0xace1('0x18')];}var _0x28ab49=this['channel'];if(_0x28ab49==='chat'){_0x303080[_0xace1('0x1a')]=this['account']['id'];}else{_0x303080[_[_0xace1('0x1b')](_0x28ab49)+_0xace1('0x1c')]=this[_0xace1('0x1d')]['id'];}_0x303080[_['upperFirst'](_0x28ab49)+_0xace1('0x1e')]=this[_0xace1('0x19')]['id'];if(this['interaction'][_0xace1('0x1f')]){var _0x46189d=_0x757cdc[0x4];if(!_[_0xace1('0x20')](_0x46189d)){_0x303080[_0xace1('0x9')]=utils[_0xace1('0x21')](_0x46189d,this);return rpc[_0x28ab49+_0xace1('0xa')][_0xace1('0xb')](_0x303080)[_0xace1('0x22')](function(_0x324b52){logger[_0xace1('0xc')](_0xace1('0xd'),_0x2f59f3,_0x303080[_0xace1('0x9')]);})[_0xace1('0xe')](function(_0x20706f){logger['error'](_0xace1('0xd'),_0x2f59f3,JSON[_0xace1('0x23')](_0x20706f));})[_0xace1('0x24')](function(){logger[_0xace1('0xc')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2f59f3);_0x4f3995[_0xace1('0x25')]();});}else{logger['info'](_0xace1('0x26'),_0x2f59f3);_0x4f3995[_0xace1('0x25')]();}}else{var _0x1d356b=this;var _0x15ca0d=_0x757cdc[0x2]['replace'](/\\n/g,'\x0a');var _0x4d1889={'credentials':{'private_key':_0x15ca0d,'client_email':_0x757cdc[0x1]}};var _0x2794b2=new dialogflow[(_0xace1('0x27'))](_0x4d1889);var _0x1dacd0=_0x2794b2[_0xace1('0x28')](_0x757cdc[0x0],md5(_0x1d356b['interaction']['id']));var _0x4d241d={'session':_0x1dacd0,'queryInput':{'text':{'text':_0x1d356b[_0xace1('0x29')][_0xace1('0x9')],'languageCode':_0x757cdc[0x3]||'en'}}};return _0x2794b2[_0xace1('0x2a')](_0x4d241d)[_0xace1('0x22')](function(_0x452423){if(_0x452423&&_0x452423[_0xace1('0x2b')]){_0x1d356b[_0xace1('0x9')][_0xace1('0x2c')]=_0x452423;var _0xf78389=_0x452423[0x0];var _0x3d7ba7=_0xf78389[_0xace1('0x2d')][_0xace1('0x2e')]&&_0xf78389[_0xace1('0x2d')][_0xace1('0x2e')]['fields']?_0xf78389['queryResult'][_0xace1('0x2e')]['fields'][_0xace1('0x2f')][_0xace1('0x30')]:![];_0x1d356b[_0xace1('0x9')][_0xace1('0x31')]=_0xf78389[_0xace1('0x2d')][_0xace1('0x32')];_0x1d356b['body'][_0xace1('0x33')]=_0xf78389[_0xace1('0x2d')][_0xace1('0x34')];_0x1d356b['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0xf78389[_0xace1('0x2d')][_0xace1('0x2e')]&&_0xf78389[_0xace1('0x2d')][_0xace1('0x2e')][_0xace1('0x35')]?_0xf78389[_0xace1('0x2d')][_0xace1('0x2e')][_0xace1('0x35')][_0xace1('0x2f')][_0xace1('0x30')]:![];_0x1d356b[_0xace1('0x9')][_0xace1('0x36')]=_0xf78389[_0xace1('0x2d')]['intent']['name'];_0x1d356b['body'][_0xace1('0x37')]=_0xf78389[_0xace1('0x2d')]['intent'][_0xace1('0x38')];_0x1d356b[_0xace1('0x9')][_0xace1('0x39')]=_0xf78389[_0xace1('0x2d')][_0xace1('0x3a')]['isFallback'];_0x1d356b['body']['DIALOGFLOWV2_LANGUAGECODE']=_0xf78389[_0xace1('0x2d')][_0xace1('0x3b')];_0x1d356b[_0xace1('0x9')][_0xace1('0x3c')]=_0xf78389['queryResult'][_0xace1('0x3d')];_0x1d356b[_0xace1('0x9')][_0xace1('0x3e')]=_0xf78389[_0xace1('0x2d')][_0xace1('0x3f')];_0x303080[_0xace1('0x40')]=_0xace1('0x2c');_0x303080[_0xace1('0x41')]=JSON[_0xace1('0x23')](_0x452423);var _0x3e2082=[];for(var _0x2282ad=0x0;_0x2282ad<_0x452423[_0xace1('0x2b')];_0x2282ad++){var _0x2ea27d=_0x452423[_0x2282ad];if(_0x2ea27d&&_0x2ea27d['queryResult']&&_0x2ea27d[_0xace1('0x2d')][_0xace1('0x42')]){_0x3e2082[_0xace1('0x43')](createMessage(_0x2f59f3,_0x28ab49,_0x303080,_0x2ea27d[_0xace1('0x2d')][_0xace1('0x42')]));}}return Promise[_0xace1('0x44')](_0x3e2082)[_0xace1('0x22')](function(){if(_0x3d7ba7){_0x4f3995[_0xace1('0x12')]();}else{_0x4f3995['stop']();}})[_0xace1('0xe')](function(_0x5941fe){logger[_0xace1('0x45')](_0xace1('0xd'),_0x2f59f3,JSON['stringify'](_0x5941fe));_0x4f3995['next']();});}})['catch'](function(_0x55d3ba){logger[_0xace1('0x45')](_0xace1('0xd'),_0x2f59f3,_0x55d3ba[_0xace1('0x29')]);_0x4f3995['next']();});}}catch(_0x3626a1){logger[_0xace1('0x45')](_0xace1('0xd'),_0x2f59f3,JSON[_0xace1('0x23')](_0x3626a1));_0x4f3995[_0xace1('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 32089da..caf41ad 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 _0xc5d8=['routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger'];(function(_0x3e4169,_0x58efd2){var _0x28b204=function(_0x52a8e2){while(--_0x52a8e2){_0x3e4169['push'](_0x3e4169['shift']());}};_0x28b204(++_0x58efd2);}(_0xc5d8,0x132));var _0x8c5d=function(_0x4adc6d,_0x11275c){_0x4adc6d=_0x4adc6d-0x0;var _0x4d42e5=_0xc5d8[_0x4adc6d];return _0x4d42e5;};'use strict';var schema=require(_0x8c5d('0x0'));var _=require('lodash');var htmlToText=require(_0x8c5d('0x1'));var utils=require(_0x8c5d('0x2'));var logger=require(_0x8c5d('0x3'))(_0x8c5d('0x4'));var gotoif=schema({'condition':{'type':_0x8c5d('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x8c5d('0x6'),'message':_0x8c5d('0x7')},'priorityFalse':{'type':_0x8c5d('0x6'),'message':_0x8c5d('0x8')}});exports[_0x8c5d('0x9')]=function(_0x5be335,_0x188a0f){return function(_0x5ebdb6){try{var _0x20b9bc={'condition':htmlToText[_0x8c5d('0xa')](utils[_0x8c5d('0xb')](_0x188a0f[0x0],this),{'wordwrap':![]})[_0x8c5d('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x188a0f[0x1],'priorityFalse':_0x188a0f[0x2]};var _0x4aa31c=gotoif[_0x8c5d('0x0')](_0x20b9bc,{'typecast':!![]});if(_0x4aa31c[_0x8c5d('0xd')]){logger[_0x8c5d('0xe')](_0x8c5d('0xf'),_0x5be335,_['map'](_0x4aa31c,_0x8c5d('0x10'))[_0x8c5d('0x11')](',\x20'));_0x5ebdb6[_0x8c5d('0x12')]();}else{try{var _0x3e4bc4=eval('('+_0x20b9bc[_0x8c5d('0x13')]+')');var _0x2e5529=_0x3e4bc4?_0x20b9bc[_0x8c5d('0x14')]:_0x20b9bc[_0x8c5d('0x15')];logger[_0x8c5d('0x16')](_0x8c5d('0x17'),_0x5be335,_0x20b9bc['condition'],_0x3e4bc4,_0x2e5529||_0x8c5d('0x18'));if(_0x2e5529){var _0x2ef157=_[_0x8c5d('0x19')](_0x5ebdb6[_0x8c5d('0x1a')](),{'p':_0x2e5529});if(_0x2ef157>=0x0){logger[_0x8c5d('0x16')](_0x8c5d('0x1b'),_0x5be335,_0x2e5529||_0x8c5d('0x18'),_0x2ef157);_0x5ebdb6[_0x8c5d('0x18')](_0x2ef157);}else{logger['info'](_0x8c5d('0x1c'),_0x5be335,_0x2e5529||_0x8c5d('0x18'));_0x5ebdb6['stop']();}}else{_0x5ebdb6[_0x8c5d('0x18')]();}}catch(_0x1ff9e2){logger[_0x8c5d('0xe')](_0x8c5d('0x1d'),_0x5be335,_0x1ff9e2['message']);_0x5ebdb6[_0x8c5d('0x12')]();}}}catch(_0x17b0e5){logger[_0x8c5d('0xe')](_0x8c5d('0xf'),_0x5be335,JSON[_0x8c5d('0x1e')](_0x17b0e5));_0x5ebdb6[_0x8c5d('0x12')]();}};}; \ No newline at end of file +var _0x471e=['message','join','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x471e,0x196));var _0xe471=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x471e[_0x2641f9];return _0x585741;};'use strict';var schema=require(_0xe471('0x0'));var _=require('lodash');var htmlToText=require(_0xe471('0x1'));var utils=require('./utils');var logger=require(_0xe471('0x2'))(_0xe471('0x3'));var gotoif=schema({'condition':{'type':_0xe471('0x4'),'required':!![],'message':_0xe471('0x5')},'priorityTrue':{'type':_0xe471('0x6'),'message':_0xe471('0x7')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xe471('0x8')]=function(_0x471a4d,_0x1341b8){return function(_0x58ae36){try{var _0x2f218c={'condition':htmlToText['fromString'](utils[_0xe471('0x9')](_0x1341b8[0x0],this),{'wordwrap':![]})[_0xe471('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1341b8[0x1],'priorityFalse':_0x1341b8[0x2]};var _0x287387=gotoif['validate'](_0x2f218c,{'typecast':!![]});if(_0x287387[_0xe471('0xb')]){logger['error'](_0xe471('0xc'),_0x471a4d,_[_0xe471('0xd')](_0x287387,_0xe471('0xe'))[_0xe471('0xf')](',\x20'));_0x58ae36[_0xe471('0x10')]();}else{try{var _0x3cf9da=eval('('+_0x2f218c[_0xe471('0x11')]+')');var _0x2d65f7=_0x3cf9da?_0x2f218c[_0xe471('0x12')]:_0x2f218c['priorityFalse'];logger['info'](_0xe471('0x13'),_0x471a4d,_0x2f218c[_0xe471('0x11')],_0x3cf9da,_0x2d65f7||_0xe471('0x14'));if(_0x2d65f7){var _0x5bf163=_[_0xe471('0x15')](_0x58ae36[_0xe471('0x16')](),{'p':_0x2d65f7});if(_0x5bf163>=0x0){logger[_0xe471('0x17')](_0xe471('0x18'),_0x471a4d,_0x2d65f7||'next',_0x5bf163);_0x58ae36[_0xe471('0x14')](_0x5bf163);}else{logger[_0xe471('0x17')](_0xe471('0x19'),_0x471a4d,_0x2d65f7||_0xe471('0x14'));_0x58ae36[_0xe471('0x10')]();}}else{_0x58ae36[_0xe471('0x14')]();}}catch(_0x34eb97){logger[_0xe471('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x471a4d,_0x34eb97[_0xe471('0xe')]);_0x58ae36[_0xe471('0x10')]();}}}catch(_0x365ec2){logger[_0xe471('0x1a')](_0xe471('0xc'),_0x471a4d,JSON[_0xe471('0x1b')](_0x365ec2));_0x58ae36[_0xe471('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index a32ee8c..d981560 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 _0x0419=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','error','[%s][GOTOP]\x20%s','map','message','stop'];(function(_0x308de1,_0xdf892f){var _0x38fc36=function(_0x5b4adf){while(--_0x5b4adf){_0x308de1['push'](_0x308de1['shift']());}};_0x38fc36(++_0xdf892f);}(_0x0419,0xe5));var _0x9041=function(_0x4f6400,_0x379b1b){_0x4f6400=_0x4f6400-0x0;var _0x4e447=_0x0419[_0x4f6400];return _0x4e447;};'use strict';var schema=require(_0x9041('0x0'));var _=require(_0x9041('0x1'));var logger=require(_0x9041('0x2'))(_0x9041('0x3'));var gotop=schema({'priority':{'type':_0x9041('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x9041('0x5')]=function(_0x2074ef,_0x5ad44a){return function(_0x206ffc){try{var _0x8cca7={'priority':_0x5ad44a[0x0]};var _0x1d806b=gotop[_0x9041('0x0')](_0x8cca7,{'typecast':!![]});if(_0x1d806b['length']){logger[_0x9041('0x6')](_0x9041('0x7'),_0x2074ef,_[_0x9041('0x8')](_0x1d806b,_0x9041('0x9'))['join'](',\x20'));_0x206ffc[_0x9041('0xa')]();}else{logger[_0x9041('0xb')](_0x9041('0xc'),_0x2074ef,_0x8cca7[_0x9041('0xd')]);if(_0x8cca7[_0x9041('0xd')]){var _0xb7e8d9=_[_0x9041('0xe')](_0x206ffc[_0x9041('0xf')](),{'p':_0x8cca7[_0x9041('0xd')]});if(_0xb7e8d9>=0x0){logger[_0x9041('0xb')](_0x9041('0x10'),_0x2074ef,_0x8cca7[_0x9041('0xd')]||_0x9041('0x11'),_0xb7e8d9);_0x206ffc['next'](_0xb7e8d9);}else{logger['info'](_0x9041('0x12'),_0x2074ef,_0x8cca7['priority']||'next');_0x206ffc['stop']();}}else{_0x206ffc[_0x9041('0x11')]();}}}catch(_0x48da2a){logger[_0x9041('0x6')](_0x9041('0x7'),_0x2074ef,JSON[_0x9041('0x13')](_0x48da2a));_0x206ffc[_0x9041('0xa')]();}};}; \ No newline at end of file +var _0x95fa=['priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][GOTOP]\x20%s','map','message','join','stop','info'];(function(_0x33cbe0,_0x3e133a){var _0x21d5c1=function(_0x49c02d){while(--_0x49c02d){_0x33cbe0['push'](_0x33cbe0['shift']());}};_0x21d5c1(++_0x3e133a);}(_0x95fa,0x1f4));var _0xa95f=function(_0x34d4e8,_0xd1fee2){_0x34d4e8=_0x34d4e8-0x0;var _0x19780c=_0x95fa[_0x34d4e8];return _0x19780c;};'use strict';var schema=require('validate');var _=require(_0xa95f('0x0'));var logger=require('../../../../config/logger')(_0xa95f('0x1'));var gotop=schema({'priority':{'type':_0xa95f('0x2'),'required':!![],'message':_0xa95f('0x3')}});exports[_0xa95f('0x4')]=function(_0x400bcf,_0x2dd967){return function(_0x569591){try{var _0x7bb060={'priority':_0x2dd967[0x0]};var _0x1b8606=gotop[_0xa95f('0x5')](_0x7bb060,{'typecast':!![]});if(_0x1b8606[_0xa95f('0x6')]){logger['error'](_0xa95f('0x7'),_0x400bcf,_[_0xa95f('0x8')](_0x1b8606,_0xa95f('0x9'))[_0xa95f('0xa')](',\x20'));_0x569591[_0xa95f('0xb')]();}else{logger[_0xa95f('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x400bcf,_0x7bb060[_0xa95f('0xd')]);if(_0x7bb060['priority']){var _0x221b36=_[_0xa95f('0xe')](_0x569591['rules'](),{'p':_0x7bb060[_0xa95f('0xd')]});if(_0x221b36>=0x0){logger[_0xa95f('0xc')](_0xa95f('0xf'),_0x400bcf,_0x7bb060[_0xa95f('0xd')]||'next',_0x221b36);_0x569591[_0xa95f('0x10')](_0x221b36);}else{logger[_0xa95f('0xc')](_0xa95f('0x11'),_0x400bcf,_0x7bb060['priority']||_0xa95f('0x10'));_0x569591[_0xa95f('0xb')]();}}else{_0x569591[_0xa95f('0x10')]();}}}catch(_0x23632b){logger['error'](_0xa95f('0x7'),_0x400bcf,JSON[_0xa95f('0x12')](_0x23632b));_0x569591['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index b911cd2..56b8b56 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 _0x43a5=['then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','InteractionId','Message'];(function(_0x2c7e63,_0x48d19c){var _0x46352b=function(_0x1bd1e7){while(--_0x1bd1e7){_0x2c7e63['push'](_0x2c7e63['shift']());}};_0x46352b(++_0x48d19c);}(_0x43a5,0xb0));var _0x543a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x43a5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x543a('0x0'));var utils=require(_0x543a('0x1'));var logger=require(_0x543a('0x2'))(_0x543a('0x3'));var rpc={'chatMessage':require(_0x543a('0x4')),'openchannelMessage':require(_0x543a('0x5')),'mailMessage':require(_0x543a('0x6')),'smsMessage':require(_0x543a('0x7')),'faxMessage':require(_0x543a('0x8')),'whatsappMessage':require(_0x543a('0x9'))};exports[_0x543a('0xa')]=function(_0xf40279,_0x58d6cf){return function(_0x437c97){try{var _0x40b408={'body':utils[_0x543a('0xb')](_0x58d6cf[0x0],this),'ContactId':this[_0x543a('0xc')]['id']};if(this[_0x543a('0xd')]===_0x543a('0xe')){_0x40b408[_0x543a('0xf')]=this[_0x543a('0x10')]['id'];}else{_0x40b408[_['upperFirst'](this['channel'])+_0x543a('0x11')]=this[_0x543a('0x10')]['id'];}_0x40b408[_['upperFirst'](this[_0x543a('0xd')])+_0x543a('0x12')]=this['interaction']['id'];if(rpc[this[_0x543a('0xd')]+_0x543a('0x13')]){return rpc[this[_0x543a('0xd')]+'Message']['create'](_0x40b408)[_0x543a('0x14')](function(_0xab606e){logger[_0x543a('0x15')](_0x543a('0x16'),_0xf40279,_0x40b408[_0x543a('0x17')]);_0x437c97['next']();})[_0x543a('0x18')](function(_0x52127c){logger[_0x543a('0x19')]('[%s][MESSAGE]\x20%s',_0xf40279,JSON[_0x543a('0x1a')](_0x52127c));_0x437c97[_0x543a('0x1b')]();});}}catch(_0x502f18){logger['error'](_0x543a('0x16'),_0xf40279,JSON[_0x543a('0x1a')](_0x502f18));_0x437c97[_0x543a('0x1b')]();}};}; \ No newline at end of file +var _0x388a=['catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','ChatWebsiteId','account','upperFirst','channel','AccountId','interaction','Message','create','then','[%s][MESSAGE]\x20%s'];(function(_0xc0eba8,_0x545c46){var _0x412f96=function(_0x54d2b1){while(--_0x54d2b1){_0xc0eba8['push'](_0xc0eba8['shift']());}};_0x412f96(++_0x545c46);}(_0x388a,0xdc));var _0xa388=function(_0xd64c2f,_0x1a8358){_0xd64c2f=_0xd64c2f-0x0;var _0x67da6a=_0x388a[_0xd64c2f];return _0x67da6a;};'use strict';var _=require('lodash');var utils=require(_0xa388('0x0'));var logger=require(_0xa388('0x1'))(_0xa388('0x2'));var rpc={'chatMessage':require(_0xa388('0x3')),'openchannelMessage':require(_0xa388('0x4')),'mailMessage':require(_0xa388('0x5')),'smsMessage':require(_0xa388('0x6')),'faxMessage':require(_0xa388('0x7')),'whatsappMessage':require(_0xa388('0x8'))};exports[_0xa388('0x9')]=function(_0x15ca59,_0x2d30c1){return function(_0x297742){try{var _0x517b08={'body':utils['getMustacheRender'](_0x2d30c1[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x517b08[_0xa388('0xa')]=this[_0xa388('0xb')]['id'];}else{_0x517b08[_[_0xa388('0xc')](this[_0xa388('0xd')])+_0xa388('0xe')]=this[_0xa388('0xb')]['id'];}_0x517b08[_[_0xa388('0xc')](this[_0xa388('0xd')])+'InteractionId']=this[_0xa388('0xf')]['id'];if(rpc[this[_0xa388('0xd')]+_0xa388('0x10')]){return rpc[this[_0xa388('0xd')]+_0xa388('0x10')][_0xa388('0x11')](_0x517b08)[_0xa388('0x12')](function(_0x32abba){logger['info'](_0xa388('0x13'),_0x15ca59,_0x517b08['body']);_0x297742['next']();})[_0xa388('0x14')](function(_0x36f8eb){logger[_0xa388('0x15')]('[%s][MESSAGE]\x20%s',_0x15ca59,JSON[_0xa388('0x16')](_0x36f8eb));_0x297742[_0xa388('0x17')]();});}}catch(_0xb5a97f){logger[_0xa388('0x15')](_0xa388('0x13'),_0x15ca59,JSON[_0xa388('0x16')](_0xb5a97f));_0x297742[_0xa388('0x17')]();}};}; \ 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 1be4984..8650eaa 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 _0x15b7=['stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x436325,_0x342028){var _0x534aaa=function(_0x87d757){while(--_0x87d757){_0x436325['push'](_0x436325['shift']());}};_0x534aaa(++_0x342028);}(_0x15b7,0x88));var _0x715b=function(_0x1e0766,_0x1164df){_0x1e0766=_0x1e0766-0x0;var _0x10b762=_0x15b7[_0x1e0766];return _0x10b762;};'use strict';var utils=require(_0x715b('0x0'));var logger=require(_0x715b('0x1'))(_0x715b('0x2'));exports[_0x715b('0x3')]=function(_0x50d383,_0x262b77){return function(_0x467d64){try{logger['info'](_0x715b('0x4'),_0x50d383,utils[_0x715b('0x5')](_0x262b77[0x0],this));_0x467d64[_0x715b('0x6')]();}catch(_0x821cf3){logger[_0x715b('0x7')](_0x715b('0x4'),_0x50d383,JSON['stringify'](_0x821cf3));_0x467d64[_0x715b('0x8')]();}};}; \ No newline at end of file +var _0xb653=['getMustacheRender','next','error','stringify','stop','../../../../config/logger','routing','consequence','info'];(function(_0x30f054,_0x2dd199){var _0x502e20=function(_0x470dd9){while(--_0x470dd9){_0x30f054['push'](_0x30f054['shift']());}};_0x502e20(++_0x2dd199);}(_0xb653,0x16d));var _0x3b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb653[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require('./utils');var logger=require(_0x3b65('0x0'))(_0x3b65('0x1'));exports[_0x3b65('0x2')]=function(_0x496d42,_0x3fe81f){return function(_0x160b7a){try{logger[_0x3b65('0x3')]('[%s][NOOP]\x20%s',_0x496d42,utils[_0x3b65('0x4')](_0x3fe81f[0x0],this));_0x160b7a[_0x3b65('0x5')]();}catch(_0x360425){logger[_0x3b65('0x6')]('[%s][NOOP]\x20%s',_0x496d42,JSON[_0x3b65('0x7')](_0x360425));_0x160b7a[_0x3b65('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d1bb7c7..546bc88 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 _0x629c=['next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','queue','from','joinAt','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','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','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x629c,0x19b));var _0xc629=function(_0x32f8a0,_0x3441c6){_0x32f8a0=_0x32f8a0-0x0;var _0x34b816=_0x629c[_0x32f8a0];return _0x34b816;};'use strict';var schema=require('validate');var _=require(_0xc629('0x0'));var util=require(_0xc629('0x1'));var seqqueue=require(_0xc629('0x2'));var moment=require(_0xc629('0x3'));var Redis=require('ioredis');var config=require(_0xc629('0x4'));var logger=require(_0xc629('0x5'))(_0xc629('0x6'));var strategy=require('./strategy');config['redis']=_[_0xc629('0x7')](config[_0xc629('0x8')],{'host':_0xc629('0x9'),'port':0x18eb});var io=require(_0xc629('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id','account',_0xc629('0xb'),_0xc629('0xc'),_0xc629('0xd')];function emit(_0xdda66b,_0xbd1577,_0x2d3fff){io['to'](_0xdda66b)['emit'](_0xbd1577,_0x2d3fff);}function emitChannelQueueInteraction(_0x5a7682,_0x57f13b,_0x53b34d,_0x19c5c6,_0x10b5be,_0x4758ea,_0x22a969,_0x2b5020){var _0x4adf06=_[_0xc629('0xe')](_0x53b34d);_0x4adf06['queue_id']=_0x2b5020;_0x4adf06[_0xc629('0xb')]=_0x57f13b;_0x4adf06[_0xc629('0xf')]=_0x19c5c6;_0x4adf06['id']=_0x10b5be;if(_0x4758ea){_0x22a969[util[_0xc629('0x10')](_0xc629('0x11'),_0x5a7682)][_0x10b5be]=_[_0xc629('0x12')](_0x4adf06,attributes);}else{delete _0x22a969[util[_0xc629('0x10')](_0xc629('0x11'),_0x5a7682)][_0x10b5be];}emit(util['format'](_0xc629('0x13'),_0x5a7682,_0x57f13b),util['format'](_0xc629('0x14'),_0x5a7682,_0x4758ea?'save':'remove'),_[_0xc629('0x12')](_0x4adf06,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc629('0x15')),'chatQueueReport':require(_0xc629('0x16')),'smsQueueReport':require(_0xc629('0x17')),'faxQueueReport':require(_0xc629('0x18')),'whatsappQueueReport':require(_0xc629('0x19'))};var queue=schema({'name':{'type':_0xc629('0x1a'),'required':!![],'message':_0xc629('0x1b')},'timeout':{'type':_0xc629('0x1c'),'message':_0xc629('0x1d')}});function startRouting(_0x1784ad,_0x39bd97,_0x576fb0,_0x17533a){if(_0x1784ad&&_0x39bd97&&_0x576fb0){_0x39bd97[_0xc629('0x1e')]+=0x1;var _0x2a64d0={'uniqueid':_0x1784ad,'from':_0x576fb0[_0xc629('0x1f')]?_0x576fb0[_0xc629('0x1f')]['from']:'','joinAt':moment()[_0xc629('0x10')](_0xc629('0x20')),'ContactId':_0x576fb0[_0xc629('0x21')]?_0x576fb0[_0xc629('0x21')]['id']:null,'ListId':_0x576fb0['list']?_0x576fb0[_0xc629('0x22')]['id']:null};_0x2a64d0[_[_0xc629('0x23')](_0x576fb0[_0xc629('0x24')])+_0xc629('0x25')]=_0x39bd97['id']||null;_0x2a64d0[_[_0xc629('0x23')](_0x576fb0[_0xc629('0x24')])+_0xc629('0x26')]=_0x576fb0[_0xc629('0x27')]?_0x576fb0[_0xc629('0x27')]['id']:null;_0x2a64d0[_[_0xc629('0x23')](_0x576fb0[_0xc629('0x24')])+_0xc629('0x28')]=_0x576fb0[_0xc629('0x29')]?_0x576fb0[_0xc629('0x29')]['id']:null;_0x2a64d0[_[_0xc629('0x23')](_0x576fb0['channel'])+(_0x576fb0[_0xc629('0x24')]!==_0xc629('0x2a')?_0xc629('0x2b'):_0xc629('0x2c'))]=_0x576fb0['account']?_0x576fb0['account']['id']:null;logger[_0xc629('0x2d')](util[_0xc629('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x1784ad,_0x39bd97[_0xc629('0x2e')]));emitChannelQueueInteraction(_0x576fb0[_0xc629('0x24')],_0x39bd97[_0xc629('0x2e')],_0x2a64d0,_0x576fb0[_0xc629('0xf')][_0xc629('0x2e')],_0x576fb0['message']['id'],!![],_0x17533a,_0x39bd97['id']);if(rpc[_0x576fb0[_0xc629('0x24')]+'QueueReport']){return rpc[_0x576fb0['channel']+_0xc629('0x2f')][_0xc629('0x30')](_0x2a64d0)[_0xc629('0x31')](function(_0x2fb07b){logger[_0xc629('0x32')](_0xc629('0x33'));});}}}function stopRouting(_0x407a7b,_0xb85bec,_0x36e57b,_0x1d2b8b){if(_0x407a7b&&_0xb85bec){_0xb85bec[_0xc629('0x1e')]-=0x1;var _0x46d601={'leaveAt':moment()[_0xc629('0x10')](_0xc629('0x20')),'acceptAt':moment()[_0xc629('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util[_0xc629('0x10')](_0xc629('0x34'),_0x407a7b,_0xb85bec[_0xc629('0x2e')]));emitChannelQueueInteraction(_0x36e57b[_0xc629('0x24')],_0xb85bec[_0xc629('0x2e')],_0x36e57b[_0xc629('0x1f')],_0x36e57b[_0xc629('0xf')][_0xc629('0x2e')],_0x36e57b[_0xc629('0x29')]['id'],![],_0x1d2b8b,_0xb85bec['id']);if(rpc[_0x36e57b[_0xc629('0x24')]+_0xc629('0x2f')]){return rpc[_0x36e57b[_0xc629('0x24')]+'QueueReport'][_0xc629('0x35')](_0x407a7b,_0x46d601)[_0xc629('0x31')](function(_0x37b7a1){logger[_0xc629('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x49a495,_0x30a557,_0x259ad4,_0x4e3269){if(_0x49a495&&_0x30a557){_0x30a557[_0xc629('0x1e')]-=0x1;var _0x496f3e={'leaveAt':moment()[_0xc629('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xc629('0x10')](_0xc629('0x20')),'reason':_0xc629('0x36')};logger[_0xc629('0x2d')](util['format'](_0xc629('0x37'),_0x49a495,_0x30a557[_0xc629('0x2e')]));emitChannelQueueInteraction(_0x259ad4[_0xc629('0x24')],_0x30a557[_0xc629('0x2e')],_0x259ad4['body'],_0x259ad4[_0xc629('0xf')][_0xc629('0x2e')],_0x259ad4[_0xc629('0x29')]['id'],![],_0x4e3269);if(rpc[_0x259ad4[_0xc629('0x24')]+_0xc629('0x2f')]){return rpc[_0x259ad4[_0xc629('0x24')]+'QueueReport']['update'](_0x49a495,_0x496f3e)['catch'](function(_0x547f44){logger[_0xc629('0x32')](_0xc629('0x38'));});}}}function handleFindQueue(_0x2016de){return function(_0x1b2f47){return _0x1b2f47['name'][_0xc629('0x39')]()===_0x2016de[_0xc629('0x39')]();};}exports[_0xc629('0x3a')]=function(_0x3336ef,_0x33ec1c,_0x206577,_0x3e7c64){return function(_0x3502bf){try{var _0x282489={'name':_0x33ec1c[0x0],'timeout':_0x33ec1c[0x1]};var _0x3f490e=queue[_0xc629('0x3b')](_0x282489,{'typecast':!![]});if(_0x3f490e[_0xc629('0x3c')]){logger[_0xc629('0x32')](_0xc629('0x3d'),_0x3336ef,_[_0xc629('0x3e')](_0x3f490e,'message')[_0xc629('0x3f')](',\x20'));_0x3502bf[_0xc629('0x40')]();}else{var _0x3e0705=_[_0xc629('0x41')](_0x206577[_0x3e7c64[_0xc629('0x24')]+'Queues'],handleFindQueue(_0x282489['name']));if(_0x3e0705){startRouting(_0x3336ef,_0x3e0705,_0x3e7c64,_0x206577);var _0x2cd3bc=(_0x3e0705[_0xc629('0x36')]||0xa)*0x3e8;var _0x26e449=(_0x282489[_0xc629('0x36')]||0x14)*0x3e8;var _0x5ad59d,_0x3c2951;if(_0x2cd3bc>_0x26e449){_0x26e449=_0x2cd3bc;}var _0x1220e3=seqqueue[_0xc629('0x42')](_0x2cd3bc);_0x1220e3['id']=_0x3336ef;_0x1220e3[_0xc629('0x43')]=_0x2cd3bc;_0x1220e3[_0xc629('0x44')]=_0x26e449;_0x1220e3['channel']=_0x3e7c64[_0xc629('0x24')];_0x206577[_0xc629('0x45')][_0x3336ef]['on'](_0xc629('0x46'),function(){logger[_0xc629('0x2d')](_0xc629('0x47'),_0x3336ef);stopRouting(_0x3336ef,_0x3e0705,_0x3e7c64,_0x206577);clearTimeout(_0x5ad59d);_0x5ad59d=undefined;_0x1220e3[_0xc629('0x48')](!![]);if(_0x206577[_0xc629('0x45')][_0x3336ef]){delete _0x206577['rules'][_0x3336ef];}_0x3502bf['stop']();});_0x206577[_0xc629('0x45')][_0x3336ef]['on'](_0xc629('0x49'),function(){if(_0x206577[_0xc629('0x45')][_0x3336ef]){delete _0x206577['rules'][_0x3336ef];}});_0x5ad59d=setTimeout(function(){logger[_0xc629('0x2d')](_0xc629('0x4a'),_0x3336ef);endRouting(_0x3336ef,_0x3e0705,_0x3e7c64,_0x206577);clearTimeout(_0x5ad59d);_0x1220e3[_0xc629('0x48')](!![]);_0x3502bf[_0xc629('0x4b')]();},_0x26e449);switch(_0x3e0705['strategy']){case'rrmemory':strategy[_0xc629('0x4c')](_0x1220e3,_0x3e0705,_0x206577,_0x3e7c64);break;default:strategy[_0xc629('0x4d')](_0x1220e3,_0x3e0705,_0x206577,_0x3e7c64);}}else{logger[_0xc629('0x32')](_0xc629('0x4e'),_0x3336ef,_0x282489[_0xc629('0x2e')]);_0x3502bf[_0xc629('0x40')]();}}}catch(_0x30ffa8){console[_0xc629('0x4f')](_0x30ffa8);logger[_0xc629('0x32')](_0xc629('0x3d'),_0x3336ef,_0x30ffa8[_0xc629('0x50')]);_0x3502bf['stop']();}};}; \ No newline at end of file +var _0x91c5=['QueueReport','error','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','join','stop','find','timeout','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','stack','lodash','moment','./strategy','redis','localhost','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','upperFirst','InteractionId','interaction','channel','MessageId','chat','AccountId','name','message'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x91c5,0x124));var _0x591c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x91c5[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require('validate');var _=require(_0x591c('0x0'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0x591c('0x1'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x591c('0x2'));config[_0x591c('0x3')]=_['defaults'](config[_0x591c('0x3')],{'host':_0x591c('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x591c('0x3')]));var attributes=['id','queue_id',_0x591c('0x5'),_0x591c('0x6'),_0x591c('0x7'),_0x591c('0x8')];function emit(_0x38ac70,_0x14741e,_0x3c8bd1){io['to'](_0x38ac70)[_0x591c('0x9')](_0x14741e,_0x3c8bd1);}function emitChannelQueueInteraction(_0x2adbb6,_0x3f1a4a,_0x5c9e,_0x2a3a76,_0x38cc76,_0x38699b,_0x180ac0,_0x2c6d89){var _0x548f0e=_[_0x591c('0xa')](_0x5c9e);_0x548f0e[_0x591c('0xb')]=_0x2c6d89;_0x548f0e['queue']=_0x3f1a4a;_0x548f0e[_0x591c('0x5')]=_0x2a3a76;_0x548f0e['id']=_0x38cc76;if(_0x38699b){_0x180ac0[util[_0x591c('0xc')](_0x591c('0xd'),_0x2adbb6)][_0x38cc76]=_[_0x591c('0xe')](_0x548f0e,attributes);}else{delete _0x180ac0[util[_0x591c('0xc')](_0x591c('0xd'),_0x2adbb6)][_0x38cc76];}emit(util[_0x591c('0xc')](_0x591c('0xf'),_0x2adbb6,_0x3f1a4a),util[_0x591c('0xc')]('%s_queue_waiting_interaction:%s',_0x2adbb6,_0x38699b?_0x591c('0x10'):'remove'),_[_0x591c('0xe')](_0x548f0e,attributes));}var rpc={'openchannelQueueReport':require(_0x591c('0x11')),'mailQueueReport':require(_0x591c('0x12')),'chatQueueReport':require(_0x591c('0x13')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x591c('0x14')),'whatsappQueueReport':require(_0x591c('0x15'))};var queue=schema({'name':{'type':_0x591c('0x16'),'required':!![],'message':_0x591c('0x17')},'timeout':{'type':_0x591c('0x18'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x380154,_0x15ec33,_0x3a1907,_0x25dc77){if(_0x380154&&_0x15ec33&&_0x3a1907){_0x15ec33[_0x591c('0x19')]+=0x1;var _0x15d9dd={'uniqueid':_0x380154,'from':_0x3a1907[_0x591c('0x1a')]?_0x3a1907[_0x591c('0x1a')][_0x591c('0x7')]:'','joinAt':moment()[_0x591c('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a1907['contact']?_0x3a1907[_0x591c('0x1b')]['id']:null,'ListId':_0x3a1907[_0x591c('0x1c')]?_0x3a1907['list']['id']:null};_0x15d9dd[_[_0x591c('0x1d')](_0x3a1907['channel'])+'QueueId']=_0x15ec33['id']||null;_0x15d9dd[_[_0x591c('0x1d')](_0x3a1907['channel'])+_0x591c('0x1e')]=_0x3a1907[_0x591c('0x1f')]?_0x3a1907[_0x591c('0x1f')]['id']:null;_0x15d9dd[_[_0x591c('0x1d')](_0x3a1907[_0x591c('0x20')])+_0x591c('0x21')]=_0x3a1907['message']?_0x3a1907['message']['id']:null;_0x15d9dd[_['upperFirst'](_0x3a1907['channel'])+(_0x3a1907[_0x591c('0x20')]!==_0x591c('0x22')?_0x591c('0x23'):'WebsiteId')]=_0x3a1907[_0x591c('0x5')]?_0x3a1907[_0x591c('0x5')]['id']:null;logger['info'](util[_0x591c('0xc')]('[%s][START:QUEUE][NAME:%s]',_0x380154,_0x15ec33[_0x591c('0x24')]));emitChannelQueueInteraction(_0x3a1907[_0x591c('0x20')],_0x15ec33[_0x591c('0x24')],_0x15d9dd,_0x3a1907[_0x591c('0x5')][_0x591c('0x24')],_0x3a1907[_0x591c('0x25')]['id'],!![],_0x25dc77,_0x15ec33['id']);if(rpc[_0x3a1907[_0x591c('0x20')]+_0x591c('0x26')]){return rpc[_0x3a1907[_0x591c('0x20')]+_0x591c('0x26')]['create'](_0x15d9dd)['catch'](function(_0x250adf){logger[_0x591c('0x27')]('create\x20queue\x20report');});}}}function stopRouting(_0x592bb0,_0x22e7a9,_0x3e88b6,_0xf4f6){if(_0x592bb0&&_0x22e7a9){_0x22e7a9[_0x591c('0x19')]-=0x1;var _0x14cfb4={'leaveAt':moment()[_0x591c('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x591c('0xc')](_0x591c('0x28')),'reason':_0x591c('0x29')};logger[_0x591c('0x2a')](util['format'](_0x591c('0x2b'),_0x592bb0,_0x22e7a9['name']));emitChannelQueueInteraction(_0x3e88b6[_0x591c('0x20')],_0x22e7a9[_0x591c('0x24')],_0x3e88b6[_0x591c('0x1a')],_0x3e88b6[_0x591c('0x5')]['name'],_0x3e88b6['message']['id'],![],_0xf4f6,_0x22e7a9['id']);if(rpc[_0x3e88b6[_0x591c('0x20')]+_0x591c('0x26')]){return rpc[_0x3e88b6[_0x591c('0x20')]+'QueueReport'][_0x591c('0x2c')](_0x592bb0,_0x14cfb4)[_0x591c('0x2d')](function(_0x4df433){logger[_0x591c('0x27')](_0x591c('0x2e'));});}}}function endRouting(_0x56f65a,_0x5a842d,_0x2f3ca2,_0x36474b){if(_0x56f65a&&_0x5a842d){_0x5a842d['waiting']-=0x1;var _0x8a55c5={'leaveAt':moment()[_0x591c('0xc')](_0x591c('0x28')),'exitAt':moment()[_0x591c('0xc')](_0x591c('0x28')),'reason':'timeout'};logger[_0x591c('0x2a')](util[_0x591c('0xc')]('[%s][END:QUEUE][NAME:%s]',_0x56f65a,_0x5a842d[_0x591c('0x24')]));emitChannelQueueInteraction(_0x2f3ca2['channel'],_0x5a842d[_0x591c('0x24')],_0x2f3ca2[_0x591c('0x1a')],_0x2f3ca2['account'][_0x591c('0x24')],_0x2f3ca2['message']['id'],![],_0x36474b);if(rpc[_0x2f3ca2[_0x591c('0x20')]+_0x591c('0x26')]){return rpc[_0x2f3ca2[_0x591c('0x20')]+_0x591c('0x26')][_0x591c('0x2c')](_0x56f65a,_0x8a55c5)[_0x591c('0x2d')](function(_0x4808af){logger['error'](_0x591c('0x2e'));});}}}function handleFindQueue(_0x55d9e9){return function(_0x2ddf7d){return _0x2ddf7d[_0x591c('0x24')][_0x591c('0x2f')]()===_0x55d9e9[_0x591c('0x2f')]();};}exports[_0x591c('0x30')]=function(_0x15e257,_0x2d68cc,_0x532b04,_0x763b41){return function(_0x590e08){try{var _0x2533bc={'name':_0x2d68cc[0x0],'timeout':_0x2d68cc[0x1]};var _0x101778=queue[_0x591c('0x31')](_0x2533bc,{'typecast':!![]});if(_0x101778['length']){logger[_0x591c('0x27')](_0x591c('0x32'),_0x15e257,_['map'](_0x101778,_0x591c('0x25'))[_0x591c('0x33')](',\x20'));_0x590e08[_0x591c('0x34')]();}else{var _0x55f350=_[_0x591c('0x35')](_0x532b04[_0x763b41[_0x591c('0x20')]+'Queues'],handleFindQueue(_0x2533bc['name']));if(_0x55f350){startRouting(_0x15e257,_0x55f350,_0x763b41,_0x532b04);var _0x5881cf=(_0x55f350[_0x591c('0x36')]||0xa)*0x3e8;var _0x2f100c=(_0x2533bc[_0x591c('0x36')]||0x14)*0x3e8;var _0x595f4a,_0x1f4025;if(_0x5881cf>_0x2f100c){_0x2f100c=_0x5881cf;}var _0x5e8472=seqqueue[_0x591c('0x37')](_0x5881cf);_0x5e8472['id']=_0x15e257;_0x5e8472[_0x591c('0x38')]=_0x5881cf;_0x5e8472[_0x591c('0x39')]=_0x2f100c;_0x5e8472[_0x591c('0x20')]=_0x763b41[_0x591c('0x20')];_0x532b04['rules'][_0x15e257]['on']('end',function(){logger['info'](_0x591c('0x3a'),_0x15e257);stopRouting(_0x15e257,_0x55f350,_0x763b41,_0x532b04);clearTimeout(_0x595f4a);_0x595f4a=undefined;_0x5e8472[_0x591c('0x3b')](!![]);if(_0x532b04[_0x591c('0x3c')][_0x15e257]){delete _0x532b04['rules'][_0x15e257];}_0x590e08[_0x591c('0x34')]();});_0x532b04[_0x591c('0x3c')][_0x15e257]['on']('complete',function(){if(_0x532b04[_0x591c('0x3c')][_0x15e257]){delete _0x532b04[_0x591c('0x3c')][_0x15e257];}});_0x595f4a=setTimeout(function(){logger[_0x591c('0x2a')](_0x591c('0x3d'),_0x15e257);endRouting(_0x15e257,_0x55f350,_0x763b41,_0x532b04);clearTimeout(_0x595f4a);_0x5e8472[_0x591c('0x3b')](!![]);_0x590e08[_0x591c('0x3e')]();},_0x2f100c);switch(_0x55f350[_0x591c('0x3f')]){case _0x591c('0x40'):strategy[_0x591c('0x40')](_0x5e8472,_0x55f350,_0x532b04,_0x763b41);break;default:strategy['beepall'](_0x5e8472,_0x55f350,_0x532b04,_0x763b41);}}else{logger[_0x591c('0x27')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x15e257,_0x2533bc['name']);_0x590e08[_0x591c('0x34')]();}}}catch(_0x5e70c2){console['log'](_0x5e70c2);logger[_0x591c('0x27')]('[%s][QUEUE]\x20%s',_0x15e257,_0x5e70c2[_0x591c('0x41')]);_0x590e08[_0x591c('0x34')]();}};}; \ 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 b236d10..ff992b1 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 _0x5519=['bind','handleTimeout','timeout','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','handleRun'];(function(_0x56dfdb,_0xbef4c0){var _0xf3f640=function(_0x3d6b25){while(--_0x3d6b25){_0x56dfdb['push'](_0x56dfdb['shift']());}};_0xf3f640(++_0xbef4c0);}(_0x5519,0xde));var _0x9551=function(_0x4b5039,_0x23b033){_0x4b5039=_0x4b5039-0x0;var _0x597f29=_0x5519[_0x4b5039];return _0x597f29;};'use strict';var _=require(_0x9551('0x0'));var uuid=require(_0x9551('0x1'));var util=require(_0x9551('0x2'));var logger=require('../../../../../config/logger')(_0x9551('0x3'));var Agent=function(_0x2a12bc,_0x61476f,_0x4aeb9d,_0x5e8281){this[_0x9551('0x4')]=uuid['v4']();this['squeue']=_0x2a12bc;this[_0x9551('0x5')]=_0x61476f;this[_0x9551('0x6')]=_0x4aeb9d;this[_0x9551('0x3')]=_0x5e8281;this[_0x9551('0x7')]['push'](this[_0x9551('0x8')][_0x9551('0x9')](this),this[_0x9551('0xa')][_0x9551('0x9')](this));this[_0x9551('0x7')]['on'](_0x9551('0xb'),this[_0x9551('0xa')][_0x9551('0x9')](this));this['squeue']['on']('drained',this['handleDrained'][_0x9551('0x9')](this));};Agent[_0x9551('0xc')][_0x9551('0xd')]=function(){this[_0x9551('0x7')][_0x9551('0xd')](this[_0x9551('0x8')][_0x9551('0x9')](this),this['handleTimeout'][_0x9551('0x9')](this));};Agent[_0x9551('0xc')][_0x9551('0xe')]=function(){this[_0x9551('0xa')](!![]);};Agent[_0x9551('0xc')][_0x9551('0x8')]=function(_0x2967ef){logger[_0x9551('0xf')](_0x9551('0x10'),this[_0x9551('0x7')]['id'],this[_0x9551('0x5')]['id']);if(_[_0x9551('0x11')](this[_0x9551('0x6')][_0x9551('0x12')][this[_0x9551('0x5')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9551('0x7')]['id'],this[_0x9551('0x5')]['id']);setTimeout(this[_0x9551('0xd')][_0x9551('0x9')](this),0x3e8);}else{if(this[_0x9551('0x3')][_0x9551('0x13')]||util['isAgentAvailable'](this[_0x9551('0x7')]['id'],this[_0x9551('0x6')][_0x9551('0x12')][this['agent']['id']],this['squeue'][_0x9551('0x14')],![])){this['realtime'][_0x9551('0x12')][this[_0x9551('0x5')]['id']][_0x9551('0x15')]=!![];this[_0x9551('0x6')]['agents'][this[_0x9551('0x5')]['id']][_0x9551('0x16')]=undefined;util[_0x9551('0x17')](this[_0x9551('0x4')],this[_0x9551('0x7')]['id'],this[_0x9551('0x6')][_0x9551('0x12')][this['agent']['id']],null,this[_0x9551('0x3')]);util[_0x9551('0x18')](this[_0x9551('0x7')]['id'],this['realtime'][_0x9551('0x12')][this[_0x9551('0x5')]['id']],_0x9551('0x19')+(this[_0x9551('0x3')][_0x9551('0x13')]?_0x9551('0x1a'):''));}else{logger['info'](_0x9551('0x1b'),this[_0x9551('0x7')]['id'],this[_0x9551('0x5')]['id']);setTimeout(this[_0x9551('0xd')]['bind'](this),0x3e8);}}};Agent[_0x9551('0xc')][_0x9551('0xa')]=function(_0x15e62d){if(_[_0x9551('0x11')](this[_0x9551('0x6')][_0x9551('0x12')][this['agent']['id']])){return logger['info'](_0x9551('0x1c'),this[_0x9551('0x7')]['id'],this[_0x9551('0x5')]['id']);}else{logger['info'](_0x9551('0x1d'),this[_0x9551('0x7')]['id'],this[_0x9551('0x5')]['id']);util[_0x9551('0x1e')](this[_0x9551('0x4')],this[_0x9551('0x7')]['id'],this[_0x9551('0x6')][_0x9551('0x12')][this[_0x9551('0x5')]['id']],null,this[_0x9551('0x3')]);this['realtime'][_0x9551('0x12')][this[_0x9551('0x5')]['id']][_0x9551('0x15')]=![];this[_0x9551('0x6')][_0x9551('0x12')][this['agent']['id']][_0x9551('0x16')]=undefined;util[_0x9551('0x18')](this[_0x9551('0x7')]['id'],this[_0x9551('0x6')][_0x9551('0x12')][this[_0x9551('0x5')]['id']],_0x15e62d?_0x9551('0x1f'):_0x9551('0x20'));}if(!_0x15e62d){setTimeout(this[_0x9551('0xd')]['bind'](this),0x3e8);}};function agent(_0x502350,_0x205a79,_0x3bb849,_0x5ebb22){return new Agent(_0x502350,_0x205a79,_0x3bb849,_0x5ebb22);}module['exports']=agent; \ No newline at end of file +var _0xcc6b=['forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','push','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x233ba6,_0x20b9ef){var _0x3c5b27=function(_0xc97860){while(--_0xc97860){_0x233ba6['push'](_0x233ba6['shift']());}};_0x3c5b27(++_0x20b9ef);}(_0xcc6b,0x140));var _0xbcc6=function(_0x2e8fd3,_0x1372e3){_0x2e8fd3=_0x2e8fd3-0x0;var _0x323aaf=_0xcc6b[_0x2e8fd3];return _0x323aaf;};'use strict';var _=require(_0xbcc6('0x0'));var uuid=require(_0xbcc6('0x1'));var util=require(_0xbcc6('0x2'));var logger=require(_0xbcc6('0x3'))(_0xbcc6('0x4'));var Agent=function(_0x9b9a82,_0x4bb7c4,_0xa484a6,_0x2329b9){this[_0xbcc6('0x5')]=uuid['v4']();this[_0xbcc6('0x6')]=_0x9b9a82;this[_0xbcc6('0x7')]=_0x4bb7c4;this[_0xbcc6('0x8')]=_0xa484a6;this[_0xbcc6('0x4')]=_0x2329b9;this[_0xbcc6('0x6')]['push'](this[_0xbcc6('0x9')][_0xbcc6('0xa')](this),this[_0xbcc6('0xb')][_0xbcc6('0xa')](this));this[_0xbcc6('0x6')]['on'](_0xbcc6('0xc'),this[_0xbcc6('0xb')][_0xbcc6('0xa')](this));this[_0xbcc6('0x6')]['on']('drained',this[_0xbcc6('0xd')][_0xbcc6('0xa')](this));};Agent[_0xbcc6('0xe')]['push']=function(){this[_0xbcc6('0x6')][_0xbcc6('0xf')](this['handleRun']['bind'](this),this[_0xbcc6('0xb')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0xbcc6('0xb')](!![]);};Agent['prototype'][_0xbcc6('0x9')]=function(_0x2fbc18){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this['agent']['id']);if(_[_0xbcc6('0x10')](this[_0xbcc6('0x8')][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']])){logger[_0xbcc6('0x12')](_0xbcc6('0x13'),this[_0xbcc6('0x6')]['id'],this[_0xbcc6('0x7')]['id']);setTimeout(this['push'][_0xbcc6('0xa')](this),0x3e8);}else{if(this['routing'][_0xbcc6('0x14')]||util[_0xbcc6('0x15')](this['squeue']['id'],this[_0xbcc6('0x8')][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']],this['squeue'][_0xbcc6('0x16')],![])){this['realtime']['agents'][this[_0xbcc6('0x7')]['id']][_0xbcc6('0x17')]=!![];this[_0xbcc6('0x8')]['agents'][this[_0xbcc6('0x7')]['id']][_0xbcc6('0x18')]=undefined;util[_0xbcc6('0x19')](this[_0xbcc6('0x5')],this[_0xbcc6('0x6')]['id'],this['realtime'][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']],null,this[_0xbcc6('0x4')]);util[_0xbcc6('0x1a')](this[_0xbcc6('0x6')]['id'],this[_0xbcc6('0x8')][_0xbcc6('0x11')][this['agent']['id']],_0xbcc6('0x1b')+(this[_0xbcc6('0x4')][_0xbcc6('0x14')]?_0xbcc6('0x1c'):''));}else{logger['info'](_0xbcc6('0x1d'),this[_0xbcc6('0x6')]['id'],this[_0xbcc6('0x7')]['id']);setTimeout(this[_0xbcc6('0xf')]['bind'](this),0x3e8);}}};Agent[_0xbcc6('0xe')]['handleTimeout']=function(_0x3c9776){if(_[_0xbcc6('0x10')](this[_0xbcc6('0x8')][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']])){return logger['info'](_0xbcc6('0x13'),this[_0xbcc6('0x6')]['id'],this['agent']['id']);}else{logger[_0xbcc6('0x12')](_0xbcc6('0x1e'),this[_0xbcc6('0x6')]['id'],this[_0xbcc6('0x7')]['id']);util[_0xbcc6('0x1f')](this[_0xbcc6('0x5')],this['squeue']['id'],this[_0xbcc6('0x8')]['agents'][this[_0xbcc6('0x7')]['id']],null,this[_0xbcc6('0x4')]);this['realtime'][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']]['busy']=![];this[_0xbcc6('0x8')][_0xbcc6('0x11')][this[_0xbcc6('0x7')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0xbcc6('0x6')]['id'],this[_0xbcc6('0x8')][_0xbcc6('0x11')][this['agent']['id']],_0x3c9776?'STOP':_0xbcc6('0x20'));}if(!_0x3c9776){setTimeout(this[_0xbcc6('0xf')][_0xbcc6('0xa')](this),0x3e8);}};function agent(_0x55e725,_0x18cb94,_0x38dfcf,_0xa0f2){return new Agent(_0x55e725,_0x18cb94,_0x38dfcf,_0xa0f2);}module[_0xbcc6('0x21')]=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 bcebe28..f18b57a 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 _0xd9ef=['Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','showNotification','isNil','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0xd9ef,0x95));var _0xfd9e=function(_0x316838,_0x3cc41e){_0x316838=_0x316838-0x0;var _0x5a56d3=_0xd9ef[_0x316838];return _0x5a56d3;};'use strict';var _=require(_0xfd9e('0x0'));var uuid=require(_0xfd9e('0x1'));var util=require('./util');var logger=require(_0xfd9e('0x2'))('routing');var Beepall=function(_0x57c743,_0x505f7f,_0xdce9ae,_0x28cfac){this[_0xfd9e('0x3')]=uuid['v4']();this[_0xfd9e('0x4')]=_0x57c743;this[_0xfd9e('0x5')]=_0x505f7f;this[_0xfd9e('0x6')]=_0xdce9ae;this[_0xfd9e('0x7')]=_0x28cfac;this[_0xfd9e('0x4')][_0xfd9e('0x8')](this[_0xfd9e('0x9')][_0xfd9e('0xa')](this),this[_0xfd9e('0xb')][_0xfd9e('0xa')](this));this['squeue']['on'](_0xfd9e('0xc'),this[_0xfd9e('0xb')]['bind'](this));this[_0xfd9e('0x4')]['on'](_0xfd9e('0xd'),this[_0xfd9e('0xe')]['bind'](this));};Beepall[_0xfd9e('0xf')][_0xfd9e('0x8')]=function(){this[_0xfd9e('0x4')][_0xfd9e('0x8')](this[_0xfd9e('0x9')]['bind'](this),this[_0xfd9e('0xb')][_0xfd9e('0xa')](this));};Beepall[_0xfd9e('0xf')][_0xfd9e('0xe')]=function(_0x1d7951){this[_0xfd9e('0xb')](!![]);};Beepall[_0xfd9e('0xf')][_0xfd9e('0x9')]=function(_0x3b2b83){var _0x3f5b3c=!![];if(!_['isNil'](this[_0xfd9e('0x5')])&&!_['isNil'](this['queue'][_0xfd9e('0x10')])&&this[_0xfd9e('0x5')][_0xfd9e('0x10')]['length']>0x0){for(var _0x3c329e=0x0,_0xee091f;_0x3c329e0x0){for(var _0x3a26cb=0x0,_0x354183;_0x3a26cb0x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x4819=['format','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','OFFLINE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x4819,0xcd));var _0x9481=function(_0x12fc36,_0x6530d3){_0x12fc36=_0x12fc36-0x0;var _0x55c667=_0x4819[_0x12fc36];return _0x55c667;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var utils=require(_0x9481('0x1'));var Mustache=require(_0x9481('0x2'));var Redis=require(_0x9481('0x3'));var config=require(_0x9481('0x4'));var logger=require(_0x9481('0x5'))(_0x9481('0x6'));config[_0x9481('0x7')]=_[_0x9481('0x8')](config[_0x9481('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9481('0x9'))(new Redis(config['redis']));function emit(_0x54cc78,_0x14e05a,_0x6c6a08){io['to'](_0x54cc78)[_0x9481('0xa')](_0x14e05a,_0x6c6a08);}function sendNotification(_0x3278ff,_0x15d895,_0x4c7d9c,_0x1818cf,_0x521d18,_0x2fabf1){io['to'](util['format'](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](_0x9481('0xd'),_0x1818cf);var _0xe84f77=_0x2fabf1||{};var _0x29515a=_0x4c7d9c[_0x9481('0xe')]('.');var _0xe410c3={'uniqueid':_0x15d895,'channel':_0x29515a[0x0],'id':_0x29515a[0x1],'title':_0x29515a[0x0]+_0x9481('0xf'),'interactionId':_0x29515a[0x2],'queue':_0x521d18?_0x521d18['name']:null,'sound':_0xe84f77['account'][_0x9481('0x10')],'shake':_0xe84f77[_0x9481('0x11')][_0x9481('0x12')]};try{if(!_0xe84f77[_0x9481('0x13')]){_0xe84f77[_0x9481('0x13')]={};}if(_0x521d18){_0xe84f77[_0x9481('0x13')][_0x9481('0x14')]=_0x521d18;}else if(_0xe84f77['body'][_0x9481('0x14')]){delete _0xe84f77[_0x9481('0x13')]['queue'];}_0xe410c3[_0x9481('0x15')]=utils['getMustacheRender'](_0xe84f77[_0x9481('0x11')][_0x9481('0x16')],_0xe84f77);}catch(_0x2bc12a){_0xe410c3[_0x9481('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x9481('0x17')]('[%s][QUEUE]\x20%s',_0x15d895,_0x2bc12a['message']));}io['to'](util[_0x9481('0x17')](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](util[_0x9481('0x17')](_0x9481('0x18'),_0x3278ff?'save':_0x9481('0x19')),_0xe410c3);}function writeLog(_0x272a84,_0x45f9df,_0x615e02){return logger[_0x9481('0x1a')](util['format'](_0x9481('0x1b'),_0x272a84,_0x45f9df[_0x9481('0xc')],_0x615e02));}exports['isAgentAvailable']=function(_0x2bcf37,_0xd1cd1a,_0x352b3a,_0x1809d2){if(_0xd1cd1a[_0x9481('0x1c')]){writeLog(_0x2bcf37,_0xd1cd1a,'BUSY');return![];}if(!_0xd1cd1a[_0x9481('0x1d')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x9481('0x1e'));return![];}if(_0xd1cd1a[_0x352b3a+'Pause']){writeLog(_0x2bcf37,_0xd1cd1a,'PAUSE');return![];}if(_0x1809d2&&_0xd1cd1a[_0x9481('0x1f')](_0x352b3a+_0x9481('0x20'))&&_0xd1cd1a['hasOwnProperty'](_0x352b3a+_0x9481('0x21'))){if(_0xd1cd1a[_0x352b3a+_0x9481('0x20')]>0x0&&_0xd1cd1a[_0x352b3a+_0x9481('0x21')]>=_0xd1cd1a[_0x352b3a+_0x9481('0x20')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x352b3a['toUpperCase']()+_0x9481('0x22'));return![];}}return!![];};exports[_0x9481('0x23')]=function(_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff){return sendNotification(!![],_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff);};exports[_0x9481('0x24')]=function(_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff){return sendNotification(![],_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff);};exports[_0x9481('0x25')]=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 ed02dbe..88eb986 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 _0xe73c=['shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','exec','trim','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','stringify','validate'];(function(_0x5b337c,_0x1375d9){var _0x196c1d=function(_0x14b7b7){while(--_0x14b7b7){_0x5b337c['push'](_0x5b337c['shift']());}};_0x196c1d(++_0x1375d9);}(_0xe73c,0x167));var _0xce73=function(_0x2858f1,_0xe0c1d1){_0x2858f1=_0x2858f1-0x0;var _0xdc169a=_0xe73c[_0x2858f1];return _0xdc169a;};'use strict';var schema=require(_0xce73('0x0'));var sh=require(_0xce73('0x1'));var _=require(_0xce73('0x2'));var utils=require(_0xce73('0x3'));var logger=require(_0xce73('0x4'))(_0xce73('0x5'));var system=schema({'command':{'type':_0xce73('0x6'),'required':!![],'message':_0xce73('0x7')}});exports[_0xce73('0x8')]=function(_0x44159d,_0x3fdff0){return function(_0xd8751){try{var _0x1712d7={'command':_0x3fdff0[0x0]};var _0x572cb8=system[_0xce73('0x0')](_0x1712d7,{'typecast':!![]});if(_0x572cb8['length']){logger[_0xce73('0x9')](_0xce73('0xa'),_0x44159d,_[_0xce73('0xb')](_0x572cb8,_0xce73('0xc'))[_0xce73('0xd')](',\x20'));logger['info'](_0xce73('0xe'),_0x44159d);_0xd8751['next']();}else{var _0x147769=this;var _0x4863a8=utils[_0xce73('0xf')](_0x3fdff0[0x0],this);logger[_0xce73('0x10')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x44159d,_0x4863a8);sh[_0xce73('0x11')](_[_0xce73('0x12')](_0x4863a8),function(_0x258c45,_0x2fbab5){logger[_0xce73('0x10')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x44159d,_0x258c45);if(_0x258c45==0x0){var _0x477779=_0x2fbab5[_0xce73('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3fdff0[0x1])||_['isEmpty'](_0x3fdff0[0x1])){logger[_0xce73('0x10')]('[%s][SYSTEM]\x20no\x20variable',_0x44159d);_0x147769[_0xce73('0x14')][_0x3fdff0[0x1]]=_0x477779;}else{logger['info'](_0xce73('0x15'),_0x44159d,_0x3fdff0[0x1],_0x477779);_0x147769[_0xce73('0x14')][_0x3fdff0[0x1]]=_0x477779;}}_0xd8751[_0xce73('0x16')]();});}}catch(_0x53007d){logger[_0xce73('0x9')](_0xce73('0xa'),_0x44159d,_['isObject'](_0x53007d)?JSON[_0xce73('0x17')](_0x53007d):_0x53007d);logger[_0xce73('0x10')](_0xce73('0xe'),_0x44159d);_0xd8751[_0xce73('0x16')]();}};}; \ No newline at end of file +var _0x7399=['replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x2711b4,_0x4eb677){var _0x4157e2=function(_0x16f3c5){while(--_0x16f3c5){_0x2711b4['push'](_0x2711b4['shift']());}};_0x4157e2(++_0x4eb677);}(_0x7399,0x13e));var _0x9739=function(_0x2de10c,_0x14a21e){_0x2de10c=_0x2de10c-0x0;var _0x9635ef=_0x7399[_0x2de10c];return _0x9635ef;};'use strict';var schema=require(_0x9739('0x0'));var sh=require(_0x9739('0x1'));var _=require(_0x9739('0x2'));var utils=require(_0x9739('0x3'));var logger=require(_0x9739('0x4'))(_0x9739('0x5'));var system=schema({'command':{'type':_0x9739('0x6'),'required':!![],'message':_0x9739('0x7')}});exports[_0x9739('0x8')]=function(_0x22b083,_0x2480da){return function(_0x5ab382){try{var _0x5f4e38={'command':_0x2480da[0x0]};var _0x4eb9a2=system[_0x9739('0x0')](_0x5f4e38,{'typecast':!![]});if(_0x4eb9a2['length']){logger[_0x9739('0x9')]('[%s][SYSTEM]\x20%s',_0x22b083,_['map'](_0x4eb9a2,_0x9739('0xa'))[_0x9739('0xb')](',\x20'));logger['info'](_0x9739('0xc'),_0x22b083);_0x5ab382[_0x9739('0xd')]();}else{var _0x1681d1=this;var _0x442966=utils[_0x9739('0xe')](_0x2480da[0x0],this);logger['info'](_0x9739('0xf'),_0x22b083,_0x442966);sh[_0x9739('0x10')](_[_0x9739('0x11')](_0x442966),function(_0x29a4e5,_0x4a7340){logger[_0x9739('0x12')](_0x9739('0x13'),_0x22b083,_0x29a4e5);if(_0x29a4e5==0x0){var _0x32527a=_0x4a7340[_0x9739('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x9739('0x15')](_0x2480da[0x1])||_[_0x9739('0x16')](_0x2480da[0x1])){logger[_0x9739('0x12')]('[%s][SYSTEM]\x20no\x20variable',_0x22b083);_0x1681d1[_0x9739('0x17')][_0x2480da[0x1]]=_0x32527a;}else{logger[_0x9739('0x12')](_0x9739('0x18'),_0x22b083,_0x2480da[0x1],_0x32527a);_0x1681d1[_0x9739('0x17')][_0x2480da[0x1]]=_0x32527a;}}_0x5ab382[_0x9739('0xd')]();});}}catch(_0x12b1f7){logger[_0x9739('0x9')](_0x9739('0x19'),_0x22b083,_['isObject'](_0x12b1f7)?JSON['stringify'](_0x12b1f7):_0x12b1f7);logger['info'](_0x9739('0xc'),_0x22b083);_0x5ab382[_0x9739('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index b14434f..25e2699 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 _0x3e41=['channel','Interaction','addTags','interaction','then','info','catch','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next'];(function(_0x41620d,_0xa0bdc5){var _0x1ba9ca=function(_0x42167c){while(--_0x42167c){_0x41620d['push'](_0x41620d['shift']());}};_0x1ba9ca(++_0xa0bdc5);}(_0x3e41,0x1f0));var _0x13e4=function(_0x4f03bc,_0xb52955){_0x4f03bc=_0x4f03bc-0x0;var _0x48f4c6=_0x3e41[_0x4f03bc];return _0x48f4c6;};'use strict';var schema=require(_0x13e4('0x0'));var _=require(_0x13e4('0x1'));var rpc={'chatInteraction':require(_0x13e4('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x13e4('0x3')),'mailInteraction':require(_0x13e4('0x4')),'faxInteraction':require(_0x13e4('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x13e4('0x6'))(_0x13e4('0x7'));var tag=schema({'tag':{'type':_0x13e4('0x8'),'required':!![],'message':_0x13e4('0x9')}});exports[_0x13e4('0xa')]=function(_0x3ba066,_0x558ec3,_0x283381,_0x50b841){return function(_0x5d0e8d){try{var _0x4e5e85={'tag':_0x558ec3[0x0]};var _0x3bec2b=tag[_0x13e4('0x0')](_0x4e5e85,{'typecast':!![]});if(_0x3bec2b['length']){logger[_0x13e4('0xb')](_0x13e4('0xc'),_0x3ba066,_[_0x13e4('0xd')](_0x3bec2b,'message')[_0x13e4('0xe')](',\x20'));logger['info'](_0x13e4('0xf'),_0x3ba066);_0x5d0e8d[_0x13e4('0x10')]();}else{var _0x4d67f5={'ids':[_0x558ec3[0x0]]};if(rpc[_0x50b841[_0x13e4('0x11')]+_0x13e4('0x12')]){rpc[_0x50b841[_0x13e4('0x11')]+_0x13e4('0x12')][_0x13e4('0x13')](_0x50b841[_0x13e4('0x14')]['id'],_0x4d67f5)[_0x13e4('0x15')](function(_0x326ff7){logger[_0x13e4('0x16')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3ba066,_0x558ec3[0x1],_0x50b841['channel'],_0x50b841[_0x13e4('0x14')]['id']);})[_0x13e4('0x17')](function(_0x17c75e){logger[_0x13e4('0xb')](_0x13e4('0xc'),_0x3ba066,JSON['stringify'](_0x17c75e));logger['info'](_0x13e4('0xf'),_0x3ba066);})[_0x13e4('0x18')](function(){_0x5d0e8d['next']();});}}}catch(_0x5e62c9){logger[_0x13e4('0xb')](_0x13e4('0xc'),_0x3ba066,_[_0x13e4('0x19')](_0x5e62c9)?JSON[_0x13e4('0x1a')](_0x5e62c9):_0x5e62c9);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3ba066);_0x5d0e8d['next']();}};}; \ No newline at end of file +var _0x6931=['next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x5a7d1b,_0xd07dc9){var _0x3c8705=function(_0x586a70){while(--_0x586a70){_0x5a7d1b['push'](_0x5a7d1b['shift']());}};_0x3c8705(++_0xd07dc9);}(_0x6931,0x179));var _0x1693=function(_0x4d9d9c,_0x339b4e){_0x4d9d9c=_0x4d9d9c-0x0;var _0x4521be=_0x6931[_0x4d9d9c];return _0x4521be;};'use strict';var schema=require(_0x1693('0x0'));var _=require(_0x1693('0x1'));var rpc={'chatInteraction':require(_0x1693('0x2')),'openchannelInteraction':require(_0x1693('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x1693('0x4')),'whatsappInteraction':require(_0x1693('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x1693('0x6'),'required':!![],'message':_0x1693('0x7')}});exports['consequence']=function(_0x11121b,_0x1900d3,_0x31e5ff,_0x4b499a){return function(_0x592c30){try{var _0xede998={'tag':_0x1900d3[0x0]};var _0x487f2f=tag[_0x1693('0x0')](_0xede998,{'typecast':!![]});if(_0x487f2f[_0x1693('0x8')]){logger[_0x1693('0x9')](_0x1693('0xa'),_0x11121b,_['map'](_0x487f2f,'message')[_0x1693('0xb')](',\x20'));logger[_0x1693('0xc')](_0x1693('0xd'),_0x11121b);_0x592c30[_0x1693('0xe')]();}else{var _0x362c3d={'ids':[_0x1900d3[0x0]]};if(rpc[_0x4b499a[_0x1693('0xf')]+_0x1693('0x10')]){rpc[_0x4b499a['channel']+_0x1693('0x10')][_0x1693('0x11')](_0x4b499a[_0x1693('0x12')]['id'],_0x362c3d)[_0x1693('0x13')](function(_0x2efcab){logger['info'](_0x1693('0x14'),_0x11121b,_0x1900d3[0x1],_0x4b499a[_0x1693('0xf')],_0x4b499a['interaction']['id']);})[_0x1693('0x15')](function(_0x4267aa){logger[_0x1693('0x9')]('[%s][TAG]\x20%s',_0x11121b,JSON[_0x1693('0x16')](_0x4267aa));logger['info'](_0x1693('0xd'),_0x11121b);})['finally'](function(){_0x592c30[_0x1693('0xe')]();});}}}catch(_0x2d4a97){logger['error'](_0x1693('0xa'),_0x11121b,_['isObject'](_0x2d4a97)?JSON[_0x1693('0x16')](_0x2d4a97):_0x2d4a97);logger[_0x1693('0xc')](_0x1693('0xd'),_0x11121b);_0x592c30[_0x1693('0xe')]();}};}; \ 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 6995975..a180aea 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 _0x5873=['[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','POST','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0x5873,0xc8));var _0x3587=function(_0x4562dd,_0x1d1647){_0x4562dd=_0x4562dd-0x0;var _0x18d353=_0x5873[_0x4562dd];return _0x18d353;};'use strict';var rp=require('request-promise');var logger=require(_0x3587('0x0'))(_0x3587('0x1'));var _=require(_0x3587('0x2'));var arr=[];exports[_0x3587('0x3')]=function(_0x454857,_0x95c4f8){return function(_0x3ca277){var _0x4e1f8a=_0x95c4f8[0xa];var _0x2d47b6=_0x95c4f8[0xb];var _0x37503e=_0x95c4f8[0xc];var _0x40341f=_0x95c4f8[0xd];var _0x57fbb6=_0x95c4f8[0xe];var _0x5a1164=_0x95c4f8[0xf][_0x3587('0x4')](/\n/g,_0x3587('0x5'));var _0xaeaf87=_0x95c4f8[0x10][_0x3587('0x4')](/\n/g,'\x20');if(!arr[_0x3587('0x6')](_0x2d47b6)){arr[_0x3587('0x7')](_0x2d47b6);var _0x46e7a4=_0x95c4f8[0x3];var _0x51d186=_0x95c4f8[0x4];var _0x3376ab=_0x95c4f8[0x1];var _0x28c6e8=_0x95c4f8[0x0];var _0x318f4d={};_0x318f4d[_0x3587('0x8')]=_0x95c4f8[0x8]+_0x3587('0x9')+_0x37503e+'|'+_0x4e1f8a+'|'+_0x40341f+'|'+_0x2d47b6+'|'+_0x57fbb6;_0x318f4d[_0x3587('0xa')]=_0x95c4f8[0x7]+_0x3587('0x9')+_0x37503e+'|'+_0x4e1f8a+'|'+_0x40341f+'|'+_0x2d47b6+'|'+_0x57fbb6+'|'+_0x5a1164+'|'+_0xaeaf87;_0x318f4d[_0x3587('0xb')]=_0x95c4f8[0x9];var _0x3abd08={};_0x3abd08[_0x3587('0xc')]=_0x3587('0xd');_0x3abd08[_0x3587('0xe')]=_0x3587('0xf');var _0x527f0a=[];_0x527f0a[_0x3587('0x7')](_0x95c4f8[0x2]);_0x527f0a['push'](_0x95c4f8[0x5]);_0x527f0a[_0x3587('0x7')](_0x95c4f8[0x6]);_0x3abd08[_0x3587('0x10')]=_0x527f0a;_0x3abd08['id']=0x1;var _0x3f4b1c=JSON[_0x3587('0x11')](_0x3abd08);var _0x5bbc09={'encoding':'utf8','method':_0x3587('0x12'),'timeout':0x2710,'url':_0x46e7a4,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3f4b1c};return rp(_0x5bbc09)[_0x3587('0x13')](function(_0x5df105){const _0x2b94bf=JSON[_0x3587('0x14')](_0x5df105);if(!_0x2b94bf[_0x3587('0x15')]['logged']){throw new Error(_0x3587('0x16'));}var _0x1b7b9d=_0x2d47b6;var _0x534337=_0x3587('0x17')+_0x3376ab+_0x3587('0x18')+_0x28c6e8+'&sessionId='+_0x1b7b9d+'&data='+JSON[_0x3587('0x11')](_0x318f4d);var _0x432408=_0x51d186+'?'+_0x534337;return rp(_0x432408);})[_0x3587('0x13')](function(_0xd03d9b){logger[_0x3587('0x19')](_0x3587('0x1a'),_0x454857,_0xd03d9b);_0x3ca277[_0x3587('0x1b')]();})[_0x3587('0x1c')](function(_0x33b036){logger[_0x3587('0x1d')](_0x3587('0x1e'),_0x454857,_['isObject'](_0x33b036)?JSON[_0x3587('0x11')](_0x33b036):_0x33b036);_0x3ca277['stop']();});}else{logger[_0x3587('0x19')](_0x3587('0x1f'),_0x454857);_0x3ca277[_0x3587('0x20')]();}};}; \ No newline at end of file +var _0x6cbb=['[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','replace','includes','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','params','stringify','POST','then','result','logged','&serviceId=','&sessionId=','&data=','stop','catch'];(function(_0x345aa0,_0x111b0e){var _0x524f36=function(_0x48c10e){while(--_0x48c10e){_0x345aa0['push'](_0x345aa0['shift']());}};_0x524f36(++_0x111b0e);}(_0x6cbb,0x1f1));var _0xb6cb=function(_0x3754a9,_0x37fdc8){_0x3754a9=_0x3754a9-0x0;var _0x34cf33=_0x6cbb[_0x3754a9];return _0x34cf33;};'use strict';var rp=require('request-promise');var logger=require(_0xb6cb('0x0'))(_0xb6cb('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x243fe0,_0x50caa6){return function(_0x3474b2){var _0x3b8d9d=_0x50caa6[0xa];var _0x5ec13d=_0x50caa6[0xb];var _0x40654f=_0x50caa6[0xc];var _0xebc145=_0x50caa6[0xd];var _0x2583b4=_0x50caa6[0xe];var _0xebbc20=_0x50caa6[0xf][_0xb6cb('0x2')](/\n/g,'\x20-\x20');var _0x23dd5d=_0x50caa6[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xb6cb('0x3')](_0x5ec13d)){arr[_0xb6cb('0x4')](_0x5ec13d);var _0x3addc9=_0x50caa6[0x3];var _0x27b24b=_0x50caa6[0x4];var _0x18f19e=_0x50caa6[0x1];var _0x1b9bc2=_0x50caa6[0x0];var _0x16cfeb={};_0x16cfeb[_0xb6cb('0x5')]=_0x50caa6[0x8]+_0xb6cb('0x6')+_0x40654f+'|'+_0x3b8d9d+'|'+_0xebc145+'|'+_0x5ec13d+'|'+_0x2583b4;_0x16cfeb['urlOnRing']=_0x50caa6[0x7]+'?params='+_0x40654f+'|'+_0x3b8d9d+'|'+_0xebc145+'|'+_0x5ec13d+'|'+_0x2583b4+'|'+_0xebbc20+'|'+_0x23dd5d;_0x16cfeb[_0xb6cb('0x7')]=_0x50caa6[0x9];var _0x2c17db={};_0x2c17db[_0xb6cb('0x8')]=_0xb6cb('0x9');_0x2c17db[_0xb6cb('0xa')]=_0xb6cb('0xb');var _0x217bb6=[];_0x217bb6[_0xb6cb('0x4')](_0x50caa6[0x2]);_0x217bb6[_0xb6cb('0x4')](_0x50caa6[0x5]);_0x217bb6['push'](_0x50caa6[0x6]);_0x2c17db[_0xb6cb('0xc')]=_0x217bb6;_0x2c17db['id']=0x1;var _0x149da8=JSON[_0xb6cb('0xd')](_0x2c17db);var _0x182631={'encoding':'utf8','method':_0xb6cb('0xe'),'timeout':0x2710,'url':_0x3addc9,'headers':{'Content-Type':'application/json-rpc'},'body':_0x149da8};return rp(_0x182631)[_0xb6cb('0xf')](function(_0x38799a){const _0x1ed97f=JSON['parse'](_0x38799a);if(!_0x1ed97f[_0xb6cb('0x10')][_0xb6cb('0x11')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1e2821=_0x5ec13d;var _0x29a1e0='channelId='+_0x18f19e+_0xb6cb('0x12')+_0x1b9bc2+_0xb6cb('0x13')+_0x1e2821+_0xb6cb('0x14')+JSON[_0xb6cb('0xd')](_0x16cfeb);var _0x23f024=_0x27b24b+'?'+_0x29a1e0;return rp(_0x23f024);})[_0xb6cb('0xf')](function(_0xb48f73){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x243fe0,_0xb48f73);_0x3474b2[_0xb6cb('0x15')]();})[_0xb6cb('0x16')](function(_0x3de663){logger['error'](_0xb6cb('0x17'),_0x243fe0,_[_0xb6cb('0x18')](_0x3de663)?JSON[_0xb6cb('0xd')](_0x3de663):_0x3de663);_0x3474b2[_0xb6cb('0x15')]();});}else{logger['info'](_0xb6cb('0x19'),_0x243fe0);_0x3474b2['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 225a818..eccacef 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x131700,_0x36c6ca){var _0x3658eb=function(_0x18776a){while(--_0x18776a){_0x131700['push'](_0x131700['shift']());}};_0x3658eb(++_0x36c6ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x425eae,_0xffe611){var _0x1ba650=function(_0x5047a6){while(--_0x5047a6){_0x425eae['push'](_0x425eae['shift']());}};_0x1ba650(++_0xffe611);}(_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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3b48dc9..11e426d 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 _0x4483=['stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','toLowerCase','autoreply','split','mail','push','slice','appdata','dialogflowv2','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','QueueReport','update','UserId'];(function(_0x9ab282,_0x224526){var _0x3ae406=function(_0x23c911){while(--_0x23c911){_0x9ab282['push'](_0x9ab282['shift']());}};_0x3ae406(++_0x224526);}(_0x4483,0x1a3));var _0x3448=function(_0x3077d2,_0x14e353){_0x3077d2=_0x3077d2-0x0;var _0x41a645=_0x4483[_0x3077d2];return _0x41a645;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x3448('0x3'));var uuid=require(_0x3448('0x4'));var utils=require(_0x3448('0x5'));var config=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x3448('0x8')),'mailQueueReport':require(_0x3448('0x9')),'chatQueueReport':require(_0x3448('0xa')),'smsQueueReport':require(_0x3448('0xb')),'faxQueueReport':require(_0x3448('0xc')),'whatsappQueueReport':require(_0x3448('0xd'))};var RuleEngine=require(_0x3448('0xe'));function getId(_0x34b926,_0x5923ee,_0x5c82c6){return util[_0x3448('0xf')](_0x3448('0x10'),_0x34b926,_0x5923ee||0x0,_0x5c82c6||0x0);}function getIntervals(_0xc36409,_0x6f82ca){var _0x3f4364=[];if(!_[_0x3448('0x11')](_0x6f82ca[_0x3448('0x12')])&&!_[_0x3448('0x11')](_0xc36409[_0x6f82ca[_0x3448('0x12')]])&&!_[_0x3448('0x11')](_0xc36409[_0x6f82ca[_0x3448('0x12')]]['Intervals'])){_0x3f4364=_['map'](_0xc36409[_0x6f82ca[_0x3448('0x12')]][_0x3448('0x13')],'interval');}else if(!_[_0x3448('0x11')](_0x6f82ca[_0x3448('0x14')])){_0x3f4364=[_0x6f82ca[_0x3448('0x14')]];}return _0x3f4364;}exports['listen']=function(_0x14104c){_0x14104c[_0x3448('0x15')]={};return new BPromise(function(_0x4daf3e,_0x2387a3){var _0x2c2da6={'Start':function(_0x46784f){var _0x4fc70f=this;return new Promise(function(_0x472518,_0x28f5b9){if(_0x46784f){try{var _0x13610a=[];var _0x30f8dd=getId(_0x46784f[_0x3448('0x16')],_0x46784f[_0x3448('0x17')]?_0x46784f[_0x3448('0x17')]['id']:0x0,_0x46784f[_0x3448('0x18')]?_0x46784f['interaction']['id']:0x0);if(_0x46784f[_0x3448('0x19')]&&_['isArray'](_0x46784f['applications'])&&_0x46784f['applications'][_0x3448('0x1a')]){for(var _0x278736=0x0;_0x278736<_0x46784f[_0x3448('0x19')]['length'];_0x278736+=0x1){var _0x3df082=_0x46784f[_0x3448('0x19')][_0x278736];if(fs[_0x3448('0x1b')](path[_0x3448('0x1c')](__dirname,_0x3448('0x19'),_0x3df082[_0x3448('0x1d')]+'.js'))){var _0x54c7ee=[];switch(_0x3df082['app'][_0x3448('0x1e')]()){case _0x3448('0x1f'):var _0x4b3d74=_0x3df082['appdata'][_0x3448('0x20')](',');if(_0x46784f[_0x3448('0x16')]===_0x3448('0x21')){_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x0]);_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x1]);_0x54c7ee['push'](_0x4b3d74[_0x3448('0x23')](0x2,_0x4b3d74[_0x3448('0x1a')])[_0x3448('0x1c')](','));}else{_0x54c7ee[_0x3448('0x22')](_0x4b3d74[0x0]);_0x54c7ee[_0x3448('0x22')](_0x4b3d74['slice'](0x1,_0x4b3d74[_0x3448('0x1a')])[_0x3448('0x1c')](','));}break;case'dialogflow':var _0x19a479=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee[_0x3448('0x22')](_0x19a479[0x0]);_0x54c7ee[_0x3448('0x22')](_0x19a479[0x1]);_0x54c7ee[_0x3448('0x22')](_0x19a479[_0x3448('0x23')](0x2,_0x19a479[_0x3448('0x1a')])['join'](','));break;case _0x3448('0x25'):var _0x450704=_0x3df082[_0x3448('0x24')]['split'](',');_0x54c7ee[_0x3448('0x22')](_0x450704[0x0]);_0x54c7ee['push'](_0x450704[0x1]);_0x54c7ee['push'](_0x450704[0x2]);_0x54c7ee['push'](_0x450704[0x3]);_0x54c7ee[_0x3448('0x22')](_0x450704[_0x3448('0x23')](0x4,_0x450704['length'])['join'](','));break;case _0x3448('0x26'):var _0x37ceac=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee['push'](_0x37ceac[0x0]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x1]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x2]);_0x54c7ee[_0x3448('0x22')](_0x37ceac[0x3]);_0x54c7ee['push'](_0x37ceac[_0x3448('0x23')](0x4,_0x37ceac[_0x3448('0x1a')])['join'](','));break;case'message':_0x54c7ee[_0x3448('0x22')](_0x3df082[_0x3448('0x24')]);break;case _0x3448('0x27'):_0x54c7ee[_0x3448('0x22')](_0x3df082['TagId']);_0x54c7ee[_0x3448('0x22')](_0x3df082[_0x3448('0x24')]);break;case _0x3448('0x28'):var _0x30b6b0=utils['getMustacheRender'](_0x46784f[_0x3448('0x29')][_0x3448('0x2a')],_0x46784f);var _0x5ea47c=_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x0]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x1]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x2]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x3]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x4]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x5]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x6]);_0x54c7ee['push'](_0x5ea47c[0x7]);_0x54c7ee['push'](_0x5ea47c[0x8]);_0x54c7ee[_0x3448('0x22')](_0x5ea47c[0x9]);_0x54c7ee['push'](_0x5ea47c[0xa]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x18')]['id']);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x17')]['id']);_0x54c7ee['push'](_0x3df082[_0x3448('0x2b')]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x18')][_0x3448('0x2c')]);_0x54c7ee[_0x3448('0x22')](_0x46784f[_0x3448('0x2d')][_0x3448('0x2d')]);_0x54c7ee[_0x3448('0x22')](_0x30b6b0);break;default:_0x54c7ee=_[_0x3448('0x11')](_0x3df082['appdata'])?[]:_0x3df082[_0x3448('0x24')][_0x3448('0x20')](',');}var _0x322b46={'id':util[_0x3448('0xf')](_0x3448('0x2e'),_0x30f8dd,_0x3df082['id'],_0x3df082['app']),'condition':require(_0x3448('0x2f'))[_0x3448('0x30')](_0x30f8dd,getIntervals(_0x14104c[_0x3448('0x31')],_0x3df082),_0x14104c),'consequence':require(_0x3448('0x32')+_0x3df082[_0x3448('0x1d')])[_0x3448('0x33')](_0x30f8dd,_0x54c7ee,_0x14104c,_0x46784f),'p':_0x3df082[_0x3448('0x34')]||0x0};logger[_0x3448('0x35')]('Push\x20new\x20rule',_0x322b46['id'],_0x3448('0x36'),getIntervals(_0x14104c[_0x3448('0x31')],_0x3df082)[_0x3448('0x1c')]('\x20|\x20'));_0x13610a[_0x3448('0x22')](_0x322b46);}else{logger[_0x3448('0x37')](_0x3448('0x38'),path[_0x3448('0x1c')](__dirname,_0x3448('0x19'),_0x3df082[_0x3448('0x1d')]+_0x3448('0x39')));}}_0x14104c['rules'][_0x30f8dd]=new RuleEngine(_0x13610a);_0x14104c[_0x3448('0x15')][_0x30f8dd][_0x3448('0x3a')](_0x46784f,function(_0x1e7fb7){logger[_0x3448('0x35')](_0x3448('0x3b'),JSON[_0x3448('0x3c')](_0x1e7fb7['matchPath']));if(_0x14104c[_0x3448('0x15')][_0x30f8dd]){_0x14104c['rules'][_0x30f8dd]['emit'](_0x3448('0x3d'));}});return _0x472518({'code':0xc8,'message':_0x46784f});}else{logger[_0x3448('0x35')]('No\x20applications\x20to\x20execute');return _0x472518({'code':0xc8,'message':_0x46784f});}}catch(_0x3a700f){logger[_0x3448('0x37')](_0x3a700f['stack']);return _0x28f5b9(_0x4fc70f[_0x3448('0x37')](0x1f4,_0x3a700f));}}return _0x28f5b9(_0x3448('0x3e'));});},'AcceptMessage':function(_0x5d4263){var _0x35f875=this;return new Promise(function(_0x1186c9,_0x1fcd85){if(_0x5d4263[_0x3448('0x3f')]&&_0x5d4263[_0x3448('0x3f')]['id']){if(_0x14104c[_0x3448('0x40')][_0x5d4263[_0x3448('0x3f')]['id']]){_0x14104c['agents'][_0x5d4263['agent']['id']][_0x3448('0x41')]=![];_0x14104c[_0x3448('0x40')][_0x5d4263[_0x3448('0x3f')]['id']][_0x3448('0x42')]=undefined;}}if(_0x5d4263['message']&&_0x5d4263[_0x3448('0x17')]['id']){try{var _0x198e30=getId(_0x5d4263[_0x3448('0x16')],_0x5d4263[_0x3448('0x17')]?_0x5d4263[_0x3448('0x17')]['id']:0x0,_0x5d4263['interaction']?_0x5d4263[_0x3448('0x18')]['id']:0x0);if(_0x14104c['rules'][_0x198e30]){_0x14104c[_0x3448('0x15')][_0x198e30][_0x3448('0x43')]('end');if(rpc[_0x5d4263[_0x3448('0x16')]+_0x3448('0x44')]){rpc[_0x5d4263[_0x3448('0x16')]+_0x3448('0x44')][_0x3448('0x45')](_0x198e30,{'UserId':_0x5d4263[_0x3448('0x17')][_0x3448('0x46')]})['catch'](function(_0x23dbda){logger[_0x3448('0x37')]('error\x20update\x20queue\x20report');});}}return _0x1186c9({'code':0xc8,'message':_0x5d4263});}catch(_0x5a81dd){logger[_0x3448('0x37')](_0x5a81dd[_0x3448('0x47')]);return _0x1fcd85(_0x35f875['error'](0x1f4,_0x5a81dd));}}logger['error'](_0x3448('0x48'));return _0x1fcd85(_0x35f875[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'RejectMessage':function(_0x430e74){var _0x176e60=this;return new Promise(function(_0x39db50,_0x2aea70){if(_0x430e74['agent']&&_0x430e74['agent']['id']){try{if(_0x14104c['agents'][_0x430e74[_0x3448('0x3f')]['id']]){_0x14104c[_0x3448('0x40')][_0x430e74['agent']['id']][_0x3448('0x41')]=![];_0x14104c[_0x3448('0x40')][_0x430e74['agent']['id']][_0x3448('0x42')]=undefined;}return _0x39db50({'code':0xc8,'message':_0x430e74});}catch(_0x93669){logger['error'](_0x93669[_0x3448('0x47')]);return _0x2aea70(_0x176e60[_0x3448('0x37')](0x1f4,_0x93669));}}logger[_0x3448('0x37')](_0x3448('0x48'));return _0x2aea70(_0x176e60[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'AbandonInteraction':function(_0xeda861){var _0x1b7d87=this;return new Promise(function(_0x4520a1,_0x4926aa){if(_0xeda861[_0x3448('0x16')]&&_0xeda861['interaction']&&_0xeda861[_0x3448('0x18')]['id']){try{var _0x108b99=getId(_0xeda861[_0x3448('0x16')],_0xeda861[_0x3448('0x17')]?_0xeda861[_0x3448('0x17')]['id']:0x0,_0xeda861[_0x3448('0x18')]?_0xeda861['interaction']['id']:0x0);if(_0x14104c[_0x3448('0x15')][_0x108b99]){_0x14104c['rules'][_0x108b99][_0x3448('0x43')](_0x3448('0x49'));}return _0x4520a1({'code':0xc8,'message':_0xeda861});}catch(_0x3bf4d2){logger[_0x3448('0x37')](_0x3bf4d2[_0x3448('0x47')]);return _0x4926aa(_0x1b7d87['error'](0x1f4,_0x3bf4d2));}}logger['error'](_0x3448('0x48'));return _0x4926aa(_0x1b7d87[_0x3448('0x37')](0x1f4,_0x3448('0x48')));});},'AgentCapacity':function(_0x5a51bb){var _0x7c00fe=this;return new Promise(function(_0x3eb57b,_0x1e4fb9){if(_0x14104c[_0x3448('0x40')][_0x3448('0x4a')](_0x5a51bb['id'])){for(var _0x28205e in _0x5a51bb[_0x3448('0x4b')]){if(_0x5a51bb[_0x3448('0x4b')][_0x3448('0x4a')](_0x28205e)){if(_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x3448('0x4a')](_0x28205e+_0x3448('0x4c'))){_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x28205e+_0x3448('0x4c')]=parseInt(_0x5a51bb[_0x3448('0x4b')][_0x28205e],0xa);}}}_0x14104c[_0x3448('0x40')][_0x5a51bb['id']][_0x3448('0x4d')]();return _0x3eb57b({'code':0xc8,'message':_0x14104c[_0x3448('0x40')][_0x5a51bb['id']]});}else{return _0x1e4fb9(_0x7c00fe['error'](0x1f4,_0x3448('0x4e')));}});},'Agents':function(_0x4864d1){return new Promise(function(_0x29a8fb,_0x4f10dc){var _0x1f1e3c=_[_0x3448('0x4f')](_0x14104c['agents']);_0x29a8fb({'count':_0x1f1e3c[_0x3448('0x1a')],'rows':_0x1f1e3c});});},'ChatQueues':function(_0x2f6517){return new Promise(function(_0x54cddd,_0x4f6902){var _0x599350=[];for(var _0x4864ae in _0x14104c['chatQueues']){if(_0x14104c[_0x3448('0x50')][_0x3448('0x4a')](_0x4864ae)){var _0x5be195=_0x14104c['chatQueues'][_0x4864ae];var _0x1385b9={'id':_0x5be195['id'],'available':_0x5be195[_0x3448('0x51')],'loggedIn':_0x5be195[_0x3448('0x52')],'name':_0x5be195[_0x3448('0x53')],'paused':_0x5be195[_0x3448('0x54')],'waiting':_0x5be195[_0x3448('0x55')]};_0x599350[_0x3448('0x22')](_0x1385b9);}}_0x54cddd({'count':_0x599350[_0x3448('0x1a')],'rows':_0x599350});});},'MailQueues':function(_0x2cf3ef){return new Promise(function(_0x347412,_0x143b28){var _0x4369bd=[];for(var _0x41f84c in _0x14104c[_0x3448('0x56')]){if(_0x14104c['mailQueues'][_0x3448('0x4a')](_0x41f84c)){var _0x2dcf50=_0x14104c['mailQueues'][_0x41f84c];var _0x407b6a={'id':_0x2dcf50['id'],'available':_0x2dcf50[_0x3448('0x51')],'loggedIn':_0x2dcf50['loggedIn'],'name':_0x2dcf50[_0x3448('0x53')],'paused':_0x2dcf50[_0x3448('0x54')],'waiting':_0x2dcf50[_0x3448('0x55')]};_0x4369bd['push'](_0x407b6a);}}_0x347412({'count':_0x4369bd['length'],'rows':_0x4369bd});});},'OpenchannelQueues':function(_0x41d459){return new Promise(function(_0x489b70,_0x31dfc5){var _0x42c146=[];for(var _0x5d952a in _0x14104c['openchannelQueues']){if(_0x14104c[_0x3448('0x57')][_0x3448('0x4a')](_0x5d952a)){var _0x6ca224=_0x14104c['openchannelQueues'][_0x5d952a];var _0x4b8b33={'id':_0x6ca224['id'],'available':_0x6ca224[_0x3448('0x51')],'loggedIn':_0x6ca224[_0x3448('0x52')],'name':_0x6ca224[_0x3448('0x53')],'paused':_0x6ca224[_0x3448('0x54')],'waiting':_0x6ca224[_0x3448('0x55')]};_0x42c146[_0x3448('0x22')](_0x4b8b33);}}_0x489b70({'count':_0x42c146['length'],'rows':_0x42c146});});},'SmsQueues':function(_0x2ec688){return new Promise(function(_0x5dbbc5,_0x3f7a64){var _0x2cca2f=[];for(var _0x487174 in _0x14104c[_0x3448('0x58')]){if(_0x14104c[_0x3448('0x58')]['hasOwnProperty'](_0x487174)){var _0x4b793f=_0x14104c[_0x3448('0x58')][_0x487174];var _0x26ce48={'id':_0x4b793f['id'],'available':_0x4b793f[_0x3448('0x51')],'loggedIn':_0x4b793f[_0x3448('0x52')],'name':_0x4b793f[_0x3448('0x53')],'paused':_0x4b793f[_0x3448('0x54')],'waiting':_0x4b793f[_0x3448('0x55')]};_0x2cca2f[_0x3448('0x22')](_0x26ce48);}}_0x5dbbc5({'count':_0x2cca2f[_0x3448('0x1a')],'rows':_0x2cca2f});});},'FaxQueues':function(_0x3d7867){return new Promise(function(_0x36cfb4,_0xc0d8f1){var _0x46c693=[];for(var _0x11d62f in _0x14104c[_0x3448('0x59')]){if(_0x14104c[_0x3448('0x59')]['hasOwnProperty'](_0x11d62f)){var _0x4efd6c=_0x14104c[_0x3448('0x59')][_0x11d62f];var _0x4d2af5={'id':_0x4efd6c['id'],'available':_0x4efd6c[_0x3448('0x51')],'loggedIn':_0x4efd6c[_0x3448('0x52')],'name':_0x4efd6c['name'],'paused':_0x4efd6c[_0x3448('0x54')],'waiting':_0x4efd6c['waiting']};_0x46c693[_0x3448('0x22')](_0x4d2af5);}}_0x36cfb4({'count':_0x46c693[_0x3448('0x1a')],'rows':_0x46c693});});},'WhatsappQueues':function(_0x2dbd3c){return new Promise(function(_0x3a64cc,_0x349554){var _0x5f46a4=[];for(var _0xe21908 in _0x14104c[_0x3448('0x5a')]){if(_0x14104c[_0x3448('0x5a')]['hasOwnProperty'](_0xe21908)){var _0x2f1236=_0x14104c[_0x3448('0x5a')][_0xe21908];var _0x17c22b={'id':_0x2f1236['id'],'available':_0x2f1236['available'],'loggedIn':_0x2f1236[_0x3448('0x52')],'name':_0x2f1236['name'],'paused':_0x2f1236['paused'],'waiting':_0x2f1236[_0x3448('0x55')]};_0x5f46a4['push'](_0x17c22b);}}_0x3a64cc({'count':_0x5f46a4[_0x3448('0x1a')],'rows':_0x5f46a4});});},'ChatQueuesWaitingInteractions':function(_0x4ef3a5){return new Promise(function(_0x26a6db,_0x961895){var _0x4dcdae=_['values'](_0x14104c[_0x3448('0x5b')]);_0x26a6db({'count':_0x4dcdae[_0x3448('0x1a')],'rows':_0x4dcdae});});},'MailQueuesWaitingInteractions':function(_0x48fffc){return new Promise(function(_0x3cdb3c,_0x28ebdd){var _0x513a01=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5c')]);_0x3cdb3c({'count':_0x513a01[_0x3448('0x1a')],'rows':_0x513a01});});},'OpenchannelQueuesWaitingInteractions':function(_0xc92ddf){return new Promise(function(_0x577570,_0x37c395){var _0x5be142=_[_0x3448('0x4f')](_0x14104c['openchannelQueuesWaitingInteractions']);_0x577570({'count':_0x5be142[_0x3448('0x1a')],'rows':_0x5be142});});},'SmsQueuesWaitingInteractions':function(_0x20a047){return new Promise(function(_0x4117da,_0x4e0709){var _0x17ebc9=_[_0x3448('0x4f')](_0x14104c['smsQueuesWaitingInteractions']);_0x4117da({'count':_0x17ebc9[_0x3448('0x1a')],'rows':_0x17ebc9});});},'FaxQueuesWaitingInteractions':function(_0x51f6b0){return new Promise(function(_0x520950,_0x1022fa){var _0x5394b1=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5d')]);_0x520950({'count':_0x5394b1[_0x3448('0x1a')],'rows':_0x5394b1});});},'WhatsappQueuesWaitingInteractions':function(_0x59c822){return new Promise(function(_0x3b4de4,_0x716797){var _0x45f399=_[_0x3448('0x4f')](_0x14104c[_0x3448('0x5e')]);_0x3b4de4({'count':_0x45f399[_0x3448('0x1a')],'rows':_0x45f399});});}};var _0x203466=jayson[_0x3448('0x5f')](_0x2c2da6)[_0x3448('0x60')]();_0x203466['on'](_0x3448('0x37'),function(_0x7073d8){logger[_0x3448('0x37')](JSON[_0x3448('0x3c')](_0x7073d8));return _0x2387a3(_0x7073d8);});_0x203466['listen'](0x232c,'127.0.0.1',function(){console['log'](_0x3448('0x61'),0x232c);return _0x4daf3e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x78f0=['error','execute','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x78f0,0x15d));var _0x078f=function(_0x4d9c9c,_0x23284c){_0x4d9c9c=_0x4d9c9c-0x0;var _0x496114=_0x78f0[_0x4d9c9c];return _0x496114;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var path=require(_0x078f('0x2'));var fs=require('fs');var jayson=require(_0x078f('0x3'));var BPromise=require(_0x078f('0x4'));var uuid=require(_0x078f('0x5'));var utils=require(_0x078f('0x6'));var config=require(_0x078f('0x7'));var logger=require('../../../config/logger')(_0x078f('0x8'));var rpc={'openchannelQueueReport':require(_0x078f('0x9')),'mailQueueReport':require(_0x078f('0xa')),'chatQueueReport':require(_0x078f('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x078f('0xc')),'whatsappQueueReport':require(_0x078f('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2ef013,_0x1901e3,_0x39d622){return util[_0x078f('0xe')](_0x078f('0xf'),_0x2ef013,_0x1901e3||0x0,_0x39d622||0x0);}function getIntervals(_0x1e71bd,_0x4207d0){var _0x1897d3=[];if(!_['isNil'](_0x4207d0[_0x078f('0x10')])&&!_[_0x078f('0x11')](_0x1e71bd[_0x4207d0['IntervalId']])&&!_[_0x078f('0x11')](_0x1e71bd[_0x4207d0[_0x078f('0x10')]][_0x078f('0x12')])){_0x1897d3=_[_0x078f('0x13')](_0x1e71bd[_0x4207d0['IntervalId']]['Intervals'],_0x078f('0x14'));}else if(!_[_0x078f('0x11')](_0x4207d0[_0x078f('0x14')])){_0x1897d3=[_0x4207d0[_0x078f('0x14')]];}return _0x1897d3;}exports['listen']=function(_0x36670d){_0x36670d[_0x078f('0x15')]={};return new BPromise(function(_0x5465b8,_0x1d8dba){var _0x1a44f1={'Start':function(_0x21fc72){var _0x363dfd=this;return new Promise(function(_0x247de9,_0x63a278){if(_0x21fc72){try{var _0x4c69e0=[];var _0x56bad2=getId(_0x21fc72[_0x078f('0x16')],_0x21fc72[_0x078f('0x17')]?_0x21fc72[_0x078f('0x17')]['id']:0x0,_0x21fc72[_0x078f('0x18')]?_0x21fc72[_0x078f('0x18')]['id']:0x0);if(_0x21fc72[_0x078f('0x19')]&&_[_0x078f('0x1a')](_0x21fc72[_0x078f('0x19')])&&_0x21fc72[_0x078f('0x19')][_0x078f('0x1b')]){for(var _0x264252=0x0;_0x264252<_0x21fc72[_0x078f('0x19')]['length'];_0x264252+=0x1){var _0x43f05f=_0x21fc72['applications'][_0x264252];if(fs['existsSync'](path[_0x078f('0x1c')](__dirname,_0x078f('0x19'),_0x43f05f[_0x078f('0x1d')]+_0x078f('0x1e')))){var _0x712d52=[];switch(_0x43f05f[_0x078f('0x1d')][_0x078f('0x1f')]()){case _0x078f('0x20'):var _0x32f4f3=_0x43f05f['appdata'][_0x078f('0x21')](',');if(_0x21fc72[_0x078f('0x16')]===_0x078f('0x22')){_0x712d52['push'](_0x32f4f3[0x0]);_0x712d52['push'](_0x32f4f3[0x1]);_0x712d52[_0x078f('0x23')](_0x32f4f3[_0x078f('0x24')](0x2,_0x32f4f3[_0x078f('0x1b')])[_0x078f('0x1c')](','));}else{_0x712d52[_0x078f('0x23')](_0x32f4f3[0x0]);_0x712d52[_0x078f('0x23')](_0x32f4f3[_0x078f('0x24')](0x1,_0x32f4f3['length'])[_0x078f('0x1c')](','));}break;case _0x078f('0x25'):var _0x4b6244=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x4b6244[0x0]);_0x712d52[_0x078f('0x23')](_0x4b6244[0x1]);_0x712d52[_0x078f('0x23')](_0x4b6244[_0x078f('0x24')](0x2,_0x4b6244[_0x078f('0x1b')])[_0x078f('0x1c')](','));break;case _0x078f('0x27'):var _0x29d306=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x29d306[0x0]);_0x712d52[_0x078f('0x23')](_0x29d306[0x1]);_0x712d52[_0x078f('0x23')](_0x29d306[0x2]);_0x712d52[_0x078f('0x23')](_0x29d306[0x3]);_0x712d52[_0x078f('0x23')](_0x29d306[_0x078f('0x24')](0x4,_0x29d306['length'])[_0x078f('0x1c')](','));break;case'amazonlex':var _0x519c22=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x519c22[0x0]);_0x712d52[_0x078f('0x23')](_0x519c22[0x1]);_0x712d52['push'](_0x519c22[0x2]);_0x712d52[_0x078f('0x23')](_0x519c22[0x3]);_0x712d52[_0x078f('0x23')](_0x519c22[_0x078f('0x24')](0x4,_0x519c22[_0x078f('0x1b')])[_0x078f('0x1c')](','));break;case'message':_0x712d52[_0x078f('0x23')](_0x43f05f[_0x078f('0x26')]);break;case'tag':_0x712d52['push'](_0x43f05f[_0x078f('0x28')]);_0x712d52[_0x078f('0x23')](_0x43f05f['appdata']);break;case _0x078f('0x29'):var _0x13b165=utils[_0x078f('0x2a')](_0x21fc72['account'][_0x078f('0x2b')],_0x21fc72);var _0x411311=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x411311[0x0]);_0x712d52[_0x078f('0x23')](_0x411311[0x1]);_0x712d52['push'](_0x411311[0x2]);_0x712d52[_0x078f('0x23')](_0x411311[0x3]);_0x712d52[_0x078f('0x23')](_0x411311[0x4]);_0x712d52[_0x078f('0x23')](_0x411311[0x5]);_0x712d52[_0x078f('0x23')](_0x411311[0x6]);_0x712d52['push'](_0x411311[0x7]);_0x712d52[_0x078f('0x23')](_0x411311[0x8]);_0x712d52[_0x078f('0x23')](_0x411311[0x9]);_0x712d52[_0x078f('0x23')](_0x411311[0xa]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x18')]['id']);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x17')]['id']);_0x712d52[_0x078f('0x23')](_0x43f05f[_0x078f('0x2c')]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x18')][_0x078f('0x2d')]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x2e')][_0x078f('0x2e')]);_0x712d52[_0x078f('0x23')](_0x13b165);break;default:_0x712d52=_['isNil'](_0x43f05f['appdata'])?[]:_0x43f05f['appdata'][_0x078f('0x21')](',');}var _0x4d7cbb={'id':util[_0x078f('0xe')](_0x078f('0x2f'),_0x56bad2,_0x43f05f['id'],_0x43f05f[_0x078f('0x1d')]),'condition':require(_0x078f('0x30'))['condition'](_0x56bad2,getIntervals(_0x36670d[_0x078f('0x31')],_0x43f05f),_0x36670d),'consequence':require('./applications/'+_0x43f05f['app'])['consequence'](_0x56bad2,_0x712d52,_0x36670d,_0x21fc72),'p':_0x43f05f[_0x078f('0x32')]||0x0};logger[_0x078f('0x33')](_0x078f('0x34'),_0x4d7cbb['id'],_0x078f('0x35'),getIntervals(_0x36670d[_0x078f('0x31')],_0x43f05f)[_0x078f('0x1c')](_0x078f('0x36')));_0x4c69e0[_0x078f('0x23')](_0x4d7cbb);}else{logger[_0x078f('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x078f('0x1c')](__dirname,'applications',_0x43f05f['app']+_0x078f('0x1e')));}}_0x36670d['rules'][_0x56bad2]=new RuleEngine(_0x4c69e0);_0x36670d[_0x078f('0x15')][_0x56bad2][_0x078f('0x38')](_0x21fc72,function(_0x3a9798){logger[_0x078f('0x33')](_0x078f('0x39'),JSON[_0x078f('0x3a')](_0x3a9798[_0x078f('0x3b')]));if(_0x36670d[_0x078f('0x15')][_0x56bad2]){_0x36670d['rules'][_0x56bad2][_0x078f('0x3c')]('complete');}});return _0x247de9({'code':0xc8,'message':_0x21fc72});}else{logger[_0x078f('0x33')]('No\x20applications\x20to\x20execute');return _0x247de9({'code':0xc8,'message':_0x21fc72});}}catch(_0x16a09b){logger[_0x078f('0x37')](_0x16a09b[_0x078f('0x3d')]);return _0x63a278(_0x363dfd[_0x078f('0x37')](0x1f4,_0x16a09b));}}return _0x63a278(_0x078f('0x3e'));});},'AcceptMessage':function(_0x39481d){var _0x2124c3=this;return new Promise(function(_0x3cfe9f,_0x160cbd){if(_0x39481d['agent']&&_0x39481d[_0x078f('0x3f')]['id']){if(_0x36670d[_0x078f('0x40')][_0x39481d['agent']['id']]){_0x36670d[_0x078f('0x40')][_0x39481d[_0x078f('0x3f')]['id']][_0x078f('0x41')]=![];_0x36670d[_0x078f('0x40')][_0x39481d['agent']['id']][_0x078f('0x42')]=undefined;}}if(_0x39481d[_0x078f('0x17')]&&_0x39481d[_0x078f('0x17')]['id']){try{var _0x5dba79=getId(_0x39481d[_0x078f('0x16')],_0x39481d[_0x078f('0x17')]?_0x39481d[_0x078f('0x17')]['id']:0x0,_0x39481d[_0x078f('0x18')]?_0x39481d[_0x078f('0x18')]['id']:0x0);if(_0x36670d['rules'][_0x5dba79]){_0x36670d[_0x078f('0x15')][_0x5dba79][_0x078f('0x3c')]('end');if(rpc[_0x39481d[_0x078f('0x16')]+_0x078f('0x43')]){rpc[_0x39481d['channel']+_0x078f('0x43')][_0x078f('0x44')](_0x5dba79,{'UserId':_0x39481d[_0x078f('0x17')][_0x078f('0x45')]})[_0x078f('0x46')](function(_0x1ad4a8){logger[_0x078f('0x37')](_0x078f('0x47'));});}}return _0x3cfe9f({'code':0xc8,'message':_0x39481d});}catch(_0x4206ac){logger['error'](_0x4206ac[_0x078f('0x3d')]);return _0x160cbd(_0x2124c3[_0x078f('0x37')](0x1f4,_0x4206ac));}}logger[_0x078f('0x37')]('message\x20is\x20empty');return _0x160cbd(_0x2124c3[_0x078f('0x37')](0x1f4,_0x078f('0x48')));});},'RejectMessage':function(_0x20d961){var _0x3ce881=this;return new Promise(function(_0x4bb6a2,_0x3badef){if(_0x20d961[_0x078f('0x3f')]&&_0x20d961['agent']['id']){try{if(_0x36670d[_0x078f('0x40')][_0x20d961['agent']['id']]){_0x36670d[_0x078f('0x40')][_0x20d961[_0x078f('0x3f')]['id']][_0x078f('0x41')]=![];_0x36670d['agents'][_0x20d961['agent']['id']]['busyQueue']=undefined;}return _0x4bb6a2({'code':0xc8,'message':_0x20d961});}catch(_0x3855ae){logger['error'](_0x3855ae[_0x078f('0x3d')]);return _0x3badef(_0x3ce881['error'](0x1f4,_0x3855ae));}}logger[_0x078f('0x37')](_0x078f('0x48'));return _0x3badef(_0x3ce881[_0x078f('0x37')](0x1f4,_0x078f('0x48')));});},'AbandonInteraction':function(_0x4d42ca){var _0x3dfa39=this;return new Promise(function(_0x51fa52,_0x16c42a){if(_0x4d42ca[_0x078f('0x16')]&&_0x4d42ca['interaction']&&_0x4d42ca[_0x078f('0x18')]['id']){try{var _0x3f7ac8=getId(_0x4d42ca[_0x078f('0x16')],_0x4d42ca[_0x078f('0x17')]?_0x4d42ca[_0x078f('0x17')]['id']:0x0,_0x4d42ca[_0x078f('0x18')]?_0x4d42ca[_0x078f('0x18')]['id']:0x0);if(_0x36670d[_0x078f('0x15')][_0x3f7ac8]){_0x36670d[_0x078f('0x15')][_0x3f7ac8][_0x078f('0x3c')](_0x078f('0x49'));}return _0x51fa52({'code':0xc8,'message':_0x4d42ca});}catch(_0x233b04){logger['error'](_0x233b04[_0x078f('0x3d')]);return _0x16c42a(_0x3dfa39[_0x078f('0x37')](0x1f4,_0x233b04));}}logger['error']('message\x20is\x20empty');return _0x16c42a(_0x3dfa39[_0x078f('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4bfc24){var _0x2d6ec1=this;return new Promise(function(_0x6ca456,_0x12c805){if(_0x36670d['agents'][_0x078f('0x4a')](_0x4bfc24['id'])){for(var _0x587682 in _0x4bfc24[_0x078f('0x4b')]){if(_0x4bfc24[_0x078f('0x4b')][_0x078f('0x4a')](_0x587682)){if(_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]['hasOwnProperty'](_0x587682+_0x078f('0x4c'))){_0x36670d['agents'][_0x4bfc24['id']][_0x587682+_0x078f('0x4c')]=parseInt(_0x4bfc24['capacity'][_0x587682],0xa);}}}_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]['updateRealtime']();return _0x6ca456({'code':0xc8,'message':_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]});}else{return _0x12c805(_0x2d6ec1[_0x078f('0x37')](0x1f4,_0x078f('0x4d')));}});},'Agents':function(_0x496fef){return new Promise(function(_0x65e2e5,_0x586334){var _0x4fc183=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x40')]);_0x65e2e5({'count':_0x4fc183[_0x078f('0x1b')],'rows':_0x4fc183});});},'ChatQueues':function(_0x1dc8f6){return new Promise(function(_0x291d20,_0x34e2db){var _0x5e01b2=[];for(var _0x518266 in _0x36670d[_0x078f('0x4f')]){if(_0x36670d[_0x078f('0x4f')][_0x078f('0x4a')](_0x518266)){var _0x346997=_0x36670d[_0x078f('0x4f')][_0x518266];var _0x57ffdb={'id':_0x346997['id'],'available':_0x346997[_0x078f('0x50')],'loggedIn':_0x346997[_0x078f('0x51')],'name':_0x346997[_0x078f('0x52')],'paused':_0x346997[_0x078f('0x53')],'waiting':_0x346997[_0x078f('0x54')]};_0x5e01b2[_0x078f('0x23')](_0x57ffdb);}}_0x291d20({'count':_0x5e01b2['length'],'rows':_0x5e01b2});});},'MailQueues':function(_0x215d60){return new Promise(function(_0x1c259a,_0xd4e52a){var _0x6c8a18=[];for(var _0x505881 in _0x36670d[_0x078f('0x55')]){if(_0x36670d[_0x078f('0x55')][_0x078f('0x4a')](_0x505881)){var _0x29ce23=_0x36670d[_0x078f('0x55')][_0x505881];var _0x5378d8={'id':_0x29ce23['id'],'available':_0x29ce23['available'],'loggedIn':_0x29ce23[_0x078f('0x51')],'name':_0x29ce23[_0x078f('0x52')],'paused':_0x29ce23[_0x078f('0x53')],'waiting':_0x29ce23[_0x078f('0x54')]};_0x6c8a18[_0x078f('0x23')](_0x5378d8);}}_0x1c259a({'count':_0x6c8a18[_0x078f('0x1b')],'rows':_0x6c8a18});});},'OpenchannelQueues':function(_0x3f5d88){return new Promise(function(_0x3601db,_0x26cba1){var _0x15be67=[];for(var _0x45e1f7 in _0x36670d['openchannelQueues']){if(_0x36670d['openchannelQueues']['hasOwnProperty'](_0x45e1f7)){var _0x3974d4=_0x36670d[_0x078f('0x56')][_0x45e1f7];var _0x3ed7f0={'id':_0x3974d4['id'],'available':_0x3974d4[_0x078f('0x50')],'loggedIn':_0x3974d4[_0x078f('0x51')],'name':_0x3974d4[_0x078f('0x52')],'paused':_0x3974d4[_0x078f('0x53')],'waiting':_0x3974d4[_0x078f('0x54')]};_0x15be67[_0x078f('0x23')](_0x3ed7f0);}}_0x3601db({'count':_0x15be67['length'],'rows':_0x15be67});});},'SmsQueues':function(_0x2ad40b){return new Promise(function(_0x569b88,_0x5b85a3){var _0x508721=[];for(var _0x4e80f5 in _0x36670d[_0x078f('0x57')]){if(_0x36670d[_0x078f('0x57')][_0x078f('0x4a')](_0x4e80f5)){var _0x451c52=_0x36670d[_0x078f('0x57')][_0x4e80f5];var _0x135874={'id':_0x451c52['id'],'available':_0x451c52[_0x078f('0x50')],'loggedIn':_0x451c52[_0x078f('0x51')],'name':_0x451c52[_0x078f('0x52')],'paused':_0x451c52['paused'],'waiting':_0x451c52['waiting']};_0x508721[_0x078f('0x23')](_0x135874);}}_0x569b88({'count':_0x508721[_0x078f('0x1b')],'rows':_0x508721});});},'FaxQueues':function(_0x29a0d1){return new Promise(function(_0x3d7f65,_0x466a55){var _0x4a08d7=[];for(var _0x38f65b in _0x36670d[_0x078f('0x58')]){if(_0x36670d['faxQueues'][_0x078f('0x4a')](_0x38f65b)){var _0x3c3828=_0x36670d[_0x078f('0x58')][_0x38f65b];var _0x3351b1={'id':_0x3c3828['id'],'available':_0x3c3828[_0x078f('0x50')],'loggedIn':_0x3c3828[_0x078f('0x51')],'name':_0x3c3828[_0x078f('0x52')],'paused':_0x3c3828[_0x078f('0x53')],'waiting':_0x3c3828[_0x078f('0x54')]};_0x4a08d7[_0x078f('0x23')](_0x3351b1);}}_0x3d7f65({'count':_0x4a08d7[_0x078f('0x1b')],'rows':_0x4a08d7});});},'WhatsappQueues':function(_0xe03b7f){return new Promise(function(_0x50da7c,_0x3a6de6){var _0x2e7451=[];for(var _0x28e18e in _0x36670d[_0x078f('0x59')]){if(_0x36670d[_0x078f('0x59')][_0x078f('0x4a')](_0x28e18e)){var _0xccfd4=_0x36670d['whatsappQueues'][_0x28e18e];var _0x2daa4e={'id':_0xccfd4['id'],'available':_0xccfd4[_0x078f('0x50')],'loggedIn':_0xccfd4[_0x078f('0x51')],'name':_0xccfd4[_0x078f('0x52')],'paused':_0xccfd4[_0x078f('0x53')],'waiting':_0xccfd4[_0x078f('0x54')]};_0x2e7451[_0x078f('0x23')](_0x2daa4e);}}_0x50da7c({'count':_0x2e7451[_0x078f('0x1b')],'rows':_0x2e7451});});},'ChatQueuesWaitingInteractions':function(_0x3563a3){return new Promise(function(_0x3fa237,_0x4872e3){var _0x10959c=_[_0x078f('0x4e')](_0x36670d['chatQueuesWaitingInteractions']);_0x3fa237({'count':_0x10959c['length'],'rows':_0x10959c});});},'MailQueuesWaitingInteractions':function(_0x3b3519){return new Promise(function(_0x2aa28f,_0x2e0abe){var _0x32a228=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5a')]);_0x2aa28f({'count':_0x32a228['length'],'rows':_0x32a228});});},'OpenchannelQueuesWaitingInteractions':function(_0x555dd6){return new Promise(function(_0x118ca3,_0x4b235a){var _0x2e49a6=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5b')]);_0x118ca3({'count':_0x2e49a6['length'],'rows':_0x2e49a6});});},'SmsQueuesWaitingInteractions':function(_0x1e4ec0){return new Promise(function(_0x563a88,_0x1fb814){var _0x11fa8d=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5c')]);_0x563a88({'count':_0x11fa8d[_0x078f('0x1b')],'rows':_0x11fa8d});});},'FaxQueuesWaitingInteractions':function(_0x28fdce){return new Promise(function(_0x17bf75,_0x118006){var _0xa7d82a=_['values'](_0x36670d[_0x078f('0x5d')]);_0x17bf75({'count':_0xa7d82a[_0x078f('0x1b')],'rows':_0xa7d82a});});},'WhatsappQueuesWaitingInteractions':function(_0x23f978){return new Promise(function(_0x34f38a,_0x2ee7fd){var _0x4d7b6b=_[_0x078f('0x4e')](_0x36670d['whatsappQueuesWaitingInteractions']);_0x34f38a({'count':_0x4d7b6b[_0x078f('0x1b')],'rows':_0x4d7b6b});});}};var _0x710913=jayson[_0x078f('0x5e')](_0x1a44f1)[_0x078f('0x5f')]();_0x710913['on']('error',function(_0x261f00){logger[_0x078f('0x37')](JSON[_0x078f('0x3a')](_0x261f00));return _0x1d8dba(_0x261f00);});_0x710913[_0x078f('0x60')](0x232c,_0x078f('0x61'),function(){console[_0x078f('0x62')](_0x078f('0x63'),0x232c);return _0x5465b8(_0x078f('0x64')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f31ae29..a4a9ddc 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 _0x0d16=['result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message'];(function(_0x2adf45,_0x394a10){var _0xde7a41=function(_0x29ba2b){while(--_0x29ba2b){_0x2adf45['push'](_0x2adf45['shift']());}};_0xde7a41(++_0x394a10);}(_0x0d16,0x90));var _0x60d1=function(_0xd6137f,_0xcc30c4){_0xd6137f=_0xd6137f-0x0;var _0x1c8e76=_0x0d16[_0xd6137f];return _0x1c8e76;};'use strict';var util=require('util');var BPromise=require(_0x60d1('0x0'));var jayson=require(_0x60d1('0x1'));var _=require(_0x60d1('0x2'));var logger=require(_0x60d1('0x3'))(_0x60d1('0x4'));var client=jayson[_0x60d1('0x5')][_0x60d1('0x6')]({'port':0x232a});function request(_0x4d2a4d,_0x430265){return new BPromise(function(_0x1c7d3e,_0x24a68a){return client[_0x60d1('0x7')](_0x4d2a4d,_0x430265)[_0x60d1('0x8')](function(_0x5a3585){if(_0x5a3585['error']){return _0x24a68a(_0x5a3585[_0x60d1('0x9')][_0x60d1('0xa')]);}else{return _0x1c7d3e(_0x5a3585[_0x60d1('0xb')]);}})[_0x60d1('0xc')](function(_0x580520){return _0x24a68a(_0x580520);});});}exports[_0x60d1('0xd')]=function(_0x749e48,_0x2154d0,_0xf63587){return function(_0x1087df){if(_0xf63587[_0x60d1('0xe')]&&!_0xf63587[_0x60d1('0xe')][_0x749e48]){logger[_0x60d1('0xf')](_0x60d1('0x10'),_0x749e48);return _0x1087df[_0x60d1('0x11')]();}var _0x17efea=[];for(var _0x5114d2=0x0;_0x5114d2<_0x2154d0[_0x60d1('0x12')];_0x5114d2+=0x1){_0x17efea['push'](request(_0x60d1('0x13'),{'command':util[_0x60d1('0x14')](_0x60d1('0x15'),_0x2154d0[_0x5114d2])})['then'](function(_0x35053e){return _0x35053e&&_0x35053e['message']&&_0x35053e['message']['indexOf']('true')>=0x0?!![]:![];})[_0x60d1('0xc')](function(_0x2170d9){logger[_0x60d1('0x9')](_0x60d1('0x16'),_0x749e48,_0x2154d0[_0x5114d2]);}));}BPromise[_0x60d1('0x17')](_0x17efea)[_0x60d1('0x8')](function(_0x2ac1cd){var _0x275114=_[_0x60d1('0x18')](_0x2ac1cd);logger[_0x60d1('0xf')]('[%s][INTERVAL]\x20%s\x20%s',_0x749e48,_0x2154d0[_0x60d1('0x19')](_0x60d1('0x1a')),_0x275114);_0x1087df[_0x60d1('0x1b')](_0x275114);})[_0x60d1('0xc')](function(_0x189832){console[_0x60d1('0x1c')](_0x189832);logger[_0x60d1('0x9')](_0x60d1('0x1d'),_0x749e48,_0x2154d0[_0x60d1('0x19')]('\x20|\x20'),_0x189832[_0x60d1('0x1e')]);_0x1087df[_0x60d1('0x11')]();});};}; \ No newline at end of file +var _0xc23d=['error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','then','indexOf','catch','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','util','jayson/promise','../../../config/logger','routing','client','http','request'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xc23d,0xc9));var _0xdc23=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0xc23d[_0x584291];return _0x4e7d08;};'use strict';var util=require(_0xdc23('0x0'));var BPromise=require('bluebird');var jayson=require(_0xdc23('0x1'));var _=require('lodash');var logger=require(_0xdc23('0x2'))(_0xdc23('0x3'));var client=jayson[_0xdc23('0x4')][_0xdc23('0x5')]({'port':0x232a});function request(_0x418fa9,_0x26dc3a){return new BPromise(function(_0x3369c2,_0x18976f){return client[_0xdc23('0x6')](_0x418fa9,_0x26dc3a)['then'](function(_0x2b06e2){if(_0x2b06e2[_0xdc23('0x7')]){return _0x18976f(_0x2b06e2[_0xdc23('0x7')][_0xdc23('0x8')]);}else{return _0x3369c2(_0x2b06e2[_0xdc23('0x9')]);}})['catch'](function(_0x133705){return _0x18976f(_0x133705);});});}exports['condition']=function(_0x345f31,_0x27427b,_0x3374fe){return function(_0x27b1d3){if(_0x3374fe[_0xdc23('0xa')]&&!_0x3374fe[_0xdc23('0xa')][_0x345f31]){logger[_0xdc23('0xb')](_0xdc23('0xc'),_0x345f31);return _0x27b1d3[_0xdc23('0xd')]();}var _0x5922fa=[];for(var _0x376f37=0x0;_0x376f37<_0x27427b['length'];_0x376f37+=0x1){_0x5922fa[_0xdc23('0xe')](request(_0xdc23('0xf'),{'command':util[_0xdc23('0x10')](_0xdc23('0x11'),_0x27427b[_0x376f37])})[_0xdc23('0x12')](function(_0x368b23){return _0x368b23&&_0x368b23[_0xdc23('0x8')]&&_0x368b23[_0xdc23('0x8')][_0xdc23('0x13')]('true')>=0x0?!![]:![];})[_0xdc23('0x14')](function(_0x1a477c){logger[_0xdc23('0x7')](_0xdc23('0x15'),_0x345f31,_0x27427b[_0x376f37]);}));}BPromise[_0xdc23('0x16')](_0x5922fa)[_0xdc23('0x12')](function(_0x1b1863){var _0x4dd311=_['some'](_0x1b1863);logger[_0xdc23('0xb')](_0xdc23('0x17'),_0x345f31,_0x27427b['join'](_0xdc23('0x18')),_0x4dd311);_0x27b1d3['when'](_0x4dd311);})[_0xdc23('0x14')](function(_0x5680f0){console[_0xdc23('0x19')](_0x5680f0);logger[_0xdc23('0x7')](_0xdc23('0x17'),_0x345f31,_0x27427b['join'](_0xdc23('0x18')),_0x5680f0['stack']);_0x27b1d3[_0xdc23('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 05f01a4..6a0fe0e 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 _0xd404=['channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','abandoned','agentconnect','info','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','secondtransfererlinkedid','transfertargetuniqueid','calleridname','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','diffTime','agent','complete','[%s][agents][hangup]','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd404,0x15b));var _0x4d40=function(_0x64b5fe,_0x2ab7ed){_0x64b5fe=_0x64b5fe-0x0;var _0x47f397=_0xd404[_0x64b5fe];return _0x47f397;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0xb6576c,_0x2322e5){utils['info'](util[_0x4d40('0x2')](_0x4d40('0x3'),_0xb6576c[_0x4d40('0x4')],_0xb6576c[_0x4d40('0x5')],_0xb6576c[_0x4d40('0x6')],_0xb6576c[_0x4d40('0x7')],_0xb6576c[_0x4d40('0x8')],_0xb6576c[_0x4d40('0x9')],_0xb6576c[_0x4d40('0xa')],_0xb6576c['lastevent']));if(_0xb6576c[_0x4d40('0x6')]){utils[_0x4d40('0xb')](_0xb6576c['queue'])[_0x4d40('0xc')](function(_0x5e31bc){if(_0x5e31bc){_0xb6576c['type']=_0x5e31bc[_0x4d40('0xd')];_0xb6576c[_0x4d40('0xe')]=_0xb6576c[_0x4d40('0xf')]?_0x5e31bc[_0x4d40('0x10')]:![];_0xb6576c[_0x4d40('0x11')]=_0xb6576c[_0x4d40('0xe')]?_0x5e31bc[_0x4d40('0x12')]:0x0;}utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);});}else{utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);}if(_0x2322e5){delete transfers[_0xb6576c[_0x4d40('0x4')]];}else{delete agents[_0xb6576c[_0x4d40('0x15')]];}}exports[_0x4d40('0x16')]=function(_0x5162f9){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x5162f9);agents[_0x5162f9[_0x4d40('0x15')]]=_0x5162f9;agents[_0x5162f9['destuniqueid']][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1b')]=_0x4d40('0x1c');agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0xa')]=null;agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1d')]=null;utils['info'](util['format'](_0x4d40('0x1e'),_0x5162f9[_0x4d40('0x4')],agents[_0x5162f9['destuniqueid']][_0x4d40('0x7')],_0x5162f9[_0x4d40('0x15')]));}catch(_0x4eec1d){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x4eec1d);}};exports['agentringnoanswer']=function(_0x57c997){try{if(!_[_0x4d40('0x20')](agents[_0x57c997[_0x4d40('0x15')]])){utils['debug'](util[_0x4d40('0x2')](_0x4d40('0x21'),_0x57c997[_0x4d40('0x4')]),_0x57c997);utils['info'](util[_0x4d40('0x2')](_0x4d40('0x22'),_0x57c997[_0x4d40('0x4')],agents[_0x57c997['destuniqueid']]['membername'],_0x57c997[_0x4d40('0x15')]));agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x23')]=!![];agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x24')]=utils['now']();agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x1b')]='timeout';agents[_0x57c997['destuniqueid']][_0x4d40('0x25')]=_0x4d40('0x26');agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x27')]=_0x57c997[_0x4d40('0x28')]?parseInt(_0x57c997[_0x4d40('0x28')])/0x3e8:0x0;agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x29')]=0x0;unanswered[_0x4d40('0x2a')](_0x57c997[_0x4d40('0x15')]);}}catch(_0x1c0fcf){utils['error'](util['format']('[%s][agents][agentringnoanswer]',_0x57c997[_0x4d40('0x4')]),_0x1c0fcf);}};exports[_0x4d40('0x2b')]=function(_0x1ac240){try{_[_0x4d40('0x2c')](agents,function(_0x598ca9,_0x18e601){if(_0x598ca9[_0x4d40('0x4')]==_0x1ac240[_0x4d40('0x4')]&&!_['includes'](unanswered,_0x598ca9[_0x4d40('0x15')])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x1ac240);utils['info'](util[_0x4d40('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ac240[_0x4d40('0x4')],_0x598ca9[_0x4d40('0x7')],_0x598ca9[_0x4d40('0x15')]));_0x598ca9[_0x4d40('0x23')]=!![];_0x598ca9['agentringnoanswerAt']=utils['now']();_0x598ca9[_0x4d40('0x1b')]=_0x4d40('0x2e');_0x598ca9[_0x4d40('0x25')]=_0x4d40('0x2e');_0x598ca9['holdtime']=_0x1ac240[_0x4d40('0x27')];_0x598ca9['talktime']=0x0;writeDB(_0x598ca9);}});}catch(_0x2fde16){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x2fde16);}};exports[_0x4d40('0x2f')]=function(_0x1d1ba9){try{if(agents[_0x1d1ba9[_0x4d40('0x15')]]){utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1d1ba9);utils[_0x4d40('0x30')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1d1ba9['uniqueid'],agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x7')],_0x1d1ba9['destuniqueid']));agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0xa')]=_0x1d1ba9['connectedlinenum'];agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x1d')]=_0x1d1ba9['connectedlinename'];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x27')]=_0x1d1ba9[_0x4d40('0x28')];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x1b')]=_0x4d40('0x32');_['forIn'](agents,function(_0x1e8427,_0x1a9586){if(_0x1e8427['destuniqueid']!=_0x1d1ba9[_0x4d40('0x15')]&&_0x1e8427[_0x4d40('0x4')]==_0x1d1ba9['uniqueid']){_0x1e8427[_0x4d40('0x29')]=0x0;_0x1e8427['holdtime']=_0x1d1ba9[_0x4d40('0x28')];_0x1e8427[_0x4d40('0x23')]=!![];_0x1e8427[_0x4d40('0x24')]=utils[_0x4d40('0x1a')]();_0x1e8427[_0x4d40('0x1b')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x25')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x34')]=_0x1d1ba9['destuniqueid'];_0x1e8427[_0x4d40('0x35')]=_0x1d1ba9[_0x4d40('0x7')];writeDB(_0x1e8427);}});}}catch(_0x1c2fa8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1c2fa8);}};exports['agentcomplete']=function(_0x2e7f75){try{if(!_[_0x4d40('0x20')](agents[_0x2e7f75[_0x4d40('0x15')]])){utils[_0x4d40('0x17')](util['format'](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x2e7f75);utils['info'](util[_0x4d40('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2e7f75[_0x4d40('0x4')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x7')],_0x2e7f75[_0x4d40('0x15')]));agents[_0x2e7f75['destuniqueid']][_0x4d40('0xf')]=!![];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x29')]=utils['diffTime'](agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x37')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x31')]);agents[_0x2e7f75['destuniqueid']][_0x4d40('0x25')]=_0x2e7f75[_0x4d40('0x25')];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x1b')]='complete';writeDB(agents[_0x2e7f75[_0x4d40('0x15')]]);}}catch(_0x1777e8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x1777e8);}};exports[_0x4d40('0x38')]=function(_0x37b6bf){try{if(!_[_0x4d40('0x20')](agents[_0x37b6bf['transfereruniqueid']])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x39'),_0x37b6bf[_0x4d40('0x4')]),_0x37b6bf);utils[_0x4d40('0x30')](util['format'](_0x4d40('0x3a'),_0x37b6bf[_0x4d40('0x4')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x7')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x4')]));agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3c')]=!![];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x3d')]=_0x4d40('0x3e');agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3f')]=_0x37b6bf[_0x4d40('0x40')];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x41')]=agents[_0x37b6bf[_0x4d40('0x3b')]]['uniqueid'];}}catch(_0x1000f4){utils['error'](util[_0x4d40('0x2')]('[%s][agents][blindtransfer]',_0x37b6bf[_0x4d40('0x4')]),_0x1000f4);}};exports[_0x4d40('0x42')]=function(_0x539df4){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x43'),_0x539df4[_0x4d40('0x44')]),_0x539df4);if(_0x539df4[_0x4d40('0x44')]==_0x539df4[_0x4d40('0x45')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x46')]])){utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3d')]=_0x4d40('0x48');agents[_0x539df4['secondtransfereruniqueid']][_0x4d40('0x3f')]=_0x539df4[_0x4d40('0x49')];agents[_0x539df4['secondtransfereruniqueid']]['transferuniqueid']=_0x539df4[_0x4d40('0x44')];}if(_0x539df4[_0x4d40('0x4a')]&&agents[_0x539df4['transfereeuniqueid']]){agents[_0x539df4['transfereeuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4['transfereeuniqueid']]=_[_0x4d40('0x4c')](agents[_0x539df4['transfereeuniqueid']]);transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x9')]=agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x9')];transfers[_0x539df4[_0x4d40('0x4a')]]['calleridname']=agents[_0x539df4['secondtransfereruniqueid']]['calleridname'];transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x31')]=utils['now']();transfers[_0x539df4[_0x4d40('0x4a')]]['holdtime']=0x0;transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x4b')]=0x2;}}else if(_0x539df4[_0x4d40('0x46')]==_0x539df4[_0x4d40('0x4d')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x44')]])){utils['info'](util['format'](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3d')]='ATTENDED';agents[_0x539df4[_0x4d40('0x44')]]['transferexten']=_0x539df4['secondtransfererexten'];agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x41')]=_0x539df4[_0x4d40('0x46')];}if(_0x539df4[_0x4d40('0x4e')]&&agents[_0x539df4[_0x4d40('0x4e')]]){agents[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4[_0x4d40('0x4e')]]=_[_0x4d40('0x4c')](agents[_0x539df4[_0x4d40('0x4e')]]);transfers[_0x539df4[_0x4d40('0x4e')]]['calleridnum']=agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x9')];transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4f')]=agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x4f')];transfers[_0x539df4['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x27')]=0x0;transfers[_0x539df4[_0x4d40('0x4e')]][_0x4d40('0x4b')]=0x2;}}}catch(_0x3bce3d){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][attendedtransfer]',_0x539df4['origtransfereruniqueid']),_0x3bce3d);}};exports['hangup']=function(_0x13872b){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][hangup]',_0x13872b[_0x4d40('0x4')]),_0x13872b);if(agents[_0x13872b[_0x4d40('0x4')]]&&agents[_0x13872b['uniqueid']]['reason']===_0x4d40('0x26')){if(_0x13872b[_0x4d40('0x50')]==='21'){agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=_0x4d40('0x51');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x51');}utils[_0x4d40('0x30')](util['format'](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b[_0x4d40('0x4')]]);var _0x7df23=unanswered['indexOf'](_0x13872b[_0x4d40('0x4')]);if(_0x7df23>-0x1){unanswered[_0x4d40('0x53')](_0x7df23,0x1);}}if(transfers[_0x13872b[_0x4d40('0x4')]]){transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];transfers[_0x13872b['uniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x29')]=utils[_0x4d40('0x54')](transfers[_0x13872b[_0x4d40('0x4')]]['agentcompleteAt'],transfers[_0x13872b[_0x4d40('0x4')]]['agentconnectAt']);transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')]=_0x4d40('0x55');transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]='complete';utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b[_0x4d40('0x4')],transfers[_0x13872b['uniqueid']][_0x4d40('0x7')],transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')],transfers[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(transfers[_0x13872b[_0x4d40('0x4')]],!![]);}if(agents[_0x13872b['uniqueid']]&&agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]){agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];agents[_0x13872b['uniqueid']]['agentcompleteAt']=utils[_0x4d40('0x1a')]();agents[_0x13872b[_0x4d40('0x4')]]['talktime']=utils[_0x4d40('0x54')](agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x37')],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]);agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x3c')]?_0x4d40('0x3c'):_0x4d40('0x55');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x56');utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b['uniqueid']]);}}catch(_0x33b8f3){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x57'),_0x13872b[_0x4d40('0x4')]),_0x33b8f3);}}; \ No newline at end of file +var _0x84a0=['transferexten','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','complete','lodash','util','./utils','info','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','timeout','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x84a0,0x66));var _0x084a=function(_0x4f7624,_0x4a883e){_0x4f7624=_0x4f7624-0x0;var _0x5bdefe=_0x84a0[_0x4f7624];return _0x5bdefe;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var utils=require(_0x084a('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fff7f,_0x483bfa){utils[_0x084a('0x3')](util[_0x084a('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1fff7f['uniqueid'],_0x1fff7f[_0x084a('0x5')],_0x1fff7f[_0x084a('0x6')],_0x1fff7f['membername'],_0x1fff7f[_0x084a('0x7')],_0x1fff7f[_0x084a('0x8')],_0x1fff7f[_0x084a('0x9')],_0x1fff7f[_0x084a('0xa')]));if(_0x1fff7f[_0x084a('0x6')]){utils['getVoiceQueueByName'](_0x1fff7f[_0x084a('0x6')])[_0x084a('0xb')](function(_0x8198ad){if(_0x8198ad){_0x1fff7f[_0x084a('0xc')]=_0x8198ad[_0x084a('0xc')];_0x1fff7f['agentacw']=_0x1fff7f['agentcomplete']?_0x8198ad[_0x084a('0xd')]:![];_0x1fff7f[_0x084a('0xe')]=_0x1fff7f[_0x084a('0xf')]?_0x8198ad[_0x084a('0x10')]:0x0;}utils[_0x084a('0x11')]('CreateVoiceAgentReport',_0x1fff7f);});}else{utils['request'](_0x084a('0x12'),_0x1fff7f);}if(_0x483bfa){delete transfers[_0x1fff7f[_0x084a('0x13')]];}else{delete agents[_0x1fff7f[_0x084a('0x14')]];}}exports[_0x084a('0x15')]=function(_0x1bdfb8){try{utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x17'),_0x1bdfb8['uniqueid']),_0x1bdfb8);agents[_0x1bdfb8[_0x084a('0x14')]]=_0x1bdfb8;agents[_0x1bdfb8['destuniqueid']][_0x084a('0x18')]=utils[_0x084a('0x19')]();agents[_0x1bdfb8[_0x084a('0x14')]][_0x084a('0xa')]=_0x084a('0x1a');agents[_0x1bdfb8['destuniqueid']][_0x084a('0x9')]=null;agents[_0x1bdfb8['destuniqueid']][_0x084a('0x1b')]=null;utils[_0x084a('0x3')](util['format'](_0x084a('0x1c'),_0x1bdfb8[_0x084a('0x13')],agents[_0x1bdfb8[_0x084a('0x14')]][_0x084a('0x1d')],_0x1bdfb8[_0x084a('0x14')]));}catch(_0x145636){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x17'),_0x1bdfb8[_0x084a('0x13')]),_0x145636);}};exports[_0x084a('0x1f')]=function(_0x279e25){try{if(!_[_0x084a('0x20')](agents[_0x279e25[_0x084a('0x14')]])){utils[_0x084a('0x16')](util['format'](_0x084a('0x21'),_0x279e25[_0x084a('0x13')]),_0x279e25);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x22'),_0x279e25['uniqueid'],agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x1d')],_0x279e25[_0x084a('0x14')]));agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x1f')]=!![];agents[_0x279e25[_0x084a('0x14')]]['agentringnoanswerAt']=utils[_0x084a('0x19')]();agents[_0x279e25[_0x084a('0x14')]][_0x084a('0xa')]='timeout';agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x23')]=_0x084a('0x24');agents[_0x279e25['destuniqueid']]['holdtime']=_0x279e25['ringtime']?parseInt(_0x279e25['ringtime'])/0x3e8:0x0;agents[_0x279e25[_0x084a('0x14')]]['talktime']=0x0;unanswered['push'](_0x279e25['destuniqueid']);}}catch(_0x3b8176){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x21'),_0x279e25[_0x084a('0x13')]),_0x3b8176);}};exports[_0x084a('0x25')]=function(_0x378de6){try{_[_0x084a('0x26')](agents,function(_0x5e6ea8,_0x2ed3cd){if(_0x5e6ea8[_0x084a('0x13')]==_0x378de6['uniqueid']&&!_[_0x084a('0x27')](unanswered,_0x5e6ea8[_0x084a('0x14')])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x28'),_0x378de6[_0x084a('0x13')]),_0x378de6);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x29'),_0x378de6[_0x084a('0x13')],_0x5e6ea8[_0x084a('0x1d')],_0x5e6ea8[_0x084a('0x14')]));_0x5e6ea8[_0x084a('0x1f')]=!![];_0x5e6ea8['agentringnoanswerAt']=utils['now']();_0x5e6ea8[_0x084a('0xa')]=_0x084a('0x2a');_0x5e6ea8[_0x084a('0x23')]=_0x084a('0x2a');_0x5e6ea8[_0x084a('0x2b')]=_0x378de6['holdtime'];_0x5e6ea8[_0x084a('0x2c')]=0x0;writeDB(_0x5e6ea8);}});}catch(_0x1b56ad){utils[_0x084a('0x1e')](util['format'](_0x084a('0x28'),_0x378de6[_0x084a('0x13')]),_0x1b56ad);}};exports[_0x084a('0x2d')]=function(_0x4c4c90){try{if(agents[_0x4c4c90['destuniqueid']]){utils['debug'](util[_0x084a('0x4')](_0x084a('0x2e'),_0x4c4c90[_0x084a('0x13')]),_0x4c4c90);utils['info'](util[_0x084a('0x4')](_0x084a('0x2f'),_0x4c4c90[_0x084a('0x13')],agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x1d')],_0x4c4c90[_0x084a('0x14')]));agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x9')]=_0x4c4c90[_0x084a('0x9')];agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x1b')]=_0x4c4c90[_0x084a('0x1b')];agents[_0x4c4c90['destuniqueid']][_0x084a('0x2b')]=_0x4c4c90[_0x084a('0x31')];agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0xa')]=_0x084a('0x32');_[_0x084a('0x26')](agents,function(_0xa7b652,_0x183e10){if(_0xa7b652[_0x084a('0x14')]!=_0x4c4c90['destuniqueid']&&_0xa7b652[_0x084a('0x13')]==_0x4c4c90[_0x084a('0x13')]){_0xa7b652[_0x084a('0x2c')]=0x0;_0xa7b652[_0x084a('0x2b')]=_0x4c4c90[_0x084a('0x31')];_0xa7b652[_0x084a('0x1f')]=!![];_0xa7b652['agentringnoanswerAt']=utils[_0x084a('0x19')]();_0xa7b652[_0x084a('0xa')]='answered_elsewhere';_0xa7b652[_0x084a('0x23')]=_0x084a('0x33');_0xa7b652[_0x084a('0x34')]=_0x4c4c90['destuniqueid'];_0xa7b652[_0x084a('0x35')]=_0x4c4c90[_0x084a('0x1d')];writeDB(_0xa7b652);}});}}catch(_0x4fe9c2){utils[_0x084a('0x1e')](util[_0x084a('0x4')]('[%s][agents][agentconnect]',_0x4c4c90['uniqueid']),_0x4fe9c2);}};exports[_0x084a('0x36')]=function(_0x17a8d4){try{if(!_[_0x084a('0x20')](agents[_0x17a8d4[_0x084a('0x14')]])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x37'),_0x17a8d4[_0x084a('0x13')]),_0x17a8d4);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x38'),_0x17a8d4['uniqueid'],agents[_0x17a8d4['destuniqueid']][_0x084a('0x1d')],_0x17a8d4[_0x084a('0x14')]));agents[_0x17a8d4[_0x084a('0x14')]]['agentcomplete']=!![];agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x39')]=utils[_0x084a('0x19')]();agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x2c')]=utils['diffTime'](agents[_0x17a8d4[_0x084a('0x14')]]['agentcompleteAt'],agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x30')]);agents[_0x17a8d4[_0x084a('0x14')]]['reason']=_0x17a8d4['reason'];agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0xa')]='complete';writeDB(agents[_0x17a8d4[_0x084a('0x14')]]);}}catch(_0x2c2c2e){utils[_0x084a('0x1e')](util[_0x084a('0x4')]('[%s][agents][agentcomplete]',_0x17a8d4[_0x084a('0x13')]),_0x2c2c2e);}};exports[_0x084a('0x3a')]=function(_0x31677b){try{if(!_[_0x084a('0x20')](agents[_0x31677b['transfereruniqueid']])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x3b'),_0x31677b[_0x084a('0x13')]),_0x31677b);utils['info'](util['format'](_0x084a('0x3c'),_0x31677b[_0x084a('0x13')],agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x1d')],agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x13')]));agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x3e')]=!![];agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x3f')]=_0x084a('0x40');agents[_0x31677b[_0x084a('0x3d')]]['transferexten']=_0x31677b[_0x084a('0x41')];agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x42')]=agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x13')];}}catch(_0x1c972c){utils[_0x084a('0x1e')](util['format'](_0x084a('0x3b'),_0x31677b[_0x084a('0x13')]),_0x1c972c);}};exports[_0x084a('0x43')]=function(_0x54aa6c){try{utils['debug'](util[_0x084a('0x4')]('[%s][agents][attendedtransfer]',_0x54aa6c[_0x084a('0x44')]),_0x54aa6c);if(_0x54aa6c[_0x084a('0x44')]==_0x54aa6c['origtransfererlinkedid']){if(!_[_0x084a('0x20')](agents[_0x54aa6c['secondtransfereruniqueid']])){utils['info'](util[_0x084a('0x4')](_0x084a('0x45'),_0x54aa6c[_0x084a('0x44')],agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x1d')]));agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x3e')]=!![];agents[_0x54aa6c['secondtransfereruniqueid']][_0x084a('0x3f')]=_0x084a('0x47');agents[_0x54aa6c[_0x084a('0x46')]]['transferexten']=_0x54aa6c[_0x084a('0x48')];agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x42')]=_0x54aa6c[_0x084a('0x44')];}if(_0x54aa6c['transfereeuniqueid']&&agents[_0x54aa6c[_0x084a('0x49')]]){agents[_0x54aa6c['transfereeuniqueid']][_0x084a('0x4a')]=0x1;transfers[_0x54aa6c[_0x084a('0x49')]]=_[_0x084a('0x4b')](agents[_0x54aa6c['transfereeuniqueid']]);transfers[_0x54aa6c['transfereeuniqueid']][_0x084a('0x8')]=agents[_0x54aa6c[_0x084a('0x46')]]['calleridnum'];transfers[_0x54aa6c[_0x084a('0x49')]]['calleridname']=agents[_0x54aa6c['secondtransfereruniqueid']][_0x084a('0x4c')];transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x18')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x2b')]=0x0;transfers[_0x54aa6c['transfereeuniqueid']][_0x084a('0x4a')]=0x2;}}else if(_0x54aa6c[_0x084a('0x46')]==_0x54aa6c[_0x084a('0x4d')]){if(!_['isNil'](agents[_0x54aa6c[_0x084a('0x44')]])){utils[_0x084a('0x3')](util['format'](_0x084a('0x45'),_0x54aa6c['origtransfereruniqueid'],agents[_0x54aa6c['origtransfereruniqueid']][_0x084a('0x1d')]));agents[_0x54aa6c['origtransfereruniqueid']]['transfer']=!![];agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x3f')]=_0x084a('0x47');agents[_0x54aa6c['origtransfereruniqueid']][_0x084a('0x4e')]=_0x54aa6c[_0x084a('0x4f')];agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x42')]=_0x54aa6c[_0x084a('0x46')];}if(_0x54aa6c[_0x084a('0x50')]&&agents[_0x54aa6c[_0x084a('0x50')]]){agents[_0x54aa6c['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x54aa6c[_0x084a('0x50')]]=_[_0x084a('0x4b')](agents[_0x54aa6c['transfertargetuniqueid']]);transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x8')]=agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x8')];transfers[_0x54aa6c['transfertargetuniqueid']][_0x084a('0x4c')]=agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x4c')];transfers[_0x54aa6c['transfertargetuniqueid']]['agentcalledAt']=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x2b')]=0x0;transfers[_0x54aa6c[_0x084a('0x50')]]['agententerreason']=0x2;}}}catch(_0x22efb6){utils['error'](util['format'](_0x084a('0x51'),_0x54aa6c[_0x084a('0x44')]),_0x22efb6);}};exports[_0x084a('0x52')]=function(_0x4a2745){try{utils[_0x084a('0x16')](util['format'](_0x084a('0x53'),_0x4a2745[_0x084a('0x13')]),_0x4a2745);if(agents[_0x4a2745[_0x084a('0x13')]]&&agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]===_0x084a('0x24')){if(_0x4a2745['cause']==='21'){agents[_0x4a2745['uniqueid']][_0x084a('0x23')]=_0x084a('0x54');agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]=_0x084a('0x54');}utils[_0x084a('0x3')](util['format'](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x1d')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],agents[_0x4a2745[_0x084a('0x13')]]['lastevent']));writeDB(agents[_0x4a2745[_0x084a('0x13')]]);var _0x38b5b6=unanswered[_0x084a('0x56')](_0x4a2745[_0x084a('0x13')]);if(_0x38b5b6>-0x1){unanswered[_0x084a('0x57')](_0x38b5b6,0x1);}}if(transfers[_0x4a2745[_0x084a('0x13')]]){transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x36')]=!![];transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')]=utils['now']();transfers[_0x4a2745['uniqueid']]['talktime']=utils[_0x084a('0x58')](transfers[_0x4a2745[_0x084a('0x13')]]['agentcompleteAt'],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x30')]);transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]='agent';transfers[_0x4a2745['uniqueid']][_0x084a('0xa')]=_0x084a('0x59');utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],transfers[_0x4a2745[_0x084a('0x13')]]['membername'],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]));writeDB(transfers[_0x4a2745[_0x084a('0x13')]],!![]);}if(agents[_0x4a2745[_0x084a('0x13')]]&&agents[_0x4a2745[_0x084a('0x13')]]['agentconnectAt']){agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x36')]=!![];agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')]=utils[_0x084a('0x19')]();agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x2c')]=utils[_0x084a('0x58')](agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')],agents[_0x4a2745[_0x084a('0x13')]]['agentconnectAt']);agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]=agents[_0x4a2745['uniqueid']][_0x084a('0x3e')]?'transfer':'agent';agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]='complete';utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x1d')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]));writeDB(agents[_0x4a2745[_0x084a('0x13')]]);}}catch(_0x7c85e3){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x53'),_0x4a2745['uniqueid']),_0x7c85e3);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2699e2a..66272fa 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 _0xef56=['localtwolinkedid','[%s][calls][attendedtransfer]','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','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','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','lastIndexOf','execif','gotoif','[%s][calls][newexten]','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','then','UserId','request','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','accountcode','calleridnum','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','callerid','calleridname','endtime','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer'];(function(_0x25d6db,_0x51b7f8){var _0x2abc0c=function(_0x180d7b){while(--_0x180d7b){_0x25d6db['push'](_0x25d6db['shift']());}};_0x2abc0c(++_0x51b7f8);}(_0xef56,0x103));var _0x6ef5=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xef56[_0x111e94];return _0x3de107;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require(_0x6ef5('0x0'));var dispositions=['NO\x20ANSWER',_0x6ef5('0x1'),_0x6ef5('0x1'),_0x6ef5('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x6ef5('0x3'),_0x6ef5('0x4'),_0x6ef5('0x1'),'FAILED',_0x6ef5('0x1')];var channels={};function writeDB(_0x292110){var _0x3af74a;if(transfers['blinds'][_0x292110[_0x6ef5('0x5')]]){_0x3af74a=_0x292110[_0x6ef5('0x5')];_0x292110[_0x6ef5('0x5')]=transfers[_0x6ef5('0x6')][_0x292110['uniqueid']][_0x6ef5('0x7')];}utils['info'](util[_0x6ef5('0x8')](_0x6ef5('0x9'),_0x292110['uniqueid'],_0x292110[_0x6ef5('0xa')],_0x292110[_0x6ef5('0xb')],_0x292110['membername'],_0x292110[_0x6ef5('0xc')],_0x292110['calleridnum'],_0x292110[_0x6ef5('0xd')],_0x292110[_0x6ef5('0xe')]));if(_0x292110['accountcode']){utils['getUserByInternal'](_0x292110['accountcode'])[_0x6ef5('0xf')](function(_0x7048c1){if(_0x7048c1){_0x292110[_0x6ef5('0x10')]=_0x7048c1['id'];}utils[_0x6ef5('0x11')]('CreateVoiceCallReport',_0x292110);});}else{utils[_0x6ef5('0x11')]('CreateVoiceCallReport',_0x292110);}if(channels[_0x292110[_0x6ef5('0x5')]]){delete channels[_0x292110[_0x6ef5('0x5')]];}else if(_0x3af74a&&channels[_0x3af74a]){if(!transfers[_0x6ef5('0x6')][_0x3af74a][_0x6ef5('0x12')])delete transfers['blinds'][_0x3af74a];delete channels[_0x3af74a];}}exports[_0x6ef5('0x13')]=function(_0xfa2f72){try{utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')](_0x6ef5('0x15'),_0xfa2f72[_0x6ef5('0x5')]),_0xfa2f72);if(_0xfa2f72[_0x6ef5('0x5')]==_0xfa2f72[_0x6ef5('0x16')]&&_0xfa2f72[_0x6ef5('0xa')]!=_0x6ef5('0x17')){utils['info'](util[_0x6ef5('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xfa2f72[_0x6ef5('0x5')],_0xfa2f72['context'],_0xfa2f72[_0x6ef5('0x18')]));channels[_0xfa2f72[_0x6ef5('0x5')]]={'uniqueid':_0xfa2f72[_0x6ef5('0x5')],'accountcode':_0xfa2f72[_0x6ef5('0x19')],'source':_0xfa2f72[_0x6ef5('0x1a')],'destination':_0xfa2f72[_0x6ef5('0x18')],'destinationcontext':_0xfa2f72['context'],'channel':_0xfa2f72[_0x6ef5('0xa')],'starttime':utils[_0x6ef5('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6ef5('0x2'),'amaflags':_0x6ef5('0x1c')};}}catch(_0xb4db70){utils['error'](util['format'](_0x6ef5('0x15'),_0xfa2f72[_0x6ef5('0x5')]),_0xb4db70);}};exports[_0x6ef5('0x1d')]=function(_0x1e408e){try{utils['debug'](util[_0x6ef5('0x8')](_0x6ef5('0x1e'),_0x1e408e[_0x6ef5('0x5')]),_0x1e408e);if(!_[_0x6ef5('0x1f')](channels[_0x1e408e[_0x6ef5('0x5')]])&&_0x1e408e[_0x6ef5('0x20')]==0x6){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x22'),_0x1e408e['uniqueid'],_0x1e408e[_0x6ef5('0x23')],_0x1e408e[_0x6ef5('0xa')]));if(_[_0x6ef5('0x1f')](channels[_0x1e408e[_0x6ef5('0x5')]][_0x6ef5('0x24')])){channels[_0x1e408e[_0x6ef5('0x5')]][_0x6ef5('0x24')]=utils[_0x6ef5('0x1b')]();}}else if(!_['isNil'](channels[_0x1e408e[_0x6ef5('0x16')]])&&_0x1e408e[_0x6ef5('0x20')]==0x6&&_0x1e408e[_0x6ef5('0x23')]!=_0x6ef5('0x25')){utils['info'](util[_0x6ef5('0x8')](_0x6ef5('0x26'),_0x1e408e[_0x6ef5('0x5')],_0x1e408e['linkedid'],_0x1e408e['context'],_0x1e408e[_0x6ef5('0xa')]));channels[_0x1e408e['linkedid']][_0x6ef5('0x19')]=_0x1e408e[_0x6ef5('0x19')];channels[_0x1e408e[_0x6ef5('0x16')]][_0x6ef5('0x27')]=_0x1e408e[_0x6ef5('0xa')];if(_[_0x6ef5('0x1f')](channels[_0x1e408e['linkedid']][_0x6ef5('0x28')])){channels[_0x1e408e[_0x6ef5('0x16')]]['answertime']=utils[_0x6ef5('0x1b')]();}channels[_0x1e408e['linkedid']][_0x6ef5('0x29')]=dispositions[_[_0x6ef5('0x2a')](_0x1e408e[_0x6ef5('0x20')])]||_0x6ef5('0x3');}}catch(_0x121baa){utils[_0x6ef5('0x2b')](util[_0x6ef5('0x8')](_0x6ef5('0x1e'),_0x1e408e[_0x6ef5('0x5')]),_0x121baa);}};exports[_0x6ef5('0x2c')]=function(_0x1489b5){try{if(!_[_0x6ef5('0x1f')](channels[_0x1489b5[_0x6ef5('0x5')]])){utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')]('[%s][calls][hangup]',_0x1489b5['uniqueid']),_0x1489b5);if(_[_0x6ef5('0x1f')](channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x2d')])){channels[_0x1489b5['uniqueid']][_0x6ef5('0x2d')]=_0x1489b5[_0x6ef5('0x2e')]+'\x20<'+_0x1489b5[_0x6ef5('0x1a')]+'>';}utils[_0x6ef5('0x21')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1489b5['uniqueid'],channels[_0x1489b5[_0x6ef5('0x5')]]['callerid'],_0x1489b5['cause-txt']));channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x2f')]=utils['now']();channels[_0x1489b5[_0x6ef5('0x5')]]['duration']=utils[_0x6ef5('0x30')](channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x2f')],channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x31')]);channels[_0x1489b5['uniqueid']][_0x6ef5('0x32')]=channels[_0x1489b5['uniqueid']]['answertime']?utils[_0x6ef5('0x30')](channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x2f')],channels[_0x1489b5[_0x6ef5('0x5')]][_0x6ef5('0x28')]):0x0;writeDB(channels[_0x1489b5[_0x6ef5('0x5')]]);}}catch(_0x4dafb0){utils[_0x6ef5('0x2b')](util['format'](_0x6ef5('0x33'),_0x1489b5[_0x6ef5('0x5')]),_0x4dafb0);}};exports[_0x6ef5('0x34')]=function(_0x45a291){try{if(!_[_0x6ef5('0x1f')](channels[_0x45a291[_0x6ef5('0x35')]])){utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')](_0x6ef5('0x36'),_0x45a291['origtransfereruniqueid']),_0x45a291);if(channels[_0x45a291[_0x6ef5('0x35')]][_0x6ef5('0xa')]==_0x45a291['transfereechannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x45a291['origtransfereruniqueid'],_0x45a291[_0x6ef5('0x35')],_0x45a291['secondtransfererchannel']));channels[_0x45a291['localtwolinkedid']][_0x6ef5('0x27')]=_0x45a291['secondtransfererchannel'];channels[_0x45a291[_0x6ef5('0x35')]][_0x6ef5('0x37')]=_0x6ef5('0x38');}else if(channels[_0x45a291['localtwolinkedid']][_0x6ef5('0xa')]=_0x45a291[_0x6ef5('0x39')]){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x3a'),_0x45a291[_0x6ef5('0x3b')],_0x45a291[_0x6ef5('0x35')],_0x45a291[_0x6ef5('0x3c')]));channels[_0x45a291[_0x6ef5('0x35')]][_0x6ef5('0x27')]=_0x45a291['origtransfererchannel'];channels[_0x45a291[_0x6ef5('0x35')]][_0x6ef5('0x37')]=_0x6ef5('0x38');}}}catch(_0xcdcdf5){utils[_0x6ef5('0x2b')](util[_0x6ef5('0x8')](_0x6ef5('0x36'),_0x45a291[_0x6ef5('0x3b')]),_0xcdcdf5);}};exports[_0x6ef5('0x3d')]=function(_0x388d29){try{if(!_[_0x6ef5('0x1f')](channels[_0x388d29['uniqueid']])){utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')](_0x6ef5('0x3e'),_0x388d29[_0x6ef5('0x5')]),_0x388d29);channels[_0x388d29[_0x6ef5('0x5')]][_0x6ef5('0x3f')]=utils[_0x6ef5('0x1b')]();utils[_0x6ef5('0x21')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x388d29['uniqueid'],channels[_0x388d29[_0x6ef5('0x5')]][_0x6ef5('0x3f')]));}}catch(_0x432b86){utils[_0x6ef5('0x2b')](util[_0x6ef5('0x8')](_0x6ef5('0x3e'),_0x388d29['uniqueid']),_0x432b86);}};exports['musiconholdstop']=function(_0x23b698){try{if(!_[_0x6ef5('0x1f')](channels[_0x23b698[_0x6ef5('0x5')]])){utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')](_0x6ef5('0x40'),_0x23b698[_0x6ef5('0x5')]),_0x23b698);if(!_[_0x6ef5('0x1f')](channels[_0x23b698[_0x6ef5('0x5')]][_0x6ef5('0x3f')])){channels[_0x23b698[_0x6ef5('0x5')]][_0x6ef5('0x41')]+=utils['diffTime'](utils['now'](),channels[_0x23b698[_0x6ef5('0x5')]][_0x6ef5('0x3f')]);utils[_0x6ef5('0x21')](util['format'](_0x6ef5('0x42'),_0x23b698[_0x6ef5('0x5')],channels[_0x23b698['uniqueid']][_0x6ef5('0x41')]));delete channels[_0x23b698['uniqueid']][_0x6ef5('0x3f')];}}}catch(_0x244f69){utils['error'](util[_0x6ef5('0x8')](_0x6ef5('0x40'),_0x23b698[_0x6ef5('0x5')]),_0x244f69);}};exports['varset']=function(_0x744755){try{if(!_[_0x6ef5('0x1f')](channels[_0x744755['uniqueid']])){utils[_0x6ef5('0x14')](util[_0x6ef5('0x8')](_0x6ef5('0x43'),_0x744755['uniqueid']),_0x744755);if(!_[_0x6ef5('0x1f')](_0x744755['variable'][_0x6ef5('0x44')])){utils['info'](util[_0x6ef5('0x8')](_0x6ef5('0x45'),_0x744755[_0x6ef5('0x5')],_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]]['source']=_0x744755['value'];}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x48')])){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x49'),_0x744755[_0x6ef5('0x5')],_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x4a')]=_0x744755[_0x6ef5('0x46')];channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x2d')]='\x22'+_0x744755[_0x6ef5('0x46')]+_0x6ef5('0x4b')+_0x744755[_0x6ef5('0x46')]+'>';}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x4c')])||!_[_0x6ef5('0x1f')](_0x744755['variable'][_0x6ef5('0x4d')])){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x4e'),_0x744755[_0x6ef5('0x5')],!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x4c')])?_0x6ef5('0x4c'):_0x6ef5('0x4d'),_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x2d')]=_0x744755[_0x6ef5('0x46')];}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x4f')])||!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x50')])){utils['info'](util['format'](_0x6ef5('0x4e'),_0x744755[_0x6ef5('0x5')],!_['isNil'](_0x744755['variable'][_0x6ef5('0x4f')])?_0x6ef5('0x4f'):_0x6ef5('0x50'),_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x51')]=_0x6ef5('0x52');channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x53')]=_0x744755[_0x6ef5('0x46')];channels[_0x744755['uniqueid']][_0x6ef5('0xb')]=!![];}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x54')])){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x55'),_0x744755[_0x6ef5('0x5')],_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x56')]=_0x744755[_0x6ef5('0x46')];}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x57')])){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x58'),_0x744755[_0x6ef5('0x5')],_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x59')]=_0x744755[_0x6ef5('0x46')];}if(!_['isNil'](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x5a')])){utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x744755[_0x6ef5('0x5')],_0x744755['value']));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x5b')]=_0x744755[_0x6ef5('0x46')];}if(!_[_0x6ef5('0x1f')](_0x744755[_0x6ef5('0x47')][_0x6ef5('0x5c')])){utils[_0x6ef5('0x21')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x744755[_0x6ef5('0x5')],_0x744755[_0x6ef5('0x46')]));channels[_0x744755[_0x6ef5('0x5')]][_0x6ef5('0x5c')]=_0x744755[_0x6ef5('0x46')];}}}catch(_0x4a0d2){utils[_0x6ef5('0x2b')](util['format'](_0x6ef5('0x43'),_0x744755[_0x6ef5('0x5')]),_0x4a0d2);}};exports['newexten']=function(_0x4f5de5){try{if(!_[_0x6ef5('0x1f')](channels[_0x4f5de5[_0x6ef5('0x5')]])){utils[_0x6ef5('0x14')](util['format']('[%s][calls][newexten]',_0x4f5de5[_0x6ef5('0x5')]),_0x4f5de5);utils[_0x6ef5('0x21')](util[_0x6ef5('0x8')](_0x6ef5('0x5d'),_0x4f5de5['uniqueid'],_0x4f5de5[_0x6ef5('0x5e')],_0x4f5de5[_0x6ef5('0x5f')]));if(_0x4f5de5[_0x6ef5('0x5e')][_0x6ef5('0x60')]()==_0x6ef5('0x61')&&_[_0x6ef5('0x62')](_0x4f5de5['appdata'][_0x6ef5('0x60')](),'cdr')){var _0x126b8a=_0x4f5de5[_0x6ef5('0x5f')][_0x6ef5('0x63')]('=');var _0x26ee84=_0x126b8a[0x0]['substring'](_0x126b8a[0x0][_0x6ef5('0x64')]('(')+0x1,_0x126b8a[0x0][_0x6ef5('0x64')](')'));var _0x94952f=_0x126b8a[0x1];channels[_0x4f5de5[_0x6ef5('0x5')]][_0x26ee84]=_0x94952f;}if(!_['includes'](['hangup','noop',_0x6ef5('0x65'),'set',_0x6ef5('0x66')],_0x4f5de5[_0x6ef5('0x5e')]['toLowerCase']())){channels[_0x4f5de5[_0x6ef5('0x5')]][_0x6ef5('0x51')]=_0x4f5de5['application'];channels[_0x4f5de5[_0x6ef5('0x5')]]['lastdata']=_0x4f5de5[_0x6ef5('0x5f')];}}}catch(_0x2239b7){utils[_0x6ef5('0x2b')](util[_0x6ef5('0x8')](_0x6ef5('0x67'),_0x4f5de5[_0x6ef5('0x5')]),_0x2239b7);}}; \ No newline at end of file +var _0x29b1=['then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','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','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','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','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','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','lastdata','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','calleridnum','connectedlinenum','accountcode','getUserByInternal'];(function(_0x58a115,_0x2672f2){var _0x2d1221=function(_0x259552){while(--_0x259552){_0x58a115['push'](_0x58a115['shift']());}};_0x2d1221(++_0x2672f2);}(_0x29b1,0x13b));var _0x129b=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x29b1[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x129b('0x0'));var transfers=require(_0x129b('0x1'));var dispositions=[_0x129b('0x2'),_0x129b('0x3'),_0x129b('0x3'),_0x129b('0x2'),_0x129b('0x2'),_0x129b('0x2'),_0x129b('0x4'),_0x129b('0x5'),_0x129b('0x3'),'FAILED',_0x129b('0x3')];var channels={};function writeDB(_0x5f0bcc){var _0x1155dd;if(transfers[_0x129b('0x6')][_0x5f0bcc['uniqueid']]){_0x1155dd=_0x5f0bcc['uniqueid'];_0x5f0bcc[_0x129b('0x7')]=transfers['blinds'][_0x5f0bcc[_0x129b('0x7')]][_0x129b('0x8')];}utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0xb'),_0x5f0bcc[_0x129b('0x7')],_0x5f0bcc['channel'],_0x5f0bcc[_0x129b('0xc')],_0x5f0bcc[_0x129b('0xd')],_0x5f0bcc['interface'],_0x5f0bcc[_0x129b('0xe')],_0x5f0bcc[_0x129b('0xf')],_0x5f0bcc['lastevent']));if(_0x5f0bcc[_0x129b('0x10')]){utils[_0x129b('0x11')](_0x5f0bcc[_0x129b('0x10')])[_0x129b('0x12')](function(_0x379cd1){if(_0x379cd1){_0x5f0bcc['UserId']=_0x379cd1['id'];}utils[_0x129b('0x13')](_0x129b('0x14'),_0x5f0bcc);});}else{utils[_0x129b('0x13')]('CreateVoiceCallReport',_0x5f0bcc);}if(channels[_0x5f0bcc[_0x129b('0x7')]]){delete channels[_0x5f0bcc[_0x129b('0x7')]];}else if(_0x1155dd&&channels[_0x1155dd]){if(!transfers['blinds'][_0x1155dd][_0x129b('0x15')])delete transfers['blinds'][_0x1155dd];delete channels[_0x1155dd];}}exports[_0x129b('0x16')]=function(_0x3462dd){try{utils[_0x129b('0x17')](util[_0x129b('0xa')](_0x129b('0x18'),_0x3462dd[_0x129b('0x7')]),_0x3462dd);if(_0x3462dd['uniqueid']==_0x3462dd[_0x129b('0x19')]&&_0x3462dd[_0x129b('0x1a')]!='OutgoingSpoolFailed'){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x1b'),_0x3462dd[_0x129b('0x7')],_0x3462dd[_0x129b('0x1c')],_0x3462dd[_0x129b('0x1d')]));channels[_0x3462dd['uniqueid']]={'uniqueid':_0x3462dd[_0x129b('0x7')],'accountcode':_0x3462dd[_0x129b('0x10')],'source':_0x3462dd['calleridnum'],'destination':_0x3462dd[_0x129b('0x1d')],'destinationcontext':_0x3462dd['context'],'channel':_0x3462dd[_0x129b('0x1a')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x129b('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x26d9d5){utils[_0x129b('0x1e')](util[_0x129b('0xa')]('[%s][calls][newchannel]',_0x3462dd[_0x129b('0x7')]),_0x26d9d5);}};exports[_0x129b('0x1f')]=function(_0x17c055){try{utils['debug'](util['format'](_0x129b('0x20'),_0x17c055[_0x129b('0x7')]),_0x17c055);if(!_['isNil'](channels[_0x17c055[_0x129b('0x7')]])&&_0x17c055[_0x129b('0x21')]==0x6){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x22'),_0x17c055[_0x129b('0x7')],_0x17c055[_0x129b('0x1c')],_0x17c055[_0x129b('0x1a')]));if(_[_0x129b('0x23')](channels[_0x17c055[_0x129b('0x7')]][_0x129b('0x24')])){channels[_0x17c055[_0x129b('0x7')]][_0x129b('0x24')]=utils[_0x129b('0x25')]();}}else if(!_[_0x129b('0x23')](channels[_0x17c055[_0x129b('0x19')]])&&_0x17c055['channelstate']==0x6&&_0x17c055[_0x129b('0x1c')]!=_0x129b('0x26')){utils['info'](util[_0x129b('0xa')](_0x129b('0x27'),_0x17c055['uniqueid'],_0x17c055['linkedid'],_0x17c055[_0x129b('0x1c')],_0x17c055['channel']));channels[_0x17c055[_0x129b('0x19')]][_0x129b('0x10')]=_0x17c055[_0x129b('0x10')];channels[_0x17c055[_0x129b('0x19')]][_0x129b('0x28')]=_0x17c055[_0x129b('0x1a')];if(_[_0x129b('0x23')](channels[_0x17c055[_0x129b('0x19')]][_0x129b('0x29')])){channels[_0x17c055[_0x129b('0x19')]][_0x129b('0x29')]=utils['now']();}channels[_0x17c055['linkedid']][_0x129b('0x2a')]=dispositions[_[_0x129b('0x2b')](_0x17c055['channelstate'])]||_0x129b('0x4');}}catch(_0x3e67cf){utils['error'](util['format']('[%s][calls][newstate]',_0x17c055[_0x129b('0x7')]),_0x3e67cf);}};exports[_0x129b('0x2c')]=function(_0x22fd45){try{if(!_['isNil'](channels[_0x22fd45['uniqueid']])){utils[_0x129b('0x17')](util[_0x129b('0xa')](_0x129b('0x2d'),_0x22fd45[_0x129b('0x7')]),_0x22fd45);if(_[_0x129b('0x23')](channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x2e')])){channels[_0x22fd45['uniqueid']][_0x129b('0x2e')]=_0x22fd45[_0x129b('0x2f')]+'\x20<'+_0x22fd45[_0x129b('0xe')]+'>';}utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x30'),_0x22fd45[_0x129b('0x7')],channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x2e')],_0x22fd45[_0x129b('0x31')]));channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x32')]=utils['now']();channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x33')]=utils[_0x129b('0x34')](channels[_0x22fd45[_0x129b('0x7')]]['endtime'],channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x35')]);channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x36')]=channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x29')]?utils[_0x129b('0x34')](channels[_0x22fd45[_0x129b('0x7')]][_0x129b('0x32')],channels[_0x22fd45[_0x129b('0x7')]]['answertime']):0x0;writeDB(channels[_0x22fd45[_0x129b('0x7')]]);}}catch(_0x42c5b5){utils[_0x129b('0x1e')](util['format'](_0x129b('0x2d'),_0x22fd45[_0x129b('0x7')]),_0x42c5b5);}};exports[_0x129b('0x37')]=function(_0x77b26b){try{if(!_[_0x129b('0x23')](channels[_0x77b26b[_0x129b('0x38')]])){utils['debug'](util['format'](_0x129b('0x39'),_0x77b26b[_0x129b('0x3a')]),_0x77b26b);if(channels[_0x77b26b['localtwolinkedid']]['channel']==_0x77b26b['transfereechannel']){utils[_0x129b('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x77b26b[_0x129b('0x3a')],_0x77b26b[_0x129b('0x38')],_0x77b26b['secondtransfererchannel']));channels[_0x77b26b[_0x129b('0x38')]]['destinationchannel']=_0x77b26b[_0x129b('0x3b')];channels[_0x77b26b['localtwolinkedid']]['userfield']=_0x129b('0x3c');}else if(channels[_0x77b26b[_0x129b('0x38')]][_0x129b('0x1a')]=_0x77b26b[_0x129b('0x3d')]){utils[_0x129b('0x9')](util['format'](_0x129b('0x3e'),_0x77b26b['origtransfereruniqueid'],_0x77b26b[_0x129b('0x38')],_0x77b26b[_0x129b('0x3f')]));channels[_0x77b26b[_0x129b('0x38')]][_0x129b('0x28')]=_0x77b26b[_0x129b('0x3f')];channels[_0x77b26b['localtwolinkedid']][_0x129b('0x40')]='_attended';}}}catch(_0x419e54){utils[_0x129b('0x1e')](util[_0x129b('0xa')](_0x129b('0x39'),_0x77b26b[_0x129b('0x3a')]),_0x419e54);}};exports[_0x129b('0x41')]=function(_0x24b66e){try{if(!_['isNil'](channels[_0x24b66e['uniqueid']])){utils[_0x129b('0x17')](util[_0x129b('0xa')](_0x129b('0x42'),_0x24b66e[_0x129b('0x7')]),_0x24b66e);channels[_0x24b66e[_0x129b('0x7')]][_0x129b('0x43')]=utils[_0x129b('0x25')]();utils[_0x129b('0x9')](util[_0x129b('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x24b66e[_0x129b('0x7')],channels[_0x24b66e[_0x129b('0x7')]]['musiconholdstartAt']));}}catch(_0x14ae97){utils[_0x129b('0x1e')](util[_0x129b('0xa')](_0x129b('0x42'),_0x24b66e['uniqueid']),_0x14ae97);}};exports['musiconholdstop']=function(_0x326353){try{if(!_[_0x129b('0x23')](channels[_0x326353[_0x129b('0x7')]])){utils[_0x129b('0x17')](util[_0x129b('0xa')](_0x129b('0x44'),_0x326353[_0x129b('0x7')]),_0x326353);if(!_[_0x129b('0x23')](channels[_0x326353[_0x129b('0x7')]][_0x129b('0x43')])){channels[_0x326353[_0x129b('0x7')]][_0x129b('0x45')]+=utils['diffTime'](utils[_0x129b('0x25')](),channels[_0x326353[_0x129b('0x7')]]['musiconholdstartAt']);utils[_0x129b('0x9')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x326353['uniqueid'],channels[_0x326353[_0x129b('0x7')]][_0x129b('0x45')]));delete channels[_0x326353[_0x129b('0x7')]][_0x129b('0x43')];}}}catch(_0x209e93){utils[_0x129b('0x1e')](util[_0x129b('0xa')](_0x129b('0x44'),_0x326353[_0x129b('0x7')]),_0x209e93);}};exports[_0x129b('0x46')]=function(_0x30af78){try{if(!_['isNil'](channels[_0x30af78[_0x129b('0x7')]])){utils[_0x129b('0x17')](util['format'](_0x129b('0x47'),_0x30af78['uniqueid']),_0x30af78);if(!_['isNil'](_0x30af78['variable'][_0x129b('0x48')])){utils['info'](util['format'](_0x129b('0x49'),_0x30af78['uniqueid'],_0x30af78[_0x129b('0x4a')]));channels[_0x30af78[_0x129b('0x7')]]['source']=_0x30af78[_0x129b('0x4a')];}if(!_['isNil'](_0x30af78[_0x129b('0x4b')][_0x129b('0x4c')])){utils[_0x129b('0x9')](util['format'](_0x129b('0x4d'),_0x30af78[_0x129b('0x7')],_0x30af78[_0x129b('0x4a')]));channels[_0x30af78[_0x129b('0x7')]][_0x129b('0x4e')]=_0x30af78['value'];channels[_0x30af78['uniqueid']][_0x129b('0x2e')]='\x22'+_0x30af78[_0x129b('0x4a')]+_0x129b('0x4f')+_0x30af78[_0x129b('0x4a')]+'>';}if(!_['isNil'](_0x30af78['variable'][_0x129b('0x50')])||!_[_0x129b('0x23')](_0x30af78[_0x129b('0x4b')][_0x129b('0x51')])){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x52'),_0x30af78[_0x129b('0x7')],!_['isNil'](_0x30af78[_0x129b('0x4b')]['xmd-callerid-preview'])?_0x129b('0x50'):_0x129b('0x51'),_0x30af78[_0x129b('0x4a')]));channels[_0x30af78['uniqueid']][_0x129b('0x2e')]=_0x30af78[_0x129b('0x4a')];}if(!_['isNil'](_0x30af78['variable'][_0x129b('0x53')])||!_[_0x129b('0x23')](_0x30af78['variable'][_0x129b('0x54')])){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x52'),_0x30af78[_0x129b('0x7')],!_[_0x129b('0x23')](_0x30af78[_0x129b('0x4b')][_0x129b('0x53')])?_0x129b('0x53'):'xmcs-queue',_0x30af78[_0x129b('0x4a')]));channels[_0x30af78['uniqueid']][_0x129b('0x55')]=_0x129b('0x56');channels[_0x30af78['uniqueid']]['lastdata']=_0x30af78['value'];channels[_0x30af78[_0x129b('0x7')]][_0x129b('0xc')]=!![];}if(!_[_0x129b('0x23')](_0x30af78['variable'][_0x129b('0x57')])){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x58'),_0x30af78[_0x129b('0x7')],_0x30af78[_0x129b('0x4a')]));channels[_0x30af78[_0x129b('0x7')]][_0x129b('0x59')]=_0x30af78[_0x129b('0x4a')];}if(!_['isNil'](_0x30af78[_0x129b('0x4b')]['xmd-cdrtype'])){utils[_0x129b('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x30af78[_0x129b('0x7')],_0x30af78[_0x129b('0x4a')]));channels[_0x30af78[_0x129b('0x7')]]['type']=_0x30af78[_0x129b('0x4a')];}if(!_[_0x129b('0x23')](_0x30af78['variable'][_0x129b('0x5a')])){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x5b'),_0x30af78[_0x129b('0x7')],_0x30af78[_0x129b('0x4a')]));channels[_0x30af78[_0x129b('0x7')]][_0x129b('0x5c')]=_0x30af78['value'];}if(!_[_0x129b('0x23')](_0x30af78[_0x129b('0x4b')][_0x129b('0x5d')])){utils[_0x129b('0x9')](util[_0x129b('0xa')](_0x129b('0x5e'),_0x30af78['uniqueid'],_0x30af78['value']));channels[_0x30af78[_0x129b('0x7')]][_0x129b('0x5d')]=_0x30af78[_0x129b('0x4a')];}}}catch(_0x1f8f42){utils[_0x129b('0x1e')](util[_0x129b('0xa')](_0x129b('0x47'),_0x30af78['uniqueid']),_0x1f8f42);}};exports[_0x129b('0x5f')]=function(_0x4f192f){try{if(!_[_0x129b('0x23')](channels[_0x4f192f[_0x129b('0x7')]])){utils[_0x129b('0x17')](util[_0x129b('0xa')]('[%s][calls][newexten]',_0x4f192f['uniqueid']),_0x4f192f);utils['info'](util[_0x129b('0xa')](_0x129b('0x60'),_0x4f192f[_0x129b('0x7')],_0x4f192f[_0x129b('0x61')],_0x4f192f[_0x129b('0x62')]));if(_0x4f192f['application'][_0x129b('0x63')]()==_0x129b('0x64')&&_[_0x129b('0x65')](_0x4f192f[_0x129b('0x62')][_0x129b('0x63')](),_0x129b('0x66'))){var _0x468abd=_0x4f192f[_0x129b('0x62')][_0x129b('0x67')]('=');var _0x515d42=_0x468abd[0x0][_0x129b('0x68')](_0x468abd[0x0][_0x129b('0x69')]('(')+0x1,_0x468abd[0x0][_0x129b('0x69')](')'));var _0x193967=_0x468abd[0x1];channels[_0x4f192f['uniqueid']][_0x515d42]=_0x193967;}if(!_[_0x129b('0x6a')]([_0x129b('0x2c'),_0x129b('0x6b'),_0x129b('0x6c'),_0x129b('0x64'),_0x129b('0x6d')],_0x4f192f[_0x129b('0x61')][_0x129b('0x63')]())){channels[_0x4f192f[_0x129b('0x7')]]['lastapplication']=_0x4f192f[_0x129b('0x61')];channels[_0x4f192f[_0x129b('0x7')]][_0x129b('0x6e')]=_0x4f192f['appdata'];}}}catch(_0x2771ac){utils[_0x129b('0x1e')](util[_0x129b('0xa')]('[%s][calls][newexten]',_0x4f192f[_0x129b('0x7')]),_0x2771ac);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4f3f0fd..e6d3a03 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 _0xabc5=['close','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x3cbcb9,_0xaa986){var _0x499d79=function(_0x1389f1){while(--_0x1389f1){_0x3cbcb9['push'](_0x3cbcb9['shift']());}};_0x499d79(++_0xaa986);}(_0xabc5,0x137));var _0x5abc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabc5[_0x2dafbe];return _0x58a45a;};'use strict';var utils=require(_0x5abc('0x0'));exports[_0x5abc('0x1')]=function(){utils[_0x5abc('0x2')](_0x5abc('0x3'));};exports['shutdown']=function(){utils[_0x5abc('0x2')](_0x5abc('0x4'));};exports[_0x5abc('0x5')]=function(){utils[_0x5abc('0x2')](_0x5abc('0x6'));};exports['error']=function(_0x3206c4){utils[_0x5abc('0x7')](_0x5abc('0x8'),_0x3206c4);};exports[_0x5abc('0x9')]=function(){utils[_0x5abc('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x3eeb77){}; \ No newline at end of file +var _0xf405=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected','shutdown'];(function(_0x59a272,_0x185c55){var _0xa02dc5=function(_0x35fd9f){while(--_0x35fd9f){_0x59a272['push'](_0x59a272['shift']());}};_0xa02dc5(++_0x185c55);}(_0xf405,0x1b4));var _0x5f40=function(_0x5ca413,_0x1034d6){_0x5ca413=_0x5ca413-0x0;var _0x4b259b=_0xf405[_0x5ca413];return _0x4b259b;};'use strict';var utils=require(_0x5f40('0x0'));exports['connect']=function(){utils[_0x5f40('0x1')](_0x5f40('0x2'));};exports[_0x5f40('0x3')]=function(){utils[_0x5f40('0x1')](_0x5f40('0x4'));};exports[_0x5f40('0x5')]=function(){utils['info'](_0x5f40('0x6'));};exports[_0x5f40('0x7')]=function(_0x5decc7){utils[_0x5f40('0x7')](_0x5f40('0x8'),_0x5decc7);};exports[_0x5f40('0x9')]=function(){utils[_0x5f40('0x1')]('[core]\x20close');};exports[_0x5f40('0xa')]=function(_0x353329){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 080f641..9306da8 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 _0x63fb=['billableseconds','info','format','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','starttime','holdtime','diffTime','endtime'];(function(_0x46d208,_0x3654d0){var _0x3bc42f=function(_0x4722bf){while(--_0x4722bf){_0x46d208['push'](_0x46d208['shift']());}};_0x3bc42f(++_0x3654d0);}(_0x63fb,0x8b));var _0xb63f=function(_0xbec2cd,_0xcf1938){_0xbec2cd=_0xbec2cd-0x0;var _0x38142e=_0x63fb[_0xbec2cd];return _0x38142e;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x355c4e){utils[_0xb63f('0x0')](util[_0xb63f('0x1')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x355c4e['uniqueid'],_0x355c4e['channel'],_0x355c4e[_0xb63f('0x2')],_0x355c4e[_0xb63f('0x3')],_0x355c4e[_0xb63f('0x4')],_0x355c4e[_0xb63f('0x5')]));utils[_0xb63f('0x6')](_0xb63f('0x7'),_0x355c4e);delete dials[_0x355c4e[_0xb63f('0x8')]];}exports['newexten']=function(_0x592fa7){try{utils[_0xb63f('0x9')](util['format'](_0xb63f('0xa'),_0x592fa7[_0xb63f('0x8')]),_0x592fa7);utils[_0xb63f('0x0')](util[_0xb63f('0x1')](_0xb63f('0xb'),_0x592fa7[_0xb63f('0x8')],_0x592fa7[_0xb63f('0xc')],_0x592fa7[_0xb63f('0xd')]));if(_0x592fa7[_0xb63f('0xc')][_0xb63f('0xe')]()==_0xb63f('0xf')&&_['startsWith'](_0x592fa7['appdata'][_0xb63f('0xe')](),_0xb63f('0x10'))){var _0x2d16a0=_0x592fa7[_0xb63f('0xd')][_0xb63f('0x11')]('=');dials[_0x592fa7[_0xb63f('0x8')]]={'routeId':_0x2d16a0[0x1]};}}catch(_0x555e50){utils[_0xb63f('0x12')](util[_0xb63f('0x1')]('[%s][dials][newexten]',_0x592fa7[_0xb63f('0x8')]),_0x555e50);}};exports['varset']=function(_0x328bbc){try{utils[_0xb63f('0x9')](util[_0xb63f('0x1')](_0xb63f('0x13'),_0x328bbc[_0xb63f('0x8')]),_0x328bbc);if(!_[_0xb63f('0x14')](_0x328bbc[_0xb63f('0x15')][_0xb63f('0x16')])){utils['info'](util['format'](_0xb63f('0x17'),_0x328bbc[_0xb63f('0x8')],_0x328bbc[_0xb63f('0x18')]));dials[_0x328bbc['uniqueid']]={'routeId':_0x328bbc[_0xb63f('0x18')]};}}catch(_0x27c5f6){utils[_0xb63f('0x12')](util['format']('[%s][dials][varset]',_0x328bbc[_0xb63f('0x8')]),_0x27c5f6);}};exports['dialbegin']=function(_0x4c7552){try{if(!_[_0xb63f('0x14')](dials[_0x4c7552[_0xb63f('0x8')]])){utils[_0xb63f('0x9')](util['format'](_0xb63f('0x19'),_0x4c7552[_0xb63f('0x8')]),_0x4c7552);dials[_0x4c7552[_0xb63f('0x8')]]=_[_0xb63f('0x1a')](dials[_0x4c7552[_0xb63f('0x8')]],_0x4c7552);dials[_0x4c7552[_0xb63f('0x8')]]['starttime']=utils[_0xb63f('0x1b')]();dials[_0x4c7552[_0xb63f('0x8')]][_0xb63f('0x1c')]=_0xb63f('0x1d');utils[_0xb63f('0x0')](util[_0xb63f('0x1')](_0xb63f('0x1e'),_0x4c7552[_0xb63f('0x8')],dials[_0x4c7552[_0xb63f('0x8')]]['starttime']));}}catch(_0x439b85){utils[_0xb63f('0x12')](util[_0xb63f('0x1')]('[%s][dials][dialbegin]',_0x4c7552[_0xb63f('0x8')]),_0x439b85);}};exports[_0xb63f('0x1f')]=function(_0x23d16b){try{if(!_[_0xb63f('0x14')](dials[_0x23d16b[_0xb63f('0x8')]])){utils[_0xb63f('0x9')](util['format'](_0xb63f('0x20'),_0x23d16b[_0xb63f('0x8')]),_0x23d16b);dials[_0x23d16b[_0xb63f('0x8')]][_0xb63f('0x5')]=_0x23d16b[_0xb63f('0x5')];if(_0x23d16b[_0xb63f('0x5')]==_0xb63f('0x21')){dials[_0x23d16b[_0xb63f('0x8')]]=_[_0xb63f('0x1a')](dials[_0x23d16b[_0xb63f('0x8')]],_0x23d16b);dials[_0x23d16b[_0xb63f('0x8')]][_0xb63f('0x22')]=utils[_0xb63f('0x1b')]();dials[_0x23d16b['uniqueid']][_0xb63f('0x1c')]='connect';utils[_0xb63f('0x0')](util[_0xb63f('0x1')](_0xb63f('0x23'),_0x23d16b[_0xb63f('0x8')],_0x23d16b[_0xb63f('0x5')],dials[_0x23d16b[_0xb63f('0x8')]][_0xb63f('0x22')]));}else{utils[_0xb63f('0x0')](util[_0xb63f('0x1')]('[%s][dials][dialend]\x20dialstatus:%s',_0x23d16b[_0xb63f('0x8')],_0x23d16b['dialstatus']));}}}catch(_0x5806d4){utils[_0xb63f('0x12')](util[_0xb63f('0x1')]('[%s][dials][dialend]',_0x23d16b[_0xb63f('0x8')]),_0x5806d4);}};exports[_0xb63f('0x24')]=function(_0x2a932e){try{if(!_[_0xb63f('0x14')](dials[_0x2a932e[_0xb63f('0x8')]])){utils[_0xb63f('0x9')](util[_0xb63f('0x1')](_0xb63f('0x25'),_0x2a932e['uniqueid']),_0x2a932e);utils['info'](util[_0xb63f('0x1')](_0xb63f('0x26'),_0x2a932e[_0xb63f('0x8')],_0x2a932e[_0xb63f('0x3')],_0x2a932e[_0xb63f('0x27')],_0x2a932e['cause-txt']));dials[_0x2a932e[_0xb63f('0x8')]]=_['assign'](dials[_0x2a932e['uniqueid']],{'endtime':utils[_0xb63f('0x1b')](),'lastevent':_0xb63f('0x28')});dials[_0x2a932e[_0xb63f('0x8')]]['duration']=utils['diffTime'](dials[_0x2a932e[_0xb63f('0x8')]]['endtime'],dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x29')]);dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x2a')]=utils[_0xb63f('0x2b')](dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x22')]||dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x2c')],dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x29')]);dials[_0x2a932e['uniqueid']][_0xb63f('0x2d')]=dials[_0x2a932e['uniqueid']][_0xb63f('0x22')]?utils[_0xb63f('0x2b')](dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x2c')],dials[_0x2a932e[_0xb63f('0x8')]][_0xb63f('0x22')]):0x0;writeDB(dials[_0x2a932e[_0xb63f('0x8')]]);}}catch(_0x3190e7){utils['error'](util['format'](_0xb63f('0x25'),_0x2a932e[_0xb63f('0x8')]),_0x3190e7);}}; \ No newline at end of file +var _0x065b=['billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','toLowerCase','cdr(routeid)','appdata','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','diffTime','endtime','holdtime'];(function(_0x58eaae,_0xf403fc){var _0x4d81d4=function(_0x1ddf9c){while(--_0x1ddf9c){_0x58eaae['push'](_0x58eaae['shift']());}};_0x4d81d4(++_0xf403fc);}(_0x065b,0x191));var _0xb065=function(_0x3f0bd7,_0x16284c){_0x3f0bd7=_0x3f0bd7-0x0;var _0x1cbb2f=_0x065b[_0x3f0bd7];return _0x1cbb2f;};'use strict';var _=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var utils=require(_0xb065('0x2'));var dials={};function writeDB(_0x3c2a48){utils[_0xb065('0x3')](util[_0xb065('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x3c2a48[_0xb065('0x5')],_0x3c2a48[_0xb065('0x6')],_0x3c2a48[_0xb065('0x7')],_0x3c2a48[_0xb065('0x8')],_0x3c2a48[_0xb065('0x9')],_0x3c2a48['dialstatus']));utils[_0xb065('0xa')](_0xb065('0xb'),_0x3c2a48);delete dials[_0x3c2a48[_0xb065('0x5')]];}exports[_0xb065('0xc')]=function(_0x2cd1a3){try{utils[_0xb065('0xd')](util['format']('[%s][dials][newexten]',_0x2cd1a3[_0xb065('0x5')]),_0x2cd1a3);utils['info'](util[_0xb065('0x4')](_0xb065('0xe'),_0x2cd1a3[_0xb065('0x5')],_0x2cd1a3['application'],_0x2cd1a3['appdata']));if(_0x2cd1a3[_0xb065('0xf')]['toLowerCase']()==_0xb065('0x10')&&_[_0xb065('0x11')](_0x2cd1a3['appdata'][_0xb065('0x12')](),_0xb065('0x13'))){var _0x517bca=_0x2cd1a3[_0xb065('0x14')][_0xb065('0x15')]('=');dials[_0x2cd1a3[_0xb065('0x5')]]={'routeId':_0x517bca[0x1]};}}catch(_0xc9e150){utils[_0xb065('0x16')](util[_0xb065('0x4')](_0xb065('0x17'),_0x2cd1a3[_0xb065('0x5')]),_0xc9e150);}};exports[_0xb065('0x18')]=function(_0x4d815d){try{utils[_0xb065('0xd')](util['format'](_0xb065('0x19'),_0x4d815d[_0xb065('0x5')]),_0x4d815d);if(!_[_0xb065('0x1a')](_0x4d815d['variable']['outboundrouteid'])){utils[_0xb065('0x3')](util[_0xb065('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4d815d[_0xb065('0x5')],_0x4d815d[_0xb065('0x1b')]));dials[_0x4d815d['uniqueid']]={'routeId':_0x4d815d['value']};}}catch(_0x2c3587){utils['error'](util[_0xb065('0x4')](_0xb065('0x19'),_0x4d815d[_0xb065('0x5')]),_0x2c3587);}};exports[_0xb065('0x1c')]=function(_0xed0601){try{if(!_['isNil'](dials[_0xed0601[_0xb065('0x5')]])){utils[_0xb065('0xd')](util[_0xb065('0x4')](_0xb065('0x1d'),_0xed0601[_0xb065('0x5')]),_0xed0601);dials[_0xed0601[_0xb065('0x5')]]=_[_0xb065('0x1e')](dials[_0xed0601[_0xb065('0x5')]],_0xed0601);dials[_0xed0601[_0xb065('0x5')]][_0xb065('0x1f')]=utils[_0xb065('0x20')]();dials[_0xed0601[_0xb065('0x5')]][_0xb065('0x21')]='called';utils['info'](util[_0xb065('0x4')](_0xb065('0x22'),_0xed0601['uniqueid'],dials[_0xed0601['uniqueid']]['starttime']));}}catch(_0x32d4e0){utils['error'](util[_0xb065('0x4')](_0xb065('0x1d'),_0xed0601[_0xb065('0x5')]),_0x32d4e0);}};exports['dialend']=function(_0x3bc6f9){try{if(!_[_0xb065('0x1a')](dials[_0x3bc6f9['uniqueid']])){utils['debug'](util[_0xb065('0x4')](_0xb065('0x23'),_0x3bc6f9[_0xb065('0x5')]),_0x3bc6f9);dials[_0x3bc6f9[_0xb065('0x5')]]['dialstatus']=_0x3bc6f9['dialstatus'];if(_0x3bc6f9[_0xb065('0x24')]==_0xb065('0x25')){dials[_0x3bc6f9['uniqueid']]=_[_0xb065('0x1e')](dials[_0x3bc6f9[_0xb065('0x5')]],_0x3bc6f9);dials[_0x3bc6f9['uniqueid']][_0xb065('0x26')]=utils[_0xb065('0x20')]();dials[_0x3bc6f9[_0xb065('0x5')]][_0xb065('0x21')]=_0xb065('0x27');utils[_0xb065('0x3')](util[_0xb065('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3bc6f9[_0xb065('0x5')],_0x3bc6f9[_0xb065('0x24')],dials[_0x3bc6f9[_0xb065('0x5')]][_0xb065('0x26')]));}else{utils[_0xb065('0x3')](util[_0xb065('0x4')](_0xb065('0x28'),_0x3bc6f9[_0xb065('0x5')],_0x3bc6f9[_0xb065('0x24')]));}}}catch(_0x26eb5f){utils[_0xb065('0x16')](util[_0xb065('0x4')](_0xb065('0x23'),_0x3bc6f9['uniqueid']),_0x26eb5f);}};exports[_0xb065('0x29')]=function(_0x4e7901){try{if(!_[_0xb065('0x1a')](dials[_0x4e7901[_0xb065('0x5')]])){utils[_0xb065('0xd')](util[_0xb065('0x4')](_0xb065('0x2a'),_0x4e7901['uniqueid']),_0x4e7901);utils[_0xb065('0x3')](util['format'](_0xb065('0x2b'),_0x4e7901[_0xb065('0x5')],_0x4e7901[_0xb065('0x8')],_0x4e7901[_0xb065('0x2c')],_0x4e7901[_0xb065('0x2d')]));dials[_0x4e7901['uniqueid']]=_['assign'](dials[_0x4e7901['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4e7901['uniqueid']]['duration']=utils[_0xb065('0x2e')](dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x2f')],dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x1f')]);dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x30')]=utils['diffTime'](dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x26')]||dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x2f')],dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x1f')]);dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x31')]=dials[_0x4e7901['uniqueid']]['answertime']?utils[_0xb065('0x2e')](dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x2f')],dials[_0x4e7901[_0xb065('0x5')]][_0xb065('0x26')]):0x0;writeDB(dials[_0x4e7901['uniqueid']]);}}catch(_0x49eb37){utils[_0xb065('0x16')](util[_0xb065('0x4')](_0xb065('0x2a'),_0x4e7901[_0xb065('0x5')]),_0x49eb37);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 2a6a49d..0b80e77 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 _0x3c6c=['./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','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','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','port','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller'];(function(_0x12d43c,_0x367b75){var _0x2b34d5=function(_0x518fff){while(--_0x518fff){_0x12d43c['push'](_0x12d43c['shift']());}};_0x2b34d5(++_0x367b75);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x3c4aba,_0x4ee39e){_0x3c4aba=_0x3c4aba-0x0;var _0x3a1498=_0x3c6c[_0x3c4aba];return _0x3a1498;};var AsteriskManager=require(_0xc3c6('0x0'));var config=require('../../config/environment');var utils=require(_0xc3c6('0x1'));var util=require(_0xc3c6('0x2'));var isXDREnabled=config[_0xc3c6('0x3')]&&!config[_0xc3c6('0x3')][_0xc3c6('0x4')];var isProduction=config[_0xc3c6('0x5')]===_0xc3c6('0x6')||![];var isLocalAsterisk=config[_0xc3c6('0x3')]&&config['xdr'][_0xc3c6('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xc3c6('0x8')],config['asterisk']['ip'],config['asterisk']['username'],config['asterisk']['password'],!![]);ami[_0xc3c6('0x9')]();if(!isXDREnabled){utils[_0xc3c6('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xc3c6('0xa')](_0xc3c6('0xb'));}else{var agents=require(_0xc3c6('0xc'));var calls=require(_0xc3c6('0xd'));var queues=require('./queues.controller');var recordings=require(_0xc3c6('0xe'));var members=require(_0xc3c6('0xf'));var dials=require(_0xc3c6('0x10'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xc3c6('0x11'),core[_0xc3c6('0x11')]);ami['on'](_0xc3c6('0x12'),core[_0xc3c6('0x12')]);ami['on'](_0xc3c6('0x13'),core[_0xc3c6('0x13')]);ami['on'](_0xc3c6('0x14'),core[_0xc3c6('0x14')]);ami['on'](_0xc3c6('0x15'),core[_0xc3c6('0x15')]);ami['on'](_0xc3c6('0x16'),core[_0xc3c6('0x16')]);ami['on'](_0xc3c6('0x17'),function(_0x25d2bd){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x1a'),_0x25d2bd[_0xc3c6('0x1b')]),_0x25d2bd);members[_0xc3c6('0x17')](_0x25d2bd);}catch(_0x2d4b3d){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x1a'),_0x25d2bd[_0xc3c6('0x1b')]),_0x2d4b3d);}});ami['on'](_0xc3c6('0x1c'),function(_0x470592){try{utils['debug'](util[_0xc3c6('0x19')](_0xc3c6('0x1d'),_0x470592[_0xc3c6('0x1e')]),_0x470592);agents[_0xc3c6('0x1c')](_0x470592);}catch(_0x3893c4){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x1d'),_0x470592[_0xc3c6('0x1e')]),_0x3893c4);}});ami['on'](_0xc3c6('0x1f'),function(_0x33c76a){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x20'),_0x33c76a[_0xc3c6('0x1e')]),_0x33c76a);agents[_0xc3c6('0x1f')](_0x33c76a);}catch(_0x4b9fae){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x20'),_0x33c76a['uniqueid']),_0x4b9fae);}});ami['on'](_0xc3c6('0x21'),function(_0x42438d){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x22'),_0x42438d[_0xc3c6('0x1e')]),_0x42438d);agents[_0xc3c6('0x21')](_0x42438d);queues['agentconnect'](_0x42438d);}catch(_0x104e80){utils[_0xc3c6('0x14')](util['format'](_0xc3c6('0x22'),_0x42438d[_0xc3c6('0x1e')]),_0x104e80);}});ami['on'](_0xc3c6('0x23'),function(_0xdad009){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x24'),_0xdad009[_0xc3c6('0x1e')]),_0xdad009);agents[_0xc3c6('0x23')](_0xdad009);queues['agentcomplete'](_0xdad009);members[_0xc3c6('0x23')](_0xdad009);}catch(_0x4571f4){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')]('[%s][index][agentcomplete]',_0xdad009[_0xc3c6('0x1e')]),_0x4571f4);}});ami['on'](_0xc3c6('0x25'),function(_0x223d34){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x26'),_0x223d34['uniqueid']),_0x223d34);agents[_0xc3c6('0x25')](_0x223d34);queues[_0xc3c6('0x25')](_0x223d34);}catch(_0x2220ca){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')]('[%s][index][queuecallerabandon]',_0x223d34[_0xc3c6('0x1e')]),_0x2220ca);}});ami['on'](_0xc3c6('0x27'),function(_0x418071){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x28'),_0x418071[_0xc3c6('0x1e')]),_0x418071);queues['queuecallerjoin'](_0x418071);recordings[_0xc3c6('0x27')](_0x418071);}catch(_0x4df203){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x28'),_0x418071[_0xc3c6('0x1e')]),_0x4df203);}});ami['on'](_0xc3c6('0x29'),function(_0x1b8e52){try{utils['debug'](util[_0xc3c6('0x19')](_0xc3c6('0x2a'),_0x1b8e52['uniqueid']),_0x1b8e52);queues[_0xc3c6('0x29')](_0x1b8e52);}catch(_0x976ed4){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x2a'),_0x1b8e52[_0xc3c6('0x1e')]),_0x976ed4);}});ami['on'](_0xc3c6('0x2b'),function(_0x497bbc){try{utils['debug'](util[_0xc3c6('0x19')](_0xc3c6('0x2c'),_0x497bbc[_0xc3c6('0x1e')]),_0x497bbc);queues[_0xc3c6('0x2b')](_0x497bbc);calls[_0xc3c6('0x2b')](_0x497bbc);}catch(_0x5cbbe3){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x2c'),_0x497bbc[_0xc3c6('0x1e')]),_0x5cbbe3);}});ami['on'](_0xc3c6('0x2d'),function(_0x68ff0c){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x2e'),_0x68ff0c['uniqueid']),_0x68ff0c);queues[_0xc3c6('0x2d')](_0x68ff0c);calls[_0xc3c6('0x2d')](_0x68ff0c);}catch(_0x34e901){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x2e'),_0x68ff0c[_0xc3c6('0x1e')]),_0x34e901);}});ami['on'](_0xc3c6('0x2f'),function(_0x59b2d9){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')]('[%s][index][newstate]',_0x59b2d9[_0xc3c6('0x1e')]),_0x59b2d9);calls['newstate'](_0x59b2d9);recordings[_0xc3c6('0x2f')](_0x59b2d9);}catch(_0x298a7a){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x30'),_0x59b2d9[_0xc3c6('0x1e')]),_0x298a7a);}});ami['on'](_0xc3c6('0x31'),function(_0x998388){try{utils['debug'](util[_0xc3c6('0x19')]('[%s][index][hangup]',_0x998388[_0xc3c6('0x1e')]),_0x998388);calls[_0xc3c6('0x31')](_0x998388);recordings[_0xc3c6('0x31')](_0x998388);dials[_0xc3c6('0x31')](_0x998388);agents['hangup'](_0x998388);queues['hangup'](_0x998388);}catch(_0x1e09a7){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x32'),_0x998388['uniqueid']),_0x1e09a7);}});ami['on'](_0xc3c6('0x33'),function(_0x2e5b33){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x34'),_0x2e5b33[_0xc3c6('0x1e')]),_0x2e5b33);members[_0xc3c6('0x33')](_0x2e5b33);}catch(_0x508668){utils['error'](util[_0xc3c6('0x19')](_0xc3c6('0x34'),_0x2e5b33['uniqueid']),_0x508668);}});ami['on'](_0xc3c6('0x35'),function(_0x3ba03a){try{utils['debug'](util[_0xc3c6('0x19')](_0xc3c6('0x36'),_0x3ba03a['uniqueid']),_0x3ba03a);queues[_0xc3c6('0x35')](_0x3ba03a);agents[_0xc3c6('0x35')](_0x3ba03a);transfers[_0xc3c6('0x35')](_0x3ba03a);recordings[_0xc3c6('0x35')](_0x3ba03a);}catch(_0x30d198){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x36'),_0x3ba03a[_0xc3c6('0x1e')]),_0x30d198);}});ami['on'](_0xc3c6('0x37'),function(_0x39b8f5){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x38'),_0x39b8f5['origtransfereruniqueid']),_0x39b8f5);queues['attendedtransfer'](_0x39b8f5);transfers[_0xc3c6('0x37')](_0x39b8f5);agents[_0xc3c6('0x37')](_0x39b8f5);calls[_0xc3c6('0x37')](_0x39b8f5);}catch(_0x2c85fe){utils['error'](util['format'](_0xc3c6('0x38'),_0x39b8f5[_0xc3c6('0x39')]),_0x2c85fe);}});ami['on'](_0xc3c6('0x3a'),function(_0x3eaf81){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x3b'),_0x3eaf81[_0xc3c6('0x1e')]),_0x3eaf81);queues[_0xc3c6('0x3a')](_0x3eaf81);recordings[_0xc3c6('0x3a')](_0x3eaf81);calls[_0xc3c6('0x3a')](_0x3eaf81);dials[_0xc3c6('0x3a')](_0x3eaf81);}catch(_0x3de93f){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x3b'),_0x3eaf81['uniqueid']),_0x3de93f);}});ami['on'](_0xc3c6('0x3c'),function(_0x412565){try{utils['debug'](util['format'](_0xc3c6('0x3d'),_0x412565[_0xc3c6('0x1e')]),_0x412565);calls[_0xc3c6('0x3c')](_0x412565);recordings[_0xc3c6('0x3c')](_0x412565);dials[_0xc3c6('0x3c')](_0x412565);}catch(_0x290be1){utils[_0xc3c6('0x14')](util['format']('[%s][index][newexten]',_0x412565[_0xc3c6('0x1e')]),_0x290be1);}});ami['on'](_0xc3c6('0x3e'),function(_0x38379e){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x3f'),_0x38379e[_0xc3c6('0x1e')]),_0x38379e);calls[_0xc3c6('0x3e')](_0x38379e);recordings[_0xc3c6('0x3e')](_0x38379e);}catch(_0x571c34){utils[_0xc3c6('0x14')](util['format']('[%s][index][newchannel]',_0x38379e[_0xc3c6('0x1e')]),_0x571c34);}});ami['on'](_0xc3c6('0x40'),function(_0x4433fd){try{utils[_0xc3c6('0x18')](util[_0xc3c6('0x19')](_0xc3c6('0x41'),_0x4433fd[_0xc3c6('0x1e')]),_0x4433fd);dials[_0xc3c6('0x40')](_0x4433fd);}catch(_0x2e367f){utils[_0xc3c6('0x14')](util['format'](_0xc3c6('0x42'),_0x4433fd['uniqueid']),_0x2e367f);}});ami['on'](_0xc3c6('0x43'),function(_0x5c8884){try{utils[_0xc3c6('0x18')](util['format'](_0xc3c6('0x44'),_0x5c8884['uniqueid']),_0x5c8884);dials['dialend'](_0x5c8884);}catch(_0x47a5a8){utils[_0xc3c6('0x14')](util[_0xc3c6('0x19')](_0xc3c6('0x44'),_0x5c8884[_0xc3c6('0x1e')]),_0x47a5a8);}});} \ No newline at end of file +var _0x356e=['[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','./utils','util','xdr','disabled','env','local','asterisk','port','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./dials.controller','connect','shutdown','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','error','format','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','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]','[%s][index][cdr]','cdr','blindtransfer'];(function(_0x3cf388,_0x2e237){var _0x1b13c4=function(_0x542eff){while(--_0x542eff){_0x3cf388['push'](_0x3cf388['shift']());}};_0x1b13c4(++_0x2e237);}(_0x356e,0x1dc));var _0xe356=function(_0x327040,_0x6f7206){_0x327040=_0x327040-0x0;var _0x201070=_0x356e[_0x327040];return _0x201070;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0xe356('0x0'));var util=require(_0xe356('0x1'));var isXDREnabled=config[_0xe356('0x2')]&&!config[_0xe356('0x2')][_0xe356('0x3')];var isProduction=config[_0xe356('0x4')]==='production'||![];var isLocalAsterisk=config[_0xe356('0x2')]&&config[_0xe356('0x2')][_0xe356('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xe356('0x6')][_0xe356('0x7')],config['asterisk']['ip'],config[_0xe356('0x6')][_0xe356('0x8')],config[_0xe356('0x6')][_0xe356('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xe356('0xa')](_0xe356('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xe356('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xe356('0xd'));var queues=require(_0xe356('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xe356('0xf'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xe356('0x10'),core['connect']);ami['on']('shutdown',core[_0xe356('0x11')]);ami['on']('fullybooted',core['fullybooted']);ami['on']('error',core['error']);ami['on'](_0xe356('0x12'),core[_0xe356('0x12')]);ami['on']('managerevent',core[_0xe356('0x13')]);ami['on'](_0xe356('0x14'),function(_0x1aa9b3){try{utils[_0xe356('0x15')](util['format'](_0xe356('0x16'),_0x1aa9b3[_0xe356('0x17')]),_0x1aa9b3);members[_0xe356('0x14')](_0x1aa9b3);}catch(_0x1a3b14){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x16'),_0x1aa9b3['device']),_0x1a3b14);}});ami['on']('agentcalled',function(_0x444880){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x1a'),_0x444880[_0xe356('0x1b')]),_0x444880);agents[_0xe356('0x1c')](_0x444880);}catch(_0x1635d6){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x1a'),_0x444880['uniqueid']),_0x1635d6);}});ami['on'](_0xe356('0x1d'),function(_0xa086a9){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x1e'),_0xa086a9[_0xe356('0x1b')]),_0xa086a9);agents[_0xe356('0x1d')](_0xa086a9);}catch(_0x476750){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x1e'),_0xa086a9['uniqueid']),_0x476750);}});ami['on'](_0xe356('0x1f'),function(_0x2d9f9a){try{utils['debug'](util[_0xe356('0x19')](_0xe356('0x20'),_0x2d9f9a[_0xe356('0x1b')]),_0x2d9f9a);agents['agentconnect'](_0x2d9f9a);queues['agentconnect'](_0x2d9f9a);}catch(_0x181a80){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x20'),_0x2d9f9a['uniqueid']),_0x181a80);}});ami['on'](_0xe356('0x21'),function(_0x5ab65f){try{utils['debug'](util[_0xe356('0x19')]('[%s][index][agentcomplete]',_0x5ab65f['uniqueid']),_0x5ab65f);agents['agentcomplete'](_0x5ab65f);queues[_0xe356('0x21')](_0x5ab65f);members['agentcomplete'](_0x5ab65f);}catch(_0x19ca1c){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x22'),_0x5ab65f[_0xe356('0x1b')]),_0x19ca1c);}});ami['on']('queuecallerabandon',function(_0x1cfb49){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x23'),_0x1cfb49[_0xe356('0x1b')]),_0x1cfb49);agents[_0xe356('0x24')](_0x1cfb49);queues['queuecallerabandon'](_0x1cfb49);}catch(_0x48fc73){utils[_0xe356('0x18')](util[_0xe356('0x19')]('[%s][index][queuecallerabandon]',_0x1cfb49[_0xe356('0x1b')]),_0x48fc73);}});ami['on'](_0xe356('0x25'),function(_0x712ae3){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x26'),_0x712ae3['uniqueid']),_0x712ae3);queues[_0xe356('0x25')](_0x712ae3);recordings['queuecallerjoin'](_0x712ae3);}catch(_0x376686){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x26'),_0x712ae3[_0xe356('0x1b')]),_0x376686);}});ami['on'](_0xe356('0x27'),function(_0x47f42d){try{utils[_0xe356('0x15')](util['format'](_0xe356('0x28'),_0x47f42d['uniqueid']),_0x47f42d);queues['queuecallerleave'](_0x47f42d);}catch(_0x293a00){utils[_0xe356('0x18')](util['format'](_0xe356('0x28'),_0x47f42d[_0xe356('0x1b')]),_0x293a00);}});ami['on'](_0xe356('0x29'),function(_0xc19138){try{utils['debug'](util[_0xe356('0x19')](_0xe356('0x2a'),_0xc19138[_0xe356('0x1b')]),_0xc19138);queues['musiconholdstart'](_0xc19138);calls[_0xe356('0x29')](_0xc19138);}catch(_0x5b631c){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x2a'),_0xc19138['uniqueid']),_0x5b631c);}});ami['on'](_0xe356('0x2b'),function(_0x5da513){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x2c'),_0x5da513['uniqueid']),_0x5da513);queues[_0xe356('0x2b')](_0x5da513);calls[_0xe356('0x2b')](_0x5da513);}catch(_0x4e64ed){utils['error'](util[_0xe356('0x19')](_0xe356('0x2c'),_0x5da513[_0xe356('0x1b')]),_0x4e64ed);}});ami['on'](_0xe356('0x2d'),function(_0xa9dfc){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x2e'),_0xa9dfc[_0xe356('0x1b')]),_0xa9dfc);calls[_0xe356('0x2d')](_0xa9dfc);recordings[_0xe356('0x2d')](_0xa9dfc);}catch(_0x4ef593){utils[_0xe356('0x18')](util['format'](_0xe356('0x2e'),_0xa9dfc['uniqueid']),_0x4ef593);}});ami['on'](_0xe356('0x2f'),function(_0x392376){try{utils[_0xe356('0x15')](util[_0xe356('0x19')]('[%s][index][hangup]',_0x392376[_0xe356('0x1b')]),_0x392376);calls['hangup'](_0x392376);recordings[_0xe356('0x2f')](_0x392376);dials[_0xe356('0x2f')](_0x392376);agents[_0xe356('0x2f')](_0x392376);queues[_0xe356('0x2f')](_0x392376);}catch(_0x2bb62b){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x30'),_0x392376[_0xe356('0x1b')]),_0x2bb62b);}});ami['on']('cdr',function(_0x31054e){try{utils['debug'](util[_0xe356('0x19')](_0xe356('0x31'),_0x31054e['uniqueid']),_0x31054e);members[_0xe356('0x32')](_0x31054e);}catch(_0x3bac91){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x31'),_0x31054e[_0xe356('0x1b')]),_0x3bac91);}});ami['on'](_0xe356('0x33'),function(_0x1d6ecd){try{utils['debug'](util['format'](_0xe356('0x34'),_0x1d6ecd['uniqueid']),_0x1d6ecd);queues[_0xe356('0x33')](_0x1d6ecd);agents[_0xe356('0x33')](_0x1d6ecd);transfers[_0xe356('0x33')](_0x1d6ecd);recordings[_0xe356('0x33')](_0x1d6ecd);}catch(_0x77fee4){utils['error'](util['format'](_0xe356('0x34'),_0x1d6ecd[_0xe356('0x1b')]),_0x77fee4);}});ami['on']('attendedtransfer',function(_0x203001){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x35'),_0x203001[_0xe356('0x36')]),_0x203001);queues['attendedtransfer'](_0x203001);transfers[_0xe356('0x37')](_0x203001);agents[_0xe356('0x37')](_0x203001);calls[_0xe356('0x37')](_0x203001);}catch(_0x5bc2f9){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x35'),_0x203001[_0xe356('0x36')]),_0x5bc2f9);}});ami['on']('varset',function(_0x2a2a12){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x38'),_0x2a2a12[_0xe356('0x1b')]),_0x2a2a12);queues[_0xe356('0x39')](_0x2a2a12);recordings['varset'](_0x2a2a12);calls['varset'](_0x2a2a12);dials[_0xe356('0x39')](_0x2a2a12);}catch(_0x39963e){utils[_0xe356('0x18')](util[_0xe356('0x19')]('[%s][index][varset]',_0x2a2a12[_0xe356('0x1b')]),_0x39963e);}});ami['on'](_0xe356('0x3a'),function(_0x147721){try{utils['debug'](util['format'](_0xe356('0x3b'),_0x147721[_0xe356('0x1b')]),_0x147721);calls[_0xe356('0x3a')](_0x147721);recordings['newexten'](_0x147721);dials[_0xe356('0x3a')](_0x147721);}catch(_0x4e134d){utils['error'](util[_0xe356('0x19')](_0xe356('0x3b'),_0x147721[_0xe356('0x1b')]),_0x4e134d);}});ami['on'](_0xe356('0x3c'),function(_0x4f6f50){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x3d'),_0x4f6f50[_0xe356('0x1b')]),_0x4f6f50);calls[_0xe356('0x3c')](_0x4f6f50);recordings['newchannel'](_0x4f6f50);}catch(_0x587ef4){utils[_0xe356('0x18')](util[_0xe356('0x19')](_0xe356('0x3d'),_0x4f6f50[_0xe356('0x1b')]),_0x587ef4);}});ami['on'](_0xe356('0x3e'),function(_0x5c30a1){try{utils[_0xe356('0x15')](util['format'](_0xe356('0x3f'),_0x5c30a1['uniqueid']),_0x5c30a1);dials[_0xe356('0x3e')](_0x5c30a1);}catch(_0x2824cd){utils[_0xe356('0x18')](util[_0xe356('0x19')]('[%s]dialbegin',_0x5c30a1[_0xe356('0x1b')]),_0x2824cd);}});ami['on']('dialend',function(_0x185da9){try{utils[_0xe356('0x15')](util[_0xe356('0x19')](_0xe356('0x40'),_0x185da9['uniqueid']),_0x185da9);dials[_0xe356('0x41')](_0x185da9);}catch(_0x1b1120){utils['error'](util[_0xe356('0x19')](_0xe356('0x40'),_0x185da9['uniqueid']),_0x1b1120);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5e028fe..2fe2521 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 _0x9e40=['now','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','type','data2','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','then','membername','name','internal','request','getUserByName','split','error','uniqueid','some','devicestatechange','debug','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','isNil','exitAt'];(function(_0x7376c8,_0x20cf61){var _0x4c879a=function(_0x3f787f){while(--_0x3f787f){_0x7376c8['push'](_0x7376c8['shift']());}};_0x4c879a(++_0x20cf61);}(_0x9e40,0x10d));var _0x09e4=function(_0x60e52a,_0x2c5522){_0x60e52a=_0x60e52a-0x0;var _0x7d8536=_0x9e40[_0x60e52a];return _0x7d8536;};'use strict';var _=require(_0x09e4('0x0'));var util=require('util');var utils=require(_0x09e4('0x1'));var members={};var exclude=[_0x09e4('0x2'),_0x09e4('0x3')];function writeDB(_0x376080){utils[_0x09e4('0x4')](util['format'](_0x09e4('0x5'),_0x376080['uniqueid'],_0x376080[_0x09e4('0x6')],_0x376080[_0x09e4('0x7')],_0x376080['data2'],_0x376080['membername'],_0x376080['type']));if(_0x376080[_0x09e4('0x6')]){utils['getUserByInterface'](_0x376080['interface'])[_0x09e4('0x8')](function(_0x25dd26){if(_0x25dd26){_0x376080[_0x09e4('0x9')]=_0x25dd26[_0x09e4('0xa')];_0x376080[_0x09e4('0xb')]=_0x25dd26[_0x09e4('0xb')];utils[_0x09e4('0xc')]('CreateMemberReport',_0x376080);}else{utils[_0x09e4('0xd')](_0x376080[_0x09e4('0x6')][_0x09e4('0xe')]('/')[0x1])[_0x09e4('0x8')](function(_0x56b743){if(_0x56b743){_0x376080[_0x09e4('0x9')]=_0x56b743[_0x09e4('0xa')];_0x376080[_0x09e4('0xb')]=_0x56b743[_0x09e4('0xb')];utils[_0x09e4('0xc')]('CreateMemberReport',_0x376080);}});}})['catch'](function(_0x33108b){utils[_0x09e4('0xf')](util['format']('[%s][members][writeDB]',_0x376080[_0x09e4('0x10')]),_0x33108b);});}delete members[_0x376080[_0x09e4('0x6')]];}function startsWith(_0x280cc5,_0x3fad88){return _[_0x09e4('0x11')](_0x280cc5,function(_0x721db6){return _['startsWith'](_0x3fad88,_0x721db6);});}exports[_0x09e4('0x12')]=function(_0x5099f5){try{utils[_0x09e4('0x13')](util[_0x09e4('0x14')](_0x09e4('0x15'),members[_0x5099f5['device']]?members[_0x5099f5['device']]['uniqueid']:_0x5099f5[_0x09e4('0x16')]),_0x5099f5);utils[_0x09e4('0x4')](util['format'](_0x09e4('0x17'),members[_0x5099f5[_0x09e4('0x16')]]?members[_0x5099f5['device']][_0x09e4('0x10')]:_0x5099f5[_0x09e4('0x16')],_0x5099f5[_0x09e4('0x18')],_0x5099f5[_0x09e4('0x16')]));switch(_0x5099f5[_0x09e4('0x18')]){case _0x09e4('0x19'):case _0x09e4('0x1a'):if(!startsWith(exclude,_0x5099f5[_0x09e4('0x16')])){members[_0x5099f5[_0x09e4('0x16')]]={'channel':_0x09e4('0x1b'),'interface':_0x5099f5[_0x09e4('0x16')],'type':_0x09e4('0x1c'),'enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x09e4('0x1d')](members[_0x5099f5[_0x09e4('0x16')]])){members[_0x5099f5[_0x09e4('0x16')]][_0x09e4('0x1e')]=utils[_0x09e4('0x1f')]();members[_0x5099f5[_0x09e4('0x16')]][_0x09e4('0x20')]=utils[_0x09e4('0x21')](members[_0x5099f5[_0x09e4('0x16')]]['exitAt'],members[_0x5099f5['device']][_0x09e4('0x22')]);if(members[_0x5099f5[_0x09e4('0x16')]]['uniqueid']){writeDB(members[_0x5099f5[_0x09e4('0x16')]]);}}break;default:break;}}catch(_0x486de9){utils['error'](util[_0x09e4('0x14')](_0x09e4('0x15'),members[_0x5099f5[_0x09e4('0x16')]]?members[_0x5099f5[_0x09e4('0x16')]][_0x09e4('0x10')]:_0x5099f5[_0x09e4('0x16')]),_0x486de9);}};exports[_0x09e4('0x23')]=function(_0x4657ea){try{if(!_[_0x09e4('0x1d')](members[_0x4657ea[_0x09e4('0x6')]])){utils[_0x09e4('0x13')](util[_0x09e4('0x14')](_0x09e4('0x24'),_0x4657ea[_0x09e4('0x10')]),_0x4657ea);utils[_0x09e4('0x4')](util['format'](_0x09e4('0x25'),_0x4657ea[_0x09e4('0x10')],_0x4657ea[_0x09e4('0x6')],_0x4657ea['queue']));members[_0x4657ea['interface']]=_[_0x09e4('0x26')](members[_0x4657ea[_0x09e4('0x6')]],{'data4':_0x4657ea[_0x09e4('0x27')],'uniqueid':_0x4657ea[_0x09e4('0x10')]});}}catch(_0x35af94){utils[_0x09e4('0xf')](util[_0x09e4('0x14')](_0x09e4('0x24'),_0x4657ea['uniqueid']),_0x35af94);}};exports[_0x09e4('0x28')]=function(_0xa862ee){try{utils[_0x09e4('0x13')](util[_0x09e4('0x14')](_0x09e4('0x29'),_0xa862ee[_0x09e4('0x10')]),_0xa862ee);if(_0xa862ee[_0x09e4('0x7')]){var _0x359537=_0xa862ee[_0x09e4('0x7')]['split']('-')[0x0];if(!_[_0x09e4('0x1d')](members[_0x359537])){members[_0x359537]=_[_0x09e4('0x26')](members[_0x359537],{'data1':members[_0x359537]['data1']||_0xa862ee[_0x09e4('0x2a')],'data2':members[_0x359537][_0x09e4('0x2b')]||_0xa862ee[_0x09e4('0x2c')],'data3':members[_0x359537][_0x09e4('0x2d')]||_0xa862ee[_0x09e4('0x2e')],'uniqueid':members[_0x359537][_0x09e4('0x10')]||_0xa862ee[_0x09e4('0x10')]});utils[_0x09e4('0x4')](util[_0x09e4('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xa862ee[_0x09e4('0x10')],members[_0x359537][_0x09e4('0x2f')],members[_0x359537]['data2'],members[_0x359537]['data3']));if(members[_0x359537]['exitAt']){writeDB(members[_0x359537]);}}}if(_0xa862ee[_0x09e4('0x30')]){var _0x4fe273=_0xa862ee[_0x09e4('0x30')][_0x09e4('0xe')]('-')[0x0];if(!_[_0x09e4('0x1d')](members[_0x4fe273])){members[_0x4fe273]=_[_0x09e4('0x26')](members[_0x4fe273],{'data1':members[_0x4fe273][_0x09e4('0x2f')]||_0xa862ee[_0x09e4('0x2a')],'data2':members[_0x4fe273][_0x09e4('0x2b')]||_0xa862ee['source'],'data3':members[_0x4fe273][_0x09e4('0x2d')]||_0xa862ee[_0x09e4('0x2e')],'uniqueid':members[_0x4fe273][_0x09e4('0x10')]||_0xa862ee[_0x09e4('0x10')]});utils[_0x09e4('0x4')](util['format'](_0x09e4('0x31'),_0xa862ee[_0x09e4('0x10')],members[_0x4fe273]['data1'],members[_0x4fe273]['data2'],members[_0x4fe273]['data3']));if(members[_0x4fe273][_0x09e4('0x1e')]){writeDB(members[_0x4fe273]);}}}}catch(_0x473c12){utils[_0x09e4('0xf')](util[_0x09e4('0x14')](_0x09e4('0x29'),_0xa862ee[_0x09e4('0x10')]),_0x473c12);}}; \ No newline at end of file +var _0x4431=['[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','split','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','[%s][members][cdr]','data1','data2','source','destination'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4431,0x1b4));var _0x1443=function(_0x444423,_0x2ea269){_0x444423=_0x444423-0x0;var _0x19da68=_0x4431[_0x444423];return _0x19da68;};'use strict';var _=require(_0x1443('0x0'));var util=require('util');var utils=require(_0x1443('0x1'));var members={};var exclude=[_0x1443('0x2'),_0x1443('0x3')];function writeDB(_0x3cc613){utils[_0x1443('0x4')](util[_0x1443('0x5')](_0x1443('0x6'),_0x3cc613[_0x1443('0x7')],_0x3cc613[_0x1443('0x8')],_0x3cc613[_0x1443('0x9')],_0x3cc613['data2'],_0x3cc613[_0x1443('0xa')],_0x3cc613[_0x1443('0xb')]));if(_0x3cc613[_0x1443('0x8')]){utils[_0x1443('0xc')](_0x3cc613[_0x1443('0x8')])[_0x1443('0xd')](function(_0x33c504){if(_0x33c504){_0x3cc613[_0x1443('0xa')]=_0x33c504[_0x1443('0xe')];_0x3cc613['internal']=_0x33c504[_0x1443('0xf')];utils[_0x1443('0x10')]('CreateMemberReport',_0x3cc613);}else{utils[_0x1443('0x11')](_0x3cc613[_0x1443('0x8')]['split']('/')[0x1])['then'](function(_0x3202e3){if(_0x3202e3){_0x3cc613['membername']=_0x3202e3[_0x1443('0xe')];_0x3cc613[_0x1443('0xf')]=_0x3202e3[_0x1443('0xf')];utils[_0x1443('0x10')](_0x1443('0x12'),_0x3cc613);}});}})[_0x1443('0x13')](function(_0x44e803){utils[_0x1443('0x14')](util[_0x1443('0x5')](_0x1443('0x15'),_0x3cc613['uniqueid']),_0x44e803);});}delete members[_0x3cc613[_0x1443('0x8')]];}function startsWith(_0x8e871e,_0xad567b){return _[_0x1443('0x16')](_0x8e871e,function(_0x356cd6){return _[_0x1443('0x17')](_0xad567b,_0x356cd6);});}exports[_0x1443('0x18')]=function(_0x3ac588){try{utils[_0x1443('0x19')](util[_0x1443('0x5')](_0x1443('0x1a'),members[_0x3ac588[_0x1443('0x1b')]]?members[_0x3ac588['device']][_0x1443('0x7')]:_0x3ac588[_0x1443('0x1b')]),_0x3ac588);utils['info'](util[_0x1443('0x5')](_0x1443('0x1c'),members[_0x3ac588[_0x1443('0x1b')]]?members[_0x3ac588[_0x1443('0x1b')]][_0x1443('0x7')]:_0x3ac588[_0x1443('0x1b')],_0x3ac588[_0x1443('0x1d')],_0x3ac588[_0x1443('0x1b')]));switch(_0x3ac588[_0x1443('0x1d')]){case'INUSE':case _0x1443('0x1e'):if(!startsWith(exclude,_0x3ac588[_0x1443('0x1b')])){members[_0x3ac588[_0x1443('0x1b')]]={'channel':_0x1443('0x1f'),'interface':_0x3ac588[_0x1443('0x1b')],'type':'TALKING','enterAt':utils[_0x1443('0x20')](),'role':_0x1443('0x21')};}break;case _0x1443('0x22'):if(!_[_0x1443('0x23')](members[_0x3ac588[_0x1443('0x1b')]])){members[_0x3ac588[_0x1443('0x1b')]][_0x1443('0x24')]=utils['now']();members[_0x3ac588[_0x1443('0x1b')]][_0x1443('0x25')]=utils[_0x1443('0x26')](members[_0x3ac588[_0x1443('0x1b')]]['exitAt'],members[_0x3ac588['device']][_0x1443('0x27')]);if(members[_0x3ac588[_0x1443('0x1b')]][_0x1443('0x7')]){writeDB(members[_0x3ac588['device']]);}}break;default:break;}}catch(_0xbdfd96){utils['error'](util['format'](_0x1443('0x1a'),members[_0x3ac588['device']]?members[_0x3ac588[_0x1443('0x1b')]][_0x1443('0x7')]:_0x3ac588[_0x1443('0x1b')]),_0xbdfd96);}};exports[_0x1443('0x28')]=function(_0x45f8ff){try{if(!_[_0x1443('0x23')](members[_0x45f8ff[_0x1443('0x8')]])){utils[_0x1443('0x19')](util[_0x1443('0x5')]('[%s][members][agentcomplete]',_0x45f8ff['uniqueid']),_0x45f8ff);utils[_0x1443('0x4')](util['format'](_0x1443('0x29'),_0x45f8ff['uniqueid'],_0x45f8ff[_0x1443('0x8')],_0x45f8ff[_0x1443('0x2a')]));members[_0x45f8ff[_0x1443('0x8')]]=_[_0x1443('0x2b')](members[_0x45f8ff[_0x1443('0x8')]],{'data4':_0x45f8ff[_0x1443('0x2a')],'uniqueid':_0x45f8ff[_0x1443('0x7')]});}}catch(_0x8c2b2a){utils[_0x1443('0x14')](util[_0x1443('0x5')](_0x1443('0x2c'),_0x45f8ff['uniqueid']),_0x8c2b2a);}};exports['cdr']=function(_0x2ea1a0){try{utils['debug'](util[_0x1443('0x5')](_0x1443('0x2d'),_0x2ea1a0['uniqueid']),_0x2ea1a0);if(_0x2ea1a0['channel']){var _0x33e7ba=_0x2ea1a0[_0x1443('0x9')]['split']('-')[0x0];if(!_['isNil'](members[_0x33e7ba])){members[_0x33e7ba]=_[_0x1443('0x2b')](members[_0x33e7ba],{'data1':members[_0x33e7ba][_0x1443('0x2e')]||_0x2ea1a0[_0x1443('0xb')],'data2':members[_0x33e7ba][_0x1443('0x2f')]||_0x2ea1a0[_0x1443('0x30')],'data3':members[_0x33e7ba]['data3']||_0x2ea1a0[_0x1443('0x31')],'uniqueid':members[_0x33e7ba][_0x1443('0x7')]||_0x2ea1a0[_0x1443('0x7')]});utils[_0x1443('0x4')](util[_0x1443('0x5')](_0x1443('0x32'),_0x2ea1a0[_0x1443('0x7')],members[_0x33e7ba][_0x1443('0x2e')],members[_0x33e7ba][_0x1443('0x2f')],members[_0x33e7ba][_0x1443('0x33')]));if(members[_0x33e7ba][_0x1443('0x24')]){writeDB(members[_0x33e7ba]);}}}if(_0x2ea1a0[_0x1443('0x34')]){var _0x315e30=_0x2ea1a0[_0x1443('0x34')][_0x1443('0x35')]('-')[0x0];if(!_['isNil'](members[_0x315e30])){members[_0x315e30]=_[_0x1443('0x2b')](members[_0x315e30],{'data1':members[_0x315e30][_0x1443('0x2e')]||_0x2ea1a0['type'],'data2':members[_0x315e30]['data2']||_0x2ea1a0[_0x1443('0x30')],'data3':members[_0x315e30][_0x1443('0x33')]||_0x2ea1a0[_0x1443('0x31')],'uniqueid':members[_0x315e30]['uniqueid']||_0x2ea1a0['uniqueid']});utils[_0x1443('0x4')](util[_0x1443('0x5')](_0x1443('0x32'),_0x2ea1a0['uniqueid'],members[_0x315e30]['data1'],members[_0x315e30][_0x1443('0x2f')],members[_0x315e30][_0x1443('0x33')]));if(members[_0x315e30][_0x1443('0x24')]){writeDB(members[_0x315e30]);}}}}catch(_0xd49c06){utils[_0x1443('0x14')](util[_0x1443('0x5')](_0x1443('0x2d'),_0x2ea1a0['uniqueid']),_0xd49c06);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4c4feaf..40ece8e 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 _0x236b=['calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','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]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfer','transfertype','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','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]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','queue'];(function(_0x562148,_0x28c75f){var _0x3fc4b3=function(_0x206987){while(--_0x206987){_0x562148['push'](_0x562148['shift']());}};_0x3fc4b3(++_0x28c75f);}(_0x236b,0xd1));var _0xb236=function(_0x33baba,_0x1d05f5){_0x33baba=_0x33baba-0x0;var _0x291b65=_0x236b[_0x33baba];return _0x291b65;};'use strict';var _=require(_0xb236('0x0'));var util=require('util');var utils=require(_0xb236('0x1'));var queues={};function writeDB(_0x3342be){utils[_0xb236('0x2')](util[_0xb236('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3342be['uniqueid'],_0x3342be['channel'],_0x3342be[_0xb236('0x4')],_0x3342be['lastAssignedTo'],_0x3342be[_0xb236('0x5')],_0x3342be[_0xb236('0x6')],_0x3342be[_0xb236('0x7')]));if(_0x3342be[_0xb236('0x4')]){utils['getVoiceQueueByName'](_0x3342be[_0xb236('0x4')])[_0xb236('0x8')](function(_0x1059e2){if(_0x1059e2){_0x3342be[_0xb236('0x9')]=_0x1059e2[_0xb236('0x9')];}utils[_0xb236('0xa')]('CreateVoiceQueueReport',_0x3342be);});}else{utils['request'](_0xb236('0xb'),_0x3342be);}if(_0x3342be[_0xb236('0xc')]){delete queues[_0x3342be[_0xb236('0xc')]];}else{delete queues[_0x3342be[_0xb236('0xd')]];}}exports[_0xb236('0xe')]=function(_0x25821e){try{utils['debug'](util[_0xb236('0x3')](_0xb236('0xf'),_0x25821e[_0xb236('0xd')]),_0x25821e);utils[_0xb236('0x2')](util[_0xb236('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x25821e['uniqueid'],_0x25821e[_0xb236('0x4')],_0x25821e[_0xb236('0x10')]));queues[_0x25821e[_0xb236('0xd')]]=_[_0xb236('0x11')](_0x25821e,{'originalposition':_0x25821e[_0xb236('0x10')],'queuecallerjoinAt':utils[_0xb236('0x12')](),'mohtime':0x0});}catch(_0x3a18e7){utils[_0xb236('0x13')](util[_0xb236('0x3')](_0xb236('0xf'),_0x25821e[_0xb236('0xd')]),_0x3a18e7);}};exports[_0xb236('0x14')]=function(_0x571860){try{if(!_[_0xb236('0x15')](queues[_0x571860[_0xb236('0xd')]])){utils['debug'](util[_0xb236('0x3')](_0xb236('0x16'),_0x571860[_0xb236('0xd')]),_0x571860);if(queues[_0x571860['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x571860[_0xb236('0xd')]][_0xb236('0x17')]&&!queues[_0x571860[_0xb236('0xd')]][_0xb236('0x18')]){queues[_0x571860['uniqueid']]['queuecallercomplete']=!![];queues[_0x571860[_0xb236('0xd')]][_0xb236('0x19')]=utils['now']();queues[_0x571860[_0xb236('0xd')]]['queuecallerexitreason']=_0xb236('0x1a');}utils[_0xb236('0x2')](util['format'](_0xb236('0x1b'),_0x571860['uniqueid'],queues[_0x571860[_0xb236('0xd')]][_0xb236('0x1c')],queues[_0x571860[_0xb236('0xd')]]['queuecallerexitreason']));writeDB(queues[_0x571860[_0xb236('0xd')]]);}else if(queues[_0x571860[_0xb236('0xd')]][_0xb236('0xc')]){utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x1d'),_0x571860[_0xb236('0xd')],queues[_0x571860[_0xb236('0xd')]][_0xb236('0x1c')],queues[_0x571860[_0xb236('0xd')]][_0xb236('0xc')]));queues[queues[_0x571860[_0xb236('0xd')]][_0xb236('0xc')]]=queues[_0x571860['uniqueid']];queues[queues[_0x571860[_0xb236('0xd')]][_0xb236('0xc')]][_0xb236('0x1e')]=0x2;delete queues[_0x571860[_0xb236('0xd')]];}}}catch(_0x31acb7){utils[_0xb236('0x13')](util['format'](_0xb236('0x16'),_0x571860['uniqueid']),_0x31acb7);}};exports[_0xb236('0x1f')]=function(_0x15fadb){try{utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x21'),_0x15fadb[_0xb236('0xd')]),_0x15fadb);if(!_[_0xb236('0x15')](_0x15fadb[_0xb236('0x22')][_0xb236('0x23')])&&_0x15fadb[_0xb236('0x24')][_0xb236('0x25')]()!==_0xb236('0x26')){if(!_[_0xb236('0x15')](queues[_0x15fadb[_0xb236('0xd')]])){queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x17')]=![];queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x27')]=null;queues[_0x15fadb[_0xb236('0xd')]]['queuecallerexit']=!![];queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x28')]=utils['now']();queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x7')]=_0x15fadb[_0xb236('0x24')][_0xb236('0x25')]();utils['info'](util[_0xb236('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x15fadb[_0xb236('0xd')],queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x1c')],_0x15fadb[_0xb236('0x24')],queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x7')]));writeDB(queues[_0x15fadb[_0xb236('0xd')]]);}}else if(!_[_0xb236('0x15')](_0x15fadb[_0xb236('0x22')][_0xb236('0x29')])){if(!_[_0xb236('0x15')](queues[_0x15fadb[_0xb236('0xd')]])&&!queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x17')]){queues[_0x15fadb[_0xb236('0xd')]]['queuecallerabandon']=![];queues[_0x15fadb[_0xb236('0xd')]]['queuecallerabandonAt']=null;queues[_0x15fadb[_0xb236('0xd')]]['queuecallerexit']=!![];queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x28')]=utils['now']();queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x7')]=_0xb236('0x2a');utils['info'](util['format'](_0xb236('0x2b'),_0x15fadb[_0xb236('0xd')],queues[_0x15fadb['uniqueid']][_0xb236('0x1c')],_0x15fadb[_0xb236('0x24')],queues[_0x15fadb[_0xb236('0xd')]][_0xb236('0x7')]));}}}catch(_0x10d191){utils['error'](util[_0xb236('0x3')](_0xb236('0x21'),_0x15fadb[_0xb236('0xd')]),_0x10d191);}};exports[_0xb236('0x17')]=function(_0x22ace4){try{if(!_[_0xb236('0x15')](queues[_0x22ace4[_0xb236('0xd')]])){utils['debug'](util[_0xb236('0x3')](_0xb236('0x2c'),_0x22ace4['uniqueid']),_0x22ace4);queues[_0x22ace4[_0xb236('0xd')]][_0xb236('0x18')]=![];queues[_0x22ace4['uniqueid']][_0xb236('0x28')]=null;queues[_0x22ace4[_0xb236('0xd')]][_0xb236('0x17')]=!![];queues[_0x22ace4[_0xb236('0xd')]][_0xb236('0x27')]=utils[_0xb236('0x12')]();queues[_0x22ace4[_0xb236('0xd')]][_0xb236('0x7')]='ABANDONED';utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x2d'),_0x22ace4[_0xb236('0xd')],queues[_0x22ace4['uniqueid']]['name'],queues[_0x22ace4[_0xb236('0xd')]][_0xb236('0x7')]));}}catch(_0xd0efd2){utils[_0xb236('0x13')](util['format'](_0xb236('0x2c'),_0x22ace4[_0xb236('0xd')]),_0xd0efd2);}};exports[_0xb236('0x2e')]=function(_0x5b450e){try{if(!_[_0xb236('0x15')](queues[_0x5b450e['uniqueid']])){utils[_0xb236('0x20')](util['format'](_0xb236('0x2f'),_0x5b450e[_0xb236('0xd')]),_0x5b450e);utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x30'),_0x5b450e[_0xb236('0xd')],queues[_0x5b450e[_0xb236('0xd')]][_0xb236('0x1c')],_0x5b450e['connectedlinenum'],_0x5b450e[_0xb236('0x31')]));queues[_0x5b450e[_0xb236('0xd')]][_0xb236('0x2e')]=!![];queues[_0x5b450e[_0xb236('0xd')]][_0xb236('0x32')]=utils[_0xb236('0x12')]();queues[_0x5b450e['uniqueid']][_0xb236('0x33')]=utils[_0xb236('0x34')](queues[_0x5b450e['uniqueid']][_0xb236('0x32')],queues[_0x5b450e['uniqueid']][_0xb236('0x35')]);queues[_0x5b450e['uniqueid']][_0xb236('0x10')]=_0x5b450e[_0xb236('0x10')];queues[_0x5b450e['uniqueid']][_0xb236('0x36')]=_0x5b450e[_0xb236('0x36')];queues[_0x5b450e['uniqueid']][_0xb236('0x37')]=_0x5b450e[_0xb236('0x37')];queues[_0x5b450e[_0xb236('0xd')]][_0xb236('0x31')]=_0x5b450e[_0xb236('0x31')];}}catch(_0x462786){utils['error'](util[_0xb236('0x3')](_0xb236('0x2f'),_0x5b450e[_0xb236('0xd')]),_0x462786);}};exports[_0xb236('0x38')]=function(_0x53adcd){try{if(!_['isNil'](queues[_0x53adcd[_0xb236('0xd')]])){utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x39'),_0x53adcd[_0xb236('0xd')]),_0x53adcd);utils[_0xb236('0x2')](util['format'](_0xb236('0x3a'),_0x53adcd[_0xb236('0xd')],queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x1c')],_0x53adcd['membername'],_0x53adcd['destaccountcode']));queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x17')]=![];queues[_0x53adcd[_0xb236('0xd')]]['queuecallerabandon']=![];queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x27')]=null;queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x18')]=![];queues[_0x53adcd[_0xb236('0xd')]]['queuecallerexitreason']=null;queues[_0x53adcd[_0xb236('0xd')]]['queuecallerexitAt']=null;queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x3b')]=!![];queues[_0x53adcd[_0xb236('0xd')]][_0xb236('0x6')]=_0x53adcd[_0xb236('0x3c')];queues[_0x53adcd[_0xb236('0xd')]]['lastAssignedTo']=_0x53adcd[_0xb236('0x3d')];}}catch(_0x20f1ed){utils[_0xb236('0x13')](util[_0xb236('0x3')](_0xb236('0x39'),_0x53adcd[_0xb236('0xd')]),_0x20f1ed);}};exports[_0xb236('0x3e')]=function(_0x2695f1){try{if(!_[_0xb236('0x15')](queues[_0x2695f1[_0xb236('0xd')]])){if(queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x32')]){utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x3f'),_0x2695f1[_0xb236('0xd')]),_0x2695f1);queues[_0x2695f1['uniqueid']][_0xb236('0x17')]=![];queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x17')]=![];queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x27')]=null;queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x18')]=![];queues[_0x2695f1[_0xb236('0xd')]]['queuecallerexitAt']=null;queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x3b')]=!![];queues[_0x2695f1[_0xb236('0xd')]]['lastAssignedTo']=_0x2695f1[_0xb236('0x3d')];queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x40')]=!![];queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x19')]=utils[_0xb236('0x12')]();if(_0x2695f1['reason']=='transfer'){if(!queues[_0x2695f1['uniqueid']]['transfer']){queues[_0x2695f1['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x7')]=_0xb236('0x41')+_0x2695f1[_0xb236('0x42')][_0xb236('0x25')]();}utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x43'),_0x2695f1['uniqueid'],queues[_0x2695f1['uniqueid']][_0xb236('0x1c')],_0x2695f1['membername'],queues[_0x2695f1[_0xb236('0xd')]][_0xb236('0x7')]));writeDB(queues[_0x2695f1[_0xb236('0xd')]]);}}}catch(_0x33d900){utils[_0xb236('0x13')](util['format'](_0xb236('0x3f'),_0x2695f1[_0xb236('0xd')]),_0x33d900);}};exports[_0xb236('0x44')]=function(_0x1d3eac){try{if(!_['isNil'](queues[_0x1d3eac['transfereeuniqueid']])){utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x45'),_0x1d3eac['uniqueid']),_0x1d3eac);queues[_0x1d3eac[_0xb236('0x46')]]['transfer']=!![];queues[_0x1d3eac[_0xb236('0x46')]]['transfertype']=_0xb236('0x47');queues[_0x1d3eac['transfereeuniqueid']]['transferexten']=_0x1d3eac[_0xb236('0x48')];queues[_0x1d3eac[_0xb236('0x46')]][_0xb236('0x49')]=_0x1d3eac[_0xb236('0x46')];queues[_0x1d3eac['transfereeuniqueid']]['queuecallerexitreason']=_0xb236('0x4a');utils[_0xb236('0x2')](util['format'](_0xb236('0x4b'),_0x1d3eac['uniqueid'],queues[_0x1d3eac[_0xb236('0x46')]][_0xb236('0x1c')],_0x1d3eac['transfereeuniqueid'],_0x1d3eac[_0xb236('0x48')]));}}catch(_0x410bc0){utils[_0xb236('0x13')](util[_0xb236('0x3')](_0xb236('0x45'),_0x1d3eac[_0xb236('0xd')]),_0x410bc0);}};exports[_0xb236('0x4c')]=function(_0x591d1c){try{utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x4d'),_0x591d1c[_0xb236('0x4e')]),_0x591d1c);if(_0x591d1c[_0xb236('0x4e')]==_0x591d1c[_0xb236('0x4f')]){if(!_['isNil'](queues[_0x591d1c[_0xb236('0x50')]])){utils[_0xb236('0x2')](util['format'](_0xb236('0x51'),_0x591d1c[_0xb236('0x4e')],queues[_0x591d1c['secondtransfererlinkedid']][_0xb236('0x1c')],_0x591d1c[_0xb236('0x52')]));queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x53')]=!![];queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x54')]=_0xb236('0x55');queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x56')]=_0x591d1c[_0xb236('0x52')];queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x49')]=_0x591d1c[_0xb236('0x4e')];queues[_0x591d1c['secondtransfererlinkedid']][_0xb236('0x7')]=_0xb236('0x57');}if(!_[_0xb236('0x15')](queues[_0x591d1c[_0xb236('0x4f')]])){if(_0x591d1c[_0xb236('0x58')]&&queues[_0x591d1c[_0xb236('0x58')]]){queues[_0x591d1c[_0xb236('0x58')]]['queuecallerenterreason']=0x1;queues[_0x591d1c['transfereeuniqueid']]=_[_0xb236('0x59')](queues[_0x591d1c[_0xb236('0x58')]]);queues[_0x591d1c['transfereeuniqueid']][_0xb236('0xc')]=_0x591d1c['transfertargetuniqueid'];queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x1e')]=0x2;queues[_0x591d1c['transfereeuniqueid']]['calleridnum']=queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x5')];queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x5a')]=queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x5a')];queues[_0x591d1c[_0xb236('0x46')]]['queuecallerjoinAt']=utils['now']();queues[_0x591d1c['transfereeuniqueid']][_0xb236('0x32')]=utils['now']();queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x33')]=0x0;queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x5b')]=0x0;utils[_0xb236('0x2')](util['format'](_0xb236('0x5c'),_0x591d1c[_0xb236('0x4e')],queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x1c')],queues[_0x591d1c[_0xb236('0x46')]][_0xb236('0x5')],queues[_0x591d1c[_0xb236('0x46')]]['calleridname']));}else{utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x5d'),_0x591d1c[_0xb236('0x4e')],queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x1c')],_0x591d1c['secondtransfererlinkedid']));queues[_0x591d1c[_0xb236('0x4f')]]['transfereduniqueid']=_0x591d1c[_0xb236('0x50')];}}}else if(_0x591d1c[_0xb236('0x5e')]==_0x591d1c['secondtransfererlinkedid']){if(!_[_0xb236('0x15')](queues[_0x591d1c[_0xb236('0x4f')]])){utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x5f'),_0x591d1c[_0xb236('0x4e')],queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x1c')],_0x591d1c[_0xb236('0x5e')],_0x591d1c['secondtransfererexten']));queues[_0x591d1c['origtransfererlinkedid']]['transfer']=!![];queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x54')]='ATTENDED';queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x56')]=_0x591d1c[_0xb236('0x60')];queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x49')]=_0x591d1c[_0xb236('0x5e')];queues[_0x591d1c['origtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xb236('0x15')](queues[_0x591d1c['secondtransfererlinkedid']])){if(_0x591d1c[_0xb236('0x61')]&&queues[_0x591d1c['transfertargetlinkedid']]){queues[_0x591d1c['transfertargetlinkedid']][_0xb236('0x1e')]=0x1;queues[_0x591d1c[_0xb236('0x62')]]=_['clone'](queues[_0x591d1c[_0xb236('0x61')]]);queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0xc')]=_0x591d1c[_0xb236('0x62')];queues[_0x591d1c[_0xb236('0x62')]]['queuecallerenterreason']=0x2;queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0x5')]=queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x5')];queues[_0x591d1c[_0xb236('0x62')]]['calleridname']=queues[_0x591d1c[_0xb236('0x4f')]][_0xb236('0x5a')];queues[_0x591d1c[_0xb236('0x62')]]['queuecallerjoinAt']=utils[_0xb236('0x12')]();queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0x32')]=utils[_0xb236('0x12')]();queues[_0x591d1c[_0xb236('0x62')]]['holdtime']=0x0;queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0x5b')]=0x0;utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x63'),_0x591d1c[_0xb236('0x4e')],queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0x1c')],queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0xc')],queues[_0x591d1c[_0xb236('0x62')]][_0xb236('0x5')],queues[_0x591d1c['transfertargetuniqueid']][_0xb236('0x5a')]));}else{utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x5d'),_0x591d1c['origtransfereruniqueid'],queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0x1c')],_0x591d1c['origtransfererlinkedid']));queues[_0x591d1c[_0xb236('0x50')]][_0xb236('0xc')]=_0x591d1c[_0xb236('0x4f')];}}}}catch(_0xbf7328){utils[_0xb236('0x13')](util[_0xb236('0x3')](_0xb236('0x4d'),_0x591d1c[_0xb236('0x4e')]),_0xbf7328);}};exports[_0xb236('0x64')]=function(_0x262259){try{if(!_[_0xb236('0x15')](queues[_0x262259['uniqueid']])){utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x65'),_0x262259[_0xb236('0xd')]),_0x262259);queues[_0x262259[_0xb236('0xd')]][_0xb236('0x66')]=utils[_0xb236('0x12')]();utils[_0xb236('0x2')](util['format'](_0xb236('0x67'),_0x262259[_0xb236('0xd')],queues[_0x262259[_0xb236('0xd')]][_0xb236('0x1c')],queues[_0x262259[_0xb236('0xd')]][_0xb236('0x66')]));}}catch(_0x23f32d){utils[_0xb236('0x13')](util[_0xb236('0x3')]('[%s][queues][musiconholdstart]',_0x262259['uniqueid']),_0x23f32d);}};exports[_0xb236('0x68')]=function(_0x53ee5e){try{if(!_['isNil'](queues[_0x53ee5e[_0xb236('0xd')]])){if(!_[_0xb236('0x15')](queues[_0x53ee5e[_0xb236('0xd')]][_0xb236('0x66')])){utils[_0xb236('0x20')](util[_0xb236('0x3')](_0xb236('0x69'),_0x53ee5e[_0xb236('0xd')]),_0x53ee5e);queues[_0x53ee5e['uniqueid']][_0xb236('0x5b')]+=utils[_0xb236('0x34')](utils['now'](),queues[_0x53ee5e[_0xb236('0xd')]][_0xb236('0x66')]);utils[_0xb236('0x2')](util[_0xb236('0x3')](_0xb236('0x6a'),_0x53ee5e[_0xb236('0xd')],queues[_0x53ee5e[_0xb236('0xd')]]['name'],queues[_0x53ee5e[_0xb236('0xd')]]['mohtime']));delete queues[_0x53ee5e[_0xb236('0xd')]]['musiconholdstartAt'];}}}catch(_0x2d3766){utils['error'](util[_0xb236('0x3')](_0xb236('0x69'),_0x53ee5e['uniqueid']),_0x2d3766);}}; \ No newline at end of file +var _0x63f9=['queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','transfertype','transfertargetlinkedid','clone','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable'];(function(_0x29b1b3,_0x19f17a){var _0x1b19fc=function(_0x496209){while(--_0x496209){_0x29b1b3['push'](_0x29b1b3['shift']());}};_0x1b19fc(++_0x19f17a);}(_0x63f9,0x1dc));var _0x963f=function(_0x300aa2,_0x27347b){_0x300aa2=_0x300aa2-0x0;var _0xc3d020=_0x63f9[_0x300aa2];return _0xc3d020;};'use strict';var _=require(_0x963f('0x0'));var util=require(_0x963f('0x1'));var utils=require(_0x963f('0x2'));var queues={};function writeDB(_0x3670ba){utils[_0x963f('0x3')](util['format'](_0x963f('0x4'),_0x3670ba[_0x963f('0x5')],_0x3670ba[_0x963f('0x6')],_0x3670ba[_0x963f('0x7')],_0x3670ba['lastAssignedTo'],_0x3670ba[_0x963f('0x8')],_0x3670ba[_0x963f('0x9')],_0x3670ba[_0x963f('0xa')]));if(_0x3670ba[_0x963f('0x7')]){utils['getVoiceQueueByName'](_0x3670ba[_0x963f('0x7')])['then'](function(_0x258f7d){if(_0x258f7d){_0x3670ba['type']=_0x258f7d[_0x963f('0xb')];}utils[_0x963f('0xc')](_0x963f('0xd'),_0x3670ba);});}else{utils[_0x963f('0xc')](_0x963f('0xd'),_0x3670ba);}if(_0x3670ba[_0x963f('0xe')]){delete queues[_0x3670ba['transfereduniqueid']];}else{delete queues[_0x3670ba['uniqueid']];}}exports[_0x963f('0xf')]=function(_0x54aa12){try{utils['debug'](util[_0x963f('0x10')](_0x963f('0x11'),_0x54aa12['uniqueid']),_0x54aa12);utils[_0x963f('0x3')](util[_0x963f('0x10')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x54aa12[_0x963f('0x5')],_0x54aa12[_0x963f('0x7')],_0x54aa12[_0x963f('0x12')]));queues[_0x54aa12[_0x963f('0x5')]]=_[_0x963f('0x13')](_0x54aa12,{'originalposition':_0x54aa12[_0x963f('0x12')],'queuecallerjoinAt':utils[_0x963f('0x14')](),'mohtime':0x0});}catch(_0x1d3ac7){utils[_0x963f('0x15')](util['format'](_0x963f('0x11'),_0x54aa12['uniqueid']),_0x1d3ac7);}};exports[_0x963f('0x16')]=function(_0x484d39){try{if(!_[_0x963f('0x17')](queues[_0x484d39['uniqueid']])){utils[_0x963f('0x18')](util['format'](_0x963f('0x19'),_0x484d39[_0x963f('0x5')]),_0x484d39);if(queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x1a')]){if(!queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x1b')]&&!queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x1c')]){queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x1d')]=!![];queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x1e')]=utils[_0x963f('0x14')]();queues[_0x484d39[_0x963f('0x5')]]['queuecallerexitreason']=_0x963f('0x1f');}utils[_0x963f('0x3')](util['format'](_0x963f('0x20'),_0x484d39['uniqueid'],queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x21')],queues[_0x484d39[_0x963f('0x5')]][_0x963f('0xa')]));writeDB(queues[_0x484d39['uniqueid']]);}else if(queues[_0x484d39[_0x963f('0x5')]][_0x963f('0xe')]){utils[_0x963f('0x3')](util[_0x963f('0x10')](_0x963f('0x22'),_0x484d39[_0x963f('0x5')],queues[_0x484d39[_0x963f('0x5')]][_0x963f('0x21')],queues[_0x484d39[_0x963f('0x5')]][_0x963f('0xe')]));queues[queues[_0x484d39['uniqueid']][_0x963f('0xe')]]=queues[_0x484d39[_0x963f('0x5')]];queues[queues[_0x484d39[_0x963f('0x5')]][_0x963f('0xe')]][_0x963f('0x23')]=0x2;delete queues[_0x484d39[_0x963f('0x5')]];}}}catch(_0x14fa0e){utils[_0x963f('0x15')](util[_0x963f('0x10')](_0x963f('0x19'),_0x484d39['uniqueid']),_0x14fa0e);}};exports[_0x963f('0x24')]=function(_0xc557bb){try{utils[_0x963f('0x18')](util['format'](_0x963f('0x25'),_0xc557bb['uniqueid']),_0xc557bb);if(!_[_0x963f('0x17')](_0xc557bb[_0x963f('0x26')][_0x963f('0x27')])&&_0xc557bb[_0x963f('0x28')]['toUpperCase']()!==_0x963f('0x29')){if(!_[_0x963f('0x17')](queues[_0xc557bb[_0x963f('0x5')]])){queues[_0xc557bb['uniqueid']][_0x963f('0x1b')]=![];queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x2a')]=null;queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x1c')]=!![];queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x2b')]=utils[_0x963f('0x14')]();queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0xa')]=_0xc557bb[_0x963f('0x28')][_0x963f('0x2c')]();utils[_0x963f('0x3')](util[_0x963f('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xc557bb[_0x963f('0x5')],queues[_0xc557bb['uniqueid']][_0x963f('0x21')],_0xc557bb[_0x963f('0x28')],queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0xa')]));writeDB(queues[_0xc557bb['uniqueid']]);}}else if(!_[_0x963f('0x17')](_0xc557bb[_0x963f('0x26')][_0x963f('0x2d')])){if(!_[_0x963f('0x17')](queues[_0xc557bb[_0x963f('0x5')]])&&!queues[_0xc557bb['uniqueid']][_0x963f('0x1b')]){queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x1b')]=![];queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x2a')]=null;queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x1c')]=!![];queues[_0xc557bb[_0x963f('0x5')]]['queuecallerexitAt']=utils[_0x963f('0x14')]();queues[_0xc557bb['uniqueid']][_0x963f('0xa')]=_0x963f('0x2e');utils['info'](util[_0x963f('0x10')](_0x963f('0x2f'),_0xc557bb[_0x963f('0x5')],queues[_0xc557bb[_0x963f('0x5')]][_0x963f('0x21')],_0xc557bb[_0x963f('0x28')],queues[_0xc557bb[_0x963f('0x5')]]['queuecallerexitreason']));}}}catch(_0x440e99){utils[_0x963f('0x15')](util[_0x963f('0x10')]('[%s][queues][varset]',_0xc557bb[_0x963f('0x5')]),_0x440e99);}};exports[_0x963f('0x1b')]=function(_0x54b843){try{if(!_[_0x963f('0x17')](queues[_0x54b843['uniqueid']])){utils[_0x963f('0x18')](util[_0x963f('0x10')]('[%s][queues][queuecallerabandon]',_0x54b843[_0x963f('0x5')]),_0x54b843);queues[_0x54b843[_0x963f('0x5')]]['queuecallerexit']=![];queues[_0x54b843[_0x963f('0x5')]][_0x963f('0x2b')]=null;queues[_0x54b843['uniqueid']][_0x963f('0x1b')]=!![];queues[_0x54b843[_0x963f('0x5')]][_0x963f('0x2a')]=utils[_0x963f('0x14')]();queues[_0x54b843[_0x963f('0x5')]][_0x963f('0xa')]=_0x963f('0x30');utils[_0x963f('0x3')](util['format'](_0x963f('0x31'),_0x54b843['uniqueid'],queues[_0x54b843[_0x963f('0x5')]][_0x963f('0x21')],queues[_0x54b843['uniqueid']][_0x963f('0xa')]));}}catch(_0x139d00){utils['error'](util[_0x963f('0x10')]('[%s][queues][queuecallerabandon]',_0x54b843[_0x963f('0x5')]),_0x139d00);}};exports[_0x963f('0x32')]=function(_0x4746e0){try{if(!_[_0x963f('0x17')](queues[_0x4746e0[_0x963f('0x5')]])){utils[_0x963f('0x18')](util['format']('[%s][queues][queuecallerleave]',_0x4746e0[_0x963f('0x5')]),_0x4746e0);utils[_0x963f('0x3')](util[_0x963f('0x10')](_0x963f('0x33'),_0x4746e0[_0x963f('0x5')],queues[_0x4746e0[_0x963f('0x5')]][_0x963f('0x21')],_0x4746e0[_0x963f('0x34')],_0x4746e0[_0x963f('0x35')]));queues[_0x4746e0['uniqueid']][_0x963f('0x32')]=!![];queues[_0x4746e0[_0x963f('0x5')]][_0x963f('0x1a')]=utils[_0x963f('0x14')]();queues[_0x4746e0[_0x963f('0x5')]]['holdtime']=utils['diffTime'](queues[_0x4746e0[_0x963f('0x5')]][_0x963f('0x1a')],queues[_0x4746e0[_0x963f('0x5')]]['queuecallerjoinAt']);queues[_0x4746e0[_0x963f('0x5')]]['position']=_0x4746e0[_0x963f('0x12')];queues[_0x4746e0['uniqueid']][_0x963f('0x36')]=_0x4746e0['count'];queues[_0x4746e0[_0x963f('0x5')]]['connectedlinenum']=_0x4746e0[_0x963f('0x34')];queues[_0x4746e0['uniqueid']]['connectedlinename']=_0x4746e0[_0x963f('0x35')];}}catch(_0x25215b){utils['error'](util['format'](_0x963f('0x37'),_0x4746e0[_0x963f('0x5')]),_0x25215b);}};exports[_0x963f('0x38')]=function(_0x4dbfd1){try{if(!_[_0x963f('0x17')](queues[_0x4dbfd1[_0x963f('0x5')]])){utils[_0x963f('0x18')](util['format'](_0x963f('0x39'),_0x4dbfd1[_0x963f('0x5')]),_0x4dbfd1);utils['info'](util['format'](_0x963f('0x3a'),_0x4dbfd1[_0x963f('0x5')],queues[_0x4dbfd1[_0x963f('0x5')]]['name'],_0x4dbfd1[_0x963f('0x3b')],_0x4dbfd1['destaccountcode']));queues[_0x4dbfd1['uniqueid']]['queuecallerabandon']=![];queues[_0x4dbfd1['uniqueid']]['queuecallerabandon']=![];queues[_0x4dbfd1['uniqueid']][_0x963f('0x2a')]=null;queues[_0x4dbfd1[_0x963f('0x5')]][_0x963f('0x1c')]=![];queues[_0x4dbfd1[_0x963f('0x5')]][_0x963f('0xa')]=null;queues[_0x4dbfd1['uniqueid']][_0x963f('0x2b')]=null;queues[_0x4dbfd1['uniqueid']][_0x963f('0x3c')]=!![];queues[_0x4dbfd1[_0x963f('0x5')]][_0x963f('0x9')]=_0x4dbfd1[_0x963f('0x3d')];queues[_0x4dbfd1[_0x963f('0x5')]][_0x963f('0x3e')]=_0x4dbfd1[_0x963f('0x3b')];}}catch(_0x133259){utils[_0x963f('0x15')](util['format'](_0x963f('0x39'),_0x4dbfd1['uniqueid']),_0x133259);}};exports[_0x963f('0x3f')]=function(_0x126ce3){try{if(!_['isNil'](queues[_0x126ce3['uniqueid']])){if(queues[_0x126ce3['uniqueid']][_0x963f('0x1a')]){utils[_0x963f('0x18')](util[_0x963f('0x10')](_0x963f('0x40'),_0x126ce3[_0x963f('0x5')]),_0x126ce3);queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0x1b')]=![];queues[_0x126ce3[_0x963f('0x5')]]['queuecallerabandon']=![];queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0x2a')]=null;queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0x1c')]=![];queues[_0x126ce3[_0x963f('0x5')]]['queuecallerexitAt']=null;queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0x3c')]=!![];queues[_0x126ce3['uniqueid']]['lastAssignedTo']=_0x126ce3[_0x963f('0x3b')];queues[_0x126ce3[_0x963f('0x5')]]['queuecallercomplete']=!![];queues[_0x126ce3['uniqueid']][_0x963f('0x1e')]=utils[_0x963f('0x14')]();if(_0x126ce3[_0x963f('0x41')]==_0x963f('0x42')){if(!queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0x42')]){queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0xa')]='TRANSFER';}}else{queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0xa')]=_0x963f('0x43')+_0x126ce3[_0x963f('0x41')][_0x963f('0x2c')]();}utils[_0x963f('0x3')](util[_0x963f('0x10')](_0x963f('0x44'),_0x126ce3[_0x963f('0x5')],queues[_0x126ce3['uniqueid']][_0x963f('0x21')],_0x126ce3[_0x963f('0x3b')],queues[_0x126ce3[_0x963f('0x5')]][_0x963f('0xa')]));writeDB(queues[_0x126ce3['uniqueid']]);}}}catch(_0x103d1e){utils[_0x963f('0x15')](util[_0x963f('0x10')]('[%s][queues][agentcomplete]',_0x126ce3['uniqueid']),_0x103d1e);}};exports[_0x963f('0x45')]=function(_0x572b19){try{if(!_[_0x963f('0x17')](queues[_0x572b19[_0x963f('0x46')]])){utils['debug'](util[_0x963f('0x10')](_0x963f('0x47'),_0x572b19[_0x963f('0x5')]),_0x572b19);queues[_0x572b19[_0x963f('0x46')]]['transfer']=!![];queues[_0x572b19[_0x963f('0x46')]]['transfertype']=_0x963f('0x48');queues[_0x572b19[_0x963f('0x46')]][_0x963f('0x49')]=_0x572b19[_0x963f('0x4a')];queues[_0x572b19['transfereeuniqueid']]['transferuniqueid']=_0x572b19[_0x963f('0x46')];queues[_0x572b19['transfereeuniqueid']][_0x963f('0xa')]=_0x963f('0x4b');utils[_0x963f('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x572b19[_0x963f('0x5')],queues[_0x572b19[_0x963f('0x46')]]['name'],_0x572b19[_0x963f('0x46')],_0x572b19[_0x963f('0x4a')]));}}catch(_0x1c1fdc){utils[_0x963f('0x15')](util[_0x963f('0x10')](_0x963f('0x47'),_0x572b19[_0x963f('0x5')]),_0x1c1fdc);}};exports[_0x963f('0x4c')]=function(_0x36ee10){try{utils[_0x963f('0x18')](util[_0x963f('0x10')](_0x963f('0x4d'),_0x36ee10[_0x963f('0x4e')]),_0x36ee10);if(_0x36ee10[_0x963f('0x4e')]==_0x36ee10[_0x963f('0x4f')]){if(!_[_0x963f('0x17')](queues[_0x36ee10[_0x963f('0x50')]])){utils[_0x963f('0x3')](util[_0x963f('0x10')](_0x963f('0x51'),_0x36ee10[_0x963f('0x4e')],queues[_0x36ee10[_0x963f('0x50')]][_0x963f('0x21')],_0x36ee10[_0x963f('0x52')]));queues[_0x36ee10[_0x963f('0x50')]]['transfer']=!![];queues[_0x36ee10[_0x963f('0x50')]]['transfertype']=_0x963f('0x53');queues[_0x36ee10['secondtransfererlinkedid']][_0x963f('0x49')]=_0x36ee10[_0x963f('0x52')];queues[_0x36ee10[_0x963f('0x50')]][_0x963f('0x54')]=_0x36ee10[_0x963f('0x4e')];queues[_0x36ee10[_0x963f('0x50')]][_0x963f('0xa')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x36ee10[_0x963f('0x4f')]])){if(_0x36ee10['transfereelinkedid']&&queues[_0x36ee10[_0x963f('0x55')]]){queues[_0x36ee10[_0x963f('0x55')]][_0x963f('0x23')]=0x1;queues[_0x36ee10[_0x963f('0x46')]]=_['clone'](queues[_0x36ee10[_0x963f('0x55')]]);queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0xe')]=_0x36ee10[_0x963f('0x56')];queues[_0x36ee10[_0x963f('0x46')]]['queuecallerenterreason']=0x2;queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x8')]=queues[_0x36ee10[_0x963f('0x50')]]['calleridnum'];queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x57')]=queues[_0x36ee10[_0x963f('0x50')]][_0x963f('0x57')];queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x58')]=utils['now']();queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x1a')]=utils['now']();queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x59')]=0x0;queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x5a')]=0x0;utils['info'](util[_0x963f('0x10')](_0x963f('0x5b'),_0x36ee10['origtransfereruniqueid'],queues[_0x36ee10[_0x963f('0x46')]][_0x963f('0x21')],queues[_0x36ee10['transfereeuniqueid']][_0x963f('0x8')],queues[_0x36ee10['transfereeuniqueid']][_0x963f('0x57')]));}else{utils['info'](util[_0x963f('0x10')](_0x963f('0x5c'),_0x36ee10[_0x963f('0x4e')],queues[_0x36ee10[_0x963f('0x4f')]][_0x963f('0x21')],_0x36ee10[_0x963f('0x50')]));queues[_0x36ee10['origtransfererlinkedid']][_0x963f('0xe')]=_0x36ee10[_0x963f('0x50')];}}}else if(_0x36ee10[_0x963f('0x5d')]==_0x36ee10[_0x963f('0x50')]){if(!_[_0x963f('0x17')](queues[_0x36ee10[_0x963f('0x4f')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x36ee10[_0x963f('0x4e')],queues[_0x36ee10[_0x963f('0x4f')]][_0x963f('0x21')],_0x36ee10[_0x963f('0x5d')],_0x36ee10['secondtransfererexten']));queues[_0x36ee10[_0x963f('0x4f')]][_0x963f('0x42')]=!![];queues[_0x36ee10['origtransfererlinkedid']][_0x963f('0x5e')]=_0x963f('0x53');queues[_0x36ee10['origtransfererlinkedid']][_0x963f('0x49')]=_0x36ee10['secondtransfererexten'];queues[_0x36ee10[_0x963f('0x4f')]][_0x963f('0x54')]=_0x36ee10[_0x963f('0x5d')];queues[_0x36ee10['origtransfererlinkedid']][_0x963f('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x963f('0x17')](queues[_0x36ee10[_0x963f('0x50')]])){if(_0x36ee10['transfertargetlinkedid']&&queues[_0x36ee10[_0x963f('0x5f')]]){queues[_0x36ee10[_0x963f('0x5f')]][_0x963f('0x23')]=0x1;queues[_0x36ee10[_0x963f('0x56')]]=_[_0x963f('0x60')](queues[_0x36ee10[_0x963f('0x5f')]]);queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0xe')]=_0x36ee10['transfertargetuniqueid'];queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0x23')]=0x2;queues[_0x36ee10[_0x963f('0x56')]]['calleridnum']=queues[_0x36ee10['origtransfererlinkedid']][_0x963f('0x8')];queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0x57')]=queues[_0x36ee10[_0x963f('0x4f')]][_0x963f('0x57')];queues[_0x36ee10[_0x963f('0x56')]]['queuecallerjoinAt']=utils[_0x963f('0x14')]();queues[_0x36ee10['transfertargetuniqueid']][_0x963f('0x1a')]=utils[_0x963f('0x14')]();queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0x59')]=0x0;queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0x5a')]=0x0;utils[_0x963f('0x3')](util[_0x963f('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x36ee10['origtransfereruniqueid'],queues[_0x36ee10['transfertargetuniqueid']][_0x963f('0x21')],queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0xe')],queues[_0x36ee10[_0x963f('0x56')]][_0x963f('0x8')],queues[_0x36ee10['transfertargetuniqueid']][_0x963f('0x57')]));}else{utils[_0x963f('0x3')](util[_0x963f('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x36ee10[_0x963f('0x4e')],queues[_0x36ee10[_0x963f('0x50')]][_0x963f('0x21')],_0x36ee10['origtransfererlinkedid']));queues[_0x36ee10[_0x963f('0x50')]]['transfereduniqueid']=_0x36ee10[_0x963f('0x4f')];}}}}catch(_0x2cf53a){utils[_0x963f('0x15')](util[_0x963f('0x10')]('[%s][queues][attendedtransfer]',_0x36ee10[_0x963f('0x4e')]),_0x2cf53a);}};exports[_0x963f('0x61')]=function(_0x457a73){try{if(!_['isNil'](queues[_0x457a73['uniqueid']])){utils[_0x963f('0x18')](util[_0x963f('0x10')]('[%s][queues][musiconholdstart]',_0x457a73[_0x963f('0x5')]),_0x457a73);queues[_0x457a73[_0x963f('0x5')]][_0x963f('0x62')]=utils[_0x963f('0x14')]();utils['info'](util[_0x963f('0x10')](_0x963f('0x63'),_0x457a73[_0x963f('0x5')],queues[_0x457a73[_0x963f('0x5')]][_0x963f('0x21')],queues[_0x457a73[_0x963f('0x5')]][_0x963f('0x62')]));}}catch(_0x6f5fd){utils[_0x963f('0x15')](util['format'](_0x963f('0x64'),_0x457a73['uniqueid']),_0x6f5fd);}};exports['musiconholdstop']=function(_0x9f3f3b){try{if(!_[_0x963f('0x17')](queues[_0x9f3f3b[_0x963f('0x5')]])){if(!_['isNil'](queues[_0x9f3f3b[_0x963f('0x5')]][_0x963f('0x62')])){utils[_0x963f('0x18')](util[_0x963f('0x10')]('[%s][queues][musiconholdstop]',_0x9f3f3b[_0x963f('0x5')]),_0x9f3f3b);queues[_0x9f3f3b['uniqueid']][_0x963f('0x5a')]+=utils[_0x963f('0x65')](utils['now'](),queues[_0x9f3f3b[_0x963f('0x5')]][_0x963f('0x62')]);utils[_0x963f('0x3')](util['format'](_0x963f('0x66'),_0x9f3f3b[_0x963f('0x5')],queues[_0x9f3f3b[_0x963f('0x5')]][_0x963f('0x21')],queues[_0x9f3f3b[_0x963f('0x5')]][_0x963f('0x5a')]));delete queues[_0x9f3f3b['uniqueid']]['musiconholdstartAt'];}}}catch(_0x6e21a){utils[_0x963f('0x15')](util[_0x963f('0x10')]('[%s][queues][musiconholdstop]',_0x9f3f3b[_0x963f('0x5')]),_0x6e21a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index ba74833..c74bf83 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 _0xfeff=['[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','exten','context','channel','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors','hangup'];(function(_0x515f3e,_0x5934e7){var _0x19cee4=function(_0x19bf18){while(--_0x19bf18){_0x515f3e['push'](_0x515f3e['shift']());}};_0x19cee4(++_0x5934e7);}(_0xfeff,0x16a));var _0xffef=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfeff[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x3e126f){var _0x282d07;utils['info'](util[_0xffef('0x2')](_0xffef('0x3'),_0x3e126f[_0xffef('0x4')]));if(transfers[_0xffef('0x5')][_0x3e126f[_0xffef('0x4')]]){_0x282d07=_0x3e126f[_0xffef('0x4')];_0x3e126f[_0xffef('0x4')]=transfers['blinds'][_0x3e126f[_0xffef('0x4')]][_0xffef('0x6')];}if(_0x3e126f[_0xffef('0x7')]){utils[_0xffef('0x8')](_0x3e126f[_0xffef('0x7')])[_0xffef('0x9')](function(_0x5595bd){if(_0x5595bd){_0x3e126f[_0xffef('0xa')]=_0x5595bd[_0xffef('0xb')];_0x3e126f[_0xffef('0xc')]=_0x5595bd['id'];}utils[_0xffef('0xd')](_0xffef('0xe'),_0x3e126f);});}else{utils['request'](_0xffef('0xe'),_0x3e126f);}if(_0x282d07)delete transfers[_0xffef('0x5')][_0x282d07];}exports['newchannel']=function(_0x314f05){try{utils['debug'](util['format']('[%s][recordings][newchannel]',_0x314f05[_0xffef('0x4')]),_0x314f05);if(_0x314f05[_0xffef('0x4')]==_0x314f05['linkedid']){utils['info'](util[_0xffef('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x314f05[_0xffef('0x4')],_0x314f05['context'],_0x314f05[_0xffef('0xf')]));recordings[_0x314f05[_0xffef('0x4')]]={'uniqueid':_0x314f05[_0xffef('0x4')],'accountcode':_0x314f05[_0xffef('0x7')],'exten':_0x314f05[_0xffef('0xf')],'context':_0x314f05[_0xffef('0x10')],'channel':_0x314f05[_0xffef('0x11')],'monitors':[]};}}catch(_0x4e5abd){utils[_0xffef('0x12')](util[_0xffef('0x2')](_0xffef('0x13'),_0x314f05[_0xffef('0x4')]),_0x4e5abd);}};exports[_0xffef('0x14')]=function(_0x17cdbf){try{utils[_0xffef('0x15')](util[_0xffef('0x2')](_0xffef('0x16'),_0x17cdbf[_0xffef('0x4')]),_0x17cdbf);if(!_['isNil'](recordings[_0x17cdbf[_0xffef('0x4')]])&&_0x17cdbf[_0xffef('0x17')]==0x6){utils[_0xffef('0x18')](util[_0xffef('0x2')](_0xffef('0x19'),_0x17cdbf[_0xffef('0x4')],_0x17cdbf['context'],_0x17cdbf[_0xffef('0x11')]));}else if(!_['isNil'](recordings[_0x17cdbf[_0xffef('0x1a')]])&&_0x17cdbf[_0xffef('0x17')]==0x6&&_0x17cdbf[_0xffef('0x10')]!=_0xffef('0x1b')){utils[_0xffef('0x18')](util[_0xffef('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x17cdbf[_0xffef('0x4')],_0x17cdbf[_0xffef('0x1a')],_0x17cdbf['context'],_0x17cdbf[_0xffef('0x11')]));recordings[_0x17cdbf[_0xffef('0x1a')]][_0xffef('0x7')]=_0x17cdbf[_0xffef('0x7')];}}catch(_0x504573){utils['error'](util[_0xffef('0x2')](_0xffef('0x16'),_0x17cdbf[_0xffef('0x4')]),_0x504573);}};exports['varset']=function(_0x2941f0){try{if(!_[_0xffef('0x1c')](_0x2941f0[_0xffef('0x1d')])&&!_[_0xffef('0x1c')](_0x2941f0[_0xffef('0x1d')][_0xffef('0x1e')])){utils[_0xffef('0x15')](util[_0xffef('0x2')](_0xffef('0x1f'),_0x2941f0[_0xffef('0x4')]),_0x2941f0);utils['info'](util['format'](_0xffef('0x20'),_0x2941f0[_0xffef('0x4')],_0x2941f0[_0xffef('0x1d')],_0x2941f0[_0xffef('0x21')]));if(_[_0xffef('0x22')](_0x2941f0[_0xffef('0x21')],'.wav49')){_0x2941f0[_0xffef('0x21')]=_0x2941f0[_0xffef('0x21')][_0xffef('0x23')](_0xffef('0x24'),'.WAV');}if(recordings[_0x2941f0['linkedid']]){var _0x3283c1=_[_0xffef('0x25')](recordings[_0x2941f0[_0xffef('0x1a')]][_0xffef('0x26')],{'value':_0x2941f0['value']});if(_['isNil'](_0x3283c1)){recordings[_0x2941f0['linkedid']]['monitors']['push']({'value':_0x2941f0[_0xffef('0x21')]});}}}}catch(_0x20859f){utils[_0xffef('0x12')](util[_0xffef('0x2')](_0xffef('0x1f'),_0x2941f0[_0xffef('0x4')]),_0x20859f);}};exports[_0xffef('0x27')]=function(_0x308943){try{if(!_[_0xffef('0x1c')](recordings[_0x308943[_0xffef('0x4')]])){utils[_0xffef('0x15')](util[_0xffef('0x2')](_0xffef('0x28'),_0x308943[_0xffef('0x4')]),_0x308943);utils[_0xffef('0x18')](util['format'](_0xffef('0x29'),_0x308943[_0xffef('0x4')],_0x308943[_0xffef('0x2a')],_0x308943[_0xffef('0x2b')],_0x308943['cause-txt']));recordings[_0x308943[_0xffef('0x4')]]['calleridnum']=_0x308943[_0xffef('0x2a')];recordings[_0x308943['uniqueid']]['calleridname']=_0x308943[_0xffef('0x2b')];recordings[_0x308943['uniqueid']][_0xffef('0x2c')]=_0x308943[_0xffef('0x2c')];recordings[_0x308943[_0xffef('0x4')]][_0xffef('0x2d')]=_0x308943[_0xffef('0x2d')];if(recordings[_0x308943[_0xffef('0x4')]][_0xffef('0x2e')]==_0xffef('0x2f')&&recordings[_0x308943['uniqueid']][_0xffef('0x7')]){recordings[_0x308943[_0xffef('0x4')]][_0xffef('0x2c')]=recordings[_0x308943[_0xffef('0x4')]][_0xffef('0x7')];recordings[_0x308943[_0xffef('0x4')]]['connectedlinename']='';}recordings[_0x308943[_0xffef('0x4')]][_0xffef('0x26')][_0xffef('0x30')](function(_0x5261e5){var _0x3cc7c7=_[_0xffef('0x31')](recordings[_0x308943[_0xffef('0x4')]]);_0x3cc7c7[_0xffef('0x21')]=_0x5261e5[_0xffef('0x21')];writeDB(_0x3cc7c7);});delete recordings[_0x308943['uniqueid']];}}catch(_0x33722c){utils[_0xffef('0x12')](util['format'](_0xffef('0x28'),_0x308943['uniqueid']),_0x33722c);}};exports[_0xffef('0x32')]=function(_0x37873e){try{if(!_['isNil'](recordings[_0x37873e[_0xffef('0x4')]])){utils['debug'](util[_0xffef('0x2')](_0xffef('0x33'),_0x37873e[_0xffef('0x4')]),_0x37873e);utils[_0xffef('0x18')](util[_0xffef('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x37873e[_0xffef('0x4')],_0x37873e[_0xffef('0x34')],_0x37873e['appdata']));if(_0x37873e[_0xffef('0x34')]['toLowerCase']()=='set'&&_['startsWith'](_0x37873e[_0xffef('0x35')]['toLowerCase'](),'cdr')){var _0x2e3ec7=_0x37873e[_0xffef('0x35')][_0xffef('0x36')]('=');var _0x3ae487=_0x2e3ec7[0x0][_0xffef('0x37')](_0x2e3ec7[0x0][_0xffef('0x38')]('(')+0x1,_0x2e3ec7[0x0][_0xffef('0x38')](')'));var _0x12818d=_0x2e3ec7[0x1];recordings[_0x37873e['uniqueid']][_0x3ae487]=_0x12818d;}}}catch(_0x9aa7b4){utils[_0xffef('0x12')](util[_0xffef('0x2')]('[%s][recordings][newexten]',_0x37873e[_0xffef('0x4')]),_0x9aa7b4);}};exports['queuecallerjoin']=function(_0x2b4e8c){try{if(!_[_0xffef('0x1c')](recordings[_0x2b4e8c[_0xffef('0x4')]])){utils[_0xffef('0x15')](util[_0xffef('0x2')](_0xffef('0x39'),_0x2b4e8c[_0xffef('0x4')]),_0x2b4e8c);utils['info'](util[_0xffef('0x2')](_0xffef('0x3a'),_0x2b4e8c[_0xffef('0x4')],_0x2b4e8c[_0xffef('0x3b')]));recordings[_0x2b4e8c[_0xffef('0x4')]]['queue']=_0x2b4e8c['queue'];}}catch(_0x499505){utils['error'](util[_0xffef('0x2')](_0xffef('0x39'),_0x2b4e8c['uniqueid']),_0x499505);}};exports[_0xffef('0x3c')]=function(_0x4c9e20){try{utils[_0xffef('0x15')](util[_0xffef('0x2')]('[%s][recordings][blindtransfer]',_0x4c9e20[_0xffef('0x4')]),_0x4c9e20);utils['info'](util[_0xffef('0x2')](_0xffef('0x3d'),_0x4c9e20[_0xffef('0x4')],_0x4c9e20['transferercalleridnum'],_0x4c9e20[_0xffef('0x3e')],_0x4c9e20['transfereecalleridnum'],_0x4c9e20[_0xffef('0x3f')]));if(recordings[_0x4c9e20[_0xffef('0x40')]]&&transfers[_0xffef('0x5')][_0x4c9e20[_0xffef('0x40')]]){transfers[_0xffef('0x5')][_0x4c9e20[_0xffef('0x40')]][_0xffef('0x41')]=!![];}}catch(_0x2746a6){utils['error'](util[_0xffef('0x2')](_0xffef('0x42'),_0x4c9e20['uniqueid']),_0x2746a6);}}; \ No newline at end of file +var _0x3e7a=['variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','util','./utils','info','format','[%s][recordings][writeDB]','blinds','uniqueid','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','accountcode','channel','[%s][recordings][newstate]','isNil','channelstate','transfer','context','error','varset'];(function(_0x2ce48a,_0x15351a){var _0x13f3cb=function(_0x48e000){while(--_0x48e000){_0x2ce48a['push'](_0x2ce48a['shift']());}};_0x13f3cb(++_0x15351a);}(_0x3e7a,0x139));var _0xa3e7=function(_0x13b94e,_0x5d11d6){_0x13b94e=_0x13b94e-0x0;var _0x3a7b57=_0x3e7a[_0x13b94e];return _0x3a7b57;};'use strict';var _=require('lodash');var util=require(_0xa3e7('0x0'));var utils=require(_0xa3e7('0x1'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x132b6f){var _0x598475;utils[_0xa3e7('0x2')](util[_0xa3e7('0x3')](_0xa3e7('0x4'),_0x132b6f['uniqueid']));if(transfers[_0xa3e7('0x5')][_0x132b6f['uniqueid']]){_0x598475=_0x132b6f[_0xa3e7('0x6')];_0x132b6f[_0xa3e7('0x6')]=transfers[_0xa3e7('0x5')][_0x132b6f[_0xa3e7('0x6')]]['transfereeuniqueid'];}if(_0x132b6f['accountcode']){utils[_0xa3e7('0x7')](_0x132b6f['accountcode'])[_0xa3e7('0x8')](function(_0x465428){if(_0x465428){_0x132b6f[_0xa3e7('0x9')]=_0x465428[_0xa3e7('0xa')];_0x132b6f[_0xa3e7('0xb')]=_0x465428['id'];}utils[_0xa3e7('0xc')](_0xa3e7('0xd'),_0x132b6f);});}else{utils['request'](_0xa3e7('0xd'),_0x132b6f);}if(_0x598475)delete transfers[_0xa3e7('0x5')][_0x598475];}exports[_0xa3e7('0xe')]=function(_0x189454){try{utils['debug'](util[_0xa3e7('0x3')](_0xa3e7('0xf'),_0x189454[_0xa3e7('0x6')]),_0x189454);if(_0x189454[_0xa3e7('0x6')]==_0x189454[_0xa3e7('0x10')]){utils['info'](util['format'](_0xa3e7('0x11'),_0x189454[_0xa3e7('0x6')],_0x189454['context'],_0x189454['exten']));recordings[_0x189454[_0xa3e7('0x6')]]={'uniqueid':_0x189454[_0xa3e7('0x6')],'accountcode':_0x189454[_0xa3e7('0x12')],'exten':_0x189454['exten'],'context':_0x189454['context'],'channel':_0x189454[_0xa3e7('0x13')],'monitors':[]};}}catch(_0xae22f5){utils['error'](util[_0xa3e7('0x3')](_0xa3e7('0xf'),_0x189454[_0xa3e7('0x6')]),_0xae22f5);}};exports['newstate']=function(_0x141f69){try{utils['debug'](util[_0xa3e7('0x3')](_0xa3e7('0x14'),_0x141f69['uniqueid']),_0x141f69);if(!_[_0xa3e7('0x15')](recordings[_0x141f69[_0xa3e7('0x6')]])&&_0x141f69[_0xa3e7('0x16')]==0x6){utils['info'](util[_0xa3e7('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x141f69['uniqueid'],_0x141f69['context'],_0x141f69[_0xa3e7('0x13')]));}else if(!_[_0xa3e7('0x15')](recordings[_0x141f69[_0xa3e7('0x10')]])&&_0x141f69[_0xa3e7('0x16')]==0x6&&_0x141f69['context']!=_0xa3e7('0x17')){utils[_0xa3e7('0x2')](util[_0xa3e7('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x141f69[_0xa3e7('0x6')],_0x141f69[_0xa3e7('0x10')],_0x141f69[_0xa3e7('0x18')],_0x141f69['channel']));recordings[_0x141f69[_0xa3e7('0x10')]][_0xa3e7('0x12')]=_0x141f69[_0xa3e7('0x12')];}}catch(_0x506863){utils[_0xa3e7('0x19')](util['format'](_0xa3e7('0x14'),_0x141f69['uniqueid']),_0x506863);}};exports[_0xa3e7('0x1a')]=function(_0x47198f){try{if(!_[_0xa3e7('0x15')](_0x47198f[_0xa3e7('0x1b')])&&!_[_0xa3e7('0x15')](_0x47198f[_0xa3e7('0x1b')][_0xa3e7('0x1c')])){utils[_0xa3e7('0x1d')](util[_0xa3e7('0x3')](_0xa3e7('0x1e'),_0x47198f[_0xa3e7('0x6')]),_0x47198f);utils['info'](util[_0xa3e7('0x3')](_0xa3e7('0x1f'),_0x47198f[_0xa3e7('0x6')],_0x47198f['variable'],_0x47198f[_0xa3e7('0x20')]));if(_[_0xa3e7('0x21')](_0x47198f[_0xa3e7('0x20')],'.wav49')){_0x47198f[_0xa3e7('0x20')]=_0x47198f[_0xa3e7('0x20')][_0xa3e7('0x22')](_0xa3e7('0x23'),'.WAV');}if(recordings[_0x47198f['linkedid']]){var _0x3a14a2=_['find'](recordings[_0x47198f[_0xa3e7('0x10')]][_0xa3e7('0x24')],{'value':_0x47198f[_0xa3e7('0x20')]});if(_[_0xa3e7('0x15')](_0x3a14a2)){recordings[_0x47198f[_0xa3e7('0x10')]][_0xa3e7('0x24')][_0xa3e7('0x25')]({'value':_0x47198f[_0xa3e7('0x20')]});}}}}catch(_0x2f58fd){utils[_0xa3e7('0x19')](util[_0xa3e7('0x3')](_0xa3e7('0x1e'),_0x47198f[_0xa3e7('0x6')]),_0x2f58fd);}};exports[_0xa3e7('0x26')]=function(_0x6cb6c6){try{if(!_[_0xa3e7('0x15')](recordings[_0x6cb6c6[_0xa3e7('0x6')]])){utils[_0xa3e7('0x1d')](util[_0xa3e7('0x3')]('[%s][recordings][hangup]',_0x6cb6c6[_0xa3e7('0x6')]),_0x6cb6c6);utils[_0xa3e7('0x2')](util[_0xa3e7('0x3')](_0xa3e7('0x27'),_0x6cb6c6[_0xa3e7('0x6')],_0x6cb6c6[_0xa3e7('0x28')],_0x6cb6c6[_0xa3e7('0x29')],_0x6cb6c6['cause-txt']));recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x28')]=_0x6cb6c6['calleridnum'];recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x29')]=_0x6cb6c6[_0xa3e7('0x29')];recordings[_0x6cb6c6[_0xa3e7('0x6')]]['connectedlinenum']=_0x6cb6c6[_0xa3e7('0x2a')];recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x2b')]=_0x6cb6c6[_0xa3e7('0x2b')];if(recordings[_0x6cb6c6['uniqueid']]['type']=='outbound'&&recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x12')]){recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x2a')]=recordings[_0x6cb6c6[_0xa3e7('0x6')]][_0xa3e7('0x12')];recordings[_0x6cb6c6['uniqueid']][_0xa3e7('0x2b')]='';}recordings[_0x6cb6c6['uniqueid']][_0xa3e7('0x24')][_0xa3e7('0x2c')](function(_0x3a979e){var _0x32c4fa=_[_0xa3e7('0x2d')](recordings[_0x6cb6c6[_0xa3e7('0x6')]]);_0x32c4fa[_0xa3e7('0x20')]=_0x3a979e[_0xa3e7('0x20')];writeDB(_0x32c4fa);});delete recordings[_0x6cb6c6['uniqueid']];}}catch(_0x501630){utils[_0xa3e7('0x19')](util[_0xa3e7('0x3')]('[%s][recordings][hangup]',_0x6cb6c6['uniqueid']),_0x501630);}};exports[_0xa3e7('0x2e')]=function(_0x3044f1){try{if(!_[_0xa3e7('0x15')](recordings[_0x3044f1['uniqueid']])){utils['debug'](util['format'](_0xa3e7('0x2f'),_0x3044f1[_0xa3e7('0x6')]),_0x3044f1);utils['info'](util[_0xa3e7('0x3')](_0xa3e7('0x30'),_0x3044f1[_0xa3e7('0x6')],_0x3044f1['application'],_0x3044f1[_0xa3e7('0x31')]));if(_0x3044f1[_0xa3e7('0x32')]['toLowerCase']()==_0xa3e7('0x33')&&_['startsWith'](_0x3044f1[_0xa3e7('0x31')][_0xa3e7('0x34')](),_0xa3e7('0x35'))){var _0x439c55=_0x3044f1[_0xa3e7('0x31')][_0xa3e7('0x36')]('=');var _0x1813c0=_0x439c55[0x0][_0xa3e7('0x37')](_0x439c55[0x0][_0xa3e7('0x38')]('(')+0x1,_0x439c55[0x0][_0xa3e7('0x38')](')'));var _0x2f35d0=_0x439c55[0x1];recordings[_0x3044f1[_0xa3e7('0x6')]][_0x1813c0]=_0x2f35d0;}}}catch(_0x46f989){utils[_0xa3e7('0x19')](util['format'](_0xa3e7('0x2f'),_0x3044f1[_0xa3e7('0x6')]),_0x46f989);}};exports['queuecallerjoin']=function(_0x41fa58){try{if(!_[_0xa3e7('0x15')](recordings[_0x41fa58[_0xa3e7('0x6')]])){utils[_0xa3e7('0x1d')](util[_0xa3e7('0x3')]('[%s][recordings][queuecallerjoin]',_0x41fa58[_0xa3e7('0x6')]),_0x41fa58);utils[_0xa3e7('0x2')](util[_0xa3e7('0x3')](_0xa3e7('0x39'),_0x41fa58[_0xa3e7('0x6')],_0x41fa58[_0xa3e7('0x3a')]));recordings[_0x41fa58[_0xa3e7('0x6')]]['queue']=_0x41fa58[_0xa3e7('0x3a')];}}catch(_0x3dac07){utils['error'](util[_0xa3e7('0x3')](_0xa3e7('0x3b'),_0x41fa58[_0xa3e7('0x6')]),_0x3dac07);}};exports[_0xa3e7('0x3c')]=function(_0x45bf70){try{utils['debug'](util[_0xa3e7('0x3')](_0xa3e7('0x3d'),_0x45bf70[_0xa3e7('0x6')]),_0x45bf70);utils[_0xa3e7('0x2')](util[_0xa3e7('0x3')](_0xa3e7('0x3e'),_0x45bf70[_0xa3e7('0x6')],_0x45bf70[_0xa3e7('0x3f')],_0x45bf70[_0xa3e7('0x40')],_0x45bf70[_0xa3e7('0x41')],_0x45bf70[_0xa3e7('0x42')]));if(recordings[_0x45bf70[_0xa3e7('0x43')]]&&transfers[_0xa3e7('0x5')][_0x45bf70['transfereruniqueid']]){transfers['blinds'][_0x45bf70[_0xa3e7('0x43')]]['recording']=!![];}}catch(_0x4db777){utils[_0xa3e7('0x19')](util[_0xa3e7('0x3')](_0xa3e7('0x3d'),_0x45bf70[_0xa3e7('0x6')]),_0x4db777);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3fd7e05..bf438c4 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 _0x4858=['[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','error','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','debug'];(function(_0x2a5160,_0x5f068d){var _0x2b42c5=function(_0x350590){while(--_0x350590){_0x2a5160['push'](_0x2a5160['shift']());}};_0x2b42c5(++_0x5f068d);}(_0x4858,0x6c));var _0x8485=function(_0x2fcbae,_0x22ecaf){_0x2fcbae=_0x2fcbae-0x0;var _0x511b33=_0x4858[_0x2fcbae];return _0x511b33;};'use strict';var _=require(_0x8485('0x0'));var util=require(_0x8485('0x1'));var utils=require('./utils');function writeDB(_0x407685){utils[_0x8485('0x2')](util[_0x8485('0x3')](_0x8485('0x4'),_0x407685[_0x8485('0x5')]===_0x8485('0x6')?_0x407685['origtransfereruniqueid']:_0x407685[_0x8485('0x7')],_0x407685[_0x8485('0x5')]));utils[_0x8485('0x8')](_0x8485('0x9'),_0x407685);}exports[_0x8485('0xa')]={};exports['blindtransfer']=function(_0x4030c2){try{utils[_0x8485('0xb')](util[_0x8485('0x3')](_0x8485('0xc'),_0x4030c2[_0x8485('0x7')]),_0x4030c2);utils[_0x8485('0x2')](util['format'](_0x8485('0xd'),_0x4030c2[_0x8485('0x7')],_0x4030c2[_0x8485('0xe')],_0x4030c2[_0x8485('0xf')],_0x4030c2[_0x8485('0x10')],_0x4030c2['transfereecalleridname']));_0x4030c2[_0x8485('0x5')]=_0x8485('0x11');exports[_0x8485('0xa')][_0x4030c2[_0x8485('0x12')]]=_0x4030c2;writeDB(_0x4030c2);}catch(_0x5631a9){utils['error'](util[_0x8485('0x3')]('[%s][transfers][blindtransfer]',_0x4030c2['uniqueid']),_0x5631a9);}};exports[_0x8485('0x13')]=function(_0x2df3cc){try{utils[_0x8485('0xb')](util[_0x8485('0x3')](_0x8485('0x14'),_0x2df3cc['origtransfereruniqueid']),_0x2df3cc);utils[_0x8485('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2df3cc[_0x8485('0x15')],_0x2df3cc[_0x8485('0x16')],_0x2df3cc[_0x8485('0x17')],_0x2df3cc[_0x8485('0x18')],_0x2df3cc[_0x8485('0x19')]));_0x2df3cc=_[_0x8485('0x1a')](_0x2df3cc,{'transfererchannel':_0x2df3cc[_0x8485('0x1b')],'transferercalleridnum':_0x2df3cc['origtransferercalleridnum'],'transferercalleridname':_0x2df3cc[_0x8485('0x17')],'transfererconnectedlinenum':_0x2df3cc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2df3cc[_0x8485('0x1c')],'transfereraccountcode':_0x2df3cc[_0x8485('0x1d')],'transferercontext':_0x2df3cc[_0x8485('0x1e')],'transfererexten':_0x2df3cc['secondtransfererexten'],'transfererlinkedid':_0x2df3cc['origtransfererlinkedid'],'context':_0x2df3cc[_0x8485('0x1f')],'extension':_0x2df3cc['origtransfererexten'],'type':'attended'});if(_[_0x8485('0x20')](_0x2df3cc[_0x8485('0x21')])){_0x2df3cc=_['assign'](_0x2df3cc,{'transfereechannel':_0x2df3cc[_0x8485('0x22')],'transfereecalleridnum':_0x2df3cc[_0x8485('0x18')],'transfereecalleridname':_0x2df3cc['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2df3cc[_0x8485('0x23')],'transfereeconnectedlinename':_0x2df3cc[_0x8485('0x24')],'transfereeaccountcode':_0x2df3cc[_0x8485('0x25')],'transfereecontext':_0x2df3cc['transfertargetcontext'],'transfereeexten':_0x2df3cc[_0x8485('0x26')],'transfereelinkedid':_0x2df3cc['transfertargetlinkedid']});}writeDB(_0x2df3cc);}catch(_0x4f3bbe){utils[_0x8485('0x27')](util[_0x8485('0x3')]('[%s][transfers][attendedtransfer]',_0x2df3cc[_0x8485('0x15')]),_0x4f3bbe);}}; \ No newline at end of file +var _0xb391=['transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','info','[%s][transfers][writeDB]\x20type:%s','type','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereruniqueid','error','attendedtransfer','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0xb391,0x1cc));var _0x1b39=function(_0x5d8694,_0x12b8c2){_0x5d8694=_0x5d8694-0x0;var _0x442111=_0xb391[_0x5d8694];return _0x442111;};'use strict';var _=require(_0x1b39('0x0'));var util=require(_0x1b39('0x1'));var utils=require('./utils');function writeDB(_0x5aab7c){utils[_0x1b39('0x2')](util['format'](_0x1b39('0x3'),_0x5aab7c[_0x1b39('0x4')]==='attended'?_0x5aab7c['origtransfereruniqueid']:_0x5aab7c[_0x1b39('0x5')],_0x5aab7c[_0x1b39('0x4')]));utils[_0x1b39('0x6')](_0x1b39('0x7'),_0x5aab7c);}exports[_0x1b39('0x8')]={};exports[_0x1b39('0x9')]=function(_0x1544b5){try{utils[_0x1b39('0xa')](util[_0x1b39('0xb')](_0x1b39('0xc'),_0x1544b5[_0x1b39('0x5')]),_0x1544b5);utils[_0x1b39('0x2')](util[_0x1b39('0xb')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1544b5[_0x1b39('0x5')],_0x1544b5[_0x1b39('0xd')],_0x1544b5[_0x1b39('0xe')],_0x1544b5['transfereecalleridnum'],_0x1544b5['transfereecalleridname']));_0x1544b5[_0x1b39('0x4')]='blind';exports[_0x1b39('0x8')][_0x1544b5[_0x1b39('0xf')]]=_0x1544b5;writeDB(_0x1544b5);}catch(_0x2a0859){utils[_0x1b39('0x10')](util[_0x1b39('0xb')]('[%s][transfers][blindtransfer]',_0x1544b5[_0x1b39('0x5')]),_0x2a0859);}};exports[_0x1b39('0x11')]=function(_0x3ca00b){try{utils['debug'](util[_0x1b39('0xb')]('[%s][transfers][attendedtransfer]',_0x3ca00b[_0x1b39('0x12')]),_0x3ca00b);utils[_0x1b39('0x2')](util[_0x1b39('0xb')](_0x1b39('0x13'),_0x3ca00b[_0x1b39('0x12')],_0x3ca00b[_0x1b39('0x14')],_0x3ca00b[_0x1b39('0x15')],_0x3ca00b['transfertargetcalleridnum'],_0x3ca00b[_0x1b39('0x16')]));_0x3ca00b=_['assign'](_0x3ca00b,{'transfererchannel':_0x3ca00b[_0x1b39('0x17')],'transferercalleridnum':_0x3ca00b['origtransferercalleridnum'],'transferercalleridname':_0x3ca00b[_0x1b39('0x15')],'transfererconnectedlinenum':_0x3ca00b[_0x1b39('0x18')],'transfererconnectedlinename':_0x3ca00b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3ca00b[_0x1b39('0x19')],'transferercontext':_0x3ca00b[_0x1b39('0x1a')],'transfererexten':_0x3ca00b['secondtransfererexten'],'transfererlinkedid':_0x3ca00b[_0x1b39('0x1b')],'context':_0x3ca00b['origtransferercontext'],'extension':_0x3ca00b[_0x1b39('0x1c')],'type':_0x1b39('0x1d')});if(_[_0x1b39('0x1e')](_0x3ca00b['transfereechannel'])){_0x3ca00b=_['assign'](_0x3ca00b,{'transfereechannel':_0x3ca00b[_0x1b39('0x1f')],'transfereecalleridnum':_0x3ca00b[_0x1b39('0x20')],'transfereecalleridname':_0x3ca00b[_0x1b39('0x16')],'transfereeconnectedlinenum':_0x3ca00b[_0x1b39('0x21')],'transfereeconnectedlinename':_0x3ca00b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3ca00b[_0x1b39('0x22')],'transfereecontext':_0x3ca00b['transfertargetcontext'],'transfereeexten':_0x3ca00b[_0x1b39('0x23')],'transfereelinkedid':_0x3ca00b[_0x1b39('0x24')]});}writeDB(_0x3ca00b);}catch(_0x52e3ef){utils[_0x1b39('0x10')](util[_0x1b39('0xb')](_0x1b39('0x25'),_0x3ca00b[_0x1b39('0x12')]),_0x52e3ef);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2f514d4..a618f33 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 _0xc0b3=['name','interface','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','length','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','GetUser'];(function(_0x3c52ec,_0x1992fc){var _0x1068b8=function(_0x30aa63){while(--_0x30aa63){_0x3c52ec['push'](_0x3c52ec['shift']());}};_0x1068b8(++_0x1992fc);}(_0xc0b3,0x78));var _0x3c0b=function(_0xc5676b,_0x5de501){_0xc5676b=_0xc5676b-0x0;var _0x40200b=_0xc0b3[_0xc5676b];return _0x40200b;};'use strict';var BPromise=require(_0x3c0b('0x0'));var jayson=require(_0x3c0b('0x1'));var moment=require(_0x3c0b('0x2'));var util=require(_0x3c0b('0x3'));var client=jayson[_0x3c0b('0x4')][_0x3c0b('0x5')]({'port':0x2329});var logger=require(_0x3c0b('0x6'))('xdr');exports[_0x3c0b('0x7')]=function(_0x499c51,_0x2cc5ad){logger[_0x3c0b('0x7')](_0x499c51,_0x2cc5ad?util['inspect'](_0x2cc5ad,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x10a852,_0x196856){logger[_0x3c0b('0x8')](_0x10a852,_0x196856?util[_0x3c0b('0x9')](_0x196856,{'showHidden':![],'depth':null}):'');};exports[_0x3c0b('0xa')]=function(_0x365f72,_0x2f9ad8){logger[_0x3c0b('0xa')](_0x365f72,_0x2f9ad8?util['inspect'](_0x2f9ad8,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x573935,_0x2df427){return client[_0x3c0b('0xb')](_0x573935,{'body':_0x2df427})[_0x3c0b('0xc')](function(_0x5160c8){logger[_0x3c0b('0x8')](_0x3c0b('0xd'),_0x573935,_0x5160c8?util['inspect'](_0x5160c8,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x47cba2){logger[_0x3c0b('0xa')]('[utils][request]\x20name:%s',_0x573935,_0x47cba2?util['inspect'](_0x47cba2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3aa071){return client[_0x3c0b('0xb')](_0x3c0b('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x3c0b('0xf'),_0x3c0b('0x10')],'where':_0x3aa071,'limit':0x1}})[_0x3c0b('0xc')](function(_0x2a9829){logger[_0x3c0b('0x8')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x3aa071),_0x2a9829?util[_0x3c0b('0x9')](_0x2a9829,{'showHidden':![],'depth':null}):'');return _0x2a9829[_0x3c0b('0x11')]['length']?_0x2a9829[_0x3c0b('0x11')][0x0]:null;});}exports[_0x3c0b('0x12')]=function(_0x13cb57){return new BPromise(function(_0x463f8f,_0x33b1c3){if(_0x13cb57){return getUser({'internal':_0x13cb57})['then'](function(_0x1098cb){logger['info'](_0x3c0b('0x13'),_0x13cb57,_0x1098cb?'found':_0x3c0b('0x14'));return _0x463f8f(_0x1098cb);})[_0x3c0b('0x15')](function(_0x45af08){logger['error'](_0x3c0b('0x16'),_0x45af08?util[_0x3c0b('0x9')](_0x45af08,{'showHidden':![],'depth':null}):'');return _0x463f8f(null);});}return _0x463f8f(null);});};exports[_0x3c0b('0x17')]=function(_0x2729a0){return new BPromise(function(_0x4e56fc,_0x3f1251){if(_0x2729a0){return getUser({'interface':_0x2729a0})[_0x3c0b('0xc')](function(_0x491679){logger[_0x3c0b('0x7')](_0x3c0b('0x18'),_0x2729a0,_0x491679?_0x3c0b('0x19'):'notfound');return _0x4e56fc(_0x491679);})['catch'](function(_0x4612a6){logger['error'](_0x3c0b('0x1a'),_0x4612a6?util['inspect'](_0x4612a6,{'showHidden':![],'depth':null}):'');return _0x4e56fc(null);});}return _0x4e56fc(null);});};exports[_0x3c0b('0x1b')]=function(_0x1f50aa){return new BPromise(function(_0x881a3e,_0x4982da){if(_0x1f50aa){return getUser({'name':_0x1f50aa})[_0x3c0b('0xc')](function(_0x568530){logger[_0x3c0b('0x7')](_0x3c0b('0x1c'),_0x1f50aa,_0x568530?_0x3c0b('0x19'):'notfound');return _0x881a3e(_0x568530);})[_0x3c0b('0x15')](function(_0x307547){logger[_0x3c0b('0xa')]('[utils][getUserByName]',_0x307547?util[_0x3c0b('0x9')](_0x307547,{'showHidden':![],'depth':null}):'');return _0x881a3e(null);});}return _0x881a3e(null);});};exports[_0x3c0b('0x1d')]=function(_0x11aa8a){return new BPromise(function(_0x166237,_0x3ad0ac){if(_0x11aa8a){return client[_0x3c0b('0xb')](_0x3c0b('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x3c0b('0xf'),_0x3c0b('0x1f'),'acw',_0x3c0b('0x20')],'where':{'name':_0x11aa8a},'limit':0x1}})['then'](function(_0x4713d0){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x11aa8a,_0x4713d0?util[_0x3c0b('0x9')](_0x4713d0,{'showHidden':![],'depth':null}):'');logger[_0x3c0b('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x11aa8a,_0x4713d0?_0x3c0b('0x19'):'notfound');return _0x166237(_0x4713d0['result'][_0x3c0b('0x21')]?_0x4713d0['result'][0x0]:null);})['catch'](function(_0x2dcb86){logger[_0x3c0b('0xa')](_0x3c0b('0x22'),_0x2dcb86?util[_0x3c0b('0x9')](_0x2dcb86,{'showHidden':![],'depth':null}):'');return _0x166237(null);});}return _0x166237(null);});};exports[_0x3c0b('0x23')]=function(_0x4801b7,_0x53ef67){return moment(_0x4801b7)['add'](_0x53ef67,_0x3c0b('0x24'))[_0x3c0b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x3c0b('0x26')]=function(_0x5ab7db,_0x5365d5){return moment(_0x5ab7db)['subtract'](_0x5365d5,_0x3c0b('0x24'))['format'](_0x3c0b('0x27'));};exports['diffTime']=function(_0x227f25,_0x1953d5){return moment(_0x227f25)[_0x3c0b('0x28')](moment(_0x1953d5),'seconds');};exports[_0x3c0b('0x29')]=function(_0x723ef5,_0x2b1fff){return parseInt(_0x723ef5,0xa)+parseInt(_0x2b1fff,0xa);};exports[_0x3c0b('0x2a')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x3c0b('0x2b')]=function(_0x3dbb3c,_0x1abf6a){if(_0x1abf6a){return moment(_0x3dbb3c)[_0x3c0b('0x2b')](_0x1abf6a);}return!![];};exports[_0x3c0b('0x2c')]=function(_0x5c577f,_0x138e08){if(_0x138e08){return moment(_0x5c577f)['isBefore'](_0x138e08);}else if(_0x5c577f){return!![];}return![];}; \ No newline at end of file +var _0x4afb=['info','debug','inspect','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','interface','[utils][getUser]\x20where:%s','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','error','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','xdr'];(function(_0x1d98ed,_0x252949){var _0x3d60f5=function(_0x40b8b1){while(--_0x40b8b1){_0x1d98ed['push'](_0x1d98ed['shift']());}};_0x3d60f5(++_0x252949);}(_0x4afb,0x93));var _0xb4af=function(_0x59e0e3,_0x656286){_0x59e0e3=_0x59e0e3-0x0;var _0x4d90c5=_0x4afb[_0x59e0e3];return _0x4d90c5;};'use strict';var BPromise=require(_0xb4af('0x0'));var jayson=require('jayson/promise');var moment=require(_0xb4af('0x1'));var util=require(_0xb4af('0x2'));var client=jayson[_0xb4af('0x3')][_0xb4af('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xb4af('0x5'));exports[_0xb4af('0x6')]=function(_0x3e879f,_0x2ff07b){logger[_0xb4af('0x6')](_0x3e879f,_0x2ff07b?util['inspect'](_0x2ff07b,{'showHidden':![],'depth':null}):'');};exports[_0xb4af('0x7')]=function(_0x335af8,_0x30dc84){logger[_0xb4af('0x7')](_0x335af8,_0x30dc84?util[_0xb4af('0x8')](_0x30dc84,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x308304,_0x1b8a7f){logger['error'](_0x308304,_0x1b8a7f?util[_0xb4af('0x8')](_0x1b8a7f,{'showHidden':![],'depth':null}):'');};exports[_0xb4af('0x9')]=function(_0x583deb,_0x10648a){return client['request'](_0x583deb,{'body':_0x10648a})[_0xb4af('0xa')](function(_0x38393f){logger[_0xb4af('0x7')]('[utils][request]\x20name:%s',_0x583deb,_0x38393f?util[_0xb4af('0x8')](_0x38393f,{'showHidden':![],'depth':null}):'');})[_0xb4af('0xb')](function(_0x11ef1d){logger['error'](_0xb4af('0xc'),_0x583deb,_0x11ef1d?util[_0xb4af('0x8')](_0x11ef1d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x22c503){return client[_0xb4af('0x9')](_0xb4af('0xd'),{'options':{'raw':!![],'attributes':['id',_0xb4af('0xe'),'name',_0xb4af('0xf')],'where':_0x22c503,'limit':0x1}})['then'](function(_0x515d0b){logger[_0xb4af('0x7')](_0xb4af('0x10'),JSON['stringify'](_0x22c503),_0x515d0b?util[_0xb4af('0x8')](_0x515d0b,{'showHidden':![],'depth':null}):'');return _0x515d0b['result'][_0xb4af('0x11')]?_0x515d0b[_0xb4af('0x12')][0x0]:null;});}exports[_0xb4af('0x13')]=function(_0x13ea08){return new BPromise(function(_0x1ceab7,_0x58f81c){if(_0x13ea08){return getUser({'internal':_0x13ea08})[_0xb4af('0xa')](function(_0x55800b){logger[_0xb4af('0x6')](_0xb4af('0x14'),_0x13ea08,_0x55800b?_0xb4af('0x15'):_0xb4af('0x16'));return _0x1ceab7(_0x55800b);})['catch'](function(_0x50dba5){logger['error'](_0xb4af('0x17'),_0x50dba5?util[_0xb4af('0x8')](_0x50dba5,{'showHidden':![],'depth':null}):'');return _0x1ceab7(null);});}return _0x1ceab7(null);});};exports[_0xb4af('0x18')]=function(_0x3ec8cc){return new BPromise(function(_0x3c10de,_0x322d85){if(_0x3ec8cc){return getUser({'interface':_0x3ec8cc})[_0xb4af('0xa')](function(_0x5c4b8e){logger[_0xb4af('0x6')](_0xb4af('0x19'),_0x3ec8cc,_0x5c4b8e?_0xb4af('0x15'):_0xb4af('0x16'));return _0x3c10de(_0x5c4b8e);})[_0xb4af('0xb')](function(_0x598f92){logger['error']('[utils][getUserByInterface]',_0x598f92?util['inspect'](_0x598f92,{'showHidden':![],'depth':null}):'');return _0x3c10de(null);});}return _0x3c10de(null);});};exports[_0xb4af('0x1a')]=function(_0x6b0a24){return new BPromise(function(_0x17ac56,_0x80a61b){if(_0x6b0a24){return getUser({'name':_0x6b0a24})[_0xb4af('0xa')](function(_0x51cae0){logger['info'](_0xb4af('0x1b'),_0x6b0a24,_0x51cae0?_0xb4af('0x15'):_0xb4af('0x16'));return _0x17ac56(_0x51cae0);})['catch'](function(_0x3f77f2){logger[_0xb4af('0x1c')](_0xb4af('0x1d'),_0x3f77f2?util[_0xb4af('0x8')](_0x3f77f2,{'showHidden':![],'depth':null}):'');return _0x17ac56(null);});}return _0x17ac56(null);});};exports[_0xb4af('0x1e')]=function(_0x40eedb){return new BPromise(function(_0x147c3a,_0x526397){if(_0x40eedb){return client['request'](_0xb4af('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xb4af('0x20'),_0xb4af('0x21'),_0xb4af('0x22'),'acwTimeout'],'where':{'name':_0x40eedb},'limit':0x1}})[_0xb4af('0xa')](function(_0x50528c){logger[_0xb4af('0x7')](_0xb4af('0x23'),_0x40eedb,_0x50528c?util['inspect'](_0x50528c,{'showHidden':![],'depth':null}):'');logger[_0xb4af('0x6')](_0xb4af('0x24'),_0x40eedb,_0x50528c?_0xb4af('0x15'):'notfound');return _0x147c3a(_0x50528c[_0xb4af('0x12')][_0xb4af('0x11')]?_0x50528c[_0xb4af('0x12')][0x0]:null);})[_0xb4af('0xb')](function(_0x59f588){logger['error'](_0xb4af('0x25'),_0x59f588?util[_0xb4af('0x8')](_0x59f588,{'showHidden':![],'depth':null}):'');return _0x147c3a(null);});}return _0x147c3a(null);});};exports[_0xb4af('0x26')]=function(_0x48bc44,_0x162766){return moment(_0x48bc44)[_0xb4af('0x27')](_0x162766,'seconds')[_0xb4af('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb4af('0x29')]=function(_0x449578,_0x1a9ed8){return moment(_0x449578)[_0xb4af('0x2a')](_0x1a9ed8,_0xb4af('0x2b'))[_0xb4af('0x28')](_0xb4af('0x2c'));};exports[_0xb4af('0x2d')]=function(_0x18d420,_0x2132bd){return moment(_0x18d420)[_0xb4af('0x2e')](moment(_0x2132bd),_0xb4af('0x2b'));};exports[_0xb4af('0x2f')]=function(_0x3a7dba,_0x32e76b){return parseInt(_0x3a7dba,0xa)+parseInt(_0x32e76b,0xa);};exports[_0xb4af('0x30')]=function(){return moment()[_0xb4af('0x28')](_0xb4af('0x2c'));};exports[_0xb4af('0x31')]=function(_0x155640,_0x5444e3){if(_0x5444e3){return moment(_0x155640)['isAfter'](_0x5444e3);}return!![];};exports[_0xb4af('0x32')]=function(_0x59e9aa,_0x522f91){if(_0x522f91){return moment(_0x59e9aa)[_0xb4af('0x32')](_0x522f91);}else if(_0x59e9aa){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 484e7ea..f59221d 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 _0x6954=['format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','/var','log','xcally','client','role','name','then','join','catch','user','no-user','data','timestamp','error','auth','set','use','logger','isEmpty','\x20body=%s','body'];(function(_0xa881b9,_0x3ba09b){var _0x1f6991=function(_0x182fe6){while(--_0x182fe6){_0xa881b9['push'](_0xa881b9['shift']());}};_0x1f6991(++_0x3ba09b);}(_0x6954,0xcd));var _0x4695=function(_0x2719d2,_0x2f7c26){_0x2719d2=_0x2719d2-0x0;var _0x51f58e=_0x6954[_0x2719d2];return _0x51f58e;};var fs=require(_0x4695('0x0'));var _=require(_0x4695('0x1'));var ewinston=require(_0x4695('0x2'));var path=require(_0x4695('0x3'));var util=require('util');var fileLogger=require(_0x4695('0x4'))[_0x4695('0x5')];var safeTemplate=require(_0x4695('0x6'))[_0x4695('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0x4695('0x8')];function ClientSideLogger(){function _0xd3fc89(_0x29b43b){var _0x2502bf=path['join'](_0x4695('0x9'),_0x4695('0xa'),_0x4695('0xb'));var _0xe943ef=path['join'](_0x4695('0xc'),_0x29b43b[_0x4695('0xd')]+'-'+_0x29b43b[_0x4695('0xe')]);return fs['ensureDir'](path['join'](_0x2502bf,_0xe943ef))[_0x4695('0xf')](function(){var _0x325d9b=fileLogger(_0x4695('0xc'),path[_0x4695('0x10')](_0x2502bf,_0xe943ef));return _0x325d9b;})[_0x4695('0x11')](function(_0x12ddca){throw _0x12ddca;});}this[_0x4695('0xa')]=function(_0x59af23,_0x449d6c,_0x562915,_0x1ef134){return _0xd3fc89(_0x59af23[_0x4695('0x12')])[_0x4695('0xf')](function(_0x220271){var _0x5dc5dd=_0x220271[_0x449d6c];return _0x5dc5dd;})[_0x4695('0xf')](function(_0x4ce9c2){var _0x1134f9=_0x59af23['user']?_0x59af23[_0x4695('0x12')]['id']:_0x4695('0x13');var _0x5d3b2c=_0x1ef134[_0x4695('0x14')];var _0x14686b=_0x1ef134[_0x4695('0x15')];var _0x504d04=new Date(Number(_0x14686b));return _0x4ce9c2(_0x1134f9,_0x504d04,_0x562915,_0x5d3b2c);})[_0x4695('0x11')](function(_0x14ea8b){fileLogger(_0x4695('0xc'))[_0x4695('0x16')](_0x14ea8b);});};}function setupLoggers(_0x327920){return new Promise(function(_0x5e6a38){var _0x2ae97b=new ClientSideLogger();var _0x254e08=fileLogger('api');var _0x4df1e6=fileLogger(_0x4695('0x17'));_0x327920[_0x4695('0x18')]('client-side-logger',_0x2ae97b);_0x327920[_0x4695('0x19')](ewinston[_0x4695('0x1a')]({'winstonInstance':_0x254e08,'meta':![],'statusLevels':!![],'msg':function(_0x24eebf,_0x488126){var _0x234850='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x4695('0x1b')](_0x24eebf['body'])){_0x234850+=_0x4695('0x1c');var _0x436032=_0x24eebf[_0x4695('0x1d')];maskSensitiveData(_0x436032);}return safeTemplate(util[_0x4695('0x1e')](_0x234850,_0x24eebf[_0x4695('0x1f')],_0x24eebf[_0x4695('0x20')]['x-forwarded-for']?_0x24eebf[_0x4695('0x20')][_0x4695('0x21')]:_0x24eebf[_0x4695('0x22')][_0x4695('0x23')]||_0x24eebf['ip'],_0x24eebf[_0x4695('0x24')],_0x488126[_0x4695('0x25')],_0x488126[_0x4695('0x26')],_0x24eebf['user']?_0x24eebf[_0x4695('0x12')]['id']:null,_0x24eebf[_0x4695('0x12')]?_0x24eebf['user'][_0x4695('0xe')]:null,_0x24eebf[_0x4695('0x12')]?_0x24eebf[_0x4695('0x12')][_0x4695('0xd')]:null,_0x436032?util[_0x4695('0x27')](_0x436032,![],null):''));}}));_0x327920['use'](ewinston[_0x4695('0x1a')]({'winstonInstance':_0x4df1e6,'meta':![],'statusLevels':!![],'msg':function(_0x41972c,_0x2aae33){var _0x1b0433=_0x4695('0x28');if(_0x41972c[_0x4695('0x1d')]&&_0x41972c[_0x4695('0x1d')][_0x4695('0x29')]&&_0x41972c['body'][_0x4695('0x2a')]){_0x1b0433='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x4695('0x1e')](_0x1b0433,_0x41972c['method'],_0x41972c['headers'][_0x4695('0x21')]?_0x41972c[_0x4695('0x20')][_0x4695('0x21')]:_0x41972c['connection'][_0x4695('0x23')]||_0x41972c['ip'],_0x41972c[_0x4695('0x24')],_0x2aae33[_0x4695('0x25')],_0x2aae33[_0x4695('0x26')],_0x41972c[_0x4695('0x12')]?_0x41972c[_0x4695('0x12')]['id']:null,_0x41972c[_0x4695('0x12')]?_0x41972c['user']['name']:null,_0x41972c[_0x4695('0x12')]?_0x41972c[_0x4695('0x12')][_0x4695('0xd')]:null,_0x41972c[_0x4695('0x1d')]&&_0x41972c[_0x4695('0x1d')]['device']?_0x41972c['body'][_0x4695('0x29')]:_0x4695('0x2b'),_0x41972c[_0x4695('0x1d')]&&_0x41972c['body'][_0x4695('0x2a')]?_0x41972c[_0x4695('0x1d')][_0x4695('0x2a')]:'',_0x41972c[_0x4695('0x1d')]&&_0x41972c[_0x4695('0x1d')][_0x4695('0x2c')]?_0x41972c[_0x4695('0x1d')]['agent_name']:'');},'ignoreRoute':function(_0x5859ea){var _0x398cec=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x398cec[_0x4695('0x2d')](_0x5859ea[_0x4695('0x24')]);}}));return _0x5e6a38();});}exports[_0x4695('0x2e')]=setupLoggers; \ No newline at end of file +var _0x1ea2=['\x20body=%s','body','headers','x-forwarded-for','connection','statusCode','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','other','agent_name','test','url','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','client','role','join','then','log','user','data','timestamp','catch','error','api','auth','set','client-side-logger','use','logger','isEmpty'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1ea2,0x96));var _0x21ea=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x1ea2[_0x3ec1da];return _0x472358;};var fs=require(_0x21ea('0x0'));var _=require(_0x21ea('0x1'));var ewinston=require(_0x21ea('0x2'));var path=require(_0x21ea('0x3'));var util=require('util');var fileLogger=require(_0x21ea('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x21ea('0x5')];var maskSensitiveData=require(_0x21ea('0x6'))[_0x21ea('0x7')];function ClientSideLogger(){function _0x797d4b(_0x237206){var _0x2976e5=path['join'](_0x21ea('0x8'),'log','xcally');var _0x32e8c0=path['join'](_0x21ea('0x9'),_0x237206[_0x21ea('0xa')]+'-'+_0x237206['name']);return fs['ensureDir'](path[_0x21ea('0xb')](_0x2976e5,_0x32e8c0))[_0x21ea('0xc')](function(){var _0x569479=fileLogger(_0x21ea('0x9'),path[_0x21ea('0xb')](_0x2976e5,_0x32e8c0));return _0x569479;})['catch'](function(_0x544728){throw _0x544728;});}this[_0x21ea('0xd')]=function(_0x5bf28d,_0x46bcee,_0x33b72b,_0x24230f){return _0x797d4b(_0x5bf28d[_0x21ea('0xe')])['then'](function(_0x21608f){var _0x132384=_0x21608f[_0x46bcee];return _0x132384;})[_0x21ea('0xc')](function(_0x17eb2b){var _0x481a07=_0x5bf28d[_0x21ea('0xe')]?_0x5bf28d[_0x21ea('0xe')]['id']:'no-user';var _0x118f24=_0x24230f[_0x21ea('0xf')];var _0x2cbb88=_0x24230f[_0x21ea('0x10')];var _0x2d40ef=new Date(Number(_0x2cbb88));return _0x17eb2b(_0x481a07,_0x2d40ef,_0x33b72b,_0x118f24);})[_0x21ea('0x11')](function(_0x12b662){fileLogger(_0x21ea('0x9'))[_0x21ea('0x12')](_0x12b662);});};}function setupLoggers(_0x281d3f){return new Promise(function(_0xf3fcd9){var _0x39859c=new ClientSideLogger();var _0x23d40a=fileLogger(_0x21ea('0x13'));var _0x102a68=fileLogger(_0x21ea('0x14'));_0x281d3f[_0x21ea('0x15')](_0x21ea('0x16'),_0x39859c);_0x281d3f[_0x21ea('0x17')](ewinston[_0x21ea('0x18')]({'winstonInstance':_0x23d40a,'meta':![],'statusLevels':!![],'msg':function(_0xadb3b2,_0x2ff9d7){var _0x276417='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x21ea('0x19')](_0xadb3b2['body'])){_0x276417+=_0x21ea('0x1a');var _0x1e8922=_0xadb3b2[_0x21ea('0x1b')];maskSensitiveData(_0x1e8922);}return safeTemplate(util['format'](_0x276417,_0xadb3b2['method'],_0xadb3b2['headers']['x-forwarded-for']?_0xadb3b2[_0x21ea('0x1c')][_0x21ea('0x1d')]:_0xadb3b2[_0x21ea('0x1e')]['remoteAddress']||_0xadb3b2['ip'],_0xadb3b2['url'],_0x2ff9d7[_0x21ea('0x1f')],_0x2ff9d7[_0x21ea('0x20')],_0xadb3b2['user']?_0xadb3b2[_0x21ea('0xe')]['id']:null,_0xadb3b2[_0x21ea('0xe')]?_0xadb3b2[_0x21ea('0xe')][_0x21ea('0x21')]:null,_0xadb3b2[_0x21ea('0xe')]?_0xadb3b2[_0x21ea('0xe')][_0x21ea('0xa')]:null,_0x1e8922?util[_0x21ea('0x22')](_0x1e8922,![],null):''));}}));_0x281d3f[_0x21ea('0x17')](ewinston[_0x21ea('0x18')]({'winstonInstance':_0x102a68,'meta':![],'statusLevels':!![],'msg':function(_0x4b2793,_0x277ffb){var _0x55baa0=_0x21ea('0x23');if(_0x4b2793[_0x21ea('0x1b')]&&_0x4b2793[_0x21ea('0x1b')][_0x21ea('0x24')]&&_0x4b2793[_0x21ea('0x1b')][_0x21ea('0x25')]){_0x55baa0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x55baa0,_0x4b2793['method'],_0x4b2793[_0x21ea('0x1c')][_0x21ea('0x1d')]?_0x4b2793['headers'][_0x21ea('0x1d')]:_0x4b2793[_0x21ea('0x1e')][_0x21ea('0x26')]||_0x4b2793['ip'],_0x4b2793['url'],_0x277ffb['statusCode'],_0x277ffb[_0x21ea('0x20')],_0x4b2793[_0x21ea('0xe')]?_0x4b2793['user']['id']:null,_0x4b2793[_0x21ea('0xe')]?_0x4b2793[_0x21ea('0xe')][_0x21ea('0x21')]:null,_0x4b2793[_0x21ea('0xe')]?_0x4b2793['user']['role']:null,_0x4b2793[_0x21ea('0x1b')]&&_0x4b2793['body'][_0x21ea('0x24')]?_0x4b2793['body'][_0x21ea('0x24')]:_0x21ea('0x27'),_0x4b2793[_0x21ea('0x1b')]&&_0x4b2793[_0x21ea('0x1b')][_0x21ea('0x25')]?_0x4b2793['body'][_0x21ea('0x25')]:'',_0x4b2793['body']&&_0x4b2793[_0x21ea('0x1b')][_0x21ea('0x28')]?_0x4b2793[_0x21ea('0x1b')][_0x21ea('0x28')]:'');},'ignoreRoute':function(_0x589693){var _0x49150d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x49150d[_0x21ea('0x29')](_0x589693[_0x21ea('0x2a')]);}}));return _0xf3fcd9();});}exports[_0x21ea('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 61d8ec4..a673383 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fc1=['consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','join','format','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','transports','Console','warn','%s-%s','error'];(function(_0x435038,_0x25c464){var _0x4793d5=function(_0x150f93){while(--_0x150f93){_0x435038['push'](_0x435038['shift']());}};_0x4793d5(++_0x25c464);}(_0x7fc1,0x158));var _0x17fc=function(_0x5fb81a,_0x5e9fdc){_0x5fb81a=_0x5fb81a-0x0;var _0x93cdcc=_0x7fc1[_0x5fb81a];return _0x93cdcc;};'use strict';var path=require(_0x17fc('0x0'));var util=require(_0x17fc('0x1'));var moment=require(_0x17fc('0x2'));var winston=require(_0x17fc('0x3'));var config=require(_0x17fc('0x4'));var debugLevel=config[_0x17fc('0x5')]?config[_0x17fc('0x5')][_0x17fc('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':_0x17fc('0x7'),'error':_0x17fc('0x8'),'warn':_0x17fc('0x9'),'info':_0x17fc('0xa'),'print':_0x17fc('0xb'),'success':_0x17fc('0xc'),'http':_0x17fc('0xd'),'verbose':'bold\x20magenta','debug':_0x17fc('0xe'),'silly':_0x17fc('0xf')};winston[_0x17fc('0x10')](XC_LOG_COLORS);function getLogFileName(_0x1f3820,_0x554276,_0x4321de){var _0x5dfc75=_0x1f3820||'/var/log/xcally';return path[_0x17fc('0x11')](_0x5dfc75,util[_0x17fc('0x12')]('%s-%s.log',_0x554276,_0x4321de));}function formatter(_0x482ff8,_0x297da8){_0x297da8[_0x17fc('0x13')]=_0x297da8['message']['replace'](/@@{/g,_0x17fc('0x14'))[_0x17fc('0x15')](/}@@/g,_0x17fc('0x16'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x17fc('0x12')](_0x17fc('0x17'),moment()[_0x17fc('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),_0x297da8[_0x17fc('0x18')][_0x17fc('0x19')](),_0x482ff8,_0x297da8[_0x17fc('0x13')]);}function fileFormat(_0x52eba1,_0x38d60c){_0x38d60c[_0x17fc('0x13')]=_0x38d60c[_0x17fc('0x13')][_0x17fc('0x15')](/@@{/g,'{{{')[_0x17fc('0x15')](/}@@/g,_0x17fc('0x16'))[_0x17fc('0x15')](/@{/g,'{{')[_0x17fc('0x15')](/}@/g,'}}');var _0x3a3f51=_0x38d60c[_0x17fc('0x1a')]&&Object[_0x17fc('0x1b')](_0x38d60c['meta'])['length']?'\x0a\x09'+JSON[_0x17fc('0x1c')](_0x38d60c[_0x17fc('0x1a')]):'';return util['format'](_0x17fc('0x1d'),moment()['format'](_0x17fc('0x1e')),_0x38d60c['level'][_0x17fc('0x19')](),_0x52eba1,_0x38d60c[_0x17fc('0x13')],_0x3a3f51);}function consoleLogger(){var _0x47b46c=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x17fc('0x1f'))][(_0x17fc('0x20'))]({'level':_0x17fc('0x21'),'json':![],'formatter':function(_0x2e2580){return formatter('',_0x2e2580);}})]});return _0x47b46c;}function fileLogger(_0x449a58,_0x545edf){var _0x41f27b=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x17fc('0x1f'))]['File']({'name':util[_0x17fc('0x12')](_0x17fc('0x22'),_0x449a58,_0x17fc('0x23')),'filename':getLogFileName(_0x545edf,_0x449a58,'error'),'level':_0x17fc('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x28f34b){return fileFormat(_0x449a58,_0x28f34b);}}),new winston['transports']['File']({'name':util[_0x17fc('0x12')]('%s-%s',_0x449a58,debugLevel),'filename':getLogFileName(_0x545edf,_0x449a58,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x587aef){return fileFormat(_0x449a58,_0x587aef);}}),new winston[(_0x17fc('0x1f'))][(_0x17fc('0x20'))]({'level':_0x17fc('0x21'),'json':![],'formatter':function(_0x537d9c){return fileFormat(_0x449a58,_0x537d9c);}})]});return _0x41f27b;}exports[_0x17fc('0x24')]=consoleLogger;exports[_0x17fc('0x25')]=fileLogger; \ No newline at end of file +var _0x03f9=['gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','message','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','path','util','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','white'];(function(_0x1b61ef,_0x52c3f5){var _0x86e1c3=function(_0x35c1e9){while(--_0x35c1e9){_0x1b61ef['push'](_0x1b61ef['shift']());}};_0x86e1c3(++_0x52c3f5);}(_0x03f9,0x132));var _0x903f=function(_0x3d790f,_0x3bbb4b){_0x3d790f=_0x3d790f-0x0;var _0x1a1e0c=_0x03f9[_0x3d790f];return _0x1a1e0c;};'use strict';var path=require(_0x903f('0x0'));var util=require(_0x903f('0x1'));var moment=require(_0x903f('0x2'));var winston=require('winston');var config=require(_0x903f('0x3'));var debugLevel=config[_0x903f('0x4')]?config[_0x903f('0x4')][_0x903f('0x5')]():_0x903f('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x903f('0x7'),'error':'red','warn':'bold\x20yellow','info':_0x903f('0x8'),'print':'bold\x20white','success':'bold\x20green','http':_0x903f('0x9'),'verbose':_0x903f('0xa'),'debug':_0x903f('0xb'),'silly':_0x903f('0xc')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3e8a17,_0x226bea,_0xa60a7a){var _0x3bf45f=_0x3e8a17||_0x903f('0xd');return path['join'](_0x3bf45f,util['format']('%s-%s.log',_0x226bea,_0xa60a7a));}function formatter(_0x380714,_0x283a50){_0x283a50['message']=_0x283a50[_0x903f('0xe')]['replace'](/@@{/g,'{{{')[_0x903f('0xf')](/}@@/g,_0x903f('0x10'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x903f('0x11')](_0x903f('0x12'),moment()[_0x903f('0x11')](_0x903f('0x13')),_0x283a50[_0x903f('0x14')][_0x903f('0x15')](),_0x380714,_0x283a50[_0x903f('0xe')]);}function fileFormat(_0x5b1b94,_0x3fd39d){_0x3fd39d['message']=_0x3fd39d[_0x903f('0xe')][_0x903f('0xf')](/@@{/g,_0x903f('0x16'))[_0x903f('0xf')](/}@@/g,'}}}')[_0x903f('0xf')](/@{/g,'{{')[_0x903f('0xf')](/}@/g,'}}');var _0xf0023c=_0x3fd39d[_0x903f('0x17')]&&Object[_0x903f('0x18')](_0x3fd39d[_0x903f('0x17')])[_0x903f('0x19')]?'\x0a\x09'+JSON[_0x903f('0x1a')](_0x3fd39d[_0x903f('0x17')]):'';return util[_0x903f('0x11')](_0x903f('0x1b'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x3fd39d[_0x903f('0x14')][_0x903f('0x15')](),_0x5b1b94,_0x3fd39d[_0x903f('0xe')],_0xf0023c);}function consoleLogger(){var _0x2d9054=new winston[(_0x903f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x903f('0x1d'))][(_0x903f('0x1e'))]({'level':_0x903f('0x1f'),'json':![],'formatter':function(_0x400d5a){return formatter('',_0x400d5a);}})]});return _0x2d9054;}function fileLogger(_0xd6511f,_0x251ee9){var _0x15a30b=new winston[(_0x903f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x903f('0x20'))]({'name':util[_0x903f('0x11')](_0x903f('0x21'),_0xd6511f,'error'),'filename':getLogFileName(_0x251ee9,_0xd6511f,_0x903f('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b0cce){return fileFormat(_0xd6511f,_0x2b0cce);}}),new winston[(_0x903f('0x1d'))][(_0x903f('0x20'))]({'name':util[_0x903f('0x11')](_0x903f('0x21'),_0xd6511f,debugLevel),'filename':getLogFileName(_0x251ee9,_0xd6511f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d13ef){return fileFormat(_0xd6511f,_0x4d13ef);}}),new winston[(_0x903f('0x1d'))][(_0x903f('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x49172b){return fileFormat(_0xd6511f,_0x49172b);}})]});return _0x15a30b;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 48381e0..cc4a4ea 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x1967,0x173));var _0x7196=function(_0x4062bc,_0x1dfb74){_0x4062bc=_0x4062bc-0x0;var _0x44d481=_0x1967[_0x4062bc];return _0x44d481;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb28,0x106));var _0x8db2=function(_0x4032ff,_0x58dc0f){_0x4032ff=_0x4032ff-0x0;var _0x12b679=_0xdb28[_0x4032ff];return _0x12b679;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e24d013..e26f9b4 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 _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x157c11,_0xadb8f2){var _0x1979c4=function(_0x2ab7e8){while(--_0x2ab7e8){_0x157c11['push'](_0x157c11['shift']());}};_0x1979c4(++_0xadb8f2);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0x8f4c[_0x1b2667];return _0x179ae8;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file +var _0x6e6c=['\x20}\x20}','replace','map','isPlainObject','keys','safeTemplate','lodash'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};var _=require(_0xc6e6('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x7267b){return _0x7267b==='{{'?'{\x20{\x20':_0xc6e6('0x1');}function safeTemplate(_0x1b63fe){var _0x58f303=_0x1b63fe;if(typeof _0x1b63fe==='string'){_0x58f303=_0x1b63fe[_0xc6e6('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1b63fe)){_0x58f303=_0x1b63fe[_0xc6e6('0x3')](function(_0x4b13f0){return safeTemplate(_0x4b13f0);});}else if(_[_0xc6e6('0x4')](_0x1b63fe)){_0x58f303=Object[_0xc6e6('0x5')](_0x1b63fe)['reduce'](function(_0x301f55,_0x30a10b){_0x301f55[_0x30a10b]=safeTemplate(_0x1b63fe[_0x30a10b]);return _0x301f55;},{});}return _0x58f303;}module['exports'][_0xc6e6('0x6')]=safeTemplate; \ No newline at end of file -- 1.7.1